Version 1.21.0

Merge 15400c01f06ddb8536afea6b5dad5099973e1aa3 into stable
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..96325ae
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,16 @@
+# Defines the Chromium style for automatic reformatting.
+# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
+BasedOnStyle: Chromium
+
+# Keep up to 2 blank lines. More blank lines are removed.
+MaxEmptyLinesToKeep: 2
+
+# clang-format doesn't seem to do a good job of this for longer comments.
+ReflowComments: 'false'
+
+# We have lots of these. Though we need to put them all in curly braces,
+# clang-format can't do that.
+AllowShortIfStatementsOnASingleLine: 'true'
+
+# Put escaped newlines into the rightmost column.
+AlignEscapedNewlinesLeft: false
diff --git a/.gitattributes b/.gitattributes
index 7e5534c..0f5ea98 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,8 +1,10 @@
+# Source files should not be normalized to avoid confusing clang-format-diff.py
+*.c text eol=lf
+*.cc text eol=lf
+*.cpp text eol=lf
+*.h text eol=lf
+
 # Explicitly declare text files we want to be normalized.
-*.c text
-*.cc text
-*.cpp text
-*.h text
 *.gyp text
 *.gypi text
 *.dart text
diff --git a/.gitignore b/.gitignore
index d399850..a0b469f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,6 +34,7 @@
 # IntelliJ project files
 *.iml
 .idea
+CMakeLists.txt
 
 # Built by chromebot and downloaded from Google Storage
 client/tests/drt
diff --git a/.packages b/.packages
index 4dbf1a4..1a6226d 100644
--- a/.packages
+++ b/.packages
@@ -35,6 +35,7 @@
 dev_compiler:pkg/dev_compiler/lib
 expect:pkg/expect/lib
 fixnum:third_party/pkg/fixnum/lib
+front_end:pkg/front_end/lib
 func:third_party/pkg/func/lib
 glob:third_party/pkg/glob/lib
 html:third_party/pkg/html/lib
@@ -49,7 +50,7 @@
 js_ast:pkg/js_ast/lib
 js_runtime:sdk/lib/_internal/js_runtime/lib
 json_rpc_2:third_party/pkg/json_rpc_2/lib
-kernel:third_party/pkg/kernel/lib
+kernel:pkg/kernel/lib
 linter:third_party/pkg/linter/lib
 logging:third_party/pkg/logging/lib
 lookup_map:pkg/lookup_map/lib
@@ -71,7 +72,6 @@
 pool:third_party/pkg/pool/lib
 protobuf:third_party/pkg/protobuf/lib
 pub:third_party/pkg/pub/lib
-pub_cache:third_party/pkg/pub_cache/lib
 pub_semver:third_party/pkg/pub_semver/lib
 quiver:third_party/pkg/quiver/lib
 resource:third_party/pkg/resource/lib
diff --git a/.travis.yml b/.travis.yml
index b8f5a00..f458e35 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -30,6 +30,15 @@
 
   - if [ "$CXX" ]; then $CXX --version ; fi
 
+  # Chrome install
+  - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
+  - wget https://dl.google.com/linux/direct/google-chrome-unstable_current_amd64.deb
+  - sudo dpkg -i google-chrome*.deb
+  - /usr/bin/google-chrome --version
+  - export CHROME_BIN=/usr/bin/google-chrome
+  - /usr/bin/google-chrome-unstable --version
+  - export CHROME_CANARY_BIN=/usr/bin/google-chrome-unstable
+
   # Install Depot Tools
   - git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
   - export PATH=`pwd`/depot_tools:"$PATH"
@@ -48,7 +57,6 @@
   # DDC setup
   - cd pkg/dev_compiler
   - pub global activate dart_coveralls
-  - export CHROME_CANARY_BIN=`./tool/get_chrome_canary.sh`
   - export DISPLAY=:99.0
   - sh -e /etc/init.d/xvfb start
 install:
@@ -62,18 +70,19 @@
   - if [[ -z "$TEST" ]]; then ./tool/presubmit.sh ; fi
   - if [[ "$TEST" == coverage ]]; then ./tool/build_sdk.sh && ./tool/coverage.sh ; fi
   - if [[ "$TEST" == node ]]; then ./tool/node_test.sh ; fi
+  - if [[ "$TEST" == package ]]; then ./tool/build_sdk.sh && ./tool/build_pkgs.dart ; fi
 env:
   - ANALYZER=master
   - ANALYZER=master DDC_BROWSERS=Firefox
+  - ANALYZER=master DDC_BROWSERS=ChromeCanaryTravis
   - ANALYZER=master CXX=g++
   - ANALYZER=master CXX=clang++
   - TEST=coverage
-  - TEST=node
+  - TEST=package
 matrix:
   allow_failures:
-    - env: TEST=node
-    - env: ANALYZER=master DDC_BROWSERS=Firefox
     - env: ANALYZER=master CXX=g++
+    - env: ANALYZER=master DDC_BROWSERS=ChromeCanaryTravis
 notifications:
   email:
     recipients:
diff --git a/BUILD.gn b/BUILD.gn
index d86d84a..a027a2e 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -9,13 +9,159 @@
   ]
 }
 
+group("most") {
+  deps = [
+    ":analysis_server",
+    ":create_sdk",
+    ":dart2js",
+    ":dartanalyzer",
+    ":dartdevc",
+    ":runtime",
+    ":samples",
+  ]
+}
+
 group("runtime") {
   deps = [
-    "//runtime/bin:dart",
-    "//runtime/bin:dart_bootstrap($host_toolchain)",
-    "//runtime/bin:run_vm_tests",
-    "//runtime/bin:process_test",
-    "//runtime/bin:test_extension",
-    "//runtime/bin:sample_extension",
+    "runtime/bin:dart",
+    "runtime/bin:dart_bootstrap($host_toolchain)",
+    "runtime/bin:process_test",
+    "runtime/bin:run_vm_tests",
+    "runtime/bin:sample_extension",
+    "runtime/bin:test_extension",
+    "runtime/vm:patched_sdk",
+  ]
+}
+
+group("runtime_precompiled") {
+  deps = [
+    "runtime/bin:dart_bootstrap($host_toolchain)",
+    "runtime/bin:dart_precompiled_runtime",
+    "runtime/vm:patched_sdk",
+  ]
+}
+
+group("runtime_and_noopt") {
+  deps = [
+    "runtime/bin:dart",
+    "runtime/bin:dart_bootstrap($host_toolchain)",
+    "runtime/bin:dart_noopt",
+    "runtime/bin:process_test",
+    "runtime/bin:run_vm_tests",
+    "runtime/bin:sample_extension",
+    "runtime/bin:test_extension",
+    "runtime/vm:patched_sdk",
+  ]
+}
+
+action("create_sdk") {
+  deps = [
+    "runtime/bin:dart",
+    "utils/analysis_server",
+    "utils/compiler:dart2js",
+    "utils/compiler:utils_wrapper",
+    "utils/dartanalyzer:generate_dartanalyzer_snapshot",
+    "utils/dartanalyzer:generate_summary_spec",
+    "utils/dartanalyzer:generate_summary_strong",
+    "utils/dartdevc",
+    "utils/dartdoc",
+    "utils/dartfmt",
+    "utils/pub",
+  ]
+
+  sdk_lib_files = exec_script("tools/list_dart_files.py",
+                              [ rebase_path("sdk/lib") ],
+                              "list lines")
+
+  preamble_files =
+      exec_script("tools/list_files.py",
+                  [
+                    "",
+                    rebase_path("sdk/lib/_internal/js_runtime/lib/preambles"),
+                  ],
+                  "list lines")
+
+  sdk_bin_files = exec_script("tools/list_files.py",
+                              [
+                                "",
+                                rebase_path("sdk/bin"),
+                              ],
+                              "list lines")
+
+  inputs = rebase_path(sdk_lib_files, "", "sdk/lib") +
+           rebase_path(preamble_files, "", "sdk/lib") +
+           rebase_path(sdk_bin_files, "", "sdk/bin") +
+           [
+             "sdk/lib/dart_client.platform",
+             "sdk/lib/dart_server.platform",
+             "sdk/lib/dart_shared.platform",
+             "$root_gen_dir/dart2js.dart.snapshot",
+             "$root_gen_dir/utils_wrapper.dart.snapshot",
+             "$root_gen_dir/pub.dart.snapshot",
+             "$root_gen_dir/dartanalyzer.dart.snapshot",
+             "$root_gen_dir/dartdevc.dart.snapshot",
+             "$root_gen_dir/dartfmt.dart.snapshot",
+             "$root_gen_dir/analysis_server.dart.snapshot",
+             "$root_gen_dir/dartdoc.dart.snapshot",
+             "$root_gen_dir/spec.sum",
+             "$root_gen_dir/strong.sum",
+             "tools/VERSION",
+           ]
+
+  outputs = [
+    "$root_out_dir/dart-sdk/README",
+  ]
+
+  script = "tools/create_sdk.py"
+  args = [
+    "--sdk_output_dir",
+    rebase_path("$root_out_dir/dart-sdk"),
+    "--snapshot_location",
+    rebase_path("$root_gen_dir"),
+  ]
+}
+
+group("dart2js") {
+  deps = [
+    "utils/compiler:dart2js",
+  ]
+}
+
+group("dartanalyzer") {
+  deps = [
+    "utils/dartanalyzer",
+  ]
+}
+
+group("dartdevc") {
+  deps = [
+    "utils/dartdevc",
+  ]
+}
+
+group("dartfmt") {
+  deps = [
+    "utils/dartfmt",
+  ]
+}
+
+group("analysis_server") {
+  deps = [
+    "utils/analysis_server",
+  ]
+}
+
+# This is the target that is built on the dart2js build bots.
+# It must depend on anything that is required by the dart2js
+# test suites.
+group("dart2js_bot") {
+  deps = [
+    ":create_sdk",
+  ]
+}
+
+group("samples") {
+  deps = [
+    "runtime/bin:sample_extension",
   ]
 }
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d4a80ae..141f621 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,9 +1,54 @@
+## 1.21.0 - 2016-12-07
+
+### Language
+
+* Support generic method syntax. Type arguments are not available at
+  runtime. For details, check the
+  [informal specification](https://gist.github.com/eernstg/4353d7b4f669745bed3a5423e04a453c).
+* Support access to initializing formals, e.g., the use of `x` to initialize
+ `y` in `class C { var x, y; C(this.x): y = x; }`.
+  Please check the
+  [informal specification](https://gist.github.com/eernstg/cff159be9e34d5ea295d8c24b1a3e594)
+  for details.
+* Don't warn about switch case fallthrough if the case ends in a `rethrow`
+  statement.
+* Also don't warn if the entire switch case is wrapped in braces - as long as
+  the block ends with a `break`, `continue`, `rethrow`, `return` or `throw`.
+* Allow `=` as well as `:` as separator for named parameter default values.
+
+### Core library changes
+
+* `dart:core`: `Set.difference` now takes a `Set<Object>` as argument.
+
+* `dart:developer`:
+  * The service protocol http server can now be controlled from Dart code.
+
+### Tool changes
+
+* Dart Dev Compiler
+
+  * Support calls to `loadLibrary()` on deferred libraries. Deferred libraries
+    are still loaded eagerly. (#27343)
+
 ## 1.20.1 - 2016-10-13
 
 Patch release, resolves one issue:
 
 * Dartium: Fixes a bug that caused crashes.  No issue filed
 
+### Strong Mode
+
+* It is no longer a warning when casting from dynamic to a composite type
+    (SDK issue [27766](https://github.com/dart-lang/sdk/issues/27766)).
+
+    ```dart
+    main() {
+      dynamic obj = <int>[1, 2, 3];
+      // This is now allowed without a warning.
+      List<int> list = obj;
+    }
+    ```
+
 ## 1.20.0 - 2016-10-11
 
 ### Dart VM
diff --git a/DEPS b/DEPS
index 83b2770..4f5d541 100644
--- a/DEPS
+++ b/DEPS
@@ -28,54 +28,54 @@
   "github_dartlang": "https://github.com/dart-lang/%s.git",
 
   "gyp_rev": "@6ee91ad8659871916f9aa840d42e1513befdf638",
-  "co19_rev": "@d4767b4caea3c5828ad8e053cd051d44a59061af",
+  "co19_rev": "@f05d5aee5930bfd487aedf832fbd7b832f502b15",
 
   # Revisions of GN related dependencies.
-  "buildtools_revision": "@3d2e47bf14e4e67816a53e304dea422fa18f9180",
+  "buildtools_revision": "@39b1db2ab4aa4b2ccaa263c29bdf63e7c1ee28aa",
+  "clang_format_rev": "@0ed791d1387a3c9146ea6c453c646f3c0fc97784",
 
-  "gperftools_revision": "@7822b5b0b9fa7e016e1f6b46ea86f26f4691a457",
+  "gperftools_revision": "@02eeed29df112728564a5dde6417fa4622b57a06",
 
   # Revisions of /third_party/* dependencies.
   "args_tag": "@0.13.5",
-  "async_tag": "@1.11.1",
+  "async_tag": "@1.11.3",
   "barback-0.13.0_rev": "@34853",
   "barback-0.14.0_rev": "@36398",
   "barback-0.14.1_rev": "@38525",
   "barback_tag" : "@0.15.2+9",
   "bazel_worker_tag": "@0.1.1",
   "boolean_selector_tag" : "@1.0.2",
-  "boringssl_gen_rev": "@922830c0aad900dd3d143eef1ba06faa83fe263b",
+  "boringssl_gen_rev": "@62c20247d582444cb2804f9ea4e3abaa6e47f6a5",
   "boringssl_rev" : "@8d343b44bbab829d1a28fdef650ca95f7db4412e",
   "charcode_tag": "@1.1.0",
   "chrome_rev" : "@19997",
   "cli_util_tag" : "@0.0.1+3",
   "code_transformers_tag": "@v0.4.2+3",
-  "collection_tag": "@1.9.1",
+  "collection_tag": "@1.10.1",
   "convert_tag": "@2.0.1",
   "crypto_tag" : "@2.0.1",
   "csslib_tag" : "@0.13.2",
-  "dart2js_info_tag" : "@0.2.7+1",
+  "dart2js_info_tag" : "@0.5.0",
   "dart_services_rev" : "@7aea2574e6f3924bf409a80afb8ad52aa2be4f97",
-  "dart_style_tag": "@0.2.10",
-  "dartdoc_tag" : "@v0.9.7+6",
+  "dart_style_tag": "@0.2.13",
+  "dartdoc_tag" : "@v0.9.8",
   "fixnum_tag": "@0.10.5",
   "func_tag": "@0.1.0",
   "glob_tag": "@1.1.3",
-  "html_tag" : "@0.13.0",
+  "html_tag" : "@0.13.1",
   "http_multi_server_tag" : "@2.0.2",
-  "http_parser_tag" : "@3.0.2",
+  "http_parser_tag" : "@3.0.3",
   "http_tag" : "@0.11.3+9",
   "http_throttle_rev" : "@284344cd357e435c6c8ff9a4a21f02b9e384a541",
   "idl_parser_rev": "@7fbe68cab90c38147dee4f48c30ad0d496c17915",
   "initialize_tag": "@v0.6.2+2",
-  "intl_tag": "@0.13.1",
+  "intl_tag": "@0.14.0",
   "isolate_tag": "@0.2.3",
   "jinja2_rev": "@2222b31554f03e62600cd7e383376a7c187967a1",
   "json_rpc_2_tag": "@2.0.2",
-  "kernel_rev": "@449803b82e850a41148e636db1a6e4a848284aed",
-  "linter_tag": "@0.1.27",
+  "linter_tag": "@0.1.29",
   "logging_tag": "@0.11.3+1",
-  "markdown_rev": "@4aaadf3d940bb172e1f6285af4d2b1710d309982",
+  "markdown_tag": "@0.11.0",
   "matcher_tag": "@0.12.0+2",
   "metatest_tag": "@0.2.2+2",
   "mime_rev": "@75890811d4af5af080351ba8a2853ad4c8df98dd",
@@ -90,7 +90,6 @@
   "ply_rev": "@604b32590ffad5cbb82e4afef1d305512d06ae93",
   "pool_tag": "@1.2.4",
   "protobuf_tag": "@0.5.3",
-  "pub_cache_tag": "@v0.1.0",
   "pub_rev": "@3dd04bd17ba269ccdd34502a253041dd96ded3be",
   "pub_semver_tag": "@1.3.0",
   "quiver_tag": "@0.22.0",
@@ -104,13 +103,13 @@
   "smoke_tag" : "@v0.3.6+2",
   "source_map_stack_trace_tag": "@1.1.3",
   "source_maps-0.9.4_rev": "@38524",
-  "source_maps_tag": "@0.10.1+1",
-  "source_span_tag": "@1.2.3",
+  "source_maps_tag": "@0.10.1+2",
+  "source_span_tag": "@1.2.4",
   "stack_trace_tag": "@1.6.6",
   "stream_channel_tag": "@1.5.0",
   "string_scanner_tag": "@1.0.0",
   "sunflower_rev": "@879b704933413414679396b129f5dfa96f7a0b1e",
-  "test_reflective_loader_tag": "@0.0.4",
+  "test_reflective_loader_tag": "@0.1.0",
   "test_tag": "@0.12.15+6",
   "typed_data_tag": "@1.1.3",
   "usage_tag": "@v2.2.2",
@@ -121,7 +120,7 @@
   "WebCore_rev": "@a86fe28efadcfc781f836037a80f27e22a5dad17",
   "when_tag": "@0.2.0+2",
   "which_tag": "@0.1.3+1",
-  "yaml_tag": "@2.1.10",
+  "yaml_tag": "@2.1.11",
   "zlib_rev": "@c3d0a6190f2f8c924a05ab6cc97b8f975bddd33f",
 }
 
@@ -134,6 +133,9 @@
   Var("dart_root") + "/buildtools":
      Var('chromium_git') + '/chromium/buildtools.git' +
      Var('buildtools_revision'),
+  Var("dart_root") + "/buildtools/clang_format/script":
+    Var("chromium_git") + "/chromium/llvm-project/cfe/tools/clang-format.git" +
+    Var("clang_format_rev"),
 
   Var("dart_root") + "/tests/co19/src":
       (Var("github_mirror") % "co19") + Var("co19_rev"),
@@ -232,14 +234,12 @@
       (Var("github_dartlang") % "isolate") + Var("isolate_tag"),
   Var("dart_root") + "/third_party/pkg/json_rpc_2":
       (Var("github_mirror") % "json_rpc_2") + Var("json_rpc_2_tag"),
-  Var("dart_root") + "/third_party/pkg/kernel":
-      (Var("github_mirror") % "kernel") + Var("kernel_rev"),
   Var("dart_root") + "/third_party/pkg/linter":
       (Var("github_mirror") % "linter") + Var("linter_tag"),
   Var("dart_root") + "/third_party/pkg/logging":
       (Var("github_mirror") % "logging") + Var("logging_tag"),
   Var("dart_root") + "/third_party/pkg/markdown":
-      (Var("github_mirror") % "markdown") + Var("markdown_rev"),
+      (Var("github_mirror") % "markdown") + Var("markdown_tag"),
   Var("dart_root") + "/third_party/pkg/matcher":
       (Var("github_mirror") % "matcher") + Var("matcher_tag"),
   Var("dart_root") + "/third_party/pkg/metatest":
@@ -275,8 +275,6 @@
       (Var("github_mirror") % "pub_semver") + Var("pub_semver_tag"),
   Var("dart_root") + "/third_party/pkg/pub":
       (Var("github_mirror") % "pub") + Var("pub_rev"),
-  Var("dart_root") + "/third_party/pkg/pub_cache":
-      (Var("github_mirror") % "pub_cache") + Var("pub_cache_tag"),
   Var("dart_root") + "/third_party/pkg/quiver":
       Var("chromium_git")
       + "/external/github.com/google/quiver-dart.git"
@@ -406,6 +404,21 @@
   },
   # Pull clang-format binaries using checked-in hashes.
   {
+    'name': 'clang_format_win',
+    'pattern': '.',
+    'action': [
+      'download_from_google_storage',
+      '--no_auth',
+      '--no_resume',
+      '--quiet',
+      '--platform=win32',
+      '--bucket',
+      'chromium-clang-format',
+      '-s',
+      Var('dart_root') + '/buildtools/win/clang-format.exe.sha1',
+    ],
+  },
+  {
     'name': 'clang_format_linux',
     'pattern': '.',
     'action': [
@@ -496,20 +509,6 @@
     ],
   },
   {
-    "name": "petitparser",
-    "pattern": ".",
-    "action": [
-      "download_from_google_storage",
-      "--no_auth",
-      "--no_resume",
-      "--bucket",
-      "dart-dependencies",
-      "--extract",
-      "-s",
-      Var('dart_root') + "/third_party/pkg/petitparser.tar.gz.sha1",
-    ],
-  },
-  {
     "name": "unittest",
     # Unittest is an early version, 0.11.6, of the package "test"
     # Do not use it in any new tests.
@@ -570,13 +569,33 @@
     ],
   },
   {
+    # Pull Debian wheezy sysroot for i386 Linux
+    'name': 'sysroot_i386',
+    'pattern': '.',
+    'action': ['python', 'sdk/build/linux/sysroot_scripts/install-sysroot.py',
+               '--running-as-hook', '--arch', 'i386'],
+  },
+  {
+    # Pull Debian wheezy sysroot for amd64 Linux
+    'name': 'sysroot_amd64',
+    'pattern': '.',
+    'action': ['python', 'sdk/build/linux/sysroot_scripts/install-sysroot.py',
+               '--running-as-hook', '--arch', 'amd64'],
+  },
+  {
     # Pull clang if needed or requested via GYP_DEFINES.
     'name': 'gn_clang',
     'pattern': '.',
     'action': ['python', 'sdk/tools/clang/scripts/update.py', '--if-needed'],
   },
   {
+    # Update the Windows toolchain if necessary.
+    'name': 'win_toolchain',
+    'pattern': '.',
+    'action': ['python', 'sdk/build/vs_toolchain.py', 'update'],
+  },
+  {
     "pattern": ".",
-    "action": ["python", Var("dart_root") + "/tools/gyp_dart.py"],
+    "action": ["python", Var("dart_root") + "/tools/generate_buildfiles.py"],
   },
 ]
diff --git a/README.md b/README.md
index a95407c..e2a2f1e 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@
 
 ## Building Dart
 
-Learn how to [get the source](https://github.com/dart-lang/sdk/wiki/Getting-The-Source)
+Learn how to [get the source](https://github.com/dart-lang/sdk/wiki/Building#getting-the-source)
 and [prepare your machine to build the SDK](https://github.com/dart-lang/sdk/wiki/Preparing-your-machine-to-build-the-Dart-SDK).
 
 There are more documents on our [wiki](https://github.com/dart-lang/sdk/wiki).
diff --git a/build/.gitignore b/build/.gitignore
new file mode 100644
index 0000000..56c0181
--- /dev/null
+++ b/build/.gitignore
@@ -0,0 +1,6 @@
+# Generated file containing information about the VS toolchain on Windows
+win_toolchain.json
+
+# Pulled Debian wheezy sysroots
+linux/debian_wheezy_amd64-sysroot
+linux/debian_wheezy_i386-sysroot
diff --git a/build/OWNERS b/build/OWNERS
deleted file mode 100644
index 17d067c..0000000
--- a/build/OWNERS
+++ /dev/null
@@ -1,5 +0,0 @@
-cjhopman@chromium.org
-dpranke@chromium.org
-jochen@chromium.org
-scottmg@chromium.org
-thakis@chromium.org
diff --git a/build/PRESUBMIT.py b/build/PRESUBMIT.py
deleted file mode 100644
index fca962f..0000000
--- a/build/PRESUBMIT.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-
-def _RunTests(input_api, output_api):
-  return (input_api.canned_checks.RunUnitTestsInDirectory(
-          input_api, output_api, '.', whitelist=[r'.+_test.py$']))
-
-
-def CheckChangeOnUpload(input_api, output_api):
-  return _RunTests(input_api, output_api)
-
-
-def CheckChangeOnCommit(input_api, output_api):
-  return _RunTests(input_api, output_api)
diff --git a/build/README.chromium b/build/README.chromium
deleted file mode 100644
index 012df35..0000000
--- a/build/README.chromium
+++ /dev/null
@@ -1,15 +0,0 @@
-List of property sheets to be included by projects:
-  common.vsprops
-    Not used anymore. No-op. Kept for compatibility with current projects.
-
-  debug.vsprops
-    Enables debug settings. Must be included directly in Debug configuration. Includes internal\essential.vsprops.
-
-  external_code.vsprops
-    Contains settings made to simplify usage of external (non-Google) code. It relaxes the warning levels. Should be included after debug.vsprops or release.vsprops to override their settings.
-
-  output_dll_copy.rules
-    Run to enable automatic copy of DLL when they are as an input file in a vcproj project.
-
-  release.vsprops
-    Enables release settings. Must be included directly in Release configuration. Includes internal\essential.vsprops. Also includes "internal\release_impl$(CHROME_BUILD_TYPE).vsprops". So the behavior is dependant on the CHROME_BUILD_TYPE environment variable.
diff --git a/build/all.gyp b/build/all.gyp
deleted file mode 100644
index b36fae6..0000000
--- a/build/all.gyp
+++ /dev/null
@@ -1,1442 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'variables': {
-    # A hook that can be overridden in other repositories to add additional
-    # compilation targets to 'All'.
-    'app_targets%': [],
-    # For Android-specific targets.
-    'android_app_targets%': [],
-  },
-  'targets': [
-    {
-      'target_name': 'All',
-      'type': 'none',
-      'xcode_create_dependents_test_runner': 1,
-      'dependencies': [
-        '<@(app_targets)',
-        'some.gyp:*',
-        '../base/base.gyp:*',
-        '../components/components.gyp:*',
-        '../components/components_tests.gyp:*',
-        '../content/content.gyp:*',
-        '../crypto/crypto.gyp:*',
-        '../net/net.gyp:*',
-        '../sdch/sdch.gyp:*',
-        '../sql/sql.gyp:*',
-        '../testing/gmock.gyp:*',
-        '../testing/gtest.gyp:*',
-        '../third_party/icu/icu.gyp:*',
-        '../third_party/libxml/libxml.gyp:*',
-        '../third_party/sqlite/sqlite.gyp:*',
-        '../third_party/zlib/zlib.gyp:*',
-        '../ui/accessibility/accessibility.gyp:*',
-        '../ui/base/ui_base.gyp:*',
-        '../ui/display/display.gyp:display_unittests',
-        '../ui/snapshot/snapshot.gyp:*',
-        '../url/url.gyp:*',
-      ],
-      'conditions': [
-        ['OS!="ios" and OS!="mac"', {
-          'dependencies': [
-            '../ui/touch_selection/ui_touch_selection.gyp:*',
-          ],
-        }],
-        ['OS=="ios"', {
-          'dependencies': [
-            '../chrome/chrome.gyp:browser',
-            '../chrome/chrome.gyp:browser_ui',
-            '../ios/ios.gyp:*',
-            # NOTE: This list of targets is present because
-            # mojo_base.gyp:mojo_base cannot be built on iOS, as
-            # javascript-related targets cause v8 to be built.
-            '../mojo/mojo_base.gyp:mojo_common_lib',
-            '../mojo/mojo_base.gyp:mojo_common_unittests',
-            '../google_apis/google_apis.gyp:google_apis_unittests',
-            '../skia/skia_tests.gyp:skia_unittests',
-            '../third_party/mojo/mojo_edk.gyp:mojo_system_impl',
-            '../third_party/mojo/mojo_edk_tests.gyp:mojo_public_bindings_unittests',
-            '../third_party/mojo/mojo_edk_tests.gyp:mojo_public_environment_unittests',
-            '../third_party/mojo/mojo_edk_tests.gyp:mojo_public_system_unittests',
-            '../third_party/mojo/mojo_edk_tests.gyp:mojo_public_utility_unittests',
-            '../third_party/mojo/mojo_edk_tests.gyp:mojo_system_unittests',
-            '../third_party/mojo/mojo_public.gyp:mojo_cpp_bindings',
-            '../third_party/mojo/mojo_public.gyp:mojo_public_test_utils',
-            '../third_party/mojo/mojo_public.gyp:mojo_system',
-            '../ui/base/ui_base_tests.gyp:ui_base_unittests',
-            '../ui/gfx/gfx_tests.gyp:gfx_unittests',
-          ],
-        }],
-        ['OS=="android"', {
-          'dependencies': [
-            '../content/content_shell_and_tests.gyp:content_shell_apk',
-            '<@(android_app_targets)',
-            'android_builder_tests',
-            '../tools/telemetry/telemetry.gyp:*#host',
-            # TODO(nyquist) This should instead by a target for sync when all of
-            # the sync-related code for Android has been upstreamed.
-            # See http://crbug.com/159203
-            '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_javalib',
-          ],
-          'conditions': [
-            ['chromecast==0', {
-              'dependencies': [
-                '../android_webview/android_webview.gyp:android_webview_apk',
-                '../android_webview/android_webview.gyp:system_webview_apk',
-                '../android_webview/android_webview_shell.gyp:android_webview_shell_apk',
-                '../chrome/android/chrome_apk.gyp:chrome_public_apk',
-                '../chrome/chrome.gyp:chrome_shell_apk',
-                '../chrome/chrome.gyp:chrome_sync_shell_apk',
-                '../remoting/remoting.gyp:remoting_apk',
-              ],
-            }],
-            # TODO: Enable packed relocations for x64. See: b/20532404
-            ['target_arch != "x64"', {
-              'dependencies': [
-                '../third_party/android_platform/relocation_packer.gyp:android_relocation_packer_unittests#host',
-              ],
-            }],
-          ],
-        }, {
-          'dependencies': [
-            '../content/content_shell_and_tests.gyp:*',
-            # TODO: This should build on Android and the target should move to the list above.
-            '../sync/sync.gyp:*',
-          ],
-        }],
-        ['OS!="ios" and OS!="android" and chromecast==0', {
-          'dependencies': [
-            '../third_party/re2/re2.gyp:re2',
-            '../chrome/chrome.gyp:*',
-            '../chrome/tools/profile_reset/jtl_compiler.gyp:*',
-            '../cc/blink/cc_blink_tests.gyp:*',
-            '../cc/cc_tests.gyp:*',
-            '../device/usb/usb.gyp:*',
-            '../extensions/extensions.gyp:*',
-            '../extensions/extensions_tests.gyp:*',
-            '../gin/gin.gyp:*',
-            '../gpu/gpu.gyp:*',
-            '../gpu/tools/tools.gyp:*',
-            '../ipc/ipc.gyp:*',
-            '../ipc/mojo/ipc_mojo.gyp:*',
-            '../jingle/jingle.gyp:*',
-            '../media/cast/cast.gyp:*',
-            '../media/media.gyp:*',
-            '../media/midi/midi.gyp:*',
-            '../mojo/mojo.gyp:*',
-            '../mojo/mojo_base.gyp:*',
-            '../ppapi/ppapi.gyp:*',
-            '../ppapi/ppapi_internal.gyp:*',
-            '../ppapi/tools/ppapi_tools.gyp:*',
-            '../printing/printing.gyp:*',
-            '../skia/skia.gyp:*',
-            '../sync/tools/sync_tools.gyp:*',
-            '../third_party/WebKit/public/all.gyp:*',
-            '../third_party/cacheinvalidation/cacheinvalidation.gyp:*',
-            '../third_party/codesighs/codesighs.gyp:*',
-            '../third_party/ffmpeg/ffmpeg.gyp:*',
-            '../third_party/iccjpeg/iccjpeg.gyp:*',
-            '../third_party/libpng/libpng.gyp:*',
-            '../third_party/libusb/libusb.gyp:*',
-            '../third_party/libwebp/libwebp.gyp:*',
-            '../third_party/libxslt/libxslt.gyp:*',
-            '../third_party/lzma_sdk/lzma_sdk.gyp:*',
-            '../third_party/mesa/mesa.gyp:*',
-            '../third_party/modp_b64/modp_b64.gyp:*',
-            '../third_party/npapi/npapi.gyp:*',
-            '../third_party/ots/ots.gyp:*',
-            '../third_party/pdfium/samples/samples.gyp:*',
-            '../third_party/qcms/qcms.gyp:*',
-            '../tools/gn/gn.gyp:*',
-            '../tools/perf/clear_system_cache/clear_system_cache.gyp:*',
-            '../tools/telemetry/telemetry.gyp:*',
-            '../v8/tools/gyp/v8.gyp:*',
-            '<(libjpeg_gyp_path):*',
-          ],
-        }],
-        ['OS!="ios"', {
-          'dependencies': [
-            '../device/bluetooth/bluetooth.gyp:*',
-            '../device/device_tests.gyp:*',
-            '../gpu/skia_runner/skia_runner.gyp:*',
-          ],
-        }],
-        ['use_openssl==0 and (OS=="mac" or OS=="ios" or OS=="win")', {
-          'dependencies': [
-            '../third_party/nss/nss.gyp:*',
-           ],
-        }],
-        ['OS=="win" or OS=="ios" or OS=="linux"', {
-          'dependencies': [
-            '../breakpad/breakpad.gyp:*',
-           ],
-        }],
-        ['OS=="mac"', {
-          'dependencies': [
-            '../sandbox/sandbox.gyp:*',
-            '../third_party/crashpad/crashpad/crashpad.gyp:*',
-            '../third_party/ocmock/ocmock.gyp:*',
-          ],
-        }],
-        ['OS=="linux"', {
-          'dependencies': [
-            '../courgette/courgette.gyp:*',
-            '../sandbox/sandbox.gyp:*',
-          ],
-          'conditions': [
-            ['branding=="Chrome"', {
-              'dependencies': [
-                '../chrome/chrome.gyp:linux_packages_<(channel)',
-              ],
-            }],
-            ['enable_ipc_fuzzer==1', {
-              'dependencies': [
-                '../tools/ipc_fuzzer/ipc_fuzzer.gyp:*',
-              ],
-            }],
-            ['use_dbus==1', {
-              'dependencies': [
-                '../dbus/dbus.gyp:*',
-              ],
-            }],
-          ],
-        }],
-        ['chromecast==1', {
-          'dependencies': [
-            '../chromecast/chromecast.gyp:*',
-          ],
-        }],
-        ['use_x11==1', {
-          'dependencies': [
-            '../tools/xdisplaycheck/xdisplaycheck.gyp:*',
-          ],
-        }],
-        ['OS=="win"', {
-          'conditions': [
-            ['win_use_allocator_shim==1', {
-              'dependencies': [
-                '../base/allocator/allocator.gyp:*',
-              ],
-            }],
-          ],
-          'dependencies': [
-            '../chrome/tools/crash_service/caps/caps.gyp:*',
-            '../chrome_elf/chrome_elf.gyp:*',
-            '../cloud_print/cloud_print.gyp:*',
-            '../courgette/courgette.gyp:*',
-            '../rlz/rlz.gyp:*',
-            '../sandbox/sandbox.gyp:*',
-            '<(angle_path)/src/angle.gyp:*',
-            '../third_party/bspatch/bspatch.gyp:*',
-            '../tools/win/static_initializers/static_initializers.gyp:*',
-          ],
-        }, {
-          'dependencies': [
-            '../third_party/libevent/libevent.gyp:*',
-          ],
-        }],
-        ['toolkit_views==1', {
-          'dependencies': [
-            '../ui/views/controls/webview/webview.gyp:*',
-            '../ui/views/views.gyp:*',
-          ],
-        }],
-        ['use_aura==1', {
-          'dependencies': [
-            '../ui/aura/aura.gyp:*',
-            '../ui/aura_extra/aura_extra.gyp:*',
-          ],
-        }],
-        ['use_ash==1', {
-          'dependencies': [
-            '../ash/ash.gyp:*',
-          ],
-        }],
-        ['remoting==1', {
-          'dependencies': [
-            '../remoting/remoting_all.gyp:remoting_all',
-          ],
-        }],
-        ['use_openssl==0', {
-          'dependencies': [
-            '../net/third_party/nss/ssl.gyp:*',
-          ],
-        }],
-        ['use_openssl==1', {
-          'dependencies': [
-            '../third_party/boringssl/boringssl.gyp:*',
-            '../third_party/boringssl/boringssl_tests.gyp:*',
-          ],
-        }],
-        ['enable_app_list==1', {
-          'dependencies': [
-            '../ui/app_list/app_list.gyp:*',
-          ],
-        }],
-        ['OS!="android" and OS!="ios"', {
-          'dependencies': [
-            '../google_apis/gcm/gcm.gyp:*',
-          ],
-        }],
-        ['(chromeos==1 or OS=="linux" or OS=="win" or OS=="mac") and chromecast==0', {
-          'dependencies': [
-            '../extensions/shell/app_shell.gyp:*',
-          ],
-        }],
-        ['envoy==1', {
-          'dependencies': [
-            '../envoy/envoy.gyp:*',
-          ],
-        }],
-      ],
-    }, # target_name: All
-    {
-      'target_name': 'All_syzygy',
-      'type': 'none',
-      'conditions': [
-        ['OS=="win" and fastbuild==0 and target_arch=="ia32" and '
-            '(syzyasan==1 or syzygy_optimize==1)', {
-          'dependencies': [
-            '../chrome/installer/mini_installer_syzygy.gyp:*',
-          ],
-        }],
-      ],
-    }, # target_name: All_syzygy
-    {
-      # Note: Android uses android_builder_tests below.
-      # TODO: Consider merging that with this target.
-      'target_name': 'chromium_builder_tests',
-      'type': 'none',
-      'dependencies': [
-        '../base/base.gyp:base_unittests',
-        '../components/components_tests.gyp:components_unittests',
-        '../crypto/crypto.gyp:crypto_unittests',
-        '../net/net.gyp:net_unittests',
-        '../skia/skia_tests.gyp:skia_unittests',
-        '../sql/sql.gyp:sql_unittests',
-        '../sync/sync.gyp:sync_unit_tests',
-        '../ui/base/ui_base_tests.gyp:ui_base_unittests',
-        '../ui/display/display.gyp:display_unittests',
-        '../ui/gfx/gfx_tests.gyp:gfx_unittests',
-        '../url/url.gyp:url_unittests',
-      ],
-      'conditions': [
-        ['OS!="ios"', {
-          'dependencies': [
-            '../ui/gl/gl_tests.gyp:gl_unittests',
-          ],
-        }],
-        ['OS!="ios" and OS!="mac"', {
-          'dependencies': [
-            '../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests',
-          ],
-        }],
-        ['OS!="ios" and OS!="android"', {
-          'dependencies': [
-            '../cc/blink/cc_blink_tests.gyp:cc_blink_unittests',
-            '../cc/cc_tests.gyp:cc_unittests',
-            '../cloud_print/cloud_print.gyp:cloud_print_unittests',
-            '../content/content_shell_and_tests.gyp:content_browsertests',
-            '../content/content_shell_and_tests.gyp:content_shell',
-            '../content/content_shell_and_tests.gyp:content_unittests',
-            '../device/device_tests.gyp:device_unittests',
-            '../gin/gin.gyp:gin_unittests',
-            '../google_apis/google_apis.gyp:google_apis_unittests',
-            '../gpu/gles2_conform_support/gles2_conform_support.gyp:gles2_conform_support',
-            '../gpu/gpu.gyp:gpu_unittests',
-            '../ipc/ipc.gyp:ipc_tests',
-            '../ipc/mojo/ipc_mojo.gyp:ipc_mojo_unittests',
-            '../jingle/jingle.gyp:jingle_unittests',
-            '../media/cast/cast.gyp:cast_unittests',
-            '../media/media.gyp:media_unittests',
-            '../media/midi/midi.gyp:midi_unittests',
-            '../mojo/mojo.gyp:mojo',
-            '../ppapi/ppapi_internal.gyp:ppapi_unittests',
-            '../remoting/remoting.gyp:remoting_unittests',
-            '../third_party/WebKit/public/all.gyp:all_blink',
-            '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
-            '../third_party/leveldatabase/leveldatabase.gyp:env_chromium_unittests',
-            '../third_party/libaddressinput/libaddressinput.gyp:libaddressinput_unittests',
-            '../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
-            '../tools/telemetry/telemetry.gyp:*',
-          ],
-        }],
-        ['OS!="ios" and OS!="android" and chromecast==0', {
-          'dependencies': [
-            '../chrome/chrome.gyp:browser_tests',
-            '../chrome/chrome.gyp:chromedriver_tests',
-            '../chrome/chrome.gyp:chromedriver_unittests',
-            '../chrome/chrome.gyp:interactive_ui_tests',
-            '../chrome/chrome.gyp:sync_integration_tests',
-            '../chrome/chrome.gyp:unit_tests',
-            '../extensions/extensions_tests.gyp:extensions_browsertests',
-            '../extensions/extensions_tests.gyp:extensions_unittests',
-          ],
-        }],
-        ['OS=="win"', {
-          'dependencies': [
-            '../chrome/chrome.gyp:crash_service',
-            '../chrome/chrome.gyp:installer_util_unittests',
-            '../chrome/chrome.gyp:setup_unittests',
-            # ../chrome/test/mini_installer requires mini_installer.
-            '../chrome/installer/mini_installer.gyp:mini_installer',
-            '../chrome_elf/chrome_elf.gyp:chrome_elf_unittests',
-            '../content/content_shell_and_tests.gyp:copy_test_netscape_plugin',
-            '../courgette/courgette.gyp:courgette_unittests',
-            '../sandbox/sandbox.gyp:sbox_integration_tests',
-            '../sandbox/sandbox.gyp:sbox_unittests',
-            '../sandbox/sandbox.gyp:sbox_validation_tests',
-            '../ui/app_list/app_list.gyp:app_list_unittests',
-          ],
-          'conditions': [
-            # remoting_host_installation uses lots of non-trivial GYP that tend
-            # to break because of differences between ninja and msbuild. Make
-            # sure this target is built by the builders on the main waterfall.
-            # See http://crbug.com/180600.
-            ['wix_exists == "True" and sas_dll_exists == "True"', {
-              'dependencies': [
-                '../remoting/remoting.gyp:remoting_host_installation',
-              ],
-            }],
-            ['syzyasan==1', {
-              'variables': {
-                # Disable incremental linking for all modules.
-                # 0: inherit, 1: disabled, 2: enabled.
-                'msvs_debug_link_incremental': '1',
-                'msvs_large_module_debug_link_mode': '1',
-                # Disable RTC. Syzygy explicitly doesn't support RTC
-                # instrumented binaries for now.
-                'win_debug_RuntimeChecks': '0',
-              },
-              'defines': [
-                # Disable iterator debugging (huge speed boost).
-                '_HAS_ITERATOR_DEBUGGING=0',
-              ],
-              'msvs_settings': {
-                'VCLinkerTool': {
-                  # Enable profile information (necessary for SyzyAsan
-                  # instrumentation). This is incompatible with incremental
-                  # linking.
-                  'Profile': 'true',
-                },
-              }
-            }],
-          ],
-        }],
-        ['chromeos==1', {
-          'dependencies': [
-            '../ui/chromeos/ui_chromeos.gyp:ui_chromeos_unittests',
-          ],
-        }],
-        ['OS=="linux"', {
-          'dependencies': [
-            '../sandbox/sandbox.gyp:sandbox_linux_unittests',
-          ],
-        }],
-        ['OS=="linux" and use_dbus==1', {
-          'dependencies': [
-            '../dbus/dbus.gyp:dbus_unittests',
-          ],
-        }],
-        ['OS=="mac"', {
-          'dependencies': [
-            '../ui/app_list/app_list.gyp:app_list_unittests',
-            '../ui/message_center/message_center.gyp:*',
-          ],
-        }],
-        ['test_isolation_mode != "noop"', {
-          'dependencies': [
-            'chromium_swarm_tests',
-          ],
-        }],
-        ['OS!="android"', {
-          'dependencies': [
-            '../google_apis/gcm/gcm.gyp:gcm_unit_tests',
-          ],
-        }],
-        ['enable_basic_printing==1 or enable_print_preview==1', {
-          'dependencies': [
-            '../printing/printing.gyp:printing_unittests',
-          ],
-        }],
-        ['use_aura==1', {
-          'dependencies': [
-            '../ui/app_list/app_list.gyp:app_list_unittests',
-            '../ui/aura/aura.gyp:aura_unittests',
-            '../ui/compositor/compositor.gyp:compositor_unittests',
-          ],
-        }],
-        ['use_aura==1 and chromecast==0', {
-          'dependencies': [
-            '../ui/keyboard/keyboard.gyp:keyboard_unittests',
-            '../ui/views/views.gyp:views_unittests',
-          ],
-        }],
-        ['use_aura==1 or toolkit_views==1', {
-          'dependencies': [
-            '../ui/events/events.gyp:events_unittests',
-          ],
-        }],
-        ['use_ash==1', {
-          'dependencies': [
-            '../ash/ash.gyp:ash_unittests',
-          ],
-        }],
-        ['disable_nacl==0', {
-          'dependencies': [
-            '../components/nacl.gyp:nacl_loader_unittests',
-          ],
-        }],
-        ['disable_nacl==0 and disable_nacl_untrusted==0 and enable_nacl_nonsfi_test==1', {
-          'dependencies': [
-            '../components/nacl.gyp:nacl_helper_nonsfi_unittests',
-          ],
-        }],
-        ['disable_nacl==0 and disable_nacl_untrusted==0', {
-          'dependencies': [
-            '../mojo/mojo_nacl_untrusted.gyp:libmojo',
-            '../mojo/mojo_nacl.gyp:monacl_codegen',
-            '../mojo/mojo_nacl.gyp:monacl_sel',
-            '../mojo/mojo_nacl.gyp:monacl_shell',
-          ],
-        }],
-      ],
-    }, # target_name: chromium_builder_tests
-  ],
-  'conditions': [
-    # TODO(GYP): make gn_migration.gypi work unconditionally.
-    ['OS=="mac" or OS=="win" or (OS=="linux" and target_arch=="x64" and chromecast==0)', {
-      'includes': [
-        'gn_migration.gypi',
-      ],
-    }],
-    ['OS!="ios"', {
-      'targets': [
-        {
-          'target_name': 'blink_tests',
-          'type': 'none',
-          'dependencies': [
-            '../third_party/WebKit/public/all.gyp:all_blink',
-          ],
-          'conditions': [
-            ['OS=="android"', {
-              'dependencies': [
-                '../content/content_shell_and_tests.gyp:content_shell_apk',
-                '../breakpad/breakpad.gyp:dump_syms#host',
-                '../breakpad/breakpad.gyp:minidump_stackwalk#host',
-              ],
-            }, {  # OS!="android"
-              'dependencies': [
-                '../content/content_shell_and_tests.gyp:content_shell',
-              ],
-            }],
-            ['OS=="win"', {
-              'dependencies': [
-                '../components/test_runner/test_runner.gyp:layout_test_helper',
-                '../content/content_shell_and_tests.gyp:content_shell_crash_service',
-              ],
-            }],
-            ['OS!="win" and OS!="android"', {
-              'dependencies': [
-                '../breakpad/breakpad.gyp:minidump_stackwalk',
-              ],
-            }],
-            ['OS=="mac"', {
-              'dependencies': [
-                '../components/test_runner/test_runner.gyp:layout_test_helper',
-                '../breakpad/breakpad.gyp:dump_syms#host',
-              ],
-            }],
-            ['OS=="linux"', {
-              'dependencies': [
-                '../breakpad/breakpad.gyp:dump_syms#host',
-              ],
-            }],
-          ],
-        }, # target_name: blink_tests
-      ],
-    }], # OS!=ios
-    ['OS!="ios" and OS!="android" and chromecast==0', {
-      'targets': [
-        {
-          'target_name': 'chromium_builder_nacl_win_integration',
-          'type': 'none',
-          'dependencies': [
-            'chromium_builder_tests',
-          ],
-        }, # target_name: chromium_builder_nacl_win_integration
-        {
-          'target_name': 'chromium_builder_perf',
-          'type': 'none',
-          'dependencies': [
-            '../cc/cc_tests.gyp:cc_perftests',
-            '../chrome/chrome.gyp:chrome',
-            '../chrome/chrome.gyp:load_library_perf_tests',
-            '../chrome/chrome.gyp:performance_browser_tests',
-            '../chrome/chrome.gyp:sync_performance_tests',
-            '../content/content_shell_and_tests.gyp:content_shell',
-            '../gpu/gpu.gyp:gpu_perftests',
-            '../media/media.gyp:media_perftests',
-            '../media/midi/midi.gyp:midi_unittests',
-            '../tools/perf/clear_system_cache/clear_system_cache.gyp:*',
-            '../tools/telemetry/telemetry.gyp:*',
-          ],
-          'conditions': [
-            ['OS!="ios" and OS!="win"', {
-              'dependencies': [
-                '../breakpad/breakpad.gyp:minidump_stackwalk',
-              ],
-            }],
-            ['OS=="linux"', {
-              'dependencies': [
-                '../chrome/chrome.gyp:linux_symbols'
-              ],
-            }],
-            ['OS=="win"', {
-              'dependencies': [
-                '../chrome/chrome.gyp:crash_service',
-                '../gpu/gpu.gyp:angle_perftests',
-              ],
-            }],
-            ['OS=="win" and target_arch=="ia32"', {
-              'dependencies': [
-                '../chrome/chrome.gyp:crash_service_win64',
-              ],
-            }],
-          ],
-        }, # target_name: chromium_builder_perf
-        {
-          'target_name': 'chromium_gpu_builder',
-          'type': 'none',
-          'dependencies': [
-            '../chrome/chrome.gyp:chrome',
-            '../chrome/chrome.gyp:performance_browser_tests',
-            '../content/content_shell_and_tests.gyp:content_browsertests',
-            '../content/content_shell_and_tests.gyp:content_gl_tests',
-            '../gpu/gles2_conform_support/gles2_conform_test.gyp:gles2_conform_test',
-            '../gpu/khronos_glcts_support/khronos_glcts_test.gyp:khronos_glcts_test',
-            '../gpu/gpu.gyp:gl_tests',
-            '../gpu/gpu.gyp:angle_unittests',
-            '../gpu/gpu.gyp:gpu_unittests',
-            '../tools/telemetry/telemetry.gyp:*',
-          ],
-          'conditions': [
-            ['OS!="ios" and OS!="win"', {
-              'dependencies': [
-                '../breakpad/breakpad.gyp:minidump_stackwalk',
-              ],
-            }],
-            ['OS=="linux"', {
-              'dependencies': [
-                '../chrome/chrome.gyp:linux_symbols'
-              ],
-            }],
-            ['OS=="win"', {
-              'dependencies': [
-                '../chrome/chrome.gyp:crash_service',
-              ],
-            }],
-            ['OS=="win" and target_arch=="ia32"', {
-              'dependencies': [
-                '../chrome/chrome.gyp:crash_service_win64',
-              ],
-            }],
-          ],
-        }, # target_name: chromium_gpu_builder
-        {
-          'target_name': 'chromium_gpu_debug_builder',
-          'type': 'none',
-          'dependencies': [
-            '../chrome/chrome.gyp:chrome',
-            '../content/content_shell_and_tests.gyp:content_browsertests',
-            '../content/content_shell_and_tests.gyp:content_gl_tests',
-            '../gpu/gles2_conform_support/gles2_conform_test.gyp:gles2_conform_test',
-            '../gpu/khronos_glcts_support/khronos_glcts_test.gyp:khronos_glcts_test',
-            '../gpu/gpu.gyp:gl_tests',
-            '../gpu/gpu.gyp:angle_unittests',
-            '../gpu/gpu.gyp:gpu_unittests',
-            '../tools/telemetry/telemetry.gyp:*',
-          ],
-          'conditions': [
-            ['OS!="ios" and OS!="win"', {
-              'dependencies': [
-                '../breakpad/breakpad.gyp:minidump_stackwalk',
-              ],
-            }],
-            ['OS=="linux"', {
-              'dependencies': [
-                '../chrome/chrome.gyp:linux_symbols'
-              ],
-            }],
-            ['OS=="win"', {
-              'dependencies': [
-                '../chrome/chrome.gyp:crash_service',
-              ],
-            }],
-            ['OS=="win" and target_arch=="ia32"', {
-              'dependencies': [
-                '../chrome/chrome.gyp:crash_service_win64',
-              ],
-            }],
-          ],
-        }, # target_name: chromium_gpu_debug_builder
-        {
-          # This target contains everything we need to run tests on the special
-          # device-equipped WebRTC bots. We have device-requiring tests in
-          # browser_tests and content_browsertests.
-          'target_name': 'chromium_builder_webrtc',
-          'type': 'none',
-          'dependencies': [
-            'chromium_builder_perf',
-            '../chrome/chrome.gyp:browser_tests',
-            '../content/content_shell_and_tests.gyp:content_browsertests',
-            '../content/content_shell_and_tests.gyp:content_unittests',
-            '../media/media.gyp:media_unittests',
-            '../media/midi/midi.gyp:midi_unittests',
-            '../third_party/webrtc/tools/tools.gyp:frame_analyzer',
-            '../third_party/webrtc/tools/tools.gyp:rgba_to_i420_converter',
-          ],
-          'conditions': [
-            ['remoting==1', {
-              'dependencies': [
-                '../remoting/remoting.gyp:*',
-              ],
-            }],
-          ],
-        },  # target_name: chromium_builder_webrtc
-        {
-          'target_name': 'chromium_builder_chromedriver',
-          'type': 'none',
-          'dependencies': [
-            '../chrome/chrome.gyp:chromedriver',
-            '../chrome/chrome.gyp:chromedriver_tests',
-            '../chrome/chrome.gyp:chromedriver_unittests',
-          ],
-        },  # target_name: chromium_builder_chromedriver
-        {
-          'target_name': 'chromium_builder_asan',
-          'type': 'none',
-          'dependencies': [
-            '../chrome/chrome.gyp:chrome',
-
-            # We refer to content_shell directly rather than blink_tests
-            # because we don't want the _unittests binaries.
-            '../content/content_shell_and_tests.gyp:content_shell',
-          ],
-          'conditions': [
-            ['OS!="win"', {
-              'dependencies': [
-                '../net/net.gyp:hpack_fuzz_wrapper',
-                '../net/net.gyp:dns_fuzz_stub',
-                '../skia/skia.gyp:filter_fuzz_stub',
-              ],
-            }],
-            ['enable_ipc_fuzzer==1 and component!="shared_library" and '
-                 '(OS=="linux" or OS=="win")', {
-              'dependencies': [
-                '../tools/ipc_fuzzer/ipc_fuzzer.gyp:*',
-              ],
-            }],
-            ['chromeos==0', {
-              'dependencies': [
-                '../v8/src/d8.gyp:d8#host',
-                '../third_party/pdfium/samples/samples.gyp:pdfium_test',
-              ],
-            }],
-            ['internal_filter_fuzzer==1', {
-              'dependencies': [
-                '../skia/tools/clusterfuzz-data/fuzzers/filter_fuzzer/filter_fuzzer.gyp:filter_fuzzer',
-              ],
-            }], # internal_filter_fuzzer
-            ['clang==1', {
-              'dependencies': [
-                'sanitizers/sanitizers.gyp:llvm-symbolizer',
-              ],
-            }],
-            ['OS=="win" and fastbuild==0 and target_arch=="ia32" and syzyasan==1', {
-              'dependencies': [
-                '../chrome/chrome_syzygy.gyp:chrome_dll_syzygy',
-                '../content/content_shell_and_tests.gyp:content_shell_syzyasan',
-              ],
-              'conditions': [
-                ['chrome_multiple_dll==1', {
-                  'dependencies': [
-                    '../chrome/chrome_syzygy.gyp:chrome_child_dll_syzygy',
-                  ],
-                }],
-              ],
-            }],
-          ],
-        },
-        {
-          'target_name': 'chromium_builder_nacl_sdk',
-          'type': 'none',
-          'dependencies': [
-            '../chrome/chrome.gyp:chrome',
-          ],
-          'conditions': [
-            ['OS=="win"', {
-              'dependencies': [
-                '../chrome/chrome.gyp:chrome_nacl_win64',
-              ]
-            }],
-          ],
-        },  #target_name: chromium_builder_nacl_sdk
-      ],  # targets
-    }], #OS!=ios and OS!=android
-    ['OS=="android"', {
-      'targets': [
-        {
-          # The current list of tests for android.  This is temporary
-          # until the full set supported.  If adding a new test here,
-          # please also add it to build/android/pylib/gtest/gtest_config.py,
-          # else the test is not run.
-          #
-          # WARNING:
-          # Do not add targets here without communicating the implications
-          # on tryserver triggers and load.  Discuss with
-          # chrome-infrastructure-team please.
-          'target_name': 'android_builder_tests',
-          'type': 'none',
-          'dependencies': [
-            '../base/android/jni_generator/jni_generator.gyp:jni_generator_tests',
-            '../base/base.gyp:base_unittests',
-            '../breakpad/breakpad.gyp:breakpad_unittests_deps',
-            # Also compile the tools needed to deal with minidumps, they are
-            # needed to run minidump tests upstream.
-            '../breakpad/breakpad.gyp:dump_syms#host',
-            '../breakpad/breakpad.gyp:symupload#host',
-            '../breakpad/breakpad.gyp:minidump_dump#host',
-            '../breakpad/breakpad.gyp:minidump_stackwalk#host',
-            '../build/android/pylib/device/commands/commands.gyp:chromium_commands',
-            '../cc/blink/cc_blink_tests.gyp:cc_blink_unittests',
-            '../cc/cc_tests.gyp:cc_perftests_apk',
-            '../cc/cc_tests.gyp:cc_unittests',
-            '../components/components_tests.gyp:components_unittests',
-            '../content/content_shell_and_tests.gyp:content_browsertests',
-            '../content/content_shell_and_tests.gyp:content_gl_tests',
-            '../content/content_shell_and_tests.gyp:content_junit_tests',
-            '../content/content_shell_and_tests.gyp:chromium_linker_test_apk',
-            '../content/content_shell_and_tests.gyp:content_shell_test_apk',
-            '../content/content_shell_and_tests.gyp:content_unittests',
-            '../gpu/gpu.gyp:gl_tests',
-            '../gpu/gpu.gyp:gpu_perftests_apk',
-            '../gpu/gpu.gyp:gpu_unittests',
-            '../ipc/ipc.gyp:ipc_tests',
-            '../media/media.gyp:media_perftests_apk',
-            '../media/media.gyp:media_unittests',
-            '../media/midi/midi.gyp:midi_unittests_apk',
-            '../media/midi/midi.gyp:midi_unittests',
-            '../net/net.gyp:net_unittests',
-            '../sandbox/sandbox.gyp:sandbox_linux_unittests_deps',
-            '../skia/skia_tests.gyp:skia_unittests',
-            '../sql/sql.gyp:sql_unittests',
-            '../sync/sync.gyp:sync_unit_tests',
-            '../testing/android/junit/junit_test.gyp:junit_unit_tests',
-            '../third_party/leveldatabase/leveldatabase.gyp:env_chromium_unittests',
-            '../third_party/WebKit/public/all.gyp:*',
-            '../tools/android/android_tools.gyp:android_tools',
-            '../tools/android/android_tools.gyp:memconsumer',
-            '../tools/android/findbugs_plugin/findbugs_plugin.gyp:findbugs_plugin_test',
-            '../ui/android/ui_android.gyp:ui_android_unittests',
-            '../ui/base/ui_base_tests.gyp:ui_base_unittests',
-            '../ui/events/events.gyp:events_unittests',
-            '../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests',
-            # Unit test bundles packaged as an apk.
-            '../base/base.gyp:base_unittests_apk',
-            '../cc/blink/cc_blink_tests.gyp:cc_blink_unittests_apk',
-            '../cc/cc_tests.gyp:cc_unittests_apk',
-            '../components/components_tests.gyp:components_browsertests_apk',
-            '../components/components_tests.gyp:components_unittests_apk',
-            '../content/content_shell_and_tests.gyp:content_browsertests_apk',
-            '../content/content_shell_and_tests.gyp:content_gl_tests_apk',
-            '../content/content_shell_and_tests.gyp:content_unittests_apk',
-            '../content/content_shell_and_tests.gyp:video_decode_accelerator_unittest_apk',
-            '../gpu/gpu.gyp:gl_tests_apk',
-            '../gpu/gpu.gyp:gpu_unittests_apk',
-            '../ipc/ipc.gyp:ipc_tests_apk',
-            '../media/media.gyp:media_unittests_apk',
-            '../media/midi/midi.gyp:midi_unittests_apk',
-            '../net/net.gyp:net_unittests_apk',
-            '../sandbox/sandbox.gyp:sandbox_linux_jni_unittests_apk',
-            '../skia/skia_tests.gyp:skia_unittests_apk',
-            '../sql/sql.gyp:sql_unittests_apk',
-            '../sync/sync.gyp:sync_unit_tests_apk',
-            '../tools/android/heap_profiler/heap_profiler.gyp:heap_profiler_unittests_apk',
-            '../ui/android/ui_android.gyp:ui_android_unittests_apk',
-            '../ui/base/ui_base_tests.gyp:ui_base_unittests_apk',
-            '../ui/events/events.gyp:events_unittests_apk',
-            '../ui/gfx/gfx_tests.gyp:gfx_unittests_apk',
-            '../ui/gl/gl_tests.gyp:gl_unittests_apk',
-            '../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests_apk',
-          ],
-          'conditions': [
-            ['chromecast==0', {
-              'dependencies': [
-                '../android_webview/android_webview.gyp:android_webview_unittests',
-                '../chrome/chrome.gyp:unit_tests',
-                # Unit test bundles packaged as an apk.
-                '../android_webview/android_webview.gyp:android_webview_test_apk',
-                '../android_webview/android_webview.gyp:android_webview_unittests_apk',
-                '../chrome/android/chrome_apk.gyp:chrome_public_test_apk',
-                '../chrome/chrome.gyp:chrome_junit_tests',
-                '../chrome/chrome.gyp:chrome_shell_test_apk',
-                '../chrome/chrome.gyp:chrome_sync_shell_test_apk',
-                '../chrome/chrome.gyp:chrome_shell_uiautomator_tests',
-                '../chrome/chrome.gyp:chromedriver_webview_shell_apk',
-                '../chrome/chrome.gyp:unit_tests_apk',
-                '../third_party/custom_tabs_client/src/custom_tabs_client.gyp:custom_tabs_client_example_apk',
-              ],
-            }],
-          ],
-        },
-        {
-          # WebRTC Chromium tests to run on Android.
-          'target_name': 'android_builder_chromium_webrtc',
-          'type': 'none',
-          'dependencies': [
-            '../build/android/pylib/device/commands/commands.gyp:chromium_commands',
-            '../content/content_shell_and_tests.gyp:content_browsertests',
-            '../tools/android/android_tools.gyp:android_tools',
-            '../tools/android/android_tools.gyp:memconsumer',
-            '../content/content_shell_and_tests.gyp:content_browsertests_apk',
-          ],
-        },  # target_name: android_builder_chromium_webrtc
-      ], # targets
-    }], # OS="android"
-    ['OS=="mac"', {
-      'targets': [
-        {
-          # Target to build everything plus the dmg.  We don't put the dmg
-          # in the All target because developers really don't need it.
-          'target_name': 'all_and_dmg',
-          'type': 'none',
-          'dependencies': [
-            'All',
-            '../chrome/chrome.gyp:build_app_dmg',
-          ],
-        },
-        # These targets are here so the build bots can use them to build
-        # subsets of a full tree for faster cycle times.
-        {
-          'target_name': 'chromium_builder_dbg',
-          'type': 'none',
-          'dependencies': [
-            '../cc/blink/cc_blink_tests.gyp:cc_blink_unittests',
-            '../cc/cc_tests.gyp:cc_unittests',
-            '../chrome/chrome.gyp:browser_tests',
-            '../chrome/chrome.gyp:interactive_ui_tests',
-            '../chrome/chrome.gyp:sync_integration_tests',
-            '../chrome/chrome.gyp:unit_tests',
-            '../cloud_print/cloud_print.gyp:cloud_print_unittests',
-            '../components/components_tests.gyp:components_unittests',
-            '../content/content_shell_and_tests.gyp:content_browsertests',
-            '../content/content_shell_and_tests.gyp:content_unittests',
-            '../device/device_tests.gyp:device_unittests',
-            '../google_apis/gcm/gcm.gyp:gcm_unit_tests',
-            '../gpu/gpu.gyp:gpu_unittests',
-            '../ipc/ipc.gyp:ipc_tests',
-            '../ipc/mojo/ipc_mojo.gyp:ipc_mojo_unittests',
-            '../jingle/jingle.gyp:jingle_unittests',
-            '../media/media.gyp:media_unittests',
-            '../media/midi/midi.gyp:midi_unittests',
-            '../ppapi/ppapi_internal.gyp:ppapi_unittests',
-            '../printing/printing.gyp:printing_unittests',
-            '../remoting/remoting.gyp:remoting_unittests',
-            '../rlz/rlz.gyp:*',
-            '../skia/skia_tests.gyp:skia_unittests',
-            '../sql/sql.gyp:sql_unittests',
-            '../sync/sync.gyp:sync_unit_tests',
-            '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
-            '../third_party/leveldatabase/leveldatabase.gyp:env_chromium_unittests',
-            '../third_party/libaddressinput/libaddressinput.gyp:libaddressinput_unittests',
-            '../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
-            '../tools/perf/clear_system_cache/clear_system_cache.gyp:*',
-            '../tools/telemetry/telemetry.gyp:*',
-            '../ui/base/ui_base_tests.gyp:ui_base_unittests',
-            '../ui/gfx/gfx_tests.gyp:gfx_unittests',
-            '../ui/gl/gl_tests.gyp:gl_unittests',
-            '../url/url.gyp:url_unittests',
-          ],
-        },
-        {
-          'target_name': 'chromium_builder_rel',
-          'type': 'none',
-          'dependencies': [
-            '../cc/blink/cc_blink_tests.gyp:cc_blink_unittests',
-            '../cc/cc_tests.gyp:cc_unittests',
-            '../chrome/chrome.gyp:browser_tests',
-            '../chrome/chrome.gyp:performance_browser_tests',
-            '../chrome/chrome.gyp:sync_integration_tests',
-            '../chrome/chrome.gyp:unit_tests',
-            '../cloud_print/cloud_print.gyp:cloud_print_unittests',
-            '../components/components_tests.gyp:components_unittests',
-            '../content/content_shell_and_tests.gyp:content_browsertests',
-            '../content/content_shell_and_tests.gyp:content_unittests',
-            '../device/device_tests.gyp:device_unittests',
-            '../google_apis/gcm/gcm.gyp:gcm_unit_tests',
-            '../gpu/gpu.gyp:gpu_unittests',
-            '../ipc/ipc.gyp:ipc_tests',
-            '../ipc/mojo/ipc_mojo.gyp:ipc_mojo_unittests',
-            '../jingle/jingle.gyp:jingle_unittests',
-            '../media/media.gyp:media_unittests',
-            '../media/midi/midi.gyp:midi_unittests',
-            '../ppapi/ppapi_internal.gyp:ppapi_unittests',
-            '../printing/printing.gyp:printing_unittests',
-            '../remoting/remoting.gyp:remoting_unittests',
-            '../skia/skia_tests.gyp:skia_unittests',
-            '../sql/sql.gyp:sql_unittests',
-            '../sync/sync.gyp:sync_unit_tests',
-            '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
-            '../third_party/leveldatabase/leveldatabase.gyp:env_chromium_unittests',
-            '../third_party/libaddressinput/libaddressinput.gyp:libaddressinput_unittests',
-            '../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
-            '../tools/perf/clear_system_cache/clear_system_cache.gyp:*',
-            '../tools/telemetry/telemetry.gyp:*',
-            '../ui/base/ui_base_tests.gyp:ui_base_unittests',
-            '../ui/gfx/gfx_tests.gyp:gfx_unittests',
-            '../ui/gl/gl_tests.gyp:gl_unittests',
-            '../url/url.gyp:url_unittests',
-          ],
-        },
-        {
-          'target_name': 'chromium_builder_dbg_tsan_mac',
-          'type': 'none',
-          'dependencies': [
-            '../base/base.gyp:base_unittests',
-            '../cloud_print/cloud_print.gyp:cloud_print_unittests',
-            '../crypto/crypto.gyp:crypto_unittests',
-            '../ipc/ipc.gyp:ipc_tests',
-            '../jingle/jingle.gyp:jingle_unittests',
-            '../media/media.gyp:media_unittests',
-            '../media/midi/midi.gyp:midi_unittests',
-            '../net/net.gyp:net_unittests',
-            '../printing/printing.gyp:printing_unittests',
-            '../remoting/remoting.gyp:remoting_unittests',
-            '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
-            '../third_party/libaddressinput/libaddressinput.gyp:libaddressinput_unittests',
-            '../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
-            '../url/url.gyp:url_unittests',
-          ],
-        },
-        {
-          'target_name': 'chromium_builder_dbg_valgrind_mac',
-          'type': 'none',
-          'dependencies': [
-            '../base/base.gyp:base_unittests',
-            '../chrome/chrome.gyp:unit_tests',
-            '../cloud_print/cloud_print.gyp:cloud_print_unittests',
-            '../components/components_tests.gyp:components_unittests',
-            '../content/content_shell_and_tests.gyp:content_unittests',
-            '../crypto/crypto.gyp:crypto_unittests',
-            '../device/device_tests.gyp:device_unittests',
-            '../ipc/ipc.gyp:ipc_tests',
-            '../jingle/jingle.gyp:jingle_unittests',
-            '../media/media.gyp:media_unittests',
-            '../media/midi/midi.gyp:midi_unittests',
-            '../net/net.gyp:net_unittests',
-            '../google_apis/gcm/gcm.gyp:gcm_unit_tests',
-            '../printing/printing.gyp:printing_unittests',
-            '../remoting/remoting.gyp:remoting_unittests',
-            '../skia/skia_tests.gyp:skia_unittests',
-            '../sql/sql.gyp:sql_unittests',
-            '../sync/sync.gyp:sync_unit_tests',
-            '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
-            '../third_party/leveldatabase/leveldatabase.gyp:env_chromium_unittests',
-            '../third_party/libaddressinput/libaddressinput.gyp:libaddressinput_unittests',
-            '../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
-            '../ui/base/ui_base_tests.gyp:ui_base_unittests',
-            '../ui/gfx/gfx_tests.gyp:gfx_unittests',
-            '../ui/gl/gl_tests.gyp:gl_unittests',
-            '../url/url.gyp:url_unittests',
-          ],
-        },
-      ],  # targets
-    }], # OS="mac"
-    ['OS=="win"', {
-      'targets': [
-        # These targets are here so the build bots can use them to build
-        # subsets of a full tree for faster cycle times.
-        {
-          'target_name': 'chromium_builder',
-          'type': 'none',
-          'dependencies': [
-            '../cc/blink/cc_blink_tests.gyp:cc_blink_unittests',
-            '../cc/cc_tests.gyp:cc_unittests',
-            '../chrome/chrome.gyp:browser_tests',
-            '../chrome/chrome.gyp:crash_service',
-            '../chrome/chrome.gyp:gcapi_test',
-            '../chrome/chrome.gyp:installer_util_unittests',
-            '../chrome/chrome.gyp:interactive_ui_tests',
-            '../chrome/chrome.gyp:performance_browser_tests',
-            '../chrome/chrome.gyp:setup_unittests',
-            '../chrome/chrome.gyp:sync_integration_tests',
-            '../chrome/chrome.gyp:unit_tests',
-            '../cloud_print/cloud_print.gyp:cloud_print_unittests',
-            '../components/components_tests.gyp:components_unittests',
-            '../content/content_shell_and_tests.gyp:content_browsertests',
-            '../content/content_shell_and_tests.gyp:content_unittests',
-            '../content/content_shell_and_tests.gyp:copy_test_netscape_plugin',
-            # ../chrome/test/mini_installer requires mini_installer.
-            '../chrome/installer/mini_installer.gyp:mini_installer',
-            '../courgette/courgette.gyp:courgette_unittests',
-            '../device/device_tests.gyp:device_unittests',
-            '../google_apis/gcm/gcm.gyp:gcm_unit_tests',
-            '../gpu/gpu.gyp:gpu_unittests',
-            '../ipc/ipc.gyp:ipc_tests',
-            '../ipc/mojo/ipc_mojo.gyp:ipc_mojo_unittests',
-            '../jingle/jingle.gyp:jingle_unittests',
-            '../media/media.gyp:media_unittests',
-            '../media/midi/midi.gyp:midi_unittests',
-            '../ppapi/ppapi_internal.gyp:ppapi_unittests',
-            '../printing/printing.gyp:printing_unittests',
-            '../remoting/remoting.gyp:remoting_unittests',
-            '../skia/skia_tests.gyp:skia_unittests',
-            '../sql/sql.gyp:sql_unittests',
-            '../sync/sync.gyp:sync_unit_tests',
-            '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
-            '../third_party/leveldatabase/leveldatabase.gyp:env_chromium_unittests',
-            '../third_party/libaddressinput/libaddressinput.gyp:libaddressinput_unittests',
-            '../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
-            '../tools/perf/clear_system_cache/clear_system_cache.gyp:*',
-            '../tools/telemetry/telemetry.gyp:*',
-            '../ui/base/ui_base_tests.gyp:ui_base_unittests',
-            '../ui/events/events.gyp:events_unittests',
-            '../ui/gfx/gfx_tests.gyp:gfx_unittests',
-            '../ui/gl/gl_tests.gyp:gl_unittests',
-            '../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests',
-            '../ui/views/views.gyp:views_unittests',
-            '../url/url.gyp:url_unittests',
-          ],
-          'conditions': [
-            ['target_arch=="ia32"', {
-              'dependencies': [
-                '../chrome/chrome.gyp:crash_service_win64',
-              ],
-            }],
-          ],
-        },
-        {
-          'target_name': 'chromium_builder_dbg_tsan_win',
-          'type': 'none',
-          'dependencies': [
-            '../base/base.gyp:base_unittests',
-            '../cloud_print/cloud_print.gyp:cloud_print_unittests',
-            '../components/components_tests.gyp:components_unittests',
-            '../content/content_shell_and_tests.gyp:content_unittests',
-            '../crypto/crypto.gyp:crypto_unittests',
-            '../ipc/ipc.gyp:ipc_tests',
-            '../jingle/jingle.gyp:jingle_unittests',
-            '../media/media.gyp:media_unittests',
-            '../media/midi/midi.gyp:midi_unittests',
-            '../net/net.gyp:net_unittests',
-            '../printing/printing.gyp:printing_unittests',
-            '../remoting/remoting.gyp:remoting_unittests',
-            '../sql/sql.gyp:sql_unittests',
-            '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
-            '../third_party/leveldatabase/leveldatabase.gyp:env_chromium_unittests',
-            '../third_party/libaddressinput/libaddressinput.gyp:libaddressinput_unittests',
-            '../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
-            '../url/url.gyp:url_unittests',
-          ],
-        },
-        {
-          'target_name': 'chromium_builder_lkgr_drmemory_win',
-          'type': 'none',
-          'dependencies': [
-            '../components/test_runner/test_runner.gyp:layout_test_helper',
-            '../content/content_shell_and_tests.gyp:content_shell',
-            '../content/content_shell_and_tests.gyp:content_shell_crash_service',
-          ],
-        },
-        {
-          'target_name': 'chromium_builder_dbg_drmemory_win',
-          'type': 'none',
-          'dependencies': [
-            '../ash/ash.gyp:ash_shell_unittests',
-            '../ash/ash.gyp:ash_unittests',
-            '../base/base.gyp:base_unittests',
-            '../cc/blink/cc_blink_tests.gyp:cc_blink_unittests',
-            '../cc/cc_tests.gyp:cc_unittests',
-            '../chrome/chrome.gyp:browser_tests',
-            '../chrome/chrome.gyp:chrome_app_unittests',
-            '../chrome/chrome.gyp:chromedriver_unittests',
-            '../chrome/chrome.gyp:installer_util_unittests',
-            '../chrome/chrome.gyp:setup_unittests',
-            '../chrome/chrome.gyp:unit_tests',
-            '../chrome_elf/chrome_elf.gyp:chrome_elf_unittests',
-            '../cloud_print/cloud_print.gyp:cloud_print_unittests',
-            '../components/components_tests.gyp:components_unittests',
-            '../components/test_runner/test_runner.gyp:layout_test_helper',
-            '../content/content_shell_and_tests.gyp:content_browsertests',
-            '../content/content_shell_and_tests.gyp:content_shell',
-            '../content/content_shell_and_tests.gyp:content_shell_crash_service',
-            '../content/content_shell_and_tests.gyp:content_unittests',
-            '../courgette/courgette.gyp:courgette_unittests',
-            '../crypto/crypto.gyp:crypto_unittests',
-            '../device/device_tests.gyp:device_unittests',
-            '../extensions/extensions_tests.gyp:extensions_browsertests',
-            '../extensions/extensions_tests.gyp:extensions_unittests',
-            '../gin/gin.gyp:gin_shell',
-            '../gin/gin.gyp:gin_unittests',
-            '../google_apis/gcm/gcm.gyp:gcm_unit_tests',
-            '../google_apis/google_apis.gyp:google_apis_unittests',
-            '../gpu/gpu.gyp:angle_unittests',
-            '../gpu/gpu.gyp:gpu_unittests',
-            '../ipc/ipc.gyp:ipc_tests',
-            '../ipc/mojo/ipc_mojo.gyp:ipc_mojo_unittests',
-            '../jingle/jingle.gyp:jingle_unittests',
-            '../media/cast/cast.gyp:cast_unittests',
-            '../media/media.gyp:media_unittests',
-            '../media/midi/midi.gyp:midi_unittests',
-            '../mojo/mojo.gyp:mojo',
-            '../net/net.gyp:net_unittests',
-            '../printing/printing.gyp:printing_unittests',
-            '../remoting/remoting.gyp:remoting_unittests',
-            '../skia/skia_tests.gyp:skia_unittests',
-            '../sql/sql.gyp:sql_unittests',
-            '../sync/sync.gyp:sync_unit_tests',
-            '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
-            '../third_party/leveldatabase/leveldatabase.gyp:env_chromium_unittests',
-            '../third_party/libaddressinput/libaddressinput.gyp:libaddressinput_unittests',
-            '../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
-            '../third_party/WebKit/Source/platform/blink_platform_tests.gyp:blink_heap_unittests',
-            '../third_party/WebKit/Source/platform/blink_platform_tests.gyp:blink_platform_unittests',
-            '../ui/accessibility/accessibility.gyp:accessibility_unittests',
-            '../ui/app_list/app_list.gyp:app_list_unittests',
-            '../ui/aura/aura.gyp:aura_unittests',
-            '../ui/compositor/compositor.gyp:compositor_unittests',
-            '../ui/display/display.gyp:display_unittests',
-            '../ui/events/events.gyp:events_unittests',
-            '../ui/gfx/gfx_tests.gyp:gfx_unittests',
-            '../ui/gl/gl_tests.gyp:gl_unittests',
-            '../ui/keyboard/keyboard.gyp:keyboard_unittests',
-            '../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests',
-            '../url/url.gyp:url_unittests',
-          ],
-        },
-      ],  # targets
-      'conditions': [
-        ['branding=="Chrome"', {
-          'targets': [
-            {
-              'target_name': 'chrome_official_builder_no_unittests',
-              'type': 'none',
-              'dependencies': [
-                '../chrome/chrome.gyp:crash_service',
-                '../chrome/chrome.gyp:gcapi_dll',
-                '../chrome/chrome.gyp:pack_policy_templates',
-                '../chrome/installer/mini_installer.gyp:mini_installer',
-                '../cloud_print/cloud_print.gyp:cloud_print',
-                '../courgette/courgette.gyp:courgette',
-                '../courgette/courgette.gyp:courgette64',
-                '../remoting/remoting.gyp:remoting_webapp',
-                '../third_party/widevine/cdm/widevine_cdm.gyp:widevinecdmadapter',
-              ],
-              'conditions': [
-                ['target_arch=="ia32"', {
-                  'dependencies': [
-                    '../chrome/chrome.gyp:crash_service_win64',
-                  ],
-                }],
-                ['component != "shared_library" and wix_exists == "True" and \
-                    sas_dll_exists == "True"', {
-                  'dependencies': [
-                    '../remoting/remoting.gyp:remoting_host_installation',
-                  ],
-                }], # component != "shared_library"
-              ]
-            }, {
-              'target_name': 'chrome_official_builder',
-              'type': 'none',
-              'dependencies': [
-                'chrome_official_builder_no_unittests',
-                '../base/base.gyp:base_unittests',
-                '../chrome/chrome.gyp:browser_tests',
-                '../chrome/chrome.gyp:sync_integration_tests',
-                '../ipc/ipc.gyp:ipc_tests',
-                '../media/media.gyp:media_unittests',
-                '../media/midi/midi.gyp:midi_unittests',
-                '../net/net.gyp:net_unittests',
-                '../printing/printing.gyp:printing_unittests',
-                '../sql/sql.gyp:sql_unittests',
-                '../sync/sync.gyp:sync_unit_tests',
-                '../ui/base/ui_base_tests.gyp:ui_base_unittests',
-                '../ui/gfx/gfx_tests.gyp:gfx_unittests',
-                '../ui/gl/gl_tests.gyp:gl_unittests',
-                '../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests',
-                '../ui/views/views.gyp:views_unittests',
-                '../url/url.gyp:url_unittests',
-              ],
-            },
-          ], # targets
-        }], # branding=="Chrome"
-       ], # conditions
-    }], # OS="win"
-    ['chromeos==1', {
-      'targets': [
-        {
-          'target_name': 'chromiumos_preflight',
-          'type': 'none',
-          'dependencies': [
-            '../breakpad/breakpad.gyp:minidump_stackwalk',
-            '../chrome/chrome.gyp:chrome',
-            '../chrome/chrome.gyp:chromedriver',
-            '../content/content_shell_and_tests.gyp:video_decode_accelerator_unittest',
-            '../content/content_shell_and_tests.gyp:video_encode_accelerator_unittest',
-            '../media/media.gyp:media_unittests',
-            '../ppapi/ppapi_internal.gyp:ppapi_example_video_decode',
-            '../sandbox/sandbox.gyp:chrome_sandbox',
-            '../sandbox/sandbox.gyp:sandbox_linux_unittests',
-            '../third_party/mesa/mesa.gyp:osmesa',
-            '../tools/telemetry/telemetry.gyp:bitmaptools#host',
-            '../tools/perf/clear_system_cache/clear_system_cache.gyp:clear_system_cache',
-          ],
-          'conditions': [
-            ['disable_nacl==0', {
-              'dependencies': [
-                '../components/nacl.gyp:nacl_helper',
-                '../native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp:nacl_helper_bootstrap',
-              ],
-            }],
-          ],
-        },
-      ],  # targets
-    }], # "chromeos==1"
-    ['use_aura==1', {
-      'targets': [
-        {
-          'target_name': 'aura_builder',
-          'type': 'none',
-          'dependencies': [
-            '../cc/blink/cc_blink_tests.gyp:cc_blink_unittests',
-            '../cc/cc_tests.gyp:cc_unittests',
-            '../components/components_tests.gyp:components_unittests',
-            '../content/content_shell_and_tests.gyp:content_browsertests',
-            '../content/content_shell_and_tests.gyp:content_unittests',
-            '../device/device_tests.gyp:device_unittests',
-            '../google_apis/gcm/gcm.gyp:gcm_unit_tests',
-            '../ppapi/ppapi_internal.gyp:ppapi_unittests',
-            '../remoting/remoting.gyp:remoting_unittests',
-            '../skia/skia_tests.gyp:skia_unittests',
-            '../ui/app_list/app_list.gyp:*',
-            '../ui/aura/aura.gyp:*',
-            '../ui/aura_extra/aura_extra.gyp:*',
-            '../ui/base/ui_base_tests.gyp:ui_base_unittests',
-            '../ui/compositor/compositor.gyp:*',
-            '../ui/display/display.gyp:display_unittests',
-            '../ui/events/events.gyp:*',
-            '../ui/gfx/gfx_tests.gyp:gfx_unittests',
-            '../ui/gl/gl_tests.gyp:gl_unittests',
-            '../ui/keyboard/keyboard.gyp:*',
-            '../ui/snapshot/snapshot.gyp:snapshot_unittests',
-            '../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests',
-            '../ui/wm/wm.gyp:*',
-            'blink_tests',
-          ],
-          'conditions': [
-            ['OS=="win"', {
-              'dependencies': [
-                '../chrome/chrome.gyp:crash_service',
-              ],
-            }],
-            ['OS=="win" and target_arch=="ia32"', {
-              'dependencies': [
-                '../chrome/chrome.gyp:crash_service_win64',
-              ],
-            }],
-            ['use_ash==1', {
-              'dependencies': [
-                '../ash/ash.gyp:ash_shell',
-                '../ash/ash.gyp:ash_unittests',
-              ],
-            }],
-            ['OS=="linux"', {
-              # Tests that currently only work on Linux.
-              'dependencies': [
-                '../base/base.gyp:base_unittests',
-                '../ipc/ipc.gyp:ipc_tests',
-                '../sql/sql.gyp:sql_unittests',
-                '../sync/sync.gyp:sync_unit_tests',
-              ],
-            }],
-            ['chromeos==1', {
-              'dependencies': [
-                '../chromeos/chromeos.gyp:chromeos_unittests',
-                '../ui/chromeos/ui_chromeos.gyp:ui_chromeos_unittests',
-              ],
-            }],
-            ['use_ozone==1', {
-              'dependencies': [
-                '../ui/ozone/ozone.gyp:*',
-                '../ui/ozone/demo/ozone_demos.gyp:*',
-              ],
-            }],
-            ['chromecast==0', {
-              'dependencies': [
-                '../chrome/chrome.gyp:browser_tests',
-                '../chrome/chrome.gyp:chrome',
-                '../chrome/chrome.gyp:interactive_ui_tests',
-                '../chrome/chrome.gyp:unit_tests',
-                '../ui/message_center/message_center.gyp:*',
-                '../ui/views/examples/examples.gyp:views_examples_with_content_exe',
-                '../ui/views/views.gyp:views',
-                '../ui/views/views.gyp:views_unittests',
-              ],
-            }],
-          ],
-        },
-      ],  # targets
-    }], # "use_aura==1"
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'chromium_swarm_tests',
-          'type': 'none',
-          'dependencies': [
-            '../base/base.gyp:base_unittests_run',
-            '../content/content_shell_and_tests.gyp:content_browsertests_run',
-            '../content/content_shell_and_tests.gyp:content_unittests_run',
-            '../net/net.gyp:net_unittests_run',
-          ],
-          'conditions': [
-            ['chromecast==0', {
-              'dependencies': [
-                '../chrome/chrome.gyp:browser_tests_run',
-                '../chrome/chrome.gyp:interactive_ui_tests_run',
-                '../chrome/chrome.gyp:sync_integration_tests_run',
-                '../chrome/chrome.gyp:unit_tests_run',
-              ],
-            }],
-          ],
-        }, # target_name: chromium_swarm_tests
-      ],
-    }],
-    ['archive_chromoting_tests==1', {
-      'targets': [
-        {
-          'target_name': 'chromoting_swarm_tests',
-          'type': 'none',
-          'dependencies': [
-            '../testing/chromoting/integration_tests.gyp:*',
-          ],
-        }, # target_name: chromoting_swarm_tests
-      ]
-    }],
-    ['OS=="mac" and toolkit_views==1', {
-      'targets': [
-        {
-          'target_name': 'macviews_builder',
-          'type': 'none',
-          'dependencies': [
-            '../ui/views/examples/examples.gyp:views_examples_with_content_exe',
-            '../ui/views/views.gyp:views',
-            '../ui/views/views.gyp:views_unittests',
-          ],
-        },  # target_name: macviews_builder
-      ],  # targets
-    }],  # os=='mac' and toolkit_views==1
-  ],  # conditions
-}
diff --git a/build/android/AndroidManifest.xml b/build/android/AndroidManifest.xml
deleted file mode 100644
index f27872e..0000000
--- a/build/android/AndroidManifest.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (c) 2012 The Chromium Authors. All rights reserved.  Use of this
-  source code is governed by a BSD-style license that can be found in the
-  LICENSE file.
--->
-
-<!--
-  This is a dummy manifest which is required by:
-  1. aapt when generating R.java in java.gypi:
-     Nothing in the manifest is used, but it is still required by aapt.
-  2. lint: [min|target]SdkVersion are required by lint and should
-     be kept up-to-date.
--->
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="dummy.package">
-
-    <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="22" />
-
-</manifest>
diff --git a/build/android/BUILD.gn b/build/android/BUILD.gn
deleted file mode 100644
index d90ad70..0000000
--- a/build/android/BUILD.gn
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import("//build/config/android/rules.gni")
-
-sun_tools_jar_path = "$root_gen_dir/sun_tools_jar/tools.jar"
-
-action("find_sun_tools_jar") {
-  script = "//build/android/gyp/find_sun_tools_jar.py"
-  depfile = "$target_gen_dir/$target_name.d"
-  outputs = [
-    depfile,
-    sun_tools_jar_path,
-  ]
-  args = [
-    "--depfile",
-    rebase_path(depfile, root_build_dir),
-    "--output",
-    rebase_path(sun_tools_jar_path, root_build_dir),
-  ]
-}
-
-java_prebuilt("sun_tools_java") {
-  jar_path = sun_tools_jar_path
-  jar_dep = ":find_sun_tools_jar"
-}
-
-action("cpplib_stripped") {
-  _strip_bin = "${android_tool_prefix}strip"
-  _soname = "libc++_shared.so"
-  _input_so = "${android_libcpp_root}/libs/${android_app_abi}/${_soname}"
-  _output_so = "${root_out_dir}/lib.stripped/${_soname}"
-
-  script = "//build/gn_run_binary.py"
-  inputs = [
-    _strip_bin,
-  ]
-  sources = [
-    _input_so,
-  ]
-  outputs = [
-    _output_so,
-  ]
-
-  _rebased_strip_bin = rebase_path(_strip_bin, root_out_dir)
-  _rebased_input_so = rebase_path(_input_so, root_out_dir)
-  _rebased_output_so = rebase_path(_output_so, root_out_dir)
-  args = [
-    _rebased_strip_bin,
-    "--strip-unneeded",
-    "-o",
-    _rebased_output_so,
-    _rebased_input_so,
-  ]
-}
diff --git a/build/android/CheckInstallApk-debug.apk b/build/android/CheckInstallApk-debug.apk
deleted file mode 100644
index 3dc31910..0000000
--- a/build/android/CheckInstallApk-debug.apk
+++ /dev/null
Binary files differ
diff --git a/build/android/OWNERS b/build/android/OWNERS
deleted file mode 100644
index 9a5d270..0000000
--- a/build/android/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-jbudorick@chromium.org
-klundberg@chromium.org
-pasko@chromium.org
diff --git a/build/android/PRESUBMIT.py b/build/android/PRESUBMIT.py
deleted file mode 100644
index 6e0a3de..0000000
--- a/build/android/PRESUBMIT.py
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Presubmit script for android buildbot.
-
-See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
-details on the presubmit API built into depot_tools.
-"""
-
-
-def CommonChecks(input_api, output_api):
-  output = []
-
-  def J(*dirs):
-    """Returns a path relative to presubmit directory."""
-    return input_api.os_path.join(input_api.PresubmitLocalPath(), *dirs)
-
-  output.extend(input_api.canned_checks.RunPylint(
-      input_api,
-      output_api,
-      black_list=[r'pylib/symbols/.*\.py$', r'gyp/.*\.py$', r'gn/.*\.py'],
-      extra_paths_list=[
-          J(), J('..', '..', 'third_party', 'android_testrunner'),
-          J('buildbot')]))
-  output.extend(input_api.canned_checks.RunPylint(
-      input_api,
-      output_api,
-      white_list=[r'gyp/.*\.py$', r'gn/.*\.py'],
-      extra_paths_list=[J('gyp'), J('gn')]))
-
-  # Disabled due to http://crbug.com/410936
-  #output.extend(input_api.canned_checks.RunUnitTestsInDirectory(
-  #input_api, output_api, J('buildbot', 'tests')))
-
-  pylib_test_env = dict(input_api.environ)
-  pylib_test_env.update({
-      'PYTHONPATH': input_api.PresubmitLocalPath(),
-      'PYTHONDONTWRITEBYTECODE': '1',
-  })
-  output.extend(input_api.canned_checks.RunUnitTests(
-      input_api,
-      output_api,
-      unit_tests=[
-          J('pylib', 'base', 'test_dispatcher_unittest.py'),
-          J('pylib', 'device', 'battery_utils_test.py'),
-          J('pylib', 'device', 'device_utils_test.py'),
-          J('pylib', 'device', 'logcat_monitor_test.py'),
-          J('pylib', 'gtest', 'gtest_test_instance_test.py'),
-          J('pylib', 'instrumentation',
-            'instrumentation_test_instance_test.py'),
-          J('pylib', 'results', 'json_results_test.py'),
-          J('pylib', 'utils', 'md5sum_test.py'),
-      ],
-      env=pylib_test_env))
-  return output
-
-
-def CheckChangeOnUpload(input_api, output_api):
-  return CommonChecks(input_api, output_api)
-
-
-def CheckChangeOnCommit(input_api, output_api):
-  return CommonChecks(input_api, output_api)
diff --git a/build/android/adb_android_webview_command_line b/build/android/adb_android_webview_command_line
deleted file mode 100755
index 791e270..0000000
--- a/build/android/adb_android_webview_command_line
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# If no flags are given, prints the current content shell flags.
-#
-# Otherwise, the given flags are used to REPLACE (not modify) the content shell
-# flags. For example:
-#   adb_android_webview_command_line --enable-webgl
-#
-# To remove all content shell flags, pass an empty string for the flags:
-#   adb_android_webview_command_line ""
-
-. $(dirname $0)/adb_command_line_functions.sh
-CMD_LINE_FILE=/data/local/tmp/android-webview-command-line
-REQUIRES_SU=0
-set_command_line "$@"
-
diff --git a/build/android/adb_chrome_public_command_line b/build/android/adb_chrome_public_command_line
deleted file mode 100755
index 9bf91c6..0000000
--- a/build/android/adb_chrome_public_command_line
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# If no flags are given, prints the current Chrome flags.
-#
-# Otherwise, the given flags are used to REPLACE (not modify) the Chrome
-# flags. For example:
-#   adb_chrome_public_command_line --enable-webgl
-#
-# To remove all Chrome flags, pass an empty string for the flags:
-#   adb_chrome_public_command_line ""
-
-. $(dirname $0)/adb_command_line_functions.sh
-CMD_LINE_FILE=/data/local/chrome-command-line
-REQUIRES_SU=1
-set_command_line "$@"
diff --git a/build/android/adb_chrome_shell_command_line b/build/android/adb_chrome_shell_command_line
deleted file mode 100755
index 750f906..0000000
--- a/build/android/adb_chrome_shell_command_line
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# If no flags are given, prints the current chrome shell flags.
-#
-# Otherwise, the given flags are used to REPLACE (not modify) the chrome shell
-# flags. For example:
-#   adb_chrome_shell_command_line --enable-webgl
-#
-# To remove all chrome shell flags, pass an empty string for the flags:
-#   adb_chrome_shell_command_line ""
-
-. $(dirname $0)/adb_command_line_functions.sh
-CMD_LINE_FILE=/data/local/tmp/chrome-shell-command-line
-REQUIRES_SU=0
-set_command_line "$@"
-
diff --git a/build/android/adb_command_line_functions.sh b/build/android/adb_command_line_functions.sh
deleted file mode 100755
index 7ea98b09..0000000
--- a/build/android/adb_command_line_functions.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Variables must be set before calling:
-# CMD_LINE_FILE - Path on device to flags file.
-# REQUIRES_SU - Set to 1 if path requires root.
-function set_command_line() {
-  SU_CMD=""
-  if [[ "$REQUIRES_SU" = 1 ]]; then
-    # Older androids accept "su -c", while newer use "su uid".
-    SDK_LEVEL=$(adb shell getprop ro.build.version.sdk | tr -d '\r')
-    # E.g. if no device connected.
-    if [[ -z "$SDK_LEVEL" ]]; then
-      exit 1
-    fi
-    SU_CMD="su -c"
-    if (( $SDK_LEVEL >= 21 )); then
-      SU_CMD="su 0"
-    fi
-  fi
-
-  if [ $# -eq 0 ] ; then
-    # If nothing specified, print the command line (stripping off "chrome ")
-    adb shell "cat $CMD_LINE_FILE 2>/dev/null" | cut -d ' ' -s -f2-
-  elif [ $# -eq 1 ] && [ "$1" = '' ] ; then
-    # If given an empty string, delete the command line.
-    set -x
-    adb shell $SU_CMD rm $CMD_LINE_FILE >/dev/null
-  else
-    # Else set it.
-    set -x
-    adb shell "echo 'chrome $*' | $SU_CMD dd of=$CMD_LINE_FILE"
-    # Prevent other apps from modifying flags (this can create security issues).
-    adb shell $SU_CMD chmod 0664 $CMD_LINE_FILE
-  fi
-}
-
diff --git a/build/android/adb_content_shell_command_line b/build/android/adb_content_shell_command_line
deleted file mode 100755
index 2ac7ece..0000000
--- a/build/android/adb_content_shell_command_line
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# If no flags are given, prints the current content shell flags.
-#
-# Otherwise, the given flags are used to REPLACE (not modify) the content shell
-# flags. For example:
-#   adb_content_shell_command_line --enable-webgl
-#
-# To remove all content shell flags, pass an empty string for the flags:
-#   adb_content_shell_command_line ""
-
-. $(dirname $0)/adb_command_line_functions.sh
-CMD_LINE_FILE=/data/local/tmp/content-shell-command-line
-REQUIRES_SU=0
-set_command_line "$@"
-
diff --git a/build/android/adb_device_functions.sh b/build/android/adb_device_functions.sh
deleted file mode 100755
index 66cc32f..0000000
--- a/build/android/adb_device_functions.sh
+++ /dev/null
@@ -1,139 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-# A collection of functions useful for maintaining android devices
-
-
-# Run an adb command on all connected device in parallel.
-# Usage: adb_all command line to eval.  Quoting is optional.
-#
-# Examples:
-#  adb_all install Chrome.apk
-#  adb_all 'shell cat /path/to/file'
-#
-adb_all() {
-  if [[ $# == 0 ]]; then
-    echo "Usage: adb_all <adb command>.  Quoting is optional."
-    echo "Example: adb_all install Chrome.apk"
-    return 1
-  fi
-  local DEVICES=$(adb_get_devices -b)
-  local NUM_DEVICES=$(echo $DEVICES | wc -w)
-  if (( $NUM_DEVICES > 1 )); then
-    echo "Looping over $NUM_DEVICES devices"
-  fi
-  _adb_multi "$DEVICES" "$*"
-}
-
-
-# Run a command on each connected device.  Quoting the command is suggested but
-# not required.  The script setups up variable DEVICE to correspond to the
-# current serial number.  Intended for complex one_liners that don't work in
-# adb_all
-# Usage: adb_device_loop 'command line to eval'
-adb_device_loop() {
-  if [[ $# == 0 ]]; then
-    echo "Intended for more complex one-liners that cannot be done with" \
-        "adb_all."
-    echo 'Usage: adb_device_loop "echo $DEVICE: $(adb root &&' \
-        'adb shell cat /data/local.prop)"'
-    return 1
-  fi
-  local DEVICES=$(adb_get_devices)
-  if [[ -z $DEVICES ]]; then
-    return
-  fi
-  # Do not change DEVICE variable name - part of api
-  for DEVICE in $DEVICES; do
-    DEV_TYPE=$(adb -s $DEVICE shell getprop ro.product.device | sed 's/\r//')
-    echo "Running on $DEVICE ($DEV_TYPE)"
-    ANDROID_SERIAL=$DEVICE eval "$*"
-  done
-}
-
-# Erases data from any devices visible on adb.  To preserve a device,
-# disconnect it or:
-#  1) Reboot it into fastboot with 'adb reboot bootloader'
-#  2) Run wipe_all_devices to wipe remaining devices
-#  3) Restore device it with 'fastboot reboot'
-#
-#  Usage: wipe_all_devices [-f]
-#
-wipe_all_devices() {
-  if [[ -z $(which adb) || -z $(which fastboot) ]]; then
-    echo "aborting: adb and fastboot not in path"
-    return 1
-  elif ! $(groups | grep -q 'plugdev'); then
-    echo "If fastboot fails, run: 'sudo adduser $(whoami) plugdev'"
-  fi
-
-  local DEVICES=$(adb_get_devices -b)
-
-  if [[ $1 != '-f' ]]; then
-    echo "This will ERASE ALL DATA from $(echo $DEVICES | wc -w) device."
-    read -p "Hit enter to continue"
-  fi
-
-  _adb_multi "$DEVICES" "reboot bootloader"
-  # Subshell to isolate job list
-  (
-  for DEVICE in $DEVICES; do
-    fastboot_erase $DEVICE &
-  done
-  wait
-  )
-
-  # Reboot devices together
-  for DEVICE in $DEVICES; do
-    fastboot -s $DEVICE reboot
-  done
-}
-
-# Wipe a device in fastboot.
-# Usage fastboot_erase [serial]
-fastboot_erase() {
-  if [[ -n $1 ]]; then
-    echo "Wiping $1"
-    local SERIAL="-s $1"
-  else
-    if [ -z $(fastboot devices) ]; then
-      echo "No devices in fastboot, aborting."
-      echo "Check out wipe_all_devices to see if sufficient"
-      echo "You can put a device in fastboot using adb reboot bootloader"
-      return 1
-    fi
-    local SERIAL=""
-  fi
-  fastboot $SERIAL erase cache
-  fastboot $SERIAL erase userdata
-}
-
-# Get list of devices connected via adb
-# Args: -b block until adb detects a device
-adb_get_devices() {
-  local DEVICES="$(adb devices | grep 'device$')"
-  if [[ -z $DEVICES && $1 == '-b' ]]; then
-    echo '- waiting for device -' >&2
-    local DEVICES="$(adb wait-for-device devices | grep 'device$')"
-  fi
-  echo "$DEVICES" | awk -vORS=' ' '{print $1}' | sed 's/ $/\n/'
-}
-
-###################################################
-## HELPER FUNCTIONS
-###################################################
-
-# Run an adb command in parallel over a device list
-_adb_multi() {
-  local DEVICES=$1
-  local ADB_ARGS=$2
-  (
-    for DEVICE in $DEVICES; do
-      adb -s $DEVICE $ADB_ARGS &
-    done
-    wait
-  )
-}
diff --git a/build/android/adb_gdb b/build/android/adb_gdb
deleted file mode 100755
index 65ec7b2..0000000
--- a/build/android/adb_gdb
+++ /dev/null
@@ -1,1047 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-
-# A generic script used to attach to a running Chromium process and
-# debug it. Most users should not use this directly, but one of the
-# wrapper scripts like adb_gdb_content_shell
-#
-# Use --help to print full usage instructions.
-#
-
-PROGNAME=$(basename "$0")
-PROGDIR=$(dirname "$0")
-
-# Location of Chromium-top-level sources.
-CHROMIUM_SRC=$(cd "$PROGDIR"/../.. >/dev/null && pwd 2>/dev/null)
-
-# Location of Chromium out/ directory.
-if [ -z "$CHROMIUM_OUT_DIR" ]; then
-  CHROMIUM_OUT_DIR=out
-fi
-
-TMPDIR=
-GDBSERVER_PIDFILE=
-TARGET_GDBSERVER=
-COMMAND_PREFIX=
-
-clean_exit () {
-  if [ "$TMPDIR" ]; then
-    GDBSERVER_PID=$(cat $GDBSERVER_PIDFILE 2>/dev/null)
-    if [ "$GDBSERVER_PID" ]; then
-      log "Killing background gdbserver process: $GDBSERVER_PID"
-      kill -9 $GDBSERVER_PID >/dev/null 2>&1
-    fi
-    if [ "$TARGET_GDBSERVER" ]; then
-      log "Removing target gdbserver binary: $TARGET_GDBSERVER."
-      "$ADB" shell "$COMMAND_PREFIX" rm "$TARGET_GDBSERVER" >/dev/null 2>&1
-    fi
-    log "Cleaning up: $TMPDIR"
-    rm -rf "$TMPDIR"
-  fi
-  trap "" EXIT
-  exit $1
-}
-
-# Ensure clean exit on Ctrl-C or normal exit.
-trap "clean_exit 1" INT HUP QUIT TERM
-trap "clean_exit \$?" EXIT
-
-panic () {
-  echo "ERROR: $@" >&2
-  exit 1
-}
-
-fail_panic () {
-  if [ $? != 0 ]; then panic "$@"; fi
-}
-
-log () {
-  if [ "$VERBOSE" -gt 0 ]; then
-    echo "$@"
-  fi
-}
-
-DEFAULT_PULL_LIBS_DIR=/tmp/$USER-adb-gdb-libs
-
-# NOTE: Allow wrapper scripts to set various default through ADB_GDB_XXX
-# environment variables. This is only for cosmetic reasons, i.e. to
-# display proper
-
-# Allow wrapper scripts to set the default activity through
-# the ADB_GDB_ACTIVITY variable. Users are still able to change the
-# final activity name through --activity=<name> option.
-#
-# This is only for cosmetic reasons, i.e. to display the proper default
-# in the --help output.
-#
-DEFAULT_ACTIVITY=${ADB_GDB_ACTIVITY:-".Main"}
-
-# Allow wrapper scripts to set the program name through ADB_GDB_PROGNAME
-PROGNAME=${ADB_GDB_PROGNAME:-$(basename "$0")}
-
-ACTIVITY=$DEFAULT_ACTIVITY
-ADB=
-ANNOTATE=
-# Note: Ignore BUILDTYPE variable, because the Ninja build doesn't use it.
-BUILDTYPE=
-FORCE=
-GDBEXEPOSTFIX=gdb
-GDBINIT=
-GDBSERVER=
-HELP=
-NDK_DIR=
-NO_PULL_LIBS=
-PACKAGE_NAME=
-PID=
-PORT=
-PRIVILEGED=
-PRIVILEGED_INDEX=
-PROGRAM_NAME="activity"
-PULL_LIBS=
-PULL_LIBS_DIR=
-SANDBOXED=
-SANDBOXED_INDEX=
-START=
-SU_PREFIX=
-SYMBOL_DIR=
-TARGET_ARCH=
-TOOLCHAIN=
-VERBOSE=0
-
-for opt; do
-  optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)')
-  case $opt in
-    --adb=*)
-      ADB=$optarg
-      ;;
-    --activity=*)
-      ACTIVITY=$optarg
-      ;;
-    --annotate=3)
-      ANNOTATE=$optarg
-      ;;
-    --force)
-      FORCE=true
-      ;;
-    --gdbserver=*)
-      GDBSERVER=$optarg
-      ;;
-    --gdb=*)
-      GDB=$optarg
-      ;;
-    --help|-h|-?)
-      HELP=true
-      ;;
-    --ndk-dir=*)
-      NDK_DIR=$optarg
-      ;;
-    --no-pull-libs)
-      NO_PULL_LIBS=true
-      ;;
-    --package-name=*)
-      PACKAGE_NAME=$optarg
-      ;;
-    --pid=*)
-      PID=$optarg
-      ;;
-    --port=*)
-      PORT=$optarg
-      ;;
-    --privileged)
-      PRIVILEGED=true
-      ;;
-    --privileged=*)
-      PRIVILEGED=true
-      PRIVILEGED_INDEX=$optarg
-      ;;
-    --program-name=*)
-      PROGRAM_NAME=$optarg
-      ;;
-    --pull-libs)
-      PULL_LIBS=true
-      ;;
-    --pull-libs-dir=*)
-      PULL_LIBS_DIR=$optarg
-      ;;
-    --sandboxed)
-      SANDBOXED=true
-      ;;
-    --sandboxed=*)
-      SANDBOXED=true
-      SANDBOXED_INDEX=$optarg
-      ;;
-    --script=*)
-      GDBINIT=$optarg
-      ;;
-    --start)
-      START=true
-      ;;
-    --su-prefix=*)
-      SU_PREFIX=$optarg
-      ;;
-    --symbol-dir=*)
-      SYMBOL_DIR=$optarg
-      ;;
-    --out-dir=*)
-      CHROMIUM_OUT_DIR=$optarg
-      ;;
-    --target-arch=*)
-      TARGET_ARCH=$optarg
-      ;;
-    --toolchain=*)
-      TOOLCHAIN=$optarg
-      ;;
-    --ui)
-      GDBEXEPOSTFIX=gdbtui
-      ;;
-    --verbose)
-      VERBOSE=$(( $VERBOSE + 1 ))
-      ;;
-    --debug)
-      BUILDTYPE=Debug
-      ;;
-    --release)
-      BUILDTYPE=Release
-      ;;
-    -*)
-      panic "Unknown option $OPT, see --help." >&2
-      ;;
-    *)
-      if [ "$PACKAGE_NAME" ]; then
-        panic "You can only provide a single package name as argument!\
- See --help."
-      fi
-      PACKAGE_NAME=$opt
-      ;;
-  esac
-done
-
-print_help_options () {
-  cat <<EOF
-EOF
-}
-
-if [ "$HELP" ]; then
-  if [ "$ADB_GDB_PROGNAME" ]; then
-    # Assume wrapper scripts all provide a default package name.
-    cat <<EOF
-Usage: $PROGNAME [options]
-
-Attach gdb to a running Android $PROGRAM_NAME process.
-EOF
-  else
-    # Assume this is a direct call to adb_gdb
-  cat <<EOF
-Usage: $PROGNAME [options] [<package-name>]
-
-Attach gdb to a running Android $PROGRAM_NAME process.
-
-If provided, <package-name> must be the name of the Android application's
-package name to be debugged. You can also use --package-name=<name> to
-specify it.
-EOF
-  fi
-
-  cat <<EOF
-
-This script is used to debug a running $PROGRAM_NAME process.
-This can be a regular Android application process, sandboxed (if you use the
---sandboxed or --sandboxed=<num> option) or a privileged (--privileged or
---privileged=<num>) service.
-
-This script needs several things to work properly. It will try to pick
-them up automatically for you though:
-
-   - target gdbserver binary
-   - host gdb client (e.g. arm-linux-androideabi-gdb)
-   - directory with symbolic version of $PROGRAM_NAME's shared libraries.
-
-You can also use --ndk-dir=<path> to specify an alternative NDK installation
-directory.
-
-The script tries to find the most recent version of the debug version of
-shared libraries under one of the following directories:
-
-  \$CHROMIUM_SRC/<out>/Release/lib/           (used by Ninja builds)
-  \$CHROMIUM_SRC/<out>/Debug/lib/             (used by Ninja builds)
-  \$CHROMIUM_SRC/<out>/Release/lib.target/    (used by Make builds)
-  \$CHROMIUM_SRC/<out>/Debug/lib.target/      (used by Make builds)
-
-Where <out> is 'out' by default, unless the --out=<name> option is used or
-the CHROMIUM_OUT_DIR environment variable is defined.
-
-You can restrict this search by using --release or --debug to specify the
-build type, or simply use --symbol-dir=<path> to specify the file manually.
-
-The script tries to extract the target architecture from your target device,
-but if this fails, will default to 'arm'. Use --target-arch=<name> to force
-its value.
-
-Otherwise, the script will complain, but you can use the --gdbserver,
---gdb and --symbol-lib options to specify everything manually.
-
-An alternative to --gdb=<file> is to use --toollchain=<path> to specify
-the path to the host target-specific cross-toolchain.
-
-You will also need the 'adb' tool in your path. Otherwise, use the --adb
-option. The script will complain if there is more than one device connected
-and ANDROID_SERIAL is not defined.
-
-The first time you use it on a device, the script will pull many system
-libraries required by the process into a temporary directory. This
-is done to strongly improve the debugging experience, like allowing
-readable thread stacks and more. The libraries are copied to the following
-directory by default:
-
-  $DEFAULT_PULL_LIBS_DIR/
-
-But you can use the --pull-libs-dir=<path> option to specify an
-alternative. The script can detect when you change the connected device,
-and will re-pull the libraries only in this case. You can however force it
-with the --pull-libs option.
-
-Any local .gdbinit script will be ignored, but it is possible to pass a
-gdb command script with the --script=<file> option. Note that its commands
-will be passed to gdb after the remote connection and library symbol
-loading have completed.
-
-Valid options:
-  --help|-h|-?          Print this message.
-  --verbose             Increase verbosity.
-
-  --sandboxed           Debug first sandboxed process we find.
-  --sandboxed=<num>     Debug specific sandboxed process.
-  --symbol-dir=<path>   Specify directory with symbol shared libraries.
-  --out-dir=<path>      Specify the out directory.
-  --package-name=<name> Specify package name (alternative to 1st argument).
-  --privileged          Debug first privileged process we find.
-  --privileged=<num>    Debug specific privileged process.
-  --program-name=<name> Specify program name (cosmetic only).
-  --pid=<pid>           Specify application process pid.
-  --force               Kill any previous debugging session, if any.
-  --start               Start package's activity on device.
-  --ui                  Use gdbtui instead of gdb
-  --activity=<name>     Activity name for --start [$DEFAULT_ACTIVITY].
-  --annotate=<num>      Enable gdb annotation.
-  --script=<file>       Specify extra GDB init script.
-
-  --gdbserver=<file>    Specify target gdbserver binary.
-  --gdb=<file>          Specify host gdb client binary.
-  --target-arch=<name>  Specify NDK target arch.
-  --adb=<file>          Specify host ADB binary.
-  --port=<port>         Specify the tcp port to use.
-
-  --su-prefix=<prefix>  Prepend <prefix> to 'adb shell' commands that are
-                        run by this script. This can be useful to use
-                        the 'su' program on rooted production devices.
-                        e.g. --su-prefix="su -c"
-
-  --pull-libs           Force system libraries extraction.
-  --no-pull-libs        Do not extract any system library.
-  --libs-dir=<path>     Specify system libraries extraction directory.
-
-  --debug               Use libraries under out/Debug.
-  --release             Use libraries under out/Release.
-
-EOF
-  exit 0
-fi
-
-if [ -z "$PACKAGE_NAME" ]; then
-  panic "Please specify a package name on the command line. See --help."
-fi
-
-if [ -z "$NDK_DIR" ]; then
-  ANDROID_NDK_ROOT=$(PYTHONPATH=$CHROMIUM_SRC/build/android python -c \
-'from pylib.constants import ANDROID_NDK_ROOT; print ANDROID_NDK_ROOT,')
-else
-  if [ ! -d "$NDK_DIR" ]; then
-    panic "Invalid directory: $NDK_DIR"
-  fi
-  if [ ! -f "$NDK_DIR/ndk-build" ]; then
-    panic "Not a valid NDK directory: $NDK_DIR"
-  fi
-  ANDROID_NDK_ROOT=$NDK_DIR
-fi
-
-if [ "$GDBINIT" -a ! -f "$GDBINIT" ]; then
-  panic "Unknown --script file: $GDBINIT"
-fi
-
-# Check that ADB is in our path
-if [ -z "$ADB" ]; then
-  ADB=$(which adb 2>/dev/null)
-  if [ -z "$ADB" ]; then
-    panic "Can't find 'adb' tool in your path. Install it or use \
---adb=<file>"
-  fi
-  log "Auto-config: --adb=$ADB"
-fi
-
-# Check that it works minimally
-ADB_VERSION=$($ADB version 2>/dev/null)
-echo "$ADB_VERSION" | fgrep -q -e "Android Debug Bridge"
-if [ $? != 0 ]; then
-  panic "Your 'adb' tool seems invalid, use --adb=<file> to specify a \
-different one: $ADB"
-fi
-
-# If there are more than one device connected, and ANDROID_SERIAL is not
-# defined, print an error message.
-NUM_DEVICES_PLUS2=$($ADB devices 2>/dev/null | wc -l)
-if [ "$NUM_DEVICES_PLUS2" -lt 3 -a -z "$ANDROID_SERIAL" ]; then
-  echo "ERROR: There is more than one Android device connected to ADB."
-  echo "Please define ANDROID_SERIAL to specify which one to use."
-  exit 1
-fi
-
-# Run a command through adb shell, strip the extra \r from the output
-# and return the correct status code to detect failures. This assumes
-# that the adb shell command prints a final \n to stdout.
-# $1+: command to run
-# Out: command's stdout
-# Return: command's status
-# Note: the command's stderr is lost
-adb_shell () {
-  local TMPOUT="$(mktemp)"
-  local LASTLINE RET
-  local ADB=${ADB:-adb}
-
-  # The weird sed rule is to strip the final \r on each output line
-  # Since 'adb shell' never returns the command's proper exit/status code,
-  # we force it to print it as '%%<status>' in the temporary output file,
-  # which we will later strip from it.
-  $ADB shell $@ ";" echo "%%\$?" 2>/dev/null | \
-      sed -e 's![[:cntrl:]]!!g' > $TMPOUT
-  # Get last line in log, which contains the exit code from the command
-  LASTLINE=$(sed -e '$!d' $TMPOUT)
-  # Extract the status code from the end of the line, which must
-  # be '%%<code>'.
-  RET=$(echo "$LASTLINE" | \
-    awk '{ if (match($0, "%%[0-9]+$")) { print substr($0,RSTART+2); } }')
-  # Remove the status code from the last line. Note that this may result
-  # in an empty line.
-  LASTLINE=$(echo "$LASTLINE" | \
-    awk '{ if (match($0, "%%[0-9]+$")) { print substr($0,1,RSTART-1); } }')
-  # The output itself: all lines except the status code.
-  sed -e '$d' $TMPOUT && printf "%s" "$LASTLINE"
-  # Remove temp file.
-  rm -f $TMPOUT
-  # Exit with the appropriate status.
-  return $RET
-}
-
-# Find the target architecture from the target device.
-# This returns an NDK-compatible architecture name.
-# out: NDK Architecture name, or empty string.
-get_gyp_target_arch () {
-  local ARCH=$(adb_shell getprop ro.product.cpu.abi)
-  case $ARCH in
-    mips|x86|x86_64) echo "$ARCH";;
-    arm64*) echo "arm64";;
-    arm*) echo "arm";;
-    *) echo "";
-  esac
-}
-
-if [ -z "$TARGET_ARCH" ]; then
-  TARGET_ARCH=$(get_gyp_target_arch)
-  if [ -z "$TARGET_ARCH" ]; then
-    TARGET_ARCH=arm
-  fi
-else
-  # Nit: accept Chromium's 'ia32' as a valid target architecture. This
-  # script prefers the NDK 'x86' name instead because it uses it to find
-  # NDK-specific files (host gdb) with it.
-  if [ "$TARGET_ARCH" = "ia32" ]; then
-    TARGET_ARCH=x86
-    log "Auto-config: --arch=$TARGET_ARCH  (equivalent to ia32)"
-  fi
-fi
-
-# Detect the NDK system name, i.e. the name used to identify the host.
-# out: NDK system name (e.g. 'linux' or 'darwin')
-get_ndk_host_system () {
-  local HOST_OS
-  if [ -z "$NDK_HOST_SYSTEM" ]; then
-    HOST_OS=$(uname -s)
-    case $HOST_OS in
-      Linux) NDK_HOST_SYSTEM=linux;;
-      Darwin) NDK_HOST_SYSTEM=darwin;;
-      *) panic "You can't run this script on this system: $HOST_OS";;
-    esac
-  fi
-  echo "$NDK_HOST_SYSTEM"
-}
-
-# Detect the NDK host architecture name.
-# out: NDK arch name (e.g. 'x86' or 'x86_64')
-get_ndk_host_arch () {
-  local HOST_ARCH HOST_OS
-  if [ -z "$NDK_HOST_ARCH" ]; then
-    HOST_OS=$(get_ndk_host_system)
-    HOST_ARCH=$(uname -p)
-    case $HOST_ARCH in
-      i?86) NDK_HOST_ARCH=x86;;
-      x86_64|amd64) NDK_HOST_ARCH=x86_64;;
-      *) panic "You can't run this script on this host architecture: $HOST_ARCH";;
-    esac
-    # Darwin trick: "uname -p" always returns i386 on 64-bit installations.
-    if [ "$HOST_OS" = darwin -a "$NDK_HOST_ARCH" = "x86" ]; then
-      # Use '/usr/bin/file', not just 'file' to avoid buggy MacPorts
-      # implementations of the tool. See http://b.android.com/53769
-      HOST_64BITS=$(/usr/bin/file -L "$SHELL" | grep -e "x86[_-]64")
-      if [ "$HOST_64BITS" ]; then
-        NDK_HOST_ARCH=x86_64
-      fi
-    fi
-  fi
-  echo "$NDK_HOST_ARCH"
-}
-
-# Convert an NDK architecture name into a GNU configure triplet.
-# $1: NDK architecture name (e.g. 'arm')
-# Out: Android GNU configure triplet (e.g. 'arm-linux-androideabi')
-get_arch_gnu_config () {
-  case $1 in
-    arm)
-      echo "arm-linux-androideabi"
-      ;;
-    arm64)
-      echo "aarch64-linux-android"
-      ;;
-    x86)
-      echo "i686-linux-android"
-      ;;
-    x86_64)
-      echo "x86_64-linux-android"
-      ;;
-    mips)
-      echo "mipsel-linux-android"
-      ;;
-    *)
-      echo "$ARCH-linux-android"
-      ;;
-  esac
-}
-
-# Convert an NDK architecture name into a toolchain name prefix
-# $1: NDK architecture name (e.g. 'arm')
-# Out: NDK toolchain name prefix (e.g. 'arm-linux-androideabi')
-get_arch_toolchain_prefix () {
-  # Return the configure triplet, except for x86!
-  if [ "$1" = "x86" ]; then
-    echo "$1"
-  else
-    get_arch_gnu_config $1
-  fi
-}
-
-# Find a NDK toolchain prebuilt file or sub-directory.
-# This will probe the various arch-specific toolchain directories
-# in the NDK for the needed file.
-# $1: NDK install path
-# $2: NDK architecture name
-# $3: prebuilt sub-path to look for.
-# Out: file path, or empty if none is found.
-get_ndk_toolchain_prebuilt () {
-  local NDK_DIR="${1%/}"
-  local ARCH="$2"
-  local SUBPATH="$3"
-  local NAME="$(get_arch_toolchain_prefix $ARCH)"
-  local FILE TARGET
-  FILE=$NDK_DIR/toolchains/$NAME-4.9/prebuilt/$SUBPATH
-  if [ ! -f "$FILE" ]; then
-    FILE=$NDK_DIR/toolchains/$NAME-4.8/prebuilt/$SUBPATH
-    if [ ! -f "$FILE" ]; then
-      FILE=
-    fi
-  fi
-  echo "$FILE"
-}
-
-# Find the path to an NDK's toolchain full prefix for a given architecture
-# $1: NDK install path
-# $2: NDK target architecture name
-# Out: install path + binary prefix (e.g.
-#      ".../path/to/bin/arm-linux-androideabi-")
-get_ndk_toolchain_fullprefix () {
-  local NDK_DIR="$1"
-  local ARCH="$2"
-  local TARGET NAME HOST_OS HOST_ARCH GCC CONFIG
-
-  # NOTE: This will need to be updated if the NDK changes the names or moves
-  #        the location of its prebuilt toolchains.
-  #
-  GCC=
-  HOST_OS=$(get_ndk_host_system)
-  HOST_ARCH=$(get_ndk_host_arch)
-  CONFIG=$(get_arch_gnu_config $ARCH)
-  GCC=$(get_ndk_toolchain_prebuilt \
-        "$NDK_DIR" "$ARCH" "$HOST_OS-$HOST_ARCH/bin/$CONFIG-gcc")
-  if [ -z "$GCC" -a "$HOST_ARCH" = "x86_64" ]; then
-    GCC=$(get_ndk_toolchain_prebuilt \
-          "$NDK_DIR" "$ARCH" "$HOST_OS-x86/bin/$CONFIG-gcc")
-  fi
-  if [ ! -f "$GCC" -a "$ARCH" = "x86" ]; then
-    # Special case, the x86 toolchain used to be incorrectly
-    # named i686-android-linux-gcc!
-    GCC=$(get_ndk_toolchain_prebuilt \
-          "$NDK_DIR" "$ARCH" "$HOST_OS-x86/bin/i686-android-linux-gcc")
-  fi
-  if [ -z "$GCC" ]; then
-    panic "Cannot find Android NDK toolchain for '$ARCH' architecture. \
-Please verify your NDK installation!"
-  fi
-  echo "${GCC%%gcc}"
-}
-
-# $1: NDK install path
-# $2: target architecture.
-get_ndk_gdbserver () {
-  local NDK_DIR="$1"
-  local ARCH=$2
-  local BINARY
-
-  # The location has moved after NDK r8
-  BINARY=$NDK_DIR/prebuilt/android-$ARCH/gdbserver/gdbserver
-  if [ ! -f "$BINARY" ]; then
-    BINARY=$(get_ndk_toolchain_prebuilt "$NDK_DIR" "$ARCH" gdbserver)
-  fi
-  echo "$BINARY"
-}
-
-# Check/probe the path to the Android toolchain installation. Always
-# use the NDK versions of gdb and gdbserver. They must match to avoid
-# issues when both binaries do not speak the same wire protocol.
-#
-if [ -z "$TOOLCHAIN" ]; then
-  ANDROID_TOOLCHAIN=$(get_ndk_toolchain_fullprefix \
-                      "$ANDROID_NDK_ROOT" "$TARGET_ARCH")
-  ANDROID_TOOLCHAIN=$(dirname "$ANDROID_TOOLCHAIN")
-  log "Auto-config: --toolchain=$ANDROID_TOOLCHAIN"
-else
-  # Be flexible, allow one to specify either the install path or the bin
-  # sub-directory in --toolchain:
-  #
-  if [ -d "$TOOLCHAIN/bin" ]; then
-    TOOLCHAIN=$TOOLCHAIN/bin
-  fi
-  ANDROID_TOOLCHAIN=$TOOLCHAIN
-fi
-
-# Cosmetic: Remove trailing directory separator.
-ANDROID_TOOLCHAIN=${ANDROID_TOOLCHAIN%/}
-
-# Find host GDB client binary
-if [ -z "$GDB" ]; then
-  GDB=$(which $ANDROID_TOOLCHAIN/*-$GDBEXEPOSTFIX 2>/dev/null | head -1)
-  if [ -z "$GDB" ]; then
-    panic "Can't find Android gdb client in your path, check your \
---toolchain or --gdb path."
-  fi
-  log "Host gdb client: $GDB"
-fi
-
-# Find gdbserver binary, we will later push it to /data/local/tmp
-# This ensures that both gdbserver and $GDB talk the same binary protocol,
-# otherwise weird problems will appear.
-#
-if [ -z "$GDBSERVER" ]; then
-  GDBSERVER=$(get_ndk_gdbserver "$ANDROID_NDK_ROOT" "$TARGET_ARCH")
-  if [ -z "$GDBSERVER" ]; then
-    panic "Can't find NDK gdbserver binary. use --gdbserver to specify \
-valid one!"
-  fi
-  log "Auto-config: --gdbserver=$GDBSERVER"
-fi
-
-# A unique ID for this script's session. This needs to be the same in all
-# sub-shell commands we're going to launch, so take the PID of the launcher
-# process.
-TMP_ID=$$
-
-# Temporary directory, will get cleaned up on exit.
-TMPDIR=/tmp/$USER-adb-gdb-tmp-$TMP_ID
-mkdir -p "$TMPDIR" && rm -rf "$TMPDIR"/*
-
-GDBSERVER_PIDFILE="$TMPDIR"/gdbserver-$TMP_ID.pid
-
-# If --force is specified, try to kill any gdbserver process started by the
-# same user on the device. Normally, these are killed automatically by the
-# script on exit, but there are a few corner cases where this would still
-# be needed.
-if [ "$FORCE" ]; then
-  GDBSERVER_PIDS=$(adb_shell ps | awk '$9 ~ /gdbserver/ { print $2; }')
-  for GDB_PID in $GDBSERVER_PIDS; do
-    log "Killing previous gdbserver (PID=$GDB_PID)"
-    adb_shell kill -9 $GDB_PID
-  done
-fi
-
-if [ "$START" ]; then
-  log "Starting $PROGRAM_NAME on device."
-  adb_shell am start -n $PACKAGE_NAME/$ACTIVITY 2>/dev/null
-  adb_shell ps | grep -q $PACKAGE_NAME
-  fail_panic "Could not start $PROGRAM_NAME on device. Are you sure the \
-package is installed?"
-fi
-
-# Return the timestamp of a given time, as number of seconds since epoch.
-# $1: file path
-# Out: file timestamp
-get_file_timestamp () {
-  stat -c %Y "$1" 2>/dev/null
-}
-
-# Detect the build type and symbol directory. This is done by finding
-# the most recent sub-directory containing debug shared libraries under
-# $CHROMIUM_SRC/$CHROMIUM_OUT_DIR/
-#
-# $1: $BUILDTYPE value, can be empty
-# Out: nothing, but this sets SYMBOL_DIR
-#
-detect_symbol_dir () {
-  local SUBDIRS SUBDIR LIST DIR DIR_LIBS TSTAMP
-  # Note: Ninja places debug libraries under out/$BUILDTYPE/lib/, while
-  # Make places then under out/$BUILDTYPE/lib.target.
-  if [ "$1" ]; then
-    SUBDIRS="$1/lib $1/lib.target"
-  else
-    SUBDIRS="Release/lib Debug/lib Release/lib.target Debug/lib.target"
-  fi
-  LIST=$TMPDIR/scan-subdirs-$$.txt
-  printf "" > "$LIST"
-  for SUBDIR in $SUBDIRS; do
-    DIR=$CHROMIUM_SRC/$CHROMIUM_OUT_DIR/$SUBDIR
-    if [ -d "$DIR" ]; then
-      # Ignore build directories that don't contain symbol versions
-      # of the shared libraries.
-      DIR_LIBS=$(ls "$DIR"/lib*.so 2>/dev/null)
-      if [ -z "$DIR_LIBS" ]; then
-        echo "No shared libs: $DIR"
-        continue
-      fi
-      TSTAMP=$(get_file_timestamp "$DIR")
-      printf "%s %s\n" "$TSTAMP" "$SUBDIR" >> "$LIST"
-    fi
-  done
-  SUBDIR=$(cat $LIST | sort -r | head -1 | cut -d" " -f2)
-  rm -f "$LIST"
-
-  if [ -z "$SUBDIR" ]; then
-    if [ -z "$1" ]; then
-      panic "Could not find any build directory under \
-$CHROMIUM_SRC/$CHROMIUM_OUT_DIR. Please build the program first!"
-    else
-      panic "Could not find any $1 directory under \
-$CHROMIUM_SRC/$CHROMIUM_OUT_DIR. Check your build type!"
-    fi
-  fi
-
-  SYMBOL_DIR=$CHROMIUM_SRC/$CHROMIUM_OUT_DIR/$SUBDIR
-  log "Auto-config: --symbol-dir=$SYMBOL_DIR"
-}
-
-if [ -z "$SYMBOL_DIR" ]; then
-  detect_symbol_dir "$BUILDTYPE"
-fi
-
-# Allow several concurrent debugging sessions
-TARGET_GDBSERVER=/data/data/$PACKAGE_NAME/gdbserver-adb-gdb-$TMP_ID
-TMP_TARGET_GDBSERVER=/data/local/tmp/gdbserver-adb-gdb-$TMP_ID
-
-# Return the build fingerprint contained in a build.prop file.
-# $1: path to build.prop file
-get_build_fingerprint_from () {
-  cat "$1" | grep -e '^ro.build.fingerprint=' | cut -d= -f2
-}
-
-
-ORG_PULL_LIBS_DIR=$PULL_LIBS_DIR
-PULL_LIBS_DIR=${PULL_LIBS_DIR:-$DEFAULT_PULL_LIBS_DIR}
-
-HOST_FINGERPRINT=
-DEVICE_FINGERPRINT=$(adb_shell getprop ro.build.fingerprint)
-log "Device build fingerprint: $DEVICE_FINGERPRINT"
-
-# If --pull-libs-dir is not specified, and this is a platform build, look
-# if we can use the symbolic libraries under $ANDROID_PRODUCT_OUT/symbols/
-# directly, if the build fingerprint matches the device.
-if [ -z "$ORG_PULL_LIBS_DIR" -a \
-     "$ANDROID_PRODUCT_OUT" -a \
-     -f "$ANDROID_PRODUCT_OUT/system/build.prop" ]; then
-  ANDROID_FINGERPRINT=$(get_build_fingerprint_from \
-                        "$ANDROID_PRODUCT_OUT"/system/build.prop)
-  log "Android build fingerprint:  $ANDROID_FINGERPRINT"
-  if [ "$ANDROID_FINGERPRINT" = "$DEVICE_FINGERPRINT" ]; then
-    log "Perfect match!"
-    PULL_LIBS_DIR=$ANDROID_PRODUCT_OUT/symbols
-    HOST_FINGERPRINT=$ANDROID_FINGERPRINT
-    if [ "$PULL_LIBS" ]; then
-      log "Ignoring --pull-libs since the device and platform build \
-fingerprints match."
-      NO_PULL_LIBS=true
-    fi
-  fi
-fi
-
-# If neither --pull-libs an --no-pull-libs were specified, check the build
-# fingerprints of the device, and the cached system libraries on the host.
-#
-if [ -z "$NO_PULL_LIBS" -a -z "$PULL_LIBS" ]; then
-  if [ ! -f "$PULL_LIBS_DIR/build.prop" ]; then
-    log "Auto-config: --pull-libs  (no cached libraries)"
-    PULL_LIBS=true
-  else
-    HOST_FINGERPRINT=$(get_build_fingerprint_from "$PULL_LIBS_DIR/build.prop")
-    log "Host build fingerprint:   $HOST_FINGERPRINT"
-    if [ "$HOST_FINGERPRINT" == "$DEVICE_FINGERPRINT" ]; then
-      log "Auto-config: --no-pull-libs (fingerprint match)"
-      NO_PULL_LIBS=true
-    else
-      log "Auto-config: --pull-libs  (fingerprint mismatch)"
-      PULL_LIBS=true
-    fi
-  fi
-fi
-
-# Extract the system libraries from the device if necessary.
-if [ "$PULL_LIBS" -a -z "$NO_PULL_LIBS" ]; then
-  echo "Extracting system libraries into: $PULL_LIBS_DIR"
-fi
-
-mkdir -p "$PULL_LIBS_DIR"
-fail_panic "Can't create --libs-dir directory: $PULL_LIBS_DIR"
-
-# If requested, work for M-x gdb.  The gdb indirections make it
-# difficult to pass --annotate=3 to the gdb binary itself.
-GDB_ARGS=
-if [ "$ANNOTATE" ]; then
-  GDB_ARGS=$GDB_ARGS" --annotate=$ANNOTATE"
-fi
-
-# Get the PID from the first argument or else find the PID of the
-# browser process.
-if [ -z "$PID" ]; then
-  PROCESSNAME=$PACKAGE_NAME
-  if [ "$SANDBOXED_INDEX" ]; then
-    PROCESSNAME=$PROCESSNAME:sandboxed_process$SANDBOXED_INDEX
-  elif [ "$SANDBOXED" ]; then
-    PROCESSNAME=$PROCESSNAME:sandboxed_process
-    PID=$(adb_shell ps | \
-          awk '$9 ~ /^'$PROCESSNAME'/ { print $2; }' | head -1)
-  elif [ "$PRIVILEGED_INDEX" ]; then
-    PROCESSNAME=$PROCESSNAME:privileged_process$PRIVILEGED_INDEX
-  elif [ "$PRIVILEGED" ]; then
-    PROCESSNAME=$PROCESSNAME:privileged_process
-    PID=$(adb_shell ps | \
-          awk '$9 ~ /^'$PROCESSNAME'/ { print $2; }' | head -1)
-  fi
-  if [ -z "$PID" ]; then
-    PID=$(adb_shell ps | \
-          awk '$9 == "'$PROCESSNAME'" { print $2; }' | head -1)
-  fi
-  if [ -z "$PID" ]; then
-    if [ "$START" ]; then
-      panic "Can't find application process PID, did it crash?"
-    else
-      panic "Can't find application process PID, are you sure it is \
-running? Try using --start."
-    fi
-  fi
-  log "Found process PID: $PID"
-elif [ "$SANDBOXED" ]; then
-  echo "WARNING: --sandboxed option ignored due to use of --pid."
-elif [ "$PRIVILEGED" ]; then
-  echo "WARNING: --privileged option ignored due to use of --pid."
-fi
-
-# Determine if 'adb shell' runs as root or not.
-# If so, we can launch gdbserver directly, otherwise, we have to
-# use run-as $PACKAGE_NAME ..., which requires the package to be debuggable.
-#
-if [ "$SU_PREFIX" ]; then
-  # Need to check that this works properly.
-  SU_PREFIX_TEST_LOG=$TMPDIR/su-prefix.log
-  adb_shell $SU_PREFIX \"echo "foo"\" > $SU_PREFIX_TEST_LOG 2>&1
-  if [ $? != 0 -o "$(cat $SU_PREFIX_TEST_LOG)" != "foo" ]; then
-    echo "ERROR: Cannot use '$SU_PREFIX' as a valid su prefix:"
-    echo "$ adb shell $SU_PREFIX \"echo foo\""
-    cat $SU_PREFIX_TEST_LOG
-    exit 1
-  fi
-  COMMAND_PREFIX="$SU_PREFIX \""
-  COMMAND_SUFFIX="\""
-else
-  SHELL_UID=$(adb shell cat /proc/self/status | \
-              awk '$1 == "Uid:" { print $2; }')
-  log "Shell UID: $SHELL_UID"
-  if [ "$SHELL_UID" != 0 -o -n "$NO_ROOT" ]; then
-    COMMAND_PREFIX="run-as $PACKAGE_NAME"
-    COMMAND_SUFFIX=
-  else
-    COMMAND_PREFIX=
-    COMMAND_SUFFIX=
-  fi
-fi
-log "Command prefix: '$COMMAND_PREFIX'"
-log "Command suffix: '$COMMAND_SUFFIX'"
-
-# Pull device's system libraries that are mapped by our process.
-# Pulling all system libraries is too long, so determine which ones
-# we need by looking at /proc/$PID/maps instead
-if [ "$PULL_LIBS" -a -z "$NO_PULL_LIBS" ]; then
-  echo "Extracting system libraries into: $PULL_LIBS_DIR"
-  rm -f $PULL_LIBS_DIR/build.prop
-  MAPPINGS=$(adb_shell $COMMAND_PREFIX cat /proc/$PID/maps $COMMAND_SUFFIX)
-  if [ $? != 0 ]; then
-    echo "ERROR: Could not list process's memory mappings."
-    if [ "$SU_PREFIX" ]; then
-      panic "Are you sure your --su-prefix is correct?"
-    else
-      panic "Use --su-prefix if the application is not debuggable."
-    fi
-  fi
-  SYSTEM_LIBS=$(echo "$MAPPINGS" | \
-      awk '$6 ~ /\/system\/.*\.so$/ { print $6; }' | sort -u)
-  for SYSLIB in /system/bin/linker $SYSTEM_LIBS; do
-    echo "Pulling from device: $SYSLIB"
-    DST_FILE=$PULL_LIBS_DIR$SYSLIB
-    DST_DIR=$(dirname "$DST_FILE")
-    mkdir -p "$DST_DIR" && adb pull $SYSLIB "$DST_FILE" 2>/dev/null
-    fail_panic "Could not pull $SYSLIB from device !?"
-  done
-  echo "Pulling device build.prop"
-  adb pull /system/build.prop $PULL_LIBS_DIR/build.prop
-  fail_panic "Could not pull device build.prop !?"
-fi
-
-# Find all the sub-directories of $PULL_LIBS_DIR, up to depth 4
-# so we can add them to solib-search-path later.
-SOLIB_DIRS=$(find $PULL_LIBS_DIR -mindepth 1 -maxdepth 4 -type d | \
-             grep -v "^$" | tr '\n' ':')
-
-# This is a re-implementation of gdbclient, where we use compatible
-# versions of gdbserver and $GDBNAME to ensure that everything works
-# properly.
-#
-
-# Push gdbserver to the device
-log "Pushing gdbserver $GDBSERVER to $TARGET_GDBSERVER"
-adb push $GDBSERVER $TMP_TARGET_GDBSERVER &>/dev/null
-adb shell $COMMAND_PREFIX cp $TMP_TARGET_GDBSERVER $TARGET_GDBSERVER
-adb shell rm $TMP_TARGET_GDBSERVER
-fail_panic "Could not copy gdbserver to the device!"
-
-if [ -z "$PORT" ]; then
-    PORT=5039
-fi
-HOST_PORT=$PORT
-TARGET_PORT=$PORT
-
-# Select correct app_process for architecture.
-case $TARGET_ARCH in
-      arm|x86|mips) GDBEXEC=app_process;;
-      arm64|x86_64) GDBEXEC=app_process64;;
-      *) fail_panic "Unknown app_process for architecture!";;
-esac
-
-# Detect AddressSanitizer setup on the device. In that case app_process is a
-# script, and the real executable is app_process.real.
-GDBEXEC_ASAN=app_process.real
-adb_shell ls /system/bin/$GDBEXEC_ASAN
-if [ $? == 0 ]; then
-    GDBEXEC=$GDBEXEC_ASAN
-fi
-
-# Pull the app_process binary from the device.
-log "Pulling $GDBEXEC from device"
-adb pull /system/bin/$GDBEXEC "$TMPDIR"/$GDBEXEC &>/dev/null
-fail_panic "Could not retrieve $GDBEXEC from the device!"
-
-# Setup network redirection
-log "Setting network redirection (host:$HOST_PORT -> device:$TARGET_PORT)"
-adb forward tcp:$HOST_PORT tcp:$TARGET_PORT
-fail_panic "Could not setup network redirection from \
-host:localhost:$HOST_PORT to device:localhost:$TARGET_PORT!"
-
-# Start gdbserver in the background
-# Note that using run-as requires the package to be debuggable.
-#
-# If not, this will fail horribly. The alternative is to run the
-# program as root, which requires of course root privileges.
-# Maybe we should add a --root option to enable this?
-#
-log "Starting gdbserver in the background:"
-GDBSERVER_LOG=$TMPDIR/gdbserver-$TMP_ID.log
-log "adb shell $COMMAND_PREFIX $TARGET_GDBSERVER :$TARGET_PORT \
---attach $PID $COMMAND_SUFFIX"
-("$ADB" shell $COMMAND_PREFIX $TARGET_GDBSERVER :$TARGET_PORT \
- --attach $PID $COMMAND_SUFFIX > $GDBSERVER_LOG 2>&1) &
-GDBSERVER_PID=$!
-echo "$GDBSERVER_PID" > $GDBSERVER_PIDFILE
-log "background job pid: $GDBSERVER_PID"
-
-# Check that it is still running after a few seconds. If not, this means we
-# could not properly attach to it
-sleep 2
-log "Job control: $(jobs -l)"
-STATE=$(jobs -l | awk '$2 == "'$GDBSERVER_PID'" { print $3; }')
-if [ "$STATE" != "Running" ]; then
-  echo "ERROR: GDBServer could not attach to PID $PID!"
-  if [ $(adb_shell su -c getenforce) != "Permissive" ];  then
-    echo "Device mode is Enforcing. Changing Device mode to Permissive "
-    $(adb_shell su -c setenforce 0)
-    if [ $(adb_shell su -c getenforce) != "Permissive" ]; then
-      echo "ERROR: Failed to Change Device mode to Permissive"
-      echo "Failure log (use --verbose for more information):"
-      cat $GDBSERVER_LOG
-      exit 1
-    fi
-  else
-    echo "Failure log (use --verbose for more information):"
-    cat $GDBSERVER_LOG
-    exit 1
-  fi
-fi
-
-# Generate a file containing useful GDB initialization commands
-readonly COMMANDS=$TMPDIR/gdb.init
-log "Generating GDB initialization commands file: $COMMANDS"
-echo -n "" > $COMMANDS
-echo "set print pretty 1" >> $COMMANDS
-echo "python" >> $COMMANDS
-echo "import sys" >> $COMMANDS
-echo "sys.path.insert(0, '$CHROMIUM_SRC/tools/gdb/')" >> $COMMANDS
-echo "try:" >> $COMMANDS
-echo "  import gdb_chrome" >> $COMMANDS
-echo "finally:" >> $COMMANDS
-echo "  sys.path.pop(0)" >> $COMMANDS
-echo "end" >> $COMMANDS
-echo "file $TMPDIR/$GDBEXEC" >> $COMMANDS
-echo "directory $CHROMIUM_SRC" >> $COMMANDS
-echo "set solib-absolute-prefix $PULL_LIBS_DIR" >> $COMMANDS
-echo "set solib-search-path $SOLIB_DIRS:$PULL_LIBS_DIR:$SYMBOL_DIR" \
-    >> $COMMANDS
-echo "echo Attaching and reading symbols, this may take a while.." \
-    >> $COMMANDS
-echo "target remote :$HOST_PORT" >> $COMMANDS
-
-if [ "$GDBINIT" ]; then
-  cat "$GDBINIT" >> $COMMANDS
-fi
-
-if [ "$VERBOSE" -gt 0 ]; then
-  echo "### START $COMMANDS"
-  cat $COMMANDS
-  echo "### END $COMMANDS"
-fi
-
-log "Launching gdb client: $GDB $GDB_ARGS -x $COMMANDS"
-$GDB $GDB_ARGS -x $COMMANDS &&
-rm -f "$GDBSERVER_PIDFILE"
diff --git a/build/android/adb_gdb_android_webview_shell b/build/android/adb_gdb_android_webview_shell
deleted file mode 100755
index f685fda..0000000
--- a/build/android/adb_gdb_android_webview_shell
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-# Attach to or start a ContentShell process and debug it.
-# See --help for details.
-#
-PROGDIR=$(dirname "$0")
-export ADB_GDB_PROGNAME=$(basename "$0")
-export ADB_GDB_ACTIVITY=.AwShellActivity
-"$PROGDIR"/adb_gdb \
-    --program-name=AwShellApplication \
-    --package-name=org.chromium.android_webview.shell \
-    "$@"
diff --git a/build/android/adb_gdb_chrome_public b/build/android/adb_gdb_chrome_public
deleted file mode 100755
index 4366c83..0000000
--- a/build/android/adb_gdb_chrome_public
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-# Attach to or start a ChromePublic process and debug it.
-# See --help for details.
-#
-PROGDIR=$(dirname "$0")
-export ADB_GDB_PROGNAME=$(basename "$0")
-export ADB_GDB_ACTIVITY=com.google.android.apps.chrome.Main
-"$PROGDIR"/adb_gdb \
-    --program-name=ChromePublic \
-    --package-name=org.chromium.chrome \
-    "$@"
diff --git a/build/android/adb_gdb_chrome_shell b/build/android/adb_gdb_chrome_shell
deleted file mode 100755
index e5c8a30..0000000
--- a/build/android/adb_gdb_chrome_shell
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-# Attach to or start a ChromeShell process and debug it.
-# See --help for details.
-#
-PROGDIR=$(dirname "$0")
-export ADB_GDB_PROGNAME=$(basename "$0")
-export ADB_GDB_ACTIVITY=.ChromeShellActivity
-"$PROGDIR"/adb_gdb \
-    --program-name=ChromeShell \
-    --package-name=org.chromium.chrome.shell \
-    "$@"
diff --git a/build/android/adb_gdb_content_shell b/build/android/adb_gdb_content_shell
deleted file mode 100755
index 18e1a61..0000000
--- a/build/android/adb_gdb_content_shell
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-# Attach to or start a ContentShell process and debug it.
-# See --help for details.
-#
-PROGDIR=$(dirname "$0")
-export ADB_GDB_PROGNAME=$(basename "$0")
-export ADB_GDB_ACTIVITY=.ContentShellActivity
-"$PROGDIR"/adb_gdb \
-    --program-name=ContentShell \
-    --package-name=org.chromium.content_shell_apk \
-    "$@"
diff --git a/build/android/adb_gdb_cronet_sample b/build/android/adb_gdb_cronet_sample
deleted file mode 100755
index 8d0c864..0000000
--- a/build/android/adb_gdb_cronet_sample
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-# Attach to or start a ContentShell process and debug it.
-# See --help for details.
-#
-PROGDIR=$(dirname "$0")
-export ADB_GDB_PROGNAME=$(basename "$0")
-export ADB_GDB_ACTIVITY=.CronetSampleActivity
-"$PROGDIR"/adb_gdb \
-    --program-name=CronetSample \
-    --package-name=org.chromium.cronet_sample_apk \
-    "$@"
diff --git a/build/android/adb_gdb_mojo_shell b/build/android/adb_gdb_mojo_shell
deleted file mode 100755
index ba91149..0000000
--- a/build/android/adb_gdb_mojo_shell
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-# Attach to or start a ContentShell process and debug it.
-# See --help for details.
-#
-PROGDIR=$(dirname "$0")
-export ADB_GDB_PROGNAME=$(basename "$0")
-export ADB_GDB_ACTIVITY=.MojoShellActivity
-"$PROGDIR"/adb_gdb \
-    --program-name=MojoShell \
-    --package-name=org.chromium.mojo_shell_apk \
-    "$@"
diff --git a/build/android/adb_install_apk.py b/build/android/adb_install_apk.py
deleted file mode 100755
index 50faea7..0000000
--- a/build/android/adb_install_apk.py
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2012 The Chromium Authors. 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 install APKs from the command line quickly."""
-
-import argparse
-import glob
-import logging
-import os
-import sys
-
-from pylib import constants
-from pylib.device import device_blacklist
-from pylib.device import device_errors
-from pylib.device import device_utils
-from pylib.utils import apk_helper
-from pylib.utils import run_tests_helper
-
-
-def main():
-  parser = argparse.ArgumentParser()
-
-  apk_group = parser.add_mutually_exclusive_group(required=True)
-  apk_group.add_argument('--apk', dest='apk_name',
-                         help='DEPRECATED The name of the apk containing the'
-                              ' application (with the .apk extension).')
-  apk_group.add_argument('apk_path', nargs='?',
-                         help='The path to the APK to install.')
-
-  # TODO(jbudorick): Remove once no clients pass --apk_package
-  parser.add_argument('--apk_package', help='DEPRECATED unused')
-  parser.add_argument('--split',
-                      action='append',
-                      dest='splits',
-                      help='A glob matching the apk splits. '
-                           'Can be specified multiple times.')
-  parser.add_argument('--keep_data',
-                      action='store_true',
-                      default=False,
-                      help='Keep the package data when installing '
-                           'the application.')
-  parser.add_argument('--debug', action='store_const', const='Debug',
-                      dest='build_type',
-                      default=os.environ.get('BUILDTYPE', 'Debug'),
-                      help='If set, run test suites under out/Debug. '
-                           'Default is env var BUILDTYPE or Debug')
-  parser.add_argument('--release', action='store_const', const='Release',
-                      dest='build_type',
-                      help='If set, run test suites under out/Release. '
-                           'Default is env var BUILDTYPE or Debug.')
-  parser.add_argument('-d', '--device', dest='device',
-                      help='Target device for apk to install on.')
-  parser.add_argument('-v', '--verbose', action='count',
-                      help='Enable verbose logging.')
-
-  args = parser.parse_args()
-
-  run_tests_helper.SetLogLevel(args.verbose)
-  constants.SetBuildType(args.build_type)
-
-  apk = args.apk_path or args.apk_name
-  if not apk.endswith('.apk'):
-    apk += '.apk'
-  if not os.path.exists(apk):
-    apk = os.path.join(constants.GetOutDirectory(), 'apks', apk)
-    if not os.path.exists(apk):
-      parser.error('%s not found.' % apk)
-
-  if args.splits:
-    splits = []
-    base_apk_package = apk_helper.ApkHelper(apk).GetPackageName()
-    for split_glob in args.splits:
-      apks = [f for f in glob.glob(split_glob) if f.endswith('.apk')]
-      if not apks:
-        logging.warning('No apks matched for %s.' % split_glob)
-      for f in apks:
-        helper = apk_helper.ApkHelper(f)
-        if (helper.GetPackageName() == base_apk_package
-            and helper.GetSplitName()):
-          splits.append(f)
-
-  devices = device_utils.DeviceUtils.HealthyDevices()
-
-  if args.device:
-    devices = [d for d in devices if d == args.device]
-    if not devices:
-      raise device_errors.DeviceUnreachableError(args.device)
-  elif not devices:
-    raise device_errors.NoDevicesError()
-
-  def blacklisting_install(device):
-    try:
-      if args.splits:
-        device.InstallSplitApk(apk, splits, reinstall=args.keep_data)
-      else:
-        device.Install(apk, reinstall=args.keep_data)
-    except device_errors.CommandFailedError:
-      logging.exception('Failed to install %s', args.apk_name)
-      device_blacklist.ExtendBlacklist([str(device)])
-      logging.warning('Blacklisting %s', str(device))
-    except device_errors.CommandTimeoutError:
-      logging.exception('Timed out while installing %s', args.apk_name)
-      device_blacklist.ExtendBlacklist([str(device)])
-      logging.warning('Blacklisting %s', str(device))
-
-  device_utils.DeviceUtils.parallel(devices).pMap(blacklisting_install)
-
-
-if __name__ == '__main__':
-  sys.exit(main())
-
diff --git a/build/android/adb_kill_android_webview_shell b/build/android/adb_kill_android_webview_shell
deleted file mode 100755
index 5f287f0..0000000
--- a/build/android/adb_kill_android_webview_shell
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-# Kill a running android webview shell.
-#
-# Assumes you have sourced the build/android/envsetup.sh script.
-
-SHELL_PID_LINES=$(adb shell ps | grep ' org.chromium.android_webview.shell')
-VAL=$(echo "$SHELL_PID_LINES" | wc -l)
-if [ $VAL -lt 1 ] ; then
-   echo "Not running android webview shell."
-else
-   SHELL_PID=$(echo $SHELL_PID_LINES | awk '{print $2}')
-   if [ "$SHELL_PID" != "" ] ; then
-      set -x
-      adb shell kill $SHELL_PID
-      set -
-   else
-     echo "Android webview shell does not appear to be running."
-   fi
-fi
diff --git a/build/android/adb_kill_chrome_public b/build/android/adb_kill_chrome_public
deleted file mode 100755
index 5b539a0..0000000
--- a/build/android/adb_kill_chrome_public
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-# Kill a running instance of ChromePublic.
-#
-# Assumes you have sourced the build/android/envsetup.sh script.
-
-SHELL_PID_LINES=$(adb shell ps | grep -w 'org.chromium.chrome')
-VAL=$(echo "$SHELL_PID_LINES" | wc -l)
-if [ $VAL -lt 1 ] ; then
-   echo "Not running ChromePublic."
-else
-   SHELL_PID=$(echo $SHELL_PID_LINES | awk '{print $2}')
-   if [ "$SHELL_PID" != "" ] ; then
-      set -x
-      adb shell kill $SHELL_PID
-      set -
-   else
-     echo "ChromePublic does not appear to be running."
-   fi
-fi
diff --git a/build/android/adb_kill_chrome_shell b/build/android/adb_kill_chrome_shell
deleted file mode 100755
index 2b63c9a..0000000
--- a/build/android/adb_kill_chrome_shell
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-# Kill a running chrome shell.
-#
-# Assumes you have sourced the build/android/envsetup.sh script.
-
-SHELL_PID_LINES=$(adb shell ps | grep ' org.chromium.chrome.shell')
-VAL=$(echo "$SHELL_PID_LINES" | wc -l)
-if [ $VAL -lt 1 ] ; then
-   echo "Not running Chrome shell."
-else
-   SHELL_PID=$(echo $SHELL_PID_LINES | awk '{print $2}')
-   if [ "$SHELL_PID" != "" ] ; then
-      set -x
-      adb shell kill $SHELL_PID
-      set -
-   else
-     echo "Chrome shell does not appear to be running."
-   fi
-fi
diff --git a/build/android/adb_kill_content_shell b/build/android/adb_kill_content_shell
deleted file mode 100755
index e379dd4..0000000
--- a/build/android/adb_kill_content_shell
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-# Kill a running content shell.
-#
-# Assumes you have sourced the build/android/envsetup.sh script.
-
-SHELL_PID_LINES=$(adb shell ps | grep ' org.chromium.content_shell_apk')
-VAL=$(echo "$SHELL_PID_LINES" | wc -l)
-if [ $VAL -lt 1 ] ; then
-   echo "Not running Content shell."
-else
-   SHELL_PID=$(echo $SHELL_PID_LINES | awk '{print $2}')
-   if [ "$SHELL_PID" != "" ] ; then
-      set -x
-      adb shell kill $SHELL_PID
-      set -
-   else
-     echo "Content shell does not appear to be running."
-   fi
-fi
diff --git a/build/android/adb_logcat_monitor.py b/build/android/adb_logcat_monitor.py
deleted file mode 100755
index d3cc67d..0000000
--- a/build/android/adb_logcat_monitor.py
+++ /dev/null
@@ -1,156 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Saves logcats from all connected devices.
-
-Usage: adb_logcat_monitor.py <base_dir> [<adb_binary_path>]
-
-This script will repeatedly poll adb for new devices and save logcats
-inside the <base_dir> directory, which it attempts to create.  The
-script will run until killed by an external signal.  To test, run the
-script in a shell and <Ctrl>-C it after a while.  It should be
-resilient across phone disconnects and reconnects and start the logcat
-early enough to not miss anything.
-"""
-
-import logging
-import os
-import re
-import shutil
-import signal
-import subprocess
-import sys
-import time
-
-# Map from device_id -> (process, logcat_num)
-devices = {}
-
-
-class TimeoutException(Exception):
-  """Exception used to signal a timeout."""
-  pass
-
-
-class SigtermError(Exception):
-  """Exception used to catch a sigterm."""
-  pass
-
-
-def StartLogcatIfNecessary(device_id, adb_cmd, base_dir):
-  """Spawns a adb logcat process if one is not currently running."""
-  process, logcat_num = devices[device_id]
-  if process:
-    if process.poll() is None:
-      # Logcat process is still happily running
-      return
-    else:
-      logging.info('Logcat for device %s has died', device_id)
-      error_filter = re.compile('- waiting for device -')
-      for line in process.stderr:
-        if not error_filter.match(line):
-          logging.error(device_id + ':   ' + line)
-
-  logging.info('Starting logcat %d for device %s', logcat_num,
-               device_id)
-  logcat_filename = 'logcat_%s_%03d' % (device_id, logcat_num)
-  logcat_file = open(os.path.join(base_dir, logcat_filename), 'w')
-  process = subprocess.Popen([adb_cmd, '-s', device_id,
-                              'logcat', '-v', 'threadtime'],
-                             stdout=logcat_file,
-                             stderr=subprocess.PIPE)
-  devices[device_id] = (process, logcat_num + 1)
-
-
-def GetAttachedDevices(adb_cmd):
-  """Gets the device list from adb.
-
-  We use an alarm in this function to avoid deadlocking from an external
-  dependency.
-
-  Args:
-    adb_cmd: binary to run adb
-
-  Returns:
-    list of devices or an empty list on timeout
-  """
-  signal.alarm(2)
-  try:
-    out, err = subprocess.Popen([adb_cmd, 'devices'],
-                                stdout=subprocess.PIPE,
-                                stderr=subprocess.PIPE).communicate()
-    if err:
-      logging.warning('adb device error %s', err.strip())
-    return re.findall('^(\\S+)\tdevice$', out, re.MULTILINE)
-  except TimeoutException:
-    logging.warning('"adb devices" command timed out')
-    return []
-  except (IOError, OSError):
-    logging.exception('Exception from "adb devices"')
-    return []
-  finally:
-    signal.alarm(0)
-
-
-def main(base_dir, adb_cmd='adb'):
-  """Monitor adb forever.  Expects a SIGINT (Ctrl-C) to kill."""
-  # We create the directory to ensure 'run once' semantics
-  if os.path.exists(base_dir):
-    print 'adb_logcat_monitor: %s already exists? Cleaning' % base_dir
-    shutil.rmtree(base_dir, ignore_errors=True)
-
-  os.makedirs(base_dir)
-  logging.basicConfig(filename=os.path.join(base_dir, 'eventlog'),
-                      level=logging.INFO,
-                      format='%(asctime)-2s %(levelname)-8s %(message)s')
-
-  # Set up the alarm for calling 'adb devices'. This is to ensure
-  # our script doesn't get stuck waiting for a process response
-  def TimeoutHandler(_signum, _unused_frame):
-    raise TimeoutException()
-  signal.signal(signal.SIGALRM, TimeoutHandler)
-
-  # Handle SIGTERMs to ensure clean shutdown
-  def SigtermHandler(_signum, _unused_frame):
-    raise SigtermError()
-  signal.signal(signal.SIGTERM, SigtermHandler)
-
-  logging.info('Started with pid %d', os.getpid())
-  pid_file_path = os.path.join(base_dir, 'LOGCAT_MONITOR_PID')
-
-  try:
-    with open(pid_file_path, 'w') as f:
-      f.write(str(os.getpid()))
-    while True:
-      for device_id in GetAttachedDevices(adb_cmd):
-        if not device_id in devices:
-          subprocess.call([adb_cmd, '-s', device_id, 'logcat', '-c'])
-          devices[device_id] = (None, 0)
-
-      for device in devices:
-        # This will spawn logcat watchers for any device ever detected
-        StartLogcatIfNecessary(device, adb_cmd, base_dir)
-
-      time.sleep(5)
-  except SigtermError:
-    logging.info('Received SIGTERM, shutting down')
-  except: # pylint: disable=bare-except
-    logging.exception('Unexpected exception in main.')
-  finally:
-    for process, _ in devices.itervalues():
-      if process:
-        try:
-          process.terminate()
-        except OSError:
-          pass
-    os.remove(pid_file_path)
-
-
-if __name__ == '__main__':
-  if 2 <= len(sys.argv) <= 3:
-    print 'adb_logcat_monitor: Initializing'
-    sys.exit(main(*sys.argv[1:3]))
-
-  print 'Usage: %s <base_dir> [<adb_binary_path>]' % sys.argv[0]
diff --git a/build/android/adb_logcat_printer.py b/build/android/adb_logcat_printer.py
deleted file mode 100755
index 55176ab..0000000
--- a/build/android/adb_logcat_printer.py
+++ /dev/null
@@ -1,213 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Shutdown adb_logcat_monitor and print accumulated logs.
-
-To test, call './adb_logcat_printer.py <base_dir>' where
-<base_dir> contains 'adb logcat -v threadtime' files named as
-logcat_<deviceID>_<sequenceNum>
-
-The script will print the files to out, and will combine multiple
-logcats from a single device if there is overlap.
-
-Additionally, if a <base_dir>/LOGCAT_MONITOR_PID exists, the script
-will attempt to terminate the contained PID by sending a SIGINT and
-monitoring for the deletion of the aforementioned file.
-"""
-# pylint: disable=W0702
-
-import cStringIO
-import logging
-import optparse
-import os
-import re
-import signal
-import sys
-import time
-
-
-# Set this to debug for more verbose output
-LOG_LEVEL = logging.INFO
-
-
-def CombineLogFiles(list_of_lists, logger):
-  """Splices together multiple logcats from the same device.
-
-  Args:
-    list_of_lists: list of pairs (filename, list of timestamped lines)
-    logger: handler to log events
-
-  Returns:
-    list of lines with duplicates removed
-  """
-  cur_device_log = ['']
-  for cur_file, cur_file_lines in list_of_lists:
-    # Ignore files with just the logcat header
-    if len(cur_file_lines) < 2:
-      continue
-    common_index = 0
-    # Skip this step if list just has empty string
-    if len(cur_device_log) > 1:
-      try:
-        line = cur_device_log[-1]
-        # Used to make sure we only splice on a timestamped line
-        if re.match(r'^\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3} ', line):
-          common_index = cur_file_lines.index(line)
-        else:
-          logger.warning('splice error - no timestamp in "%s"?', line.strip())
-      except ValueError:
-        # The last line was valid but wasn't found in the next file
-        cur_device_log += ['***** POSSIBLE INCOMPLETE LOGCAT *****']
-        logger.info('Unable to splice %s. Incomplete logcat?', cur_file)
-
-    cur_device_log += ['*'*30 + '  %s' % cur_file]
-    cur_device_log.extend(cur_file_lines[common_index:])
-
-  return cur_device_log
-
-
-def FindLogFiles(base_dir):
-  """Search a directory for logcat files.
-
-  Args:
-    base_dir: directory to search
-
-  Returns:
-    Mapping of device_id to a sorted list of file paths for a given device
-  """
-  logcat_filter = re.compile(r'^logcat_(\S+)_(\d+)$')
-  # list of tuples (<device_id>, <seq num>, <full file path>)
-  filtered_list = []
-  for cur_file in os.listdir(base_dir):
-    matcher = logcat_filter.match(cur_file)
-    if matcher:
-      filtered_list += [(matcher.group(1), int(matcher.group(2)),
-                         os.path.join(base_dir, cur_file))]
-  filtered_list.sort()
-  file_map = {}
-  for device_id, _, cur_file in filtered_list:
-    if device_id not in file_map:
-      file_map[device_id] = []
-
-    file_map[device_id] += [cur_file]
-  return file_map
-
-
-def GetDeviceLogs(log_filenames, logger):
-  """Read log files, combine and format.
-
-  Args:
-    log_filenames: mapping of device_id to sorted list of file paths
-    logger: logger handle for logging events
-
-  Returns:
-    list of formatted device logs, one for each device.
-  """
-  device_logs = []
-
-  for device, device_files in log_filenames.iteritems():
-    logger.debug('%s: %s', device, str(device_files))
-    device_file_lines = []
-    for cur_file in device_files:
-      with open(cur_file) as f:
-        device_file_lines += [(cur_file, f.read().splitlines())]
-    combined_lines = CombineLogFiles(device_file_lines, logger)
-    # Prepend each line with a short unique ID so it's easy to see
-    # when the device changes.  We don't use the start of the device
-    # ID because it can be the same among devices.  Example lines:
-    # AB324:  foo
-    # AB324:  blah
-    device_logs += [('\n' + device[-5:] + ':  ').join(combined_lines)]
-  return device_logs
-
-
-def ShutdownLogcatMonitor(base_dir, logger):
-  """Attempts to shutdown adb_logcat_monitor and blocks while waiting."""
-  try:
-    monitor_pid_path = os.path.join(base_dir, 'LOGCAT_MONITOR_PID')
-    with open(monitor_pid_path) as f:
-      monitor_pid = int(f.readline())
-
-    logger.info('Sending SIGTERM to %d', monitor_pid)
-    os.kill(monitor_pid, signal.SIGTERM)
-    i = 0
-    while True:
-      time.sleep(.2)
-      if not os.path.exists(monitor_pid_path):
-        return
-      if not os.path.exists('/proc/%d' % monitor_pid):
-        logger.warning('Monitor (pid %d) terminated uncleanly?', monitor_pid)
-        return
-      logger.info('Waiting for logcat process to terminate.')
-      i += 1
-      if i >= 10:
-        logger.warning('Monitor pid did not terminate. Continuing anyway.')
-        return
-
-  except (ValueError, IOError, OSError):
-    logger.exception('Error signaling logcat monitor - continuing')
-
-
-def main(argv):
-  parser = optparse.OptionParser(usage='Usage: %prog [options] <log dir>')
-  parser.add_option('--output-path',
-                    help='Output file path (if unspecified, prints to stdout)')
-  options, args = parser.parse_args(argv)
-  if len(args) != 1:
-    parser.error('Wrong number of unparsed args')
-  base_dir = args[0]
-  if options.output_path:
-    output_file = open(options.output_path, 'w')
-  else:
-    output_file = sys.stdout
-
-  log_stringio = cStringIO.StringIO()
-  logger = logging.getLogger('LogcatPrinter')
-  logger.setLevel(LOG_LEVEL)
-  sh = logging.StreamHandler(log_stringio)
-  sh.setFormatter(logging.Formatter('%(asctime)-2s %(levelname)-8s'
-                                    ' %(message)s'))
-  logger.addHandler(sh)
-
-  try:
-    # Wait at least 5 seconds after base_dir is created before printing.
-    #
-    # The idea is that 'adb logcat > file' output consists of 2 phases:
-    #  1 Dump all the saved logs to the file
-    #  2 Stream log messages as they are generated
-    #
-    # We want to give enough time for phase 1 to complete.  There's no
-    # good method to tell how long to wait, but it usually only takes a
-    # second.  On most bots, this code path won't occur at all, since
-    # adb_logcat_monitor.py command will have spawned more than 5 seconds
-    # prior to called this shell script.
-    try:
-      sleep_time = 5 - (time.time() - os.path.getctime(base_dir))
-    except OSError:
-      sleep_time = 5
-    if sleep_time > 0:
-      logger.warning('Monitor just started? Sleeping %.1fs', sleep_time)
-      time.sleep(sleep_time)
-
-    assert os.path.exists(base_dir), '%s does not exist' % base_dir
-    ShutdownLogcatMonitor(base_dir, logger)
-    separator = '\n' + '*' * 80 + '\n\n'
-    for log in GetDeviceLogs(FindLogFiles(base_dir), logger):
-      output_file.write(log)
-      output_file.write(separator)
-    with open(os.path.join(base_dir, 'eventlog')) as f:
-      output_file.write('\nLogcat Monitor Event Log\n')
-      output_file.write(f.read())
-  except:
-    logger.exception('Unexpected exception')
-
-  logger.info('Done.')
-  sh.flush()
-  output_file.write('\nLogcat Printer Event Log\n')
-  output_file.write(log_stringio.getvalue())
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
diff --git a/build/android/adb_profile_chrome b/build/android/adb_profile_chrome
deleted file mode 100755
index 21f6faf..0000000
--- a/build/android/adb_profile_chrome
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-# Start / stop profiling in chrome.
-exec $(dirname $0)/../../tools/profile_chrome.py $@
diff --git a/build/android/adb_reverse_forwarder.py b/build/android/adb_reverse_forwarder.py
deleted file mode 100755
index 3ce5359..0000000
--- a/build/android/adb_reverse_forwarder.py
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Command line tool for forwarding ports from a device to the host.
-
-Allows an Android device to connect to services running on the host machine,
-i.e., "adb forward" in reverse. Requires |host_forwarder| and |device_forwarder|
-to be built.
-"""
-
-import logging
-import optparse
-import sys
-import time
-
-from pylib import constants
-from pylib import forwarder
-from pylib.device import adb_wrapper
-from pylib.device import device_errors
-from pylib.device import device_utils
-from pylib.utils import run_tests_helper
-
-
-def main(argv):
-  parser = optparse.OptionParser(usage='Usage: %prog [options] device_port '
-                                 'host_port [device_port_2 host_port_2] ...',
-                                 description=__doc__)
-  parser.add_option('-v',
-                    '--verbose',
-                    dest='verbose_count',
-                    default=0,
-                    action='count',
-                    help='Verbose level (multiple times for more)')
-  parser.add_option('--device',
-                    help='Serial number of device we should use.')
-  parser.add_option('--debug', action='store_const', const='Debug',
-                    dest='build_type', default='Release',
-                    help='Use Debug build of host tools instead of Release.')
-
-  options, args = parser.parse_args(argv)
-  run_tests_helper.SetLogLevel(options.verbose_count)
-
-  if len(args) < 2 or not len(args) % 2:
-    parser.error('Need even number of port pairs')
-    sys.exit(1)
-
-  try:
-    port_pairs = map(int, args[1:])
-    port_pairs = zip(port_pairs[::2], port_pairs[1::2])
-  except ValueError:
-    parser.error('Bad port number')
-    sys.exit(1)
-
-  devices = device_utils.DeviceUtils.HealthyDevices()
-
-  if options.device:
-    device = next((d for d in devices if d == options.device), None)
-    if not device:
-      raise device_errors.DeviceUnreachableError(options.device)
-  elif devices:
-    device = devices[0]
-    logging.info('No device specified. Defaulting to %s', devices[0])
-  else:
-    raise device_errors.NoDevicesError()
-
-  constants.SetBuildType(options.build_type)
-  try:
-    forwarder.Forwarder.Map(port_pairs, device)
-    while True:
-      time.sleep(60)
-  except KeyboardInterrupt:
-    sys.exit(0)
-  finally:
-    forwarder.Forwarder.UnmapAllDevicePorts(device)
-
-if __name__ == '__main__':
-  main(sys.argv)
diff --git a/build/android/adb_run_android_webview_shell b/build/android/adb_run_android_webview_shell
deleted file mode 100755
index 1014a73..0000000
--- a/build/android/adb_run_android_webview_shell
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-optional_url=$1
-
-adb shell am start \
-  -a android.intent.action.VIEW \
-  -n org.chromium.android_webview.shell/.AwShellActivity \
-  ${optional_url:+-d "$optional_url"}
diff --git a/build/android/adb_run_chrome_public b/build/android/adb_run_chrome_public
deleted file mode 100755
index bf15071..0000000
--- a/build/android/adb_run_chrome_public
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-optional_url=$1
-
-adb shell am start \
-  -a android.intent.action.VIEW \
-  -n org.chromium.chrome/com.google.android.apps.chrome.Main \
-  ${optional_url:+-d "$optional_url"}
diff --git a/build/android/adb_run_chrome_shell b/build/android/adb_run_chrome_shell
deleted file mode 100755
index 79c4c32..0000000
--- a/build/android/adb_run_chrome_shell
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-optional_url=$1
-
-adb shell am start \
-  -a android.intent.action.VIEW \
-  -n org.chromium.chrome.shell/.ChromeShellActivity \
-  ${optional_url:+-d "$optional_url"}
diff --git a/build/android/adb_run_content_shell b/build/android/adb_run_content_shell
deleted file mode 100755
index 3f01f3b..0000000
--- a/build/android/adb_run_content_shell
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-optional_url=$1
-
-adb shell am start \
-  -a android.intent.action.VIEW \
-  -n org.chromium.content_shell_apk/.ContentShellActivity \
-  ${optional_url:+-d "$optional_url"}
diff --git a/build/android/adb_run_mojo_shell b/build/android/adb_run_mojo_shell
deleted file mode 100755
index b585e4a..0000000
--- a/build/android/adb_run_mojo_shell
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-optional_url=$1
-parameters=$2
-
-adb logcat -c
-adb shell am start -S \
-  -a android.intent.action.VIEW \
-  -n org.chromium.mojo_shell_apk/.MojoShellActivity \
-  ${parameters:+--esa parameters "$parameters"} \
-  ${optional_url:+-d "$optional_url"}
-adb logcat -s MojoShellApplication MojoShellActivity chromium
diff --git a/build/android/android_no_jni_exports.lst b/build/android/android_no_jni_exports.lst
deleted file mode 100644
index ffc6cf7..0000000
--- a/build/android/android_no_jni_exports.lst
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This script makes all JNI exported symbols local, to prevent the JVM from
-# being able to find them, enforcing use of manual JNI function registration.
-# This is used for all Android binaries by default, unless they explicitly state
-# that they want JNI exported symbols to remain visible, as we need to ensure
-# the manual registration path is correct to maintain compatibility with the
-# crazy linker.
-# Check ld version script manual:
-# https://sourceware.org/binutils/docs-2.24/ld/VERSION.html#VERSION
-
-{
-  local:
-    Java_*;
-};
diff --git a/build/android/ant/BUILD.gn b/build/android/ant/BUILD.gn
deleted file mode 100644
index a30fb54..0000000
--- a/build/android/ant/BUILD.gn
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-copy("keystore") {
-  sources = [
-    "chromium-debug.keystore",
-  ]
-
-  outputs = [
-    "$root_out_dir/chromium-debug.keystore",
-  ]
-}
diff --git a/build/android/ant/apk-package.xml b/build/android/ant/apk-package.xml
deleted file mode 100644
index e8b76f7..0000000
--- a/build/android/ant/apk-package.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    Copyright (C) 2005-2008 The Android Open Source Project
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
--->
-
-<project default="-package">
-  <property name="verbose" value="false" />
-  <property name="out.dir" location="${OUT_DIR}" />
-  <property name="out.absolute.dir" location="${out.dir}" />
-
-  <property name="sdk.dir" location="${ANDROID_SDK_ROOT}"/>
-  <property name="emma.device.jar" location="${EMMA_DEVICE_JAR}" />
-
-  <condition property="emma.enabled" value="true" else="false">
-    <equals arg1="${EMMA_INSTRUMENT}" arg2="1"/>
-  </condition>
-
-  <!-- jar file from where the tasks are loaded -->
-  <path id="android.antlibs">
-    <pathelement path="${sdk.dir}/tools/lib/ant-tasks.jar" />
-  </path>
-
-  <!-- Custom tasks -->
-  <taskdef resource="anttasks.properties" classpathref="android.antlibs" />
-
-  <condition property="build.target" value="release" else="debug">
-    <equals arg1="${CONFIGURATION_NAME}" arg2="Release" />
-  </condition>
-  <condition property="build.is.packaging.debug" value="true" else="false">
-    <equals arg1="${build.target}" arg2="debug" />
-  </condition>
-
-  <!-- Disables automatic signing. -->
-  <property name="build.is.signing.debug" value="false"/>
-
-  <!-- SDK tools assume that out.packaged.file is signed and name it "...-unaligned" -->
-  <property name="out.packaged.file" value="${UNSIGNED_APK_PATH}" />
-
-  <property name="native.libs.absolute.dir" location="${NATIVE_LIBS_DIR}" />
-
-  <!-- Intermediate files -->
-  <property name="resource.package.file.name" value="${RESOURCE_PACKAGED_APK_NAME}" />
-
-  <property name="intermediate.dex.file" location="${DEX_FILE_PATH}" />
-
-  <!-- Macro that enables passing a variable list of external jar files
-       to ApkBuilder. -->
-  <macrodef name="package-helper">
-    <element name="extra-jars" optional="yes" />
-    <sequential>
-      <apkbuilder
-          outfolder="${out.absolute.dir}"
-          resourcefile="${resource.package.file.name}"
-          apkfilepath="${out.packaged.file}"
-          debugpackaging="${build.is.packaging.debug}"
-          debugsigning="${build.is.signing.debug}"
-          verbose="${verbose}"
-          hascode="${HAS_CODE}"
-          previousBuildType="/"
-          buildType="${build.is.packaging.debug}/${build.is.signing.debug}">
-        <dex path="${intermediate.dex.file}"/>
-        <nativefolder path="${native.libs.absolute.dir}" />
-        <extra-jars/>
-      </apkbuilder>
-    </sequential>
-  </macrodef>
-
-
-  <!-- Packages the application. -->
-  <target name="-package">
-    <if condition="${emma.enabled}">
-      <then>
-        <package-helper>
-          <extra-jars>
-            <jarfile path="${emma.device.jar}" />
-          </extra-jars>
-        </package-helper>
-      </then>
-      <else>
-        <package-helper />
-      </else>
-    </if>
-  </target>
-</project>
diff --git a/build/android/ant/chromium-debug.keystore b/build/android/ant/chromium-debug.keystore
deleted file mode 100644
index 67eb0aa..0000000
--- a/build/android/ant/chromium-debug.keystore
+++ /dev/null
Binary files differ
diff --git a/build/android/ant/empty/res/.keep b/build/android/ant/empty/res/.keep
deleted file mode 100644
index 1fd038b..0000000
--- a/build/android/ant/empty/res/.keep
+++ /dev/null
@@ -1,2 +0,0 @@
-# This empty res folder can be passed to aapt while building Java libraries or
-# APKs that don't have any resources.
diff --git a/build/android/apkbuilder_action.gypi b/build/android/apkbuilder_action.gypi
deleted file mode 100644
index 27807d8..0000000
--- a/build/android/apkbuilder_action.gypi
+++ /dev/null
@@ -1,79 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is a helper to java_apk.gypi. It should be used to create an
-# action that runs ApkBuilder via ANT.
-#
-# Required variables:
-#  apk_name - File name (minus path & extension) of the output apk.
-#  apk_path - Path to output apk.
-#  package_input_paths - Late-evaluated list of resource zips.
-#  native_libs_dir - Path to lib/ directory to use. Set to an empty directory
-#    if no native libs are needed.
-# Optional variables:
-#  has_code - Whether to include classes.dex in the apk.
-#  dex_path - Path to classes.dex. Used only when has_code=1.
-#  extra_inputs - List of extra action inputs.
-{
-  'variables': {
-    'variables': {
-      'has_code%': 1,
-    },
-    'conditions': [
-      ['has_code == 0', {
-        'has_code_str': 'false',
-      }, {
-        'has_code_str': 'true',
-      }],
-    ],
-    'has_code%': '<(has_code)',
-    'extra_inputs%': [],
-    # Write the inputs list to a file, so that its mtime is updated when
-    # the list of inputs changes.
-    'inputs_list_file': '>|(apk_package.<(_target_name).<(apk_name).gypcmd >@(package_input_paths))',
-    'resource_packaged_apk_name': '<(apk_name)-resources.ap_',
-    'resource_packaged_apk_path': '<(intermediate_dir)/<(resource_packaged_apk_name)',
-  },
-  'action_name': 'apkbuilder_<(apk_name)',
-  'message': 'Packaging <(apk_name)',
-  'inputs': [
-    '<(DEPTH)/build/android/ant/apk-package.xml',
-    '<(DEPTH)/build/android/gyp/util/build_utils.py',
-    '<(DEPTH)/build/android/gyp/ant.py',
-    '<(resource_packaged_apk_path)',
-    '<@(extra_inputs)',
-    '>@(package_input_paths)',
-    '>(inputs_list_file)',
-  ],
-  'outputs': [
-    '<(apk_path)',
-  ],
-  'conditions': [
-    ['has_code == 1', {
-      'inputs': ['<(dex_path)'],
-      'action': [
-        '-DDEX_FILE_PATH=<(dex_path)',
-      ]
-    }],
-  ],
-  'action': [
-    'python', '<(DEPTH)/build/android/gyp/ant.py',
-    '--',
-    '-quiet',
-    '-DHAS_CODE=<(has_code_str)',
-    '-DANDROID_SDK_ROOT=<(android_sdk_root)',
-    '-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
-    '-DRESOURCE_PACKAGED_APK_NAME=<(resource_packaged_apk_name)',
-    '-DNATIVE_LIBS_DIR=<(native_libs_dir)',
-    '-DAPK_NAME=<(apk_name)',
-    '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)',
-    '-DOUT_DIR=<(intermediate_dir)',
-    '-DUNSIGNED_APK_PATH=<(apk_path)',
-    '-DEMMA_INSTRUMENT=<(emma_instrument)',
-    '-DEMMA_DEVICE_JAR=<(emma_device_jar)',
-    '-Dbasedir=.',
-    '-buildfile',
-    '<(DEPTH)/build/android/ant/apk-package.xml',
-  ]
-}
diff --git a/build/android/asan_symbolize.py b/build/android/asan_symbolize.py
deleted file mode 100755
index 10087a6..0000000
--- a/build/android/asan_symbolize.py
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-
-import collections
-import optparse
-import os
-import re
-import sys
-
-from pylib import constants
-
-# Uses symbol.py from third_party/android_platform, not python's.
-sys.path.insert(0,
-                os.path.join(constants.DIR_SOURCE_ROOT,
-                            'third_party/android_platform/development/scripts'))
-import symbol
-
-
-_RE_ASAN = re.compile(r'(.*?)(#\S*?) (\S*?) \((.*?)\+(.*?)\)')
-
-def _ParseAsanLogLine(line):
-  m = re.match(_RE_ASAN, line)
-  if not m:
-    return None
-  return {
-      'prefix': m.group(1),
-      'library': m.group(4),
-      'pos': m.group(2),
-      'rel_address': '%08x' % int(m.group(5), 16),
-  }
-
-
-def _FindASanLibraries():
-  asan_lib_dir = os.path.join(constants.DIR_SOURCE_ROOT,
-                              'third_party', 'llvm-build',
-                              'Release+Asserts', 'lib')
-  asan_libs = []
-  for src_dir, _, files in os.walk(asan_lib_dir):
-    asan_libs += [os.path.relpath(os.path.join(src_dir, f))
-                  for f in files
-                  if f.endswith('.so')]
-  return asan_libs
-
-
-def _TranslateLibPath(library, asan_libs):
-  for asan_lib in asan_libs:
-    if os.path.basename(library) == os.path.basename(asan_lib):
-      return '/' + asan_lib
-  return symbol.TranslateLibPath(library)
-
-
-def _Symbolize(asan_input):
-  asan_libs = _FindASanLibraries()
-  libraries = collections.defaultdict(list)
-  asan_lines = []
-  for asan_log_line in [a.rstrip() for a in asan_input]:
-    m = _ParseAsanLogLine(asan_log_line)
-    if m:
-      libraries[m['library']].append(m)
-    asan_lines.append({'raw_log': asan_log_line, 'parsed': m})
-
-  all_symbols = collections.defaultdict(dict)
-  for library, items in libraries.iteritems():
-    libname = _TranslateLibPath(library, asan_libs)
-    lib_relative_addrs = set([i['rel_address'] for i in items])
-    info_dict = symbol.SymbolInformationForSet(libname,
-                                               lib_relative_addrs,
-                                               True)
-    if info_dict:
-      all_symbols[library]['symbols'] = info_dict
-
-  for asan_log_line in asan_lines:
-    m = asan_log_line['parsed']
-    if not m:
-      print asan_log_line['raw_log']
-      continue
-    if (m['library'] in all_symbols and
-        m['rel_address'] in all_symbols[m['library']]['symbols']):
-      s = all_symbols[m['library']]['symbols'][m['rel_address']][0]
-      print '%s%s %s %s' % (m['prefix'], m['pos'], s[0], s[1])
-    else:
-      print asan_log_line['raw_log']
-
-
-def main():
-  parser = optparse.OptionParser()
-  parser.add_option('-l', '--logcat',
-                    help='File containing adb logcat output with ASan stacks. '
-                         'Use stdin if not specified.')
-  options, _ = parser.parse_args()
-  if options.logcat:
-    asan_input = file(options.logcat, 'r')
-  else:
-    asan_input = sys.stdin
-  _Symbolize(asan_input.readlines())
-
-
-if __name__ == "__main__":
-  sys.exit(main())
diff --git a/build/android/avd.py b/build/android/avd.py
deleted file mode 100755
index c45544f..0000000
--- a/build/android/avd.py
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Launches Android Virtual Devices with a set configuration for testing Chrome.
-
-The script will launch a specified number of Android Virtual Devices (AVD's).
-"""
-
-
-import install_emulator_deps
-import logging
-import optparse
-import os
-import re
-import sys
-
-from pylib import cmd_helper
-from pylib import constants
-from pylib.utils import emulator
-
-
-def main(argv):
-  # ANDROID_SDK_ROOT needs to be set to the location of the SDK used to launch
-  # the emulator to find the system images upon launch.
-  emulator_sdk = os.path.join(constants.EMULATOR_SDK_ROOT, 'sdk')
-  os.environ['ANDROID_SDK_ROOT'] = emulator_sdk
-
-  opt_parser = optparse.OptionParser(description='AVD script.')
-  opt_parser.add_option('--name', help='Optinaly, name of existing AVD to '
-                        'launch. If not specified, new AVD\'s will be created')
-  opt_parser.add_option('-n', '--num', dest='emulator_count',
-                        help='Number of emulators to launch (default is 1).',
-                        type='int', default='1')
-  opt_parser.add_option('--abi', default='x86',
-                        help='Platform of emulators to launch (x86 default).')
-  opt_parser.add_option('--api-level', dest='api_level',
-                        help='API level for the image, e.g. 19 for Android 4.4',
-                        type='int', default=constants.ANDROID_SDK_VERSION)
-
-  options, _ = opt_parser.parse_args(argv[1:])
-
-  logging.basicConfig(level=logging.INFO,
-                      format='# %(asctime)-15s: %(message)s')
-  logging.root.setLevel(logging.INFO)
-
-  # Check if KVM is enabled for x86 AVD's and check for x86 system images.
-  # TODO(andrewhayden) Since we can fix all of these with install_emulator_deps
-  # why don't we just run it?
-  if options.abi == 'x86':
-    if not install_emulator_deps.CheckKVM():
-      logging.critical('ERROR: KVM must be enabled in BIOS, and installed. '
-                       'Enable KVM in BIOS and run install_emulator_deps.py')
-      return 1
-    elif not install_emulator_deps.CheckX86Image(options.api_level):
-      logging.critical('ERROR: System image for x86 AVD not installed. Run '
-                       'install_emulator_deps.py')
-      return 1
-
-  if not install_emulator_deps.CheckSDK():
-    logging.critical('ERROR: Emulator SDK not installed. Run '
-                     'install_emulator_deps.py.')
-    return 1
-
-  # If AVD is specified, check that the SDK has the required target. If not,
-  # check that the SDK has the desired target for the temporary AVD's.
-  api_level = options.api_level
-  if options.name:
-    android = os.path.join(constants.EMULATOR_SDK_ROOT, 'sdk', 'tools',
-                           'android')
-    avds_output = cmd_helper.GetCmdOutput([android, 'list', 'avd'])
-    names = re.findall(r'Name: (\w+)', avds_output)
-    api_levels = re.findall(r'API level (\d+)', avds_output)
-    try:
-      avd_index = names.index(options.name)
-    except ValueError:
-      logging.critical('ERROR: Specified AVD %s does not exist.' % options.name)
-      return 1
-    api_level = int(api_levels[avd_index])
-
-  if not install_emulator_deps.CheckSDKPlatform(api_level):
-    logging.critical('ERROR: Emulator SDK missing required target for API %d. '
-                     'Run install_emulator_deps.py.')
-    return 1
-
-  if options.name:
-    emulator.LaunchEmulator(options.name, options.abi)
-  else:
-    emulator.LaunchTempEmulators(options.emulator_count, options.abi,
-                                 options.api_level, True)
-
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv))
diff --git a/build/android/bb_run_sharded_steps.py b/build/android/bb_run_sharded_steps.py
deleted file mode 100755
index 6aeba5b..0000000
--- a/build/android/bb_run_sharded_steps.py
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""DEPRECATED!
-TODO(bulach): remove me once all other repositories reference
-'test_runner.py perf' directly.
-"""
-
-import optparse
-import sys
-
-from pylib import cmd_helper
-
-
-def main(argv):
-  parser = optparse.OptionParser()
-  parser.add_option('-s', '--steps',
-                    help='A JSON file containing all the steps to be '
-                         'sharded.')
-  parser.add_option('--flaky_steps',
-                    help='A JSON file containing steps that are flaky and '
-                         'will have its exit code ignored.')
-  parser.add_option('-p', '--print_results',
-                    help='Only prints the results for the previously '
-                         'executed step, do not run it again.')
-  options, _ = parser.parse_args(argv)
-  if options.print_results:
-    return cmd_helper.RunCmd(['build/android/test_runner.py', 'perf',
-                              '--print-step', options.print_results])
-  flaky_options = []
-  if options.flaky_steps:
-    flaky_options = ['--flaky-steps', options.flaky_steps]
-  return cmd_helper.RunCmd(['build/android/test_runner.py', 'perf', '-v',
-                            '--steps', options.steps] + flaky_options)
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv))
diff --git a/build/android/buildbot/OWNERS b/build/android/buildbot/OWNERS
deleted file mode 100644
index f289720..0000000
--- a/build/android/buildbot/OWNERS
+++ /dev/null
@@ -1,6 +0,0 @@
-set noparent
-
-cmp@chromium.org
-jbudorick@chromium.org
-navabi@chromium.org
-
diff --git a/build/android/buildbot/bb_annotations.py b/build/android/buildbot/bb_annotations.py
deleted file mode 100644
index 059d673..0000000
--- a/build/android/buildbot/bb_annotations.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Helper functions to print buildbot messages."""
-
-def PrintLink(label, url):
-  """Adds a link with name |label| linking to |url| to current buildbot step.
-
-  Args:
-    label: A string with the name of the label.
-    url: A string of the URL.
-  """
-  print '@@@STEP_LINK@%s@%s@@@' % (label, url)
-
-
-def PrintMsg(msg):
-  """Appends |msg| to the current buildbot step text.
-
-  Args:
-    msg: String to be appended.
-  """
-  print '@@@STEP_TEXT@%s@@@' % msg
-
-
-def PrintSummaryText(msg):
-  """Appends |msg| to main build summary. Visible from waterfall.
-
-  Args:
-    msg: String to be appended.
-  """
-  print '@@@STEP_SUMMARY_TEXT@%s@@@' % msg
-
-
-def PrintError():
-  """Marks the current step as failed."""
-  print '@@@STEP_FAILURE@@@'
-
-
-def PrintWarning():
-  """Marks the current step with a warning."""
-  print '@@@STEP_WARNINGS@@@'
-
-
-def PrintNamedStep(step):
-  print '@@@BUILD_STEP %s@@@' % step
diff --git a/build/android/buildbot/bb_device_status_check.py b/build/android/buildbot/bb_device_status_check.py
deleted file mode 100755
index 917c51e..0000000
--- a/build/android/buildbot/bb_device_status_check.py
+++ /dev/null
@@ -1,404 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""A class to keep track of devices across builds and report state."""
-import json
-import logging
-import optparse
-import os
-import psutil
-import re
-import signal
-import smtplib
-import subprocess
-import sys
-import time
-import urllib
-
-import bb_annotations
-import bb_utils
-
-sys.path.append(os.path.join(os.path.dirname(__file__),
-                             os.pardir, os.pardir, 'util', 'lib',
-                             'common'))
-import perf_tests_results_helper  # pylint: disable=F0401
-
-sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
-from pylib import constants
-from pylib.cmd_helper import GetCmdOutput
-from pylib.device import adb_wrapper
-from pylib.device import battery_utils
-from pylib.device import device_blacklist
-from pylib.device import device_errors
-from pylib.device import device_list
-from pylib.device import device_utils
-from pylib.utils import run_tests_helper
-
-_RE_DEVICE_ID = re.compile('Device ID = (\d+)')
-
-def DeviceInfo(device, options):
-  """Gathers info on a device via various adb calls.
-
-  Args:
-    device: A DeviceUtils instance for the device to construct info about.
-
-  Returns:
-    Tuple of device type, build id, report as a string, error messages, and
-    boolean indicating whether or not device can be used for testing.
-  """
-  battery = battery_utils.BatteryUtils(device)
-
-  build_product = ''
-  build_id = ''
-  battery_level = 100
-  errors = []
-  dev_good = True
-  json_data = {}
-
-  try:
-    build_product = device.build_product
-    build_id = device.build_id
-
-    json_data = {
-      'serial': device.adb.GetDeviceSerial(),
-      'type': build_product,
-      'build': build_id,
-      'build_detail': device.GetProp('ro.build.fingerprint'),
-      'battery': {},
-      'imei_slice': 'Unknown',
-      'wifi_ip': device.GetProp('dhcp.wlan0.ipaddress'),
-    }
-
-    battery_info = {}
-    try:
-      battery_info = battery.GetBatteryInfo(timeout=5)
-      battery_level = int(battery_info.get('level', battery_level))
-      json_data['battery'] = battery_info
-    except device_errors.CommandFailedError:
-      logging.exception('Failed to get battery information for %s', str(device))
-
-    try:
-      for l in device.RunShellCommand(['dumpsys', 'iphonesubinfo'],
-                                      check_return=True, timeout=5):
-        m = _RE_DEVICE_ID.match(l)
-        if m:
-          json_data['imei_slice'] = m.group(1)[-6:]
-    except device_errors.CommandFailedError:
-      logging.exception('Failed to get IMEI slice for %s', str(device))
-
-    if battery_level < 15:
-      errors += ['Device critically low in battery.']
-      dev_good = False
-      if not battery.GetCharging():
-        battery.SetCharging(True)
-    if not options.no_provisioning_check:
-      setup_wizard_disabled = (
-          device.GetProp('ro.setupwizard.mode') == 'DISABLED')
-      if not setup_wizard_disabled and device.build_type != 'user':
-        errors += ['Setup wizard not disabled. Was it provisioned correctly?']
-    if (device.product_name == 'mantaray' and
-        battery_info.get('AC powered', None) != 'true'):
-      errors += ['Mantaray device not connected to AC power.']
-  except device_errors.CommandFailedError:
-    logging.exception('Failure while getting device status.')
-    dev_good = False
-  except device_errors.CommandTimeoutError:
-    logging.exception('Timeout while getting device status.')
-    dev_good = False
-
-  return (build_product, build_id, battery_level, errors, dev_good, json_data)
-
-
-def CheckForMissingDevices(options, devices):
-  """Uses file of previous online devices to detect broken phones.
-
-  Args:
-    options: out_dir parameter of options argument is used as the base
-      directory to load and update the cache file.
-    devices: A list of DeviceUtils instance for the currently visible and
-      online attached devices.
-  """
-  out_dir = os.path.abspath(options.out_dir)
-  device_serials = set(d.adb.GetDeviceSerial() for d in devices)
-
-  # last_devices denotes all known devices prior to this run
-  last_devices_path = os.path.join(out_dir, device_list.LAST_DEVICES_FILENAME)
-  last_missing_devices_path = os.path.join(out_dir,
-      device_list.LAST_MISSING_DEVICES_FILENAME)
-  try:
-    last_devices = device_list.GetPersistentDeviceList(last_devices_path)
-  except IOError:
-    # Ignore error, file might not exist
-    last_devices = []
-
-  try:
-    last_missing_devices = device_list.GetPersistentDeviceList(
-        last_missing_devices_path)
-  except IOError:
-    last_missing_devices = []
-
-  missing_devs = list(set(last_devices) - device_serials)
-  new_missing_devs = list(set(missing_devs) - set(last_missing_devices))
-
-  if new_missing_devs and os.environ.get('BUILDBOT_SLAVENAME'):
-    logging.info('new_missing_devs %s' % new_missing_devs)
-    devices_missing_msg = '%d devices not detected.' % len(missing_devs)
-    bb_annotations.PrintSummaryText(devices_missing_msg)
-
-    from_address = 'chrome-bot@chromium.org'
-    to_addresses = ['chrome-labs-tech-ticket@google.com',
-                    'chrome-android-device-alert@google.com']
-    cc_addresses = ['chrome-android-device-alert@google.com']
-    subject = 'Devices offline on %s, %s, %s' % (
-      os.environ.get('BUILDBOT_SLAVENAME'),
-      os.environ.get('BUILDBOT_BUILDERNAME'),
-      os.environ.get('BUILDBOT_BUILDNUMBER'))
-    msg = ('Please reboot the following devices:\n%s' %
-           '\n'.join(map(str, new_missing_devs)))
-    SendEmail(from_address, to_addresses, cc_addresses, subject, msg)
-
-  all_known_devices = list(device_serials | set(last_devices))
-  device_list.WritePersistentDeviceList(last_devices_path, all_known_devices)
-  device_list.WritePersistentDeviceList(last_missing_devices_path, missing_devs)
-
-  if not all_known_devices:
-    # This can happen if for some reason the .last_devices file is not
-    # present or if it was empty.
-    return ['No online devices. Have any devices been plugged in?']
-  if missing_devs:
-    devices_missing_msg = '%d devices not detected.' % len(missing_devs)
-    bb_annotations.PrintSummaryText(devices_missing_msg)
-    return ['Current online devices: %s' % ', '.join(d for d in device_serials),
-            '%s are no longer visible. Were they removed?' % missing_devs]
-  else:
-    new_devs = device_serials - set(last_devices)
-    if new_devs and os.path.exists(last_devices_path):
-      bb_annotations.PrintWarning()
-      bb_annotations.PrintSummaryText(
-          '%d new devices detected' % len(new_devs))
-      logging.info('New devices detected:')
-      for d in new_devs:
-        logging.info('  %s', d)
-
-
-def SendEmail(from_address, to_addresses, cc_addresses, subject, msg):
-  msg_body = '\r\n'.join(['From: %s' % from_address,
-                          'To: %s' % ', '.join(to_addresses),
-                          'CC: %s' % ', '.join(cc_addresses),
-                          'Subject: %s' % subject, '', msg])
-  try:
-    server = smtplib.SMTP('localhost')
-    server.sendmail(from_address, to_addresses, msg_body)
-    server.quit()
-  except Exception:
-    logging.exception('Failed to send alert email.')
-
-
-def RestartUsb():
-  if not os.path.isfile('/usr/bin/restart_usb'):
-    logging.error('Could not restart usb. ''/usr/bin/restart_usb not '
-                  'installed on host (see BUG=305769).')
-    return False
-
-  lsusb_proc = bb_utils.SpawnCmd(['lsusb'], stdout=subprocess.PIPE)
-  lsusb_output, _ = lsusb_proc.communicate()
-  if lsusb_proc.returncode:
-    logging.error('Could not get list of USB ports (i.e. lsusb).')
-    return lsusb_proc.returncode
-
-  usb_devices = [re.findall(r'Bus (\d\d\d) Device (\d\d\d)', lsusb_line)[0]
-                 for lsusb_line in lsusb_output.strip().split('\n')]
-
-  all_restarted = True
-  # Walk USB devices from leaves up (i.e reverse sorted) restarting the
-  # connection. If a parent node (e.g. usb hub) is restarted before the
-  # devices connected to it, the (bus, dev) for the hub can change, making the
-  # output we have wrong. This way we restart the devices before the hub.
-  for (bus, dev) in reversed(sorted(usb_devices)):
-    # Can not restart root usb connections
-    if dev != '001':
-      return_code = bb_utils.RunCmd(['/usr/bin/restart_usb', bus, dev])
-      if return_code:
-        logging.error('Error restarting USB device /dev/bus/usb/%s/%s',
-                      bus, dev)
-        all_restarted = False
-      else:
-        logging.info('Restarted USB device /dev/bus/usb/%s/%s', bus, dev)
-
-  return all_restarted
-
-
-def KillAllAdb():
-  def GetAllAdb():
-    for p in psutil.process_iter():
-      try:
-        if 'adb' in p.name:
-          yield p
-      except (psutil.NoSuchProcess, psutil.AccessDenied):
-        pass
-
-  for sig in [signal.SIGTERM, signal.SIGQUIT, signal.SIGKILL]:
-    for p in GetAllAdb():
-      try:
-        logging.info('kill %d %d (%s [%s])', sig, p.pid, p.name,
-                     ' '.join(p.cmdline))
-        p.send_signal(sig)
-      except (psutil.NoSuchProcess, psutil.AccessDenied):
-        pass
-  for p in GetAllAdb():
-    try:
-      logging.error('Unable to kill %d (%s [%s])', p.pid, p.name,
-                    ' '.join(p.cmdline))
-    except (psutil.NoSuchProcess, psutil.AccessDenied):
-      pass
-
-
-def main():
-  parser = optparse.OptionParser()
-  parser.add_option('', '--out-dir',
-                    help='Directory where the device path is stored',
-                    default=os.path.join(constants.DIR_SOURCE_ROOT, 'out'))
-  parser.add_option('--no-provisioning-check', action='store_true',
-                    help='Will not check if devices are provisioned properly.')
-  parser.add_option('--device-status-dashboard', action='store_true',
-                    help='Output device status data for dashboard.')
-  parser.add_option('--restart-usb', action='store_true',
-                    help='Restart USB ports before running device check.')
-  parser.add_option('--json-output',
-                    help='Output JSON information into a specified file.')
-  parser.add_option('-v', '--verbose', action='count', default=1,
-                    help='Log more information.')
-
-  options, args = parser.parse_args()
-  if args:
-    parser.error('Unknown options %s' % args)
-
-  run_tests_helper.SetLogLevel(options.verbose)
-
-  # Remove the last build's "bad devices" before checking device statuses.
-  device_blacklist.ResetBlacklist()
-
-  try:
-    expected_devices = device_list.GetPersistentDeviceList(
-        os.path.join(options.out_dir, device_list.LAST_DEVICES_FILENAME))
-  except IOError:
-    expected_devices = []
-  devices = device_utils.DeviceUtils.HealthyDevices()
-  device_serials = [d.adb.GetDeviceSerial() for d in devices]
-  # Only restart usb if devices are missing.
-  if set(expected_devices) != set(device_serials):
-    logging.warning('expected_devices: %s', expected_devices)
-    logging.warning('devices: %s', device_serials)
-    KillAllAdb()
-    retries = 5
-    usb_restarted = True
-    if options.restart_usb:
-      if not RestartUsb():
-        usb_restarted = False
-        bb_annotations.PrintWarning()
-        logging.error('USB reset stage failed, '
-                      'wait for any device to come back.')
-    while retries:
-      logging.info('retry adb devices...')
-      time.sleep(1)
-      devices = device_utils.DeviceUtils.HealthyDevices()
-      device_serials = [d.adb.GetDeviceSerial() for d in devices]
-      if set(expected_devices) == set(device_serials):
-        # All devices are online, keep going.
-        break
-      if not usb_restarted and devices:
-        # The USB wasn't restarted, but there's at least one device online.
-        # No point in trying to wait for all devices.
-        break
-      retries -= 1
-
-  types, builds, batteries, errors, devices_ok, json_data = (
-      [], [], [], [], [], [])
-  if devices:
-    types, builds, batteries, errors, devices_ok, json_data = (
-        zip(*[DeviceInfo(dev, options) for dev in devices]))
-
-  # Write device info to file for buildbot info display.
-  if os.path.exists('/home/chrome-bot'):
-    with open('/home/chrome-bot/.adb_device_info', 'w') as f:
-      for device in json_data:
-        try:
-          f.write('%s %s %s %.1fC %s%%\n' % (device['serial'], device['type'],
-              device['build'], float(device['battery']['temperature']) / 10,
-              device['battery']['level']))
-        except Exception:
-          pass
-
-  err_msg = CheckForMissingDevices(options, devices) or []
-
-  unique_types = list(set(types))
-  unique_builds = list(set(builds))
-
-  bb_annotations.PrintMsg('Online devices: %d. Device types %s, builds %s'
-                           % (len(devices), unique_types, unique_builds))
-
-  for j in json_data:
-    logging.info('Device %s (%s)', j.get('serial'), j.get('type'))
-    logging.info('  Build: %s (%s)', j.get('build'), j.get('build_detail'))
-    logging.info('  Current Battery Service state:')
-    for k, v in j.get('battery', {}).iteritems():
-      logging.info('    %s: %s', k, v)
-    logging.info('  IMEI slice: %s', j.get('imei_slice'))
-    logging.info('  WiFi IP: %s', j.get('wifi_ip'))
-
-
-  for dev, dev_errors in zip(devices, errors):
-    if dev_errors:
-      err_msg += ['%s errors:' % str(dev)]
-      err_msg += ['    %s' % error for error in dev_errors]
-
-  if err_msg:
-    bb_annotations.PrintWarning()
-    for e in err_msg:
-      logging.error(e)
-    from_address = 'buildbot@chromium.org'
-    to_addresses = ['chromium-android-device-alerts@google.com']
-    bot_name = os.environ.get('BUILDBOT_BUILDERNAME')
-    slave_name = os.environ.get('BUILDBOT_SLAVENAME')
-    subject = 'Device status check errors on %s, %s.' % (slave_name, bot_name)
-    SendEmail(from_address, to_addresses, [], subject, '\n'.join(err_msg))
-
-  if options.device_status_dashboard:
-    offline_devices = [
-        device_utils.DeviceUtils(a)
-        for a in adb_wrapper.AdbWrapper.Devices(is_ready=False)
-        if a.GetState() == 'offline']
-
-    perf_tests_results_helper.PrintPerfResult('BotDevices', 'OnlineDevices',
-                                              [len(devices)], 'devices')
-    perf_tests_results_helper.PrintPerfResult('BotDevices', 'OfflineDevices',
-                                              [len(offline_devices)], 'devices',
-                                              'unimportant')
-    for dev, battery in zip(devices, batteries):
-      perf_tests_results_helper.PrintPerfResult('DeviceBattery', str(dev),
-                                                [battery], '%',
-                                                'unimportant')
-
-  if options.json_output:
-    with open(options.json_output, 'wb') as f:
-      f.write(json.dumps(json_data, indent=4))
-
-  num_failed_devs = 0
-  for device_ok, device in zip(devices_ok, devices):
-    if not device_ok:
-      logging.warning('Blacklisting %s', str(device))
-      device_blacklist.ExtendBlacklist([str(device)])
-      num_failed_devs += 1
-
-  if num_failed_devs == len(devices):
-    return 2
-
-  if not devices:
-    return 1
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/android/buildbot/bb_device_steps.py b/build/android/buildbot/bb_device_steps.py
deleted file mode 100755
index 8ad42b9..0000000
--- a/build/android/buildbot/bb_device_steps.py
+++ /dev/null
@@ -1,796 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import collections
-import glob
-import hashlib
-import json
-import os
-import random
-import re
-import shutil
-import sys
-
-import bb_utils
-import bb_annotations
-
-sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
-import provision_devices
-from pylib import constants
-from pylib.device import device_utils
-from pylib.gtest import gtest_config
-
-CHROME_SRC_DIR = bb_utils.CHROME_SRC
-DIR_BUILD_ROOT = os.path.dirname(CHROME_SRC_DIR)
-CHROME_OUT_DIR = bb_utils.CHROME_OUT_DIR
-BLINK_SCRIPTS_DIR = 'third_party/WebKit/Tools/Scripts'
-
-SLAVE_SCRIPTS_DIR = os.path.join(bb_utils.BB_BUILD_DIR, 'scripts', 'slave')
-LOGCAT_DIR = os.path.join(bb_utils.CHROME_OUT_DIR, 'logcat')
-GS_URL = 'https://storage.googleapis.com'
-GS_AUTH_URL = 'https://storage.cloud.google.com'
-
-# Describes an instrumation test suite:
-#   test: Name of test we're running.
-#   apk: apk to be installed.
-#   apk_package: package for the apk to be installed.
-#   test_apk: apk to run tests on.
-#   test_data: data folder in format destination:source.
-#   host_driven_root: The host-driven test root directory.
-#   annotation: Annotation of the tests to include.
-#   exclude_annotation: The annotation of the tests to exclude.
-I_TEST = collections.namedtuple('InstrumentationTest', [
-    'name', 'apk', 'apk_package', 'test_apk', 'test_data', 'isolate_file_path',
-    'host_driven_root', 'annotation', 'exclude_annotation', 'extra_flags'])
-
-
-def SrcPath(*path):
-  return os.path.join(CHROME_SRC_DIR, *path)
-
-
-def I(name, apk, apk_package, test_apk, test_data, isolate_file_path=None,
-      host_driven_root=None, annotation=None, exclude_annotation=None,
-      extra_flags=None):
-  return I_TEST(name, apk, apk_package, test_apk, test_data, isolate_file_path,
-                host_driven_root, annotation, exclude_annotation, extra_flags)
-
-INSTRUMENTATION_TESTS = dict((suite.name, suite) for suite in [
-    I('ContentShell',
-      'ContentShell.apk',
-      'org.chromium.content_shell_apk',
-      'ContentShellTest',
-      'content:content/test/data/android/device_files',
-      isolate_file_path='content/content_shell_test_apk.isolate'),
-    I('ChromeShell',
-      'ChromeShell.apk',
-      'org.chromium.chrome.shell',
-      'ChromeShellTest',
-      'chrome:chrome/test/data/android/device_files',
-      isolate_file_path='chrome/chrome_shell_test_apk.isolate',
-      host_driven_root=constants.CHROME_SHELL_HOST_DRIVEN_DIR),
-    I('AndroidWebView',
-      'AndroidWebView.apk',
-      'org.chromium.android_webview.shell',
-      'AndroidWebViewTest',
-      'webview:android_webview/test/data/device_files',
-      isolate_file_path='android_webview/android_webview_test_apk.isolate'),
-    I('ChromeSyncShell',
-      'ChromeSyncShell.apk',
-      'org.chromium.chrome.browser.sync',
-      'ChromeSyncShellTest',
-      None),
-    ])
-
-InstallablePackage = collections.namedtuple('InstallablePackage', [
-    'name', 'apk', 'apk_package'])
-
-INSTALLABLE_PACKAGES = dict((package.name, package) for package in (
-    [InstallablePackage(i.name, i.apk, i.apk_package)
-     for i in INSTRUMENTATION_TESTS.itervalues()] +
-    [InstallablePackage('ChromeDriverWebViewShell',
-                        'ChromeDriverWebViewShell.apk',
-                        'org.chromium.chromedriver_webview_shell')]))
-
-VALID_TESTS = set([
-    'base_junit_tests',
-    'chromedriver',
-    'chrome_proxy',
-    'components_browsertests',
-    'gfx_unittests',
-    'gl_unittests',
-    'gpu',
-    'python_unittests',
-    'telemetry_unittests',
-    'telemetry_perf_unittests',
-    'ui',
-    'unit',
-    'webkit',
-    'webkit_layout'
-])
-
-RunCmd = bb_utils.RunCmd
-
-
-def _GetRevision(options):
-  """Get the SVN revision number.
-
-  Args:
-    options: options object.
-
-  Returns:
-    The revision number.
-  """
-  revision = options.build_properties.get('got_revision')
-  if not revision:
-    revision = options.build_properties.get('revision', 'testing')
-  return revision
-
-
-def _RunTest(options, cmd, suite):
-  """Run test command with runtest.py.
-
-  Args:
-    options: options object.
-    cmd: the command to run.
-    suite: test name.
-  """
-  property_args = bb_utils.EncodeProperties(options)
-  args = [os.path.join(SLAVE_SCRIPTS_DIR, 'runtest.py')] + property_args
-  args += ['--test-platform', 'android']
-  if options.factory_properties.get('generate_gtest_json'):
-    args.append('--generate-json-file')
-    args += ['-o', 'gtest-results/%s' % suite,
-             '--annotate', 'gtest',
-             '--build-number', str(options.build_properties.get('buildnumber',
-                                                                '')),
-             '--builder-name', options.build_properties.get('buildername', '')]
-  if options.target == 'Release':
-    args += ['--target', 'Release']
-  else:
-    args += ['--target', 'Debug']
-  if options.flakiness_server:
-    args += ['--flakiness-dashboard-server=%s' %
-                options.flakiness_server]
-  args += cmd
-  RunCmd(args, cwd=DIR_BUILD_ROOT)
-
-
-def RunTestSuites(options, suites, suites_options=None):
-  """Manages an invocation of test_runner.py for gtests.
-
-  Args:
-    options: options object.
-    suites: List of suite names to run.
-    suites_options: Command line options dictionary for particular suites.
-                    For example,
-                    {'content_browsertests', ['--num_retries=1', '--release']}
-                    will add the options only to content_browsertests.
-  """
-
-  if not suites_options:
-    suites_options = {}
-
-  args = ['--verbose']
-  if options.target == 'Release':
-    args.append('--release')
-  if options.asan:
-    args.append('--tool=asan')
-  if options.gtest_filter:
-    args.append('--gtest-filter=%s' % options.gtest_filter)
-
-  for suite in suites:
-    bb_annotations.PrintNamedStep(suite)
-    cmd = [suite] + args
-    cmd += suites_options.get(suite, [])
-    if suite == 'content_browsertests' or suite == 'components_browsertests':
-      cmd.append('--num_retries=1')
-    _RunTest(options, cmd, suite)
-
-
-def RunJunitSuite(suite):
-  bb_annotations.PrintNamedStep(suite)
-  RunCmd(['build/android/test_runner.py', 'junit', '-s', suite])
-
-
-def RunChromeDriverTests(options):
-  """Run all the steps for running chromedriver tests."""
-  bb_annotations.PrintNamedStep('chromedriver_annotation')
-  RunCmd(['chrome/test/chromedriver/run_buildbot_steps.py',
-          '--android-packages=%s,%s,%s,%s' %
-          ('chrome_shell',
-           'chrome_stable',
-           'chrome_beta',
-           'chromedriver_webview_shell'),
-          '--revision=%s' % _GetRevision(options),
-          '--update-log'])
-
-def RunChromeProxyTests(options):
-  """Run the chrome_proxy tests.
-
-  Args:
-    options: options object.
-  """
-  InstallApk(options, INSTRUMENTATION_TESTS['ChromeShell'], False)
-  args = ['--browser', 'android-chrome-shell']
-  devices = device_utils.DeviceUtils.HealthyDevices()
-  if devices:
-    args = args + ['--device', devices[0].adb.GetDeviceSerial()]
-  bb_annotations.PrintNamedStep('chrome_proxy')
-  RunCmd(['tools/chrome_proxy/run_tests'] + args)
-
-
-def RunTelemetryTests(options, step_name, run_tests_path):
-  """Runs either telemetry_perf_unittests or telemetry_unittests.
-
-  Args:
-    options: options object.
-    step_name: either 'telemetry_unittests' or 'telemetry_perf_unittests'
-    run_tests_path: path to run_tests script (tools/perf/run_tests for
-                    perf_unittests and tools/telemetry/run_tests for
-                    telemetry_unittests)
-  """
-  InstallApk(options, INSTRUMENTATION_TESTS['ChromeShell'], False)
-  args = ['--browser', 'android-chrome-shell']
-  devices = device_utils.DeviceUtils.HealthyDevices()
-  if devices:
-    args = args + ['--device', 'android']
-  bb_annotations.PrintNamedStep(step_name)
-  RunCmd([run_tests_path] + args)
-
-
-def InstallApk(options, test, print_step=False):
-  """Install an apk to all phones.
-
-  Args:
-    options: options object
-    test: An I_TEST namedtuple
-    print_step: Print a buildbot step
-  """
-  if print_step:
-    bb_annotations.PrintNamedStep('install_%s' % test.name.lower())
-
-  args = ['--apk_package', test.apk_package]
-  if options.target == 'Release':
-    args.append('--release')
-  args.append(test.apk)
-
-  RunCmd(['build/android/adb_install_apk.py'] + args, halt_on_failure=True)
-
-
-def RunInstrumentationSuite(options, test, flunk_on_failure=True,
-                            python_only=False, official_build=False):
-  """Manages an invocation of test_runner.py for instrumentation tests.
-
-  Args:
-    options: options object
-    test: An I_TEST namedtuple
-    flunk_on_failure: Flunk the step if tests fail.
-    Python: Run only host driven Python tests.
-    official_build: Run official-build tests.
-  """
-  bb_annotations.PrintNamedStep('%s_instrumentation_tests' % test.name.lower())
-
-  if test.apk:
-    InstallApk(options, test)
-  args = ['--test-apk', test.test_apk, '--verbose']
-  if test.test_data:
-    args.extend(['--test_data', test.test_data])
-  if options.target == 'Release':
-    args.append('--release')
-  if options.asan:
-    args.append('--tool=asan')
-  if options.flakiness_server:
-    args.append('--flakiness-dashboard-server=%s' %
-                options.flakiness_server)
-  if options.coverage_bucket:
-    args.append('--coverage-dir=%s' % options.coverage_dir)
-  if test.isolate_file_path:
-    args.append('--isolate-file-path=%s' % test.isolate_file_path)
-  if test.host_driven_root:
-    args.append('--host-driven-root=%s' % test.host_driven_root)
-  if test.annotation:
-    args.extend(['-A', test.annotation])
-  if test.exclude_annotation:
-    args.extend(['-E', test.exclude_annotation])
-  if test.extra_flags:
-    args.extend(test.extra_flags)
-  if python_only:
-    args.append('-p')
-  if official_build:
-    # The option needs to be assigned 'True' as it does not have an action
-    # associated with it.
-    args.append('--official-build')
-
-  RunCmd(['build/android/test_runner.py', 'instrumentation'] + args,
-         flunk_on_failure=flunk_on_failure)
-
-
-def RunWebkitLint():
-  """Lint WebKit's TestExpectation files."""
-  bb_annotations.PrintNamedStep('webkit_lint')
-  RunCmd([SrcPath(os.path.join(BLINK_SCRIPTS_DIR, 'lint-test-expectations'))])
-
-
-def RunWebkitLayoutTests(options):
-  """Run layout tests on an actual device."""
-  bb_annotations.PrintNamedStep('webkit_tests')
-  cmd_args = [
-      '--no-show-results',
-      '--no-new-test-results',
-      '--full-results-html',
-      '--clobber-old-results',
-      '--exit-after-n-failures', '5000',
-      '--exit-after-n-crashes-or-timeouts', '100',
-      '--debug-rwt-logging',
-      '--results-directory', '../layout-test-results',
-      '--target', options.target,
-      '--builder-name', options.build_properties.get('buildername', ''),
-      '--build-number', str(options.build_properties.get('buildnumber', '')),
-      '--master-name', 'ChromiumWebkit',  # TODO: Get this from the cfg.
-      '--build-name', options.build_properties.get('buildername', ''),
-      '--platform=android']
-
-  for flag in 'test_results_server', 'driver_name', 'additional_driver_flag':
-    if flag in options.factory_properties:
-      cmd_args.extend(['--%s' % flag.replace('_', '-'),
-                       options.factory_properties.get(flag)])
-
-  for f in options.factory_properties.get('additional_expectations', []):
-    cmd_args.extend(
-        ['--additional-expectations=%s' % os.path.join(CHROME_SRC_DIR, *f)])
-
-  # TODO(dpranke): Remove this block after
-  # https://codereview.chromium.org/12927002/ lands.
-  for f in options.factory_properties.get('additional_expectations_files', []):
-    cmd_args.extend(
-        ['--additional-expectations=%s' % os.path.join(CHROME_SRC_DIR, *f)])
-
-  exit_code = RunCmd(
-      [SrcPath(os.path.join(BLINK_SCRIPTS_DIR, 'run-webkit-tests'))] + cmd_args)
-  if exit_code == 255: # test_run_results.UNEXPECTED_ERROR_EXIT_STATUS
-    bb_annotations.PrintMsg('?? (crashed or hung)')
-  elif exit_code == 254: # test_run_results.NO_DEVICES_EXIT_STATUS
-    bb_annotations.PrintMsg('?? (no devices found)')
-  elif exit_code == 253: # test_run_results.NO_TESTS_EXIT_STATUS
-    bb_annotations.PrintMsg('?? (no tests found)')
-  else:
-    full_results_path = os.path.join('..', 'layout-test-results',
-                                     'full_results.json')
-    if os.path.exists(full_results_path):
-      full_results = json.load(open(full_results_path))
-      unexpected_passes, unexpected_failures, unexpected_flakes = (
-          _ParseLayoutTestResults(full_results))
-      if unexpected_failures:
-        _PrintDashboardLink('failed', unexpected_failures.keys(),
-                            max_tests=25)
-      elif unexpected_passes:
-        _PrintDashboardLink('unexpected passes', unexpected_passes.keys(),
-                            max_tests=10)
-      if unexpected_flakes:
-        _PrintDashboardLink('unexpected flakes', unexpected_flakes.keys(),
-                            max_tests=10)
-
-      if exit_code == 0 and (unexpected_passes or unexpected_flakes):
-        # If exit_code != 0, RunCmd() will have already printed an error.
-        bb_annotations.PrintWarning()
-    else:
-      bb_annotations.PrintError()
-      bb_annotations.PrintMsg('?? (results missing)')
-
-  if options.factory_properties.get('archive_webkit_results', False):
-    bb_annotations.PrintNamedStep('archive_webkit_results')
-    base = 'https://storage.googleapis.com/chromium-layout-test-archives'
-    builder_name = options.build_properties.get('buildername', '')
-    build_number = str(options.build_properties.get('buildnumber', ''))
-    results_link = '%s/%s/%s/layout-test-results/results.html' % (
-        base, EscapeBuilderName(builder_name), build_number)
-    bb_annotations.PrintLink('results', results_link)
-    bb_annotations.PrintLink('(zip)', '%s/%s/%s/layout-test-results.zip' % (
-        base, EscapeBuilderName(builder_name), build_number))
-    gs_bucket = 'gs://chromium-layout-test-archives'
-    RunCmd([os.path.join(SLAVE_SCRIPTS_DIR, 'chromium',
-                         'archive_layout_test_results.py'),
-            '--results-dir', '../../layout-test-results',
-            '--build-number', build_number,
-            '--builder-name', builder_name,
-            '--gs-bucket', gs_bucket],
-            cwd=DIR_BUILD_ROOT)
-
-
-def _ParseLayoutTestResults(results):
-  """Extract the failures from the test run."""
-  # Cloned from third_party/WebKit/Tools/Scripts/print-json-test-results
-  tests = _ConvertTrieToFlatPaths(results['tests'])
-  failures = {}
-  flakes = {}
-  passes = {}
-  for (test, result) in tests.iteritems():
-    if result.get('is_unexpected'):
-      actual_results = result['actual'].split()
-      expected_results = result['expected'].split()
-      if len(actual_results) > 1:
-        # We report the first failure type back, even if the second
-        # was more severe.
-        if actual_results[1] in expected_results:
-          flakes[test] = actual_results[0]
-        else:
-          failures[test] = actual_results[0]
-      elif actual_results[0] == 'PASS':
-        passes[test] = result
-      else:
-        failures[test] = actual_results[0]
-
-  return (passes, failures, flakes)
-
-
-def _ConvertTrieToFlatPaths(trie, prefix=None):
-  """Flatten the trie of failures into a list."""
-  # Cloned from third_party/WebKit/Tools/Scripts/print-json-test-results
-  result = {}
-  for name, data in trie.iteritems():
-    if prefix:
-      name = prefix + '/' + name
-
-    if len(data) and 'actual' not in data and 'expected' not in data:
-      result.update(_ConvertTrieToFlatPaths(data, name))
-    else:
-      result[name] = data
-
-  return result
-
-
-def _PrintDashboardLink(link_text, tests, max_tests):
-  """Add a link to the flakiness dashboard in the step annotations."""
-  if len(tests) > max_tests:
-    test_list_text = ' '.join(tests[:max_tests]) + ' and more'
-  else:
-    test_list_text = ' '.join(tests)
-
-  dashboard_base = ('http://test-results.appspot.com'
-                    '/dashboards/flakiness_dashboard.html#'
-                    'master=ChromiumWebkit&tests=')
-
-  bb_annotations.PrintLink('%d %s: %s' %
-                           (len(tests), link_text, test_list_text),
-                           dashboard_base + ','.join(tests))
-
-
-def EscapeBuilderName(builder_name):
-  return re.sub('[ ()]', '_', builder_name)
-
-
-def SpawnLogcatMonitor():
-  shutil.rmtree(LOGCAT_DIR, ignore_errors=True)
-  bb_utils.SpawnCmd([
-      os.path.join(CHROME_SRC_DIR, 'build', 'android', 'adb_logcat_monitor.py'),
-      LOGCAT_DIR])
-
-  # Wait for logcat_monitor to pull existing logcat
-  RunCmd(['sleep', '5'])
-
-
-def ProvisionDevices(options):
-  bb_annotations.PrintNamedStep('provision_devices')
-
-  if not bb_utils.TESTING:
-    # Restart adb to work around bugs, sleep to wait for usb discovery.
-    device_utils.RestartServer()
-    RunCmd(['sleep', '1'])
-  provision_cmd = ['build/android/provision_devices.py', '-t', options.target]
-  if options.auto_reconnect:
-    provision_cmd.append('--auto-reconnect')
-  if options.skip_wipe:
-    provision_cmd.append('--skip-wipe')
-  if options.disable_location:
-    provision_cmd.append('--disable-location')
-  RunCmd(provision_cmd, halt_on_failure=True)
-
-
-def DeviceStatusCheck(options):
-  bb_annotations.PrintNamedStep('device_status_check')
-  cmd = ['build/android/buildbot/bb_device_status_check.py']
-  if options.restart_usb:
-    cmd.append('--restart-usb')
-  RunCmd(cmd, halt_on_failure=True)
-
-
-def GetDeviceSetupStepCmds():
-  return [
-      ('device_status_check', DeviceStatusCheck),
-      ('provision_devices', ProvisionDevices),
-  ]
-
-
-def RunUnitTests(options):
-  suites = gtest_config.STABLE_TEST_SUITES
-  if options.asan:
-    suites = [s for s in suites
-              if s not in gtest_config.ASAN_EXCLUDED_TEST_SUITES]
-  RunTestSuites(options, suites)
-
-
-def RunTelemetryUnitTests(options):
-  RunTelemetryTests(options, 'telemetry_unittests', 'tools/telemetry/run_tests')
-
-
-def RunTelemetryPerfUnitTests(options):
-  RunTelemetryTests(options, 'telemetry_perf_unittests', 'tools/perf/run_tests')
-
-
-def RunInstrumentationTests(options):
-  for test in INSTRUMENTATION_TESTS.itervalues():
-    RunInstrumentationSuite(options, test)
-
-
-def RunWebkitTests(options):
-  RunTestSuites(options, ['webkit_unit_tests', 'blink_heap_unittests'])
-  RunWebkitLint()
-
-
-def RunGPUTests(options):
-  revision = _GetRevision(options)
-  builder_name = options.build_properties.get('buildername', 'noname')
-
-  bb_annotations.PrintNamedStep('pixel_tests')
-  RunCmd(['content/test/gpu/run_gpu_test.py',
-          'pixel', '-v',
-          '--browser',
-          'android-content-shell',
-          '--build-revision',
-          str(revision),
-          '--upload-refimg-to-cloud-storage',
-          '--refimg-cloud-storage-bucket',
-          'chromium-gpu-archive/reference-images',
-          '--os-type',
-          'android',
-          '--test-machine-name',
-          EscapeBuilderName(builder_name)])
-
-  bb_annotations.PrintNamedStep('webgl_conformance_tests')
-  RunCmd(['content/test/gpu/run_gpu_test.py', '-v',
-          '--browser=android-content-shell', 'webgl_conformance',
-          '--webgl-conformance-version=1.0.1'])
-
-  bb_annotations.PrintNamedStep('android_webview_webgl_conformance_tests')
-  RunCmd(['content/test/gpu/run_gpu_test.py', '-v',
-          '--browser=android-webview-shell', 'webgl_conformance',
-          '--webgl-conformance-version=1.0.1'])
-
-  bb_annotations.PrintNamedStep('gpu_rasterization_tests')
-  RunCmd(['content/test/gpu/run_gpu_test.py',
-          'gpu_rasterization', '-v',
-          '--browser',
-          'android-content-shell',
-          '--build-revision',
-          str(revision),
-          '--test-machine-name',
-          EscapeBuilderName(builder_name)])
-
-
-def RunPythonUnitTests(_options):
-  for suite in constants.PYTHON_UNIT_TEST_SUITES:
-    bb_annotations.PrintNamedStep(suite)
-    RunCmd(['build/android/test_runner.py', 'python', '-s', suite])
-
-
-def GetTestStepCmds():
-  return [
-      ('base_junit_tests',
-          lambda _options: RunJunitSuite('base_junit_tests')),
-      ('chromedriver', RunChromeDriverTests),
-      ('chrome_proxy', RunChromeProxyTests),
-      ('components_browsertests',
-          lambda options: RunTestSuites(options, ['components_browsertests'])),
-      ('gfx_unittests',
-          lambda options: RunTestSuites(options, ['gfx_unittests'])),
-      ('gl_unittests',
-          lambda options: RunTestSuites(options, ['gl_unittests'])),
-      ('gpu', RunGPUTests),
-      ('python_unittests', RunPythonUnitTests),
-      ('telemetry_unittests', RunTelemetryUnitTests),
-      ('telemetry_perf_unittests', RunTelemetryPerfUnitTests),
-      ('ui', RunInstrumentationTests),
-      ('unit', RunUnitTests),
-      ('webkit', RunWebkitTests),
-      ('webkit_layout', RunWebkitLayoutTests),
-  ]
-
-
-def MakeGSPath(options, gs_base_dir):
-  revision = _GetRevision(options)
-  bot_id = options.build_properties.get('buildername', 'testing')
-  randhash = hashlib.sha1(str(random.random())).hexdigest()
-  gs_path = '%s/%s/%s/%s' % (gs_base_dir, bot_id, revision, randhash)
-  # remove double slashes, happens with blank revisions and confuses gsutil
-  gs_path = re.sub('/+', '/', gs_path)
-  return gs_path
-
-def UploadHTML(options, gs_base_dir, dir_to_upload, link_text,
-               link_rel_path='index.html', gs_url=GS_URL):
-  """Uploads directory at |dir_to_upload| to Google Storage and output a link.
-
-  Args:
-    options: Command line options.
-    gs_base_dir: The Google Storage base directory (e.g.
-      'chromium-code-coverage/java')
-    dir_to_upload: Absolute path to the directory to be uploaded.
-    link_text: Link text to be displayed on the step.
-    link_rel_path: Link path relative to |dir_to_upload|.
-    gs_url: Google storage URL.
-  """
-  gs_path = MakeGSPath(options, gs_base_dir)
-  RunCmd([bb_utils.GSUTIL_PATH, 'cp', '-R', dir_to_upload, 'gs://%s' % gs_path])
-  bb_annotations.PrintLink(link_text,
-                           '%s/%s/%s' % (gs_url, gs_path, link_rel_path))
-
-
-def GenerateJavaCoverageReport(options):
-  """Generates an HTML coverage report using EMMA and uploads it."""
-  bb_annotations.PrintNamedStep('java_coverage_report')
-
-  coverage_html = os.path.join(options.coverage_dir, 'coverage_html')
-  RunCmd(['build/android/generate_emma_html.py',
-          '--coverage-dir', options.coverage_dir,
-          '--metadata-dir', os.path.join(CHROME_OUT_DIR, options.target),
-          '--cleanup',
-          '--output', os.path.join(coverage_html, 'index.html')])
-  return coverage_html
-
-
-def LogcatDump(options):
-  # Print logcat, kill logcat monitor
-  bb_annotations.PrintNamedStep('logcat_dump')
-  logcat_file = os.path.join(CHROME_OUT_DIR, options.target, 'full_log.txt')
-  RunCmd([SrcPath('build', 'android', 'adb_logcat_printer.py'),
-          '--output-path', logcat_file, LOGCAT_DIR])
-  gs_path = MakeGSPath(options, 'chromium-android/logcat_dumps')
-  RunCmd([bb_utils.GSUTIL_PATH, 'cp', '-z', 'txt', logcat_file,
-          'gs://%s' % gs_path])
-  bb_annotations.PrintLink('logcat dump', '%s/%s' % (GS_AUTH_URL, gs_path))
-
-
-def RunStackToolSteps(options):
-  """Run stack tool steps.
-
-  Stack tool is run for logcat dump, optionally for ASAN.
-  """
-  bb_annotations.PrintNamedStep('Run stack tool with logcat dump')
-  logcat_file = os.path.join(CHROME_OUT_DIR, options.target, 'full_log.txt')
-  RunCmd([os.path.join(CHROME_SRC_DIR, 'third_party', 'android_platform',
-          'development', 'scripts', 'stack'),
-          '--more-info', logcat_file])
-  if options.asan_symbolize:
-    bb_annotations.PrintNamedStep('Run stack tool for ASAN')
-    RunCmd([
-        os.path.join(CHROME_SRC_DIR, 'build', 'android', 'asan_symbolize.py'),
-        '-l', logcat_file])
-
-
-def GenerateTestReport(options):
-  bb_annotations.PrintNamedStep('test_report')
-  for report in glob.glob(
-      os.path.join(CHROME_OUT_DIR, options.target, 'test_logs', '*.log')):
-    RunCmd(['cat', report])
-    os.remove(report)
-
-
-def MainTestWrapper(options):
-  try:
-    # Spawn logcat monitor
-    SpawnLogcatMonitor()
-
-    # Run all device setup steps
-    for _, cmd in GetDeviceSetupStepCmds():
-      cmd(options)
-
-    if options.install:
-      for i in options.install:
-        install_obj = INSTALLABLE_PACKAGES[i]
-        InstallApk(options, install_obj, print_step=True)
-
-    if options.test_filter:
-      bb_utils.RunSteps(options.test_filter, GetTestStepCmds(), options)
-
-    if options.coverage_bucket:
-      coverage_html = GenerateJavaCoverageReport(options)
-      UploadHTML(options, '%s/java' % options.coverage_bucket, coverage_html,
-                 'Coverage Report')
-      shutil.rmtree(coverage_html, ignore_errors=True)
-
-    if options.experimental:
-      RunTestSuites(options, gtest_config.EXPERIMENTAL_TEST_SUITES)
-
-  finally:
-    # Run all post test steps
-    LogcatDump(options)
-    if not options.disable_stack_tool:
-      RunStackToolSteps(options)
-    GenerateTestReport(options)
-    # KillHostHeartbeat() has logic to check if heartbeat process is running,
-    # and kills only if it finds the process is running on the host.
-    provision_devices.KillHostHeartbeat()
-    if options.cleanup:
-      shutil.rmtree(os.path.join(CHROME_OUT_DIR, options.target),
-          ignore_errors=True)
-
-
-def GetDeviceStepsOptParser():
-  parser = bb_utils.GetParser()
-  parser.add_option('--experimental', action='store_true',
-                    help='Run experiemental tests')
-  parser.add_option('-f', '--test-filter', metavar='<filter>', default=[],
-                    action='append',
-                    help=('Run a test suite. Test suites: "%s"' %
-                          '", "'.join(VALID_TESTS)))
-  parser.add_option('--gtest-filter',
-                    help='Filter for running a subset of tests of a gtest test')
-  parser.add_option('--asan', action='store_true', help='Run tests with asan.')
-  parser.add_option('--install', metavar='<apk name>', action="append",
-                    help='Install an apk by name')
-  parser.add_option('--no-reboot', action='store_true',
-                    help='Do not reboot devices during provisioning.')
-  parser.add_option('--coverage-bucket',
-                    help=('Bucket name to store coverage results. Coverage is '
-                          'only run if this is set.'))
-  parser.add_option('--restart-usb', action='store_true',
-                    help='Restart usb ports before device status check.')
-  parser.add_option(
-      '--flakiness-server',
-      help=('The flakiness dashboard server to which the results should be '
-            'uploaded.'))
-  parser.add_option(
-      '--auto-reconnect', action='store_true',
-      help='Push script to device which restarts adbd on disconnections.')
-  parser.add_option('--skip-wipe', action='store_true',
-                    help='Do not wipe devices during provisioning.')
-  parser.add_option('--disable-location', action='store_true',
-                    help='Disable location settings.')
-  parser.add_option(
-      '--logcat-dump-output',
-      help='The logcat dump output will be "tee"-ed into this file')
-  # During processing perf bisects, a seperate working directory created under
-  # which builds are produced. Therefore we should look for relevent output
-  # file under this directory.(/b/build/slave/<slave_name>/build/bisect/src/out)
-  parser.add_option(
-      '--chrome-output-dir',
-      help='Chrome output directory to be used while bisecting.')
-
-  parser.add_option('--disable-stack-tool', action='store_true',
-      help='Do not run stack tool.')
-  parser.add_option('--asan-symbolize', action='store_true',
-      help='Run stack tool for ASAN')
-  parser.add_option('--cleanup', action='store_true',
-      help='Delete out/<target> directory at the end of the run.')
-  return parser
-
-
-def main(argv):
-  parser = GetDeviceStepsOptParser()
-  options, args = parser.parse_args(argv[1:])
-
-  if args:
-    return sys.exit('Unused args %s' % args)
-
-  unknown_tests = set(options.test_filter) - VALID_TESTS
-  if unknown_tests:
-    return sys.exit('Unknown tests %s' % list(unknown_tests))
-
-  setattr(options, 'target', options.factory_properties.get('target', 'Debug'))
-
-  if options.chrome_output_dir:
-    global CHROME_OUT_DIR
-    global LOGCAT_DIR
-    CHROME_OUT_DIR = options.chrome_output_dir
-    LOGCAT_DIR = os.path.join(CHROME_OUT_DIR, 'logcat')
-
-  if options.coverage_bucket:
-    setattr(options, 'coverage_dir',
-            os.path.join(CHROME_OUT_DIR, options.target, 'coverage'))
-
-  MainTestWrapper(options)
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv))
diff --git a/build/android/buildbot/bb_host_steps.py b/build/android/buildbot/bb_host_steps.py
deleted file mode 100755
index 1e927fb..0000000
--- a/build/android/buildbot/bb_host_steps.py
+++ /dev/null
@@ -1,133 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import os
-import json
-import sys
-
-import bb_utils
-import bb_annotations
-
-sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
-from pylib import constants
-
-
-SLAVE_SCRIPTS_DIR = os.path.join(bb_utils.BB_BUILD_DIR, 'scripts', 'slave')
-VALID_HOST_TESTS = set(['check_webview_licenses'])
-
-DIR_BUILD_ROOT = os.path.dirname(constants.DIR_SOURCE_ROOT)
-
-# Short hand for RunCmd which is used extensively in this file.
-RunCmd = bb_utils.RunCmd
-
-
-def SrcPath(*path):
-  return os.path.join(constants.DIR_SOURCE_ROOT, *path)
-
-
-def CheckWebViewLicenses(_):
-  bb_annotations.PrintNamedStep('check_licenses')
-  RunCmd([SrcPath('android_webview', 'tools', 'webview_licenses.py'), 'scan'],
-         warning_code=1)
-
-
-def RunHooks(build_type):
-  RunCmd([SrcPath('build', 'landmines.py')])
-  build_path = SrcPath('out', build_type)
-  landmine_path = os.path.join(build_path, '.landmines_triggered')
-  clobber_env = os.environ.get('BUILDBOT_CLOBBER')
-  if clobber_env or os.path.isfile(landmine_path):
-    bb_annotations.PrintNamedStep('Clobber')
-    if not clobber_env:
-      print 'Clobbering due to triggered landmines:'
-      with open(landmine_path) as f:
-        print f.read()
-    RunCmd(['rm', '-rf', build_path])
-
-  bb_annotations.PrintNamedStep('runhooks')
-  RunCmd(['gclient', 'runhooks'], halt_on_failure=True)
-
-
-def Compile(options):
-  RunHooks(options.target)
-  cmd = [os.path.join(SLAVE_SCRIPTS_DIR, 'compile.py'),
-         '--build-tool=ninja',
-         '--compiler=goma',
-         '--target=%s' % options.target,
-         '--goma-dir=%s' % bb_utils.GOMA_DIR]
-  bb_annotations.PrintNamedStep('compile')
-  if options.build_targets:
-    build_targets = options.build_targets.split(',')
-    cmd += ['--build-args', ' '.join(build_targets)]
-  RunCmd(cmd, halt_on_failure=True, cwd=DIR_BUILD_ROOT)
-
-
-def ZipBuild(options):
-  bb_annotations.PrintNamedStep('zip_build')
-  RunCmd([
-      os.path.join(SLAVE_SCRIPTS_DIR, 'zip_build.py'),
-      '--src-dir', constants.DIR_SOURCE_ROOT,
-      '--exclude-files', 'lib.target,gen,android_webview,jingle_unittests']
-      + bb_utils.EncodeProperties(options), cwd=DIR_BUILD_ROOT)
-
-
-def ExtractBuild(options):
-  bb_annotations.PrintNamedStep('extract_build')
-  RunCmd([os.path.join(SLAVE_SCRIPTS_DIR, 'extract_build.py')]
-         + bb_utils.EncodeProperties(options), cwd=DIR_BUILD_ROOT)
-
-
-def BisectPerfRegression(options):
-  args = []
-  if options.extra_src:
-    args = ['--extra_src', options.extra_src]
-  RunCmd([SrcPath('tools', 'prepare-bisect-perf-regression.py'),
-          '-w', os.path.join(constants.DIR_SOURCE_ROOT, os.pardir)])
-  RunCmd([SrcPath('tools', 'run-bisect-perf-regression.py'),
-          '-w', os.path.join(constants.DIR_SOURCE_ROOT, os.pardir),
-          '--build-properties=%s' % json.dumps(options.build_properties)] +
-          args)
-
-
-def GetHostStepCmds():
-  return [
-      ('compile', Compile),
-      ('extract_build', ExtractBuild),
-      ('check_webview_licenses', CheckWebViewLicenses),
-      ('bisect_perf_regression', BisectPerfRegression),
-      ('zip_build', ZipBuild)
-  ]
-
-
-def GetHostStepsOptParser():
-  parser = bb_utils.GetParser()
-  parser.add_option('--steps', help='Comma separated list of host tests.')
-  parser.add_option('--build-targets', default='',
-                    help='Comma separated list of build targets.')
-  parser.add_option('--experimental', action='store_true',
-                    help='Indicate whether to compile experimental targets.')
-  parser.add_option('--extra_src', default='',
-                    help='Path to extra source file. If this is supplied, '
-                    'bisect script will use it to override default behavior.')
-
-  return parser
-
-
-def main(argv):
-  parser = GetHostStepsOptParser()
-  options, args = parser.parse_args(argv[1:])
-  if args:
-    return sys.exit('Unused args %s' % args)
-
-  setattr(options, 'target', options.factory_properties.get('target', 'Debug'))
-  setattr(options, 'extra_src',
-          options.factory_properties.get('extra_src', ''))
-
-  if options.steps:
-    bb_utils.RunSteps(options.steps.split(','), GetHostStepCmds(), options)
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv))
diff --git a/build/android/buildbot/bb_run_bot.py b/build/android/buildbot/bb_run_bot.py
deleted file mode 100755
index 0c8a977..0000000
--- a/build/android/buildbot/bb_run_bot.py
+++ /dev/null
@@ -1,320 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import collections
-import copy
-import json
-import os
-import pipes
-import re
-import subprocess
-import sys
-
-import bb_utils
-
-sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
-from pylib import constants
-
-
-CHROMIUM_COVERAGE_BUCKET = 'chromium-code-coverage'
-
-_BotConfig = collections.namedtuple(
-    'BotConfig', ['bot_id', 'host_obj', 'test_obj'])
-
-HostConfig = collections.namedtuple(
-    'HostConfig',
-    ['script', 'host_steps', 'extra_args', 'extra_gyp_defines', 'target_arch'])
-
-TestConfig = collections.namedtuple('Tests', ['script', 'tests', 'extra_args'])
-
-
-def BotConfig(bot_id, host_object, test_object=None):
-  return _BotConfig(bot_id, host_object, test_object)
-
-
-def DictDiff(d1, d2):
-  diff = []
-  for key in sorted(set(d1.keys() + d2.keys())):
-    if key in d1 and d1[key] != d2.get(key):
-      diff.append('- %s=%s' % (key, pipes.quote(d1[key])))
-    if key in d2 and d2[key] != d1.get(key):
-      diff.append('+ %s=%s' % (key, pipes.quote(d2[key])))
-  return '\n'.join(diff)
-
-
-def GetEnvironment(host_obj, testing, extra_env_vars=None):
-  init_env = dict(os.environ)
-  init_env['GYP_GENERATORS'] = 'ninja'
-  if extra_env_vars:
-    init_env.update(extra_env_vars)
-  envsetup_cmd = '. build/android/envsetup.sh'
-  if testing:
-    # Skip envsetup to avoid presubmit dependence on android deps.
-    print 'Testing mode - skipping "%s"' % envsetup_cmd
-    envsetup_cmd = ':'
-  else:
-    print 'Running %s' % envsetup_cmd
-  proc = subprocess.Popen(['bash', '-exc',
-    envsetup_cmd + ' >&2; python build/android/buildbot/env_to_json.py'],
-    stdout=subprocess.PIPE, stderr=subprocess.PIPE,
-    cwd=bb_utils.CHROME_SRC, env=init_env)
-  json_env, envsetup_output = proc.communicate()
-  if proc.returncode != 0:
-    print >> sys.stderr, 'FATAL Failure in envsetup.'
-    print >> sys.stderr, envsetup_output
-    sys.exit(1)
-  env = json.loads(json_env)
-  env['GYP_DEFINES'] = env.get('GYP_DEFINES', '') + \
-      ' OS=android fastbuild=1 use_goma=1 gomadir=%s' % bb_utils.GOMA_DIR
-  if host_obj.target_arch:
-    env['GYP_DEFINES'] += ' target_arch=%s' % host_obj.target_arch
-  extra_gyp = host_obj.extra_gyp_defines
-  if extra_gyp:
-    env['GYP_DEFINES'] += ' %s' % extra_gyp
-    if re.search('(asan|clang)=1', extra_gyp):
-      env.pop('CXX_target', None)
-
-  # Bots checkout chrome in /b/build/slave/<name>/build/src
-  build_internal_android = os.path.abspath(os.path.join(
-      bb_utils.CHROME_SRC, '..', '..', '..', '..', '..', 'build_internal',
-      'scripts', 'slave', 'android'))
-  if os.path.exists(build_internal_android):
-    env['PATH'] = os.pathsep.join([build_internal_android, env['PATH']])
-  return env
-
-
-def GetCommands(options, bot_config):
-  """Get a formatted list of commands.
-
-  Args:
-    options: Options object.
-    bot_config: A BotConfig named tuple.
-    host_step_script: Host step script.
-    device_step_script: Device step script.
-  Returns:
-    list of Command objects.
-  """
-  property_args = bb_utils.EncodeProperties(options)
-  commands = [[bot_config.host_obj.script,
-               '--steps=%s' % ','.join(bot_config.host_obj.host_steps)] +
-              property_args + (bot_config.host_obj.extra_args or [])]
-
-  test_obj = bot_config.test_obj
-  if test_obj:
-    run_test_cmd = [test_obj.script] + property_args
-    for test in test_obj.tests:
-      run_test_cmd.extend(['-f', test])
-    if test_obj.extra_args:
-      run_test_cmd.extend(test_obj.extra_args)
-    commands.append(run_test_cmd)
-  return commands
-
-
-def GetBotStepMap():
-  compile_step = ['compile']
-  chrome_proxy_tests = ['chrome_proxy']
-  python_unittests = ['python_unittests']
-  std_host_tests = ['check_webview_licenses']
-  std_build_steps = ['compile', 'zip_build']
-  std_test_steps = ['extract_build']
-  std_tests = ['ui', 'unit']
-  telemetry_tests = ['telemetry_perf_unittests']
-  telemetry_tests_user_build = ['telemetry_unittests',
-                                'telemetry_perf_unittests']
-  trial_tests = [
-      'base_junit_tests',
-      'components_browsertests',
-      'gfx_unittests',
-      'gl_unittests',
-  ]
-  flakiness_server = (
-      '--flakiness-server=%s' % constants.UPSTREAM_FLAKINESS_SERVER)
-  experimental = ['--experimental']
-  bisect_chrome_output_dir = os.path.abspath(
-      os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir,
-                   os.pardir, 'bisect', 'src', 'out'))
-  B = BotConfig
-  H = (lambda steps, extra_args=None, extra_gyp=None, target_arch=None:
-       HostConfig('build/android/buildbot/bb_host_steps.py', steps, extra_args,
-                  extra_gyp, target_arch))
-  T = (lambda tests, extra_args=None:
-       TestConfig('build/android/buildbot/bb_device_steps.py', tests,
-                  extra_args))
-
-  bot_configs = [
-      # Main builders
-      B('main-builder-dbg', H(std_build_steps + std_host_tests)),
-      B('main-builder-rel', H(std_build_steps)),
-      B('main-clang-builder',
-        H(compile_step, extra_gyp='clang=1 component=shared_library')),
-      B('main-clobber', H(compile_step)),
-      B('main-tests-rel', H(std_test_steps),
-        T(std_tests + telemetry_tests + chrome_proxy_tests,
-          ['--cleanup', flakiness_server])),
-      B('main-tests', H(std_test_steps),
-        T(std_tests, ['--cleanup', flakiness_server])),
-
-      # Other waterfalls
-      B('asan-builder-tests', H(compile_step,
-                                extra_gyp='asan=1 component=shared_library'),
-        T(std_tests, ['--asan', '--asan-symbolize'])),
-      B('blink-try-builder', H(compile_step)),
-      B('chromedriver-fyi-tests-dbg', H(std_test_steps),
-        T(['chromedriver'],
-          ['--install=ChromeShell', '--install=ChromeDriverWebViewShell',
-           '--skip-wipe', '--disable-location', '--cleanup'])),
-      B('fyi-x86-builder-dbg',
-        H(compile_step + std_host_tests, experimental, target_arch='ia32')),
-      B('fyi-builder-dbg',
-        H(std_build_steps + std_host_tests, experimental,
-          extra_gyp='emma_coverage=1')),
-      B('x86-builder-dbg',
-        H(compile_step + std_host_tests, target_arch='ia32')),
-      B('fyi-builder-rel', H(std_build_steps, experimental)),
-      B('fyi-tests', H(std_test_steps),
-        T(std_tests + python_unittests,
-                      ['--experimental', flakiness_server,
-                      '--coverage-bucket', CHROMIUM_COVERAGE_BUCKET,
-                      '--cleanup'])),
-      B('user-build-fyi-tests-dbg', H(std_test_steps),
-        T(sorted(telemetry_tests_user_build + trial_tests))),
-      B('fyi-component-builder-tests-dbg',
-        H(compile_step, extra_gyp='component=shared_library'),
-        T(std_tests, ['--experimental', flakiness_server])),
-      B('gpu-builder-tests-dbg',
-        H(compile_step),
-        T(['gpu'], ['--install=ContentShell'])),
-      # Pass empty T([]) so that logcat monitor and device status check are run.
-      B('perf-bisect-builder-tests-dbg',
-        H(['bisect_perf_regression']),
-        T([], ['--chrome-output-dir', bisect_chrome_output_dir])),
-      B('perf-tests-rel', H(std_test_steps),
-        T([], ['--install=ChromeShell', '--cleanup'])),
-      B('webkit-latest-webkit-tests', H(std_test_steps),
-        T(['webkit_layout', 'webkit'], ['--cleanup', '--auto-reconnect'])),
-      B('webkit-latest-contentshell', H(compile_step),
-        T(['webkit_layout'], ['--auto-reconnect'])),
-      B('builder-unit-tests', H(compile_step), T(['unit'])),
-
-      # Generic builder config (for substring match).
-      B('builder', H(std_build_steps)),
-  ]
-
-  bot_map = dict((config.bot_id, config) for config in bot_configs)
-
-  # These bots have identical configuration to ones defined earlier.
-  copy_map = [
-      ('lkgr-clobber', 'main-clobber'),
-      ('try-builder-dbg', 'main-builder-dbg'),
-      ('try-builder-rel', 'main-builder-rel'),
-      ('try-clang-builder', 'main-clang-builder'),
-      ('try-fyi-builder-dbg', 'fyi-builder-dbg'),
-      ('try-x86-builder-dbg', 'x86-builder-dbg'),
-      ('try-tests-rel', 'main-tests-rel'),
-      ('try-tests', 'main-tests'),
-      ('try-fyi-tests', 'fyi-tests'),
-      ('webkit-latest-tests', 'main-tests'),
-  ]
-  for to_id, from_id in copy_map:
-    assert to_id not in bot_map
-    # pylint: disable=W0212
-    bot_map[to_id] = copy.deepcopy(bot_map[from_id])._replace(bot_id=to_id)
-
-    # Trybots do not upload to flakiness dashboard. They should be otherwise
-    # identical in configuration to their trunk building counterparts.
-    test_obj = bot_map[to_id].test_obj
-    if to_id.startswith('try') and test_obj:
-      extra_args = test_obj.extra_args
-      if extra_args and flakiness_server in extra_args:
-        extra_args.remove(flakiness_server)
-  return bot_map
-
-
-# Return an object from the map, looking first for an exact id match.
-# If this fails, look for an id which is a substring of the specified id.
-# Choose the longest of all substring matches.
-# pylint: disable=W0622
-def GetBestMatch(id_map, id):
-  config = id_map.get(id)
-  if not config:
-    substring_matches = [x for x in id_map.iterkeys() if x in id]
-    if substring_matches:
-      max_id = max(substring_matches, key=len)
-      print 'Using config from id="%s" (substring match).' % max_id
-      config = id_map[max_id]
-  return config
-
-
-def GetRunBotOptParser():
-  parser = bb_utils.GetParser()
-  parser.add_option('--bot-id', help='Specify bot id directly.')
-  parser.add_option('--testing', action='store_true',
-                    help='For testing: print, but do not run commands')
-
-  return parser
-
-
-def GetBotConfig(options, bot_step_map):
-  bot_id = options.bot_id or options.factory_properties.get('android_bot_id')
-  if not bot_id:
-    print (sys.stderr,
-           'A bot id must be specified through option or factory_props.')
-    return
-
-  bot_config = GetBestMatch(bot_step_map, bot_id)
-  if not bot_config:
-    print 'Error: config for id="%s" cannot be inferred.' % bot_id
-  return bot_config
-
-
-def RunBotCommands(options, commands, env):
-  print 'Environment changes:'
-  print DictDiff(dict(os.environ), env)
-
-  for command in commands:
-    print bb_utils.CommandToString(command)
-    sys.stdout.flush()
-    if options.testing:
-      env['BUILDBOT_TESTING'] = '1'
-    return_code = subprocess.call(command, cwd=bb_utils.CHROME_SRC, env=env)
-    if return_code != 0:
-      return return_code
-
-
-def main(argv):
-  proc = subprocess.Popen(
-      ['/bin/hostname', '-f'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-  hostname_stdout, hostname_stderr = proc.communicate()
-  if proc.returncode == 0:
-    print 'Running on: ' + hostname_stdout
-  else:
-    print >> sys.stderr, 'WARNING: failed to run hostname'
-    print >> sys.stderr, hostname_stdout
-    print >> sys.stderr, hostname_stderr
-    sys.exit(1)
-
-  parser = GetRunBotOptParser()
-  options, args = parser.parse_args(argv[1:])
-  if args:
-    parser.error('Unused args: %s' % args)
-
-  bot_config = GetBotConfig(options, GetBotStepMap())
-  if not bot_config:
-    sys.exit(1)
-
-  print 'Using config:', bot_config
-
-  commands = GetCommands(options, bot_config)
-  for command in commands:
-    print 'Will run: ', bb_utils.CommandToString(command)
-  print
-
-  env = GetEnvironment(bot_config.host_obj, options.testing)
-  return RunBotCommands(options, commands, env)
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv))
diff --git a/build/android/buildbot/bb_utils.py b/build/android/buildbot/bb_utils.py
deleted file mode 100644
index 3c16cc2..0000000
--- a/build/android/buildbot/bb_utils.py
+++ /dev/null
@@ -1,100 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import json
-import optparse
-import os
-import pipes
-import subprocess
-import sys
-
-import bb_annotations
-
-sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
-from pylib import constants
-
-
-TESTING = 'BUILDBOT_TESTING' in os.environ
-
-BB_BUILD_DIR = os.path.abspath(
-    os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir,
-    os.pardir, os.pardir, os.pardir, os.pardir))
-
-CHROME_SRC = os.path.abspath(
-    os.path.join(os.path.dirname(__file__), '..', '..', '..'))
-
-# TODO: Figure out how to merge this with pylib.cmd_helper.OutDirectory().
-CHROME_OUT_DIR = os.path.join(CHROME_SRC, 'out')
-
-GOMA_DIR = os.environ.get('GOMA_DIR', os.path.join(BB_BUILD_DIR, 'goma'))
-
-GSUTIL_PATH = os.path.join(BB_BUILD_DIR, 'third_party', 'gsutil', 'gsutil')
-
-def CommandToString(command):
-  """Returns quoted command that can be run in bash shell."""
-  return ' '.join(map(pipes.quote, command))
-
-
-def SpawnCmd(command, stdout=None, cwd=CHROME_SRC):
-  """Spawn a process without waiting for termination."""
-  print '>', CommandToString(command)
-  sys.stdout.flush()
-  if TESTING:
-    class MockPopen(object):
-      @staticmethod
-      def wait():
-        return 0
-      @staticmethod
-      def communicate():
-        return '', ''
-    return MockPopen()
-  return subprocess.Popen(command, cwd=cwd, stdout=stdout)
-
-
-def RunCmd(command, flunk_on_failure=True, halt_on_failure=False,
-           warning_code=constants.WARNING_EXIT_CODE, stdout=None,
-           cwd=CHROME_SRC):
-  """Run a command relative to the chrome source root."""
-  code = SpawnCmd(command, stdout, cwd).wait()
-  print '<', CommandToString(command)
-  if code != 0:
-    print 'ERROR: process exited with code %d' % code
-    if code != warning_code and flunk_on_failure:
-      bb_annotations.PrintError()
-    else:
-      bb_annotations.PrintWarning()
-    # Allow steps to have both halting (i.e. 1) and non-halting exit codes.
-    if code != warning_code and halt_on_failure:
-      print 'FATAL %d != %d' % (code, warning_code)
-      sys.exit(1)
-  return code
-
-
-def GetParser():
-  def ConvertJson(option, _, value, parser):
-    setattr(parser.values, option.dest, json.loads(value))
-  parser = optparse.OptionParser()
-  parser.add_option('--build-properties', action='callback',
-                    callback=ConvertJson, type='string', default={},
-                    help='build properties in JSON format')
-  parser.add_option('--factory-properties', action='callback',
-                    callback=ConvertJson, type='string', default={},
-                    help='factory properties in JSON format')
-  return parser
-
-
-def EncodeProperties(options):
-  return ['--factory-properties=%s' % json.dumps(options.factory_properties),
-          '--build-properties=%s' % json.dumps(options.build_properties)]
-
-
-def RunSteps(steps, step_cmds, options):
-  unknown_steps = set(steps) - set(step for step, _ in step_cmds)
-  if unknown_steps:
-    print >> sys.stderr, 'FATAL: Unknown steps %s' % list(unknown_steps)
-    sys.exit(1)
-
-  for step, cmd in step_cmds:
-    if step in steps:
-      cmd(options)
diff --git a/build/android/buildbot/env_to_json.py b/build/android/buildbot/env_to_json.py
deleted file mode 100755
index f9a7a44..0000000
--- a/build/android/buildbot/env_to_json.py
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/python
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Encode current environment into json.
-
-import json
-import os
-
-print json.dumps(dict(os.environ))
diff --git a/build/android/buildbot/tests/bb_run_bot_test.py b/build/android/buildbot/tests/bb_run_bot_test.py
deleted file mode 100755
index 810c60d..0000000
--- a/build/android/buildbot/tests/bb_run_bot_test.py
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import os
-import subprocess
-import sys
-
-BUILDBOT_DIR = os.path.join(os.path.dirname(__file__), '..')
-sys.path.append(BUILDBOT_DIR)
-import bb_run_bot
-
-def RunBotProcesses(bot_process_map):
-  code = 0
-  for bot, proc in bot_process_map:
-    _, err = proc.communicate()
-    code |= proc.returncode
-    if proc.returncode != 0:
-      print 'Error running the bot script with id="%s"' % bot, err
-
-  return code
-
-
-def main():
-  procs = [
-      (bot, subprocess.Popen(
-          [os.path.join(BUILDBOT_DIR, 'bb_run_bot.py'), '--bot-id', bot,
-          '--testing'], stdout=subprocess.PIPE, stderr=subprocess.PIPE))
-      for bot in bb_run_bot.GetBotStepMap()]
-  return RunBotProcesses(procs)
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/android/chrome_with_libs.gyp b/build/android/chrome_with_libs.gyp
deleted file mode 100644
index 690be88..0000000
--- a/build/android/chrome_with_libs.gyp
+++ /dev/null
@@ -1,82 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to add more loadable libs into Chrome_apk.
-#
-# This is useful when building Chrome_apk with some loadable modules which are
-# not included in Chrome_apk.
-# As an example, when building Chrome_apk with
-# libpeer_target_type=loadable_module,
-# the libpeerconnection.so is not included in Chrome_apk. To add the missing
-# lib, follow the steps below:
-# - Run gyp:
-#     GYP_DEFINES="$GYP_DEFINES libpeer_target_type=loadable_module" CHROMIUM_GYP_FILE="build/android/chrome_with_libs.gyp" build/gyp_chromium
-# - Build chrome_with_libs:
-#     ninja (or make) chrome_with_libs
-#
-# This tool also allows replacing the loadable module with a new one via the
-# following steps:
-# - Build Chrome_apk with the gyp define:
-#     GYP_DEFINES="$GYP_DEFINES libpeer_target_type=loadable_module" build/gyp_chromium
-#     ninja (or make) Chrome_apk
-# - Replace libpeerconnection.so with a new one:
-#     cp the_new_one path/to/libpeerconnection.so
-# - Run gyp:
-#     GYP_DEFINES="$GYP_DEFINES libpeer_target_type=loadable_module" CHROMIUM_GYP_FILE="build/android/chrome_with_libs.gyp" build/gyp_chromium
-# - Build chrome_with_libs:
-#     ninja (or make) chrome_with_libs
-{
-  'targets': [
-    {
-      # An "All" target is required for a top-level gyp-file.
-      'target_name': 'All',
-      'type': 'none',
-      'dependencies': [
-        'chrome_with_libs',
-      ],
-    },
-    {
-      'target_name': 'chrome_with_libs',
-      'type': 'none',
-      'variables': {
-        'intermediate_dir': '<(PRODUCT_DIR)/prebuilt_libs/',
-        'chrome_unsigned_path': '<(PRODUCT_DIR)/chrome_apk/Chrome-unsigned.apk',
-        'chrome_with_libs_unsigned': '<(intermediate_dir)/Chrome-with-libs-unsigned.apk',
-        'chrome_with_libs_final': '<(PRODUCT_DIR)/apks/Chrome-with-libs.apk',
-      },
-      'dependencies': [
-        '<(DEPTH)/clank/native/framework/clank.gyp:chrome_apk'
-      ],
-      'copies': [
-        {
-          'destination': '<(intermediate_dir)/lib/<(android_app_abi)',
-          'files': [
-            '<(PRODUCT_DIR)/libpeerconnection.so',
-          ],
-        },
-      ],
-      'actions': [
-        {
-          'action_name': 'put_libs_in_chrome',
-          'variables': {
-            'inputs': [
-              '<(intermediate_dir)/lib/<(android_app_abi)/libpeerconnection.so',
-            ],
-            'input_apk_path': '<(chrome_unsigned_path)',
-            'output_apk_path': '<(chrome_with_libs_unsigned)',
-            'libraries_top_dir%': '<(intermediate_dir)',
-          },
-          'includes': [ 'create_standalone_apk_action.gypi' ],
-        },
-        {
-          'action_name': 'finalize_chrome_with_libs',
-          'variables': {
-            'input_apk_path': '<(chrome_with_libs_unsigned)',
-            'output_apk_path': '<(chrome_with_libs_final)',
-          },
-          'includes': [ 'finalize_apk_action.gypi'],
-        },
-      ],
-    }],
-}
diff --git a/build/android/create_standalone_apk_action.gypi b/build/android/create_standalone_apk_action.gypi
deleted file mode 100644
index d17af7c..0000000
--- a/build/android/create_standalone_apk_action.gypi
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into an action to provide an action that
-# combines a directory of shared libraries and an incomplete APK into a
-# standalone APK.
-#
-# To use this, create a gyp action with the following form:
-#  {
-#    'action_name': 'some descriptive action name',
-#    'variables': {
-#      'inputs': [ 'input_path1', 'input_path2' ],
-#      'input_apk_path': '<(unsigned_apk_path)',
-#      'output_apk_path': '<(unsigned_standalone_apk_path)',
-#      'libraries_top_dir': '<(libraries_top_dir)',
-#    },
-#    'includes': [ 'relative/path/to/create_standalone_apk_action.gypi' ],
-#  },
-
-{
-  'message': 'Creating standalone APK: <(output_apk_path)',
-  'variables': {
-    'inputs': [],
-  },
-  'inputs': [
-    '<(DEPTH)/build/android/gyp/util/build_utils.py',
-    '<(DEPTH)/build/android/gyp/create_standalone_apk.py',
-    '<(input_apk_path)',
-    '>@(inputs)',
-  ],
-  'outputs': [
-    '<(output_apk_path)',
-  ],
-  'action': [
-    'python', '<(DEPTH)/build/android/gyp/create_standalone_apk.py',
-    '--libraries-top-dir=<(libraries_top_dir)',
-    '--input-apk-path=<(input_apk_path)',
-    '--output-apk-path=<(output_apk_path)',
-  ],
-}
diff --git a/build/android/developer_recommended_flags.gypi b/build/android/developer_recommended_flags.gypi
deleted file mode 100644
index 79c201de..0000000
--- a/build/android/developer_recommended_flags.gypi
+++ /dev/null
@@ -1,61 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This is the set of recommended gyp variable settings for Chrome for Android development.
-#
-# These can be used by copying this file to $CHROME_SRC/chrome/supplement.gypi.
-#
-# Even better, create chrome/supplement.gypi containing the following:
-#   {
-#     'includes': [ '../build/android/developer_recommended_flags.gypi' ]
-#   }
-# and you'll get new settings automatically.
-# When using this method, you can override individual settings by setting them unconditionally (with
-# no %) in chrome/supplement.gypi.
-# I.e. to disable gyp_managed_install but use everything else:
-#   {
-#     'variables': {
-#       'gyp_managed_install': 0,
-#     },
-#     'includes': [ '../build/android/developer_recommended_flags.gypi' ]
-#   }
-
-{
-  'variables': {
-    'variables': {
-      # Set component to 'shared_library' to enable the component build. This builds native code as
-      # many small shared libraries instead of one monolithic library. This slightly reduces the time
-      # required for incremental builds.
-      'component%': 'shared_library',
-    },
-    'component%': '<(component)',
-
-    # When gyp_managed_install is set to 1, building an APK will install that APK on the connected
-    # device(/emulator). To install on multiple devices (or onto a new device), build the APK once
-    # with each device attached. This greatly reduces the time required for incremental builds.
-    #
-    # This comes with some caveats:
-    #   Only works with a single device connected (it will print a warning if
-    #     zero or multiple devices are attached).
-    #   Device must be flashed with a user-debug unsigned Android build.
-    #   Some actions are always run (i.e. ninja will never say "no work to do").
-    'gyp_managed_install%': 1,
-
-    # With gyp_managed_install, we do not necessarily need a standalone APK.
-    # When create_standalone_apk is set to 1, we will build a standalone APK
-    # anyway. For even faster builds, you can set create_standalone_apk to 0.
-    'create_standalone_apk%': 1,
-
-    # Set clang to 1 to use the clang compiler. Clang has much (much, much) better warning/error
-    # messages than gcc.
-    # TODO(cjhopman): Enable this when http://crbug.com/156420 is addressed. Until then, users can
-    # set clang to 1, but Android stack traces will sometimes be incomplete.
-    #'clang%': 1,
-
-    # Set fastbuild to 1 to build with less debugging information. This can greatly decrease linking
-    # time. The downside is that stack traces will be missing useful information (like line
-    # numbers).
-    #'fastbuild%': 1,
-  },
-}
diff --git a/build/android/dex_action.gypi b/build/android/dex_action.gypi
deleted file mode 100644
index 56d386f..0000000
--- a/build/android/dex_action.gypi
+++ /dev/null
@@ -1,60 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into an action to provide a rule that dexes
-# compiled java files. If proguard_enabled == "true" and CONFIGURATION_NAME ==
-# "Release", then it will dex the proguard_enabled_input_path instead of the
-# normal dex_input_paths/dex_generated_input_paths.
-#
-# To use this, create a gyp target with the following form:
-#  {
-#    'action_name': 'some name for the action'
-#    'actions': [
-#      'variables': {
-#        'dex_input_paths': [ 'files to dex (when proguard is not used) and add to input paths' ],
-#        'dex_generated_input_dirs': [ 'dirs that contain generated files to dex' ],
-#
-#        # For targets that use proguard:
-#        'proguard_enabled': 'true',
-#        'proguard_enabled_input_path': 'path to dex when using proguard',
-#      },
-#      'includes': [ 'relative/path/to/dex_action.gypi' ],
-#    ],
-#  },
-#
-
-{
-  'message': 'Creating dex file: <(output_path)',
-  'variables': {
-    'dex_input_paths': [],
-    'dex_generated_input_dirs': [],
-    'proguard_enabled%': 'false',
-    'proguard_enabled_input_path%': '',
-    'dex_no_locals%': 0,
-    'dex_additional_options': [],
-  },
-  'inputs': [
-    '<(DEPTH)/build/android/gyp/util/build_utils.py',
-    '<(DEPTH)/build/android/gyp/util/md5_check.py',
-    '<(DEPTH)/build/android/gyp/dex.py',
-    '>@(dex_input_paths)',
-  ],
-  'outputs': [
-    '<(output_path)',
-    '<(output_path).inputs',
-  ],
-  'action': [
-    'python', '<(DEPTH)/build/android/gyp/dex.py',
-    '--dex-path=<(output_path)',
-    '--android-sdk-tools=<(android_sdk_tools)',
-    '--output-directory=<(PRODUCT_DIR)',
-    '--configuration-name=<(CONFIGURATION_NAME)',
-    '--proguard-enabled=>(proguard_enabled)',
-    '--proguard-enabled-input-path=<(proguard_enabled_input_path)',
-    '--no-locals=>(dex_no_locals)',
-    '>@(dex_additional_options)',
-    '>@(dex_input_paths)',
-    '>@(dex_generated_input_dirs)',
-  ]
-}
diff --git a/build/android/disable_lto.gypi b/build/android/disable_lto.gypi
deleted file mode 100644
index e379cfd..0000000
--- a/build/android/disable_lto.gypi
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (c) 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included to disable LTO on a target.
-
-{
-  'target_conditions': [
-    ['_toolset=="target"', {
-      'conditions': [
-        ['OS=="android" and (use_lto==1 or use_lto_o2==1)', {
-          'cflags!': [
-            '-flto',
-            '-ffat-lto-objects',
-          ],
-        }],
-      ],
-    }],
-  ],
-}
diff --git a/build/android/empty/src/.keep b/build/android/empty/src/.keep
deleted file mode 100644
index 0f710b6..0000000
--- a/build/android/empty/src/.keep
+++ /dev/null
@@ -1,6 +0,0 @@
-This is a file that needs to live here until http://crbug.com/158155 has
-been fixed.
-
-The ant build system requires that a src folder is always present, and for
-some of our targets that is not the case. Giving it an empty src-folder works
-nicely though.
diff --git a/build/android/empty_proguard.flags b/build/android/empty_proguard.flags
deleted file mode 100644
index 53484fe..0000000
--- a/build/android/empty_proguard.flags
+++ /dev/null
@@ -1 +0,0 @@
-# Used for apk targets that do not need proguard. See build/java_apk.gypi.
diff --git a/build/android/enable_asserts.py b/build/android/enable_asserts.py
deleted file mode 100755
index 8fb7dca..0000000
--- a/build/android/enable_asserts.py
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Enables dalvik vm asserts in the android device."""
-
-import argparse
-import sys
-
-from pylib.device import device_utils
-
-
-def main():
-  parser = argparse.ArgumentParser()
-
-  set_asserts_group = parser.add_mutually_exclusive_group(required=True)
-  set_asserts_group.add_argument(
-      '--enable_asserts', dest='set_asserts', action='store_true',
-      help='Sets the dalvik.vm.enableassertions property to "all"')
-  set_asserts_group.add_argument(
-      '--disable_asserts', dest='set_asserts', action='store_false',
-      help='Removes the dalvik.vm.enableassertions property')
-
-  args = parser.parse_args()
-
-  # TODO(jbudorick): Accept optional serial number and run only for the
-  # specified device when present.
-  devices = device_utils.DeviceUtils.parallel()
-
-  def set_java_asserts_and_restart(device):
-    if device.SetJavaAsserts(args.set_asserts):
-      device.RunShellCommand('stop')
-      device.RunShellCommand('start')
-
-  devices.pMap(set_java_asserts_and_restart)
-  return 0
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/android/envsetup.sh b/build/android/envsetup.sh
deleted file mode 100755
index 0545330..0000000
--- a/build/android/envsetup.sh
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Sets up environment for building Chromium on Android.
-
-# Make sure we're being sourced (possibly by another script). Check for bash
-# since zsh sets $0 when sourcing.
-if [[ -n "$BASH_VERSION" && "${BASH_SOURCE:-$0}" == "$0" ]]; then
-  echo "ERROR: envsetup must be sourced."
-  exit 1
-fi
-
-# This only exists to set local variables. Don't call this manually.
-android_envsetup_main() {
-  local SCRIPT_PATH="$1"
-  local SCRIPT_DIR="$(dirname "$SCRIPT_PATH")"
-
-  local CURRENT_DIR="$(readlink -f "${SCRIPT_DIR}/../../")"
-  if [[ -z "${CHROME_SRC}" ]]; then
-    # If $CHROME_SRC was not set, assume current directory is CHROME_SRC.
-    local CHROME_SRC="${CURRENT_DIR}"
-  fi
-
-  if [[ "${CURRENT_DIR/"${CHROME_SRC}"/}" == "${CURRENT_DIR}" ]]; then
-    # If current directory is not in $CHROME_SRC, it might be set for other
-    # source tree. If $CHROME_SRC was set correctly and we are in the correct
-    # directory, "${CURRENT_DIR/"${CHROME_SRC}"/}" will be "".
-    # Otherwise, it will equal to "${CURRENT_DIR}"
-    echo "Warning: Current directory is out of CHROME_SRC, it may not be \
-  the one you want."
-    echo "${CHROME_SRC}"
-  fi
-
-  # Allow the caller to override a few environment variables. If any of them is
-  # unset, we default to a sane value that's known to work. This allows for
-  # experimentation with a custom SDK.
-  if [[ -z "${ANDROID_SDK_ROOT}" || ! -d "${ANDROID_SDK_ROOT}" ]]; then
-    local ANDROID_SDK_ROOT="${CHROME_SRC}/third_party/android_tools/sdk/"
-  fi
-
-  # Add Android SDK tools to system path.
-  export PATH=$PATH:${ANDROID_SDK_ROOT}/platform-tools
-
-  # Add Android utility tools to the system path.
-  export PATH=$PATH:${ANDROID_SDK_ROOT}/tools/
-
-  # Add Chromium Android development scripts to system path.
-  # Must be after CHROME_SRC is set.
-  export PATH=$PATH:${CHROME_SRC}/build/android
-
-  export ENVSETUP_GYP_CHROME_SRC=${CHROME_SRC}  # TODO(thakis): Remove.
-}
-# In zsh, $0 is the name of the file being sourced.
-android_envsetup_main "${BASH_SOURCE:-$0}"
-unset -f android_envsetup_main
-
-android_gyp() {
-  echo "Please call build/gyp_chromium instead. android_gyp is going away."
-  "${ENVSETUP_GYP_CHROME_SRC}/build/gyp_chromium" --depth="${ENVSETUP_GYP_CHROME_SRC}" --check "$@"
-}
diff --git a/build/android/finalize_apk_action.gypi b/build/android/finalize_apk_action.gypi
deleted file mode 100644
index 644f9e8..0000000
--- a/build/android/finalize_apk_action.gypi
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into an action to provide an action that
-# signs and zipaligns an APK.
-#
-# To use this, create a gyp action with the following form:
-#  {
-#    'action_name': 'some descriptive action name',
-#    'variables': {
-#      'input_apk_path': 'relative/path/to/input.apk',
-#      'output_apk_path': 'relative/path/to/output.apk',
-#    },
-#    'includes': [ '../../build/android/finalize_apk_action.gypi' ],
-#  },
-#
-
-{
-  'message': 'Signing/aligning <(_target_name) APK: <(input_apk_path)',
-  'variables': {
-    'keystore_path%': '<(DEPTH)/build/android/ant/chromium-debug.keystore',
-    'keystore_name%': 'chromiumdebugkey',
-    'keystore_password%': 'chromium',
-    'zipalign_path%': '<(android_sdk_tools)/zipalign',
-    'rezip_apk_jar_path%': '<(PRODUCT_DIR)/lib.java/rezip_apk.jar',
-    'load_library_from_zip%': 0,
-  },
-  'inputs': [
-    '<(DEPTH)/build/android/gyp/finalize_apk.py',
-    '<(DEPTH)/build/android/gyp/util/build_utils.py',
-    '<(keystore_path)',
-    '<(input_apk_path)',
-  ],
-  'outputs': [
-    '<(output_apk_path)',
-  ],
-  'action': [
-    'python', '<(DEPTH)/build/android/gyp/finalize_apk.py',
-    '--zipalign-path=<(zipalign_path)',
-    '--unsigned-apk-path=<(input_apk_path)',
-    '--final-apk-path=<(output_apk_path)',
-    '--key-path=<(keystore_path)',
-    '--key-name=<(keystore_name)',
-    '--key-passwd=<(keystore_password)',
-    '--load-library-from-zip=<(load_library_from_zip)',
-    '--rezip-apk-jar-path=<(rezip_apk_jar_path)',
-  ],
-}
diff --git a/build/android/finalize_splits_action.gypi b/build/android/finalize_splits_action.gypi
deleted file mode 100644
index daa7f83..0000000
--- a/build/android/finalize_splits_action.gypi
+++ /dev/null
@@ -1,76 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into an action to provide an action that
-# signs and zipaligns split APKs.
-#
-# Required variables:
-#  apk_name - Base name of the apk.
-# Optional variables:
-#  density_splits - Whether to process density splits
-#  language_splits - Whether to language splits
-
-{
-  'variables': {
-    'keystore_path%': '<(DEPTH)/build/android/ant/chromium-debug.keystore',
-    'keystore_name%': 'chromiumdebugkey',
-    'keystore_password%': 'chromium',
-    'zipalign_path%': '<(android_sdk_tools)/zipalign',
-    'density_splits%': 0,
-    'language_splits%': [],
-    'resource_packaged_apk_name': '<(apk_name)-resources.ap_',
-    'resource_packaged_apk_path': '<(intermediate_dir)/<(resource_packaged_apk_name)',
-    'base_output_path': '<(PRODUCT_DIR)/apks/<(apk_name)',
-  },
-  'inputs': [
-    '<(DEPTH)/build/android/gyp/finalize_splits.py',
-    '<(DEPTH)/build/android/gyp/finalize_apk.py',
-    '<(DEPTH)/build/android/gyp/util/build_utils.py',
-    '<(keystore_path)',
-  ],
-  'action': [
-    'python', '<(DEPTH)/build/android/gyp/finalize_splits.py',
-    '--resource-packaged-apk-path=<(resource_packaged_apk_path)',
-    '--base-output-path=<(base_output_path)',
-    '--zipalign-path=<(zipalign_path)',
-    '--key-path=<(keystore_path)',
-    '--key-name=<(keystore_name)',
-    '--key-passwd=<(keystore_password)',
-  ],
-  'conditions': [
-    ['density_splits == 1', {
-      'message': 'Signing/aligning <(_target_name) density splits',
-      'inputs': [
-        '<(resource_packaged_apk_path)_hdpi',
-        '<(resource_packaged_apk_path)_xhdpi',
-        '<(resource_packaged_apk_path)_xxhdpi',
-        '<(resource_packaged_apk_path)_xxxhdpi',
-        '<(resource_packaged_apk_path)_tvdpi',
-      ],
-      'outputs': [
-        '<(base_output_path)-density-hdpi.apk',
-        '<(base_output_path)-density-xhdpi.apk',
-        '<(base_output_path)-density-xxhdpi.apk',
-        '<(base_output_path)-density-xxxhdpi.apk',
-        '<(base_output_path)-density-tvdpi.apk',
-      ],
-      'action': [
-        '--densities=hdpi,xhdpi,xxhdpi,xxxhdpi,tvdpi',
-      ],
-    }],
-    ['language_splits != []', {
-      'message': 'Signing/aligning <(_target_name) language splits',
-      'inputs': [
-        "<!@(python <(DEPTH)/build/apply_locales.py '<(resource_packaged_apk_path)_ZZLOCALE' <(language_splits))",
-      ],
-      'outputs': [
-        "<!@(python <(DEPTH)/build/apply_locales.py '<(base_output_path)-lang-ZZLOCALE.apk' <(language_splits))",
-      ],
-      'action': [
-        '--languages=<(language_splits)',
-      ],
-    }],
-  ],
-}
-
diff --git a/build/android/findbugs_action.gypi b/build/android/findbugs_action.gypi
deleted file mode 100644
index e3b3d36..0000000
--- a/build/android/findbugs_action.gypi
+++ /dev/null
@@ -1,22 +0,0 @@
-
-{
-  'action_name': 'findbugs_<(_target_name)',
-  'message': 'Running findbugs on <(_target_name)',
-  'variables': {
-  },
-  'inputs': [
-    '<(DEPTH)/build/android/findbugs_diff.py',
-    '<(DEPTH)/build/android/findbugs_filter/findbugs_exclude.xml',
-    '<(DEPTH)/build/android/pylib/utils/findbugs.py',
-    '<(findbugs_target_jar_path)',
-  ],
-  'outputs': [
-    '<(stamp_path)',
-  ],
-  'action': [
-    'python', '<(DEPTH)/build/android/findbugs_diff.py',
-    '--auxclasspath-gyp', '>(auxclasspath)',
-    '--stamp', '<(stamp_path)',
-    '<(findbugs_target_jar_path)',
-  ],
-}
diff --git a/build/android/findbugs_diff.py b/build/android/findbugs_diff.py
deleted file mode 100755
index f55e462..0000000
--- a/build/android/findbugs_diff.py
+++ /dev/null
@@ -1,110 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Runs findbugs, and returns an error code if there are new warnings.
-
-Other options
-  --only-analyze used to only analyze the class you are interested.
-  --relase-build analyze the classes in out/Release directory.
-  --findbugs-args used to passin other findbugs's options.
-
-Run
-  $CHROMIUM_SRC/third_party/findbugs/bin/findbugs -textui for details.
-
-"""
-
-import argparse
-import os
-import sys
-
-from pylib import constants
-from pylib.utils import findbugs
-
-_DEFAULT_BASE_DIR = os.path.join(
-    constants.DIR_SOURCE_ROOT, 'build', 'android', 'findbugs_filter')
-
-sys.path.append(
-    os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'android', 'gyp'))
-from util import build_utils
-
-
-def main():
-  parser = argparse.ArgumentParser()
-
-  parser.add_argument(
-      '-a', '--auxclasspath', default=None, dest='auxclasspath',
-      help='Set aux classpath for analysis.')
-  parser.add_argument(
-      '--auxclasspath-gyp', dest='auxclasspath_gyp',
-      help='A gyp list containing the aux classpath for analysis')
-  parser.add_argument(
-      '-o', '--only-analyze', default=None,
-      dest='only_analyze', help='Only analyze the given classes and packages.')
-  parser.add_argument(
-      '-e', '--exclude', default=None, dest='exclude',
-      help='Exclude bugs matching given filter.')
-  parser.add_argument(
-      '-l', '--release-build', action='store_true', dest='release_build',
-      help='Analyze release build instead of debug.')
-  parser.add_argument(
-      '-f', '--findbug-args', default=None, dest='findbug_args',
-      help='Additional findbug arguments.')
-  parser.add_argument(
-      '-b', '--base-dir', default=_DEFAULT_BASE_DIR,
-      dest='base_dir', help='Base directory for configuration file.')
-  parser.add_argument(
-      '--output-file', dest='output_file',
-      help='Path to save the output to.')
-  parser.add_argument(
-      '--stamp', help='Path to touch on success.')
-  parser.add_argument(
-      '--depfile', help='Path to the depfile. This must be specified as the '
-                        "action's first output.")
-
-  parser.add_argument(
-      'jar_paths', metavar='JAR_PATH', nargs='+',
-      help='JAR file to analyze')
-
-  args = parser.parse_args(build_utils.ExpandFileArgs(sys.argv[1:]))
-  if args.auxclasspath:
-    args.auxclasspath = args.auxclasspath.split(':')
-  elif args.auxclasspath_gyp:
-    args.auxclasspath = build_utils.ParseGypList(args.auxclasspath_gyp)
-
-  if args.base_dir:
-    if not args.exclude:
-      args.exclude = os.path.join(args.base_dir, 'findbugs_exclude.xml')
-
-  findbugs_command, findbugs_warnings = findbugs.Run(
-      args.exclude, args.only_analyze, args.auxclasspath,
-      args.output_file, args.findbug_args, args.jar_paths)
-
-  if findbugs_warnings:
-    print
-    print '*' * 80
-    print 'FindBugs run via:'
-    print findbugs_command
-    print
-    print 'FindBugs reported the following issues:'
-    for warning in sorted(findbugs_warnings):
-      print str(warning)
-    print '*' * 80
-    print
-  else:
-    if args.depfile:
-      build_utils.WriteDepfile(
-          args.depfile,
-          build_utils.GetPythonDependencies() + args.auxclasspath
-              + args.jar_paths)
-    if args.stamp:
-      build_utils.Touch(args.stamp)
-
-  return len(findbugs_warnings)
-
-
-if __name__ == '__main__':
-  sys.exit(main())
-
diff --git a/build/android/findbugs_filter/findbugs_exclude.xml b/build/android/findbugs_filter/findbugs_exclude.xml
deleted file mode 100644
index dbff9d9..0000000
--- a/build/android/findbugs_filter/findbugs_exclude.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Copyright (c) 2012 The Chromium Authors. All rights reserved.
-  Use of this source code is governed by a BSD-style license that can be
-  found in the LICENSE file.
--->
-
-<!--
-Documentation: http://findbugs.sourceforge.net/manual/filter.html
-In particular, ~ at the start of a string means it's a regex.
--->
-<FindBugsFilter>
-  <!-- Skip the generated resource classes (including nested classes). -->
-  <Match>
-    <Class name="~.*\.R(\$\w+)?" />
-  </Match>
-  <Match>
-    <Class name="~org\.chromium\..*\.Manifest(\$\w+)?" />
-  </Match>
-  <Bug pattern="DM_STRING_CTOR" />
-  <!-- Ignore "reliance on default String encoding" warnings, as we're not multi-platform -->
-  <Bug pattern="DM_DEFAULT_ENCODING" />
-</FindBugsFilter>
diff --git a/build/android/generate_emma_html.py b/build/android/generate_emma_html.py
deleted file mode 100755
index 93b0b0e..0000000
--- a/build/android/generate_emma_html.py
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Aggregates EMMA coverage files to produce html output."""
-
-import fnmatch
-import json
-import optparse
-import os
-import sys
-
-from pylib import cmd_helper
-from pylib import constants
-
-
-def _GetFilesWithExt(root_dir, ext):
-  """Gets all files with a given extension.
-
-  Args:
-    root_dir: Directory in which to search for files.
-    ext: Extension to look for (including dot)
-
-  Returns:
-    A list of absolute paths to files that match.
-  """
-  files = []
-  for root, _, filenames in os.walk(root_dir):
-    basenames = fnmatch.filter(filenames, '*.' + ext)
-    files.extend([os.path.join(root, basename)
-                  for basename in basenames])
-
-  return files
-
-
-def main():
-  option_parser = optparse.OptionParser()
-  option_parser.add_option('--output', help='HTML output filename.')
-  option_parser.add_option('--coverage-dir', default=None,
-                           help=('Root of the directory in which to search for '
-                                 'coverage data (.ec) files.'))
-  option_parser.add_option('--metadata-dir', default=None,
-                           help=('Root of the directory in which to search for '
-                                 'coverage metadata (.em) files.'))
-  option_parser.add_option('--cleanup', action='store_true',
-                           help=('If set, removes coverage files generated at '
-                                 'runtime.'))
-  options, _ = option_parser.parse_args()
-
-  if not (options.coverage_dir and options.metadata_dir and options.output):
-    option_parser.error('One or more mandatory options are missing.')
-
-  coverage_files = _GetFilesWithExt(options.coverage_dir, 'ec')
-  metadata_files = _GetFilesWithExt(options.metadata_dir, 'em')
-  print 'Found coverage files: %s' % str(coverage_files)
-  print 'Found metadata files: %s' % str(metadata_files)
-
-  sources = []
-  for f in metadata_files:
-    sources_file = os.path.splitext(f)[0] + '_sources.txt'
-    with open(sources_file, 'r') as sf:
-      sources.extend(json.load(sf))
-  sources = [os.path.join(constants.DIR_SOURCE_ROOT, s) for s in sources]
-  print 'Sources: %s' % sources
-
-  input_args = []
-  for f in coverage_files + metadata_files:
-    input_args.append('-in')
-    input_args.append(f)
-
-  output_args = ['-Dreport.html.out.file', options.output]
-  source_args = ['-sp', ','.join(sources)]
-
-  exit_code = cmd_helper.RunCmd(
-      ['java', '-cp',
-       os.path.join(constants.ANDROID_SDK_ROOT, 'tools', 'lib', 'emma.jar'),
-       'emma', 'report', '-r', 'html']
-      + input_args + output_args + source_args)
-
-  if options.cleanup:
-    for f in coverage_files:
-      os.remove(f)
-
-  return exit_code
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/android/gn/zip.py b/build/android/gn/zip.py
deleted file mode 100755
index 5050ea0..0000000
--- a/build/android/gn/zip.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Archives a set of files.
-"""
-
-import ast
-import optparse
-import os
-import sys
-import zipfile
-
-sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, 'gyp'))
-from util import build_utils
-
-def DoZip(inputs, output, base_dir):
-  with zipfile.ZipFile(output, 'w') as outfile:
-    for f in inputs:
-      outfile.write(f, os.path.relpath(f, base_dir))
-
-def main():
-  parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(parser)
-
-  parser.add_option('--inputs', help='List of files to archive.')
-  parser.add_option('--output', help='Path to output archive.')
-  parser.add_option('--base-dir',
-                    help='If provided, the paths in the archive will be '
-                    'relative to this directory', default='.')
-
-  options, _ = parser.parse_args()
-
-  inputs = ast.literal_eval(options.inputs)
-  output = options.output
-  base_dir = options.base_dir
-
-  DoZip(inputs, output, base_dir)
-
-  if options.depfile:
-    build_utils.WriteDepfile(
-        options.depfile,
-        build_utils.GetPythonDependencies())
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/android/gyp/aidl.py b/build/android/gyp/aidl.py
deleted file mode 100755
index d5aa546..0000000
--- a/build/android/gyp/aidl.py
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Invokes Android's aidl
-"""
-
-import optparse
-import os
-import sys
-
-from util import build_utils
-
-
-def main(argv):
-  option_parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(option_parser)
-  option_parser.add_option('--aidl-path', help='Path to the aidl binary.')
-  option_parser.add_option('--imports', help='Files to import.')
-  option_parser.add_option('--includes',
-                           help='Directories to add as import search paths.')
-  option_parser.add_option('--srcjar', help='Path for srcjar output.')
-  options, args = option_parser.parse_args(argv[1:])
-
-  with build_utils.TempDir() as temp_dir:
-    for f in args:
-      classname = os.path.splitext(os.path.basename(f))[0]
-      output = os.path.join(temp_dir, classname + '.java')
-      aidl_cmd = [options.aidl_path]
-      aidl_cmd += [
-        '-p' + s for s in build_utils.ParseGypList(options.imports)
-      ]
-      if options.includes is not None:
-        aidl_cmd += [
-          '-I' + s for s in build_utils.ParseGypList(options.includes)
-        ]
-      aidl_cmd += [
-        f,
-        output
-      ]
-      build_utils.CheckOutput(aidl_cmd)
-
-    build_utils.ZipDir(options.srcjar, temp_dir)
-
-  if options.depfile:
-    build_utils.WriteDepfile(
-        options.depfile,
-        build_utils.GetPythonDependencies())
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv))
diff --git a/build/android/gyp/ant.py b/build/android/gyp/ant.py
deleted file mode 100755
index 5394b9e..0000000
--- a/build/android/gyp/ant.py
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""An Ant wrapper that suppresses useless Ant output.
-
-Ant build scripts output "BUILD SUCCESSFUL" and build timing at the end of
-every build. In the Android build, this just adds a lot of useless noise to the
-build output. This script forwards its arguments to ant, and prints Ant's
-output up until the BUILD SUCCESSFUL line.
-
-Also, when a command fails, this script will re-run that ant command with the
-'-verbose' argument so that the failure is easier to debug.
-"""
-
-import optparse
-import sys
-import traceback
-
-from util import build_utils
-
-
-def main(argv):
-  option_parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(option_parser)
-  options, args = option_parser.parse_args(argv[1:])
-
-  try:
-    stdout = build_utils.CheckOutput(['ant'] + args)
-  except build_utils.CalledProcessError:
-    # It is very difficult to diagnose ant failures without the '-verbose'
-    # argument. So, when an ant command fails, re-run it with '-verbose' so that
-    # the cause of the failure is easier to identify.
-    verbose_args = ['-verbose'] + [a for a in args if a != '-quiet']
-    try:
-      stdout = build_utils.CheckOutput(['ant'] + verbose_args)
-    except build_utils.CalledProcessError:
-      traceback.print_exc()
-      sys.exit(1)
-
-    # If this did sys.exit(1), building again would succeed (which would be
-    # awkward). Instead, just print a big warning.
-    build_utils.PrintBigWarning(
-        'This is unexpected. `ant ' + ' '.join(args) + '` failed.' +
-        'But, running `ant ' + ' '.join(verbose_args) + '` passed.')
-
-  stdout = stdout.strip().split('\n')
-  for line in stdout:
-    if line.strip() == 'BUILD SUCCESSFUL':
-      break
-    print line
-
-  if options.depfile:
-    assert '-buildfile' in args
-    ant_buildfile = args[args.index('-buildfile') + 1]
-
-    build_utils.WriteDepfile(
-        options.depfile,
-        [ant_buildfile] + build_utils.GetPythonDependencies())
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv))
diff --git a/build/android/gyp/apk_install.py b/build/android/gyp/apk_install.py
deleted file mode 100755
index a512e50..0000000
--- a/build/android/gyp/apk_install.py
+++ /dev/null
@@ -1,118 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Installs an APK.
-
-"""
-
-import optparse
-import os
-import re
-import sys
-
-from util import build_device
-from util import build_utils
-from util import md5_check
-
-BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), '..')
-sys.path.append(BUILD_ANDROID_DIR)
-
-from pylib import constants
-from pylib.utils import apk_helper
-
-
-def GetNewMetadata(device, apk_package):
-  """Gets the metadata on the device for the apk_package apk."""
-  output = device.RunShellCommand('ls -l /data/app/')
-  # Matches lines like:
-  # -rw-r--r-- system   system    7376582 2013-04-19 16:34 \
-  # org.chromium.chrome.shell.apk
-  # -rw-r--r-- system   system    7376582 2013-04-19 16:34 \
-  # org.chromium.chrome.shell-1.apk
-  apk_matcher = lambda s: re.match('.*%s(-[0-9]*)?(.apk)?$' % apk_package, s)
-  matches = filter(apk_matcher, output)
-  return matches[0] if matches else None
-
-def HasInstallMetadataChanged(device, apk_package, metadata_path):
-  """Checks if the metadata on the device for apk_package has changed."""
-  if not os.path.exists(metadata_path):
-    return True
-
-  with open(metadata_path, 'r') as expected_file:
-    return expected_file.read() != device.GetInstallMetadata(apk_package)
-
-
-def RecordInstallMetadata(device, apk_package, metadata_path):
-  """Records the metadata from the device for apk_package."""
-  metadata = GetNewMetadata(device, apk_package)
-  if not metadata:
-    raise Exception('APK install failed unexpectedly.')
-
-  with open(metadata_path, 'w') as outfile:
-    outfile.write(metadata)
-
-
-def main():
-  parser = optparse.OptionParser()
-  parser.add_option('--apk-path',
-      help='Path to .apk to install.')
-  parser.add_option('--split-apk-path',
-      help='Path to .apk splits (can specify multiple times, causes '
-      '--install-multiple to be used.',
-      action='append')
-  parser.add_option('--android-sdk-tools',
-      help='Path to the Android SDK build tools folder. ' +
-           'Required when using --split-apk-path.')
-  parser.add_option('--install-record',
-      help='Path to install record (touched only when APK is installed).')
-  parser.add_option('--build-device-configuration',
-      help='Path to build device configuration.')
-  parser.add_option('--stamp',
-      help='Path to touch on success.')
-  parser.add_option('--configuration-name',
-      help='The build CONFIGURATION_NAME')
-  options, _ = parser.parse_args()
-
-  device = build_device.GetBuildDeviceFromPath(
-      options.build_device_configuration)
-  if not device:
-    return
-
-  constants.SetBuildType(options.configuration_name)
-
-  serial_number = device.GetSerialNumber()
-  apk_package = apk_helper.GetPackageName(options.apk_path)
-
-  metadata_path = '%s.%s.device.time.stamp' % (options.apk_path, serial_number)
-
-  # If the APK on the device does not match the one that was last installed by
-  # the build, then the APK has to be installed (regardless of the md5 record).
-  force_install = HasInstallMetadataChanged(device, apk_package, metadata_path)
-
-
-  def Install():
-    if options.split_apk_path:
-      device.InstallSplitApk(options.apk_path, options.split_apk_path)
-    else:
-      device.Install(options.apk_path, reinstall=True)
-
-    RecordInstallMetadata(device, apk_package, metadata_path)
-    build_utils.Touch(options.install_record)
-
-
-  record_path = '%s.%s.md5.stamp' % (options.apk_path, serial_number)
-  md5_check.CallAndRecordIfStale(
-      Install,
-      record_path=record_path,
-      input_paths=[options.apk_path],
-      force=force_install)
-
-  if options.stamp:
-    build_utils.Touch(options.stamp)
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/android/gyp/apk_obfuscate.py b/build/android/gyp/apk_obfuscate.py
deleted file mode 100755
index b075758..0000000
--- a/build/android/gyp/apk_obfuscate.py
+++ /dev/null
@@ -1,147 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Generates the obfuscated jar and test jar for an apk.
-
-If proguard is not enabled or 'Release' is not in the configuration name,
-obfuscation will be a no-op.
-"""
-
-import optparse
-import os
-import sys
-
-from util import build_utils
-from util import proguard_util
-
-
-def ParseArgs(argv):
-  parser = optparse.OptionParser()
-  parser.add_option('--android-sdk', help='path to the Android SDK folder')
-  parser.add_option('--android-sdk-tools',
-                    help='path to the Android SDK build tools folder')
-  parser.add_option('--android-sdk-jar',
-                    help='path to Android SDK\'s android.jar')
-  parser.add_option('--proguard-jar-path',
-                    help='Path to proguard.jar in the sdk')
-  parser.add_option('--input-jars-paths',
-                    help='Path to jars to include in obfuscated jar')
-
-  parser.add_option('--proguard-configs',
-                    help='Paths to proguard config files')
-
-  parser.add_option('--configuration-name',
-                    help='Gyp configuration name (i.e. Debug, Release)')
-  parser.add_option('--proguard-enabled', action='store_true',
-                    help='Set if proguard is enabled for this target.')
-
-  parser.add_option('--obfuscated-jar-path',
-                    help='Output path for obfuscated jar.')
-
-  parser.add_option('--testapp', action='store_true',
-                    help='Set this if building an instrumentation test apk')
-  parser.add_option('--tested-apk-obfuscated-jar-path',
-                    help='Path to obfusctated jar of the tested apk')
-  parser.add_option('--test-jar-path',
-                    help='Output path for jar containing all the test apk\'s '
-                    'code.')
-
-  parser.add_option('--stamp', help='File to touch on success')
-
-  (options, args) = parser.parse_args(argv)
-
-  if args:
-    parser.error('No positional arguments should be given. ' + str(args))
-
-  # Check that required options have been provided.
-  required_options = (
-      'android_sdk',
-      'android_sdk_tools',
-      'android_sdk_jar',
-      'proguard_jar_path',
-      'input_jars_paths',
-      'configuration_name',
-      'obfuscated_jar_path',
-      )
-
-  if options.testapp:
-    required_options += (
-        'test_jar_path',
-        )
-
-  build_utils.CheckOptions(options, parser, required=required_options)
-  return options, args
-
-
-def DoProguard(options):
-  proguard = proguard_util.ProguardCmdBuilder(options.proguard_jar_path)
-  proguard.outjar(options.obfuscated_jar_path)
-
-  library_classpath = [options.android_sdk_jar]
-  input_jars = build_utils.ParseGypList(options.input_jars_paths)
-
-  exclude_paths = []
-  configs = build_utils.ParseGypList(options.proguard_configs)
-  if options.tested_apk_obfuscated_jar_path:
-    # configs should only contain the process_resources.py generated config.
-    assert len(configs) == 1, (
-        'test apks should not have custom proguard configs: ' + str(configs))
-    tested_jar_info = build_utils.ReadJson(
-        options.tested_apk_obfuscated_jar_path + '.info')
-    exclude_paths = tested_jar_info['inputs']
-    configs = tested_jar_info['configs']
-
-    proguard.is_test(True)
-    proguard.mapping(options.tested_apk_obfuscated_jar_path + '.mapping')
-    library_classpath.append(options.tested_apk_obfuscated_jar_path)
-
-  proguard.libraryjars(library_classpath)
-  proguard_injars = [p for p in input_jars if p not in exclude_paths]
-  proguard.injars(proguard_injars)
-  proguard.configs(configs)
-
-  proguard.CheckOutput()
-
-  this_info = {
-    'inputs': proguard_injars,
-    'configs': configs
-  }
-
-  build_utils.WriteJson(
-      this_info, options.obfuscated_jar_path + '.info')
-
-
-def main(argv):
-  options, _ = ParseArgs(argv)
-
-  input_jars = build_utils.ParseGypList(options.input_jars_paths)
-
-  if options.testapp:
-    dependency_class_filters = [
-        '*R.class', '*R$*.class', '*Manifest.class', '*BuildConfig.class']
-    build_utils.MergeZips(
-        options.test_jar_path, input_jars, dependency_class_filters)
-
-  if options.configuration_name == 'Release' and options.proguard_enabled:
-    DoProguard(options)
-  else:
-    output_files = [
-        options.obfuscated_jar_path,
-        options.obfuscated_jar_path + '.info',
-        options.obfuscated_jar_path + '.dump',
-        options.obfuscated_jar_path + '.seeds',
-        options.obfuscated_jar_path + '.usage',
-        options.obfuscated_jar_path + '.mapping']
-    for f in output_files:
-      if os.path.exists(f):
-        os.remove(f)
-      build_utils.Touch(f)
-
-  if options.stamp:
-    build_utils.Touch(options.stamp)
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
diff --git a/build/android/gyp/copy_ex.py b/build/android/gyp/copy_ex.py
deleted file mode 100755
index a474e77..0000000
--- a/build/android/gyp/copy_ex.py
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Copies files to a directory."""
-
-import optparse
-import os
-import shutil
-import sys
-
-from util import build_utils
-
-
-def _get_all_files(base):
-  """Returns a list of all the files in |base|. Each entry is relative to the
-  last path entry of |base|."""
-  result = []
-  dirname = os.path.dirname(base)
-  for root, _, files in os.walk(base):
-    result.extend([os.path.join(root[len(dirname):], f) for f in files])
-  return result
-
-
-def main(args):
-  args = build_utils.ExpandFileArgs(args)
-
-  parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(parser)
-
-  parser.add_option('--dest', help='Directory to copy files to.')
-  parser.add_option('--files', action='append',
-                    help='List of files to copy.')
-  parser.add_option('--clear', action='store_true',
-                    help='If set, the destination directory will be deleted '
-                    'before copying files to it. This is highly recommended to '
-                    'ensure that no stale files are left in the directory.')
-  parser.add_option('--stamp', help='Path to touch on success.')
-
-  options, _ = parser.parse_args(args)
-
-  if options.clear:
-    build_utils.DeleteDirectory(options.dest)
-    build_utils.MakeDirectory(options.dest)
-
-  files = []
-  for file_arg in options.files:
-    files += build_utils.ParseGypList(file_arg)
-
-  deps = []
-
-  for f in files:
-    if os.path.isdir(f):
-      if not options.clear:
-        print ('To avoid stale files you must use --clear when copying '
-               'directories')
-        sys.exit(-1)
-      shutil.copytree(f, os.path.join(options.dest, os.path.basename(f)))
-      deps.extend(_get_all_files(f))
-    else:
-      shutil.copy(f, options.dest)
-      deps.append(f)
-
-  if options.depfile:
-    build_utils.WriteDepfile(
-        options.depfile,
-        deps + build_utils.GetPythonDependencies())
-
-  if options.stamp:
-    build_utils.Touch(options.stamp)
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
-
diff --git a/build/android/gyp/create_device_library_links.py b/build/android/gyp/create_device_library_links.py
deleted file mode 100755
index 3e630b6..0000000
--- a/build/android/gyp/create_device_library_links.py
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Creates symlinks to native libraries for an APK.
-
-The native libraries should have previously been pushed to the device (in
-options.target_dir). This script then creates links in an apk's lib/ folder to
-those native libraries.
-"""
-
-import optparse
-import os
-import sys
-
-from util import build_device
-from util import build_utils
-
-BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), '..')
-sys.path.append(BUILD_ANDROID_DIR)
-
-from pylib import constants
-from pylib.utils import apk_helper
-
-def RunShellCommand(device, cmd):
-  output = device.RunShellCommand(cmd)
-
-  if output:
-    raise Exception(
-        'Unexpected output running command: ' + cmd + '\n' +
-        '\n'.join(output))
-
-
-def CreateSymlinkScript(options):
-  libraries = build_utils.ParseGypList(options.libraries)
-
-  link_cmd = (
-      'rm $APK_LIBRARIES_DIR/%(lib_basename)s > /dev/null 2>&1 \n'
-      'ln -s $STRIPPED_LIBRARIES_DIR/%(lib_basename)s '
-        '$APK_LIBRARIES_DIR/%(lib_basename)s \n'
-      )
-
-  script = '#!/bin/sh \n'
-
-  for lib in libraries:
-    script += link_cmd % { 'lib_basename': lib }
-
-  with open(options.script_host_path, 'w') as scriptfile:
-    scriptfile.write(script)
-
-
-def TriggerSymlinkScript(options):
-  device = build_device.GetBuildDeviceFromPath(
-      options.build_device_configuration)
-  if not device:
-    return
-
-  apk_package = apk_helper.GetPackageName(options.apk)
-  apk_libraries_dir = '/data/data/%s/lib' % apk_package
-
-  device_dir = os.path.dirname(options.script_device_path)
-  mkdir_cmd = ('if [ ! -e %(dir)s ]; then mkdir -p %(dir)s; fi ' %
-      { 'dir': device_dir })
-  RunShellCommand(device, mkdir_cmd)
-  device.PushChangedFiles([(options.script_host_path,
-                            options.script_device_path)])
-
-  trigger_cmd = (
-      'APK_LIBRARIES_DIR=%(apk_libraries_dir)s; '
-      'STRIPPED_LIBRARIES_DIR=%(target_dir)s; '
-      '. %(script_device_path)s'
-      ) % {
-          'apk_libraries_dir': apk_libraries_dir,
-          'target_dir': options.target_dir,
-          'script_device_path': options.script_device_path
-          }
-  RunShellCommand(device, trigger_cmd)
-
-
-def main(args):
-  args = build_utils.ExpandFileArgs(args)
-  parser = optparse.OptionParser()
-  parser.add_option('--apk', help='Path to the apk.')
-  parser.add_option('--script-host-path',
-      help='Path on the host for the symlink script.')
-  parser.add_option('--script-device-path',
-      help='Path on the device to push the created symlink script.')
-  parser.add_option('--libraries',
-      help='List of native libraries.')
-  parser.add_option('--target-dir',
-      help='Device directory that contains the target libraries for symlinks.')
-  parser.add_option('--stamp', help='Path to touch on success.')
-  parser.add_option('--build-device-configuration',
-      help='Path to build device configuration.')
-  parser.add_option('--configuration-name',
-      help='The build CONFIGURATION_NAME')
-  options, _ = parser.parse_args(args)
-
-  required_options = ['apk', 'libraries', 'script_host_path',
-      'script_device_path', 'target_dir', 'configuration_name']
-  build_utils.CheckOptions(options, parser, required=required_options)
-  constants.SetBuildType(options.configuration_name)
-
-  CreateSymlinkScript(options)
-  TriggerSymlinkScript(options)
-
-  if options.stamp:
-    build_utils.Touch(options.stamp)
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
diff --git a/build/android/gyp/create_dist_jar.py b/build/android/gyp/create_dist_jar.py
deleted file mode 100755
index 0d31c5d..0000000
--- a/build/android/gyp/create_dist_jar.py
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Merges a list of jars into a single jar."""
-
-import optparse
-import sys
-
-from util import build_utils
-
-def main(args):
-  args = build_utils.ExpandFileArgs(args)
-  parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(parser)
-  parser.add_option('--output', help='Path to output jar.')
-  parser.add_option('--inputs', action='append', help='List of jar inputs.')
-  options, _ = parser.parse_args(args)
-  build_utils.CheckOptions(options, parser, ['output', 'inputs'])
-
-  input_jars = []
-  for inputs_arg in options.inputs:
-    input_jars.extend(build_utils.ParseGypList(inputs_arg))
-
-  build_utils.MergeZips(options.output, input_jars)
-
-  if options.depfile:
-    build_utils.WriteDepfile(
-        options.depfile,
-        input_jars + build_utils.GetPythonDependencies())
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
diff --git a/build/android/gyp/create_flutter_jar.py b/build/android/gyp/create_flutter_jar.py
deleted file mode 100644
index c30bae2..0000000
--- a/build/android/gyp/create_flutter_jar.py
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2016 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Create a JAR incorporating all the components required to build a Flutter application"""
-
-import optparse
-import os
-import sys
-import zipfile
-
-from util import build_utils
-
-def main(args):
-  args = build_utils.ExpandFileArgs(args)
-  parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(parser)
-  parser.add_option('--output', help='Path to output jar.')
-  parser.add_option('--dist_jar', help='Flutter shell Java code jar.')
-  parser.add_option('--native_lib', action='append', help='Native code library.')
-  parser.add_option('--android_abi', help='Native code ABI.')
-  parser.add_option('--asset_dir', help='Path to assets.')
-  options, _ = parser.parse_args(args)
-  build_utils.CheckOptions(options, parser, [
-    'output', 'dist_jar', 'native_lib', 'android_abi', 'asset_dir'
-  ])
-
-  input_deps = []
-
-  with zipfile.ZipFile(options.output, 'w', zipfile.ZIP_DEFLATED) as out_zip:
-    input_deps.append(options.dist_jar)
-    with zipfile.ZipFile(options.dist_jar, 'r') as dist_zip:
-      for dist_file in dist_zip.infolist():
-        if dist_file.filename.endswith('.class'):
-          out_zip.writestr(dist_file.filename, dist_zip.read(dist_file.filename))
-
-    for native_lib in options.native_lib:
-      input_deps.append(native_lib)
-      out_zip.write(native_lib,
-                    'lib/%s/%s' % (options.android_abi, os.path.basename(native_lib)))
-
-    for asset_file in os.listdir(options.asset_dir):
-      input_deps.append(asset_file)
-      out_zip.write(os.path.join(options.asset_dir, asset_file),
-                    'assets/%s' % asset_file)
-
-  if options.depfile:
-    build_utils.WriteDepfile(
-        options.depfile,
-        input_deps + build_utils.GetPythonDependencies())
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
diff --git a/build/android/gyp/create_java_binary_script.py b/build/android/gyp/create_java_binary_script.py
deleted file mode 100755
index 5de43f2..0000000
--- a/build/android/gyp/create_java_binary_script.py
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Creates a simple script to run a java "binary".
-
-This creates a script that sets up the java command line for running a java
-jar. This includes correctly setting the classpath and the main class.
-"""
-
-import optparse
-import os
-import sys
-
-from util import build_utils
-
-# The java command must be executed in the current directory because there may
-# be user-supplied paths in the args. The script receives the classpath relative
-# to the directory that the script is written in and then, when run, must
-# recalculate the paths relative to the current directory.
-script_template = """\
-#!/usr/bin/env python
-#
-# This file was generated by build/android/gyp/create_java_binary_script.py
-
-import os
-import sys
-
-self_dir = os.path.dirname(__file__)
-classpath = [{classpath}]
-if os.getcwd() != self_dir:
-  offset = os.path.relpath(self_dir, os.getcwd())
-  classpath = [os.path.join(offset, p) for p in classpath]
-java_args = [
-  "java",
-  "-classpath", ":".join(classpath),
-  "-enableassertions",
-  \"{main_class}\"] + sys.argv[1:]
-os.execvp("java", java_args)
-"""
-
-def main(argv):
-  argv = build_utils.ExpandFileArgs(argv)
-  parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(parser)
-  parser.add_option('--output', help='Output path for executable script.')
-  parser.add_option('--jar-path', help='Path to the main jar.')
-  parser.add_option('--main-class',
-      help='Name of the java class with the "main" entry point.')
-  parser.add_option('--classpath', action='append',
-      help='Classpath for running the jar.')
-  options, _ = parser.parse_args(argv)
-
-  classpath = [options.jar_path]
-  for cp_arg in options.classpath:
-    classpath += build_utils.ParseGypList(cp_arg)
-
-  run_dir = os.path.dirname(options.output)
-  classpath = [os.path.relpath(p, run_dir) for p in classpath]
-
-  with open(options.output, 'w') as script:
-    script.write(script_template.format(
-      classpath=('"%s"' % '", "'.join(classpath)),
-      main_class=options.main_class))
-
-  os.chmod(options.output, 0750)
-
-  if options.depfile:
-    build_utils.WriteDepfile(
-        options.depfile,
-        build_utils.GetPythonDependencies())
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
diff --git a/build/android/gyp/create_placeholder_files.py b/build/android/gyp/create_placeholder_files.py
deleted file mode 100755
index 103e1df..0000000
--- a/build/android/gyp/create_placeholder_files.py
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Create placeholder files.
-"""
-
-import optparse
-import os
-import sys
-
-from util import build_utils
-
-def main():
-  parser = optparse.OptionParser()
-  parser.add_option(
-      '--dest-lib-dir',
-      help='Destination directory to have placeholder files.')
-  parser.add_option(
-      '--stamp',
-      help='Path to touch on success')
-
-  options, args = parser.parse_args()
-
-  for name in args:
-    target_path = os.path.join(options.dest_lib_dir, name)
-    build_utils.Touch(target_path)
-
-  if options.stamp:
-    build_utils.Touch(options.stamp)
-
-if __name__ == '__main__':
-  sys.exit(main())
-
diff --git a/build/android/gyp/create_standalone_apk.py b/build/android/gyp/create_standalone_apk.py
deleted file mode 100755
index c560599..0000000
--- a/build/android/gyp/create_standalone_apk.py
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Combines stripped libraries and incomplete APK into single standalone APK.
-
-"""
-
-import optparse
-import os
-import shutil
-import sys
-import tempfile
-
-from util import build_utils
-from util import md5_check
-
-def CreateStandaloneApk(options):
-  def DoZip():
-    with tempfile.NamedTemporaryFile(suffix='.zip') as intermediate_file:
-      intermediate_path = intermediate_file.name
-      shutil.copy(options.input_apk_path, intermediate_path)
-      apk_path_abs = os.path.abspath(intermediate_path)
-      build_utils.CheckOutput(
-          ['zip', '-r', '-1', apk_path_abs, 'lib'],
-          cwd=options.libraries_top_dir)
-      shutil.copy(intermediate_path, options.output_apk_path)
-
-  input_paths = [options.input_apk_path, options.libraries_top_dir]
-  record_path = '%s.standalone.stamp' % options.input_apk_path
-  md5_check.CallAndRecordIfStale(
-      DoZip,
-      record_path=record_path,
-      input_paths=input_paths)
-
-
-def main():
-  parser = optparse.OptionParser()
-  parser.add_option('--libraries-top-dir',
-      help='Top directory that contains libraries '
-      '(i.e. library paths are like '
-      'libraries_top_dir/lib/android_app_abi/foo.so).')
-  parser.add_option('--input-apk-path', help='Path to incomplete APK.')
-  parser.add_option('--output-apk-path', help='Path for standalone APK.')
-  parser.add_option('--stamp', help='Path to touch on success.')
-  options, _ = parser.parse_args()
-
-  required_options = ['libraries_top_dir', 'input_apk_path', 'output_apk_path']
-  build_utils.CheckOptions(options, parser, required=required_options)
-
-  CreateStandaloneApk(options)
-
-  if options.stamp:
-    build_utils.Touch(options.stamp)
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/android/gyp/create_test_runner_script.py b/build/android/gyp/create_test_runner_script.py
deleted file mode 100755
index 247bf20..0000000
--- a/build/android/gyp/create_test_runner_script.py
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Creates a script to run an android test using build/android/test_runner.py.
-"""
-
-import argparse
-import os
-import sys
-
-from util import build_utils
-
-SCRIPT_TEMPLATE = """\
-#!/usr/bin/env python
-#
-# This file was generated by build/android/gyp/create_test_runner_script.py
-
-import logging
-import os
-import sys
-
-def main():
-  script_directory = os.path.dirname(__file__)
-
-  def ResolvePath(path):
-    \"\"\"Returns an absolute filepath given a path relative to this script.
-    \"\"\"
-    return os.path.abspath(os.path.join(script_directory, path))
-
-  test_runner_path = ResolvePath('{test_runner_path}')
-  test_runner_args = {test_runner_args}
-  test_runner_path_args = {test_runner_path_args}
-  for arg, path in test_runner_path_args.iteritems():
-    test_runner_args.extend([arg, ResolvePath(path)])
-
-  test_runner_cmd = ' '.join(
-      [test_runner_path] + test_runner_args + sys.argv[1:])
-  logging.critical(test_runner_cmd)
-  os.system(test_runner_cmd)
-
-if __name__ == '__main__':
-  sys.exit(main())
-"""
-
-def main():
-  parser = argparse.ArgumentParser()
-  parser.add_argument('--script-output-path',
-                      help='Output path for executable script.')
-  parser.add_argument('--depfile',
-                      help='Path to the depfile. This must be specified as '
-                           "the action's first output.")
-  # We need to intercept any test runner path arguments and make all
-  # of the paths relative to the output script directory.
-  group = parser.add_argument_group('Test runner path arguments.')
-  group.add_argument('--output-directory')
-  group.add_argument('--isolate-file-path')
-  group.add_argument('--support-apk')
-  args, test_runner_args = parser.parse_known_args()
-
-  def RelativizePathToScript(path):
-    """Returns the path relative to the output script directory."""
-    return os.path.relpath(path, os.path.dirname(args.script_output_path))
-
-  test_runner_path = os.path.join(
-      os.path.dirname(__file__), os.path.pardir, 'test_runner.py')
-  test_runner_path = RelativizePathToScript(test_runner_path)
-
-  test_runner_path_args = {}
-  if args.output_directory:
-    test_runner_path_args['--output-directory'] = RelativizePathToScript(
-        args.output_directory)
-  if args.isolate_file_path:
-    test_runner_path_args['--isolate-file-path'] = RelativizePathToScript(
-        args.isolate_file_path)
-  if args.support_apk:
-    test_runner_path_args['--support-apk'] = RelativizePathToScript(
-        args.support_apk)
-
-  with open(args.script_output_path, 'w') as script:
-    script.write(SCRIPT_TEMPLATE.format(
-        test_runner_path=str(test_runner_path),
-        test_runner_args=str(test_runner_args),
-        test_runner_path_args=str(test_runner_path_args)))
-
-  os.chmod(args.script_output_path, 0750)
-
-  if args.depfile:
-    build_utils.WriteDepfile(
-        args.depfile,
-        build_utils.GetPythonDependencies())
-
-if __name__ == '__main__':
-  sys.exit(main())
\ No newline at end of file
diff --git a/build/android/gyp/dex.py b/build/android/gyp/dex.py
deleted file mode 100755
index c26d23a..0000000
--- a/build/android/gyp/dex.py
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import optparse
-import os
-import sys
-
-from util import build_utils
-from util import md5_check
-
-
-def DoDex(options, paths):
-  dx_binary = os.path.join(options.android_sdk_tools, 'dx')
-  # See http://crbug.com/272064 for context on --force-jumbo.
-  dex_cmd = [dx_binary, '--dex', '--force-jumbo', '--output', options.dex_path]
-  if options.no_locals != '0':
-    dex_cmd.append('--no-locals')
-
-  dex_cmd += paths
-
-  record_path = '%s.md5.stamp' % options.dex_path
-  md5_check.CallAndRecordIfStale(
-      lambda: build_utils.CheckOutput(dex_cmd, print_stderr=False),
-      record_path=record_path,
-      input_paths=paths,
-      input_strings=dex_cmd,
-      force=not os.path.exists(options.dex_path))
-  build_utils.WriteJson(
-      [os.path.relpath(p, options.output_directory) for p in paths],
-      options.dex_path + '.inputs')
-
-
-def main():
-  args = build_utils.ExpandFileArgs(sys.argv[1:])
-
-  parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(parser)
-
-  parser.add_option('--android-sdk-tools',
-                    help='Android sdk build tools directory.')
-  parser.add_option('--output-directory',
-                    default=os.getcwd(),
-                    help='Path to the output build directory.')
-  parser.add_option('--dex-path', help='Dex output path.')
-  parser.add_option('--configuration-name',
-                    help='The build CONFIGURATION_NAME.')
-  parser.add_option('--proguard-enabled',
-                    help='"true" if proguard is enabled.')
-  parser.add_option('--proguard-enabled-input-path',
-                    help=('Path to dex in Release mode when proguard '
-                          'is enabled.'))
-  parser.add_option('--no-locals',
-                    help='Exclude locals list from the dex file.')
-  parser.add_option('--inputs', help='A list of additional input paths.')
-  parser.add_option('--excluded-paths',
-                    help='A list of paths to exclude from the dex file.')
-
-  options, paths = parser.parse_args(args)
-
-  required_options = ('android_sdk_tools',)
-  build_utils.CheckOptions(options, parser, required=required_options)
-
-  if (options.proguard_enabled == 'true'
-      and options.configuration_name == 'Release'):
-    paths = [options.proguard_enabled_input_path]
-
-  if options.inputs:
-    paths += build_utils.ParseGypList(options.inputs)
-
-  if options.excluded_paths:
-    # Excluded paths are relative to the output directory.
-    exclude_paths = build_utils.ParseGypList(options.excluded_paths)
-    paths = [p for p in paths if not
-             os.path.relpath(p, options.output_directory) in exclude_paths]
-
-  DoDex(options, paths)
-
-  if options.depfile:
-    build_utils.WriteDepfile(
-        options.depfile,
-        paths + build_utils.GetPythonDependencies())
-
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/android/gyp/emma_instr.py b/build/android/gyp/emma_instr.py
deleted file mode 100755
index 6f3555a..0000000
--- a/build/android/gyp/emma_instr.py
+++ /dev/null
@@ -1,207 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Instruments classes and jar files.
-
-This script corresponds to the 'emma_instr' action in the java build process.
-Depending on whether emma_instrument is set, the 'emma_instr' action will either
-call one of the instrument commands, or the copy command.
-
-Possible commands are:
-- instrument_jar: Accepts a jar and instruments it using emma.jar.
-- instrument_classes: Accepts a directory containing java classes and
-      instruments it using emma.jar.
-- copy: Called when EMMA coverage is not enabled. This allows us to make
-      this a required step without necessarily instrumenting on every build.
-      Also removes any stale coverage files.
-"""
-
-import collections
-import json
-import os
-import shutil
-import sys
-import tempfile
-
-sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))
-from pylib.utils import command_option_parser
-
-from util import build_utils
-
-
-def _AddCommonOptions(option_parser):
-  """Adds common options to |option_parser|."""
-  option_parser.add_option('--input-path',
-                           help=('Path to input file(s). Either the classes '
-                                 'directory, or the path to a jar.'))
-  option_parser.add_option('--output-path',
-                           help=('Path to output final file(s) to. Either the '
-                                 'final classes directory, or the directory in '
-                                 'which to place the instrumented/copied jar.'))
-  option_parser.add_option('--stamp', help='Path to touch when done.')
-  option_parser.add_option('--coverage-file',
-                           help='File to create with coverage metadata.')
-  option_parser.add_option('--sources-file',
-                           help='File to create with the list of sources.')
-
-
-def _AddInstrumentOptions(option_parser):
-  """Adds options related to instrumentation to |option_parser|."""
-  _AddCommonOptions(option_parser)
-  option_parser.add_option('--sources',
-                           help='Space separated list of sources.')
-  option_parser.add_option('--src-root',
-                           help='Root of the src repository.')
-  option_parser.add_option('--emma-jar',
-                           help='Path to emma.jar.')
-  option_parser.add_option(
-      '--filter-string', default='',
-      help=('Filter string consisting of a list of inclusion/exclusion '
-            'patterns separated with whitespace and/or comma.'))
-
-
-def _RunCopyCommand(_command, options, _, option_parser):
-  """Copies the jar from input to output locations.
-
-  Also removes any old coverage/sources file.
-
-  Args:
-    command: String indicating the command that was received to trigger
-        this function.
-    options: optparse options dictionary.
-    args: List of extra args from optparse.
-    option_parser: optparse.OptionParser object.
-
-  Returns:
-    An exit code.
-  """
-  if not (options.input_path and options.output_path and
-          options.coverage_file and options.sources_file):
-    option_parser.error('All arguments are required.')
-
-  coverage_file = os.path.join(os.path.dirname(options.output_path),
-                               options.coverage_file)
-  sources_file = os.path.join(os.path.dirname(options.output_path),
-                              options.sources_file)
-  if os.path.exists(coverage_file):
-    os.remove(coverage_file)
-  if os.path.exists(sources_file):
-    os.remove(sources_file)
-
-  if os.path.isdir(options.input_path):
-    shutil.rmtree(options.output_path, ignore_errors=True)
-    shutil.copytree(options.input_path, options.output_path)
-  else:
-    shutil.copy(options.input_path, options.output_path)
-
-  if options.stamp:
-    build_utils.Touch(options.stamp)
-
-
-def _CreateSourcesFile(sources_string, sources_file, src_root):
-  """Adds all normalized source directories to |sources_file|.
-
-  Args:
-    sources_string: String generated from gyp containing the list of sources.
-    sources_file: File into which to write the JSON list of sources.
-    src_root: Root which sources added to the file should be relative to.
-
-  Returns:
-    An exit code.
-  """
-  src_root = os.path.abspath(src_root)
-  sources = build_utils.ParseGypList(sources_string)
-  relative_sources = []
-  for s in sources:
-    abs_source = os.path.abspath(s)
-    if abs_source[:len(src_root)] != src_root:
-      print ('Error: found source directory not under repository root: %s %s'
-             % (abs_source, src_root))
-      return 1
-    rel_source = os.path.relpath(abs_source, src_root)
-
-    relative_sources.append(rel_source)
-
-  with open(sources_file, 'w') as f:
-    json.dump(relative_sources, f)
-
-
-def _RunInstrumentCommand(command, options, _, option_parser):
-  """Instruments the classes/jar files using EMMA.
-
-  Args:
-    command: 'instrument_jar' or 'instrument_classes'. This distinguishes
-        whether we copy the output from the created lib/ directory, or classes/
-        directory.
-    options: optparse options dictionary.
-    args: List of extra args from optparse.
-    option_parser: optparse.OptionParser object.
-
-  Returns:
-    An exit code.
-  """
-  if not (options.input_path and options.output_path and
-          options.coverage_file and options.sources_file and options.sources and
-          options.src_root and options.emma_jar):
-    option_parser.error('All arguments are required.')
-
-  coverage_file = os.path.join(os.path.dirname(options.output_path),
-                               options.coverage_file)
-  sources_file = os.path.join(os.path.dirname(options.output_path),
-                              options.sources_file)
-  if os.path.exists(coverage_file):
-    os.remove(coverage_file)
-  temp_dir = tempfile.mkdtemp()
-  try:
-    cmd = ['java', '-cp', options.emma_jar,
-           'emma', 'instr',
-           '-ip', options.input_path,
-           '-ix', options.filter_string,
-           '-d', temp_dir,
-           '-out', coverage_file,
-           '-m', 'fullcopy']
-    build_utils.CheckOutput(cmd)
-
-    if command == 'instrument_jar':
-      for jar in os.listdir(os.path.join(temp_dir, 'lib')):
-        shutil.copy(os.path.join(temp_dir, 'lib', jar),
-                    options.output_path)
-    else:  # 'instrument_classes'
-      if os.path.isdir(options.output_path):
-        shutil.rmtree(options.output_path, ignore_errors=True)
-      shutil.copytree(os.path.join(temp_dir, 'classes'),
-                      options.output_path)
-  finally:
-    shutil.rmtree(temp_dir)
-
-  _CreateSourcesFile(options.sources, sources_file, options.src_root)
-
-  if options.stamp:
-    build_utils.Touch(options.stamp)
-
-  return 0
-
-
-CommandFunctionTuple = collections.namedtuple(
-    'CommandFunctionTuple', ['add_options_func', 'run_command_func'])
-VALID_COMMANDS = {
-    'copy': CommandFunctionTuple(_AddCommonOptions,
-                                 _RunCopyCommand),
-    'instrument_jar': CommandFunctionTuple(_AddInstrumentOptions,
-                                           _RunInstrumentCommand),
-    'instrument_classes': CommandFunctionTuple(_AddInstrumentOptions,
-                                               _RunInstrumentCommand),
-}
-
-
-def main():
-  option_parser = command_option_parser.CommandOptionParser(
-      commands_dict=VALID_COMMANDS)
-  command_option_parser.ParseAndExecute(option_parser)
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/android/gyp/finalize_apk.py b/build/android/gyp/finalize_apk.py
deleted file mode 100755
index 0a80035..0000000
--- a/build/android/gyp/finalize_apk.py
+++ /dev/null
@@ -1,132 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-"""Signs and zipaligns APK.
-
-"""
-
-import optparse
-import shutil
-import sys
-import tempfile
-
-from util import build_utils
-
-def RenameInflateAndAddPageAlignment(
-    rezip_apk_jar_path, in_zip_file, out_zip_file):
-  rezip_apk_cmd = [
-      'java',
-      '-classpath',
-      rezip_apk_jar_path,
-      'RezipApk',
-      'renamealign',
-      in_zip_file,
-      out_zip_file,
-    ]
-  build_utils.CheckOutput(rezip_apk_cmd)
-
-
-def ReorderAndAlignApk(rezip_apk_jar_path, in_zip_file, out_zip_file):
-  rezip_apk_cmd = [
-      'java',
-      '-classpath',
-      rezip_apk_jar_path,
-      'RezipApk',
-      'reorder',
-      in_zip_file,
-      out_zip_file,
-    ]
-  build_utils.CheckOutput(rezip_apk_cmd)
-
-
-def JarSigner(key_path, key_name, key_passwd, unsigned_path, signed_path):
-  shutil.copy(unsigned_path, signed_path)
-  sign_cmd = [
-      'jarsigner',
-      '-sigalg', 'MD5withRSA',
-      '-digestalg', 'SHA1',
-      '-keystore', key_path,
-      '-storepass', key_passwd,
-      signed_path,
-      key_name,
-    ]
-  build_utils.CheckOutput(sign_cmd)
-
-
-def AlignApk(zipalign_path, unaligned_path, final_path):
-  align_cmd = [
-      zipalign_path,
-      '-f', '4',  # 4 bytes
-      unaligned_path,
-      final_path,
-      ]
-  build_utils.CheckOutput(align_cmd)
-
-
-def main():
-  parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(parser)
-
-  parser.add_option('--rezip-apk-jar-path',
-                    help='Path to the RezipApk jar file.')
-  parser.add_option('--zipalign-path', help='Path to the zipalign tool.')
-  parser.add_option('--unsigned-apk-path', help='Path to input unsigned APK.')
-  parser.add_option('--final-apk-path',
-      help='Path to output signed and aligned APK.')
-  parser.add_option('--key-path', help='Path to keystore for signing.')
-  parser.add_option('--key-passwd', help='Keystore password')
-  parser.add_option('--key-name', help='Keystore name')
-  parser.add_option('--stamp', help='Path to touch on success.')
-  parser.add_option('--load-library-from-zip', type='int',
-      help='If non-zero, build the APK such that the library can be loaded ' +
-           'directly from the zip file using the crazy linker. The library ' +
-           'will be renamed, uncompressed and page aligned.')
-
-  options, _ = parser.parse_args()
-
-  FinalizeApk(options)
-
-  if options.depfile:
-    build_utils.WriteDepfile(
-        options.depfile, build_utils.GetPythonDependencies())
-
-  if options.stamp:
-    build_utils.Touch(options.stamp)
-
-
-def FinalizeApk(options):
-  with tempfile.NamedTemporaryFile() as signed_apk_path_tmp, \
-      tempfile.NamedTemporaryFile() as apk_to_sign_tmp:
-
-    if options.load_library_from_zip:
-      # We alter the name of the library so that the Android Package Manager
-      # does not extract it into a separate file. This must be done before
-      # signing, as the filename is part of the signed manifest. At the same
-      # time we uncompress the library, which is necessary so that it can be
-      # loaded directly from the APK.
-      # Move the library to a page boundary by adding a page alignment file.
-      apk_to_sign = apk_to_sign_tmp.name
-      RenameInflateAndAddPageAlignment(
-          options.rezip_apk_jar_path, options.unsigned_apk_path, apk_to_sign)
-    else:
-      apk_to_sign = options.unsigned_apk_path
-
-    signed_apk_path = signed_apk_path_tmp.name
-    JarSigner(options.key_path, options.key_name, options.key_passwd,
-              apk_to_sign, signed_apk_path)
-
-    if options.load_library_from_zip:
-      # Reorder the contents of the APK. This re-establishes the canonical
-      # order which means the library will be back at its page aligned location.
-      # This step also aligns uncompressed items to 4 bytes.
-      ReorderAndAlignApk(
-          options.rezip_apk_jar_path, signed_apk_path, options.final_apk_path)
-    else:
-      # Align uncompressed items to 4 bytes
-      AlignApk(options.zipalign_path, signed_apk_path, options.final_apk_path)
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/android/gyp/finalize_splits.py b/build/android/gyp/finalize_splits.py
deleted file mode 100755
index a6796bb..0000000
--- a/build/android/gyp/finalize_splits.py
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-"""Signs and zipaligns split APKs.
-
-This script is require only by GYP (not GN).
-"""
-
-import optparse
-import sys
-
-import finalize_apk
-from util import build_utils
-
-def main():
-  parser = optparse.OptionParser()
-  parser.add_option('--zipalign-path', help='Path to the zipalign tool.')
-  parser.add_option('--resource-packaged-apk-path',
-      help='Base path to input .ap_s.')
-  parser.add_option('--base-output-path',
-      help='Path to output .apk, minus extension.')
-  parser.add_option('--key-path', help='Path to keystore for signing.')
-  parser.add_option('--key-passwd', help='Keystore password')
-  parser.add_option('--key-name', help='Keystore name')
-  parser.add_option('--densities',
-      help='Comma separated list of densities finalize.')
-  parser.add_option('--languages',
-      help='GYP list of language splits to finalize.')
-
-  options, _ = parser.parse_args()
-  options.load_library_from_zip = 0
-
-  if options.densities:
-    for density in options.densities.split(','):
-      options.unsigned_apk_path = ("%s_%s" %
-          (options.resource_packaged_apk_path, density))
-      options.final_apk_path = ("%s-density-%s.apk" %
-          (options.base_output_path, density))
-      finalize_apk.FinalizeApk(options)
-
-  if options.languages:
-    for lang in build_utils.ParseGypList(options.languages):
-      options.unsigned_apk_path = ("%s_%s" %
-          (options.resource_packaged_apk_path, lang))
-      options.final_apk_path = ("%s-lang-%s.apk" %
-          (options.base_output_path, lang))
-      finalize_apk.FinalizeApk(options)
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/android/gyp/find.py b/build/android/gyp/find.py
deleted file mode 100755
index a9f1d49..0000000
--- a/build/android/gyp/find.py
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Finds files in directories.
-"""
-
-import fnmatch
-import optparse
-import os
-import sys
-
-
-def main(argv):
-  parser = optparse.OptionParser()
-  parser.add_option('--pattern', default='*', help='File pattern to match.')
-  options, directories = parser.parse_args(argv)
-
-  for d in directories:
-    if not os.path.exists(d):
-      print >> sys.stderr, '%s does not exist' % d
-      return 1
-    for root, _, filenames in os.walk(d):
-      for f in fnmatch.filter(filenames, options.pattern):
-        print os.path.join(root, f)
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
diff --git a/build/android/gyp/find_sun_tools_jar.py b/build/android/gyp/find_sun_tools_jar.py
deleted file mode 100755
index 2f15a15..0000000
--- a/build/android/gyp/find_sun_tools_jar.py
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""This finds the java distribution's tools.jar and copies it somewhere.
-"""
-
-import argparse
-import os
-import re
-import shutil
-import sys
-
-from util import build_utils
-
-RT_JAR_FINDER = re.compile(r'\[Opened (.*)/jre/lib/rt.jar\]')
-
-def main():
-  parser = argparse.ArgumentParser(description='Find Sun Tools Jar')
-  parser.add_argument('--depfile',
-                      help='Path to depfile. This must be specified as the '
-                           'action\'s first output.')
-  parser.add_argument('--output', required=True)
-  args = parser.parse_args()
-
-  sun_tools_jar_path = FindSunToolsJarPath()
-
-  if sun_tools_jar_path is None:
-    raise Exception("Couldn\'t find tools.jar")
-
-  # Using copyfile instead of copy() because copy() calls copymode()
-  # We don't want the locked mode because we may copy over this file again
-  shutil.copyfile(sun_tools_jar_path, args.output)
-
-  if args.depfile:
-    build_utils.WriteDepfile(
-        args.depfile,
-        [sun_tools_jar_path] + build_utils.GetPythonDependencies())
-
-
-def FindSunToolsJarPath():
-  # This works with at least openjdk 1.6, 1.7 and sun java 1.6, 1.7
-  stdout = build_utils.CheckOutput(
-      ["java", "-verbose", "-version"], print_stderr=False)
-  for ln in stdout.splitlines():
-    match = RT_JAR_FINDER.match(ln)
-    if match:
-      return os.path.join(match.group(1), 'lib', 'tools.jar')
-
-  return None
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/android/gyp/gcc_preprocess.py b/build/android/gyp/gcc_preprocess.py
deleted file mode 100755
index 03becf9..0000000
--- a/build/android/gyp/gcc_preprocess.py
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import optparse
-import os
-import sys
-
-from util import build_utils
-
-def DoGcc(options):
-  build_utils.MakeDirectory(os.path.dirname(options.output))
-
-  gcc_cmd = [ 'gcc' ]  # invoke host gcc.
-  if options.defines:
-    gcc_cmd.extend(sum(map(lambda w: ['-D', w], options.defines), []))
-  gcc_cmd.extend([
-      '-E',                  # stop after preprocessing.
-      '-D', 'ANDROID',       # Specify ANDROID define for pre-processor.
-      '-x', 'c-header',      # treat sources as C header files
-      '-P',                  # disable line markers, i.e. '#line 309'
-      '-I', options.include_path,
-      '-o', options.output,
-      options.template
-      ])
-
-  build_utils.CheckOutput(gcc_cmd)
-
-
-def main(args):
-  args = build_utils.ExpandFileArgs(args)
-
-  parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(parser)
-
-  parser.add_option('--include-path', help='Include path for gcc.')
-  parser.add_option('--template', help='Path to template.')
-  parser.add_option('--output', help='Path for generated file.')
-  parser.add_option('--stamp', help='Path to touch on success.')
-  parser.add_option('--defines', help='Pre-defines macros', action='append')
-
-  options, _ = parser.parse_args(args)
-
-  DoGcc(options)
-
-  if options.depfile:
-    build_utils.WriteDepfile(
-        options.depfile,
-        build_utils.GetPythonDependencies())
-
-  if options.stamp:
-    build_utils.Touch(options.stamp)
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
diff --git a/build/android/gyp/generate_split_manifest.py b/build/android/gyp/generate_split_manifest.py
deleted file mode 100755
index 9cb3bca..0000000
--- a/build/android/gyp/generate_split_manifest.py
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-"""Creates an AndroidManifest.xml for an APK split.
-
-Given the manifest file for the main APK, generates an AndroidManifest.xml with
-the value required for a Split APK (package, versionCode, etc).
-"""
-
-import optparse
-import xml.etree.ElementTree
-
-from util import build_utils
-
-MANIFEST_TEMPLATE = """<?xml version="1.0" encoding="utf-8"?>
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="%(package)s"
-    split="%(split)s">
-  <uses-sdk android:minSdkVersion="21" />
-  <application android:hasCode="%(has_code)s">
-  </application>
-</manifest>
-"""
-
-def ParseArgs():
-  """Parses command line options.
-
-  Returns:
-    An options object as from optparse.OptionsParser.parse_args()
-  """
-  parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(parser)
-  parser.add_option('--main-manifest', help='The main manifest of the app')
-  parser.add_option('--out-manifest', help='The output manifest')
-  parser.add_option('--split', help='The name of the split')
-  parser.add_option(
-      '--has-code',
-      action='store_true',
-      default=False,
-      help='Whether the split will contain a .dex file')
-
-  (options, args) = parser.parse_args()
-
-  if args:
-    parser.error('No positional arguments should be given.')
-
-  # Check that required options have been provided.
-  required_options = ('main_manifest', 'out_manifest', 'split')
-  build_utils.CheckOptions(options, parser, required=required_options)
-
-  return options
-
-
-def Build(main_manifest, split, has_code):
-  """Builds a split manifest based on the manifest of the main APK.
-
-  Args:
-    main_manifest: the XML manifest of the main APK as a string
-    split: the name of the split as a string
-    has_code: whether this split APK will contain .dex files
-
-  Returns:
-    The XML split manifest as a string
-  """
-
-  doc = xml.etree.ElementTree.fromstring(main_manifest)
-  package = doc.get('package')
-
-  return MANIFEST_TEMPLATE % {
-      'package': package,
-      'split': split.replace('-', '_'),
-      'has_code': str(has_code).lower()
-  }
-
-
-def main():
-  options = ParseArgs()
-  main_manifest = file(options.main_manifest).read()
-  split_manifest = Build(
-      main_manifest,
-      options.split,
-      options.has_code)
-
-  with file(options.out_manifest, 'w') as f:
-    f.write(split_manifest)
-
-  if options.depfile:
-    build_utils.WriteDepfile(
-        options.depfile,
-        [options.main_manifest] + build_utils.GetPythonDependencies())
-
-
-if __name__ == '__main__':
-  main()
diff --git a/build/android/gyp/generate_v14_compatible_resources.py b/build/android/gyp/generate_v14_compatible_resources.py
deleted file mode 100755
index 9c8ff3b..0000000
--- a/build/android/gyp/generate_v14_compatible_resources.py
+++ /dev/null
@@ -1,319 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Convert Android xml resources to API 14 compatible.
-
-There are two reasons that we cannot just use API 17 attributes,
-so we are generating another set of resources by this script.
-
-1. paddingStart attribute can cause a crash on Galaxy Tab 2.
-2. There is a bug that paddingStart does not override paddingLeft on
-   JB-MR1. This is fixed on JB-MR2. b/8654490
-
-Therefore, this resource generation script can be removed when
-we drop the support for JB-MR1.
-
-Please refer to http://crbug.com/235118 for the details.
-"""
-
-import optparse
-import os
-import re
-import shutil
-import sys
-import xml.dom.minidom as minidom
-
-from util import build_utils
-
-# Note that we are assuming 'android:' is an alias of
-# the namespace 'http://schemas.android.com/apk/res/android'.
-
-GRAVITY_ATTRIBUTES = ('android:gravity', 'android:layout_gravity')
-
-# Almost all the attributes that has "Start" or "End" in
-# its name should be mapped.
-ATTRIBUTES_TO_MAP = {'paddingStart' : 'paddingLeft',
-                     'drawableStart' : 'drawableLeft',
-                     'layout_alignStart' : 'layout_alignLeft',
-                     'layout_marginStart' : 'layout_marginLeft',
-                     'layout_alignParentStart' : 'layout_alignParentLeft',
-                     'layout_toStartOf' : 'layout_toLeftOf',
-                     'paddingEnd' : 'paddingRight',
-                     'drawableEnd' : 'drawableRight',
-                     'layout_alignEnd' : 'layout_alignRight',
-                     'layout_marginEnd' : 'layout_marginRight',
-                     'layout_alignParentEnd' : 'layout_alignParentRight',
-                     'layout_toEndOf' : 'layout_toRightOf'}
-
-ATTRIBUTES_TO_MAP = dict(['android:' + k, 'android:' + v] for k, v
-                         in ATTRIBUTES_TO_MAP.iteritems())
-
-ATTRIBUTES_TO_MAP_REVERSED = dict([v, k] for k, v
-                                  in ATTRIBUTES_TO_MAP.iteritems())
-
-
-def IterateXmlElements(node):
-  """minidom helper function that iterates all the element nodes.
-  Iteration order is pre-order depth-first."""
-  if node.nodeType == node.ELEMENT_NODE:
-    yield node
-  for child_node in node.childNodes:
-    for child_node_element in IterateXmlElements(child_node):
-      yield child_node_element
-
-
-def ParseAndReportErrors(filename):
-  try:
-    return minidom.parse(filename)
-  except Exception:
-    import traceback
-    traceback.print_exc()
-    sys.stderr.write('Failed to parse XML file: %s\n' % filename)
-    sys.exit(1)
-
-
-def AssertNotDeprecatedAttribute(name, value, filename):
-  """Raises an exception if the given attribute is deprecated."""
-  msg = None
-  if name in ATTRIBUTES_TO_MAP_REVERSED:
-    msg = '{0} should use {1} instead of {2}'.format(filename,
-        ATTRIBUTES_TO_MAP_REVERSED[name], name)
-  elif name in GRAVITY_ATTRIBUTES and ('left' in value or 'right' in value):
-    msg = '{0} should use start/end instead of left/right for {1}'.format(
-        filename, name)
-
-  if msg:
-    msg += ('\nFor background, see: http://android-developers.blogspot.com/'
-            '2013/03/native-rtl-support-in-android-42.html\n'
-            'If you have a legitimate need for this attribute, discuss with '
-            'kkimlabs@chromium.org or newt@chromium.org')
-    raise Exception(msg)
-
-
-def WriteDomToFile(dom, filename):
-  """Write the given dom to filename."""
-  build_utils.MakeDirectory(os.path.dirname(filename))
-  with open(filename, 'w') as f:
-    dom.writexml(f, '', '  ', '\n', encoding='utf-8')
-
-
-def HasStyleResource(dom):
-  """Return True if the dom is a style resource, False otherwise."""
-  root_node = IterateXmlElements(dom).next()
-  return bool(root_node.nodeName == 'resources' and
-              list(root_node.getElementsByTagName('style')))
-
-
-def ErrorIfStyleResourceExistsInDir(input_dir):
-  """If a style resource is in input_dir, raises an exception."""
-  for input_filename in build_utils.FindInDirectory(input_dir, '*.xml'):
-    dom = ParseAndReportErrors(input_filename)
-    if HasStyleResource(dom):
-      raise Exception('error: style file ' + input_filename +
-                      ' should be under ' + input_dir +
-                      '-v17 directory. Please refer to '
-                      'http://crbug.com/243952 for the details.')
-
-
-def GenerateV14LayoutResourceDom(dom, filename, assert_not_deprecated=True):
-  """Convert layout resource to API 14 compatible layout resource.
-
-  Args:
-    dom: Parsed minidom object to be modified.
-    filename: Filename that the DOM was parsed from.
-    assert_not_deprecated: Whether deprecated attributes (e.g. paddingLeft) will
-                           cause an exception to be thrown.
-
-  Returns:
-    True if dom is modified, False otherwise.
-  """
-  is_modified = False
-
-  # Iterate all the elements' attributes to find attributes to convert.
-  for element in IterateXmlElements(dom):
-    for name, value in list(element.attributes.items()):
-      # Convert any API 17 Start/End attributes to Left/Right attributes.
-      # For example, from paddingStart="10dp" to paddingLeft="10dp"
-      # Note: gravity attributes are not necessary to convert because
-      # start/end values are backward-compatible. Explained at
-      # https://plus.sandbox.google.com/+RomanNurik/posts/huuJd8iVVXY?e=Showroom
-      if name in ATTRIBUTES_TO_MAP:
-        element.setAttribute(ATTRIBUTES_TO_MAP[name], value)
-        del element.attributes[name]
-        is_modified = True
-      elif assert_not_deprecated:
-        AssertNotDeprecatedAttribute(name, value, filename)
-
-  return is_modified
-
-
-def GenerateV14StyleResourceDom(dom, filename, assert_not_deprecated=True):
-  """Convert style resource to API 14 compatible style resource.
-
-  Args:
-    dom: Parsed minidom object to be modified.
-    filename: Filename that the DOM was parsed from.
-    assert_not_deprecated: Whether deprecated attributes (e.g. paddingLeft) will
-                           cause an exception to be thrown.
-
-  Returns:
-    True if dom is modified, False otherwise.
-  """
-  is_modified = False
-
-  for style_element in dom.getElementsByTagName('style'):
-    for item_element in style_element.getElementsByTagName('item'):
-      name = item_element.attributes['name'].value
-      value = item_element.childNodes[0].nodeValue
-      if name in ATTRIBUTES_TO_MAP:
-        item_element.attributes['name'].value = ATTRIBUTES_TO_MAP[name]
-        is_modified = True
-      elif assert_not_deprecated:
-        AssertNotDeprecatedAttribute(name, value, filename)
-
-  return is_modified
-
-
-def GenerateV14LayoutResource(input_filename, output_v14_filename,
-                              output_v17_filename):
-  """Convert API 17 layout resource to API 14 compatible layout resource.
-
-  It's mostly a simple replacement, s/Start/Left s/End/Right,
-  on the attribute names.
-  If the generated resource is identical to the original resource,
-  don't do anything. If not, write the generated resource to
-  output_v14_filename, and copy the original resource to output_v17_filename.
-  """
-  dom = ParseAndReportErrors(input_filename)
-  is_modified = GenerateV14LayoutResourceDom(dom, input_filename)
-
-  if is_modified:
-    # Write the generated resource.
-    WriteDomToFile(dom, output_v14_filename)
-
-    # Copy the original resource.
-    build_utils.MakeDirectory(os.path.dirname(output_v17_filename))
-    shutil.copy2(input_filename, output_v17_filename)
-
-
-def GenerateV14StyleResource(input_filename, output_v14_filename):
-  """Convert API 17 style resources to API 14 compatible style resource.
-
-  Write the generated style resource to output_v14_filename.
-  It's mostly a simple replacement, s/Start/Left s/End/Right,
-  on the attribute names.
-  """
-  dom = ParseAndReportErrors(input_filename)
-  GenerateV14StyleResourceDom(dom, input_filename)
-
-  # Write the generated resource.
-  WriteDomToFile(dom, output_v14_filename)
-
-
-def GenerateV14LayoutResourcesInDir(input_dir, output_v14_dir, output_v17_dir):
-  """Convert layout resources to API 14 compatible resources in input_dir."""
-  for input_filename in build_utils.FindInDirectory(input_dir, '*.xml'):
-    rel_filename = os.path.relpath(input_filename, input_dir)
-    output_v14_filename = os.path.join(output_v14_dir, rel_filename)
-    output_v17_filename = os.path.join(output_v17_dir, rel_filename)
-    GenerateV14LayoutResource(input_filename, output_v14_filename,
-                              output_v17_filename)
-
-
-def GenerateV14StyleResourcesInDir(input_dir, output_v14_dir):
-  """Convert style resources to API 14 compatible resources in input_dir."""
-  for input_filename in build_utils.FindInDirectory(input_dir, '*.xml'):
-    rel_filename = os.path.relpath(input_filename, input_dir)
-    output_v14_filename = os.path.join(output_v14_dir, rel_filename)
-    GenerateV14StyleResource(input_filename, output_v14_filename)
-
-
-def ParseArgs():
-  """Parses command line options.
-
-  Returns:
-    An options object as from optparse.OptionsParser.parse_args()
-  """
-  parser = optparse.OptionParser()
-  parser.add_option('--res-dir',
-                    help='directory containing resources '
-                         'used to generate v14 compatible resources')
-  parser.add_option('--res-v14-compatibility-dir',
-                    help='output directory into which '
-                         'v14 compatible resources will be generated')
-  parser.add_option('--stamp', help='File to touch on success')
-
-  options, args = parser.parse_args()
-
-  if args:
-    parser.error('No positional arguments should be given.')
-
-  # Check that required options have been provided.
-  required_options = ('res_dir', 'res_v14_compatibility_dir')
-  build_utils.CheckOptions(options, parser, required=required_options)
-  return options
-
-def GenerateV14Resources(res_dir, res_v14_dir):
-  for name in os.listdir(res_dir):
-    if not os.path.isdir(os.path.join(res_dir, name)):
-      continue
-
-    dir_pieces = name.split('-')
-    resource_type = dir_pieces[0]
-    qualifiers = dir_pieces[1:]
-
-    api_level_qualifier_index = -1
-    api_level_qualifier = ''
-    for index, qualifier in enumerate(qualifiers):
-      if re.match('v[0-9]+$', qualifier):
-        api_level_qualifier_index = index
-        api_level_qualifier = qualifier
-        break
-
-    # Android pre-v17 API doesn't support RTL. Skip.
-    if 'ldrtl' in qualifiers:
-      continue
-
-    input_dir = os.path.abspath(os.path.join(res_dir, name))
-
-    # We also need to copy the original v17 resource to *-v17 directory
-    # because the generated v14 resource will hide the original resource.
-    output_v14_dir = os.path.join(res_v14_dir, name)
-    output_v17_dir = os.path.join(res_v14_dir, name + '-v17')
-
-    # We only convert layout resources under layout*/, xml*/,
-    # and style resources under values*/.
-    if resource_type in ('layout', 'xml'):
-      if not api_level_qualifier:
-        GenerateV14LayoutResourcesInDir(input_dir, output_v14_dir,
-                                        output_v17_dir)
-    elif resource_type == 'values':
-      if api_level_qualifier == 'v17':
-        output_qualifiers = qualifiers[:]
-        del output_qualifiers[api_level_qualifier_index]
-        output_v14_dir = os.path.join(res_v14_dir,
-                                      '-'.join([resource_type] +
-                                               output_qualifiers))
-        GenerateV14StyleResourcesInDir(input_dir, output_v14_dir)
-      elif not api_level_qualifier:
-        ErrorIfStyleResourceExistsInDir(input_dir)
-
-def main():
-  options = ParseArgs()
-
-  res_v14_dir = options.res_v14_compatibility_dir
-
-  build_utils.DeleteDirectory(res_v14_dir)
-  build_utils.MakeDirectory(res_v14_dir)
-
-  GenerateV14Resources(options.res_dir, res_v14_dir)
-
-  if options.stamp:
-    build_utils.Touch(options.stamp)
-
-if __name__ == '__main__':
-  sys.exit(main())
-
diff --git a/build/android/gyp/get_device_configuration.py b/build/android/gyp/get_device_configuration.py
deleted file mode 100755
index 390eb2f..0000000
--- a/build/android/gyp/get_device_configuration.py
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Gets and writes the configurations of the attached devices.
-
-This configuration is used by later build steps to determine which devices to
-install to and what needs to be installed to those devices.
-"""
-
-import optparse
-import sys
-
-from util import build_utils
-from util import build_device
-
-
-def main(argv):
-  parser = optparse.OptionParser()
-  parser.add_option('--stamp', action='store')
-  parser.add_option('--output', action='store')
-  options, _ = parser.parse_args(argv)
-
-  devices = build_device.GetAttachedDevices()
-
-  device_configurations = []
-  for d in devices:
-    configuration, is_online, has_root = (
-        build_device.GetConfigurationForDevice(d))
-
-    if not is_online:
-      build_utils.PrintBigWarning(
-          '%s is not online. Skipping managed install for this device. '
-          'Try rebooting the device to fix this warning.' % d)
-      continue
-
-    if not has_root:
-      build_utils.PrintBigWarning(
-          '"adb root" failed on device: %s\n'
-          'Skipping managed install for this device.'
-          % configuration['description'])
-      continue
-
-    device_configurations.append(configuration)
-
-  if len(device_configurations) == 0:
-    build_utils.PrintBigWarning(
-        'No valid devices attached. Skipping managed install steps.')
-  elif len(devices) > 1:
-    # Note that this checks len(devices) and not len(device_configurations).
-    # This way, any time there are multiple devices attached it is
-    # explicitly stated which device we will install things to even if all but
-    # one device were rejected for other reasons (e.g. two devices attached,
-    # one w/o root).
-    build_utils.PrintBigWarning(
-        'Multiple devices attached. '
-        'Installing to the preferred device: '
-        '%(id)s (%(description)s)' % (device_configurations[0]))
-
-
-  build_device.WriteConfigurations(device_configurations, options.output)
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv))
diff --git a/build/android/gyp/insert_chromium_version.py b/build/android/gyp/insert_chromium_version.py
deleted file mode 100755
index 171f9d4..0000000
--- a/build/android/gyp/insert_chromium_version.py
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Insert a version string into a library as a section '.chromium.version'.
-"""
-
-import optparse
-import os
-import sys
-import tempfile
-
-from util import build_utils
-
-def InsertChromiumVersion(android_objcopy,
-                          library_path,
-                          version_string):
-  # Remove existing .chromium.version section from .so
-  objcopy_command = [android_objcopy,
-                     '--remove-section=.chromium.version',
-                     library_path]
-  build_utils.CheckOutput(objcopy_command)
-
-  # Add a .chromium.version section.
-  with tempfile.NamedTemporaryFile() as stream:
-    stream.write(version_string)
-    stream.flush()
-    objcopy_command = [android_objcopy,
-                       '--add-section', '.chromium.version=%s' % stream.name,
-                       library_path]
-    build_utils.CheckOutput(objcopy_command)
-
-def main(args):
-  args = build_utils.ExpandFileArgs(args)
-  parser = optparse.OptionParser()
-
-  parser.add_option('--android-objcopy',
-      help='Path to the toolchain\'s objcopy binary')
-  parser.add_option('--stripped-libraries-dir',
-      help='Directory of native libraries')
-  parser.add_option('--libraries',
-      help='List of libraries')
-  parser.add_option('--version-string',
-      help='Version string to be inserted')
-  parser.add_option('--stamp', help='Path to touch on success')
-
-  options, _ = parser.parse_args(args)
-  libraries = build_utils.ParseGypList(options.libraries)
-
-  for library in libraries:
-    library_path = os.path.join(options.stripped_libraries_dir, library)
-
-    InsertChromiumVersion(options.android_objcopy,
-                          library_path,
-                          options.version_string)
-
-  if options.stamp:
-    build_utils.Touch(options.stamp)
-
-  return 0
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
diff --git a/build/android/gyp/jar.py b/build/android/gyp/jar.py
deleted file mode 100755
index 48abf5e..0000000
--- a/build/android/gyp/jar.py
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import fnmatch
-import optparse
-import os
-import sys
-
-from util import build_utils
-from util import md5_check
-
-
-def Jar(class_files, classes_dir, jar_path, manifest_file=None):
-  jar_path = os.path.abspath(jar_path)
-
-  # The paths of the files in the jar will be the same as they are passed in to
-  # the command. Because of this, the command should be run in
-  # options.classes_dir so the .class file paths in the jar are correct.
-  jar_cwd = classes_dir
-  class_files_rel = [os.path.relpath(f, jar_cwd) for f in class_files]
-  jar_cmd = ['jar', 'cf0', jar_path]
-  if manifest_file:
-    jar_cmd[1] += 'm'
-    jar_cmd.append(os.path.abspath(manifest_file))
-  jar_cmd.extend(class_files_rel)
-
-  with build_utils.TempDir() as temp_dir:
-    empty_file = os.path.join(temp_dir, '.empty')
-    build_utils.Touch(empty_file)
-    jar_cmd.append(os.path.relpath(empty_file, jar_cwd))
-    record_path = '%s.md5.stamp' % jar_path
-    md5_check.CallAndRecordIfStale(
-        lambda: build_utils.CheckOutput(jar_cmd, cwd=jar_cwd),
-        record_path=record_path,
-        input_paths=class_files,
-        input_strings=jar_cmd,
-        force=not os.path.exists(jar_path),
-        )
-
-    build_utils.Touch(jar_path, fail_if_missing=True)
-
-
-def JarDirectory(classes_dir, excluded_classes, jar_path, manifest_file=None):
-  class_files = build_utils.FindInDirectory(classes_dir, '*.class')
-  for exclude in excluded_classes:
-    class_files = filter(
-        lambda f: not fnmatch.fnmatch(f, exclude), class_files)
-
-  Jar(class_files, classes_dir, jar_path, manifest_file=manifest_file)
-
-
-def main():
-  parser = optparse.OptionParser()
-  parser.add_option('--classes-dir', help='Directory containing .class files.')
-  parser.add_option('--jar-path', help='Jar output path.')
-  parser.add_option('--excluded-classes',
-      help='List of .class file patterns to exclude from the jar.')
-  parser.add_option('--stamp', help='Path to touch on success.')
-
-  options, _ = parser.parse_args()
-
-  if options.excluded_classes:
-    excluded_classes = build_utils.ParseGypList(options.excluded_classes)
-  else:
-    excluded_classes = []
-  JarDirectory(options.classes_dir,
-               excluded_classes,
-               options.jar_path)
-
-  if options.stamp:
-    build_utils.Touch(options.stamp)
-
-
-if __name__ == '__main__':
-  sys.exit(main())
-
diff --git a/build/android/gyp/jar_toc.py b/build/android/gyp/jar_toc.py
deleted file mode 100755
index 00d97d2..0000000
--- a/build/android/gyp/jar_toc.py
+++ /dev/null
@@ -1,127 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Creates a TOC file from a Java jar.
-
-The TOC file contains the non-package API of the jar. This includes all
-public/protected/package classes/functions/members and the values of static
-final variables (members with package access are kept because in some cases we
-have multiple libraries with the same package, particularly test+non-test). Some
-other information (major/minor javac version) is also included.
-
-This TOC file then can be used to determine if a dependent library should be
-rebuilt when this jar changes. I.e. any change to the jar that would require a
-rebuild, will have a corresponding change in the TOC file.
-"""
-
-import optparse
-import os
-import re
-import sys
-import zipfile
-
-from util import build_utils
-from util import md5_check
-
-
-def GetClassesInZipFile(zip_file):
-  classes = []
-  files = zip_file.namelist()
-  for f in files:
-    if f.endswith('.class'):
-      # f is of the form org/chromium/base/Class$Inner.class
-      classes.append(f.replace('/', '.')[:-6])
-  return classes
-
-
-def CallJavap(classpath, classes):
-  javap_cmd = [
-      'javap',
-      '-package',  # Show public/protected/package.
-      # -verbose is required to get constant values (which can be inlined in
-      # dependents).
-      '-verbose',
-      '-J-XX:NewSize=4m',
-      '-classpath', classpath
-      ] + classes
-  return build_utils.CheckOutput(javap_cmd)
-
-
-def ExtractToc(disassembled_classes):
-  # javap output is structured by indent (2-space) levels.
-  good_patterns = [
-      '^[^ ]', # This includes all class/function/member signatures.
-      '^  SourceFile:',
-      '^  minor version:',
-      '^  major version:',
-      '^  Constant value:',
-      ]
-  bad_patterns = [
-      '^const #', # Matches the constant pool (i.e. literals used in the class).
-    ]
-
-  def JavapFilter(line):
-    return (re.match('|'.join(good_patterns), line) and
-        not re.match('|'.join(bad_patterns), line))
-  toc = filter(JavapFilter, disassembled_classes.split('\n'))
-
-  return '\n'.join(toc)
-
-
-def UpdateToc(jar_path, toc_path):
-  classes = GetClassesInZipFile(zipfile.ZipFile(jar_path))
-  toc = []
-
-  limit = 1000 # Split into multiple calls to stay under command size limit
-  for i in xrange(0, len(classes), limit):
-    javap_output = CallJavap(classpath=jar_path, classes=classes[i:i+limit])
-    toc.append(ExtractToc(javap_output))
-
-  with open(toc_path, 'w') as tocfile:
-    tocfile.write(''.join(toc))
-
-
-def DoJarToc(options):
-  jar_path = options.jar_path
-  toc_path = options.toc_path
-  record_path = '%s.md5.stamp' % toc_path
-  md5_check.CallAndRecordIfStale(
-      lambda: UpdateToc(jar_path, toc_path),
-      record_path=record_path,
-      input_paths=[jar_path],
-      force=not os.path.exists(toc_path),
-      )
-  build_utils.Touch(toc_path, fail_if_missing=True)
-
-
-def main():
-  parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(parser)
-
-  parser.add_option('--jar-path', help='Input .jar path.')
-  parser.add_option('--toc-path', help='Output .jar.TOC path.')
-  parser.add_option('--stamp', help='Path to touch on success.')
-
-  options, _ = parser.parse_args()
-
-  if options.depfile:
-    build_utils.WriteDepfile(
-        options.depfile,
-        build_utils.GetPythonDependencies())
-
-  DoJarToc(options)
-
-  if options.depfile:
-    build_utils.WriteDepfile(
-        options.depfile,
-        build_utils.GetPythonDependencies())
-
-  if options.stamp:
-    build_utils.Touch(options.stamp)
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/android/gyp/java_cpp_enum.py b/build/android/gyp/java_cpp_enum.py
deleted file mode 100755
index c2f1764..0000000
--- a/build/android/gyp/java_cpp_enum.py
+++ /dev/null
@@ -1,340 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import collections
-import re
-import optparse
-import os
-from string import Template
-import sys
-
-from util import build_utils
-
-# List of C++ types that are compatible with the Java code generated by this
-# script.
-#
-# This script can parse .idl files however, at present it ignores special
-# rules such as [cpp_enum_prefix_override="ax_attr"].
-ENUM_FIXED_TYPE_WHITELIST = ['char', 'unsigned char',
-  'short', 'unsigned short',
-  'int', 'int8_t', 'int16_t', 'int32_t', 'uint8_t', 'uint16_t']
-
-class EnumDefinition(object):
-  def __init__(self, original_enum_name=None, class_name_override=None,
-               enum_package=None, entries=None, fixed_type=None):
-    self.original_enum_name = original_enum_name
-    self.class_name_override = class_name_override
-    self.enum_package = enum_package
-    self.entries = collections.OrderedDict(entries or [])
-    self.prefix_to_strip = None
-    self.fixed_type = fixed_type
-
-  def AppendEntry(self, key, value):
-    if key in self.entries:
-      raise Exception('Multiple definitions of key %s found.' % key)
-    self.entries[key] = value
-
-  @property
-  def class_name(self):
-    return self.class_name_override or self.original_enum_name
-
-  def Finalize(self):
-    self._Validate()
-    self._AssignEntryIndices()
-    self._StripPrefix()
-
-  def _Validate(self):
-    assert self.class_name
-    assert self.enum_package
-    assert self.entries
-    if self.fixed_type and self.fixed_type not in ENUM_FIXED_TYPE_WHITELIST:
-      raise Exception('Fixed type %s for enum %s not whitelisted.' %
-          (self.fixed_type, self.class_name))
-
-  def _AssignEntryIndices(self):
-    # Enums, if given no value, are given the value of the previous enum + 1.
-    if not all(self.entries.values()):
-      prev_enum_value = -1
-      for key, value in self.entries.iteritems():
-        if not value:
-          self.entries[key] = prev_enum_value + 1
-        elif value in self.entries:
-          self.entries[key] = self.entries[value]
-        else:
-          try:
-            self.entries[key] = int(value)
-          except ValueError:
-            raise Exception('Could not interpret integer from enum value "%s" '
-                            'for key %s.' % (value, key))
-        prev_enum_value = self.entries[key]
-
-
-  def _StripPrefix(self):
-    prefix_to_strip = self.prefix_to_strip
-    if not prefix_to_strip:
-      prefix_to_strip = self.original_enum_name
-      prefix_to_strip = re.sub('(?!^)([A-Z]+)', r'_\1', prefix_to_strip).upper()
-      prefix_to_strip += '_'
-      if not all([w.startswith(prefix_to_strip) for w in self.entries.keys()]):
-        prefix_to_strip = ''
-
-    entries = collections.OrderedDict()
-    for (k, v) in self.entries.iteritems():
-      stripped_key = k.replace(prefix_to_strip, '', 1)
-      if isinstance(v, basestring):
-        stripped_value = v.replace(prefix_to_strip, '', 1)
-      else:
-        stripped_value = v
-      entries[stripped_key] = stripped_value
-
-    self.entries = entries
-
-class DirectiveSet(object):
-  class_name_override_key = 'CLASS_NAME_OVERRIDE'
-  enum_package_key = 'ENUM_PACKAGE'
-  prefix_to_strip_key = 'PREFIX_TO_STRIP'
-
-  known_keys = [class_name_override_key, enum_package_key, prefix_to_strip_key]
-
-  def __init__(self):
-    self._directives = {}
-
-  def Update(self, key, value):
-    if key not in DirectiveSet.known_keys:
-      raise Exception("Unknown directive: " + key)
-    self._directives[key] = value
-
-  @property
-  def empty(self):
-    return len(self._directives) == 0
-
-  def UpdateDefinition(self, definition):
-    definition.class_name_override = self._directives.get(
-        DirectiveSet.class_name_override_key, '')
-    definition.enum_package = self._directives.get(
-        DirectiveSet.enum_package_key)
-    definition.prefix_to_strip = self._directives.get(
-        DirectiveSet.prefix_to_strip_key)
-
-
-class HeaderParser(object):
-  single_line_comment_re = re.compile(r'\s*//')
-  multi_line_comment_start_re = re.compile(r'\s*/\*')
-  enum_line_re = re.compile(r'^\s*(\w+)(\s*\=\s*([^,\n]+))?,?')
-  enum_end_re = re.compile(r'^\s*}\s*;\.*$')
-  generator_directive_re = re.compile(
-      r'^\s*//\s+GENERATED_JAVA_(\w+)\s*:\s*([\.\w]+)$')
-  multi_line_generator_directive_start_re = re.compile(
-      r'^\s*//\s+GENERATED_JAVA_(\w+)\s*:\s*\(([\.\w]*)$')
-  multi_line_directive_continuation_re = re.compile(
-      r'^\s*//\s+([\.\w]+)$')
-  multi_line_directive_end_re = re.compile(
-      r'^\s*//\s+([\.\w]*)\)$')
-
-  optional_class_or_struct_re = r'(class|struct)?'
-  enum_name_re = r'(\w+)'
-  optional_fixed_type_re = r'(\:\s*(\w+\s*\w+?))?'
-  enum_start_re = re.compile(r'^\s*(?:\[cpp.*\])?\s*enum\s+' +
-      optional_class_or_struct_re + '\s*' + enum_name_re + '\s*' +
-      optional_fixed_type_re + '\s*{\s*$')
-
-  def __init__(self, lines, path=None):
-    self._lines = lines
-    self._path = path
-    self._enum_definitions = []
-    self._in_enum = False
-    self._current_definition = None
-    self._generator_directives = DirectiveSet()
-    self._multi_line_generator_directive = None
-
-  def _ApplyGeneratorDirectives(self):
-    self._generator_directives.UpdateDefinition(self._current_definition)
-    self._generator_directives = DirectiveSet()
-
-  def ParseDefinitions(self):
-    for line in self._lines:
-      self._ParseLine(line)
-    return self._enum_definitions
-
-  def _ParseLine(self, line):
-    if self._multi_line_generator_directive:
-      self._ParseMultiLineDirectiveLine(line)
-    elif not self._in_enum:
-      self._ParseRegularLine(line)
-    else:
-      self._ParseEnumLine(line)
-
-  def _ParseEnumLine(self, line):
-    if HeaderParser.single_line_comment_re.match(line):
-      return
-    if HeaderParser.multi_line_comment_start_re.match(line):
-      raise Exception('Multi-line comments in enums are not supported in ' +
-                      self._path)
-    enum_end = HeaderParser.enum_end_re.match(line)
-    enum_entry = HeaderParser.enum_line_re.match(line)
-    if enum_end:
-      self._ApplyGeneratorDirectives()
-      self._current_definition.Finalize()
-      self._enum_definitions.append(self._current_definition)
-      self._in_enum = False
-    elif enum_entry:
-      enum_key = enum_entry.groups()[0]
-      enum_value = enum_entry.groups()[2]
-      self._current_definition.AppendEntry(enum_key, enum_value)
-
-  def _ParseMultiLineDirectiveLine(self, line):
-    multi_line_directive_continuation = (
-        HeaderParser.multi_line_directive_continuation_re.match(line))
-    multi_line_directive_end = (
-        HeaderParser.multi_line_directive_end_re.match(line))
-
-    if multi_line_directive_continuation:
-      value_cont = multi_line_directive_continuation.groups()[0]
-      self._multi_line_generator_directive[1].append(value_cont)
-    elif multi_line_directive_end:
-      directive_name = self._multi_line_generator_directive[0]
-      directive_value = "".join(self._multi_line_generator_directive[1])
-      directive_value += multi_line_directive_end.groups()[0]
-      self._multi_line_generator_directive = None
-      self._generator_directives.Update(directive_name, directive_value)
-    else:
-      raise Exception('Malformed multi-line directive declaration in ' +
-                      self._path)
-
-  def _ParseRegularLine(self, line):
-    enum_start = HeaderParser.enum_start_re.match(line)
-    generator_directive = HeaderParser.generator_directive_re.match(line)
-    multi_line_generator_directive_start = (
-        HeaderParser.multi_line_generator_directive_start_re.match(line))
-
-    if generator_directive:
-      directive_name = generator_directive.groups()[0]
-      directive_value = generator_directive.groups()[1]
-      self._generator_directives.Update(directive_name, directive_value)
-    elif multi_line_generator_directive_start:
-      directive_name = multi_line_generator_directive_start.groups()[0]
-      directive_value = multi_line_generator_directive_start.groups()[1]
-      self._multi_line_generator_directive = (directive_name, [directive_value])
-    elif enum_start:
-      if self._generator_directives.empty:
-        return
-      self._current_definition = EnumDefinition(
-          original_enum_name=enum_start.groups()[1],
-          fixed_type=enum_start.groups()[3])
-      self._in_enum = True
-
-def GetScriptName():
-  script_components = os.path.abspath(sys.argv[0]).split(os.path.sep)
-  build_index = script_components.index('build')
-  return os.sep.join(script_components[build_index:])
-
-
-def DoGenerate(output_dir, source_paths, print_output_only=False):
-  output_paths = []
-  for source_path in source_paths:
-    enum_definitions = DoParseHeaderFile(source_path)
-    if not enum_definitions:
-      raise Exception('No enums found in %s\n'
-                      'Did you forget prefixing enums with '
-                      '"// GENERATED_JAVA_ENUM_PACKAGE: foo"?' %
-                      source_path)
-    for enum_definition in enum_definitions:
-      package_path = enum_definition.enum_package.replace('.', os.path.sep)
-      file_name = enum_definition.class_name + '.java'
-      output_path = os.path.join(output_dir, package_path, file_name)
-      output_paths.append(output_path)
-      if not print_output_only:
-        build_utils.MakeDirectory(os.path.dirname(output_path))
-        DoWriteOutput(source_path, output_path, enum_definition)
-  return output_paths
-
-
-def DoParseHeaderFile(path):
-  with open(path) as f:
-    return HeaderParser(f.readlines(), path).ParseDefinitions()
-
-
-def GenerateOutput(source_path, enum_definition):
-  template = Template("""
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This file is autogenerated by
-//     ${SCRIPT_NAME}
-// From
-//     ${SOURCE_PATH}
-
-package ${PACKAGE};
-
-public class ${CLASS_NAME} {
-${ENUM_ENTRIES}
-}
-""")
-
-  enum_template = Template('  public static final int ${NAME} = ${VALUE};')
-  enum_entries_string = []
-  for enum_name, enum_value in enum_definition.entries.iteritems():
-    values = {
-        'NAME': enum_name,
-        'VALUE': enum_value,
-    }
-    enum_entries_string.append(enum_template.substitute(values))
-  enum_entries_string = '\n'.join(enum_entries_string)
-
-  values = {
-      'CLASS_NAME': enum_definition.class_name,
-      'ENUM_ENTRIES': enum_entries_string,
-      'PACKAGE': enum_definition.enum_package,
-      'SCRIPT_NAME': GetScriptName(),
-      'SOURCE_PATH': source_path,
-  }
-  return template.substitute(values)
-
-
-def DoWriteOutput(source_path, output_path, enum_definition):
-  with open(output_path, 'w') as out_file:
-    out_file.write(GenerateOutput(source_path, enum_definition))
-
-def AssertFilesList(output_paths, assert_files_list):
-  actual = set(output_paths)
-  expected = set(assert_files_list)
-  if not actual == expected:
-    need_to_add = list(actual - expected)
-    need_to_remove = list(expected - actual)
-    raise Exception('Output files list does not match expectations. Please '
-                    'add %s and remove %s.' % (need_to_add, need_to_remove))
-
-def DoMain(argv):
-  usage = 'usage: %prog [options] output_dir input_file(s)...'
-  parser = optparse.OptionParser(usage=usage)
-
-  parser.add_option('--assert_file', action="append", default=[],
-                    dest="assert_files_list", help='Assert that the given '
-                    'file is an output. There can be multiple occurrences of '
-                    'this flag.')
-  parser.add_option('--print_output_only', help='Only print output paths.',
-                    action='store_true')
-  parser.add_option('--verbose', help='Print more information.',
-                    action='store_true')
-
-  options, args = parser.parse_args(argv)
-  if len(args) < 2:
-    parser.error('Need to specify output directory and at least one input file')
-  output_paths = DoGenerate(args[0], args[1:],
-                            print_output_only=options.print_output_only)
-
-  if options.assert_files_list:
-    AssertFilesList(output_paths, options.assert_files_list)
-
-  if options.verbose:
-    print 'Output paths:'
-    print '\n'.join(output_paths)
-
-  return ' '.join(output_paths)
-
-if __name__ == '__main__':
-  DoMain(sys.argv[1:])
diff --git a/build/android/gyp/java_cpp_enum_tests.py b/build/android/gyp/java_cpp_enum_tests.py
deleted file mode 100755
index 44f9766..0000000
--- a/build/android/gyp/java_cpp_enum_tests.py
+++ /dev/null
@@ -1,436 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Tests for enum_preprocess.py.
-
-This test suite containss various tests for the C++ -> Java enum generator.
-"""
-
-import collections
-import optparse
-import os
-import sys
-import unittest
-
-import java_cpp_enum
-from java_cpp_enum import EnumDefinition, GenerateOutput, GetScriptName
-from java_cpp_enum import HeaderParser
-
-sys.path.append(os.path.join(os.path.dirname(__file__), "gyp"))
-from util import build_utils
-
-class TestPreprocess(unittest.TestCase):
-  def testOutput(self):
-    definition = EnumDefinition(original_enum_name='ClassName',
-                                enum_package='some.package',
-                                entries=[('E1', 1), ('E2', '2 << 2')])
-    output = GenerateOutput('path/to/file', definition)
-    expected = """
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This file is autogenerated by
-//     %s
-// From
-//     path/to/file
-
-package some.package;
-
-public class ClassName {
-  public static final int E1 = 1;
-  public static final int E2 = 2 << 2;
-}
-"""
-    self.assertEqual(expected % GetScriptName(), output)
-
-  def testParseSimpleEnum(self):
-    test_data = """
-      // GENERATED_JAVA_ENUM_PACKAGE: test.namespace
-      enum EnumName {
-        VALUE_ZERO,
-        VALUE_ONE,
-      };
-    """.split('\n')
-    definitions = HeaderParser(test_data).ParseDefinitions()
-    self.assertEqual(1, len(definitions))
-    definition = definitions[0]
-    self.assertEqual('EnumName', definition.class_name)
-    self.assertEqual('test.namespace', definition.enum_package)
-    self.assertEqual(collections.OrderedDict([('VALUE_ZERO', 0),
-                                              ('VALUE_ONE', 1)]),
-                     definition.entries)
-
-  def testParseBitShifts(self):
-    test_data = """
-      // GENERATED_JAVA_ENUM_PACKAGE: test.namespace
-      enum EnumName {
-        VALUE_ZERO = 1 << 0,
-        VALUE_ONE = 1 << 1,
-      };
-    """.split('\n')
-    definitions = HeaderParser(test_data).ParseDefinitions()
-    self.assertEqual(1, len(definitions))
-    definition = definitions[0]
-    self.assertEqual('EnumName', definition.class_name)
-    self.assertEqual('test.namespace', definition.enum_package)
-    self.assertEqual(collections.OrderedDict([('VALUE_ZERO', '1 << 0'),
-                                              ('VALUE_ONE', '1 << 1')]),
-                     definition.entries)
-
-  def testParseClassNameOverride(self):
-    test_data = """
-      // GENERATED_JAVA_ENUM_PACKAGE: test.namespace
-      // GENERATED_JAVA_CLASS_NAME_OVERRIDE: OverrideName
-      enum EnumName {
-        FOO
-      };
-
-      // GENERATED_JAVA_ENUM_PACKAGE: test.namespace
-      // GENERATED_JAVA_CLASS_NAME_OVERRIDE: OtherOverride
-      enum PrefixTest {
-        PREFIX_TEST_A,
-        PREFIX_TEST_B,
-      };
-    """.split('\n')
-    definitions = HeaderParser(test_data).ParseDefinitions()
-    self.assertEqual(2, len(definitions))
-    definition = definitions[0]
-    self.assertEqual('OverrideName', definition.class_name)
-
-    definition = definitions[1]
-    self.assertEqual('OtherOverride', definition.class_name)
-    self.assertEqual(collections.OrderedDict([('A', 0),
-                                              ('B', 1)]),
-                     definition.entries)
-
-  def testParseTwoEnums(self):
-    test_data = """
-      // GENERATED_JAVA_ENUM_PACKAGE: test.namespace
-      enum EnumOne {
-        ENUM_ONE_A = 1,
-        // Comment there
-        ENUM_ONE_B = A,
-      };
-
-      enum EnumIgnore {
-        C, D, E
-      };
-
-      // GENERATED_JAVA_ENUM_PACKAGE: other.package
-      // GENERATED_JAVA_PREFIX_TO_STRIP: P_
-      enum EnumTwo {
-        P_A,
-        P_B
-      };
-    """.split('\n')
-    definitions = HeaderParser(test_data).ParseDefinitions()
-    self.assertEqual(2, len(definitions))
-    definition = definitions[0]
-    self.assertEqual('EnumOne', definition.class_name)
-    self.assertEqual('test.namespace', definition.enum_package)
-    self.assertEqual(collections.OrderedDict([('A', '1'),
-                                              ('B', 'A')]),
-                     definition.entries)
-
-    definition = definitions[1]
-    self.assertEqual('EnumTwo', definition.class_name)
-    self.assertEqual('other.package', definition.enum_package)
-    self.assertEqual(collections.OrderedDict([('A', 0),
-                                              ('B', 1)]),
-                     definition.entries)
-
-  def testParseThrowsOnUnknownDirective(self):
-    test_data = """
-      // GENERATED_JAVA_UNKNOWN: Value
-      enum EnumName {
-        VALUE_ONE,
-      };
-    """.split('\n')
-    with self.assertRaises(Exception):
-      HeaderParser(test_data).ParseDefinitions()
-
-  def testParseReturnsEmptyListWithoutDirectives(self):
-    test_data = """
-      enum EnumName {
-        VALUE_ONE,
-      };
-    """.split('\n')
-    self.assertEqual([], HeaderParser(test_data).ParseDefinitions())
-
-  def testParseEnumClass(self):
-    test_data = """
-      // GENERATED_JAVA_ENUM_PACKAGE: test.namespace
-      enum class Foo {
-        FOO_A,
-      };
-    """.split('\n')
-    definitions = HeaderParser(test_data).ParseDefinitions()
-    self.assertEqual(1, len(definitions))
-    definition = definitions[0]
-    self.assertEqual('Foo', definition.class_name)
-    self.assertEqual('test.namespace', definition.enum_package)
-    self.assertEqual(collections.OrderedDict([('A', 0)]),
-                     definition.entries)
-
-  def testParseEnumStruct(self):
-    test_data = """
-      // GENERATED_JAVA_ENUM_PACKAGE: test.namespace
-      enum struct Foo {
-        FOO_A,
-      };
-    """.split('\n')
-    definitions = HeaderParser(test_data).ParseDefinitions()
-    self.assertEqual(1, len(definitions))
-    definition = definitions[0]
-    self.assertEqual('Foo', definition.class_name)
-    self.assertEqual('test.namespace', definition.enum_package)
-    self.assertEqual(collections.OrderedDict([('A', 0)]),
-                     definition.entries)
-
-  def testParseFixedTypeEnum(self):
-    test_data = """
-      // GENERATED_JAVA_ENUM_PACKAGE: test.namespace
-      enum Foo : int {
-        FOO_A,
-      };
-    """.split('\n')
-    definitions = HeaderParser(test_data).ParseDefinitions()
-    self.assertEqual(1, len(definitions))
-    definition = definitions[0]
-    self.assertEqual('Foo', definition.class_name)
-    self.assertEqual('test.namespace', definition.enum_package)
-    self.assertEqual('int', definition.fixed_type)
-    self.assertEqual(collections.OrderedDict([('A', 0)]),
-                     definition.entries)
-
-  def testParseFixedTypeEnumClass(self):
-    test_data = """
-      // GENERATED_JAVA_ENUM_PACKAGE: test.namespace
-      enum class Foo: unsigned short {
-        FOO_A,
-      };
-    """.split('\n')
-    definitions = HeaderParser(test_data).ParseDefinitions()
-    self.assertEqual(1, len(definitions))
-    definition = definitions[0]
-    self.assertEqual('Foo', definition.class_name)
-    self.assertEqual('test.namespace', definition.enum_package)
-    self.assertEqual('unsigned short', definition.fixed_type)
-    self.assertEqual(collections.OrderedDict([('A', 0)]),
-                     definition.entries)
-
-  def testParseUnknownFixedTypeRaises(self):
-    test_data = """
-      // GENERATED_JAVA_ENUM_PACKAGE: test.namespace
-      enum class Foo: foo_type {
-        FOO_A,
-      };
-    """.split('\n')
-    with self.assertRaises(Exception):
-      HeaderParser(test_data).ParseDefinitions()
-
-  def testParseSimpleMultiLineDirective(self):
-    test_data = """
-      // GENERATED_JAVA_ENUM_PACKAGE: (
-      //   test.namespace)
-      // GENERATED_JAVA_CLASS_NAME_OVERRIDE: Bar
-      enum Foo {
-        FOO_A,
-      };
-    """.split('\n')
-    definitions = HeaderParser(test_data).ParseDefinitions()
-    self.assertEqual('test.namespace', definitions[0].enum_package)
-    self.assertEqual('Bar', definitions[0].class_name)
-
-  def testParseMultiLineDirective(self):
-    test_data = """
-      // GENERATED_JAVA_ENUM_PACKAGE: (te
-      //   st.name
-      //   space)
-      enum Foo {
-        FOO_A,
-      };
-    """.split('\n')
-    definitions = HeaderParser(test_data).ParseDefinitions()
-    self.assertEqual('test.namespace', definitions[0].enum_package)
-
-  def testParseMultiLineDirectiveWithOtherDirective(self):
-    test_data = """
-      // GENERATED_JAVA_ENUM_PACKAGE: (
-      //   test.namespace)
-      // GENERATED_JAVA_CLASS_NAME_OVERRIDE: (
-      //   Ba
-      //   r
-      //   )
-      enum Foo {
-        FOO_A,
-      };
-    """.split('\n')
-    definitions = HeaderParser(test_data).ParseDefinitions()
-    self.assertEqual('test.namespace', definitions[0].enum_package)
-    self.assertEqual('Bar', definitions[0].class_name)
-
-  def testParseMalformedMultiLineDirectiveWithOtherDirective(self):
-    test_data = """
-      // GENERATED_JAVA_ENUM_PACKAGE: (
-      //   test.name
-      //   space
-      // GENERATED_JAVA_CLASS_NAME_OVERRIDE: Bar
-      enum Foo {
-        FOO_A,
-      };
-    """.split('\n')
-    with self.assertRaises(Exception):
-      HeaderParser(test_data).ParseDefinitions()
-
-  def testParseMalformedMultiLineDirective(self):
-    test_data = """
-      // GENERATED_JAVA_ENUM_PACKAGE: (
-      //   test.name
-      //   space
-      enum Foo {
-        FOO_A,
-      };
-    """.split('\n')
-    with self.assertRaises(Exception):
-      HeaderParser(test_data).ParseDefinitions()
-
-  def testParseMalformedMultiLineDirectiveShort(self):
-    test_data = """
-      // GENERATED_JAVA_ENUM_PACKAGE: (
-      enum Foo {
-        FOO_A,
-      };
-    """.split('\n')
-    with self.assertRaises(Exception):
-      HeaderParser(test_data).ParseDefinitions()
-
-  def testEnumValueAssignmentNoneDefined(self):
-    definition = EnumDefinition(original_enum_name='c', enum_package='p')
-    definition.AppendEntry('A', None)
-    definition.AppendEntry('B', None)
-    definition.AppendEntry('C', None)
-    definition.Finalize()
-    self.assertEqual(collections.OrderedDict([('A', 0),
-                                              ('B', 1),
-                                              ('C', 2)]),
-                     definition.entries)
-
-  def testEnumValueAssignmentAllDefined(self):
-    definition = EnumDefinition(original_enum_name='c', enum_package='p')
-    definition.AppendEntry('A', '1')
-    definition.AppendEntry('B', '2')
-    definition.AppendEntry('C', '3')
-    definition.Finalize()
-    self.assertEqual(collections.OrderedDict([('A', '1'),
-                                              ('B', '2'),
-                                              ('C', '3')]),
-                     definition.entries)
-
-  def testEnumValueAssignmentReferences(self):
-    definition = EnumDefinition(original_enum_name='c', enum_package='p')
-    definition.AppendEntry('A', None)
-    definition.AppendEntry('B', 'A')
-    definition.AppendEntry('C', None)
-    definition.AppendEntry('D', 'C')
-    definition.Finalize()
-    self.assertEqual(collections.OrderedDict([('A', 0),
-                                              ('B', 0),
-                                              ('C', 1),
-                                              ('D', 1)]),
-                     definition.entries)
-
-  def testEnumValueAssignmentSet(self):
-    definition = EnumDefinition(original_enum_name='c', enum_package='p')
-    definition.AppendEntry('A', None)
-    definition.AppendEntry('B', '2')
-    definition.AppendEntry('C', None)
-    definition.Finalize()
-    self.assertEqual(collections.OrderedDict([('A', 0),
-                                              ('B', 2),
-                                              ('C', 3)]),
-                     definition.entries)
-
-  def testEnumValueAssignmentSetReferences(self):
-    definition = EnumDefinition(original_enum_name='c', enum_package='p')
-    definition.AppendEntry('A', None)
-    definition.AppendEntry('B', 'A')
-    definition.AppendEntry('C', 'B')
-    definition.AppendEntry('D', None)
-    definition.Finalize()
-    self.assertEqual(collections.OrderedDict([('A', 0),
-                                              ('B', 0),
-                                              ('C', 0),
-                                              ('D', 1)]),
-                     definition.entries)
-
-  def testEnumValueAssignmentRaises(self):
-    definition = EnumDefinition(original_enum_name='c', enum_package='p')
-    definition.AppendEntry('A', None)
-    definition.AppendEntry('B', 'foo')
-    definition.AppendEntry('C', None)
-    with self.assertRaises(Exception):
-      definition.Finalize()
-
-  def testExplicitPrefixStripping(self):
-    definition = EnumDefinition(original_enum_name='c', enum_package='p')
-    definition.AppendEntry('P_A', None)
-    definition.AppendEntry('B', None)
-    definition.AppendEntry('P_C', None)
-    definition.AppendEntry('P_LAST', 'P_C')
-    definition.prefix_to_strip = 'P_'
-    definition.Finalize()
-    self.assertEqual(collections.OrderedDict([('A', 0),
-                                              ('B', 1),
-                                              ('C', 2),
-                                              ('LAST', 2)]),
-                     definition.entries)
-
-  def testImplicitPrefixStripping(self):
-    definition = EnumDefinition(original_enum_name='ClassName',
-                                enum_package='p')
-    definition.AppendEntry('CLASS_NAME_A', None)
-    definition.AppendEntry('CLASS_NAME_B', None)
-    definition.AppendEntry('CLASS_NAME_C', None)
-    definition.AppendEntry('CLASS_NAME_LAST', 'CLASS_NAME_C')
-    definition.Finalize()
-    self.assertEqual(collections.OrderedDict([('A', 0),
-                                              ('B', 1),
-                                              ('C', 2),
-                                              ('LAST', 2)]),
-                     definition.entries)
-
-  def testImplicitPrefixStrippingRequiresAllConstantsToBePrefixed(self):
-    definition = EnumDefinition(original_enum_name='Name',
-                                enum_package='p')
-    definition.AppendEntry('A', None)
-    definition.AppendEntry('B', None)
-    definition.AppendEntry('NAME_LAST', None)
-    definition.Finalize()
-    self.assertEqual(['A', 'B', 'NAME_LAST'], definition.entries.keys())
-
-  def testGenerateThrowsOnEmptyInput(self):
-    with self.assertRaises(Exception):
-      original_do_parse = java_cpp_enum.DoParseHeaderFile
-      try:
-        java_cpp_enum.DoParseHeaderFile = lambda _: []
-        java_cpp_enum.DoGenerate('dir', ['file'])
-      finally:
-        java_cpp_enum.DoParseHeaderFile = original_do_parse
-
-def main(argv):
-  parser = optparse.OptionParser()
-  parser.add_option("--stamp", help="File to touch on success.")
-  options, _ = parser.parse_args(argv)
-
-  suite = unittest.TestLoader().loadTestsFromTestCase(TestPreprocess)
-  unittest.TextTestRunner(verbosity=0).run(suite)
-
-  if options.stamp:
-    build_utils.Touch(options.stamp)
-
-if __name__ == '__main__':
-  main(sys.argv[1:])
diff --git a/build/android/gyp/javac.py b/build/android/gyp/javac.py
deleted file mode 100755
index dafe5df..0000000
--- a/build/android/gyp/javac.py
+++ /dev/null
@@ -1,321 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import fnmatch
-import optparse
-import os
-import shutil
-import re
-import sys
-import textwrap
-
-from util import build_utils
-from util import md5_check
-
-import jar
-
-sys.path.append(build_utils.COLORAMA_ROOT)
-import colorama
-
-
-def ColorJavacOutput(output):
-  fileline_prefix = r'(?P<fileline>(?P<file>[-.\w/\\]+.java):(?P<line>[0-9]+):)'
-  warning_re = re.compile(
-      fileline_prefix + r'(?P<full_message> warning: (?P<message>.*))$')
-  error_re = re.compile(
-      fileline_prefix + r'(?P<full_message> (?P<message>.*))$')
-  marker_re = re.compile(r'\s*(?P<marker>\^)\s*$')
-
-  warning_color = ['full_message', colorama.Fore.YELLOW + colorama.Style.DIM]
-  error_color = ['full_message', colorama.Fore.MAGENTA + colorama.Style.BRIGHT]
-  marker_color = ['marker',  colorama.Fore.BLUE + colorama.Style.BRIGHT]
-
-  def Colorize(line, regex, color):
-    match = regex.match(line)
-    start = match.start(color[0])
-    end = match.end(color[0])
-    return (line[:start]
-            + color[1] + line[start:end]
-            + colorama.Fore.RESET + colorama.Style.RESET_ALL
-            + line[end:])
-
-  def ApplyColor(line):
-    if warning_re.match(line):
-      line = Colorize(line, warning_re, warning_color)
-    elif error_re.match(line):
-      line = Colorize(line, error_re, error_color)
-    elif marker_re.match(line):
-      line = Colorize(line, marker_re, marker_color)
-    return line
-
-  return '\n'.join(map(ApplyColor, output.split('\n')))
-
-
-ERRORPRONE_OPTIONS = [
-  '-Xepdisable:'
-  # Something in chrome_private_java makes this check crash.
-  'com.google.errorprone.bugpatterns.ClassCanBeStatic,'
-  # These crash on lots of targets.
-  'com.google.errorprone.bugpatterns.WrongParameterPackage,'
-  'com.google.errorprone.bugpatterns.GuiceOverridesGuiceInjectableMethod,'
-  'com.google.errorprone.bugpatterns.GuiceOverridesJavaxInjectableMethod,'
-  'com.google.errorprone.bugpatterns.ElementsCountedInLoop'
-]
-
-def DoJavac(
-    bootclasspath, classpath, classes_dir, chromium_code,
-    use_errorprone_path, java_files):
-  """Runs javac.
-
-  Builds |java_files| with the provided |classpath| and puts the generated
-  .class files into |classes_dir|. If |chromium_code| is true, extra lint
-  checking will be enabled.
-  """
-
-  jar_inputs = []
-  for path in classpath:
-    if os.path.exists(path + '.TOC'):
-      jar_inputs.append(path + '.TOC')
-    else:
-      jar_inputs.append(path)
-
-  javac_args = [
-      '-g',
-      # Chromium only allows UTF8 source files.  Being explicit avoids
-      # javac pulling a default encoding from the user's environment.
-      '-encoding', 'UTF-8',
-      '-classpath', ':'.join(classpath),
-      '-d', classes_dir]
-
-  if bootclasspath:
-    javac_args.extend([
-        '-bootclasspath', ':'.join(bootclasspath),
-        '-source', '1.7',
-        '-target', '1.7',
-        ])
-
-  if chromium_code:
-    # TODO(aurimas): re-enable '-Xlint:deprecation' checks once they are fixed.
-    javac_args.extend(['-Xlint:unchecked'])
-  else:
-    # XDignore.symbol.file makes javac compile against rt.jar instead of
-    # ct.sym. This means that using a java internal package/class will not
-    # trigger a compile warning or error.
-    javac_args.extend(['-XDignore.symbol.file'])
-
-  if use_errorprone_path:
-    javac_cmd = [use_errorprone_path] + ERRORPRONE_OPTIONS
-  else:
-    javac_cmd = ['javac']
-
-  javac_cmd = javac_cmd + javac_args + java_files
-
-  def Compile():
-    build_utils.CheckOutput(
-        javac_cmd,
-        print_stdout=chromium_code,
-        stderr_filter=ColorJavacOutput)
-
-  record_path = os.path.join(classes_dir, 'javac.md5.stamp')
-  md5_check.CallAndRecordIfStale(
-      Compile,
-      record_path=record_path,
-      input_paths=java_files + jar_inputs,
-      input_strings=javac_cmd)
-
-
-_MAX_MANIFEST_LINE_LEN = 72
-
-
-def CreateManifest(manifest_path, classpath, main_class=None,
-                   manifest_entries=None):
-  """Creates a manifest file with the given parameters.
-
-  This generates a manifest file that compiles with the spec found at
-  http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html#JAR_Manifest
-
-  Args:
-    manifest_path: The path to the manifest file that should be created.
-    classpath: The JAR files that should be listed on the manifest file's
-      classpath.
-    main_class: If present, the class containing the main() function.
-    manifest_entries: If present, a list of (key, value) pairs to add to
-      the manifest.
-
-  """
-  output = ['Manifest-Version: 1.0']
-  if main_class:
-    output.append('Main-Class: %s' % main_class)
-  if manifest_entries:
-    for k, v in manifest_entries:
-      output.append('%s: %s' % (k, v))
-  if classpath:
-    sanitized_paths = []
-    for path in classpath:
-      sanitized_paths.append(os.path.basename(path.strip('"')))
-    output.append('Class-Path: %s' % ' '.join(sanitized_paths))
-  output.append('Created-By: ')
-  output.append('')
-
-  wrapper = textwrap.TextWrapper(break_long_words=True,
-                                 drop_whitespace=False,
-                                 subsequent_indent=' ',
-                                 width=_MAX_MANIFEST_LINE_LEN - 2)
-  output = '\r\n'.join(w for l in output for w in wrapper.wrap(l))
-
-  with open(manifest_path, 'w') as f:
-    f.write(output)
-
-
-def main(argv):
-  colorama.init()
-
-  argv = build_utils.ExpandFileArgs(argv)
-
-  parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(parser)
-
-  parser.add_option(
-      '--src-gendirs',
-      help='Directories containing generated java files.')
-  parser.add_option(
-      '--java-srcjars',
-      action='append',
-      default=[],
-      help='List of srcjars to include in compilation.')
-  parser.add_option(
-      '--bootclasspath',
-      action='append',
-      default=[],
-      help='Boot classpath for javac. If this is specified multiple times, '
-      'they will all be appended to construct the classpath.')
-  parser.add_option(
-      '--classpath',
-      action='append',
-      help='Classpath for javac. If this is specified multiple times, they '
-      'will all be appended to construct the classpath.')
-  parser.add_option(
-      '--javac-includes',
-      help='A list of file patterns. If provided, only java files that match'
-      'one of the patterns will be compiled.')
-  parser.add_option(
-      '--jar-excluded-classes',
-      default='',
-      help='List of .class file patterns to exclude from the jar.')
-
-  parser.add_option(
-      '--chromium-code',
-      type='int',
-      help='Whether code being compiled should be built with stricter '
-      'warnings for chromium code.')
-
-  parser.add_option(
-      '--use-errorprone-path',
-      help='Use the Errorprone compiler at this path.')
-
-  parser.add_option(
-      '--classes-dir',
-      help='Directory for compiled .class files.')
-  parser.add_option('--jar-path', help='Jar output path.')
-  parser.add_option(
-      '--main-class',
-      help='The class containing the main method.')
-  parser.add_option(
-      '--manifest-entry',
-      action='append',
-      help='Key:value pairs to add to the .jar manifest.')
-
-  parser.add_option('--stamp', help='Path to touch on success.')
-
-  options, args = parser.parse_args(argv)
-
-  if options.main_class and not options.jar_path:
-    parser.error('--main-class requires --jar-path')
-
-  bootclasspath = []
-  for arg in options.bootclasspath:
-    bootclasspath += build_utils.ParseGypList(arg)
-
-  classpath = []
-  for arg in options.classpath:
-    classpath += build_utils.ParseGypList(arg)
-
-  java_srcjars = []
-  for arg in options.java_srcjars:
-    java_srcjars += build_utils.ParseGypList(arg)
-
-  java_files = args
-  if options.src_gendirs:
-    src_gendirs = build_utils.ParseGypList(options.src_gendirs)
-    java_files += build_utils.FindInDirectories(src_gendirs, '*.java')
-
-  input_files = bootclasspath + classpath + java_srcjars + java_files
-  with build_utils.TempDir() as temp_dir:
-    classes_dir = os.path.join(temp_dir, 'classes')
-    os.makedirs(classes_dir)
-    if java_srcjars:
-      java_dir = os.path.join(temp_dir, 'java')
-      os.makedirs(java_dir)
-      for srcjar in java_srcjars:
-        build_utils.ExtractAll(srcjar, path=java_dir, pattern='*.java')
-      java_files += build_utils.FindInDirectory(java_dir, '*.java')
-
-    if options.javac_includes:
-      javac_includes = build_utils.ParseGypList(options.javac_includes)
-      filtered_java_files = []
-      for f in java_files:
-        for include in javac_includes:
-          if fnmatch.fnmatch(f, include):
-            filtered_java_files.append(f)
-            break
-      java_files = filtered_java_files
-
-    if len(java_files) != 0:
-      DoJavac(
-          bootclasspath,
-          classpath,
-          classes_dir,
-          options.chromium_code,
-          options.use_errorprone_path,
-          java_files)
-
-    if options.jar_path:
-      if options.main_class or options.manifest_entry:
-        if options.manifest_entry:
-          entries = map(lambda e: e.split(":"), options.manifest_entry)
-        else:
-          entries = []
-        manifest_file = os.path.join(temp_dir, 'manifest')
-        CreateManifest(manifest_file, classpath, options.main_class, entries)
-      else:
-        manifest_file = None
-      jar.JarDirectory(classes_dir,
-                       build_utils.ParseGypList(options.jar_excluded_classes),
-                       options.jar_path,
-                       manifest_file=manifest_file)
-
-    if options.classes_dir:
-      # Delete the old classes directory. This ensures that all .class files in
-      # the output are actually from the input .java files. For example, if a
-      # .java file is deleted or an inner class is removed, the classes
-      # directory should not contain the corresponding old .class file after
-      # running this action.
-      build_utils.DeleteDirectory(options.classes_dir)
-      shutil.copytree(classes_dir, options.classes_dir)
-
-  if options.depfile:
-    build_utils.WriteDepfile(
-        options.depfile,
-        input_files + build_utils.GetPythonDependencies())
-
-  if options.stamp:
-    build_utils.Touch(options.stamp)
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
-
-
diff --git a/build/android/gyp/jinja_template.py b/build/android/gyp/jinja_template.py
deleted file mode 100755
index e7c9a34..0000000
--- a/build/android/gyp/jinja_template.py
+++ /dev/null
@@ -1,121 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Renders one or more template files using the Jinja template engine."""
-
-import codecs
-import optparse
-import os
-import sys
-
-from util import build_utils
-
-# Import jinja2 from third_party/jinja2
-sys.path.append(os.path.join(os.path.dirname(__file__), '../../../third_party'))
-import jinja2  # pylint: disable=F0401
-
-
-class RecordingFileSystemLoader(jinja2.FileSystemLoader):
-  '''A FileSystemLoader that stores a list of loaded templates.'''
-  def __init__(self, searchpath):
-    jinja2.FileSystemLoader.__init__(self, searchpath)
-    self.loaded_templates = set()
-
-  def get_source(self, environment, template):
-    contents, filename, uptodate = jinja2.FileSystemLoader.get_source(
-        self, environment, template)
-    self.loaded_templates.add(os.path.relpath(filename))
-    return contents, filename, uptodate
-
-  def get_loaded_templates(self):
-    return list(self.loaded_templates)
-
-
-def ProcessFile(env, input_filename, loader_base_dir, output_filename,
-                variables):
-  input_rel_path = os.path.relpath(input_filename, loader_base_dir)
-  template = env.get_template(input_rel_path)
-  output = template.render(variables)
-  with codecs.open(output_filename, 'w', 'utf-8') as output_file:
-    output_file.write(output)
-
-
-def ProcessFiles(env, input_filenames, loader_base_dir, inputs_base_dir,
-                 outputs_zip, variables):
-  with build_utils.TempDir() as temp_dir:
-    for input_filename in input_filenames:
-      relpath = os.path.relpath(os.path.abspath(input_filename),
-                                os.path.abspath(inputs_base_dir))
-      if relpath.startswith(os.pardir):
-        raise Exception('input file %s is not contained in inputs base dir %s'
-                        % (input_filename, inputs_base_dir))
-
-      output_filename = os.path.join(temp_dir, relpath)
-      parent_dir = os.path.dirname(output_filename)
-      build_utils.MakeDirectory(parent_dir)
-      ProcessFile(env, input_filename, loader_base_dir, output_filename,
-                  variables)
-
-    build_utils.ZipDir(outputs_zip, temp_dir)
-
-
-def main():
-  parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(parser)
-  parser.add_option('--inputs', help='The template files to process.')
-  parser.add_option('--output', help='The output file to generate. Valid '
-                    'only if there is a single input.')
-  parser.add_option('--outputs-zip', help='A zip file containing the processed '
-                    'templates. Required if there are multiple inputs.')
-  parser.add_option('--inputs-base-dir', help='A common ancestor directory of '
-                    'the inputs. Each output\'s path in the output zip will '
-                    'match the relative path from INPUTS_BASE_DIR to the '
-                    'input. Required if --output-zip is given.')
-  parser.add_option('--loader-base-dir', help='Base path used by the template '
-                    'loader. Must be a common ancestor directory of '
-                    'the inputs. Defaults to CHROMIUM_SRC.',
-                    default=build_utils.CHROMIUM_SRC)
-  parser.add_option('--variables', help='Variables to be made available in the '
-                    'template processing environment, as a GYP list (e.g. '
-                    '--variables "channel=beta mstone=39")', default='')
-  options, args = parser.parse_args()
-
-  build_utils.CheckOptions(options, parser, required=['inputs'])
-  inputs = build_utils.ParseGypList(options.inputs)
-
-  if (options.output is None) == (options.outputs_zip is None):
-    parser.error('Exactly one of --output and --output-zip must be given')
-  if options.output and len(inputs) != 1:
-    parser.error('--output cannot be used with multiple inputs')
-  if options.outputs_zip and not options.inputs_base_dir:
-    parser.error('--inputs-base-dir must be given when --output-zip is used')
-  if args:
-    parser.error('No positional arguments should be given.')
-
-  variables = {}
-  for v in build_utils.ParseGypList(options.variables):
-    if '=' not in v:
-      parser.error('--variables argument must contain "=": ' + v)
-    name, _, value = v.partition('=')
-    variables[name] = value
-
-  loader = RecordingFileSystemLoader(options.loader_base_dir)
-  env = jinja2.Environment(loader=loader, undefined=jinja2.StrictUndefined,
-                           line_comment_prefix='##')
-  if options.output:
-    ProcessFile(env, inputs[0], options.loader_base_dir, options.output,
-                variables)
-  else:
-    ProcessFiles(env, inputs, options.loader_base_dir, options.inputs_base_dir,
-                 options.outputs_zip, variables)
-
-  if options.depfile:
-    deps = loader.get_loaded_templates() + build_utils.GetPythonDependencies()
-    build_utils.WriteDepfile(options.depfile, deps)
-
-
-if __name__ == '__main__':
-  main()
diff --git a/build/android/gyp/lint.py b/build/android/gyp/lint.py
deleted file mode 100755
index 6c4645a..0000000
--- a/build/android/gyp/lint.py
+++ /dev/null
@@ -1,214 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Runs Android's lint tool."""
-
-
-import optparse
-import os
-import sys
-from xml.dom import minidom
-
-from util import build_utils
-
-
-_SRC_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__),
-                                         '..', '..', '..'))
-
-
-def _RunLint(lint_path, config_path, processed_config_path, manifest_path,
-             result_path, product_dir, sources, jar_path, resource_dir=None):
-
-  def _RelativizePath(path):
-    """Returns relative path to top-level src dir.
-
-    Args:
-      path: A path relative to cwd.
-    """
-    return os.path.relpath(os.path.abspath(path), _SRC_ROOT)
-
-  def _ProcessConfigFile():
-    if not build_utils.IsTimeStale(processed_config_path, [config_path]):
-      return
-
-    with open(config_path, 'rb') as f:
-      content = f.read().replace(
-          'PRODUCT_DIR', _RelativizePath(product_dir))
-
-    with open(processed_config_path, 'wb') as f:
-      f.write(content)
-
-  def _ProcessResultFile():
-    with open(result_path, 'rb') as f:
-      content = f.read().replace(
-          _RelativizePath(product_dir), 'PRODUCT_DIR')
-
-    with open(result_path, 'wb') as f:
-      f.write(content)
-
-  def _ParseAndShowResultFile():
-    dom = minidom.parse(result_path)
-    issues = dom.getElementsByTagName('issue')
-    print >> sys.stderr
-    for issue in issues:
-      issue_id = issue.attributes['id'].value
-      message = issue.attributes['message'].value
-      location_elem = issue.getElementsByTagName('location')[0]
-      path = location_elem.attributes['file'].value
-      line = location_elem.getAttribute('line')
-      if line:
-        error = '%s:%s %s: %s [warning]' % (path, line, message, issue_id)
-      else:
-        # Issues in class files don't have a line number.
-        error = '%s %s: %s [warning]' % (path, message, issue_id)
-      print >> sys.stderr, error
-      for attr in ['errorLine1', 'errorLine2']:
-        error_line = issue.getAttribute(attr)
-        if error_line:
-          print >> sys.stderr, error_line
-    return len(issues)
-
-  with build_utils.TempDir() as temp_dir:
-    _ProcessConfigFile()
-
-    cmd = [
-        _RelativizePath(lint_path), '-Werror', '--exitcode', '--showall',
-        '--config', _RelativizePath(processed_config_path),
-        '--classpath', _RelativizePath(jar_path),
-        '--xml', _RelativizePath(result_path),
-    ]
-    if resource_dir:
-      cmd.extend(['--resources', _RelativizePath(resource_dir)])
-
-    # There may be multiple source files with the same basename (but in
-    # different directories). It is difficult to determine what part of the path
-    # corresponds to the java package, and so instead just link the source files
-    # into temporary directories (creating a new one whenever there is a name
-    # conflict).
-    src_dirs = []
-    def NewSourceDir():
-      new_dir = os.path.join(temp_dir, str(len(src_dirs)))
-      os.mkdir(new_dir)
-      src_dirs.append(new_dir)
-      cmd.extend(['--sources', _RelativizePath(new_dir)])
-      return new_dir
-
-    def PathInDir(d, src):
-      return os.path.join(d, os.path.basename(src))
-
-    for src in sources:
-      src_dir = None
-      for d in src_dirs:
-        if not os.path.exists(PathInDir(d, src)):
-          src_dir = d
-          break
-      if not src_dir:
-        src_dir = NewSourceDir()
-      os.symlink(os.path.abspath(src), PathInDir(src_dir, src))
-
-    cmd.append(_RelativizePath(os.path.join(manifest_path, os.pardir)))
-
-    if os.path.exists(result_path):
-      os.remove(result_path)
-
-    try:
-      build_utils.CheckOutput(cmd, cwd=_SRC_ROOT)
-    except build_utils.CalledProcessError as e:
-      # There is a problem with lint usage
-      if not os.path.exists(result_path):
-        print 'Something is wrong:'
-        print e
-        return 1
-
-      # There are actual lint issues
-      else:
-        try:
-          num_issues = _ParseAndShowResultFile()
-        except Exception:
-          print 'Lint created unparseable xml file...'
-          print 'File contents:'
-          with open(result_path) as f:
-            print f.read()
-          return 1
-
-        _ProcessResultFile()
-        msg = ('\nLint found %d new issues.\n'
-               ' - For full explanation refer to %s\n'
-               ' - Wanna suppress these issues?\n'
-               '    1. Read comment in %s\n'
-               '    2. Run "python %s %s"\n' %
-               (num_issues,
-                _RelativizePath(result_path),
-                _RelativizePath(config_path),
-                _RelativizePath(os.path.join(_SRC_ROOT, 'build', 'android',
-                                             'lint', 'suppress.py')),
-                _RelativizePath(result_path)))
-        print >> sys.stderr, msg
-        return 1
-
-  return 0
-
-
-def main():
-  parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(parser)
-  parser.add_option('--lint-path', help='Path to lint executable.')
-  parser.add_option('--config-path', help='Path to lint suppressions file.')
-  parser.add_option('--processed-config-path',
-                    help='Path to processed lint suppressions file.')
-  parser.add_option('--manifest-path', help='Path to AndroidManifest.xml')
-  parser.add_option('--result-path', help='Path to XML lint result file.')
-  parser.add_option('--product-dir', help='Path to product dir.')
-  parser.add_option('--src-dirs', help='Directories containing java files.')
-  parser.add_option('--java-files', help='Paths to java files.')
-  parser.add_option('--jar-path', help='Jar file containing class files.')
-  parser.add_option('--resource-dir', help='Path to resource dir.')
-  parser.add_option('--can-fail-build', action='store_true',
-                    help='If set, script will exit with nonzero exit status'
-                    ' if lint errors are present')
-  parser.add_option('--stamp', help='Path to touch on success.')
-  parser.add_option('--enable', action='store_true',
-                    help='Run lint instead of just touching stamp.')
-
-  options, _ = parser.parse_args()
-
-  build_utils.CheckOptions(
-      options, parser, required=['lint_path', 'config_path',
-                                 'processed_config_path', 'manifest_path',
-                                 'result_path', 'product_dir',
-                                 'jar_path'])
-
-  rc = 0
-
-  if options.enable:
-    sources = []
-    if options.src_dirs:
-      src_dirs = build_utils.ParseGypList(options.src_dirs)
-      sources = build_utils.FindInDirectories(src_dirs, '*.java')
-    elif options.java_files:
-      sources = build_utils.ParseGypList(options.java_files)
-    else:
-      print 'One of --src-dirs or --java-files must be specified.'
-      return 1
-    rc = _RunLint(options.lint_path, options.config_path,
-                  options.processed_config_path,
-                  options.manifest_path, options.result_path,
-                  options.product_dir, sources, options.jar_path,
-                  options.resource_dir)
-
-  if options.depfile:
-    build_utils.WriteDepfile(
-        options.depfile,
-        build_utils.GetPythonDependencies())
-
-  if options.stamp and not rc:
-    build_utils.Touch(options.stamp)
-
-  return rc if options.can_fail_build else 0
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/android/gyp/locale_pak_resources.py b/build/android/gyp/locale_pak_resources.py
deleted file mode 100755
index 84c4a37..0000000
--- a/build/android/gyp/locale_pak_resources.py
+++ /dev/null
@@ -1,126 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-"""Creates a resources.zip for locale .pak files.
-
-Places the locale.pak files into appropriate resource configs
-(e.g. en-GB.pak -> res/raw-en/en_gb.lpak). Also generates a locale_paks
-TypedArray so that resource files can be enumerated at runtime.
-"""
-
-import collections
-import optparse
-import os
-import sys
-import zipfile
-
-from util import build_utils
-
-
-# This should stay in sync with:
-# base/android/java/src/org/chromium/base/LocaleUtils.java
-_CHROME_TO_ANDROID_LOCALE_MAP = {
-    'he': 'iw',
-    'id': 'in',
-    'fil': 'tl',
-}
-
-
-def ToResourceFileName(name):
-  """Returns the resource-compatible file name for the given file."""
-  # Resources file names must consist of [a-z0-9_.].
-  # Changes extension to .lpak so that compression can be toggled separately for
-  # locale pak files vs other pak files.
-  return name.replace('-', '_').replace('.pak', '.lpak').lower()
-
-
-def CreateLocalePaksXml(names):
-  """Creates the contents for the locale-paks.xml files."""
-  VALUES_FILE_TEMPLATE = '''<?xml version="1.0" encoding="utf-8"?>
-<resources>
-  <array name="locale_paks">%s
-  </array>
-</resources>
-'''
-  VALUES_ITEM_TEMPLATE = '''
-    <item>@raw/%s</item>'''
-
-  res_names = (os.path.splitext(name)[0] for name in names)
-  items = ''.join((VALUES_ITEM_TEMPLATE % name for name in res_names))
-  return VALUES_FILE_TEMPLATE % items
-
-
-def ComputeMappings(sources):
-  """Computes the mappings of sources -> resources.
-
-  Returns a tuple of:
-    - mappings: List of (src, dest) paths
-    - lang_to_locale_map: Map of language -> list of resource names
-      e.g. "en" -> ["en_gb.lpak"]
-  """
-  lang_to_locale_map = collections.defaultdict(list)
-  mappings = []
-  for src_path in sources:
-    basename = os.path.basename(src_path)
-    name = os.path.splitext(basename)[0]
-    res_name = ToResourceFileName(basename)
-    if name == 'en-US':
-      dest_dir = 'raw'
-    else:
-      # Chrome's uses different region mapping logic from Android, so include
-      # all regions for each language.
-      android_locale = _CHROME_TO_ANDROID_LOCALE_MAP.get(name, name)
-      lang = android_locale[0:2]
-      dest_dir = 'raw-' + lang
-      lang_to_locale_map[lang].append(res_name)
-    mappings.append((src_path, os.path.join(dest_dir, res_name)))
-  return mappings, lang_to_locale_map
-
-
-def main():
-  parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(parser)
-  parser.add_option('--locale-paks', help='List of files for res/raw-LOCALE')
-  parser.add_option('--resources-zip', help='Path to output resources.zip')
-  parser.add_option('--print-languages',
-      action='store_true',
-      help='Print out the list of languages that cover the given locale paks '
-           '(using Android\'s language codes)')
-
-  options, _ = parser.parse_args()
-  build_utils.CheckOptions(options, parser,
-                           required=['locale_paks'])
-
-  sources = build_utils.ParseGypList(options.locale_paks)
-
-  if options.depfile:
-    deps = sources + build_utils.GetPythonDependencies()
-    build_utils.WriteDepfile(options.depfile, deps)
-
-  mappings, lang_to_locale_map = ComputeMappings(sources)
-  if options.print_languages:
-    print '\n'.join(sorted(lang_to_locale_map))
-
-  if options.resources_zip:
-    with zipfile.ZipFile(options.resources_zip, 'w', zipfile.ZIP_STORED) as out:
-      for mapping in mappings:
-        out.write(mapping[0], mapping[1])
-
-      # Create TypedArray resources so ResourceExtractor can enumerate files.
-      def WriteValuesFile(lang, names):
-        dest_dir = 'values'
-        if lang:
-          dest_dir += '-' + lang
-        # Always extract en-US.lpak since it's the fallback.
-        xml = CreateLocalePaksXml(names + ['en_us.lpak'])
-        out.writestr(os.path.join(dest_dir, 'locale-paks.xml'), xml)
-
-      for lang, names in lang_to_locale_map.iteritems():
-        WriteValuesFile(lang, names)
-      WriteValuesFile(None, [])
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/android/gyp/pack_relocations.py b/build/android/gyp/pack_relocations.py
deleted file mode 100755
index 02e4499..0000000
--- a/build/android/gyp/pack_relocations.py
+++ /dev/null
@@ -1,107 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Pack relocations in a library (or copy unchanged).
-
-If --enable-packing and --configuration-name=='Release', invoke the
-relocation_packer tool to pack the .rel.dyn or .rela.dyn section in the given
-library files.  This step is inserted after the libraries are stripped.
-
-If --enable-packing is zero, the script copies files verbatim, with no
-attempt to pack relocations.
-
-Any library listed in --exclude-packing-list is also copied verbatim,
-irrespective of any --enable-packing setting.  Typically this would be
-'libchromium_android_linker.so'.
-"""
-
-import optparse
-import os
-import shlex
-import shutil
-import sys
-import tempfile
-
-from util import build_utils
-
-def PackLibraryRelocations(android_pack_relocations, library_path, output_path):
-  shutil.copy(library_path, output_path)
-  pack_command = [android_pack_relocations, output_path]
-  build_utils.CheckOutput(pack_command)
-
-
-def CopyLibraryUnchanged(library_path, output_path):
-  shutil.copy(library_path, output_path)
-
-
-def main(args):
-  args = build_utils.ExpandFileArgs(args)
-  parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(parser)
-  parser.add_option('--clear-dir', action='store_true',
-                    help='If set, the destination directory will be deleted '
-                    'before copying files to it. This is highly recommended to '
-                    'ensure that no stale files are left in the directory.')
-
-  parser.add_option('--configuration-name',
-      default='Release',
-      help='Gyp configuration name (i.e. Debug, Release)')
-  parser.add_option('--enable-packing',
-      choices=['0', '1'],
-      help=('Pack relocations if 1 and configuration name is \'Release\','
-            ' otherwise plain file copy'))
-  parser.add_option('--exclude-packing-list',
-      default='',
-      help='Names of any libraries explicitly not packed')
-  parser.add_option('--android-pack-relocations',
-      help='Path to the relocations packer binary')
-  parser.add_option('--stripped-libraries-dir',
-      help='Directory for stripped libraries')
-  parser.add_option('--packed-libraries-dir',
-      help='Directory for packed libraries')
-  parser.add_option('--libraries', action='append',
-      help='List of libraries')
-  parser.add_option('--stamp', help='Path to touch on success')
-
-  options, _ = parser.parse_args(args)
-  enable_packing = (options.enable_packing == '1' and
-                    options.configuration_name == 'Release')
-  exclude_packing_set = set(shlex.split(options.exclude_packing_list))
-
-  libraries = []
-  for libs_arg in options.libraries:
-    libraries += build_utils.ParseGypList(libs_arg)
-
-  if options.clear_dir:
-    build_utils.DeleteDirectory(options.packed_libraries_dir)
-
-  build_utils.MakeDirectory(options.packed_libraries_dir)
-
-  for library in libraries:
-    library_path = os.path.join(options.stripped_libraries_dir, library)
-    output_path = os.path.join(
-        options.packed_libraries_dir, os.path.basename(library))
-
-    if enable_packing and library not in exclude_packing_set:
-      PackLibraryRelocations(options.android_pack_relocations,
-                             library_path,
-                             output_path)
-    else:
-      CopyLibraryUnchanged(library_path, output_path)
-
-  if options.depfile:
-    build_utils.WriteDepfile(
-        options.depfile,
-        libraries + build_utils.GetPythonDependencies())
-
-  if options.stamp:
-    build_utils.Touch(options.stamp)
-
-  return 0
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
diff --git a/build/android/gyp/package_resources.py b/build/android/gyp/package_resources.py
deleted file mode 100755
index d17d1fe..0000000
--- a/build/android/gyp/package_resources.py
+++ /dev/null
@@ -1,270 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# pylint: disable=C0301
-"""Package resources into an apk.
-
-See https://android.googlesource.com/platform/tools/base/+/master/legacy/ant-tasks/src/main/java/com/android/ant/AaptExecTask.java
-and
-https://android.googlesource.com/platform/sdk/+/master/files/ant/build.xml
-"""
-# pylint: enable=C0301
-
-import optparse
-import os
-import re
-import shutil
-import zipfile
-
-from util import build_utils
-
-
-# List is generated from the chrome_apk.apk_intermediates.ap_ via:
-#     unzip -l $FILE_AP_ | cut -c31- | grep res/draw | cut -d'/' -f 2 | sort \
-#     | uniq | grep -- -tvdpi- | cut -c10-
-# and then manually sorted.
-# Note that we can't just do a cross-product of dimentions because the filenames
-# become too big and aapt fails to create the files.
-# This leaves all default drawables (mdpi) in the main apk. Android gets upset
-# though if any drawables are missing from the default drawables/ directory.
-DENSITY_SPLITS = {
-    'hdpi': (
-        'hdpi-v4', # Order matters for output file names.
-        'ldrtl-hdpi-v4',
-        'sw600dp-hdpi-v13',
-        'ldrtl-hdpi-v17',
-        'ldrtl-sw600dp-hdpi-v17',
-        'hdpi-v21',
-    ),
-    'xhdpi': (
-        'xhdpi-v4',
-        'ldrtl-xhdpi-v4',
-        'sw600dp-xhdpi-v13',
-        'ldrtl-xhdpi-v17',
-        'ldrtl-sw600dp-xhdpi-v17',
-        'xhdpi-v21',
-    ),
-    'xxhdpi': (
-        'xxhdpi-v4',
-        'ldrtl-xxhdpi-v4',
-        'sw600dp-xxhdpi-v13',
-        'ldrtl-xxhdpi-v17',
-        'ldrtl-sw600dp-xxhdpi-v17',
-        'xxhdpi-v21',
-    ),
-    'xxxhdpi': (
-        'xxxhdpi-v4',
-        'ldrtl-xxxhdpi-v4',
-        'sw600dp-xxxhdpi-v13',
-        'ldrtl-xxxhdpi-v17',
-        'ldrtl-sw600dp-xxxhdpi-v17',
-        'xxxhdpi-v21',
-    ),
-    'tvdpi': (
-        'tvdpi-v4',
-        'sw600dp-tvdpi-v13',
-        'ldrtl-sw600dp-tvdpi-v17',
-    ),
-}
-
-
-def ParseArgs():
-  """Parses command line options.
-
-  Returns:
-    An options object as from optparse.OptionsParser.parse_args()
-  """
-  parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(parser)
-  parser.add_option('--android-sdk', help='path to the Android SDK folder')
-  parser.add_option('--aapt-path',
-                    help='path to the Android aapt tool')
-
-  parser.add_option('--configuration-name',
-                    help='Gyp\'s configuration name (Debug or Release).')
-
-  parser.add_option('--android-manifest', help='AndroidManifest.xml path')
-  parser.add_option('--version-code', help='Version code for apk.')
-  parser.add_option('--version-name', help='Version name for apk.')
-  parser.add_option(
-      '--shared-resources',
-      action='store_true',
-      help='Make a resource package that can be loaded by a different'
-      'application at runtime to access the package\'s resources.')
-  parser.add_option('--resource-zips',
-                    help='zip files containing resources to be packaged')
-  parser.add_option('--asset-dir',
-                    help='directories containing assets to be packaged')
-  parser.add_option('--no-compress', help='disables compression for the '
-                    'given comma separated list of extensions')
-  parser.add_option(
-      '--create-density-splits',
-      action='store_true',
-      help='Enables density splits')
-  parser.add_option('--language-splits',
-                    help='GYP list of languages to create splits for')
-
-  parser.add_option('--apk-path',
-                    help='Path to output (partial) apk.')
-
-  (options, args) = parser.parse_args()
-
-  if args:
-    parser.error('No positional arguments should be given.')
-
-  # Check that required options have been provided.
-  required_options = ('android_sdk', 'aapt_path', 'configuration_name',
-                      'android_manifest', 'version_code', 'version_name',
-                      'apk_path')
-
-  build_utils.CheckOptions(options, parser, required=required_options)
-
-  return options
-
-
-def MoveImagesToNonMdpiFolders(res_root):
-  """Move images from drawable-*-mdpi-* folders to drawable-* folders.
-
-  Why? http://crbug.com/289843
-  """
-  for src_dir_name in os.listdir(res_root):
-    src_components = src_dir_name.split('-')
-    if src_components[0] != 'drawable' or 'mdpi' not in src_components:
-      continue
-    src_dir = os.path.join(res_root, src_dir_name)
-    if not os.path.isdir(src_dir):
-      continue
-    dst_components = [c for c in src_components if c != 'mdpi']
-    assert dst_components != src_components
-    dst_dir_name = '-'.join(dst_components)
-    dst_dir = os.path.join(res_root, dst_dir_name)
-    build_utils.MakeDirectory(dst_dir)
-    for src_file_name in os.listdir(src_dir):
-      if not src_file_name.endswith('.png'):
-        continue
-      src_file = os.path.join(src_dir, src_file_name)
-      dst_file = os.path.join(dst_dir, src_file_name)
-      assert not os.path.lexists(dst_file)
-      shutil.move(src_file, dst_file)
-
-
-def PackageArgsForExtractedZip(d):
-  """Returns the aapt args for an extracted resources zip.
-
-  A resources zip either contains the resources for a single target or for
-  multiple targets. If it is multiple targets merged into one, the actual
-  resource directories will be contained in the subdirectories 0, 1, 2, ...
-  """
-  subdirs = [os.path.join(d, s) for s in os.listdir(d)]
-  subdirs = [s for s in subdirs if os.path.isdir(s)]
-  is_multi = '0' in [os.path.basename(s) for s in subdirs]
-  if is_multi:
-    res_dirs = sorted(subdirs, key=lambda p : int(os.path.basename(p)))
-  else:
-    res_dirs = [d]
-  package_command = []
-  for d in res_dirs:
-    MoveImagesToNonMdpiFolders(d)
-    package_command += ['-S', d]
-  return package_command
-
-
-def RenameDensitySplits(apk_path):
-  """Renames all density splits to have shorter / predictable names."""
-  for density, config in DENSITY_SPLITS.iteritems():
-    src_path = '%s_%s' % (apk_path, '_'.join(config))
-    dst_path = '%s_%s' % (apk_path, density)
-    if src_path != dst_path:
-      if os.path.exists(dst_path):
-        os.unlink(dst_path)
-      os.rename(src_path, dst_path)
-
-
-def CheckForMissedConfigs(apk_path, check_density, languages):
-  """Raises an exception if apk_path contains any unexpected configs."""
-  triggers = []
-  if check_density:
-    triggers.extend(re.compile('-%s' % density) for density in DENSITY_SPLITS)
-  if languages:
-    triggers.extend(re.compile(r'-%s\b' % lang) for lang in languages)
-  with zipfile.ZipFile(apk_path) as main_apk_zip:
-    for name in main_apk_zip.namelist():
-      for trigger in triggers:
-        if trigger.search(name) and not 'mipmap-' in name:
-          raise Exception(('Found config in main apk that should have been ' +
-                           'put into a split: %s\nYou need to update ' +
-                           'package_resources.py to include this new ' +
-                           'config (trigger=%s)') % (name, trigger.pattern))
-
-
-def main():
-  options = ParseArgs()
-  android_jar = os.path.join(options.android_sdk, 'android.jar')
-  aapt = options.aapt_path
-
-  with build_utils.TempDir() as temp_dir:
-    package_command = [aapt,
-                       'package',
-                       '--version-code', options.version_code,
-                       '--version-name', options.version_name,
-                       '-M', options.android_manifest,
-                       '--no-crunch',
-                       '-f',
-                       '--auto-add-overlay',
-                       '-I', android_jar,
-                       '-F', options.apk_path,
-                       '--ignore-assets', build_utils.AAPT_IGNORE_PATTERN,
-                       ]
-
-    if options.no_compress:
-      for ext in options.no_compress.split(','):
-        package_command += ['-0', ext]
-    if options.shared_resources:
-      package_command.append('--shared-lib')
-
-    if options.asset_dir and os.path.exists(options.asset_dir):
-      package_command += ['-A', options.asset_dir]
-
-    if options.resource_zips:
-      dep_zips = build_utils.ParseGypList(options.resource_zips)
-      for z in dep_zips:
-        subdir = os.path.join(temp_dir, os.path.basename(z))
-        if os.path.exists(subdir):
-          raise Exception('Resource zip name conflict: ' + os.path.basename(z))
-        build_utils.ExtractAll(z, path=subdir)
-        package_command += PackageArgsForExtractedZip(subdir)
-
-    if options.create_density_splits:
-      for config in DENSITY_SPLITS.itervalues():
-        package_command.extend(('--split', ','.join(config)))
-
-    language_splits = None
-    if options.language_splits:
-      language_splits = build_utils.ParseGypList(options.language_splits)
-      for lang in language_splits:
-        package_command.extend(('--split', lang))
-
-    if 'Debug' in options.configuration_name:
-      package_command += ['--debug-mode']
-
-    build_utils.CheckOutput(
-        package_command, print_stdout=False, print_stderr=False)
-
-    if options.create_density_splits or language_splits:
-      CheckForMissedConfigs(
-          options.apk_path, options.create_density_splits, language_splits)
-
-    if options.create_density_splits:
-      RenameDensitySplits(options.apk_path)
-
-    if options.depfile:
-      build_utils.WriteDepfile(
-          options.depfile,
-          build_utils.GetPythonDependencies())
-
-
-if __name__ == '__main__':
-  main()
diff --git a/build/android/gyp/process_resources.py b/build/android/gyp/process_resources.py
deleted file mode 100755
index d227954..0000000
--- a/build/android/gyp/process_resources.py
+++ /dev/null
@@ -1,420 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Process Android resources to generate R.java, and prepare for packaging.
-
-This will crunch images and generate v14 compatible resources
-(see generate_v14_compatible_resources.py).
-"""
-
-import codecs
-import optparse
-import os
-import re
-import shutil
-import sys
-import zipfile
-
-import generate_v14_compatible_resources
-
-from util import build_utils
-
-# Import jinja2 from third_party/jinja2
-sys.path.insert(1,
-    os.path.join(os.path.dirname(__file__), '../../../third_party'))
-from jinja2 import Template # pylint: disable=F0401
-
-
-def ParseArgs(args):
-  """Parses command line options.
-
-  Returns:
-    An options object as from optparse.OptionsParser.parse_args()
-  """
-  parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(parser)
-
-  parser.add_option('--android-sdk', help='path to the Android SDK folder')
-  parser.add_option('--aapt-path',
-                    help='path to the Android aapt tool')
-  parser.add_option('--non-constant-id', action='store_true')
-
-  parser.add_option('--android-manifest', help='AndroidManifest.xml path')
-  parser.add_option('--custom-package', help='Java package for R.java')
-  parser.add_option(
-      '--shared-resources',
-      action='store_true',
-      help='Make a resource package that can be loaded by a different'
-      'application at runtime to access the package\'s resources.')
-
-  parser.add_option('--resource-dirs',
-                    help='Directories containing resources of this target.')
-  parser.add_option('--dependencies-res-zips',
-                    help='Resources from dependents.')
-
-  parser.add_option('--resource-zip-out',
-                    help='Path for output zipped resources.')
-
-  parser.add_option('--R-dir',
-                    help='directory to hold generated R.java.')
-  parser.add_option('--srcjar-out',
-                    help='Path to srcjar to contain generated R.java.')
-  parser.add_option('--r-text-out',
-                    help='Path to store the R.txt file generated by appt.')
-
-  parser.add_option('--proguard-file',
-                    help='Path to proguard.txt generated file')
-
-  parser.add_option(
-      '--v14-skip',
-      action="store_true",
-      help='Do not generate nor verify v14 resources')
-
-  parser.add_option(
-      '--extra-res-packages',
-      help='Additional package names to generate R.java files for')
-  parser.add_option(
-      '--extra-r-text-files',
-      help='For each additional package, the R.txt file should contain a '
-      'list of resources to be included in the R.java file in the format '
-      'generated by aapt')
-  parser.add_option(
-      '--include-all-resources',
-      action='store_true',
-      help='Include every resource ID in every generated R.java file '
-      '(ignoring R.txt).')
-
-  parser.add_option(
-      '--all-resources-zip-out',
-      help='Path for output of all resources. This includes resources in '
-      'dependencies.')
-
-  parser.add_option('--stamp', help='File to touch on success')
-
-  (options, args) = parser.parse_args(args)
-
-  if args:
-    parser.error('No positional arguments should be given.')
-
-  # Check that required options have been provided.
-  required_options = (
-      'android_sdk',
-      'aapt_path',
-      'android_manifest',
-      'dependencies_res_zips',
-      'resource_dirs',
-      'resource_zip_out',
-      )
-  build_utils.CheckOptions(options, parser, required=required_options)
-
-  if (options.R_dir is None) == (options.srcjar_out is None):
-    raise Exception('Exactly one of --R-dir or --srcjar-out must be specified.')
-
-  return options
-
-
-def CreateExtraRJavaFiles(
-      r_dir, extra_packages, extra_r_text_files, shared_resources, include_all):
-  if include_all:
-    java_files = build_utils.FindInDirectory(r_dir, "R.java")
-    if len(java_files) != 1:
-      return
-    r_java_file = java_files[0]
-    r_java_contents = codecs.open(r_java_file, encoding='utf-8').read()
-
-    for package in extra_packages:
-      package_r_java_dir = os.path.join(r_dir, *package.split('.'))
-      build_utils.MakeDirectory(package_r_java_dir)
-      package_r_java_path = os.path.join(package_r_java_dir, 'R.java')
-      new_r_java = re.sub(r'package [.\w]*;', u'package %s;' % package,
-                          r_java_contents)
-      codecs.open(package_r_java_path, 'w', encoding='utf-8').write(new_r_java)
-  else:
-    if len(extra_packages) != len(extra_r_text_files):
-      raise Exception('Need one R.txt file per extra package')
-
-    all_resources = {}
-    r_txt_file = os.path.join(r_dir, 'R.txt')
-    if not os.path.exists(r_txt_file):
-      return
-    with open(r_txt_file) as f:
-      for line in f:
-        m = re.match(r'(int(?:\[\])?) (\w+) (\w+) (.+)$', line)
-        if not m:
-          raise Exception('Unexpected line in R.txt: %s' % line)
-        java_type, resource_type, name, value = m.groups()
-        all_resources[(resource_type, name)] = (java_type, value)
-
-    for package, r_text_file in zip(extra_packages, extra_r_text_files):
-      if os.path.exists(r_text_file):
-        package_r_java_dir = os.path.join(r_dir, *package.split('.'))
-        build_utils.MakeDirectory(package_r_java_dir)
-        package_r_java_path = os.path.join(package_r_java_dir, 'R.java')
-        CreateExtraRJavaFile(
-            package, package_r_java_path, r_text_file, all_resources,
-            shared_resources)
-
-
-def CreateExtraRJavaFile(
-      package, r_java_path, r_text_file, all_resources, shared_resources):
-  resources = {}
-  with open(r_text_file) as f:
-    for line in f:
-      m = re.match(r'int(?:\[\])? (\w+) (\w+) ', line)
-      if not m:
-        raise Exception('Unexpected line in R.txt: %s' % line)
-      resource_type, name = m.groups()
-      java_type, value = all_resources[(resource_type, name)]
-      if resource_type not in resources:
-        resources[resource_type] = []
-      resources[resource_type].append((name, java_type, value))
-
-  template = Template("""/* AUTO-GENERATED FILE.  DO NOT MODIFY. */
-
-package {{ package }};
-
-public final class R {
-    {% for resource_type in resources %}
-    public static final class {{ resource_type }} {
-        {% for name, java_type, value in resources[resource_type] %}
-        {% if shared_resources %}
-        public static {{ java_type }} {{ name }} = {{ value }};
-        {% else %}
-        public static final {{ java_type }} {{ name }} = {{ value }};
-        {% endif %}
-        {% endfor %}
-    }
-    {% endfor %}
-    {% if shared_resources %}
-    public static void onResourcesLoaded(int packageId) {
-        {% for resource_type in resources %}
-        {% for name, java_type, value in resources[resource_type] %}
-        {% if java_type == 'int[]' %}
-        for(int i = 0; i < {{ resource_type }}.{{ name }}.length; ++i) {
-            {{ resource_type }}.{{ name }}[i] =
-                    ({{ resource_type }}.{{ name }}[i] & 0x00ffffff)
-                    | (packageId << 24);
-        }
-        {% else %}
-        {{ resource_type }}.{{ name }} =
-                ({{ resource_type }}.{{ name }} & 0x00ffffff)
-                | (packageId << 24);
-        {% endif %}
-        {% endfor %}
-        {% endfor %}
-    }
-    {% endif %}
-}
-""", trim_blocks=True, lstrip_blocks=True)
-
-  output = template.render(package=package, resources=resources,
-                           shared_resources=shared_resources)
-  with open(r_java_path, 'w') as f:
-    f.write(output)
-
-
-def CrunchDirectory(aapt, input_dir, output_dir):
-  """Crunches the images in input_dir and its subdirectories into output_dir.
-
-  If an image is already optimized, crunching often increases image size. In
-  this case, the crunched image is overwritten with the original image.
-  """
-  aapt_cmd = [aapt,
-              'crunch',
-              '-C', output_dir,
-              '-S', input_dir,
-              '--ignore-assets', build_utils.AAPT_IGNORE_PATTERN]
-  build_utils.CheckOutput(aapt_cmd, stderr_filter=FilterCrunchStderr,
-                          fail_func=DidCrunchFail)
-
-  # Check for images whose size increased during crunching and replace them
-  # with their originals (except for 9-patches, which must be crunched).
-  for dir_, _, files in os.walk(output_dir):
-    for crunched in files:
-      if crunched.endswith('.9.png'):
-        continue
-      if not crunched.endswith('.png'):
-        raise Exception('Unexpected file in crunched dir: ' + crunched)
-      crunched = os.path.join(dir_, crunched)
-      original = os.path.join(input_dir, os.path.relpath(crunched, output_dir))
-      original_size = os.path.getsize(original)
-      crunched_size = os.path.getsize(crunched)
-      if original_size < crunched_size:
-        shutil.copyfile(original, crunched)
-
-
-def FilterCrunchStderr(stderr):
-  """Filters out lines from aapt crunch's stderr that can safely be ignored."""
-  filtered_lines = []
-  for line in stderr.splitlines(True):
-    # Ignore this libpng warning, which is a known non-error condition.
-    # http://crbug.com/364355
-    if ('libpng warning: iCCP: Not recognizing known sRGB profile that has '
-        + 'been edited' in line):
-      continue
-    filtered_lines.append(line)
-  return ''.join(filtered_lines)
-
-
-def DidCrunchFail(returncode, stderr):
-  """Determines whether aapt crunch failed from its return code and output.
-
-  Because aapt's return code cannot be trusted, any output to stderr is
-  an indication that aapt has failed (http://crbug.com/314885).
-  """
-  return returncode != 0 or stderr
-
-
-def ZipResources(resource_dirs, zip_path):
-  # Python zipfile does not provide a way to replace a file (it just writes
-  # another file with the same name). So, first collect all the files to put
-  # in the zip (with proper overriding), and then zip them.
-  files_to_zip = dict()
-  for d in resource_dirs:
-    for root, _, files in os.walk(d):
-      for f in files:
-        archive_path = os.path.join(os.path.relpath(root, d), f)
-        path = os.path.join(root, f)
-        files_to_zip[archive_path] = path
-  with zipfile.ZipFile(zip_path, 'w') as outzip:
-    for archive_path, path in files_to_zip.iteritems():
-      outzip.write(path, archive_path)
-
-
-def CombineZips(zip_files, output_path):
-  # When packaging resources, if the top-level directories in the zip file are
-  # of the form 0, 1, ..., then each subdirectory will be passed to aapt as a
-  # resources directory. While some resources just clobber others (image files,
-  # etc), other resources (particularly .xml files) need to be more
-  # intelligently merged. That merging is left up to aapt.
-  with zipfile.ZipFile(output_path, 'w') as outzip:
-    for i, z in enumerate(zip_files):
-      with zipfile.ZipFile(z, 'r') as inzip:
-        for name in inzip.namelist():
-          new_name = '%d/%s' % (i, name)
-          outzip.writestr(new_name, inzip.read(name))
-
-
-def main():
-  args = build_utils.ExpandFileArgs(sys.argv[1:])
-
-  options = ParseArgs(args)
-  android_jar = os.path.join(options.android_sdk, 'android.jar')
-  aapt = options.aapt_path
-
-  input_files = []
-
-  with build_utils.TempDir() as temp_dir:
-    deps_dir = os.path.join(temp_dir, 'deps')
-    build_utils.MakeDirectory(deps_dir)
-    v14_dir = os.path.join(temp_dir, 'v14')
-    build_utils.MakeDirectory(v14_dir)
-
-    gen_dir = os.path.join(temp_dir, 'gen')
-    build_utils.MakeDirectory(gen_dir)
-
-    input_resource_dirs = build_utils.ParseGypList(options.resource_dirs)
-
-    if not options.v14_skip:
-      for resource_dir in input_resource_dirs:
-        generate_v14_compatible_resources.GenerateV14Resources(
-            resource_dir,
-            v14_dir)
-
-    dep_zips = build_utils.ParseGypList(options.dependencies_res_zips)
-    input_files += dep_zips
-    dep_subdirs = []
-    for z in dep_zips:
-      subdir = os.path.join(deps_dir, os.path.basename(z))
-      if os.path.exists(subdir):
-        raise Exception('Resource zip name conflict: ' + os.path.basename(z))
-      build_utils.ExtractAll(z, path=subdir)
-      dep_subdirs.append(subdir)
-
-    # Generate R.java. This R.java contains non-final constants and is used only
-    # while compiling the library jar (e.g. chromium_content.jar). When building
-    # an apk, a new R.java file with the correct resource -> ID mappings will be
-    # generated by merging the resources from all libraries and the main apk
-    # project.
-    package_command = [aapt,
-                       'package',
-                       '-m',
-                       '-M', options.android_manifest,
-                       '--auto-add-overlay',
-                       '-I', android_jar,
-                       '--output-text-symbols', gen_dir,
-                       '-J', gen_dir,
-                       '--ignore-assets', build_utils.AAPT_IGNORE_PATTERN]
-
-    for d in input_resource_dirs:
-      package_command += ['-S', d]
-
-    for d in dep_subdirs:
-      package_command += ['-S', d]
-
-    if options.non_constant_id:
-      package_command.append('--non-constant-id')
-    if options.custom_package:
-      package_command += ['--custom-package', options.custom_package]
-    if options.proguard_file:
-      package_command += ['-G', options.proguard_file]
-    if options.shared_resources:
-      package_command.append('--shared-lib')
-    build_utils.CheckOutput(package_command, print_stderr=False)
-
-    if options.extra_res_packages:
-      CreateExtraRJavaFiles(
-          gen_dir,
-          build_utils.ParseGypList(options.extra_res_packages),
-          build_utils.ParseGypList(options.extra_r_text_files),
-          options.shared_resources,
-          options.include_all_resources)
-
-    # This is the list of directories with resources to put in the final .zip
-    # file. The order of these is important so that crunched/v14 resources
-    # override the normal ones.
-    zip_resource_dirs = input_resource_dirs + [v14_dir]
-
-    base_crunch_dir = os.path.join(temp_dir, 'crunch')
-
-    # Crunch image resources. This shrinks png files and is necessary for
-    # 9-patch images to display correctly. 'aapt crunch' accepts only a single
-    # directory at a time and deletes everything in the output directory.
-    for idx, input_dir in enumerate(input_resource_dirs):
-      crunch_dir = os.path.join(base_crunch_dir, str(idx))
-      build_utils.MakeDirectory(crunch_dir)
-      zip_resource_dirs.append(crunch_dir)
-      CrunchDirectory(aapt, input_dir, crunch_dir)
-
-    ZipResources(zip_resource_dirs, options.resource_zip_out)
-
-    if options.all_resources_zip_out:
-      CombineZips([options.resource_zip_out] + dep_zips,
-                  options.all_resources_zip_out)
-
-    if options.R_dir:
-      build_utils.DeleteDirectory(options.R_dir)
-      shutil.copytree(gen_dir, options.R_dir)
-    else:
-      build_utils.ZipDir(options.srcjar_out, gen_dir)
-
-    if options.r_text_out:
-      r_text_path = os.path.join(gen_dir, 'R.txt')
-      if os.path.exists(r_text_path):
-        shutil.copyfile(r_text_path, options.r_text_out)
-      else:
-        open(options.r_text_out, 'w').close()
-
-  if options.depfile:
-    input_files += build_utils.GetPythonDependencies()
-    build_utils.WriteDepfile(options.depfile, input_files)
-
-  if options.stamp:
-    build_utils.Touch(options.stamp)
-
-
-if __name__ == '__main__':
-  main()
diff --git a/build/android/gyp/proguard.py b/build/android/gyp/proguard.py
deleted file mode 100755
index 5127100..0000000
--- a/build/android/gyp/proguard.py
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import optparse
-import sys
-
-from util import build_utils
-from util import proguard_util
-
-def DoProguard(options):
-  proguard = proguard_util.ProguardCmdBuilder(options.proguard_path)
-  proguard.injars(build_utils.ParseGypList(options.input_paths))
-  proguard.configs(build_utils.ParseGypList(options.proguard_configs))
-  proguard.outjar(options.output_path)
-
-  if options.mapping:
-    proguard.mapping(options.mapping)
-
-  if options.is_test:
-    proguard.is_test(True)
-
-  classpath = []
-  for arg in options.classpath:
-    classpath += build_utils.ParseGypList(arg)
-  classpath = list(set(classpath))
-  proguard.libraryjars(classpath)
-
-  proguard.CheckOutput()
-
-  return proguard.GetInputs()
-
-
-def main(args):
-  args = build_utils.ExpandFileArgs(args)
-  parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(parser)
-  parser.add_option('--proguard-path',
-                    help='Path to the proguard executable.')
-  parser.add_option('--input-paths',
-                    help='Paths to the .jar files proguard should run on.')
-  parser.add_option('--output-path', help='Path to the generated .jar file.')
-  parser.add_option('--proguard-configs',
-                    help='Paths to proguard configuration files.')
-  parser.add_option('--mapping', help='Path to proguard mapping to apply.')
-  parser.add_option('--is-test', action='store_true',
-      help='If true, extra proguard options for instrumentation tests will be '
-      'added.')
-  parser.add_option('--classpath', action='append',
-                    help='Classpath for proguard.')
-  parser.add_option('--stamp', help='Path to touch on success.')
-
-  options, _ = parser.parse_args(args)
-
-  inputs = DoProguard(options)
-
-  if options.depfile:
-    build_utils.WriteDepfile(
-        options.depfile,
-        inputs + build_utils.GetPythonDependencies())
-
-  if options.stamp:
-    build_utils.Touch(options.stamp)
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
diff --git a/build/android/gyp/push_libraries.py b/build/android/gyp/push_libraries.py
deleted file mode 100755
index 6b31a2e..0000000
--- a/build/android/gyp/push_libraries.py
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Pushes native libraries to a device.
-
-"""
-
-import optparse
-import os
-import sys
-
-BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), os.pardir)
-sys.path.append(BUILD_ANDROID_DIR)
-
-from pylib import constants
-
-from util import build_device
-from util import build_utils
-from util import md5_check
-
-def DoPush(options):
-  libraries = build_utils.ParseGypList(options.libraries)
-
-  device = build_device.GetBuildDeviceFromPath(
-      options.build_device_configuration)
-  if not device:
-    return
-
-  serial_number = device.GetSerialNumber()
-  # A list so that it is modifiable in Push below.
-  needs_directory = [True]
-  for lib in libraries:
-    device_path = os.path.join(options.device_dir, lib)
-    host_path = os.path.join(options.libraries_dir, lib)
-
-    def Push():
-      if needs_directory:
-        device.RunShellCommand('mkdir -p ' + options.device_dir)
-        needs_directory[:] = [] # = False
-      device.PushChangedFiles([(host_path, device_path)])
-
-    record_path = '%s.%s.push.md5.stamp' % (host_path, serial_number)
-    md5_check.CallAndRecordIfStale(
-        Push,
-        record_path=record_path,
-        input_paths=[host_path],
-        input_strings=[device_path])
-
-
-def main(args):
-  args = build_utils.ExpandFileArgs(args)
-  parser = optparse.OptionParser()
-  parser.add_option('--libraries-dir',
-      help='Directory that contains stripped libraries.')
-  parser.add_option('--device-dir',
-      help='Device directory to push the libraries to.')
-  parser.add_option('--libraries',
-      help='List of native libraries.')
-  parser.add_option('--stamp', help='Path to touch on success.')
-  parser.add_option('--build-device-configuration',
-      help='Path to build device configuration.')
-  parser.add_option('--configuration-name',
-      help='The build CONFIGURATION_NAME')
-  options, _ = parser.parse_args(args)
-
-  required_options = ['libraries', 'device_dir', 'libraries']
-  build_utils.CheckOptions(options, parser, required=required_options)
-  constants.SetBuildType(options.configuration_name)
-
-  DoPush(options)
-
-  if options.stamp:
-    build_utils.Touch(options.stamp)
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
diff --git a/build/android/gyp/strip_library_for_device.py b/build/android/gyp/strip_library_for_device.py
deleted file mode 100755
index 9e2daae..0000000
--- a/build/android/gyp/strip_library_for_device.py
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import optparse
-import os
-import sys
-
-from util import build_utils
-
-
-def StripLibrary(android_strip, android_strip_args, library_path, output_path):
-  if build_utils.IsTimeStale(output_path, [library_path]):
-    strip_cmd = ([android_strip] +
-                 android_strip_args +
-                 ['-o', output_path, library_path])
-    build_utils.CheckOutput(strip_cmd)
-
-
-def main(args):
-  args = build_utils.ExpandFileArgs(args)
-
-  parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(parser)
-
-  parser.add_option('--android-strip',
-      help='Path to the toolchain\'s strip binary')
-  parser.add_option('--android-strip-arg', action='append',
-      help='Argument to be passed to strip')
-  parser.add_option('--libraries-dir',
-      help='Directory for un-stripped libraries')
-  parser.add_option('--stripped-libraries-dir',
-      help='Directory for stripped libraries')
-  parser.add_option('--libraries',
-      help='List of libraries to strip')
-  parser.add_option('--stamp', help='Path to touch on success')
-
-  options, _ = parser.parse_args(args)
-
-  libraries = build_utils.ParseGypList(options.libraries)
-
-  build_utils.MakeDirectory(options.stripped_libraries_dir)
-
-  for library in libraries:
-    for base_path in options.libraries_dir.split(','):
-      library_path = os.path.join(base_path, library)
-      if (os.path.exists(library_path)):
-        break
-    stripped_library_path = os.path.join(
-        options.stripped_libraries_dir, library)
-    StripLibrary(options.android_strip, options.android_strip_arg, library_path,
-        stripped_library_path)
-
-  if options.stamp:
-    build_utils.Touch(options.stamp)
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
diff --git a/build/android/gyp/test/BUILD.gn b/build/android/gyp/test/BUILD.gn
deleted file mode 100644
index 2deac1d..0000000
--- a/build/android/gyp/test/BUILD.gn
+++ /dev/null
@@ -1,13 +0,0 @@
-import("//build/config/android/rules.gni")
-
-java_library("hello_world_java") {
-  java_files = [ "java/org/chromium/helloworld/HelloWorldPrinter.java" ]
-}
-
-java_binary("hello_world") {
-  deps = [
-    ":hello_world_java",
-  ]
-  java_files = [ "java/org/chromium/helloworld/HelloWorldMain.java" ]
-  main_class = "org.chromium.helloworld.HelloWorldMain"
-}
diff --git a/build/android/gyp/test/java/org/chromium/helloworld/HelloWorldMain.java b/build/android/gyp/test/java/org/chromium/helloworld/HelloWorldMain.java
deleted file mode 100644
index 10860d8..0000000
--- a/build/android/gyp/test/java/org/chromium/helloworld/HelloWorldMain.java
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.helloworld;
-
-public class HelloWorldMain {
-    public static void main(String[] args) {
-        if (args.length > 0) {
-            System.exit(Integer.parseInt(args[0]));
-        }
-        HelloWorldPrinter.print();
-    }
-}
-
diff --git a/build/android/gyp/test/java/org/chromium/helloworld/HelloWorldPrinter.java b/build/android/gyp/test/java/org/chromium/helloworld/HelloWorldPrinter.java
deleted file mode 100644
index b09673e..0000000
--- a/build/android/gyp/test/java/org/chromium/helloworld/HelloWorldPrinter.java
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.helloworld;
-
-public class HelloWorldPrinter {
-    public static void print() {
-        System.out.println("Hello, world!");
-    }
-}
-
diff --git a/build/android/gyp/touch.py b/build/android/gyp/touch.py
deleted file mode 100755
index 7b4375e..0000000
--- a/build/android/gyp/touch.py
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import sys
-
-from util import build_utils
-
-def main(argv):
-  for f in argv[1:]:
-    build_utils.Touch(f)
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv))
diff --git a/build/android/gyp/util/__init__.py b/build/android/gyp/util/__init__.py
deleted file mode 100644
index 727e987..0000000
--- a/build/android/gyp/util/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
diff --git a/build/android/gyp/util/build_device.py b/build/android/gyp/util/build_device.py
deleted file mode 100644
index 8ab1112..0000000
--- a/build/android/gyp/util/build_device.py
+++ /dev/null
@@ -1,108 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-""" A simple device interface for build steps.
-
-"""
-
-import logging
-import os
-import re
-import sys
-
-from util import build_utils
-
-BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), '..', '..')
-sys.path.append(BUILD_ANDROID_DIR)
-
-from pylib import android_commands
-from pylib.device import device_errors
-from pylib.device import device_utils
-
-GetAttachedDevices = android_commands.GetAttachedDevices
-
-
-class BuildDevice(object):
-  def __init__(self, configuration):
-    self.id = configuration['id']
-    self.description = configuration['description']
-    self.install_metadata = configuration['install_metadata']
-    self.device = device_utils.DeviceUtils(self.id)
-
-  def RunShellCommand(self, *args, **kwargs):
-    return self.device.RunShellCommand(*args, **kwargs)
-
-  def PushChangedFiles(self, *args, **kwargs):
-    return self.device.PushChangedFiles(*args, **kwargs)
-
-  def GetSerialNumber(self):
-    return self.id
-
-  def Install(self, *args, **kwargs):
-    return self.device.Install(*args, **kwargs)
-
-  def InstallSplitApk(self, *args, **kwargs):
-    return self.device.InstallSplitApk(*args, **kwargs)
-
-  def GetInstallMetadata(self, apk_package):
-    """Gets the metadata on the device for the apk_package apk."""
-    # Matches lines like:
-    # -rw-r--r-- system   system    7376582 2013-04-19 16:34 \
-    #   org.chromium.chrome.shell.apk
-    # -rw-r--r-- system   system    7376582 2013-04-19 16:34 \
-    #   org.chromium.chrome.shell-1.apk
-    apk_matcher = lambda s: re.match('.*%s(-[0-9]*)?.apk$' % apk_package, s)
-    matches = filter(apk_matcher, self.install_metadata)
-    return matches[0] if matches else None
-
-
-def GetConfigurationForDevice(device_id):
-  device = device_utils.DeviceUtils(device_id)
-  configuration = None
-  has_root = False
-  is_online = device.IsOnline()
-  if is_online:
-    cmd = 'ls -l /data/app; getprop ro.build.description'
-    cmd_output = device.RunShellCommand(cmd)
-    has_root = not 'Permission denied' in cmd_output[0]
-    if not has_root:
-      # Disable warning log messages from EnableRoot()
-      logging.getLogger().disabled = True
-      try:
-        device.EnableRoot()
-        has_root = True
-      except device_errors.CommandFailedError:
-        has_root = False
-      finally:
-        logging.getLogger().disabled = False
-      cmd_output = device.RunShellCommand(cmd)
-
-    configuration = {
-        'id': device_id,
-        'description': cmd_output[-1],
-        'install_metadata': cmd_output[:-1],
-      }
-  return configuration, is_online, has_root
-
-
-def WriteConfigurations(configurations, path):
-  # Currently we only support installing to the first device.
-  build_utils.WriteJson(configurations[:1], path, only_if_changed=True)
-
-
-def ReadConfigurations(path):
-  return build_utils.ReadJson(path)
-
-
-def GetBuildDevice(configurations):
-  assert len(configurations) == 1
-  return BuildDevice(configurations[0])
-
-
-def GetBuildDeviceFromPath(path):
-  configurations = ReadConfigurations(path)
-  if len(configurations) > 0:
-    return GetBuildDevice(ReadConfigurations(path))
-  return None
-
diff --git a/build/android/gyp/util/build_utils.py b/build/android/gyp/util/build_utils.py
deleted file mode 100644
index 65b1a64..0000000
--- a/build/android/gyp/util/build_utils.py
+++ /dev/null
@@ -1,376 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import ast
-import contextlib
-import fnmatch
-import json
-import os
-import pipes
-import re
-import shlex
-import shutil
-import subprocess
-import sys
-import tempfile
-import zipfile
-
-
-CHROMIUM_SRC = os.path.normpath(
-    os.path.join(os.path.dirname(__file__),
-                 os.pardir, os.pardir, os.pardir, os.pardir))
-COLORAMA_ROOT = os.path.join(CHROMIUM_SRC,
-                             'third_party', 'colorama', 'src')
-# aapt should ignore OWNERS files in addition the default ignore pattern.
-AAPT_IGNORE_PATTERN = ('!OWNERS:!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:' +
-                       '!CVS:!thumbs.db:!picasa.ini:!*~:!*.d.stamp')
-
-
-@contextlib.contextmanager
-def TempDir():
-  dirname = tempfile.mkdtemp()
-  try:
-    yield dirname
-  finally:
-    shutil.rmtree(dirname)
-
-
-def MakeDirectory(dir_path):
-  try:
-    os.makedirs(dir_path)
-  except OSError:
-    pass
-
-
-def DeleteDirectory(dir_path):
-  if os.path.exists(dir_path):
-    shutil.rmtree(dir_path)
-
-
-def Touch(path, fail_if_missing=False):
-  if fail_if_missing and not os.path.exists(path):
-    raise Exception(path + ' doesn\'t exist.')
-
-  MakeDirectory(os.path.dirname(path))
-  with open(path, 'a'):
-    os.utime(path, None)
-
-
-def FindInDirectory(directory, filename_filter):
-  files = []
-  for root, _dirnames, filenames in os.walk(directory):
-    matched_files = fnmatch.filter(filenames, filename_filter)
-    files.extend((os.path.join(root, f) for f in matched_files))
-  return files
-
-
-def FindInDirectories(directories, filename_filter):
-  all_files = []
-  for directory in directories:
-    all_files.extend(FindInDirectory(directory, filename_filter))
-  return all_files
-
-
-def ParseGnList(gn_string):
-  return ast.literal_eval(gn_string)
-
-
-def ParseGypList(gyp_string):
-  # The ninja generator doesn't support $ in strings, so use ## to
-  # represent $.
-  # TODO(cjhopman): Remove when
-  # https://code.google.com/p/gyp/issues/detail?id=327
-  # is addressed.
-  gyp_string = gyp_string.replace('##', '$')
-
-  if gyp_string.startswith('['):
-    return ParseGnList(gyp_string)
-  return shlex.split(gyp_string)
-
-
-def CheckOptions(options, parser, required=None):
-  if not required:
-    return
-  for option_name in required:
-    if getattr(options, option_name) is None:
-      parser.error('--%s is required' % option_name.replace('_', '-'))
-
-
-def WriteJson(obj, path, only_if_changed=False):
-  old_dump = None
-  if os.path.exists(path):
-    with open(path, 'r') as oldfile:
-      old_dump = oldfile.read()
-
-  new_dump = json.dumps(obj, sort_keys=True, indent=2, separators=(',', ': '))
-
-  if not only_if_changed or old_dump != new_dump:
-    with open(path, 'w') as outfile:
-      outfile.write(new_dump)
-
-
-def ReadJson(path):
-  with open(path, 'r') as jsonfile:
-    return json.load(jsonfile)
-
-
-class CalledProcessError(Exception):
-  """This exception is raised when the process run by CheckOutput
-  exits with a non-zero exit code."""
-
-  def __init__(self, cwd, args, output):
-    super(CalledProcessError, self).__init__()
-    self.cwd = cwd
-    self.args = args
-    self.output = output
-
-  def __str__(self):
-    # A user should be able to simply copy and paste the command that failed
-    # into their shell.
-    copyable_command = '( cd {}; {} )'.format(os.path.abspath(self.cwd),
-        ' '.join(map(pipes.quote, self.args)))
-    return 'Command failed: {}\n{}'.format(copyable_command, self.output)
-
-
-# This can be used in most cases like subprocess.check_output(). The output,
-# particularly when the command fails, better highlights the command's failure.
-# If the command fails, raises a build_utils.CalledProcessError.
-def CheckOutput(args, cwd=None,
-                print_stdout=False, print_stderr=True,
-                stdout_filter=None,
-                stderr_filter=None,
-                fail_func=lambda returncode, stderr: returncode != 0):
-  if not cwd:
-    cwd = os.getcwd()
-
-  child = subprocess.Popen(args,
-      stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd)
-  stdout, stderr = child.communicate()
-
-  if stdout_filter is not None:
-    stdout = stdout_filter(stdout)
-
-  if stderr_filter is not None:
-    stderr = stderr_filter(stderr)
-
-  if fail_func(child.returncode, stderr):
-    raise CalledProcessError(cwd, args, stdout + stderr)
-
-  if print_stdout:
-    sys.stdout.write(stdout)
-  if print_stderr:
-    sys.stderr.write(stderr)
-
-  return stdout
-
-
-def GetModifiedTime(path):
-  # For a symlink, the modified time should be the greater of the link's
-  # modified time and the modified time of the target.
-  return max(os.lstat(path).st_mtime, os.stat(path).st_mtime)
-
-
-def IsTimeStale(output, inputs):
-  if not os.path.exists(output):
-    return True
-
-  output_time = GetModifiedTime(output)
-  for i in inputs:
-    if GetModifiedTime(i) > output_time:
-      return True
-  return False
-
-
-def IsDeviceReady():
-  device_state = CheckOutput(['adb', 'get-state'])
-  return device_state.strip() == 'device'
-
-
-def CheckZipPath(name):
-  if os.path.normpath(name) != name:
-    raise Exception('Non-canonical zip path: %s' % name)
-  if os.path.isabs(name):
-    raise Exception('Absolute zip path: %s' % name)
-
-
-def ExtractAll(zip_path, path=None, no_clobber=True, pattern=None):
-  if path is None:
-    path = os.getcwd()
-  elif not os.path.exists(path):
-    MakeDirectory(path)
-
-  with zipfile.ZipFile(zip_path) as z:
-    for name in z.namelist():
-      if name.endswith('/'):
-        continue
-      if pattern is not None:
-        if not fnmatch.fnmatch(name, pattern):
-          continue
-      CheckZipPath(name)
-      if no_clobber:
-        output_path = os.path.join(path, name)
-        if os.path.exists(output_path):
-          raise Exception(
-              'Path already exists from zip: %s %s %s'
-              % (zip_path, name, output_path))
-
-    z.extractall(path=path)
-
-
-def DoZip(inputs, output, base_dir):
-  with zipfile.ZipFile(output, 'w') as outfile:
-    for f in inputs:
-      CheckZipPath(os.path.relpath(f, base_dir))
-      outfile.write(f, os.path.relpath(f, base_dir))
-
-
-def ZipDir(output, base_dir):
-  with zipfile.ZipFile(output, 'w') as outfile:
-    for root, _, files in os.walk(base_dir):
-      for f in files:
-        path = os.path.join(root, f)
-        archive_path = os.path.relpath(path, base_dir)
-        CheckZipPath(archive_path)
-        outfile.write(path, archive_path)
-
-
-def MergeZips(output, inputs, exclude_patterns=None):
-  added_names = set()
-  def Allow(name):
-    if exclude_patterns is not None:
-      for p in exclude_patterns:
-        if fnmatch.fnmatch(name, p):
-          return False
-    return True
-
-  with zipfile.ZipFile(output, 'w') as out_zip:
-    for in_file in inputs:
-      with zipfile.ZipFile(in_file, 'r') as in_zip:
-        for name in in_zip.namelist():
-          if name not in added_names and Allow(name):
-            out_zip.writestr(name, in_zip.read(name))
-            added_names.add(name)
-
-
-def PrintWarning(message):
-  print 'WARNING: ' + message
-
-
-def PrintBigWarning(message):
-  print '*****     ' * 8
-  PrintWarning(message)
-  print '*****     ' * 8
-
-
-def GetSortedTransitiveDependencies(top, deps_func):
-  """Gets the list of all transitive dependencies in sorted order.
-
-  There should be no cycles in the dependency graph.
-
-  Args:
-    top: a list of the top level nodes
-    deps_func: A function that takes a node and returns its direct dependencies.
-  Returns:
-    A list of all transitive dependencies of nodes in top, in order (a node will
-    appear in the list at a higher index than all of its dependencies).
-  """
-  def Node(dep):
-    return (dep, deps_func(dep))
-
-  # First: find all deps
-  unchecked_deps = list(top)
-  all_deps = set(top)
-  while unchecked_deps:
-    dep = unchecked_deps.pop()
-    new_deps = deps_func(dep).difference(all_deps)
-    unchecked_deps.extend(new_deps)
-    all_deps = all_deps.union(new_deps)
-
-  # Then: simple, slow topological sort.
-  sorted_deps = []
-  unsorted_deps = dict(map(Node, all_deps))
-  while unsorted_deps:
-    for library, dependencies in unsorted_deps.items():
-      if not dependencies.intersection(unsorted_deps.keys()):
-        sorted_deps.append(library)
-        del unsorted_deps[library]
-
-  return sorted_deps
-
-
-def GetPythonDependencies():
-  """Gets the paths of imported non-system python modules.
-
-  A path is assumed to be a "system" import if it is outside of chromium's
-  src/. The paths will be relative to the current directory.
-  """
-  module_paths = (m.__file__ for m in sys.modules.itervalues()
-                  if m is not None and hasattr(m, '__file__'))
-
-  abs_module_paths = map(os.path.abspath, module_paths)
-
-  non_system_module_paths = [
-      p for p in abs_module_paths if p.startswith(CHROMIUM_SRC)]
-  def ConvertPycToPy(s):
-    if s.endswith('.pyc'):
-      return s[:-1]
-    return s
-
-  non_system_module_paths = map(ConvertPycToPy, non_system_module_paths)
-  non_system_module_paths = map(os.path.relpath, non_system_module_paths)
-  return sorted(set(non_system_module_paths))
-
-
-def AddDepfileOption(parser):
-  parser.add_option('--depfile',
-                    help='Path to depfile. This must be specified as the '
-                    'action\'s first output.')
-
-
-def WriteDepfile(path, dependencies):
-  with open(path, 'w') as depfile:
-    depfile.write(path)
-    depfile.write(': ')
-    depfile.write(' '.join(dependencies))
-    depfile.write('\n')
-
-
-def ExpandFileArgs(args):
-  """Replaces file-arg placeholders in args.
-
-  These placeholders have the form:
-    @FileArg(filename:key1:key2:...:keyn)
-
-  The value of such a placeholder is calculated by reading 'filename' as json.
-  And then extracting the value at [key1][key2]...[keyn].
-
-  Note: This intentionally does not return the list of files that appear in such
-  placeholders. An action that uses file-args *must* know the paths of those
-  files prior to the parsing of the arguments (typically by explicitly listing
-  them in the action's inputs in build files).
-  """
-  new_args = list(args)
-  file_jsons = dict()
-  r = re.compile('@FileArg\((.*?)\)')
-  for i, arg in enumerate(args):
-    match = r.search(arg)
-    if not match:
-      continue
-
-    if match.end() != len(arg):
-      raise Exception('Unexpected characters after FileArg: ' + arg)
-
-    lookup_path = match.group(1).split(':')
-    file_path = lookup_path[0]
-    if not file_path in file_jsons:
-      file_jsons[file_path] = ReadJson(file_path)
-
-    expansion = file_jsons[file_path]
-    for k in lookup_path[1:]:
-      expansion = expansion[k]
-
-    new_args[i] = arg[:match.start()] + str(expansion)
-
-  return new_args
-
diff --git a/build/android/gyp/util/md5_check.py b/build/android/gyp/util/md5_check.py
deleted file mode 100644
index 9f365aa..0000000
--- a/build/android/gyp/util/md5_check.py
+++ /dev/null
@@ -1,86 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import hashlib
-import os
-
-
-def CallAndRecordIfStale(
-    function, record_path=None, input_paths=None, input_strings=None,
-    force=False):
-  """Calls function if the md5sum of the input paths/strings has changed.
-
-  The md5sum of the inputs is compared with the one stored in record_path. If
-  this has changed (or the record doesn't exist), function will be called and
-  the new md5sum will be recorded.
-
-  If force is True, the function will be called regardless of whether the
-  md5sum is out of date.
-  """
-  if not input_paths:
-    input_paths = []
-  if not input_strings:
-    input_strings = []
-  md5_checker = _Md5Checker(
-      record_path=record_path,
-      input_paths=input_paths,
-      input_strings=input_strings)
-  if force or md5_checker.IsStale():
-    function()
-    md5_checker.Write()
-
-
-def _UpdateMd5ForFile(md5, path, block_size=2**16):
-  with open(path, 'rb') as infile:
-    while True:
-      data = infile.read(block_size)
-      if not data:
-        break
-      md5.update(data)
-
-
-def _UpdateMd5ForDirectory(md5, dir_path):
-  for root, _, files in os.walk(dir_path):
-    for f in files:
-      _UpdateMd5ForFile(md5, os.path.join(root, f))
-
-
-def _UpdateMd5ForPath(md5, path):
-  if os.path.isdir(path):
-    _UpdateMd5ForDirectory(md5, path)
-  else:
-    _UpdateMd5ForFile(md5, path)
-
-
-class _Md5Checker(object):
-  def __init__(self, record_path=None, input_paths=None, input_strings=None):
-    if not input_paths:
-      input_paths = []
-    if not input_strings:
-      input_strings = []
-
-    assert record_path.endswith('.stamp'), (
-        'record paths must end in \'.stamp\' so that they are easy to find '
-        'and delete')
-
-    self.record_path = record_path
-
-    md5 = hashlib.md5()
-    for i in sorted(input_paths):
-      _UpdateMd5ForPath(md5, i)
-    for s in input_strings:
-      md5.update(s)
-    self.new_digest = md5.hexdigest()
-
-    self.old_digest = ''
-    if os.path.exists(self.record_path):
-      with open(self.record_path, 'r') as old_record:
-        self.old_digest = old_record.read()
-
-  def IsStale(self):
-    return self.old_digest != self.new_digest
-
-  def Write(self):
-    with open(self.record_path, 'w') as new_record:
-      new_record.write(self.new_digest)
diff --git a/build/android/gyp/util/md5_check_test.py b/build/android/gyp/util/md5_check_test.py
deleted file mode 100644
index 4f89fc2..0000000
--- a/build/android/gyp/util/md5_check_test.py
+++ /dev/null
@@ -1,72 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import tempfile
-import unittest
-
-import md5_check # pylint: disable=W0403
-
-
-class TestMd5Check(unittest.TestCase):
-  def setUp(self):
-    self.called = False
-
-  def testCallAndRecordIfStale(self):
-    input_strings = ['string1', 'string2']
-    input_file1 = tempfile.NamedTemporaryFile()
-    input_file2 = tempfile.NamedTemporaryFile()
-    file1_contents = 'input file 1'
-    file2_contents = 'input file 2'
-    input_file1.write(file1_contents)
-    input_file1.flush()
-    input_file2.write(file2_contents)
-    input_file2.flush()
-    input_files = [input_file1.name, input_file2.name]
-
-    record_path = tempfile.NamedTemporaryFile(suffix='.stamp')
-
-    def CheckCallAndRecord(should_call, message, force=False):
-      self.called = False
-      def MarkCalled():
-        self.called = True
-      md5_check.CallAndRecordIfStale(
-          MarkCalled,
-          record_path=record_path.name,
-          input_paths=input_files,
-          input_strings=input_strings,
-          force=force)
-      self.failUnlessEqual(should_call, self.called, message)
-
-    CheckCallAndRecord(True, 'should call when record doesn\'t exist')
-    CheckCallAndRecord(False, 'should not call when nothing changed')
-    CheckCallAndRecord(True, force=True, message='should call when forced')
-
-    input_file1.write('some more input')
-    input_file1.flush()
-    CheckCallAndRecord(True, 'changed input file should trigger call')
-
-    input_files = input_files[::-1]
-    CheckCallAndRecord(False, 'reordering of inputs shouldn\'t trigger call')
-
-    input_files = input_files[:1]
-    CheckCallAndRecord(True, 'removing file should trigger call')
-
-    input_files.append(input_file2.name)
-    CheckCallAndRecord(True, 'added input file should trigger call')
-
-    input_strings[0] = input_strings[0] + ' a bit longer'
-    CheckCallAndRecord(True, 'changed input string should trigger call')
-
-    input_strings = input_strings[::-1]
-    CheckCallAndRecord(True, 'reordering of string inputs should trigger call')
-
-    input_strings = input_strings[:1]
-    CheckCallAndRecord(True, 'removing a string should trigger call')
-
-    input_strings.append('a brand new string')
-    CheckCallAndRecord(True, 'added input string should trigger call')
-
-
-if __name__ == '__main__':
-  unittest.main()
diff --git a/build/android/gyp/util/proguard_util.py b/build/android/gyp/util/proguard_util.py
deleted file mode 100644
index 901cd9f..0000000
--- a/build/android/gyp/util/proguard_util.py
+++ /dev/null
@@ -1,128 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import os
-from util import build_utils
-
-def FilterProguardOutput(output):
-  '''ProGuard outputs boring stuff to stdout (proguard version, jar path, etc)
-  as well as interesting stuff (notes, warnings, etc). If stdout is entirely
-  boring, this method suppresses the output.
-  '''
-  ignore_patterns = [
-    'ProGuard, version ',
-    'Reading program jar [',
-    'Reading library jar [',
-    'Preparing output jar [',
-    '  Copying resources from program jar [',
-  ]
-  for line in output.splitlines():
-    for pattern in ignore_patterns:
-      if line.startswith(pattern):
-        break
-    else:
-      # line doesn't match any of the patterns; it's probably something worth
-      # printing out.
-      return output
-  return ''
-
-
-class ProguardCmdBuilder(object):
-  def __init__(self, proguard_jar):
-    assert os.path.exists(proguard_jar)
-    self._proguard_jar_path = proguard_jar
-    self._test = None
-    self._mapping = None
-    self._libraries = None
-    self._injars = None
-    self._configs = None
-    self._outjar = None
-
-  def outjar(self, path):
-    assert self._outjar is None
-    self._outjar = path
-
-  def is_test(self, enable):
-    assert self._test is None
-    self._test = enable
-
-  def mapping(self, path):
-    assert self._mapping is None
-    assert os.path.exists(path), path
-    self._mapping = path
-
-  def libraryjars(self, paths):
-    assert self._libraries is None
-    for p in paths:
-      assert os.path.exists(p), p
-    self._libraries = paths
-
-  def injars(self, paths):
-    assert self._injars is None
-    for p in paths:
-      assert os.path.exists(p), p
-    self._injars = paths
-
-  def configs(self, paths):
-    assert self._configs is None
-    for p in paths:
-      assert os.path.exists(p), p
-    self._configs = paths
-
-  def build(self):
-    assert self._injars is not None
-    assert self._outjar is not None
-    assert self._configs is not None
-    cmd = [
-      'java', '-jar', self._proguard_jar_path,
-      '-forceprocessing',
-    ]
-    if self._test:
-      cmd += [
-        '-dontobfuscate',
-        '-dontoptimize',
-        '-dontshrink',
-        '-dontskipnonpubliclibraryclassmembers',
-      ]
-
-    if self._mapping:
-      cmd += [
-        '-applymapping', self._mapping,
-      ]
-
-    if self._libraries:
-      cmd += [
-        '-libraryjars', ':'.join(self._libraries),
-      ]
-
-    cmd += [
-      '-injars', ':'.join(self._injars)
-    ]
-
-    for config_file in self._configs:
-      cmd += ['-include', config_file]
-
-    # The output jar must be specified after inputs.
-    cmd += [
-      '-outjars', self._outjar,
-      '-dump', self._outjar + '.dump',
-      '-printseeds', self._outjar + '.seeds',
-      '-printusage', self._outjar + '.usage',
-      '-printmapping', self._outjar + '.mapping',
-    ]
-    return cmd
-
-  def GetInputs(self):
-    inputs = [self._proguard_jar_path] + self._configs + self._injars
-    if self._mapping:
-      inputs.append(self._mapping)
-    if self._libraries:
-      inputs += self._libraries
-    return inputs
-
-
-  def CheckOutput(self):
-    build_utils.CheckOutput(self.build(), print_stdout=True,
-                            stdout_filter=FilterProguardOutput)
-
diff --git a/build/android/gyp/write_build_config.py b/build/android/gyp/write_build_config.py
deleted file mode 100755
index 3773e98..0000000
--- a/build/android/gyp/write_build_config.py
+++ /dev/null
@@ -1,357 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Writes a build_config file.
-
-The build_config file for a target is a json file containing information about
-how to build that target based on the target's dependencies. This includes
-things like: the javac classpath, the list of android resources dependencies,
-etc. It also includes the information needed to create the build_config for
-other targets that depend on that one.
-
-Android build scripts should not refer to the build_config directly, and the
-build specification should instead pass information in using the special
-file-arg syntax (see build_utils.py:ExpandFileArgs). That syntax allows passing
-of values in a json dict in a file and looks like this:
-  --python-arg=@FileArg(build_config_path:javac:classpath)
-
-Note: If paths to input files are passed in this way, it is important that:
-  1. inputs/deps of the action ensure that the files are available the first
-  time the action runs.
-  2. Either (a) or (b)
-    a. inputs/deps ensure that the action runs whenever one of the files changes
-    b. the files are added to the action's depfile
-"""
-
-import optparse
-import os
-import sys
-import xml.dom.minidom
-
-from util import build_utils
-
-import write_ordered_libraries
-
-class AndroidManifest(object):
-  def __init__(self, path):
-    self.path = path
-    dom = xml.dom.minidom.parse(path)
-    manifests = dom.getElementsByTagName('manifest')
-    assert len(manifests) == 1
-    self.manifest = manifests[0]
-
-  def GetInstrumentation(self):
-    instrumentation_els = self.manifest.getElementsByTagName('instrumentation')
-    if len(instrumentation_els) == 0:
-      return None
-    if len(instrumentation_els) != 1:
-      raise Exception(
-          'More than one <instrumentation> element found in %s' % self.path)
-    return instrumentation_els[0]
-
-  def CheckInstrumentation(self, expected_package):
-    instr = self.GetInstrumentation()
-    if not instr:
-      raise Exception('No <instrumentation> elements found in %s' % self.path)
-    instrumented_package = instr.getAttributeNS(
-        'http://schemas.android.com/apk/res/android', 'targetPackage')
-    if instrumented_package != expected_package:
-      raise Exception(
-          'Wrong instrumented package. Expected %s, got %s'
-          % (expected_package, instrumented_package))
-
-  def GetPackageName(self):
-    return self.manifest.getAttribute('package')
-
-
-dep_config_cache = {}
-def GetDepConfig(path):
-  if not path in dep_config_cache:
-    dep_config_cache[path] = build_utils.ReadJson(path)['deps_info']
-  return dep_config_cache[path]
-
-
-def DepsOfType(wanted_type, configs):
-  return [c for c in configs if c['type'] == wanted_type]
-
-
-def GetAllDepsConfigsInOrder(deps_config_paths):
-  def GetDeps(path):
-    return set(GetDepConfig(path)['deps_configs'])
-  return build_utils.GetSortedTransitiveDependencies(deps_config_paths, GetDeps)
-
-
-class Deps(object):
-  def __init__(self, direct_deps_config_paths):
-    self.all_deps_config_paths = GetAllDepsConfigsInOrder(
-        direct_deps_config_paths)
-    self.direct_deps_configs = [
-        GetDepConfig(p) for p in direct_deps_config_paths]
-    self.all_deps_configs = [
-        GetDepConfig(p) for p in self.all_deps_config_paths]
-
-  def All(self, wanted_type=None):
-    if type is None:
-      return self.all_deps_configs
-    return DepsOfType(wanted_type, self.all_deps_configs)
-
-  def Direct(self, wanted_type=None):
-    if wanted_type is None:
-      return self.direct_deps_configs
-    return DepsOfType(wanted_type, self.direct_deps_configs)
-
-  def AllConfigPaths(self):
-    return self.all_deps_config_paths
-
-
-def main(argv):
-  parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(parser)
-  parser.add_option('--build-config', help='Path to build_config output.')
-  parser.add_option(
-      '--type',
-      help='Type of this target (e.g. android_library).')
-  parser.add_option(
-      '--possible-deps-configs',
-      help='List of paths for dependency\'s build_config files. Some '
-      'dependencies may not write build_config files. Missing build_config '
-      'files are handled differently based on the type of this target.')
-
-  # android_resources options
-  parser.add_option('--srcjar', help='Path to target\'s resources srcjar.')
-  parser.add_option('--resources-zip', help='Path to target\'s resources zip.')
-  parser.add_option('--r-text', help='Path to target\'s R.txt file.')
-  parser.add_option('--package-name',
-      help='Java package name for these resources.')
-  parser.add_option('--android-manifest', help='Path to android manifest.')
-
-  # java library options
-  parser.add_option('--jar-path', help='Path to target\'s jar output.')
-  parser.add_option('--supports-android', action='store_true',
-      help='Whether this library supports running on the Android platform.')
-  parser.add_option('--requires-android', action='store_true',
-      help='Whether this library requires running on the Android platform.')
-  parser.add_option('--bypass-platform-checks', action='store_true',
-      help='Bypass checks for support/require Android platform.')
-
-  # android library options
-  parser.add_option('--dex-path', help='Path to target\'s dex output.')
-
-  # native library options
-  parser.add_option('--native-libs', help='List of top-level native libs.')
-  parser.add_option('--readelf-path', help='Path to toolchain\'s readelf.')
-
-  parser.add_option('--tested-apk-config',
-      help='Path to the build config of the tested apk (for an instrumentation '
-      'test apk).')
-
-  options, args = parser.parse_args(argv)
-
-  if args:
-    parser.error('No positional arguments should be given.')
-
-
-  if not options.type in [
-      'java_library', 'android_resources', 'android_apk', 'deps_dex']:
-    raise Exception('Unknown type: <%s>' % options.type)
-
-  required_options = ['build_config'] + {
-      'java_library': ['jar_path'],
-      'android_resources': ['resources_zip'],
-      'android_apk': ['jar_path', 'dex_path', 'resources_zip'],
-      'deps_dex': ['dex_path']
-    }[options.type]
-
-  if options.native_libs:
-    required_options.append('readelf_path')
-
-  build_utils.CheckOptions(options, parser, required_options)
-
-  if options.type == 'java_library':
-    if options.supports_android and not options.dex_path:
-      raise Exception('java_library that supports Android requires a dex path.')
-
-    if options.requires_android and not options.supports_android:
-      raise Exception(
-          '--supports-android is required when using --requires-android')
-
-  possible_deps_config_paths = build_utils.ParseGypList(
-      options.possible_deps_configs)
-
-  allow_unknown_deps = (options.type == 'android_apk' or
-                        options.type == 'android_resources')
-  unknown_deps = [
-      c for c in possible_deps_config_paths if not os.path.exists(c)]
-  if unknown_deps and not allow_unknown_deps:
-    raise Exception('Unknown deps: ' + str(unknown_deps))
-
-  direct_deps_config_paths = [
-      c for c in possible_deps_config_paths if not c in unknown_deps]
-
-  deps = Deps(direct_deps_config_paths)
-  direct_library_deps = deps.Direct('java_library')
-  all_library_deps = deps.All('java_library')
-
-  direct_resources_deps = deps.Direct('android_resources')
-  all_resources_deps = deps.All('android_resources')
-  # Resources should be ordered with the highest-level dependency first so that
-  # overrides are done correctly.
-  all_resources_deps.reverse()
-
-  if options.type == 'android_apk' and options.tested_apk_config:
-    tested_apk_deps = Deps([options.tested_apk_config])
-    tested_apk_resources_deps = tested_apk_deps.All('android_resources')
-    all_resources_deps = [
-        d for d in all_resources_deps if not d in tested_apk_resources_deps]
-
-  # Initialize some common config.
-  config = {
-    'deps_info': {
-      'name': os.path.basename(options.build_config),
-      'path': options.build_config,
-      'type': options.type,
-      'deps_configs': direct_deps_config_paths,
-    }
-  }
-  deps_info = config['deps_info']
-
-  if options.type == 'java_library' and not options.bypass_platform_checks:
-    deps_info['requires_android'] = options.requires_android
-    deps_info['supports_android'] = options.supports_android
-
-    deps_require_android = (all_resources_deps +
-        [d['name'] for d in all_library_deps if d['requires_android']])
-    deps_not_support_android = (
-        [d['name'] for d in all_library_deps if not d['supports_android']])
-
-    if deps_require_android and not options.requires_android:
-      raise Exception('Some deps require building for the Android platform: ' +
-          str(deps_require_android))
-
-    if deps_not_support_android and options.supports_android:
-      raise Exception('Not all deps support the Android platform: ' +
-          str(deps_not_support_android))
-
-  if options.type in ['java_library', 'android_apk']:
-    javac_classpath = [c['jar_path'] for c in direct_library_deps]
-    java_full_classpath = [c['jar_path'] for c in all_library_deps]
-    deps_info['resources_deps'] = [c['path'] for c in all_resources_deps]
-    deps_info['jar_path'] = options.jar_path
-    if options.type == 'android_apk' or options.supports_android:
-      deps_info['dex_path'] = options.dex_path
-    config['javac'] = {
-      'classpath': javac_classpath,
-    }
-    config['java'] = {
-      'full_classpath': java_full_classpath
-    }
-
-  if options.type == 'java_library':
-    # Only resources might have srcjars (normal srcjar targets are listed in
-    # srcjar_deps). A resource's srcjar contains the R.java file for those
-    # resources, and (like Android's default build system) we allow a library to
-    # refer to the resources in any of its dependents.
-    config['javac']['srcjars'] = [
-        c['srcjar'] for c in direct_resources_deps if 'srcjar' in c]
-
-  if options.type == 'android_apk':
-    # Apks will get their resources srcjar explicitly passed to the java step.
-    config['javac']['srcjars'] = []
-
-  if options.type == 'android_resources':
-    deps_info['resources_zip'] = options.resources_zip
-    if options.srcjar:
-      deps_info['srcjar'] = options.srcjar
-    if options.android_manifest:
-      manifest = AndroidManifest(options.android_manifest)
-      deps_info['package_name'] = manifest.GetPackageName()
-    if options.package_name:
-      deps_info['package_name'] = options.package_name
-    if options.r_text:
-      deps_info['r_text'] = options.r_text
-
-  if options.type == 'android_resources' or options.type == 'android_apk':
-    config['resources'] = {}
-    config['resources']['dependency_zips'] = [
-        c['resources_zip'] for c in all_resources_deps]
-    config['resources']['extra_package_names'] = []
-    config['resources']['extra_r_text_files'] = []
-
-  if options.type == 'android_apk':
-    config['resources']['extra_package_names'] = [
-        c['package_name'] for c in all_resources_deps if 'package_name' in c]
-    config['resources']['extra_r_text_files'] = [
-        c['r_text'] for c in all_resources_deps if 'r_text' in c]
-
-  if options.type in ['android_apk', 'deps_dex']:
-    deps_dex_files = [c['dex_path'] for c in all_library_deps]
-
-  # An instrumentation test apk should exclude the dex files that are in the apk
-  # under test.
-  if options.type == 'android_apk' and options.tested_apk_config:
-    tested_apk_deps = Deps([options.tested_apk_config])
-    tested_apk_library_deps = tested_apk_deps.All('java_library')
-    tested_apk_deps_dex_files = [c['dex_path'] for c in tested_apk_library_deps]
-    deps_dex_files = [
-        p for p in deps_dex_files if not p in tested_apk_deps_dex_files]
-
-    tested_apk_config = GetDepConfig(options.tested_apk_config)
-    expected_tested_package = tested_apk_config['package_name']
-    AndroidManifest(options.android_manifest).CheckInstrumentation(
-        expected_tested_package)
-
-  # Dependencies for the final dex file of an apk or a 'deps_dex'.
-  if options.type in ['android_apk', 'deps_dex']:
-    config['final_dex'] = {}
-    dex_config = config['final_dex']
-    # TODO(cjhopman): proguard version
-    dex_config['dependency_dex_files'] = deps_dex_files
-
-  if options.type == 'android_apk':
-    config['dist_jar'] = {
-      'dependency_jars': [
-        c['jar_path'] for c in all_library_deps
-      ]
-    }
-    manifest = AndroidManifest(options.android_manifest)
-    deps_info['package_name'] = manifest.GetPackageName()
-    if not options.tested_apk_config and manifest.GetInstrumentation():
-      # This must then have instrumentation only for itself.
-      manifest.CheckInstrumentation(manifest.GetPackageName())
-
-    library_paths = []
-    java_libraries_list = []
-    if options.native_libs:
-      libraries = build_utils.ParseGypList(options.native_libs)
-      if libraries:
-        libraries_dir = os.path.dirname(libraries[0])
-        write_ordered_libraries.SetReadelfPath(options.readelf_path)
-        write_ordered_libraries.SetLibraryDirs([libraries_dir])
-        all_native_library_deps = (
-            write_ordered_libraries.GetSortedTransitiveDependenciesForBinaries(
-                libraries))
-        # Create a java literal array with the "base" library names:
-        # e.g. libfoo.so -> foo
-        java_libraries_list = '{%s}' % ','.join(
-            ['"%s"' % s[3:-3] for s in all_native_library_deps])
-        library_paths = map(
-            write_ordered_libraries.FullLibraryPath, all_native_library_deps)
-
-      config['native'] = {
-        'libraries': library_paths,
-        'java_libraries_list': java_libraries_list
-      }
-
-  build_utils.WriteJson(config, options.build_config, only_if_changed=True)
-
-  if options.depfile:
-    build_utils.WriteDepfile(
-        options.depfile,
-        deps.AllConfigPaths() + build_utils.GetPythonDependencies())
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
diff --git a/build/android/gyp/write_ordered_libraries.py b/build/android/gyp/write_ordered_libraries.py
deleted file mode 100755
index 0fc9a8c..0000000
--- a/build/android/gyp/write_ordered_libraries.py
+++ /dev/null
@@ -1,144 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Writes dependency ordered list of native libraries.
-
-The list excludes any Android system libraries, as those are not bundled with
-the APK.
-
-This list of libraries is used for several steps of building an APK.
-In the component build, the --input-libraries only needs to be the top-level
-library (i.e. libcontent_shell_content_view). This will then use readelf to
-inspect the shared libraries and determine the full list of (non-system)
-libraries that should be included in the APK.
-"""
-
-# TODO(cjhopman): See if we can expose the list of library dependencies from
-# gyp, rather than calculating it ourselves.
-# http://crbug.com/225558
-
-import optparse
-import os
-import re
-import sys
-
-from util import build_utils
-
-_readelf = None
-_library_dirs = None
-
-_library_re = re.compile(
-    '.*NEEDED.*Shared library: \[(?P<library_name>.+)\]')
-
-
-def SetReadelfPath(path):
-  global _readelf
-  _readelf = path
-
-
-def SetLibraryDirs(dirs):
-  global _library_dirs
-  _library_dirs = dirs
-
-
-def FullLibraryPath(library_name):
-  assert _library_dirs is not None
-  for directory in _library_dirs:
-    path = '%s/%s' % (directory, library_name)
-    if os.path.exists(path):
-      return path
-  return library_name
-
-
-def IsSystemLibrary(library_name):
-  # If the library doesn't exist in the libraries directory, assume that it is
-  # an Android system library.
-  return not os.path.exists(FullLibraryPath(library_name))
-
-
-def CallReadElf(library_or_executable):
-  assert _readelf is not None
-  readelf_cmd = [_readelf,
-                 '-d',
-                 FullLibraryPath(library_or_executable)]
-  return build_utils.CheckOutput(readelf_cmd)
-
-
-def GetDependencies(library_or_executable):
-  elf = CallReadElf(library_or_executable)
-  return set(_library_re.findall(elf))
-
-
-def GetNonSystemDependencies(library_name):
-  all_deps = GetDependencies(library_name)
-  return set((lib for lib in all_deps if not IsSystemLibrary(lib)))
-
-
-def GetSortedTransitiveDependencies(libraries):
-  """Returns all transitive library dependencies in dependency order."""
-  return build_utils.GetSortedTransitiveDependencies(
-      libraries, GetNonSystemDependencies)
-
-
-def GetSortedTransitiveDependenciesForBinaries(binaries):
-  if binaries[0].endswith('.so'):
-    libraries = [os.path.basename(lib) for lib in binaries]
-  else:
-    assert len(binaries) == 1
-    all_deps = GetDependencies(binaries[0])
-    libraries = [lib for lib in all_deps if not IsSystemLibrary(lib)]
-
-  return GetSortedTransitiveDependencies(libraries)
-
-
-def main():
-  parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(parser)
-
-  parser.add_option('--input-libraries',
-      help='A list of top-level input libraries.')
-  parser.add_option('--libraries-dir',
-      help='The directory which contains shared libraries.')
-  parser.add_option('--readelf', help='Path to the readelf binary.')
-  parser.add_option('--output', help='Path to the generated .json file.')
-  parser.add_option('--stamp', help='Path to touch on success.')
-
-  options, _ = parser.parse_args()
-
-  SetReadelfPath(options.readelf)
-  SetLibraryDirs(options.libraries_dir.split(','))
-
-  libraries = build_utils.ParseGypList(options.input_libraries)
-  if len(libraries):
-    libraries = GetSortedTransitiveDependenciesForBinaries(libraries)
-
-  # Convert to "base" library names: e.g. libfoo.so -> foo
-  java_libraries_list = (
-      '{%s}' % ','.join(['"%s"' % s[3:-3] for s in libraries]))
-
-  out_json = {
-      'libraries': libraries,
-      'lib_paths': [FullLibraryPath(l) for l in libraries],
-      'java_libraries_list': java_libraries_list
-      }
-  build_utils.WriteJson(
-      out_json,
-      options.output,
-      only_if_changed=True)
-
-  if options.stamp:
-    build_utils.Touch(options.stamp)
-
-  if options.depfile:
-    build_utils.WriteDepfile(
-        options.depfile,
-        libraries + build_utils.GetPythonDependencies())
-
-
-if __name__ == '__main__':
-  sys.exit(main())
-
-
diff --git a/build/android/gyp/zip.py b/build/android/gyp/zip.py
deleted file mode 100755
index 51322df..0000000
--- a/build/android/gyp/zip.py
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Archives a set of files.
-"""
-
-import optparse
-import sys
-
-from util import build_utils
-
-def main():
-  parser = optparse.OptionParser()
-  parser.add_option('--input-dir', help='Directory of files to archive.')
-  parser.add_option('--output', help='Path to output archive.')
-  options, _ = parser.parse_args()
-
-  inputs = build_utils.FindInDirectory(options.input_dir, '*')
-  build_utils.DoZip(inputs, options.output, options.input_dir)
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/android/host_heartbeat.py b/build/android/host_heartbeat.py
deleted file mode 100755
index 6a7cdd1..0000000
--- a/build/android/host_heartbeat.py
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Sends a heart beat pulse to the currently online Android devices.
-This heart beat lets the devices know that they are connected to a host.
-"""
-# pylint: disable=W0702
-
-import sys
-import time
-
-from pylib.device import device_utils
-
-PULSE_PERIOD = 20
-
-def main():
-  while True:
-    try:
-      devices = device_utils.DeviceUtils.HealthyDevices()
-      for d in devices:
-        d.RunShellCommand(['touch', '/sdcard/host_heartbeat'],
-                          check_return=True)
-    except:
-      # Keep the heatbeat running bypassing all errors.
-      pass
-    time.sleep(PULSE_PERIOD)
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/android/increase_size_for_speed.gypi b/build/android/increase_size_for_speed.gypi
deleted file mode 100644
index 48d17f5..0000000
--- a/build/android/increase_size_for_speed.gypi
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright (c) 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included to optimize a target for speed
-# rather than for size on Android.
-# This is used in some carefully tailored targets and is not meant
-# to be included everywhere. Before adding the template to another target,
-# please ask in chromium-dev@. See crbug.com/411909
-
-{
-  'configurations': {
-    'Release': {
-      'target_conditions': [
-        ['_toolset=="target"', {
-          'conditions': [
-            ['OS=="android"', {
-              'cflags!': ['-Os'],
-              'cflags': ['-O2'],
-            }],
-            # Do not merge -Os and -O2 in LTO.
-            # LTO merges all optimization options at link-time. -O2 takes
-            # precedence over -Os. Avoid using LTO simultaneously
-            # on -Os and -O2 parts for that reason.
-            ['OS=="android" and use_lto==1', {
-              'cflags!': [
-                '-flto',
-                '-ffat-lto-objects',
-              ],
-            }],
-            ['OS=="android" and use_lto_o2==1', {
-              'cflags': [
-                '-flto',
-                '-ffat-lto-objects',
-              ],
-            }],
-          ],
-        }],
-      ],
-    },
-  },
-}
diff --git a/build/android/insert_chromium_version.gypi b/build/android/insert_chromium_version.gypi
deleted file mode 100644
index a6ff908..0000000
--- a/build/android/insert_chromium_version.gypi
+++ /dev/null
@@ -1,53 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into an action to provide a rule that
-# inserts a chromium version string into native libraries.
-#
-# To use this, create a gyp target with the following form:
-#  {
-#    'action_name': 'insert_chromium_version',
-#    'actions': [
-#      'variables': {
-#        'ordered_libraries_file': 'file generated by write_ordered_libraries'
-#        'stripped_libraries_dir': 'the directory contains native libraries'
-#        'input_paths': 'files to be added to the list of inputs'
-#        'stamp': 'file to touch when the action is complete'
-#        'version_string': 'chromium version string to be inserted'
-#      'includes': [ '../../build/android/insert_chromium_version.gypi' ],
-#    ],
-#  },
-#
-
-{
-  'message': 'Inserting chromium version string into native libraries',
-  'variables': {
-    'input_paths': [],
-  },
-  'inputs': [
-    '<(DEPTH)/build/android/gyp/util/build_utils.py',
-    '<(DEPTH)/build/android/gyp/insert_chromium_version.py',
-    '<(ordered_libraries_file)',
-    '>@(input_paths)',
-  ],
-  'outputs': [
-    '<(stamp)',
-  ],
-  'action': [
-    'python', '<(DEPTH)/build/android/gyp/insert_chromium_version.py',
-    '--android-objcopy=<(android_objcopy)',
-    '--stripped-libraries-dir=<(stripped_libraries_dir)',
-    '--libraries=@FileArg(<(ordered_libraries_file):libraries)',
-    '--version-string=<(version_string)',
-    '--stamp=<(stamp)',
-  ],
-  'conditions': [
-    ['component == "shared_library"', {
-      # Add a fake output to force the build to always re-run this step. This
-      # is required because the real inputs are not known at gyp-time and
-      # changing base.so may not trigger changes to dependent libraries.
-      'outputs': [ '<(stamp).fake' ]
-    }],
-  ],
-}
diff --git a/build/android/install_emulator_deps.py b/build/android/install_emulator_deps.py
deleted file mode 100755
index 82d1c75..0000000
--- a/build/android/install_emulator_deps.py
+++ /dev/null
@@ -1,277 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Installs deps for using SDK emulator for testing.
-
-The script will download the SDK and system images, if they are not present, and
-install and enable KVM, if virtualization has been enabled in the BIOS.
-"""
-
-
-import logging
-import optparse
-import os
-import re
-import shutil
-import sys
-
-from pylib import cmd_helper
-from pylib import constants
-from pylib import pexpect
-from pylib.utils import run_tests_helper
-
-# Android API level
-DEFAULT_ANDROID_API_LEVEL = constants.ANDROID_SDK_VERSION
-
-# From the Android Developer's website.
-# Keep this up to date; the user can install older API levels as necessary.
-SDK_BASE_URL = 'http://dl.google.com/android/adt'
-SDK_ZIP = 'adt-bundle-linux-x86_64-20131030.zip'
-
-# pylint: disable=line-too-long
-# Android x86 system image from the Intel website:
-# http://software.intel.com/en-us/articles/intel-eula-x86-android-4-2-jelly-bean-bin
-# These don't exist prior to Android-15.
-# As of 08 Nov 2013, Android-19 is not yet available either.
-X86_IMG_URLS = {
-  15: 'https://software.intel.com/sites/landingpage/android/sysimg_x86-15_r01.zip',
-  16: 'https://software.intel.com/sites/landingpage/android/sysimg_x86-16_r01.zip',
-  17: 'https://software.intel.com/sites/landingpage/android/sysimg_x86-17_r01.zip',
-  18: 'https://software.intel.com/sites/landingpage/android/sysimg_x86-18_r01.zip',
-  19: 'https://software.intel.com/sites/landingpage/android/sysimg_x86-19_r01.zip'}
-#pylint: enable=line-too-long
-
-def CheckSDK():
-  """Check if SDK is already installed.
-
-  Returns:
-    True if the emulator SDK directory (src/android_emulator_sdk/) exists.
-  """
-  return os.path.exists(constants.EMULATOR_SDK_ROOT)
-
-
-def CheckSDKPlatform(api_level=DEFAULT_ANDROID_API_LEVEL):
-  """Check if the "SDK Platform" for the specified API level is installed.
-     This is necessary in order for the emulator to run when the target
-     is specified.
-
-  Args:
-    api_level: the Android API level to check; defaults to the latest API.
-
-  Returns:
-    True if the platform is already installed.
-  """
-  android_binary = os.path.join(constants.EMULATOR_SDK_ROOT,
-                                'sdk', 'tools', 'android')
-  pattern = re.compile('id: [0-9]+ or "android-%d"' % api_level)
-  try:
-    exit_code, stdout = cmd_helper.GetCmdStatusAndOutput(
-        [android_binary, 'list'])
-    if exit_code != 0:
-      raise Exception('\'android list\' command failed')
-    for line in stdout.split('\n'):
-      if pattern.match(line):
-        return True
-    return False
-  except OSError:
-    logging.exception('Unable to execute \'android list\'')
-    return False
-
-
-def CheckX86Image(api_level=DEFAULT_ANDROID_API_LEVEL):
-  """Check if Android system images have been installed.
-
-  Args:
-    api_level: the Android API level to check for; defaults to the latest API.
-
-  Returns:
-    True if sdk/system-images/android-<api_level>/x86 exists inside
-    EMULATOR_SDK_ROOT.
-  """
-  api_target = 'android-%d' % api_level
-  return os.path.exists(os.path.join(constants.EMULATOR_SDK_ROOT,
-                                     'sdk', 'system-images',
-                                     api_target, 'x86'))
-
-
-def CheckKVM():
-  """Quickly check whether KVM is enabled.
-
-  Returns:
-    True iff /dev/kvm exists (Linux only).
-  """
-  return os.path.exists('/dev/kvm')
-
-
-def RunKvmOk():
-  """Run kvm-ok as root to check that KVM is properly enabled after installation
-     of the required packages.
-
-  Returns:
-    True iff KVM is enabled (/dev/kvm exists). On failure, returns False
-    but also print detailed information explaining why KVM isn't enabled
-    (e.g. CPU doesn't support it, or BIOS disabled it).
-  """
-  try:
-    # Note: kvm-ok is in /usr/sbin, so always use 'sudo' to run it.
-    return not cmd_helper.RunCmd(['sudo', 'kvm-ok'])
-  except OSError:
-    logging.info('kvm-ok not installed')
-    return False
-
-
-def GetSDK():
-  """Download the SDK and unzip it into EMULATOR_SDK_ROOT."""
-  logging.info('Download Android SDK.')
-  sdk_url = '%s/%s' % (SDK_BASE_URL, SDK_ZIP)
-  try:
-    cmd_helper.RunCmd(['curl', '-o', '/tmp/sdk.zip', sdk_url])
-    print 'curled unzipping...'
-    rc = cmd_helper.RunCmd(['unzip', '-o', '/tmp/sdk.zip', '-d', '/tmp/'])
-    if rc:
-      raise Exception('ERROR: could not download/unzip Android SDK.')
-    # Get the name of the sub-directory that everything will be extracted to.
-    dirname, _ = os.path.splitext(SDK_ZIP)
-    zip_dir = '/tmp/%s' % dirname
-    # Move the extracted directory to EMULATOR_SDK_ROOT
-    shutil.move(zip_dir, constants.EMULATOR_SDK_ROOT)
-  finally:
-    os.unlink('/tmp/sdk.zip')
-
-
-def InstallKVM():
-  """Installs KVM packages."""
-  rc = cmd_helper.RunCmd(['sudo', 'apt-get', 'install', 'kvm'])
-  if rc:
-    logging.critical('ERROR: Did not install KVM. Make sure hardware '
-                     'virtualization is enabled in BIOS (i.e. Intel VT-x or '
-                     'AMD SVM).')
-  # TODO(navabi): Use modprobe kvm-amd on AMD processors.
-  rc = cmd_helper.RunCmd(['sudo', 'modprobe', 'kvm-intel'])
-  if rc:
-    logging.critical('ERROR: Did not add KVM module to Linux Kernel. Make sure '
-                     'hardware virtualization is enabled in BIOS.')
-  # Now check to ensure KVM acceleration can be used.
-  if not RunKvmOk():
-    logging.critical('ERROR: Can not use KVM acceleration. Make sure hardware '
-                     'virtualization is enabled in BIOS (i.e. Intel VT-x or '
-                     'AMD SVM).')
-
-
-def GetX86Image(api_level=DEFAULT_ANDROID_API_LEVEL):
-  """Download x86 system image from Intel's website.
-
-  Args:
-    api_level: the Android API level to download for.
-  """
-  logging.info('Download x86 system image directory into sdk directory.')
-  # TODO(andrewhayden): Use python tempfile lib instead
-  temp_file = '/tmp/x86_img_android-%d.zip' % api_level
-  if api_level not in X86_IMG_URLS:
-    raise Exception('ERROR: no URL known for x86 image for android-%s' %
-                    api_level)
-  try:
-    cmd_helper.RunCmd(['curl', '-o', temp_file, X86_IMG_URLS[api_level]])
-    rc = cmd_helper.RunCmd(['unzip', '-o', temp_file, '-d', '/tmp/'])
-    if rc:
-      raise Exception('ERROR: Could not download/unzip image zip.')
-    api_target = 'android-%d' % api_level
-    sys_imgs = os.path.join(constants.EMULATOR_SDK_ROOT, 'sdk',
-                            'system-images', api_target, 'x86')
-    logging.info('Deploying system image to %s' % sys_imgs)
-    shutil.move('/tmp/x86', sys_imgs)
-  finally:
-    os.unlink(temp_file)
-
-
-def GetSDKPlatform(api_level=DEFAULT_ANDROID_API_LEVEL):
-  """Update the SDK to include the platform specified.
-
-  Args:
-    api_level: the Android API level to download
-  """
-  android_binary = os.path.join(constants.EMULATOR_SDK_ROOT,
-                                'sdk', 'tools', 'android')
-  pattern = re.compile(
-      r'\s*([0-9]+)- SDK Platform Android [\.,0-9]+, API %d.*' % api_level)
-  # Example:
-  #   2- SDK Platform Android 4.3, API 18, revision 2
-  exit_code, stdout = cmd_helper.GetCmdStatusAndOutput(
-      [android_binary, 'list', 'sdk'])
-  if exit_code != 0:
-    raise Exception('\'android list sdk\' command return %d' % exit_code)
-  for line in stdout.split('\n'):
-    match = pattern.match(line)
-    if match:
-      index = match.group(1)
-      print 'package %s corresponds to platform level %d' % (index, api_level)
-      # update sdk --no-ui --filter $INDEX
-      update_command = [android_binary,
-                        'update', 'sdk', '--no-ui', '--filter', index]
-      update_command_str = ' '.join(update_command)
-      logging.info('running update command: %s' % update_command_str)
-      update_process = pexpect.spawn(update_command_str)
-      # TODO(andrewhayden): Do we need to bug the user about this?
-      if update_process.expect('Do you accept the license') != 0:
-        raise Exception('License agreement check failed')
-      update_process.sendline('y')
-      if update_process.expect('Done. 1 package installed.') == 0:
-        print 'Successfully installed platform for API level %d' % api_level
-        return
-      else:
-        raise Exception('Failed to install platform update')
-  raise Exception('Could not find android-%d update for the SDK!' % api_level)
-
-
-def main(argv):
-  opt_parser = optparse.OptionParser(
-      description='Install dependencies for running the Android emulator')
-  opt_parser.add_option('--api-level', dest='api_level',
-      help='The API level (e.g., 19 for Android 4.4) to ensure is available',
-      type='int', default=DEFAULT_ANDROID_API_LEVEL)
-  opt_parser.add_option('-v', dest='verbose', action='store_true',
-      help='enable verbose logging')
-  options, _ = opt_parser.parse_args(argv[1:])
-
-  # run_tests_helper will set logging to INFO or DEBUG
-  # We achieve verbose output by configuring it with 2 (==DEBUG)
-  verbosity = 1
-  if options.verbose:
-    verbosity = 2
-  logging.basicConfig(level=logging.INFO,
-                      format='# %(asctime)-15s: %(message)s')
-  run_tests_helper.SetLogLevel(verbose_count=verbosity)
-
-  # Calls below will download emulator SDK and/or system images only if needed.
-  if CheckSDK():
-    logging.info('android_emulator_sdk/ already exists, skipping download.')
-  else:
-    GetSDK()
-
-  # Check target. The target has to be installed in order to run the emulator.
-  if CheckSDKPlatform(options.api_level):
-    logging.info('SDK platform android-%d already present, skipping.' %
-                 options.api_level)
-  else:
-    logging.info('SDK platform android-%d not present, installing.' %
-                 options.api_level)
-    GetSDKPlatform(options.api_level)
-
-  # Download the x86 system image only if needed.
-  if CheckX86Image(options.api_level):
-    logging.info('x86 image for android-%d already present, skipping.' %
-                 options.api_level)
-  else:
-    GetX86Image(options.api_level)
-
-  # Make sure KVM packages are installed and enabled.
-  if CheckKVM():
-    logging.info('KVM already installed and enabled.')
-  else:
-    InstallKVM()
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv))
diff --git a/build/android/instr_action.gypi b/build/android/instr_action.gypi
deleted file mode 100644
index fa6d062..0000000
--- a/build/android/instr_action.gypi
+++ /dev/null
@@ -1,53 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into an action to provide a rule that
-# instruments either java class files, or jars.
-
-{
-  'variables': {
-    'instr_type%': 'jar',
-    'input_path%': '',
-    'output_path%': '',
-    'stamp_path%': '',
-    'extra_instr_args': [
-      '--coverage-file=<(_target_name).em',
-      '--sources-file=<(_target_name)_sources.txt',
-    ],
-    'emma_jar': '<(android_sdk_root)/tools/lib/emma.jar',
-    'conditions': [
-      ['emma_instrument != 0', {
-        'extra_instr_args': [
-          '--sources=<(java_in_dir)/src >(additional_src_dirs) >(generated_src_dirs)',
-          '--src-root=<(DEPTH)',
-          '--emma-jar=<(emma_jar)',
-          '--filter-string=<(emma_filter)',
-        ],
-        'conditions': [
-          ['instr_type == "jar"', {
-            'instr_action': 'instrument_jar',
-          }, {
-            'instr_action': 'instrument_classes',
-          }]
-        ],
-      }, {
-        'instr_action': 'copy',
-        'extra_instr_args': [],
-      }]
-    ]
-  },
-  'inputs': [
-    '<(DEPTH)/build/android/gyp/emma_instr.py',
-    '<(DEPTH)/build/android/gyp/util/build_utils.py',
-    '<(DEPTH)/build/android/pylib/utils/command_option_parser.py',
-  ],
-  'action': [
-    'python', '<(DEPTH)/build/android/gyp/emma_instr.py',
-    '<(instr_action)',
-    '--input-path=<(input_path)',
-    '--output-path=<(output_path)',
-    '--stamp=<(stamp_path)',
-    '<@(extra_instr_args)',
-  ]
-}
diff --git a/build/android/java_cpp_enum.gypi b/build/android/java_cpp_enum.gypi
deleted file mode 100644
index d4abafa..0000000
--- a/build/android/java_cpp_enum.gypi
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into a target to provide an action
-# to generate Java source files from a C++ header file containing annotated
-# enum definitions using a Python script.
-#
-# To use this, create a gyp target with the following form:
-#  {
-#    'target_name': 'bitmap_format_java',
-#    'type': 'none',
-#    'variables': {
-#      'source_file': 'ui/android/bitmap_format.h',
-#    },
-#    'includes': [ '../build/android/java_cpp_enum.gypi' ],
-#  },
-#
-# Then have the gyp target which compiles the java code depend on the newly
-# created target.
-
-{
-  'variables': {
-    # Location where all generated Java sources will be placed.
-    'output_dir': '<(SHARED_INTERMEDIATE_DIR)/enums/<(_target_name)',
-    'generator_path': '<(DEPTH)/build/android/gyp/java_cpp_enum.py',
-    'generator_args': '<(output_dir) <(source_file)',
-  },
-  'direct_dependent_settings': {
-    'variables': {
-      # Ensure that the output directory is used in the class path
-      # when building targets that depend on this one.
-      'generated_src_dirs': [
-        '<(output_dir)/',
-      ],
-      # Ensure that the targets depending on this one are rebuilt if the sources
-      # of this one are modified.
-      'additional_input_paths': [
-        '<(source_file)',
-      ],
-    },
-  },
-  'actions': [
-    {
-      'action_name': 'generate_java_constants',
-      'inputs': [
-        '<(DEPTH)/build/android/gyp/util/build_utils.py',
-        '<(generator_path)',
-        '<(source_file)',
-      ],
-      'outputs': [
-        # This is the main reason this is an action and not a rule. Gyp doesn't
-        # properly expand RULE_INPUT_PATH here and so it's impossible to
-        # calculate the list of outputs.
-        '<!@pymod_do_main(java_cpp_enum --print_output_only '
-            '<@(generator_args))',
-      ],
-      'action': [
-        'python', '<(generator_path)', '<@(generator_args)'
-      ],
-      'message': 'Generating Java from cpp header <(source_file)',
-    },
-  ],
-}
diff --git a/build/android/java_cpp_template.gypi b/build/android/java_cpp_template.gypi
deleted file mode 100644
index 3296659..0000000
--- a/build/android/java_cpp_template.gypi
+++ /dev/null
@@ -1,81 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into a target to provide a rule
-# to generate Java source files from templates that are processed
-# through the host C pre-processor.
-#
-# NOTE: For generating Java conterparts to enums prefer using the java_cpp_enum
-#       rule instead.
-#
-# To use this, create a gyp target with the following form:
-#  {
-#    'target_name': 'android_net_java_constants',
-#    'type': 'none',
-#    'sources': [
-#      'net/android/NetError.template',
-#    ],
-#    'variables': {
-#      'package_name': 'org/chromium/net',
-#      'template_deps': ['base/net_error_list.h'],
-#    },
-#    'includes': [ '../build/android/java_cpp_template.gypi' ],
-#  },
-#
-# The 'sources' entry should only list template file. The template file
-# itself should use the 'ClassName.template' format, and will generate
-# 'gen/templates/<target-name>/<package-name>/ClassName.java. The files which
-# template dependents on and typically included by the template should be listed
-# in template_deps variables. Any change to them will force a rebuild of
-# the template, and hence of any source that depends on it.
-#
-
-{
-  # Location where all generated Java sources will be placed.
-  'variables': {
-    'include_path%': '<(DEPTH)',
-    'output_dir': '<(SHARED_INTERMEDIATE_DIR)/templates/<(_target_name)/<(package_name)',
-  },
-  'direct_dependent_settings': {
-    'variables': {
-      # Ensure that the output directory is used in the class path
-      # when building targets that depend on this one.
-      'generated_src_dirs': [
-        '<(output_dir)/',
-      ],
-      # Ensure dependents are rebuilt when sources for this rule change.
-      'additional_input_paths': [
-        '<@(_sources)',
-        '<@(template_deps)',
-      ],
-    },
-  },
-  # Define a single rule that will be apply to each .template file
-  # listed in 'sources'.
-  'rules': [
-    {
-      'rule_name': 'generate_java_constants',
-      'extension': 'template',
-      # Set template_deps as additional dependencies.
-      'variables': {
-        'output_path': '<(output_dir)/<(RULE_INPUT_ROOT).java',
-      },
-      'inputs': [
-        '<(DEPTH)/build/android/gyp/util/build_utils.py',
-        '<(DEPTH)/build/android/gyp/gcc_preprocess.py',
-        '<@(template_deps)'
-      ],
-      'outputs': [
-        '<(output_path)',
-      ],
-      'action': [
-        'python', '<(DEPTH)/build/android/gyp/gcc_preprocess.py',
-        '--include-path=<(include_path)',
-        '--output=<(output_path)',
-        '--template=<(RULE_INPUT_PATH)',
-      ],
-      'message': 'Generating Java from cpp template <(RULE_INPUT_PATH)',
-    }
-  ],
-}
diff --git a/build/android/jinja_template.gypi b/build/android/jinja_template.gypi
deleted file mode 100644
index 9c49360..0000000
--- a/build/android/jinja_template.gypi
+++ /dev/null
@@ -1,85 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into a target to process one or more
-# Jinja templates.
-#
-# To process a single template file, create a gyp target with the following
-# form:
-#  {
-#    'target_name': 'chrome_shell_manifest',
-#    'type': 'none',
-#    'variables': {
-#      'jinja_inputs': ['android/shell/java/AndroidManifest.xml'],
-#      'jinja_output': '<(SHARED_INTERMEDIATE_DIR)/chrome_shell_manifest/AndroidManifest.xml',
-#      'jinja_variables': ['app_name=ChromeShell'],
-#    },
-#    'includes': [ '../build/android/jinja_template.gypi' ],
-#  },
-#
-# To process multiple template files and package the results into a zip file,
-# create a gyp target with the following form:
-#  {
-#    'target_name': 'chrome_template_resources',
-#    'type': 'none',
-#    'variables': {
-#       'jinja_inputs_base_dir': 'android/shell/java/res_template',
-#       'jinja_inputs': [
-#         '<(jinja_inputs_base_dir)/xml/searchable.xml',
-#         '<(jinja_inputs_base_dir)/xml/syncadapter.xml',
-#       ],
-#       'jinja_outputs_zip': '<(PRODUCT_DIR)/res.java/<(_target_name).zip',
-#       'jinja_variables': ['app_name=ChromeShell'],
-#     },
-#     'includes': [ '../build/android/jinja_template.gypi' ],
-#   },
-#
-
-{
-  'actions': [
-    {
-      'action_name': '<(_target_name)_jinja_template',
-      'message': 'processing jinja template',
-      'variables': {
-        'jinja_output%': '',
-        'jinja_outputs_zip%': '',
-        'jinja_inputs_base_dir%': '',
-        'jinja_includes%': [],
-        'jinja_variables%': [],
-        'jinja_args': [],
-      },
-      'inputs': [
-        '<(DEPTH)/build/android/gyp/util/build_utils.py',
-        '<(DEPTH)/build/android/gyp/jinja_template.py',
-        '<@(jinja_inputs)',
-        '<@(jinja_includes)',
-      ],
-      'conditions': [
-        ['jinja_output != ""', {
-          'outputs': [ '<(jinja_output)' ],
-          'variables': {
-            'jinja_args': ['--output', '<(jinja_output)'],
-          },
-        }],
-        ['jinja_outputs_zip != ""', {
-          'outputs': [ '<(jinja_outputs_zip)' ],
-          'variables': {
-            'jinja_args': ['--outputs-zip', '<(jinja_outputs_zip)'],
-          },
-        }],
-        ['jinja_inputs_base_dir != ""', {
-          'variables': {
-            'jinja_args': ['--inputs-base-dir', '<(jinja_inputs_base_dir)'],
-          },
-        }],
-      ],
-      'action': [
-        'python', '<(DEPTH)/build/android/gyp/jinja_template.py',
-        '--inputs', '<(jinja_inputs)',
-        '--variables', '<(jinja_variables)',
-        '<@(jinja_args)',
-      ],
-    },
-  ],
-}
diff --git a/build/android/lighttpd_server.py b/build/android/lighttpd_server.py
deleted file mode 100755
index a5195ac..0000000
--- a/build/android/lighttpd_server.py
+++ /dev/null
@@ -1,256 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Provides a convenient wrapper for spawning a test lighttpd instance.
-
-Usage:
-  lighttpd_server PATH_TO_DOC_ROOT
-"""
-
-import codecs
-import contextlib
-import httplib
-import os
-import random
-import shutil
-import socket
-import subprocess
-import sys
-import tempfile
-import time
-
-from pylib import constants
-from pylib import pexpect
-
-class LighttpdServer(object):
-  """Wraps lighttpd server, providing robust startup.
-
-  Args:
-    document_root: Path to root of this server's hosted files.
-    port: TCP port on the _host_ machine that the server will listen on. If
-        ommitted it will attempt to use 9000, or if unavailable it will find
-        a free port from 8001 - 8999.
-    lighttpd_path, lighttpd_module_path: Optional paths to lighttpd binaries.
-    base_config_path: If supplied this file will replace the built-in default
-        lighttpd config file.
-    extra_config_contents: If specified, this string will be appended to the
-        base config (default built-in, or from base_config_path).
-    config_path, error_log, access_log: Optional paths where the class should
-        place temprary files for this session.
-  """
-
-  def __init__(self, document_root, port=None,
-               lighttpd_path=None, lighttpd_module_path=None,
-               base_config_path=None, extra_config_contents=None,
-               config_path=None, error_log=None, access_log=None):
-    self.temp_dir = tempfile.mkdtemp(prefix='lighttpd_for_chrome_android')
-    self.document_root = os.path.abspath(document_root)
-    self.fixed_port = port
-    self.port = port or constants.LIGHTTPD_DEFAULT_PORT
-    self.server_tag = 'LightTPD ' + str(random.randint(111111, 999999))
-    self.lighttpd_path = lighttpd_path or '/usr/sbin/lighttpd'
-    self.lighttpd_module_path = lighttpd_module_path or '/usr/lib/lighttpd'
-    self.base_config_path = base_config_path
-    self.extra_config_contents = extra_config_contents
-    self.config_path = config_path or self._Mktmp('config')
-    self.error_log = error_log or self._Mktmp('error_log')
-    self.access_log = access_log or self._Mktmp('access_log')
-    self.pid_file = self._Mktmp('pid_file')
-    self.process = None
-
-  def _Mktmp(self, name):
-    return os.path.join(self.temp_dir, name)
-
-  @staticmethod
-  def _GetRandomPort():
-    # The ports of test server is arranged in constants.py.
-    return random.randint(constants.LIGHTTPD_RANDOM_PORT_FIRST,
-                          constants.LIGHTTPD_RANDOM_PORT_LAST)
-
-  def StartupHttpServer(self):
-    """Starts up a http server with specified document root and port."""
-    # If we want a specific port, make sure no one else is listening on it.
-    if self.fixed_port:
-      self._KillProcessListeningOnPort(self.fixed_port)
-    while True:
-      if self.base_config_path:
-        # Read the config
-        with codecs.open(self.base_config_path, 'r', 'utf-8') as f:
-          config_contents = f.read()
-      else:
-        config_contents = self._GetDefaultBaseConfig()
-      if self.extra_config_contents:
-        config_contents += self.extra_config_contents
-      # Write out the config, filling in placeholders from the members of |self|
-      with codecs.open(self.config_path, 'w', 'utf-8') as f:
-        f.write(config_contents % self.__dict__)
-      if (not os.path.exists(self.lighttpd_path) or
-          not os.access(self.lighttpd_path, os.X_OK)):
-        raise EnvironmentError(
-            'Could not find lighttpd at %s.\n'
-            'It may need to be installed (e.g. sudo apt-get install lighttpd)'
-            % self.lighttpd_path)
-      self.process = pexpect.spawn(self.lighttpd_path,
-                                   ['-D', '-f', self.config_path,
-                                    '-m', self.lighttpd_module_path],
-                                   cwd=self.temp_dir)
-      client_error, server_error = self._TestServerConnection()
-      if not client_error:
-        assert int(open(self.pid_file, 'r').read()) == self.process.pid
-        break
-      self.process.close()
-
-      if self.fixed_port or not 'in use' in server_error:
-        print 'Client error:', client_error
-        print 'Server error:', server_error
-        return False
-      self.port = self._GetRandomPort()
-    return True
-
-  def ShutdownHttpServer(self):
-    """Shuts down our lighttpd processes."""
-    if self.process:
-      self.process.terminate()
-    shutil.rmtree(self.temp_dir, ignore_errors=True)
-
-  def _TestServerConnection(self):
-    # Wait for server to start
-    server_msg = ''
-    for timeout in xrange(1, 5):
-      client_error = None
-      try:
-        with contextlib.closing(httplib.HTTPConnection(
-            '127.0.0.1', self.port, timeout=timeout)) as http:
-          http.set_debuglevel(timeout > 3)
-          http.request('HEAD', '/')
-          r = http.getresponse()
-          r.read()
-          if (r.status == 200 and r.reason == 'OK' and
-              r.getheader('Server') == self.server_tag):
-            return (None, server_msg)
-          client_error = ('Bad response: %s %s version %s\n  ' %
-                          (r.status, r.reason, r.version) +
-                          '\n  '.join([': '.join(h) for h in r.getheaders()]))
-      except (httplib.HTTPException, socket.error) as client_error:
-        pass  # Probably too quick connecting: try again
-      # Check for server startup error messages
-      ix = self.process.expect([pexpect.TIMEOUT, pexpect.EOF, '.+'],
-                               timeout=timeout)
-      if ix == 2:  # stdout spew from the server
-        server_msg += self.process.match.group(0)
-      elif ix == 1:  # EOF -- server has quit so giveup.
-        client_error = client_error or 'Server exited'
-        break
-    return (client_error or 'Timeout', server_msg)
-
-  @staticmethod
-  def _KillProcessListeningOnPort(port):
-    """Checks if there is a process listening on port number |port| and
-    terminates it if found.
-
-    Args:
-      port: Port number to check.
-    """
-    if subprocess.call(['fuser', '-kv', '%d/tcp' % port]) == 0:
-      # Give the process some time to terminate and check that it is gone.
-      time.sleep(2)
-      assert subprocess.call(['fuser', '-v', '%d/tcp' % port]) != 0, \
-          'Unable to kill process listening on port %d.' % port
-
-  @staticmethod
-  def _GetDefaultBaseConfig():
-    return """server.tag                  = "%(server_tag)s"
-server.modules              = ( "mod_access",
-                                "mod_accesslog",
-                                "mod_alias",
-                                "mod_cgi",
-                                "mod_rewrite" )
-
-# default document root required
-#server.document-root = "."
-
-# files to check for if .../ is requested
-index-file.names            = ( "index.php", "index.pl", "index.cgi",
-                                "index.html", "index.htm", "default.htm" )
-# mimetype mapping
-mimetype.assign             = (
-  ".gif"          =>      "image/gif",
-  ".jpg"          =>      "image/jpeg",
-  ".jpeg"         =>      "image/jpeg",
-  ".png"          =>      "image/png",
-  ".svg"          =>      "image/svg+xml",
-  ".css"          =>      "text/css",
-  ".html"         =>      "text/html",
-  ".htm"          =>      "text/html",
-  ".xhtml"        =>      "application/xhtml+xml",
-  ".xhtmlmp"      =>      "application/vnd.wap.xhtml+xml",
-  ".js"           =>      "application/x-javascript",
-  ".log"          =>      "text/plain",
-  ".conf"         =>      "text/plain",
-  ".text"         =>      "text/plain",
-  ".txt"          =>      "text/plain",
-  ".dtd"          =>      "text/xml",
-  ".xml"          =>      "text/xml",
-  ".manifest"     =>      "text/cache-manifest",
- )
-
-# Use the "Content-Type" extended attribute to obtain mime type if possible
-mimetype.use-xattr          = "enable"
-
-##
-# which extensions should not be handle via static-file transfer
-#
-# .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
-static-file.exclude-extensions = ( ".php", ".pl", ".cgi" )
-
-server.bind = "127.0.0.1"
-server.port = %(port)s
-
-## virtual directory listings
-dir-listing.activate        = "enable"
-#dir-listing.encoding       = "iso-8859-2"
-#dir-listing.external-css   = "style/oldstyle.css"
-
-## enable debugging
-#debug.log-request-header   = "enable"
-#debug.log-response-header  = "enable"
-#debug.log-request-handling = "enable"
-#debug.log-file-not-found   = "enable"
-
-#### SSL engine
-#ssl.engine                 = "enable"
-#ssl.pemfile                = "server.pem"
-
-# Autogenerated test-specific config follows.
-
-cgi.assign = ( ".cgi"  => "/usr/bin/env",
-               ".pl"   => "/usr/bin/env",
-               ".asis" => "/bin/cat",
-               ".php"  => "/usr/bin/php-cgi" )
-
-server.errorlog = "%(error_log)s"
-accesslog.filename = "%(access_log)s"
-server.upload-dirs = ( "/tmp" )
-server.pid-file = "%(pid_file)s"
-server.document-root = "%(document_root)s"
-
-"""
-
-
-def main(argv):
-  server = LighttpdServer(*argv[1:])
-  try:
-    if server.StartupHttpServer():
-      raw_input('Server running at http://127.0.0.1:%s -'
-                ' press Enter to exit it.' % server.port)
-    else:
-      print 'Server exit code:', server.process.exitstatus
-  finally:
-    server.ShutdownHttpServer()
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv))
diff --git a/build/android/lint/OWNERS b/build/android/lint/OWNERS
deleted file mode 100644
index cd396e7..0000000
--- a/build/android/lint/OWNERS
+++ /dev/null
@@ -1,2 +0,0 @@
-newt@chromium.org
-aurimas@chromium.org
diff --git a/build/android/lint/suppress.py b/build/android/lint/suppress.py
deleted file mode 100755
index 52d7579..0000000
--- a/build/android/lint/suppress.py
+++ /dev/null
@@ -1,115 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Add all generated lint_result.xml files to suppressions.xml"""
-
-
-import collections
-import optparse
-import os
-import sys
-from xml.dom import minidom
-
-_BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), '..')
-sys.path.append(_BUILD_ANDROID_DIR)
-
-from pylib import constants
-
-
-_THIS_FILE = os.path.abspath(__file__)
-_CONFIG_PATH = os.path.join(os.path.dirname(_THIS_FILE), 'suppressions.xml')
-_DOC = (
-    '\nSTOP! It looks like you want to suppress some lint errors:\n'
-    '- Have you tried identifing the offending patch?\n'
-    '  Ask the author for a fix and/or revert the patch.\n'
-    '- It is preferred to add suppressions in the code instead of\n'
-    '  sweeping it under the rug here. See:\n\n'
-    '    http://developer.android.com/tools/debugging/improving-w-lint.html\n'
-    '\n'
-    'Still reading?\n'
-    '- You can edit this file manually to suppress an issue\n'
-    '  globally if it is not applicable to the project.\n'
-    '- You can also automatically add issues found so for in the\n'
-    '  build process by running:\n\n'
-    '    ' + os.path.relpath(_THIS_FILE, constants.DIR_SOURCE_ROOT) + '\n\n'
-    '  which will generate this file (Comments are not preserved).\n'
-    '  Note: PRODUCT_DIR will be substituted at run-time with actual\n'
-    '  directory path (e.g. out/Debug)\n'
-)
-
-
-_Issue = collections.namedtuple('Issue', ['severity', 'paths'])
-
-
-def _ParseConfigFile(config_path):
-  print 'Parsing %s' % config_path
-  issues_dict = {}
-  dom = minidom.parse(config_path)
-  for issue in dom.getElementsByTagName('issue'):
-    issue_id = issue.attributes['id'].value
-    severity = issue.getAttribute('severity')
-    paths = set(
-        [p.attributes['path'].value for p in
-         issue.getElementsByTagName('ignore')])
-    issues_dict[issue_id] = _Issue(severity, paths)
-  return issues_dict
-
-
-def _ParseAndMergeResultFile(result_path, issues_dict):
-  print 'Parsing and merging %s' % result_path
-  dom = minidom.parse(result_path)
-  for issue in dom.getElementsByTagName('issue'):
-    issue_id = issue.attributes['id'].value
-    severity = issue.attributes['severity'].value
-    path = issue.getElementsByTagName('location')[0].attributes['file'].value
-    if issue_id not in issues_dict:
-      issues_dict[issue_id] = _Issue(severity, set())
-    issues_dict[issue_id].paths.add(path)
-
-
-def _WriteConfigFile(config_path, issues_dict):
-  new_dom = minidom.getDOMImplementation().createDocument(None, 'lint', None)
-  top_element = new_dom.documentElement
-  top_element.appendChild(new_dom.createComment(_DOC))
-  for issue_id in sorted(issues_dict.keys()):
-    severity = issues_dict[issue_id].severity
-    paths = issues_dict[issue_id].paths
-    issue = new_dom.createElement('issue')
-    issue.attributes['id'] = issue_id
-    if severity:
-      issue.attributes['severity'] = severity
-    if severity == 'ignore':
-      print 'Warning: [%s] is suppressed globally.' % issue_id
-    else:
-      for path in sorted(paths):
-        ignore = new_dom.createElement('ignore')
-        ignore.attributes['path'] = path
-        issue.appendChild(ignore)
-    top_element.appendChild(issue)
-
-  with open(config_path, 'w') as f:
-    f.write(new_dom.toprettyxml(indent='  ', encoding='utf-8'))
-  print 'Updated %s' % config_path
-
-
-def _Suppress(config_path, result_path):
-  issues_dict = _ParseConfigFile(config_path)
-  _ParseAndMergeResultFile(result_path, issues_dict)
-  _WriteConfigFile(config_path, issues_dict)
-
-
-def main():
-  parser = optparse.OptionParser(usage='%prog RESULT-FILE')
-  _, args = parser.parse_args()
-
-  if len(args) != 1 or not os.path.exists(args[0]):
-    parser.error('Must provide RESULT-FILE')
-
-  _Suppress(_CONFIG_PATH, args[0])
-
-
-if __name__ == '__main__':
-  main()
diff --git a/build/android/lint/suppressions.xml b/build/android/lint/suppressions.xml
deleted file mode 100644
index cb77c1f..0000000
--- a/build/android/lint/suppressions.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<lint>
-  <!--
-STOP! It looks like you want to suppress some lint errors:
-- Have you tried identifing the offending patch?
-  Ask the author for a fix and/or revert the patch.
-- It is preferred to add suppressions in the code instead of
-  sweeping it under the rug here. See:
-
-    http://developer.android.com/tools/debugging/improving-w-lint.html
-
-Still reading?
-- You can edit this file manually to suppress an issue
-  globally if it is not applicable to the project.
-- You can also automatically add issues found so for in the
-  build process by running:
-
-    build/android/lint/suppress.py
-
-  which will generate this file (Comments are not preserved).
-  Note: PRODUCT_DIR will be substituted at run-time with actual
-  directory path (e.g. out/Debug)
--->
-  <issue id="AllowBackup">
-    <ignore path="AndroidManifest.xml"/>
-  </issue>
-  <issue id="Assert" severity="ignore"/>
-  <issue id="CommitPrefEdits">
-    <ignore path="third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidChannelPreferences.java"/>
-  </issue>
-  <issue id="DefaultLocale">
-    <ignore path="third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/contrib/AndroidListenerState.java"/>
-  </issue>
-  <issue id="DrawAllocation">
-    <ignore path="content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java"/>
-    <ignore path="content/public/android/java/src/org/chromium/content/browser/PopupZoomer.java"/>
-  </issue>
-  <issue id="ExportedContentProvider">
-    <ignore path="AndroidManifest.xml"/>
-  </issue>
-  <issue id="HandlerLeak">
-    <ignore path="remoting/android/java/src/org/chromium/chromoting/TapGestureDetector.java"/>
-  </issue>
-  <issue id="HardcodedDebugMode" severity="Fatal">
-    <ignore path="AndroidManifest.xml"/>
-  </issue>
-  <issue id="IconDensities">
-    <!-- crbug.com/457918 is tracking missing assets -->
-    <ignore path="components/web_contents_delegate_android/android/java/res/drawable-xxhdpi"/>
-    <ignore path="components/web_contents_delegate_android/android/java/res/drawable-xxxhdpi"/>
-    <ignore path="content/public/android/java/res/drawable-xxhdpi"/>
-    <ignore path="content/public/android/java/res/drawable-xxxhdpi"/>
-    <ignore path="chrome/android/java/res/drawable-xxhdpi"/>
-    <ignore path="chrome/android/java/res/drawable-xxxhdpi"/>
-    <ignore path="ui/android/java/res/drawable-xxhdpi"/>
-    <ignore path="ui/android/java/res/drawable-xxxhdpi"/>
-    <ignore regexp=".*: reader_mode_bar_background.9.png, tabs_moved_htc.png, tabs_moved_nexus.png, tabs_moved_samsung.png$"/>
-  </issue>
-  <issue id="IconLocation">
-    <!-- It is OK for content_shell_apk and chrome_shell_apk to have missing assets. -->
-    <ignore path="content/shell/android/java/res/"/>
-    <ignore path="chrome/android/shell/res/"/>
-    <!-- Suppression for chrome/test/chromedriver/test/webview_shell/java/res/drawable/icon.png -->
-    <ignore path="res/drawable/icon.png"/>
-    <!-- TODO(lambroslambrou) remove this once crbug.com/502030 is fixed. -->
-    <ignore path="remoting/android/java/res"/>
-  </issue>
-  <issue id="InconsistentLayout" severity="ignore"/>
-  <issue id="InflateParams" severity="ignore"/>
-  <issue id="MissingApplicationIcon" severity="ignore"/>
-  <issue id="MissingRegistered" severity="ignore"/>
-  <issue id="MissingVersion">
-    <ignore path="AndroidManifest.xml"/>
-  </issue>
-  <issue id="InlinedApi" severity="ignore"/>
-  <issue id="NewApi">
-    <ignore regexp="Attribute `paddingStart` referenced here can result in a crash on some specific devices older than API 17"/>
-    <ignore path="org/chromium/base/AnimationFrameTimeHistogram$Recorder.class"/>
-    <ignore path="org/chromium/base/JavaHandlerThread.class"/>
-    <ignore path="org/chromium/base/SysUtils.class"/>
-    <ignore path="org/chromium/chrome/browser/TtsPlatformImpl.class"/>
-    <ignore path="org/chromium/chrome/browser/TtsPlatformImpl$*.class"/>
-    <ignore path="chrome/android/java/res/values-v17/styles.xml"/>
-  </issue>
-  <issue id="OldTargetApi">
-    <ignore path="AndroidManifest.xml"/>
-  </issue>
-  <issue id="Overdraw" severity="ignore"/>
-  <issue id="Recycle" severity="ignore"/>
-  <issue id="Registered" severity="ignore"/>
-  <issue id="RtlCompat" severity="ignore"/>
-  <issue id="RtlEnabled" severity="ignore"/>
-  <issue id="RtlSymmetry" severity="ignore"/>
-  <issue id="SdCardPath">
-    <ignore path="content/public/android/java/src/org/chromium/content/browser/MediaResourceGetter.java"/>
-  </issue>
-  <issue id="SetJavaScriptEnabled" severity="ignore"/>
-  <issue id="UnusedResources">
-    <!-- Used by chrome/android/java/AndroidManifest.xml -->
-    <ignore path="chrome/android/java/res/drawable/window_background.xml" />
-    <ignore path="chrome/android/java/res/xml/bookmark_thumbnail_widget_info.xml" />
-    <ignore path="chrome/android/java/res/xml/file_paths.xml" />
-
-    <ignore path="content/shell/android/shell_apk/res/layout/content_shell_activity.xml" />
-    <ignore path="content/shell/android/shell_apk/res/values/strings.xml" />
-  </issue>
-  <issue id="SignatureOrSystemPermissions" severity="ignore"/>
-  <issue id="UnusedAttribute" severity="ignore"/>
-  <issue id="ViewConstructor" severity="ignore"/>
-  <issue id="WrongCall" severity="ignore"/>
-</lint>
diff --git a/build/android/lint_action.gypi b/build/android/lint_action.gypi
deleted file mode 100644
index e1adf1f..0000000
--- a/build/android/lint_action.gypi
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into an action to provide a rule to
-# run lint on java/class files.
-
-{
-  'action_name': 'lint_<(_target_name)',
-  'message': 'Linting <(_target_name)',
-  'variables': {
-    'conditions': [
-      ['chromium_code != 0 and android_lint != 0 and never_lint == 0', {
-        'is_enabled': '--enable',
-      }, {
-        'is_enabled': '',
-      }]
-    ],
-    'android_manifest_path%': '<(DEPTH)/build/android/AndroidManifest.xml',
-    'resource_dir%': '<(DEPTH)/build/android/ant/empty/res',
-  },
-  'inputs': [
-    '<(DEPTH)/build/android/gyp/util/build_utils.py',
-    '<(DEPTH)/build/android/gyp/lint.py',
-    '<(DEPTH)/build/android/lint/suppressions.xml',
-    '<(lint_jar_path)',
-  ],
-  'action': [
-    'python', '<(DEPTH)/build/android/gyp/lint.py',
-    '--lint-path=<(android_sdk_root)/tools/lint',
-    '--config-path=<(DEPTH)/build/android/lint/suppressions.xml',
-    '--processed-config-path=<(config_path)',
-    '--manifest-path=<(android_manifest_path)',
-    '--result-path=<(result_path)',
-    '--resource-dir=<(resource_dir)',
-    '--product-dir=<(PRODUCT_DIR)',
-    '--src-dirs=>(src_dirs)',
-    '--jar-path=<(lint_jar_path)',
-    '--can-fail-build',
-    '--stamp=<(stamp_path)',
-    '<(is_enabled)',
-  ],
-}
diff --git a/build/android/locale_pak_resources.gypi b/build/android/locale_pak_resources.gypi
deleted file mode 100644
index 6f8e56f..0000000
--- a/build/android/locale_pak_resources.gypi
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Creates a resources.zip with locale.pak files placed into appropriate
-# resource configs (e.g. en-GB.pak -> res/raw-en/en_gb.pak). Also generates
-# a locale_paks TypedArray so that resource files can be enumerated at runtime.
-#
-# If this target is included in the deps of an android resources/library/apk,
-# the resources will be included with that target.
-#
-# Variables:
-#   locale_pak_files - List of .pak files to process.
-#     Names must be of the form "en.pak" or "en-US.pak".
-#
-# Example
-#  {
-#    'target_name': 'my_locale_resources',
-#    'type': 'none',
-#    'variables': {
-#      'locale_paks_files': ['path1/fr.pak'],
-#    },
-#    'includes': [ '../build/android/locale_pak_resources.gypi' ],
-#  },
-#
-{
-  'variables': {
-    'resources_zip_path': '<(PRODUCT_DIR)/res.java/<(_target_name).zip',
-  },
-  'all_dependent_settings': {
-    'variables': {
-      'additional_input_paths': ['<(resources_zip_path)'],
-      'dependencies_res_zip_paths': ['<(resources_zip_path)'],
-    },
-  },
-  'actions': [{
-    'action_name': '<(_target_name)_locale_pak_resources',
-    'inputs': [
-      '<(DEPTH)/build/android/gyp/util/build_utils.py',
-      '<(DEPTH)/build/android/gyp/locale_pak_resources.py',
-      '<@(locale_pak_files)',
-    ],
-    'outputs': [
-      '<(resources_zip_path)',
-    ],
-    'action': [
-      'python', '<(DEPTH)/build/android/gyp/locale_pak_resources.py',
-      '--locale-paks', '<(locale_pak_files)',
-      '--resources-zip', '<(resources_zip_path)',
-    ],
-  }],
-}
diff --git a/build/android/method_count.py b/build/android/method_count.py
deleted file mode 100755
index 93250b5..0000000
--- a/build/android/method_count.py
+++ /dev/null
@@ -1,55 +0,0 @@
-#! /usr/bin/env python
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import argparse
-import os
-import re
-import sys
-
-from pylib import constants
-from pylib.sdk import dexdump
-
-sys.path.append(os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib',
-                             'common'))
-import perf_tests_results_helper
-
-
-_METHOD_IDS_SIZE_RE = re.compile(r'^method_ids_size +: +(\d+)$')
-
-def MethodCount(dexfile):
-  for line in dexdump.DexDump(dexfile, file_summary=True):
-    m = _METHOD_IDS_SIZE_RE.match(line)
-    if m:
-      return m.group(1)
-  raise Exception('"method_ids_size" not found in dex dump of %s' % dexfile)
-
-def main():
-  parser = argparse.ArgumentParser()
-  parser.add_argument(
-      '--apk-name', help='Name of the APK to which the dexfile corresponds.')
-  parser.add_argument('dexfile')
-
-  args = parser.parse_args()
-
-  if not args.apk_name:
-    dirname, basename = os.path.split(args.dexfile)
-    while basename:
-      if 'apk' in basename:
-        args.apk_name = basename
-        break
-      dirname, basename = os.path.split(dirname)
-    else:
-      parser.error(
-          'Unable to determine apk name from %s, '
-          'and --apk-name was not provided.' % args.dexfile)
-
-  method_count = MethodCount(args.dexfile)
-  perf_tests_results_helper.PrintPerfResult(
-      '%s_methods' % args.apk_name, 'total', [method_count], 'methods')
-  return 0
-
-if __name__ == '__main__':
-  sys.exit(main())
-
diff --git a/build/android/native_app_dependencies.gypi b/build/android/native_app_dependencies.gypi
deleted file mode 100644
index 6032274..0000000
--- a/build/android/native_app_dependencies.gypi
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into a target to provide a rule
-# to strip and place dependent shared libraries required by a native binary in a
-# single folder that can later be pushed to the device.
-#
-# NOTE: consider packaging your binary as an apk instead of running a native
-# library.
-#
-# To use this, create a gyp target with the following form:
-#  {
-#    'target_name': 'target_that_depends_on_my_binary',
-#    'type': 'none',
-#    'dependencies': [
-#      'my_binary',
-#    ],
-#    'variables': {
-#      'native_binary': '<(PRODUCT_DIR)/my_binary',
-#      'output_dir': 'location to place binary and dependent libraries'
-#    },
-#    'includes': [ '../../build/android/native_app_dependencies.gypi' ],
-#  },
-#
-
-{
-  'variables': {
-    'include_main_binary%': 1,
-  },
-  'conditions': [
-      ['component == "shared_library"', {
-        'dependencies': [
-          '<(DEPTH)/build/android/setup.gyp:copy_system_libraries',
-        ],
-        'variables': {
-          'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)',
-          'ordered_libraries_file': '<(intermediate_dir)/native_libraries.json',
-        },
-        'actions': [
-          {
-            'variables': {
-              'input_libraries': ['<(native_binary)'],
-            },
-            'includes': ['../../build/android/write_ordered_libraries.gypi'],
-          },
-          {
-            'action_name': 'stripping native libraries',
-            'variables': {
-              'stripped_libraries_dir%': '<(output_dir)',
-              'input_paths': ['<(native_binary)'],
-              'stamp': '<(intermediate_dir)/strip.stamp',
-            },
-            'includes': ['../../build/android/strip_native_libraries.gypi'],
-          },
-        ],
-      }],
-      ['include_main_binary==1', {
-        'copies': [
-          {
-            'destination': '<(output_dir)',
-            'files': [ '<(native_binary)' ],
-          }
-        ],
-      }],
-  ],
-}
diff --git a/build/android/ndk.gyp b/build/android/ndk.gyp
deleted file mode 100644
index 2838a98..0000000
--- a/build/android/ndk.gyp
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (c) 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'cpu_features',
-      'type': 'static_library',
-      'direct_dependent_settings': {
-        'include_dirs': [
-          '<(android_ndk_root)/sources/android/cpufeatures',
-        ],
-      },
-      'sources': [
-        '<(android_ndk_root)/sources/android/cpufeatures/cpu-features.c',
-      ],
-    },
-  ],
-}
diff --git a/build/android/pack_relocations.gypi b/build/android/pack_relocations.gypi
deleted file mode 100644
index 8567fa6..0000000
--- a/build/android/pack_relocations.gypi
+++ /dev/null
@@ -1,77 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into an action to provide a rule that
-# packs relocations in Release builds of native libraries.
-#
-# To use this, create a gyp target with the following form:
-#  {
-#    'action_name': 'pack_relocations',
-#    'actions': [
-#      'variables': {
-#        'enable_packing': 'pack relocations if 1, plain file copy if 0'
-#        'exclude_packing_list': 'names of libraries explicitly not packed',
-#        'ordered_libraries_file': 'file generated by write_ordered_libraries'
-#        'input_paths': 'files to be added to the list of inputs'
-#        'stamp': 'file to touch when the action is complete'
-#        'stripped_libraries_dir': 'directory holding stripped libraries',
-#        'packed_libraries_dir': 'directory holding packed libraries',
-#      'includes': [ '../../build/android/pack_relocations.gypi' ],
-#    ],
-#  },
-#
-
-{
-  'variables': {
-    'input_paths': [],
-  },
-  'inputs': [
-    '<(DEPTH)/build/android/gyp/util/build_utils.py',
-    '<(DEPTH)/build/android/gyp/pack_relocations.py',
-    '<(ordered_libraries_file)',
-    '>@(input_paths)',
-  ],
-  'outputs': [
-    '<(stamp)',
-  ],
-  'conditions': [
-    ['enable_packing == 1', {
-      'message': 'Packing relocations for <(_target_name)',
-      'dependencies': [
-        '<(DEPTH)/third_party/android_platform/relocation_packer.gyp:android_relocation_packer#host',
-      ],
-      'inputs': [
-        '<(PRODUCT_DIR)/android_relocation_packer',
-      ],
-      'action': [
-        'python', '<(DEPTH)/build/android/gyp/pack_relocations.py',
-        '--configuration-name=<(CONFIGURATION_NAME)',
-        '--enable-packing=1',
-        '--exclude-packing-list=<@(exclude_packing_list)',
-        '--android-pack-relocations=<(PRODUCT_DIR)/android_relocation_packer',
-        '--stripped-libraries-dir=<(stripped_libraries_dir)',
-        '--packed-libraries-dir=<(packed_libraries_dir)',
-        '--libraries=@FileArg(<(ordered_libraries_file):libraries)',
-        '--stamp=<(stamp)',
-      ],
-    }, {
-      'message': 'Copying libraries (no relocation packing) for <(_target_name)',
-      'action': [
-        'python', '<(DEPTH)/build/android/gyp/pack_relocations.py',
-        '--configuration-name=<(CONFIGURATION_NAME)',
-        '--enable-packing=0',
-        '--stripped-libraries-dir=<(stripped_libraries_dir)',
-        '--packed-libraries-dir=<(packed_libraries_dir)',
-        '--libraries=@FileArg(<(ordered_libraries_file):libraries)',
-        '--stamp=<(stamp)',
-      ],
-    }],
-    ['component == "shared_library"', {
-      # Add a fake output to force the build to always re-run this step. This
-      # is required because the real inputs are not known at gyp-time and
-      # changing base.so may not trigger changes to dependent libraries.
-      'outputs': [ '<(stamp).fake' ]
-    }],
-  ],
-}
diff --git a/build/android/package_resources_action.gypi b/build/android/package_resources_action.gypi
deleted file mode 100644
index eb60871..0000000
--- a/build/android/package_resources_action.gypi
+++ /dev/null
@@ -1,97 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is a helper to java_apk.gypi. It should be used to create an
-# action that runs ApkBuilder via ANT.
-#
-# Required variables:
-#  apk_name - File name (minus path & extension) of the output apk.
-#  android_manifest_path - Path to AndroidManifest.xml.
-#  app_manifest_version_name - set the apps 'human readable' version number.
-#  app_manifest_version_code - set the apps version number.
-# Optional variables:
-#  asset_location - The directory where assets are located (if any).
-#  create_density_splits - Whether to create density-based apk splits. Splits
-#    are supported only for minSdkVersion >= 21.
-#  language_splits - List of languages to create apk splits for.
-#  resource_zips - List of paths to resource zip files.
-#  shared_resources - Make a resource package that can be loaded by a different
-#    application at runtime to access the package's resources.
-#  extensions_to_not_compress - E.g.: 'pak,dat,bin'
-#  extra_inputs - List of extra action inputs.
-{
-  'variables': {
-    'asset_location%': '',
-    'create_density_splits%': 0,
-    'resource_zips%': [],
-    'shared_resources%': 0,
-    'extensions_to_not_compress%': '',
-    'extra_inputs%': [],
-    'resource_packaged_apk_name': '<(apk_name)-resources.ap_',
-    'resource_packaged_apk_path': '<(intermediate_dir)/<(resource_packaged_apk_name)',
-  },
-  'action_name': 'package_resources_<(apk_name)',
-  'message': 'packaging resources for <(apk_name)',
-  'inputs': [
-    # TODO: This isn't always rerun correctly, http://crbug.com/351928
-    '<(DEPTH)/build/android/gyp/util/build_utils.py',
-    '<(DEPTH)/build/android/gyp/package_resources.py',
-    '<(android_manifest_path)',
-    '<@(extra_inputs)',
-  ],
-  'outputs': [
-    '<(resource_packaged_apk_path)',
-  ],
-  'action': [
-    'python', '<(DEPTH)/build/android/gyp/package_resources.py',
-    '--android-sdk', '<(android_sdk)',
-    '--aapt-path', '<(android_aapt_path)',
-    '--configuration-name', '<(CONFIGURATION_NAME)',
-    '--android-manifest', '<(android_manifest_path)',
-    '--version-code', '<(app_manifest_version_code)',
-    '--version-name', '<(app_manifest_version_name)',
-    '--no-compress', '<(extensions_to_not_compress)',
-    '--apk-path', '<(resource_packaged_apk_path)',
-  ],
-  'conditions': [
-    ['shared_resources == 1', {
-      'action': [
-        '--shared-resources',
-      ],
-    }],
-    ['asset_location != ""', {
-      'action': [
-        '--asset-dir', '<(asset_location)',
-      ],
-    }],
-    ['create_density_splits == 1', {
-      'action': [
-        '--create-density-splits',
-      ],
-      'outputs': [
-        '<(resource_packaged_apk_path)_hdpi',
-        '<(resource_packaged_apk_path)_xhdpi',
-        '<(resource_packaged_apk_path)_xxhdpi',
-        '<(resource_packaged_apk_path)_xxxhdpi',
-        '<(resource_packaged_apk_path)_tvdpi',
-      ],
-    }],
-    ['language_splits != []', {
-      'action': [
-        '--language-splits=<(language_splits)',
-      ],
-      'outputs': [
-        "<!@(python <(DEPTH)/build/apply_locales.py '<(resource_packaged_apk_path)_ZZLOCALE' <(language_splits))",
-      ],
-    }],
-    ['resource_zips != []', {
-      'action': [
-        '--resource-zips', '>(resource_zips)',
-      ],
-      'inputs': [
-        '>@(resource_zips)',
-      ],
-    }],
-  ],
-}
diff --git a/build/android/preprocess_google_play_services.config.json b/build/android/preprocess_google_play_services.config.json
deleted file mode 100644
index 8b3198b..0000000
--- a/build/android/preprocess_google_play_services.config.json
+++ /dev/null
@@ -1,90 +0,0 @@
-{
-  "lib_version": "7.3.0",
-  "clients": [
-    "play-services-base",
-    "play-services-cast",
-    "play-services-identity"
-  ],
-  "client_filter": [
-    "res/drawable*",
-    "res/values-af",
-    "res/values-az",
-    "res/values-be",
-    "res/values-bn",
-    "res/values-bn-rBD",
-    "res/values-de-rAT",
-    "res/values-de-rCH",
-    "res/values-en-rIE",
-    "res/values-en-rIN",
-    "res/values-en-rSG",
-    "res/values-en-rZA",
-    "res/values-es-rAR",
-    "res/values-es-rBO",
-    "res/values-es-rCL",
-    "res/values-es-rCO",
-    "res/values-es-rCR",
-    "res/values-es-rDO",
-    "res/values-es-rEC",
-    "res/values-es-rGT",
-    "res/values-es-rHN",
-    "res/values-es-rMX",
-    "res/values-es-rNI",
-    "res/values-es-rPA",
-    "res/values-es-rPE",
-    "res/values-es-rPR",
-    "res/values-es-rPY",
-    "res/values-es-rSV",
-    "res/values-es-rUS",
-    "res/values-es-rUY",
-    "res/values-es-rVE",
-    "res/values-eu-rES",
-    "res/values-fr-rCA",
-    "res/values-fr-rCH",
-    "res/values-gl",
-    "res/values-gl-rES",
-    "res/values-gu",
-    "res/values-he",
-    "res/values-hy",
-    "res/values-hy-rAM",
-    "res/values-in",
-    "res/values-is",
-    "res/values-is-rIS",
-    "res/values-ka",
-    "res/values-ka-rGE",
-    "res/values-kk-rKZ",
-    "res/values-km",
-    "res/values-km-rKH",
-    "res/values-kn",
-    "res/values-kn-rIN",
-    "res/values-ky",
-    "res/values-ky-rKG",
-    "res/values-lo",
-    "res/values-lo-rLA",
-    "res/values-mk-rMK",
-    "res/values-ml",
-    "res/values-ml-rIN",
-    "res/values-mn",
-    "res/values-mn-rMN",
-    "res/values-mo",
-    "res/values-mr",
-    "res/values-mr-rIN",
-    "res/values-ms",
-    "res/values-ms-rMY",
-    "res/values-my-rMM",
-    "res/values-nb",
-    "res/values-ne",
-    "res/values-ne-rNP",
-    "res/values-si",
-    "res/values-si-rLK",
-    "res/values-ta",
-    "res/values-ta-rIN",
-    "res/values-te",
-    "res/values-te-rIN",
-    "res/values-tl",
-    "res/values-ur-rPK",
-    "res/values-uz-rUZ",
-    "res/values-zh",
-    "res/values-zh-rHK",
-    "res/values-zu"
-  ]
-}
diff --git a/build/android/preprocess_google_play_services.py b/build/android/preprocess_google_play_services.py
deleted file mode 100755
index 85d239a..0000000
--- a/build/android/preprocess_google_play_services.py
+++ /dev/null
@@ -1,238 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-'''Prepares the Google Play services split client libraries before usage by
-Chrome's build system.
-
-We need to preprocess Google Play services before using it in Chrome
-builds for 2 main reasons:
-
-- Getting rid of unused resources: unsupported languages, unused
-drawables, etc.
-
-- Merging the differents jars so that it can be proguarded more
-easily. This is necessary since debug and test apks get very close
-to the dex limit.
-
-The script is supposed to be used with the maven repository that can be obtained
-by downloading the "extra-google-m2repository" from the Android SDK Manager. It
-also supports importing from already extracted AAR files using the
---is-extracted-repo flag.
-
-The json config (see the -c argument) file should provide the following fields:
-
-- lib_version: String. Used when building from the maven repository. It should
-  be the package's version (e.g. "7.3.0")
-
-- clients: String array. List of clients to pick. For example, when building
-  from the maven repository, it's the artifactId (e.g. "play-services-base") of
-  each client.
-
-- client_filter: String array. Pattern of files to prune from the clients once
-  extracted. Metacharacters are allowed. (e.g. "res/drawable*")
-
-The output is a directory with the following structure:
-
-    OUT_DIR
-    +-- google-play-services.jar
-    +-- res
-    |   +-- CLIENT_1
-    |   |   +-- color
-    |   |   +-- values
-    |   |   +-- etc.
-    |   +-- CLIENT_2
-    |       +-- ...
-    +-- stub
-        +-- res/[.git-keep-directory]
-        +-- src/android/UnusedStub.java
-
-Requires the `jar` utility in the path.
-
-'''
-
-import argparse
-import glob
-import itertools
-import json
-import os
-import shutil
-import stat
-import sys
-
-from pylib import cmd_helper
-from pylib import constants
-
-sys.path.append(
-    os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'android', 'gyp'))
-from util import build_utils
-
-
-M2_PKG_PATH = os.path.join('com', 'google', 'android', 'gms')
-
-
-def main():
-  parser = argparse.ArgumentParser(description=("Prepares the Google Play "
-      "services split client libraries before usage by Chrome's build system"))
-  parser.add_argument('-r',
-                      '--repository',
-                      help='The Google Play services repository location',
-                      required=True,
-                      metavar='FILE')
-  parser.add_argument('-o',
-                      '--out-dir',
-                      help='The output directory',
-                      required=True,
-                      metavar='FILE')
-  parser.add_argument('-c',
-                      '--config-file',
-                      help='Config file path',
-                      required=True,
-                      metavar='FILE')
-  parser.add_argument('-g',
-                      '--git-friendly',
-                      action='store_true',
-                      default=False,
-                      help='Add a .gitkeep file to the empty directories')
-  parser.add_argument('-x',
-                      '--is-extracted-repo',
-                      action='store_true',
-                      default=False,
-                      help='The provided repository is not made of AAR files.')
-
-  args = parser.parse_args()
-
-  ProcessGooglePlayServices(args.repository,
-                            args.out_dir,
-                            args.config_file,
-                            args.git_friendly,
-                            args.is_extracted_repo)
-
-
-def ProcessGooglePlayServices(repo, out_dir, config_path, git_friendly,
-                              is_extracted_repo):
-  with open(config_path, 'r') as json_file:
-    config = json.load(json_file)
-
-  with build_utils.TempDir() as tmp_root:
-    tmp_paths = _SetupTempDir(tmp_root)
-
-    if is_extracted_repo:
-      _ImportFromExtractedRepo(config, tmp_paths, repo)
-    else:
-      _ImportFromAars(config, tmp_paths, repo)
-
-    _GenerateCombinedJar(tmp_paths)
-    _ProcessResources(config, tmp_paths)
-    _BuildOutput(config, tmp_paths, out_dir, git_friendly)
-
-
-def _SetupTempDir(tmp_root):
-  tmp_paths = {
-    'root': tmp_root,
-    'imported_clients': os.path.join(tmp_root, 'imported_clients'),
-    'extracted_jars': os.path.join(tmp_root, 'jar'),
-    'combined_jar': os.path.join(tmp_root, 'google-play-services.jar'),
-  }
-  os.mkdir(tmp_paths['imported_clients'])
-  os.mkdir(tmp_paths['extracted_jars'])
-
-  return tmp_paths
-
-
-def _SetupOutputDir(out_dir):
-  out_paths = {
-    'root': out_dir,
-    'res': os.path.join(out_dir, 'res'),
-    'jar': os.path.join(out_dir, 'google-play-services.jar'),
-    'stub': os.path.join(out_dir, 'stub'),
-  }
-
-  shutil.rmtree(out_paths['jar'], ignore_errors=True)
-  shutil.rmtree(out_paths['res'], ignore_errors=True)
-  shutil.rmtree(out_paths['stub'], ignore_errors=True)
-
-  return out_paths
-
-
-def _MakeWritable(dir_path):
-  for root, dirs, files in os.walk(dir_path):
-    for path in itertools.chain(dirs, files):
-      st = os.stat(os.path.join(root, path))
-      os.chmod(os.path.join(root, path), st.st_mode | stat.S_IWUSR)
-
-
-def _ImportFromAars(config, tmp_paths, repo):
-  for client in config['clients']:
-    aar_name = '%s-%s.aar' % (client, config['lib_version'])
-    aar_path = os.path.join(repo, M2_PKG_PATH, client,
-                            config['lib_version'], aar_name)
-    aar_out_path = os.path.join(tmp_paths['imported_clients'], client)
-    build_utils.ExtractAll(aar_path, aar_out_path)
-
-    client_jar_path = os.path.join(aar_out_path, 'classes.jar')
-    build_utils.ExtractAll(client_jar_path, tmp_paths['extracted_jars'],
-                           no_clobber=False)
-
-
-def _ImportFromExtractedRepo(config, tmp_paths, repo):
-  # Import the clients
-  try:
-    for client in config['clients']:
-      client_out_dir = os.path.join(tmp_paths['imported_clients'], client)
-      shutil.copytree(os.path.join(repo, client), client_out_dir)
-
-      client_jar_path = os.path.join(client_out_dir, 'classes.jar')
-      build_utils.ExtractAll(client_jar_path, tmp_paths['extracted_jars'],
-                             no_clobber=False)
-  finally:
-    _MakeWritable(tmp_paths['imported_clients'])
-
-
-def _GenerateCombinedJar(tmp_paths):
-  out_file_name = tmp_paths['combined_jar']
-  working_dir = tmp_paths['extracted_jars']
-  cmd_helper.Call(['jar', '-cf', out_file_name, '-C', working_dir, '.'])
-
-
-def _ProcessResources(config, tmp_paths):
-  # Prune unused resources
-  for res_filter in config['client_filter']:
-    glob_pattern = os.path.join(tmp_paths['imported_clients'], '*', res_filter)
-    for prune_target in glob.glob(glob_pattern):
-      shutil.rmtree(prune_target)
-
-
-def _BuildOutput(config, tmp_paths, out_dir, git_friendly):
-  out_paths = _SetupOutputDir(out_dir)
-
-  # Copy the resources to the output dir
-  for client in config['clients']:
-    res_in_tmp_dir = os.path.join(tmp_paths['imported_clients'], client, 'res')
-    if os.path.isdir(res_in_tmp_dir) and os.listdir(res_in_tmp_dir):
-      res_in_final_dir = os.path.join(out_paths['res'], client)
-      shutil.copytree(res_in_tmp_dir, res_in_final_dir)
-
-  # Copy the jar
-  shutil.copyfile(tmp_paths['combined_jar'], out_paths['jar'])
-
-  # Write the java dummy stub. Needed for gyp to create the resource jar
-  stub_location = os.path.join(out_paths['stub'], 'src', 'android')
-  os.makedirs(stub_location)
-  with open(os.path.join(stub_location, 'UnusedStub.java'), 'w') as stub:
-    stub.write('package android;'
-               'public final class UnusedStub {'
-               '    private UnusedStub() {}'
-               '}')
-
-  # Create the main res directory. Will be empty but is needed by gyp
-  stub_res_location = os.path.join(out_paths['stub'], 'res')
-  os.makedirs(stub_res_location)
-  if git_friendly:
-    build_utils.Touch(os.path.join(stub_res_location, '.git-keep-directory'))
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/android/provision_devices.py b/build/android/provision_devices.py
deleted file mode 100755
index a5f8fc6..0000000
--- a/build/android/provision_devices.py
+++ /dev/null
@@ -1,349 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Provisions Android devices with settings required for bots.
-
-Usage:
-  ./provision_devices.py [-d <device serial number>]
-"""
-
-import argparse
-import json
-import logging
-import os
-import posixpath
-import re
-import subprocess
-import sys
-import time
-
-from pylib import constants
-from pylib import device_settings
-from pylib.device import battery_utils
-from pylib.device import device_blacklist
-from pylib.device import device_errors
-from pylib.device import device_utils
-from pylib.utils import run_tests_helper
-from pylib.utils import timeout_retry
-
-sys.path.append(os.path.join(constants.DIR_SOURCE_ROOT,
-                             'third_party', 'android_testrunner'))
-import errors
-
-
-class _DEFAULT_TIMEOUTS(object):
-  # L can take a while to reboot after a wipe.
-  LOLLIPOP = 600
-  PRE_LOLLIPOP = 180
-
-  HELP_TEXT = '{}s on L, {}s on pre-L'.format(LOLLIPOP, PRE_LOLLIPOP)
-
-
-class _PHASES(object):
-  WIPE = 'wipe'
-  PROPERTIES = 'properties'
-  FINISH = 'finish'
-
-  ALL = [WIPE, PROPERTIES, FINISH]
-
-
-def ProvisionDevices(options):
-  devices = device_utils.DeviceUtils.HealthyDevices()
-  if options.device:
-    devices = [d for d in devices if d == options.device]
-    if not devices:
-      raise device_errors.DeviceUnreachableError(options.device)
-
-  parallel_devices = device_utils.DeviceUtils.parallel(devices)
-  parallel_devices.pMap(ProvisionDevice, options)
-  if options.auto_reconnect:
-    _LaunchHostHeartbeat()
-  blacklist = device_blacklist.ReadBlacklist()
-  if options.output_device_blacklist:
-    with open(options.output_device_blacklist, 'w') as f:
-      json.dump(blacklist, f)
-  if all(d in blacklist for d in devices):
-    raise device_errors.NoDevicesError
-  return 0
-
-
-def ProvisionDevice(device, options):
-  if options.reboot_timeout:
-    reboot_timeout = options.reboot_timeout
-  elif (device.build_version_sdk >=
-        constants.ANDROID_SDK_VERSION_CODES.LOLLIPOP):
-    reboot_timeout = _DEFAULT_TIMEOUTS.LOLLIPOP
-  else:
-    reboot_timeout = _DEFAULT_TIMEOUTS.PRE_LOLLIPOP
-
-  def should_run_phase(phase_name):
-    return not options.phases or phase_name in options.phases
-
-  def run_phase(phase_func, reboot=True):
-    try:
-      device.WaitUntilFullyBooted(timeout=reboot_timeout, retries=0)
-    except device_errors.CommandTimeoutError:
-      logging.error('Device did not finish booting. Will try to reboot.')
-      device.Reboot(timeout=reboot_timeout)
-    phase_func(device, options)
-    if reboot:
-      device.Reboot(False, retries=0)
-      device.adb.WaitForDevice()
-
-  try:
-    if should_run_phase(_PHASES.WIPE):
-      run_phase(WipeDevice)
-
-    if should_run_phase(_PHASES.PROPERTIES):
-      run_phase(SetProperties)
-
-    if should_run_phase(_PHASES.FINISH):
-      run_phase(FinishProvisioning, reboot=False)
-
-  except (errors.WaitForResponseTimedOutError,
-          device_errors.CommandTimeoutError):
-    logging.exception('Timed out waiting for device %s. Adding to blacklist.',
-                      str(device))
-    device_blacklist.ExtendBlacklist([str(device)])
-
-  except device_errors.CommandFailedError:
-    logging.exception('Failed to provision device %s. Adding to blacklist.',
-                      str(device))
-    device_blacklist.ExtendBlacklist([str(device)])
-
-
-def WipeDevice(device, options):
-  """Wipes data from device, keeping only the adb_keys for authorization.
-
-  After wiping data on a device that has been authorized, adb can still
-  communicate with the device, but after reboot the device will need to be
-  re-authorized because the adb keys file is stored in /data/misc/adb/.
-  Thus, adb_keys file is rewritten so the device does not need to be
-  re-authorized.
-
-  Arguments:
-    device: the device to wipe
-  """
-  if options.skip_wipe:
-    return
-
-  try:
-    device.EnableRoot()
-    device_authorized = device.FileExists(constants.ADB_KEYS_FILE)
-    if device_authorized:
-      adb_keys = device.ReadFile(constants.ADB_KEYS_FILE,
-                                 as_root=True).splitlines()
-    device.RunShellCommand(['wipe', 'data'],
-                           as_root=True, check_return=True)
-    device.adb.WaitForDevice()
-
-    if device_authorized:
-      adb_keys_set = set(adb_keys)
-      for adb_key_file in options.adb_key_files or []:
-        try:
-          with open(adb_key_file, 'r') as f:
-            adb_public_keys = f.readlines()
-          adb_keys_set.update(adb_public_keys)
-        except IOError:
-          logging.warning('Unable to find adb keys file %s.' % adb_key_file)
-      _WriteAdbKeysFile(device, '\n'.join(adb_keys_set))
-  except device_errors.CommandFailedError:
-    logging.exception('Possible failure while wiping the device. '
-                      'Attempting to continue.')
-
-
-def _WriteAdbKeysFile(device, adb_keys_string):
-  dir_path = posixpath.dirname(constants.ADB_KEYS_FILE)
-  device.RunShellCommand(['mkdir', '-p', dir_path],
-                         as_root=True, check_return=True)
-  device.RunShellCommand(['restorecon', dir_path],
-                         as_root=True, check_return=True)
-  device.WriteFile(constants.ADB_KEYS_FILE, adb_keys_string, as_root=True)
-  device.RunShellCommand(['restorecon', constants.ADB_KEYS_FILE],
-                         as_root=True, check_return=True)
-
-
-def SetProperties(device, options):
-  try:
-    device.EnableRoot()
-  except device_errors.CommandFailedError as e:
-    logging.warning(str(e))
-
-  _ConfigureLocalProperties(device, options.enable_java_debug)
-  device_settings.ConfigureContentSettings(
-      device, device_settings.DETERMINISTIC_DEVICE_SETTINGS)
-  if options.disable_location:
-    device_settings.ConfigureContentSettings(
-        device, device_settings.DISABLE_LOCATION_SETTINGS)
-  else:
-    device_settings.ConfigureContentSettings(
-        device, device_settings.ENABLE_LOCATION_SETTINGS)
-
-  if options.disable_mock_location:
-    device_settings.ConfigureContentSettings(
-        device, device_settings.DISABLE_MOCK_LOCATION_SETTINGS)
-  else:
-    device_settings.ConfigureContentSettings(
-        device, device_settings.ENABLE_MOCK_LOCATION_SETTINGS)
-
-  device_settings.SetLockScreenSettings(device)
-  if options.disable_network:
-    device_settings.ConfigureContentSettings(
-        device, device_settings.NETWORK_DISABLED_SETTINGS)
-
-def _ConfigureLocalProperties(device, java_debug=True):
-  """Set standard readonly testing device properties prior to reboot."""
-  local_props = [
-      'persist.sys.usb.config=adb',
-      'ro.monkey=1',
-      'ro.test_harness=1',
-      'ro.audio.silent=1',
-      'ro.setupwizard.mode=DISABLED',
-      ]
-  if java_debug:
-    local_props.append(
-        '%s=all' % device_utils.DeviceUtils.JAVA_ASSERT_PROPERTY)
-    local_props.append('debug.checkjni=1')
-  try:
-    device.WriteFile(
-        constants.DEVICE_LOCAL_PROPERTIES_PATH,
-        '\n'.join(local_props), as_root=True)
-    # Android will not respect the local props file if it is world writable.
-    device.RunShellCommand(
-        ['chmod', '644', constants.DEVICE_LOCAL_PROPERTIES_PATH],
-        as_root=True, check_return=True)
-  except device_errors.CommandFailedError:
-    logging.exception('Failed to configure local properties.')
-
-
-def FinishProvisioning(device, options):
-  if options.min_battery_level is not None:
-    try:
-      battery = battery_utils.BatteryUtils(device)
-      battery.ChargeDeviceToLevel(options.min_battery_level)
-    except device_errors.CommandFailedError:
-      logging.exception('Unable to charge device to specified level.')
-
-  if options.max_battery_temp is not None:
-    try:
-      battery = battery_utils.BatteryUtils(device)
-      battery.LetBatteryCoolToTemperature(options.max_battery_temp)
-    except device_errors.CommandFailedError:
-      logging.exception('Unable to let battery cool to specified temperature.')
-
-  device.RunShellCommand(
-      ['date', '-s', time.strftime('%Y%m%d.%H%M%S', time.gmtime())],
-      as_root=True, check_return=True)
-  props = device.RunShellCommand('getprop', check_return=True)
-  for prop in props:
-    logging.info('  %s' % prop)
-  if options.auto_reconnect:
-    _PushAndLaunchAdbReboot(device, options.target)
-
-
-def _PushAndLaunchAdbReboot(device, target):
-  """Pushes and launches the adb_reboot binary on the device.
-
-  Arguments:
-    device: The DeviceUtils instance for the device to which the adb_reboot
-            binary should be pushed.
-    target: The build target (example, Debug or Release) which helps in
-            locating the adb_reboot binary.
-  """
-  logging.info('Will push and launch adb_reboot on %s' % str(device))
-  # Kill if adb_reboot is already running.
-  device.KillAll('adb_reboot', blocking=True, timeout=2, quiet=True)
-  # Push adb_reboot
-  logging.info('  Pushing adb_reboot ...')
-  adb_reboot = os.path.join(constants.DIR_SOURCE_ROOT,
-                            'out/%s/adb_reboot' % target)
-  device.PushChangedFiles([(adb_reboot, '/data/local/tmp/')])
-  # Launch adb_reboot
-  logging.info('  Launching adb_reboot ...')
-  device.RunShellCommand(
-      ['/data/local/tmp/adb_reboot'],
-      check_return=True)
-
-
-def _LaunchHostHeartbeat():
-  # Kill if existing host_heartbeat
-  KillHostHeartbeat()
-  # Launch a new host_heartbeat
-  logging.info('Spawning host heartbeat...')
-  subprocess.Popen([os.path.join(constants.DIR_SOURCE_ROOT,
-                                 'build/android/host_heartbeat.py')])
-
-
-def KillHostHeartbeat():
-  ps = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
-  stdout, _ = ps.communicate()
-  matches = re.findall('\\n.*host_heartbeat.*', stdout)
-  for match in matches:
-    logging.info('An instance of host heart beart running... will kill')
-    pid = re.findall(r'(\S+)', match)[1]
-    subprocess.call(['kill', str(pid)])
-
-
-def main():
-  # Recommended options on perf bots:
-  # --disable-network
-  #     TODO(tonyg): We eventually want network on. However, currently radios
-  #     can cause perfbots to drain faster than they charge.
-  # --min-battery-level 95
-  #     Some perf bots run benchmarks with USB charging disabled which leads
-  #     to gradual draining of the battery. We must wait for a full charge
-  #     before starting a run in order to keep the devices online.
-
-  parser = argparse.ArgumentParser(
-      description='Provision Android devices with settings required for bots.')
-  parser.add_argument('-d', '--device', metavar='SERIAL',
-                      help='the serial number of the device to be provisioned'
-                      ' (the default is to provision all devices attached)')
-  parser.add_argument('--phase', action='append', choices=_PHASES.ALL,
-                      dest='phases',
-                      help='Phases of provisioning to run. '
-                           '(If omitted, all phases will be run.)')
-  parser.add_argument('--skip-wipe', action='store_true', default=False,
-                      help="don't wipe device data during provisioning")
-  parser.add_argument('--reboot-timeout', metavar='SECS', type=int,
-                      help='when wiping the device, max number of seconds to'
-                      ' wait after each reboot '
-                      '(default: %s)' % _DEFAULT_TIMEOUTS.HELP_TEXT)
-  parser.add_argument('--min-battery-level', type=int, metavar='NUM',
-                      help='wait for the device to reach this minimum battery'
-                      ' level before trying to continue')
-  parser.add_argument('--disable-location', action='store_true',
-                      help='disable Google location services on devices')
-  parser.add_argument('--disable-mock-location', action='store_true',
-                      default=False, help='Set ALLOW_MOCK_LOCATION to false')
-  parser.add_argument('--disable-network', action='store_true',
-                      help='disable network access on devices')
-  parser.add_argument('--disable-java-debug', action='store_false',
-                      dest='enable_java_debug', default=True,
-                      help='disable Java property asserts and JNI checking')
-  parser.add_argument('-t', '--target', default='Debug',
-                      help='the build target (default: %(default)s)')
-  parser.add_argument('-r', '--auto-reconnect', action='store_true',
-                      help='push binary which will reboot the device on adb'
-                      ' disconnections')
-  parser.add_argument('--adb-key-files', type=str, nargs='+',
-                      help='list of adb keys to push to device')
-  parser.add_argument('-v', '--verbose', action='count', default=1,
-                      help='Log more information.')
-  parser.add_argument('--max-battery-temp', type=int, metavar='NUM',
-                      help='Wait for the battery to have this temp or lower.')
-  parser.add_argument('--output-device-blacklist',
-                      help='Json file to output the device blacklist.')
-  args = parser.parse_args()
-  constants.SetBuildType(args.target)
-
-  run_tests_helper.SetLogLevel(args.verbose)
-
-  return ProvisionDevices(args)
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/android/push_libraries.gypi b/build/android/push_libraries.gypi
deleted file mode 100644
index 773c44f..0000000
--- a/build/android/push_libraries.gypi
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into an action to provide a rule that
-# pushes stripped shared libraries to the attached Android device. This should
-# only be used with the gyp_managed_install flag set.
-#
-# To use this, create a gyp target with the following form:
-#  {
-#    'actions': [
-#      'variables': {
-#        'ordered_libraries_file': 'file generated by write_ordered_libraries'
-#        'strip_stamp': 'stamp from strip action to block on'
-#        'libraries_source_dir': 'location where stripped libraries are stored'
-#        'device_library_dir': 'location on the device where to put pushed libraries',
-#        'push_stamp': 'file to touch when the action is complete'
-#        'configuration_name': 'The build CONFIGURATION_NAME'
-#      },
-#      'includes': [ '../../build/android/push_libraries.gypi' ],
-#    ],
-#  },
-#
-
-{
-  'action_name': 'push_libraries_<(_target_name)',
-  'message': 'Pushing libraries to device for <(_target_name)',
-  'inputs': [
-    '<(DEPTH)/build/android/gyp/util/build_utils.py',
-    '<(DEPTH)/build/android/gyp/util/md5_check.py',
-    '<(DEPTH)/build/android/gyp/push_libraries.py',
-    '<(strip_stamp)',
-    '<(strip_additional_stamp)',
-    '<(build_device_config_path)',
-    '<(pack_relocations_stamp)',
-  ],
-  'outputs': [
-    '<(push_stamp)',
-  ],
-  'action': [
-    'python', '<(DEPTH)/build/android/gyp/push_libraries.py',
-    '--build-device-configuration=<(build_device_config_path)',
-    '--libraries-dir=<(libraries_source_dir)',
-    '--device-dir=<(device_library_dir)',
-    '--libraries=@FileArg(<(ordered_libraries_file):libraries)',
-    '--stamp=<(push_stamp)',
-    '--configuration-name=<(configuration_name)',
-  ],
-}
diff --git a/build/android/pylib/OWNERS b/build/android/pylib/OWNERS
deleted file mode 100644
index dbbbba7..0000000
--- a/build/android/pylib/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-jbudorick@chromium.org
-klundberg@chromium.org
-navabi@chromium.org
-skyostil@chromium.org
diff --git a/build/android/pylib/__init__.py b/build/android/pylib/__init__.py
deleted file mode 100644
index 96196cf..0000000
--- a/build/android/pylib/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py
deleted file mode 100644
index f7191f7..0000000
--- a/build/android/pylib/android_commands.py
+++ /dev/null
@@ -1,1976 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Provides an interface to communicate with the device via the adb command.
-
-Assumes adb binary is currently on system path.
-
-Note that this module is deprecated.
-"""
-# TODO(jbudorick): Delete this file once no clients use it.
-
-# pylint: skip-file
-
-import collections
-import datetime
-import inspect
-import logging
-import os
-import random
-import re
-import shlex
-import signal
-import subprocess
-import sys
-import tempfile
-import time
-
-import cmd_helper
-import constants
-import system_properties
-from utils import host_utils
-
-try:
-  from pylib import pexpect
-except ImportError:
-  pexpect = None
-
-sys.path.append(os.path.join(
-    constants.DIR_SOURCE_ROOT, 'third_party', 'android_testrunner'))
-import adb_interface
-import am_instrument_parser
-import errors
-
-from pylib.device import device_blacklist
-from pylib.device import device_errors
-
-# Pattern to search for the next whole line of pexpect output and capture it
-# into a match group. We can't use ^ and $ for line start end with pexpect,
-# see http://www.noah.org/python/pexpect/#doc for explanation why.
-PEXPECT_LINE_RE = re.compile('\n([^\r]*)\r')
-
-# Set the adb shell prompt to be a unique marker that will [hopefully] not
-# appear at the start of any line of a command's output.
-SHELL_PROMPT = '~+~PQ\x17RS~+~'
-
-# Java properties file
-LOCAL_PROPERTIES_PATH = constants.DEVICE_LOCAL_PROPERTIES_PATH
-
-# Property in /data/local.prop that controls Java assertions.
-JAVA_ASSERT_PROPERTY = 'dalvik.vm.enableassertions'
-
-# Keycode "enum" suitable for passing to AndroidCommands.SendKey().
-KEYCODE_HOME = 3
-KEYCODE_BACK = 4
-KEYCODE_DPAD_UP = 19
-KEYCODE_DPAD_DOWN = 20
-KEYCODE_DPAD_RIGHT = 22
-KEYCODE_ENTER = 66
-KEYCODE_MENU = 82
-
-MD5SUM_DEVICE_FOLDER = constants.TEST_EXECUTABLE_DIR + '/md5sum/'
-MD5SUM_DEVICE_PATH = MD5SUM_DEVICE_FOLDER + 'md5sum_bin'
-
-PIE_WRAPPER_PATH = constants.TEST_EXECUTABLE_DIR + '/run_pie'
-
-CONTROL_USB_CHARGING_COMMANDS = [
-  {
-    # Nexus 4
-    'witness_file': '/sys/module/pm8921_charger/parameters/disabled',
-    'enable_command': 'echo 0 > /sys/module/pm8921_charger/parameters/disabled',
-    'disable_command':
-        'echo 1 > /sys/module/pm8921_charger/parameters/disabled',
-  },
-  {
-    # Nexus 5
-    # Setting the HIZ bit of the bq24192 causes the charger to actually ignore
-    # energy coming from USB. Setting the power_supply offline just updates the
-    # Android system to reflect that.
-    'witness_file': '/sys/kernel/debug/bq24192/INPUT_SRC_CONT',
-    'enable_command': (
-        'echo 0x4A > /sys/kernel/debug/bq24192/INPUT_SRC_CONT && '
-        'echo 1 > /sys/class/power_supply/usb/online'),
-    'disable_command': (
-        'echo 0xCA > /sys/kernel/debug/bq24192/INPUT_SRC_CONT && '
-        'chmod 644 /sys/class/power_supply/usb/online && '
-        'echo 0 > /sys/class/power_supply/usb/online'),
-  },
-]
-
-class DeviceTempFile(object):
-  def __init__(self, android_commands, prefix='temp_file', suffix=''):
-    """Find an unused temporary file path in the devices external directory.
-
-    When this object is closed, the file will be deleted on the device.
-    """
-    self.android_commands = android_commands
-    while True:
-      # TODO(cjhopman): This could actually return the same file in multiple
-      # calls if the caller doesn't write to the files immediately. This is
-      # expected to never happen.
-      i = random.randint(0, 1000000)
-      self.name = '%s/%s-%d-%010d%s' % (
-          android_commands.GetExternalStorage(),
-          prefix, int(time.time()), i, suffix)
-      if not android_commands.FileExistsOnDevice(self.name):
-        break
-
-  def __enter__(self):
-    return self
-
-  def __exit__(self, type, value, traceback):
-    self.close()
-
-  def close(self):
-    self.android_commands.RunShellCommand('rm ' + self.name)
-
-
-def GetAVDs():
-  """Returns a list of AVDs."""
-  re_avd = re.compile('^[ ]+Name: ([a-zA-Z0-9_:.-]+)', re.MULTILINE)
-  avds = re_avd.findall(cmd_helper.GetCmdOutput(['android', 'list', 'avd']))
-  return avds
-
-def ResetBadDevices():
-  """Removes the blacklist that keeps track of bad devices for a current
-     build.
-  """
-  device_blacklist.ResetBlacklist()
-
-def ExtendBadDevices(devices):
-  """Adds devices to the blacklist that keeps track of bad devices for a
-     current build.
-
-  The devices listed in the bad devices file will not be returned by
-  GetAttachedDevices.
-
-  Args:
-    devices: list of bad devices to be added to the bad devices file.
-  """
-  device_blacklist.ExtendBlacklist(devices)
-
-
-def GetAttachedDevices(hardware=True, emulator=True, offline=False):
-  """Returns a list of attached, android devices and emulators.
-
-  If a preferred device has been set with ANDROID_SERIAL, it will be first in
-  the returned list. The arguments specify what devices to include in the list.
-
-  Example output:
-
-    * daemon not running. starting it now on port 5037 *
-    * daemon started successfully *
-    List of devices attached
-    027c10494100b4d7        device
-    emulator-5554   offline
-
-  Args:
-    hardware: Include attached actual devices that are online.
-    emulator: Include emulators (i.e. AVD's) currently on host.
-    offline: Include devices and emulators that are offline.
-
-  Returns: List of devices.
-  """
-  adb_devices_output = cmd_helper.GetCmdOutput([constants.GetAdbPath(),
-                                                'devices'])
-
-  re_device = re.compile('^([a-zA-Z0-9_:.-]+)\tdevice$', re.MULTILINE)
-  online_devices = re_device.findall(adb_devices_output)
-
-  re_device = re.compile('^(emulator-[0-9]+)\tdevice', re.MULTILINE)
-  emulator_devices = re_device.findall(adb_devices_output)
-
-  re_device = re.compile('^([a-zA-Z0-9_:.-]+)\t(?:offline|unauthorized)$',
-                         re.MULTILINE)
-  offline_devices = re_device.findall(adb_devices_output)
-
-  devices = []
-  # First determine list of online devices (e.g. hardware and/or emulator).
-  if hardware and emulator:
-    devices = online_devices
-  elif hardware:
-    devices = [device for device in online_devices
-               if device not in emulator_devices]
-  elif emulator:
-    devices = emulator_devices
-
-  # Now add offline devices if offline is true
-  if offline:
-    devices = devices + offline_devices
-
-  # Remove any devices in the blacklist.
-  blacklist = device_blacklist.ReadBlacklist()
-  if len(blacklist):
-    logging.info('Avoiding bad devices %s', ' '.join(blacklist))
-    devices = [device for device in devices if device not in blacklist]
-
-  preferred_device = os.environ.get('ANDROID_SERIAL')
-  if preferred_device in devices:
-    devices.remove(preferred_device)
-    devices.insert(0, preferred_device)
-  return devices
-
-
-def IsDeviceAttached(device):
-  """Return true if the device is attached and online."""
-  return device in GetAttachedDevices()
-
-
-def _GetFilesFromRecursiveLsOutput(path, ls_output, re_file, utc_offset=None):
-  """Gets a list of files from `ls` command output.
-
-  Python's os.walk isn't used because it doesn't work over adb shell.
-
-  Args:
-    path: The path to list.
-    ls_output: A list of lines returned by an `ls -lR` command.
-    re_file: A compiled regular expression which parses a line into named groups
-        consisting of at minimum "filename", "date", "time", "size" and
-        optionally "timezone".
-    utc_offset: A 5-character string of the form +HHMM or -HHMM, where HH is a
-        2-digit string giving the number of UTC offset hours, and MM is a
-        2-digit string giving the number of UTC offset minutes. If the input
-        utc_offset is None, will try to look for the value of "timezone" if it
-        is specified in re_file.
-
-  Returns:
-    A dict of {"name": (size, lastmod), ...} where:
-      name: The file name relative to |path|'s directory.
-      size: The file size in bytes (0 for directories).
-      lastmod: The file last modification date in UTC.
-  """
-  re_directory = re.compile('^%s/(?P<dir>[^:]+):$' % re.escape(path))
-  path_dir = os.path.dirname(path)
-
-  current_dir = ''
-  files = {}
-  for line in ls_output:
-    directory_match = re_directory.match(line)
-    if directory_match:
-      current_dir = directory_match.group('dir')
-      continue
-    file_match = re_file.match(line)
-    if file_match:
-      filename = os.path.join(current_dir, file_match.group('filename'))
-      if filename.startswith(path_dir):
-        filename = filename[len(path_dir) + 1:]
-      lastmod = datetime.datetime.strptime(
-          file_match.group('date') + ' ' + file_match.group('time')[:5],
-          '%Y-%m-%d %H:%M')
-      if not utc_offset and 'timezone' in re_file.groupindex:
-        utc_offset = file_match.group('timezone')
-      if isinstance(utc_offset, str) and len(utc_offset) == 5:
-        utc_delta = datetime.timedelta(hours=int(utc_offset[1:3]),
-                                       minutes=int(utc_offset[3:5]))
-        if utc_offset[0:1] == '-':
-          utc_delta = -utc_delta
-        lastmod -= utc_delta
-      files[filename] = (int(file_match.group('size')), lastmod)
-  return files
-
-
-def _ParseMd5SumOutput(md5sum_output):
-  """Returns a list of tuples from the provided md5sum output.
-
-  Args:
-    md5sum_output: output directly from md5sum binary.
-
-  Returns:
-    List of namedtuples with attributes |hash| and |path|, where |path| is the
-    absolute path to the file with an Md5Sum of |hash|.
-  """
-  HashAndPath = collections.namedtuple('HashAndPath', ['hash', 'path'])
-  split_lines = [line.split('  ') for line in md5sum_output]
-  return [HashAndPath._make(s) for s in split_lines if len(s) == 2]
-
-
-def _HasAdbPushSucceeded(command_output):
-  """Returns whether adb push has succeeded from the provided output."""
-  # TODO(frankf): We should look at the return code instead of the command
-  # output for many of the commands in this file.
-  if not command_output:
-    return True
-  # Success looks like this: "3035 KB/s (12512056 bytes in 4.025s)"
-  # Errors look like this: "failed to copy  ... "
-  if not re.search('^[0-9]', command_output.splitlines()[-1]):
-    logging.critical('PUSH FAILED: ' + command_output)
-    return False
-  return True
-
-
-def GetLogTimestamp(log_line, year):
-  """Returns the timestamp of the given |log_line| in the given year."""
-  try:
-    return datetime.datetime.strptime('%s-%s' % (year, log_line[:18]),
-                                      '%Y-%m-%d %H:%M:%S.%f')
-  except (ValueError, IndexError):
-    logging.critical('Error reading timestamp from ' + log_line)
-    return None
-
-
-class AndroidCommands(object):
-  """Helper class for communicating with Android device via adb."""
-
-  def __init__(self, device=None):
-    """Constructor.
-
-    Args:
-      device: If given, adb commands are only send to the device of this ID.
-          Otherwise commands are sent to all attached devices.
-    """
-    self._adb = adb_interface.AdbInterface(constants.GetAdbPath())
-    if device:
-      self._adb.SetTargetSerial(device)
-    self._device = device
-    self._logcat = None
-    self.logcat_process = None
-    self._logcat_tmpoutfile = None
-    self._pushed_files = []
-    self._device_utc_offset = None
-    self._potential_push_size = 0
-    self._actual_push_size = 0
-    self._external_storage = ''
-    self._util_wrapper = ''
-    self._system_properties = system_properties.SystemProperties(self.Adb())
-    self._push_if_needed_cache = {}
-    self._control_usb_charging_command = {
-        'command': None,
-        'cached': False,
-    }
-    self._protected_file_access_method_initialized = None
-    self._privileged_command_runner = None
-    self._pie_wrapper = None
-
-  @property
-  def system_properties(self):
-    return self._system_properties
-
-  def _LogShell(self, cmd):
-    """Logs the adb shell command."""
-    if self._device:
-      device_repr = self._device[-4:]
-    else:
-      device_repr = '????'
-    logging.info('[%s]> %s', device_repr, cmd)
-
-  def Adb(self):
-    """Returns our AdbInterface to avoid us wrapping all its methods."""
-    # TODO(tonyg): Goal should be to git rid of this method by making this API
-    # complete and alleviating the need.
-    return self._adb
-
-  def GetDevice(self):
-    """Returns the device serial."""
-    return self._device
-
-  def IsOnline(self):
-    """Checks whether the device is online.
-
-    Returns:
-      True if device is in 'device' mode, False otherwise.
-    """
-    # TODO(aurimas): revert to using adb get-state when android L adb is fixed.
-    #out = self._adb.SendCommand('get-state')
-    #return out.strip() == 'device'
-
-    out = self._adb.SendCommand('devices')
-    for line in out.split('\n'):
-      if self._device in line and 'device' in line:
-        return True
-    return False
-
-  def IsRootEnabled(self):
-    """Checks if root is enabled on the device."""
-    root_test_output = self.RunShellCommand('ls /root') or ['']
-    return not 'Permission denied' in root_test_output[0]
-
-  def EnableAdbRoot(self):
-    """Enables adb root on the device.
-
-    Returns:
-      True: if output from executing adb root was as expected.
-      False: otherwise.
-    """
-    if self.GetBuildType() == 'user':
-      logging.warning("Can't enable root in production builds with type user")
-      return False
-    else:
-      return_value = self._adb.EnableAdbRoot()
-      # EnableAdbRoot inserts a call for wait-for-device only when adb logcat
-      # output matches what is expected. Just to be safe add a call to
-      # wait-for-device.
-      self._adb.SendCommand('wait-for-device')
-      return return_value
-
-  def GetDeviceYear(self):
-    """Returns the year information of the date on device."""
-    return self.RunShellCommand('date +%Y')[0]
-
-  def GetExternalStorage(self):
-    if not self._external_storage:
-      self._external_storage = self.RunShellCommand('echo $EXTERNAL_STORAGE')[0]
-      if not self._external_storage:
-        raise device_errors.CommandFailedError(
-            ['shell', "'echo $EXTERNAL_STORAGE'"],
-            'Unable to find $EXTERNAL_STORAGE')
-    return self._external_storage
-
-  def WaitForDevicePm(self, timeout=120):
-    """Blocks until the device's package manager is available.
-
-    To workaround http://b/5201039, we restart the shell and retry if the
-    package manager isn't back after 120 seconds.
-
-    Raises:
-      errors.WaitForResponseTimedOutError after max retries reached.
-    """
-    last_err = None
-    retries = 3
-    while retries:
-      try:
-        self._adb.WaitForDevicePm(wait_time=timeout)
-        return  # Success
-      except errors.WaitForResponseTimedOutError as e:
-        last_err = e
-        logging.warning('Restarting and retrying after timeout: %s', e)
-        retries -= 1
-        self.RestartShell()
-    raise last_err # Only reached after max retries, re-raise the last error.
-
-  def RestartShell(self):
-    """Restarts the shell on the device. Does not block for it to return."""
-    self.RunShellCommand('stop')
-    self.RunShellCommand('start')
-
-  def Reboot(self, full_reboot=True):
-    """Reboots the device and waits for the package manager to return.
-
-    Args:
-      full_reboot: Whether to fully reboot the device or just restart the shell.
-    """
-    # TODO(torne): hive can't reboot the device either way without breaking the
-    # connection; work out if we can handle this better
-    if os.environ.get('USING_HIVE'):
-      logging.warning('Ignoring reboot request as we are on hive')
-      return
-    if full_reboot or not self.IsRootEnabled():
-      self._adb.SendCommand('reboot')
-      self._system_properties = system_properties.SystemProperties(self.Adb())
-      timeout = 300
-      retries = 1
-      # Wait for the device to disappear.
-      while retries < 10 and self.IsOnline():
-        time.sleep(1)
-        retries += 1
-    else:
-      self.RestartShell()
-      timeout = 120
-    # To run tests we need at least the package manager and the sd card (or
-    # other external storage) to be ready.
-    self.WaitForDevicePm(timeout)
-    self.WaitForSdCardReady(timeout)
-
-  def Shutdown(self):
-    """Shuts down the device."""
-    self._adb.SendCommand('reboot -p')
-    self._system_properties = system_properties.SystemProperties(self.Adb())
-
-  def Uninstall(self, package):
-    """Uninstalls the specified package from the device.
-
-    Args:
-      package: Name of the package to remove.
-
-    Returns:
-      A status string returned by adb uninstall
-    """
-    uninstall_command = 'uninstall %s' % package
-
-    self._LogShell(uninstall_command)
-    return self._adb.SendCommand(uninstall_command, timeout_time=60)
-
-  def Install(self, package_file_path, reinstall=False):
-    """Installs the specified package to the device.
-
-    Args:
-      package_file_path: Path to .apk file to install.
-      reinstall: Reinstall an existing apk, keeping the data.
-
-    Returns:
-      A status string returned by adb install
-    """
-    assert os.path.isfile(package_file_path), ('<%s> is not file' %
-                                               package_file_path)
-
-    install_cmd = ['install']
-
-    if reinstall:
-      install_cmd.append('-r')
-
-    install_cmd.append(package_file_path)
-    install_cmd = ' '.join(install_cmd)
-
-    self._LogShell(install_cmd)
-    return self._adb.SendCommand(install_cmd,
-                                 timeout_time=2 * 60,
-                                 retry_count=0)
-
-  def ManagedInstall(self, apk_path, keep_data=False, package_name=None,
-                     reboots_on_timeout=2):
-    """Installs specified package and reboots device on timeouts.
-
-    If package_name is supplied, checks if the package is already installed and
-    doesn't reinstall if the apk md5sums match.
-
-    Args:
-      apk_path: Path to .apk file to install.
-      keep_data: Reinstalls instead of uninstalling first, preserving the
-        application data.
-      package_name: Package name (only needed if keep_data=False).
-      reboots_on_timeout: number of time to reboot if package manager is frozen.
-    """
-    # Check if package is already installed and up to date.
-    if package_name:
-      installed_apk_path = self.GetApplicationPath(package_name)
-      if (installed_apk_path and
-          not self.GetFilesChanged(apk_path, installed_apk_path,
-                                   ignore_filenames=True)):
-        logging.info('Skipped install: identical %s APK already installed' %
-            package_name)
-        return
-    # Install.
-    reboots_left = reboots_on_timeout
-    while True:
-      try:
-        if not keep_data:
-          assert package_name
-          self.Uninstall(package_name)
-        install_status = self.Install(apk_path, reinstall=keep_data)
-        if 'Success' in install_status:
-          return
-        else:
-          raise Exception('Install failure: %s' % install_status)
-      except errors.WaitForResponseTimedOutError:
-        print '@@@STEP_WARNINGS@@@'
-        logging.info('Timeout on installing %s on device %s', apk_path,
-                     self._device)
-
-        if reboots_left <= 0:
-          raise Exception('Install timed out')
-
-        # Force a hard reboot on last attempt
-        self.Reboot(full_reboot=(reboots_left == 1))
-        reboots_left -= 1
-
-  def MakeSystemFolderWritable(self):
-    """Remounts the /system folder rw."""
-    out = self._adb.SendCommand('remount')
-    if out.strip() != 'remount succeeded':
-      raise errors.MsgException('Remount failed: %s' % out)
-
-  def RestartAdbdOnDevice(self):
-    logging.info('Restarting adbd on the device...')
-    with DeviceTempFile(self, suffix=".sh") as temp_script_file:
-      host_script_path = os.path.join(constants.DIR_SOURCE_ROOT,
-                                      'build',
-                                      'android',
-                                      'pylib',
-                                      'restart_adbd.sh')
-      self._adb.Push(host_script_path, temp_script_file.name)
-      self.RunShellCommand('. %s' % temp_script_file.name)
-      self._adb.SendCommand('wait-for-device')
-
-  def RestartAdbServer(self):
-    """Restart the adb server."""
-    ret = self.KillAdbServer()
-    if ret != 0:
-      raise errors.MsgException('KillAdbServer: %d' % ret)
-
-    ret = self.StartAdbServer()
-    if ret != 0:
-      raise errors.MsgException('StartAdbServer: %d' % ret)
-
-  @staticmethod
-  def KillAdbServer():
-    """Kill adb server."""
-    adb_cmd = [constants.GetAdbPath(), 'kill-server']
-    ret = cmd_helper.RunCmd(adb_cmd)
-    retry = 0
-    while retry < 3:
-      ret, _ = cmd_helper.GetCmdStatusAndOutput(['pgrep', 'adb'])
-      if ret != 0:
-        # pgrep didn't find adb, kill-server succeeded.
-        return 0
-      retry += 1
-      time.sleep(retry)
-    return ret
-
-  def StartAdbServer(self):
-    """Start adb server."""
-    adb_cmd = ['taskset', '-c', '0', constants.GetAdbPath(), 'start-server']
-    ret, _ = cmd_helper.GetCmdStatusAndOutput(adb_cmd)
-    retry = 0
-    while retry < 3:
-      ret, _ = cmd_helper.GetCmdStatusAndOutput(['pgrep', 'adb'])
-      if ret == 0:
-        # pgrep found adb, start-server succeeded.
-        # Waiting for device to reconnect before returning success.
-        self._adb.SendCommand('wait-for-device')
-        return 0
-      retry += 1
-      time.sleep(retry)
-    return ret
-
-  def WaitForSystemBootCompleted(self, wait_time):
-    """Waits for targeted system's boot_completed flag to be set.
-
-    Args:
-      wait_time: time in seconds to wait
-
-    Raises:
-      WaitForResponseTimedOutError if wait_time elapses and flag still not
-      set.
-    """
-    logging.info('Waiting for system boot completed...')
-    self._adb.SendCommand('wait-for-device')
-    # Now the device is there, but system not boot completed.
-    # Query the sys.boot_completed flag with a basic command
-    boot_completed = False
-    attempts = 0
-    wait_period = 5
-    while not boot_completed and (attempts * wait_period) < wait_time:
-      output = self.system_properties['sys.boot_completed']
-      output = output.strip()
-      if output == '1':
-        boot_completed = True
-      else:
-        # If 'error: xxx' returned when querying the flag, it means
-        # adb server lost the connection to the emulator, so restart the adb
-        # server.
-        if 'error:' in output:
-          self.RestartAdbServer()
-        time.sleep(wait_period)
-        attempts += 1
-    if not boot_completed:
-      raise errors.WaitForResponseTimedOutError(
-          'sys.boot_completed flag was not set after %s seconds' % wait_time)
-
-  def WaitForSdCardReady(self, timeout_time):
-    """Wait for the SD card ready before pushing data into it."""
-    logging.info('Waiting for SD card ready...')
-    sdcard_ready = False
-    attempts = 0
-    wait_period = 5
-    external_storage = self.GetExternalStorage()
-    while not sdcard_ready and attempts * wait_period < timeout_time:
-      output = self.RunShellCommand('ls ' + external_storage)
-      if output:
-        sdcard_ready = True
-      else:
-        time.sleep(wait_period)
-        attempts += 1
-    if not sdcard_ready:
-      raise errors.WaitForResponseTimedOutError(
-          'SD card not ready after %s seconds' % timeout_time)
-
-  def GetAndroidToolStatusAndOutput(self, command, lib_path=None, *args, **kw):
-    """Runs a native Android binary, wrapping the command as necessary.
-
-    This is a specialization of GetShellCommandStatusAndOutput, which is meant
-    for running tools/android/ binaries and handle properly: (1) setting the
-    lib path (for component=shared_library), (2) using the PIE wrapper on ICS.
-    See crbug.com/373219 for more context.
-
-    Args:
-      command: String containing the command to send.
-      lib_path: (optional) path to the folder containing the dependent libs.
-      Same other arguments of GetCmdStatusAndOutput.
-    """
-    # The first time this command is run the device is inspected to check
-    # whether a wrapper for running PIE executable is needed (only Android ICS)
-    # or not. The results is cached, so the wrapper is pushed only once.
-    if self._pie_wrapper is None:
-      # None: did not check; '': did check and not needed; '/path': use /path.
-      self._pie_wrapper = ''
-      if self.GetBuildId().startswith('I'):  # Ixxxx = Android ICS.
-        run_pie_dist_path = os.path.join(constants.GetOutDirectory(), 'run_pie')
-        assert os.path.exists(run_pie_dist_path), 'Please build run_pie'
-        # The PIE loader must be pushed manually (i.e. no PushIfNeeded) because
-        # PushIfNeeded requires md5sum and md5sum requires the wrapper as well.
-        adb_command = 'push %s %s' % (run_pie_dist_path, PIE_WRAPPER_PATH)
-        assert _HasAdbPushSucceeded(self._adb.SendCommand(adb_command))
-        self._pie_wrapper = PIE_WRAPPER_PATH
-
-    if self._pie_wrapper:
-      command = '%s %s' % (self._pie_wrapper, command)
-    if lib_path:
-      command = 'LD_LIBRARY_PATH=%s %s' % (lib_path, command)
-    return self.GetShellCommandStatusAndOutput(command, *args, **kw)
-
-  # It is tempting to turn this function into a generator, however this is not
-  # possible without using a private (local) adb_shell instance (to ensure no
-  # other command interleaves usage of it), which would defeat the main aim of
-  # being able to reuse the adb shell instance across commands.
-  def RunShellCommand(self, command, timeout_time=20, log_result=False):
-    """Send a command to the adb shell and return the result.
-
-    Args:
-      command: String containing the shell command to send.
-      timeout_time: Number of seconds to wait for command to respond before
-        retrying, used by AdbInterface.SendShellCommand.
-      log_result: Boolean to indicate whether we should log the result of the
-                  shell command.
-
-    Returns:
-      list containing the lines of output received from running the command
-    """
-    self._LogShell(command)
-    if "'" in command:
-      command = command.replace('\'', '\'\\\'\'')
-    result = self._adb.SendShellCommand(
-        "'%s'" % command, timeout_time).splitlines()
-    # TODO(b.kelemen): we should really be able to drop the stderr of the
-    # command or raise an exception based on what the caller wants.
-    result = [ l for l in result if not l.startswith('WARNING') ]
-    if ['error: device not found'] == result:
-      raise errors.DeviceUnresponsiveError('device not found')
-    if log_result:
-      self._LogShell('\n'.join(result))
-    return result
-
-  def GetShellCommandStatusAndOutput(self, command, timeout_time=20,
-                                     log_result=False):
-    """See RunShellCommand() above.
-
-    Returns:
-      The tuple (exit code, list of output lines).
-    """
-    lines = self.RunShellCommand(
-        command + '; echo %$?', timeout_time, log_result)
-    last_line = lines[-1]
-    status_pos = last_line.rfind('%')
-    assert status_pos >= 0
-    status = int(last_line[status_pos + 1:])
-    if status_pos == 0:
-      lines = lines[:-1]
-    else:
-      lines = lines[:-1] + [last_line[:status_pos]]
-    return (status, lines)
-
-  def KillAll(self, process, signum=9, with_su=False):
-    """Android version of killall, connected via adb.
-
-    Args:
-      process: name of the process to kill off.
-      signum: signal to use, 9 (SIGKILL) by default.
-      with_su: wether or not to use su to kill the processes.
-
-    Returns:
-      the number of processes killed
-    """
-    pids = self.ExtractPid(process)
-    if pids:
-      cmd = 'kill -%d %s' % (signum, ' '.join(pids))
-      if with_su:
-        self.RunShellCommandWithSU(cmd)
-      else:
-        self.RunShellCommand(cmd)
-    return len(pids)
-
-  def KillAllBlocking(self, process, timeout_sec, signum=9, with_su=False):
-    """Blocking version of killall, connected via adb.
-
-    This waits until no process matching the corresponding name appears in ps'
-    output anymore.
-
-    Args:
-      process: name of the process to kill off
-      timeout_sec: the timeout in seconds
-      signum: same as |KillAll|
-      with_su: same as |KillAll|
-    Returns:
-      the number of processes killed
-    """
-    processes_killed = self.KillAll(process, signum=signum, with_su=with_su)
-    if processes_killed:
-      elapsed = 0
-      wait_period = 0.1
-      # Note that this doesn't take into account the time spent in ExtractPid().
-      while self.ExtractPid(process) and elapsed < timeout_sec:
-        time.sleep(wait_period)
-        elapsed += wait_period
-      if elapsed >= timeout_sec:
-        return processes_killed - self.ExtractPid(process)
-    return processes_killed
-
-  @staticmethod
-  def _GetActivityCommand(package, activity, wait_for_completion, action,
-                          category, data, extras, trace_file_name, force_stop,
-                          flags):
-    """Creates command to start |package|'s activity on the device.
-
-    Args - as for StartActivity
-
-    Returns:
-      the command to run on the target to start the activity
-    """
-    cmd = 'am start -a %s' % action
-    if force_stop:
-      cmd += ' -S'
-    if wait_for_completion:
-      cmd += ' -W'
-    if category:
-      cmd += ' -c %s' % category
-    if package and activity:
-      cmd += ' -n %s/%s' % (package, activity)
-    if data:
-      cmd += ' -d "%s"' % data
-    if extras:
-      for key in extras:
-        value = extras[key]
-        if isinstance(value, str):
-          cmd += ' --es'
-        elif isinstance(value, bool):
-          cmd += ' --ez'
-        elif isinstance(value, int):
-          cmd += ' --ei'
-        else:
-          raise NotImplementedError(
-              'Need to teach StartActivity how to pass %s extras' % type(value))
-        cmd += ' %s %s' % (key, value)
-    if trace_file_name:
-      cmd += ' --start-profiler ' + trace_file_name
-    if flags:
-      cmd += ' -f %s' % flags
-    return cmd
-
-  def StartActivity(self, package, activity, wait_for_completion=False,
-                    action='android.intent.action.VIEW',
-                    category=None, data=None,
-                    extras=None, trace_file_name=None,
-                    force_stop=False, flags=None):
-    """Starts |package|'s activity on the device.
-
-    Args:
-      package: Name of package to start (e.g. 'com.google.android.apps.chrome').
-      activity: Name of activity (e.g. '.Main' or
-        'com.google.android.apps.chrome.Main').
-      wait_for_completion: wait for the activity to finish launching (-W flag).
-      action: string (e.g. "android.intent.action.MAIN"). Default is VIEW.
-      category: string (e.g. "android.intent.category.HOME")
-      data: Data string to pass to activity (e.g. 'http://www.example.com/').
-      extras: Dict of extras to pass to activity. Values are significant.
-      trace_file_name: If used, turns on and saves the trace to this file name.
-      force_stop: force stop the target app before starting the activity (-S
-        flag).
-    Returns:
-      The output of the underlying command as a list of lines.
-    """
-    cmd = self._GetActivityCommand(package, activity, wait_for_completion,
-                                   action, category, data, extras,
-                                   trace_file_name, force_stop, flags)
-    return self.RunShellCommand(cmd)
-
-  def StartActivityTimed(self, package, activity, wait_for_completion=False,
-                         action='android.intent.action.VIEW',
-                         category=None, data=None,
-                         extras=None, trace_file_name=None,
-                         force_stop=False, flags=None):
-    """Starts |package|'s activity on the device, returning the start time
-
-    Args - as for StartActivity
-
-    Returns:
-      A tuple containing:
-        - the output of the underlying command as a list of lines, and
-        - a timestamp string for the time at which the activity started
-    """
-    cmd = self._GetActivityCommand(package, activity, wait_for_completion,
-                                   action, category, data, extras,
-                                   trace_file_name, force_stop, flags)
-    self.StartMonitoringLogcat()
-    out = self.RunShellCommand('log starting activity; ' + cmd)
-    activity_started_re = re.compile('.*starting activity.*')
-    m = self.WaitForLogMatch(activity_started_re, None)
-    assert m
-    start_line = m.group(0)
-    return (out, GetLogTimestamp(start_line, self.GetDeviceYear()))
-
-  def StartCrashUploadService(self, package):
-    # TODO(frankf): We really need a python wrapper around Intent
-    # to be shared with StartActivity/BroadcastIntent.
-    cmd = (
-      'am startservice -a %s.crash.ACTION_FIND_ALL -n '
-      '%s/%s.crash.MinidumpUploadService' %
-      (constants.PACKAGE_INFO['chrome'].package,
-       package,
-       constants.PACKAGE_INFO['chrome'].package))
-    am_output = self.RunShellCommandWithSU(cmd)
-    assert am_output and 'Starting' in am_output[-1], (
-        'Service failed to start: %s' % am_output)
-    time.sleep(15)
-
-  def BroadcastIntent(self, package, intent, *args):
-    """Send a broadcast intent.
-
-    Args:
-      package: Name of package containing the intent.
-      intent: Name of the intent.
-      args: Optional extra arguments for the intent.
-    """
-    cmd = 'am broadcast -a %s.%s %s' % (package, intent, ' '.join(args))
-    self.RunShellCommand(cmd)
-
-  def GoHome(self):
-    """Tell the device to return to the home screen. Blocks until completion."""
-    self.RunShellCommand('am start -W '
-        '-a android.intent.action.MAIN -c android.intent.category.HOME')
-
-  def CloseApplication(self, package):
-    """Attempt to close down the application, using increasing violence.
-
-    Args:
-      package: Name of the process to kill off, e.g.
-      com.google.android.apps.chrome
-    """
-    self.RunShellCommand('am force-stop ' + package)
-
-  def GetApplicationPath(self, package):
-    """Get the installed apk path on the device for the given package.
-
-    Args:
-      package: Name of the package.
-
-    Returns:
-      Path to the apk on the device if it exists, None otherwise.
-    """
-    pm_path_output  = self.RunShellCommand('pm path ' + package)
-    # The path output contains anything if and only if the package
-    # exists.
-    if pm_path_output:
-      # pm_path_output is of the form: "package:/path/to/foo.apk"
-      return pm_path_output[0].split(':')[1]
-    else:
-      return None
-
-  def ClearApplicationState(self, package):
-    """Closes and clears all state for the given |package|."""
-    # Check that the package exists before clearing it. Necessary because
-    # calling pm clear on a package that doesn't exist may never return.
-    pm_path_output  = self.RunShellCommand('pm path ' + package)
-    # The path output only contains anything if and only if the package exists.
-    if pm_path_output:
-      self.RunShellCommand('pm clear ' + package)
-
-  def SendKeyEvent(self, keycode):
-    """Sends keycode to the device.
-
-    Args:
-      keycode: Numeric keycode to send (see "enum" at top of file).
-    """
-    self.RunShellCommand('input keyevent %d' % keycode)
-
-  def _RunMd5Sum(self, host_path, device_path):
-    """Gets the md5sum of a host path and device path.
-
-    Args:
-      host_path: Path (file or directory) on the host.
-      device_path: Path on the device.
-
-    Returns:
-      A tuple containing lists of the host and device md5sum results as
-      created by _ParseMd5SumOutput().
-    """
-    md5sum_dist_path = os.path.join(constants.GetOutDirectory(),
-                                    'md5sum_dist')
-    assert os.path.exists(md5sum_dist_path), 'Please build md5sum.'
-    md5sum_dist_mtime = os.stat(md5sum_dist_path).st_mtime
-    if (md5sum_dist_path not in self._push_if_needed_cache or
-        self._push_if_needed_cache[md5sum_dist_path] != md5sum_dist_mtime):
-      command = 'push %s %s' % (md5sum_dist_path, MD5SUM_DEVICE_FOLDER)
-      assert _HasAdbPushSucceeded(self._adb.SendCommand(command))
-      self._push_if_needed_cache[md5sum_dist_path] = md5sum_dist_mtime
-
-    (_, md5_device_output) = self.GetAndroidToolStatusAndOutput(
-        self._util_wrapper + ' ' + MD5SUM_DEVICE_PATH + ' ' + device_path,
-        lib_path=MD5SUM_DEVICE_FOLDER,
-        timeout_time=2 * 60)
-    device_hash_tuples = _ParseMd5SumOutput(md5_device_output)
-    assert os.path.exists(host_path), 'Local path not found %s' % host_path
-    md5sum_output = cmd_helper.GetCmdOutput(
-        [os.path.join(constants.GetOutDirectory(), 'md5sum_bin_host'),
-         host_path])
-    host_hash_tuples = _ParseMd5SumOutput(md5sum_output.splitlines())
-    return (host_hash_tuples, device_hash_tuples)
-
-  def GetFilesChanged(self, host_path, device_path, ignore_filenames=False):
-    """Compares the md5sum of a host path against a device path.
-
-    Note: Ignores extra files on the device.
-
-    Args:
-      host_path: Path (file or directory) on the host.
-      device_path: Path on the device.
-      ignore_filenames: If True only the file contents are considered when
-          checking whether a file has changed, otherwise the relative path
-          must also match.
-
-    Returns:
-      A list of tuples of the form (host_path, device_path) for files whose
-      md5sums do not match.
-    """
-
-    # Md5Sum resolves symbolic links in path names so the calculation of
-    # relative path names from its output will need the real path names of the
-    # base directories. Having calculated these they are used throughout the
-    # function since this makes us less subject to any future changes to Md5Sum.
-    real_host_path = os.path.realpath(host_path)
-    real_device_path = self.RunShellCommand('realpath "%s"' % device_path)[0]
-
-    host_hash_tuples, device_hash_tuples = self._RunMd5Sum(
-        real_host_path, real_device_path)
-
-    if len(host_hash_tuples) > len(device_hash_tuples):
-      logging.info('%s files do not exist on the device' %
-                   (len(host_hash_tuples) - len(device_hash_tuples)))
-
-    host_rel = [(os.path.relpath(os.path.normpath(t.path), real_host_path),
-                 t.hash)
-                for t in host_hash_tuples]
-
-    if os.path.isdir(real_host_path):
-      def RelToRealPaths(rel_path):
-        return (os.path.join(real_host_path, rel_path),
-                os.path.join(real_device_path, rel_path))
-    else:
-      assert len(host_rel) == 1
-      def RelToRealPaths(_):
-        return (real_host_path, real_device_path)
-
-    if ignore_filenames:
-      # If we are ignoring file names, then we want to push any file for which
-      # a file with an equivalent MD5 sum does not exist on the device.
-      device_hashes = set([h.hash for h in device_hash_tuples])
-      ShouldPush = lambda p, h: h not in device_hashes
-    else:
-      # Otherwise, we want to push any file on the host for which a file with
-      # an equivalent MD5 sum does not exist at the same relative path on the
-      # device.
-      device_rel = dict([(os.path.relpath(os.path.normpath(t.path),
-                                          real_device_path),
-                          t.hash)
-                         for t in device_hash_tuples])
-      ShouldPush = lambda p, h: p not in device_rel or h != device_rel[p]
-
-    return [RelToRealPaths(path) for path, host_hash in host_rel
-            if ShouldPush(path, host_hash)]
-
-  def PushIfNeeded(self, host_path, device_path):
-    """Pushes |host_path| to |device_path|.
-
-    Works for files and directories. This method skips copying any paths in
-    |test_data_paths| that already exist on the device with the same hash.
-
-    All pushed files can be removed by calling RemovePushedFiles().
-    """
-    MAX_INDIVIDUAL_PUSHES = 50
-    if not os.path.exists(host_path):
-      raise device_errors.CommandFailedError(
-          'Local path not found %s' % host_path, device=str(self))
-
-    # See if the file on the host changed since the last push (if any) and
-    # return early if it didn't. Note that this shortcut assumes that the tests
-    # on the device don't modify the files.
-    if not os.path.isdir(host_path):
-      if host_path in self._push_if_needed_cache:
-        host_path_mtime = self._push_if_needed_cache[host_path]
-        if host_path_mtime == os.stat(host_path).st_mtime:
-          return
-
-    size = host_utils.GetRecursiveDiskUsage(host_path)
-    self._pushed_files.append(device_path)
-    self._potential_push_size += size
-
-    if os.path.isdir(host_path):
-      self.RunShellCommand('mkdir -p "%s"' % device_path)
-
-    changed_files = self.GetFilesChanged(host_path, device_path)
-    logging.info('Found %d files that need to be pushed to %s',
-        len(changed_files), device_path)
-    if not changed_files:
-      return
-
-    def Push(host, device):
-      # NOTE: We can't use adb_interface.Push() because it hardcodes a timeout
-      # of 60 seconds which isn't sufficient for a lot of users of this method.
-      push_command = 'push %s %s' % (host, device)
-      self._LogShell(push_command)
-
-      # Retry push with increasing backoff if the device is busy.
-      retry = 0
-      while True:
-        output = self._adb.SendCommand(push_command, timeout_time=30 * 60)
-        if _HasAdbPushSucceeded(output):
-          if not os.path.isdir(host_path):
-            self._push_if_needed_cache[host] = os.stat(host).st_mtime
-          return
-        if retry < 3:
-          retry += 1
-          wait_time = 5 * retry
-          logging.error('Push failed, retrying in %d seconds: %s' %
-                        (wait_time, output))
-          time.sleep(wait_time)
-        else:
-          raise Exception('Push failed: %s' % output)
-
-    diff_size = 0
-    if len(changed_files) <= MAX_INDIVIDUAL_PUSHES:
-      diff_size = sum(host_utils.GetRecursiveDiskUsage(f[0])
-                      for f in changed_files)
-
-    # TODO(craigdh): Replace this educated guess with a heuristic that
-    # approximates the push time for each method.
-    if len(changed_files) > MAX_INDIVIDUAL_PUSHES or diff_size > 0.5 * size:
-      self._actual_push_size += size
-      Push(host_path, device_path)
-    else:
-      for f in changed_files:
-        Push(f[0], f[1])
-      self._actual_push_size += diff_size
-
-  def GetPushSizeInfo(self):
-    """Get total size of pushes to the device done via PushIfNeeded()
-
-    Returns:
-      A tuple:
-        1. Total size of push requests to PushIfNeeded (MB)
-        2. Total size that was actually pushed (MB)
-    """
-    return (self._potential_push_size, self._actual_push_size)
-
-  def GetFileContents(self, filename, log_result=False):
-    """Gets contents from the file specified by |filename|."""
-    return self.RunShellCommand('cat "%s" 2>/dev/null' % filename,
-                                log_result=log_result)
-
-  def SetFileContents(self, filename, contents):
-    """Writes |contents| to the file specified by |filename|."""
-    with tempfile.NamedTemporaryFile() as f:
-      f.write(contents)
-      f.flush()
-      self._adb.Push(f.name, filename)
-
-  def RunShellCommandWithSU(self, command, timeout_time=20, log_result=False):
-    return self.RunShellCommand('su -c %s' % command, timeout_time, log_result)
-
-  def CanAccessProtectedFileContents(self):
-    """Returns True if Get/SetProtectedFileContents would work via "su" or adb
-    shell running as root.
-
-    Devices running user builds don't have adb root, but may provide "su" which
-    can be used for accessing protected files.
-    """
-    return (self._GetProtectedFileCommandRunner() != None)
-
-  def _GetProtectedFileCommandRunner(self):
-    """Finds the best method to access protected files on the device.
-
-    Returns:
-      1. None when privileged files cannot be accessed on the device.
-      2. Otherwise: A function taking a single parameter: a string with command
-         line arguments. Running that function executes the command with
-         the appropriate method.
-    """
-    if self._protected_file_access_method_initialized:
-      return self._privileged_command_runner
-
-    self._privileged_command_runner = None
-    self._protected_file_access_method_initialized = True
-
-    for cmd in [self.RunShellCommand, self.RunShellCommandWithSU]:
-      # Get contents of the auxv vector for the init(8) process from a small
-      # binary file that always exists on linux and is always read-protected.
-      contents = cmd('cat /proc/1/auxv')
-      # The leading 4 or 8-bytes of auxv vector is a_type. There are not many
-      # reserved a_type values, hence byte 2 must always be '\0' for a realistic
-      # auxv. See /usr/include/elf.h.
-      if len(contents) > 0 and (contents[0][2] == '\0'):
-        self._privileged_command_runner = cmd
-        break
-    return self._privileged_command_runner
-
-  def GetProtectedFileContents(self, filename):
-    """Gets contents from the protected file specified by |filename|.
-
-    This is potentially less efficient than GetFileContents.
-    """
-    command = 'cat "%s" 2> /dev/null' % filename
-    command_runner = self._GetProtectedFileCommandRunner()
-    if command_runner:
-      return command_runner(command)
-    else:
-      logging.warning('Could not access protected file: %s' % filename)
-      return []
-
-  def SetProtectedFileContents(self, filename, contents):
-    """Writes |contents| to the protected file specified by |filename|.
-
-    This is less efficient than SetFileContents.
-    """
-    with DeviceTempFile(self) as temp_file:
-      with DeviceTempFile(self, suffix=".sh") as temp_script:
-        # Put the contents in a temporary file
-        self.SetFileContents(temp_file.name, contents)
-        # Create a script to copy the file contents to its final destination
-        self.SetFileContents(temp_script.name,
-                             'cat %s > %s' % (temp_file.name, filename))
-
-        command = 'sh %s' % temp_script.name
-        command_runner = self._GetProtectedFileCommandRunner()
-        if command_runner:
-          return command_runner(command)
-        else:
-          logging.warning(
-              'Could not set contents of protected file: %s' % filename)
-
-
-  def RemovePushedFiles(self):
-    """Removes all files pushed with PushIfNeeded() from the device."""
-    for p in self._pushed_files:
-      self.RunShellCommand('rm -r %s' % p, timeout_time=2 * 60)
-
-  def ListPathContents(self, path):
-    """Lists files in all subdirectories of |path|.
-
-    Args:
-      path: The path to list.
-
-    Returns:
-      A dict of {"name": (size, lastmod), ...}.
-    """
-    # Example output:
-    # /foo/bar:
-    # -rw-r----- user group   102 2011-05-12 12:29:54.131623387 +0100 baz.txt
-    re_file = re.compile('^-(?P<perms>[^\s]+)\s+'
-                         '(?P<user>[^\s]+)\s+'
-                         '(?P<group>[^\s]+)\s+'
-                         '(?P<size>[^\s]+)\s+'
-                         '(?P<date>[^\s]+)\s+'
-                         '(?P<time>[^\s]+)\s+'
-                         '(?P<filename>[^\s]+)$')
-    return _GetFilesFromRecursiveLsOutput(
-        path, self.RunShellCommand('ls -lR %s' % path), re_file,
-        self.GetUtcOffset())
-
-  def GetUtcOffset(self):
-    if not self._device_utc_offset:
-      self._device_utc_offset = self.RunShellCommand('date +%z')[0]
-    return self._device_utc_offset
-
-  def SetJavaAssertsEnabled(self, enable):
-    """Sets or removes the device java assertions property.
-
-    Args:
-      enable: If True the property will be set.
-
-    Returns:
-      True if the file was modified (reboot is required for it to take effect).
-    """
-    # First ensure the desired property is persisted.
-    temp_props_file = tempfile.NamedTemporaryFile()
-    properties = ''
-    if self._adb.Pull(LOCAL_PROPERTIES_PATH, temp_props_file.name):
-      with open(temp_props_file.name) as f:
-        properties = f.read()
-    re_search = re.compile(r'^\s*' + re.escape(JAVA_ASSERT_PROPERTY) +
-                           r'\s*=\s*all\s*$', re.MULTILINE)
-    if enable != bool(re.search(re_search, properties)):
-      re_replace = re.compile(r'^\s*' + re.escape(JAVA_ASSERT_PROPERTY) +
-                              r'\s*=\s*\w+\s*$', re.MULTILINE)
-      properties = re.sub(re_replace, '', properties)
-      if enable:
-        properties += '\n%s=all\n' % JAVA_ASSERT_PROPERTY
-
-      file(temp_props_file.name, 'w').write(properties)
-      self._adb.Push(temp_props_file.name, LOCAL_PROPERTIES_PATH)
-
-    # Next, check the current runtime value is what we need, and
-    # if not, set it and report that a reboot is required.
-    was_set = 'all' in self.system_properties[JAVA_ASSERT_PROPERTY]
-    if was_set == enable:
-      return False
-    self.system_properties[JAVA_ASSERT_PROPERTY] = enable and 'all' or ''
-    return True
-
-  def GetBuildId(self):
-    """Returns the build ID of the system (e.g. JRM79C)."""
-    build_id = self.system_properties['ro.build.id']
-    assert build_id
-    return build_id
-
-  def GetBuildType(self):
-    """Returns the build type of the system (e.g. eng)."""
-    build_type = self.system_properties['ro.build.type']
-    assert build_type
-    return build_type
-
-  def GetBuildProduct(self):
-    """Returns the build product of the device (e.g. maguro)."""
-    build_product = self.system_properties['ro.build.product']
-    assert build_product
-    return build_product
-
-  def GetProductName(self):
-    """Returns the product name of the device (e.g. takju)."""
-    name = self.system_properties['ro.product.name']
-    assert name
-    return name
-
-  def GetBuildFingerprint(self):
-    """Returns the build fingerprint of the device."""
-    build_fingerprint = self.system_properties['ro.build.fingerprint']
-    assert build_fingerprint
-    return build_fingerprint
-
-  def GetDescription(self):
-    """Returns the description of the system.
-
-    For example, "yakju-userdebug 4.1 JRN54F 364167 dev-keys".
-    """
-    description = self.system_properties['ro.build.description']
-    assert description
-    return description
-
-  def GetProductModel(self):
-    """Returns the name of the product model (e.g. "Galaxy Nexus") """
-    model = self.system_properties['ro.product.model']
-    assert model
-    return model
-
-  def GetWifiIP(self):
-    """Returns the wifi IP on the device."""
-    wifi_ip = self.system_properties['dhcp.wlan0.ipaddress']
-    # Do not assert here. Devices (e.g. emulators) may not have a WifiIP.
-    return wifi_ip
-
-  def GetSubscriberInfo(self):
-    """Returns the device subscriber info (e.g. GSM and device ID) as string."""
-    iphone_sub = self.RunShellCommand('dumpsys iphonesubinfo')
-    # Do not assert here. Devices (e.g. Nakasi on K) may not have iphonesubinfo.
-    return '\n'.join(iphone_sub)
-
-  def GetBatteryInfo(self):
-    """Returns a {str: str} dict of battery info (e.g. status, level, etc)."""
-    battery = self.RunShellCommand('dumpsys battery')
-    assert battery
-    battery_info = {}
-    for line in battery[1:]:
-      k, _, v = line.partition(': ')
-      battery_info[k.strip()] = v.strip()
-    return battery_info
-
-  def GetSetupWizardStatus(self):
-    """Returns the status of the device setup wizard (e.g. DISABLED)."""
-    status = self.system_properties['ro.setupwizard.mode']
-    # On some devices, the status is empty if not otherwise set. In such cases
-    # the caller should expect an empty string to be returned.
-    return status
-
-  def StartMonitoringLogcat(self, clear=True, logfile=None, filters=None):
-    """Starts monitoring the output of logcat, for use with WaitForLogMatch.
-
-    Args:
-      clear: If True the existing logcat output will be cleared, to avoiding
-             matching historical output lurking in the log.
-      filters: A list of logcat filters to be used.
-    """
-    if clear:
-      self.RunShellCommand('logcat -c')
-    args = []
-    if self._adb._target_arg:
-      args += shlex.split(self._adb._target_arg)
-    args += ['logcat', '-v', 'threadtime']
-    if filters:
-      args.extend(filters)
-    else:
-      args.append('*:v')
-
-    if logfile:
-      logfile = NewLineNormalizer(logfile)
-
-    # Spawn logcat and synchronize with it.
-    for _ in range(4):
-      self._logcat = pexpect.spawn(constants.GetAdbPath(), args, timeout=10,
-                                   logfile=logfile)
-      if not clear or self.SyncLogCat():
-        break
-      self._logcat.close(force=True)
-    else:
-      logging.critical('Error reading from logcat: ' + str(self._logcat.match))
-      sys.exit(1)
-
-  def SyncLogCat(self):
-    """Synchronize with logcat.
-
-    Synchronize with the monitored logcat so that WaitForLogMatch will only
-    consider new message that are received after this point in time.
-
-    Returns:
-      True if the synchronization succeeded.
-    """
-    assert self._logcat
-    tag = 'logcat_sync_%s' % time.time()
-    self.RunShellCommand('log ' + tag)
-    return self._logcat.expect([tag, pexpect.EOF, pexpect.TIMEOUT]) == 0
-
-  def GetMonitoredLogCat(self):
-    """Returns an "adb logcat" command as created by pexpected.spawn."""
-    if not self._logcat:
-      self.StartMonitoringLogcat(clear=False)
-    return self._logcat
-
-  def WaitForLogMatch(self, success_re, error_re, clear=False, timeout=10):
-    """Blocks until a matching line is logged or a timeout occurs.
-
-    Args:
-      success_re: A compiled re to search each line for.
-      error_re: A compiled re which, if found, terminates the search for
-          |success_re|. If None is given, no error condition will be detected.
-      clear: If True the existing logcat output will be cleared, defaults to
-          false.
-      timeout: Timeout in seconds to wait for a log match.
-
-    Raises:
-      pexpect.TIMEOUT after |timeout| seconds without a match for |success_re|
-      or |error_re|.
-
-    Returns:
-      The re match object if |success_re| is matched first or None if |error_re|
-      is matched first.
-    """
-    logging.info('<<< Waiting for logcat:' + str(success_re.pattern))
-    t0 = time.time()
-    while True:
-      if not self._logcat:
-        self.StartMonitoringLogcat(clear)
-      try:
-        while True:
-          # Note this will block for upto the timeout _per log line_, so we need
-          # to calculate the overall timeout remaining since t0.
-          time_remaining = t0 + timeout - time.time()
-          if time_remaining < 0:
-            raise pexpect.TIMEOUT(self._logcat)
-          self._logcat.expect(PEXPECT_LINE_RE, timeout=time_remaining)
-          line = self._logcat.match.group(1)
-          if error_re:
-            error_match = error_re.search(line)
-            if error_match:
-              return None
-          success_match = success_re.search(line)
-          if success_match:
-            return success_match
-          logging.info('<<< Skipped Logcat Line:' + str(line))
-      except pexpect.TIMEOUT:
-        raise pexpect.TIMEOUT(
-            'Timeout (%ds) exceeded waiting for pattern "%s" (tip: use -vv '
-            'to debug)' %
-            (timeout, success_re.pattern))
-      except pexpect.EOF:
-        # It seems that sometimes logcat can end unexpectedly. This seems
-        # to happen during Chrome startup after a reboot followed by a cache
-        # clean. I don't understand why this happens, but this code deals with
-        # getting EOF in logcat.
-        logging.critical('Found EOF in adb logcat. Restarting...')
-        # Rerun spawn with original arguments. Note that self._logcat.args[0] is
-        # the path of adb, so we don't want it in the arguments.
-        self._logcat = pexpect.spawn(constants.GetAdbPath(),
-                                     self._logcat.args[1:],
-                                     timeout=self._logcat.timeout,
-                                     logfile=self._logcat.logfile)
-
-  def StartRecordingLogcat(self, clear=True, filters=None):
-    """Starts recording logcat output to eventually be saved as a string.
-
-    This call should come before some series of tests are run, with either
-    StopRecordingLogcat or SearchLogcatRecord following the tests.
-
-    Args:
-      clear: True if existing log output should be cleared.
-      filters: A list of logcat filters to be used.
-    """
-    if not filters:
-      filters = ['*:v']
-    if clear:
-      self._adb.SendCommand('logcat -c')
-    logcat_command = 'adb %s logcat -v threadtime %s' % (self._adb._target_arg,
-                                                         ' '.join(filters))
-    self._logcat_tmpoutfile = tempfile.NamedTemporaryFile(bufsize=0)
-    self.logcat_process = subprocess.Popen(logcat_command, shell=True,
-                                           stdout=self._logcat_tmpoutfile)
-
-  def GetCurrentRecordedLogcat(self):
-    """Return the current content of the logcat being recorded.
-       Call this after StartRecordingLogcat() and before StopRecordingLogcat().
-       This can be useful to perform timed polling/parsing.
-    Returns:
-       Current logcat output as a single string, or None if
-       StopRecordingLogcat() was already called.
-    """
-    if not self._logcat_tmpoutfile:
-      return None
-
-    with open(self._logcat_tmpoutfile.name) as f:
-      return f.read()
-
-  def StopRecordingLogcat(self):
-    """Stops an existing logcat recording subprocess and returns output.
-
-    Returns:
-      The logcat output as a string or an empty string if logcat was not
-      being recorded at the time.
-    """
-    if not self.logcat_process:
-      return ''
-    # Cannot evaluate directly as 0 is a possible value.
-    # Better to read the self.logcat_process.stdout before killing it,
-    # Otherwise the communicate may return incomplete output due to pipe break.
-    if self.logcat_process.poll() is None:
-      self.logcat_process.kill()
-    self.logcat_process.wait()
-    self.logcat_process = None
-    self._logcat_tmpoutfile.seek(0)
-    output = self._logcat_tmpoutfile.read()
-    self._logcat_tmpoutfile.close()
-    self._logcat_tmpoutfile = None
-    return output
-
-  @staticmethod
-  def SearchLogcatRecord(record, message, thread_id=None, proc_id=None,
-                         log_level=None, component=None):
-    """Searches the specified logcat output and returns results.
-
-    This method searches through the logcat output specified by record for a
-    certain message, narrowing results by matching them against any other
-    specified criteria.  It returns all matching lines as described below.
-
-    Args:
-      record: A string generated by Start/StopRecordingLogcat to search.
-      message: An output string to search for.
-      thread_id: The thread id that is the origin of the message.
-      proc_id: The process that is the origin of the message.
-      log_level: The log level of the message.
-      component: The name of the component that would create the message.
-
-    Returns:
-      A list of dictionaries represeting matching entries, each containing keys
-      thread_id, proc_id, log_level, component, and message.
-    """
-    if thread_id:
-      thread_id = str(thread_id)
-    if proc_id:
-      proc_id = str(proc_id)
-    results = []
-    reg = re.compile('(\d+)\s+(\d+)\s+([A-Z])\s+([A-Za-z]+)\s*:(.*)$',
-                     re.MULTILINE)
-    log_list = reg.findall(record)
-    for (tid, pid, log_lev, comp, msg) in log_list:
-      if ((not thread_id or thread_id == tid) and
-          (not proc_id or proc_id == pid) and
-          (not log_level or log_level == log_lev) and
-          (not component or component == comp) and msg.find(message) > -1):
-        match = dict({'thread_id': tid, 'proc_id': pid,
-                      'log_level': log_lev, 'component': comp,
-                      'message': msg})
-        results.append(match)
-    return results
-
-  def ExtractPid(self, process_name):
-    """Extracts Process Ids for a given process name from Android Shell.
-
-    Args:
-      process_name: name of the process on the device.
-
-    Returns:
-      List of all the process ids (as strings) that match the given name.
-      If the name of a process exactly matches the given name, the pid of
-      that process will be inserted to the front of the pid list.
-    """
-    pids = []
-    for line in self.RunShellCommand('ps', log_result=False):
-      data = line.split()
-      try:
-        if process_name in data[-1]:  # name is in the last column
-          if process_name == data[-1]:
-            pids.insert(0, data[1])  # PID is in the second column
-          else:
-            pids.append(data[1])
-      except IndexError:
-        pass
-    return pids
-
-  def GetIoStats(self):
-    """Gets cumulative disk IO stats since boot (for all processes).
-
-    Returns:
-      Dict of {num_reads, num_writes, read_ms, write_ms} or None if there
-      was an error.
-    """
-    IoStats = collections.namedtuple(
-        'IoStats',
-        ['device',
-         'num_reads_issued',
-         'num_reads_merged',
-         'num_sectors_read',
-         'ms_spent_reading',
-         'num_writes_completed',
-         'num_writes_merged',
-         'num_sectors_written',
-         'ms_spent_writing',
-         'num_ios_in_progress',
-         'ms_spent_doing_io',
-         'ms_spent_doing_io_weighted',
-        ])
-
-    for line in self.GetFileContents('/proc/diskstats', log_result=False):
-      fields = line.split()
-      stats = IoStats._make([fields[2]] + [int(f) for f in fields[3:]])
-      if stats.device == 'mmcblk0':
-        return {
-            'num_reads': stats.num_reads_issued,
-            'num_writes': stats.num_writes_completed,
-            'read_ms': stats.ms_spent_reading,
-            'write_ms': stats.ms_spent_writing,
-        }
-    logging.warning('Could not find disk IO stats.')
-    return None
-
-  def GetMemoryUsageForPid(self, pid):
-    """Returns the memory usage for given pid.
-
-    Args:
-      pid: The pid number of the specific process running on device.
-
-    Returns:
-      Dict of {metric:usage_kb}, for the process which has specified pid.
-      The metric keys which may be included are: Size, Rss, Pss, Shared_Clean,
-      Shared_Dirty, Private_Clean, Private_Dirty, VmHWM.
-    """
-    showmap = self.RunShellCommand('showmap %d' % pid)
-    if not showmap or not showmap[-1].endswith('TOTAL'):
-      logging.warning('Invalid output for showmap %s', str(showmap))
-      return {}
-    items = showmap[-1].split()
-    if len(items) != 9:
-      logging.warning('Invalid TOTAL for showmap %s', str(items))
-      return {}
-    usage_dict = collections.defaultdict(int)
-    usage_dict.update({
-        'Size': int(items[0].strip()),
-        'Rss': int(items[1].strip()),
-        'Pss': int(items[2].strip()),
-        'Shared_Clean': int(items[3].strip()),
-        'Shared_Dirty': int(items[4].strip()),
-        'Private_Clean': int(items[5].strip()),
-        'Private_Dirty': int(items[6].strip()),
-    })
-    peak_value_kb = 0
-    for line in self.GetProtectedFileContents('/proc/%s/status' % pid):
-      if not line.startswith('VmHWM:'):  # Format: 'VmHWM: +[0-9]+ kB'
-        continue
-      peak_value_kb = int(line.split(':')[1].strip().split(' ')[0])
-      break
-    usage_dict['VmHWM'] = peak_value_kb
-    if not peak_value_kb:
-      logging.warning('Could not find memory peak value for pid ' + str(pid))
-
-    return usage_dict
-
-  def ProcessesUsingDevicePort(self, device_port):
-    """Lists processes using the specified device port on loopback interface.
-
-    Args:
-      device_port: Port on device we want to check.
-
-    Returns:
-      A list of (pid, process_name) tuples using the specified port.
-    """
-    tcp_results = self.RunShellCommand('cat /proc/net/tcp', log_result=False)
-    tcp_address = '0100007F:%04X' % device_port
-    pids = []
-    for single_connect in tcp_results:
-      connect_results = single_connect.split()
-      # Column 1 is the TCP port, and Column 9 is the inode of the socket
-      if connect_results[1] == tcp_address:
-        socket_inode = connect_results[9]
-        socket_name = 'socket:[%s]' % socket_inode
-        lsof_results = self.RunShellCommand('lsof', log_result=False)
-        for single_process in lsof_results:
-          process_results = single_process.split()
-          # Ignore the line if it has less than nine columns in it, which may
-          # be the case when a process stops while lsof is executing.
-          if len(process_results) <= 8:
-            continue
-          # Column 0 is the executable name
-          # Column 1 is the pid
-          # Column 8 is the Inode in use
-          if process_results[8] == socket_name:
-            pids.append((int(process_results[1]), process_results[0]))
-        break
-    logging.info('PidsUsingDevicePort: %s', pids)
-    return pids
-
-  def FileExistsOnDevice(self, file_name):
-    """Checks whether the given file exists on the device.
-
-    Args:
-      file_name: Full path of file to check.
-
-    Returns:
-      True if the file exists, False otherwise.
-    """
-    assert '"' not in file_name, 'file_name cannot contain double quotes'
-    try:
-      status = self._adb.SendShellCommand(
-          '\'test -e "%s"; echo $?\'' % (file_name))
-      if 'test: not found' not in status:
-        return int(status) == 0
-
-      status = self._adb.SendShellCommand(
-          '\'ls "%s" >/dev/null 2>&1; echo $?\'' % (file_name))
-      return int(status) == 0
-    except ValueError:
-      if IsDeviceAttached(self._device):
-        raise errors.DeviceUnresponsiveError('Device may be offline.')
-
-      return False
-
-  def IsFileWritableOnDevice(self, file_name):
-    """Checks whether the given file (or directory) is writable on the device.
-
-    Args:
-      file_name: Full path of file/directory to check.
-
-    Returns:
-      True if writable, False otherwise.
-    """
-    assert '"' not in file_name, 'file_name cannot contain double quotes'
-    try:
-      status = self._adb.SendShellCommand(
-          '\'test -w "%s"; echo $?\'' % (file_name))
-      if 'test: not found' not in status:
-        return int(status) == 0
-      raise errors.AbortError('"test" binary not found. OS too old.')
-
-    except ValueError:
-      if IsDeviceAttached(self._device):
-        raise errors.DeviceUnresponsiveError('Device may be offline.')
-
-      return False
-
-  @staticmethod
-  def GetTimestamp():
-    return time.strftime('%Y-%m-%d-%H%M%S', time.localtime())
-
-  @staticmethod
-  def EnsureHostDirectory(host_file):
-    host_dir = os.path.dirname(os.path.abspath(host_file))
-    if not os.path.exists(host_dir):
-      os.makedirs(host_dir)
-
-  def TakeScreenshot(self, host_file=None):
-    """Saves a screenshot image to |host_file| on the host.
-
-    Args:
-      host_file: Absolute path to the image file to store on the host or None to
-                 use an autogenerated file name.
-
-    Returns:
-      Resulting host file name of the screenshot.
-    """
-    host_file = os.path.abspath(host_file or
-                                'screenshot-%s.png' % self.GetTimestamp())
-    self.EnsureHostDirectory(host_file)
-    device_file = '%s/screenshot.png' % self.GetExternalStorage()
-    self.RunShellCommand(
-        '/system/bin/screencap -p %s' % device_file)
-    self.PullFileFromDevice(device_file, host_file)
-    self.RunShellCommand('rm -f "%s"' % device_file)
-    return host_file
-
-  def PullFileFromDevice(self, device_file, host_file):
-    """Download |device_file| on the device from to |host_file| on the host.
-
-    Args:
-      device_file: Absolute path to the file to retrieve from the device.
-      host_file: Absolute path to the file to store on the host.
-    """
-    if not self._adb.Pull(device_file, host_file):
-      raise device_errors.AdbCommandFailedError(
-          ['pull', device_file, host_file], 'Failed to pull file from device.')
-    assert os.path.exists(host_file)
-
-  def SetUtilWrapper(self, util_wrapper):
-    """Sets a wrapper prefix to be used when running a locally-built
-    binary on the device (ex.: md5sum_bin).
-    """
-    self._util_wrapper = util_wrapper
-
-  def RunUIAutomatorTest(self, test, test_package, timeout):
-    """Runs a single uiautomator test.
-
-    Args:
-      test: Test class/method.
-      test_package: Name of the test jar.
-      timeout: Timeout time in seconds.
-
-    Returns:
-      An instance of am_instrument_parser.TestResult object.
-    """
-    cmd = 'uiautomator runtest %s -e class %s' % (test_package, test)
-    self._LogShell(cmd)
-    output = self._adb.SendShellCommand(cmd, timeout_time=timeout)
-    # uiautomator doesn't fully conform to the instrumenation test runner
-    # convention and doesn't terminate with INSTRUMENTATION_CODE.
-    # Just assume the first result is valid.
-    (test_results, _) = am_instrument_parser.ParseAmInstrumentOutput(output)
-    if not test_results:
-      raise errors.InstrumentationError(
-          'no test results... device setup correctly?')
-    return test_results[0]
-
-  def DismissCrashDialogIfNeeded(self):
-    """Dismiss the error/ANR dialog if present.
-
-    Returns: Name of the crashed package if a dialog is focused,
-             None otherwise.
-    """
-    re_focus = re.compile(
-        r'\s*mCurrentFocus.*Application (Error|Not Responding): (\S+)}')
-
-    def _FindFocusedWindow():
-      match = None
-      for line in self.RunShellCommand('dumpsys window windows'):
-        match = re.match(re_focus, line)
-        if match:
-          break
-      return match
-
-    match = _FindFocusedWindow()
-    if not match:
-      return
-    package = match.group(2)
-    logging.warning('Trying to dismiss %s dialog for %s' % match.groups())
-    self.SendKeyEvent(KEYCODE_DPAD_RIGHT)
-    self.SendKeyEvent(KEYCODE_DPAD_RIGHT)
-    self.SendKeyEvent(KEYCODE_ENTER)
-    match = _FindFocusedWindow()
-    if match:
-      logging.error('Still showing a %s dialog for %s' % match.groups())
-    return package
-
-  def EfficientDeviceDirectoryCopy(self, source, dest):
-    """ Copy a directory efficiently on the device
-
-    Uses a shell script running on the target to copy new and changed files the
-    source directory to the destination directory and remove added files. This
-    is in some cases much faster than cp -r.
-
-    Args:
-      source: absolute path of source directory
-      dest: absolute path of destination directory
-    """
-    logging.info('In EfficientDeviceDirectoryCopy %s %s', source, dest)
-    with DeviceTempFile(self, suffix=".sh") as temp_script_file:
-      host_script_path = os.path.join(constants.DIR_SOURCE_ROOT,
-                                      'build',
-                                      'android',
-                                      'pylib',
-                                      'efficient_android_directory_copy.sh')
-      self._adb.Push(host_script_path, temp_script_file.name)
-      out = self.RunShellCommand(
-          'sh %s %s %s' % (temp_script_file.name, source, dest),
-          timeout_time=120)
-      if self._device:
-        device_repr = self._device[-4:]
-      else:
-        device_repr = '????'
-      for line in out:
-        logging.info('[%s]> %s', device_repr, line)
-
-  def _GetControlUsbChargingCommand(self):
-    if self._control_usb_charging_command['cached']:
-      return self._control_usb_charging_command['command']
-    self._control_usb_charging_command['cached'] = True
-    if not self.IsRootEnabled():
-      return None
-    for command in CONTROL_USB_CHARGING_COMMANDS:
-      # Assert command is valid.
-      assert 'disable_command' in command
-      assert 'enable_command' in command
-      assert 'witness_file' in command
-      witness_file = command['witness_file']
-      if self.FileExistsOnDevice(witness_file):
-        self._control_usb_charging_command['command'] = command
-        return command
-    return None
-
-  def CanControlUsbCharging(self):
-    return self._GetControlUsbChargingCommand() is not None
-
-  def DisableUsbCharging(self, timeout=10):
-    command = self._GetControlUsbChargingCommand()
-    if not command:
-      raise Exception('Unable to act on usb charging.')
-    disable_command = command['disable_command']
-    t0 = time.time()
-    # Do not loop directly on self.IsDeviceCharging to cut the number of calls
-    # to the device.
-    while True:
-      if t0 + timeout - time.time() < 0:
-        raise pexpect.TIMEOUT('Unable to disable USB charging in time: %s' % (
-            self.GetBatteryInfo()))
-      self.RunShellCommand(disable_command)
-      if not self.IsDeviceCharging():
-        break
-
-  def EnableUsbCharging(self, timeout=10):
-    command = self._GetControlUsbChargingCommand()
-    if not command:
-      raise Exception('Unable to act on usb charging.')
-    disable_command = command['enable_command']
-    t0 = time.time()
-    # Do not loop directly on self.IsDeviceCharging to cut the number of calls
-    # to the device.
-    while True:
-      if t0 + timeout - time.time() < 0:
-        raise pexpect.TIMEOUT('Unable to enable USB charging in time.')
-      self.RunShellCommand(disable_command)
-      if self.IsDeviceCharging():
-        break
-
-  def IsDeviceCharging(self):
-    for line in self.RunShellCommand('dumpsys battery'):
-      if 'powered: ' in line:
-        if line.split('powered: ')[1] == 'true':
-          return True
-
-
-class NewLineNormalizer(object):
-  """A file-like object to normalize EOLs to '\n'.
-
-  Pexpect runs adb within a pseudo-tty device (see
-  http://www.noah.org/wiki/pexpect), so any '\n' printed by adb is written
-  as '\r\n' to the logfile. Since adb already uses '\r\n' to terminate
-  lines, the log ends up having '\r\r\n' at the end of each line. This
-  filter replaces the above with a single '\n' in the data stream.
-  """
-  def __init__(self, output):
-    self._output = output
-
-  def write(self, data):
-    data = data.replace('\r\r\n', '\n')
-    self._output.write(data)
-
-  def flush(self):
-    self._output.flush()
diff --git a/build/android/pylib/android_commands_unittest.py b/build/android/pylib/android_commands_unittest.py
deleted file mode 100644
index 21c34f9..0000000
--- a/build/android/pylib/android_commands_unittest.py
+++ /dev/null
@@ -1,191 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import os
-import shutil
-import sys
-import unittest
-
-sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))
-
-from pylib import android_commands
-
-# pylint: disable=W0212,W0702
-
-class TestDeviceTempFile(unittest.TestCase):
-  def setUp(self):
-    if not os.getenv('BUILDTYPE'):
-      os.environ['BUILDTYPE'] = 'Debug'
-
-    devices = android_commands.GetAttachedDevices()
-    self.assertGreater(len(devices), 0, 'No device attached!')
-    self.ac = android_commands.AndroidCommands(device=devices[0])
-
-  def testTempFileDeleted(self):
-    """Tests that DeviceTempFile deletes files when closed."""
-    temp_file = android_commands.DeviceTempFile(self.ac)
-    self.assertFalse(self.ac.FileExistsOnDevice(temp_file.name))
-    self.ac.SetFileContents(temp_file.name, "contents")
-    self.assertTrue(self.ac.FileExistsOnDevice(temp_file.name))
-    temp_file.close()
-    self.assertFalse(self.ac.FileExistsOnDevice(temp_file.name))
-
-    with android_commands.DeviceTempFile(self.ac) as with_temp_file:
-      self.assertFalse(self.ac.FileExistsOnDevice(with_temp_file.name))
-      self.ac.SetFileContents(with_temp_file.name, "contents")
-      self.assertTrue(self.ac.FileExistsOnDevice(with_temp_file.name))
-
-    self.assertFalse(self.ac.FileExistsOnDevice(with_temp_file.name))
-
-  def testTempFileNotWritten(self):
-    """Tests that device temp files work successfully even if not written to."""
-    temp_file = android_commands.DeviceTempFile(self.ac)
-    temp_file.close()
-    self.assertFalse(self.ac.FileExistsOnDevice(temp_file.name))
-
-    with android_commands.DeviceTempFile(self.ac) as with_temp_file:
-      pass
-    self.assertFalse(self.ac.FileExistsOnDevice(with_temp_file.name))
-
-  def testNaming(self):
-    """Tests that returned filenames are as requested."""
-    temp_file = android_commands.DeviceTempFile(self.ac, prefix="cat")
-    self.assertTrue(os.path.basename(temp_file.name).startswith("cat"))
-
-    temp_file = android_commands.DeviceTempFile(self.ac, suffix="dog")
-    self.assertTrue(temp_file.name.endswith("dog"))
-
-    temp_file = android_commands.DeviceTempFile(
-        self.ac, prefix="cat", suffix="dog")
-    self.assertTrue(os.path.basename(temp_file.name).startswith("cat"))
-    self.assertTrue(temp_file.name.endswith("dog"))
-
-
-class TestGetFilesChanged(unittest.TestCase):
-
-  def setUp(self):
-    if not os.getenv('BUILDTYPE'):
-      os.environ['BUILDTYPE'] = 'Debug'
-
-    devices = android_commands.GetAttachedDevices()
-    self.assertGreater(len(devices), 0, 'No device attached!')
-    self.ac = android_commands.AndroidCommands(device=devices[0])
-    self.host_data_dir = os.path.realpath('test_push_data')
-    self.device_data_dir = '%s/test_push_data' % (
-        self.ac.RunShellCommand('realpath %s' %
-            self.ac.GetExternalStorage())[0])
-
-    os.mkdir(self.host_data_dir)
-    for i in xrange(1, 10):
-      with open('%s/%d.txt' % (self.host_data_dir, i), 'w') as f:
-        f.write('file #%d' % i)
-
-    self.ac.RunShellCommand('mkdir %s' % self.device_data_dir)
-
-  def testGetFilesChangedAllNeeded(self):
-    """ Tests GetFilesChanged when none of the files are on the device.
-    """
-    expected = [('%s/%d.txt' % (self.host_data_dir, i),
-                 '%s/%d.txt' % (self.device_data_dir, i))
-                for i in xrange(1, 10)]
-    actual = self.ac.GetFilesChanged(self.host_data_dir, self.device_data_dir)
-    self.assertSequenceEqual(expected, actual)
-
-  def testGetFilesChangedSomeIdentical(self):
-    """ Tests GetFilesChanged when some of the files are on the device.
-    """
-    for i in xrange(1, 5):
-      self.ac._adb.Push('%s/%d.txt' % (self.host_data_dir, i),
-                        self.device_data_dir)
-    expected = [('%s/%d.txt' % (self.host_data_dir, i),
-                 '%s/%d.txt' % (self.device_data_dir, i))
-                for i in xrange(5, 10)]
-    actual = self.ac.GetFilesChanged(self.host_data_dir, self.device_data_dir)
-    self.assertSequenceEqual(expected, actual)
-
-  def testGetFilesChangedAllIdentical(self):
-    """ Tests GetFilesChanged when all of the files are on the device.
-    """
-    for i in xrange(1, 10):
-      self.ac._adb.Push('%s/%d.txt' % (self.host_data_dir, i),
-                        self.device_data_dir)
-    expected = []
-    actual = self.ac.GetFilesChanged(self.host_data_dir, self.device_data_dir)
-    self.assertSequenceEqual(expected, actual)
-
-  def testGetFilesChangedRename(self):
-    """ Tests GetFilesChanged when one of the files has been renamed.
-
-        This tests both with and without the ignore_filenames flag set.
-    """
-    for i in xrange(5, 10):
-      self.ac._adb.Push('%s/%d.txt' % (self.host_data_dir, i),
-                        self.device_data_dir)
-    os.rename('%s/5.txt' % (self.host_data_dir),
-              '%s/99.txt' % (self.host_data_dir))
-
-    expected = [('%s/%d.txt' % (self.host_data_dir, i),
-                 '%s/%d.txt' % (self.device_data_dir, i))
-                for i in xrange(1, 5)]
-    actual = self.ac.GetFilesChanged(self.host_data_dir, self.device_data_dir,
-                                     ignore_filenames=True)
-    self.assertSequenceEqual(expected, actual)
-
-    expected.append(('%s/99.txt' % self.host_data_dir,
-                     '%s/99.txt' % self.device_data_dir))
-    actual = self.ac.GetFilesChanged(self.host_data_dir, self.device_data_dir)
-    self.assertSequenceEqual(expected, actual)
-
-  def testGetFilesChangedCopy(self):
-    """ Tests GetFilesChanged when one of the files has been copied.
-
-        This tests both with and without the ignore_filenames flag set.
-    """
-    for i in xrange(5, 10):
-      self.ac._adb.Push('%s/%d.txt' % (self.host_data_dir, i),
-                        self.device_data_dir)
-    shutil.copy('%s/5.txt' % self.host_data_dir,
-                '%s/99.txt' % self.host_data_dir)
-
-    expected = [('%s/%d.txt' % (self.host_data_dir, i),
-                 '%s/%d.txt' % (self.device_data_dir, i))
-                for i in xrange(1, 5)]
-    actual = self.ac.GetFilesChanged(self.host_data_dir, self.device_data_dir,
-                                     ignore_filenames=True)
-    self.assertSequenceEqual(expected, actual)
-
-    expected.append(('%s/99.txt' % self.host_data_dir,
-                     '%s/99.txt' % self.device_data_dir))
-    actual = self.ac.GetFilesChanged(self.host_data_dir, self.device_data_dir)
-    self.assertSequenceEqual(expected, actual)
-
-  def testGetFilesChangedIndividual(self):
-    """ Tests GetFilesChanged when provided one file.
-    """
-    expected = [('%s/1.txt' % self.host_data_dir,
-                 '%s/1.txt' % self.device_data_dir)]
-    actual = self.ac.GetFilesChanged('%s/1.txt' % self.host_data_dir,
-                                     '%s/1.txt' % self.device_data_dir)
-    self.assertSequenceEqual(expected, actual)
-
-  def testGetFilesChangedFileToDirectory(self):
-    """ Tests GetFilesChanged when provided a file from the host and a
-        directory on the device.
-    """
-    expected = [('%s/1.txt' % self.host_data_dir,
-                 '%s' % self.device_data_dir)]
-    actual = self.ac.GetFilesChanged('%s/1.txt' % self.host_data_dir,
-                                     '%s' % self.device_data_dir)
-    self.assertSequenceEqual(expected, actual)
-
-  def tearDown(self):
-    try:
-      shutil.rmtree(self.host_data_dir)
-      self.ac.RunShellCommand('rm -rf %s' % self.device_data_dir)
-    except:
-      pass
-
-if __name__ == '__main__':
-  unittest.main()
-
diff --git a/build/android/pylib/base/__init__.py b/build/android/pylib/base/__init__.py
deleted file mode 100644
index 727e987..0000000
--- a/build/android/pylib/base/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
diff --git a/build/android/pylib/base/base_setup.py b/build/android/pylib/base/base_setup.py
deleted file mode 100644
index a416380..0000000
--- a/build/android/pylib/base/base_setup.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright (c) 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Base script for doing test setup."""
-
-import logging
-import os
-
-from pylib import constants
-from pylib import valgrind_tools
-from pylib.utils import isolator
-
-def GenerateDepsDirUsingIsolate(suite_name, isolate_file_path,
-                                isolate_file_paths, deps_exclusion_list):
-  """Generate the dependency dir for the test suite using isolate.
-
-  Args:
-    suite_name: Name of the test suite (e.g. base_unittests).
-    isolate_file_path: .isolate file path to use. If there is a default .isolate
-                       file path for the suite_name, this will override it.
-    isolate_file_paths: Dictionary with the default .isolate file paths for
-                        the test suites.
-    deps_exclusion_list: A list of files that are listed as dependencies in the
-                         .isolate files but should not be pushed to the device.
-  Returns:
-    The Isolator instance used to remap the dependencies, or None.
-  """
-  if isolate_file_path:
-    if os.path.isabs(isolate_file_path):
-      isolate_abs_path = isolate_file_path
-    else:
-      isolate_abs_path = os.path.join(constants.DIR_SOURCE_ROOT,
-                                      isolate_file_path)
-  else:
-    isolate_rel_path = isolate_file_paths.get(suite_name)
-    if not isolate_rel_path:
-      logging.info('Did not find an isolate file for the test suite.')
-      return
-    isolate_abs_path = os.path.join(constants.DIR_SOURCE_ROOT, isolate_rel_path)
-
-  isolated_abs_path = os.path.join(
-      constants.GetOutDirectory(), '%s.isolated' % suite_name)
-  assert os.path.exists(isolate_abs_path), 'Cannot find %s' % isolate_abs_path
-
-  i = isolator.Isolator(constants.ISOLATE_DEPS_DIR)
-  i.Clear()
-  i.Remap(isolate_abs_path, isolated_abs_path)
-  # We're relying on the fact that timestamps are preserved
-  # by the remap command (hardlinked). Otherwise, all the data
-  # will be pushed to the device once we move to using time diff
-  # instead of md5sum. Perform a sanity check here.
-  i.VerifyHardlinks()
-  i.PurgeExcluded(deps_exclusion_list)
-  i.MoveOutputDeps()
-  return i
-
-
-def PushDataDeps(device, device_dir, test_options):
-  valgrind_tools.PushFilesForTool(test_options.tool, device)
-  if os.path.exists(constants.ISOLATE_DEPS_DIR):
-    device.PushChangedFiles([(constants.ISOLATE_DEPS_DIR, device_dir)],
-                            delete_device_stale=test_options.delete_stale_data)
diff --git a/build/android/pylib/base/base_test_result.py b/build/android/pylib/base/base_test_result.py
deleted file mode 100644
index 58200f6..0000000
--- a/build/android/pylib/base/base_test_result.py
+++ /dev/null
@@ -1,216 +0,0 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Module containing base test results classes."""
-
-class ResultType(object):
-  """Class enumerating test types."""
-  PASS = 'PASS'
-  SKIP = 'SKIP'
-  FAIL = 'FAIL'
-  CRASH = 'CRASH'
-  TIMEOUT = 'TIMEOUT'
-  UNKNOWN = 'UNKNOWN'
-
-  @staticmethod
-  def GetTypes():
-    """Get a list of all test types."""
-    return [ResultType.PASS, ResultType.SKIP, ResultType.FAIL,
-            ResultType.CRASH, ResultType.TIMEOUT, ResultType.UNKNOWN]
-
-
-class BaseTestResult(object):
-  """Base class for a single test result."""
-
-  def __init__(self, name, test_type, duration=0, log=''):
-    """Construct a BaseTestResult.
-
-    Args:
-      name: Name of the test which defines uniqueness.
-      test_type: Type of the test result as defined in ResultType.
-      duration: Time it took for the test to run in milliseconds.
-      log: An optional string listing any errors.
-    """
-    assert name
-    assert test_type in ResultType.GetTypes()
-    self._name = name
-    self._test_type = test_type
-    self._duration = duration
-    self._log = log
-
-  def __str__(self):
-    return self._name
-
-  def __repr__(self):
-    return self._name
-
-  def __cmp__(self, other):
-    # pylint: disable=W0212
-    return cmp(self._name, other._name)
-
-  def __hash__(self):
-    return hash(self._name)
-
-  def SetName(self, name):
-    """Set the test name.
-
-    Because we're putting this into a set, this should only be used if moving
-    this test result into another set.
-    """
-    self._name = name
-
-  def GetName(self):
-    """Get the test name."""
-    return self._name
-
-  def SetType(self, test_type):
-    """Set the test result type."""
-    assert test_type in ResultType.GetTypes()
-    self._test_type = test_type
-
-  def GetType(self):
-    """Get the test result type."""
-    return self._test_type
-
-  def GetDuration(self):
-    """Get the test duration."""
-    return self._duration
-
-  def SetLog(self, log):
-    """Set the test log."""
-    self._log = log
-
-  def GetLog(self):
-    """Get the test log."""
-    return self._log
-
-
-class TestRunResults(object):
-  """Set of results for a test run."""
-
-  def __init__(self):
-    self._results = set()
-
-  def GetLogs(self):
-    """Get the string representation of all test logs."""
-    s = []
-    for test_type in ResultType.GetTypes():
-      if test_type != ResultType.PASS:
-        for t in sorted(self._GetType(test_type)):
-          log = t.GetLog()
-          if log:
-            s.append('[%s] %s:' % (test_type, t))
-            s.append(log)
-    return '\n'.join(s)
-
-  def GetGtestForm(self):
-    """Get the gtest string representation of this object."""
-    s = []
-    plural = lambda n, s, p: '%d %s' % (n, p if n != 1 else s)
-    tests = lambda n: plural(n, 'test', 'tests')
-
-    s.append('[==========] %s ran.' % (tests(len(self.GetAll()))))
-    s.append('[  PASSED  ] %s.' % (tests(len(self.GetPass()))))
-
-    skipped = self.GetSkip()
-    if skipped:
-      s.append('[  SKIPPED ] Skipped %s, listed below:' % tests(len(skipped)))
-      for t in sorted(skipped):
-        s.append('[  SKIPPED ] %s' % str(t))
-
-    all_failures = self.GetFail().union(self.GetCrash(), self.GetTimeout(),
-        self.GetUnknown())
-    if all_failures:
-      s.append('[  FAILED  ] %s, listed below:' % tests(len(all_failures)))
-      for t in sorted(self.GetFail()):
-        s.append('[  FAILED  ] %s' % str(t))
-      for t in sorted(self.GetCrash()):
-        s.append('[  FAILED  ] %s (CRASHED)' % str(t))
-      for t in sorted(self.GetTimeout()):
-        s.append('[  FAILED  ] %s (TIMEOUT)' % str(t))
-      for t in sorted(self.GetUnknown()):
-        s.append('[  FAILED  ] %s (UNKNOWN)' % str(t))
-      s.append('')
-      s.append(plural(len(all_failures), 'FAILED TEST', 'FAILED TESTS'))
-    return '\n'.join(s)
-
-  def GetShortForm(self):
-    """Get the short string representation of this object."""
-    s = []
-    s.append('ALL: %d' % len(self._results))
-    for test_type in ResultType.GetTypes():
-      s.append('%s: %d' % (test_type, len(self._GetType(test_type))))
-    return ''.join([x.ljust(15) for x in s])
-
-  def __str__(self):
-    return self.GetLongForm()
-
-  def AddResult(self, result):
-    """Add |result| to the set.
-
-    Args:
-      result: An instance of BaseTestResult.
-    """
-    assert isinstance(result, BaseTestResult)
-    self._results.add(result)
-
-  def AddResults(self, results):
-    """Add |results| to the set.
-
-    Args:
-      results: An iterable of BaseTestResult objects.
-    """
-    for t in results:
-      self.AddResult(t)
-
-  def AddTestRunResults(self, results):
-    """Add the set of test results from |results|.
-
-    Args:
-      results: An instance of TestRunResults.
-    """
-    assert isinstance(results, TestRunResults)
-    # pylint: disable=W0212
-    self._results.update(results._results)
-
-  def GetAll(self):
-    """Get the set of all test results."""
-    return self._results.copy()
-
-  def _GetType(self, test_type):
-    """Get the set of test results with the given test type."""
-    return set(t for t in self._results if t.GetType() == test_type)
-
-  def GetPass(self):
-    """Get the set of all passed test results."""
-    return self._GetType(ResultType.PASS)
-
-  def GetSkip(self):
-    """Get the set of all skipped test results."""
-    return self._GetType(ResultType.SKIP)
-
-  def GetFail(self):
-    """Get the set of all failed test results."""
-    return self._GetType(ResultType.FAIL)
-
-  def GetCrash(self):
-    """Get the set of all crashed test results."""
-    return self._GetType(ResultType.CRASH)
-
-  def GetTimeout(self):
-    """Get the set of all timed out test results."""
-    return self._GetType(ResultType.TIMEOUT)
-
-  def GetUnknown(self):
-    """Get the set of all unknown test results."""
-    return self._GetType(ResultType.UNKNOWN)
-
-  def GetNotPass(self):
-    """Get the set of all non-passed test results."""
-    return self.GetAll() - self.GetPass()
-
-  def DidRunPass(self):
-    """Return whether the test run was successful."""
-    return not self.GetNotPass() - self.GetSkip()
-
diff --git a/build/android/pylib/base/base_test_result_unittest.py b/build/android/pylib/base/base_test_result_unittest.py
deleted file mode 100644
index 6f0cba7..0000000
--- a/build/android/pylib/base/base_test_result_unittest.py
+++ /dev/null
@@ -1,82 +0,0 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Unittests for TestRunResults."""
-
-import unittest
-
-from pylib.base.base_test_result import BaseTestResult
-from pylib.base.base_test_result import TestRunResults
-from pylib.base.base_test_result import ResultType
-
-
-class TestTestRunResults(unittest.TestCase):
-  def setUp(self):
-    self.p1 = BaseTestResult('p1', ResultType.PASS, log='pass1')
-    other_p1 = BaseTestResult('p1', ResultType.PASS)
-    self.p2 = BaseTestResult('p2', ResultType.PASS)
-    self.f1 = BaseTestResult('f1', ResultType.FAIL, log='failure1')
-    self.c1 = BaseTestResult('c1', ResultType.CRASH, log='crash1')
-    self.u1 = BaseTestResult('u1', ResultType.UNKNOWN)
-    self.tr = TestRunResults()
-    self.tr.AddResult(self.p1)
-    self.tr.AddResult(other_p1)
-    self.tr.AddResult(self.p2)
-    self.tr.AddResults(set([self.f1, self.c1, self.u1]))
-
-  def testGetAll(self):
-    self.assertFalse(
-        self.tr.GetAll().symmetric_difference(
-            [self.p1, self.p2, self.f1, self.c1, self.u1]))
-
-  def testGetPass(self):
-    self.assertFalse(self.tr.GetPass().symmetric_difference(
-        [self.p1, self.p2]))
-
-  def testGetNotPass(self):
-    self.assertFalse(self.tr.GetNotPass().symmetric_difference(
-        [self.f1, self.c1, self.u1]))
-
-  def testGetAddTestRunResults(self):
-    tr2 = TestRunResults()
-    other_p1 = BaseTestResult('p1', ResultType.PASS)
-    f2 = BaseTestResult('f2', ResultType.FAIL)
-    tr2.AddResult(other_p1)
-    tr2.AddResult(f2)
-    tr2.AddTestRunResults(self.tr)
-    self.assertFalse(
-        tr2.GetAll().symmetric_difference(
-            [self.p1, self.p2, self.f1, self.c1, self.u1, f2]))
-
-  def testGetLogs(self):
-    log_print = ('[FAIL] f1:\n'
-                 'failure1\n'
-                 '[CRASH] c1:\n'
-                 'crash1')
-    self.assertEqual(self.tr.GetLogs(), log_print)
-
-  def testGetShortForm(self):
-    short_print = ('ALL: 5         PASS: 2        FAIL: 1        '
-                   'CRASH: 1       TIMEOUT: 0     UNKNOWN: 1     ')
-    self.assertEqual(self.tr.GetShortForm(), short_print)
-
-  def testGetGtestForm(self):
-    gtest_print = ('[==========] 5 tests ran.\n'
-                   '[  PASSED  ] 2 tests.\n'
-                   '[  FAILED  ] 3 tests, listed below:\n'
-                   '[  FAILED  ] f1\n'
-                   '[  FAILED  ] c1 (CRASHED)\n'
-                   '[  FAILED  ] u1 (UNKNOWN)\n'
-                   '\n'
-                   '3 FAILED TESTS')
-    self.assertEqual(gtest_print, self.tr.GetGtestForm())
-
-  def testRunPassed(self):
-    self.assertFalse(self.tr.DidRunPass())
-    tr2 = TestRunResults()
-    self.assertTrue(tr2.DidRunPass())
-
-
-if __name__ == '__main__':
-  unittest.main()
diff --git a/build/android/pylib/base/base_test_runner.py b/build/android/pylib/base/base_test_runner.py
deleted file mode 100644
index 2a7fdd3..0000000
--- a/build/android/pylib/base/base_test_runner.py
+++ /dev/null
@@ -1,138 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Base class for running tests on a single device."""
-
-# TODO(jbudorick) Deprecate and remove this class and all subclasses after
-# any relevant parts have been ported to the new environment + test instance
-# model.
-
-import logging
-
-from pylib import ports
-from pylib.device import device_utils
-from pylib.forwarder import Forwarder
-from pylib.valgrind_tools import CreateTool
-# TODO(frankf): Move this to pylib/utils
-import lighttpd_server
-
-
-# A file on device to store ports of net test server. The format of the file is
-# test-spawner-server-port:test-server-port
-NET_TEST_SERVER_PORT_INFO_FILE = 'net-test-server-ports'
-
-
-class BaseTestRunner(object):
-  """Base class for running tests on a single device."""
-
-  def __init__(self, device, tool):
-    """
-      Args:
-        device: An instance of DeviceUtils that the tests will run on.
-        tool: Name of the Valgrind tool.
-    """
-    assert isinstance(device, device_utils.DeviceUtils)
-    self.device = device
-    self.device_serial = self.device.adb.GetDeviceSerial()
-    self.tool = CreateTool(tool, self.device)
-    self._http_server = None
-    self._forwarder_device_port = 8000
-    self.forwarder_base_url = ('http://localhost:%d' %
-        self._forwarder_device_port)
-    # We will allocate port for test server spawner when calling method
-    # LaunchChromeTestServerSpawner and allocate port for test server when
-    # starting it in TestServerThread.
-    self.test_server_spawner_port = 0
-    self.test_server_port = 0
-
-  def _PushTestServerPortInfoToDevice(self):
-    """Pushes the latest port information to device."""
-    self.device.WriteFile(
-        self.device.GetExternalStoragePath() + '/' +
-            NET_TEST_SERVER_PORT_INFO_FILE,
-        '%d:%d' % (self.test_server_spawner_port, self.test_server_port))
-
-  def RunTest(self, test):
-    """Runs a test. Needs to be overridden.
-
-    Args:
-      test: A test to run.
-
-    Returns:
-      Tuple containing:
-        (base_test_result.TestRunResults, tests to rerun or None)
-    """
-    raise NotImplementedError
-
-  def InstallTestPackage(self):
-    """Installs the test package once before all tests are run."""
-    pass
-
-  def SetUp(self):
-    """Run once before all tests are run."""
-    self.InstallTestPackage()
-
-  def TearDown(self):
-    """Run once after all tests are run."""
-    self.ShutdownHelperToolsForTestSuite()
-
-  def LaunchTestHttpServer(self, document_root, port=None,
-                           extra_config_contents=None):
-    """Launches an HTTP server to serve HTTP tests.
-
-    Args:
-      document_root: Document root of the HTTP server.
-      port: port on which we want to the http server bind.
-      extra_config_contents: Extra config contents for the HTTP server.
-    """
-    self._http_server = lighttpd_server.LighttpdServer(
-        document_root, port=port, extra_config_contents=extra_config_contents)
-    if self._http_server.StartupHttpServer():
-      logging.info('http server started: http://localhost:%s',
-                   self._http_server.port)
-    else:
-      logging.critical('Failed to start http server')
-    self._ForwardPortsForHttpServer()
-    return (self._forwarder_device_port, self._http_server.port)
-
-  def _ForwardPorts(self, port_pairs):
-    """Forwards a port."""
-    Forwarder.Map(port_pairs, self.device, self.tool)
-
-  def _UnmapPorts(self, port_pairs):
-    """Unmap previously forwarded ports."""
-    for (device_port, _) in port_pairs:
-      Forwarder.UnmapDevicePort(device_port, self.device)
-
-  # Deprecated: Use ForwardPorts instead.
-  def StartForwarder(self, port_pairs):
-    """Starts TCP traffic forwarding for the given |port_pairs|.
-
-    Args:
-      host_port_pairs: A list of (device_port, local_port) tuples to forward.
-    """
-    self._ForwardPorts(port_pairs)
-
-  def _ForwardPortsForHttpServer(self):
-    """Starts a forwarder for the HTTP server.
-
-    The forwarder forwards HTTP requests and responses between host and device.
-    """
-    self._ForwardPorts([(self._forwarder_device_port, self._http_server.port)])
-
-  def _RestartHttpServerForwarderIfNecessary(self):
-    """Restarts the forwarder if it's not open."""
-    # Checks to see if the http server port is being used.  If not forwards the
-    # request.
-    # TODO(dtrainor): This is not always reliable because sometimes the port
-    # will be left open even after the forwarder has been killed.
-    if not ports.IsDevicePortUsed(self.device, self._forwarder_device_port):
-      self._ForwardPortsForHttpServer()
-
-  def ShutdownHelperToolsForTestSuite(self):
-    """Shuts down the server and the forwarder."""
-    if self._http_server:
-      self._UnmapPorts([(self._forwarder_device_port, self._http_server.port)])
-      self._http_server.ShutdownHttpServer()
-
diff --git a/build/android/pylib/base/environment.py b/build/android/pylib/base/environment.py
deleted file mode 100644
index 3f49f41..0000000
--- a/build/android/pylib/base/environment.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-
-class Environment(object):
-  """An environment in which tests can be run.
-
-  This is expected to handle all logic that is applicable to an entire specific
-  environment but is independent of the test type.
-
-  Examples include:
-    - The local device environment, for running tests on devices attached to
-      the local machine.
-    - The local machine environment, for running tests directly on the local
-      machine.
-  """
-
-  def __init__(self):
-    pass
-
-  def SetUp(self):
-    raise NotImplementedError
-
-  def TearDown(self):
-    raise NotImplementedError
-
-  def __enter__(self):
-    self.SetUp()
-    return self
-
-  def __exit__(self, _exc_type, _exc_val, _exc_tb):
-    self.TearDown()
-
diff --git a/build/android/pylib/base/environment_factory.py b/build/android/pylib/base/environment_factory.py
deleted file mode 100644
index 31b4952..0000000
--- a/build/android/pylib/base/environment_factory.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from pylib import constants
-from pylib.local.device import local_device_environment
-from pylib.remote.device import remote_device_environment
-
-def CreateEnvironment(args, error_func):
-
-  if args.environment == 'local':
-    if args.command not in constants.LOCAL_MACHINE_TESTS:
-      return local_device_environment.LocalDeviceEnvironment(args, error_func)
-    # TODO(jbudorick) Add local machine environment.
-  if args.environment == 'remote_device':
-    return remote_device_environment.RemoteDeviceEnvironment(args,
-                                                             error_func)
-  error_func('Unable to create %s environment.' % args.environment)
diff --git a/build/android/pylib/base/test_collection.py b/build/android/pylib/base/test_collection.py
deleted file mode 100644
index de51027..0000000
--- a/build/android/pylib/base/test_collection.py
+++ /dev/null
@@ -1,80 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import threading
-
-class TestCollection(object):
-  """A threadsafe collection of tests.
-
-  Args:
-    tests: List of tests to put in the collection.
-  """
-
-  def __init__(self, tests=None):
-    if not tests:
-      tests = []
-    self._lock = threading.Lock()
-    self._tests = []
-    self._tests_in_progress = 0
-    # Used to signal that an item is available or all items have been handled.
-    self._item_available_or_all_done = threading.Event()
-    for t in tests:
-      self.add(t)
-
-  def _pop(self):
-    """Pop a test from the collection.
-
-    Waits until a test is available or all tests have been handled.
-
-    Returns:
-      A test or None if all tests have been handled.
-    """
-    while True:
-      # Wait for a test to be available or all tests to have been handled.
-      self._item_available_or_all_done.wait()
-      with self._lock:
-        # Check which of the two conditions triggered the signal.
-        if self._tests_in_progress == 0:
-          return None
-        try:
-          return self._tests.pop(0)
-        except IndexError:
-          # Another thread beat us to the available test, wait again.
-          self._item_available_or_all_done.clear()
-
-  def add(self, test):
-    """Add a test to the collection.
-
-    Args:
-      test: A test to add.
-    """
-    with self._lock:
-      self._tests.append(test)
-      self._item_available_or_all_done.set()
-      self._tests_in_progress += 1
-
-  def test_completed(self):
-    """Indicate that a test has been fully handled."""
-    with self._lock:
-      self._tests_in_progress -= 1
-      if self._tests_in_progress == 0:
-        # All tests have been handled, signal all waiting threads.
-        self._item_available_or_all_done.set()
-
-  def __iter__(self):
-    """Iterate through tests in the collection until all have been handled."""
-    while True:
-      r = self._pop()
-      if r is None:
-        break
-      yield r
-
-  def __len__(self):
-    """Return the number of tests currently in the collection."""
-    return len(self._tests)
-
-  def test_names(self):
-    """Return a list of the names of the tests currently in the collection."""
-    with self._lock:
-      return list(t.test for t in self._tests)
diff --git a/build/android/pylib/base/test_dispatcher.py b/build/android/pylib/base/test_dispatcher.py
deleted file mode 100644
index f919965..0000000
--- a/build/android/pylib/base/test_dispatcher.py
+++ /dev/null
@@ -1,332 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Dispatches tests, either sharding or replicating them.
-
-Performs the following steps:
-* Create a test collection factory, using the given tests
-  - If sharding: test collection factory returns the same shared test collection
-    to all test runners
-  - If replciating: test collection factory returns a unique test collection to
-    each test runner, with the same set of tests in each.
-* Create a test runner for each device.
-* Run each test runner in its own thread, grabbing tests from the test
-  collection until there are no tests left.
-"""
-
-# TODO(jbudorick) Deprecate and remove this class after any relevant parts have
-# been ported to the new environment / test instance model.
-
-import logging
-import threading
-
-from pylib import constants
-from pylib.base import base_test_result
-from pylib.base import test_collection
-from pylib.device import device_errors
-from pylib.utils import reraiser_thread
-from pylib.utils import watchdog_timer
-
-
-DEFAULT_TIMEOUT = 7 * 60  # seven minutes
-
-
-class _ThreadSafeCounter(object):
-  """A threadsafe counter."""
-
-  def __init__(self):
-    self._lock = threading.Lock()
-    self._value = 0
-
-  def GetAndIncrement(self):
-    """Get the current value and increment it atomically.
-
-    Returns:
-      The value before incrementing.
-    """
-    with self._lock:
-      pre_increment = self._value
-      self._value += 1
-      return pre_increment
-
-
-class _Test(object):
-  """Holds a test with additional metadata."""
-
-  def __init__(self, test, tries=0):
-    """Initializes the _Test object.
-
-    Args:
-      test: The test.
-      tries: Number of tries so far.
-    """
-    self.test = test
-    self.tries = tries
-
-
-def _RunTestsFromQueue(runner, collection, out_results, watcher,
-                       num_retries, tag_results_with_device=False):
-  """Runs tests from the collection until empty using the given runner.
-
-  Adds TestRunResults objects to the out_results list and may add tests to the
-  out_retry list.
-
-  Args:
-    runner: A TestRunner object used to run the tests.
-    collection: A TestCollection from which to get _Test objects to run.
-    out_results: A list to add TestRunResults to.
-    watcher: A watchdog_timer.WatchdogTimer object, used as a shared timeout.
-    num_retries: Number of retries for a test.
-    tag_results_with_device: If True, appends the name of the device on which
-        the test was run to the test name. Used when replicating to identify
-        which device ran each copy of the test, and to ensure each copy of the
-        test is recorded separately.
-  """
-
-  def TagTestRunResults(test_run_results):
-    """Tags all results with the last 4 digits of the device id.
-
-    Used when replicating tests to distinguish the same tests run on different
-    devices. We use a set to store test results, so the hash (generated from
-    name and tag) must be unique to be considered different results.
-    """
-    new_test_run_results = base_test_result.TestRunResults()
-    for test_result in test_run_results.GetAll():
-      test_result.SetName('%s_%s' % (runner.device_serial[-4:],
-                                     test_result.GetName()))
-      new_test_run_results.AddResult(test_result)
-    return new_test_run_results
-
-  for test in collection:
-    watcher.Reset()
-    try:
-      if not runner.device.IsOnline():
-        # Device is unresponsive, stop handling tests on this device.
-        msg = 'Device %s is unresponsive.' % runner.device_serial
-        logging.warning(msg)
-        raise device_errors.DeviceUnreachableError(msg)
-      result, retry = runner.RunTest(test.test)
-      if tag_results_with_device:
-        result = TagTestRunResults(result)
-      test.tries += 1
-      if retry and test.tries <= num_retries:
-        # Retry non-passing results, only record passing results.
-        pass_results = base_test_result.TestRunResults()
-        pass_results.AddResults(result.GetPass())
-        out_results.append(pass_results)
-        logging.warning('Will retry test %s, try #%s.', retry, test.tries)
-        collection.add(_Test(test=retry, tries=test.tries))
-      else:
-        # All tests passed or retry limit reached. Either way, record results.
-        out_results.append(result)
-    except:
-      # An unhandleable exception, ensure tests get run by another device and
-      # reraise this exception on the main thread.
-      collection.add(test)
-      raise
-    finally:
-      # Retries count as separate tasks so always mark the popped test as done.
-      collection.test_completed()
-
-
-def _SetUp(runner_factory, device, out_runners, threadsafe_counter):
-  """Creates a test runner for each device and calls SetUp() in parallel.
-
-  Note: if a device is unresponsive the corresponding TestRunner will not be
-    added to out_runners.
-
-  Args:
-    runner_factory: Callable that takes a device and index and returns a
-      TestRunner object.
-    device: The device serial number to set up.
-    out_runners: List to add the successfully set up TestRunner object.
-    threadsafe_counter: A _ThreadSafeCounter object used to get shard indices.
-  """
-  try:
-    index = threadsafe_counter.GetAndIncrement()
-    logging.warning('Creating shard %s for device %s.', index, device)
-    runner = runner_factory(device, index)
-    runner.SetUp()
-    out_runners.append(runner)
-  except device_errors.DeviceUnreachableError as e:
-    logging.warning('Failed to create shard for %s: [%s]', device, e)
-
-
-def _RunAllTests(runners, test_collection_factory, num_retries, timeout=None,
-                 tag_results_with_device=False):
-  """Run all tests using the given TestRunners.
-
-  Args:
-    runners: A list of TestRunner objects.
-    test_collection_factory: A callable to generate a TestCollection object for
-        each test runner.
-    num_retries: Number of retries for a test.
-    timeout: Watchdog timeout in seconds.
-    tag_results_with_device: If True, appends the name of the device on which
-        the test was run to the test name. Used when replicating to identify
-        which device ran each copy of the test, and to ensure each copy of the
-        test is recorded separately.
-
-  Returns:
-    A tuple of (TestRunResults object, exit code)
-  """
-  logging.warning('Running tests with %s test runners.' % (len(runners)))
-  results = []
-  exit_code = 0
-  run_results = base_test_result.TestRunResults()
-  watcher = watchdog_timer.WatchdogTimer(timeout)
-  test_collections = [test_collection_factory() for _ in runners]
-
-  threads = [
-      reraiser_thread.ReraiserThread(
-          _RunTestsFromQueue,
-          [r, tc, results, watcher, num_retries, tag_results_with_device],
-          name=r.device_serial[-4:])
-      for r, tc in zip(runners, test_collections)]
-
-  workers = reraiser_thread.ReraiserThreadGroup(threads)
-  workers.StartAll()
-
-  # Catch DeviceUnreachableErrors and set a warning exit code
-  try:
-    workers.JoinAll(watcher)
-  except device_errors.DeviceUnreachableError as e:
-    logging.error(e)
-
-  if not all((len(tc) == 0 for tc in test_collections)):
-    logging.error('Only ran %d tests (all devices are likely offline).' %
-                  len(results))
-    for tc in test_collections:
-      run_results.AddResults(base_test_result.BaseTestResult(
-          t, base_test_result.ResultType.UNKNOWN) for t in tc.test_names())
-
-  for r in results:
-    run_results.AddTestRunResults(r)
-  if not run_results.DidRunPass():
-    exit_code = constants.ERROR_EXIT_CODE
-  return (run_results, exit_code)
-
-
-def _CreateRunners(runner_factory, devices, timeout=None):
-  """Creates a test runner for each device and calls SetUp() in parallel.
-
-  Note: if a device is unresponsive the corresponding TestRunner will not be
-    included in the returned list.
-
-  Args:
-    runner_factory: Callable that takes a device and index and returns a
-      TestRunner object.
-    devices: List of device serial numbers as strings.
-    timeout: Watchdog timeout in seconds, defaults to the default timeout.
-
-  Returns:
-    A list of TestRunner objects.
-  """
-  logging.warning('Creating %s test runners.' % len(devices))
-  runners = []
-  counter = _ThreadSafeCounter()
-  threads = reraiser_thread.ReraiserThreadGroup(
-      [reraiser_thread.ReraiserThread(_SetUp,
-                                      [runner_factory, d, runners, counter],
-                                      name=str(d)[-4:])
-       for d in devices])
-  threads.StartAll()
-  threads.JoinAll(watchdog_timer.WatchdogTimer(timeout))
-  return runners
-
-
-def _TearDownRunners(runners, timeout=None):
-  """Calls TearDown() for each test runner in parallel.
-
-  Args:
-    runners: A list of TestRunner objects.
-    timeout: Watchdog timeout in seconds, defaults to the default timeout.
-  """
-  threads = reraiser_thread.ReraiserThreadGroup(
-      [reraiser_thread.ReraiserThread(r.TearDown, name=r.device_serial[-4:])
-       for r in runners])
-  threads.StartAll()
-  threads.JoinAll(watchdog_timer.WatchdogTimer(timeout))
-
-
-def ApplyMaxPerRun(tests, max_per_run):
-  """Rearrange the tests so that no group contains more than max_per_run tests.
-
-  Args:
-    tests:
-    max_per_run:
-
-  Returns:
-    A list of tests with no more than max_per_run per run.
-  """
-  tests_expanded = []
-  for test_group in tests:
-    if type(test_group) != str:
-      # Do not split test objects which are not strings.
-      tests_expanded.append(test_group)
-    else:
-      test_split = test_group.split(':')
-      for i in range(0, len(test_split), max_per_run):
-        tests_expanded.append(':'.join(test_split[i:i+max_per_run]))
-  return tests_expanded
-
-
-def RunTests(tests, runner_factory, devices, shard=True,
-             test_timeout=DEFAULT_TIMEOUT, setup_timeout=DEFAULT_TIMEOUT,
-             num_retries=2, max_per_run=256):
-  """Run all tests on attached devices, retrying tests that don't pass.
-
-  Args:
-    tests: List of tests to run.
-    runner_factory: Callable that takes a device and index and returns a
-        TestRunner object.
-    devices: List of attached devices.
-    shard: True if we should shard, False if we should replicate tests.
-      - Sharding tests will distribute tests across all test runners through a
-        shared test collection.
-      - Replicating tests will copy all tests to each test runner through a
-        unique test collection for each test runner.
-    test_timeout: Watchdog timeout in seconds for running tests.
-    setup_timeout: Watchdog timeout in seconds for creating and cleaning up
-        test runners.
-    num_retries: Number of retries for a test.
-    max_per_run: Maximum number of tests to run in any group.
-
-  Returns:
-    A tuple of (base_test_result.TestRunResults object, exit code).
-  """
-  if not tests:
-    logging.critical('No tests to run.')
-    return (base_test_result.TestRunResults(), constants.ERROR_EXIT_CODE)
-
-  tests_expanded = ApplyMaxPerRun(tests, max_per_run)
-  if shard:
-    # Generate a shared TestCollection object for all test runners, so they
-    # draw from a common pool of tests.
-    shared_test_collection = test_collection.TestCollection(
-        [_Test(t) for t in tests_expanded])
-    test_collection_factory = lambda: shared_test_collection
-    tag_results_with_device = False
-    log_string = 'sharded across devices'
-  else:
-    # Generate a unique TestCollection object for each test runner, but use
-    # the same set of tests.
-    test_collection_factory = lambda: test_collection.TestCollection(
-        [_Test(t) for t in tests_expanded])
-    tag_results_with_device = True
-    log_string = 'replicated on each device'
-
-  logging.info('Will run %d tests (%s): %s',
-               len(tests_expanded), log_string, str(tests_expanded))
-  runners = _CreateRunners(runner_factory, devices, setup_timeout)
-  try:
-    return _RunAllTests(runners, test_collection_factory,
-                        num_retries, test_timeout, tag_results_with_device)
-  finally:
-    try:
-      _TearDownRunners(runners, setup_timeout)
-    except device_errors.DeviceUnreachableError as e:
-      logging.warning('Device unresponsive during TearDown: [%s]', e)
-    except Exception as e:
-      logging.error('Unexpected exception caught during TearDown: %s' % str(e))
diff --git a/build/android/pylib/base/test_dispatcher_unittest.py b/build/android/pylib/base/test_dispatcher_unittest.py
deleted file mode 100755
index cace9a6..0000000
--- a/build/android/pylib/base/test_dispatcher_unittest.py
+++ /dev/null
@@ -1,241 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Unittests for test_dispatcher.py."""
-# pylint: disable=R0201
-# pylint: disable=W0212
-
-import os
-import sys
-import unittest
-
-
-from pylib import constants
-from pylib.base import base_test_result
-from pylib.base import test_collection
-from pylib.base import test_dispatcher
-from pylib.device import adb_wrapper
-from pylib.device import device_utils
-from pylib.utils import watchdog_timer
-
-sys.path.append(
-    os.path.join(constants.DIR_SOURCE_ROOT, 'third_party', 'pymock'))
-import mock
-
-
-class TestException(Exception):
-  pass
-
-
-def _MockDevice(serial):
-  d = mock.MagicMock(spec=device_utils.DeviceUtils)
-  d.__str__.return_value = serial
-  d.adb = mock.MagicMock(spec=adb_wrapper.AdbWrapper)
-  d.adb.GetDeviceSerial = mock.MagicMock(return_value=serial)
-  d.IsOnline = mock.MagicMock(return_value=True)
-  return d
-
-
-class MockRunner(object):
-  """A mock TestRunner."""
-  def __init__(self, device=None, shard_index=0):
-    self.device = device or _MockDevice('0')
-    self.device_serial = self.device.adb.GetDeviceSerial()
-    self.shard_index = shard_index
-    self.setups = 0
-    self.teardowns = 0
-
-  def RunTest(self, test):
-    results = base_test_result.TestRunResults()
-    results.AddResult(
-        base_test_result.BaseTestResult(test, base_test_result.ResultType.PASS))
-    return (results, None)
-
-  def SetUp(self):
-    self.setups += 1
-
-  def TearDown(self):
-    self.teardowns += 1
-
-
-class MockRunnerFail(MockRunner):
-  def RunTest(self, test):
-    results = base_test_result.TestRunResults()
-    results.AddResult(
-        base_test_result.BaseTestResult(test, base_test_result.ResultType.FAIL))
-    return (results, test)
-
-
-class MockRunnerFailTwice(MockRunner):
-  def __init__(self, device=None, shard_index=0):
-    super(MockRunnerFailTwice, self).__init__(device, shard_index)
-    self._fails = 0
-
-  def RunTest(self, test):
-    self._fails += 1
-    results = base_test_result.TestRunResults()
-    if self._fails <= 2:
-      results.AddResult(base_test_result.BaseTestResult(
-          test, base_test_result.ResultType.FAIL))
-      return (results, test)
-    else:
-      results.AddResult(base_test_result.BaseTestResult(
-          test, base_test_result.ResultType.PASS))
-      return (results, None)
-
-
-class MockRunnerException(MockRunner):
-  def RunTest(self, test):
-    raise TestException
-
-
-class TestFunctions(unittest.TestCase):
-  """Tests test_dispatcher._RunTestsFromQueue."""
-  @staticmethod
-  def _RunTests(mock_runner, tests):
-    results = []
-    tests = test_collection.TestCollection(
-        [test_dispatcher._Test(t) for t in tests])
-    test_dispatcher._RunTestsFromQueue(mock_runner, tests, results,
-                                       watchdog_timer.WatchdogTimer(None), 2)
-    run_results = base_test_result.TestRunResults()
-    for r in results:
-      run_results.AddTestRunResults(r)
-    return run_results
-
-  def testRunTestsFromQueue(self):
-    results = TestFunctions._RunTests(MockRunner(), ['a', 'b'])
-    self.assertEqual(len(results.GetPass()), 2)
-    self.assertEqual(len(results.GetNotPass()), 0)
-
-  def testRunTestsFromQueueRetry(self):
-    results = TestFunctions._RunTests(MockRunnerFail(), ['a', 'b'])
-    self.assertEqual(len(results.GetPass()), 0)
-    self.assertEqual(len(results.GetFail()), 2)
-
-  def testRunTestsFromQueueFailTwice(self):
-    results = TestFunctions._RunTests(MockRunnerFailTwice(), ['a', 'b'])
-    self.assertEqual(len(results.GetPass()), 2)
-    self.assertEqual(len(results.GetNotPass()), 0)
-
-  def testSetUp(self):
-    runners = []
-    counter = test_dispatcher._ThreadSafeCounter()
-    test_dispatcher._SetUp(MockRunner, _MockDevice('0'), runners, counter)
-    self.assertEqual(len(runners), 1)
-    self.assertEqual(runners[0].setups, 1)
-
-  def testThreadSafeCounter(self):
-    counter = test_dispatcher._ThreadSafeCounter()
-    for i in xrange(5):
-      self.assertEqual(counter.GetAndIncrement(), i)
-
-  def testApplyMaxPerRun(self):
-    self.assertEqual(
-        ['A:B', 'C:D', 'E', 'F:G', 'H:I'],
-        test_dispatcher.ApplyMaxPerRun(['A:B', 'C:D:E', 'F:G:H:I'], 2))
-
-
-class TestThreadGroupFunctions(unittest.TestCase):
-  """Tests test_dispatcher._RunAllTests and test_dispatcher._CreateRunners."""
-  def setUp(self):
-    self.tests = ['a', 'b', 'c', 'd', 'e', 'f', 'g']
-    shared_test_collection = test_collection.TestCollection(
-        [test_dispatcher._Test(t) for t in self.tests])
-    self.test_collection_factory = lambda: shared_test_collection
-
-  def testCreate(self):
-    runners = test_dispatcher._CreateRunners(
-        MockRunner, [_MockDevice('0'), _MockDevice('1')])
-    for runner in runners:
-      self.assertEqual(runner.setups, 1)
-    self.assertEqual(set([r.device_serial for r in runners]),
-                     set(['0', '1']))
-    self.assertEqual(set([r.shard_index for r in runners]),
-                     set([0, 1]))
-
-  def testRun(self):
-    runners = [MockRunner(_MockDevice('0')), MockRunner(_MockDevice('1'))]
-    results, exit_code = test_dispatcher._RunAllTests(
-        runners, self.test_collection_factory, 0)
-    self.assertEqual(len(results.GetPass()), len(self.tests))
-    self.assertEqual(exit_code, 0)
-
-  def testTearDown(self):
-    runners = [MockRunner(_MockDevice('0')), MockRunner(_MockDevice('1'))]
-    test_dispatcher._TearDownRunners(runners)
-    for runner in runners:
-      self.assertEqual(runner.teardowns, 1)
-
-  def testRetry(self):
-    runners = test_dispatcher._CreateRunners(
-        MockRunnerFail, [_MockDevice('0'), _MockDevice('1')])
-    results, exit_code = test_dispatcher._RunAllTests(
-        runners, self.test_collection_factory, 0)
-    self.assertEqual(len(results.GetFail()), len(self.tests))
-    self.assertEqual(exit_code, constants.ERROR_EXIT_CODE)
-
-  def testReraise(self):
-    runners = test_dispatcher._CreateRunners(
-        MockRunnerException, [_MockDevice('0'), _MockDevice('1')])
-    with self.assertRaises(TestException):
-      test_dispatcher._RunAllTests(runners, self.test_collection_factory, 0)
-
-
-class TestShard(unittest.TestCase):
-  """Tests test_dispatcher.RunTests with sharding."""
-  @staticmethod
-  def _RunShard(runner_factory):
-    return test_dispatcher.RunTests(
-        ['a', 'b', 'c'], runner_factory, [_MockDevice('0'), _MockDevice('1')],
-        shard=True)
-
-  def testShard(self):
-    results, exit_code = TestShard._RunShard(MockRunner)
-    self.assertEqual(len(results.GetPass()), 3)
-    self.assertEqual(exit_code, 0)
-
-  def testFailing(self):
-    results, exit_code = TestShard._RunShard(MockRunnerFail)
-    self.assertEqual(len(results.GetPass()), 0)
-    self.assertEqual(len(results.GetFail()), 3)
-    self.assertEqual(exit_code, constants.ERROR_EXIT_CODE)
-
-  def testNoTests(self):
-    results, exit_code = test_dispatcher.RunTests(
-        [], MockRunner, [_MockDevice('0'), _MockDevice('1')], shard=True)
-    self.assertEqual(len(results.GetAll()), 0)
-    self.assertEqual(exit_code, constants.ERROR_EXIT_CODE)
-
-
-class TestReplicate(unittest.TestCase):
-  """Tests test_dispatcher.RunTests with replication."""
-  @staticmethod
-  def _RunReplicate(runner_factory):
-    return test_dispatcher.RunTests(
-        ['a', 'b', 'c'], runner_factory, [_MockDevice('0'), _MockDevice('1')],
-        shard=False)
-
-  def testReplicate(self):
-    results, exit_code = TestReplicate._RunReplicate(MockRunner)
-    # We expect 6 results since each test should have been run on every device
-    self.assertEqual(len(results.GetPass()), 6)
-    self.assertEqual(exit_code, 0)
-
-  def testFailing(self):
-    results, exit_code = TestReplicate._RunReplicate(MockRunnerFail)
-    self.assertEqual(len(results.GetPass()), 0)
-    self.assertEqual(len(results.GetFail()), 6)
-    self.assertEqual(exit_code, constants.ERROR_EXIT_CODE)
-
-  def testNoTests(self):
-    results, exit_code = test_dispatcher.RunTests(
-        [], MockRunner, [_MockDevice('0'), _MockDevice('1')], shard=False)
-    self.assertEqual(len(results.GetAll()), 0)
-    self.assertEqual(exit_code, constants.ERROR_EXIT_CODE)
-
-
-if __name__ == '__main__':
-  unittest.main()
diff --git a/build/android/pylib/base/test_instance.py b/build/android/pylib/base/test_instance.py
deleted file mode 100644
index cdf678f..0000000
--- a/build/android/pylib/base/test_instance.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-
-class TestInstance(object):
-  """A type of test.
-
-  This is expected to handle all logic that is test-type specific but
-  independent of the environment or device.
-
-  Examples include:
-    - gtests
-    - instrumentation tests
-  """
-
-  def __init__(self):
-    pass
-
-  def TestType(self):
-    raise NotImplementedError
-
-  def SetUp(self):
-    raise NotImplementedError
-
-  def TearDown(self):
-    raise NotImplementedError
-
-  def __enter__(self):
-    self.SetUp()
-    return self
-
-  def __exit__(self, _exc_type, _exc_val, _exc_tb):
-    self.TearDown()
-
diff --git a/build/android/pylib/base/test_instance_factory.py b/build/android/pylib/base/test_instance_factory.py
deleted file mode 100644
index 7e7cb0c..0000000
--- a/build/android/pylib/base/test_instance_factory.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from pylib import constants
-from pylib.gtest import gtest_test_instance
-from pylib.instrumentation import instrumentation_test_instance
-from pylib.utils import isolator
-from pylib.uirobot import uirobot_test_instance
-
-
-
-def CreateTestInstance(args, error_func):
-
-  if args.command == 'gtest':
-    return gtest_test_instance.GtestTestInstance(
-        args, isolator.Isolator(constants.ISOLATE_DEPS_DIR), error_func)
-  elif args.command == 'instrumentation':
-    return instrumentation_test_instance.InstrumentationTestInstance(
-        args, isolator.Isolator(constants.ISOLATE_DEPS_DIR), error_func)
-  elif args.command == 'uirobot':
-    return uirobot_test_instance.UirobotTestInstance(args, error_func)
-
-  error_func('Unable to create %s test instance.' % args.command)
diff --git a/build/android/pylib/base/test_run.py b/build/android/pylib/base/test_run.py
deleted file mode 100644
index 7380e78..0000000
--- a/build/android/pylib/base/test_run.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-
-class TestRun(object):
-  """An execution of a particular test on a particular device.
-
-  This is expected to handle all logic that is specific to the combination of
-  environment and test type.
-
-  Examples include:
-    - local gtests
-    - local instrumentation tests
-  """
-
-  def __init__(self, env, test_instance):
-    self._env = env
-    self._test_instance = test_instance
-
-  def TestPackage(self):
-    raise NotImplementedError
-
-  def SetUp(self):
-    raise NotImplementedError
-
-  def RunTests(self):
-    raise NotImplementedError
-
-  def TearDown(self):
-    raise NotImplementedError
-
-  def __enter__(self):
-    self.SetUp()
-    return self
-
-  def __exit__(self, exc_type, exc_val, exc_tb):
-    self.TearDown()
-
diff --git a/build/android/pylib/base/test_run_factory.py b/build/android/pylib/base/test_run_factory.py
deleted file mode 100644
index 8c71ebbd..0000000
--- a/build/android/pylib/base/test_run_factory.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from pylib.gtest import gtest_test_instance
-from pylib.gtest import local_device_gtest_run
-from pylib.instrumentation import instrumentation_test_instance
-from pylib.local.device import local_device_environment
-from pylib.local.device import local_device_instrumentation_test_run
-from pylib.remote.device import remote_device_environment
-from pylib.remote.device import remote_device_gtest_run
-from pylib.remote.device import remote_device_instrumentation_test_run
-from pylib.remote.device import remote_device_uirobot_test_run
-from pylib.uirobot import uirobot_test_instance
-
-
-def CreateTestRun(_args, env, test_instance, error_func):
-  if isinstance(env, local_device_environment.LocalDeviceEnvironment):
-    if isinstance(test_instance, gtest_test_instance.GtestTestInstance):
-      return local_device_gtest_run.LocalDeviceGtestRun(env, test_instance)
-    if isinstance(test_instance,
-                  instrumentation_test_instance.InstrumentationTestInstance):
-      return (local_device_instrumentation_test_run
-              .LocalDeviceInstrumentationTestRun(env, test_instance))
-
-  if isinstance(env, remote_device_environment.RemoteDeviceEnvironment):
-    if isinstance(test_instance, gtest_test_instance.GtestTestInstance):
-      return remote_device_gtest_run.RemoteDeviceGtestTestRun(
-          env, test_instance)
-    if isinstance(test_instance,
-                  instrumentation_test_instance.InstrumentationTestInstance):
-      return (remote_device_instrumentation_test_run
-              .RemoteDeviceInstrumentationTestRun(env, test_instance))
-    if isinstance(test_instance, uirobot_test_instance.UirobotTestInstance):
-      return remote_device_uirobot_test_run.RemoteDeviceUirobotTestRun(
-          env, test_instance)
-
-
-  error_func('Unable to create test run for %s tests in %s environment'
-             % (str(test_instance), str(env)))
-
diff --git a/build/android/pylib/base/test_server.py b/build/android/pylib/base/test_server.py
deleted file mode 100644
index 085a51e..0000000
--- a/build/android/pylib/base/test_server.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-class TestServer(object):
-  """Base class for any server that needs to be set up for the tests."""
-
-  def __init__(self, *args, **kwargs):
-    pass
-
-  def SetUp(self):
-    raise NotImplementedError
-
-  def Reset(self):
-    raise NotImplementedError
-
-  def TearDown(self):
-    raise NotImplementedError
-
diff --git a/build/android/pylib/chrome_test_server_spawner.py b/build/android/pylib/chrome_test_server_spawner.py
deleted file mode 100644
index 052c2fd..0000000
--- a/build/android/pylib/chrome_test_server_spawner.py
+++ /dev/null
@@ -1,422 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""A "Test Server Spawner" that handles killing/stopping per-test test servers.
-
-It's used to accept requests from the device to spawn and kill instances of the
-chrome test server on the host.
-"""
-# pylint: disable=W0702
-
-import BaseHTTPServer
-import json
-import logging
-import os
-import select
-import struct
-import subprocess
-import sys
-import threading
-import time
-import urlparse
-
-from pylib import constants
-from pylib import ports
-
-from pylib.forwarder import Forwarder
-
-
-# Path that are needed to import necessary modules when launching a testserver.
-os.environ['PYTHONPATH'] = os.environ.get('PYTHONPATH', '') + (':%s:%s:%s:%s:%s'
-    % (os.path.join(constants.DIR_SOURCE_ROOT, 'third_party'),
-       os.path.join(constants.DIR_SOURCE_ROOT, 'third_party', 'tlslite'),
-       os.path.join(constants.DIR_SOURCE_ROOT, 'third_party', 'pyftpdlib',
-                    'src'),
-       os.path.join(constants.DIR_SOURCE_ROOT, 'net', 'tools', 'testserver'),
-       os.path.join(constants.DIR_SOURCE_ROOT, 'sync', 'tools', 'testserver')))
-
-
-SERVER_TYPES = {
-    'http': '',
-    'ftp': '-f',
-    'sync': '',  # Sync uses its own script, and doesn't take a server type arg.
-    'tcpecho': '--tcp-echo',
-    'udpecho': '--udp-echo',
-}
-
-
-# The timeout (in seconds) of starting up the Python test server.
-TEST_SERVER_STARTUP_TIMEOUT = 10
-
-def _WaitUntil(predicate, max_attempts=5):
-  """Blocks until the provided predicate (function) is true.
-
-  Returns:
-    Whether the provided predicate was satisfied once (before the timeout).
-  """
-  sleep_time_sec = 0.025
-  for _ in xrange(1, max_attempts):
-    if predicate():
-      return True
-    time.sleep(sleep_time_sec)
-    sleep_time_sec = min(1, sleep_time_sec * 2)  # Don't wait more than 1 sec.
-  return False
-
-
-def _CheckPortAvailable(port):
-  """Returns True if |port| is available."""
-  return _WaitUntil(lambda: ports.IsHostPortAvailable(port))
-
-
-def _CheckPortNotAvailable(port):
-  """Returns True if |port| is not available."""
-  return _WaitUntil(lambda: not ports.IsHostPortAvailable(port))
-
-
-def _CheckDevicePortStatus(device, port):
-  """Returns whether the provided port is used."""
-  return _WaitUntil(lambda: ports.IsDevicePortUsed(device, port))
-
-
-def _GetServerTypeCommandLine(server_type):
-  """Returns the command-line by the given server type.
-
-  Args:
-    server_type: the server type to be used (e.g. 'http').
-
-  Returns:
-    A string containing the command-line argument.
-  """
-  if server_type not in SERVER_TYPES:
-    raise NotImplementedError('Unknown server type: %s' % server_type)
-  if server_type == 'udpecho':
-    raise Exception('Please do not run UDP echo tests because we do not have '
-                    'a UDP forwarder tool.')
-  return SERVER_TYPES[server_type]
-
-
-class TestServerThread(threading.Thread):
-  """A thread to run the test server in a separate process."""
-
-  def __init__(self, ready_event, arguments, device, tool):
-    """Initialize TestServerThread with the following argument.
-
-    Args:
-      ready_event: event which will be set when the test server is ready.
-      arguments: dictionary of arguments to run the test server.
-      device: An instance of DeviceUtils.
-      tool: instance of runtime error detection tool.
-    """
-    threading.Thread.__init__(self)
-    self.wait_event = threading.Event()
-    self.stop_flag = False
-    self.ready_event = ready_event
-    self.ready_event.clear()
-    self.arguments = arguments
-    self.device = device
-    self.tool = tool
-    self.test_server_process = None
-    self.is_ready = False
-    self.host_port = self.arguments['port']
-    assert isinstance(self.host_port, int)
-    # The forwarder device port now is dynamically allocated.
-    self.forwarder_device_port = 0
-    # Anonymous pipe in order to get port info from test server.
-    self.pipe_in = None
-    self.pipe_out = None
-    self.process = None
-    self.command_line = []
-
-  def _WaitToStartAndGetPortFromTestServer(self):
-    """Waits for the Python test server to start and gets the port it is using.
-
-    The port information is passed by the Python test server with a pipe given
-    by self.pipe_out. It is written as a result to |self.host_port|.
-
-    Returns:
-      Whether the port used by the test server was successfully fetched.
-    """
-    assert self.host_port == 0 and self.pipe_out and self.pipe_in
-    (in_fds, _, _) = select.select([self.pipe_in, ], [], [],
-                                   TEST_SERVER_STARTUP_TIMEOUT)
-    if len(in_fds) == 0:
-      logging.error('Failed to wait to the Python test server to be started.')
-      return False
-    # First read the data length as an unsigned 4-byte value.  This
-    # is _not_ using network byte ordering since the Python test server packs
-    # size as native byte order and all Chromium platforms so far are
-    # configured to use little-endian.
-    # TODO(jnd): Change the Python test server and local_test_server_*.cc to
-    # use a unified byte order (either big-endian or little-endian).
-    data_length = os.read(self.pipe_in, struct.calcsize('=L'))
-    if data_length:
-      (data_length,) = struct.unpack('=L', data_length)
-      assert data_length
-    if not data_length:
-      logging.error('Failed to get length of server data.')
-      return False
-    port_json = os.read(self.pipe_in, data_length)
-    if not port_json:
-      logging.error('Failed to get server data.')
-      return False
-    logging.info('Got port json data: %s', port_json)
-    port_json = json.loads(port_json)
-    if port_json.has_key('port') and isinstance(port_json['port'], int):
-      self.host_port = port_json['port']
-      return _CheckPortNotAvailable(self.host_port)
-    logging.error('Failed to get port information from the server data.')
-    return False
-
-  def _GenerateCommandLineArguments(self):
-    """Generates the command line to run the test server.
-
-    Note that all options are processed by following the definitions in
-    testserver.py.
-    """
-    if self.command_line:
-      return
-
-    args_copy = dict(self.arguments)
-
-    # Translate the server type.
-    type_cmd = _GetServerTypeCommandLine(args_copy.pop('server-type'))
-    if type_cmd:
-      self.command_line.append(type_cmd)
-
-    # Use a pipe to get the port given by the instance of Python test server
-    # if the test does not specify the port.
-    assert self.host_port == args_copy['port']
-    if self.host_port == 0:
-      (self.pipe_in, self.pipe_out) = os.pipe()
-      self.command_line.append('--startup-pipe=%d' % self.pipe_out)
-
-    # Pass the remaining arguments as-is.
-    for key, values in args_copy.iteritems():
-      if not isinstance(values, list):
-        values = [values]
-      for value in values:
-        if value is None:
-          self.command_line.append('--%s' % key)
-        else:
-          self.command_line.append('--%s=%s' % (key, value))
-
-  def _CloseUnnecessaryFDsForTestServerProcess(self):
-    # This is required to avoid subtle deadlocks that could be caused by the
-    # test server child process inheriting undesirable file descriptors such as
-    # file lock file descriptors.
-    for fd in xrange(0, 1024):
-      if fd != self.pipe_out:
-        try:
-          os.close(fd)
-        except:
-          pass
-
-  def run(self):
-    logging.info('Start running the thread!')
-    self.wait_event.clear()
-    self._GenerateCommandLineArguments()
-    command = constants.DIR_SOURCE_ROOT
-    if self.arguments['server-type'] == 'sync':
-      command = [os.path.join(command, 'sync', 'tools', 'testserver',
-                              'sync_testserver.py')] + self.command_line
-    else:
-      command = [os.path.join(command, 'net', 'tools', 'testserver',
-                              'testserver.py')] + self.command_line
-    logging.info('Running: %s', command)
-    # Pass DIR_SOURCE_ROOT as the child's working directory so that relative
-    # paths in the arguments are resolved correctly.
-    self.process = subprocess.Popen(
-        command, preexec_fn=self._CloseUnnecessaryFDsForTestServerProcess,
-        cwd=constants.DIR_SOURCE_ROOT)
-    if self.process:
-      if self.pipe_out:
-        self.is_ready = self._WaitToStartAndGetPortFromTestServer()
-      else:
-        self.is_ready = _CheckPortNotAvailable(self.host_port)
-    if self.is_ready:
-      Forwarder.Map([(0, self.host_port)], self.device, self.tool)
-      # Check whether the forwarder is ready on the device.
-      self.is_ready = False
-      device_port = Forwarder.DevicePortForHostPort(self.host_port)
-      if device_port and _CheckDevicePortStatus(self.device, device_port):
-        self.is_ready = True
-        self.forwarder_device_port = device_port
-    # Wake up the request handler thread.
-    self.ready_event.set()
-    # Keep thread running until Stop() gets called.
-    _WaitUntil(lambda: self.stop_flag, max_attempts=sys.maxint)
-    if self.process.poll() is None:
-      self.process.kill()
-    Forwarder.UnmapDevicePort(self.forwarder_device_port, self.device)
-    self.process = None
-    self.is_ready = False
-    if self.pipe_out:
-      os.close(self.pipe_in)
-      os.close(self.pipe_out)
-      self.pipe_in = None
-      self.pipe_out = None
-    logging.info('Test-server has died.')
-    self.wait_event.set()
-
-  def Stop(self):
-    """Blocks until the loop has finished.
-
-    Note that this must be called in another thread.
-    """
-    if not self.process:
-      return
-    self.stop_flag = True
-    self.wait_event.wait()
-
-
-class SpawningServerRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
-  """A handler used to process http GET/POST request."""
-
-  def _SendResponse(self, response_code, response_reason, additional_headers,
-                    contents):
-    """Generates a response sent to the client from the provided parameters.
-
-    Args:
-      response_code: number of the response status.
-      response_reason: string of reason description of the response.
-      additional_headers: dict of additional headers. Each key is the name of
-                          the header, each value is the content of the header.
-      contents: string of the contents we want to send to client.
-    """
-    self.send_response(response_code, response_reason)
-    self.send_header('Content-Type', 'text/html')
-    # Specify the content-length as without it the http(s) response will not
-    # be completed properly (and the browser keeps expecting data).
-    self.send_header('Content-Length', len(contents))
-    for header_name in additional_headers:
-      self.send_header(header_name, additional_headers[header_name])
-    self.end_headers()
-    self.wfile.write(contents)
-    self.wfile.flush()
-
-  def _StartTestServer(self):
-    """Starts the test server thread."""
-    logging.info('Handling request to spawn a test server.')
-    content_type = self.headers.getheader('content-type')
-    if content_type != 'application/json':
-      raise Exception('Bad content-type for start request.')
-    content_length = self.headers.getheader('content-length')
-    if not content_length:
-      content_length = 0
-    try:
-      content_length = int(content_length)
-    except:
-      raise Exception('Bad content-length for start request.')
-    logging.info(content_length)
-    test_server_argument_json = self.rfile.read(content_length)
-    logging.info(test_server_argument_json)
-    assert not self.server.test_server_instance
-    ready_event = threading.Event()
-    self.server.test_server_instance = TestServerThread(
-        ready_event,
-        json.loads(test_server_argument_json),
-        self.server.device,
-        self.server.tool)
-    self.server.test_server_instance.setDaemon(True)
-    self.server.test_server_instance.start()
-    ready_event.wait()
-    if self.server.test_server_instance.is_ready:
-      self._SendResponse(200, 'OK', {}, json.dumps(
-          {'port': self.server.test_server_instance.forwarder_device_port,
-           'message': 'started'}))
-      logging.info('Test server is running on port: %d.',
-                   self.server.test_server_instance.host_port)
-    else:
-      self.server.test_server_instance.Stop()
-      self.server.test_server_instance = None
-      self._SendResponse(500, 'Test Server Error.', {}, '')
-      logging.info('Encounter problem during starting a test server.')
-
-  def _KillTestServer(self):
-    """Stops the test server instance."""
-    # There should only ever be one test server at a time. This may do the
-    # wrong thing if we try and start multiple test servers.
-    if not self.server.test_server_instance:
-      return
-    port = self.server.test_server_instance.host_port
-    logging.info('Handling request to kill a test server on port: %d.', port)
-    self.server.test_server_instance.Stop()
-    # Make sure the status of test server is correct before sending response.
-    if _CheckPortAvailable(port):
-      self._SendResponse(200, 'OK', {}, 'killed')
-      logging.info('Test server on port %d is killed', port)
-    else:
-      self._SendResponse(500, 'Test Server Error.', {}, '')
-      logging.info('Encounter problem during killing a test server.')
-    self.server.test_server_instance = None
-
-  def do_POST(self):
-    parsed_path = urlparse.urlparse(self.path)
-    action = parsed_path.path
-    logging.info('Action for POST method is: %s.', action)
-    if action == '/start':
-      self._StartTestServer()
-    else:
-      self._SendResponse(400, 'Unknown request.', {}, '')
-      logging.info('Encounter unknown request: %s.', action)
-
-  def do_GET(self):
-    parsed_path = urlparse.urlparse(self.path)
-    action = parsed_path.path
-    params = urlparse.parse_qs(parsed_path.query, keep_blank_values=1)
-    logging.info('Action for GET method is: %s.', action)
-    for param in params:
-      logging.info('%s=%s', param, params[param][0])
-    if action == '/kill':
-      self._KillTestServer()
-    elif action == '/ping':
-      # The ping handler is used to check whether the spawner server is ready
-      # to serve the requests. We don't need to test the status of the test
-      # server when handling ping request.
-      self._SendResponse(200, 'OK', {}, 'ready')
-      logging.info('Handled ping request and sent response.')
-    else:
-      self._SendResponse(400, 'Unknown request', {}, '')
-      logging.info('Encounter unknown request: %s.', action)
-
-
-class SpawningServer(object):
-  """The class used to start/stop a http server."""
-
-  def __init__(self, test_server_spawner_port, device, tool):
-    logging.info('Creating new spawner on port: %d.', test_server_spawner_port)
-    self.server = BaseHTTPServer.HTTPServer(('', test_server_spawner_port),
-                                            SpawningServerRequestHandler)
-    self.server.device = device
-    self.server.tool = tool
-    self.server.test_server_instance = None
-    self.server.build_type = constants.GetBuildType()
-
-  def _Listen(self):
-    logging.info('Starting test server spawner')
-    self.server.serve_forever()
-
-  def Start(self):
-    """Starts the test server spawner."""
-    listener_thread = threading.Thread(target=self._Listen)
-    listener_thread.setDaemon(True)
-    listener_thread.start()
-
-  def Stop(self):
-    """Stops the test server spawner.
-
-    Also cleans the server state.
-    """
-    self.CleanupState()
-    self.server.shutdown()
-
-  def CleanupState(self):
-    """Cleans up the spawning server state.
-
-    This should be called if the test server spawner is reused,
-    to avoid sharing the test server instance.
-    """
-    if self.server.test_server_instance:
-      self.server.test_server_instance.Stop()
-      self.server.test_server_instance = None
diff --git a/build/android/pylib/cmd_helper.py b/build/android/pylib/cmd_helper.py
deleted file mode 100644
index f881553..0000000
--- a/build/android/pylib/cmd_helper.py
+++ /dev/null
@@ -1,261 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""A wrapper for subprocess to make calling shell commands easier."""
-
-import logging
-import os
-import pipes
-import select
-import signal
-import string
-import StringIO
-import subprocess
-import time
-
-# fcntl is not available on Windows.
-try:
-  import fcntl
-except ImportError:
-  fcntl = None
-
-_SafeShellChars = frozenset(string.ascii_letters + string.digits + '@%_-+=:,./')
-
-def SingleQuote(s):
-  """Return an shell-escaped version of the string using single quotes.
-
-  Reliably quote a string which may contain unsafe characters (e.g. space,
-  quote, or other special characters such as '$').
-
-  The returned value can be used in a shell command line as one token that gets
-  to be interpreted literally.
-
-  Args:
-    s: The string to quote.
-
-  Return:
-    The string quoted using single quotes.
-  """
-  return pipes.quote(s)
-
-def DoubleQuote(s):
-  """Return an shell-escaped version of the string using double quotes.
-
-  Reliably quote a string which may contain unsafe characters (e.g. space
-  or quote characters), while retaining some shell features such as variable
-  interpolation.
-
-  The returned value can be used in a shell command line as one token that gets
-  to be further interpreted by the shell.
-
-  The set of characters that retain their special meaning may depend on the
-  shell implementation. This set usually includes: '$', '`', '\', '!', '*',
-  and '@'.
-
-  Args:
-    s: The string to quote.
-
-  Return:
-    The string quoted using double quotes.
-  """
-  if not s:
-    return '""'
-  elif all(c in _SafeShellChars for c in s):
-    return s
-  else:
-    return '"' + s.replace('"', '\\"') + '"'
-
-
-def Popen(args, stdout=None, stderr=None, shell=None, cwd=None, env=None):
-  return subprocess.Popen(
-      args=args, cwd=cwd, stdout=stdout, stderr=stderr,
-      shell=shell, close_fds=True, env=env,
-      preexec_fn=lambda: signal.signal(signal.SIGPIPE, signal.SIG_DFL))
-
-
-def Call(args, stdout=None, stderr=None, shell=None, cwd=None, env=None):
-  pipe = Popen(args, stdout=stdout, stderr=stderr, shell=shell, cwd=cwd,
-               env=env)
-  pipe.communicate()
-  return pipe.wait()
-
-
-def RunCmd(args, cwd=None):
-  """Opens a subprocess to execute a program and returns its return value.
-
-  Args:
-    args: A string or a sequence of program arguments. The program to execute is
-      the string or the first item in the args sequence.
-    cwd: If not None, the subprocess's current directory will be changed to
-      |cwd| before it's executed.
-
-  Returns:
-    Return code from the command execution.
-  """
-  logging.info(str(args) + ' ' + (cwd or ''))
-  return Call(args, cwd=cwd)
-
-
-def GetCmdOutput(args, cwd=None, shell=False):
-  """Open a subprocess to execute a program and returns its output.
-
-  Args:
-    args: A string or a sequence of program arguments. The program to execute is
-      the string or the first item in the args sequence.
-    cwd: If not None, the subprocess's current directory will be changed to
-      |cwd| before it's executed.
-    shell: Whether to execute args as a shell command.
-
-  Returns:
-    Captures and returns the command's stdout.
-    Prints the command's stderr to logger (which defaults to stdout).
-  """
-  (_, output) = GetCmdStatusAndOutput(args, cwd, shell)
-  return output
-
-
-def _ValidateAndLogCommand(args, cwd, shell):
-  if isinstance(args, basestring):
-    if not shell:
-      raise Exception('string args must be run with shell=True')
-  else:
-    if shell:
-      raise Exception('array args must be run with shell=False')
-    args = ' '.join(SingleQuote(c) for c in args)
-  if cwd is None:
-    cwd = ''
-  else:
-    cwd = ':' + cwd
-  logging.info('[host]%s> %s', cwd, args)
-  return args
-
-
-def GetCmdStatusAndOutput(args, cwd=None, shell=False):
-  """Executes a subprocess and returns its exit code and output.
-
-  Args:
-    args: A string or a sequence of program arguments. The program to execute is
-      the string or the first item in the args sequence.
-    cwd: If not None, the subprocess's current directory will be changed to
-      |cwd| before it's executed.
-    shell: Whether to execute args as a shell command. Must be True if args
-      is a string and False if args is a sequence.
-
-  Returns:
-    The 2-tuple (exit code, output).
-  """
-  _ValidateAndLogCommand(args, cwd, shell)
-  pipe = Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
-               shell=shell, cwd=cwd)
-  stdout, stderr = pipe.communicate()
-
-  if stderr:
-    logging.critical(stderr)
-  if len(stdout) > 4096:
-    logging.debug('Truncated output:')
-  logging.debug(stdout[:4096])
-  return (pipe.returncode, stdout)
-
-
-class TimeoutError(Exception):
-  """Module-specific timeout exception."""
-  pass
-
-
-def _IterProcessStdout(process, timeout=None, buffer_size=4096,
-                       poll_interval=1):
-  assert fcntl, 'fcntl module is required'
-  try:
-    # Enable non-blocking reads from the child's stdout.
-    child_fd = process.stdout.fileno()
-    fl = fcntl.fcntl(child_fd, fcntl.F_GETFL)
-    fcntl.fcntl(child_fd, fcntl.F_SETFL, fl | os.O_NONBLOCK)
-
-    end_time = (time.time() + timeout) if timeout else None
-    while True:
-      if end_time and time.time() > end_time:
-        raise TimeoutError
-      read_fds, _, _ = select.select([child_fd], [], [], poll_interval)
-      if child_fd in read_fds:
-        data = os.read(child_fd, buffer_size)
-        if not data:
-          break
-        yield data
-      if process.poll() is not None:
-        break
-  finally:
-    try:
-      # Make sure the process doesn't stick around if we fail with an
-      # exception.
-      process.kill()
-    except OSError:
-      pass
-    process.wait()
-
-
-def GetCmdStatusAndOutputWithTimeout(args, timeout, cwd=None, shell=False,
-                                     logfile=None):
-  """Executes a subprocess with a timeout.
-
-  Args:
-    args: List of arguments to the program, the program to execute is the first
-      element.
-    timeout: the timeout in seconds or None to wait forever.
-    cwd: If not None, the subprocess's current directory will be changed to
-      |cwd| before it's executed.
-    shell: Whether to execute args as a shell command. Must be True if args
-      is a string and False if args is a sequence.
-    logfile: Optional file-like object that will receive output from the
-      command as it is running.
-
-  Returns:
-    The 2-tuple (exit code, output).
-  """
-  _ValidateAndLogCommand(args, cwd, shell)
-  output = StringIO.StringIO()
-  process = Popen(args, cwd=cwd, shell=shell, stdout=subprocess.PIPE,
-                  stderr=subprocess.STDOUT)
-  for data in _IterProcessStdout(process, timeout=timeout):
-    if logfile:
-      logfile.write(data)
-    output.write(data)
-  return process.returncode, output.getvalue()
-
-
-def IterCmdOutputLines(args, timeout=None, cwd=None, shell=False,
-                       check_status=True):
-  """Executes a subprocess and continuously yields lines from its output.
-
-  Args:
-    args: List of arguments to the program, the program to execute is the first
-      element.
-    cwd: If not None, the subprocess's current directory will be changed to
-      |cwd| before it's executed.
-    shell: Whether to execute args as a shell command. Must be True if args
-      is a string and False if args is a sequence.
-    check_status: A boolean indicating whether to check the exit status of the
-      process after all output has been read.
-
-  Yields:
-    The output of the subprocess, line by line.
-
-  Raises:
-    CalledProcessError if check_status is True and the process exited with a
-      non-zero exit status.
-  """
-  cmd = _ValidateAndLogCommand(args, cwd, shell)
-  process = Popen(args, cwd=cwd, shell=shell, stdout=subprocess.PIPE,
-                  stderr=subprocess.STDOUT)
-  buffer_output = ''
-  for data in _IterProcessStdout(process, timeout=timeout):
-    buffer_output += data
-    has_incomplete_line = buffer_output[-1] not in '\r\n'
-    lines = buffer_output.splitlines()
-    buffer_output = lines.pop() if has_incomplete_line else ''
-    for line in lines:
-      yield line
-  if buffer_output:
-    yield buffer_output
-  if check_status and process.returncode:
-    raise subprocess.CalledProcessError(process.returncode, cmd)
diff --git a/build/android/pylib/cmd_helper_test.py b/build/android/pylib/cmd_helper_test.py
deleted file mode 100644
index 5155cea..0000000
--- a/build/android/pylib/cmd_helper_test.py
+++ /dev/null
@@ -1,83 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Tests for the cmd_helper module."""
-
-import unittest
-import subprocess
-
-from pylib import cmd_helper
-
-
-class CmdHelperSingleQuoteTest(unittest.TestCase):
-
-  def testSingleQuote_basic(self):
-    self.assertEquals('hello',
-                      cmd_helper.SingleQuote('hello'))
-
-  def testSingleQuote_withSpaces(self):
-    self.assertEquals("'hello world'",
-                      cmd_helper.SingleQuote('hello world'))
-
-  def testSingleQuote_withUnsafeChars(self):
-    self.assertEquals("""'hello'"'"'; rm -rf /'""",
-                      cmd_helper.SingleQuote("hello'; rm -rf /"))
-
-  def testSingleQuote_dontExpand(self):
-    test_string = 'hello $TEST_VAR'
-    cmd = 'TEST_VAR=world; echo %s' % cmd_helper.SingleQuote(test_string)
-    self.assertEquals(test_string,
-                      cmd_helper.GetCmdOutput(cmd, shell=True).rstrip())
-
-
-class CmdHelperDoubleQuoteTest(unittest.TestCase):
-
-  def testDoubleQuote_basic(self):
-    self.assertEquals('hello',
-                      cmd_helper.DoubleQuote('hello'))
-
-  def testDoubleQuote_withSpaces(self):
-    self.assertEquals('"hello world"',
-                      cmd_helper.DoubleQuote('hello world'))
-
-  def testDoubleQuote_withUnsafeChars(self):
-    self.assertEquals('''"hello\\"; rm -rf /"''',
-                      cmd_helper.DoubleQuote('hello"; rm -rf /'))
-
-  def testSingleQuote_doExpand(self):
-    test_string = 'hello $TEST_VAR'
-    cmd = 'TEST_VAR=world; echo %s' % cmd_helper.DoubleQuote(test_string)
-    self.assertEquals('hello world',
-                      cmd_helper.GetCmdOutput(cmd, shell=True).rstrip())
-
-
-class CmdHelperIterCmdOutputLinesTest(unittest.TestCase):
-  """Test IterCmdOutputLines with some calls to the unix 'seq' command."""
-
-  def testIterCmdOutputLines_success(self):
-    for num, line in enumerate(
-        cmd_helper.IterCmdOutputLines(['seq', '10']), 1):
-      self.assertEquals(num, int(line))
-
-  def testIterCmdOutputLines_exitStatusFail(self):
-    with self.assertRaises(subprocess.CalledProcessError):
-      for num, line in enumerate(
-          cmd_helper.IterCmdOutputLines('seq 10 && false', shell=True), 1):
-        self.assertEquals(num, int(line))
-      # after reading all the output we get an exit status of 1
-
-  def testIterCmdOutputLines_exitStatusIgnored(self):
-    for num, line in enumerate(
-        cmd_helper.IterCmdOutputLines('seq 10 && false', shell=True,
-                                      check_status=False), 1):
-      self.assertEquals(num, int(line))
-
-  def testIterCmdOutputLines_exitStatusSkipped(self):
-    for num, line in enumerate(
-        cmd_helper.IterCmdOutputLines('seq 10 && false', shell=True), 1):
-      self.assertEquals(num, int(line))
-      # no exception will be raised because we don't attempt to read past
-      # the end of the output and, thus, the status never gets checked
-      if num == 10:
-        break
diff --git a/build/android/pylib/constants/__init__.py b/build/android/pylib/constants/__init__.py
deleted file mode 100644
index 8821f97..0000000
--- a/build/android/pylib/constants/__init__.py
+++ /dev/null
@@ -1,308 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Defines a set of constants shared by test runners and other scripts."""
-
-# TODO(jbudorick): Split these constants into coherent modules.
-
-# pylint: disable=W0212
-
-import collections
-import logging
-import os
-import subprocess
-
-
-DIR_SOURCE_ROOT = os.environ.get('CHECKOUT_SOURCE_ROOT',
-    os.path.abspath(os.path.join(os.path.dirname(__file__),
-                                 os.pardir, os.pardir, os.pardir, os.pardir)))
-ISOLATE_DEPS_DIR = os.path.join(DIR_SOURCE_ROOT, 'isolate_deps_dir')
-
-CHROME_SHELL_HOST_DRIVEN_DIR = os.path.join(
-    DIR_SOURCE_ROOT, 'chrome', 'android')
-
-
-PackageInfo = collections.namedtuple('PackageInfo',
-    ['package', 'activity', 'cmdline_file', 'devtools_socket',
-     'test_package'])
-
-PACKAGE_INFO = {
-    'chrome_document': PackageInfo(
-        'com.google.android.apps.chrome.document',
-        'com.google.android.apps.chrome.document.ChromeLauncherActivity',
-        '/data/local/chrome-command-line',
-        'chrome_devtools_remote',
-        None),
-    'chrome': PackageInfo(
-        'com.google.android.apps.chrome',
-        'com.google.android.apps.chrome.Main',
-        '/data/local/chrome-command-line',
-        'chrome_devtools_remote',
-        'com.google.android.apps.chrome.tests'),
-    'chrome_beta': PackageInfo(
-        'com.chrome.beta',
-        'com.google.android.apps.chrome.Main',
-        '/data/local/chrome-command-line',
-        'chrome_devtools_remote',
-        None),
-    'chrome_stable': PackageInfo(
-        'com.android.chrome',
-        'com.google.android.apps.chrome.Main',
-        '/data/local/chrome-command-line',
-        'chrome_devtools_remote',
-        None),
-    'chrome_dev': PackageInfo(
-        'com.chrome.dev',
-        'com.google.android.apps.chrome.Main',
-        '/data/local/chrome-command-line',
-        'chrome_devtools_remote',
-        None),
-    'chrome_canary': PackageInfo(
-        'com.chrome.canary',
-        'com.google.android.apps.chrome.Main',
-        '/data/local/chrome-command-line',
-        'chrome_devtools_remote',
-        None),
-    'chrome_work': PackageInfo(
-        'com.chrome.work',
-        'com.google.android.apps.chrome.Main',
-        '/data/local/chrome-command-line',
-        'chrome_devtools_remote',
-        None),
-    'chromium': PackageInfo(
-        'org.chromium.chrome',
-        'com.google.android.apps.chrome.Main',
-        '/data/local/chrome-command-line',
-        'chrome_devtools_remote',
-        None),
-    'legacy_browser': PackageInfo(
-        'com.google.android.browser',
-        'com.android.browser.BrowserActivity',
-        None,
-        None,
-        None),
-    'chromecast_shell': PackageInfo(
-        'com.google.android.apps.mediashell',
-        'com.google.android.apps.mediashell.MediaShellActivity',
-        '/data/local/tmp/castshell-command-line',
-        None,
-        None),
-    'content_shell': PackageInfo(
-        'org.chromium.content_shell_apk',
-        'org.chromium.content_shell_apk.ContentShellActivity',
-        '/data/local/tmp/content-shell-command-line',
-        None,
-        'org.chromium.content_shell_apk.tests'),
-    'chrome_shell': PackageInfo(
-        'org.chromium.chrome.shell',
-        'org.chromium.chrome.shell.ChromeShellActivity',
-        '/data/local/tmp/chrome-shell-command-line',
-        'chrome_shell_devtools_remote',
-        'org.chromium.chrome.shell.tests'),
-    'android_webview_shell': PackageInfo(
-        'org.chromium.android_webview.shell',
-        'org.chromium.android_webview.shell.AwShellActivity',
-        '/data/local/tmp/android-webview-command-line',
-        None,
-        'org.chromium.android_webview.test'),
-    'gtest': PackageInfo(
-        'org.chromium.native_test',
-        'org.chromium.native_test.NativeUnitTestActivity',
-        '/data/local/tmp/chrome-native-tests-command-line',
-        None,
-        None),
-    'components_browsertests': PackageInfo(
-        'org.chromium.components_browsertests_apk',
-        ('org.chromium.components_browsertests_apk' +
-         '.ComponentsBrowserTestsActivity'),
-        '/data/local/tmp/chrome-native-tests-command-line',
-        None,
-        None),
-    'content_browsertests': PackageInfo(
-        'org.chromium.content_browsertests_apk',
-        'org.chromium.content_browsertests_apk.ContentBrowserTestsActivity',
-        '/data/local/tmp/chrome-native-tests-command-line',
-        None,
-        None),
-    'chromedriver_webview_shell': PackageInfo(
-        'org.chromium.chromedriver_webview_shell',
-        'org.chromium.chromedriver_webview_shell.Main',
-        None,
-        None,
-        None),
-}
-
-
-# Ports arrangement for various test servers used in Chrome for Android.
-# Lighttpd server will attempt to use 9000 as default port, if unavailable it
-# will find a free port from 8001 - 8999.
-LIGHTTPD_DEFAULT_PORT = 9000
-LIGHTTPD_RANDOM_PORT_FIRST = 8001
-LIGHTTPD_RANDOM_PORT_LAST = 8999
-TEST_SYNC_SERVER_PORT = 9031
-TEST_SEARCH_BY_IMAGE_SERVER_PORT = 9041
-TEST_POLICY_SERVER_PORT = 9051
-
-# The net test server is started from port 10201.
-# TODO(pliard): http://crbug.com/239014. Remove this dirty workaround once
-# http://crbug.com/239014 is fixed properly.
-TEST_SERVER_PORT_FIRST = 10201
-TEST_SERVER_PORT_LAST = 30000
-# A file to record next valid port of test server.
-TEST_SERVER_PORT_FILE = '/tmp/test_server_port'
-TEST_SERVER_PORT_LOCKFILE = '/tmp/test_server_port.lock'
-
-TEST_EXECUTABLE_DIR = '/data/local/tmp'
-# Directories for common java libraries for SDK build.
-# These constants are defined in build/android/ant/common.xml
-SDK_BUILD_JAVALIB_DIR = 'lib.java'
-SDK_BUILD_TEST_JAVALIB_DIR = 'test.lib.java'
-SDK_BUILD_APKS_DIR = 'apks'
-
-ADB_KEYS_FILE = '/data/misc/adb/adb_keys'
-
-PERF_OUTPUT_DIR = os.path.join(DIR_SOURCE_ROOT, 'out', 'step_results')
-# The directory on the device where perf test output gets saved to.
-DEVICE_PERF_OUTPUT_DIR = (
-    '/data/data/' + PACKAGE_INFO['chrome'].package + '/files')
-
-SCREENSHOTS_DIR = os.path.join(DIR_SOURCE_ROOT, 'out_screenshots')
-
-class ANDROID_SDK_VERSION_CODES(object):
-  """Android SDK version codes.
-
-  http://developer.android.com/reference/android/os/Build.VERSION_CODES.html
-  """
-
-  JELLY_BEAN = 16
-  JELLY_BEAN_MR1 = 17
-  JELLY_BEAN_MR2 = 18
-  KITKAT = 19
-  KITKAT_WATCH = 20
-  LOLLIPOP = 21
-  LOLLIPOP_MR1 = 22
-
-ANDROID_SDK_VERSION = ANDROID_SDK_VERSION_CODES.LOLLIPOP_MR1
-ANDROID_SDK_BUILD_TOOLS_VERSION = '22.0.1'
-ANDROID_SDK_ROOT = os.path.join(DIR_SOURCE_ROOT,
-                                'third_party/android_tools/sdk')
-ANDROID_SDK_TOOLS = os.path.join(ANDROID_SDK_ROOT,
-                                 'build-tools', ANDROID_SDK_BUILD_TOOLS_VERSION)
-ANDROID_NDK_ROOT = os.path.join(DIR_SOURCE_ROOT,
-                                'third_party/android_tools/ndk')
-
-EMULATOR_SDK_ROOT = os.environ.get('ANDROID_EMULATOR_SDK_ROOT',
-                                   os.path.join(DIR_SOURCE_ROOT,
-                                                'android_emulator_sdk'))
-
-BAD_DEVICES_JSON = os.path.join(DIR_SOURCE_ROOT,
-                                os.environ.get('CHROMIUM_OUT_DIR', 'out'),
-                                'bad_devices.json')
-
-UPSTREAM_FLAKINESS_SERVER = 'test-results.appspot.com'
-
-DEVICE_LOCAL_PROPERTIES_PATH = '/data/local.prop'
-
-PYTHON_UNIT_TEST_SUITES = {
-  'pylib_py_unittests': {
-    'path': os.path.join(DIR_SOURCE_ROOT, 'build', 'android'),
-    'test_modules': [
-      'pylib.cmd_helper_test',
-      'pylib.device.device_utils_test',
-      'pylib.results.json_results_test',
-      'pylib.utils.md5sum_test',
-    ]
-  },
-  'gyp_py_unittests': {
-    'path': os.path.join(DIR_SOURCE_ROOT, 'build', 'android', 'gyp'),
-    'test_modules': [
-      'java_cpp_enum_tests',
-    ]
-  },
-}
-
-LOCAL_MACHINE_TESTS = ['junit', 'python']
-VALID_ENVIRONMENTS = ['local', 'remote_device']
-VALID_TEST_TYPES = ['gtest', 'instrumentation', 'junit', 'linker', 'monkey',
-                    'perf', 'python', 'uiautomator', 'uirobot']
-VALID_DEVICE_TYPES = ['Android', 'iOS']
-
-
-def GetBuildType():
-  try:
-    return os.environ['BUILDTYPE']
-  except KeyError:
-    raise EnvironmentError(
-        'The BUILDTYPE environment variable has not been set')
-
-
-def SetBuildType(build_type):
-  os.environ['BUILDTYPE'] = build_type
-
-
-def SetBuildDirectory(build_directory):
-  os.environ['CHROMIUM_OUT_DIR'] = build_directory
-
-
-def SetOutputDirectory(output_directory):
-  os.environ['CHROMIUM_OUTPUT_DIR'] = output_directory
-
-
-def GetOutDirectory(build_type=None):
-  """Returns the out directory where the output binaries are built.
-
-  Args:
-    build_type: Build type, generally 'Debug' or 'Release'. Defaults to the
-      globally set build type environment variable BUILDTYPE.
-  """
-  if 'CHROMIUM_OUTPUT_DIR' in os.environ:
-    return os.path.abspath(os.path.join(
-        DIR_SOURCE_ROOT, os.environ.get('CHROMIUM_OUTPUT_DIR')))
-
-  return os.path.abspath(os.path.join(
-      DIR_SOURCE_ROOT, os.environ.get('CHROMIUM_OUT_DIR', 'out'),
-      GetBuildType() if build_type is None else build_type))
-
-
-def _Memoize(func):
-  def Wrapper():
-    try:
-      return func._result
-    except AttributeError:
-      func._result = func()
-      return func._result
-  return Wrapper
-
-
-def SetAdbPath(adb_path):
-  os.environ['ADB_PATH'] = adb_path
-
-
-def GetAdbPath():
-  # Check if a custom adb path as been set. If not, try to find adb
-  # on the system.
-  if os.environ.get('ADB_PATH'):
-    return os.environ.get('ADB_PATH')
-  else:
-    return _FindAdbPath()
-
-
-@_Memoize
-def _FindAdbPath():
-  if os.environ.get('ANDROID_SDK_ROOT'):
-    return 'adb'
-  # If envsetup.sh hasn't been sourced and there's no adb in the path,
-  # set it here.
-  try:
-    with file(os.devnull, 'w') as devnull:
-      subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull)
-    return 'adb'
-  except OSError:
-    logging.debug('No adb found in $PATH, fallback to checked in binary.')
-    return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb')
-
-# Exit codes
-ERROR_EXIT_CODE = 1
-INFRA_EXIT_CODE = 87
-WARNING_EXIT_CODE = 88
diff --git a/build/android/pylib/constants/keyevent.py b/build/android/pylib/constants/keyevent.py
deleted file mode 100644
index 06736b3..0000000
--- a/build/android/pylib/constants/keyevent.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Android KeyEvent constants.
-
-http://developer.android.com/reference/android/view/KeyEvent.html
-"""
-
-KEYCODE_BACK = 4
-KEYCODE_DPAD_RIGHT = 22
-KEYCODE_ENTER = 66
-KEYCODE_MENU = 82
-
diff --git a/build/android/pylib/content_settings.py b/build/android/pylib/content_settings.py
deleted file mode 100644
index 8594140..0000000
--- a/build/android/pylib/content_settings.py
+++ /dev/null
@@ -1,82 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from pylib import constants
-
-
-class ContentSettings(dict):
-
-  """A dict interface to interact with device content settings.
-
-  System properties are key/value pairs as exposed by adb shell content.
-  """
-
-  def __init__(self, table, device):
-    super(ContentSettings, self).__init__()
-    self._table = table
-    self._device = device
-
-  @staticmethod
-  def _GetTypeBinding(value):
-    if isinstance(value, bool):
-      return 'b'
-    if isinstance(value, float):
-      return 'f'
-    if isinstance(value, int):
-      return 'i'
-    if isinstance(value, long):
-      return 'l'
-    if isinstance(value, str):
-      return 's'
-    raise ValueError('Unsupported type %s' % type(value))
-
-  def iteritems(self):
-    # Example row:
-    # 'Row: 0 _id=13, name=logging_id2, value=-1fccbaa546705b05'
-    for row in self._device.RunShellCommand(
-        'content query --uri content://%s' % self._table, as_root=True):
-      fields = row.split(', ')
-      key = None
-      value = None
-      for field in fields:
-        k, _, v = field.partition('=')
-        if k == 'name':
-          key = v
-        elif k == 'value':
-          value = v
-      if not key:
-        continue
-      if not value:
-        value = ''
-      yield key, value
-
-  def __getitem__(self, key):
-    return self._device.RunShellCommand(
-        'content query --uri content://%s --where "name=\'%s\'" '
-        '--projection value' % (self._table, key), as_root=True).strip()
-
-  def __setitem__(self, key, value):
-    if key in self:
-      self._device.RunShellCommand(
-          'content update --uri content://%s '
-          '--bind value:%s:%s --where "name=\'%s\'"' % (
-              self._table,
-              self._GetTypeBinding(value), value, key),
-          as_root=True)
-    else:
-      self._device.RunShellCommand(
-          'content insert --uri content://%s '
-          '--bind name:%s:%s --bind value:%s:%s' % (
-              self._table,
-              self._GetTypeBinding(key), key,
-              self._GetTypeBinding(value), value),
-          as_root=True)
-
-  def __delitem__(self, key):
-    self._device.RunShellCommand(
-        'content delete --uri content://%s '
-        '--bind name:%s:%s' % (
-            self._table,
-            self._GetTypeBinding(key), key),
-        as_root=True)
diff --git a/build/android/pylib/device/OWNERS b/build/android/pylib/device/OWNERS
deleted file mode 100644
index c35d7ac..0000000
--- a/build/android/pylib/device/OWNERS
+++ /dev/null
@@ -1,2 +0,0 @@
-jbudorick@chromium.org
-perezju@chromium.org
diff --git a/build/android/pylib/device/__init__.py b/build/android/pylib/device/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/build/android/pylib/device/__init__.py
+++ /dev/null
diff --git a/build/android/pylib/device/adb_wrapper.py b/build/android/pylib/device/adb_wrapper.py
deleted file mode 100644
index e897326..0000000
--- a/build/android/pylib/device/adb_wrapper.py
+++ /dev/null
@@ -1,608 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""This module wraps Android's adb tool.
-
-This is a thin wrapper around the adb interface. Any additional complexity
-should be delegated to a higher level (ex. DeviceUtils).
-"""
-
-import collections
-import errno
-import logging
-import os
-import re
-
-from pylib import cmd_helper
-from pylib import constants
-from pylib.device import decorators
-from pylib.device import device_errors
-from pylib.utils import timeout_retry
-
-
-_DEFAULT_TIMEOUT = 30
-_DEFAULT_RETRIES = 2
-
-_EMULATOR_RE = re.compile(r'^emulator-[0-9]+$')
-
-_READY_STATE = 'device'
-
-
-def _VerifyLocalFileExists(path):
-  """Verifies a local file exists.
-
-  Args:
-    path: Path to the local file.
-
-  Raises:
-    IOError: If the file doesn't exist.
-  """
-  if not os.path.exists(path):
-    raise IOError(errno.ENOENT, os.strerror(errno.ENOENT), path)
-
-
-DeviceStat = collections.namedtuple('DeviceStat',
-                                    ['st_mode', 'st_size', 'st_time'])
-
-
-class AdbWrapper(object):
-  """A wrapper around a local Android Debug Bridge executable."""
-
-  def __init__(self, device_serial):
-    """Initializes the AdbWrapper.
-
-    Args:
-      device_serial: The device serial number as a string.
-    """
-    if not device_serial:
-      raise ValueError('A device serial must be specified')
-    self._device_serial = str(device_serial)
-
-  # pylint: disable=unused-argument
-  @classmethod
-  def _BuildAdbCmd(cls, args, device_serial, cpu_affinity=None):
-    if cpu_affinity is not None:
-      cmd = ['taskset', '-c', str(cpu_affinity)]
-    else:
-      cmd = []
-    cmd.append(constants.GetAdbPath())
-    if device_serial is not None:
-      cmd.extend(['-s', device_serial])
-    cmd.extend(args)
-    return cmd
-  # pylint: enable=unused-argument
-
-  # pylint: disable=unused-argument
-  @classmethod
-  @decorators.WithTimeoutAndRetries
-  def _RunAdbCmd(cls, args, timeout=None, retries=None, device_serial=None,
-                 check_error=True, cpu_affinity=None):
-    status, output = cmd_helper.GetCmdStatusAndOutputWithTimeout(
-        cls._BuildAdbCmd(args, device_serial, cpu_affinity=cpu_affinity),
-        timeout_retry.CurrentTimeoutThread().GetRemainingTime())
-    if status != 0:
-      raise device_errors.AdbCommandFailedError(
-          args, output, status, device_serial)
-    # This catches some errors, including when the device drops offline;
-    # unfortunately adb is very inconsistent with error reporting so many
-    # command failures present differently.
-    if check_error and output.startswith('error:'):
-      raise device_errors.AdbCommandFailedError(args, output)
-    return output
-  # pylint: enable=unused-argument
-
-  def _RunDeviceAdbCmd(self, args, timeout, retries, check_error=True):
-    """Runs an adb command on the device associated with this object.
-
-    Args:
-      args: A list of arguments to adb.
-      timeout: Timeout in seconds.
-      retries: Number of retries.
-      check_error: Check that the command doesn't return an error message. This
-        does NOT check the exit status of shell commands.
-
-    Returns:
-      The output of the command.
-    """
-    return self._RunAdbCmd(args, timeout=timeout, retries=retries,
-                           device_serial=self._device_serial,
-                           check_error=check_error)
-
-  def _IterRunDeviceAdbCmd(self, args, timeout):
-    """Runs an adb command and returns an iterator over its output lines.
-
-    Args:
-      args: A list of arguments to adb.
-      timeout: Timeout in seconds.
-
-    Yields:
-      The output of the command line by line.
-    """
-    return cmd_helper.IterCmdOutputLines(
-      self._BuildAdbCmd(args, self._device_serial), timeout=timeout)
-
-  def __eq__(self, other):
-    """Consider instances equal if they refer to the same device.
-
-    Args:
-      other: The instance to compare equality with.
-
-    Returns:
-      True if the instances are considered equal, false otherwise.
-    """
-    return self._device_serial == str(other)
-
-  def __str__(self):
-    """The string representation of an instance.
-
-    Returns:
-      The device serial number as a string.
-    """
-    return self._device_serial
-
-  def __repr__(self):
-    return '%s(\'%s\')' % (self.__class__.__name__, self)
-
-  # pylint: disable=unused-argument
-  @classmethod
-  def IsServerOnline(cls):
-    status, output = cmd_helper.GetCmdStatusAndOutput(['pgrep', 'adb'])
-    output = [int(x) for x in output.split()]
-    logging.info('PIDs for adb found: %r', output)
-    return status == 0
-  # pylint: enable=unused-argument
-
-  @classmethod
-  def KillServer(cls, timeout=_DEFAULT_TIMEOUT, retries=_DEFAULT_RETRIES):
-    cls._RunAdbCmd(['kill-server'], timeout=timeout, retries=retries)
-
-  @classmethod
-  def StartServer(cls, timeout=_DEFAULT_TIMEOUT, retries=_DEFAULT_RETRIES):
-    # CPU affinity is used to reduce adb instability http://crbug.com/268450
-    cls._RunAdbCmd(['start-server'], timeout=timeout, retries=retries,
-                   cpu_affinity=0)
-
-  @classmethod
-  def GetDevices(cls, timeout=_DEFAULT_TIMEOUT, retries=_DEFAULT_RETRIES):
-    """DEPRECATED. Refer to Devices(...) below."""
-    # TODO(jbudorick): Remove this function once no more clients are using it.
-    return cls.Devices(timeout=timeout, retries=retries)
-
-  @classmethod
-  def Devices(cls, is_ready=True, timeout=_DEFAULT_TIMEOUT,
-              retries=_DEFAULT_RETRIES):
-    """Get the list of active attached devices.
-
-    Args:
-      is_ready: Whether the devices should be limited to only those that are
-        ready for use.
-      timeout: (optional) Timeout per try in seconds.
-      retries: (optional) Number of retries to attempt.
-
-    Yields:
-      AdbWrapper instances.
-    """
-    output = cls._RunAdbCmd(['devices'], timeout=timeout, retries=retries)
-    lines = (line.split() for line in output.splitlines())
-    return [AdbWrapper(line[0]) for line in lines
-            if len(line) == 2 and (not is_ready or line[1] == _READY_STATE)]
-
-  def GetDeviceSerial(self):
-    """Gets the device serial number associated with this object.
-
-    Returns:
-      Device serial number as a string.
-    """
-    return self._device_serial
-
-  def Push(self, local, remote, timeout=60*5, retries=_DEFAULT_RETRIES):
-    """Pushes a file from the host to the device.
-
-    Args:
-      local: Path on the host filesystem.
-      remote: Path on the device filesystem.
-      timeout: (optional) Timeout per try in seconds.
-      retries: (optional) Number of retries to attempt.
-    """
-    _VerifyLocalFileExists(local)
-    self._RunDeviceAdbCmd(['push', local, remote], timeout, retries)
-
-  def Pull(self, remote, local, timeout=60*5, retries=_DEFAULT_RETRIES):
-    """Pulls a file from the device to the host.
-
-    Args:
-      remote: Path on the device filesystem.
-      local: Path on the host filesystem.
-      timeout: (optional) Timeout per try in seconds.
-      retries: (optional) Number of retries to attempt.
-    """
-    cmd = ['pull', remote, local]
-    self._RunDeviceAdbCmd(cmd, timeout, retries)
-    try:
-      _VerifyLocalFileExists(local)
-    except IOError:
-      raise device_errors.AdbCommandFailedError(
-          cmd, 'File not found on host: %s' % local, device_serial=str(self))
-
-  def Shell(self, command, expect_status=0, timeout=_DEFAULT_TIMEOUT,
-            retries=_DEFAULT_RETRIES):
-    """Runs a shell command on the device.
-
-    Args:
-      command: A string with the shell command to run.
-      expect_status: (optional) Check that the command's exit status matches
-        this value. Default is 0. If set to None the test is skipped.
-      timeout: (optional) Timeout per try in seconds.
-      retries: (optional) Number of retries to attempt.
-
-    Returns:
-      The output of the shell command as a string.
-
-    Raises:
-      device_errors.AdbCommandFailedError: If the exit status doesn't match
-        |expect_status|.
-    """
-    if expect_status is None:
-      args = ['shell', command]
-    else:
-      args = ['shell', '%s; echo %%$?;' % command.rstrip()]
-    output = self._RunDeviceAdbCmd(args, timeout, retries, check_error=False)
-    if expect_status is not None:
-      output_end = output.rfind('%')
-      if output_end < 0:
-        # causes the status string to become empty and raise a ValueError
-        output_end = len(output)
-
-      try:
-        status = int(output[output_end+1:])
-      except ValueError:
-        logging.warning('exit status of shell command %r missing.', command)
-        raise device_errors.AdbShellCommandFailedError(
-            command, output, status=None, device_serial=self._device_serial)
-      output = output[:output_end]
-      if status != expect_status:
-        raise device_errors.AdbShellCommandFailedError(
-            command, output, status=status, device_serial=self._device_serial)
-    return output
-
-  def IterShell(self, command, timeout):
-    """Runs a shell command and returns an iterator over its output lines.
-
-    Args:
-      command: A string with the shell command to run.
-      timeout: Timeout in seconds.
-
-    Yields:
-      The output of the command line by line.
-    """
-    args = ['shell', command]
-    return cmd_helper.IterCmdOutputLines(
-      self._BuildAdbCmd(args, self._device_serial), timeout=timeout)
-
-  def Ls(self, path, timeout=_DEFAULT_TIMEOUT, retries=_DEFAULT_RETRIES):
-    """List the contents of a directory on the device.
-
-    Args:
-      path: Path on the device filesystem.
-      timeout: (optional) Timeout per try in seconds.
-      retries: (optional) Number of retries to attempt.
-
-    Returns:
-      A list of pairs (filename, stat) for each file found in the directory,
-      where the stat object has the properties: st_mode, st_size, and st_time.
-
-    Raises:
-      AdbCommandFailedError if |path| does not specify a valid and accessible
-          directory in the device.
-    """
-    def ParseLine(line):
-      cols = line.split(None, 3)
-      filename = cols.pop()
-      stat = DeviceStat(*[int(num, base=16) for num in cols])
-      return (filename, stat)
-
-    cmd = ['ls', path]
-    lines = self._RunDeviceAdbCmd(
-        cmd, timeout=timeout, retries=retries).splitlines()
-    if lines:
-      return [ParseLine(line) for line in lines]
-    else:
-      raise device_errors.AdbCommandFailedError(
-          cmd, 'path does not specify an accessible directory in the device',
-          device_serial=self._device_serial)
-
-  def Logcat(self, clear=False, dump=False, filter_specs=None,
-             logcat_format=None, ring_buffer=None, timeout=None,
-             retries=_DEFAULT_RETRIES):
-    """Get an iterable over the logcat output.
-
-    Args:
-      clear: If true, clear the logcat.
-      dump: If true, dump the current logcat contents.
-      filter_specs: If set, a list of specs to filter the logcat.
-      logcat_format: If set, the format in which the logcat should be output.
-        Options include "brief", "process", "tag", "thread", "raw", "time",
-        "threadtime", and "long"
-      ring_buffer: If set, a list of alternate ring buffers to request.
-        Options include "main", "system", "radio", "events", "crash" or "all".
-        The default is equivalent to ["main", "system", "crash"].
-      timeout: (optional) If set, timeout per try in seconds. If clear or dump
-        is set, defaults to _DEFAULT_TIMEOUT.
-      retries: (optional) If clear or dump is set, the number of retries to
-        attempt. Otherwise, does nothing.
-
-    Yields:
-      logcat output line by line.
-    """
-    cmd = ['logcat']
-    use_iter = True
-    if clear:
-      cmd.append('-c')
-      use_iter = False
-    if dump:
-      cmd.append('-d')
-      use_iter = False
-    if logcat_format:
-      cmd.extend(['-v', logcat_format])
-    if ring_buffer:
-      for buffer_name in ring_buffer:
-        cmd.extend(['-b', buffer_name])
-    if filter_specs:
-      cmd.extend(filter_specs)
-
-    if use_iter:
-      return self._IterRunDeviceAdbCmd(cmd, timeout)
-    else:
-      timeout = timeout if timeout is not None else _DEFAULT_TIMEOUT
-      return self._RunDeviceAdbCmd(cmd, timeout, retries).splitlines()
-
-  def Forward(self, local, remote, timeout=_DEFAULT_TIMEOUT,
-              retries=_DEFAULT_RETRIES):
-    """Forward socket connections from the local socket to the remote socket.
-
-    Sockets are specified by one of:
-      tcp:<port>
-      localabstract:<unix domain socket name>
-      localreserved:<unix domain socket name>
-      localfilesystem:<unix domain socket name>
-      dev:<character device name>
-      jdwp:<process pid> (remote only)
-
-    Args:
-      local: The host socket.
-      remote: The device socket.
-      timeout: (optional) Timeout per try in seconds.
-      retries: (optional) Number of retries to attempt.
-    """
-    self._RunDeviceAdbCmd(['forward', str(local), str(remote)], timeout,
-                          retries)
-
-  def JDWP(self, timeout=_DEFAULT_TIMEOUT, retries=_DEFAULT_RETRIES):
-    """List of PIDs of processes hosting a JDWP transport.
-
-    Args:
-      timeout: (optional) Timeout per try in seconds.
-      retries: (optional) Number of retries to attempt.
-
-    Returns:
-      A list of PIDs as strings.
-    """
-    return [a.strip() for a in
-            self._RunDeviceAdbCmd(['jdwp'], timeout, retries).split('\n')]
-
-  def Install(self, apk_path, forward_lock=False, reinstall=False,
-              sd_card=False, timeout=60*2, retries=_DEFAULT_RETRIES):
-    """Install an apk on the device.
-
-    Args:
-      apk_path: Host path to the APK file.
-      forward_lock: (optional) If set forward-locks the app.
-      reinstall: (optional) If set reinstalls the app, keeping its data.
-      sd_card: (optional) If set installs on the SD card.
-      timeout: (optional) Timeout per try in seconds.
-      retries: (optional) Number of retries to attempt.
-    """
-    _VerifyLocalFileExists(apk_path)
-    cmd = ['install']
-    if forward_lock:
-      cmd.append('-l')
-    if reinstall:
-      cmd.append('-r')
-    if sd_card:
-      cmd.append('-s')
-    cmd.append(apk_path)
-    output = self._RunDeviceAdbCmd(cmd, timeout, retries)
-    if 'Success' not in output:
-      raise device_errors.AdbCommandFailedError(
-          cmd, output, device_serial=self._device_serial)
-
-  def InstallMultiple(self, apk_paths, forward_lock=False, reinstall=False,
-                      sd_card=False, allow_downgrade=False, partial=False,
-                      timeout=60*2, retries=_DEFAULT_RETRIES):
-    """Install an apk with splits on the device.
-
-    Args:
-      apk_paths: Host path to the APK file.
-      forward_lock: (optional) If set forward-locks the app.
-      reinstall: (optional) If set reinstalls the app, keeping its data.
-      sd_card: (optional) If set installs on the SD card.
-      timeout: (optional) Timeout per try in seconds.
-      retries: (optional) Number of retries to attempt.
-      allow_downgrade: (optional) Allow versionCode downgrade.
-      partial: (optional) Package ID if apk_paths doesn't include all .apks.
-    """
-    for path in apk_paths:
-      _VerifyLocalFileExists(path)
-    cmd = ['install-multiple']
-    if forward_lock:
-      cmd.append('-l')
-    if reinstall:
-      cmd.append('-r')
-    if sd_card:
-      cmd.append('-s')
-    if allow_downgrade:
-      cmd.append('-d')
-    if partial:
-      cmd.extend(('-p', partial))
-    cmd.extend(apk_paths)
-    output = self._RunDeviceAdbCmd(cmd, timeout, retries)
-    if 'Success' not in output:
-      raise device_errors.AdbCommandFailedError(
-          cmd, output, device_serial=self._device_serial)
-
-  def Uninstall(self, package, keep_data=False, timeout=_DEFAULT_TIMEOUT,
-                retries=_DEFAULT_RETRIES):
-    """Remove the app |package| from the device.
-
-    Args:
-      package: The package to uninstall.
-      keep_data: (optional) If set keep the data and cache directories.
-      timeout: (optional) Timeout per try in seconds.
-      retries: (optional) Number of retries to attempt.
-    """
-    cmd = ['uninstall']
-    if keep_data:
-      cmd.append('-k')
-    cmd.append(package)
-    output = self._RunDeviceAdbCmd(cmd, timeout, retries)
-    if 'Failure' in output:
-      raise device_errors.AdbCommandFailedError(
-          cmd, output, device_serial=self._device_serial)
-
-  def Backup(self, path, packages=None, apk=False, shared=False,
-             nosystem=True, include_all=False, timeout=_DEFAULT_TIMEOUT,
-             retries=_DEFAULT_RETRIES):
-    """Write an archive of the device's data to |path|.
-
-    Args:
-      path: Local path to store the backup file.
-      packages: List of to packages to be backed up.
-      apk: (optional) If set include the .apk files in the archive.
-      shared: (optional) If set buckup the device's SD card.
-      nosystem: (optional) If set exclude system applications.
-      include_all: (optional) If set back up all installed applications and
-        |packages| is optional.
-      timeout: (optional) Timeout per try in seconds.
-      retries: (optional) Number of retries to attempt.
-    """
-    cmd = ['backup', '-f', path]
-    if apk:
-      cmd.append('-apk')
-    if shared:
-      cmd.append('-shared')
-    if nosystem:
-      cmd.append('-nosystem')
-    if include_all:
-      cmd.append('-all')
-    if packages:
-      cmd.extend(packages)
-    assert bool(packages) ^ bool(include_all), (
-        'Provide \'packages\' or set \'include_all\' but not both.')
-    ret = self._RunDeviceAdbCmd(cmd, timeout, retries)
-    _VerifyLocalFileExists(path)
-    return ret
-
-  def Restore(self, path, timeout=_DEFAULT_TIMEOUT, retries=_DEFAULT_RETRIES):
-    """Restore device contents from the backup archive.
-
-    Args:
-      path: Host path to the backup archive.
-      timeout: (optional) Timeout per try in seconds.
-      retries: (optional) Number of retries to attempt.
-    """
-    _VerifyLocalFileExists(path)
-    self._RunDeviceAdbCmd(['restore'] + [path], timeout, retries)
-
-  def WaitForDevice(self, timeout=60*5, retries=_DEFAULT_RETRIES):
-    """Block until the device is online.
-
-    Args:
-      timeout: (optional) Timeout per try in seconds.
-      retries: (optional) Number of retries to attempt.
-    """
-    self._RunDeviceAdbCmd(['wait-for-device'], timeout, retries)
-
-  def GetState(self, timeout=_DEFAULT_TIMEOUT, retries=_DEFAULT_RETRIES):
-    """Get device state.
-
-    Args:
-      timeout: (optional) Timeout per try in seconds.
-      retries: (optional) Number of retries to attempt.
-
-    Returns:
-      One of 'offline', 'bootloader', or 'device'.
-    """
-    return self._RunDeviceAdbCmd(['get-state'], timeout, retries).strip()
-
-  def GetDevPath(self, timeout=_DEFAULT_TIMEOUT, retries=_DEFAULT_RETRIES):
-    """Gets the device path.
-
-    Args:
-      timeout: (optional) Timeout per try in seconds.
-      retries: (optional) Number of retries to attempt.
-
-    Returns:
-      The device path (e.g. usb:3-4)
-    """
-    return self._RunDeviceAdbCmd(['get-devpath'], timeout, retries)
-
-  def Remount(self, timeout=_DEFAULT_TIMEOUT, retries=_DEFAULT_RETRIES):
-    """Remounts the /system partition on the device read-write."""
-    self._RunDeviceAdbCmd(['remount'], timeout, retries)
-
-  def Reboot(self, to_bootloader=False, timeout=60*5,
-             retries=_DEFAULT_RETRIES):
-    """Reboots the device.
-
-    Args:
-      to_bootloader: (optional) If set reboots to the bootloader.
-      timeout: (optional) Timeout per try in seconds.
-      retries: (optional) Number of retries to attempt.
-    """
-    if to_bootloader:
-      cmd = ['reboot-bootloader']
-    else:
-      cmd = ['reboot']
-    self._RunDeviceAdbCmd(cmd, timeout, retries)
-
-  def Root(self, timeout=_DEFAULT_TIMEOUT, retries=_DEFAULT_RETRIES):
-    """Restarts the adbd daemon with root permissions, if possible.
-
-    Args:
-      timeout: (optional) Timeout per try in seconds.
-      retries: (optional) Number of retries to attempt.
-    """
-    output = self._RunDeviceAdbCmd(['root'], timeout, retries)
-    if 'cannot' in output:
-      raise device_errors.AdbCommandFailedError(
-          ['root'], output, device_serial=self._device_serial)
-
-  def Emu(self, cmd, timeout=_DEFAULT_TIMEOUT,
-               retries=_DEFAULT_RETRIES):
-    """Runs an emulator console command.
-
-    See http://developer.android.com/tools/devices/emulator.html#console
-
-    Args:
-      cmd: The command to run on the emulator console.
-      timeout: (optional) Timeout per try in seconds.
-      retries: (optional) Number of retries to attempt.
-
-    Returns:
-      The output of the emulator console command.
-    """
-    if isinstance(cmd, basestring):
-      cmd = [cmd]
-    return self._RunDeviceAdbCmd(['emu'] + cmd, timeout, retries)
-
-  @property
-  def is_emulator(self):
-    return _EMULATOR_RE.match(self._device_serial)
-
-  @property
-  def is_ready(self):
-    try:
-      return self.GetState() == _READY_STATE
-    except device_errors.CommandFailedError:
-      return False
diff --git a/build/android/pylib/device/adb_wrapper_test.py b/build/android/pylib/device/adb_wrapper_test.py
deleted file mode 100644
index 5fc9eb6..0000000
--- a/build/android/pylib/device/adb_wrapper_test.py
+++ /dev/null
@@ -1,96 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Tests for the AdbWrapper class."""
-
-import os
-import tempfile
-import time
-import unittest
-
-from pylib.device import adb_wrapper
-from pylib.device import device_errors
-
-
-class TestAdbWrapper(unittest.TestCase):
-
-  def setUp(self):
-    devices = adb_wrapper.AdbWrapper.Devices()
-    assert devices, 'A device must be attached'
-    self._adb = devices[0]
-    self._adb.WaitForDevice()
-
-  @staticmethod
-  def _MakeTempFile(contents):
-    """Make a temporary file with the given contents.
-
-    Args:
-      contents: string to write to the temporary file.
-
-    Returns:
-      The absolute path to the file.
-    """
-    fi, path = tempfile.mkstemp()
-    with os.fdopen(fi, 'wb') as f:
-      f.write(contents)
-    return path
-
-  def testShell(self):
-    output = self._adb.Shell('echo test', expect_status=0)
-    self.assertEqual(output.strip(), 'test')
-    output = self._adb.Shell('echo test')
-    self.assertEqual(output.strip(), 'test')
-    with self.assertRaises(device_errors.AdbCommandFailedError):
-        self._adb.Shell('echo test', expect_status=1)
-
-  def testPushLsPull(self):
-    path = self._MakeTempFile('foo')
-    device_path = '/data/local/tmp/testfile.txt'
-    local_tmpdir = os.path.dirname(path)
-    self._adb.Push(path, device_path)
-    files = dict(self._adb.Ls('/data/local/tmp'))
-    self.assertTrue('testfile.txt' in files)
-    self.assertEquals(3, files['testfile.txt'].st_size)
-    self.assertEqual(self._adb.Shell('cat %s' % device_path), 'foo')
-    self._adb.Pull(device_path, local_tmpdir)
-    with open(os.path.join(local_tmpdir, 'testfile.txt'), 'r') as f:
-      self.assertEqual(f.read(), 'foo')
-
-  def testInstall(self):
-    path = self._MakeTempFile('foo')
-    with self.assertRaises(device_errors.AdbCommandFailedError):
-      self._adb.Install(path)
-
-  def testForward(self):
-    with self.assertRaises(device_errors.AdbCommandFailedError):
-      self._adb.Forward(0, 0)
-
-  def testUninstall(self):
-    with self.assertRaises(device_errors.AdbCommandFailedError):
-      self._adb.Uninstall('some.nonexistant.package')
-
-  def testRebootWaitForDevice(self):
-    self._adb.Reboot()
-    print 'waiting for device to reboot...'
-    while self._adb.GetState() == 'device':
-      time.sleep(1)
-    self._adb.WaitForDevice()
-    self.assertEqual(self._adb.GetState(), 'device')
-    print 'waiting for package manager...'
-    while 'package:' not in self._adb.Shell('pm path android'):
-      time.sleep(1)
-
-  def testRootRemount(self):
-    self._adb.Root()
-    while True:
-      try:
-        self._adb.Shell('start')
-        break
-      except device_errors.AdbCommandFailedError:
-        time.sleep(1)
-    self._adb.Remount()
-
-
-if __name__ == '__main__':
-  unittest.main()
diff --git a/build/android/pylib/device/battery_utils.py b/build/android/pylib/device/battery_utils.py
deleted file mode 100644
index eab558e..0000000
--- a/build/android/pylib/device/battery_utils.py
+++ /dev/null
@@ -1,593 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Provides a variety of device interactions with power.
-"""
-# pylint: disable=unused-argument
-
-import collections
-import contextlib
-import csv
-import logging
-
-from pylib import constants
-from pylib.device import decorators
-from pylib.device import device_errors
-from pylib.device import device_utils
-from pylib.utils import timeout_retry
-
-_DEFAULT_TIMEOUT = 30
-_DEFAULT_RETRIES = 3
-
-
-_DEVICE_PROFILES = [
-  {
-    'name': 'Nexus 4',
-    'witness_file': '/sys/module/pm8921_charger/parameters/disabled',
-    'enable_command': (
-        'echo 0 > /sys/module/pm8921_charger/parameters/disabled && '
-        'dumpsys battery reset'),
-    'disable_command': (
-        'echo 1 > /sys/module/pm8921_charger/parameters/disabled && '
-        'dumpsys battery set ac 0 && dumpsys battery set usb 0'),
-    'charge_counter': None,
-    'voltage': None,
-    'current': None,
-  },
-  {
-    'name': 'Nexus 5',
-    # Nexus 5
-    # Setting the HIZ bit of the bq24192 causes the charger to actually ignore
-    # energy coming from USB. Setting the power_supply offline just updates the
-    # Android system to reflect that.
-    'witness_file': '/sys/kernel/debug/bq24192/INPUT_SRC_CONT',
-    'enable_command': (
-        'echo 0x4A > /sys/kernel/debug/bq24192/INPUT_SRC_CONT && '
-        'echo 1 > /sys/class/power_supply/usb/online &&'
-        'dumpsys battery reset'),
-    'disable_command': (
-        'echo 0xCA > /sys/kernel/debug/bq24192/INPUT_SRC_CONT && '
-        'chmod 644 /sys/class/power_supply/usb/online && '
-        'echo 0 > /sys/class/power_supply/usb/online && '
-        'dumpsys battery set ac 0 && dumpsys battery set usb 0'),
-    'charge_counter': None,
-    'voltage': None,
-    'current': None,
-  },
-  {
-    'name': 'Nexus 6',
-    'witness_file': None,
-    'enable_command': (
-        'echo 1 > /sys/class/power_supply/battery/charging_enabled && '
-        'dumpsys battery reset'),
-    'disable_command': (
-        'echo 0 > /sys/class/power_supply/battery/charging_enabled && '
-        'dumpsys battery set ac 0 && dumpsys battery set usb 0'),
-    'charge_counter': (
-        '/sys/class/power_supply/max170xx_battery/charge_counter_ext'),
-    'voltage': '/sys/class/power_supply/max170xx_battery/voltage_now',
-    'current': '/sys/class/power_supply/max170xx_battery/current_now',
-  },
-  {
-    'name': 'Nexus 9',
-    'witness_file': None,
-    'enable_command': (
-        'echo Disconnected > '
-        '/sys/bus/i2c/drivers/bq2419x/0-006b/input_cable_state && '
-        'dumpsys battery reset'),
-    'disable_command': (
-        'echo Connected > '
-        '/sys/bus/i2c/drivers/bq2419x/0-006b/input_cable_state && '
-        'dumpsys battery set ac 0 && dumpsys battery set usb 0'),
-    'charge_counter': '/sys/class/power_supply/battery/charge_counter_ext',
-    'voltage': '/sys/class/power_supply/battery/voltage_now',
-    'current': '/sys/class/power_supply/battery/current_now',
-  },
-  {
-    'name': 'Nexus 10',
-    'witness_file': None,
-    'enable_command': None,
-    'disable_command': None,
-    'charge_counter': None,
-    'voltage': '/sys/class/power_supply/ds2784-fuelgauge/voltage_now',
-    'current': '/sys/class/power_supply/ds2784-fuelgauge/current_now',
-
-  },
-]
-
-# The list of useful dumpsys columns.
-# Index of the column containing the format version.
-_DUMP_VERSION_INDEX = 0
-# Index of the column containing the type of the row.
-_ROW_TYPE_INDEX = 3
-# Index of the column containing the uid.
-_PACKAGE_UID_INDEX = 4
-# Index of the column containing the application package.
-_PACKAGE_NAME_INDEX = 5
-# The column containing the uid of the power data.
-_PWI_UID_INDEX = 1
-# The column containing the type of consumption. Only consumtion since last
-# charge are of interest here.
-_PWI_AGGREGATION_INDEX = 2
-# The column containing the amount of power used, in mah.
-_PWI_POWER_CONSUMPTION_INDEX = 5
-
-
-class BatteryUtils(object):
-
-  def __init__(self, device, default_timeout=_DEFAULT_TIMEOUT,
-               default_retries=_DEFAULT_RETRIES):
-    """BatteryUtils constructor.
-
-      Args:
-        device: A DeviceUtils instance.
-        default_timeout: An integer containing the default number of seconds to
-                         wait for an operation to complete if no explicit value
-                         is provided.
-        default_retries: An integer containing the default number or times an
-                         operation should be retried on failure if no explicit
-                         value is provided.
-
-      Raises:
-        TypeError: If it is not passed a DeviceUtils instance.
-    """
-    if not isinstance(device, device_utils.DeviceUtils):
-      raise TypeError('Must be initialized with DeviceUtils object.')
-    self._device = device
-    self._cache = device.GetClientCache(self.__class__.__name__)
-    self._default_timeout = default_timeout
-    self._default_retries = default_retries
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def SupportsFuelGauge(self, timeout=None, retries=None):
-    """Detect if fuel gauge chip is present.
-
-    Args:
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Returns:
-      True if known fuel gauge files are present.
-      False otherwise.
-    """
-    self._DiscoverDeviceProfile()
-    return (self._cache['profile']['enable_command'] != None
-        and self._cache['profile']['charge_counter'] != None)
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def GetFuelGaugeChargeCounter(self, timeout=None, retries=None):
-    """Get value of charge_counter on fuel gauge chip.
-
-    Device must have charging disabled for this, not just battery updates
-    disabled. The only device that this currently works with is the nexus 5.
-
-    Args:
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Returns:
-      value of charge_counter for fuel gauge chip in units of nAh.
-
-    Raises:
-      device_errors.CommandFailedError: If fuel gauge chip not found.
-    """
-    if self.SupportsFuelGauge():
-       return int(self._device.ReadFile(
-          self._cache['profile']['charge_counter']))
-    raise device_errors.CommandFailedError(
-        'Unable to find fuel gauge.')
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def GetNetworkData(self, package, timeout=None, retries=None):
-    """Get network data for specific package.
-
-    Args:
-      package: package name you want network data for.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Returns:
-      Tuple of (sent_data, recieved_data)
-      None if no network data found
-    """
-    # If device_utils clears cache, cache['uids'] doesn't exist
-    if 'uids' not in self._cache:
-      self._cache['uids'] = {}
-    if package not in self._cache['uids']:
-      self.GetPowerData()
-      if package not in self._cache['uids']:
-        logging.warning('No UID found for %s. Can\'t get network data.',
-                        package)
-        return None
-
-    network_data_path = '/proc/uid_stat/%s/' % self._cache['uids'][package]
-    try:
-      send_data = int(self._device.ReadFile(network_data_path + 'tcp_snd'))
-    # If ReadFile throws exception, it means no network data usage file for
-    # package has been recorded. Return 0 sent and 0 received.
-    except device_errors.AdbShellCommandFailedError:
-      logging.warning('No sent data found for package %s', package)
-      send_data = 0
-    try:
-      recv_data = int(self._device.ReadFile(network_data_path + 'tcp_rcv'))
-    except device_errors.AdbShellCommandFailedError:
-      logging.warning('No received data found for package %s', package)
-      recv_data = 0
-    return (send_data, recv_data)
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def GetPowerData(self, timeout=None, retries=None):
-    """Get power data for device.
-
-    Args:
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Returns:
-      Dict of power data, keyed on package names.
-      {
-        package_name: {
-          'uid': uid,
-          'data': [1,2,3]
-        },
-      }
-    """
-    if 'uids' not in self._cache:
-      self._cache['uids'] = {}
-    dumpsys_output = self._device.RunShellCommand(
-        ['dumpsys', 'batterystats', '-c'], check_return=True)
-    csvreader = csv.reader(dumpsys_output)
-    pwi_entries = collections.defaultdict(list)
-    for entry in csvreader:
-      if entry[_DUMP_VERSION_INDEX] not in ['8', '9']:
-        # Wrong dumpsys version.
-        raise device_errors.DeviceVersionError(
-            'Dumpsys version must be 8 or 9. %s found.'
-            % entry[_DUMP_VERSION_INDEX])
-      if _ROW_TYPE_INDEX < len(entry) and entry[_ROW_TYPE_INDEX] == 'uid':
-        current_package = entry[_PACKAGE_NAME_INDEX]
-        if (self._cache['uids'].get(current_package)
-            and self._cache['uids'].get(current_package)
-            != entry[_PACKAGE_UID_INDEX]):
-          raise device_errors.CommandFailedError(
-              'Package %s found multiple times with differnt UIDs %s and %s'
-               % (current_package, self._cache['uids'][current_package],
-               entry[_PACKAGE_UID_INDEX]))
-        self._cache['uids'][current_package] = entry[_PACKAGE_UID_INDEX]
-      elif (_PWI_POWER_CONSUMPTION_INDEX < len(entry)
-          and entry[_ROW_TYPE_INDEX] == 'pwi'
-          and entry[_PWI_AGGREGATION_INDEX] == 'l'):
-        pwi_entries[entry[_PWI_UID_INDEX]].append(
-            float(entry[_PWI_POWER_CONSUMPTION_INDEX]))
-
-    return {p: {'uid': uid, 'data': pwi_entries[uid]}
-            for p, uid in self._cache['uids'].iteritems()}
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def GetPackagePowerData(self, package, timeout=None, retries=None):
-    """Get power data for particular package.
-
-    Args:
-      package: Package to get power data on.
-
-    returns:
-      Dict of UID and power data.
-      {
-        'uid': uid,
-        'data': [1,2,3]
-      }
-      None if the package is not found in the power data.
-    """
-    return self.GetPowerData().get(package)
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def GetBatteryInfo(self, timeout=None, retries=None):
-    """Gets battery info for the device.
-
-    Args:
-      timeout: timeout in seconds
-      retries: number of retries
-    Returns:
-      A dict containing various battery information as reported by dumpsys
-      battery.
-    """
-    result = {}
-    # Skip the first line, which is just a header.
-    for line in self._device.RunShellCommand(
-        ['dumpsys', 'battery'], check_return=True)[1:]:
-      # If usb charging has been disabled, an extra line of header exists.
-      if 'UPDATES STOPPED' in line:
-        logging.warning('Dumpsys battery not receiving updates. '
-                        'Run dumpsys battery reset if this is in error.')
-      elif ':' not in line:
-        logging.warning('Unknown line found in dumpsys battery: "%s"', line)
-      else:
-        k, v = line.split(':', 1)
-        result[k.strip()] = v.strip()
-    return result
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def GetCharging(self, timeout=None, retries=None):
-    """Gets the charging state of the device.
-
-    Args:
-      timeout: timeout in seconds
-      retries: number of retries
-    Returns:
-      True if the device is charging, false otherwise.
-    """
-    battery_info = self.GetBatteryInfo()
-    for k in ('AC powered', 'USB powered', 'Wireless powered'):
-      if (k in battery_info and
-          battery_info[k].lower() in ('true', '1', 'yes')):
-        return True
-    return False
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def SetCharging(self, enabled, timeout=None, retries=None):
-    """Enables or disables charging on the device.
-
-    Args:
-      enabled: A boolean indicating whether charging should be enabled or
-        disabled.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Raises:
-      device_errors.CommandFailedError: If method of disabling charging cannot
-        be determined.
-    """
-    self._DiscoverDeviceProfile()
-    if not self._cache['profile']['enable_command']:
-      raise device_errors.CommandFailedError(
-          'Unable to find charging commands.')
-
-    if enabled:
-      command = self._cache['profile']['enable_command']
-    else:
-      command = self._cache['profile']['disable_command']
-
-    def set_and_verify_charging():
-      self._device.RunShellCommand(command, check_return=True)
-      return self.GetCharging() == enabled
-
-    timeout_retry.WaitFor(set_and_verify_charging, wait_period=1)
-
-  # TODO(rnephew): Make private when all use cases can use the context manager.
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def DisableBatteryUpdates(self, timeout=None, retries=None):
-    """Resets battery data and makes device appear like it is not
-    charging so that it will collect power data since last charge.
-
-    Args:
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Raises:
-      device_errors.CommandFailedError: When resetting batterystats fails to
-        reset power values.
-      device_errors.DeviceVersionError: If device is not L or higher.
-    """
-    def battery_updates_disabled():
-      return self.GetCharging() is False
-
-    self._ClearPowerData()
-    self._device.RunShellCommand(['dumpsys', 'battery', 'set', 'ac', '0'],
-                                 check_return=True)
-    self._device.RunShellCommand(['dumpsys', 'battery', 'set', 'usb', '0'],
-                                 check_return=True)
-    timeout_retry.WaitFor(battery_updates_disabled, wait_period=1)
-
-  # TODO(rnephew): Make private when all use cases can use the context manager.
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def EnableBatteryUpdates(self, timeout=None, retries=None):
-    """Restarts device charging so that dumpsys no longer collects power data.
-
-    Args:
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Raises:
-      device_errors.DeviceVersionError: If device is not L or higher.
-    """
-    def battery_updates_enabled():
-      return (self.GetCharging()
-              or not bool('UPDATES STOPPED' in self._device.RunShellCommand(
-                  ['dumpsys', 'battery'], check_return=True)))
-
-    self._device.RunShellCommand(['dumpsys', 'battery', 'reset'],
-                                 check_return=True)
-    timeout_retry.WaitFor(battery_updates_enabled, wait_period=1)
-
-  @contextlib.contextmanager
-  def BatteryMeasurement(self, timeout=None, retries=None):
-    """Context manager that enables battery data collection. It makes
-    the device appear to stop charging so that dumpsys will start collecting
-    power data since last charge. Once the with block is exited, charging is
-    resumed and power data since last charge is no longer collected.
-
-    Only for devices L and higher.
-
-    Example usage:
-      with BatteryMeasurement():
-        browser_actions()
-        get_power_data() # report usage within this block
-      after_measurements() # Anything that runs after power
-                           # measurements are collected
-
-    Args:
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Raises:
-      device_errors.DeviceVersionError: If device is not L or higher.
-    """
-    if (self._device.build_version_sdk <
-        constants.ANDROID_SDK_VERSION_CODES.LOLLIPOP):
-      raise device_errors.DeviceVersionError('Device must be L or higher.')
-    try:
-      self.DisableBatteryUpdates(timeout=timeout, retries=retries)
-      yield
-    finally:
-      self.EnableBatteryUpdates(timeout=timeout, retries=retries)
-
-  def ChargeDeviceToLevel(self, level, wait_period=60):
-    """Enables charging and waits for device to be charged to given level.
-
-    Args:
-      level: level of charge to wait for.
-      wait_period: time in seconds to wait between checking.
-    """
-    self.SetCharging(True)
-
-    def device_charged():
-      battery_level = self.GetBatteryInfo().get('level')
-      if battery_level is None:
-        logging.warning('Unable to find current battery level.')
-        battery_level = 100
-      else:
-        logging.info('current battery level: %s', battery_level)
-        battery_level = int(battery_level)
-      return battery_level >= level
-
-    timeout_retry.WaitFor(device_charged, wait_period=wait_period)
-
-  def LetBatteryCoolToTemperature(self, target_temp, wait_period=60):
-    """Lets device sit to give battery time to cool down
-    Args:
-      temp: maximum temperature to allow in tenths of degrees c.
-      wait_period: time in seconds to wait between checking.
-    """
-    def cool_device():
-      temp = self.GetBatteryInfo().get('temperature')
-      if temp is None:
-        logging.warning('Unable to find current battery temperature.')
-        temp = 0
-      else:
-        logging.info('Current battery temperature: %s', temp)
-      return int(temp) <= target_temp
-    self.EnableBatteryUpdates()
-    logging.info('Waiting for the device to cool down to %s (0.1 C)',
-                 target_temp)
-    timeout_retry.WaitFor(cool_device, wait_period=wait_period)
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def TieredSetCharging(self, enabled, timeout=None, retries=None):
-    """Enables or disables charging on the device.
-
-    Args:
-      enabled: A boolean indicating whether charging should be enabled or
-        disabled.
-      timeout: timeout in seconds
-      retries: number of retries
-    """
-    if self.GetCharging() == enabled:
-      logging.warning('Device charging already in expected state: %s', enabled)
-      return
-
-    if enabled:
-      try:
-        self.SetCharging(enabled)
-      except device_errors.CommandFailedError:
-        logging.info('Unable to enable charging via hardware.'
-                     ' Falling back to software enabling.')
-        self.EnableBatteryUpdates()
-    else:
-      try:
-        self._ClearPowerData()
-        self.SetCharging(enabled)
-      except device_errors.CommandFailedError:
-        logging.info('Unable to disable charging via hardware.'
-                     ' Falling back to software disabling.')
-        self.DisableBatteryUpdates()
-
-  @contextlib.contextmanager
-  def PowerMeasurement(self, timeout=None, retries=None):
-    """Context manager that enables battery power collection.
-
-    Once the with block is exited, charging is resumed. Will attempt to disable
-    charging at the hardware level, and if that fails will fall back to software
-    disabling of battery updates.
-
-    Only for devices L and higher.
-
-    Example usage:
-      with PowerMeasurement():
-        browser_actions()
-        get_power_data() # report usage within this block
-      after_measurements() # Anything that runs after power
-                           # measurements are collected
-
-    Args:
-      timeout: timeout in seconds
-      retries: number of retries
-    """
-    try:
-      self.TieredSetCharging(False, timeout=timeout, retries=retries)
-      yield
-    finally:
-      self.TieredSetCharging(True, timeout=timeout, retries=retries)
-
-  def _ClearPowerData(self):
-    """Resets battery data and makes device appear like it is not
-    charging so that it will collect power data since last charge.
-
-    Returns:
-      True if power data cleared.
-      False if power data clearing is not supported (pre-L)
-
-    Raises:
-      device_errors.DeviceVersionError: If power clearing is supported,
-        but fails.
-    """
-    if (self._device.build_version_sdk <
-        constants.ANDROID_SDK_VERSION_CODES.LOLLIPOP):
-      logging.warning('Dumpsys power data only available on 5.0 and above. '
-                      'Cannot clear power data.')
-      return False
-
-    self._device.RunShellCommand(
-        ['dumpsys', 'battery', 'set', 'usb', '1'], check_return=True)
-    self._device.RunShellCommand(
-        ['dumpsys', 'battery', 'set', 'ac', '1'], check_return=True)
-    self._device.RunShellCommand(
-        ['dumpsys', 'batterystats', '--reset'], check_return=True)
-    battery_data = self._device.RunShellCommand(
-        ['dumpsys', 'batterystats', '--charged', '--checkin'],
-        check_return=True, large_output=True)
-    for line in battery_data:
-      l = line.split(',')
-      if (len(l) > _PWI_POWER_CONSUMPTION_INDEX and l[_ROW_TYPE_INDEX] == 'pwi'
-          and l[_PWI_POWER_CONSUMPTION_INDEX] != 0):
-        self._device.RunShellCommand(
-            ['dumpsys', 'battery', 'reset'], check_return=True)
-        raise device_errors.CommandFailedError(
-            'Non-zero pmi value found after reset.')
-    self._device.RunShellCommand(
-        ['dumpsys', 'battery', 'reset'], check_return=True)
-    return True
-
-  def _DiscoverDeviceProfile(self):
-    """Checks and caches device information.
-
-    Returns:
-      True if profile is found, false otherwise.
-    """
-
-    if 'profile' in self._cache:
-      return True
-    for profile in _DEVICE_PROFILES:
-      if self._device.product_model == profile['name']:
-        self._cache['profile'] = profile
-        return True
-    self._cache['profile'] = {
-        'name': None,
-        'witness_file': None,
-        'enable_command': None,
-        'disable_command': None,
-        'charge_counter': None,
-        'voltage': None,
-        'current': None,
-    }
-    return False
diff --git a/build/android/pylib/device/battery_utils_test.py b/build/android/pylib/device/battery_utils_test.py
deleted file mode 100755
index b968fa6..0000000
--- a/build/android/pylib/device/battery_utils_test.py
+++ /dev/null
@@ -1,574 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-Unit tests for the contents of battery_utils.py
-"""
-
-# pylint: disable=W0613
-
-import logging
-import os
-import sys
-import unittest
-
-from pylib import constants
-from pylib.device import battery_utils
-from pylib.device import device_errors
-from pylib.device import device_utils
-from pylib.device import device_utils_test
-from pylib.utils import mock_calls
-
-# RunCommand from third_party/android_testrunner/run_command.py is mocked
-# below, so its path needs to be in sys.path.
-sys.path.append(os.path.join(
-    constants.DIR_SOURCE_ROOT, 'third_party', 'android_testrunner'))
-
-sys.path.append(os.path.join(
-    constants.DIR_SOURCE_ROOT, 'third_party', 'pymock'))
-import mock # pylint: disable=F0401
-
-_DUMPSYS_OUTPUT = [
-    '9,0,i,uid,1000,test_package1',
-    '9,0,i,uid,1001,test_package2',
-    '9,1000,l,pwi,uid,1',
-    '9,1001,l,pwi,uid,2'
-]
-
-
-class BatteryUtilsTest(mock_calls.TestCase):
-
-  _NEXUS_5 = {
-    'name': 'Nexus 5',
-    'witness_file': '/sys/kernel/debug/bq24192/INPUT_SRC_CONT',
-    'enable_command': (
-        'echo 0x4A > /sys/kernel/debug/bq24192/INPUT_SRC_CONT && '
-        'echo 1 > /sys/class/power_supply/usb/online'),
-    'disable_command': (
-        'echo 0xCA > /sys/kernel/debug/bq24192/INPUT_SRC_CONT && '
-        'chmod 644 /sys/class/power_supply/usb/online && '
-        'echo 0 > /sys/class/power_supply/usb/online'),
-    'charge_counter': None,
-    'voltage': None,
-    'current': None,
-  }
-
-  _NEXUS_6 = {
-    'name': 'Nexus 6',
-    'witness_file': None,
-    'enable_command': None,
-    'disable_command': None,
-    'charge_counter': (
-        '/sys/class/power_supply/max170xx_battery/charge_counter_ext'),
-    'voltage': '/sys/class/power_supply/max170xx_battery/voltage_now',
-    'current': '/sys/class/power_supply/max170xx_battery/current_now',
-  }
-
-  _NEXUS_10 = {
-    'name': 'Nexus 10',
-    'witness_file': None,
-    'enable_command': None,
-    'disable_command': None,
-    'charge_counter': (
-        '/sys/class/power_supply/ds2784-fuelgauge/charge_counter_ext'),
-    'voltage': '/sys/class/power_supply/ds2784-fuelgauge/voltage_now',
-    'current': '/sys/class/power_supply/ds2784-fuelgauge/current_now',
-  }
-
-  def ShellError(self, output=None, status=1):
-    def action(cmd, *args, **kwargs):
-      raise device_errors.AdbShellCommandFailedError(
-          cmd, output, status, str(self.device))
-    if output is None:
-      output = 'Permission denied\n'
-    return action
-
-  def setUp(self):
-    self.adb = device_utils_test._AdbWrapperMock('0123456789abcdef')
-    self.device = device_utils.DeviceUtils(
-        self.adb, default_timeout=10, default_retries=0)
-    self.watchMethodCalls(self.call.adb, ignore=['GetDeviceSerial'])
-    self.battery = battery_utils.BatteryUtils(
-        self.device, default_timeout=10, default_retries=0)
-
-
-class BatteryUtilsInitTest(unittest.TestCase):
-
-  def testInitWithDeviceUtil(self):
-    serial = '0fedcba987654321'
-    d = device_utils.DeviceUtils(serial)
-    b = battery_utils.BatteryUtils(d)
-    self.assertEqual(d, b._device)
-
-  def testInitWithMissing_fails(self):
-    with self.assertRaises(TypeError):
-      battery_utils.BatteryUtils(None)
-    with self.assertRaises(TypeError):
-      battery_utils.BatteryUtils('')
-
-
-class BatteryUtilsSetChargingTest(BatteryUtilsTest):
-
-  @mock.patch('time.sleep', mock.Mock())
-  def testSetCharging_enabled(self):
-    self.battery._cache['profile'] = self._NEXUS_5
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(mock.ANY, check_return=True), []),
-        (self.call.battery.GetCharging(), False),
-        (self.call.device.RunShellCommand(mock.ANY, check_return=True), []),
-        (self.call.battery.GetCharging(), True)):
-      self.battery.SetCharging(True)
-
-  def testSetCharging_alreadyEnabled(self):
-    self.battery._cache['profile'] = self._NEXUS_5
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(mock.ANY, check_return=True), []),
-        (self.call.battery.GetCharging(), True)):
-      self.battery.SetCharging(True)
-
-  @mock.patch('time.sleep', mock.Mock())
-  def testSetCharging_disabled(self):
-    self.battery._cache['profile'] = self._NEXUS_5
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(mock.ANY, check_return=True), []),
-        (self.call.battery.GetCharging(), True),
-        (self.call.device.RunShellCommand(mock.ANY, check_return=True), []),
-        (self.call.battery.GetCharging(), False)):
-      self.battery.SetCharging(False)
-
-
-class BatteryUtilsSetBatteryMeasurementTest(BatteryUtilsTest):
-
-  @mock.patch('time.sleep', mock.Mock())
-  def testBatteryMeasurementWifi(self):
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(
-            mock.ANY, retries=0, single_line=True,
-            timeout=10, check_return=True), '22'),
-        (self.call.battery._ClearPowerData(), True),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'battery', 'set', 'ac', '0'], check_return=True), []),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'battery', 'set', 'usb', '0'], check_return=True), []),
-        (self.call.battery.GetCharging(), False),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'battery', 'reset'], check_return=True), []),
-        (self.call.battery.GetCharging(), False),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'battery'], check_return=True), ['UPDATES STOPPED']),
-        (self.call.battery.GetCharging(), False),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'battery'], check_return=True), [])):
-      with self.battery.BatteryMeasurement():
-        pass
-
-  @mock.patch('time.sleep', mock.Mock())
-  def testBatteryMeasurementUsb(self):
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(
-            mock.ANY, retries=0, single_line=True,
-            timeout=10, check_return=True), '22'),
-        (self.call.battery._ClearPowerData(), True),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'battery', 'set', 'ac', '0'], check_return=True), []),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'battery', 'set', 'usb', '0'], check_return=True), []),
-        (self.call.battery.GetCharging(), False),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'battery', 'reset'], check_return=True), []),
-        (self.call.battery.GetCharging(), False),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'battery'], check_return=True), ['UPDATES STOPPED']),
-        (self.call.battery.GetCharging(), True)):
-      with self.battery.BatteryMeasurement():
-        pass
-
-
-class BatteryUtilsGetPowerData(BatteryUtilsTest):
-
-  def testGetPowerData(self):
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'batterystats', '-c'], check_return=True),
-            _DUMPSYS_OUTPUT)):
-      data = self.battery.GetPowerData()
-      check = {
-          'test_package1': {'uid': '1000', 'data': [1.0]},
-          'test_package2': {'uid': '1001', 'data': [2.0]}
-      }
-      self.assertEqual(data, check)
-
-  def testGetPowerData_packageCollisionSame(self):
-      self.battery._cache['uids'] = {'test_package1': '1000'}
-      with self.assertCall(
-        self.call.device.RunShellCommand(
-            ['dumpsys', 'batterystats', '-c'], check_return=True),
-            _DUMPSYS_OUTPUT):
-        data = self.battery.GetPowerData()
-        check = {
-            'test_package1': {'uid': '1000', 'data': [1.0]},
-            'test_package2': {'uid': '1001', 'data': [2.0]}
-        }
-        self.assertEqual(data, check)
-
-  def testGetPowerData_packageCollisionDifferent(self):
-      self.battery._cache['uids'] = {'test_package1': '1'}
-      with self.assertCall(
-        self.call.device.RunShellCommand(
-            ['dumpsys', 'batterystats', '-c'], check_return=True),
-            _DUMPSYS_OUTPUT):
-        with self.assertRaises(device_errors.CommandFailedError):
-          self.battery.GetPowerData()
-
-  def testGetPowerData_cacheCleared(self):
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'batterystats', '-c'], check_return=True),
-            _DUMPSYS_OUTPUT)):
-      self.battery._cache.clear()
-      data = self.battery.GetPowerData()
-      check = {
-          'test_package1': {'uid': '1000', 'data': [1.0]},
-          'test_package2': {'uid': '1001', 'data': [2.0]}
-      }
-      self.assertEqual(data, check)
-
-  def testGetPackagePowerData(self):
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'batterystats', '-c'], check_return=True),
-            _DUMPSYS_OUTPUT)):
-      data = self.battery.GetPackagePowerData('test_package2')
-      self.assertEqual(data, {'uid': '1001', 'data': [2.0]})
-
-  def testGetPackagePowerData_badPackage(self):
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'batterystats', '-c'], check_return=True),
-            _DUMPSYS_OUTPUT)):
-      data = self.battery.GetPackagePowerData('not_a_package')
-      self.assertEqual(data, None)
-
-
-class BatteryUtilsChargeDevice(BatteryUtilsTest):
-
-  @mock.patch('time.sleep', mock.Mock())
-  def testChargeDeviceToLevel(self):
-    with self.assertCalls(
-        (self.call.battery.SetCharging(True)),
-        (self.call.battery.GetBatteryInfo(), {'level': '50'}),
-        (self.call.battery.GetBatteryInfo(), {'level': '100'})):
-      self.battery.ChargeDeviceToLevel(95)
-
-
-class BatteryUtilsGetBatteryInfoTest(BatteryUtilsTest):
-
-  def testGetBatteryInfo_normal(self):
-    with self.assertCall(
-        self.call.device.RunShellCommand(
-            ['dumpsys', 'battery'], check_return=True),
-        [
-          'Current Battery Service state:',
-          '  AC powered: false',
-          '  USB powered: true',
-          '  level: 100',
-          '  temperature: 321',
-        ]):
-      self.assertEquals(
-          {
-            'AC powered': 'false',
-            'USB powered': 'true',
-            'level': '100',
-            'temperature': '321',
-          },
-          self.battery.GetBatteryInfo())
-
-  def testGetBatteryInfo_nothing(self):
-    with self.assertCall(
-        self.call.device.RunShellCommand(
-            ['dumpsys', 'battery'], check_return=True), []):
-      self.assertEquals({}, self.battery.GetBatteryInfo())
-
-
-class BatteryUtilsGetChargingTest(BatteryUtilsTest):
-
-  def testGetCharging_usb(self):
-    with self.assertCall(
-        self.call.battery.GetBatteryInfo(), {'USB powered': 'true'}):
-      self.assertTrue(self.battery.GetCharging())
-
-  def testGetCharging_usbFalse(self):
-    with self.assertCall(
-        self.call.battery.GetBatteryInfo(), {'USB powered': 'false'}):
-      self.assertFalse(self.battery.GetCharging())
-
-  def testGetCharging_ac(self):
-    with self.assertCall(
-        self.call.battery.GetBatteryInfo(), {'AC powered': 'true'}):
-      self.assertTrue(self.battery.GetCharging())
-
-  def testGetCharging_wireless(self):
-    with self.assertCall(
-        self.call.battery.GetBatteryInfo(), {'Wireless powered': 'true'}):
-      self.assertTrue(self.battery.GetCharging())
-
-  def testGetCharging_unknown(self):
-    with self.assertCall(
-        self.call.battery.GetBatteryInfo(), {'level': '42'}):
-      self.assertFalse(self.battery.GetCharging())
-
-
-class BatteryUtilsGetNetworkDataTest(BatteryUtilsTest):
-
-  def testGetNetworkData_noDataUsage(self):
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'batterystats', '-c'], check_return=True),
-            _DUMPSYS_OUTPUT),
-        (self.call.device.ReadFile('/proc/uid_stat/1000/tcp_snd'),
-            self.ShellError()),
-        (self.call.device.ReadFile('/proc/uid_stat/1000/tcp_rcv'),
-            self.ShellError())):
-      self.assertEquals(self.battery.GetNetworkData('test_package1'), (0, 0))
-
-  def testGetNetworkData_badPackage(self):
-    with self.assertCall(
-        self.call.device.RunShellCommand(
-            ['dumpsys', 'batterystats', '-c'], check_return=True),
-            _DUMPSYS_OUTPUT):
-      self.assertEqual(self.battery.GetNetworkData('asdf'), None)
-
-  def testGetNetworkData_packageNotCached(self):
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'batterystats', '-c'], check_return=True),
-            _DUMPSYS_OUTPUT),
-        (self.call.device.ReadFile('/proc/uid_stat/1000/tcp_snd'), 1),
-        (self.call.device.ReadFile('/proc/uid_stat/1000/tcp_rcv'), 2)):
-      self.assertEqual(self.battery.GetNetworkData('test_package1'), (1,2))
-
-  def testGetNetworkData_packageCached(self):
-    self.battery._cache['uids'] = {'test_package1': '1000'}
-    with self.assertCalls(
-        (self.call.device.ReadFile('/proc/uid_stat/1000/tcp_snd'), 1),
-        (self.call.device.ReadFile('/proc/uid_stat/1000/tcp_rcv'), 2)):
-      self.assertEqual(self.battery.GetNetworkData('test_package1'), (1,2))
-
-  def testGetNetworkData_clearedCache(self):
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'batterystats', '-c'], check_return=True),
-            _DUMPSYS_OUTPUT),
-        (self.call.device.ReadFile('/proc/uid_stat/1000/tcp_snd'), 1),
-        (self.call.device.ReadFile('/proc/uid_stat/1000/tcp_rcv'), 2)):
-      self.battery._cache.clear()
-      self.assertEqual(self.battery.GetNetworkData('test_package1'), (1,2))
-
-
-class BatteryUtilsLetBatteryCoolToTemperatureTest(BatteryUtilsTest):
-
-  @mock.patch('time.sleep', mock.Mock())
-  def testLetBatteryCoolToTemperature_startUnder(self):
-    with self.assertCalls(
-        (self.call.battery.EnableBatteryUpdates(), []),
-        (self.call.battery.GetBatteryInfo(), {'temperature': '500'})):
-      self.battery.LetBatteryCoolToTemperature(600)
-
-  @mock.patch('time.sleep', mock.Mock())
-  def testLetBatteryCoolToTemperature_startOver(self):
-    with self.assertCalls(
-        (self.call.battery.EnableBatteryUpdates(), []),
-        (self.call.battery.GetBatteryInfo(), {'temperature': '500'}),
-        (self.call.battery.GetBatteryInfo(), {'temperature': '400'})):
-      self.battery.LetBatteryCoolToTemperature(400)
-
-class BatteryUtilsSupportsFuelGaugeTest(BatteryUtilsTest):
-
-  def testSupportsFuelGauge_false(self):
-    self.battery._cache['profile'] = self._NEXUS_5
-    self.assertFalse(self.battery.SupportsFuelGauge())
-
-  def testSupportsFuelGauge_trueMax(self):
-    self.battery._cache['profile'] = self._NEXUS_6
-    # TODO(rnephew): Change this to assertTrue when we have support for
-    # disabling hardware charging on nexus 6.
-    self.assertFalse(self.battery.SupportsFuelGauge())
-
-  def testSupportsFuelGauge_trueDS(self):
-    self.battery._cache['profile'] = self._NEXUS_10
-    # TODO(rnephew): Change this to assertTrue when we have support for
-    # disabling hardware charging on nexus 10.
-    self.assertFalse(self.battery.SupportsFuelGauge())
-
-
-class BatteryUtilsGetFuelGaugeChargeCounterTest(BatteryUtilsTest):
-
-  def testGetFuelGaugeChargeCounter_noFuelGauge(self):
-    self.battery._cache['profile'] = self._NEXUS_5
-    with self.assertRaises(device_errors.CommandFailedError):
-        self.battery.GetFuelGaugeChargeCounter()
-
-  def testGetFuelGaugeChargeCounter_fuelGaugePresent(self):
-    self.battery._cache['profile']= self._NEXUS_6
-    with self.assertCalls(
-        (self.call.battery.SupportsFuelGauge(), True),
-        (self.call.device.ReadFile(mock.ANY), '123')):
-      self.assertEqual(self.battery.GetFuelGaugeChargeCounter(), 123)
-
-
-class BatteryUtilsTieredSetCharging(BatteryUtilsTest):
-
-  @mock.patch('time.sleep', mock.Mock())
-  def testTieredSetCharging_softwareSetTrue(self):
-    self.battery._cache['profile'] = self._NEXUS_6
-    with self.assertCalls(
-        (self.call.battery.GetCharging(), False),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'battery', 'reset'], check_return=True), []),
-        (self.call.battery.GetCharging(), False),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'battery'], check_return=True), ['UPDATES STOPPED']),
-        (self.call.battery.GetCharging(), True)):
-      self.battery.TieredSetCharging(True)
-
-  @mock.patch('time.sleep', mock.Mock())
-  def testTieredSetCharging_softwareSetFalse(self):
-    self.battery._cache['profile'] = self._NEXUS_6
-    with self.assertCalls(
-        (self.call.battery.GetCharging(), True),
-        (self.call.battery._ClearPowerData(), True),
-        (self.call.battery._ClearPowerData(), True),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'battery', 'set', 'ac', '0'], check_return=True), []),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'battery', 'set', 'usb', '0'], check_return=True), []),
-        (self.call.battery.GetCharging(), False)):
-      self.battery.TieredSetCharging(False)
-
-  @mock.patch('time.sleep', mock.Mock())
-  def testTieredSetCharging_hardwareSetTrue(self):
-    self.battery._cache['profile'] = self._NEXUS_5
-    with self.assertCalls(
-        (self.call.battery.GetCharging(), False),
-        (self.call.battery.SetCharging(True))):
-      self.battery.TieredSetCharging(True)
-
-  @mock.patch('time.sleep', mock.Mock())
-  def testTieredSetCharging_hardwareSetFalse(self):
-    self.battery._cache['profile'] = self._NEXUS_5
-    with self.assertCalls(
-        (self.call.battery.GetCharging(), True),
-        (self.call.battery._ClearPowerData(), True),
-        (self.call.battery.SetCharging(False))):
-      self.battery.TieredSetCharging(False)
-
-  def testTieredSetCharging_expectedStateAlreadyTrue(self):
-    with self.assertCalls((self.call.battery.GetCharging(), True)):
-      self.battery.TieredSetCharging(True)
-
-  def testTieredSetCharging_expectedStateAlreadyFalse(self):
-    with self.assertCalls((self.call.battery.GetCharging(), False)):
-      self.battery.TieredSetCharging(False)
-
-
-class BatteryUtilsPowerMeasurement(BatteryUtilsTest):
-
-  def testPowerMeasurement_hardware(self):
-    self.battery._cache['profile'] = self._NEXUS_5
-    with self.assertCalls(
-        (self.call.battery.GetCharging(), True),
-        (self.call.battery._ClearPowerData(), True),
-        (self.call.battery.SetCharging(False)),
-        (self.call.battery.GetCharging(), False),
-        (self.call.battery.SetCharging(True))):
-      with self.battery.PowerMeasurement():
-        pass
-
-  @mock.patch('time.sleep', mock.Mock())
-  def testPowerMeasurement_software(self):
-    self.battery._cache['profile'] = self._NEXUS_6
-    with self.assertCalls(
-        (self.call.battery.GetCharging(), True),
-        (self.call.battery._ClearPowerData(), True),
-        (self.call.battery._ClearPowerData(), True),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'battery', 'set', 'ac', '0'], check_return=True), []),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'battery', 'set', 'usb', '0'], check_return=True), []),
-        (self.call.battery.GetCharging(), False),
-        (self.call.battery.GetCharging(), False),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'battery', 'reset'], check_return=True), []),
-        (self.call.battery.GetCharging(), False),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'battery'], check_return=True), ['UPDATES STOPPED']),
-        (self.call.battery.GetCharging(), True)):
-      with self.battery.PowerMeasurement():
-        pass
-
-
-class BatteryUtilsDiscoverDeviceProfile(BatteryUtilsTest):
-
-  def testDiscoverDeviceProfile_known(self):
-    with self.assertCalls(
-        (self.call.adb.Shell('getprop ro.product.model'), "Nexus 4")):
-      self.battery._DiscoverDeviceProfile()
-      self.assertEqual(self.battery._cache['profile']['name'], "Nexus 4")
-
-  def testDiscoverDeviceProfile_unknown(self):
-    with self.assertCalls(
-        (self.call.adb.Shell('getprop ro.product.model'), "Other")):
-      self.battery._DiscoverDeviceProfile()
-      self.assertEqual(self.battery._cache['profile']['name'], None)
-
-
-class BatteryUtilsClearPowerData(BatteryUtilsTest):
-
-  def testClearPowerData_preL(self):
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(mock.ANY, retries=0,
-            single_line=True, timeout=10, check_return=True), '20')):
-      self.assertFalse(self.battery._ClearPowerData())
-
-  def testClearPowerData_clearedL(self):
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(mock.ANY, retries=0,
-            single_line=True, timeout=10, check_return=True), '22'),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'battery', 'set', 'usb', '1'], check_return=True), []),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'battery', 'set', 'ac', '1'], check_return=True), []),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'batterystats', '--reset'], check_return=True), []),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'batterystats', '--charged', '--checkin'],
-            check_return=True, large_output=True), []),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'battery', 'reset'], check_return=True), [])):
-      self.assertTrue(self.battery._ClearPowerData())
-
-  def testClearPowerData_notClearedL(self):
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(mock.ANY, retries=0,
-            single_line=True, timeout=10, check_return=True), '22'),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'battery', 'set', 'usb', '1'], check_return=True), []),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'battery', 'set', 'ac', '1'], check_return=True), []),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'batterystats', '--reset'], check_return=True), []),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'batterystats', '--charged', '--checkin'],
-            check_return=True, large_output=True),
-            ['9,1000,l,pwi,uid,0.0327']),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'battery', 'reset'], check_return=True), [])):
-      with self.assertRaises(device_errors.CommandFailedError):
-        self.battery._ClearPowerData()
-
-
-if __name__ == '__main__':
-  logging.getLogger().setLevel(logging.DEBUG)
-  unittest.main(verbosity=2)
diff --git a/build/android/pylib/device/commands/BUILD.gn b/build/android/pylib/device/commands/BUILD.gn
deleted file mode 100644
index 66e1010..0000000
--- a/build/android/pylib/device/commands/BUILD.gn
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import("//build/config/android/rules.gni")
-
-group("commands") {
-  datadeps = [
-    ":chromium_commands",
-  ]
-}
-
-# GYP: //build/android/pylib/device/commands/commands.gyp:chromium_commands
-android_library("chromium_commands") {
-  java_files = [ "java/src/org/chromium/android/commands/unzip/Unzip.java" ]
-  dex_path = "$root_build_dir/lib.java/chromium_commands.dex.jar"
-}
diff --git a/build/android/pylib/device/commands/__init__.py b/build/android/pylib/device/commands/__init__.py
deleted file mode 100644
index 4d6aabb..0000000
--- a/build/android/pylib/device/commands/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
diff --git a/build/android/pylib/device/commands/commands.gyp b/build/android/pylib/device/commands/commands.gyp
deleted file mode 100644
index b5b5bc8..0000000
--- a/build/android/pylib/device/commands/commands.gyp
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      # GN version: //build/android/pylib/devices/commands:chromium_commands
-      'target_name': 'chromium_commands',
-      'type': 'none',
-      'variables': {
-        'add_to_dependents_classpaths': 0,
-        'java_in_dir': ['java'],
-      },
-      'includes': [
-        '../../../../../build/java.gypi',
-      ],
-    }
-  ],
-}
diff --git a/build/android/pylib/device/commands/install_commands.py b/build/android/pylib/device/commands/install_commands.py
deleted file mode 100644
index 58c56cc..0000000
--- a/build/android/pylib/device/commands/install_commands.py
+++ /dev/null
@@ -1,51 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import os
-
-from pylib import constants
-
-BIN_DIR = '%s/bin' % constants.TEST_EXECUTABLE_DIR
-_FRAMEWORK_DIR = '%s/framework' % constants.TEST_EXECUTABLE_DIR
-
-_COMMANDS = {
-  'unzip': 'org.chromium.android.commands.unzip.Unzip',
-}
-
-_SHELL_COMMAND_FORMAT = (
-"""#!/system/bin/sh
-base=%s
-export CLASSPATH=$base/framework/chromium_commands.jar
-exec app_process $base/bin %s $@
-""")
-
-
-def Installed(device):
-  return (all(device.FileExists('%s/%s' % (BIN_DIR, c)) for c in _COMMANDS)
-          and device.FileExists('%s/chromium_commands.jar' % _FRAMEWORK_DIR))
-
-def InstallCommands(device):
-  if device.IsUserBuild():
-    raise Exception('chromium_commands currently requires a userdebug build.')
-
-  chromium_commands_jar_path = os.path.join(
-      constants.GetOutDirectory(), constants.SDK_BUILD_JAVALIB_DIR,
-      'chromium_commands.dex.jar')
-  if not os.path.exists(chromium_commands_jar_path):
-    raise Exception('%s not found. Please build chromium_commands.'
-                    % chromium_commands_jar_path)
-
-  device.RunShellCommand(['mkdir', BIN_DIR, _FRAMEWORK_DIR])
-  for command, main_class in _COMMANDS.iteritems():
-    shell_command = _SHELL_COMMAND_FORMAT % (
-        constants.TEST_EXECUTABLE_DIR, main_class)
-    shell_file = '%s/%s' % (BIN_DIR, command)
-    device.WriteFile(shell_file, shell_command)
-    device.RunShellCommand(
-        ['chmod', '755', shell_file], check_return=True)
-
-  device.adb.Push(
-      chromium_commands_jar_path,
-      '%s/chromium_commands.jar' % _FRAMEWORK_DIR)
-
diff --git a/build/android/pylib/device/commands/java/src/org/chromium/android/commands/unzip/Unzip.java b/build/android/pylib/device/commands/java/src/org/chromium/android/commands/unzip/Unzip.java
deleted file mode 100644
index 7cbbb73..0000000
--- a/build/android/pylib/device/commands/java/src/org/chromium/android/commands/unzip/Unzip.java
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.android.commands.unzip;
-
-import android.util.Log;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-/**
- *  Minimal implementation of the command-line unzip utility for Android.
- */
-public class Unzip {
-
-    private static final String TAG = "Unzip";
-
-    public static void main(String[] args) {
-        try {
-            (new Unzip()).run(args);
-        } catch (RuntimeException e) {
-            Log.e(TAG, e.toString());
-            System.exit(1);
-        }
-    }
-
-    private void showUsage(PrintStream s) {
-        s.println("Usage:");
-        s.println("unzip [zipfile]");
-    }
-
-    @SuppressWarnings("Finally")
-    private void unzip(String[] args) {
-        ZipInputStream zis = null;
-        try {
-            String zipfile = args[0];
-            zis = new ZipInputStream(new BufferedInputStream(new FileInputStream(zipfile)));
-            ZipEntry ze = null;
-
-            byte[] bytes = new byte[1024];
-            while ((ze = zis.getNextEntry()) != null) {
-                File outputFile = new File(ze.getName());
-                if (ze.isDirectory()) {
-                    if (!outputFile.exists() && !outputFile.mkdirs()) {
-                        throw new RuntimeException(
-                                "Failed to create directory: " + outputFile.toString());
-                    }
-                } else {
-                    File parentDir = outputFile.getParentFile();
-                    if (!parentDir.exists() && !parentDir.mkdirs()) {
-                        throw new RuntimeException(
-                                "Failed to create directory: " + parentDir.toString());
-                    }
-                    OutputStream out = new BufferedOutputStream(new FileOutputStream(outputFile));
-                    int actual_bytes = 0;
-                    int total_bytes = 0;
-                    while ((actual_bytes = zis.read(bytes)) != -1) {
-                        out.write(bytes, 0, actual_bytes);
-                        total_bytes += actual_bytes;
-                    }
-                    out.close();
-                }
-                zis.closeEntry();
-            }
-
-        } catch (IOException e) {
-            throw new RuntimeException("Error while unzipping: " + e.toString());
-        } finally {
-            try {
-                if (zis != null) zis.close();
-            } catch (IOException e) {
-                throw new RuntimeException("Error while closing zip: " + e.toString());
-            }
-        }
-    }
-
-    public void run(String[] args) {
-        if (args.length != 1) {
-            showUsage(System.err);
-            throw new RuntimeException("Incorrect usage.");
-        }
-
-        unzip(args);
-    }
-}
-
diff --git a/build/android/pylib/device/decorators.py b/build/android/pylib/device/decorators.py
deleted file mode 100644
index 73c13da..0000000
--- a/build/android/pylib/device/decorators.py
+++ /dev/null
@@ -1,157 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-Function/method decorators that provide timeout and retry logic.
-"""
-
-import functools
-import os
-import sys
-import threading
-
-from pylib import cmd_helper
-from pylib import constants
-from pylib.device import device_errors
-from pylib.utils import reraiser_thread
-from pylib.utils import timeout_retry
-
-# TODO(jbudorick) Remove once the DeviceUtils implementations are no longer
-#                 backed by AndroidCommands / android_testrunner.
-sys.path.append(os.path.join(constants.DIR_SOURCE_ROOT, 'third_party',
-                             'android_testrunner'))
-import errors as old_errors
-
-DEFAULT_TIMEOUT_ATTR = '_default_timeout'
-DEFAULT_RETRIES_ATTR = '_default_retries'
-
-
-def _TimeoutRetryWrapper(f, timeout_func, retries_func, pass_values=False):
-  """ Wraps a funcion with timeout and retry handling logic.
-
-  Args:
-    f: The function to wrap.
-    timeout_func: A callable that returns the timeout value.
-    retries_func: A callable that returns the retries value.
-    pass_values: If True, passes the values returned by |timeout_func| and
-                 |retries_func| to the wrapped function as 'timeout' and
-                 'retries' kwargs, respectively.
-  Returns:
-    The wrapped function.
-  """
-  @functools.wraps(f)
-  def TimeoutRetryWrapper(*args, **kwargs):
-    timeout = timeout_func(*args, **kwargs)
-    retries = retries_func(*args, **kwargs)
-    if pass_values:
-      kwargs['timeout'] = timeout
-      kwargs['retries'] = retries
-    def impl():
-      return f(*args, **kwargs)
-    try:
-      if isinstance(threading.current_thread(),
-                    timeout_retry.TimeoutRetryThread):
-        return impl()
-      else:
-        return timeout_retry.Run(impl, timeout, retries)
-    except old_errors.WaitForResponseTimedOutError as e:
-      raise device_errors.CommandTimeoutError(str(e)), None, (
-          sys.exc_info()[2])
-    except old_errors.DeviceUnresponsiveError as e:
-      raise device_errors.DeviceUnreachableError(str(e)), None, (
-          sys.exc_info()[2])
-    except reraiser_thread.TimeoutError as e:
-      raise device_errors.CommandTimeoutError(str(e)), None, (
-          sys.exc_info()[2])
-    except cmd_helper.TimeoutError as e:
-      raise device_errors.CommandTimeoutError(str(e)), None, (
-          sys.exc_info()[2])
-  return TimeoutRetryWrapper
-
-
-def WithTimeoutAndRetries(f):
-  """A decorator that handles timeouts and retries.
-
-  'timeout' and 'retries' kwargs must be passed to the function.
-
-  Args:
-    f: The function to decorate.
-  Returns:
-    The decorated function.
-  """
-  get_timeout = lambda *a, **kw: kw['timeout']
-  get_retries = lambda *a, **kw: kw['retries']
-  return _TimeoutRetryWrapper(f, get_timeout, get_retries)
-
-
-def WithExplicitTimeoutAndRetries(timeout, retries):
-  """Returns a decorator that handles timeouts and retries.
-
-  The provided |timeout| and |retries| values are always used.
-
-  Args:
-    timeout: The number of seconds to wait for the decorated function to
-             return. Always used.
-    retries: The number of times the decorated function should be retried on
-             failure. Always used.
-  Returns:
-    The actual decorator.
-  """
-  def decorator(f):
-    get_timeout = lambda *a, **kw: timeout
-    get_retries = lambda *a, **kw: retries
-    return _TimeoutRetryWrapper(f, get_timeout, get_retries)
-  return decorator
-
-
-def WithTimeoutAndRetriesDefaults(default_timeout, default_retries):
-  """Returns a decorator that handles timeouts and retries.
-
-  The provided |default_timeout| and |default_retries| values are used only
-  if timeout and retries values are not provided.
-
-  Args:
-    default_timeout: The number of seconds to wait for the decorated function
-                     to return. Only used if a 'timeout' kwarg is not passed
-                     to the decorated function.
-    default_retries: The number of times the decorated function should be
-                     retried on failure. Only used if a 'retries' kwarg is not
-                     passed to the decorated function.
-  Returns:
-    The actual decorator.
-  """
-  def decorator(f):
-    get_timeout = lambda *a, **kw: kw.get('timeout', default_timeout)
-    get_retries = lambda *a, **kw: kw.get('retries', default_retries)
-    return _TimeoutRetryWrapper(f, get_timeout, get_retries, pass_values=True)
-  return decorator
-
-
-def WithTimeoutAndRetriesFromInstance(
-    default_timeout_name=DEFAULT_TIMEOUT_ATTR,
-    default_retries_name=DEFAULT_RETRIES_ATTR):
-  """Returns a decorator that handles timeouts and retries.
-
-  The provided |default_timeout_name| and |default_retries_name| are used to
-  get the default timeout value and the default retries value from the object
-  instance if timeout and retries values are not provided.
-
-  Note that this should only be used to decorate methods, not functions.
-
-  Args:
-    default_timeout_name: The name of the default timeout attribute of the
-                          instance.
-    default_retries_name: The name of the default retries attribute of the
-                          instance.
-  Returns:
-    The actual decorator.
-  """
-  def decorator(f):
-    def get_timeout(inst, *_args, **kwargs):
-      return kwargs.get('timeout', getattr(inst, default_timeout_name))
-    def get_retries(inst, *_args, **kwargs):
-      return kwargs.get('retries', getattr(inst, default_retries_name))
-    return _TimeoutRetryWrapper(f, get_timeout, get_retries, pass_values=True)
-  return decorator
-
diff --git a/build/android/pylib/device/decorators_test.py b/build/android/pylib/device/decorators_test.py
deleted file mode 100644
index b75618b..0000000
--- a/build/android/pylib/device/decorators_test.py
+++ /dev/null
@@ -1,365 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-Unit tests for decorators.py.
-"""
-
-# pylint: disable=W0613
-
-import os
-import sys
-import time
-import traceback
-import unittest
-
-from pylib import constants
-from pylib.device import decorators
-from pylib.device import device_errors
-from pylib.utils import reraiser_thread
-
-# TODO(jbudorick) Remove once the DeviceUtils implementations are no longer
-#                 backed by AndroidCommands / android_testrunner.
-sys.path.append(os.path.join(constants.DIR_SOURCE_ROOT, 'third_party',
-                             'android_testrunner'))
-import errors as old_errors
-
-_DEFAULT_TIMEOUT = 30
-_DEFAULT_RETRIES = 3
-
-class DecoratorsTest(unittest.TestCase):
-  _decorated_function_called_count = 0
-
-  def testFunctionDecoratorDoesTimeouts(self):
-    """Tests that the base decorator handles the timeout logic."""
-    DecoratorsTest._decorated_function_called_count = 0
-    @decorators.WithTimeoutAndRetries
-    def alwaysTimesOut(timeout=None, retries=None):
-      DecoratorsTest._decorated_function_called_count += 1
-      time.sleep(100)
-
-    start_time = time.time()
-    with self.assertRaises(device_errors.CommandTimeoutError):
-      alwaysTimesOut(timeout=1, retries=0)
-    elapsed_time = time.time() - start_time
-    self.assertTrue(elapsed_time >= 1)
-    self.assertEquals(1, DecoratorsTest._decorated_function_called_count)
-
-  def testFunctionDecoratorDoesRetries(self):
-    """Tests that the base decorator handles the retries logic."""
-    DecoratorsTest._decorated_function_called_count = 0
-    @decorators.WithTimeoutAndRetries
-    def alwaysRaisesCommandFailedError(timeout=None, retries=None):
-      DecoratorsTest._decorated_function_called_count += 1
-      raise device_errors.CommandFailedError('testCommand failed')
-
-    with self.assertRaises(device_errors.CommandFailedError):
-      alwaysRaisesCommandFailedError(timeout=30, retries=10)
-    self.assertEquals(11, DecoratorsTest._decorated_function_called_count)
-
-  def testFunctionDecoratorRequiresParams(self):
-    """Tests that the base decorator requires timeout and retries params."""
-    @decorators.WithTimeoutAndRetries
-    def requiresExplicitTimeoutAndRetries(timeout=None, retries=None):
-      return (timeout, retries)
-
-    with self.assertRaises(KeyError):
-      requiresExplicitTimeoutAndRetries()
-    with self.assertRaises(KeyError):
-      requiresExplicitTimeoutAndRetries(timeout=10)
-    with self.assertRaises(KeyError):
-      requiresExplicitTimeoutAndRetries(retries=0)
-    expected_timeout = 10
-    expected_retries = 1
-    (actual_timeout, actual_retries) = (
-        requiresExplicitTimeoutAndRetries(timeout=expected_timeout,
-                                          retries=expected_retries))
-    self.assertEquals(expected_timeout, actual_timeout)
-    self.assertEquals(expected_retries, actual_retries)
-
-  def testFunctionDecoratorTranslatesOldExceptions(self):
-    """Tests that the explicit decorator translates old exceptions."""
-    @decorators.WithTimeoutAndRetries
-    def alwaysRaisesProvidedException(exception, timeout=None, retries=None):
-      raise exception
-
-    exception_desc = 'Old response timeout error'
-    with self.assertRaises(device_errors.CommandTimeoutError) as e:
-      alwaysRaisesProvidedException(
-          old_errors.WaitForResponseTimedOutError(exception_desc),
-          timeout=10, retries=1)
-    self.assertEquals(exception_desc, str(e.exception))
-
-    exception_desc = 'Old device error'
-    with self.assertRaises(device_errors.DeviceUnreachableError) as e:
-      alwaysRaisesProvidedException(
-          old_errors.DeviceUnresponsiveError(exception_desc),
-          timeout=10, retries=1)
-    self.assertEquals(exception_desc, str(e.exception))
-
-  def testFunctionDecoratorTranslatesReraiserExceptions(self):
-    """Tests that the explicit decorator translates reraiser exceptions."""
-    @decorators.WithTimeoutAndRetries
-    def alwaysRaisesProvidedException(exception, timeout=None, retries=None):
-      raise exception
-
-    exception_desc = 'Reraiser thread timeout error'
-    with self.assertRaises(device_errors.CommandTimeoutError) as e:
-      alwaysRaisesProvidedException(
-          reraiser_thread.TimeoutError(exception_desc),
-          timeout=10, retries=1)
-    self.assertEquals(exception_desc, str(e.exception))
-
-  def testDefaultsFunctionDecoratorDoesTimeouts(self):
-    """Tests that the defaults decorator handles timeout logic."""
-    DecoratorsTest._decorated_function_called_count = 0
-    @decorators.WithTimeoutAndRetriesDefaults(1, 0)
-    def alwaysTimesOut(timeout=None, retries=None):
-      DecoratorsTest._decorated_function_called_count += 1
-      time.sleep(100)
-
-    start_time = time.time()
-    with self.assertRaises(device_errors.CommandTimeoutError):
-      alwaysTimesOut()
-    elapsed_time = time.time() - start_time
-    self.assertTrue(elapsed_time >= 1)
-    self.assertEquals(1, DecoratorsTest._decorated_function_called_count)
-
-    DecoratorsTest._decorated_function_called_count = 0
-    with self.assertRaises(device_errors.CommandTimeoutError):
-      alwaysTimesOut(timeout=2)
-    elapsed_time = time.time() - start_time
-    self.assertTrue(elapsed_time >= 2)
-    self.assertEquals(1, DecoratorsTest._decorated_function_called_count)
-
-  def testDefaultsFunctionDecoratorDoesRetries(self):
-    """Tests that the defaults decorator handles retries logic."""
-    DecoratorsTest._decorated_function_called_count = 0
-    @decorators.WithTimeoutAndRetriesDefaults(30, 10)
-    def alwaysRaisesCommandFailedError(timeout=None, retries=None):
-      DecoratorsTest._decorated_function_called_count += 1
-      raise device_errors.CommandFailedError('testCommand failed')
-
-    with self.assertRaises(device_errors.CommandFailedError):
-      alwaysRaisesCommandFailedError()
-    self.assertEquals(11, DecoratorsTest._decorated_function_called_count)
-
-    DecoratorsTest._decorated_function_called_count = 0
-    with self.assertRaises(device_errors.CommandFailedError):
-      alwaysRaisesCommandFailedError(retries=5)
-    self.assertEquals(6, DecoratorsTest._decorated_function_called_count)
-
-  def testDefaultsFunctionDecoratorPassesValues(self):
-    """Tests that the defaults decorator passes timeout and retries kwargs."""
-    @decorators.WithTimeoutAndRetriesDefaults(30, 10)
-    def alwaysReturnsTimeouts(timeout=None, retries=None):
-      return timeout
-
-    self.assertEquals(30, alwaysReturnsTimeouts())
-    self.assertEquals(120, alwaysReturnsTimeouts(timeout=120))
-
-    @decorators.WithTimeoutAndRetriesDefaults(30, 10)
-    def alwaysReturnsRetries(timeout=None, retries=None):
-      return retries
-
-    self.assertEquals(10, alwaysReturnsRetries())
-    self.assertEquals(1, alwaysReturnsRetries(retries=1))
-
-  def testDefaultsFunctionDecoratorTranslatesOldExceptions(self):
-    """Tests that the explicit decorator translates old exceptions."""
-    @decorators.WithTimeoutAndRetriesDefaults(30, 10)
-    def alwaysRaisesProvidedException(exception, timeout=None, retries=None):
-      raise exception
-
-    exception_desc = 'Old response timeout error'
-    with self.assertRaises(device_errors.CommandTimeoutError) as e:
-      alwaysRaisesProvidedException(
-          old_errors.WaitForResponseTimedOutError(exception_desc))
-    self.assertEquals(exception_desc, str(e.exception))
-
-    exception_desc = 'Old device error'
-    with self.assertRaises(device_errors.DeviceUnreachableError) as e:
-      alwaysRaisesProvidedException(
-          old_errors.DeviceUnresponsiveError(exception_desc))
-    self.assertEquals(exception_desc, str(e.exception))
-
-  def testDefaultsFunctionDecoratorTranslatesReraiserExceptions(self):
-    """Tests that the explicit decorator translates reraiser exceptions."""
-    @decorators.WithTimeoutAndRetriesDefaults(30, 10)
-    def alwaysRaisesProvidedException(exception, timeout=None, retries=None):
-      raise exception
-
-    exception_desc = 'Reraiser thread timeout error'
-    with self.assertRaises(device_errors.CommandTimeoutError) as e:
-      alwaysRaisesProvidedException(
-          reraiser_thread.TimeoutError(exception_desc))
-    self.assertEquals(exception_desc, str(e.exception))
-
-  def testExplicitFunctionDecoratorDoesTimeouts(self):
-    """Tests that the explicit decorator handles timeout logic."""
-    DecoratorsTest._decorated_function_called_count = 0
-    @decorators.WithExplicitTimeoutAndRetries(1, 0)
-    def alwaysTimesOut():
-      DecoratorsTest._decorated_function_called_count += 1
-      time.sleep(100)
-
-    start_time = time.time()
-    with self.assertRaises(device_errors.CommandTimeoutError):
-      alwaysTimesOut()
-    elapsed_time = time.time() - start_time
-    self.assertTrue(elapsed_time >= 1)
-    self.assertEquals(1, DecoratorsTest._decorated_function_called_count)
-
-  def testExplicitFunctionDecoratorDoesRetries(self):
-    """Tests that the explicit decorator handles retries logic."""
-    DecoratorsTest._decorated_function_called_count = 0
-    @decorators.WithExplicitTimeoutAndRetries(30, 10)
-    def alwaysRaisesCommandFailedError():
-      DecoratorsTest._decorated_function_called_count += 1
-      raise device_errors.CommandFailedError('testCommand failed')
-
-    with self.assertRaises(device_errors.CommandFailedError):
-      alwaysRaisesCommandFailedError()
-    self.assertEquals(11, DecoratorsTest._decorated_function_called_count)
-
-  def testExplicitDecoratorTranslatesOldExceptions(self):
-    """Tests that the explicit decorator translates old exceptions."""
-    @decorators.WithExplicitTimeoutAndRetries(30, 10)
-    def alwaysRaisesProvidedException(exception):
-      raise exception
-
-    exception_desc = 'Old response timeout error'
-    with self.assertRaises(device_errors.CommandTimeoutError) as e:
-      alwaysRaisesProvidedException(
-          old_errors.WaitForResponseTimedOutError(exception_desc))
-    self.assertEquals(exception_desc, str(e.exception))
-
-    exception_desc = 'Old device error'
-    with self.assertRaises(device_errors.DeviceUnreachableError) as e:
-      alwaysRaisesProvidedException(
-          old_errors.DeviceUnresponsiveError(exception_desc))
-    self.assertEquals(exception_desc, str(e.exception))
-
-  def testExplicitDecoratorTranslatesReraiserExceptions(self):
-    """Tests that the explicit decorator translates reraiser exceptions."""
-    @decorators.WithExplicitTimeoutAndRetries(30, 10)
-    def alwaysRaisesProvidedException(exception):
-      raise exception
-
-    exception_desc = 'Reraiser thread timeout error'
-    with self.assertRaises(device_errors.CommandTimeoutError) as e:
-      alwaysRaisesProvidedException(
-          reraiser_thread.TimeoutError(exception_desc))
-    self.assertEquals(exception_desc, str(e.exception))
-
-  class _MethodDecoratorTestObject(object):
-    """An object suitable for testing the method decorator."""
-
-    def __init__(self, test_case, default_timeout=_DEFAULT_TIMEOUT,
-                 default_retries=_DEFAULT_RETRIES):
-      self._test_case = test_case
-      self.default_timeout = default_timeout
-      self.default_retries = default_retries
-      self.function_call_counters = {
-          'alwaysRaisesCommandFailedError': 0,
-          'alwaysTimesOut': 0,
-          'requiresExplicitTimeoutAndRetries': 0,
-      }
-
-    @decorators.WithTimeoutAndRetriesFromInstance(
-        'default_timeout', 'default_retries')
-    def alwaysTimesOut(self, timeout=None, retries=None):
-      self.function_call_counters['alwaysTimesOut'] += 1
-      time.sleep(100)
-      self._test_case.assertFalse(True, msg='Failed to time out?')
-
-    @decorators.WithTimeoutAndRetriesFromInstance(
-        'default_timeout', 'default_retries')
-    def alwaysRaisesCommandFailedError(self, timeout=None, retries=None):
-      self.function_call_counters['alwaysRaisesCommandFailedError'] += 1
-      raise device_errors.CommandFailedError('testCommand failed')
-
-    # pylint: disable=no-self-use
-
-    @decorators.WithTimeoutAndRetriesFromInstance(
-        'default_timeout', 'default_retries')
-    def alwaysReturnsTimeout(self, timeout=None, retries=None):
-      return timeout
-
-    @decorators.WithTimeoutAndRetriesFromInstance(
-        'default_timeout', 'default_retries')
-    def alwaysReturnsRetries(self, timeout=None, retries=None):
-      return retries
-
-    @decorators.WithTimeoutAndRetriesFromInstance(
-        'default_timeout', 'default_retries')
-    def alwaysRaisesProvidedException(self, exception, timeout=None,
-                                      retries=None):
-      raise exception
-
-    # pylint: enable=no-self-use
-
-
-  def testMethodDecoratorDoesTimeout(self):
-    """Tests that the method decorator handles timeout logic."""
-    test_obj = self._MethodDecoratorTestObject(self)
-    start_time = time.time()
-    with self.assertRaises(device_errors.CommandTimeoutError):
-      try:
-        test_obj.alwaysTimesOut(timeout=1, retries=0)
-      except:
-        traceback.print_exc()
-        raise
-    elapsed_time = time.time() - start_time
-    self.assertTrue(elapsed_time >= 1)
-    self.assertEquals(1, test_obj.function_call_counters['alwaysTimesOut'])
-
-  def testMethodDecoratorDoesRetries(self):
-    """Tests that the method decorator handles retries logic."""
-    test_obj = self._MethodDecoratorTestObject(self)
-    with self.assertRaises(device_errors.CommandFailedError):
-      try:
-        test_obj.alwaysRaisesCommandFailedError(retries=10)
-      except:
-        traceback.print_exc()
-        raise
-    self.assertEquals(
-        11, test_obj.function_call_counters['alwaysRaisesCommandFailedError'])
-
-  def testMethodDecoratorPassesValues(self):
-    """Tests that the method decorator passes timeout and retries kwargs."""
-    test_obj = self._MethodDecoratorTestObject(
-        self, default_timeout=42, default_retries=31)
-    self.assertEquals(42, test_obj.alwaysReturnsTimeout())
-    self.assertEquals(41, test_obj.alwaysReturnsTimeout(timeout=41))
-    self.assertEquals(31, test_obj.alwaysReturnsRetries())
-    self.assertEquals(32, test_obj.alwaysReturnsRetries(retries=32))
-
-  def testMethodDecoratorTranslatesOldExceptions(self):
-    test_obj = self._MethodDecoratorTestObject(self)
-
-    exception_desc = 'Old response timeout error'
-    with self.assertRaises(device_errors.CommandTimeoutError) as e:
-      test_obj.alwaysRaisesProvidedException(
-          old_errors.WaitForResponseTimedOutError(exception_desc))
-    self.assertEquals(exception_desc, str(e.exception))
-
-    exception_desc = 'Old device error'
-    with self.assertRaises(device_errors.DeviceUnreachableError) as e:
-      test_obj.alwaysRaisesProvidedException(
-          old_errors.DeviceUnresponsiveError(exception_desc))
-    self.assertEquals(exception_desc, str(e.exception))
-
-  def testMethodDecoratorTranslatesReraiserExceptions(self):
-    test_obj = self._MethodDecoratorTestObject(self)
-
-    exception_desc = 'Reraiser thread timeout error'
-    with self.assertRaises(device_errors.CommandTimeoutError) as e:
-      test_obj.alwaysRaisesProvidedException(
-          reraiser_thread.TimeoutError(exception_desc))
-    self.assertEquals(exception_desc, str(e.exception))
-
-if __name__ == '__main__':
-  unittest.main(verbosity=2)
-
diff --git a/build/android/pylib/device/device_blacklist.py b/build/android/pylib/device/device_blacklist.py
deleted file mode 100644
index a141d62..0000000
--- a/build/android/pylib/device/device_blacklist.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import json
-import os
-import threading
-
-from pylib import constants
-_BLACKLIST_JSON = os.path.join(
-    constants.DIR_SOURCE_ROOT,
-    os.environ.get('CHROMIUM_OUT_DIR', 'out'),
-    'bad_devices.json')
-
-# Note that this only protects against concurrent accesses to the blacklist
-# within a process.
-_blacklist_lock = threading.RLock()
-
-def ReadBlacklist():
-  """Reads the blacklist from the _BLACKLIST_JSON file.
-
-  Returns:
-    A list containing bad devices.
-  """
-  with _blacklist_lock:
-    if not os.path.exists(_BLACKLIST_JSON):
-      return []
-
-    with open(_BLACKLIST_JSON, 'r') as f:
-      return json.load(f)
-
-
-def WriteBlacklist(blacklist):
-  """Writes the provided blacklist to the _BLACKLIST_JSON file.
-
-  Args:
-    blacklist: list of bad devices to write to the _BLACKLIST_JSON file.
-  """
-  with _blacklist_lock:
-    with open(_BLACKLIST_JSON, 'w') as f:
-      json.dump(list(set(blacklist)), f)
-
-
-def ExtendBlacklist(devices):
-  """Adds devices to _BLACKLIST_JSON file.
-
-  Args:
-    devices: list of bad devices to be added to the _BLACKLIST_JSON file.
-  """
-  with _blacklist_lock:
-    blacklist = ReadBlacklist()
-    blacklist.extend(devices)
-    WriteBlacklist(blacklist)
-
-
-def ResetBlacklist():
-  """Erases the _BLACKLIST_JSON file if it exists."""
-  with _blacklist_lock:
-    if os.path.exists(_BLACKLIST_JSON):
-      os.remove(_BLACKLIST_JSON)
-
diff --git a/build/android/pylib/device/device_errors.py b/build/android/pylib/device/device_errors.py
deleted file mode 100644
index 2492015..0000000
--- a/build/android/pylib/device/device_errors.py
+++ /dev/null
@@ -1,89 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-Exception classes raised by AdbWrapper and DeviceUtils.
-"""
-
-from pylib import cmd_helper
-from pylib.utils import base_error
-
-
-class CommandFailedError(base_error.BaseError):
-  """Exception for command failures."""
-
-  def __init__(self, message, device_serial=None):
-    if device_serial is not None:
-      message = '(device: %s) %s' % (device_serial, message)
-    self.device_serial = device_serial
-    super(CommandFailedError, self).__init__(message)
-
-
-class AdbCommandFailedError(CommandFailedError):
-  """Exception for adb command failures."""
-
-  def __init__(self, args, output, status=None, device_serial=None,
-               message=None):
-    self.args = args
-    self.output = output
-    self.status = status
-    if not message:
-      adb_cmd = ' '.join(cmd_helper.SingleQuote(arg) for arg in self.args)
-      message = ['adb %s: failed ' % adb_cmd]
-      if status:
-        message.append('with exit status %s ' % self.status)
-      if output:
-        message.append('and output:\n')
-        message.extend('- %s\n' % line for line in output.splitlines())
-      else:
-        message.append('and no output.')
-      message = ''.join(message)
-    super(AdbCommandFailedError, self).__init__(message, device_serial)
-
-
-class DeviceVersionError(CommandFailedError):
-  """Exception for device version failures."""
-
-  def __init__(self, message, device_serial=None):
-    super(DeviceVersionError, self).__init__(message, device_serial)
-
-
-class AdbShellCommandFailedError(AdbCommandFailedError):
-  """Exception for shell command failures run via adb."""
-
-  def __init__(self, command, output, status, device_serial=None):
-    self.command = command
-    message = ['shell command run via adb failed on the device:\n',
-               '  command: %s\n' % command]
-    message.append('  exit status: %s\n' % status)
-    if output:
-      message.append('  output:\n')
-      if isinstance(output, basestring):
-        output_lines = output.splitlines()
-      else:
-        output_lines = output
-      message.extend('  - %s\n' % line for line in output_lines)
-    else:
-      message.append("  output: ''\n")
-    message = ''.join(message)
-    super(AdbShellCommandFailedError, self).__init__(
-      ['shell', command], output, status, device_serial, message)
-
-
-class CommandTimeoutError(base_error.BaseError):
-  """Exception for command timeouts."""
-  pass
-
-
-class DeviceUnreachableError(base_error.BaseError):
-  """Exception for device unreachable failures."""
-  pass
-
-
-class NoDevicesError(base_error.BaseError):
-  """Exception for having no devices attached."""
-
-  def __init__(self):
-    super(NoDevicesError, self).__init__(
-        'No devices attached.', is_infra_error=True)
diff --git a/build/android/pylib/device/device_list.py b/build/android/pylib/device/device_list.py
deleted file mode 100644
index 0eb6acb..0000000
--- a/build/android/pylib/device/device_list.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""A module to keep track of devices across builds."""
-
-import os
-
-LAST_DEVICES_FILENAME = '.last_devices'
-LAST_MISSING_DEVICES_FILENAME = '.last_missing'
-
-
-def GetPersistentDeviceList(file_name):
-  """Returns a list of devices.
-
-  Args:
-    file_name: the file name containing a list of devices.
-
-  Returns: List of device serial numbers that were on the bot.
-  """
-  with open(file_name) as f:
-    return f.read().splitlines()
-
-
-def WritePersistentDeviceList(file_name, device_list):
-  path = os.path.dirname(file_name)
-  if not os.path.exists(path):
-    os.makedirs(path)
-  with open(file_name, 'w') as f:
-    f.write('\n'.join(set(device_list)))
diff --git a/build/android/pylib/device/device_utils.py b/build/android/pylib/device/device_utils.py
deleted file mode 100644
index f201ef3..0000000
--- a/build/android/pylib/device/device_utils.py
+++ /dev/null
@@ -1,1754 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Provides a variety of device interactions based on adb.
-
-Eventually, this will be based on adb_wrapper.
-"""
-# pylint: disable=unused-argument
-
-import collections
-import contextlib
-import itertools
-import logging
-import multiprocessing
-import os
-import posixpath
-import re
-import shutil
-import sys
-import tempfile
-import time
-import zipfile
-
-import pylib.android_commands
-from pylib import cmd_helper
-from pylib import constants
-from pylib import device_signal
-from pylib.constants import keyevent
-from pylib.device import adb_wrapper
-from pylib.device import decorators
-from pylib.device import device_blacklist
-from pylib.device import device_errors
-from pylib.device import intent
-from pylib.device import logcat_monitor
-from pylib.device.commands import install_commands
-from pylib.sdk import split_select
-from pylib.utils import apk_helper
-from pylib.utils import base_error
-from pylib.utils import device_temp_file
-from pylib.utils import host_utils
-from pylib.utils import md5sum
-from pylib.utils import parallelizer
-from pylib.utils import timeout_retry
-from pylib.utils import zip_utils
-
-_DEFAULT_TIMEOUT = 30
-_DEFAULT_RETRIES = 3
-
-# A sentinel object for default values
-# TODO(jbudorick,perezju): revisit how default values are handled by
-# the timeout_retry decorators.
-DEFAULT = object()
-
-_CONTROL_CHARGING_COMMANDS = [
-  {
-    # Nexus 4
-    'witness_file': '/sys/module/pm8921_charger/parameters/disabled',
-    'enable_command': 'echo 0 > /sys/module/pm8921_charger/parameters/disabled',
-    'disable_command':
-        'echo 1 > /sys/module/pm8921_charger/parameters/disabled',
-  },
-  {
-    # Nexus 5
-    # Setting the HIZ bit of the bq24192 causes the charger to actually ignore
-    # energy coming from USB. Setting the power_supply offline just updates the
-    # Android system to reflect that.
-    'witness_file': '/sys/kernel/debug/bq24192/INPUT_SRC_CONT',
-    'enable_command': (
-        'echo 0x4A > /sys/kernel/debug/bq24192/INPUT_SRC_CONT && '
-        'echo 1 > /sys/class/power_supply/usb/online'),
-    'disable_command': (
-        'echo 0xCA > /sys/kernel/debug/bq24192/INPUT_SRC_CONT && '
-        'chmod 644 /sys/class/power_supply/usb/online && '
-        'echo 0 > /sys/class/power_supply/usb/online'),
-  },
-]
-
-
-@decorators.WithExplicitTimeoutAndRetries(
-    _DEFAULT_TIMEOUT, _DEFAULT_RETRIES)
-def GetAVDs():
-  """Returns a list of Android Virtual Devices.
-
-  Returns:
-    A list containing the configured AVDs.
-  """
-  lines = cmd_helper.GetCmdOutput([
-      os.path.join(constants.ANDROID_SDK_ROOT, 'tools', 'android'),
-      'list', 'avd']).splitlines()
-  avds = []
-  for line in lines:
-    if 'Name:' not in line:
-      continue
-    key, value = (s.strip() for s in line.split(':', 1))
-    if key == 'Name':
-      avds.append(value)
-  return avds
-
-
-@decorators.WithExplicitTimeoutAndRetries(
-    _DEFAULT_TIMEOUT, _DEFAULT_RETRIES)
-def RestartServer():
-  """Restarts the adb server.
-
-  Raises:
-    CommandFailedError if we fail to kill or restart the server.
-  """
-  def adb_killed():
-    return not adb_wrapper.AdbWrapper.IsServerOnline()
-
-  def adb_started():
-    return adb_wrapper.AdbWrapper.IsServerOnline()
-
-  adb_wrapper.AdbWrapper.KillServer()
-  if not timeout_retry.WaitFor(adb_killed, wait_period=1, max_tries=5):
-    # TODO(perezju): raise an exception after fixng http://crbug.com/442319
-    logging.warning('Failed to kill adb server')
-  adb_wrapper.AdbWrapper.StartServer()
-  if not timeout_retry.WaitFor(adb_started, wait_period=1, max_tries=5):
-    raise device_errors.CommandFailedError('Failed to start adb server')
-
-
-def _GetTimeStamp():
-  """Return a basic ISO 8601 time stamp with the current local time."""
-  return time.strftime('%Y%m%dT%H%M%S', time.localtime())
-
-
-def _JoinLines(lines):
-  # makes sure that the last line is also terminated, and is more memory
-  # efficient than first appending an end-line to each line and then joining
-  # all of them together.
-  return ''.join(s for line in lines for s in (line, '\n'))
-
-
-class DeviceUtils(object):
-
-  _MAX_ADB_COMMAND_LENGTH = 512
-  _MAX_ADB_OUTPUT_LENGTH = 32768
-  _LAUNCHER_FOCUSED_RE = re.compile(
-      '\s*mCurrentFocus.*(Launcher|launcher).*')
-  _VALID_SHELL_VARIABLE = re.compile('^[a-zA-Z_][a-zA-Z0-9_]*$')
-
-  # Property in /data/local.prop that controls Java assertions.
-  JAVA_ASSERT_PROPERTY = 'dalvik.vm.enableassertions'
-
-  def __init__(self, device, default_timeout=_DEFAULT_TIMEOUT,
-               default_retries=_DEFAULT_RETRIES):
-    """DeviceUtils constructor.
-
-    Args:
-      device: Either a device serial, an existing AdbWrapper instance, or an
-              an existing AndroidCommands instance.
-      default_timeout: An integer containing the default number of seconds to
-                       wait for an operation to complete if no explicit value
-                       is provided.
-      default_retries: An integer containing the default number or times an
-                       operation should be retried on failure if no explicit
-                       value is provided.
-    """
-    self.adb = None
-    self.old_interface = None
-    if isinstance(device, basestring):
-      self.adb = adb_wrapper.AdbWrapper(device)
-      self.old_interface = pylib.android_commands.AndroidCommands(device)
-    elif isinstance(device, adb_wrapper.AdbWrapper):
-      self.adb = device
-      self.old_interface = pylib.android_commands.AndroidCommands(str(device))
-    elif isinstance(device, pylib.android_commands.AndroidCommands):
-      self.adb = adb_wrapper.AdbWrapper(device.GetDevice())
-      self.old_interface = device
-    else:
-      raise ValueError('Unsupported device value: %r' % device)
-    self._commands_installed = None
-    self._default_timeout = default_timeout
-    self._default_retries = default_retries
-    self._cache = {}
-    self._client_caches = {}
-    assert hasattr(self, decorators.DEFAULT_TIMEOUT_ATTR)
-    assert hasattr(self, decorators.DEFAULT_RETRIES_ATTR)
-
-  def __eq__(self, other):
-    """Checks whether |other| refers to the same device as |self|.
-
-    Args:
-      other: The object to compare to. This can be a basestring, an instance
-        of adb_wrapper.AdbWrapper, or an instance of DeviceUtils.
-    Returns:
-      Whether |other| refers to the same device as |self|.
-    """
-    return self.adb.GetDeviceSerial() == str(other)
-
-  def __lt__(self, other):
-    """Compares two instances of DeviceUtils.
-
-    This merely compares their serial numbers.
-
-    Args:
-      other: The instance of DeviceUtils to compare to.
-    Returns:
-      Whether |self| is less than |other|.
-    """
-    return self.adb.GetDeviceSerial() < other.adb.GetDeviceSerial()
-
-  def __str__(self):
-    """Returns the device serial."""
-    return self.adb.GetDeviceSerial()
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def IsOnline(self, timeout=None, retries=None):
-    """Checks whether the device is online.
-
-    Args:
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Returns:
-      True if the device is online, False otherwise.
-
-    Raises:
-      CommandTimeoutError on timeout.
-    """
-    try:
-      return self.adb.GetState() == 'device'
-    except base_error.BaseError as exc:
-      logging.info('Failed to get state: %s', exc)
-      return False
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def HasRoot(self, timeout=None, retries=None):
-    """Checks whether or not adbd has root privileges.
-
-    Args:
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Returns:
-      True if adbd has root privileges, False otherwise.
-
-    Raises:
-      CommandTimeoutError on timeout.
-      DeviceUnreachableError on missing device.
-    """
-    try:
-      self.RunShellCommand('ls /root', check_return=True)
-      return True
-    except device_errors.AdbCommandFailedError:
-      return False
-
-  def NeedsSU(self, timeout=DEFAULT, retries=DEFAULT):
-    """Checks whether 'su' is needed to access protected resources.
-
-    Args:
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Returns:
-      True if 'su' is available on the device and is needed to to access
-        protected resources; False otherwise if either 'su' is not available
-        (e.g. because the device has a user build), or not needed (because adbd
-        already has root privileges).
-
-    Raises:
-      CommandTimeoutError on timeout.
-      DeviceUnreachableError on missing device.
-    """
-    if 'needs_su' not in self._cache:
-      try:
-        self.RunShellCommand(
-            'su -c ls /root && ! ls /root', check_return=True,
-            timeout=self._default_timeout if timeout is DEFAULT else timeout,
-            retries=self._default_retries if retries is DEFAULT else retries)
-        self._cache['needs_su'] = True
-      except device_errors.AdbCommandFailedError:
-        self._cache['needs_su'] = False
-    return self._cache['needs_su']
-
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def EnableRoot(self, timeout=None, retries=None):
-    """Restarts adbd with root privileges.
-
-    Args:
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Raises:
-      CommandFailedError if root could not be enabled.
-      CommandTimeoutError on timeout.
-    """
-    if self.IsUserBuild():
-      raise device_errors.CommandFailedError(
-          'Cannot enable root in user builds.', str(self))
-    if 'needs_su' in self._cache:
-      del self._cache['needs_su']
-    self.adb.Root()
-    self.WaitUntilFullyBooted()
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def IsUserBuild(self, timeout=None, retries=None):
-    """Checks whether or not the device is running a user build.
-
-    Args:
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Returns:
-      True if the device is running a user build, False otherwise (i.e. if
-        it's running a userdebug build).
-
-    Raises:
-      CommandTimeoutError on timeout.
-      DeviceUnreachableError on missing device.
-    """
-    return self.build_type == 'user'
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def GetExternalStoragePath(self, timeout=None, retries=None):
-    """Get the device's path to its SD card.
-
-    Args:
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Returns:
-      The device's path to its SD card.
-
-    Raises:
-      CommandFailedError if the external storage path could not be determined.
-      CommandTimeoutError on timeout.
-      DeviceUnreachableError on missing device.
-    """
-    if 'external_storage' in self._cache:
-      return self._cache['external_storage']
-
-    value = self.RunShellCommand('echo $EXTERNAL_STORAGE',
-                                 single_line=True,
-                                 check_return=True)
-    if not value:
-      raise device_errors.CommandFailedError('$EXTERNAL_STORAGE is not set',
-                                             str(self))
-    self._cache['external_storage'] = value
-    return value
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def GetApplicationPaths(self, package, timeout=None, retries=None):
-    """Get the paths of the installed apks on the device for the given package.
-
-    Args:
-      package: Name of the package.
-
-    Returns:
-      List of paths to the apks on the device for the given package.
-    """
-    # 'pm path' is liable to incorrectly exit with a nonzero number starting
-    # in Lollipop.
-    # TODO(jbudorick): Check if this is fixed as new Android versions are
-    # released to put an upper bound on this.
-    should_check_return = (self.build_version_sdk <
-                           constants.ANDROID_SDK_VERSION_CODES.LOLLIPOP)
-    output = self.RunShellCommand(
-        ['pm', 'path', package], check_return=should_check_return)
-    apks = []
-    for line in output:
-      if not line.startswith('package:'):
-        raise device_errors.CommandFailedError(
-            'pm path returned: %r' % '\n'.join(output), str(self))
-      apks.append(line[len('package:'):])
-    return apks
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def GetApplicationDataDirectory(self, package, timeout=None, retries=None):
-    """Get the data directory on the device for the given package.
-
-    Args:
-      package: Name of the package.
-
-    Returns:
-      The package's data directory, or None if the package doesn't exist on the
-      device.
-    """
-    try:
-      output = self._RunPipedShellCommand(
-          'pm dump %s | grep dataDir=' % cmd_helper.SingleQuote(package))
-      for line in output:
-        _, _, dataDir = line.partition('dataDir=')
-        if dataDir:
-          return dataDir
-    except device_errors.CommandFailedError:
-      logging.exception('Could not find data directory for %s', package)
-    return None
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def WaitUntilFullyBooted(self, wifi=False, timeout=None, retries=None):
-    """Wait for the device to fully boot.
-
-    This means waiting for the device to boot, the package manager to be
-    available, and the SD card to be ready. It can optionally mean waiting
-    for wifi to come up, too.
-
-    Args:
-      wifi: A boolean indicating if we should wait for wifi to come up or not.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Raises:
-      CommandFailedError on failure.
-      CommandTimeoutError if one of the component waits times out.
-      DeviceUnreachableError if the device becomes unresponsive.
-    """
-    def sd_card_ready():
-      try:
-        self.RunShellCommand(['test', '-d', self.GetExternalStoragePath()],
-                             check_return=True)
-        return True
-      except device_errors.AdbCommandFailedError:
-        return False
-
-    def pm_ready():
-      try:
-        return self.GetApplicationPaths('android')
-      except device_errors.CommandFailedError:
-        return False
-
-    def boot_completed():
-      return self.GetProp('sys.boot_completed') == '1'
-
-    def wifi_enabled():
-      return 'Wi-Fi is enabled' in self.RunShellCommand(['dumpsys', 'wifi'],
-                                                        check_return=False)
-
-    self.adb.WaitForDevice()
-    timeout_retry.WaitFor(sd_card_ready)
-    timeout_retry.WaitFor(pm_ready)
-    timeout_retry.WaitFor(boot_completed)
-    if wifi:
-      timeout_retry.WaitFor(wifi_enabled)
-
-  REBOOT_DEFAULT_TIMEOUT = 10 * _DEFAULT_TIMEOUT
-  REBOOT_DEFAULT_RETRIES = _DEFAULT_RETRIES
-
-  @decorators.WithTimeoutAndRetriesDefaults(
-      REBOOT_DEFAULT_TIMEOUT,
-      REBOOT_DEFAULT_RETRIES)
-  def Reboot(self, block=True, wifi=False, timeout=None, retries=None):
-    """Reboot the device.
-
-    Args:
-      block: A boolean indicating if we should wait for the reboot to complete.
-      wifi: A boolean indicating if we should wait for wifi to be enabled after
-        the reboot. The option has no effect unless |block| is also True.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Raises:
-      CommandTimeoutError on timeout.
-      DeviceUnreachableError on missing device.
-    """
-    def device_offline():
-      return not self.IsOnline()
-
-    self.adb.Reboot()
-    self._ClearCache()
-    timeout_retry.WaitFor(device_offline, wait_period=1)
-    if block:
-      self.WaitUntilFullyBooted(wifi=wifi)
-
-  INSTALL_DEFAULT_TIMEOUT = 4 * _DEFAULT_TIMEOUT
-  INSTALL_DEFAULT_RETRIES = _DEFAULT_RETRIES
-
-  @decorators.WithTimeoutAndRetriesDefaults(
-      INSTALL_DEFAULT_TIMEOUT,
-      INSTALL_DEFAULT_RETRIES)
-  def Install(self, apk_path, reinstall=False, timeout=None, retries=None):
-    """Install an APK.
-
-    Noop if an identical APK is already installed.
-
-    Args:
-      apk_path: A string containing the path to the APK to install.
-      reinstall: A boolean indicating if we should keep any existing app data.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Raises:
-      CommandFailedError if the installation fails.
-      CommandTimeoutError if the installation times out.
-      DeviceUnreachableError on missing device.
-    """
-    package_name = apk_helper.GetPackageName(apk_path)
-    device_paths = self.GetApplicationPaths(package_name)
-    if device_paths:
-      if len(device_paths) > 1:
-        logging.warning(
-            'Installing single APK (%s) when split APKs (%s) are currently '
-            'installed.', apk_path, ' '.join(device_paths))
-      (files_to_push, _) = self._GetChangedAndStaleFiles(
-          apk_path, device_paths[0])
-      should_install = bool(files_to_push)
-      if should_install and not reinstall:
-        self.adb.Uninstall(package_name)
-    else:
-      should_install = True
-    if should_install:
-      self.adb.Install(apk_path, reinstall=reinstall)
-
-  @decorators.WithTimeoutAndRetriesDefaults(
-      INSTALL_DEFAULT_TIMEOUT,
-      INSTALL_DEFAULT_RETRIES)
-  def InstallSplitApk(self, base_apk, split_apks, reinstall=False,
-                      timeout=None, retries=None):
-    """Install a split APK.
-
-    Noop if all of the APK splits are already installed.
-
-    Args:
-      base_apk: A string of the path to the base APK.
-      split_apks: A list of strings of paths of all of the APK splits.
-      reinstall: A boolean indicating if we should keep any existing app data.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Raises:
-      CommandFailedError if the installation fails.
-      CommandTimeoutError if the installation times out.
-      DeviceUnreachableError on missing device.
-      DeviceVersionError if device SDK is less than Android L.
-    """
-    self._CheckSdkLevel(constants.ANDROID_SDK_VERSION_CODES.LOLLIPOP)
-
-    all_apks = [base_apk] + split_select.SelectSplits(
-        self, base_apk, split_apks)
-    package_name = apk_helper.GetPackageName(base_apk)
-    device_apk_paths = self.GetApplicationPaths(package_name)
-
-    if device_apk_paths:
-      partial_install_package = package_name
-      device_checksums = md5sum.CalculateDeviceMd5Sums(device_apk_paths, self)
-      host_checksums = md5sum.CalculateHostMd5Sums(all_apks)
-      apks_to_install = [k for (k, v) in host_checksums.iteritems()
-                         if v not in device_checksums.values()]
-      if apks_to_install and not reinstall:
-        self.adb.Uninstall(package_name)
-        partial_install_package = None
-        apks_to_install = all_apks
-    else:
-      partial_install_package = None
-      apks_to_install = all_apks
-    if apks_to_install:
-      self.adb.InstallMultiple(
-          apks_to_install, partial=partial_install_package, reinstall=reinstall)
-
-  def _CheckSdkLevel(self, required_sdk_level):
-    """Raises an exception if the device does not have the required SDK level.
-    """
-    if self.build_version_sdk < required_sdk_level:
-      raise device_errors.DeviceVersionError(
-          ('Requires SDK level %s, device is SDK level %s' %
-           (required_sdk_level, self.build_version_sdk)),
-           device_serial=self.adb.GetDeviceSerial())
-
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def RunShellCommand(self, cmd, check_return=False, cwd=None, env=None,
-                      as_root=False, single_line=False, large_output=False,
-                      timeout=None, retries=None):
-    """Run an ADB shell command.
-
-    The command to run |cmd| should be a sequence of program arguments or else
-    a single string.
-
-    When |cmd| is a sequence, it is assumed to contain the name of the command
-    to run followed by its arguments. In this case, arguments are passed to the
-    command exactly as given, without any further processing by the shell. This
-    allows to easily pass arguments containing spaces or special characters
-    without having to worry about getting quoting right. Whenever possible, it
-    is recomended to pass |cmd| as a sequence.
-
-    When |cmd| is given as a string, it will be interpreted and run by the
-    shell on the device.
-
-    This behaviour is consistent with that of command runners in cmd_helper as
-    well as Python's own subprocess.Popen.
-
-    TODO(perezju) Change the default of |check_return| to True when callers
-      have switched to the new behaviour.
-
-    Args:
-      cmd: A string with the full command to run on the device, or a sequence
-        containing the command and its arguments.
-      check_return: A boolean indicating whether or not the return code should
-        be checked.
-      cwd: The device directory in which the command should be run.
-      env: The environment variables with which the command should be run.
-      as_root: A boolean indicating whether the shell command should be run
-        with root privileges.
-      single_line: A boolean indicating if only a single line of output is
-        expected.
-      large_output: Uses a work-around for large shell command output. Without
-        this large output will be truncated.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Returns:
-      If single_line is False, the output of the command as a list of lines,
-      otherwise, a string with the unique line of output emmited by the command
-      (with the optional newline at the end stripped).
-
-    Raises:
-      AdbCommandFailedError if check_return is True and the exit code of
-        the command run on the device is non-zero.
-      CommandFailedError if single_line is True but the output contains two or
-        more lines.
-      CommandTimeoutError on timeout.
-      DeviceUnreachableError on missing device.
-    """
-    def env_quote(key, value):
-      if not DeviceUtils._VALID_SHELL_VARIABLE.match(key):
-        raise KeyError('Invalid shell variable name %r' % key)
-      # using double quotes here to allow interpolation of shell variables
-      return '%s=%s' % (key, cmd_helper.DoubleQuote(value))
-
-    def run(cmd):
-      return self.adb.Shell(cmd)
-
-    def handle_check_return(cmd):
-      try:
-        return run(cmd)
-      except device_errors.AdbCommandFailedError as exc:
-        if check_return:
-          raise
-        else:
-          return exc.output
-
-    def handle_large_command(cmd):
-      if len(cmd) < self._MAX_ADB_COMMAND_LENGTH:
-        return handle_check_return(cmd)
-      else:
-        with device_temp_file.DeviceTempFile(self.adb, suffix='.sh') as script:
-          self._WriteFileWithPush(script.name, cmd)
-          logging.info('Large shell command will be run from file: %s ...',
-                       cmd[:100])
-          return handle_check_return('sh %s' % script.name_quoted)
-
-    def handle_large_output(cmd, large_output_mode):
-      if large_output_mode:
-        with device_temp_file.DeviceTempFile(self.adb) as large_output_file:
-          cmd = '%s > %s' % (cmd, large_output_file.name)
-          logging.debug('Large output mode enabled. Will write output to '
-                        'device and read results from file.')
-          handle_large_command(cmd)
-          return self.ReadFile(large_output_file.name, force_pull=True)
-      else:
-        try:
-          return handle_large_command(cmd)
-        except device_errors.AdbCommandFailedError as exc:
-          if exc.status is None:
-            logging.exception('No output found for %s', cmd)
-            logging.warning('Attempting to run in large_output mode.')
-            logging.warning('Use RunShellCommand(..., large_output=True) for '
-                            'shell commands that expect a lot of output.')
-            return handle_large_output(cmd, True)
-          else:
-            raise
-
-    if not isinstance(cmd, basestring):
-      cmd = ' '.join(cmd_helper.SingleQuote(s) for s in cmd)
-    if env:
-      env = ' '.join(env_quote(k, v) for k, v in env.iteritems())
-      cmd = '%s %s' % (env, cmd)
-    if cwd:
-      cmd = 'cd %s && %s' % (cmd_helper.SingleQuote(cwd), cmd)
-    if as_root and self.NeedsSU():
-      # "su -c sh -c" allows using shell features in |cmd|
-      cmd = 'su -c sh -c %s' % cmd_helper.SingleQuote(cmd)
-
-    output = handle_large_output(cmd, large_output).splitlines()
-
-    if single_line:
-      if not output:
-        return ''
-      elif len(output) == 1:
-        return output[0]
-      else:
-        msg = 'one line of output was expected, but got: %s'
-        raise device_errors.CommandFailedError(msg % output, str(self))
-    else:
-      return output
-
-  def _RunPipedShellCommand(self, script, **kwargs):
-    PIPESTATUS_LEADER = 'PIPESTATUS: '
-
-    script += '; echo "%s${PIPESTATUS[@]}"' % PIPESTATUS_LEADER
-    kwargs['check_return'] = True
-    output = self.RunShellCommand(script, **kwargs)
-    pipestatus_line = output[-1]
-
-    if not pipestatus_line.startswith(PIPESTATUS_LEADER):
-      logging.error('Pipe exit statuses of shell script missing.')
-      raise device_errors.AdbShellCommandFailedError(
-          script, output, status=None,
-          device_serial=self.adb.GetDeviceSerial())
-
-    output = output[:-1]
-    statuses = [
-        int(s) for s in pipestatus_line[len(PIPESTATUS_LEADER):].split()]
-    if any(statuses):
-      raise device_errors.AdbShellCommandFailedError(
-          script, output, status=statuses,
-          device_serial=self.adb.GetDeviceSerial())
-    return output
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def KillAll(self, process_name, signum=device_signal.SIGKILL, as_root=False,
-              blocking=False, quiet=False, timeout=None, retries=None):
-    """Kill all processes with the given name on the device.
-
-    Args:
-      process_name: A string containing the name of the process to kill.
-      signum: An integer containing the signal number to send to kill. Defaults
-              to SIGKILL (9).
-      as_root: A boolean indicating whether the kill should be executed with
-               root privileges.
-      blocking: A boolean indicating whether we should wait until all processes
-                with the given |process_name| are dead.
-      quiet: A boolean indicating whether to ignore the fact that no processes
-             to kill were found.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Returns:
-      The number of processes attempted to kill.
-
-    Raises:
-      CommandFailedError if no process was killed and |quiet| is False.
-      CommandTimeoutError on timeout.
-      DeviceUnreachableError on missing device.
-    """
-    pids = self.GetPids(process_name)
-    if not pids:
-      if quiet:
-        return 0
-      else:
-        raise device_errors.CommandFailedError(
-            'No process "%s"' % process_name, str(self))
-
-    cmd = ['kill', '-%d' % signum] + pids.values()
-    self.RunShellCommand(cmd, as_root=as_root, check_return=True)
-
-    if blocking:
-      # TODO(perezu): use timeout_retry.WaitFor
-      wait_period = 0.1
-      while self.GetPids(process_name):
-        time.sleep(wait_period)
-
-    return len(pids)
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def StartActivity(self, intent_obj, blocking=False, trace_file_name=None,
-                    force_stop=False, timeout=None, retries=None):
-    """Start package's activity on the device.
-
-    Args:
-      intent_obj: An Intent object to send.
-      blocking: A boolean indicating whether we should wait for the activity to
-                finish launching.
-      trace_file_name: If present, a string that both indicates that we want to
-                       profile the activity and contains the path to which the
-                       trace should be saved.
-      force_stop: A boolean indicating whether we should stop the activity
-                  before starting it.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Raises:
-      CommandFailedError if the activity could not be started.
-      CommandTimeoutError on timeout.
-      DeviceUnreachableError on missing device.
-    """
-    cmd = ['am', 'start']
-    if blocking:
-      cmd.append('-W')
-    if trace_file_name:
-      cmd.extend(['--start-profiler', trace_file_name])
-    if force_stop:
-      cmd.append('-S')
-    cmd.extend(intent_obj.am_args)
-    for line in self.RunShellCommand(cmd, check_return=True):
-      if line.startswith('Error:'):
-        raise device_errors.CommandFailedError(line, str(self))
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def StartInstrumentation(self, component, finish=True, raw=False,
-                           extras=None, timeout=None, retries=None):
-    if extras is None:
-      extras = {}
-
-    cmd = ['am', 'instrument']
-    if finish:
-      cmd.append('-w')
-    if raw:
-      cmd.append('-r')
-    for k, v in extras.iteritems():
-      cmd.extend(['-e', str(k), str(v)])
-    cmd.append(component)
-    return self.RunShellCommand(cmd, check_return=True, large_output=True)
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def BroadcastIntent(self, intent_obj, timeout=None, retries=None):
-    """Send a broadcast intent.
-
-    Args:
-      intent: An Intent to broadcast.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Raises:
-      CommandTimeoutError on timeout.
-      DeviceUnreachableError on missing device.
-    """
-    cmd = ['am', 'broadcast'] + intent_obj.am_args
-    self.RunShellCommand(cmd, check_return=True)
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def GoHome(self, timeout=None, retries=None):
-    """Return to the home screen and obtain launcher focus.
-
-    This command launches the home screen and attempts to obtain
-    launcher focus until the timeout is reached.
-
-    Args:
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Raises:
-      CommandTimeoutError on timeout.
-      DeviceUnreachableError on missing device.
-    """
-    def is_launcher_focused():
-      output = self.RunShellCommand(['dumpsys', 'window', 'windows'],
-                                    check_return=True, large_output=True)
-      return any(self._LAUNCHER_FOCUSED_RE.match(l) for l in output)
-
-    def dismiss_popups():
-      # There is a dialog present; attempt to get rid of it.
-      # Not all dialogs can be dismissed with back.
-      self.SendKeyEvent(keyevent.KEYCODE_ENTER)
-      self.SendKeyEvent(keyevent.KEYCODE_BACK)
-      return is_launcher_focused()
-
-    # If Home is already focused, return early to avoid unnecessary work.
-    if is_launcher_focused():
-      return
-
-    self.StartActivity(
-        intent.Intent(action='android.intent.action.MAIN',
-                      category='android.intent.category.HOME'),
-        blocking=True)
-
-    if not is_launcher_focused():
-      timeout_retry.WaitFor(dismiss_popups, wait_period=1)
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def ForceStop(self, package, timeout=None, retries=None):
-    """Close the application.
-
-    Args:
-      package: A string containing the name of the package to stop.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Raises:
-      CommandTimeoutError on timeout.
-      DeviceUnreachableError on missing device.
-    """
-    self.RunShellCommand(['am', 'force-stop', package], check_return=True)
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def ClearApplicationState(self, package, timeout=None, retries=None):
-    """Clear all state for the given package.
-
-    Args:
-      package: A string containing the name of the package to stop.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Raises:
-      CommandTimeoutError on timeout.
-      DeviceUnreachableError on missing device.
-    """
-    # Check that the package exists before clearing it for android builds below
-    # JB MR2. Necessary because calling pm clear on a package that doesn't exist
-    # may never return.
-    if ((self.build_version_sdk >=
-         constants.ANDROID_SDK_VERSION_CODES.JELLY_BEAN_MR2)
-        or self.GetApplicationPaths(package)):
-      self.RunShellCommand(['pm', 'clear', package], check_return=True)
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def SendKeyEvent(self, keycode, timeout=None, retries=None):
-    """Sends a keycode to the device.
-
-    See the pylib.constants.keyevent module for suitable keycode values.
-
-    Args:
-      keycode: A integer keycode to send to the device.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Raises:
-      CommandTimeoutError on timeout.
-      DeviceUnreachableError on missing device.
-    """
-    self.RunShellCommand(['input', 'keyevent', format(keycode, 'd')],
-                         check_return=True)
-
-  PUSH_CHANGED_FILES_DEFAULT_TIMEOUT = 10 * _DEFAULT_TIMEOUT
-  PUSH_CHANGED_FILES_DEFAULT_RETRIES = _DEFAULT_RETRIES
-
-  @decorators.WithTimeoutAndRetriesDefaults(
-      PUSH_CHANGED_FILES_DEFAULT_TIMEOUT,
-      PUSH_CHANGED_FILES_DEFAULT_RETRIES)
-  def PushChangedFiles(self, host_device_tuples, timeout=None,
-                       retries=None, delete_device_stale=False):
-    """Push files to the device, skipping files that don't need updating.
-
-    When a directory is pushed, it is traversed recursively on the host and
-    all files in it are pushed to the device as needed.
-    Additionally, if delete_device_stale option is True,
-    files that exist on the device but don't exist on the host are deleted.
-
-    Args:
-      host_device_tuples: A list of (host_path, device_path) tuples, where
-        |host_path| is an absolute path of a file or directory on the host
-        that should be minimially pushed to the device, and |device_path| is
-        an absolute path of the destination on the device.
-      timeout: timeout in seconds
-      retries: number of retries
-      delete_device_stale: option to delete stale files on device
-
-    Raises:
-      CommandFailedError on failure.
-      CommandTimeoutError on timeout.
-      DeviceUnreachableError on missing device.
-    """
-
-    all_changed_files = []
-    all_stale_files = []
-    for h, d in host_device_tuples:
-      if os.path.isdir(h):
-        self.RunShellCommand(['mkdir', '-p', d], check_return=True)
-      changed_files, stale_files = (
-          self._GetChangedAndStaleFiles(h, d, delete_device_stale))
-      all_changed_files += changed_files
-      all_stale_files += stale_files
-
-    if delete_device_stale:
-      self.RunShellCommand(['rm', '-f'] + all_stale_files,
-                             check_return=True)
-
-    if not all_changed_files:
-      return
-
-    self._PushFilesImpl(host_device_tuples, all_changed_files)
-
-  def _GetChangedAndStaleFiles(self, host_path, device_path, track_stale=False):
-    """Get files to push and delete
-
-    Args:
-      host_path: an absolute path of a file or directory on the host
-      device_path: an absolute path of a file or directory on the device
-      track_stale: whether to bother looking for stale files (slower)
-
-    Returns:
-      a two-element tuple
-      1st element: a list of (host_files_path, device_files_path) tuples to push
-      2nd element: a list of stale files under device_path, or [] when
-        track_stale == False
-    """
-    real_host_path = os.path.realpath(host_path)
-    try:
-      real_device_path = self.RunShellCommand(
-          ['realpath', device_path], single_line=True, check_return=True)
-    except device_errors.CommandFailedError:
-      real_device_path = None
-    if not real_device_path:
-      return ([(host_path, device_path)], [])
-
-    try:
-      host_checksums = md5sum.CalculateHostMd5Sums([real_host_path])
-      interesting_device_paths = [real_device_path]
-      if not track_stale and os.path.isdir(real_host_path):
-        interesting_device_paths = [
-            posixpath.join(real_device_path, os.path.relpath(p, real_host_path))
-            for p in host_checksums.keys()]
-      device_checksums = md5sum.CalculateDeviceMd5Sums(
-          interesting_device_paths, self)
-    except EnvironmentError as e:
-      logging.warning('Error calculating md5: %s', e)
-      return ([(host_path, device_path)], [])
-
-    if os.path.isfile(host_path):
-      host_checksum = host_checksums.get(real_host_path)
-      device_checksum = device_checksums.get(real_device_path)
-      if host_checksum != device_checksum:
-        return ([(host_path, device_path)], [])
-      else:
-        return ([], [])
-    else:
-      to_push = []
-      for host_abs_path, host_checksum in host_checksums.iteritems():
-        device_abs_path = '%s/%s' % (
-            real_device_path, os.path.relpath(host_abs_path, real_host_path))
-        device_checksum = device_checksums.pop(device_abs_path, None)
-        if device_checksum != host_checksum:
-          to_push.append((host_abs_path, device_abs_path))
-      to_delete = device_checksums.keys()
-      return (to_push, to_delete)
-
-  def _PushFilesImpl(self, host_device_tuples, files):
-    size = sum(host_utils.GetRecursiveDiskUsage(h) for h, _ in files)
-    file_count = len(files)
-    dir_size = sum(host_utils.GetRecursiveDiskUsage(h)
-                   for h, _ in host_device_tuples)
-    dir_file_count = 0
-    for h, _ in host_device_tuples:
-      if os.path.isdir(h):
-        dir_file_count += sum(len(f) for _r, _d, f in os.walk(h))
-      else:
-        dir_file_count += 1
-
-    push_duration = self._ApproximateDuration(
-        file_count, file_count, size, False)
-    dir_push_duration = self._ApproximateDuration(
-        len(host_device_tuples), dir_file_count, dir_size, False)
-    zip_duration = self._ApproximateDuration(1, 1, size, True)
-
-    self._InstallCommands()
-
-    if dir_push_duration < push_duration and (
-        dir_push_duration < zip_duration or not self._commands_installed):
-      self._PushChangedFilesIndividually(host_device_tuples)
-    elif push_duration < zip_duration or not self._commands_installed:
-      self._PushChangedFilesIndividually(files)
-    else:
-      self._PushChangedFilesZipped(files)
-      self.RunShellCommand(
-          ['chmod', '-R', '777'] + [d for _, d in host_device_tuples],
-          as_root=True, check_return=True)
-
-  def _InstallCommands(self):
-    if self._commands_installed is None:
-      try:
-        if not install_commands.Installed(self):
-          install_commands.InstallCommands(self)
-        self._commands_installed = True
-      except Exception as e:
-        logging.warning('unzip not available: %s' % str(e))
-        self._commands_installed = False
-
-  @staticmethod
-  def _ApproximateDuration(adb_calls, file_count, byte_count, is_zipping):
-    # We approximate the time to push a set of files to a device as:
-    #   t = c1 * a + c2 * f + c3 + b / c4 + b / (c5 * c6), where
-    #     t: total time (sec)
-    #     c1: adb call time delay (sec)
-    #     a: number of times adb is called (unitless)
-    #     c2: push time delay (sec)
-    #     f: number of files pushed via adb (unitless)
-    #     c3: zip time delay (sec)
-    #     c4: zip rate (bytes/sec)
-    #     b: total number of bytes (bytes)
-    #     c5: transfer rate (bytes/sec)
-    #     c6: compression ratio (unitless)
-
-    # All of these are approximations.
-    ADB_CALL_PENALTY = 0.1 # seconds
-    ADB_PUSH_PENALTY = 0.01 # seconds
-    ZIP_PENALTY = 2.0 # seconds
-    ZIP_RATE = 10000000.0 # bytes / second
-    TRANSFER_RATE = 2000000.0 # bytes / second
-    COMPRESSION_RATIO = 2.0 # unitless
-
-    adb_call_time = ADB_CALL_PENALTY * adb_calls
-    adb_push_setup_time = ADB_PUSH_PENALTY * file_count
-    if is_zipping:
-      zip_time = ZIP_PENALTY + byte_count / ZIP_RATE
-      transfer_time = byte_count / (TRANSFER_RATE * COMPRESSION_RATIO)
-    else:
-      zip_time = 0
-      transfer_time = byte_count / TRANSFER_RATE
-    return adb_call_time + adb_push_setup_time + zip_time + transfer_time
-
-  def _PushChangedFilesIndividually(self, files):
-    for h, d in files:
-      self.adb.Push(h, d)
-
-  def _PushChangedFilesZipped(self, files):
-    if not files:
-      return
-
-    with tempfile.NamedTemporaryFile(suffix='.zip') as zip_file:
-      zip_proc = multiprocessing.Process(
-          target=DeviceUtils._CreateDeviceZip,
-          args=(zip_file.name, files))
-      zip_proc.start()
-      zip_proc.join()
-
-      zip_on_device = '%s/tmp.zip' % self.GetExternalStoragePath()
-      try:
-        self.adb.Push(zip_file.name, zip_on_device)
-        self.RunShellCommand(
-            ['unzip', zip_on_device],
-            as_root=True,
-            env={'PATH': '%s:$PATH' % install_commands.BIN_DIR},
-            check_return=True)
-      finally:
-        if zip_proc.is_alive():
-          zip_proc.terminate()
-        if self.IsOnline():
-          self.RunShellCommand(['rm', zip_on_device], check_return=True)
-
-  @staticmethod
-  def _CreateDeviceZip(zip_path, host_device_tuples):
-    with zipfile.ZipFile(zip_path, 'w') as zip_file:
-      for host_path, device_path in host_device_tuples:
-        zip_utils.WriteToZipFile(zip_file, host_path, device_path)
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def FileExists(self, device_path, timeout=None, retries=None):
-    """Checks whether the given file exists on the device.
-
-    Args:
-      device_path: A string containing the absolute path to the file on the
-                   device.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Returns:
-      True if the file exists on the device, False otherwise.
-
-    Raises:
-      CommandTimeoutError on timeout.
-      DeviceUnreachableError on missing device.
-    """
-    try:
-      self.RunShellCommand(['test', '-e', device_path], check_return=True)
-      return True
-    except device_errors.AdbCommandFailedError:
-      return False
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def PullFile(self, device_path, host_path, timeout=None, retries=None):
-    """Pull a file from the device.
-
-    Args:
-      device_path: A string containing the absolute path of the file to pull
-                   from the device.
-      host_path: A string containing the absolute path of the destination on
-                 the host.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Raises:
-      CommandFailedError on failure.
-      CommandTimeoutError on timeout.
-    """
-    # Create the base dir if it doesn't exist already
-    dirname = os.path.dirname(host_path)
-    if dirname and not os.path.exists(dirname):
-      os.makedirs(dirname)
-    self.adb.Pull(device_path, host_path)
-
-  def _ReadFileWithPull(self, device_path):
-    try:
-      d = tempfile.mkdtemp()
-      host_temp_path = os.path.join(d, 'tmp_ReadFileWithPull')
-      self.adb.Pull(device_path, host_temp_path)
-      with open(host_temp_path, 'r') as host_temp:
-        return host_temp.read()
-    finally:
-      if os.path.exists(d):
-        shutil.rmtree(d)
-
-  _LS_RE = re.compile(
-      r'(?P<perms>\S+) +(?P<owner>\S+) +(?P<group>\S+) +(?:(?P<size>\d+) +)?'
-      + r'(?P<date>\S+) +(?P<time>\S+) +(?P<name>.+)$')
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def ReadFile(self, device_path, as_root=False, force_pull=False,
-               timeout=None, retries=None):
-    """Reads the contents of a file from the device.
-
-    Args:
-      device_path: A string containing the absolute path of the file to read
-                   from the device.
-      as_root: A boolean indicating whether the read should be executed with
-               root privileges.
-      force_pull: A boolean indicating whether to force the operation to be
-          performed by pulling a file from the device. The default is, when the
-          contents are short, to retrieve the contents using cat instead.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Returns:
-      The contents of |device_path| as a string. Contents are intepreted using
-      universal newlines, so the caller will see them encoded as '\n'. Also,
-      all lines will be terminated.
-
-    Raises:
-      AdbCommandFailedError if the file can't be read.
-      CommandTimeoutError on timeout.
-      DeviceUnreachableError on missing device.
-    """
-    def get_size(path):
-      # TODO(jbudorick): Implement a generic version of Stat() that handles
-      # as_root=True, then switch this implementation to use that.
-      ls_out = self.RunShellCommand(['ls', '-l', device_path], as_root=as_root,
-                                    check_return=True)
-      for line in ls_out:
-        m = self._LS_RE.match(line)
-        if m and m.group('name') == posixpath.basename(device_path):
-          return int(m.group('size'))
-      logging.warning('Could not determine size of %s.', device_path)
-      return None
-
-    if (not force_pull
-        and 0 < get_size(device_path) <= self._MAX_ADB_OUTPUT_LENGTH):
-      return _JoinLines(self.RunShellCommand(
-          ['cat', device_path], as_root=as_root, check_return=True))
-    elif as_root and self.NeedsSU():
-      with device_temp_file.DeviceTempFile(self.adb) as device_temp:
-        self.RunShellCommand(['cp', device_path, device_temp.name],
-                             as_root=True, check_return=True)
-        return self._ReadFileWithPull(device_temp.name)
-    else:
-      return self._ReadFileWithPull(device_path)
-
-  def _WriteFileWithPush(self, device_path, contents):
-    with tempfile.NamedTemporaryFile() as host_temp:
-      host_temp.write(contents)
-      host_temp.flush()
-      self.adb.Push(host_temp.name, device_path)
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def WriteFile(self, device_path, contents, as_root=False, force_push=False,
-                timeout=None, retries=None):
-    """Writes |contents| to a file on the device.
-
-    Args:
-      device_path: A string containing the absolute path to the file to write
-          on the device.
-      contents: A string containing the data to write to the device.
-      as_root: A boolean indicating whether the write should be executed with
-          root privileges (if available).
-      force_push: A boolean indicating whether to force the operation to be
-          performed by pushing a file to the device. The default is, when the
-          contents are short, to pass the contents using a shell script instead.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Raises:
-      CommandFailedError if the file could not be written on the device.
-      CommandTimeoutError on timeout.
-      DeviceUnreachableError on missing device.
-    """
-    if not force_push and len(contents) < self._MAX_ADB_COMMAND_LENGTH:
-      # If the contents are small, for efficieny we write the contents with
-      # a shell command rather than pushing a file.
-      cmd = 'echo -n %s > %s' % (cmd_helper.SingleQuote(contents),
-                                 cmd_helper.SingleQuote(device_path))
-      self.RunShellCommand(cmd, as_root=as_root, check_return=True)
-    elif as_root and self.NeedsSU():
-      # Adb does not allow to "push with su", so we first push to a temp file
-      # on a safe location, and then copy it to the desired location with su.
-      with device_temp_file.DeviceTempFile(self.adb) as device_temp:
-        self._WriteFileWithPush(device_temp.name, contents)
-        # Here we need 'cp' rather than 'mv' because the temp and
-        # destination files might be on different file systems (e.g.
-        # on internal storage and an external sd card).
-        self.RunShellCommand(['cp', device_temp.name, device_path],
-                             as_root=True, check_return=True)
-    else:
-      # If root is not needed, we can push directly to the desired location.
-      self._WriteFileWithPush(device_path, contents)
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def Ls(self, device_path, timeout=None, retries=None):
-    """Lists the contents of a directory on the device.
-
-    Args:
-      device_path: A string containing the path of the directory on the device
-                   to list.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Returns:
-      A list of pairs (filename, stat) for each file found in the directory,
-      where the stat object has the properties: st_mode, st_size, and st_time.
-
-    Raises:
-      AdbCommandFailedError if |device_path| does not specify a valid and
-          accessible directory in the device.
-      CommandTimeoutError on timeout.
-      DeviceUnreachableError on missing device.
-    """
-    return self.adb.Ls(device_path)
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def Stat(self, device_path, timeout=None, retries=None):
-    """Get the stat attributes of a file or directory on the device.
-
-    Args:
-      device_path: A string containing the path of from which to get attributes
-                   on the device.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Returns:
-      A stat object with the properties: st_mode, st_size, and st_time
-
-    Raises:
-      CommandFailedError if device_path cannot be found on the device.
-      CommandTimeoutError on timeout.
-      DeviceUnreachableError on missing device.
-    """
-    dirname, target = device_path.rsplit('/', 1)
-    for filename, stat in self.adb.Ls(dirname):
-      if filename == target:
-        return stat
-    raise device_errors.CommandFailedError(
-        'Cannot find file or directory: %r' % device_path, str(self))
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def SetJavaAsserts(self, enabled, timeout=None, retries=None):
-    """Enables or disables Java asserts.
-
-    Args:
-      enabled: A boolean indicating whether Java asserts should be enabled
-               or disabled.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Returns:
-      True if the device-side property changed and a restart is required as a
-      result, False otherwise.
-
-    Raises:
-      CommandTimeoutError on timeout.
-    """
-    def find_property(lines, property_name):
-      for index, line in enumerate(lines):
-        if line.strip() == '':
-          continue
-        key, value = (s.strip() for s in line.split('=', 1))
-        if key == property_name:
-          return index, value
-      return None, ''
-
-    new_value = 'all' if enabled else ''
-
-    # First ensure the desired property is persisted.
-    try:
-      properties = self.ReadFile(
-          constants.DEVICE_LOCAL_PROPERTIES_PATH).splitlines()
-    except device_errors.CommandFailedError:
-      properties = []
-    index, value = find_property(properties, self.JAVA_ASSERT_PROPERTY)
-    if new_value != value:
-      if new_value:
-        new_line = '%s=%s' % (self.JAVA_ASSERT_PROPERTY, new_value)
-        if index is None:
-          properties.append(new_line)
-        else:
-          properties[index] = new_line
-      else:
-        assert index is not None # since new_value == '' and new_value != value
-        properties.pop(index)
-      self.WriteFile(constants.DEVICE_LOCAL_PROPERTIES_PATH,
-                     _JoinLines(properties))
-
-    # Next, check the current runtime value is what we need, and
-    # if not, set it and report that a reboot is required.
-    value = self.GetProp(self.JAVA_ASSERT_PROPERTY)
-    if new_value != value:
-      self.SetProp(self.JAVA_ASSERT_PROPERTY, new_value)
-      return True
-    else:
-      return False
-
-  @property
-  def language(self):
-    """Returns the language setting on the device."""
-    return self.GetProp('persist.sys.language', cache=False)
-
-  @property
-  def country(self):
-    """Returns the country setting on the device."""
-    return self.GetProp('persist.sys.country', cache=False)
-
-  @property
-  def screen_density(self):
-    """Returns the screen density of the device."""
-    DPI_TO_DENSITY = {
-      120: 'ldpi',
-      160: 'mdpi',
-      240: 'hdpi',
-      320: 'xhdpi',
-      480: 'xxhdpi',
-      640: 'xxxhdpi',
-    }
-    dpi = int(self.GetProp('ro.sf.lcd_density', cache=True))
-    return DPI_TO_DENSITY.get(dpi, 'tvdpi')
-
-  @property
-  def build_description(self):
-    """Returns the build description of the system.
-
-    For example:
-      nakasi-user 4.4.4 KTU84P 1227136 release-keys
-    """
-    return self.GetProp('ro.build.description', cache=True)
-
-  @property
-  def build_fingerprint(self):
-    """Returns the build fingerprint of the system.
-
-    For example:
-      google/nakasi/grouper:4.4.4/KTU84P/1227136:user/release-keys
-    """
-    return self.GetProp('ro.build.fingerprint', cache=True)
-
-  @property
-  def build_id(self):
-    """Returns the build ID of the system (e.g. 'KTU84P')."""
-    return self.GetProp('ro.build.id', cache=True)
-
-  @property
-  def build_product(self):
-    """Returns the build product of the system (e.g. 'grouper')."""
-    return self.GetProp('ro.build.product', cache=True)
-
-  @property
-  def build_type(self):
-    """Returns the build type of the system (e.g. 'user')."""
-    return self.GetProp('ro.build.type', cache=True)
-
-  @property
-  def build_version_sdk(self):
-    """Returns the build version sdk of the system as a number (e.g. 19).
-
-    For version code numbers see:
-    http://developer.android.com/reference/android/os/Build.VERSION_CODES.html
-
-    For named constants see:
-    pylib.constants.ANDROID_SDK_VERSION_CODES
-
-    Raises:
-      CommandFailedError if the build version sdk is not a number.
-    """
-    value = self.GetProp('ro.build.version.sdk', cache=True)
-    try:
-      return int(value)
-    except ValueError:
-      raise device_errors.CommandFailedError(
-          'Invalid build version sdk: %r' % value)
-
-  @property
-  def product_cpu_abi(self):
-    """Returns the product cpu abi of the device (e.g. 'armeabi-v7a')."""
-    return self.GetProp('ro.product.cpu.abi', cache=True)
-
-  @property
-  def product_model(self):
-    """Returns the name of the product model (e.g. 'Nexus 7')."""
-    return self.GetProp('ro.product.model', cache=True)
-
-  @property
-  def product_name(self):
-    """Returns the product name of the device (e.g. 'nakasi')."""
-    return self.GetProp('ro.product.name', cache=True)
-
-  def GetProp(self, property_name, cache=False, timeout=DEFAULT,
-              retries=DEFAULT):
-    """Gets a property from the device.
-
-    Args:
-      property_name: A string containing the name of the property to get from
-                     the device.
-      cache: A boolean indicating whether to cache the value of this property.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Returns:
-      The value of the device's |property_name| property.
-
-    Raises:
-      CommandTimeoutError on timeout.
-    """
-    assert isinstance(property_name, basestring), (
-        "property_name is not a string: %r" % property_name)
-
-    cache_key = '_prop:' + property_name
-    if cache and cache_key in self._cache:
-      return self._cache[cache_key]
-    else:
-      # timeout and retries are handled down at run shell, because we don't
-      # want to apply them in the other branch when reading from the cache
-      value = self.RunShellCommand(
-          ['getprop', property_name], single_line=True, check_return=True,
-          timeout=self._default_timeout if timeout is DEFAULT else timeout,
-          retries=self._default_retries if retries is DEFAULT else retries)
-      if cache or cache_key in self._cache:
-        self._cache[cache_key] = value
-      return value
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def SetProp(self, property_name, value, check=False, timeout=None,
-              retries=None):
-    """Sets a property on the device.
-
-    Args:
-      property_name: A string containing the name of the property to set on
-                     the device.
-      value: A string containing the value to set to the property on the
-             device.
-      check: A boolean indicating whether to check that the property was
-             successfully set on the device.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Raises:
-      CommandFailedError if check is true and the property was not correctly
-        set on the device (e.g. because it is not rooted).
-      CommandTimeoutError on timeout.
-    """
-    assert isinstance(property_name, basestring), (
-        "property_name is not a string: %r" % property_name)
-    assert isinstance(value, basestring), "value is not a string: %r" % value
-
-    self.RunShellCommand(['setprop', property_name, value], check_return=True)
-    if property_name in self._cache:
-      del self._cache[property_name]
-    # TODO(perezju) remove the option and make the check mandatory, but using a
-    # single shell script to both set- and getprop.
-    if check and value != self.GetProp(property_name):
-      raise device_errors.CommandFailedError(
-          'Unable to set property %r on the device to %r'
-          % (property_name, value), str(self))
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def GetABI(self, timeout=None, retries=None):
-    """Gets the device main ABI.
-
-    Args:
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Returns:
-      The device's main ABI name.
-
-    Raises:
-      CommandTimeoutError on timeout.
-    """
-    return self.GetProp('ro.product.cpu.abi')
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def GetPids(self, process_name, timeout=None, retries=None):
-    """Returns the PIDs of processes with the given name.
-
-    Note that the |process_name| is often the package name.
-
-    Args:
-      process_name: A string containing the process name to get the PIDs for.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Returns:
-      A dict mapping process name to PID for each process that contained the
-      provided |process_name|.
-
-    Raises:
-      CommandTimeoutError on timeout.
-      DeviceUnreachableError on missing device.
-    """
-    procs_pids = {}
-    try:
-      ps_output = self._RunPipedShellCommand(
-          'ps | grep -F %s' % cmd_helper.SingleQuote(process_name))
-    except device_errors.AdbShellCommandFailedError as e:
-      if e.status and isinstance(e.status, list) and not e.status[0]:
-        # If ps succeeded but grep failed, there were no processes with the
-        # given name.
-        return procs_pids
-      else:
-        raise
-
-    for line in ps_output:
-      try:
-        ps_data = line.split()
-        if process_name in ps_data[-1]:
-          procs_pids[ps_data[-1]] = ps_data[1]
-      except IndexError:
-        pass
-    return procs_pids
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def TakeScreenshot(self, host_path=None, timeout=None, retries=None):
-    """Takes a screenshot of the device.
-
-    Args:
-      host_path: A string containing the path on the host to save the
-                 screenshot to. If None, a file name in the current
-                 directory will be generated.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Returns:
-      The name of the file on the host to which the screenshot was saved.
-
-    Raises:
-      CommandFailedError on failure.
-      CommandTimeoutError on timeout.
-      DeviceUnreachableError on missing device.
-    """
-    if not host_path:
-      host_path = os.path.abspath('screenshot-%s.png' % _GetTimeStamp())
-    with device_temp_file.DeviceTempFile(self.adb, suffix='.png') as device_tmp:
-      self.RunShellCommand(['/system/bin/screencap', '-p', device_tmp.name],
-                           check_return=True)
-      self.PullFile(device_tmp.name, host_path)
-    return host_path
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def GetMemoryUsageForPid(self, pid, timeout=None, retries=None):
-    """Gets the memory usage for the given PID.
-
-    Args:
-      pid: PID of the process.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Returns:
-      A dict containing memory usage statistics for the PID. May include:
-        Size, Rss, Pss, Shared_Clean, Shared_Dirty, Private_Clean,
-        Private_Dirty, VmHWM
-
-    Raises:
-      CommandTimeoutError on timeout.
-    """
-    result = collections.defaultdict(int)
-
-    try:
-      result.update(self._GetMemoryUsageForPidFromSmaps(pid))
-    except device_errors.CommandFailedError:
-      logging.exception('Error getting memory usage from smaps')
-
-    try:
-      result.update(self._GetMemoryUsageForPidFromStatus(pid))
-    except device_errors.CommandFailedError:
-      logging.exception('Error getting memory usage from status')
-
-    return result
-
-  def _GetMemoryUsageForPidFromSmaps(self, pid):
-    SMAPS_COLUMNS = (
-        'Size', 'Rss', 'Pss', 'Shared_Clean', 'Shared_Dirty', 'Private_Clean',
-        'Private_Dirty')
-
-    showmap_out = self._RunPipedShellCommand(
-        'showmap %d | grep TOTAL' % int(pid), as_root=True)
-
-    split_totals = showmap_out[-1].split()
-    if (not split_totals
-        or len(split_totals) != 9
-        or split_totals[-1] != 'TOTAL'):
-      raise device_errors.CommandFailedError(
-          'Invalid output from showmap: %s' % '\n'.join(showmap_out))
-
-    return dict(itertools.izip(SMAPS_COLUMNS, (int(n) for n in split_totals)))
-
-  def _GetMemoryUsageForPidFromStatus(self, pid):
-    for line in self.ReadFile(
-        '/proc/%s/status' % str(pid), as_root=True).splitlines():
-      if line.startswith('VmHWM:'):
-        return {'VmHWM': int(line.split()[1])}
-    else:
-      raise device_errors.CommandFailedError(
-          'Could not find memory peak value for pid %s', str(pid))
-
-  @decorators.WithTimeoutAndRetriesFromInstance()
-  def GetLogcatMonitor(self, timeout=None, retries=None, *args, **kwargs):
-    """Returns a new LogcatMonitor associated with this device.
-
-    Parameters passed to this function are passed directly to
-    |logcat_monitor.LogcatMonitor| and are documented there.
-
-    Args:
-      timeout: timeout in seconds
-      retries: number of retries
-    """
-    return logcat_monitor.LogcatMonitor(self.adb, *args, **kwargs)
-
-  def GetClientCache(self, client_name):
-    """Returns client cache."""
-    if client_name not in self._client_caches:
-      self._client_caches[client_name] = {}
-    return self._client_caches[client_name]
-
-  def _ClearCache(self):
-    """Clears all caches."""
-    for client in self._client_caches:
-      self._client_caches[client].clear()
-    self._cache.clear()
-
-  @classmethod
-  def parallel(cls, devices=None, async=False):
-    """Creates a Parallelizer to operate over the provided list of devices.
-
-    If |devices| is either |None| or an empty list, the Parallelizer will
-    operate over all attached devices that have not been blacklisted.
-
-    Args:
-      devices: A list of either DeviceUtils instances or objects from
-               from which DeviceUtils instances can be constructed. If None,
-               all attached devices will be used.
-      async: If true, returns a Parallelizer that runs operations
-             asynchronously.
-
-    Returns:
-      A Parallelizer operating over |devices|.
-    """
-    if not devices:
-      devices = cls.HealthyDevices()
-      if not devices:
-        raise device_errors.NoDevicesError()
-
-    devices = [d if isinstance(d, cls) else cls(d) for d in devices]
-    if async:
-      return parallelizer.Parallelizer(devices)
-    else:
-      return parallelizer.SyncParallelizer(devices)
-
-  @classmethod
-  def HealthyDevices(cls):
-    blacklist = device_blacklist.ReadBlacklist()
-    def blacklisted(adb):
-      if adb.GetDeviceSerial() in blacklist:
-        logging.warning('Device %s is blacklisted.', adb.GetDeviceSerial())
-        return True
-      return False
-
-    return [cls(adb) for adb in adb_wrapper.AdbWrapper.Devices()
-            if not blacklisted(adb)]
diff --git a/build/android/pylib/device/device_utils_device_test.py b/build/android/pylib/device/device_utils_device_test.py
deleted file mode 100755
index daae2b6..0000000
--- a/build/android/pylib/device/device_utils_device_test.py
+++ /dev/null
@@ -1,211 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-Unit tests for the contents of device_utils.py (mostly DeviceUtils).
-The test will invoke real devices
-"""
-
-import os
-import tempfile
-import unittest
-
-from pylib import cmd_helper
-from pylib import constants
-from pylib.device import adb_wrapper
-from pylib.device import device_utils
-from pylib.utils import md5sum
-
-_OLD_CONTENTS = "foo"
-_NEW_CONTENTS = "bar"
-_DEVICE_DIR = "/data/local/tmp/device_utils_test"
-_SUB_DIR = "sub"
-_SUB_DIR1 = "sub1"
-_SUB_DIR2 = "sub2"
-
-class DeviceUtilsPushDeleteFilesTest(unittest.TestCase):
-
-  def setUp(self):
-    devices = adb_wrapper.AdbWrapper.Devices()
-    assert devices, 'A device must be attached'
-    self.adb = devices[0]
-    self.adb.WaitForDevice()
-    self.device = device_utils.DeviceUtils(
-        self.adb, default_timeout=10, default_retries=0)
-    default_build_type = os.environ.get('BUILDTYPE', 'Debug')
-    constants.SetBuildType(default_build_type)
-
-  @staticmethod
-  def _MakeTempFile(contents):
-    """Make a temporary file with the given contents.
-
-    Args:
-      contents: string to write to the temporary file.
-
-    Returns:
-      the tuple contains the absolute path to the file and the file name
-    """
-    fi, path = tempfile.mkstemp(text=True)
-    with os.fdopen(fi, 'w') as f:
-      f.write(contents)
-    file_name = os.path.basename(path)
-    return (path, file_name)
-
-  @staticmethod
-  def _MakeTempFileGivenDir(directory, contents):
-    """Make a temporary file under the given directory
-    with the given contents
-
-    Args:
-      directory: the temp directory to create the file
-      contents: string to write to the temp file
-
-    Returns:
-      the list contains the absolute path to the file and the file name
-    """
-    fi, path = tempfile.mkstemp(dir=directory, text=True)
-    with os.fdopen(fi, 'w') as f:
-      f.write(contents)
-    file_name = os.path.basename(path)
-    return (path, file_name)
-
-  @staticmethod
-  def _ChangeTempFile(path, contents):
-    with os.open(path, 'w') as f:
-      f.write(contents)
-
-  @staticmethod
-  def _DeleteTempFile(path):
-    os.remove(path)
-
-  def testPushChangedFiles_noFileChange(self):
-    (host_file_path, file_name) = self._MakeTempFile(_OLD_CONTENTS)
-    device_file_path = "%s/%s" % (_DEVICE_DIR, file_name)
-    self.adb.Push(host_file_path, device_file_path)
-    self.device.PushChangedFiles([(host_file_path, device_file_path)])
-    result = self.device.RunShellCommand(['cat', device_file_path],
-                                         single_line=True)
-    self.assertEqual(_OLD_CONTENTS, result)
-
-    cmd_helper.RunCmd(['rm', host_file_path])
-    self.device.RunShellCommand(['rm', '-rf',  _DEVICE_DIR])
-
-  def testPushChangedFiles_singleFileChange(self):
-    (host_file_path, file_name) = self._MakeTempFile(_OLD_CONTENTS)
-    device_file_path = "%s/%s" % (_DEVICE_DIR, file_name)
-    self.adb.Push(host_file_path, device_file_path)
-
-    with open(host_file_path, 'w') as f:
-      f.write(_NEW_CONTENTS)
-    self.device.PushChangedFiles([(host_file_path, device_file_path)])
-    result = self.device.RunShellCommand(['cat', device_file_path],
-                                         single_line=True)
-    self.assertEqual(_NEW_CONTENTS, result)
-
-    cmd_helper.RunCmd(['rm', host_file_path])
-    self.device.RunShellCommand(['rm', '-rf',  _DEVICE_DIR])
-
-  def testDeleteFiles(self):
-    host_tmp_dir = tempfile.mkdtemp()
-    (host_file_path, file_name) = self._MakeTempFileGivenDir(
-        host_tmp_dir, _OLD_CONTENTS)
-
-    device_file_path = "%s/%s" % (_DEVICE_DIR, file_name)
-    self.adb.Push(host_file_path, device_file_path)
-
-    cmd_helper.RunCmd(['rm', host_file_path])
-    self.device.PushChangedFiles([(host_tmp_dir, _DEVICE_DIR)],
-                                 delete_device_stale=True)
-    result = self.device.RunShellCommand(['ls', _DEVICE_DIR], single_line=True)
-    self.assertEqual('', result)
-
-    cmd_helper.RunCmd(['rm', '-rf', host_tmp_dir])
-    self.device.RunShellCommand(['rm', '-rf',  _DEVICE_DIR])
-
-  def testPushAndDeleteFiles_noSubDir(self):
-    host_tmp_dir = tempfile.mkdtemp()
-    (host_file_path1, file_name1) = self._MakeTempFileGivenDir(
-        host_tmp_dir, _OLD_CONTENTS)
-    (host_file_path2, file_name2) = self._MakeTempFileGivenDir(
-        host_tmp_dir, _OLD_CONTENTS)
-
-    device_file_path1 = "%s/%s" % (_DEVICE_DIR, file_name1)
-    device_file_path2 = "%s/%s" % (_DEVICE_DIR, file_name2)
-    self.adb.Push(host_file_path1, device_file_path1)
-    self.adb.Push(host_file_path2, device_file_path2)
-
-    with open(host_file_path1, 'w') as f:
-      f.write(_NEW_CONTENTS)
-    cmd_helper.RunCmd(['rm', host_file_path2])
-
-    self.device.PushChangedFiles([(host_tmp_dir, _DEVICE_DIR)],
-                                   delete_device_stale=True)
-    result = self.device.RunShellCommand(['cat', device_file_path1],
-                                         single_line=True)
-    self.assertEqual(_NEW_CONTENTS, result)
-    result = self.device.RunShellCommand(['ls', _DEVICE_DIR], single_line=True)
-    self.assertEqual(file_name1, result)
-
-    self.device.RunShellCommand(['rm', '-rf',  _DEVICE_DIR])
-    cmd_helper.RunCmd(['rm', '-rf', host_tmp_dir])
-
-  def testPushAndDeleteFiles_SubDir(self):
-    host_tmp_dir = tempfile.mkdtemp()
-    host_sub_dir1 = "%s/%s" % (host_tmp_dir, _SUB_DIR1)
-    host_sub_dir2 = "%s/%s/%s" % (host_tmp_dir, _SUB_DIR, _SUB_DIR2)
-    cmd_helper.RunCmd(['mkdir', '-p', host_sub_dir1])
-    cmd_helper.RunCmd(['mkdir', '-p', host_sub_dir2])
-
-    (host_file_path1, file_name1) = self._MakeTempFileGivenDir(
-        host_tmp_dir, _OLD_CONTENTS)
-    (host_file_path2, file_name2) = self._MakeTempFileGivenDir(
-        host_tmp_dir, _OLD_CONTENTS)
-    (host_file_path3, file_name3) = self._MakeTempFileGivenDir(
-        host_sub_dir1, _OLD_CONTENTS)
-    (host_file_path4, file_name4) = self._MakeTempFileGivenDir(
-        host_sub_dir2, _OLD_CONTENTS)
-
-    device_file_path1 = "%s/%s" % (_DEVICE_DIR, file_name1)
-    device_file_path2 = "%s/%s" % (_DEVICE_DIR, file_name2)
-    device_file_path3 = "%s/%s/%s" % (_DEVICE_DIR, _SUB_DIR1, file_name3)
-    device_file_path4 = "%s/%s/%s/%s" % (_DEVICE_DIR, _SUB_DIR,
-                                         _SUB_DIR2, file_name4)
-
-    self.adb.Push(host_file_path1, device_file_path1)
-    self.adb.Push(host_file_path2, device_file_path2)
-    self.adb.Push(host_file_path3, device_file_path3)
-    self.adb.Push(host_file_path4, device_file_path4)
-
-    with open(host_file_path1, 'w') as f:
-      f.write(_NEW_CONTENTS)
-    cmd_helper.RunCmd(['rm', host_file_path2])
-    cmd_helper.RunCmd(['rm', host_file_path4])
-
-    self.device.PushChangedFiles([(host_tmp_dir, _DEVICE_DIR)],
-                                   delete_device_stale=True)
-    result = self.device.RunShellCommand(['cat', device_file_path1],
-                                         single_line=True)
-    self.assertEqual(_NEW_CONTENTS, result)
-
-    result = self.device.RunShellCommand(['ls', _DEVICE_DIR])
-    self.assertIn(file_name1, result)
-    self.assertIn(_SUB_DIR1, result)
-    self.assertIn(_SUB_DIR, result)
-    self.assertEqual(3, len(result))
-
-    result = self.device.RunShellCommand(['cat', device_file_path3],
-                                      single_line=True)
-    self.assertEqual(_OLD_CONTENTS, result)
-
-    result = self.device.RunShellCommand(["ls", "%s/%s/%s"
-                                          % (_DEVICE_DIR, _SUB_DIR, _SUB_DIR2)],
-                                         single_line=True)
-    self.assertEqual('', result)
-
-    self.device.RunShellCommand(['rm', '-rf',  _DEVICE_DIR])
-    cmd_helper.RunCmd(['rm', '-rf', host_tmp_dir])
-
-if __name__ == '__main__':
-  unittest.main()
diff --git a/build/android/pylib/device/device_utils_test.py b/build/android/pylib/device/device_utils_test.py
deleted file mode 100755
index 6699673..0000000
--- a/build/android/pylib/device/device_utils_test.py
+++ /dev/null
@@ -1,1845 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-Unit tests for the contents of device_utils.py (mostly DeviceUtils).
-"""
-
-# pylint: disable=C0321
-# pylint: disable=W0212
-# pylint: disable=W0613
-
-import collections
-import datetime
-import logging
-import os
-import re
-import sys
-import unittest
-
-from pylib import android_commands
-from pylib import cmd_helper
-from pylib import constants
-from pylib import device_signal
-from pylib.device import adb_wrapper
-from pylib.device import device_errors
-from pylib.device import device_utils
-from pylib.device import intent
-from pylib.sdk import split_select
-from pylib.utils import mock_calls
-
-# RunCommand from third_party/android_testrunner/run_command.py is mocked
-# below, so its path needs to be in sys.path.
-sys.path.append(os.path.join(
-    constants.DIR_SOURCE_ROOT, 'third_party', 'android_testrunner'))
-
-sys.path.append(os.path.join(
-    constants.DIR_SOURCE_ROOT, 'third_party', 'pymock'))
-import mock # pylint: disable=F0401
-
-
-class DeviceUtilsInitTest(unittest.TestCase):
-
-  def testInitWithStr(self):
-    serial_as_str = str('0123456789abcdef')
-    d = device_utils.DeviceUtils('0123456789abcdef')
-    self.assertEqual(serial_as_str, d.adb.GetDeviceSerial())
-
-  def testInitWithUnicode(self):
-    serial_as_unicode = unicode('fedcba9876543210')
-    d = device_utils.DeviceUtils(serial_as_unicode)
-    self.assertEqual(serial_as_unicode, d.adb.GetDeviceSerial())
-
-  def testInitWithAdbWrapper(self):
-    serial = '123456789abcdef0'
-    a = adb_wrapper.AdbWrapper(serial)
-    d = device_utils.DeviceUtils(a)
-    self.assertEqual(serial, d.adb.GetDeviceSerial())
-
-  def testInitWithAndroidCommands(self):
-    serial = '0fedcba987654321'
-    a = android_commands.AndroidCommands(device=serial)
-    d = device_utils.DeviceUtils(a)
-    self.assertEqual(serial, d.adb.GetDeviceSerial())
-
-  def testInitWithMissing_fails(self):
-    with self.assertRaises(ValueError):
-      device_utils.DeviceUtils(None)
-    with self.assertRaises(ValueError):
-      device_utils.DeviceUtils('')
-
-
-class DeviceUtilsGetAVDsTest(mock_calls.TestCase):
-
-  def testGetAVDs(self):
-    with self.assertCall(
-        mock.call.pylib.cmd_helper.GetCmdOutput([mock.ANY, 'list', 'avd']),
-        'Available Android Virtual Devices:\n'
-        '    Name: my_android5.0\n'
-        '    Path: /some/path/to/.android/avd/my_android5.0.avd\n'
-        '  Target: Android 5.0 (API level 21)\n'
-        ' Tag/ABI: default/x86\n'
-        '    Skin: WVGA800\n'):
-      self.assertEquals(['my_android5.0'],
-                        device_utils.GetAVDs())
-
-
-class DeviceUtilsRestartServerTest(mock_calls.TestCase):
-
-  @mock.patch('time.sleep', mock.Mock())
-  def testRestartServer_succeeds(self):
-    with self.assertCalls(
-        mock.call.pylib.device.adb_wrapper.AdbWrapper.KillServer(),
-        (mock.call.pylib.cmd_helper.GetCmdStatusAndOutput(['pgrep', 'adb']),
-         (1, '')),
-        mock.call.pylib.device.adb_wrapper.AdbWrapper.StartServer(),
-        (mock.call.pylib.cmd_helper.GetCmdStatusAndOutput(['pgrep', 'adb']),
-         (1, '')),
-        (mock.call.pylib.cmd_helper.GetCmdStatusAndOutput(['pgrep', 'adb']),
-         (0, '123\n'))):
-      device_utils.RestartServer()
-
-
-class MockTempFile(object):
-
-  def __init__(self, name='/tmp/some/file'):
-    self.file = mock.MagicMock(spec=file)
-    self.file.name = name
-    self.file.name_quoted = cmd_helper.SingleQuote(name)
-
-  def __enter__(self):
-    return self.file
-
-  def __exit__(self, exc_type, exc_val, exc_tb):
-    pass
-
-  @property
-  def name(self):
-    return self.file.name
-
-
-class _PatchedFunction(object):
-  def __init__(self, patched=None, mocked=None):
-    self.patched = patched
-    self.mocked = mocked
-
-
-def _AdbWrapperMock(test_serial):
-  adb = mock.Mock(spec=adb_wrapper.AdbWrapper)
-  adb.__str__ = mock.Mock(return_value=test_serial)
-  adb.GetDeviceSerial.return_value = test_serial
-  return adb
-
-
-class DeviceUtilsTest(mock_calls.TestCase):
-
-  def setUp(self):
-    self.adb = _AdbWrapperMock('0123456789abcdef')
-    self.device = device_utils.DeviceUtils(
-        self.adb, default_timeout=10, default_retries=0)
-    self.watchMethodCalls(self.call.adb, ignore=['GetDeviceSerial'])
-
-  def AdbCommandError(self, args=None, output=None, status=None, msg=None):
-    if args is None:
-      args = ['[unspecified]']
-    return mock.Mock(side_effect=device_errors.AdbCommandFailedError(
-        args, output, status, msg, str(self.device)))
-
-  def CommandError(self, msg=None):
-    if msg is None:
-      msg = 'Command failed'
-    return mock.Mock(side_effect=device_errors.CommandFailedError(
-        msg, str(self.device)))
-
-  def ShellError(self, output=None, status=1):
-    def action(cmd, *args, **kwargs):
-      raise device_errors.AdbShellCommandFailedError(
-          cmd, output, status, str(self.device))
-    if output is None:
-      output = 'Permission denied\n'
-    return action
-
-  def TimeoutError(self, msg=None):
-    if msg is None:
-      msg = 'Operation timed out'
-    return mock.Mock(side_effect=device_errors.CommandTimeoutError(
-        msg, str(self.device)))
-
-
-class DeviceUtilsEqTest(DeviceUtilsTest):
-
-  def testEq_equal_deviceUtils(self):
-    other = device_utils.DeviceUtils(_AdbWrapperMock('0123456789abcdef'))
-    self.assertTrue(self.device == other)
-    self.assertTrue(other == self.device)
-
-  def testEq_equal_adbWrapper(self):
-    other = adb_wrapper.AdbWrapper('0123456789abcdef')
-    self.assertTrue(self.device == other)
-    self.assertTrue(other == self.device)
-
-  def testEq_equal_string(self):
-    other = '0123456789abcdef'
-    self.assertTrue(self.device == other)
-    self.assertTrue(other == self.device)
-
-  def testEq_devicesNotEqual(self):
-    other = device_utils.DeviceUtils(_AdbWrapperMock('0123456789abcdee'))
-    self.assertFalse(self.device == other)
-    self.assertFalse(other == self.device)
-
-  def testEq_identity(self):
-    self.assertTrue(self.device == self.device)
-
-  def testEq_serialInList(self):
-    devices = [self.device]
-    self.assertTrue('0123456789abcdef' in devices)
-
-
-class DeviceUtilsLtTest(DeviceUtilsTest):
-
-  def testLt_lessThan(self):
-    other = device_utils.DeviceUtils(_AdbWrapperMock('ffffffffffffffff'))
-    self.assertTrue(self.device < other)
-    self.assertTrue(other > self.device)
-
-  def testLt_greaterThan_lhs(self):
-    other = device_utils.DeviceUtils(_AdbWrapperMock('0000000000000000'))
-    self.assertFalse(self.device < other)
-    self.assertFalse(other > self.device)
-
-  def testLt_equal(self):
-    other = device_utils.DeviceUtils(_AdbWrapperMock('0123456789abcdef'))
-    self.assertFalse(self.device < other)
-    self.assertFalse(other > self.device)
-
-  def testLt_sorted(self):
-    devices = [
-        device_utils.DeviceUtils(_AdbWrapperMock('ffffffffffffffff')),
-        device_utils.DeviceUtils(_AdbWrapperMock('0000000000000000')),
-    ]
-    sorted_devices = sorted(devices)
-    self.assertEquals('0000000000000000',
-                      sorted_devices[0].adb.GetDeviceSerial())
-    self.assertEquals('ffffffffffffffff',
-                      sorted_devices[1].adb.GetDeviceSerial())
-
-
-class DeviceUtilsStrTest(DeviceUtilsTest):
-
-  def testStr_returnsSerial(self):
-    with self.assertCalls(
-        (self.call.adb.GetDeviceSerial(), '0123456789abcdef')):
-      self.assertEqual('0123456789abcdef', str(self.device))
-
-
-class DeviceUtilsIsOnlineTest(DeviceUtilsTest):
-
-  def testIsOnline_true(self):
-    with self.assertCall(self.call.adb.GetState(), 'device'):
-      self.assertTrue(self.device.IsOnline())
-
-  def testIsOnline_false(self):
-    with self.assertCall(self.call.adb.GetState(), 'offline'):
-      self.assertFalse(self.device.IsOnline())
-
-  def testIsOnline_error(self):
-    with self.assertCall(self.call.adb.GetState(), self.CommandError()):
-      self.assertFalse(self.device.IsOnline())
-
-
-class DeviceUtilsHasRootTest(DeviceUtilsTest):
-
-  def testHasRoot_true(self):
-    with self.assertCall(self.call.adb.Shell('ls /root'), 'foo\n'):
-      self.assertTrue(self.device.HasRoot())
-
-  def testHasRoot_false(self):
-    with self.assertCall(self.call.adb.Shell('ls /root'), self.ShellError()):
-      self.assertFalse(self.device.HasRoot())
-
-
-class DeviceUtilsEnableRootTest(DeviceUtilsTest):
-
-  def testEnableRoot_succeeds(self):
-    with self.assertCalls(
-        (self.call.device.IsUserBuild(), False),
-         self.call.adb.Root(),
-         self.call.device.WaitUntilFullyBooted()):
-      self.device.EnableRoot()
-
-  def testEnableRoot_userBuild(self):
-    with self.assertCalls(
-        (self.call.device.IsUserBuild(), True)):
-      with self.assertRaises(device_errors.CommandFailedError):
-        self.device.EnableRoot()
-
-  def testEnableRoot_rootFails(self):
-    with self.assertCalls(
-        (self.call.device.IsUserBuild(), False),
-        (self.call.adb.Root(), self.CommandError())):
-      with self.assertRaises(device_errors.CommandFailedError):
-        self.device.EnableRoot()
-
-
-class DeviceUtilsIsUserBuildTest(DeviceUtilsTest):
-
-  def testIsUserBuild_yes(self):
-    with self.assertCall(
-        self.call.device.GetProp('ro.build.type', cache=True), 'user'):
-      self.assertTrue(self.device.IsUserBuild())
-
-  def testIsUserBuild_no(self):
-    with self.assertCall(
-        self.call.device.GetProp('ro.build.type', cache=True), 'userdebug'):
-      self.assertFalse(self.device.IsUserBuild())
-
-
-class DeviceUtilsGetExternalStoragePathTest(DeviceUtilsTest):
-
-  def testGetExternalStoragePath_succeeds(self):
-    with self.assertCall(
-        self.call.adb.Shell('echo $EXTERNAL_STORAGE'), '/fake/storage/path\n'):
-      self.assertEquals('/fake/storage/path',
-                        self.device.GetExternalStoragePath())
-
-  def testGetExternalStoragePath_fails(self):
-    with self.assertCall(self.call.adb.Shell('echo $EXTERNAL_STORAGE'), '\n'):
-      with self.assertRaises(device_errors.CommandFailedError):
-        self.device.GetExternalStoragePath()
-
-
-class DeviceUtilsGetApplicationPathsTest(DeviceUtilsTest):
-
-  def testGetApplicationPaths_exists(self):
-    with self.assertCalls(
-        (self.call.adb.Shell('getprop ro.build.version.sdk'), '19\n'),
-        (self.call.adb.Shell('pm path android'),
-         'package:/path/to/android.apk\n')):
-      self.assertEquals(['/path/to/android.apk'],
-                        self.device.GetApplicationPaths('android'))
-
-  def testGetApplicationPaths_notExists(self):
-    with self.assertCalls(
-        (self.call.adb.Shell('getprop ro.build.version.sdk'), '19\n'),
-        (self.call.adb.Shell('pm path not.installed.app'), '')):
-      self.assertEquals([],
-                        self.device.GetApplicationPaths('not.installed.app'))
-
-  def testGetApplicationPaths_fails(self):
-    with self.assertCalls(
-        (self.call.adb.Shell('getprop ro.build.version.sdk'), '19\n'),
-        (self.call.adb.Shell('pm path android'),
-         self.CommandError('ERROR. Is package manager running?\n'))):
-      with self.assertRaises(device_errors.CommandFailedError):
-        self.device.GetApplicationPaths('android')
-
-
-class DeviceUtilsGetApplicationDataDirectoryTest(DeviceUtilsTest):
-
-  def testGetApplicationDataDirectory_exists(self):
-    with self.assertCall(
-        self.call.device._RunPipedShellCommand(
-            'pm dump foo.bar.baz | grep dataDir='),
-        ['dataDir=/data/data/foo.bar.baz']):
-      self.assertEquals(
-          '/data/data/foo.bar.baz',
-          self.device.GetApplicationDataDirectory('foo.bar.baz'))
-
-  def testGetApplicationDataDirectory_notExists(self):
-    with self.assertCall(
-        self.call.device._RunPipedShellCommand(
-            'pm dump foo.bar.baz | grep dataDir='),
-        self.ShellError()):
-      self.assertIsNone(self.device.GetApplicationDataDirectory('foo.bar.baz'))
-
-
-@mock.patch('time.sleep', mock.Mock())
-class DeviceUtilsWaitUntilFullyBootedTest(DeviceUtilsTest):
-
-  def testWaitUntilFullyBooted_succeedsNoWifi(self):
-    with self.assertCalls(
-        self.call.adb.WaitForDevice(),
-        # sd_card_ready
-        (self.call.device.GetExternalStoragePath(), '/fake/storage/path'),
-        (self.call.adb.Shell('test -d /fake/storage/path'), ''),
-        # pm_ready
-        (self.call.device.GetApplicationPaths('android'),
-         ['package:/some/fake/path']),
-        # boot_completed
-        (self.call.device.GetProp('sys.boot_completed'), '1')):
-      self.device.WaitUntilFullyBooted(wifi=False)
-
-  def testWaitUntilFullyBooted_succeedsWithWifi(self):
-    with self.assertCalls(
-        self.call.adb.WaitForDevice(),
-        # sd_card_ready
-        (self.call.device.GetExternalStoragePath(), '/fake/storage/path'),
-        (self.call.adb.Shell('test -d /fake/storage/path'), ''),
-        # pm_ready
-        (self.call.device.GetApplicationPaths('android'),
-         ['package:/some/fake/path']),
-        # boot_completed
-        (self.call.device.GetProp('sys.boot_completed'), '1'),
-        # wifi_enabled
-        (self.call.adb.Shell('dumpsys wifi'),
-         'stuff\nWi-Fi is enabled\nmore stuff\n')):
-      self.device.WaitUntilFullyBooted(wifi=True)
-
-  def testWaitUntilFullyBooted_deviceNotInitiallyAvailable(self):
-    with self.assertCalls(
-        self.call.adb.WaitForDevice(),
-        # sd_card_ready
-        (self.call.device.GetExternalStoragePath(), self.AdbCommandError()),
-        # sd_card_ready
-        (self.call.device.GetExternalStoragePath(), self.AdbCommandError()),
-        # sd_card_ready
-        (self.call.device.GetExternalStoragePath(), self.AdbCommandError()),
-        # sd_card_ready
-        (self.call.device.GetExternalStoragePath(), self.AdbCommandError()),
-        # sd_card_ready
-        (self.call.device.GetExternalStoragePath(), '/fake/storage/path'),
-        (self.call.adb.Shell('test -d /fake/storage/path'), ''),
-        # pm_ready
-        (self.call.device.GetApplicationPaths('android'),
-         ['package:/some/fake/path']),
-        # boot_completed
-        (self.call.device.GetProp('sys.boot_completed'), '1')):
-      self.device.WaitUntilFullyBooted(wifi=False)
-
-  def testWaitUntilFullyBooted_sdCardReadyFails_noPath(self):
-    with self.assertCalls(
-        self.call.adb.WaitForDevice(),
-        # sd_card_ready
-        (self.call.device.GetExternalStoragePath(), self.CommandError())):
-      with self.assertRaises(device_errors.CommandFailedError):
-        self.device.WaitUntilFullyBooted(wifi=False)
-
-  def testWaitUntilFullyBooted_sdCardReadyFails_notExists(self):
-    with self.assertCalls(
-        self.call.adb.WaitForDevice(),
-        # sd_card_ready
-        (self.call.device.GetExternalStoragePath(), '/fake/storage/path'),
-        (self.call.adb.Shell('test -d /fake/storage/path'), self.ShellError()),
-        # sd_card_ready
-        (self.call.device.GetExternalStoragePath(), '/fake/storage/path'),
-        (self.call.adb.Shell('test -d /fake/storage/path'), self.ShellError()),
-        # sd_card_ready
-        (self.call.device.GetExternalStoragePath(), '/fake/storage/path'),
-        (self.call.adb.Shell('test -d /fake/storage/path'),
-         self.TimeoutError())):
-      with self.assertRaises(device_errors.CommandTimeoutError):
-        self.device.WaitUntilFullyBooted(wifi=False)
-
-  def testWaitUntilFullyBooted_devicePmFails(self):
-    with self.assertCalls(
-        self.call.adb.WaitForDevice(),
-        # sd_card_ready
-        (self.call.device.GetExternalStoragePath(), '/fake/storage/path'),
-        (self.call.adb.Shell('test -d /fake/storage/path'), ''),
-        # pm_ready
-        (self.call.device.GetApplicationPaths('android'), self.CommandError()),
-        # pm_ready
-        (self.call.device.GetApplicationPaths('android'), self.CommandError()),
-        # pm_ready
-        (self.call.device.GetApplicationPaths('android'), self.TimeoutError())):
-      with self.assertRaises(device_errors.CommandTimeoutError):
-        self.device.WaitUntilFullyBooted(wifi=False)
-
-  def testWaitUntilFullyBooted_bootFails(self):
-    with self.assertCalls(
-        self.call.adb.WaitForDevice(),
-        # sd_card_ready
-        (self.call.device.GetExternalStoragePath(), '/fake/storage/path'),
-        (self.call.adb.Shell('test -d /fake/storage/path'), ''),
-        # pm_ready
-        (self.call.device.GetApplicationPaths('android'),
-         ['package:/some/fake/path']),
-        # boot_completed
-        (self.call.device.GetProp('sys.boot_completed'), '0'),
-        # boot_completed
-        (self.call.device.GetProp('sys.boot_completed'), '0'),
-        # boot_completed
-        (self.call.device.GetProp('sys.boot_completed'), self.TimeoutError())):
-      with self.assertRaises(device_errors.CommandTimeoutError):
-        self.device.WaitUntilFullyBooted(wifi=False)
-
-  def testWaitUntilFullyBooted_wifiFails(self):
-    with self.assertCalls(
-        self.call.adb.WaitForDevice(),
-        # sd_card_ready
-        (self.call.device.GetExternalStoragePath(), '/fake/storage/path'),
-        (self.call.adb.Shell('test -d /fake/storage/path'), ''),
-        # pm_ready
-        (self.call.device.GetApplicationPaths('android'),
-         ['package:/some/fake/path']),
-        # boot_completed
-        (self.call.device.GetProp('sys.boot_completed'), '1'),
-        # wifi_enabled
-        (self.call.adb.Shell('dumpsys wifi'), 'stuff\nmore stuff\n'),
-        # wifi_enabled
-        (self.call.adb.Shell('dumpsys wifi'), 'stuff\nmore stuff\n'),
-        # wifi_enabled
-        (self.call.adb.Shell('dumpsys wifi'), self.TimeoutError())):
-      with self.assertRaises(device_errors.CommandTimeoutError):
-        self.device.WaitUntilFullyBooted(wifi=True)
-
-
-@mock.patch('time.sleep', mock.Mock())
-class DeviceUtilsRebootTest(DeviceUtilsTest):
-
-  def testReboot_nonBlocking(self):
-    with self.assertCalls(
-        self.call.adb.Reboot(),
-        (self.call.device.IsOnline(), True),
-        (self.call.device.IsOnline(), False)):
-      self.device.Reboot(block=False)
-
-  def testReboot_blocking(self):
-    with self.assertCalls(
-        self.call.adb.Reboot(),
-        (self.call.device.IsOnline(), True),
-        (self.call.device.IsOnline(), False),
-        self.call.device.WaitUntilFullyBooted(wifi=False)):
-      self.device.Reboot(block=True)
-
-  def testReboot_blockUntilWifi(self):
-    with self.assertCalls(
-        self.call.adb.Reboot(),
-        (self.call.device.IsOnline(), True),
-        (self.call.device.IsOnline(), False),
-        self.call.device.WaitUntilFullyBooted(wifi=True)):
-      self.device.Reboot(block=True, wifi=True)
-
-
-class DeviceUtilsInstallTest(DeviceUtilsTest):
-
-  def testInstall_noPriorInstall(self):
-    with self.assertCalls(
-        (mock.call.pylib.utils.apk_helper.GetPackageName('/fake/test/app.apk'),
-         'this.is.a.test.package'),
-        (self.call.device.GetApplicationPaths('this.is.a.test.package'), []),
-        self.call.adb.Install('/fake/test/app.apk', reinstall=False)):
-      self.device.Install('/fake/test/app.apk', retries=0)
-
-  def testInstall_differentPriorInstall(self):
-    with self.assertCalls(
-        (mock.call.pylib.utils.apk_helper.GetPackageName('/fake/test/app.apk'),
-         'this.is.a.test.package'),
-        (self.call.device.GetApplicationPaths('this.is.a.test.package'),
-         ['/fake/data/app/this.is.a.test.package.apk']),
-        (self.call.device._GetChangedAndStaleFiles(
-            '/fake/test/app.apk', '/fake/data/app/this.is.a.test.package.apk'),
-         ([('/fake/test/app.apk', '/fake/data/app/this.is.a.test.package.apk')],
-          [])),
-        self.call.adb.Uninstall('this.is.a.test.package'),
-        self.call.adb.Install('/fake/test/app.apk', reinstall=False)):
-      self.device.Install('/fake/test/app.apk', retries=0)
-
-  def testInstall_differentPriorInstall_reinstall(self):
-    with self.assertCalls(
-        (mock.call.pylib.utils.apk_helper.GetPackageName('/fake/test/app.apk'),
-         'this.is.a.test.package'),
-        (self.call.device.GetApplicationPaths('this.is.a.test.package'),
-         ['/fake/data/app/this.is.a.test.package.apk']),
-        (self.call.device._GetChangedAndStaleFiles(
-            '/fake/test/app.apk', '/fake/data/app/this.is.a.test.package.apk'),
-         ([('/fake/test/app.apk', '/fake/data/app/this.is.a.test.package.apk')],
-          [])),
-        self.call.adb.Install('/fake/test/app.apk', reinstall=True)):
-      self.device.Install('/fake/test/app.apk', reinstall=True, retries=0)
-
-  def testInstall_identicalPriorInstall(self):
-    with self.assertCalls(
-        (mock.call.pylib.utils.apk_helper.GetPackageName('/fake/test/app.apk'),
-         'this.is.a.test.package'),
-        (self.call.device.GetApplicationPaths('this.is.a.test.package'),
-         ['/fake/data/app/this.is.a.test.package.apk']),
-        (self.call.device._GetChangedAndStaleFiles(
-            '/fake/test/app.apk', '/fake/data/app/this.is.a.test.package.apk'),
-         ([], []))):
-      self.device.Install('/fake/test/app.apk', retries=0)
-
-  def testInstall_fails(self):
-    with self.assertCalls(
-        (mock.call.pylib.utils.apk_helper.GetPackageName('/fake/test/app.apk'),
-         'this.is.a.test.package'),
-        (self.call.device.GetApplicationPaths('this.is.a.test.package'), []),
-        (self.call.adb.Install('/fake/test/app.apk', reinstall=False),
-         self.CommandError('Failure\r\n'))):
-      with self.assertRaises(device_errors.CommandFailedError):
-        self.device.Install('/fake/test/app.apk', retries=0)
-
-class DeviceUtilsInstallSplitApkTest(DeviceUtilsTest):
-
-  def testInstallSplitApk_noPriorInstall(self):
-    with self.assertCalls(
-        (self.call.device._CheckSdkLevel(21)),
-        (mock.call.pylib.sdk.split_select.SelectSplits(
-            self.device, 'base.apk',
-            ['split1.apk', 'split2.apk', 'split3.apk']),
-         ['split2.apk']),
-        (mock.call.pylib.utils.apk_helper.GetPackageName('base.apk'),
-         'this.is.a.test.package'),
-        (self.call.device.GetApplicationPaths('this.is.a.test.package'), []),
-        (self.call.adb.InstallMultiple(
-            ['base.apk', 'split2.apk'], partial=None, reinstall=False))):
-      self.device.InstallSplitApk('base.apk',
-          ['split1.apk', 'split2.apk', 'split3.apk'], retries=0)
-
-  def testInstallSplitApk_partialInstall(self):
-    with self.assertCalls(
-        (self.call.device._CheckSdkLevel(21)),
-        (mock.call.pylib.sdk.split_select.SelectSplits(
-            self.device, 'base.apk',
-            ['split1.apk', 'split2.apk', 'split3.apk']),
-         ['split2.apk']),
-        (mock.call.pylib.utils.apk_helper.GetPackageName('base.apk'),
-         'test.package'),
-        (self.call.device.GetApplicationPaths('test.package'),
-         ['base-on-device.apk', 'split2-on-device.apk']),
-        (mock.call.pylib.utils.md5sum.CalculateDeviceMd5Sums(
-            ['base-on-device.apk', 'split2-on-device.apk'], self.device),
-         {'base-on-device.apk': 'AAA', 'split2-on-device.apk': 'BBB'}),
-        (mock.call.pylib.utils.md5sum.CalculateHostMd5Sums(
-            ['base.apk', 'split2.apk']),
-         {'base.apk': 'AAA', 'split2.apk': 'CCC'}),
-        (self.call.adb.InstallMultiple(
-            ['split2.apk'], partial='test.package', reinstall=True))):
-      self.device.InstallSplitApk('base.apk',
-          ['split1.apk', 'split2.apk', 'split3.apk'], reinstall=True, retries=0)
-
-
-class DeviceUtilsRunShellCommandTest(DeviceUtilsTest):
-
-  def setUp(self):
-    super(DeviceUtilsRunShellCommandTest, self).setUp()
-    self.device.NeedsSU = mock.Mock(return_value=False)
-
-  def testRunShellCommand_commandAsList(self):
-    with self.assertCall(self.call.adb.Shell('pm list packages'), ''):
-      self.device.RunShellCommand(['pm', 'list', 'packages'])
-
-  def testRunShellCommand_commandAsListQuoted(self):
-    with self.assertCall(self.call.adb.Shell("echo 'hello world' '$10'"), ''):
-      self.device.RunShellCommand(['echo', 'hello world', '$10'])
-
-  def testRunShellCommand_commandAsString(self):
-    with self.assertCall(self.call.adb.Shell('echo "$VAR"'), ''):
-      self.device.RunShellCommand('echo "$VAR"')
-
-  def testNewRunShellImpl_withEnv(self):
-    with self.assertCall(
-        self.call.adb.Shell('VAR=some_string echo "$VAR"'), ''):
-      self.device.RunShellCommand('echo "$VAR"', env={'VAR': 'some_string'})
-
-  def testNewRunShellImpl_withEnvQuoted(self):
-    with self.assertCall(
-        self.call.adb.Shell('PATH="$PATH:/other/path" run_this'), ''):
-      self.device.RunShellCommand('run_this', env={'PATH': '$PATH:/other/path'})
-
-  def testNewRunShellImpl_withEnv_failure(self):
-    with self.assertRaises(KeyError):
-      self.device.RunShellCommand('some_cmd', env={'INVALID NAME': 'value'})
-
-  def testNewRunShellImpl_withCwd(self):
-    with self.assertCall(self.call.adb.Shell('cd /some/test/path && ls'), ''):
-      self.device.RunShellCommand('ls', cwd='/some/test/path')
-
-  def testNewRunShellImpl_withCwdQuoted(self):
-    with self.assertCall(
-        self.call.adb.Shell("cd '/some test/path with/spaces' && ls"), ''):
-      self.device.RunShellCommand('ls', cwd='/some test/path with/spaces')
-
-  def testRunShellCommand_withHugeCmd(self):
-    payload = 'hi! ' * 1024
-    expected_cmd = "echo '%s'" % payload
-    with self.assertCalls(
-      (mock.call.pylib.utils.device_temp_file.DeviceTempFile(
-          self.adb, suffix='.sh'), MockTempFile('/sdcard/temp-123.sh')),
-      self.call.device._WriteFileWithPush('/sdcard/temp-123.sh', expected_cmd),
-      (self.call.adb.Shell('sh /sdcard/temp-123.sh'), payload + '\n')):
-      self.assertEquals([payload],
-                        self.device.RunShellCommand(['echo', payload]))
-
-  def testRunShellCommand_withHugeCmdAmdSU(self):
-    payload = 'hi! ' * 1024
-    expected_cmd = """su -c sh -c 'echo '"'"'%s'"'"''""" % payload
-    with self.assertCalls(
-      (self.call.device.NeedsSU(), True),
-      (mock.call.pylib.utils.device_temp_file.DeviceTempFile(
-          self.adb, suffix='.sh'), MockTempFile('/sdcard/temp-123.sh')),
-      self.call.device._WriteFileWithPush('/sdcard/temp-123.sh', expected_cmd),
-      (self.call.adb.Shell('sh /sdcard/temp-123.sh'), payload + '\n')):
-      self.assertEquals(
-          [payload],
-          self.device.RunShellCommand(['echo', payload], as_root=True))
-
-  def testRunShellCommand_withSu(self):
-    with self.assertCalls(
-        (self.call.device.NeedsSU(), True),
-        (self.call.adb.Shell("su -c sh -c 'setprop service.adb.root 0'"), '')):
-      self.device.RunShellCommand('setprop service.adb.root 0', as_root=True)
-
-  def testRunShellCommand_manyLines(self):
-    cmd = 'ls /some/path'
-    with self.assertCall(self.call.adb.Shell(cmd), 'file1\nfile2\nfile3\n'):
-      self.assertEquals(['file1', 'file2', 'file3'],
-                        self.device.RunShellCommand(cmd))
-
-  def testRunShellCommand_singleLine_success(self):
-    cmd = 'echo $VALUE'
-    with self.assertCall(self.call.adb.Shell(cmd), 'some value\n'):
-      self.assertEquals('some value',
-                        self.device.RunShellCommand(cmd, single_line=True))
-
-  def testRunShellCommand_singleLine_successEmptyLine(self):
-    cmd = 'echo $VALUE'
-    with self.assertCall(self.call.adb.Shell(cmd), '\n'):
-      self.assertEquals('',
-                        self.device.RunShellCommand(cmd, single_line=True))
-
-  def testRunShellCommand_singleLine_successWithoutEndLine(self):
-    cmd = 'echo -n $VALUE'
-    with self.assertCall(self.call.adb.Shell(cmd), 'some value'):
-      self.assertEquals('some value',
-                        self.device.RunShellCommand(cmd, single_line=True))
-
-  def testRunShellCommand_singleLine_successNoOutput(self):
-    cmd = 'echo -n $VALUE'
-    with self.assertCall(self.call.adb.Shell(cmd), ''):
-      self.assertEquals('',
-                        self.device.RunShellCommand(cmd, single_line=True))
-
-  def testRunShellCommand_singleLine_failTooManyLines(self):
-    cmd = 'echo $VALUE'
-    with self.assertCall(self.call.adb.Shell(cmd),
-                         'some value\nanother value\n'):
-      with self.assertRaises(device_errors.CommandFailedError):
-        self.device.RunShellCommand(cmd, single_line=True)
-
-  def testRunShellCommand_checkReturn_success(self):
-    cmd = 'echo $ANDROID_DATA'
-    output = '/data\n'
-    with self.assertCall(self.call.adb.Shell(cmd), output):
-      self.assertEquals([output.rstrip()],
-                        self.device.RunShellCommand(cmd, check_return=True))
-
-  def testRunShellCommand_checkReturn_failure(self):
-    cmd = 'ls /root'
-    output = 'opendir failed, Permission denied\n'
-    with self.assertCall(self.call.adb.Shell(cmd), self.ShellError(output)):
-      with self.assertRaises(device_errors.AdbCommandFailedError):
-        self.device.RunShellCommand(cmd, check_return=True)
-
-  def testRunShellCommand_checkReturn_disabled(self):
-    cmd = 'ls /root'
-    output = 'opendir failed, Permission denied\n'
-    with self.assertCall(self.call.adb.Shell(cmd), self.ShellError(output)):
-      self.assertEquals([output.rstrip()],
-                        self.device.RunShellCommand(cmd, check_return=False))
-
-  def testRunShellCommand_largeOutput_enabled(self):
-    cmd = 'echo $VALUE'
-    temp_file = MockTempFile('/sdcard/temp-123')
-    cmd_redirect = '%s > %s' % (cmd, temp_file.name)
-    with self.assertCalls(
-        (mock.call.pylib.utils.device_temp_file.DeviceTempFile(self.adb),
-            temp_file),
-        (self.call.adb.Shell(cmd_redirect)),
-        (self.call.device.ReadFile(temp_file.name, force_pull=True),
-         'something')):
-      self.assertEquals(
-          ['something'],
-          self.device.RunShellCommand(
-              cmd, large_output=True, check_return=True))
-
-  def testRunShellCommand_largeOutput_disabledNoTrigger(self):
-    cmd = 'something'
-    with self.assertCall(self.call.adb.Shell(cmd), self.ShellError('')):
-      with self.assertRaises(device_errors.AdbCommandFailedError):
-        self.device.RunShellCommand(cmd, check_return=True)
-
-  def testRunShellCommand_largeOutput_disabledTrigger(self):
-    cmd = 'echo $VALUE'
-    temp_file = MockTempFile('/sdcard/temp-123')
-    cmd_redirect = '%s > %s' % (cmd, temp_file.name)
-    with self.assertCalls(
-        (self.call.adb.Shell(cmd), self.ShellError('', None)),
-        (mock.call.pylib.utils.device_temp_file.DeviceTempFile(self.adb),
-            temp_file),
-        (self.call.adb.Shell(cmd_redirect)),
-        (self.call.device.ReadFile(mock.ANY, force_pull=True),
-         'something')):
-      self.assertEquals(['something'],
-                        self.device.RunShellCommand(cmd, check_return=True))
-
-
-class DeviceUtilsRunPipedShellCommandTest(DeviceUtilsTest):
-
-  def testRunPipedShellCommand_success(self):
-    with self.assertCall(
-        self.call.device.RunShellCommand(
-            'ps | grep foo; echo "PIPESTATUS: ${PIPESTATUS[@]}"',
-            check_return=True),
-        ['This line contains foo', 'PIPESTATUS: 0 0']):
-      self.assertEquals(['This line contains foo'],
-                        self.device._RunPipedShellCommand('ps | grep foo'))
-
-  def testRunPipedShellCommand_firstCommandFails(self):
-    with self.assertCall(
-        self.call.device.RunShellCommand(
-            'ps | grep foo; echo "PIPESTATUS: ${PIPESTATUS[@]}"',
-            check_return=True),
-        ['PIPESTATUS: 1 0']):
-      with self.assertRaises(device_errors.AdbShellCommandFailedError) as ec:
-        self.device._RunPipedShellCommand('ps | grep foo')
-      self.assertEquals([1, 0], ec.exception.status)
-
-  def testRunPipedShellCommand_secondCommandFails(self):
-    with self.assertCall(
-        self.call.device.RunShellCommand(
-            'ps | grep foo; echo "PIPESTATUS: ${PIPESTATUS[@]}"',
-            check_return=True),
-        ['PIPESTATUS: 0 1']):
-      with self.assertRaises(device_errors.AdbShellCommandFailedError) as ec:
-        self.device._RunPipedShellCommand('ps | grep foo')
-      self.assertEquals([0, 1], ec.exception.status)
-
-  def testRunPipedShellCommand_outputCutOff(self):
-    with self.assertCall(
-        self.call.device.RunShellCommand(
-            'ps | grep foo; echo "PIPESTATUS: ${PIPESTATUS[@]}"',
-            check_return=True),
-        ['foo.bar'] * 256 + ['foo.ba']):
-      with self.assertRaises(device_errors.AdbShellCommandFailedError) as ec:
-        self.device._RunPipedShellCommand('ps | grep foo')
-      self.assertIs(None, ec.exception.status)
-
-
-@mock.patch('time.sleep', mock.Mock())
-class DeviceUtilsKillAllTest(DeviceUtilsTest):
-
-  def testKillAll_noMatchingProcessesFailure(self):
-    with self.assertCall(self.call.device.GetPids('test_process'), {}):
-      with self.assertRaises(device_errors.CommandFailedError):
-        self.device.KillAll('test_process')
-
-  def testKillAll_noMatchingProcessesQuiet(self):
-    with self.assertCall(self.call.device.GetPids('test_process'), {}):
-      self.assertEqual(0, self.device.KillAll('test_process', quiet=True))
-
-  def testKillAll_nonblocking(self):
-    with self.assertCalls(
-        (self.call.device.GetPids('some.process'), {'some.process': '1234'}),
-        (self.call.adb.Shell('kill -9 1234'), '')):
-      self.assertEquals(
-          1, self.device.KillAll('some.process', blocking=False))
-
-  def testKillAll_blocking(self):
-    with self.assertCalls(
-        (self.call.device.GetPids('some.process'), {'some.process': '1234'}),
-        (self.call.adb.Shell('kill -9 1234'), ''),
-        (self.call.device.GetPids('some.process'), {'some.process': '1234'}),
-        (self.call.device.GetPids('some.process'), [])):
-      self.assertEquals(
-          1, self.device.KillAll('some.process', blocking=True))
-
-  def testKillAll_root(self):
-    with self.assertCalls(
-        (self.call.device.GetPids('some.process'), {'some.process': '1234'}),
-        (self.call.device.NeedsSU(), True),
-        (self.call.adb.Shell("su -c sh -c 'kill -9 1234'"), '')):
-      self.assertEquals(
-          1, self.device.KillAll('some.process', as_root=True))
-
-  def testKillAll_sigterm(self):
-    with self.assertCalls(
-        (self.call.device.GetPids('some.process'), {'some.process': '1234'}),
-        (self.call.adb.Shell('kill -15 1234'), '')):
-      self.assertEquals(
-          1, self.device.KillAll('some.process', signum=device_signal.SIGTERM))
-
-
-class DeviceUtilsStartActivityTest(DeviceUtilsTest):
-
-  def testStartActivity_actionOnly(self):
-    test_intent = intent.Intent(action='android.intent.action.VIEW')
-    with self.assertCall(
-        self.call.adb.Shell('am start '
-                            '-a android.intent.action.VIEW'),
-        'Starting: Intent { act=android.intent.action.VIEW }'):
-      self.device.StartActivity(test_intent)
-
-  def testStartActivity_success(self):
-    test_intent = intent.Intent(action='android.intent.action.VIEW',
-                                package='this.is.a.test.package',
-                                activity='.Main')
-    with self.assertCall(
-        self.call.adb.Shell('am start '
-                            '-a android.intent.action.VIEW '
-                            '-n this.is.a.test.package/.Main'),
-        'Starting: Intent { act=android.intent.action.VIEW }'):
-      self.device.StartActivity(test_intent)
-
-  def testStartActivity_failure(self):
-    test_intent = intent.Intent(action='android.intent.action.VIEW',
-                                package='this.is.a.test.package',
-                                activity='.Main')
-    with self.assertCall(
-        self.call.adb.Shell('am start '
-                            '-a android.intent.action.VIEW '
-                            '-n this.is.a.test.package/.Main'),
-        'Error: Failed to start test activity'):
-      with self.assertRaises(device_errors.CommandFailedError):
-        self.device.StartActivity(test_intent)
-
-  def testStartActivity_blocking(self):
-    test_intent = intent.Intent(action='android.intent.action.VIEW',
-                                package='this.is.a.test.package',
-                                activity='.Main')
-    with self.assertCall(
-        self.call.adb.Shell('am start '
-                            '-W '
-                            '-a android.intent.action.VIEW '
-                            '-n this.is.a.test.package/.Main'),
-        'Starting: Intent { act=android.intent.action.VIEW }'):
-      self.device.StartActivity(test_intent, blocking=True)
-
-  def testStartActivity_withCategory(self):
-    test_intent = intent.Intent(action='android.intent.action.VIEW',
-                                package='this.is.a.test.package',
-                                activity='.Main',
-                                category='android.intent.category.HOME')
-    with self.assertCall(
-        self.call.adb.Shell('am start '
-                            '-a android.intent.action.VIEW '
-                            '-c android.intent.category.HOME '
-                            '-n this.is.a.test.package/.Main'),
-        'Starting: Intent { act=android.intent.action.VIEW }'):
-      self.device.StartActivity(test_intent)
-
-  def testStartActivity_withMultipleCategories(self):
-    test_intent = intent.Intent(action='android.intent.action.VIEW',
-                                package='this.is.a.test.package',
-                                activity='.Main',
-                                category=['android.intent.category.HOME',
-                                          'android.intent.category.BROWSABLE'])
-    with self.assertCall(
-        self.call.adb.Shell('am start '
-                            '-a android.intent.action.VIEW '
-                            '-c android.intent.category.HOME '
-                            '-c android.intent.category.BROWSABLE '
-                            '-n this.is.a.test.package/.Main'),
-        'Starting: Intent { act=android.intent.action.VIEW }'):
-      self.device.StartActivity(test_intent)
-
-  def testStartActivity_withData(self):
-    test_intent = intent.Intent(action='android.intent.action.VIEW',
-                                package='this.is.a.test.package',
-                                activity='.Main',
-                                data='http://www.google.com/')
-    with self.assertCall(
-        self.call.adb.Shell('am start '
-                            '-a android.intent.action.VIEW '
-                            '-d http://www.google.com/ '
-                            '-n this.is.a.test.package/.Main'),
-        'Starting: Intent { act=android.intent.action.VIEW }'):
-      self.device.StartActivity(test_intent)
-
-  def testStartActivity_withStringExtra(self):
-    test_intent = intent.Intent(action='android.intent.action.VIEW',
-                                package='this.is.a.test.package',
-                                activity='.Main',
-                                extras={'foo': 'test'})
-    with self.assertCall(
-        self.call.adb.Shell('am start '
-                            '-a android.intent.action.VIEW '
-                            '-n this.is.a.test.package/.Main '
-                            '--es foo test'),
-        'Starting: Intent { act=android.intent.action.VIEW }'):
-      self.device.StartActivity(test_intent)
-
-  def testStartActivity_withBoolExtra(self):
-    test_intent = intent.Intent(action='android.intent.action.VIEW',
-                                package='this.is.a.test.package',
-                                activity='.Main',
-                                extras={'foo': True})
-    with self.assertCall(
-        self.call.adb.Shell('am start '
-                            '-a android.intent.action.VIEW '
-                            '-n this.is.a.test.package/.Main '
-                            '--ez foo True'),
-        'Starting: Intent { act=android.intent.action.VIEW }'):
-      self.device.StartActivity(test_intent)
-
-  def testStartActivity_withIntExtra(self):
-    test_intent = intent.Intent(action='android.intent.action.VIEW',
-                                package='this.is.a.test.package',
-                                activity='.Main',
-                                extras={'foo': 123})
-    with self.assertCall(
-        self.call.adb.Shell('am start '
-                            '-a android.intent.action.VIEW '
-                            '-n this.is.a.test.package/.Main '
-                            '--ei foo 123'),
-        'Starting: Intent { act=android.intent.action.VIEW }'):
-      self.device.StartActivity(test_intent)
-
-  def testStartActivity_withTraceFile(self):
-    test_intent = intent.Intent(action='android.intent.action.VIEW',
-                                package='this.is.a.test.package',
-                                activity='.Main')
-    with self.assertCall(
-        self.call.adb.Shell('am start '
-                            '--start-profiler test_trace_file.out '
-                            '-a android.intent.action.VIEW '
-                            '-n this.is.a.test.package/.Main'),
-        'Starting: Intent { act=android.intent.action.VIEW }'):
-      self.device.StartActivity(test_intent,
-                                trace_file_name='test_trace_file.out')
-
-  def testStartActivity_withForceStop(self):
-    test_intent = intent.Intent(action='android.intent.action.VIEW',
-                                package='this.is.a.test.package',
-                                activity='.Main')
-    with self.assertCall(
-        self.call.adb.Shell('am start '
-                            '-S '
-                            '-a android.intent.action.VIEW '
-                            '-n this.is.a.test.package/.Main'),
-        'Starting: Intent { act=android.intent.action.VIEW }'):
-      self.device.StartActivity(test_intent, force_stop=True)
-
-  def testStartActivity_withFlags(self):
-    test_intent = intent.Intent(action='android.intent.action.VIEW',
-                                package='this.is.a.test.package',
-                                activity='.Main',
-                                flags='0x10000000')
-    with self.assertCall(
-        self.call.adb.Shell('am start '
-                            '-a android.intent.action.VIEW '
-                            '-n this.is.a.test.package/.Main '
-                            '-f 0x10000000'),
-        'Starting: Intent { act=android.intent.action.VIEW }'):
-      self.device.StartActivity(test_intent)
-
-
-class DeviceUtilsStartInstrumentationTest(DeviceUtilsTest):
-
-  def testStartInstrumentation_nothing(self):
-    with self.assertCalls(
-        self.call.device.RunShellCommand(
-            ['am', 'instrument', 'test.package/.TestInstrumentation'],
-            check_return=True, large_output=True)):
-      self.device.StartInstrumentation(
-          'test.package/.TestInstrumentation',
-          finish=False, raw=False, extras=None)
-
-  def testStartInstrumentation_finish(self):
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(
-            ['am', 'instrument', '-w', 'test.package/.TestInstrumentation'],
-            check_return=True, large_output=True),
-         ['OK (1 test)'])):
-      output = self.device.StartInstrumentation(
-          'test.package/.TestInstrumentation',
-          finish=True, raw=False, extras=None)
-      self.assertEquals(['OK (1 test)'], output)
-
-  def testStartInstrumentation_raw(self):
-    with self.assertCalls(
-        self.call.device.RunShellCommand(
-            ['am', 'instrument', '-r', 'test.package/.TestInstrumentation'],
-            check_return=True, large_output=True)):
-      self.device.StartInstrumentation(
-          'test.package/.TestInstrumentation',
-          finish=False, raw=True, extras=None)
-
-  def testStartInstrumentation_extras(self):
-    with self.assertCalls(
-        self.call.device.RunShellCommand(
-            ['am', 'instrument', '-e', 'foo', 'Foo', '-e', 'bar', 'Bar',
-             'test.package/.TestInstrumentation'],
-            check_return=True, large_output=True)):
-      self.device.StartInstrumentation(
-          'test.package/.TestInstrumentation',
-          finish=False, raw=False, extras={'foo': 'Foo', 'bar': 'Bar'})
-
-
-class DeviceUtilsBroadcastIntentTest(DeviceUtilsTest):
-
-  def testBroadcastIntent_noExtras(self):
-    test_intent = intent.Intent(action='test.package.with.an.INTENT')
-    with self.assertCall(
-        self.call.adb.Shell('am broadcast -a test.package.with.an.INTENT'),
-        'Broadcasting: Intent { act=test.package.with.an.INTENT } '):
-      self.device.BroadcastIntent(test_intent)
-
-  def testBroadcastIntent_withExtra(self):
-    test_intent = intent.Intent(action='test.package.with.an.INTENT',
-                                extras={'foo': 'bar value'})
-    with self.assertCall(
-        self.call.adb.Shell(
-            "am broadcast -a test.package.with.an.INTENT --es foo 'bar value'"),
-        'Broadcasting: Intent { act=test.package.with.an.INTENT } '):
-      self.device.BroadcastIntent(test_intent)
-
-  def testBroadcastIntent_withExtra_noValue(self):
-    test_intent = intent.Intent(action='test.package.with.an.INTENT',
-                                extras={'foo': None})
-    with self.assertCall(
-        self.call.adb.Shell(
-            'am broadcast -a test.package.with.an.INTENT --esn foo'),
-        'Broadcasting: Intent { act=test.package.with.an.INTENT } '):
-      self.device.BroadcastIntent(test_intent)
-
-
-class DeviceUtilsGoHomeTest(DeviceUtilsTest):
-
-  def testGoHome_popupsExist(self):
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'window', 'windows'], check_return=True,
-            large_output=True), []),
-        (self.call.device.RunShellCommand(
-            ['am', 'start', '-W', '-a', 'android.intent.action.MAIN',
-            '-c', 'android.intent.category.HOME'], check_return=True),
-         'Starting: Intent { act=android.intent.action.MAIN }\r\n'''),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'window', 'windows'], check_return=True,
-            large_output=True), []),
-        (self.call.device.RunShellCommand(
-            ['input', 'keyevent', '66'], check_return=True)),
-        (self.call.device.RunShellCommand(
-            ['input', 'keyevent', '4'], check_return=True)),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'window', 'windows'], check_return=True,
-            large_output=True),
-         ['mCurrentFocus Launcher'])):
-      self.device.GoHome()
-
-  def testGoHome_willRetry(self):
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'window', 'windows'], check_return=True,
-            large_output=True), []),
-        (self.call.device.RunShellCommand(
-            ['am', 'start', '-W', '-a', 'android.intent.action.MAIN',
-            '-c', 'android.intent.category.HOME'], check_return=True),
-         'Starting: Intent { act=android.intent.action.MAIN }\r\n'''),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'window', 'windows'], check_return=True,
-            large_output=True), []),
-        (self.call.device.RunShellCommand(
-            ['input', 'keyevent', '66'], check_return=True,)),
-        (self.call.device.RunShellCommand(
-            ['input', 'keyevent', '4'], check_return=True)),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'window', 'windows'], check_return=True,
-            large_output=True), []),
-        (self.call.device.RunShellCommand(
-            ['input', 'keyevent', '66'], check_return=True)),
-        (self.call.device.RunShellCommand(
-            ['input', 'keyevent', '4'], check_return=True)),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'window', 'windows'], check_return=True,
-            large_output=True),
-         self.TimeoutError())):
-      with self.assertRaises(device_errors.CommandTimeoutError):
-        self.device.GoHome()
-
-  def testGoHome_alreadyFocused(self):
-    with self.assertCall(
-        self.call.device.RunShellCommand(
-            ['dumpsys', 'window', 'windows'], check_return=True,
-            large_output=True),
-        ['mCurrentFocus Launcher']):
-      self.device.GoHome()
-
-  def testGoHome_alreadyFocusedAlternateCase(self):
-    with self.assertCall(
-        self.call.device.RunShellCommand(
-            ['dumpsys', 'window', 'windows'], check_return=True,
-            large_output=True),
-        [' mCurrentFocus .launcher/.']):
-      self.device.GoHome()
-
-  def testGoHome_obtainsFocusAfterGoingHome(self):
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'window', 'windows'], check_return=True,
-            large_output=True), []),
-        (self.call.device.RunShellCommand(
-            ['am', 'start', '-W', '-a', 'android.intent.action.MAIN',
-            '-c', 'android.intent.category.HOME'], check_return=True),
-         'Starting: Intent { act=android.intent.action.MAIN }\r\n'''),
-        (self.call.device.RunShellCommand(
-            ['dumpsys', 'window', 'windows'], check_return=True,
-            large_output=True),
-         ['mCurrentFocus Launcher'])):
-      self.device.GoHome()
-
-class DeviceUtilsForceStopTest(DeviceUtilsTest):
-
-  def testForceStop(self):
-    with self.assertCall(
-        self.call.adb.Shell('am force-stop this.is.a.test.package'),
-        ''):
-      self.device.ForceStop('this.is.a.test.package')
-
-
-class DeviceUtilsClearApplicationStateTest(DeviceUtilsTest):
-
-  def testClearApplicationState_packageDoesntExist(self):
-    with self.assertCalls(
-        (self.call.adb.Shell('getprop ro.build.version.sdk'), '17\n'),
-        (self.call.device.GetApplicationPaths('this.package.does.not.exist'),
-         [])):
-      self.device.ClearApplicationState('this.package.does.not.exist')
-
-  def testClearApplicationState_packageDoesntExistOnAndroidJBMR2OrAbove(self):
-    with self.assertCalls(
-        (self.call.adb.Shell('getprop ro.build.version.sdk'), '18\n'),
-        (self.call.adb.Shell('pm clear this.package.does.not.exist'),
-         'Failed\r\n')):
-      self.device.ClearApplicationState('this.package.does.not.exist')
-
-  def testClearApplicationState_packageExists(self):
-    with self.assertCalls(
-        (self.call.adb.Shell('getprop ro.build.version.sdk'), '17\n'),
-        (self.call.device.GetApplicationPaths('this.package.exists'),
-         ['/data/app/this.package.exists.apk']),
-        (self.call.adb.Shell('pm clear this.package.exists'),
-         'Success\r\n')):
-      self.device.ClearApplicationState('this.package.exists')
-
-  def testClearApplicationState_packageExistsOnAndroidJBMR2OrAbove(self):
-    with self.assertCalls(
-        (self.call.adb.Shell('getprop ro.build.version.sdk'), '18\n'),
-        (self.call.adb.Shell('pm clear this.package.exists'),
-         'Success\r\n')):
-      self.device.ClearApplicationState('this.package.exists')
-
-
-class DeviceUtilsSendKeyEventTest(DeviceUtilsTest):
-
-  def testSendKeyEvent(self):
-    with self.assertCall(self.call.adb.Shell('input keyevent 66'), ''):
-      self.device.SendKeyEvent(66)
-
-
-class DeviceUtilsPushChangedFilesIndividuallyTest(DeviceUtilsTest):
-
-  def testPushChangedFilesIndividually_empty(self):
-    test_files = []
-    with self.assertCalls():
-      self.device._PushChangedFilesIndividually(test_files)
-
-  def testPushChangedFilesIndividually_single(self):
-    test_files = [('/test/host/path', '/test/device/path')]
-    with self.assertCalls(self.call.adb.Push(*test_files[0])):
-      self.device._PushChangedFilesIndividually(test_files)
-
-  def testPushChangedFilesIndividually_multiple(self):
-    test_files = [
-        ('/test/host/path/file1', '/test/device/path/file1'),
-        ('/test/host/path/file2', '/test/device/path/file2')]
-    with self.assertCalls(
-        self.call.adb.Push(*test_files[0]),
-        self.call.adb.Push(*test_files[1])):
-      self.device._PushChangedFilesIndividually(test_files)
-
-
-class DeviceUtilsPushChangedFilesZippedTest(DeviceUtilsTest):
-
-  def testPushChangedFilesZipped_empty(self):
-    test_files = []
-    with self.assertCalls():
-      self.device._PushChangedFilesZipped(test_files)
-
-  def _testPushChangedFilesZipped_spec(self, test_files):
-    mock_zip_temp = mock.mock_open()
-    mock_zip_temp.return_value.name = '/test/temp/file/tmp.zip'
-    with self.assertCalls(
-        (mock.call.tempfile.NamedTemporaryFile(suffix='.zip'), mock_zip_temp),
-        (mock.call.multiprocessing.Process(
-            target=device_utils.DeviceUtils._CreateDeviceZip,
-            args=('/test/temp/file/tmp.zip', test_files)), mock.Mock()),
-        (self.call.device.GetExternalStoragePath(),
-         '/test/device/external_dir'),
-        self.call.adb.Push(
-            '/test/temp/file/tmp.zip', '/test/device/external_dir/tmp.zip'),
-        self.call.device.RunShellCommand(
-            ['unzip', '/test/device/external_dir/tmp.zip'],
-            as_root=True,
-            env={'PATH': '/data/local/tmp/bin:$PATH'},
-            check_return=True),
-        (self.call.device.IsOnline(), True),
-        self.call.device.RunShellCommand(
-            ['rm', '/test/device/external_dir/tmp.zip'], check_return=True)):
-      self.device._PushChangedFilesZipped(test_files)
-
-  def testPushChangedFilesZipped_single(self):
-    self._testPushChangedFilesZipped_spec(
-        [('/test/host/path/file1', '/test/device/path/file1')])
-
-  def testPushChangedFilesZipped_multiple(self):
-    self._testPushChangedFilesZipped_spec(
-        [('/test/host/path/file1', '/test/device/path/file1'),
-         ('/test/host/path/file2', '/test/device/path/file2')])
-
-
-class DeviceUtilsFileExistsTest(DeviceUtilsTest):
-
-  def testFileExists_usingTest_fileExists(self):
-    with self.assertCall(
-        self.call.device.RunShellCommand(
-            ['test', '-e', '/path/file.exists'], check_return=True), ''):
-      self.assertTrue(self.device.FileExists('/path/file.exists'))
-
-  def testFileExists_usingTest_fileDoesntExist(self):
-    with self.assertCall(
-        self.call.device.RunShellCommand(
-            ['test', '-e', '/does/not/exist'], check_return=True),
-        self.ShellError('', 1)):
-      self.assertFalse(self.device.FileExists('/does/not/exist'))
-
-
-class DeviceUtilsPullFileTest(DeviceUtilsTest):
-
-  def testPullFile_existsOnDevice(self):
-    with mock.patch('os.path.exists', return_value=True):
-      with self.assertCall(
-          self.call.adb.Pull('/data/app/test.file.exists',
-                             '/test/file/host/path')):
-        self.device.PullFile('/data/app/test.file.exists',
-                             '/test/file/host/path')
-
-  def testPullFile_doesntExistOnDevice(self):
-    with mock.patch('os.path.exists', return_value=True):
-      with self.assertCall(
-          self.call.adb.Pull('/data/app/test.file.does.not.exist',
-                             '/test/file/host/path'),
-          self.CommandError('remote object does not exist')):
-        with self.assertRaises(device_errors.CommandFailedError):
-          self.device.PullFile('/data/app/test.file.does.not.exist',
-                               '/test/file/host/path')
-
-
-class DeviceUtilsReadFileTest(DeviceUtilsTest):
-
-  def testReadFileWithPull_success(self):
-    tmp_host_dir = '/tmp/dir/on.host/'
-    tmp_host = MockTempFile('/tmp/dir/on.host/tmp_ReadFileWithPull')
-    tmp_host.file.read.return_value = 'some interesting contents'
-    with self.assertCalls(
-        (mock.call.tempfile.mkdtemp(), tmp_host_dir),
-        (self.call.adb.Pull('/path/to/device/file', mock.ANY)),
-        (mock.call.__builtin__.open(mock.ANY, 'r'), tmp_host),
-        (mock.call.os.path.exists(tmp_host_dir), True),
-        (mock.call.shutil.rmtree(tmp_host_dir), None)):
-      self.assertEquals('some interesting contents',
-                        self.device._ReadFileWithPull('/path/to/device/file'))
-    tmp_host.file.read.assert_called_once_with()
-
-  def testReadFileWithPull_rejected(self):
-    tmp_host_dir = '/tmp/dir/on.host/'
-    with self.assertCalls(
-        (mock.call.tempfile.mkdtemp(), tmp_host_dir),
-        (self.call.adb.Pull('/path/to/device/file', mock.ANY),
-         self.CommandError()),
-        (mock.call.os.path.exists(tmp_host_dir), True),
-        (mock.call.shutil.rmtree(tmp_host_dir), None)):
-      with self.assertRaises(device_errors.CommandFailedError):
-        self.device._ReadFileWithPull('/path/to/device/file')
-
-  def testReadFile_exists(self):
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(
-            ['ls', '-l', '/read/this/test/file'],
-            as_root=False, check_return=True),
-         ['-rw-rw---- root foo 256 1970-01-01 00:00 file']),
-        (self.call.device.RunShellCommand(
-            ['cat', '/read/this/test/file'],
-            as_root=False, check_return=True),
-         ['this is a test file'])):
-      self.assertEqual('this is a test file\n',
-                       self.device.ReadFile('/read/this/test/file'))
-
-  def testReadFile_doesNotExist(self):
-    with self.assertCall(
-        self.call.device.RunShellCommand(
-            ['ls', '-l', '/this/file/does.not.exist'],
-            as_root=False, check_return=True),
-        self.CommandError('File does not exist')):
-      with self.assertRaises(device_errors.CommandFailedError):
-        self.device.ReadFile('/this/file/does.not.exist')
-
-  def testReadFile_zeroSize(self):
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(
-            ['ls', '-l', '/this/file/has/zero/size'],
-            as_root=False, check_return=True),
-         ['-r--r--r-- root foo 0 1970-01-01 00:00 zero_size_file']),
-        (self.call.device._ReadFileWithPull('/this/file/has/zero/size'),
-         'but it has contents\n')):
-      self.assertEqual('but it has contents\n',
-                       self.device.ReadFile('/this/file/has/zero/size'))
-
-  def testReadFile_withSU(self):
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(
-            ['ls', '-l', '/this/file/can.be.read.with.su'],
-            as_root=True, check_return=True),
-         ['-rw------- root root 256 1970-01-01 00:00 can.be.read.with.su']),
-        (self.call.device.RunShellCommand(
-            ['cat', '/this/file/can.be.read.with.su'],
-            as_root=True, check_return=True),
-         ['this is a test file', 'read with su'])):
-      self.assertEqual(
-          'this is a test file\nread with su\n',
-          self.device.ReadFile('/this/file/can.be.read.with.su',
-                               as_root=True))
-
-  def testReadFile_withPull(self):
-    contents = 'a' * 123456
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(
-            ['ls', '-l', '/read/this/big/test/file'],
-            as_root=False, check_return=True),
-         ['-rw-rw---- root foo 123456 1970-01-01 00:00 file']),
-        (self.call.device._ReadFileWithPull('/read/this/big/test/file'),
-         contents)):
-      self.assertEqual(
-          contents, self.device.ReadFile('/read/this/big/test/file'))
-
-  def testReadFile_withPullAndSU(self):
-    contents = 'b' * 123456
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(
-            ['ls', '-l', '/this/big/file/can.be.read.with.su'],
-            as_root=True, check_return=True),
-         ['-rw------- root root 123456 1970-01-01 00:00 can.be.read.with.su']),
-        (self.call.device.NeedsSU(), True),
-        (mock.call.pylib.utils.device_temp_file.DeviceTempFile(self.adb),
-         MockTempFile('/sdcard/tmp/on.device')),
-        self.call.device.RunShellCommand(
-            ['cp', '/this/big/file/can.be.read.with.su',
-             '/sdcard/tmp/on.device'],
-            as_root=True, check_return=True),
-        (self.call.device._ReadFileWithPull('/sdcard/tmp/on.device'),
-         contents)):
-      self.assertEqual(
-          contents,
-          self.device.ReadFile('/this/big/file/can.be.read.with.su',
-                               as_root=True))
-
-  def testReadFile_forcePull(self):
-    contents = 'a' * 123456
-    with self.assertCall(
-        self.call.device._ReadFileWithPull('/read/this/big/test/file'),
-        contents):
-      self.assertEqual(
-          contents,
-          self.device.ReadFile('/read/this/big/test/file', force_pull=True))
-
-
-class DeviceUtilsWriteFileTest(DeviceUtilsTest):
-
-  def testWriteFileWithPush_success(self):
-    tmp_host = MockTempFile('/tmp/file/on.host')
-    contents = 'some interesting contents'
-    with self.assertCalls(
-        (mock.call.tempfile.NamedTemporaryFile(), tmp_host),
-        self.call.adb.Push('/tmp/file/on.host', '/path/to/device/file')):
-      self.device._WriteFileWithPush('/path/to/device/file', contents)
-    tmp_host.file.write.assert_called_once_with(contents)
-
-  def testWriteFileWithPush_rejected(self):
-    tmp_host = MockTempFile('/tmp/file/on.host')
-    contents = 'some interesting contents'
-    with self.assertCalls(
-        (mock.call.tempfile.NamedTemporaryFile(), tmp_host),
-        (self.call.adb.Push('/tmp/file/on.host', '/path/to/device/file'),
-         self.CommandError())):
-      with self.assertRaises(device_errors.CommandFailedError):
-        self.device._WriteFileWithPush('/path/to/device/file', contents)
-
-  def testWriteFile_withPush(self):
-    contents = 'some large contents ' * 26 # 20 * 26 = 520 chars
-    with self.assertCalls(
-        self.call.device._WriteFileWithPush('/path/to/device/file', contents)):
-      self.device.WriteFile('/path/to/device/file', contents)
-
-  def testWriteFile_withPushForced(self):
-    contents = 'tiny contents'
-    with self.assertCalls(
-        self.call.device._WriteFileWithPush('/path/to/device/file', contents)):
-      self.device.WriteFile('/path/to/device/file', contents, force_push=True)
-
-  def testWriteFile_withPushAndSU(self):
-    contents = 'some large contents ' * 26 # 20 * 26 = 520 chars
-    with self.assertCalls(
-        (self.call.device.NeedsSU(), True),
-        (mock.call.pylib.utils.device_temp_file.DeviceTempFile(self.adb),
-         MockTempFile('/sdcard/tmp/on.device')),
-        self.call.device._WriteFileWithPush('/sdcard/tmp/on.device', contents),
-        self.call.device.RunShellCommand(
-            ['cp', '/sdcard/tmp/on.device', '/path/to/device/file'],
-            as_root=True, check_return=True)):
-      self.device.WriteFile('/path/to/device/file', contents, as_root=True)
-
-  def testWriteFile_withEcho(self):
-    with self.assertCall(self.call.adb.Shell(
-        "echo -n the.contents > /test/file/to.write"), ''):
-      self.device.WriteFile('/test/file/to.write', 'the.contents')
-
-  def testWriteFile_withEchoAndQuotes(self):
-    with self.assertCall(self.call.adb.Shell(
-        "echo -n 'the contents' > '/test/file/to write'"), ''):
-      self.device.WriteFile('/test/file/to write', 'the contents')
-
-  def testWriteFile_withEchoAndSU(self):
-    with self.assertCalls(
-        (self.call.device.NeedsSU(), True),
-        (self.call.adb.Shell("su -c sh -c 'echo -n contents > /test/file'"),
-         '')):
-      self.device.WriteFile('/test/file', 'contents', as_root=True)
-
-
-class DeviceUtilsLsTest(DeviceUtilsTest):
-
-  def testLs_directory(self):
-    result = [('.', adb_wrapper.DeviceStat(16889, 4096, 1417436123)),
-              ('..', adb_wrapper.DeviceStat(16873, 4096, 12382237)),
-              ('testfile.txt', adb_wrapper.DeviceStat(33206, 3, 1417436122))]
-    with self.assertCalls(
-        (self.call.adb.Ls('/data/local/tmp'), result)):
-      self.assertEquals(result,
-                        self.device.Ls('/data/local/tmp'))
-
-  def testLs_nothing(self):
-    with self.assertCalls(
-        (self.call.adb.Ls('/data/local/tmp/testfile.txt'), [])):
-      self.assertEquals([],
-                        self.device.Ls('/data/local/tmp/testfile.txt'))
-
-
-class DeviceUtilsStatTest(DeviceUtilsTest):
-
-  def testStat_file(self):
-    result = [('.', adb_wrapper.DeviceStat(16889, 4096, 1417436123)),
-              ('..', adb_wrapper.DeviceStat(16873, 4096, 12382237)),
-              ('testfile.txt', adb_wrapper.DeviceStat(33206, 3, 1417436122))]
-    with self.assertCalls(
-        (self.call.adb.Ls('/data/local/tmp'), result)):
-      self.assertEquals(adb_wrapper.DeviceStat(33206, 3, 1417436122),
-                        self.device.Stat('/data/local/tmp/testfile.txt'))
-
-  def testStat_directory(self):
-    result = [('.', adb_wrapper.DeviceStat(16873, 4096, 12382237)),
-              ('..', adb_wrapper.DeviceStat(16873, 4096, 12382237)),
-              ('tmp', adb_wrapper.DeviceStat(16889, 4096, 1417436123))]
-    with self.assertCalls(
-        (self.call.adb.Ls('/data/local'), result)):
-      self.assertEquals(adb_wrapper.DeviceStat(16889, 4096, 1417436123),
-                        self.device.Stat('/data/local/tmp'))
-
-  def testStat_doesNotExist(self):
-    result = [('.', adb_wrapper.DeviceStat(16889, 4096, 1417436123)),
-              ('..', adb_wrapper.DeviceStat(16873, 4096, 12382237)),
-              ('testfile.txt', adb_wrapper.DeviceStat(33206, 3, 1417436122))]
-    with self.assertCalls(
-        (self.call.adb.Ls('/data/local/tmp'), result)):
-      with self.assertRaises(device_errors.CommandFailedError):
-        self.device.Stat('/data/local/tmp/does.not.exist.txt')
-
-
-class DeviceUtilsSetJavaAssertsTest(DeviceUtilsTest):
-
-  def testSetJavaAsserts_enable(self):
-    with self.assertCalls(
-        (self.call.device.ReadFile(constants.DEVICE_LOCAL_PROPERTIES_PATH),
-         'some.example.prop=with an example value\n'
-         'some.other.prop=value_ok\n'),
-        self.call.device.WriteFile(
-            constants.DEVICE_LOCAL_PROPERTIES_PATH,
-            'some.example.prop=with an example value\n'
-            'some.other.prop=value_ok\n'
-            'dalvik.vm.enableassertions=all\n'),
-        (self.call.device.GetProp('dalvik.vm.enableassertions'), ''),
-        self.call.device.SetProp('dalvik.vm.enableassertions', 'all')):
-      self.assertTrue(self.device.SetJavaAsserts(True))
-
-  def testSetJavaAsserts_disable(self):
-    with self.assertCalls(
-        (self.call.device.ReadFile(constants.DEVICE_LOCAL_PROPERTIES_PATH),
-         'some.example.prop=with an example value\n'
-         'dalvik.vm.enableassertions=all\n'
-         'some.other.prop=value_ok\n'),
-        self.call.device.WriteFile(
-            constants.DEVICE_LOCAL_PROPERTIES_PATH,
-            'some.example.prop=with an example value\n'
-            'some.other.prop=value_ok\n'),
-        (self.call.device.GetProp('dalvik.vm.enableassertions'), 'all'),
-        self.call.device.SetProp('dalvik.vm.enableassertions', '')):
-      self.assertTrue(self.device.SetJavaAsserts(False))
-
-  def testSetJavaAsserts_alreadyEnabled(self):
-    with self.assertCalls(
-        (self.call.device.ReadFile(constants.DEVICE_LOCAL_PROPERTIES_PATH),
-         'some.example.prop=with an example value\n'
-         'dalvik.vm.enableassertions=all\n'
-         'some.other.prop=value_ok\n'),
-        (self.call.device.GetProp('dalvik.vm.enableassertions'), 'all')):
-      self.assertFalse(self.device.SetJavaAsserts(True))
-
-
-class DeviceUtilsGetPropTest(DeviceUtilsTest):
-
-  def testGetProp_exists(self):
-    with self.assertCall(
-        self.call.adb.Shell('getprop test.property'), 'property_value\n'):
-      self.assertEqual('property_value',
-                       self.device.GetProp('test.property'))
-
-  def testGetProp_doesNotExist(self):
-    with self.assertCall(
-        self.call.adb.Shell('getprop property.does.not.exist'), '\n'):
-      self.assertEqual('', self.device.GetProp('property.does.not.exist'))
-
-  def testGetProp_cachedRoProp(self):
-    with self.assertCall(
-        self.call.adb.Shell('getprop ro.build.type'), 'userdebug\n'):
-      self.assertEqual('userdebug',
-                       self.device.GetProp('ro.build.type', cache=True))
-      self.assertEqual('userdebug',
-                       self.device.GetProp('ro.build.type', cache=True))
-
-  def testGetProp_retryAndCache(self):
-    with self.assertCalls(
-        (self.call.adb.Shell('getprop ro.build.type'), self.ShellError()),
-        (self.call.adb.Shell('getprop ro.build.type'), self.ShellError()),
-        (self.call.adb.Shell('getprop ro.build.type'), 'userdebug\n')):
-      self.assertEqual('userdebug',
-                       self.device.GetProp('ro.build.type',
-                                           cache=True, retries=3))
-      self.assertEqual('userdebug',
-                       self.device.GetProp('ro.build.type',
-                                           cache=True, retries=3))
-
-
-class DeviceUtilsSetPropTest(DeviceUtilsTest):
-
-  def testSetProp(self):
-    with self.assertCall(
-        self.call.adb.Shell("setprop test.property 'test value'"), ''):
-      self.device.SetProp('test.property', 'test value')
-
-  def testSetProp_check_succeeds(self):
-    with self.assertCalls(
-        (self.call.adb.Shell('setprop test.property new_value'), ''),
-        (self.call.adb.Shell('getprop test.property'), 'new_value')):
-      self.device.SetProp('test.property', 'new_value', check=True)
-
-  def testSetProp_check_fails(self):
-    with self.assertCalls(
-        (self.call.adb.Shell('setprop test.property new_value'), ''),
-        (self.call.adb.Shell('getprop test.property'), 'old_value')):
-      with self.assertRaises(device_errors.CommandFailedError):
-        self.device.SetProp('test.property', 'new_value', check=True)
-
-
-class DeviceUtilsGetPidsTest(DeviceUtilsTest):
-
-  def testGetPids_noMatches(self):
-    with self.assertCall(
-        self.call.device._RunPipedShellCommand('ps | grep -F does.not.match'),
-        []):
-      self.assertEqual({}, self.device.GetPids('does.not.match'))
-
-  def testGetPids_oneMatch(self):
-    with self.assertCall(
-        self.call.device._RunPipedShellCommand('ps | grep -F one.match'),
-        ['user  1001    100   1024 1024   ffffffff 00000000 one.match']):
-      self.assertEqual({'one.match': '1001'}, self.device.GetPids('one.match'))
-
-  def testGetPids_mutlipleMatches(self):
-    with self.assertCall(
-        self.call.device._RunPipedShellCommand('ps | grep -F match'),
-        ['user  1001    100   1024 1024   ffffffff 00000000 one.match',
-         'user  1002    100   1024 1024   ffffffff 00000000 two.match',
-         'user  1003    100   1024 1024   ffffffff 00000000 three.match']):
-      self.assertEqual(
-          {'one.match': '1001', 'two.match': '1002', 'three.match': '1003'},
-          self.device.GetPids('match'))
-
-  def testGetPids_exactMatch(self):
-    with self.assertCall(
-        self.call.device._RunPipedShellCommand('ps | grep -F exact.match'),
-        ['user  1000    100   1024 1024   ffffffff 00000000 not.exact.match',
-         'user  1234    100   1024 1024   ffffffff 00000000 exact.match']):
-      self.assertEqual(
-          {'not.exact.match': '1000', 'exact.match': '1234'},
-          self.device.GetPids('exact.match'))
-
-  def testGetPids_quotable(self):
-    with self.assertCall(
-        self.call.device._RunPipedShellCommand("ps | grep -F 'my$process'"),
-        ['user  1234    100   1024 1024   ffffffff 00000000 my$process']):
-      self.assertEqual(
-          {'my$process': '1234'}, self.device.GetPids('my$process'))
-
-
-class DeviceUtilsTakeScreenshotTest(DeviceUtilsTest):
-
-  def testTakeScreenshot_fileNameProvided(self):
-    with self.assertCalls(
-        (mock.call.pylib.utils.device_temp_file.DeviceTempFile(
-            self.adb, suffix='.png'),
-         MockTempFile('/tmp/path/temp-123.png')),
-        (self.call.adb.Shell('/system/bin/screencap -p /tmp/path/temp-123.png'),
-         ''),
-        self.call.device.PullFile('/tmp/path/temp-123.png',
-                                  '/test/host/screenshot.png')):
-      self.device.TakeScreenshot('/test/host/screenshot.png')
-
-
-class DeviceUtilsGetMemoryUsageForPidTest(DeviceUtilsTest):
-
-  def setUp(self):
-    super(DeviceUtilsGetMemoryUsageForPidTest, self).setUp()
-
-  def testGetMemoryUsageForPid_validPid(self):
-    with self.assertCalls(
-        (self.call.device._RunPipedShellCommand(
-            'showmap 1234 | grep TOTAL', as_root=True),
-         ['100 101 102 103 104 105 106 107 TOTAL']),
-        (self.call.device.ReadFile('/proc/1234/status', as_root=True),
-         'VmHWM: 1024 kB\n')):
-      self.assertEqual(
-          {
-            'Size': 100,
-            'Rss': 101,
-            'Pss': 102,
-            'Shared_Clean': 103,
-            'Shared_Dirty': 104,
-            'Private_Clean': 105,
-            'Private_Dirty': 106,
-            'VmHWM': 1024
-          },
-          self.device.GetMemoryUsageForPid(1234))
-
-  def testGetMemoryUsageForPid_noSmaps(self):
-    with self.assertCalls(
-        (self.call.device._RunPipedShellCommand(
-            'showmap 4321 | grep TOTAL', as_root=True),
-         ['cannot open /proc/4321/smaps: No such file or directory']),
-        (self.call.device.ReadFile('/proc/4321/status', as_root=True),
-         'VmHWM: 1024 kb\n')):
-      self.assertEquals({'VmHWM': 1024}, self.device.GetMemoryUsageForPid(4321))
-
-  def testGetMemoryUsageForPid_noStatus(self):
-    with self.assertCalls(
-        (self.call.device._RunPipedShellCommand(
-            'showmap 4321 | grep TOTAL', as_root=True),
-         ['100 101 102 103 104 105 106 107 TOTAL']),
-        (self.call.device.ReadFile('/proc/4321/status', as_root=True),
-         self.CommandError())):
-      self.assertEquals(
-          {
-            'Size': 100,
-            'Rss': 101,
-            'Pss': 102,
-            'Shared_Clean': 103,
-            'Shared_Dirty': 104,
-            'Private_Clean': 105,
-            'Private_Dirty': 106,
-          },
-          self.device.GetMemoryUsageForPid(4321))
-
-
-class DeviceUtilsClientCache(DeviceUtilsTest):
-
-  def testClientCache_twoCaches(self):
-    self.device._cache['test'] = 0
-    client_cache_one = self.device.GetClientCache('ClientOne')
-    client_cache_one['test'] = 1
-    client_cache_two = self.device.GetClientCache('ClientTwo')
-    client_cache_two['test'] = 2
-    self.assertEqual(self.device._cache, {'test': 0})
-    self.assertEqual(client_cache_one, {'test': 1})
-    self.assertEqual(client_cache_two, {'test': 2})
-    self.device._ClearCache()
-    self.assertEqual(self.device._cache, {})
-    self.assertEqual(client_cache_one, {})
-    self.assertEqual(client_cache_two, {})
-
-  def testClientCache_multipleInstances(self):
-    client_cache_one = self.device.GetClientCache('ClientOne')
-    client_cache_one['test'] = 1
-    client_cache_two = self.device.GetClientCache('ClientOne')
-    self.assertEqual(client_cache_one, {'test': 1})
-    self.assertEqual(client_cache_two, {'test': 1})
-    self.device._ClearCache()
-    self.assertEqual(client_cache_one, {})
-    self.assertEqual(client_cache_two, {})
-
-
-class DeviceUtilsParallelTest(mock_calls.TestCase):
-
-  def testParallel_default(self):
-    test_serials = ['0123456789abcdef', 'fedcba9876543210']
-    with self.assertCall(
-        mock.call.pylib.device.device_utils.DeviceUtils.HealthyDevices(),
-        [device_utils.DeviceUtils(s) for s in test_serials]):
-      parallel_devices = device_utils.DeviceUtils.parallel()
-    for serial, device in zip(test_serials, parallel_devices.pGet(None)):
-      self.assertTrue(isinstance(device, device_utils.DeviceUtils))
-      self.assertEquals(serial, device.adb.GetDeviceSerial())
-
-  def testParallel_noDevices(self):
-    with self.assertCall(
-        mock.call.pylib.device.device_utils.DeviceUtils.HealthyDevices(), []):
-      with self.assertRaises(device_errors.NoDevicesError):
-        device_utils.DeviceUtils.parallel()
-
-
-class DeviceUtilsHealthyDevicesTest(mock_calls.TestCase):
-
-  def _createAdbWrapperMock(self, serial, is_ready=True):
-    adb = _AdbWrapperMock(serial)
-    adb.is_ready = is_ready
-    return adb
-
-  def testHealthyDevices_default(self):
-    test_serials = ['0123456789abcdef', 'fedcba9876543210']
-    with self.assertCalls(
-        (mock.call.pylib.device.device_blacklist.ReadBlacklist(), []),
-        (mock.call.pylib.device.adb_wrapper.AdbWrapper.Devices(),
-         [self._createAdbWrapperMock(s) for s in test_serials])):
-      devices = device_utils.DeviceUtils.HealthyDevices()
-    for serial, device in zip(test_serials, devices):
-      self.assertTrue(isinstance(device, device_utils.DeviceUtils))
-      self.assertEquals(serial, device.adb.GetDeviceSerial())
-
-  def testHealthyDevices_blacklisted(self):
-    test_serials = ['0123456789abcdef', 'fedcba9876543210']
-    with self.assertCalls(
-        (mock.call.pylib.device.device_blacklist.ReadBlacklist(),
-         ['fedcba9876543210']),
-        (mock.call.pylib.device.adb_wrapper.AdbWrapper.Devices(),
-         [self._createAdbWrapperMock(s) for s in test_serials])):
-      devices = device_utils.DeviceUtils.HealthyDevices()
-    self.assertEquals(1, len(devices))
-    self.assertTrue(isinstance(devices[0], device_utils.DeviceUtils))
-    self.assertEquals('0123456789abcdef', devices[0].adb.GetDeviceSerial())
-
-
-if __name__ == '__main__':
-  logging.getLogger().setLevel(logging.DEBUG)
-  unittest.main(verbosity=2)
-
diff --git a/build/android/pylib/device/intent.py b/build/android/pylib/device/intent.py
deleted file mode 100644
index 333b9f1..0000000
--- a/build/android/pylib/device/intent.py
+++ /dev/null
@@ -1,113 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Manages intents and associated information.
-
-This is generally intended to be used with functions that calls Android's
-Am command.
-"""
-
-class Intent(object):
-
-  def __init__(self, action='android.intent.action.VIEW', activity=None,
-               category=None, component=None, data=None, extras=None,
-               flags=None, package=None):
-    """Creates an Intent.
-
-    Args:
-      action: A string containing the action.
-      activity: A string that, with |package|, can be used to specify the
-                component.
-      category: A string or list containing any categories.
-      component: A string that specifies the component to send the intent to.
-      data: A string containing a data URI.
-      extras: A dict containing extra parameters to be passed along with the
-              intent.
-      flags: A string containing flags to pass.
-      package: A string that, with activity, can be used to specify the
-               component.
-    """
-    self._action = action
-    self._activity = activity
-    if isinstance(category, list) or category is None:
-      self._category = category
-    else:
-      self._category = [category]
-    self._component = component
-    self._data = data
-    self._extras = extras
-    self._flags = flags
-    self._package = package
-
-    if self._component and '/' in component:
-      self._package, self._activity = component.split('/', 1)
-    elif self._package and self._activity:
-      self._component = '%s/%s' % (package, activity)
-
-  @property
-  def action(self):
-    return self._action
-
-  @property
-  def activity(self):
-    return self._activity
-
-  @property
-  def category(self):
-    return self._category
-
-  @property
-  def component(self):
-    return self._component
-
-  @property
-  def data(self):
-    return self._data
-
-  @property
-  def extras(self):
-    return self._extras
-
-  @property
-  def flags(self):
-    return self._flags
-
-  @property
-  def package(self):
-    return self._package
-
-  @property
-  def am_args(self):
-    """Returns the intent as a list of arguments for the activity manager.
-
-    For details refer to the specification at:
-    - http://developer.android.com/tools/help/adb.html#IntentSpec
-    """
-    args = []
-    if self.action:
-      args.extend(['-a', self.action])
-    if self.data:
-      args.extend(['-d', self.data])
-    if self.category:
-      args.extend(arg for cat in self.category for arg in ('-c', cat))
-    if self.component:
-      args.extend(['-n', self.component])
-    if self.flags:
-      args.extend(['-f', self.flags])
-    if self.extras:
-      for key, value in self.extras.iteritems():
-        if value is None:
-          args.extend(['--esn', key])
-        elif isinstance(value, str):
-          args.extend(['--es', key, value])
-        elif isinstance(value, bool):
-          args.extend(['--ez', key, str(value)])
-        elif isinstance(value, int):
-          args.extend(['--ei', key, str(value)])
-        elif isinstance(value, float):
-          args.extend(['--ef', key, str(value)])
-        else:
-          raise NotImplementedError(
-              'Intent does not know how to pass %s extras' % type(value))
-    return args
diff --git a/build/android/pylib/device/logcat_monitor.py b/build/android/pylib/device/logcat_monitor.py
deleted file mode 100644
index 2eebc2d..0000000
--- a/build/android/pylib/device/logcat_monitor.py
+++ /dev/null
@@ -1,139 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# pylint: disable=unused-argument
-
-import collections
-import itertools
-import logging
-import subprocess
-import tempfile
-import time
-import re
-
-from pylib.device import adb_wrapper
-from pylib.device import decorators
-from pylib.device import device_errors
-
-
-class LogcatMonitor(object):
-
-  _THREADTIME_RE_FORMAT = (
-      r'(?P<date>\S*) +(?P<time>\S*) +(?P<proc_id>%s) +(?P<thread_id>%s) +'
-      r'(?P<log_level>%s) +(?P<component>%s) *: +(?P<message>%s)$')
-
-  def __init__(self, adb, clear=True, filter_specs=None):
-    """Create a LogcatMonitor instance.
-
-    Args:
-      adb: An instance of adb_wrapper.AdbWrapper.
-      clear: If True, clear the logcat when monitoring starts.
-      filter_specs: An optional list of '<tag>[:priority]' strings.
-    """
-    if isinstance(adb, adb_wrapper.AdbWrapper):
-      self._adb = adb
-    else:
-      raise ValueError('Unsupported type passed for argument "device"')
-    self._clear = clear
-    self._filter_specs = filter_specs
-    self._logcat_out = None
-    self._logcat_out_file = None
-    self._logcat_proc = None
-
-  @decorators.WithTimeoutAndRetriesDefaults(10, 0)
-  def WaitFor(self, success_regex, failure_regex=None, timeout=None,
-              retries=None):
-    """Wait for a matching logcat line or until a timeout occurs.
-
-    This will attempt to match lines in the logcat against both |success_regex|
-    and |failure_regex| (if provided). Note that this calls re.search on each
-    logcat line, not re.match, so the provided regular expressions don't have
-    to match an entire line.
-
-    Args:
-      success_regex: The regular expression to search for.
-      failure_regex: An optional regular expression that, if hit, causes this
-        to stop looking for a match. Can be None.
-      timeout: timeout in seconds
-      retries: number of retries
-
-    Returns:
-      A match object if |success_regex| matches a part of a logcat line, or
-      None if |failure_regex| matches a part of a logcat line.
-    Raises:
-      CommandFailedError on logcat failure (NOT on a |failure_regex| match).
-      CommandTimeoutError if no logcat line matching either |success_regex| or
-        |failure_regex| is found in |timeout| seconds.
-      DeviceUnreachableError if the device becomes unreachable.
-    """
-    if isinstance(success_regex, basestring):
-      success_regex = re.compile(success_regex)
-    if isinstance(failure_regex, basestring):
-      failure_regex = re.compile(failure_regex)
-
-    logging.debug('Waiting %d seconds for "%s"', timeout, success_regex.pattern)
-
-    # NOTE This will continue looping until:
-    #  - success_regex matches a line, in which case the match object is
-    #    returned.
-    #  - failure_regex matches a line, in which case None is returned
-    #  - the timeout is hit, in which case a CommandTimeoutError is raised.
-    for l in self._adb.Logcat(filter_specs=self._filter_specs):
-      m = success_regex.search(l)
-      if m:
-        return m
-      if failure_regex and failure_regex.search(l):
-        return None
-
-  def FindAll(self, message_regex, proc_id=None, thread_id=None, log_level=None,
-              component=None):
-    """Finds all lines in the logcat that match the provided constraints.
-
-    Args:
-      message_regex: The regular expression that the <message> section must
-        match.
-      proc_id: The process ID to match. If None, matches any process ID.
-      thread_id: The thread ID to match. If None, matches any thread ID.
-      log_level: The log level to match. If None, matches any log level.
-      component: The component to match. If None, matches any component.
-
-    Yields:
-      A match object for each matching line in the logcat. The match object
-      will always contain, in addition to groups defined in |message_regex|,
-      the following named groups: 'date', 'time', 'proc_id', 'thread_id',
-      'log_level', 'component', and 'message'.
-    """
-    if proc_id is None:
-      proc_id = r'\d+'
-    if thread_id is None:
-      thread_id = r'\d+'
-    if log_level is None:
-      log_level = r'[VDIWEF]'
-    if component is None:
-      component = r'[^\s:]+'
-    threadtime_re = re.compile(
-        type(self)._THREADTIME_RE_FORMAT % (
-            proc_id, thread_id, log_level, component, message_regex))
-
-    for line in self._adb.Logcat(dump=True, logcat_format='threadtime'):
-      m = re.match(threadtime_re, line)
-      if m:
-        yield m
-
-  def Start(self):
-    """Starts the logcat monitor.
-
-    Clears the logcat if |clear| was set in |__init__|.
-    """
-    if self._clear:
-      self._adb.Logcat(clear=True)
-
-  def __enter__(self):
-    """Starts the logcat monitor."""
-    self.Start()
-    return self
-
-  def __exit__(self, exc_type, exc_val, exc_tb):
-    """Stops the logcat monitor."""
-    pass
diff --git a/build/android/pylib/device/logcat_monitor_test.py b/build/android/pylib/device/logcat_monitor_test.py
deleted file mode 100755
index db397e57..0000000
--- a/build/android/pylib/device/logcat_monitor_test.py
+++ /dev/null
@@ -1,164 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import itertools
-import os
-import sys
-import unittest
-
-from pylib import constants
-from pylib.device import adb_wrapper
-from pylib.device import decorators
-from pylib.device import logcat_monitor
-
-sys.path.append(os.path.join(
-    constants.DIR_SOURCE_ROOT, 'third_party', 'pymock'))
-import mock # pylint: disable=F0401
-
-
-class LogcatMonitorTest(unittest.TestCase):
-
-  _TEST_THREADTIME_LOGCAT_DATA = [
-        '01-01 01:02:03.456  7890  0987 V LogcatMonitorTest: '
-            'verbose logcat monitor test message 1',
-        '01-01 01:02:03.457  8901  1098 D LogcatMonitorTest: '
-            'debug logcat monitor test message 2',
-        '01-01 01:02:03.458  9012  2109 I LogcatMonitorTest: '
-            'info logcat monitor test message 3',
-        '01-01 01:02:03.459  0123  3210 W LogcatMonitorTest: '
-            'warning logcat monitor test message 4',
-        '01-01 01:02:03.460  1234  4321 E LogcatMonitorTest: '
-            'error logcat monitor test message 5',
-        '01-01 01:02:03.461  2345  5432 F LogcatMonitorTest: '
-            'fatal logcat monitor test message 6',
-        '01-01 01:02:03.462  3456  6543 D LogcatMonitorTest: '
-            'ignore me',]
-
-  def _createTestLog(self, raw_logcat=None):
-    test_adb = adb_wrapper.AdbWrapper('0123456789abcdef')
-    test_adb.Logcat = mock.Mock(return_value=(l for l in raw_logcat))
-    test_log = logcat_monitor.LogcatMonitor(test_adb, clear=False)
-    return test_log
-
-  def assertIterEqual(self, expected_iter, actual_iter):
-    for expected, actual in itertools.izip_longest(expected_iter, actual_iter):
-      self.assertIsNotNone(
-          expected,
-          msg='actual has unexpected elements starting with %s' % str(actual))
-      self.assertIsNotNone(
-          actual,
-          msg='actual is missing elements starting with %s' % str(expected))
-      self.assertEqual(actual.group('proc_id'), expected[0])
-      self.assertEqual(actual.group('thread_id'), expected[1])
-      self.assertEqual(actual.group('log_level'), expected[2])
-      self.assertEqual(actual.group('component'), expected[3])
-      self.assertEqual(actual.group('message'), expected[4])
-
-    with self.assertRaises(StopIteration):
-      next(actual_iter)
-    with self.assertRaises(StopIteration):
-      next(expected_iter)
-
-  def testWaitFor_success(self):
-    test_log = self._createTestLog(
-        raw_logcat=type(self)._TEST_THREADTIME_LOGCAT_DATA)
-    actual_match = test_log.WaitFor(r'.*(fatal|error) logcat monitor.*', None)
-    self.assertTrue(actual_match)
-    self.assertEqual(
-        '01-01 01:02:03.460  1234  4321 E LogcatMonitorTest: '
-            'error logcat monitor test message 5',
-        actual_match.group(0))
-    self.assertEqual('error', actual_match.group(1))
-
-  def testWaitFor_failure(self):
-    test_log = self._createTestLog(
-        raw_logcat=type(self)._TEST_THREADTIME_LOGCAT_DATA)
-    actual_match = test_log.WaitFor(
-        r'.*My Success Regex.*', r'.*(fatal|error) logcat monitor.*')
-    self.assertIsNone(actual_match)
-
-  def testFindAll_defaults(self):
-    test_log = self._createTestLog(
-        raw_logcat=type(self)._TEST_THREADTIME_LOGCAT_DATA)
-    expected_results = [
-        ('7890', '0987', 'V', 'LogcatMonitorTest',
-         'verbose logcat monitor test message 1'),
-        ('8901', '1098', 'D', 'LogcatMonitorTest',
-         'debug logcat monitor test message 2'),
-        ('9012', '2109', 'I', 'LogcatMonitorTest',
-         'info logcat monitor test message 3'),
-        ('0123', '3210', 'W', 'LogcatMonitorTest',
-         'warning logcat monitor test message 4'),
-        ('1234', '4321', 'E', 'LogcatMonitorTest',
-         'error logcat monitor test message 5'),
-        ('2345', '5432', 'F', 'LogcatMonitorTest',
-         'fatal logcat monitor test message 6')]
-    actual_results = test_log.FindAll(r'\S* logcat monitor test message \d')
-    self.assertIterEqual(iter(expected_results), actual_results)
-
-  def testFindAll_defaults_miss(self):
-    test_log = self._createTestLog(
-        raw_logcat=type(self)._TEST_THREADTIME_LOGCAT_DATA)
-    expected_results = []
-    actual_results = test_log.FindAll(r'\S* nothing should match this \d')
-    self.assertIterEqual(iter(expected_results), actual_results)
-
-  def testFindAll_filterProcId(self):
-    test_log = self._createTestLog(
-        raw_logcat=type(self)._TEST_THREADTIME_LOGCAT_DATA)
-    actual_results = test_log.FindAll(
-        r'\S* logcat monitor test message \d', proc_id=1234)
-    expected_results = [
-        ('1234', '4321', 'E', 'LogcatMonitorTest',
-         'error logcat monitor test message 5')]
-    self.assertIterEqual(iter(expected_results), actual_results)
-
-  def testFindAll_filterThreadId(self):
-    test_log = self._createTestLog(
-        raw_logcat=type(self)._TEST_THREADTIME_LOGCAT_DATA)
-    actual_results = test_log.FindAll(
-        r'\S* logcat monitor test message \d', thread_id=2109)
-    expected_results = [
-        ('9012', '2109', 'I', 'LogcatMonitorTest',
-         'info logcat monitor test message 3')]
-    self.assertIterEqual(iter(expected_results), actual_results)
-
-  def testFindAll_filterLogLevel(self):
-    test_log = self._createTestLog(
-        raw_logcat=type(self)._TEST_THREADTIME_LOGCAT_DATA)
-    actual_results = test_log.FindAll(
-        r'\S* logcat monitor test message \d', log_level=r'[DW]')
-    expected_results = [
-        ('8901', '1098', 'D', 'LogcatMonitorTest',
-         'debug logcat monitor test message 2'),
-        ('0123', '3210', 'W', 'LogcatMonitorTest',
-         'warning logcat monitor test message 4'),]
-    self.assertIterEqual(iter(expected_results), actual_results)
-
-  def testFindAll_filterComponent(self):
-    test_log = self._createTestLog(
-        raw_logcat=type(self)._TEST_THREADTIME_LOGCAT_DATA)
-    actual_results = test_log.FindAll(r'.*', component='LogcatMonitorTest')
-    expected_results = [
-        ('7890', '0987', 'V', 'LogcatMonitorTest',
-         'verbose logcat monitor test message 1'),
-        ('8901', '1098', 'D', 'LogcatMonitorTest',
-         'debug logcat monitor test message 2'),
-        ('9012', '2109', 'I', 'LogcatMonitorTest',
-         'info logcat monitor test message 3'),
-        ('0123', '3210', 'W', 'LogcatMonitorTest',
-         'warning logcat monitor test message 4'),
-        ('1234', '4321', 'E', 'LogcatMonitorTest',
-         'error logcat monitor test message 5'),
-        ('2345', '5432', 'F', 'LogcatMonitorTest',
-         'fatal logcat monitor test message 6'),
-        ('3456', '6543', 'D', 'LogcatMonitorTest',
-         'ignore me'),]
-    self.assertIterEqual(iter(expected_results), actual_results)
-
-
-if __name__ == '__main__':
-  unittest.main(verbosity=2)
-
diff --git a/build/android/pylib/device/shared_prefs.py b/build/android/pylib/device/shared_prefs.py
deleted file mode 100644
index 32cef4b..0000000
--- a/build/android/pylib/device/shared_prefs.py
+++ /dev/null
@@ -1,391 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Helper object to read and modify Shared Preferences from Android apps.
-
-See e.g.:
-  http://developer.android.com/reference/android/content/SharedPreferences.html
-"""
-
-import collections
-import logging
-import posixpath
-
-from xml.etree import ElementTree
-
-
-_XML_DECLARATION = "<?xml version='1.0' encoding='utf-8' standalone='yes' ?>\n"
-
-
-class BasePref(object):
-  """Base class for getting/setting the value of a specific preference type.
-
-  Should not be instantiated directly. The SharedPrefs collection will
-  instantiate the appropriate subclasses, which directly manipulate the
-  underlying xml document, to parse and serialize values according to their
-  type.
-
-  Args:
-    elem: An xml ElementTree object holding the preference data.
-
-  Properties:
-    tag_name: A string with the tag that must be used for this preference type.
-  """
-  tag_name = None
-
-  def __init__(self, elem):
-    if elem.tag != type(self).tag_name:
-      raise TypeError('Property %r has type %r, but trying to access as %r' %
-                      (elem.get('name'), elem.tag, type(self).tag_name))
-    self._elem = elem
-
-  def __str__(self):
-    """Get the underlying xml element as a string."""
-    return ElementTree.tostring(self._elem)
-
-  def get(self):
-    """Get the value of this preference."""
-    return self._elem.get('value')
-
-  def set(self, value):
-    """Set from a value casted as a string."""
-    self._elem.set('value', str(value))
-
-  @property
-  def has_value(self):
-    """Check whether the element has a value."""
-    return self._elem.get('value') is not None
-
-
-class BooleanPref(BasePref):
-  """Class for getting/setting a preference with a boolean value.
-
-  The underlying xml element has the form, e.g.:
-      <boolean name="featureEnabled" value="false" />
-  """
-  tag_name = 'boolean'
-  VALUES = {'true': True, 'false': False}
-
-  def get(self):
-    """Get the value as a Python bool."""
-    return type(self).VALUES[super(BooleanPref, self).get()]
-
-  def set(self, value):
-    """Set from a value casted as a bool."""
-    super(BooleanPref, self).set('true' if value else 'false')
-
-
-class FloatPref(BasePref):
-  """Class for getting/setting a preference with a float value.
-
-  The underlying xml element has the form, e.g.:
-      <float name="someMetric" value="4.7" />
-  """
-  tag_name = 'float'
-
-  def get(self):
-    """Get the value as a Python float."""
-    return float(super(FloatPref, self).get())
-
-
-class IntPref(BasePref):
-  """Class for getting/setting a preference with an int value.
-
-  The underlying xml element has the form, e.g.:
-      <int name="aCounter" value="1234" />
-  """
-  tag_name = 'int'
-
-  def get(self):
-    """Get the value as a Python int."""
-    return int(super(IntPref, self).get())
-
-
-class LongPref(IntPref):
-  """Class for getting/setting a preference with a long value.
-
-  The underlying xml element has the form, e.g.:
-      <long name="aLongCounter" value="1234" />
-
-  We use the same implementation from IntPref.
-  """
-  tag_name = 'long'
-
-
-class StringPref(BasePref):
-  """Class for getting/setting a preference with a string value.
-
-  The underlying xml element has the form, e.g.:
-      <string name="someHashValue">249b3e5af13d4db2</string>
-  """
-  tag_name = 'string'
-
-  def get(self):
-    """Get the value as a Python string."""
-    return self._elem.text
-
-  def set(self, value):
-    """Set from a value casted as a string."""
-    self._elem.text = str(value)
-
-
-class StringSetPref(StringPref):
-  """Class for getting/setting a preference with a set of string values.
-
-  The underlying xml element has the form, e.g.:
-      <set name="managed_apps">
-          <string>com.mine.app1</string>
-          <string>com.mine.app2</string>
-          <string>com.mine.app3</string>
-      </set>
-  """
-  tag_name = 'set'
-
-  def get(self):
-    """Get a list with the string values contained."""
-    value = []
-    for child in self._elem:
-      assert child.tag == 'string'
-      value.append(child.text)
-    return value
-
-  def set(self, value):
-    """Set from a sequence of values, each casted as a string."""
-    for child in list(self._elem):
-      self._elem.remove(child)
-    for item in value:
-      ElementTree.SubElement(self._elem, 'string').text = str(item)
-
-
-_PREF_TYPES = {c.tag_name: c for c in [BooleanPref, FloatPref, IntPref,
-                                       LongPref, StringPref, StringSetPref]}
-
-
-class SharedPrefs(object):
-  def __init__(self, device, package, filename):
-    """Helper object to read and update "Shared Prefs" of Android apps.
-
-    Such files typically look like, e.g.:
-
-        <?xml version='1.0' encoding='utf-8' standalone='yes' ?>
-        <map>
-          <int name="databaseVersion" value="107" />
-          <boolean name="featureEnabled" value="false" />
-          <string name="someHashValue">249b3e5af13d4db2</string>
-        </map>
-
-    Example usage:
-
-        prefs = shared_prefs.SharedPrefs(device, 'com.my.app', 'my_prefs.xml')
-        prefs.Load()
-        prefs.GetString('someHashValue') # => '249b3e5af13d4db2'
-        prefs.SetInt('databaseVersion', 42)
-        prefs.Remove('featureEnabled')
-        prefs.Commit()
-
-    The object may also be used as a context manager to automatically load and
-    commit, respectively, upon entering and leaving the context.
-
-    Args:
-      device: A DeviceUtils object.
-      package: A string with the package name of the app that owns the shared
-        preferences file.
-      filename: A string with the name of the preferences file to read/write.
-    """
-    self._device = device
-    self._xml = None
-    self._package = package
-    self._filename = filename
-    self._path = '/data/data/%s/shared_prefs/%s' % (package, filename)
-    self._changed = False
-
-  def __repr__(self):
-    """Get a useful printable representation of the object."""
-    return '<{cls} file {filename} for {package} on {device}>'.format(
-      cls=type(self).__name__, filename=self.filename, package=self.package,
-      device=str(self._device))
-
-  def __str__(self):
-    """Get the underlying xml document as a string."""
-    return _XML_DECLARATION + ElementTree.tostring(self.xml)
-
-  @property
-  def package(self):
-    """Get the package name of the app that owns the shared preferences."""
-    return self._package
-
-  @property
-  def filename(self):
-    """Get the filename of the shared preferences file."""
-    return self._filename
-
-  @property
-  def path(self):
-    """Get the full path to the shared preferences file on the device."""
-    return self._path
-
-  @property
-  def changed(self):
-    """True if properties have changed and a commit would be needed."""
-    return self._changed
-
-  @property
-  def xml(self):
-    """Get the underlying xml document as an ElementTree object."""
-    if self._xml is None:
-      self._xml = ElementTree.Element('map')
-    return self._xml
-
-  def Load(self):
-    """Load the shared preferences file from the device.
-
-    A empty xml document, which may be modified and saved on |commit|, is
-    created if the file does not already exist.
-    """
-    if self._device.FileExists(self.path):
-      self._xml = ElementTree.fromstring(
-          self._device.ReadFile(self.path, as_root=True))
-      assert self._xml.tag == 'map'
-    else:
-      self._xml = None
-    self._changed = False
-
-  def Clear(self):
-    """Clear all of the preferences contained in this object."""
-    if self._xml is not None and len(self): # only clear if not already empty
-      self._xml = None
-      self._changed = True
-
-  def Commit(self):
-    """Save the current set of preferences to the device.
-
-    Only actually saves if some preferences have been modified.
-    """
-    if not self.changed:
-      return
-    self._device.RunShellCommand(
-        ['mkdir', '-p', posixpath.dirname(self.path)],
-        as_root=True, check_return=True)
-    self._device.WriteFile(self.path, str(self), as_root=True)
-    self._device.KillAll(self.package, as_root=True, quiet=True)
-    self._changed = False
-
-  def __len__(self):
-    """Get the number of preferences in this collection."""
-    return len(self.xml)
-
-  def PropertyType(self, key):
-    """Get the type (i.e. tag name) of a property in the collection."""
-    return self._GetChild(key).tag
-
-  def HasProperty(self, key):
-    try:
-      self._GetChild(key)
-      return True
-    except KeyError:
-      return False
-
-  def GetBoolean(self, key):
-    """Get a boolean property."""
-    return BooleanPref(self._GetChild(key)).get()
-
-  def SetBoolean(self, key, value):
-    """Set a boolean property."""
-    self._SetPrefValue(key, value, BooleanPref)
-
-  def GetFloat(self, key):
-    """Get a float property."""
-    return FloatPref(self._GetChild(key)).get()
-
-  def SetFloat(self, key, value):
-    """Set a float property."""
-    self._SetPrefValue(key, value, FloatPref)
-
-  def GetInt(self, key):
-    """Get an int property."""
-    return IntPref(self._GetChild(key)).get()
-
-  def SetInt(self, key, value):
-    """Set an int property."""
-    self._SetPrefValue(key, value, IntPref)
-
-  def GetLong(self, key):
-    """Get a long property."""
-    return LongPref(self._GetChild(key)).get()
-
-  def SetLong(self, key, value):
-    """Set a long property."""
-    self._SetPrefValue(key, value, LongPref)
-
-  def GetString(self, key):
-    """Get a string property."""
-    return StringPref(self._GetChild(key)).get()
-
-  def SetString(self, key, value):
-    """Set a string property."""
-    self._SetPrefValue(key, value, StringPref)
-
-  def GetStringSet(self, key):
-    """Get a string set property."""
-    return StringSetPref(self._GetChild(key)).get()
-
-  def SetStringSet(self, key, value):
-    """Set a string set property."""
-    self._SetPrefValue(key, value, StringSetPref)
-
-  def Remove(self, key):
-    """Remove a preference from the collection."""
-    self.xml.remove(self._GetChild(key))
-
-  def AsDict(self):
-    """Return the properties and their values as a dictionary."""
-    d = {}
-    for child in self.xml:
-      pref = _PREF_TYPES[child.tag](child)
-      d[child.get('name')] = pref.get()
-    return d
-
-  def __enter__(self):
-    """Load preferences file from the device when entering a context."""
-    self.Load()
-    return self
-
-  def __exit__(self, exc_type, _exc_value, _traceback):
-    """Save preferences file to the device when leaving a context."""
-    if not exc_type:
-      self.Commit()
-
-  def _GetChild(self, key):
-    """Get the underlying xml node that holds the property of a given key.
-
-    Raises:
-      KeyError when the key is not found in the collection.
-    """
-    for child in self.xml:
-      if child.get('name') == key:
-        return child
-    raise KeyError(key)
-
-  def _SetPrefValue(self, key, value, pref_cls):
-    """Set the value of a property.
-
-    Args:
-      key: The key of the property to set.
-      value: The new value of the property.
-      pref_cls: A subclass of BasePref used to access the property.
-
-    Raises:
-      TypeError when the key already exists but with a different type.
-    """
-    try:
-      pref = pref_cls(self._GetChild(key))
-      old_value = pref.get()
-    except KeyError:
-      pref = pref_cls(ElementTree.SubElement(
-          self.xml, pref_cls.tag_name, {'name': key}))
-      old_value = None
-    if old_value != value:
-      pref.set(value)
-      self._changed = True
-      logging.info('Setting property: %s', pref)
diff --git a/build/android/pylib/device/shared_prefs_test.py b/build/android/pylib/device/shared_prefs_test.py
deleted file mode 100755
index c5f0ec3..0000000
--- a/build/android/pylib/device/shared_prefs_test.py
+++ /dev/null
@@ -1,169 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-Unit tests for the contents of shared_prefs.py (mostly SharedPrefs).
-"""
-
-import logging
-import os
-import sys
-import unittest
-
-from pylib import constants
-from pylib.device import device_utils
-from pylib.device import shared_prefs
-
-sys.path.append(os.path.join(
-    constants.DIR_SOURCE_ROOT, 'third_party', 'pymock'))
-import mock
-
-
-def MockDeviceWithFiles(files=None):
-  if files is None:
-    files = {}
-
-  def file_exists(path):
-    return path in files
-
-  def write_file(path, contents, **_kwargs):
-    files[path] = contents
-
-  def read_file(path, **_kwargs):
-    return files[path]
-
-  device = mock.MagicMock(spec=device_utils.DeviceUtils)
-  device.FileExists = mock.Mock(side_effect=file_exists)
-  device.WriteFile = mock.Mock(side_effect=write_file)
-  device.ReadFile = mock.Mock(side_effect=read_file)
-  return device
-
-
-class SharedPrefsTest(unittest.TestCase):
-
-  def setUp(self):
-    self.device = MockDeviceWithFiles({
-      '/data/data/com.some.package/shared_prefs/prefs.xml':
-          "<?xml version='1.0' encoding='utf-8' standalone='yes' ?>\n"
-          '<map>\n'
-          '  <int name="databaseVersion" value="107" />\n'
-          '  <boolean name="featureEnabled" value="false" />\n'
-          '  <string name="someHashValue">249b3e5af13d4db2</string>\n'
-          '</map>'})
-    self.expected_data = {'databaseVersion': 107,
-                          'featureEnabled': False,
-                          'someHashValue': '249b3e5af13d4db2'}
-
-  def testPropertyLifetime(self):
-    prefs = shared_prefs.SharedPrefs(
-        self.device, 'com.some.package', 'prefs.xml')
-    self.assertEquals(len(prefs), 0) # collection is empty before loading
-    prefs.SetInt('myValue', 444)
-    self.assertEquals(len(prefs), 1)
-    self.assertEquals(prefs.GetInt('myValue'), 444)
-    self.assertTrue(prefs.HasProperty('myValue'))
-    prefs.Remove('myValue')
-    self.assertEquals(len(prefs), 0)
-    self.assertFalse(prefs.HasProperty('myValue'))
-    with self.assertRaises(KeyError):
-      prefs.GetInt('myValue')
-
-  def testPropertyType(self):
-    prefs = shared_prefs.SharedPrefs(
-        self.device, 'com.some.package', 'prefs.xml')
-    prefs.SetInt('myValue', 444)
-    self.assertEquals(prefs.PropertyType('myValue'), 'int')
-    with self.assertRaises(TypeError):
-      prefs.GetString('myValue')
-    with self.assertRaises(TypeError):
-      prefs.SetString('myValue', 'hello')
-
-  def testLoad(self):
-    prefs = shared_prefs.SharedPrefs(
-        self.device, 'com.some.package', 'prefs.xml')
-    self.assertEquals(len(prefs), 0) # collection is empty before loading
-    prefs.Load()
-    self.assertEquals(len(prefs), len(self.expected_data))
-    self.assertEquals(prefs.AsDict(), self.expected_data)
-    self.assertFalse(prefs.changed)
-
-  def testClear(self):
-    prefs = shared_prefs.SharedPrefs(
-        self.device, 'com.some.package', 'prefs.xml')
-    prefs.Load()
-    self.assertEquals(prefs.AsDict(), self.expected_data)
-    self.assertFalse(prefs.changed)
-    prefs.Clear()
-    self.assertEquals(len(prefs), 0) # collection is empty now
-    self.assertTrue(prefs.changed)
-
-  def testCommit(self):
-    prefs = shared_prefs.SharedPrefs(
-        self.device, 'com.some.package', 'other_prefs.xml')
-    self.assertFalse(self.device.FileExists(prefs.path)) # file does not exist
-    prefs.Load()
-    self.assertEquals(len(prefs), 0) # file did not exist, collection is empty
-    prefs.SetInt('magicNumber', 42)
-    prefs.SetFloat('myMetric', 3.14)
-    prefs.SetLong('bigNumner', 6000000000)
-    prefs.SetStringSet('apps', ['gmail', 'chrome', 'music'])
-    self.assertFalse(self.device.FileExists(prefs.path)) # still does not exist
-    self.assertTrue(prefs.changed)
-    prefs.Commit()
-    self.assertTrue(self.device.FileExists(prefs.path)) # should exist now
-    self.device.KillAll.assert_called_once_with(prefs.package, as_root=True,
-                                                quiet=True)
-    self.assertFalse(prefs.changed)
-
-    prefs = shared_prefs.SharedPrefs(
-        self.device, 'com.some.package', 'other_prefs.xml')
-    self.assertEquals(len(prefs), 0) # collection is empty before loading
-    prefs.Load()
-    self.assertEquals(prefs.AsDict(), {
-        'magicNumber': 42,
-        'myMetric': 3.14,
-        'bigNumner': 6000000000,
-        'apps': ['gmail', 'chrome', 'music']}) # data survived roundtrip
-
-  def testAsContextManager_onlyReads(self):
-    with shared_prefs.SharedPrefs(
-        self.device, 'com.some.package', 'prefs.xml') as prefs:
-      self.assertEquals(prefs.AsDict(), self.expected_data) # loaded and ready
-    self.assertEquals(self.device.WriteFile.call_args_list, []) # did not write
-
-  def testAsContextManager_readAndWrite(self):
-    with shared_prefs.SharedPrefs(
-        self.device, 'com.some.package', 'prefs.xml') as prefs:
-      prefs.SetBoolean('featureEnabled', True)
-      prefs.Remove('someHashValue')
-      prefs.SetString('newString', 'hello')
-
-    self.assertTrue(self.device.WriteFile.called) # did write
-    with shared_prefs.SharedPrefs(
-        self.device, 'com.some.package', 'prefs.xml') as prefs:
-      # changes persisted
-      self.assertTrue(prefs.GetBoolean('featureEnabled'))
-      self.assertFalse(prefs.HasProperty('someHashValue'))
-      self.assertEquals(prefs.GetString('newString'), 'hello')
-      self.assertTrue(prefs.HasProperty('databaseVersion')) # still there
-
-  def testAsContextManager_commitAborted(self):
-    with self.assertRaises(TypeError):
-      with shared_prefs.SharedPrefs(
-          self.device, 'com.some.package', 'prefs.xml') as prefs:
-        prefs.SetBoolean('featureEnabled', True)
-        prefs.Remove('someHashValue')
-        prefs.SetString('newString', 'hello')
-        prefs.SetInt('newString', 123) # oops!
-
-    self.assertEquals(self.device.WriteFile.call_args_list, []) # did not write
-    with shared_prefs.SharedPrefs(
-        self.device, 'com.some.package', 'prefs.xml') as prefs:
-      # contents were not modified
-      self.assertEquals(prefs.AsDict(), self.expected_data)
-
-if __name__ == '__main__':
-  logging.getLogger().setLevel(logging.DEBUG)
-  unittest.main(verbosity=2)
diff --git a/build/android/pylib/device_settings.py b/build/android/pylib/device_settings.py
deleted file mode 100644
index beabcff..0000000
--- a/build/android/pylib/device_settings.py
+++ /dev/null
@@ -1,198 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging
-
-from pylib import constants
-from pylib import content_settings
-from pylib.device import device_errors
-
-_LOCK_SCREEN_SETTINGS_PATH = '/data/system/locksettings.db'
-_ALTERNATE_LOCK_SCREEN_SETTINGS_PATH = (
-    '/data/data/com.android.providers.settings/databases/settings.db')
-PASSWORD_QUALITY_UNSPECIFIED = '0'
-
-
-def ConfigureContentSettings(device, desired_settings):
-  """Configures device content setings from a list.
-
-  Many settings are documented at:
-    http://developer.android.com/reference/android/provider/Settings.Global.html
-    http://developer.android.com/reference/android/provider/Settings.Secure.html
-    http://developer.android.com/reference/android/provider/Settings.System.html
-
-  Many others are undocumented.
-
-  Args:
-    device: A DeviceUtils instance for the device to configure.
-    desired_settings: A list of (table, [(key: value), ...]) for all
-        settings to configure.
-  """
-  if device.build_type == 'userdebug':
-    for table, key_value in desired_settings:
-      settings = content_settings.ContentSettings(table, device)
-      for key, value in key_value:
-        settings[key] = value
-      logging.info('\n%s %s', table, (80 - len(table)) * '-')
-      for key, value in sorted(settings.iteritems()):
-        logging.info('\t%s: %s', key, value)
-
-
-def SetLockScreenSettings(device):
-  """Sets lock screen settings on the device.
-
-  On certain device/Android configurations we need to disable the lock screen in
-  a different database. Additionally, the password type must be set to
-  DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED.
-  Lock screen settings are stored in sqlite on the device in:
-      /data/system/locksettings.db
-
-  IMPORTANT: The first column is used as a primary key so that all rows with the
-  same value for that column are removed from the table prior to inserting the
-  new values.
-
-  Args:
-    device: A DeviceUtils instance for the device to configure.
-
-  Raises:
-    Exception if the setting was not properly set.
-  """
-  if device.build_type != 'userdebug':
-    logging.warning('Unable to disable lockscreen on user builds.')
-    return
-
-  def get_lock_settings(table):
-    return [(table, 'lockscreen.disabled', '1'),
-            (table, 'lockscreen.password_type', PASSWORD_QUALITY_UNSPECIFIED),
-            (table, 'lockscreen.password_type_alternate',
-             PASSWORD_QUALITY_UNSPECIFIED)]
-
-  if device.FileExists(_LOCK_SCREEN_SETTINGS_PATH):
-    db = _LOCK_SCREEN_SETTINGS_PATH
-    locksettings = get_lock_settings('locksettings')
-    columns = ['name', 'user', 'value']
-    generate_values = lambda k, v: [k, '0', v]
-  elif device.FileExists(_ALTERNATE_LOCK_SCREEN_SETTINGS_PATH):
-    db = _ALTERNATE_LOCK_SCREEN_SETTINGS_PATH
-    locksettings = get_lock_settings('secure') + get_lock_settings('system')
-    columns = ['name', 'value']
-    generate_values = lambda k, v: [k, v]
-  else:
-    logging.warning('Unable to find database file to set lock screen settings.')
-    return
-
-  for table, key, value in locksettings:
-    # Set the lockscreen setting for default user '0'
-    values = generate_values(key, value)
-
-    cmd = """begin transaction;
-delete from '%(table)s' where %(primary_key)s='%(primary_value)s';
-insert into '%(table)s' (%(columns)s) values (%(values)s);
-commit transaction;""" % {
-      'table': table,
-      'primary_key': columns[0],
-      'primary_value': values[0],
-      'columns': ', '.join(columns),
-      'values': ', '.join(["'%s'" % value for value in values])
-    }
-    output_msg = device.RunShellCommand('sqlite3 %s "%s"' % (db, cmd),
-                                        as_root=True)
-    if output_msg:
-      logging.info(' '.join(output_msg))
-
-
-ENABLE_LOCATION_SETTINGS = [
-  # Note that setting these in this order is required in order for all of
-  # them to take and stick through a reboot.
-  ('com.google.settings/partner', [
-    ('use_location_for_services', 1),
-  ]),
-  ('settings/secure', [
-    # Ensure Geolocation is enabled and allowed for tests.
-    ('location_providers_allowed', 'gps,network'),
-  ]),
-  ('com.google.settings/partner', [
-    ('network_location_opt_in', 1),
-  ])
-]
-
-DISABLE_LOCATION_SETTINGS = [
-  ('com.google.settings/partner', [
-    ('use_location_for_services', 0),
-  ]),
-  ('settings/secure', [
-    # Ensure Geolocation is disabled.
-    ('location_providers_allowed', ''),
-  ]),
-]
-
-ENABLE_MOCK_LOCATION_SETTINGS = [
-  ('settings/secure', [
-    ('mock_location', 1),
-  ]),
-]
-
-DISABLE_MOCK_LOCATION_SETTINGS = [
-  ('settings/secure', [
-    ('mock_location', 0),
-  ]),
-]
-
-DETERMINISTIC_DEVICE_SETTINGS = [
-  ('settings/global', [
-    ('assisted_gps_enabled', 0),
-
-    # Disable "auto time" and "auto time zone" to avoid network-provided time
-    # to overwrite the device's datetime and timezone synchronized from host
-    # when running tests later. See b/6569849.
-    ('auto_time', 0),
-    ('auto_time_zone', 0),
-
-    ('development_settings_enabled', 1),
-
-    # Flag for allowing ActivityManagerService to send ACTION_APP_ERROR intents
-    # on application crashes and ANRs. If this is disabled, the crash/ANR dialog
-    # will never display the "Report" button.
-    # Type: int ( 0 = disallow, 1 = allow )
-    ('send_action_app_error', 0),
-
-    ('stay_on_while_plugged_in', 3),
-
-    ('verifier_verify_adb_installs', 0),
-  ]),
-  ('settings/secure', [
-    ('allowed_geolocation_origins',
-        'http://www.google.co.uk http://www.google.com'),
-
-    # Ensure that we never get random dialogs like "Unfortunately the process
-    # android.process.acore has stopped", which steal the focus, and make our
-    # automation fail (because the dialog steals the focus then mistakenly
-    # receives the injected user input events).
-    ('anr_show_background', 0),
-
-    ('lockscreen.disabled', 1),
-
-    ('screensaver_enabled', 0),
-  ]),
-  ('settings/system', [
-    # Don't want devices to accidentally rotate the screen as that could
-    # affect performance measurements.
-    ('accelerometer_rotation', 0),
-
-    ('lockscreen.disabled', 1),
-
-    # Turn down brightness and disable auto-adjust so that devices run cooler.
-    ('screen_brightness', 5),
-    ('screen_brightness_mode', 0),
-
-    ('user_rotation', 0),
-  ]),
-]
-
-NETWORK_DISABLED_SETTINGS = [
-  ('settings/global', [
-    ('airplane_mode_on', 1),
-    ('wifi_on', 0),
-  ]),
-]
diff --git a/build/android/pylib/device_signal.py b/build/android/pylib/device_signal.py
deleted file mode 100644
index 6a5b709..0000000
--- a/build/android/pylib/device_signal.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Defines constants for signals that should be supported on devices.
-
-Note: Obtained by running `kill -l` on a user device.
-"""
-
-
-SIGHUP = 1 # Hangup
-SIGINT = 2 # Interrupt
-SIGQUIT = 3 # Quit
-SIGILL = 4 # Illegal instruction
-SIGTRAP = 5 # Trap
-SIGABRT = 6 # Aborted
-SIGBUS = 7 # Bus error
-SIGFPE = 8 # Floating point exception
-SIGKILL = 9 # Killed
-SIGUSR1 = 10 # User signal 1
-SIGSEGV = 11 # Segmentation fault
-SIGUSR2 = 12 # User signal 2
-SIGPIPE = 13 # Broken pipe
-SIGALRM = 14 # Alarm clock
-SIGTERM = 15 # Terminated
-SIGSTKFLT = 16 # Stack fault
-SIGCHLD = 17 # Child exited
-SIGCONT = 18 # Continue
-SIGSTOP = 19 # Stopped (signal)
-SIGTSTP = 20 # Stopped
-SIGTTIN = 21 # Stopped (tty input)
-SIGTTOU = 22 # Stopped (tty output)
-SIGURG = 23 # Urgent I/O condition
-SIGXCPU = 24 # CPU time limit exceeded
-SIGXFSZ = 25 # File size limit exceeded
-SIGVTALRM = 26 # Virtual timer expired
-SIGPROF = 27 # Profiling timer expired
-SIGWINCH = 28 # Window size changed
-SIGIO = 29 # I/O possible
-SIGPWR = 30 # Power failure
-SIGSYS = 31 # Bad system call
diff --git a/build/android/pylib/efficient_android_directory_copy.sh b/build/android/pylib/efficient_android_directory_copy.sh
deleted file mode 100755
index 7021109..0000000
--- a/build/android/pylib/efficient_android_directory_copy.sh
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/system/bin/sh
-
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Android shell script to make the destination directory identical with the
-# source directory, without doing unnecessary copies. This assumes that the
-# the destination directory was originally a copy of the source directory, and
-# has since been modified.
-
-source=$1
-dest=$2
-echo copying $source to $dest
-
-delete_extra() {
-  # Don't delete symbolic links, since doing so deletes the vital lib link.
-  if [ ! -L "$1" ]
-  then
-    if [ ! -e "$source/$1" ]
-    then
-      echo rm -rf "$dest/$1"
-      rm -rf "$dest/$1"
-    elif [ -d "$1" ]
-    then
-      for f in "$1"/*
-      do
-       delete_extra "$f"
-      done
-    fi
-  fi
-}
-
-copy_if_older() {
-  if [ -d "$1" ] && [ -e "$dest/$1" ]
-  then
-    if [ ! -e "$dest/$1" ]
-    then
-      echo cp -a "$1" "$dest/$1"
-      cp -a "$1" "$dest/$1"
-    else
-      for f in "$1"/*
-      do
-        copy_if_older "$f"
-      done
-    fi
-  elif [ ! -e "$dest/$1" ] || [ "$1" -ot "$dest/$1" ] || [ "$1" -nt "$dest/$1" ]
-  then
-    # dates are different, so either the destination of the source has changed.
-    echo cp -a "$1" "$dest/$1"
-    cp -a "$1" "$dest/$1"
-  fi
-}
-
-if [ -e "$dest" ]
-then
-  echo cd "$dest"
-  cd "$dest"
-  for f in ./*
-  do
-    if [ -e "$f" ]
-    then
-      delete_extra "$f"
-    fi
-  done
-else
-  echo mkdir "$dest"
-  mkdir "$dest"
-fi
-echo cd "$source"
-cd "$source"
-for f in ./*
-do
-  if [ -e "$f" ]
-  then
-    copy_if_older "$f"
-  fi
-done
diff --git a/build/android/pylib/flag_changer.py b/build/android/pylib/flag_changer.py
deleted file mode 100644
index 718bc39..0000000
--- a/build/android/pylib/flag_changer.py
+++ /dev/null
@@ -1,166 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging
-
-import pylib.android_commands
-import pylib.device.device_utils
-
-from pylib.device import device_errors
-
-
-class FlagChanger(object):
-  """Changes the flags Chrome runs with.
-
-  There are two different use cases for this file:
-  * Flags are permanently set by calling Set().
-  * Flags can be temporarily set for a particular set of unit tests.  These
-    tests should call Restore() to revert the flags to their original state
-    once the tests have completed.
-  """
-
-  def __init__(self, device, cmdline_file):
-    """Initializes the FlagChanger and records the original arguments.
-
-    Args:
-      device: A DeviceUtils instance.
-      cmdline_file: Path to the command line file on the device.
-    """
-    # TODO(jbudorick) Remove once telemetry switches over.
-    if isinstance(device, pylib.android_commands.AndroidCommands):
-      device = pylib.device.device_utils.DeviceUtils(device)
-    self._device = device
-    self._cmdline_file = cmdline_file
-
-    # Save the original flags.
-    try:
-      self._orig_line = self._device.ReadFile(self._cmdline_file).strip()
-    except device_errors.CommandFailedError:
-      self._orig_line = ''
-
-    # Parse out the flags into a list to facilitate adding and removing flags.
-    self._current_flags = self._TokenizeFlags(self._orig_line)
-
-  def Get(self):
-    """Returns list of current flags."""
-    return self._current_flags
-
-  def Set(self, flags):
-    """Replaces all flags on the current command line with the flags given.
-
-    Args:
-      flags: A list of flags to set, eg. ['--single-process'].
-    """
-    if flags:
-      assert flags[0] != 'chrome'
-
-    self._current_flags = flags
-    self._UpdateCommandLineFile()
-
-  def AddFlags(self, flags):
-    """Appends flags to the command line if they aren't already there.
-
-    Args:
-      flags: A list of flags to add on, eg. ['--single-process'].
-    """
-    if flags:
-      assert flags[0] != 'chrome'
-
-    # Avoid appending flags that are already present.
-    for flag in flags:
-      if flag not in self._current_flags:
-        self._current_flags.append(flag)
-    self._UpdateCommandLineFile()
-
-  def RemoveFlags(self, flags):
-    """Removes flags from the command line, if they exist.
-
-    Args:
-      flags: A list of flags to remove, eg. ['--single-process'].  Note that we
-             expect a complete match when removing flags; if you want to remove
-             a switch with a value, you must use the exact string used to add
-             it in the first place.
-    """
-    if flags:
-      assert flags[0] != 'chrome'
-
-    for flag in flags:
-      if flag in self._current_flags:
-        self._current_flags.remove(flag)
-    self._UpdateCommandLineFile()
-
-  def Restore(self):
-    """Restores the flags to their original state."""
-    self._current_flags = self._TokenizeFlags(self._orig_line)
-    self._UpdateCommandLineFile()
-
-  def _UpdateCommandLineFile(self):
-    """Writes out the command line to the file, or removes it if empty."""
-    logging.info('Current flags: %s', self._current_flags)
-    # Root is not required to write to /data/local/tmp/.
-    use_root = '/data/local/tmp/' not in self._cmdline_file
-    if self._current_flags:
-      # The first command line argument doesn't matter as we are not actually
-      # launching the chrome executable using this command line.
-      cmd_line = ' '.join(['_'] + self._current_flags)
-      self._device.WriteFile(
-          self._cmdline_file, cmd_line, as_root=use_root)
-      file_contents = self._device.ReadFile(
-          self._cmdline_file, as_root=use_root).rstrip()
-      assert file_contents == cmd_line, (
-          'Failed to set the command line file at %s' % self._cmdline_file)
-    else:
-      self._device.RunShellCommand('rm ' + self._cmdline_file,
-                                   as_root=use_root)
-      assert not self._device.FileExists(self._cmdline_file), (
-          'Failed to remove the command line file at %s' % self._cmdline_file)
-
-  @staticmethod
-  def _TokenizeFlags(line):
-    """Changes the string containing the command line into a list of flags.
-
-    Follows similar logic to CommandLine.java::tokenizeQuotedArguments:
-    * Flags are split using whitespace, unless the whitespace is within a
-      pair of quotation marks.
-    * Unlike the Java version, we keep the quotation marks around switch
-      values since we need them to re-create the file when new flags are
-      appended.
-
-    Args:
-      line: A string containing the entire command line.  The first token is
-            assumed to be the program name.
-    """
-    if not line:
-      return []
-
-    tokenized_flags = []
-    current_flag = ""
-    within_quotations = False
-
-    # Move through the string character by character and build up each flag
-    # along the way.
-    for c in line.strip():
-      if c is '"':
-        if len(current_flag) > 0 and current_flag[-1] == '\\':
-          # Last char was a backslash; pop it, and treat this " as a literal.
-          current_flag = current_flag[0:-1] + '"'
-        else:
-          within_quotations = not within_quotations
-          current_flag += c
-      elif not within_quotations and (c is ' ' or c is '\t'):
-        if current_flag is not "":
-          tokenized_flags.append(current_flag)
-          current_flag = ""
-      else:
-        current_flag += c
-
-    # Tack on the last flag.
-    if not current_flag:
-      if within_quotations:
-        logging.warn('Unterminated quoted argument: ' + line)
-    else:
-      tokenized_flags.append(current_flag)
-
-    # Return everything but the program name.
-    return tokenized_flags[1:]
diff --git a/build/android/pylib/forwarder.py b/build/android/pylib/forwarder.py
deleted file mode 100644
index c8c47d6..0000000
--- a/build/android/pylib/forwarder.py
+++ /dev/null
@@ -1,331 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# pylint: disable=W0212
-
-import fcntl
-import logging
-import os
-import psutil
-
-from pylib import cmd_helper
-from pylib import constants
-from pylib import valgrind_tools
-
-# TODO(jbudorick) Remove once telemetry gets switched over.
-import pylib.android_commands
-import pylib.device.device_utils
-
-
-def _GetProcessStartTime(pid):
-  return psutil.Process(pid).create_time
-
-
-class _FileLock(object):
-  """With statement-aware implementation of a file lock.
-
-  File locks are needed for cross-process synchronization when the
-  multiprocessing Python module is used.
-  """
-  def __init__(self, path):
-    self._fd = -1
-    self._path = path
-
-  def __enter__(self):
-    self._fd = os.open(self._path, os.O_RDONLY | os.O_CREAT)
-    if self._fd < 0:
-      raise Exception('Could not open file %s for reading' % self._path)
-    fcntl.flock(self._fd, fcntl.LOCK_EX)
-
-  def __exit__(self, _exception_type, _exception_value, traceback):
-    fcntl.flock(self._fd, fcntl.LOCK_UN)
-    os.close(self._fd)
-
-
-class Forwarder(object):
-  """Thread-safe class to manage port forwards from the device to the host."""
-
-  _DEVICE_FORWARDER_FOLDER = (constants.TEST_EXECUTABLE_DIR +
-                              '/forwarder/')
-  _DEVICE_FORWARDER_PATH = (constants.TEST_EXECUTABLE_DIR +
-                            '/forwarder/device_forwarder')
-  _LOCK_PATH = '/tmp/chrome.forwarder.lock'
-  # Defined in host_forwarder_main.cc
-  _HOST_FORWARDER_LOG = '/tmp/host_forwarder_log'
-
-  _instance = None
-
-  @staticmethod
-  def Map(port_pairs, device, tool=None):
-    """Runs the forwarder.
-
-    Args:
-      port_pairs: A list of tuples (device_port, host_port) to forward. Note
-                 that you can specify 0 as a device_port, in which case a
-                 port will by dynamically assigned on the device. You can
-                 get the number of the assigned port using the
-                 DevicePortForHostPort method.
-      device: A DeviceUtils instance.
-      tool: Tool class to use to get wrapper, if necessary, for executing the
-            forwarder (see valgrind_tools.py).
-
-    Raises:
-      Exception on failure to forward the port.
-    """
-    # TODO(jbudorick) Remove once telemetry gets switched over.
-    if isinstance(device, pylib.android_commands.AndroidCommands):
-      device = pylib.device.device_utils.DeviceUtils(device)
-    if not tool:
-      tool = valgrind_tools.CreateTool(None, device)
-    with _FileLock(Forwarder._LOCK_PATH):
-      instance = Forwarder._GetInstanceLocked(tool)
-      instance._InitDeviceLocked(device, tool)
-
-      device_serial = str(device)
-      redirection_commands = [
-          ['--adb=' + constants.GetAdbPath(),
-           '--serial-id=' + device_serial,
-           '--map', str(device_port), str(host_port)]
-          for device_port, host_port in port_pairs]
-      logging.info('Forwarding using commands: %s', redirection_commands)
-
-      for redirection_command in redirection_commands:
-        try:
-          (exit_code, output) = cmd_helper.GetCmdStatusAndOutput(
-              [instance._host_forwarder_path] + redirection_command)
-        except OSError as e:
-          if e.errno == 2:
-            raise Exception('Unable to start host forwarder. Make sure you have'
-                            ' built host_forwarder.')
-          else: raise
-        if exit_code != 0:
-          Forwarder._KillDeviceLocked(device, tool)
-          raise Exception('%s exited with %d:\n%s' % (
-              instance._host_forwarder_path, exit_code, '\n'.join(output)))
-        tokens = output.split(':')
-        if len(tokens) != 2:
-          raise Exception('Unexpected host forwarder output "%s", '
-                          'expected "device_port:host_port"' % output)
-        device_port = int(tokens[0])
-        host_port = int(tokens[1])
-        serial_with_port = (device_serial, device_port)
-        instance._device_to_host_port_map[serial_with_port] = host_port
-        instance._host_to_device_port_map[host_port] = serial_with_port
-        logging.info('Forwarding device port: %d to host port: %d.',
-                     device_port, host_port)
-
-  @staticmethod
-  def UnmapDevicePort(device_port, device):
-    """Unmaps a previously forwarded device port.
-
-    Args:
-      device: A DeviceUtils instance.
-      device_port: A previously forwarded port (through Map()).
-    """
-    # TODO(jbudorick) Remove once telemetry gets switched over.
-    if isinstance(device, pylib.android_commands.AndroidCommands):
-      device = pylib.device.device_utils.DeviceUtils(device)
-    with _FileLock(Forwarder._LOCK_PATH):
-      Forwarder._UnmapDevicePortLocked(device_port, device)
-
-  @staticmethod
-  def UnmapAllDevicePorts(device):
-    """Unmaps all the previously forwarded ports for the provided device.
-
-    Args:
-      device: A DeviceUtils instance.
-      port_pairs: A list of tuples (device_port, host_port) to unmap.
-    """
-    # TODO(jbudorick) Remove once telemetry gets switched over.
-    if isinstance(device, pylib.android_commands.AndroidCommands):
-      device = pylib.device.device_utils.DeviceUtils(device)
-    with _FileLock(Forwarder._LOCK_PATH):
-      if not Forwarder._instance:
-        return
-      adb_serial = str(device)
-      if adb_serial not in Forwarder._instance._initialized_devices:
-        return
-      port_map = Forwarder._GetInstanceLocked(
-          None)._device_to_host_port_map
-      for (device_serial, device_port) in port_map.keys():
-        if adb_serial == device_serial:
-          Forwarder._UnmapDevicePortLocked(device_port, device)
-      # There are no more ports mapped, kill the device_forwarder.
-      tool = valgrind_tools.CreateTool(None, device)
-      Forwarder._KillDeviceLocked(device, tool)
-
-  @staticmethod
-  def DevicePortForHostPort(host_port):
-    """Returns the device port that corresponds to a given host port."""
-    with _FileLock(Forwarder._LOCK_PATH):
-      (_device_serial, device_port) = Forwarder._GetInstanceLocked(
-          None)._host_to_device_port_map.get(host_port)
-      return device_port
-
-  @staticmethod
-  def RemoveHostLog():
-    if os.path.exists(Forwarder._HOST_FORWARDER_LOG):
-      os.unlink(Forwarder._HOST_FORWARDER_LOG)
-
-  @staticmethod
-  def GetHostLog():
-    if not os.path.exists(Forwarder._HOST_FORWARDER_LOG):
-      return ''
-    with file(Forwarder._HOST_FORWARDER_LOG, 'r') as f:
-      return f.read()
-
-  @staticmethod
-  def _GetInstanceLocked(tool):
-    """Returns the singleton instance.
-
-    Note that the global lock must be acquired before calling this method.
-
-    Args:
-      tool: Tool class to use to get wrapper, if necessary, for executing the
-            forwarder (see valgrind_tools.py).
-    """
-    if not Forwarder._instance:
-      Forwarder._instance = Forwarder(tool)
-    return Forwarder._instance
-
-  def __init__(self, tool):
-    """Constructs a new instance of Forwarder.
-
-    Note that Forwarder is a singleton therefore this constructor should be
-    called only once.
-
-    Args:
-      tool: Tool class to use to get wrapper, if necessary, for executing the
-            forwarder (see valgrind_tools.py).
-    """
-    assert not Forwarder._instance
-    self._tool = tool
-    self._initialized_devices = set()
-    self._device_to_host_port_map = dict()
-    self._host_to_device_port_map = dict()
-    self._host_forwarder_path = os.path.join(
-        constants.GetOutDirectory(), 'host_forwarder')
-    assert os.path.exists(self._host_forwarder_path), 'Please build forwarder2'
-    self._device_forwarder_path_on_host = os.path.join(
-        constants.GetOutDirectory(), 'forwarder_dist')
-    self._InitHostLocked()
-
-  @staticmethod
-  def _UnmapDevicePortLocked(device_port, device):
-    """Internal method used by UnmapDevicePort().
-
-    Note that the global lock must be acquired before calling this method.
-    """
-    instance = Forwarder._GetInstanceLocked(None)
-    serial = str(device)
-    serial_with_port = (serial, device_port)
-    if not serial_with_port in instance._device_to_host_port_map:
-      logging.error('Trying to unmap non-forwarded port %d' % device_port)
-      return
-    redirection_command = ['--adb=' + constants.GetAdbPath(),
-                           '--serial-id=' + serial,
-                           '--unmap', str(device_port)]
-    (exit_code, output) = cmd_helper.GetCmdStatusAndOutput(
-        [instance._host_forwarder_path] + redirection_command)
-    if exit_code != 0:
-      logging.error('%s exited with %d:\n%s' % (
-          instance._host_forwarder_path, exit_code, '\n'.join(output)))
-    host_port = instance._device_to_host_port_map[serial_with_port]
-    del instance._device_to_host_port_map[serial_with_port]
-    del instance._host_to_device_port_map[host_port]
-
-  @staticmethod
-  def _GetPidForLock():
-    """Returns the PID used for host_forwarder initialization.
-
-    The PID of the "sharder" is used to handle multiprocessing. The "sharder"
-    is the initial process that forks that is the parent process.
-    """
-    return os.getpgrp()
-
-  def _InitHostLocked(self):
-    """Initializes the host forwarder daemon.
-
-    Note that the global lock must be acquired before calling this method. This
-    method kills any existing host_forwarder process that could be stale.
-    """
-    # See if the host_forwarder daemon was already initialized by a concurrent
-    # process or thread (in case multi-process sharding is not used).
-    pid_for_lock = Forwarder._GetPidForLock()
-    fd = os.open(Forwarder._LOCK_PATH, os.O_RDWR | os.O_CREAT)
-    with os.fdopen(fd, 'r+') as pid_file:
-      pid_with_start_time = pid_file.readline()
-      if pid_with_start_time:
-        (pid, process_start_time) = pid_with_start_time.split(':')
-        if pid == str(pid_for_lock):
-          if process_start_time == str(_GetProcessStartTime(pid_for_lock)):
-            return
-      self._KillHostLocked()
-      pid_file.seek(0)
-      pid_file.write(
-          '%s:%s' % (pid_for_lock, str(_GetProcessStartTime(pid_for_lock))))
-      pid_file.truncate()
-
-  def _InitDeviceLocked(self, device, tool):
-    """Initializes the device_forwarder daemon for a specific device (once).
-
-    Note that the global lock must be acquired before calling this method. This
-    method kills any existing device_forwarder daemon on the device that could
-    be stale, pushes the latest version of the daemon (to the device) and starts
-    it.
-
-    Args:
-      device: A DeviceUtils instance.
-      tool: Tool class to use to get wrapper, if necessary, for executing the
-            forwarder (see valgrind_tools.py).
-    """
-    device_serial = str(device)
-    if device_serial in self._initialized_devices:
-      return
-    Forwarder._KillDeviceLocked(device, tool)
-    device.PushChangedFiles([(
-        self._device_forwarder_path_on_host,
-        Forwarder._DEVICE_FORWARDER_FOLDER)])
-    cmd = '%s %s' % (tool.GetUtilWrapper(), Forwarder._DEVICE_FORWARDER_PATH)
-    device.RunShellCommand(
-        cmd, env={'LD_LIBRARY_PATH': Forwarder._DEVICE_FORWARDER_FOLDER},
-        check_return=True)
-    self._initialized_devices.add(device_serial)
-
-  def _KillHostLocked(self):
-    """Kills the forwarder process running on the host.
-
-    Note that the global lock must be acquired before calling this method.
-    """
-    logging.info('Killing host_forwarder.')
-    (exit_code, output) = cmd_helper.GetCmdStatusAndOutput(
-        [self._host_forwarder_path, '--kill-server'])
-    if exit_code != 0:
-      (exit_code, output) = cmd_helper.GetCmdStatusAndOutput(
-          ['pkill', '-9', 'host_forwarder'])
-      if exit_code != 0:
-        raise Exception('%s exited with %d:\n%s' % (
-              self._host_forwarder_path, exit_code, '\n'.join(output)))
-
-  @staticmethod
-  def _KillDeviceLocked(device, tool):
-    """Kills the forwarder process running on the device.
-
-    Note that the global lock must be acquired before calling this method.
-
-    Args:
-      device: Instance of DeviceUtils for talking to the device.
-      tool: Wrapper tool (e.g. valgrind) that can be used to execute the device
-            forwarder (see valgrind_tools.py).
-    """
-    logging.info('Killing device_forwarder.')
-    Forwarder._instance._initialized_devices.discard(str(device))
-    if not device.FileExists(Forwarder._DEVICE_FORWARDER_PATH):
-      return
-
-    cmd = '%s %s --kill-server' % (tool.GetUtilWrapper(),
-                                   Forwarder._DEVICE_FORWARDER_PATH)
-    device.RunShellCommand(
-        cmd, env={'LD_LIBRARY_PATH': Forwarder._DEVICE_FORWARDER_FOLDER},
-        check_return=True)
diff --git a/build/android/pylib/gtest/__init__.py b/build/android/pylib/gtest/__init__.py
deleted file mode 100644
index 727e987..0000000
--- a/build/android/pylib/gtest/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
diff --git a/build/android/pylib/gtest/filter/OWNERS b/build/android/pylib/gtest/filter/OWNERS
deleted file mode 100644
index 72e8ffc..0000000
--- a/build/android/pylib/gtest/filter/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-*
diff --git a/build/android/pylib/gtest/filter/base_unittests_disabled b/build/android/pylib/gtest/filter/base_unittests_disabled
deleted file mode 100644
index bf2311d..0000000
--- a/build/android/pylib/gtest/filter/base_unittests_disabled
+++ /dev/null
@@ -1,28 +0,0 @@
-# List of suppressions
-
-# Android will not support StackTrace.
-StackTrace.*
-#
-# Sometimes this is automatically generated by run_tests.py
-VerifyPathControlledByUserTest.Symlinks
-
-# http://crbug.com/138845
-MessagePumpLibeventTest.TestWatchingFromBadThread
-
-StringPrintfTest.StringPrintfMisc
-StringPrintfTest.StringAppendfString
-StringPrintfTest.StringAppendfInt
-StringPrintfTest.StringPrintfBounds
-ProcessUtilTest.GetAppOutputRestrictedSIGPIPE
-# TODO(jrg): Fails on bots.  Works locally.  Figure out why.  2/6/12
-FieldTrialTest.*
-# Flaky?
-ScopedJavaRefTest.RefCounts
-# Death tests are not supported with apks.
-*DeathTest*
-FileTest.MemoryCorruption
-MessagePumpLibeventTest.QuitOutsideOfRun
-ScopedFD.ScopedFDCrashesOnCloseFailure
-
-# http://crbug.com/245043
-StackContainer.BufferAlignment
diff --git a/build/android/pylib/gtest/filter/base_unittests_emulator_additional_disabled b/build/android/pylib/gtest/filter/base_unittests_emulator_additional_disabled
deleted file mode 100644
index 85e8fd6..0000000
--- a/build/android/pylib/gtest/filter/base_unittests_emulator_additional_disabled
+++ /dev/null
@@ -1,10 +0,0 @@
-# Addtional list of suppressions from emulator
-#
-# Automatically generated by run_tests.py
-PathServiceTest.Get
-SharedMemoryTest.OpenClose
-StringPrintfTest.StringAppendfInt
-StringPrintfTest.StringAppendfString
-StringPrintfTest.StringPrintfBounds
-StringPrintfTest.StringPrintfMisc
-VerifyPathControlledByUserTest.Symlinks
diff --git a/build/android/pylib/gtest/filter/blink_heap_unittests_disabled b/build/android/pylib/gtest/filter/blink_heap_unittests_disabled
deleted file mode 100644
index 7a43fb1..0000000
--- a/build/android/pylib/gtest/filter/blink_heap_unittests_disabled
+++ /dev/null
@@ -1,2 +0,0 @@
-# List of suppressions
-
diff --git a/build/android/pylib/gtest/filter/breakpad_unittests_disabled b/build/android/pylib/gtest/filter/breakpad_unittests_disabled
deleted file mode 100644
index cefc64f..0000000
--- a/build/android/pylib/gtest/filter/breakpad_unittests_disabled
+++ /dev/null
@@ -1,9 +0,0 @@
-FileIDStripTest.StripSelf
-# crbug.com/303960
-ExceptionHandlerTest.InstructionPointerMemoryNullPointer
-# crbug.com/171419
-MinidumpWriterTest.MappingInfoContained
-# crbug.com/310088
-MinidumpWriterTest.MinidumpSizeLimit
-# crbug.com/375838
-ElfCoreDumpTest.ValidCoreFile
diff --git a/build/android/pylib/gtest/filter/cc_unittests_disabled b/build/android/pylib/gtest/filter/cc_unittests_disabled
deleted file mode 100644
index b49d2c6..0000000
--- a/build/android/pylib/gtest/filter/cc_unittests_disabled
+++ /dev/null
@@ -1,5 +0,0 @@
-# Death tests are not supported with apks.
-BeginFrameObserverBaseTest.OnBeginFrameImplementation
-BeginFrameSourceBaseTest.ObserverManipulation
-BeginFrameSourceMultiplexerTest.SourcesManipulation
-BeginFrameSourceMultiplexerTest.MinimumIntervalNegativeFails
diff --git a/build/android/pylib/gtest/filter/content_browsertests_disabled b/build/android/pylib/gtest/filter/content_browsertests_disabled
deleted file mode 100644
index dcad240..0000000
--- a/build/android/pylib/gtest/filter/content_browsertests_disabled
+++ /dev/null
@@ -1,62 +0,0 @@
-# List of suppressions
-# Timeouts
-Http/MediaTest.*
-File/MediaTest.*
-MediaTest.*
-DatabaseTest.*
-
-# Crashes
-RenderFrameHostManagerTest.IgnoreRendererDebugURLsWhenCrashed
-
-# Plugins are not supported.
-BrowserPluginThreadedCompositorPixelTest.*
-BrowserPluginHostTest.*
-BrowserPluginTest.*
-PluginTest.*
-
-# http://crbug.com/463740
-CrossPlatformAccessibilityBrowserTest.SelectedEditableTextAccessibility
-
-# http://crbug.com/297230
-DumpAccessibilityTreeTest.AccessibilityAriaLevel
-DumpAccessibilityTreeTest.AccessibilityAriaProgressbar
-DumpAccessibilityTreeTest.AccessibilityListMarkers
-DumpAccessibilityTreeTest.AccessibilityUl
-DumpAccessibilityTreeTest.AccessibilityCanvas
-RendererAccessibilityTest.DetachAccessibilityObject
-DumpAccessibilityTreeTest.AccessibilityDialog
-DumpAccessibilityTreeTest.AccessibilityModalDialogClosed
-DumpAccessibilityTreeTest.AccessibilityModalDialogInIframeOpened
-RendererAccessibilityTest.EventOnObjectNotInTree
-
-# http://crbug.com/187500
-RenderViewImplTest.*
-RendererAccessibilityTest.SendFullAccessibilityTreeOnReload
-RendererAccessibilityTest.HideAccessibilityObject
-RendererAccessibilityTest.ShowAccessibilityObject
-
-# http://crbug.com/215894
-DownloadContentTest.CancelInterruptedDownload
-DownloadContentTest.CancelResumingDownload
-DownloadContentTest.RemoveDownload
-DownloadContentTest.RemoveResumingDownload
-DownloadContentTest.ResumeInterruptedDownload
-DownloadContentTest.ResumeInterruptedDownloadNoRange
-DownloadContentTest.ResumeInterruptedDownloadNoVerifiers
-DownloadContentTest.ResumeInterruptedDownloadBadPrecondition
-DownloadContentTest.ResumeWithDeletedFile
-
-# http://crbug.com/386227
-IndexedDBBrowserTest.VersionChangeCrashResilience
-
-# http://crbug.com/233118
-IndexedDBBrowserTest.NullKeyPathPersistence
-
-# http://crbug.com/342525
-IndexedDBBrowserTestSingleProcess.RenderThreadShutdownTest
-
-# http://crbug.com/338421
-GinBrowserTest.GinAndGarbageCollection
-
-# http://crbug.com/343604
-MSE_ClearKey/EncryptedMediaTest.ConfigChangeVideo/0
diff --git a/build/android/pylib/gtest/filter/content_unittests_disabled b/build/android/pylib/gtest/filter/content_unittests_disabled
deleted file mode 100644
index 925a7d1..0000000
--- a/build/android/pylib/gtest/filter/content_unittests_disabled
+++ /dev/null
@@ -1,13 +0,0 @@
-# List of suppressions
-
-# crbug.com/139095
-RenderWidgetTest.OnMsgPaintAtSize
-# crbug.com/147549
-GamepadProviderTest.PollingAccess
-PepperGamepadHostTest.WaitForReply
-# crbug.com/159234
-WebContentsVideoCaptureDeviceTest.*
-# crbug.com/167045
-ContentViewPopupZoomerTest.testPopupZoomerShowsUp
-# crbug.com/254034
-PageStateSerializationTest.BackwardsCompat_v11
diff --git a/build/android/pylib/gtest/filter/gfx_unittests_disabled b/build/android/pylib/gtest/filter/gfx_unittests_disabled
deleted file mode 100644
index b9aec9e..0000000
--- a/build/android/pylib/gtest/filter/gfx_unittests_disabled
+++ /dev/null
@@ -1,10 +0,0 @@
-CanvasTest.StringSizeEmptyString
-CanvasTest.StringWidth
-FontTest.Ascent
-FontTest.AvgWidths
-FontTest.CapHeight
-FontTest.GetActualFontNameForTesting
-FontTest.Height
-FontTest.LoadArial
-FontTest.LoadArialBold
-TextUtilsTest.GetStringWidth
diff --git a/build/android/pylib/gtest/filter/ipc_tests_disabled b/build/android/pylib/gtest/filter/ipc_tests_disabled
deleted file mode 100644
index e8d0691..0000000
--- a/build/android/pylib/gtest/filter/ipc_tests_disabled
+++ /dev/null
@@ -1,18 +0,0 @@
-# Times out
-IPCSyncChannelTest.ChattyServer
-
-# MultiProcessTest related failures. These tests fail if DCHECK is enabled.
-IPCChannelPosixTest.AdvancedConnected
-IPCChannelPosixTest.ResetState
-IPCChannelPosixTest.MultiConnection
-IPCFuzzingTest.SanityTest
-IPCFuzzingTest.MsgBadPayloadArgs
-IPCFuzzingTest.MsgBadPayloadShort
-IPCSendFdsTest.DescriptorTest
-IPCChannelProxyTest.MessageClassFilters
-IPCChannelProxyTest.GlobalAndMessageClassFilters
-IPCChannelProxyTest.FilterRemoval
-IPCChannelTest.ChannelTest
-IPCChannelTest.ChannelProxyTest
-IPCChannelTest.SendMessageInChannelConnected
-SyncSocketTest.SanityTest
diff --git a/build/android/pylib/gtest/filter/media_unittests_disabled b/build/android/pylib/gtest/filter/media_unittests_disabled
deleted file mode 100644
index ed3b9aa..0000000
--- a/build/android/pylib/gtest/filter/media_unittests_disabled
+++ /dev/null
@@ -1,8 +0,0 @@
-# List of suppressions
-
-# Death tests are not supported on APK
-# http://crbug.com/138855
-CompositeFilterDeathTest.*
-
-# http://crbug.com/138833
-AesDecryptorTest.*
diff --git a/build/android/pylib/gtest/filter/net_unittests_disabled b/build/android/pylib/gtest/filter/net_unittests_disabled
deleted file mode 100644
index 75a1c86..0000000
--- a/build/android/pylib/gtest/filter/net_unittests_disabled
+++ /dev/null
@@ -1,41 +0,0 @@
-# List of suppressions.
-
-PythonUtils.PythonRunTime
-VerifyEndEntity/CertVerifyProcWeakDigestTest.Verify/0
-VerifyEndEntity/CertVerifyProcWeakDigestTest.Verify/1
-VerifyEndEntity/CertVerifyProcWeakDigestTest.Verify/2
-VerifyIncompleteEndEntity/CertVerifyProcWeakDigestTest.Verify/0
-VerifyIncompleteEndEntity/CertVerifyProcWeakDigestTest.Verify/1
-VerifyIncompleteEndEntity/CertVerifyProcWeakDigestTest.Verify/2
-VerifyIncompleteIntermediate/CertVerifyProcWeakDigestTest.Verify/0
-VerifyIncompleteIntermediate/CertVerifyProcWeakDigestTest.Verify/1
-VerifyIncompleteIntermediate/CertVerifyProcWeakDigestTest.Verify/2
-VerifyIntermediate/CertVerifyProcWeakDigestTest.Verify/0
-VerifyIntermediate/CertVerifyProcWeakDigestTest.Verify/1
-VerifyIntermediate/CertVerifyProcWeakDigestTest.Verify/2
-VerifyMixed/CertVerifyProcWeakDigestTest.Verify/0
-VerifyMixed/CertVerifyProcWeakDigestTest.Verify/1
-VerifyMixed/CertVerifyProcWeakDigestTest.Verify/2
-VerifyRoot/CertVerifyProcWeakDigestTest.Verify/0
-VerifyRoot/CertVerifyProcWeakDigestTest.Verify/1
-VerifyRoot/CertVerifyProcWeakDigestTest.Verify/2
-
-# Can't spin up more than one SpawnedTestServer on Android.
-URLRequestTestReferrerPolicy.HTTPToCrossOriginHTTP
-URLRequestTestReferrerPolicy.HTTPSToCrossOriginHTTPS
-URLRequestTestReferrerPolicy.HTTPToHTTPS
-URLRequestTestReferrerPolicy.HTTPSToHTTP
-
-# Fail only on bots.
-HttpCache.RangeGET_Cancel
-HttpCache.RangeGET_Cancel2
-HttpCache.RangeGET_OK
-HttpCache.RangeGET_Previous200
-HttpCache.RangeGET_Revalidate2
-HttpCache.RangeGET_SyncOK
-HttpCache.TypicalGET_ConditionalRequest
-# Death tests are not supported with apks.
-*DeathTest*
-# These are death tests and thus also disabled.
-PrioritizedDispatcherTest.CancelNull
-PrioritizedDispatcherTest.CancelMissing
diff --git a/build/android/pylib/gtest/filter/sync_unit_tests_disabled b/build/android/pylib/gtest/filter/sync_unit_tests_disabled
deleted file mode 100644
index cc4b72d..0000000
--- a/build/android/pylib/gtest/filter/sync_unit_tests_disabled
+++ /dev/null
@@ -1,4 +0,0 @@
-SyncHttpBridgeTest.*
-
-# crbug.com/144422
-OnDiskSyncableDirectory.FailInitialWrite
diff --git a/build/android/pylib/gtest/filter/unit_tests_disabled b/build/android/pylib/gtest/filter/unit_tests_disabled
deleted file mode 100644
index c7851fd..0000000
--- a/build/android/pylib/gtest/filter/unit_tests_disabled
+++ /dev/null
@@ -1,119 +0,0 @@
-# List of suppressions
-
-# The UDP related tests currently do not work on Android because
-# we lack a UDP forwarder tool.
-NetworkStatsTestUDP.*
-
-# Missing test resource of 16MB.
-HistoryProfileTest.TypicalProfileVersion
-
-# crbug.com/139408
-SQLitePersistentCookieStoreTest.TestDontLoadOldSessionCookies
-SQLitePersistentCookieStoreTest.PersistIsPersistent
-
-# crbug.com/139433
-AutofillTableTest.AutofillProfile*
-AutofillTableTest.UpdateAutofillProfile
-
-# crbug.com/139400
-AutofillProfileTest.*
-CreditCardTest.SetInfoExpirationMonth
-
-# crbug.com/139398
-DownloadItemModelTest.InterruptTooltip
-
-# Tests crashing in the APK
-# l10n_util.cc(655)] Check failed: std::string::npos != pos
-DownloadItemModelTest.InterruptStatus
-# l10n_util.cc(655)] Check failed: std::string::npos != pos
-WebsiteSettingsTest.OnSiteDataAccessed
-
-# crbug.com/139423
-ValueStoreFrontendTest.GetExistingData
-
-# crbug.com/139421
-ChromeSelectFilePolicyTest.ExpectAsynchronousListenerCall
-
-# http://crbug.com/139033
-ChromeDownloadManagerDelegateTest.StartDownload_PromptAlways
-
-# Extension support is limited on Android.
-# Some of these can be enabled if we register extension related prefs in
-# browser_prefs.cc
-ExtensionTest.*
-ExtensionAPI.*
-ExtensionFileUtilTest.*
-ExtensionPermissionsTest.*
-ExtensionUnpackerTest.*
-ActiveTabTest.*
-ExtensionAppsPromo.*
-ComponentLoaderTest.*
-ExtensionFromUserScript.*
-ExtensionFromWebApp.*
-ExtensionIconManagerTest.*
-ExtensionServiceTest.*
-ExtensionServiceTestSimple.*
-ExtensionSourcePriorityTest.*
-ExtensionSpecialStoragePolicyTest.*
-ExternalPolicyProviderTest.*
-ExternalProviderImplTest.*
-MenuManagerTest.*
-PageActionControllerTest.*
-PermissionsUpdaterTest.*
-ImageLoaderTest.*
-ImageLoadingTrackerTest.*
-ExtensionSettingsFrontendTest.*
-ExtensionSettingsSyncTest.*
-ExtensionUpdaterTest.*
-UserScriptListenerTest.*
-WebApplicationTest.GetShortcutInfoForTab
-ExtensionActionIconFactoryTest.*
-
-# crbug.com/139411
-AutocompleteProviderTest.*
-HistoryContentsProviderBodyOnlyTest.*
-HistoryContentsProviderTest.*
-HQPOrderingTest.*
-SearchProviderTest.*
-
-ProtocolHandlerRegistryTest.TestOSRegistrationFailure
-
-# crbug.com/139418
-SQLiteServerBoundCertStoreTest.TestUpgradeV1
-SQLiteServerBoundCertStoreTest.TestUpgradeV2
-
-ProfileSyncComponentsFactoryImplTest.*
-PermissionsTest.GetWarningMessages_Plugins
-ImageOperations.ResizeShouldAverageColors
-
-# crbug.com/138275
-PrerenderTest.*
-RenderWidgetTest.OnMsgPaintAtSize
-
-# crbug.com/139643
-VariationsUtilTest.DisableAfterInitialization
-VariationsUtilTest.AssociateGoogleVariationID
-VariationsUtilTest.NoAssociation
-
-# crbug.com/141473
-AutofillManagerTest.UpdatePasswordSyncState
-AutofillManagerTest.UpdatePasswordGenerationState
-
-# crbug.com/144227
-ExtensionIconImageTest.*
-
-# crbug.com/145843
-EntropyProviderTest.UseOneTimeRandomizationSHA1
-EntropyProviderTest.UseOneTimeRandomizationPermuted
-
-# crbug.com/147500
-ManifestTest.RestrictedKeys
-
-# crbug.com/152599
-SyncSearchEngineDataTypeControllerTest.*
-
-# crbug.com/256259
-DiagnosticsModelTest.RunAll
-
-# Death tests are not supported with apks.
-*DeathTest*
diff --git a/build/android/pylib/gtest/filter/webkit_unit_tests_disabled b/build/android/pylib/gtest/filter/webkit_unit_tests_disabled
deleted file mode 100644
index 1ffa325..0000000
--- a/build/android/pylib/gtest/filter/webkit_unit_tests_disabled
+++ /dev/null
@@ -1,25 +0,0 @@
-# List of suppressions
-
-# crbug.com/159935
-WebCompositorInputHandlerImplTest.gestureFlingAnimates
-WebCompositorInputHandlerImplTest.gestureFlingTransferResets
-WebPageSerializerTest.HTMLNodes
-
-# crbug.com/241730
-ScrollAnimatorNoneTest.CurveMathQuartic
-ScrollAnimatorNoneTest.ScrollDownToBumper
-ScrollAnimatorNoneTest.ScrollQuadraticSmoothed
-ScrollAnimatorNoneTest.ScrollTwiceCubic
-ScrollAnimatorNoneTest.VaryingInputsEquivalencyCoastSteep
-WebViewTest.VisitedLinkCrash
-
-# Disabled until blink roll r151682
-DeferredImageDecoderTest.drawScaledIntoSkPicture
-
-# Disabled until blink roll r173540
-DeferredImageDecoderTest.decodeOnOtherThread
-DeferredImageDecoderTest.drawIntoSkPicture
-DeferredImageDecoderTest.drawIntoSkPictureProgressive
-
-# crbug.com/320005
-CoreAnimationCompositorAnimationsTest.ConvertTimingForCompositorIterationCount
diff --git a/build/android/pylib/gtest/gtest_config.py b/build/android/pylib/gtest/gtest_config.py
deleted file mode 100644
index 76e0f50..0000000
--- a/build/android/pylib/gtest/gtest_config.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Configuration file for android gtest suites."""
-
-# Add new suites here before upgrading them to the stable list below.
-EXPERIMENTAL_TEST_SUITES = [
-    'components_browsertests',
-    'content_gl_tests',
-    'heap_profiler_unittests',
-    'devtools_bridge_tests',
-]
-
-TELEMETRY_EXPERIMENTAL_TEST_SUITES = [
-    'telemetry_unittests',
-]
-
-# Do not modify this list without approval of an android owner.
-# This list determines which suites are run by default, both for local
-# testing and on android trybots running on commit-queue.
-STABLE_TEST_SUITES = [
-    'android_webview_unittests',
-    'base_unittests',
-    'breakpad_unittests',
-    'cc_unittests',
-    'components_unittests',
-    'content_browsertests',
-    'content_unittests',
-    'events_unittests',
-    'gl_tests',
-    'gl_unittests',
-    'gpu_unittests',
-    'ipc_tests',
-    'media_unittests',
-    'midi_unittests',
-    'net_unittests',
-    'sandbox_linux_unittests',
-    'skia_unittests',
-    'sql_unittests',
-    'sync_unit_tests',
-    'ui_android_unittests',
-    'ui_base_unittests',
-    'ui_touch_selection_unittests',
-    'unit_tests',
-    'webkit_unit_tests',
-]
-
-# Tests fail in component=shared_library build, which is required for ASan.
-# http://crbug.com/344868
-ASAN_EXCLUDED_TEST_SUITES = [
-    'breakpad_unittests',
-    'sandbox_linux_unittests'
-]
diff --git a/build/android/pylib/gtest/gtest_test_instance.py b/build/android/pylib/gtest/gtest_test_instance.py
deleted file mode 100644
index 3285e0b..0000000
--- a/build/android/pylib/gtest/gtest_test_instance.py
+++ /dev/null
@@ -1,329 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging
-import os
-import re
-import shutil
-import sys
-import tempfile
-
-from pylib import constants
-from pylib.base import base_test_result
-from pylib.base import test_instance
-from pylib.utils import apk_helper
-
-sys.path.append(os.path.join(
-    constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib', 'common'))
-import unittest_util
-
-
-BROWSER_TEST_SUITES = [
-  'components_browsertests',
-  'content_browsertests',
-]
-
-
-_DEFAULT_ISOLATE_FILE_PATHS = {
-    'base_unittests': 'base/base_unittests.isolate',
-    'blink_heap_unittests':
-      'third_party/WebKit/Source/platform/heap/BlinkHeapUnitTests.isolate',
-    'breakpad_unittests': 'breakpad/breakpad_unittests.isolate',
-    'cc_perftests': 'cc/cc_perftests.isolate',
-    'components_browsertests': 'components/components_browsertests.isolate',
-    'components_unittests': 'components/components_unittests.isolate',
-    'content_browsertests': 'content/content_browsertests.isolate',
-    'content_unittests': 'content/content_unittests.isolate',
-    'media_perftests': 'media/media_perftests.isolate',
-    'media_unittests': 'media/media_unittests.isolate',
-    'midi_unittests': 'media/midi/midi_unittests.isolate',
-    'net_unittests': 'net/net_unittests.isolate',
-    'sql_unittests': 'sql/sql_unittests.isolate',
-    'sync_unit_tests': 'sync/sync_unit_tests.isolate',
-    'ui_base_unittests': 'ui/base/ui_base_tests.isolate',
-    'unit_tests': 'chrome/unit_tests.isolate',
-    'webkit_unit_tests':
-      'third_party/WebKit/Source/web/WebKitUnitTests.isolate',
-}
-
-
-# Used for filtering large data deps at a finer grain than what's allowed in
-# isolate files since pushing deps to devices is expensive.
-# Wildcards are allowed.
-_DEPS_EXCLUSION_LIST = [
-    'chrome/test/data/extensions/api_test',
-    'chrome/test/data/extensions/secure_shell',
-    'chrome/test/data/firefox*',
-    'chrome/test/data/gpu',
-    'chrome/test/data/image_decoding',
-    'chrome/test/data/import',
-    'chrome/test/data/page_cycler',
-    'chrome/test/data/perf',
-    'chrome/test/data/pyauto_private',
-    'chrome/test/data/safari_import',
-    'chrome/test/data/scroll',
-    'chrome/test/data/third_party',
-    'third_party/hunspell_dictionaries/*.dic',
-    # crbug.com/258690
-    'webkit/data/bmp_decoder',
-    'webkit/data/ico_decoder',
-]
-
-
-_EXTRA_NATIVE_TEST_ACTIVITY = (
-    'org.chromium.native_test.NativeTestInstrumentationTestRunner.'
-        'NativeTestActivity')
-_EXTRA_SHARD_SIZE_LIMIT =(
-    'org.chromium.native_test.NativeTestInstrumentationTestRunner.'
-        'ShardSizeLimit')
-
-# TODO(jbudorick): Remove these once we're no longer parsing stdout to generate
-# results.
-_RE_TEST_STATUS = re.compile(
-    r'\[ +((?:RUN)|(?:FAILED)|(?:OK)) +\] ?([^ ]+)(?: \((\d+) ms\))?$')
-_RE_TEST_RUN_STATUS = re.compile(
-    r'\[ +(PASSED|RUNNER_FAILED|CRASHED) \] ?[^ ]+')
-
-
-# TODO(jbudorick): Make this a class method of GtestTestInstance once
-# test_package_apk and test_package_exe are gone.
-def ParseGTestListTests(raw_list):
-  """Parses a raw test list as provided by --gtest_list_tests.
-
-  Args:
-    raw_list: The raw test listing with the following format:
-
-    IPCChannelTest.
-      SendMessageInChannelConnected
-    IPCSyncChannelTest.
-      Simple
-      DISABLED_SendWithTimeoutMixedOKAndTimeout
-
-  Returns:
-    A list of all tests. For the above raw listing:
-
-    [IPCChannelTest.SendMessageInChannelConnected, IPCSyncChannelTest.Simple,
-     IPCSyncChannelTest.DISABLED_SendWithTimeoutMixedOKAndTimeout]
-  """
-  ret = []
-  current = ''
-  for test in raw_list:
-    if not test:
-      continue
-    if test[0] != ' ':
-      test_case = test.split()[0]
-      if test_case.endswith('.'):
-        current = test_case
-    elif not 'YOU HAVE' in test:
-      test_name = test.split()[0]
-      ret += [current + test_name]
-  return ret
-
-
-class GtestTestInstance(test_instance.TestInstance):
-
-  def __init__(self, args, isolate_delegate, error_func):
-    super(GtestTestInstance, self).__init__()
-    # TODO(jbudorick): Support multiple test suites.
-    if len(args.suite_name) > 1:
-      raise ValueError('Platform mode currently supports only 1 gtest suite')
-    self._suite = args.suite_name[0]
-
-    self._apk_path = os.path.join(
-        constants.GetOutDirectory(), '%s_apk' % self._suite,
-        '%s-debug.apk' % self._suite)
-    self._exe_path = os.path.join(constants.GetOutDirectory(),
-                                  self._suite)
-    if not os.path.exists(self._apk_path):
-      self._apk_path = None
-      self._activity = None
-      self._package = None
-      self._runner = None
-    else:
-      helper = apk_helper.ApkHelper(self._apk_path)
-      self._activity = helper.GetActivityName()
-      self._package = helper.GetPackageName()
-      self._runner = helper.GetInstrumentationName()
-      self._extras = {
-        _EXTRA_NATIVE_TEST_ACTIVITY: self._activity,
-      }
-      if self._suite in BROWSER_TEST_SUITES:
-        self._extras[_EXTRA_SHARD_SIZE_LIMIT] = 1
-
-    if not os.path.exists(self._exe_path):
-      self._exe_path = None
-    if not self._apk_path and not self._exe_path:
-      error_func('Could not find apk or executable for %s' % self._suite)
-
-    self._data_deps = []
-    if args.test_filter:
-      self._gtest_filter = args.test_filter
-    elif args.test_filter_file:
-      with open(args.test_filter_file, 'r') as f:
-        self._gtest_filter = ':'.join(l.strip() for l in f)
-    else:
-      self._gtest_filter = None
-
-    if not args.isolate_file_path:
-      default_isolate_file_path = _DEFAULT_ISOLATE_FILE_PATHS.get(self._suite)
-      if default_isolate_file_path:
-        args.isolate_file_path = os.path.join(
-            constants.DIR_SOURCE_ROOT, default_isolate_file_path)
-
-    if args.isolate_file_path:
-      self._isolate_abs_path = os.path.abspath(args.isolate_file_path)
-      self._isolate_delegate = isolate_delegate
-      self._isolated_abs_path = os.path.join(
-          constants.GetOutDirectory(), '%s.isolated' % self._suite)
-    else:
-      logging.warning('No isolate file provided. No data deps will be pushed.');
-      self._isolate_delegate = None
-
-    if args.app_data_files:
-      self._app_data_files = args.app_data_files
-      if args.app_data_file_dir:
-        self._app_data_file_dir = args.app_data_file_dir
-      else:
-        self._app_data_file_dir = tempfile.mkdtemp()
-        logging.critical('Saving app files to %s', self._app_data_file_dir)
-    else:
-      self._app_data_files = None
-      self._app_data_file_dir = None
-
-  #override
-  def TestType(self):
-    return 'gtest'
-
-  #override
-  def SetUp(self):
-    """Map data dependencies via isolate."""
-    if self._isolate_delegate:
-      self._isolate_delegate.Remap(
-          self._isolate_abs_path, self._isolated_abs_path)
-      self._isolate_delegate.PurgeExcluded(_DEPS_EXCLUSION_LIST)
-      self._isolate_delegate.MoveOutputDeps()
-      dest_dir = None
-      if self._suite == 'breakpad_unittests':
-        dest_dir = '/data/local/tmp/'
-      self._data_deps.extend([(constants.ISOLATE_DEPS_DIR, dest_dir)])
-
-
-  def GetDataDependencies(self):
-    """Returns the test suite's data dependencies.
-
-    Returns:
-      A list of (host_path, device_path) tuples to push. If device_path is
-      None, the client is responsible for determining where to push the file.
-    """
-    return self._data_deps
-
-  def FilterTests(self, test_list, disabled_prefixes=None):
-    """Filters |test_list| based on prefixes and, if present, a filter string.
-
-    Args:
-      test_list: The list of tests to filter.
-      disabled_prefixes: A list of test prefixes to filter. Defaults to
-        DISABLED_, FLAKY_, FAILS_, PRE_, and MANUAL_
-    Returns:
-      A filtered list of tests to run.
-    """
-    gtest_filter_strings = [
-        self._GenerateDisabledFilterString(disabled_prefixes)]
-    if self._gtest_filter:
-      gtest_filter_strings.append(self._gtest_filter)
-
-    filtered_test_list = test_list
-    for gtest_filter_string in gtest_filter_strings:
-      logging.debug('Filtering tests using: %s', gtest_filter_string)
-      filtered_test_list = unittest_util.FilterTestNames(
-          filtered_test_list, gtest_filter_string)
-    return filtered_test_list
-
-  def _GenerateDisabledFilterString(self, disabled_prefixes):
-    disabled_filter_items = []
-
-    if disabled_prefixes is None:
-      disabled_prefixes = ['DISABLED_', 'FLAKY_', 'FAILS_', 'PRE_', 'MANUAL_']
-    disabled_filter_items += ['%s*' % dp for dp in disabled_prefixes]
-    disabled_filter_items += ['*.%s*' % dp for dp in disabled_prefixes]
-
-    disabled_tests_file_path = os.path.join(
-        constants.DIR_SOURCE_ROOT, 'build', 'android', 'pylib', 'gtest',
-        'filter', '%s_disabled' % self._suite)
-    if disabled_tests_file_path and os.path.exists(disabled_tests_file_path):
-      with open(disabled_tests_file_path) as disabled_tests_file:
-        disabled_filter_items += [
-            '%s' % l for l in (line.strip() for line in disabled_tests_file)
-            if l and not l.startswith('#')]
-
-    return '*-%s' % ':'.join(disabled_filter_items)
-
-  def ParseGTestOutput(self, output):
-    """Parses raw gtest output and returns a list of results.
-
-    Args:
-      output: A list of output lines.
-    Returns:
-      A list of base_test_result.BaseTestResults.
-    """
-    results = []
-    for l in output:
-      matcher = _RE_TEST_STATUS.match(l)
-      if matcher:
-        result_type = None
-        if matcher.group(1) == 'OK':
-          result_type = base_test_result.ResultType.PASS
-        elif matcher.group(1) == 'FAILED':
-          result_type = base_test_result.ResultType.FAIL
-
-        if result_type:
-          test_name = matcher.group(2)
-          duration = matcher.group(3) if matcher.group(3) else 0
-          results.append(base_test_result.BaseTestResult(
-              test_name, result_type, duration))
-      logging.info(l)
-    return results
-
-  #override
-  def TearDown(self):
-    """Clear the mappings created by SetUp."""
-    if self._isolate_delegate:
-      self._isolate_delegate.Clear()
-
-  @property
-  def activity(self):
-    return self._activity
-
-  @property
-  def apk(self):
-    return self._apk_path
-
-  @property
-  def app_file_dir(self):
-    return self._app_data_file_dir
-
-  @property
-  def app_files(self):
-    return self._app_data_files
-
-  @property
-  def exe(self):
-    return self._exe_path
-
-  @property
-  def extras(self):
-    return self._extras
-
-  @property
-  def package(self):
-    return self._package
-
-  @property
-  def runner(self):
-    return self._runner
-
-  @property
-  def suite(self):
-    return self._suite
-
diff --git a/build/android/pylib/gtest/gtest_test_instance_test.py b/build/android/pylib/gtest/gtest_test_instance_test.py
deleted file mode 100755
index c52b235..0000000
--- a/build/android/pylib/gtest/gtest_test_instance_test.py
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import unittest
-
-from pylib.gtest import gtest_test_instance
-
-
-class GtestTestInstanceTests(unittest.TestCase):
-
-  def testParseGTestListTests_simple(self):
-    raw_output = [
-      'TestCaseOne.',
-      '  testOne',
-      '  testTwo',
-      'TestCaseTwo.',
-      '  testThree',
-      '  testFour',
-    ]
-    actual = gtest_test_instance.ParseGTestListTests(raw_output)
-    expected = [
-      'TestCaseOne.testOne',
-      'TestCaseOne.testTwo',
-      'TestCaseTwo.testThree',
-      'TestCaseTwo.testFour',
-    ]
-    self.assertEqual(expected, actual)
-
-  def testParseGTestListTests_typeParameterized_old(self):
-    raw_output = [
-      'TPTestCase/WithTypeParam/0.',
-      '  testOne',
-      '  testTwo',
-    ]
-    actual = gtest_test_instance.ParseGTestListTests(raw_output)
-    expected = [
-      'TPTestCase/WithTypeParam/0.testOne',
-      'TPTestCase/WithTypeParam/0.testTwo',
-    ]
-    self.assertEqual(expected, actual)
-
-  def testParseGTestListTests_typeParameterized_new(self):
-    raw_output = [
-      'TPTestCase/WithTypeParam/0.  # TypeParam = TypeParam0',
-      '  testOne',
-      '  testTwo',
-    ]
-    actual = gtest_test_instance.ParseGTestListTests(raw_output)
-    expected = [
-      'TPTestCase/WithTypeParam/0.testOne',
-      'TPTestCase/WithTypeParam/0.testTwo',
-    ]
-    self.assertEqual(expected, actual)
-
-  def testParseGTestListTests_valueParameterized_old(self):
-    raw_output = [
-      'VPTestCase.',
-      '  testWithValueParam/0',
-      '  testWithValueParam/1',
-    ]
-    actual = gtest_test_instance.ParseGTestListTests(raw_output)
-    expected = [
-      'VPTestCase.testWithValueParam/0',
-      'VPTestCase.testWithValueParam/1',
-    ]
-    self.assertEqual(expected, actual)
-
-  def testParseGTestListTests_valueParameterized_new(self):
-    raw_output = [
-      'VPTestCase.',
-      '  testWithValueParam/0  # GetParam() = 0',
-      '  testWithValueParam/1  # GetParam() = 1',
-    ]
-    actual = gtest_test_instance.ParseGTestListTests(raw_output)
-    expected = [
-      'VPTestCase.testWithValueParam/0',
-      'VPTestCase.testWithValueParam/1',
-    ]
-    self.assertEqual(expected, actual)
-
-
-if __name__ == '__main__':
-  unittest.main(verbosity=2)
-
diff --git a/build/android/pylib/gtest/local_device_gtest_run.py b/build/android/pylib/gtest/local_device_gtest_run.py
deleted file mode 100644
index f1cea4e..0000000
--- a/build/android/pylib/gtest/local_device_gtest_run.py
+++ /dev/null
@@ -1,241 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import itertools
-import logging
-import os
-import posixpath
-
-from pylib import constants
-from pylib import ports
-from pylib.base import test_run
-from pylib.device import device_errors
-from pylib.gtest import gtest_test_instance
-
-from pylib.local import local_test_server_spawner
-from pylib.local.device import local_device_environment
-from pylib.local.device import local_device_test_run
-from pylib.utils import device_temp_file
-
-_COMMAND_LINE_FLAGS_SUPPORTED = True
-
-_EXTRA_COMMAND_LINE_FILE = (
-    'org.chromium.native_test.NativeTestActivity.CommandLineFile')
-_EXTRA_COMMAND_LINE_FLAGS = (
-    'org.chromium.native_test.NativeTestActivity.CommandLineFlags')
-_EXTRA_TEST_LIST = (
-    'org.chromium.native_test.NativeTestInstrumentationTestRunner'
-        '.TestList')
-
-_MAX_SHARD_SIZE = 256
-
-# TODO(jbudorick): Move this up to the test instance if the net test server is
-# handled outside of the APK for the remote_device environment.
-_SUITE_REQUIRES_TEST_SERVER_SPAWNER = [
-  'components_browsertests', 'content_unittests', 'content_browsertests',
-  'net_unittests', 'unit_tests'
-]
-
-# TODO(jbudorick): Move this inside _ApkDelegate once TestPackageApk is gone.
-def PullAppFilesImpl(device, package, files, directory):
-  device_dir = device.GetApplicationDataDirectory(package)
-  host_dir = os.path.join(directory, str(device))
-  for f in files:
-    device_file = posixpath.join(device_dir, f)
-    host_file = os.path.join(host_dir, *f.split(posixpath.sep))
-    host_file_base, ext = os.path.splitext(host_file)
-    for i in itertools.count():
-      host_file = '%s_%d%s' % (host_file_base, i, ext)
-      if not os.path.exists(host_file):
-        break
-    device.PullFile(device_file, host_file)
-
-class _ApkDelegate(object):
-  def __init__(self, test_instance):
-    self._activity = test_instance.activity
-    self._apk = test_instance.apk
-    self._package = test_instance.package
-    self._runner = test_instance.runner
-
-    self._component = '%s/%s' % (self._package, self._runner)
-    self._extras = test_instance.extras
-
-  def Install(self, device):
-    device.Install(self._apk)
-
-  def Run(self, test, device, flags=None, **kwargs):
-    extras = dict(self._extras)
-
-    with device_temp_file.DeviceTempFile(device.adb) as command_line_file:
-      device.WriteFile(command_line_file.name, '_ %s' % flags if flags else '_')
-      extras[_EXTRA_COMMAND_LINE_FILE] = command_line_file.name
-
-      with device_temp_file.DeviceTempFile(device.adb) as test_list_file:
-        if test:
-          device.WriteFile(test_list_file.name, '\n'.join(test))
-          extras[_EXTRA_TEST_LIST] = test_list_file.name
-
-        return device.StartInstrumentation(
-            self._component, extras=extras, raw=False, **kwargs)
-
-  def PullAppFiles(self, device, files, directory):
-    PullAppFilesImpl(device, self._package, files, directory)
-
-  def Clear(self, device):
-    device.ClearApplicationState(self._package)
-
-
-class _ExeDelegate(object):
-  def __init__(self, tr, exe):
-    self._exe_host_path = exe
-    self._exe_file_name = os.path.split(exe)[-1]
-    self._exe_device_path = '%s/%s' % (
-        constants.TEST_EXECUTABLE_DIR, self._exe_file_name)
-    deps_host_path = self._exe_host_path + '_deps'
-    if os.path.exists(deps_host_path):
-      self._deps_host_path = deps_host_path
-      self._deps_device_path = self._exe_device_path + '_deps'
-    else:
-      self._deps_host_path = None
-    self._test_run = tr
-
-  def Install(self, device):
-    # TODO(jbudorick): Look into merging this with normal data deps pushing if
-    # executables become supported on nonlocal environments.
-    host_device_tuples = [(self._exe_host_path, self._exe_device_path)]
-    if self._deps_host_path:
-      host_device_tuples.append((self._deps_host_path, self._deps_device_path))
-    device.PushChangedFiles(host_device_tuples)
-
-  def Run(self, test, device, flags=None, **kwargs):
-    cmd = [
-        self._test_run.GetTool(device).GetTestWrapper(),
-        self._exe_device_path,
-    ]
-    if test:
-      cmd.append('--gtest_filter=%s' % ':'.join(test))
-    if flags:
-      cmd.append(flags)
-    cwd = constants.TEST_EXECUTABLE_DIR
-
-    env = {
-      'LD_LIBRARY_PATH':
-          '%s/%s_deps' % (constants.TEST_EXECUTABLE_DIR, self._exe_file_name),
-    }
-    try:
-      gcov_strip_depth = os.environ['NATIVE_COVERAGE_DEPTH_STRIP']
-      external = device.GetExternalStoragePath()
-      env['GCOV_PREFIX'] = '%s/gcov' % external
-      env['GCOV_PREFIX_STRIP'] = gcov_strip_depth
-    except (device_errors.CommandFailedError, KeyError):
-      pass
-
-    # TODO(jbudorick): Switch to just RunShellCommand once perezju@'s CL
-    # for long shell commands lands.
-    with device_temp_file.DeviceTempFile(device.adb) as script_file:
-      script_contents = ' '.join(cmd)
-      logging.info('script contents: %r' % script_contents)
-      device.WriteFile(script_file.name, script_contents)
-      output = device.RunShellCommand(['sh', script_file.name], cwd=cwd,
-                                      env=env, **kwargs)
-    return output
-
-  def PullAppFiles(self, device, files, directory):
-    pass
-
-  def Clear(self, device):
-    device.KillAll(self._exe_file_name, blocking=True, timeout=30, quiet=True)
-
-
-class LocalDeviceGtestRun(local_device_test_run.LocalDeviceTestRun):
-
-  def __init__(self, env, test_instance):
-    assert isinstance(env, local_device_environment.LocalDeviceEnvironment)
-    assert isinstance(test_instance, gtest_test_instance.GtestTestInstance)
-    super(LocalDeviceGtestRun, self).__init__(env, test_instance)
-
-    if self._test_instance.apk:
-      self._delegate = _ApkDelegate(self._test_instance)
-    elif self._test_instance.exe:
-      self._delegate = _ExeDelegate(self, self._test_instance.exe)
-
-    self._servers = {}
-
-  #override
-  def TestPackage(self):
-    return self._test_instance.suite
-
-  #override
-  def SetUp(self):
-
-    def individual_device_set_up(dev, host_device_tuples):
-      # Install test APK.
-      self._delegate.Install(dev)
-
-      # Push data dependencies.
-      external_storage = dev.GetExternalStoragePath()
-      host_device_tuples = [
-          (h, d if d is not None else external_storage)
-          for h, d in host_device_tuples]
-      dev.PushChangedFiles(host_device_tuples)
-
-      self._servers[str(dev)] = []
-      if self.TestPackage() in _SUITE_REQUIRES_TEST_SERVER_SPAWNER:
-        self._servers[str(dev)].append(
-            local_test_server_spawner.LocalTestServerSpawner(
-                ports.AllocateTestServerPort(), dev, self.GetTool(dev)))
-
-      for s in self._servers[str(dev)]:
-        s.SetUp()
-
-    self._env.parallel_devices.pMap(individual_device_set_up,
-                                    self._test_instance.GetDataDependencies())
-
-  #override
-  def _ShouldShard(self):
-    return True
-
-  #override
-  def _CreateShards(self, tests):
-    device_count = len(self._env.devices)
-    shards = []
-    for i in xrange(0, device_count):
-      unbounded_shard = tests[i::device_count]
-      shards += [unbounded_shard[j:j+_MAX_SHARD_SIZE]
-                 for j in xrange(0, len(unbounded_shard), _MAX_SHARD_SIZE)]
-    return shards
-
-  #override
-  def _GetTests(self):
-    tests = self._delegate.Run(
-        None, self._env.devices[0], flags='--gtest_list_tests')
-    tests = gtest_test_instance.ParseGTestListTests(tests)
-    tests = self._test_instance.FilterTests(tests)
-    return tests
-
-  #override
-  def _RunTest(self, device, test):
-    # Run the test.
-    output = self._delegate.Run(
-        test, device, timeout=900, retries=0)
-    for s in self._servers[str(device)]:
-      s.Reset()
-    if self._test_instance.app_files:
-      self._delegate.PullAppFiles(device, self._test_instance.app_files,
-                                  self._test_instance.app_file_dir)
-    self._delegate.Clear(device)
-
-    # Parse the output.
-    # TODO(jbudorick): Transition test scripts away from parsing stdout.
-    results = self._test_instance.ParseGTestOutput(output)
-    return results
-
-  #override
-  def TearDown(self):
-    def individual_device_tear_down(dev):
-      for s in self._servers[str(dev)]:
-        s.TearDown()
-
-    self._env.parallel_devices.pMap(individual_device_tear_down)
-
diff --git a/build/android/pylib/gtest/setup.py b/build/android/pylib/gtest/setup.py
deleted file mode 100644
index f563ccf..0000000
--- a/build/android/pylib/gtest/setup.py
+++ /dev/null
@@ -1,230 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Generates test runner factory and tests for GTests."""
-# pylint: disable=W0212
-
-import logging
-import os
-import sys
-
-from pylib import constants
-
-from pylib.base import base_setup
-from pylib.base import base_test_result
-from pylib.base import test_dispatcher
-from pylib.device import device_utils
-from pylib.gtest import gtest_test_instance
-from pylib.gtest import test_package_apk
-from pylib.gtest import test_package_exe
-from pylib.gtest import test_runner
-
-sys.path.insert(0,
-                os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib',
-                             'common'))
-import unittest_util # pylint: disable=F0401
-
-
-ISOLATE_FILE_PATHS = gtest_test_instance._DEFAULT_ISOLATE_FILE_PATHS
-
-
-# Used for filtering large data deps at a finer grain than what's allowed in
-# isolate files since pushing deps to devices is expensive.
-# Wildcards are allowed.
-DEPS_EXCLUSION_LIST = [
-    'chrome/test/data/extensions/api_test',
-    'chrome/test/data/extensions/secure_shell',
-    'chrome/test/data/firefox*',
-    'chrome/test/data/gpu',
-    'chrome/test/data/image_decoding',
-    'chrome/test/data/import',
-    'chrome/test/data/page_cycler',
-    'chrome/test/data/perf',
-    'chrome/test/data/pyauto_private',
-    'chrome/test/data/safari_import',
-    'chrome/test/data/scroll',
-    'chrome/test/data/third_party',
-    'third_party/hunspell_dictionaries/*.dic',
-    # crbug.com/258690
-    'webkit/data/bmp_decoder',
-    'webkit/data/ico_decoder',
-]
-
-
-def _GetDisabledTestsFilterFromFile(suite_name):
-  """Returns a gtest filter based on the *_disabled file.
-
-  Args:
-    suite_name: Name of the test suite (e.g. base_unittests).
-
-  Returns:
-    A gtest filter which excludes disabled tests.
-    Example: '*-StackTrace.*:StringPrintfTest.StringPrintfMisc'
-  """
-  filter_file_path = os.path.join(
-      os.path.abspath(os.path.dirname(__file__)),
-      'filter', '%s_disabled' % suite_name)
-
-  if not filter_file_path or not os.path.exists(filter_file_path):
-    logging.info('No filter file found at %s', filter_file_path)
-    return '*'
-
-  filters = [x for x in [x.strip() for x in file(filter_file_path).readlines()]
-             if x and x[0] != '#']
-  disabled_filter = '*-%s' % ':'.join(filters)
-  logging.info('Applying filter "%s" obtained from %s',
-               disabled_filter, filter_file_path)
-  return disabled_filter
-
-
-def _GetTests(test_options, test_package, devices):
-  """Get a list of tests.
-
-  Args:
-    test_options: A GTestOptions object.
-    test_package: A TestPackageApk object.
-    devices: A list of attached devices.
-
-  Returns:
-    A list of all the tests in the test suite.
-  """
-  class TestListResult(base_test_result.BaseTestResult):
-    def __init__(self):
-      super(TestListResult, self).__init__(
-          'gtest_list_tests', base_test_result.ResultType.PASS)
-      self.test_list = []
-
-  def TestListerRunnerFactory(device, _shard_index):
-    class TestListerRunner(test_runner.TestRunner):
-      def RunTest(self, _test):
-        result = TestListResult()
-        self.test_package.Install(self.device)
-        result.test_list = self.test_package.GetAllTests(self.device)
-        results = base_test_result.TestRunResults()
-        results.AddResult(result)
-        return results, None
-    return TestListerRunner(test_options, device, test_package)
-
-  results, _no_retry = test_dispatcher.RunTests(
-      ['gtest_list_tests'], TestListerRunnerFactory, devices)
-  tests = []
-  for r in results.GetAll():
-    tests.extend(r.test_list)
-  return tests
-
-
-def _FilterTestsUsingPrefixes(all_tests, pre=False, manual=False):
-  """Removes tests with disabled prefixes.
-
-  Args:
-    all_tests: List of tests to filter.
-    pre: If True, include tests with PRE_ prefix.
-    manual: If True, include tests with MANUAL_ prefix.
-
-  Returns:
-    List of tests remaining.
-  """
-  filtered_tests = []
-  filter_prefixes = ['DISABLED_', 'FLAKY_', 'FAILS_']
-
-  if not pre:
-    filter_prefixes.append('PRE_')
-
-  if not manual:
-    filter_prefixes.append('MANUAL_')
-
-  for t in all_tests:
-    test_case, test = t.split('.', 1)
-    if not any([test_case.startswith(prefix) or test.startswith(prefix) for
-                prefix in filter_prefixes]):
-      filtered_tests.append(t)
-  return filtered_tests
-
-
-def _FilterDisabledTests(tests, suite_name, has_gtest_filter):
-  """Removes disabled tests from |tests|.
-
-  Applies the following filters in order:
-    1. Remove tests with disabled prefixes.
-    2. Remove tests specified in the *_disabled files in the 'filter' dir
-
-  Args:
-    tests: List of tests.
-    suite_name: Name of the test suite (e.g. base_unittests).
-    has_gtest_filter: Whether a gtest_filter is provided.
-
-  Returns:
-    List of tests remaining.
-  """
-  tests = _FilterTestsUsingPrefixes(
-      tests, has_gtest_filter, has_gtest_filter)
-  tests = unittest_util.FilterTestNames(
-      tests, _GetDisabledTestsFilterFromFile(suite_name))
-
-  return tests
-
-
-def Setup(test_options, devices):
-  """Create the test runner factory and tests.
-
-  Args:
-    test_options: A GTestOptions object.
-    devices: A list of attached devices.
-
-  Returns:
-    A tuple of (TestRunnerFactory, tests).
-  """
-  test_package = test_package_apk.TestPackageApk(test_options.suite_name)
-  if not os.path.exists(test_package.suite_path):
-    exe_test_package = test_package_exe.TestPackageExecutable(
-        test_options.suite_name)
-    if not os.path.exists(exe_test_package.suite_path):
-      raise Exception(
-          'Did not find %s target. Ensure it has been built.\n'
-          '(not found at %s or %s)'
-          % (test_options.suite_name,
-             test_package.suite_path,
-             exe_test_package.suite_path))
-    test_package = exe_test_package
-  logging.warning('Found target %s', test_package.suite_path)
-
-  i = base_setup.GenerateDepsDirUsingIsolate(test_options.suite_name,
-                                         test_options.isolate_file_path,
-                                         ISOLATE_FILE_PATHS,
-                                         DEPS_EXCLUSION_LIST)
-  def push_data_deps_to_device_dir(device):
-    device_dir = (constants.TEST_EXECUTABLE_DIR
-        if test_package.suite_name == 'breakpad_unittests'
-        else device.GetExternalStoragePath())
-    base_setup.PushDataDeps(device, device_dir, test_options)
-  device_utils.DeviceUtils.parallel(devices).pMap(push_data_deps_to_device_dir)
-  if i:
-    i.Clear()
-
-  tests = _GetTests(test_options, test_package, devices)
-
-  # Constructs a new TestRunner with the current options.
-  def TestRunnerFactory(device, _shard_index):
-    return test_runner.TestRunner(
-        test_options,
-        device,
-        test_package)
-
-  if test_options.run_disabled:
-    test_options = test_options._replace(
-        test_arguments=('%s --gtest_also_run_disabled_tests' %
-                        test_options.test_arguments))
-  else:
-    tests = _FilterDisabledTests(tests, test_options.suite_name,
-                                 bool(test_options.gtest_filter))
-  if test_options.gtest_filter:
-    tests = unittest_util.FilterTestNames(tests, test_options.gtest_filter)
-
-  # Coalesce unit tests into a single test per device
-  if test_options.suite_name not in gtest_test_instance.BROWSER_TEST_SUITES:
-    num_devices = len(devices)
-    tests = [':'.join(tests[i::num_devices]) for i in xrange(num_devices)]
-    tests = [t for t in tests if t]
-
-  return (TestRunnerFactory, tests)
diff --git a/build/android/pylib/gtest/test_options.py b/build/android/pylib/gtest/test_options.py
deleted file mode 100644
index 8bc6996..0000000
--- a/build/android/pylib/gtest/test_options.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Defines the GTestOptions named tuple."""
-
-import collections
-
-GTestOptions = collections.namedtuple('GTestOptions', [
-    'tool',
-    'gtest_filter',
-    'run_disabled',
-    'test_arguments',
-    'timeout',
-    'isolate_file_path',
-    'suite_name',
-    'app_data_files',
-    'app_data_file_dir',
-    'delete_stale_data'])
diff --git a/build/android/pylib/gtest/test_package.py b/build/android/pylib/gtest/test_package.py
deleted file mode 100644
index 4042a98..0000000
--- a/build/android/pylib/gtest/test_package.py
+++ /dev/null
@@ -1,76 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Base class representing GTest test packages."""
-# pylint: disable=R0201
-
-
-class TestPackage(object):
-
-  """A helper base class for both APK and stand-alone executables.
-
-  Args:
-    suite_name: Name of the test suite (e.g. base_unittests).
-  """
-  def __init__(self, suite_name):
-    self.suite_name = suite_name
-
-  def ClearApplicationState(self, device):
-    """Clears the application state.
-
-    Args:
-      device: Instance of DeviceUtils.
-    """
-    raise NotImplementedError('Method must be overridden.')
-
-  def CreateCommandLineFileOnDevice(self, device, test_filter, test_arguments):
-    """Creates a test runner script and pushes to the device.
-
-    Args:
-      device: Instance of DeviceUtils.
-      test_filter: A test_filter flag.
-      test_arguments: Additional arguments to pass to the test binary.
-    """
-    raise NotImplementedError('Method must be overridden.')
-
-  def GetAllTests(self, device):
-    """Returns a list of all tests available in the test suite.
-
-    Args:
-      device: Instance of DeviceUtils.
-    """
-    raise NotImplementedError('Method must be overridden.')
-
-  def GetGTestReturnCode(self, _device):
-    return None
-
-  def SpawnTestProcess(self, device):
-    """Spawn the test process.
-
-    Args:
-      device: Instance of DeviceUtils.
-
-    Returns:
-      An instance of pexpect spawn class.
-    """
-    raise NotImplementedError('Method must be overridden.')
-
-  def Install(self, device):
-    """Install the test package to the device.
-
-    Args:
-      device: Instance of DeviceUtils.
-    """
-    raise NotImplementedError('Method must be overridden.')
-
-  def PullAppFiles(self, device, files, directory):
-    """Pull application data from the device.
-
-    Args:
-      device: Instance of DeviceUtils.
-      files: A list of paths relative to the application data directory to
-        retrieve from the device.
-      directory: The host directory to which files should be pulled.
-    """
-    raise NotImplementedError('Method must be overridden.')
diff --git a/build/android/pylib/gtest/test_package_apk.py b/build/android/pylib/gtest/test_package_apk.py
deleted file mode 100644
index a679b03..0000000
--- a/build/android/pylib/gtest/test_package_apk.py
+++ /dev/null
@@ -1,157 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Defines TestPackageApk to help run APK-based native tests."""
-# pylint: disable=W0212
-
-import itertools
-import logging
-import os
-import posixpath
-import shlex
-import sys
-import tempfile
-import time
-
-from pylib import android_commands
-from pylib import constants
-from pylib import pexpect
-from pylib.device import device_errors
-from pylib.device import intent
-from pylib.gtest import gtest_test_instance
-from pylib.gtest import local_device_gtest_run
-from pylib.gtest.test_package import TestPackage
-
-
-class TestPackageApk(TestPackage):
-  """A helper class for running APK-based native tests."""
-
-  def __init__(self, suite_name):
-    """
-    Args:
-      suite_name: Name of the test suite (e.g. base_unittests).
-    """
-    TestPackage.__init__(self, suite_name)
-    self.suite_path = os.path.join(
-        constants.GetOutDirectory(), '%s_apk' % suite_name,
-        '%s-debug.apk' % suite_name)
-    if suite_name == 'content_browsertests':
-      self._package_info = constants.PACKAGE_INFO['content_browsertests']
-    elif suite_name == 'components_browsertests':
-      self._package_info = constants.PACKAGE_INFO['components_browsertests']
-    else:
-      self._package_info = constants.PACKAGE_INFO['gtest']
-
-    if suite_name == 'net_unittests':
-      self._extras = {'RunInSubThread': ''}
-    else:
-      self._extras = []
-
-  def _CreateCommandLineFileOnDevice(self, device, options):
-    device.WriteFile(self._package_info.cmdline_file,
-                     self.suite_name + ' ' + options)
-
-  def _GetFifo(self):
-    # The test.fifo path is determined by:
-    # testing/android/native_test/java/src/org/chromium/native_test/
-    #     NativeTestActivity.java and
-    # testing/android/native_test_launcher.cc
-    return '/data/data/' + self._package_info.package + '/files/test.fifo'
-
-  def _ClearFifo(self, device):
-    device.RunShellCommand('rm -f ' + self._GetFifo())
-
-  def _WatchFifo(self, device, timeout, logfile=None):
-    for i in range(100):
-      if device.FileExists(self._GetFifo()):
-        logging.info('Fifo created. Slept for %f secs' % (i * 0.5))
-        break
-      time.sleep(0.5)
-    else:
-      raise device_errors.DeviceUnreachableError(
-          'Unable to find fifo on device %s ' % self._GetFifo())
-    args = shlex.split(device.old_interface.Adb()._target_arg)
-    args += ['shell', 'cat', self._GetFifo()]
-    return pexpect.spawn('adb', args, timeout=timeout, logfile=logfile)
-
-  def _StartActivity(self, device, force_stop=True):
-    device.StartActivity(
-        intent.Intent(package=self._package_info.package,
-                      activity=self._package_info.activity,
-                      action='android.intent.action.MAIN',
-                      extras=self._extras),
-        # No wait since the runner waits for FIFO creation anyway.
-        blocking=False,
-        force_stop=force_stop)
-
-  #override
-  def ClearApplicationState(self, device):
-    device.ClearApplicationState(self._package_info.package)
-    # Content shell creates a profile on the sdscard which accumulates cache
-    # files over time.
-    if self.suite_name == 'content_browsertests':
-      try:
-        device.RunShellCommand(
-            'rm -r %s/content_shell' % device.GetExternalStoragePath(),
-            timeout=60 * 2)
-      except device_errors.CommandFailedError:
-        # TODO(jbudorick) Handle this exception appropriately once the
-        #                 conversions are done.
-        pass
-    elif self.suite_name == 'components_browsertests':
-      try:
-        device.RunShellCommand(
-            'rm -r %s/components_shell' % device.GetExternalStoragePath(),
-            timeout=60 * 2)
-      except device_errors.CommandFailedError:
-        # TODO(jbudorick) Handle this exception appropriately once the
-        #                 conversions are done.
-        pass
-
-  #override
-  def CreateCommandLineFileOnDevice(self, device, test_filter, test_arguments):
-    self._CreateCommandLineFileOnDevice(
-        device, '--gtest_filter=%s %s' % (test_filter, test_arguments))
-
-  #override
-  def GetAllTests(self, device):
-    self._CreateCommandLineFileOnDevice(device, '--gtest_list_tests')
-    try:
-      self.tool.SetupEnvironment()
-      # Clear and start monitoring logcat.
-      self._ClearFifo(device)
-      self._StartActivity(device)
-      # Wait for native test to complete.
-      p = self._WatchFifo(device, timeout=30 * self.tool.GetTimeoutScale())
-      p.expect('<<ScopedMainEntryLogger')
-      p.close()
-    finally:
-      self.tool.CleanUpEnvironment()
-    # We need to strip the trailing newline.
-    content = [line.rstrip() for line in p.before.splitlines()]
-    return gtest_test_instance.ParseGTestListTests(content)
-
-  #override
-  def SpawnTestProcess(self, device):
-    try:
-      self.tool.SetupEnvironment()
-      self._ClearFifo(device)
-      # Doesn't need to stop an Activity because ClearApplicationState() is
-      # always called before this call and so it is already stopped at this
-      # point.
-      self._StartActivity(device, force_stop=False)
-    finally:
-      self.tool.CleanUpEnvironment()
-    logfile = android_commands.NewLineNormalizer(sys.stdout)
-    return self._WatchFifo(device, timeout=10, logfile=logfile)
-
-  #override
-  def Install(self, device):
-    self.tool.CopyFiles(device)
-    device.Install(self.suite_path)
-
-  #override
-  def PullAppFiles(self, device, files, directory):
-    local_device_gtest_run.PullAppFilesImpl(
-        device, self._package_info.package, files, directory)
diff --git a/build/android/pylib/gtest/test_package_exe.py b/build/android/pylib/gtest/test_package_exe.py
deleted file mode 100644
index 87071b5..0000000
--- a/build/android/pylib/gtest/test_package_exe.py
+++ /dev/null
@@ -1,163 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Defines TestPackageExecutable to help run stand-alone executables."""
-
-import logging
-import os
-import posixpath
-import sys
-import tempfile
-
-from pylib import cmd_helper
-from pylib import constants
-from pylib import pexpect
-from pylib.device import device_errors
-from pylib.gtest import gtest_test_instance
-from pylib.gtest.test_package import TestPackage
-
-
-class TestPackageExecutable(TestPackage):
-  """A helper class for running stand-alone executables."""
-
-  _TEST_RUNNER_RET_VAL_FILE = 'gtest_retval'
-
-  def __init__(self, suite_name):
-    """
-    Args:
-      suite_name: Name of the test suite (e.g. base_unittests).
-    """
-    TestPackage.__init__(self, suite_name)
-    self.suite_path = os.path.join(constants.GetOutDirectory(), suite_name)
-    self._symbols_dir = os.path.join(constants.GetOutDirectory(),
-                                     'lib.target')
-
-  #override
-  def GetGTestReturnCode(self, device):
-    ret = None
-    ret_code = 1  # Assume failure if we can't find it
-    ret_code_file = tempfile.NamedTemporaryFile()
-    try:
-      if not device.PullFile(
-          constants.TEST_EXECUTABLE_DIR + '/' +
-          TestPackageExecutable._TEST_RUNNER_RET_VAL_FILE,
-          ret_code_file.name):
-        logging.critical('Unable to pull gtest ret val file %s',
-                         ret_code_file.name)
-        raise ValueError
-      ret_code = file(ret_code_file.name).read()
-      ret = int(ret_code)
-    except ValueError:
-      logging.critical('Error reading gtest ret val file %s [%s]',
-                       ret_code_file.name, ret_code)
-      ret = 1
-    return ret
-
-  @staticmethod
-  def _AddNativeCoverageExports(device):
-    # export GCOV_PREFIX set the path for native coverage results
-    # export GCOV_PREFIX_STRIP indicates how many initial directory
-    #                          names to strip off the hardwired absolute paths.
-    #                          This value is calculated in buildbot.sh and
-    #                          depends on where the tree is built.
-    # Ex: /usr/local/google/code/chrome will become
-    #     /code/chrome if GCOV_PREFIX_STRIP=3
-    try:
-      depth = os.environ['NATIVE_COVERAGE_DEPTH_STRIP']
-      export_string = ('export GCOV_PREFIX="%s/gcov"\n' %
-                       device.GetExternalStoragePath())
-      export_string += 'export GCOV_PREFIX_STRIP=%s\n' % depth
-      return export_string
-    except KeyError:
-      logging.info('NATIVE_COVERAGE_DEPTH_STRIP is not defined: '
-                   'No native coverage.')
-      return ''
-    except device_errors.CommandFailedError:
-      logging.info('No external storage found: No native coverage.')
-      return ''
-
-  #override
-  def ClearApplicationState(self, device):
-    device.KillAll(self.suite_name, blocking=True, timeout=30, quiet=True)
-
-  #override
-  def CreateCommandLineFileOnDevice(self, device, test_filter, test_arguments):
-    tool_wrapper = self.tool.GetTestWrapper()
-    sh_script_file = tempfile.NamedTemporaryFile()
-    # We need to capture the exit status from the script since adb shell won't
-    # propagate to us.
-    sh_script_file.write(
-        'cd %s\n'
-        '%s'
-        '%s LD_LIBRARY_PATH=%s/%s_deps %s/%s --gtest_filter=%s %s\n'
-        'echo $? > %s' %
-        (constants.TEST_EXECUTABLE_DIR,
-         self._AddNativeCoverageExports(device),
-         tool_wrapper,
-         constants.TEST_EXECUTABLE_DIR,
-         self.suite_name,
-         constants.TEST_EXECUTABLE_DIR,
-         self.suite_name,
-         test_filter, test_arguments,
-         TestPackageExecutable._TEST_RUNNER_RET_VAL_FILE))
-    sh_script_file.flush()
-    cmd_helper.RunCmd(['chmod', '+x', sh_script_file.name])
-    device.PushChangedFiles([(
-        sh_script_file.name,
-        constants.TEST_EXECUTABLE_DIR + '/chrome_test_runner.sh')])
-    logging.info('Conents of the test runner script: ')
-    for line in open(sh_script_file.name).readlines():
-      logging.info('  ' + line.rstrip())
-
-  #override
-  def GetAllTests(self, device):
-    lib_path = posixpath.join(
-        constants.TEST_EXECUTABLE_DIR, '%s_deps' % self.suite_name)
-
-    cmd = []
-    if self.tool.GetTestWrapper():
-      cmd.append(self.tool.GetTestWrapper())
-    cmd.extend([
-        posixpath.join(constants.TEST_EXECUTABLE_DIR, self.suite_name),
-        '--gtest_list_tests'])
-
-    output = device.RunShellCommand(
-        cmd, check_return=True, env={'LD_LIBRARY_PATH': lib_path})
-    return gtest_test_instance.ParseGTestListTests(output)
-
-  #override
-  def SpawnTestProcess(self, device):
-    args = ['adb', '-s', str(device), 'shell', 'sh',
-            constants.TEST_EXECUTABLE_DIR + '/chrome_test_runner.sh']
-    logging.info(args)
-    return pexpect.spawn(args[0], args[1:], logfile=sys.stdout)
-
-  #override
-  def Install(self, device):
-    if self.tool.NeedsDebugInfo():
-      target_name = self.suite_path
-    else:
-      target_name = self.suite_path + '_stripped'
-      if not os.path.isfile(target_name):
-        raise Exception('Did not find %s, build target %s' %
-                        (target_name, self.suite_name + '_stripped'))
-
-      target_mtime = os.stat(target_name).st_mtime
-      source_mtime = os.stat(self.suite_path).st_mtime
-      if target_mtime < source_mtime:
-        raise Exception(
-            'stripped binary (%s, timestamp %d) older than '
-            'source binary (%s, timestamp %d), build target %s' %
-            (target_name, target_mtime, self.suite_path, source_mtime,
-             self.suite_name + '_stripped'))
-
-    test_binary_path = constants.TEST_EXECUTABLE_DIR + '/' + self.suite_name
-    device.PushChangedFiles([(target_name, test_binary_path)])
-    deps_path = self.suite_path + '_deps'
-    if os.path.isdir(deps_path):
-      device.PushChangedFiles([(deps_path, test_binary_path + '_deps')])
-
-  #override
-  def PullAppFiles(self, device, files, directory):
-    pass
diff --git a/build/android/pylib/gtest/test_runner.py b/build/android/pylib/gtest/test_runner.py
deleted file mode 100644
index a48f18a..0000000
--- a/build/android/pylib/gtest/test_runner.py
+++ /dev/null
@@ -1,217 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging
-import os
-import re
-import tempfile
-
-from pylib import pexpect
-from pylib import ports
-from pylib.base import base_test_result
-from pylib.base import base_test_runner
-from pylib.device import device_errors
-from pylib.gtest import gtest_test_instance
-from pylib.local import local_test_server_spawner
-from pylib.perf import perf_control
-
-# Test case statuses.
-RE_RUN = re.compile('\\[ RUN      \\] ?(.*)\r\n')
-RE_FAIL = re.compile('\\[  FAILED  \\] ?(.*?)( \\((\\d+) ms\\))?\r\r\n')
-RE_OK = re.compile('\\[       OK \\] ?(.*?)( \\((\\d+) ms\\))?\r\r\n')
-
-# Test run statuses.
-RE_PASSED = re.compile('\\[  PASSED  \\] ?(.*)\r\n')
-RE_RUNNER_FAIL = re.compile('\\[ RUNNER_FAILED \\] ?(.*)\r\n')
-# Signal handlers are installed before starting tests
-# to output the CRASHED marker when a crash happens.
-RE_CRASH = re.compile('\\[ CRASHED      \\](.*)\r\n')
-
-# Bots that don't output anything for 20 minutes get timed out, so that's our
-# hard cap.
-_INFRA_STDOUT_TIMEOUT = 20 * 60
-
-
-def _TestSuiteRequiresMockTestServer(suite_name):
-  """Returns True if the test suite requires mock test server."""
-  tests_require_net_test_server = ['unit_tests', 'net_unittests',
-                                   'components_browsertests',
-                                   'content_unittests',
-                                   'content_browsertests']
-  return (suite_name in
-          tests_require_net_test_server)
-
-def _TestSuiteRequiresHighPerfMode(suite_name):
-  """Returns True if the test suite requires high performance mode."""
-  return 'perftests' in suite_name
-
-class TestRunner(base_test_runner.BaseTestRunner):
-  def __init__(self, test_options, device, test_package):
-    """Single test suite attached to a single device.
-
-    Args:
-      test_options: A GTestOptions object.
-      device: Device to run the tests.
-      test_package: An instance of TestPackage class.
-    """
-
-    super(TestRunner, self).__init__(device, test_options.tool)
-
-    self.test_package = test_package
-    self.test_package.tool = self.tool
-    self._test_arguments = test_options.test_arguments
-
-    timeout = test_options.timeout
-    if timeout == 0:
-      timeout = 60
-    # On a VM (e.g. chromium buildbots), this timeout is way too small.
-    if os.environ.get('BUILDBOT_SLAVENAME'):
-      timeout = timeout * 2
-
-    self._timeout = min(timeout * self.tool.GetTimeoutScale(),
-                        _INFRA_STDOUT_TIMEOUT)
-    if _TestSuiteRequiresHighPerfMode(self.test_package.suite_name):
-      self._perf_controller = perf_control.PerfControl(self.device)
-
-    if _TestSuiteRequiresMockTestServer(self.test_package.suite_name):
-      self._servers = [
-          local_test_server_spawner.LocalTestServerSpawner(
-              ports.AllocateTestServerPort(), self.device, self.tool)]
-    else:
-      self._servers = []
-
-    if test_options.app_data_files:
-      self._app_data_files = test_options.app_data_files
-      if test_options.app_data_file_dir:
-        self._app_data_file_dir = test_options.app_data_file_dir
-      else:
-        self._app_data_file_dir = tempfile.mkdtemp()
-        logging.critical('Saving app files to %s', self._app_data_file_dir)
-    else:
-      self._app_data_files = None
-      self._app_data_file_dir = None
-
-  #override
-  def InstallTestPackage(self):
-    self.test_package.Install(self.device)
-
-  def _ParseTestOutput(self, p):
-    """Process the test output.
-
-    Args:
-      p: An instance of pexpect spawn class.
-
-    Returns:
-      A TestRunResults object.
-    """
-    results = base_test_result.TestRunResults()
-
-    log = ''
-    try:
-      while True:
-        full_test_name = None
-
-        found = p.expect([RE_RUN, RE_PASSED, RE_RUNNER_FAIL],
-                         timeout=self._timeout)
-        if found == 1:  # RE_PASSED
-          break
-        elif found == 2:  # RE_RUNNER_FAIL
-          break
-        else:  # RE_RUN
-          full_test_name = p.match.group(1).replace('\r', '')
-          found = p.expect([RE_OK, RE_FAIL, RE_CRASH], timeout=self._timeout)
-          log = p.before.replace('\r', '')
-          if found == 0:  # RE_OK
-            if full_test_name == p.match.group(1).replace('\r', ''):
-              duration_ms = int(p.match.group(3)) if p.match.group(3) else 0
-              results.AddResult(base_test_result.BaseTestResult(
-                  full_test_name, base_test_result.ResultType.PASS,
-                  duration=duration_ms, log=log))
-          elif found == 2:  # RE_CRASH
-            results.AddResult(base_test_result.BaseTestResult(
-                full_test_name, base_test_result.ResultType.CRASH,
-                log=log))
-            break
-          else:  # RE_FAIL
-            duration_ms = int(p.match.group(3)) if p.match.group(3) else 0
-            results.AddResult(base_test_result.BaseTestResult(
-                full_test_name, base_test_result.ResultType.FAIL,
-                duration=duration_ms, log=log))
-    except pexpect.EOF:
-      logging.error('Test terminated - EOF')
-      # We're here because either the device went offline, or the test harness
-      # crashed without outputting the CRASHED marker (crbug.com/175538).
-      if not self.device.IsOnline():
-        raise device_errors.DeviceUnreachableError(
-            'Device %s went offline.' % str(self.device))
-      if full_test_name:
-        results.AddResult(base_test_result.BaseTestResult(
-            full_test_name, base_test_result.ResultType.CRASH,
-            log=p.before.replace('\r', '')))
-    except pexpect.TIMEOUT:
-      logging.error('Test terminated after %d second timeout.',
-                    self._timeout)
-      if full_test_name:
-        results.AddResult(base_test_result.BaseTestResult(
-            full_test_name, base_test_result.ResultType.TIMEOUT,
-            log=p.before.replace('\r', '')))
-    finally:
-      p.close()
-
-    ret_code = self.test_package.GetGTestReturnCode(self.device)
-    if ret_code:
-      logging.critical(
-          'gtest exit code: %d\npexpect.before: %s\npexpect.after: %s',
-          ret_code, p.before, p.after)
-
-    return results
-
-  #override
-  def RunTest(self, test):
-    test_results = base_test_result.TestRunResults()
-    if not test:
-      return test_results, None
-
-    try:
-      self.test_package.ClearApplicationState(self.device)
-      self.test_package.CreateCommandLineFileOnDevice(
-          self.device, test, self._test_arguments)
-      test_results = self._ParseTestOutput(
-          self.test_package.SpawnTestProcess(self.device))
-      if self._app_data_files:
-        self.test_package.PullAppFiles(self.device, self._app_data_files,
-                                       self._app_data_file_dir)
-    finally:
-      for s in self._servers:
-        s.Reset()
-    # Calculate unknown test results.
-    all_tests = set(test.split(':'))
-    all_tests_ran = set([t.GetName() for t in test_results.GetAll()])
-    unknown_tests = all_tests - all_tests_ran
-    test_results.AddResults(
-        [base_test_result.BaseTestResult(t, base_test_result.ResultType.UNKNOWN)
-         for t in unknown_tests])
-    retry = ':'.join([t.GetName() for t in test_results.GetNotPass()])
-    return test_results, retry
-
-  #override
-  def SetUp(self):
-    """Sets up necessary test enviroment for the test suite."""
-    super(TestRunner, self).SetUp()
-    for s in self._servers:
-      s.SetUp()
-    if _TestSuiteRequiresHighPerfMode(self.test_package.suite_name):
-      self._perf_controller.SetHighPerfMode()
-    self.tool.SetupEnvironment()
-
-  #override
-  def TearDown(self):
-    """Cleans up the test enviroment for the test suite."""
-    for s in self._servers:
-      s.TearDown()
-    if _TestSuiteRequiresHighPerfMode(self.test_package.suite_name):
-      self._perf_controller.SetDefaultPerfMode()
-    self.test_package.ClearApplicationState(self.device)
-    self.tool.CleanUpEnvironment()
-    super(TestRunner, self).TearDown()
diff --git a/build/android/pylib/host_driven/__init__.py b/build/android/pylib/host_driven/__init__.py
deleted file mode 100644
index 727e987..0000000
--- a/build/android/pylib/host_driven/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
diff --git a/build/android/pylib/host_driven/setup.py b/build/android/pylib/host_driven/setup.py
deleted file mode 100644
index b2ed348..0000000
--- a/build/android/pylib/host_driven/setup.py
+++ /dev/null
@@ -1,200 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Setup for instrumentation host-driven tests."""
-
-import logging
-import os
-import sys
-import types
-
-from pylib.host_driven import test_case
-from pylib.host_driven import test_info_collection
-from pylib.host_driven import test_runner
-
-
-def _GetPythonFiles(root, files):
-  """Returns all files from |files| that end in 'Test.py'.
-
-  Args:
-    root: A directory name with python files.
-    files: A list of file names.
-
-  Returns:
-    A list with all python files that match the testing naming scheme.
-  """
-  return [os.path.join(root, f) for f in files if f.endswith('Test.py')]
-
-
-def _InferImportNameFromFile(python_file):
-  """Given a file, infer the import name for that file.
-
-  Example: /usr/foo/bar/baz.py -> baz.
-
-  Args:
-    python_file: Path to the Python file, ostensibly to import later.
-
-  Returns:
-    The module name for the given file.
-  """
-  return os.path.splitext(os.path.basename(python_file))[0]
-
-
-def _GetTestModules(host_driven_test_root, is_official_build):
-  """Retrieve a list of python modules that match the testing naming scheme.
-
-  Walks the location of host-driven tests, imports them, and provides the list
-  of imported modules to the caller.
-
-  Args:
-    host_driven_test_root: The path to walk, looking for the
-        pythonDrivenTests or host_driven_tests directory
-    is_official_build: Whether to run only those tests marked 'official'
-
-  Returns:
-    A list of python modules under |host_driven_test_root| which match the
-    testing naming scheme. Each module should define one or more classes that
-    derive from HostDrivenTestCase.
-  """
-  # By default run all host-driven tests under pythonDrivenTests or
-  # host_driven_tests.
-  host_driven_test_file_list = []
-  for root, _, files in os.walk(host_driven_test_root):
-    if (root.endswith('host_driven_tests') or
-        root.endswith('pythonDrivenTests') or
-        (is_official_build and (root.endswith('pythonDrivenTests/official') or
-                                root.endswith('host_driven_tests/official')))):
-      host_driven_test_file_list += _GetPythonFiles(root, files)
-  host_driven_test_file_list.sort()
-
-  test_module_list = [_GetModuleFromFile(test_file)
-                      for test_file in host_driven_test_file_list]
-  return test_module_list
-
-
-def _GetModuleFromFile(python_file):
-  """Gets the python module associated with a file by importing it.
-
-  Args:
-    python_file: File to import.
-
-  Returns:
-    The module object.
-  """
-  sys.path.append(os.path.dirname(python_file))
-  import_name = _InferImportNameFromFile(python_file)
-  return __import__(import_name)
-
-
-def _GetTestsFromClass(test_case_class, **kwargs):
-  """Returns one test object for each test method in |test_case_class|.
-
-  Test methods are methods on the class which begin with 'test'.
-
-  Args:
-    test_case_class: Class derived from HostDrivenTestCase which contains zero
-        or more test methods.
-    kwargs: Keyword args to pass into the constructor of test cases.
-
-  Returns:
-    A list of test case objects, each initialized for a particular test method.
-  """
-  test_names = [m for m in dir(test_case_class)
-                if _IsTestMethod(m, test_case_class)]
-  return [test_case_class(name, **kwargs) for name in test_names]
-
-
-def _GetTestsFromModule(test_module, **kwargs):
-  """Gets a list of test objects from |test_module|.
-
-  Args:
-    test_module: Module from which to get the set of test methods.
-    kwargs: Keyword args to pass into the constructor of test cases.
-
-  Returns:
-    A list of test case objects each initialized for a particular test method
-    defined in |test_module|.
-  """
-
-  tests = []
-  for name in dir(test_module):
-    attr = getattr(test_module, name)
-    if _IsTestCaseClass(attr):
-      tests.extend(_GetTestsFromClass(attr, **kwargs))
-  return tests
-
-
-def _IsTestCaseClass(test_class):
-  return (type(test_class) is types.TypeType and
-          issubclass(test_class, test_case.HostDrivenTestCase) and
-          test_class is not test_case.HostDrivenTestCase)
-
-
-def _IsTestMethod(attrname, test_case_class):
-  """Checks whether this is a valid test method.
-
-  Args:
-    attrname: The method name.
-    test_case_class: The test case class.
-
-  Returns:
-    True if test_case_class.'attrname' is callable and it starts with 'test';
-    False otherwise.
-  """
-  attr = getattr(test_case_class, attrname)
-  return callable(attr) and attrname.startswith('test')
-
-
-def _GetAllTests(test_root, is_official_build, **kwargs):
-  """Retrieve a list of host-driven tests defined under |test_root|.
-
-  Args:
-    test_root: Path which contains host-driven test files.
-    is_official_build: Whether this is an official build.
-    kwargs: Keyword args to pass into the constructor of test cases.
-
-  Returns:
-    List of test case objects, one for each available test method.
-  """
-  if not test_root:
-    return []
-  all_tests = []
-  test_module_list = _GetTestModules(test_root, is_official_build)
-  for module in test_module_list:
-    all_tests.extend(_GetTestsFromModule(module, **kwargs))
-  return all_tests
-
-
-def InstrumentationSetup(host_driven_test_root, official_build,
-                         instrumentation_options):
-  """Creates a list of host-driven instrumentation tests and a runner factory.
-
-  Args:
-    host_driven_test_root: Directory where the host-driven tests are.
-    official_build: True if this is an official build.
-    instrumentation_options: An InstrumentationOptions object.
-
-  Returns:
-    A tuple of (TestRunnerFactory, tests).
-  """
-
-  test_collection = test_info_collection.TestInfoCollection()
-  all_tests = _GetAllTests(
-      host_driven_test_root, official_build,
-      instrumentation_options=instrumentation_options)
-  test_collection.AddTests(all_tests)
-
-  available_tests = test_collection.GetAvailableTests(
-      instrumentation_options.annotations,
-      instrumentation_options.exclude_annotations,
-      instrumentation_options.test_filter)
-  logging.debug('All available tests: ' + str(
-      [t.tagged_name for t in available_tests]))
-
-  def TestRunnerFactory(device, shard_index):
-    return test_runner.HostDrivenTestRunner(
-        device, shard_index,
-        instrumentation_options.tool)
-
-  return (TestRunnerFactory, available_tests)
diff --git a/build/android/pylib/host_driven/test_case.py b/build/android/pylib/host_driven/test_case.py
deleted file mode 100644
index 6ff4c5f..0000000
--- a/build/android/pylib/host_driven/test_case.py
+++ /dev/null
@@ -1,189 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Base class for host-driven test cases.
-
-This test case is intended to serve as the base class for any host-driven
-test cases. It is similar to the Python unitttest module in that test cases
-inherit from this class and add methods which will be run as tests.
-
-When a HostDrivenTestCase object is instantiated, its purpose is to run only one
-test method in the derived class. The test runner gives it the name of the test
-method the instance will run. The test runner calls SetUp with the device ID
-which the test method will run against. The test runner runs the test method
-itself, collecting the result, and calls TearDown.
-
-Tests can perform arbitrary Python commands and asserts in test methods. Tests
-that run instrumentation tests can make use of the _RunJavaTestFilters helper
-function to trigger Java tests and convert results into a single host-driven
-test result.
-"""
-
-import logging
-import os
-import time
-
-from pylib import constants
-from pylib import forwarder
-from pylib import valgrind_tools
-from pylib.base import base_test_result
-from pylib.device import device_utils
-from pylib.instrumentation import test_package
-from pylib.instrumentation import test_result
-from pylib.instrumentation import test_runner
-
-# aka the parent of com.google.android
-BASE_ROOT = 'src' + os.sep
-
-
-class HostDrivenTestCase(object):
-  """Base class for host-driven test cases."""
-
-  _HOST_DRIVEN_TAG = 'HostDriven'
-
-  def __init__(self, test_name, instrumentation_options=None):
-    """Create a test case initialized to run |test_name|.
-
-    Args:
-      test_name: The name of the method to run as the test.
-      instrumentation_options: An InstrumentationOptions object.
-    """
-    class_name = self.__class__.__name__
-    self.device = None
-    self.device_id = ''
-    self.has_forwarded_ports = False
-    self.instrumentation_options = instrumentation_options
-    self.ports_to_forward = []
-    self.shard_index = 0
-
-    # Use tagged_name when creating results, so that we can identify host-driven
-    # tests in the overall results.
-    self.test_name = test_name
-    self.qualified_name = '%s.%s' % (class_name, self.test_name)
-    self.tagged_name = '%s_%s' % (self._HOST_DRIVEN_TAG, self.qualified_name)
-
-  # TODO(bulach): make ports_to_forward not optional and move the Forwarder
-  # mapping here.
-  def SetUp(self, device, shard_index, ports_to_forward=None):
-    if not ports_to_forward:
-      ports_to_forward = []
-    self.device = device
-    self.shard_index = shard_index
-    self.device_id = str(self.device)
-    if ports_to_forward:
-      self.ports_to_forward = ports_to_forward
-
-  def TearDown(self):
-    pass
-
-  # TODO(craigdh): Remove GetOutDir once references have been removed
-  # downstream.
-  @staticmethod
-  def GetOutDir():
-    return constants.GetOutDirectory()
-
-  def Run(self):
-    logging.info('Running host-driven test: %s', self.tagged_name)
-    # Get the test method on the derived class and execute it
-    return getattr(self, self.test_name)()
-
-  @staticmethod
-  def __GetHostForwarderLog():
-    return ('-- Begin Full HostForwarder log\n'
-            '%s\n'
-            '--End Full HostForwarder log\n' % forwarder.Forwarder.GetHostLog())
-
-  def __StartForwarder(self):
-    logging.warning('Forwarding %s %s', self.ports_to_forward,
-                    self.has_forwarded_ports)
-    if self.ports_to_forward and not self.has_forwarded_ports:
-      self.has_forwarded_ports = True
-      tool = valgrind_tools.CreateTool(None, self.device)
-      forwarder.Forwarder.Map([(port, port) for port in self.ports_to_forward],
-                              self.device, tool)
-
-  def __RunJavaTest(self, test, test_pkg, additional_flags=None):
-    """Runs a single Java test in a Java TestRunner.
-
-    Args:
-      test: Fully qualified test name (ex. foo.bar.TestClass#testMethod)
-      test_pkg: TestPackage object.
-      additional_flags: A list of additional flags to add to the command line.
-
-    Returns:
-      TestRunResults object with a single test result.
-    """
-    # TODO(bulach): move this to SetUp() stage.
-    self.__StartForwarder()
-
-    java_test_runner = test_runner.TestRunner(
-        self.instrumentation_options, self.device, self.shard_index,
-        test_pkg, additional_flags=additional_flags)
-    try:
-      java_test_runner.SetUp()
-      return java_test_runner.RunTest(test)[0]
-    finally:
-      java_test_runner.TearDown()
-
-  def _RunJavaTestFilters(self, test_filters, additional_flags=None):
-    """Calls a list of tests and stops at the first test failure.
-
-    This method iterates until either it encounters a non-passing test or it
-    exhausts the list of tests. Then it returns the appropriate overall result.
-
-    Test cases may make use of this method internally to assist in running
-    instrumentation tests. This function relies on instrumentation_options
-    being defined.
-
-    Args:
-      test_filters: A list of Java test filters.
-      additional_flags: A list of addition flags to add to the command line.
-
-    Returns:
-      A TestRunResults object containing an overall result for this set of Java
-      tests. If any Java tests do not pass, this is a fail overall.
-    """
-    test_type = base_test_result.ResultType.PASS
-    log = ''
-
-    test_pkg = test_package.TestPackage(
-        self.instrumentation_options.test_apk_path,
-        self.instrumentation_options.test_apk_jar_path,
-        self.instrumentation_options.test_support_apk_path)
-
-    start_ms = int(time.time()) * 1000
-    done = False
-    for test_filter in test_filters:
-      tests = test_pkg.GetAllMatchingTests(None, None, test_filter)
-      # Filters should always result in >= 1 test.
-      if len(tests) == 0:
-        raise Exception('Java test filter "%s" returned no tests.'
-                        % test_filter)
-      for test in tests:
-        # We're only running one test at a time, so this TestRunResults object
-        # will hold only one result.
-        java_result = self.__RunJavaTest(test, test_pkg, additional_flags)
-        assert len(java_result.GetAll()) == 1
-        if not java_result.DidRunPass():
-          result = java_result.GetNotPass().pop()
-          log = result.GetLog()
-          log += self.__GetHostForwarderLog()
-          test_type = result.GetType()
-          done = True
-          break
-      if done:
-        break
-    duration_ms = int(time.time()) * 1000 - start_ms
-
-    overall_result = base_test_result.TestRunResults()
-    overall_result.AddResult(
-        test_result.InstrumentationTestResult(
-            self.tagged_name, test_type, start_ms, duration_ms, log=log))
-    return overall_result
-
-  def __str__(self):
-    return self.tagged_name
-
-  def __repr__(self):
-    return self.tagged_name
diff --git a/build/android/pylib/host_driven/test_info_collection.py b/build/android/pylib/host_driven/test_info_collection.py
deleted file mode 100644
index c65d417..0000000
--- a/build/android/pylib/host_driven/test_info_collection.py
+++ /dev/null
@@ -1,144 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Module containing information about the host-driven tests."""
-
-import logging
-import os
-import sys
-
-from pylib.host_driven import tests_annotations
-
-from pylib import constants
-
-sys.path.insert(0,
-                os.path.join(constants.DIR_SOURCE_ROOT,
-                             'build', 'util', 'lib', 'common'))
-
-import unittest_util # pylint: disable=F0401
-
-class TestInfo(object):
-  """An object containing and representing a test function, plus metadata."""
-
-  def __init__(self, runnable, set_up=None, tear_down=None):
-    # The actual test function/method.
-    self.runnable = runnable
-    # Qualified name of test function/method (e.g. FooModule.testBar).
-    self.qualified_name = self._GetQualifiedName(runnable)
-    # setUp and teardown functions, if any.
-    self.set_up = set_up
-    self.tear_down = tear_down
-
-  @staticmethod
-  def _GetQualifiedName(runnable):
-    """Helper method to infer a runnable's name and module name.
-
-    Many filters and lists presuppose a format of module_name.testMethodName.
-    To make this easy on everyone, we use some reflection magic to infer this
-    name automatically.
-
-    Args:
-      runnable: the test method to get the qualified name for
-
-    Returns:
-      qualified name for this runnable, incl. module name and method name.
-    """
-    runnable_name = runnable.__name__
-    # See also tests_annotations.
-    module_name = os.path.splitext(
-        os.path.basename(runnable.__globals__['__file__']))[0]
-    return '.'.join([module_name, runnable_name])
-
-  def __str__(self):
-    return self.qualified_name
-
-
-class TestInfoCollection(object):
-  """A collection of TestInfo objects which facilitates filtering."""
-
-  def __init__(self):
-    """Initialize a new TestInfoCollection."""
-    # Master list of all valid tests.
-    self.all_tests = []
-
-  def AddTests(self, test_infos):
-    """Adds a set of tests to this collection.
-
-    The user may then retrieve them, optionally according to criteria, via
-    GetAvailableTests().
-
-    Args:
-      test_infos: a list of TestInfos representing test functions/methods.
-    """
-    self.all_tests = test_infos
-
-  def GetAvailableTests(self, annotations, exclude_annotations, name_filter):
-    """Get a collection of TestInfos which match the supplied criteria.
-
-    Args:
-      annotations: List of annotations. Each test in the returned list is
-        annotated with atleast one of these annotations.
-      exclude_annotations: List of annotations. The tests in the returned
-        list are not annotated with any of these annotations.
-      name_filter: name filter which tests must match, if any
-
-    Returns:
-      List of available tests.
-    """
-    available_tests = self.all_tests
-
-    # Filter out tests which match neither the requested annotation, nor the
-    # requested name filter, if any.
-    available_tests = [t for t in available_tests if
-                       self._AnnotationIncludesTest(t, annotations)]
-    if annotations and len(annotations) == 1 and annotations[0] == 'SmallTest':
-      tests_without_annotation = [
-          t for t in self.all_tests if
-          not tests_annotations.AnnotatedFunctions.GetTestAnnotations(
-              t.qualified_name)]
-      test_names = [t.qualified_name for t in tests_without_annotation]
-      logging.warning('The following tests do not contain any annotation. '
-                      'Assuming "SmallTest":\n%s',
-                      '\n'.join(test_names))
-      available_tests += tests_without_annotation
-    if exclude_annotations:
-      excluded_tests = [t for t in available_tests if
-                        self._AnnotationIncludesTest(t, exclude_annotations)]
-      available_tests = list(set(available_tests) - set(excluded_tests))
-
-    if name_filter:
-      available_test_names = unittest_util.FilterTestNames(
-          [t.qualified_name for t in available_tests], name_filter)
-      available_tests = [
-          t for t in available_tests if
-          t.qualified_name in available_test_names]
-    return available_tests
-
-  @staticmethod
-  def _AnnotationIncludesTest(test_info, annotation_filter_list):
-    """Checks whether a given test represented by test_info matches annotation.
-
-    Args:
-      test_info: TestInfo object representing the test
-      annotation_filter_list: list of annotation filters to match (e.g. Smoke)
-
-    Returns:
-      True if no annotation was supplied or the test matches; false otherwise.
-    """
-    if not annotation_filter_list:
-      return True
-    for annotation_filter in annotation_filter_list:
-      filters = annotation_filter.split('=')
-      if len(filters) == 2:
-        key = filters[0]
-        value_list = filters[1].split(',')
-        for value in value_list:
-          if tests_annotations.AnnotatedFunctions.IsAnnotated(
-              key + ':' + value, test_info.qualified_name):
-            return True
-      elif tests_annotations.AnnotatedFunctions.IsAnnotated(
-          annotation_filter, test_info.qualified_name):
-        return True
-    return False
-
diff --git a/build/android/pylib/host_driven/test_runner.py b/build/android/pylib/host_driven/test_runner.py
deleted file mode 100644
index 8620aa1..0000000
--- a/build/android/pylib/host_driven/test_runner.py
+++ /dev/null
@@ -1,133 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Runs host-driven tests on a particular device."""
-
-import logging
-import sys
-import time
-import traceback
-
-from pylib.base import base_test_result
-from pylib.base import base_test_runner
-from pylib.host_driven import test_case
-from pylib.instrumentation import test_result
-
-
-class HostDrivenExceptionTestResult(test_result.InstrumentationTestResult):
-  """Test result corresponding to a python exception in a host-driven test."""
-
-  def __init__(self, test_name, start_date_ms, exc_info):
-    """Constructs a HostDrivenExceptionTestResult object.
-
-    Args:
-      test_name: name of the test which raised an exception.
-      start_date_ms: the starting time for the test.
-      exc_info: exception info, ostensibly from sys.exc_info().
-    """
-    exc_type, exc_value, exc_traceback = exc_info
-    trace_info = ''.join(traceback.format_exception(exc_type, exc_value,
-                                                    exc_traceback))
-    log_msg = 'Exception:\n' + trace_info
-    duration_ms = (int(time.time()) * 1000) - start_date_ms
-
-    super(HostDrivenExceptionTestResult, self).__init__(
-        test_name,
-        base_test_result.ResultType.FAIL,
-        start_date_ms,
-        duration_ms,
-        log=str(exc_type) + ' ' + log_msg)
-
-
-class HostDrivenTestRunner(base_test_runner.BaseTestRunner):
-  """Orchestrates running a set of host-driven tests.
-
-  Any Python exceptions in the tests are caught and translated into a failed
-  result, rather than being re-raised on the main thread.
-  """
-
-  # TODO(jbudorick): Remove cleanup_test_files once it's no longer used.
-  # pylint: disable=unused-argument
-  #override
-  def __init__(self, device, shard_index, tool, cleanup_test_files=None):
-    """Creates a new HostDrivenTestRunner.
-
-    Args:
-      device: Attached android device.
-      shard_index: Shard index.
-      tool: Name of the Valgrind tool.
-      cleanup_test_files: Deprecated.
-    """
-
-    super(HostDrivenTestRunner, self).__init__(device, tool)
-
-    # The shard index affords the ability to create unique port numbers (e.g.
-    # DEFAULT_PORT + shard_index) if the test so wishes.
-    self.shard_index = shard_index
-
-  # pylint: enable=unused-argument
-
-  #override
-  def RunTest(self, test):
-    """Sets up and runs a test case.
-
-    Args:
-      test: An object which is ostensibly a subclass of HostDrivenTestCase.
-
-    Returns:
-      A TestRunResults object which contains the result produced by the test
-      and, in the case of a failure, the test that should be retried.
-    """
-
-    assert isinstance(test, test_case.HostDrivenTestCase)
-
-    start_date_ms = int(time.time()) * 1000
-    exception_raised = False
-
-    try:
-      test.SetUp(self.device, self.shard_index)
-    except Exception:
-      logging.exception(
-          'Caught exception while trying to run SetUp() for test: ' +
-          test.tagged_name)
-      # Tests whose SetUp() method has failed are likely to fail, or at least
-      # yield invalid results.
-      exc_info = sys.exc_info()
-      results = base_test_result.TestRunResults()
-      results.AddResult(HostDrivenExceptionTestResult(
-          test.tagged_name, start_date_ms, exc_info))
-      return results, test
-
-    try:
-      results = test.Run()
-    except Exception:
-      # Setting this lets TearDown() avoid stomping on our stack trace from
-      # Run() should TearDown() also raise an exception.
-      exception_raised = True
-      logging.exception('Caught exception while trying to run test: ' +
-                        test.tagged_name)
-      exc_info = sys.exc_info()
-      results = base_test_result.TestRunResults()
-      results.AddResult(HostDrivenExceptionTestResult(
-          test.tagged_name, start_date_ms, exc_info))
-
-    try:
-      test.TearDown()
-    except Exception:
-      logging.exception(
-          'Caught exception while trying run TearDown() for test: ' +
-          test.tagged_name)
-      if not exception_raised:
-        # Don't stomp the error during the test if TearDown blows up. This is a
-        # trade-off: if the test fails, this will mask any problem with TearDown
-        # until the test is fixed.
-        exc_info = sys.exc_info()
-        results = base_test_result.TestRunResults()
-        results.AddResult(HostDrivenExceptionTestResult(
-            test.tagged_name, start_date_ms, exc_info))
-
-    if not results.DidRunPass():
-      return results, test
-    else:
-      return results, None
diff --git a/build/android/pylib/host_driven/test_server.py b/build/android/pylib/host_driven/test_server.py
deleted file mode 100644
index 0783500..0000000
--- a/build/android/pylib/host_driven/test_server.py
+++ /dev/null
@@ -1,130 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Host driven test server controller.
-
-This class controls the startup and shutdown of a python driven test server that
-runs in a separate process.
-
-The server starts up automatically when the object is created.
-
-After it starts up, it is possible to retreive the hostname it started on
-through accessing the member field |host| and the port name through |port|.
-
-For shutting down the server, call TearDown().
-"""
-
-import logging
-import subprocess
-import os
-import os.path
-import time
-import urllib2
-
-from pylib import constants
-
-# NOTE: when adding or modifying these lines, omit any leading slashes!
-# Otherwise os.path.join() will (correctly) treat them as absolute paths
-# instead of relative paths, and will do nothing.
-_PYTHONPATH_DIRS = [
-    'net/tools/testserver/',
-    'third_party/',
-    'third_party/pyftpdlib/src/',
-    'third_party/pywebsocket/src',
-    'third_party/tlslite/',
-]
-
-# Python files in these directories are generated as part of the build.
-# These dirs are located in out/(Debug|Release) directory.
-# The correct path is determined based on the build type. E.g. out/Debug for
-# debug builds and out/Release for release builds.
-_GENERATED_PYTHONPATH_DIRS = [
-    'pyproto/policy/proto/',
-    'pyproto/sync/protocol/',
-    'pyproto/'
-]
-
-_TEST_SERVER_HOST = '127.0.0.1'
-# Paths for supported test server executables.
-TEST_NET_SERVER_PATH = 'net/tools/testserver/testserver.py'
-TEST_SYNC_SERVER_PATH = 'sync/tools/testserver/sync_testserver.py'
-TEST_POLICY_SERVER_PATH = 'chrome/browser/policy/test/policy_testserver.py'
-# Parameters to check that the server is up and running.
-TEST_SERVER_CHECK_PARAMS = {
-  TEST_NET_SERVER_PATH: {
-      'url_path': '/',
-      'response': 'Default response given for path'
-  },
-  TEST_SYNC_SERVER_PATH: {
-      'url_path': 'chromiumsync/time',
-      'response': '0123456789'
-  },
-  TEST_POLICY_SERVER_PATH: {
-      'url_path': 'test/ping',
-      'response': 'Policy server is up.'
-  },
-}
-
-class TestServer(object):
-  """Sets up a host driven test server on the host machine.
-
-  For shutting down the server, call TearDown().
-  """
-
-  def __init__(self, shard_index, test_server_port, test_server_path,
-               test_server_flags=None):
-    """Sets up a Python driven test server on the host machine.
-
-    Args:
-      shard_index: Index of the current shard.
-      test_server_port: Port to run the test server on. This is multiplexed with
-                        the shard index. To retrieve the real port access the
-                        member variable |port|.
-      test_server_path: The path (relative to the root src dir) of the server
-      test_server_flags: Optional list of additional flags to the test server
-    """
-    self.host = _TEST_SERVER_HOST
-    self.port = test_server_port + shard_index
-
-    src_dir = constants.DIR_SOURCE_ROOT
-    # Make dirs into a list of absolute paths.
-    abs_dirs = [os.path.join(src_dir, d) for d in _PYTHONPATH_DIRS]
-    # Add the generated python files to the path
-    abs_dirs.extend([os.path.join(src_dir, constants.GetOutDirectory(), d)
-                     for d in _GENERATED_PYTHONPATH_DIRS])
-    current_python_path = os.environ.get('PYTHONPATH')
-    extra_python_path = ':'.join(abs_dirs)
-    if current_python_path:
-      python_path = current_python_path + ':' + extra_python_path
-    else:
-      python_path = extra_python_path
-
-    # NOTE: A separate python process is used to simplify getting the right
-    # system path for finding includes.
-    test_server_flags = test_server_flags or []
-    cmd = ['python', os.path.join(src_dir, test_server_path),
-           '--log-to-console',
-           ('--host=%s' % self.host),
-           ('--port=%d' % self.port),
-           '--on-remote-server'] + test_server_flags
-    self._test_server_process = subprocess.Popen(
-          cmd, env={'PYTHONPATH': python_path})
-    test_url = 'http://%s:%d/%s' % (self.host, self.port,
-        TEST_SERVER_CHECK_PARAMS[test_server_path]['url_path'])
-    expected_response = TEST_SERVER_CHECK_PARAMS[test_server_path]['response']
-    retries = 0
-    while retries < 5:
-      try:
-        d = urllib2.urlopen(test_url).read()
-        logging.info('URL %s GOT: %s' % (test_url, d))
-        if d.startswith(expected_response):
-          break
-      except Exception as e:
-        logging.info('URL %s GOT: %s' % (test_url, e))
-      time.sleep(retries * 0.1)
-      retries += 1
-
-  def TearDown(self):
-    self._test_server_process.kill()
-    self._test_server_process.wait()
diff --git a/build/android/pylib/host_driven/tests_annotations.py b/build/android/pylib/host_driven/tests_annotations.py
deleted file mode 100644
index 5331140..0000000
--- a/build/android/pylib/host_driven/tests_annotations.py
+++ /dev/null
@@ -1,94 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Annotations for host-driven tests."""
-# pylint: disable=W0212
-
-import os
-
-
-class AnnotatedFunctions(object):
-  """A container for annotated methods."""
-  _ANNOTATED = {}
-
-  @staticmethod
-  def _AddFunction(annotation, function):
-    """Adds an annotated function to our container.
-
-    Args:
-      annotation: the annotation string.
-      function: the function.
-    Returns:
-      The function passed in.
-    """
-    module_name = os.path.splitext(os.path.basename(
-        function.__globals__['__file__']))[0]
-    qualified_function_name = '.'.join([module_name, function.func_name])
-    function_list = AnnotatedFunctions._ANNOTATED.get(annotation, [])
-    function_list.append(qualified_function_name)
-    AnnotatedFunctions._ANNOTATED[annotation] = function_list
-    return function
-
-  @staticmethod
-  def IsAnnotated(annotation, qualified_function_name):
-    """True if function name (module.function) contains the annotation.
-
-    Args:
-      annotation: the annotation string.
-      qualified_function_name: the qualified function name.
-    Returns:
-      True if module.function contains the annotation.
-    """
-    return qualified_function_name in AnnotatedFunctions._ANNOTATED.get(
-        annotation, [])
-
-  @staticmethod
-  def GetTestAnnotations(qualified_function_name):
-    """Returns a list containing all annotations for the given function.
-
-    Args:
-      qualified_function_name: the qualified function name.
-    Returns:
-      List of all annotations for this function.
-    """
-    return [annotation
-            for annotation, tests in AnnotatedFunctions._ANNOTATED.iteritems()
-            if qualified_function_name in tests]
-
-
-# The following functions are annotations used for the host-driven tests.
-def Smoke(function):
-  return AnnotatedFunctions._AddFunction('Smoke', function)
-
-
-def SmallTest(function):
-  return AnnotatedFunctions._AddFunction('SmallTest', function)
-
-
-def MediumTest(function):
-  return AnnotatedFunctions._AddFunction('MediumTest', function)
-
-
-def LargeTest(function):
-  return AnnotatedFunctions._AddFunction('LargeTest', function)
-
-
-def EnormousTest(function):
-  return AnnotatedFunctions._AddFunction('EnormousTest', function)
-
-
-def FlakyTest(function):
-  return AnnotatedFunctions._AddFunction('FlakyTest', function)
-
-
-def DisabledTest(function):
-  return AnnotatedFunctions._AddFunction('DisabledTest', function)
-
-
-def Feature(feature_list):
-  def _AddFeatures(function):
-    for feature in feature_list:
-      AnnotatedFunctions._AddFunction('Feature:%s' % feature, function)
-    return AnnotatedFunctions._AddFunction('Feature', function)
-  return _AddFeatures
diff --git a/build/android/pylib/instrumentation/__init__.py b/build/android/pylib/instrumentation/__init__.py
deleted file mode 100644
index 727e987..0000000
--- a/build/android/pylib/instrumentation/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
diff --git a/build/android/pylib/instrumentation/instrumentation_parser.py b/build/android/pylib/instrumentation/instrumentation_parser.py
deleted file mode 100644
index 1859f14..0000000
--- a/build/android/pylib/instrumentation/instrumentation_parser.py
+++ /dev/null
@@ -1,96 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging
-import re
-
-# http://developer.android.com/reference/android/test/InstrumentationTestRunner.html
-STATUS_CODE_START = 1
-STATUS_CODE_OK = 0
-STATUS_CODE_ERROR = -1
-STATUS_CODE_FAILURE = -2
-
-# http://developer.android.com/reference/android/app/Activity.html
-RESULT_CODE_OK = -1
-RESULT_CODE_CANCELED = 0
-
-_INSTR_LINE_RE = re.compile('^\s*INSTRUMENTATION_([A-Z_]+): (.*)$')
-
-
-class InstrumentationParser(object):
-
-  def __init__(self, stream):
-    """An incremental parser for the output of Android instrumentation tests.
-
-    Example:
-
-      stream = adb.IterShell('am instrument -r ...')
-      parser = InstrumentationParser(stream)
-
-      for code, bundle in parser.IterStatus():
-        # do something with each instrumentation status
-        print 'status:', code, bundle
-
-      # do something with the final instrumentation result
-      code, bundle = parser.GetResult()
-      print 'result:', code, bundle
-
-    Args:
-      stream: a sequence of lines as produced by the raw output of an
-        instrumentation test (e.g. by |am instrument -r| or |uiautomator|).
-    """
-    self._stream = stream
-    self._code = None
-    self._bundle = None
-
-  def IterStatus(self):
-    """Iterate over statuses as they are produced by the instrumentation test.
-
-    Yields:
-      A tuple (code, bundle) for each instrumentation status found in the
-      output.
-    """
-    def join_bundle_values(bundle):
-      for key in bundle:
-        bundle[key] = '\n'.join(bundle[key])
-      return bundle
-
-    bundle = {'STATUS': {}, 'RESULT': {}}
-    header = None
-    key = None
-    for line in self._stream:
-      m = _INSTR_LINE_RE.match(line)
-      if m:
-        header, value = m.groups()
-        key = None
-        if header in ['STATUS', 'RESULT'] and '=' in value:
-          key, value = value.split('=', 1)
-          bundle[header][key] = [value]
-        elif header == 'STATUS_CODE':
-          yield int(value), join_bundle_values(bundle['STATUS'])
-          bundle['STATUS'] = {}
-        elif header == 'CODE':
-          self._code = int(value)
-        else:
-          logging.warning('Unknown INSTRUMENTATION_%s line: %s', header, value)
-      elif key is not None:
-        bundle[header][key].append(line)
-
-    self._bundle = join_bundle_values(bundle['RESULT'])
-
-  def GetResult(self):
-    """Return the final instrumentation result.
-
-    Returns:
-      A pair (code, bundle) with the final instrumentation result. The |code|
-      may be None if no instrumentation result was found in the output.
-
-    Raises:
-      AssertionError if attempting to get the instrumentation result before
-      exhausting |IterStatus| first.
-    """
-    assert self._bundle is not None, (
-        'The IterStatus generator must be exhausted before reading the final'
-        ' instrumentation result.')
-    return self._code, self._bundle
diff --git a/build/android/pylib/instrumentation/instrumentation_parser_test.py b/build/android/pylib/instrumentation/instrumentation_parser_test.py
deleted file mode 100755
index 092d10f..0000000
--- a/build/android/pylib/instrumentation/instrumentation_parser_test.py
+++ /dev/null
@@ -1,134 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-
-"""Unit tests for instrumentation.InstrumentationParser."""
-
-import unittest
-
-from pylib.instrumentation import instrumentation_parser
-
-
-class InstrumentationParserTest(unittest.TestCase):
-
-  def testInstrumentationParser_nothing(self):
-    parser = instrumentation_parser.InstrumentationParser([''])
-    statuses = list(parser.IterStatus())
-    code, bundle = parser.GetResult()
-    self.assertEqual(None, code)
-    self.assertEqual({}, bundle)
-    self.assertEqual([], statuses)
-
-  def testInstrumentationParser_noMatchingStarts(self):
-    raw_output = [
-      '',
-      'this.is.a.test.package.TestClass:.',
-      'Test result for =.',
-      'Time: 1.234',
-      '',
-      'OK (1 test)',
-    ]
-
-    parser = instrumentation_parser.InstrumentationParser(raw_output)
-    statuses = list(parser.IterStatus())
-    code, bundle = parser.GetResult()
-    self.assertEqual(None, code)
-    self.assertEqual({}, bundle)
-    self.assertEqual([], statuses)
-
-  def testInstrumentationParser_resultAndCode(self):
-    raw_output = [
-      'INSTRUMENTATION_RESULT: shortMsg=foo bar',
-      'INSTRUMENTATION_RESULT: longMsg=a foo',
-      'walked into',
-      'a bar',
-      'INSTRUMENTATION_CODE: -1',
-    ]
-
-    parser = instrumentation_parser.InstrumentationParser(raw_output)
-    statuses = list(parser.IterStatus())
-    code, bundle = parser.GetResult()
-    self.assertEqual(-1, code)
-    self.assertEqual(
-        {'shortMsg': 'foo bar', 'longMsg': 'a foo\nwalked into\na bar'}, bundle)
-    self.assertEqual([], statuses)
-
-  def testInstrumentationParser_oneStatus(self):
-    raw_output = [
-      'INSTRUMENTATION_STATUS: foo=1',
-      'INSTRUMENTATION_STATUS: bar=hello',
-      'INSTRUMENTATION_STATUS: world=false',
-      'INSTRUMENTATION_STATUS: class=this.is.a.test.package.TestClass',
-      'INSTRUMENTATION_STATUS: test=testMethod',
-      'INSTRUMENTATION_STATUS_CODE: 0',
-    ]
-
-    parser = instrumentation_parser.InstrumentationParser(raw_output)
-    statuses = list(parser.IterStatus())
-
-    expected = [
-      (0, {
-        'foo': '1',
-        'bar': 'hello',
-        'world': 'false',
-        'class': 'this.is.a.test.package.TestClass',
-        'test': 'testMethod',
-      })
-    ]
-    self.assertEqual(expected, statuses)
-
-  def testInstrumentationParser_multiStatus(self):
-    raw_output = [
-      'INSTRUMENTATION_STATUS: class=foo',
-      'INSTRUMENTATION_STATUS: test=bar',
-      'INSTRUMENTATION_STATUS_CODE: 1',
-      'INSTRUMENTATION_STATUS: test_skipped=true',
-      'INSTRUMENTATION_STATUS_CODE: 0',
-      'INSTRUMENTATION_STATUS: class=hello',
-      'INSTRUMENTATION_STATUS: test=world',
-      'INSTRUMENTATION_STATUS: stack=',
-      'foo/bar.py (27)',
-      'hello/world.py (42)',
-      'test/file.py (1)',
-      'INSTRUMENTATION_STATUS_CODE: -1',
-    ]
-
-    parser = instrumentation_parser.InstrumentationParser(raw_output)
-    statuses = list(parser.IterStatus())
-
-    expected = [
-      (1, {'class': 'foo', 'test': 'bar',}),
-      (0, {'test_skipped': 'true'}),
-      (-1, {
-        'class': 'hello',
-        'test': 'world',
-        'stack': '\nfoo/bar.py (27)\nhello/world.py (42)\ntest/file.py (1)',
-      }),
-    ]
-    self.assertEqual(expected, statuses)
-
-  def testInstrumentationParser_statusResultAndCode(self):
-    raw_output = [
-      'INSTRUMENTATION_STATUS: class=foo',
-      'INSTRUMENTATION_STATUS: test=bar',
-      'INSTRUMENTATION_STATUS_CODE: 1',
-      'INSTRUMENTATION_RESULT: result=hello',
-      'world',
-      '',
-      '',
-      'INSTRUMENTATION_CODE: 0',
-    ]
-
-    parser = instrumentation_parser.InstrumentationParser(raw_output)
-    statuses = list(parser.IterStatus())
-    code, bundle = parser.GetResult()
-
-    self.assertEqual(0, code)
-    self.assertEqual({'result': 'hello\nworld\n\n'}, bundle)
-    self.assertEqual([(1, {'class': 'foo', 'test': 'bar'})], statuses)
-
-
-if __name__ == '__main__':
-  unittest.main(verbosity=2)
diff --git a/build/android/pylib/instrumentation/instrumentation_test_instance.py b/build/android/pylib/instrumentation/instrumentation_test_instance.py
deleted file mode 100644
index f9957b0..0000000
--- a/build/android/pylib/instrumentation/instrumentation_test_instance.py
+++ /dev/null
@@ -1,525 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging
-import os
-import pickle
-import re
-import sys
-
-from pylib import cmd_helper
-from pylib import constants
-from pylib import flag_changer
-from pylib.base import base_test_result
-from pylib.base import test_instance
-from pylib.instrumentation import test_result
-from pylib.instrumentation import instrumentation_parser
-from pylib.utils import apk_helper
-from pylib.utils import md5sum
-from pylib.utils import proguard
-
-sys.path.append(
-    os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib', 'common'))
-import unittest_util
-
-# Ref: http://developer.android.com/reference/android/app/Activity.html
-_ACTIVITY_RESULT_CANCELED = 0
-_ACTIVITY_RESULT_OK = -1
-
-_DEFAULT_ANNOTATIONS = [
-    'Smoke', 'SmallTest', 'MediumTest', 'LargeTest',
-    'EnormousTest', 'IntegrationTest']
-_EXTRA_ENABLE_HTTP_SERVER = (
-    'org.chromium.chrome.test.ChromeInstrumentationTestRunner.'
-        + 'EnableTestHttpServer')
-_EXTRA_DRIVER_TEST_LIST = (
-    'org.chromium.test.driver.OnDeviceInstrumentationDriver.TestList')
-_EXTRA_DRIVER_TEST_LIST_FILE = (
-    'org.chromium.test.driver.OnDeviceInstrumentationDriver.TestListFile')
-_EXTRA_DRIVER_TARGET_PACKAGE = (
-    'org.chromium.test.driver.OnDeviceInstrumentationDriver.TargetPackage')
-_EXTRA_DRIVER_TARGET_CLASS = (
-    'org.chromium.test.driver.OnDeviceInstrumentationDriver.TargetClass')
-_NATIVE_CRASH_RE = re.compile('native crash', re.IGNORECASE)
-_PICKLE_FORMAT_VERSION = 10
-
-
-# TODO(jbudorick): Make these private class methods of
-# InstrumentationTestInstance once the instrumentation test_runner is
-# deprecated.
-def ParseAmInstrumentRawOutput(raw_output):
-  """Parses the output of an |am instrument -r| call.
-
-  Args:
-    raw_output: the output of an |am instrument -r| call as a list of lines
-  Returns:
-    A 3-tuple containing:
-      - the instrumentation code as an integer
-      - the instrumentation result as a list of lines
-      - the instrumentation statuses received as a list of 2-tuples
-        containing:
-        - the status code as an integer
-        - the bundle dump as a dict mapping string keys to a list of
-          strings, one for each line.
-  """
-  parser = instrumentation_parser.InstrumentationParser(raw_output)
-  statuses = list(parser.IterStatus())
-  code, bundle = parser.GetResult()
-  return (code, bundle, statuses)
-
-
-def GenerateTestResults(
-    result_code, result_bundle, statuses, start_ms, duration_ms):
-  """Generate test results from |statuses|.
-
-  Args:
-    result_code: The overall status code as an integer.
-    result_bundle: The summary bundle dump as a dict.
-    statuses: A list of 2-tuples containing:
-      - the status code as an integer
-      - the bundle dump as a dict mapping string keys to string values
-      Note that this is the same as the third item in the 3-tuple returned by
-      |_ParseAmInstrumentRawOutput|.
-    start_ms: The start time of the test in milliseconds.
-    duration_ms: The duration of the test in milliseconds.
-
-  Returns:
-    A list containing an instance of InstrumentationTestResult for each test
-    parsed.
-  """
-
-  results = []
-
-  current_result = None
-
-  for status_code, bundle in statuses:
-    test_class = bundle.get('class', '')
-    test_method = bundle.get('test', '')
-    if test_class and test_method:
-      test_name = '%s#%s' % (test_class, test_method)
-    else:
-      continue
-
-    if status_code == instrumentation_parser.STATUS_CODE_START:
-      if current_result:
-        results.append(current_result)
-      current_result = test_result.InstrumentationTestResult(
-          test_name, base_test_result.ResultType.UNKNOWN, start_ms, duration_ms)
-    else:
-      if status_code == instrumentation_parser.STATUS_CODE_OK:
-        if bundle.get('test_skipped', '').lower() in ('true', '1', 'yes'):
-          current_result.SetType(base_test_result.ResultType.SKIP)
-        elif current_result.GetType() == base_test_result.ResultType.UNKNOWN:
-          current_result.SetType(base_test_result.ResultType.PASS)
-      else:
-        if status_code not in (instrumentation_parser.STATUS_CODE_ERROR,
-                               instrumentation_parser.STATUS_CODE_FAILURE):
-          logging.error('Unrecognized status code %d. Handling as an error.',
-                        status_code)
-        current_result.SetType(base_test_result.ResultType.FAIL)
-        if 'stack' in bundle:
-          current_result.SetLog(bundle['stack'])
-
-  if current_result:
-    if current_result.GetType() == base_test_result.ResultType.UNKNOWN:
-      crashed = (result_code == _ACTIVITY_RESULT_CANCELED
-                 and any(_NATIVE_CRASH_RE.search(l)
-                         for l in result_bundle.itervalues()))
-      if crashed:
-        current_result.SetType(base_test_result.ResultType.CRASH)
-
-    results.append(current_result)
-
-  return results
-
-
-class InstrumentationTestInstance(test_instance.TestInstance):
-
-  def __init__(self, args, isolate_delegate, error_func):
-    super(InstrumentationTestInstance, self).__init__()
-
-    self._apk_under_test = None
-    self._package_info = None
-    self._suite = None
-    self._test_apk = None
-    self._test_jar = None
-    self._test_package = None
-    self._test_runner = None
-    self._test_support_apk = None
-    self._initializeApkAttributes(args, error_func)
-
-    self._data_deps = None
-    self._isolate_abs_path = None
-    self._isolate_delegate = None
-    self._isolated_abs_path = None
-    self._test_data = None
-    self._initializeDataDependencyAttributes(args, isolate_delegate)
-
-    self._annotations = None
-    self._excluded_annotations = None
-    self._test_filter = None
-    self._initializeTestFilterAttributes(args)
-
-    self._flags = None
-    self._initializeFlagAttributes(args)
-
-    self._driver_apk = None
-    self._driver_package = None
-    self._driver_name = None
-    self._initializeDriverAttributes()
-
-  def _initializeApkAttributes(self, args, error_func):
-    if args.apk_under_test.endswith('.apk'):
-      self._apk_under_test = args.apk_under_test
-    else:
-      self._apk_under_test = os.path.join(
-          constants.GetOutDirectory(), constants.SDK_BUILD_APKS_DIR,
-          '%s.apk' % args.apk_under_test)
-
-    if not os.path.exists(self._apk_under_test):
-      error_func('Unable to find APK under test: %s' % self._apk_under_test)
-
-    if args.test_apk.endswith('.apk'):
-      self._suite = os.path.splitext(os.path.basename(args.test_apk))[0]
-      self._test_apk = args.test_apk
-    else:
-      self._suite = args.test_apk
-      self._test_apk = os.path.join(
-          constants.GetOutDirectory(), constants.SDK_BUILD_APKS_DIR,
-          '%s.apk' % args.test_apk)
-
-    self._test_jar = os.path.join(
-        constants.GetOutDirectory(), constants.SDK_BUILD_TEST_JAVALIB_DIR,
-        '%s.jar' % self._suite)
-    self._test_support_apk = os.path.join(
-        constants.GetOutDirectory(), constants.SDK_BUILD_TEST_JAVALIB_DIR,
-        '%sSupport.apk' % self._suite)
-
-    if not os.path.exists(self._test_apk):
-      error_func('Unable to find test APK: %s' % self._test_apk)
-    if not os.path.exists(self._test_jar):
-      error_func('Unable to find test JAR: %s' % self._test_jar)
-
-    apk = apk_helper.ApkHelper(self.test_apk)
-    self._test_package = apk.GetPackageName()
-    self._test_runner = apk.GetInstrumentationName()
-
-    self._package_info = None
-    for package_info in constants.PACKAGE_INFO.itervalues():
-      if self._test_package == package_info.test_package:
-        self._package_info = package_info
-    if not self._package_info:
-      logging.warning('Unable to find package info for %s', self._test_package)
-
-  def _initializeDataDependencyAttributes(self, args, isolate_delegate):
-    self._data_deps = []
-    if args.isolate_file_path:
-      self._isolate_abs_path = os.path.abspath(args.isolate_file_path)
-      self._isolate_delegate = isolate_delegate
-      self._isolated_abs_path = os.path.join(
-          constants.GetOutDirectory(), '%s.isolated' % self._test_package)
-    else:
-      self._isolate_delegate = None
-
-    # TODO(jbudorick): Deprecate and remove --test-data once data dependencies
-    # are fully converted to isolate.
-    if args.test_data:
-      logging.info('Data dependencies specified via --test-data')
-      self._test_data = args.test_data
-    else:
-      self._test_data = None
-
-    if not self._isolate_delegate and not self._test_data:
-      logging.warning('No data dependencies will be pushed.')
-
-  def _initializeTestFilterAttributes(self, args):
-    self._test_filter = args.test_filter
-
-    def annotation_dict_element(a):
-      a = a.split('=')
-      return (a[0], a[1] if len(a) == 2 else None)
-
-    if args.annotation_str:
-      self._annotations = dict(
-          annotation_dict_element(a)
-          for a in args.annotation_str.split(','))
-    elif not self._test_filter:
-      self._annotations = dict(
-          annotation_dict_element(a)
-          for a in _DEFAULT_ANNOTATIONS)
-    else:
-      self._annotations = {}
-
-    if args.exclude_annotation_str:
-      self._excluded_annotations = dict(
-          annotation_dict_element(a)
-          for a in args.exclude_annotation_str.split(','))
-    else:
-      self._excluded_annotations = {}
-
-  def _initializeFlagAttributes(self, args):
-    self._flags = ['--disable-fre', '--enable-test-intents']
-    # TODO(jbudorick): Transition "--device-flags" to "--device-flags-file"
-    if hasattr(args, 'device_flags') and args.device_flags:
-      with open(args.device_flags) as device_flags_file:
-        stripped_lines = (l.strip() for l in device_flags_file)
-        self._flags.extend([flag for flag in stripped_lines if flag])
-    if hasattr(args, 'device_flags_file') and args.device_flags_file:
-      with open(args.device_flags_file) as device_flags_file:
-        stripped_lines = (l.strip() for l in device_flags_file)
-        self._flags.extend([flag for flag in stripped_lines if flag])
-
-  def _initializeDriverAttributes(self):
-    self._driver_apk = os.path.join(
-        constants.GetOutDirectory(), constants.SDK_BUILD_APKS_DIR,
-        'OnDeviceInstrumentationDriver.apk')
-    if os.path.exists(self._driver_apk):
-      driver_apk = apk_helper.ApkHelper(self._driver_apk)
-      self._driver_package = driver_apk.GetPackageName()
-      self._driver_name = driver_apk.GetInstrumentationName()
-    else:
-      self._driver_apk = None
-
-  @property
-  def apk_under_test(self):
-    return self._apk_under_test
-
-  @property
-  def flags(self):
-    return self._flags
-
-  @property
-  def driver_apk(self):
-    return self._driver_apk
-
-  @property
-  def driver_package(self):
-    return self._driver_package
-
-  @property
-  def driver_name(self):
-    return self._driver_name
-
-  @property
-  def package_info(self):
-    return self._package_info
-
-  @property
-  def suite(self):
-    return self._suite
-
-  @property
-  def test_apk(self):
-    return self._test_apk
-
-  @property
-  def test_jar(self):
-    return self._test_jar
-
-  @property
-  def test_support_apk(self):
-    return self._test_support_apk
-
-  @property
-  def test_package(self):
-    return self._test_package
-
-  @property
-  def test_runner(self):
-    return self._test_runner
-
-  #override
-  def TestType(self):
-    return 'instrumentation'
-
-  #override
-  def SetUp(self):
-    if self._isolate_delegate:
-      self._isolate_delegate.Remap(
-          self._isolate_abs_path, self._isolated_abs_path)
-      self._isolate_delegate.MoveOutputDeps()
-      self._data_deps.extend([(constants.ISOLATE_DEPS_DIR, None)])
-
-    # TODO(jbudorick): Convert existing tests that depend on the --test-data
-    # mechanism to isolate, then remove this.
-    if self._test_data:
-      for t in self._test_data:
-        device_rel_path, host_rel_path = t.split(':')
-        host_abs_path = os.path.join(constants.DIR_SOURCE_ROOT, host_rel_path)
-        self._data_deps.extend(
-            [(host_abs_path,
-              [None, 'chrome', 'test', 'data', device_rel_path])])
-
-  def GetDataDependencies(self):
-    return self._data_deps
-
-  def GetTests(self):
-    pickle_path = '%s-proguard.pickle' % self.test_jar
-    try:
-      tests = self._GetTestsFromPickle(pickle_path, self.test_jar)
-    except self.ProguardPickleException as e:
-      logging.info('Getting tests from JAR via proguard. (%s)' % str(e))
-      tests = self._GetTestsFromProguard(self.test_jar)
-      self._SaveTestsToPickle(pickle_path, self.test_jar, tests)
-    return self._InflateTests(self._FilterTests(tests))
-
-  class ProguardPickleException(Exception):
-    pass
-
-  def _GetTestsFromPickle(self, pickle_path, jar_path):
-    if not os.path.exists(pickle_path):
-      raise self.ProguardPickleException('%s does not exist.' % pickle_path)
-    if os.path.getmtime(pickle_path) <= os.path.getmtime(jar_path):
-      raise self.ProguardPickleException(
-          '%s newer than %s.' % (jar_path, pickle_path))
-
-    with open(pickle_path, 'r') as pickle_file:
-      pickle_data = pickle.loads(pickle_file.read())
-    jar_md5 = md5sum.CalculateHostMd5Sums(jar_path)[jar_path]
-
-    try:
-      if pickle_data['VERSION'] != _PICKLE_FORMAT_VERSION:
-        raise self.ProguardPickleException('PICKLE_FORMAT_VERSION has changed.')
-      if pickle_data['JAR_MD5SUM'] != jar_md5:
-        raise self.ProguardPickleException('JAR file MD5 sum differs.')
-      return pickle_data['TEST_METHODS']
-    except TypeError as e:
-      logging.error(pickle_data)
-      raise self.ProguardPickleException(str(e))
-
-  def _GetTestsFromProguard(self, jar_path):
-    p = proguard.Dump(jar_path)
-
-    def is_test_class(c):
-      return c['class'].endswith('Test')
-
-    def is_test_method(m):
-      return m['method'].startswith('test')
-
-    class_lookup = dict((c['class'], c) for c in p['classes'])
-    def recursive_get_class_annotations(c):
-      s = c['superclass']
-      if s in class_lookup:
-        a = recursive_get_class_annotations(class_lookup[s])
-      else:
-        a = {}
-      a.update(c['annotations'])
-      return a
-
-    def stripped_test_class(c):
-      return {
-        'class': c['class'],
-        'annotations': recursive_get_class_annotations(c),
-        'methods': [m for m in c['methods'] if is_test_method(m)],
-      }
-
-    return [stripped_test_class(c) for c in p['classes']
-            if is_test_class(c)]
-
-  def _SaveTestsToPickle(self, pickle_path, jar_path, tests):
-    jar_md5 = md5sum.CalculateHostMd5Sums(jar_path)[jar_path]
-    pickle_data = {
-      'VERSION': _PICKLE_FORMAT_VERSION,
-      'JAR_MD5SUM': jar_md5,
-      'TEST_METHODS': tests,
-    }
-    with open(pickle_path, 'w') as pickle_file:
-      pickle.dump(pickle_data, pickle_file)
-
-  def _FilterTests(self, tests):
-
-    def gtest_filter(c, m):
-      t = ['%s.%s' % (c['class'].split('.')[-1], m['method'])]
-      return (not self._test_filter
-              or unittest_util.FilterTestNames(t, self._test_filter))
-
-    def annotation_filter(all_annotations):
-      if not self._annotations:
-        return True
-      return any_annotation_matches(self._annotations, all_annotations)
-
-    def excluded_annotation_filter(all_annotations):
-      if not self._excluded_annotations:
-        return True
-      return not any_annotation_matches(self._excluded_annotations,
-                                        all_annotations)
-
-    def any_annotation_matches(annotations, all_annotations):
-      return any(
-          ak in all_annotations and (av is None or av == all_annotations[ak])
-          for ak, av in annotations.iteritems())
-
-    filtered_classes = []
-    for c in tests:
-      filtered_methods = []
-      for m in c['methods']:
-        # Gtest filtering
-        if not gtest_filter(c, m):
-          continue
-
-        all_annotations = dict(c['annotations'])
-        all_annotations.update(m['annotations'])
-        if (not annotation_filter(all_annotations)
-            or not excluded_annotation_filter(all_annotations)):
-          continue
-
-        filtered_methods.append(m)
-
-      if filtered_methods:
-        filtered_class = dict(c)
-        filtered_class['methods'] = filtered_methods
-        filtered_classes.append(filtered_class)
-
-    return filtered_classes
-
-  def _InflateTests(self, tests):
-    inflated_tests = []
-    for c in tests:
-      for m in c['methods']:
-        a = dict(c['annotations'])
-        a.update(m['annotations'])
-        inflated_tests.append({
-            'class': c['class'],
-            'method': m['method'],
-            'annotations': a,
-        })
-    return inflated_tests
-
-  @staticmethod
-  def GetHttpServerEnvironmentVars():
-    return {
-      _EXTRA_ENABLE_HTTP_SERVER: None,
-    }
-
-  def GetDriverEnvironmentVars(
-      self, test_list=None, test_list_file_path=None):
-    env = {
-      _EXTRA_DRIVER_TARGET_PACKAGE: self.test_package,
-      _EXTRA_DRIVER_TARGET_CLASS: self.test_runner,
-    }
-
-    if test_list:
-      env[_EXTRA_DRIVER_TEST_LIST] = ','.join(test_list)
-
-    if test_list_file_path:
-      env[_EXTRA_DRIVER_TEST_LIST_FILE] = (
-          os.path.basename(test_list_file_path))
-
-    return env
-
-  @staticmethod
-  def ParseAmInstrumentRawOutput(raw_output):
-    return ParseAmInstrumentRawOutput(raw_output)
-
-  @staticmethod
-  def GenerateTestResults(
-      result_code, result_bundle, statuses, start_ms, duration_ms):
-    return GenerateTestResults(result_code, result_bundle, statuses,
-                               start_ms, duration_ms)
-
-  #override
-  def TearDown(self):
-    if self._isolate_delegate:
-      self._isolate_delegate.Clear()
-
diff --git a/build/android/pylib/instrumentation/instrumentation_test_instance_test.py b/build/android/pylib/instrumentation/instrumentation_test_instance_test.py
deleted file mode 100755
index 752e4d3..0000000
--- a/build/android/pylib/instrumentation/instrumentation_test_instance_test.py
+++ /dev/null
@@ -1,109 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-
-"""Unit tests for instrumentation.TestRunner."""
-
-# pylint: disable=W0212
-
-import os
-import sys
-import unittest
-
-from pylib import constants
-from pylib.base import base_test_result
-from pylib.instrumentation import instrumentation_test_instance
-
-sys.path.append(os.path.join(
-    constants.DIR_SOURCE_ROOT, 'third_party', 'pymock'))
-import mock  # pylint: disable=F0401
-
-
-class InstrumentationTestInstanceTest(unittest.TestCase):
-
-  def setUp(self):
-    options = mock.Mock()
-    options.tool = ''
-
-  def testGenerateTestResults_noStatus(self):
-    results = instrumentation_test_instance.GenerateTestResults(
-        None, None, [], 0, 1000)
-    self.assertEqual([], results)
-
-  def testGenerateTestResults_testPassed(self):
-    statuses = [
-      (1, {
-        'class': 'test.package.TestClass',
-        'test': 'testMethod',
-      }),
-      (0, {
-        'class': 'test.package.TestClass',
-        'test': 'testMethod',
-      }),
-    ]
-    results = instrumentation_test_instance.GenerateTestResults(
-        None, None, statuses, 0, 1000)
-    self.assertEqual(1, len(results))
-    self.assertEqual(base_test_result.ResultType.PASS, results[0].GetType())
-
-  def testGenerateTestResults_testSkipped_true(self):
-    statuses = [
-      (1, {
-        'class': 'test.package.TestClass',
-        'test': 'testMethod',
-      }),
-      (0, {
-        'test_skipped': 'true',
-        'class': 'test.package.TestClass',
-        'test': 'testMethod',
-      }),
-      (0, {
-        'class': 'test.package.TestClass',
-        'test': 'testMethod',
-      }),
-    ]
-    results = instrumentation_test_instance.GenerateTestResults(
-        None, None, statuses, 0, 1000)
-    self.assertEqual(1, len(results))
-    self.assertEqual(base_test_result.ResultType.SKIP, results[0].GetType())
-
-  def testGenerateTestResults_testSkipped_false(self):
-    statuses = [
-      (1, {
-        'class': 'test.package.TestClass',
-        'test': 'testMethod',
-      }),
-      (0, {
-        'test_skipped': 'false',
-      }),
-      (0, {
-        'class': 'test.package.TestClass',
-        'test': 'testMethod',
-      }),
-    ]
-    results = instrumentation_test_instance.GenerateTestResults(
-        None, None, statuses, 0, 1000)
-    self.assertEqual(1, len(results))
-    self.assertEqual(base_test_result.ResultType.PASS, results[0].GetType())
-
-  def testGenerateTestResults_testFailed(self):
-    statuses = [
-      (1, {
-        'class': 'test.package.TestClass',
-        'test': 'testMethod',
-      }),
-      (-2, {
-        'class': 'test.package.TestClass',
-        'test': 'testMethod',
-      }),
-    ]
-    results = instrumentation_test_instance.GenerateTestResults(
-        None, None, statuses, 0, 1000)
-    self.assertEqual(1, len(results))
-    self.assertEqual(base_test_result.ResultType.FAIL, results[0].GetType())
-
-
-if __name__ == '__main__':
-  unittest.main(verbosity=2)
diff --git a/build/android/pylib/instrumentation/json_perf_parser.py b/build/android/pylib/instrumentation/json_perf_parser.py
deleted file mode 100644
index ffdfbe7..0000000
--- a/build/android/pylib/instrumentation/json_perf_parser.py
+++ /dev/null
@@ -1,161 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-
-"""A helper module for parsing JSON objects from perf tests results."""
-
-import json
-
-
-def GetAverageRunInfo(json_data, name):
-  """Summarizes TraceEvent JSON data for performance metrics.
-
-  Example JSON Inputs (More tags can be added but these are required):
-  Measuring Duration:
-  [
-    { "cat": "Java",
-      "ts": 10000000000,
-      "ph": "S",
-      "name": "TestTrace"
-    },
-    { "cat": "Java",
-      "ts": 10000004000,
-      "ph": "F",
-      "name": "TestTrace"
-    },
-    ...
-  ]
-
-  Measuring Call Frequency (FPS):
-  [
-    { "cat": "Java",
-      "ts": 10000000000,
-      "ph": "I",
-      "name": "TestTraceFPS"
-    },
-    { "cat": "Java",
-      "ts": 10000004000,
-      "ph": "I",
-      "name": "TestTraceFPS"
-    },
-    ...
-  ]
-
-  Args:
-    json_data: A list of dictonaries each representing a JSON object.
-    name: The 'name' tag to filter on in the JSON file.
-
-  Returns:
-    A dictionary of result data with the following tags:
-      min: The minimum value tracked.
-      max: The maximum value tracked.
-      average: The average of all the values tracked.
-      count: The number of times the category/name pair was tracked.
-      type: The type of tracking ('Instant' for instant tags and 'Span' for
-            begin/end tags.
-      category: The passed in category filter.
-      name: The passed in name filter.
-      data_points: A list of all of the times used to generate this data.
-      units: The units for the values being reported.
-
-  Raises:
-    Exception: if entry contains invalid data.
-  """
-
-  def EntryFilter(entry):
-    return entry['cat'] == 'Java' and entry['name'] == name
-  filtered_entries = filter(EntryFilter, json_data)
-
-  result = {}
-
-  result['min'] = -1
-  result['max'] = -1
-  result['average'] = 0
-  result['count'] = 0
-  result['type'] = 'Unknown'
-  result['category'] = 'Java'
-  result['name'] = name
-  result['data_points'] = []
-  result['units'] = ''
-
-  total_sum = 0
-
-  last_val = 0
-  val_type = None
-  for entry in filtered_entries:
-    if not val_type:
-      if 'mem' in entry:
-        val_type = 'mem'
-
-        def GetVal(entry):
-          return entry['mem']
-
-        result['units'] = 'kb'
-      elif 'ts' in entry:
-        val_type = 'ts'
-
-        def GetVal(entry):
-          return float(entry['ts']) / 1000.0
-
-        result['units'] = 'ms'
-      else:
-        raise Exception('Entry did not contain valid value info: %s' % entry)
-
-    if not val_type in entry:
-      raise Exception('Entry did not contain expected value type "%s" '
-                      'information: %s' % (val_type, entry))
-    val = GetVal(entry)
-    if (entry['ph'] == 'S' and
-        (result['type'] == 'Unknown' or result['type'] == 'Span')):
-      result['type'] = 'Span'
-      last_val = val
-    elif ((entry['ph'] == 'F' and result['type'] == 'Span') or
-          (entry['ph'] == 'I' and (result['type'] == 'Unknown' or
-                                   result['type'] == 'Instant'))):
-      if last_val > 0:
-        delta = val - last_val
-        if result['min'] == -1 or result['min'] > delta:
-          result['min'] = delta
-        if result['max'] == -1 or result['max'] < delta:
-          result['max'] = delta
-        total_sum += delta
-        result['count'] += 1
-        result['data_points'].append(delta)
-      if entry['ph'] == 'I':
-        result['type'] = 'Instant'
-        last_val = val
-  if result['count'] > 0:
-    result['average'] = total_sum / result['count']
-
-  return result
-
-
-def GetAverageRunInfoFromJSONString(json_string, name):
-  """Returns the results from GetAverageRunInfo using a JSON string.
-
-  Args:
-    json_string: The string containing JSON.
-    name: The 'name' tag to filter on in the JSON file.
-
-  Returns:
-    See GetAverageRunInfo Returns section.
-  """
-  return GetAverageRunInfo(json.loads(json_string), name)
-
-
-def GetAverageRunInfoFromFile(json_file, name):
-  """Returns the results from GetAverageRunInfo using a JSON file.
-
-  Args:
-    json_file: The path to a JSON file.
-    name: The 'name' tag to filter on in the JSON file.
-
-  Returns:
-    See GetAverageRunInfo Returns section.
-  """
-  with open(json_file, 'r') as f:
-    data = f.read()
-    perf = json.loads(data)
-
-  return GetAverageRunInfo(perf, name)
diff --git a/build/android/pylib/instrumentation/setup.py b/build/android/pylib/instrumentation/setup.py
deleted file mode 100644
index 7a0501e..0000000
--- a/build/android/pylib/instrumentation/setup.py
+++ /dev/null
@@ -1,113 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Generates test runner factory and tests for instrumentation tests."""
-
-import logging
-import os
-
-from pylib import constants
-from pylib import valgrind_tools
-
-from pylib.base import base_setup
-from pylib.device import device_utils
-from pylib.instrumentation import test_package
-from pylib.instrumentation import test_runner
-
-DEVICE_DATA_DIR = 'chrome/test/data'
-
-ISOLATE_FILE_PATHS = {
-    'AndroidWebViewTest': 'android_webview/android_webview_test_apk.isolate',
-    'ChromeShellTest': 'chrome/chrome_shell_test_apk.isolate',
-    'ContentShellTest': 'content/content_shell_test_apk.isolate',
-}
-
-DEPS_EXCLUSION_LIST = []
-
-# TODO(mikecase): Remove this function and the constant DEVICE_DATA_DIR
-# once all data deps are pushed to the same location on the device.
-def _PushExtraSuiteDataDeps(device, test_apk):
-  """Pushes some extra data files/dirs needed by some test suite.
-
-  Args:
-    test_apk: The test suite basename for which to return file paths.
-  """
-  if test_apk in ['ChromeTest', 'ContentShellTest']:
-    test_files = 'net/data/ssl/certificates'
-    host_device_file_tuple = [
-        (os.path.join(constants.DIR_SOURCE_ROOT, test_files),
-         os.path.join(device.GetExternalStoragePath(), test_files))]
-    device.PushChangedFiles(host_device_file_tuple)
-
-
-# TODO(mikecase): Remove this function once everything uses
-# base_setup.PushDataDeps to push data deps to the device.
-def _PushDataDeps(device, test_options):
-  valgrind_tools.PushFilesForTool(test_options.tool, device)
-
-  host_device_file_tuples = []
-  for dest_host_pair in test_options.test_data:
-    dst_src = dest_host_pair.split(':', 1)
-    dst_layer = dst_src[0]
-    host_src = dst_src[1]
-    host_test_files_path = os.path.join(constants.DIR_SOURCE_ROOT, host_src)
-    if os.path.exists(host_test_files_path):
-      host_device_file_tuples += [(
-          host_test_files_path,
-          '%s/%s/%s' % (
-              device.GetExternalStoragePath(),
-              DEVICE_DATA_DIR,
-              dst_layer))]
-  if host_device_file_tuples:
-    device.PushChangedFiles(host_device_file_tuples)
-
-
-def Setup(test_options, devices):
-  """Create and return the test runner factory and tests.
-
-  Args:
-    test_options: An InstrumentationOptions object.
-
-  Returns:
-    A tuple of (TestRunnerFactory, tests).
-  """
-  if (test_options.coverage_dir and not
-      os.path.exists(test_options.coverage_dir)):
-    os.makedirs(test_options.coverage_dir)
-
-  test_pkg = test_package.TestPackage(test_options.test_apk_path,
-                                      test_options.test_apk_jar_path,
-                                      test_options.test_support_apk_path)
-  tests = test_pkg.GetAllMatchingTests(
-      test_options.annotations,
-      test_options.exclude_annotations,
-      test_options.test_filter)
-  if not tests:
-    logging.error('No instrumentation tests to run with current args.')
-
-  if test_options.test_data:
-    device_utils.DeviceUtils.parallel(devices).pMap(
-        _PushDataDeps, test_options)
-
-  if test_options.isolate_file_path:
-    i = base_setup.GenerateDepsDirUsingIsolate(test_options.test_apk,
-                                           test_options.isolate_file_path,
-                                           ISOLATE_FILE_PATHS,
-                                           DEPS_EXCLUSION_LIST)
-    def push_data_deps_to_device_dir(device):
-      base_setup.PushDataDeps(device, device.GetExternalStoragePath(),
-                              test_options)
-    device_utils.DeviceUtils.parallel(devices).pMap(
-        push_data_deps_to_device_dir)
-    if i:
-      i.Clear()
-
-  device_utils.DeviceUtils.parallel(devices).pMap(
-      _PushExtraSuiteDataDeps, test_options.test_apk)
-
-  def TestRunnerFactory(device, shard_index):
-    return test_runner.TestRunner(test_options, device, shard_index,
-                                  test_pkg)
-
-  return (TestRunnerFactory, tests)
diff --git a/build/android/pylib/instrumentation/test_jar.py b/build/android/pylib/instrumentation/test_jar.py
deleted file mode 100644
index 7ad8997..0000000
--- a/build/android/pylib/instrumentation/test_jar.py
+++ /dev/null
@@ -1,230 +0,0 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Helper class for instrumenation test jar."""
-# pylint: disable=W0702
-
-import logging
-import os
-import pickle
-import re
-import sys
-
-from pylib import cmd_helper
-from pylib import constants
-from pylib.device import device_utils
-from pylib.utils import md5sum
-from pylib.utils import proguard
-
-sys.path.insert(0,
-                os.path.join(constants.DIR_SOURCE_ROOT,
-                             'build', 'util', 'lib', 'common'))
-
-import unittest_util # pylint: disable=F0401
-
-# If you change the cached output of proguard, increment this number
-PICKLE_FORMAT_VERSION = 4
-
-
-class TestJar(object):
-  _ANNOTATIONS = frozenset(
-      ['Smoke', 'SmallTest', 'MediumTest', 'LargeTest', 'EnormousTest',
-       'FlakyTest', 'DisabledTest', 'Manual', 'PerfTest', 'HostDrivenTest',
-       'IntegrationTest'])
-  _DEFAULT_ANNOTATION = 'SmallTest'
-  _PROGUARD_CLASS_RE = re.compile(r'\s*?- Program class:\s*([\S]+)$')
-  _PROGUARD_SUPERCLASS_RE = re.compile(r'\s*?  Superclass:\s*([\S]+)$')
-  _PROGUARD_METHOD_RE = re.compile(r'\s*?- Method:\s*(\S*)[(].*$')
-  _PROGUARD_ANNOTATION_RE = re.compile(r'\s*?- Annotation \[L(\S*);\]:$')
-  _PROGUARD_ANNOTATION_CONST_RE = (
-      re.compile(r'\s*?- Constant element value.*$'))
-  _PROGUARD_ANNOTATION_VALUE_RE = re.compile(r'\s*?- \S+? \[(.*)\]$')
-
-  def __init__(self, jar_path):
-    if not os.path.exists(jar_path):
-      raise Exception('%s not found, please build it' % jar_path)
-
-    self._PROGUARD_PATH = os.path.join(constants.ANDROID_SDK_ROOT,
-                                       'tools/proguard/lib/proguard.jar')
-    if not os.path.exists(self._PROGUARD_PATH):
-      self._PROGUARD_PATH = os.path.join(os.environ['ANDROID_BUILD_TOP'],
-                                         'external/proguard/lib/proguard.jar')
-    self._jar_path = jar_path
-    self._pickled_proguard_name = self._jar_path + '-proguard.pickle'
-    self._test_methods = {}
-    if not self._GetCachedProguardData():
-      self._GetProguardData()
-
-  def _GetCachedProguardData(self):
-    if (os.path.exists(self._pickled_proguard_name) and
-        (os.path.getmtime(self._pickled_proguard_name) >
-         os.path.getmtime(self._jar_path))):
-      logging.info('Loading cached proguard output from %s',
-                   self._pickled_proguard_name)
-      try:
-        with open(self._pickled_proguard_name, 'r') as r:
-          d = pickle.loads(r.read())
-        jar_md5 = md5sum.CalculateHostMd5Sums(
-          self._jar_path)[os.path.realpath(self._jar_path)]
-        if (d['JAR_MD5SUM'] == jar_md5 and
-            d['VERSION'] == PICKLE_FORMAT_VERSION):
-          self._test_methods = d['TEST_METHODS']
-          return True
-      except:
-        logging.warning('PICKLE_FORMAT_VERSION has changed, ignoring cache')
-    return False
-
-  def _GetProguardData(self):
-    logging.info('Retrieving test methods via proguard.')
-
-    p = proguard.Dump(self._jar_path)
-
-    class_lookup = dict((c['class'], c) for c in p['classes'])
-    def recursive_get_annotations(c):
-      s = c['superclass']
-      if s in class_lookup:
-        a = recursive_get_annotations(class_lookup[s])
-      else:
-        a = {}
-      a.update(c['annotations'])
-      return a
-
-    test_classes = (c for c in p['classes']
-                    if c['class'].endswith('Test'))
-    for c in test_classes:
-      class_annotations = recursive_get_annotations(c)
-      test_methods = (m for m in c['methods']
-                      if m['method'].startswith('test'))
-      for m in test_methods:
-        qualified_method = '%s#%s' % (c['class'], m['method'])
-        annotations = dict(class_annotations)
-        annotations.update(m['annotations'])
-        self._test_methods[qualified_method] = m
-        self._test_methods[qualified_method]['annotations'] = annotations
-
-    logging.info('Storing proguard output to %s', self._pickled_proguard_name)
-    d = {'VERSION': PICKLE_FORMAT_VERSION,
-         'TEST_METHODS': self._test_methods,
-         'JAR_MD5SUM':
-              md5sum.CalculateHostMd5Sums(
-                self._jar_path)[os.path.realpath(self._jar_path)]}
-    with open(self._pickled_proguard_name, 'w') as f:
-      f.write(pickle.dumps(d))
-
-  @staticmethod
-  def _IsTestMethod(test):
-    class_name, method = test.split('#')
-    return class_name.endswith('Test') and method.startswith('test')
-
-  def GetTestAnnotations(self, test):
-    """Returns a list of all annotations for the given |test|. May be empty."""
-    if not self._IsTestMethod(test) or not test in self._test_methods:
-      return []
-    return self._test_methods[test]['annotations']
-
-  @staticmethod
-  def _AnnotationsMatchFilters(annotation_filter_list, annotations):
-    """Checks if annotations match any of the filters."""
-    if not annotation_filter_list:
-      return True
-    for annotation_filter in annotation_filter_list:
-      filters = annotation_filter.split('=')
-      if len(filters) == 2:
-        key = filters[0]
-        value_list = filters[1].split(',')
-        for value in value_list:
-          if key in annotations and value == annotations[key]:
-            return True
-      elif annotation_filter in annotations:
-        return True
-    return False
-
-  def GetAnnotatedTests(self, annotation_filter_list):
-    """Returns a list of all tests that match the given annotation filters."""
-    return [test for test in self.GetTestMethods()
-            if self._IsTestMethod(test) and self._AnnotationsMatchFilters(
-                annotation_filter_list, self.GetTestAnnotations(test))]
-
-  def GetTestMethods(self):
-    """Returns a dict of all test methods and relevant attributes.
-
-    Test methods are retrieved as Class#testMethod.
-    """
-    return self._test_methods
-
-  def _GetTestsMissingAnnotation(self):
-    """Get a list of test methods with no known annotations."""
-    tests_missing_annotations = []
-    for test_method in self.GetTestMethods().iterkeys():
-      annotations_ = frozenset(self.GetTestAnnotations(test_method).iterkeys())
-      if (annotations_.isdisjoint(self._ANNOTATIONS) and
-          not self.IsHostDrivenTest(test_method)):
-        tests_missing_annotations.append(test_method)
-    return sorted(tests_missing_annotations)
-
-  def _IsTestValidForSdkRange(self, test_name, attached_min_sdk_level):
-    required_min_sdk_level = int(
-        self.GetTestAnnotations(test_name).get('MinAndroidSdkLevel', 0))
-    return (required_min_sdk_level is None or
-            attached_min_sdk_level >= required_min_sdk_level)
-
-  def GetAllMatchingTests(self, annotation_filter_list,
-                          exclude_annotation_list, test_filter):
-    """Get a list of tests matching any of the annotations and the filter.
-
-    Args:
-      annotation_filter_list: List of test annotations. A test must have at
-        least one of these annotations. A test without any annotations is
-        considered to be SmallTest.
-      exclude_annotation_list: List of test annotations. A test must not have
-        any of these annotations.
-      test_filter: Filter used for partial matching on the test method names.
-
-    Returns:
-      List of all matching tests.
-    """
-    if annotation_filter_list:
-      available_tests = self.GetAnnotatedTests(annotation_filter_list)
-      # Include un-annotated tests in SmallTest.
-      if annotation_filter_list.count(self._DEFAULT_ANNOTATION) > 0:
-        for test in self._GetTestsMissingAnnotation():
-          logging.warning(
-              '%s has no annotations. Assuming "%s".', test,
-              self._DEFAULT_ANNOTATION)
-          available_tests.append(test)
-    else:
-      available_tests = [m for m in self.GetTestMethods()
-                         if not self.IsHostDrivenTest(m)]
-
-    if exclude_annotation_list:
-      excluded_tests = self.GetAnnotatedTests(exclude_annotation_list)
-      available_tests = list(set(available_tests) - set(excluded_tests))
-
-    tests = []
-    if test_filter:
-      # |available_tests| are in adb instrument format: package.path.class#test.
-
-      # Maps a 'class.test' name to each 'package.path.class#test' name.
-      sanitized_test_names = dict([
-          (t.split('.')[-1].replace('#', '.'), t) for t in available_tests])
-      # Filters 'class.test' names and populates |tests| with the corresponding
-      # 'package.path.class#test' names.
-      tests = [
-          sanitized_test_names[t] for t in unittest_util.FilterTestNames(
-              sanitized_test_names.keys(), test_filter.replace('#', '.'))]
-    else:
-      tests = available_tests
-
-    # Filter out any tests with SDK level requirements that don't match the set
-    # of attached devices.
-    devices = device_utils.DeviceUtils.parallel()
-    min_sdk_version = min(devices.build_version_sdk.pGet(None))
-    tests = [t for t in tests
-             if self._IsTestValidForSdkRange(t, min_sdk_version)]
-
-    return tests
-
-  @staticmethod
-  def IsHostDrivenTest(test):
-    return 'pythonDrivenTests' in test
diff --git a/build/android/pylib/instrumentation/test_options.py b/build/android/pylib/instrumentation/test_options.py
deleted file mode 100644
index e7b7a9f..0000000
--- a/build/android/pylib/instrumentation/test_options.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Defines the InstrumentationOptions named tuple."""
-
-import collections
-
-InstrumentationOptions = collections.namedtuple('InstrumentationOptions', [
-    'tool',
-    'annotations',
-    'exclude_annotations',
-    'test_filter',
-    'test_data',
-    'save_perf_json',
-    'screenshot_failures',
-    'wait_for_debugger',
-    'coverage_dir',
-    'test_apk',
-    'test_apk_path',
-    'test_apk_jar_path',
-    'test_runner',
-    'test_support_apk_path',
-    'device_flags',
-    'isolate_file_path',
-    'set_asserts',
-    'delete_stale_data'])
diff --git a/build/android/pylib/instrumentation/test_package.py b/build/android/pylib/instrumentation/test_package.py
deleted file mode 100644
index 5be061d..0000000
--- a/build/android/pylib/instrumentation/test_package.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Class representing instrumentation test apk and jar."""
-
-import os
-
-from pylib.instrumentation import test_jar
-from pylib.utils import apk_helper
-
-
-class TestPackage(test_jar.TestJar):
-  def __init__(self, apk_path, jar_path, test_support_apk_path):
-    test_jar.TestJar.__init__(self, jar_path)
-
-    if not os.path.exists(apk_path):
-      raise Exception('%s not found, please build it' % apk_path)
-    if test_support_apk_path and not os.path.exists(test_support_apk_path):
-      raise Exception('%s not found, please build it' % test_support_apk_path)
-    self._apk_path = apk_path
-    self._apk_name = os.path.splitext(os.path.basename(apk_path))[0]
-    self._package_name = apk_helper.GetPackageName(self._apk_path)
-    self._test_support_apk_path = test_support_apk_path
-
-  def GetApkPath(self):
-    """Returns the absolute path to the APK."""
-    return self._apk_path
-
-  def GetApkName(self):
-    """Returns the name of the apk without the suffix."""
-    return self._apk_name
-
-  def GetPackageName(self):
-    """Returns the package name of this APK."""
-    return self._package_name
-
-  # Override.
-  def Install(self, device):
-    device.Install(self.GetApkPath())
-    if (self._test_support_apk_path and
-        os.path.exists(self._test_support_apk_path)):
-      device.Install(self._test_support_apk_path)
-
diff --git a/build/android/pylib/instrumentation/test_result.py b/build/android/pylib/instrumentation/test_result.py
deleted file mode 100644
index 24e80a8..0000000
--- a/build/android/pylib/instrumentation/test_result.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from pylib.base import base_test_result
-
-
-class InstrumentationTestResult(base_test_result.BaseTestResult):
-  """Result information for a single instrumentation test."""
-
-  def __init__(self, full_name, test_type, start_date, dur, log=''):
-    """Construct an InstrumentationTestResult object.
-
-    Args:
-      full_name: Full name of the test.
-      test_type: Type of the test result as defined in ResultType.
-      start_date: Date in milliseconds when the test began running.
-      dur: Duration of the test run in milliseconds.
-      log: A string listing any errors.
-    """
-    super(InstrumentationTestResult, self).__init__(
-        full_name, test_type, dur, log)
-    name_pieces = full_name.rsplit('#')
-    if len(name_pieces) > 1:
-      self._test_name = name_pieces[1]
-      self._class_name = name_pieces[0]
-    else:
-      self._class_name = full_name
-      self._test_name = full_name
-    self._start_date = start_date
diff --git a/build/android/pylib/instrumentation/test_runner.py b/build/android/pylib/instrumentation/test_runner.py
deleted file mode 100644
index 0f2e53f..0000000
--- a/build/android/pylib/instrumentation/test_runner.py
+++ /dev/null
@@ -1,374 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Class for running instrumentation tests on a single device."""
-
-import logging
-import os
-import re
-import sys
-import time
-
-from pylib import constants
-from pylib import flag_changer
-from pylib import valgrind_tools
-from pylib.base import base_test_result
-from pylib.base import base_test_runner
-from pylib.device import device_errors
-from pylib.instrumentation import instrumentation_test_instance
-from pylib.instrumentation import json_perf_parser
-from pylib.instrumentation import test_result
-from pylib.local.device import local_device_instrumentation_test_run
-
-sys.path.append(os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib',
-                             'common'))
-import perf_tests_results_helper # pylint: disable=F0401
-
-
-_PERF_TEST_ANNOTATION = 'PerfTest'
-
-
-class TestRunner(base_test_runner.BaseTestRunner):
-  """Responsible for running a series of tests connected to a single device."""
-
-  _DEVICE_COVERAGE_DIR = 'chrome/test/coverage'
-  _HOSTMACHINE_PERF_OUTPUT_FILE = '/tmp/chrome-profile'
-  _DEVICE_PERF_OUTPUT_SEARCH_PREFIX = (constants.DEVICE_PERF_OUTPUT_DIR +
-                                       '/chrome-profile*')
-
-  def __init__(self, test_options, device, shard_index, test_pkg,
-               additional_flags=None):
-    """Create a new TestRunner.
-
-    Args:
-      test_options: An InstrumentationOptions object.
-      device: Attached android device.
-      shard_index: Shard index.
-      test_pkg: A TestPackage object.
-      additional_flags: A list of additional flags to add to the command line.
-    """
-    super(TestRunner, self).__init__(device, test_options.tool)
-    self._lighttp_port = constants.LIGHTTPD_RANDOM_PORT_FIRST + shard_index
-    self._logcat_monitor = None
-
-    self.coverage_device_file = None
-    self.coverage_dir = test_options.coverage_dir
-    self.coverage_host_file = None
-    self.options = test_options
-    self.test_pkg = test_pkg
-    # Use the correct command line file for the package under test.
-    cmdline_file = [a.cmdline_file for a in constants.PACKAGE_INFO.itervalues()
-                    if a.test_package == self.test_pkg.GetPackageName()]
-    assert len(cmdline_file) < 2, 'Multiple packages have the same test package'
-    if len(cmdline_file) and cmdline_file[0]:
-      self.flags = flag_changer.FlagChanger(self.device, cmdline_file[0])
-      if additional_flags:
-        self.flags.AddFlags(additional_flags)
-    else:
-      self.flags = None
-
-  #override
-  def InstallTestPackage(self):
-    self.test_pkg.Install(self.device)
-
-  def _GetInstrumentationArgs(self):
-    ret = {}
-    if self.options.wait_for_debugger:
-      ret['debug'] = 'true'
-    if self.coverage_dir:
-      ret['coverage'] = 'true'
-      ret['coverageFile'] = self.coverage_device_file
-
-    return ret
-
-  def _TakeScreenshot(self, test):
-    """Takes a screenshot from the device."""
-    screenshot_name = os.path.join(constants.SCREENSHOTS_DIR, '%s.png' % test)
-    logging.info('Taking screenshot named %s', screenshot_name)
-    self.device.TakeScreenshot(screenshot_name)
-
-  def SetUp(self):
-    """Sets up the test harness and device before all tests are run."""
-    super(TestRunner, self).SetUp()
-    if not self.device.HasRoot():
-      logging.warning('Unable to enable java asserts for %s, non rooted device',
-                      str(self.device))
-    else:
-      if self.device.SetJavaAsserts(self.options.set_asserts):
-        # TODO(jbudorick) How to best do shell restart after the
-        #                 android_commands refactor?
-        self.device.RunShellCommand('stop')
-        self.device.RunShellCommand('start')
-        self.device.WaitUntilFullyBooted()
-
-    # We give different default value to launch HTTP server based on shard index
-    # because it may have race condition when multiple processes are trying to
-    # launch lighttpd with same port at same time.
-    self.LaunchTestHttpServer(
-        os.path.join(constants.DIR_SOURCE_ROOT), self._lighttp_port)
-    if self.flags:
-      self.flags.AddFlags(['--disable-fre', '--enable-test-intents'])
-      if self.options.device_flags:
-        with open(self.options.device_flags) as device_flags_file:
-          stripped_flags = (l.strip() for l in device_flags_file)
-          self.flags.AddFlags([flag for flag in stripped_flags if flag])
-
-  def TearDown(self):
-    """Cleans up the test harness and saves outstanding data from test run."""
-    if self.flags:
-      self.flags.Restore()
-    super(TestRunner, self).TearDown()
-
-  def TestSetup(self, test):
-    """Sets up the test harness for running a particular test.
-
-    Args:
-      test: The name of the test that will be run.
-    """
-    self.SetupPerfMonitoringIfNeeded(test)
-    self._SetupIndividualTestTimeoutScale(test)
-    self.tool.SetupEnvironment()
-
-    if self.flags and self._IsFreTest(test):
-      self.flags.RemoveFlags(['--disable-fre'])
-
-    # Make sure the forwarder is still running.
-    self._RestartHttpServerForwarderIfNecessary()
-
-    if self.coverage_dir:
-      coverage_basename = '%s.ec' % test
-      self.coverage_device_file = '%s/%s/%s' % (
-          self.device.GetExternalStoragePath(),
-          TestRunner._DEVICE_COVERAGE_DIR, coverage_basename)
-      self.coverage_host_file = os.path.join(
-          self.coverage_dir, coverage_basename)
-
-  def _IsFreTest(self, test):
-    """Determines whether a test is a first run experience test.
-
-    Args:
-      test: The name of the test to be checked.
-
-    Returns:
-      Whether the feature being tested is FirstRunExperience.
-    """
-    annotations = self.test_pkg.GetTestAnnotations(test)
-    return 'FirstRunExperience' == annotations.get('Feature', None)
-
-  def _IsPerfTest(self, test):
-    """Determines whether a test is a performance test.
-
-    Args:
-      test: The name of the test to be checked.
-
-    Returns:
-      Whether the test is annotated as a performance test.
-    """
-    return _PERF_TEST_ANNOTATION in self.test_pkg.GetTestAnnotations(test)
-
-  def SetupPerfMonitoringIfNeeded(self, test):
-    """Sets up performance monitoring if the specified test requires it.
-
-    Args:
-      test: The name of the test to be run.
-    """
-    if not self._IsPerfTest(test):
-      return
-    self.device.RunShellCommand(
-        ['rm', TestRunner._DEVICE_PERF_OUTPUT_SEARCH_PREFIX])
-    self._logcat_monitor = self.device.GetLogcatMonitor()
-    self._logcat_monitor.Start()
-
-  def TestTeardown(self, test, result):
-    """Cleans up the test harness after running a particular test.
-
-    Depending on the options of this TestRunner this might handle performance
-    tracking.  This method will only be called if the test passed.
-
-    Args:
-      test: The name of the test that was just run.
-      result: result for this test.
-    """
-
-    self.tool.CleanUpEnvironment()
-
-    # The logic below relies on the test passing.
-    if not result or not result.DidRunPass():
-      return
-
-    self.TearDownPerfMonitoring(test)
-
-    if self.flags and self._IsFreTest(test):
-      self.flags.AddFlags(['--disable-fre'])
-
-    if self.coverage_dir:
-      self.device.PullFile(
-          self.coverage_device_file, self.coverage_host_file)
-      self.device.RunShellCommand(
-          'rm -f %s' % self.coverage_device_file)
-
-  def TearDownPerfMonitoring(self, test):
-    """Cleans up performance monitoring if the specified test required it.
-
-    Args:
-      test: The name of the test that was just run.
-    Raises:
-      Exception: if there's anything wrong with the perf data.
-    """
-    if not self._IsPerfTest(test):
-      return
-    raw_test_name = test.split('#')[1]
-
-    # Wait and grab annotation data so we can figure out which traces to parse
-    regex = self._logcat_monitor.WaitFor(
-        re.compile(r'\*\*PERFANNOTATION\(' + raw_test_name + r'\)\:(.*)'))
-
-    # If the test is set to run on a specific device type only (IE: only
-    # tablet or phone) and it is being run on the wrong device, the test
-    # just quits and does not do anything.  The java test harness will still
-    # print the appropriate annotation for us, but will add --NORUN-- for
-    # us so we know to ignore the results.
-    # The --NORUN-- tag is managed by ChromeTabbedActivityTestBase.java
-    if regex.group(1) != '--NORUN--':
-
-      # Obtain the relevant perf data.  The data is dumped to a
-      # JSON formatted file.
-      json_string = self.device.ReadFile(
-          '/data/data/com.google.android.apps.chrome/files/PerfTestData.txt',
-          as_root=True)
-
-      if not json_string:
-        raise Exception('Perf file is empty')
-
-      if self.options.save_perf_json:
-        json_local_file = '/tmp/chromium-android-perf-json-' + raw_test_name
-        with open(json_local_file, 'w') as f:
-          f.write(json_string)
-        logging.info('Saving Perf UI JSON from test ' +
-                     test + ' to ' + json_local_file)
-
-      raw_perf_data = regex.group(1).split(';')
-
-      for raw_perf_set in raw_perf_data:
-        if raw_perf_set:
-          perf_set = raw_perf_set.split(',')
-          if len(perf_set) != 3:
-            raise Exception('Unexpected number of tokens in perf annotation '
-                            'string: ' + raw_perf_set)
-
-          # Process the performance data
-          result = json_perf_parser.GetAverageRunInfoFromJSONString(json_string,
-                                                                    perf_set[0])
-          perf_tests_results_helper.PrintPerfResult(perf_set[1], perf_set[2],
-                                                    [result['average']],
-                                                    result['units'])
-
-  def _SetupIndividualTestTimeoutScale(self, test):
-    timeout_scale = self._GetIndividualTestTimeoutScale(test)
-    valgrind_tools.SetChromeTimeoutScale(self.device, timeout_scale)
-
-  def _GetIndividualTestTimeoutScale(self, test):
-    """Returns the timeout scale for the given |test|."""
-    annotations = self.test_pkg.GetTestAnnotations(test)
-    timeout_scale = 1
-    if 'TimeoutScale' in annotations:
-      try:
-        timeout_scale = int(annotations['TimeoutScale'])
-      except ValueError:
-        logging.warning('Non-integer value of TimeoutScale ignored. (%s)'
-                        % annotations['TimeoutScale'])
-    if self.options.wait_for_debugger:
-      timeout_scale *= 100
-    return timeout_scale
-
-  def _GetIndividualTestTimeoutSecs(self, test):
-    """Returns the timeout in seconds for the given |test|."""
-    annotations = self.test_pkg.GetTestAnnotations(test)
-    if 'Manual' in annotations:
-      return 10 * 60 * 60
-    if 'IntegrationTest' in annotations:
-      return 30 * 60
-    if 'External' in annotations:
-      return 10 * 60
-    if 'EnormousTest' in annotations:
-      return 10 * 60
-    if 'LargeTest' in annotations or _PERF_TEST_ANNOTATION in annotations:
-      return 5 * 60
-    if 'MediumTest' in annotations:
-      return 3 * 60
-    if 'SmallTest' in annotations:
-      return 1 * 60
-
-    logging.warn(("Test size not found in annotations for test '%s', using " +
-                  "1 minute for timeout.") % test)
-    return 1 * 60
-
-  def _RunTest(self, test, timeout):
-    """Runs a single instrumentation test.
-
-    Args:
-      test: Test class/method.
-      timeout: Timeout time in seconds.
-
-    Returns:
-      The raw output of am instrument as a list of lines.
-    """
-    extras = self._GetInstrumentationArgs()
-    extras['class'] = test
-    return self.device.StartInstrumentation(
-        '%s/%s' % (self.test_pkg.GetPackageName(), self.options.test_runner),
-        raw=True, extras=extras, timeout=timeout, retries=3)
-
-  def _GenerateTestResult(self, test, instr_result_code, instr_result_bundle,
-                          statuses, start_ms, duration_ms):
-    results = instrumentation_test_instance.GenerateTestResults(
-        instr_result_code, instr_result_bundle, statuses, start_ms, duration_ms)
-    for r in results:
-      if r.GetName() == test:
-        return r
-    logging.error('Could not find result for test: %s', test)
-    return test_result.InstrumentationTestResult(
-        test, base_test_result.ResultType.UNKNOWN, start_ms, duration_ms)
-
-  #override
-  def RunTest(self, test):
-    results = base_test_result.TestRunResults()
-    timeout = (self._GetIndividualTestTimeoutSecs(test) *
-               self._GetIndividualTestTimeoutScale(test) *
-               self.tool.GetTimeoutScale())
-
-    start_ms = 0
-    duration_ms = 0
-    try:
-      self.TestSetup(test)
-
-      try:
-        self.device.GoHome()
-      except device_errors.CommandTimeoutError:
-        logging.exception('Failed to focus the launcher.')
-
-      time_ms = lambda: int(time.time() * 1000)
-      start_ms = time_ms()
-      raw_output = self._RunTest(test, timeout)
-      duration_ms = time_ms() - start_ms
-
-      # Parse the test output
-      result_code, result_bundle, statuses = (
-          instrumentation_test_instance.ParseAmInstrumentRawOutput(raw_output))
-      result = self._GenerateTestResult(
-          test, result_code, result_bundle, statuses, start_ms, duration_ms)
-      if local_device_instrumentation_test_run.DidPackageCrashOnDevice(
-          self.test_pkg.GetPackageName(), self.device):
-        result.SetType(base_test_result.ResultType.CRASH)
-      results.AddResult(result)
-    except device_errors.CommandTimeoutError as e:
-      results.AddResult(test_result.InstrumentationTestResult(
-          test, base_test_result.ResultType.TIMEOUT, start_ms, duration_ms,
-          log=str(e) or 'No information'))
-    except device_errors.DeviceUnreachableError as e:
-      results.AddResult(test_result.InstrumentationTestResult(
-          test, base_test_result.ResultType.CRASH, start_ms, duration_ms,
-          log=str(e) or 'No information'))
-    self.TestTeardown(test, results)
-    return (results, None if results.DidRunPass() else test)
diff --git a/build/android/pylib/junit/__init__.py b/build/android/pylib/junit/__init__.py
deleted file mode 100644
index 5cac026..0000000
--- a/build/android/pylib/junit/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
diff --git a/build/android/pylib/junit/setup.py b/build/android/pylib/junit/setup.py
deleted file mode 100644
index 94d4277..0000000
--- a/build/android/pylib/junit/setup.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from pylib.junit import test_runner
-
-def Setup(args):
-  """Creates a test runner factory for junit tests.
-
-  Args:
-    args: an argparse.Namespace object.
-  Return:
-    A (runner_factory, tests) tuple.
-  """
-
-  def TestRunnerFactory(_unused_device, _unused_shard_index):
-    return test_runner.JavaTestRunner(args)
-
-  return (TestRunnerFactory, ['JUnit tests'])
-
diff --git a/build/android/pylib/junit/test_dispatcher.py b/build/android/pylib/junit/test_dispatcher.py
deleted file mode 100644
index 6e0d865..0000000
--- a/build/android/pylib/junit/test_dispatcher.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from pylib import constants
-from pylib.base import base_test_result
-
-def RunTests(tests, runner_factory):
-  """Runs a set of java tests on the host.
-
-  Return:
-    A tuple containing the results & the exit code.
-  """
-  def run(t):
-    runner = runner_factory(None, None)
-    runner.SetUp()
-    results_list, return_code = runner.RunTest(t)
-    runner.TearDown()
-    return (results_list, return_code == 0)
-
-  test_run_results = base_test_result.TestRunResults()
-  exit_code = 0
-  for t in tests:
-    results_list, passed = run(t)
-    test_run_results.AddResults(results_list)
-    if not passed:
-      exit_code = constants.ERROR_EXIT_CODE
-  return (test_run_results, exit_code)
\ No newline at end of file
diff --git a/build/android/pylib/junit/test_runner.py b/build/android/pylib/junit/test_runner.py
deleted file mode 100644
index a6d3bf9..0000000
--- a/build/android/pylib/junit/test_runner.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import json
-import os
-import tempfile
-
-from pylib import cmd_helper
-from pylib import constants
-from pylib.base import base_test_result
-from pylib.results import json_results
-
-class JavaTestRunner(object):
-  """Runs java tests on the host."""
-
-  def __init__(self, args):
-    self._package_filter = args.package_filter
-    self._runner_filter = args.runner_filter
-    self._sdk_version = args.sdk_version
-    self._test_filter = args.test_filter
-    self._test_suite = args.test_suite
-
-  def SetUp(self):
-    pass
-
-  def RunTest(self, _test):
-    """Runs junit tests from |self._test_suite|."""
-    with tempfile.NamedTemporaryFile() as json_file:
-      java_script = os.path.join(
-          constants.GetOutDirectory(), 'bin', self._test_suite)
-      command = [java_script,
-                 '-test-jars', self._test_suite + '.jar',
-                 '-json-results-file', json_file.name]
-      if self._test_filter:
-        command.extend(['-gtest-filter', self._test_filter])
-      if self._package_filter:
-        command.extend(['-package-filter', self._package_filter])
-      if self._runner_filter:
-        command.extend(['-runner-filter', self._runner_filter])
-      if self._sdk_version:
-        command.extend(['-sdk-version', self._sdk_version])
-      return_code = cmd_helper.RunCmd(command)
-      results_list = json_results.ParseResultsFromJson(
-          json.loads(json_file.read()))
-      return (results_list, return_code)
-
-  def TearDown(self):
-    pass
-
diff --git a/build/android/pylib/linker/__init__.py b/build/android/pylib/linker/__init__.py
deleted file mode 100644
index af99437..0000000
--- a/build/android/pylib/linker/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
diff --git a/build/android/pylib/linker/setup.py b/build/android/pylib/linker/setup.py
deleted file mode 100644
index 5776f5a..0000000
--- a/build/android/pylib/linker/setup.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Setup for linker tests."""
-
-import os
-import sys
-
-from pylib import constants
-from pylib.linker import test_case
-from pylib.linker import test_runner
-
-sys.path.insert(0,
-                os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib',
-                             'common'))
-import unittest_util # pylint: disable=F0401
-
-def Setup(args, _devices):
-  """Creates a list of test cases and a runner factory.
-
-  Args:
-    args: an argparse.Namespace object.
-  Returns:
-    A tuple of (TestRunnerFactory, tests).
-  """
-  test_cases = [
-      test_case.LinkerLibraryAddressTest,
-      test_case.LinkerSharedRelroTest,
-      test_case.LinkerRandomizationTest]
-
-  low_memory_modes = [False, True]
-  all_tests = [t(is_low_memory=m) for t in test_cases for m in low_memory_modes]
-
-  if args.test_filter:
-    all_test_names = [test.qualified_name for test in all_tests]
-    filtered_test_names = unittest_util.FilterTestNames(all_test_names,
-                                                        args.test_filter)
-    all_tests = [t for t in all_tests \
-                 if t.qualified_name in filtered_test_names]
-
-  def TestRunnerFactory(device, _shard_index):
-    return test_runner.LinkerTestRunner(device, args.tool)
-
-  return (TestRunnerFactory, all_tests)
diff --git a/build/android/pylib/linker/test_case.py b/build/android/pylib/linker/test_case.py
deleted file mode 100644
index c7b0f50..0000000
--- a/build/android/pylib/linker/test_case.py
+++ /dev/null
@@ -1,496 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Base class for linker-specific test cases.
-
-   The custom dynamic linker can only be tested through a custom test case
-   for various technical reasons:
-
-     - It's an 'invisible feature', i.e. it doesn't expose a new API or
-       behaviour, all it does is save RAM when loading native libraries.
-
-     - Checking that it works correctly requires several things that do not
-       fit the existing GTest-based and instrumentation-based tests:
-
-         - Native test code needs to be run in both the browser and renderer
-           process at the same time just after loading native libraries, in
-           a completely asynchronous way.
-
-         - Each test case requires restarting a whole new application process
-           with a different command-line.
-
-         - Enabling test support in the Linker code requires building a special
-           APK with a flag to activate special test-only support code in the
-           Linker code itself.
-
-       Host-driven tests have also been tried, but since they're really
-       sub-classes of instrumentation tests, they didn't work well either.
-
-   To build and run the linker tests, do the following:
-
-     ninja -C out/Debug chromium_linker_test_apk
-     build/android/test_runner.py linker
-
-"""
-# pylint: disable=R0201
-
-import logging
-import os
-import re
-import time
-
-from pylib import constants
-from pylib.base import base_test_result
-from pylib.device import device_errors
-from pylib.device import intent
-
-
-ResultType = base_test_result.ResultType
-
-_PACKAGE_NAME = 'org.chromium.chromium_linker_test_apk'
-_ACTIVITY_NAME = '.ChromiumLinkerTestActivity'
-_COMMAND_LINE_FILE = '/data/local/tmp/chromium-linker-test-command-line'
-
-# Path to the Linker.java source file.
-_LINKER_JAVA_SOURCE_PATH = (
-    'base/android/java/src/org/chromium/base/library_loader/Linker.java')
-
-# A regular expression used to extract the browser shared RELRO configuration
-# from the Java source file above.
-_RE_LINKER_BROWSER_CONFIG = re.compile(
-    r'.*BROWSER_SHARED_RELRO_CONFIG\s+=\s+' +
-        r'BROWSER_SHARED_RELRO_CONFIG_(\S+)\s*;.*',
-    re.MULTILINE | re.DOTALL)
-
-# Logcat filters used during each test. Only the 'chromium' one is really
-# needed, but the logs are added to the TestResult in case of error, and
-# it is handy to have the 'chromium_android_linker' ones as well when
-# troubleshooting.
-_LOGCAT_FILTERS = ['*:s', 'chromium:v', 'chromium_android_linker:v']
-#_LOGCAT_FILTERS = ['*:v']  ## DEBUG
-
-# Regular expression used to match status lines in logcat.
-_RE_BROWSER_STATUS_LINE = re.compile(r' BROWSER_LINKER_TEST: (FAIL|SUCCESS)$')
-_RE_RENDERER_STATUS_LINE = re.compile(r' RENDERER_LINKER_TEST: (FAIL|SUCCESS)$')
-
-# Regular expression used to mach library load addresses in logcat.
-_RE_LIBRARY_ADDRESS = re.compile(
-    r'(BROWSER|RENDERER)_LIBRARY_ADDRESS: (\S+) ([0-9A-Fa-f]+)')
-
-
-def _GetBrowserSharedRelroConfig():
-  """Returns a string corresponding to the Linker's configuration of shared
-     RELRO sections in the browser process. This parses the Java linker source
-     file to get the appropriate information.
-  Return:
-      None in case of error (e.g. could not locate the source file).
-     'NEVER' if the browser process shall never use shared RELROs.
-     'LOW_RAM_ONLY' if if uses it only on low-end devices.
-     'ALWAYS' if it always uses a shared RELRO.
-  """
-  source_path = \
-      os.path.join(constants.DIR_SOURCE_ROOT, _LINKER_JAVA_SOURCE_PATH)
-  if not os.path.exists(source_path):
-    logging.error('Could not find linker source file: ' + source_path)
-    return None
-
-  with open(source_path) as f:
-    configs = _RE_LINKER_BROWSER_CONFIG.findall(f.read())
-    if not configs:
-      logging.error(
-          'Can\'t find browser shared RELRO configuration value in ' + \
-          source_path)
-      return None
-
-    if configs[0] not in ['NEVER', 'LOW_RAM_ONLY', 'ALWAYS']:
-      logging.error('Unexpected browser config value: ' + configs[0])
-      return None
-
-    logging.info('Found linker browser shared RELRO config: ' + configs[0])
-    return configs[0]
-
-
-def _StartActivityAndWaitForLinkerTestStatus(device, timeout):
-  """Force-start an activity and wait up to |timeout| seconds until the full
-     linker test status lines appear in the logcat, recorded through |device|.
-  Args:
-    device: A DeviceUtils instance.
-    timeout: Timeout in seconds
-  Returns:
-    A (status, logs) tuple, where status is a ResultType constant, and logs
-    if the final logcat output as a string.
-  """
-
-  # 1. Start recording logcat with appropriate filters.
-  with device.GetLogcatMonitor(filter_specs=_LOGCAT_FILTERS) as logmon:
-
-    # 2. Force-start activity.
-    device.StartActivity(
-        intent.Intent(package=_PACKAGE_NAME, activity=_ACTIVITY_NAME),
-        force_stop=True)
-
-    # 3. Wait up to |timeout| seconds until the test status is in the logcat.
-    result = ResultType.PASS
-    try:
-      browser_match = logmon.WaitFor(_RE_BROWSER_STATUS_LINE, timeout=timeout)
-      logging.debug('Found browser match: %s', browser_match.group(0))
-      renderer_match = logmon.WaitFor(_RE_RENDERER_STATUS_LINE,
-                                      timeout=timeout)
-      logging.debug('Found renderer match: %s', renderer_match.group(0))
-      if (browser_match.group(1) != 'SUCCESS'
-          or renderer_match.group(1) != 'SUCCESS'):
-        result = ResultType.FAIL
-    except device_errors.CommandTimeoutError:
-      result = ResultType.TIMEOUT
-
-    return result, '\n'.join(device.adb.Logcat(dump=True))
-
-
-class LibraryLoadMap(dict):
-  """A helper class to pretty-print a map of library names to load addresses."""
-  def __str__(self):
-    items = ['\'%s\': 0x%x' % (name, address) for \
-        (name, address) in self.iteritems()]
-    return '{%s}' % (', '.join(items))
-
-  def __repr__(self):
-    return 'LibraryLoadMap(%s)' % self.__str__()
-
-
-class AddressList(list):
-  """A helper class to pretty-print a list of load addresses."""
-  def __str__(self):
-    items = ['0x%x' % address for address in self]
-    return '[%s]' % (', '.join(items))
-
-  def __repr__(self):
-    return 'AddressList(%s)' % self.__str__()
-
-
-def _ExtractLibraryLoadAddressesFromLogcat(logs):
-  """Extract the names and addresses of shared libraries loaded in the
-     browser and renderer processes.
-  Args:
-    logs: A string containing logcat output.
-  Returns:
-    A tuple (browser_libs, renderer_libs), where each item is a map of
-    library names (strings) to library load addresses (ints), for the
-    browser and renderer processes, respectively.
-  """
-  browser_libs = LibraryLoadMap()
-  renderer_libs = LibraryLoadMap()
-  for m in _RE_LIBRARY_ADDRESS.finditer(logs):
-    process_type, lib_name, lib_address = m.groups()
-    lib_address = int(lib_address, 16)
-    if process_type == 'BROWSER':
-      browser_libs[lib_name] = lib_address
-    elif process_type == 'RENDERER':
-      renderer_libs[lib_name] = lib_address
-    else:
-      assert False, 'Invalid process type'
-
-  return browser_libs, renderer_libs
-
-
-def _CheckLoadAddressRandomization(lib_map_list, process_type):
-  """Check that a map of library load addresses is random enough.
-  Args:
-    lib_map_list: a list of dictionaries that map library names (string)
-      to load addresses (int). Each item in the list corresponds to a
-      different run / process start.
-    process_type: a string describing the process type.
-  Returns:
-    (status, logs) tuple, where <status> is True iff the load addresses are
-    randomized, False otherwise, and <logs> is a string containing an error
-    message detailing the libraries that are not randomized properly.
-  """
-  # Collect, for each library, its list of load addresses.
-  lib_addr_map = {}
-  for lib_map in lib_map_list:
-    for lib_name, lib_address in lib_map.iteritems():
-      if lib_name not in lib_addr_map:
-        lib_addr_map[lib_name] = AddressList()
-      lib_addr_map[lib_name].append(lib_address)
-
-  logging.info('%s library load map: %s', process_type, lib_addr_map)
-
-  # For each library, check the randomness of its load addresses.
-  bad_libs = {}
-  for lib_name, lib_address_list in lib_addr_map.iteritems():
-    # If all addresses are different, skip to next item.
-    lib_address_set = set(lib_address_list)
-    # Consider that if there is more than one pair of identical addresses in
-    # the list, then randomization is broken.
-    if len(lib_address_set) < len(lib_address_list) - 1:
-      bad_libs[lib_name] = lib_address_list
-
-
-  if bad_libs:
-    return False, '%s libraries failed randomization: %s' % \
-        (process_type, bad_libs)
-
-  return True, '%s libraries properly randomized: %s' % \
-      (process_type, lib_addr_map)
-
-
-class LinkerTestCaseBase(object):
-  """Base class for linker test cases."""
-
-  def __init__(self, is_low_memory=False):
-    """Create a test case.
-    Args:
-      is_low_memory: True to simulate a low-memory device, False otherwise.
-    """
-    self.is_low_memory = is_low_memory
-    if is_low_memory:
-      test_suffix = 'ForLowMemoryDevice'
-    else:
-      test_suffix = 'ForRegularDevice'
-    class_name = self.__class__.__name__
-    self.qualified_name = '%s.%s' % (class_name, test_suffix)
-    self.tagged_name = self.qualified_name
-
-  def _RunTest(self, _device):
-    """Run the test, must be overriden.
-    Args:
-      _device: A DeviceUtils interface.
-    Returns:
-      A (status, log) tuple, where <status> is a ResultType constant, and <log>
-      is the logcat output captured during the test in case of error, or None
-      in case of success.
-    """
-    return ResultType.FAIL, 'Unimplemented _RunTest() method!'
-
-  def Run(self, device):
-    """Run the test on a given device.
-    Args:
-      device: Name of target device where to run the test.
-    Returns:
-      A base_test_result.TestRunResult() instance.
-    """
-    margin = 8
-    print '[ %-*s ] %s' % (margin, 'RUN', self.tagged_name)
-    logging.info('Running linker test: %s', self.tagged_name)
-
-    # Create command-line file on device.
-    command_line_flags = ''
-    if self.is_low_memory:
-      command_line_flags = '--low-memory-device'
-    device.WriteFile(_COMMAND_LINE_FILE, command_line_flags)
-
-    # Run the test.
-    status, logs = self._RunTest(device)
-
-    result_text = 'OK'
-    if status == ResultType.FAIL:
-      result_text = 'FAILED'
-    elif status == ResultType.TIMEOUT:
-      result_text = 'TIMEOUT'
-    print '[ %*s ] %s' % (margin, result_text, self.tagged_name)
-
-    results = base_test_result.TestRunResults()
-    results.AddResult(
-        base_test_result.BaseTestResult(
-            self.tagged_name,
-            status,
-            log=logs))
-
-    return results
-
-  def __str__(self):
-    return self.tagged_name
-
-  def __repr__(self):
-    return self.tagged_name
-
-
-class LinkerSharedRelroTest(LinkerTestCaseBase):
-  """A linker test case to check the status of shared RELRO sections.
-
-    The core of the checks performed here are pretty simple:
-
-      - Clear the logcat and start recording with an appropriate set of filters.
-      - Create the command-line appropriate for the test-case.
-      - Start the activity (always forcing a cold start).
-      - Every second, look at the current content of the filtered logcat lines
-        and look for instances of the following:
-
-            BROWSER_LINKER_TEST: <status>
-            RENDERER_LINKER_TEST: <status>
-
-        where <status> can be either FAIL or SUCCESS. These lines can appear
-        in any order in the logcat. Once both browser and renderer status are
-        found, stop the loop. Otherwise timeout after 30 seconds.
-
-        Note that there can be other lines beginning with BROWSER_LINKER_TEST:
-        and RENDERER_LINKER_TEST:, but are not followed by a <status> code.
-
-      - The test case passes if the <status> for both the browser and renderer
-        process are SUCCESS. Otherwise its a fail.
-  """
-  def _RunTest(self, device):
-    # Wait up to 30 seconds until the linker test status is in the logcat.
-    return _StartActivityAndWaitForLinkerTestStatus(device, timeout=30)
-
-
-class LinkerLibraryAddressTest(LinkerTestCaseBase):
-  """A test case that verifies library load addresses.
-
-     The point of this check is to ensure that the libraries are loaded
-     according to the following rules:
-
-     - For low-memory devices, they should always be loaded at the same address
-       in both browser and renderer processes, both below 0x4000_0000.
-
-     - For regular devices, the browser process should load libraries above
-       0x4000_0000, and renderer ones below it.
-  """
-  def _RunTest(self, device):
-    result, logs = _StartActivityAndWaitForLinkerTestStatus(device, timeout=30)
-
-    # Return immediately in case of timeout.
-    if result == ResultType.TIMEOUT:
-      return result, logs
-
-    # Collect the library load addresses in the browser and renderer processes.
-    browser_libs, renderer_libs = _ExtractLibraryLoadAddressesFromLogcat(logs)
-
-    logging.info('Browser libraries: %s', browser_libs)
-    logging.info('Renderer libraries: %s', renderer_libs)
-
-    # Check that the same libraries are loaded into both processes:
-    browser_set = set(browser_libs.keys())
-    renderer_set = set(renderer_libs.keys())
-    if browser_set != renderer_set:
-      logging.error('Library set mistmach browser=%s renderer=%s',
-          browser_libs.keys(), renderer_libs.keys())
-      return ResultType.FAIL, logs
-
-    # And that there are not empty.
-    if not browser_set:
-      logging.error('No libraries loaded in any process!')
-      return ResultType.FAIL, logs
-
-    # Check that the renderer libraries are loaded at 'low-addresses'. i.e.
-    # below 0x4000_0000, for every kind of device.
-    memory_boundary = 0x40000000
-    bad_libs = []
-    for lib_name, lib_address in renderer_libs.iteritems():
-      if lib_address >= memory_boundary:
-        bad_libs.append((lib_name, lib_address))
-
-    if bad_libs:
-      logging.error('Renderer libraries loaded at high addresses: %s', bad_libs)
-      return ResultType.FAIL, logs
-
-    browser_config = _GetBrowserSharedRelroConfig()
-    if not browser_config:
-      return ResultType.FAIL, 'Bad linker source configuration'
-
-    if browser_config == 'ALWAYS' or \
-        (browser_config == 'LOW_RAM_ONLY' and self.is_low_memory):
-      # The libraries must all be loaded at the same addresses. This also
-      # implicitly checks that the browser libraries are at low addresses.
-      addr_mismatches = []
-      for lib_name, lib_address in browser_libs.iteritems():
-        lib_address2 = renderer_libs[lib_name]
-        if lib_address != lib_address2:
-          addr_mismatches.append((lib_name, lib_address, lib_address2))
-
-      if addr_mismatches:
-        logging.error('Library load address mismatches: %s',
-            addr_mismatches)
-        return ResultType.FAIL, logs
-
-    # Otherwise, check that libraries are loaded at 'high-addresses'.
-    # Note that for low-memory devices, the previous checks ensure that they
-    # were loaded at low-addresses.
-    else:
-      bad_libs = []
-      for lib_name, lib_address in browser_libs.iteritems():
-        if lib_address < memory_boundary:
-          bad_libs.append((lib_name, lib_address))
-
-      if bad_libs:
-        logging.error('Browser libraries loaded at low addresses: %s', bad_libs)
-        return ResultType.FAIL, logs
-
-    # Everything's ok.
-    return ResultType.PASS, logs
-
-
-class LinkerRandomizationTest(LinkerTestCaseBase):
-  """A linker test case to check that library load address randomization works
-     properly between successive starts of the test program/activity.
-
-     This starts the activity several time (each time forcing a new process
-     creation) and compares the load addresses of the libraries in them to
-     detect that they have changed.
-
-     In theory, two successive runs could (very rarely) use the same load
-     address, so loop 5 times and compare the values there. It is assumed
-     that if there are more than one pair of identical addresses, then the
-     load addresses are not random enough for this test.
-  """
-  def _RunTest(self, device):
-    max_loops = 5
-    browser_lib_map_list = []
-    renderer_lib_map_list = []
-    logs_list = []
-    for _ in range(max_loops):
-      # Start the activity.
-      result, logs = _StartActivityAndWaitForLinkerTestStatus(
-          device, timeout=30)
-      if result == ResultType.TIMEOUT:
-        # Something bad happened. Return immediately.
-        return result, logs
-
-      # Collect library addresses.
-      browser_libs, renderer_libs = _ExtractLibraryLoadAddressesFromLogcat(logs)
-      browser_lib_map_list.append(browser_libs)
-      renderer_lib_map_list.append(renderer_libs)
-      logs_list.append(logs)
-
-    # Check randomization in the browser libraries.
-    logs = '\n'.join(logs_list)
-
-    browser_status, browser_logs = _CheckLoadAddressRandomization(
-        browser_lib_map_list, 'Browser')
-
-    renderer_status, renderer_logs = _CheckLoadAddressRandomization(
-        renderer_lib_map_list, 'Renderer')
-
-    browser_config = _GetBrowserSharedRelroConfig()
-    if not browser_config:
-      return ResultType.FAIL, 'Bad linker source configuration'
-
-    if not browser_status:
-      if browser_config == 'ALWAYS' or \
-          (browser_config == 'LOW_RAM_ONLY' and self.is_low_memory):
-        return ResultType.FAIL, browser_logs
-
-      # IMPORTANT NOTE: The system's ASLR implementation seems to be very poor
-      # when starting an activity process in a loop with "adb shell am start".
-      #
-      # When simulating a regular device, loading libraries in the browser
-      # process uses a simple mmap(NULL, ...) to let the kernel device where to
-      # load the file (this is similar to what System.loadLibrary() does).
-      #
-      # Unfortunately, at least in the context of this test, doing so while
-      # restarting the activity with the activity manager very, very, often
-      # results in the system using the same load address for all 5 runs, or
-      # sometimes only 4 out of 5.
-      #
-      # This has been tested experimentally on both Android 4.1.2 and 4.3.
-      #
-      # Note that this behaviour doesn't seem to happen when starting an
-      # application 'normally', i.e. when using the application launcher to
-      # start the activity.
-      logging.info('Ignoring system\'s low randomization of browser libraries' +
-                   ' for regular devices')
-
-    if not renderer_status:
-      return ResultType.FAIL, renderer_logs
-
-    return ResultType.PASS, logs
diff --git a/build/android/pylib/linker/test_runner.py b/build/android/pylib/linker/test_runner.py
deleted file mode 100644
index b6803e4..0000000
--- a/build/android/pylib/linker/test_runner.py
+++ /dev/null
@@ -1,98 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Runs linker tests on a particular device."""
-
-import logging
-import os.path
-import sys
-import traceback
-
-from pylib import constants
-from pylib.base import base_test_result
-from pylib.base import base_test_runner
-from pylib.linker import test_case
-from pylib.utils import apk_helper
-
-
-# Name of the Android package to install for this to work.
-_PACKAGE_NAME = 'ChromiumLinkerTest'
-
-
-class LinkerExceptionTestResult(base_test_result.BaseTestResult):
-  """Test result corresponding to a python exception in a host-custom test."""
-
-  def __init__(self, test_name, exc_info):
-    """Constructs a LinkerExceptionTestResult object.
-
-    Args:
-      test_name: name of the test which raised an exception.
-      exc_info: exception info, ostensibly from sys.exc_info().
-    """
-    exc_type, exc_value, exc_traceback = exc_info
-    trace_info = ''.join(traceback.format_exception(exc_type, exc_value,
-                                                    exc_traceback))
-    log_msg = 'Exception:\n' + trace_info
-
-    super(LinkerExceptionTestResult, self).__init__(
-        test_name,
-        base_test_result.ResultType.FAIL,
-        log="%s %s" % (exc_type, log_msg))
-
-
-class LinkerTestRunner(base_test_runner.BaseTestRunner):
-  """Orchestrates running a set of linker tests.
-
-  Any Python exceptions in the tests are caught and translated into a failed
-  result, rather than being re-raised on the main thread.
-  """
-
-  #override
-  def __init__(self, device, tool):
-    """Creates a new LinkerTestRunner.
-
-    Args:
-      device: Attached android device.
-      tool: Name of the Valgrind tool.
-    """
-    super(LinkerTestRunner, self).__init__(device, tool)
-
-  #override
-  def InstallTestPackage(self):
-    apk_path = os.path.join(
-        constants.GetOutDirectory(), 'apks', '%s.apk' % _PACKAGE_NAME)
-
-    if not os.path.exists(apk_path):
-      raise Exception('%s not found, please build it' % apk_path)
-
-    self.device.Install(apk_path)
-
-  #override
-  def RunTest(self, test):
-    """Sets up and runs a test case.
-
-    Args:
-      test: An object which is ostensibly a subclass of LinkerTestCaseBase.
-
-    Returns:
-      A TestRunResults object which contains the result produced by the test
-      and, in the case of a failure, the test that should be retried.
-    """
-
-    assert isinstance(test, test_case.LinkerTestCaseBase)
-
-    try:
-      results = test.Run(self.device)
-    except Exception:
-      logging.exception('Caught exception while trying to run test: ' +
-                        test.tagged_name)
-      exc_info = sys.exc_info()
-      results = base_test_result.TestRunResults()
-      results.AddResult(LinkerExceptionTestResult(
-          test.tagged_name, exc_info))
-
-    if not results.DidRunPass():
-      return results, test
-    else:
-      return results, None
diff --git a/build/android/pylib/local/__init__.py b/build/android/pylib/local/__init__.py
deleted file mode 100644
index 4d6aabb..0000000
--- a/build/android/pylib/local/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
diff --git a/build/android/pylib/local/device/__init__.py b/build/android/pylib/local/device/__init__.py
deleted file mode 100644
index 4d6aabb..0000000
--- a/build/android/pylib/local/device/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
diff --git a/build/android/pylib/local/device/local_device_environment.py b/build/android/pylib/local/device/local_device_environment.py
deleted file mode 100644
index 04f9ab7..0000000
--- a/build/android/pylib/local/device/local_device_environment.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from pylib.base import environment
-from pylib.device import adb_wrapper
-from pylib.device import device_errors
-from pylib.device import device_utils
-from pylib.utils import parallelizer
-
-
-class LocalDeviceEnvironment(environment.Environment):
-
-  def __init__(self, args, _error_func):
-    super(LocalDeviceEnvironment, self).__init__()
-    self._device_serial = args.test_device
-    self._devices = []
-    self._max_tries = 1 + args.num_retries
-    self._tool_name = args.tool
-
-  #override
-  def SetUp(self):
-    available_devices = device_utils.DeviceUtils.HealthyDevices()
-    if not available_devices:
-      raise device_errors.NoDevicesError
-    if self._device_serial:
-      self._devices = [d for d in available_devices
-                       if d.adb.GetDeviceSerial() == self._device_serial]
-      if not self._devices:
-        raise device_errors.DeviceUnreachableError(
-            'Could not find device %r' % self._device_serial)
-    else:
-      self._devices = available_devices
-
-  @property
-  def devices(self):
-    return self._devices
-
-  @property
-  def parallel_devices(self):
-    return parallelizer.SyncParallelizer(self._devices)
-
-  @property
-  def max_tries(self):
-    return self._max_tries
-
-  @property
-  def tool(self):
-    return self._tool_name
-
-  #override
-  def TearDown(self):
-    pass
-
diff --git a/build/android/pylib/local/device/local_device_instrumentation_test_run.py b/build/android/pylib/local/device/local_device_instrumentation_test_run.py
deleted file mode 100644
index e388fce..0000000
--- a/build/android/pylib/local/device/local_device_instrumentation_test_run.py
+++ /dev/null
@@ -1,207 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging
-import re
-import time
-
-from pylib import flag_changer
-from pylib.base import base_test_result
-from pylib.base import test_run
-from pylib.constants import keyevent
-from pylib.device import device_errors
-from pylib.local.device import local_device_test_run
-
-
-TIMEOUT_ANNOTATIONS = [
-  ('Manual', 10 * 60 * 60),
-  ('IntegrationTest', 30 * 60),
-  ('External', 10 * 60),
-  ('EnormousTest', 10 * 60),
-  ('LargeTest', 5 * 60),
-  ('MediumTest', 3 * 60),
-  ('SmallTest', 1 * 60),
-]
-
-
-# TODO(jbudorick): Make this private once the instrumentation test_runner is
-# deprecated.
-def DidPackageCrashOnDevice(package_name, device):
-  # Dismiss any error dialogs. Limit the number in case we have an error
-  # loop or we are failing to dismiss.
-  try:
-    for _ in xrange(10):
-      package = _DismissCrashDialog(device)
-      if not package:
-        return False
-      # Assume test package convention of ".test" suffix
-      if package in package_name:
-        return True
-  except device_errors.CommandFailedError:
-    logging.exception('Error while attempting to dismiss crash dialog.')
-  return False
-
-
-_CURRENT_FOCUS_CRASH_RE = re.compile(
-    r'\s*mCurrentFocus.*Application (Error|Not Responding): (\S+)}')
-
-
-def _DismissCrashDialog(device):
-  # TODO(jbudorick): Try to grep the output on the device instead of using
-  # large_output if/when DeviceUtils exposes a public interface for piped
-  # shell command handling.
-  for l in device.RunShellCommand(
-      ['dumpsys', 'window', 'windows'], check_return=True, large_output=True):
-    m = re.match(_CURRENT_FOCUS_CRASH_RE, l)
-    if m:
-      device.SendKeyEvent(keyevent.KEYCODE_DPAD_RIGHT)
-      device.SendKeyEvent(keyevent.KEYCODE_DPAD_RIGHT)
-      device.SendKeyEvent(keyevent.KEYCODE_ENTER)
-      return m.group(2)
-
-  return None
-
-
-class LocalDeviceInstrumentationTestRun(
-    local_device_test_run.LocalDeviceTestRun):
-  def __init__(self, env, test_instance):
-    super(LocalDeviceInstrumentationTestRun, self).__init__(env, test_instance)
-    self._flag_changers = {}
-
-  def TestPackage(self):
-    return None
-
-  def SetUp(self):
-    def substitute_external_storage(d, external_storage):
-      if not d:
-        return external_storage
-      elif isinstance(d, list):
-        return '/'.join(p if p else external_storage for p in d)
-      else:
-        return d
-
-    def individual_device_set_up(dev, host_device_tuples):
-      dev.Install(self._test_instance.apk_under_test)
-      dev.Install(self._test_instance.test_apk)
-
-      external_storage = dev.GetExternalStoragePath()
-      host_device_tuples = [
-          (h, substitute_external_storage(d, external_storage))
-          for h, d in host_device_tuples]
-      logging.info('instrumentation data deps:')
-      for h, d in host_device_tuples:
-        logging.info('%r -> %r', h, d)
-      dev.PushChangedFiles(host_device_tuples)
-      if self._test_instance.flags:
-        if not self._test_instance.package_info:
-          logging.error("Couldn't set flags: no package info")
-        elif not self._test_instance.package_info.cmdline_file:
-          logging.error("Couldn't set flags: no cmdline_file")
-        else:
-          self._flag_changers[str(dev)] = flag_changer.FlagChanger(
-              dev, self._test_instance.package_info.cmdline_file)
-          logging.debug('Attempting to set flags: %r',
-                        self._test_instance.flags)
-          self._flag_changers[str(dev)].AddFlags(self._test_instance.flags)
-
-    self._env.parallel_devices.pMap(
-        individual_device_set_up,
-        self._test_instance.GetDataDependencies())
-
-  def TearDown(self):
-    def individual_device_tear_down(dev):
-      if str(dev) in self._flag_changers:
-        self._flag_changers[str(dev)].Restore()
-
-    self._env.parallel_devices.pMap(individual_device_tear_down)
-
-  #override
-  def _CreateShards(self, tests):
-    return tests
-
-  #override
-  def _GetTests(self):
-    return self._test_instance.GetTests()
-
-  #override
-  def _GetTestName(self, test):
-    return '%s#%s' % (test['class'], test['method'])
-
-  #override
-  def _RunTest(self, device, test):
-    extras = self._test_instance.GetHttpServerEnvironmentVars()
-
-    if isinstance(test, list):
-      if not self._test_instance.driver_apk:
-        raise Exception('driver_apk does not exist. '
-                        'Please build it and try again.')
-
-      def name_and_timeout(t):
-        n = self._GetTestName(t)
-        i = self._GetTimeoutFromAnnotations(t['annotations'], n)
-        return (n, i)
-
-      test_names, timeouts = zip(*(name_and_timeout(t) for t in test))
-
-      test_name = ','.join(test_names)
-      target = '%s/%s' % (
-          self._test_instance.driver_package,
-          self._test_instance.driver_name)
-      extras.update(
-          self._test_instance.GetDriverEnvironmentVars(
-              test_list=test_names))
-      timeout = sum(timeouts)
-    else:
-      test_name = self._GetTestName(test)
-      target = '%s/%s' % (
-          self._test_instance.test_package, self._test_instance.test_runner)
-      extras['class'] = test_name
-      timeout = self._GetTimeoutFromAnnotations(test['annotations'], test_name)
-
-    logging.info('preparing to run %s: %s' % (test_name, test))
-
-    time_ms = lambda: int(time.time() * 1e3)
-    start_ms = time_ms()
-    output = device.StartInstrumentation(
-        target, raw=True, extras=extras, timeout=timeout, retries=0)
-    duration_ms = time_ms() - start_ms
-
-    # TODO(jbudorick): Make instrumentation tests output a JSON so this
-    # doesn't have to parse the output.
-    logging.debug('output from %s:', test_name)
-    for l in output:
-      logging.debug('  %s', l)
-
-    result_code, result_bundle, statuses = (
-        self._test_instance.ParseAmInstrumentRawOutput(output))
-    results = self._test_instance.GenerateTestResults(
-        result_code, result_bundle, statuses, start_ms, duration_ms)
-    if DidPackageCrashOnDevice(self._test_instance.test_package, device):
-      for r in results:
-        if r.GetType() == base_test_result.ResultType.UNKNOWN:
-          r.SetType(base_test_result.ResultType.CRASH)
-    return results
-
-  #override
-  def _ShouldShard(self):
-    return True
-
-  @staticmethod
-  def _GetTimeoutFromAnnotations(annotations, test_name):
-    for k, v in TIMEOUT_ANNOTATIONS:
-      if k in annotations:
-        timeout = v
-    else:
-      logging.warning('Using default 1 minute timeout for %s' % test_name)
-      timeout = 60
-
-    try:
-      scale = int(annotations.get('TimeoutScale', 1))
-    except ValueError as e:
-      logging.warning("Non-integer value of TimeoutScale ignored. (%s)", str(e))
-      scale = 1
-    timeout *= scale
-
-    return timeout
-
diff --git a/build/android/pylib/local/device/local_device_test_run.py b/build/android/pylib/local/device/local_device_test_run.py
deleted file mode 100644
index fa24eb1..0000000
--- a/build/android/pylib/local/device/local_device_test_run.py
+++ /dev/null
@@ -1,99 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging
-
-from pylib import valgrind_tools
-from pylib.base import base_test_result
-from pylib.base import test_run
-from pylib.base import test_collection
-
-
-class LocalDeviceTestRun(test_run.TestRun):
-
-  def __init__(self, env, test_instance):
-    super(LocalDeviceTestRun, self).__init__(env, test_instance)
-    self._tools = {}
-
-  #override
-  def RunTests(self):
-    tests = self._GetTests()
-
-    def run_tests_on_device(dev, tests):
-      r = base_test_result.TestRunResults()
-      for test in tests:
-        result = self._RunTest(dev, test)
-        if isinstance(result, base_test_result.BaseTestResult):
-          r.AddResult(result)
-        elif isinstance(result, list):
-          r.AddResults(result)
-        else:
-          raise Exception('Unexpected result type: %s' % type(result).__name__)
-        if isinstance(tests, test_collection.TestCollection):
-          tests.test_completed()
-      return r
-
-    tries = 0
-    results = base_test_result.TestRunResults()
-    all_fail_results = {}
-    while tries < self._env.max_tries and tests:
-      logging.debug('try %d, will run %d tests:', tries, len(tests))
-      for t in tests:
-        logging.debug('  %s', t)
-
-      if self._ShouldShard():
-        tc = test_collection.TestCollection(self._CreateShards(tests))
-        try_results = self._env.parallel_devices.pMap(
-            run_tests_on_device, tc).pGet(None)
-      else:
-        try_results = self._env.parallel_devices.pMap(
-            run_tests_on_device, tests).pGet(None)
-      for try_result in try_results:
-        for result in try_result.GetAll():
-          if result.GetType() in (base_test_result.ResultType.PASS,
-                                  base_test_result.ResultType.SKIP):
-            results.AddResult(result)
-          else:
-            all_fail_results[result.GetName()] = result
-
-      results_names = set(r.GetName() for r in results.GetAll())
-      tests = [t for t in tests if self._GetTestName(t) not in results_names]
-      tries += 1
-
-    all_unknown_test_names = set(self._GetTestName(t) for t in tests)
-    all_failed_test_names = set(all_fail_results.iterkeys())
-
-    unknown_tests = all_unknown_test_names.difference(all_failed_test_names)
-    failed_tests = all_failed_test_names.intersection(all_unknown_test_names)
-
-    if unknown_tests:
-      results.AddResults(
-          base_test_result.BaseTestResult(
-              u, base_test_result.ResultType.UNKNOWN)
-          for u in unknown_tests)
-    if failed_tests:
-      results.AddResults(all_fail_results[f] for f in failed_tests)
-
-    return results
-
-  def GetTool(self, device):
-    if not str(device) in self._tools:
-      self._tools[str(device)] = valgrind_tools.CreateTool(
-          self._env.tool, device)
-    return self._tools[str(device)]
-
-  def _CreateShards(self, tests):
-    raise NotImplementedError
-
-  def _GetTestName(self, test):
-    return test
-
-  def _GetTests(self):
-    raise NotImplementedError
-
-  def _RunTest(self, device, test):
-    raise NotImplementedError
-
-  def _ShouldShard(self):
-    raise NotImplementedError
diff --git a/build/android/pylib/local/local_test_server_spawner.py b/build/android/pylib/local/local_test_server_spawner.py
deleted file mode 100644
index 77f552e..0000000
--- a/build/android/pylib/local/local_test_server_spawner.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from pylib import chrome_test_server_spawner
-from pylib import forwarder
-from pylib.base import test_server
-
-
-class LocalTestServerSpawner(test_server.TestServer):
-
-  def __init__(self, port, device, tool):
-    super(LocalTestServerSpawner, self).__init__()
-    self._device = device
-    self._spawning_server = chrome_test_server_spawner.SpawningServer(
-        port, device, tool)
-    self._tool = tool
-
-  @property
-  def server_address(self):
-    return self._spawning_server.server.server_address
-
-  @property
-  def port(self):
-    return self.server_address[1]
-
-  #override
-  def SetUp(self):
-    self._device.WriteFile(
-        '%s/net-test-server-ports' % self._device.GetExternalStoragePath(),
-        '%s:0' % str(self.port))
-    forwarder.Forwarder.Map(
-        [(self.port, self.port)], self._device, self._tool)
-    self._spawning_server.Start()
-
-  #override
-  def Reset(self):
-    self._spawning_server.CleanupState()
-
-  #override
-  def TearDown(self):
-    self.Reset()
-    self._spawning_server.Stop()
-    forwarder.Forwarder.UnmapDevicePort(self.port, self._device)
-
diff --git a/build/android/pylib/monkey/__init__.py b/build/android/pylib/monkey/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/build/android/pylib/monkey/__init__.py
+++ /dev/null
diff --git a/build/android/pylib/monkey/setup.py b/build/android/pylib/monkey/setup.py
deleted file mode 100644
index fe690a5..0000000
--- a/build/android/pylib/monkey/setup.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Generates test runner factory and tests for monkey tests."""
-
-from pylib.monkey import test_runner
-
-
-def Setup(test_options):
-  """Create and return the test runner factory and tests.
-
-  Args:
-    test_options: A MonkeyOptions object.
-
-  Returns:
-    A tuple of (TestRunnerFactory, tests).
-  """
-  # Token to replicate across devices as the "test". The TestRunner does all of
-  # the work to run the test.
-  tests = ['MonkeyTest']
-
-  def TestRunnerFactory(device, shard_index):
-    return test_runner.TestRunner(
-        test_options, device, shard_index)
-
-  return (TestRunnerFactory, tests)
diff --git a/build/android/pylib/monkey/test_options.py b/build/android/pylib/monkey/test_options.py
deleted file mode 100644
index 54d3d08..0000000
--- a/build/android/pylib/monkey/test_options.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Defines the MonkeyOptions named tuple."""
-
-import collections
-
-MonkeyOptions = collections.namedtuple('MonkeyOptions', [
-    'verbose_count',
-    'package',
-    'event_count',
-    'category',
-    'throttle',
-    'seed',
-    'extra_args'])
diff --git a/build/android/pylib/monkey/test_runner.py b/build/android/pylib/monkey/test_runner.py
deleted file mode 100644
index 3fd1797..0000000
--- a/build/android/pylib/monkey/test_runner.py
+++ /dev/null
@@ -1,106 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Runs a monkey test on a single device."""
-
-import logging
-import random
-
-from pylib import constants
-from pylib.base import base_test_result
-from pylib.base import base_test_runner
-from pylib.device import device_errors
-from pylib.device import intent
-
-_CHROME_PACKAGE = constants.PACKAGE_INFO['chrome'].package
-
-class TestRunner(base_test_runner.BaseTestRunner):
-  """A TestRunner instance runs a monkey test on a single device."""
-
-  def __init__(self, test_options, device, _):
-    super(TestRunner, self).__init__(device, None)
-    self._options = test_options
-    self._package = constants.PACKAGE_INFO[self._options.package].package
-    self._activity = constants.PACKAGE_INFO[self._options.package].activity
-
-  def _LaunchMonkeyTest(self):
-    """Runs monkey test for a given package.
-
-    Returns:
-      Output from the monkey command on the device.
-    """
-
-    timeout_ms = self._options.event_count * self._options.throttle * 1.5
-
-    cmd = ['monkey',
-           '-p %s' % self._package,
-           ' '.join(['-c %s' % c for c in self._options.category]),
-           '--throttle %d' % self._options.throttle,
-           '-s %d' % (self._options.seed or random.randint(1, 100)),
-           '-v ' * self._options.verbose_count,
-           '--monitor-native-crashes',
-           '--kill-process-after-error',
-           self._options.extra_args,
-           '%d' % self._options.event_count]
-    return self.device.RunShellCommand(' '.join(cmd), timeout=timeout_ms)
-
-  def RunTest(self, test_name):
-    """Run a Monkey test on the device.
-
-    Args:
-      test_name: String to use for logging the test result.
-
-    Returns:
-      A tuple of (TestRunResults, retry).
-    """
-    self.device.StartActivity(
-        intent.Intent(package=self._package, activity=self._activity,
-                      action='android.intent.action.MAIN'),
-        blocking=True, force_stop=True)
-
-    # Chrome crashes are not always caught by Monkey test runner.
-    # Verify Chrome has the same PID before and after the test.
-    before_pids = self.device.GetPids(self._package)
-
-    # Run the test.
-    output = ''
-    if before_pids:
-      output = '\n'.join(self._LaunchMonkeyTest())
-      after_pids = self.device.GetPids(self._package)
-
-    crashed = True
-    if not self._package in before_pids:
-      logging.error('Failed to start the process.')
-    elif not self._package in after_pids:
-      logging.error('Process %s has died.', before_pids[self._package])
-    elif before_pids[self._package] != after_pids[self._package]:
-      logging.error('Detected process restart %s -> %s',
-                    before_pids[self._package], after_pids[self._package])
-    else:
-      crashed = False
-
-    results = base_test_result.TestRunResults()
-    success_pattern = 'Events injected: %d' % self._options.event_count
-    if success_pattern in output and not crashed:
-      result = base_test_result.BaseTestResult(
-          test_name, base_test_result.ResultType.PASS, log=output)
-    else:
-      result = base_test_result.BaseTestResult(
-          test_name, base_test_result.ResultType.FAIL, log=output)
-      if 'chrome' in self._options.package:
-        logging.warning('Starting MinidumpUploadService...')
-        # TODO(jbudorick): Update this after upstreaming.
-        minidump_intent = intent.Intent(
-            action='%s.crash.ACTION_FIND_ALL' % _CHROME_PACKAGE,
-            package=self._package,
-            activity='%s.crash.MinidumpUploadService' % _CHROME_PACKAGE)
-        try:
-          self.device.RunShellCommand(
-              ['am', 'startservice'] + minidump_intent.am_args,
-              as_root=True, check_return=True)
-        except device_errors.CommandFailedError:
-          logging.exception('Failed to start MinidumpUploadService')
-
-    results.AddResult(result)
-    return results, False
diff --git a/build/android/pylib/perf/__init__.py b/build/android/pylib/perf/__init__.py
deleted file mode 100644
index 9228df8..0000000
--- a/build/android/pylib/perf/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
diff --git a/build/android/pylib/perf/cache_control.py b/build/android/pylib/perf/cache_control.py
deleted file mode 100644
index 8065cf9..0000000
--- a/build/android/pylib/perf/cache_control.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from pylib import android_commands
-from pylib.device import device_utils
-
-class CacheControl(object):
-  _DROP_CACHES = '/proc/sys/vm/drop_caches'
-
-  def __init__(self, device):
-    # TODO(jbudorick) Remove once telemetry gets switched over.
-    if isinstance(device, android_commands.AndroidCommands):
-      device = device_utils.DeviceUtils(device)
-    self._device = device
-
-  def DropRamCaches(self):
-    """Drops the filesystem ram caches for performance testing."""
-    self._device.RunShellCommand('sync', as_root=True)
-    self._device.WriteFile(CacheControl._DROP_CACHES, '3', as_root=True)
-
diff --git a/build/android/pylib/perf/perf_control.py b/build/android/pylib/perf/perf_control.py
deleted file mode 100644
index f89f397..0000000
--- a/build/android/pylib/perf/perf_control.py
+++ /dev/null
@@ -1,161 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import atexit
-import logging
-
-from pylib import android_commands
-from pylib.device import device_errors
-from pylib.device import device_utils
-
-
-class PerfControl(object):
-  """Provides methods for setting the performance mode of a device."""
-  _CPU_PATH = '/sys/devices/system/cpu'
-  _KERNEL_MAX = '/sys/devices/system/cpu/kernel_max'
-
-  def __init__(self, device):
-    # TODO(jbudorick) Remove once telemetry gets switched over.
-    if isinstance(device, android_commands.AndroidCommands):
-      device = device_utils.DeviceUtils(device)
-    self._device = device
-    # this will raise an AdbCommandFailedError if no CPU files are found
-    self._cpu_files = self._device.RunShellCommand(
-        'ls -d cpu[0-9]*', cwd=self._CPU_PATH, check_return=True, as_root=True)
-    assert self._cpu_files, 'Failed to detect CPUs.'
-    self._cpu_file_list = ' '.join(self._cpu_files)
-    logging.info('CPUs found: %s', self._cpu_file_list)
-    self._have_mpdecision = self._device.FileExists('/system/bin/mpdecision')
-
-  def SetHighPerfMode(self):
-    """Sets the highest stable performance mode for the device."""
-    try:
-      self._device.EnableRoot()
-    except device_errors.CommandFailedError:
-      message = 'Need root for performance mode. Results may be NOISY!!'
-      logging.warning(message)
-      # Add an additional warning at exit, such that it's clear that any results
-      # may be different/noisy (due to the lack of intended performance mode).
-      atexit.register(logging.warning, message)
-      return
-
-    product_model = self._device.product_model
-    # TODO(epenner): Enable on all devices (http://crbug.com/383566)
-    if 'Nexus 4' == product_model:
-      self._ForceAllCpusOnline(True)
-      if not self._AllCpusAreOnline():
-        logging.warning('Failed to force CPUs online. Results may be NOISY!')
-      self._SetScalingGovernorInternal('performance')
-    elif 'Nexus 5' == product_model:
-      self._ForceAllCpusOnline(True)
-      if not self._AllCpusAreOnline():
-        logging.warning('Failed to force CPUs online. Results may be NOISY!')
-      self._SetScalingGovernorInternal('performance')
-      self._SetScalingMaxFreq(1190400)
-      self._SetMaxGpuClock(200000000)
-    else:
-      self._SetScalingGovernorInternal('performance')
-
-  def SetPerfProfilingMode(self):
-    """Enables all cores for reliable perf profiling."""
-    self._ForceAllCpusOnline(True)
-    self._SetScalingGovernorInternal('performance')
-    if not self._AllCpusAreOnline():
-      if not self._device.HasRoot():
-        raise RuntimeError('Need root to force CPUs online.')
-      raise RuntimeError('Failed to force CPUs online.')
-
-  def SetDefaultPerfMode(self):
-    """Sets the performance mode for the device to its default mode."""
-    if not self._device.HasRoot():
-      return
-    product_model = self._device.product_model
-    if 'Nexus 5' == product_model:
-      if self._AllCpusAreOnline():
-        self._SetScalingMaxFreq(2265600)
-        self._SetMaxGpuClock(450000000)
-
-    governor_mode = {
-        'GT-I9300': 'pegasusq',
-        'Galaxy Nexus': 'interactive',
-        'Nexus 4': 'ondemand',
-        'Nexus 5': 'ondemand',
-        'Nexus 7': 'interactive',
-        'Nexus 10': 'interactive'
-    }.get(product_model, 'ondemand')
-    self._SetScalingGovernorInternal(governor_mode)
-    self._ForceAllCpusOnline(False)
-
-  def GetCpuInfo(self):
-    online = (output.rstrip() == '1' and status == 0
-              for (_, output, status) in self._ForEachCpu('cat "$CPU/online"'))
-    governor = (output.rstrip() if status == 0 else None
-                for (_, output, status)
-                in self._ForEachCpu('cat "$CPU/cpufreq/scaling_governor"'))
-    return zip(self._cpu_files, online, governor)
-
-  def _ForEachCpu(self, cmd):
-    script = '; '.join([
-        'for CPU in %s' % self._cpu_file_list,
-        'do %s' % cmd,
-        'echo -n "%~%$?%~%"',
-        'done'
-    ])
-    output = self._device.RunShellCommand(
-        script, cwd=self._CPU_PATH, check_return=True, as_root=True)
-    output = '\n'.join(output).split('%~%')
-    return zip(self._cpu_files, output[0::2], (int(c) for c in output[1::2]))
-
-  def _WriteEachCpuFile(self, path, value):
-    results = self._ForEachCpu(
-        'test -e "$CPU/{path}" && echo {value} > "$CPU/{path}"'.format(
-            path=path, value=value))
-    cpus = ' '.join(cpu for (cpu, _, status) in results if status == 0)
-    if cpus:
-      logging.info('Successfully set %s to %r on: %s', path, value, cpus)
-    else:
-      logging.warning('Failed to set %s to %r on any cpus')
-
-  def _SetScalingGovernorInternal(self, value):
-    self._WriteEachCpuFile('cpufreq/scaling_governor', value)
-
-  def _SetScalingMaxFreq(self, value):
-    self._WriteEachCpuFile('cpufreq/scaling_max_freq', '%d' % value)
-
-  def _SetMaxGpuClock(self, value):
-    self._device.WriteFile('/sys/class/kgsl/kgsl-3d0/max_gpuclk',
-                           str(value),
-                           as_root=True)
-
-  def _AllCpusAreOnline(self):
-    results = self._ForEachCpu('cat "$CPU/online"')
-    # TODO(epenner): Investigate why file may be missing
-    # (http://crbug.com/397118)
-    return all(output.rstrip() == '1' and status == 0
-               for (cpu, output, status) in results
-               if cpu != 'cpu0')
-
-  def _ForceAllCpusOnline(self, force_online):
-    """Enable all CPUs on a device.
-
-    Some vendors (or only Qualcomm?) hot-plug their CPUs, which can add noise
-    to measurements:
-    - In perf, samples are only taken for the CPUs that are online when the
-      measurement is started.
-    - The scaling governor can't be set for an offline CPU and frequency scaling
-      on newly enabled CPUs adds noise to both perf and tracing measurements.
-
-    It appears Qualcomm is the only vendor that hot-plugs CPUs, and on Qualcomm
-    this is done by "mpdecision".
-
-    """
-    if self._have_mpdecision:
-      script = 'stop mpdecision' if force_online else 'start mpdecision'
-      self._device.RunShellCommand(script, check_return=True, as_root=True)
-
-    if not self._have_mpdecision and not self._AllCpusAreOnline():
-      logging.warning('Unexpected cpu hot plugging detected.')
-
-    if force_online:
-      self._ForEachCpu('echo 1 > "$CPU/online"')
diff --git a/build/android/pylib/perf/perf_control_unittest.py b/build/android/pylib/perf/perf_control_unittest.py
deleted file mode 100644
index 69b8b46..0000000
--- a/build/android/pylib/perf/perf_control_unittest.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-# pylint: disable=W0212
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
-
-from pylib.device import device_utils
-from pylib.perf import perf_control
-
-class TestPerfControl(unittest.TestCase):
-  def setUp(self):
-    if not os.getenv('BUILDTYPE'):
-      os.environ['BUILDTYPE'] = 'Debug'
-
-    devices = device_utils.DeviceUtils.HealthyDevices()
-    self.assertGreater(len(devices), 0, 'No device attached!')
-    self._device = devices[0]
-
-  def testHighPerfMode(self):
-    perf = perf_control.PerfControl(self._device)
-    try:
-      perf.SetPerfProfilingMode()
-      cpu_info = perf.GetCpuInfo()
-      self.assertEquals(len(perf._cpu_files), len(cpu_info))
-      for _, online, governor in cpu_info:
-        self.assertTrue(online)
-        self.assertEquals('performance', governor)
-    finally:
-      perf.SetDefaultPerfMode()
-
-if __name__ == '__main__':
-  unittest.main()
diff --git a/build/android/pylib/perf/setup.py b/build/android/pylib/perf/setup.py
deleted file mode 100644
index 8e1fc28..0000000
--- a/build/android/pylib/perf/setup.py
+++ /dev/null
@@ -1,97 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Generates test runner factory and tests for performance tests."""
-
-import json
-import fnmatch
-import logging
-import os
-import shutil
-
-from pylib import constants
-from pylib import forwarder
-from pylib.device import device_list
-from pylib.device import device_utils
-from pylib.perf import test_runner
-from pylib.utils import test_environment
-
-
-def _GetAllDevices():
-  devices_path = os.path.join(os.environ.get('CHROMIUM_OUT_DIR', 'out'),
-                              device_list.LAST_DEVICES_FILENAME)
-  try:
-    devices = [device_utils.DeviceUtils(s)
-               for s in device_list.GetPersistentDeviceList(devices_path)]
-  except IOError as e:
-    logging.error('Unable to find %s [%s]', devices_path, e)
-    devices = device_utils.DeviceUtils.HealthyDevices()
-  return sorted(devices)
-
-
-def _GetStepsDictFromSingleStep(test_options):
-  # Running a single command, build the tests structure.
-  steps_dict = {
-    'version': 1,
-    'steps': {
-        'single_step': {
-          'device_affinity': 0,
-          'cmd': test_options.single_step
-        },
-    }
-  }
-  return steps_dict
-
-
-def _GetStepsDict(test_options):
-  if test_options.single_step:
-    return _GetStepsDictFromSingleStep(test_options)
-  if test_options.steps:
-    with file(test_options.steps, 'r') as f:
-      steps = json.load(f)
-
-      # Already using the new format.
-      assert steps['version'] == 1
-      return steps
-
-
-def Setup(test_options):
-  """Create and return the test runner factory and tests.
-
-  Args:
-    test_options: A PerformanceOptions object.
-
-  Returns:
-    A tuple of (TestRunnerFactory, tests, devices).
-  """
-  # TODO(bulach): remove this once the bot side lands. BUG=318369
-  constants.SetBuildType('Release')
-  if os.path.exists(constants.PERF_OUTPUT_DIR):
-    shutil.rmtree(constants.PERF_OUTPUT_DIR)
-  os.makedirs(constants.PERF_OUTPUT_DIR)
-
-  # Before running the tests, kill any leftover server.
-  test_environment.CleanupLeftoverProcesses()
-
-  # We want to keep device affinity, so return all devices ever seen.
-  all_devices = _GetAllDevices()
-
-  steps_dict = _GetStepsDict(test_options)
-  sorted_step_names = sorted(steps_dict['steps'].keys())
-
-  if test_options.test_filter:
-    sorted_step_names = fnmatch.filter(sorted_step_names,
-                                       test_options.test_filter)
-
-  flaky_steps = []
-  if test_options.flaky_steps:
-    with file(test_options.flaky_steps, 'r') as f:
-      flaky_steps = json.load(f)
-
-  def TestRunnerFactory(device, shard_index):
-    return test_runner.TestRunner(
-        test_options, device, shard_index, len(all_devices),
-        steps_dict, flaky_steps)
-
-  return (TestRunnerFactory, sorted_step_names, all_devices)
diff --git a/build/android/pylib/perf/surface_stats_collector.py b/build/android/pylib/perf/surface_stats_collector.py
deleted file mode 100644
index c7e7527..0000000
--- a/build/android/pylib/perf/surface_stats_collector.py
+++ /dev/null
@@ -1,191 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import Queue
-import datetime
-import logging
-import re
-import threading
-from pylib import android_commands
-from pylib.device import device_utils
-
-
-# Log marker containing SurfaceTexture timestamps.
-_SURFACE_TEXTURE_TIMESTAMPS_MESSAGE = 'SurfaceTexture update timestamps'
-_SURFACE_TEXTURE_TIMESTAMP_RE = r'\d+'
-
-
-class SurfaceStatsCollector(object):
-  """Collects surface stats for a SurfaceView from the output of SurfaceFlinger.
-
-  Args:
-    device: A DeviceUtils instance.
-  """
-
-  def __init__(self, device):
-    # TODO(jbudorick) Remove once telemetry gets switched over.
-    if isinstance(device, android_commands.AndroidCommands):
-      device = device_utils.DeviceUtils(device)
-    self._device = device
-    self._collector_thread = None
-    self._surface_before = None
-    self._get_data_event = None
-    self._data_queue = None
-    self._stop_event = None
-    self._warn_about_empty_data = True
-
-  def DisableWarningAboutEmptyData(self):
-    self._warn_about_empty_data = False
-
-  def Start(self):
-    assert not self._collector_thread
-
-    if self._ClearSurfaceFlingerLatencyData():
-      self._get_data_event = threading.Event()
-      self._stop_event = threading.Event()
-      self._data_queue = Queue.Queue()
-      self._collector_thread = threading.Thread(target=self._CollectorThread)
-      self._collector_thread.start()
-    else:
-      raise Exception('SurfaceFlinger not supported on this device.')
-
-  def Stop(self):
-    assert self._collector_thread
-    (refresh_period, timestamps) = self._GetDataFromThread()
-    if self._collector_thread:
-      self._stop_event.set()
-      self._collector_thread.join()
-      self._collector_thread = None
-    return (refresh_period, timestamps)
-
-  def _CollectorThread(self):
-    last_timestamp = 0
-    timestamps = []
-    retries = 0
-
-    while not self._stop_event.is_set():
-      self._get_data_event.wait(1)
-      try:
-        refresh_period, new_timestamps = self._GetSurfaceFlingerFrameData()
-        if refresh_period is None or timestamps is None:
-          retries += 1
-          if retries < 3:
-            continue
-          if last_timestamp:
-            # Some data has already been collected, but either the app
-            # was closed or there's no new data. Signal the main thread and
-            # wait.
-            self._data_queue.put((None, None))
-            self._stop_event.wait()
-            break
-          raise Exception('Unable to get surface flinger latency data')
-
-        timestamps += [timestamp for timestamp in new_timestamps
-                       if timestamp > last_timestamp]
-        if len(timestamps):
-          last_timestamp = timestamps[-1]
-
-        if self._get_data_event.is_set():
-          self._get_data_event.clear()
-          self._data_queue.put((refresh_period, timestamps))
-          timestamps = []
-      except Exception as e:
-        # On any error, before aborting, put the exception into _data_queue to
-        # prevent the main thread from waiting at _data_queue.get() infinitely.
-        self._data_queue.put(e)
-        raise
-
-  def _GetDataFromThread(self):
-    self._get_data_event.set()
-    ret = self._data_queue.get()
-    if isinstance(ret, Exception):
-      raise ret
-    return ret
-
-  def _ClearSurfaceFlingerLatencyData(self):
-    """Clears the SurfaceFlinger latency data.
-
-    Returns:
-      True if SurfaceFlinger latency is supported by the device, otherwise
-      False.
-    """
-    # The command returns nothing if it is supported, otherwise returns many
-    # lines of result just like 'dumpsys SurfaceFlinger'.
-    results = self._device.RunShellCommand(
-        'dumpsys SurfaceFlinger --latency-clear SurfaceView')
-    return not len(results)
-
-  def GetSurfaceFlingerPid(self):
-    results = self._device.RunShellCommand('ps | grep surfaceflinger')
-    if not results:
-      raise Exception('Unable to get surface flinger process id')
-    pid = results[0].split()[1]
-    return pid
-
-  def _GetSurfaceFlingerFrameData(self):
-    """Returns collected SurfaceFlinger frame timing data.
-
-    Returns:
-      A tuple containing:
-      - The display's nominal refresh period in milliseconds.
-      - A list of timestamps signifying frame presentation times in
-        milliseconds.
-      The return value may be (None, None) if there was no data collected (for
-      example, if the app was closed before the collector thread has finished).
-    """
-    # adb shell dumpsys SurfaceFlinger --latency <window name>
-    # prints some information about the last 128 frames displayed in
-    # that window.
-    # The data returned looks like this:
-    # 16954612
-    # 7657467895508   7657482691352   7657493499756
-    # 7657484466553   7657499645964   7657511077881
-    # 7657500793457   7657516600576   7657527404785
-    # (...)
-    #
-    # The first line is the refresh period (here 16.95 ms), it is followed
-    # by 128 lines w/ 3 timestamps in nanosecond each:
-    # A) when the app started to draw
-    # B) the vsync immediately preceding SF submitting the frame to the h/w
-    # C) timestamp immediately after SF submitted that frame to the h/w
-    #
-    # The difference between the 1st and 3rd timestamp is the frame-latency.
-    # An interesting data is when the frame latency crosses a refresh period
-    # boundary, this can be calculated this way:
-    #
-    # ceil((C - A) / refresh-period)
-    #
-    # (each time the number above changes, we have a "jank").
-    # If this happens a lot during an animation, the animation appears
-    # janky, even if it runs at 60 fps in average.
-    #
-    # We use the special "SurfaceView" window name because the statistics for
-    # the activity's main window are not updated when the main web content is
-    # composited into a SurfaceView.
-    results = self._device.RunShellCommand(
-        'dumpsys SurfaceFlinger --latency SurfaceView')
-    if not len(results):
-      return (None, None)
-
-    timestamps = []
-    nanoseconds_per_millisecond = 1e6
-    refresh_period = long(results[0]) / nanoseconds_per_millisecond
-
-    # If a fence associated with a frame is still pending when we query the
-    # latency data, SurfaceFlinger gives the frame a timestamp of INT64_MAX.
-    # Since we only care about completed frames, we will ignore any timestamps
-    # with this value.
-    pending_fence_timestamp = (1 << 63) - 1
-
-    for line in results[1:]:
-      fields = line.split()
-      if len(fields) != 3:
-        continue
-      timestamp = long(fields[1])
-      if timestamp == pending_fence_timestamp:
-        continue
-      timestamp /= nanoseconds_per_millisecond
-      timestamps.append(timestamp)
-
-    return (refresh_period, timestamps)
diff --git a/build/android/pylib/perf/surface_stats_collector_unittest.py b/build/android/pylib/perf/surface_stats_collector_unittest.py
deleted file mode 100644
index e905d73..0000000
--- a/build/android/pylib/perf/surface_stats_collector_unittest.py
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Unittests for SurfaceStatsCollector."""
-# pylint: disable=W0212
-
-import unittest
-
-from pylib.perf.surface_stats_collector import SurfaceStatsCollector
-
-
-class TestSurfaceStatsCollector(unittest.TestCase):
-  @staticmethod
-  def _CreateUniformTimestamps(base, num, delta):
-    return [base + i * delta for i in range(1, num + 1)]
-
-  @staticmethod
-  def _CreateDictionaryFromResults(results):
-    dictionary = {}
-    for result in results:
-      dictionary[result.name] = result
-    return dictionary
-
-  def setUp(self):
-    self.refresh_period = 0.1
-
-  def testOneFrameDelta(self):
-    timestamps = self._CreateUniformTimestamps(0, 10, self.refresh_period)
-    results = self._CreateDictionaryFromResults(
-                  SurfaceStatsCollector._CalculateResults(
-                      self.refresh_period, timestamps, ''))
-
-    self.assertEquals(results['avg_surface_fps'].value,
-                      int(round(1 / self.refresh_period)))
-    self.assertEquals(results['jank_count'].value, 0)
-    self.assertEquals(results['max_frame_delay'].value, 1)
-    self.assertEquals(len(results['frame_lengths'].value), len(timestamps) - 1)
-
-  def testAllFramesTooShort(self):
-    timestamps = self._CreateUniformTimestamps(0, 10, self.refresh_period / 100)
-    self.assertRaises(Exception,
-                      SurfaceStatsCollector._CalculateResults,
-                      [self.refresh_period, timestamps, ''])
-
-  def testSomeFramesTooShort(self):
-    timestamps = self._CreateUniformTimestamps(0, 5, self.refresh_period)
-    # The following timestamps should be skipped.
-    timestamps += self._CreateUniformTimestamps(timestamps[4],
-                                                5,
-                                                self.refresh_period / 100)
-    timestamps += self._CreateUniformTimestamps(timestamps[4],
-                                                5,
-                                                self.refresh_period)
-
-    results = self._CreateDictionaryFromResults(
-                  SurfaceStatsCollector._CalculateResults(
-                      self.refresh_period, timestamps, ''))
-
-    self.assertEquals(len(results['frame_lengths'].value), 9)
-
-
-if __name__ == '__main__':
-  unittest.main()
diff --git a/build/android/pylib/perf/test_options.py b/build/android/pylib/perf/test_options.py
deleted file mode 100644
index eff928e..0000000
--- a/build/android/pylib/perf/test_options.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Defines the PerfOptions named tuple."""
-
-import collections
-
-PerfOptions = collections.namedtuple('PerfOptions', [
-    'steps',
-    'flaky_steps',
-    'output_json_list',
-    'print_step',
-    'no_timeout',
-    'test_filter',
-    'dry_run',
-    'single_step',
-    'collect_chartjson_data',
-    'output_chartjson_data',
-    'max_battery_temp',
-    'min_battery_level',
-])
diff --git a/build/android/pylib/perf/test_runner.py b/build/android/pylib/perf/test_runner.py
deleted file mode 100644
index d21a9b7..0000000
--- a/build/android/pylib/perf/test_runner.py
+++ /dev/null
@@ -1,374 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Runs perf tests.
-
-Our buildbot infrastructure requires each slave to run steps serially.
-This is sub-optimal for android, where these steps can run independently on
-multiple connected devices.
-
-The buildbots will run this script multiple times per cycle:
-- First: all steps listed in --steps in will be executed in parallel using all
-connected devices. Step results will be pickled to disk. Each step has a unique
-name. The result code will be ignored if the step name is listed in
---flaky-steps.
-The buildbot will treat this step as a regular step, and will not process any
-graph data.
-
-- Then, with -print-step STEP_NAME: at this stage, we'll simply print the file
-with the step results previously saved. The buildbot will then process the graph
-data accordingly.
-
-The JSON steps file contains a dictionary in the format:
-{ "version": int,
-  "steps": {
-    "foo": {
-      "device_affinity": int,
-      "cmd": "script_to_execute foo"
-    },
-    "bar": {
-      "device_affinity": int,
-      "cmd": "script_to_execute bar"
-    }
-  }
-}
-
-The JSON flaky steps file contains a list with step names which results should
-be ignored:
-[
-  "step_name_foo",
-  "step_name_bar"
-]
-
-Note that script_to_execute necessarily have to take at least the following
-option:
-  --device: the serial number to be passed to all adb commands.
-"""
-
-import collections
-import datetime
-import json
-import logging
-import os
-import pickle
-import shutil
-import sys
-import tempfile
-import threading
-import time
-
-from pylib import cmd_helper
-from pylib import constants
-from pylib import forwarder
-from pylib.base import base_test_result
-from pylib.base import base_test_runner
-from pylib.device import battery_utils
-from pylib.device import device_errors
-
-
-def GetPersistedResult(test_name):
-  file_name = os.path.join(constants.PERF_OUTPUT_DIR, test_name)
-  if not os.path.exists(file_name):
-    logging.error('File not found %s', file_name)
-    return None
-
-  with file(file_name, 'r') as f:
-    return pickle.loads(f.read())
-
-
-def OutputJsonList(json_input, json_output):
-  with file(json_input, 'r') as i:
-    all_steps = json.load(i)
-
-  step_values = []
-  for k, v in all_steps['steps'].iteritems():
-    data = {'test': k, 'device_affinity': v['device_affinity']}
-
-    persisted_result = GetPersistedResult(k)
-    if persisted_result:
-      data['total_time'] = persisted_result['total_time']
-    step_values.append(data)
-
-  with file(json_output, 'w') as o:
-    o.write(json.dumps(step_values))
-  return 0
-
-
-def PrintTestOutput(test_name, json_file_name=None):
-  """Helper method to print the output of previously executed test_name.
-
-  Args:
-    test_name: name of the test that has been previously executed.
-    json_file_name: name of the file to output chartjson data to.
-
-  Returns:
-    exit code generated by the test step.
-  """
-  persisted_result = GetPersistedResult(test_name)
-  if not persisted_result:
-    return 1
-  logging.info('*' * 80)
-  logging.info('Output from:')
-  logging.info(persisted_result['cmd'])
-  logging.info('*' * 80)
-  print persisted_result['output']
-
-  if json_file_name:
-    with file(json_file_name, 'w') as f:
-      f.write(persisted_result['chartjson'])
-
-  return persisted_result['exit_code']
-
-
-def PrintSummary(test_names):
-  logging.info('*' * 80)
-  logging.info('Sharding summary')
-  device_total_time = collections.defaultdict(int)
-  for test_name in test_names:
-    file_name = os.path.join(constants.PERF_OUTPUT_DIR, test_name)
-    if not os.path.exists(file_name):
-      logging.info('%s : No status file found', test_name)
-      continue
-    with file(file_name, 'r') as f:
-      result = pickle.loads(f.read())
-    logging.info('%s : exit_code=%d in %d secs at %s',
-                 result['name'], result['exit_code'], result['total_time'],
-                 result['device'])
-    device_total_time[result['device']] += result['total_time']
-  for device, device_time in device_total_time.iteritems():
-    logging.info('Total for device %s : %d secs', device, device_time)
-  logging.info('Total steps time: %d secs', sum(device_total_time.values()))
-
-
-class _HeartBeatLogger(object):
-  # How often to print the heartbeat on flush().
-  _PRINT_INTERVAL = 30.0
-
-  def __init__(self):
-    """A file-like class for keeping the buildbot alive."""
-    self._len = 0
-    self._tick = time.time()
-    self._stopped = threading.Event()
-    self._timer = threading.Thread(target=self._runner)
-    self._timer.start()
-
-  def _runner(self):
-    while not self._stopped.is_set():
-      self.flush()
-      self._stopped.wait(_HeartBeatLogger._PRINT_INTERVAL)
-
-  def write(self, data):
-    self._len += len(data)
-
-  def flush(self):
-    now = time.time()
-    if now - self._tick >= _HeartBeatLogger._PRINT_INTERVAL:
-      self._tick = now
-      print '--single-step output length %d' % self._len
-      sys.stdout.flush()
-
-  def stop(self):
-    self._stopped.set()
-
-
-class TestRunner(base_test_runner.BaseTestRunner):
-  def __init__(self, test_options, device, shard_index, max_shard, tests,
-      flaky_tests):
-    """A TestRunner instance runs a perf test on a single device.
-
-    Args:
-      test_options: A PerfOptions object.
-      device: Device to run the tests.
-      shard_index: the index of this device.
-      max_shards: the maximum shard index.
-      tests: a dict mapping test_name to command.
-      flaky_tests: a list of flaky test_name.
-    """
-    super(TestRunner, self).__init__(device, None)
-    self._options = test_options
-    self._shard_index = shard_index
-    self._max_shard = max_shard
-    self._tests = tests
-    self._flaky_tests = flaky_tests
-    self._output_dir = None
-    self._device_battery = battery_utils.BatteryUtils(self.device)
-
-  @staticmethod
-  def _IsBetter(result):
-    if result['actual_exit_code'] == 0:
-      return True
-    pickled = os.path.join(constants.PERF_OUTPUT_DIR,
-                           result['name'])
-    if not os.path.exists(pickled):
-      return True
-    with file(pickled, 'r') as f:
-      previous = pickle.loads(f.read())
-    return result['actual_exit_code'] < previous['actual_exit_code']
-
-  @staticmethod
-  def _SaveResult(result):
-    if TestRunner._IsBetter(result):
-      with file(os.path.join(constants.PERF_OUTPUT_DIR,
-                             result['name']), 'w') as f:
-        f.write(pickle.dumps(result))
-
-  def _CheckDeviceAffinity(self, test_name):
-    """Returns True if test_name has affinity for this shard."""
-    affinity = (self._tests['steps'][test_name]['device_affinity'] %
-                self._max_shard)
-    if self._shard_index == affinity:
-      return True
-    logging.info('Skipping %s on %s (affinity is %s, device is %s)',
-                 test_name, self.device_serial, affinity, self._shard_index)
-    return False
-
-  def _CleanupOutputDirectory(self):
-    if self._output_dir:
-      shutil.rmtree(self._output_dir, ignore_errors=True)
-      self._output_dir = None
-
-  def _ReadChartjsonOutput(self):
-    if not self._output_dir:
-      return ''
-
-    json_output_path = os.path.join(self._output_dir, 'results-chart.json')
-    try:
-      with open(json_output_path) as f:
-        return f.read()
-    except IOError:
-      logging.exception('Exception when reading chartjson.')
-      logging.error('This usually means that telemetry did not run, so it could'
-                    ' not generate the file. Please check the device running'
-                    ' the test.')
-      return ''
-
-  def _LaunchPerfTest(self, test_name):
-    """Runs a perf test.
-
-    Args:
-      test_name: the name of the test to be executed.
-
-    Returns:
-      A tuple containing (Output, base_test_result.ResultType)
-    """
-    if not self._CheckDeviceAffinity(test_name):
-      return '', base_test_result.ResultType.PASS
-
-    try:
-      logging.warning('Unmapping device ports')
-      forwarder.Forwarder.UnmapAllDevicePorts(self.device)
-      self.device.old_interface.RestartAdbdOnDevice()
-    except Exception as e:
-      logging.error('Exception when tearing down device %s', e)
-
-    cmd = ('%s --device %s' %
-           (self._tests['steps'][test_name]['cmd'],
-            self.device_serial))
-
-    if self._options.collect_chartjson_data:
-      self._output_dir = tempfile.mkdtemp()
-      cmd = cmd + ' --output-dir=%s' % self._output_dir
-
-    logging.info(
-        'temperature: %s (0.1 C)',
-        str(self._device_battery.GetBatteryInfo().get('temperature')))
-    if self._options.max_battery_temp:
-      self._device_battery.LetBatteryCoolToTemperature(
-          self._options.max_battery_temp)
-
-    logging.info('Charge level: %s%%',
-        str(self._device_battery.GetBatteryInfo().get('level')))
-    if self._options.min_battery_level:
-      self._device_battery.ChargeDeviceToLevel(
-          self._options.min_battery_level)
-
-    logging.info('%s : %s', test_name, cmd)
-    start_time = datetime.datetime.now()
-
-    timeout = self._tests['steps'][test_name].get('timeout', 5400)
-    if self._options.no_timeout:
-      timeout = None
-    logging.info('Timeout for %s test: %s', test_name, timeout)
-    full_cmd = cmd
-    if self._options.dry_run:
-      full_cmd = 'echo %s' % cmd
-
-    logfile = sys.stdout
-    if self._options.single_step:
-      # Just print a heart-beat so that the outer buildbot scripts won't timeout
-      # without response.
-      logfile = _HeartBeatLogger()
-    cwd = os.path.abspath(constants.DIR_SOURCE_ROOT)
-    if full_cmd.startswith('src/'):
-      cwd = os.path.abspath(os.path.join(constants.DIR_SOURCE_ROOT, os.pardir))
-    try:
-      exit_code, output = cmd_helper.GetCmdStatusAndOutputWithTimeout(
-          full_cmd, timeout, cwd=cwd, shell=True, logfile=logfile)
-      json_output = self._ReadChartjsonOutput()
-    except cmd_helper.TimeoutError as e:
-      exit_code = -1
-      output = str(e)
-      json_output = ''
-    finally:
-      self._CleanupOutputDirectory()
-      if self._options.single_step:
-        logfile.stop()
-    end_time = datetime.datetime.now()
-    if exit_code is None:
-      exit_code = -1
-    logging.info('%s : exit_code=%d in %d secs at %s',
-                 test_name, exit_code, (end_time - start_time).seconds,
-                 self.device_serial)
-
-    if exit_code == 0:
-      result_type = base_test_result.ResultType.PASS
-    else:
-      result_type = base_test_result.ResultType.FAIL
-      # Since perf tests use device affinity, give the device a chance to
-      # recover if it is offline after a failure. Otherwise, the master sharder
-      # will remove it from the pool and future tests on this device will fail.
-      try:
-        self.device.WaitUntilFullyBooted(timeout=120)
-      except device_errors.CommandTimeoutError as e:
-        logging.error('Device failed to return after %s: %s' % (test_name, e))
-
-    actual_exit_code = exit_code
-    if test_name in self._flaky_tests:
-      # The exit_code is used at the second stage when printing the
-      # test output. If the test is flaky, force to "0" to get that step green
-      # whilst still gathering data to the perf dashboards.
-      # The result_type is used by the test_dispatcher to retry the test.
-      exit_code = 0
-
-    persisted_result = {
-        'name': test_name,
-        'output': output,
-        'chartjson': json_output,
-        'exit_code': exit_code,
-        'actual_exit_code': actual_exit_code,
-        'result_type': result_type,
-        'total_time': (end_time - start_time).seconds,
-        'device': self.device_serial,
-        'cmd': cmd,
-    }
-    self._SaveResult(persisted_result)
-
-    return (output, result_type)
-
-  def RunTest(self, test_name):
-    """Run a perf test on the device.
-
-    Args:
-      test_name: String to use for logging the test result.
-
-    Returns:
-      A tuple of (TestRunResults, retry).
-    """
-    _, result_type = self._LaunchPerfTest(test_name)
-    results = base_test_result.TestRunResults()
-    results.AddResult(base_test_result.BaseTestResult(test_name, result_type))
-    retry = None
-    if not results.DidRunPass():
-      retry = test_name
-    return results, retry
diff --git a/build/android/pylib/perf/thermal_throttle.py b/build/android/pylib/perf/thermal_throttle.py
deleted file mode 100644
index 383b6d5..0000000
--- a/build/android/pylib/perf/thermal_throttle.py
+++ /dev/null
@@ -1,137 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging
-from pylib import android_commands
-from pylib.device import device_utils
-
-
-class OmapThrottlingDetector(object):
-  """Class to detect and track thermal throttling on an OMAP 4."""
-  OMAP_TEMP_FILE = ('/sys/devices/platform/omap/omap_temp_sensor.0/'
-                    'temperature')
-
-  @staticmethod
-  def IsSupported(device):
-    return device.FileExists(OmapThrottlingDetector.OMAP_TEMP_FILE)
-
-  def __init__(self, device):
-    self._device = device
-
-  @staticmethod
-  def BecameThrottled(log_line):
-    return 'omap_thermal_throttle' in log_line
-
-  @staticmethod
-  def BecameUnthrottled(log_line):
-    return 'omap_thermal_unthrottle' in log_line
-
-  @staticmethod
-  def GetThrottlingTemperature(log_line):
-    if 'throttle_delayed_work_fn' in log_line:
-      return float([s for s in log_line.split() if s.isdigit()][0]) / 1000.0
-
-  def GetCurrentTemperature(self):
-    tempdata = self._device.ReadFile(OmapThrottlingDetector.OMAP_TEMP_FILE)
-    return float(tempdata) / 1000.0
-
-
-class ExynosThrottlingDetector(object):
-  """Class to detect and track thermal throttling on an Exynos 5."""
-  @staticmethod
-  def IsSupported(device):
-    return device.FileExists('/sys/bus/exynos5-core')
-
-  def __init__(self, device):
-    pass
-
-  @staticmethod
-  def BecameThrottled(log_line):
-    return 'exynos_tmu: Throttling interrupt' in log_line
-
-  @staticmethod
-  def BecameUnthrottled(log_line):
-    return 'exynos_thermal_unthrottle: not throttling' in log_line
-
-  @staticmethod
-  def GetThrottlingTemperature(_log_line):
-    return None
-
-  @staticmethod
-  def GetCurrentTemperature():
-    return None
-
-
-class ThermalThrottle(object):
-  """Class to detect and track thermal throttling.
-
-  Usage:
-    Wait for IsThrottled() to be False before running test
-    After running test call HasBeenThrottled() to find out if the
-    test run was affected by thermal throttling.
-  """
-
-  def __init__(self, device):
-    # TODO(jbudorick) Remove once telemetry gets switched over.
-    if isinstance(device, android_commands.AndroidCommands):
-      device = device_utils.DeviceUtils(device)
-    self._device = device
-    self._throttled = False
-    self._detector = None
-    if OmapThrottlingDetector.IsSupported(device):
-      self._detector = OmapThrottlingDetector(device)
-    elif ExynosThrottlingDetector.IsSupported(device):
-      self._detector = ExynosThrottlingDetector(device)
-
-  def HasBeenThrottled(self):
-    """True if there has been any throttling since the last call to
-       HasBeenThrottled or IsThrottled.
-    """
-    return self._ReadLog()
-
-  def IsThrottled(self):
-    """True if currently throttled."""
-    self._ReadLog()
-    return self._throttled
-
-  def _ReadLog(self):
-    if not self._detector:
-      return False
-    has_been_throttled = False
-    serial_number = str(self._device)
-    log = self._device.RunShellCommand('dmesg -c')
-    degree_symbol = unichr(0x00B0)
-    for line in log:
-      if self._detector.BecameThrottled(line):
-        if not self._throttled:
-          logging.warning('>>> Device %s thermally throttled', serial_number)
-        self._throttled = True
-        has_been_throttled = True
-      elif self._detector.BecameUnthrottled(line):
-        if self._throttled:
-          logging.warning('>>> Device %s thermally unthrottled', serial_number)
-        self._throttled = False
-        has_been_throttled = True
-      temperature = self._detector.GetThrottlingTemperature(line)
-      if temperature is not None:
-        logging.info(u'Device %s thermally throttled at %3.1f%sC',
-                     serial_number, temperature, degree_symbol)
-
-    if logging.getLogger().isEnabledFor(logging.DEBUG):
-      # Print current temperature of CPU SoC.
-      temperature = self._detector.GetCurrentTemperature()
-      if temperature is not None:
-        logging.debug(u'Current SoC temperature of %s = %3.1f%sC',
-                      serial_number, temperature, degree_symbol)
-
-      # Print temperature of battery, to give a system temperature
-      dumpsys_log = self._device.RunShellCommand('dumpsys battery')
-      for line in dumpsys_log:
-        if 'temperature' in line:
-          btemp = float([s for s in line.split() if s.isdigit()][0]) / 10.0
-          logging.debug(u'Current battery temperature of %s = %3.1f%sC',
-                        serial_number, btemp, degree_symbol)
-
-    return has_been_throttled
-
diff --git a/build/android/pylib/pexpect.py b/build/android/pylib/pexpect.py
deleted file mode 100644
index cf59fb0..0000000
--- a/build/android/pylib/pexpect.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-from __future__ import absolute_import
-
-import os
-import sys
-
-_CHROME_SRC = os.path.join(
-    os.path.abspath(os.path.dirname(__file__)), '..', '..', '..')
-
-_PEXPECT_PATH = os.path.join(_CHROME_SRC, 'third_party', 'pexpect')
-if _PEXPECT_PATH not in sys.path:
-  sys.path.append(_PEXPECT_PATH)
-
-# pexpect is not available on all platforms. We allow this file to be imported
-# on platforms without pexpect and only fail when pexpect is actually used.
-try:
-  from pexpect import * # pylint: disable=W0401,W0614
-except ImportError:
-  pass
diff --git a/build/android/pylib/ports.py b/build/android/pylib/ports.py
deleted file mode 100644
index 578152c..0000000
--- a/build/android/pylib/ports.py
+++ /dev/null
@@ -1,172 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Functions that deal with local and device ports."""
-
-import contextlib
-import fcntl
-import httplib
-import logging
-import os
-import socket
-import traceback
-
-from pylib import constants
-
-
-# The following two methods are used to allocate the port source for various
-# types of test servers. Because some net-related tests can be run on shards at
-# same time, it's important to have a mechanism to allocate the port
-# process-safe. In here, we implement the safe port allocation by leveraging
-# flock.
-def ResetTestServerPortAllocation():
-  """Resets the port allocation to start from TEST_SERVER_PORT_FIRST.
-
-  Returns:
-    Returns True if reset successes. Otherwise returns False.
-  """
-  try:
-    with open(constants.TEST_SERVER_PORT_FILE, 'w') as fp:
-      fp.write('%d' % constants.TEST_SERVER_PORT_FIRST)
-    if os.path.exists(constants.TEST_SERVER_PORT_LOCKFILE):
-      os.unlink(constants.TEST_SERVER_PORT_LOCKFILE)
-    return True
-  except Exception as e:
-    logging.error(e)
-  return False
-
-
-def AllocateTestServerPort():
-  """Allocates a port incrementally.
-
-  Returns:
-    Returns a valid port which should be in between TEST_SERVER_PORT_FIRST and
-    TEST_SERVER_PORT_LAST. Returning 0 means no more valid port can be used.
-  """
-  port = 0
-  ports_tried = []
-  try:
-    fp_lock = open(constants.TEST_SERVER_PORT_LOCKFILE, 'w')
-    fcntl.flock(fp_lock, fcntl.LOCK_EX)
-    # Get current valid port and calculate next valid port.
-    if not os.path.exists(constants.TEST_SERVER_PORT_FILE):
-      ResetTestServerPortAllocation()
-    with open(constants.TEST_SERVER_PORT_FILE, 'r+') as fp:
-      port = int(fp.read())
-      ports_tried.append(port)
-      while not IsHostPortAvailable(port):
-        port += 1
-        ports_tried.append(port)
-      if (port > constants.TEST_SERVER_PORT_LAST or
-          port < constants.TEST_SERVER_PORT_FIRST):
-        port = 0
-      else:
-        fp.seek(0, os.SEEK_SET)
-        fp.write('%d' % (port + 1))
-  except Exception as e:
-    logging.error(e)
-  finally:
-    if fp_lock:
-      fcntl.flock(fp_lock, fcntl.LOCK_UN)
-      fp_lock.close()
-  if port:
-    logging.info('Allocate port %d for test server.', port)
-  else:
-    logging.error('Could not allocate port for test server. '
-                  'List of ports tried: %s', str(ports_tried))
-  return port
-
-
-def IsHostPortAvailable(host_port):
-  """Checks whether the specified host port is available.
-
-  Args:
-    host_port: Port on host to check.
-
-  Returns:
-    True if the port on host is available, otherwise returns False.
-  """
-  s = socket.socket()
-  try:
-    s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
-    s.bind(('', host_port))
-    s.close()
-    return True
-  except socket.error:
-    return False
-
-
-def IsDevicePortUsed(device, device_port, state=''):
-  """Checks whether the specified device port is used or not.
-
-  Args:
-    device: A DeviceUtils instance.
-    device_port: Port on device we want to check.
-    state: String of the specified state. Default is empty string, which
-           means any state.
-
-  Returns:
-    True if the port on device is already used, otherwise returns False.
-  """
-  base_url = '127.0.0.1:%d' % device_port
-  netstat_results = device.RunShellCommand('netstat')
-  for single_connect in netstat_results:
-    # Column 3 is the local address which we want to check with.
-    connect_results = single_connect.split()
-    if connect_results[0] != 'tcp':
-      continue
-    if len(connect_results) < 6:
-      raise Exception('Unexpected format while parsing netstat line: ' +
-                      single_connect)
-    is_state_match = connect_results[5] == state if state else True
-    if connect_results[3] == base_url and is_state_match:
-      return True
-  return False
-
-
-def IsHttpServerConnectable(host, port, tries=3, command='GET', path='/',
-                            expected_read='', timeout=2):
-  """Checks whether the specified http server is ready to serve request or not.
-
-  Args:
-    host: Host name of the HTTP server.
-    port: Port number of the HTTP server.
-    tries: How many times we want to test the connection. The default value is
-           3.
-    command: The http command we use to connect to HTTP server. The default
-             command is 'GET'.
-    path: The path we use when connecting to HTTP server. The default path is
-          '/'.
-    expected_read: The content we expect to read from the response. The default
-                   value is ''.
-    timeout: Timeout (in seconds) for each http connection. The default is 2s.
-
-  Returns:
-    Tuple of (connect status, client error). connect status is a boolean value
-    to indicate whether the server is connectable. client_error is the error
-    message the server returns when connect status is false.
-  """
-  assert tries >= 1
-  for i in xrange(0, tries):
-    client_error = None
-    try:
-      with contextlib.closing(httplib.HTTPConnection(
-          host, port, timeout=timeout)) as http:
-        # Output some debug information when we have tried more than 2 times.
-        http.set_debuglevel(i >= 2)
-        http.request(command, path)
-        r = http.getresponse()
-        content = r.read()
-        if r.status == 200 and r.reason == 'OK' and content == expected_read:
-          return (True, '')
-        client_error = ('Bad response: %s %s version %s\n  ' %
-                        (r.status, r.reason, r.version) +
-                        '\n  '.join([': '.join(h) for h in r.getheaders()]))
-    except (httplib.HTTPException, socket.error) as e:
-      # Probably too quick connecting: try again.
-      exception_error_msgs = traceback.format_exception_only(type(e), e)
-      if exception_error_msgs:
-        client_error = ''.join(exception_error_msgs)
-  # Only returns last client_error.
-  return (False, client_error or 'Timeout')
diff --git a/build/android/pylib/remote/__init__.py b/build/android/pylib/remote/__init__.py
deleted file mode 100644
index 4d6aabb..0000000
--- a/build/android/pylib/remote/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
diff --git a/build/android/pylib/remote/device/__init__.py b/build/android/pylib/remote/device/__init__.py
deleted file mode 100644
index 4d6aabb..0000000
--- a/build/android/pylib/remote/device/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
diff --git a/build/android/pylib/remote/device/appurify_constants.py b/build/android/pylib/remote/device/appurify_constants.py
deleted file mode 100644
index 9343178..0000000
--- a/build/android/pylib/remote/device/appurify_constants.py
+++ /dev/null
@@ -1,57 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Defines a set of constants specific to appurify."""
-
-# Appurify network config constants.
-class NETWORK(object):
-  WIFI_1_BAR = 1
-  SPRINT_4G_LTE_4_BARS = 2
-  SPRINT_3G_5_BARS = 3
-  SPRINT_3G_4_BARS = 4
-  SPRINT_3G_3_BARS = 5
-  SPRINT_3G_2_BARS = 6
-  SPRINT_3G_1_BAR = 7
-  SPRING_4G_1_BAR = 8
-  VERIZON_3G_5_BARS = 9
-  VERIZON_3G_4_BARS = 10
-  VERIZON_3G_3_BARS = 11
-  VERIZON_3G_2_BARS = 12
-  VERIZON_3G_1_BAR = 13
-  VERIZON_4G_1_BAR = 14
-  ATANDT_3G_5_BARS = 15
-  ATANDT_3G_4_BARS = 16
-  ATANDT_3G_3_BARS = 17
-  ATANDT_3G_2_BARS = 18
-  ATANDT_3G_1_BAR = 19
-  GENERIC_2G_4_BARS = 20
-  GENERIC_2G_3_BARS = 21
-  GENERIC_EVOLVED_EDGE = 22
-  GENERIC_GPRS = 23
-  GENERIC_ENHANCED_GPRS = 24
-  GENERIC_LTE = 25
-  GENERIC_HIGH_LATENCY_DNS = 26
-  GENERIC_100_PERCENT_PACKET_LOSS = 27
-  ATANDT_HSPA_PLUS = 28
-  ATANDT_4G_LTE_4_BARS = 29
-  VERIZON_4G_LTE_4_BARS = 30
-  GENERIC_DIGITAL_SUBSCRIBE_LINE = 31
-  WIFI_STARBUCKS_3_BARS = 32
-  WIFI_STARBUCKS_4_BARS = 33
-  WIFI_STARBUCKS_HIGH_TRAFFIC = 34
-  WIFI_TARGET_1_BAR = 35
-  WIFI_TARGET_3_BARS = 36
-  WIFI_TARGET_4_BARS = 37
-  PUBLIC_WIFI_MCDONALDS_5_BARS = 38
-  PUBLIC_WIFI_MCDONALDS_4_BARS = 39
-  PUBLIC_WIFI_MCDONALDS_2_BARS = 40
-  PUBLIC_WIFI_MCDONALDS_1_BAR = 41
-  PUBLIC_WIFI_KOHLS_5_BARS = 42
-  PUBLIC_WIFI_KOHLS_4_BARS = 43
-  PUBLIC_WIFI_KOHLS_2_BARS = 44
-  PUBLIC_WIFI_ATANDT_5_BARS = 45
-  PUBLIC_WIFI_ATANDT_4_BARS = 46
-  PUBLIC_WIFI_ATANDT_2_BARS = 47
-  PUBLIC_WIFI_ATANDT_1_BAR = 48
-  BOINGO = 49
\ No newline at end of file
diff --git a/build/android/pylib/remote/device/appurify_sanitized.py b/build/android/pylib/remote/device/appurify_sanitized.py
deleted file mode 100644
index 9f6ab40..0000000
--- a/build/android/pylib/remote/device/appurify_sanitized.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import contextlib
-import logging
-import os
-import sys
-
-from pylib import constants
-
-sys.path.append(os.path.join(
-    constants.DIR_SOURCE_ROOT, 'third_party', 'requests', 'src'))
-sys.path.append(os.path.join(
-    constants.DIR_SOURCE_ROOT, 'third_party', 'appurify-python', 'src'))
-handlers_before = list(logging.getLogger().handlers)
-
-import appurify.api
-import appurify.utils
-
-handlers_after = list(logging.getLogger().handlers)
-new_handler = list(set(handlers_after) - set(handlers_before))
-while new_handler:
-  logging.info("Removing logging handler.")
-  logging.getLogger().removeHandler(new_handler.pop())
-
-api = appurify.api
-utils = appurify.utils
-
-# This is not thread safe. If multiple threads are ever supported with appurify
-# this may cause logging messages to go missing.
-@contextlib.contextmanager
-def SanitizeLogging(verbose_count, level):
-  if verbose_count < 2:
-    logging.disable(level)
-    yield True
-    logging.disable(logging.NOTSET)
-  else:
-    yield False
-
diff --git a/build/android/pylib/remote/device/dummy/BUILD.gn b/build/android/pylib/remote/device/dummy/BUILD.gn
deleted file mode 100644
index 54ca275..0000000
--- a/build/android/pylib/remote/device/dummy/BUILD.gn
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import("//build/config/android/config.gni")
-import("//build/config/android/rules.gni")
-
-# GYP: //build/android/pylib/remote/device/dummy/dummy.gyp:remote_device_dummy_apk
-android_apk("remote_device_dummy_apk") {
-  android_manifest = "//build/android/AndroidManifest.xml"
-  java_files = [ "src/org/chromium/dummy/Dummy.java" ]
-  apk_name = "remote_device_dummy"
-  testonly = true
-}
diff --git a/build/android/pylib/remote/device/dummy/dummy.gyp b/build/android/pylib/remote/device/dummy/dummy.gyp
deleted file mode 100644
index b003edc..0000000
--- a/build/android/pylib/remote/device/dummy/dummy.gyp
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Running gtests on a remote device via am instrument requires both an "app"
-# APK and a "test" APK with different package names. Our gtests only use one
-# APK, so we build a dummy APK to upload as the app.
-
-{
-  'targets': [
-    {
-      # GN: //build/android/pylib/remote/device/dummy:remote_device_dummy_apk
-      'target_name': 'remote_device_dummy_apk',
-      'type': 'none',
-      'variables': {
-        'apk_name': 'remote_device_dummy',
-        'java_in_dir': '.',
-        'android_manifest_path': '../../../../../../build/android/AndroidManifest.xml',
-      },
-      'includes': [
-        '../../../../../../build/java_apk.gypi',
-      ]
-    },
-  ]
-}
diff --git a/build/android/pylib/remote/device/dummy/src/org/chromium/dummy/Dummy.java b/build/android/pylib/remote/device/dummy/src/org/chromium/dummy/Dummy.java
deleted file mode 100644
index 1281b39..0000000
--- a/build/android/pylib/remote/device/dummy/src/org/chromium/dummy/Dummy.java
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.dummy;
-
-/** Does nothing. */
-class Dummy {}
-
diff --git a/build/android/pylib/remote/device/remote_device_environment.py b/build/android/pylib/remote/device/remote_device_environment.py
deleted file mode 100644
index dc11845..0000000
--- a/build/android/pylib/remote/device/remote_device_environment.py
+++ /dev/null
@@ -1,368 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Environment setup and teardown for remote devices."""
-
-import distutils.version
-import json
-import logging
-import os
-import random
-import sys
-
-from pylib import constants
-from pylib.base import environment
-from pylib.remote.device import appurify_sanitized
-from pylib.remote.device import remote_device_helper
-from pylib.utils import timeout_retry
-from pylib.utils import reraiser_thread
-
-class RemoteDeviceEnvironment(environment.Environment):
-  """An environment for running on remote devices."""
-
-  _ENV_KEY = 'env'
-  _DEVICE_KEY = 'device'
-  _DEFAULT_RETRIES = 0
-
-  def __init__(self, args, error_func):
-    """Constructor.
-
-    Args:
-      args: Command line arguments.
-      error_func: error to show when using bad command line arguments.
-    """
-    super(RemoteDeviceEnvironment, self).__init__()
-    self._access_token = None
-    self._device = None
-    self._device_type = args.device_type
-    self._verbose_count = args.verbose_count
-    self._timeouts = {
-        'queueing': 60 * 10,
-        'installing': 60 * 10,
-        'in-progress': 60 * 30,
-        'unknown': 60 * 5
-    }
-    # Example config file:
-    # {
-    #   "remote_device": ["Galaxy S4", "Galaxy S3"],
-    #   "remote_device_os": ["4.4.2", "4.4.4"],
-    #   "remote_device_minimum_os": "4.4.2",
-    #   "api_address": "www.example.com",
-    #   "api_port": "80",
-    #   "api_protocol": "http",
-    #   "api_secret": "apisecret",
-    #   "api_key": "apikey",
-    #   "timeouts": {
-    #     "queueing": 600,
-    #     "installing": 600,
-    #     "in-progress": 1800,
-    #     "unknown": 300
-    #   }
-    # }
-    if args.remote_device_file:
-      with open(args.remote_device_file) as device_file:
-        device_json = json.load(device_file)
-    else:
-      device_json = {}
-
-    self._api_address = device_json.get('api_address', None)
-    self._api_key = device_json.get('api_key', None)
-    self._api_port = device_json.get('api_port', None)
-    self._api_protocol = device_json.get('api_protocol', None)
-    self._api_secret = device_json.get('api_secret', None)
-    self._device_oem = device_json.get('device_oem', None)
-    self._device_type = device_json.get('device_type', 'Android')
-    self._network_config = device_json.get('network_config', None)
-    self._remote_device = device_json.get('remote_device', None)
-    self._remote_device_minimum_os = device_json.get(
-        'remote_device_minimum_os', None)
-    self._remote_device_os = device_json.get('remote_device_os', None)
-    self._remote_device_timeout = device_json.get(
-        'remote_device_timeout', None)
-    self._results_path = device_json.get('results_path', None)
-    self._runner_package = device_json.get('runner_package', None)
-    self._runner_type = device_json.get('runner_type', None)
-    self._timeouts.update(device_json.get('timeouts', {}))
-
-    def command_line_override(
-        file_value, cmd_line_value, desc, print_value=True):
-      if cmd_line_value:
-        if file_value and file_value != cmd_line_value:
-          if print_value:
-            logging.info('Overriding %s from %s to %s',
-                         desc, file_value, cmd_line_value)
-          else:
-            logging.info('overriding %s', desc)
-        return cmd_line_value
-      return file_value
-
-    self._api_address = command_line_override(
-        self._api_address, args.api_address, 'api_address')
-    self._api_port = command_line_override(
-        self._api_port, args.api_port, 'api_port')
-    self._api_protocol = command_line_override(
-        self._api_protocol, args.api_protocol, 'api_protocol')
-    self._device_oem = command_line_override(
-        self._device_oem, args.device_oem, 'device_oem')
-    self._device_type = command_line_override(
-        self._device_type, args.device_type, 'device_type')
-    self._network_config = command_line_override(
-        self._network_config, args.network_config, 'network_config')
-    self._remote_device = command_line_override(
-        self._remote_device, args.remote_device, 'remote_device')
-    self._remote_device_minimum_os = command_line_override(
-        self._remote_device_minimum_os, args.remote_device_minimum_os,
-        'remote_device_minimum_os')
-    self._remote_device_os = command_line_override(
-        self._remote_device_os, args.remote_device_os, 'remote_device_os')
-    self._remote_device_timeout = command_line_override(
-        self._remote_device_timeout, args.remote_device_timeout,
-        'remote_device_timeout')
-    self._results_path = command_line_override(
-        self._results_path, args.results_path, 'results_path')
-    self._runner_package = command_line_override(
-        self._runner_package, args.runner_package, 'runner_package')
-    self._runner_type = command_line_override(
-        self._runner_type, args.runner_type, 'runner_type')
-
-    if args.api_key_file:
-      with open(args.api_key_file) as api_key_file:
-        temp_key = api_key_file.read().strip()
-        self._api_key = command_line_override(
-            self._api_key, temp_key, 'api_key', print_value=False)
-    self._api_key = command_line_override(
-        self._api_key, args.api_key, 'api_key', print_value=False)
-
-    if args.api_secret_file:
-      with open(args.api_secret_file) as api_secret_file:
-        temp_secret = api_secret_file.read().strip()
-        self._api_secret = command_line_override(
-            self._api_secret, temp_secret, 'api_secret', print_value=False)
-    self._api_secret = command_line_override(
-        self._api_secret, args.api_secret, 'api_secret', print_value=False)
-
-    if not self._api_address:
-      error_func('Must set api address with --api-address'
-                 ' or in --remote-device-file.')
-    if not self._api_key:
-      error_func('Must set api key with --api-key, --api-key-file'
-                 ' or in --remote-device-file')
-    if not self._api_port:
-      error_func('Must set api port with --api-port'
-                 ' or in --remote-device-file')
-    if not self._api_protocol:
-      error_func('Must set api protocol with --api-protocol'
-                 ' or in --remote-device-file. Example: http')
-    if not self._api_secret:
-      error_func('Must set api secret with --api-secret, --api-secret-file'
-                 ' or in --remote-device-file')
-
-    logging.info('Api address: %s', self._api_address)
-    logging.info('Api port: %s', self._api_port)
-    logging.info('Api protocol: %s', self._api_protocol)
-    logging.info('Remote device: %s', self._remote_device)
-    logging.info('Remote device minimum OS: %s',
-                 self._remote_device_minimum_os)
-    logging.info('Remote device OS: %s', self._remote_device_os)
-    logging.info('Remote device OEM: %s', self._device_oem)
-    logging.info('Remote device type: %s', self._device_type)
-    logging.info('Remote device timout: %s', self._remote_device_timeout)
-    logging.info('Results Path: %s', self._results_path)
-    logging.info('Runner package: %s', self._runner_package)
-    logging.info('Runner type: %s', self._runner_type)
-    logging.info('Timeouts: %s', self._timeouts)
-
-    if not args.trigger and not args.collect:
-      self._trigger = True
-      self._collect = True
-    else:
-      self._trigger = args.trigger
-      self._collect = args.collect
-
-  def SetUp(self):
-    """Set up the test environment."""
-    os.environ['APPURIFY_API_PROTO'] = self._api_protocol
-    os.environ['APPURIFY_API_HOST'] = self._api_address
-    os.environ['APPURIFY_API_PORT'] = self._api_port
-    os.environ['APPURIFY_STATUS_BASE_URL'] = 'none'
-    self._GetAccessToken()
-    if self._trigger:
-      self._SelectDevice()
-
-  def TearDown(self):
-    """Teardown the test environment."""
-    self._RevokeAccessToken()
-
-  def __enter__(self):
-    """Set up the test run when used as a context manager."""
-    try:
-      self.SetUp()
-      return self
-    except:
-      self.__exit__(*sys.exc_info())
-      raise
-
-  def __exit__(self, exc_type, exc_val, exc_tb):
-    """Tears down the test run when used as a context manager."""
-    self.TearDown()
-
-  def DumpTo(self, persisted_data):
-    env_data = {
-      self._DEVICE_KEY: self._device,
-    }
-    persisted_data[self._ENV_KEY] = env_data
-
-  def LoadFrom(self, persisted_data):
-    env_data = persisted_data[self._ENV_KEY]
-    self._device = env_data[self._DEVICE_KEY]
-
-  def _GetAccessToken(self):
-    """Generates access token for remote device service."""
-    logging.info('Generating remote service access token')
-    with appurify_sanitized.SanitizeLogging(self._verbose_count,
-                                            logging.WARNING):
-      access_token_results = appurify_sanitized.api.access_token_generate(
-          self._api_key, self._api_secret)
-    remote_device_helper.TestHttpResponse(access_token_results,
-                                          'Unable to generate access token.')
-    self._access_token = access_token_results.json()['response']['access_token']
-
-  def _RevokeAccessToken(self):
-    """Destroys access token for remote device service."""
-    logging.info('Revoking remote service access token')
-    with appurify_sanitized.SanitizeLogging(self._verbose_count,
-                                            logging.WARNING):
-      revoke_token_results = appurify_sanitized.api.access_token_revoke(
-          self._access_token)
-    remote_device_helper.TestHttpResponse(revoke_token_results,
-                                          'Unable to revoke access token.')
-
-  def _SelectDevice(self):
-    if self._remote_device_timeout:
-      try:
-        timeout_retry.Run(self._FindDeviceWithTimeout,
-                          self._remote_device_timeout, self._DEFAULT_RETRIES)
-      except reraiser_thread.TimeoutError:
-        self._NoDeviceFound()
-    else:
-      if not self._FindDevice():
-        self._NoDeviceFound()
-
-  def _FindDevice(self):
-    """Find which device to use."""
-    logging.info('Finding device to run tests on.')
-    device_list = self._GetDeviceList()
-    random.shuffle(device_list)
-    for device in device_list:
-      if device['os_name'] != self._device_type:
-        continue
-      if self._remote_device and device['name'] not in self._remote_device:
-        continue
-      if (self._remote_device_os
-          and device['os_version'] not in self._remote_device_os):
-        continue
-      if self._device_oem and device['brand'] not in self._device_oem:
-        continue
-      if (self._remote_device_minimum_os
-          and distutils.version.LooseVersion(device['os_version'])
-          < distutils.version.LooseVersion(self._remote_device_minimum_os)):
-        continue
-      if device['has_available_device']:
-        logging.info('Found device: %s %s',
-                     device['name'], device['os_version'])
-        self._device = device
-        return True
-    return False
-
-  def _FindDeviceWithTimeout(self):
-    """Find which device to use with timeout."""
-    timeout_retry.WaitFor(self._FindDevice, wait_period=1)
-
-  def _PrintAvailableDevices(self, device_list):
-    def compare_devices(a,b):
-      for key in ('os_version', 'name'):
-        c = cmp(a[key], b[key])
-        if c:
-          return c
-      return 0
-
-    logging.critical('Available %s Devices:', self._device_type)
-    logging.critical(
-        '  %s %s %s %s %s',
-        'OS'.ljust(10),
-        'Device Name'.ljust(30),
-        'Available'.ljust(10),
-        'Busy'.ljust(10),
-        'All'.ljust(10))
-    devices = (d for d in device_list if d['os_name'] == self._device_type)
-    for d in sorted(devices, compare_devices):
-      logging.critical(
-          '  %s %s %s %s %s',
-          d['os_version'].ljust(10),
-          d['name'].ljust(30),
-          str(d['available_devices_count']).ljust(10),
-          str(d['busy_devices_count']).ljust(10),
-          str(d['all_devices_count']).ljust(10))
-
-  def _GetDeviceList(self):
-    with appurify_sanitized.SanitizeLogging(self._verbose_count,
-                                            logging.WARNING):
-      dev_list_res = appurify_sanitized.api.devices_list(self._access_token)
-    remote_device_helper.TestHttpResponse(dev_list_res,
-                                         'Unable to generate access token.')
-    return dev_list_res.json()['response']
-
-  def _NoDeviceFound(self):
-    self._PrintAvailableDevices(self._GetDeviceList())
-    raise remote_device_helper.RemoteDeviceError(
-        'No device found.', is_infra_error=True)
-
-  @property
-  def collect(self):
-    return self._collect
-
-  @property
-  def device_type_id(self):
-    return self._device['device_type_id']
-
-  @property
-  def network_config(self):
-    return self._network_config
-
-  @property
-  def only_output_failures(self):
-    # TODO(jbudorick): Remove this once b/18981674 is fixed.
-    return True
-
-  @property
-  def results_path(self):
-    return self._results_path
-
-  @property
-  def runner_package(self):
-    return self._runner_package
-
-  @property
-  def runner_type(self):
-    return self._runner_type
-
-  @property
-  def timeouts(self):
-    return self._timeouts
-
-  @property
-  def token(self):
-    return self._access_token
-
-  @property
-  def trigger(self):
-    return self._trigger
-
-  @property
-  def verbose_count(self):
-    return self._verbose_count
-
-  @property
-  def device_type(self):
-    return self._device_type
diff --git a/build/android/pylib/remote/device/remote_device_gtest_run.py b/build/android/pylib/remote/device/remote_device_gtest_run.py
deleted file mode 100644
index 98d41e4..0000000
--- a/build/android/pylib/remote/device/remote_device_gtest_run.py
+++ /dev/null
@@ -1,81 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Run specific test on specific environment."""
-
-import logging
-import os
-import sys
-import tempfile
-
-from pylib import constants
-from pylib.base import base_test_result
-from pylib.remote.device import appurify_sanitized
-from pylib.remote.device import remote_device_test_run
-from pylib.remote.device import remote_device_helper
-
-
-_EXTRA_COMMAND_LINE_FILE = (
-    'org.chromium.native_test.NativeTestActivity.CommandLineFile')
-
-
-class RemoteDeviceGtestTestRun(remote_device_test_run.RemoteDeviceTestRun):
-  """Run gtests and uirobot tests on a remote device."""
-
-  DEFAULT_RUNNER_PACKAGE = (
-      'org.chromium.native_test.NativeTestInstrumentationTestRunner')
-
-  #override
-  def TestPackage(self):
-    return self._test_instance.suite
-
-  #override
-  def _TriggerSetUp(self):
-    """Set up the triggering of a test run."""
-    logging.info('Triggering test run.')
-
-    if self._env.runner_type:
-      logging.warning('Ignoring configured runner_type "%s"',
-                      self._env.runner_type)
-
-    if not self._env.runner_package:
-      runner_package = self.DEFAULT_RUNNER_PACKAGE
-      logging.info('Using default runner package: %s',
-                   self.DEFAULT_RUNNER_PACKAGE)
-    else:
-      runner_package = self._env.runner_package
-
-    dummy_app_path = os.path.join(
-        constants.GetOutDirectory(), 'apks', 'remote_device_dummy.apk')
-    with tempfile.NamedTemporaryFile(suffix='.flags.txt') as flag_file:
-      env_vars = {}
-      filter_string = self._test_instance._GenerateDisabledFilterString(None)
-      if filter_string:
-        flag_file.write('_ --gtest_filter=%s' % filter_string)
-        flag_file.flush()
-        env_vars[_EXTRA_COMMAND_LINE_FILE] = os.path.basename(flag_file.name)
-        self._test_instance._data_deps.append(
-            (os.path.abspath(flag_file.name), None))
-      self._AmInstrumentTestSetup(
-          dummy_app_path, self._test_instance.apk, runner_package,
-          environment_variables=env_vars)
-
-  _INSTRUMENTATION_STREAM_LEADER = 'INSTRUMENTATION_STATUS: stream='
-
-  #override
-  def _ParseTestResults(self):
-    logging.info('Parsing results from stdout.')
-    results = base_test_result.TestRunResults()
-    output = self._results['results']['output'].splitlines()
-    output = (l[len(self._INSTRUMENTATION_STREAM_LEADER):] for l in output
-              if l.startswith(self._INSTRUMENTATION_STREAM_LEADER))
-    results_list = self._test_instance.ParseGTestOutput(output)
-    results.AddResults(results_list)
-    if self._env.only_output_failures:
-      logging.info('See logcat for more results information.')
-    if not self._results['results']['pass']:
-      results.AddResult(base_test_result.BaseTestResult(
-          'Remote Service detected error.',
-          base_test_result.ResultType.FAIL))
-    return results
diff --git a/build/android/pylib/remote/device/remote_device_helper.py b/build/android/pylib/remote/device/remote_device_helper.py
deleted file mode 100644
index 896ae99..0000000
--- a/build/android/pylib/remote/device/remote_device_helper.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Common functions and Exceptions for remote_device_*"""
-
-from pylib.utils import base_error
-
-
-class RemoteDeviceError(base_error.BaseError):
-  """Exception to throw when problems occur with remote device service."""
-  pass
-
-
-def TestHttpResponse(response, error_msg):
-  """Checks the Http response from remote device service.
-
-  Args:
-      response: response dict from the remote device service.
-      error_msg: Error message to display if bad response is seen.
-  """
-  if response.status_code != 200:
-    raise RemoteDeviceError(
-        '%s (%d: %s)' % (error_msg, response.status_code, response.reason))
diff --git a/build/android/pylib/remote/device/remote_device_instrumentation_test_run.py b/build/android/pylib/remote/device/remote_device_instrumentation_test_run.py
deleted file mode 100644
index bcdb90c..0000000
--- a/build/android/pylib/remote/device/remote_device_instrumentation_test_run.py
+++ /dev/null
@@ -1,74 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Run specific test on specific environment."""
-
-import logging
-import os
-import tempfile
-
-from pylib import constants
-from pylib.base import base_test_result
-from pylib.remote.device import remote_device_test_run
-from pylib.utils import apk_helper
-
-
-class RemoteDeviceInstrumentationTestRun(
-    remote_device_test_run.RemoteDeviceTestRun):
-  """Run instrumentation tests on a remote device."""
-
-  #override
-  def TestPackage(self):
-    return self._test_instance.test_package
-
-  #override
-  def _TriggerSetUp(self):
-    """Set up the triggering of a test run."""
-    logging.info('Triggering test run.')
-
-    with tempfile.NamedTemporaryFile(suffix='.txt') as test_list_file:
-      tests = self._test_instance.GetTests()
-      logging.debug('preparing to run %d instrumentation tests remotely:',
-                    len(tests))
-      for t in tests:
-        test_name = '%s#%s' % (t['class'], t['method'])
-        logging.debug('  %s', test_name)
-        test_list_file.write('%s\n' % test_name)
-      test_list_file.flush()
-      self._test_instance._data_deps.append(
-          (os.path.abspath(test_list_file.name), None))
-
-      env_vars = self._test_instance.GetDriverEnvironmentVars(
-          test_list_file_path=test_list_file.name)
-      env_vars.update(self._test_instance.GetHttpServerEnvironmentVars())
-
-      logging.debug('extras:')
-      for k, v in env_vars.iteritems():
-        logging.debug('  %s: %s', k, v)
-
-      self._AmInstrumentTestSetup(
-          self._test_instance.apk_under_test,
-          self._test_instance.driver_apk,
-          self._test_instance.driver_name,
-          environment_variables=env_vars,
-          extra_apks=[self._test_instance.test_apk])
-
-  #override
-  def _ParseTestResults(self):
-    logging.info('Parsing results from stdout.')
-    r = base_test_result.TestRunResults()
-    result_code, result_bundle, statuses = (
-        self._test_instance.ParseAmInstrumentRawOutput(
-            self._results['results']['output'].splitlines()))
-    result = self._test_instance.GenerateTestResults(
-        result_code, result_bundle, statuses, 0, 0)
-
-    if isinstance(result, base_test_result.BaseTestResult):
-      r.AddResult(result)
-    elif isinstance(result, list):
-      r.AddResults(result)
-    else:
-      raise Exception('Unexpected result type: %s' % type(result).__name__)
-
-    return r
diff --git a/build/android/pylib/remote/device/remote_device_test_run.py b/build/android/pylib/remote/device/remote_device_test_run.py
deleted file mode 100644
index 60cc735..0000000
--- a/build/android/pylib/remote/device/remote_device_test_run.py
+++ /dev/null
@@ -1,308 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Run specific test on specific environment."""
-
-import json
-import logging
-import os
-import sys
-import tempfile
-import time
-import zipfile
-
-from pylib import constants
-from pylib.base import test_run
-from pylib.remote.device import appurify_constants
-from pylib.remote.device import appurify_sanitized
-from pylib.remote.device import remote_device_helper
-from pylib.utils import zip_utils
-
-class RemoteDeviceTestRun(test_run.TestRun):
-  """Run tests on a remote device."""
-
-  _TEST_RUN_KEY = 'test_run'
-  _TEST_RUN_ID_KEY = 'test_run_id'
-
-  WAIT_TIME = 5
-  COMPLETE = 'complete'
-  HEARTBEAT_INTERVAL = 300
-
-  def __init__(self, env, test_instance):
-    """Constructor.
-
-    Args:
-      env: Environment the tests will run in.
-      test_instance: The test that will be run.
-    """
-    super(RemoteDeviceTestRun, self).__init__(env, test_instance)
-    self._env = env
-    self._test_instance = test_instance
-    self._app_id = ''
-    self._test_id = ''
-    self._results = ''
-    self._test_run_id = ''
-
-  #override
-  def SetUp(self):
-    """Set up a test run."""
-    if self._env.trigger:
-      self._TriggerSetUp()
-    elif self._env.collect:
-      assert isinstance(self._env.collect, basestring), (
-                        'File for storing test_run_id must be a string.')
-      with open(self._env.collect, 'r') as persisted_data_file:
-        persisted_data = json.loads(persisted_data_file.read())
-        self._env.LoadFrom(persisted_data)
-        self.LoadFrom(persisted_data)
-
-  def _TriggerSetUp(self):
-    """Set up the triggering of a test run."""
-    raise NotImplementedError
-
-  #override
-  def RunTests(self):
-    """Run the test."""
-    if self._env.trigger:
-      with appurify_sanitized.SanitizeLogging(self._env.verbose_count,
-                                              logging.WARNING):
-        test_start_res = appurify_sanitized.api.tests_run(
-            self._env.token, self._env.device_type_id, self._app_id,
-            self._test_id)
-      remote_device_helper.TestHttpResponse(
-        test_start_res, 'Unable to run test.')
-      self._test_run_id = test_start_res.json()['response']['test_run_id']
-      logging.info('Test run id: %s' % self._test_run_id)
-
-    if self._env.collect:
-      current_status = ''
-      timeout_counter = 0
-      heartbeat_counter = 0
-      while self._GetTestStatus(self._test_run_id) != self.COMPLETE:
-        if self._results['detailed_status'] != current_status:
-          logging.info('Test status: %s', self._results['detailed_status'])
-          current_status = self._results['detailed_status']
-          timeout_counter = 0
-          heartbeat_counter = 0
-        if heartbeat_counter > self.HEARTBEAT_INTERVAL:
-          logging.info('Test status: %s', self._results['detailed_status'])
-          heartbeat_counter = 0
-
-        timeout = self._env.timeouts.get(
-            current_status, self._env.timeouts['unknown'])
-        if timeout_counter > timeout:
-          raise remote_device_helper.RemoteDeviceError(
-              'Timeout while in %s state for %s seconds'
-              % (current_status, timeout),
-              is_infra_error=True)
-        time.sleep(self.WAIT_TIME)
-        timeout_counter += self.WAIT_TIME
-        heartbeat_counter += self.WAIT_TIME
-      self._DownloadTestResults(self._env.results_path)
-
-      if self._results['results']['exception']:
-        raise remote_device_helper.RemoteDeviceError(
-            self._results['results']['exception'], is_infra_error=True)
-
-      return self._ParseTestResults()
-
-  #override
-  def TearDown(self):
-    """Tear down the test run."""
-    if self._env.collect:
-      self._CollectTearDown()
-    elif self._env.trigger:
-      assert isinstance(self._env.trigger, basestring), (
-                        'File for storing test_run_id must be a string.')
-      with open(self._env.trigger, 'w') as persisted_data_file:
-        persisted_data = {}
-        self.DumpTo(persisted_data)
-        self._env.DumpTo(persisted_data)
-        persisted_data_file.write(json.dumps(persisted_data))
-
-  def _CollectTearDown(self):
-    if self._GetTestStatus(self._test_run_id) != self.COMPLETE:
-      with appurify_sanitized.SanitizeLogging(self._env.verbose_count,
-                                              logging.WARNING):
-        test_abort_res = appurify_sanitized.api.tests_abort(
-            self._env.token, self._test_run_id, reason='Test runner exiting.')
-      remote_device_helper.TestHttpResponse(test_abort_res,
-                                            'Unable to abort test.')
-
-  def __enter__(self):
-    """Set up the test run when used as a context manager."""
-    self.SetUp()
-    return self
-
-  def __exit__(self, exc_type, exc_val, exc_tb):
-    """Tear down the test run when used as a context manager."""
-    self.TearDown()
-
-  def DumpTo(self, persisted_data):
-    test_run_data = {
-      self._TEST_RUN_ID_KEY: self._test_run_id,
-    }
-    persisted_data[self._TEST_RUN_KEY] = test_run_data
-
-  def LoadFrom(self, persisted_data):
-    test_run_data = persisted_data[self._TEST_RUN_KEY]
-    self._test_run_id = test_run_data[self._TEST_RUN_ID_KEY]
-
-  def _ParseTestResults(self):
-    raise NotImplementedError
-
-  def _GetTestByName(self, test_name):
-    """Gets test_id for specific test.
-
-    Args:
-      test_name: Test to find the ID of.
-    """
-    with appurify_sanitized.SanitizeLogging(self._env.verbose_count,
-                                            logging.WARNING):
-      test_list_res = appurify_sanitized.api.tests_list(self._env.token)
-    remote_device_helper.TestHttpResponse(test_list_res,
-                                          'Unable to get tests list.')
-    for test in test_list_res.json()['response']:
-      if test['test_type'] == test_name:
-        return test['test_id']
-    raise remote_device_helper.RemoteDeviceError(
-        'No test found with name %s' % (test_name))
-
-  def _DownloadTestResults(self, results_path):
-    """Download the test results from remote device service.
-
-    Args:
-      results_path: Path to download appurify results zipfile.
-    """
-    if results_path:
-      logging.info('Downloading results to %s.' % results_path)
-      if not os.path.exists(os.path.dirname(results_path)):
-        os.makedirs(os.path.dirname(results_path))
-      with appurify_sanitized.SanitizeLogging(self._env.verbose_count,
-                                              logging.WARNING):
-        appurify_sanitized.utils.wget(self._results['results']['url'],
-                                      results_path)
-
-  def _GetTestStatus(self, test_run_id):
-    """Checks the state of the test, and sets self._results
-
-    Args:
-      test_run_id: Id of test on on remote service.
-    """
-
-    with appurify_sanitized.SanitizeLogging(self._env.verbose_count,
-                                            logging.WARNING):
-      test_check_res = appurify_sanitized.api.tests_check_result(
-          self._env.token, test_run_id)
-    remote_device_helper.TestHttpResponse(test_check_res,
-                                          'Unable to get test status.')
-    self._results = test_check_res.json()['response']
-    return self._results['status']
-
-  def _AmInstrumentTestSetup(self, app_path, test_path, runner_package,
-                             environment_variables, extra_apks=None):
-    config = {'runner': runner_package}
-    if environment_variables:
-      config['environment_vars'] = ','.join(
-          '%s=%s' % (k, v) for k, v in environment_variables.iteritems())
-
-    self._app_id = self._UploadAppToDevice(app_path)
-
-    data_deps = self._test_instance.GetDataDependencies()
-    if data_deps:
-      with tempfile.NamedTemporaryFile(suffix='.zip') as test_with_deps:
-        sdcard_files = []
-        additional_apks = []
-        host_test = os.path.basename(test_path)
-        with zipfile.ZipFile(test_with_deps.name, 'w') as zip_file:
-          zip_file.write(test_path, host_test, zipfile.ZIP_DEFLATED)
-          for h, _ in data_deps:
-            if os.path.isdir(h):
-              zip_utils.WriteToZipFile(zip_file, h, '.')
-              sdcard_files.extend(os.listdir(h))
-            else:
-              zip_utils.WriteToZipFile(zip_file, h, os.path.basename(h))
-              sdcard_files.append(os.path.basename(h))
-          for a in extra_apks or ():
-            zip_utils.WriteToZipFile(zip_file, a, os.path.basename(a));
-            additional_apks.append(os.path.basename(a))
-
-        config['sdcard_files'] = ','.join(sdcard_files)
-        config['host_test'] = host_test
-        if additional_apks:
-          config['additional_apks'] = ','.join(additional_apks)
-        self._test_id = self._UploadTestToDevice(
-            'robotium', test_with_deps.name, app_id=self._app_id)
-    else:
-      self._test_id = self._UploadTestToDevice('robotium', test_path)
-
-    logging.info('Setting config: %s' % config)
-    appurify_configs = {}
-    if self._env.network_config:
-      appurify_configs['network'] = self._env.network_config
-    self._SetTestConfig('robotium', config, **appurify_configs)
-
-  def _UploadAppToDevice(self, app_path):
-    """Upload app to device."""
-    logging.info('Uploading %s to remote service as %s.', app_path,
-                 self._test_instance.suite)
-    with open(app_path, 'rb') as apk_src:
-      with appurify_sanitized.SanitizeLogging(self._env.verbose_count,
-                                              logging.WARNING):
-        upload_results = appurify_sanitized.api.apps_upload(
-            self._env.token, apk_src, 'raw', name=self._test_instance.suite)
-      remote_device_helper.TestHttpResponse(
-          upload_results, 'Unable to upload %s.' % app_path)
-      return upload_results.json()['response']['app_id']
-
-  def _UploadTestToDevice(self, test_type, test_path, app_id=None):
-    """Upload test to device
-    Args:
-      test_type: Type of test that is being uploaded. Ex. uirobot, gtest..
-    """
-    logging.info('Uploading %s to remote service.' % test_path)
-    with open(test_path, 'rb') as test_src:
-      with appurify_sanitized.SanitizeLogging(self._env.verbose_count,
-                                              logging.WARNING):
-        upload_results = appurify_sanitized.api.tests_upload(
-            self._env.token, test_src, 'raw', test_type, app_id=app_id)
-      remote_device_helper.TestHttpResponse(upload_results,
-          'Unable to upload %s.' % test_path)
-      return upload_results.json()['response']['test_id']
-
-  def _SetTestConfig(self, runner_type, runner_configs,
-                     network=appurify_constants.NETWORK.WIFI_1_BAR,
-                     pcap=0, profiler=0, videocapture=0):
-    """Generates and uploads config file for test.
-    Args:
-      runner_configs: Configs specific to the runner you are using.
-      network: Config to specify the network environment the devices running
-          the tests will be in.
-      pcap: Option to set the recording the of network traffic from the device.
-      profiler: Option to set the recording of CPU, memory, and network
-          transfer usage in the tests.
-      videocapture: Option to set video capture during the tests.
-
-    """
-    logging.info('Generating config file for test.')
-    with tempfile.TemporaryFile() as config:
-      config_data = [
-          '[appurify]',
-          'network=%s' % network,
-          'pcap=%s' % pcap,
-          'profiler=%s' % profiler,
-          'videocapture=%s' % videocapture,
-          '[%s]' % runner_type
-      ]
-      config_data.extend(
-          '%s=%s' % (k, v) for k, v in runner_configs.iteritems())
-      config.write(''.join('%s\n' % l for l in config_data))
-      config.flush()
-      config.seek(0)
-      with appurify_sanitized.SanitizeLogging(self._env.verbose_count,
-                                              logging.WARNING):
-        config_response = appurify_sanitized.api.config_upload(
-            self._env.token, config, self._test_id)
-      remote_device_helper.TestHttpResponse(
-          config_response, 'Unable to upload test config.')
diff --git a/build/android/pylib/remote/device/remote_device_uirobot_test_run.py b/build/android/pylib/remote/device/remote_device_uirobot_test_run.py
deleted file mode 100644
index f818c98..0000000
--- a/build/android/pylib/remote/device/remote_device_uirobot_test_run.py
+++ /dev/null
@@ -1,88 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Run specific test on specific environment."""
-
-import logging
-import os
-import sys
-
-from pylib import constants
-from pylib.base import base_test_result
-from pylib.remote.device import appurify_sanitized
-from pylib.remote.device import remote_device_test_run
-from pylib.remote.device import remote_device_helper
-
-
-class RemoteDeviceUirobotTestRun(remote_device_test_run.RemoteDeviceTestRun):
-  """Run uirobot tests on a remote device."""
-
-
-  def __init__(self, env, test_instance):
-    """Constructor.
-
-    Args:
-      env: Environment the tests will run in.
-      test_instance: The test that will be run.
-    """
-    super(RemoteDeviceUirobotTestRun, self).__init__(env, test_instance)
-
-  #override
-  def TestPackage(self):
-    return self._test_instance.package_name
-
-  #override
-  def _TriggerSetUp(self):
-    """Set up the triggering of a test run."""
-    logging.info('Triggering test run.')
-
-    if self._env.device_type == 'Android':
-      default_runner_type = 'android_robot'
-    elif self._env.device_type == 'iOS':
-      default_runner_type = 'ios_robot'
-    else:
-      raise remote_device_helper.RemoteDeviceError(
-          'Unknown device type: %s' % self._env.device_type)
-
-    self._app_id = self._UploadAppToDevice(self._test_instance.app_under_test)
-    if not self._env.runner_type:
-      runner_type = default_runner_type
-      logging.info('Using default runner type: %s', default_runner_type)
-    else:
-      runner_type = self._env.runner_type
-
-    self._test_id = self._UploadTestToDevice(
-        'android_robot', None, app_id=self._app_id)
-    config_body = {'duration': self._test_instance.minutes}
-    self._SetTestConfig(runner_type, config_body)
-
-
-  # TODO(rnephew): Switch to base class implementation when supported.
-  #override
-  def _UploadTestToDevice(self, test_type, test_path, app_id=None):
-    if test_path:
-      logging.info("Ignoring test path.")
-    data = {
-        'access_token':self._env.token,
-        'test_type':test_type,
-        'app_id':app_id,
-    }
-    with appurify_sanitized.SanitizeLogging(self._env.verbose_count,
-                                            logging.WARNING):
-      test_upload_res = appurify_sanitized.utils.post('tests/upload',
-                                                      data, None)
-    remote_device_helper.TestHttpResponse(
-        test_upload_res, 'Unable to get UiRobot test id.')
-    return test_upload_res.json()['response']['test_id']
-
-  #override
-  def _ParseTestResults(self):
-    logging.info('Parsing results from remote service.')
-    results = base_test_result.TestRunResults()
-    if self._results['results']['pass']:
-      result_type = base_test_result.ResultType.PASS
-    else:
-      result_type = base_test_result.ResultType.FAIL
-    results.AddResult(base_test_result.BaseTestResult('uirobot', result_type))
-    return results
diff --git a/build/android/pylib/restart_adbd.sh b/build/android/pylib/restart_adbd.sh
deleted file mode 100755
index 393b2eb..0000000
--- a/build/android/pylib/restart_adbd.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/system/bin/sh
-
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Android shell script to restart adbd on the device. This has to be run
-# atomically as a shell script because stopping adbd prevents further commands
-# from running (even if called in the same adb shell).
-
-trap '' HUP
-trap '' TERM
-trap '' PIPE
-
-function restart() {
-  stop adbd
-  start adbd
-}
-
-restart &
diff --git a/build/android/pylib/results/__init__.py b/build/android/pylib/results/__init__.py
deleted file mode 100644
index 4d6aabb..0000000
--- a/build/android/pylib/results/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
diff --git a/build/android/pylib/results/flakiness_dashboard/__init__.py b/build/android/pylib/results/flakiness_dashboard/__init__.py
deleted file mode 100644
index 4d6aabb..0000000
--- a/build/android/pylib/results/flakiness_dashboard/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
diff --git a/build/android/pylib/results/flakiness_dashboard/json_results_generator.py b/build/android/pylib/results/flakiness_dashboard/json_results_generator.py
deleted file mode 100644
index e5c433d..0000000
--- a/build/android/pylib/results/flakiness_dashboard/json_results_generator.py
+++ /dev/null
@@ -1,697 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-#
-# Most of this file was ported over from Blink's
-# Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
-# Tools/Scripts/webkitpy/common/net/file_uploader.py
-#
-
-import json
-import logging
-import mimetypes
-import os
-import time
-import urllib2
-
-_log = logging.getLogger(__name__)
-
-_JSON_PREFIX = 'ADD_RESULTS('
-_JSON_SUFFIX = ');'
-
-
-def HasJSONWrapper(string):
-  return string.startswith(_JSON_PREFIX) and string.endswith(_JSON_SUFFIX)
-
-
-def StripJSONWrapper(json_content):
-  # FIXME: Kill this code once the server returns json instead of jsonp.
-  if HasJSONWrapper(json_content):
-    return json_content[len(_JSON_PREFIX):len(json_content) - len(_JSON_SUFFIX)]
-  return json_content
-
-
-def WriteJSON(json_object, file_path, callback=None):
-  # Specify separators in order to get compact encoding.
-  json_string = json.dumps(json_object, separators=(',', ':'))
-  if callback:
-    json_string = callback + '(' + json_string + ');'
-  with open(file_path, 'w') as fp:
-    fp.write(json_string)
-
-
-def ConvertTrieToFlatPaths(trie, prefix=None):
-  """Flattens the trie of paths, prepending a prefix to each."""
-  result = {}
-  for name, data in trie.iteritems():
-    if prefix:
-      name = prefix + '/' + name
-
-    if len(data) and not 'results' in data:
-      result.update(ConvertTrieToFlatPaths(data, name))
-    else:
-      result[name] = data
-
-  return result
-
-
-def AddPathToTrie(path, value, trie):
-  """Inserts a single path and value into a directory trie structure."""
-  if not '/' in path:
-    trie[path] = value
-    return
-
-  directory, _slash, rest = path.partition('/')
-  if not directory in trie:
-    trie[directory] = {}
-  AddPathToTrie(rest, value, trie[directory])
-
-
-def TestTimingsTrie(individual_test_timings):
-  """Breaks a test name into dicts by directory
-
-  foo/bar/baz.html: 1ms
-  foo/bar/baz1.html: 3ms
-
-  becomes
-  foo: {
-      bar: {
-          baz.html: 1,
-          baz1.html: 3
-      }
-  }
-  """
-  trie = {}
-  for test_result in individual_test_timings:
-    test = test_result.test_name
-
-    AddPathToTrie(test, int(1000 * test_result.test_run_time), trie)
-
-  return trie
-
-
-class TestResult(object):
-  """A simple class that represents a single test result."""
-
-  # Test modifier constants.
-  (NONE, FAILS, FLAKY, DISABLED) = range(4)
-
-  def __init__(self, test, failed=False, elapsed_time=0):
-    self.test_name = test
-    self.failed = failed
-    self.test_run_time = elapsed_time
-
-    test_name = test
-    try:
-      test_name = test.split('.')[1]
-    except IndexError:
-      _log.warn('Invalid test name: %s.', test)
-
-    if test_name.startswith('FAILS_'):
-      self.modifier = self.FAILS
-    elif test_name.startswith('FLAKY_'):
-      self.modifier = self.FLAKY
-    elif test_name.startswith('DISABLED_'):
-      self.modifier = self.DISABLED
-    else:
-      self.modifier = self.NONE
-
-  def Fixable(self):
-    return self.failed or self.modifier == self.DISABLED
-
-
-class JSONResultsGeneratorBase(object):
-  """A JSON results generator for generic tests."""
-
-  MAX_NUMBER_OF_BUILD_RESULTS_TO_LOG = 750
-  # Min time (seconds) that will be added to the JSON.
-  MIN_TIME = 1
-
-  # Note that in non-chromium tests those chars are used to indicate
-  # test modifiers (FAILS, FLAKY, etc) but not actual test results.
-  PASS_RESULT = 'P'
-  SKIP_RESULT = 'X'
-  FAIL_RESULT = 'F'
-  FLAKY_RESULT = 'L'
-  NO_DATA_RESULT = 'N'
-
-  MODIFIER_TO_CHAR = {TestResult.NONE: PASS_RESULT,
-                      TestResult.DISABLED: SKIP_RESULT,
-                      TestResult.FAILS: FAIL_RESULT,
-                      TestResult.FLAKY: FLAKY_RESULT}
-
-  VERSION = 4
-  VERSION_KEY = 'version'
-  RESULTS = 'results'
-  TIMES = 'times'
-  BUILD_NUMBERS = 'buildNumbers'
-  TIME = 'secondsSinceEpoch'
-  TESTS = 'tests'
-
-  FIXABLE_COUNT = 'fixableCount'
-  FIXABLE = 'fixableCounts'
-  ALL_FIXABLE_COUNT = 'allFixableCount'
-
-  RESULTS_FILENAME = 'results.json'
-  TIMES_MS_FILENAME = 'times_ms.json'
-  INCREMENTAL_RESULTS_FILENAME = 'incremental_results.json'
-
-  # line too long pylint: disable=line-too-long
-  URL_FOR_TEST_LIST_JSON = (
-      'http://%s/testfile?builder=%s&name=%s&testlistjson=1&testtype=%s&master=%s')
-  # pylint: enable=line-too-long
-
-  def __init__(self, builder_name, build_name, build_number,
-               results_file_base_path, builder_base_url,
-               test_results_map, svn_repositories=None,
-               test_results_server=None,
-               test_type='',
-               master_name=''):
-    """Modifies the results.json file. Grabs it off the archive directory
-    if it is not found locally.
-
-    Args
-      builder_name: the builder name (e.g. Webkit).
-      build_name: the build name (e.g. webkit-rel).
-      build_number: the build number.
-      results_file_base_path: Absolute path to the directory containing the
-          results json file.
-      builder_base_url: the URL where we have the archived test results.
-          If this is None no archived results will be retrieved.
-      test_results_map: A dictionary that maps test_name to TestResult.
-      svn_repositories: A (json_field_name, svn_path) pair for SVN
-          repositories that tests rely on.  The SVN revision will be
-          included in the JSON with the given json_field_name.
-      test_results_server: server that hosts test results json.
-      test_type: test type string (e.g. 'layout-tests').
-      master_name: the name of the buildbot master.
-    """
-    self._builder_name = builder_name
-    self._build_name = build_name
-    self._build_number = build_number
-    self._builder_base_url = builder_base_url
-    self._results_directory = results_file_base_path
-
-    self._test_results_map = test_results_map
-    self._test_results = test_results_map.values()
-
-    self._svn_repositories = svn_repositories
-    if not self._svn_repositories:
-      self._svn_repositories = {}
-
-    self._test_results_server = test_results_server
-    self._test_type = test_type
-    self._master_name = master_name
-
-    self._archived_results = None
-
-  def GenerateJSONOutput(self):
-    json_object = self.GetJSON()
-    if json_object:
-      file_path = (
-          os.path.join(
-              self._results_directory,
-              self.INCREMENTAL_RESULTS_FILENAME))
-      WriteJSON(json_object, file_path)
-
-  def GenerateTimesMSFile(self):
-    times = TestTimingsTrie(self._test_results_map.values())
-    file_path = os.path.join(self._results_directory, self.TIMES_MS_FILENAME)
-    WriteJSON(times, file_path)
-
-  def GetJSON(self):
-    """Gets the results for the results.json file."""
-    results_json = {}
-
-    if not results_json:
-      results_json, error = self._GetArchivedJSONResults()
-      if error:
-        # If there was an error don't write a results.json
-        # file at all as it would lose all the information on the
-        # bot.
-        _log.error('Archive directory is inaccessible. Not '
-                   'modifying or clobbering the results.json '
-                   'file: ' + str(error))
-        return None
-
-    builder_name = self._builder_name
-    if results_json and builder_name not in results_json:
-      _log.debug('Builder name (%s) is not in the results.json file.'
-                 % builder_name)
-
-    self._ConvertJSONToCurrentVersion(results_json)
-
-    if builder_name not in results_json:
-      results_json[builder_name] = (
-          self._CreateResultsForBuilderJSON())
-
-    results_for_builder = results_json[builder_name]
-
-    if builder_name:
-      self._InsertGenericMetaData(results_for_builder)
-
-    self._InsertFailureSummaries(results_for_builder)
-
-    # Update the all failing tests with result type and time.
-    tests = results_for_builder[self.TESTS]
-    all_failing_tests = self._GetFailedTestNames()
-    all_failing_tests.update(ConvertTrieToFlatPaths(tests))
-
-    for test in all_failing_tests:
-      self._InsertTestTimeAndResult(test, tests)
-
-    return results_json
-
-  def SetArchivedResults(self, archived_results):
-    self._archived_results = archived_results
-
-  def UploadJSONFiles(self, json_files):
-    """Uploads the given json_files to the test_results_server (if the
-    test_results_server is given)."""
-    if not self._test_results_server:
-      return
-
-    if not self._master_name:
-      _log.error(
-          '--test-results-server was set, but --master-name was not.  Not '
-          'uploading JSON files.')
-      return
-
-    _log.info('Uploading JSON files for builder: %s', self._builder_name)
-    attrs = [('builder', self._builder_name),
-             ('testtype', self._test_type),
-             ('master', self._master_name)]
-
-    files = [(json_file, os.path.join(self._results_directory, json_file))
-             for json_file in json_files]
-
-    url = 'http://%s/testfile/upload' % self._test_results_server
-    # Set uploading timeout in case appengine server is having problems.
-    # 120 seconds are more than enough to upload test results.
-    uploader = _FileUploader(url, 120)
-    try:
-      response = uploader.UploadAsMultipartFormData(files, attrs)
-      if response:
-        if response.code == 200:
-          _log.info('JSON uploaded.')
-        else:
-          _log.debug(
-              "JSON upload failed, %d: '%s'" %
-              (response.code, response.read()))
-      else:
-        _log.error('JSON upload failed; no response returned')
-    except Exception, err:
-      _log.error('Upload failed: %s' % err)
-      return
-
-  def _GetTestTiming(self, test_name):
-    """Returns test timing data (elapsed time) in second
-    for the given test_name."""
-    if test_name in self._test_results_map:
-      # Floor for now to get time in seconds.
-      return int(self._test_results_map[test_name].test_run_time)
-    return 0
-
-  def _GetFailedTestNames(self):
-    """Returns a set of failed test names."""
-    return set([r.test_name for r in self._test_results if r.failed])
-
-  def _GetModifierChar(self, test_name):
-    """Returns a single char (e.g. SKIP_RESULT, FAIL_RESULT,
-    PASS_RESULT, NO_DATA_RESULT, etc) that indicates the test modifier
-    for the given test_name.
-    """
-    if test_name not in self._test_results_map:
-      return self.__class__.NO_DATA_RESULT
-
-    test_result = self._test_results_map[test_name]
-    if test_result.modifier in self.MODIFIER_TO_CHAR.keys():
-      return self.MODIFIER_TO_CHAR[test_result.modifier]
-
-    return self.__class__.PASS_RESULT
-
-  def _get_result_char(self, test_name):
-    """Returns a single char (e.g. SKIP_RESULT, FAIL_RESULT,
-    PASS_RESULT, NO_DATA_RESULT, etc) that indicates the test result
-    for the given test_name.
-    """
-    if test_name not in self._test_results_map:
-      return self.__class__.NO_DATA_RESULT
-
-    test_result = self._test_results_map[test_name]
-    if test_result.modifier == TestResult.DISABLED:
-      return self.__class__.SKIP_RESULT
-
-    if test_result.failed:
-      return self.__class__.FAIL_RESULT
-
-    return self.__class__.PASS_RESULT
-
-  def _GetSVNRevision(self, in_directory):
-    """Returns the svn revision for the given directory.
-
-    Args:
-      in_directory: The directory where svn is to be run.
-    """
-    # This is overridden in flakiness_dashboard_results_uploader.py.
-    raise NotImplementedError()
-
-  def _GetArchivedJSONResults(self):
-    """Download JSON file that only contains test
-    name list from test-results server. This is for generating incremental
-    JSON so the file generated has info for tests that failed before but
-    pass or are skipped from current run.
-
-    Returns (archived_results, error) tuple where error is None if results
-    were successfully read.
-    """
-    results_json = {}
-    old_results = None
-    error = None
-
-    if not self._test_results_server:
-      return {}, None
-
-    results_file_url = (self.URL_FOR_TEST_LIST_JSON %
-                        (urllib2.quote(self._test_results_server),
-                         urllib2.quote(self._builder_name),
-                         self.RESULTS_FILENAME,
-                         urllib2.quote(self._test_type),
-                         urllib2.quote(self._master_name)))
-
-    try:
-      # FIXME: We should talk to the network via a Host object.
-      results_file = urllib2.urlopen(results_file_url)
-      old_results = results_file.read()
-    except urllib2.HTTPError, http_error:
-      # A non-4xx status code means the bot is hosed for some reason
-      # and we can't grab the results.json file off of it.
-      if http_error.code < 400 and http_error.code >= 500:
-        error = http_error
-    except urllib2.URLError, url_error:
-      error = url_error
-
-    if old_results:
-      # Strip the prefix and suffix so we can get the actual JSON object.
-      old_results = StripJSONWrapper(old_results)
-
-      try:
-        results_json = json.loads(old_results)
-      except Exception:
-        _log.debug('results.json was not valid JSON. Clobbering.')
-        # The JSON file is not valid JSON. Just clobber the results.
-        results_json = {}
-    else:
-      _log.debug('Old JSON results do not exist. Starting fresh.')
-      results_json = {}
-
-    return results_json, error
-
-  def _InsertFailureSummaries(self, results_for_builder):
-    """Inserts aggregate pass/failure statistics into the JSON.
-    This method reads self._test_results and generates
-    FIXABLE, FIXABLE_COUNT and ALL_FIXABLE_COUNT entries.
-
-    Args:
-      results_for_builder: Dictionary containing the test results for a
-          single builder.
-    """
-    # Insert the number of tests that failed or skipped.
-    fixable_count = len([r for r in self._test_results if r.Fixable()])
-    self._InsertItemIntoRawList(results_for_builder,
-                                fixable_count, self.FIXABLE_COUNT)
-
-    # Create a test modifiers (FAILS, FLAKY etc) summary dictionary.
-    entry = {}
-    for test_name in self._test_results_map.iterkeys():
-      result_char = self._GetModifierChar(test_name)
-      entry[result_char] = entry.get(result_char, 0) + 1
-
-    # Insert the pass/skip/failure summary dictionary.
-    self._InsertItemIntoRawList(results_for_builder, entry,
-                                self.FIXABLE)
-
-    # Insert the number of all the tests that are supposed to pass.
-    all_test_count = len(self._test_results)
-    self._InsertItemIntoRawList(results_for_builder,
-                                all_test_count, self.ALL_FIXABLE_COUNT)
-
-  def _InsertItemIntoRawList(self, results_for_builder, item, key):
-    """Inserts the item into the list with the given key in the results for
-    this builder. Creates the list if no such list exists.
-
-    Args:
-      results_for_builder: Dictionary containing the test results for a
-          single builder.
-      item: Number or string to insert into the list.
-      key: Key in results_for_builder for the list to insert into.
-    """
-    if key in results_for_builder:
-      raw_list = results_for_builder[key]
-    else:
-      raw_list = []
-
-    raw_list.insert(0, item)
-    raw_list = raw_list[:self.MAX_NUMBER_OF_BUILD_RESULTS_TO_LOG]
-    results_for_builder[key] = raw_list
-
-  def _InsertItemRunLengthEncoded(self, item, encoded_results):
-    """Inserts the item into the run-length encoded results.
-
-    Args:
-      item: String or number to insert.
-      encoded_results: run-length encoded results. An array of arrays, e.g.
-          [[3,'A'],[1,'Q']] encodes AAAQ.
-    """
-    if len(encoded_results) and item == encoded_results[0][1]:
-      num_results = encoded_results[0][0]
-      if num_results <= self.MAX_NUMBER_OF_BUILD_RESULTS_TO_LOG:
-        encoded_results[0][0] = num_results + 1
-    else:
-      # Use a list instead of a class for the run-length encoding since
-      # we want the serialized form to be concise.
-      encoded_results.insert(0, [1, item])
-
-  def _InsertGenericMetaData(self, results_for_builder):
-    """ Inserts generic metadata (such as version number, current time etc)
-    into the JSON.
-
-    Args:
-      results_for_builder: Dictionary containing the test results for
-          a single builder.
-    """
-    self._InsertItemIntoRawList(results_for_builder,
-                                self._build_number, self.BUILD_NUMBERS)
-
-    # Include SVN revisions for the given repositories.
-    for (name, path) in self._svn_repositories:
-      # Note: for JSON file's backward-compatibility we use 'chrome' rather
-      # than 'chromium' here.
-      lowercase_name = name.lower()
-      if lowercase_name == 'chromium':
-        lowercase_name = 'chrome'
-      self._InsertItemIntoRawList(results_for_builder,
-                                  self._GetSVNRevision(path),
-                                  lowercase_name + 'Revision')
-
-    self._InsertItemIntoRawList(results_for_builder,
-                                int(time.time()),
-                                self.TIME)
-
-  def _InsertTestTimeAndResult(self, test_name, tests):
-    """ Insert a test item with its results to the given tests dictionary.
-
-    Args:
-      tests: Dictionary containing test result entries.
-    """
-
-    result = self._get_result_char(test_name)
-    test_time = self._GetTestTiming(test_name)
-
-    this_test = tests
-    for segment in test_name.split('/'):
-      if segment not in this_test:
-        this_test[segment] = {}
-      this_test = this_test[segment]
-
-    if not len(this_test):
-      self._PopulateResultsAndTimesJSON(this_test)
-
-    if self.RESULTS in this_test:
-      self._InsertItemRunLengthEncoded(result, this_test[self.RESULTS])
-    else:
-      this_test[self.RESULTS] = [[1, result]]
-
-    if self.TIMES in this_test:
-      self._InsertItemRunLengthEncoded(test_time, this_test[self.TIMES])
-    else:
-      this_test[self.TIMES] = [[1, test_time]]
-
-  def _ConvertJSONToCurrentVersion(self, results_json):
-    """If the JSON does not match the current version, converts it to the
-    current version and adds in the new version number.
-    """
-    if self.VERSION_KEY in results_json:
-      archive_version = results_json[self.VERSION_KEY]
-      if archive_version == self.VERSION:
-        return
-    else:
-      archive_version = 3
-
-    # version 3->4
-    if archive_version == 3:
-      for results in results_json.values():
-        self._ConvertTestsToTrie(results)
-
-    results_json[self.VERSION_KEY] = self.VERSION
-
-  def _ConvertTestsToTrie(self, results):
-    if not self.TESTS in results:
-      return
-
-    test_results = results[self.TESTS]
-    test_results_trie = {}
-    for test in test_results.iterkeys():
-      single_test_result = test_results[test]
-      AddPathToTrie(test, single_test_result, test_results_trie)
-
-    results[self.TESTS] = test_results_trie
-
-  def _PopulateResultsAndTimesJSON(self, results_and_times):
-    results_and_times[self.RESULTS] = []
-    results_and_times[self.TIMES] = []
-    return results_and_times
-
-  def _CreateResultsForBuilderJSON(self):
-    results_for_builder = {}
-    results_for_builder[self.TESTS] = {}
-    return results_for_builder
-
-  def _RemoveItemsOverMaxNumberOfBuilds(self, encoded_list):
-    """Removes items from the run-length encoded list after the final
-    item that exceeds the max number of builds to track.
-
-    Args:
-      encoded_results: run-length encoded results. An array of arrays, e.g.
-          [[3,'A'],[1,'Q']] encodes AAAQ.
-    """
-    num_builds = 0
-    index = 0
-    for result in encoded_list:
-      num_builds = num_builds + result[0]
-      index = index + 1
-      if num_builds > self.MAX_NUMBER_OF_BUILD_RESULTS_TO_LOG:
-        return encoded_list[:index]
-    return encoded_list
-
-  def _NormalizeResultsJSON(self, test, test_name, tests):
-    """ Prune tests where all runs pass or tests that no longer exist and
-    truncate all results to maxNumberOfBuilds.
-
-    Args:
-      test: ResultsAndTimes object for this test.
-      test_name: Name of the test.
-      tests: The JSON object with all the test results for this builder.
-    """
-    test[self.RESULTS] = self._RemoveItemsOverMaxNumberOfBuilds(
-        test[self.RESULTS])
-    test[self.TIMES] = self._RemoveItemsOverMaxNumberOfBuilds(
-        test[self.TIMES])
-
-    is_all_pass = self._IsResultsAllOfType(test[self.RESULTS],
-                                           self.PASS_RESULT)
-    is_all_no_data = self._IsResultsAllOfType(test[self.RESULTS],
-                                              self.NO_DATA_RESULT)
-    max_time = max([test_time[1] for test_time in test[self.TIMES]])
-
-    # Remove all passes/no-data from the results to reduce noise and
-    # filesize. If a test passes every run, but takes > MIN_TIME to run,
-    # don't throw away the data.
-    if is_all_no_data or (is_all_pass and max_time <= self.MIN_TIME):
-      del tests[test_name]
-
-  # method could be a function pylint: disable=R0201
-  def _IsResultsAllOfType(self, results, result_type):
-    """Returns whether all the results are of the given type
-    (e.g. all passes)."""
-    return len(results) == 1 and results[0][1] == result_type
-
-
-class _FileUploader(object):
-
-  def __init__(self, url, timeout_seconds):
-    self._url = url
-    self._timeout_seconds = timeout_seconds
-
-  def UploadAsMultipartFormData(self, files, attrs):
-    file_objs = []
-    for filename, path in files:
-      with file(path, 'rb') as fp:
-        file_objs.append(('file', filename, fp.read()))
-
-    # FIXME: We should use the same variable names for the formal and actual
-    # parameters.
-    content_type, data = _EncodeMultipartFormData(attrs, file_objs)
-    return self._UploadData(content_type, data)
-
-  def _UploadData(self, content_type, data):
-    start = time.time()
-    end = start + self._timeout_seconds
-    while time.time() < end:
-      try:
-        request = urllib2.Request(self._url, data,
-                                  {'Content-Type': content_type})
-        return urllib2.urlopen(request)
-      except urllib2.HTTPError as e:
-        _log.warn("Received HTTP status %s loading \"%s\".  "
-                  'Retrying in 10 seconds...' % (e.code, e.filename))
-        time.sleep(10)
-
-
-def _GetMIMEType(filename):
-  return mimetypes.guess_type(filename)[0] or 'application/octet-stream'
-
-
-# FIXME: Rather than taking tuples, this function should take more
-# structured data.
-def _EncodeMultipartFormData(fields, files):
-  """Encode form fields for multipart/form-data.
-
-  Args:
-    fields: A sequence of (name, value) elements for regular form fields.
-    files: A sequence of (name, filename, value) elements for data to be
-           uploaded as files.
-  Returns:
-    (content_type, body) ready for httplib.HTTP instance.
-
-  Source:
-    http://code.google.com/p/rietveld/source/browse/trunk/upload.py
-  """
-  BOUNDARY = '-M-A-G-I-C---B-O-U-N-D-A-R-Y-'
-  CRLF = '\r\n'
-  lines = []
-
-  for key, value in fields:
-    lines.append('--' + BOUNDARY)
-    lines.append('Content-Disposition: form-data; name="%s"' % key)
-    lines.append('')
-    if isinstance(value, unicode):
-      value = value.encode('utf-8')
-    lines.append(value)
-
-  for key, filename, value in files:
-    lines.append('--' + BOUNDARY)
-    lines.append('Content-Disposition: form-data; name="%s"; '
-                 'filename="%s"' % (key, filename))
-    lines.append('Content-Type: %s' % _GetMIMEType(filename))
-    lines.append('')
-    if isinstance(value, unicode):
-      value = value.encode('utf-8')
-    lines.append(value)
-
-  lines.append('--' + BOUNDARY + '--')
-  lines.append('')
-  body = CRLF.join(lines)
-  content_type = 'multipart/form-data; boundary=%s' % BOUNDARY
-  return content_type, body
diff --git a/build/android/pylib/results/flakiness_dashboard/results_uploader.py b/build/android/pylib/results/flakiness_dashboard/results_uploader.py
deleted file mode 100644
index b86d7ac..0000000
--- a/build/android/pylib/results/flakiness_dashboard/results_uploader.py
+++ /dev/null
@@ -1,181 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Uploads the results to the flakiness dashboard server."""
-# pylint: disable=E1002,R0201
-
-import logging
-import os
-import shutil
-import tempfile
-import xml
-
-
-from pylib import cmd_helper
-from pylib import constants
-from pylib.results.flakiness_dashboard import json_results_generator
-from pylib.utils import repo_utils
-
-
-
-class JSONResultsGenerator(json_results_generator.JSONResultsGeneratorBase):
-  """Writes test results to a JSON file and handles uploading that file to
-  the test results server.
-  """
-  def __init__(self, builder_name, build_name, build_number, tmp_folder,
-               test_results_map, test_results_server, test_type, master_name):
-    super(JSONResultsGenerator, self).__init__(
-        builder_name=builder_name,
-        build_name=build_name,
-        build_number=build_number,
-        results_file_base_path=tmp_folder,
-        builder_base_url=None,
-        test_results_map=test_results_map,
-        svn_repositories=(('webkit', 'third_party/WebKit'),
-                          ('chrome', '.')),
-        test_results_server=test_results_server,
-        test_type=test_type,
-        master_name=master_name)
-
-  #override
-  def _GetModifierChar(self, test_name):
-    if test_name not in self._test_results_map:
-      return self.__class__.NO_DATA_RESULT
-
-    return self._test_results_map[test_name].modifier
-
-  #override
-  def _GetSVNRevision(self, in_directory):
-    """Returns the git/svn revision for the given directory.
-
-    Args:
-      in_directory: The directory relative to src.
-    """
-    def _is_git_directory(in_directory):
-      """Returns true if the given directory is in a git repository.
-
-      Args:
-        in_directory: The directory path to be tested.
-      """
-      if os.path.exists(os.path.join(in_directory, '.git')):
-        return True
-      parent = os.path.dirname(in_directory)
-      if parent == constants.DIR_SOURCE_ROOT or parent == in_directory:
-        return False
-      return _is_git_directory(parent)
-
-    in_directory = os.path.join(constants.DIR_SOURCE_ROOT, in_directory)
-
-    if not os.path.exists(os.path.join(in_directory, '.svn')):
-      if _is_git_directory(in_directory):
-        return repo_utils.GetGitHeadSHA1(in_directory)
-      else:
-        return ''
-
-    output = cmd_helper.GetCmdOutput(['svn', 'info', '--xml'], cwd=in_directory)
-    try:
-      dom = xml.dom.minidom.parseString(output)
-      return dom.getElementsByTagName('entry')[0].getAttribute('revision')
-    except xml.parsers.expat.ExpatError:
-      return ''
-    return ''
-
-
-class ResultsUploader(object):
-  """Handles uploading buildbot tests results to the flakiness dashboard."""
-  def __init__(self, tests_type):
-    self._build_number = os.environ.get('BUILDBOT_BUILDNUMBER')
-    self._builder_name = os.environ.get('BUILDBOT_BUILDERNAME')
-    self._tests_type = tests_type
-
-    if not self._build_number or not self._builder_name:
-      raise Exception('You should not be uploading tests results to the server'
-                      'from your local machine.')
-
-    upstream = (tests_type != 'Chromium_Android_Instrumentation')
-    if upstream:
-      # TODO(frankf): Use factory properties (see buildbot/bb_device_steps.py)
-      # This requires passing the actual master name (e.g. 'ChromiumFYI' not
-      # 'chromium.fyi').
-      from slave import slave_utils # pylint: disable=F0401
-      self._build_name = slave_utils.SlaveBuildName(constants.DIR_SOURCE_ROOT)
-      self._master_name = slave_utils.GetActiveMaster()
-    else:
-      self._build_name = 'chromium-android'
-      buildbot_branch = os.environ.get('BUILDBOT_BRANCH')
-      if not buildbot_branch:
-        buildbot_branch = 'master'
-      else:
-        # Ensure there's no leading "origin/"
-        buildbot_branch = buildbot_branch[buildbot_branch.find('/') + 1:]
-      self._master_name = '%s-%s' % (self._build_name, buildbot_branch)
-
-    self._test_results_map = {}
-
-  def AddResults(self, test_results):
-    # TODO(frankf): Differentiate between fail/crash/timeouts.
-    conversion_map = [
-        (test_results.GetPass(), False,
-            json_results_generator.JSONResultsGeneratorBase.PASS_RESULT),
-        (test_results.GetFail(), True,
-            json_results_generator.JSONResultsGeneratorBase.FAIL_RESULT),
-        (test_results.GetCrash(), True,
-            json_results_generator.JSONResultsGeneratorBase.FAIL_RESULT),
-        (test_results.GetTimeout(), True,
-            json_results_generator.JSONResultsGeneratorBase.FAIL_RESULT),
-        (test_results.GetUnknown(), True,
-            json_results_generator.JSONResultsGeneratorBase.NO_DATA_RESULT),
-        ]
-
-    for results_list, failed, modifier in conversion_map:
-      for single_test_result in results_list:
-        test_result = json_results_generator.TestResult(
-            test=single_test_result.GetName(),
-            failed=failed,
-            elapsed_time=single_test_result.GetDuration() / 1000)
-        # The WebKit TestResult object sets the modifier it based on test name.
-        # Since we don't use the same test naming convention as WebKit the
-        # modifier will be wrong, so we need to overwrite it.
-        test_result.modifier = modifier
-
-        self._test_results_map[single_test_result.GetName()] = test_result
-
-  def Upload(self, test_results_server):
-    if not self._test_results_map:
-      return
-
-    tmp_folder = tempfile.mkdtemp()
-
-    try:
-      results_generator = JSONResultsGenerator(
-          builder_name=self._builder_name,
-          build_name=self._build_name,
-          build_number=self._build_number,
-          tmp_folder=tmp_folder,
-          test_results_map=self._test_results_map,
-          test_results_server=test_results_server,
-          test_type=self._tests_type,
-          master_name=self._master_name)
-
-      json_files = ["incremental_results.json", "times_ms.json"]
-      results_generator.GenerateJSONOutput()
-      results_generator.GenerateTimesMSFile()
-      results_generator.UploadJSONFiles(json_files)
-    except Exception as e:
-      logging.error("Uploading results to test server failed: %s." % e)
-    finally:
-      shutil.rmtree(tmp_folder)
-
-
-def Upload(results, flakiness_dashboard_server, test_type):
-  """Reports test results to the flakiness dashboard for Chrome for Android.
-
-  Args:
-    results: test results.
-    flakiness_dashboard_server: the server to upload the results to.
-    test_type: the type of the tests (as displayed by the flakiness dashboard).
-  """
-  uploader = ResultsUploader(test_type)
-  uploader.AddResults(results)
-  uploader.Upload(flakiness_dashboard_server)
diff --git a/build/android/pylib/results/json_results.py b/build/android/pylib/results/json_results.py
deleted file mode 100644
index 65664e3..0000000
--- a/build/android/pylib/results/json_results.py
+++ /dev/null
@@ -1,139 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import json
-import logging
-
-from pylib.base import base_test_result
-
-
-def GenerateResultsDict(test_run_result):
-  """Create a results dict from |test_run_result| suitable for writing to JSON.
-  Args:
-    test_run_result: a base_test_result.TestRunResults object.
-  Returns:
-    A results dict that mirrors the one generated by
-      base/test/launcher/test_results_tracker.cc:SaveSummaryAsJSON.
-  """
-  # Example json output.
-  # {
-  #   "global_tags": [],
-  #   "all_tests": [
-  #     "test1",
-  #     "test2",
-  #    ],
-  #   "disabled_tests": [],
-  #   "per_iteration_data": [
-  #     {
-  #       "test1": [
-  #         {
-  #           "status": "SUCCESS",
-  #           "elapsed_time_ms": 1,
-  #           "output_snippet": "",
-  #           "output_snippet_base64": "",
-  #           "losless_snippet": "",
-  #         },
-  #       ],
-  #       "test2": [
-  #         {
-  #           "status": "FAILURE",
-  #           "elapsed_time_ms": 12,
-  #           "output_snippet": "",
-  #           "output_snippet_base64": "",
-  #           "losless_snippet": "",
-  #         },
-  #       ],
-  #     },
-  #   ],
-  # }
-
-  assert isinstance(test_run_result, base_test_result.TestRunResults)
-
-  def status_as_string(s):
-    if s == base_test_result.ResultType.PASS:
-      return 'SUCCESS'
-    elif s == base_test_result.ResultType.SKIP:
-      return 'SKIPPED'
-    elif s == base_test_result.ResultType.FAIL:
-      return 'FAILURE'
-    elif s == base_test_result.ResultType.CRASH:
-      return 'CRASH'
-    elif s == base_test_result.ResultType.TIMEOUT:
-      return 'TIMEOUT'
-    elif s == base_test_result.ResultType.UNKNOWN:
-      return 'UNKNOWN'
-
-  def generate_iteration_data(t):
-    return {
-      t.GetName(): [
-        {
-          'status': status_as_string(t.GetType()),
-          'elapsed_time_ms': t.GetDuration(),
-          'output_snippet': '',
-          'losless_snippet': '',
-          'output_snippet_base64:': '',
-        }
-      ]
-    }
-
-  all_tests_tuple, per_iteration_data_tuple = zip(
-      *[(t.GetName(), generate_iteration_data(t))
-        for t in test_run_result.GetAll()])
-
-  return {
-    'global_tags': [],
-    'all_tests': list(all_tests_tuple),
-    # TODO(jbudorick): Add support for disabled tests within base_test_result.
-    'disabled_tests': [],
-    'per_iteration_data': list(per_iteration_data_tuple),
-  }
-
-
-def GenerateJsonResultsFile(test_run_result, file_path):
-  """Write |test_run_result| to JSON.
-
-  This emulates the format of the JSON emitted by
-  base/test/launcher/test_results_tracker.cc:SaveSummaryAsJSON.
-
-  Args:
-    test_run_result: a base_test_result.TestRunResults object.
-    file_path: The path to the JSON file to write.
-  """
-  with open(file_path, 'w') as json_result_file:
-    json_result_file.write(json.dumps(GenerateResultsDict(test_run_result)))
-
-
-def ParseResultsFromJson(json_results):
-  """Creates a list of BaseTestResult objects from JSON.
-
-  Args:
-    json_results: A JSON dict in the format created by
-                  GenerateJsonResultsFile.
-  """
-
-  def string_as_status(s):
-    if s == 'SUCCESS':
-      return base_test_result.ResultType.PASS
-    elif s == 'SKIPPED':
-      return base_test_result.ResultType.SKIP
-    elif s == 'FAILURE':
-      return base_test_result.ResultType.FAIL
-    elif s == 'CRASH':
-      return base_test_result.ResultType.CRASH
-    elif s == 'TIMEOUT':
-      return base_test_result.ResultType.TIMEOUT
-    else:
-      return base_test_result.ResultType.UNKNOWN
-
-  results_list = []
-  testsuite_runs = json_results['per_iteration_data']
-  for testsuite_run in testsuite_runs:
-    for test, test_runs in testsuite_run.iteritems():
-      results_list.extend(
-          [base_test_result.BaseTestResult(test,
-                                           string_as_status(tr['status']),
-                                           duration=tr['elapsed_time_ms'])
-          for tr in test_runs])
-  return results_list
-
diff --git a/build/android/pylib/results/json_results_test.py b/build/android/pylib/results/json_results_test.py
deleted file mode 100755
index 1bc730d..0000000
--- a/build/android/pylib/results/json_results_test.py
+++ /dev/null
@@ -1,133 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import unittest
-
-from pylib.base import base_test_result
-from pylib.results import json_results
-
-
-class JsonResultsTest(unittest.TestCase):
-
-  def testGenerateResultsDict_passedResult(self):
-    result = base_test_result.BaseTestResult(
-        'test.package.TestName', base_test_result.ResultType.PASS)
-
-    all_results = base_test_result.TestRunResults()
-    all_results.AddResult(result)
-
-    results_dict = json_results.GenerateResultsDict(all_results)
-    self.assertEquals(
-        ['test.package.TestName'],
-        results_dict['all_tests'])
-    self.assertEquals(1, len(results_dict['per_iteration_data']))
-
-    iteration_result = results_dict['per_iteration_data'][0]
-    self.assertTrue('test.package.TestName' in iteration_result)
-    self.assertEquals(1, len(iteration_result['test.package.TestName']))
-
-    test_iteration_result = iteration_result['test.package.TestName'][0]
-    self.assertTrue('status' in test_iteration_result)
-    self.assertEquals('SUCCESS', test_iteration_result['status'])
-
-  def testGenerateResultsDict_skippedResult(self):
-    result = base_test_result.BaseTestResult(
-        'test.package.TestName', base_test_result.ResultType.SKIP)
-
-    all_results = base_test_result.TestRunResults()
-    all_results.AddResult(result)
-
-    results_dict = json_results.GenerateResultsDict(all_results)
-    self.assertEquals(
-        ['test.package.TestName'],
-        results_dict['all_tests'])
-    self.assertEquals(1, len(results_dict['per_iteration_data']))
-
-    iteration_result = results_dict['per_iteration_data'][0]
-    self.assertTrue('test.package.TestName' in iteration_result)
-    self.assertEquals(1, len(iteration_result['test.package.TestName']))
-
-    test_iteration_result = iteration_result['test.package.TestName'][0]
-    self.assertTrue('status' in test_iteration_result)
-    self.assertEquals('SKIPPED', test_iteration_result['status'])
-
-  def testGenerateResultsDict_failedResult(self):
-    result = base_test_result.BaseTestResult(
-        'test.package.TestName', base_test_result.ResultType.FAIL)
-
-    all_results = base_test_result.TestRunResults()
-    all_results.AddResult(result)
-
-    results_dict = json_results.GenerateResultsDict(all_results)
-    self.assertEquals(
-        ['test.package.TestName'],
-        results_dict['all_tests'])
-    self.assertEquals(1, len(results_dict['per_iteration_data']))
-
-    iteration_result = results_dict['per_iteration_data'][0]
-    self.assertTrue('test.package.TestName' in iteration_result)
-    self.assertEquals(1, len(iteration_result['test.package.TestName']))
-
-    test_iteration_result = iteration_result['test.package.TestName'][0]
-    self.assertTrue('status' in test_iteration_result)
-    self.assertEquals('FAILURE', test_iteration_result['status'])
-
-  def testGenerateResultsDict_duration(self):
-    result = base_test_result.BaseTestResult(
-        'test.package.TestName', base_test_result.ResultType.PASS, duration=123)
-
-    all_results = base_test_result.TestRunResults()
-    all_results.AddResult(result)
-
-    results_dict = json_results.GenerateResultsDict(all_results)
-    self.assertEquals(
-        ['test.package.TestName'],
-        results_dict['all_tests'])
-    self.assertEquals(1, len(results_dict['per_iteration_data']))
-
-    iteration_result = results_dict['per_iteration_data'][0]
-    self.assertTrue('test.package.TestName' in iteration_result)
-    self.assertEquals(1, len(iteration_result['test.package.TestName']))
-
-    test_iteration_result = iteration_result['test.package.TestName'][0]
-    self.assertTrue('elapsed_time_ms' in test_iteration_result)
-    self.assertEquals(123, test_iteration_result['elapsed_time_ms'])
-
-  def testGenerateResultsDict_multipleResults(self):
-    result1 = base_test_result.BaseTestResult(
-        'test.package.TestName1', base_test_result.ResultType.PASS)
-    result2 = base_test_result.BaseTestResult(
-        'test.package.TestName2', base_test_result.ResultType.PASS)
-
-    all_results = base_test_result.TestRunResults()
-    all_results.AddResult(result1)
-    all_results.AddResult(result2)
-
-    results_dict = json_results.GenerateResultsDict(all_results)
-    self.assertEquals(
-        ['test.package.TestName1', 'test.package.TestName2'],
-        results_dict['all_tests'])
-    self.assertEquals(2, len(results_dict['per_iteration_data']))
-
-    expected_tests = set([
-        'test.package.TestName1',
-        'test.package.TestName2',
-    ])
-
-    for iteration_result in results_dict['per_iteration_data']:
-      self.assertEquals(1, len(iteration_result))
-      name = iteration_result.keys()[0]
-      self.assertTrue(name in expected_tests)
-      expected_tests.remove(name)
-      self.assertEquals(1, len(iteration_result[name]))
-
-      test_iteration_result = iteration_result[name][0]
-      self.assertTrue('status' in test_iteration_result)
-      self.assertEquals('SUCCESS', test_iteration_result['status'])
-
-
-if __name__ == '__main__':
-  unittest.main(verbosity=2)
-
diff --git a/build/android/pylib/results/report_results.py b/build/android/pylib/results/report_results.py
deleted file mode 100644
index 4fc6aa0..0000000
--- a/build/android/pylib/results/report_results.py
+++ /dev/null
@@ -1,114 +0,0 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Module containing utility functions for reporting results."""
-
-import logging
-import os
-import re
-
-from pylib import constants
-from pylib.results.flakiness_dashboard import results_uploader
-
-
-def _LogToFile(results, test_type, suite_name):
-  """Log results to local files which can be used for aggregation later."""
-  log_file_path = os.path.join(constants.GetOutDirectory(), 'test_logs')
-  if not os.path.exists(log_file_path):
-    os.mkdir(log_file_path)
-  full_file_name = os.path.join(
-      log_file_path, re.sub(r'\W', '_', test_type).lower() + '.log')
-  if not os.path.exists(full_file_name):
-    with open(full_file_name, 'w') as log_file:
-      print >> log_file, '\n%s results for %s build %s:' % (
-          test_type, os.environ.get('BUILDBOT_BUILDERNAME'),
-          os.environ.get('BUILDBOT_BUILDNUMBER'))
-    logging.info('Writing results to %s.' % full_file_name)
-
-  logging.info('Writing results to %s.' % full_file_name)
-  with open(full_file_name, 'a') as log_file:
-    shortened_suite_name = suite_name[:25] + (suite_name[25:] and '...')
-    print >> log_file, '%s%s' % (shortened_suite_name.ljust(30),
-                                 results.GetShortForm())
-
-
-def _LogToFlakinessDashboard(results, test_type, test_package,
-                             flakiness_server):
-  """Upload results to the flakiness dashboard"""
-  logging.info('Upload results for test type "%s", test package "%s" to %s' %
-               (test_type, test_package, flakiness_server))
-
-  try:
-    if test_type == 'Instrumentation':
-      if flakiness_server == constants.UPSTREAM_FLAKINESS_SERVER:
-        assert test_package in ['ContentShellTest',
-                                'ChromePublicTest',
-                                'ChromeShellTest',
-                                'ChromeSyncShellTest',
-                                'AndroidWebViewTest']
-        dashboard_test_type = ('%s_instrumentation_tests' %
-                               test_package.lower().rstrip('test'))
-      # Downstream server.
-      else:
-        dashboard_test_type = 'Chromium_Android_Instrumentation'
-
-    elif test_type == 'Unit test':
-      dashboard_test_type = test_package
-
-    else:
-      logging.warning('Invalid test type')
-      return
-
-    results_uploader.Upload(
-        results, flakiness_server, dashboard_test_type)
-
-  except Exception as e:
-    logging.error(e)
-
-
-def LogFull(results, test_type, test_package, annotation=None,
-            flakiness_server=None):
-  """Log the tests results for the test suite.
-
-  The results will be logged three different ways:
-    1. Log to stdout.
-    2. Log to local files for aggregating multiple test steps
-       (on buildbots only).
-    3. Log to flakiness dashboard (on buildbots only).
-
-  Args:
-    results: An instance of TestRunResults object.
-    test_type: Type of the test (e.g. 'Instrumentation', 'Unit test', etc.).
-    test_package: Test package name (e.g. 'ipc_tests' for gtests,
-                  'ContentShellTest' for instrumentation tests)
-    annotation: If instrumenation test type, this is a list of annotations
-                (e.g. ['Smoke', 'SmallTest']).
-    flakiness_server: If provider, upload the results to flakiness dashboard
-                      with this URL.
-    """
-  if not results.DidRunPass():
-    logging.critical('*' * 80)
-    logging.critical('Detailed Logs')
-    logging.critical('*' * 80)
-    for line in results.GetLogs().splitlines():
-      logging.critical(line)
-  logging.critical('*' * 80)
-  logging.critical('Summary')
-  logging.critical('*' * 80)
-  for line in results.GetGtestForm().splitlines():
-    logging.critical(line)
-  logging.critical('*' * 80)
-
-  if os.environ.get('BUILDBOT_BUILDERNAME'):
-    # It is possible to have multiple buildbot steps for the same
-    # instrumenation test package using different annotations.
-    if annotation and len(annotation) == 1:
-      suite_name = annotation[0]
-    else:
-      suite_name = test_package
-    _LogToFile(results, test_type, suite_name)
-
-    if flakiness_server:
-      _LogToFlakinessDashboard(results, test_type, test_package,
-                               flakiness_server)
diff --git a/build/android/pylib/screenshot.py b/build/android/pylib/screenshot.py
deleted file mode 100644
index 0fcc590..0000000
--- a/build/android/pylib/screenshot.py
+++ /dev/null
@@ -1,99 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging
-import os
-import tempfile
-import time
-
-from pylib import cmd_helper
-from pylib import device_signal
-from pylib.device import device_errors
-
-# TODO(jbudorick) Remove once telemetry gets switched over.
-import pylib.android_commands
-import pylib.device.device_utils
-
-
-class VideoRecorder(object):
-  """Records a screen capture video from an Android Device (KitKat or newer).
-
-  Args:
-    device: DeviceUtils instance.
-    host_file: Path to the video file to store on the host.
-    megabits_per_second: Video bitrate in megabits per second. Allowed range
-                         from 0.1 to 100 mbps.
-    size: Video frame size tuple (width, height) or None to use the device
-          default.
-    rotate: If True, the video will be rotated 90 degrees.
-  """
-  def __init__(self, device, megabits_per_second=4, size=None,
-               rotate=False):
-    # TODO(jbudorick) Remove once telemetry gets switched over.
-    if isinstance(device, pylib.android_commands.AndroidCommands):
-      device = pylib.device.device_utils.DeviceUtils(device)
-    self._device = device
-    self._device_file = (
-        '%s/screen-recording.mp4' % device.GetExternalStoragePath())
-    self._recorder = None
-    self._recorder_stdout = None
-    self._is_started = False
-
-    self._args = ['adb']
-    if str(self._device):
-      self._args += ['-s', str(self._device)]
-    self._args += ['shell', 'screenrecord', '--verbose']
-    self._args += ['--bit-rate', str(megabits_per_second * 1000 * 1000)]
-    if size:
-      self._args += ['--size', '%dx%d' % size]
-    if rotate:
-      self._args += ['--rotate']
-    self._args += [self._device_file]
-
-  def Start(self):
-    """Start recording video."""
-    self._recorder_stdout = tempfile.mkstemp()[1]
-    self._recorder = cmd_helper.Popen(
-        self._args, stdout=open(self._recorder_stdout, 'w'))
-    if not self._device.GetPids('screenrecord'):
-      raise RuntimeError('Recording failed. Is your device running Android '
-                         'KitKat or later?')
-
-  def IsStarted(self):
-    if not self._is_started:
-      for line in open(self._recorder_stdout):
-        self._is_started = line.startswith('Content area is ')
-        if self._is_started:
-          break
-    return self._is_started
-
-  def Stop(self):
-    """Stop recording video."""
-    os.remove(self._recorder_stdout)
-    self._is_started = False
-    if not self._recorder:
-      return
-    if not self._device.KillAll('screenrecord', signum=device_signal.SIGINT,
-                                quiet=True):
-      logging.warning('Nothing to kill: screenrecord was not running')
-    self._recorder.wait()
-
-  def Pull(self, host_file=None):
-    """Pull resulting video file from the device.
-
-    Args:
-      host_file: Path to the video file to store on the host.
-    Returns:
-      Output video file name on the host.
-    """
-    # TODO(jbudorick): Merge filename generation with the logic for doing so in
-    # DeviceUtils.
-    host_file_name = (
-        host_file
-        or 'screen-recording-%s.mp4' % time.strftime('%Y%m%dT%H%M%S',
-                                                     time.localtime()))
-    host_file_name = os.path.abspath(host_file_name)
-    self._device.PullFile(self._device_file, host_file_name)
-    self._device.RunShellCommand('rm -f "%s"' % self._device_file)
-    return host_file_name
diff --git a/build/android/pylib/sdk/__init__.py b/build/android/pylib/sdk/__init__.py
deleted file mode 100644
index 50b23df..0000000
--- a/build/android/pylib/sdk/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
diff --git a/build/android/pylib/sdk/aapt.py b/build/android/pylib/sdk/aapt.py
deleted file mode 100644
index 3d317ff..0000000
--- a/build/android/pylib/sdk/aapt.py
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""This module wraps the Android Asset Packaging Tool."""
-
-import os
-
-from pylib import cmd_helper
-from pylib import constants
-from pylib.utils import timeout_retry
-
-_AAPT_PATH = os.path.join(constants.ANDROID_SDK_TOOLS, 'aapt')
-
-def _RunAaptCmd(args):
-  """Runs an aapt command.
-
-  Args:
-    args: A list of arguments for aapt.
-
-  Returns:
-    The output of the command.
-  """
-  cmd = [_AAPT_PATH] + args
-  status, output = cmd_helper.GetCmdStatusAndOutput(cmd)
-  if status != 0:
-    raise Exception('Failed running aapt command: "%s" with output "%s".' %
-                    (' '.join(cmd), output))
-  return output
-
-def Dump(what, apk, assets=None):
-  """Returns the output of the aapt dump command.
-
-  Args:
-    what: What you want to dump.
-    apk: Path to apk you want to dump information for.
-    assets: List of assets in apk you want to dump information for.
-  """
-  assets = assets or []
-  if isinstance(assets, basestring):
-    assets = [assets]
-  return _RunAaptCmd(['dump', what, apk] + assets).splitlines()
\ No newline at end of file
diff --git a/build/android/pylib/sdk/dexdump.py b/build/android/pylib/sdk/dexdump.py
deleted file mode 100644
index ec10aba..0000000
--- a/build/android/pylib/sdk/dexdump.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import os
-
-from pylib import cmd_helper
-from pylib import constants
-
-_DEXDUMP_PATH = os.path.join(constants.ANDROID_SDK_TOOLS, 'dexdump')
-
-def DexDump(dexfiles, file_summary=False):
-  """A wrapper around the Android SDK's dexdump tool.
-
-  Args:
-    dexfiles: The dexfile or list of dex files to dump.
-    file_summary: Display summary information from the file header. (-f)
-
-  Returns:
-    An iterable over the output lines.
-  """
-  # TODO(jbudorick): Add support for more options as necessary.
-  if isinstance(dexfiles, basestring):
-    dexfiles = [dexfiles]
-  args = [_DEXDUMP_PATH] + dexfiles
-  if file_summary:
-    args.append('-f')
-
-  return cmd_helper.IterCmdOutputLines(args)
-
diff --git a/build/android/pylib/sdk/split_select.py b/build/android/pylib/sdk/split_select.py
deleted file mode 100644
index e204662..0000000
--- a/build/android/pylib/sdk/split_select.py
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""This module wraps Android's split-select tool."""
-
-import os
-
-from pylib import cmd_helper
-from pylib import constants
-from pylib.utils import timeout_retry
-
-_SPLIT_SELECT_PATH = os.path.join(constants.ANDROID_SDK_TOOLS, 'split-select')
-
-def _RunSplitSelectCmd(args):
-  """Runs a split-select command.
-
-  Args:
-    args: A list of arguments for split-select.
-
-  Returns:
-    The output of the command.
-  """
-  cmd = [_SPLIT_SELECT_PATH] + args
-  status, output = cmd_helper.GetCmdStatusAndOutput(cmd)
-  if status != 0:
-    raise Exception('Failed running command "%s" with output "%s".' %
-                    (' '.join(cmd), output))
-  return output
-
-def _SplitConfig(device):
-  """Returns a config specifying which APK splits are required by the device.
-
-  Args:
-    device: A DeviceUtils object.
-  """
-  return ('%s-r%s-%s:%s' %
-          (device.language,
-           device.country,
-           device.screen_density,
-           device.product_cpu_abi))
-
-def SelectSplits(device, base_apk, split_apks):
-  """Determines which APK splits the device requires.
-
-  Args:
-    device: A DeviceUtils object.
-    base_apk: The path of the base APK.
-    split_apks: A list of paths of APK splits.
-
-  Returns:
-    The list of APK splits that the device requires.
-  """
-  config = _SplitConfig(device)
-  args = ['--target', config, '--base', base_apk]
-  for split in split_apks:
-    args.extend(['--split', split])
-  return _RunSplitSelectCmd(args).splitlines()
\ No newline at end of file
diff --git a/build/android/pylib/symbols/PRESUBMIT.py b/build/android/pylib/symbols/PRESUBMIT.py
deleted file mode 100644
index b4d94ae..0000000
--- a/build/android/pylib/symbols/PRESUBMIT.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-def CommonChecks(input_api, output_api):
-  output = []
-  output.extend(input_api.canned_checks.RunPylint(input_api, output_api))
-  output.extend(input_api.canned_checks.RunUnitTestsInDirectory(
-      input_api,
-      output_api,
-      input_api.PresubmitLocalPath(),
-      whitelist=[r'^.+_unittest\.py$']))
-  return output
-
-
-def CheckChangeOnUpload(input_api, output_api):
-  return CommonChecks(input_api, output_api)
-
-
-def CheckChangeOnCommit(input_api, output_api):
-  return CommonChecks(input_api, output_api)
\ No newline at end of file
diff --git a/build/android/pylib/symbols/__init__.py b/build/android/pylib/symbols/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/build/android/pylib/symbols/__init__.py
+++ /dev/null
diff --git a/build/android/pylib/symbols/elf_symbolizer.py b/build/android/pylib/symbols/elf_symbolizer.py
deleted file mode 100644
index 374063a..0000000
--- a/build/android/pylib/symbols/elf_symbolizer.py
+++ /dev/null
@@ -1,467 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import collections
-import datetime
-import logging
-import multiprocessing
-import os
-import posixpath
-import Queue
-import re
-import subprocess
-import sys
-import threading
-import time
-
-
-# addr2line builds a possibly infinite memory cache that can exhaust
-# the computer's memory if allowed to grow for too long. This constant
-# controls how many lookups we do before restarting the process. 4000
-# gives near peak performance without extreme memory usage.
-ADDR2LINE_RECYCLE_LIMIT = 4000
-
-
-class ELFSymbolizer(object):
-  """An uber-fast (multiprocessing, pipelined and asynchronous) ELF symbolizer.
-
-  This class is a frontend for addr2line (part of GNU binutils), designed to
-  symbolize batches of large numbers of symbols for a given ELF file. It
-  supports sharding symbolization against many addr2line instances and
-  pipelining of multiple requests per each instance (in order to hide addr2line
-  internals and OS pipe latencies).
-
-  The interface exhibited by this class is a very simple asynchronous interface,
-  which is based on the following three methods:
-  - SymbolizeAsync(): used to request (enqueue) resolution of a given address.
-  - The |callback| method: used to communicated back the symbol information.
-  - Join(): called to conclude the batch to gather the last outstanding results.
-  In essence, before the Join method returns, this class will have issued as
-  many callbacks as the number of SymbolizeAsync() calls. In this regard, note
-  that due to multiprocess sharding, callbacks can be delivered out of order.
-
-  Some background about addr2line:
-  - it is invoked passing the elf path in the cmdline, piping the addresses in
-    its stdin and getting results on its stdout.
-  - it has pretty large response times for the first requests, but it
-    works very well in streaming mode once it has been warmed up.
-  - it doesn't scale by itself (on more cores). However, spawning multiple
-    instances at the same time on the same file is pretty efficient as they
-    keep hitting the pagecache and become mostly CPU bound.
-  - it might hang or crash, mostly for OOM. This class deals with both of these
-    problems.
-
-  Despite the "scary" imports and the multi* words above, (almost) no multi-
-  threading/processing is involved from the python viewpoint. Concurrency
-  here is achieved by spawning several addr2line subprocesses and handling their
-  output pipes asynchronously. Therefore, all the code here (with the exception
-  of the Queue instance in Addr2Line) should be free from mind-blowing
-  thread-safety concerns.
-
-  The multiprocess sharding works as follows:
-  The symbolizer tries to use the lowest number of addr2line instances as
-  possible (with respect of |max_concurrent_jobs|) and enqueue all the requests
-  in a single addr2line instance. For few symbols (i.e. dozens) sharding isn't
-  worth the startup cost.
-  The multiprocess logic kicks in as soon as the queues for the existing
-  instances grow. Specifically, once all the existing instances reach the
-  |max_queue_size| bound, a new addr2line instance is kicked in.
-  In the case of a very eager producer (i.e. all |max_concurrent_jobs| instances
-  have a backlog of |max_queue_size|), back-pressure is applied on the caller by
-  blocking the SymbolizeAsync method.
-
-  This module has been deliberately designed to be dependency free (w.r.t. of
-  other modules in this project), to allow easy reuse in external projects.
-  """
-
-  def __init__(self, elf_file_path, addr2line_path, callback, inlines=False,
-      max_concurrent_jobs=None, addr2line_timeout=30, max_queue_size=50,
-      source_root_path=None, strip_base_path=None):
-    """Args:
-      elf_file_path: path of the elf file to be symbolized.
-      addr2line_path: path of the toolchain's addr2line binary.
-      callback: a callback which will be invoked for each resolved symbol with
-          the two args (sym_info, callback_arg). The former is an instance of
-          |ELFSymbolInfo| and contains the symbol information. The latter is an
-          embedder-provided argument which is passed to SymbolizeAsync().
-      inlines: when True, the ELFSymbolInfo will contain also the details about
-          the outer inlining functions. When False, only the innermost function
-          will be provided.
-      max_concurrent_jobs: Max number of addr2line instances spawned.
-          Parallelize responsibly, addr2line is a memory and I/O monster.
-      max_queue_size: Max number of outstanding requests per addr2line instance.
-      addr2line_timeout: Max time (in seconds) to wait for a addr2line response.
-          After the timeout, the instance will be considered hung and respawned.
-      source_root_path: In some toolchains only the name of the source file is
-          is output, without any path information; disambiguation searches
-          through the source directory specified by |source_root_path| argument
-          for files whose name matches, adding the full path information to the
-          output. For example, if the toolchain outputs "unicode.cc" and there
-          is a file called "unicode.cc" located under |source_root_path|/foo,
-          the tool will replace "unicode.cc" with
-          "|source_root_path|/foo/unicode.cc". If there are multiple files with
-          the same name, disambiguation will fail because the tool cannot
-          determine which of the files was the source of the symbol.
-      strip_base_path: Rebases the symbols source paths onto |source_root_path|
-          (i.e replace |strip_base_path| with |source_root_path).
-    """
-    assert(os.path.isfile(addr2line_path)), 'Cannot find ' + addr2line_path
-    self.elf_file_path = elf_file_path
-    self.addr2line_path = addr2line_path
-    self.callback = callback
-    self.inlines = inlines
-    self.max_concurrent_jobs = (max_concurrent_jobs or
-                                min(multiprocessing.cpu_count(), 4))
-    self.max_queue_size = max_queue_size
-    self.addr2line_timeout = addr2line_timeout
-    self.requests_counter = 0  # For generating monotonic request IDs.
-    self._a2l_instances = []  # Up to |max_concurrent_jobs| _Addr2Line inst.
-
-    # If necessary, create disambiguation lookup table
-    self.disambiguate = source_root_path is not None
-    self.disambiguation_table = {}
-    self.strip_base_path = strip_base_path
-    if(self.disambiguate):
-      self.source_root_path = os.path.abspath(source_root_path)
-      self._CreateDisambiguationTable()
-
-    # Create one addr2line instance. More instances will be created on demand
-    # (up to |max_concurrent_jobs|) depending on the rate of the requests.
-    self._CreateNewA2LInstance()
-
-  def SymbolizeAsync(self, addr, callback_arg=None):
-    """Requests symbolization of a given address.
-
-    This method is not guaranteed to return immediately. It generally does, but
-    in some scenarios (e.g. all addr2line instances have full queues) it can
-    block to create back-pressure.
-
-    Args:
-      addr: address to symbolize.
-      callback_arg: optional argument which will be passed to the |callback|."""
-    assert(isinstance(addr, int))
-
-    # Process all the symbols that have been resolved in the meanwhile.
-    # Essentially, this drains all the addr2line(s) out queues.
-    for a2l_to_purge in self._a2l_instances:
-      a2l_to_purge.ProcessAllResolvedSymbolsInQueue()
-      a2l_to_purge.RecycleIfNecessary()
-
-    # Find the best instance according to this logic:
-    # 1. Find an existing instance with the shortest queue.
-    # 2. If all of instances' queues are full, but there is room in the pool,
-    #    (i.e. < |max_concurrent_jobs|) create a new instance.
-    # 3. If there were already |max_concurrent_jobs| instances and all of them
-    #    had full queues, make back-pressure.
-
-    # 1.
-    def _SortByQueueSizeAndReqID(a2l):
-      return (a2l.queue_size, a2l.first_request_id)
-    a2l = min(self._a2l_instances, key=_SortByQueueSizeAndReqID)
-
-    # 2.
-    if (a2l.queue_size >= self.max_queue_size and
-        len(self._a2l_instances) < self.max_concurrent_jobs):
-      a2l = self._CreateNewA2LInstance()
-
-    # 3.
-    if a2l.queue_size >= self.max_queue_size:
-      a2l.WaitForNextSymbolInQueue()
-
-    a2l.EnqueueRequest(addr, callback_arg)
-
-  def Join(self):
-    """Waits for all the outstanding requests to complete and terminates."""
-    for a2l in self._a2l_instances:
-      a2l.WaitForIdle()
-      a2l.Terminate()
-
-  def _CreateNewA2LInstance(self):
-    assert(len(self._a2l_instances) < self.max_concurrent_jobs)
-    a2l = ELFSymbolizer.Addr2Line(self)
-    self._a2l_instances.append(a2l)
-    return a2l
-
-  def _CreateDisambiguationTable(self):
-    """ Non-unique file names will result in None entries"""
-    start_time = time.time()
-    logging.info('Collecting information about available source files...')
-    self.disambiguation_table = {}
-
-    for root, _, filenames in os.walk(self.source_root_path):
-      for f in filenames:
-        self.disambiguation_table[f] = os.path.join(root, f) if (f not in
-                                       self.disambiguation_table) else None
-    logging.info('Finished collecting information about '
-                 'possible files (took %.1f s).',
-                 (time.time() - start_time))
-
-
-  class Addr2Line(object):
-    """A python wrapper around an addr2line instance.
-
-    The communication with the addr2line process looks as follows:
-      [STDIN]         [STDOUT]  (from addr2line's viewpoint)
-    > f001111
-    > f002222
-                    < Symbol::Name(foo, bar) for f001111
-                    < /path/to/source/file.c:line_number
-    > f003333
-                    < Symbol::Name2() for f002222
-                    < /path/to/source/file.c:line_number
-                    < Symbol::Name3() for f003333
-                    < /path/to/source/file.c:line_number
-    """
-
-    SYM_ADDR_RE = re.compile(r'([^:]+):(\?|\d+).*')
-
-    def __init__(self, symbolizer):
-      self._symbolizer = symbolizer
-      self._lib_file_name = posixpath.basename(symbolizer.elf_file_path)
-
-      # The request queue (i.e. addresses pushed to addr2line's stdin and not
-      # yet retrieved on stdout)
-      self._request_queue = collections.deque()
-
-      # This is essentially len(self._request_queue). It has been optimized to a
-      # separate field because turned out to be a perf hot-spot.
-      self.queue_size = 0
-
-      # Keep track of the number of symbols a process has processed to
-      # avoid a single process growing too big and using all the memory.
-      self._processed_symbols_count = 0
-
-      # Objects required to handle the addr2line subprocess.
-      self._proc = None  # Subprocess.Popen(...) instance.
-      self._thread = None  # Threading.thread instance.
-      self._out_queue = None  # Queue.Queue instance (for buffering a2l stdout).
-      self._RestartAddr2LineProcess()
-
-    def EnqueueRequest(self, addr, callback_arg):
-      """Pushes an address to addr2line's stdin (and keeps track of it)."""
-      self._symbolizer.requests_counter += 1  # For global "age" of requests.
-      req_idx = self._symbolizer.requests_counter
-      self._request_queue.append((addr, callback_arg, req_idx))
-      self.queue_size += 1
-      self._WriteToA2lStdin(addr)
-
-    def WaitForIdle(self):
-      """Waits until all the pending requests have been symbolized."""
-      while self.queue_size > 0:
-        self.WaitForNextSymbolInQueue()
-
-    def WaitForNextSymbolInQueue(self):
-      """Waits for the next pending request to be symbolized."""
-      if not self.queue_size:
-        return
-
-      # This outer loop guards against a2l hanging (detecting stdout timeout).
-      while True:
-        start_time = datetime.datetime.now()
-        timeout = datetime.timedelta(seconds=self._symbolizer.addr2line_timeout)
-
-        # The inner loop guards against a2l crashing (checking if it exited).
-        while (datetime.datetime.now() - start_time < timeout):
-          # poll() returns !None if the process exited. a2l should never exit.
-          if self._proc.poll():
-            logging.warning('addr2line crashed, respawning (lib: %s).' %
-                            self._lib_file_name)
-            self._RestartAddr2LineProcess()
-            # TODO(primiano): the best thing to do in this case would be
-            # shrinking the pool size as, very likely, addr2line is crashed
-            # due to low memory (and the respawned one will die again soon).
-
-          try:
-            lines = self._out_queue.get(block=True, timeout=0.25)
-          except Queue.Empty:
-            # On timeout (1/4 s.) repeat the inner loop and check if either the
-            # addr2line process did crash or we waited its output for too long.
-            continue
-
-          # In nominal conditions, we get straight to this point.
-          self._ProcessSymbolOutput(lines)
-          return
-
-        # If this point is reached, we waited more than |addr2line_timeout|.
-        logging.warning('Hung addr2line process, respawning (lib: %s).' %
-                        self._lib_file_name)
-        self._RestartAddr2LineProcess()
-
-    def ProcessAllResolvedSymbolsInQueue(self):
-      """Consumes all the addr2line output lines produced (without blocking)."""
-      if not self.queue_size:
-        return
-      while True:
-        try:
-          lines = self._out_queue.get_nowait()
-        except Queue.Empty:
-          break
-        self._ProcessSymbolOutput(lines)
-
-    def RecycleIfNecessary(self):
-      """Restarts the process if it has been used for too long.
-
-      A long running addr2line process will consume excessive amounts
-      of memory without any gain in performance."""
-      if self._processed_symbols_count >= ADDR2LINE_RECYCLE_LIMIT:
-        self._RestartAddr2LineProcess()
-
-
-    def Terminate(self):
-      """Kills the underlying addr2line process.
-
-      The poller |_thread| will terminate as well due to the broken pipe."""
-      try:
-        self._proc.kill()
-        self._proc.communicate()  # Essentially wait() without risking deadlock.
-      except Exception:  # An exception while terminating? How interesting.
-        pass
-      self._proc = None
-
-    def _WriteToA2lStdin(self, addr):
-      self._proc.stdin.write('%s\n' % hex(addr))
-      if self._symbolizer.inlines:
-        # In the case of inlines we output an extra blank line, which causes
-        # addr2line to emit a (??,??:0) tuple that we use as a boundary marker.
-        self._proc.stdin.write('\n')
-      self._proc.stdin.flush()
-
-    def _ProcessSymbolOutput(self, lines):
-      """Parses an addr2line symbol output and triggers the client callback."""
-      (_, callback_arg, _) = self._request_queue.popleft()
-      self.queue_size -= 1
-
-      innermost_sym_info = None
-      sym_info = None
-      for (line1, line2) in lines:
-        prev_sym_info = sym_info
-        name = line1 if not line1.startswith('?') else None
-        source_path = None
-        source_line = None
-        m = ELFSymbolizer.Addr2Line.SYM_ADDR_RE.match(line2)
-        if m:
-          if not m.group(1).startswith('?'):
-            source_path = m.group(1)
-            if not m.group(2).startswith('?'):
-              source_line = int(m.group(2))
-        else:
-          logging.warning('Got invalid symbol path from addr2line: %s' % line2)
-
-        # In case disambiguation is on, and needed
-        was_ambiguous = False
-        disambiguated = False
-        if self._symbolizer.disambiguate:
-          if source_path and not posixpath.isabs(source_path):
-            path = self._symbolizer.disambiguation_table.get(source_path)
-            was_ambiguous = True
-            disambiguated = path is not None
-            source_path = path if disambiguated else source_path
-
-          # Use absolute paths (so that paths are consistent, as disambiguation
-          # uses absolute paths)
-          if source_path and not was_ambiguous:
-            source_path = os.path.abspath(source_path)
-
-        if source_path and self._symbolizer.strip_base_path:
-          # Strip the base path
-          source_path = re.sub('^' + self._symbolizer.strip_base_path,
-              self._symbolizer.source_root_path or '', source_path)
-
-        sym_info = ELFSymbolInfo(name, source_path, source_line, was_ambiguous,
-                                 disambiguated)
-        if prev_sym_info:
-          prev_sym_info.inlined_by = sym_info
-        if not innermost_sym_info:
-          innermost_sym_info = sym_info
-
-      self._processed_symbols_count += 1
-      self._symbolizer.callback(innermost_sym_info, callback_arg)
-
-    def _RestartAddr2LineProcess(self):
-      if self._proc:
-        self.Terminate()
-
-      # The only reason of existence of this Queue (and the corresponding
-      # Thread below) is the lack of a subprocess.stdout.poll_avail_lines().
-      # Essentially this is a pipe able to extract a couple of lines atomically.
-      self._out_queue = Queue.Queue()
-
-      # Start the underlying addr2line process in line buffered mode.
-
-      cmd = [self._symbolizer.addr2line_path, '--functions', '--demangle',
-          '--exe=' + self._symbolizer.elf_file_path]
-      if self._symbolizer.inlines:
-        cmd += ['--inlines']
-      self._proc = subprocess.Popen(cmd, bufsize=1, stdout=subprocess.PIPE,
-          stdin=subprocess.PIPE, stderr=sys.stderr, close_fds=True)
-
-      # Start the poller thread, which simply moves atomically the lines read
-      # from the addr2line's stdout to the |_out_queue|.
-      self._thread = threading.Thread(
-          target=ELFSymbolizer.Addr2Line.StdoutReaderThread,
-          args=(self._proc.stdout, self._out_queue, self._symbolizer.inlines))
-      self._thread.daemon = True  # Don't prevent early process exit.
-      self._thread.start()
-
-      self._processed_symbols_count = 0
-
-      # Replay the pending requests on the new process (only for the case
-      # of a hung addr2line timing out during the game).
-      for (addr, _, _) in self._request_queue:
-        self._WriteToA2lStdin(addr)
-
-    @staticmethod
-    def StdoutReaderThread(process_pipe, queue, inlines):
-      """The poller thread fn, which moves the addr2line stdout to the |queue|.
-
-      This is the only piece of code not running on the main thread. It merely
-      writes to a Queue, which is thread-safe. In the case of inlines, it
-      detects the ??,??:0 marker and sends the lines atomically, such that the
-      main thread always receives all the lines corresponding to one symbol in
-      one shot."""
-      try:
-        lines_for_one_symbol = []
-        while True:
-          line1 = process_pipe.readline().rstrip('\r\n')
-          line2 = process_pipe.readline().rstrip('\r\n')
-          if not line1 or not line2:
-            break
-          inline_has_more_lines = inlines and (len(lines_for_one_symbol) == 0 or
-                                  (line1 != '??' and line2 != '??:0'))
-          if not inlines or inline_has_more_lines:
-            lines_for_one_symbol += [(line1, line2)]
-          if inline_has_more_lines:
-            continue
-          queue.put(lines_for_one_symbol)
-          lines_for_one_symbol = []
-        process_pipe.close()
-
-      # Every addr2line processes will die at some point, please die silently.
-      except (IOError, OSError):
-        pass
-
-    @property
-    def first_request_id(self):
-      """Returns the request_id of the oldest pending request in the queue."""
-      return self._request_queue[0][2] if self._request_queue else 0
-
-
-class ELFSymbolInfo(object):
-  """The result of the symbolization passed as first arg. of each callback."""
-
-  def __init__(self, name, source_path, source_line, was_ambiguous=False,
-               disambiguated=False):
-    """All the fields here can be None (if addr2line replies with '??')."""
-    self.name = name
-    self.source_path = source_path
-    self.source_line = source_line
-    # In the case of |inlines|=True, the |inlined_by| points to the outer
-    # function inlining the current one (and so on, to form a chain).
-    self.inlined_by = None
-    self.disambiguated = disambiguated
-    self.was_ambiguous = was_ambiguous
-
-  def __str__(self):
-    return '%s [%s:%d]' % (
-        self.name or '??', self.source_path or '??', self.source_line or 0)
diff --git a/build/android/pylib/symbols/elf_symbolizer_unittest.py b/build/android/pylib/symbols/elf_symbolizer_unittest.py
deleted file mode 100755
index e963a34..0000000
--- a/build/android/pylib/symbols/elf_symbolizer_unittest.py
+++ /dev/null
@@ -1,173 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import functools
-import logging
-import os
-import sys
-import unittest
-
-sys.path.insert(0, os.path.dirname(__file__))
-import elf_symbolizer
-import mock_addr2line
-
-
-_MOCK_A2L_PATH = os.path.join(os.path.dirname(mock_addr2line.__file__),
-                              'mock_addr2line')
-_INCOMPLETE_MOCK_ADDR = 1024 * 1024
-_UNKNOWN_MOCK_ADDR = 2 * 1024 * 1024
-_INLINE_MOCK_ADDR = 3 * 1024 * 1024
-
-
-class ELFSymbolizerTest(unittest.TestCase):
-  def setUp(self):
-    self._callback = functools.partial(
-        ELFSymbolizerTest._SymbolizeCallback, self)
-    self._resolved_addresses = set()
-    # Mute warnings, we expect them due to the crash/hang tests.
-    logging.getLogger().setLevel(logging.ERROR)
-
-  def testParallelism1(self):
-    self._RunTest(max_concurrent_jobs=1, num_symbols=100)
-
-  def testParallelism4(self):
-    self._RunTest(max_concurrent_jobs=4, num_symbols=100)
-
-  def testParallelism8(self):
-    self._RunTest(max_concurrent_jobs=8, num_symbols=100)
-
-  def testCrash(self):
-    os.environ['MOCK_A2L_CRASH_EVERY'] = '99'
-    self._RunTest(max_concurrent_jobs=1, num_symbols=100)
-    os.environ['MOCK_A2L_CRASH_EVERY'] = '0'
-
-  def testHang(self):
-    os.environ['MOCK_A2L_HANG_EVERY'] = '99'
-    self._RunTest(max_concurrent_jobs=1, num_symbols=100)
-    os.environ['MOCK_A2L_HANG_EVERY'] = '0'
-
-  def testInlines(self):
-    """Stimulate the inline processing logic."""
-    symbolizer = elf_symbolizer.ELFSymbolizer(
-        elf_file_path='/path/doesnt/matter/mock_lib1.so',
-        addr2line_path=_MOCK_A2L_PATH,
-        callback=self._callback,
-        inlines=True,
-        max_concurrent_jobs=4)
-
-    for addr in xrange(1000):
-      exp_inline = False
-      exp_unknown = False
-
-      # First 100 addresses with inlines.
-      if addr < 100:
-        addr += _INLINE_MOCK_ADDR
-        exp_inline = True
-
-      # Followed by 100 without inlines.
-      elif addr < 200:
-        pass
-
-      # Followed by 100 interleaved inlines and not inlines.
-      elif addr < 300:
-        if addr & 1:
-          addr += _INLINE_MOCK_ADDR
-          exp_inline = True
-
-      # Followed by 100 interleaved inlines and unknonwn.
-      elif addr < 400:
-        if addr & 1:
-          addr += _INLINE_MOCK_ADDR
-          exp_inline = True
-        else:
-          addr += _UNKNOWN_MOCK_ADDR
-          exp_unknown = True
-
-      exp_name = 'mock_sym_for_addr_%d' % addr if not exp_unknown else None
-      exp_source_path = 'mock_src/mock_lib1.so.c' if not exp_unknown else None
-      exp_source_line = addr if not exp_unknown else None
-      cb_arg = (addr, exp_name, exp_source_path, exp_source_line, exp_inline)
-      symbolizer.SymbolizeAsync(addr, cb_arg)
-
-    symbolizer.Join()
-
-  def testIncompleteSyminfo(self):
-    """Stimulate the symbol-not-resolved logic."""
-    symbolizer = elf_symbolizer.ELFSymbolizer(
-        elf_file_path='/path/doesnt/matter/mock_lib1.so',
-        addr2line_path=_MOCK_A2L_PATH,
-        callback=self._callback,
-        max_concurrent_jobs=1)
-
-    # Test symbols with valid name but incomplete path.
-    addr = _INCOMPLETE_MOCK_ADDR
-    exp_name = 'mock_sym_for_addr_%d' % addr
-    exp_source_path = None
-    exp_source_line = None
-    cb_arg = (addr, exp_name, exp_source_path, exp_source_line, False)
-    symbolizer.SymbolizeAsync(addr, cb_arg)
-
-    # Test symbols with no name or sym info.
-    addr = _UNKNOWN_MOCK_ADDR
-    exp_name = None
-    exp_source_path = None
-    exp_source_line = None
-    cb_arg = (addr, exp_name, exp_source_path, exp_source_line, False)
-    symbolizer.SymbolizeAsync(addr, cb_arg)
-
-    symbolizer.Join()
-
-  def _RunTest(self, max_concurrent_jobs, num_symbols):
-    symbolizer = elf_symbolizer.ELFSymbolizer(
-        elf_file_path='/path/doesnt/matter/mock_lib1.so',
-        addr2line_path=_MOCK_A2L_PATH,
-        callback=self._callback,
-        max_concurrent_jobs=max_concurrent_jobs,
-        addr2line_timeout=0.5)
-
-    for addr in xrange(num_symbols):
-      exp_name = 'mock_sym_for_addr_%d' % addr
-      exp_source_path = 'mock_src/mock_lib1.so.c'
-      exp_source_line = addr
-      cb_arg = (addr, exp_name, exp_source_path, exp_source_line, False)
-      symbolizer.SymbolizeAsync(addr, cb_arg)
-
-    symbolizer.Join()
-
-    # Check that all the expected callbacks have been received.
-    for addr in xrange(num_symbols):
-      self.assertIn(addr, self._resolved_addresses)
-      self._resolved_addresses.remove(addr)
-
-    # Check for unexpected callbacks.
-    self.assertEqual(len(self._resolved_addresses), 0)
-
-  def _SymbolizeCallback(self, sym_info, cb_arg):
-    self.assertTrue(isinstance(sym_info, elf_symbolizer.ELFSymbolInfo))
-    self.assertTrue(isinstance(cb_arg, tuple))
-    self.assertEqual(len(cb_arg), 5)
-
-    # Unpack expectations from the callback extra argument.
-    (addr, exp_name, exp_source_path, exp_source_line, exp_inlines) = cb_arg
-    if exp_name is None:
-      self.assertIsNone(sym_info.name)
-    else:
-      self.assertTrue(sym_info.name.startswith(exp_name))
-    self.assertEqual(sym_info.source_path, exp_source_path)
-    self.assertEqual(sym_info.source_line, exp_source_line)
-
-    if exp_inlines:
-      self.assertEqual(sym_info.name, exp_name + '_inner')
-      self.assertEqual(sym_info.inlined_by.name, exp_name + '_middle')
-      self.assertEqual(sym_info.inlined_by.inlined_by.name,
-                       exp_name + '_outer')
-
-    # Check against duplicate callbacks.
-    self.assertNotIn(addr, self._resolved_addresses)
-    self._resolved_addresses.add(addr)
-
-
-if __name__ == '__main__':
-  unittest.main()
diff --git a/build/android/pylib/symbols/mock_addr2line/__init__.py b/build/android/pylib/symbols/mock_addr2line/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/build/android/pylib/symbols/mock_addr2line/__init__.py
+++ /dev/null
diff --git a/build/android/pylib/symbols/mock_addr2line/mock_addr2line b/build/android/pylib/symbols/mock_addr2line/mock_addr2line
deleted file mode 100755
index cd58f56..0000000
--- a/build/android/pylib/symbols/mock_addr2line/mock_addr2line
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Simple mock for addr2line.
-
-Outputs mock symbol information, with each symbol being a function of the
-original address (so it is easy to double-check consistency in unittests).
-"""
-
-import optparse
-import os
-import posixpath
-import sys
-import time
-
-
-def main(argv):
-  parser = optparse.OptionParser()
-  parser.add_option('-e', '--exe', dest='exe')  # Path of the debug-library.so.
-  # Silently swallow the other unnecessary arguments.
-  parser.add_option('-C', '--demangle', action='store_true')
-  parser.add_option('-f', '--functions', action='store_true')
-  parser.add_option('-i', '--inlines', action='store_true')
-  options, _ = parser.parse_args(argv[1:])
-  lib_file_name = posixpath.basename(options.exe)
-  processed_sym_count = 0
-  crash_every = int(os.environ.get('MOCK_A2L_CRASH_EVERY', 0))
-  hang_every = int(os.environ.get('MOCK_A2L_HANG_EVERY', 0))
-
-  while(True):
-    line = sys.stdin.readline().rstrip('\r')
-    if not line:
-      break
-
-    # An empty line should generate '??,??:0' (is used as marker for inlines).
-    if line == '\n':
-      print '??'
-      print '??:0'
-      sys.stdout.flush()
-      continue
-
-    addr = int(line, 16)
-    processed_sym_count += 1
-    if crash_every and processed_sym_count % crash_every == 0:
-      sys.exit(1)
-    if hang_every and processed_sym_count % hang_every == 0:
-      time.sleep(1)
-
-    # Addresses < 1M will return good mock symbol information.
-    if addr < 1024 * 1024:
-      print 'mock_sym_for_addr_%d' % addr
-      print 'mock_src/%s.c:%d' % (lib_file_name, addr)
-
-    # Addresses 1M <= x < 2M will return symbols with a name but a missing path.
-    elif addr < 2 * 1024 * 1024:
-      print 'mock_sym_for_addr_%d' % addr
-      print '??:0'
-
-    # Addresses 2M <= x < 3M will return unknown symbol information.
-    elif addr < 3 * 1024 * 1024:
-      print '??'
-      print '??'
-
-    # Addresses 3M <= x < 4M will return inlines.
-    elif addr < 4 * 1024 * 1024:
-      print 'mock_sym_for_addr_%d_inner' % addr
-      print 'mock_src/%s.c:%d' % (lib_file_name, addr)
-      print 'mock_sym_for_addr_%d_middle' % addr
-      print 'mock_src/%s.c:%d' % (lib_file_name, addr)
-      print 'mock_sym_for_addr_%d_outer' % addr
-      print 'mock_src/%s.c:%d' % (lib_file_name, addr)
-
-    sys.stdout.flush()
-
-
-if __name__ == '__main__':
-  main(sys.argv)
\ No newline at end of file
diff --git a/build/android/pylib/system_properties.py b/build/android/pylib/system_properties.py
deleted file mode 100644
index 3f16f86..0000000
--- a/build/android/pylib/system_properties.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-
-class SystemProperties(dict):
-
-  """A dict interface to interact with device system properties.
-
-  System properties are key/value pairs as exposed by adb shell getprop/setprop.
-
-  This implementation minimizes interaction with the physical device. It is
-  valid for the lifetime of a boot.
-  """
-
-  def __init__(self, android_commands):
-    super(SystemProperties, self).__init__()
-    self._adb = android_commands
-    self._cached_static_properties = {}
-
-  def __getitem__(self, key):
-    if self._IsStatic(key):
-      if key not in self._cached_static_properties:
-        self._cached_static_properties[key] = self._GetProperty(key)
-      return self._cached_static_properties[key]
-    return self._GetProperty(key)
-
-  def __setitem__(self, key, value):
-    # TODO(tonyg): This can fail with no root. Verify that it succeeds.
-    self._adb.SendShellCommand('setprop %s "%s"' % (key, value), retry_count=3)
-
-  @staticmethod
-  def _IsStatic(key):
-    # TODO(tonyg): This list is conservative and could be expanded as needed.
-    return (key.startswith('ro.boot.') or
-            key.startswith('ro.build.') or
-            key.startswith('ro.product.'))
-
-  def _GetProperty(self, key):
-    return self._adb.SendShellCommand('getprop %s' % key, retry_count=3).strip()
diff --git a/build/android/pylib/uiautomator/__init__.py b/build/android/pylib/uiautomator/__init__.py
deleted file mode 100644
index cda7672..0000000
--- a/build/android/pylib/uiautomator/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
diff --git a/build/android/pylib/uiautomator/setup.py b/build/android/pylib/uiautomator/setup.py
deleted file mode 100644
index bd8ffc7..0000000
--- a/build/android/pylib/uiautomator/setup.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Generates test runner factory and tests for uiautomator tests."""
-
-import logging
-
-from pylib.uiautomator import test_package
-from pylib.uiautomator import test_runner
-
-
-def Setup(test_options):
-  """Runs uiautomator tests on connected device(s).
-
-  Args:
-    test_options: A UIAutomatorOptions object.
-
-  Returns:
-    A tuple of (TestRunnerFactory, tests).
-  """
-  test_pkg = test_package.TestPackage(test_options.uiautomator_jar,
-                                      test_options.uiautomator_info_jar)
-  tests = test_pkg.GetAllMatchingTests(test_options.annotations,
-                                       test_options.exclude_annotations,
-                                       test_options.test_filter)
-
-  if not tests:
-    logging.error('No uiautomator tests to run with current args.')
-
-  def TestRunnerFactory(device, shard_index):
-    return test_runner.TestRunner(
-        test_options, device, shard_index, test_pkg)
-
-  return (TestRunnerFactory, tests)
diff --git a/build/android/pylib/uiautomator/test_options.py b/build/android/pylib/uiautomator/test_options.py
deleted file mode 100644
index 3f5f950..0000000
--- a/build/android/pylib/uiautomator/test_options.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Defines the UIAutomatorOptions named tuple."""
-
-import collections
-
-UIAutomatorOptions = collections.namedtuple('UIAutomatorOptions', [
-    'tool',
-    'annotations',
-    'exclude_annotations',
-    'test_filter',
-    'test_data',
-    'save_perf_json',
-    'screenshot_failures',
-    'uiautomator_jar',
-    'uiautomator_info_jar',
-    'package',
-    'set_asserts'])
diff --git a/build/android/pylib/uiautomator/test_package.py b/build/android/pylib/uiautomator/test_package.py
deleted file mode 100644
index cb51fdf..0000000
--- a/build/android/pylib/uiautomator/test_package.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Class representing uiautomator test package."""
-
-import os
-
-from pylib import constants
-from pylib.instrumentation import test_jar
-
-
-class TestPackage(test_jar.TestJar):
-
-  UIAUTOMATOR_PATH = 'uiautomator/'
-  UIAUTOMATOR_DEVICE_DIR = os.path.join(constants.TEST_EXECUTABLE_DIR,
-                                        UIAUTOMATOR_PATH)
-
-  def __init__(self, jar_path, jar_info_path):
-    test_jar.TestJar.__init__(self, jar_info_path)
-
-    if not os.path.exists(jar_path):
-      raise Exception('%s not found, please build it' % jar_path)
-    self._jar_path = jar_path
-
-  def GetPackageName(self):
-    """Returns the JAR named that is installed on the device."""
-    return os.path.basename(self._jar_path)
-
-  # Override.
-  def Install(self, device):
-    device.PushChangedFiles([(self._jar_path, self.UIAUTOMATOR_DEVICE_DIR +
-                              self.GetPackageName())])
diff --git a/build/android/pylib/uiautomator/test_runner.py b/build/android/pylib/uiautomator/test_runner.py
deleted file mode 100644
index bda6687..0000000
--- a/build/android/pylib/uiautomator/test_runner.py
+++ /dev/null
@@ -1,89 +0,0 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Class for running uiautomator tests on a single device."""
-
-from pylib import constants
-from pylib import flag_changer
-from pylib.device import intent
-from pylib.instrumentation import test_options as instr_test_options
-from pylib.instrumentation import test_runner as instr_test_runner
-
-
-class TestRunner(instr_test_runner.TestRunner):
-  """Responsible for running a series of tests connected to a single device."""
-
-  def __init__(self, test_options, device, shard_index, test_pkg):
-    """Create a new TestRunner.
-
-    Args:
-      test_options: A UIAutomatorOptions object.
-      device: Attached android device.
-      shard_index: Shard index.
-      test_pkg: A TestPackage object.
-    """
-    # Create an InstrumentationOptions object to pass to the super class
-    instrumentation_options = instr_test_options.InstrumentationOptions(
-        test_options.tool,
-        test_options.annotations,
-        test_options.exclude_annotations,
-        test_options.test_filter,
-        test_options.test_data,
-        test_options.save_perf_json,
-        test_options.screenshot_failures,
-        wait_for_debugger=False,
-        coverage_dir=None,
-        test_apk=None,
-        test_apk_path=None,
-        test_apk_jar_path=None,
-        test_runner=None,
-        test_support_apk_path=None,
-        device_flags=None,
-        isolate_file_path=None,
-        set_asserts=test_options.set_asserts,
-        delete_stale_data=False)
-    super(TestRunner, self).__init__(instrumentation_options, device,
-                                     shard_index, test_pkg)
-
-    cmdline_file = constants.PACKAGE_INFO[test_options.package].cmdline_file
-    self.flags = None
-    if cmdline_file:
-      self.flags = flag_changer.FlagChanger(self.device, cmdline_file)
-    self._package = constants.PACKAGE_INFO[test_options.package].package
-    self._activity = constants.PACKAGE_INFO[test_options.package].activity
-
-  #override
-  def InstallTestPackage(self):
-    self.test_pkg.Install(self.device)
-
-  #override
-  def _RunTest(self, test, timeout):
-    self.device.ClearApplicationState(self._package)
-    if self.flags:
-      annotations = self.test_pkg.GetTestAnnotations(test)
-      if 'FirstRunExperience' == annotations.get('Feature', None):
-        self.flags.RemoveFlags(['--disable-fre'])
-      else:
-        self.flags.AddFlags(['--disable-fre'])
-    self.device.StartActivity(
-        intent.Intent(action='android.intent.action.MAIN',
-                      activity=self._activity,
-                      package=self._package),
-        blocking=True,
-        force_stop=True)
-    cmd = ['uiautomator', 'runtest',
-           self.test_pkg.UIAUTOMATOR_PATH + self.test_pkg.GetPackageName(),
-           '-e', 'class', test,
-           '-e', 'test_package', self._package]
-    return self.device.RunShellCommand(cmd, timeout=timeout, retries=0)
-
-  #override
-  def _GenerateTestResult(self, test, _result_code, _result_bundle, statuses,
-                          start_ms, duration_ms):
-    # uiautomator emits its summary status with INSTRUMENTATION_STATUS_CODE,
-    # not INSTRUMENTATION_CODE, so we have to drop if off the list of statuses.
-    summary_code, summary_bundle = statuses[-1]
-    return super(TestRunner, self)._GenerateTestResult(
-        test, summary_code, summary_bundle, statuses[:-1], start_ms,
-        duration_ms)
diff --git a/build/android/pylib/uirobot/__init__.py b/build/android/pylib/uirobot/__init__.py
deleted file mode 100644
index 5cac026..0000000
--- a/build/android/pylib/uirobot/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
diff --git a/build/android/pylib/uirobot/uirobot_test_instance.py b/build/android/pylib/uirobot/uirobot_test_instance.py
deleted file mode 100644
index e3f6eb7..0000000
--- a/build/android/pylib/uirobot/uirobot_test_instance.py
+++ /dev/null
@@ -1,79 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import os
-import json
-import logging
-
-from pylib import constants
-from pylib.base import test_instance
-from pylib.utils import apk_helper
-
-class UirobotTestInstance(test_instance.TestInstance):
-
-  def __init__(self, args, error_func):
-    """Constructor.
-
-    Args:
-      args: Command line arguments.
-    """
-    super(UirobotTestInstance, self).__init__()
-    if not args.app_under_test:
-      error_func('Must set --app-under-test.')
-    self._app_under_test = args.app_under_test
-    self._minutes = args.minutes
-
-    if args.remote_device_file:
-      with open(args.remote_device_file) as remote_device_file:
-        device_json = json.load(remote_device_file)
-    else:
-      device_json = {}
-    device_type = device_json.get('device_type', 'Android')
-    if args.device_type:
-      if device_type and device_type != args.device_type:
-        logging.info('Overriding device_type from %s to %s',
-                     device_type, args.device_type)
-      device_type = args.device_type
-
-    if device_type == 'Android':
-      self._suite = 'Android Uirobot'
-      self._package_name = apk_helper.GetPackageName(self._app_under_test)
-    elif device_type == 'iOS':
-      self._suite = 'iOS Uirobot'
-      self._package_name = self._app_under_test
-
-
-  #override
-  def TestType(self):
-    """Returns type of test."""
-    return 'uirobot'
-
-  #override
-  def SetUp(self):
-    """Setup for test."""
-    pass
-
-  #override
-  def TearDown(self):
-    """Teardown for test."""
-    pass
-
-  @property
-  def app_under_test(self):
-    """Returns the app to run the test on."""
-    return self._app_under_test
-
-  @property
-  def minutes(self):
-    """Returns the number of minutes to run the uirobot for."""
-    return self._minutes
-
-  @property
-  def package_name(self):
-    """Returns the name of the package in the APK."""
-    return self._package_name
-
-  @property
-  def suite(self):
-    return self._suite
diff --git a/build/android/pylib/utils/__init__.py b/build/android/pylib/utils/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/build/android/pylib/utils/__init__.py
+++ /dev/null
diff --git a/build/android/pylib/utils/apk_helper.py b/build/android/pylib/utils/apk_helper.py
deleted file mode 100644
index a556e7b..0000000
--- a/build/android/pylib/utils/apk_helper.py
+++ /dev/null
@@ -1,131 +0,0 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Module containing utilities for apk packages."""
-
-import os.path
-import re
-
-from pylib import cmd_helper
-from pylib import constants
-from pylib.sdk import aapt
-
-
-_AAPT_PATH = os.path.join(constants.ANDROID_SDK_TOOLS, 'aapt')
-_MANIFEST_ATTRIBUTE_RE = re.compile(
-    r'\s*A: ([^\(\)= ]*)\([^\(\)= ]*\)="(.*)" \(Raw: .*\)$')
-_MANIFEST_ELEMENT_RE = re.compile(r'\s*(?:E|N): (\S*) .*$')
-_PACKAGE_NAME_RE = re.compile(r'package: .*name=\'(\S*)\'')
-_SPLIT_NAME_RE = re.compile(r'package: .*split=\'(\S*)\'')
-
-
-def GetPackageName(apk_path):
-  """Returns the package name of the apk."""
-  return ApkHelper(apk_path).GetPackageName()
-
-
-# TODO(jbudorick): Deprecate and remove this function once callers have been
-# converted to ApkHelper.GetInstrumentationName
-def GetInstrumentationName(apk_path):
-  """Returns the name of the Instrumentation in the apk."""
-  return ApkHelper(apk_path).GetInstrumentationName()
-
-
-def _ParseManifestFromApk(apk_path):
-  aapt_output = aapt.Dump('xmltree', apk_path, 'AndroidManifest.xml')
-
-  parsed_manifest = {}
-  node_stack = [parsed_manifest]
-  indent = '  '
-
-  for line in aapt_output[1:]:
-    if len(line) == 0:
-      continue
-
-    indent_depth = 0
-    while line[(len(indent) * indent_depth):].startswith(indent):
-      indent_depth += 1
-
-    node_stack = node_stack[:indent_depth]
-    node = node_stack[-1]
-
-    m = _MANIFEST_ELEMENT_RE.match(line[len(indent) * indent_depth:])
-    if m:
-      if not m.group(1) in node:
-        node[m.group(1)] = {}
-      node_stack += [node[m.group(1)]]
-      continue
-
-    m = _MANIFEST_ATTRIBUTE_RE.match(line[len(indent) * indent_depth:])
-    if m:
-      if not m.group(1) in node:
-        node[m.group(1)] = []
-      node[m.group(1)].append(m.group(2))
-      continue
-
-  return parsed_manifest
-
-
-class ApkHelper(object):
-  def __init__(self, apk_path):
-    self._apk_path = apk_path
-    self._manifest = None
-    self._package_name = None
-    self._split_name = None
-
-  def GetActivityName(self):
-    """Returns the name of the Activity in the apk."""
-    manifest_info = self._GetManifest()
-    try:
-      activity = (
-          manifest_info['manifest']['application']['activity']
-              ['android:name'][0])
-    except KeyError:
-      return None
-    if '.' not in activity:
-      activity = '%s.%s' % (self.GetPackageName(), activity)
-    elif activity.startswith('.'):
-      activity = '%s%s' % (self.GetPackageName(), activity)
-    return activity
-
-  def GetInstrumentationName(
-      self, default='android.test.InstrumentationTestRunner'):
-    """Returns the name of the Instrumentation in the apk."""
-    manifest_info = self._GetManifest()
-    try:
-      return manifest_info['manifest']['instrumentation']['android:name'][0]
-    except KeyError:
-      return default
-
-  def GetPackageName(self):
-    """Returns the package name of the apk."""
-    if self._package_name:
-      return self._package_name
-
-    aapt_output = aapt.Dump('badging', self._apk_path)
-    for line in aapt_output:
-      m = _PACKAGE_NAME_RE.match(line)
-      if m:
-        self._package_name = m.group(1)
-        return self._package_name
-    raise Exception('Failed to determine package name of %s' % self._apk_path)
-
-  def GetSplitName(self):
-    """Returns the name of the split of the apk."""
-    if self._split_name:
-      return self._split_name
-
-    aapt_output = aapt.Dump('badging', self._apk_path)
-    for line in aapt_output:
-      m = _SPLIT_NAME_RE.match(line)
-      if m:
-        self._split_name = m.group(1)
-        return self._split_name
-    return None
-
-  def _GetManifest(self):
-    if not self._manifest:
-      self._manifest = _ParseManifestFromApk(self._apk_path)
-    return self._manifest
-
diff --git a/build/android/pylib/utils/base_error.py b/build/android/pylib/utils/base_error.py
deleted file mode 100644
index 31eaa54..0000000
--- a/build/android/pylib/utils/base_error.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-
-class BaseError(Exception):
-  """Base error for all test runner errors."""
-
-  def __init__(self, message, is_infra_error=False):
-    super(BaseError, self).__init__(message)
-    self._is_infra_error = is_infra_error
-
-  @property
-  def is_infra_error(self):
-    """Property to indicate if error was caused by an infrastructure issue."""
-    return self._is_infra_error
\ No newline at end of file
diff --git a/build/android/pylib/utils/command_option_parser.py b/build/android/pylib/utils/command_option_parser.py
deleted file mode 100644
index cf501d0..0000000
--- a/build/android/pylib/utils/command_option_parser.py
+++ /dev/null
@@ -1,75 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""An option parser which handles the first arg as a command.
-
-Add other nice functionality such as printing a list of commands
-and an example in usage.
-"""
-
-import optparse
-import sys
-
-
-class CommandOptionParser(optparse.OptionParser):
-  """Wrapper class for OptionParser to help with listing commands."""
-
-  def __init__(self, *args, **kwargs):
-    """Creates a CommandOptionParser.
-
-    Args:
-      commands_dict: A dictionary mapping command strings to an object defining
-          - add_options_func: Adds options to the option parser
-          - run_command_func: Runs the command itself.
-      example: An example command.
-      everything else: Passed to optparse.OptionParser contructor.
-    """
-    self.commands_dict = kwargs.pop('commands_dict', {})
-    self.example = kwargs.pop('example', '')
-    if not 'usage' in kwargs:
-      kwargs['usage'] = 'Usage: %prog <command> [options]'
-    optparse.OptionParser.__init__(self, *args, **kwargs)
-
-  #override
-  def get_usage(self):
-    normal_usage = optparse.OptionParser.get_usage(self)
-    command_list = self.get_command_list()
-    example = self.get_example()
-    return self.expand_prog_name(normal_usage + example + command_list)
-
-  #override
-  def get_command_list(self):
-    if self.commands_dict.keys():
-      return '\nCommands:\n  %s\n' % '\n  '.join(
-          sorted(self.commands_dict.keys()))
-    return ''
-
-  def get_example(self):
-    if self.example:
-      return '\nExample:\n  %s\n' % self.example
-    return ''
-
-
-def ParseAndExecute(option_parser, argv=None):
-  """Parses options/args from argv and runs the specified command.
-
-  Args:
-    option_parser: A CommandOptionParser object.
-    argv: Command line arguments. If None, automatically draw from sys.argv.
-
-  Returns:
-    An exit code.
-  """
-  if not argv:
-    argv = sys.argv
-
-    if len(argv) < 2 or argv[1] not in option_parser.commands_dict:
-      # Parse args first, if this is '--help', optparse will print help and exit
-      option_parser.parse_args(argv)
-      option_parser.error('Invalid command.')
-
-    cmd = option_parser.commands_dict[argv[1]]
-    cmd.add_options_func(option_parser)
-    options, args = option_parser.parse_args(argv)
-    return cmd.run_command_func(argv[1], options, args, option_parser)
diff --git a/build/android/pylib/utils/device_temp_file.py b/build/android/pylib/utils/device_temp_file.py
deleted file mode 100644
index 7d3b95b..0000000
--- a/build/android/pylib/utils/device_temp_file.py
+++ /dev/null
@@ -1,57 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""A temp file that automatically gets pushed and deleted from a device."""
-
-# pylint: disable=W0622
-
-import random
-import time
-
-from pylib import cmd_helper
-from pylib.device import device_errors
-
-
-class DeviceTempFile(object):
-  def __init__(self, adb, suffix='', prefix='temp_file', dir='/data/local/tmp'):
-    """Find an unused temporary file path in the devices external directory.
-
-    When this object is closed, the file will be deleted on the device.
-
-    Args:
-      adb: An instance of AdbWrapper
-      suffix: The suffix of the name of the temp file.
-      prefix: The prefix of the name of the temp file.
-      dir: The directory on the device where to place the temp file.
-    """
-    self._adb = adb
-    # make sure that the temp dir is writable
-    self._adb.Shell('test -d %s' % cmd_helper.SingleQuote(dir))
-    while True:
-      self.name = '{dir}/{prefix}-{time:d}-{nonce:d}{suffix}'.format(
-        dir=dir, prefix=prefix, time=int(time.time()),
-        nonce=random.randint(0, 1000000), suffix=suffix)
-      self.name_quoted = cmd_helper.SingleQuote(self.name)
-      try:
-        self._adb.Shell('test -e %s' % self.name_quoted)
-      except device_errors.AdbCommandFailedError:
-        break # file does not exist
-
-    # Immediately touch the file, so other temp files can't get the same name.
-    self._adb.Shell('touch %s' % self.name_quoted)
-
-  def close(self):
-    """Deletes the temporary file from the device."""
-    # ignore exception if the file is already gone.
-    try:
-      self._adb.Shell('rm -f %s' % self.name_quoted)
-    except device_errors.AdbCommandFailedError:
-      # file does not exist on Android version without 'rm -f' support (ICS)
-      pass
-
-  def __enter__(self):
-    return self
-
-  def __exit__(self, type, value, traceback):
-    self.close()
diff --git a/build/android/pylib/utils/device_temp_file_test.py b/build/android/pylib/utils/device_temp_file_test.py
deleted file mode 100755
index f839ce0..0000000
--- a/build/android/pylib/utils/device_temp_file_test.py
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-Unit tests for the contents of device_temp_file.py.
-"""
-
-import logging
-import os
-import sys
-import unittest
-
-from pylib import constants
-from pylib.device import adb_wrapper
-from pylib.device import device_errors
-from pylib.utils import device_temp_file
-from pylib.utils import mock_calls
-
-sys.path.append(os.path.join(
-    constants.DIR_SOURCE_ROOT, 'third_party', 'pymock'))
-import mock # pylint: disable=F0401
-
-class DeviceTempFileTest(mock_calls.TestCase):
-
-  def setUp(self):
-    test_serial = '0123456789abcdef'
-    self.adb = mock.Mock(spec=adb_wrapper.AdbWrapper)
-    self.adb.__str__ = mock.Mock(return_value=test_serial)
-    self.watchMethodCalls(self.call.adb)
-
-  def mockShellCall(self, cmd_prefix, action=''):
-    """Expect an adb.Shell(cmd) call with cmd_prefix and do some action
-
-    Args:
-      cmd_prefix: A string, the cmd of the received call is expected to have
-          this as a prefix.
-      action: If callable, an action to perform when the expected call is
-          received, otherwise a return value.
-    Returns:
-      An (expected_call, action) pair suitable for use in assertCalls.
-    """
-    def check_and_return(cmd):
-      self.assertTrue(
-          cmd.startswith(cmd_prefix),
-          'command %r does not start with prefix %r' % (cmd, cmd_prefix))
-      if callable(action):
-        return action(cmd)
-      else:
-        return action
-    return (self.call.adb.Shell(mock.ANY), check_and_return)
-
-  def mockExistsTest(self, exists_result):
-    def action(cmd):
-      if exists_result:
-        return ''
-      else:
-        raise device_errors.AdbCommandFailedError(
-            cmd, 'File not found', 1, str(self.adb))
-    return self.mockShellCall('test -e ', action)
-
-  def testTempFileNameAlreadyExists(self):
-    with self.assertCalls(
-        self.mockShellCall('test -d /data/local/tmp'),
-        self.mockExistsTest(True),
-        self.mockExistsTest(True),
-        self.mockExistsTest(True),
-        self.mockExistsTest(False),
-        self.mockShellCall('touch '),
-        self.mockShellCall('rm -f ')):
-      with device_temp_file.DeviceTempFile(self.adb) as tmpfile:
-        logging.debug('Temp file name: %s' % tmpfile.name)
-
-  def testTempFileLifecycle(self):
-    with self.assertCalls(
-        self.mockShellCall('test -d /data/local/tmp'),
-        self.mockExistsTest(False),
-        self.mockShellCall('touch ')):
-      tempFileContextManager = device_temp_file.DeviceTempFile(self.adb)
-    with mock.patch.object(self.adb, 'Shell'):
-      with tempFileContextManager as tmpfile:
-        logging.debug('Temp file name: %s' % tmpfile.name)
-        self.assertEquals(0, self.adb.Shell.call_count)
-      self.assertEquals(1, self.adb.Shell.call_count)
-      args, _ = self.adb.Shell.call_args
-      self.assertTrue(args[0].startswith('rm -f '))
-
-if __name__ == '__main__':
-  logging.getLogger().setLevel(logging.DEBUG)
-  unittest.main(verbosity=2)
diff --git a/build/android/pylib/utils/emulator.py b/build/android/pylib/utils/emulator.py
deleted file mode 100644
index cc07e61..0000000
--- a/build/android/pylib/utils/emulator.py
+++ /dev/null
@@ -1,444 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Provides an interface to start and stop Android emulator.
-
-  Emulator: The class provides the methods to launch/shutdown the emulator with
-            the android virtual device named 'avd_armeabi' .
-"""
-
-import logging
-import os
-import signal
-import subprocess
-import time
-
-# TODO(craigdh): Move these pylib dependencies to pylib/utils/.
-from pylib import cmd_helper
-from pylib import constants
-from pylib import pexpect
-from pylib.device import device_errors
-from pylib.device import device_utils
-from pylib.utils import time_profile
-
-import errors
-import run_command
-
-# SD card size
-SDCARD_SIZE = '512M'
-
-# Template used to generate config.ini files for the emulator
-CONFIG_TEMPLATE = """avd.ini.encoding=ISO-8859-1
-hw.dPad=no
-hw.lcd.density=320
-sdcard.size=512M
-hw.cpu.arch={hw.cpu.arch}
-hw.device.hash=-708107041
-hw.camera.back=none
-disk.dataPartition.size=800M
-hw.gpu.enabled=yes
-skin.path=720x1280
-skin.dynamic=yes
-hw.keyboard=yes
-hw.ramSize=1024
-hw.device.manufacturer=Google
-hw.sdCard=yes
-hw.mainKeys=no
-hw.accelerometer=yes
-skin.name=720x1280
-abi.type={abi.type}
-hw.trackBall=no
-hw.device.name=Galaxy Nexus
-hw.battery=yes
-hw.sensors.proximity=yes
-image.sysdir.1=system-images/android-{api.level}/{abi.type}/
-hw.sensors.orientation=yes
-hw.audioInput=yes
-hw.camera.front=none
-hw.gps=yes
-vm.heapSize=128
-{extras}"""
-
-CONFIG_REPLACEMENTS = {
-  'x86': {
-    '{hw.cpu.arch}': 'x86',
-    '{abi.type}': 'x86',
-    '{extras}': ''
-  },
-  'arm': {
-    '{hw.cpu.arch}': 'arm',
-    '{abi.type}': 'armeabi-v7a',
-    '{extras}': 'hw.cpu.model=cortex-a8\n'
-  },
-  'mips': {
-    '{hw.cpu.arch}': 'mips',
-    '{abi.type}': 'mips',
-    '{extras}': ''
-  }
-}
-
-class EmulatorLaunchException(Exception):
-  """Emulator failed to launch."""
-  pass
-
-def _KillAllEmulators():
-  """Kill all running emulators that look like ones we started.
-
-  There are odd 'sticky' cases where there can be no emulator process
-  running but a device slot is taken.  A little bot trouble and we're out of
-  room forever.
-  """
-  emulators = [d for d in device_utils.DeviceUtils.HealthyDevices()
-               if d.adb.is_emulator]
-  if not emulators:
-    return
-  for e in emulators:
-    e.adb.Emu(['kill'])
-  logging.info('Emulator killing is async; give a few seconds for all to die.')
-  for _ in range(5):
-    if not any(d.adb.is_emulator for d
-               in device_utils.DeviceUtils.HealthyDevices()):
-      return
-    time.sleep(1)
-
-
-def DeleteAllTempAVDs():
-  """Delete all temporary AVDs which are created for tests.
-
-  If the test exits abnormally and some temporary AVDs created when testing may
-  be left in the system. Clean these AVDs.
-  """
-  avds = device_utils.GetAVDs()
-  if not avds:
-    return
-  for avd_name in avds:
-    if 'run_tests_avd' in avd_name:
-      cmd = ['android', '-s', 'delete', 'avd', '--name', avd_name]
-      cmd_helper.RunCmd(cmd)
-      logging.info('Delete AVD %s' % avd_name)
-
-
-class PortPool(object):
-  """Pool for emulator port starting position that changes over time."""
-  _port_min = 5554
-  _port_max = 5585
-  _port_current_index = 0
-
-  @classmethod
-  def port_range(cls):
-    """Return a range of valid ports for emulator use.
-
-    The port must be an even number between 5554 and 5584.  Sometimes
-    a killed emulator "hangs on" to a port long enough to prevent
-    relaunch.  This is especially true on slow machines (like a bot).
-    Cycling through a port start position helps make us resilient."""
-    ports = range(cls._port_min, cls._port_max, 2)
-    n = cls._port_current_index
-    cls._port_current_index = (n + 1) % len(ports)
-    return ports[n:] + ports[:n]
-
-
-def _GetAvailablePort():
-  """Returns an available TCP port for the console."""
-  used_ports = []
-  emulators = [d for d in device_utils.DeviceUtils.HealthyDevices()
-               if d.adb.is_emulator]
-  for emulator in emulators:
-    used_ports.append(emulator.adb.GetDeviceSerial().split('-')[1])
-  for port in PortPool.port_range():
-    if str(port) not in used_ports:
-      return port
-
-
-def LaunchTempEmulators(emulator_count, abi, api_level, wait_for_boot=True):
-  """Create and launch temporary emulators and wait for them to boot.
-
-  Args:
-    emulator_count: number of emulators to launch.
-    abi: the emulator target platform
-    api_level: the api level (e.g., 19 for Android v4.4 - KitKat release)
-    wait_for_boot: whether or not to wait for emulators to boot up
-
-  Returns:
-    List of emulators.
-  """
-  emulators = []
-  for n in xrange(emulator_count):
-    t = time_profile.TimeProfile('Emulator launch %d' % n)
-    # Creates a temporary AVD.
-    avd_name = 'run_tests_avd_%d' % n
-    logging.info('Emulator launch %d with avd_name=%s and api=%d',
-        n, avd_name, api_level)
-    emulator = Emulator(avd_name, abi)
-    emulator.CreateAVD(api_level)
-    emulator.Launch(kill_all_emulators=n == 0)
-    t.Stop()
-    emulators.append(emulator)
-  # Wait for all emulators to boot completed.
-  if wait_for_boot:
-    for emulator in emulators:
-      emulator.ConfirmLaunch(True)
-  return emulators
-
-
-def LaunchEmulator(avd_name, abi):
-  """Launch an existing emulator with name avd_name.
-
-  Args:
-    avd_name: name of existing emulator
-    abi: the emulator target platform
-
-  Returns:
-    emulator object.
-  """
-  logging.info('Specified emulator named avd_name=%s launched', avd_name)
-  emulator = Emulator(avd_name, abi)
-  emulator.Launch(kill_all_emulators=True)
-  emulator.ConfirmLaunch(True)
-  return emulator
-
-
-class Emulator(object):
-  """Provides the methods to launch/shutdown the emulator.
-
-  The emulator has the android virtual device named 'avd_armeabi'.
-
-  The emulator could use any even TCP port between 5554 and 5584 for the
-  console communication, and this port will be part of the device name like
-  'emulator-5554'. Assume it is always True, as the device name is the id of
-  emulator managed in this class.
-
-  Attributes:
-    emulator: Path of Android's emulator tool.
-    popen: Popen object of the running emulator process.
-    device: Device name of this emulator.
-  """
-
-  # Signals we listen for to kill the emulator on
-  _SIGNALS = (signal.SIGINT, signal.SIGHUP)
-
-  # Time to wait for an emulator launch, in seconds.  This includes
-  # the time to launch the emulator and a wait-for-device command.
-  _LAUNCH_TIMEOUT = 120
-
-  # Timeout interval of wait-for-device command before bouncing to a a
-  # process life check.
-  _WAITFORDEVICE_TIMEOUT = 5
-
-  # Time to wait for a "wait for boot complete" (property set on device).
-  _WAITFORBOOT_TIMEOUT = 300
-
-  def __init__(self, avd_name, abi):
-    """Init an Emulator.
-
-    Args:
-      avd_name: name of the AVD to create
-      abi: target platform for emulator being created, defaults to x86
-    """
-    android_sdk_root = os.path.join(constants.EMULATOR_SDK_ROOT, 'sdk')
-    self.emulator = os.path.join(android_sdk_root, 'tools', 'emulator')
-    self.android = os.path.join(android_sdk_root, 'tools', 'android')
-    self.popen = None
-    self.device_serial = None
-    self.abi = abi
-    self.avd_name = avd_name
-
-  @staticmethod
-  def _DeviceName():
-    """Return our device name."""
-    port = _GetAvailablePort()
-    return ('emulator-%d' % port, port)
-
-  def CreateAVD(self, api_level):
-    """Creates an AVD with the given name.
-
-    Args:
-      api_level: the api level of the image
-
-    Return avd_name.
-    """
-
-    if self.abi == 'arm':
-      abi_option = 'armeabi-v7a'
-    elif self.abi == 'mips':
-      abi_option = 'mips'
-    else:
-      abi_option = 'x86'
-
-    api_target = 'android-%s' % api_level
-
-    avd_command = [
-        self.android,
-        '--silent',
-        'create', 'avd',
-        '--name', self.avd_name,
-        '--abi', abi_option,
-        '--target', api_target,
-        '--sdcard', SDCARD_SIZE,
-        '--force',
-    ]
-    avd_cmd_str = ' '.join(avd_command)
-    logging.info('Create AVD command: %s', avd_cmd_str)
-    avd_process = pexpect.spawn(avd_cmd_str)
-
-    # Instead of creating a custom profile, we overwrite config files.
-    avd_process.expect('Do you wish to create a custom hardware profile')
-    avd_process.sendline('no\n')
-    avd_process.expect('Created AVD \'%s\'' % self.avd_name)
-
-    # Replace current configuration with default Galaxy Nexus config.
-    avds_dir = os.path.join(os.path.expanduser('~'), '.android', 'avd')
-    ini_file = os.path.join(avds_dir, '%s.ini' % self.avd_name)
-    new_config_ini = os.path.join(avds_dir, '%s.avd' % self.avd_name,
-                                  'config.ini')
-
-    # Remove config files with defaults to replace with Google's GN settings.
-    os.unlink(ini_file)
-    os.unlink(new_config_ini)
-
-    # Create new configuration files with Galaxy Nexus by Google settings.
-    with open(ini_file, 'w') as new_ini:
-      new_ini.write('avd.ini.encoding=ISO-8859-1\n')
-      new_ini.write('target=%s\n' % api_target)
-      new_ini.write('path=%s/%s.avd\n' % (avds_dir, self.avd_name))
-      new_ini.write('path.rel=avd/%s.avd\n' % self.avd_name)
-
-    custom_config = CONFIG_TEMPLATE
-    replacements = CONFIG_REPLACEMENTS[self.abi]
-    for key in replacements:
-      custom_config = custom_config.replace(key, replacements[key])
-    custom_config = custom_config.replace('{api.level}', str(api_level))
-
-    with open(new_config_ini, 'w') as new_config_ini:
-      new_config_ini.write(custom_config)
-
-    return self.avd_name
-
-
-  def _DeleteAVD(self):
-    """Delete the AVD of this emulator."""
-    avd_command = [
-        self.android,
-        '--silent',
-        'delete',
-        'avd',
-        '--name', self.avd_name,
-    ]
-    logging.info('Delete AVD command: %s', ' '.join(avd_command))
-    cmd_helper.RunCmd(avd_command)
-
-
-  def Launch(self, kill_all_emulators):
-    """Launches the emulator asynchronously. Call ConfirmLaunch() to ensure the
-    emulator is ready for use.
-
-    If fails, an exception will be raised.
-    """
-    if kill_all_emulators:
-      _KillAllEmulators()  # just to be sure
-    self._AggressiveImageCleanup()
-    (self.device_serial, port) = self._DeviceName()
-    emulator_command = [
-        self.emulator,
-        # Speed up emulator launch by 40%.  Really.
-        '-no-boot-anim',
-        # The default /data size is 64M.
-        # That's not enough for 8 unit test bundles and their data.
-        '-partition-size', '512',
-        # Use a familiar name and port.
-        '-avd', self.avd_name,
-        '-port', str(port),
-        # Wipe the data.  We've seen cases where an emulator gets 'stuck' if we
-        # don't do this (every thousand runs or so).
-        '-wipe-data',
-        # Enable GPU by default.
-        '-gpu', 'on',
-        '-qemu', '-m', '1024',
-        ]
-    if self.abi == 'x86':
-      emulator_command.extend([
-          # For x86 emulator --enable-kvm will fail early, avoiding accidental
-          # runs in a slow mode (i.e. without hardware virtualization support).
-          '--enable-kvm',
-          ])
-
-    logging.info('Emulator launch command: %s', ' '.join(emulator_command))
-    self.popen = subprocess.Popen(args=emulator_command,
-                                  stderr=subprocess.STDOUT)
-    self._InstallKillHandler()
-
-  @staticmethod
-  def _AggressiveImageCleanup():
-    """Aggressive cleanup of emulator images.
-
-    Experimentally it looks like our current emulator use on the bot
-    leaves image files around in /tmp/android-$USER.  If a "random"
-    name gets reused, we choke with a 'File exists' error.
-    TODO(jrg): is there a less hacky way to accomplish the same goal?
-    """
-    logging.info('Aggressive Image Cleanup')
-    emulator_imagedir = '/tmp/android-%s' % os.environ['USER']
-    if not os.path.exists(emulator_imagedir):
-      return
-    for image in os.listdir(emulator_imagedir):
-      full_name = os.path.join(emulator_imagedir, image)
-      if 'emulator' in full_name:
-        logging.info('Deleting emulator image %s', full_name)
-        os.unlink(full_name)
-
-  def ConfirmLaunch(self, wait_for_boot=False):
-    """Confirm the emulator launched properly.
-
-    Loop on a wait-for-device with a very small timeout.  On each
-    timeout, check the emulator process is still alive.
-    After confirming a wait-for-device can be successful, make sure
-    it returns the right answer.
-    """
-    seconds_waited = 0
-    number_of_waits = 2  # Make sure we can wfd twice
-
-    device = device_utils.DeviceUtils(self.device_serial)
-    while seconds_waited < self._LAUNCH_TIMEOUT:
-      try:
-        device.adb.WaitForDevice(
-            timeout=self._WAITFORDEVICE_TIMEOUT, retries=1)
-        number_of_waits -= 1
-        if not number_of_waits:
-          break
-      except device_errors.CommandTimeoutError:
-        seconds_waited += self._WAITFORDEVICE_TIMEOUT
-        device.adb.KillServer()
-      self.popen.poll()
-      if self.popen.returncode != None:
-        raise EmulatorLaunchException('EMULATOR DIED')
-
-    if seconds_waited >= self._LAUNCH_TIMEOUT:
-      raise EmulatorLaunchException('TIMEOUT with wait-for-device')
-
-    logging.info('Seconds waited on wait-for-device: %d', seconds_waited)
-    if wait_for_boot:
-      # Now that we checked for obvious problems, wait for a boot complete.
-      # Waiting for the package manager is sometimes problematic.
-      device.WaitUntilFullyBooted(timeout=self._WAITFORBOOT_TIMEOUT)
-
-  def Shutdown(self):
-    """Shuts down the process started by launch."""
-    self._DeleteAVD()
-    if self.popen:
-      self.popen.poll()
-      if self.popen.returncode == None:
-        self.popen.kill()
-      self.popen = None
-
-  def _ShutdownOnSignal(self, _signum, _frame):
-    logging.critical('emulator _ShutdownOnSignal')
-    for sig in self._SIGNALS:
-      signal.signal(sig, signal.SIG_DFL)
-    self.Shutdown()
-    raise KeyboardInterrupt  # print a stack
-
-  def _InstallKillHandler(self):
-    """Install a handler to kill the emulator when we exit unexpectedly."""
-    for sig in self._SIGNALS:
-      signal.signal(sig, self._ShutdownOnSignal)
diff --git a/build/android/pylib/utils/findbugs.py b/build/android/pylib/utils/findbugs.py
deleted file mode 100644
index 8deb0fe..0000000
--- a/build/android/pylib/utils/findbugs.py
+++ /dev/null
@@ -1,154 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import argparse
-import logging
-import os
-import re
-import shlex
-import sys
-import xml.dom.minidom
-
-from pylib import cmd_helper
-from pylib import constants
-
-
-_FINDBUGS_HOME = os.path.join(constants.DIR_SOURCE_ROOT, 'third_party',
-                              'findbugs')
-_FINDBUGS_JAR = os.path.join(_FINDBUGS_HOME, 'lib', 'findbugs.jar')
-_FINDBUGS_MAX_HEAP = 768
-_FINDBUGS_PLUGIN_PATH = os.path.join(
-    constants.DIR_SOURCE_ROOT, 'tools', 'android', 'findbugs_plugin', 'lib',
-    'chromiumPlugin.jar')
-
-
-def _ParseXmlResults(results_doc):
-  warnings = set()
-  for en in (n for n in results_doc.documentElement.childNodes
-             if n.nodeType == xml.dom.Node.ELEMENT_NODE):
-    if en.tagName == 'BugInstance':
-      warnings.add(_ParseBugInstance(en))
-  return warnings
-
-
-def _GetMessage(node):
-  for c in (n for n in node.childNodes
-            if n.nodeType == xml.dom.Node.ELEMENT_NODE):
-    if c.tagName == 'Message':
-      if (len(c.childNodes) == 1
-          and c.childNodes[0].nodeType == xml.dom.Node.TEXT_NODE):
-        return c.childNodes[0].data
-  return None
-
-
-def _ParseBugInstance(node):
-  bug = FindBugsWarning(node.getAttribute('type'))
-  msg_parts = []
-  for c in (n for n in node.childNodes
-            if n.nodeType == xml.dom.Node.ELEMENT_NODE):
-    if c.tagName == 'Class':
-      msg_parts.append(_GetMessage(c))
-    elif c.tagName == 'Method':
-      msg_parts.append(_GetMessage(c))
-    elif c.tagName == 'Field':
-      msg_parts.append(_GetMessage(c))
-    elif c.tagName == 'SourceLine':
-      bug.file_name = c.getAttribute('sourcefile')
-      if c.hasAttribute('start'):
-        bug.start_line = int(c.getAttribute('start'))
-      if c.hasAttribute('end'):
-        bug.end_line = int(c.getAttribute('end'))
-      msg_parts.append(_GetMessage(c))
-    elif (c.tagName == 'ShortMessage' and len(c.childNodes) == 1
-          and c.childNodes[0].nodeType == xml.dom.Node.TEXT_NODE):
-      msg_parts.append(c.childNodes[0].data)
-  bug.message = tuple(m for m in msg_parts if m)
-  return bug
-
-
-class FindBugsWarning(object):
-
-  def __init__(self, bug_type='', end_line=0, file_name='', message=None,
-               start_line=0):
-    self.bug_type = bug_type
-    self.end_line = end_line
-    self.file_name = file_name
-    if message is None:
-      self.message = tuple()
-    else:
-      self.message = message
-    self.start_line = start_line
-
-  def __cmp__(self, other):
-    return (cmp(self.file_name, other.file_name)
-            or cmp(self.start_line, other.start_line)
-            or cmp(self.end_line, other.end_line)
-            or cmp(self.bug_type, other.bug_type)
-            or cmp(self.message, other.message))
-
-  def __eq__(self, other):
-    return self.__dict__ == other.__dict__
-
-  def __hash__(self):
-    return hash((self.bug_type, self.end_line, self.file_name, self.message,
-                 self.start_line))
-
-  def __ne__(self, other):
-    return not self == other
-
-  def __str__(self):
-    return '%s: %s' % (self.bug_type, '\n  '.join(self.message))
-
-
-def Run(exclude, classes_to_analyze, auxiliary_classes, output_file,
-        findbug_args, jars):
-  """Run FindBugs.
-
-  Args:
-    exclude: the exclude xml file, refer to FindBugs's -exclude command option.
-    classes_to_analyze: the list of classes need to analyze, refer to FindBug's
-                        -onlyAnalyze command line option.
-    auxiliary_classes: the classes help to analyze, refer to FindBug's
-                       -auxclasspath command line option.
-    output_file: An optional path to dump XML results to.
-    findbug_args: A list of addtional command line options to pass to Findbugs.
-  """
-  # TODO(jbudorick): Get this from the build system.
-  system_classes = [
-    os.path.join(constants.ANDROID_SDK_ROOT, 'platforms',
-                 'android-%s' % constants.ANDROID_SDK_VERSION, 'android.jar')
-  ]
-  system_classes.extend(os.path.abspath(classes)
-                        for classes in auxiliary_classes or [])
-
-  cmd = ['java',
-         '-classpath', '%s:' % _FINDBUGS_JAR,
-         '-Xmx%dm' % _FINDBUGS_MAX_HEAP,
-         '-Dfindbugs.home="%s"' % _FINDBUGS_HOME,
-         '-jar', _FINDBUGS_JAR,
-         '-textui', '-sortByClass',
-         '-pluginList', _FINDBUGS_PLUGIN_PATH, '-xml:withMessages']
-  if system_classes:
-    cmd.extend(['-auxclasspath', ':'.join(system_classes)])
-  if classes_to_analyze:
-    cmd.extend(['-onlyAnalyze', classes_to_analyze])
-  if exclude:
-    cmd.extend(['-exclude', os.path.abspath(exclude)])
-  if output_file:
-    cmd.extend(['-output', output_file])
-  if findbug_args:
-    cmd.extend(findbug_args)
-  cmd.extend(os.path.abspath(j) for j in jars or [])
-
-  if output_file:
-    cmd_helper.RunCmd(cmd)
-    results_doc = xml.dom.minidom.parse(output_file)
-  else:
-    raw_out = cmd_helper.GetCmdOutput(cmd)
-    results_doc = xml.dom.minidom.parseString(raw_out)
-
-  current_warnings_set = _ParseXmlResults(results_doc)
-
-  return (' '.join(cmd), current_warnings_set)
-
diff --git a/build/android/pylib/utils/host_path_finder.py b/build/android/pylib/utils/host_path_finder.py
deleted file mode 100644
index 389ac43..0000000
--- a/build/android/pylib/utils/host_path_finder.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import os
-
-from pylib import constants
-
-
-def GetMostRecentHostPath(file_name):
-  """Returns the most recent existing full path for the given file name.
-
-  Returns: An empty string if no path could be found.
-  """
-  out_dir = os.path.join(
-      constants.DIR_SOURCE_ROOT, os.environ.get('CHROMIUM_OUT_DIR', 'out'))
-  candidate_paths = [os.path.join(out_dir, build_type, file_name)
-                     for build_type in ['Debug', 'Release']]
-  candidate_paths = filter(os.path.exists, candidate_paths)
-  candidate_paths = sorted(candidate_paths, key=os.path.getmtime, reverse=True)
-  candidate_paths.append('')
-  return candidate_paths[0]
diff --git a/build/android/pylib/utils/host_utils.py b/build/android/pylib/utils/host_utils.py
deleted file mode 100644
index 580721f..0000000
--- a/build/android/pylib/utils/host_utils.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import os
-
-
-def GetRecursiveDiskUsage(path):
-  """Returns the disk usage in bytes of |path|. Similar to `du -sb |path|`."""
-  running_size = os.path.getsize(path)
-  if os.path.isdir(path):
-    for root, dirs, files in os.walk(path):
-      running_size += sum([os.path.getsize(os.path.join(root, f))
-                           for f in files + dirs])
-  return running_size
-
diff --git a/build/android/pylib/utils/isolator.py b/build/android/pylib/utils/isolator.py
deleted file mode 100644
index cac39d8..0000000
--- a/build/android/pylib/utils/isolator.py
+++ /dev/null
@@ -1,173 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import fnmatch
-import glob
-import os
-import shutil
-import sys
-
-from pylib import cmd_helper
-from pylib import constants
-
-
-_ISOLATE_SCRIPT = os.path.join(
-    constants.DIR_SOURCE_ROOT, 'tools', 'swarming_client', 'isolate.py')
-
-
-def DefaultPathVariables():
-  return {
-    'DEPTH': constants.DIR_SOURCE_ROOT,
-    'PRODUCT_DIR': constants.GetOutDirectory(),
-  }
-
-
-def DefaultConfigVariables():
-  # Note: This list must match the --config-vars in build/isolate.gypi
-  return {
-    'CONFIGURATION_NAME': constants.GetBuildType(),
-    'OS': 'android',
-    'asan': '0',
-    'branding': 'Chromium',
-    'chromeos': '0',
-    'component': 'static_library',
-    'enable_pepper_cdms': '0',
-    'enable_plugins': '0',
-    'fastbuild': '0',
-    'icu_use_data_file_flag': '1',
-    'kasko': '0',
-    'lsan': '0',
-    'msan': '0',
-    # TODO(maruel): This may not always be true.
-    'target_arch': 'arm',
-    'tsan': '0',
-    'use_custom_libcxx': '0',
-    'use_instrumented_libraries': '0',
-    'use_prebuilt_instrumented_libraries': '0',
-    'use_openssl': '0',
-    'use_ozone': '0',
-    'use_x11': '0',
-    'v8_use_external_startup_data': '1',
-  }
-
-
-class Isolator(object):
-  """Manages calls to isolate.py for the android test runner scripts."""
-
-  def __init__(self, isolate_deps_dir):
-    """
-    Args:
-      isolate_deps_dir: The directory in which dependencies specified by
-        isolate are or should be stored.
-    """
-    self._isolate_deps_dir = isolate_deps_dir
-
-  def Clear(self):
-    """Deletes the isolate dependency directory."""
-    if os.path.exists(self._isolate_deps_dir):
-      shutil.rmtree(self._isolate_deps_dir)
-
-  def Remap(self, isolate_abs_path, isolated_abs_path,
-            path_variables=None, config_variables=None):
-    """Remaps data dependencies into |self._isolate_deps_dir|.
-
-    Args:
-      isolate_abs_path: The absolute path to the .isolate file, which specifies
-        data dependencies in the source tree.
-      isolated_abs_path: The absolute path to the .isolated file, which is
-        generated by isolate.py and specifies data dependencies in
-        |self._isolate_deps_dir| and their digests.
-      path_variables: A dict containing everything that should be passed
-        as a |--path-variable| to the isolate script. Defaults to the return
-        value of |DefaultPathVariables()|.
-      config_variables: A dict containing everything that should be passed
-        as a |--config-variable| to the isolate script. Defaults to the return
-        value of |DefaultConfigVariables()|.
-    Raises:
-      Exception if the isolate command fails for some reason.
-    """
-    if not path_variables:
-      path_variables = DefaultPathVariables()
-    if not config_variables:
-      config_variables = DefaultConfigVariables()
-
-    isolate_cmd = [
-      sys.executable, _ISOLATE_SCRIPT, 'remap',
-      '--isolate', isolate_abs_path,
-      '--isolated', isolated_abs_path,
-      '--outdir', self._isolate_deps_dir,
-    ]
-    for k, v in path_variables.iteritems():
-      isolate_cmd.extend(['--path-variable', k, v])
-    for k, v in config_variables.iteritems():
-      isolate_cmd.extend(['--config-variable', k, v])
-
-    if cmd_helper.RunCmd(isolate_cmd):
-      raise Exception('isolate command failed: %s' % ' '.join(isolate_cmd))
-
-  def VerifyHardlinks(self):
-    """Checks |isolate_deps_dir| for a hardlink.
-
-    Returns:
-      True if a hardlink is found.
-      False if nothing is found.
-    Raises:
-      Exception if a non-hardlink is found.
-    """
-    for root, _, filenames in os.walk(self._isolate_deps_dir):
-      if filenames:
-        linked_file = os.path.join(root, filenames[0])
-        orig_file = os.path.join(
-            self._isolate_deps_dir,
-            os.path.relpath(linked_file, self._isolate_deps_dir))
-        if os.stat(linked_file).st_ino == os.stat(orig_file).st_ino:
-          return True
-        else:
-          raise Exception('isolate remap command did not use hardlinks.')
-    return False
-
-  def PurgeExcluded(self, deps_exclusion_list):
-    """Deletes anything on |deps_exclusion_list| from |self._isolate_deps_dir|.
-
-    Args:
-      deps_exclusion_list: A list of globs to exclude from the isolate
-        dependency directory.
-    """
-    excluded_paths = (
-        x for y in deps_exclusion_list
-        for x in glob.glob(
-            os.path.abspath(os.path.join(self._isolate_deps_dir, y))))
-    for p in excluded_paths:
-      if os.path.isdir(p):
-        shutil.rmtree(p)
-      else:
-        os.remove(p)
-
-  def MoveOutputDeps(self):
-    """Moves files from the output directory to the top level of
-      |self._isolate_deps_dir|.
-
-    Moves pak files from the output directory to to <isolate_deps_dir>/paks
-    Moves files from the product directory to <isolate_deps_dir>
-    """
-    # On Android, all pak files need to be in the top-level 'paks' directory.
-    paks_dir = os.path.join(self._isolate_deps_dir, 'paks')
-    os.mkdir(paks_dir)
-
-    deps_out_dir = os.path.join(
-        self._isolate_deps_dir,
-        os.path.relpath(os.path.join(constants.GetOutDirectory(), os.pardir),
-                        constants.DIR_SOURCE_ROOT))
-    for root, _, filenames in os.walk(deps_out_dir):
-      for filename in fnmatch.filter(filenames, '*.pak'):
-        shutil.move(os.path.join(root, filename), paks_dir)
-
-    # Move everything in PRODUCT_DIR to top level.
-    deps_product_dir = os.path.join(deps_out_dir, constants.GetBuildType())
-    if os.path.isdir(deps_product_dir):
-      for p in os.listdir(deps_product_dir):
-        shutil.move(os.path.join(deps_product_dir, p), self._isolate_deps_dir)
-      os.rmdir(deps_product_dir)
-      os.rmdir(deps_out_dir)
-
diff --git a/build/android/pylib/utils/json_results_generator_unittest.py b/build/android/pylib/utils/json_results_generator_unittest.py
deleted file mode 100644
index 41ab77b..0000000
--- a/build/android/pylib/utils/json_results_generator_unittest.py
+++ /dev/null
@@ -1,213 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-#
-# Most of this file was ported over from Blink's
-# webkitpy/layout_tests/layout_package/json_results_generator_unittest.py
-#
-
-import unittest
-import json
-
-from pylib.utils import json_results_generator
-
-
-class JSONGeneratorTest(unittest.TestCase):
-
-  def setUp(self):
-    self.builder_name = 'DUMMY_BUILDER_NAME'
-    self.build_name = 'DUMMY_BUILD_NAME'
-    self.build_number = 'DUMMY_BUILDER_NUMBER'
-
-    # For archived results.
-    self._json = None
-    self._num_runs = 0
-    self._tests_set = set([])
-    self._test_timings = {}
-    self._failed_count_map = {}
-
-    self._PASS_count = 0
-    self._DISABLED_count = 0
-    self._FLAKY_count = 0
-    self._FAILS_count = 0
-    self._fixable_count = 0
-
-    self._orig_write_json = json_results_generator.WriteJSON
-
-    # unused arguments ... pylint: disable=W0613
-    def _WriteJSONStub(json_object, file_path, callback=None):
-      pass
-
-    json_results_generator.WriteJSON = _WriteJSONStub
-
-  def tearDown(self):
-    json_results_generator.WriteJSON = self._orig_write_json
-
-  def _TestJSONGeneration(self, passed_tests_list, failed_tests_list):
-    tests_set = set(passed_tests_list) | set(failed_tests_list)
-
-    DISABLED_tests = set([t for t in tests_set
-                          if t.startswith('DISABLED_')])
-    FLAKY_tests = set([t for t in tests_set
-                       if t.startswith('FLAKY_')])
-    FAILS_tests = set([t for t in tests_set
-                       if t.startswith('FAILS_')])
-    PASS_tests = tests_set - (DISABLED_tests | FLAKY_tests | FAILS_tests)
-
-    failed_tests = set(failed_tests_list) - DISABLED_tests
-    failed_count_map = dict([(t, 1) for t in failed_tests])
-
-    test_timings = {}
-    i = 0
-    for test in tests_set:
-      test_timings[test] = float(self._num_runs * 100 + i)
-      i += 1
-
-    test_results_map = dict()
-    for test in tests_set:
-      test_results_map[test] = json_results_generator.TestResult(
-          test, failed=(test in failed_tests),
-          elapsed_time=test_timings[test])
-
-    generator = json_results_generator.JSONResultsGeneratorBase(
-        self.builder_name, self.build_name, self.build_number,
-        '',
-        None,   # don't fetch past json results archive
-        test_results_map)
-
-    failed_count_map = dict([(t, 1) for t in failed_tests])
-
-    # Test incremental json results
-    incremental_json = generator.GetJSON()
-    self._VerifyJSONResults(
-        tests_set,
-        test_timings,
-        failed_count_map,
-        len(PASS_tests),
-        len(DISABLED_tests),
-        len(FLAKY_tests),
-        len(DISABLED_tests | failed_tests),
-        incremental_json,
-        1)
-
-    # We don't verify the results here, but at least we make sure the code
-    # runs without errors.
-    generator.GenerateJSONOutput()
-    generator.GenerateTimesMSFile()
-
-  def _VerifyJSONResults(self, tests_set, test_timings, failed_count_map,
-                         PASS_count, DISABLED_count, FLAKY_count,
-                         fixable_count, json_obj, num_runs):
-    # Aliasing to a short name for better access to its constants.
-    JRG = json_results_generator.JSONResultsGeneratorBase
-
-    self.assertIn(JRG.VERSION_KEY, json_obj)
-    self.assertIn(self.builder_name, json_obj)
-
-    buildinfo = json_obj[self.builder_name]
-    self.assertIn(JRG.FIXABLE, buildinfo)
-    self.assertIn(JRG.TESTS, buildinfo)
-    self.assertEqual(len(buildinfo[JRG.BUILD_NUMBERS]), num_runs)
-    self.assertEqual(buildinfo[JRG.BUILD_NUMBERS][0], self.build_number)
-
-    if tests_set or DISABLED_count:
-      fixable = {}
-      for fixable_items in buildinfo[JRG.FIXABLE]:
-        for (result_type, count) in fixable_items.iteritems():
-          if result_type in fixable:
-            fixable[result_type] = fixable[result_type] + count
-          else:
-            fixable[result_type] = count
-
-      if PASS_count:
-        self.assertEqual(fixable[JRG.PASS_RESULT], PASS_count)
-      else:
-        self.assertTrue(JRG.PASS_RESULT not in fixable or
-                        fixable[JRG.PASS_RESULT] == 0)
-      if DISABLED_count:
-        self.assertEqual(fixable[JRG.SKIP_RESULT], DISABLED_count)
-      else:
-        self.assertTrue(JRG.SKIP_RESULT not in fixable or
-                        fixable[JRG.SKIP_RESULT] == 0)
-      if FLAKY_count:
-        self.assertEqual(fixable[JRG.FLAKY_RESULT], FLAKY_count)
-      else:
-        self.assertTrue(JRG.FLAKY_RESULT not in fixable or
-                        fixable[JRG.FLAKY_RESULT] == 0)
-
-    if failed_count_map:
-      tests = buildinfo[JRG.TESTS]
-      for test_name in failed_count_map.iterkeys():
-        test = self._FindTestInTrie(test_name, tests)
-
-        failed = 0
-        for result in test[JRG.RESULTS]:
-          if result[1] == JRG.FAIL_RESULT:
-            failed += result[0]
-        self.assertEqual(failed_count_map[test_name], failed)
-
-        timing_count = 0
-        for timings in test[JRG.TIMES]:
-          if timings[1] == test_timings[test_name]:
-            timing_count = timings[0]
-        self.assertEqual(1, timing_count)
-
-    if fixable_count:
-      self.assertEqual(sum(buildinfo[JRG.FIXABLE_COUNT]), fixable_count)
-
-  def _FindTestInTrie(self, path, trie):
-    nodes = path.split('/')
-    sub_trie = trie
-    for node in nodes:
-      self.assertIn(node, sub_trie)
-      sub_trie = sub_trie[node]
-    return sub_trie
-
-  def testJSONGeneration(self):
-    self._TestJSONGeneration([], [])
-    self._TestJSONGeneration(['A1', 'B1'], [])
-    self._TestJSONGeneration([], ['FAILS_A2', 'FAILS_B2'])
-    self._TestJSONGeneration(['DISABLED_A3', 'DISABLED_B3'], [])
-    self._TestJSONGeneration(['A4'], ['B4', 'FAILS_C4'])
-    self._TestJSONGeneration(['DISABLED_C5', 'DISABLED_D5'], ['A5', 'B5'])
-    self._TestJSONGeneration(
-        ['A6', 'B6', 'FAILS_C6', 'DISABLED_E6', 'DISABLED_F6'],
-        ['FAILS_D6'])
-
-    # Generate JSON with the same test sets. (Both incremental results and
-    # archived results must be updated appropriately.)
-    self._TestJSONGeneration(
-        ['A', 'FLAKY_B', 'DISABLED_C'],
-        ['FAILS_D', 'FLAKY_E'])
-    self._TestJSONGeneration(
-        ['A', 'DISABLED_C', 'FLAKY_E'],
-        ['FLAKY_B', 'FAILS_D'])
-    self._TestJSONGeneration(
-        ['FLAKY_B', 'DISABLED_C', 'FAILS_D'],
-        ['A', 'FLAKY_E'])
-
-  def testHierarchicalJSNGeneration(self):
-    # FIXME: Re-work tests to be more comprehensible and comprehensive.
-    self._TestJSONGeneration(['foo/A'], ['foo/B', 'bar/C'])
-
-  def testTestTimingsTrie(self):
-    individual_test_timings = []
-    individual_test_timings.append(
-        json_results_generator.TestResult(
-            'foo/bar/baz.html',
-            elapsed_time=1.2))
-    individual_test_timings.append(
-        json_results_generator.TestResult('bar.html', elapsed_time=0.0001))
-    trie = json_results_generator.TestTimingsTrie(individual_test_timings)
-
-    expected_trie = {
-        'bar.html': 0,
-        'foo': {
-            'bar': {
-                'baz.html': 1200,
-            }
-        }
-    }
-
-    self.assertEqual(json.dumps(trie), json.dumps(expected_trie))
diff --git a/build/android/pylib/utils/logging_utils.py b/build/android/pylib/utils/logging_utils.py
deleted file mode 100644
index 1e46fa8..0000000
--- a/build/android/pylib/utils/logging_utils.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import contextlib
-import logging
-
-@contextlib.contextmanager
-def SuppressLogging(level=logging.ERROR):
-  """Momentarilly suppress logging events from all loggers.
-
-  TODO(jbudorick): This is not thread safe. Log events from other threads might
-  also inadvertently dissapear.
-
-  Example:
-
-    with logging_utils.SuppressLogging():
-      # all but CRITICAL logging messages are suppressed
-      logging.info('just doing some thing') # not shown
-      logging.critical('something really bad happened') # still shown
-
-  Args:
-    level: logging events with this or lower levels are suppressed.
-  """
-  logging.disable(level)
-  yield
-  logging.disable(logging.NOTSET)
diff --git a/build/android/pylib/utils/md5sum.py b/build/android/pylib/utils/md5sum.py
deleted file mode 100644
index 3e61c8f..0000000
--- a/build/android/pylib/utils/md5sum.py
+++ /dev/null
@@ -1,91 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import collections
-import logging
-import os
-import re
-import tempfile
-import types
-
-from pylib import cmd_helper
-from pylib import constants
-from pylib.utils import device_temp_file
-
-MD5SUM_DEVICE_LIB_PATH = '/data/local/tmp/md5sum/'
-MD5SUM_DEVICE_BIN_PATH = MD5SUM_DEVICE_LIB_PATH + 'md5sum_bin'
-
-MD5SUM_DEVICE_SCRIPT_FORMAT = (
-    'test -f {path} -o -d {path} '
-    '&& LD_LIBRARY_PATH={md5sum_lib} {md5sum_bin} {path}')
-
-_STARTS_WITH_CHECKSUM_RE = re.compile(r'^\s*[0-9a-fA-F]{32}\s+')
-
-
-def CalculateHostMd5Sums(paths):
-  """Calculates the MD5 sum value for all items in |paths|.
-
-  Directories are traversed recursively and the MD5 sum of each file found is
-  reported in the result.
-
-  Args:
-    paths: A list of host paths to md5sum.
-  Returns:
-    A dict mapping file paths to their respective md5sum checksums.
-  """
-  if isinstance(paths, basestring):
-    paths = [paths]
-
-  md5sum_bin_host_path = os.path.join(
-      constants.GetOutDirectory(), 'md5sum_bin_host')
-  if not os.path.exists(md5sum_bin_host_path):
-    raise IOError('File not built: %s' % md5sum_bin_host_path)
-  out = cmd_helper.GetCmdOutput([md5sum_bin_host_path] + [p for p in paths])
-
-  return _ParseMd5SumOutput(out.splitlines())
-
-
-def CalculateDeviceMd5Sums(paths, device):
-  """Calculates the MD5 sum value for all items in |paths|.
-
-  Directories are traversed recursively and the MD5 sum of each file found is
-  reported in the result.
-
-  Args:
-    paths: A list of device paths to md5sum.
-  Returns:
-    A dict mapping file paths to their respective md5sum checksums.
-  """
-  if isinstance(paths, basestring):
-    paths = [paths]
-
-  if not device.FileExists(MD5SUM_DEVICE_BIN_PATH):
-    md5sum_dist_path = os.path.join(constants.GetOutDirectory(), 'md5sum_dist')
-    if not os.path.exists(md5sum_dist_path):
-      raise IOError('File not built: %s' % md5sum_dist_path)
-    device.adb.Push(md5sum_dist_path, MD5SUM_DEVICE_LIB_PATH)
-
-  out = []
-
-  with tempfile.NamedTemporaryFile() as md5sum_script_file:
-    with device_temp_file.DeviceTempFile(
-        device.adb) as md5sum_device_script_file:
-      md5sum_script = (
-          MD5SUM_DEVICE_SCRIPT_FORMAT.format(
-              path=p, md5sum_lib=MD5SUM_DEVICE_LIB_PATH,
-              md5sum_bin=MD5SUM_DEVICE_BIN_PATH)
-          for p in paths)
-      md5sum_script_file.write('; '.join(md5sum_script))
-      md5sum_script_file.flush()
-      device.adb.Push(md5sum_script_file.name, md5sum_device_script_file.name)
-      out = device.RunShellCommand(['sh', md5sum_device_script_file.name])
-
-  return _ParseMd5SumOutput(out)
-
-
-def _ParseMd5SumOutput(out):
-  hash_and_path = (l.split(None, 1) for l in out
-                   if l and _STARTS_WITH_CHECKSUM_RE.match(l))
-  return dict((p, h) for h, p in hash_and_path)
-
diff --git a/build/android/pylib/utils/md5sum_test.py b/build/android/pylib/utils/md5sum_test.py
deleted file mode 100755
index c94c19d..0000000
--- a/build/android/pylib/utils/md5sum_test.py
+++ /dev/null
@@ -1,231 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import os
-import sys
-import unittest
-
-from pylib import cmd_helper
-from pylib import constants
-from pylib.utils import md5sum
-
-sys.path.append(
-    os.path.join(constants.DIR_SOURCE_ROOT, 'third_party', 'pymock'))
-import mock
-
-TEST_OUT_DIR = os.path.join('test', 'out', 'directory')
-HOST_MD5_EXECUTABLE = os.path.join(TEST_OUT_DIR, 'md5sum_bin_host')
-
-class Md5SumTest(unittest.TestCase):
-
-  def setUp(self):
-    self._patchers = [
-        mock.patch('pylib.constants.GetOutDirectory',
-                   new=mock.Mock(return_value=TEST_OUT_DIR)),
-        mock.patch('os.path.exists',
-                   new=mock.Mock(return_value=True)),
-    ]
-    for p in self._patchers:
-      p.start()
-
-  def tearDown(self):
-    for p in self._patchers:
-      p.stop()
-
-  def testCalculateHostMd5Sums_singlePath(self):
-    test_path = '/test/host/file.dat'
-    mock_get_cmd_output = mock.Mock(
-        return_value='0123456789abcdeffedcba9876543210 /test/host/file.dat')
-    with mock.patch('pylib.cmd_helper.GetCmdOutput', new=mock_get_cmd_output):
-      out = md5sum.CalculateHostMd5Sums(test_path)
-      self.assertEquals(1, len(out))
-      self.assertTrue('/test/host/file.dat' in out)
-      self.assertEquals('0123456789abcdeffedcba9876543210',
-                        out['/test/host/file.dat'])
-      mock_get_cmd_output.assert_called_once_with(
-          [HOST_MD5_EXECUTABLE, '/test/host/file.dat'])
-
-  def testCalculateHostMd5Sums_list(self):
-    test_paths = ['/test/host/file0.dat', '/test/host/file1.dat']
-    mock_get_cmd_output = mock.Mock(
-        return_value='0123456789abcdeffedcba9876543210 /test/host/file0.dat\n'
-                     '123456789abcdef00fedcba987654321 /test/host/file1.dat\n')
-    with mock.patch('pylib.cmd_helper.GetCmdOutput', new=mock_get_cmd_output):
-      out = md5sum.CalculateHostMd5Sums(test_paths)
-      self.assertEquals(2, len(out))
-      self.assertTrue('/test/host/file0.dat' in out)
-      self.assertEquals('0123456789abcdeffedcba9876543210',
-                        out['/test/host/file0.dat'])
-      self.assertTrue('/test/host/file1.dat' in out)
-      self.assertEquals('123456789abcdef00fedcba987654321',
-                        out['/test/host/file1.dat'])
-      mock_get_cmd_output.assert_called_once_with(
-          [HOST_MD5_EXECUTABLE, '/test/host/file0.dat',
-           '/test/host/file1.dat'])
-
-  def testCalculateHostMd5Sums_generator(self):
-    test_paths = ('/test/host/' + p for p in ['file0.dat', 'file1.dat'])
-    mock_get_cmd_output = mock.Mock(
-        return_value='0123456789abcdeffedcba9876543210 /test/host/file0.dat\n'
-                     '123456789abcdef00fedcba987654321 /test/host/file1.dat\n')
-    with mock.patch('pylib.cmd_helper.GetCmdOutput', new=mock_get_cmd_output):
-      out = md5sum.CalculateHostMd5Sums(test_paths)
-      self.assertEquals(2, len(out))
-      self.assertTrue('/test/host/file0.dat' in out)
-      self.assertEquals('0123456789abcdeffedcba9876543210',
-                        out['/test/host/file0.dat'])
-      self.assertTrue('/test/host/file1.dat' in out)
-      self.assertEquals('123456789abcdef00fedcba987654321',
-                        out['/test/host/file1.dat'])
-      mock_get_cmd_output.assert_called_once_with(
-          [HOST_MD5_EXECUTABLE, '/test/host/file0.dat', '/test/host/file1.dat'])
-
-  def testCalculateDeviceMd5Sums_singlePath(self):
-    test_path = '/storage/emulated/legacy/test/file.dat'
-
-    device = mock.NonCallableMock()
-    device.adb = mock.NonCallableMock()
-    device.adb.Push = mock.Mock()
-    device_md5sum_output = [
-        '0123456789abcdeffedcba9876543210 '
-            '/storage/emulated/legacy/test/file.dat',
-    ]
-    device.RunShellCommand = mock.Mock(return_value=device_md5sum_output)
-
-    mock_temp_file = mock.mock_open()
-    mock_temp_file.return_value.name = '/tmp/test/script/file.sh'
-
-    mock_device_temp_file = mock.mock_open()
-    mock_device_temp_file.return_value.name = (
-        '/data/local/tmp/test/script/file.sh')
-
-    with mock.patch('tempfile.NamedTemporaryFile', new=mock_temp_file), (
-         mock.patch('pylib.utils.device_temp_file.DeviceTempFile',
-                    new=mock_device_temp_file)):
-      out = md5sum.CalculateDeviceMd5Sums(test_path, device)
-      self.assertEquals(1, len(out))
-      self.assertTrue('/storage/emulated/legacy/test/file.dat' in out)
-      self.assertEquals('0123456789abcdeffedcba9876543210',
-                        out['/storage/emulated/legacy/test/file.dat'])
-      device.adb.Push.assert_called_once_with(
-          '/tmp/test/script/file.sh', '/data/local/tmp/test/script/file.sh')
-      device.RunShellCommand.assert_called_once_with(
-          ['sh', '/data/local/tmp/test/script/file.sh'])
-
-  def testCalculateDeviceMd5Sums_list(self):
-    test_path = ['/storage/emulated/legacy/test/file0.dat',
-                 '/storage/emulated/legacy/test/file1.dat']
-    device = mock.NonCallableMock()
-    device.adb = mock.NonCallableMock()
-    device.adb.Push = mock.Mock()
-    device_md5sum_output = [
-        '0123456789abcdeffedcba9876543210 '
-            '/storage/emulated/legacy/test/file0.dat',
-        '123456789abcdef00fedcba987654321 '
-            '/storage/emulated/legacy/test/file1.dat',
-    ]
-    device.RunShellCommand = mock.Mock(return_value=device_md5sum_output)
-
-    mock_temp_file = mock.mock_open()
-    mock_temp_file.return_value.name = '/tmp/test/script/file.sh'
-
-    mock_device_temp_file = mock.mock_open()
-    mock_device_temp_file.return_value.name = (
-        '/data/local/tmp/test/script/file.sh')
-
-    with mock.patch('tempfile.NamedTemporaryFile', new=mock_temp_file), (
-         mock.patch('pylib.utils.device_temp_file.DeviceTempFile',
-                    new=mock_device_temp_file)):
-      out = md5sum.CalculateDeviceMd5Sums(test_path, device)
-      self.assertEquals(2, len(out))
-      self.assertTrue('/storage/emulated/legacy/test/file0.dat' in out)
-      self.assertEquals('0123456789abcdeffedcba9876543210',
-                        out['/storage/emulated/legacy/test/file0.dat'])
-      self.assertTrue('/storage/emulated/legacy/test/file1.dat' in out)
-      self.assertEquals('123456789abcdef00fedcba987654321',
-                        out['/storage/emulated/legacy/test/file1.dat'])
-      device.adb.Push.assert_called_once_with(
-          '/tmp/test/script/file.sh', '/data/local/tmp/test/script/file.sh')
-      device.RunShellCommand.assert_called_once_with(
-          ['sh', '/data/local/tmp/test/script/file.sh'])
-
-  def testCalculateDeviceMd5Sums_generator(self):
-    test_path = ('/storage/emulated/legacy/test/file%d.dat' % n
-                 for n in xrange(0, 2))
-
-    device = mock.NonCallableMock()
-    device.adb = mock.NonCallableMock()
-    device.adb.Push = mock.Mock()
-    device_md5sum_output = [
-        '0123456789abcdeffedcba9876543210 '
-            '/storage/emulated/legacy/test/file0.dat',
-        '123456789abcdef00fedcba987654321 '
-            '/storage/emulated/legacy/test/file1.dat',
-    ]
-    device.RunShellCommand = mock.Mock(return_value=device_md5sum_output)
-
-    mock_temp_file = mock.mock_open()
-    mock_temp_file.return_value.name = '/tmp/test/script/file.sh'
-
-    mock_device_temp_file = mock.mock_open()
-    mock_device_temp_file.return_value.name = (
-        '/data/local/tmp/test/script/file.sh')
-
-    with mock.patch('tempfile.NamedTemporaryFile', new=mock_temp_file), (
-         mock.patch('pylib.utils.device_temp_file.DeviceTempFile',
-                    new=mock_device_temp_file)):
-      out = md5sum.CalculateDeviceMd5Sums(test_path, device)
-      self.assertEquals(2, len(out))
-      self.assertTrue('/storage/emulated/legacy/test/file0.dat' in out)
-      self.assertEquals('0123456789abcdeffedcba9876543210',
-                        out['/storage/emulated/legacy/test/file0.dat'])
-      self.assertTrue('/storage/emulated/legacy/test/file1.dat' in out)
-      self.assertEquals('123456789abcdef00fedcba987654321',
-                        out['/storage/emulated/legacy/test/file1.dat'])
-      device.adb.Push.assert_called_once_with(
-          '/tmp/test/script/file.sh', '/data/local/tmp/test/script/file.sh')
-      device.RunShellCommand.assert_called_once_with(
-          ['sh', '/data/local/tmp/test/script/file.sh'])
-
-  def testCalculateDeviceMd5Sums_singlePath_linkerWarning(self):
-    # See crbug/479966
-    test_path = '/storage/emulated/legacy/test/file.dat'
-
-    device = mock.NonCallableMock()
-    device.adb = mock.NonCallableMock()
-    device.adb.Push = mock.Mock()
-    device_md5sum_output = [
-        'WARNING: linker: /data/local/tmp/md5sum/md5sum_bin: '
-            'unused DT entry: type 0x1d arg 0x15db',
-        'THIS_IS_NOT_A_VALID_CHECKSUM_ZZZ some random text',
-        '0123456789abcdeffedcba9876543210 '
-            '/storage/emulated/legacy/test/file.dat',
-    ]
-    device.RunShellCommand = mock.Mock(return_value=device_md5sum_output)
-
-    mock_temp_file = mock.mock_open()
-    mock_temp_file.return_value.name = '/tmp/test/script/file.sh'
-
-    mock_device_temp_file = mock.mock_open()
-    mock_device_temp_file.return_value.name = (
-        '/data/local/tmp/test/script/file.sh')
-
-    with mock.patch('tempfile.NamedTemporaryFile', new=mock_temp_file), (
-         mock.patch('pylib.utils.device_temp_file.DeviceTempFile',
-                    new=mock_device_temp_file)):
-      out = md5sum.CalculateDeviceMd5Sums(test_path, device)
-      self.assertEquals(1, len(out))
-      self.assertTrue('/storage/emulated/legacy/test/file.dat' in out)
-      self.assertEquals('0123456789abcdeffedcba9876543210',
-                        out['/storage/emulated/legacy/test/file.dat'])
-      device.adb.Push.assert_called_once_with(
-          '/tmp/test/script/file.sh', '/data/local/tmp/test/script/file.sh')
-      device.RunShellCommand.assert_called_once_with(
-          ['sh', '/data/local/tmp/test/script/file.sh'])
-
-
-if __name__ == '__main__':
-  unittest.main(verbosity=2)
-
diff --git a/build/android/pylib/utils/mock_calls.py b/build/android/pylib/utils/mock_calls.py
deleted file mode 100644
index 59167ba..0000000
--- a/build/android/pylib/utils/mock_calls.py
+++ /dev/null
@@ -1,182 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-A test facility to assert call sequences while mocking their behavior.
-"""
-
-import os
-import sys
-import unittest
-
-from pylib import constants
-
-sys.path.append(os.path.join(
-    constants.DIR_SOURCE_ROOT, 'third_party', 'pymock'))
-import mock # pylint: disable=F0401
-
-
-class TestCase(unittest.TestCase):
-  """Adds assertCalls to TestCase objects."""
-  class _AssertCalls(object):
-    def __init__(self, test_case, expected_calls, watched):
-      def call_action(pair):
-        if isinstance(pair, type(mock.call)):
-          return (pair, None)
-        else:
-          return pair
-
-      def do_check(call):
-        def side_effect(*args, **kwargs):
-          received_call = call(*args, **kwargs)
-          self._test_case.assertTrue(
-              self._expected_calls,
-              msg=('Unexpected call: %s' % str(received_call)))
-          expected_call, action = self._expected_calls.pop(0)
-          self._test_case.assertTrue(
-              received_call == expected_call,
-              msg=('Expected call mismatch:\n'
-                   '  expected: %s\n'
-                   '  received: %s\n'
-                   % (str(expected_call), str(received_call))))
-          if callable(action):
-            return action(*args, **kwargs)
-          else:
-            return action
-        return side_effect
-
-      self._test_case = test_case
-      self._expected_calls = [call_action(pair) for pair in expected_calls]
-      watched = watched.copy() # do not pollute the caller's dict
-      watched.update((call.parent.name, call.parent)
-                     for call, _ in self._expected_calls)
-      self._patched = [test_case.patch_call(call, side_effect=do_check(call))
-                       for call in watched.itervalues()]
-
-    def __enter__(self):
-      for patch in self._patched:
-        patch.__enter__()
-      return self
-
-    def __exit__(self, exc_type, exc_val, exc_tb):
-      for patch in self._patched:
-        patch.__exit__(exc_type, exc_val, exc_tb)
-      if exc_type is None:
-        missing = ''.join('  expected: %s\n' % str(call)
-                          for call, _ in self._expected_calls)
-        self._test_case.assertFalse(
-            missing,
-            msg='Expected calls not found:\n' + missing)
-
-  def __init__(self, *args, **kwargs):
-    super(TestCase, self).__init__(*args, **kwargs)
-    self.call = mock.call.self
-    self._watched = {}
-
-  def call_target(self, call):
-    """Resolve a self.call instance to the target it represents.
-
-    Args:
-      call: a self.call instance, e.g. self.call.adb.Shell
-
-    Returns:
-      The target object represented by the call, e.g. self.adb.Shell
-
-    Raises:
-      ValueError if the path of the call does not start with "self", i.e. the
-          target of the call is external to the self object.
-      AttributeError if the path of the call does not specify a valid
-          chain of attributes (without any calls) starting from "self".
-    """
-    path = call.name.split('.')
-    if path.pop(0) != 'self':
-      raise ValueError("Target %r outside of 'self' object" % call.name)
-    target = self
-    for attr in path:
-      target = getattr(target, attr)
-    return target
-
-  def patch_call(self, call, **kwargs):
-    """Patch the target of a mock.call instance.
-
-    Args:
-      call: a mock.call instance identifying a target to patch
-      Extra keyword arguments are processed by mock.patch
-
-    Returns:
-      A context manager to mock/unmock the target of the call
-    """
-    if call.name.startswith('self.'):
-      target = self.call_target(call.parent)
-      _, attribute = call.name.rsplit('.', 1)
-      if (hasattr(type(target), attribute)
-          and isinstance(getattr(type(target), attribute), property)):
-        return mock.patch.object(
-            type(target), attribute, new_callable=mock.PropertyMock, **kwargs)
-      else:
-        return mock.patch.object(target, attribute, **kwargs)
-    else:
-      return mock.patch(call.name, **kwargs)
-
-  def watchCalls(self, calls):
-    """Add calls to the set of watched calls.
-
-    Args:
-      calls: a sequence of mock.call instances identifying targets to watch
-    """
-    self._watched.update((call.name, call) for call in calls)
-
-  def watchMethodCalls(self, call, ignore=None):
-    """Watch all public methods of the target identified by a self.call.
-
-    Args:
-      call: a self.call instance indetifying an object
-      ignore: a list of public methods to ignore when watching for calls
-    """
-    target = self.call_target(call)
-    if ignore is None:
-      ignore = []
-    self.watchCalls(getattr(call, method)
-                    for method in dir(target.__class__)
-                    if not method.startswith('_') and not method in ignore)
-
-  def clearWatched(self):
-    """Clear the set of watched calls."""
-    self._watched = {}
-
-  def assertCalls(self, *calls):
-    """A context manager to assert that a sequence of calls is made.
-
-    During the assertion, a number of functions and methods will be "watched",
-    and any calls made to them is expected to appear---in the exact same order,
-    and with the exact same arguments---as specified by the argument |calls|.
-
-    By default, the targets of all expected calls are watched. Further targets
-    to watch may be added using watchCalls and watchMethodCalls.
-
-    Optionaly, each call may be accompanied by an action. If the action is a
-    (non-callable) value, this value will be used as the return value given to
-    the caller when the matching call is found. Alternatively, if the action is
-    a callable, the action will be then called with the same arguments as the
-    intercepted call, so that it can provide a return value or perform other
-    side effects. If the action is missing, a return value of None is assumed.
-
-    Note that mock.Mock objects are often convenient to use as a callable
-    action, e.g. to raise exceptions or return other objects which are
-    themselves callable.
-
-    Args:
-      calls: each argument is either a pair (expected_call, action) or just an
-          expected_call, where expected_call is a mock.call instance.
-
-    Raises:
-      AssertionError if the watched targets do not receive the exact sequence
-          of calls specified. Missing calls, extra calls, and calls with
-          mismatching arguments, all cause the assertion to fail.
-    """
-    return self._AssertCalls(self, calls, self._watched)
-
-  def assertCall(self, call, action=None):
-    return self.assertCalls((call, action))
-
diff --git a/build/android/pylib/utils/mock_calls_test.py b/build/android/pylib/utils/mock_calls_test.py
deleted file mode 100755
index 4dbafd4..0000000
--- a/build/android/pylib/utils/mock_calls_test.py
+++ /dev/null
@@ -1,175 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-Unit tests for the contents of mock_calls.py.
-"""
-
-import logging
-import os
-import sys
-import unittest
-
-from pylib import constants
-from pylib.utils import mock_calls
-
-sys.path.append(os.path.join(
-    constants.DIR_SOURCE_ROOT, 'third_party', 'pymock'))
-import mock # pylint: disable=F0401
-
-
-class _DummyAdb(object):
-  def __str__(self):
-    return '0123456789abcdef'
-
-  def Push(self, host_path, device_path):
-    logging.debug('(device %s) pushing %r to %r', self, host_path, device_path)
-
-  def IsOnline(self):
-    logging.debug('(device %s) checking device online', self)
-    return True
-
-  def Shell(self, cmd):
-    logging.debug('(device %s) running command %r', self, cmd)
-    return "nice output\n"
-
-  def Reboot(self):
-    logging.debug('(device %s) rebooted!', self)
-
-  @property
-  def build_version_sdk(self):
-    logging.debug('(device %s) getting build_version_sdk', self)
-    return constants.ANDROID_SDK_VERSION_CODES.LOLLIPOP
-
-
-class TestCaseWithAssertCallsTest(mock_calls.TestCase):
-  def setUp(self):
-    self.adb = _DummyAdb()
-
-  def ShellError(self):
-    def action(cmd):
-      raise ValueError('(device %s) command %r is not nice' % (self.adb, cmd))
-    return action
-
-  def get_answer(self):
-    logging.debug("called 'get_answer' of %r object", self)
-    return 42
-
-  def echo(self, thing):
-    logging.debug("called 'echo' of %r object", self)
-    return thing
-
-  def testCallTarget_succeds(self):
-    self.assertEquals(self.adb.Shell,
-                      self.call_target(self.call.adb.Shell))
-
-  def testCallTarget_failsExternal(self):
-    with self.assertRaises(ValueError):
-      self.call_target(mock.call.sys.getcwd)
-
-  def testCallTarget_failsUnknownAttribute(self):
-    with self.assertRaises(AttributeError):
-      self.call_target(self.call.adb.Run)
-
-  def testCallTarget_failsIntermediateCalls(self):
-    with self.assertRaises(AttributeError):
-      self.call_target(self.call.adb.RunShell('cmd').append)
-
-  def testPatchCall_method(self):
-    self.assertEquals(42, self.get_answer())
-    with self.patch_call(self.call.get_answer, return_value=123):
-      self.assertEquals(123, self.get_answer())
-    self.assertEquals(42, self.get_answer())
-
-  def testPatchCall_attribute_method(self):
-    with self.patch_call(self.call.adb.Shell, return_value='hello'):
-      self.assertEquals('hello', self.adb.Shell('echo hello'))
-
-  def testPatchCall_global(self):
-    with self.patch_call(mock.call.os.getcwd, return_value='/some/path'):
-      self.assertEquals('/some/path', os.getcwd())
-
-  def testPatchCall_withSideEffect(self):
-    with self.patch_call(self.call.adb.Shell, side_effect=ValueError):
-      with self.assertRaises(ValueError):
-        self.adb.Shell('echo hello')
-
-  def testPatchCall_property(self):
-    self.assertEquals(constants.ANDROID_SDK_VERSION_CODES.LOLLIPOP,
-                      self.adb.build_version_sdk)
-    with self.patch_call(
-        self.call.adb.build_version_sdk,
-        return_value=constants.ANDROID_SDK_VERSION_CODES.KITKAT):
-      self.assertEquals(constants.ANDROID_SDK_VERSION_CODES.KITKAT,
-                        self.adb.build_version_sdk)
-    self.assertEquals(constants.ANDROID_SDK_VERSION_CODES.LOLLIPOP,
-                      self.adb.build_version_sdk)
-
-  def testAssertCalls_succeeds_simple(self):
-    self.assertEquals(42, self.get_answer())
-    with self.assertCall(self.call.get_answer(), 123):
-      self.assertEquals(123, self.get_answer())
-    self.assertEquals(42, self.get_answer())
-
-  def testAssertCalls_succeeds_multiple(self):
-    with self.assertCalls(
-        (mock.call.os.getcwd(), '/some/path'),
-        (self.call.echo('hello'), 'hello'),
-        (self.call.get_answer(), 11),
-        self.call.adb.Push('this_file', 'that_file'),
-        (self.call.get_answer(), 12)):
-      self.assertEquals(os.getcwd(), '/some/path')
-      self.assertEquals('hello', self.echo('hello'))
-      self.assertEquals(11, self.get_answer())
-      self.adb.Push('this_file', 'that_file')
-      self.assertEquals(12, self.get_answer())
-
-  def testAsserCalls_succeeds_withAction(self):
-    with self.assertCall(
-        self.call.adb.Shell('echo hello'), self.ShellError()):
-      with self.assertRaises(ValueError):
-        self.adb.Shell('echo hello')
-
-  def testAssertCalls_fails_tooManyCalls(self):
-    with self.assertRaises(AssertionError):
-      with self.assertCalls(self.call.adb.IsOnline()):
-        self.adb.IsOnline()
-        self.adb.IsOnline()
-
-  def testAssertCalls_fails_tooFewCalls(self):
-    with self.assertRaises(AssertionError):
-      with self.assertCalls(self.call.adb.IsOnline()):
-        pass
-
-  def testAssertCalls_succeeds_extraCalls(self):
-    # we are not watching Reboot, so the assertion succeeds
-    with self.assertCalls(self.call.adb.IsOnline()):
-      self.adb.IsOnline()
-      self.adb.Reboot()
-
-  def testAssertCalls_fails_extraCalls(self):
-    self.watchCalls([self.call.adb.Reboot])
-    # this time we are also watching Reboot, so the assertion fails
-    with self.assertRaises(AssertionError):
-      with self.assertCalls(self.call.adb.IsOnline()):
-        self.adb.IsOnline()
-        self.adb.Reboot()
-
-  def testAssertCalls_succeeds_NoCalls(self):
-    self.watchMethodCalls(self.call.adb) # we are watching all adb methods
-    with self.assertCalls():
-      pass
-
-  def testAssertCalls_fails_NoCalls(self):
-    self.watchMethodCalls(self.call.adb)
-    with self.assertRaises(AssertionError):
-      with self.assertCalls():
-        self.adb.IsOnline()
-
-
-if __name__ == '__main__':
-  logging.getLogger().setLevel(logging.DEBUG)
-  unittest.main(verbosity=2)
-
diff --git a/build/android/pylib/utils/parallelizer.py b/build/android/pylib/utils/parallelizer.py
deleted file mode 100644
index 9a85b54..0000000
--- a/build/android/pylib/utils/parallelizer.py
+++ /dev/null
@@ -1,242 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-""" Wrapper that allows method execution in parallel.
-
-This class wraps a list of objects of the same type, emulates their
-interface, and executes any functions called on the objects in parallel
-in ReraiserThreads.
-
-This means that, given a list of objects:
-
-  class Foo:
-    def __init__(self):
-      self.baz = Baz()
-
-    def bar(self, my_param):
-      // do something
-
-  list_of_foos = [Foo(1), Foo(2), Foo(3)]
-
-we can take a sequential operation on that list of objects:
-
-  for f in list_of_foos:
-    f.bar('Hello')
-
-and run it in parallel across all of the objects:
-
-  Parallelizer(list_of_foos).bar('Hello')
-
-It can also handle (non-method) attributes of objects, so that this:
-
-  for f in list_of_foos:
-    f.baz.myBazMethod()
-
-can be run in parallel with:
-
-  Parallelizer(list_of_foos).baz.myBazMethod()
-
-Because it emulates the interface of the wrapped objects, a Parallelizer
-can be passed to a method or function that takes objects of that type:
-
-  def DoesSomethingWithFoo(the_foo):
-    the_foo.bar('Hello')
-    the_foo.bar('world')
-    the_foo.baz.myBazMethod
-
-  DoesSomethingWithFoo(Parallelizer(list_of_foos))
-
-Note that this class spins up a thread for each object. Using this class
-to parallelize operations that are already fast will incur a net performance
-penalty.
-
-"""
-# pylint: disable=protected-access
-
-from pylib.utils import reraiser_thread
-from pylib.utils import watchdog_timer
-
-_DEFAULT_TIMEOUT = 30
-_DEFAULT_RETRIES = 3
-
-
-class Parallelizer(object):
-  """Allows parallel execution of method calls across a group of objects."""
-
-  def __init__(self, objs):
-    assert (objs is not None and len(objs) > 0), (
-        "Passed empty list to 'Parallelizer'")
-    self._orig_objs = objs
-    self._objs = objs
-
-  def __getattr__(self, name):
-    """Emulate getting the |name| attribute of |self|.
-
-    Args:
-      name: The name of the attribute to retrieve.
-    Returns:
-      A Parallelizer emulating the |name| attribute of |self|.
-    """
-    self.pGet(None)
-
-    r = type(self)(self._orig_objs)
-    r._objs = [getattr(o, name) for o in self._objs]
-    return r
-
-  def __getitem__(self, index):
-    """Emulate getting the value of |self| at |index|.
-
-    Returns:
-      A Parallelizer emulating the value of |self| at |index|.
-    """
-    self.pGet(None)
-
-    r = type(self)(self._orig_objs)
-    r._objs = [o[index] for o in self._objs]
-    return r
-
-  def __call__(self, *args, **kwargs):
-    """Emulate calling |self| with |args| and |kwargs|.
-
-    Note that this call is asynchronous. Call pFinish on the return value to
-    block until the call finishes.
-
-    Returns:
-      A Parallelizer wrapping the ReraiserThreadGroup running the call in
-      parallel.
-    Raises:
-      AttributeError if the wrapped objects aren't callable.
-    """
-    self.pGet(None)
-
-    if not self._objs:
-      raise AttributeError('Nothing to call.')
-    for o in self._objs:
-      if not callable(o):
-        raise AttributeError("'%s' is not callable" % o.__name__)
-
-    r = type(self)(self._orig_objs)
-    r._objs = reraiser_thread.ReraiserThreadGroup(
-        [reraiser_thread.ReraiserThread(
-            o, args=args, kwargs=kwargs,
-            name='%s.%s' % (str(d), o.__name__))
-         for d, o in zip(self._orig_objs, self._objs)])
-    r._objs.StartAll() # pylint: disable=W0212
-    return r
-
-  def pFinish(self, timeout):
-    """Finish any outstanding asynchronous operations.
-
-    Args:
-      timeout: The maximum number of seconds to wait for an individual
-               result to return, or None to wait forever.
-    Returns:
-      self, now emulating the return values.
-    """
-    self._assertNoShadow('pFinish')
-    if isinstance(self._objs, reraiser_thread.ReraiserThreadGroup):
-      self._objs.JoinAll()
-      self._objs = self._objs.GetAllReturnValues(
-          watchdog_timer.WatchdogTimer(timeout))
-    return self
-
-  def pGet(self, timeout):
-    """Get the current wrapped objects.
-
-    Args:
-      timeout: Same as |pFinish|.
-    Returns:
-      A list of the results, in order of the provided devices.
-    Raises:
-      Any exception raised by any of the called functions.
-    """
-    self._assertNoShadow('pGet')
-    self.pFinish(timeout)
-    return self._objs
-
-  def pMap(self, f, *args, **kwargs):
-    """Map a function across the current wrapped objects in parallel.
-
-    This calls f(o, *args, **kwargs) for each o in the set of wrapped objects.
-
-    Note that this call is asynchronous. Call pFinish on the return value to
-    block until the call finishes.
-
-    Args:
-      f: The function to call.
-      args: The positional args to pass to f.
-      kwargs: The keyword args to pass to f.
-    Returns:
-      A Parallelizer wrapping the ReraiserThreadGroup running the map in
-      parallel.
-    """
-    self._assertNoShadow('pMap')
-    r = type(self)(self._orig_objs)
-    r._objs = reraiser_thread.ReraiserThreadGroup(
-        [reraiser_thread.ReraiserThread(
-            f, args=tuple([o] + list(args)), kwargs=kwargs,
-            name='%s(%s)' % (f.__name__, d))
-         for d, o in zip(self._orig_objs, self._objs)])
-    r._objs.StartAll() # pylint: disable=W0212
-    return r
-
-  def _assertNoShadow(self, attr_name):
-    """Ensures that |attr_name| isn't shadowing part of the wrapped obejcts.
-
-    If the wrapped objects _do_ have an |attr_name| attribute, it will be
-    inaccessible to clients.
-
-    Args:
-      attr_name: The attribute to check.
-    Raises:
-      AssertionError if the wrapped objects have an attribute named 'attr_name'
-      or '_assertNoShadow'.
-    """
-    if isinstance(self._objs, reraiser_thread.ReraiserThreadGroup):
-      assert not hasattr(self._objs, '_assertNoShadow')
-      assert not hasattr(self._objs, attr_name)
-    else:
-      assert not any(hasattr(o, '_assertNoShadow') for o in self._objs)
-      assert not any(hasattr(o, attr_name) for o in self._objs)
-
-
-class SyncParallelizer(Parallelizer):
-  """A Parallelizer that blocks on function calls."""
-
-  #override
-  def __call__(self, *args, **kwargs):
-    """Emulate calling |self| with |args| and |kwargs|.
-
-    Note that this call is synchronous.
-
-    Returns:
-      A Parallelizer emulating the value returned from calling |self| with
-      |args| and |kwargs|.
-    Raises:
-      AttributeError if the wrapped objects aren't callable.
-    """
-    r = super(SyncParallelizer, self).__call__(*args, **kwargs)
-    r.pFinish(None)
-    return r
-
-  #override
-  def pMap(self, f, *args, **kwargs):
-    """Map a function across the current wrapped objects in parallel.
-
-    This calls f(o, *args, **kwargs) for each o in the set of wrapped objects.
-
-    Note that this call is synchronous.
-
-    Args:
-      f: The function to call.
-      args: The positional args to pass to f.
-      kwargs: The keyword args to pass to f.
-    Returns:
-      A Parallelizer wrapping the ReraiserThreadGroup running the map in
-      parallel.
-    """
-    r = super(SyncParallelizer, self).pMap(f, *args, **kwargs)
-    r.pFinish(None)
-    return r
-
diff --git a/build/android/pylib/utils/parallelizer_test.py b/build/android/pylib/utils/parallelizer_test.py
deleted file mode 100644
index 6e0c7e7..0000000
--- a/build/android/pylib/utils/parallelizer_test.py
+++ /dev/null
@@ -1,166 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Unit tests for the contents of parallelizer.py."""
-
-# pylint: disable=W0212
-# pylint: disable=W0613
-
-import os
-import tempfile
-import time
-import unittest
-
-from pylib.utils import parallelizer
-
-
-class ParallelizerTestObject(object):
-  """Class used to test parallelizer.Parallelizer."""
-
-  parallel = parallelizer.Parallelizer
-
-  def __init__(self, thing, completion_file_name=None):
-    self._thing = thing
-    self._completion_file_name = completion_file_name
-    self.helper = ParallelizerTestObjectHelper(thing)
-
-  @staticmethod
-  def doReturn(what):
-    return what
-
-  @classmethod
-  def doRaise(cls, what):
-    raise what
-
-  def doSetTheThing(self, new_thing):
-    self._thing = new_thing
-
-  def doReturnTheThing(self):
-    return self._thing
-
-  def doRaiseTheThing(self):
-    raise self._thing
-
-  def doRaiseIfExceptionElseSleepFor(self, sleep_duration):
-    if isinstance(self._thing, Exception):
-      raise self._thing
-    time.sleep(sleep_duration)
-    self._write_completion_file()
-    return self._thing
-
-  def _write_completion_file(self):
-    if self._completion_file_name and len(self._completion_file_name):
-      with open(self._completion_file_name, 'w+b') as completion_file:
-        completion_file.write('complete')
-
-  def __getitem__(self, index):
-    return self._thing[index]
-
-  def __str__(self):
-    return type(self).__name__
-
-
-class ParallelizerTestObjectHelper(object):
-
-  def __init__(self, thing):
-    self._thing = thing
-
-  def doReturnStringThing(self):
-    return str(self._thing)
-
-
-class ParallelizerTest(unittest.TestCase):
-
-  def testInitWithNone(self):
-    with self.assertRaises(AssertionError):
-      parallelizer.Parallelizer(None)
-
-  def testInitEmptyList(self):
-    with self.assertRaises(AssertionError):
-      parallelizer.Parallelizer([])
-
-  def testMethodCall(self):
-    test_data = ['abc_foo', 'def_foo', 'ghi_foo']
-    expected = ['abc_bar', 'def_bar', 'ghi_bar']
-    r = parallelizer.Parallelizer(test_data).replace('_foo', '_bar').pGet(0.1)
-    self.assertEquals(expected, r)
-
-  def testMutate(self):
-    devices = [ParallelizerTestObject(True) for _ in xrange(0, 10)]
-    self.assertTrue(all(d.doReturnTheThing() for d in devices))
-    ParallelizerTestObject.parallel(devices).doSetTheThing(False).pFinish(1)
-    self.assertTrue(not any(d.doReturnTheThing() for d in devices))
-
-  def testAllReturn(self):
-    devices = [ParallelizerTestObject(True) for _ in xrange(0, 10)]
-    results = ParallelizerTestObject.parallel(
-        devices).doReturnTheThing().pGet(1)
-    self.assertTrue(isinstance(results, list))
-    self.assertEquals(10, len(results))
-    self.assertTrue(all(results))
-
-  def testAllRaise(self):
-    devices = [ParallelizerTestObject(Exception('thing %d' % i))
-               for i in xrange(0, 10)]
-    p = ParallelizerTestObject.parallel(devices).doRaiseTheThing()
-    with self.assertRaises(Exception):
-      p.pGet(1)
-
-  def testOneFailOthersComplete(self):
-    parallel_device_count = 10
-    exception_index = 7
-    exception_msg = 'thing %d' % exception_index
-
-    try:
-      completion_files = [tempfile.NamedTemporaryFile(delete=False)
-                          for _ in xrange(0, parallel_device_count)]
-      devices = [
-          ParallelizerTestObject(
-              i if i != exception_index else Exception(exception_msg),
-              completion_files[i].name)
-          for i in xrange(0, parallel_device_count)]
-      for f in completion_files:
-        f.close()
-      p = ParallelizerTestObject.parallel(devices)
-      with self.assertRaises(Exception) as e:
-        p.doRaiseIfExceptionElseSleepFor(2).pGet(3)
-      self.assertTrue(exception_msg in str(e.exception))
-      for i in xrange(0, parallel_device_count):
-        with open(completion_files[i].name) as f:
-          if i == exception_index:
-            self.assertEquals('', f.read())
-          else:
-            self.assertEquals('complete', f.read())
-    finally:
-      for f in completion_files:
-        os.remove(f.name)
-
-  def testReusable(self):
-    devices = [ParallelizerTestObject(True) for _ in xrange(0, 10)]
-    p = ParallelizerTestObject.parallel(devices)
-    results = p.doReturn(True).pGet(1)
-    self.assertTrue(all(results))
-    results = p.doReturn(True).pGet(1)
-    self.assertTrue(all(results))
-    with self.assertRaises(Exception):
-      results = p.doRaise(Exception('reusableTest')).pGet(1)
-
-  def testContained(self):
-    devices = [ParallelizerTestObject(i) for i in xrange(0, 10)]
-    results = (ParallelizerTestObject.parallel(devices).helper
-        .doReturnStringThing().pGet(1))
-    self.assertTrue(isinstance(results, list))
-    self.assertEquals(10, len(results))
-    for i in xrange(0, 10):
-      self.assertEquals(str(i), results[i])
-
-  def testGetItem(self):
-    devices = [ParallelizerTestObject(range(i, i+10)) for i in xrange(0, 10)]
-    results = ParallelizerTestObject.parallel(devices)[9].pGet(1)
-    self.assertEquals(range(9, 19), results)
-
-
-if __name__ == '__main__':
-  unittest.main(verbosity=2)
-
diff --git a/build/android/pylib/utils/proguard.py b/build/android/pylib/utils/proguard.py
deleted file mode 100644
index 34ad5c3..0000000
--- a/build/android/pylib/utils/proguard.py
+++ /dev/null
@@ -1,148 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import os
-import re
-import tempfile
-
-from pylib import constants
-from pylib import cmd_helper
-
-
-_PROGUARD_CLASS_RE = re.compile(r'\s*?- Program class:\s*([\S]+)$')
-_PROGUARD_SUPERCLASS_RE = re.compile(r'\s*?  Superclass:\s*([\S]+)$')
-_PROGUARD_SECTION_RE = re.compile(
-    r'^(?:Interfaces|Constant Pool|Fields|Methods|Class file attributes) '
-    r'\(count = \d+\):$')
-_PROGUARD_METHOD_RE = re.compile(r'\s*?- Method:\s*(\S*)[(].*$')
-_PROGUARD_ANNOTATION_RE = re.compile(r'\s*?- Annotation \[L(\S*);\]:$')
-_PROGUARD_ANNOTATION_CONST_RE = (
-    re.compile(r'\s*?- Constant element value.*$'))
-_PROGUARD_ANNOTATION_VALUE_RE = re.compile(r'\s*?- \S+? \[(.*)\]$')
-
-_PROGUARD_PATH_SDK = os.path.join(
-    constants.ANDROID_SDK_ROOT, 'tools', 'proguard', 'lib', 'proguard.jar')
-_PROGUARD_PATH_BUILT = (
-    os.path.join(os.environ['ANDROID_BUILD_TOP'], 'external', 'proguard',
-                 'lib', 'proguard.jar')
-    if 'ANDROID_BUILD_TOP' in os.environ else None)
-_PROGUARD_PATH = (
-    _PROGUARD_PATH_SDK if os.path.exists(_PROGUARD_PATH_SDK)
-    else _PROGUARD_PATH_BUILT)
-
-
-def Dump(jar_path):
-  """Dumps class and method information from a JAR into a dict via proguard.
-
-  Args:
-    jar_path: An absolute path to the JAR file to dump.
-  Returns:
-    A dict in the following format:
-      {
-        'classes': [
-          {
-            'class': '',
-            'superclass': '',
-            'annotations': {},
-            'methods': [
-              {
-                'method': '',
-                'annotations': {},
-              },
-              ...
-            ],
-          },
-          ...
-        ],
-      }
-  """
-
-  with tempfile.NamedTemporaryFile() as proguard_output:
-    cmd_helper.RunCmd(['java', '-jar',
-                       _PROGUARD_PATH,
-                       '-injars', jar_path,
-                       '-dontshrink',
-                       '-dontoptimize',
-                       '-dontobfuscate',
-                       '-dontpreverify',
-                       '-dump', proguard_output.name])
-
-
-    results = {
-      'classes': [],
-    }
-
-    annotation = None
-    annotation_has_value = False
-    class_result = None
-    method_result = None
-
-    for line in proguard_output:
-      line = line.strip('\r\n')
-
-      m = _PROGUARD_CLASS_RE.match(line)
-      if m:
-        class_result = {
-          'class': m.group(1).replace('/', '.'),
-          'superclass': '',
-          'annotations': {},
-          'methods': [],
-        }
-        results['classes'].append(class_result)
-        annotation = None
-        annotation_has_value = False
-        method_result = None
-        continue
-
-      if not class_result:
-        continue
-
-      m = _PROGUARD_SUPERCLASS_RE.match(line)
-      if m:
-        class_result['superclass'] = m.group(1).replace('/', '.')
-        continue
-
-      m = _PROGUARD_SECTION_RE.match(line)
-      if m:
-        annotation = None
-        annotation_has_value = False
-        method_result = None
-        continue
-
-      m = _PROGUARD_METHOD_RE.match(line)
-      if m:
-        method_result = {
-          'method': m.group(1),
-          'annotations': {},
-        }
-        class_result['methods'].append(method_result)
-        annotation = None
-        annotation_has_value = False
-        continue
-
-      m = _PROGUARD_ANNOTATION_RE.match(line)
-      if m:
-        # Ignore the annotation package.
-        annotation = m.group(1).split('/')[-1]
-        if method_result:
-          method_result['annotations'][annotation] = None
-        else:
-          class_result['annotations'][annotation] = None
-        continue
-
-      if annotation:
-        if not annotation_has_value:
-          m = _PROGUARD_ANNOTATION_CONST_RE.match(line)
-          annotation_has_value = bool(m)
-        else:
-          m = _PROGUARD_ANNOTATION_VALUE_RE.match(line)
-          if m:
-            if method_result:
-              method_result['annotations'][annotation] = m.group(1)
-            else:
-              class_result['annotations'][annotation] = m.group(1)
-          annotation_has_value = None
-
-  return results
-
diff --git a/build/android/pylib/utils/repo_utils.py b/build/android/pylib/utils/repo_utils.py
deleted file mode 100644
index e0c7d2c..0000000
--- a/build/android/pylib/utils/repo_utils.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from pylib import cmd_helper
-
-
-def GetGitHeadSHA1(in_directory):
-  """Returns the git hash tag for the given directory.
-
-  Args:
-    in_directory: The directory where git is to be run.
-  """
-  command_line = ['git', 'log', '-1', '--pretty=format:%H']
-  output = cmd_helper.GetCmdOutput(command_line, cwd=in_directory)
-  return output[0:40]
diff --git a/build/android/pylib/utils/reraiser_thread.py b/build/android/pylib/utils/reraiser_thread.py
deleted file mode 100644
index 0ec16b1..0000000
--- a/build/android/pylib/utils/reraiser_thread.py
+++ /dev/null
@@ -1,158 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Thread and ThreadGroup that reraise exceptions on the main thread."""
-# pylint: disable=W0212
-
-import logging
-import sys
-import threading
-import traceback
-
-from pylib.utils import watchdog_timer
-
-
-class TimeoutError(Exception):
-  """Module-specific timeout exception."""
-  pass
-
-
-def LogThreadStack(thread):
-  """Log the stack for the given thread.
-
-  Args:
-    thread: a threading.Thread instance.
-  """
-  stack = sys._current_frames()[thread.ident]
-  logging.critical('*' * 80)
-  logging.critical('Stack dump for thread %r', thread.name)
-  logging.critical('*' * 80)
-  for filename, lineno, name, line in traceback.extract_stack(stack):
-    logging.critical('File: "%s", line %d, in %s', filename, lineno, name)
-    if line:
-      logging.critical('  %s', line.strip())
-  logging.critical('*' * 80)
-
-
-class ReraiserThread(threading.Thread):
-  """Thread class that can reraise exceptions."""
-
-  def __init__(self, func, args=None, kwargs=None, name=None):
-    """Initialize thread.
-
-    Args:
-      func: callable to call on a new thread.
-      args: list of positional arguments for callable, defaults to empty.
-      kwargs: dictionary of keyword arguments for callable, defaults to empty.
-      name: thread name, defaults to Thread-N.
-    """
-    super(ReraiserThread, self).__init__(name=name)
-    if not args:
-      args = []
-    if not kwargs:
-      kwargs = {}
-    self.daemon = True
-    self._func = func
-    self._args = args
-    self._kwargs = kwargs
-    self._ret = None
-    self._exc_info = None
-
-  def ReraiseIfException(self):
-    """Reraise exception if an exception was raised in the thread."""
-    if self._exc_info:
-      raise self._exc_info[0], self._exc_info[1], self._exc_info[2]
-
-  def GetReturnValue(self):
-    """Reraise exception if present, otherwise get the return value."""
-    self.ReraiseIfException()
-    return self._ret
-
-  #override
-  def run(self):
-    """Overrides Thread.run() to add support for reraising exceptions."""
-    try:
-      self._ret = self._func(*self._args, **self._kwargs)
-    except: # pylint: disable=W0702
-      self._exc_info = sys.exc_info()
-
-
-class ReraiserThreadGroup(object):
-  """A group of ReraiserThread objects."""
-
-  def __init__(self, threads=None):
-    """Initialize thread group.
-
-    Args:
-      threads: a list of ReraiserThread objects; defaults to empty.
-    """
-    if not threads:
-      threads = []
-    self._threads = threads
-
-  def Add(self, thread):
-    """Add a thread to the group.
-
-    Args:
-      thread: a ReraiserThread object.
-    """
-    self._threads.append(thread)
-
-  def StartAll(self):
-    """Start all threads."""
-    for thread in self._threads:
-      thread.start()
-
-  def _JoinAll(self, watcher=None):
-    """Join all threads without stack dumps.
-
-    Reraises exceptions raised by the child threads and supports breaking
-    immediately on exceptions raised on the main thread.
-
-    Args:
-      watcher: Watchdog object providing timeout, by default waits forever.
-    """
-    if watcher is None:
-      watcher = watchdog_timer.WatchdogTimer(None)
-    alive_threads = self._threads[:]
-    while alive_threads:
-      for thread in alive_threads[:]:
-        if watcher.IsTimedOut():
-          raise TimeoutError('Timed out waiting for %d of %d threads.' %
-                             (len(alive_threads), len(self._threads)))
-        # Allow the main thread to periodically check for interrupts.
-        thread.join(0.1)
-        if not thread.isAlive():
-          alive_threads.remove(thread)
-    # All threads are allowed to complete before reraising exceptions.
-    for thread in self._threads:
-      thread.ReraiseIfException()
-
-  def JoinAll(self, watcher=None):
-    """Join all threads.
-
-    Reraises exceptions raised by the child threads and supports breaking
-    immediately on exceptions raised on the main thread. Unfinished threads'
-    stacks will be logged on watchdog timeout.
-
-    Args:
-      watcher: Watchdog object providing timeout, by default waits forever.
-    """
-    try:
-      self._JoinAll(watcher)
-    except TimeoutError:
-      for thread in (t for t in self._threads if t.isAlive()):
-        LogThreadStack(thread)
-      raise
-
-  def GetAllReturnValues(self, watcher=None):
-    """Get all return values, joining all threads if necessary.
-
-    Args:
-      watcher: same as in |JoinAll|. Only used if threads are alive.
-    """
-    if any([t.isAlive() for t in self._threads]):
-      self.JoinAll(watcher)
-    return [t.GetReturnValue() for t in self._threads]
-
diff --git a/build/android/pylib/utils/reraiser_thread_unittest.py b/build/android/pylib/utils/reraiser_thread_unittest.py
deleted file mode 100644
index 2392d0e..0000000
--- a/build/android/pylib/utils/reraiser_thread_unittest.py
+++ /dev/null
@@ -1,96 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Unittests for reraiser_thread.py."""
-
-import threading
-import unittest
-
-from pylib.utils import reraiser_thread
-from pylib.utils import watchdog_timer
-
-
-class TestException(Exception):
-  pass
-
-
-class TestReraiserThread(unittest.TestCase):
-  """Tests for reraiser_thread.ReraiserThread."""
-  def testNominal(self):
-    result = [None, None]
-
-    def f(a, b=None):
-      result[0] = a
-      result[1] = b
-
-    thread = reraiser_thread.ReraiserThread(f, [1], {'b': 2})
-    thread.start()
-    thread.join()
-    self.assertEqual(result[0], 1)
-    self.assertEqual(result[1], 2)
-
-  def testRaise(self):
-    def f():
-      raise TestException
-
-    thread = reraiser_thread.ReraiserThread(f)
-    thread.start()
-    thread.join()
-    with self.assertRaises(TestException):
-      thread.ReraiseIfException()
-
-
-class TestReraiserThreadGroup(unittest.TestCase):
-  """Tests for reraiser_thread.ReraiserThreadGroup."""
-  def testInit(self):
-    ran = [False] * 5
-    def f(i):
-      ran[i] = True
-
-    group = reraiser_thread.ReraiserThreadGroup(
-      [reraiser_thread.ReraiserThread(f, args=[i]) for i in range(5)])
-    group.StartAll()
-    group.JoinAll()
-    for v in ran:
-      self.assertTrue(v)
-
-  def testAdd(self):
-    ran = [False] * 5
-    def f(i):
-      ran[i] = True
-
-    group = reraiser_thread.ReraiserThreadGroup()
-    for i in xrange(5):
-      group.Add(reraiser_thread.ReraiserThread(f, args=[i]))
-    group.StartAll()
-    group.JoinAll()
-    for v in ran:
-      self.assertTrue(v)
-
-  def testJoinRaise(self):
-    def f():
-      raise TestException
-    group = reraiser_thread.ReraiserThreadGroup(
-      [reraiser_thread.ReraiserThread(f) for _ in xrange(5)])
-    group.StartAll()
-    with self.assertRaises(TestException):
-      group.JoinAll()
-
-  def testJoinTimeout(self):
-    def f():
-      pass
-    event = threading.Event()
-    def g():
-      event.wait()
-    group = reraiser_thread.ReraiserThreadGroup(
-        [reraiser_thread.ReraiserThread(g),
-         reraiser_thread.ReraiserThread(f)])
-    group.StartAll()
-    with self.assertRaises(reraiser_thread.TimeoutError):
-      group.JoinAll(watchdog_timer.WatchdogTimer(0.01))
-    event.set()
-
-
-if __name__ == '__main__':
-  unittest.main()
diff --git a/build/android/pylib/utils/run_tests_helper.py b/build/android/pylib/utils/run_tests_helper.py
deleted file mode 100644
index 43f654d..0000000
--- a/build/android/pylib/utils/run_tests_helper.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Helper functions common to native, java and host-driven test runners."""
-
-import logging
-import sys
-import time
-
-
-class CustomFormatter(logging.Formatter):
-  """Custom log formatter."""
-
-  #override
-  def __init__(self, fmt='%(threadName)-4s  %(message)s'):
-    # Can't use super() because in older Python versions logging.Formatter does
-    # not inherit from object.
-    logging.Formatter.__init__(self, fmt=fmt)
-    self._creation_time = time.time()
-
-  #override
-  def format(self, record):
-    # Can't use super() because in older Python versions logging.Formatter does
-    # not inherit from object.
-    msg = logging.Formatter.format(self, record)
-    if 'MainThread' in msg[:19]:
-      msg = msg.replace('MainThread', 'Main', 1)
-    timediff = time.time() - self._creation_time
-    return '%s %8.3fs %s' % (record.levelname[0], timediff, msg)
-
-
-def SetLogLevel(verbose_count):
-  """Sets log level as |verbose_count|."""
-  log_level = logging.WARNING  # Default.
-  if verbose_count == 1:
-    log_level = logging.INFO
-  elif verbose_count >= 2:
-    log_level = logging.DEBUG
-  logger = logging.getLogger()
-  logger.setLevel(log_level)
-  custom_handler = logging.StreamHandler(sys.stdout)
-  custom_handler.setFormatter(CustomFormatter())
-  logging.getLogger().addHandler(custom_handler)
diff --git a/build/android/pylib/utils/test_environment.py b/build/android/pylib/utils/test_environment.py
deleted file mode 100644
index e78eb5c..0000000
--- a/build/android/pylib/utils/test_environment.py
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging
-import psutil
-import signal
-
-from pylib.device import device_errors
-from pylib.device import device_utils
-
-
-def _KillWebServers():
-  for s in [signal.SIGTERM, signal.SIGINT, signal.SIGQUIT, signal.SIGKILL]:
-    signalled = []
-    for server in ['lighttpd', 'webpagereplay']:
-      for p in psutil.process_iter():
-        try:
-          if not server in ' '.join(p.cmdline):
-            continue
-          logging.info('Killing %s %s %s', s, server, p.pid)
-          p.send_signal(s)
-          signalled.append(p)
-        except Exception as e:
-          logging.warning('Failed killing %s %s %s', server, p.pid, e)
-    for p in signalled:
-      try:
-        p.wait(1)
-      except Exception as e:
-        logging.warning('Failed waiting for %s to die. %s', p.pid, e)
-
-
-def CleanupLeftoverProcesses():
-  """Clean up the test environment, restarting fresh adb and HTTP daemons."""
-  _KillWebServers()
-  device_utils.RestartServer()
-
-  def cleanup_device(d):
-    d.old_interface.RestartAdbdOnDevice()
-    try:
-      d.EnableRoot()
-    except device_errors.CommandFailedError as e:
-      logging.error(str(e))
-    d.WaitUntilFullyBooted()
-
-  device_utils.DeviceUtils.parallel().pMap(cleanup_device)
-
diff --git a/build/android/pylib/utils/time_profile.py b/build/android/pylib/utils/time_profile.py
deleted file mode 100644
index 45da7ff..0000000
--- a/build/android/pylib/utils/time_profile.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging
-import time
-
-
-class TimeProfile(object):
-  """Class for simple profiling of action, with logging of cost."""
-
-  def __init__(self, description):
-    self._starttime = None
-    self._description = description
-    self.Start()
-
-  def Start(self):
-    self._starttime = time.time()
-
-  def Stop(self):
-    """Stop profiling and dump a log."""
-    if self._starttime:
-      stoptime = time.time()
-      logging.info('%fsec to perform %s',
-                   stoptime - self._starttime, self._description)
-      self._starttime = None
diff --git a/build/android/pylib/utils/timeout_retry.py b/build/android/pylib/utils/timeout_retry.py
deleted file mode 100644
index 61f7c70..0000000
--- a/build/android/pylib/utils/timeout_retry.py
+++ /dev/null
@@ -1,167 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""A utility to run functions with timeouts and retries."""
-# pylint: disable=W0702
-
-import logging
-import threading
-import time
-import traceback
-
-from pylib.utils import reraiser_thread
-from pylib.utils import watchdog_timer
-
-
-class TimeoutRetryThread(reraiser_thread.ReraiserThread):
-  def __init__(self, func, timeout, name):
-    super(TimeoutRetryThread, self).__init__(func, name=name)
-    self._watcher = watchdog_timer.WatchdogTimer(timeout)
-    self._expired = False
-
-  def GetWatcher(self):
-    """Returns the watchdog keeping track of this thread's time."""
-    return self._watcher
-
-  def GetElapsedTime(self):
-    return self._watcher.GetElapsed()
-
-  def GetRemainingTime(self, required=0, msg=None):
-    """Get the remaining time before the thread times out.
-
-    Useful to send as the |timeout| parameter of async IO operations.
-
-    Args:
-      required: minimum amount of time that will be required to complete, e.g.,
-        some sleep or IO operation.
-      msg: error message to show if timing out.
-
-    Returns:
-      The number of seconds remaining before the thread times out, or None
-      if the thread never times out.
-
-    Raises:
-      reraiser_thread.TimeoutError if the remaining time is less than the
-        required time.
-    """
-    remaining = self._watcher.GetRemaining()
-    if remaining is not None and remaining < required:
-      if msg is None:
-        msg = 'Timeout expired'
-      if remaining > 0:
-        msg += (', wait of %.1f secs required but only %.1f secs left'
-                % (required, remaining))
-      self._expired = True
-      raise reraiser_thread.TimeoutError(msg)
-    return remaining
-
-  def LogTimeoutException(self):
-    """Log the exception that terminated this thread."""
-    if not self._expired:
-      return
-    logging.critical('*' * 80)
-    logging.critical('%s on thread %r', self._exc_info[0].__name__, self.name)
-    logging.critical('*' * 80)
-    fmt_exc = ''.join(traceback.format_exception(*self._exc_info))
-    for line in fmt_exc.splitlines():
-      logging.critical(line.rstrip())
-    logging.critical('*' * 80)
-
-
-def CurrentTimeoutThread():
-  """Get the current thread if it is a TimeoutRetryThread.
-
-  Returns:
-    The current thread if it is a TimeoutRetryThread, otherwise None.
-  """
-  current_thread = threading.current_thread()
-  if isinstance(current_thread, TimeoutRetryThread):
-    return current_thread
-  else:
-    return None
-
-
-def WaitFor(condition, wait_period=5, max_tries=None):
-  """Wait for a condition to become true.
-
-  Repeadly call the function condition(), with no arguments, until it returns
-  a true value.
-
-  If called within a TimeoutRetryThread, it cooperates nicely with it.
-
-  Args:
-    condition: function with the condition to check
-    wait_period: number of seconds to wait before retrying to check the
-      condition
-    max_tries: maximum number of checks to make, the default tries forever
-      or until the TimeoutRetryThread expires.
-
-  Returns:
-    The true value returned by the condition, or None if the condition was
-    not met after max_tries.
-
-  Raises:
-    reraiser_thread.TimeoutError if the current thread is a TimeoutRetryThread
-      and the timeout expires.
-  """
-  condition_name = condition.__name__
-  timeout_thread = CurrentTimeoutThread()
-  while max_tries is None or max_tries > 0:
-    result = condition()
-    if max_tries is not None:
-      max_tries -= 1
-    msg = ['condition', repr(condition_name), 'met' if result else 'not met']
-    if timeout_thread:
-      msg.append('(%.1fs)' % timeout_thread.GetElapsedTime())
-    logging.info(' '.join(msg))
-    if result:
-      return result
-    if timeout_thread:
-      timeout_thread.GetRemainingTime(wait_period,
-          msg='Timed out waiting for %r' % condition_name)
-    time.sleep(wait_period)
-  return None
-
-
-def Run(func, timeout, retries, args=None, kwargs=None):
-  """Runs the passed function in a separate thread with timeouts and retries.
-
-  Args:
-    func: the function to be wrapped.
-    timeout: the timeout in seconds for each try.
-    retries: the number of retries.
-    args: list of positional args to pass to |func|.
-    kwargs: dictionary of keyword args to pass to |func|.
-
-  Returns:
-    The return value of func(*args, **kwargs).
-  """
-  if not args:
-    args = []
-  if not kwargs:
-    kwargs = {}
-
-  # The return value uses a list because Python variables are references, not
-  # values. Closures make a copy of the reference, so updating the closure's
-  # reference wouldn't update where the original reference pointed.
-  ret = [None]
-  def RunOnTimeoutThread():
-    ret[0] = func(*args, **kwargs)
-
-  num_try = 1
-  while True:
-    child_thread = TimeoutRetryThread(
-      RunOnTimeoutThread, timeout,
-      name='TimeoutThread-%d-for-%s' % (num_try,
-                                        threading.current_thread().name))
-    try:
-      thread_group = reraiser_thread.ReraiserThreadGroup([child_thread])
-      thread_group.StartAll()
-      thread_group.JoinAll(child_thread.GetWatcher())
-      return ret[0]
-    except:
-      child_thread.LogTimeoutException()
-      if num_try > retries:
-        raise
-      num_try += 1
diff --git a/build/android/pylib/utils/timeout_retry_unittest.py b/build/android/pylib/utils/timeout_retry_unittest.py
deleted file mode 100644
index dc36c42..0000000
--- a/build/android/pylib/utils/timeout_retry_unittest.py
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Unittests for timeout_and_retry.py."""
-
-import unittest
-
-from pylib.utils import reraiser_thread
-from pylib.utils import timeout_retry
-
-
-class TestException(Exception):
-  pass
-
-
-def _NeverEnding(tries):
-  tries[0] += 1
-  while True:
-    pass
-
-
-def _CountTries(tries):
-  tries[0] += 1
-  raise TestException
-
-
-class TestRun(unittest.TestCase):
-  """Tests for timeout_retry.Run."""
-
-  def testRun(self):
-    self.assertTrue(timeout_retry.Run(
-        lambda x: x, 30, 3, [True], {}))
-
-  def testTimeout(self):
-    tries = [0]
-    self.assertRaises(reraiser_thread.TimeoutError,
-        timeout_retry.Run, lambda: _NeverEnding(tries), 0, 3)
-    self.assertEqual(tries[0], 4)
-
-  def testRetries(self):
-    tries = [0]
-    self.assertRaises(TestException,
-        timeout_retry.Run, lambda: _CountTries(tries), 30, 3)
-    self.assertEqual(tries[0], 4)
-
-  def testReturnValue(self):
-    self.assertTrue(timeout_retry.Run(lambda: True, 30, 3))
-
-
-if __name__ == '__main__':
-  unittest.main()
diff --git a/build/android/pylib/utils/watchdog_timer.py b/build/android/pylib/utils/watchdog_timer.py
deleted file mode 100644
index 2f4c464..0000000
--- a/build/android/pylib/utils/watchdog_timer.py
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""WatchdogTimer timeout objects."""
-
-import time
-
-
-class WatchdogTimer(object):
-  """A resetable timeout-based watchdog.
-
-  This object is threadsafe.
-  """
-
-  def __init__(self, timeout):
-    """Initializes the watchdog.
-
-    Args:
-      timeout: The timeout in seconds. If timeout is None it will never timeout.
-    """
-    self._start_time = time.time()
-    self._timeout = timeout
-
-  def Reset(self):
-    """Resets the timeout countdown."""
-    self._start_time = time.time()
-
-  def GetElapsed(self):
-    """Returns the elapsed time of the watchdog."""
-    return time.time() - self._start_time
-
-  def GetRemaining(self):
-    """Returns the remaining time of the watchdog."""
-    if self._timeout:
-      return self._timeout - self.GetElapsed()
-    else:
-      return None
-
-  def IsTimedOut(self):
-    """Whether the watchdog has timed out.
-
-    Returns:
-      True if the watchdog has timed out, False otherwise.
-    """
-    remaining = self.GetRemaining()
-    return remaining is not None and remaining < 0
diff --git a/build/android/pylib/utils/xvfb.py b/build/android/pylib/utils/xvfb.py
deleted file mode 100644
index cb9d50e..0000000
--- a/build/android/pylib/utils/xvfb.py
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# pylint: disable=W0702
-
-import os
-import signal
-import subprocess
-import sys
-import time
-
-
-def _IsLinux():
-  """Return True if on Linux; else False."""
-  return sys.platform.startswith('linux')
-
-
-class Xvfb(object):
-  """Class to start and stop Xvfb if relevant.  Nop if not Linux."""
-
-  def __init__(self):
-    self._pid = 0
-
-  def Start(self):
-    """Start Xvfb and set an appropriate DISPLAY environment.  Linux only.
-
-    Copied from tools/code_coverage/coverage_posix.py
-    """
-    if not _IsLinux():
-      return
-    proc = subprocess.Popen(['Xvfb', ':9', '-screen', '0', '1024x768x24',
-                             '-ac'],
-                            stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-    self._pid = proc.pid
-    if not self._pid:
-      raise Exception('Could not start Xvfb')
-    os.environ['DISPLAY'] = ':9'
-
-    # Now confirm, giving a chance for it to start if needed.
-    for _ in range(10):
-      proc = subprocess.Popen('xdpyinfo >/dev/null', shell=True)
-      _, retcode = os.waitpid(proc.pid, 0)
-      if retcode == 0:
-        break
-      time.sleep(0.25)
-    if retcode != 0:
-      raise Exception('Could not confirm Xvfb happiness')
-
-  def Stop(self):
-    """Stop Xvfb if needed.  Linux only."""
-    if self._pid:
-      try:
-        os.kill(self._pid, signal.SIGKILL)
-      except:
-        pass
-      del os.environ['DISPLAY']
-      self._pid = 0
diff --git a/build/android/pylib/utils/zip_utils.py b/build/android/pylib/utils/zip_utils.py
deleted file mode 100644
index d799463..0000000
--- a/build/android/pylib/utils/zip_utils.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging
-import os
-import zipfile
-
-
-def WriteToZipFile(zip_file, path, arc_path):
-  """Recursively write |path| to |zip_file| as |arc_path|.
-
-  zip_file: An open instance of zipfile.ZipFile.
-  path: An absolute path to the file or directory to be zipped.
-  arc_path: A relative path within the zip file to which the file or directory
-    located at |path| should be written.
-  """
-  if os.path.isdir(path):
-    for dir_path, _, file_names in os.walk(path):
-      dir_arc_path = os.path.join(arc_path, os.path.relpath(dir_path, path))
-      logging.debug('dir:  %s -> %s', dir_path, dir_arc_path)
-      zip_file.write(dir_path, dir_arc_path, zipfile.ZIP_STORED)
-      for f in file_names:
-        file_path = os.path.join(dir_path, f)
-        file_arc_path = os.path.join(dir_arc_path, f)
-        logging.debug('file: %s -> %s', file_path, file_arc_path)
-        zip_file.write(file_path, file_arc_path, zipfile.ZIP_DEFLATED)
-  else:
-    logging.debug('file: %s -> %s', path, arc_path)
-    zip_file.write(path, arc_path, zipfile.ZIP_DEFLATED)
-
diff --git a/build/android/pylib/valgrind_tools.py b/build/android/pylib/valgrind_tools.py
deleted file mode 100644
index 99719d0..0000000
--- a/build/android/pylib/valgrind_tools.py
+++ /dev/null
@@ -1,304 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-Classes in this file define additional actions that need to be taken to run a
-test under some kind of runtime error detection tool.
-
-The interface is intended to be used as follows.
-
-1. For tests that simply run a native process (i.e. no activity is spawned):
-
-Call tool.CopyFiles(device).
-Prepend test command line with tool.GetTestWrapper().
-
-2. For tests that spawn an activity:
-
-Call tool.CopyFiles(device).
-Call tool.SetupEnvironment().
-Run the test as usual.
-Call tool.CleanUpEnvironment().
-"""
-# pylint: disable=R0201
-
-import glob
-import logging
-import os.path
-import subprocess
-import sys
-
-from pylib.constants import DIR_SOURCE_ROOT
-from pylib.device import device_errors
-
-
-def SetChromeTimeoutScale(device, scale):
-  """Sets the timeout scale in /data/local/tmp/chrome_timeout_scale to scale."""
-  path = '/data/local/tmp/chrome_timeout_scale'
-  if not scale or scale == 1.0:
-    # Delete if scale is None/0.0/1.0 since the default timeout scale is 1.0
-    device.RunShellCommand('rm %s' % path)
-  else:
-    device.WriteFile(path, '%f' % scale, as_root=True)
-
-
-class BaseTool(object):
-  """A tool that does nothing."""
-
-  def __init__(self):
-    """Does nothing."""
-    pass
-
-  def GetTestWrapper(self):
-    """Returns a string that is to be prepended to the test command line."""
-    return ''
-
-  def GetUtilWrapper(self):
-    """Returns the wrapper name for the utilities.
-
-    Returns:
-       A string that is to be prepended to the command line of utility
-    processes (forwarder, etc.).
-    """
-    return ''
-
-  @classmethod
-  def CopyFiles(cls, device):
-    """Copies tool-specific files to the device, create directories, etc."""
-    pass
-
-  def SetupEnvironment(self):
-    """Sets up the system environment for a test.
-
-    This is a good place to set system properties.
-    """
-    pass
-
-  def CleanUpEnvironment(self):
-    """Cleans up environment."""
-    pass
-
-  def GetTimeoutScale(self):
-    """Returns a multiplier that should be applied to timeout values."""
-    return 1.0
-
-  def NeedsDebugInfo(self):
-    """Whether this tool requires debug info.
-
-    Returns:
-      True if this tool can not work with stripped binaries.
-    """
-    return False
-
-
-class AddressSanitizerTool(BaseTool):
-  """AddressSanitizer tool."""
-
-  WRAPPER_NAME = '/system/bin/asanwrapper'
-  # Disable memcmp overlap check.There are blobs (gl drivers)
-  # on some android devices that use memcmp on overlapping regions,
-  # nothing we can do about that.
-  EXTRA_OPTIONS = 'strict_memcmp=0,use_sigaltstack=1'
-
-  def __init__(self, device):
-    super(AddressSanitizerTool, self).__init__()
-    self._device = device
-    # Configure AndroidCommands to run utils (such as md5sum_bin) under ASan.
-    # This is required because ASan is a compiler-based tool, and md5sum
-    # includes instrumented code from base.
-    device.old_interface.SetUtilWrapper(self.GetUtilWrapper())
-
-  @classmethod
-  def CopyFiles(cls, device):
-    """Copies ASan tools to the device."""
-    libs = glob.glob(os.path.join(DIR_SOURCE_ROOT,
-                                  'third_party/llvm-build/Release+Asserts/',
-                                  'lib/clang/*/lib/linux/',
-                                  'libclang_rt.asan-arm-android.so'))
-    assert len(libs) == 1
-    subprocess.call(
-        [os.path.join(
-             DIR_SOURCE_ROOT,
-             'tools/android/asan/third_party/asan_device_setup.sh'),
-         '--device', str(device),
-         '--lib', libs[0],
-         '--extra-options', AddressSanitizerTool.EXTRA_OPTIONS])
-    device.WaitUntilFullyBooted()
-
-  def GetTestWrapper(self):
-    return AddressSanitizerTool.WRAPPER_NAME
-
-  def GetUtilWrapper(self):
-    """Returns the wrapper for utilities, such as forwarder.
-
-    AddressSanitizer wrapper must be added to all instrumented binaries,
-    including forwarder and the like. This can be removed if such binaries
-    were built without instrumentation. """
-    return self.GetTestWrapper()
-
-  def SetupEnvironment(self):
-    try:
-      self._device.EnableRoot()
-    except device_errors.CommandFailedError as e:
-      # Try to set the timeout scale anyway.
-      # TODO(jbudorick) Handle this exception appropriately after interface
-      #                 conversions are finished.
-      logging.error(str(e))
-    SetChromeTimeoutScale(self._device, self.GetTimeoutScale())
-
-  def CleanUpEnvironment(self):
-    SetChromeTimeoutScale(self._device, None)
-
-  def GetTimeoutScale(self):
-    # Very slow startup.
-    return 20.0
-
-
-class ValgrindTool(BaseTool):
-  """Base abstract class for Valgrind tools."""
-
-  VG_DIR = '/data/local/tmp/valgrind'
-  VGLOGS_DIR = '/data/local/tmp/vglogs'
-
-  def __init__(self, device):
-    super(ValgrindTool, self).__init__()
-    self._device = device
-    # exactly 31 chars, SystemProperties::PROP_NAME_MAX
-    self._wrap_properties = ['wrap.com.google.android.apps.ch',
-                             'wrap.org.chromium.native_test']
-
-  @classmethod
-  def CopyFiles(cls, device):
-    """Copies Valgrind tools to the device."""
-    device.RunShellCommand(
-        'rm -r %s; mkdir %s' % (ValgrindTool.VG_DIR, ValgrindTool.VG_DIR))
-    device.RunShellCommand(
-        'rm -r %s; mkdir %s' % (ValgrindTool.VGLOGS_DIR,
-                                ValgrindTool.VGLOGS_DIR))
-    files = cls.GetFilesForTool()
-    device.PushChangedFiles(
-        [((os.path.join(DIR_SOURCE_ROOT, f),
-          os.path.join(ValgrindTool.VG_DIR, os.path.basename(f)))
-         for f in files)])
-
-  def SetupEnvironment(self):
-    """Sets up device environment."""
-    self._device.RunShellCommand('chmod 777 /data/local/tmp')
-    self._device.RunShellCommand('setenforce 0')
-    for prop in self._wrap_properties:
-      self._device.RunShellCommand(
-          'setprop %s "logwrapper %s"' % (prop, self.GetTestWrapper()))
-    SetChromeTimeoutScale(self._device, self.GetTimeoutScale())
-
-  def CleanUpEnvironment(self):
-    """Cleans up device environment."""
-    for prop in self._wrap_properties:
-      self._device.RunShellCommand('setprop %s ""' % (prop,))
-    SetChromeTimeoutScale(self._device, None)
-
-  @staticmethod
-  def GetFilesForTool():
-    """Returns a list of file names for the tool."""
-    raise NotImplementedError()
-
-  def NeedsDebugInfo(self):
-    """Whether this tool requires debug info.
-
-    Returns:
-      True if this tool can not work with stripped binaries.
-    """
-    return True
-
-
-class MemcheckTool(ValgrindTool):
-  """Memcheck tool."""
-
-  def __init__(self, device):
-    super(MemcheckTool, self).__init__(device)
-
-  @staticmethod
-  def GetFilesForTool():
-    """Returns a list of file names for the tool."""
-    return ['tools/valgrind/android/vg-chrome-wrapper.sh',
-            'tools/valgrind/memcheck/suppressions.txt',
-            'tools/valgrind/memcheck/suppressions_android.txt']
-
-  def GetTestWrapper(self):
-    """Returns a string that is to be prepended to the test command line."""
-    return ValgrindTool.VG_DIR + '/' + 'vg-chrome-wrapper.sh'
-
-  def GetTimeoutScale(self):
-    """Returns a multiplier that should be applied to timeout values."""
-    return 30
-
-
-class TSanTool(ValgrindTool):
-  """ThreadSanitizer tool. See http://code.google.com/p/data-race-test ."""
-
-  def __init__(self, device):
-    super(TSanTool, self).__init__(device)
-
-  @staticmethod
-  def GetFilesForTool():
-    """Returns a list of file names for the tool."""
-    return ['tools/valgrind/android/vg-chrome-wrapper-tsan.sh',
-            'tools/valgrind/tsan/suppressions.txt',
-            'tools/valgrind/tsan/suppressions_android.txt',
-            'tools/valgrind/tsan/ignores.txt']
-
-  def GetTestWrapper(self):
-    """Returns a string that is to be prepended to the test command line."""
-    return ValgrindTool.VG_DIR + '/' + 'vg-chrome-wrapper-tsan.sh'
-
-  def GetTimeoutScale(self):
-    """Returns a multiplier that should be applied to timeout values."""
-    return 30.0
-
-
-TOOL_REGISTRY = {
-    'memcheck': MemcheckTool,
-    'memcheck-renderer': MemcheckTool,
-    'tsan': TSanTool,
-    'tsan-renderer': TSanTool,
-    'asan': AddressSanitizerTool,
-}
-
-
-def CreateTool(tool_name, device):
-  """Creates a tool with the specified tool name.
-
-  Args:
-    tool_name: Name of the tool to create.
-    device: A DeviceUtils instance.
-  Returns:
-    A tool for the specified tool_name.
-  """
-  if not tool_name:
-    return BaseTool()
-
-  ctor = TOOL_REGISTRY.get(tool_name)
-  if ctor:
-    return ctor(device)
-  else:
-    print 'Unknown tool %s, available tools: %s' % (
-        tool_name, ', '.join(sorted(TOOL_REGISTRY.keys())))
-    sys.exit(1)
-
-def PushFilesForTool(tool_name, device):
-  """Pushes the files required for |tool_name| to |device|.
-
-  Args:
-    tool_name: Name of the tool to create.
-    device: A DeviceUtils instance.
-  """
-  if not tool_name:
-    return
-
-  clazz = TOOL_REGISTRY.get(tool_name)
-  if clazz:
-    clazz.CopyFiles(device)
-  else:
-    print 'Unknown tool %s, available tools: %s' % (
-        tool_name, ', '.join(sorted(TOOL_REGISTRY.keys())))
-    sys.exit(1)
-
diff --git a/build/android/rezip.gyp b/build/android/rezip.gyp
deleted file mode 100644
index 1115177..0000000
--- a/build/android/rezip.gyp
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Build the rezip build tool.
-{
-  'targets': [
-    {
-      # GN: //build/android/rezip:rezip
-      'target_name': 'rezip_apk_jar',
-      'type': 'none',
-      'variables': {
-        'java_in_dir': 'rezip',
-        'compile_stamp': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/compile.stamp',
-        'javac_jar_path': '<(PRODUCT_DIR)/lib.java/rezip_apk.jar',
-      },
-      'actions': [
-        {
-          'action_name': 'javac_<(_target_name)',
-          'message': 'Compiling <(_target_name) java sources',
-          'variables': {
-            'java_sources': ['>!@(find >(java_in_dir) -name "*.java")'],
-          },
-          'inputs': [
-            '<(DEPTH)/build/android/gyp/util/build_utils.py',
-            '<(DEPTH)/build/android/gyp/javac.py',
-            '>@(java_sources)',
-          ],
-          'outputs': [
-            '<(compile_stamp)',
-            '<(javac_jar_path)',
-          ],
-          'action': [
-            'python', '<(DEPTH)/build/android/gyp/javac.py',
-            '--classpath=',
-            '--classes-dir=<(SHARED_INTERMEDIATE_DIR)/<(_target_name)',
-            '--jar-path=<(javac_jar_path)',
-            '--stamp=<(compile_stamp)',
-            '>@(java_sources)',
-          ]
-        },
-      ],
-    }
-  ],
-}
diff --git a/build/android/rezip/BUILD.gn b/build/android/rezip/BUILD.gn
deleted file mode 100644
index 8b8f78e..0000000
--- a/build/android/rezip/BUILD.gn
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import("//build/config/android/rules.gni")
-
-# GYP: //build/android/rezip.gyp:rezip_apk_jar
-java_library("rezip") {
-  jar_path = "$root_build_dir/lib.java/rezip_apk.jar"
-  DEPRECATED_java_in_dir = "."
-}
diff --git a/build/android/rezip/RezipApk.java b/build/android/rezip/RezipApk.java
deleted file mode 100644
index 43d7544..0000000
--- a/build/android/rezip/RezipApk.java
+++ /dev/null
@@ -1,448 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-import java.util.jar.JarOutputStream;
-import java.util.regex.Pattern;
-import java.util.zip.CRC32;
-
-/**
- * Command line tool used to build APKs which support loading the native code library
- * directly from the APK file. To construct the APK we rename the native library by
- * adding the prefix "crazy." to the filename. This is done to prevent the Android
- * Package Manager from extracting the library. The native code must be page aligned
- * and uncompressed. The page alignment is implemented by adding a zero filled file
- * in front of the the native code library. This tool is designed so that running
- * SignApk and/or zipalign on the resulting APK does not break the page alignment.
- * This is achieved by outputing the filenames in the same canonical order used
- * by SignApk and adding the same alignment fields added by zipalign.
- */
-class RezipApk {
-    // Alignment to use for non-compressed files (must match zipalign).
-    private static final int ALIGNMENT = 4;
-
-    // Alignment to use for non-compressed *.so files
-    private static final int LIBRARY_ALIGNMENT = 4096;
-
-    // Files matching this pattern are not copied to the output when adding alignment.
-    // When reordering and verifying the APK they are copied to the end of the file.
-    private static Pattern sMetaFilePattern =
-            Pattern.compile("^(META-INF/((.*)[.](SF|RSA|DSA)|com/android/otacert))|("
-                    + Pattern.quote(JarFile.MANIFEST_NAME) + ")$");
-
-    // Pattern for matching a shared library in the APK
-    private static Pattern sLibraryPattern = Pattern.compile("^lib/[^/]*/lib.*[.]so$");
-    // Pattern for match the crazy linker in the APK
-    private static Pattern sCrazyLinkerPattern =
-            Pattern.compile("^lib/[^/]*/libchromium_android_linker.so$");
-    // Pattern for matching a crazy loaded shared library in the APK
-    private static Pattern sCrazyLibraryPattern = Pattern.compile("^lib/[^/]*/crazy.lib.*[.]so$");
-
-    private static boolean isLibraryFilename(String filename) {
-        return sLibraryPattern.matcher(filename).matches()
-                && !sCrazyLinkerPattern.matcher(filename).matches();
-    }
-
-    private static boolean isCrazyLibraryFilename(String filename) {
-        return sCrazyLibraryPattern.matcher(filename).matches();
-    }
-
-    private static String renameLibraryForCrazyLinker(String filename) {
-        int lastSlash = filename.lastIndexOf('/');
-        // We rename the library, so that the Android Package Manager
-        // no longer extracts the library.
-        return filename.substring(0, lastSlash + 1) + "crazy." + filename.substring(lastSlash + 1);
-    }
-
-    /**
-     * Wraps another output stream, counting the number of bytes written.
-     */
-    private static class CountingOutputStream extends OutputStream {
-        private long mCount = 0;
-        private OutputStream mOut;
-
-        public CountingOutputStream(OutputStream out) {
-            this.mOut = out;
-        }
-
-        /** Returns the number of bytes written. */
-        public long getCount() {
-            return mCount;
-        }
-
-        @Override public void write(byte[] b, int off, int len) throws IOException {
-            mOut.write(b, off, len);
-            mCount += len;
-        }
-
-        @Override public void write(int b) throws IOException {
-            mOut.write(b);
-            mCount++;
-        }
-
-        @Override public void close() throws IOException {
-            mOut.close();
-        }
-
-        @Override public void flush() throws IOException {
-            mOut.flush();
-        }
-    }
-
-    private static String outputName(JarEntry entry, boolean rename) {
-        String inName = entry.getName();
-        if (rename && entry.getSize() > 0 && isLibraryFilename(inName)) {
-            return renameLibraryForCrazyLinker(inName);
-        }
-        return inName;
-    }
-
-    /**
-     * Comparator used to sort jar entries from the input file.
-     * Sorting is done based on the output filename (which maybe renamed).
-     * Filenames are in natural string order, except that filenames matching
-     * the meta-file pattern are always after other files. This is so the manifest
-     * and signature are at the end of the file after any alignment file.
-     */
-    private static class EntryComparator implements Comparator<JarEntry> {
-        private boolean mRename;
-
-        public EntryComparator(boolean rename) {
-            mRename = rename;
-        }
-
-        @Override
-        public int compare(JarEntry j1, JarEntry j2) {
-            String o1 = outputName(j1, mRename);
-            String o2 = outputName(j2, mRename);
-            boolean o1Matches = sMetaFilePattern.matcher(o1).matches();
-            boolean o2Matches = sMetaFilePattern.matcher(o2).matches();
-            if (o1Matches != o2Matches) {
-                return o1Matches ? 1 : -1;
-            } else {
-                return o1.compareTo(o2);
-            }
-        }
-    }
-
-    // Build an ordered list of jar entries. The jar entries from the input are
-    // sorted based on the output filenames (which maybe renamed). If |omitMetaFiles|
-    // is true do not include the jar entries for the META-INF files.
-    // Entries are ordered in the deterministic order used by SignApk.
-    private static List<JarEntry> getOutputFileOrderEntries(
-            JarFile jar, boolean omitMetaFiles, boolean rename) {
-        List<JarEntry> entries = new ArrayList<JarEntry>();
-        for (Enumeration<JarEntry> e = jar.entries(); e.hasMoreElements(); ) {
-            JarEntry entry = e.nextElement();
-            if (entry.isDirectory()) {
-                continue;
-            }
-            if (omitMetaFiles && sMetaFilePattern.matcher(entry.getName()).matches()) {
-                continue;
-            }
-            entries.add(entry);
-        }
-
-        // We sort the input entries by name. When present META-INF files
-        // are sorted to the end.
-        Collections.sort(entries, new EntryComparator(rename));
-        return entries;
-    }
-
-    /**
-     * Add a zero filled alignment file at this point in the zip file,
-     * The added file will be added before |name| and after |prevName|.
-     * The size of the alignment file is such that the location of the
-     * file |name| will be on a LIBRARY_ALIGNMENT boundary.
-     *
-     * Note this arrangement is devised so that running SignApk and/or zipalign on the resulting
-     * file will not alter the alignment.
-     *
-     * @param offset number of bytes into the output file at this point.
-     * @param timestamp time in millis since the epoch to include in the header.
-     * @param name the name of the library filename.
-     * @param prevName the name of the previous file in the archive (or null).
-     * @param out jar output stream to write the alignment file to.
-     *
-     * @throws IOException if the output file can not be written.
-     */
-    private static void addAlignmentFile(
-            long offset, long timestamp, String name, String prevName,
-            JarOutputStream out) throws IOException {
-
-        // Compute the start and alignment of the library, as if it was next.
-        int headerSize = JarFile.LOCHDR + name.length();
-        long libOffset = offset + headerSize;
-        int libNeeded = LIBRARY_ALIGNMENT - (int) (libOffset % LIBRARY_ALIGNMENT);
-        if (libNeeded == LIBRARY_ALIGNMENT) {
-            // Already aligned, no need to added alignment file.
-            return;
-        }
-
-        // Check that there is not another file between the library and the
-        // alignment file.
-        String alignName = name.substring(0, name.length() - 2) + "align";
-        if (prevName != null && prevName.compareTo(alignName) >= 0) {
-            throw new UnsupportedOperationException(
-                "Unable to insert alignment file, because there is "
-                + "another file in front of the file to be aligned. "
-                + "Other file: " + prevName + " Alignment file: " + alignName
-                + " file: " + name);
-        }
-
-        // Compute the size of the alignment file header.
-        headerSize = JarFile.LOCHDR + alignName.length();
-        // We are going to add an alignment file of type STORED. This file
-        // will itself induce a zipalign alignment adjustment.
-        int extraNeeded =
-                (ALIGNMENT - (int) ((offset + headerSize) % ALIGNMENT)) % ALIGNMENT;
-        headerSize += extraNeeded;
-
-        if (libNeeded < headerSize + 1) {
-            // The header was bigger than the alignment that we need, add another page.
-            libNeeded += LIBRARY_ALIGNMENT;
-        }
-        // Compute the size of the alignment file.
-        libNeeded -= headerSize;
-
-        // Build the header for the alignment file.
-        byte[] zeroBuffer = new byte[libNeeded];
-        JarEntry alignEntry = new JarEntry(alignName);
-        alignEntry.setMethod(JarEntry.STORED);
-        alignEntry.setSize(libNeeded);
-        alignEntry.setTime(timestamp);
-        CRC32 crc = new CRC32();
-        crc.update(zeroBuffer);
-        alignEntry.setCrc(crc.getValue());
-
-        if (extraNeeded != 0) {
-            alignEntry.setExtra(new byte[extraNeeded]);
-        }
-
-        // Output the alignment file.
-        out.putNextEntry(alignEntry);
-        out.write(zeroBuffer);
-        out.closeEntry();
-        out.flush();
-    }
-
-    // Make a JarEntry for the output file which corresponds to the input
-    // file. The output file will be called |name|. The output file will always
-    // be uncompressed (STORED). If the input is not STORED it is necessary to inflate
-    // it to compute the CRC and size of the output entry.
-    private static JarEntry makeStoredEntry(String name, JarEntry inEntry, JarFile in)
-            throws IOException {
-        JarEntry outEntry = new JarEntry(name);
-        outEntry.setMethod(JarEntry.STORED);
-
-        if (inEntry.getMethod() == JarEntry.STORED) {
-            outEntry.setCrc(inEntry.getCrc());
-            outEntry.setSize(inEntry.getSize());
-        } else {
-            // We are inflating the file. We need to compute the CRC and size.
-            byte[] buffer = new byte[4096];
-            CRC32 crc = new CRC32();
-            int size = 0;
-            int num;
-            InputStream data = in.getInputStream(inEntry);
-            while ((num = data.read(buffer)) > 0) {
-                crc.update(buffer, 0, num);
-                size += num;
-            }
-            data.close();
-            outEntry.setCrc(crc.getValue());
-            outEntry.setSize(size);
-        }
-        return outEntry;
-    }
-
-    /**
-     * Copy the contents of the input APK file to the output APK file. If |rename| is
-     * true then non-empty libraries (*.so) in the input will be renamed by prefixing
-     * "crazy.". This is done to prevent the Android Package Manager extracting the
-     * library. Note the crazy linker itself is not renamed, for bootstrapping reasons.
-     * Empty libraries are not renamed (they are in the APK to workaround a bug where
-     * the Android Package Manager fails to delete old versions when upgrading).
-     * There must be exactly one "crazy" library in the output stream. The "crazy"
-     * library will be uncompressed and page aligned in the output stream. Page
-     * alignment is implemented by adding a zero filled file, regular alignment is
-     * implemented by adding a zero filled extra field to the zip file header. If
-     * |addAlignment| is true a page alignment file is added, otherwise the "crazy"
-     * library must already be page aligned. Care is taken so that the output is generated
-     * in the same way as SignApk. This is important so that running SignApk and
-     * zipalign on the output does not break the page alignment. The archive may not
-     * contain a "*.apk" as SignApk has special nested signing logic that we do not
-     * support.
-     *
-     * @param in The input APK File.
-     * @param out The output APK stream.
-     * @param countOut Counting output stream (to measure the current offset).
-     * @param addAlignment Whether to add the alignment file or just check.
-     * @param rename Whether to rename libraries to be "crazy".
-     *
-     * @throws IOException if the output file can not be written.
-     */
-    private static void rezip(
-            JarFile in, JarOutputStream out, CountingOutputStream countOut,
-            boolean addAlignment, boolean rename) throws IOException {
-
-        List<JarEntry> entries = getOutputFileOrderEntries(in, addAlignment, rename);
-        long timestamp = System.currentTimeMillis();
-        byte[] buffer = new byte[4096];
-        boolean firstEntry = true;
-        String prevName = null;
-        int numCrazy = 0;
-        for (JarEntry inEntry : entries) {
-            // Rename files, if specied.
-            String name = outputName(inEntry, rename);
-            if (name.endsWith(".apk")) {
-                throw new UnsupportedOperationException(
-                        "Nested APKs are not supported: " + name);
-            }
-
-            // Build the header.
-            JarEntry outEntry = null;
-            boolean isCrazy = isCrazyLibraryFilename(name);
-            if (isCrazy) {
-                // "crazy" libraries are alway output uncompressed (STORED).
-                outEntry = makeStoredEntry(name, inEntry, in);
-                numCrazy++;
-                if (numCrazy > 1) {
-                    throw new UnsupportedOperationException(
-                            "Found more than one library\n"
-                            + "Multiple libraries are not supported for APKs that use "
-                            + "'load_library_from_zip'.\n"
-                            + "See crbug/388223.\n"
-                            + "Note, check that your build is clean.\n"
-                            + "An unclean build can incorrectly incorporate old "
-                            + "libraries in the APK.");
-                }
-            } else if (inEntry.getMethod() == JarEntry.STORED) {
-                // Preserve the STORED method of the input entry.
-                outEntry = new JarEntry(inEntry);
-                outEntry.setExtra(null);
-            } else {
-                // Create a new entry so that the compressed len is recomputed.
-                outEntry = new JarEntry(name);
-            }
-            outEntry.setTime(timestamp);
-
-            // Compute and add alignment
-            long offset = countOut.getCount();
-            if (firstEntry) {
-                // The first entry in a jar file has an extra field of
-                // four bytes that you can't get rid of; any extra
-                // data you specify in the JarEntry is appended to
-                // these forced four bytes.  This is JAR_MAGIC in
-                // JarOutputStream; the bytes are 0xfeca0000.
-                firstEntry = false;
-                offset += 4;
-            }
-            if (outEntry.getMethod() == JarEntry.STORED) {
-                if (isCrazy) {
-                    if (addAlignment) {
-                        addAlignmentFile(offset, timestamp, name, prevName, out);
-                    }
-                    // We check that we did indeed get to a page boundary.
-                    offset = countOut.getCount() + JarFile.LOCHDR + name.length();
-                    if ((offset % LIBRARY_ALIGNMENT) != 0) {
-                        throw new AssertionError(
-                                "Library was not page aligned when verifying page alignment. "
-                                + "Library name: " + name + " Expected alignment: "
-                                + LIBRARY_ALIGNMENT + "Offset: " + offset + " Error: "
-                                + (offset % LIBRARY_ALIGNMENT));
-                    }
-                } else {
-                    // This is equivalent to zipalign.
-                    offset += JarFile.LOCHDR + name.length();
-                    int needed = (ALIGNMENT - (int) (offset % ALIGNMENT)) % ALIGNMENT;
-                    if (needed != 0) {
-                        outEntry.setExtra(new byte[needed]);
-                    }
-                }
-            }
-            out.putNextEntry(outEntry);
-
-            // Copy the data from the input to the output
-            int num;
-            InputStream data = in.getInputStream(inEntry);
-            while ((num = data.read(buffer)) > 0) {
-                out.write(buffer, 0, num);
-            }
-            data.close();
-            out.closeEntry();
-            out.flush();
-            prevName = name;
-        }
-        if (numCrazy == 0) {
-            throw new AssertionError("There was no crazy library in the archive");
-        }
-    }
-
-    private static void usage() {
-        System.err.println("Usage: prealignapk (addalignment|reorder) input.apk output.apk");
-        System.err.println("\"crazy\" libraries are always inflated in the output");
-        System.err.println(
-                "  renamealign  - rename libraries with \"crazy.\" prefix and add alignment file");
-        System.err.println("  align        - add alignment file");
-        System.err.println("  reorder      - re-creates canonical ordering and checks alignment");
-        System.exit(2);
-    }
-
-    public static void main(String[] args) throws IOException {
-        if (args.length != 3) usage();
-
-        boolean addAlignment = false;
-        boolean rename = false;
-        if (args[0].equals("renamealign")) {
-            // Normal case. Before signing we rename the library and add an alignment file.
-            addAlignment = true;
-            rename = true;
-        } else if (args[0].equals("align")) {
-            // LGPL compliance case. Before signing, we add an alignment file to a
-            // reconstructed APK which already contains the "crazy" library.
-            addAlignment = true;
-            rename = false;
-        } else if (args[0].equals("reorder")) {
-            // Normal case. After jarsigning we write the file in the canonical order and check.
-            addAlignment = false;
-        } else {
-            usage();
-        }
-
-        String inputFilename = args[1];
-        String outputFilename = args[2];
-
-        JarFile inputJar = null;
-        FileOutputStream outputFile = null;
-
-        try {
-            inputJar = new JarFile(new File(inputFilename), true);
-            outputFile = new FileOutputStream(outputFilename);
-
-            CountingOutputStream outCount = new CountingOutputStream(outputFile);
-            JarOutputStream outputJar = new JarOutputStream(outCount);
-
-            // Match the compression level used by SignApk.
-            outputJar.setLevel(9);
-
-            rezip(inputJar, outputJar, outCount, addAlignment, rename);
-            outputJar.close();
-        } finally {
-            if (inputJar != null) inputJar.close();
-            if (outputFile != null) outputFile.close();
-        }
-    }
-}
diff --git a/build/android/screenshot.py b/build/android/screenshot.py
deleted file mode 100755
index 097739f..0000000
--- a/build/android/screenshot.py
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Takes a screenshot or a screen video capture from an Android device."""
-
-import logging
-import optparse
-import os
-import sys
-
-from pylib import screenshot
-from pylib.device import device_errors
-from pylib.device import device_utils
-
-def _PrintMessage(heading, eol='\n'):
-  sys.stdout.write('%s%s' % (heading, eol))
-  sys.stdout.flush()
-
-
-def _CaptureScreenshot(device, host_file):
-  host_file = device.TakeScreenshot(host_file)
-  _PrintMessage('Screenshot written to %s' % os.path.abspath(host_file))
-
-
-def _CaptureVideo(device, host_file, options):
-  size = tuple(map(int, options.size.split('x'))) if options.size else None
-  recorder = screenshot.VideoRecorder(device,
-                                      megabits_per_second=options.bitrate,
-                                      size=size,
-                                      rotate=options.rotate)
-  try:
-    recorder.Start()
-    _PrintMessage('Recording. Press Enter to stop...', eol='')
-    raw_input()
-  finally:
-    recorder.Stop()
-  host_file = recorder.Pull(host_file)
-  _PrintMessage('Video written to %s' % os.path.abspath(host_file))
-
-
-def main():
-  # Parse options.
-  parser = optparse.OptionParser(description=__doc__,
-                                 usage='screenshot.py [options] [filename]')
-  parser.add_option('-d', '--device', metavar='ANDROID_DEVICE', help='Serial '
-                    'number of Android device to use.', default=None)
-  parser.add_option('-f', '--file', help='Save result to file instead of '
-                    'generating a timestamped file name.', metavar='FILE')
-  parser.add_option('-v', '--verbose', help='Verbose logging.',
-                    action='store_true')
-  video_options = optparse.OptionGroup(parser, 'Video capture')
-  video_options.add_option('--video', help='Enable video capturing. Requires '
-                           'Android KitKat or later', action='store_true')
-  video_options.add_option('-b', '--bitrate', help='Bitrate in megabits/s, '
-                           'from 0.1 to 100 mbps, %default mbps by default.',
-                           default=4, type='float')
-  video_options.add_option('-r', '--rotate', help='Rotate video by 90 degrees.',
-                           default=False, action='store_true')
-  video_options.add_option('-s', '--size', metavar='WIDTHxHEIGHT',
-                           help='Frame size to use instead of the device '
-                           'screen size.', default=None)
-  parser.add_option_group(video_options)
-
-  (options, args) = parser.parse_args()
-
-  if len(args) > 1:
-    parser.error('Too many positional arguments.')
-  host_file = args[0] if args else options.file
-
-  if options.verbose:
-    logging.getLogger().setLevel(logging.DEBUG)
-
-  devices = device_utils.DeviceUtils.HealthyDevices()
-  if options.device:
-    device = next((d for d in devices if d == options.device), None)
-    if not device:
-      raise device_errors.DeviceUnreachableError(options.device)
-  else:
-    if len(devices) > 1:
-      parser.error('Multiple devices are attached. '
-                   'Please specify device serial number with --device.')
-    elif len(devices) == 1:
-      device = devices[0]
-    else:
-      raise device_errors.NoDevicesError()
-
-  if options.video:
-    _CaptureVideo(device, host_file, options)
-  else:
-    _CaptureScreenshot(device, host_file)
-  return 0
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/android/setup.gyp b/build/android/setup.gyp
deleted file mode 100644
index 0e1c2c4..0000000
--- a/build/android/setup.gyp
+++ /dev/null
@@ -1,111 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'conditions': [
-    ['component == "shared_library"', {
-      'targets': [
-        {
-          # These libraries from the Android ndk are required to be packaged with
-          # any APK that is built with them. build/java_apk.gypi expects any
-          # libraries that should be packaged with the apk to be in
-          # <(SHARED_LIB_DIR)
-          'target_name': 'copy_system_libraries',
-          'type': 'none',
-          'copies': [
-            {
-              'destination': '<(SHARED_LIB_DIR)/',
-              'files': [
-                '<(android_libcpp_libs_dir)/libc++_shared.so',
-              ],
-            },
-          ],
-        },
-      ],
-    }],
-  ],
-  'targets': [
-    {
-      'target_name': 'get_build_device_configurations',
-      'type': 'none',
-      'actions': [
-        {
-          'action_name': 'get configurations',
-          'inputs': [
-            'gyp/util/build_device.py',
-            'gyp/get_device_configuration.py',
-          ],
-          'outputs': [
-            '<(build_device_config_path)',
-            '<(build_device_config_path).fake',
-          ],
-          'action': [
-            'python', 'gyp/get_device_configuration.py',
-            '--output=<(build_device_config_path)',
-          ],
-        }
-      ],
-    },
-    {
-      # Target for creating common output build directories. Creating output
-      # dirs beforehand ensures that build scripts can assume these folders to
-      # exist and there are no race conditions resulting from build scripts
-      # trying to create these directories.
-      # The build/java.gypi target depends on this target.
-      'target_name': 'build_output_dirs',
-      'type': 'none',
-      'actions': [
-        {
-          'action_name': 'create_java_output_dirs',
-          'variables' : {
-            'output_dirs' : [
-              '<(PRODUCT_DIR)/apks',
-              '<(PRODUCT_DIR)/lib.java',
-              '<(PRODUCT_DIR)/test.lib.java',
-            ]
-          },
-          'inputs' : [],
-          # By not specifying any outputs, we ensure that this command isn't
-          # re-run when the output directories are touched (i.e. apks are
-          # written to them).
-          'outputs': [''],
-          'action': [
-            'mkdir',
-            '-p',
-            '<@(output_dirs)',
-          ],
-        },
-      ],
-    }, # build_output_dirs
-    {
-      'target_name': 'sun_tools_java',
-      'type': 'none',
-      'variables': {
-        'found_jar_path': '<(PRODUCT_DIR)/sun_tools_java/tools.jar',
-        'jar_path': '<(found_jar_path)',
-      },
-      'includes': [
-        '../../build/host_prebuilt_jar.gypi',
-      ],
-      'actions': [
-        {
-          'action_name': 'find_sun_tools_jar',
-          'variables' : {
-          },
-          'inputs' : [
-            'gyp/find_sun_tools_jar.py',
-            'gyp/util/build_utils.py',
-          ],
-          'outputs': [
-            '<(found_jar_path)',
-          ],
-          'action': [
-            'python', 'gyp/find_sun_tools_jar.py',
-            '--output', '<(found_jar_path)',
-          ],
-        },
-      ],
-    }, # sun_tools_java
-  ]
-}
-
diff --git a/build/android/strip_native_libraries.gypi b/build/android/strip_native_libraries.gypi
deleted file mode 100644
index bdffcfd..0000000
--- a/build/android/strip_native_libraries.gypi
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into an action to provide a rule that strips
-# native libraries.
-#
-# To use this, create a gyp target with the following form:
-#  {
-#    'action_name': 'strip_native_libraries',
-#    'actions': [
-#      'variables': {
-#        'ordered_libraries_file': 'file generated by write_ordered_libraries'
-#        'input_paths': 'files to be added to the list of inputs'
-#        'stamp': 'file to touch when the action is complete'
-#        'stripped_libraries_dir': 'directory to store stripped libraries',
-#      },
-#      'includes': [ '../../build/android/strip_native_libraries.gypi' ],
-#    ],
-#  },
-#
-
-{
-  'message': 'Stripping libraries for <(_target_name)',
-  'variables': {
-    'input_paths': [],
-  },
-  'inputs': [
-    '<(DEPTH)/build/android/gyp/util/build_utils.py',
-    '<(DEPTH)/build/android/gyp/strip_library_for_device.py',
-    '<(ordered_libraries_file)',
-    '>@(input_paths)',
-  ],
-  'outputs': [
-    '<(stamp)',
-  ],
-  'conditions': [
-    ['component == "shared_library"', {
-      # Add a fake output to force the build to always re-run this step. This
-      # is required because the real inputs are not known at gyp-time and
-      # changing base.so may not trigger changes to dependent libraries.
-      'outputs': [ '<(stamp).fake' ]
-    }],
-  ],
-  'action': [
-    'python', '<(DEPTH)/build/android/gyp/strip_library_for_device.py',
-    '--android-strip=<(android_strip)',
-    '--android-strip-arg=--strip-unneeded',
-    '--stripped-libraries-dir=<(stripped_libraries_dir)',
-    '--libraries-dir=<(SHARED_LIB_DIR),<(PRODUCT_DIR)',
-    '--libraries=@FileArg(<(ordered_libraries_file):libraries)',
-    '--stamp=<(stamp)',
-  ],
-}
diff --git a/build/android/symbolize.py b/build/android/symbolize.py
deleted file mode 100755
index 56d3b19..0000000
--- a/build/android/symbolize.py
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Symbolizes stack traces generated by Chromium for Android.
-
-Sample usage:
-  adb logcat chromium:V | symbolize.py
-"""
-
-import os
-import re
-import sys
-
-from pylib import constants
-
-# Uses symbol.py from third_party/android_platform, not python's.
-sys.path.insert(0,
-                os.path.join(constants.DIR_SOURCE_ROOT,
-                            'third_party/android_platform/development/scripts'))
-import symbol
-
-# Sample output from base/debug/stack_trace_android.cc
-#00 0x693cd34f /path/to/some/libfoo.so+0x0007434f
-TRACE_LINE = re.compile(r'(?P<frame>\#[0-9]+ 0x[0-9a-f]{8,8}) '
-                        r'(?P<lib>[^+]+)\+0x(?P<addr>[0-9a-f]{8,8})')
-
-class Symbolizer(object):
-  def __init__(self, output):
-    self._output = output
-
-  def write(self, data):
-    while True:
-      match = re.search(TRACE_LINE, data)
-      if not match:
-        self._output.write(data)
-        break
-
-      frame = match.group('frame')
-      lib = match.group('lib')
-      addr = match.group('addr')
-
-      # TODO(scherkus): Doing a single lookup per line is pretty slow,
-      # especially with larger libraries. Consider caching strategies such as:
-      # 1) Have Python load the libraries and do symbol lookups instead of
-      #    calling out to addr2line each time.
-      # 2) Have Python keep multiple addr2line instances open as subprocesses,
-      #    piping addresses and reading back symbols as we find them
-      # 3) Read ahead the entire stack trace until we find no more, then batch
-      #    the symbol lookups.
-      #
-      # TODO(scherkus): These results are memoized, which could result in
-      # incorrect lookups when running this script on long-lived instances
-      # (e.g., adb logcat) when doing incremental development. Consider clearing
-      # the cache when modification timestamp of libraries change.
-      sym = symbol.SymbolInformation(lib, addr, False)[0][0]
-
-      if not sym:
-        post = match.end('addr')
-        self._output.write(data[:post])
-        data = data[post:]
-        continue
-
-      pre = match.start('frame')
-      post = match.end('addr')
-
-      self._output.write(data[:pre])
-      self._output.write(frame)
-      self._output.write(' ')
-      self._output.write(sym)
-
-      data = data[post:]
-
-  def flush(self):
-    self._output.flush()
-
-
-def main():
-  symbolizer = Symbolizer(sys.stdout)
-  for line in sys.stdin:
-    symbolizer.write(line)
-  symbolizer.flush()
-
-
-if __name__ == '__main__':
-  main()
diff --git a/build/android/symbolize_test.py b/build/android/symbolize_test.py
deleted file mode 100755
index 826d852..0000000
--- a/build/android/symbolize_test.py
+++ /dev/null
@@ -1,130 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Unittest for symbolize.py.
-
-This test uses test libraries generated by the Android g++ toolchain.
-
-Should things break you can recreate the libraries and get the updated
-addresses and demangled names by running the following:
-  cd test/symbolize/
-  make
-  nm -gC *.so
-"""
-
-import StringIO
-import unittest
-
-import symbolize
-
-LIB_A_PATH = '/build/android/tests/symbolize/liba.so'
-LIB_B_PATH = '/build/android/tests/symbolize/libb.so'
-
-def RunSymbolizer(text):
-  output = StringIO.StringIO()
-  s = symbolize.Symbolizer(output)
-  s.write(text)
-  return output.getvalue()
-
-
-class SymbolizerUnittest(unittest.TestCase):
-  def testSingleLineNoMatch(self):
-    # Leading '#' is required.
-    expected = '00 0x00000000 ' + LIB_A_PATH + '+0x00000254\n'
-    self.assertEqual(expected, RunSymbolizer(expected))
-
-    # Whitespace should be exactly one space.
-    expected = '#00  0x00000000 ' + LIB_A_PATH + '+0x00000254\n'
-    self.assertEqual(expected, RunSymbolizer(expected))
-    expected = '#00 0x00000000  ' + LIB_A_PATH + '+0x00000254\n'
-    self.assertEqual(expected, RunSymbolizer(expected))
-
-    # Decimal stack frame numbers are required.
-    expected = '#0a 0x00000000 ' + LIB_A_PATH + '+0x00000254\n'
-    self.assertEqual(expected, RunSymbolizer(expected))
-
-    # Hexadecimal addresses are required.
-    expected = '#00 0xghijklmn ' + LIB_A_PATH + '+0x00000254\n'
-    self.assertEqual(expected, RunSymbolizer(expected))
-    expected = '#00 0x00000000 ' + LIB_A_PATH + '+0xghijklmn\n'
-    self.assertEqual(expected, RunSymbolizer(expected))
-
-    # Addresses must be exactly 8 characters.
-    expected = '#00 0x0000000 ' + LIB_A_PATH + '+0x00000254\n'
-    self.assertEqual(expected, RunSymbolizer(expected))
-    expected = '#00 0x000000000 ' + LIB_A_PATH + '+0x00000254\n'
-    self.assertEqual(expected, RunSymbolizer(expected))
-
-    expected = '#00 0x0000000 ' + LIB_A_PATH + '+0x0000254\n'
-    self.assertEqual(expected, RunSymbolizer(expected))
-    expected = '#00 0x000000000 ' + LIB_A_PATH + '+0x000000254\n'
-    self.assertEqual(expected, RunSymbolizer(expected))
-
-    # Addresses must be prefixed with '0x'.
-    expected = '#00 00000000 ' + LIB_A_PATH + '+0x00000254\n'
-    self.assertEqual(expected, RunSymbolizer(expected))
-    expected = '#00 0x00000000 ' + LIB_A_PATH + '+00000254\n'
-    self.assertEqual(expected, RunSymbolizer(expected))
-
-    # Library name is required.
-    expected = '#00 0x00000000\n'
-    self.assertEqual(expected, RunSymbolizer(expected))
-    expected = '#00 0x00000000 +0x00000254\n'
-    self.assertEqual(expected, RunSymbolizer(expected))
-
-    # Library name must be followed by offset with no spaces around '+'.
-    expected = '#00 0x00000000 ' + LIB_A_PATH + ' +0x00000254\n'
-    self.assertEqual(expected, RunSymbolizer(expected))
-    expected = '#00 0x00000000 ' + LIB_A_PATH + '+ 0x00000254\n'
-    self.assertEqual(expected, RunSymbolizer(expected))
-    expected = '#00 0x00000000 ' + LIB_A_PATH + ' 0x00000254\n'
-    self.assertEqual(expected, RunSymbolizer(expected))
-    expected = '#00 0x00000000 ' + LIB_A_PATH + '+\n'
-    self.assertEqual(expected, RunSymbolizer(expected))
-
-  def testSingleLine(self):
-    text = '#00 0x00000000 ' + LIB_A_PATH + '+0x00000254\n'
-    expected = '#00 0x00000000 A::Bar(char const*)\n'
-    actual = RunSymbolizer(text)
-    self.assertEqual(expected, actual)
-
-  def testSingleLineWithSurroundingText(self):
-    text = 'LEFT #00 0x00000000 ' + LIB_A_PATH + '+0x00000254 RIGHT\n'
-    expected = 'LEFT #00 0x00000000 A::Bar(char const*) RIGHT\n'
-    actual = RunSymbolizer(text)
-    self.assertEqual(expected, actual)
-
-  def testMultipleLinesSameLibrary(self):
-    text = '#00 0x00000000 ' + LIB_A_PATH + '+0x00000254\n'
-    text += '#01 0x00000000 ' + LIB_A_PATH + '+0x00000234\n'
-    expected = '#00 0x00000000 A::Bar(char const*)\n'
-    expected += '#01 0x00000000 A::Foo(int)\n'
-    actual = RunSymbolizer(text)
-    self.assertEqual(expected, actual)
-
-  def testMultipleLinesDifferentLibrary(self):
-    text = '#00 0x00000000 ' + LIB_A_PATH + '+0x00000254\n'
-    text += '#01 0x00000000 ' + LIB_B_PATH + '+0x00000234\n'
-    expected = '#00 0x00000000 A::Bar(char const*)\n'
-    expected += '#01 0x00000000 B::Baz(float)\n'
-    actual = RunSymbolizer(text)
-    self.assertEqual(expected, actual)
-
-  def testMultipleLinesWithSurroundingTextEverywhere(self):
-    text = 'TOP\n'
-    text += 'LEFT #00 0x00000000 ' + LIB_A_PATH + '+0x00000254 RIGHT\n'
-    text += 'LEFT #01 0x00000000 ' + LIB_B_PATH + '+0x00000234 RIGHT\n'
-    text += 'BOTTOM\n'
-    expected = 'TOP\n'
-    expected += 'LEFT #00 0x00000000 A::Bar(char const*) RIGHT\n'
-    expected += 'LEFT #01 0x00000000 B::Baz(float) RIGHT\n'
-    expected += 'BOTTOM\n'
-    actual = RunSymbolizer(text)
-    self.assertEqual(expected, actual)
-
-
-if __name__ == '__main__':
-  unittest.main()
diff --git a/build/android/test_runner.gypi b/build/android/test_runner.gypi
deleted file mode 100644
index f92b7ce..0000000
--- a/build/android/test_runner.gypi
+++ /dev/null
@@ -1,81 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Generates a script in the output bin directory which runs the test
-# target using the test runner script in build/android/pylib/test_runner.py.
-#
-# To use this, include this file in a gtest or instrumentation test target.
-# {
-#   'target_name': 'gtest',
-#   'type': 'none',
-#   'variables': {
-#     'test_type': 'gtest',  # string
-#     'test_suite_name': 'gtest_suite'  # string
-#     'isolate_file': 'path/to/gtest.isolate'  # string
-#   },
-#   'includes': ['path/to/this/gypi/file'],
-# }
-#
-# {
-#   'target_name': 'instrumentation_apk',
-#   'type': 'none',
-#   'variables': {
-#     'test_type': 'instrumentation',  # string
-#     'apk_name': 'TestApk'  # string
-#     'isolate_file': 'path/to/instrumentation_test.isolate'  # string
-#   },
-#   'includes': ['path/to/this/gypi/file'],
-# }
-#
-
-{
-  'variables': {
-    'variables': {
-      'isolate_file%': '',
-      'support_apk_path%': '',
-    },
-    'test_runner_args': ['--output-directory', '<(PRODUCT_DIR)'],
-    'conditions': [
-      ['test_type == "gtest"', {
-        'test_runner_args': ['--suite', '<(test_suite_name)'],
-        'script_name': 'run_<(test_suite_name)',
-      }],
-      ['test_type == "instrumentation"', {
-        'test_runner_args': ['--test-apk', '<(apk_name)'],
-        'script_name': 'run_<(_target_name)',
-        'conditions': [
-          ['support_apk_path != ""', {
-            'test_runner_args': [
-              '--support-apk',
-              '<(support_apk_path)'
-            ],
-          }],
-        ],
-      }],
-      ['isolate_file != ""', {
-        'test_runner_args': ['--isolate-file-path', '<(isolate_file)']
-      }],
-    ],
-  },
-  'actions': [
-    {
-      'action_name': 'create_test_runner_script_<(script_name)',
-      'message': 'Creating test runner script <(script_name)',
-      'variables': {
-        'script_output_path': '<(PRODUCT_DIR)/bin/<(script_name)',
-      },
-      'inputs': [
-        '<(DEPTH)/build/android/gyp/create_test_runner_script.py',
-      ],
-      'outputs': [
-        '<(script_output_path)'
-      ],
-      'action': [
-        'python', '<(DEPTH)/build/android/gyp/create_test_runner_script.py',
-        '--script-output-path=<(script_output_path)',
-        '<(test_type)', '<@(test_runner_args)',
-      ],
-    },
-  ],
-}
\ No newline at end of file
diff --git a/build/android/test_runner.py b/build/android/test_runner.py
deleted file mode 100755
index 1fc48ec..0000000
--- a/build/android/test_runner.py
+++ /dev/null
@@ -1,1067 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Runs all types of tests from one unified interface."""
-
-import argparse
-import collections
-import logging
-import os
-import shutil
-import signal
-import sys
-import threading
-import unittest
-
-from pylib import constants
-from pylib import forwarder
-from pylib import ports
-from pylib.base import base_test_result
-from pylib.base import environment_factory
-from pylib.base import test_dispatcher
-from pylib.base import test_instance_factory
-from pylib.base import test_run_factory
-from pylib.device import device_errors
-from pylib.device import device_utils
-from pylib.gtest import gtest_config
-# TODO(jbudorick): Remove this once we stop selectively enabling platform mode.
-from pylib.gtest import gtest_test_instance
-from pylib.gtest import setup as gtest_setup
-from pylib.gtest import test_options as gtest_test_options
-from pylib.linker import setup as linker_setup
-from pylib.host_driven import setup as host_driven_setup
-from pylib.instrumentation import setup as instrumentation_setup
-from pylib.instrumentation import test_options as instrumentation_test_options
-from pylib.junit import setup as junit_setup
-from pylib.junit import test_dispatcher as junit_dispatcher
-from pylib.monkey import setup as monkey_setup
-from pylib.monkey import test_options as monkey_test_options
-from pylib.perf import setup as perf_setup
-from pylib.perf import test_options as perf_test_options
-from pylib.perf import test_runner as perf_test_runner
-from pylib.results import json_results
-from pylib.results import report_results
-from pylib.uiautomator import setup as uiautomator_setup
-from pylib.uiautomator import test_options as uiautomator_test_options
-from pylib.utils import apk_helper
-from pylib.utils import base_error
-from pylib.utils import reraiser_thread
-from pylib.utils import run_tests_helper
-
-
-def AddCommonOptions(parser):
-  """Adds all common options to |parser|."""
-
-  group = parser.add_argument_group('Common Options')
-
-  default_build_type = os.environ.get('BUILDTYPE', 'Debug')
-
-  debug_or_release_group = group.add_mutually_exclusive_group()
-  debug_or_release_group.add_argument(
-      '--debug', action='store_const', const='Debug', dest='build_type',
-      default=default_build_type,
-      help=('If set, run test suites under out/Debug. '
-            'Default is env var BUILDTYPE or Debug.'))
-  debug_or_release_group.add_argument(
-      '--release', action='store_const', const='Release', dest='build_type',
-      help=('If set, run test suites under out/Release. '
-            'Default is env var BUILDTYPE or Debug.'))
-
-  group.add_argument('--build-directory', dest='build_directory',
-                     help=('Path to the directory in which build files are'
-                           ' located (should not include build type)'))
-  group.add_argument('--output-directory', dest='output_directory',
-                     help=('Path to the directory in which build files are'
-                           ' located (must include build type). This will take'
-                           ' precedence over --debug, --release and'
-                           ' --build-directory'))
-  group.add_argument('--num_retries', dest='num_retries', type=int, default=2,
-                     help=('Number of retries for a test before '
-                           'giving up (default: %(default)s).'))
-  group.add_argument('-v',
-                     '--verbose',
-                     dest='verbose_count',
-                     default=0,
-                     action='count',
-                     help='Verbose level (multiple times for more)')
-  group.add_argument('--flakiness-dashboard-server',
-                     dest='flakiness_dashboard_server',
-                     help=('Address of the server that is hosting the '
-                           'Chrome for Android flakiness dashboard.'))
-  group.add_argument('--enable-platform-mode', action='store_true',
-                     help=('Run the test scripts in platform mode, which '
-                           'conceptually separates the test runner from the '
-                           '"device" (local or remote, real or emulated) on '
-                           'which the tests are running. [experimental]'))
-  group.add_argument('-e', '--environment', default='local',
-                     choices=constants.VALID_ENVIRONMENTS,
-                     help='Test environment to run in (default: %(default)s).')
-  group.add_argument('--adb-path',
-                     help=('Specify the absolute path of the adb binary that '
-                           'should be used.'))
-  group.add_argument('--json-results-file', dest='json_results_file',
-                     help='If set, will dump results in JSON form '
-                          'to specified file.')
-
-def ProcessCommonOptions(args):
-  """Processes and handles all common options."""
-  run_tests_helper.SetLogLevel(args.verbose_count)
-  constants.SetBuildType(args.build_type)
-  if args.build_directory:
-    constants.SetBuildDirectory(args.build_directory)
-  if args.output_directory:
-    constants.SetOutputDirectory(args.output_directory)
-  if args.adb_path:
-    constants.SetAdbPath(args.adb_path)
-  # Some things such as Forwarder require ADB to be in the environment path.
-  adb_dir = os.path.dirname(constants.GetAdbPath())
-  if adb_dir and adb_dir not in os.environ['PATH'].split(os.pathsep):
-    os.environ['PATH'] = adb_dir + os.pathsep + os.environ['PATH']
-
-
-def AddRemoteDeviceOptions(parser):
-  group = parser.add_argument_group('Remote Device Options')
-
-  group.add_argument('--trigger',
-                     help=('Only triggers the test if set. Stores test_run_id '
-                           'in given file path. '))
-  group.add_argument('--collect',
-                     help=('Only collects the test results if set. '
-                           'Gets test_run_id from given file path.'))
-  group.add_argument('--remote-device', action='append',
-                     help='Device type to run test on.')
-  group.add_argument('--results-path',
-                     help='File path to download results to.')
-  group.add_argument('--api-protocol',
-                     help='HTTP protocol to use. (http or https)')
-  group.add_argument('--api-address',
-                     help='Address to send HTTP requests.')
-  group.add_argument('--api-port',
-                     help='Port to send HTTP requests to.')
-  group.add_argument('--runner-type',
-                     help='Type of test to run as.')
-  group.add_argument('--runner-package',
-                     help='Package name of test.')
-  group.add_argument('--device-type',
-                     choices=constants.VALID_DEVICE_TYPES,
-                     help=('Type of device to run on. iOS or android'))
-  group.add_argument('--device-oem', action='append',
-                     help='Device OEM to run on.')
-  group.add_argument('--remote-device-file',
-                     help=('File with JSON to select remote device. '
-                           'Overrides all other flags.'))
-  group.add_argument('--remote-device-timeout', type=int,
-                     help='Times to retry finding remote device')
-  group.add_argument('--network-config', type=int,
-                     help='Integer that specifies the network environment '
-                          'that the tests will be run in.')
-
-  device_os_group = group.add_mutually_exclusive_group()
-  device_os_group.add_argument('--remote-device-minimum-os',
-                               help='Minimum OS on device.')
-  device_os_group.add_argument('--remote-device-os', action='append',
-                               help='OS to have on the device.')
-
-  api_secret_group = group.add_mutually_exclusive_group()
-  api_secret_group.add_argument('--api-secret', default='',
-                                help='API secret for remote devices.')
-  api_secret_group.add_argument('--api-secret-file', default='',
-                                help='Path to file that contains API secret.')
-
-  api_key_group = group.add_mutually_exclusive_group()
-  api_key_group.add_argument('--api-key', default='',
-                             help='API key for remote devices.')
-  api_key_group.add_argument('--api-key-file', default='',
-                             help='Path to file that contains API key.')
-
-
-def AddDeviceOptions(parser):
-  """Adds device options to |parser|."""
-  group = parser.add_argument_group(title='Device Options')
-  group.add_argument('--tool',
-                     dest='tool',
-                     help=('Run the test under a tool '
-                           '(use --tool help to list them)'))
-  group.add_argument('-d', '--device', dest='test_device',
-                     help=('Target device for the test suite '
-                           'to run on.'))
-
-
-def AddGTestOptions(parser):
-  """Adds gtest options to |parser|."""
-
-  gtest_suites = list(gtest_config.STABLE_TEST_SUITES
-                      + gtest_config.EXPERIMENTAL_TEST_SUITES)
-
-  group = parser.add_argument_group('GTest Options')
-  group.add_argument('-s', '--suite', dest='suite_name',
-                     nargs='+', metavar='SUITE_NAME', required=True,
-                     help=('Executable name of the test suite to run. '
-                           'Available suites include (but are not limited to): '
-                            '%s' % ', '.join('"%s"' % s for s in gtest_suites)))
-  group.add_argument('--gtest_also_run_disabled_tests',
-                     '--gtest-also-run-disabled-tests',
-                     dest='run_disabled', action='store_true',
-                     help='Also run disabled tests if applicable.')
-  group.add_argument('-a', '--test-arguments', dest='test_arguments',
-                     default='',
-                     help='Additional arguments to pass to the test.')
-  group.add_argument('-t', dest='timeout', type=int, default=60,
-                     help='Timeout to wait for each test '
-                          '(default: %(default)s).')
-  group.add_argument('--isolate_file_path',
-                     '--isolate-file-path',
-                     dest='isolate_file_path',
-                     help='.isolate file path to override the default '
-                          'path')
-  group.add_argument('--app-data-file', action='append', dest='app_data_files',
-                     help='A file path relative to the app data directory '
-                          'that should be saved to the host.')
-  group.add_argument('--app-data-file-dir',
-                     help='Host directory to which app data files will be'
-                          ' saved. Used with --app-data-file.')
-  group.add_argument('--delete-stale-data', dest='delete_stale_data',
-                     action='store_true',
-                     help='Delete stale test data on the device.')
-
-  filter_group = group.add_mutually_exclusive_group()
-  filter_group.add_argument('-f', '--gtest_filter', '--gtest-filter',
-                            dest='test_filter',
-                            help='googletest-style filter string.')
-  filter_group.add_argument('--gtest-filter-file', dest='test_filter_file',
-                            help='Path to file that contains googletest-style '
-                                  'filter strings. (Lines will be joined with '
-                                  '":" to create a single filter string.)')
-
-  AddDeviceOptions(parser)
-  AddCommonOptions(parser)
-  AddRemoteDeviceOptions(parser)
-
-
-def AddLinkerTestOptions(parser):
-  group = parser.add_argument_group('Linker Test Options')
-  group.add_argument('-f', '--gtest-filter', dest='test_filter',
-                     help='googletest-style filter string.')
-  AddCommonOptions(parser)
-  AddDeviceOptions(parser)
-
-
-def AddJavaTestOptions(argument_group):
-  """Adds the Java test options to |option_parser|."""
-
-  argument_group.add_argument(
-      '-f', '--test-filter', dest='test_filter',
-      help=('Test filter (if not fully qualified, will run all matches).'))
-  argument_group.add_argument(
-      '-A', '--annotation', dest='annotation_str',
-      help=('Comma-separated list of annotations. Run only tests with any of '
-            'the given annotations. An annotation can be either a key or a '
-            'key-values pair. A test that has no annotation is considered '
-            '"SmallTest".'))
-  argument_group.add_argument(
-      '-E', '--exclude-annotation', dest='exclude_annotation_str',
-      help=('Comma-separated list of annotations. Exclude tests with these '
-            'annotations.'))
-  argument_group.add_argument(
-      '--screenshot', dest='screenshot_failures', action='store_true',
-      help='Capture screenshots of test failures')
-  argument_group.add_argument(
-      '--save-perf-json', action='store_true',
-      help='Saves the JSON file for each UI Perf test.')
-  argument_group.add_argument(
-      '--official-build', action='store_true', help='Run official build tests.')
-  argument_group.add_argument(
-      '--test_data', '--test-data', action='append', default=[],
-      help=('Each instance defines a directory of test data that should be '
-            'copied to the target(s) before running the tests. The argument '
-            'should be of the form <target>:<source>, <target> is relative to '
-            'the device data directory, and <source> is relative to the '
-            'chromium build directory.'))
-  argument_group.add_argument(
-      '--disable-dalvik-asserts', dest='set_asserts', action='store_false',
-      default=True, help='Removes the dalvik.vm.enableassertions property')
-
-
-
-def ProcessJavaTestOptions(args):
-  """Processes options/arguments and populates |options| with defaults."""
-
-  # TODO(jbudorick): Handle most of this function in argparse.
-  if args.annotation_str:
-    args.annotations = args.annotation_str.split(',')
-  elif args.test_filter:
-    args.annotations = []
-  else:
-    args.annotations = ['Smoke', 'SmallTest', 'MediumTest', 'LargeTest',
-                        'EnormousTest', 'IntegrationTest']
-
-  if args.exclude_annotation_str:
-    args.exclude_annotations = args.exclude_annotation_str.split(',')
-  else:
-    args.exclude_annotations = []
-
-
-def AddInstrumentationTestOptions(parser):
-  """Adds Instrumentation test options to |parser|."""
-
-  parser.usage = '%(prog)s [options]'
-
-  group = parser.add_argument_group('Instrumentation Test Options')
-  AddJavaTestOptions(group)
-
-  java_or_python_group = group.add_mutually_exclusive_group()
-  java_or_python_group.add_argument(
-      '-j', '--java-only', action='store_false',
-      dest='run_python_tests', default=True, help='Run only the Java tests.')
-  java_or_python_group.add_argument(
-      '-p', '--python-only', action='store_false',
-      dest='run_java_tests', default=True,
-      help='Run only the host-driven tests.')
-
-  group.add_argument('--host-driven-root',
-                     help='Root of the host-driven tests.')
-  group.add_argument('-w', '--wait_debugger', dest='wait_for_debugger',
-                     action='store_true',
-                     help='Wait for debugger.')
-  group.add_argument('--apk-under-test', dest='apk_under_test',
-                     help=('the name of the apk under test.'))
-  group.add_argument('--test-apk', dest='test_apk', required=True,
-                     help=('The name of the apk containing the tests '
-                           '(without the .apk extension; '
-                           'e.g. "ContentShellTest").'))
-  group.add_argument('--support-apk', dest='test_support_apk_path',
-                     help=('The path to an optional support apk to be '
-                           'installed alongside the test apk. The '
-                           'path should be relative to the output '
-                           'directory (--output-directory).'))
-  group.add_argument('--coverage-dir',
-                     help=('Directory in which to place all generated '
-                           'EMMA coverage files.'))
-  group.add_argument('--device-flags', dest='device_flags', default='',
-                     help='The relative filepath to a file containing '
-                          'command-line flags to set on the device')
-  group.add_argument('--device-flags-file', default='',
-                     help='The relative filepath to a file containing '
-                          'command-line flags to set on the device')
-  group.add_argument('--isolate_file_path',
-                     '--isolate-file-path',
-                     dest='isolate_file_path',
-                     help='.isolate file path to override the default '
-                          'path')
-  group.add_argument('--delete-stale-data', dest='delete_stale_data',
-                     action='store_true',
-                     help='Delete stale test data on the device.')
-
-  AddCommonOptions(parser)
-  AddDeviceOptions(parser)
-  AddRemoteDeviceOptions(parser)
-
-
-def ProcessInstrumentationOptions(args):
-  """Processes options/arguments and populate |options| with defaults.
-
-  Args:
-    args: argparse.Namespace object.
-
-  Returns:
-    An InstrumentationOptions named tuple which contains all options relevant to
-    instrumentation tests.
-  """
-
-  ProcessJavaTestOptions(args)
-
-  if not args.host_driven_root:
-    args.run_python_tests = False
-
-  args.test_apk_path = os.path.join(
-      constants.GetOutDirectory(),
-      constants.SDK_BUILD_APKS_DIR,
-      '%s.apk' % args.test_apk)
-  args.test_apk_jar_path = os.path.join(
-      constants.GetOutDirectory(),
-      constants.SDK_BUILD_TEST_JAVALIB_DIR,
-      '%s.jar' %  args.test_apk)
-
-  args.test_runner = apk_helper.GetInstrumentationName(args.test_apk_path)
-
-  # TODO(jbudorick): Get rid of InstrumentationOptions.
-  return instrumentation_test_options.InstrumentationOptions(
-      args.tool,
-      args.annotations,
-      args.exclude_annotations,
-      args.test_filter,
-      args.test_data,
-      args.save_perf_json,
-      args.screenshot_failures,
-      args.wait_for_debugger,
-      args.coverage_dir,
-      args.test_apk,
-      args.test_apk_path,
-      args.test_apk_jar_path,
-      args.test_runner,
-      args.test_support_apk_path,
-      args.device_flags,
-      args.isolate_file_path,
-      args.set_asserts,
-      args.delete_stale_data
-      )
-
-
-def AddUIAutomatorTestOptions(parser):
-  """Adds UI Automator test options to |parser|."""
-
-  group = parser.add_argument_group('UIAutomator Test Options')
-  AddJavaTestOptions(group)
-  group.add_argument(
-      '--package', required=True, choices=constants.PACKAGE_INFO.keys(),
-      metavar='PACKAGE', help='Package under test.')
-  group.add_argument(
-      '--test-jar', dest='test_jar', required=True,
-      help=('The name of the dexed jar containing the tests (without the '
-            '.dex.jar extension). Alternatively, this can be a full path '
-            'to the jar.'))
-
-  AddCommonOptions(parser)
-  AddDeviceOptions(parser)
-
-
-def ProcessUIAutomatorOptions(args):
-  """Processes UIAutomator options/arguments.
-
-  Args:
-    args: argparse.Namespace object.
-
-  Returns:
-    A UIAutomatorOptions named tuple which contains all options relevant to
-    uiautomator tests.
-  """
-
-  ProcessJavaTestOptions(args)
-
-  if os.path.exists(args.test_jar):
-    # The dexed JAR is fully qualified, assume the info JAR lives along side.
-    args.uiautomator_jar = args.test_jar
-  else:
-    args.uiautomator_jar = os.path.join(
-        constants.GetOutDirectory(),
-        constants.SDK_BUILD_JAVALIB_DIR,
-        '%s.dex.jar' % args.test_jar)
-  args.uiautomator_info_jar = (
-      args.uiautomator_jar[:args.uiautomator_jar.find('.dex.jar')] +
-      '_java.jar')
-
-  return uiautomator_test_options.UIAutomatorOptions(
-      args.tool,
-      args.annotations,
-      args.exclude_annotations,
-      args.test_filter,
-      args.test_data,
-      args.save_perf_json,
-      args.screenshot_failures,
-      args.uiautomator_jar,
-      args.uiautomator_info_jar,
-      args.package,
-      args.set_asserts)
-
-
-def AddJUnitTestOptions(parser):
-  """Adds junit test options to |parser|."""
-
-  group = parser.add_argument_group('JUnit Test Options')
-  group.add_argument(
-      '-s', '--test-suite', dest='test_suite', required=True,
-      help=('JUnit test suite to run.'))
-  group.add_argument(
-      '-f', '--test-filter', dest='test_filter',
-      help='Filters tests googletest-style.')
-  group.add_argument(
-      '--package-filter', dest='package_filter',
-      help='Filters tests by package.')
-  group.add_argument(
-      '--runner-filter', dest='runner_filter',
-      help='Filters tests by runner class. Must be fully qualified.')
-  group.add_argument(
-      '--sdk-version', dest='sdk_version', type=int,
-      help='The Android SDK version.')
-  AddCommonOptions(parser)
-
-
-def AddMonkeyTestOptions(parser):
-  """Adds monkey test options to |parser|."""
-
-  group = parser.add_argument_group('Monkey Test Options')
-  group.add_argument(
-      '--package', required=True, choices=constants.PACKAGE_INFO.keys(),
-      metavar='PACKAGE', help='Package under test.')
-  group.add_argument(
-      '--event-count', default=10000, type=int,
-      help='Number of events to generate (default: %(default)s).')
-  group.add_argument(
-      '--category', default='',
-      help='A list of allowed categories.')
-  group.add_argument(
-      '--throttle', default=100, type=int,
-      help='Delay between events (ms) (default: %(default)s). ')
-  group.add_argument(
-      '--seed', type=int,
-      help=('Seed value for pseudo-random generator. Same seed value generates '
-            'the same sequence of events. Seed is randomized by default.'))
-  group.add_argument(
-      '--extra-args', default='',
-      help=('String of other args to pass to the command verbatim.'))
-
-  AddCommonOptions(parser)
-  AddDeviceOptions(parser)
-
-def ProcessMonkeyTestOptions(args):
-  """Processes all monkey test options.
-
-  Args:
-    args: argparse.Namespace object.
-
-  Returns:
-    A MonkeyOptions named tuple which contains all options relevant to
-    monkey tests.
-  """
-  # TODO(jbudorick): Handle this directly in argparse with nargs='+'
-  category = args.category
-  if category:
-    category = args.category.split(',')
-
-  # TODO(jbudorick): Get rid of MonkeyOptions.
-  return monkey_test_options.MonkeyOptions(
-      args.verbose_count,
-      args.package,
-      args.event_count,
-      category,
-      args.throttle,
-      args.seed,
-      args.extra_args)
-
-def AddUirobotTestOptions(parser):
-  """Adds uirobot test options to |option_parser|."""
-  group = parser.add_argument_group('Uirobot Test Options')
-
-  group.add_argument('--app-under-test', required=True,
-                     help='APK to run tests on.')
-  group.add_argument(
-      '--minutes', default=5, type=int,
-      help='Number of minutes to run uirobot test [default: %(default)s].')
-
-  AddCommonOptions(parser)
-  AddDeviceOptions(parser)
-  AddRemoteDeviceOptions(parser)
-
-def AddPerfTestOptions(parser):
-  """Adds perf test options to |parser|."""
-
-  group = parser.add_argument_group('Perf Test Options')
-
-  class SingleStepAction(argparse.Action):
-    def __call__(self, parser, namespace, values, option_string=None):
-      if values and not namespace.single_step:
-        parser.error('single step command provided, '
-                     'but --single-step not specified.')
-      elif namespace.single_step and not values:
-        parser.error('--single-step specified, '
-                     'but no single step command provided.')
-      setattr(namespace, self.dest, values)
-
-  step_group = group.add_mutually_exclusive_group(required=True)
-  # TODO(jbudorick): Revise --single-step to use argparse.REMAINDER.
-  # This requires removing "--" from client calls.
-  step_group.add_argument(
-      '--single-step', action='store_true',
-      help='Execute the given command with retries, but only print the result '
-           'for the "most successful" round.')
-  step_group.add_argument(
-      '--steps',
-      help='JSON file containing the list of commands to run.')
-  step_group.add_argument(
-      '--print-step',
-      help='The name of a previously executed perf step to print.')
-
-  group.add_argument(
-      '--output-json-list',
-      help='Write a simple list of names from --steps into the given file.')
-  group.add_argument(
-      '--collect-chartjson-data',
-      action='store_true',
-      help='Cache the chartjson output from each step for later use.')
-  group.add_argument(
-      '--output-chartjson-data',
-      default='',
-      help='Write out chartjson into the given file.')
-  group.add_argument(
-      '--flaky-steps',
-      help=('A JSON file containing steps that are flaky '
-            'and will have its exit code ignored.'))
-  group.add_argument(
-      '--no-timeout', action='store_true',
-      help=('Do not impose a timeout. Each perf step is responsible for '
-            'implementing the timeout logic.'))
-  group.add_argument(
-      '-f', '--test-filter',
-      help=('Test filter (will match against the names listed in --steps).'))
-  group.add_argument(
-      '--dry-run', action='store_true',
-      help='Just print the steps without executing.')
-  # Uses 0.1 degrees C because that's what Android does.
-  group.add_argument(
-      '--max-battery-temp', type=int,
-      help='Only start tests when the battery is at or below the given '
-           'temperature (0.1 C)')
-  group.add_argument('single_step_command', nargs='*', action=SingleStepAction,
-                     help='If --single-step is specified, the command to run.')
-  group.add_argument('--min-battery-level', type=int,
-                     help='Only starts tests when the battery is charged above '
-                          'given level.')
-  AddCommonOptions(parser)
-  AddDeviceOptions(parser)
-
-
-def ProcessPerfTestOptions(args):
-  """Processes all perf test options.
-
-  Args:
-    args: argparse.Namespace object.
-
-  Returns:
-    A PerfOptions named tuple which contains all options relevant to
-    perf tests.
-  """
-  # TODO(jbudorick): Move single_step handling down into the perf tests.
-  if args.single_step:
-    args.single_step = ' '.join(args.single_step_command)
-  # TODO(jbudorick): Get rid of PerfOptions.
-  return perf_test_options.PerfOptions(
-      args.steps, args.flaky_steps, args.output_json_list,
-      args.print_step, args.no_timeout, args.test_filter,
-      args.dry_run, args.single_step, args.collect_chartjson_data,
-      args.output_chartjson_data, args.max_battery_temp, args.min_battery_level)
-
-
-def AddPythonTestOptions(parser):
-  group = parser.add_argument_group('Python Test Options')
-  group.add_argument(
-      '-s', '--suite', dest='suite_name', metavar='SUITE_NAME',
-      choices=constants.PYTHON_UNIT_TEST_SUITES.keys(),
-      help='Name of the test suite to run.')
-  AddCommonOptions(parser)
-
-
-def _RunGTests(args, devices):
-  """Subcommand of RunTestsCommands which runs gtests."""
-  exit_code = 0
-  for suite_name in args.suite_name:
-    # TODO(jbudorick): Either deprecate multi-suite or move its handling down
-    # into the gtest code.
-    gtest_options = gtest_test_options.GTestOptions(
-        args.tool,
-        args.test_filter,
-        args.run_disabled,
-        args.test_arguments,
-        args.timeout,
-        args.isolate_file_path,
-        suite_name,
-        args.app_data_files,
-        args.app_data_file_dir,
-        args.delete_stale_data)
-    runner_factory, tests = gtest_setup.Setup(gtest_options, devices)
-
-    results, test_exit_code = test_dispatcher.RunTests(
-        tests, runner_factory, devices, shard=True, test_timeout=None,
-        num_retries=args.num_retries)
-
-    if test_exit_code and exit_code != constants.ERROR_EXIT_CODE:
-      exit_code = test_exit_code
-
-    report_results.LogFull(
-        results=results,
-        test_type='Unit test',
-        test_package=suite_name,
-        flakiness_server=args.flakiness_dashboard_server)
-
-    if args.json_results_file:
-      json_results.GenerateJsonResultsFile(results, args.json_results_file)
-
-  return exit_code
-
-
-def _RunLinkerTests(args, devices):
-  """Subcommand of RunTestsCommands which runs linker tests."""
-  runner_factory, tests = linker_setup.Setup(args, devices)
-
-  results, exit_code = test_dispatcher.RunTests(
-      tests, runner_factory, devices, shard=True, test_timeout=60,
-      num_retries=args.num_retries)
-
-  report_results.LogFull(
-      results=results,
-      test_type='Linker test',
-      test_package='ChromiumLinkerTest')
-
-  if args.json_results_file:
-    json_results.GenerateJsonResultsFile(results, args.json_results_file)
-
-  return exit_code
-
-
-def _RunInstrumentationTests(args, devices):
-  """Subcommand of RunTestsCommands which runs instrumentation tests."""
-  logging.info('_RunInstrumentationTests(%s, %s)' % (str(args), str(devices)))
-
-  instrumentation_options = ProcessInstrumentationOptions(args)
-
-  if len(devices) > 1 and args.wait_for_debugger:
-    logging.warning('Debugger can not be sharded, using first available device')
-    devices = devices[:1]
-
-  results = base_test_result.TestRunResults()
-  exit_code = 0
-
-  if args.run_java_tests:
-    runner_factory, tests = instrumentation_setup.Setup(
-        instrumentation_options, devices)
-
-    test_results, exit_code = test_dispatcher.RunTests(
-        tests, runner_factory, devices, shard=True, test_timeout=None,
-        num_retries=args.num_retries)
-
-    results.AddTestRunResults(test_results)
-
-  if args.run_python_tests:
-    runner_factory, tests = host_driven_setup.InstrumentationSetup(
-        args.host_driven_root, args.official_build,
-        instrumentation_options)
-
-    if tests:
-      test_results, test_exit_code = test_dispatcher.RunTests(
-          tests, runner_factory, devices, shard=True, test_timeout=None,
-          num_retries=args.num_retries)
-
-      results.AddTestRunResults(test_results)
-
-      # Only allow exit code escalation
-      if test_exit_code and exit_code != constants.ERROR_EXIT_CODE:
-        exit_code = test_exit_code
-
-  if args.device_flags:
-    args.device_flags = os.path.join(constants.DIR_SOURCE_ROOT,
-                                     args.device_flags)
-
-  report_results.LogFull(
-      results=results,
-      test_type='Instrumentation',
-      test_package=os.path.basename(args.test_apk),
-      annotation=args.annotations,
-      flakiness_server=args.flakiness_dashboard_server)
-
-  if args.json_results_file:
-    json_results.GenerateJsonResultsFile(results, args.json_results_file)
-
-  return exit_code
-
-
-def _RunUIAutomatorTests(args, devices):
-  """Subcommand of RunTestsCommands which runs uiautomator tests."""
-  uiautomator_options = ProcessUIAutomatorOptions(args)
-
-  runner_factory, tests = uiautomator_setup.Setup(uiautomator_options)
-
-  results, exit_code = test_dispatcher.RunTests(
-      tests, runner_factory, devices, shard=True, test_timeout=None,
-      num_retries=args.num_retries)
-
-  report_results.LogFull(
-      results=results,
-      test_type='UIAutomator',
-      test_package=os.path.basename(args.test_jar),
-      annotation=args.annotations,
-      flakiness_server=args.flakiness_dashboard_server)
-
-  if args.json_results_file:
-    json_results.GenerateJsonResultsFile(results, args.json_results_file)
-
-  return exit_code
-
-
-def _RunJUnitTests(args):
-  """Subcommand of RunTestsCommand which runs junit tests."""
-  runner_factory, tests = junit_setup.Setup(args)
-  results, exit_code = junit_dispatcher.RunTests(tests, runner_factory)
-
-  report_results.LogFull(
-      results=results,
-      test_type='JUnit',
-      test_package=args.test_suite)
-
-  if args.json_results_file:
-    json_results.GenerateJsonResultsFile(results, args.json_results_file)
-
-  return exit_code
-
-
-def _RunMonkeyTests(args, devices):
-  """Subcommand of RunTestsCommands which runs monkey tests."""
-  monkey_options = ProcessMonkeyTestOptions(args)
-
-  runner_factory, tests = monkey_setup.Setup(monkey_options)
-
-  results, exit_code = test_dispatcher.RunTests(
-      tests, runner_factory, devices, shard=False, test_timeout=None,
-      num_retries=args.num_retries)
-
-  report_results.LogFull(
-      results=results,
-      test_type='Monkey',
-      test_package='Monkey')
-
-  if args.json_results_file:
-    json_results.GenerateJsonResultsFile(results, args.json_results_file)
-
-  return exit_code
-
-
-def _RunPerfTests(args):
-  """Subcommand of RunTestsCommands which runs perf tests."""
-  perf_options = ProcessPerfTestOptions(args)
-
-  # Just save a simple json with a list of test names.
-  if perf_options.output_json_list:
-    return perf_test_runner.OutputJsonList(
-        perf_options.steps, perf_options.output_json_list)
-
-  # Just print the results from a single previously executed step.
-  if perf_options.print_step:
-    return perf_test_runner.PrintTestOutput(
-        perf_options.print_step, perf_options.output_chartjson_data)
-
-  runner_factory, tests, devices = perf_setup.Setup(perf_options)
-
-  # shard=False means that each device will get the full list of tests
-  # and then each one will decide their own affinity.
-  # shard=True means each device will pop the next test available from a queue,
-  # which increases throughput but have no affinity.
-  results, _ = test_dispatcher.RunTests(
-      tests, runner_factory, devices, shard=False, test_timeout=None,
-      num_retries=args.num_retries)
-
-  report_results.LogFull(
-      results=results,
-      test_type='Perf',
-      test_package='Perf')
-
-  if args.json_results_file:
-    json_results.GenerateJsonResultsFile(results, args.json_results_file)
-
-  if perf_options.single_step:
-    return perf_test_runner.PrintTestOutput('single_step')
-
-  perf_test_runner.PrintSummary(tests)
-
-  # Always return 0 on the sharding stage. Individual tests exit_code
-  # will be returned on the print_step stage.
-  return 0
-
-
-def _RunPythonTests(args):
-  """Subcommand of RunTestsCommand which runs python unit tests."""
-  suite_vars = constants.PYTHON_UNIT_TEST_SUITES[args.suite_name]
-  suite_path = suite_vars['path']
-  suite_test_modules = suite_vars['test_modules']
-
-  sys.path = [suite_path] + sys.path
-  try:
-    suite = unittest.TestSuite()
-    suite.addTests(unittest.defaultTestLoader.loadTestsFromName(m)
-                   for m in suite_test_modules)
-    runner = unittest.TextTestRunner(verbosity=1+args.verbose_count)
-    return 0 if runner.run(suite).wasSuccessful() else 1
-  finally:
-    sys.path = sys.path[1:]
-
-
-def _GetAttachedDevices(test_device=None):
-  """Get all attached devices.
-
-  Args:
-    test_device: Name of a specific device to use.
-
-  Returns:
-    A list of attached devices.
-  """
-  attached_devices = device_utils.DeviceUtils.HealthyDevices()
-  if test_device:
-    test_device = [d for d in attached_devices if d == test_device]
-    if not test_device:
-      raise device_errors.DeviceUnreachableError(
-          'Did not find device %s among attached device. Attached devices: %s'
-          % (test_device, ', '.join(attached_devices)))
-    return test_device
-
-  else:
-    if not attached_devices:
-      raise device_errors.NoDevicesError()
-    return sorted(attached_devices)
-
-
-def RunTestsCommand(args, parser):
-  """Checks test type and dispatches to the appropriate function.
-
-  Args:
-    args: argparse.Namespace object.
-    parser: argparse.ArgumentParser object.
-
-  Returns:
-    Integer indicated exit code.
-
-  Raises:
-    Exception: Unknown command name passed in, or an exception from an
-        individual test runner.
-  """
-  command = args.command
-
-  ProcessCommonOptions(args)
-
-  if args.enable_platform_mode:
-    return RunTestsInPlatformMode(args, parser)
-
-  if command in constants.LOCAL_MACHINE_TESTS:
-    devices = []
-  else:
-    devices = _GetAttachedDevices(args.test_device)
-
-  forwarder.Forwarder.RemoveHostLog()
-  if not ports.ResetTestServerPortAllocation():
-    raise Exception('Failed to reset test server port.')
-
-  if command == 'gtest':
-    if args.suite_name[0] in gtest_test_instance.BROWSER_TEST_SUITES:
-      return RunTestsInPlatformMode(args, parser)
-    return _RunGTests(args, devices)
-  elif command == 'linker':
-    return _RunLinkerTests(args, devices)
-  elif command == 'instrumentation':
-    return _RunInstrumentationTests(args, devices)
-  elif command == 'uiautomator':
-    return _RunUIAutomatorTests(args, devices)
-  elif command == 'junit':
-    return _RunJUnitTests(args)
-  elif command == 'monkey':
-    return _RunMonkeyTests(args, devices)
-  elif command == 'perf':
-    return _RunPerfTests(args)
-  elif command == 'python':
-    return _RunPythonTests(args)
-  else:
-    raise Exception('Unknown test type.')
-
-
-_SUPPORTED_IN_PLATFORM_MODE = [
-  # TODO(jbudorick): Add support for more test types.
-  'gtest',
-  'instrumentation',
-  'uirobot',
-]
-
-
-def RunTestsInPlatformMode(args, parser):
-
-  if args.command not in _SUPPORTED_IN_PLATFORM_MODE:
-    parser.error('%s is not yet supported in platform mode' % args.command)
-
-  with environment_factory.CreateEnvironment(args, parser.error) as env:
-    with test_instance_factory.CreateTestInstance(args, parser.error) as test:
-      with test_run_factory.CreateTestRun(
-          args, env, test, parser.error) as test_run:
-        results = test_run.RunTests()
-
-        if args.environment == 'remote_device' and args.trigger:
-          return 0 # Not returning results, only triggering.
-
-        report_results.LogFull(
-            results=results,
-            test_type=test.TestType(),
-            test_package=test_run.TestPackage(),
-            annotation=getattr(args, 'annotations', None),
-            flakiness_server=getattr(args, 'flakiness_dashboard_server', None))
-
-        if args.json_results_file:
-          json_results.GenerateJsonResultsFile(
-              results, args.json_results_file)
-
-  return 0 if results.DidRunPass() else constants.ERROR_EXIT_CODE
-
-
-CommandConfigTuple = collections.namedtuple(
-    'CommandConfigTuple',
-    ['add_options_func', 'help_txt'])
-VALID_COMMANDS = {
-    'gtest': CommandConfigTuple(
-        AddGTestOptions,
-        'googletest-based C++ tests'),
-    'instrumentation': CommandConfigTuple(
-        AddInstrumentationTestOptions,
-        'InstrumentationTestCase-based Java tests'),
-    'uiautomator': CommandConfigTuple(
-        AddUIAutomatorTestOptions,
-        "Tests that run via Android's uiautomator command"),
-    'junit': CommandConfigTuple(
-        AddJUnitTestOptions,
-        'JUnit4-based Java tests'),
-    'monkey': CommandConfigTuple(
-        AddMonkeyTestOptions,
-        "Tests based on Android's monkey"),
-    'perf': CommandConfigTuple(
-        AddPerfTestOptions,
-        'Performance tests'),
-    'python': CommandConfigTuple(
-        AddPythonTestOptions,
-        'Python tests based on unittest.TestCase'),
-    'linker': CommandConfigTuple(
-        AddLinkerTestOptions,
-        'Linker tests'),
-    'uirobot': CommandConfigTuple(
-        AddUirobotTestOptions,
-        'Uirobot test'),
-}
-
-
-def DumpThreadStacks(_signal, _frame):
-  for thread in threading.enumerate():
-    reraiser_thread.LogThreadStack(thread)
-
-
-def main():
-  signal.signal(signal.SIGUSR1, DumpThreadStacks)
-
-  parser = argparse.ArgumentParser()
-  command_parsers = parser.add_subparsers(title='test types',
-                                          dest='command')
-
-  for test_type, config in sorted(VALID_COMMANDS.iteritems(),
-                                  key=lambda x: x[0]):
-    subparser = command_parsers.add_parser(
-        test_type, usage='%(prog)s [options]', help=config.help_txt)
-    config.add_options_func(subparser)
-
-  args = parser.parse_args()
-
-  try:
-    return RunTestsCommand(args, parser)
-  except base_error.BaseError as e:
-    logging.exception('Error occurred.')
-    if e.is_infra_error:
-      return constants.INFRA_EXIT_CODE
-    return constants.ERROR_EXIT_CODE
-  except: # pylint: disable=W0702
-    logging.exception('Unrecognized error occurred.')
-    return constants.ERROR_EXIT_CODE
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/android/tests/symbolize/Makefile b/build/android/tests/symbolize/Makefile
deleted file mode 100644
index 5178a04..0000000
--- a/build/android/tests/symbolize/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-TOOLCHAIN=../../../../third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
-CXX=$(TOOLCHAIN)g++
-
-lib%.so: %.cc
-	$(CXX) -nostdlib -g -fPIC -shared $< -o $@
-
-all: liba.so libb.so
diff --git a/build/android/tests/symbolize/a.cc b/build/android/tests/symbolize/a.cc
deleted file mode 100644
index f0c7ca4..0000000
--- a/build/android/tests/symbolize/a.cc
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-class A {
- public:
-  A();
-  void Foo(int i);
-  void Bar(const char* c);
-};
-
-A::A() {}
-void A::Foo(int i) {}
-void A::Bar(const char* c) {}
diff --git a/build/android/tests/symbolize/b.cc b/build/android/tests/symbolize/b.cc
deleted file mode 100644
index db87520..0000000
--- a/build/android/tests/symbolize/b.cc
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-class B {
- public:
-  B();
-  void Baz(float f);
-  void Qux(double d);
-};
-
-B::B() {}
-void B::Baz(float f) {}
-void B::Qux(double d) {}
diff --git a/build/android/tests/symbolize/liba.so b/build/android/tests/symbolize/liba.so
deleted file mode 100644
index 79cb739..0000000
--- a/build/android/tests/symbolize/liba.so
+++ /dev/null
Binary files differ
diff --git a/build/android/tests/symbolize/libb.so b/build/android/tests/symbolize/libb.so
deleted file mode 100644
index 7cf01d4..0000000
--- a/build/android/tests/symbolize/libb.so
+++ /dev/null
Binary files differ
diff --git a/build/android/tombstones.py b/build/android/tombstones.py
deleted file mode 100755
index dbfe3f7..0000000
--- a/build/android/tombstones.py
+++ /dev/null
@@ -1,252 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-# Find the most recent tombstone file(s) on all connected devices
-# and prints their stacks.
-#
-# Assumes tombstone file was created with current symbols.
-
-import datetime
-import itertools
-import logging
-import multiprocessing
-import os
-import re
-import subprocess
-import sys
-import optparse
-
-from pylib.device import adb_wrapper
-from pylib.device import device_errors
-from pylib.device import device_utils
-from pylib.utils import run_tests_helper
-
-
-_TZ_UTC = {'TZ': 'UTC'}
-
-def _ListTombstones(device):
-  """List the tombstone files on the device.
-
-  Args:
-    device: An instance of DeviceUtils.
-
-  Yields:
-    Tuples of (tombstone filename, date time of file on device).
-  """
-  try:
-    lines = device.RunShellCommand(
-        ['ls', '-a', '-l', '/data/tombstones'],
-        as_root=True, check_return=True, env=_TZ_UTC, timeout=60)
-    for line in lines:
-      if 'tombstone' in line and not 'No such file or directory' in line:
-        details = line.split()
-        t = datetime.datetime.strptime(details[-3] + ' ' + details[-2],
-                                       '%Y-%m-%d %H:%M')
-        yield details[-1], t
-  except device_errors.CommandFailedError:
-    logging.exception('Could not retrieve tombstones.')
-
-
-def _GetDeviceDateTime(device):
-  """Determine the date time on the device.
-
-  Args:
-    device: An instance of DeviceUtils.
-
-  Returns:
-    A datetime instance.
-  """
-  device_now_string = device.RunShellCommand(
-      ['date'], check_return=True, env=_TZ_UTC)
-  return datetime.datetime.strptime(
-      device_now_string[0], '%a %b %d %H:%M:%S %Z %Y')
-
-
-def _GetTombstoneData(device, tombstone_file):
-  """Retrieve the tombstone data from the device
-
-  Args:
-    device: An instance of DeviceUtils.
-    tombstone_file: the tombstone to retrieve
-
-  Returns:
-    A list of lines
-  """
-  return device.ReadFile(
-      '/data/tombstones/' + tombstone_file, as_root=True).splitlines()
-
-
-def _EraseTombstone(device, tombstone_file):
-  """Deletes a tombstone from the device.
-
-  Args:
-    device: An instance of DeviceUtils.
-    tombstone_file: the tombstone to delete.
-  """
-  return device.RunShellCommand(
-      ['rm', '/data/tombstones/' + tombstone_file],
-      as_root=True, check_return=True)
-
-
-def _DeviceAbiToArch(device_abi):
-  # The order of this list is significant to find the more specific match (e.g.,
-  # arm64) before the less specific (e.g., arm).
-  arches = ['arm64', 'arm', 'x86_64', 'x86_64', 'x86', 'mips']
-  for arch in arches:
-    if arch in device_abi:
-      return arch
-  raise RuntimeError('Unknown device ABI: %s' % device_abi)
-
-def _ResolveSymbols(tombstone_data, include_stack, device_abi):
-  """Run the stack tool for given tombstone input.
-
-  Args:
-    tombstone_data: a list of strings of tombstone data.
-    include_stack: boolean whether to include stack data in output.
-    device_abi: the default ABI of the device which generated the tombstone.
-
-  Yields:
-    A string for each line of resolved stack output.
-  """
-  # Check if the tombstone data has an ABI listed, if so use this in preference
-  # to the device's default ABI.
-  for line in tombstone_data:
-    found_abi = re.search('ABI: \'(.+?)\'', line)
-    if found_abi:
-      device_abi = found_abi.group(1)
-  arch = _DeviceAbiToArch(device_abi)
-  if not arch:
-    return
-
-  stack_tool = os.path.join(os.path.dirname(__file__), '..', '..',
-                            'third_party', 'android_platform', 'development',
-                            'scripts', 'stack')
-  proc = subprocess.Popen([stack_tool, '--arch', arch], stdin=subprocess.PIPE,
-                          stdout=subprocess.PIPE)
-  output = proc.communicate(input='\n'.join(tombstone_data))[0]
-  for line in output.split('\n'):
-    if not include_stack and 'Stack Data:' in line:
-      break
-    yield line
-
-
-def _ResolveTombstone(tombstone):
-  lines = []
-  lines += [tombstone['file'] + ' created on ' + str(tombstone['time']) +
-            ', about this long ago: ' +
-            (str(tombstone['device_now'] - tombstone['time']) +
-            ' Device: ' + tombstone['serial'])]
-  logging.info('\n'.join(lines))
-  logging.info('Resolving...')
-  lines += _ResolveSymbols(tombstone['data'], tombstone['stack'],
-                           tombstone['device_abi'])
-  return lines
-
-
-def _ResolveTombstones(jobs, tombstones):
-  """Resolve a list of tombstones.
-
-  Args:
-    jobs: the number of jobs to use with multiprocess.
-    tombstones: a list of tombstones.
-  """
-  if not tombstones:
-    logging.warning('No tombstones to resolve.')
-    return
-  if len(tombstones) == 1:
-    data = [_ResolveTombstone(tombstones[0])]
-  else:
-    pool = multiprocessing.Pool(processes=jobs)
-    data = pool.map(_ResolveTombstone, tombstones)
-  for tombstone in data:
-    for line in tombstone:
-      logging.info(line)
-
-
-def _GetTombstonesForDevice(device, options):
-  """Returns a list of tombstones on a given device.
-
-  Args:
-    device: An instance of DeviceUtils.
-    options: command line arguments from OptParse
-  """
-  ret = []
-  all_tombstones = list(_ListTombstones(device))
-  if not all_tombstones:
-    logging.warning('No tombstones.')
-    return ret
-
-  # Sort the tombstones in date order, descending
-  all_tombstones.sort(cmp=lambda a, b: cmp(b[1], a[1]))
-
-  # Only resolve the most recent unless --all-tombstones given.
-  tombstones = all_tombstones if options.all_tombstones else [all_tombstones[0]]
-
-  device_now = _GetDeviceDateTime(device)
-  try:
-    for tombstone_file, tombstone_time in tombstones:
-      ret += [{'serial': str(device),
-               'device_abi': device.product_cpu_abi,
-               'device_now': device_now,
-               'time': tombstone_time,
-               'file': tombstone_file,
-               'stack': options.stack,
-               'data': _GetTombstoneData(device, tombstone_file)}]
-  except device_errors.CommandFailedError:
-    for line in device.RunShellCommand(
-        ['ls', '-a', '-l', '/data/tombstones'],
-        as_root=True, check_return=True, env=_TZ_UTC, timeout=60):
-      logging.info('%s: %s', str(device), line)
-    raise
-
-  # Erase all the tombstones if desired.
-  if options.wipe_tombstones:
-    for tombstone_file, _ in all_tombstones:
-      _EraseTombstone(device, tombstone_file)
-
-  return ret
-
-
-def main():
-  custom_handler = logging.StreamHandler(sys.stdout)
-  custom_handler.setFormatter(run_tests_helper.CustomFormatter())
-  logging.getLogger().addHandler(custom_handler)
-  logging.getLogger().setLevel(logging.INFO)
-
-  parser = optparse.OptionParser()
-  parser.add_option('--device',
-                    help='The serial number of the device. If not specified '
-                         'will use all devices.')
-  parser.add_option('-a', '--all-tombstones', action='store_true',
-                    help="""Resolve symbols for all tombstones, rather than just
-                         the most recent""")
-  parser.add_option('-s', '--stack', action='store_true',
-                    help='Also include symbols for stack data')
-  parser.add_option('-w', '--wipe-tombstones', action='store_true',
-                    help='Erase all tombstones from device after processing')
-  parser.add_option('-j', '--jobs', type='int',
-                    default=4,
-                    help='Number of jobs to use when processing multiple '
-                         'crash stacks.')
-  options, _ = parser.parse_args()
-
-  if options.device:
-    devices = [device_utils.DeviceUtils(options.device)]
-  else:
-    devices = device_utils.DeviceUtils.HealthyDevices()
-
-  # This must be done serially because strptime can hit a race condition if
-  # used for the first time in a multithreaded environment.
-  # http://bugs.python.org/issue7980
-  tombstones = []
-  for device in devices:
-    tombstones += _GetTombstonesForDevice(device, options)
-
-  _ResolveTombstones(options.jobs, tombstones)
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/android/update_verification.py b/build/android/update_verification.py
deleted file mode 100755
index 05d083b..0000000
--- a/build/android/update_verification.py
+++ /dev/null
@@ -1,108 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Runs semi-automated update testing on a non-rooted device.
-
-This script will help verify that app data is preserved during an update.
-To use this script first run it with the create_app_data option.
-
-./update_verification.py create_app_data --old-apk <path> --app-data <path>
-
-The script will then install the old apk, prompt you to create some app data
-(bookmarks, etc.), and then save the app data in the path you gave it.
-
-Next, once you have some app data saved, run this script with the test_update
-option.
-
-./update_verification.py test_update --old-apk <path> --new-apk <path>
---app-data <path>
-
-This will install the old apk, load the saved app data, install the new apk,
-and ask the user to verify that all of the app data was preserved.
-"""
-
-import argparse
-import logging
-import os
-import sys
-import time
-
-from pylib import constants
-from pylib.device import device_errors
-from pylib.device import device_utils
-from pylib.utils import apk_helper
-from pylib.utils import run_tests_helper
-
-def CreateAppData(device, old_apk, app_data, package_name):
-  device.Install(old_apk)
-  raw_input('Set the application state. Once ready, press enter and '
-            'select "Backup my data" on the device.')
-  device.adb.Backup(app_data, packages=[package_name])
-  logging.critical('Application data saved to %s' % app_data)
-
-def TestUpdate(device, old_apk, new_apk, app_data, package_name):
-  device.Install(old_apk)
-  device.adb.Restore(app_data)
-  # Restore command is not synchronous
-  raw_input('Select "Restore my data" on the device. Then press enter to '
-            'continue.')
-  device_path = device.GetApplicationPaths(package_name)
-  if not device_path:
-    raise Exception('Expected package %s to already be installed. '
-                    'Package name might have changed!' % package_name)
-
-  logging.info('Verifying that %s can be overinstalled.', new_apk)
-  device.adb.Install(new_apk, reinstall=True)
-  logging.critical('Successfully updated to the new apk. Please verify that '
-                   'the application data is preserved.')
-
-def main():
-  parser = argparse.ArgumentParser(
-      description="Script to do semi-automated upgrade testing.")
-  parser.add_argument('-v', '--verbose', action='count',
-                      help='Print verbose log information.')
-  command_parsers = parser.add_subparsers(dest='command')
-
-  subparser = command_parsers.add_parser('create_app_data')
-  subparser.add_argument('--old-apk', required=True,
-                         help='Path to apk to update from.')
-  subparser.add_argument('--app-data', required=True,
-                         help='Path to where the app data backup should be '
-                           'saved to.')
-  subparser.add_argument('--package-name',
-                         help='Chrome apk package name.')
-
-  subparser = command_parsers.add_parser('test_update')
-  subparser.add_argument('--old-apk', required=True,
-                         help='Path to apk to update from.')
-  subparser.add_argument('--new-apk', required=True,
-                         help='Path to apk to update to.')
-  subparser.add_argument('--app-data', required=True,
-                         help='Path to where the app data backup is saved.')
-  subparser.add_argument('--package-name',
-                         help='Chrome apk package name.')
-
-  args = parser.parse_args()
-  run_tests_helper.SetLogLevel(args.verbose)
-
-  devices = device_utils.DeviceUtils.HealthyDevices()
-  if not devices:
-    raise device_errors.NoDevicesError()
-  device = devices[0]
-  logging.info('Using device %s for testing.' % str(device))
-
-  package_name = (args.package_name if args.package_name
-                  else apk_helper.GetPackageName(args.old_apk))
-  if args.command == 'create_app_data':
-    CreateAppData(device, args.old_apk, args.app_data, package_name)
-  elif args.command == 'test_update':
-    TestUpdate(
-        device, args.old_apk, args.new_apk, args.app_data, package_name)
-  else:
-    raise Exception('Unknown test command: %s' % args.command)
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/android/write_ordered_libraries.gypi b/build/android/write_ordered_libraries.gypi
deleted file mode 100644
index 1b52e71..0000000
--- a/build/android/write_ordered_libraries.gypi
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into an action to provide a rule that
-# generates a json file with the list of dependent libraries needed for a given
-# shared library or executable.
-#
-# To use this, create a gyp target with the following form:
-#  {
-#    'actions': [
-#      'variables': {
-#        'input_libraries': 'shared library or executable to process',
-#        'ordered_libraries_file': 'file to generate'
-#      },
-#      'includes': [ '../../build/android/write_ordered_libraries.gypi' ],
-#    ],
-#  },
-#
-
-{
-  'action_name': 'ordered_libraries_<(_target_name)<(subtarget)',
-  'message': 'Writing dependency ordered libraries for <(_target_name)',
-  'variables': {
-    'input_libraries%': [],
-    'subtarget%': '',
-  },
-  'inputs': [
-    '<(DEPTH)/build/android/gyp/util/build_utils.py',
-    '<(DEPTH)/build/android/gyp/write_ordered_libraries.py',
-    '<@(input_libraries)',
-  ],
-  'outputs': [
-    '<(ordered_libraries_file)',
-  ],
-  'action': [
-    'python', '<(DEPTH)/build/android/gyp/write_ordered_libraries.py',
-    '--input-libraries=<(input_libraries)',
-    '--libraries-dir=<(SHARED_LIB_DIR),<(PRODUCT_DIR)',
-    '--readelf=<(android_readelf)',
-    '--output=<(ordered_libraries_file)',
-  ],
-}
diff --git a/build/android_sdk_extras.json b/build/android_sdk_extras.json
deleted file mode 100644
index 25b47c3..0000000
--- a/build/android_sdk_extras.json
+++ /dev/null
@@ -1,9 +0,0 @@
-[
-  {
-    "dir_name": "google",
-    "version": "21.0.0",
-    "zip": "google_google_play_services_21.0.0.zip",
-    "package": "google_play_services",
-    "package_id": "extra-google-google_play_services"
-  }
-]
diff --git a/build/apk_browsertest.gypi b/build/apk_browsertest.gypi
deleted file mode 100644
index 316f52f..0000000
--- a/build/apk_browsertest.gypi
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into a target to provide a rule
-# to build APK-based browser test suites.
-#
-# To use this, create a gyp target with the following form:
-# {
-#   'target_name': 'test_suite_name_apk',
-#   'type': 'none',
-#   'variables': {
-#     'test_suite_name': 'test_suite_name',  # string
-#     'java_in_dir': 'path/to/java/dir',
-#   },
-#   'includes': ['path/to/this/gypi/file'],
-# }
-#
-
-{
-  'dependencies': [
-    '<(DEPTH)/base/base.gyp:base_java',
-    '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_commands',
-    '<(DEPTH)/build/android/pylib/remote/device/dummy/dummy.gyp:remote_device_dummy_apk',
-    '<(DEPTH)/testing/android/appurify_support.gyp:appurify_support_java',
-    '<(DEPTH)/testing/android/native_test.gyp:native_test_java',
-    '<(DEPTH)/tools/android/android_tools.gyp:android_tools',
-  ],
-  'conditions': [
-     ['OS == "android"', {
-       'variables': {
-         # These are used to configure java_apk.gypi included below.
-         'apk_name': '<(test_suite_name)',
-         'intermediate_dir': '<(PRODUCT_DIR)/<(test_suite_name)_apk',
-         'final_apk_path': '<(intermediate_dir)/<(test_suite_name)-debug.apk',
-         'native_lib_target': 'lib<(test_suite_name)',
-         # TODO(yfriedman, cjhopman): Support managed installs for gtests.
-         'gyp_managed_install': 0,
-       },
-       'includes': [ 'java_apk.gypi' ],
-     }],  # 'OS == "android"
-  ],  # conditions
-}
diff --git a/build/apk_fake_jar.gypi b/build/apk_fake_jar.gypi
deleted file mode 100644
index 128b84c..0000000
--- a/build/apk_fake_jar.gypi
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into a target to provide a rule
-# to build Java in a consistent manner.
-
-{
-  'all_dependent_settings': {
-    'variables': {
-      'input_jars_paths': ['>(apk_output_jar_path)'],
-      'library_dexed_jars_paths': ['>(apk_output_jar_path)'],
-    },
-  },
-}
diff --git a/build/apk_test.gypi b/build/apk_test.gypi
deleted file mode 100644
index e0d323f..0000000
--- a/build/apk_test.gypi
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into a target to provide a rule
-# to build APK based test suites.
-#
-# To use this, create a gyp target with the following form:
-# {
-#   'target_name': 'test_suite_name_apk',
-#   'type': 'none',
-#   'variables': {
-#     'test_suite_name': 'test_suite_name',  # string
-#     'input_jars_paths': ['/path/to/test_suite.jar', ... ],  # list
-#   },
-#   'includes': ['path/to/this/gypi/file'],
-# }
-#
-
-{
-  'dependencies': [
-    '<(DEPTH)/base/base.gyp:base_java',
-    '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_commands',
-    '<(DEPTH)/build/android/pylib/remote/device/dummy/dummy.gyp:remote_device_dummy_apk',
-    '<(DEPTH)/testing/android/appurify_support.gyp:appurify_support_java',
-    '<(DEPTH)/testing/android/on_device_instrumentation.gyp:reporter_java',
-    '<(DEPTH)/tools/android/android_tools.gyp:android_tools',
-  ],
-  'conditions': [
-     ['OS == "android"', {
-       'variables': {
-         # These are used to configure java_apk.gypi included below.
-         'test_type': 'gtest',
-         'apk_name': '<(test_suite_name)',
-         'intermediate_dir': '<(PRODUCT_DIR)/<(test_suite_name)_apk',
-         'final_apk_path': '<(intermediate_dir)/<(test_suite_name)-debug.apk',
-         'java_in_dir': '<(DEPTH)/testing/android/native_test/java',
-         'native_lib_target': 'lib<(test_suite_name)',
-         # TODO(yfriedman, cjhopman): Support managed installs for gtests.
-         'gyp_managed_install': 0,
-       },
-       'includes': [ 'java_apk.gypi', 'android/test_runner.gypi' ],
-     }],  # 'OS == "android"
-  ],  # conditions
-}
diff --git a/build/apply_locales.py b/build/apply_locales.py
deleted file mode 100755
index 6af7280..0000000
--- a/build/apply_locales.py
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2009 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# TODO: remove this script when GYP has for loops
-
-import sys
-import optparse
-
-def main(argv):
-
-  parser = optparse.OptionParser()
-  usage = 'usage: %s [options ...] format_string locale_list'
-  parser.set_usage(usage.replace('%s', '%prog'))
-  parser.add_option('-d', dest='dash_to_underscore', action="store_true",
-                    default=False,
-                    help='map "en-US" to "en" and "-" to "_" in locales')
-
-  (options, arglist) = parser.parse_args(argv)
-
-  if len(arglist) < 3:
-    print 'ERROR: need string and list of locales'
-    return 1
-
-  str_template = arglist[1]
-  locales = arglist[2:]
-
-  results = []
-  for locale in locales:
-    # For Cocoa to find the locale at runtime, it needs to use '_' instead
-    # of '-' (http://crbug.com/20441).  Also, 'en-US' should be represented
-    # simply as 'en' (http://crbug.com/19165, http://crbug.com/25578).
-    if options.dash_to_underscore:
-      if locale == 'en-US':
-        locale = 'en'
-      locale = locale.replace('-', '_')
-    results.append(str_template.replace('ZZLOCALE', locale))
-
-  # Quote each element so filename spaces don't mess up GYP's attempt to parse
-  # it into a list.
-  print ' '.join(["'%s'" % x for x in results])
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv))
diff --git a/build/branding_value.sh b/build/branding_value.sh
deleted file mode 100755
index 9fcb550..0000000
--- a/build/branding_value.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/sh
-
-# Copyright (c) 2008 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This is a wrapper for fetching values from the BRANDING files.  Pass the
-# value of GYP's branding variable followed by the key you want and the right
-# file is checked.
-#
-#  branding_value.sh Chromium COPYRIGHT
-#  branding_value.sh Chromium PRODUCT_FULLNAME
-#
-
-set -e
-
-if [ $# -ne 2 ] ;  then
-  echo "error: expect two arguments, branding and key" >&2
-  exit 1
-fi
-
-BUILD_BRANDING=$1
-THE_KEY=$2
-
-pushd $(dirname "${0}") > /dev/null
-BUILD_DIR=$(pwd)
-popd > /dev/null
-
-TOP="${BUILD_DIR}/.."
-
-case ${BUILD_BRANDING} in
-  Chromium)
-    BRANDING_FILE="${TOP}/chrome/app/theme/chromium/BRANDING"
-    ;;
-  Chrome)
-    BRANDING_FILE="${TOP}/chrome/app/theme/google_chrome/BRANDING"
-    ;;
-  *)
-    echo "error: unknown branding: ${BUILD_BRANDING}" >&2
-    exit 1
-    ;;
-esac
-
-BRANDING_VALUE=$(sed -n -e "s/^${THE_KEY}=\(.*\)\$/\1/p" "${BRANDING_FILE}")
-
-if [ -z "${BRANDING_VALUE}" ] ; then
-  echo "error: failed to find key '${THE_KEY}'" >&2
-  exit 1
-fi
-
-echo "${BRANDING_VALUE}"
diff --git a/build/build-ctags.sh b/build/build-ctags.sh
deleted file mode 100755
index 61e017e..0000000
--- a/build/build-ctags.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/bash
-
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-if [[ a"`ctags --version | head -1 | grep \"^Exuberant Ctags\"`" == "a" ]]; then
-  cat <<EOF
-  You must be using Exuberant Ctags, not just standard GNU ctags. If you are on
-  Debian or a related flavor of Linux, you may want to try running
-  apt-get install exuberant-ctags.
-EOF
-  exit
-fi
-
-CHROME_SRC_DIR="$PWD"
-
-fail() {
-  echo "Failed to create ctags for $1"
-  exit 1
-}
-
-ctags_cmd() {
-  echo "ctags --languages=C++ $1 --exclude=.git -R -f .tmp_tags"
-}
-
-build_dir() {
-  local extraexcludes=""
-  if [[ a"$1" == "a--extra-excludes" ]]; then
-    extraexcludes="--exclude=third_party --exclude=build --exclude=out"
-    shift
-  fi
-
-  cd "$CHROME_SRC_DIR/$1" || fail $1
-  # Redirect error messages so they aren't seen because they are almost always
-  # errors about components that you just happen to have not built (NaCl, for
-  # example).
-  $(ctags_cmd "$extraexcludes") 2> /dev/null || fail $1
-  mv -f .tmp_tags tags
-}
-
-# We always build the top level but leave all submodules as optional.
-build_dir --extra-excludes "" "top level"
-
-# Build any other directies that are listed on the command line.
-for dir in $@; do
-  build_dir "$1"
-  shift
-done
diff --git a/build/build_config.h b/build/build_config.h
deleted file mode 100644
index d8c3db6..0000000
--- a/build/build_config.h
+++ /dev/null
@@ -1,168 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This file adds defines about the platform we're currently building on.
-//  Operating System:
-//    OS_WIN / OS_MACOSX / OS_LINUX / OS_POSIX (MACOSX or LINUX) /
-//    OS_NACL (NACL_SFI or NACL_NONSFI) / OS_NACL_SFI / OS_NACL_NONSFI
-//  Compiler:
-//    COMPILER_MSVC / COMPILER_GCC
-//  Processor:
-//    ARCH_CPU_X86 / ARCH_CPU_X86_64 / ARCH_CPU_X86_FAMILY (X86 or X86_64)
-//    ARCH_CPU_32_BITS / ARCH_CPU_64_BITS
-
-#ifndef BUILD_BUILD_CONFIG_H_
-#define BUILD_BUILD_CONFIG_H_
-
-// A set of macros to use for platform detection.
-#if defined(__native_client__)
-// __native_client__ must be first, so that other OS_ defines are not set.
-#define OS_NACL 1
-// OS_NACL comes in two sandboxing technology flavors, SFI or Non-SFI.
-// PNaCl toolchain defines __native_client_nonsfi__ macro in Non-SFI build
-// mode, while it does not in SFI build mode.
-#if defined(__native_client_nonsfi__)
-#define OS_NACL_NONSFI
-#else
-#define OS_NACL_SFI
-#endif
-#elif defined(ANDROID)
-#define OS_ANDROID 1
-#elif defined(__APPLE__)
-// only include TargetConditions after testing ANDROID as some android builds
-// on mac don't have this header available and it's not needed unless the target
-// is really mac/ios.
-#include <TargetConditionals.h>
-#define OS_MACOSX 1
-#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
-#define OS_IOS 1
-#endif  // defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
-#elif defined(__linux__)
-#define OS_LINUX 1
-// include a system header to pull in features.h for glibc/uclibc macros.
-#include <unistd.h>
-#if defined(__GLIBC__) && !defined(__UCLIBC__)
-// we really are using glibc, not uClibc pretending to be glibc
-#define LIBC_GLIBC 1
-#endif
-#elif defined(_WIN32)
-#define OS_WIN 1
-#define TOOLKIT_VIEWS 1
-#elif defined(__FreeBSD__)
-#define OS_FREEBSD 1
-#elif defined(__OpenBSD__)
-#define OS_OPENBSD 1
-#elif defined(__sun)
-#define OS_SOLARIS 1
-#elif defined(__QNXNTO__)
-#define OS_QNX 1
-#else
-#error Please add support for your platform in build/build_config.h
-#endif
-
-#if defined(USE_OPENSSL_CERTS) && defined(USE_NSS_CERTS)
-#error Cannot use both OpenSSL and NSS for certificates
-#endif
-
-// For access to standard BSD features, use OS_BSD instead of a
-// more specific macro.
-#if defined(OS_FREEBSD) || defined(OS_OPENBSD)
-#define OS_BSD 1
-#endif
-
-// For access to standard POSIXish features, use OS_POSIX instead of a
-// more specific macro.
-#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_FREEBSD) ||     \
-    defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(OS_ANDROID) ||  \
-    defined(OS_NACL) || defined(OS_QNX)
-#define OS_POSIX 1
-#endif
-
-// Use tcmalloc
-#if (defined(OS_WIN) || defined(OS_LINUX) || defined(OS_ANDROID)) && \
-    !defined(NO_TCMALLOC)
-#define USE_TCMALLOC 1
-#endif
-
-// Compiler detection.
-#if defined(__GNUC__)
-#define COMPILER_GCC 1
-#elif defined(_MSC_VER)
-#define COMPILER_MSVC 1
-#else
-#error Please add support for your compiler in build/build_config.h
-#endif
-
-// Processor architecture detection.  For more info on what's defined, see:
-//   http://msdn.microsoft.com/en-us/library/b0084kay.aspx
-//   http://www.agner.org/optimize/calling_conventions.pdf
-//   or with gcc, run: "echo | gcc -E -dM -"
-#if defined(_M_X64) || defined(__x86_64__)
-#define ARCH_CPU_X86_FAMILY 1
-#define ARCH_CPU_X86_64 1
-#define ARCH_CPU_64_BITS 1
-#define ARCH_CPU_LITTLE_ENDIAN 1
-#elif defined(_M_IX86) || defined(__i386__)
-#define ARCH_CPU_X86_FAMILY 1
-#define ARCH_CPU_X86 1
-#define ARCH_CPU_32_BITS 1
-#define ARCH_CPU_LITTLE_ENDIAN 1
-#elif defined(__ARMEL__)
-#define ARCH_CPU_ARM_FAMILY 1
-#define ARCH_CPU_ARMEL 1
-#define ARCH_CPU_32_BITS 1
-#define ARCH_CPU_LITTLE_ENDIAN 1
-#elif defined(__aarch64__)
-#define ARCH_CPU_ARM_FAMILY 1
-#define ARCH_CPU_ARM64 1
-#define ARCH_CPU_64_BITS 1
-#define ARCH_CPU_LITTLE_ENDIAN 1
-#elif defined(__pnacl__)
-#define ARCH_CPU_32_BITS 1
-#define ARCH_CPU_LITTLE_ENDIAN 1
-#elif defined(__MIPSEL__)
-#if defined(__LP64__)
-#define ARCH_CPU_MIPS64_FAMILY 1
-#define ARCH_CPU_MIPS64EL 1
-#define ARCH_CPU_64_BITS 1
-#define ARCH_CPU_LITTLE_ENDIAN 1
-#else
-#define ARCH_CPU_MIPS_FAMILY 1
-#define ARCH_CPU_MIPSEL 1
-#define ARCH_CPU_32_BITS 1
-#define ARCH_CPU_LITTLE_ENDIAN 1
-#endif
-#else
-#error Please add support for your architecture in build/build_config.h
-#endif
-
-// Type detection for wchar_t.
-#if defined(OS_WIN)
-#define WCHAR_T_IS_UTF16
-#elif defined(OS_POSIX) && defined(COMPILER_GCC) && \
-    defined(__WCHAR_MAX__) && \
-    (__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff)
-#define WCHAR_T_IS_UTF32
-#elif defined(OS_POSIX) && defined(COMPILER_GCC) && \
-    defined(__WCHAR_MAX__) && \
-    (__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff)
-// On Posix, we'll detect short wchar_t, but projects aren't guaranteed to
-// compile in this mode (in particular, Chrome doesn't). This is intended for
-// other projects using base who manage their own dependencies and make sure
-// short wchar works for them.
-#define WCHAR_T_IS_UTF16
-#else
-#error Please add support for your compiler in build/build_config.h
-#endif
-
-#if defined(OS_ANDROID)
-// The compiler thinks std::string::const_iterator and "const char*" are
-// equivalent types.
-#define STD_STRING_ITERATOR_IS_CHAR_POINTER
-// The compiler thinks base::string16::const_iterator and "char16*" are
-// equivalent types.
-#define BASE_STRING16_ITERATOR_IS_CHAR16_POINTER
-#endif
-
-#endif  // BUILD_BUILD_CONFIG_H_
diff --git a/build/check_return_value.py b/build/check_return_value.py
deleted file mode 100755
index c659d1e..0000000
--- a/build/check_return_value.py
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""This program wraps an arbitrary command and prints "1" if the command ran
-successfully."""
-
-import os
-import subprocess
-import sys
-
-devnull = open(os.devnull, 'wb')
-if not subprocess.call(sys.argv[1:], stdout=devnull, stderr=devnull):
-  print 1
-else:
-  print 0
diff --git a/build/check_sdk_extras_version.py b/build/check_sdk_extras_version.py
deleted file mode 100755
index 9b2f10d..0000000
--- a/build/check_sdk_extras_version.py
+++ /dev/null
@@ -1,131 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-'''Checks the status of an Android SDK package.
-
-Verifies the given package has been installed from the Android SDK Manager and
-that its version is at least the minimum version required by the project
-configuration.
-'''
-
-import argparse
-import json
-import os
-import re
-import sys
-
-
-COLORAMA_ROOT = os.path.join(os.path.dirname(__file__),
-                 os.pardir, 'third_party', 'colorama', 'src')
-
-sys.path.append(COLORAMA_ROOT)
-import colorama
-
-
-UDPATE_SCRIPT_PATH = 'build/install-android-sdks.sh'
-
-SDK_EXTRAS_JSON_FILE = os.path.join(os.path.dirname(__file__),
-                                    'android_sdk_extras.json')
-
-PACKAGE_VERSION_PATTERN = r'^Pkg\.Revision=(?P<version>\d+).*$'
-
-PKG_NOT_FOUND_MSG = ('Error while checking Android SDK extras versions. '
-                     'Could not find the "{package_id}" package in '
-                     '{checked_location}. Please run {script} to download it.')
-UPDATE_NEEDED_MSG = ('Error while checking Android SDK extras versions. '
-                     'Version {minimum_version} or greater is required for the '
-                     'package "{package_id}". Version {actual_version} found. '
-                     'Please run {script} to update it.')
-REQUIRED_VERSION_ERROR_MSG = ('Error while checking Android SDK extras '
-                              'versions. '
-                              'Could not retrieve the required version for '
-                              'package "{package_id}".')
-
-
-def main():
-  parser = argparse.ArgumentParser(description=__doc__)
-  parser.add_argument('--package-id',
-                      help=('id of the package to check for. The list of '
-                            'available packages and their ids can be obtained '
-                            'by running '
-                            'third_party/android_tools/sdk/tools/android list '
-                            'sdk --extended'))
-  parser.add_argument('--package-location',
-                      help='path to the package\'s expected install location.',
-                      metavar='DIR')
-  parser.add_argument('--stamp',
-                      help=('if specified, a stamp file will be created at the '
-                            'provided location.'),
-                      metavar='FILE')
-
-  args = parser.parse_args()
-
-  if not ShouldSkipVersionCheck():
-    minimum_version = GetRequiredMinimumVersion(args.package_id)
-    CheckPackageVersion(args.package_id, args.package_location, minimum_version)
-
-  # Create the stamp file.
-  if args.stamp:
-    with open(args.stamp, 'a'):
-      os.utime(args.stamp, None)
-
-  sys.exit(0)
-
-def ExitError(msg):
-  sys.exit(colorama.Fore.MAGENTA + colorama.Style.BRIGHT + msg +
-           colorama.Style.RESET_ALL)
-
-
-def GetRequiredMinimumVersion(package_id):
-  with open(SDK_EXTRAS_JSON_FILE, 'r') as json_file:
-    packages = json.load(json_file)
-
-  for package in packages:
-    if package['package_id'] == package_id:
-      return int(package['version'].split('.')[0])
-
-  ExitError(REQUIRED_VERSION_ERROR_MSG.format(package_id=package_id))
-
-
-def CheckPackageVersion(pkg_id, location, minimum_version):
-  version_file_path = os.path.join(location, 'source.properties')
-  # Extracts the version of the package described by the property file. We only
-  # care about the major version number here.
-  version_pattern = re.compile(PACKAGE_VERSION_PATTERN, re.MULTILINE)
-
-  if not os.path.isfile(version_file_path):
-    ExitError(PKG_NOT_FOUND_MSG.format(
-      package_id=pkg_id,
-      checked_location=location,
-      script=UDPATE_SCRIPT_PATH))
-
-  with open(version_file_path, 'r') as f:
-    match = version_pattern.search(f.read())
-
-    if not match:
-      ExitError(PKG_NOT_FOUND_MSG.format(
-        package_id=pkg_id,
-        checked_location=location,
-        script=UDPATE_SCRIPT_PATH))
-
-    pkg_version = int(match.group('version'))
-    if pkg_version < minimum_version:
-      ExitError(UPDATE_NEEDED_MSG.format(
-        package_id=pkg_id,
-        minimum_version=minimum_version,
-        actual_version=pkg_version,
-        script=UDPATE_SCRIPT_PATH))
-
-  # Everything looks ok, print nothing.
-
-def ShouldSkipVersionCheck():
-  '''
-  Bots should not run the version check, since they download the sdk extras
-  in a different way.
-  '''
-  return bool(os.environ.get('CHROME_HEADLESS'))
-
-if __name__ == '__main__':
-  main()
diff --git a/build/chrome_settings.gypi b/build/chrome_settings.gypi
deleted file mode 100644
index e9c7535..0000000
--- a/build/chrome_settings.gypi
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file contains settings for ../chrome/chrome.gyp that other gyp files
-# also use.
-{
-  'variables': {
-    # TODO: remove this helper when we have loops in GYP
-    'apply_locales_cmd': ['python', '<(DEPTH)/build/apply_locales.py'],
-
-    'conditions': [
-      ['OS=="mac"', {
-        'conditions': [
-          ['branding=="Chrome"', {
-            'mac_bundle_id': 'com.google.Chrome',
-            'mac_creator': 'rimZ',
-            # The policy .grd file also needs the bundle id.
-            'grit_defines': ['-D', 'mac_bundle_id=com.google.Chrome'],
-          }, {  # else: branding!="Chrome"
-            'mac_bundle_id': 'org.chromium.Chromium',
-            'mac_creator': 'Cr24',
-            # The policy .grd file also needs the bundle id.
-            'grit_defines': ['-D', 'mac_bundle_id=org.chromium.Chromium'],
-          }],  # branding
-        ],  # conditions
-      }],  # OS=="mac"
-    ],  # conditions
-  },  # variables
-}
diff --git a/build/clobber.py b/build/clobber.py
deleted file mode 100755
index 785011a..0000000
--- a/build/clobber.py
+++ /dev/null
@@ -1,110 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""This script provides methods for clobbering build directories."""
-
-import argparse
-import os
-import shutil
-import sys
-
-
-def extract_gn_build_commands(build_ninja_file):
-  """Extracts from a build.ninja the commands to run GN.
-
-  The commands to run GN are the gn rule and build.ninja build step at the
-  top of the build.ninja file. We want to keep these when deleting GN builds
-  since we want to preserve the command-line flags to GN.
-
-  On error, returns the empty string."""
-  result = ""
-  with open(build_ninja_file, 'r') as f:
-    # Read until the second blank line. The first thing GN writes to the file
-    # is the "rule gn" and the second is the section for "build build.ninja",
-    # separated by blank lines.
-    num_blank_lines = 0
-    while num_blank_lines < 2:
-      line = f.readline()
-      if len(line) == 0:
-        return ''  # Unexpected EOF.
-      result += line
-      if line[0] == '\n':
-        num_blank_lines = num_blank_lines + 1
-  return result
-
-
-def delete_build_dir(build_dir):
-  # GN writes a build.ninja.d file. Note that not all GN builds have args.gn.
-  build_ninja_d_file = os.path.join(build_dir, 'build.ninja.d')
-  if not os.path.exists(build_ninja_d_file):
-    shutil.rmtree(build_dir)
-    return
-
-  # GN builds aren't automatically regenerated when you sync. To avoid
-  # messing with the GN workflow, erase everything but the args file, and
-  # write a dummy build.ninja file that will automatically rerun GN the next
-  # time Ninja is run.
-  build_ninja_file = os.path.join(build_dir, 'build.ninja')
-  build_commands = extract_gn_build_commands(build_ninja_file)
-
-  try:
-    gn_args_file = os.path.join(build_dir, 'args.gn')
-    with open(gn_args_file, 'r') as f:
-      args_contents = f.read()
-  except IOError:
-    args_contents = ''
-
-  shutil.rmtree(build_dir)
-
-  # Put back the args file (if any).
-  os.mkdir(build_dir)
-  if args_contents != '':
-    with open(gn_args_file, 'w') as f:
-      f.write(args_contents)
-
-  # Write the build.ninja file sufficiently to regenerate itself.
-  with open(os.path.join(build_dir, 'build.ninja'), 'w') as f:
-    if build_commands != '':
-      f.write(build_commands)
-    else:
-      # Couldn't parse the build.ninja file, write a default thing.
-      f.write('''rule gn
-command = gn -q gen //out/%s/
-description = Regenerating ninja files
-
-build build.ninja: gn
-generator = 1
-depfile = build.ninja.d
-''' % (os.path.split(build_dir)[1]))
-
-  # Write a .d file for the build which references a nonexistant file. This
-  # will make Ninja always mark the build as dirty.
-  with open(build_ninja_d_file, 'w') as f:
-    f.write('build.ninja: nonexistant_file.gn\n')
-
-
-def clobber(out_dir):
-  """Clobber contents of build directory.
-
-  Don't delete the directory itself: some checkouts have the build directory
-  mounted."""
-  for f in os.listdir(out_dir):
-    path = os.path.join(out_dir, f)
-    if os.path.isfile(path):
-      os.unlink(path)
-    elif os.path.isdir(path):
-      delete_build_dir(path)
-
-
-def main():
-  parser = argparse.ArgumentParser()
-  parser.add_argument('out_dir', help='The output directory to clobber')
-  args = parser.parse_args()
-  clobber(args.out_dir)
-  return 0
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/common.croc b/build/common.croc
deleted file mode 100644
index fde7a8b..0000000
--- a/build/common.croc
+++ /dev/null
@@ -1,127 +0,0 @@
-# -*- python -*-
-# Crocodile config file for Chromium - settings common to all platforms
-#
-# This should be speicified before the platform-specific config, for example:
-#       croc -c chrome_common.croc -c linux/chrome_linux.croc
-
-{
-  # List of root directories, applied in order
-  'roots' : [
-    # Sub-paths we specifically care about and want to call out
-    {
-      'root' : '_/src',
-      'altname' : 'CHROMIUM',
-    },
-  ],
-
-  # List of rules, applied in order
-  # Note that any 'include':0 rules here will be overridden by the 'include':1
-  # rules in the platform-specific configs.
-  'rules' : [
-    # Don't scan for executable lines in uninstrumented C++ header files
-    {
-      'regexp' : '.*\\.(h|hpp)$',
-      'add_if_missing' : 0,
-    },
-
-    # Groups
-    {
-      'regexp' : '',
-      'group' : 'source',
-    },
-    {
-      'regexp' : '.*_(test|unittest|uitest|browsertest)\\.',
-      'group' : 'test',
-    },
-
-    # Languages
-    {
-      'regexp' : '.*\\.(c|h)$',
-      'language' : 'C',
-    },
-    {
-      'regexp' : '.*\\.(cc|cpp|hpp)$',
-      'language' : 'C++',
-    },
-
-    # Files/paths to include.  Specify these before the excludes, since rules
-    # are in order.
-    {
-      'regexp' : '^CHROMIUM/(base|media|net|printing|remoting|chrome|content|webkit/glue|native_client)/',
-      'include' : 1,
-    },
-    # Don't include subversion or mercurial SCM dirs
-    {
-      'regexp' : '.*/(\\.svn|\\.hg)/',
-      'include' : 0,
-    },
-    # Don't include output dirs
-    {
-      'regexp' : '.*/(Debug|Release|out|xcodebuild)/',
-      'include' : 0,
-    },
-    # Don't include third-party source
-    {
-      'regexp' : '.*/third_party/',
-      'include' : 0,
-    },
-    # We don't run the V8 test suite, so we don't care about V8 coverage.
-    {
-      'regexp' : '.*/v8/',
-      'include' : 0,
-    },
-  ],
-
-  # Paths to add source from
-  'add_files' : [
-    'CHROMIUM'
-  ],
-
-  # Statistics to print
-  'print_stats' : [
-    {
-      'stat' : 'files_executable',
-      'format' : '*RESULT FilesKnown: files_executable= %d files',
-    },
-    {
-      'stat' : 'files_instrumented',
-      'format' : '*RESULT FilesInstrumented: files_instrumented= %d files',
-    },
-    {
-      'stat' : '100.0 * files_instrumented / files_executable',
-      'format' : '*RESULT FilesInstrumentedPercent: files_instrumented_percent= %g percent',
-    },
-    {
-      'stat' : 'lines_executable',
-      'format' : '*RESULT LinesKnown: lines_known= %d lines',
-    },
-    {
-      'stat' : 'lines_instrumented',
-      'format' : '*RESULT LinesInstrumented: lines_instrumented= %d lines',
-    },
-    {
-      'stat' : 'lines_covered',
-      'format' : '*RESULT LinesCoveredSource: lines_covered_source= %d lines',
-      'group' : 'source',
-    },
-    {
-      'stat' : 'lines_covered',
-      'format' : '*RESULT LinesCoveredTest: lines_covered_test= %d lines',
-      'group' : 'test',
-    },
-    {
-      'stat' : '100.0 * lines_covered / lines_executable',
-      'format' : '*RESULT PercentCovered: percent_covered= %g percent',
-    },
-    {
-      'stat' : '100.0 * lines_covered / lines_executable',
-      'format' : '*RESULT PercentCoveredSource: percent_covered_source= %g percent',
-      'group' : 'source',
-    },
-    {
-      'stat' : '100.0 * lines_covered / lines_executable',
-      'format' : '*RESULT PercentCoveredTest: percent_covered_test= %g percent',
-      'group' : 'test',
-    },
-  ],
-}
diff --git a/build/common.gypi b/build/common.gypi
deleted file mode 100644
index 3a2df58..0000000
--- a/build/common.gypi
+++ /dev/null
@@ -1,6216 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# IMPORTANT:
-# Please don't directly include this file if you are building via gyp_chromium,
-# since gyp_chromium is automatically forcing its inclusion.
-{
-  # Variables expected to be overriden on the GYP command line (-D) or by
-  # ~/.gyp/include.gypi.
-  'variables': {
-    # Putting a variables dict inside another variables dict looks kind of
-    # weird.  This is done so that 'host_arch', 'chromeos', etc are defined as
-    # variables within the outer variables dict here.  This is necessary
-    # to get these variables defined for the conditions within this variables
-    # dict that operate on these variables.
-    'variables': {
-      'variables': {
-        'variables': {
-          'variables': {
-            # Whether we're building a ChromeOS build.
-            'chromeos%': 0,
-
-            # Whether we're building the cast (chromecast) shell
-            'chromecast%': 0,
-
-            # Whether or not we are using the Aura windowing framework.
-            'use_aura%': 0,
-
-            # Whether or not we are building the Ash shell.
-            'use_ash%': 0,
-
-            # Whether or not we are using CRAS, the ChromeOS Audio Server.
-            'use_cras%': 0,
-
-            # Use a raw surface abstraction.
-            'use_ozone%': 0,
-
-            # Configure the build for small devices. See crbug.com/318413
-            'embedded%': 0,
-
-            'conditions': [
-              # Compute the architecture that we're building on.
-              ['OS=="win" or OS=="ios"', {
-                'host_arch%': 'ia32',
-              }, {
-                'host_arch%': '<!pymod_do_main(detect_host_arch)',
-              }],
-            ],
-          },
-          # Copy conditionally-set variables out one scope.
-          'chromeos%': '<(chromeos)',
-          'chromecast%': '<(chromecast)',
-          'use_aura%': '<(use_aura)',
-          'use_ash%': '<(use_ash)',
-          'use_cras%': '<(use_cras)',
-          'use_ozone%': '<(use_ozone)',
-          'embedded%': '<(embedded)',
-          'host_arch%': '<(host_arch)',
-
-          # Whether we are using Views Toolkit
-          'toolkit_views%': 0,
-
-          # Use the PCI lib to collect GPU information.
-          'use_libpci%': 1,
-
-          # Use OpenSSL instead of NSS as the underlying SSL and crypto
-          # implementation. Certificate verification will in most cases be
-          # handled by the OS. If OpenSSL's struct X509 is used to represent
-          # certificates, use_openssl_certs must be set.
-          'use_openssl%': 1,
-
-          # Use OpenSSL for representing certificates. When targeting Android,
-          # the platform certificate library is used for certificate
-          # verification. On other targets, this flag also enables OpenSSL for
-          # certificate verification, but this configuration is unsupported.
-          'use_openssl_certs%': 0,
-
-          # Disable viewport meta tag by default.
-          'enable_viewport%': 0,
-
-          # Enable HiDPI support.
-          'enable_hidpi%': 0,
-
-          # Enable top chrome material design.
-          'enable_topchrome_md%' : 0,
-
-          # Force building against pre-built sysroot image on linux.  By default
-          # the sysroot image is only used for Official builds  or when cross
-          # compiling to arm or mips.
-          'use_sysroot%': 0,
-
-          # Override buildtype to select the desired build flavor.
-          # Dev - everyday build for development/testing
-          # Official - release build (generally implies additional processing)
-          # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
-          # conversion is done), some of the things which are now controlled by
-          # 'branding', such as symbol generation, will need to be refactored
-          # based on 'buildtype' (i.e. we don't care about saving symbols for
-          # non-Official # builds).
-          'buildtype%': 'Dev',
-
-          # Override branding to select the desired branding flavor.
-          'branding%': 'Chromium',
-
-          'conditions': [
-            # Windows and Linux (including Chrome OS) use Aura and Ash.
-            ['OS=="win" or OS=="linux"', {
-              'use_ash%': 1,
-              'use_aura%': 1,
-            }],
-
-            ['chromecast==1 and OS!="android"', {
-              'embedded%': 1,
-              'use_ozone%': 1,
-            }],
-
-            # Ozone uses Aura.
-            ['use_ozone==1', {
-              'use_aura%': 1,
-            }],
-
-            # Whether we're a traditional desktop unix.
-            ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', {
-              'desktop_linux%': 1,
-            }, {
-              'desktop_linux%': 0,
-            }],
-
-            # Embedded implies ozone.
-            ['embedded==1', {
-              'use_ozone%': 1,
-            }],
-
-            ['OS=="android"', {
-              'target_arch%': 'arm',
-            }, {
-              # Default architecture we're building for is the architecture we're
-              # building on, and possibly sub-architecture (for iOS builds).
-              'target_arch%': '<(host_arch)',
-            }],
-          ],
-        },
-        # Copy conditionally-set variables out one scope.
-        'chromeos%': '<(chromeos)',
-        'chromecast%': '<(chromecast)',
-        'desktop_linux%': '<(desktop_linux)',
-        'use_aura%': '<(use_aura)',
-        'use_ash%': '<(use_ash)',
-        'use_cras%': '<(use_cras)',
-        'use_ozone%': '<(use_ozone)',
-        'embedded%': '<(embedded)',
-        'use_libpci%': '<(use_libpci)',
-        'use_openssl%': '<(use_openssl)',
-        'use_openssl_certs%': '<(use_openssl_certs)',
-        'enable_viewport%': '<(enable_viewport)',
-        'enable_hidpi%': '<(enable_hidpi)',
-        'enable_topchrome_md%': '<(enable_topchrome_md)',
-        'buildtype%': '<(buildtype)',
-        'branding%': '<(branding)',
-        'branding_path_component%': '<(branding)',
-        'host_arch%': '<(host_arch)',
-        'target_arch%': '<(target_arch)',
-
-        'target_subarch%': '',
-
-        # The channel to build on Android: stable, beta, dev, canary, or
-        # default. "default" should be used on non-official builds.
-        'android_channel%': 'default',
-
-        # Set ARM architecture version.
-        'arm_version%': 7,
-
-        # Use aurax11 for clipboard implementation. This is true on linux_aura.
-        'use_clipboard_aurax11%': 0,
-
-        # goma settings.
-        # 1 to use goma.
-        # If no gomadir is set, it uses the default gomadir.
-        'use_goma%': 0,
-        'gomadir%': '',
-
-        # The system root for cross-compiles. Default: none.
-        'sysroot%': '',
-        'chroot_cmd%': '',
-
-        # The system libdir used for this ABI.
-        'system_libdir%': 'lib',
-
-        # Default MIPS arch variant. This is set in the conditions block
-        # below for MIPS targets.
-        'mips_arch_variant%': '',
-
-        # MIPS DSP ASE revision. Possible values are:
-        #   0: unavailable
-        #   1: revision 1
-        #   2: revision 2
-        'mips_dsp_rev%': 0,
-
-        'conditions': [
-          ['branding == "Chrome"', {
-            'branding_path_component%': 'google_chrome',
-          }],
-
-          ['branding == "Chromium"', {
-            'branding_path_component%': 'chromium',
-          }],
-
-          # Ash needs Aura.
-          ['use_aura==0', {
-            'use_ash%': 0,
-          }],
-
-          # Set default value of toolkit_views based on OS.
-          ['OS=="mac" or OS=="win" or chromeos==1 or use_aura==1', {
-            'toolkit_views%': 1,
-          }, {
-            'toolkit_views%': 0,
-          }],
-
-          # Embedded builds use aura without ash or views.
-          ['embedded==1', {
-            'use_aura%': 1,
-            'use_ash%': 0,
-            'toolkit_views%': 0,
-          }],
-
-          # Enable HiDPI on Mac OS, Windows and Linux (including Chrome OS).
-          ['OS=="mac" or OS=="win" or OS=="linux"', {
-            'enable_hidpi%': 1,
-          }],
-
-          # Enable Top Chrome Material Design on Chrome OS, Windows, and Linux.
-          ['chromeos==1 or OS=="win" or OS=="linux"', {
-            'enable_topchrome_md%': 1,
-          }],
-
-          # On iOS, use NSS rather than OpenSSL. See http://crbug.com/338886.
-          ['OS=="ios"', {
-            'use_openssl%': 0,
-          }],
-
-          # Enable App Launcher everywhere but mobile.
-          ['OS!="ios" and OS!="android"', {
-            'enable_app_list%': 1,
-          }, {
-            'enable_app_list%': 0,
-          }],
-
-          ['use_aura==1 and OS!="android"', {
-            'use_default_render_theme%': 1,
-          }, {
-            'use_default_render_theme%': 0,
-          }],
-
-          ['use_ozone==1', {
-            'use_ozone_evdev%': 1,
-          }, {
-            'use_ozone_evdev%': 0,
-          }],
-
-          # Set default gomadir.
-          ['OS=="win"', {
-            'gomadir': 'c:\\goma\\goma-win',
-          }, {
-            'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
-          }],
-
-          # Set the default "target_subarch" on iOS. Valid values are "arm32",
-          # "arm64" and "both" (meaning a fat binary).
-          ['OS=="ios"', {
-            'target_subarch%': 'arm64',
-          }],
-
-          # Set arch variants for MIPS platforms.
-          ['target_arch=="mips64el"', {
-            'conditions': [
-              ['OS=="android"', {
-                'mips_arch_variant%': 'r6',
-              }, {
-                'mips_arch_variant%': 'r2',
-              }],
-            ],
-          }],
-
-          ['target_arch=="mipsel"', {
-            'mips_arch_variant%': 'r1',
-          }],
-
-          ['OS=="linux" and target_arch=="arm" and chromeos==0', {
-            # sysroot needs to be an absolute path otherwise it generates
-            # incorrect results when passed to pkg-config
-            'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_wheezy_arm-sysroot',
-          }], # OS=="linux" and target_arch=="arm" and chromeos==0
-
-          ['OS=="linux" and ((branding=="Chrome" and buildtype=="Official" and chromeos==0) or use_sysroot==1)' , {
-            'conditions': [
-              ['target_arch=="x64"', {
-                'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_wheezy_amd64-sysroot',
-              }],
-              ['target_arch=="ia32"', {
-                'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_wheezy_i386-sysroot',
-              }],
-          ],
-          }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
-
-          ['OS=="linux" and target_arch=="mipsel"', {
-            'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
-          }],
-        ],
-      },
-
-      # Copy conditionally-set variables out one scope.
-      'chromeos%': '<(chromeos)',
-      'chromecast%': '<(chromecast)',
-      'host_arch%': '<(host_arch)',
-      'target_arch%': '<(target_arch)',
-      'target_subarch%': '<(target_subarch)',
-      'mips_arch_variant%': '<(mips_arch_variant)',
-      'mips_dsp_rev%': '<(mips_dsp_rev)',
-      'toolkit_views%': '<(toolkit_views)',
-      'desktop_linux%': '<(desktop_linux)',
-      'use_aura%': '<(use_aura)',
-      'use_ash%': '<(use_ash)',
-      'use_cras%': '<(use_cras)',
-      'use_libpci%': '<(use_libpci)',
-      'use_ozone%': '<(use_ozone)',
-      'use_ozone_evdev%': '<(use_ozone_evdev)',
-      'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
-      'embedded%': '<(embedded)',
-      'use_openssl%': '<(use_openssl)',
-      'use_openssl_certs%': '<(use_openssl_certs)',
-      'enable_viewport%': '<(enable_viewport)',
-      'enable_hidpi%': '<(enable_hidpi)',
-      'enable_topchrome_md%': '<(enable_topchrome_md)',
-      'android_channel%': '<(android_channel)',
-      'use_goma%': '<(use_goma)',
-      'gomadir%': '<(gomadir)',
-      'enable_app_list%': '<(enable_app_list)',
-      'use_default_render_theme%': '<(use_default_render_theme)',
-      'buildtype%': '<(buildtype)',
-      'branding%': '<(branding)',
-      'branding_path_component%': '<(branding_path_component)',
-      'arm_version%': '<(arm_version)',
-      'sysroot%': '<(sysroot)',
-      'chroot_cmd%': '<(chroot_cmd)',
-      'system_libdir%': '<(system_libdir)',
-
-      # Set to 1 to enable fast builds. Set to 2 for even faster builds
-      # (it disables debug info for fastest compilation - only for use
-      # on compile-only bots).
-      'fastbuild%': 0,
-
-      # Set to 1 to not store any build metadata, e.g. ifdef out all __DATE__
-      # and __TIME__. Set to 0 to reenable the use of these macros in the code
-      # base. See http://crbug.com/314403.
-      'dont_embed_build_metadata%': 1,
-
-      # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
-      # This is useful for parallel compilation tools which can't support /Zi.
-      # Only used on Windows.
-      'win_z7%' : 0,
-
-      # Set to 1 to enable dcheck in Release build.
-      'dcheck_always_on%': 0,
-
-      # Set to 1 to make a build that disables unshipped tracing events.
-      # Note: this setting is ignored if buildtype=="Official".
-      'tracing_like_official_build%': 0,
-
-      # Disable image loader component extension by default.
-      'image_loader_extension%': 0,
-
-      # Set NEON compilation flags.
-      'arm_neon%': 1,
-
-      # Detect NEON support at run-time.
-      'arm_neon_optional%': 0,
-
-      # Use libjpeg-turbo as the JPEG codec used by Chromium.
-      'use_libjpeg_turbo%': 1,
-
-      # Use system libjpeg. Note that the system's libjepg will be used even if
-      # use_libjpeg_turbo is set.
-      'use_system_libjpeg%': 0,
-
-      # By default, component is set to static_library and it can be overriden
-      # by the GYP command line or by ~/.gyp/include.gypi.
-      'component%': 'static_library',
-
-      # /analyze is off by default on Windows because it is very slow and noisy.
-      # Enable with GYP_DEFINES=win_analyze=1
-      'win_analyze%': 0,
-
-      # Set to select the Title Case versions of strings in GRD files.
-      'use_titlecase_in_grd%': 0,
-
-      # Use translations provided by volunteers at launchpad.net.  This
-      # currently only works on Linux.
-      'use_third_party_translations%': 0,
-
-      # Remoting compilation is enabled by default. Set to 0 to disable.
-      'remoting%': 1,
-
-      # Configuration policy is enabled by default. Set to 0 to disable.
-      'configuration_policy%': 1,
-
-      # Variable safe_browsing is used to control the build time configuration
-      # for safe browsing feature. Safe browsing can be compiled in 4 different
-      # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
-      # reporting features for use with Data Saver on Mobile, and 3 enables
-      # extended mobile protection via an external API.  When 3 is fully
-      # deployed, it will replace 2.
-      'safe_browsing%': 1,
-
-      # Web speech is enabled by default. Set to 0 to disable.
-      'enable_web_speech%': 1,
-
-      # 'Ok Google' hotwording is disabled by default in open source builds. Set
-      # to 1 to enable. (This will download a closed-source NaCl module at
-      # startup.) Chrome-branded builds have this enabled by default.
-      'enable_hotwording%': 0,
-
-      # Notifications are compiled in by default. Set to 0 to disable.
-      'notifications%' : 1,
-
-      # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
-      # regular builds and 1 for ASan builds.
-      'mac_want_real_dsym%': 'default',
-
-      # If this is set, the clang plugins used on the buildbot will be used.
-      # Run tools/clang/scripts/update.sh to make sure they are compiled.
-      # This causes 'clang_chrome_plugins_flags' to be set.
-      # Has no effect if 'clang' is not set as well.
-      'clang_use_chrome_plugins%': 1,
-
-      # Enable building with ASAN (Clang's -fsanitize=address option).
-      # -fsanitize=address only works with clang, but asan=1 implies clang=1
-      # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
-      'asan%': 0,
-      'asan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/asan/blacklist.txt',
-      # Enable coverage gathering instrumentation in sanitizer tools. This flag
-      # also controls coverage granularity (1 for function-level coverage, 2
-      # for block-level coverage).
-      'sanitizer_coverage%': 0,
-      # Deprecated, only works if |sanitizer_coverage| isn't set.
-      # TODO(glider): remove this flag.
-      'asan_coverage%': 0,
-      # Enable intra-object-overflow detection in ASan (experimental).
-      'asan_field_padding%': 0,
-
-      # Enable Chromium overrides of the default configurations for various
-      # dynamic tools (like ASan).
-      'use_sanitizer_options%': 0,
-
-      # Enable building with SyzyAsan.
-      # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
-      'syzyasan%': 0,
-
-      # Enable crash reporting via Kasko.
-      'kasko%': 0,
-
-      # Enable building with LSan (Clang's -fsanitize=leak option).
-      # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
-      # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
-      'lsan%': 0,
-
-      # Enable building with TSan (Clang's -fsanitize=thread option).
-      # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
-      # See http://clang.llvm.org/docs/ThreadSanitizer.html
-      'tsan%': 0,
-      'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
-
-      # Enable building with MSan (Clang's -fsanitize=memory option).
-      # MemorySanitizer only works with clang, but msan=1 implies clang=1
-      # See http://clang.llvm.org/docs/MemorySanitizer.html
-      'msan%': 0,
-      'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
-      # Track where uninitialized memory originates from. From fastest to
-      # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
-      # - track the chain of stores leading from allocation site to use site.
-      'msan_track_origins%': 2,
-
-      # Enable building with UBSan (Clang's -fsanitize=undefined option).
-      # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
-      # See http://clang.llvm.org/docs/UsersManual.html
-      'ubsan%': 0,
-      'ubsan_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/blacklist.txt',
-      'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/vptr_blacklist.txt',
-
-      # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
-      # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
-      'ubsan_vptr%': 0,
-
-      # Use dynamic libraries instrumented by one of the sanitizers
-      # instead of the standard system libraries. Set this flag to build the
-      # libraries from source.
-      'use_instrumented_libraries%': 0,
-
-      # Use dynamic libraries instrumented by one of the sanitizers
-      # instead of the standard system libraries. Set this flag to download
-      # prebuilt binaries from GCS.
-      'use_prebuilt_instrumented_libraries%': 0,
-
-      # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
-      # stdlibc++ as standard library. This is intended to use for instrumented
-      # builds.
-      'use_custom_libcxx%': 0,
-
-      # Use system libc++ instead of the default C++ library, usually libstdc++.
-      # This is intended for iOS builds only.
-      'use_system_libcxx%': 0,
-
-      # Use a modified version of Clang to intercept allocated types and sizes
-      # for allocated objects. clang_type_profiler=1 implies clang=1.
-      # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
-      # TODO(dmikurube): Support mac.  See http://crbug.com/123758#c11
-      'clang_type_profiler%': 0,
-
-      # Set to true to instrument the code with function call logger.
-      # See src/third_party/cygprofile/cyg-profile.cc for details.
-      'order_profiling%': 0,
-
-      # Use the provided profiled order file to link Chrome image with it.
-      # This makes Chrome faster by better using CPU cache when executing code.
-      # This is known as PGO (profile guided optimization).
-      # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
-      'order_text_section%' : "",
-
-      # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
-      # libraries on linux x86-64 and arm, plus ASLR.
-      'linux_fpic%': 1,
-
-      # Whether one-click signin is enabled or not.
-      'enable_one_click_signin%': 0,
-
-      # Whether to back up data before sync.
-      'enable_pre_sync_backup%': 0,
-
-      # Enable Chrome browser extensions
-      'enable_extensions%': 1,
-
-      # Enable Google Now.
-      'enable_google_now%': 1,
-
-      # Enable basic printing support and UI.
-      'enable_basic_printing%': 1,
-
-      # Enable printing with print preview. It does not imply
-      # enable_basic_printing. It's possible to build Chrome with preview only.
-      'enable_print_preview%': 1,
-
-      # Set the version of CLD.
-      #   0: Don't specify the version. This option is for the Finch testing.
-      #   1: Use only CLD1.
-      #   2: Use only CLD2.
-      'cld_version%': 2,
-
-      # For CLD2, the size of the tables that should be included in the build
-      # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
-      # tool explicitly.
-      # See third_party/cld_2/cld_2.gyp for more information.
-      #   0: Small tables, lower accuracy
-      #   2: Large tables, high accuracy
-      'cld2_table_size%': 2,
-
-      # Enable spell checker.
-      'enable_spellcheck%': 1,
-
-      # Use the operating system spellchecker, e.g. NSSpellChecker on Mac or
-      # SpellCheckerSession on Android.
-      'use_platform_spellchecker%': 0,
-
-      # Webrtc compilation is enabled by default. Set to 0 to disable.
-      'enable_webrtc%': 1,
-
-      # Media router support is enabled by default. Set to 0 to disable.
-      'enable_media_router%': 1,
-
-      # Enables use of the session service, which is enabled by default.
-      # Support for disabling depends on the platform.
-      'enable_session_service%': 1,
-
-      # Enables theme support, which is enabled by default.  Support for
-      # disabling depends on the platform.
-      'enable_themes%': 1,
-
-      # Enables autofill dialog and associated features; disabled by default.
-      'enable_autofill_dialog%' : 0,
-
-      # Defaults Wallet integration in Autofill dialog to use production
-      # servers. Unofficial builds won't have the proper API keys.
-      'enable_prod_wallet_service%': 0,
-
-      # Enables support for background apps.
-      'enable_background%': 1,
-
-      # Enable the task manager by default.
-      'enable_task_manager%': 1,
-
-      # Enables used resource whitelist generation; disabled by default.
-      'enable_resource_whitelist_generation%': 0,
-
-      # Enable FILE support by default.
-      'disable_file_support%': 0,
-
-      # Enable FTP support by default.
-      'disable_ftp_support%': 0,
-
-      # Use native android functions in place of ICU.  Not supported by most
-      # components.
-      'use_icu_alternatives_on_android%': 0,
-
-      # Use of precompiled headers on Windows.
-      #
-      # This variable may be explicitly set to 1 (enabled) or 0
-      # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
-      # This setting will override the default.
-      #
-      # See
-      # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
-      # for details.
-      'chromium_win_pch%': 0,
-
-      # Clang stuff.
-      'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
-      # Set this to true when building with Clang.
-      # See http://code.google.com/p/chromium/wiki/Clang for details.
-      # If this is set, clang is used as both host and target compiler in
-      # cross-compile builds.
-      'clang%': 0,
-
-      # Use experimental lld linker instead of the platform's default linker.
-      'use_lld%': 0,
-
-      # Enable plugin installation by default.
-      'enable_plugin_installation%': 1,
-
-      # Specifies whether to use canvas_skia.cc in place of platform
-      # specific implementations of gfx::Canvas. Affects text drawing in the
-      # Chrome UI.
-      # TODO(asvitkine): Enable this on all platforms and delete this flag.
-      #                  http://crbug.com/105550
-      'use_canvas_skia%': 0,
-
-      # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
-      # with one of those tools.
-      'build_for_tool%': '',
-
-      'wix_path%': '<(DEPTH)/third_party/wix',
-
-      # Supervised users are enabled by default.
-      'enable_supervised_users%': 1,
-
-      # Platform sends memory pressure signals natively.
-      'native_memory_pressure_signals%': 0,
-
-      'enable_mdns%' : 0,
-      'enable_service_discovery%': 0,
-      'enable_wifi_bootstrapping%': 0,
-      'enable_hangout_services_extension%': 0,
-
-       # Enable the Syzygy optimization step.
-      'syzygy_optimize%': 0,
-
-      # Enable hole punching for the protected video.
-      'video_hole%': 0,
-
-      # Automatically select platforms under ozone. Turn this off to
-      # build only explicitly selected platforms.
-      'ozone_auto_platforms%': 1,
-
-      # If this is set clang is used as host compiler, but not as target
-      # compiler. Always do this by default.
-      'host_clang%': 1,
-
-      # Variables to control Link-Time Optimization (LTO).
-      # On Android, the variable use_lto enables LTO on code compiled with -Os,
-      # and use_lto_o2 enables LTO on code compiled with -O2. On other
-      # platforms, use_lto enables LTO in all translation units, and use_lto_o2
-      # has no effect.
-      #
-      # On Linux and Android, when using LLVM LTO, the script
-      # build/download_gold_plugin.py must be run to download a linker plugin.
-      # On Mac, LLVM needs to be built from scratch using
-      # tools/clang/scripts/update.py and the absolute path to
-      # third_party/llvm-build/Release+Asserts/lib must be added to
-      # $DYLD_LIBRARY_PATH to pick up the right version of the linker plugin.
-      #
-      # On Android, the variables must *not* be enabled at the same time.
-      # In this case LTO would 'merge' the optimization flags at link-time
-      # which would lead to all code be optimized with -O2. See crbug.com/407544
-      'use_lto%': 0,
-      'use_lto_o2%': 0,
-
-      # Allowed level of identical code folding in the gold linker.
-      'gold_icf_level%': 'all',
-
-      # Libxkbcommon usage.
-      'use_xkbcommon%': 0,
-
-      # Control Flow Integrity for virtual calls and casts.
-      # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
-      'cfi_vptr%': 0,
-
-      'cfi_blacklist%': '<(PRODUCT_DIR)/../../tools/cfi/blacklist.txt',
-
-      # Whether the entire browser uses toolkit-views on Mac instead of Cocoa.
-      'mac_views_browser%': 0,
-
-      # By default, use ICU data file (icudtl.dat).
-      'icu_use_data_file_flag%': 1,
-
-      # Turn on JNI generation optimizations by default.
-      'optimize_jni_generation%': 1,
-
-      'conditions': [
-        # A flag for POSIX platforms
-        ['OS=="win"', {
-          'os_posix%': 0,
-        }, {
-          'os_posix%': 1,
-        }],
-
-        # A flag for BSD platforms
-        ['OS=="freebsd" or OS=="openbsd"', {
-          'os_bsd%': 1,
-        }, {
-          'os_bsd%': 0,
-        }],
-
-        # NSS usage.
-        ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris")', {
-          'use_nss_certs%': 1,
-        }, {
-          'use_nss_certs%': 0,
-        }],
-
-        # libudev usage.  This currently only affects the content layer.
-        ['OS=="linux" and embedded==0', {
-          'use_udev%': 1,
-        }, {
-          'use_udev%': 0,
-        }],
-
-        # Flags to use X11 on non-Mac POSIX platforms.
-        ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
-          'use_x11%': 0,
-        }, {
-          'use_x11%': 1,
-        }],
-
-        # Flags to use glib.
-        ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
-          'use_glib%': 0,
-        }, {
-          'use_glib%': 1,
-        }],
-
-        # Flags to use pango and cairo.
-        ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
-          'use_pango%': 0,
-          'use_cairo%': 0,
-        }, {
-          'use_pango%': 1,
-          'use_cairo%': 1,
-        }],
-
-        # DBus usage.
-        ['OS=="linux" and embedded==0', {
-          'use_dbus%': 1,
-        }, {
-          'use_dbus%': 0,
-        }],
-
-        # We always use skia text rendering in Aura on Windows, since GDI
-        # doesn't agree with our BackingStore.
-        # TODO(beng): remove once skia text rendering is on by default.
-        ['use_aura==1 and OS=="win"', {
-          'enable_skia_text%': 1,
-        }],
-
-        # A flag to enable or disable our compile-time dependency
-        # on gnome-keyring. If that dependency is disabled, no gnome-keyring
-        # support will be available. This option is useful
-        # for Linux distributions and for Aura.
-        ['OS!="linux" or chromeos==1', {
-          'use_gnome_keyring%': 0,
-        }, {
-          'use_gnome_keyring%': 1,
-        }],
-
-        ['OS=="mac" or OS=="ios"', {
-          # Mac and iOS want Title Case strings
-          'use_titlecase_in_grd%': 1,
-        }],
-
-        # Enable loader extensions on Chrome OS.
-        ['chromeos==1', {
-          'image_loader_extension%': 1,
-        }, {
-          'image_loader_extension%': 0,
-        }],
-
-        ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
-          'enable_one_click_signin%': 1,
-          'enable_pre_sync_backup%': 1,
-        }],
-
-        ['OS=="android"', {
-          'enable_extensions%': 0,
-          'enable_google_now%': 0,
-          'cld_version%': 1,
-          'enable_spellcheck%': 0,
-          'enable_themes%': 0,
-          'remoting%': 0,
-          'arm_neon%': 0,
-          'arm_neon_optional%': 1,
-          'native_memory_pressure_signals%': 1,
-          'enable_basic_printing%': 1,
-          'enable_print_preview%': 0,
-          'enable_task_manager%':0,
-          'video_hole%': 1,
-        }],
-
-        # OSX has a built-in spellchecker can be utilized.
-        ['OS=="mac"', {
-          'use_platform_spellchecker%': 1,
-        }],
-
-        # Android OS includes support for proprietary codecs regardless of
-        # building Chromium or Google Chrome. We also ship Google Chrome and
-        # Chromecast with proprietary codecs.
-        ['OS=="android" or branding=="Chrome" or chromecast==1', {
-          'proprietary_codecs%': 1,
-        }, {
-          'proprietary_codecs%': 0,
-        }],
-
-        ['OS=="mac" or OS=="ios"', {
-          'native_memory_pressure_signals%': 1,
-        }],
-
-        # Enable autofill dialog when not on iOS.
-        ['OS!="ios"', {
-          'enable_autofill_dialog%': 1,
-        }],
-
-        ['buildtype=="Official"', {
-          'enable_prod_wallet_service%': 1,
-        }],
-
-        ['branding=="Chrome"', {
-          'enable_hotwording%': 1,
-        }],
-
-        ['OS=="android"', {
-          'enable_webrtc%': 1,
-        }],
-
-        ['OS=="ios"', {
-          'disable_ftp_support%': 1,
-          'enable_extensions%': 0,
-          'enable_google_now%': 0,
-          'cld_version%': 2,
-          'cld2_table_size%': 0,
-          'enable_basic_printing%': 0,
-          'enable_print_preview%': 0,
-          'enable_session_service%': 0,
-          'enable_spellcheck%': 0,
-          'enable_themes%': 0,
-          'enable_webrtc%': 0,
-          'notifications%': 0,
-          'remoting%': 0,
-          'safe_browsing%': 0,
-          'enable_supervised_users%': 0,
-          'enable_task_manager%': 0,
-          'use_system_libcxx%': 1,
-        }],
-
-        # Use GPU accelerated cross process image transport by default
-        # on linux builds with the Aura window manager
-        ['use_aura==1 and OS=="linux"', {
-          'ui_compositor_image_transport%': 1,
-        }, {
-          'ui_compositor_image_transport%': 0,
-        }],
-
-        # Turn precompiled headers on by default.
-        ['OS=="win" and buildtype!="Official"', {
-          'chromium_win_pch%': 1
-        }],
-
-        ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
-          'enable_plugin_installation%': 0,
-        }, {
-          'enable_plugin_installation%': 1,
-        }],
-
-        # Whether PPAPI is enabled.
-        ['OS=="android" or OS=="ios" or (embedded==1 and chromecast==0)', {
-          'enable_plugins%': 0,
-        }, {
-          'enable_plugins%': 1,
-        }],
-
-        # linux_use_bundled_gold: whether to use the gold linker binary checked
-        # into third_party/binutils.  Force this off via GYP_DEFINES when you
-        # are using a custom toolchain and need to control -B in ldflags.
-        # Do not use 32-bit gold on 32-bit hosts as it runs out address space
-        # for component=static_library builds.
-        ['(OS=="linux" or OS=="android") and (target_arch=="x64" or target_arch=="arm")', {
-          'linux_use_bundled_gold%': 1,
-        }, {
-          'linux_use_bundled_gold%': 0,
-        }],
-
-        # linux_use_bundled_binutils: whether to use the binary binutils
-        # checked into third_party/binutils.  These are not multi-arch so cannot
-        # be used except on x86 and x86-64 (the only two architectures which
-        # are currently checke in).  Force this off via GYP_DEFINES when you
-        # are using a custom toolchain and need to control -B in cflags.
-        ['OS=="linux" and (target_arch=="x64")', {
-          'linux_use_bundled_binutils%': 1,
-        }, {
-          'linux_use_bundled_binutils%': 0,
-        }],
-
-        # linux_use_gold_flags: whether to use build flags that rely on gold.
-        # On by default for x64 Linux.
-        ['OS=="linux" and target_arch=="x64"', {
-          'linux_use_gold_flags%': 1,
-        }, {
-          'linux_use_gold_flags%': 0,
-        }],
-
-        # linux_use_debug_fission: whether to use split DWARF debug info
-        # files. This can reduce link time significantly, but is incompatible
-        # with some utilities such as icecc and ccache. Requires gold and
-        # gcc >= 4.8 or clang.
-        # http://gcc.gnu.org/wiki/DebugFission
-        ['OS=="linux" and target_arch=="x64"', {
-          'linux_use_debug_fission%': 1,
-        }, {
-          'linux_use_debug_fission%': 0,
-        }],
-
-        ['OS=="android" or OS=="ios"', {
-          'enable_captive_portal_detection%': 0,
-          'enable_media_router%': 0,
-        }, {
-          'enable_captive_portal_detection%': 1,
-          'enable_media_router%': 1,
-        }],
-
-        # Enable Skia UI text drawing incrementally on different platforms.
-        # http://crbug.com/105550
-        #
-        # On Aura, this allows per-tile painting to be used in the browser
-        # compositor.
-        ['OS!="android" and OS!="ios"', {
-          'use_canvas_skia%': 1,
-        }],
-
-        ['chromeos==1', {
-          'enable_basic_printing%': 0,
-          'enable_print_preview%': 1,
-        }],
-
-        # Do not enable the Settings App on ChromeOS.
-        ['enable_app_list==1 and chromeos==0', {
-          'enable_settings_app%': 1,
-        }, {
-          'enable_settings_app%': 0,
-        }],
-
-        # Whether tests targets should be run, archived or just have the
-        # dependencies verified. All the tests targets have the '_run' suffix,
-        # e.g. base_unittests_run runs the target base_unittests. The test
-        # target always calls tools/swarming_client/isolate.py. See the script's
-        # --help for more information. Meant to be overriden with GYP_DEFINES.
-        # TODO(maruel): Remove the conditions as more configurations are
-        # supported.
-        ['OS!="ios" and OS!="android" and chromeos==0', {
-          'test_isolation_mode%': 'check',
-        }, {
-          'test_isolation_mode%': 'noop',
-        }],
-        # Whether Android build uses OpenMAX DL FFT.
-        ['OS=="android" and ((target_arch=="arm" and arm_version >= 7) or target_arch=="ia32" or target_arch=="x64" or target_arch=="arm64" or target_arch=="mipsel")', {
-          # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
-          # When enabled, this will also enable WebAudio support on
-          # Android for these architectures.  Default is enabled.  Whether
-          # WebAudio is actually available depends on runtime settings
-          # and flags.
-          'use_openmax_dl_fft%': 1,
-        }, {
-          'use_openmax_dl_fft%': 0,
-        }],
-        ['OS=="win" or OS=="linux"', {
-            'enable_mdns%' : 1,
-        }],
-
-        # Disable various features by default on embedded.
-        ['embedded==1', {
-          'remoting%': 0,
-          'enable_basic_printing%': 0,
-          'enable_print_preview%': 0,
-        }],
-
-        ['OS=="win" or OS=="mac"', {
-          'enable_wifi_bootstrapping%' : 1,
-        }],
-
-        # Path to sas.dll, which provides the SendSAS function.
-        # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
-        ['target_arch=="x64"', {
-          'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
-        }, {
-          'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
-        }],
-
-        ['sysroot!=""', {
-          'pkg-config': '<(chroot_cmd) <(DEPTH)/build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)" "<(system_libdir)"',
-        }, {
-          'pkg-config': 'pkg-config'
-        }],
-      ],
-
-      # WebVR support disabled until platform implementations have been added
-      'enable_webvr%': 0,
-
-      # Setting this to '0' will cause V8's startup snapshot to be
-      # embedded in the binary instead of being a external files.
-      'v8_use_external_startup_data%': 1,
-
-      # Set this to 1 to enable use of concatenated impulse responses
-      # for the HRTF panner in WebAudio.
-      'use_concatenated_impulse_responses': 1,
-
-      # You can set the variable 'use_official_google_api_keys' to 1
-      # to use the Google-internal file containing official API keys
-      # for Google Chrome even in a developer build.  Setting this
-      # variable explicitly to 1 will cause your build to fail if the
-      # internal file is missing.
-      #
-      # The variable is documented here, but not handled in this file;
-      # see //google_apis/determine_use_official_keys.gypi for the
-      # implementation.
-      #
-      # Set the variable to 0 to not use the internal file, even when
-      # it exists in your checkout.
-      #
-      # Leave it unset in your include.gypi to have the variable
-      # implicitly set to 1 if you have
-      # src/google_apis/internal/google_chrome_api_keys.h in your
-      # checkout, and implicitly set to 0 if not.
-      #
-      # Note that official builds always behave as if the variable
-      # was explicitly set to 1, i.e. they always use official keys,
-      # and will fail to build if the internal file is missing.
-      #
-      # NOTE: You MUST NOT explicitly set the variable to 2 in your
-      # include.gypi or by other means. Due to subtleties of GYP, this
-      # is not the same as leaving the variable unset, even though its
-      # default value in
-      # //google_apis/determine_use_official_keys.gypi is 2.
-
-      # Set these to bake the specified API keys and OAuth client
-      # IDs/secrets into your build.
-      #
-      # If you create a build without values baked in, you can instead
-      # set environment variables to provide the keys at runtime (see
-      # src/google_apis/google_api_keys.h for details).  Features that
-      # require server-side APIs may fail to work if no keys are
-      # provided.
-      #
-      # Note that if you are building an official build or if
-      # use_official_google_api_keys has been set to 1 (explicitly or
-      # implicitly), these values will be ignored and the official
-      # keys will be used instead.
-      'google_api_key%': '',
-      'google_default_client_id%': '',
-      'google_default_client_secret%': '',
-      # Native Client is enabled by default.
-      'disable_nacl%': '0',
-
-      # Sets the default version name and code for Android app, by default we
-      # do a developer build.
-      'android_app_version_name%': 'Developer Build',
-      'android_app_version_code%': 1,
-    },
-
-    # Copy conditionally-set variables out one scope.
-    'branding%': '<(branding)',
-    'branding_path_component%': '<(branding_path_component)',
-    'buildtype%': '<(buildtype)',
-    'target_arch%': '<(target_arch)',
-    'target_subarch%': '<(target_subarch)',
-    'mips_arch_variant%': '<(mips_arch_variant)',
-    'mips_dsp_rev%': '<(mips_dsp_rev)',
-    'host_arch%': '<(host_arch)',
-    'toolkit_views%': '<(toolkit_views)',
-    'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
-    'use_aura%': '<(use_aura)',
-    'use_ash%': '<(use_ash)',
-    'use_cras%': '<(use_cras)',
-    'use_libpci%': '<(use_libpci)',
-    'use_openssl%': '<(use_openssl)',
-    'use_openssl_certs%': '<(use_openssl_certs)',
-    'use_nss_certs%': '<(use_nss_certs)',
-    'use_udev%': '<(use_udev)',
-    'os_bsd%': '<(os_bsd)',
-    'os_posix%': '<(os_posix)',
-    'use_dbus%': '<(use_dbus)',
-    'use_glib%': '<(use_glib)',
-    'use_pango%': '<(use_pango)',
-    'use_cairo%': '<(use_cairo)',
-    'use_ozone%': '<(use_ozone)',
-    'use_ozone_evdev%': '<(use_ozone_evdev)',
-    'use_xkbcommon%': '<(use_xkbcommon)',
-    'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
-    'desktop_linux%': '<(desktop_linux)',
-    'use_x11%': '<(use_x11)',
-    'use_gnome_keyring%': '<(use_gnome_keyring)',
-    'linux_fpic%': '<(linux_fpic)',
-    'chromeos%': '<(chromeos)',
-    'chromecast%': '<(chromecast)',
-    'enable_viewport%': '<(enable_viewport)',
-    'enable_hidpi%': '<(enable_hidpi)',
-    'enable_topchrome_md%': '<(enable_topchrome_md)',
-    'image_loader_extension%': '<(image_loader_extension)',
-    'fastbuild%': '<(fastbuild)',
-    'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
-    'win_z7%': '<(win_z7)',
-    'dcheck_always_on%': '<(dcheck_always_on)',
-    'tracing_like_official_build%': '<(tracing_like_official_build)',
-    'arm_version%': '<(arm_version)',
-    'arm_neon%': '<(arm_neon)',
-    'arm_neon_optional%': '<(arm_neon_optional)',
-    'sysroot%': '<(sysroot)',
-    'pkg-config%': '<(pkg-config)',
-    'chroot_cmd%': '<(chroot_cmd)',
-    'system_libdir%': '<(system_libdir)',
-    'component%': '<(component)',
-    'win_analyze%': '<(win_analyze)',
-    'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
-    'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
-    'use_third_party_translations%': '<(use_third_party_translations)',
-    'remoting%': '<(remoting)',
-    'enable_one_click_signin%': '<(enable_one_click_signin)',
-    'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
-    'enable_media_router%': '<(enable_media_router)',
-    'enable_webrtc%': '<(enable_webrtc)',
-    'chromium_win_pch%': '<(chromium_win_pch)',
-    'configuration_policy%': '<(configuration_policy)',
-    'safe_browsing%': '<(safe_browsing)',
-    'enable_web_speech%': '<(enable_web_speech)',
-    'enable_hotwording%': '<(enable_hotwording)',
-    'notifications%': '<(notifications)',
-    'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
-    'mac_want_real_dsym%': '<(mac_want_real_dsym)',
-    'asan%': '<(asan)',
-    'asan_blacklist%': '<(asan_blacklist)',
-    'asan_coverage%': '<(asan_coverage)',
-    'sanitizer_coverage%': '<(sanitizer_coverage)',
-    'asan_field_padding%': '<(asan_field_padding)',
-    'use_sanitizer_options%': '<(use_sanitizer_options)',
-    'syzyasan%': '<(syzyasan)',
-    'kasko%': '<(kasko)',
-    'syzygy_optimize%': '<(syzygy_optimize)',
-    'lsan%': '<(lsan)',
-    'msan%': '<(msan)',
-    'msan_blacklist%': '<(msan_blacklist)',
-    'msan_track_origins%': '<(msan_track_origins)',
-    'tsan%': '<(tsan)',
-    'tsan_blacklist%': '<(tsan_blacklist)',
-    'ubsan%': '<(ubsan)',
-    'ubsan_blacklist%': '<(ubsan_blacklist)',
-    'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
-    'ubsan_vptr%': '<(ubsan_vptr)',
-    'use_instrumented_libraries%': '<(use_instrumented_libraries)',
-    'use_prebuilt_instrumented_libraries%': '<(use_prebuilt_instrumented_libraries)',
-    'use_custom_libcxx%': '<(use_custom_libcxx)',
-    'use_system_libcxx%': '<(use_system_libcxx)',
-    'clang_type_profiler%': '<(clang_type_profiler)',
-    'order_profiling%': '<(order_profiling)',
-    'order_text_section%': '<(order_text_section)',
-    'enable_extensions%': '<(enable_extensions)',
-    'enable_plugin_installation%': '<(enable_plugin_installation)',
-    'enable_plugins%': '<(enable_plugins)',
-    'enable_session_service%': '<(enable_session_service)',
-    'enable_themes%': '<(enable_themes)',
-    'enable_autofill_dialog%': '<(enable_autofill_dialog)',
-    'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
-    'enable_background%': '<(enable_background)',
-    'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
-    'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
-    'linux_use_gold_flags%': '<(linux_use_gold_flags)',
-    'linux_use_debug_fission%': '<(linux_use_debug_fission)',
-    'use_canvas_skia%': '<(use_canvas_skia)',
-    'test_isolation_mode%': '<(test_isolation_mode)',
-    'enable_basic_printing%': '<(enable_basic_printing)',
-    'enable_print_preview%': '<(enable_print_preview)',
-    'enable_spellcheck%': '<(enable_spellcheck)',
-    'use_platform_spellchecker%': '<(use_platform_spellchecker)',
-    'enable_google_now%': '<(enable_google_now)',
-    'cld_version%': '<(cld_version)',
-    'cld2_table_size%': '<(cld2_table_size)',
-    'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
-    'disable_file_support%': '<(disable_file_support)',
-    'disable_ftp_support%': '<(disable_ftp_support)',
-    'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
-    'enable_task_manager%': '<(enable_task_manager)',
-    'sas_dll_path%': '<(sas_dll_path)',
-    'wix_path%': '<(wix_path)',
-    'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
-    'use_system_libjpeg%': '<(use_system_libjpeg)',
-    'android_channel%': '<(android_channel)',
-    'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
-    'gyp_managed_install%': 0,
-    'create_standalone_apk%': 1,
-    'enable_app_list%': '<(enable_app_list)',
-    'use_default_render_theme%': '<(use_default_render_theme)',
-    'enable_settings_app%': '<(enable_settings_app)',
-    'google_api_key%': '<(google_api_key)',
-    'google_default_client_id%': '<(google_default_client_id)',
-    'google_default_client_secret%': '<(google_default_client_secret)',
-    'enable_supervised_users%': '<(enable_supervised_users)',
-    'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
-    'enable_mdns%' : '<(enable_mdns)',
-    'enable_service_discovery%' : '<(enable_service_discovery)',
-    'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
-    'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
-    'proprietary_codecs%': '<(proprietary_codecs)',
-    'use_goma%': '<(use_goma)',
-    'gomadir%': '<(gomadir)',
-    'use_lto%': '<(use_lto)',
-    'use_lto_o2%': '<(use_lto_o2)',
-    'gold_icf_level%': '<(gold_icf_level)',
-    'video_hole%': '<(video_hole)',
-    'v8_use_external_startup_data%': '<(v8_use_external_startup_data)',
-    'cfi_vptr%': '<(cfi_vptr)',
-    'cfi_blacklist%': '<(cfi_blacklist)',
-    'mac_views_browser%': '<(mac_views_browser)',
-    'android_app_version_name%': '<(android_app_version_name)',
-    'android_app_version_code%': '<(android_app_version_code)',
-    'enable_webvr%': '<(enable_webvr)',
-
-    # Turns on compiler optimizations in V8 in Debug build.
-    'v8_optimized_debug%': 1,
-
-    # Use system protobuf instead of bundled one.
-    'use_system_protobuf%': 0,
-
-    # Use system yasm instead of bundled one.
-    'use_system_yasm%': 0,
-
-    # Use system ICU instead of bundled one.
-    'use_system_icu%' : 0,
-
-    # Default to enabled PIE; this is important for ASLR but we may need to be
-    # able to turn it off for various reasons.
-    'linux_disable_pie%': 0,
-
-    # The release channel that this build targets. This is used to restrict
-    # channel-specific build options, like which installer packages to create.
-    # The default is 'all', which does no channel-specific filtering.
-    'channel%': 'all',
-
-    # Override chromium_mac_pch and set it to 0 to suppress the use of
-    # precompiled headers on the Mac.  Prefix header injection may still be
-    # used, but prefix headers will not be precompiled.  This is useful when
-    # using distcc to distribute a build to compile slaves that don't
-    # share the same compiler executable as the system driving the compilation,
-    # because precompiled headers rely on pointers into a specific compiler
-    # executable's image.  Setting this to 0 is needed to use an experimental
-    # Linux-Mac cross compiler distcc farm.
-    'chromium_mac_pch%': 1,
-
-    # The default value for mac_strip in target_defaults. This cannot be
-    # set there, per the comment about variable% in a target_defaults.
-    'mac_strip_release%': 0,
-
-    # Set to 1 to enable java code coverage. Instruments classes during build
-    # to produce .ec files during runtime.
-    'emma_coverage%': 0,
-
-    # EMMA filter string consisting of a list of inclusion/exclusion patterns
-    # separated with whitespace and/or comma. Only has effect if
-    # 'emma_coverage=1'.
-    'emma_filter%': '',
-
-    # Set to 1 to enable running Android lint on java/class files.
-    'android_lint%': 1,
-
-    # Although base/allocator lets you select a heap library via an
-    # environment variable, the libcmt shim it uses sometimes gets in
-    # the way.  To disable it entirely, and switch to normal msvcrt, do e.g.
-    #  'win_use_allocator_shim': 0,
-    #  'win_release_RuntimeLibrary': 2
-    # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
-    'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
-
-    # TODO(bradnelson): eliminate this when possible.
-    # To allow local gyp files to prevent release.vsprops from being included.
-    # Yes(1) means include release.vsprops.
-    # Once all vsprops settings are migrated into gyp, this can go away.
-    'msvs_use_common_release%': 1,
-
-    # TODO(bradnelson): eliminate this when possible.
-    # To allow local gyp files to override additional linker options for msvs.
-    # Yes(1) means set use the common linker options.
-    'msvs_use_common_linker_extras%': 1,
-
-    # TODO(sgk): eliminate this if possible.
-    # It would be nicer to support this via a setting in 'target_defaults'
-    # in chrome/app/locales/locales.gypi overriding the setting in the
-    # 'Debug' configuration in the 'target_defaults' dict below,
-    # but that doesn't work as we'd like.
-    'msvs_debug_link_incremental%': '2',
-
-    # Needed for some of the largest modules.
-    'msvs_debug_link_nonincremental%': '1',
-
-    # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
-    # to get incremental linking to be faster in debug builds.
-    'incremental_chrome_dll%': '0',
-
-    # Experimental setting to break chrome.dll into multiple pieces based on
-    # process type.
-    'chrome_multiple_dll%': '0',
-
-    # Experimental setting to optimize Chrome's DLLs with PGO.
-    'chrome_pgo_phase%': '0',
-
-    # Whether the VS xtree header has been patched to disable warning 4702. If
-    # it has, then we don't need to disable 4702 (unreachable code warning).
-    # The patch is preapplied to the internal toolchain and hence all bots.
-    'msvs_xtree_patched%': '<!pymod_do_main(win_is_xtree_patched)',
-
-    # Clang stuff.
-    'clang%': '<(clang)',
-    'host_clang%': '<(host_clang)',
-    'make_clang_dir%': '<(make_clang_dir)',
-    'use_lld%': '<(use_lld)',
-
-    # Control which version of clang to use when building for iOS.  If set to
-    # '1', uses the version of clang that ships with Xcode.  If set to '0', uses
-    # the version of clang that ships with the Chromium source.  This variable
-    # is automatically set to '1' in Official builds.
-    'clang_xcode%': 0,
-
-    # These two variables can be set in GYP_DEFINES while running
-    # |gclient runhooks| to let clang run a plugin in every compilation.
-    # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
-    # Example:
-    #     GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
-
-    'clang_load%': '',
-    'clang_add_plugin%': '',
-
-    # Tell ld64 to write map files describing binary layout. Useful
-    # for looking at what contributes to binary size, e.g. with
-    # https://github.com/nico/bloat
-    'mac_write_linker_maps%': 0,
-
-    # The default type of gtest.
-    'gtest_target_type%': 'executable',
-
-    # Enable sampling based profiler.
-    # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
-    'profiling%': '0',
-    # Profile without optimizing out stack frames when profiling==1.
-    'profiling_full_stack_frames%': '0',
-
-    # And if we want to dump symbols for Breakpad-enabled builds.
-    'linux_dump_symbols%': 0,
-    # And if we want to strip the binary after dumping symbols.
-    'linux_strip_binary%': 0,
-    # If we want stack unwind support for backtrace().
-    'debug_unwind_tables%': 1,
-    'release_unwind_tables%': 1,
-
-    # Override where to find binutils
-    'binutils_version%': 0,
-    'binutils_dir%': '',
-
-    # Enable TCMalloc.
-    # Default of 'use_allocator' is set to 'none' if OS=='android' later.
-    'use_allocator%': 'tcmalloc',
-
-    # Set to 1 to link against libgnome-keyring instead of using dlopen().
-    'linux_link_gnome_keyring%': 0,
-    # Set to 1 to link against gsettings APIs instead of using dlopen().
-    'linux_link_gsettings%': 0,
-
-    # Enable use of OpenMAX DL FFT routines.
-    'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
-
-    # Enable new NPDevice API.
-    'enable_new_npdevice_api%': 0,
-
-    # .gyp files or targets should set chromium_code to 1 if they build
-    # Chromium-specific code, as opposed to external code.  This variable is
-    # used to control such things as the set of warnings to enable, and
-    # whether warnings are treated as errors.
-    'chromium_code%': 0,
-
-    # Disable fatal linker warnings, similarly to how we make it possible
-    # to disable -Werror (e.g. for different toolchain versions).
-    'disable_fatal_linker_warnings%': 0,
-
-    'release_valgrind_build%': 0,
-
-    # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
-    'enable_wexit_time_destructors%': 0,
-
-    # Build libpeerconnection as a static library by default.
-    'libpeer_target_type%': 'static_library',
-
-    # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
-    'internal_gles2_conform_tests%': 0,
-
-    # Set to 1 to compile with the Khronos GL-CTS conformance tests.
-    'internal_khronos_glcts_tests%': 0,
-
-    # Set to 1 to compile the filter fuzzer.
-    'internal_filter_fuzzer%': 0,
-
-    # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
-    # so Cocoa is happy (http://crbug.com/20441).
-    'locales': [
-      'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
-      'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
-      'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
-      'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
-      'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
-      'vi', 'zh-CN', 'zh-TW',
-    ],
-
-    # Pseudo locales are special locales which are used for testing and
-    # debugging. They don't get copied to the final app. For more info,
-    # check out https://www.chromium.org/developers/testing/fake-bidi
-    'pseudo_locales': [
-      'fake-bidi',
-    ],
-
-    'grit_defines': [],
-
-    # If debug_devtools is set to 1, JavaScript files for DevTools are
-    # stored as is and loaded from disk. Otherwise, a concatenated file
-    # is stored in resources.pak. It is still possible to load JS files
-    # from disk by passing --debug-devtools cmdline switch.
-    'debug_devtools%': 0,
-
-    # The Java Bridge is not compiled in by default.
-    'java_bridge%': 0,
-
-    # Code signing for iOS binaries.  The bots need to be able to disable this.
-    'chromium_ios_signing%': 1,
-
-    # This flag is only used when disable_nacl==0 and disables all those
-    # subcomponents which would require the installation of a native_client
-    # untrusted toolchain.
-    'disable_nacl_untrusted%': 0,
-
-    # PNaCl toolchain does not support sanitizers. Disable by default.
-    'enable_nacl_nonsfi_test%': 0,
-
-    # Disable Dart by default.
-    'enable_dart%': 0,
-
-    # Copy out the setting of disable_nacl.
-    'disable_nacl%': '<(disable_nacl)',
-
-    # Portable Native Client is enabled by default.
-    'disable_pnacl%': 0,
-
-    # Whether to build full debug version for Debug configuration on Android.
-    # Compared to full debug version, the default Debug configuration on Android
-    # has no full v8 debug, has size optimization and linker gc section, so that
-    # we can build a debug version with acceptable size and performance.
-    'android_full_debug%': 0,
-
-    # Contains data about the attached devices for gyp_managed_install.
-    'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
-
-    'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
-    'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
-
-    'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.1',
-    'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
-
-    # Whether we are using the rlz library or not.  Platforms like Android send
-    # rlz codes for searches but do not use the library.
-    'enable_rlz_support%': 0,
-    'enable_rlz%': 0,
-
-    # Turns on the i18n support in V8.
-    'v8_enable_i18n_support': 1,
-
-    # Compile d8 for the host toolset.
-    'v8_toolset_for_d8': 'host',
-
-    # Use brlapi from brltty for braille display support.
-    'use_brlapi%': 0,
-
-    # Relative path to icu.gyp from this file.
-    'icu_gyp_path': '../third_party/icu/icu.gyp',
-
-    # IPC fuzzer is disabled by default.
-    'enable_ipc_fuzzer%': 0,
-
-    # Force disable libstdc++ debug mode.
-    'disable_glibcxx_debug%': 0,
-
-    # Set to 1 to compile with MSE support for MPEG2 TS
-    'enable_mpeg2ts_stream_parser%': 0,
-
-    # Support ChromeOS touchpad gestures with ozone.
-    'use_evdev_gestures%': 0,
-
-    # Default ozone platform (if no --ozone-platform flag).
-    'ozone_platform%': "",
-
-    # Ozone platforms to include in the build.
-    'ozone_platform_caca%': 0,
-    'ozone_platform_cast%': 0,
-    'ozone_platform_drm%': 0,
-    'ozone_platform_egltest%': 0,
-    'ozone_platform_gbm%': 0,
-    'ozone_platform_ozonex%': 0,
-    'ozone_platform_test%': 0,
-
-    # Experiment: http://crbug.com/426914
-    'envoy%': 0,
-
-    # Used to set libjpeg_gyp_path. Chrome OS ui/gfx/gfx.gyp uses the IJG path
-    # for robust login screen decoding.
-    'libjpeg_ijg_gyp_path': '<(DEPTH)/third_party/libjpeg/libjpeg.gyp',
-    'libjpeg_turbo_gyp_path': '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp',
-
-    'conditions': [
-      ['buildtype=="Official"', {
-        # Continue to embed build meta data in Official builds, basically the
-        # time it was built.
-        # TODO(maruel): This decision should be revisited because having an
-        # official deterministic build has high value too but MSVC toolset can't
-        # generate anything deterministic with WPO enabled AFAIK.
-        'dont_embed_build_metadata%': 0,
-      }],
-      # Enable the Syzygy optimization step for the official builds.
-      ['OS=="win" and buildtype=="Official" and syzyasan!=1 and clang!=1', {
-        'syzygy_optimize%': 1,
-      }, {
-        'syzygy_optimize%': 0,
-      }],
-      # Get binutils version so we can enable debug fission if we can.
-      ['os_posix==1 and OS!="mac" and OS!="ios"', {
-        'conditions': [
-          # compiler_version doesn't work with clang
-          # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
-          # compiler_version works with clang.
-          # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
-          # that it takes effect here.
-          ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
-            'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
-          }],
-          # On Android we know the binutils version in the toolchain.
-          ['OS=="android"', {
-            'binutils_version%': 222,
-          }],
-          ['host_arch=="x64"', {
-            'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
-          }],
-          ['host_arch=="ia32"', {
-            'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
-          }],
-          # Our version of binutils in third_party/binutils
-          ['linux_use_bundled_binutils==1', {
-            'binutils_version%': 224,
-          }],
-        ],
-      }, {
-        'binutils_version%': 0,
-      }],
-      # The version of GCC in use, set later in platforms that use GCC and have
-      # not explicitly chosen to build with clang. Currently, this means all
-      # platforms except Windows, Mac and iOS.
-      # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
-      # it takes effect here.
-      ['os_posix==1 and OS!="mac" and OS!="ios" and clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan_vptr==0', {
-        'conditions': [
-          ['OS=="android"', {
-            'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
-            # We directly set the gcc version since we know what we use.
-            'gcc_version%': 49,
-          }, {
-            'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
-            'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
-          }],
-        ],
-      }, {
-        'host_gcc_version%': 0,
-        'gcc_version%': 0,
-      }],
-      ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
-        'directx_sdk_path%': '<(directx_sdk_default_path)',
-      }, {
-        'directx_sdk_path%': '$(DXSDK_DIR)',
-      }],
-      ['OS=="win"', {
-        'windows_driver_kit_path%': '$(WDK_DIR)',
-      }],
-      ['os_posix==1 and OS!="mac" and OS!="ios"', {
-        'conditions': [
-          ['target_arch=="mipsel" or target_arch=="mips64el"', {
-            'werror%': '',
-            'disable_nacl%': 1,
-            'nacl_untrusted_build%': 0,
-            'use_allocator%': 'none',
-          }],
-          # Use a 64-bit linker to avoid running out of address space. The
-          # buildbots should have a 64-bit kernel and a 64-bit libc installed.
-          ['host_arch=="ia32" and target_arch=="ia32"', {
-            # TODO(thestig) This is a horrible way to force the desired
-            # configuration. Our gyp variable scoping is likely wrong and
-            # needs to be cleaned up. The GN configuration should be changed
-            # to match.
-            'binutils_version%': 224,
-            'linux_use_bundled_binutils%': '1',
-            'linux_use_bundled_gold%': '1',
-            'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
-          }],
-          # All Chrome builds have breakpad symbols, but only process the
-          # symbols from official builds.
-          ['(branding=="Chrome" and buildtype=="Official")', {
-            'linux_dump_symbols%': 1,
-
-            # Omit unwind support in official release builds to save space. We
-            # can use breakpad for these builds.
-            'release_unwind_tables%': 0,
-          }],
-        ],
-      }],  # os_posix==1 and OS!="mac" and OS!="ios"
-      ['OS=="ios"', {
-        'disable_nacl%': 1,
-        'enable_background%': 0,
-        'icu_use_data_file_flag%': 1,
-        'enable_web_speech%': 0,
-        'use_system_libxml%': 1,
-        'use_system_sqlite%': 1,
-        'locales==': [
-          'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
-          'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
-          'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
-          'uk', 'vi', 'zh-CN', 'zh-TW',
-        ],
-
-        # iOS SDK and deployment target support.  The |ios_sdk| value is left
-        # blank so that when it is set in the project files it will be the
-        # "current" iOS SDK.  Forcing a specific SDK even if it is "current"
-        # causes Xcode to spit out a warning for every single project file for
-        # not using the "current" SDK.
-        'ios_sdk%': '',
-        'ios_sdk_path%': '',
-        'ios_deployment_target%': '7.0',
-
-        'conditions': [
-          # ios_product_name is set to the name of the .app bundle as it should
-          # appear on disk.
-          ['branding=="Chrome"', {
-            'ios_product_name%': 'Chrome',
-          }, { # else: branding!="Chrome"
-            'ios_product_name%': 'Chromium',
-          }],
-          ['branding=="Chrome" and buildtype=="Official"', {
-            'ios_breakpad%': 1,
-          }, { # else: branding!="Chrome" or buildtype!="Official"
-            'ios_breakpad%': 0,
-          }],
-        ],
-      }],  # OS=="ios"
-      ['OS=="android"', {
-        # Location of Android NDK.
-        'variables': {
-          'variables': {
-            # Standard libraries can use the relative path to the NDK.
-            'android_ndk_root%': '../../third_party/android_tools/ndk/',
-            # Unfortunately, it is required to use the absolute path to the SDK
-            # because it us passed to ant which uses a different relative path
-            # from GYP.
-            'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
-            # Similarly, gdbserver and the Android toolchain need to use the
-            # absolute path to the NDK because they are used at different levels
-            # in the GYP files.
-            'android_ndk_absolute_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
-            'android_host_arch%': '<!(uname -m)',
-            # Android API-level of the SDK used for compilation.
-            'android_sdk_version%': '22',
-            'android_sdk_build_tools_version%': '22.0.1',
-            'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
-          },
-          # Copy conditionally-set variables out one scope.
-          'android_ndk_root%': '<(android_ndk_root)',
-          'android_ndk_absolute_root%': '<(android_ndk_absolute_root)',
-          'android_sdk_root%': '<(android_sdk_root)',
-          'android_sdk_version%': '<(android_sdk_version)',
-          'android_libcpp_root': '<(android_ndk_root)/sources/cxx-stl/llvm-libc++',
-          'host_os%': '<(host_os)',
-
-          'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
-          # Android SDK build tools (e.g. dx, aidl)
-          'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
-
-          # Android API level 16 is JB (Android 4.1) which is the minimum
-          # platform requirement for Chrome on Android, we use it for native
-          # code compilation.
-          'conditions': [
-            ['target_arch == "ia32"', {
-              'android_app_abi%': 'x86',
-              'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86/gdbserver/gdbserver',
-              'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-x86',
-              'android_ndk_lib_dir%': 'usr/lib',
-              'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
-            }],
-            ['target_arch == "x64"', {
-              'android_app_abi%': 'x86_64',
-              'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
-              'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
-              'android_ndk_lib_dir%': 'usr/lib64',
-              'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
-            }],
-            ['target_arch=="arm"', {
-              'conditions': [
-                ['arm_version<7', {
-                  'android_app_abi%': 'armeabi',
-                }, {
-                  'android_app_abi%': 'armeabi-v7a',
-                }],
-              ],
-              'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm/gdbserver/gdbserver',
-              'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-arm',
-              'android_ndk_lib_dir%': 'usr/lib',
-              'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
-            }],
-            ['target_arch == "arm64"', {
-              'android_app_abi%': 'arm64-v8a',
-              'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm64/gdbserver/gdbserver',
-              'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
-              'android_ndk_lib_dir%': 'usr/lib',
-              'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
-            }],
-            ['target_arch == "mipsel"', {
-              'android_app_abi%': 'mips',
-              'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips/gdbserver/gdbserver',
-              'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-mips',
-              'android_ndk_lib_dir%': 'usr/lib',
-              'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
-            }],
-            ['target_arch == "mips64el"', {
-              'android_app_abi%': 'mips64',
-              'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips64/gdbserver/gdbserver',
-              'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
-              'android_ndk_lib_dir%': 'usr/lib64',
-              'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
-            }],
-          ],
-        },
-        # Copy conditionally-set variables out one scope.
-        'android_app_abi%': '<(android_app_abi)',
-        'android_gdbserver%': '<(android_gdbserver)',
-        'android_ndk_root%': '<(android_ndk_root)',
-        'android_ndk_sysroot%': '<(android_ndk_sysroot)',
-        'android_sdk_root%': '<(android_sdk_root)',
-        'android_sdk_version%': '<(android_sdk_version)',
-        'android_toolchain%': '<(android_toolchain)',
-
-        'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
-        'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
-        'android_sdk_tools%': '<(android_sdk_tools)',
-        'android_aapt_path%': '<(android_sdk_tools)/aapt',
-        'android_sdk%': '<(android_sdk)',
-        'android_sdk_jar%': '<(android_sdk)/android.jar',
-
-        'android_libcpp_root': '<(android_libcpp_root)',
-        'android_libcpp_include': '<(android_libcpp_root)/libcxx/include',
-        'android_libcpp_libs_dir%': '<(android_libcpp_root)/libs/<(android_app_abi)',
-        'host_os%': '<(host_os)',
-
-        # Location of the "objcopy" binary, used by both gyp and scripts.
-        'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
-
-        # Location of the "strip" binary, used by both gyp and scripts.
-        'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
-
-        # Location of the "readelf" binary.
-        'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
-
-        # Determines whether we should optimize JNI generation at the cost of
-        # breaking assumptions in the build system that when inputs have changed
-        # the outputs should always change as well.  This is meant purely for
-        # developer builds, to avoid spurious re-linking of native files.
-        'optimize_jni_generation%': '<(optimize_jni_generation)',
-
-        # Use OpenSSL's struct X509 to represent certificates.
-        'use_openssl_certs%': 1,
-
-        'proprietary_codecs%': '<(proprietary_codecs)',
-        'safe_browsing%': 2,
-        'enable_web_speech%': 0,
-        'java_bridge%': 1,
-        'build_ffmpegsumo%': 0,
-        'use_allocator%': 'none',
-
-        # Disable Native Client.
-        'disable_nacl%': 1,
-
-        # Android does not support background apps.
-        'enable_background%': 0,
-
-        # Sessions are store separately in the Java side.
-        'enable_session_service%': 0,
-
-        'p2p_apis%' : 0,
-
-        'gtest_target_type%': 'shared_library',
-      }],  # OS=="android"
-      ['embedded==1', {
-        'use_system_fontconfig%': 0,
-      }, {
-        'use_system_fontconfig%': 1,
-      }],
-      ['chromecast==1', {
-        'enable_mpeg2ts_stream_parser%': 1,
-        'ffmpeg_branding%': 'ChromeOS',
-        'ozone_platform_ozonex%': 1,
-        'use_custom_freetype%': 0,
-        'use_playready%': 0,
-        'conditions': [
-          ['target_arch=="arm"', {
-            'arm_arch%': '',
-            'arm_tune%': 'cortex-a9',
-            'arm_thumb%': 1,
-            'video_hole%': 1,
-          }],
-        ],
-      }],
-      ['chromecast==1 and OS!="android"', {
-        'ozone_platform_cast%': 1
-      }],
-      ['OS=="linux" and target_arch!="mipsel"', {
-        'clang%': 1,
-      }],  # OS=="mac"
-      ['OS=="mac"', {
-        'conditions': [
-          # All Chrome builds have breakpad symbols, but only process the
-          # symbols from official builds.
-          ['(branding=="Chrome" and buildtype=="Official")', {
-            'mac_strip_release%': 1,
-          }],
-        ],
-      }],  # OS=="mac"
-      ['OS=="mac" or OS=="ios"', {
-        'clang%': 1,
-
-        'variables': {
-          # Mac OS X SDK and deployment target support.  The SDK identifies
-          # the version of the system headers that will be used, and
-          # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
-          # macro.  "Maximum allowed" refers to the operating system version
-          # whose APIs are available in the headers.  The deployment target
-          # identifies the minimum system version that the built products are
-          # expected to function on.  It corresponds to the
-          # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro.  To ensure these
-          # macros are available, #include <AvailabilityMacros.h>.  Additional
-          # documentation on these macros is available at
-          # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
-          # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
-          # deployment target to 10.6.  Other projects, such as O3D, may
-          # override these defaults.
-
-          # Normally, mac_sdk_min is used to find an SDK that Xcode knows
-          # about that is at least the specified version. In official builds,
-          # the SDK must match mac_sdk_min exactly. If the SDK is installed
-          # someplace that Xcode doesn't know about, set mac_sdk_path to the
-          # path to the SDK; when set to a non-empty string, SDK detection
-          # based on mac_sdk_min will be bypassed entirely.
-          'conditions': [
-            ['OS=="ios"', {
-              'mac_sdk_min%': '10.8',
-            }, {  # else OS!="ios"
-              'mac_sdk_min%': '10.6',
-            }],
-          ],
-          'mac_sdk_path%': '',
-
-          'mac_deployment_target%': '10.6',
-        },
-
-        'mac_sdk_min': '<(mac_sdk_min)',
-        'mac_sdk_path': '<(mac_sdk_path)',
-        'mac_deployment_target': '<(mac_deployment_target)',
-
-        # Compile in Breakpad support by default so that it can be
-        # tested, even if it is not enabled by default at runtime.
-        'mac_breakpad_compiled_in%': 1,
-        'conditions': [
-          # mac_product_name is set to the name of the .app bundle as it should
-          # appear on disk.  This duplicates data from
-          # chrome/app/theme/chromium/BRANDING and
-          # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
-          # these names into the build system.
-          ['branding=="Chrome"', {
-            'mac_product_name%': 'Google Chrome',
-          }, { # else: branding!="Chrome"
-            'mac_product_name%': 'Chromium',
-          }],
-          # Official mac builds require a specific OS X SDK, but iOS and
-          # non-official mac builds do not.
-          ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
-            'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
-          }, {
-            'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
-          }],
-          ['branding=="Chrome" and buildtype=="Official"', {
-            # Enable uploading crash dumps.
-            'mac_breakpad_uploads%': 1,
-            # Enable dumping symbols at build time for use by Mac Breakpad.
-            'mac_breakpad%': 1,
-            # Enable Keystone auto-update support.
-            'mac_keystone%': 1,
-          }, { # else: branding!="Chrome" or buildtype!="Official"
-            'mac_breakpad_uploads%': 0,
-            'mac_breakpad%': 0,
-            'mac_keystone%': 0,
-          }],
-        ],
-      }],  # OS=="mac" or OS=="ios"
-      ['OS=="win"', {
-        'conditions': [
-          # This is the architecture convention used in WinSDK paths.
-          ['target_arch=="ia32"', {
-            'winsdk_arch%': 'x86',
-          },{
-            'winsdk_arch%': '<(target_arch)',
-          }],
-          ['component=="shared_library" or MSVS_VERSION == "2015"', {
-            # TODO(scottmg): The allocator shimming doesn't work on the 2015 CRT
-            # and we are hoping to be able to remove it if an additional feature
-            # lands in the 2015 CRT API. For now, don't shim and revisit once
-            # VS2015 is RTM: http://crbug.com/481611.
-            'win_use_allocator_shim%': 0,
-          }],
-          ['component=="static_library"', {
-            # Turn on multiple dll by default on Windows when in static_library.
-            'chrome_multiple_dll%': 1,
-          }],
-          ['asan==1 or syzyasan==1', {
-            'win_use_allocator_shim%': 0,
-          }],
-          ['syzyasan==1', {
-            'kasko%': 1,
-          }],
-          ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
-            # Only enabled by default for ninja because it's buggy in VS.
-            # Not enabled for component=static_library because some targets
-            # are too large and the toolchain fails due to the size of the
-            # .obj files.
-            'incremental_chrome_dll%': 1,
-          }],
-          # Don't do incremental linking for large modules on 32-bit or when
-          # component=static_library as the toolchain fails due to the size of
-          # the .ilk files.
-          ['MSVS_OS_BITS==32 or component=="static_library"', {
-            'msvs_large_module_debug_link_mode%': '1',  # No
-          },{
-            'msvs_large_module_debug_link_mode%': '2',  # Yes
-          }],
-        ],
-        'nacl_win64_defines': [
-          # This flag is used to minimize dependencies when building
-          # Native Client loader for 64-bit Windows.
-          'NACL_WIN64',
-        ],
-        # Need to include allocator target, but exclude tcmalloc files.
-        'use_allocator%': 'winheap',
-      }],
-
-      ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
-        'use_cups%': 1,
-      }, {
-        'use_cups%': 0,
-      }],
-
-      ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win") and chromecast==0', {
-        'enable_pepper_cdms%': 1,
-      }, {
-        'enable_pepper_cdms%': 0,
-      }],
-
-      ['OS=="android" or chromecast==1', {
-        'enable_browser_cdms%': 1,
-      }, {
-        'enable_browser_cdms%': 0,
-      }],
-
-      # Native Client glibc toolchain is enabled
-      # by default except on arm, mips and mips64.
-      ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
-        'disable_glibc%': 1,
-      }, {
-        'disable_glibc%': 0,
-      }],
-
-      # Set the relative path from this file to the GYP file of the JPEG
-      # library used by Chromium.
-      ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
-        # Configuration for using the system libjeg is here.
-        'libjpeg_gyp_path': '<(libjpeg_ijg_gyp_path)',
-      }, {
-        'libjpeg_gyp_path': '<(libjpeg_turbo_gyp_path)',
-      }],
-
-      # Options controlling the use of GConf (the classic GNOME configuration
-      # system) and GIO, which contains GSettings (the new GNOME config system).
-      ['chromeos==1 or embedded==1', {
-        'use_gconf%': 0,
-        'use_gio%': 0,
-      }, {
-        'use_gconf%': 1,
-        'use_gio%': 1,
-      }],
-
-      # Set up -D and -E flags passed into grit.
-      ['branding=="Chrome"', {
-        # TODO(mmoss) The .grd files look for _google_chrome, but for
-        # consistency they should look for google_chrome_build like C++.
-        'grit_defines': ['-D', '_google_chrome',
-                         '-E', 'CHROMIUM_BUILD=google_chrome'],
-      }, {
-        'grit_defines': ['-D', '_chromium',
-                         '-E', 'CHROMIUM_BUILD=chromium'],
-      }],
-      ['chromeos==1', {
-        'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
-      }],
-      ['desktop_linux==1', {
-        'grit_defines': ['-D', 'desktop_linux'],
-      }],
-      ['toolkit_views==1', {
-        'grit_defines': ['-D', 'toolkit_views'],
-      }],
-      ['use_aura==1', {
-        'grit_defines': ['-D', 'use_aura'],
-      }],
-      ['use_ash==1', {
-        'grit_defines': ['-D', 'use_ash'],
-      }],
-      ['use_nss_certs==1', {
-        'grit_defines': ['-D', 'use_nss_certs'],
-      }],
-      ['use_ozone==1', {
-        'grit_defines': ['-D', 'use_ozone'],
-      }],
-      ['image_loader_extension==1', {
-        'grit_defines': ['-D', 'image_loader_extension'],
-      }],
-      ['remoting==1', {
-        'grit_defines': ['-D', 'remoting'],
-      }],
-      ['use_titlecase_in_grd==1', {
-        'grit_defines': ['-D', 'use_titlecase'],
-      }],
-      ['use_third_party_translations==1', {
-        'grit_defines': ['-D', 'use_third_party_translations'],
-        'locales': [
-          'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
-          'ka', 'ku', 'kw', 'ms', 'ug'
-        ],
-      }],
-      ['OS=="android"', {
-        'grit_defines': [
-          '-t', 'android',
-          '-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
-          '--no-output-all-resource-defines',
-        ],
-      }],
-      ['OS=="mac" or OS=="ios"', {
-        'grit_defines': ['-D', 'scale_factors=2x'],
-      }],
-      ['OS == "ios"', {
-        'variables': {
-          'enable_coverage%': 0,
-        },
-        'grit_defines': [
-          '-t', 'ios',
-          '--no-output-all-resource-defines',
-        ],
-        # iOS uses a whitelist to filter resources.
-        'grit_whitelist%': '<(DEPTH)/build/ios/grit_whitelist.txt',
-
-        # Enable host builds when generating with ninja-ios.
-        'conditions': [
-          ['"<(GENERATOR)"=="ninja"', {
-            'host_os%': "mac",
-          }],
-
-          # Use the version of clang shipped with Xcode when building official
-          # version of Chrome for iOS.
-          #
-          # TODO(eugenebut): Remove enable_coverage check once
-          # libclang_rt.profile_ios.a is bundled with Chromium's clang.
-          # http://crbug.com/450379
-          #
-          # TODO(sdefresne): Remove xcodebuild version check onces clang ToT
-          # supports "nullable" and related. https://crbug.com/499448
-          ['buildtype=="Official" or enable_coverage or '
-            '<!(xcodebuild -version|awk \'/Xcode/{print ($2 >= 7.0)}\')==1', {
-            'clang_xcode%': 1,
-          }],
-        ],
-      }],
-      ['enable_extensions==1', {
-        'grit_defines': ['-D', 'enable_extensions'],
-      }],
-      ['enable_plugins!=0', {
-        'grit_defines': ['-D', 'enable_plugins'],
-      }],
-      ['enable_basic_printing==1 or enable_print_preview==1', {
-        'grit_defines': ['-D', 'enable_printing'],
-      }],
-      ['enable_print_preview==1', {
-        'grit_defines': ['-D', 'enable_print_preview'],
-      }],
-      ['enable_themes==1', {
-        'grit_defines': ['-D', 'enable_themes'],
-      }],
-      ['enable_app_list==1', {
-        'grit_defines': ['-D', 'enable_app_list'],
-      }],
-      ['enable_settings_app==1', {
-        'grit_defines': ['-D', 'enable_settings_app'],
-      }],
-      ['enable_google_now==1', {
-        'grit_defines': ['-D', 'enable_google_now'],
-      }],
-      ['use_concatenated_impulse_responses==1', {
-        'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
-      }],
-      ['enable_media_router==1', {
-        'grit_defines': ['-D', 'enable_media_router'],
-      }],
-      ['enable_webrtc==1', {
-        'grit_defines': ['-D', 'enable_webrtc'],
-      }],
-      ['enable_hangout_services_extension==1', {
-        'grit_defines': ['-D', 'enable_hangout_services_extension'],
-      }],
-      ['enable_task_manager==1', {
-        'grit_defines': ['-D', 'enable_task_manager'],
-      }],
-      ['notifications==1', {
-        'grit_defines': ['-D', 'enable_notifications'],
-      }],
-      ['enable_wifi_bootstrapping==1', {
-        'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
-      }],
-      ['mac_views_browser==1', {
-        'grit_defines': ['-D', 'mac_views_browser'],
-      }],
-      ['enable_resource_whitelist_generation==1 and OS!="win"', {
-        'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
-      }],
-      ['enable_resource_whitelist_generation==1 and OS=="win"', {
-        'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
-      }],
-      ['enable_mdns==1 or OS=="mac"', {
-        'grit_defines': ['-D', 'enable_service_discovery'],
-        'enable_service_discovery%': 1
-      }],
-      ['clang_use_chrome_plugins==1', {
-        'variables': {
-          'conditions': [
-            ['OS!="win"', {
-              'variables': {
-                'conditions': [
-                  ['OS=="mac" or OS=="ios"', {
-                    'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib',
-                  }, { # OS != "mac" or OS != "ios"
-                    'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so',
-                  }],
-                ],
-              },
-              'clang_dynlib_flags%': '-Xclang -load -Xclang <(clang_lib_path) ',
-            }, { # OS == "win"
-              # On Windows, the plugin is built directly into clang, so there's
-              # no need to load it dynamically.
-              'clang_dynlib_flags%': '',
-            }],
-            # https://crbug.com/441916
-            ['OS=="android" or OS=="linux" or OS=="mac"', {
-              'clang_plugin_args%': '-Xclang -plugin-arg-find-bad-constructs -Xclang check-templates ',
-            }, { # OS != "linux"
-              'clang_plugin_args%': ''
-            }],
-          ],
-        },
-        # If you change these, also change build/config/clang/BUILD.gn.
-        'clang_chrome_plugins_flags%':
-          '<(clang_dynlib_flags)'
-          '-Xclang -add-plugin -Xclang find-bad-constructs <(clang_plugin_args)',
-      }],
-      ['asan==1 or msan==1 or lsan==1 or tsan==1', {
-        'clang%': 1,
-        'use_allocator%': 'none',
-        'use_sanitizer_options%': 1,
-      }],
-
-      ['OS=="linux" and asan==0 and msan==0 and lsan==0 and tsan==0', {
-        # PNaCl toolchain Non-SFI build only supports linux OS build.
-        # Also, it does not support sanitizers.
-        'enable_nacl_nonsfi_test%': 1,
-      }],
-      ['asan==1 and OS=="linux" and chromeos==0', {
-        'use_custom_libcxx%': 1,
-      }],
-      ['ubsan==1', {
-        'clang%': 1,
-      }],
-      ['ubsan_vptr==1', {
-        'clang%': 1,
-      }],
-      ['asan==1 and OS=="mac"', {
-        'mac_strip_release': 1,
-      }],
-      ['tsan==1', {
-        'use_custom_libcxx%': 1,
-      }],
-      ['msan==1', {
-        # Use a just-built, MSan-instrumented libc++ instead of the system-wide
-        # libstdc++. This is required to avoid false positive reports whenever
-        # the C++ standard library is used.
-        'use_custom_libcxx%': 1,
-        # Running the V8-generated code on an ARM simulator is a powerful hack
-        # that allows the tool to see the memory accesses from JITted code.
-        # Without this flag, JS code causes false positive reports from MSan.
-        'v8_target_arch': 'arm64',
-      }],
-
-      ['OS=="linux" and clang_type_profiler==1', {
-        'clang%': 1,
-        'clang_use_chrome_plugins%': 0,
-        'conditions': [
-          ['host_arch=="x64"', {
-            'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
-          }],
-          ['host_arch=="ia32"', {
-            # 32-bit Clang is unsupported.  It may not build.  Put your 32-bit
-            # Clang in this directory at your own risk if needed for some
-            # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
-            # usage).  Any failure by this compiler should not close the tree.
-            'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
-          }],
-        ],
-      }],
-
-      # On valgrind bots, override the optimizer settings so we don't inline too
-      # much and make the stacks harder to figure out.
-      #
-      # TODO(rnk): Kill off variables that no one else uses and just implement
-      # them under a build_for_tool== condition.
-      ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
-        # gcc flags
-        'mac_debug_optimization': '1',
-        'mac_release_optimization': '1',
-        'release_optimize': '1',
-        'no_gc_sections': 1,
-        'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
-                              '-fno-builtin -fno-optimize-sibling-calls',
-        'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
-                                '-fno-builtin -fno-optimize-sibling-calls',
-
-        # MSVS flags for TSan on Pin and Windows.
-        'win_debug_RuntimeChecks': '0',
-        'win_debug_disable_iterator_debugging': '1',
-        'win_debug_Optimization': '1',
-        'win_debug_InlineFunctionExpansion': '0',
-        'win_release_InlineFunctionExpansion': '0',
-        'win_release_OmitFramePointers': '0',
-
-        'use_allocator': 'tcmalloc',
-        'release_valgrind_build': 1,
-        'werror': '',
-        'component': 'static_library',
-        'use_system_zlib': 0,
-      }],
-
-      # Build tweaks for DrMemory.
-      # TODO(rnk): Combine with tsan config to share the builder.
-      # http://crbug.com/108155
-      ['build_for_tool=="drmemory"', {
-        # These runtime checks force initialization of stack vars which blocks
-        # DrMemory's uninit detection.
-        'win_debug_RuntimeChecks': '0',
-        # Iterator debugging is slow.
-        'win_debug_disable_iterator_debugging': '1',
-        # Try to disable optimizations that mess up stacks in a release build.
-        # DrM-i#1054 (https://github.com/DynamoRIO/drmemory/issues/1054)
-        # /O2 and /Ob0 (disable inline) cannot be used together because of a
-        # compiler bug, so we use /Ob1 instead.
-        'win_release_InlineFunctionExpansion': '1',
-        'win_release_OmitFramePointers': '0',
-        # Ditto for debug, to support bumping win_debug_Optimization.
-        'win_debug_InlineFunctionExpansion': 0,
-        'win_debug_OmitFramePointers': 0,
-        # Keep the code under #ifndef NVALGRIND.
-        'release_valgrind_build': 1,
-      }],
-
-      # RLZ library is used on Win, Mac, iOS and ChromeOS.
-      ['OS=="win" or OS=="mac" or OS=="ios" or chromeos==1', {
-        'enable_rlz_support%': 1,
-        'conditions': [
-          # RLZ is enabled for "Chrome" builds.
-          ['branding=="Chrome"', {
-            'enable_rlz%': 1,
-          }],
-        ],
-      }],
-
-      # Set default compiler flags depending on ARM version.
-      ['arm_version==6', {
-        'arm_arch%': 'armv6',
-        'arm_tune%': '',
-        'arm_fpu%': 'vfp',
-        'arm_float_abi%': 'softfp',
-        'arm_thumb%': 0,
-      }],
-      ['arm_version==7', {
-        'arm_arch%': 'armv7-a',
-        'arm_tune%': 'generic-armv7-a',
-        'conditions': [
-          ['arm_neon==1', {
-            'arm_fpu%': 'neon',
-          }, {
-            'arm_fpu%': 'vfpv3-d16',
-          }],
-          ['OS=="android"', {
-            'arm_float_abi%': 'softfp',
-          }, {
-            'arm_float_abi%': 'hard',
-          }],
-        ],
-        'arm_thumb%': 1,
-      }],
-
-      # Set default compiler flags for MIPS floating-point support.
-      ['target_arch=="mipsel"', {
-        'mips_float_abi%': 'hard',
-      }],
-      ['target_arch=="mipsel" and mips_arch_variant=="r2"', {
-        'mips_fpu_mode%': 'fp32',
-      }],
-
-      # Enable brlapi by default for chromeos.
-      [ 'chromeos==1', {
-        'use_brlapi%': 1,
-      }],
-
-      ['use_ozone==1 and ozone_auto_platforms==1', {
-        # Use test as the default platform.
-        'ozone_platform%': 'test',
-
-        # Build all platforms whose deps are in install-build-deps.sh.
-        # Only these platforms will be compile tested by buildbots.
-        'ozone_platform_drm%': 1,
-        'ozone_platform_test%': 1,
-        'ozone_platform_egltest%': 1,
-      }],
-
-      ['desktop_linux==1 and use_aura==1 and use_x11==1', {
-        'use_clipboard_aurax11%': 1,
-      }],
-
-      ['OS=="win" and use_goma==1', {
-        # goma doesn't support pch yet.
-        'chromium_win_pch': 0,
-        # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
-        'conditions': [
-          ['win_z7==0 and fastbuild==0', {
-            'fastbuild': 1,
-          }],
-        ],
-      }],
-
-      ['OS=="win" and (clang==1 or asan==1)', {
-        'chromium_win_pch': 0,
-      }],
-
-      ['host_clang==1', {
-        'host_cc': '<(make_clang_dir)/bin/clang',
-        'host_cxx': '<(make_clang_dir)/bin/clang++',
-      }, {
-        'host_cc': '<!(which gcc)',
-        'host_cxx': '<!(which g++)',
-      }],
-
-      # The seccomp-bpf sandbox is only supported on five architectures
-      # currently.
-      # Do not disable seccomp_bpf anywhere without talking to
-      # security@chromium.org!
-      ['((OS=="linux" or OS=="android") and '
-           '(target_arch=="ia32" or target_arch=="x64" or '
-             'target_arch=="arm" or target_arch=="mipsel" or '
-             'target_arch=="arm64"))', {
-         'use_seccomp_bpf%': 1,
-      }, {
-         'use_seccomp_bpf%': 0,
-      }],
-
-      ['cfi_vptr==1', {
-        'use_lto%': 1,
-      }],
-
-      ['branding=="Chrome" and buildtype=="Official"', {
-        'enable_hangout_services_extension%': 1,
-      }, {
-        'enable_hangout_services_extension%': 0,
-      }],
-    ],
-
-    # The path to the ANGLE library.
-    'angle_path': '<(DEPTH)/third_party/angle',
-
-    # List of default apps to install in new profiles.  The first list contains
-    # the source files as found in svn.  The second list, used only for linux,
-    # contains the destination location for each of the files.  When a crx
-    # is added or removed from the list, the chrome/browser/resources/
-    # default_apps/external_extensions.json file must also be updated.
-    #
-    # README: GN version of these is in the target //chrome:default_apps
-    # (there's no global variable like in GYP). Be sure to update that target
-    # if you change these lists!
-    'default_apps_list': [
-      'browser/resources/default_apps/external_extensions.json',
-      'browser/resources/default_apps/gmail.crx',
-      'browser/resources/default_apps/search.crx',
-      'browser/resources/default_apps/youtube.crx',
-      'browser/resources/default_apps/drive.crx',
-      'browser/resources/default_apps/docs.crx',
-    ],
-    'default_apps_list_linux_dest': [
-      '<(PRODUCT_DIR)/default_apps/external_extensions.json',
-      '<(PRODUCT_DIR)/default_apps/gmail.crx',
-      '<(PRODUCT_DIR)/default_apps/search.crx',
-      '<(PRODUCT_DIR)/default_apps/youtube.crx',
-      '<(PRODUCT_DIR)/default_apps/drive.crx',
-      '<(PRODUCT_DIR)/default_apps/docs.crx',
-    ],
-
-    # Whether to allow building of the GPU-related isolates.
-    'archive_gpu_tests%': 0,
-
-     # Whether to allow building of chromoting related isolates.
-    'archive_chromoting_tests%': 0,
-  },
-  'target_defaults': {
-    'variables': {
-      # The condition that operates on chromium_code is in a target_conditions
-      # section, and will not have access to the default fallback value of
-      # chromium_code at the top of this file, or to the chromium_code
-      # variable placed at the root variables scope of .gyp files, because
-      # those variables are not set at target scope.  As a workaround,
-      # if chromium_code is not set at target scope, define it in target scope
-      # to contain whatever value it has during early variable expansion.
-      # That's enough to make it available during target conditional
-      # processing.
-      'chromium_code%': '<(chromium_code)',
-
-      'component%': '<(component)',
-
-      'chromecast%': '<(chromecast)',
-
-      # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
-      'win_release_Optimization%': '2', # 2 = /O2
-      'win_debug_Optimization%': '0',   # 0 = /Od
-
-      # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
-      # Tri-state: blank is default, 1 on, 0 off
-      'win_release_OmitFramePointers%': '0',
-      # Tri-state: blank is default, 1 on, 0 off
-      'win_debug_OmitFramePointers%': '',
-
-      # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
-      'win_debug_RuntimeChecks%': '3',    # 3 = all checks enabled, 0 = off
-
-      # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
-      'win_debug_InlineFunctionExpansion%': '',    # empty = default, 0 = off,
-      'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
-
-      # VS inserts quite a lot of extra checks to algorithms like
-      # std::partial_sort in Debug build which make them O(N^2)
-      # instead of O(N*logN). This is particularly slow under memory
-      # tools like ThreadSanitizer so we want it to be disablable.
-      # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
-      'win_debug_disable_iterator_debugging%': '0',
-
-      # An application manifest fragment to declare compatibility settings for
-      # 'executable' targets. Ignored in other target type.
-      'win_exe_compatibility_manifest%':
-          '<(DEPTH)\\build\\win\\compatibility.manifest',
-
-      'release_extra_cflags%': '',
-      'debug_extra_cflags%': '',
-
-      'release_valgrind_build%': '<(release_valgrind_build)',
-
-      # the non-qualified versions are widely assumed to be *nix-only
-      'win_release_extra_cflags%': '',
-      'win_debug_extra_cflags%': '',
-
-      # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
-      'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
-
-      # Only used by Windows build for now.  Can be used to build into a
-      # differet output directory, e.g., a build_dir_prefix of VS2010_ would
-      # output files in src/build/VS2010_{Debug,Release}.
-      'build_dir_prefix%': '',
-
-      # Targets are by default not nacl untrusted code.
-      'nacl_untrusted_build%': 0,
-
-      'pnacl_compile_flags': [
-        # pnacl uses the clang compiler so we need to suppress all the
-        # same warnings as we do for clang.
-        # TODO(sbc): Remove these if/when they are removed from the clang
-        # build.
-        '-Wno-unused-function',
-        '-Wno-char-subscripts',
-        '-Wno-c++11-extensions',
-        '-Wno-unnamed-type-template-args',
-      ],
-
-      # By default, Android targets have their exported JNI symbols stripped,
-      # so we test the manual JNI registration code paths that are required
-      # when using the crazy linker. To allow use of native JNI exports (lazily
-      # resolved by the JVM), targets can enable this variable, which will stop
-      # the stripping from happening. Only targets which do not need to be
-      # compatible with the crazy linker are permitted to set this.
-      'use_native_jni_exports%': 0,
-
-      'conditions': [
-        ['OS=="win" and component=="shared_library"', {
-          # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
-          'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
-          'win_debug_RuntimeLibrary%': '3',   # 3 = /MDd (debug DLL)
-        }, {
-          # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
-          'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
-          'win_debug_RuntimeLibrary%': '1',   # 1 = /MTd (debug static)
-        }],
-        ['OS=="ios"', {
-          # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
-          'mac_release_optimization%': 's', # Use -Os unless overridden
-          'mac_debug_optimization%': '0',   # Use -O0 unless overridden
-        }, {
-          # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
-          'mac_release_optimization%': '2', # Use -O2 unless overridden
-          'mac_debug_optimization%': '0',   # Use -O0 unless overridden
-        }],
-        ['OS=="android"', {
-          'host_os%': '<(host_os)',  # See comment above chromium_code.
-        }],
-      ],
-      'clang_warning_flags': [
-        '-Wheader-hygiene',
-
-        # Don't die on dtoa code that uses a char as an array index.
-        # This is required solely for base/third_party/dmg_fp/dtoa.cc.
-        '-Wno-char-subscripts',
-
-        # TODO(thakis): This used to be implied by -Wno-unused-function,
-        # which we no longer use. Check if it makes sense to remove
-        # this as well. http://crbug.com/316352
-        '-Wno-unneeded-internal-declaration',
-
-        # Warns on switches on enums that cover all enum values but
-        # also contain a default: branch. Chrome is full of that.
-        '-Wno-covered-switch-default',
-
-        # Warns when a const char[] is converted to bool.
-        '-Wstring-conversion',
-
-        # C++11-related flags:
-
-        # This warns on using ints as initializers for floats in
-        # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
-        # which happens in several places in chrome code. Not sure if
-        # this is worth fixing.
-        '-Wno-c++11-narrowing',
-
-        # Clang considers the `register` keyword as deprecated, but e.g.
-        # code generated by flex (used in angle) contains that keyword.
-        # http://crbug.com/255186
-        '-Wno-deprecated-register',
-
-        # TODO(hans): Get this cleaned up, http://crbug.com/428099
-        '-Wno-inconsistent-missing-override',
-
-        # TODO(thakis): Enable this, crbug.com/507717
-        '-Wno-shift-negative-value',
-      ],
-    },
-    'includes': [ 'set_clang_warning_flags.gypi', ],
-    'defines': [
-      # Don't use deprecated V8 APIs anywhere.
-      'V8_DEPRECATION_WARNINGS',
-    ],
-    'include_dirs': [
-      '<(SHARED_INTERMEDIATE_DIR)',
-    ],
-    'conditions': [
-      ['OS=="mac"', {
-        # When compiling Objective C, warns if a method is used whose
-        # availability is newer than the deployment target.
-        'xcode_settings': { 'WARNING_CFLAGS': ['-Wpartial-availability']},
-      }],
-      ['(OS=="mac" or OS=="ios") and asan==1', {
-        'dependencies': [
-          '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
-        ],
-      }],
-      ['OS=="win" and asan==1 and component=="shared_library"', {
-        'dependencies': [
-          '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
-        ],
-      }],
-      ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
-        'cflags_cc!': ['-fno-rtti'],
-        'cflags_cc+': [
-          '-frtti',
-          '-gline-tables-only',
-          '-fintercept-allocation-functions',
-        ],
-        'defines': ['TYPE_PROFILING'],
-        'dependencies': [
-          '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
-        ],
-      }],
-      ['branding=="Chrome"', {
-        'defines': ['GOOGLE_CHROME_BUILD'],
-      }, {  # else: branding!="Chrome"
-        'defines': ['CHROMIUM_BUILD'],
-      }],
-      ['OS=="mac" and component=="shared_library"', {
-        'xcode_settings': {
-          'DYLIB_INSTALL_NAME_BASE': '@rpath',
-          'LD_RUNPATH_SEARCH_PATHS': [
-            # For unbundled binaries.
-            '@loader_path/.',
-            # For bundled binaries, to get back from Binary.app/Contents/MacOS.
-            '@loader_path/../../..',
-          ],
-        },
-      }],
-      ['clang==1 or host_clang==1', {
-        # This is here so that all files get recompiled after a clang roll and
-        # when turning clang on or off.
-        # (defines are passed via the command line, and build systems rebuild
-        # things when their commandline changes). Nothing should ever read this
-        # define.
-        'defines': ['CR_CLANG_REVISION=<!(python <(DEPTH)/tools/clang/scripts/update.py --print-revision)'],
-      }],
-      ['enable_rlz==1', {
-        'defines': ['ENABLE_RLZ'],
-      }],
-      ['component=="shared_library"', {
-        'defines': ['COMPONENT_BUILD'],
-      }],
-      ['ui_compositor_image_transport==1', {
-        'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
-      }],
-      ['use_aura==1', {
-        'defines': ['USE_AURA=1'],
-      }],
-      ['use_ash==1', {
-        'defines': ['USE_ASH=1'],
-      }],
-      ['use_pango==1', {
-        'defines': ['USE_PANGO=1'],
-      }],
-      ['use_cairo==1', {
-        'defines': ['USE_CAIRO=1'],
-      }],
-      ['use_cras==1', {
-        'defines': ['USE_CRAS=1'],
-      }],
-      ['use_ozone==1', {
-        'defines': ['USE_OZONE=1'],
-      }],
-      ['use_default_render_theme==1', {
-        'defines': ['USE_DEFAULT_RENDER_THEME=1'],
-      }],
-      ['use_libjpeg_turbo==1', {
-        'defines': ['USE_LIBJPEG_TURBO=1'],
-      }],
-      ['use_x11==1', {
-        'defines': ['USE_X11=1'],
-      }],
-      ['use_clipboard_aurax11==1', {
-        'defines': ['USE_CLIPBOARD_AURAX11=1'],
-      }],
-      ['enable_one_click_signin==1', {
-        'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
-      }],
-      ['enable_pre_sync_backup==1', {
-        'defines': ['ENABLE_PRE_SYNC_BACKUP'],
-      }],
-      ['image_loader_extension==1', {
-        'defines': ['IMAGE_LOADER_EXTENSION=1'],
-      }],
-      ['profiling==1', {
-        'defines': ['ENABLE_PROFILING=1'],
-      }],
-      ['remoting==1', {
-        'defines': ['ENABLE_REMOTING=1'],
-      }],
-      ['enable_webrtc==1', {
-        'defines': ['ENABLE_WEBRTC=1'],
-      }],
-      ['enable_media_router==1', {
-        'defines': ['ENABLE_MEDIA_ROUTER=1'],
-      }],
-      ['proprietary_codecs==1', {
-        'defines': ['USE_PROPRIETARY_CODECS'],
-        'conditions': [
-          ['enable_mpeg2ts_stream_parser==1', {
-            'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
-          }],
-        ],
-      }],
-      ['enable_viewport==1', {
-        'defines': ['ENABLE_VIEWPORT'],
-      }],
-      ['enable_pepper_cdms==1', {
-        'defines': ['ENABLE_PEPPER_CDMS'],
-      }],
-      ['enable_browser_cdms==1', {
-        'defines': ['ENABLE_BROWSER_CDMS'],
-      }],
-      ['configuration_policy==1', {
-        'defines': ['ENABLE_CONFIGURATION_POLICY'],
-      }],
-      ['notifications==1', {
-        'defines': ['ENABLE_NOTIFICATIONS'],
-      }],
-      ['enable_hidpi==1', {
-        'defines': ['ENABLE_HIDPI=1'],
-      }],
-      ['enable_topchrome_md==1', {
-        'defines': ['ENABLE_TOPCHROME_MD=1'],
-      }],
-      ['native_memory_pressure_signals==1', {
-        'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
-      }],
-      ['use_udev==1', {
-        'defines': ['USE_UDEV'],
-      }],
-      ['fastbuild!=0', {
-        'xcode_settings': {
-          'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
-        },
-        'conditions': [
-          ['OS=="win" and fastbuild==2', {
-            # Completely disable debug information.
-            'msvs_settings': {
-              'VCLinkerTool': {
-                'GenerateDebugInformation': 'false',
-              },
-              'VCCLCompilerTool': {
-                'DebugInformationFormat': '0',
-              },
-            },
-          }],
-          ['OS=="win" and fastbuild==1', {
-            'msvs_settings': {
-              'VCLinkerTool': {
-                # This tells the linker to generate .pdbs, so that
-                # we can get meaningful stack traces.
-                'GenerateDebugInformation': 'true',
-              },
-              'VCCLCompilerTool': {
-                # No debug info to be generated by compiler.
-                'DebugInformationFormat': '0',
-              },
-            },
-          }],
-          ['(OS=="android" or OS=="linux") and fastbuild==2', {
-            'variables': { 'debug_extra_cflags': '-g0', },
-          }],
-          ['(OS=="android" or OS=="linux") and fastbuild==1', {
-            # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
-            # fixed.
-            'variables': { 'debug_extra_cflags': '-g0', },
-          }],
-          # Android builds symbols on release by default, disable them.
-          ['OS=="android" and fastbuild==2', {
-            'variables': { 'release_extra_cflags': '-g0', },
-          }],
-          ['OS=="android" and fastbuild==1', {
-            # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
-            # fixed.
-            'variables': { 'release_extra_cflags': '-g0', },
-          }],
-        ],
-      }],  # fastbuild!=0
-      ['dont_embed_build_metadata==1', {
-        'defines': [
-          'DONT_EMBED_BUILD_METADATA',
-        ],
-      }],  # dont_embed_build_metadata==1
-      ['dcheck_always_on!=0', {
-        'defines': ['DCHECK_ALWAYS_ON=1'],
-      }],  # dcheck_always_on!=0
-      ['tracing_like_official_build!=0', {
-        'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
-      }],  # tracing_like_official_build!=0
-      ['OS=="win"', {
-        'defines': ['NO_TCMALLOC'],
-        'conditions': [
-          ['win_use_allocator_shim==1', {
-            'defines': ['ALLOCATOR_SHIM'],
-          }],
-        ],
-      }],
-      ['asan==1', {
-        'defines': [
-          'ADDRESS_SANITIZER',
-          'MEMORY_TOOL_REPLACES_ALLOCATOR',
-          'MEMORY_SANITIZER_INITIAL_SIZE',
-        ],
-      }],
-      ['syzyasan==1', {
-        # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
-        'msvs_settings': {
-          'VCLinkerTool': {
-            'Profile': 'true',
-          },
-        },
-        'defines': [
-            'SYZYASAN',
-            'MEMORY_TOOL_REPLACES_ALLOCATOR',
-            'MEMORY_SANITIZER_INITIAL_SIZE',
-        ],
-      }],
-      ['kasko==1', {
-        'defines': [
-            'KASKO',
-        ],
-        'include_dirs': [
-          '<(DEPTH)/third_party/kasko/include',
-        ],
-      }],
-      ['OS=="win"', {
-        'defines': [
-          '__STD_C',
-          '_CRT_SECURE_NO_DEPRECATE',
-          '_SCL_SECURE_NO_DEPRECATE',
-          # This define is required to pull in the new Win8 interfaces from
-          # system headers like ShObjIdl.h.
-          'NTDDI_VERSION=0x06030000',
-          # This is required for ATL to use XP-safe versions of its functions.
-          '_USING_V110_SDK71_',
-        ],
-        'include_dirs': [
-          '<(DEPTH)/third_party/wtl/include',
-        ],
-        'conditions': [
-          ['win_z7!=0', {
-            'msvs_settings': {
-              # Generates debug info when win_z7=1
-              # even if fastbuild=1 (that makes GenerateDebugInformation false).
-              'VCLinkerTool': {
-                'GenerateDebugInformation': 'true',
-              },
-              'VCCLCompilerTool': {
-                'DebugInformationFormat': '1',
-              }
-            }
-          }],  # win_z7!=0
-          ['win_analyze', {
-            'defines!': [
-              # This is prohibited when running /analyze.
-              '_USING_V110_SDK71_',
-            ],
-            'msvs_settings': {
-              'VCCLCompilerTool': {
-                # Set WarnAsError to false to disable this setting for most
-                # projects so that compilation continues.
-                'WarnAsError': 'false',
-                # When win_analyze is specified add the /analyze switch.
-                # Also add /WX- to force-disable WarnAsError for projects that
-                # override WarnAsError.
-                # Also, disable various noisy warnings that have low value.
-                'AdditionalOptions': [
-                  '/analyze:WX-',
-                  '/wd6011',  # Dereferencing NULL pointer
-                  '/wd6312',  # Possible infinite loop: use of the constant
-                    # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
-                  '/wd6326',  # Potential comparison of constant with constant
-                  '/wd28159', # Consider using 'GetTickCount64'
-                  '/wd28204', # Inconsistent SAL annotations
-                  '/wd28251', # Inconsistent SAL annotations
-                  '/wd28252', # Inconsistent SAL annotations
-                  '/wd28253', # Inconsistent SAL annotations
-                  '/wd28196', # The precondition is not satisfied
-                  '/wd28301', # Inconsistent SAL annotations
-                  '/wd6340',  # Sign mismatch in function parameter
-                  '/wd28182', # Dereferencing NULL pointer
-                  # C6285 is ~16% of raw warnings and has low value
-                  '/wd6285',  # non-zero constant || non-zero constant
-                  # C6334 is ~80% of raw warnings and has low value
-                  '/wd6334',  # sizeof applied to an expression with an operator
-                ],
-              },
-            },
-          }],  # win_analyze
-        ],
-      }],  # OS==win
-      ['chromecast==1', {
-        'defines': [
-          'LOG_DISABLED=0',
-        ],
-        'conditions': [
-          ['use_playready==1', {
-            'defines': [
-              'PLAYREADY_CDM_AVAILABLE',
-            ],
-          }],
-        ],
-      }],
-      ['enable_task_manager==1', {
-        'defines': [
-          'ENABLE_TASK_MANAGER=1',
-        ],
-      }],
-      ['enable_extensions==1', {
-        'defines': [
-          'ENABLE_EXTENSIONS=1',
-        ],
-      }],
-      ['OS=="win" and branding=="Chrome"', {
-        'defines': ['ENABLE_SWIFTSHADER'],
-      }],
-      ['enable_dart==1', {
-        'defines': ['WEBKIT_USING_DART=1'],
-      }],
-      ['enable_plugin_installation==1', {
-        'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
-      }],
-      ['enable_plugins==1', {
-        'defines': ['ENABLE_PLUGINS=1'],
-      }],
-      ['enable_session_service==1', {
-        'defines': ['ENABLE_SESSION_SERVICE=1'],
-      }],
-      ['enable_themes==1', {
-        'defines': ['ENABLE_THEMES=1'],
-      }],
-      ['enable_autofill_dialog==1', {
-        'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
-      }],
-      ['enable_prod_wallet_service==1', {
-        # In GN, this is set on the autofill tagets only. See
-        # //components/autofill/core/browser:wallet_service
-        'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
-      }],
-      ['enable_background==1', {
-        'defines': ['ENABLE_BACKGROUND=1'],
-      }],
-      ['enable_google_now==1', {
-        'defines': ['ENABLE_GOOGLE_NOW=1'],
-      }],
-      ['cld_version!=0', {
-        'defines': ['CLD_VERSION=<(cld_version)'],
-      }],
-      ['enable_basic_printing==1 or enable_print_preview==1', {
-        # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
-        'defines': ['ENABLE_PRINTING=1'],
-      }],
-      ['enable_basic_printing==1', {
-        # Enable basic printing support and UI.
-        'defines': ['ENABLE_BASIC_PRINTING=1'],
-      }],
-      ['enable_print_preview==1', {
-        # Enable printing with print preview.
-        # Can be defined without ENABLE_BASIC_PRINTING.
-        'defines': ['ENABLE_PRINT_PREVIEW=1'],
-      }],
-      ['enable_spellcheck==1', {
-        'defines': ['ENABLE_SPELLCHECK=1'],
-      }],
-      ['use_platform_spellchecker', {
-        'defines': ['USE_PLATFORM_SPELLCHECKER=1'],
-      }],
-      ['enable_captive_portal_detection==1', {
-        'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
-      }],
-      ['enable_app_list==1', {
-        'defines': ['ENABLE_APP_LIST=1'],
-      }],
-      ['enable_settings_app==1', {
-        'defines': ['ENABLE_SETTINGS_APP=1'],
-      }],
-      ['disable_file_support==1', {
-        'defines': ['DISABLE_FILE_SUPPORT=1'],
-      }],
-      ['disable_ftp_support==1', {
-        'defines': ['DISABLE_FTP_SUPPORT=1'],
-      }],
-      ['enable_supervised_users==1', {
-        'defines': ['ENABLE_SUPERVISED_USERS=1'],
-      }],
-      ['enable_mdns==1', {
-        'defines': ['ENABLE_MDNS=1'],
-      }],
-      ['enable_service_discovery==1', {
-        'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
-      }],
-      ['enable_wifi_bootstrapping==1', {
-        'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
-      }],
-      ['enable_hangout_services_extension==1', {
-        'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
-      }],
-      ['enable_ipc_fuzzer==1', {
-        'defines': ['ENABLE_IPC_FUZZER=1'],
-      }],
-      ['video_hole==1', {
-        'defines': ['VIDEO_HOLE=1'],
-      }],
-      ['v8_use_external_startup_data==1', {
-       'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
-      }],
-      ['enable_webvr==1', {
-        'defines': ['ENABLE_WEBVR'],
-      }],
-
-      # SAFE_BROWSING_SERVICE - browser manages a safe-browsing service.
-      # SAFE_BROWSING_DB_LOCAL - service manages a local database.
-      # SAFE_BROWSING_DB_REMOTE - service talks via API to a database
-      # SAFE_BROWSING_CSD - enable client-side phishing detection.
-      ['safe_browsing==1', {
-        'defines': [
-          # TODO(nparker): Remove existing uses of FULL_SAFE_BROWSING
-          'FULL_SAFE_BROWSING',
-          'SAFE_BROWSING_CSD',
-          'SAFE_BROWSING_DB_LOCAL',
-          'SAFE_BROWSING_SERVICE',
-        ],
-      }],
-      ['safe_browsing==2', {
-        'defines': [
-          # TODO(nparker): Remove existing uses of MOBILE_SAFE_BROWSING
-          'MOBILE_SAFE_BROWSING',
-          'SAFE_BROWSING_SERVICE',
-        ],
-      }],
-      ['safe_browsing==3', {
-        'defines': [
-          # TODO(nparker): Remove existing uses of MOBILE_SAFE_BROWSING
-          'MOBILE_SAFE_BROWSING',
-          'SAFE_BROWSING_DB_REMOTE',
-          'SAFE_BROWSING_SERVICE',
-        ],
-      }],
-    ],  # conditions for 'target_defaults'
-    'target_conditions': [
-      ['<(use_libpci)==1', {
-        'defines': ['USE_LIBPCI=1'],
-      }],
-      ['<(use_openssl)==1', {
-        'defines': ['USE_OPENSSL=1'],
-      }],
-      ['<(use_openssl_certs)==1', {
-        'defines': ['USE_OPENSSL_CERTS=1'],
-      }],
-      ['>(nacl_untrusted_build)==1', {
-        'defines': [
-          'USE_OPENSSL=1',
-          'USE_OPENSSL_CERTS=1',
-        ],
-      }],
-      ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
-        'defines': ['USE_GLIB=1'],
-      }],
-      ['<(use_nss_certs)==1 and >(nacl_untrusted_build)==0', {
-        'defines': ['USE_NSS_CERTS=1'],
-      }],
-      ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
-        'defines': ['OS_CHROMEOS=1'],
-      }],
-      ['enable_wexit_time_destructors==1 and OS!="win"', {
-        # TODO: Enable on Windows too, http://crbug.com/404525
-        'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
-      }],
-      ['chromium_code==0', {
-        'variables': {
-          'clang_warning_flags': [
-            # TODO(mgiuca): Move this suppression into individual third-party
-            # libraries as required. http://crbug.com/505301.
-            '-Wno-overloaded-virtual',
-            # Lots of third-party libraries have unused variables. Instead of
-            # suppressing them individually, we just blanket suppress them here.
-            '-Wno-unused-variable',
-          ],
-        },
-        'conditions': [
-          [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
-            # We don't want to get warnings from third-party code,
-            # so remove any existing warning-enabling flags like -Wall.
-            'cflags!': [
-              '-Wall',
-              '-Wextra',
-            ],
-            'cflags_cc': [
-              # Don't warn about hash_map in third-party code.
-              '-Wno-deprecated',
-            ],
-            'cflags': [
-              # Don't warn about printf format problems.
-              # This is off by default in gcc but on in Ubuntu's gcc(!).
-              '-Wno-format',
-            ],
-            'cflags_cc!': [
-              # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
-              '-Wsign-compare',
-            ]
-          }],
-          # TODO: Fix all warnings on chromeos too.
-          [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
-            'cflags!': [
-              '-Werror',
-            ],
-          }],
-          [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
-            'cflags': [
-              # Don't warn about ignoring the return value from e.g. close().
-              # This is off by default in some gccs but on by default in others.
-              # BSD systems do not support this option, since they are usually
-              # using gcc 4.2.1, which does not have this flag yet.
-              '-Wno-unused-result',
-            ],
-          }],
-          [ 'OS=="win"', {
-            'defines': [
-              '_CRT_SECURE_NO_DEPRECATE',
-              '_CRT_NONSTDC_NO_WARNINGS',
-              '_CRT_NONSTDC_NO_DEPRECATE',
-              '_SCL_SECURE_NO_DEPRECATE',
-            ],
-            'msvs_disabled_warnings': [
-              4800,
-            ],
-            'msvs_settings': {
-              'VCCLCompilerTool': {
-                'WarningLevel': '3',
-                'WarnAsError': 'true',
-                'Detect64BitPortabilityProblems': 'false',
-              },
-            },
-            'conditions': [
-              ['buildtype=="Official"', {
-                'msvs_settings': {
-                  'VCCLCompilerTool': { 'WarnAsError': 'false' },
-                }
-              }],
-              [ 'component=="shared_library"', {
-              # TODO(darin): Unfortunately, some third_party code depends on base.
-                'msvs_disabled_warnings': [
-                  4251,  # class 'std::xx' needs to have dll-interface.
-                 ],
-              }],
-            ],
-          }],
-
-          [ 'OS=="mac" or OS=="ios"', {
-            'xcode_settings': {
-              'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
-            },
-            'conditions': [
-              ['buildtype=="Official"', {
-                'xcode_settings': {
-                  'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',    # -Werror
-                },
-              }],
-            ],
-          }],
-          [ 'OS=="ios"', {
-            'xcode_settings': {
-              # TODO(ios): Fix remaining warnings in third-party code, then
-              # remove this; the Mac cleanup didn't get everything that's
-              # flagged in an iOS build.
-              'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
-              'RUN_CLANG_STATIC_ANALYZER': 'NO',
-              # Several internal ios directories generate numerous warnings for
-              # -Wobjc-missing-property-synthesis.
-              'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
-            },
-          }],
-        ],
-      }, {
-        'includes': [
-           # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
-          'filename_rules.gypi',
-        ],
-        # In Chromium code, we define __STDC_foo_MACROS in order to get the
-        # C99 macros on Mac and Linux.
-        'defines': [
-          '__STDC_CONSTANT_MACROS',
-          '__STDC_FORMAT_MACROS',
-        ],
-        'conditions': [
-          ['OS=="win"', {
-            # turn on warnings for signed/unsigned mismatch on chromium code.
-            'msvs_settings': {
-              'VCCLCompilerTool': {
-                'AdditionalOptions': ['/we4389'],
-              },
-            },
-          }],
-          ['OS=="win" and component=="shared_library"', {
-            'msvs_disabled_warnings': [
-              4251,  # class 'std::xx' needs to have dll-interface.
-            ],
-          }],
-        ],
-      }],
-    ],  # target_conditions for 'target_defaults'
-    'default_configuration': 'Debug',
-    'configurations': {
-      # VCLinkerTool LinkIncremental values below:
-      #   0 == default
-      #   1 == /INCREMENTAL:NO
-      #   2 == /INCREMENTAL
-      # Debug links incremental, Release does not.
-      #
-      # Abstract base configurations to cover common attributes.
-      #
-      'Common_Base': {
-        'abstract': 1,
-        'msvs_configuration_attributes': {
-          'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
-          'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
-          'CharacterSet': '1',
-        },
-        'msvs_settings':{
-          'VCCLCompilerTool': {
-            'AdditionalOptions': [
-              '/bigobj',
-            ],
-          },
-          'VCLinkerTool': {
-            # Add the default import libs.
-            'AdditionalDependencies': [
-              'kernel32.lib',
-              'gdi32.lib',
-              'winspool.lib',
-              'comdlg32.lib',
-              'advapi32.lib',
-              'shell32.lib',
-              'ole32.lib',
-              'oleaut32.lib',
-              'user32.lib',
-              'uuid.lib',
-              'odbc32.lib',
-              'odbccp32.lib',
-              'delayimp.lib',
-              'credui.lib',
-              'netapi32.lib',
-            ],
-            'AdditionalOptions': [
-              # Suggested by Microsoft Devrel to avoid
-              #   LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
-              # which started happening more regularly after VS2013 Update 4.
-              # Needs to be a bit lower for VS2015, or else errors out.
-              '/maxilksize:0x7ff00000',
-            ],
-          },
-        },
-      },
-      'x86_Base': {
-        'abstract': 1,
-        'msvs_settings': {
-          'VCLinkerTool': {
-            'MinimumRequiredVersion': '5.01',  # XP.
-            'TargetMachine': '1',
-          },
-          'VCLibrarianTool': {
-            'TargetMachine': '1',
-          },
-        },
-        'msvs_configuration_platform': 'Win32',
-      },
-      'x64_Base': {
-        'abstract': 1,
-        'msvs_configuration_platform': 'x64',
-        'msvs_settings': {
-          'VCLinkerTool': {
-            # Make sure to understand http://crbug.com/361720 if you want to
-            # increase this.
-            'MinimumRequiredVersion': '5.02',  # Server 2003.
-            'TargetMachine': '17', # x86 - 64
-            'AdditionalLibraryDirectories!':
-              ['<(windows_sdk_path)/Lib/win8/um/x86'],
-            'AdditionalLibraryDirectories':
-              ['<(windows_sdk_path)/Lib/win8/um/x64'],
-            # Doesn't exist x64 SDK. Should use oleaut32 in any case.
-            'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
-          },
-          'VCLibrarianTool': {
-            'AdditionalLibraryDirectories!':
-              ['<(windows_sdk_path)/Lib/win8/um/x86'],
-            'AdditionalLibraryDirectories':
-              ['<(windows_sdk_path)/Lib/win8/um/x64'],
-            'TargetMachine': '17', # x64
-          },
-        },
-      },
-      'Debug_Base': {
-        'abstract': 1,
-        'defines': [
-          'DYNAMIC_ANNOTATIONS_ENABLED=1',
-          'WTF_USE_DYNAMIC_ANNOTATIONS=1',
-        ],
-        'xcode_settings': {
-          'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
-          'OTHER_CFLAGS': [
-            '<@(debug_extra_cflags)',
-          ],
-        },
-        'msvs_settings': {
-          'VCCLCompilerTool': {
-            'Optimization': '<(win_debug_Optimization)',
-            'PreprocessorDefinitions': ['_DEBUG'],
-            'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
-            'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
-            'conditions': [
-              # According to MSVS, InlineFunctionExpansion=0 means
-              # "default inlining", not "/Ob0".
-              # Thus, we have to handle InlineFunctionExpansion==0 separately.
-              ['win_debug_InlineFunctionExpansion==0', {
-                'AdditionalOptions': ['/Ob0'],
-              }],
-              ['win_debug_InlineFunctionExpansion!=""', {
-                'InlineFunctionExpansion':
-                  '<(win_debug_InlineFunctionExpansion)',
-              }],
-              ['win_debug_disable_iterator_debugging==1', {
-                'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
-              }],
-
-              # if win_debug_OmitFramePointers is blank, leave as default
-              ['win_debug_OmitFramePointers==1', {
-                'OmitFramePointers': 'true',
-              }],
-              ['win_debug_OmitFramePointers==0', {
-                'OmitFramePointers': 'false',
-                # The above is not sufficient (http://crbug.com/106711): it
-                # simply eliminates an explicit "/Oy", but both /O2 and /Ox
-                # perform FPO regardless, so we must explicitly disable.
-                # We still want the false setting above to avoid having
-                # "/Oy /Oy-" and warnings about overriding.
-                'AdditionalOptions': ['/Oy-'],
-              }],
-            ],
-            'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
-          },
-          'VCLinkerTool': {
-            'LinkIncremental': '<(msvs_debug_link_incremental)',
-            # ASLR makes debugging with windbg difficult because Chrome.exe and
-            # Chrome.dll share the same base name. As result, windbg will
-            # name the Chrome.dll module like chrome_<base address>, where
-            # <base address> typically changes with each launch. This in turn
-            # means that breakpoints in Chrome.dll don't stick from one launch
-            # to the next. For this reason, we turn ASLR off in debug builds.
-            # Note that this is a three-way bool, where 0 means to pick up
-            # the default setting, 1 is off and 2 is on.
-            'RandomizedBaseAddress': 1,
-          },
-          'VCResourceCompilerTool': {
-            'PreprocessorDefinitions': ['_DEBUG'],
-          },
-        },
-        'conditions': [
-          ['OS=="linux" or OS=="android"', {
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'cflags': [
-                  '<@(debug_extra_cflags)',
-                ],
-              }],
-            ],
-          }],
-          ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
-            # Enable libstdc++ debugging facilities to help catch problems
-            # early, see http://crbug.com/65151 .
-            # TODO(phajdan.jr): Should we enable this for all of POSIX?
-            'defines': ['_GLIBCXX_DEBUG=1',],
-          }],
-          ['release_valgrind_build==0', {
-            'xcode_settings': {
-              'OTHER_CFLAGS': [
-                '-fstack-protector-all',  # Implies -fstack-protector
-              ],
-            },
-          }],
-          ['clang==1', {
-            'cflags': [
-              # Allow comparing the address of references and 'this' against 0
-              # in debug builds. Technically, these can never be null in
-              # well-defined C/C++ and Clang can optimize such checks away in
-              # release builds, but they may be used in asserts in debug builds.
-              '-Wno-undefined-bool-conversion',
-              '-Wno-tautological-undefined-compare',
-            ],
-            'xcode_settings': {
-              'OTHER_CFLAGS': [
-                '-Wno-undefined-bool-conversion',
-                '-Wno-tautological-undefined-compare',
-              ],
-            },
-            'msvs_settings': {
-              'VCCLCompilerTool': {
-                'AdditionalOptions': [
-                  '-Wno-undefined-bool-conversion',
-                  '-Wno-tautological-undefined-compare',
-                ],
-              },
-            },
-          }],
-        ],
-      },
-      'Release_Base': {
-        'abstract': 1,
-        'defines': [
-          'NDEBUG',
-        ],
-        'xcode_settings': {
-          'DEAD_CODE_STRIPPING': 'YES',  # -Wl,-dead_strip
-          'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
-          'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
-        },
-        'msvs_settings': {
-          'VCCLCompilerTool': {
-            'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
-            'conditions': [
-              # In official builds, each target will self-select
-              # an optimization level.
-              ['buildtype!="Official"', {
-                  'Optimization': '<(win_release_Optimization)',
-                },
-              ],
-              # According to MSVS, InlineFunctionExpansion=0 means
-              # "default inlining", not "/Ob0".
-              # Thus, we have to handle InlineFunctionExpansion==0 separately.
-              ['win_release_InlineFunctionExpansion==0', {
-                'AdditionalOptions': ['/Ob0'],
-              }],
-              ['win_release_InlineFunctionExpansion!=""', {
-                'InlineFunctionExpansion':
-                  '<(win_release_InlineFunctionExpansion)',
-              }],
-
-              # if win_release_OmitFramePointers is blank, leave as default
-              ['win_release_OmitFramePointers==1', {
-                'OmitFramePointers': 'true',
-              }],
-              ['win_release_OmitFramePointers==0', {
-                'OmitFramePointers': 'false',
-                # The above is not sufficient (http://crbug.com/106711): it
-                # simply eliminates an explicit "/Oy", but both /O2 and /Ox
-                # perform FPO regardless, so we must explicitly disable.
-                # We still want the false setting above to avoid having
-                # "/Oy /Oy-" and warnings about overriding.
-                'AdditionalOptions': ['/Oy-'],
-              }],
-              ['asan==0', {
-                # Put data in separate COMDATs. This allows the linker
-                # to put bit-identical constants at the same address even if
-                # they're unrelated constants, which saves binary size.
-                # This optimization can't be used when ASan is enabled because
-                # it is not compatible with the ASan ODR checker.
-                'AdditionalOptions': ['/Gw'],
-              }],
-            ],
-            'AdditionalOptions': [
-                '/d2Zi+',  # Improve debugging of Release builds.
-                '/Zc:inline',  # Remove unreferenced COMDAT (faster links).
-                '<@(win_release_extra_cflags)',
-            ],
-          },
-          'VCLinkerTool': {
-            # LinkIncremental is a tri-state boolean, where 0 means default
-            # (i.e., inherit from parent solution), 1 means false, and
-            # 2 means true.
-            'LinkIncremental': '1',
-            # This corresponds to the /PROFILE flag which ensures the PDB
-            # file contains FIXUP information (growing the PDB file by about
-            # 5%) but does not otherwise alter the output binary. This
-            # information is used by the Syzygy optimization tool when
-            # decomposing the release image.
-            'Profile': 'true',
-          },
-        },
-        'conditions': [
-          ['msvs_use_common_release', {
-            'includes': ['release.gypi'],
-          }],
-          ['release_valgrind_build==0 and tsan==0', {
-            'defines': [
-              'NVALGRIND',
-              'DYNAMIC_ANNOTATIONS_ENABLED=0',
-            ],
-          }, {
-            'defines': [
-              'MEMORY_TOOL_REPLACES_ALLOCATOR',
-              'MEMORY_SANITIZER_INITIAL_SIZE',
-              'DYNAMIC_ANNOTATIONS_ENABLED=1',
-              'WTF_USE_DYNAMIC_ANNOTATIONS=1',
-            ],
-          }],
-          ['OS=="win"', {
-            'defines': ['NO_TCMALLOC'],
-          }],
-          # _FORTIFY_SOURCE isn't really supported by Clang now, see
-          # http://llvm.org/bugs/show_bug.cgi?id=16821.
-          # It seems to work fine with Ubuntu 12 headers though, so use it
-          # in official builds.
-          ['os_posix==1 and (asan!=1 and msan!=1 and tsan!=1 and lsan!=1 and ubsan!=1) and (OS!="linux" or clang!=1 or buildtype=="Official")', {
-            'target_conditions': [
-              ['chromium_code==1', {
-                # Non-chromium code is not guaranteed to compile cleanly
-                # with _FORTIFY_SOURCE. Also, fortified build may fail
-                # when optimizations are disabled, so only do that for Release
-                # build.
-                'defines': [
-                  '_FORTIFY_SOURCE=2',
-                ],
-              }],
-            ],
-          }],
-          ['OS=="linux" or OS=="android"', {
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'cflags': [
-                  '<@(release_extra_cflags)',
-                ],
-                'conditions': [
-                  ['enable_resource_whitelist_generation==1', {
-                    'cflags': [
-                      '-Wunknown-pragmas -Wno-error=unknown-pragmas',
-                    ],
-                  }],
-                ],
-              }],
-            ],
-          }],
-          ['OS=="ios"', {
-            'defines': [
-              'NS_BLOCK_ASSERTIONS=1',
-            ],
-          }],
-        ],
-      },
-      #
-      # Concrete configurations
-      #
-      'Debug': {
-        'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
-      },
-      'Release': {
-        'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
-      },
-      'conditions': [
-        [ 'OS=="ios"', {
-          'Profile': {
-            'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
-            'target_conditions': [
-              [ '_type=="executable"', {
-                # To get a real .dSYM bundle produced by dsymutil, set the
-                # debug information format to dwarf-with-dsym.  Since
-                # strip_from_xcode will not be used, set Xcode to do the
-                # stripping as well.
-                'xcode_settings': {
-                  'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
-                  'DEPLOYMENT_POSTPROCESSING': 'YES',
-                  'STRIP_INSTALLED_PRODUCT': 'YES',
-                },
-              }],
-            ],
-          },
-        }],
-        [ 'OS=="win"', {
-          # TODO(bradnelson): add a gyp mechanism to make this more graceful.
-          'Debug_x64': {
-            'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
-          },
-          'Release_x64': {
-            'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
-          },
-        }],
-      ],
-    },
-  },
-  'conditions': [
-    ['os_posix==1', {
-      'target_defaults': {
-        'ldflags': [
-          '-Wl,-z,now',
-          '-Wl,-z,relro',
-        ],
-        # TODO(glider): enable the default options on other systems.
-        'conditions': [
-          ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
-            'dependencies': [
-              '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
-            ],
-          }],
-        ],
-      },
-    }],
-    # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
-    ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
-      'target_defaults': {
-        'ldflags': [
-          '-Wl,--fatal-warnings',
-        ],
-      },
-    }],
-    # -Wl,-z,-defs doesn't work with the sanitiziers, http://crbug.com/452065
-    ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and tsan==0 and ubsan==0 and ubsan_vptr==0', {
-      'target_defaults': {
-        'ldflags': [
-          '-Wl,-z,defs',
-        ],
-      },
-    }],
-    ['os_posix==1 and chromeos==0', {
-      # Chrome OS enables -fstack-protector-strong via its build wrapper,
-      # and we want to avoid overriding this, so stack-protector is only
-      # enabled when not building on Chrome OS.
-      # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
-      # supports it.
-      'target_defaults': {
-        'cflags': [
-          '-fstack-protector',
-          '--param=ssp-buffer-size=4',
-        ],
-      },
-    }],
-    ['os_posix==1 and OS=="linux"', {
-      'defines': [
-        '_LARGEFILE_SOURCE',
-        '_LARGEFILE64_SOURCE',
-        '_FILE_OFFSET_BITS=64',
-      ],
-    }],
-    ['os_posix==1 and OS!="mac" and OS!="ios"', {
-      'target_defaults': {
-        # Enable -Werror by default, but put it in a variable so it can
-        # be disabled in ~/.gyp/include.gypi on the valgrind builders.
-        'variables': {
-          'werror%': '-Werror',
-          'libraries_for_target%': '',
-        },
-        'defines': [
-          '_FILE_OFFSET_BITS=64',
-        ],
-        'cflags': [
-          '<(werror)',  # See note above about the werror variable.
-          '-pthread',
-          '-fno-strict-aliasing',  # See http://crbug.com/32204
-          '-Wall',
-          # Don't warn about unused function params.  We use those everywhere.
-          '-Wno-unused-parameter',
-          # Don't warn about the "struct foo f = {0};" initialization pattern.
-          '-Wno-missing-field-initializers',
-          # Don't export any symbols (for example, to plugins we dlopen()).
-          # Note: this is *required* to make some plugins work.
-          '-fvisibility=hidden',
-          '-pipe',
-        ],
-        'cflags_cc': [
-          '-fno-exceptions',
-          '-fno-rtti',
-          '-fno-threadsafe-statics',
-          # Make inline functions have hidden visiblity by default.
-          # Surprisingly, not covered by -fvisibility=hidden.
-          '-fvisibility-inlines-hidden',
-          # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
-          # so we specify it explicitly.  (llvm.org/PR10448, crbug.com/90453)
-          '-Wsign-compare',
-        ],
-        'ldflags': [
-          '-pthread', '-Wl,-z,noexecstack',
-        ],
-        'libraries' : [
-          '<(libraries_for_target)',
-        ],
-        'configurations': {
-          'Debug_Base': {
-            'variables': {
-              'debug_optimize%': '0',
-            },
-            'defines': [
-              '_DEBUG',
-            ],
-            'cflags': [
-              '-O>(debug_optimize)',
-              '-g',
-            ],
-            'conditions' : [
-              ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
-                # TODO(jdduke) Re-enable on mips after resolving linking
-                # issues with libc++ (crbug.com/456380).
-                'ldflags': [
-                  # Warn in case of text relocations.
-                  '-Wl,--warn-shared-textrel',
-                ],
-              }],
-              ['OS=="android" and android_full_debug==0', {
-                # Some configurations are copied from Release_Base to reduce
-                # the binary size.
-                'variables': {
-                  'debug_optimize%': 's',
-                },
-                'cflags': [
-                  '-fdata-sections',
-                  '-ffunction-sections',
-                ],
-                'ldflags': [
-                  '-Wl,-O1',
-                  '-Wl,--as-needed',
-                ],
-              }],
-              ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
-                # We don't omit frame pointers on arm64 since they are required
-                # to correctly unwind stackframes which contain system library
-                # function frames (crbug.com/391706).
-                'cflags': [
-                  '-fomit-frame-pointer',
-                ],
-              }],
-              ['OS=="linux" and target_arch=="ia32"', {
-                'ldflags': [
-                  '-Wl,--no-as-needed',
-                ],
-              }],
-              ['debug_unwind_tables==1', {
-                'cflags': ['-funwind-tables'],
-              }, {
-                'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
-                'defines': ['NO_UNWIND_TABLES'],
-              }],
-              # TODO(mostynb): shuffle clang/gcc_version/binutils_version
-              # definitions in to the right scope to use them when setting
-              # linux_use_debug_fission, so it can be used here alone.
-              ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
-                'cflags': ['-gsplit-dwarf'],
-              }],
-            ],
-          },
-          'Release_Base': {
-            'variables': {
-              'release_optimize%': '2',
-              # Binaries become big and gold is unable to perform GC
-              # and remove unused sections for some of test targets
-              # on 32 bit platform.
-              # (This is currently observed only in chromeos valgrind bots)
-              # The following flag is to disable --gc-sections linker
-              # option for these bots.
-              'no_gc_sections%': 0,
-
-              # TODO(bradnelson): reexamine how this is done if we change the
-              # expansion of configurations
-              'release_valgrind_build%': 0,
-            },
-            'cflags': [
-              '-O<(release_optimize)',
-              # Don't emit the GCC version ident directives, they just end up
-              # in the .comment section taking up binary size.
-              '-fno-ident',
-              # Put data and code in their own sections, so that unused symbols
-              # can be removed at link time with --gc-sections.
-              '-fdata-sections',
-              '-ffunction-sections',
-            ],
-            'ldflags': [
-              # Specifically tell the linker to perform optimizations.
-              # See http://lwn.net/Articles/192624/ .
-              '-Wl,-O1',
-              '-Wl,--as-needed',
-            ],
-            'conditions' : [
-              ['no_gc_sections==0', {
-                'ldflags': [
-                  '-Wl,--gc-sections',
-                ],
-              }],
-              ['OS=="android" and target_arch!="arm64"', {
-                # We don't omit frame pointers on arm64 since they are required
-                # to correctly unwind stackframes which contain system library
-                # function frames (crbug.com/391706).
-                'cflags': [
-                  '-fomit-frame-pointer',
-                ]
-              }],
-              ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
-                # TODO(jdduke) Re-enable on mips after resolving linking
-                # issues with libc++ (crbug.com/456380).
-                'ldflags': [
-                  # Warn in case of text relocations.
-                  '-Wl,--warn-shared-textrel',
-                ],
-              }],
-              ['OS=="android"', {
-                'variables': {
-                  'release_optimize%': 's',
-                },
-              }],
-              ['profiling==1', {
-                'cflags': [
-                  '-fno-omit-frame-pointer',
-                  '-g',
-                ],
-                'conditions' : [
-                  ['profiling_full_stack_frames==1', {
-                    'cflags': [
-                      '-fno-inline',
-                      '-fno-optimize-sibling-calls',
-                    ],
-                  }],
-                ],
-              }],
-              ['release_unwind_tables==1', {
-                'cflags': ['-funwind-tables'],
-              }, {
-                'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
-                'defines': ['NO_UNWIND_TABLES'],
-              }],
-            ],
-          },
-        },
-        'conditions': [
-          ['target_arch=="ia32"', {
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'asflags': [
-                  # Needed so that libs with .s files (e.g. libicudata.a)
-                  # are compatible with the general 32-bit-ness.
-                  '-32',
-                ],
-                # All floating-point computations on x87 happens in 80-bit
-                # precision.  Because the C and C++ language standards allow
-                # the compiler to keep the floating-point values in higher
-                # precision than what's specified in the source and doing so
-                # is more efficient than constantly rounding up to 64-bit or
-                # 32-bit precision as specified in the source, the compiler,
-                # especially in the optimized mode, tries very hard to keep
-                # values in x87 floating-point stack (in 80-bit precision)
-                # as long as possible. This has important side effects, that
-                # the real value used in computation may change depending on
-                # how the compiler did the optimization - that is, the value
-                # kept in 80-bit is different than the value rounded down to
-                # 64-bit or 32-bit. There are possible compiler options to
-                # make this behavior consistent (e.g. -ffloat-store would keep
-                # all floating-values in the memory, thus force them to be
-                # rounded to its original precision) but they have significant
-                # runtime performance penalty.
-                #
-                # -mfpmath=sse -msse2 makes the compiler use SSE instructions
-                # which keep floating-point values in SSE registers in its
-                # native precision (32-bit for single precision, and 64-bit
-                # for double precision values). This means the floating-point
-                # value used during computation does not change depending on
-                # how the compiler optimized the code, since the value is
-                # always kept in its specified precision.
-                #
-                # Refer to http://crbug.com/348761 for rationale behind SSE2
-                # being a minimum requirement for 32-bit Linux builds and
-                # http://crbug.com/313032 for an example where this has "bit"
-                # us in the past.
-                'cflags': [
-                  '-msse2',
-                  '-mfpmath=sse',
-                  '-mmmx',  # Allows mmintrin.h for MMX intrinsics.
-                  '-m32',
-                ],
-                'ldflags': [
-                  '-m32',
-                ],
-                'conditions': [
-                  # Use gold linker for Android ia32 target.
-                  ['OS=="android"', {
-                    'ldflags': [
-                      '-fuse-ld=gold',
-                    ],
-                  }],
-                ],
-              }],
-            ],
-          }],
-          ['target_arch=="x64"', {
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'conditions': [
-                  # Use gold linker for Android x64 target.
-                  ['OS=="android"', {
-                    'ldflags': [
-                      '-fuse-ld=gold',
-                    ],
-                  }],
-                ],
-                'cflags': [
-                  '-m64',
-                  '-march=x86-64',
-                ],
-                'ldflags': [
-                  '-m64',
-                ],
-              }],
-            ],
-          }],
-          ['target_arch=="arm"', {
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'conditions': [
-                  ['clang==0', {
-                    'cflags_cc': [
-                      # The codesourcery arm-2009q3 toolchain warns at that the ABI
-                      # has changed whenever it encounters a varargs function. This
-                      # silences those warnings, as they are not helpful and
-                      # clutter legitimate warnings.
-                      '-Wno-abi',
-                    ],
-                  }],
-                  ['clang==1 and arm_arch!="" and OS!="android"', {
-                    'cflags': [
-                      '-target arm-linux-gnueabihf',
-                    ],
-                    'ldflags': [
-                      '-target arm-linux-gnueabihf',
-                    ],
-                  }],
-                  ['arm_arch!=""', {
-                    'cflags': [
-                      '-march=<(arm_arch)',
-                    ],
-                    'conditions': [
-                      ['use_lto==1 or use_lto_o2==1', {
-                        'ldflags': [
-                          '-march=<(arm_arch)',
-                        ],
-                      }],
-                    ],
-                  }],
-                  ['clang==1 and OS!="android"', {
-                    'cflags': [
-                      # We need to disable clang's builtin assembler as it can't
-                      # handle several asm files, crbug.com/124610
-                      '-no-integrated-as',
-                    ],
-                  }],
-                  ['arm_tune!=""', {
-                    'cflags': [
-                      '-mtune=<(arm_tune)',
-                    ],
-                    'conditions': [
-                      ['use_lto==1 or use_lto_o2==1', {
-                        'ldflags': [
-                          '-mtune=<(arm_tune)',
-                        ],
-                      }],
-                    ],
-                  }],
-                  ['arm_fpu!=""', {
-                    'cflags': [
-                      '-mfpu=<(arm_fpu)',
-                    ],
-                    'conditions': [
-                      ['use_lto==1 or use_lto_o2==1', {
-                        'ldflags': [
-                          '-mfpu=<(arm_fpu)',
-                        ],
-                      }],
-                    ],
-                  }],
-                  ['arm_float_abi!=""', {
-                    'cflags': [
-                      '-mfloat-abi=<(arm_float_abi)',
-                    ],
-                    'conditions': [
-                      ['use_lto==1 or use_lto_o2==1', {
-                        'ldflags': [
-                          '-mfloat-abi=<(arm_float_abi)',
-                        ],
-                      }],
-                    ],
-                  }],
-                  ['arm_thumb==1', {
-                    'cflags': [
-                      '-mthumb',
-                    ],
-                    'conditions': [
-                      ['use_lto==1 or use_lto_o2==1', {
-                        'ldflags': [
-                          '-mthumb',
-                        ],
-                      }],
-                    ],
-                  }],
-                  ['OS=="android"', {
-                    # Most of the following flags are derived from what Android
-                    # uses by default when building for arm, reference for which
-                    # can be found in the following file in the Android NDK:
-                    # toolchains/arm-linux-androideabi-4.9/setup.mk
-                    'cflags': [
-                      # The tree-sra optimization (scalar replacement for
-                      # aggregates enabling subsequent optimizations) leads to
-                      # invalid code generation when using the Android NDK's
-                      # compiler (r5-r7). This can be verified using
-                      # webkit_unit_tests' WTF.Checked_int8_t test.
-                      '-fno-tree-sra',
-                      # The following option is disabled to improve binary
-                      # size and performance in gcc 4.9.
-                      '-fno-caller-saves',
-                      '-Wno-psabi',
-                    ],
-                    # Android now supports .relro sections properly.
-                    # NOTE: While these flags enable the generation of .relro
-                    # sections, the generated libraries can still be loaded on
-                    # older Android platform versions.
-                    'ldflags': [
-                        '-Wl,-z,relro',
-                        '-Wl,-z,now',
-                        '-fuse-ld=gold',
-                    ],
-                    'conditions': [
-                      ['gcc_version==48 and clang==0', {
-                        'cflags': [
-                          # The following 5 options are disabled to save on
-                          # binary size in GCC 4.8.
-                          '-fno-partial-inlining',
-                          '-fno-early-inlining',
-                          '-fno-tree-copy-prop',
-                          '-fno-tree-loop-optimize',
-                          '-fno-move-loop-invariants',
-                        ],
-                      }],
-                      ['arm_thumb==1', {
-                        'cflags': [ '-mthumb-interwork' ],
-                      }],
-                      ['profiling==1', {
-                        'cflags': [
-                          # Thumb code with frame pointer makes chrome crash
-                          # early.
-                          '-marm',
-                          '-mapcs-frame', # Required by -fno-omit-frame-pointer.
-                          # The perf report sometimes incorrectly attributes
-                          # code from tail calls.
-                          '-fno-optimize-sibling-calls',
-                        ],
-                        'cflags!': [
-                          '-fomit-frame-pointer',
-                        ],
-                      }],
-                      ['clang==1', {
-                        'cflags!': [
-                          # Clang does not support the following options.
-                          '-mapcs-frame',
-                          '-mthumb-interwork',
-                          '-finline-limit=64',
-                          '-fno-tree-sra',
-                          '-fno-caller-saves',
-                          '-Wno-psabi',
-                        ],
-                        'cflags': [
-                          # TODO(hans) Enable integrated-as (crbug.com/124610).
-                          '-no-integrated-as',
-                          '-B<(android_toolchain)',  # Else /usr/bin/as gets picked up.
-                        ],
-                      }],
-                      ['clang==1 and linux_use_bundled_gold==0', {
-                        'ldflags': [
-                          # Let clang find the ld.gold in the NDK.
-                          '--gcc-toolchain=<(android_toolchain)/..',
-                        ],
-                      }],
-                      ['asan==1', {
-                        'cflags': [
-                          '-marm', # Required for frame pointer based stack traces.
-                        ],
-                      }],
-                    ],
-                  }],
-                  ['chromecast==1', {
-                    'cflags': [
-                      # We set arm_arch to "" so that -march compiler option
-                      # is not set.  Otherwise a gcc bug that would complain
-                      # about it conflicting with '-mcpu=cortex-a9'. The flag
-                      # '-march=armv7-a' is actually redundant anyway because
-                      # it is enabled by default when we built the toolchain.
-                      # And using '-mcpu=cortex-a9' should be sufficient.
-                      '-mcpu=cortex-a9',
-                      '-funwind-tables',
-                      # Breakpad requires symbols with debugging information
-                      '-g',
-                    ],
-                    'ldflags': [
-                      # We want to statically link libstdc++/libgcc_s.
-                      '-static-libstdc++',
-                      '-static-libgcc',
-                    ],
-                    'cflags!': [
-                      # Some components in Chromium (e.g. v8, skia, ffmpeg)
-                      # define their own cflags for arm builds that could
-                      # conflict with the flags we set here (e.g.
-                      # '-mcpu=cortex-a9'). Remove these flags explicitly.
-                      '-march=armv7-a',
-                      '-mtune=cortex-a8',
-                    ],
-                  }],
-                ],
-              }],
-            ],
-          }],
-          ['target_arch=="arm64"', {
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'conditions': [
-                  ['OS=="android"', {
-                    'cflags!': [
-                       '-fstack-protector',  # stack protector is always enabled on arm64.
-                    ],
-                  }],
-                ],
-              }],
-            ],
-          }],
-          ['target_arch=="mipsel"', {
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'conditions': [
-                  ['mips_arch_variant=="r6"', {
-                    'conditions': [
-                      ['clang==1', {
-                        'cflags': [ '-target mipsel-linux-gnu', '-march=mips32r6', ],
-                        'ldflags': [ '-target mipsel-linux-gnu', ],
-                      }, { # clang==0
-                        'cflags': ['-mips32r6', '-Wa,-mips32r6', ],
-                      }],
-                      ['clang==0 and OS=="android"', {
-                        'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
-                      }],
-                    ],
-                  }],
-                  ['mips_arch_variant=="r2"', {
-                    'conditions': [
-                      ['mips_float_abi=="hard" and mips_fpu_mode!=""', {
-                        'cflags': ['-m<(mips_fpu_mode)'],
-                      }],
-                      ['clang==1', {
-                         'conditions': [
-                          ['OS=="android"', {
-                            'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32r2'],
-                            'ldflags': [ '-target mipsel-linux-android', ],
-                          }, {
-                            'cflags': [ '-target mipsel-linux-gnu', '-march=mipsel', '-mcpu=mips32r2'],
-                            'ldflags': [ '-target mipsel-linux-gnu', ],
-                          }],
-                         ],
-                      }, { # clang==0
-                        'cflags': ['-mips32r2', '-Wa,-mips32r2', ],
-                      }],
-                    ],
-                  }],
-                  ['mips_arch_variant=="r1"', {
-                    'conditions': [
-                      ['clang==1', {
-                        'conditions': [
-                          ['OS=="android"', {
-                            'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32'],
-                            'ldflags': [ '-target mipsel-linux-android', ],
-                          }, {
-                            'cflags': [ '-target mipsel-linux-gnu', '-march=mipsel', '-mcpu=mips32'],
-                            'ldflags': [ '-target mipsel-linux-gnu', ],
-                          }],
-                        ],
-                      }, { # clang==0
-                        'cflags': ['-mips32', '-Wa,-mips32', ],
-                      }],
-                    ],
-                  }],
-                  ['clang==1', {
-                    'cflags!': [
-                      # Clang does not support the following options.
-                      '-finline-limit=64',
-                    ],
-                    'cflags': [
-                      # TODO(gordanac) Enable integrated-as.
-                      '-no-integrated-as',
-                    ],
-                  }],
-                  ['clang==1 and OS=="android"', {
-                    'cflags': [
-                      '-B<(android_toolchain)',  # Else /usr/bin/as gets picked up.
-                    ],
-                    'ldflags': [
-                      # Let clang find the ld in the NDK.
-                      '--gcc-toolchain=<(android_toolchain)/..',
-                    ],
-                  }],
-                  ['mips_dsp_rev==1', {
-                    'cflags': ['-mdsp'],
-                  }],
-                  ['mips_dsp_rev==2', {
-                    'cflags': ['-mdspr2'],
-                  }],
-                ],
-                'cflags': [
-                  '-m<(mips_float_abi)-float'
-                ],
-                'ldflags': [
-                  '-Wl,--no-keep-memory'
-                ],
-                'cflags_cc': [
-                  '-Wno-uninitialized',
-                ],
-              }],
-            ],
-          }],
-          ['target_arch=="mips64el"', {
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'conditions': [
-                  ['mips_arch_variant=="r6"', {
-                    'cflags': ['-mips64r6', '-Wa,-mips64r6'],
-                    'ldflags': ['-mips64r6'],
-                  }],
-                  ['mips_arch_variant=="r2"', {
-                    'cflags': ['-mips64r2', '-Wa,-mips64r2'],
-                    'ldflags': ['-mips64r2'],
-                  }],
-                ],
-                'cflags_cc': [
-                  '-Wno-uninitialized',
-                ],
-              }],
-            ],
-          }],
-          ['linux_fpic==1', {
-            'cflags': [
-              '-fPIC',
-            ],
-            'ldflags': [
-              '-fPIC',
-            ],
-          }],
-          ['sysroot!=""', {
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'cflags': [
-                  '--sysroot=<(sysroot)',
-                ],
-                'ldflags': [
-                  '--sysroot=<(sysroot)',
-                  '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
-                ],
-              }]]
-          }],
-          ['clang==1', {
-            'cflags': [
-              # TODO(thakis): Remove, http://crbug.com/263960
-              '-Wno-reserved-user-defined-literal',
-            ],
-            'cflags_cc': [
-              # gnu++11 instead of c++11 is needed because some code uses
-              # typeof() (a GNU extension).
-              # TODO(thakis): Eventually switch this to c++11 instead,
-              # http://crbug.com/427584
-              '-std=gnu++11',
-            ],
-          }],
-          ['clang==0 and host_clang==1', {
-            'target_conditions': [
-              ['_toolset=="host"', {
-                'cflags_cc': [ '-std=gnu++11', ],
-              }],
-            ],
-          }],
-          ['clang==1 and clang_use_chrome_plugins==1', {
-            'cflags': [
-              '<@(clang_chrome_plugins_flags)',
-            ],
-          }],
-          ['clang==1 and clang_load!=""', {
-            'cflags': [
-              '-Xclang', '-load', '-Xclang', '<(clang_load)',
-            ],
-          }],
-          ['clang==1 and clang_add_plugin!=""', {
-            'cflags': [
-              '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
-            ],
-          }],
-          ['clang==1 and target_arch=="ia32"', {
-            'cflags': [
-              # Else building libyuv gives clang's register allocator issues,
-              # see llvm.org/PR15798 / crbug.com/233709
-              '-momit-leaf-frame-pointer',
-              # Align the stack on 16-byte boundaries, http://crbug.com/418554.
-              '-mstack-alignment=16',
-              '-mstackrealign',
-            ],
-          }],
-          ['clang==1 and "<(GENERATOR)"=="ninja"', {
-            'cflags': [
-              # See http://crbug.com/110262
-              '-fcolor-diagnostics',
-            ],
-          }],
-          # Common options for AddressSanitizer, LeakSanitizer,
-          # ThreadSanitizer and MemorySanitizer.
-          ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'cflags': [
-                  '-fno-omit-frame-pointer',
-                  '-gline-tables-only',
-                ],
-                'cflags!': [
-                  '-fomit-frame-pointer',
-                ],
-              }],
-            ],
-          }],
-          ['asan==1 or lsan==1 or tsan==1 or msan==1', {
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'ldflags!': [
-                  # Functions interposed by the sanitizers can make ld think
-                  # that some libraries aren't needed when they actually are,
-                  # http://crbug.com/234010. As workaround, disable --as-needed.
-                  '-Wl,--as-needed',
-                ],
-                'defines': [
-                  'MEMORY_TOOL_REPLACES_ALLOCATOR',
-                  'MEMORY_SANITIZER_INITIAL_SIZE',
-                ],
-              }],
-            ],
-          }],
-          ['asan==1', {
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'cflags': [
-                  '-fsanitize=address',
-                  # TODO(earthdok): Re-enable. http://crbug.com/427202
-                  #'-fsanitize-blacklist=<(asan_blacklist)',
-                ],
-                'ldflags': [
-                  '-fsanitize=address',
-                ],
-              }],
-            ],
-            'conditions': [
-              ['OS=="mac"', {
-                'cflags': [
-                  '-mllvm -asan-globals=0',  # http://crbug.com/352073
-                ],
-              }],
-            ],
-          }],
-          ['ubsan==1', {
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'cflags': [
-                  # FIXME: work on enabling more flags and getting rid of false
-                  # positives. http://crbug.com/174801.
-                  '-fsanitize=bounds',
-                  '-fsanitize=float-divide-by-zero',
-                  '-fsanitize=integer-divide-by-zero',
-                  '-fsanitize=null',
-                  '-fsanitize=object-size',
-                  '-fsanitize=return',
-                  '-fsanitize=returns-nonnull-attribute',
-                  '-fsanitize=shift-exponent',
-                  '-fsanitize=signed-integer-overflow',
-                  '-fsanitize=unreachable',
-                  '-fsanitize=vla-bound',
-                  '-fsanitize-blacklist=<(ubsan_blacklist)',
-                  # Employ the experimental PBQP register allocator to avoid
-                  # slow compilation on files with too many basic blocks.
-                  # See http://crbug.com/426271.
-                  '-mllvm -regalloc=pbqp',
-                  # Speculatively use coalescing to slightly improve the code
-                  # generated by PBQP regallocator. May increase compile time.
-                  '-mllvm -pbqp-coalescing',
-                ],
-                'cflags_cc!': [
-                  '-fno-rtti',
-                ],
-                'cflags!': [
-                  '-fno-rtti',
-                ],
-                'ldflags': [
-                  '-fsanitize=undefined',
-                ],
-                'defines': [
-                  'UNDEFINED_SANITIZER',
-                ],
-              }],
-            ],
-          }],
-          ['ubsan_vptr==1', {
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'cflags': [
-                  '-fsanitize=vptr',
-                  '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
-                ],
-                'cflags_cc!': [
-                  '-fno-rtti',
-                ],
-                'cflags!': [
-                  '-fno-rtti',
-                ],
-                'ldflags': [
-                  '-fsanitize=vptr',
-                ],
-                'defines': [
-                  'UNDEFINED_SANITIZER',
-                ],
-              }],
-            ],
-          }],
-          ['asan_coverage!=0 and sanitizer_coverage==0', {
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'cflags': [
-                  '-fsanitize-coverage=<(asan_coverage)',
-                ],
-                'defines': [
-                  'SANITIZER_COVERAGE',
-                ],
-              }],
-            ],
-          }],
-          ['sanitizer_coverage!=0', {
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'cflags': [
-                  '-fsanitize-coverage=<(sanitizer_coverage)',
-                ],
-                'defines': [
-                  'SANITIZER_COVERAGE',
-                ],
-              }],
-            ],
-          }],
-          ['asan_field_padding!=0', {
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'cflags': [
-                  '-fsanitize-address-field-padding=<(asan_field_padding)',
-                ],
-              }],
-            ],
-          }],
-          ['lsan==1', {
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'cflags': [
-                  '-fsanitize=leak',
-                ],
-                'ldflags': [
-                  '-fsanitize=leak',
-                ],
-                'defines': [
-                  'LEAK_SANITIZER',
-                  'WTF_USE_LEAK_SANITIZER=1',
-                ],
-              }],
-            ],
-          }],
-          ['tsan==1', {
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'cflags': [
-                  '-fsanitize=thread',
-                  '-fsanitize-blacklist=<(tsan_blacklist)',
-                ],
-                'ldflags': [
-                  '-fsanitize=thread',
-                ],
-                'defines': [
-                  'THREAD_SANITIZER',
-                  'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
-                  'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
-                ],
-              }],
-            ],
-          }],
-          ['msan==1', {
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'cflags': [
-                  '-fsanitize=memory',
-                  '-fsanitize-memory-track-origins=<(msan_track_origins)',
-                  '-fsanitize-blacklist=<(msan_blacklist)',
-                ],
-                'ldflags': [
-                  '-fsanitize=memory',
-                ],
-                'defines': [
-                  'MEMORY_SANITIZER',
-                ],
-              }],
-            ],
-          }],
-          ['use_instrumented_libraries==1', {
-            'dependencies': [
-              '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
-            ],
-          }],
-          ['use_prebuilt_instrumented_libraries==1', {
-            'dependencies': [
-              '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:prebuilt_instrumented_libraries',
-            ],
-          }],
-          ['use_custom_libcxx==1', {
-            'dependencies': [
-              '<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
-            ],
-          }],
-          ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
-            'target_conditions' : [
-              # crazy_linker has an upstream gyp file we can't edit, and we
-              # don't want to instrument it.
-              ['_toolset=="target" and _target_name!="crazy_linker"', {
-                'cflags': [
-                  '-finstrument-functions',
-                  # Allow mmx intrinsics to inline, so that the
-                  #0 compiler can expand the intrinsics.
-                  '-finstrument-functions-exclude-file-list=mmintrin.h',
-                ],
-              }],
-              ['_toolset=="target" and OS=="android"', {
-                'cflags': [
-                  # Avoids errors with current NDK:
-                  # "third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/include/arm_neon.h:3426:3: error: argument must be a constant"
-                  '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
-                ],
-              }],
-            ],
-          }],
-          ['linux_dump_symbols==1', {
-            'cflags': [ '-g' ],
-            'conditions': [
-              ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
-                'target_conditions': [
-                  ['_toolset=="target"', {
-                    'ldflags': [
-                      # Attempt to use less memory to prevent the linker from
-                      # running out of address space. Considering installing a
-                      # 64-bit kernel and switching to a 64-bit linker.
-                      '-Wl,--no-keep-memory',
-                    ],
-                  }],
-                ],
-              }],
-            ],
-          }],
-          ['use_allocator!="tcmalloc"', {
-            'defines': ['NO_TCMALLOC'],
-          }],
-          ['linux_use_gold_flags==1', {
-            # Newer gccs and clangs support -fuse-ld, use the flag to force gold
-            # selection.
-            # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
-            'ldflags': [ '-fuse-ld=gold', ],
-
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'ldflags': [
-                  # Experimentation found that using four linking threads
-                  # saved ~20% of link time.
-                  # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
-                  # Only apply this to the target linker, since the host
-                  # linker might not be gold, but isn't used much anyway.
-                  # TODO(raymes): Disable threading because gold is frequently
-                  # crashing on the bots: crbug.com/161942.
-                  # '-Wl,--threads',
-                  # '-Wl,--thread-count=4',
-                ],
-                'conditions': [
-                  # TODO(thestig): Enable this for disabled cases.
-                  [ 'buildtype!="Official" and chromeos==0 and release_valgrind_build==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
-                    'ldflags': [
-                      '-Wl,--detect-odr-violations',
-                    ],
-                  }],
-                ],
-              }],
-            ],
-            'conditions': [
-              ['release_valgrind_build==0 and order_profiling==0 and asan==0 and msan==0 and lsan==0 and tsan==0', {
-                'target_conditions': [
-                  ['_toolset=="target"', {
-                    'ldflags': [
-                      '-Wl,--icf=<(gold_icf_level)',
-                    ],
-                  }],
-                ],
-              }],
-            ],
-          }],
-          ['linux_use_bundled_binutils==1', {
-            'cflags': [
-              '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
-            ],
-          }],
-          ['linux_use_bundled_gold==1 and '
-           'not (clang==0 and (use_lto==1 or use_lto_o2==1))', {
-            # Put our binutils, which contains gold in the search path. We pass
-            # the path to gold to the compiler. gyp leaves unspecified what the
-            # cwd is when running the compiler, so the normal gyp path-munging
-            # fails us. This hack gets the right path.
-            #
-            # Disabled when using GCC LTO because GCC also uses the -B search
-            # path at link time to find "as", and our bundled "as" can only
-            # target x86.
-            'ldflags': [
-              '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
-            ],
-          }],
-          # Some binutils 2.23 releases may or may not have new dtags enabled,
-          # but they are all compatible with --disable-new-dtags,
-          # because the new dynamic tags are not created by default.
-          ['binutils_version>=223', {
-            # Newer binutils don't set DT_RPATH unless you disable "new" dtags
-            # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
-            # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
-            # inside this file to allow usage of --no-as-needed and removal of
-            # this flag.
-            'ldflags': [
-              '-Wl,--disable-new-dtags',
-            ],
-          }],
-          ['gcc_version>=47 and clang==0', {
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'cflags_cc': [
-                  '-std=gnu++11',
-                  # See comment for -Wno-c++11-narrowing.
-                  '-Wno-narrowing',
-                  # TODO(thakis): Remove, http://crbug.com/263960
-                  '-Wno-literal-suffix',
-                ],
-              }],
-            ],
-          }],
-          ['host_gcc_version>=47 and clang==0 and host_clang==0', {
-            'target_conditions': [
-              ['_toolset=="host"', {
-                'cflags_cc': [
-                  '-std=gnu++11',
-                  # See comment for -Wno-c++11-narrowing.
-                  '-Wno-narrowing',
-                  # TODO(thakis): Remove, http://crbug.com/263960
-                  '-Wno-literal-suffix',
-                ],
-              }],
-            ],
-          }],
-        ],
-      },
-    }],
-    # FreeBSD-specific options; note that most FreeBSD options are set above,
-    # with Linux.
-    ['OS=="freebsd"', {
-      'target_defaults': {
-        'ldflags': [
-          '-Wl,--no-keep-memory',
-        ],
-      },
-    }],
-    # Android-specific options; note that most are set above with Linux.
-    ['OS=="android"', {
-      'variables': {
-        # This is a unique identifier for a given build. It's used for
-        # identifying various build artifacts corresponding to a particular
-        # build of chrome (e.g. where to find archived symbols).
-        'chrome_build_id%': '',
-        'conditions': [
-          # Figure this out early since it needs symbols from libgcc.a, so it
-          # has to be before that in the set of libraries.
-          ['component=="shared_library"', {
-              'android_libcpp_library': 'c++_shared',
-          }, {
-              'android_libcpp_library': 'c++_static',
-          }],
-        ],
-
-        # Placing this variable here prevents from forking libvpx, used
-        # by remoting.  Remoting is off, so it needn't built,
-        # so forking it's deps seems like overkill.
-        # But this variable need defined to properly run gyp.
-        # A proper solution is to have an OS==android conditional
-        # in third_party/libvpx/libvpx.gyp to define it.
-        'libvpx_path': 'lib/linux/arm',
-      },
-      'target_defaults': {
-        'variables': {
-          'release_extra_cflags%': '',
-          'conditions': [
-            # If we're using the components build, append "cr" to all shared
-            # libraries to avoid naming collisions with android system library
-            # versions with the same name (e.g. skia, icu).
-            ['component=="shared_library"', {
-              'android_product_extension': 'cr.so',
-            }, {
-              'android_product_extension': 'so',
-            } ],
-          ],
-        },
-        'target_conditions': [
-          ['_type=="shared_library"', {
-            'product_extension': '<(android_product_extension)',
-          }],
-
-          # Settings for building device targets using Android's toolchain.
-          # These are based on the setup.mk file from the Android NDK.
-          #
-          # The NDK Android executable link step looks as follows:
-          #  $LDFLAGS
-          #  $(TARGET_CRTBEGIN_DYNAMIC_O)  <-- crtbegin.o
-          #  $(PRIVATE_OBJECTS)            <-- The .o that we built
-          #  $(PRIVATE_STATIC_LIBRARIES)   <-- The .a that we built
-          #  $(TARGET_LIBGCC)              <-- libgcc.a
-          #  $(PRIVATE_SHARED_LIBRARIES)   <-- The .so that we built
-          #  $(PRIVATE_LDLIBS)             <-- System .so
-          #  $(TARGET_CRTEND_O)            <-- crtend.o
-          #
-          # For now the above are approximated for executables by adding
-          # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
-          # of 'libraries'.
-          #
-          # The NDK Android shared library link step looks as follows:
-          #  $LDFLAGS
-          #  $(PRIVATE_OBJECTS)            <-- The .o that we built
-          #  -l,--whole-archive
-          #  $(PRIVATE_WHOLE_STATIC_LIBRARIES)
-          #  -l,--no-whole-archive
-          #  $(PRIVATE_STATIC_LIBRARIES)   <-- The .a that we built
-          #  $(TARGET_LIBGCC)              <-- libgcc.a
-          #  $(PRIVATE_SHARED_LIBRARIES)   <-- The .so that we built
-          #  $(PRIVATE_LDLIBS)             <-- System .so
-          #
-          # For now, assume that whole static libraries are not needed.
-          #
-          # For both executables and shared libraries, add the proper
-          # libgcc.a to the start of libraries which puts it in the
-          # proper spot after .o and .a files get linked in.
-          #
-          # TODO: The proper thing to do longer-tem would be proper gyp
-          # support for a custom link command line.
-          ['_toolset=="target"', {
-            'cflags!': [
-              '-pthread',  # Not supported by Android toolchain.
-            ],
-            'cflags': [
-              '-ffunction-sections',
-              '-funwind-tables',
-              '-g',
-              '-fstack-protector',
-              '-fno-short-enums',
-              '-finline-limit=64',
-              '<@(release_extra_cflags)',
-              '--sysroot=<(android_ndk_sysroot)',
-              # NOTE: The libc++ header include paths below are specified in
-              # cflags rather than include_dirs because they need to come
-              # after include_dirs.
-              # The include ordering here is important; change with caution.
-              '-isystem<(android_libcpp_include)',
-              '-isystem<(android_ndk_root)/sources/cxx-stl/llvm-libc++abi/libcxxabi/include',
-              '-isystem<(android_ndk_root)/sources/android/support/include',
-            ],
-            'defines': [
-              'ANDROID',
-              '__GNU_SOURCE=1',  # Necessary for clone()
-              'CHROME_BUILD_ID="<(chrome_build_id)"',
-              # The NDK has these things, but doesn't define the constants
-              # to say that it does. Define them here instead.
-              'HAVE_SYS_UIO_H',
-            ],
-            'ldflags!': [
-              '-pthread',  # Not supported by Android toolchain.
-            ],
-            'ldflags': [
-              '-Wl,--build-id=sha1',
-              '-Wl,--no-undefined',
-              '--sysroot=<(android_ndk_sysroot)',
-              '-nostdlib',
-              '-L<(android_libcpp_libs_dir)',
-              # Don't allow visible symbols from libgcc or libc++ to be
-              # re-exported.
-              '-Wl,--exclude-libs=libgcc.a',
-              '-Wl,--exclude-libs=libc++_static.a',
-              # Don't allow visible symbols from libraries that contain
-              # assembly code with symbols that aren't hidden properly.
-              # http://crbug.com/448386
-              '-Wl,--exclude-libs=libcommon_audio.a',
-              '-Wl,--exclude-libs=libcommon_audio_neon.a',
-              '-Wl,--exclude-libs=libcommon_audio_sse2.a',
-              '-Wl,--exclude-libs=libiSACFix.a',
-              '-Wl,--exclude-libs=libisac_neon.a',
-              '-Wl,--exclude-libs=libopus.a',
-              '-Wl,--exclude-libs=libvpx.a',
-            ],
-            'libraries': [
-              '-l<(android_libcpp_library)',
-              '-latomic',
-              # Manually link the libgcc.a that the cross compiler uses.
-              '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
-              '-lc',
-              '-ldl',
-              '-lm',
-            ],
-            'conditions': [
-              ['component=="static_library"', {
-                'target_conditions': [
-                  ['use_native_jni_exports==0', {
-                    # Use a linker version script to strip JNI exports from
-                    # binaries which have not specifically asked to use them.
-                    'ldflags': [
-                      '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/build/android/android_no_jni_exports.lst',
-                    ],
-                  }],
-                ],
-              }],
-              ['clang==1', {
-                'libraries!': [
-                  # Clang with libc++ does not require an explicit atomic
-                  # library reference.
-                  '-latomic',
-                ],
-                'cflags': [
-                  # Work around incompatibilities between bionic and clang
-                  # headers.
-                  '-D__compiler_offsetof=__builtin_offsetof',
-                  '-Dnan=__builtin_nan',
-                ],
-                'conditions': [
-                  ['target_arch=="arm"', {
-                    'cflags': [
-                      '-target arm-linux-androideabi',
-                    ],
-                    'ldflags': [
-                      '-target arm-linux-androideabi',
-                    ],
-                  }],
-                  ['target_arch=="ia32"', {
-                    'cflags': [
-                      '-target x86-linux-androideabi',
-                    ],
-                    'ldflags': [
-                      '-target x86-linux-androideabi',
-                    ],
-                  }],
-                  # Place holder for x64 support, not tested.
-                  # TODO: Enable clang support for Android x64. http://crbug.com/346626
-                  ['target_arch=="x64"', {
-                    'cflags': [
-                      '-target x86_64-linux-androideabi',
-                    ],
-                    'ldflags': [
-                      '-target x86_64-linux-androideabi',
-                    ],
-                  }],
-                ],
-              }],
-              ['asan==1', {
-                'cflags': [
-                  # Android build relies on -Wl,--gc-sections removing
-                  # unreachable code. ASan instrumentation for globals inhibits
-                  # this and results in a library with unresolvable relocations.
-                  # TODO(eugenis): find a way to reenable this.
-                  '-mllvm -asan-globals=0',
-                ],
-              }],
-              ['target_arch == "arm" and order_profiling==0', {
-                'ldflags': [
-                  # Enable identical code folding to reduce size.
-                  '-Wl,--icf=<(gold_icf_level)',
-                ],
-              }],
-              ['target_arch=="ia32"', {
-                # The x86 toolchain currently has problems with stack-protector.
-                'cflags!': [
-                  '-fstack-protector',
-                ],
-                'cflags': [
-                  '-fno-stack-protector',
-                ],
-              }],
-            ],
-            'target_conditions': [
-              ['_type=="executable"', {
-                # Force android tools to export the "main" symbol so they can be
-                # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
-                # TODO(primiano): remove -fvisibility and -rdynamic flags below
-                # when ICS support will be dropped.
-                'cflags': [
-                  '-fPIE',
-                  '-fvisibility=default',
-                ],
-                'ldflags': [
-                  '-Bdynamic',
-                  '-Wl,--gc-sections',
-                  '-Wl,-z,nocopyreloc',
-                  '-pie',
-                  '-rdynamic',
-                  # crtbegin_dynamic.o should be the last item in ldflags.
-                  '<(android_ndk_lib)/crtbegin_dynamic.o',
-                ],
-                'libraries': [
-                  # crtend_android.o needs to be the last item in libraries.
-                  # Do not add any libraries after this!
-                  '<(android_ndk_lib)/crtend_android.o',
-                ],
-              }],
-              ['_type=="shared_library" or _type=="loadable_module"', {
-                'ldflags': [
-                  '-Wl,-shared,-Bsymbolic',
-                  # crtbegin_so.o should be the last item in ldflags.
-                  '<(android_ndk_lib)/crtbegin_so.o',
-                ],
-                'libraries': [
-                  # crtend_so.o needs to be the last item in libraries.
-                  # Do not add any libraries after this!
-                  '<(android_ndk_lib)/crtend_so.o',
-                ],
-              }],
-            ],
-          }],
-          # Settings for building host targets using the system toolchain.
-          ['_toolset=="host"', {
-            'cflags!': [
-              # Due to issues in Clang build system, using ASan on 32-bit
-              # binaries on x86_64 host is problematic.
-              # TODO(eugenis): re-enable.
-              '-fsanitize=address',
-            ],
-            'ldflags!': [
-              '-fsanitize=address',
-              '-Wl,-z,noexecstack',
-              '-Wl,--gc-sections',
-              '-Wl,-O1',
-              '-Wl,--as-needed',
-              '-Wl,--warn-shared-textrel',
-              '-Wl,--fatal-warnings',
-            ],
-          }],
-          # Settings for building host targets on mac.
-          ['_toolset=="host" and host_os=="mac"', {
-            'ldflags!': [
-              '-Wl,-z,now',
-              '-Wl,-z,relro',
-            ],
-          }],
-        ],
-      },
-    }],
-    ['OS=="solaris"', {
-      'cflags!': ['-fvisibility=hidden'],
-      'cflags_cc!': ['-fvisibility-inlines-hidden'],
-    }],
-    ['OS=="mac" or OS=="ios"', {
-      'target_defaults': {
-        'mac_bundle': 0,
-        'xcode_settings': {
-          'ALWAYS_SEARCH_USER_PATHS': 'NO',
-          # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
-          'CLANG_LINK_OBJC_RUNTIME': 'NO',          # -fno-objc-link-runtime
-          'COPY_PHASE_STRIP': 'NO',
-          'GCC_C_LANGUAGE_STANDARD': 'c99',         # -std=c99
-          'GCC_CW_ASM_SYNTAX': 'NO',                # No -fasm-blocks
-          'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',        # -fno-exceptions
-          'GCC_ENABLE_CPP_RTTI': 'NO',              # -fno-rtti
-          'GCC_ENABLE_PASCAL_STRINGS': 'NO',        # No -mpascal-strings
-          # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
-          'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
-          'GCC_OBJC_CALL_CXX_CDTORS': 'YES',        # -fobjc-call-cxx-cdtors
-          'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',      # -fvisibility=hidden
-          'GCC_THREADSAFE_STATICS': 'NO',           # -fno-threadsafe-statics
-          'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES',    # -Werror
-          'GCC_VERSION': '4.2',
-          'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',  # -Wnewline-eof
-          'USE_HEADERMAP': 'NO',
-          'WARNING_CFLAGS': [
-            '-Wall',
-            '-Wendif-labels',
-            '-Wextra',
-            # Don't warn about unused function parameters.
-            '-Wno-unused-parameter',
-            # Don't warn about the "struct foo f = {0};" initialization
-            # pattern.
-            '-Wno-missing-field-initializers',
-          ],
-          'conditions': [
-            ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
-                                 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
-            ],
-            # Note that the prebuilt Clang binaries should not be used for iOS
-            # development except for ASan builds.
-            ['clang==1', {
-              'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',  # -std=c++11
-              # Warn if automatic synthesis is triggered with
-              # the -Wobjc-missing-property-synthesis flag.
-              'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
-              'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
-              'WARNING_CFLAGS': [
-                # This warns on selectors from Cocoa headers (-length, -set).
-                # cfe-dev is currently discussing the merits of this warning.
-                # TODO(thakis): Reevaluate what to do with this, based one
-                # cfe-dev discussion.
-                '-Wno-selector-type-mismatch',
-              ],
-              'conditions': [
-                ['clang_xcode==0', {
-                  'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
-                  'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
-                }],
-              ],
-            }],
-            ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
-              'OTHER_CFLAGS': [
-                '<@(clang_chrome_plugins_flags)',
-              ],
-            }],
-            ['clang==1 and clang_xcode==0 and clang_load!=""', {
-              'OTHER_CFLAGS': [
-                '-Xclang', '-load', '-Xclang', '<(clang_load)',
-              ],
-            }],
-            ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
-              'OTHER_CFLAGS': [
-                '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
-              ],
-            }],
-            ['clang==1 and "<(GENERATOR)"=="ninja"', {
-              'OTHER_CFLAGS': [
-                # See http://crbug.com/110262
-                '-fcolor-diagnostics',
-              ],
-            }],
-            ['OS=="ios" and target_subarch!="arm32" and \
-              "<(GENERATOR)"=="xcode"', {
-              'OTHER_CFLAGS': [
-                # TODO(ios): when building Chrome for iOS on 64-bit platform
-                # with Xcode, the -Wshorted-64-to-32 warning is automatically
-                # enabled. This cause failures when compiling protobuf code,
-                # so disable the warning. http://crbug.com/359107
-                '-Wno-shorten-64-to-32',
-              ],
-            }],
-          ],
-        },
-        'conditions': [
-          ['clang==1', {
-            'variables': {
-              'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
-            },
-          }],
-          ['asan==1', {
-            'xcode_settings': {
-              'OTHER_CFLAGS': [
-                '-fsanitize=address',
-                '-mllvm -asan-globals=0',  # http://crbug.com/352073
-                '-gline-tables-only',
-              ],
-            },
-          }],
-          ['asan_coverage!=0 and sanitizer_coverage==0', {
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'cflags': [
-                  '-fsanitize-coverage=<(asan_coverage)',
-                ],
-                'defines': [
-                  'SANITIZER_COVERAGE',
-                ],
-              }],
-            ],
-          }],
-          ['sanitizer_coverage!=0', {
-            'target_conditions': [
-              ['_toolset=="target"', {
-                'cflags': [
-                  '-fsanitize-coverage=<(sanitizer_coverage)',
-                ],
-                'defines': [
-                  'SANITIZER_COVERAGE',
-                ],
-              }],
-            ],
-          }],
-        ],
-        'target_conditions': [
-          ['_type!="static_library"', {
-            'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
-            'conditions': [
-              ['asan==1', {
-                'xcode_settings': {
-                  'OTHER_LDFLAGS': [
-                    '-fsanitize=address',
-                  ],
-                },
-              }],
-              ['mac_write_linker_maps==1', {
-                'xcode_settings': {
-                  'OTHER_LDFLAGS': [
-                    '-Wl,-map,>(_target_name).map',
-                  ],
-                },
-              }],
-            ],
-          }],
-          ['_mac_bundle', {
-            'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
-            'target_conditions': [
-              ['_type=="executable"', {
-                'conditions': [
-                  ['asan==1', {
-                    'postbuilds': [
-                      {
-                        'variables': {
-                          # Define copy_asan_dylib_path in a variable ending in
-                          # _path so that gyp understands it's a path and
-                          # performs proper relativization during dict merging.
-                          'copy_asan_dylib_path':
-                            'mac/copy_asan_runtime_dylib.sh',
-                        },
-                        'postbuild_name': 'Copy ASan runtime dylib',
-                        'action': [
-                          '<(copy_asan_dylib_path)',
-                        ],
-                      },
-                    ],
-                  }],
-                ],
-              }],
-            ],
-          }],
-        ],  # target_conditions
-      },  # target_defaults
-    }],  # OS=="mac" or OS=="ios"
-    ['OS=="mac"', {
-      'target_defaults': {
-        'defines': [
-          # Prevent Mac OS X AssertMacros.h from defining macros that collide
-          # with common names, like 'check', 'require', and 'verify'.
-          # (Included by system header. Also exists on iOS but not included.)
-          # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
-          '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
-        ],
-        'variables': {
-          # These should end with %, but there seems to be a bug with % in
-          # variables that are intended to be set to different values in
-          # different targets, like these.
-          'mac_pie': 1,        # Most executables can be position-independent.
-          # Strip debugging symbols from the target.
-          'mac_strip': '<(mac_strip_release)',
-          'conditions': [
-            ['asan==1', {
-              'conditions': [
-                ['mac_want_real_dsym=="default"', {
-                  'mac_real_dsym': 1,
-                }, {
-                  'mac_real_dsym': '<(mac_want_real_dsym)'
-                }],
-              ],
-            }, {
-              'conditions': [
-                ['mac_want_real_dsym=="default"', {
-                  'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
-                }, {
-                  'mac_real_dsym': '<(mac_want_real_dsym)'
-                }],
-              ],
-            }],
-          ],
-        },
-        'configurations': {
-          'Release_Base': {
-            'conditions': [
-              ['branding=="Chrome" and buildtype=="Official"', {
-                'xcode_settings': {
-                  'OTHER_CFLAGS': [
-                    # The Google Chrome Framework dSYM generated by dsymutil has
-                    # grown larger than 4GB, which dsymutil can't handle. Reduce
-                    # the amount of debug symbols.
-                    '-fno-standalone-debug',  # See http://crbug.com/479841
-                  ]
-                },
-              }],
-            ],
-          },  # configuration "Release"
-        },  # configurations
-        'xcode_settings': {
-          'GCC_DYNAMIC_NO_PIC': 'NO',               # No -mdynamic-no-pic
-                                                    # (Equivalent to -fPIC)
-          # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
-          'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
-          # Keep pch files below xcodebuild/.
-          'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
-          'OTHER_CFLAGS': [
-            # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
-            # xcode_setting, but not until all downstream projects' mac bots are
-            # using xcode >= 4.6, because that's when the default value of the
-            # flag in the compiler switched.  Pre-4.6, the value 'NO' for that
-            # setting is a no-op as far as xcode is concerned, but the compiler
-            # behaves differently based on whether -fno-strict-aliasing is
-            # specified or not.
-            '-fno-strict-aliasing',  # See http://crbug.com/32204.
-          ],
-        },
-        'target_conditions': [
-          ['_type=="executable"', {
-            'postbuilds': [
-              {
-                # Arranges for data (heap) pages to be protected against
-                # code execution when running on Mac OS X 10.7 ("Lion"), and
-                # ensures that the position-independent executable (PIE) bit
-                # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
-                'variables': {
-                  # Define change_mach_o_flags in a variable ending in _path
-                  # so that GYP understands it's a path and performs proper
-                  # relativization during dict merging.
-                  'change_mach_o_flags_path':
-                      'mac/change_mach_o_flags_from_xcode.sh',
-                  'change_mach_o_flags_options%': [
-                  ],
-                  'target_conditions': [
-                    ['mac_pie==0 or release_valgrind_build==1', {
-                      # Don't enable PIE if it's unwanted. It's unwanted if
-                      # the target specifies mac_pie=0 or if building for
-                      # Valgrind, because Valgrind doesn't understand slide.
-                      # See the similar mac_pie/release_valgrind_build check
-                      # below.
-                      'change_mach_o_flags_options': [
-                        '--no-pie',
-                      ],
-                    }],
-                  ],
-                },
-                'postbuild_name': 'Change Mach-O Flags',
-                'action': [
-                  '<(change_mach_o_flags_path)',
-                  '>@(change_mach_o_flags_options)',
-                ],
-              },
-            ],
-            'target_conditions': [
-              ['mac_pie==1 and release_valgrind_build==0', {
-                # Turn on position-independence (ASLR) for executables. When
-                # PIE is on for the Chrome executables, the framework will
-                # also be subject to ASLR.
-                # Don't do this when building for Valgrind, because Valgrind
-                # doesn't understand slide. TODO: Make Valgrind on Mac OS X
-                # understand slide, and get rid of the Valgrind check.
-                'xcode_settings': {
-                  'OTHER_LDFLAGS': [
-                    '-Wl,-pie',  # Position-independent executable (MH_PIE)
-                  ],
-                },
-              }],
-            ],
-          }],
-          ['(_type=="executable" or _type=="shared_library" or \
-             _type=="loadable_module") and mac_strip!=0', {
-            'target_conditions': [
-              ['mac_real_dsym == 1', {
-                # To get a real .dSYM bundle produced by dsymutil, set the
-                # debug information format to dwarf-with-dsym.  Since
-                # strip_from_xcode will not be used, set Xcode to do the
-                # stripping as well.
-                'configurations': {
-                  'Release_Base': {
-                    'xcode_settings': {
-                      'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
-                      'DEPLOYMENT_POSTPROCESSING': 'YES',
-                      'STRIP_INSTALLED_PRODUCT': 'YES',
-                      'conditions': [
-                        # Only strip non-ASan builds.
-                        ['asan==0', {
-                          'target_conditions': [
-                            ['_type=="shared_library" or _type=="loadable_module"', {
-                              # The Xcode default is to strip debugging symbols
-                              # only (-S).  Local symbols should be stripped as
-                              # well, which will be handled by -x.  Xcode will
-                              # continue to insert -S when stripping even when
-                              # additional flags are added with STRIPFLAGS.
-                              'STRIPFLAGS': '-x',
-                            }],  # _type=="shared_library" or _type=="loadable_module"
-                          ],  # target_conditions
-                        }, {  # asan != 0
-                          'STRIPFLAGS': '-S',
-                        }],
-                      ],
-                    },  # xcode_settings
-                  },  # configuration "Release"
-                },  # configurations
-              }, {  # mac_real_dsym != 1
-                # To get a fast fake .dSYM bundle, use a post-build step to
-                # produce the .dSYM and strip the executable.  strip_from_xcode
-                # only operates in the Release configuration.
-                'postbuilds': [
-                  {
-                    'variables': {
-                      # Define strip_from_xcode in a variable ending in _path
-                      # so that gyp understands it's a path and performs proper
-                      # relativization during dict merging.
-                      'strip_from_xcode_path': 'mac/strip_from_xcode',
-                    },
-                    'postbuild_name': 'Strip If Needed',
-                    'action': ['<(strip_from_xcode_path)'],
-                  },
-                ],  # postbuilds
-              }],  # mac_real_dsym
-            ],  # target_conditions
-          }],  # (_type=="executable" or _type=="shared_library" or
-               #  _type=="loadable_module") and mac_strip!=0
-        ],  # target_conditions
-      },  # target_defaults
-    }],  # OS=="mac"
-    ['OS=="ios"', {
-      'includes': [
-        'ios/coverage.gypi',
-      ],
-      'target_defaults': {
-        'xcode_settings' : {
-          'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
-
-          'conditions': [
-            # Older Xcodes do not support -Wno-deprecated-register, so pass an
-            # additional flag to suppress the "unknown compiler option" error.
-            # Restrict this flag to builds that are either compiling with Xcode
-            # or compiling with Xcode's Clang.  This will allow Ninja builds to
-            # continue failing on unknown compiler options.
-            # TODO(rohitrao): This flag is temporary and should be removed as
-            # soon as the iOS bots are updated to use Xcode 5.1.
-            ['clang_xcode==1', {
-              'WARNING_CFLAGS': [
-                '-Wno-unknown-warning-option',
-                # It's not possible to achieve nullability completeness before
-                # all builders are running Xcode 7. crbug.com/499809
-                '-Wno-nullability-completeness',
-              ],
-            }],
-
-            # Limit the valid architectures depending on "target_subarch".
-            # This need to include the "arm" architectures but also the "x86"
-            # ones (they are used when building for the simulator).
-            ['target_subarch=="arm32"', {
-              'VALID_ARCHS': ['armv7', 'i386'],
-            }],
-            ['target_subarch=="arm64"', {
-              'VALID_ARCHS': ['arm64', 'x86_64'],
-            }],
-            ['target_subarch=="both"', {
-              'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
-            }],
-            ['use_system_libcxx==1', {
-              'target_conditions': [
-                # Only use libc++ when building target for iOS not when building
-                # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
-                # does not support libc++.
-                ['_toolset=="target"', {
-                  'CLANG_CXX_LIBRARY': 'libc++',  # -stdlib=libc++
-                }]
-              ],
-            }, {
-              # The default for deployment target of 7.0+ is libc++, so force
-              # the old behavior unless libc++ is enabled.
-              'CLANG_CXX_LIBRARY': 'libstdc++',  # -stdlib=libstdc++
-            }],
-          ],
-        },
-        'target_conditions': [
-          ['_toolset=="host"', {
-            'xcode_settings': {
-              'SDKROOT': 'macosx<(mac_sdk)',  # -isysroot
-              'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
-              'VALID_ARCHS': [
-                'x86_64',
-              ],
-              'ARCHS': [
-                'x86_64',
-              ],
-            },
-          }],
-          ['_toolset=="target"', {
-            'xcode_settings': {
-              # This section should be for overriding host settings. But,
-              # since we can't negate the iphone deployment target above, we
-              # instead set it here for target only.
-              'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
-              'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
-            },
-          }],
-          ['_type=="executable"', {
-            'configurations': {
-              'Release_Base': {
-                'xcode_settings': {
-                  'DEPLOYMENT_POSTPROCESSING': 'YES',
-                  'STRIP_INSTALLED_PRODUCT': 'YES',
-                },
-              },
-              'Debug_Base': {
-                'xcode_settings': {
-                  # Remove dSYM to reduce build time.
-                  'DEBUG_INFORMATION_FORMAT': 'dwarf',
-                },
-              },
-            },
-            'xcode_settings': {
-              'conditions': [
-                ['chromium_ios_signing', {
-                  # iOS SDK wants everything for device signed.
-                  'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
-                }, {
-                  'CODE_SIGNING_REQUIRED': 'NO',
-                  'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
-                }],
-              ],
-            },
-          }],
-        ],  # target_conditions
-      },  # target_defaults
-    }],  # OS=="ios"
-    ['OS=="win"', {
-      'target_defaults': {
-        'defines': [
-          '_WIN32_WINNT=0x0603',
-          'WINVER=0x0603',
-          'WIN32',
-          '_WINDOWS',
-          'NOMINMAX',
-          'PSAPI_VERSION=1',
-          '_CRT_RAND_S',
-          'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
-          'WIN32_LEAN_AND_MEAN',
-          '_ATL_NO_OPENGL',
-          '_SECURE_ATL',
-          # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
-          '_HAS_EXCEPTIONS=0',
-          # Silence some warnings; we can't switch the the 'recommended'
-          # versions as they're not available on old OSs.
-          '_WINSOCK_DEPRECATED_NO_WARNINGS',
-        ],
-        'conditions': [
-          ['buildtype=="Official"', {
-              # In official builds, targets can self-select an optimization
-              # level by defining a variable named 'optimize', and setting it
-              # to one of
-              # - "size", optimizes for minimal code size - the default.
-              # - "speed", optimizes for speed over code size.
-              # - "max", whole program optimization and link-time code
-              #   generation. This is very expensive and should be used
-              #   sparingly.
-              'variables': {
-                'optimize%': 'size',
-              },
-              'msvs_settings': {
-                'VCLinkerTool': {
-                  # Set /LTCG for the official builds.
-                  'LinkTimeCodeGeneration': '1',
-                  'AdditionalOptions': [
-                    # Set the number of LTCG code-gen threads to eight.
-                    # The default is four. This gives a 5-10% link speedup.
-                    '/cgthreads:8',
-                  ],
-                },
-              },
-              'target_conditions': [
-                ['optimize=="size"', {
-                    'msvs_settings': {
-                      'VCCLCompilerTool': {
-                        # 1, optimizeMinSpace, Minimize Size (/O1)
-                        'Optimization': '1',
-                        # 2, favorSize - Favor small code (/Os)
-                        'FavorSizeOrSpeed': '2',
-                      },
-                    },
-                  },
-                ],
-                # This config is used to avoid a problem in ffmpeg, see
-                # http://crbug.com/264459.
-                ['optimize=="size_no_ltcg"', {
-                    'msvs_settings': {
-                      'VCCLCompilerTool': {
-                        # 1, optimizeMinSpace, Minimize Size (/O1)
-                        'Optimization': '1',
-                        # 2, favorSize - Favor small code (/Os)
-                        'FavorSizeOrSpeed': '2',
-                      },
-                    },
-                  },
-                ],
-                ['optimize=="speed"', {
-                    'msvs_settings': {
-                      'VCCLCompilerTool': {
-                        # 2, optimizeMaxSpeed, Maximize Speed (/O2)
-                        'Optimization': '2',
-                        # 1, favorSpeed - Favor fast code (/Ot)
-                        'FavorSizeOrSpeed': '1',
-                      },
-                    },
-                  },
-                ],
-                ['optimize=="max"', {
-                    # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
-                    # builds. Probably anything that this would catch that
-                    # wouldn't be caught in a normal build isn't going to
-                    # actually be a bug, so the incremental value of C4702 for
-                    # PGO builds is likely very small.
-                    'msvs_disabled_warnings': [
-                      4702
-                    ],
-                    'msvs_settings': {
-                      'VCCLCompilerTool': {
-                        # 2, optimizeMaxSpeed, Maximize Speed (/O2)
-                        'Optimization': '2',
-                        # 1, favorSpeed - Favor fast code (/Ot)
-                        'FavorSizeOrSpeed': '1',
-                        # This implies link time code generation.
-                        'WholeProgramOptimization': 'true',
-                      },
-                    },
-                  },
-                ],
-              ],
-            },
-          ],
-          ['msvs_xtree_patched!=1', {
-            # If xtree hasn't been patched, then we disable C4702. Otherwise,
-            # it's enabled. This will generally only be true for system-level
-            # installed Express users.
-            'msvs_disabled_warnings': [
-              4702,
-            ],
-          }],
-        ],
-        'msvs_system_include_dirs': [
-          '<(windows_sdk_path)/Include/shared',
-          '<(windows_sdk_path)/Include/um',
-          '<(windows_sdk_path)/Include/winrt',
-          '$(VSInstallDir)/VC/atlmfc/include',
-        ],
-        'msvs_cygwin_shell': 0,
-        'msvs_disabled_warnings': [
-          # C4091: 'typedef ': ignored on left of 'X' when no variable is
-          #                    declared.
-          # This happens in a number of Windows headers. Dumb.
-          4091,
-
-          # C4127: conditional expression is constant
-          # This warning can in theory catch dead code and other problems, but
-          # triggers in far too many desirable cases where the conditional
-          # expression is either set by macros or corresponds some legitimate
-          # compile-time constant expression (due to constant template args,
-          # conditionals comparing the sizes of different types, etc.).  Some of
-          # these can be worked around, but it's not worth it.
-          4127,
-
-          # C4351: new behavior: elements of array 'array' will be default
-          #        initialized
-          # This is a silly "warning" that basically just alerts you that the
-          # compiler is going to actually follow the language spec like it's
-          # supposed to, instead of not following it like old buggy versions
-          # did.  There's absolutely no reason to turn this on.
-          4351,
-
-          # C4355: 'this': used in base member initializer list
-          # It's commonly useful to pass |this| to objects in a class'
-          # initializer list.  While this warning can catch real bugs, most of
-          # the time the constructors in question don't attempt to call methods
-          # on the passed-in pointer (until later), and annotating every legit
-          # usage of this is simply more hassle than the warning is worth.
-          4355,
-
-          # C4503: 'identifier': decorated name length exceeded, name was
-          #        truncated
-          # This only means that some long error messages might have truncated
-          # identifiers in the presence of lots of templates.  It has no effect
-          # on program correctness and there's no real reason to waste time
-          # trying to prevent it.
-          4503,
-
-          # Warning C4589 says: "Constructor of abstract class ignores
-          # initializer for virtual base class." Disable this warning because it
-          # is flaky in VS 2015 RTM. It triggers on compiler generated
-          # copy-constructors in some cases.
-          4589,
-
-          # C4611: interaction between 'function' and C++ object destruction is
-          #        non-portable
-          # This warning is unavoidable when using e.g. setjmp/longjmp.  MSDN
-          # suggests using exceptions instead of setjmp/longjmp for C++, but
-          # Chromium code compiles without exception support.  We therefore have
-          # to use setjmp/longjmp for e.g. JPEG decode error handling, which
-          # means we have to turn off this warning (and be careful about how
-          # object destruction happens in such cases).
-          4611,
-
-          # TODO(maruel): These warnings are level 4. They will be slowly
-          # removed as code is fixed.
-          4100, # Unreferenced formal parameter
-          4121, # Alignment of a member was sensitive to packing
-          4244, # Conversion from 'type1' to 'type2', possible loss of data
-          4481, # Nonstandard extension used: override specifier 'keyword'
-          4505, # Unreferenced local function has been removed
-          4510, # Default constructor could not be generated
-          4512, # Assignment operator could not be generated
-          4610, # Object can never be instantiated
-          4838, # Narrowing conversion. Doesn't seem to be very useful.
-          4996, # 'X': was declared deprecated (for GetVersionEx).
-
-          # These are variable shadowing warnings that are new in VS2015. We
-          # should work through these at some point -- they may be removed from
-          # the RTM release in the /W4 set.
-          4456, 4457, 4458, 4459,
-        ],
-        'msvs_settings': {
-          'VCCLCompilerTool': {
-            'AdditionalOptions': ['/MP'],
-            'MinimalRebuild': 'false',
-            'BufferSecurityCheck': 'true',
-            'EnableFunctionLevelLinking': 'true',
-            'RuntimeTypeInfo': 'false',
-            'WarningLevel': '4',
-            'WarnAsError': 'true',
-            'DebugInformationFormat': '3',
-            # ExceptionHandling must match _HAS_EXCEPTIONS above.
-            'ExceptionHandling': '0',
-          },
-          'VCLibrarianTool': {
-            'AdditionalOptions': ['/ignore:4221'],
-            'AdditionalLibraryDirectories': [
-              '<(windows_sdk_path)/Lib/win8/um/x86',
-            ],
-          },
-          'VCLinkerTool': {
-            'AdditionalDependencies': [
-              'wininet.lib',
-              'dnsapi.lib',
-              'version.lib',
-              'msimg32.lib',
-              'ws2_32.lib',
-              'usp10.lib',
-              'psapi.lib',
-              'dbghelp.lib',
-              'winmm.lib',
-              'shlwapi.lib',
-            ],
-            'AdditionalLibraryDirectories': [
-              '<(windows_sdk_path)/Lib/win8/um/x86',
-            ],
-            'GenerateDebugInformation': 'true',
-            'MapFileName': '$(OutDir)\\$(TargetName).map',
-            'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
-            'FixedBaseAddress': '1',
-            # SubSystem values:
-            #   0 == not set
-            #   1 == /SUBSYSTEM:CONSOLE
-            #   2 == /SUBSYSTEM:WINDOWS
-            # Most of the executables we'll ever create are tests
-            # and utilities with console output.
-            'SubSystem': '1',
-          },
-          'VCMIDLTool': {
-            'GenerateStublessProxies': 'true',
-            'TypeLibraryName': '$(InputName).tlb',
-            'OutputDirectory': '$(IntDir)',
-            'HeaderFileName': '$(InputName).h',
-            'DLLDataFileName': '$(InputName).dlldata.c',
-            'InterfaceIdentifierFileName': '$(InputName)_i.c',
-            'ProxyFileName': '$(InputName)_p.c',
-          },
-          'VCResourceCompilerTool': {
-            'Culture' : '1033',
-            'AdditionalIncludeDirectories': [
-              '<(DEPTH)',
-              '<(SHARED_INTERMEDIATE_DIR)',
-            ],
-          },
-          'target_conditions': [
-            ['_type=="executable"', {
-              'VCManifestTool': {
-                'EmbedManifest': 'true',
-              },
-            }],
-            ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
-              'VCManifestTool': {
-                'AdditionalManifestFiles': [
-                  '>(win_exe_compatibility_manifest)',
-                ],
-              },
-            }],
-          ],
-          'conditions': [
-            # Building with Clang on Windows is a work in progress and very
-            # experimental. See crbug.com/82385.
-            # Keep this in sync with the similar blocks in build/config/compiler/BUILD.gn
-            ['clang==1', {
-              'VCCLCompilerTool': {
-                'AdditionalOptions': [
-                  # Many files use intrinsics without including this header.
-                  # TODO(hans): Fix those files, or move this to sub-GYPs.
-                  '/FIIntrin.h',
-
-                  # TODO(hans): Make this list shorter eventually, http://crbug.com/504657
-                  '-Qunused-arguments',  # http://crbug.com/504658
-                  '-Wno-microsoft',  # http://crbug.com/505296
-                  '-Wno-switch',  # http://crbug.com/505308
-                  '-Wno-unknown-pragmas',  # http://crbug.com/505314
-                  '-Wno-unused-function',  # http://crbug.com/505316
-                  '-Wno-unused-value',  # http://crbug.com/505318
-                  '-Wno-unused-local-typedef',  # http://crbug.com/411648
-                ],
-              },
-            }],
-            ['clang==1 and target_arch=="ia32"', {
-              'VCCLCompilerTool': {
-                'WarnAsError': 'false',
-                'AdditionalOptions': [
-                  '/fallback',
-                ],
-              },
-            }],
-            ['clang==1 and clang_use_chrome_plugins==1', {
-              'VCCLCompilerTool': {
-                'AdditionalOptions': [
-                  '<@(clang_chrome_plugins_flags)',
-                ],
-              },
-            }],
-            ['clang==1 and MSVS_VERSION == "2013"', {
-              'VCCLCompilerTool': {
-                'AdditionalOptions': [
-                  '-fmsc-version=1800',
-                ],
-              },
-            }],
-            ['clang==1 and MSVS_VERSION == "2015"', {
-              'VCCLCompilerTool': {
-                'AdditionalOptions': [
-                  '-fmsc-version=1900',
-                ],
-              },
-            }],
-            ['clang==1 and "<!(python <(DEPTH)/build/win/use_ansi_codes.py)"=="True"', {
-              'VCCLCompilerTool': {
-                'AdditionalOptions': [
-                  # cmd.exe doesn't understand ANSI escape codes by default,
-                  # so only enable them if something emulating them is around.
-                  '-fansi-escape-codes',
-                  # Also see http://crbug.com/110262
-                  '-fcolor-diagnostics',
-                ],
-              },
-            }],
-          ],
-        },
-      },
-    }],
-    ['disable_nacl==1', {
-      'target_defaults': {
-        'defines': [
-          'DISABLE_NACL',
-        ],
-      },
-    }],
-    ['OS=="win" and msvs_use_common_linker_extras', {
-      'target_defaults': {
-        'msvs_settings': {
-          'VCLinkerTool': {
-            'DelayLoadDLLs': [
-              'dbghelp.dll',
-              'dwmapi.dll',
-              'shell32.dll',
-              'uxtheme.dll',
-            ],
-          },
-        },
-        'configurations': {
-          'x86_Base': {
-            'msvs_settings': {
-              'VCLinkerTool': {
-                'AdditionalOptions': [
-                  '/safeseh',
-                  '/dynamicbase',
-                  '/ignore:4199',
-                  '/ignore:4221',
-                  '/nxcompat',
-                ],
-              },
-              'conditions': [
-                ['syzyasan==0', {
-                  'VCLinkerTool': {
-                    'AdditionalOptions': ['/largeaddressaware'],
-                  },
-                }],
-                ['asan==1', {
-                  # TODO(asan/win): Move this down into the general
-                  # win-target_defaults section once the 64-bit asan runtime
-                  # exists.  See crbug.com/345874.
-                  'VCCLCompilerTool': {
-                    'AdditionalOptions': [
-                      '-fsanitize=address',
-                      '-fsanitize-blacklist=<(PRODUCT_DIR)/../../tools/memory/asan/blacklist_win.txt',
-                    ],
-                    'AdditionalIncludeDirectories': [
-                      # MSVC needs to be able to find the sanitizer headers when
-                      # invoked via /fallback. This is critical for using macros
-                      # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
-                      # back.
-                      '<(DEPTH)/<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/tools/clang/scripts/update.py --print-clang-version)/include_sanitizer',
-                    ],
-                  },
-                  'VCLinkerTool': {
-                    'AdditionalLibraryDirectories': [
-                      # TODO(hans): If make_clang_dir is absolute, this breaks.
-                      '<(DEPTH)/<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/tools/clang/scripts/update.py --print-clang-version)/lib/windows',
-                    ],
-                  },
-                  'target_conditions': [
-                    ['component=="shared_library"', {
-                      'VCLinkerTool': {
-                        'AdditionalDependencies': [
-                           'clang_rt.asan_dynamic-i386.lib',
-                           'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
-                        ],
-                      },
-                    }],
-                    ['_type=="executable" and component=="static_library"', {
-                      'VCLinkerTool': {
-                        'AdditionalDependencies': [
-                           'clang_rt.asan-i386.lib',
-                        ],
-                      },
-                    }],
-                    ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
-                      'VCLinkerTool': {
-                        'AdditionalDependencies': [
-                           'clang_rt.asan_dll_thunk-i386.lib',
-                        ],
-                      },
-                    }],
-                  ],
-                }],
-                ['sanitizer_coverage!=0', {
-                  # TODO(asan/win): Move this down into the general
-                  # win-target_defaults section once the 64-bit asan runtime
-                  # exists.  See crbug.com/345874.
-                  'VCCLCompilerTool': {
-                    'AdditionalOptions': [
-                      '-fsanitize-coverage=<(sanitizer_coverage)',
-                    ],
-                  },
-                }],
-              ],
-            },
-            'conditions': [
-              ['sanitizer_coverage!=0', {
-                # TODO(asan/win): Move this down into the general
-                # win-target_defaults section once the 64-bit asan runtime
-                # exists.  See crbug.com/345874.
-                'defines': [
-                  'SANITIZER_COVERAGE',
-                ],
-              }],
-            ],
-          },
-          'x64_Base': {
-            'msvs_settings': {
-              'VCLinkerTool': {
-                'AdditionalOptions': [
-                  # safeseh is not compatible with x64
-                  '/dynamicbase',
-                  '/ignore:4199',
-                  '/ignore:4221',
-                  '/nxcompat',
-                ],
-              },
-            },
-          },
-        },
-      },
-    }],
-    ['enable_new_npdevice_api==1', {
-      'target_defaults': {
-        'defines': [
-          'ENABLE_NEW_NPDEVICE_API',
-        ],
-      },
-    }],
-    # Don't warn about the "typedef 'foo' locally defined but not used"
-    # for gcc 4.8 and higher.
-    # TODO: remove this flag once all builds work. See crbug.com/227506
-    ['gcc_version>=48 and clang==0', {
-      'target_defaults': {
-        'cflags': [
-          '-Wno-unused-local-typedefs',
-        ],
-      },
-    }],
-    ['gcc_version>=48 and clang==0 and host_clang==1', {
-      'target_defaults': {
-        'target_conditions': [
-          ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
-        ],
-      },
-    }],
-    ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
-        'and OS!="win"', {
-      'make_global_settings': [
-        ['CC', '<(make_clang_dir)/bin/clang'],
-        ['CXX', '<(make_clang_dir)/bin/clang++'],
-        ['CC.host', '$(CC)'],
-        ['CXX.host', '$(CXX)'],
-      ],
-    }],
-    ['clang==1 and OS=="win"', {
-      'make_global_settings': [
-        # On Windows, gyp's ninja generator only looks at CC.
-        ['CC', '<(make_clang_dir)/bin/clang-cl'],
-      ],
-    }],
-    ['use_lld==1 and OS=="win"', {
-      'make_global_settings': [
-        # Limited to Windows because -flavor link2 is the driver that is
-        # compatible with link.exe.
-        ['LD', '<(make_clang_dir)/bin/lld -flavor link2'],
-      ],
-    }],
-    ['OS=="android" and clang==0', {
-      # Hardcode the compiler names in the Makefile so that
-      # it won't depend on the environment at make time.
-      'make_global_settings': [
-        ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
-        ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
-        ['CC.host', '<(host_cc)'],
-        ['CXX.host', '<(host_cxx)'],
-      ],
-    }],
-    ['OS=="linux" and target_arch=="mipsel" and clang==0', {
-      'make_global_settings': [
-        ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
-        ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
-        ['CC.host', '<(host_cc)'],
-        ['CXX.host', '<(host_cxx)'],
-      ],
-    }],
-    ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
-      # Set default ARM cross compiling on linux.  These can be overridden
-      # using CC/CXX/etc environment variables.
-      'make_global_settings': [
-        ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
-        ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
-        ['CC.host', '<(host_cc)'],
-        ['CXX.host', '<(host_cxx)'],
-      ],
-    }],
-
-    # TODO(yyanagisawa): supports GENERATOR==make
-    #  make generator doesn't support CC_wrapper without CC
-    #  in make_global_settings yet.
-    ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
-      'make_global_settings': [
-       ['CC_wrapper', '<(gomadir)/gomacc'],
-       ['CXX_wrapper', '<(gomadir)/gomacc'],
-       ['CC.host_wrapper', '<(gomadir)/gomacc'],
-       ['CXX.host_wrapper', '<(gomadir)/gomacc'],
-      ],
-    }],
-    ['use_lto==1', {
-      'target_defaults': {
-        'target_conditions': [
-          ['_toolset=="target"', {
-            'cflags': [
-              '-flto',
-            ],
-            'xcode_settings': {
-              'LLVM_LTO': 'YES',
-            },
-          }],
-          # Work-around for http://openradar.appspot.com/20356002
-          ['_toolset=="target" and _type!="static_library"', {
-            'xcode_settings': {
-              'OTHER_LDFLAGS': [
-                '-Wl,-all_load',
-              ],
-            },
-          }],
-        ],
-      },
-    }],
-    ['use_lto==1 and clang==0', {
-      'target_defaults': {
-        'target_conditions': [
-          ['_toolset=="target"', {
-            'cflags': [
-              '-ffat-lto-objects',
-            ],
-          }],
-        ],
-      },
-    }],
-    ['use_lto==1 and clang==1', {
-      'target_defaults': {
-        'target_conditions': [
-          ['_toolset=="target"', {
-            'arflags': [
-              '--plugin', '../../<(make_clang_dir)/lib/LLVMgold.so',
-            ],
-          }],
-        ],
-      },
-    }],
-    # Apply a lower LTO optimization level in non-official builds.
-    ['use_lto==1 and clang==1 and buildtype!="Official"', {
-      'target_defaults': {
-        'target_conditions': [
-          ['_toolset=="target"', {
-            'ldflags': [
-              '-Wl,--plugin-opt,O1',
-            ],
-          }],
-          ['_toolset=="target" and _type!="static_library"', {
-            'xcode_settings':  {
-              'OTHER_LDFLAGS': [
-                '-Wl,-mllvm,-O1',
-              ],
-            },
-          }],
-        ],
-      },
-    }],
-    ['use_lto==1 and clang==1 and target_arch=="arm"', {
-      'target_defaults': {
-        'target_conditions': [
-          ['_toolset=="target"', {
-            # Without this flag, LTO produces a .text section that is larger
-            # than the maximum call displacement, preventing the linker from
-            # relocating calls (http://llvm.org/PR22999).
-            'ldflags': [
-              '-Wl,-plugin-opt,-function-sections',
-            ],
-          }],
-        ],
-      },
-    }],
-    ['(use_lto==1 or use_lto_o2==1) and clang==0', {
-      'target_defaults': {
-        'target_conditions': [
-          ['_toolset=="target"', {
-            'ldflags': [
-              '-flto=32',
-            ],
-          }],
-        ],
-      },
-    }],
-    ['(use_lto==1 or use_lto_o2==1) and clang==1', {
-      'target_defaults': {
-        'target_conditions': [
-          ['_toolset=="target"', {
-            'ldflags': [
-              '-flto',
-            ],
-          }],
-        ],
-      },
-    }],
-    ['cfi_vptr==1', {
-      'target_defaults': {
-        'target_conditions': [
-          ['_toolset=="target"', {
-            'cflags': [
-              '-fsanitize=cfi-vcall',
-              '-fsanitize=cfi-derived-cast',
-              '-fsanitize=cfi-unrelated-cast',
-              '-fsanitize-blacklist=<(cfi_blacklist)',
-            ],
-            'ldflags': [
-              '-fsanitize=cfi-vcall',
-              '-fsanitize=cfi-derived-cast',
-              '-fsanitize=cfi-unrelated-cast',
-            ],
-            'xcode_settings': {
-              'OTHER_CFLAGS': [
-                '-fsanitize=cfi-vcall',
-                '-fsanitize=cfi-derived-cast',
-                '-fsanitize=cfi-unrelated-cast',
-                '-fsanitize-blacklist=<(cfi_blacklist)',
-              ],
-            },
-            'msvs_settings': {
-              'VCCLCompilerTool': {
-                'AdditionalOptions': [
-                  '-fsanitize=cfi-vcall',
-                  '-fsanitize=cfi-derived-cast',
-                  '-fsanitize=cfi-unrelated-cast',
-                  '-fsanitize-blacklist=<(cfi_blacklist)',
-                ],
-              },
-            },
-          }],
-          ['_toolset=="target" and _type!="static_library"', {
-            'xcode_settings':  {
-              'OTHER_LDFLAGS': [
-                '-fsanitize=cfi-vcall',
-                '-fsanitize=cfi-derived-cast',
-                '-fsanitize=cfi-unrelated-cast',
-              ],
-            },
-          }],
-        ],
-      },
-    }],
-  ],
-  'xcode_settings': {
-    # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
-    # This block adds *project-wide* configuration settings to each project
-    # file.  It's almost always wrong to put things here.  Specify your
-    # custom xcode_settings in target_defaults to add them to targets instead.
-
-    'conditions': [
-      # In an Xcode Project Info window, the "Base SDK for All Configurations"
-      # setting sets the SDK on a project-wide basis. In order to get the
-      # configured SDK to show properly in the Xcode UI, SDKROOT must be set
-      # here at the project level.
-      ['OS=="mac"', {
-        'conditions': [
-          ['mac_sdk_path==""', {
-            'SDKROOT': 'macosx<(mac_sdk)',  # -isysroot
-          }, {
-            'SDKROOT': '<(mac_sdk_path)',  # -isysroot
-          }],
-        ],
-      }],
-      ['OS=="ios"', {
-        'conditions': [
-          ['ios_sdk_path==""', {
-            'conditions': [
-              # TODO(justincohen): Ninja only supports simulator for now.
-              ['"<(GENERATOR)"=="xcode"', {
-                'SDKROOT': 'iphoneos<(ios_sdk)',  # -isysroot
-              }, {
-                'SDKROOT': 'iphonesimulator<(ios_sdk)',  # -isysroot
-              }],
-            ],
-          }, {
-            'SDKROOT': '<(ios_sdk_path)',  # -isysroot
-          }],
-        ],
-      }],
-      ['OS=="ios"', {
-        # Target both iPhone and iPad.
-        'TARGETED_DEVICE_FAMILY': '1,2',
-      }, {  # OS!="ios"
-        'conditions': [
-          ['target_arch=="x64"', {
-            'ARCHS': [
-              'x86_64'
-            ],
-          }],
-          ['target_arch=="ia32"', {
-            'ARCHS': [
-              'i386'
-            ],
-          }],
-        ],
-      }],
-    ],
-
-    # The Xcode generator will look for an xcode_settings section at the root
-    # of each dict and use it to apply settings on a file-wide basis.  Most
-    # settings should not be here, they should be in target-specific
-    # xcode_settings sections, or better yet, should use non-Xcode-specific
-    # settings in target dicts.  SYMROOT is a special case, because many other
-    # Xcode variables depend on it, including variables such as
-    # PROJECT_DERIVED_FILE_DIR.  When a source group corresponding to something
-    # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
-    # files to appear (when present) in the UI as actual files and not red
-    # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
-    # and therefore SYMROOT, needs to be set at the project level.
-    'SYMROOT': '<(DEPTH)/xcodebuild',
-  },
-}
diff --git a/build/common_untrusted.gypi b/build/common_untrusted.gypi
deleted file mode 100644
index bcc3686..0000000
--- a/build/common_untrusted.gypi
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This GYP file should be included for every target in Chromium that is built
-# using the NaCl toolchain.
-{
-  'includes': [
-    '../native_client/build/untrusted.gypi',
-  ],
-  'target_defaults': {
-    'conditions': [
-      # TODO(bradnelson): Drop this once the nacl side does the same.
-      ['target_arch=="x64"', {
-        'variables': {
-          'enable_x86_32': 0,
-        },
-      }],
-      ['target_arch=="ia32" and OS!="win"', {
-        'variables': {
-          'enable_x86_64': 0,
-        },
-      }],
-      ['target_arch=="arm"', {
-        'variables': {
-          'clang': 1,
-        },
-        'defines': [
-          # Needed by build/build_config.h processor architecture detection.
-          '__ARMEL__',
-          # Needed by base/third_party/nspr/prtime.cc.
-          '__arm__',
-          # Disable ValGrind. The assembly code it generates causes the build
-          # to fail.
-          'NVALGRIND',
-        ],
-      }],
-    ],
-  },
-}
diff --git a/build/compiled_action.gni b/build/compiled_action.gni
index b6d0c4d..e4e999a 100644
--- a/build/compiled_action.gni
+++ b/build/compiled_action.gni
@@ -72,6 +72,8 @@
   _host_executable_suffix = ""
 }
 
+_dart_root = rebase_path("..")
+
 template("compiled_action") {
   assert(defined(invoker.tool), "tool must be defined for $target_name")
   assert(defined(invoker.outputs), "outputs must be defined for $target_name")
@@ -85,7 +87,7 @@
       visibility = invoker.visibility
     }
 
-    script = "//build/gn_run_binary.py"
+    script = "$_dart_root/build/gn_run_binary.py"
 
     if (defined(invoker.inputs)) {
       inputs = invoker.inputs
@@ -118,7 +120,10 @@
 
     # The script takes as arguments the binary to run, and then the arguments
     # to pass it.
-    args = [ rebase_path(host_executable, root_build_dir) ] + invoker.args
+    args = [
+      "compiled_action",
+      rebase_path(host_executable, root_build_dir)
+    ] + invoker.args
   }
 }
 
@@ -134,7 +139,7 @@
       visibility = invoker.visibility
     }
 
-    script = "//build/gn_run_binary.py"
+    script = "$_dart_root/build/gn_run_binary.py"
     sources = invoker.sources
 
     if (defined(invoker.inputs)) {
@@ -168,6 +173,9 @@
 
     # The script takes as arguments the binary to run, and then the arguments
     # to pass it.
-    args = [ rebase_path(host_executable, root_build_dir) ] + invoker.args
+    args = [
+      "compiled_action",
+      rebase_path(host_executable, root_build_dir)
+    ] + invoker.args
   }
 }
diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn
index 93243a1..418e7c1 100644
--- a/build/config/BUILD.gn
+++ b/build/config/BUILD.gn
@@ -5,15 +5,11 @@
 # Debug/release ----------------------------------------------------------------
 
 config("debug") {
-  defines = [
-    "DEBUG",
-  ]
+  defines = [ "DEBUG" ]
 }
 
 config("release") {
-  defines = [
-    "NDEBUG"
-  ]
+  defines = [ "NDEBUG" ]
 }
 
 config("product") {
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
index 09527af..d01496f 100644
--- a/build/config/BUILDCONFIG.gn
+++ b/build/config/BUILDCONFIG.gn
@@ -308,11 +308,6 @@
   _shared_library_configs += _windows_linker_configs
 } else if (is_mac) {
   _shared_library_configs += [ "//build/config/mac:mac_dynamic_flags" ]
-} else if (is_android) {
-  # Strip native JNI exports from shared libraries by default. Binaries that
-  # want this can remove this config.
-  _shared_library_configs +=
-      [ "//build/config/android:hide_native_jni_exports" ]
 }
 set_defaults("shared_library") {
   configs = _shared_library_configs
@@ -337,11 +332,7 @@
 
 if (is_win) {
   # On windows we use the same toolchain for host and target by default.
-  if (is_clang) {
-    host_toolchain = "//build/toolchain/win:clang_$current_cpu"
-  } else {
-    host_toolchain = "//build/toolchain/win:$current_cpu"
-  }
+  host_toolchain = "//build/toolchain/win:$current_cpu"
   set_default_toolchain("$host_toolchain")
 } else if (is_android) {
   if (host_os == "linux") {
diff --git a/build/config/android/BUILD.gn b/build/config/android/BUILD.gn
index 5492693..0cc38b7 100644
--- a/build/config/android/BUILD.gn
+++ b/build/config/android/BUILD.gn
@@ -25,8 +25,3 @@
   cflags = [ "-fPIE" ]
   ldflags = [ "-pie" ]
 }
-
-config("hide_native_jni_exports") {
-  ldflags = [ "-Wl,--version-script=" +
-              rebase_path("//build/android/android_no_jni_exports.lst") ]
-}
diff --git a/build/config/android/OWNERS b/build/config/android/OWNERS
deleted file mode 100644
index 3759e93..0000000
--- a/build/config/android/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-cjhopman@chromium.org
diff --git a/build/config/android/config.gni b/build/config/android/config.gni
index 35ffcccf..3346966 100644
--- a/build/config/android/config.gni
+++ b/build/config/android/config.gni
@@ -5,53 +5,23 @@
 # This file contains common system config stuff for the Android build.
 
 if (is_android) {
-  has_chrome_android_internal =
-      exec_script("//build/dir_exists.py",
-                  [ rebase_path("//clank", root_build_dir) ],
-                  "string") == "True"
-
-  if (has_chrome_android_internal) {
-    import("//clank/config.gni")
-  }
-
   if (!defined(default_android_sdk_root)) {
     default_android_sdk_root = "//third_party/android_tools/sdk"
     default_android_sdk_version = "22"
     default_android_sdk_build_tools_version = "22.0.1"
   }
 
-  if (!defined(google_play_services_library)) {
-    google_play_services_library =
-        "//third_party/android_tools:google_play_services_default_java"
-  }
-
   declare_args() {
     android_sdk_root = default_android_sdk_root
     android_sdk_version = default_android_sdk_version
     android_sdk_build_tools_version = default_android_sdk_build_tools_version
-
-    android_default_keystore_path =
-        "//build/android/ant/chromium-debug.keystore"
-    android_default_keystore_name = "chromiumdebugkey"
-    android_default_keystore_password = "chromium"
-
-    # This is a unique identifier for a given build. It's used for
-    # identifying various build artifacts corresponding to a particular build of
-    # chrome (e.g. where to find archived symbols).
-    android_chrome_build_id = "\"\""
-
-    # Set to true to run findbugs on JAR targets.
-    run_findbugs = false
-
-    # Set to true to enable the Errorprone compiler
-    use_errorprone_java_compiler = false
   }
 
   # Host stuff -----------------------------------------------------------------
 
   # Defines the name the Android build gives to the current host CPU
   # architecture, which is different than the names GN uses.
-  if ((host_cpu == "x64") || (host_cpu == "x86")) {
+  if (host_cpu == "x64" || host_cpu == "x86") {
     android_host_arch = "x86_64"
   } else {
     assert(false, "Need Android toolchain support for your build CPU arch.")
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
deleted file mode 100644
index ab154b4..0000000
--- a/build/config/android/internal_rules.gni
+++ /dev/null
@@ -1,1596 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import("//build/config/android/config.gni")
-
-assert(is_android)
-
-rebased_android_sdk = rebase_path(android_sdk, root_build_dir)
-rebased_android_sdk_root = rebase_path(android_sdk_root, root_build_dir)
-rebased_android_sdk_build_tools =
-    rebase_path(android_sdk_build_tools, root_build_dir)
-
-android_sdk_jar = "$android_sdk/android.jar"
-rebased_android_sdk_jar = rebase_path(android_sdk_jar, root_build_dir)
-android_aapt_path = "$rebased_android_sdk_build_tools/aapt"
-
-template("android_lint") {
-  set_sources_assignment_filter([])
-  if (defined(invoker.testonly)) {
-    testonly = invoker.testonly
-  }
-
-  jar_path = invoker.jar_path
-  android_manifest = invoker.android_manifest
-  java_files = invoker.java_files
-  base_path = "$target_gen_dir/$target_name"
-
-  action(target_name) {
-    script = "//build/android/gyp/lint.py"
-    result_path = base_path + "/result.xml"
-    config_path = base_path + "/config.xml"
-    suppressions_file = "//build/android/lint/suppressions.xml"
-    inputs = [
-               suppressions_file,
-               android_manifest,
-               jar_path,
-             ] + java_files
-
-    outputs = [
-      config_path,
-      result_path,
-    ]
-
-    rebased_java_files = rebase_path(java_files, root_build_dir)
-
-    args = [
-      "--lint-path=$rebased_android_sdk_root/tools/lint",
-      "--config-path",
-      rebase_path(suppressions_file, root_build_dir),
-      "--manifest-path",
-      rebase_path(android_manifest, root_build_dir),
-      "--product-dir=.",
-      "--jar-path",
-      rebase_path(jar_path, root_build_dir),
-      "--processed-config-path",
-      rebase_path(config_path, root_build_dir),
-      "--result-path",
-      rebase_path(result_path, root_build_dir),
-      "--java-files=$rebased_java_files",
-      "--enable",
-    ]
-
-    if (defined(invoker.deps)) {
-      deps = invoker.deps
-    }
-    if (defined(invoker.public_deps)) {
-      public_deps = invoker.public_deps
-    }
-    if (defined(invoker.data_deps)) {
-      data_deps = invoker.data_deps
-    }
-  }
-}
-
-template("findbugs") {
-  jar_path = invoker.jar_path
-
-  build_config = invoker.build_config
-
-  action(target_name) {
-    script = "//build/android/findbugs_diff.py"
-    depfile = "$target_gen_dir/$target_name.d"
-    result_path = "$target_gen_dir/$target_name/result.xml"
-    exclusions_file = "//build/android/findbugs_filter/findbugs_exclude.xml"
-
-    rebased_build_config = rebase_path(build_config, root_build_dir)
-
-    if (defined(invoker.deps)) {
-      deps = invoker.deps
-    }
-
-    if (defined(invoker.testonly)) {
-      testonly = invoker.testonly
-    }
-
-    inputs = [
-      "//build/android/pylib/utils/findbugs.py",
-      exclusions_file,
-      jar_path,
-    ]
-
-    outputs = [
-      depfile,
-      result_path,
-    ]
-
-    args = [
-      "--depfile",
-      rebase_path(depfile, root_build_dir),
-      "--exclude",
-      rebase_path(exclusions_file, root_build_dir),
-      "--auxclasspath-gyp",
-      "@FileArg($rebased_build_config:javac:classpath)",
-      "--output-file",
-      rebase_path(result_path, root_build_dir),
-      rebase_path(jar_path, root_build_dir),
-    ]
-  }
-}
-
-template("dex") {
-  set_sources_assignment_filter([])
-  if (defined(invoker.testonly)) {
-    testonly = invoker.testonly
-  }
-
-  assert(defined(invoker.output))
-  action(target_name) {
-    script = "//build/android/gyp/dex.py"
-    depfile = "$target_gen_dir/$target_name.d"
-    if (defined(invoker.sources)) {
-      sources = invoker.sources
-    }
-    outputs = [
-      depfile,
-      invoker.output,
-    ]
-    if (defined(invoker.inputs)) {
-      inputs = invoker.inputs
-    }
-
-    if (defined(invoker.deps)) {
-      deps = invoker.deps
-    }
-
-    rebased_output = rebase_path(invoker.output, root_build_dir)
-
-    args = [
-      "--depfile",
-      rebase_path(depfile, root_build_dir),
-      "--android-sdk-tools",
-      rebased_android_sdk_build_tools,
-      "--dex-path",
-      rebased_output,
-    ]
-
-    if (defined(invoker.no_locals) && invoker.no_locals) {
-      args += [ "--no-locals=1" ]
-    }
-
-    if (defined(invoker.args)) {
-      args += invoker.args
-    }
-
-    if (defined(invoker.sources)) {
-      args += rebase_path(invoker.sources, root_build_dir)
-    }
-  }
-}
-
-# Creates a zip archive of the inputs.
-# If base_dir is provided, the archive paths will be relative to it.
-template("zip") {
-  set_sources_assignment_filter([])
-  if (defined(invoker.testonly)) {
-    testonly = invoker.testonly
-  }
-
-  assert(defined(invoker.inputs))
-  assert(defined(invoker.output))
-
-  rebase_inputs = rebase_path(invoker.inputs, root_build_dir)
-  rebase_output = rebase_path(invoker.output, root_build_dir)
-  action(target_name) {
-    script = "//build/android/gn/zip.py"
-    depfile = "$target_gen_dir/$target_name.d"
-    inputs = invoker.inputs
-    outputs = [
-      depfile,
-      invoker.output,
-    ]
-    args = [
-      "--depfile",
-      rebase_path(depfile, root_build_dir),
-      "--inputs=$rebase_inputs",
-      "--output=$rebase_output",
-    ]
-    if (defined(invoker.base_dir)) {
-      args += [
-        "--base-dir",
-        rebase_path(invoker.base_dir, root_build_dir),
-      ]
-    }
-
-    if (defined(invoker.deps)) {
-      deps = invoker.deps
-    }
-    if (defined(invoker.public_deps)) {
-      public_deps = invoker.public_deps
-    }
-    if (defined(invoker.data_deps)) {
-      data_deps = invoker.data_deps
-    }
-
-    if (defined(invoker.visibility)) {
-      visibility = invoker.visibility
-    }
-  }
-}
-
-# Write the target's .build_config file. This is a json file that contains a
-# dictionary of information about how to build this target (things that
-# require knowledge about this target's dependencies and cannot be calculated
-# at gn-time). There is a special syntax to add a value in that dictionary to
-# an action/action_foreachs args:
-#   --python-arg=@FileArg($rebased_build_config_path:key0:key1)
-# At runtime, such an arg will be replaced by the value in the build_config.
-# See build/android/gyp/write_build_config.py and
-# build/android/gyp/util/build_utils.py:ExpandFileArgs
-template("write_build_config") {
-  set_sources_assignment_filter([])
-  if (defined(invoker.testonly)) {
-    testonly = invoker.testonly
-  }
-
-  assert(defined(invoker.type))
-  assert(defined(invoker.build_config))
-
-  type = invoker.type
-  build_config = invoker.build_config
-
-  assert(type == "android_apk" || type == "java_library" ||
-         type == "android_resources" || type == "deps_dex")
-
-  action(target_name) {
-    if (defined(invoker.visibility)) {
-      visibility = invoker.visibility
-    }
-
-    script = "//build/android/gyp/write_build_config.py"
-    depfile = "$target_gen_dir/$target_name.d"
-    inputs = []
-
-    deps = []
-    if (defined(invoker.deps)) {
-      deps += invoker.deps
-    }
-
-    possible_deps_configs = []
-    foreach(d, deps) {
-      dep_gen_dir = get_label_info(d, "target_gen_dir")
-      dep_name = get_label_info(d, "name")
-      possible_deps_configs += [ "$dep_gen_dir/$dep_name.build_config" ]
-    }
-    rebase_possible_deps_configs =
-        rebase_path(possible_deps_configs, root_build_dir)
-
-    outputs = [
-      depfile,
-      build_config,
-    ]
-
-    args = [
-      "--type",
-      type,
-      "--depfile",
-      rebase_path(depfile, root_build_dir),
-      "--possible-deps-configs=$rebase_possible_deps_configs",
-      "--build-config",
-      rebase_path(build_config, root_build_dir),
-    ]
-
-    is_java_library = type == "java_library"
-    is_apk = type == "android_apk"
-    is_android_resources = type == "android_resources"
-    is_deps_dex = type == "deps_dex"
-
-    supports_android = is_apk || is_android_resources || is_deps_dex ||
-                       (is_java_library && defined(invoker.supports_android) &&
-                        invoker.supports_android)
-    requires_android = is_apk || is_android_resources || is_deps_dex ||
-                       (is_java_library && defined(invoker.requires_android) &&
-                        invoker.requires_android)
-
-    assert(!requires_android || supports_android,
-           "requires_android requires" + " supports_android")
-
-    # Mark these variables as used.
-    assert(is_java_library || true)
-    assert(is_apk || true)
-    assert(is_android_resources || true)
-    assert(is_deps_dex || true)
-
-    if (is_java_library || is_apk) {
-      args += [
-        "--jar-path",
-        rebase_path(invoker.jar_path, root_build_dir),
-      ]
-    }
-
-    if (is_apk || is_deps_dex || (is_java_library && supports_android)) {
-      args += [
-        "--dex-path",
-        rebase_path(invoker.dex_path, root_build_dir),
-      ]
-    }
-    if (supports_android) {
-      args += [ "--supports-android" ]
-    }
-    if (requires_android) {
-      args += [ "--requires-android" ]
-    }
-    if (defined(invoker.bypass_platform_checks) &&
-        invoker.bypass_platform_checks) {
-      args += [ "--bypass-platform-checks" ]
-    }
-
-    if (defined(invoker.apk_under_test)) {
-      deps += [ invoker.apk_under_test ]
-      apk_under_test_gen_dir =
-          get_label_info(invoker.apk_under_test, "target_gen_dir")
-      apk_under_test_name = get_label_info(invoker.apk_under_test, "name")
-      apk_under_test_config =
-          "$apk_under_test_gen_dir/$apk_under_test_name.build_config"
-      args += [
-        "--tested-apk-config",
-        rebase_path(apk_under_test_config, root_build_dir),
-      ]
-    }
-
-    if (is_android_resources || is_apk) {
-      assert(defined(invoker.resources_zip))
-      args += [
-        "--resources-zip",
-        rebase_path(invoker.resources_zip, root_build_dir),
-      ]
-      if (defined(invoker.android_manifest)) {
-        inputs += [ invoker.android_manifest ]
-        args += [
-          "--android-manifest",
-          rebase_path(invoker.android_manifest, root_build_dir),
-        ]
-      } else {
-        assert(!is_apk, "apk build configs require an android_manifest")
-      }
-      if (defined(invoker.custom_package)) {
-        args += [
-          "--package-name",
-          invoker.custom_package,
-        ]
-      }
-      if (defined(invoker.r_text)) {
-        args += [
-          "--r-text",
-          rebase_path(invoker.r_text, root_build_dir),
-        ]
-      }
-    }
-
-    if (is_apk) {
-      if (defined(invoker.native_libs)) {
-        inputs += invoker.native_libs
-        rebased_native_libs = rebase_path(invoker.native_libs, root_build_dir)
-        rebased_android_readelf = rebase_path(android_readelf, root_build_dir)
-        args += [
-          "--native-libs=$rebased_native_libs",
-          "--readelf-path=$rebased_android_readelf",
-        ]
-      }
-    }
-
-    if (defined(invoker.srcjar)) {
-      args += [
-        "--srcjar",
-        rebase_path(invoker.srcjar, root_build_dir),
-      ]
-    }
-  }
-}
-
-template("process_java_prebuilt") {
-  set_sources_assignment_filter([])
-  if (defined(invoker.testonly)) {
-    testonly = invoker.testonly
-  }
-
-  _input_jar_path = invoker.input_jar_path
-  _output_jar_path = invoker.output_jar_path
-  _jar_toc_path = _output_jar_path + ".TOC"
-
-  assert(invoker.build_config != "")
-
-  if (defined(invoker.proguard_preprocess) && invoker.proguard_preprocess) {
-    _proguard_jar_path = "$android_sdk_root/tools/proguard/lib/proguard.jar"
-    _proguard_config_path = invoker.proguard_config
-    _build_config = invoker.build_config
-    _rebased_build_config = rebase_path(_build_config, root_build_dir)
-    _output_jar_target = "${target_name}__proguard_process"
-    action(_output_jar_target) {
-      script = "//build/android/gyp/proguard.py"
-      inputs = [
-        android_sdk_jar,
-        _proguard_jar_path,
-        _build_config,
-        _input_jar_path,
-        _proguard_config_path,
-      ]
-      depfile = "${target_gen_dir}/${target_name}.d"
-      outputs = [
-        depfile,
-        _output_jar_path,
-      ]
-      args = [
-        "--depfile",
-        rebase_path(depfile, root_build_dir),
-        "--proguard-path",
-        rebase_path(_proguard_jar_path, root_build_dir),
-        "--input-path",
-        rebase_path(_input_jar_path, root_build_dir),
-        "--output-path",
-        rebase_path(_output_jar_path, root_build_dir),
-        "--proguard-config",
-        rebase_path(_proguard_config_path, root_build_dir),
-        "--classpath",
-        rebased_android_sdk_jar,
-        "--classpath=@FileArg($_rebased_build_config:javac:classpath)",
-      ]
-
-      if (defined(invoker.deps)) {
-        deps = invoker.deps
-      }
-      if (defined(invoker.public_deps)) {
-        public_deps = invoker.public_deps
-      }
-      if (defined(invoker.data_deps)) {
-        data_deps = invoker.data_deps
-      }
-    }
-  } else {
-    _output_jar_target = "${target_name}__copy_jar"
-    copy(_output_jar_target) {
-      sources = [
-        _input_jar_path,
-      ]
-      outputs = [
-        _output_jar_path,
-      ]
-
-      if (defined(invoker.deps)) {
-        deps = invoker.deps
-      }
-      if (defined(invoker.public_deps)) {
-        public_deps = invoker.public_deps
-      }
-      if (defined(invoker.data_deps)) {
-        data_deps = invoker.data_deps
-      }
-    }
-  }
-
-  action("${target_name}__jar_toc") {
-    script = "//build/android/gyp/jar_toc.py"
-    depfile = "$target_gen_dir/$target_name.d"
-    outputs = [
-      depfile,
-      _jar_toc_path,
-      _jar_toc_path + ".md5.stamp",
-    ]
-    inputs = [
-      _output_jar_path,
-    ]
-    args = [
-      "--depfile",
-      rebase_path(depfile, root_build_dir),
-      "--jar-path",
-      rebase_path(_output_jar_path, root_build_dir),
-      "--toc-path",
-      rebase_path(_jar_toc_path, root_build_dir),
-    ]
-    public_deps = [
-      ":$_output_jar_target",
-    ]
-  }
-
-  group(target_name) {
-    if (defined(invoker.visibility)) {
-      visibility = invoker.visibility
-    }
-    public_deps = [
-      ":${target_name}__jar_toc",
-      ":$_output_jar_target",
-    ]
-  }
-}
-
-template("finalize_apk") {
-  action(target_name) {
-    script = "//build/android/gyp/finalize_apk.py"
-    depfile = "$target_gen_dir/$target_name.d"
-
-    if (defined(invoker.testonly)) {
-      testonly = invoker.testonly
-    }
-
-    sources = [
-      invoker.input_apk_path,
-    ]
-    inputs = [
-      invoker.keystore_path,
-    ]
-    outputs = [
-      depfile,
-      invoker.output_apk_path,
-    ]
-
-    args = [
-      "--depfile",
-      rebase_path(depfile, root_build_dir),
-      "--zipalign-path",
-      rebase_path(zipalign_path, root_build_dir),
-      "--unsigned-apk-path",
-      rebase_path(invoker.input_apk_path, root_build_dir),
-      "--final-apk-path",
-      rebase_path(invoker.output_apk_path, root_build_dir),
-      "--key-path",
-      rebase_path(invoker.keystore_path, root_build_dir),
-      "--key-name",
-      invoker.keystore_name,
-      "--key-passwd",
-      invoker.keystore_password,
-    ]
-    if (defined(invoker.rezip_apk) && invoker.rezip_apk) {
-      _rezip_jar_path = "$root_build_dir/lib.java/rezip_apk.jar"
-      inputs += [ _rezip_jar_path ]
-      args += [
-        "--load-library-from-zip=1",
-        "--rezip-apk-jar-path",
-        rebase_path(_rezip_jar_path, root_build_dir),
-      ]
-    }
-
-    if (defined(invoker.deps)) {
-      deps = invoker.deps
-    }
-    if (defined(invoker.public_deps)) {
-      public_deps = invoker.public_deps
-    }
-    if (defined(invoker.data_deps)) {
-      data_deps = invoker.data_deps
-    }
-  }
-}
-
-# Packages resources, assets, dex, and native libraries into an apk. Signs and
-# zipaligns the apk.
-template("create_apk") {
-  set_sources_assignment_filter([])
-  if (defined(invoker.testonly)) {
-    testonly = invoker.testonly
-  }
-
-  _android_manifest = invoker.android_manifest
-  _base_path = invoker.base_path
-  _final_apk_path = invoker.apk_path
-
-  if (defined(invoker.resources_zip)) {
-    _resources_zip = invoker.resources_zip
-  }
-  if (defined(invoker.dex_path)) {
-    _dex_path = invoker.dex_path
-  }
-  _load_library_from_apk = invoker.load_library_from_apk
-
-  _package_deps = []
-  if (defined(invoker.deps)) {
-    _package_deps = invoker.deps
-  }
-
-  _native_libs_dir = "//build/android/empty/res"
-  if (defined(invoker.native_libs_dir)) {
-    _native_libs_dir = invoker.native_libs_dir
-  }
-
-  if (defined(invoker.asset_location)) {
-    _asset_location = invoker.asset_location
-  }
-
-  _version_code = invoker.version_code
-  _version_name = invoker.version_name
-
-  _base_apk_path = _base_path + ".apk_intermediates"
-
-  _resource_packaged_apk_path = _base_apk_path + ".ap_"
-  _packaged_apk_path = _base_apk_path + ".unfinished.apk"
-  _shared_resources =
-      defined(invoker.shared_resources) && invoker.shared_resources
-
-  _configuration_name = "Release"
-  if (is_debug) {
-    _configuration_name = "Debug"
-  }
-
-  _keystore_path = invoker.keystore_path
-  _keystore_name = invoker.keystore_name
-  _keystore_password = invoker.keystore_password
-
-  _split_densities = []
-  if (defined(invoker.create_density_splits) && invoker.create_density_splits) {
-    _split_densities = [
-      "hdpi",
-      "xhdpi",
-      "xxhdpi",
-      "xxxhdpi",
-      "tvdpi",
-    ]
-  }
-
-  _split_languages = []
-  if (defined(invoker.language_splits)) {
-    _split_languages = invoker.language_splits
-  }
-
-  _package_resources_target_name = "${target_name}__package_resources"
-  action(_package_resources_target_name) {
-    deps = _package_deps
-
-    script = "//build/android/gyp/package_resources.py"
-    depfile = "${target_gen_dir}/${target_name}.d"
-    inputs = [
-      _android_manifest,
-    ]
-    if (defined(_resources_zip)) {
-      inputs += [ _resources_zip ]
-    }
-    outputs = [
-      depfile,
-      _resource_packaged_apk_path,
-    ]
-
-    args = [
-      "--depfile",
-      rebase_path(depfile, root_build_dir),
-      "--android-sdk",
-      rebased_android_sdk,
-      "--aapt-path",
-      android_aapt_path,
-      "--configuration-name=$_configuration_name",
-      "--android-manifest",
-      rebase_path(_android_manifest, root_build_dir),
-      "--version-code",
-      _version_code,
-      "--version-name",
-      _version_name,
-      "--apk-path",
-      rebase_path(_resource_packaged_apk_path, root_build_dir),
-    ]
-
-    if (defined(_asset_location)) {
-      args += [
-        "--asset-dir",
-        rebase_path(_asset_location, root_build_dir),
-      ]
-    }
-    if (defined(_resources_zip)) {
-      args += [
-        "--resource-zips",
-        rebase_path(_resources_zip, root_build_dir),
-      ]
-    }
-    if (_shared_resources) {
-      args += [ "--shared-resources" ]
-    }
-    if (_split_densities != []) {
-      args += [ "--create-density-splits" ]
-      foreach(_density, _split_densities) {
-        outputs += [ "${_resource_packaged_apk_path}_${_density}" ]
-      }
-    }
-    if (_split_languages != []) {
-      args += [ "--language-splits=$_split_languages" ]
-      foreach(_language, _split_languages) {
-        outputs += [ "${_resource_packaged_apk_path}_${_language}" ]
-      }
-    }
-    if (defined(invoker.extensions_to_not_compress)) {
-      args += [
-        "--no-compress",
-        invoker.extensions_to_not_compress,
-      ]
-    }
-  }
-
-  package_target = "${target_name}__package"
-  action(package_target) {
-    script = "//build/android/gyp/ant.py"
-    _ant_script = "//build/android/ant/apk-package.xml"
-
-    deps = [
-      ":${_package_resources_target_name}",
-    ]
-    if (defined(invoker.deps)) {
-      deps += invoker.deps
-    }
-    depfile = "$target_gen_dir/$target_name.d"
-
-    inputs = [
-      _resource_packaged_apk_path,
-      _ant_script,
-    ]
-    if (defined(_dex_path)) {
-      inputs += [ _dex_path ]
-    }
-
-    outputs = [
-      depfile,
-      _packaged_apk_path,
-    ]
-
-    _rebased_emma_jar = ""
-    _rebased_resource_packaged_apk_path =
-        rebase_path(_resource_packaged_apk_path, root_build_dir)
-    _rebased_packaged_apk_path = rebase_path(_packaged_apk_path, root_build_dir)
-    _rebased_native_libs_dir = rebase_path(_native_libs_dir, root_build_dir)
-    args = [
-      "--depfile",
-      rebase_path(depfile, root_build_dir),
-      "--",
-      "-quiet",
-      "-DANDROID_SDK_ROOT=$rebased_android_sdk_root",
-      "-DANDROID_SDK_TOOLS=$rebased_android_sdk_build_tools",
-      "-DRESOURCE_PACKAGED_APK_NAME=$_rebased_resource_packaged_apk_path",
-      "-DCONFIGURATION_NAME=$_configuration_name",
-      "-DNATIVE_LIBS_DIR=$_rebased_native_libs_dir",
-      "-DOUT_DIR=",
-      "-DUNSIGNED_APK_PATH=$_rebased_packaged_apk_path",
-      "-DEMMA_INSTRUMENT=0",
-      "-DEMMA_DEVICE_JAR=$_rebased_emma_jar",
-      "-Dbasedir=.",
-      "-buildfile",
-      rebase_path(_ant_script, root_build_dir),
-    ]
-    if (defined(_dex_path)) {
-      _rebased_dex_path = rebase_path(_dex_path, root_build_dir)
-      args += [
-        "-DDEX_FILE_PATH=$_rebased_dex_path",
-        "-DHAS_CODE=true",
-      ]
-    } else {
-      args += [ "-DHAS_CODE=false" ]
-    }
-  }
-
-  _finalize_apk_rule_name = "${target_name}__finalize"
-  finalize_apk(_finalize_apk_rule_name) {
-    input_apk_path = _packaged_apk_path
-    output_apk_path = _final_apk_path
-    keystore_path = _keystore_path
-    keystore_name = _keystore_name
-    keystore_password = _keystore_password
-    rezip_apk = _load_library_from_apk
-
-    public_deps = [
-      # Generator of the _packaged_apk_path this target takes as input.
-      ":$package_target",
-    ]
-  }
-
-  _final_deps = [ ":${_finalize_apk_rule_name}" ]
-
-  template("finalize_split") {
-    finalize_apk(target_name) {
-      _config = invoker.split_config
-      _type = invoker.split_type
-      input_apk_path = "${_resource_packaged_apk_path}_${_config}"
-      _output_paths = process_file_template(
-              [ _final_apk_path ],
-              "{{source_dir}}/{{source_name_part}}-${_type}-${_config}.apk")
-      output_apk_path = _output_paths[0]
-      keystore_path = _keystore_path
-      keystore_name = _keystore_name
-      keystore_password = _keystore_password
-      deps = [
-        ":${_package_resources_target_name}",
-      ]
-    }
-  }
-
-  foreach(_split, _split_densities) {
-    _split_rule = "${target_name}__finalize_${_split}_split"
-    finalize_split(_split_rule) {
-      split_type = "density"
-      split_config = _split
-    }
-    _final_deps += [ ":$_split_rule" ]
-  }
-  foreach(_split, _split_languages) {
-    _split_rule = "${target_name}__finalize_${_split}_split"
-    finalize_split(_split_rule) {
-      split_type = "lang"
-      split_config = _split
-    }
-    _final_deps += [ ":$_split_rule" ]
-  }
-
-  group(target_name) {
-    public_deps = _final_deps
-  }
-}
-
-template("java_prebuilt_impl") {
-  set_sources_assignment_filter([])
-  if (defined(invoker.testonly)) {
-    testonly = invoker.testonly
-  }
-  _supports_android =
-      defined(invoker.supports_android) && invoker.supports_android
-
-  assert(defined(invoker.jar_path))
-  _base_path = "${target_gen_dir}/$target_name"
-  _jar_path = _base_path + ".jar"
-  _build_config = _base_path + ".build_config"
-
-  if (_supports_android) {
-    _dex_path = _base_path + ".dex.jar"
-  }
-  _deps = []
-  if (defined(invoker.deps)) {
-    _deps = invoker.deps
-  }
-  _jar_deps = []
-  if (defined(invoker.jar_dep)) {
-    _jar_deps = [ invoker.jar_dep ]
-  }
-
-  _template_name = target_name
-
-  build_config_target_name = "${_template_name}__build_config"
-  process_jar_target_name = "${_template_name}__process_jar"
-  if (_supports_android) {
-    dex_target_name = "${_template_name}__dex"
-  }
-
-  write_build_config(build_config_target_name) {
-    type = "java_library"
-    supports_android = _supports_android
-    requires_android =
-        defined(invoker.requires_android) && invoker.requires_android
-
-    deps = _deps
-    build_config = _build_config
-    jar_path = _jar_path
-    if (_supports_android) {
-      dex_path = _dex_path
-    }
-  }
-
-  process_java_prebuilt(process_jar_target_name) {
-    visibility = [ ":$_template_name" ]
-    if (_supports_android) {
-      visibility += [ ":$dex_target_name" ]
-    }
-
-    if (defined(invoker.proguard_preprocess) && invoker.proguard_preprocess) {
-      proguard_preprocess = true
-      proguard_config = invoker.proguard_config
-    }
-
-    build_config = _build_config
-    input_jar_path = invoker.jar_path
-    output_jar_path = _jar_path
-
-    deps = [ ":$build_config_target_name" ] + _deps + _jar_deps
-  }
-
-  if (_supports_android) {
-    dex(dex_target_name) {
-      sources = [
-        _jar_path,
-      ]
-      output = _dex_path
-      deps = [ ":$process_jar_target_name" ] + _deps + _jar_deps
-    }
-  }
-
-  group(target_name) {
-    deps = [
-      ":$process_jar_target_name",
-    ]
-    if (defined(invoker.data_deps)) {
-      data_deps = invoker.data_deps
-    }
-    if (_supports_android) {
-      deps += [ ":$dex_target_name" ]
-    }
-  }
-}
-
-# Compiles and jars a set of java files.
-#
-# Outputs:
-#  $jar_path.jar
-#  $jar_path.jar.TOC
-#
-# Variables
-#   java_files: List of .java files to compile.
-#   java_deps: List of java dependencies. These should all have a .jar output
-#     at "${target_gen_dir}/${target_name}.jar.
-#   chromium_code: If true, enable extra warnings.
-#   srcjar_deps: List of srcjar dependencies. The .java files contained in the
-#     dependencies srcjar outputs will be compiled and added to the output jar.
-#   jar_path: Use this to explicitly set the output jar path. Defaults to
-#     "${target_gen_dir}/${target_name}.jar.
-template("compile_java") {
-  set_sources_assignment_filter([])
-  if (defined(invoker.testonly)) {
-    testonly = invoker.testonly
-  }
-
-  assert(defined(invoker.java_files))
-  assert(defined(invoker.build_config))
-  assert(defined(invoker.jar_path))
-
-  _java_files = invoker.java_files
-  _final_jar_path = invoker.jar_path
-  _intermediate_jar_path = "$target_gen_dir/$target_name.initial.jar"
-
-  _build_config = invoker.build_config
-
-  _jar_excluded_patterns = []
-  if (defined(invoker.jar_excluded_patterns)) {
-    _jar_excluded_patterns += invoker.jar_excluded_patterns
-  }
-
-  _chromium_code = false
-  if (defined(invoker.chromium_code)) {
-    _chromium_code = invoker.chromium_code
-  }
-
-  _supports_android = true
-  if (defined(invoker.supports_android)) {
-    _supports_android = invoker.supports_android
-  }
-
-  _enable_errorprone = use_errorprone_java_compiler
-  if (defined(invoker.enable_errorprone)) {
-    _enable_errorprone = invoker.enable_errorprone
-  }
-
-  _manifest_entries = []
-  if (defined(invoker.manifest_entries)) {
-    _manifest_entries = invoker.manifest_entries
-  }
-
-  _srcjar_deps = []
-  if (defined(invoker.srcjar_deps)) {
-    _srcjar_deps += invoker.srcjar_deps
-  }
-
-  _java_srcjars = []
-  if (defined(invoker.srcjars)) {
-    _java_srcjars = invoker.srcjars
-  }
-  foreach(dep, _srcjar_deps) {
-    _dep_gen_dir = get_label_info(dep, "target_gen_dir")
-    _dep_name = get_label_info(dep, "name")
-    _java_srcjars += [ "$_dep_gen_dir/$_dep_name.srcjar" ]
-  }
-
-  # Mark srcjar_deps as used.
-  assert(_srcjar_deps == [] || true)
-
-  _system_jars = []
-  if (defined(invoker.android) && invoker.android) {
-    _system_jars += [ android_sdk_jar ]
-  }
-
-  _rebased_build_config = rebase_path(_build_config, root_build_dir)
-  _rebased_jar_path = rebase_path(_intermediate_jar_path, root_build_dir)
-
-  javac_target_name = "${target_name}__javac"
-  finish_target_name = "${target_name}__finish"
-  final_target_name = target_name
-
-  action(javac_target_name) {
-    script = "//build/android/gyp/javac.py"
-    depfile = "$target_gen_dir/$target_name.d"
-    deps = _srcjar_deps
-    if (defined(invoker.deps)) {
-      deps += invoker.deps
-    }
-
-    outputs = [
-      depfile,
-      _intermediate_jar_path,
-      _intermediate_jar_path + ".md5.stamp",
-    ]
-    sources = _java_files + _java_srcjars
-    inputs = _system_jars + [ _build_config ]
-
-    _rebased_system_jars = rebase_path(_system_jars, root_build_dir)
-    _rebased_java_srcjars = rebase_path(_java_srcjars, root_build_dir)
-    _rebased_depfile = rebase_path(depfile, root_build_dir)
-    args = [
-      "--depfile=$_rebased_depfile",
-      "--classpath=$_rebased_system_jars",
-      "--classpath=@FileArg($_rebased_build_config:javac:classpath)",
-      "--jar-path=$_rebased_jar_path",
-      "--java-srcjars=$_rebased_java_srcjars",
-      "--java-srcjars=@FileArg($_rebased_build_config:javac:srcjars)",
-      "--jar-excluded-classes=$_jar_excluded_patterns",
-    ]
-    if (_supports_android) {
-      _rebased_android_sdk_jar = rebase_path(android_sdk_jar, root_build_dir)
-      args += [ "--bootclasspath=$_rebased_android_sdk_jar" ]
-    }
-    foreach(e, _manifest_entries) {
-      args += [ "--manifest-entry=" + e ]
-    }
-    if (_chromium_code) {
-      args += [ "--chromium-code=1" ]
-    }
-    if (_enable_errorprone) {
-      deps += [ "//third_party/errorprone:chromium_errorprone" ]
-      args += [
-        "--use-errorprone-path",
-        "bin/chromium_errorprone",
-      ]
-    }
-    args += rebase_path(_java_files, root_build_dir)
-  }
-
-  process_java_prebuilt(finish_target_name) {
-    visibility = [ ":$final_target_name" ]
-
-    build_config = _build_config
-    input_jar_path = _intermediate_jar_path
-    output_jar_path = _final_jar_path
-    if (defined(invoker.proguard_preprocess) && invoker.proguard_preprocess) {
-      proguard_preprocess = invoker.proguard_preprocess
-      proguard_config = invoker.proguard_config
-    }
-    deps = [
-      ":$javac_target_name",
-    ]
-  }
-
-  group(final_target_name) {
-    if (defined(invoker.visibility)) {
-      visibility = invoker.visibility
-    }
-    public_deps = [
-      ":$finish_target_name",
-    ]
-  }
-}
-
-template("java_library_impl") {
-  set_sources_assignment_filter([])
-  if (defined(invoker.testonly)) {
-    testonly = invoker.testonly
-  }
-
-  assert(
-      defined(invoker.java_files) || defined(invoker.DEPRECATED_java_in_dir) ||
-      defined(invoker.srcjars) || defined(invoker.srcjar_deps))
-  _base_path = "$target_gen_dir/$target_name"
-  _jar_path = _base_path + ".jar"
-  if (defined(invoker.jar_path)) {
-    _jar_path = invoker.jar_path
-  }
-  _template_name = target_name
-
-  _final_deps = []
-  _final_datadeps = []
-  if (defined(invoker.datadeps)) {
-    _final_datadeps = invoker.datadeps
-  }
-
-  _supports_android =
-      defined(invoker.supports_android) && invoker.supports_android
-  _requires_android =
-      defined(invoker.requires_android) && invoker.requires_android
-
-  if (_supports_android) {
-    _dex_path = _base_path + ".dex.jar"
-    if (defined(invoker.dex_path)) {
-      _dex_path = invoker.dex_path
-    }
-  }
-
-  # Define build_config_deps which will be a list of targets required to
-  # build the _build_config.
-  if (defined(invoker.override_build_config)) {
-    _build_config = invoker.override_build_config
-
-    # When a custom build config file is specified, we need to use the deps
-    # supplied by the invoker any time we reference the build config file.
-    assert(defined(invoker.deps),
-           "If you specify a build config file for " +
-               "java_library_impl($target_name), you should " +
-               "also specify the target that made it in the deps")
-    build_config_deps = invoker.deps
-  } else {
-    _build_config = _base_path + ".build_config"
-    build_config_target_name = "${_template_name}__build_config"
-    build_config_deps = [ ":$build_config_target_name" ]
-
-    write_build_config(build_config_target_name) {
-      type = "java_library"
-      supports_android = _supports_android
-      requires_android = _requires_android
-      bypass_platform_checks = defined(invoker.bypass_platform_checks) &&
-                               invoker.bypass_platform_checks
-
-      deps = []
-      if (defined(invoker.deps)) {
-        deps += invoker.deps
-      }
-
-      build_config = _build_config
-      jar_path = _jar_path
-      if (_supports_android) {
-        dex_path = _dex_path
-      }
-    }
-  }
-
-  _chromium_code = true
-  if (defined(invoker.chromium_code)) {
-    _chromium_code = invoker.chromium_code
-  }
-
-  _srcjar_deps = []
-  if (defined(invoker.srcjar_deps)) {
-    _srcjar_deps = invoker.srcjar_deps
-  }
-
-  _srcjars = []
-  if (defined(invoker.srcjars)) {
-    _srcjars = invoker.srcjars
-  }
-
-  _java_files = []
-  if (defined(invoker.java_files)) {
-    _java_files = invoker.java_files
-  } else if (defined(invoker.DEPRECATED_java_in_dir)) {
-    _src_dir = invoker.DEPRECATED_java_in_dir + "/src"
-    _src_dir_exists = exec_script("//build/dir_exists.py",
-                                  [ rebase_path(_src_dir, root_build_dir) ],
-                                  "string")
-    assert(_src_dir_exists == "False",
-           "In GN, java_in_dir should be the fully specified java directory " +
-               "(i.e. including the trailing \"/src\")")
-
-    _java_files_build_rel = exec_script(
-            "//build/android/gyp/find.py",
-            [
-              "--pattern",
-              "*.java",
-              rebase_path(invoker.DEPRECATED_java_in_dir, root_build_dir),
-            ],
-            "list lines")
-    _java_files = rebase_path(_java_files_build_rel, ".", root_build_dir)
-  }
-  assert(_java_files != [] || _srcjar_deps != [] || _srcjars != [])
-
-  _compile_java_target = "${_template_name}__compile_java"
-  _final_deps += [ ":$_compile_java_target" ]
-  compile_java(_compile_java_target) {
-    jar_path = _jar_path
-    build_config = _build_config
-    java_files = _java_files
-    srcjar_deps = _srcjar_deps
-    srcjars = _srcjars
-    chromium_code = _chromium_code
-    android = _requires_android
-
-    if (defined(invoker.enable_errorprone)) {
-      enable_errorprone = invoker.enable_errorprone
-    }
-    if (defined(invoker.jar_excluded_patterns)) {
-      jar_excluded_patterns = invoker.jar_excluded_patterns
-    }
-    if (defined(invoker.proguard_preprocess)) {
-      proguard_preprocess = invoker.proguard_preprocess
-    }
-    if (defined(invoker.proguard_config)) {
-      proguard_config = invoker.proguard_config
-    }
-    if (defined(invoker.dist_jar_path)) {
-      dist_jar_path = invoker.dist_jar_path
-    }
-    if (defined(invoker.manifest_entries)) {
-      manifest_entries = invoker.manifest_entries
-    }
-
-    supports_android = _supports_android
-    deps = build_config_deps
-  }
-
-  if (defined(invoker.main_class)) {
-    _final_deps += [ ":${_template_name}__binary_script" ]
-    action("${_template_name}__binary_script") {
-      script = "//build/android/gyp/create_java_binary_script.py"
-      depfile = "$target_gen_dir/$target_name.d"
-      java_script = "$root_build_dir/bin/$_template_name"
-      inputs = [
-        _build_config,
-      ]
-      outputs = [
-        depfile,
-        java_script,
-      ]
-      _rebased_build_config = rebase_path(_build_config, root_build_dir)
-      args = [
-        "--depfile",
-        rebase_path(depfile, root_build_dir),
-        "--output",
-        rebase_path(java_script, root_build_dir),
-        "--classpath=@FileArg($_rebased_build_config:java:full_classpath)",
-        "--jar-path",
-        rebase_path(_jar_path, root_build_dir),
-        "--main-class",
-        invoker.main_class,
-      ]
-
-      deps = build_config_deps
-    }
-  }
-
-  if (_supports_android) {
-    if (defined(invoker.chromium_code) && invoker.chromium_code) {
-      _android_manifest = "//build/android/AndroidManifest.xml"
-      if (defined(invoker.android_manifest)) {
-        _android_manifest = invoker.android_manifest
-      }
-
-      _final_datadeps += [ ":${_template_name}__lint" ]
-      android_lint("${_template_name}__lint") {
-        android_manifest = _android_manifest
-        jar_path = _jar_path
-        java_files = _java_files
-        deps = [
-          ":$_compile_java_target",
-        ]
-        if (defined(invoker.deps)) {
-          deps += invoker.deps
-        }
-      }
-
-      if (run_findbugs) {
-        _final_datadeps += [ ":${_template_name}__findbugs" ]
-        findbugs("${_template_name}__findbugs") {
-          build_config = _build_config
-          jar_path = _jar_path
-          deps = build_config_deps
-        }
-      }
-    }
-
-    _final_deps += [ ":${_template_name}__dex" ]
-    dex("${_template_name}__dex") {
-      sources = [
-        _jar_path,
-      ]
-      output = _dex_path
-      deps = [
-        ":$_compile_java_target",
-      ]
-    }
-  }
-
-  group(target_name) {
-    if (defined(invoker.visibility)) {
-      visibility = invoker.visibility
-    }
-    public_deps = _final_deps
-    data_deps = _final_datadeps
-  }
-}
-
-# Runs process_resources.py
-template("process_resources") {
-  set_sources_assignment_filter([])
-  if (defined(invoker.testonly)) {
-    testonly = invoker.testonly
-  }
-
-  zip_path = invoker.zip_path
-  srcjar_path = invoker.srcjar_path
-  r_text_path = invoker.r_text_path
-  build_config = invoker.build_config
-  resource_dirs = invoker.resource_dirs
-  android_manifest = invoker.android_manifest
-
-  non_constant_id = true
-  if (defined(invoker.generate_constant_ids) && invoker.generate_constant_ids) {
-    non_constant_id = false
-  }
-
-  action(target_name) {
-    if (defined(invoker.visibility)) {
-      visibility = invoker.visibility
-    }
-
-    script = "//build/android/gyp/process_resources.py"
-
-    depfile = "$target_gen_dir/$target_name.d"
-    outputs = [
-      depfile,
-      zip_path,
-      srcjar_path,
-      r_text_path,
-    ]
-
-    sources_build_rel = exec_script("//build/android/gyp/find.py",
-                                    rebase_path(resource_dirs, root_build_dir),
-                                    "list lines")
-    sources = rebase_path(sources_build_rel, ".", root_build_dir)
-
-    inputs = [
-      build_config,
-      android_manifest,
-    ]
-
-    rebase_resource_dirs = rebase_path(resource_dirs, root_build_dir)
-    rebase_build_config = rebase_path(build_config, root_build_dir)
-    args = [
-      "--depfile",
-      rebase_path(depfile, root_build_dir),
-      "--android-sdk",
-      rebase_path(android_sdk, root_build_dir),
-      "--aapt-path",
-      android_aapt_path,
-      "--android-manifest",
-      rebase_path(android_manifest, root_build_dir),
-      "--resource-dirs=$rebase_resource_dirs",
-      "--srcjar-out",
-      rebase_path(srcjar_path, root_build_dir),
-      "--resource-zip-out",
-      rebase_path(zip_path, root_build_dir),
-      "--r-text-out",
-      rebase_path(r_text_path, root_build_dir),
-      "--dependencies-res-zips=@FileArg($rebase_build_config:resources:dependency_zips)",
-      "--extra-res-packages=@FileArg($rebase_build_config:resources:extra_package_names)",
-      "--extra-r-text-files=@FileArg($rebase_build_config:resources:extra_r_text_files)",
-    ]
-
-    if (non_constant_id) {
-      args += [ "--non-constant-id" ]
-    }
-
-    if (defined(invoker.custom_package)) {
-      args += [
-        "--custom-package",
-        invoker.custom_package,
-      ]
-    }
-
-    if (defined(invoker.v14_skip) && invoker.v14_skip) {
-      args += [ "--v14-skip" ]
-    }
-
-    if (defined(invoker.shared_resources) && invoker.shared_resources) {
-      args += [ "--shared-resources" ]
-    }
-
-    if (defined(invoker.include_all_resources) &&
-        invoker.include_all_resources) {
-      args += [ "--include-all-resources" ]
-    }
-
-    if (defined(invoker.all_resources_zip_path)) {
-      all_resources_zip = invoker.all_resources_zip_path
-      outputs += [ all_resources_zip ]
-      args += [
-        "--all-resources-zip-out",
-        rebase_path(all_resources_zip, root_build_dir),
-      ]
-    }
-
-    if (defined(invoker.args)) {
-      args += invoker.args
-    }
-    if (defined(invoker.deps)) {
-      deps = invoker.deps
-    }
-  }
-}
-
-template("copy_ex") {
-  set_sources_assignment_filter([])
-  if (defined(invoker.testonly)) {
-    testonly = invoker.testonly
-  }
-
-  action(target_name) {
-    if (defined(invoker.visibility)) {
-      visibility = invoker.visibility
-    }
-
-    script = "//build/android/gyp/copy_ex.py"
-
-    if (defined(invoker.deps)) {
-      deps = invoker.deps
-    }
-
-    sources = []
-    if (defined(invoker.sources)) {
-      sources += invoker.sources
-    }
-
-    inputs = []
-    if (defined(invoker.inputs)) {
-      inputs += invoker.inputs
-    }
-
-    depfile = "$target_gen_dir/$target_name.d"
-    outputs = [
-      depfile,
-    ]
-
-    args = [
-      "--depfile",
-      rebase_path(depfile, root_build_dir),
-      "--dest",
-      rebase_path(invoker.dest, root_build_dir),
-    ]
-    rebased_sources = rebase_path(sources, root_build_dir)
-    args += [ "--files=$rebased_sources" ]
-
-    if (defined(invoker.clear_dir) && invoker.clear_dir) {
-      args += [ "--clear" ]
-    }
-
-    if (defined(invoker.args)) {
-      args += invoker.args
-    }
-  }
-}
-
-# Produces a single .dex.jar out of a set of Java dependencies.
-template("deps_dex") {
-  set_sources_assignment_filter([])
-  build_config = "$target_gen_dir/${target_name}.build_config"
-  build_config_target_name = "${target_name}__build_config"
-
-  write_build_config(build_config_target_name) {
-    type = "deps_dex"
-    deps = invoker.deps
-
-    build_config = build_config
-    dex_path = invoker.dex_path
-  }
-
-  rebased_build_config = rebase_path(build_config, root_build_dir)
-  dex(target_name) {
-    inputs = [
-      build_config,
-    ]
-    output = invoker.dex_path
-    dex_arg_key = "${rebased_build_config}:final_dex:dependency_dex_files"
-    args = [ "--inputs=@FileArg($dex_arg_key)" ]
-    if (defined(invoker.excluded_jars)) {
-      excluded_jars = rebase_path(invoker.excluded_jars, root_build_dir)
-      args += [ "--excluded-paths=${excluded_jars}" ]
-    }
-    deps = [
-      ":$build_config_target_name",
-    ]
-  }
-}
-
-# Creates an AndroidManifest.xml for an APK split.
-template("generate_split_manifest") {
-  assert(defined(invoker.main_manifest))
-  assert(defined(invoker.out_manifest))
-  assert(defined(invoker.split_name))
-
-  action(target_name) {
-    depfile = "$target_gen_dir/$target_name.d"
-    if (defined(invoker.deps)) {
-      deps = invoker.deps
-    }
-    args = [
-      "--main-manifest",
-      rebase_path(invoker.main_manifest, root_build_dir),
-      "--out-manifest",
-      rebase_path(invoker.out_manifest, root_build_dir),
-      "--split",
-      invoker.split_name,
-    ]
-    if (defined(invoker.version_code)) {
-      args += [
-        "--version-code",
-        invoker.version_code,
-      ]
-    }
-    if (defined(invoker.version_name)) {
-      args += [
-        "--version-name",
-        invoker.version_name,
-      ]
-    }
-    if (defined(invoker.has_code)) {
-      args += [
-        "--has-code",
-        invoker.has_code,
-      ]
-    }
-    args += [
-      "--depfile",
-      rebase_path(depfile, root_build_dir),
-    ]
-
-    script = "//build/android/gyp/generate_split_manifest.py"
-    outputs = [
-      depfile,
-      invoker.out_manifest,
-    ]
-    inputs = [
-      invoker.main_manifest,
-    ]
-  }
-}
-
-# Generates a script in the output bin directory which runs the test
-# target using the test runner script in build/android/test_runner.py.
-template("test_runner_script") {
-  testonly = true
-  _test_name = invoker.test_name
-  _test_type = invoker.test_type
-
-  action(target_name) {
-    script = "//build/android/gyp/create_test_runner_script.py"
-    depfile = "$target_gen_dir/$target_name.d"
-
-    test_runner_args = [
-      _test_type,
-      "--output-directory",
-      rebase_path(root_build_dir, root_build_dir),
-    ]
-    if (_test_type == "gtest") {
-      assert(defined(invoker.test_suite))
-      test_runner_args += [
-        "--suite",
-        invoker.test_suite,
-      ]
-    } else if (_test_type == "instrumentation") {
-      assert(defined(invoker.test_apk))
-      test_runner_args += [
-        "--test-apk",
-        invoker.test_apk,
-      ]
-      if (defined(invoker.support_apk_path)) {
-        test_runner_args += [
-          "--support-apk",
-          rebase_path(invoker.support_apk_path, root_build_dir),
-        ]
-      }
-    } else {
-      assert(false, "Invalid test type: $_test_type.")
-    }
-
-    if (defined(invoker.isolate_file)) {
-      test_runner_args += [
-        "--isolate-file-path",
-        rebase_path(invoker.isolate_file, root_build_dir),
-      ]
-    }
-
-    generated_script = "$root_build_dir/bin/run_${_test_name}"
-    outputs = [
-      depfile,
-      generated_script,
-    ]
-    args = [
-      "--depfile",
-      rebase_path(depfile, root_build_dir),
-      "--script-output-path",
-      rebase_path(generated_script, root_build_dir),
-    ]
-    args += test_runner_args
-  }
-}
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni
deleted file mode 100644
index 3c8640b..0000000
--- a/build/config/android/rules.gni
+++ /dev/null
@@ -1,2238 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import("//base/android/linker/config.gni")
-import("//build/config/android/config.gni")
-import("//build/config/android/internal_rules.gni")
-import("//third_party/android_platform/config.gni")
-import("//tools/grit/grit_rule.gni")
-
-assert(is_android)
-
-# Declare a jni target
-#
-# This target generates the native jni bindings for a set of .java files.
-#
-# See base/android/jni_generator/jni_generator.py for more info about the
-# format of generating JNI bindings.
-#
-# Variables
-#   sources: list of .java files to generate jni for
-#   jni_package: subdirectory path for generated bindings
-#
-# Example
-#   generate_jni("foo_jni") {
-#     sources = [
-#       "android/java/src/org/chromium/foo/Foo.java",
-#       "android/java/src/org/chromium/foo/FooUtil.java",
-#     ]
-#     jni_package = "foo"
-#   }
-template("generate_jni") {
-  set_sources_assignment_filter([])
-  if (defined(invoker.testonly)) {
-    testonly = invoker.testonly
-  }
-
-  assert(defined(invoker.sources))
-  assert(defined(invoker.jni_package))
-  jni_package = invoker.jni_package
-  base_output_dir = "${target_gen_dir}/${target_name}"
-  package_output_dir = "${base_output_dir}/${jni_package}"
-  jni_output_dir = "${package_output_dir}/jni"
-
-  jni_generator_include = "//base/android/jni_generator/jni_generator_helper.h"
-
-  foreach_target_name = "${target_name}__jni_gen"
-  action_foreach(foreach_target_name) {
-    script = "//base/android/jni_generator/jni_generator.py"
-    depfile = "$target_gen_dir/$target_name.{{source_name_part}}.d"
-    sources = invoker.sources
-    outputs = [
-      depfile,
-      "${jni_output_dir}/{{source_name_part}}_jni.h",
-    ]
-
-    args = [
-      "--depfile",
-      rebase_path(depfile, root_build_dir),
-      "--input_file={{source}}",
-      "--optimize_generation=1",
-      "--ptr_type=long",
-      "--output_dir",
-      rebase_path(jni_output_dir, root_build_dir),
-      "--includes",
-      rebase_path(jni_generator_include, jni_output_dir),
-      "--native_exports_optional",
-    ]
-    if (defined(invoker.jni_generator_jarjar_file)) {
-      args += [
-        "--jarjar",
-        rebase_path(jni_generator_jarjar_file, root_build_dir),
-      ]
-    }
-  }
-
-  config("jni_includes_${target_name}") {
-    # TODO(cjhopman): #includes should probably all be relative to
-    # base_output_dir. Remove that from this config once the includes are
-    # updated.
-    include_dirs = [
-      base_output_dir,
-      package_output_dir,
-    ]
-  }
-
-  group(target_name) {
-    deps = [
-      ":$foreach_target_name",
-    ]
-    public_configs = [ ":jni_includes_${target_name}" ]
-
-    if (defined(invoker.deps)) {
-      deps += invoker.deps
-    }
-    if (defined(invoker.public_deps)) {
-      public_deps = invoker.public_deps
-    }
-
-    if (defined(invoker.visibility)) {
-      visibility = invoker.visibility
-    }
-  }
-}
-
-# Declare a jni target for a prebuilt jar
-#
-# This target generates the native jni bindings for a set of classes in a .jar.
-#
-# See base/android/jni_generator/jni_generator.py for more info about the
-# format of generating JNI bindings.
-#
-# Variables
-#   classes: list of .class files in the jar to generate jni for. These should
-#     include the full path to the .class file.
-#   jni_package: subdirectory path for generated bindings
-#   jar_file: the path to the .jar. If not provided, will default to the sdk's
-#     android.jar
-#
-#   deps, public_deps: As normal
-#
-# Example
-#   generate_jar_jni("foo_jni") {
-#     classes = [
-#       "android/view/Foo.class",
-#     ]
-#     jni_package = "foo"
-#   }
-template("generate_jar_jni") {
-  set_sources_assignment_filter([])
-  if (defined(invoker.testonly)) {
-    testonly = invoker.testonly
-  }
-
-  assert(defined(invoker.classes))
-  assert(defined(invoker.jni_package))
-
-  if (defined(invoker.jar_file)) {
-    jar_file = invoker.jar_file
-  } else {
-    jar_file = android_sdk_jar
-  }
-
-  jni_package = invoker.jni_package
-  base_output_dir = "${root_gen_dir}/${target_name}/${jni_package}"
-  jni_output_dir = "${base_output_dir}/jni"
-
-  jni_generator_include = "//base/android/jni_generator/jni_generator_helper.h"
-
-  # TODO(cjhopman): make jni_generator.py support generating jni for multiple
-  # .class files from a .jar.
-  jni_actions = []
-  foreach(class, invoker.classes) {
-    _classname_list = []
-    _classname_list = process_file_template([ class ], "{{source_name_part}}")
-    classname = _classname_list[0]
-    jni_target_name = "${target_name}__jni_${classname}"
-    jni_actions += [ ":$jni_target_name" ]
-    action(jni_target_name) {
-      # The sources aren't compiled so don't check their dependencies.
-      check_includes = false
-      depfile = "$target_gen_dir/$target_name.d"
-      script = "//base/android/jni_generator/jni_generator.py"
-      sources = [
-        jar_file,
-      ]
-      outputs = [
-        depfile,
-        "${jni_output_dir}/${classname}_jni.h",
-      ]
-
-      args = [
-        "--depfile",
-        rebase_path(depfile, root_build_dir),
-        "--jar_file",
-        rebase_path(jar_file, root_build_dir),
-        "--input_file",
-        class,
-        "--optimize_generation=1",
-        "--ptr_type=long",
-        "--output_dir",
-        rebase_path(jni_output_dir, root_build_dir),
-        "--includes",
-        rebase_path(jni_generator_include, jni_output_dir),
-        "--native_exports_optional",
-      ]
-    }
-  }
-
-  config("jni_includes_${target_name}") {
-    include_dirs = [ base_output_dir ]
-  }
-
-  group(target_name) {
-    deps = jni_actions
-    if (defined(invoker.deps)) {
-      deps += invoker.deps
-    }
-    if (defined(invoker.public_deps)) {
-      public_deps = invoker.public_deps
-    }
-    public_configs = [ ":jni_includes_${target_name}" ]
-  }
-}
-
-# Declare a target for c-preprocessor-generated java files
-#
-# NOTE: For generating Java conterparts to enums prefer using the java_cpp_enum
-#       rule instead.
-#
-# This target generates java files using the host C pre-processor. Each file in
-# sources will be compiled using the C pre-processor. If include_path is
-# specified, it will be passed (with --I) to the pre-processor.
-#
-# This target will create a single .srcjar. Adding this target to an
-# android_library target's srcjar_deps will make the generated java files be
-# included in that library's final outputs.
-#
-# Variables
-#   sources: list of files to be processed by the C pre-processor. For each
-#     file in sources, there will be one .java file in the final .srcjar. For a
-#     file named FooBar.template, a java file will be created with name
-#     FooBar.java.
-#   inputs: additional compile-time dependencies. Any files
-#     `#include`-ed in the templates should be listed here.
-#   package_name: this will be the subdirectory for each .java file in the
-#     .srcjar.
-#
-# Example
-#   java_cpp_template("foo_generated_enum") {
-#     sources = [
-#       "android/java/templates/Foo.template",
-#     ]
-#     inputs = [
-#       "android/java/templates/native_foo_header.h",
-#     ]
-#
-#     package_name = "org/chromium/base/library_loader"
-#     include_path = "android/java/templates"
-#   }
-template("java_cpp_template") {
-  set_sources_assignment_filter([])
-  if (defined(invoker.testonly)) {
-    testonly = invoker.testonly
-  }
-
-  assert(defined(invoker.sources))
-  package_name = invoker.package_name + ""
-
-  if (defined(invoker.include_path)) {
-    include_path = invoker.include_path + ""
-  } else {
-    include_path = "//"
-  }
-
-  apply_gcc_target_name = "${target_name}__apply_gcc"
-  zip_srcjar_target_name = "${target_name}__zip_srcjar"
-  final_target_name = target_name
-
-  action_foreach(apply_gcc_target_name) {
-    visibility = [ ":$zip_srcjar_target_name" ]
-    script = "//build/android/gyp/gcc_preprocess.py"
-    if (defined(invoker.inputs)) {
-      inputs = invoker.inputs + []
-    }
-    depfile = "${target_gen_dir}/${target_name}_{{source_name_part}}.d"
-
-    sources = invoker.sources
-
-    if (defined(invoker.deps)) {
-      deps = invoker.deps
-    }
-    if (defined(invoker.public_deps)) {
-      public_deps = invoker.public_deps
-    }
-    if (defined(invoker.data_deps)) {
-      data_deps = invoker.data_deps
-    }
-
-    gen_dir =
-        "${target_gen_dir}/${target_name}/java_cpp_template/${package_name}"
-    gcc_template_output_pattern = "${gen_dir}/{{source_name_part}}.java"
-
-    outputs = [
-      depfile,
-      gcc_template_output_pattern,
-    ]
-
-    args = [
-      "--depfile",
-      rebase_path(depfile, root_build_dir),
-      "--include-path",
-      rebase_path(include_path, root_build_dir),
-      "--output",
-      rebase_path(gen_dir, root_build_dir) + "/{{source_name_part}}.java",
-      "--template={{source}}",
-    ]
-
-    if (defined(invoker.defines)) {
-      foreach(def, invoker.defines) {
-        args += [
-          "--defines",
-          def,
-        ]
-      }
-    }
-  }
-
-  apply_gcc_outputs = get_target_outputs(":$apply_gcc_target_name")
-  base_gen_dir = get_label_info(":$apply_gcc_target_name", "target_gen_dir")
-
-  srcjar_path = "${target_gen_dir}/${target_name}.srcjar"
-  zip(zip_srcjar_target_name) {
-    visibility = [ ":$final_target_name" ]
-    inputs = apply_gcc_outputs
-    output = srcjar_path
-    base_dir = base_gen_dir
-    deps = [
-      ":$apply_gcc_target_name",
-    ]
-  }
-
-  group(final_target_name) {
-    if (defined(invoker.visibility)) {
-      visibility = invoker.visibility
-    }
-    deps = [
-      ":$zip_srcjar_target_name",
-    ]
-  }
-}
-
-# Declare a target for generating Java classes from C++ enums.
-#
-# This target generates Java files from C++ enums using a script.
-#
-# This target will create a single .srcjar. Adding this target to an
-# android_library target's srcjar_deps will make the generated java files be
-# included in that library's final outputs.
-#
-# Variables
-#   sources: list of files to be processed by the script. For each annotated
-#     enum contained in the sources files the script will generate a .java
-#     file with the same name as the name of the enum.
-#
-#   outputs: list of outputs, relative to the output_dir. These paths are
-#     verified at build time by the script. To get the list programatically run:
-#       python build/android/gyp/java_cpp_enum.py \
-#         --print_output_only . path/to/header/file.h
-#
-# Example
-#   java_cpp_enum("foo_generated_enum") {
-#     sources = [
-#       "src/native_foo_header.h",
-#     ]
-#     outputs = [
-#       "org/chromium/FooEnum.java",
-#     ]
-#   }
-template("java_cpp_enum") {
-  set_sources_assignment_filter([])
-  if (defined(invoker.testonly)) {
-    testonly = invoker.testonly
-  }
-
-  assert(defined(invoker.sources))
-  assert(defined(invoker.outputs))
-
-  generate_enum_target_name = "${target_name}__generate_enum"
-  zip_srcjar_target_name = "${target_name}__zip_srcjar"
-  final_target_name = target_name
-
-  action(generate_enum_target_name) {
-    visibility = [ ":$zip_srcjar_target_name" ]
-
-    # The sources aren't compiled so don't check their dependencies.
-    check_includes = false
-
-    sources = invoker.sources
-    script = "//build/android/gyp/java_cpp_enum.py"
-    gen_dir = "${target_gen_dir}/${target_name}/enums"
-    outputs =
-        get_path_info(rebase_path(invoker.outputs, ".", gen_dir), "abspath")
-
-    args = []
-    foreach(output, rebase_path(outputs, root_build_dir)) {
-      args += [
-        "--assert_file",
-        output,
-      ]
-    }
-    args += [ rebase_path(gen_dir, root_build_dir) ]
-    args += rebase_path(invoker.sources, root_build_dir)
-  }
-
-  generate_enum_outputs = get_target_outputs(":$generate_enum_target_name")
-  base_gen_dir = get_label_info(":$generate_enum_target_name", "target_gen_dir")
-
-  srcjar_path = "${target_gen_dir}/${target_name}.srcjar"
-  zip(zip_srcjar_target_name) {
-    visibility = [ ":$final_target_name" ]
-    inputs = generate_enum_outputs
-    output = srcjar_path
-    base_dir = base_gen_dir
-    deps = [
-      ":$generate_enum_target_name",
-    ]
-  }
-
-  group(final_target_name) {
-    if (defined(invoker.visibility)) {
-      visibility = invoker.visibility
-    }
-    deps = [
-      ":$zip_srcjar_target_name",
-    ]
-  }
-}
-
-# Declare a target for processing Android resources as Jinja templates.
-#
-# This takes an Android resource directory where each resource is a Jinja
-# template, processes each template, then packages the results in a zip file
-# which can be consumed by an android resources, library, or apk target.
-#
-# If this target is included in the deps of an android resources/library/apk,
-# the resources will be included with that target.
-#
-# Variables
-#   resources: The list of resources files to process.
-#   res_dir: The resource directory containing the resources.
-#   variables: (Optional) A list of variables to make available to the template
-#     processing environment, e.g. ["name=foo", "color=red"].
-#
-# Example
-#   jinja_template_resources("chrome_shell_template_resources") {
-#     res_dir = "shell/res_template"
-#     resources = ["shell/res_template/xml/syncable.xml"]
-#     variables = ["color=red"]
-#   }
-template("jinja_template_resources") {
-  set_sources_assignment_filter([])
-  if (defined(invoker.testonly)) {
-    testonly = invoker.testonly
-  }
-
-  assert(defined(invoker.resources))
-  assert(defined(invoker.res_dir))
-
-  _base_path = "$target_gen_dir/$target_name"
-  _resources_zip = _base_path + ".resources.zip"
-  _build_config = _base_path + ".build_config"
-
-  write_build_config("${target_name}__build_config") {
-    build_config = _build_config
-    resources_zip = _resources_zip
-    type = "android_resources"
-  }
-
-  action("${target_name}__template") {
-    sources = invoker.resources
-    script = "//build/android/gyp/jinja_template.py"
-    depfile = "$target_gen_dir/$target_name.d"
-
-    outputs = [
-      depfile,
-      _resources_zip,
-    ]
-
-    rebased_resources = rebase_path(invoker.resources, root_build_dir)
-    args = [
-      "--inputs=${rebased_resources}",
-      "--inputs-base-dir",
-      rebase_path(invoker.res_dir, root_build_dir),
-      "--outputs-zip",
-      rebase_path(_resources_zip, root_build_dir),
-      "--depfile",
-      rebase_path(depfile, root_build_dir),
-    ]
-    if (defined(invoker.variables)) {
-      variables = invoker.variables
-      args += [ "--variables=${variables}" ]
-    }
-  }
-
-  group(target_name) {
-    deps = [
-      ":${target_name}__build_config",
-      ":${target_name}__template",
-    ]
-  }
-}
-
-# Creates a resources.zip with locale.pak files placed into appropriate
-# resource configs (e.g. en-GB.pak -> res/raw-en/en_gb.pak). Also generates
-# a locale_paks TypedArray so that resource files can be enumerated at runtime.
-#
-# If this target is included in the deps of an android resources/library/apk,
-# the resources will be included with that target.
-#
-# Variables:
-#   sources: List of .pak files. Names must be of the form "en.pak" or
-#       "en-US.pak".
-#   deps: (optional) List of dependencies that might be needed to generate
-#       the .pak files.
-#
-# Example
-#   locale_pak_resources("locale_paks") {
-#     sources = [ "path/en-US.pak", "path/fr.pak", ... ]
-#   }
-template("locale_pak_resources") {
-  set_sources_assignment_filter([])
-  assert(defined(invoker.sources))
-
-  _base_path = "$target_gen_dir/$target_name"
-  _resources_zip = _base_path + ".resources.zip"
-  _build_config = _base_path + ".build_config"
-
-  write_build_config("${target_name}__build_config") {
-    build_config = _build_config
-    resources_zip = _resources_zip
-    type = "android_resources"
-  }
-
-  action("${target_name}__create_resources_zip") {
-    sources = invoker.sources
-    script = "//build/android/gyp/locale_pak_resources.py"
-    depfile = "$target_gen_dir/$target_name.d"
-
-    outputs = [
-      depfile,
-      _resources_zip,
-    ]
-
-    _rebased_sources = rebase_path(invoker.sources, root_build_dir)
-    args = [
-      "--locale-paks=${_rebased_sources}",
-      "--resources-zip",
-      rebase_path(_resources_zip, root_build_dir),
-      "--depfile",
-      rebase_path(depfile, root_build_dir),
-    ]
-
-    if (defined(invoker.deps)) {
-      deps = invoker.deps
-    }
-  }
-
-  group(target_name) {
-    deps = [
-      ":${target_name}__build_config",
-      ":${target_name}__create_resources_zip",
-    ]
-  }
-}
-
-# Declare an Android resources target
-#
-# This creates a resources zip file that will be used when building an Android
-# library or apk and included into a final apk.
-#
-# To include these resources in a library/apk, this target should be listed in
-# the library's deps. A library/apk will also include any resources used by its
-# own dependencies.
-#
-# Variables
-#   deps: Specifies the dependencies of this target. Any Android resources
-#     listed in deps will be included by libraries/apks that depend on this
-#     target.
-#   resource_dirs: List of directories containing resources for this target.
-#   android_manifest: AndroidManifest.xml for this target. Defaults to
-#     //build/android/AndroidManifest.xml.
-#   custom_package: java package for generated .java files.
-#   v14_skip: If true, don't run v14 resource generator on this. Defaults to
-#     false. (see build/android/gyp/generate_v14_compatible_resources.py)
-#
-#   shared_resources: If true make a resource package that can be loaded by a
-#     different application at runtime to access the package's resources.
-#
-
-# Example
-#   android_resources("foo_resources") {
-#     deps = [":foo_strings_grd"]
-#     resource_dirs = ["res"]
-#     custom_package = "org.chromium.foo"
-#   }
-template("android_resources") {
-  set_sources_assignment_filter([])
-  if (defined(invoker.testonly)) {
-    testonly = invoker.testonly
-  }
-
-  assert(defined(invoker.resource_dirs))
-  assert(defined(invoker.android_manifest) || defined(invoker.custom_package))
-
-  base_path = "$target_gen_dir/$target_name"
-  zip_path = base_path + ".resources.zip"
-  srcjar_path = base_path + ".srcjar"
-  r_text_path = base_path + "_R.txt"
-  build_config = base_path + ".build_config"
-
-  build_config_target_name = "${target_name}__build_config"
-  process_resources_target_name = "${target_name}__process_resources"
-  final_target_name = target_name
-
-  write_build_config(build_config_target_name) {
-    visibility = [ ":$process_resources_target_name" ]
-
-    type = "android_resources"
-    resources_zip = zip_path
-    srcjar = srcjar_path
-    r_text = r_text_path
-    if (defined(invoker.deps)) {
-      deps = invoker.deps
-    }
-    if (defined(invoker.android_manifest)) {
-      android_manifest = invoker.android_manifest
-    }
-    if (defined(invoker.custom_package)) {
-      custom_package = invoker.custom_package
-    }
-  }
-
-  android_manifest = "//build/android/AndroidManifest.xml"
-  if (defined(invoker.android_manifest)) {
-    android_manifest = invoker.android_manifest
-  }
-
-  process_resources(process_resources_target_name) {
-    visibility = [ ":$final_target_name" ]
-
-    resource_dirs = invoker.resource_dirs
-    if (defined(invoker.custom_package)) {
-      custom_package = invoker.custom_package
-    }
-
-    if (defined(invoker.v14_skip)) {
-      v14_skip = invoker.v14_skip
-    }
-
-    if (defined(invoker.shared_resources)) {
-      shared_resources = invoker.shared_resources
-    }
-
-    deps = [
-      ":$build_config_target_name",
-    ]
-    if (defined(invoker.deps)) {
-      # Invoker may have added deps that generate the input resources.
-      deps += invoker.deps
-    }
-  }
-
-  group(final_target_name) {
-    if (defined(invoker.visibility)) {
-      visibility = invoker.visibility
-    }
-    deps = [
-      ":${target_name}__process_resources",
-    ]
-  }
-}
-
-# Declare a target that generates localized strings.xml from a .grd file.
-#
-# If this target is included in the deps of an android resources/library/apk,
-# the strings.xml will be included with that target.
-#
-# Variables
-#   deps: Specifies the dependencies of this target.
-#   grd_file: Path to the .grd file to generate strings.xml from.
-#   outputs: Expected grit outputs (see grit rule).
-#
-# Example
-#  java_strings_grd("foo_strings_grd") {
-#    grd_file = "foo_strings.grd"
-#  }
-template("java_strings_grd") {
-  set_sources_assignment_filter([])
-  if (defined(invoker.testonly)) {
-    testonly = invoker.testonly
-  }
-
-  base_path = "$target_gen_dir/$target_name"
-  resources_zip = base_path + ".resources.zip"
-  build_config = base_path + ".build_config"
-
-  write_build_config("${target_name}__build_config") {
-    type = "android_resources"
-    if (defined(invoker.deps)) {
-      deps = invoker.deps
-    }
-  }
-
-  # Put grit files into this subdirectory of target_gen_dir.
-  extra_output_path = target_name + "_grit_output"
-
-  grit_target_name = "${target_name}__grit"
-  grit_output_dir = "$target_gen_dir/$extra_output_path"
-  grit(grit_target_name) {
-    grit_flags = [
-      "-E",
-      "ANDROID_JAVA_TAGGED_ONLY=false",
-    ]
-    output_dir = grit_output_dir
-    resource_ids = ""
-    source = invoker.grd_file
-    outputs = invoker.outputs
-  }
-
-  # This needs to get outputs from grit's internal target, not the final
-  # source_set.
-  generate_strings_outputs = get_target_outputs(":${grit_target_name}_grit")
-
-  zip("${target_name}__zip") {
-    base_dir = grit_output_dir
-    inputs = generate_strings_outputs
-    output = resources_zip
-    deps = [
-      ":$grit_target_name",
-    ]
-  }
-
-  group(target_name) {
-    deps = [
-      ":${target_name}__build_config",
-      ":${target_name}__zip",
-    ]
-  }
-}
-
-# Declare a target that packages strings.xml generated from a grd file.
-#
-# If this target is included in the deps of an android resources/library/apk,
-# the strings.xml will be included with that target.
-#
-# Variables
-#  grit_output_dir: directory containing grit-generated files.
-#  generated_files: list of android resource files to package.
-#
-# Example
-#  java_strings_grd_prebuilt("foo_strings_grd") {
-#    grit_output_dir = "$root_gen_dir/foo/grit"
-#    generated_files = [
-#      "values/strings.xml"
-#    ]
-#  }
-template("java_strings_grd_prebuilt") {
-  set_sources_assignment_filter([])
-  if (defined(invoker.testonly)) {
-    testonly = invoker.testonly
-  }
-
-  base_path = "$target_gen_dir/$target_name"
-  resources_zip = base_path + ".resources.zip"
-  build_config = base_path + ".build_config"
-
-  build_config_target_name = "${target_name}__build_config"
-  zip_target_name = "${target_name}__zip"
-  final_target_name = target_name
-
-  write_build_config(build_config_target_name) {
-    visibility = [ ":$zip_target_name" ]
-    type = "android_resources"
-  }
-
-  zip(zip_target_name) {
-    visibility = [ ":$final_target_name" ]
-
-    base_dir = invoker.grit_output_dir
-    inputs = rebase_path(invoker.generated_files, ".", base_dir)
-    output = resources_zip
-    deps = [
-      ":$build_config_target_name",
-    ]
-    if (defined(invoker.deps)) {
-      deps += invoker.deps
-    }
-  }
-
-  group(final_target_name) {
-    if (defined(invoker.visibility)) {
-      visibility = invoker.visibility
-    }
-    deps = [
-      ":$zip_target_name",
-    ]
-  }
-}
-
-# Declare a Java executable target
-#
-# This target creates an executable from java code and libraries. The executable
-# will be in the output folder's /bin/ directory.
-#
-# Variables
-#   deps: Specifies the dependencies of this target. Java targets in this list
-#     will be included in the executable (and the javac classpath).
-#
-#   java_files: List of .java files included in this library.
-#   srcjar_deps: List of srcjar dependencies. The .java files in the srcjars
-#     will be added to java_files and be included in this library.
-#   srcjars: List of srcjars to be included in this library, together with the
-#     ones obtained from srcjar_deps.
-#
-#   bypass_platform_checks: Disables checks about cross-platform (Java/Android)
-#     dependencies for this target. This will allow depending on an
-#     android_library target, for example.
-#
-#   chromium_code: If true, extra analysis warning/errors will be enabled.
-#   enable_errorprone: If true, enables the errorprone compiler.
-#
-#   data_deps, testonly
-#
-# Example
-#   java_binary("foo") {
-#     java_files = [ "org/chromium/foo/FooMain.java" ]
-#     deps = [ ":bar_java" ]
-#     main_class = "org.chromium.foo.FooMain"
-#   }
-template("java_binary") {
-  set_sources_assignment_filter([])
-
-  # TODO(cjhopman): This should not act like a java_library for dependents (i.e.
-  # dependents shouldn't get the jar in their classpath, etc.).
-  java_library_impl(target_name) {
-    if (defined(invoker.DEPRECATED_java_in_dir)) {
-      DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir
-    }
-    if (defined(invoker.chromium_code)) {
-      chromium_code = invoker.chromium_code
-    }
-    if (defined(invoker.data_deps)) {
-      deps = invoker.data_deps
-    }
-    if (defined(invoker.deps)) {
-      deps = invoker.deps
-    }
-    if (defined(invoker.enable_errorprone)) {
-      enable_errorprone = invoker.enable_errorprone
-    }
-    if (defined(invoker.java_files)) {
-      java_files = invoker.java_files
-    }
-    if (defined(invoker.srcjar_deps)) {
-      srcjar_deps = invoker.srcjar_deps
-    }
-    if (defined(invoker.srcjars)) {
-      srcjars = invoker.srcjars
-    }
-    if (defined(invoker.bypass_platform_checks)) {
-      bypass_platform_checks = invoker.bypass_platform_checks
-    }
-    if (defined(invoker.testonly)) {
-      testonly = invoker.testonly
-    }
-
-    supports_android = false
-    main_class = invoker.main_class
-  }
-}
-
-# Declare a Junit executable target
-#
-# This target creates an executable from java code for running as a junit test
-# suite. The executable will be in the output folder's /bin/ directory.
-#
-# Variables
-#   deps: Specifies the dependencies of this target. Java targets in this list
-#     will be included in the executable (and the javac classpath).
-#
-#   java_files: List of .java files included in this library.
-#   srcjar_deps: List of srcjar dependencies. The .java files in the srcjars
-#     will be added to java_files and be included in this library.
-#   srcjars: List of srcjars to be included in this library, together with the
-#     ones obtained from srcjar_deps.
-#
-#   chromium_code: If true, extra analysis warning/errors will be enabled.
-#
-# Example
-#   junit_binary("foo") {
-#     java_files = [ "org/chromium/foo/FooTest.java" ]
-#     deps = [ ":bar_java" ]
-#   }
-template("junit_binary") {
-  set_sources_assignment_filter([])
-
-  java_binary(target_name) {
-    bypass_platform_checks = true
-    main_class = "org.chromium.testing.local.JunitTestMain"
-    testonly = true
-
-    if (defined(invoker.DEPRECATED_java_in_dir)) {
-      DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir
-    }
-    if (defined(invoker.chromium_code)) {
-      chromium_code = invoker.chromium_code
-    }
-    deps = [
-      "//testing/android/junit:junit_test_support",
-      "//third_party/junit",
-      "//third_party/mockito:mockito_java",
-      "//third_party/robolectric:robolectric_java",
-      "//third_party/robolectric:android-all-4.3_r2-robolectric-0",
-    ]
-    if (defined(invoker.deps)) {
-      deps += invoker.deps
-    }
-    if (defined(invoker.java_files)) {
-      java_files = invoker.java_files
-    }
-    if (defined(invoker.srcjar_deps)) {
-      srcjar_deps = invoker.srcjar_deps
-    }
-    if (defined(invoker.srcjars)) {
-      srcjars = invoker.srcjars
-    }
-  }
-}
-
-# Declare a java library target
-#
-# Variables
-#   deps: Specifies the dependencies of this target. Java targets in this list
-#     will be added to the javac classpath.
-#
-#   java_files: List of .java files included in this library.
-#   srcjar_deps: List of srcjar dependencies. The .java files in the srcjars
-#     will be added to java_files and be included in this library.
-#   srcjars: List of srcjars to be included in this library, together with the
-#     ones obtained from srcjar_deps.
-#   DEPRECATED_java_in_dir: Directory containing java files. All .java files in
-#     this directory will be included in the library. This is only supported to
-#     ease the gyp->gn conversion and will be removed in the future.
-#
-#   chromium_code: If true, extra analysis warning/errors will be enabled.
-#   enable_errorprone: If true, enables the errorprone compiler.
-#
-#   jar_excluded_patterns: List of patterns of .class files to exclude from the
-#     final jar.
-#
-#   proguard_preprocess: If true, proguard preprocessing will be run. This can
-#     be used to remove unwanted parts of the library.
-#   proguard_config: Path to the proguard config for preprocessing.
-#
-#   supports_android: If true, Android targets (android_library, android_apk)
-#     may depend on this target. Note: if true, this target must only use the
-#     subset of Java available on Android.
-#   bypass_platform_checks: Disables checks about cross-platform (Java/Android)
-#     dependencies for this target. This will allow depending on an
-#     android_library target, for example.
-#
-#   data_deps, testonly
-#
-# Example
-#   java_library("foo_java") {
-#     java_files = [
-#       "org/chromium/foo/Foo.java",
-#       "org/chromium/foo/FooInterface.java",
-#       "org/chromium/foo/FooService.java",
-#     ]
-#     deps = [
-#       ":bar_java"
-#     ]
-#     srcjar_deps = [
-#       ":foo_generated_enum"
-#     ]
-#     jar_excluded_patterns = [
-#       "*/FooService.class", "*/FooService##*.class"
-#     ]
-#   }
-template("java_library") {
-  set_sources_assignment_filter([])
-  java_library_impl(target_name) {
-    if (defined(invoker.DEPRECATED_java_in_dir)) {
-      DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir
-    }
-    if (defined(invoker.chromium_code)) {
-      chromium_code = invoker.chromium_code
-    }
-    if (defined(invoker.data_deps)) {
-      deps = invoker.data_deps
-    }
-    if (defined(invoker.deps)) {
-      deps = invoker.deps
-    }
-    if (defined(invoker.enable_errorprone)) {
-      enable_errorprone = invoker.enable_errorprone
-    }
-    if (defined(invoker.jar_excluded_patterns)) {
-      jar_excluded_patterns = invoker.jar_excluded_patterns
-    }
-    if (defined(invoker.java_files)) {
-      java_files = invoker.java_files
-    }
-    if (defined(invoker.proguard_config)) {
-      proguard_config = invoker.proguard_config
-    }
-    if (defined(invoker.proguard_preprocess)) {
-      proguard_preprocess = invoker.proguard_preprocess
-    }
-    if (defined(invoker.srcjar_deps)) {
-      srcjar_deps = invoker.srcjar_deps
-    }
-    if (defined(invoker.srcjars)) {
-      srcjars = invoker.srcjars
-    }
-    if (defined(invoker.bypass_platform_checks)) {
-      bypass_platform_checks = invoker.bypass_platform_checks
-    }
-    if (defined(invoker.testonly)) {
-      testonly = invoker.testonly
-    }
-    if (defined(invoker.jar_path)) {
-      jar_path = invoker.jar_path
-    }
-
-    if (defined(invoker.supports_android) && invoker.supports_android) {
-      supports_android = true
-    }
-  }
-}
-
-# Declare a java library target for a prebuilt jar
-#
-# Variables
-#   deps: Specifies the dependencies of this target. Java targets in this list
-#     will be added to the javac classpath.
-#   jar_path: Path to the prebuilt jar.
-#   jar_dep: Target that builds jar_path (optional).
-#   proguard_preprocess: If true, proguard preprocessing will be run. This can
-#     be used to remove unwanted parts of the library.
-#   proguard_config: Path to the proguard config for preprocessing.
-#
-# Example
-#   java_prebuilt("foo_java") {
-#     jar_path = "foo.jar"
-#     deps = [
-#       ":foo_resources",
-#       ":bar_java"
-#     ]
-#   }
-template("java_prebuilt") {
-  set_sources_assignment_filter([])
-  java_prebuilt_impl(target_name) {
-    jar_path = invoker.jar_path
-    if (defined(invoker.jar_dep)) {
-      jar_dep = invoker.jar_dep
-    }
-    if (defined(invoker.testonly)) {
-      testonly = invoker.testonly
-    }
-    if (defined(invoker.deps)) {
-      deps = invoker.deps
-    }
-    if (defined(invoker.data_deps)) {
-      data_deps = invoker.data_deps
-    }
-    if (defined(invoker.proguard_config)) {
-      proguard_config = invoker.proguard_config
-    }
-    if (defined(invoker.proguard_preprocess)) {
-      proguard_preprocess = invoker.proguard_preprocess
-    }
-  }
-}
-
-# Declare an Android library target
-#
-# This target creates an Android library containing java code and Android
-# resources.
-#
-# Variables
-#   deps: Specifies the dependencies of this target. Java targets in this list
-#     will be added to the javac classpath. Android resources in dependencies
-#     will be used when building this library.
-#
-#   java_files: List of .java files included in this library.
-#   srcjar_deps: List of srcjar dependencies. The .java files in the srcjars
-#     will be added to java_files and be included in this library.
-#   srcjars: List of srcjars to be included in this library, together with the
-#     ones obtained from srcjar_deps.
-#   DEPRECATED_java_in_dir: Directory containing java files. All .java files in
-#     this directory will be included in the library. This is only supported to
-#     ease the gyp->gn conversion and will be removed in the future.
-#
-#   chromium_code: If true, extra analysis warning/errors will be enabled.
-#   enable_errorprone: If true, enables the errorprone compiler.
-#
-#   jar_excluded_patterns: List of patterns of .class files to exclude from the
-#     final jar.
-#
-#   proguard_preprocess: If true, proguard preprocessing will be run. This can
-#     be used to remove unwanted parts of the library.
-#   proguard_config: Path to the proguard config for preprocessing.
-#
-#   dex_path: If set, the resulting .dex.jar file will be placed under this
-#     path.
-#
-#
-# Example
-#   android_library("foo_java") {
-#     java_files = [
-#       "android/org/chromium/foo/Foo.java",
-#       "android/org/chromium/foo/FooInterface.java",
-#       "android/org/chromium/foo/FooService.java",
-#     ]
-#     deps = [
-#       ":bar_java"
-#     ]
-#     srcjar_deps = [
-#       ":foo_generated_enum"
-#     ]
-#     jar_excluded_patterns = [
-#       "*/FooService.class", "*/FooService##*.class"
-#     ]
-#   }
-template("android_library") {
-  set_sources_assignment_filter([])
-  assert(!defined(invoker.jar_path),
-         "android_library does not support a custom jar path")
-  java_library_impl(target_name) {
-    if (defined(invoker.DEPRECATED_java_in_dir)) {
-      DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir
-    }
-    if (defined(invoker.chromium_code)) {
-      chromium_code = invoker.chromium_code
-    }
-    if (defined(invoker.data_deps)) {
-      deps = invoker.data_deps
-    }
-    if (defined(invoker.deps)) {
-      deps = invoker.deps
-    }
-    if (defined(invoker.enable_errorprone)) {
-      enable_errorprone = invoker.enable_errorprone
-    }
-    if (defined(invoker.jar_excluded_patterns)) {
-      jar_excluded_patterns = invoker.jar_excluded_patterns
-    }
-    if (defined(invoker.java_files)) {
-      java_files = invoker.java_files
-    }
-    if (defined(invoker.proguard_config)) {
-      proguard_config = invoker.proguard_config
-    }
-    if (defined(invoker.proguard_preprocess)) {
-      proguard_preprocess = invoker.proguard_preprocess
-    }
-    if (defined(invoker.srcjar_deps)) {
-      srcjar_deps = invoker.srcjar_deps
-    }
-    if (defined(invoker.srcjars)) {
-      srcjars = invoker.srcjars
-    }
-    if (defined(invoker.testonly)) {
-      testonly = invoker.testonly
-    }
-    if (defined(invoker.visibility)) {
-      visibility = invoker.visibility
-    }
-    if (defined(invoker.dex_path)) {
-      dex_path = invoker.dex_path
-    }
-    if (defined(invoker.manifest_entries)) {
-      manifest_entries = invoker.manifest_entries
-    }
-
-    supports_android = true
-    requires_android = true
-
-    if (!defined(jar_excluded_patterns)) {
-      jar_excluded_patterns = []
-    }
-    jar_excluded_patterns += [
-      "*/R.class",
-      "*/R##*.class",
-      "*/Manifest.class",
-      "*/Manifest##*.class",
-    ]
-  }
-}
-
-# Declare a target that packages a set of Java dependencies into a standalone
-# .dex.jar.
-#
-# Variables
-#   deps: specifies the dependencies of this target. Android libraries in deps
-#     will be packaged into the resulting .dex.jar file.
-#   dex_path: location at which the output file will be put
-template("android_standalone_library") {
-  set_sources_assignment_filter([])
-  deps_dex(target_name) {
-    deps = invoker.deps
-    dex_path = invoker.dex_path
-    if (defined(invoker.excluded_jars)) {
-      excluded_jars = invoker.excluded_jars
-    }
-  }
-}
-
-# Declare an Android library target for a prebuilt jar
-#
-# This target creates an Android library containing java code and Android
-# resources.
-#
-# Variables
-#   deps: Specifies the dependencies of this target. Java targets in this list
-#     will be added to the javac classpath. Android resources in dependencies
-#     will be used when building this library.
-#   jar_path: Path to the prebuilt jar.
-#   proguard_preprocess: If true, proguard preprocessing will be run. This can
-#     be used to remove unwanted parts of the library.
-#   proguard_config: Path to the proguard config for preprocessing.
-#
-# Example
-#   android_java_prebuilt("foo_java") {
-#     jar_path = "foo.jar"
-#     deps = [
-#       ":foo_resources",
-#       ":bar_java"
-#     ]
-#   }
-template("android_java_prebuilt") {
-  set_sources_assignment_filter([])
-  java_prebuilt_impl(target_name) {
-    jar_path = invoker.jar_path
-    supports_android = true
-    requires_android = true
-    if (defined(invoker.testonly)) {
-      testonly = invoker.testonly
-    }
-    if (defined(invoker.deps)) {
-      deps = invoker.deps
-    }
-    if (defined(invoker.data_deps)) {
-      data_deps = invoker.data_deps
-    }
-    if (defined(invoker.proguard_config)) {
-      proguard_config = invoker.proguard_config
-    }
-    if (defined(invoker.proguard_preprocess)) {
-      proguard_preprocess = invoker.proguard_preprocess
-    }
-  }
-}
-
-# Declare an Android apk target
-#
-# This target creates an Android APK containing java code, resources, assets,
-# and (possibly) native libraries.
-#
-# Variables
-#   android_manifest: Path to AndroidManifest.xml.
-#   android_manifest_dep: Target that generates AndroidManifest (if applicable)
-#   data_deps: List of dependencies needed at runtime. These will be built but
-#     won't change the generated .apk in any way (in fact they may be built
-#     after the .apk is).
-#   deps: List of dependencies. All Android java resources and libraries in the
-#     "transitive closure" of these dependencies will be included in the apk.
-#     Note: this "transitive closure" actually only includes such targets if
-#     they are depended on through android_library or android_resources targets
-#     (and so not through builtin targets like 'action', 'group', etc).
-#   java_files: List of .java files to include in the apk.
-#   srcjar_deps: List of srcjar dependencies. The .java files in the srcjars
-#      will be added to java_files and be included in this apk.
-#   apk_name: Name for final apk.
-#   final_apk_path: Path to final built apk. Default is
-#     $root_out_dir/apks/$apk_name.apk. Setting this will override apk_name.
-#   native_libs: List paths of native libraries to include in this apk. If these
-#     libraries depend on other shared_library targets, those dependencies will
-#     also be included in the apk.
-#   apk_under_test: For an instrumentation test apk, this is the target of the
-#     tested apk.
-#   include_all_resources - If true include all resource IDs in all generated
-#     R.java files.
-#   testonly: Marks this target as "test-only".
-#
-#   DEPRECATED_java_in_dir: Directory containing java files. All .java files in
-#     this directory will be included in the library. This is only supported to
-#     ease the gyp->gn conversion and will be removed in the future.
-#
-# Example
-#   android_apk("foo_apk") {
-#     android_manifest = "AndroidManifest.xml"
-#     java_files = [
-#       "android/org/chromium/foo/FooApplication.java",
-#       "android/org/chromium/foo/FooActivity.java",
-#     ]
-#     deps = [
-#       ":foo_support_java"
-#       ":foo_resources"
-#     ]
-#     srcjar_deps = [
-#       ":foo_generated_enum"
-#     ]
-#     native_libs = [
-#       native_lib_path
-#     ]
-#   }
-template("android_apk") {
-  set_sources_assignment_filter([])
-  if (defined(invoker.testonly)) {
-    testonly = invoker.testonly
-  }
-
-  assert(defined(invoker.final_apk_path) || defined(invoker.apk_name))
-  assert(defined(invoker.android_manifest))
-  gen_dir = "$target_gen_dir/$target_name"
-  base_path = "$gen_dir/$target_name"
-  _build_config = "$target_gen_dir/$target_name.build_config"
-  resources_zip_path = "$base_path.resources.zip"
-  _all_resources_zip_path = "$base_path.resources.all.zip"
-  jar_path = "$base_path.jar"
-  _template_name = target_name
-
-  final_dex_path = "$gen_dir/classes.dex"
-  final_dex_target_name = "${_template_name}__final_dex"
-
-  _final_apk_path = ""
-  if (defined(invoker.final_apk_path)) {
-    _final_apk_path = invoker.final_apk_path
-  } else if (defined(invoker.apk_name)) {
-    _final_apk_path = "$root_build_dir/apks/" + invoker.apk_name + ".apk"
-  }
-  _dist_jar_path_list =
-      process_file_template(
-          [ _final_apk_path ],
-          "$root_build_dir/test.lib.java/{{source_name_part}}.jar")
-  _dist_jar_path = _dist_jar_path_list[0]
-
-  _native_libs = []
-
-  _version_code = "1"
-  if (defined(invoker.version_code)) {
-    _version_code = invoker.version_code
-  }
-
-  _version_name = "Developer Build"
-  if (defined(invoker.version_name)) {
-    _version_name = invoker.version_name
-  }
-  _keystore_path = android_default_keystore_path
-  _keystore_name = android_default_keystore_name
-  _keystore_password = android_default_keystore_password
-
-  if (defined(invoker.keystore_path)) {
-    _keystore_path = invoker.keystore_path
-    _keystore_name = invoker.keystore_name
-    _keystore_password = invoker.keystore_password
-  }
-
-  _srcjar_deps = []
-  if (defined(invoker.srcjar_deps)) {
-    _srcjar_deps += invoker.srcjar_deps
-  }
-
-  _load_library_from_apk = false
-
-  # The dependency that makes the chromium linker, if any is needed.
-  _chromium_linker_dep = []
-
-  if (defined(invoker.native_libs)) {
-    _use_chromium_linker = false
-    if (defined(invoker.use_chromium_linker)) {
-      _use_chromium_linker =
-          invoker.use_chromium_linker && chromium_linker_supported
-      _chromium_linker_dep = [ "//base/android/linker:chromium_android_linker" ]
-    }
-
-    if (defined(invoker.load_library_from_apk) &&
-        invoker.load_library_from_apk) {
-      _load_library_from_apk = true
-      assert(_use_chromium_linker,
-             "Loading library from the apk requires use" +
-                 " of the Chromium linker.")
-    }
-
-    _enable_relocation_packing = false
-    if (defined(invoker.enable_relocation_packing) &&
-        invoker.enable_relocation_packing) {
-      _enable_relocation_packing = relocation_packing_supported
-      assert(_use_chromium_linker,
-             "Relocation packing requires use of the" + " Chromium linker.")
-    }
-
-    if (is_component_build) {
-      _native_libs += [ "$root_out_dir/lib.stripped/libc++_shared.so" ]
-      _chromium_linker_dep += [ "//build/android:cpplib_stripped" ]
-    }
-
-    # Allow native_libs to be in the form "foo.so" or "foo.cr.so"
-    _first_ext_removed =
-        process_file_template(invoker.native_libs, "{{source_name_part}}")
-    _native_libs += process_file_template(
-            _first_ext_removed,
-            "$root_build_dir/lib.stripped/{{source_name_part}}$android_product_extension")
-
-    _native_libs_dir = base_path + "/libs"
-
-    if (_use_chromium_linker) {
-      _native_libs += [ "$root_build_dir/lib.stripped/libchromium_android_linker$android_product_extension" ]
-    }
-
-    _enable_relocation_packing = false
-    if (_use_chromium_linker && defined(invoker.enable_relocation_packing) &&
-        invoker.enable_relocation_packing) {
-      _enable_relocation_packing = true
-    }
-
-    _native_lib_version_rule = ""
-    if (defined(invoker.native_lib_version_rule)) {
-      _native_lib_version_rule = invoker.native_lib_version_rule
-    }
-    _native_lib_version_arg = "\"\""
-    if (defined(invoker.native_lib_version_arg)) {
-      _native_lib_version_arg = invoker.native_lib_version_arg
-    }
-  }
-
-  _android_manifest_deps = []
-  if (defined(invoker.android_manifest_dep)) {
-    _android_manifest_deps = [ invoker.android_manifest_dep ]
-  }
-  _android_manifest = invoker.android_manifest
-
-  _rebased_build_config = rebase_path(_build_config, root_build_dir)
-  _create_abi_split =
-      defined(invoker.create_abi_split) && invoker.create_abi_split
-  _create_density_splits =
-      defined(invoker.create_density_splits) && invoker.create_density_splits
-
-  # Help GN understand that _create_abi_split is not unused (bug in GN).
-  assert(_create_abi_split || true)
-
-  build_config_target = "${_template_name}__build_config"
-  write_build_config(build_config_target) {
-    type = "android_apk"
-    dex_path = final_dex_path
-    resources_zip = resources_zip_path
-    build_config = _build_config
-    android_manifest = _android_manifest
-
-    deps = _chromium_linker_dep + _android_manifest_deps
-    if (defined(invoker.deps)) {
-      deps += invoker.deps
-    }
-
-    if (defined(invoker.apk_under_test)) {
-      apk_under_test = invoker.apk_under_test
-    }
-
-    native_libs = _native_libs
-  }
-
-  final_deps = []
-
-  process_resources_target = "${_template_name}__process_resources"
-  final_deps += [ ":$process_resources_target" ]
-  process_resources(process_resources_target) {
-    srcjar_path = "${target_gen_dir}/${target_name}.srcjar"
-    r_text_path = "${target_gen_dir}/${target_name}_R.txt"
-    android_manifest = _android_manifest
-    resource_dirs = [ "//build/android/ant/empty/res" ]
-    zip_path = resources_zip_path
-    all_resources_zip_path = _all_resources_zip_path
-    generate_constant_ids = true
-
-    if (defined(invoker.include_all_resources)) {
-      include_all_resources = invoker.include_all_resources
-    }
-
-    build_config = _build_config
-    deps = _android_manifest_deps + [ ":$build_config_target" ]
-    if (defined(invoker.deps)) {
-      deps += invoker.deps
-    }
-  }
-  _srcjar_deps += [ ":$process_resources_target" ]
-
-  if (_native_libs != []) {
-    _enable_chromium_linker_tests = false
-    if (defined(invoker.enable_chromium_linker_tests)) {
-      _enable_chromium_linker_tests = invoker.enable_chromium_linker_tests
-    }
-
-    java_cpp_template("${_template_name}__native_libraries_java") {
-      package_name = "org/chromium/base/library_loader"
-      sources = [
-        "//base/android/java/templates/NativeLibraries.template",
-      ]
-      inputs = [
-        _build_config,
-      ]
-      deps = [
-        ":$build_config_target",
-      ]
-      if (_native_lib_version_rule != "") {
-        deps += [ _native_lib_version_rule ]
-      }
-
-      defines = [
-        "NATIVE_LIBRARIES_LIST=" +
-            "@FileArg($_rebased_build_config:native:java_libraries_list)",
-        "NATIVE_LIBRARIES_VERSION_NUMBER=$_native_lib_version_arg",
-      ]
-      if (_use_chromium_linker) {
-        defines += [ "ENABLE_CHROMIUM_LINKER" ]
-      }
-      if (_load_library_from_apk) {
-        defines += [ "ENABLE_CHROMIUM_LINKER_LIBRARY_IN_ZIP_FILE" ]
-      }
-      if (_enable_chromium_linker_tests) {
-        defines += [ "ENABLE_CHROMIUM_LINKER_TESTS" ]
-      }
-    }
-    _srcjar_deps += [ ":${_template_name}__native_libraries_java" ]
-  }
-
-  java_target = "${_template_name}__java"
-  final_deps += [ ":$java_target" ]
-  java_library_impl(java_target) {
-    supports_android = true
-    requires_android = true
-    override_build_config = _build_config
-    deps = _android_manifest_deps + [ ":$build_config_target" ]
-
-    android_manifest = _android_manifest
-    chromium_code = true
-    if (defined(invoker.java_files)) {
-      java_files = invoker.java_files
-    } else if (defined(invoker.DEPRECATED_java_in_dir)) {
-      DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir
-    } else {
-      java_files = []
-    }
-    srcjar_deps = _srcjar_deps
-    dex_path = base_path + ".dex.jar"
-
-    if (defined(invoker.deps)) {
-      deps += invoker.deps
-    }
-  }
-
-  if (_dist_jar_path != "") {
-    create_dist_target = "${_template_name}__create_dist_jar"
-    final_deps += [ ":$create_dist_target" ]
-
-    # TODO(cjhopman): This is only ever needed to calculate the list of tests to
-    # run. See build/android/pylib/instrumentation/test_jar.py. We should be
-    # able to just do that calculation at build time instead.
-    action(create_dist_target) {
-      script = "//build/android/gyp/create_dist_jar.py"
-      depfile = "$target_gen_dir/$target_name.d"
-      inputs = [
-        _build_config,
-      ]
-      outputs = [
-        depfile,
-        _dist_jar_path,
-      ]
-      args = [
-        "--depfile",
-        rebase_path(depfile, root_build_dir),
-        "--output",
-        rebase_path(_dist_jar_path, root_build_dir),
-        "--inputs=@FileArg($_rebased_build_config:dist_jar:dependency_jars)",
-      ]
-      inputs += [ jar_path ]
-      _rebased_jar_path = rebase_path([ jar_path ], root_build_dir)
-      args += [ "--inputs=$_rebased_jar_path" ]
-      deps = [
-        ":$build_config_target",  # Generates the build config file.
-        ":$java_target",  # Generates the jar file.
-      ]
-    }
-  }
-
-  final_deps += [ ":$final_dex_target_name" ]
-  dex("${final_dex_target_name}_jar") {
-    deps = [
-      ":$build_config_target",
-      ":$java_target",
-    ]
-    sources = [
-      jar_path,
-    ]
-    inputs = [
-      _build_config,
-    ]
-    output = "${final_dex_path}.jar"
-    dex_arg_key = "${_rebased_build_config}:final_dex:dependency_dex_files"
-    args = [ "--inputs=@FileArg($dex_arg_key)" ]
-  }
-
-  dex("$final_dex_target_name") {
-    deps = [
-      ":${final_dex_target_name}_jar",
-    ]
-    sources = [
-      "${final_dex_path}.jar",
-    ]
-    output = final_dex_path
-  }
-
-  if (_native_libs != []) {
-    action("${_template_name}__prepare_native") {
-      script = "//build/android/gyp/pack_relocations.py"
-      packed_libraries_dir = "$_native_libs_dir/$android_app_abi"
-      depfile = "$target_gen_dir/$target_name.d"
-      outputs = [
-        depfile,
-      ]
-
-      inputs = _native_libs
-      deps = _chromium_linker_dep
-
-      inputs += [ _build_config ]
-      deps += [ ":$build_config_target" ]
-
-      skip_packing_list = [
-        "gdbserver",
-        "libchromium_android_linker$android_product_extension",
-      ]
-
-      enable_packing_arg = 0
-      if (_enable_relocation_packing) {
-        enable_packing_arg = 1
-        deps += [ relocation_packer_target ]
-      }
-
-      args = [
-        "--depfile",
-        rebase_path(depfile, root_build_dir),
-        "--enable-packing=$enable_packing_arg",
-        "--exclude-packing-list=$skip_packing_list",
-        "--android-pack-relocations",
-        rebase_path(relocation_packer_exe, root_build_dir),
-        "--stripped-libraries-dir",
-        rebase_path(root_build_dir, root_build_dir),
-        "--packed-libraries-dir",
-        rebase_path(packed_libraries_dir, root_build_dir),
-        "--libraries=@FileArg(${_rebased_build_config}:native:libraries)",
-        "--clear-dir",
-      ]
-
-      if (defined(invoker.deps)) {
-        deps += invoker.deps
-      }
-      if (defined(invoker.public_deps)) {
-        public_deps = invoker.public_deps
-      }
-      if (defined(invoker.data_deps)) {
-        data_deps = invoker.data_deps
-      }
-
-      if (is_debug) {
-        rebased_gdbserver = rebase_path([ android_gdbserver ], root_build_dir)
-        inputs += [ android_gdbserver ]
-        args += [ "--libraries=$rebased_gdbserver" ]
-      }
-    }
-  }
-
-  final_deps += [ ":${_template_name}__create" ]
-  create_apk("${_template_name}__create") {
-    apk_path = _final_apk_path
-    android_manifest = _android_manifest
-    resources_zip = _all_resources_zip_path
-    dex_path = final_dex_path
-    load_library_from_apk = _load_library_from_apk
-    create_density_splits = _create_density_splits
-    if (defined(invoker.language_splits)) {
-      language_splits = invoker.language_splits
-    }
-    if (defined(invoker.extensions_to_not_compress)) {
-      extensions_to_not_compress = invoker.extensions_to_not_compress
-    } else {
-      # Allow icu data, v8 snapshots, and pak files to be loaded directly from
-      # the .apk.
-      # Note: These are actually suffix matches, not necessarily extensions.
-      extensions_to_not_compress = ".dat,.bin,.pak"
-    }
-
-    version_code = _version_code
-    version_name = _version_name
-
-    keystore_name = _keystore_name
-    keystore_path = _keystore_path
-    keystore_password = _keystore_password
-
-    # This target generates the input file _all_resources_zip_path.
-    deps = _android_manifest_deps + [
-             ":$process_resources_target",
-             ":$final_dex_target_name",
-           ]
-    if (defined(invoker.deps)) {
-      deps += invoker.deps
-    }
-
-    if (defined(invoker.asset_location)) {
-      asset_location = invoker.asset_location
-
-      # We don't know the exact dependencies that create the assets in
-      # |asset_location|; we depend on all caller deps until a better solution
-      # is figured out (http://crbug.com/433330).
-      if (defined(invoker.deps)) {
-        deps += invoker.deps
-      }
-    }
-
-    if (_native_libs != [] && !_create_abi_split) {
-      native_libs_dir = _native_libs_dir
-      deps += [ ":${_template_name}__prepare_native" ]
-    }
-  }
-
-  if (_native_libs != [] && _create_abi_split) {
-    _manifest_rule = "${_template_name}__split_manifest_abi_${android_app_abi}"
-    generate_split_manifest(_manifest_rule) {
-      main_manifest = _android_manifest
-      out_manifest =
-          "$gen_dir/split-manifests/${android_app_abi}/AndroidManifest.xml"
-      split_name = "abi_${android_app_abi}"
-      deps = _android_manifest_deps
-    }
-
-    _apk_rule = "${_template_name}__split_apk_abi_${android_app_abi}"
-    final_deps += [ ":$_apk_rule" ]
-    create_apk(_apk_rule) {
-      _split_paths = process_file_template(
-              [ _final_apk_path ],
-              "{{source_dir}}/{{source_name_part}}-abi-${android_app_abi}.apk")
-      apk_path = _split_paths[0]
-      base_path = "$gen_dir/$_apk_rule"
-
-      manifest_outputs = get_target_outputs(":${_manifest_rule}")
-      android_manifest = manifest_outputs[1]
-      load_library_from_apk = _load_library_from_apk
-
-      version_code = _version_code
-      version_name = _version_name
-
-      keystore_name = _keystore_name
-      keystore_path = _keystore_path
-      keystore_password = _keystore_password
-
-      native_libs_dir = _native_libs_dir
-      deps = [
-        ":${_template_name}__prepare_native",
-        ":${_manifest_rule}",
-      ]
-    }
-  }
-
-  if (defined(invoker.flutter_dist_jar)) {
-    flutter_jar_target = "${_template_name}__create_flutter_jar"
-    final_deps += [ ":$flutter_jar_target" ]
-
-    action(flutter_jar_target) {
-      script = "//build/android/gyp/create_flutter_jar.py"
-      depfile = "$target_gen_dir/$target_name.d"
-      inputs = [
-        _dist_jar_path,
-      ]
-      outputs = [
-        invoker.flutter_dist_jar,
-      ]
-      args = [
-        "--depfile",
-        rebase_path(depfile, root_build_dir),
-        "--output",
-        rebase_path(invoker.flutter_dist_jar, root_build_dir),
-        "--dist_jar",
-        rebase_path(_dist_jar_path, root_build_dir),
-        "--android_abi",
-        "$android_app_abi",
-        "--asset_dir",
-        rebase_path(invoker.asset_location, root_build_dir),
-      ]
-      foreach(native_lib, rebase_path(_native_libs, root_build_dir)) {
-        args += [
-          "--native_lib",
-          native_lib,
-        ]
-      }
-      deps = [
-        ":$create_dist_target",
-        ":${_template_name}__prepare_native"
-      ]
-      if (defined(invoker.deps)) {
-        deps += invoker.deps
-      }
-    }
-  }
-
-  group(target_name) {
-    deps = final_deps
-    if (defined(invoker.data_deps)) {
-      data_deps = invoker.data_deps
-    }
-  }
-}
-
-# Declare an Android instrumentation test apk
-#
-# This target creates an Android instrumentation test apk.
-#
-# Variables
-#   android_manifest: Path to AndroidManifest.xml.
-#   data_deps: List of dependencies needed at runtime. These will be built but
-#     won't change the generated .apk in any way (in fact they may be built
-#     after the .apk is).
-#   deps: List of dependencies. All Android java resources and libraries in the
-#     "transitive closure" of these dependencies will be included in the apk.
-#     Note: this "transitive closure" actually only includes such targets if
-#     they are depended on through android_library or android_resources targets
-#     (and so not through builtin targets like 'action', 'group', etc).
-#   java_files: List of .java files to include in the apk.
-#   srcjar_deps: List of srcjar dependencies. The .java files in the srcjars
-#      will be added to java_files and be included in this apk.
-#   apk_name: Name for final apk.
-#   support_apk_path: Path to a support apk. If present, the test runner script
-#      will install it on the device before running the instrumentation tests.
-#      Should be a path relative to the src root.
-#   final_apk_path: Path to final built apk. Default is
-#     $root_out_dir/apks/$apk_name.apk. Setting this will override apk_name.
-#   native_libs: List paths of native libraries to include in this apk. If these
-#     libraries depend on other shared_library targets, those dependencies will
-#     also be included in the apk.
-#   apk_under_test: The apk being tested.
-#   isolate_file: Isolate file containing the list of test data dependencies.
-#
-#   DEPRECATED_java_in_dir: Directory containing java files. All .java files in
-#     this directory will be included in the library. This is only supported to
-#     ease the gyp->gn conversion and will be removed in the future.
-#
-# Example
-#   instrumentation_test_apk("foo_test_apk") {
-#     android_manifest = "AndroidManifest.xml"
-#     apk_name = "FooTest"
-#     apk_under_test = "Foo"
-#     java_files = [
-#       "android/org/chromium/foo/FooTestCase.java",
-#       "android/org/chromium/foo/FooExampleTest.java",
-#     ]
-#     deps = [
-#       ":foo_test_support_java"
-#     ]
-#   }
-template("instrumentation_test_apk") {
-  set_sources_assignment_filter([])
-  testonly = true
-  _template_name = target_name
-
-  if (defined(invoker.apk_name)) {
-    test_runner_data_dep = [ ":${_template_name}__test_runner_script" ]
-    test_runner_script("${_template_name}__test_runner_script") {
-      test_name = invoker.target_name
-      test_type = "instrumentation"
-      test_apk = invoker.apk_name
-      if (defined(invoker.isolate_file)) {
-        isolate_file = invoker.isolate_file
-      }
-      if (defined(invoker.support_apk_path)) {
-        support_apk_path = invoker.support_apk_path
-      }
-    }
-  }
-
-  android_apk(target_name) {
-    if (defined(invoker.android_manifest)) {
-      android_manifest = invoker.android_manifest
-    }
-    data_deps = [
-      "//testing/android/driver:driver_apk",
-      "//tools/android/forwarder2",
-      "//tools/android/md5sum",
-    ]
-    if (defined(test_runner_data_dep)) {
-      data_deps += test_runner_data_dep
-    }
-    if (defined(invoker.data_deps)) {
-      data_deps += invoker.data_deps
-    }
-    deps = [
-      "//testing/android/broker:broker_java",
-    ]
-    if (defined(invoker.deps)) {
-      deps += invoker.deps
-    }
-    if (defined(invoker.java_files)) {
-      java_files = invoker.java_files
-    }
-    if (defined(invoker.srcjar_deps)) {
-      srcjar_deps = invoker.srcjar_deps
-    }
-    if (defined(invoker.apk_name)) {
-      apk_name = invoker.apk_name
-    }
-    if (defined(invoker.final_apk_path)) {
-      final_apk_path = invoker.final_apk_path
-    }
-    if (defined(invoker.native_libs)) {
-      native_libs = invoker.native_libs
-    }
-    if (defined(invoker.apk_under_test)) {
-      apk_under_test = invoker.apk_under_test
-    }
-    if (defined(invoker.DEPRECATED_java_in_dir)) {
-      DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir
-    }
-  }
-}
-
-# Declare an Android gtest apk
-#
-# This target creates an Android apk for running gtest-based unittests.
-#
-# Variables
-#   deps: Specifies the dependencies of this target. These will be passed to
-#     the underlying android_apk invocation and should include the java and
-#     resource dependencies of the apk.
-#   unittests_dep: This should be the label of the gtest native target. This
-#     target must be defined previously in the same file.
-#   unittests_binary: The basename of the library produced by the unittests_dep
-#     target. If unspecified, it assumes the name of the unittests_dep target
-#     (which will be correct unless that target specifies an "output_name".
-#     TODO(brettw) make this automatic by allowing get_target_outputs to
-#     support executables.
-#   apk_name: The name of the produced apk. If unspecified, it uses the name
-#             of the unittests_dep target postfixed with "_apk"
-#
-# Example
-#   unittest_apk("foo_unittests_apk") {
-#     deps = [ ":foo_java", ":foo_resources" ]
-#     unittests_dep = ":foo_unittests"
-#   }
-template("unittest_apk") {
-  set_sources_assignment_filter([])
-  testonly = true
-
-  assert(defined(invoker.unittests_dep), "Need unittests_dep for $target_name")
-
-  test_suite_name = get_label_info(invoker.unittests_dep, "name")
-
-  # This trivial assert is needed in case both unittests_binary and apk_name
-  # are defined, as otherwise test_suite_name would not be used.
-  assert(test_suite_name != "")
-
-  if (defined(invoker.unittests_binary)) {
-    unittests_binary = invoker.unittests_binary
-  } else {
-    unittests_binary = "lib${test_suite_name}${android_product_extension}"
-  }
-
-  if (defined(invoker.apk_name)) {
-    apk_name = invoker.apk_name
-  } else {
-    apk_name = test_suite_name
-  }
-
-  android_apk(target_name) {
-    final_apk_path = "$root_build_dir/${apk_name}_apk/${apk_name}-debug.apk"
-    java_files = [
-      "//testing/android/native_test/java/src/org/chromium/native_test/NativeBrowserTestActivity.java",
-      "//testing/android/native_test/java/src/org/chromium/native_test/NativeTestActivity.java",
-      "//testing/android/native_test/java/src/org/chromium/native_test/NativeUnitTestActivity.java",
-      "//testing/android/native_test/java/src/org/chromium/native_test/NativeTestInstrumentationTestRunner.java",
-    ]
-    android_manifest = "//testing/android/native_test/java/AndroidManifest.xml"
-    native_libs = [ unittests_binary ]
-    if (defined(invoker.asset_location)) {
-      asset_location = invoker.asset_location
-    }
-    deps = [
-      "//base:base_java",
-      "//build/android/pylib/remote/device/dummy:remote_device_dummy_apk",
-      "//testing/android/appurify_support:appurify_support_java",
-      "//testing/android/reporter:reporter_java",
-    ]
-    if (defined(invoker.deps)) {
-      deps += invoker.deps
-    }
-    data_deps = [ "//tools/android/md5sum" ]
-    if (host_os == "linux") {
-      data_deps += [ "//tools/android/forwarder2" ]
-    }
-    if (defined(invoker.data_deps)) {
-      data_deps += invoker.data_deps
-    }
-  }
-}
-
-# Generate .java files from .aidl files.
-#
-# This target will store the .java files in a srcjar and should be included in
-# an android_library or android_apk's srcjar_deps.
-#
-# Variables
-#   sources: Paths to .aidl files to compile.
-#   import_include: Path to directory containing .java files imported by the
-#     .aidl files.
-#   interface_file: Preprocessed aidl file to import.
-#
-# Example
-#   android_aidl("foo_aidl") {
-#     import_include = "java/src"
-#     sources = [
-#       "java/src/com/foo/bar/FooBarService.aidl",
-#       "java/src/com/foo/bar/FooBarServiceCallback.aidl",
-#     ]
-#   }
-template("android_aidl") {
-  set_sources_assignment_filter([])
-  if (defined(invoker.testonly)) {
-    testonly = invoker.testonly
-  }
-
-  srcjar_path = "${target_gen_dir}/${target_name}.srcjar"
-  aidl_path = "${android_sdk_build_tools}/aidl"
-  framework_aidl = "$android_sdk/framework.aidl"
-
-  action(target_name) {
-    script = "//build/android/gyp/aidl.py"
-    sources = invoker.sources
-
-    imports = [ framework_aidl ]
-    if (defined(invoker.interface_file)) {
-      assert(invoker.interface_file != "")
-      imports += [ invoker.interface_file ]
-    }
-
-    inputs = [ aidl_path ] + imports
-
-    depfile = "${target_gen_dir}/${target_name}.d"
-    outputs = [
-      depfile,
-      srcjar_path,
-    ]
-    rebased_imports = rebase_path(imports, root_build_dir)
-    args = [
-      "--depfile",
-      rebase_path(depfile, root_build_dir),
-      "--aidl-path",
-      rebase_path(aidl_path, root_build_dir),
-      "--imports=$rebased_imports",
-      "--srcjar",
-      rebase_path(srcjar_path, root_build_dir),
-    ]
-    if (defined(invoker.import_include) && invoker.import_include != "") {
-      # TODO(cjhopman): aidl supports creating a depfile. We should be able to
-      # switch to constructing a depfile for the overall action from that
-      # instead of having all the .java files in the include paths as inputs.
-      rebased_import_includes =
-          rebase_path([ invoker.import_include ], root_build_dir)
-      args += [ "--includes=$rebased_import_includes" ]
-
-      _java_files_build_rel =
-          exec_script("//build/android/gyp/find.py",
-                      rebase_path([ invoker.import_include ], root_build_dir),
-                      "list lines")
-      _java_files = rebase_path(_java_files_build_rel, ".", root_build_dir)
-      inputs += _java_files
-    }
-    args += rebase_path(sources, root_build_dir)
-  }
-}
-
-# Creates a dist directory for a native executable.
-#
-# Running a native executable on a device requires all the shared library
-# dependencies of that executable. To make it easier to install and run such an
-# executable, this will create a directory containing the native exe and all
-# it's library dependencies.
-#
-# Note: It's usually better to package things as an APK than as a native
-# executable.
-#
-# Variables
-#   dist_dir: Directory for the exe and libraries. Everything in this directory
-#     will be deleted before copying in the exe and libraries.
-#   binary: Path to (stripped) executable.
-#
-# Example
-#   create_native_executable_dist("foo_dist") {
-#     dist_dir = "$root_build_dir/foo_dist"
-#     binary = "$root_build_dir/exe.stripped/foo"
-#     deps = [ ":the_thing_that_makes_foo" ]
-#   }
-template("create_native_executable_dist") {
-  set_sources_assignment_filter([])
-  if (defined(invoker.testonly)) {
-    testonly = invoker.testonly
-  }
-
-  dist_dir = invoker.dist_dir
-  binary = invoker.binary
-  template_name = target_name
-
-  libraries_list =
-      "${target_gen_dir}/${template_name}_library_dependencies.list"
-
-  find_deps_target_name = "${template_name}__find_library_dependencies"
-  copy_target_name = "${template_name}__copy_libraries_and_exe"
-
-  stripped_libraries_dir = "$root_build_dir/lib.stripped"
-  action(find_deps_target_name) {
-    visibility = [ ":$copy_target_name" ]
-
-    script = "//build/android/gyp/write_ordered_libraries.py"
-    depfile = "$target_gen_dir/$target_name.d"
-    inputs = [
-      binary,
-      android_readelf,
-    ]
-    outputs = [
-      depfile,
-      libraries_list,
-    ]
-    rebased_binaries = rebase_path([ binary ], root_build_dir)
-    args = [
-      "--depfile",
-      rebase_path(depfile, root_build_dir),
-      "--input-libraries=$rebased_binaries",
-      "--libraries-dir",
-      rebase_path(stripped_libraries_dir, root_build_dir),
-      "--output",
-      rebase_path(libraries_list, root_build_dir),
-      "--readelf",
-      rebase_path(android_readelf, root_build_dir),
-    ]
-    if (defined(invoker.deps)) {
-      deps = invoker.deps
-    }
-  }
-
-  copy_ex(copy_target_name) {
-    visibility = [ ":$template_name" ]
-
-    clear_dir = true
-    inputs = [
-      binary,
-      libraries_list,
-    ]
-    dest = dist_dir
-    rebased_binaries_list = rebase_path([ binary ], root_build_dir)
-    rebased_libraries_list = rebase_path(libraries_list, root_build_dir)
-    args = [
-      "--files=$rebased_binaries_list",
-      "--files=@FileArg($rebased_libraries_list:lib_paths)",
-    ]
-
-    deps = [
-      ":$find_deps_target_name",
-    ]
-    if (defined(invoker.deps)) {
-      deps += invoker.deps
-    }
-  }
-
-  group(template_name) {
-    if (defined(invoker.visibility)) {
-      visibility = invoker.visibility
-    }
-    deps = [
-      ":$copy_target_name",
-    ]
-  }
-}
-
-# Compile a protocol buffer to java.
-#
-# This generates java files from protocol buffers and creates an Android library
-# containing the classes.
-#
-# Variables
-#   sources: Paths to .proto files to compile.
-#   proto_path: Root directory of .proto files.
-#
-# Example:
-#  proto_java_library("foo_proto_java") {
-#    proto_path = [ "src/foo" ]
-#    sources = [ "$proto_path/foo.proto" ]
-#  }
-template("proto_java_library") {
-  set_sources_assignment_filter([])
-  _protoc_dep = "//third_party/android_protobuf:android_protoc($host_toolchain)"
-  _protoc_out_dir = get_label_info(_protoc_dep, "root_out_dir")
-  _protoc_bin = "$_protoc_out_dir/android_protoc"
-  _proto_path = invoker.proto_path
-
-  _template_name = target_name
-
-  action("${_template_name}__protoc_java") {
-    srcjar_path = "$target_gen_dir/$target_name.srcjar"
-    script = "//build/protoc_java.py"
-    deps = [
-      _protoc_dep,
-    ]
-    sources = invoker.sources
-    depfile = "$target_gen_dir/$target_name.d"
-    outputs = [
-      depfile,
-      srcjar_path,
-    ]
-    args = [
-             "--depfile",
-             rebase_path(depfile, root_build_dir),
-             "--protoc",
-             rebase_path(_protoc_bin, root_build_dir),
-             "--proto-path",
-             rebase_path(_proto_path, root_build_dir),
-             "--srcjar",
-             rebase_path(srcjar_path, root_build_dir),
-           ] + rebase_path(sources, root_build_dir)
-  }
-
-  android_library(target_name) {
-    java_files = []
-    srcjar_deps = [ ":${_template_name}__protoc_java" ]
-    deps = [
-      "//third_party/android_protobuf:protobuf_nano_javalib",
-    ]
-  }
-}
-
-# TODO(GYP): implement this.
-template("uiautomator_test") {
-  set_sources_assignment_filter([])
-  if (defined(invoker.testonly)) {
-    testonly = invoker.testonly
-  }
-  assert(target_name != "")
-  assert(invoker.deps != [] || true)
-  group(target_name) {
-  }
-}
diff --git a/build/config/arm.gni b/build/config/arm.gni
index 429a250..fa9934f1 100644
--- a/build/config/arm.gni
+++ b/build/config/arm.gni
@@ -8,7 +8,7 @@
     # platforms.
     if (current_cpu == "arm") {
       arm_version = 7
-    } else if(current_cpu == "arm64") {
+    } else if (current_cpu == "arm64") {
       arm_version = 8
     } else {
       assert(false, "Unconfigured arm version")
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 7f7e423..52043c8 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -17,16 +17,6 @@
 }
 
 import("//build/toolchain/ccache.gni")
-import("//build/config/sanitizers/sanitizers.gni")
-
-declare_args() {
-  if (is_win) {
-    # Whether the VS xtree header has been patched to disable warning 4702. If
-    # it has, then we don't need to disable 4702 (unreachable code warning).
-    # The patch is preapplied to the internal toolchain and hence all bots.
-    msvs_xtree_patched = false
-  }
-}
 
 # default_include_dirs ---------------------------------------------------------
 #
@@ -40,7 +30,6 @@
   ]
 }
 
-# TODO(GYP): is_ubsan, is_ubsan_vptr
 if (!is_win) {
   using_sanitizer = is_asan || is_lsan || is_tsan || is_msan
 }
@@ -73,40 +62,6 @@
       "/GS",  # Enable buffer security checking.
       "/FS",  # Preserve previous PDB behavior.
     ]
-
-    # Building with Clang on Windows is a work in progress and very
-    # experimental. See crbug.com/82385.
-    # Keep this in sync with the similar block in build/common.gypi
-    if (is_clang) {
-      cflags += [
-        # Many files use intrinsics without including this header.
-        # TODO(hans): Fix those files, or move this to sub-GYPs.
-        "/FIIntrin.h",
-      ]
-
-      if (visual_studio_version == "2013") {
-        cflags += [ "-fmsc-version=1800" ]
-      } else if (visual_studio_version == "2015") {
-        cflags += [ "-fmsc-version=1900" ]
-      }
-
-      if (current_cpu == "x86") {
-        cflags += [
-          "/fallback",
-          "-m32",
-        ]
-      } else {
-        cflags += [ "-m64" ]
-      }
-      if (exec_script("//build/win/use_ansi_codes.py", [], "trim string") ==
-          "True") {
-        cflags += [
-          # cmd.exe doesn't understand ANSI escape codes by default,
-          # so only enable them if something emulating them is around.
-          "-fansi-escape-codes",
-        ]
-      }
-    }
   } else {
     # Common GCC compiler flags setup.
     # --------------------------------
@@ -123,7 +78,7 @@
     cflags_objcc += common_flags
 
     # Linker warnings.
-    if ((current_cpu != "arm") && !is_mac) {
+    if (current_cpu != "arm" && !is_mac) {
       # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
       ldflags += [ "-Wl,--fatal-warnings" ]
     }
@@ -131,49 +86,23 @@
     # Common options for AddressSanitizer, LeakSanitizer, ThreadSanitizer and
     # MemorySanitizer
     if (using_sanitizer) {
-      cflags += [
-        "-gline-tables-only",
-      ]
+      cflags += [ "-gline-tables-only" ]
     }
     if (is_asan) {
-      asan_blacklist_path =
-          rebase_path("//tools/memory/asan/blacklist.txt", root_build_dir)
-      cflags += [
-        "-fsanitize=address",
-        "-fsanitize-blacklist=$asan_blacklist_path",
-      ]
-      if (is_mac) {
-        cflags += [ "-mllvm -asan-globals=0" ]  # http://crbug.com/352073
-        # TODO(GYP): deal with mac_bundles.
-      }
+      cflags += [ "-fsanitize=address" ]
+      ldflags += [ "-fsanitize=address" ]
     }
     if (is_lsan) {
       cflags += [ "-fsanitize=leak" ]
+      ldflags += [ "-fsanitize=leak" ]
     }
     if (is_tsan) {
-      tsan_blacklist_path =
-          rebase_path("//tools/memory/tsan_v2/ignores.txt", root_build_dir)
-      cflags += [
-        "-fsanitize=thread",
-        "-fsanitize-blacklist=$tsan_blacklist_path",
-      ]
+      cflags += [ "-fsanitize=thread" ]
+      ldflags += [ "-fsanitize=thread" ]
     }
     if (is_msan) {
-      msan_blacklist_path =
-          rebase_path("//tools/msan/blacklist.txt", root_build_dir)
-      cflags += [
-        "-fsanitize=memory",
-        "-fsanitize-memory-track-origins=$msan_track_origins",
-        "-fsanitize-blacklist=$msan_blacklist_path",
-      ]
-    }
-
-    if (use_custom_libcxx) {
-      cflags_cc += [ "-nostdinc++" ]
-      include_dirs = [
-        "//buildtools/third_party/libc++/trunk/include",
-        "//buildtools/third_party/libc++abi/trunk/include",
-      ]
+      cflags += [ "-fsanitize=memory" ]
+      ldflags += [ "-fsanitize=memory" ]
     }
   }
 
@@ -268,7 +197,6 @@
         ]
       }
     } else if (current_cpu == "arm") {
-
       cflags += [
         "-march=$arm_arch",
         "-mfloat-abi=$arm_float_abi",
@@ -303,7 +231,7 @@
       if (is_debug || is_release) {
         cflags += [
           "-fexceptions",
-          "-funwind-tables"
+          "-funwind-tables",
         ]
       }
 
@@ -364,9 +292,7 @@
   # Linux/Android common flags setup.
   # ---------------------------------
   if (is_linux || is_android) {
-    cflags += [
-      "-fPIC",
-    ]
+    cflags += [ "-fPIC" ]
 
     ldflags += [
       "-fPIC",
@@ -470,9 +396,9 @@
 #
 # How do you determine what should go in here vs. "compiler" above? Consider if
 # a target might choose to use a different runtime library (ignore for a moment
-# if this is possible or reasonable on your system). If such a target would want
-# to change or remove your option, put it in the runtime_library config. If a
-# target wants the option regardless, put it in the compiler config.
+# if this is possible or reasonable on your system). If such a target would
+# want to change or remove your option, put it in the runtime_library config.
+# If a target wants the option regardless, put it in the compiler config.
 
 config("runtime_library") {
   cflags = []
@@ -481,30 +407,13 @@
   lib_dirs = []
   libs = []
 
-  if (is_component_build) {
-    # Component mode: dynamic CRT.
-    defines += [ "COMPONENT_BUILD" ]
-    if (is_win) {
-      # Since the library is shared, it requires exceptions or will give errors
-      # about things not matching, so keep exceptions on.
-      if (is_debug) {
-        cflags += [ "/MDd" ]
-      } else {
-        cflags += [ "/MD" ]
-      }
-    }
-  } else {
-    # Static CRT.
-    if (is_win) {
-      if (is_debug) {
-        cflags += [ "/MTd" ]
-      } else {
-        cflags += [ "/MT" ]
-      }
-    }
-  }
-
+  # Static CRT.
   if (is_win) {
+    if (is_debug) {
+      cflags += [ "/MTd" ]
+    } else {
+      cflags += [ "/MT" ]
+    }
     defines += [
       "__STD_C",
       "_CRT_RAND_S",
@@ -590,114 +499,27 @@
 default_warning_flags = []
 default_warning_flags_cc = []
 if (is_win) {
-  if (!is_clang || current_cpu != "x86") {
+  if (current_cpu != "x86") {
     default_warning_flags += [ "/WX" ]  # Treat warnings as errors.
   }
 
   default_warning_flags += [
-    # Warnings permanently disabled:
+    # Permanent.
+    "/wd4091",  # typedef warning from dbghelp.h
 
-    # TODO(GYP) The GYP build doesn't have this globally enabled but disabled
-    # for a bunch of individual targets. Re-enable this globally when those
-    # targets are fixed.
-    "/wd4018",  # Comparing signed and unsigned values.
-
-    # C4127: conditional expression is constant
-    # This warning can in theory catch dead code and other problems, but
-    # triggers in far too many desirable cases where the conditional
-    # expression is either set by macros or corresponds some legitimate
-    # compile-time constant expression (due to constant template args,
-    # conditionals comparing the sizes of different types, etc.).  Some of
-    # these can be worked around, but it's not worth it.
-    "/wd4127",
-
-    # C4251: 'identifier' : class 'type' needs to have dll-interface to be
-    #        used by clients of class 'type2'
-    # This is necessary for the shared library build.
-    "/wd4251",
-
-    # C4351: new behavior: elements of array 'array' will be default
-    #        initialized
-    # This is a silly "warning" that basically just alerts you that the
-    # compiler is going to actually follow the language spec like it's
-    # supposed to, instead of not following it like old buggy versions did.
-    # There's absolutely no reason to turn this on.
-    "/wd4351",
-
-    # C4355: 'this': used in base member initializer list
-    # It's commonly useful to pass |this| to objects in a class' initializer
-    # list.  While this warning can catch real bugs, most of the time the
-    # constructors in question don't attempt to call methods on the passed-in
-    # pointer (until later), and annotating every legit usage of this is
-    # simply more hassle than the warning is worth.
-    "/wd4355",
-
-    # C4503: 'identifier': decorated name length exceeded, name was
-    #        truncated
-    # This only means that some long error messages might have truncated
-    # identifiers in the presence of lots of templates.  It has no effect on
-    # program correctness and there's no real reason to waste time trying to
-    # prevent it.
-    "/wd4503",
-
-    # Warning C4589 says: "Constructor of abstract class ignores
-    # initializer for virtual base class." Disable this warning because it
-    # is flaky in VS 2015 RTM. It triggers on compiler generated
-    # copy-constructors in some cases.
-    "/wd4589",
-
-    # C4611: interaction between 'function' and C++ object destruction is
-    #        non-portable
-    # This warning is unavoidable when using e.g. setjmp/longjmp.  MSDN
-    # suggests using exceptions instead of setjmp/longjmp for C++, but
-    # Chromium code compiles without exception support.  We therefore have to
-    # use setjmp/longjmp for e.g. JPEG decode error handling, which means we
-    # have to turn off this warning (and be careful about how object
-    # destruction happens in such cases).
-    "/wd4611",
-
-    # Warnings to evaluate and possibly fix/reenable later:
-
-    "/wd4100",  # Unreferenced formal function parameter.
-    "/wd4121",  # Alignment of a member was sensitive to packing.
-    "/wd4244",  # Conversion: possible loss of data.
-    "/wd4481",  # Nonstandard extension: override specifier.
-    "/wd4505",  # Unreferenced local function has been removed.
-    "/wd4510",  # Default constructor could not be generated.
-    "/wd4512",  # Assignment operator could not be generated.
-    "/wd4610",  # Class can never be instantiated, constructor required.
-    "/wd4996",  # Deprecated function warning.
+    # Investigate.
+    "/wd4312",  # int to pointer of greater size conversion.
+    "/wd4838",  # Narrowing conversion required.
+    "/wd4172",  # Returning address of local.
+    "/wd4005",  # Redefinition of macros for PRId64 etc.
+    "/wd4311",  # Pointer truncation from PVOID to DWORD.
+    "/wd4477",  # Format string requires wchar_t*
   ]
-
-  # VS xtree header file needs to be patched or 4702 (unreachable code
-  # warning) is reported if _HAS_EXCEPTIONS=0. Disable the warning if xtree is
-  # not patched.
-  if (!msvs_xtree_patched &&
-      exec_script("../../win_is_xtree_patched.py", [], "value") == 0) {
-    default_warning_flags += [ "/wd4702" ]  # Unreachable code.
-  }
-
-  # Building with Clang on Windows is a work in progress and very
-  # experimental. See crbug.com/82385.
-  # Keep this in sync with the similar block in build/common.gypi
-  if (is_clang) {
-    default_warning_flags += [
-      # TODO(hans): Make this list shorter eventually, http://crbug.com/504657
-      "-Qunused-arguments",  # http://crbug.com/504658
-      "-Wno-microsoft",  # http://crbug.com/505296
-      "-Wno-switch",  # http://crbug.com/505308
-      "-Wno-unknown-pragmas",  # http://crbug.com/505314
-      "-Wno-unused-function",  # http://crbug.com/505316
-      "-Wno-unused-value",  # http://crbug.com/505318
-      "-Wno-unused-local-typedef",  # http://crbug.com/411648
-    ]
-  }
 } else {
   # Common GCC warning setup.
   default_warning_flags += [
     # Enables.
     "-Wendif-labels",  # Weird old-style text after an #endif.
-    "-Werror",  # Warnings as errors.
 
     # Disables.
     "-Wno-missing-field-initializers",  # "struct foo f = {0};"
@@ -758,11 +580,14 @@
 
 config("chromium_code") {
   if (is_win) {
-    cflags = [ "/W4" ]  # Warning level 4.
+    # TODO(zra): Enable higher warning levels.
+    # cflags = [ "/W4" ]  # Warning level 4.
+    cflags = []
   } else {
     cflags = [
       "-Wall",
       "-Wextra",
+      "-Werror",
     ]
 
     defines = []
@@ -787,12 +612,6 @@
   defines = []
 
   if (is_win) {
-    cflags += [
-      "/W3",  # Warning level 3.
-      "/wd4800",  # Disable warning when forcing value to bool.
-      "/wd4267",  # TODO(jschuh): size_t to int.
-      "/wd4996",  # Deprecated function warning.
-    ]
     defines += [
       "_CRT_NONSTDC_NO_WARNINGS",
       "_CRT_NONSTDC_NO_DEPRECATE",
@@ -897,7 +716,7 @@
   if (is_win) {
     # Favor size over speed, /O1 must be before the common flags. The GYP
     # build also specifies /Os and /GF but these are implied by /O1.
-    cflags = [ "/O1" ] + common_optimize_on_cflags + [ "/Oi" ]
+    cflags = [ "/O2" ] + common_optimize_on_cflags + [ "/Oi" ]
   } else if (is_android) {
     cflags = [ "-Os" ] + common_optimize_on_cflags  # Favor size over speed.
   } else {
@@ -909,10 +728,11 @@
 # Turn off optimizations.
 config("no_optimize") {
   if (is_win) {
+    # The only difference on windows is that the inlining is less aggressive.
+    # (We accept the default level). Otherwise it is very slow.
     cflags = [
-      "/Od",  # Disable optimization.
-      "/Ob0",  # Disable all inlining (on by default).
-      "/RTC1",  # Runtime checks for stack frame and uninitialized variables.
+      "/O2",  # Do some optimizations.
+      "/Oy-",  # Disable omitting frame pointers, must be after /O2.
     ]
   } else if (is_android) {
     # On Android we kind of optimize some things that don't affect debugging
diff --git a/build/config/fnl/BUILD.gn b/build/config/fnl/BUILD.gn
deleted file mode 100644
index 0eb35e3..0000000
--- a/build/config/fnl/BUILD.gn
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import("//build/config/linux/pkg_config.gni")
-import("//build/config/features.gni")
-import("//build/config/sysroot.gni")
-import("//build/config/ui.gni")
-
-config("sdk") {
-  if (sysroot != "") {
-    cflags = [ "--sysroot=" + sysroot ]
-    ldflags = [ "--sysroot=" + sysroot ]
-
-    # Need to get some linker flags out of the sysroot.
-    ldflags += [ exec_script("../linux/sysroot_ld_path.py",
-                             [
-                               rebase_path("//build/linux/sysroot_ld_path.sh",
-                                           root_build_dir),
-                               sysroot,
-                             ],
-                             "value") ]
-  }
-
-  defines = [ "FNL_MUSL" ]
-
-  if (use_ozone) {
-    defines += [ "MESA_EGL_NO_X11_HEADERS" ]
-  }
-}
-
-config("fontconfig") {
-  libs = [ "fontconfig" ]
-}
-
-pkg_config("freetype2") {
-  packages = [ "freetype2" ]
-}
-
-if (use_evdev_gestures) {
-  pkg_config("libevdev-cros") {
-    packages = [ "libevdev-cros" ]
-  }
-
-  pkg_config("libgestures") {
-    packages = [ "libgestures" ]
-  }
-}
diff --git a/build/config/ios/BUILD.gn b/build/config/ios/BUILD.gn
deleted file mode 100644
index 0292315..0000000
--- a/build/config/ios/BUILD.gn
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import("//build/config/sysroot.gni")
-import("//build/config/ios/ios_sdk.gni")
-
-config("sdk") {
-  common_flags = [
-    "-stdlib=libc++",
-  ]
-
-  cflags = common_flags
-  ldflags = common_flags
-}
diff --git a/build/config/ios/XcodeHarness/.gitignore b/build/config/ios/XcodeHarness/.gitignore
deleted file mode 100644
index 89c499e..0000000
--- a/build/config/ios/XcodeHarness/.gitignore
+++ /dev/null
@@ -1,18 +0,0 @@
-# Xcode
-.DS_Store
-build/
-*.pbxuser
-!default.pbxuser
-*.mode1v3
-!default.mode1v3
-*.mode2v3
-!default.mode2v3
-*.perspectivev3
-!default.perspectivev3
-*.xcworkspace
-!default.xcworkspace
-xcuserdata
-profile
-*.moved-aside
-DerivedData
-.idea/
diff --git a/build/config/ios/XcodeHarness/FakeMain.m b/build/config/ios/XcodeHarness/FakeMain.m
deleted file mode 100644
index 5ddbd34..0000000
--- a/build/config/ios/XcodeHarness/FakeMain.m
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#import <Foundation/Foundation.h>
-
-int main(int argc, char* argv[]) {
-  NSCAssert(NO, @"Placeholder for Xcode. Should never be run");
-  return EXIT_FAILURE;
-}
diff --git a/build/config/ios/find_signing_identity.py b/build/config/ios/find_signing_identity.py
deleted file mode 100644
index 2fe67f9..0000000
--- a/build/config/ios/find_signing_identity.py
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/python
-# Copyright (c) 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import subprocess
-import sys
-import re
-
-def ListIdentities():
-  return subprocess.check_output([
-    '/usr/bin/env',
-    'xcrun',
-    'security',
-    'find-identity',
-    '-v',
-    '-p',
-    'codesigning',
-  ]).strip()
-
-
-def FindValidIdentity():
-  lines = ListIdentities().splitlines()
-  # Look for something like "2) XYZ "iPhone Developer: Name (ABC)""
-  exp = re.compile('.*\) ([A-F|0-9]*)(.*)')
-  for line in lines:
-    res = exp.match(line)
-    if res is None:
-      continue
-    if "iPhone Developer: Google Development" in res.group(2):
-      return res.group(1)
-  return ""
-
-
-if __name__ == '__main__':
-  print FindValidIdentity()
diff --git a/build/config/ios/ios_app.py b/build/config/ios/ios_app.py
deleted file mode 100644
index b8bf544..0000000
--- a/build/config/ios/ios_app.py
+++ /dev/null
@@ -1,137 +0,0 @@
-#!/usr/bin/python
-# Copyright (c) 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import argparse
-import os
-import errno
-import subprocess
-import sys
-
-PLUTIL = [
-  '/usr/bin/env',
-  'xcrun',
-  'plutil'
-]
-
-def MakeDirectories(path):
-  try:
-    os.makedirs(path)
-  except OSError as exc:
-    if exc.errno == errno.EEXIST and os.path.isdir(path):
-      return 0
-    else:
-      return -1
-
-  return 0
-
-
-def ProcessInfoPlist(args):
-  output_plist_file = os.path.abspath(os.path.join(args.output, 'Info.plist'))
-
-  if MakeDirectories(os.path.dirname(output_plist_file)) == -1:
-    return -1
-
-  return subprocess.check_call( PLUTIL + [
-    '-convert',
-    'binary1',
-    '-o',
-    output_plist_file,
-    '--',
-    args.input,
-  ])
-
-
-def PerformCodeSigning(args):
-  return subprocess.check_call([
-    '/usr/bin/env',
-    'xcrun',
-    'codesign',
-    '--entitlements',
-    args.entitlements_path,
-    '--sign',
-    args.identity,
-    '-f',
-    args.application_path,
-  ])
-
-def GenerateDSYM(args):
-  return subprocess.check_call([
-    '/usr/bin/env',
-    'xcrun',
-    'dsymutil',
-    '-o',
-    args.output,
-    args.executable_path
-  ])
-
-
-def GenerateProjectStructure(args):
-  application_path = os.path.join( args.dir, args.name + ".app" )
-  return MakeDirectories( application_path )
-
-
-def Main():
-  parser = argparse.ArgumentParser(description='A script that aids in '
-                                   'the creation of an iOS application')
-
-  subparsers = parser.add_subparsers()
-
-  # Plist Parser
-
-  plist_parser = subparsers.add_parser('plist',
-                                       help='Process the Info.plist')
-  plist_parser.set_defaults(func=ProcessInfoPlist)
-  
-  plist_parser.add_argument('-i', dest='input', help='The input plist path')
-  plist_parser.add_argument('-o', dest='output', help='The output plist dir')
-
-  # Directory Structure Parser
-
-  dir_struct_parser = subparsers.add_parser('structure',
-                      help='Creates the directory of an iOS application')
-
-  dir_struct_parser.set_defaults(func=GenerateProjectStructure)
-
-  dir_struct_parser.add_argument('-d', dest='dir', help='Out directory')
-  dir_struct_parser.add_argument('-n', dest='name', help='App name')
-
-  # Code Signing
-
-  code_signing_parser = subparsers.add_parser('codesign',
-                        help='Code sign the specified application')
-
-  code_signing_parser.set_defaults(func=PerformCodeSigning)
-
-  code_signing_parser.add_argument('-p', dest='application_path', required=True,
-                                   help='The application path')
-  code_signing_parser.add_argument('-i', dest='identity', required=True,
-                                   help='The code signing identity to use')
-  code_signing_parser.add_argument('-e', dest='entitlements_path',
-                                   required=True,
-                                   help='The path to the entitlements .xcent')
-
-  # dSYM Generation
-
-  dsym_generation_parser = subparsers.add_parser('dsym',
-                        help='Generate a .dSYM file for an executable')
-
-  dsym_generation_parser.set_defaults(func=GenerateDSYM)
-
-  dsym_generation_parser.add_argument('-e', dest='executable_path',
-                                      required=True,
-                                      help='The executable path')
-  dsym_generation_parser.add_argument('-o', dest='output',
-                                      required=True,
-                                      help='The output file name')
-
-  # Engage!
-
-  args = parser.parse_args()
-  
-  return args.func(args)
-
-
-if __name__ == '__main__':
-  sys.exit(Main())
diff --git a/build/config/ios/ios_sdk.gni b/build/config/ios/ios_sdk.gni
deleted file mode 100644
index 65654a5..0000000
--- a/build/config/ios/ios_sdk.gni
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-declare_args() {
-  # SDK path to use. When empty this will use the default SDK based on the
-  # value of use_ios_simulator.
-  ios_sdk_path = ""
-
-  # Set to true when targeting a simulator build on iOS. False means that the
-  # target is for running on the device. The default value is to use the
-  # Simulator except when targeting GYP's Xcode builds (for compat with the
-  # existing GYP build).
-  use_ios_simulator = true
-
-  # Version of iOS that we're targeting.
-  ios_deployment_target = "6.0"
-
-  # The iOS Code signing identity to use
-  ios_code_signing_identity = ""
-
-  # The path to the iOS device SDK.
-  ios_device_sdk_path = ""
-
-  # The path to the iOS simulator SDK.
-  ios_simulator_sdk_path = ""
-}
-
-if (ios_device_sdk_path == "") {
-  _ios_device_sdk_result =
-      exec_script("ios_sdk.py", [ "iphoneos" ], "list lines")
-  ios_device_sdk_path = _ios_device_sdk_result[0]
-}
-
-if (ios_simulator_sdk_path == "") {
-  _ios_sim_sdk_result =
-      exec_script("ios_sdk.py", [ "iphonesimulator" ], "list lines")
-  ios_simulator_sdk_path = _ios_sim_sdk_result[0]
-}
-
-# Compute default target.
-if (use_ios_simulator) {
-  ios_sdk_path = ios_simulator_sdk_path
-} else {
-  ios_sdk_path = ios_device_sdk_path
-}
-
-if (use_ios_simulator) {
-  # Always disable code signing on the simulator
-  ios_code_signing_identity = ""
-} else {
-  # If an identity is not provided, look for one on the host
-  if (ios_code_signing_identity == "") {
-    _ios_identities = exec_script("find_signing_identity.py", 
-                                  [], "list lines")
-    ios_code_signing_identity = _ios_identities[0]
-  }
-}
diff --git a/build/config/ios/ios_sdk.py b/build/config/ios/ios_sdk.py
deleted file mode 100644
index dfec4db..0000000
--- a/build/config/ios/ios_sdk.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import subprocess
-import sys
-
-# This script returns the path to the SDK of the given type. Pass the type of
-# SDK you want, which is typically "iphone" or "iphonesimulator".
-#
-# In the GYP build, this is done inside GYP itself based on the SDKROOT
-# variable.
-
-if len(sys.argv) != 2:
-  print "Takes one arg (SDK to find)"
-  sys.exit(1)
-
-print subprocess.check_output(['xcodebuild', '-version', '-sdk',
-                               sys.argv[1], 'Path']).strip()
diff --git a/build/config/ios/lldb_start_commands.txt b/build/config/ios/lldb_start_commands.txt
deleted file mode 100644
index 42e0b14..0000000
--- a/build/config/ios/lldb_start_commands.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-breakpoint set --name UIApplicationMain
-breakpoint set --name objc_exception_throw
-continue
-script print "........ Debugger break on main() ........"
diff --git a/build/config/ios/rules.gni b/build/config/ios/rules.gni
deleted file mode 100644
index 429c153..0000000
--- a/build/config/ios/rules.gni
+++ /dev/null
@@ -1,234 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-ios_app_script = "//build/config/ios/ios_app.py"
-
-template("code_sign_ios") {
-  assert(defined(invoker.entitlements_path),
-         "The path to the entitlements .xcent file")
-  assert(defined(invoker.identity),
-         "The code signing identity")
-  assert(defined(invoker.application_path),
-         "The application to code sign")
-  assert(defined(invoker.deps))
-
-  action(target_name) {
-    sources = [
-      invoker.entitlements_path,
-    ]
-
-    _application_path = invoker.application_path
-
-    script = ios_app_script
-
-    outputs = [
-      "$_application_path/_CodeSignature/CodeResources"
-    ]
-
-    args = [
-      "codesign",
-      "-p",
-      rebase_path(invoker.application_path, root_build_dir),
-      "-i",
-      invoker.identity,
-      "-e",
-      rebase_path(invoker.entitlements_path, root_build_dir),
-    ]
-
-    deps = invoker.deps
-  }
-}
-
-template("xcode_harness_ios") {
-  assert(defined(invoker.deps),
-         "The dependencies must be specified")
-  assert(defined(invoker.app_bundle),
-         "The app bundle must be defined")
-  assert(defined(invoker.app_name),
-         "The application name must be defined")
-  app_name = invoker.app_name
-
-  xcode_project_gen_target_name = app_name + "_xcode"
-  copy(xcode_project_gen_target_name) {
-    sources = [
-      "//build/config/ios/XcodeHarness/FakeMain.m",
-      "//build/config/ios/XcodeHarness/Harness.xcodeproj",
-    ]
-    outputs = [
-      "$root_build_dir/$xcode_project_gen_target_name/{{source_file_part}}",
-    ]
-  }
-
-  bundle_copy_gen_target_name = app_name + "_bundle_copy"
-  copy(bundle_copy_gen_target_name) {
-    sources = [
-      invoker.app_bundle
-    ]
-    outputs = [
-      "$root_build_dir/$xcode_project_gen_target_name/Application",
-    ]
-
-    deps = invoker.deps
-  }
-
-  group(target_name) {
-    deps = [
-      ":$xcode_project_gen_target_name",
-      ":$bundle_copy_gen_target_name",
-    ]
-  }
-}
-
-template("resource_copy_ios") {
-  assert(defined(invoker.resources),
-         "The source list of resources to copy over")
-  assert(defined(invoker.bundle_directory),
-         "The directory within the bundle to place the sources in")
-  assert(defined(invoker.app_name),
-         "The name of the application")
-
-  _bundle_directory = invoker.bundle_directory
-  _app_name = invoker.app_name
-  _resources = invoker.resources
-
-  copy(target_name) {
-    set_sources_assignment_filter([])
-    sources = _resources
-    outputs = [ "$root_build_dir/$_app_name.app/$_bundle_directory/{{source_file_part}}" ]
-
-    if (defined(invoker.deps)) {
-      deps = invoker.deps
-    }
-  }
-}
-
-template("ios_app") {
-
-  assert(defined(invoker.deps),
-         "Dependencies must be specified for $target_name")
-  assert(defined(invoker.info_plist),
-         "The application plist file must be specified for $target_name")
-  assert(defined(invoker.app_name),
-         "The name of iOS application for $target_name")
-  assert(defined(invoker.entitlements_path),
-         "The entitlements path must be specified for $target_name")
-  assert(defined(invoker.code_signing_identity),
-         "The entitlements path must be specified for $target_name")
-
-  # We just create a variable so we can use the same in interpolation
-  app_name = invoker.app_name
-
-  # Generate the project structure
-
-  struct_gen_target_name = target_name + "_struct"
-
-  action(struct_gen_target_name) {
-
-    script = ios_app_script
-
-    sources = []
-    outputs = [ "$root_build_dir/$app_name.app" ]
-
-    args = [
-      "structure",
-      "-d",
-      rebase_path(root_build_dir),
-      "-n",
-      app_name
-    ]
-
-  }
-
-  # Generate the executable
-
-  bin_gen_target_name = target_name + "_bin"
-
-  executable(bin_gen_target_name) {
-    libs = [
-      "AudioToolbox.framework",
-      "AVFoundation.framework",
-      "OpenGLES.framework",
-      "QuartzCore.framework",
-      "UIKit.framework",
-    ]
-    deps = invoker.deps
-    output_name = app_name
-  }
-
-  # Process the Info.plist
-
-  plist_gen_target_name = target_name + "_plist"
-
-  action(plist_gen_target_name) {
-
-    script = ios_app_script
-
-    sources = [ invoker.info_plist ]
-    outputs = [ "$root_build_dir/plist/$app_name/Info.plist" ]
-
-    args = [
-      "plist",
-      "-i",
-      rebase_path(invoker.info_plist, root_build_dir),
-      "-o",
-      rebase_path("$root_build_dir/plist/$app_name"),
-    ]
-  }
-
-  # Copy the generated binaries and assets to their appropriate locations
-
-  copy_gen_target_name = target_name + "_copy"
-  copy(copy_gen_target_name) {
-    sources = [
-      "$root_build_dir/plist/$app_name/Info.plist",
-      "$root_build_dir/$app_name",
-    ]
-
-    outputs = [
-      "$root_build_dir/$app_name.app/{{source_file_part}}"
-    ]
-
-    deps = [
-      ":$struct_gen_target_name",
-      ":$bin_gen_target_name",
-      ":$plist_gen_target_name",
-    ]
-  }
-
-  # Generate the Xcode Harness for Profiling
-
-  xcode_harness_gen_target_name = app_name + "_harness"
-  xcode_harness_ios(xcode_harness_gen_target_name) {
-    app_bundle = "$root_build_dir/$app_name.app"
-    deps = [
-      ":$bin_gen_target_name",
-      ":$struct_gen_target_name",
-      ":$copy_gen_target_name",
-    ]
-  }
-
-  # Perform Code Signing
-
-  code_sign_gen_target_name = target_name + "_codesign"
-  code_sign_ios(code_sign_gen_target_name) {
-    entitlements_path = invoker.entitlements_path
-    identity = invoker.code_signing_identity
-    application_path = "$root_build_dir/$app_name.app"
-    deps = [ ":$copy_gen_target_name" ]
-  }
-
-  # Top level group
-
-  group(target_name) {
-    # Skip code signing if no identity is provided. This is useful for simulator
-    # builds
-    deps = [ ":$xcode_harness_gen_target_name" ]
-    if (invoker.code_signing_identity == "") {
-      deps += [ ":$copy_gen_target_name" ]
-    } else {
-      deps += [ ":$code_sign_gen_target_name" ]
-    }
-  }
-
-}
diff --git a/build/config/linux/BUILD.gn b/build/config/linux/BUILD.gn
index 4b02a25..051809a 100644
--- a/build/config/linux/BUILD.gn
+++ b/build/config/linux/BUILD.gn
@@ -17,5 +17,14 @@
                                sysroot,
                              ],
                              "value") ]
+
+    # When using the pulled wheezy sysroot with gcc, we have to specify these
+    # excplicitly.
+    if (dart_use_wheezy_sysroot && !is_clang) {
+      cflags += [
+        "-I=/usr/include/c++/4.6",
+        "-I=/usr/include/c++/4.6/i486-linux-gnu",
+      ]
+    }
   }
 }
diff --git a/build/config/mac/BUILD.gn b/build/config/mac/BUILD.gn
index 132e12c..02aae66 100644
--- a/build/config/mac/BUILD.gn
+++ b/build/config/mac/BUILD.gn
@@ -5,9 +5,7 @@
 import("//build/config/sysroot.gni")
 
 config("sdk") {
-  common_flags = [
-    "-stdlib=libc++",
-  ]
+  common_flags = [ "-stdlib=libc++" ]
 
   cflags = common_flags
   ldflags = common_flags
@@ -19,6 +17,10 @@
     "-Wl,-search_paths_first",
     "-L.",
 
+    # Forces shared libraries to search for undefined symbols.
+    "-undefined",
+    "dynamic_lookup",
+
     # Path for loading shared libraries for unbundled binaries.
     "-Wl,-rpath,@loader_path/.",
 
diff --git a/build/config/mac/mac_sdk.gni b/build/config/mac/mac_sdk.gni
index 54b68c4..e0a3abc 100644
--- a/build/config/mac/mac_sdk.gni
+++ b/build/config/mac/mac_sdk.gni
@@ -2,8 +2,6 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
-import("//build/config/chrome_build.gni")
-
 declare_args() {
   # Minimum supported version of the Mac SDK.
   mac_sdk_min = "10.8"
@@ -14,16 +12,10 @@
   mac_sdk_path = ""
 }
 
-find_sdk_args = [ "--print_sdk_path" ]
-if (is_chrome_branded && is_official_build) {
-  find_sdk_args += [
-    "--verify",
-    mac_sdk_min,
-    "--sdk_path=" + mac_sdk_path,
-  ]
-} else {
-  find_sdk_args += [ mac_sdk_min ]
-}
+find_sdk_args = [
+  "--print_sdk_path",
+  mac_sdk_min,
+]
 
 # The tool will print the SDK path on the first line, and the version on the
 # second line.
diff --git a/build/config/mac/rules.gni b/build/config/mac/rules.gni
index 66f0de4..54b5a6c 100644
--- a/build/config/mac/rules.gni
+++ b/build/config/mac/rules.gni
@@ -7,10 +7,8 @@
 template("code_sign_mac") {
   assert(defined(invoker.entitlements_path),
          "The path to the entitlements .xcent file")
-  assert(defined(invoker.identity),
-         "The code signing identity")
-  assert(defined(invoker.application_path),
-         "The application to code sign")
+  assert(defined(invoker.identity), "The code signing identity")
+  assert(defined(invoker.application_path), "The application to code sign")
   assert(defined(invoker.deps))
 
   action(target_name) {
@@ -23,7 +21,7 @@
     script = mac_app_script
 
     outputs = [
-      "$_application_path/_CodeSignature/CodeResources"
+      "$_application_path/_CodeSignature/CodeResources",
     ]
 
     args = [
@@ -41,12 +39,9 @@
 }
 
 template("process_nibs_mac") {
-  assert(defined(invoker.sources),
-         "The nib sources must be specified")
-  assert(defined(invoker.module),
-         "The nib module must be specified")
-  assert(defined(invoker.output_dir),
-         "The output directory must be specified")
+  assert(defined(invoker.sources), "The nib sources must be specified")
+  assert(defined(invoker.module), "The nib module must be specified")
+  assert(defined(invoker.output_dir), "The output directory must be specified")
 
   action_foreach(target_name) {
     sources = invoker.sources
@@ -56,7 +51,7 @@
     invoker_out_dir = invoker.output_dir
 
     outputs = [
-      "$root_build_dir/$invoker_out_dir/{{source_name_part}}.nib"
+      "$root_build_dir/$invoker_out_dir/{{source_name_part}}.nib",
     ]
 
     args = [
@@ -76,8 +71,7 @@
          "The source list of resources to copy over")
   assert(defined(invoker.bundle_directory),
          "The directory within the bundle to place the sources in")
-  assert(defined(invoker.app_name),
-         "The name of the application")
+  assert(defined(invoker.app_name), "The name of the application")
 
   _bundle_directory = invoker.bundle_directory
   _app_name = invoker.app_name
@@ -86,7 +80,9 @@
   copy(target_name) {
     set_sources_assignment_filter([])
     sources = _resources
-    outputs = [ "$root_build_dir/$_app_name.app/$_bundle_directory/Contents/Resources/{{source_file_part}}" ]
+    outputs = [
+      "$root_build_dir/$_app_name.app/$_bundle_directory/Contents/Resources/{{source_file_part}}",
+    ]
 
     if (defined(invoker.deps)) {
       deps = invoker.deps
@@ -95,7 +91,6 @@
 }
 
 template("mac_app") {
-
   assert(defined(invoker.deps),
          "Dependencies must be specified for $target_name")
   assert(defined(invoker.info_plist),
@@ -104,6 +99,7 @@
          "The name of Mac application for $target_name")
   assert(defined(invoker.xibs),
          "The list of XIB files must be specified for $target_name")
+
   # assert(defined(invoker.entitlements_path),
   #        "The entitlements path must be specified for $target_name")
   # assert(defined(invoker.code_signing_identity),
@@ -117,20 +113,20 @@
   struct_gen_target_name = target_name + "_struct"
 
   action(struct_gen_target_name) {
-
     script = mac_app_script
 
     sources = []
-    outputs = [ "$root_build_dir/$app_name.app" ]
+    outputs = [
+      "$root_build_dir/$app_name.app",
+    ]
 
     args = [
       "structure",
       "-d",
       rebase_path(root_build_dir),
       "-n",
-      app_name
+      app_name,
     ]
-
   }
 
   # Generate the executable
@@ -147,11 +143,14 @@
   plist_gen_target_name = target_name + "_plist"
 
   action(plist_gen_target_name) {
-
     script = mac_app_script
 
-    sources = [ invoker.info_plist ]
-    outputs = [ "$root_build_dir/plist/$app_name/Info.plist" ]
+    sources = [
+      invoker.info_plist,
+    ]
+    outputs = [
+      "$root_build_dir/plist/$app_name/Info.plist",
+    ]
 
     args = [
       "plist",
@@ -171,7 +170,7 @@
     ]
 
     outputs = [
-      "$root_build_dir/$app_name.app/Contents/{{source_file_part}}"
+      "$root_build_dir/$app_name.app/Contents/{{source_file_part}}",
     ]
 
     deps = [
@@ -186,7 +185,7 @@
     ]
 
     outputs = [
-      "$root_build_dir/$app_name.app/Contents/MacOS/{{source_file_part}}"
+      "$root_build_dir/$app_name.app/Contents/MacOS/{{source_file_part}}",
     ]
 
     deps = [
@@ -204,17 +203,18 @@
   copy_all_target_name = target_name + "_all_copy"
   group(copy_all_target_name) {
     deps = [
-      ":$struct_gen_target_name",
-      ":$copy_plist_gen_target_name",
       ":$copy_bin_target_name",
+      ":$copy_plist_gen_target_name",
       ":$copy_xib_target_name",
+      ":$struct_gen_target_name",
     ]
   }
 
   # Top level group
 
   group(target_name) {
-    deps = [ ":$copy_all_target_name" ]
+    deps = [
+      ":$copy_all_target_name",
+    ]
   }
-
 }
diff --git a/build/config/sysroot.gni b/build/config/sysroot.gni
index 37faae0..bb29e6c 100644
--- a/build/config/sysroot.gni
+++ b/build/config/sysroot.gni
@@ -9,6 +9,20 @@
   # The absolute path of the sysroot that is applied when compiling using
   # the target toolchain.
   target_sysroot = ""
+
+  # Whether the Debian wheezy sysroot should be used.
+  dart_use_wheezy_sysroot = false
+}
+
+if (is_linux && dart_use_wheezy_sysroot) {
+  if (current_cpu == "x86") {
+    target_sysroot = rebase_path("//build/linux/debian_wheezy_i386-sysroot")
+  } else if (current_cpu == "x64") {
+    target_sysroot = rebase_path("//build/linux/debian_wheezy_amd64-sysroot")
+  } else {
+    print("There is no Debian wheezy sysroot present for $current_cpu")
+    assert(false)
+  }
 }
 
 if (current_toolchain == default_toolchain && target_sysroot != "") {
diff --git a/build/config/templates/templates.gni b/build/config/templates/templates.gni
index ae00fca..72d09c0 100644
--- a/build/config/templates/templates.gni
+++ b/build/config/templates/templates.gni
@@ -23,25 +23,28 @@
     testonly = invoker.testonly
   }
 
-  assert(defined(invoker.input),
-      "The input file must be specified")
-  assert(defined(invoker.output),
-      "The output file must be specified")
+  assert(defined(invoker.input), "The input file must be specified")
+  assert(defined(invoker.output), "The output file must be specified")
   assert(defined(invoker.variables),
-      "The variable used for substitution in templates must be specified")
+         "The variable used for substitution in templates must be specified")
 
   variables = invoker.variables
 
   action(target_name) {
-    if(defined(invoker.visibility)) {
+    if (defined(invoker.visibility)) {
       visibility = invoker.visibility
     }
 
     script = "//build/android/gyp/jinja_template.py"
     depfile = "$target_gen_dir/$target_name.d"
 
-    sources = [ invoker.input ]
-    outputs = [ invoker.output, depfile ]
+    sources = [
+      invoker.input,
+    ]
+    outputs = [
+      invoker.output,
+      depfile,
+    ]
 
     args = [
       "--inputs",
@@ -50,7 +53,7 @@
       rebase_path(invoker.output, root_build_dir),
       "--depfile",
       rebase_path(depfile, root_build_dir),
-      "--variables=${variables}"
+      "--variables=${variables}",
     ]
   }
 }
diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn
index c939100..ed6583e 100644
--- a/build/config/win/BUILD.gn
+++ b/build/config/win/BUILD.gn
@@ -65,6 +65,7 @@
     "/FIXED:NO",
     "/ignore:4199",
     "/ignore:4221",
+    "/ignore:4197",  # Disable multiple Dart_True export warning.
     "/NXCOMPAT",
 
     # Suggested by Microsoft Devrel to avoid
@@ -85,17 +86,9 @@
   } else {
     ldflags += [ "/DYNAMICBASE" ]
   }
-
-  # Delay loaded DLLs.
-  ldflags += [
-    "/DELAYLOAD:dbghelp.dll",
-    "/DELAYLOAD:dwmapi.dll",
-    "/DELAYLOAD:shell32.dll",
-    "/DELAYLOAD:uxtheme.dll",
-  ]
 }
 
-# Subsystem --------------------------------------------------------------------
+# Subsystem -------------------------------------------------------------------
 
 # This is appended to the subsystem to specify a minimum version.
 if (current_cpu == "x64") {
@@ -114,7 +107,7 @@
   ldflags = [ "/SUBSYSTEM:WINDOWS$subsystem_version_suffix" ]
 }
 
-# Incremental linking ----------------------------------------------------------
+# Incremental linking ---------------------------------------------------------
 
 incremental_linking_on_switch = [ "/INCREMENTAL" ]
 incremental_linking_off_switch = [ "/INCREMENTAL:NO" ]
@@ -151,7 +144,7 @@
   }
 }
 
-# Character set ----------------------------------------------------------------
+# Character set ---------------------------------------------------------------
 
 # Not including this config means "ansi" (8-bit system codepage).
 config("unicode") {
@@ -161,7 +154,7 @@
   ]
 }
 
-# Lean and mean ----------------------------------------------------------------
+# Lean and mean ---------------------------------------------------------------
 
 # Some third party code might not compile with WIN32_LEAN_AND_MEAN so we have
 # to have a separate config for it. Remove this config from your target to
diff --git a/build/config/win/visual_studio_version.gni b/build/config/win/visual_studio_version.gni
index 6a2828c..782d8e8 100644
--- a/build/config/win/visual_studio_version.gni
+++ b/build/config/win/visual_studio_version.gni
@@ -23,13 +23,13 @@
 }
 
 if (visual_studio_path == "") {
-  toolchain_data =
+  _toolchain_data =
       exec_script("../../vs_toolchain.py", [ "get_toolchain_dir" ], "scope")
-  visual_studio_path = toolchain_data.vs_path
-  windows_sdk_path = toolchain_data.sdk_path
-  visual_studio_version = toolchain_data.vs_version
-  wdk_path = toolchain_data.wdk_dir
-  visual_studio_runtime_dirs = toolchain_data.runtime_dirs
+  visual_studio_path = _toolchain_data.vs_path
+  windows_sdk_path = _toolchain_data.sdk_path
+  visual_studio_version = _toolchain_data.vs_version
+  wdk_path = _toolchain_data.wdk_dir
+  visual_studio_runtime_dirs = _toolchain_data.runtime_dirs
 } else {
   assert(visual_studio_version != "",
          "You must set the visual_studio_version if you set the path")
diff --git a/build/copy_test_data_ios.gypi b/build/copy_test_data_ios.gypi
deleted file mode 100644
index 576a0f2..0000000
--- a/build/copy_test_data_ios.gypi
+++ /dev/null
@@ -1,53 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into an action to copy test data files into
-# an iOS app bundle. To use this the following variables need to be defined:
-#   test_data_files: list: paths to test data files or directories
-#   test_data_prefix: string: a directory prefix that will be prepended to each
-#                             output path.  Generally, this should be the base
-#                             directory of the gypi file containing the unittest
-#                             target (e.g. "base" or "chrome").
-#
-# To use this, create a gyp target with the following form:
-# {
-#   'target_name': 'my_unittests',
-#   'conditions': [
-#     ['OS == "ios"', {
-#       'actions': [
-#         {
-#           'action_name': 'copy_test_data',
-#           'variables': {
-#             'test_data_files': [
-#               'path/to/datafile.txt',
-#               'path/to/data/directory/',
-#             ]
-#             'test_data_prefix' : 'prefix',
-#           },
-#           'includes': ['path/to/this/gypi/file'],
-#         },
-#       ],
-#     }],
-# }
-#
-
-{
-  'inputs': [
-    # The |-o <(test_data_prefix)| is ignored; it is there to work around a
-    # caching bug in gyp (https://code.google.com/p/gyp/issues/detail?id=112).
-    # It caches command output when the string is the same, so if two copy
-    # steps have the same relative paths, there can be bogus cache hits that
-    # cause compile failures unless something varies.
-    '<!@pymod_do_main(copy_test_data_ios -o <(test_data_prefix) --inputs <(test_data_files))',
-  ],
-  'outputs': [
-    '<!@pymod_do_main(copy_test_data_ios -o <(PRODUCT_DIR)/<(_target_name).app/<(test_data_prefix) --outputs <(test_data_files))',
-  ],
-  'action': [
-    'python',
-    '<(DEPTH)/build/copy_test_data_ios.py',
-    '-o', '<(PRODUCT_DIR)/<(_target_name).app/<(test_data_prefix)',
-    '<@(_inputs)',
-  ],
-}
diff --git a/build/copy_test_data_ios.py b/build/copy_test_data_ios.py
deleted file mode 100755
index 6f0302f..0000000
--- a/build/copy_test_data_ios.py
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Copies test data files or directories into a given output directory."""
-
-import optparse
-import os
-import shutil
-import sys
-
-class WrongNumberOfArgumentsException(Exception):
-  pass
-
-def EscapePath(path):
-  """Returns a path with spaces escaped."""
-  return path.replace(" ", "\\ ")
-
-def ListFilesForPath(path):
-  """Returns a list of all the files under a given path."""
-  output = []
-  # Ignore revision control metadata directories.
-  if (os.path.basename(path).startswith('.git') or
-      os.path.basename(path).startswith('.svn')):
-    return output
-
-  # Files get returned without modification.
-  if not os.path.isdir(path):
-    output.append(path)
-    return output
-
-  # Directories get recursively expanded.
-  contents = os.listdir(path)
-  for item in contents:
-    full_path = os.path.join(path, item)
-    output.extend(ListFilesForPath(full_path))
-  return output
-
-def CalcInputs(inputs):
-  """Computes the full list of input files for a set of command-line arguments.
-  """
-  # |inputs| is a list of paths, which may be directories.
-  output = []
-  for input in inputs:
-    output.extend(ListFilesForPath(input))
-  return output
-
-def CopyFiles(relative_filenames, output_basedir):
-  """Copies files to the given output directory."""
-  for file in relative_filenames:
-    relative_dirname = os.path.dirname(file)
-    output_dir = os.path.join(output_basedir, relative_dirname)
-    output_filename = os.path.join(output_basedir, file)
-
-    # In cases where a directory has turned into a file or vice versa, delete it
-    # before copying it below.
-    if os.path.exists(output_dir) and not os.path.isdir(output_dir):
-      os.remove(output_dir)
-    if os.path.exists(output_filename) and os.path.isdir(output_filename):
-      shutil.rmtree(output_filename)
-
-    if not os.path.exists(output_dir):
-      os.makedirs(output_dir)
-    shutil.copy(file, output_filename)
-
-def DoMain(argv):
-  parser = optparse.OptionParser()
-  usage = 'Usage: %prog -o <output_dir> [--inputs] [--outputs] <input_files>'
-  parser.set_usage(usage)
-  parser.add_option('-o', dest='output_dir')
-  parser.add_option('--inputs', action='store_true', dest='list_inputs')
-  parser.add_option('--outputs', action='store_true', dest='list_outputs')
-  options, arglist = parser.parse_args(argv)
-
-  if len(arglist) == 0:
-    raise WrongNumberOfArgumentsException('<input_files> required.')
-
-  files_to_copy = CalcInputs(arglist)
-  escaped_files = [EscapePath(x) for x in CalcInputs(arglist)]
-  if options.list_inputs:
-    return '\n'.join(escaped_files)
-
-  if not options.output_dir:
-    raise WrongNumberOfArgumentsException('-o required.')
-
-  if options.list_outputs:
-    outputs = [os.path.join(options.output_dir, x) for x in escaped_files]
-    return '\n'.join(outputs)
-
-  CopyFiles(files_to_copy, options.output_dir)
-  return
-
-def main(argv):
-  try:
-    result = DoMain(argv[1:])
-  except WrongNumberOfArgumentsException, e:
-    print >>sys.stderr, e
-    return 1
-  if result:
-    print result
-  return 0
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv))
diff --git a/build/cp.py b/build/cp.py
deleted file mode 100755
index 0f32536..0000000
--- a/build/cp.py
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Copy a file.
-
-This module works much like the cp posix command - it takes 2 arguments:
-(src, dst) and copies the file with path |src| to |dst|.
-"""
-
-import os
-import shutil
-import sys
-
-
-def Main(src, dst):
-  # Use copy instead of copyfile to ensure the executable bit is copied.
-  return shutil.copy(src, os.path.normpath(dst))
-
-
-if __name__ == '__main__':
-  sys.exit(Main(sys.argv[1], sys.argv[2]))
diff --git a/build/dir_exists.py b/build/dir_exists.py
deleted file mode 100755
index 70d367e..0000000
--- a/build/dir_exists.py
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-"""Writes True if the argument is a directory."""
-
-import os.path
-import sys
-
-def main():
-  sys.stdout.write(_is_dir(sys.argv[1]))
-  return 0
-
-def _is_dir(dir_name):
-  return str(os.path.isdir(dir_name))
-
-def DoMain(args):
-  """Hook to be called from gyp without starting a separate python
-  interpreter."""
-  return _is_dir(args[0])
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/download_gold_plugin.py b/build/download_gold_plugin.py
deleted file mode 100755
index cd7ca41..0000000
--- a/build/download_gold_plugin.py
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Script to download LLVM gold plugin from google storage."""
-
-import json
-import os
-import shutil
-import subprocess
-import sys
-import zipfile
-
-SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
-CHROME_SRC = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir))
-sys.path.insert(0, os.path.join(CHROME_SRC, 'tools'))
-
-import find_depot_tools
-
-DEPOT_PATH = find_depot_tools.add_depot_tools_to_path()
-GSUTIL_PATH = os.path.join(DEPOT_PATH, 'gsutil.py')
-
-LLVM_BUILD_PATH = os.path.join(CHROME_SRC, 'third_party', 'llvm-build',
-                               'Release+Asserts')
-CLANG_UPDATE_PY = os.path.join(CHROME_SRC, 'tools', 'clang', 'scripts',
-                               'update.py')
-CLANG_REVISION = os.popen(CLANG_UPDATE_PY + ' --print-revision').read().rstrip()
-
-CLANG_BUCKET = 'gs://chromium-browser-clang/Linux_x64'
-
-def main():
-  targz_name = 'llvmgold-%s.tgz' % CLANG_REVISION
-  remote_path = '%s/%s' % (CLANG_BUCKET, targz_name)
-
-  os.chdir(LLVM_BUILD_PATH)
-
-  subprocess.check_call(['python', GSUTIL_PATH,
-                         'cp', remote_path, targz_name])
-  subprocess.check_call(['tar', 'xzf', targz_name])
-  os.remove(targz_name)
-  return 0
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/download_nacl_toolchains.py b/build/download_nacl_toolchains.py
deleted file mode 100755
index b99b940..0000000
--- a/build/download_nacl_toolchains.py
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Shim to run nacl toolchain download script only if there is a nacl dir."""
-
-import os
-import shutil
-import sys
-
-
-def Main(args):
-  # Exit early if disable_nacl=1.
-  if 'disable_nacl=1' in os.environ.get('GYP_DEFINES', ''):
-    return 0
-  script_dir = os.path.dirname(os.path.abspath(__file__))
-  src_dir = os.path.dirname(script_dir)
-  nacl_dir = os.path.join(src_dir, 'native_client')
-  nacl_build_dir = os.path.join(nacl_dir, 'build')
-  package_version_dir = os.path.join(nacl_build_dir, 'package_version')
-  package_version = os.path.join(package_version_dir, 'package_version.py')
-  if not os.path.exists(package_version):
-    print "Can't find '%s'" % package_version
-    print 'Presumably you are intentionally building without NativeClient.'
-    print 'Skipping NativeClient toolchain download.'
-    sys.exit(0)
-  sys.path.insert(0, package_version_dir)
-  import package_version
-
-  # BUG:
-  # We remove this --optional-pnacl argument, and instead replace it with
-  # --no-pnacl for most cases.  However, if the bot name is an sdk
-  # bot then we will go ahead and download it.  This prevents increasing the
-  # gclient sync time for developers, or standard Chrome bots.
-  if '--optional-pnacl' in args:
-    args.remove('--optional-pnacl')
-    use_pnacl = False
-    buildbot_name = os.environ.get('BUILDBOT_BUILDERNAME', '')
-    if 'pnacl' in buildbot_name and 'sdk' in buildbot_name:
-      use_pnacl = True
-    if use_pnacl:
-      print '\n*** DOWNLOADING PNACL TOOLCHAIN ***\n'
-    else:
-      args = ['--exclude', 'pnacl_newlib'] + args
-
-  # Only download the ARM gcc toolchain if we are building for ARM
-  # TODO(olonho): we need to invent more reliable way to get build
-  # configuration info, to know if we're building for ARM.
-  if 'target_arch=arm' not in os.environ.get('GYP_DEFINES', ''):
-      args = ['--exclude', 'nacl_arm_newlib'] + args
-
-  package_version.main(args)
-
-  return 0
-
-
-if __name__ == '__main__':
-  sys.exit(Main(sys.argv[1:]))
diff --git a/build/download_sdk_extras.py b/build/download_sdk_extras.py
deleted file mode 100755
index d7c5d6c..0000000
--- a/build/download_sdk_extras.py
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Script to download sdk/extras packages on the bots from google storage.
-
-The script expects arguments that specify zips file in the google storage
-bucket named: <dir in SDK extras>_<package name>_<version>.zip. The file will
-be extracted in the android_tools/sdk/extras directory on the test bots. This
-script will not do anything for developers.
-
-TODO(navabi): Move this script (crbug.com/459819).
-"""
-
-import json
-import os
-import shutil
-import subprocess
-import sys
-import zipfile
-
-SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
-CHROME_SRC = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir))
-sys.path.insert(0, os.path.join(SCRIPT_DIR, 'android'))
-sys.path.insert(1, os.path.join(CHROME_SRC, 'tools'))
-
-from pylib import constants
-import find_depot_tools
-
-DEPOT_PATH = find_depot_tools.add_depot_tools_to_path()
-GSUTIL_PATH = os.path.join(DEPOT_PATH, 'gsutil.py')
-SDK_EXTRAS_BUCKET = 'gs://chrome-sdk-extras'
-SDK_EXTRAS_PATH = os.path.join(constants.ANDROID_SDK_ROOT, 'extras')
-SDK_EXTRAS_JSON_FILE = os.path.join(os.path.dirname(__file__),
-                                    'android_sdk_extras.json')
-
-
-def clean_and_extract(dir_name, package_name, zip_file):
-  local_dir = '%s/%s/%s' % (SDK_EXTRAS_PATH, dir_name, package_name)
-  if os.path.exists(local_dir):
-    shutil.rmtree(local_dir)
-  local_zip = '%s/%s' % (SDK_EXTRAS_PATH, zip_file)
-  with zipfile.ZipFile(local_zip) as z:
-    z.extractall(path=SDK_EXTRAS_PATH)
-
-
-def main():
-  if not os.environ.get('CHROME_HEADLESS'):
-    # This is not a buildbot checkout.
-    return 0
-  # Update the android_sdk_extras.json file to update downloaded packages.
-  with open(SDK_EXTRAS_JSON_FILE) as json_file:
-    packages = json.load(json_file)
-  for package in packages:
-    local_zip = '%s/%s' % (SDK_EXTRAS_PATH, package['zip'])
-    if not os.path.exists(local_zip):
-      package_zip = '%s/%s' % (SDK_EXTRAS_BUCKET, package['zip'])
-      try:
-        subprocess.check_call(['python', GSUTIL_PATH, '--force-version', '4.7',
-                               'cp', package_zip, local_zip])
-      except subprocess.CalledProcessError:
-        print ('WARNING: Failed to download SDK packages. If this bot compiles '
-               'for Android, it may have errors.')
-        return 0
-    # Always clean dir and extract zip to ensure correct contents.
-    clean_and_extract(package['dir_name'], package['package'], package['zip'])
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/env_dump.py b/build/env_dump.py
deleted file mode 100755
index 21edfe6..0000000
--- a/build/env_dump.py
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/python
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This script can either source a file and dump the enironment changes done by
-# it, or just simply dump the current environment as JSON into a file.
-
-import json
-import optparse
-import os
-import pipes
-import subprocess
-import sys
-
-
-def main():
-  parser = optparse.OptionParser()
-  parser.add_option('-f', '--output-json',
-                    help='File to dump the environment as JSON into.')
-  parser.add_option(
-      '-d', '--dump-mode', action='store_true',
-      help='Dump the environment to sys.stdout and exit immediately.')
-
-  parser.disable_interspersed_args()
-  options, args = parser.parse_args()
-  if options.dump_mode:
-    if args or options.output_json:
-      parser.error('Cannot specify args or --output-json with --dump-mode.')
-    json.dump(dict(os.environ), sys.stdout)
-  else:
-    if not options.output_json:
-      parser.error('Requires --output-json option.')
-
-    envsetup_cmd = ' '.join(map(pipes.quote, args))
-    full_cmd = [
-        'bash', '-c',
-        '. %s > /dev/null; %s -d' % (envsetup_cmd, os.path.abspath(__file__))
-    ]
-    try:
-      output = subprocess.check_output(full_cmd)
-    except Exception as e:
-      sys.exit('Error running %s and dumping environment.' % envsetup_cmd)
-
-    env_diff = {}
-    new_env = json.loads(output)
-    for k, val in new_env.items():
-      if k == '_' or (k in os.environ and os.environ[k] == val):
-        continue
-      env_diff[k] = val
-    with open(options.output_json, 'w') as f:
-      json.dump(env_diff, f)
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/executable_suffix.gni b/build/executable_suffix.gni
new file mode 100644
index 0000000..e2b0dd8
--- /dev/null
+++ b/build/executable_suffix.gni
@@ -0,0 +1,9 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+if (defined(is_win) && is_win) {
+  executable_suffix = ".exe"
+} else {
+  executable_suffix = ""
+}
diff --git a/build/extract_from_cab.py b/build/extract_from_cab.py
deleted file mode 100755
index 080370c..0000000
--- a/build/extract_from_cab.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Extracts a single file from a CAB archive."""
-
-import os
-import shutil
-import subprocess
-import sys
-import tempfile
-
-def run_quiet(*args):
-  """Run 'expand' suppressing noisy output. Returns returncode from process."""
-  popen = subprocess.Popen(args, stdout=subprocess.PIPE)
-  out, _ = popen.communicate()
-  if popen.returncode:
-    # expand emits errors to stdout, so if we fail, then print that out.
-    print out
-  return popen.returncode
-
-def main():
-  if len(sys.argv) != 4:
-    print 'Usage: extract_from_cab.py cab_path archived_file output_dir'
-    return 1
-
-  [cab_path, archived_file, output_dir] = sys.argv[1:]
-
-  # Expand.exe does its work in a fixed-named temporary directory created within
-  # the given output directory. This is a problem for concurrent extractions, so
-  # create a unique temp dir within the desired output directory to work around
-  # this limitation.
-  temp_dir = tempfile.mkdtemp(dir=output_dir)
-
-  try:
-    # Invoke the Windows expand utility to extract the file.
-    level = run_quiet('expand', cab_path, '-F:' + archived_file, temp_dir)
-    if level == 0:
-      # Move the output file into place, preserving expand.exe's behavior of
-      # paving over any preexisting file.
-      output_file = os.path.join(output_dir, archived_file)
-      try:
-        os.remove(output_file)
-      except OSError:
-        pass
-      os.rename(os.path.join(temp_dir, archived_file), output_file)
-  finally:
-    shutil.rmtree(temp_dir, True)
-
-  if level != 0:
-    return level
-
-  # The expand utility preserves the modification date and time of the archived
-  # file. Touch the extracted file. This helps build systems that compare the
-  # modification times of input and output files to determine whether to do an
-  # action.
-  os.utime(os.path.join(output_dir, archived_file), None)
-  return 0
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/filename_rules.gypi b/build/filename_rules.gypi
deleted file mode 100644
index f67287f..0000000
--- a/build/filename_rules.gypi
+++ /dev/null
@@ -1,106 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This gypi file defines the patterns used for determining whether a
-# file is excluded from the build on a given platform.  It is
-# included by common.gypi for chromium_code.
-
-{
-  'target_conditions': [
-    ['OS!="win" or >(nacl_untrusted_build)==1', {
-      'sources/': [ ['exclude', '_win(_browsertest|_unittest)?\\.(h|cc)$'],
-                    ['exclude', '(^|/)win/'],
-                    ['exclude', '(^|/)win_[^/]*\\.(h|cc)$'] ],
-    }],
-    ['OS!="mac" or >(nacl_untrusted_build)==1', {
-      'sources/': [ ['exclude', '_(cocoa|mac)(_unittest)?\\.(h|cc|mm?)$'],
-                    ['exclude', '(^|/)(cocoa|mac)/'] ],
-    }],
-    ['OS!="ios" or >(nacl_untrusted_build)==1', {
-      'sources/': [ ['exclude', '_ios(_unittest)?\\.(h|cc|mm?)$'],
-                    ['exclude', '(^|/)ios/'] ],
-    }],
-    ['(OS!="mac" and OS!="ios") or >(nacl_untrusted_build)==1', {
-      'sources/': [ ['exclude', '\\.mm?$' ] ],
-    }],
-    # Do not exclude the linux files on *BSD since most of them can be
-    # shared at this point.
-    # In case a file is not needed, it is going to be excluded later on.
-    # TODO(evan): the above is not correct; we shouldn't build _linux
-    # files on non-linux.
-    ['OS!="linux" and OS!="openbsd" and OS!="freebsd" or >(nacl_untrusted_build)==1', {
-      'sources/': [
-        ['exclude', '_linux(_unittest)?\\.(h|cc)$'],
-        ['exclude', '(^|/)linux/'],
-      ],
-    }],
-    ['OS!="android" or _toolset=="host" or >(nacl_untrusted_build)==1', {
-      'sources/': [
-        ['exclude', '_android(_unittest)?\\.(h|cc)$'],
-        ['exclude', '(^|/)android/'],
-      ],
-    }],
-    ['OS=="win" and >(nacl_untrusted_build)==0', {
-      'sources/': [
-        ['exclude', '_posix(_unittest)?\\.(h|cc)$'],
-        ['exclude', '(^|/)posix/'],
-      ],
-    }],
-    ['<(chromeos)!=1 or >(nacl_untrusted_build)==1', {
-      'sources/': [
-        ['exclude', '_chromeos(_unittest)?\\.(h|cc)$'],
-        ['exclude', '(^|/)chromeos/'],
-      ],
-    }],
-    ['>(nacl_untrusted_build)==0', {
-      'sources/': [
-        ['exclude', '_nacl(_unittest)?\\.(h|cc)$'],
-      ],
-    }],
-    ['OS!="linux" and OS!="openbsd" and OS!="freebsd" or >(nacl_untrusted_build)==1', {
-      'sources/': [
-        ['exclude', '_xdg(_unittest)?\\.(h|cc)$'],
-      ],
-    }],
-    ['<(use_x11)!=1 or >(nacl_untrusted_build)==1', {
-      'sources/': [
-        ['exclude', '_(x|x11)(_interactive_uitest|_unittest)?\\.(h|cc)$'],
-        ['exclude', '(^|/)x11_[^/]*\\.(h|cc)$'],
-        ['exclude', '(^|/)x11/'],
-        ['exclude', '(^|/)x/'],
-      ],
-    }],
-    ['<(toolkit_views)==0 or >(nacl_untrusted_build)==1', {
-      'sources/': [ ['exclude', '_views(_browsertest|_unittest)?\\.(h|cc)$'] ]
-    }],
-    ['<(use_aura)==0 or >(nacl_untrusted_build)==1', {
-      'sources/': [ ['exclude', '_aura(_browsertest|_unittest)?\\.(h|cc)$'],
-                    ['exclude', '(^|/)aura/'],
-      ]
-    }],
-    ['<(use_aura)==0 or <(use_x11)==0 or >(nacl_untrusted_build)==1', {
-      'sources/': [ ['exclude', '_aurax11(_browsertest|_unittest)?\\.(h|cc)$'] ]
-    }],
-    ['<(use_aura)==0 or OS!="win" or >(nacl_untrusted_build)==1', {
-      'sources/': [ ['exclude', '_aurawin\\.(h|cc)$'] ]
-    }],
-    ['<(use_aura)==0 or OS!="linux" or >(nacl_untrusted_build)==1', {
-      'sources/': [ ['exclude', '_auralinux\\.(h|cc)$'] ]
-    }],
-    ['<(use_ash)==0 or >(nacl_untrusted_build)==1', {
-      'sources/': [ ['exclude', '_ash(_browsertest|_unittest)?\\.(h|cc)$'],
-                    ['exclude', '(^|/)ash/'],
-      ]
-    }],
-    ['<(use_ash)==0 or OS!="win" or >(nacl_untrusted_build)==1', {
-      'sources/': [ ['exclude', '_ashwin\\.(h|cc)$'] ]
-    }],
-    ['<(use_ozone)==0 or >(nacl_untrusted_build)==1', {
-      'sources/': [ ['exclude', '_ozone(_browsertest|_unittest)?\\.(h|cc)$'] ]
-    }],
-    ['<(use_pango)==0', {
-      'sources/': [ ['exclude', '(^|_)pango(_util|_browsertest|_unittest)?\\.(h|cc)$'], ],
-    }],
-  ]
-}
diff --git a/build/find_isolated_tests.py b/build/find_isolated_tests.py
deleted file mode 100755
index c5b3ab7..0000000
--- a/build/find_isolated_tests.py
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Scans build output directory for .isolated files, calculates their SHA1
-hashes, stores final list in JSON document and then removes *.isolated files
-found (to ensure no stale *.isolated stay around on the next build).
-
-Used to figure out what tests were build in isolated mode to trigger these
-tests to run on swarming.
-
-For more info see:
-https://sites.google.com/a/chromium.org/dev/developers/testing/isolated-testing
-"""
-
-import glob
-import hashlib
-import json
-import optparse
-import os
-import re
-import sys
-
-
-def hash_file(filepath):
-  """Calculates the hash of a file without reading it all in memory at once."""
-  digest = hashlib.sha1()
-  with open(filepath, 'rb') as f:
-    while True:
-      chunk = f.read(1024*1024)
-      if not chunk:
-        break
-      digest.update(chunk)
-  return digest.hexdigest()
-
-
-def main():
-  parser = optparse.OptionParser(
-      usage='%prog --build-dir <path> --output-json <path>',
-      description=sys.modules[__name__].__doc__)
-  parser.add_option(
-      '--build-dir',
-      help='Path to a directory to search for *.isolated files.')
-  parser.add_option(
-      '--output-json',
-      help='File to dump JSON results into.')
-
-  options, _ = parser.parse_args()
-  if not options.build_dir:
-    parser.error('--build-dir option is required')
-  if not options.output_json:
-    parser.error('--output-json option is required')
-
-  result = {}
-
-  # Get the file hash values and output the pair.
-  pattern = os.path.join(options.build_dir, '*.isolated')
-  for filepath in sorted(glob.glob(pattern)):
-    test_name = os.path.splitext(os.path.basename(filepath))[0]
-    if re.match(r'^.+?\.\d$', test_name):
-      # It's a split .isolated file, e.g. foo.0.isolated. Ignore these.
-      continue
-
-    # TODO(csharp): Remove deletion once the isolate tracked dependencies are
-    # inputs for the isolated files.
-    sha1_hash = hash_file(filepath)
-    os.remove(filepath)
-    result[test_name] = sha1_hash
-
-  with open(options.output_json, 'wb') as f:
-    json.dump(result, f)
-
-  return 0
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/gdb-add-index b/build/gdb-add-index
deleted file mode 100755
index 992ac16..0000000
--- a/build/gdb-add-index
+++ /dev/null
@@ -1,162 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-# Saves the gdb index for a given binary and its shared library dependencies.
-#
-# This will run gdb index in parallel on a number of binaries using SIGUSR1
-# as the communication mechanism to simulate a semaphore. Because of the
-# nature of this technique, using "set -e" is very difficult. The SIGUSR1
-# terminates a "wait" with an error which we need to interpret.
-#
-# When modifying this code, most of the real logic is in the index_one_file
-# function. The rest is cleanup + sempahore plumbing.
-
-# Cleanup temp directory and ensure all child jobs are dead-dead.
-function on_exit {
-  trap "" EXIT USR1  # Avoid reentrancy.
-
-  local jobs=$(jobs -p)
-  if [ -n "$jobs" ]; then
-    echo -n "Killing outstanding index jobs..."
-    kill -KILL $(jobs -p)
-    wait
-    echo "done"
-  fi
-
-  if [ -f "$DIRECTORY" ]; then
-    echo -n "Removing temp directory $DIRECTORY..."
-    rm -rf $DIRECTORY
-    echo done
-  fi
-}
-
-# Add index to one binary.
-function index_one_file {
-  local file=$1
-  local basename=$(basename "$file")
-  local should_index="${SHOULD_INDEX}"
-
-  local readelf_out=$(${TOOLCHAIN_PREFIX}readelf -S "$file")
-  if [[ $readelf_out =~ "gdb_index" ]]; then
-    if [ "${REMOVE_INDEX}" = 1 ]; then
-      ${TOOLCHAIN_PREFIX}objcopy --remove-section .gdb_index "$file"
-      echo "Removed index from $basename."
-    else
-      echo "Skipped $basename -- already contains index."
-      should_index=0
-    fi
-  fi
-
-  if [ "${should_index}" = 1 ]; then
-    local start=$(date +"%s%N")
-    echo "Adding index to $basename..."
-
-    ${TOOLCHAIN_PREFIX}gdb -batch "$file" -ex "save gdb-index $DIRECTORY" \
-      -ex "quit"
-    local index_file="$DIRECTORY/$basename.gdb-index"
-    if [ -f "$index_file" ]; then
-      ${TOOLCHAIN_PREFIX}objcopy --add-section .gdb_index="$index_file" \
-        --set-section-flags .gdb_index=readonly "$file" "$file"
-      local finish=$(date +"%s%N")
-      local elapsed=$(((finish - start)/1000000))
-      echo "   ...$basename indexed. [${elapsed}ms]"
-    else
-      echo "   ...$basename unindexable."
-    fi
-  fi
-}
-
-# Functions that when combined, concurrently index all files in FILES_TO_INDEX
-# array. The global FILES_TO_INDEX is declared in the main body of the script.
-function async_index {
-  # Start a background subshell to run the index command.
-  {
-    index_one_file $1
-    kill -SIGUSR1 $$  # $$ resolves to the parent script.
-    exit 129  # See comment above wait loop at bottom.
-  } &
-}
-
-CUR_FILE_NUM=0
-function index_next {
-  if (( CUR_FILE_NUM >= ${#FILES_TO_INDEX[@]} )); then
-    return
-  fi
-
-  async_index "${FILES_TO_INDEX[CUR_FILE_NUM]}"
-  ((CUR_FILE_NUM += 1)) || true
-}
-
-
-########
-### Main body of the script.
-
-REMOVE_INDEX=0
-SHOULD_INDEX=1
-while getopts ":f:r" opt; do
-  case $opt in
-    f)
-      REMOVE_INDEX=1
-      shift
-      ;;
-    r)
-      REMOVE_INDEX=1
-      SHOULD_INDEX=0
-      shift
-      ;;
-    *)
-      echo "Invalid option: -$OPTARG" >&2
-      ;;
-  esac
-done
-
-if [[ ! $# == 1 ]]; then
-  echo "Usage: $0 [-f] [-r] path-to-binary"
-  echo "  -f forces replacement of an existing index."
-  echo "  -r removes the index section."
-  exit 1
-fi
-
-FILENAME="$1"
-if [[ ! -f "$FILENAME" ]]; then
-  echo "Path $FILENAME does not exist."
-  exit 1
-fi
-
-# Ensure we cleanup on on exit.
-trap on_exit EXIT
-
-# We're good to go! Create temp directory for index files.
-DIRECTORY=$(mktemp -d)
-echo "Made temp directory $DIRECTORY."
-
-# Create array with the filename and all shared libraries that
-# have the same dirname. The dirname is a signal that these
-# shared libraries were part of the same build as the binary.
-declare -a FILES_TO_INDEX=($FILENAME
- $(ldd "$FILENAME" 2>/dev/null \
-  | grep $(dirname "$FILENAME") \
-  | sed "s/.*[ \t]\(.*\) (.*/\1/")
-)
-
-# Start concurrent indexing.
-trap index_next USR1
-
-# 4 is an arbitrary default. When changing, remember we are likely IO bound
-# so basing this off the number of cores is not sensible.
-INDEX_TASKS=${INDEX_TASKS:-4}
-for ((i=0;i<${INDEX_TASKS};i++)); do
-  index_next
-done
-
-# Do a wait loop. Bash waits that terminate due a trap have an exit
-# code > 128. We also ensure that our subshell's "normal" exit occurs with
-# an exit code > 128. This allows us to do consider a > 128 exit code as
-# an indication that the loop should continue. Unfortunately, it also means
-# we cannot use set -e since technically the "wait" is failing.
-wait
-while (( $? > 128 )); do
-  wait
-done
diff --git a/build/get_landmines.py b/build/get_landmines.py
deleted file mode 100755
index 92f81fe..0000000
--- a/build/get_landmines.py
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-This file emits the list of reasons why a particular build needs to be clobbered
-(or a list of 'landmines').
-"""
-
-import sys
-
-import landmine_utils
-
-
-builder = landmine_utils.builder
-distributor = landmine_utils.distributor
-gyp_defines = landmine_utils.gyp_defines
-gyp_msvs_version = landmine_utils.gyp_msvs_version
-platform = landmine_utils.platform
-
-
-def print_landmines():
-  """
-  ALL LANDMINES ARE EMITTED FROM HERE.
-  """
-  # DO NOT add landmines as part of a regular CL. Landmines are a last-effort
-  # bandaid fix if a CL that got landed has a build dependency bug and all bots
-  # need to be cleaned up. If you're writing a new CL that causes build
-  # dependency problems, fix the dependency problems instead of adding a
-  # landmine.
-
-  print 'Lets start a new landmines file.'
-
-
-def main():
-  print_landmines()
-  return 0
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/get_sdk_extras_packages.py b/build/get_sdk_extras_packages.py
deleted file mode 100755
index a90b8a8..0000000
--- a/build/get_sdk_extras_packages.py
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import json
-import os
-import sys
-
-SDK_EXTRAS_JSON_FILE = os.path.join(os.path.dirname(__file__),
-                                    'android_sdk_extras.json')
-
-def main():
-  with open(SDK_EXTRAS_JSON_FILE) as json_file:
-    packages = json.load(json_file)
-
-  out = []
-  for package in packages:
-    out.append(package['package_id'])
-
-  print ','.join(out)
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/get_syzygy_binaries.py b/build/get_syzygy_binaries.py
deleted file mode 100755
index 1cab3fc..0000000
--- a/build/get_syzygy_binaries.py
+++ /dev/null
@@ -1,487 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""A utility script for downloading versioned Syzygy binaries."""
-
-import hashlib
-import errno
-import json
-import logging
-import optparse
-import os
-import re
-import shutil
-import stat
-import sys
-import subprocess
-import tempfile
-import time
-import zipfile
-
-
-_LOGGER = logging.getLogger(os.path.basename(__file__))
-
-# The relative path where official builds are archived in their GS bucket.
-_SYZYGY_ARCHIVE_PATH = ('/builds/official/%(revision)s')
-
-# A JSON file containing the state of the download directory. If this file and
-# directory state do not agree, then the binaries will be downloaded and
-# installed again.
-_STATE = '.state'
-
-# This matches an integer (an SVN revision number) or a SHA1 value (a GIT hash).
-# The archive exclusively uses lowercase GIT hashes.
-_REVISION_RE = re.compile('^(?:\d+|[a-f0-9]{40})$')
-
-# This matches an MD5 hash.
-_MD5_RE = re.compile('^[a-f0-9]{32}$')
-
-# List of reources to be downloaded and installed. These are tuples with the
-# following format:
-# (basename, logging name, relative installation path, extraction filter)
-_RESOURCES = [
-  ('benchmark.zip', 'benchmark', '', None),
-  ('binaries.zip', 'binaries', 'exe', None),
-  ('symbols.zip', 'symbols', 'exe',
-      lambda x: x.filename.endswith('.dll.pdb'))]
-
-
-def _LoadState(output_dir):
-  """Loads the contents of the state file for a given |output_dir|, returning
-  None if it doesn't exist.
-  """
-  path = os.path.join(output_dir, _STATE)
-  if not os.path.exists(path):
-    _LOGGER.debug('No state file found.')
-    return None
-  with open(path, 'rb') as f:
-    _LOGGER.debug('Reading state file: %s', path)
-    try:
-      return json.load(f)
-    except ValueError:
-      _LOGGER.debug('Invalid state file.')
-      return None
-
-
-def _SaveState(output_dir, state, dry_run=False):
-  """Saves the |state| dictionary to the given |output_dir| as a JSON file."""
-  path = os.path.join(output_dir, _STATE)
-  _LOGGER.debug('Writing state file: %s', path)
-  if dry_run:
-    return
-  with open(path, 'wb') as f:
-    f.write(json.dumps(state, sort_keys=True, indent=2))
-
-
-def _Md5(path):
-  """Returns the MD5 hash of the file at |path|, which must exist."""
-  return hashlib.md5(open(path, 'rb').read()).hexdigest()
-
-
-def _StateIsValid(state):
-  """Returns true if the given state structure is valid."""
-  if not isinstance(state, dict):
-    _LOGGER.debug('State must be a dict.')
-    return False
-  r = state.get('revision', None)
-  if not isinstance(r, basestring) or not _REVISION_RE.match(r):
-    _LOGGER.debug('State contains an invalid revision.')
-    return False
-  c = state.get('contents', None)
-  if not isinstance(c, dict):
-    _LOGGER.debug('State must contain a contents dict.')
-    return False
-  for (relpath, md5) in c.iteritems():
-    if not isinstance(relpath, basestring) or len(relpath) == 0:
-      _LOGGER.debug('State contents dict contains an invalid path.')
-      return False
-    if not isinstance(md5, basestring) or not _MD5_RE.match(md5):
-      _LOGGER.debug('State contents dict contains an invalid MD5 digest.')
-      return False
-  return True
-
-
-def _BuildActualState(stored, revision, output_dir):
-  """Builds the actual state using the provided |stored| state as a template.
-  Only examines files listed in the stored state, causing the script to ignore
-  files that have been added to the directories locally. |stored| must be a
-  valid state dictionary.
-  """
-  contents = {}
-  state = { 'revision': revision, 'contents': contents }
-  for relpath, md5 in stored['contents'].iteritems():
-    abspath = os.path.abspath(os.path.join(output_dir, relpath))
-    if os.path.isfile(abspath):
-      m = _Md5(abspath)
-      contents[relpath] = m
-
-  return state
-
-
-def _StatesAreConsistent(stored, actual):
-  """Validates whether two state dictionaries are consistent. Both must be valid
-  state dictionaries. Additional entries in |actual| are ignored.
-  """
-  if stored['revision'] != actual['revision']:
-    _LOGGER.debug('Mismatched revision number.')
-    return False
-  cont_stored = stored['contents']
-  cont_actual = actual['contents']
-  for relpath, md5 in cont_stored.iteritems():
-    if relpath not in cont_actual:
-      _LOGGER.debug('Missing content: %s', relpath)
-      return False
-    if md5 != cont_actual[relpath]:
-      _LOGGER.debug('Modified content: %s', relpath)
-      return False
-  return True
-
-
-def _GetCurrentState(revision, output_dir):
-  """Loads the current state and checks to see if it is consistent. Returns
-  a tuple (state, bool). The returned state will always be valid, even if an
-  invalid state is present on disk.
-  """
-  stored = _LoadState(output_dir)
-  if not _StateIsValid(stored):
-    _LOGGER.debug('State is invalid.')
-    # Return a valid but empty state.
-    return ({'revision': '0', 'contents': {}}, False)
-  actual = _BuildActualState(stored, revision, output_dir)
-  # If the script has been modified consider the state invalid.
-  path = os.path.join(output_dir, _STATE)
-  if os.path.getmtime(__file__) > os.path.getmtime(path):
-    return (stored, False)
-  # Otherwise, explicitly validate the state.
-  if not _StatesAreConsistent(stored, actual):
-    return (stored, False)
-  return (stored, True)
-
-
-def _DirIsEmpty(path):
-  """Returns true if the given directory is empty, false otherwise."""
-  for root, dirs, files in os.walk(path):
-    return not dirs and not files
-
-
-def _RmTreeHandleReadOnly(func, path, exc):
-  """An error handling function for use with shutil.rmtree. This will
-  detect failures to remove read-only files, and will change their properties
-  prior to removing them. This is necessary on Windows as os.remove will return
-  an access error for read-only files, and git repos contain read-only
-  pack/index files.
-  """
-  excvalue = exc[1]
-  if func in (os.rmdir, os.remove) and excvalue.errno == errno.EACCES:
-    _LOGGER.debug('Removing read-only path: %s', path)
-    os.chmod(path, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)
-    func(path)
-  else:
-    raise
-
-
-def _RmTree(path):
-  """A wrapper of shutil.rmtree that handles read-only files."""
-  shutil.rmtree(path, ignore_errors=False, onerror=_RmTreeHandleReadOnly)
-
-
-def _CleanState(output_dir, state, dry_run=False):
-  """Cleans up files/directories in |output_dir| that are referenced by
-  the given |state|. Raises an error if there are local changes. Returns a
-  dictionary of files that were deleted.
-  """
-  _LOGGER.debug('Deleting files from previous installation.')
-  deleted = {}
-
-  # Generate a list of files to delete, relative to |output_dir|.
-  contents = state['contents']
-  files = sorted(contents.keys())
-
-  # Try to delete the files. Keep track of directories to delete as well.
-  dirs = {}
-  for relpath in files:
-    fullpath = os.path.join(output_dir, relpath)
-    fulldir = os.path.dirname(fullpath)
-    dirs[fulldir] = True
-    if os.path.exists(fullpath):
-      # If somehow the file has become a directory complain about it.
-      if os.path.isdir(fullpath):
-        raise Exception('Directory exists where file expected: %s' % fullpath)
-
-      # Double check that the file doesn't have local changes. If it does
-      # then refuse to delete it.
-      if relpath in contents:
-        stored_md5 = contents[relpath]
-        actual_md5 = _Md5(fullpath)
-        if actual_md5 != stored_md5:
-          raise Exception('File has local changes: %s' % fullpath)
-
-      # The file is unchanged so it can safely be deleted.
-      _LOGGER.debug('Deleting file "%s".', fullpath)
-      deleted[relpath] = True
-      if not dry_run:
-        os.unlink(fullpath)
-
-  # Sort directories from longest name to shortest. This lets us remove empty
-  # directories from the most nested paths first.
-  dirs = sorted(dirs.keys(), key=lambda x: len(x), reverse=True)
-  for p in dirs:
-    if os.path.exists(p) and _DirIsEmpty(p):
-      _LOGGER.debug('Deleting empty directory "%s".', p)
-      if not dry_run:
-        _RmTree(p)
-
-  return deleted
-
-
-def _FindGsUtil():
-  """Looks for depot_tools and returns the absolute path to gsutil.py."""
-  for path in os.environ['PATH'].split(os.pathsep):
-    path = os.path.abspath(path)
-    git_cl = os.path.join(path, 'git_cl.py')
-    gs_util = os.path.join(path, 'gsutil.py')
-    if os.path.exists(git_cl) and os.path.exists(gs_util):
-      return gs_util
-  return None
-
-
-def _GsUtil(*cmd):
-  """Runs the given command in gsutil with exponential backoff and retries."""
-  gs_util = _FindGsUtil()
-  cmd = [sys.executable, gs_util] + list(cmd)
-
-  retries = 3
-  timeout = 4  # Seconds.
-  while True:
-    _LOGGER.debug('Running %s', cmd)
-    prog = subprocess.Popen(cmd, shell=False)
-    prog.communicate()
-
-    # Stop retrying on success.
-    if prog.returncode == 0:
-      return
-
-    # Raise a permanent failure if retries have been exhausted.
-    if retries == 0:
-      raise RuntimeError('Command "%s" returned %d.' % (cmd, prog.returncode))
-
-    _LOGGER.debug('Sleeping %d seconds and trying again.', timeout)
-    time.sleep(timeout)
-    retries -= 1
-    timeout *= 2
-
-
-def _Download(resource):
-  """Downloads the given GS resource to a temporary file, returning its path."""
-  tmp = tempfile.mkstemp(suffix='syzygy_archive')
-  os.close(tmp[0])
-  url = 'gs://syzygy-archive' + resource
-  _GsUtil('cp', url, tmp[1])
-  return tmp[1]
-
-
-def _InstallBinaries(options, deleted={}):
-  """Installs Syzygy binaries. This assumes that the output directory has
-  already been cleaned, as it will refuse to overwrite existing files."""
-  contents = {}
-  state = { 'revision': options.revision, 'contents': contents }
-  archive_path = _SYZYGY_ARCHIVE_PATH % { 'revision': options.revision }
-  if options.resources:
-    resources = [(resource, resource, '', None)
-                 for resource in options.resources]
-  else:
-    resources = _RESOURCES
-  for (base, name, subdir, filt) in resources:
-    # Create the output directory if it doesn't exist.
-    fulldir = os.path.join(options.output_dir, subdir)
-    if os.path.isfile(fulldir):
-      raise Exception('File exists where a directory needs to be created: %s' %
-                      fulldir)
-    if not os.path.exists(fulldir):
-      _LOGGER.debug('Creating directory: %s', fulldir)
-      if not options.dry_run:
-        os.makedirs(fulldir)
-
-    # Download and read the archive.
-    resource = archive_path + '/' + base
-    _LOGGER.debug('Retrieving %s archive at "%s".', name, resource)
-    path = _Download(resource)
-
-    _LOGGER.debug('Unzipping %s archive.', name)
-    with open(path, 'rb') as data:
-      archive = zipfile.ZipFile(data)
-      for entry in archive.infolist():
-        if not filt or filt(entry):
-          fullpath = os.path.normpath(os.path.join(fulldir, entry.filename))
-          relpath = os.path.relpath(fullpath, options.output_dir)
-          if os.path.exists(fullpath):
-            # If in a dry-run take into account the fact that the file *would*
-            # have been deleted.
-            if options.dry_run and relpath in deleted:
-              pass
-            else:
-              raise Exception('Path already exists: %s' % fullpath)
-
-          # Extract the file and update the state dictionary.
-          _LOGGER.debug('Extracting "%s".', fullpath)
-          if not options.dry_run:
-            archive.extract(entry.filename, fulldir)
-            md5 = _Md5(fullpath)
-            contents[relpath] = md5
-            if sys.platform == 'cygwin':
-              os.chmod(fullpath, os.stat(fullpath).st_mode | stat.S_IXUSR)
-
-    _LOGGER.debug('Removing temporary file "%s".', path)
-    os.remove(path)
-
-  return state
-
-
-def _ParseCommandLine():
-  """Parses the command-line and returns an options structure."""
-  option_parser = optparse.OptionParser()
-  option_parser.add_option('--dry-run', action='store_true', default=False,
-      help='If true then will simply list actions that would be performed.')
-  option_parser.add_option('--force', action='store_true', default=False,
-      help='Force an installation even if the binaries are up to date.')
-  option_parser.add_option('--no-cleanup', action='store_true', default=False,
-      help='Allow installation on non-Windows platforms, and skip the forced '
-           'cleanup step.')
-  option_parser.add_option('--output-dir', type='string',
-      help='The path where the binaries will be replaced. Existing binaries '
-           'will only be overwritten if not up to date.')
-  option_parser.add_option('--overwrite', action='store_true', default=False,
-      help='If specified then the installation will happily delete and rewrite '
-           'the entire output directory, blasting any local changes.')
-  option_parser.add_option('--revision', type='string',
-      help='The SVN revision or GIT hash associated with the required version.')
-  option_parser.add_option('--revision-file', type='string',
-      help='A text file containing an SVN revision or GIT hash.')
-  option_parser.add_option('--resource', type='string', action='append',
-      dest='resources', help='A resource to be downloaded.')
-  option_parser.add_option('--verbose', dest='log_level', action='store_const',
-      default=logging.INFO, const=logging.DEBUG,
-      help='Enables verbose logging.')
-  option_parser.add_option('--quiet', dest='log_level', action='store_const',
-      default=logging.INFO, const=logging.ERROR,
-      help='Disables all output except for errors.')
-  options, args = option_parser.parse_args()
-  if args:
-    option_parser.error('Unexpected arguments: %s' % args)
-  if not options.output_dir:
-    option_parser.error('Must specify --output-dir.')
-  if not options.revision and not options.revision_file:
-    option_parser.error('Must specify one of --revision or --revision-file.')
-  if options.revision and options.revision_file:
-    option_parser.error('Must not specify both --revision and --revision-file.')
-
-  # Configure logging.
-  logging.basicConfig(level=options.log_level)
-
-  # If a revision file has been specified then read it.
-  if options.revision_file:
-    options.revision = open(options.revision_file, 'rb').read().strip()
-    _LOGGER.debug('Parsed revision "%s" from file "%s".',
-                 options.revision, options.revision_file)
-
-  # Ensure that the specified SVN revision or GIT hash is valid.
-  if not _REVISION_RE.match(options.revision):
-    option_parser.error('Must specify a valid SVN or GIT revision.')
-
-  # This just makes output prettier to read.
-  options.output_dir = os.path.normpath(options.output_dir)
-
-  return options
-
-
-def _RemoveOrphanedFiles(options):
-  """This is run on non-Windows systems to remove orphaned files that may have
-  been downloaded by a previous version of this script.
-  """
-  # Reconfigure logging to output info messages. This will allow inspection of
-  # cleanup status on non-Windows buildbots.
-  _LOGGER.setLevel(logging.INFO)
-
-  output_dir = os.path.abspath(options.output_dir)
-
-  # We only want to clean up the folder in 'src/third_party/syzygy', and we
-  # expect to be called with that as an output directory. This is an attempt to
-  # not start deleting random things if the script is run from an alternate
-  # location, or not called from the gclient hooks.
-  expected_syzygy_dir = os.path.abspath(os.path.join(
-      os.path.dirname(__file__), '..', 'third_party', 'syzygy'))
-  expected_output_dir = os.path.join(expected_syzygy_dir, 'binaries')
-  if expected_output_dir != output_dir:
-    _LOGGER.info('Unexpected output directory, skipping cleanup.')
-    return
-
-  if not os.path.isdir(expected_syzygy_dir):
-    _LOGGER.info('Output directory does not exist, skipping cleanup.')
-    return
-
-  def OnError(function, path, excinfo):
-    """Logs error encountered by shutil.rmtree."""
-    _LOGGER.error('Error when running %s(%s)', function, path, exc_info=excinfo)
-
-  _LOGGER.info('Removing orphaned files from %s', expected_syzygy_dir)
-  if not options.dry_run:
-    shutil.rmtree(expected_syzygy_dir, True, OnError)
-
-
-def main():
-  options = _ParseCommandLine()
-
-  if options.dry_run:
-    _LOGGER.debug('Performing a dry-run.')
-
-  # We only care about Windows platforms, as the Syzygy binaries aren't used
-  # elsewhere. However, there was a short period of time where this script
-  # wasn't gated on OS types, and those OSes downloaded and installed binaries.
-  # This will cleanup orphaned files on those operating systems.
-  if sys.platform not in ('win32', 'cygwin'):
-    if options.no_cleanup:
-      _LOGGER.debug('Skipping usual cleanup for non-Windows platforms.')
-    else:
-      return _RemoveOrphanedFiles(options)
-
-  # Load the current installation state, and validate it against the
-  # requested installation.
-  state, is_consistent = _GetCurrentState(options.revision, options.output_dir)
-
-  # Decide whether or not an install is necessary.
-  if options.force:
-    _LOGGER.debug('Forcing reinstall of binaries.')
-  elif is_consistent:
-    # Avoid doing any work if the contents of the directory are consistent.
-    _LOGGER.debug('State unchanged, no reinstall necessary.')
-    return
-
-  # Under normal logging this is the only only message that will be reported.
-  _LOGGER.info('Installing revision %s Syzygy binaries.',
-               options.revision[0:12])
-
-  # Clean up the old state to begin with.
-  deleted = []
-  if options.overwrite:
-    if os.path.exists(options.output_dir):
-      # If overwrite was specified then take a heavy-handed approach.
-      _LOGGER.debug('Deleting entire installation directory.')
-      if not options.dry_run:
-        _RmTree(options.output_dir)
-  else:
-    # Otherwise only delete things that the previous installation put in place,
-    # and take care to preserve any local changes.
-    deleted = _CleanState(options.output_dir, state, options.dry_run)
-
-  # Install the new binaries. In a dry-run this will actually download the
-  # archives, but it won't write anything to disk.
-  state = _InstallBinaries(options, deleted)
-
-  # Build and save the state for the directory.
-  _SaveState(options.output_dir, state, options.dry_run)
-
-
-if __name__ == '__main__':
-  main()
diff --git a/build/git-hooks/OWNERS b/build/git-hooks/OWNERS
deleted file mode 100644
index 3e327dc..0000000
--- a/build/git-hooks/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-set noparent
-szager@chromium.org
-cmp@chromium.org
diff --git a/build/git-hooks/pre-commit b/build/git-hooks/pre-commit
deleted file mode 100755
index 41b5963..0000000
--- a/build/git-hooks/pre-commit
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/sh
-
-submodule_diff() {
-  if test -n "$2"; then
-    git diff-tree -r --ignore-submodules=dirty "$1" "$2" | grep -e '^:160000' -e '^:...... 160000' | xargs
-  else
-    git diff-index --cached --ignore-submodules=dirty "$1" | grep -e '^:160000' -e '^:...... 160000' | xargs
-  fi
-}
-
-if git rev-parse --verify --quiet --no-revs MERGE_HEAD; then
-  merge_base=$(git merge-base HEAD MERGE_HEAD)
-  if test -z "$(submodule_diff $merge_base HEAD)"; then
-    # Most up-to-date submodules are in MERGE_HEAD.
-    head_ref=MERGE_HEAD
-  else
-    # Most up-to-date submodules are in HEAD.
-    head_ref=HEAD
-  fi
-else
-  # No merge in progress. Submodules must match HEAD.
-  head_ref=HEAD
-fi
-
-submods=$(submodule_diff $head_ref)
-if test "$submods"; then
-  echo "You are trying to commit changes to the following submodules:" 1>&2
-  echo 1>&2
-  echo $submods | cut -d ' ' -f 6 | sed 's/^/  /g' 1>&2
-  cat <<EOF 1>&2
-
-Submodule commits are not allowed.  Please run:
-
-  git status --ignore-submodules=dirty
-
-and/or:
-
-  git diff-index --cached --ignore-submodules=dirty HEAD
-
-... to see what's in your index.
-
-If you're really and truly trying to roll the version of a submodule, you should
-commit the new version to DEPS, instead.
-EOF
-  exit 1
-fi
-
-gitmodules_diff() {
-  git diff-index --cached "$1" .gitmodules
-}
-
-if [ "$(git ls-files .gitmodules)" ] && [ "$(gitmodules_diff $head_ref)" ]; then
-  cat <<EOF 1>&2
-You are trying to commit a change to .gitmodules.  That is not allowed.
-To make changes to submodule names/paths, edit DEPS.
-EOF
-  exit 1
-fi
-
-exit 0
diff --git a/build/gn_migration.gypi b/build/gn_migration.gypi
deleted file mode 100644
index 2527b2e..0000000
--- a/build/gn_migration.gypi
+++ /dev/null
@@ -1,726 +0,0 @@
-# Copyright (c) 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file defines five targets that we are using to track the progress of the
-# GYP->GN migration:
-#
-# 'both_gn_and_gyp' lists what GN is currently capable of building and should
-# match the 'both_gn_and_gyp' target in //BUILD.gn.
-#
-# 'gyp_all' Should include everything built when building "all"; i.e., if you
-# type 'ninja gyp_all' and then 'ninja all', the second build should do
-# nothing. 'gyp_all' should just depend on the other four targets.
-#
-# 'gyp_only' lists any targets that are not meant to be ported over to the GN
-# build.
-#
-# 'gyp_remaining' lists all of the targets that still need to be converted,
-# i.e., all of the other (non-empty) targets that a GYP build will build.
-#
-# TODO(GYP): crbug.com/481694. Add a build step to the bot that enforces the
-# above contracts.
-
-{
-  'targets': [
-    {
-      'target_name': 'gyp_all',
-      'type': 'none',
-      'dependencies': [
-        'both_gn_and_gyp',
-        'gyp_only',
-        'gyp_remaining',
-      ]
-    },
-    {
-      # This target should mirror the structure of //:both_gn_and_gyp
-      # in src/BUILD.gn as closely as possible, for ease of comparison.
-      'target_name': 'both_gn_and_gyp',
-      'type': 'none',
-      'dependencies': [
-        '../base/base.gyp:base_i18n_perftests',
-        '../base/base.gyp:base_perftests',
-        '../base/base.gyp:base_unittests',
-        '../base/base.gyp:build_utf8_validator_tables#host',
-        '../base/base.gyp:check_example',
-        '../cc/cc_tests.gyp:cc_perftests',
-        '../cc/cc_tests.gyp:cc_unittests',
-        '../cc/blink/cc_blink_tests.gyp:cc_blink_unittests',
-        '../chrome/chrome.gyp:chrome',
-        '../chrome/chrome.gyp:browser_tests',
-        '../chrome/chrome.gyp:chrome_app_unittests',
-        '../chrome/chrome.gyp:chromedriver',
-        '../chrome/chrome.gyp:chromedriver_tests',
-        '../chrome/chrome.gyp:chromedriver_unittests',
-        '../chrome/chrome.gyp:interactive_ui_tests',
-        '../chrome/chrome.gyp:load_library_perf_tests',
-        '../chrome/chrome.gyp:performance_browser_tests',
-        '../chrome/chrome.gyp:sync_integration_tests',
-        '../chrome/chrome.gyp:sync_performance_tests',
-        '../chrome/chrome.gyp:unit_tests',
-        '../chrome/tools/profile_reset/jtl_compiler.gyp:jtl_compiler',
-        '../cloud_print/cloud_print.gyp:cloud_print_unittests',
-        '../components/components.gyp:network_hints_browser',
-        '../components/components.gyp:policy_templates',
-        '../components/components_tests.gyp:components_browsertests',
-        '../components/components_tests.gyp:components_perftests',
-        '../components/components_tests.gyp:components_unittests',
-        '../content/content.gyp:content_app_browser',
-        '../content/content.gyp:content_app_child',
-        '../content/content_shell_and_tests.gyp:content_browsertests',
-        '../content/content_shell_and_tests.gyp:content_gl_benchmark',
-        '../content/content_shell_and_tests.gyp:content_gl_tests',
-        '../content/content_shell_and_tests.gyp:content_perftests',
-        '../content/content_shell_and_tests.gyp:content_shell',
-        '../content/content_shell_and_tests.gyp:content_unittests',
-        '../courgette/courgette.gyp:courgette',
-        '../courgette/courgette.gyp:courgette_fuzz',
-        '../courgette/courgette.gyp:courgette_minimal_tool',
-        '../courgette/courgette.gyp:courgette_unittests',
-        '../crypto/crypto.gyp:crypto_unittests',
-        '../extensions/extensions_tests.gyp:extensions_browsertests',
-        '../extensions/extensions_tests.gyp:extensions_unittests',
-        '../device/device_tests.gyp:device_unittests',
-        '../gin/gin.gyp:gin_v8_snapshot_fingerprint',
-        '../gin/gin.gyp:gin_shell',
-        '../gin/gin.gyp:gin_unittests',
-        '../google_apis/gcm/gcm.gyp:gcm_unit_tests',
-        '../google_apis/gcm/gcm.gyp:mcs_probe',
-        '../google_apis/google_apis.gyp:google_apis_unittests',
-        '../gpu/gpu.gyp:angle_unittests',
-        '../gpu/gpu.gyp:gl_tests',
-        '../gpu/gpu.gyp:gpu_perftests',
-        '../gpu/gpu.gyp:gpu_unittests',
-        '../gpu/gles2_conform_support/gles2_conform_support.gyp:gles2_conform_support',  # TODO(GYP) crbug.com/471920
-        '../gpu/gles2_conform_support/gles2_conform_test.gyp:gles2_conform_test',  # TODO(GYP) crbug.com/471920
-        '../gpu/khronos_glcts_support/khronos_glcts_test.gyp:khronos_glcts_test',  # TODO(GYP) crbug.com/471903 to make this complete.
-        '../ipc/ipc.gyp:ipc_perftests',
-        '../ipc/ipc.gyp:ipc_tests',
-        '../ipc/mojo/ipc_mojo.gyp:ipc_mojo_unittests',
-        '../jingle/jingle.gyp:jingle_unittests',
-        '../media/media.gyp:ffmpeg_regression_tests',  # TODO(GYP) this should be conditional on media_use_ffmpeg
-        '../media/media.gyp:media_perftests',
-        '../media/media.gyp:media_unittests',
-        '../media/midi/midi.gyp:midi_unittests',
-        '../media/cast/cast.gyp:cast_benchmarks',
-        '../media/cast/cast.gyp:cast_unittests',
-        '../media/cast/cast.gyp:generate_barcode_video',
-        '../media/cast/cast.gyp:generate_timecode_audio',
-        '../mojo/mojo.gyp:mojo',
-        '../mojo/mojo_base.gyp:mojo_application_base',
-        '../mojo/mojo_base.gyp:mojo_common_unittests',
-        '../net/net.gyp:crash_cache',
-        '../net/net.gyp:crl_set_dump',
-        '../net/net.gyp:dns_fuzz_stub',
-        '../net/net.gyp:dump_cache',
-        '../net/net.gyp:gdig',
-        '../net/net.gyp:get_server_time',
-        '../net/net.gyp:hpack_example_generator',
-        '../net/net.gyp:hpack_fuzz_mutator',
-        '../net/net.gyp:hpack_fuzz_wrapper',
-        '../net/net.gyp:net_perftests',
-        '../net/net.gyp:net_unittests',
-        '../net/net.gyp:net_watcher',  # TODO(GYP): This should be conditional on use_v8_in_net
-        '../net/net.gyp:run_testserver',
-        '../net/net.gyp:stress_cache',
-        '../net/net.gyp:tld_cleanup',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_audio',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_audio_input',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_c_stub',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_cc_stub',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_compositor',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_crxfs',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_enumerate_devices',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_file_chooser',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_flash_topmost',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_gamepad',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_gles2',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_gles2_spinning_cube',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_graphics_2d',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_ime',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_input',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_media_stream_audio',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_media_stream_video',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_mouse_cursor',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_mouse_lock',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_paint_manager',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_post_message',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_printing',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_scaling',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_scroll',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_simple_font',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_threading',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_url_loader',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_url_loader_file',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_vc',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_video_decode',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_video_decode_dev',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_video_effects',
-        '../ppapi/ppapi_internal.gyp:ppapi_example_video_encode',
-        '../ppapi/ppapi_internal.gyp:ppapi_tests',
-        '../ppapi/ppapi_internal.gyp:ppapi_perftests',
-        '../ppapi/ppapi_internal.gyp:ppapi_unittests',
-        '../ppapi/tools/ppapi_tools.gyp:pepper_hash_for_uma',
-        '../printing/printing.gyp:printing_unittests',
-        '../skia/skia_tests.gyp:skia_unittests',
-        '../skia/skia.gyp:filter_fuzz_stub',
-        '../skia/skia.gyp:image_operations_bench',
-        '../sql/sql.gyp:sql_unittests',
-        '../sync/sync.gyp:run_sync_testserver',
-        '../sync/sync.gyp:sync_unit_tests',
-        '../sync/tools/sync_tools.gyp:sync_client',
-        '../sync/tools/sync_tools.gyp:sync_listen_notifications',
-        '../testing/gmock.gyp:gmock_main',
-        '../third_party/WebKit/Source/platform/blink_platform_tests.gyp:blink_heap_unittests',
-        '../third_party/WebKit/Source/platform/blink_platform_tests.gyp:blink_platform_unittests',
-        '../third_party/WebKit/Source/web/web_tests.gyp:webkit_unit_tests',
-        '../third_party/WebKit/Source/wtf/wtf_tests.gyp:wtf_unittests',
-        '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
-        '../third_party/codesighs/codesighs.gyp:codesighs',
-        '../third_party/codesighs/codesighs.gyp:maptsvdifftool',
-        '../third_party/leveldatabase/leveldatabase.gyp:env_chromium_unittests',
-        '../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
-        '../third_party/libaddressinput/libaddressinput.gyp:libaddressinput_unittests',
-        '../third_party/mojo/mojo_edk_tests.gyp:mojo_system_unittests',
-        '../third_party/mojo/mojo_edk_tests.gyp:mojo_public_bindings_unittests',
-        '../third_party/mojo/mojo_edk_tests.gyp:mojo_public_environment_unittests',
-        '../third_party/mojo/mojo_edk_tests.gyp:mojo_public_system_perftests',
-        '../third_party/mojo/mojo_edk_tests.gyp:mojo_public_system_unittests',
-        '../third_party/mojo/mojo_edk_tests.gyp:mojo_public_utility_unittests',
-        '../third_party/pdfium/samples/samples.gyp:pdfium_diff',
-        '../third_party/pdfium/samples/samples.gyp:pdfium_test',
-        '../third_party/smhasher/smhasher.gyp:pmurhash',
-        '../tools/gn/gn.gyp:gn',
-        '../tools/gn/gn.gyp:generate_test_gn_data',
-        '../tools/gn/gn.gyp:gn_unittests',
-        '../tools/imagediff/image_diff.gyp:image_diff',
-        '../tools/perf/clear_system_cache/clear_system_cache.gyp:clear_system_cache',
-        '../tools/telemetry/telemetry.gyp:bitmaptools#host',
-        '../ui/accessibility/accessibility.gyp:accessibility_unittests',
-        '../ui/app_list/app_list.gyp:app_list_unittests',
-        '../ui/base/ui_base_tests.gyp:ui_base_unittests',
-        '../ui/compositor/compositor.gyp:compositor_unittests',
-        '../ui/display/display.gyp:display_unittests',
-        '../ui/events/events.gyp:events_unittests',
-        '../ui/gfx/gfx_tests.gyp:gfx_unittests',
-        '../ui/gl/gl_tests.gyp:gl_unittests',
-        '../ui/message_center/message_center.gyp:message_center_unittests',
-        '../ui/snapshot/snapshot.gyp:snapshot_unittests',
-        '../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests',
-        '../ui/views/examples/examples.gyp:views_examples_with_content_exe',
-        '../url/url.gyp:url_unittests',
-        '../v8/tools/gyp/v8.gyp:v8_snapshot',
-        '../v8/tools/gyp/v8.gyp:postmortem-metadata',
-      ],
-      'conditions': [
-        ['clang==1', {
-          'dependencies': [
-            '../build/sanitizers/sanitizers.gyp:llvm-symbolizer',
-          ],
-        }],
-        ['disable_nacl==0 and disable_nacl_untrusted==0', {
-          'dependencies': [
-            '../components/nacl.gyp:nacl_loader_unittests',
-          ]
-        }],
-        ['enable_extensions==1 and OS!="mac"', {
-          'dependencies': [
-            '../extensions/shell/app_shell.gyp:app_shell',
-            '../extensions/shell/app_shell.gyp:app_shell_unittests',
-          ],
-        }],
-        ['enable_mdns==1', {
-          'dependencies': [
-            '../chrome/chrome.gyp:service_discovery_sniffer',
-          ]
-        }],
-        ['remoting==1', {
-          'dependencies': [
-            '../remoting/remoting_all.gyp:remoting_all',
-          ],
-        }],
-        ['remoting==1 and chromeos==0 and use_x11==1', {
-          'dependencies': [
-            '../remoting/remoting.gyp:remoting_me2me_host',
-            '../remoting/remoting.gyp:remoting_me2me_native_messaging_host',
-          ],
-        }],
-        ['toolkit_views==1', {
-          'dependencies': [
-            '../ui/app_list/app_list.gyp:app_list_demo',
-            '../ui/views/views.gyp:views_unittests',
-          ],
-        }],
-        ['use_ash==1', {
-          'dependencies': [
-            '../ash/ash.gyp:ash_shell',
-            '../ash/ash.gyp:ash_shell_unittests',
-            '../ash/ash.gyp:ash_unittests',
-          ],
-        }],
-        ['use_ash==1 or chromeos== 1', {
-          'dependencies': [
-            '../components/components.gyp:session_manager_component',
-          ]
-        }],
-        ['use_aura==1', {
-          'dependencies': [
-            '../ui/aura/aura.gyp:aura_bench',
-            '../ui/aura/aura.gyp:aura_demo',
-            '../ui/aura/aura.gyp:aura_unittests',
-            '../ui/keyboard/keyboard.gyp:keyboard_unittests',
-            '../ui/wm/wm.gyp:wm_unittests',
-          ],
-        }],
-        ['use_ozone==1', {
-          'dependencies': [
-            '../ui/ozone/ozone.gyp:ozone',
-          ],
-        }],
-        ['use_x11==1', {
-          'dependencies': [
-            '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
-          ],
-          'conditions': [
-            ['target_arch!="arm"', {
-              'dependencies': [
-                '../gpu/tools/tools.gyp:compositor_model_bench',
-              ],
-            }],
-          ],
-        }],
-        ['OS=="android"', {
-          'dependencies': [
-            '../base/base.gyp:chromium_android_linker',
-            '../breakpad/breakpad.gyp:dump_syms',
-            '../build/android/rezip.gyp:rezip_apk_jar',
-            '../chrome/chrome.gyp:chrome_public_apk',
-            '../chrome/chrome.gyp:chrome_public_test_apk',
-            '../chrome/chrome.gyp:chrome_shell_apk',
-            '../chrome/chrome.gyp:chromedriver_webview_shell_apk',
-            #"//clank" TODO(GYP) - conditional somehow?
-            '../tools/imagediff/image_diff.gyp:image_diff#host',
-            '../tools/telemetry/telemetry.gyp:bitmaptools#host',
-
-            # TODO(GYP): Remove these when the components_unittests work.
-            #"//components/history/core/test:test",
-            #"//components/policy:policy_component_test_support",
-            #"//components/policy:test_support",
-            #"//components/rappor:test_support",
-            #"//components/signin/core/browser:test_support",
-            #"//components/sync_driver:test_support",
-            #"//components/user_manager",
-            #"//components/wallpaper",
-
-            '../content/content_shell_and_tests.gyp:content_shell_apk',
-
-            '../third_party/WebKit/Source/platform/blink_platform_tests.gyp:blink_heap_unittests_apk',
-            '../third_party/WebKit/Source/platform/blink_platform_tests.gyp:blink_platform_unittests_apk',
-            '../third_party/WebKit/Source/web/web_tests.gyp:webkit_unit_tests_apk',
-            '../third_party/WebKit/Source/wtf/wtf_tests.gyp:wtf_unittests_apk',
-            # TODO(GYP): Are these needed, or will they be pulled in automatically?
-            #"//third_party/android_tools:android_gcm_java",
-            #"//third_party/android_tools:uiautomator_java",
-            #"//third_party/android_tools:android_support_v13_java",
-            #"//third_party/android_tools:android_support_v7_appcompat_java",
-            #"//third_party/android_tools:android_support_v7_mediarouter_java",
-            #"//third_party/mesa",
-            #"//third_party/mockito:mockito_java",
-            #"//third_party/openmax_dl/dl",
-            #"//third_party/speex",
-            #"//ui/android:ui_java",
-
-            # TODO(GYP): Are these needed?
-            #"//chrome/test:test_support_unit",
-            #"//third_party/smhasher:murmurhash3",
-            #"//ui/message_center:test_support",
-          ],
-          'dependencies!': [
-            '../breakpad/breakpad.gyp:symupload',
-            '../chrome/chrome.gyp:browser_tests',
-            '../chrome/chrome.gyp:chromedriver',
-            '../chrome/chrome.gyp:chromedriver_unitests',
-            '../chrome/chrome.gyp:interactive_ui_tests',
-            '../chrome/chrome.gyp:performance_browser_tests',
-            '../chrome/chrome.gyp:sync_integration_tests',
-            '../chrome/chrome.gyp:unit_tests',
-            '../extensions/extensions_tests.gyp:extensions_browsertests',
-            '../extensions/extensions_tests.gyp:extensions_unittests',
-            '../google_apis/gcm/gcm.gyp:gcm_unit_tests',
-            '../ipc/ipc.gyp:ipc_tests',
-            '../jingle/jingle.gyp:jingle_unittests',
-            '../net/net.gyp:net_unittests',
-            #"//ppapi/examples",
-            '../third_party/pdfium/samples/samples.gyp:pdfium_test',
-            '../tools/gn/gn.gyp:gn',
-            '../tools/gn/gn.gyp:gn_unittests',
-            '../tools/imagediff/image_diff.gyp:image_diff',
-            '../tools/gn/gn.gyp:gn',
-            '../tools/gn/gn.gyp:gn_unittests',
-            '../ui/app_list/app_list.gyp:app_list_unittests',
-            '../url/url.gyp:url_unittests',
-          ],
-        }],
-        ['OS=="android" or OS=="linux"', {
-          'dependencies': [
-            '../net/net.gyp:disk_cache_memory_test',
-          ],
-        }],
-        ['chromeos==1', {
-          'dependencies': [
-            '../chromeos/chromeos.gyp:chromeos_unittests',
-            '../ui/chromeos/ui_chromeos.gyp:ui_chromeos_unittests',
-          ]
-        }],
-        ['chromeos==1 or OS=="win" or OS=="mac"', {
-          'dependencies': [
-            '../rlz/rlz.gyp:rlz_id',
-            '../rlz/rlz.gyp:rlz_lib',
-            '../rlz/rlz.gyp:rlz_unittests',
-          ],
-        }],
-        ['OS=="android" or OS=="linux" or os_bsd==1', {
-          'dependencies': [
-            '../breakpad/breakpad.gyp:core-2-minidump',
-            '../breakpad/breakpad.gyp:microdump_stackwalk',
-            '../breakpad/breakpad.gyp:minidump_dump',
-            '../breakpad/breakpad.gyp:minidump_stackwalk',
-            '../breakpad/breakpad.gyp:symupload',
-            '../third_party/codesighs/codesighs.gyp:nm2tsv',
-          ],
-        }],
-        ['OS=="linux"', {
-          'dependencies': [
-            '../breakpad/breakpad.gyp:breakpad_unittests',
-            '../breakpad/breakpad.gyp:dump_syms#host',
-            '../breakpad/breakpad.gyp:generate_test_dump',
-            '../breakpad/breakpad.gyp:minidump-2-core',
-            '../dbus/dbus.gyp:dbus_test_server',
-            '../dbus/dbus.gyp:dbus_unittests',
-            '../media/cast/cast.gyp:tap_proxy',
-            '../net/net.gyp:disk_cache_memory_test',
-            '../net/net.gyp:flip_in_mem_edsm_server',
-            '../net/net.gyp:flip_in_mem_edsm_server_unittests',
-            '../net/net.gyp:epoll_quic_client',
-            '../net/net.gyp:epoll_quic_server',
-            '../net/net.gyp:hpack_example_generator',
-            '../net/net.gyp:hpack_fuzz_mutator',
-            '../net/net.gyp:hpack_fuzz_wrapper',
-            '../net/net.gyp:net_perftests',
-            '../net/net.gyp:quic_client',
-            '../net/net.gyp:quic_server',
-            '../sandbox/sandbox.gyp:chrome_sandbox',
-            '../sandbox/sandbox.gyp:sandbox_linux_unittests',
-            '../sandbox/sandbox.gyp:sandbox_linux_jni_unittests',
-            '../third_party/sqlite/sqlite.gyp:sqlite_shell',
-         ],
-        }],
-        ['OS=="mac"', {
-          'dependencies': [
-            '../breakpad/breakpad.gyp:crash_inspector',
-            '../breakpad/breakpad.gyp:dump_syms',
-            '../breakpad/breakpad.gyp:symupload',
-            '../third_party/apple_sample_code/apple_sample_code.gyp:apple_sample_code',
-            '../third_party/molokocacao/molokocacao.gyp:molokocacao',
-
-            # TODO(GYP): remove these when the corresponding root targets work.
-            #"//cc/blink",
-            #"//components/ui/zoom:ui_zoom",
-            #"//content",
-            #"//content/test:test_support",
-            #"//device/battery",
-            #"//device/bluetooth",
-            #"//device/nfc",
-            #"//device/usb",
-            #"//device/vibration",
-            #"//media/blink",
-            #"//pdf",
-            #"//storage/browser",
-            #"//third_party/brotli",
-            #"//third_party/flac",
-            #"//third_party/hunspell",
-            #//third_party/iccjpeg",
-            #"//third_party/libphonenumber",
-            #"//third_party/ots",
-            #"//third_party/qcms",
-            #"//third_party/smhasher:murmurhash3",
-            #"//third_party/speex",
-            #"//third_party/webrtc/system_wrappers",
-            #"//ui/native_theme",
-            #"//ui/snapshot",
-            #"//ui/surface",
-          ],
-          'dependencies!': [
-            #"//chrome",  # TODO(GYP)
-            #"//chrome/test:browser_tests",  # TODO(GYP)
-            #"//chrome/test:interactive_ui_tests",  # TODO(GYP)
-            #"//chrome/test:sync_integration_tests",  # TODO(GYP)
-            #"//chrome/test:unit_tests",  # TODO(GYP)
-            #"//components:components_unittests",  # TODO(GYP)
-            #"//content/test:content_browsertests",  # TODO(GYP)
-            #"//content/test:content_perftests",  # TODO(GYP)
-            #"//content/test:content_unittests",  # TODO(GYP)
-            #"//extensions:extensions_browsertests",  # TODO(GYP)
-            #"//extensions:extensions_unittests",  # TODO(GYP)
-            #"//net:net_unittests",  # TODO(GYP)
-            #"//third_party/usrsctp",  # TODO(GYP)
-            #"//ui/app_list:app_list_unittests",  # TODO(GYP)
-            #"//ui/gfx:gfx_unittests",  # TODO(GYP)
-          ],
-        }],
-        ['OS=="win"', {
-          'dependencies': [
-            '../base/base.gyp:pe_image_test',
-            '../chrome/chrome.gyp:crash_service',
-            '../chrome/chrome.gyp:setup_unittests',
-            '../chrome_elf/chrome_elf.gyp:chrome_elf_unittests',
-            '../chrome_elf/chrome_elf.gyp:dll_hash_main',
-            '../components/components.gyp:wifi_test',
-            '../net/net.gyp:quic_client',
-            '../net/net.gyp:quic_server',
-            '../sandbox/sandbox.gyp:pocdll',
-            '../sandbox/sandbox.gyp:sandbox_poc',
-            '../sandbox/sandbox.gyp:sbox_integration_tests',
-            '../sandbox/sandbox.gyp:sbox_unittests',
-            '../sandbox/sandbox.gyp:sbox_validation_tests',
-            '../testing/gtest.gyp:gtest_main',
-            '../third_party/codesighs/codesighs.gyp:msdump2symdb',
-            '../third_party/codesighs/codesighs.gyp:msmap2tsv',
-            '../third_party/pdfium/samples/samples.gyp:pdfium_diff',
-            '../win8/win8.gyp:metro_viewer',
-          ],
-        }],
-      ],
-    },
-    {
-      'target_name': 'gyp_only',
-      'type': 'none',
-      'conditions': [
-        ['OS=="linux" or OS=="win"', {
-          'conditions': [
-            ['disable_nacl==0 and disable_nacl_untrusted==0', {
-              'dependencies': [
-                '../mojo/mojo_nacl.gyp:monacl_shell',  # This should not be built in chromium.
-              ]
-            }],
-          ]
-        }],
-      ],
-    },
-    {
-      'target_name': 'gyp_remaining',
-      'type': 'none',
-      'conditions': [
-        ['remoting==1', {
-          'dependencies': [
-            '../remoting/app_remoting_webapp.gyp:ar_sample_app',  # crbug.com/471916
-          ],
-        }],
-        ['test_isolation_mode!="noop"', {
-          'dependencies': [
-            '../base/base.gyp:base_unittests_run',
-            '../cc/cc_tests.gyp:cc_unittests_run',
-            '../chrome/chrome.gyp:browser_tests_run',
-            '../chrome/chrome.gyp:chrome_run',
-            '../chrome/chrome.gyp:interactive_ui_tests_run',
-            '../chrome/chrome.gyp:sync_integration_tests_run',
-            '../chrome/chrome.gyp:unit_tests_run',
-            '../components/components_tests.gyp:components_browsertests_run',
-            '../components/components_tests.gyp:components_unittests_run',
-            '../content/content_shell_and_tests.gyp:content_browsertests_run',
-            '../content/content_shell_and_tests.gyp:content_unittests_run',
-            '../courgette/courgette.gyp:courgette_unittests_run',
-            '../crypto/crypto.gyp:crypto_unittests_run',
-            '../google_apis/gcm/gcm.gyp:gcm_unit_tests_run',
-            '../gpu/gpu.gyp:gpu_unittests_run',
-            '../ipc/ipc.gyp:ipc_tests_run',
-            '../media/cast/cast.gyp:cast_unittests_run',
-            '../media/media.gyp:media_unittests_run',
-            '../media/midi/midi.gyp:midi_unittests_run',
-            '../net/net.gyp:net_unittests_run',
-            '../printing/printing.gyp:printing_unittests_run',
-            '../remoting/remoting.gyp:remoting_unittests_run',
-            '../skia/skia_tests.gyp:skia_unittests_run',
-            '../sql/sql.gyp:sql_unittests_run',
-            '../sync/sync.gyp:sync_unit_tests_run',
-            '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests_run',
-            '../third_party/mojo/mojo_edk_tests.gyp:mojo_public_bindings_unittests_run',
-            '../tools/gn/gn.gyp:gn_unittests_run',
-            '../ui/accessibility/accessibility.gyp:accessibility_unittests_run',
-            '../ui/app_list/app_list.gyp:app_list_unittests_run',
-            '../ui/compositor/compositor.gyp:compositor_unittests_run',
-            '../ui/events/events.gyp:events_unittests_run',
-            '../ui/gl/gl_tests.gyp:gl_unittests_run',
-            '../ui/message_center/message_center.gyp:message_center_unittests_run',
-            '../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests_run',
-            '../url/url.gyp:url_unittests_run',
-          ],
-          'conditions': [
-            ['OS=="linux"', {
-              'dependencies': [
-                '../sandbox/sandbox.gyp:sandbox_linux_unittests_run',
-                '../ui/display/display.gyp:display_unittests_run',
-              ],
-            }],
-            ['OS=="mac"', {
-              'dependencies': [
-                '../sandbox/sandbox.gyp:sandbox_mac_unittests_run',
-              ],
-            }],
-            ['OS=="win"', {
-              'dependencies': [
-                '../chrome/chrome.gyp:installer_util_unittests_run',
-                '../chrome/chrome.gyp:setup_unittests_run',
-                '../sandbox/sandbox.gyp:sbox_integration_tests',
-                '../sandbox/sandbox.gyp:sbox_unittests',
-                '../sandbox/sandbox.gyp:sbox_validation_tests',
-              ],
-            }],
-            ['use_ash==1', {
-              'dependencies': [
-                '../ash/ash.gyp:ash_unittests_run',
-              ],
-            }],
-            ['use_aura==1', {
-              'dependencies': [
-                '../ui/aura/aura.gyp:aura_unittests_run',
-                '../ui/wm/wm.gyp:wm_unittests_run',
-              ],
-            }],
-            ['enable_webrtc==1 or OS!="android"', {
-              'dependencies': [
-                '../jingle/jingle.gyp:jingle_unittests_run',
-              ],
-            }],
-            ['disable_nacl==0 and disable_nacl_untrusted==0', {
-              'dependencies': [
-                '../components/nacl.gyp:nacl_loader_unittests_run',
-              ]
-            }],
-          ],
-        }],
-        ['use_openssl==1', {
-          'dependencies': [
-            # TODO(GYP): All of these targets still need to be converted.
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_ecdsa_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_bn_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_pqueue_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_digest_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_cipher_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_hkdf_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_constant_time_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_thread_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_base64_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_gcm_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_bytestring_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_evp_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_dsa_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_rsa_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_hmac_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_aead_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_ssl_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_err_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_lhash_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_pbkdf_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_dh_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_pkcs12_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_example_mul',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_ec_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_bio_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_pkcs7_test',
-            '../third_party/boringssl/boringssl_tests.gyp:boringssl_unittests',
-          ],
-        }],
-        ['chromeos==1', {
-          'dependencies': [
-            '../content/content_shell_and_tests.gyp:jpeg_decode_accelerator_unittest',
-            '../content/content_shell_and_tests.gyp:video_encode_accelerator_unittest',
-          ],
-        }],
-        ['chromeos==1 and target_arch != "arm"', {
-          'dependencies': [
-            '../content/content_shell_and_tests.gyp:vaapi_jpeg_decoder_unittest',
-          ],
-        }],
-        ['chromeos==1 or OS=="win" or OS=="android"', {
-          'dependencies': [
-            '../content/content_shell_and_tests.gyp:video_decode_accelerator_unittest',
-          ],
-        }],
-        ['OS=="linux" or OS=="win"', {
-          'dependencies': [
-            # TODO(GYP): Figure out which of these run on android/mac/win/ios/etc.
-            '../net/net.gyp:net_docs',
-            '../remoting/remoting.gyp:ar_sample_test_driver',
-
-            # TODO(GYP): in progress - see tfarina.
-            '../third_party/webrtc/tools/tools.gyp:frame_analyzer',
-            '../third_party/webrtc/tools/tools.gyp:rgba_to_i420_converter',
-          ],
-        }],
-        ['OS=="win"', {
-          'dependencies': [
-            # TODO(GYP): All of these targets still need to be converted.
-            '../base/base.gyp:debug_message',
-            '../chrome/chrome.gyp:app_shim',
-            '../chrome/chrome.gyp:gcapi_dll',
-            '../chrome/chrome.gyp:gcapi_test',
-            '../chrome/chrome.gyp:installer_util_unittests',
-            '../chrome/chrome.gyp:pack_policy_templates',
-            '../chrome/chrome.gyp:sb_sigutil',
-            '../chrome/chrome.gyp:setup',
-            '../chrome/installer/mini_installer.gyp:mini_installer',
-            '../chrome/tools/crash_service/caps/caps.gyp:caps',
-            '../cloud_print/gcp20/prototype/gcp20_device.gyp:gcp20_device',
-            '../cloud_print/gcp20/prototype/gcp20_device.gyp:gcp20_device_unittests',
-            '../cloud_print/service/win/service.gyp:cloud_print_service',
-            '../cloud_print/service/win/service.gyp:cloud_print_service_config',
-            '../cloud_print/service/win/service.gyp:cloud_print_service_setup',
-            '../cloud_print/virtual_driver/win/install/virtual_driver_install.gyp:virtual_driver_setup',
-            '../cloud_print/virtual_driver/win/virtual_driver.gyp:gcp_portmon',
-            '../components/test_runner/test_runner.gyp:layout_test_helper',
-            '../content/content_shell_and_tests.gyp:content_shell_crash_service',
-            '../gpu/gpu.gyp:angle_end2end_tests',
-            '../gpu/gpu.gyp:angle_perftests',
-            '../net/net.gyp:net_docs',
-            '../ppapi/ppapi_internal.gyp:ppapi_perftests',
-            '../remoting/remoting.gyp:ar_sample_test_driver',
-            '../remoting/remoting.gyp:remoting_breakpad_tester',
-            '../remoting/remoting.gyp:remoting_console',
-            '../remoting/remoting.gyp:remoting_desktop',
-            '../rlz/rlz.gyp:rlz',
-            '../tools/win/static_initializers/static_initializers.gyp:static_initializers',
-          ],
-        }],
-        ['OS=="win" and win_use_allocator_shim==1', {
-          'dependencies': [
-            '../base/allocator/allocator.gyp:allocator_unittests',
-          ]
-        }],
-        ['OS=="win" and target_arch=="ia32"', {
-          'dependencies': [
-            # TODO(GYP): All of these targets need to be ported over.
-            '../base/base.gyp:base_win64',
-            '../base/base.gyp:base_i18n_nacl_win64',
-            '../chrome/chrome.gyp:crash_service_win64',
-            '../chrome/chrome.gyp:launcher_support64',
-            '../components/components.gyp:breakpad_win64',
-            '../courgette/courgette.gyp:courgette64',
-            '../crypto/crypto.gyp:crypto_nacl_win64',
-            '../ipc/ipc.gyp:ipc_win64',
-            '../sandbox/sandbox.gyp:sandbox_win64',
-            '../cloud_print/virtual_driver/win/virtual_driver64.gyp:gcp_portmon64',
-            '../cloud_print/virtual_driver/win/virtual_driver64.gyp:virtual_driver_lib64',
-          ],
-        }],
-        ['OS=="win" and target_arch=="ia32" and configuration_policy==1', {
-          'dependencies': [
-            # TODO(GYP): All of these targets need to be ported over.
-            '../components/components.gyp:policy_win64',
-          ]
-        }],
-      ],
-    },
-  ]
-}
-
diff --git a/build/gn_run_binary.py b/build/gn_run_binary.py
old mode 100644
new mode 100755
index 7d83f61..76d1992
--- a/build/gn_run_binary.py
+++ b/build/gn_run_binary.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
 # Copyright 2014 The Chromium Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
@@ -5,18 +6,56 @@
 """Helper script for GN to run an arbitrary binary. See compiled_action.gni.
 
 Run with:
-  python gn_run_binary.py <binary_name> [args ...]
+  python gn_run_binary.py <invoker> <binary_name> [args ...]
+
+Where <invoker> is either "compiled_action" or "exec_script". If it is
+"compiled_action" the script has a non-zero exit code on a failure. If it is
+"exec_script" the script has no output on success and produces output otherwise,
+but always has an exit code of 0.
 """
 
+import os
 import sys
 import subprocess
 
-# This script is designed to run binaries produced by the current build. We
-# always prefix it with "./" to avoid picking up system versions that might
-# also be on the path.
-path = './' + sys.argv[1]
+# Run a command, swallowing the output unless there is an error.
+def run_command(command):
+  try:
+    subprocess.check_output(command, stderr=subprocess.STDOUT)
+    return 0
+  except subprocess.CalledProcessError as e:
+    return ("Command failed: " + ' '.join(command) + "\n" +
+            "output: " + e.output)
 
-# The rest of the arguements are passed directly to the executable.
-args = [path] + sys.argv[2:]
+def main(argv):
+  error_exit = 0
+  if argv[1] == "compiled_action":
+    error_exit = 1
+  elif argv[1] != "exec_script":
+    print ("The first argument should be either "
+           "'compiled_action' or 'exec_script")
+    return 1
 
-sys.exit(subprocess.call(args))
+  # Unless the path is absolute, this script is designed to run binaries
+  # produced by the current build. We always prefix it with "./" to avoid
+  # picking up system versions that might also be on the path.
+  if os.path.isabs(argv[2]):
+    path = argv[2]
+  else:
+    path = './' + argv[2]
+
+  if not os.path.isfile(path):
+    print "Binary not found: " + path
+    return error_exit
+
+  # The rest of the arguements are passed directly to the executable.
+  args = [path] + argv[3:]
+
+  result = run_command(args)
+  if result != 0:
+    print result
+    return error_exit
+  return 0
+
+if __name__ == '__main__':
+  sys.exit(main(sys.argv))
diff --git a/build/grit_action.gypi b/build/grit_action.gypi
deleted file mode 100644
index b24f0f8..0000000
--- a/build/grit_action.gypi
+++ /dev/null
@@ -1,71 +0,0 @@
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into an action to invoke grit in a
-# consistent manner. To use this the following variables need to be
-# defined:
-#   grit_grd_file: string: grd file path
-#   grit_out_dir: string: the output directory path
-
-# It would be really nice to do this with a rule instead of actions, but it
-# would need to determine inputs and outputs via grit_info on a per-file
-# basis. GYP rules don't currently support that. They could be extended to
-# do this, but then every generator would need to be updated to handle this.
-
-{
-  'variables': {
-    'grit_cmd': ['python', '<(DEPTH)/tools/grit/grit.py'],
-    'grit_resource_ids%': '<(DEPTH)/tools/gritsettings/resource_ids',
-    # This makes it possible to add more defines in specific targets,
-    # instead of build/common.gypi .
-    'grit_additional_defines%': [],
-    'grit_rc_header_format%': [],
-    'grit_whitelist%': '',
-
-    'conditions': [
-      # These scripts can skip writing generated files if they are identical
-      # to the already existing files, which avoids further build steps, like
-      # recompilation. However, a dependency (earlier build step) having a
-      # newer timestamp than an output (later build step) confuses some build
-      # systems, so only use this on ninja, which explicitly supports this use
-      # case (gyp turns all actions into ninja restat rules).
-      ['"<(GENERATOR)"=="ninja"', {
-        'write_only_new': '1',
-      }, {
-        'write_only_new': '0',
-      }],
-    ],
-  },
-  'conditions': [
-    ['"<(grit_whitelist)"==""', {
-      'variables': {
-        'grit_whitelist_flag': [],
-      }
-    }, {
-      'variables': {
-        'grit_whitelist_flag': ['-w', '<(grit_whitelist)'],
-      }
-    }]
-  ],
-  'inputs': [
-    '<!@pymod_do_main(grit_info <@(grit_defines) <@(grit_additional_defines) '
-        '<@(grit_whitelist_flag) --inputs <(grit_grd_file) '
-        '-f "<(grit_resource_ids)")',
-  ],
-  'outputs': [
-    '<!@pymod_do_main(grit_info <@(grit_defines) <@(grit_additional_defines) '
-        '<@(grit_whitelist_flag) --outputs \'<(grit_out_dir)\' '
-        '<(grit_grd_file) -f "<(grit_resource_ids)")',
-  ],
-  'action': ['<@(grit_cmd)',
-             '-i', '<(grit_grd_file)', 'build',
-             '-f', '<(grit_resource_ids)',
-             '-o', '<(grit_out_dir)',
-             '--write-only-new=<(write_only_new)',
-             '<@(grit_defines)',
-             '<@(grit_whitelist_flag)',
-             '<@(grit_additional_defines)',
-             '<@(grit_rc_header_format)'],
-  'message': 'Generating resources from <(grit_grd_file)',
-}
diff --git a/build/grit_target.gypi b/build/grit_target.gypi
deleted file mode 100644
index 179f986..0000000
--- a/build/grit_target.gypi
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into a target that will have one or more
-# uses of grit_action.gypi. To use this the following variables need to be
-# defined:
-#   grit_out_dir: string: the output directory path
-
-# DO NOT USE THIS FILE. Instead, use qualified includes.
-# TODO: Convert everything to qualified includes, and delete this file,
-# http://crbug.com/401588
-{
-  'conditions': [
-    # If the target is a direct binary, it needs to be able to find the header,
-    # otherwise it probably a supporting target just for grit so the include
-    # dir needs to be set on anything that depends on this action.
-    ['_type=="executable" or _type=="shared_library" or \
-      _type=="loadable_module" or _type=="static_library"', {
-      'include_dirs': [
-        '<(grit_out_dir)',
-      ],
-    }, {
-      'direct_dependent_settings': {
-        'include_dirs': [
-          '<(grit_out_dir)',
-        ],
-      },
-    }],
-  ],
-}
diff --git a/build/gyp_environment.py b/build/gyp_environment.py
deleted file mode 100644
index fb50645..0000000
--- a/build/gyp_environment.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-Sets up various automatic gyp environment variables. These are used by
-gyp_chromium and landmines.py which run at different stages of runhooks. To
-make sure settings are consistent between them, all setup should happen here.
-"""
-
-import gyp_helper
-import os
-import sys
-import vs_toolchain
-
-def SetEnvironment():
-  """Sets defaults for GYP_* variables."""
-  gyp_helper.apply_chromium_gyp_env()
-
-  # Default to ninja on linux and windows, but only if no generator has
-  # explicitly been set.
-  # Also default to ninja on mac, but only when not building chrome/ios.
-  # . -f / --format has precedence over the env var, no need to check for it
-  # . set the env var only if it hasn't been set yet
-  # . chromium.gyp_env has been applied to os.environ at this point already
-  if sys.platform.startswith(('linux', 'win', 'freebsd')) and \
-      not os.environ.get('GYP_GENERATORS'):
-    os.environ['GYP_GENERATORS'] = 'ninja'
-  elif sys.platform == 'darwin' and not os.environ.get('GYP_GENERATORS') and \
-      not 'OS=ios' in os.environ.get('GYP_DEFINES', []):
-    os.environ['GYP_GENERATORS'] = 'ninja'
-
-  vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs()
diff --git a/build/gyp_helper.py b/build/gyp_helper.py
deleted file mode 100644
index c840f2d..0000000
--- a/build/gyp_helper.py
+++ /dev/null
@@ -1,68 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file helps gyp_chromium and landmines correctly set up the gyp
-# environment from chromium.gyp_env on disk
-
-import os
-
-SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
-CHROME_SRC = os.path.dirname(SCRIPT_DIR)
-
-
-def apply_gyp_environment_from_file(file_path):
-  """Reads in a *.gyp_env file and applies the valid keys to os.environ."""
-  if not os.path.exists(file_path):
-    return
-  with open(file_path, 'rU') as f:
-    file_contents = f.read()
-  try:
-    file_data = eval(file_contents, {'__builtins__': None}, None)
-  except SyntaxError, e:
-    e.filename = os.path.abspath(file_path)
-    raise
-  supported_vars = (
-      'CC',
-      'CC_wrapper',
-      'CC.host_wrapper',
-      'CHROMIUM_GYP_FILE',
-      'CHROMIUM_GYP_SYNTAX_CHECK',
-      'CXX',
-      'CXX_wrapper',
-      'CXX.host_wrapper',
-      'GYP_DEFINES',
-      'GYP_GENERATOR_FLAGS',
-      'GYP_CROSSCOMPILE',
-      'GYP_GENERATOR_OUTPUT',
-      'GYP_GENERATORS',
-      'GYP_INCLUDE_FIRST',
-      'GYP_INCLUDE_LAST',
-      'GYP_MSVS_VERSION',
-  )
-  for var in supported_vars:
-    file_val = file_data.get(var)
-    if file_val:
-      if var in os.environ:
-        behavior = 'replaces'
-        if var == 'GYP_DEFINES':
-          result = file_val + ' ' + os.environ[var]
-          behavior = 'merges with, and individual components override,'
-        else:
-          result = os.environ[var]
-        print 'INFO: Environment value for "%s" %s value in %s' % (
-            var, behavior, os.path.abspath(file_path)
-        )
-        string_padding = max(len(var), len(file_path), len('result'))
-        print '      %s: %s' % (var.rjust(string_padding), os.environ[var])
-        print '      %s: %s' % (file_path.rjust(string_padding), file_val)
-        os.environ[var] = result
-      else:
-        os.environ[var] = file_val
-
-
-def apply_chromium_gyp_env():
-  if 'SKIP_CHROMIUM_GYP_ENV' not in os.environ:
-    # Update the environment based on chromium.gyp_env
-    path = os.path.join(os.path.dirname(CHROME_SRC), 'chromium.gyp_env')
-    apply_gyp_environment_from_file(path)
diff --git a/build/host_jar.gypi b/build/host_jar.gypi
deleted file mode 100644
index a47f6bb..0000000
--- a/build/host_jar.gypi
+++ /dev/null
@@ -1,146 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into a target to provide a rule to build
-# a JAR file for use on a host in a consistent manner. If a main class is
-# specified, this file will also generate an executable to run the jar in the
-# output folder's /bin/ directory.
-#
-# To use this, create a gyp target with the following form:
-# {
-#   'target_name': 'my_jar',
-#   'type': 'none',
-#   'variables': {
-#     'src_paths': [
-#       'path/to/directory',
-#       'path/to/other/directory',
-#       'path/to/individual_file.java',
-#       ...
-#     ],
-#   },
-#   'includes': [ 'path/to/this/gypi/file' ],
-# }
-#
-# Required variables:
-#   src_paths - A list of all paths containing java files that should be
-#     included in the jar. Paths can be either directories or files.
-# Optional/automatic variables:
-#   excluded_src_paths - A list of all paths that should be excluded from
-#     the jar.
-#   generated_src_dirs - Directories containing additional .java files
-#     generated at build time.
-#   input_jars_paths - A list of paths to the jars that should be included
-#     in the classpath.
-#   main_class - The class containing the main() function that should be called
-#     when running the jar file.
-#   jar_excluded_classes - A list of .class files that should be excluded
-#     from the jar.
-
-{
-  'dependencies': [
-    '<(DEPTH)/build/android/setup.gyp:build_output_dirs',
-  ],
-  'variables': {
-    'classes_dir': '<(intermediate_dir)/classes',
-    'excluded_src_paths': [],
-    'generated_src_dirs': [],
-    'input_jars_paths': [],
-    'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)',
-    'jar_dir': '<(PRODUCT_DIR)/lib.java',
-    'jar_excluded_classes': [],
-    'jar_name': '<(_target_name).jar',
-    'jar_path': '<(jar_dir)/<(jar_name)',
-    'main_class%': '',
-    'stamp': '<(intermediate_dir)/jar.stamp',
-    'enable_errorprone%': '0',
-    'errorprone_exe_path': '<(PRODUCT_DIR)/bin.java/chromium_errorprone',
-  },
-  'all_dependent_settings': {
-    'variables': {
-      'input_jars_paths': ['<(jar_path)']
-    },
-  },
-  'actions': [
-    {
-      'action_name': 'javac_<(_target_name)',
-      'message': 'Compiling <(_target_name) java sources',
-      'variables': {
-        'extra_args': [],
-        'extra_inputs': [],
-        'java_sources': [ '<!@(find <@(src_paths) -name "*.java")' ],
-        'conditions': [
-          ['"<(excluded_src_paths)" != ""', {
-            'java_sources!': ['<!@(find <@(excluded_src_paths) -name "*.java")']
-          }],
-          ['"<(jar_excluded_classes)" != ""', {
-            'extra_args': ['--jar-excluded-classes=<(jar_excluded_classes)']
-          }],
-          ['main_class != ""', {
-            'extra_args': ['--main-class=>(main_class)']
-          }],
-          ['enable_errorprone == 1', {
-            'extra_inputs': [
-              '<(errorprone_exe_path)',
-            ],
-            'extra_args': [ '--use-errorprone-path=<(errorprone_exe_path)' ],
-          }],
-        ],
-      },
-      'inputs': [
-        '<(DEPTH)/build/android/gyp/util/build_utils.py',
-        '<(DEPTH)/build/android/gyp/javac.py',
-        '^@(java_sources)',
-        '>@(input_jars_paths)',
-        '<@(extra_inputs)',
-      ],
-      'outputs': [
-        '<(jar_path)',
-        '<(stamp)',
-      ],
-      'action': [
-        'python', '<(DEPTH)/build/android/gyp/javac.py',
-        '--classpath=>(input_jars_paths)',
-        '--src-gendirs=>(generated_src_dirs)',
-        '--chromium-code=<(chromium_code)',
-        '--stamp=<(stamp)',
-        '--jar-path=<(jar_path)',
-        '<@(extra_args)',
-        '^@(java_sources)',
-      ],
-    },
-  ],
-  'conditions': [
-    ['main_class != ""', {
-      'actions': [
-        {
-          'action_name': 'create_java_binary_script_<(_target_name)',
-          'message': 'Creating java binary script <(_target_name)',
-          'variables': {
-            'output': '<(PRODUCT_DIR)/bin/<(_target_name)',
-          },
-          'inputs': [
-            '<(DEPTH)/build/android/gyp/create_java_binary_script.py',
-            '<(jar_path)',
-          ],
-          'outputs': [
-            '<(output)',
-          ],
-          'action': [
-            'python', '<(DEPTH)/build/android/gyp/create_java_binary_script.py',
-            '--classpath=>(input_jars_paths)',
-            '--jar-path=<(jar_path)',
-            '--output=<(output)',
-            '--main-class=>(main_class)',
-          ]
-        }
-      ]
-    }],
-    ['enable_errorprone == 1', {
-      'dependencies': [
-        '<(DEPTH)/third_party/errorprone/errorprone.gyp:chromium_errorprone',
-      ],
-    }],
-  ]
-}
-
diff --git a/build/host_prebuilt_jar.gypi b/build/host_prebuilt_jar.gypi
deleted file mode 100644
index feed5ca..0000000
--- a/build/host_prebuilt_jar.gypi
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into a target to provide a rule to
-# copy a prebuilt JAR for use on a host to the output directory.
-#
-# To use this, create a gyp target with the following form:
-# {
-#   'target_name': 'my_prebuilt_jar',
-#   'type': 'none',
-#   'variables': {
-#     'jar_path': 'path/to/prebuilt.jar',
-#   },
-#   'includes': [ 'path/to/this/gypi/file' ],
-# }
-#
-# Required variables:
-#   jar_path - The path to the prebuilt jar.
-
-{
-  'dependencies': [
-  ],
-  'variables': {
-    'dest_path': '<(PRODUCT_DIR)/lib.java/<(_target_name).jar',
-    'src_path': '<(jar_path)',
-  },
-  'all_dependent_settings': {
-    'variables': {
-      'input_jars_paths': [
-        '<(dest_path)',
-      ]
-    },
-  },
-  'actions': [
-    {
-      'action_name': 'copy_prebuilt_jar',
-      'message': 'Copy <(src_path) to <(dest_path)',
-      'inputs': [
-        '<(src_path)',
-      ],
-      'outputs': [
-        '<(dest_path)',
-      ],
-      'action': [
-        'python', '<(DEPTH)/build/cp.py', '<(src_path)', '<(dest_path)',
-      ],
-    }
-  ]
-}
diff --git a/build/install-android-sdks.sh b/build/install-android-sdks.sh
deleted file mode 100755
index 1119b7d..0000000
--- a/build/install-android-sdks.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash -e
-
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Script to install SDKs needed to build chromium on android.
-# See http://code.google.com/p/chromium/wiki/AndroidBuildInstructions
-
-echo 'checking for sdk packages install'
-# Use absolute path to call 'android' so script can be run from any directory.
-cwd=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
-# Get the SDK extras packages to install from the DEPS file 'sdkextras' hook.
-packages="$(python ${cwd}/get_sdk_extras_packages.py)"
-if [[ -n "${packages}" ]]; then
-  ${cwd}/../third_party/android_tools/sdk/tools/android update sdk --no-ui \
-      --filter ${packages}
-fi
-
-echo "install-android-sdks.sh complete."
diff --git a/build/install-build-deps-android.sh b/build/install-build-deps-android.sh
deleted file mode 100755
index cf87381..0000000
--- a/build/install-build-deps-android.sh
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/bin/bash -e
-
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Script to install everything needed to build chromium on android, including
-# items requiring sudo privileges.
-# See http://code.google.com/p/chromium/wiki/AndroidBuildInstructions
-
-# This script installs the sun-java6 packages (bin, jre and jdk). Sun requires
-# a license agreement, so upon installation it will prompt the user. To get
-# past the curses-based dialog press TAB <ret> TAB <ret> to agree.
-
-args="$@"
-if test "$1" = "--skip-sdk-packages"; then
-  skip_inst_sdk_packages=1
-  args="${@:2}"
-else
-  skip_inst_sdk_packages=0
-fi
-
-if ! uname -m | egrep -q "i686|x86_64"; then
-  echo "Only x86 architectures are currently supported" >&2
-  exit
-fi
-
-# Install first the default Linux build deps.
-"$(dirname "${BASH_SOURCE[0]}")/install-build-deps.sh" \
-  --no-syms --lib32 --no-arm --no-chromeos-fonts --no-nacl --no-prompt "${args}"
-
-lsb_release=$(lsb_release --codename --short)
-
-# The temporary directory used to store output of update-java-alternatives
-TEMPDIR=$(mktemp -d)
-cleanup() {
-  local status=${?}
-  trap - EXIT
-  rm -rf "${TEMPDIR}"
-  exit ${status}
-}
-trap cleanup EXIT
-
-# Fix deps
-sudo apt-get -f install
-
-# Install deps
-# This step differs depending on what Ubuntu release we are running
-# on since the package names are different, and Sun's Java must
-# be installed manually on late-model versions.
-
-# common
-sudo apt-get -y install lighttpd python-pexpect xvfb x11-utils
-
-# Some binaries in the Android SDK require 32-bit libraries on the host.
-# See https://developer.android.com/sdk/installing/index.html?pkg=tools
-if [[ $lsb_release == "precise" ]]; then
-  sudo apt-get -y install ia32-libs
-else
-  sudo apt-get -y install libncurses5:i386 libstdc++6:i386 zlib1g:i386
-fi
-
-sudo apt-get -y install ant
-
-# Install openjdk and openjre 7 stuff
-sudo apt-get -y install openjdk-7-jre openjdk-7-jdk
-
-# Switch version of Java to openjdk 7.
-# Some Java plugins (e.g. for firefox, mozilla) are not required to build, and
-# thus are treated only as warnings. Any errors in updating java alternatives
-# which are not '*-javaplugin.so' will cause errors and stop the script from
-# completing successfully.
-if ! sudo update-java-alternatives -s java-1.7.0-openjdk-amd64 \
-           >& "${TEMPDIR}"/update-java-alternatives.out
-then
-  # Check that there are the expected javaplugin.so errors for the update
-  if grep 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out >& \
-      /dev/null
-  then
-    # Print as warnings all the javaplugin.so errors
-    echo 'WARNING: java-6-sun has no alternatives for the following plugins:'
-    grep 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out
-  fi
-  # Check if there are any errors that are not javaplugin.so
-  if grep -v 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out \
-      >& /dev/null
-  then
-    # If there are non-javaplugin.so errors, treat as errors and exit
-    echo 'ERRORS: Failed to update alternatives for java-6-sun:'
-    grep -v 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out
-    exit 1
-  fi
-fi
-
-# Install SDK packages for android
-if test "$skip_inst_sdk_packages" != 1; then
-  "$(dirname "${BASH_SOURCE[0]}")/install-android-sdks.sh"
-fi
-
-echo "install-build-deps-android.sh complete."
diff --git a/build/install-build-deps.py b/build/install-build-deps.py
deleted file mode 100755
index 7cc3760..0000000
--- a/build/install-build-deps.py
+++ /dev/null
@@ -1,430 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import argparse
-import operator
-import os
-import platform
-import re
-import subprocess
-import sys
-
-
-SUPPORTED_UBUNTU_VERSIONS = (
-  {'number': '12.04', 'codename': 'precise'},
-  {'number': '14.04', 'codename': 'trusty'},
-  {'number': '14.10', 'codename': 'utopic'},
-  {'number': '15.04', 'codename': 'vivid'},
-)
-
-
-# Packages needed for chromeos only.
-_packages_chromeos_dev = (
-  'libbluetooth-dev',
-  'libxkbcommon-dev',
-  'realpath',
-)
-
-
-# Packages needed for development.
-_packages_dev = (
-  'apache2.2-bin',
-  'bison',
-  'cdbs',
-  'curl',
-  'devscripts',
-  'dpkg-dev',
-  'elfutils',
-  'fakeroot',
-  'flex',
-  'fonts-thai-tlwg',
-  'g++',
-  'git-core',
-  'git-svn',
-  'gperf',
-  'language-pack-da',
-  'language-pack-fr',
-  'language-pack-he',
-  'language-pack-zh-hant',
-  'libapache2-mod-php5',
-  'libasound2-dev',
-  'libav-tools',
-  'libbrlapi-dev',
-  'libbz2-dev',
-  'libcairo2-dev',
-  'libcap-dev',
-  'libcups2-dev',
-  'libcurl4-gnutls-dev',
-  'libdrm-dev',
-  'libelf-dev',
-  'libexif-dev',
-  'libgconf2-dev',
-  'libglib2.0-dev',
-  'libglu1-mesa-dev',
-  'libgnome-keyring-dev',
-  'libgtk2.0-dev',
-  'libkrb5-dev',
-  'libnspr4-dev',
-  'libnss3-dev',
-  'libpam0g-dev',
-  'libpci-dev',
-  'libpulse-dev',
-  'libsctp-dev',
-  'libspeechd-dev',
-  'libsqlite3-dev',
-  'libssl-dev',
-  'libudev-dev',
-  'libwww-perl',
-  'libxslt1-dev',
-  'libxss-dev',
-  'libxt-dev',
-  'libxtst-dev',
-  'openbox',
-  'patch',
-  'perl',
-  'php5-cgi',
-  'pkg-config',
-  'python',
-  'python-cherrypy3',
-  'python-crypto',
-  'python-dev',
-  'python-numpy',
-  'python-opencv',
-  'python-openssl',
-  'python-psutil',
-  'python-yaml',
-  'rpm',
-  'ruby',
-  'subversion',
-  'ttf-dejavu-core',
-  'ttf-indic-fonts',
-  'ttf-kochi-gothic',
-  'ttf-kochi-mincho',
-  'wdiff',
-  'xfonts-mathml',
-  'zip',
-)
-
-
-# Run-time libraries required by chromeos only.
-_packages_chromeos_lib = (
-  'libbz2-1.0',
-  'libpulse0',
-)
-
-
-# Full list of required run-time libraries.
-_packages_lib = (
-  'libasound2',
-  'libatk1.0-0',
-  'libc6',
-  'libcairo2',
-  'libcap2',
-  'libcups2',
-  'libexif12',
-  'libexpat1',
-  'libfontconfig1',
-  'libfreetype6',
-  'libglib2.0-0',
-  'libgnome-keyring0',
-  'libgtk2.0-0',
-  'libpam0g',
-  'libpango1.0-0',
-  'libpci3',
-  'libpcre3',
-  'libpixman-1-0',
-  'libpng12-0',
-  'libspeechd2',
-  'libsqlite3-0',
-  'libstdc++6',
-  'libx11-6',
-  'libxau6',
-  'libxcb1',
-  'libxcomposite1',
-  'libxcursor1',
-  'libxdamage1',
-  'libxdmcp6',
-  'libxext6',
-  'libxfixes3',
-  'libxi6',
-  'libxinerama1',
-  'libxrandr2',
-  'libxrender1',
-  'libxtst6',
-  'zlib1g',
-)
-
-
-# Debugging symbols for all of the run-time libraries.
-_packages_dbg = (
-  'libatk1.0-dbg',
-  'libc6-dbg',
-  'libcairo2-dbg',
-  'libfontconfig1-dbg',
-  'libglib2.0-0-dbg',
-  'libgtk2.0-0-dbg',
-  'libpango1.0-0-dbg',
-  'libpcre3-dbg',
-  'libpixman-1-0-dbg',
-  'libsqlite3-0-dbg',
-  'libx11-6-dbg',
-  'libxau6-dbg',
-  'libxcb1-dbg',
-  'libxcomposite1-dbg',
-  'libxcursor1-dbg',
-  'libxdamage1-dbg',
-  'libxdmcp6-dbg',
-  'libxext6-dbg',
-  'libxfixes3-dbg',
-  'libxi6-dbg',
-  'libxinerama1-dbg',
-  'libxrandr2-dbg',
-  'libxrender1-dbg',
-  'libxtst6-dbg',
-  'zlib1g-dbg',
-)
-
-
-# 32-bit libraries needed e.g. to compile V8 snapshot for Android or armhf.
-_packages_lib32 = (
-  'linux-libc-dev:i386',
-)
-
-
-# arm cross toolchain packages needed to build chrome on armhf.
-_packages_arm = (
-  'g++-arm-linux-gnueabihf',
-  'libc6-dev-armhf-cross',
-  'linux-libc-dev-armhf-cross',
-)
-
-
-# Packages to build NaCl, its toolchains, and its ports.
-_packages_naclports = (
-  'ant',
-  'autoconf',
-  'bison',
-  'cmake',
-  'gawk',
-  'intltool',
-  'xsltproc',
-  'xutils-dev',
-)
-_packages_nacl = (
-  'g++-mingw-w64-i686',
-  'lib32ncurses5-dev',
-  'lib32z1-dev',
-  'libasound2:i386',
-  'libcap2:i386',
-  'libelf-dev:i386',
-  'libexif12:i386',
-  'libfontconfig1:i386',
-  'libgconf-2-4:i386',
-  'libglib2.0-0:i386',
-  'libgpm2:i386',
-  'libgtk2.0-0:i386',
-  'libncurses5:i386',
-  'libnss3:i386',
-  'libpango1.0-0:i386',
-  'libssl1.0.0:i386',
-  'libtinfo-dev',
-  'libtinfo-dev:i386',
-  'libtool',
-  'libxcomposite1:i386',
-  'libxcursor1:i386',
-  'libxdamage1:i386',
-  'libxi6:i386',
-  'libxrandr2:i386',
-  'libxss1:i386',
-  'libxtst6:i386',
-  'texinfo',
-  'xvfb',
-)
-
-
-def is_userland_64_bit():
-  return platform.architecture()[0] == '64bit'
-
-
-def package_exists(pkg):
-  return pkg in subprocess.check_output(['apt-cache', 'pkgnames']).splitlines()
-
-
-def lsb_release_short_codename():
-  return subprocess.check_output(
-      ['lsb_release', '--codename', '--short']).strip()
-
-
-def write_error(message):
-  sys.stderr.write('ERROR: %s\n' % message)
-  sys.stderr.flush()
-
-
-def nonfatal_get_output(*popenargs, **kwargs):
-  process = subprocess.Popen(
-      stdout=subprocess.PIPE, stderr=subprocess.PIPE, *popenargs, **kwargs)
-  stdout, stderr = process.communicate()
-  retcode = process.poll()
-  return retcode, stdout, stderr
-
-
-def compute_dynamic_package_lists():
-  global _packages_arm
-  global _packages_dbg
-  global _packages_dev
-  global _packages_lib
-  global _packages_lib32
-  global _packages_nacl
-
-  if is_userland_64_bit():
-    # 64-bit systems need a minimum set of 32-bit compat packages
-    # for the pre-built NaCl binaries.
-    _packages_dev += (
-      'lib32gcc1',
-      'lib32stdc++6',
-      'libc6-i386',
-    )
-
-    # When cross building for arm/Android on 64-bit systems the host binaries
-    # that are part of v8 need to be compiled with -m32 which means
-    # that basic multilib support is needed.
-    # gcc-multilib conflicts with the arm cross compiler (at least in trusty)
-    # but g++-X.Y-multilib gives us the 32-bit support that we need. Find out
-    # the appropriate value of X and Y by seeing what version the current
-    # distribution's g++-multilib package depends on.
-    output = subprocess.check_output(['apt-cache', 'depends', 'g++-multilib'])
-    multilib_package = re.search(r'g\+\+-[0-9.]+-multilib', output).group()
-    _packages_lib32 += (multilib_package,)
-
-  lsb_codename = lsb_release_short_codename()
-
-  # Find the proper version of libstdc++6-4.x-dbg.
-  if lsb_codename == 'precise':
-    _packages_dbg += ('libstdc++6-4.6-dbg',)
-  elif lsb_codename == 'trusty':
-    _packages_dbg += ('libstdc++6-4.8-dbg',)
-  else:
-    _packages_dbg += ('libstdc++6-4.9-dbg',)
-
-  # Work around for dependency issue Ubuntu/Trusty: http://crbug.com/435056 .
-  if lsb_codename == 'trusty':
-    _packages_arm += (
-      'g++-4.8-multilib-arm-linux-gnueabihf',
-      'gcc-4.8-multilib-arm-linux-gnueabihf',
-    )
-
-  # Find the proper version of libgbm-dev. We can't just install libgbm-dev as
-  # it depends on mesa, and only one version of mesa can exists on the system.
-  # Hence we must match the same version or this entire script will fail.
-  mesa_variant = ''
-  for variant in ('-lts-trusty', '-lts-utopic'):
-    rc, stdout, stderr = nonfatal_get_output(
-        ['dpkg-query', '-Wf\'{Status}\'', 'libgl1-mesa-glx' + variant])
-    if 'ok installed' in output:
-      mesa_variant = variant
-  _packages_dev += (
-    'libgbm-dev' + mesa_variant,
-    'libgl1-mesa-dev' + mesa_variant,
-    'libgles2-mesa-dev' + mesa_variant,
-    'mesa-common-dev' + mesa_variant,
-  )
-
-  if package_exists('ttf-mscorefonts-installer'):
-    _packages_dev += ('ttf-mscorefonts-installer',)
-  else:
-    _packages_dev += ('msttcorefonts',)
-
-  if package_exists('libnspr4-dbg'):
-    _packages_dbg += ('libnspr4-dbg', 'libnss3-dbg')
-    _packages_lib += ('libnspr4', 'libnss3')
-  else:
-    _packages_dbg += ('libnspr4-0d-dbg', 'libnss3-1d-dbg')
-    _packages_lib += ('libnspr4-0d', 'libnss3-1d')
-
-  if package_exists('libjpeg-dev'):
-    _packages_dev += ('libjpeg-dev',)
-  else:
-    _packages_dev += ('libjpeg62-dev',)
-
-  if package_exists('libudev1'):
-    _packages_dev += ('libudev1',)
-    _packages_nacl += ('libudev1:i386',)
-  else:
-    _packages_dev += ('libudev0',)
-    _packages_nacl += ('libudev0:i386',)
-
-  if package_exists('libbrlapi0.6'):
-    _packages_dev += ('libbrlapi0.6',)
-  else:
-    _packages_dev += ('libbrlapi0.5',)
-
-  # Some packages are only needed if the distribution actually supports
-  # installing them.
-  if package_exists('appmenu-gtk'):
-    _packages_lib += ('appmenu-gtk',)
-
-  _packages_dev += _packages_chromeos_dev
-  _packages_lib += _packages_chromeos_lib
-  _packages_nacl += _packages_naclports
-
-
-def quick_check(packages):
-  rc, stdout, stderr = nonfatal_get_output([
-      'dpkg-query', '-W', '-f', '${PackageSpec}:${Status}\n'] + list(packages))
-  if rc == 0 and not stderr:
-    return 0
-  print stderr
-  return 1
-
-
-def main(argv):
-  parser = argparse.ArgumentParser()
-  parser.add_argument('--quick-check', action='store_true',
-                      help='quickly try to determine if dependencies are '
-                           'installed (this avoids interactive prompts and '
-                           'sudo commands so might not be 100% accurate)')
-  parser.add_argument('--unsupported', action='store_true',
-                      help='attempt installation even on unsupported systems')
-  args = parser.parse_args(argv)
-
-  lsb_codename = lsb_release_short_codename()
-  if not args.unsupported and not args.quick_check:
-    if lsb_codename not in map(
-        operator.itemgetter('codename'), SUPPORTED_UBUNTU_VERSIONS):
-      supported_ubuntus = ['%(number)s (%(codename)s)' % v
-                           for v in SUPPORTED_UBUNTU_VERSIONS]
-      write_error('Only Ubuntu %s are currently supported.' %
-                  ', '.join(supported_ubuntus))
-      return 1
-
-    if platform.machine() not in ('i686', 'x86_64'):
-      write_error('Only x86 architectures are currently supported.')
-      return 1
-
-  if os.geteuid() != 0 and not args.quick_check:
-    print 'Running as non-root user.'
-    print 'You might have to enter your password one or more times'
-    print 'for \'sudo\'.'
-    print
-
-  compute_dynamic_package_lists()
-
-  packages = (_packages_dev + _packages_lib + _packages_dbg + _packages_lib32 +
-              _packages_arm + _packages_nacl)
-  def packages_key(pkg):
-    s = pkg.rsplit(':', 1)
-    if len(s) == 1:
-      return (s, '')
-    return s
-  packages = sorted(set(packages), key=packages_key)
-
-  if args.quick_check:
-    return quick_check(packages)
-
-  return 0
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
diff --git a/build/install-build-deps.sh b/build/install-build-deps.sh
deleted file mode 100755
index 57f7216..0000000
--- a/build/install-build-deps.sh
+++ /dev/null
@@ -1,477 +0,0 @@
-#!/bin/bash -e
-
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Script to install everything needed to build chromium (well, ideally, anyway)
-# See http://code.google.com/p/chromium/wiki/LinuxBuildInstructions
-# and http://code.google.com/p/chromium/wiki/LinuxBuild64Bit
-
-usage() {
-  echo "Usage: $0 [--options]"
-  echo "Options:"
-  echo "--[no-]syms: enable or disable installation of debugging symbols"
-  echo "--lib32: enable installation of 32-bit libraries, e.g. for V8 snapshot"
-  echo "--[no-]arm: enable or disable installation of arm cross toolchain"
-  echo "--[no-]chromeos-fonts: enable or disable installation of Chrome OS"\
-       "fonts"
-  echo "--[no-]nacl: enable or disable installation of prerequisites for"\
-       "building standalone NaCl and all its toolchains"
-  echo "--no-prompt: silently select standard options/defaults"
-  echo "--quick-check: quickly try to determine if dependencies are installed"
-  echo "               (this avoids interactive prompts and sudo commands,"
-  echo "               so might not be 100% accurate)"
-  echo "--unsupported: attempt installation even on unsupported systems"
-  echo "Script will prompt interactively if options not given."
-  exit 1
-}
-
-# Checks whether a particular package is available in the repos.
-# USAGE: $ package_exists <package name>
-package_exists() {
-  apt-cache pkgnames | grep -x "$1" > /dev/null 2>&1
-}
-
-# These default to on because (some) bots need them and it keeps things
-# simple for the bot setup if all bots just run the script in its default
-# mode.  Developers who don't want stuff they don't need installed on their
-# own workstations can pass --no-arm --no-nacl when running the script.
-do_inst_arm=1
-do_inst_nacl=1
-
-while test "$1" != ""
-do
-  case "$1" in
-  --syms)                   do_inst_syms=1;;
-  --no-syms)                do_inst_syms=0;;
-  --lib32)                  do_inst_lib32=1;;
-  --arm)                    do_inst_arm=1;;
-  --no-arm)                 do_inst_arm=0;;
-  --chromeos-fonts)         do_inst_chromeos_fonts=1;;
-  --no-chromeos-fonts)      do_inst_chromeos_fonts=0;;
-  --nacl)                   do_inst_nacl=1;;
-  --no-nacl)                do_inst_nacl=0;;
-  --no-prompt)              do_default=1
-                            do_quietly="-qq --assume-yes"
-    ;;
-  --quick-check)            do_quick_check=1;;
-  --unsupported)            do_unsupported=1;;
-  *) usage;;
-  esac
-  shift
-done
-
-if test "$do_inst_arm" = "1"; then
-  do_inst_lib32=1
-fi
-
-# Check for lsb_release command in $PATH
-if ! which lsb_release > /dev/null; then
-  echo "ERROR: lsb_release not found in \$PATH" >&2
-  exit 1;
-fi
-
-distro=$(lsb_release --id --short)
-codename=$(lsb_release --codename --short)
-ubuntu_codenames="(precise|trusty|utopic|vivid)"
-debian_codenames="(stretch)"
-if [ 0 -eq "${do_unsupported-0}" ] && [ 0 -eq "${do_quick_check-0}" ] ; then
-  if [[ ! $codename =~ $ubuntu_codenames && ! $codename =~ $debian_codenames ]]; then
-    echo "ERROR: Only Ubuntu 12.04 (precise), 14.04 (trusty), " \
-      "14.10 (utopic) and 15.04 (vivid), and Debian Testing (stretch) are currently supported" >&2
-    exit 1
-  fi
-
-  if ! uname -m | egrep -q "i686|x86_64"; then
-    echo "Only x86 architectures are currently supported" >&2
-    exit
-  fi
-fi
-
-if [ "x$(id -u)" != x0 ] && [ 0 -eq "${do_quick_check-0}" ]; then
-  echo "Running as non-root user."
-  echo "You might have to enter your password one or more times for 'sudo'."
-  echo
-fi
-
-# Packages needed for chromeos only
-chromeos_dev_list="libbluetooth-dev libxkbcommon-dev realpath"
-
-# Packages needed for development
-if [[ $distro = Debian ]] ; then
-  # Debian-specific package names
-  dev_list="apache2-bin fonts-indic fonts-lyx"
-else
-  # Ubuntu-specific package names
-  dev_list="apache2.2-bin ttf-indic-fonts xfonts-mathml language-pack-da
-            language-pack-fr language-pack-he language-pack-zh-hant"
-fi
-dev_list="$dev_list bison cdbs curl dpkg-dev elfutils devscripts fakeroot
-          flex fonts-thai-tlwg g++ git-core git-svn gperf libapache2-mod-php5
-          libasound2-dev libbrlapi-dev libav-tools
-          libbz2-dev libcairo2-dev libcap-dev libcups2-dev libcurl4-gnutls-dev
-          libdrm-dev libelf-dev libexif-dev libgconf2-dev libglib2.0-dev
-          libglu1-mesa-dev libgnome-keyring-dev libgtk2.0-dev libkrb5-dev
-          libnspr4-dev libnss3-dev libpam0g-dev libpci-dev libpulse-dev
-          libsctp-dev libspeechd-dev libsqlite3-dev libssl-dev libudev-dev
-          libwww-perl libxslt1-dev libxss-dev libxt-dev libxtst-dev openbox
-          patch perl php5-cgi pkg-config python python-cherrypy3 python-crypto
-          python-dev python-numpy python-opencv python-openssl python-psutil
-          python-yaml rpm ruby subversion ttf-dejavu-core
-          ttf-kochi-gothic ttf-kochi-mincho wdiff zip
-          $chromeos_dev_list"
-
-# 64-bit systems need a minimum set of 32-bit compat packages for the pre-built
-# NaCl binaries.
-if file /sbin/init | grep -q 'ELF 64-bit'; then
-  dev_list="${dev_list} libc6-i386 lib32gcc1 lib32stdc++6"
-fi
-
-# Run-time libraries required by chromeos only
-chromeos_lib_list="libpulse0 libbz2-1.0"
-
-# Full list of required run-time libraries
-lib_list="libatk1.0-0 libc6 libasound2 libcairo2 libcap2 libcups2 libexpat1
-          libexif12 libfontconfig1 libfreetype6 libglib2.0-0 libgnome-keyring0
-          libgtk2.0-0 libpam0g libpango1.0-0 libpci3 libpcre3 libpixman-1-0
-          libpng12-0 libspeechd2 libstdc++6 libsqlite3-0 libx11-6
-          libxau6 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxdmcp6
-          libxext6 libxfixes3 libxi6 libxinerama1 libxrandr2 libxrender1
-          libxtst6 zlib1g $chromeos_lib_list"
-
-# Debugging symbols for all of the run-time libraries
-dbg_list="libatk1.0-dbg libc6-dbg libcairo2-dbg libfontconfig1-dbg
-          libglib2.0-0-dbg libgtk2.0-0-dbg libpango1.0-0-dbg libpcre3-dbg
-          libpixman-1-0-dbg libsqlite3-0-dbg libx11-6-dbg libxau6-dbg
-          libxcb1-dbg libxcomposite1-dbg libxcursor1-dbg libxdamage1-dbg
-          libxdmcp6-dbg libxext6-dbg libxfixes3-dbg libxi6-dbg libxinerama1-dbg
-          libxrandr2-dbg libxrender1-dbg libxtst6-dbg zlib1g-dbg"
-
-# Find the proper version of libstdc++6-4.x-dbg.
-if [ "x$codename" = "xprecise" ]; then
-  dbg_list="${dbg_list} libstdc++6-4.6-dbg"
-elif [ "x$codename" = "xtrusty" ]; then
-  dbg_list="${dbg_list} libstdc++6-4.8-dbg"
-else
-  dbg_list="${dbg_list} libstdc++6-4.9-dbg"
-fi
-
-# 32-bit libraries needed e.g. to compile V8 snapshot for Android or armhf
-lib32_list="linux-libc-dev:i386"
-
-# arm cross toolchain packages needed to build chrome on armhf
-arm_list="libc6-dev-armhf-cross
-          linux-libc-dev-armhf-cross"
-
-# Work around for dependency issue Debian/Stretch
-if [ "x$codename" = "xstretch" ]; then
-  arm_list+=" g++-5-arm-linux-gnueabihf"
-else
-  arm_list+=" g++-arm-linux-gnueabihf"
-fi
-
-# Work around for dependency issue Ubuntu/Trusty: http://crbug.com/435056
-if [ "x$codename" = "xtrusty" ]; then
-  arm_list+=" g++-4.8-multilib-arm-linux-gnueabihf
-              gcc-4.8-multilib-arm-linux-gnueabihf"
-fi
-
-# Packages to build NaCl, its toolchains, and its ports.
-naclports_list="ant autoconf bison cmake gawk intltool xutils-dev xsltproc"
-nacl_list="g++-mingw-w64-i686 lib32z1-dev
-           libasound2:i386 libcap2:i386 libelf-dev:i386 libexif12:i386
-           libfontconfig1:i386 libgconf-2-4:i386 libglib2.0-0:i386 libgpm2:i386
-           libgtk2.0-0:i386 libncurses5:i386 lib32ncurses5-dev
-           libnss3:i386 libpango1.0-0:i386
-           libssl1.0.0:i386 libtinfo-dev libtinfo-dev:i386 libtool
-           libxcomposite1:i386 libxcursor1:i386 libxdamage1:i386 libxi6:i386
-           libxrandr2:i386 libxss1:i386 libxtst6:i386 texinfo xvfb
-           ${naclports_list}"
-
-# Find the proper version of libgbm-dev. We can't just install libgbm-dev as
-# it depends on mesa, and only one version of mesa can exists on the system.
-# Hence we must match the same version or this entire script will fail.
-mesa_variant=""
-for variant in "-lts-trusty" "-lts-utopic"; do
-  if $(dpkg-query -Wf'${Status}' libgl1-mesa-glx${variant} 2>/dev/null | \
-       grep -q " ok installed"); then
-    mesa_variant="${variant}"
-  fi
-done
-dev_list="${dev_list} libgbm-dev${mesa_variant}
-          libgles2-mesa-dev${mesa_variant} libgl1-mesa-dev${mesa_variant}
-          mesa-common-dev${mesa_variant}"
-nacl_list="${nacl_list} libgl1-mesa-glx${mesa_variant}:i386"
-
-# Some package names have changed over time
-if package_exists ttf-mscorefonts-installer; then
-  dev_list="${dev_list} ttf-mscorefonts-installer"
-else
-  dev_list="${dev_list} msttcorefonts"
-fi
-if package_exists libnspr4-dbg; then
-  dbg_list="${dbg_list} libnspr4-dbg libnss3-dbg"
-  lib_list="${lib_list} libnspr4 libnss3"
-else
-  dbg_list="${dbg_list} libnspr4-0d-dbg libnss3-1d-dbg"
-  lib_list="${lib_list} libnspr4-0d libnss3-1d"
-fi
-if package_exists libjpeg-dev; then
-  dev_list="${dev_list} libjpeg-dev"
-else
-  dev_list="${dev_list} libjpeg62-dev"
-fi
-if package_exists libudev1; then
-  dev_list="${dev_list} libudev1"
-  nacl_list="${nacl_list} libudev1:i386"
-else
-  dev_list="${dev_list} libudev0"
-  nacl_list="${nacl_list} libudev0:i386"
-fi
-if package_exists libbrlapi0.6; then
-  dev_list="${dev_list} libbrlapi0.6"
-else
-  dev_list="${dev_list} libbrlapi0.5"
-fi
-
-
-# Some packages are only needed if the distribution actually supports
-# installing them.
-if package_exists appmenu-gtk; then
-  lib_list="$lib_list appmenu-gtk"
-fi
-
-# When cross building for arm/Android on 64-bit systems the host binaries
-# that are part of v8 need to be compiled with -m32 which means
-# that basic multilib support is needed.
-if file /sbin/init | grep -q 'ELF 64-bit'; then
-  # gcc-multilib conflicts with the arm cross compiler (at least in trusty) but
-  # g++-X.Y-multilib gives us the 32-bit support that we need. Find out the
-  # appropriate value of X and Y by seeing what version the current
-  # distribution's g++-multilib package depends on.
-  multilib_package=$(apt-cache depends g++-multilib --important | \
-      grep -E --color=never --only-matching '\bg\+\+-[0-9.]+-multilib\b')
-  lib32_list="$lib32_list $multilib_package"
-fi
-
-# Waits for the user to press 'Y' or 'N'. Either uppercase of lowercase is
-# accepted. Returns 0 for 'Y' and 1 for 'N'. If an optional parameter has
-# been provided to yes_no(), the function also accepts RETURN as a user input.
-# The parameter specifies the exit code that should be returned in that case.
-# The function will echo the user's selection followed by a newline character.
-# Users can abort the function by pressing CTRL-C. This will call "exit 1".
-yes_no() {
-  if [ 0 -ne "${do_default-0}" ] ; then
-    [ $1 -eq 0 ] && echo "Y" || echo "N"
-    return $1
-  fi
-  local c
-  while :; do
-    c="$(trap 'stty echo -iuclc icanon 2>/dev/null' EXIT INT TERM QUIT
-         stty -echo iuclc -icanon 2>/dev/null
-         dd count=1 bs=1 2>/dev/null | od -An -tx1)"
-    case "$c" in
-      " 0a") if [ -n "$1" ]; then
-               [ $1 -eq 0 ] && echo "Y" || echo "N"
-               return $1
-             fi
-             ;;
-      " 79") echo "Y"
-             return 0
-             ;;
-      " 6e") echo "N"
-             return 1
-             ;;
-      "")    echo "Aborted" >&2
-             exit 1
-             ;;
-      *)     # The user pressed an unrecognized key. As we are not echoing
-             # any incorrect user input, alert the user by ringing the bell.
-             (tput bel) 2>/dev/null
-             ;;
-    esac
-  done
-}
-
-if test "$do_inst_syms" = "" && test 0 -eq ${do_quick_check-0}
-then
-  echo "This script installs all tools and libraries needed to build Chromium."
-  echo ""
-  echo "For most of the libraries, it can also install debugging symbols, which"
-  echo "will allow you to debug code in the system libraries. Most developers"
-  echo "won't need these symbols."
-  echo -n "Do you want me to install them for you (y/N) "
-  if yes_no 1; then
-    do_inst_syms=1
-  fi
-fi
-if test "$do_inst_syms" = "1"; then
-  echo "Including debugging symbols."
-else
-  echo "Skipping debugging symbols."
-  dbg_list=
-fi
-
-if test "$do_inst_lib32" = "1" ; then
-  echo "Including 32-bit libraries for ARM/Android."
-else
-  echo "Skipping 32-bit libraries for ARM/Android."
-  lib32_list=
-fi
-
-if test "$do_inst_arm" = "1" ; then
-  echo "Including ARM cross toolchain."
-else
-  echo "Skipping ARM cross toolchain."
-  arm_list=
-fi
-
-if test "$do_inst_nacl" = "1"; then
-  echo "Including NaCl, NaCl toolchain, NaCl ports dependencies."
-else
-  echo "Skipping NaCl, NaCl toolchain, NaCl ports dependencies."
-  nacl_list=
-fi
-
-# The `sort -r -s -t: -k2` sorts all the :i386 packages to the front, to avoid
-# confusing dpkg-query (crbug.com/446172).
-packages="$(
-  echo "${dev_list} ${lib_list} ${dbg_list} ${lib32_list} ${arm_list}"\
-       "${nacl_list}" | tr " " "\n" | sort -u | sort -r -s -t: -k2 | tr "\n" " "
-)"
-
-if [ 1 -eq "${do_quick_check-0}" ] ; then
-  failed_check="$(dpkg-query -W -f '${PackageSpec}:${Status}\n' \
-    ${packages} 2>&1 | grep -v "ok installed" || :)"
-  if [ -n "${failed_check}" ]; then
-    echo
-    nomatch="$(echo "${failed_check}" | \
-      sed -e "s/^No packages found matching \(.*\).$/\1/;t;d")"
-    missing="$(echo "${failed_check}" | \
-      sed -e "/^No packages found matching/d;s/^\(.*\):.*$/\1/")"
-    if [ "$nomatch" ]; then
-      # Distinguish between packages that actually aren't available to the
-      # system (i.e. not in any repo) and packages that just aren't known to
-      # dpkg (i.e. managed by apt).
-      unknown=""
-      for p in ${nomatch}; do
-        if apt-cache show ${p} > /dev/null 2>&1; then
-          missing="${p}\n${missing}"
-        else
-          unknown="${p}\n${unknown}"
-        fi
-      done
-      if [ -n "${unknown}" ]; then
-        echo "WARNING: The following packages are unknown to your system"
-        echo "(maybe missing a repo or need to 'sudo apt-get update'):"
-        echo -e "${unknown}" | sed -e "s/^/  /"
-      fi
-    fi
-    if [ -n "${missing}" ]; then
-      echo "WARNING: The following packages are not installed:"
-      echo -e "${missing}" | sed -e "s/^/  /"
-    fi
-    exit 1
-  fi
-  exit 0
-fi
-
-if test "$do_inst_lib32" = "1" || test "$do_inst_nacl" = "1"; then
-  if [[ ! $codename =~ (precise) ]]; then
-    sudo dpkg --add-architecture i386
-  fi
-fi
-sudo apt-get update
-
-# We initially run "apt-get" with the --reinstall option and parse its output.
-# This way, we can find all the packages that need to be newly installed
-# without accidentally promoting any packages from "auto" to "manual".
-# We then re-run "apt-get" with just the list of missing packages.
-echo "Finding missing packages..."
-# Intentionally leaving $packages unquoted so it's more readable.
-echo "Packages required: " $packages
-echo
-new_list_cmd="sudo apt-get install --reinstall $(echo $packages)"
-if new_list="$(yes n | LANGUAGE=en LANG=C $new_list_cmd)"; then
-  # We probably never hit this following line.
-  echo "No missing packages, and the packages are up-to-date."
-elif [ $? -eq 1 ]; then
-  # We expect apt-get to have exit status of 1.
-  # This indicates that we cancelled the install with "yes n|".
-  new_list=$(echo "$new_list" |
-    sed -e '1,/The following NEW packages will be installed:/d;s/^  //;t;d')
-  new_list=$(echo "$new_list" | sed 's/ *$//')
-  if [ -z "$new_list" ] ; then
-    echo "No missing packages, and the packages are up-to-date."
-  else
-    echo "Installing missing packages: $new_list."
-    sudo apt-get install ${do_quietly-} ${new_list}
-  fi
-  echo
-else
-  # An apt-get exit status of 100 indicates that a real error has occurred.
-
-  # I am intentionally leaving out the '"'s around new_list_cmd,
-  # as this makes it easier to cut and paste the output
-  echo "The following command failed: " ${new_list_cmd}
-  echo
-  echo "It produces the following output:"
-  yes n | $new_list_cmd || true
-  echo
-  echo "You will have to install the above packages yourself."
-  echo
-  exit 100
-fi
-
-# Install the Chrome OS default fonts. This must go after running
-# apt-get, since install-chromeos-fonts depends on curl.
-if test "$do_inst_chromeos_fonts" != "0"; then
-  echo
-  echo "Installing Chrome OS fonts."
-  dir=`echo $0 | sed -r -e 's/\/[^/]+$//'`
-  if ! sudo $dir/linux/install-chromeos-fonts.py; then
-    echo "ERROR: The installation of the Chrome OS default fonts failed."
-    if [ `stat -f -c %T $dir` == "nfs" ]; then
-      echo "The reason is that your repo is installed on a remote file system."
-    else
-      echo "This is expected if your repo is installed on a remote file system."
-    fi
-    echo "It is recommended to install your repo on a local file system."
-    echo "You can skip the installation of the Chrome OS default founts with"
-    echo "the command line option: --no-chromeos-fonts."
-    exit 1
-  fi
-else
-  echo "Skipping installation of Chrome OS fonts."
-fi
-
-# $1 - target name
-# $2 - link name
-create_library_symlink() {
-  target=$1
-  linkname=$2
-  if [ -L $linkname ]; then
-    if [ "$(basename $(readlink $linkname))" != "$(basename $target)" ]; then
-      sudo rm $linkname
-    fi
-  fi
-  if [ ! -r $linkname ]; then
-    echo "Creating link: $linkname"
-    sudo ln -fs $target $linkname
-  fi
-}
-
-if test "$do_inst_nacl" = "1"; then
-  echo "Installing symbolic links for NaCl."
-  # naclports needs to cross build python for i386, but libssl1.0.0:i386
-  # only contains libcrypto.so.1.0.0 and not the symlink needed for
-  # linking (libcrypto.so).
-  create_library_symlink /lib/i386-linux-gnu/libcrypto.so.1.0.0 \
-      /usr/lib/i386-linux-gnu/libcrypto.so
-
-  create_library_symlink /lib/i386-linux-gnu/libssl.so.1.0.0 \
-      /usr/lib/i386-linux-gnu/libssl.so
-else
-  echo "Skipping symbolic links for NaCl."
-fi
diff --git a/build/install-chroot.sh b/build/install-chroot.sh
deleted file mode 100755
index 99451ed..0000000
--- a/build/install-chroot.sh
+++ /dev/null
@@ -1,888 +0,0 @@
-#!/bin/bash -e
-
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This script installs Debian-derived distributions in a chroot environment.
-# It can for example be used to have an accurate 32bit build and test
-# environment when otherwise working on a 64bit machine.
-# N. B. it is unlikely that this script will ever work on anything other than a
-# Debian-derived system.
-
-# Older Debian based systems had both "admin" and "adm" groups, with "admin"
-# apparently being used in more places. Newer distributions have standardized
-# on just the "adm" group. Check /etc/group for the preferred name of the
-# administrator group.
-admin=$(grep '^admin:' /etc/group >&/dev/null && echo admin || echo adm)
-
-usage() {
-  echo "usage: ${0##*/} [-m mirror] [-g group,...] [-s] [-c]"
-  echo "-b dir       additional directories that should be bind mounted,"
-  echo '             or "NONE".'
-  echo "             Default: if local filesystems present, ask user for help"
-  echo "-g group,... groups that can use the chroot unauthenticated"
-  echo "             Default: '${admin}' and current user's group ('$(id -gn)')"
-  echo "-l           List all installed chroot environments"
-  echo "-m mirror    an alternate repository mirror for package downloads"
-  echo "-s           configure default deb-srcs"
-  echo "-c           always copy 64bit helper binaries to 32bit chroot"
-  echo "-h           this help message"
-}
-
-process_opts() {
-  local OPTNAME OPTIND OPTERR OPTARG
-  while getopts ":b:g:lm:sch" OPTNAME; do
-    case "$OPTNAME" in
-      b)
-        if [ "${OPTARG}" = "NONE" -a -z "${bind_mounts}" ]; then
-          bind_mounts="${OPTARG}"
-        else
-          if [ "${bind_mounts}" = "NONE" -o "${OPTARG}" = "${OPTARG#/}" -o \
-               ! -d "${OPTARG}" ]; then
-            echo "Invalid -b option(s)"
-            usage
-            exit 1
-          fi
-          bind_mounts="${bind_mounts}
-${OPTARG} ${OPTARG} none rw,bind 0 0"
-        fi
-        ;;
-      g)
-        [ -n "${OPTARG}" ] &&
-          chroot_groups="${chroot_groups}${chroot_groups:+,}${OPTARG}"
-        ;;
-      l)
-        list_all_chroots
-        exit
-        ;;
-      m)
-        if [ -n "${mirror}" ]; then
-          echo "You can only specify exactly one mirror location"
-          usage
-          exit 1
-        fi
-        mirror="$OPTARG"
-        ;;
-      s)
-        add_srcs="y"
-        ;;
-      c)
-        copy_64="y"
-        ;;
-      h)
-        usage
-        exit 0
-        ;;
-      \:)
-        echo "'-$OPTARG' needs an argument."
-        usage
-        exit 1
-        ;;
-      *)
-        echo "invalid command-line option: $OPTARG"
-        usage
-        exit 1
-        ;;
-    esac
-  done
-
-  if [ $# -ge ${OPTIND} ]; then
-    eval echo "Unexpected command line argument: \${${OPTIND}}"
-    usage
-    exit 1
-  fi
-}
-
-list_all_chroots() {
-  for i in /var/lib/chroot/*; do
-    i="${i##*/}"
-    [ "${i}" = "*" ] && continue
-    [ -x "/usr/local/bin/${i%bit}" ] || continue
-    grep -qs "^\[${i%bit}\]\$" /etc/schroot/schroot.conf || continue
-    [ -r "/etc/schroot/script-${i}" -a \
-      -r "/etc/schroot/mount-${i}" ] || continue
-    echo "${i%bit}"
-  done
-}
-
-getkey() {
-  (
-    trap 'stty echo -iuclc icanon 2>/dev/null' EXIT INT TERM QUIT HUP
-    stty -echo iuclc -icanon 2>/dev/null
-    dd count=1 bs=1 2>/dev/null
-  )
-}
-
-chr() {
-  printf "\\$(printf '%03o' "$1")"
-}
-
-ord() {
-  printf '%d' $(printf '%c' "$1" | od -tu1 -An)
-}
-
-is_network_drive() {
-  stat -c %T -f "$1/" 2>/dev/null |
-    egrep -qs '^nfs|cifs|smbfs'
-}
-
-# Check that we are running as a regular user
-[ "$(id -nu)" = root ] && {
-  echo "Run this script as a regular user and provide your \"sudo\""           \
-       "password if requested" >&2
-  exit 1
-}
-
-process_opts "$@"
-
-echo "This script will help you through the process of installing a"
-echo "Debian or Ubuntu distribution in a chroot environment. You will"
-echo "have to provide your \"sudo\" password when requested."
-echo
-
-# Error handler
-trap 'exit 1' INT TERM QUIT HUP
-trap 'sudo apt-get clean; tput bel; echo; echo Failed' EXIT
-
-# Install any missing applications that this script relies on. If these packages
-# are already installed, don't force another "apt-get install". That would
-# prevent them from being auto-removed, if they ever become eligible for that.
-# And as this script only needs the packages once, there is no good reason to
-# introduce a hard dependency on things such as dchroot and debootstrap.
-dep=
-for i in dchroot debootstrap libwww-perl; do
-  [ -d /usr/share/doc/"$i" ] || dep="$dep $i"
-done
-[ -n "$dep" ] && sudo apt-get -y install $dep
-sudo apt-get -y install schroot
-
-# Create directory for chroot
-sudo mkdir -p /var/lib/chroot
-
-# Find chroot environments that can be installed with debootstrap
-targets="$(cd /usr/share/debootstrap/scripts
-           ls | grep '^[a-z]*$')"
-
-# Ask user to pick one of the available targets
-echo "The following targets are available to be installed in a chroot:"
-j=1; for i in $targets; do
-  printf '%4d: %s\n' "$j" "$i"
-  j=$(($j+1))
-done
-while :; do
-  printf "Which target would you like to install: "
-  read n
-  [ "$n" -gt 0 -a "$n" -lt "$j" ] >&/dev/null && break
-done
-j=1; for i in $targets; do
-  [ "$j" -eq "$n" ] && { distname="$i"; break; }
-  j=$(($j+1))
-done
-echo
-
-# On x86-64, ask whether the user wants to install x86-32 or x86-64
-archflag=
-arch=
-if [ "$(uname -m)" = x86_64 ]; then
-  while :; do
-    echo "You are running a 64bit kernel. This allows you to install either a"
-    printf "32bit or a 64bit chroot environment. %s"                           \
-           "Which one do you want (32, 64) "
-    read arch
-    [ "${arch}" == 32 -o "${arch}" == 64 ] && break
-  done
-  [ "${arch}" == 32 ] && archflag="--arch i386" || archflag="--arch amd64"
-  arch="${arch}bit"
-  echo
-fi
-target="${distname}${arch}"
-
-# Don't accidentally overwrite an existing installation
-[ -d /var/lib/chroot/"${target}" ] && {
-  while :; do
-    echo "This chroot already exists on your machine."
-    if schroot -l --all-sessions 2>&1 |
-       sed 's/^session://' |
-       grep -qs "^${target%bit}-"; then
-      echo "And it appears to be in active use. Terminate all programs that"
-      echo "are currently using the chroot environment and then re-run this"
-      echo "script."
-      echo "If you still get an error message, you might have stale mounts"
-      echo "that you forgot to delete. You can always clean up mounts by"
-      echo "executing \"${target%bit} -c\"."
-      exit 1
-    fi
-    echo "I can abort installation, I can overwrite the existing chroot,"
-    echo "or I can delete the old one and then exit. What would you like to"
-    printf "do (a/o/d)? "
-    read choice
-    case "${choice}" in
-      a|A) exit 1;;
-      o|O) sudo rm -rf "/var/lib/chroot/${target}"; break;;
-      d|D) sudo rm -rf "/var/lib/chroot/${target}"      \
-                       "/usr/local/bin/${target%bit}"   \
-                       "/etc/schroot/mount-${target}"   \
-                       "/etc/schroot/script-${target}"  \
-                       "/etc/schroot/${target}"
-           sudo sed -ni '/^[[]'"${target%bit}"']$/,${
-                         :1;n;/^[[]/b2;b1;:2;p;n;b2};p' \
-                       "/etc/schroot/schroot.conf"
-           trap '' INT TERM QUIT HUP
-           trap '' EXIT
-           echo "Deleted!"
-           exit 0;;
-    esac
-  done
-  echo
-}
-sudo mkdir -p /var/lib/chroot/"${target}"
-
-# Offer to include additional standard repositories for Ubuntu-based chroots.
-alt_repos=
-grep -qs ubuntu.com /usr/share/debootstrap/scripts/"${distname}" && {
-  while :; do
-    echo "Would you like to add ${distname}-updates and ${distname}-security "
-    printf "to the chroot's sources.list (y/n)? "
-    read alt_repos
-    case "${alt_repos}" in
-      y|Y)
-        alt_repos="y"
-        break
-      ;;
-      n|N)
-        break
-      ;;
-    esac
-  done
-  echo
-}
-
-# Check for non-standard file system mount points and ask the user whether
-# they should be imported into the chroot environment
-# We limit to the first 26 mount points that much some basic heuristics,
-# because a) that allows us to enumerate choices with a single character,
-# and b) if we find more than 26 mount points, then these are probably
-# false-positives and something is very unusual about the system's
-# configuration. No need to spam the user with even more information that
-# is likely completely irrelevant.
-if [ -z "${bind_mounts}" ]; then
-  mounts="$(awk '$2 != "/" && $2 !~ "^/boot" && $2 !~ "^/home" &&
-                 $2 !~ "^/media" && $2 !~ "^/run" &&
-                 ($3 ~ "ext[2-4]" || $3 == "reiserfs" || $3 == "btrfs" ||
-                 $3 == "xfs" || $3 == "jfs" || $3 == "u?msdos" ||
-                 $3 == "v?fat" || $3 == "hfs" || $3 == "ntfs" ||
-                 $3 ~ "nfs[4-9]?" || $3 == "smbfs" || $3 == "cifs") {
-                   print $2
-                 }' /proc/mounts |
-            head -n26)"
-  if [ -n "${mounts}" ]; then
-    echo "You appear to have non-standard mount points that you"
-    echo "might want to import into the chroot environment:"
-    echo
-    sel=
-    while :; do
-      # Print a menu, listing all non-default mounts of local or network
-      # file systems.
-      j=1; for m in ${mounts}; do
-        c="$(printf $(printf '\\%03o' $((64+$j))))"
-        echo "$sel" | grep -qs $c &&
-          state="mounted in chroot" || state="$(tput el)"
-        printf "   $c) %-40s${state}\n" "$m"
-        j=$(($j+1))
-      done
-      # Allow user to interactively (de-)select any of the entries
-      echo
-      printf "Select mount points that you want to be included or press %s" \
-             "SPACE to continue"
-      c="$(getkey | tr a-z A-Z)"
-      [ "$c" == " " ] && { echo; echo; break; }
-      if [ -z "$c" ] ||
-         [ "$c" '<' 'A' -o $(ord "$c") -gt $((64 + $(ord "$j"))) ]; then
-          # Invalid input, ring the console bell
-          tput bel
-      else
-        # Toggle the selection for the given entry
-        if echo "$sel" | grep -qs $c; then
-          sel="$(printf "$sel" | sed "s/$c//")"
-        else
-          sel="$sel$c"
-        fi
-      fi
-      # Reposition cursor to the top of the list of entries
-      tput cuu $(($j + 1))
-      echo
-    done
-  fi
-  j=1; for m in ${mounts}; do
-    c="$(chr $(($j + 64)))"
-    if echo "$sel" | grep -qs $c; then
-      bind_mounts="${bind_mounts}$m $m none rw,bind 0 0
-"
-    fi
-    j=$(($j+1))
-  done
-fi
-
-# Remove stale entry from /etc/schroot/schroot.conf. Entries start
-# with the target name in square brackets, followed by an arbitrary
-# number of lines. The entry stops when either the end of file has
-# been reached, or when the beginning of a new target is encountered.
-# This means, we cannot easily match for a range of lines in
-# "sed". Instead, we actually have to iterate over each line and check
-# whether it is the beginning of a new entry.
-sudo sed -ni '/^[[]'"${target%bit}"']$/,${:1;n;/^[[]/b2;b1;:2;p;n;b2};p'       \
-         /etc/schroot/schroot.conf
-
-# Download base system. This takes some time
-if [ -z "${mirror}" ]; then
- grep -qs ubuntu.com /usr/share/debootstrap/scripts/"${distname}" &&
-   mirror="http://archive.ubuntu.com/ubuntu" ||
-   mirror="http://ftp.us.debian.org/debian"
-fi
-
-sudo ${http_proxy:+http_proxy="${http_proxy}"} debootstrap ${archflag} \
-    "${distname}" "/var/lib/chroot/${target}"  "$mirror"
-
-# Add new entry to /etc/schroot/schroot.conf
-grep -qs ubuntu.com /usr/share/debootstrap/scripts/"${distname}" &&
-  brand="Ubuntu" || brand="Debian"
-if [ -z "${chroot_groups}" ]; then
-  chroot_groups="${admin},$(id -gn)"
-fi
-
-if [ -d '/etc/schroot/default' ]; then
-  new_version=1
-  fstab="/etc/schroot/${target}/fstab"
-else
-  new_version=0
-  fstab="/etc/schroot/mount-${target}"
-fi
-
-if [ "$new_version" = "1" ]; then
-  sudo cp -ar /etc/schroot/default /etc/schroot/${target}
-
-  sudo sh -c 'cat >>/etc/schroot/schroot.conf' <<EOF
-[${target%bit}]
-description=${brand} ${distname} ${arch}
-type=directory
-directory=/var/lib/chroot/${target}
-users=root
-groups=${chroot_groups}
-root-groups=${chroot_groups}
-personality=linux$([ "${arch}" != 64bit ] && echo 32)
-profile=${target}
-
-EOF
-  [ -n "${bind_mounts}" -a "${bind_mounts}" != "NONE" ] &&
-    printf "${bind_mounts}" |
-      sudo sh -c "cat >>${fstab}"
-else
-  # Older versions of schroot wanted a "priority=" line, whereas recent
-  # versions deprecate "priority=" and warn if they see it. We don't have
-  # a good feature test, but scanning for the string "priority=" in the
-  # existing "schroot.conf" file is a good indication of what to do.
-  priority=$(grep -qs 'priority=' /etc/schroot/schroot.conf &&
-           echo 'priority=3' || :)
-  sudo sh -c 'cat >>/etc/schroot/schroot.conf' <<EOF
-[${target%bit}]
-description=${brand} ${distname} ${arch}
-type=directory
-directory=/var/lib/chroot/${target}
-users=root
-groups=${chroot_groups}
-root-groups=${chroot_groups}
-personality=linux$([ "${arch}" != 64bit ] && echo 32)
-script-config=script-${target}
-${priority}
-
-EOF
-
-  # Set up a list of mount points that is specific to this
-  # chroot environment.
-  sed '/^FSTAB=/s,"[^"]*","'"${fstab}"'",' \
-           /etc/schroot/script-defaults |
-    sudo sh -c 'cat >/etc/schroot/script-'"${target}"
-  sed '\,^/home[/[:space:]],s/\([,[:space:]]\)bind[[:space:]]/\1rbind /' \
-    /etc/schroot/mount-defaults |
-    sudo sh -c "cat > ${fstab}"
-fi
-
-# Add the extra mount points that the user told us about
-[ -n "${bind_mounts}" -a "${bind_mounts}" != "NONE" ] &&
-  printf "${bind_mounts}" |
-    sudo sh -c 'cat >>'"${fstab}"
-
-# If this system has a "/media" mountpoint, import it into the chroot
-# environment. Most modern distributions use this mount point to
-# automatically mount devices such as CDROMs, USB sticks, etc...
-if [ -d /media ] &&
-   ! grep -qs '^/media' "${fstab}"; then
-  echo '/media /media none rw,rbind 0 0' |
-    sudo sh -c 'cat >>'"${fstab}"
-fi
-
-# Share /dev/shm, /run and /run/shm.
-grep -qs '^/dev/shm' "${fstab}" ||
-  echo '/dev/shm /dev/shm none rw,bind 0 0' |
-    sudo sh -c 'cat >>'"${fstab}"
-if [ ! -d "/var/lib/chroot/${target}/run" ] &&
-   ! grep -qs '^/run' "${fstab}"; then
-  echo '/run /run none rw,bind 0 0' |
-    sudo sh -c 'cat >>'"${fstab}"
-fi
-if ! grep -qs '^/run/shm' "${fstab}"; then
-  { [ -d /run ] && echo '/run/shm /run/shm none rw,bind 0 0' ||
-                   echo '/dev/shm /run/shm none rw,bind 0 0'; } |
-    sudo sh -c 'cat >>'"${fstab}"
-fi
-
-# Set up a special directory that changes contents depending on the target
-# that is executing.
-d="$(readlink -f "${HOME}/chroot" 2>/dev/null || echo "${HOME}/chroot")"
-s="${d}/.${target}"
-echo "${s} ${d} none rw,bind 0 0" |
-  sudo sh -c 'cat >>'"${target}"
-mkdir -p "${s}"
-
-# Install a helper script to launch commands in the chroot
-sudo sh -c 'cat >/usr/local/bin/'"${target%bit}" <<'EOF'
-#!/bin/bash
-
-chroot="${0##*/}"
-
-wrap() {
-  # Word-wrap the text passed-in on stdin. Optionally, on continuation lines
-  # insert the same number of spaces as the number of characters in the
-  # parameter(s) passed to this function.
-  # If the "fold" program cannot be found, or if the actual width of the
-  # terminal cannot be determined, this function doesn't attempt to do any
-  # wrapping.
-  local f="$(type -P fold)"
-  [ -z "${f}" ] && { cat; return; }
-  local c="$(stty -a </dev/tty 2>/dev/null |
-             sed 's/.*columns[[:space:]]*\([0-9]*\).*/\1/;t;d')"
-  [ -z "${c}" ] && { cat; return; }
-  local i="$(echo "$*"|sed 's/./ /g')"
-  local j="$(printf %s "${i}"|wc -c)"
-  if [ "${c}" -gt "${j}" ]; then
-    dd bs=1 count="${j}" 2>/dev/null
-    "${f}" -sw "$((${c}-${j}))" | sed '2,$s/^/'"${i}"'/'
-  else
-    "${f}" -sw "${c}"
-  fi
-}
-
-help() {
-  echo "Usage ${0##*/} [-h|--help] [-c|--clean] [-C|--clean-all] [-l|--list] [--] args" | wrap "Usage ${0##*/} "
-  echo "  help:      print this message"                                                | wrap "             "
-  echo "  list:      list all known chroot environments"                                | wrap "             "
-  echo "  clean:     remove all old chroot sessions for \"${chroot}\""                  | wrap "             "
-  echo "  clean-all: remove all old chroot sessions for all environments"               | wrap "             "
-  exit 0
-}
-
-clean() {
-  local s t rc
-  rc=0
-  for s in $(schroot -l --all-sessions); do
-    if [ -n "$1" ]; then
-      t="${s#session:}"
-      [ "${t#${chroot}-}" == "${t}" ] && continue
-    fi
-    if ls -l /proc/*/{cwd,fd} 2>/dev/null |
-       fgrep -qs "/var/lib/schroot/mount/${t}"; then
-      echo "Session \"${t}\" still has active users, not cleaning up" | wrap
-      rc=1
-      continue
-    fi
-    sudo schroot -c "${s}" -e || rc=1
-  done
-  exit ${rc}
-}
-
-list() {
-  for e in $(schroot -l); do
-    e="${e#chroot:}"
-    [ -x "/usr/local/bin/${e}" ] || continue
-    if schroot -l --all-sessions 2>/dev/null |
-       sed 's/^session://' |
-       grep -qs "^${e}-"; then
-      echo "${e} is currently active"
-    else
-      echo "${e}"
-    fi
-  done
-  exit 0
-}
-
-while [ "$#" -ne 0 ]; do
-  case "$1" in
-    --)             shift; break;;
-    -h|--help)      shift; help;;
-    -l|--list)      shift; list;;
-    -c|--clean)     shift; clean "${chroot}";;
-    -C|--clean-all) shift; clean;;
-    *)              break;;
-  esac
-done
-
-# Start a new chroot session and keep track of the session id. We inject this
-# id into all processes that run inside the chroot. Unless they go out of their
-# way to clear their environment, we can then later identify our child and
-# grand-child processes by scanning their environment.
-session="$(schroot -c "${chroot}" -b)"
-export CHROOT_SESSION_ID="${session}"
-
-# Set GOMA_TMP_DIR for better handling of goma inside chroot.
-export GOMA_TMP_DIR="/tmp/goma_tmp_$CHROOT_SESSION_ID"
-mkdir -p "$GOMA_TMP_DIR"
-
-if [ $# -eq 0 ]; then
-  # Run an interactive shell session
-  schroot -c "${session}" -r -p
-else
-  # Run a command inside of the chroot environment
-  p="$1"; shift
-  schroot -c "${session}" -r -p "$p" -- "$@"
-fi
-rc=$?
-
-# Compute the inode of the root directory inside of the chroot environment.
-i=$(schroot -c "${session}" -r -p ls -- -id /proc/self/root/. |
-     awk '{ print $1 }') 2>/dev/null
-other_pids=
-while [ -n "$i" ]; do
-  # Identify processes by the inode number of their root directory. Then
-  # remove all processes that we know belong to other sessions. We use
-  # "sort | uniq -u" to do what amounts to a "set substraction operation".
-  pids=$({ ls -id1 /proc/*/root/. 2>/dev/null |
-         sed -e 's,^[^0-9]*'$i'.*/\([1-9][0-9]*\)/.*$,\1,
-                 t
-                 d';
-         echo "${other_pids}";
-         echo "${other_pids}"; } | sort | uniq -u) >/dev/null 2>&1
-  # Kill all processes that are still left running in the session. This is
-  # typically an assortment of daemon processes that were started
-  # automatically. They result in us being unable to tear down the session
-  # cleanly.
-  [ -z "${pids}" ] && break
-  for j in $pids; do
-    # Unfortunately, the way that schroot sets up sessions has the
-    # side-effect of being unable to tell one session apart from another.
-    # This can result in us attempting to kill processes in other sessions.
-    # We make a best-effort to avoid doing so.
-    k="$( ( xargs -0 -n1 </proc/$j/environ ) 2>/dev/null |
-         sed 's/^CHROOT_SESSION_ID=/x/;t1;d;:1;q')"
-    if [ -n "${k}" -a "${k#x}" != "${session}" ]; then
-      other_pids="${other_pids}
-${j}"
-      continue
-    fi
-    kill -9 $pids
-  done
-done
-# End the chroot session. This should clean up all temporary files. But if we
-# earlier failed to terminate all (daemon) processes inside of the session,
-# deleting the session could fail. When that happens, the user has to manually
-# clean up the stale files by invoking us with "--clean" after having killed
-# all running processes.
-schroot -c "${session}" -e
-# Since no goma processes are running, we can remove goma directory.
-rm -rf "$GOMA_TMP_DIR"
-exit $rc
-EOF
-sudo chown root:root /usr/local/bin/"${target%bit}"
-sudo chmod 755 /usr/local/bin/"${target%bit}"
-
-# Add the standard Ubuntu update repositories if requested.
-[ "${alt_repos}" = "y" -a \
-  -r "/var/lib/chroot/${target}/etc/apt/sources.list" ] &&
-sudo sed -i '/^deb .* [^ -]\+ main$/p
-             s/^\(deb .* [^ -]\+\) main/\1-security main/
-             p
-             t1
-             d
-             :1;s/-security main/-updates main/
-             t
-             d' "/var/lib/chroot/${target}/etc/apt/sources.list"
-
-# Add a few more repositories to the chroot
-[ -r "/var/lib/chroot/${target}/etc/apt/sources.list" ] &&
-sudo sed -i 's/ main$/ main restricted universe multiverse/' \
-         "/var/lib/chroot/${target}/etc/apt/sources.list"
-
-# Add the Ubuntu "partner" repository, if available
-if [ -r "/var/lib/chroot/${target}/etc/apt/sources.list" ] &&
-   HEAD "http://archive.canonical.com/ubuntu/dists/${distname}/partner" \
-   >&/dev/null; then
-  sudo sh -c '
-    echo "deb http://archive.canonical.com/ubuntu" \
-         "'"${distname}"' partner" \
-      >>"/var/lib/chroot/'"${target}"'/etc/apt/sources.list"'
-fi
-
-# Add source repositories, if the user requested we do so
-[ "${add_srcs}" = "y" -a \
-  -r "/var/lib/chroot/${target}/etc/apt/sources.list" ] &&
-sudo sed -i '/^deb[^-]/p
-             s/^deb\([^-]\)/deb-src\1/' \
-         "/var/lib/chroot/${target}/etc/apt/sources.list"
-
-# Set apt proxy if host has set http_proxy
-if [ -n "${http_proxy}" ]; then
-  sudo sh -c '
-    echo "Acquire::http::proxy \"'"${http_proxy}"'\";" \
-        >>"/var/lib/chroot/'"${target}"'/etc/apt/apt.conf"'
-fi
-
-# Update packages
-sudo "/usr/local/bin/${target%bit}" /bin/sh -c '
-  apt-get update; apt-get -y dist-upgrade' || :
-
-# Install a couple of missing packages
-for i in debian-keyring ubuntu-keyring locales sudo; do
-  [ -d "/var/lib/chroot/${target}/usr/share/doc/$i" ] ||
-    sudo "/usr/local/bin/${target%bit}" apt-get -y install "$i" || :
-done
-
-# Configure locales
-sudo "/usr/local/bin/${target%bit}" /bin/sh -c '
-  l='"${LANG:-en_US}"'; l="${l%%.*}"
-  [ -r /etc/locale.gen ] &&
-    sed -i "s/^# \($l\)/\1/" /etc/locale.gen
-  locale-gen $LANG en_US en_US.UTF-8' || :
-
-# Enable multi-arch support, if available
-sudo "/usr/local/bin/${target%bit}" dpkg --assert-multi-arch >&/dev/null &&
-  [ -r "/var/lib/chroot/${target}/etc/apt/sources.list" ] && {
-  sudo sed -i 's/ / [arch=amd64,i386] /' \
-              "/var/lib/chroot/${target}/etc/apt/sources.list"
-  [ -d /var/lib/chroot/${target}/etc/dpkg/dpkg.cfg.d/ ] &&
-  sudo "/usr/local/bin/${target%bit}" dpkg --add-architecture \
-      $([ "${arch}" = "32bit" ] && echo amd64 || echo i386) >&/dev/null ||
-    echo foreign-architecture \
-        $([ "${arch}" = "32bit" ] && echo amd64 || echo i386) |
-      sudo sh -c \
-        "cat >'/var/lib/chroot/${target}/etc/dpkg/dpkg.cfg.d/multiarch'"
-}
-
-# Configure "sudo" package
-sudo "/usr/local/bin/${target%bit}" /bin/sh -c '
-  egrep -qs '"'^$(id -nu) '"' /etc/sudoers ||
-  echo '"'$(id -nu) ALL=(ALL) ALL'"' >>/etc/sudoers'
-
-# Install a few more commonly used packages
-sudo "/usr/local/bin/${target%bit}" apt-get -y install                         \
-  autoconf automake1.9 dpkg-dev g++-multilib gcc-multilib gdb less libtool     \
-  lsof strace
-
-# If running a 32bit environment on a 64bit machine, install a few binaries
-# as 64bit. This is only done automatically if the chroot distro is the same as
-# the host, otherwise there might be incompatibilities in build settings or
-# runtime dependencies. The user can force it with the '-c' flag.
-host_distro=$(grep -s DISTRIB_CODENAME /etc/lsb-release | \
-  cut -d "=" -f 2)
-if [ "${copy_64}" = "y" -o \
-    "${host_distro}" = "${distname}" -a "${arch}" = 32bit ] && \
-    file /bin/bash 2>/dev/null | grep -q x86-64; then
-  readlinepkg=$(sudo "/usr/local/bin/${target%bit}" sh -c \
-    'apt-cache search "lib64readline.\$" | sort | tail -n 1 | cut -d " " -f 1')
-  sudo "/usr/local/bin/${target%bit}" apt-get -y install                       \
-    lib64expat1 lib64ncurses5 ${readlinepkg} lib64z1 lib64stdc++6
-  dep=
-  for i in binutils gdb; do
-    [ -d /usr/share/doc/"$i" ] || dep="$dep $i"
-  done
-  [ -n "$dep" ] && sudo apt-get -y install $dep
-  sudo mkdir -p "/var/lib/chroot/${target}/usr/local/lib/amd64"
-  for i in libbfd libpython; do
-    lib="$({ ldd /usr/bin/ld; ldd /usr/bin/gdb; } |
-           grep -s "$i" | awk '{ print $3 }')"
-    if [ -n "$lib" -a -r "$lib" ]; then
-      sudo cp "$lib" "/var/lib/chroot/${target}/usr/local/lib/amd64"
-    fi
-  done
-  for lib in libssl libcrypt; do
-    for path in /usr/lib /usr/lib/x86_64-linux-gnu; do
-      sudo cp $path/$lib* \
-              "/var/lib/chroot/${target}/usr/local/lib/amd64/" >&/dev/null || :
-    done
-  done
-  for i in gdb ld; do
-    sudo cp /usr/bin/$i "/var/lib/chroot/${target}/usr/local/lib/amd64/"
-    sudo sh -c "cat >'/var/lib/chroot/${target}/usr/local/bin/$i'" <<EOF
-#!/bin/sh
-exec /lib64/ld-linux-x86-64.so.2 --library-path /usr/local/lib/amd64 \
-  /usr/local/lib/amd64/$i "\$@"
-EOF
-    sudo chmod 755 "/var/lib/chroot/${target}/usr/local/bin/$i"
-  done
-fi
-
-
-# If the install-build-deps.sh script can be found, offer to run it now
-script="$(dirname $(readlink -f "$0"))/install-build-deps.sh"
-if [ -x "${script}" ]; then
-  while :; do
-    echo
-    echo "If you plan on building Chrome inside of the new chroot environment,"
-    echo "you now have to install the build dependencies. Do you want me to"
-    printf "start the script that does this for you (y/n)? "
-    read install_deps
-    case "${install_deps}" in
-      y|Y)
-        echo
-        # We prefer running the script in-place, but this might not be
-        # possible, if it lives on a network filesystem that denies
-        # access to root.
-        tmp_script=
-        if ! sudo /usr/local/bin/"${target%bit}" \
-            sh -c "[ -x '${script}' ]" >&/dev/null; then
-          tmp_script="/tmp/${script##*/}"
-          cp "${script}" "${tmp_script}"
-        fi
-        # Some distributions automatically start an instance of the system-
-        # wide dbus daemon, cron daemon or of the logging daemon, when
-        # installing the Chrome build depencies. This prevents the chroot
-        # session from being closed.  So, we always try to shut down any running
-        # instance of dbus and rsyslog.
-        sudo /usr/local/bin/"${target%bit}" sh -c "${script};
-              rc=$?;
-              /etc/init.d/cron stop >/dev/null 2>&1 || :;
-              /etc/init.d/rsyslog stop >/dev/null 2>&1 || :;
-              /etc/init.d/dbus stop >/dev/null 2>&1 || :;
-              exit $rc"
-        rc=$?
-        [ -n "${tmp_script}" ] && rm -f "${tmp_script}"
-        [ $rc -ne 0 ] && exit $rc
-        break
-      ;;
-      n|N)
-        break
-      ;;
-    esac
-  done
-  echo
-fi
-
-# Check whether ~/chroot is on a (slow) network file system and offer to
-# relocate it. Also offer relocation, if the user appears to have multiple
-# spindles (as indicated by "${bind_mount}" being non-empty).
-# We only offer this option, if it doesn't look as if a chroot environment
-# is currently active. Otherwise, relocation is unlikely to work and it
-# can be difficult for the user to recover from the failed attempt to relocate
-# the ~/chroot directory.
-# We don't aim to solve this problem for every configuration,
-# but try to help with the common cases. For more advanced configuration
-# options, the user can always manually adjust things.
-mkdir -p "${HOME}/chroot/"
-if [ ! -h "${HOME}/chroot" ] &&
-   ! egrep -qs '^[^[:space:]]*/chroot' /etc/fstab &&
-   { [ -n "${bind_mounts}" -a "${bind_mounts}" != "NONE" ] ||
-     is_network_drive "${HOME}/chroot"; } &&
-   ! egrep -qs '/var/lib/[^/]*chroot/.*/chroot' /proc/mounts; then
-  echo "${HOME}/chroot is currently located on the same device as your"
-  echo "home directory."
-  echo "This might not be what you want. Do you want me to move it somewhere"
-  echo "else?"
-  # If the computer has multiple spindles, many users configure all or part of
-  # the secondary hard disk to be writable by the primary user of this machine.
-  # Make some reasonable effort to detect this type of configuration and
-  # then offer a good location for where to put the ~/chroot directory.
-  suggest=
-  for i in $(echo "${bind_mounts}"|cut -d ' ' -f 1); do
-    if [ -d "$i" -a -w "$i" -a \( ! -a "$i/chroot" -o -w "$i/chroot/." \) ] &&
-       ! is_network_drive "$i"; then
-      suggest="$i"
-    else
-      for j in "$i/"*; do
-        if [ -d "$j" -a -w "$j" -a \
-             \( ! -a "$j/chroot" -o -w "$j/chroot/." \) ] &&
-           ! is_network_drive "$j"; then
-          suggest="$j"
-        else
-          for k in "$j/"*; do
-            if [ -d "$k" -a -w "$k" -a \
-                 \( ! -a "$k/chroot" -o -w "$k/chroot/." \) ] &&
-               ! is_network_drive "$k"; then
-              suggest="$k"
-              break
-            fi
-          done
-        fi
-        [ -n "${suggest}" ] && break
-      done
-    fi
-    [ -n "${suggest}" ] && break
-  done
-  def_suggest="${HOME}"
-  if [ -n "${suggest}" ]; then
-    # For home directories that reside on network drives, make our suggestion
-    # the default option. For home directories that reside on a local drive,
-    # require that the user manually enters the new location.
-    if is_network_drive "${HOME}"; then
-      def_suggest="${suggest}"
-    else
-      echo "A good location would probably be in \"${suggest}\""
-    fi
-  fi
-  while :; do
-    printf "Physical location [${def_suggest}]: "
-    read dir
-    [ -z "${dir}" ] && dir="${def_suggest}"
-    [ "${dir%%/}" == "${HOME%%/}" ] && break
-    if ! [ -d "${dir}" -a -w "${dir}" ] ||
-       [ -a "${dir}/chroot" -a ! -w "${dir}/chroot/." ]; then
-      echo "Cannot write to ${dir}/chroot. Please try again"
-    else
-      mv "${HOME}/chroot" "${dir}/chroot"
-      ln -s "${dir}/chroot" "${HOME}/chroot"
-      for i in $(list_all_chroots); do
-        sudo "$i" mkdir -p "${dir}/chroot"
-      done
-      sudo sed -i "s,${HOME}/chroot,${dir}/chroot,g" /etc/schroot/mount-*
-      break
-    fi
-  done
-fi
-
-# Clean up package files
-sudo schroot -c "${target%bit}" -p -- apt-get clean
-sudo apt-get clean
-
-trap '' INT TERM QUIT HUP
-trap '' EXIT
-
-# Let the user know what we did
-cat <<EOF
-
-
-Successfully installed ${distname} ${arch}
-
-You can run programs inside of the chroot by invoking the
-"/usr/local/bin/${target%bit}" command.
-
-This command can be used with arguments, in order to just run a single
-program inside of the chroot environment (e.g. "${target%bit} make chrome")
-or without arguments, in order to run an interactive shell session inside
-of the chroot environment.
-
-If you need to run things as "root", you can use "sudo" (e.g. try
-"sudo ${target%bit} apt-get update").
-
-Your home directory is shared between the host and the chroot. But I
-configured "${HOME}/chroot" to be private to the chroot environment.
-You can use it for files that need to differ between environments. This
-would be a good place to store binaries that you have built from your
-source files.
-
-For Chrome, this probably means you want to make your "out" directory a
-symbolic link that points somewhere inside of "${HOME}/chroot".
-
-You still need to run "gclient runhooks" whenever you switch from building
-outside of the chroot to inside of the chroot. But you will find that you
-don't have to repeatedly erase and then completely rebuild all your object
-and binary files.
-
-EOF
diff --git a/build/internal/README.chromium b/build/internal/README.chromium
deleted file mode 100644
index 4624830..0000000
--- a/build/internal/README.chromium
+++ /dev/null
@@ -1,24 +0,0 @@
-Internal property sheets:
-  essential.vsprops
-    Contains the common settings used throughout the projects. Is included by either ..\debug.vsprops or ..\release.vsprops, so in general, it is not included directly.
-
-  release_defaults.vsprops
-    Included by ..\release.vsprops. Its settings are overriden by release_impl$(CHROME_BUILD_TYPE).vsprops. Uses the default VS setting which is "Maximize Speed". Results in relatively fast build with reasonable optimization level but without whole program optimization to reduce build time.
-
-  release_impl.vsprops
-    Included by ..\release.vsprops by default when CHROME_BUILD_TYPE is undefined. Includes release_defaults.vsprops.
-
-  release_impl_checksenabled.vsprops
-    Included by ..\release.vsprops when CHROME_BUILD_TYPE=_checksenabled. Matches what release_defaults.vsprops does, but doesn't actually inherit from it as we couldn't quite get that working. The only difference is that _DEBUG is set instead of NDEBUG. Used for keeping debug checks enabled with a build that is fast enough to dogfood with.
-
-  release_impl_official.vsprops
-    Included by ..\release.vsprops when CHROME_BUILD_TYPE=_official. Includes release_defaults.vsprops. Enables Whole Program Optimizations (WPO), which doubles the build time. Results in much more optimized build. Uses "Full Optimization" and "Flavor small code".
-
-  release_impl_pgo_instrument.vsprops
-    Included by ..\release.vsprops when CHROME_BUILD_TYPE=_pgo_instrument. Includes release_defaults.vsprops. Enables Profile Guided Optimization (PGO) instrumentation (first pass). Uses "Full Optimization" and "Flavor small code".
-
-  release_impl_pgo_optimize.vsprops
-    Included by ..\release.vsprops when CHROME_BUILD_TYPE=_pgo_optimize. Includes release_defaults.vsprops. Enables Profile Guided Optimization (PGO) optimization (second pass). Uses "Full Optimization" and "Flavor small code".
-
-  release_impl_purify.vsprops
-    Included by ..\release.vsprops when CHROME_BUILD_TYPE=_purify. Includes release_defaults.vsprops. Disables optimizations. Used with Purify to test without debug tools and without optimization; i.e. NDEBUG is defined but the compiler doesn't optimize the binary.
diff --git a/build/internal/release_defaults.gypi b/build/internal/release_defaults.gypi
deleted file mode 100644
index 1bf674a..0000000
--- a/build/internal/release_defaults.gypi
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'msvs_settings': {
-    'VCCLCompilerTool': {
-      'StringPooling': 'true',
-    },
-    'VCLinkerTool': {
-      # No incremental linking.
-      'LinkIncremental': '1',
-      # Eliminate Unreferenced Data (/OPT:REF).
-      'OptimizeReferences': '2',
-      # Folding on (/OPT:ICF).
-      'EnableCOMDATFolding': '2',
-    },
-  },
-}
diff --git a/build/internal/release_impl.gypi b/build/internal/release_impl.gypi
deleted file mode 100644
index 5ac0e09..0000000
--- a/build/internal/release_impl.gypi
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'includes': ['release_defaults.gypi'],
-  'msvs_settings': {
-    'VCCLCompilerTool': {
-      'OmitFramePointers': 'false',
-      # The above is not sufficient (http://crbug.com/106711): it
-      # simply eliminates an explicit "/Oy", but both /O2 and /Ox
-      # perform FPO regardless, so we must explicitly disable.
-      # We still want the false setting above to avoid having
-      # "/Oy /Oy-" and warnings about overriding.
-      'AdditionalOptions': ['/Oy-'],
-    },
-  },
-}
diff --git a/build/internal/release_impl_official.gypi b/build/internal/release_impl_official.gypi
deleted file mode 100644
index 36d5d78..0000000
--- a/build/internal/release_impl_official.gypi
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'includes': ['release_defaults.gypi'],
-  'defines': ['OFFICIAL_BUILD'],
-  'msvs_settings': {
-    'VCCLCompilerTool': {
-      'InlineFunctionExpansion': '2',
-      'EnableIntrinsicFunctions': 'true',
-      'OmitFramePointers': 'false',
-      # The above is not sufficient (http://crbug.com/106711): it
-      # simply eliminates an explicit "/Oy", but both /O2 and /Ox
-      # perform FPO regardless, so we must explicitly disable.
-      # We still want the false setting above to avoid having
-      # "/Oy /Oy-" and warnings about overriding.
-      'AdditionalOptions': ['/Oy-'],
-    },
-    'VCLibrarianTool': {
-      'AdditionalOptions': [
-        '/ltcg',
-        '/expectedoutputsize:120000000'
-      ],
-    },
-    'VCLinkerTool': {
-      'AdditionalOptions': [
-        '/time',
-        # This may reduce memory fragmentation during linking.
-        # The expected size is 40*1024*1024, which gives us about 10M of
-        # headroom as of Dec 16, 2011.
-        '/expectedoutputsize:41943040',
-      ],
-      # The /PROFILE flag causes the linker to add a "FIXUP" debug stream to
-      # the generated PDB. According to MSDN documentation, this flag is only
-      # available (or perhaps supported) in the Enterprise (team development)
-      # version of Visual Studio. If this blocks your official build, simply
-      # comment out this line, then  re-run "gclient runhooks".
-      'Profile': 'true',
-    },
-  },
-}
diff --git a/build/inverse_depth.py b/build/inverse_depth.py
deleted file mode 100755
index ce7a6ab..0000000
--- a/build/inverse_depth.py
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import os
-import sys
-
-
-def DoMain(argv):
-  depth = argv[0]
-  return os.path.relpath(os.getcwd(), os.path.abspath(depth))
-
-
-def main(argv):
-  if len(argv) < 2:
-    print "USAGE: inverse_depth.py depth"
-    return 1
-  print DoMain(argv[1:])
-  return 0
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv))
diff --git a/build/ios/OWNERS b/build/ios/OWNERS
deleted file mode 100644
index 4caf405..0000000
--- a/build/ios/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-rohitrao@chromium.org
-stuartmorgan@chromium.org
-
-per-file grit_whitelist.txt=*
diff --git a/build/ios/PRESUBMIT.py b/build/ios/PRESUBMIT.py
deleted file mode 100644
index bbd17b3..0000000
--- a/build/ios/PRESUBMIT.py
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import os
-
-"""Chromium presubmit script for src/tools/ios.
-
-See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
-for more details on the presubmit API built into depot_tools.
-"""
-
-WHITELIST_FILE = 'build/ios/grit_whitelist.txt'
-
-def _CheckWhitelistSorted(input_api, output_api):
-  for path in input_api.LocalPaths():
-    if WHITELIST_FILE == path:
-      lines = open(os.path.join('../..', WHITELIST_FILE)).readlines()
-      i = 0
-      while i < len(lines) - 1 and lines[i] <= lines[i + 1]:
-        i += 1
-      if i < len(lines) - 1:
-        return [output_api.PresubmitError(
-            'The file ' + WHITELIST_FILE + ' must be sorted.  ' +
-            'First offending line: #' + str(i + 2))]
-  return []
-
-def _CommonChecks(input_api, output_api):
-  """Checks common to both upload and commit."""
-  results = []
-  results.extend(_CheckWhitelistSorted(input_api, output_api))
-  return results
-
-def CheckChangeOnUpload(input_api, output_api):
-  results = []
-  results.extend(_CommonChecks(input_api, output_api))
-  return results
-
-def CheckChangeOnCommit(input_api, output_api):
-  results = []
-  results.extend(_CommonChecks(input_api, output_api))
-  return results
diff --git a/build/ios/chrome_ios.croc b/build/ios/chrome_ios.croc
deleted file mode 100644
index 938a2e9..0000000
--- a/build/ios/chrome_ios.croc
+++ /dev/null
@@ -1,71 +0,0 @@
-# -*- python -*-
-# Crocodile config file for Chromium iOS.
-#
-# Note that Chromium iOS also uses the config file at src/build/common.croc.
-#
-# See src/tools/code_coverage/example.croc for more info on config files.
-
-{
-  # List of rules, applied in order
-  'rules' : [
-    # Specify inclusions before exclusions, since rules are in order.
-
-    # Exclude everything to negate whatever is in src/build/common.croc
-    {
-      'regexp' : '.*',
-      'include' : 0,
-    },
-
-    # Include all directories (but not the files in the directories).
-    # This is a workaround for how croc.py walks the directory tree. See the
-    # TODO in the AddFiles method of src/tools/code_coverage/croc.py
-    {
-      'regexp' : '.*/$',
-      'include' : 1,
-    },
-
-    # Include any file with an 'ios' directory in the path.
-    {
-      'regexp' : '.*/ios/.*',
-      'include' : 1,
-      'add_if_missing' : 1,
-    },
-    
-    # Include any file that ends with _ios.
-    {
-      'regexp' : '.*_ios\\.(c|cc|m|mm)$',
-      'include' : 1,
-      'add_if_missing' : 1,
-    },
-
-    # Include any file that ends with _ios_unittest (and label it a test).
-    {
-      'regexp' : '.*_ios_unittest\\.(c|cc|m|mm)$',
-      'include' : 1,
-      'add_if_missing' : 1,
-      'group' : 'test',
-    },
-
-    # Don't scan for executable lines in uninstrumented header files
-    {
-      'regexp' : '.*\\.(h|hpp)$',
-      'add_if_missing' : 0,
-    },
-
-    # Don't measure coverage of perftests.
-    {
-      'regexp' : '.*perftest\\.(c|cc|m|mm)$',
-      'include' : 0,
-    },
-
-    # Languages
-    {
-      'regexp' : '.*\\.m$',
-      'language' : 'ObjC',
-    },
-    {
-      'regexp' : '.*\\.mm$',
-      'language' : 'ObjC++',
-    },
-  ],
-}
diff --git a/build/ios/clean_env.py b/build/ios/clean_env.py
deleted file mode 100755
index 548e2b9..0000000
--- a/build/ios/clean_env.py
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/usr/bin/python
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import os
-import sys
-
-def Main(argv):
-  """This is like 'env -i', but it uses a whitelist of env variables to allow
-  through to the command being run.  It attempts to strip off Xcode-added
-  values from PATH.
-  """
-  # Note: An attempt was made to do something like: env -i bash -lc '[command]'
-  # but that fails to set the things set by login (USER, etc.), so instead
-  # the only approach that seems to work is to have a whitelist.
-  env_key_whitelist = (
-    'HOME',
-    'LOGNAME',
-    # 'PATH' added below (but filtered).
-    'PWD',
-    'SHELL',
-    'TEMP',
-    'TMPDIR',
-    'USER'
-  )
-
-  # Need something to run.
-  # TODO(lliabraa): Make this output a usage string and exit (here and below).
-  assert(len(argv) > 0)
-
-  add_to_path = [];
-  first_entry = argv[0];
-  if first_entry.startswith('ADD_TO_PATH='):
-    argv = argv[1:];
-    add_to_path = first_entry.replace('ADD_TO_PATH=', '', 1).split(':')
-
-  # Still need something to run.
-  assert(len(argv) > 0)
-
-  clean_env = {}
-
-  # Pull over the whitelisted keys.
-  for key in env_key_whitelist:
-    val = os.environ.get(key, None)
-    if not val is None:
-      clean_env[key] = val
-
-  # Collect the developer dir as set via Xcode, defaulting it.
-  dev_prefix = os.environ.get('DEVELOPER_DIR', '/Developer/')
-  if dev_prefix[-1:] != '/':
-    dev_prefix += '/'
-
-  # Now pull in PATH, but remove anything Xcode might have added.
-  initial_path = os.environ.get('PATH', '')
-  filtered_chunks = \
-      [x for x in initial_path.split(':') if not x.startswith(dev_prefix)]
-  if filtered_chunks:
-    clean_env['PATH'] = ':'.join(add_to_path + filtered_chunks)
-
-  # Add any KEY=VALUE args before the command to the cleaned environment.
-  args = argv[:]
-  while '=' in args[0]:
-    (key, val) = args[0].split('=', 1)
-    clean_env[key] = val
-    args = args[1:]
-
-  # Still need something to run.
-  assert(len(args) > 0)
-
-  # Off it goes...
-  os.execvpe(args[0], args, clean_env)
-  # Should never get here, so return a distinctive, non-zero status code.
-  return 66
-
-if __name__ == '__main__':
-  sys.exit(Main(sys.argv[1:]))
diff --git a/build/ios/coverage.gypi b/build/ios/coverage.gypi
deleted file mode 100644
index e822089..0000000
--- a/build/ios/coverage.gypi
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'variables': {
-    'enable_coverage%': 0,
-  },
-  'conditions': [
-    ['enable_coverage', {
-        'target_defaults': {
-          'defines': [
-            'ENABLE_TEST_CODE_COVERAGE=1'
-          ],
-          'link_settings': {
-            'xcode_settings': {
-              'OTHER_LDFLAGS': [
-                '-fprofile-arcs',
-              ],
-            },
-          },
-          'xcode_settings': {
-            'OTHER_CFLAGS': [
-              '-fprofile-arcs',
-              '-ftest-coverage',
-            ],
-          },
-        },
-    }],
-  ],
-}
-
diff --git a/build/ios/grit_whitelist.txt b/build/ios/grit_whitelist.txt
deleted file mode 100644
index a976daf..0000000
--- a/build/ios/grit_whitelist.txt
+++ /dev/null
@@ -1,1155 +0,0 @@
-IDR_ABOUT_DOM_DISTILLER_CSS
-IDR_ABOUT_DOM_DISTILLER_HTML
-IDR_ABOUT_DOM_DISTILLER_JS
-IDR_ABOUT_STATS_HTML
-IDR_ABOUT_STATS_JS
-IDR_ABOUT_VERSION_CSS
-IDR_ABOUT_VERSION_HTML
-IDR_ABOUT_VERSION_JS
-IDR_CONTEXTUAL_SEARCH_PROMO_HTML
-IDR_CONTROLLED_SETTING_MANDATORY
-IDR_CRASHES_HTML
-IDR_CRASHES_JS
-IDR_CREDITS_HTML
-IDR_CREDITS_JS
-IDR_CREDIT_CARD_CVC_HINT
-IDR_CREDIT_CARD_CVC_HINT_AMEX
-IDR_DATA_REDUCTION_PROXY_INTERSTITIAL_HTML
-IDR_DEFAULT_FAVICON
-IDR_DEFAULT_FAVICON_32
-IDR_DEFAULT_FAVICON_64
-IDR_DIR_HEADER_HTML
-IDR_DISTILLABLE_PAGE_SERIALIZED_MODEL
-IDR_DISTILLER_CSS
-IDR_DISTILLER_IOS_CSS
-IDR_DISTILLER_JS
-IDR_DOM_DISTILLER_VIEWER_HTML
-IDR_DOM_DISTILLER_VIEWER_JS
-IDR_EXTRACT_PAGE_FEATURES_JS
-IDR_FLAGS_FAVICON
-IDR_FLAGS_HTML
-IDR_FLAGS_JS
-IDR_GCM_INTERNALS_CSS
-IDR_GCM_INTERNALS_HTML
-IDR_GCM_INTERNALS_JS
-IDR_HISTORY_FAVICON
-IDR_HISTORY_HTML
-IDR_HISTORY_JS
-IDR_INCOGNITO_TAB_HTML
-IDR_INFOBAR_AUTOFILL_CC
-IDR_INFOBAR_AUTOLOGIN
-IDR_INFOBAR_RESTORE_SESSION
-IDR_INFOBAR_SAVE_PASSWORD
-IDR_INFOBAR_TRANSLATE_IOS
-IDR_INFOBAR_WARNING
-IDR_IS_DISTILLABLE_JS
-IDR_LOCATION_BAR_HTTP
-IDR_NET_ERROR_HTML
-IDR_NET_EXPORT_HTML
-IDR_NET_EXPORT_JS
-IDR_NET_INTERNALS_INDEX_HTML
-IDR_NET_INTERNALS_INDEX_JS
-IDR_OMAHA_HTML
-IDR_OMAHA_JS
-IDR_OMNIBOX_CALCULATOR
-IDR_OMNIBOX_CLEAR_IOS
-IDR_OMNIBOX_CLEAR_OTR_IOS
-IDR_OMNIBOX_CLEAR_OTR_PRESSED_IOS
-IDR_OMNIBOX_CLEAR_PRESSED_IOS
-IDR_OMNIBOX_EXTENSION_APP
-IDR_OMNIBOX_HISTORY
-IDR_OMNIBOX_HISTORY_INCOGNITO
-IDR_OMNIBOX_HTTP
-IDR_OMNIBOX_HTTPS_INVALID
-IDR_OMNIBOX_HTTPS_POLICY_WARNING
-IDR_OMNIBOX_HTTPS_VALID
-IDR_OMNIBOX_HTTPS_WARNING
-IDR_OMNIBOX_HTTP_INCOGNITO
-IDR_OMNIBOX_KEYBOARD_VIEW_APPEND
-IDR_OMNIBOX_KEYBOARD_VIEW_APPEND_HIGHLIGHTED
-IDR_OMNIBOX_KEYBOARD_VIEW_APPEND_INCOGNITO
-IDR_OMNIBOX_KEYBOARD_VIEW_APPEND_INCOGNITO_HIGHLIGHTED
-IDR_OMNIBOX_SEARCH
-IDR_OMNIBOX_SEARCH_INCOGNITO
-IDR_OMNIBOX_SEARCH_SECURED
-IDR_OMNIBOX_STAR
-IDR_OMNIBOX_STAR_INCOGNITO
-IDR_OTHER_DEVICES_JS
-IDR_PAGEINFO_BAD
-IDR_PAGEINFO_GOOD
-IDR_PAGEINFO_INFO
-IDR_PAGEINFO_WARNING_MAJOR
-IDR_PAGEINFO_WARNING_MINOR
-IDR_POLICY_CSS
-IDR_POLICY_HTML
-IDR_POLICY_JS
-IDR_PRINTER_FAVICON
-IDR_SAD_FAVICON
-IDR_SAD_TAB
-IDR_SECURITY_INTERSTITIAL_HTML
-IDR_SIGNIN_INTERNALS_INDEX_HTML
-IDR_SIGNIN_INTERNALS_INDEX_JS
-IDR_SYNC_INTERNALS_ABOUT_JS
-IDR_SYNC_INTERNALS_CHROME_SYNC_JS
-IDR_SYNC_INTERNALS_DATA_JS
-IDR_SYNC_INTERNALS_EVENTS_JS
-IDR_SYNC_INTERNALS_INDEX_HTML
-IDR_SYNC_INTERNALS_INDEX_JS
-IDR_SYNC_INTERNALS_SEARCH_JS
-IDR_SYNC_INTERNALS_SYNC_LOG_JS
-IDR_SYNC_INTERNALS_SYNC_NODE_BROWSER_JS
-IDR_SYNC_INTERNALS_SYNC_SEARCH_JS
-IDR_SYNC_INTERNALS_TYPES_JS
-IDR_TOOLBAR_SHADOW_FULL_BLEED
-IDR_TRANSLATE_JS
-IDR_UBER_UTILS_JS
-IDR_WEBUI_CSS_TEXT_DEFAULTS
-IDR_WEBUI_I18N_TEMPLATE_JS
-IDR_WEBUI_JSTEMPLATE_JS
-IDR_WEBUI_JS_LOAD_TIME_DATA
-IDS_ABOUT_MAC
-IDS_ABOUT_VERSION_COMMAND_LINE
-IDS_ABOUT_VERSION_COMPANY_NAME
-IDS_ABOUT_VERSION_COPYRIGHT
-IDS_ABOUT_VERSION_EXECUTABLE_PATH
-IDS_ABOUT_VERSION_OFFICIAL
-IDS_ABOUT_VERSION_OS
-IDS_ABOUT_VERSION_PATH_NOTFOUND
-IDS_ABOUT_VERSION_PROFILE_PATH
-IDS_ABOUT_VERSION_REVISION
-IDS_ABOUT_VERSION_TITLE
-IDS_ABOUT_VERSION_UNOFFICIAL
-IDS_ABOUT_VERSION_USER_AGENT
-IDS_ABOUT_VERSION_VARIATIONS
-IDS_ACCEPT_LANGUAGES
-IDS_ACCNAME_BACK
-IDS_ACCNAME_CLEAR_TEXT
-IDS_ACCNAME_FORWARD
-IDS_ACCNAME_LOCATION
-IDS_ACCNAME_VOICE_SEARCH
-IDS_ALLOW_INSECURE_CONTENT_BUTTON
-IDS_ALTERNATE_NAV_URL_VIEW_LABEL
-IDS_ANNOTATED_SUGGESTION
-IDS_APP_CANCEL
-IDS_APP_OK
-IDS_APP_UNTITLED_SHORTCUT_FILE_NAME
-IDS_AUTOCOMPLETE_SEARCH_DESCRIPTION
-IDS_AUTOFILL_ADDRESS_LINE_SEPARATOR
-IDS_AUTOFILL_ADDRESS_SUMMARY_SEPARATOR
-IDS_AUTOFILL_CARD_UNMASK_PROMPT_ERROR_NETWORK
-IDS_AUTOFILL_CARD_UNMASK_PROMPT_ERROR_PERMANENT
-IDS_AUTOFILL_CARD_UNMASK_PROMPT_ERROR_TRY_AGAIN
-IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS
-IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS_AMEX
-IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS_EXPIRED
-IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS_EXPIRED_AMEX
-IDS_AUTOFILL_CC_AMEX
-IDS_AUTOFILL_CC_AMEX_SHORT
-IDS_AUTOFILL_CC_DINERS
-IDS_AUTOFILL_CC_DISCOVER
-IDS_AUTOFILL_CC_GENERIC
-IDS_AUTOFILL_CC_INFOBAR_ACCEPT
-IDS_AUTOFILL_CC_INFOBAR_DENY
-IDS_AUTOFILL_CC_INFOBAR_TEXT
-IDS_AUTOFILL_CC_JCB
-IDS_AUTOFILL_CC_MASTERCARD
-IDS_AUTOFILL_CC_UNION_PAY
-IDS_AUTOFILL_CC_VISA
-IDS_AUTOFILL_CLEAR_FORM_MENU_ITEM
-IDS_AUTOFILL_DELETE_AUTOCOMPLETE_SUGGESTION_CONFIRMATION_BODY
-IDS_AUTOFILL_DELETE_CREDIT_CARD_SUGGESTION_CONFIRMATION_BODY
-IDS_AUTOFILL_DELETE_PROFILE_SUGGESTION_CONFIRMATION_BODY
-IDS_AUTOFILL_DIALOG_PRIVACY_POLICY_LINK
-IDS_AUTOFILL_FIELD_LABEL_AREA
-IDS_AUTOFILL_FIELD_LABEL_COUNTY
-IDS_AUTOFILL_FIELD_LABEL_DEPARTMENT
-IDS_AUTOFILL_FIELD_LABEL_DISTRICT
-IDS_AUTOFILL_FIELD_LABEL_EMIRATE
-IDS_AUTOFILL_FIELD_LABEL_ISLAND
-IDS_AUTOFILL_FIELD_LABEL_PARISH
-IDS_AUTOFILL_FIELD_LABEL_POSTAL_CODE
-IDS_AUTOFILL_FIELD_LABEL_PREFECTURE
-IDS_AUTOFILL_FIELD_LABEL_PROVINCE
-IDS_AUTOFILL_FIELD_LABEL_STATE
-IDS_AUTOFILL_FIELD_LABEL_ZIP_CODE
-IDS_AUTOFILL_OPTIONS_POPUP
-IDS_AUTOFILL_PASSWORD_FIELD_SUGGESTIONS_TITLE
-IDS_AUTOFILL_SCAN_CREDIT_CARD
-IDS_AUTOFILL_WARNING_FORM_DISABLED
-IDS_AUTOFILL_WARNING_INSECURE_CONNECTION
-IDS_AUTOLOGIN_INFOBAR_CANCEL_BUTTON
-IDS_AUTOLOGIN_INFOBAR_MESSAGE
-IDS_AUTOLOGIN_INFOBAR_OK_BUTTON
-IDS_BLOCKED_DISPLAYING_INSECURE_CONTENT
-IDS_BLOCK_INSECURE_CONTENT_BUTTON
-IDS_BOOKMARK_ADD_EDITOR_TITLE
-IDS_BOOKMARK_ALL_TABS_DIALOG_TITLE
-IDS_BOOKMARK_BAR_FOLDER_NAME
-IDS_BOOKMARK_BAR_MANAGED_FOLDER_DEFAULT_NAME
-IDS_BOOKMARK_BAR_MANAGED_FOLDER_DOMAIN_NAME
-IDS_BOOKMARK_BAR_MOBILE_FOLDER_NAME
-IDS_BOOKMARK_BAR_OTHER_FOLDER_NAME
-IDS_BOOKMARK_BAR_REDO
-IDS_BOOKMARK_BAR_REDO_ADD
-IDS_BOOKMARK_BAR_REDO_DELETE
-IDS_BOOKMARK_BAR_REDO_EDIT
-IDS_BOOKMARK_BAR_REDO_MOVE
-IDS_BOOKMARK_BAR_REDO_REORDER
-IDS_BOOKMARK_BAR_SUPERVISED_FOLDER_DEFAULT_NAME
-IDS_BOOKMARK_BAR_UNDO
-IDS_BOOKMARK_BAR_UNDO_ADD
-IDS_BOOKMARK_BAR_UNDO_DELETE
-IDS_BOOKMARK_BAR_UNDO_EDIT
-IDS_BOOKMARK_BAR_UNDO_MOVE
-IDS_BOOKMARK_BAR_UNDO_REORDER
-IDS_BOOKMARK_BUBBLE_CHOOSER_ANOTHER_FOLDER
-IDS_BOOKMARK_BUBBLE_REMOVE_BOOKMARK
-IDS_BOOKMARK_EDITOR_CONFIRM_DELETE
-IDS_BOOKMARK_EDITOR_NEW_FOLDER_NAME
-IDS_BOOKMARK_EDITOR_TITLE
-IDS_BOOKMARK_FOLDER_CHOOSER_TITLE
-IDS_BOOKMARK_FOLDER_EDITOR_TITLE
-IDS_BOOKMARK_FOLDER_EDITOR_WINDOW_TITLE
-IDS_BOOKMARK_FOLDER_EDITOR_WINDOW_TITLE_NEW
-IDS_BOOKMARK_MANAGER_FOLDER_SECTION
-IDS_BOOKMARK_MANAGER_FOLDER_TITLE
-IDS_BOOKMARK_MANAGER_NAME_INPUT_PLACE_HOLDER
-IDS_BOOKMARK_MANAGER_REMOVE_TITLE
-IDS_BOOKMARK_MANAGER_URL_INPUT_PLACE_HOLDER
-IDS_BOOKMARK_NEW_FOLDER_BUTTON_TITLE
-IDS_CANCEL
-IDS_CERT_ERROR_AUTHORITY_INVALID_DESCRIPTION
-IDS_CERT_ERROR_AUTHORITY_INVALID_DETAILS
-IDS_CERT_ERROR_AUTHORITY_INVALID_EXTRA_INFO_2
-IDS_CERT_ERROR_AUTHORITY_INVALID_TITLE
-IDS_CERT_ERROR_CHAIN_EXPIRED_DESCRIPTION
-IDS_CERT_ERROR_CHAIN_EXPIRED_DETAILS
-IDS_CERT_ERROR_COMMON_NAME_INVALID_DESCRIPTION
-IDS_CERT_ERROR_COMMON_NAME_INVALID_DETAILS
-IDS_CERT_ERROR_COMMON_NAME_INVALID_EXTRA_INFO_2
-IDS_CERT_ERROR_COMMON_NAME_INVALID_TITLE
-IDS_CERT_ERROR_CONTAINS_ERRORS_DESCRIPTION
-IDS_CERT_ERROR_CONTAINS_ERRORS_DETAILS
-IDS_CERT_ERROR_CONTAINS_ERRORS_EXTRA_INFO_2
-IDS_CERT_ERROR_CONTAINS_ERRORS_TITLE
-IDS_CERT_ERROR_EXPIRED_DESCRIPTION
-IDS_CERT_ERROR_EXPIRED_DETAILS
-IDS_CERT_ERROR_EXPIRED_DETAILS_EXTRA_INFO_2
-IDS_CERT_ERROR_EXPIRED_TITLE
-IDS_CERT_ERROR_EXTRA_INFO_1
-IDS_CERT_ERROR_EXTRA_INFO_TITLE
-IDS_CERT_ERROR_INVALID_CERT_DESCRIPTION
-IDS_CERT_ERROR_INVALID_CERT_DETAILS
-IDS_CERT_ERROR_INVALID_CERT_EXTRA_INFO_2
-IDS_CERT_ERROR_INVALID_CERT_TITLE
-IDS_CERT_ERROR_NAME_CONSTRAINT_VIOLATION_DESCRIPTION
-IDS_CERT_ERROR_NAME_CONSTRAINT_VIOLATION_DETAILS
-IDS_CERT_ERROR_NAME_CONSTRAINT_VIOLATION_TITLE
-IDS_CERT_ERROR_NOT_YET_VALID_DESCRIPTION
-IDS_CERT_ERROR_NOT_YET_VALID_DETAILS
-IDS_CERT_ERROR_NOT_YET_VALID_DETAILS_EXTRA_INFO_2
-IDS_CERT_ERROR_NOT_YET_VALID_TITLE
-IDS_CERT_ERROR_NO_REVOCATION_MECHANISM_DESCRIPTION
-IDS_CERT_ERROR_NO_REVOCATION_MECHANISM_DETAILS
-IDS_CERT_ERROR_NO_REVOCATION_MECHANISM_TITLE
-IDS_CERT_ERROR_REVOKED_CERT_DESCRIPTION
-IDS_CERT_ERROR_REVOKED_CERT_DETAILS
-IDS_CERT_ERROR_REVOKED_CERT_EXTRA_INFO_2
-IDS_CERT_ERROR_REVOKED_CERT_TITLE
-IDS_CERT_ERROR_UNABLE_TO_CHECK_REVOCATION_DESCRIPTION
-IDS_CERT_ERROR_UNABLE_TO_CHECK_REVOCATION_DETAILS
-IDS_CERT_ERROR_UNABLE_TO_CHECK_REVOCATION_TITLE
-IDS_CERT_ERROR_UNKNOWN_ERROR_DESCRIPTION
-IDS_CERT_ERROR_UNKNOWN_ERROR_DETAILS
-IDS_CERT_ERROR_UNKNOWN_ERROR_TITLE
-IDS_CERT_ERROR_WEAK_KEY_DESCRIPTION
-IDS_CERT_ERROR_WEAK_KEY_DETAILS
-IDS_CERT_ERROR_WEAK_KEY_EXTRA_INFO_2
-IDS_CERT_ERROR_WEAK_KEY_TITLE
-IDS_CERT_ERROR_WEAK_SIGNATURE_ALGORITHM_DESCRIPTION
-IDS_CERT_ERROR_WEAK_SIGNATURE_ALGORITHM_DETAILS
-IDS_CERT_ERROR_WEAK_SIGNATURE_ALGORITHM_EXTRA_INFO_2
-IDS_CERT_ERROR_WEAK_SIGNATURE_ALGORITHM_TITLE
-IDS_CHROME_TO_DEVICE_PRINT_TO_PHONE
-IDS_CHROME_TO_DEVICE_SNAPSHOTS
-IDS_CLOSE
-IDS_CONTEXTUAL_SEARCH_HEADER
-IDS_CONTEXTUAL_SEARCH_PROMO_DESCRIPTION_1
-IDS_CONTEXTUAL_SEARCH_PROMO_DESCRIPTION_2
-IDS_CONTEXTUAL_SEARCH_PROMO_FEATURE_NAME
-IDS_CONTEXTUAL_SEARCH_PROMO_OPTIN
-IDS_CONTEXTUAL_SEARCH_PROMO_OPTOUT
-IDS_COULDNT_OPEN_PROFILE_ERROR
-IDS_CRASHES_BUG_LINK_LABEL
-IDS_CRASHES_CRASH_COUNT_BANNER_FORMAT
-IDS_CRASHES_CRASH_HEADER_FORMAT
-IDS_CRASHES_CRASH_TIME_FORMAT
-IDS_CRASHES_DISABLED_HEADER
-IDS_CRASHES_DISABLED_MESSAGE
-IDS_CRASHES_NO_CRASHES_MESSAGE
-IDS_CRASHES_TITLE
-IDS_CRASHES_UPLOAD_MESSAGE
-IDS_DATA_REDUCTION_PROXY_BACK_BUTTON
-IDS_DATA_REDUCTION_PROXY_CANNOT_PROXY_HEADING
-IDS_DATA_REDUCTION_PROXY_CANNOT_PROXY_PRIMARY_PARAGRAPH
-IDS_DATA_REDUCTION_PROXY_CANNOT_PROXY_SECONDARY_PARAGRAPH
-IDS_DATA_REDUCTION_PROXY_CONTINUE_BUTTON
-IDS_DATA_REDUCTION_PROXY_TITLE
-IDS_DEFAULT_AVATAR_NAME_10
-IDS_DEFAULT_AVATAR_NAME_11
-IDS_DEFAULT_AVATAR_NAME_12
-IDS_DEFAULT_AVATAR_NAME_13
-IDS_DEFAULT_AVATAR_NAME_14
-IDS_DEFAULT_AVATAR_NAME_15
-IDS_DEFAULT_AVATAR_NAME_16
-IDS_DEFAULT_AVATAR_NAME_17
-IDS_DEFAULT_AVATAR_NAME_18
-IDS_DEFAULT_AVATAR_NAME_19
-IDS_DEFAULT_AVATAR_NAME_20
-IDS_DEFAULT_AVATAR_NAME_21
-IDS_DEFAULT_AVATAR_NAME_22
-IDS_DEFAULT_AVATAR_NAME_23
-IDS_DEFAULT_AVATAR_NAME_24
-IDS_DEFAULT_AVATAR_NAME_25
-IDS_DEFAULT_AVATAR_NAME_26
-IDS_DEFAULT_AVATAR_NAME_8
-IDS_DEFAULT_AVATAR_NAME_9
-IDS_DEFAULT_ENCODING
-IDS_DEFAULT_PROFILE_NAME
-IDS_DEFAULT_TAB_TITLE
-IDS_DELETE
-IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION
-IDS_DISABLE_TOUCH_ADJUSTMENT_NAME
-IDS_DOM_DISTILLER_JAVASCRIPT_DISABLED_CONTENT
-IDS_DOM_DISTILLER_QUALITY_ANSWER_NO
-IDS_DOM_DISTILLER_QUALITY_ANSWER_YES
-IDS_DOM_DISTILLER_QUALITY_QUESTION
-IDS_DOM_DISTILLER_VIEWER_CLOSE_READER_VIEW
-IDS_DOM_DISTILLER_VIEWER_FAILED_TO_FIND_ARTICLE_CONTENT
-IDS_DOM_DISTILLER_VIEWER_FAILED_TO_FIND_ARTICLE_TITLE
-IDS_DOM_DISTILLER_VIEWER_LOADING_STRING
-IDS_DOM_DISTILLER_VIEWER_LOADING_TITLE
-IDS_DOM_DISTILLER_VIEWER_NO_DATA_CONTENT
-IDS_DOM_DISTILLER_VIEWER_NO_DATA_TITLE
-IDS_DOM_DISTILLER_VIEWER_VIEW_ORIGINAL
-IDS_DOM_DISTILLER_WEBUI_ENTRY_ADD
-IDS_DOM_DISTILLER_WEBUI_ENTRY_ADD_FAILED
-IDS_DOM_DISTILLER_WEBUI_ENTRY_URL
-IDS_DOM_DISTILLER_WEBUI_FETCHING_ENTRIES
-IDS_DOM_DISTILLER_WEBUI_REFRESH
-IDS_DOM_DISTILLER_WEBUI_TITLE
-IDS_DOM_DISTILLER_WEBUI_VIEW_URL
-IDS_DOM_DISTILLER_WEBUI_VIEW_URL_FAILED
-IDS_DONE
-IDS_EASY_UNLOCK_SCREENLOCK_USER_POD_AUTH_VALUE
-IDS_EDIT_FIND_MAC
-IDS_EMPTY_KEYWORD_VALUE
-IDS_ERRORPAGES_BUTTON_LESS
-IDS_ERRORPAGES_BUTTON_MORE
-IDS_ERRORPAGES_BUTTON_RELOAD
-IDS_ERRORPAGES_BUTTON_SHOW_SAVED_COPY
-IDS_ERRORPAGES_BUTTON_SHOW_SAVED_COPY_HELP
-IDS_ERRORPAGES_DETAILS_ADDRESS_UNREACHABLE
-IDS_ERRORPAGES_DETAILS_BAD_GATEWAY
-IDS_ERRORPAGES_DETAILS_BAD_SSL_CLIENT_AUTH_CERT
-IDS_ERRORPAGES_DETAILS_BLOCKED
-IDS_ERRORPAGES_DETAILS_BLOCKED_BY_ADMINISTRATOR
-IDS_ERRORPAGES_DETAILS_BLOCKED_ENROLLMENT_CHECK_PENDING
-IDS_ERRORPAGES_DETAILS_CACHE_MISS
-IDS_ERRORPAGES_DETAILS_CACHE_READ_FAILURE
-IDS_ERRORPAGES_DETAILS_CONNECTION_CLOSED
-IDS_ERRORPAGES_DETAILS_CONNECTION_FAILED
-IDS_ERRORPAGES_DETAILS_CONNECTION_REFUSED
-IDS_ERRORPAGES_DETAILS_CONNECTION_RESET
-IDS_ERRORPAGES_DETAILS_DNS_PROBE_RUNNING
-IDS_ERRORPAGES_DETAILS_DOWNLOAD_FILE_TYPE_ERROR
-IDS_ERRORPAGES_DETAILS_EMPTY_RESPONSE
-IDS_ERRORPAGES_DETAILS_FILE_ACCESS_DENIED
-IDS_ERRORPAGES_DETAILS_FILE_NOT_FOUND
-IDS_ERRORPAGES_DETAILS_FORBIDDEN
-IDS_ERRORPAGES_DETAILS_GATEWAY_TIMEOUT
-IDS_ERRORPAGES_DETAILS_GONE
-IDS_ERRORPAGES_DETAILS_HTTP_VERSION_NOT_SUPPORTED
-IDS_ERRORPAGES_DETAILS_ICANN_NAME_COLLISION
-IDS_ERRORPAGES_DETAILS_INTERNAL_SERVER_ERROR
-IDS_ERRORPAGES_DETAILS_INTERNET_DISCONNECTED
-IDS_ERRORPAGES_DETAILS_NAME_NOT_RESOLVED
-IDS_ERRORPAGES_DETAILS_NETWORK_ACCESS_DENIED
-IDS_ERRORPAGES_DETAILS_NETWORK_CHANGED
-IDS_ERRORPAGES_DETAILS_NETWORK_IO_SUSPENDED
-IDS_ERRORPAGES_DETAILS_NOT_IMPLEMENTED
-IDS_ERRORPAGES_DETAILS_PINNING_FAILURE
-IDS_ERRORPAGES_DETAILS_PROXY_CONNECTION_FAILED
-IDS_ERRORPAGES_DETAILS_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION
-IDS_ERRORPAGES_DETAILS_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH
-IDS_ERRORPAGES_DETAILS_RESPONSE_HEADERS_MULTIPLE_LOCATION
-IDS_ERRORPAGES_DETAILS_SERVICE_UNAVAILABLE
-IDS_ERRORPAGES_DETAILS_SSL_FALLBACK_BEYOND_MINIMUM_VERSION
-IDS_ERRORPAGES_DETAILS_SSL_PROTOCOL_ERROR
-IDS_ERRORPAGES_DETAILS_SSL_VERSION_OR_CIPHER_MISMATCH
-IDS_ERRORPAGES_DETAILS_TEMPORARILY_THROTTLED
-IDS_ERRORPAGES_DETAILS_TIMED_OUT
-IDS_ERRORPAGES_DETAILS_TOO_MANY_REDIRECTS
-IDS_ERRORPAGES_DETAILS_UNKNOWN
-IDS_ERRORPAGES_ERROR_CODE
-IDS_ERRORPAGES_HEADING_ACCESS_DENIED
-IDS_ERRORPAGES_HEADING_BAD_SSL_CLIENT_AUTH_CERT
-IDS_ERRORPAGES_HEADING_BLOCKED
-IDS_ERRORPAGES_HEADING_BLOCKED_BY_ADMINISTRATOR
-IDS_ERRORPAGES_HEADING_CACHE_MISS
-IDS_ERRORPAGES_HEADING_CACHE_READ_FAILURE
-IDS_ERRORPAGES_HEADING_DOWNLOAD_FILE_TYPE_ERROR
-IDS_ERRORPAGES_HEADING_DUPLICATE_HEADERS
-IDS_ERRORPAGES_HEADING_EMPTY_RESPONSE
-IDS_ERRORPAGES_HEADING_FILE_ACCESS_DENIED
-IDS_ERRORPAGES_HEADING_HTTP_SERVER_ERROR
-IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED
-IDS_ERRORPAGES_HEADING_NETWORK_ACCESS_DENIED
-IDS_ERRORPAGES_HEADING_NETWORK_IO_SUSPENDED
-IDS_ERRORPAGES_HEADING_NOT_AVAILABLE
-IDS_ERRORPAGES_HEADING_NOT_FOUND
-IDS_ERRORPAGES_HEADING_PINNING_FAILURE
-IDS_ERRORPAGES_HEADING_PROXY_CONNECTION_FAILED
-IDS_ERRORPAGES_HEADING_SSL_FALLBACK_BEYOND_MINIMUM_VERSION
-IDS_ERRORPAGES_HEADING_SSL_PROTOCOL_ERROR
-IDS_ERRORPAGES_HEADING_SSL_VERSION_OR_CIPHER_MISMATCH
-IDS_ERRORPAGES_HEADING_TOO_MANY_REDIRECTS
-IDS_ERRORPAGES_HEADING_WEAK_SERVER_EPHEMERAL_DH_KEY
-IDS_ERRORPAGES_HTTP_POST_WARNING
-IDS_ERRORPAGES_SUGGESTION_CHECK_CONNECTION_BODY
-IDS_ERRORPAGES_SUGGESTION_CHECK_CONNECTION_HEADER
-IDS_ERRORPAGES_SUGGESTION_CONTACT_ADMINISTRATOR
-IDS_ERRORPAGES_SUGGESTION_DNS_CONFIG
-IDS_ERRORPAGES_SUGGESTION_FIREWALL_CONFIG
-IDS_ERRORPAGES_SUGGESTION_GOOGLE_SEARCH
-IDS_ERRORPAGES_SUGGESTION_LEARNMORE_BODY
-IDS_ERRORPAGES_SUGGESTION_NETWORK_PREDICTION
-IDS_ERRORPAGES_SUGGESTION_PROXY_CONFIG
-IDS_ERRORPAGES_SUGGESTION_PROXY_DISABLE_PLATFORM
-IDS_ERRORPAGES_SUGGESTION_RELOAD
-IDS_ERRORPAGES_SUGGESTION_RELOAD_REPOST_BODY
-IDS_ERRORPAGES_SUGGESTION_RELOAD_REPOST_HEADER
-IDS_ERRORPAGES_SUGGESTION_VIEW_POLICIES
-IDS_ERRORPAGES_SUMMARY_ADDRESS_UNREACHABLE
-IDS_ERRORPAGES_SUMMARY_BAD_GATEWAY
-IDS_ERRORPAGES_SUMMARY_BAD_SSL_CLIENT_AUTH_CERT
-IDS_ERRORPAGES_SUMMARY_BLOCKED
-IDS_ERRORPAGES_SUMMARY_BLOCKED_BY_ADMINISTRATOR
-IDS_ERRORPAGES_SUMMARY_BLOCKED_ENROLLMENT_CHECK_PENDING
-IDS_ERRORPAGES_SUMMARY_CACHE_MISS
-IDS_ERRORPAGES_SUMMARY_CACHE_READ_FAILURE
-IDS_ERRORPAGES_SUMMARY_CONNECTION_REFUSED
-IDS_ERRORPAGES_SUMMARY_CONNECTION_RESET
-IDS_ERRORPAGES_SUMMARY_DNS_PROBE_RUNNING
-IDS_ERRORPAGES_SUMMARY_DOWNLOAD_FILE_TYPE_ERROR
-IDS_ERRORPAGES_SUMMARY_DUPLICATE_HEADERS
-IDS_ERRORPAGES_SUMMARY_EMPTY_RESPONSE
-IDS_ERRORPAGES_SUMMARY_FILE_ACCESS_DENIED
-IDS_ERRORPAGES_SUMMARY_FORBIDDEN
-IDS_ERRORPAGES_SUMMARY_GATEWAY_TIMEOUT
-IDS_ERRORPAGES_SUMMARY_GONE
-IDS_ERRORPAGES_SUMMARY_ICANN_NAME_COLLISION
-IDS_ERRORPAGES_SUMMARY_INTERNAL_SERVER_ERROR
-IDS_ERRORPAGES_SUMMARY_INTERNET_DISCONNECTED
-IDS_ERRORPAGES_SUMMARY_INTERNET_DISCONNECTED_INSTRUCTIONS_TEMPLATE
-IDS_ERRORPAGES_SUMMARY_INTERNET_DISCONNECTED_PLATFORM
-IDS_ERRORPAGES_SUMMARY_NAME_NOT_RESOLVED
-IDS_ERRORPAGES_SUMMARY_NETWORK_ACCESS_DENIED
-IDS_ERRORPAGES_SUMMARY_NETWORK_CHANGED
-IDS_ERRORPAGES_SUMMARY_NETWORK_IO_SUSPENDED
-IDS_ERRORPAGES_SUMMARY_NOT_AVAILABLE
-IDS_ERRORPAGES_SUMMARY_NOT_FOUND
-IDS_ERRORPAGES_SUMMARY_PINNING_FAILURE
-IDS_ERRORPAGES_SUMMARY_PROXY_CONNECTION_FAILED
-IDS_ERRORPAGES_SUMMARY_SERVICE_UNAVAILABLE
-IDS_ERRORPAGES_SUMMARY_SSL_FALLBACK_BEYOND_MINIMUM_VERSION
-IDS_ERRORPAGES_SUMMARY_SSL_PROTOCOL_ERROR
-IDS_ERRORPAGES_SUMMARY_SSL_VERSION_OR_CIPHER_MISMATCH
-IDS_ERRORPAGES_SUMMARY_TEMPORARILY_THROTTLED
-IDS_ERRORPAGES_SUMMARY_TIMED_OUT
-IDS_ERRORPAGES_SUMMARY_TOO_MANY_REDIRECTS
-IDS_ERRORPAGES_SUMMARY_WEAK_SERVER_EPHEMERAL_DH_KEY
-IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE
-IDS_ERRORPAGES_TITLE_ACCESS_DENIED
-IDS_ERRORPAGES_TITLE_BLOCKED
-IDS_ERRORPAGES_TITLE_LOAD_FAILED
-IDS_ERRORPAGES_TITLE_NOT_AVAILABLE
-IDS_ERRORPAGES_TITLE_NOT_FOUND
-IDS_ERRORPAGE_NET_BUTTON_DETAILS
-IDS_ERRORPAGE_NET_BUTTON_HIDE_DETAILS
-IDS_EXTENSION_KEYWORD_COMMAND
-IDS_FEEDBACK_REPORT_PAGE_TITLE
-IDS_FEEDBACK_REPORT_URL_LABEL
-IDS_FEEDBACK_SEND_REPORT
-IDS_FEEDBACK_USER_EMAIL_LABEL
-IDS_FIND_IN_PAGE_CLOSE_TOOLTIP
-IDS_FIND_IN_PAGE_COUNT
-IDS_FIND_IN_PAGE_NEXT_TOOLTIP
-IDS_FIND_IN_PAGE_PREVIOUS_TOOLTIP
-IDS_FLAGS_ACCELERATED_FIXED_ROOT_BACKGROUND_DESCRIPTION
-IDS_FLAGS_ACCELERATED_FIXED_ROOT_BACKGROUND_NAME
-IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION
-IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME
-IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION
-IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME
-IDS_FLAGS_COMPOSITED_LAYER_BORDERS
-IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION
-IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_DESCRIPTION
-IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_HIGH_DPI
-IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_NAME
-IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION
-IDS_FLAGS_CONFLICTS_CHECK_NAME
-IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION
-IDS_FLAGS_DEBUG_PACKED_APP_NAME
-IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION
-IDS_FLAGS_DEBUG_SHORTCUTS_NAME
-IDS_FLAGS_DEFAULT_TILE_HEIGHT_DESCRIPTION
-IDS_FLAGS_DEFAULT_TILE_HEIGHT_GRANDE
-IDS_FLAGS_DEFAULT_TILE_HEIGHT_NAME
-IDS_FLAGS_DEFAULT_TILE_HEIGHT_SHORT
-IDS_FLAGS_DEFAULT_TILE_HEIGHT_TALL
-IDS_FLAGS_DEFAULT_TILE_HEIGHT_VENTI
-IDS_FLAGS_DEFAULT_TILE_WIDTH_DESCRIPTION
-IDS_FLAGS_DEFAULT_TILE_WIDTH_GRANDE
-IDS_FLAGS_DEFAULT_TILE_WIDTH_NAME
-IDS_FLAGS_DEFAULT_TILE_WIDTH_SHORT
-IDS_FLAGS_DEFAULT_TILE_WIDTH_TALL
-IDS_FLAGS_DEFAULT_TILE_WIDTH_VENTI
-IDS_FLAGS_DISABLE
-IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION
-IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME
-IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION
-IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME
-IDS_FLAGS_DISABLE_BOOT_ANIMATION
-IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION
-IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION
-IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME
-IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION
-IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME
-IDS_FLAGS_DISABLE_PNACL_DESCRIPTION
-IDS_FLAGS_DISABLE_PNACL_NAME
-IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION
-IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME
-IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION
-IDS_FLAGS_DISABLE_WEBGL_NAME
-IDS_FLAGS_DISABLE_WEBRTC_DESCRIPTION
-IDS_FLAGS_DISABLE_WEBRTC_NAME
-IDS_FLAGS_ENABLE
-IDS_FLAGS_ENABLE_ACCELERATED_MJPEG_DECODE_DESCRIPTION
-IDS_FLAGS_ENABLE_ACCELERATED_MJPEG_DECODE_NAME
-IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_DESCRIPTION
-IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_NAME
-IDS_FLAGS_ENABLE_CONTEXTUAL_SEARCH
-IDS_FLAGS_ENABLE_CONTEXTUAL_SEARCH_DESCRIPTION
-IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION
-IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME
-IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION
-IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME
-IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION
-IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME
-IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_DESCRIPTION
-IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_NAME
-IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_DESCRIPTION
-IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_NAME
-IDS_FLAGS_ENABLE_ICON_NTP_DESCRIPTION
-IDS_FLAGS_ENABLE_ICON_NTP_NAME
-IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION
-IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME
-IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION
-IDS_FLAGS_ENABLE_NACL_DEBUG_NAME
-IDS_FLAGS_ENABLE_NACL_DESCRIPTION
-IDS_FLAGS_ENABLE_NACL_NAME
-IDS_FLAGS_ENABLE_PANELS_DESCRIPTION
-IDS_FLAGS_ENABLE_PANELS_NAME
-IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION
-IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME
-IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION
-IDS_FLAGS_ENABLE_PINCH_SCALE_NAME
-IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION
-IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME
-IDS_FLAGS_ENABLE_SCREEN_CAPTURE_DESCRIPTION
-IDS_FLAGS_ENABLE_SCREEN_CAPTURE_NAME
-IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_DESCRIPTION
-IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME
-IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION
-IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME
-IDS_FLAGS_ENABLE_STALE_WHILE_REVALIDATE_DESCRIPTION
-IDS_FLAGS_ENABLE_STALE_WHILE_REVALIDATE_NAME
-IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_DESCRIPTION
-IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_NAME
-IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_DESCRIPTION
-IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_NAME
-IDS_FLAGS_ENABLE_TCP_FAST_OPEN_DESCRIPTION
-IDS_FLAGS_ENABLE_TCP_FAST_OPEN_NAME
-IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION
-IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME
-IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION
-IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME
-IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_DESCRIPTION
-IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_NAME
-IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION
-IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME
-IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_DESCRIPTION
-IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_NAME
-IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_DESCRIPTION
-IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_NAME
-IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION
-IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME
-IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION
-IDS_FLAGS_FORCE_HIGH_DPI_NAME
-IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION
-IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME
-IDS_FLAGS_LONG_TITLE
-IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION
-IDS_FLAGS_NACL_DEBUG_MASK_NAME
-IDS_FLAGS_NOT_AVAILABLE
-IDS_FLAGS_NO_EXPERIMENTS_AVAILABLE
-IDS_FLAGS_NO_UNSUPPORTED_EXPERIMENTS
-IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION
-IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME
-IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION
-IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME
-IDS_FLAGS_RELAUNCH_BUTTON
-IDS_FLAGS_RELAUNCH_NOTICE
-IDS_FLAGS_RESET_ALL_BUTTON
-IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION
-IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME
-IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION
-IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME
-IDS_FLAGS_SHOW_FPS_COUNTER
-IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION
-IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION
-IDS_FLAGS_SHOW_TOUCH_HUD_NAME
-IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION
-IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME
-IDS_FLAGS_SPELLCHECK_AUTOCORRECT
-IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION
-IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION
-IDS_FLAGS_STACKED_TAB_STRIP_NAME
-IDS_FLAGS_TABLE_TITLE
-IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION
-IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME
-IDS_FLAGS_TOUCH_SCROLLING_MODE_ABSORB_TOUCHMOVE
-IDS_FLAGS_TOUCH_SCROLLING_MODE_DESCRIPTION
-IDS_FLAGS_TOUCH_SCROLLING_MODE_NAME
-IDS_FLAGS_TOUCH_SCROLLING_MODE_SYNC_TOUCHMOVE
-IDS_FLAGS_TOUCH_SCROLLING_MODE_TOUCHCANCEL
-IDS_FLAGS_UNSUPPORTED_TABLE_TITLE
-IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_DESCRIPTION
-IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_NAME
-IDS_FLAGS_WARNING_HEADER
-IDS_FLAGS_WARNING_TEXT
-IDS_FULLSCREEN
-IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC
-IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
-IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
-IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
-IDS_GROUP_BY_DOMAIN_LABEL
-IDS_GUEST_PROFILE_NAME
-IDS_HARMFUL_V3_EXPLANATION_PARAGRAPH
-IDS_HARMFUL_V3_HEADING
-IDS_HARMFUL_V3_PRIMARY_PARAGRAPH
-IDS_HARMFUL_V3_PROCEED_PARAGRAPH
-IDS_HISTORY_ACTION_MENU_DESCRIPTION
-IDS_HISTORY_BLOCKED_VISIT_TEXT
-IDS_HISTORY_BROWSERESULTS
-IDS_HISTORY_CONTINUED
-IDS_HISTORY_DATE_WITH_RELATIVE_TIME
-IDS_HISTORY_DELETE_PRIOR_VISITS_CONFIRM_BUTTON
-IDS_HISTORY_DELETE_PRIOR_VISITS_WARNING
-IDS_HISTORY_FILTER_ALLOWED
-IDS_HISTORY_FILTER_ALLOW_ITEMS
-IDS_HISTORY_FILTER_BLOCKED
-IDS_HISTORY_FILTER_BLOCK_ITEMS
-IDS_HISTORY_HAS_SYNCED_RESULTS
-IDS_HISTORY_INTERVAL
-IDS_HISTORY_IN_CONTENT_PACK
-IDS_HISTORY_LOADING
-IDS_HISTORY_LOCK_BUTTON
-IDS_HISTORY_MORE_FROM_SITE
-IDS_HISTORY_NEWER
-IDS_HISTORY_NEWEST
-IDS_HISTORY_NO_RESULTS
-IDS_HISTORY_NO_SEARCH_RESULTS
-IDS_HISTORY_NO_SYNCED_RESULTS
-IDS_HISTORY_NUMBER_VISITS
-IDS_HISTORY_OLDER
-IDS_HISTORY_OPEN_CLEAR_BROWSING_DATA_DIALOG
-IDS_HISTORY_OTHER_SESSIONS_COLLAPSE_SESSION
-IDS_HISTORY_OTHER_SESSIONS_EXPAND_SESSION
-IDS_HISTORY_OTHER_SESSIONS_OPEN_ALL
-IDS_HISTORY_RANGE_ALL_TIME
-IDS_HISTORY_RANGE_LABEL
-IDS_HISTORY_RANGE_MONTH
-IDS_HISTORY_RANGE_NEXT
-IDS_HISTORY_RANGE_PREVIOUS
-IDS_HISTORY_RANGE_TODAY
-IDS_HISTORY_RANGE_WEEK
-IDS_HISTORY_REMOVE_BOOKMARK
-IDS_HISTORY_REMOVE_PAGE
-IDS_HISTORY_REMOVE_SELECTED_ITEMS
-IDS_HISTORY_SEARCHRESULTSFOR
-IDS_HISTORY_SEARCH_BUTTON
-IDS_HISTORY_TITLE
-IDS_HISTORY_UNKNOWN_DEVICE
-IDS_HISTORY_UNLOCK_BUTTON
-IDS_HTTP_POST_WARNING
-IDS_HTTP_POST_WARNING_RESEND
-IDS_HTTP_POST_WARNING_TITLE
-IDS_IMPORT_FROM_FIREFOX
-IDS_IMPORT_FROM_ICEWEASEL
-IDS_JAVASCRIPT_ALERT_DEFAULT_TITLE
-IDS_JAVASCRIPT_ALERT_TITLE
-IDS_JAVASCRIPT_MESSAGEBOX_DEFAULT_TITLE
-IDS_JAVASCRIPT_MESSAGEBOX_TITLE
-IDS_KEYWORD_SEARCH
-IDS_LEARN_MORE
-IDS_LEGACY_DEFAULT_PROFILE_NAME
-IDS_LIBADDRESSINPUT_ADDRESS_LINE_1_LABEL
-IDS_LIBADDRESSINPUT_AREA
-IDS_LIBADDRESSINPUT_COUNTRY_OR_REGION_LABEL
-IDS_LIBADDRESSINPUT_COUNTY
-IDS_LIBADDRESSINPUT_DEPARTMENT
-IDS_LIBADDRESSINPUT_DISTRICT
-IDS_LIBADDRESSINPUT_DO_SI
-IDS_LIBADDRESSINPUT_EMIRATE
-IDS_LIBADDRESSINPUT_ISLAND
-IDS_LIBADDRESSINPUT_LOCALITY_LABEL
-IDS_LIBADDRESSINPUT_MISMATCHING_VALUE_POSTAL_CODE
-IDS_LIBADDRESSINPUT_MISMATCHING_VALUE_POSTAL_CODE_URL
-IDS_LIBADDRESSINPUT_MISMATCHING_VALUE_ZIP
-IDS_LIBADDRESSINPUT_MISMATCHING_VALUE_ZIP_URL
-IDS_LIBADDRESSINPUT_MISSING_REQUIRED_FIELD
-IDS_LIBADDRESSINPUT_MISSING_REQUIRED_POSTAL_CODE_EXAMPLE
-IDS_LIBADDRESSINPUT_MISSING_REQUIRED_POSTAL_CODE_EXAMPLE_AND_URL
-IDS_LIBADDRESSINPUT_MISSING_REQUIRED_ZIP_CODE_EXAMPLE
-IDS_LIBADDRESSINPUT_MISSING_REQUIRED_ZIP_CODE_EXAMPLE_AND_URL
-IDS_LIBADDRESSINPUT_NEIGHBORHOOD
-IDS_LIBADDRESSINPUT_OBLAST
-IDS_LIBADDRESSINPUT_ORGANIZATION_LABEL
-IDS_LIBADDRESSINPUT_PARISH
-IDS_LIBADDRESSINPUT_PIN_CODE_LABEL
-IDS_LIBADDRESSINPUT_POSTAL_CODE_LABEL
-IDS_LIBADDRESSINPUT_POST_TOWN
-IDS_LIBADDRESSINPUT_PO_BOX_FORBIDDEN_VALUE
-IDS_LIBADDRESSINPUT_PREFECTURE
-IDS_LIBADDRESSINPUT_PROVINCE
-IDS_LIBADDRESSINPUT_RECIPIENT_LABEL
-IDS_LIBADDRESSINPUT_STATE
-IDS_LIBADDRESSINPUT_SUBURB
-IDS_LIBADDRESSINPUT_UNKNOWN_VALUE
-IDS_LIBADDRESSINPUT_UNRECOGNIZED_FORMAT_POSTAL_CODE
-IDS_LIBADDRESSINPUT_UNRECOGNIZED_FORMAT_POSTAL_CODE_EXAMPLE
-IDS_LIBADDRESSINPUT_UNRECOGNIZED_FORMAT_POSTAL_CODE_EXAMPLE_AND_URL
-IDS_LIBADDRESSINPUT_UNRECOGNIZED_FORMAT_ZIP
-IDS_LIBADDRESSINPUT_UNRECOGNIZED_FORMAT_ZIP_CODE_EXAMPLE
-IDS_LIBADDRESSINPUT_UNRECOGNIZED_FORMAT_ZIP_CODE_EXAMPLE_AND_URL
-IDS_LIBADDRESSINPUT_VILLAGE_TOWNSHIP
-IDS_LIBADDRESSINPUT_ZIP_CODE_LABEL
-IDS_LINK_FROM_CLIPBOARD
-IDS_LOGIN_DIALOG_OK_BUTTON_LABEL
-IDS_LOGIN_DIALOG_PASSWORD_FIELD
-IDS_LOGIN_DIALOG_TITLE
-IDS_LOGIN_DIALOG_USERNAME_FIELD
-IDS_MALWARE_V3_ADVICE_HEADING
-IDS_MALWARE_V3_EXPLANATION_PARAGRAPH
-IDS_MALWARE_V3_EXPLANATION_PARAGRAPH_ADVICE
-IDS_MALWARE_V3_EXPLANATION_PARAGRAPH_HISTORY
-IDS_MALWARE_V3_EXPLANATION_PARAGRAPH_SUBRESOURCE
-IDS_MALWARE_V3_EXPLANATION_PARAGRAPH_SUBRESOURCE_ADVICE
-IDS_MALWARE_V3_EXPLANATION_PARAGRAPH_SUBRESOURCE_HISTORY
-IDS_MALWARE_V3_HEADING
-IDS_MALWARE_V3_PRIMARY_PARAGRAPH
-IDS_MALWARE_V3_PROCEED_PARAGRAPH
-IDS_MALWARE_V3_PROCEED_PARAGRAPH_NOT_RECOMMEND
-IDS_MALWARE_V3_PROCEED_PARAGRAPH_SOCIAL
-IDS_MANAGED_USER_AVATAR_LABEL
-IDS_MIDI_SYSEX_INFOBAR_QUESTION
-IDS_MIDI_SYSEX_PERMISSION_FRAGMENT
-IDS_MOBILE_WELCOME_URL
-IDS_NACL_DEBUG_MASK_CHOICE_DEBUG_ALL
-IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS_PNACL
-IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG
-IDS_NETWORK_PREDICTION_ENABLED_DESCRIPTION
-IDS_NET_EXPORT_NO_EMAIL_ACCOUNTS_ALERT_MESSAGE
-IDS_NET_EXPORT_NO_EMAIL_ACCOUNTS_ALERT_TITLE
-IDS_NEW_INCOGNITO_WINDOW_MAC
-IDS_NEW_NUMBERED_PROFILE_NAME
-IDS_NEW_TAB_CHROME_WELCOME_PAGE_TITLE
-IDS_NEW_TAB_MOST_VISITED
-IDS_NEW_TAB_RECENTLY_CLOSED
-IDS_NEW_TAB_RESTORE_THUMBNAILS_SHORT_LINK
-IDS_NEW_TAB_THUMBNAIL_REMOVED_NOTIFICATION
-IDS_NEW_TAB_TITLE
-IDS_NEW_TAB_UNDO_THUMBNAIL_REMOVE
-IDS_NUMBERED_PROFILE_NAME
-IDS_OK
-IDS_OMNIBOX_EMPTY_HINT
-IDS_ONE_CLICK_SIGNIN_CONFIRM_EMAIL_DIALOG_CANCEL_BUTTON
-IDS_OPEN_TABS_NOTYETSYNCED
-IDS_OPEN_TABS_PROMOCOMPUTER
-IDS_OPTIONS_ADVANCED_SECTION_TITLE_PRIVACY
-IDS_OPTIONS_DISABLE_WEB_SERVICES
-IDS_OPTIONS_ENABLE_LOGGING
-IDS_OPTIONS_IMPROVE_BROWSING_EXPERIENCE
-IDS_OPTIONS_PROXIES_CONFIGURE_BUTTON
-IDS_OTHER_DEVICES_X_MORE
-IDS_PAGEINFO_ADDRESS
-IDS_PAGEINFO_CERT_INFO_BUTTON
-IDS_PAGEINFO_PARTIAL_ADDRESS
-IDS_PAGE_INFO_HELP_CENTER_LINK
-IDS_PAGE_INFO_INTERNAL_PAGE
-IDS_PAGE_INFO_SECURITY_BUTTON_ACCESSIBILITY_LABEL
-IDS_PAGE_INFO_SECURITY_TAB_DEPRECATED_SIGNATURE_ALGORITHM
-IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_CONNECTION_TEXT
-IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_INSECURE_CONTENT_ERROR
-IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_INSECURE_CONTENT_WARNING
-IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_SENTENCE_LINK
-IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTION_DETAILS
-IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTION_DETAILS_AEAD
-IDS_PAGE_INFO_SECURITY_TAB_FALLBACK_MESSAGE
-IDS_PAGE_INFO_SECURITY_TAB_FIRST_VISITED_TODAY
-IDS_PAGE_INFO_SECURITY_TAB_INSECURE_IDENTITY
-IDS_PAGE_INFO_SECURITY_TAB_NON_UNIQUE_NAME
-IDS_PAGE_INFO_SECURITY_TAB_NOT_ENCRYPTED_CONNECTION_TEXT
-IDS_PAGE_INFO_SECURITY_TAB_NO_REVOCATION_MECHANISM
-IDS_PAGE_INFO_SECURITY_TAB_RENEGOTIATION_MESSAGE
-IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY_EV_NO_CT
-IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY_NO_CT
-IDS_PAGE_INFO_SECURITY_TAB_SSL_VERSION
-IDS_PAGE_INFO_SECURITY_TAB_UNABLE_TO_CHECK_REVOCATION
-IDS_PAGE_INFO_SECURITY_TAB_UNKNOWN_PARTY
-IDS_PAGE_INFO_SECURITY_TAB_WEAK_ENCRYPTION_CONNECTION_TEXT
-IDS_PASSWORDS_EXCEPTIONS_TAB_TITLE
-IDS_PASSWORDS_SHOW_PASSWORDS_TAB_TITLE
-IDS_PASSWORD_MANAGER_BLACKLIST_BUTTON
-IDS_PASSWORD_MANAGER_EMPTY_LOGIN
-IDS_PASSWORD_MANAGER_SAVE_BUTTON
-IDS_PASSWORD_MANAGER_SAVE_PASSWORD_PROMPT
-IDS_PAST_TIME_TODAY
-IDS_PAST_TIME_YESTERDAY
-IDS_PDF_INFOBAR_ALWAYS_USE_READER_BUTTON
-IDS_PERMISSION_ALLOW
-IDS_PERMISSION_DENY
-IDS_PHISHING_V3_EXPLANATION_PARAGRAPH
-IDS_PHISHING_V3_HEADING
-IDS_PHISHING_V3_PRIMARY_PARAGRAPH
-IDS_PHISHING_V3_PROCEED_PARAGRAPH
-IDS_PLATFORM_LABEL
-IDS_PLUGIN_CONFIRM_INSTALL_DIALOG_ACCEPT_BUTTON
-IDS_PLUGIN_CONFIRM_INSTALL_DIALOG_TITLE
-IDS_PLUGIN_NOT_SUPPORTED
-IDS_POLICY_ASSOCIATION_STATE_ACTIVE
-IDS_POLICY_ASSOCIATION_STATE_DEPROVISIONED
-IDS_POLICY_ASSOCIATION_STATE_UNMANAGED
-IDS_POLICY_DEFAULT_SEARCH_DISABLED
-IDS_POLICY_DEPRECATED
-IDS_POLICY_DM_STATUS_HTTP_STATUS_ERROR
-IDS_POLICY_DM_STATUS_REQUEST_FAILED
-IDS_POLICY_DM_STATUS_REQUEST_INVALID
-IDS_POLICY_DM_STATUS_RESPONSE_DECODING_ERROR
-IDS_POLICY_DM_STATUS_SERVICE_ACTIVATION_PENDING
-IDS_POLICY_DM_STATUS_SERVICE_DEPROVISIONED
-IDS_POLICY_DM_STATUS_SERVICE_DEVICE_ID_CONFLICT
-IDS_POLICY_DM_STATUS_SERVICE_DEVICE_NOT_FOUND
-IDS_POLICY_DM_STATUS_SERVICE_DOMAIN_MISMATCH
-IDS_POLICY_DM_STATUS_SERVICE_INVALID_SERIAL_NUMBER
-IDS_POLICY_DM_STATUS_SERVICE_MANAGEMENT_NOT_SUPPORTED
-IDS_POLICY_DM_STATUS_SERVICE_MANAGEMENT_TOKEN_INVALID
-IDS_POLICY_DM_STATUS_SERVICE_MISSING_LICENSES
-IDS_POLICY_DM_STATUS_SERVICE_POLICY_NOT_FOUND
-IDS_POLICY_DM_STATUS_SUCCESS
-IDS_POLICY_DM_STATUS_TEMPORARY_UNAVAILABLE
-IDS_POLICY_DM_STATUS_UNKNOWN_ERROR
-IDS_POLICY_FILTER_PLACEHOLDER
-IDS_POLICY_HEADER_LEVEL
-IDS_POLICY_HEADER_NAME
-IDS_POLICY_HEADER_SCOPE
-IDS_POLICY_HEADER_STATUS
-IDS_POLICY_HEADER_VALUE
-IDS_POLICY_HIDE_EXPANDED_VALUE
-IDS_POLICY_INVALID_BOOKMARK
-IDS_POLICY_INVALID_PROXY_MODE_ERROR
-IDS_POLICY_INVALID_SEARCH_URL_ERROR
-IDS_POLICY_LABEL_ASSET_ID
-IDS_POLICY_LABEL_CLIENT_ID
-IDS_POLICY_LABEL_DIRECTORY_API_ID
-IDS_POLICY_LABEL_DOMAIN
-IDS_POLICY_LABEL_LOCATION
-IDS_POLICY_LABEL_REFRESH_INTERVAL
-IDS_POLICY_LABEL_STATUS
-IDS_POLICY_LABEL_TIME_SINCE_LAST_REFRESH
-IDS_POLICY_LABEL_USERNAME
-IDS_POLICY_LEVEL_ERROR
-IDS_POLICY_LEVEL_MANDATORY
-IDS_POLICY_LEVEL_RECOMMENDED
-IDS_POLICY_LIST_ENTRY_ERROR
-IDS_POLICY_NEVER_FETCHED
-IDS_POLICY_NOT_SPECIFIED
-IDS_POLICY_NOT_SPECIFIED_ERROR
-IDS_POLICY_NO_POLICIES_SET
-IDS_POLICY_OK
-IDS_POLICY_OUT_OF_RANGE_ERROR
-IDS_POLICY_OVERRIDDEN
-IDS_POLICY_PROXY_BOTH_SPECIFIED_ERROR
-IDS_POLICY_PROXY_MODE_AUTO_DETECT_ERROR
-IDS_POLICY_PROXY_MODE_DISABLED_ERROR
-IDS_POLICY_PROXY_MODE_FIXED_SERVERS_ERROR
-IDS_POLICY_PROXY_MODE_PAC_URL_ERROR
-IDS_POLICY_PROXY_MODE_SYSTEM_ERROR
-IDS_POLICY_PROXY_NEITHER_SPECIFIED_ERROR
-IDS_POLICY_RELOAD_POLICIES
-IDS_POLICY_SCHEMA_VALIDATION_ERROR
-IDS_POLICY_SCOPE_DEVICE
-IDS_POLICY_SCOPE_USER
-IDS_POLICY_SHOW_EXPANDED_VALUE
-IDS_POLICY_SHOW_UNSET
-IDS_POLICY_STATUS
-IDS_POLICY_STATUS_DEVICE
-IDS_POLICY_STATUS_USER
-IDS_POLICY_STORE_STATUS_BAD_STATE
-IDS_POLICY_STORE_STATUS_LOAD_ERROR
-IDS_POLICY_STORE_STATUS_OK
-IDS_POLICY_STORE_STATUS_PARSE_ERROR
-IDS_POLICY_STORE_STATUS_SERIALIZE_ERROR
-IDS_POLICY_STORE_STATUS_STORE_ERROR
-IDS_POLICY_STORE_STATUS_UNKNOWN_ERROR
-IDS_POLICY_STORE_STATUS_VALIDATION_ERROR
-IDS_POLICY_SUBKEY_ERROR
-IDS_POLICY_TITLE
-IDS_POLICY_TYPE_ERROR
-IDS_POLICY_UNKNOWN
-IDS_POLICY_UNSET
-IDS_POLICY_VALIDATION_BAD_INITIAL_SIGNATURE
-IDS_POLICY_VALIDATION_BAD_KEY_VERIFICATION_SIGNATURE
-IDS_POLICY_VALIDATION_BAD_SIGNATURE
-IDS_POLICY_VALIDATION_BAD_TIMESTAMP
-IDS_POLICY_VALIDATION_BAD_USERNAME
-IDS_POLICY_VALIDATION_ERROR_CODE_PRESENT
-IDS_POLICY_VALIDATION_OK
-IDS_POLICY_VALIDATION_PAYLOAD_PARSE_ERROR
-IDS_POLICY_VALIDATION_POLICY_PARSE_ERROR
-IDS_POLICY_VALIDATION_UNKNOWN_ERROR
-IDS_POLICY_VALIDATION_WRONG_POLICY_TYPE
-IDS_POLICY_VALIDATION_WRONG_SETTINGS_ENTITY_ID
-IDS_POLICY_VALIDATION_WRONG_TOKEN
-IDS_PREFERENCES_CORRUPT_ERROR
-IDS_PREFERENCES_UNREADABLE_ERROR
-IDS_PRINT
-IDS_PRIVACY_POLICY_URL
-IDS_PRODUCT_NAME
-IDS_PROFILES_GUEST_PROFILE_NAME
-IDS_PROFILES_LOCAL_PROFILE_STATE
-IDS_PROFILE_TOO_NEW_ERROR
-IDS_PUSH_MESSAGES_BUBBLE_FRAGMENT
-IDS_PUSH_MESSAGES_BUBBLE_TEXT
-IDS_PUSH_MESSAGES_PERMISSION_QUESTION
-IDS_RECENT_TABS_MENU
-IDS_SAD_TAB_MESSAGE
-IDS_SAD_TAB_RELOAD_LABEL
-IDS_SAD_TAB_TITLE
-IDS_SAFEBROWSING_OVERRIDABLE_SAFETY_BUTTON
-IDS_SAFEBROWSING_V3_CLOSE_DETAILS_BUTTON
-IDS_SAFEBROWSING_V3_OPEN_DETAILS_BUTTON
-IDS_SAFEBROWSING_V3_TITLE
-IDS_SAFE_BROWSING_MALWARE_BACK_BUTTON
-IDS_SAFE_BROWSING_MALWARE_BACK_HEADLINE
-IDS_SAFE_BROWSING_MALWARE_COLLAB_HEADLINE
-IDS_SAFE_BROWSING_MALWARE_DIAGNOSTIC_PAGE
-IDS_SAFE_BROWSING_MALWARE_FEAR_HEADLINE
-IDS_SAFE_BROWSING_MALWARE_HEADLINE
-IDS_SAFE_BROWSING_MALWARE_LABEL
-IDS_SAFE_BROWSING_MALWARE_QUESTION_HEADLINE
-IDS_SAFE_BROWSING_MALWARE_REPORTING_AGREE
-IDS_SAFE_BROWSING_MALWARE_TITLE
-IDS_SAFE_BROWSING_MALWARE_V2_DESCRIPTION1
-IDS_SAFE_BROWSING_MALWARE_V2_DESCRIPTION1_SUBRESOURCE
-IDS_SAFE_BROWSING_MALWARE_V2_DESCRIPTION2
-IDS_SAFE_BROWSING_MALWARE_V2_DESCRIPTION2_SUBRESOURCE
-IDS_SAFE_BROWSING_MALWARE_V2_DESCRIPTION3
-IDS_SAFE_BROWSING_MALWARE_V2_DETAILS
-IDS_SAFE_BROWSING_MALWARE_V2_DETAILS_SUBRESOURCE
-IDS_SAFE_BROWSING_MALWARE_V2_HEADLINE
-IDS_SAFE_BROWSING_MALWARE_V2_HEADLINE_SUBRESOURCE
-IDS_SAFE_BROWSING_MALWARE_V2_LEARN_MORE
-IDS_SAFE_BROWSING_MALWARE_V2_PROCEED_LINK
-IDS_SAFE_BROWSING_MALWARE_V2_REPORTING_AGREE
-IDS_SAFE_BROWSING_MALWARE_V2_SEE_MORE
-IDS_SAFE_BROWSING_MALWARE_V2_TITLE
-IDS_SAFE_BROWSING_MULTI_MALWARE_DESCRIPTION1
-IDS_SAFE_BROWSING_MULTI_MALWARE_DESCRIPTION2
-IDS_SAFE_BROWSING_MULTI_MALWARE_DESCRIPTION3
-IDS_SAFE_BROWSING_MULTI_MALWARE_DESCRIPTION_AGREE
-IDS_SAFE_BROWSING_MULTI_MALWARE_PROCEED_BUTTON
-IDS_SAFE_BROWSING_MULTI_PHISHING_DESCRIPTION1
-IDS_SAFE_BROWSING_MULTI_THREAT_DESCRIPTION1
-IDS_SAFE_BROWSING_MULTI_THREAT_DESCRIPTION2
-IDS_SAFE_BROWSING_MULTI_THREAT_TITLE
-IDS_SAFE_BROWSING_PHISHING_BACK_HEADLINE
-IDS_SAFE_BROWSING_PHISHING_COLLAB_HEADLINE
-IDS_SAFE_BROWSING_PHISHING_FEAR_HEADLINE
-IDS_SAFE_BROWSING_PHISHING_HEADLINE
-IDS_SAFE_BROWSING_PHISHING_LABEL
-IDS_SAFE_BROWSING_PHISHING_QUESTION_HEADLINE
-IDS_SAFE_BROWSING_PHISHING_REPORT_ERROR
-IDS_SAFE_BROWSING_PHISHING_TITLE
-IDS_SAFE_BROWSING_PHISHING_V2_DESCRIPTION1
-IDS_SAFE_BROWSING_PHISHING_V2_DESCRIPTION2
-IDS_SAFE_BROWSING_PHISHING_V2_HEADLINE
-IDS_SAFE_BROWSING_PHISHING_V2_REPORT_ERROR
-IDS_SAFE_BROWSING_PHISHING_V2_TITLE
-IDS_SAFE_BROWSING_PRIVACY_POLICY_PAGE
-IDS_SAFE_BROWSING_PRIVACY_POLICY_PAGE_V2
-IDS_SAFE_BROWSING_PRIVACY_POLICY_URL
-IDS_SAVE
-IDS_SEARCH_BOX_EMPTY_HINT
-IDS_SECURE_CONNECTION_EV
-IDS_SESSION_CRASHED_VIEW_MESSAGE
-IDS_SESSION_CRASHED_VIEW_RESTORE_BUTTON
-IDS_SETTINGS_SHOW_ADVANCED_SETTINGS
-IDS_SHORT_PRODUCT_NAME
-IDS_SHOW_HISTORY
-IDS_SIGNED_IN_WITH_SYNC_DISABLED
-IDS_SIGNED_IN_WITH_SYNC_SUPPRESSED
-IDS_SIGNIN_ERROR_BUBBLE_VIEW_TITLE
-IDS_SINGLE_PROFILE_DISPLAY_NAME
-IDS_SSL_CLOCK_ERROR
-IDS_SSL_CLOCK_ERROR_EXPLANATION
-IDS_SSL_NONOVERRIDABLE_HSTS
-IDS_SSL_NONOVERRIDABLE_INVALID
-IDS_SSL_NONOVERRIDABLE_MORE
-IDS_SSL_NONOVERRIDABLE_MORE_INVALID_SP3
-IDS_SSL_NONOVERRIDABLE_PINNED
-IDS_SSL_NONOVERRIDABLE_REVOKED
-IDS_SSL_OVERRIDABLE_PRIMARY_PARAGRAPH
-IDS_SSL_OVERRIDABLE_PROCEED_LINK_TEXT
-IDS_SSL_OVERRIDABLE_PROCEED_PARAGRAPH
-IDS_SSL_OVERRIDABLE_SAFETY_BUTTON
-IDS_SSL_OVERRIDABLE_TITLE
-IDS_SSL_RELOAD
-IDS_SSL_V2_CLOCK_AHEAD_HEADING
-IDS_SSL_V2_CLOCK_BEHIND_HEADING
-IDS_SSL_V2_CLOCK_PRIMARY_PARAGRAPH
-IDS_SSL_V2_CLOCK_TITLE
-IDS_SSL_V2_CLOCK_UPDATE_DATE_AND_TIME
-IDS_SSL_V2_CLOSE_DETAILS_BUTTON
-IDS_SSL_V2_HEADING
-IDS_SSL_V2_OPEN_DETAILS_BUTTON
-IDS_SSL_V2_PRIMARY_PARAGRAPH
-IDS_SSL_V2_TITLE
-IDS_STARS_PROMO_LABEL_IOS
-IDS_SUPERVISED_USER_AVATAR_LABEL
-IDS_SUPERVISED_USER_NEW_AVATAR_LABEL
-IDS_SYNC_ACCOUNT_DETAILS_NOT_ENTERED
-IDS_SYNC_ACCOUNT_SYNCING_TO_USER
-IDS_SYNC_ACCOUNT_SYNCING_TO_USER_WITH_MANAGE_LINK
-IDS_SYNC_AUTHENTICATING_LABEL
-IDS_SYNC_BASIC_ENCRYPTION_DATA
-IDS_SYNC_CLEAR_USER_DATA
-IDS_SYNC_CONFIGURE_ENCRYPTION
-IDS_SYNC_DATATYPE_AUTOFILL
-IDS_SYNC_DATATYPE_BOOKMARKS
-IDS_SYNC_DATATYPE_PASSWORDS
-IDS_SYNC_DATATYPE_PREFERENCES
-IDS_SYNC_DATATYPE_TABS
-IDS_SYNC_DATATYPE_TYPED_URLS
-IDS_SYNC_EMPTY_PASSPHRASE_ERROR
-IDS_SYNC_ENABLE_SYNC_ON_ACCOUNT
-IDS_SYNC_ENCRYPTION_SECTION_TITLE
-IDS_SYNC_ENTER_GOOGLE_PASSPHRASE_BODY
-IDS_SYNC_ENTER_PASSPHRASE_BODY
-IDS_SYNC_ENTER_PASSPHRASE_BODY_WITH_DATE
-IDS_SYNC_ENTER_PASSPHRASE_TITLE
-IDS_SYNC_ERROR_BUBBLE_VIEW_TITLE
-IDS_SYNC_ERROR_SIGNING_IN
-IDS_SYNC_FULL_ENCRYPTION_DATA
-IDS_SYNC_INVALID_USER_CREDENTIALS
-IDS_SYNC_LOGIN_INFO_OUT_OF_DATE
-IDS_SYNC_LOGIN_SETTING_UP
-IDS_SYNC_MENU_PRE_SYNCED_LABEL
-IDS_SYNC_MENU_SYNCED_LABEL
-IDS_SYNC_NTP_PASSWORD_ENABLE
-IDS_SYNC_NTP_PASSWORD_PROMO
-IDS_SYNC_NTP_PASSWORD_PROMO,
-IDS_SYNC_NTP_SETUP_IN_PROGRESS
-IDS_SYNC_OPTIONS_GROUP_NAME
-IDS_SYNC_OTHER_SIGN_IN_ERROR_BUBBLE_VIEW_MESSAGE
-IDS_SYNC_PASSPHRASE_ERROR_BUBBLE_VIEW_ACCEPT
-IDS_SYNC_PASSPHRASE_ERROR_BUBBLE_VIEW_MESSAGE
-IDS_SYNC_PASSPHRASE_ERROR_WRENCH_MENU_ITEM
-IDS_SYNC_PASSPHRASE_LABEL
-IDS_SYNC_PASSPHRASE_MISMATCH_ERROR
-IDS_SYNC_PASSPHRASE_MSG_EXPLICIT_POSTFIX
-IDS_SYNC_PASSPHRASE_MSG_EXPLICIT_PREFIX
-IDS_SYNC_PASSWORD_SYNC_ATTENTION
-IDS_SYNC_PROMO_NTP_BUBBLE_MESSAGE
-IDS_SYNC_PROMO_TAB_TITLE
-IDS_SYNC_RELOGIN_LINK_LABEL
-IDS_SYNC_SERVER_IS_UNREACHABLE
-IDS_SYNC_SERVICE_UNAVAILABLE
-IDS_SYNC_SETUP_ERROR
-IDS_SYNC_SIGN_IN_ERROR_BUBBLE_VIEW_ACCEPT
-IDS_SYNC_SIGN_IN_ERROR_BUBBLE_VIEW_MESSAGE
-IDS_SYNC_SIGN_IN_ERROR_WRENCH_MENU_ITEM
-IDS_SYNC_START_SYNC_BUTTON_LABEL
-IDS_SYNC_STATUS_UNRECOVERABLE_ERROR
-IDS_SYNC_STOP_AND_RESTART_SYNC
-IDS_SYNC_TIME_JUST_NOW
-IDS_SYNC_TIME_NEVER
-IDS_SYNC_UNAVAILABLE_ERROR_BUBBLE_VIEW_ACCEPT
-IDS_SYNC_UNAVAILABLE_ERROR_BUBBLE_VIEW_MESSAGE
-IDS_SYNC_UNRECOVERABLE_ERROR_HELP_URL
-IDS_SYNC_UPGRADE_CLIENT
-IDS_SYSTEM_FLAGS_OWNER_ONLY
-IDS_TERMS_HTML
-IDS_TIME_DAYS
-IDS_TIME_DAYS_1ST
-IDS_TIME_ELAPSED_DAYS
-IDS_TIME_ELAPSED_HOURS
-IDS_TIME_ELAPSED_MINS
-IDS_TIME_ELAPSED_SECS
-IDS_TIME_HOURS
-IDS_TIME_HOURS_1ST
-IDS_TIME_HOURS_2ND
-IDS_TIME_LONG_MINS
-IDS_TIME_LONG_MINS_1ST
-IDS_TIME_LONG_MINS_2ND
-IDS_TIME_LONG_SECS
-IDS_TIME_LONG_SECS_2ND
-IDS_TIME_MINS
-IDS_TIME_REMAINING_DAYS
-IDS_TIME_REMAINING_HOURS
-IDS_TIME_REMAINING_LONG_MINS
-IDS_TIME_REMAINING_LONG_SECS
-IDS_TIME_REMAINING_MINS
-IDS_TIME_REMAINING_SECS
-IDS_TIME_SECS
-IDS_TOOLTIP_STAR
-IDS_TOUCH_EVENTS_DESCRIPTION
-IDS_TOUCH_EVENTS_NAME
-IDS_TRANSLATE_INFOBAR_ACCEPT
-IDS_TRANSLATE_INFOBAR_AFTER_MESSAGE
-IDS_TRANSLATE_INFOBAR_AFTER_MESSAGE_AUTODETERMINED_SOURCE_LANGUAGE
-IDS_TRANSLATE_INFOBAR_ALWAYS_TRANSLATE
-IDS_TRANSLATE_INFOBAR_BEFORE_MESSAGE
-IDS_TRANSLATE_INFOBAR_BEFORE_MESSAGE_IOS
-IDS_TRANSLATE_INFOBAR_DENY
-IDS_TRANSLATE_INFOBAR_ERROR_CANT_CONNECT
-IDS_TRANSLATE_INFOBAR_ERROR_CANT_TRANSLATE
-IDS_TRANSLATE_INFOBAR_ERROR_SAME_LANGUAGE
-IDS_TRANSLATE_INFOBAR_NEVER_MESSAGE_IOS
-IDS_TRANSLATE_INFOBAR_NEVER_TRANSLATE
-IDS_TRANSLATE_INFOBAR_OPTIONS_ABOUT
-IDS_TRANSLATE_INFOBAR_OPTIONS_ALWAYS
-IDS_TRANSLATE_INFOBAR_OPTIONS_NEVER_TRANSLATE_LANG
-IDS_TRANSLATE_INFOBAR_OPTIONS_NEVER_TRANSLATE_SITE
-IDS_TRANSLATE_INFOBAR_OPTIONS_REPORT_ERROR
-IDS_TRANSLATE_INFOBAR_RETRY
-IDS_TRANSLATE_INFOBAR_REVERT
-IDS_TRANSLATE_INFOBAR_TRANSLATING_TO
-IDS_TRANSLATE_INFOBAR_UNKNOWN_PAGE_LANGUAGE
-IDS_TRANSLATE_INFOBAR_UNSUPPORTED_PAGE_LANGUAGE
-IDS_UPGRADE_AVAILABLE
-IDS_UPGRADE_AVAILABLE_BUTTON
-IDS_WEB_FONT_FAMILY
-IDS_WEB_FONT_SIZE
diff --git a/build/ios/mac_build.gypi b/build/ios/mac_build.gypi
deleted file mode 100644
index 4da21eb..0000000
--- a/build/ios/mac_build.gypi
+++ /dev/null
@@ -1,83 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Xcode throws an error if an iOS target depends on a Mac OS X target. So
-# any place a utility program needs to be build and run, an action is
-# used to run ninja as script to work around this.
-# Example:
-# {
-#   'target_name': 'foo',
-#   'type': 'none',
-#   'variables': {
-#     # The name of a directory used for ninja. This cannot be shared with
-#     # another mac build.
-#     'ninja_output_dir': 'ninja-foo',
-#     # The full path to the location in which the ninja executable should be
-#     # placed. This cannot be shared with another mac build.
-#    'ninja_product_dir':
-#      '<(DEPTH)/xcodebuild/<(ninja_output_dir)/<(CONFIGURATION_NAME)',
-#     # The list of all the gyp files that contain the targets to run.
-#     're_run_targets': [
-#       'foo.gyp',
-#     ],
-#   },
-#   'includes': ['path_to/mac_build.gypi'],
-#   'actions': [
-#     {
-#       'action_name': 'compile foo',
-#       'inputs': [],
-#       'outputs': [],
-#       'action': [
-#         '<@(ninja_cmd)',
-#         # All the targets to build.
-#         'foo1',
-#         'foo2',
-#       ],
-#     },
-#   ],
-# }
-{
-  'variables': {
-    'variables': {
-     'parent_generator%': '<(GENERATOR)',
-    },
-    'parent_generator%': '<(parent_generator)',
-    # Common ninja command line flags.
-    'ninja_cmd': [
-      # Bounce through clean_env to clean up the environment so things
-      # set by the iOS build don't pollute the Mac build.
-      '<(DEPTH)/build/ios/clean_env.py',
-      # ninja must be found in the PATH.
-      'ADD_TO_PATH=<!(echo $PATH)',
-      'ninja',
-      '-C',
-      '<(ninja_product_dir)',
-    ],
-
-    # Common syntax to rerun gyp to generate the Mac projects.
-    're_run_gyp': [
-      'build/gyp_chromium',
-      '--depth=.',
-      # Don't use anything set for the iOS side of things.
-      '--ignore-environment',
-      # Generate for ninja
-      '--format=ninja',
-      # Generate files into xcodebuild/ninja
-      '-Goutput_dir=xcodebuild/<(ninja_output_dir)',
-      # nacl isn't in the iOS checkout, make sure it's turned off
-      '-Ddisable_nacl=1',
-      # Pass through the Mac SDK version.
-      '-Dmac_sdk=<(mac_sdk)',
-      '-Dparent_generator=<(parent_generator)'
-    ],
-
-    # Rerun gyp for each of the projects needed. This is what actually
-    # generates the projects on disk.
-    're_run_gyp_execution':
-      '<!(cd <(DEPTH) && <@(re_run_gyp) <@(re_run_targets))',
-  },
-  # Since these are used to generate things needed by other targets, make
-  # them hard dependencies so they are always built first.
-  'hard_dependency': 1,
-}
diff --git a/build/isolate.gypi b/build/isolate.gypi
deleted file mode 100644
index 69af5b0..0000000
--- a/build/isolate.gypi
+++ /dev/null
@@ -1,125 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into a target to provide a rule
-# to "build" .isolate files into a .isolated file.
-#
-# To use this, create a gyp target with the following form:
-# 'conditions': [
-#   ['test_isolation_mode != "noop"', {
-#     'targets': [
-#       {
-#         'target_name': 'foo_test_run',
-#         'type': 'none',
-#         'dependencies': [
-#           'foo_test',
-#         ],
-#         'includes': [
-#           '../build/isolate.gypi',
-#         ],
-#         'sources': [
-#           'foo_test.isolate',
-#         ],
-#       },
-#     ],
-#   }],
-# ],
-#
-# Note: foo_test.isolate is included and a source file. It is an inherent
-# property of the .isolate format. This permits to define GYP variables but is
-# a stricter format than GYP so isolate.py can read it.
-#
-# The generated .isolated file will be:
-#   <(PRODUCT_DIR)/foo_test.isolated
-#
-# See http://dev.chromium.org/developers/testing/isolated-testing/for-swes
-# for more information.
-
-{
-  'includes': [
-    '../build/util/version.gypi',
-  ],
-  'rules': [
-    {
-      'rule_name': 'isolate',
-      'extension': 'isolate',
-      'inputs': [
-        # Files that are known to be involved in this step.
-        '<(DEPTH)/tools/isolate_driver.py',
-        '<(DEPTH)/tools/swarming_client/isolate.py',
-        '<(DEPTH)/tools/swarming_client/run_isolated.py',
-      ],
-      'outputs': [],
-      'action': [
-        'python',
-        '<(DEPTH)/tools/isolate_driver.py',
-        '<(test_isolation_mode)',
-        '--isolated', '<(PRODUCT_DIR)/<(RULE_INPUT_ROOT).isolated',
-        '--isolate', '<(RULE_INPUT_PATH)',
-
-        # Variables should use the -V FOO=<(FOO) form so frequent values,
-        # like '0' or '1', aren't stripped out by GYP. Run 'isolate.py help' for
-        # more details.
-
-        # Path variables are used to replace file paths when loading a .isolate
-        # file
-        '--path-variable', 'DEPTH', '<(DEPTH)',
-        '--path-variable', 'PRODUCT_DIR', '<(PRODUCT_DIR) ',
-
-        # Extra variables are replaced on the 'command' entry and on paths in
-        # the .isolate file but are not considered relative paths.
-        '--extra-variable', 'version_full=<(version_full)',
-
-        # Note: This list must match DefaultConfigVariables()
-        # in build/android/pylib/utils/isolator.py
-        '--config-variable', 'CONFIGURATION_NAME=<(CONFIGURATION_NAME)',
-        '--config-variable', 'OS=<(OS)',
-        '--config-variable', 'asan=<(asan)',
-        '--config-variable', 'branding=<(branding)',
-        '--config-variable', 'chromeos=<(chromeos)',
-        '--config-variable', 'component=<(component)',
-        '--config-variable', 'disable_nacl=<(disable_nacl)',
-        '--config-variable', 'enable_pepper_cdms=<(enable_pepper_cdms)',
-        '--config-variable', 'enable_plugins=<(enable_plugins)',
-        '--config-variable', 'fastbuild=<(fastbuild)',
-        '--config-variable', 'icu_use_data_file_flag=<(icu_use_data_file_flag)',
-        # TODO(kbr): move this to chrome_tests.gypi:gles2_conform_tests_run
-        # once support for user-defined config variables is added.
-        '--config-variable',
-          'internal_gles2_conform_tests=<(internal_gles2_conform_tests)',
-        '--config-variable', 'kasko=<(kasko)',
-        '--config-variable', 'libpeer_target_type=<(libpeer_target_type)',
-        '--config-variable', 'lsan=<(lsan)',
-        '--config-variable', 'msan=<(msan)',
-        '--config-variable', 'target_arch=<(target_arch)',
-        '--config-variable', 'tsan=<(tsan)',
-        '--config-variable', 'use_custom_libcxx=<(use_custom_libcxx)',
-        '--config-variable', 'use_instrumented_libraries=<(use_instrumented_libraries)',
-        '--config-variable',
-        'use_prebuilt_instrumented_libraries=<(use_prebuilt_instrumented_libraries)',
-        '--config-variable', 'use_openssl=<(use_openssl)',
-        '--config-variable', 'use_ozone=<(use_ozone)',
-        '--config-variable', 'use_x11=<(use_x11)',
-        '--config-variable', 'v8_use_external_startup_data=<(v8_use_external_startup_data)',
-      ],
-      'conditions': [
-        # Note: When gyp merges lists, it appends them to the old value.
-        ['OS=="mac"', {
-          'action': [
-            '--extra-variable', 'mac_product_name=<(mac_product_name)',
-          ],
-        }],
-        ["test_isolation_mode == 'prepare'", {
-          'outputs': [
-            '<(PRODUCT_DIR)/<(RULE_INPUT_ROOT).isolated.gen.json',
-          ],
-        }, {
-          'outputs': [
-            '<(PRODUCT_DIR)/<(RULE_INPUT_ROOT).isolated',
-          ],
-        }],
-      ],
-    },
-  ],
-}
diff --git a/build/jar_file_jni_generator.gypi b/build/jar_file_jni_generator.gypi
deleted file mode 100644
index 3d95b28..0000000
--- a/build/jar_file_jni_generator.gypi
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into a target to provide a rule
-# to generate jni bindings for system Java-files in a consistent manner.
-#
-# To use this, create a gyp target with the following form:
-# {
-#   'target_name': 'android_jar_jni_headers',
-#   'type': 'none',
-#   'variables': {
-#     'jni_gen_package': 'chrome',
-#     'input_java_class': 'java/io/InputStream.class',
-#   },
-#   'includes': [ '../build/jar_file_jni_generator.gypi' ],
-# },
-#
-# Optional variables:
-#  input_jar_file - The input jar file, if omitted, android_sdk_jar will be used.
-
-{
-  'variables': {
-    'jni_generator': '<(DEPTH)/base/android/jni_generator/jni_generator.py',
-    # A comma separated string of include files.
-    'jni_generator_includes%': (
-        'base/android/jni_generator/jni_generator_helper.h'
-    ),
-    'native_exports%': '--native_exports_optional',
-  },
-  'actions': [
-    {
-      'action_name': 'generate_jni_headers_from_jar_file',
-      'inputs': [
-        '<(jni_generator)',
-        '<(input_jar_file)',
-        '<(android_sdk_jar)',
-      ],
-      'variables': {
-        'java_class_name': '<!(basename <(input_java_class)|sed "s/\.class//")',
-        'input_jar_file%': '<(android_sdk_jar)'
-      },
-      'outputs': [
-        '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)/jni/<(java_class_name)_jni.h',
-      ],
-      'action': [
-        '<(jni_generator)',
-        '-j',
-        '<(input_jar_file)',
-        '--input_file',
-        '<(input_java_class)',
-        '--output_dir',
-        '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)/jni',
-        '--includes',
-        '<(jni_generator_includes)',
-        '--optimize_generation',
-        '<(optimize_jni_generation)',
-        '<(native_exports)',
-      ],
-      'message': 'Generating JNI bindings from  <(input_jar_file)/<(input_java_class)',
-      'process_outputs_as_sources': 1,
-    },
-  ],
-  # This target exports a hard dependency because it generates header
-  # files.
-  'hard_dependency': 1,
-}
diff --git a/build/java.gypi b/build/java.gypi
deleted file mode 100644
index 73c550d..0000000
--- a/build/java.gypi
+++ /dev/null
@@ -1,368 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into a target to provide a rule
-# to build Java in a consistent manner.
-#
-# To use this, create a gyp target with the following form:
-# {
-#   'target_name': 'my-package_java',
-#   'type': 'none',
-#   'variables': {
-#     'java_in_dir': 'path/to/package/root',
-#   },
-#   'includes': ['path/to/this/gypi/file'],
-# }
-#
-# Required variables:
-#  java_in_dir - The top-level java directory. The src should be in
-#    <java_in_dir>/src.
-# Optional/automatic variables:
-#  add_to_dependents_classpaths - Set to 0 if the resulting jar file should not
-#    be added to its dependents' classpaths.
-#  additional_input_paths - These paths will be included in the 'inputs' list to
-#    ensure that this target is rebuilt when one of these paths changes.
-#  additional_src_dirs - Additional directories with .java files to be compiled
-#    and included in the output of this target.
-#  generated_src_dirs - Same as additional_src_dirs except used for .java files
-#    that are generated at build time. This should be set automatically by a
-#    target's dependencies. The .java files in these directories are not
-#    included in the 'inputs' list (unlike additional_src_dirs).
-#  input_jars_paths - The path to jars to be included in the classpath. This
-#    should be filled automatically by depending on the appropriate targets.
-#  javac_includes - A list of specific files to include. This is by default
-#    empty, which leads to inclusion of all files specified. May include
-#    wildcard, and supports '**/' for recursive path wildcards, ie.:
-#    '**/MyFileRegardlessOfDirectory.java', '**/IncludedPrefix*.java'.
-#  has_java_resources - Set to 1 if the java target contains an
-#    Android-compatible resources folder named res.  If 1, R_package and
-#    R_package_relpath must also be set.
-#  R_package - The java package in which the R class (which maps resources to
-#    integer IDs) should be generated, e.g. org.chromium.content.
-#  R_package_relpath - Same as R_package, but replace each '.' with '/'.
-#  res_extra_dirs - A list of extra directories containing Android resources.
-#    These directories may be generated at build time.
-#  res_extra_files - A list of the files in res_extra_dirs.
-#  never_lint - Set to 1 to not run lint on this target.
-
-{
-  'dependencies': [
-    '<(DEPTH)/build/android/setup.gyp:build_output_dirs'
-  ],
-  'variables': {
-    'add_to_dependents_classpaths%': 1,
-    'android_jar': '<(android_sdk)/android.jar',
-    'input_jars_paths': [ '<(android_jar)' ],
-    'additional_src_dirs': [],
-    'javac_includes': [],
-    'jar_name': '<(_target_name).jar',
-    'jar_dir': '<(PRODUCT_DIR)/lib.java',
-    'jar_path': '<(intermediate_dir)/<(jar_name)',
-    'jar_final_path': '<(jar_dir)/<(jar_name)',
-    'jar_excluded_classes': [ '*/R.class', '*/R##*.class' ],
-    'instr_stamp': '<(intermediate_dir)/instr.stamp',
-    'additional_input_paths': [],
-    'dex_path': '<(PRODUCT_DIR)/lib.java/<(_target_name).dex.jar',
-    'generated_src_dirs': ['>@(generated_R_dirs)'],
-    'generated_R_dirs': [],
-    'has_java_resources%': 0,
-    'res_extra_dirs': [],
-    'res_extra_files': [],
-    'res_v14_skip%': 0,
-    'resource_input_paths': ['>@(res_extra_files)'],
-    'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)',
-    'compile_stamp': '<(intermediate_dir)/compile.stamp',
-    'lint_stamp': '<(intermediate_dir)/lint.stamp',
-    'lint_result': '<(intermediate_dir)/lint_result.xml',
-    'lint_config': '<(intermediate_dir)/lint_config.xml',
-    'never_lint%': 0,
-    'findbugs_stamp': '<(intermediate_dir)/findbugs.stamp',
-    'run_findbugs%': 0,
-    'java_in_dir_suffix%': '/src',
-    'proguard_config%': '',
-    'proguard_preprocess%': '0',
-    'enable_errorprone%': '0',
-    'errorprone_exe_path': '<(PRODUCT_DIR)/bin.java/chromium_errorprone',
-    'variables': {
-      'variables': {
-        'proguard_preprocess%': 0,
-        'emma_never_instrument%': 0,
-      },
-      'conditions': [
-        ['proguard_preprocess == 1', {
-          'javac_jar_path': '<(intermediate_dir)/<(_target_name).pre.jar'
-        }, {
-          'javac_jar_path': '<(jar_path)'
-        }],
-        ['chromium_code != 0 and emma_coverage != 0 and emma_never_instrument == 0', {
-          'emma_instrument': 1,
-        }, {
-          'emma_instrument': 0,
-        }],
-      ],
-    },
-    'emma_instrument': '<(emma_instrument)',
-    'javac_jar_path': '<(javac_jar_path)',
-  },
-  'conditions': [
-    ['add_to_dependents_classpaths == 1', {
-      # This all_dependent_settings is used for java targets only. This will add the
-      # jar path to the classpath of dependent java targets.
-      'all_dependent_settings': {
-        'variables': {
-          'input_jars_paths': ['<(jar_final_path)'],
-          'library_dexed_jars_paths': ['<(dex_path)'],
-        },
-      },
-    }],
-    ['has_java_resources == 1', {
-      'variables': {
-        'resource_dir': '<(java_in_dir)/res',
-        'res_input_dirs': ['<(resource_dir)', '<@(res_extra_dirs)'],
-        'resource_input_paths': ['<!@(find <(resource_dir) -type f)'],
-
-        'R_dir': '<(intermediate_dir)/java_R',
-        'R_text_file': '<(R_dir)/R.txt',
-
-        'generated_src_dirs': ['<(R_dir)'],
-        'additional_input_paths': ['<(resource_zip_path)', ],
-
-        'dependencies_res_zip_paths': [],
-        'resource_zip_path': '<(PRODUCT_DIR)/res.java/<(_target_name).zip',
-      },
-      'all_dependent_settings': {
-        'variables': {
-          # Dependent libraries include this target's R.java file via
-          # generated_R_dirs.
-          'generated_R_dirs': ['<(R_dir)'],
-
-          # Dependent libraries and apks include this target's resources via
-          # dependencies_res_zip_paths.
-          'additional_input_paths': ['<(resource_zip_path)'],
-          'dependencies_res_zip_paths': ['<(resource_zip_path)'],
-
-          # additional_res_packages and additional_R_text_files are used to
-          # create this packages R.java files when building the APK.
-          'additional_res_packages': ['<(R_package)'],
-          'additional_R_text_files': ['<(R_text_file)'],
-        },
-      },
-      'actions': [
-        # Generate R.java and crunch image resources.
-        {
-          'action_name': 'process_resources',
-          'message': 'processing resources for <(_target_name)',
-          'variables': {
-            'android_manifest': '<(DEPTH)/build/android/AndroidManifest.xml',
-            # Write the inputs list to a file, so that its mtime is updated when
-            # the list of inputs changes.
-            'inputs_list_file': '>|(java_resources.<(_target_name).gypcmd >@(resource_input_paths))',
-            'process_resources_options': [],
-            'conditions': [
-              ['res_v14_skip == 1', {
-                'process_resources_options': ['--v14-skip']
-              }],
-            ],
-          },
-          'inputs': [
-            '<(DEPTH)/build/android/gyp/util/build_utils.py',
-            '<(DEPTH)/build/android/gyp/process_resources.py',
-            '<(DEPTH)/build/android/gyp/generate_v14_compatible_resources.py',
-            '>@(resource_input_paths)',
-            '>@(dependencies_res_zip_paths)',
-            '>(inputs_list_file)',
-          ],
-          'outputs': [
-            '<(resource_zip_path)',
-          ],
-          'action': [
-            'python', '<(DEPTH)/build/android/gyp/process_resources.py',
-            '--android-sdk', '<(android_sdk)',
-            '--aapt-path', '<(android_aapt_path)',
-            '--non-constant-id',
-
-            '--android-manifest', '<(android_manifest)',
-            '--custom-package', '<(R_package)',
-
-            '--dependencies-res-zips', '>(dependencies_res_zip_paths)',
-            '--resource-dirs', '<(res_input_dirs)',
-
-            '--R-dir', '<(R_dir)',
-            '--resource-zip-out', '<(resource_zip_path)',
-
-            '<@(process_resources_options)',
-          ],
-        },
-      ],
-    }],
-    ['proguard_preprocess == 1', {
-      'actions': [
-        {
-          'action_name': 'proguard_<(_target_name)',
-          'message': 'Proguard preprocessing <(_target_name) jar',
-          'inputs': [
-            '<(android_sdk_root)/tools/proguard/lib/proguard.jar',
-            '<(DEPTH)/build/android/gyp/util/build_utils.py',
-            '<(DEPTH)/build/android/gyp/proguard.py',
-            '<(javac_jar_path)',
-            '<(proguard_config)',
-          ],
-          'outputs': [
-            '<(jar_path)',
-          ],
-          'action': [
-            'python', '<(DEPTH)/build/android/gyp/proguard.py',
-            '--proguard-path=<(android_sdk_root)/tools/proguard/lib/proguard.jar',
-            '--input-path=<(javac_jar_path)',
-            '--output-path=<(jar_path)',
-            '--proguard-config=<(proguard_config)',
-            '--classpath=<(android_sdk_jar) >(input_jars_paths)',
-          ]
-        },
-      ],
-    }],
-    ['run_findbugs == 1', {
-      'actions': [
-        {
-          'action_name': 'findbugs_<(_target_name)',
-          'message': 'Running findbugs on <(_target_name)',
-          'inputs': [
-            '<(DEPTH)/build/android/findbugs_diff.py',
-            '<(DEPTH)/build/android/findbugs_filter/findbugs_exclude.xml',
-            '<(DEPTH)/build/android/pylib/utils/findbugs.py',
-            '>@(input_jars_paths)',
-            '<(jar_final_path)',
-            '<(compile_stamp)',
-          ],
-          'outputs': [
-            '<(findbugs_stamp)',
-          ],
-          'action': [
-            'python', '<(DEPTH)/build/android/findbugs_diff.py',
-            '--auxclasspath-gyp', '>(input_jars_paths)',
-            '--stamp', '<(findbugs_stamp)',
-            '<(jar_final_path)',
-          ],
-        },
-      ],
-    }],
-    ['enable_errorprone == 1', {
-      'dependencies': [
-        '<(DEPTH)/third_party/errorprone/errorprone.gyp:chromium_errorprone',
-      ],
-    }],
-  ],
-  'actions': [
-    {
-      'action_name': 'javac_<(_target_name)',
-      'message': 'Compiling <(_target_name) java sources',
-      'variables': {
-        'extra_args': [],
-        'extra_inputs': [],
-        'java_sources': ['>!@(find >(java_in_dir)>(java_in_dir_suffix) >(additional_src_dirs) -name "*.java")'],
-        'conditions': [
-          ['enable_errorprone == 1', {
-            'extra_inputs': [
-              '<(errorprone_exe_path)',
-            ],
-            'extra_args': [ '--use-errorprone-path=<(errorprone_exe_path)' ],
-          }],
-        ],
-      },
-      'inputs': [
-        '<(DEPTH)/build/android/gyp/util/build_utils.py',
-        '<(DEPTH)/build/android/gyp/javac.py',
-        '>@(java_sources)',
-        '>@(input_jars_paths)',
-        '>@(additional_input_paths)',
-        '<@(extra_inputs)',
-      ],
-      'outputs': [
-        '<(compile_stamp)',
-        '<(javac_jar_path)',
-      ],
-      'action': [
-        'python', '<(DEPTH)/build/android/gyp/javac.py',
-        '--bootclasspath=<(android_sdk_jar)',
-        '--classpath=>(input_jars_paths)',
-        '--src-gendirs=>(generated_src_dirs)',
-        '--javac-includes=<(javac_includes)',
-        '--chromium-code=<(chromium_code)',
-        '--jar-path=<(javac_jar_path)',
-        '--jar-excluded-classes=<(jar_excluded_classes)',
-        '--stamp=<(compile_stamp)',
-        '>@(java_sources)',
-        '<@(extra_args)',
-      ]
-    },
-    {
-      'action_name': 'instr_jar_<(_target_name)',
-      'message': 'Instrumenting <(_target_name) jar',
-      'variables': {
-        'input_path': '<(jar_path)',
-        'output_path': '<(jar_final_path)',
-        'stamp_path': '<(instr_stamp)',
-        'instr_type': 'jar',
-      },
-      'outputs': [
-        '<(jar_final_path)',
-      ],
-      'inputs': [
-        '<(jar_path)',
-      ],
-      'includes': [ 'android/instr_action.gypi' ],
-    },
-    {
-      'variables': {
-        'src_dirs': [
-          '<(java_in_dir)<(java_in_dir_suffix)',
-          '>@(additional_src_dirs)',
-        ],
-        'stamp_path': '<(lint_stamp)',
-        'result_path': '<(lint_result)',
-        'config_path': '<(lint_config)',
-        'lint_jar_path': '<(jar_final_path)',
-      },
-      'inputs': [
-        '<(jar_final_path)',
-        '<(compile_stamp)',
-      ],
-      'outputs': [
-        '<(lint_stamp)',
-      ],
-      'includes': [ 'android/lint_action.gypi' ],
-    },
-    {
-      'action_name': 'jar_toc_<(_target_name)',
-      'message': 'Creating <(_target_name) jar.TOC',
-      'inputs': [
-        '<(DEPTH)/build/android/gyp/util/build_utils.py',
-        '<(DEPTH)/build/android/gyp/util/md5_check.py',
-        '<(DEPTH)/build/android/gyp/jar_toc.py',
-        '<(jar_final_path)',
-      ],
-      'outputs': [
-        '<(jar_final_path).TOC',
-      ],
-      'action': [
-        'python', '<(DEPTH)/build/android/gyp/jar_toc.py',
-        '--jar-path=<(jar_final_path)',
-        '--toc-path=<(jar_final_path).TOC',
-      ]
-    },
-    {
-      'action_name': 'dex_<(_target_name)',
-      'variables': {
-        'conditions': [
-          ['emma_instrument != 0', {
-            'dex_no_locals': 1,
-          }],
-        ],
-        'dex_input_paths': [ '<(jar_final_path)' ],
-        'output_path': '<(dex_path)',
-      },
-      'includes': [ 'android/dex_action.gypi' ],
-    },
-  ],
-}
diff --git a/build/java_aidl.gypi b/build/java_aidl.gypi
deleted file mode 100644
index dda2894..0000000
--- a/build/java_aidl.gypi
+++ /dev/null
@@ -1,79 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into a target to provide a rule
-# to build Java aidl files in a consistent manner.
-#
-# To use this, create a gyp target with the following form:
-# {
-#   'target_name': 'aidl_aidl-file-name',
-#   'type': 'none',
-#   'variables': {
-#     'aidl_interface_file': '<interface-path>/<interface-file>.aidl',
-#     'aidl_import_include': '<(DEPTH)/<path-to-src-dir>',
-#   },
-#   'sources': {
-#     '<input-path1>/<input-file1>.aidl',
-#     '<input-path2>/<input-file2>.aidl',
-#     ...
-#   },
-#   'includes': ['<path-to-this-file>/java_aidl.gypi'],
-# }
-#
-#
-# The generated java files will be:
-#   <(PRODUCT_DIR)/lib.java/<input-file1>.java
-#   <(PRODUCT_DIR)/lib.java/<input-file2>.java
-#   ...
-#
-# Optional variables:
-#  aidl_import_include - This should be an absolute path to your java src folder
-#    that contains the classes that are imported by your aidl files.
-#
-# TODO(cjhopman): dependents need to rebuild when this target's inputs have changed.
-
-{
-  'variables': {
-    'aidl_path%': '<(android_sdk_tools)/aidl',
-    'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/aidl',
-    'aidl_import_include%': '',
-    'additional_aidl_arguments': [],
-    'additional_aidl_input_paths': [],
-  },
-  'direct_dependent_settings': {
-    'variables': {
-      'generated_src_dirs': ['<(intermediate_dir)/'],
-    },
-  },
-  'conditions': [
-    ['aidl_import_include != ""', {
-      'variables': {
-        'additional_aidl_arguments': [ '-I<(aidl_import_include)' ],
-        'additional_aidl_input_paths': [ '<!@(find <(aidl_import_include) -name "*.java" | sort)' ],
-      }
-    }],
-  ],
-  'rules': [
-    {
-      'rule_name': 'compile_aidl',
-      'extension': 'aidl',
-      'inputs': [
-        '<(android_sdk)/framework.aidl',
-        '<(aidl_interface_file)',
-        '<@(additional_aidl_input_paths)',
-      ],
-      'outputs': [
-        '<(intermediate_dir)/<(RULE_INPUT_ROOT).java',
-      ],
-      'action': [
-        '<(aidl_path)',
-        '-p<(android_sdk)/framework.aidl',
-        '-p<(aidl_interface_file)',
-        '<@(additional_aidl_arguments)',
-        '<(RULE_INPUT_PATH)',
-        '<(intermediate_dir)/<(RULE_INPUT_ROOT).java',
-      ],
-    },
-  ],
-}
diff --git a/build/java_apk.gypi b/build/java_apk.gypi
deleted file mode 100644
index ff837c3..0000000
--- a/build/java_apk.gypi
+++ /dev/null
@@ -1,1063 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into a target to provide a rule
-# to build Android APKs in a consistent manner.
-#
-# To use this, create a gyp target with the following form:
-# {
-#   'target_name': 'my_package_apk',
-#   'type': 'none',
-#   'variables': {
-#     'apk_name': 'MyPackage',
-#     'java_in_dir': 'path/to/package/root',
-#     'resource_dir': 'path/to/package/root/res',
-#   },
-#   'includes': ['path/to/this/gypi/file'],
-# }
-#
-# Required variables:
-#  apk_name - The final apk will be named <apk_name>.apk
-#  java_in_dir - The top-level java directory. The src should be in
-#    <(java_in_dir)/src.
-# Optional/automatic variables:
-#  additional_input_paths - These paths will be included in the 'inputs' list to
-#    ensure that this target is rebuilt when one of these paths changes.
-#  additional_res_packages - Package names of R.java files generated in addition
-#    to the default package name defined in AndroidManifest.xml.
-#  additional_src_dirs - Additional directories with .java files to be compiled
-#    and included in the output of this target.
-#  additional_bundled_libs - Additional libraries what will be stripped and
-#    bundled in the apk.
-#  asset_location - The directory where assets are located.
-#  create_abi_split - Whether to create abi-based spilts. Splits
-#    are supported only for minSdkVersion >= 21.
-#  create_density_splits - Whether to create density-based apk splits.
-#  language_splits - List of languages to create apk splits for.
-#  generated_src_dirs - Same as additional_src_dirs except used for .java files
-#    that are generated at build time. This should be set automatically by a
-#    target's dependencies. The .java files in these directories are not
-#    included in the 'inputs' list (unlike additional_src_dirs).
-#  input_jars_paths - The path to jars to be included in the classpath. This
-#    should be filled automatically by depending on the appropriate targets.
-#  is_test_apk - Set to 1 if building a test apk.  This prevents resources from
-#    dependencies from being re-included.
-#  native_lib_target - The target_name of the target which generates the final
-#    shared library to be included in this apk. A stripped copy of the
-#    library will be included in the apk.
-#  resource_dir - The directory for resources.
-#  shared_resources - Make a resource package that can be loaded by a different
-#    application at runtime to access the package's resources.
-#  R_package - A custom Java package to generate the resource file R.java in.
-#    By default, the package given in AndroidManifest.xml will be used.
-#  include_all_resources - Set to 1 to include all resource IDs in all generated
-#    R.java files.
-#  use_chromium_linker - Enable the content dynamic linker that allows sharing the
-#    RELRO section of the native libraries between the different processes.
-#  load_library_from_zip - When using the dynamic linker, load the library
-#    directly out of the zip file.
-#  use_relocation_packer - Enable relocation packing. Relies on the chromium
-#    linker, so use_chromium_linker must also be enabled.
-#  enable_chromium_linker_tests - Enable the content dynamic linker test support
-#    code. This allows a test APK to inject a Linker.TestRunner instance at
-#    runtime. Should only be used by the chromium_linker_test_apk target!!
-#  never_lint - Set to 1 to not run lint on this target.
-#  java_in_dir_suffix - To override the /src suffix on java_in_dir.
-#  app_manifest_version_name - set the apps 'human readable' version number.
-#  app_manifest_version_code - set the apps version number.
-{
-  'variables': {
-    'tested_apk_obfuscated_jar_path%': '/',
-    'tested_apk_dex_path%': '/',
-    'additional_input_paths': [],
-    'create_density_splits%': 0,
-    'language_splits': [],
-    'input_jars_paths': [],
-    'library_dexed_jars_paths': [],
-    'additional_src_dirs': [],
-    'generated_src_dirs': [],
-    'app_manifest_version_name%': '<(android_app_version_name)',
-    'app_manifest_version_code%': '<(android_app_version_code)',
-    # aapt generates this proguard.txt.
-    'generated_proguard_file': '<(intermediate_dir)/proguard.txt',
-    'proguard_enabled%': 'false',
-    'proguard_flags_paths': ['<(generated_proguard_file)'],
-    'jar_name': 'chromium_apk_<(_target_name).jar',
-    'resource_dir%':'<(DEPTH)/build/android/ant/empty/res',
-    'R_package%':'',
-    'include_all_resources%': 0,
-    'additional_R_text_files': [],
-    'dependencies_res_zip_paths': [],
-    'additional_res_packages': [],
-    'additional_bundled_libs%': [],
-    'is_test_apk%': 0,
-    # Allow icu data, v8 snapshots, and pak files to be loaded directly from the .apk.
-    # Note: These are actually suffix matches, not necessarily extensions.
-    'extensions_to_not_compress%': '.dat,.bin,.pak',
-    'resource_input_paths': [],
-    'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)',
-    'asset_location%': '<(intermediate_dir)/assets',
-    'codegen_stamp': '<(intermediate_dir)/codegen.stamp',
-    'package_input_paths': [],
-    'ordered_libraries_file': '<(intermediate_dir)/native_libraries.json',
-    'additional_ordered_libraries_file': '<(intermediate_dir)/additional_native_libraries.json',
-    'native_libraries_template': '<(DEPTH)/base/android/java/templates/NativeLibraries.template',
-    'native_libraries_java_dir': '<(intermediate_dir)/native_libraries_java/',
-    'native_libraries_java_file': '<(native_libraries_java_dir)/NativeLibraries.java',
-    'native_libraries_java_stamp': '<(intermediate_dir)/native_libraries_java.stamp',
-    'native_libraries_template_data_dir': '<(intermediate_dir)/native_libraries/',
-    'native_libraries_template_data_file': '<(native_libraries_template_data_dir)/native_libraries_array.h',
-    'native_libraries_template_version_file': '<(native_libraries_template_data_dir)/native_libraries_version.h',
-    'compile_stamp': '<(intermediate_dir)/compile.stamp',
-    'lint_stamp': '<(intermediate_dir)/lint.stamp',
-    'lint_result': '<(intermediate_dir)/lint_result.xml',
-    'lint_config': '<(intermediate_dir)/lint_config.xml',
-    'never_lint%': 0,
-    'findbugs_stamp': '<(intermediate_dir)/findbugs.stamp',
-    'run_findbugs%': 0,
-    'java_in_dir_suffix%': '/src',
-    'instr_stamp': '<(intermediate_dir)/instr.stamp',
-    'jar_stamp': '<(intermediate_dir)/jar.stamp',
-    'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp',
-    'pack_relocations_stamp': '<(intermediate_dir)/pack_relocations.stamp',
-    'strip_stamp': '<(intermediate_dir)/strip.stamp',
-    'stripped_libraries_dir': '<(intermediate_dir)/stripped_libraries',
-    'strip_additional_stamp': '<(intermediate_dir)/strip_additional.stamp',
-    'version_stamp': '<(intermediate_dir)/version.stamp',
-    'javac_includes': [],
-    'jar_excluded_classes': [],
-    'javac_jar_path': '<(intermediate_dir)/<(_target_name).javac.jar',
-    'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)',
-    'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar',
-    'test_jar_path': '<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar',
-    'dex_path': '<(intermediate_dir)/classes.dex',
-    'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar',
-    'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml',
-    'split_android_manifest_path': '<(intermediate_dir)/split-manifests/<(android_app_abi)/AndroidManifest.xml',
-    'push_stamp': '<(intermediate_dir)/push.stamp',
-    'link_stamp': '<(intermediate_dir)/link.stamp',
-    'resource_zip_path': '<(intermediate_dir)/<(_target_name).resources.zip',
-    'shared_resources%': 0,
-    'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk',
-    'final_apk_path_no_extension%': '<(PRODUCT_DIR)/apks/<(apk_name)',
-    'final_abi_split_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name)-abi-<(android_app_abi).apk',
-    'incomplete_apk_path': '<(intermediate_dir)/<(apk_name)-incomplete.apk',
-    'apk_install_record': '<(intermediate_dir)/apk_install.record.stamp',
-    'device_intermediate_dir': '/data/data/org.chromium.gyp_managed_install/<(_target_name)/<(CONFIGURATION_NAME)',
-    'symlink_script_host_path': '<(intermediate_dir)/create_symlinks.sh',
-    'symlink_script_device_path': '<(device_intermediate_dir)/create_symlinks.sh',
-    'create_standalone_apk%': 1,
-    'res_v14_skip%': 0,
-    'variables': {
-      'variables': {
-        'native_lib_target%': '',
-        'native_lib_version_name%': '',
-        'use_chromium_linker%' : 0,
-        'use_relocation_packer%' : 0,
-        'enable_chromium_linker_tests%': 0,
-        'is_test_apk%': 0,
-        'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk',
-        'unsigned_abi_split_apk_path': '<(intermediate_dir)/<(apk_name)-abi-<(android_app_abi)-unsigned.apk',
-        'create_abi_split%': 0,
-      },
-      'unsigned_apk_path': '<(unsigned_apk_path)',
-      'unsigned_abi_split_apk_path': '<(unsigned_abi_split_apk_path)',
-      'create_abi_split%': '<(create_abi_split)',
-      'conditions': [
-        ['gyp_managed_install == 1 and native_lib_target != ""', {
-          'conditions': [
-            ['create_abi_split == 0', {
-              'unsigned_standalone_apk_path': '<(intermediate_dir)/<(apk_name)-standalone-unsigned.apk',
-            }, {
-              'unsigned_standalone_apk_path': '<(intermediate_dir)/<(apk_name)-abi-<(android_app_abi)-standalone-unsigned.apk',
-            }],
-          ],
-        }, {
-          'unsigned_standalone_apk_path': '<(unsigned_apk_path)',
-        }],
-        ['gyp_managed_install == 1', {
-          'apk_package_native_libs_dir': '<(intermediate_dir)/libs.managed',
-        }, {
-          'apk_package_native_libs_dir': '<(intermediate_dir)/libs',
-        }],
-        ['is_test_apk == 0 and emma_coverage != 0', {
-          'emma_instrument%': 1,
-        },{
-          'emma_instrument%': 0,
-        }],
-        # When using abi splits, the abi split is modified by
-        # gyp_managed_install rather than the main .apk
-        ['create_abi_split == 1', {
-          'managed_input_apk_path': '<(unsigned_abi_split_apk_path)',
-        }, {
-          'managed_input_apk_path': '<(unsigned_apk_path)',
-        }],
-      ],
-    },
-    'native_lib_target%': '',
-    'native_lib_version_name%': '',
-    'use_chromium_linker%' : 0,
-    'load_library_from_zip%' : 0,
-    'use_relocation_packer%' : 0,
-    'enable_chromium_linker_tests%': 0,
-    'emma_instrument%': '<(emma_instrument)',
-    'apk_package_native_libs_dir': '<(apk_package_native_libs_dir)',
-    'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)',
-    'unsigned_apk_path': '<(unsigned_apk_path)',
-    'unsigned_abi_split_apk_path': '<(unsigned_abi_split_apk_path)',
-    'create_abi_split%': '<(create_abi_split)',
-    'managed_input_apk_path': '<(managed_input_apk_path)',
-    'libchromium_android_linker': 'libchromium_android_linker.>(android_product_extension)',
-    'extra_native_libs': [],
-    'native_lib_placeholder_stamp': '<(apk_package_native_libs_dir)/<(android_app_abi)/native_lib_placeholder.stamp',
-    'native_lib_placeholders': [],
-    'main_apk_name': '<(apk_name)',
-    'enable_errorprone%': '0',
-    'errorprone_exe_path': '<(PRODUCT_DIR)/bin.java/chromium_errorprone',
-  },
-  # Pass the jar path to the apk's "fake" jar target.  This would be better as
-  # direct_dependent_settings, but a variable set by a direct_dependent_settings
-  # cannot be lifted in a dependent to all_dependent_settings.
-  'all_dependent_settings': {
-    'conditions': [
-      ['proguard_enabled == "true"', {
-        'variables': {
-          'proguard_enabled': 'true',
-        }
-      }],
-    ],
-    'variables': {
-      'apk_output_jar_path': '<(jar_path)',
-      'tested_apk_obfuscated_jar_path': '<(obfuscated_jar_path)',
-      'tested_apk_dex_path': '<(dex_path)',
-    },
-  },
-  'conditions': [
-    ['resource_dir!=""', {
-      'variables': {
-        'resource_input_paths': [ '<!@(find <(resource_dir) -name "*")' ]
-      },
-    }],
-    ['R_package != ""', {
-      'variables': {
-        # We generate R.java in package R_package (in addition to the package
-        # listed in the AndroidManifest.xml, which is unavoidable).
-        'additional_res_packages': ['<(R_package)'],
-        'additional_R_text_files': ['<(intermediate_dir)/R.txt'],
-      },
-    }],
-    ['native_lib_target != "" and component == "shared_library"', {
-      'dependencies': [
-        '<(DEPTH)/build/android/setup.gyp:copy_system_libraries',
-      ],
-    }],
-    ['use_chromium_linker == 1', {
-      'dependencies': [
-        '<(DEPTH)/base/base.gyp:chromium_android_linker',
-      ],
-    }],
-    ['enable_errorprone == 1', {
-      'dependencies': [
-        '<(DEPTH)/third_party/errorprone/errorprone.gyp:chromium_errorprone',
-      ],
-    }],
-    ['native_lib_target != ""', {
-      'variables': {
-        'conditions': [
-          ['use_chromium_linker == 1', {
-            'variables': {
-              'chromium_linker_path': [
-                '<(SHARED_LIB_DIR)/<(libchromium_android_linker)',
-              ],
-            }
-          }, {
-            'variables': {
-              'chromium_linker_path': [],
-            },
-          }],
-        ],
-        'generated_src_dirs': [ '<(native_libraries_java_dir)' ],
-        'native_libs_paths': [
-          '<(SHARED_LIB_DIR)/<(native_lib_target).>(android_product_extension)',
-          '<@(chromium_linker_path)'
-        ],
-        'package_input_paths': [
-          '<(apk_package_native_libs_dir)/<(android_app_abi)/gdbserver',
-        ],
-      },
-      'copies': [
-        {
-          # gdbserver is always copied into the APK's native libs dir. The ant
-          # build scripts (apkbuilder task) will only include it in a debug
-          # build.
-          'destination': '<(apk_package_native_libs_dir)/<(android_app_abi)',
-          'files': [
-            '<(android_gdbserver)',
-          ],
-        },
-      ],
-      'actions': [
-        {
-          'variables': {
-            'input_libraries': [
-              '<@(native_libs_paths)',
-              '<@(extra_native_libs)',
-            ],
-          },
-          'includes': ['../build/android/write_ordered_libraries.gypi'],
-        },
-        {
-          'action_name': 'native_libraries_<(_target_name)',
-          'variables': {
-            'conditions': [
-              ['use_chromium_linker == 1', {
-                'variables': {
-                  'linker_gcc_preprocess_defines': [
-                    '--defines', 'ENABLE_CHROMIUM_LINKER',
-                  ],
-                }
-              }, {
-                'variables': {
-                  'linker_gcc_preprocess_defines': [],
-                },
-              }],
-              ['load_library_from_zip == 1', {
-                'variables': {
-                  'linker_load_from_zip_file_preprocess_defines': [
-                    '--defines', 'ENABLE_CHROMIUM_LINKER_LIBRARY_IN_ZIP_FILE',
-                  ],
-                }
-              }, {
-                'variables': {
-                  'linker_load_from_zip_file_preprocess_defines': [],
-                },
-              }],
-              ['enable_chromium_linker_tests == 1', {
-                'variables': {
-                  'linker_tests_gcc_preprocess_defines': [
-                    '--defines', 'ENABLE_CHROMIUM_LINKER_TESTS',
-                  ],
-                }
-              }, {
-                'variables': {
-                  'linker_tests_gcc_preprocess_defines': [],
-                },
-              }],
-            ],
-            'gcc_preprocess_defines': [
-              '<@(linker_load_from_zip_file_preprocess_defines)',
-              '<@(linker_gcc_preprocess_defines)',
-              '<@(linker_tests_gcc_preprocess_defines)',
-            ],
-          },
-          'message': 'Creating NativeLibraries.java for <(_target_name)',
-          'inputs': [
-            '<(DEPTH)/build/android/gyp/util/build_utils.py',
-            '<(DEPTH)/build/android/gyp/gcc_preprocess.py',
-            '<(ordered_libraries_file)',
-            '<(native_libraries_template)',
-          ],
-          'outputs': [
-            '<(native_libraries_java_stamp)',
-          ],
-          'action': [
-            'python', '<(DEPTH)/build/android/gyp/gcc_preprocess.py',
-            '--include-path=',
-            '--output=<(native_libraries_java_file)',
-            '--template=<(native_libraries_template)',
-            '--stamp=<(native_libraries_java_stamp)',
-            '--defines', 'NATIVE_LIBRARIES_LIST=@FileArg(<(ordered_libraries_file):java_libraries_list)',
-            '--defines', 'NATIVE_LIBRARIES_VERSION_NUMBER="<(native_lib_version_name)"',
-            '<@(gcc_preprocess_defines)',
-          ],
-        },
-        {
-          'action_name': 'strip_native_libraries',
-          'variables': {
-            'ordered_libraries_file%': '<(ordered_libraries_file)',
-            'stripped_libraries_dir%': '<(stripped_libraries_dir)',
-            'input_paths': [
-              '<@(native_libs_paths)',
-              '<@(extra_native_libs)',
-            ],
-            'stamp': '<(strip_stamp)'
-          },
-          'includes': ['../build/android/strip_native_libraries.gypi'],
-        },
-        {
-          'action_name': 'insert_chromium_version',
-          'variables': {
-            'ordered_libraries_file%': '<(ordered_libraries_file)',
-            'stripped_libraries_dir%': '<(stripped_libraries_dir)',
-            'version_string': '<(native_lib_version_name)',
-            'input_paths': [
-              '<(strip_stamp)',
-            ],
-            'stamp': '<(version_stamp)'
-          },
-          'includes': ['../build/android/insert_chromium_version.gypi'],
-        },
-        {
-          'action_name': 'pack_relocations',
-          'variables': {
-            'conditions': [
-              ['use_chromium_linker == 1 and use_relocation_packer == 1 and profiling != 1', {
-                'enable_packing': 1,
-              }, {
-                'enable_packing': 0,
-              }],
-            ],
-            'exclude_packing_list': [
-              '<(libchromium_android_linker)',
-            ],
-            'ordered_libraries_file%': '<(ordered_libraries_file)',
-            'stripped_libraries_dir%': '<(stripped_libraries_dir)',
-            'packed_libraries_dir': '<(libraries_source_dir)',
-            'input_paths': [
-              '<(version_stamp)'
-            ],
-            'stamp': '<(pack_relocations_stamp)',
-          },
-          'includes': ['../build/android/pack_relocations.gypi'],
-        },
-        {
-          'variables': {
-            'input_libraries': [
-              '<@(additional_bundled_libs)',
-            ],
-            'ordered_libraries_file': '<(additional_ordered_libraries_file)',
-            'subtarget': '_additional_libraries',
-          },
-          'includes': ['../build/android/write_ordered_libraries.gypi'],
-        },
-        {
-          'action_name': 'strip_additional_libraries',
-          'variables': {
-            'ordered_libraries_file': '<(additional_ordered_libraries_file)',
-            'stripped_libraries_dir': '<(libraries_source_dir)',
-            'input_paths': [
-              '<@(additional_bundled_libs)',
-              '<(strip_stamp)',
-            ],
-            'stamp': '<(strip_additional_stamp)'
-          },
-          'includes': ['../build/android/strip_native_libraries.gypi'],
-        },
-        {
-          'action_name': 'Create native lib placeholder files for previous releases',
-          'variables': {
-            'placeholders': ['<@(native_lib_placeholders)'],
-            'conditions': [
-              ['gyp_managed_install == 1', {
-                # This "library" just needs to be put in the .apk. It is not loaded
-                # at runtime.
-                'placeholders': ['libfix.crbug.384638.so'],
-              }]
-            ],
-          },
-          'inputs': [
-            '<(DEPTH)/build/android/gyp/create_placeholder_files.py',
-          ],
-          'outputs': [
-            '<(native_lib_placeholder_stamp)',
-          ],
-          'action': [
-            'python', '<(DEPTH)/build/android/gyp/create_placeholder_files.py',
-            '--dest-lib-dir=<(apk_package_native_libs_dir)/<(android_app_abi)/',
-            '--stamp=<(native_lib_placeholder_stamp)',
-            '<@(placeholders)',
-          ],
-        },
-      ],
-      'conditions': [
-        ['gyp_managed_install == 1', {
-          'variables': {
-            'libraries_top_dir': '<(intermediate_dir)/lib.stripped',
-            'libraries_source_dir': '<(libraries_top_dir)/lib/<(android_app_abi)',
-            'device_library_dir': '<(device_intermediate_dir)/lib.stripped',
-            'configuration_name': '<(CONFIGURATION_NAME)',
-          },
-          'dependencies': [
-            '<(DEPTH)/build/android/setup.gyp:get_build_device_configurations',
-            '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_commands',
-          ],
-          'actions': [
-            {
-              'includes': ['../build/android/push_libraries.gypi'],
-            },
-            {
-              'action_name': 'create device library symlinks',
-              'message': 'Creating links on device for <(_target_name)',
-              'inputs': [
-                '<(DEPTH)/build/android/gyp/util/build_utils.py',
-                '<(DEPTH)/build/android/gyp/create_device_library_links.py',
-                '<(apk_install_record)',
-                '<(build_device_config_path)',
-                '<(ordered_libraries_file)',
-              ],
-              'outputs': [
-                '<(link_stamp)'
-              ],
-              'action': [
-                'python', '<(DEPTH)/build/android/gyp/create_device_library_links.py',
-                '--build-device-configuration=<(build_device_config_path)',
-                '--libraries=@FileArg(<(ordered_libraries_file):libraries)',
-                '--script-host-path=<(symlink_script_host_path)',
-                '--script-device-path=<(symlink_script_device_path)',
-                '--target-dir=<(device_library_dir)',
-                '--apk=<(incomplete_apk_path)',
-                '--stamp=<(link_stamp)',
-                '--configuration-name=<(CONFIGURATION_NAME)',
-              ],
-            },
-          ],
-          'conditions': [
-            ['create_standalone_apk == 1', {
-              'actions': [
-                {
-                  'action_name': 'create standalone APK',
-                  'variables': {
-                    'inputs': [
-                      '<(ordered_libraries_file)',
-                      '<(strip_additional_stamp)',
-                      '<(pack_relocations_stamp)',
-                    ],
-                    'output_apk_path': '<(unsigned_standalone_apk_path)',
-                    'libraries_top_dir%': '<(libraries_top_dir)',
-                    'input_apk_path': '<(managed_input_apk_path)',
-                  },
-                  'includes': [ 'android/create_standalone_apk_action.gypi' ],
-                },
-              ],
-            }],
-          ],
-        }, {
-          # gyp_managed_install != 1
-          'variables': {
-            'libraries_source_dir': '<(apk_package_native_libs_dir)/<(android_app_abi)',
-            'package_input_paths': [
-              '<(strip_additional_stamp)',
-              '<(pack_relocations_stamp)',
-            ],
-          },
-        }],
-      ],
-    }], # native_lib_target != ''
-    ['gyp_managed_install == 0 or create_standalone_apk == 1 or create_abi_split == 1', {
-      'dependencies': [
-        '<(DEPTH)/build/android/rezip.gyp:rezip_apk_jar',
-      ],
-    }],
-    ['create_abi_split == 1 or gyp_managed_install == 0 or create_standalone_apk == 1', {
-      'actions': [
-        {
-          'action_name': 'finalize_base',
-          'variables': {
-            'output_apk_path': '<(final_apk_path)',
-            'conditions': [
-              ['create_abi_split == 0', {
-                'input_apk_path': '<(unsigned_standalone_apk_path)',
-              }, {
-                'input_apk_path': '<(unsigned_apk_path)',
-                'load_library_from_zip': 0,
-              }]
-            ],
-          },
-          'includes': [ 'android/finalize_apk_action.gypi']
-        },
-      ],
-    }],
-    ['create_abi_split == 1', {
-      'actions': [
-        {
-          'action_name': 'generate_split_manifest_<(_target_name)',
-          'inputs': [
-            '<(DEPTH)/build/android/gyp/util/build_utils.py',
-            '<(DEPTH)/build/android/gyp/generate_split_manifest.py',
-            '<(android_manifest_path)',
-          ],
-          'outputs': [
-            '<(split_android_manifest_path)',
-          ],
-          'action': [
-            'python', '<(DEPTH)/build/android/gyp/generate_split_manifest.py',
-            '--main-manifest', '<(android_manifest_path)',
-            '--out-manifest', '<(split_android_manifest_path)',
-            '--split', 'abi_<(android_app_abi)',
-          ],
-        },
-        {
-          'variables': {
-            'apk_name': '<(main_apk_name)-abi-<(android_app_abi)',
-            'asset_location': '',
-            'android_manifest_path': '<(split_android_manifest_path)',
-            'create_density_splits': 0,
-            'language_splits=': [],
-          },
-          'includes': [ 'android/package_resources_action.gypi' ],
-        },
-        {
-          'variables': {
-            'apk_name': '<(main_apk_name)-abi-<(android_app_abi)',
-            'apk_path': '<(unsigned_abi_split_apk_path)',
-            'has_code': 0,
-            'native_libs_dir': '<(apk_package_native_libs_dir)',
-            'extra_inputs': ['<(native_lib_placeholder_stamp)'],
-          },
-          'includes': ['android/apkbuilder_action.gypi'],
-        },
-      ],
-    }],
-    ['create_abi_split == 1 and (gyp_managed_install == 0 or create_standalone_apk == 1)', {
-      'actions': [
-        {
-          'action_name': 'finalize_split',
-          'variables': {
-            'output_apk_path': '<(final_abi_split_apk_path)',
-            'conditions': [
-              ['gyp_managed_install == 1', {
-                'input_apk_path': '<(unsigned_standalone_apk_path)',
-              }, {
-                'input_apk_path': '<(unsigned_abi_split_apk_path)',
-              }],
-            ],
-          },
-          'includes': [ 'android/finalize_apk_action.gypi']
-        },
-      ],
-    }],
-    ['gyp_managed_install == 1', {
-      'actions': [
-        {
-          'action_name': 'finalize incomplete apk',
-          'variables': {
-            'load_library_from_zip': 0,
-            'input_apk_path': '<(managed_input_apk_path)',
-            'output_apk_path': '<(incomplete_apk_path)',
-          },
-          'includes': [ 'android/finalize_apk_action.gypi']
-        },
-        {
-          'action_name': 'apk_install_<(_target_name)',
-          'message': 'Installing <(apk_name).apk',
-          'inputs': [
-            '<(DEPTH)/build/android/gyp/util/build_utils.py',
-            '<(DEPTH)/build/android/gyp/apk_install.py',
-            '<(build_device_config_path)',
-            '<(incomplete_apk_path)',
-          ],
-          'outputs': [
-            '<(apk_install_record)',
-          ],
-          'action': [
-            'python', '<(DEPTH)/build/android/gyp/apk_install.py',
-            '--build-device-configuration=<(build_device_config_path)',
-            '--install-record=<(apk_install_record)',
-            '--configuration-name=<(CONFIGURATION_NAME)',
-            '--android-sdk-tools', '<(android_sdk_tools)',
-          ],
-          'conditions': [
-            ['create_abi_split == 1', {
-              'inputs': [
-                '<(final_apk_path)',
-              ],
-              'action': [
-                '--apk-path=<(final_apk_path)',
-                '--split-apk-path=<(incomplete_apk_path)',
-              ],
-            }, {
-              'action': [
-                '--apk-path=<(incomplete_apk_path)',
-              ],
-            }],
-            ['create_density_splits == 1', {
-              'inputs': [
-                '<(final_apk_path_no_extension)-density-hdpi.apk',
-                '<(final_apk_path_no_extension)-density-xhdpi.apk',
-                '<(final_apk_path_no_extension)-density-xxhdpi.apk',
-                '<(final_apk_path_no_extension)-density-xxxhdpi.apk',
-                '<(final_apk_path_no_extension)-density-tvdpi.apk',
-              ],
-              'action': [
-                '--split-apk-path=<(final_apk_path_no_extension)-density-hdpi.apk',
-                '--split-apk-path=<(final_apk_path_no_extension)-density-xhdpi.apk',
-                '--split-apk-path=<(final_apk_path_no_extension)-density-xxhdpi.apk',
-                '--split-apk-path=<(final_apk_path_no_extension)-density-xxxhdpi.apk',
-                '--split-apk-path=<(final_apk_path_no_extension)-density-tvdpi.apk',
-              ],
-            }],
-            ['language_splits != []', {
-              'inputs': [
-                "<!@(python <(DEPTH)/build/apply_locales.py '<(final_apk_path_no_extension)-lang-ZZLOCALE.apk' <(language_splits))",
-              ],
-              'action': [
-                "<!@(python <(DEPTH)/build/apply_locales.py -- '--split-apk-path=<(final_apk_path_no_extension)-lang-ZZLOCALE.apk' <(language_splits))",
-              ],
-            }],
-          ],
-        },
-      ],
-    }],
-    ['create_density_splits == 1', {
-      'actions': [
-        {
-          'action_name': 'finalize_density_splits',
-          'variables': {
-            'density_splits': 1,
-          },
-          'includes': [ 'android/finalize_splits_action.gypi']
-        },
-      ],
-    }],
-    ['is_test_apk == 1', {
-      'dependencies': [
-        '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_commands',
-        '<(DEPTH)/tools/android/android_tools.gyp:android_tools',
-      ]
-    }],
-    ['run_findbugs == 1', {
-      'actions': [
-        {
-          'action_name': 'findbugs_<(_target_name)',
-          'message': 'Running findbugs on <(_target_name)',
-          'inputs': [
-            '<(DEPTH)/build/android/findbugs_diff.py',
-            '<(DEPTH)/build/android/findbugs_filter/findbugs_exclude.xml',
-            '<(DEPTH)/build/android/pylib/utils/findbugs.py',
-            '>@(input_jars_paths)',
-            '<(jar_path)',
-            '<(compile_stamp)',
-          ],
-          'outputs': [
-            '<(findbugs_stamp)',
-          ],
-          'action': [
-            'python', '<(DEPTH)/build/android/findbugs_diff.py',
-            '--auxclasspath-gyp', '>(input_jars_paths)',
-            '--stamp', '<(findbugs_stamp)',
-            '<(jar_path)',
-          ],
-        },
-      ],
-    },
-    ]
-  ],
-  'dependencies': [
-    '<(DEPTH)/tools/android/md5sum/md5sum.gyp:md5sum',
-  ],
-  'actions': [
-    {
-      'action_name': 'process_resources',
-      'message': 'processing resources for <(_target_name)',
-      'variables': {
-        # Write the inputs list to a file, so that its mtime is updated when
-        # the list of inputs changes.
-        'inputs_list_file': '>|(apk_codegen.<(_target_name).gypcmd >@(additional_input_paths) >@(resource_input_paths))',
-        'process_resources_options': [],
-        'conditions': [
-          ['is_test_apk == 1', {
-            'dependencies_res_zip_paths=': [],
-            'additional_res_packages=': [],
-          }],
-          ['res_v14_skip == 1', {
-            'process_resources_options+': ['--v14-skip']
-          }],
-          ['shared_resources == 1', {
-            'process_resources_options+': ['--shared-resources']
-          }],
-          ['R_package != ""', {
-            'process_resources_options+': ['--custom-package', '<(R_package)']
-          }],
-          ['include_all_resources == 1', {
-            'process_resources_options+': ['--include-all-resources']
-          }]
-        ],
-      },
-      'inputs': [
-        '<(DEPTH)/build/android/gyp/util/build_utils.py',
-        '<(DEPTH)/build/android/gyp/process_resources.py',
-        '<(android_manifest_path)',
-        '>@(additional_input_paths)',
-        '>@(resource_input_paths)',
-        '>@(dependencies_res_zip_paths)',
-        '>(inputs_list_file)',
-      ],
-      'outputs': [
-        '<(resource_zip_path)',
-        '<(generated_proguard_file)',
-        '<(codegen_stamp)',
-      ],
-      'action': [
-        'python', '<(DEPTH)/build/android/gyp/process_resources.py',
-        '--android-sdk', '<(android_sdk)',
-        '--aapt-path', '<(android_aapt_path)',
-
-        '--android-manifest', '<(android_manifest_path)',
-        '--dependencies-res-zips', '>(dependencies_res_zip_paths)',
-
-        '--extra-res-packages', '>(additional_res_packages)',
-        '--extra-r-text-files', '>(additional_R_text_files)',
-
-        '--proguard-file', '<(generated_proguard_file)',
-
-        '--resource-dirs', '<(resource_dir)',
-        '--resource-zip-out', '<(resource_zip_path)',
-
-        '--R-dir', '<(intermediate_dir)/gen',
-
-        '--stamp', '<(codegen_stamp)',
-
-        '<@(process_resources_options)',
-      ],
-    },
-    {
-      'action_name': 'javac_<(_target_name)',
-      'message': 'Compiling java for <(_target_name)',
-      'variables': {
-        'extra_args': [],
-        'extra_inputs': [],
-        'gen_src_dirs': [
-          '<(intermediate_dir)/gen',
-          '>@(generated_src_dirs)',
-        ],
-        # If there is a separate find for additional_src_dirs, it will find the
-        # wrong .java files when additional_src_dirs is empty.
-        # TODO(thakis): Gyp caches >! evaluation by command. Both java.gypi and
-        # java_apk.gypi evaluate the same command, and at the moment two targets
-        # set java_in_dir to "java". Add a dummy comment here to make sure
-        # that the two targets (one uses java.gypi, the other java_apk.gypi)
-        # get distinct source lists. Medium-term, make targets list all their
-        # Java files instead of using find. (As is, this will be broken if two
-        # targets use the same java_in_dir and both use java_apk.gypi or
-        # both use java.gypi.)
-        'java_sources': ['>!@(find >(java_in_dir)>(java_in_dir_suffix) >(additional_src_dirs) -name "*.java"  # apk)'],
-        'conditions': [
-          ['enable_errorprone == 1', {
-            'extra_inputs': [
-              '<(errorprone_exe_path)',
-            ],
-            'extra_args': [ '--use-errorprone-path=<(errorprone_exe_path)' ],
-          }],
-        ],
-      },
-      'inputs': [
-        '<(DEPTH)/build/android/gyp/util/build_utils.py',
-        '<(DEPTH)/build/android/gyp/javac.py',
-        '>@(java_sources)',
-        '>@(input_jars_paths)',
-        '<(codegen_stamp)',
-        '<@(extra_inputs)',
-      ],
-      'conditions': [
-        ['native_lib_target != ""', {
-          'inputs': [ '<(native_libraries_java_stamp)' ],
-        }],
-      ],
-      'outputs': [
-        '<(compile_stamp)',
-        '<(javac_jar_path)',
-      ],
-      'action': [
-        'python', '<(DEPTH)/build/android/gyp/javac.py',
-        '--bootclasspath=<(android_sdk_jar)',
-        '--classpath=>(input_jars_paths) <(android_sdk_jar)',
-        '--src-gendirs=>(gen_src_dirs)',
-        '--javac-includes=<(javac_includes)',
-        '--chromium-code=<(chromium_code)',
-        '--jar-path=<(javac_jar_path)',
-        '--jar-excluded-classes=<(jar_excluded_classes)',
-        '--stamp=<(compile_stamp)',
-        '<@(extra_args)',
-        '>@(java_sources)',
-      ],
-    },
-    {
-      'action_name': 'instr_jar_<(_target_name)',
-      'message': 'Instrumenting <(_target_name) jar',
-      'variables': {
-        'input_path': '<(javac_jar_path)',
-        'output_path': '<(jar_path)',
-        'stamp_path': '<(instr_stamp)',
-        'instr_type': 'jar',
-      },
-      'outputs': [
-        '<(instr_stamp)',
-        '<(jar_path)',
-      ],
-      'inputs': [
-        '<(javac_jar_path)',
-      ],
-      'includes': [ 'android/instr_action.gypi' ],
-    },
-    {
-      'variables': {
-        'src_dirs': [
-          '<(java_in_dir)<(java_in_dir_suffix)',
-          '>@(additional_src_dirs)',
-        ],
-        'lint_jar_path': '<(jar_path)',
-        'stamp_path': '<(lint_stamp)',
-        'result_path': '<(lint_result)',
-        'config_path': '<(lint_config)',
-      },
-      'outputs': [
-        '<(lint_stamp)',
-      ],
-      'includes': [ 'android/lint_action.gypi' ],
-    },
-    {
-      'action_name': 'obfuscate_<(_target_name)',
-      'message': 'Obfuscating <(_target_name)',
-      'variables': {
-        'additional_obfuscate_options': [],
-        'additional_obfuscate_input_paths': [],
-        'proguard_out_dir': '<(intermediate_dir)/proguard',
-        'proguard_input_jar_paths': [
-          '>@(input_jars_paths)',
-          '<(jar_path)',
-        ],
-        'target_conditions': [
-          ['is_test_apk == 1', {
-            'additional_obfuscate_options': [
-              '--testapp',
-            ],
-          }],
-          ['is_test_apk == 1 and tested_apk_obfuscated_jar_path != "/"', {
-            'additional_obfuscate_options': [
-              '--tested-apk-obfuscated-jar-path', '>(tested_apk_obfuscated_jar_path)',
-            ],
-            'additional_obfuscate_input_paths': [
-              '>(tested_apk_obfuscated_jar_path).info',
-            ],
-          }],
-          ['proguard_enabled == "true"', {
-            'additional_obfuscate_options': [
-              '--proguard-enabled',
-            ],
-          }],
-        ],
-        'obfuscate_input_jars_paths': [
-          '>@(input_jars_paths)',
-          '<(jar_path)',
-        ],
-      },
-      'conditions': [
-        ['is_test_apk == 1', {
-          'outputs': [
-            '<(test_jar_path)',
-          ],
-        }],
-      ],
-      'inputs': [
-        '<(DEPTH)/build/android/gyp/apk_obfuscate.py',
-        '<(DEPTH)/build/android/gyp/util/build_utils.py',
-        '>@(proguard_flags_paths)',
-        '>@(obfuscate_input_jars_paths)',
-        '>@(additional_obfuscate_input_paths)',
-        '<(instr_stamp)',
-      ],
-      'outputs': [
-        '<(obfuscate_stamp)',
-
-        # In non-Release builds, these paths will all be empty files.
-        '<(obfuscated_jar_path)',
-        '<(obfuscated_jar_path).info',
-        '<(obfuscated_jar_path).dump',
-        '<(obfuscated_jar_path).seeds',
-        '<(obfuscated_jar_path).mapping',
-        '<(obfuscated_jar_path).usage',
-      ],
-      'action': [
-        'python', '<(DEPTH)/build/android/gyp/apk_obfuscate.py',
-
-        '--configuration-name', '<(CONFIGURATION_NAME)',
-
-        '--android-sdk', '<(android_sdk)',
-        '--android-sdk-tools', '<(android_sdk_tools)',
-        '--android-sdk-jar', '<(android_sdk_jar)',
-
-        '--input-jars-paths=>(proguard_input_jar_paths)',
-        '--proguard-configs=>(proguard_flags_paths)',
-
-        '--test-jar-path', '<(test_jar_path)',
-        '--obfuscated-jar-path', '<(obfuscated_jar_path)',
-
-        '--proguard-jar-path', '<(android_sdk_root)/tools/proguard/lib/proguard.jar',
-
-        '--stamp', '<(obfuscate_stamp)',
-
-        '>@(additional_obfuscate_options)',
-      ],
-    },
-    {
-      'action_name': 'dex_<(_target_name)',
-      'variables': {
-        'dex_input_paths': [
-          '>@(library_dexed_jars_paths)',
-          '<(jar_path)',
-        ],
-        'output_path': '<(dex_path)',
-        'proguard_enabled_input_path': '<(obfuscated_jar_path)',
-      },
-      'target_conditions': [
-        ['emma_instrument != 0', {
-          'variables': {
-            'dex_no_locals': 1,
-            'dex_input_paths': [
-              '<(emma_device_jar)'
-            ],
-          },
-        }],
-        ['is_test_apk == 1 and tested_apk_dex_path != "/"', {
-          'variables': {
-            'dex_additional_options': [
-              '--excluded-paths', '@FileArg(>(tested_apk_dex_path).inputs)'
-            ],
-          },
-          'inputs': [
-            '>(tested_apk_dex_path).inputs',
-          ],
-        }],
-        ['proguard_enabled == "true"', {
-          'inputs': [ '<(obfuscate_stamp)' ]
-        }, {
-          'inputs': [ '<(instr_stamp)' ]
-        }],
-      ],
-      'includes': [ 'android/dex_action.gypi' ],
-    },
-    {
-      'variables': {
-        'extra_inputs': ['<(codegen_stamp)'],
-        'resource_zips': [
-          '<(resource_zip_path)',
-        ],
-        'conditions': [
-          ['is_test_apk == 0', {
-            'resource_zips': [
-              '>@(dependencies_res_zip_paths)',
-            ],
-          }],
-        ],
-      },
-      'includes': [ 'android/package_resources_action.gypi' ],
-    },
-    {
-      'variables': {
-        'apk_path': '<(unsigned_apk_path)',
-        'conditions': [
-          ['native_lib_target != ""', {
-            'extra_inputs': ['<(native_lib_placeholder_stamp)'],
-          }],
-          ['create_abi_split == 0', {
-            'native_libs_dir': '<(apk_package_native_libs_dir)',
-          }, {
-            'native_libs_dir': '<(DEPTH)/build/android/ant/empty/res',
-          }],
-        ],
-      },
-      'includes': ['android/apkbuilder_action.gypi'],
-    },
-  ],
-}
diff --git a/build/java_prebuilt.gypi b/build/java_prebuilt.gypi
deleted file mode 100644
index 8efc4ef..0000000
--- a/build/java_prebuilt.gypi
+++ /dev/null
@@ -1,102 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into a target to provide a rule
-# to package prebuilt Java JARs in a consistent manner.
-#
-# To use this, create a gyp target with the following form:
-# {
-#   'target_name': 'my-package_java',
-#   'type': 'none',
-#   'variables': {
-#     'jar_path': 'path/to/your.jar',
-#   },
-#   'includes': ['path/to/this/gypi/file'],
-# }
-#
-# Required variables:
-#  jar_path - The path to the prebuilt Java JAR file.
-
-{
-  'dependencies': [
-    '<(DEPTH)/build/android/setup.gyp:build_output_dirs'
-  ],
-  'variables': {
-    'dex_path': '<(PRODUCT_DIR)/lib.java/<(_target_name).dex.jar',
-    'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)',
-    'android_jar': '<(android_sdk)/android.jar',
-    'input_jars_paths': [ '<(android_jar)' ],
-    'neverlink%': 0,
-    'proguard_config%': '',
-    'proguard_preprocess%': '0',
-    'variables': {
-      'variables': {
-        'proguard_preprocess%': 0,
-      },
-      'conditions': [
-        ['proguard_preprocess == 1', {
-          'dex_input_jar_path': '<(intermediate_dir)/<(_target_name).pre.jar'
-        }, {
-          'dex_input_jar_path': '<(jar_path)'
-        }],
-      ],
-    },
-    'dex_input_jar_path': '<(dex_input_jar_path)',
-  },
-  'all_dependent_settings': {
-    'variables': {
-      'input_jars_paths': ['<(dex_input_jar_path)'],
-      'conditions': [
-        ['neverlink == 1', {
-          'library_dexed_jars_paths': [],
-        }, {
-          'library_dexed_jars_paths': ['<(dex_path)'],
-        }],
-      ],
-    },
-  },
-  'conditions' : [
-    ['proguard_preprocess == 1', {
-      'actions': [
-        {
-          'action_name': 'proguard_<(_target_name)',
-          'message': 'Proguard preprocessing <(_target_name) jar',
-          'inputs': [
-            '<(android_sdk_root)/tools/proguard/lib/proguard.jar',
-            '<(DEPTH)/build/android/gyp/util/build_utils.py',
-            '<(DEPTH)/build/android/gyp/proguard.py',
-            '<(jar_path)',
-            '<(proguard_config)',
-          ],
-          'outputs': [
-            '<(dex_input_jar_path)',
-          ],
-          'action': [
-            'python', '<(DEPTH)/build/android/gyp/proguard.py',
-            '--proguard-path=<(android_sdk_root)/tools/proguard/lib/proguard.jar',
-            '--input-path=<(jar_path)',
-            '--output-path=<(dex_input_jar_path)',
-            '--proguard-config=<(proguard_config)',
-            '--classpath=>(input_jars_paths)',
-          ]
-        },
-      ],
-    }],
-    ['neverlink == 0', {
-      'actions': [
-        {
-          'action_name': 'dex_<(_target_name)',
-          'message': 'Dexing <(_target_name) jar',
-          'variables': {
-            'dex_input_paths': [
-              '<(dex_input_jar_path)',
-            ],
-            'output_path': '<(dex_path)',
-          },
-          'includes': [ 'android/dex_action.gypi' ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/build/java_strings_grd.gypi b/build/java_strings_grd.gypi
deleted file mode 100644
index 7534be5..0000000
--- a/build/java_strings_grd.gypi
+++ /dev/null
@@ -1,62 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into a target to provide a rule
-# to generate localized strings.xml from a grd file.
-#
-# To use this, create a gyp target with the following form:
-# {
-#   'target_name': 'my-package_strings_grd',
-#   'type': 'none',
-#   'variables': {
-#     'grd_file': 'path/to/grd/file',
-#   },
-#   'includes': ['path/to/this/gypi/file'],
-# }
-#
-# Required variables:
-#  grd_file - The path to the grd file to use.
-{
-  'variables': {
-    'res_grit_dir': '<(INTERMEDIATE_DIR)/<(_target_name)/res_grit',
-    'grit_grd_file': '<(grd_file)',
-    'resource_zip_path': '<(PRODUCT_DIR)/res.java/<(_target_name).zip',
-    'grit_additional_defines': ['-E', 'ANDROID_JAVA_TAGGED_ONLY=false'],
-    'grit_out_dir': '<(res_grit_dir)',
-    # resource_ids is unneeded since we don't generate .h headers.
-    'grit_resource_ids': '',
-    'grit_outputs': [
-      '<!@pymod_do_main(grit_info <@(grit_defines) <@(grit_additional_defines) '
-          '--outputs \'<(grit_out_dir)\' '
-          '<(grit_grd_file) -f "<(grit_resource_ids)")',
-          ]
-  },
-  'all_dependent_settings': {
-    'variables': {
-      'additional_input_paths': ['<(resource_zip_path)'],
-      'dependencies_res_zip_paths': ['<(resource_zip_path)'],
-    },
-  },
-  'actions': [
-    {
-      'action_name': 'generate_localized_strings_xml',
-      'includes': ['../build/grit_action.gypi'],
-    },
-    {
-      'action_name': 'create_resources_zip',
-      'inputs': [
-          '<(DEPTH)/build/android/gyp/zip.py',
-          '<@(grit_outputs)',
-      ],
-      'outputs': [
-          '<(resource_zip_path)',
-      ],
-      'action': [
-          'python', '<(DEPTH)/build/android/gyp/zip.py',
-          '--input-dir', '<(res_grit_dir)',
-          '--output', '<(resource_zip_path)',
-      ],
-    }
-  ],
-}
diff --git a/build/jni_generator.gypi b/build/jni_generator.gypi
deleted file mode 100644
index 7a9e333..0000000
--- a/build/jni_generator.gypi
+++ /dev/null
@@ -1,87 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into a target to provide a rule
-# to generate jni bindings for Java-files in a consistent manner.
-#
-# To use this, create a gyp target with the following form:
-#  {
-#    'target_name': 'base_jni_headers',
-#    'type': 'none',
-#    'sources': [
-#      'android/java/src/org/chromium/base/BuildInfo.java',
-#      ...
-#      ...
-#      'android/java/src/org/chromium/base/SystemMessageHandler.java',
-#    ],
-#    'variables': {
-#      'jni_gen_package': 'base',
-#    },
-#    'includes': [ '../build/jni_generator.gypi' ],
-#  },
-#
-# The generated file name pattern can be seen on the "outputs" section below.
-# (note that RULE_INPUT_ROOT is the basename for the java file).
-#
-# See base/android/jni_generator/jni_generator.py for more info about the
-# format of generating JNI bindings.
-
-{
-  'variables': {
-    'jni_generator': '<(DEPTH)/base/android/jni_generator/jni_generator.py',
-    'jni_generator_jarjar_file%': '',
-    'jni_generator_ptr_type%': 'long',
-    # A comma separated string of include files.
-    'jni_generator_includes%': (
-        'base/android/jni_generator/jni_generator_helper.h'
-    ),
-    'native_exports%': '--native_exports_optional',
-  },
-  'rules': [
-    {
-      'rule_name': 'generate_jni_headers',
-      'extension': 'java',
-      'inputs': [
-        '<(jni_generator)',
-      ],
-      'outputs': [
-        '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)/jni/<(RULE_INPUT_ROOT)_jni.h',
-      ],
-      'action': [
-        '<(jni_generator)',
-        '--input_file',
-        '<(RULE_INPUT_PATH)',
-        '--output_dir',
-        '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)/jni',
-        '--includes',
-        '<(jni_generator_includes)',
-        '--optimize_generation',
-        '<(optimize_jni_generation)',
-        '--jarjar',
-        '<(jni_generator_jarjar_file)',
-        '--ptr_type',
-        '<(jni_generator_ptr_type)',
-        '<(native_exports)',
-      ],
-      'message': 'Generating JNI bindings from <(RULE_INPUT_PATH)',
-      'process_outputs_as_sources': 1,
-      'conditions': [
-        ['jni_generator_jarjar_file != ""', {
-          'inputs': [
-            '<(jni_generator_jarjar_file)',
-          ],
-        }]
-      ],
-    },
-  ],
-  'direct_dependent_settings': {
-    'include_dirs': [
-      '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)',
-    ],
-  },
-  # This target exports a hard dependency because it generates header
-  # files.
-  'hard_dependency': 1,
-}
-
diff --git a/build/landmine_utils.py b/build/landmine_utils.py
deleted file mode 100644
index 6d18b6d..0000000
--- a/build/landmine_utils.py
+++ /dev/null
@@ -1,120 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-
-import functools
-import logging
-import os
-import shlex
-import sys
-
-
-def memoize(default=None):
-  """This decorator caches the return value of a parameterless pure function"""
-  def memoizer(func):
-    val = []
-    @functools.wraps(func)
-    def inner():
-      if not val:
-        ret = func()
-        val.append(ret if ret is not None else default)
-        if logging.getLogger().isEnabledFor(logging.INFO):
-          print '%s -> %r' % (func.__name__, val[0])
-      return val[0]
-    return inner
-  return memoizer
-
-
-@memoize()
-def IsWindows():
-  return sys.platform in ['win32', 'cygwin']
-
-
-@memoize()
-def IsLinux():
-  return sys.platform.startswith(('linux', 'freebsd', 'openbsd'))
-
-
-@memoize()
-def IsMac():
-  return sys.platform == 'darwin'
-
-
-@memoize()
-def gyp_defines():
-  """Parses and returns GYP_DEFINES env var as a dictionary."""
-  return dict(arg.split('=', 1)
-      for arg in shlex.split(os.environ.get('GYP_DEFINES', '')))
-
-@memoize()
-def gyp_generator_flags():
-  """Parses and returns GYP_GENERATOR_FLAGS env var as a dictionary."""
-  return dict(arg.split('=', 1)
-      for arg in shlex.split(os.environ.get('GYP_GENERATOR_FLAGS', '')))
-
-@memoize()
-def gyp_msvs_version():
-  return os.environ.get('GYP_MSVS_VERSION', '')
-
-@memoize()
-def distributor():
-  """
-  Returns a string which is the distributed build engine in use (if any).
-  Possible values: 'goma', 'ib', ''
-  """
-  if 'goma' in gyp_defines():
-    return 'goma'
-  elif IsWindows():
-    if 'CHROME_HEADLESS' in os.environ:
-      return 'ib' # use (win and !goma and headless) as approximation of ib
-
-
-@memoize()
-def platform():
-  """
-  Returns a string representing the platform this build is targetted for.
-  Possible values: 'win', 'mac', 'linux', 'ios', 'android'
-  """
-  if 'OS' in gyp_defines():
-    if 'android' in gyp_defines()['OS']:
-      return 'android'
-    else:
-      return gyp_defines()['OS']
-  elif IsWindows():
-    return 'win'
-  elif IsLinux():
-    return 'linux'
-  else:
-    return 'mac'
-
-
-@memoize()
-def builder():
-  """
-  Returns a string representing the build engine (not compiler) to use.
-  Possible values: 'make', 'ninja', 'xcode', 'msvs', 'scons'
-  """
-  if 'GYP_GENERATORS' in os.environ:
-    # for simplicity, only support the first explicit generator
-    generator = os.environ['GYP_GENERATORS'].split(',')[0]
-    if generator.endswith('-android'):
-      return generator.split('-')[0]
-    elif generator.endswith('-ninja'):
-      return 'ninja'
-    else:
-      return generator
-  else:
-    if platform() == 'android':
-      # Good enough for now? Do any android bots use make?
-      return 'ninja'
-    elif platform() == 'ios':
-      return 'xcode'
-    elif IsWindows():
-      return 'ninja'
-    elif IsLinux():
-      return 'ninja'
-    elif IsMac():
-      return 'ninja'
-    else:
-      assert False, 'Don\'t know what builder we\'re using!'
diff --git a/build/landmines.py b/build/landmines.py
deleted file mode 100755
index 0ea2b64..0000000
--- a/build/landmines.py
+++ /dev/null
@@ -1,134 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-This script runs every build as the first hook (See DEPS). If it detects that
-the build should be clobbered, it will delete the contents of the build
-directory.
-
-A landmine is tripped when a builder checks out a different revision, and the
-diff between the new landmines and the old ones is non-null. At this point, the
-build is clobbered.
-"""
-
-import difflib
-import errno
-import logging
-import optparse
-import os
-import sys
-import subprocess
-import time
-
-import clobber
-import landmine_utils
-
-
-SRC_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
-
-
-def get_build_dir(build_tool, is_iphone=False):
-  """
-  Returns output directory absolute path dependent on build and targets.
-  Examples:
-    r'c:\b\build\slave\win\build\src\out'
-    '/mnt/data/b/build/slave/linux/build/src/out'
-    '/b/build/slave/ios_rel_device/build/src/xcodebuild'
-
-  Keep this function in sync with tools/build/scripts/slave/compile.py
-  """
-  ret = None
-  if build_tool == 'xcode':
-    ret = os.path.join(SRC_DIR, 'xcodebuild')
-  elif build_tool in ['make', 'ninja', 'ninja-ios']:  # TODO: Remove ninja-ios.
-    if 'CHROMIUM_OUT_DIR' in os.environ:
-      output_dir = os.environ.get('CHROMIUM_OUT_DIR').strip()
-      if not output_dir:
-        raise Error('CHROMIUM_OUT_DIR environment variable is set but blank!')
-    else:
-      output_dir = landmine_utils.gyp_generator_flags().get('output_dir', 'out')
-    ret = os.path.join(SRC_DIR, output_dir)
-  else:
-    raise NotImplementedError('Unexpected GYP_GENERATORS (%s)' % build_tool)
-  return os.path.abspath(ret)
-
-
-def clobber_if_necessary(new_landmines):
-  """Does the work of setting, planting, and triggering landmines."""
-  out_dir = get_build_dir(landmine_utils.builder())
-  landmines_path = os.path.normpath(os.path.join(out_dir, '..', '.landmines'))
-  try:
-    os.makedirs(out_dir)
-  except OSError as e:
-    if e.errno == errno.EEXIST:
-      pass
-
-  if os.path.exists(landmines_path):
-    with open(landmines_path, 'r') as f:
-      old_landmines = f.readlines()
-    if old_landmines != new_landmines:
-      old_date = time.ctime(os.stat(landmines_path).st_ctime)
-      diff = difflib.unified_diff(old_landmines, new_landmines,
-          fromfile='old_landmines', tofile='new_landmines',
-          fromfiledate=old_date, tofiledate=time.ctime(), n=0)
-      sys.stdout.write('Clobbering due to:\n')
-      sys.stdout.writelines(diff)
-
-      clobber.clobber(out_dir)
-
-  # Save current set of landmines for next time.
-  with open(landmines_path, 'w') as f:
-    f.writelines(new_landmines)
-
-
-def process_options():
-  """Returns a list of landmine emitting scripts."""
-  parser = optparse.OptionParser()
-  parser.add_option(
-      '-s', '--landmine-scripts', action='append',
-      default=[os.path.join(SRC_DIR, 'build', 'get_landmines.py')],
-      help='Path to the script which emits landmines to stdout. The target '
-           'is passed to this script via option -t. Note that an extra '
-           'script can be specified via an env var EXTRA_LANDMINES_SCRIPT.')
-  parser.add_option('-v', '--verbose', action='store_true',
-      default=('LANDMINES_VERBOSE' in os.environ),
-      help=('Emit some extra debugging information (default off). This option '
-          'is also enabled by the presence of a LANDMINES_VERBOSE environment '
-          'variable.'))
-
-  options, args = parser.parse_args()
-
-  if args:
-    parser.error('Unknown arguments %s' % args)
-
-  logging.basicConfig(
-      level=logging.DEBUG if options.verbose else logging.ERROR)
-
-  extra_script = os.environ.get('EXTRA_LANDMINES_SCRIPT')
-  if extra_script:
-    return options.landmine_scripts + [extra_script]
-  else:
-    return options.landmine_scripts
-
-
-def main():
-  landmine_scripts = process_options()
-
-  if landmine_utils.builder() in ('dump_dependency_json', 'eclipse'):
-    return 0
-
-
-  landmines = []
-  for s in landmine_scripts:
-    proc = subprocess.Popen([sys.executable, s], stdout=subprocess.PIPE)
-    output, _ = proc.communicate()
-    landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()])
-  clobber_if_necessary(landmines)
-
-  return 0
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/linux/OWNERS b/build/linux/OWNERS
deleted file mode 100644
index 4a60b79..0000000
--- a/build/linux/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-mmoss@chromium.org
-phajdan.jr@chromium.org
-thestig@chromium.org
diff --git a/build/linux/bin/eu-strip b/build/linux/bin/eu-strip
deleted file mode 100755
index 7f93eec..0000000
--- a/build/linux/bin/eu-strip
+++ /dev/null
Binary files differ
diff --git a/build/linux/bin/eu-strip.sha1 b/build/linux/bin/eu-strip.sha1
deleted file mode 100644
index 43f290a7..0000000
--- a/build/linux/bin/eu-strip.sha1
+++ /dev/null
@@ -1 +0,0 @@
-0a9b8f68615ce388b65201e6d22da7a9cf2e729c
\ No newline at end of file
diff --git a/build/linux/chrome_linux.croc b/build/linux/chrome_linux.croc
deleted file mode 100644
index f400306..0000000
--- a/build/linux/chrome_linux.croc
+++ /dev/null
@@ -1,29 +0,0 @@
-# -*- python -*-
-# Crocodile config file for Chromium linux
-
-# TODO(jhawkins): We'll need to add a chromeos.croc once we get a coverage bot
-# for that platform.
-
-{
-  # List of rules, applied in order
-  'rules' : [
-    # Specify inclusions before exclusions, since rules are in order.
-
-    # Don't include non-Linux platform dirs
-    {
-      'regexp' : '.*/(chromeos|views)/',
-      'include' : 0,
-    },
-    # Don't include chromeos, windows, or mac specific files
-    {
-      'regexp' : '.*(_|/)(chromeos|mac|win|views)(\\.|_)',
-      'include' : 0,
-    },
-
-    # Groups
-    {
-      'regexp' : '.*_test_linux\\.',
-      'group' : 'test',
-    },
-  ],
-}
diff --git a/build/linux/dump_app_syms.py b/build/linux/dump_app_syms.py
deleted file mode 100644
index c18bff7..0000000
--- a/build/linux/dump_app_syms.py
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Helper script to run dump_syms on Chrome Linux executables and strip
-# them if needed.
-
-import os
-import subprocess
-import sys
-
-if len(sys.argv) != 5:
-  print "dump_app_syms.py <dump_syms_exe> <strip_binary>"
-  print "                 <binary_with_symbols> <symbols_output>"
-  sys.exit(1)
-
-dumpsyms = sys.argv[1]
-strip_binary = sys.argv[2]
-infile = sys.argv[3]
-outfile = sys.argv[4]
-
-# Dump only when the output file is out-of-date.
-if not os.path.isfile(outfile) or \
-   os.stat(outfile).st_mtime > os.stat(infile).st_mtime:
-  with open(outfile, 'w') as outfileobj:
-    subprocess.check_call([dumpsyms, '-r', infile], stdout=outfileobj)
-
-if strip_binary != '0':
-  subprocess.check_call(['strip', infile])
diff --git a/build/linux/install-chromeos-fonts.py b/build/linux/install-chromeos-fonts.py
deleted file mode 100755
index a24adc9..0000000
--- a/build/linux/install-chromeos-fonts.py
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Script to install the Chrome OS fonts on Linux.
-# This script can be run manually (as root), but is also run as part
-# install-build-deps.sh.
-
-import os
-import shutil
-import subprocess
-import sys
-
-# Taken from the media-fonts/notofonts ebuild in chromiumos-overlay.
-VERSION = '20140815'
-URL = ('https://commondatastorage.googleapis.com/chromeos-localmirror/'
-       'distfiles/notofonts-%s.tar.bz2') % (VERSION)
-FONTS_DIR = '/usr/local/share/fonts'
-
-def main(args):
-  if not sys.platform.startswith('linux'):
-    print "Error: %s must be run on Linux." % __file__
-    return 1
-
-  if os.getuid() != 0:
-    print "Error: %s must be run as root." % __file__
-    return 1
-
-  if not os.path.isdir(FONTS_DIR):
-    print "Error: Destination directory does not exist: %s" % FONTS_DIR
-    return 1
-
-  dest_dir = os.path.join(FONTS_DIR, 'chromeos')
-
-  stamp = os.path.join(dest_dir, ".stamp02")
-  if os.path.exists(stamp):
-    with open(stamp) as s:
-      if s.read() == URL:
-        print "Chrome OS fonts already up-to-date in %s." % dest_dir
-        return 0
-
-  if os.path.isdir(dest_dir):
-    shutil.rmtree(dest_dir)
-  os.mkdir(dest_dir)
-  os.chmod(dest_dir, 0755)
-
-  print "Installing Chrome OS fonts to %s." % dest_dir
-  tarball = os.path.join(dest_dir, os.path.basename(URL))
-  subprocess.check_call(['curl', '-L', URL, '-o', tarball])
-  subprocess.check_call(['tar', '--no-same-owner', '--no-same-permissions',
-                         '-xf', tarball, '-C', dest_dir])
-  os.remove(tarball)
-
-  readme = os.path.join(dest_dir, "README")
-  with open(readme, 'w') as s:
-    s.write("This directory and its contents are auto-generated.\n")
-    s.write("It may be deleted and recreated. Do not modify.\n")
-    s.write("Script: %s\n" % __file__)
-
-  with open(stamp, 'w') as s:
-    s.write(URL)
-
-  for base, dirs, files in os.walk(dest_dir):
-    for dir in dirs:
-      os.chmod(os.path.join(base, dir), 0755)
-    for file in files:
-      os.chmod(os.path.join(base, file), 0644)
-
-  return 0
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
diff --git a/build/linux/pkg-config-wrapper b/build/linux/pkg-config-wrapper
deleted file mode 100755
index b759564..0000000
--- a/build/linux/pkg-config-wrapper
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This program wraps around pkg-config to generate the correct include and
-# library paths when cross-compiling using a sysroot.
-# The assumption is that the sysroot contains the .pc files in usr/lib/pkgconfig
-# and usr/share/pkgconfig (relative to the sysroot) and that they output paths
-# relative to some parent path of the sysroot.
-# This assumption is valid for a range of sysroots, in particular: a
-# LSB-compliant root filesystem mounted at the sysroot, and a board build
-# directory of a Chromium OS chroot.
-# Additional directories containing .pc files may be specified by setting
-# the PKG_CONFIG_PATH environment variable- these will be prepended to the
-# generated paths.
-
-root="$1"
-shift
-target_arch="$1"
-shift
-libpath="$1"
-shift
-
-if [ -z "$root" -o -z "$target_arch" ]
-then
-  echo "usage: $0 /path/to/sysroot target_arch libdir [pkg-config-arguments] package" >&2
-  exit 1
-fi
-
-if [ "$target_arch" = "x64" ]
-then
-  : ${libpath:="lib64"}
-else
-  : ${libpath:="lib"}
-fi
-
-rewrite=`dirname $0`/rewrite_dirs.py
-package=${!#}
-
-config_path=$root/usr/$libpath/pkgconfig:$root/usr/share/pkgconfig
-
-# prepend any paths specified by the environment
-if [ -n "$PKG_CONFIG_PATH" ]
-then
-  config_path="$PKG_CONFIG_PATH:$config_path"
-fi
-
-set -e
-# Some sysroots, like the Chromium OS ones, may generate paths that are not
-# relative to the sysroot. For example,
-# /path/to/chroot/build/x86-generic/usr/lib/pkgconfig/pkg.pc may have all paths
-# relative to /path/to/chroot (i.e. prefix=/build/x86-generic/usr) instead of
-# relative to /path/to/chroot/build/x86-generic (i.e prefix=/usr).
-# To support this correctly, it's necessary to extract the prefix to strip from
-# pkg-config's |prefix| variable.
-prefix=`PKG_CONFIG_PATH=$config_path pkg-config --variable=prefix "$package" | sed -e 's|/usr$||'`
-result=`PKG_CONFIG_PATH=$config_path pkg-config "$@"`
-echo "$result"| $rewrite --sysroot "$root" --strip-prefix "$prefix"
diff --git a/build/linux/rewrite_dirs.py b/build/linux/rewrite_dirs.py
deleted file mode 100755
index 30f22f0..0000000
--- a/build/linux/rewrite_dirs.py
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Rewrites paths in -I, -L and other option to be relative to a sysroot."""
-
-import sys
-import os
-import optparse
-
-REWRITE_PREFIX = ['-I',
-                  '-idirafter',
-                  '-imacros',
-                  '-imultilib',
-                  '-include',
-                  '-iprefix',
-                  '-iquote',
-                  '-isystem',
-                  '-L']
-
-def RewritePath(path, opts):
-  """Rewrites a path by stripping the prefix and prepending the sysroot."""
-  sysroot = opts.sysroot
-  prefix = opts.strip_prefix
-  if os.path.isabs(path) and not path.startswith(sysroot):
-    if path.startswith(prefix):
-      path = path[len(prefix):]
-    path = path.lstrip('/')
-    return os.path.join(sysroot, path)
-  else:
-    return path
-
-
-def RewriteLine(line, opts):
-  """Rewrites all the paths in recognized options."""
-  args = line.split()
-  count = len(args)
-  i = 0
-  while i < count:
-    for prefix in REWRITE_PREFIX:
-      # The option can be either in the form "-I /path/to/dir" or
-      # "-I/path/to/dir" so handle both.
-      if args[i] == prefix:
-        i += 1
-        try:
-          args[i] = RewritePath(args[i], opts)
-        except IndexError:
-          sys.stderr.write('Missing argument following %s\n' % prefix)
-          break
-      elif args[i].startswith(prefix):
-        args[i] = prefix + RewritePath(args[i][len(prefix):], opts)
-    i += 1
-
-  return ' '.join(args)
-
-
-def main(argv):
-  parser = optparse.OptionParser()
-  parser.add_option('-s', '--sysroot', default='/', help='sysroot to prepend')
-  parser.add_option('-p', '--strip-prefix', default='', help='prefix to strip')
-  opts, args = parser.parse_args(argv[1:])
-
-  for line in sys.stdin.readlines():
-    line = RewriteLine(line.strip(), opts)
-    print line
-  return 0
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv))
diff --git a/build/linux/sysroot_scripts/install-sysroot.py b/build/linux/sysroot_scripts/install-sysroot.py
index 99fc2d6..f305f26 100755
--- a/build/linux/sysroot_scripts/install-sysroot.py
+++ b/build/linux/sysroot_scripts/install-sysroot.py
@@ -108,18 +108,6 @@
       print 'Unable to detect host architecture'
       return 1
 
-  if options.running_as_hook and target_arch != 'arm' and target_arch != 'mips':
-    # When run from runhooks, only install the sysroot for an Official Chrome
-    # Linux build, except on ARM where we always use a sysroot.
-    skip_if_defined = ['branding=Chrome', 'buildtype=Official']
-    skip_if_undefined = ['chromeos=1']
-    for option in skip_if_defined:
-      if option not in gyp_defines:
-        return 0
-    for option in skip_if_undefined:
-      if option in gyp_defines:
-        return 0
-
   # The sysroot directory should match the one specified in build/common.gypi.
   # TODO(thestig) Consider putting this else where to avoid having to recreate
   # it on every build.
diff --git a/build/linux/system.gyp b/build/linux/system.gyp
deleted file mode 100644
index ab20951..0000000
--- a/build/linux/system.gyp
+++ /dev/null
@@ -1,1222 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'variables': {
-    # If any of the linux_link_FOO below are set to 1, then the corresponding
-    # target will be linked against the FOO library (either dynamically or
-    # statically, depending on the pkg-config files), as opposed to loading the
-    # FOO library dynamically with dlopen.
-    'linux_link_libgps%': 0,
-    'linux_link_libpci%': 0,
-    'linux_link_libspeechd%': 0,
-    'linux_link_libbrlapi%': 0,
-
-    # Used below for the various libraries. In this scope for sharing with GN.
-    'libbrlapi_functions': [
-      'brlapi_getHandleSize',
-      'brlapi_error_location',
-      'brlapi_strerror',
-      'brlapi__acceptKeys',
-      'brlapi__openConnection',
-      'brlapi__closeConnection',
-      'brlapi__getDisplaySize',
-      'brlapi__enterTtyModeWithPath',
-      'brlapi__leaveTtyMode',
-      'brlapi__writeDots',
-      'brlapi__readKey',
-    ],
-    'libgio_functions': [
-      'g_settings_new',
-      'g_settings_get_child',
-      'g_settings_get_string',
-      'g_settings_get_boolean',
-      'g_settings_get_int',
-      'g_settings_get_strv',
-      'g_settings_list_schemas',
-    ],
-    'libpci_functions': [
-      'pci_alloc',
-      'pci_init',
-      'pci_cleanup',
-      'pci_scan_bus',
-      'pci_fill_info',
-      'pci_lookup_name',
-    ],
-    'libudev_functions': [
-      'udev_device_get_action',
-      'udev_device_get_devnode',
-      'udev_device_get_parent',
-      'udev_device_get_parent_with_subsystem_devtype',
-      'udev_device_get_property_value',
-      'udev_device_get_subsystem',
-      'udev_device_get_sysattr_value',
-      'udev_device_get_sysname',
-      'udev_device_get_syspath',
-      'udev_device_new_from_devnum',
-      'udev_device_new_from_subsystem_sysname',
-      'udev_device_new_from_syspath',
-      'udev_device_unref',
-      'udev_enumerate_add_match_subsystem',
-      'udev_enumerate_get_list_entry',
-      'udev_enumerate_new',
-      'udev_enumerate_scan_devices',
-      'udev_enumerate_unref',
-      'udev_list_entry_get_next',
-      'udev_list_entry_get_name',
-      'udev_monitor_enable_receiving',
-      'udev_monitor_filter_add_match_subsystem_devtype',
-      'udev_monitor_get_fd',
-      'udev_monitor_new_from_netlink',
-      'udev_monitor_receive_device',
-      'udev_monitor_unref',
-      'udev_new',
-      'udev_set_log_fn',
-      'udev_set_log_priority',
-      'udev_unref',
-    ],
-  },
-  'conditions': [
-    [ 'chromeos==0 and use_ozone==0', {
-      # Hide GTK and related dependencies for Chrome OS and Ozone, so they won't get
-      # added back to Chrome OS and Ozone. Don't try to use GTK on Chrome OS and Ozone.
-      'targets': [
-        {
-          'target_name': 'atk',
-          'type': 'none',
-          'conditions': [
-            ['_toolset=="target"', {
-              'direct_dependent_settings': {
-                'cflags': [
-                  '<!@(<(pkg-config) --cflags atk)',
-                ],
-                'defines': [
-                  'ATK_LIB_DIR="<!@(<(pkg-config) --variable=libdir atk)"',
-                ],
-              },
-              'link_settings': {
-                'ldflags': [
-                  '<!@(<(pkg-config) --libs-only-L --libs-only-other atk)',
-                ],
-                'libraries': [
-                  '<!@(<(pkg-config) --libs-only-l atk)',
-                ],
-              },
-            }],
-          ],
-        },
-        {
-          'target_name': 'gdk',
-          'type': 'none',
-          'conditions': [
-            ['_toolset=="target"', {
-              'direct_dependent_settings': {
-                'cflags': [
-                  '<!@(<(pkg-config) --cflags gdk-2.0)',
-                ],
-              },
-              'link_settings': {
-                'ldflags': [
-                  '<!@(<(pkg-config) --libs-only-L --libs-only-other gdk-2.0)',
-                ],
-                'libraries': [
-                  '<!@(<(pkg-config) --libs-only-l gdk-2.0)',
-                ],
-              },
-            }],
-          ],
-        },
-        {
-          'target_name': 'gtk',
-          'type': 'none',
-          'toolsets': ['host', 'target'],
-          'variables': {
-            # gtk requires gmodule, but it does not list it as a dependency
-            # in some misconfigured systems.
-            'gtk_packages': 'gmodule-2.0 gtk+-2.0 gthread-2.0',
-          },
-          'conditions': [
-            ['_toolset=="target"', {
-              'all_dependent_settings': {
-                'cflags': [
-                  '<!@(<(pkg-config) --cflags <(gtk_packages))',
-                ],
-              },
-              'link_settings': {
-                'ldflags': [
-                  '<!@(<(pkg-config) --libs-only-L --libs-only-other <(gtk_packages))',
-                ],
-                'libraries': [
-                  '<!@(<(pkg-config) --libs-only-l <(gtk_packages))',
-                ],
-              },
-            }, {
-              'all_dependent_settings': {
-                'cflags': [
-                  '<!@(pkg-config --cflags <(gtk_packages))',
-                ],
-              },
-              'link_settings': {
-                'ldflags': [
-                  '<!@(pkg-config --libs-only-L --libs-only-other <(gtk_packages))',
-                ],
-                'libraries': [
-                  '<!@(pkg-config --libs-only-l <(gtk_packages))',
-                ],
-              },
-            }],
-          ],
-        },
-        {
-          'target_name': 'gtkprint',
-          'type': 'none',
-          'conditions': [
-            ['_toolset=="target"', {
-              'direct_dependent_settings': {
-                'cflags': [
-                  '<!@(<(pkg-config) --cflags gtk+-unix-print-2.0)',
-                ],
-              },
-              'link_settings': {
-                'ldflags': [
-                  '<!@(<(pkg-config) --libs-only-L --libs-only-other gtk+-unix-print-2.0)',
-                ],
-                'libraries': [
-                  '<!@(<(pkg-config) --libs-only-l gtk+-unix-print-2.0)',
-                ],
-              },
-            }],
-          ],
-        },
-      ],  # targets
-    }],
-    [ 'use_x11==1 or ozone_platform_ozonex==1', {
-      # Hide X11 and related dependencies when use_x11=0
-      'targets': [
-        {
-          'target_name': 'x11',
-          'type': 'none',
-          'toolsets': ['host', 'target'],
-          'conditions': [
-            ['_toolset=="target"', {
-              'direct_dependent_settings': {
-                'cflags': [
-                  '<!@(<(pkg-config) --cflags x11)',
-                ],
-              },
-              'link_settings': {
-                'ldflags': [
-                  '<!@(<(pkg-config) --libs-only-L --libs-only-other x11 xi)',
-                ],
-                'libraries': [
-                  '<!@(<(pkg-config) --libs-only-l x11 xi)',
-                ],
-              },
-            }, {
-              'direct_dependent_settings': {
-                'cflags': [
-                  '<!@(pkg-config --cflags x11)',
-                ],
-              },
-              'link_settings': {
-                'ldflags': [
-                  '<!@(pkg-config --libs-only-L --libs-only-other x11 xi)',
-                ],
-                'libraries': [
-                  '<!@(pkg-config --libs-only-l x11 xi)',
-                ],
-              },
-            }],
-          ],
-        },
-        {
-          'target_name': 'xcursor',
-          'type': 'none',
-          'direct_dependent_settings': {
-            'cflags': [
-              '<!@(<(pkg-config) --cflags xcursor)',
-            ],
-          },
-          'link_settings': {
-            'ldflags': [
-              '<!@(<(pkg-config) --libs-only-L --libs-only-other xcursor)',
-            ],
-            'libraries': [
-              '<!@(<(pkg-config) --libs-only-l xcursor)',
-            ],
-          },
-        },
-        {
-          'target_name': 'xcomposite',
-          'type': 'none',
-          'direct_dependent_settings': {
-            'cflags': [
-              '<!@(<(pkg-config) --cflags xcomposite)',
-            ],
-          },
-          'link_settings': {
-            'ldflags': [
-              '<!@(<(pkg-config) --libs-only-L --libs-only-other xcomposite)',
-            ],
-            'libraries': [
-              '<!@(<(pkg-config) --libs-only-l xcomposite)',
-            ],
-          },
-        },
-        {
-          'target_name': 'xdamage',
-          'type': 'none',
-          'direct_dependent_settings': {
-            'cflags': [
-              '<!@(<(pkg-config) --cflags xdamage)',
-            ],
-          },
-          'link_settings': {
-            'ldflags': [
-              '<!@(<(pkg-config) --libs-only-L --libs-only-other xdamage)',
-            ],
-            'libraries': [
-              '<!@(<(pkg-config) --libs-only-l xdamage)',
-            ],
-          },
-        },
-        {
-          'target_name': 'xext',
-          'type': 'none',
-          'direct_dependent_settings': {
-            'cflags': [
-              '<!@(<(pkg-config) --cflags xext)',
-            ],
-          },
-          'link_settings': {
-            'ldflags': [
-              '<!@(<(pkg-config) --libs-only-L --libs-only-other xext)',
-            ],
-            'libraries': [
-              '<!@(<(pkg-config) --libs-only-l xext)',
-            ],
-          },
-        },
-        {
-          'target_name': 'xfixes',
-          'type': 'none',
-          'direct_dependent_settings': {
-            'cflags': [
-              '<!@(<(pkg-config) --cflags xfixes)',
-            ],
-          },
-          'link_settings': {
-            'ldflags': [
-              '<!@(<(pkg-config) --libs-only-L --libs-only-other xfixes)',
-            ],
-            'libraries': [
-              '<!@(<(pkg-config) --libs-only-l xfixes)',
-            ],
-          },
-        },
-        {
-          'target_name': 'xi',
-          'type': 'none',
-          'direct_dependent_settings': {
-            'cflags': [
-              '<!@(<(pkg-config) --cflags xi)',
-            ],
-          },
-          'link_settings': {
-            'ldflags': [
-              '<!@(<(pkg-config) --libs-only-L --libs-only-other xi)',
-            ],
-            'libraries': [
-              '<!@(<(pkg-config) --libs-only-l xi)',
-            ],
-          },
-        },
-        {
-          'target_name': 'xrandr',
-          'type': 'none',
-          'toolsets': ['host', 'target'],
-          'conditions': [
-            ['_toolset=="target"', {
-              'direct_dependent_settings': {
-                'cflags': [
-                  '<!@(<(pkg-config) --cflags xrandr)',
-                ],
-              },
-              'link_settings': {
-                'ldflags': [
-                  '<!@(<(pkg-config) --libs-only-L --libs-only-other xrandr)',
-                ],
-                'libraries': [
-                  '<!@(<(pkg-config) --libs-only-l xrandr)',
-                ],
-              },
-            }, {
-              'direct_dependent_settings': {
-                'cflags': [
-                  '<!@(pkg-config --cflags xrandr)',
-                ],
-              },
-              'link_settings': {
-                'ldflags': [
-                  '<!@(pkg-config --libs-only-L --libs-only-other xrandr)',
-                ],
-                'libraries': [
-                  '<!@(pkg-config --libs-only-l xrandr)',
-                ],
-              },
-            }],
-          ],
-        },
-        {
-          'target_name': 'xrender',
-          'type': 'none',
-          'direct_dependent_settings': {
-            'cflags': [
-              '<!@(<(pkg-config) --cflags xrender)',
-            ],
-          },
-          'link_settings': {
-            'ldflags': [
-              '<!@(<(pkg-config) --libs-only-L --libs-only-other xrender)',
-            ],
-            'libraries': [
-              '<!@(<(pkg-config) --libs-only-l xrender)',
-            ],
-          },
-        },
-        {
-          'target_name': 'xtst',
-          'type': 'none',
-          'toolsets': ['host', 'target'],
-          'conditions': [
-            ['_toolset=="target"', {
-              'direct_dependent_settings': {
-                'cflags': [
-                  '<!@(<(pkg-config) --cflags xtst)',
-                ],
-              },
-              'link_settings': {
-                'ldflags': [
-                  '<!@(<(pkg-config) --libs-only-L --libs-only-other xtst)',
-                ],
-                'libraries': [
-                  '<!@(<(pkg-config) --libs-only-l xtst)',
-                ],
-              },
-            }, {
-              'direct_dependent_settings': {
-                'cflags': [
-                  '<!@(pkg-config --cflags xtst)',
-                ],
-              },
-              'link_settings': {
-                'ldflags': [
-                  '<!@(pkg-config --libs-only-L --libs-only-other xtst)',
-                ],
-                'libraries': [
-                  '<!@(pkg-config --libs-only-l xtst)',
-                ],
-              },
-            }]
-          ]
-        }
-      ],  # targets
-    }],
-    ['use_x11==1 and chromeos==0', {
-      'targets': [
-        {
-          'target_name': 'xscrnsaver',
-          'type': 'none',
-          'direct_dependent_settings': {
-            'cflags': [
-              '<!@(<(pkg-config) --cflags xscrnsaver)',
-            ],
-          },
-          'link_settings': {
-            'ldflags': [
-              '<!@(<(pkg-config) --libs-only-L --libs-only-other xscrnsaver)',
-            ],
-            'libraries': [
-              '<!@(<(pkg-config) --libs-only-l xscrnsaver)',
-            ],
-          },
-        },
-      ],  # targets
-    }],
-    ['use_evdev_gestures==1', {
-      'targets': [
-        {
-          'target_name': 'libevdev-cros',
-          'type': 'none',
-          'direct_dependent_settings': {
-            'cflags': [
-              '<!@(<(pkg-config) --cflags libevdev-cros)'
-            ],
-          },
-          'link_settings': {
-            'ldflags': [
-              '<!@(<(pkg-config) --libs-only-L --libs-only-other libevdev-cros)',
-            ],
-            'libraries': [
-              '<!@(<(pkg-config) --libs-only-l libevdev-cros)',
-            ],
-          },
-        },
-        {
-          'target_name': 'libgestures',
-          'type': 'none',
-          'direct_dependent_settings': {
-            'cflags': [
-              '<!@(<(pkg-config) --cflags libgestures)'
-            ],
-          },
-          'link_settings': {
-            'ldflags': [
-              '<!@(<(pkg-config) --libs-only-L --libs-only-other libgestures)',
-            ],
-            'libraries': [
-              '<!@(<(pkg-config) --libs-only-l libgestures)',
-            ],
-          },
-        },
-      ],
-    }],
-    ['use_xkbcommon==1', {
-      'targets': [
-        {
-          'target_name': 'xkbcommon',
-          'type': 'none',
-          'direct_dependent_settings': {
-            'cflags': [
-              '<!@(<(pkg-config) --cflags xkbcommon)'
-            ],
-          },
-          'link_settings': {
-            'ldflags': [
-              '<!@(<(pkg-config) --libs-only-L --libs-only-other xkbcommon)',
-            ],
-            'libraries': [
-              '<!@(<(pkg-config) --libs-only-l xkbcommon)',
-            ],
-          },
-        },
-      ],
-    }],
-    ['ozone_platform_gbm==1', {
-      'targets': [
-        {
-          'target_name': 'gbm',
-          'type': 'none',
-          'direct_dependent_settings': {
-            'cflags': [
-              '<!@(<(pkg-config) --cflags gbm)',
-            ],
-          },
-          'link_settings': {
-            'ldflags': [
-              '<!@(<(pkg-config) --libs-only-L --libs-only-other gbm)',
-            ],
-            'libraries': [
-              '<!@(<(pkg-config) --libs-only-l gbm)',
-            ],
-          },
-        },
-      ],
-    }],
-    ['ozone_platform_drm==1 or ozone_platform_gbm==1', {
-      'targets': [
-        {
-          'target_name': 'libdrm',
-          'type': 'none',
-          'direct_dependent_settings': {
-            'cflags': [
-              '<!@(<(pkg-config) --cflags libdrm)',
-            ],
-          },
-          'link_settings': {
-            'libraries': [
-              '<!@(<(pkg-config) --libs-only-l libdrm)',
-            ],
-          },
-        },
-      ],
-    }],
-    ['use_udev==1', {
-      'targets': [
-        {
-          'target_name': 'udev',
-          'type': 'static_library',
-          'conditions': [
-            ['_toolset=="target"', {
-              'include_dirs': [
-                '../..',
-              ],
-              'hard_dependency': 1,
-              'actions': [
-                {
-                  'variables': {
-                    'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libudev0.h',
-                    'output_cc': '<(INTERMEDIATE_DIR)/libudev0_loader.cc',
-                    'generator': '../../tools/generate_library_loader/generate_library_loader.py',
-                  },
-                  'action_name': 'generate_libudev0_loader',
-                  'inputs': [
-                    '<(generator)',
-                  ],
-                  'outputs': [
-                    '<(output_h)',
-                    '<(output_cc)',
-                  ],
-                  'action': ['python',
-                             '<(generator)',
-                             '--name', 'LibUdev0Loader',
-                             '--output-h', '<(output_h)',
-                             '--output-cc', '<(output_cc)',
-                             '--header', '"third_party/libudev/libudev0.h"',
-                             '--link-directly=0',
-                             '<@(libudev_functions)',
-                  ],
-                  'message': 'Generating libudev0 library loader',
-                  'process_outputs_as_sources': 1,
-                },
-                {
-                  'variables': {
-                    'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libudev1.h',
-                    'output_cc': '<(INTERMEDIATE_DIR)/libudev1_loader.cc',
-                    'generator': '../../tools/generate_library_loader/generate_library_loader.py',
-                  },
-                  'action_name': 'generate_libudev1_loader',
-                  'inputs': [
-                    '<(generator)',
-                  ],
-                  'outputs': [
-                    '<(output_h)',
-                    '<(output_cc)',
-                  ],
-                  'action': ['python',
-                             '<(generator)',
-                             '--name', 'LibUdev1Loader',
-                             '--output-h', '<(output_h)',
-                             '--output-cc', '<(output_cc)',
-                             '--header', '"third_party/libudev/libudev1.h"',
-                             '--link-directly=0',
-                             '<@(libudev_functions)',
-                  ],
-                  'message': 'Generating libudev1 library loader',
-                  'process_outputs_as_sources': 1,
-                },
-              ],
-            }],
-          ],
-        },
-      ],
-    }],
-    ['use_libpci==1', {
-      'targets': [
-        {
-          'target_name': 'libpci',
-          'type': 'static_library',
-          'cflags': [
-            '<!@(<(pkg-config) --cflags libpci)',
-          ],
-          'direct_dependent_settings': {
-            'include_dirs': [
-              '<(SHARED_INTERMEDIATE_DIR)',
-            ],
-            'conditions': [
-              ['linux_link_libpci==1', {
-                'link_settings': {
-                  'ldflags': [
-                    '<!@(<(pkg-config) --libs-only-L --libs-only-other libpci)',
-                  ],
-                  'libraries': [
-                    '<!@(<(pkg-config) --libs-only-l libpci)',
-                  ],
-                }
-              }],
-            ],
-          },
-          'include_dirs': [
-            '../..',
-          ],
-          'hard_dependency': 1,
-          'actions': [
-            {
-              'variables': {
-                'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libpci.h',
-                'output_cc': '<(INTERMEDIATE_DIR)/libpci_loader.cc',
-                'generator': '../../tools/generate_library_loader/generate_library_loader.py',
-              },
-              'action_name': 'generate_libpci_loader',
-              'inputs': [
-                '<(generator)',
-              ],
-              'outputs': [
-                '<(output_h)',
-                '<(output_cc)',
-              ],
-              'action': ['python',
-                         '<(generator)',
-                         '--name', 'LibPciLoader',
-                         '--output-h', '<(output_h)',
-                         '--output-cc', '<(output_cc)',
-                         '--header', '<pci/pci.h>',
-                         # TODO(phajdan.jr): Report problem to pciutils project
-                         # and get it fixed so that we don't need --use-extern-c.
-                         '--use-extern-c',
-                         '--link-directly=<(linux_link_libpci)',
-                         '<@(libpci_functions)',
-              ],
-              'message': 'Generating libpci library loader',
-              'process_outputs_as_sources': 1,
-            },
-          ],
-        },
-      ],
-    }],
-  ],  # conditions
-  'targets': [
-    {
-      'target_name': 'dbus',
-      'type': 'none',
-      'direct_dependent_settings': {
-        'cflags': [
-          '<!@(<(pkg-config) --cflags dbus-1)',
-        ],
-      },
-      'link_settings': {
-        'ldflags': [
-          '<!@(<(pkg-config) --libs-only-L --libs-only-other dbus-1)',
-        ],
-        'libraries': [
-          '<!@(<(pkg-config) --libs-only-l dbus-1)',
-        ],
-      },
-    },
-    {
-      'target_name': 'fontconfig',
-      'type': 'none',
-      'conditions': [
-        ['_toolset=="target"', {
-          'conditions': [
-            ['use_system_fontconfig==1', {
-              'direct_dependent_settings': {
-                'cflags': [
-                  '<!@(<(pkg-config) --cflags fontconfig)',
-                ],
-              },
-              'link_settings': {
-                'ldflags': [
-                  '<!@(<(pkg-config) --libs-only-L --libs-only-other fontconfig)',
-                ],
-                'libraries': [
-                  '<!@(<(pkg-config) --libs-only-l fontconfig)',
-                ],
-              },
-            }, {  # use_system_fontconfig==0
-              'dependencies': [
-                '../../third_party/fontconfig/fontconfig.gyp:fontconfig',
-              ],
-              'export_dependent_settings' : [
-                '../../third_party/fontconfig/fontconfig.gyp:fontconfig',
-              ],
-            }],
-          ],
-        }],
-      ],
-    },
-    {
-      'target_name': 'freetype2',
-      'type': 'none',
-      'conditions': [
-        ['_toolset=="target"', {
-          'direct_dependent_settings': {
-            'cflags': [
-              '<!@(<(pkg-config) --cflags freetype2)',
-            ],
-          },
-          'link_settings': {
-            'ldflags': [
-              '<!@(<(pkg-config) --libs-only-L --libs-only-other freetype2)',
-            ],
-            'libraries': [
-              '<!@(<(pkg-config) --libs-only-l freetype2)',
-            ],
-          },
-        }],
-      ],
-    },
-    {
-      'target_name': 'gconf',
-      'type': 'none',
-      'conditions': [
-        ['use_gconf==1 and _toolset=="target"', {
-          'direct_dependent_settings': {
-            'cflags': [
-              '<!@(<(pkg-config) --cflags gconf-2.0)',
-            ],
-            'defines': [
-              'USE_GCONF',
-            ],
-          },
-          'link_settings': {
-            'ldflags': [
-              '<!@(<(pkg-config) --libs-only-L --libs-only-other gconf-2.0)',
-            ],
-            'libraries': [
-              '<!@(<(pkg-config) --libs-only-l gconf-2.0)',
-            ],
-          },
-        }],
-      ],
-    },
-    {
-      'target_name': 'gio',
-      'type': 'static_library',
-      'conditions': [
-        ['use_gio==1 and _toolset=="target"', {
-          'cflags': [
-            '<!@(<(pkg-config) --cflags gio-2.0)',
-          ],
-          'variables': {
-            'gio_warning_define': [
-              # glib >=2.40 deprecate g_settings_list_schemas in favor of
-              # g_settings_schema_source_list_schemas. This function is not
-              # available on earlier versions that we still need to support
-              # (specifically, 2.32), so disable the warning.
-              # TODO(mgiuca): Remove this suppression (and variable) when we
-              # drop support for Ubuntu 13.10 (saucy) and earlier. Update the
-              # code to use g_settings_schema_source_list_schemas instead.
-              'GLIB_DISABLE_DEPRECATION_WARNINGS',
-            ],
-          },
-          'defines': [
-            '<(gio_warning_define)',
-          ],
-          'direct_dependent_settings': {
-            'cflags': [
-              '<!@(<(pkg-config) --cflags gio-2.0)',
-            ],
-            'defines': [
-              'USE_GIO',
-              '<(gio_warning_define)',
-            ],
-            'include_dirs': [
-              '<(SHARED_INTERMEDIATE_DIR)',
-            ],
-          },
-          'include_dirs': [
-            '../..',
-          ],
-          'link_settings': {
-            'ldflags': [
-              '<!@(<(pkg-config) --libs-only-L --libs-only-other gio-2.0)',
-            ],
-            'libraries': [
-              '<!@(<(pkg-config) --libs-only-l gio-2.0)',
-            ],
-            'conditions': [
-              ['linux_link_gsettings==0 and OS=="linux"', {
-                'libraries': [
-                  '-ldl',
-                ],
-              }],
-            ],
-          },
-          'hard_dependency': 1,
-          'actions': [
-            {
-              'variables': {
-                'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libgio.h',
-                'output_cc': '<(INTERMEDIATE_DIR)/libgio_loader.cc',
-                'generator': '../../tools/generate_library_loader/generate_library_loader.py',
-              },
-              'action_name': 'generate_libgio_loader',
-              'inputs': [
-                '<(generator)',
-              ],
-              'outputs': [
-                '<(output_h)',
-                '<(output_cc)',
-              ],
-              'action': ['python',
-                         '<(generator)',
-                         '--name', 'LibGioLoader',
-                         '--output-h', '<(output_h)',
-                         '--output-cc', '<(output_cc)',
-                         '--header', '<gio/gio.h>',
-                         '--link-directly=<(linux_link_gsettings)',
-                         '<@(libgio_functions)',
-              ],
-              'message': 'Generating libgio library loader',
-              'process_outputs_as_sources': 1,
-            },
-          ],
-        }],
-      ],
-    },
-    {
-      'target_name': 'glib',
-      'type': 'none',
-      'toolsets': ['host', 'target'],
-      'variables': {
-        'glib_packages': 'glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0',
-      },
-      'conditions': [
-        ['_toolset=="target"', {
-          'direct_dependent_settings': {
-            'cflags': [
-              '<!@(<(pkg-config) --cflags <(glib_packages))',
-            ],
-          },
-          'link_settings': {
-            'ldflags': [
-              '<!@(<(pkg-config) --libs-only-L --libs-only-other <(glib_packages))',
-            ],
-            'libraries': [
-              '<!@(<(pkg-config) --libs-only-l <(glib_packages))',
-            ],
-          },
-        }, {
-          'direct_dependent_settings': {
-            'cflags': [
-              '<!@(pkg-config --cflags <(glib_packages))',
-            ],
-          },
-          'link_settings': {
-            'ldflags': [
-              '<!@(pkg-config --libs-only-L --libs-only-other <(glib_packages))',
-            ],
-            'libraries': [
-              '<!@(pkg-config --libs-only-l <(glib_packages))',
-            ],
-          },
-        }],
-      ],
-    },
-    {
-      'target_name': 'gnome_keyring',
-      'type': 'none',
-      'conditions': [
-        ['use_gnome_keyring==1', {
-          'direct_dependent_settings': {
-            'cflags': [
-              '<!@(<(pkg-config) --cflags gnome-keyring-1)',
-            ],
-            'defines': [
-              'USE_GNOME_KEYRING',
-            ],
-            'conditions': [
-              ['linux_link_gnome_keyring==0', {
-                'defines': ['DLOPEN_GNOME_KEYRING'],
-              }],
-            ],
-          },
-          'conditions': [
-            ['linux_link_gnome_keyring!=0', {
-              'link_settings': {
-                'ldflags': [
-                  '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)',
-                ],
-                'libraries': [
-                  '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)',
-                ],
-              },
-            }, {
-              'conditions': [
-                ['OS=="linux"', {
-                 'link_settings': {
-                   'libraries': [
-                     '-ldl',
-                   ],
-                 },
-                }],
-              ],
-            }],
-          ],
-        }],
-      ],
-    },
-    {
-      # The unit tests use a few convenience functions from the GNOME
-      # Keyring library directly. We ignore linux_link_gnome_keyring and
-      # link directly in this version of the target to allow this.
-      # *** Do not use this target in the main binary! ***
-      'target_name': 'gnome_keyring_direct',
-      'type': 'none',
-      'conditions': [
-        ['use_gnome_keyring==1', {
-          'direct_dependent_settings': {
-            'cflags': [
-              '<!@(<(pkg-config) --cflags gnome-keyring-1)',
-            ],
-            'defines': [
-              'USE_GNOME_KEYRING',
-            ],
-            'conditions': [
-              ['linux_link_gnome_keyring==0', {
-                'defines': ['DLOPEN_GNOME_KEYRING'],
-              }],
-            ],
-          },
-          'link_settings': {
-            'ldflags': [
-              '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)',
-            ],
-            'libraries': [
-              '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)',
-            ],
-          },
-        }],
-      ],
-    },
-    {
-      'target_name': 'libbrlapi',
-      'type': 'static_library',
-      'all_dependent_settings': {
-        'include_dirs': [
-          '<(SHARED_INTERMEDIATE_DIR)',
-        ],
-        'defines': [
-          'USE_BRLAPI',
-        ],
-        'conditions': [
-          ['linux_link_libbrlapi==1', {
-            'link_settings': {
-              'libraries': [
-                '-lbrlapi',
-              ],
-            }
-          }],
-        ],
-      },
-      'include_dirs': [
-        '../..',
-      ],
-      'hard_dependency': 1,
-      'actions': [
-        {
-          'variables': {
-            'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libbrlapi.h',
-            'output_cc': '<(INTERMEDIATE_DIR)/libbrlapi_loader.cc',
-            'generator': '../../tools/generate_library_loader/generate_library_loader.py',
-          },
-          'action_name': 'generate_brlapi_loader',
-          'inputs': [
-            '<(generator)',
-          ],
-          'outputs': [
-            '<(output_h)',
-            '<(output_cc)',
-          ],
-          'action': ['python',
-                     '<(generator)',
-                     '--name', 'LibBrlapiLoader',
-                     '--output-h', '<(output_h)',
-                     '--output-cc', '<(output_cc)',
-                     '--header', '<brlapi.h>',
-                     '--link-directly=<(linux_link_libbrlapi)',
-                     '<@(libbrlapi_functions)',
-          ],
-          'message': 'Generating libbrlapi library loader',
-          'process_outputs_as_sources': 1,
-        },
-      ],
-    },
-    {
-      'target_name': 'libcap',
-      'type': 'none',
-      'link_settings': {
-        'libraries': [
-          '-lcap',
-        ],
-      },
-    },
-    {
-      'target_name': 'libresolv',
-      'type': 'none',
-      'link_settings': {
-        'libraries': [
-          '-lresolv',
-        ],
-      },
-    },
-    {
-      # GN version: //third_party/speech-dispatcher
-      'target_name': 'libspeechd',
-      'type': 'static_library',
-      'direct_dependent_settings': {
-        'include_dirs': [
-          '<(SHARED_INTERMEDIATE_DIR)',
-        ],
-        'conditions': [
-          ['linux_link_libspeechd==1', {
-            'link_settings': {
-              'libraries': [
-                '-lspeechd',
-              ],
-            }
-          }],
-        ],
-      },
-      'include_dirs': [
-        '../..',
-      ],
-      'hard_dependency': 1,
-      'actions': [
-        {
-          'variables': {
-            'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libspeechd.h',
-            'output_cc': '<(INTERMEDIATE_DIR)/libspeechd_loader.cc',
-            'generator': '../../tools/generate_library_loader/generate_library_loader.py',
-
-            # speech-dispatcher >= 0.8 installs libspeechd.h into
-            # speech-dispatcher/libspeechd.h, whereas speech-dispatcher < 0.8
-            # puts libspeechd.h in the top-level include directory.
-            # Since we need to support both cases for now, we ship a copy of
-            # libspeechd.h in third_party/speech-dispatcher. If the user
-            # prefers to link against the speech-dispatcher directly, the
-            # `libspeechd_h_prefix' variable can be passed to gyp with a value
-            # such as "speech-dispatcher/" that will be prepended to
-            # "libspeechd.h" in the #include directive.
-            # TODO(phaldan.jr): Once we do not need to support
-            # speech-dispatcher < 0.8 we can get rid of all this (including
-            # third_party/speech-dispatcher) and just include
-            # speech-dispatcher/libspeechd.h unconditionally.
-            'libspeechd_h_prefix%': '',
-          },
-          'action_name': 'generate_libspeechd_loader',
-          'inputs': [
-            '<(generator)',
-          ],
-          'outputs': [
-            '<(output_h)',
-            '<(output_cc)',
-          ],
-          'action': ['python',
-                     '<(generator)',
-                     '--name', 'LibSpeechdLoader',
-                     '--output-h', '<(output_h)',
-                     '--output-cc', '<(output_cc)',
-                     '--header', '<<(libspeechd_h_prefix)libspeechd.h>',
-                     '--bundled-header',
-                     '"third_party/speech-dispatcher/libspeechd.h"',
-                     '--link-directly=<(linux_link_libspeechd)',
-                     'spd_open',
-                     'spd_say',
-                     'spd_stop',
-                     'spd_close',
-                     'spd_pause',
-                     'spd_resume',
-                     'spd_set_notification_on',
-                     'spd_set_voice_rate',
-                     'spd_set_voice_pitch',
-                     'spd_list_synthesis_voices',
-                     'spd_set_synthesis_voice',
-                     'spd_list_modules',
-                     'spd_set_output_module',
-                     'spd_set_language',
-          ],
-          'message': 'Generating libspeechd library loader',
-          'process_outputs_as_sources': 1,
-        },
-      ],
-    },
-    {
-      'target_name': 'pangocairo',
-      'type': 'none',
-      'toolsets': ['host', 'target'],
-      'conditions': [
-        ['use_pango==1 and use_cairo==1', {
-          'conditions': [
-            ['_toolset=="target"', {
-              'direct_dependent_settings': {
-                'cflags': [
-                  '<!@(<(pkg-config) --cflags pangocairo pangoft2)',
-                ],
-              },
-              'link_settings': {
-                'ldflags': [
-                  '<!@(<(pkg-config) --libs-only-L --libs-only-other pangocairo pangoft2)',
-                ],
-                'libraries': [
-                  '<!@(<(pkg-config) --libs-only-l pangocairo pangoft2)',
-                ],
-              },
-            }, {
-              'direct_dependent_settings': {
-                'cflags': [
-                  '<!@(pkg-config --cflags pangocairo pangoft2)',
-                ],
-              },
-              'link_settings': {
-                'ldflags': [
-                  '<!@(pkg-config --libs-only-L --libs-only-other pangocairo pangoft2)',
-                ],
-                'libraries': [
-                  '<!@(pkg-config --libs-only-l pangocairo pangoft2)',
-                ],
-              },
-            }],
-          ],
-        }],
-      ],
-    },
-    {
-      'target_name': 'ssl',
-      'type': 'none',
-      'conditions': [
-        ['_toolset=="target"', {
-          'conditions': [
-            ['use_openssl==1', {
-              'dependencies': [
-                '../../third_party/boringssl/boringssl.gyp:boringssl',
-              ],
-            }, {
-              'dependencies': [
-                '../../net/third_party/nss/ssl.gyp:libssl',
-              ],
-              'direct_dependent_settings': {
-                'include_dirs+': [
-                  # We need for our local copies of the libssl3 headers to come
-                  # before other includes, as we are shadowing system headers.
-                  '<(DEPTH)/net/third_party/nss/ssl',
-                ],
-              },
-            }],
-            # Link in the system NSS if it is used for either the internal
-            # crypto library (use_openssl==0) or platform certificate
-            # library (use_nss_certs==1).
-            ['use_openssl==0 or use_nss_certs==1', {
-              'direct_dependent_settings': {
-                'cflags': [
-                  '<!@(<(pkg-config) --cflags nss)',
-                ],
-              },
-              'link_settings': {
-                'ldflags': [
-                  '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)',
-                ],
-                'libraries': [
-                  '<!@(<(pkg-config) --libs-only-l nss | sed -e "s/-lssl3//")',
-                ],
-              },
-              'conditions': [
-                ['clang==1', {
-                  'direct_dependent_settings': {
-                    'cflags': [
-                      # There is a broken header guard in /usr/include/nss/secmod.h:
-                      # https://bugzilla.mozilla.org/show_bug.cgi?id=884072
-                      '-Wno-header-guard',
-                    ],
-                  },
-                }],
-              ],
-            }],
-          ]
-        }],
-      ],
-    },
-  ],
-}
diff --git a/build/linux/unbundle/README b/build/linux/unbundle/README
deleted file mode 100644
index d1b2a96..0000000
--- a/build/linux/unbundle/README
+++ /dev/null
@@ -1,44 +0,0 @@
-This directory contains files that make it possible to use system libraries.
-
-For more info please read the following:
-
- - https://fedoraproject.org/wiki/Packaging:No_Bundled_Libraries
- - https://wiki.gentoo.org/wiki/Why_not_bundle_dependencies
- - http://www.debian.org/doc/debian-policy/ch-source.html#s-embeddedfiles
-
-For more Chromium-specific context please read
-http://spot.livejournal.com/312320.html .
-
-This directory is provided in the source tree to follow above guidelines.
-It is a compromise solution which takes into account Chromium developers
-who want to avoid the perceived burden of more conditional code in gyp,
-and expectations of Open Source community, where using system-provided
-libraries is the norm.
-
-Usage:
-
-1. remove_bundled_libraries.py <preserved-directories>
-
-   For example: remove_bundled_libraries.py third_party/mesa
-
-   The script scans sources looking for third_party directories.
-   Everything that is not explicitly preserved is removed (except for
-   gyp files), and the script fails if any directory passed on command
-   line does not exist (to ensure list is kept up to date).
-
-   This is intended to be used on sources extracted from a tarball,
-   not a repository.
-
-   NOTE: by default this will not remove anything (for safety). Pass
-   --do-remove flag to actually remove files.
-
-2. replace_gyp_files.py <gyp-flags>
-
-   For example: replace_gyp_files.py -Duse_system_harfbuzz=1
-
-   The script ignores flags other than -D for convenience. This makes it
-   possible to have a variable e.g. ${myconf} with all the options, and
-   execute:
-
-   build/linux/unbundle/replace_gyp_files.py ${myconf}
-   build/gyp_chromium ${myconf}
diff --git a/build/linux/unbundle/expat.gyp b/build/linux/unbundle/expat.gyp
deleted file mode 100644
index 030fb85..0000000
--- a/build/linux/unbundle/expat.gyp
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'expat',
-      'type': 'none',
-      'link_settings': {
-        'libraries': [
-          '-lexpat',
-        ],
-      },
-    },
-  ],
-}
diff --git a/build/linux/unbundle/ffmpeg.gyp b/build/linux/unbundle/ffmpeg.gyp
deleted file mode 100644
index e3c3723..0000000
--- a/build/linux/unbundle/ffmpeg.gyp
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'ffmpeg',
-      'type': 'none',
-      'direct_dependent_settings': {
-        'cflags': [
-          '<!@(pkg-config --cflags libavcodec libavformat libavutil)',
-
-          '<!(python <(DEPTH)/tools/compile_test/compile_test.py '
-              '--code "#define __STDC_CONSTANT_MACROS\n'
-              '#include <libavcodec/avcodec.h>\n'
-              'int test() { return AV_CODEC_ID_OPUS; }" '
-              '--on-failure -DCHROMIUM_OMIT_AV_CODEC_ID_OPUS=1)',
-
-          '<!(python <(DEPTH)/tools/compile_test/compile_test.py '
-              '--code "#define __STDC_CONSTANT_MACROS\n'
-              '#include <libavcodec/avcodec.h>\n'
-              'int test() { return AV_CODEC_ID_VP9; }" '
-              '--on-failure -DCHROMIUM_OMIT_AV_CODEC_ID_VP9=1)',
-
-          '<!(python <(DEPTH)/tools/compile_test/compile_test.py '
-              '--code "#define __STDC_CONSTANT_MACROS\n'
-              '#include <libavcodec/avcodec.h>\n'
-              'int test() { return AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL; }" '
-              '--on-failure -DCHROMIUM_OMIT_AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL=1)',
-
-          '<!(python <(DEPTH)/tools/compile_test/compile_test.py '
-              '--code "#define __STDC_CONSTANT_MACROS\n'
-              '#include <libavcodec/avcodec.h>\n'
-              'int test() { struct AVFrame frame;\n'
-              'return av_frame_get_channels(&frame); }" '
-              '--on-failure -DCHROMIUM_NO_AVFRAME_CHANNELS=1)',
-        ],
-        'defines': [
-          '__STDC_CONSTANT_MACROS',
-          'USE_SYSTEM_FFMPEG',
-        ],
-      },
-      'link_settings': {
-        'ldflags': [
-          '<!@(pkg-config --libs-only-L --libs-only-other libavcodec libavformat libavutil)',
-        ],
-        'libraries': [
-          '<!@(pkg-config --libs-only-l libavcodec libavformat libavutil)',
-        ],
-      },
-    },
-  ],
-}
diff --git a/build/linux/unbundle/flac.gyp b/build/linux/unbundle/flac.gyp
deleted file mode 100644
index 9e4a664..0000000
--- a/build/linux/unbundle/flac.gyp
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'libflac',
-      'type': 'none',
-      'variables': {
-        'headers_root_path': 'include',
-        'header_filenames': [
-          'FLAC/callback.h',
-          'FLAC/metadata.h',
-          'FLAC/assert.h',
-          'FLAC/export.h',
-          'FLAC/format.h',
-          'FLAC/stream_decoder.h',
-          'FLAC/stream_encoder.h',
-          'FLAC/ordinals.h',
-          'FLAC/all.h',
-        ],
-      },
-      'includes': [
-        '../../build/shim_headers.gypi',
-      ],
-      'link_settings': {
-        'ldflags': [
-          '<!@(pkg-config --libs-only-L --libs-only-other flac)',
-        ],
-        'libraries': [
-          '<!@(pkg-config --libs-only-l flac)',
-        ],
-      },
-    },
-  ],
-}
diff --git a/build/linux/unbundle/harfbuzz.gyp b/build/linux/unbundle/harfbuzz.gyp
deleted file mode 100644
index 3bc1744..0000000
--- a/build/linux/unbundle/harfbuzz.gyp
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'variables': {
-    # Check for presence of harfbuzz-icu library, use it if present.
-    'harfbuzz_libraries':
-        '<!(python <(DEPTH)/tools/compile_test/compile_test.py '
-        '--code "int main() { return 0; }" '
-        '--run-linker '
-        '--on-success "harfbuzz harfbuzz-icu" '
-        '--on-failure "harfbuzz" '
-        '-- -lharfbuzz-icu)',
-  },
-  'targets': [
-    {
-      'target_name': 'harfbuzz-ng',
-      'type': 'none',
-      'cflags': [
-        '<!@(pkg-config --cflags <(harfbuzz_libraries))',
-      ],
-      'direct_dependent_settings': {
-        'cflags': [
-          '<!@(pkg-config --cflags <(harfbuzz_libraries))',
-        ],
-      },
-      'link_settings': {
-        'ldflags': [
-          '<!@(pkg-config --libs-only-L --libs-only-other <(harfbuzz_libraries))',
-        ],
-        'libraries': [
-          '<!@(pkg-config --libs-only-l <(harfbuzz_libraries))',
-        ],
-      },
-      'variables': {
-        'headers_root_path': 'src',
-        'header_filenames': [
-          'hb.h',
-        ],
-      },
-      'includes': [
-        '../../build/shim_headers.gypi',
-      ],
-    },
-  ],
-}
diff --git a/build/linux/unbundle/icu.gyp b/build/linux/unbundle/icu.gyp
deleted file mode 100644
index 16c36df..0000000
--- a/build/linux/unbundle/icu.gyp
+++ /dev/null
@@ -1,248 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'icudata',
-      'type': 'none',
-      'direct_dependent_settings': {
-        'cflags': [
-          '<!@(pkg-config --cflags icu-uc)',
-        ],
-        'defines': [
-          'U_USING_ICU_NAMESPACE=0',
-        ],
-      },
-      'link_settings': {
-        'ldflags': [
-          '<!@(pkg-config --libs-only-L --libs-only-other icu-uc)',
-        ],
-        'libraries': [
-          '<!@(pkg-config --libs-only-l icu-uc)',
-        ],
-      },
-    },
-    {
-      'target_name': 'icui18n',
-      'type': 'none',
-      'toolsets': ['host', 'target'],
-      'direct_dependent_settings': {
-        'cflags': [
-          '<!@(pkg-config --cflags icu-i18n)',
-        ],
-        'defines': [
-          'U_USING_ICU_NAMESPACE=0',
-        ],
-      },
-      'link_settings': {
-        'ldflags': [
-          '<!@(pkg-config --libs-only-L --libs-only-other icu-i18n)',
-        ],
-        'libraries': [
-          '<!@(pkg-config --libs-only-l icu-i18n)',
-        ],
-      },
-      'variables': {
-        'headers_root_path': 'source/i18n',
-        'header_filenames': [
-          # This list can easily be updated using the command below:
-          # find third_party/icu/source/i18n/unicode -iname '*.h' \
-          # -printf "'%p',\n" | \
-          # sed -e 's|third_party/icu/source/i18n/||' | sort -u
-          'unicode/basictz.h',
-          'unicode/bmsearch.h',
-          'unicode/bms.h',
-          'unicode/calendar.h',
-          'unicode/choicfmt.h',
-          'unicode/coleitr.h',
-          'unicode/colldata.h',
-          'unicode/coll.h',
-          'unicode/curramt.h',
-          'unicode/currpinf.h',
-          'unicode/currunit.h',
-          'unicode/datefmt.h',
-          'unicode/dcfmtsym.h',
-          'unicode/decimfmt.h',
-          'unicode/dtfmtsym.h',
-          'unicode/dtitvfmt.h',
-          'unicode/dtitvinf.h',
-          'unicode/dtptngen.h',
-          'unicode/dtrule.h',
-          'unicode/fieldpos.h',
-          'unicode/fmtable.h',
-          'unicode/format.h',
-          'unicode/fpositer.h',
-          'unicode/gregocal.h',
-          'unicode/locdspnm.h',
-          'unicode/measfmt.h',
-          'unicode/measunit.h',
-          'unicode/measure.h',
-          'unicode/msgfmt.h',
-          'unicode/numfmt.h',
-          'unicode/numsys.h',
-          'unicode/plurfmt.h',
-          'unicode/plurrule.h',
-          'unicode/rbnf.h',
-          'unicode/rbtz.h',
-          'unicode/regex.h',
-          'unicode/search.h',
-          'unicode/selfmt.h',
-          'unicode/simpletz.h',
-          'unicode/smpdtfmt.h',
-          'unicode/sortkey.h',
-          'unicode/stsearch.h',
-          'unicode/tblcoll.h',
-          'unicode/timezone.h',
-          'unicode/tmunit.h',
-          'unicode/tmutamt.h',
-          'unicode/tmutfmt.h',
-          'unicode/translit.h',
-          'unicode/tzrule.h',
-          'unicode/tztrans.h',
-          'unicode/ucal.h',
-          'unicode/ucoleitr.h',
-          'unicode/ucol.h',
-          'unicode/ucsdet.h',
-          'unicode/ucurr.h',
-          'unicode/udat.h',
-          'unicode/udatpg.h',
-          'unicode/uldnames.h',
-          'unicode/ulocdata.h',
-          'unicode/umsg.h',
-          'unicode/unirepl.h',
-          'unicode/unum.h',
-          'unicode/uregex.h',
-          'unicode/usearch.h',
-          'unicode/uspoof.h',
-          'unicode/utmscale.h',
-          'unicode/utrans.h',
-          'unicode/vtzone.h',
-        ],
-      },
-      'includes': [
-        '../../build/shim_headers.gypi',
-      ],
-    },
-    {
-      'target_name': 'icuuc',
-      'type': 'none',
-      'toolsets': ['host', 'target'],
-      'direct_dependent_settings': {
-        'cflags': [
-          '<!@(pkg-config --cflags icu-uc)',
-        ],
-        'defines': [
-          'U_USING_ICU_NAMESPACE=0',
-        ],
-      },
-      'link_settings': {
-        'ldflags': [
-          '<!@(pkg-config --libs-only-L --libs-only-other icu-uc)',
-        ],
-        'libraries': [
-          '<!@(pkg-config --libs-only-l icu-uc)',
-        ],
-      },
-      'variables': {
-        'headers_root_path': 'source/common',
-        'header_filenames': [
-          # This list can easily be updated using the command below:
-          # find third_party/icu/source/common/unicode -iname '*.h' \
-          # -printf "'%p',\n" | \
-          # sed -e 's|third_party/icu/source/common/||' | sort -u
-          'unicode/brkiter.h',
-          'unicode/bytestream.h',
-          'unicode/caniter.h',
-          'unicode/chariter.h',
-          'unicode/dbbi.h',
-          'unicode/docmain.h',
-          'unicode/dtintrv.h',
-          'unicode/errorcode.h',
-          'unicode/icudataver.h',
-          'unicode/icuplug.h',
-          'unicode/idna.h',
-          'unicode/localpointer.h',
-          'unicode/locid.h',
-          'unicode/normalizer2.h',
-          'unicode/normlzr.h',
-          'unicode/pandroid.h',
-          'unicode/parseerr.h',
-          'unicode/parsepos.h',
-          'unicode/pfreebsd.h',
-          'unicode/plinux.h',
-          'unicode/pmac.h',
-          'unicode/popenbsd.h',
-          'unicode/ppalmos.h',
-          'unicode/ptypes.h',
-          'unicode/putil.h',
-          'unicode/pwin32.h',
-          'unicode/rbbi.h',
-          'unicode/rep.h',
-          'unicode/resbund.h',
-          'unicode/schriter.h',
-          'unicode/std_string.h',
-          'unicode/strenum.h',
-          'unicode/stringpiece.h',
-          'unicode/symtable.h',
-          'unicode/ubidi.h',
-          'unicode/ubrk.h',
-          'unicode/ucasemap.h',
-          'unicode/ucat.h',
-          'unicode/uchar.h',
-          'unicode/uchriter.h',
-          'unicode/uclean.h',
-          'unicode/ucnv_cb.h',
-          'unicode/ucnv_err.h',
-          'unicode/ucnv.h',
-          'unicode/ucnvsel.h',
-          'unicode/uconfig.h',
-          'unicode/udata.h',
-          'unicode/udeprctd.h',
-          'unicode/udraft.h',
-          'unicode/uenum.h',
-          'unicode/uidna.h',
-          'unicode/uintrnal.h',
-          'unicode/uiter.h',
-          'unicode/uloc.h',
-          'unicode/umachine.h',
-          'unicode/umisc.h',
-          'unicode/unifilt.h',
-          'unicode/unifunct.h',
-          'unicode/unimatch.h',
-          'unicode/uniset.h',
-          'unicode/unistr.h',
-          'unicode/unorm2.h',
-          'unicode/unorm.h',
-          'unicode/uobject.h',
-          'unicode/uobslete.h',
-          'unicode/urename.h',
-          'unicode/urep.h',
-          'unicode/ures.h',
-          'unicode/uscript.h',
-          'unicode/uset.h',
-          'unicode/usetiter.h',
-          'unicode/ushape.h',
-          'unicode/usprep.h',
-          'unicode/ustring.h',
-          'unicode/usystem.h',
-          'unicode/utext.h',
-          'unicode/utf16.h',
-          'unicode/utf32.h',
-          'unicode/utf8.h',
-          'unicode/utf.h',
-          'unicode/utf_old.h',
-          'unicode/utrace.h',
-          'unicode/utypeinfo.h',
-          'unicode/utypes.h',
-          'unicode/uvernum.h',
-          'unicode/uversion.h',
-        ],
-      },
-      'includes': [
-        '../../build/shim_headers.gypi',
-      ],
-    },
-  ],
-}
diff --git a/build/linux/unbundle/jsoncpp.gyp b/build/linux/unbundle/jsoncpp.gyp
deleted file mode 100644
index c397f64..0000000
--- a/build/linux/unbundle/jsoncpp.gyp
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'jsoncpp',
-      'type': 'none',
-      'variables': {
-        'headers_root_path': 'source/include',
-        'header_filenames': [
-          'json/assertions.h',
-          'json/autolink.h',
-          'json/config.h',
-          'json/features.h',
-          'json/forwards.h',
-          'json/json.h',
-          'json/reader.h',
-          'json/value.h',
-          'json/writer.h',
-        ],
-      },
-      'includes': [
-        '../../build/shim_headers.gypi',
-      ],
-      'direct_dependent_settings': {
-        'include_dirs': [
-          '/usr/include/jsoncpp',
-        ],
-      },
-      'link_settings': {
-        'libraries': [
-          '-ljsoncpp',
-        ],
-      },
-    }
-  ],
-}
diff --git a/build/linux/unbundle/libXNVCtrl.gyp b/build/linux/unbundle/libXNVCtrl.gyp
deleted file mode 100644
index f076bdb..0000000
--- a/build/linux/unbundle/libXNVCtrl.gyp
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'libXNVCtrl',
-      'type': 'none',
-      'variables': {
-        'headers_root_path': '.',
-        'header_filenames': [
-          'NVCtrlLib.h',
-          'NVCtrl.h',
-        ],
-      },
-      'includes': [
-        '../../build/shim_headers.gypi',
-      ],
-      'direct_dependent_settings': {
-        'cflags': [
-            '<!@(pkg-config --cflags libXNVCtrl)',
-        ],
-      },
-      'link_settings': {
-        'ldflags': [
-          '<!@(pkg-config --libs-only-L --libs-only-other libXNVCtrl)',
-        ],
-        'libraries': [
-          '<!@(pkg-config --libs-only-l libXNVCtrl)',
-        ],
-      },
-    }
-  ],
-}
diff --git a/build/linux/unbundle/libevent.gyp b/build/linux/unbundle/libevent.gyp
deleted file mode 100644
index 99d7435..0000000
--- a/build/linux/unbundle/libevent.gyp
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'libevent',
-      'type': 'none',
-      'toolsets': ['host', 'target'],
-      'variables': {
-        'headers_root_path': '.',
-        'header_filenames': [
-          'event.h',
-        ],
-      },
-      'includes': [
-        '../../build/shim_headers.gypi',
-      ],
-      'link_settings': {
-        'libraries': [
-          '-levent',
-        ],
-      },
-    }
-  ],
-}
diff --git a/build/linux/unbundle/libjpeg.gyp b/build/linux/unbundle/libjpeg.gyp
deleted file mode 100644
index f56e7aa..0000000
--- a/build/linux/unbundle/libjpeg.gyp
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'libjpeg',
-      'type': 'none',
-      'direct_dependent_settings': {
-        'defines': [
-          'USE_SYSTEM_LIBJPEG',
-        ],
-        'conditions': [
-          ['os_bsd==1', {
-            'include_dirs': [
-              '/usr/local/include',
-            ],
-          }],
-        ],
-      },
-      'link_settings': {
-        'libraries': [
-          '-ljpeg',
-        ],
-      },
-    }
-  ],
-}
diff --git a/build/linux/unbundle/libpng.gyp b/build/linux/unbundle/libpng.gyp
deleted file mode 100644
index d6933fc..0000000
--- a/build/linux/unbundle/libpng.gyp
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'libpng',
-      'type': 'none',
-      'dependencies': [
-        '../zlib/zlib.gyp:zlib',
-      ],
-      'direct_dependent_settings': {
-        'cflags': [
-          '<!@(pkg-config --cflags libpng)',
-        ],
-      },
-      'link_settings': {
-        'ldflags': [
-          '<!@(pkg-config --libs-only-L --libs-only-other libpng)',
-        ],
-        'libraries': [
-          '<!@(pkg-config --libs-only-l libpng)',
-        ],
-      },
-      'variables': {
-        'headers_root_path': '.',
-        'header_filenames': [
-          'png.h',
-          'pngconf.h',
-        ],
-      },
-      'includes': [
-        '../../build/shim_headers.gypi',
-      ],
-    },
-  ],
-}
diff --git a/build/linux/unbundle/libusb.gyp b/build/linux/unbundle/libusb.gyp
deleted file mode 100644
index 1c18033..0000000
--- a/build/linux/unbundle/libusb.gyp
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'libusb',
-      'type': 'none',
-      'variables': {
-        'headers_root_path': 'src/libusb',
-        'header_filenames': [
-          'libusb.h',
-        ],
-      },
-      'includes': [
-        '../../build/shim_headers.gypi',
-      ],
-      'direct_dependent_settings': {
-        'cflags': [
-          '<!@(pkg-config --cflags libusb-1.0)',
-        ],
-        'link_settings': {
-          'ldflags': [
-            '<!@(pkg-config --libs-only-L --libs-only-other libusb-1.0)',
-          ],
-          'libraries': [
-            '<!@(pkg-config --libs-only-l libusb-1.0)',
-          ],
-        },
-      },
-    },
-  ],
-}
diff --git a/build/linux/unbundle/libvpx.gyp b/build/linux/unbundle/libvpx.gyp
deleted file mode 100644
index 75671c5..0000000
--- a/build/linux/unbundle/libvpx.gyp
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'targets': [
-    {
-      'target_name': 'libvpx',
-      'type': 'none',
-      'direct_dependent_settings': {
-        'cflags': [
-          '<!@(pkg-config --cflags vpx)',
-        ],
-      },
-      'variables': {
-        'headers_root_path': 'source/libvpx',
-        'header_filenames': [
-          'vpx/vp8.h',
-          'vpx/vp8cx.h',
-          'vpx/vp8dx.h',
-          'vpx/vpx_codec.h',
-          'vpx/vpx_codec_impl_bottom.h',
-          'vpx/vpx_codec_impl_top.h',
-          'vpx/vpx_decoder.h',
-          'vpx/vpx_encoder.h',
-          'vpx/vpx_frame_buffer.h',
-          'vpx/vpx_image.h',
-          'vpx/vpx_integer.h',
-        ],
-      },
-      'includes': [
-        '../../build/shim_headers.gypi',
-      ],
-      'link_settings': {
-        'ldflags': [
-          '<!@(pkg-config --libs-only-L --libs-only-other vpx)',
-        ],
-        'libraries': [
-          '<!@(pkg-config --libs-only-l vpx)',
-        ],
-      },
-    },
-  ],
-}
diff --git a/build/linux/unbundle/libwebp.gyp b/build/linux/unbundle/libwebp.gyp
deleted file mode 100644
index 6dbce2e..0000000
--- a/build/linux/unbundle/libwebp.gyp
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'libwebp',
-      'type': 'none',
-      'direct_dependent_settings': {
-        'defines': [
-          'ENABLE_WEBP',
-        ],
-      },
-      'link_settings': {
-        'libraries': [
-          # Check for presence of webpdemux library, use it if present.
-          '<!(python <(DEPTH)/tools/compile_test/compile_test.py '
-          '--code "int main() { return 0; }" '
-          '--run-linker '
-          '--on-success "-lwebp -lwebpdemux" '
-          '--on-failure "-lwebp" '
-          '-- -lwebpdemux)',
-        ],
-      },
-    }
-  ],
-}
diff --git a/build/linux/unbundle/libxml.gyp b/build/linux/unbundle/libxml.gyp
deleted file mode 100644
index bc4f9fc..0000000
--- a/build/linux/unbundle/libxml.gyp
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'libxml',
-      'type': 'static_library',
-      'sources': [
-        'chromium/libxml_utils.h',
-        'chromium/libxml_utils.cc',
-      ],
-      'cflags': [
-        '<!@(pkg-config --cflags libxml-2.0)',
-      ],
-      'defines': [
-        'USE_SYSTEM_LIBXML',
-      ],
-      'direct_dependent_settings': {
-        'cflags': [
-          '<!@(pkg-config --cflags libxml-2.0)',
-        ],
-        'defines': [
-          'USE_SYSTEM_LIBXML',
-        ],
-      },
-      'link_settings': {
-        'ldflags': [
-          '<!@(pkg-config --libs-only-L --libs-only-other libxml-2.0)',
-        ],
-        'libraries': [
-          '<!@(pkg-config --libs-only-l libxml-2.0)',
-        ],
-      },
-    },
-  ],
-}
diff --git a/build/linux/unbundle/libxslt.gyp b/build/linux/unbundle/libxslt.gyp
deleted file mode 100644
index f7f6bb9..0000000
--- a/build/linux/unbundle/libxslt.gyp
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'libxslt',
-      'type': 'none',
-      'direct_dependent_settings': {
-        'cflags': [
-          '<!@(pkg-config --cflags libxslt)',
-        ],
-      },
-      'link_settings': {
-        'ldflags': [
-          '<!@(pkg-config --libs-only-L --libs-only-other libxslt)',
-        ],
-        'libraries': [
-          '<!@(pkg-config --libs-only-l libxslt)',
-        ],
-      },
-    },
-  ],
-}
diff --git a/build/linux/unbundle/opus.gyp b/build/linux/unbundle/opus.gyp
deleted file mode 100644
index e8c30ba..0000000
--- a/build/linux/unbundle/opus.gyp
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'opus',
-      'type': 'none',
-      'direct_dependent_settings': {
-        'cflags': [
-          '<!@(pkg-config --cflags opus)',
-        ],
-      },
-      'variables': {
-        'headers_root_path': 'src/include',
-        'header_filenames': [
-          'opus_custom.h',
-          'opus_defines.h',
-          'opus_multistream.h',
-          'opus_types.h',
-          'opus.h',
-        ],
-      },
-      'includes': [
-        '../../build/shim_headers.gypi',
-      ],
-      'link_settings': {
-        'ldflags': [
-          '<!@(pkg-config --libs-only-L --libs-only-other opus)',
-        ],
-        'libraries': [
-          '<!@(pkg-config --libs-only-l opus)',
-        ],
-      },
-    },
-  ],
-}
diff --git a/build/linux/unbundle/protobuf.gyp b/build/linux/unbundle/protobuf.gyp
deleted file mode 100644
index 7bcd992..0000000
--- a/build/linux/unbundle/protobuf.gyp
+++ /dev/null
@@ -1,149 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'protobuf_lite',
-      'type': 'none',
-      'direct_dependent_settings': {
-        'cflags': [
-          # Use full protobuf, because vanilla protobuf doesn't have
-          # our custom patch to retain unknown fields in lite mode.
-          '<!@(pkg-config --cflags protobuf)',
-        ],
-        'defines': [
-          'USE_SYSTEM_PROTOBUF',
-
-          # This macro must be defined to suppress the use
-          # of dynamic_cast<>, which requires RTTI.
-          'GOOGLE_PROTOBUF_NO_RTTI',
-          'GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER',
-        ],
-      },
-      'link_settings': {
-        # Use full protobuf, because vanilla protobuf doesn't have
-        # our custom patch to retain unknown fields in lite mode.
-        'ldflags': [
-          '<!@(pkg-config --libs-only-L --libs-only-other protobuf)',
-        ],
-        'libraries': [
-          '<!@(pkg-config --libs-only-l protobuf)',
-        ],
-      },
-      'variables': {
-        'headers_root_path': 'src',
-        'header_filenames': [
-          # This list can easily be updated using the command below:
-          # find third_party/protobuf/src -iname '*.h' -printf "'%p',\n" | \
-          # sed -e 's|third_party/protobuf/src/||' | sort -u
-          'google/protobuf/compiler/code_generator.h',
-          'google/protobuf/compiler/command_line_interface.h',
-          'google/protobuf/compiler/cpp/cpp_enum_field.h',
-          'google/protobuf/compiler/cpp/cpp_enum.h',
-          'google/protobuf/compiler/cpp/cpp_extension.h',
-          'google/protobuf/compiler/cpp/cpp_field.h',
-          'google/protobuf/compiler/cpp/cpp_file.h',
-          'google/protobuf/compiler/cpp/cpp_generator.h',
-          'google/protobuf/compiler/cpp/cpp_helpers.h',
-          'google/protobuf/compiler/cpp/cpp_message_field.h',
-          'google/protobuf/compiler/cpp/cpp_message.h',
-          'google/protobuf/compiler/cpp/cpp_options.h',
-          'google/protobuf/compiler/cpp/cpp_primitive_field.h',
-          'google/protobuf/compiler/cpp/cpp_service.h',
-          'google/protobuf/compiler/cpp/cpp_string_field.h',
-          'google/protobuf/compiler/cpp/cpp_unittest.h',
-          'google/protobuf/compiler/importer.h',
-          'google/protobuf/compiler/java/java_doc_comment.h',
-          'google/protobuf/compiler/java/java_enum_field.h',
-          'google/protobuf/compiler/java/java_enum.h',
-          'google/protobuf/compiler/java/java_extension.h',
-          'google/protobuf/compiler/java/java_field.h',
-          'google/protobuf/compiler/java/java_file.h',
-          'google/protobuf/compiler/java/java_generator.h',
-          'google/protobuf/compiler/java/java_helpers.h',
-          'google/protobuf/compiler/java/java_message_field.h',
-          'google/protobuf/compiler/java/java_message.h',
-          'google/protobuf/compiler/java/java_primitive_field.h',
-          'google/protobuf/compiler/java/java_service.h',
-          'google/protobuf/compiler/java/java_string_field.h',
-          'google/protobuf/compiler/mock_code_generator.h',
-          'google/protobuf/compiler/package_info.h',
-          'google/protobuf/compiler/parser.h',
-          'google/protobuf/compiler/plugin.h',
-          'google/protobuf/compiler/plugin.pb.h',
-          'google/protobuf/compiler/python/python_generator.h',
-          'google/protobuf/compiler/subprocess.h',
-          'google/protobuf/compiler/zip_writer.h',
-          'google/protobuf/descriptor_database.h',
-          'google/protobuf/descriptor.h',
-          'google/protobuf/descriptor.pb.h',
-          'google/protobuf/dynamic_message.h',
-          'google/protobuf/extension_set.h',
-          'google/protobuf/generated_enum_reflection.h',
-          'google/protobuf/generated_message_reflection.h',
-          'google/protobuf/generated_message_util.h',
-          'google/protobuf/io/coded_stream.h',
-          'google/protobuf/io/coded_stream_inl.h',
-          'google/protobuf/io/gzip_stream.h',
-          'google/protobuf/io/package_info.h',
-          'google/protobuf/io/printer.h',
-          'google/protobuf/io/tokenizer.h',
-          'google/protobuf/io/zero_copy_stream.h',
-          'google/protobuf/io/zero_copy_stream_impl.h',
-          'google/protobuf/io/zero_copy_stream_impl_lite.h',
-          'google/protobuf/message.h',
-          'google/protobuf/message_lite.h',
-          'google/protobuf/package_info.h',
-          'google/protobuf/reflection_ops.h',
-          'google/protobuf/repeated_field.h',
-          'google/protobuf/service.h',
-          'google/protobuf/stubs/atomicops.h',
-          'google/protobuf/stubs/atomicops_internals_arm64_gcc.h',
-          'google/protobuf/stubs/atomicops_internals_arm_gcc.h',
-          'google/protobuf/stubs/atomicops_internals_arm_qnx.h',
-          'google/protobuf/stubs/atomicops_internals_atomicword_compat.h',
-          'google/protobuf/stubs/atomicops_internals_macosx.h',
-          'google/protobuf/stubs/atomicops_internals_mips_gcc.h',
-          'google/protobuf/stubs/atomicops_internals_pnacl.h',
-          'google/protobuf/stubs/atomicops_internals_tsan.h',
-          'google/protobuf/stubs/atomicops_internals_x86_gcc.h',
-          'google/protobuf/stubs/atomicops_internals_x86_msvc.h',
-          'google/protobuf/stubs/common.h',
-          'google/protobuf/stubs/hash.h',
-          'google/protobuf/stubs/map-util.h',
-          'google/protobuf/stubs/once.h',
-          'google/protobuf/stubs/platform_macros.h',
-          'google/protobuf/stubs/stl_util.h',
-          'google/protobuf/stubs/stringprintf.h',
-          'google/protobuf/stubs/strutil.h',
-          'google/protobuf/stubs/substitute.h',
-          'google/protobuf/stubs/template_util.h',
-          'google/protobuf/stubs/type_traits.h',
-          'google/protobuf/testing/file.h',
-          'google/protobuf/testing/googletest.h',
-          'google/protobuf/test_util.h',
-          'google/protobuf/test_util_lite.h',
-          'google/protobuf/text_format.h',
-          'google/protobuf/unknown_field_set.h',
-          'google/protobuf/wire_format.h',
-          'google/protobuf/wire_format_lite.h',
-          'google/protobuf/wire_format_lite_inl.h',
-        ],
-      },
-      'includes': [
-        '../../build/shim_headers.gypi',
-      ],
-    },
-    {
-      'target_name': 'protoc',
-      'type': 'none',
-      'toolsets': ['host', 'target'],
-    },
-    {
-      'target_name': 'py_proto',
-      'type': 'none',
-    },
-  ],
-}
diff --git a/build/linux/unbundle/re2.gyp b/build/linux/unbundle/re2.gyp
deleted file mode 100644
index e2e567a..0000000
--- a/build/linux/unbundle/re2.gyp
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 're2',
-      'type': 'none',
-      'variables': {
-        'headers_root_path': '.',
-        'header_filenames': [
-          're2/filtered_re2.h',
-          're2/re2.h',
-          're2/set.h',
-          're2/stringpiece.h',
-          're2/variadic_function.h',
-        ],
-        'shim_generator_additional_args': [
-          # Chromium copy of re2 is patched to rename POSIX to POSIX_SYNTAX
-          # because of collision issues that break the build.
-          # Upstream refuses to make changes:
-          # http://code.google.com/p/re2/issues/detail?id=73 .
-          '--define', 'POSIX=POSIX_SYNTAX',
-        ],
-      },
-      'includes': [
-        '../../build/shim_headers.gypi',
-      ],
-      'link_settings': {
-        'libraries': [
-          '-lre2',
-        ],
-      },
-    }
-  ],
-}
diff --git a/build/linux/unbundle/remove_bundled_libraries.py b/build/linux/unbundle/remove_bundled_libraries.py
deleted file mode 100755
index 69e76f5..0000000
--- a/build/linux/unbundle/remove_bundled_libraries.py
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-Removes bundled libraries to make sure they are not used.
-
-See README for more details.
-"""
-
-
-import optparse
-import os.path
-import sys
-
-
-def DoMain(argv):
-  my_dirname = os.path.abspath(os.path.dirname(__file__))
-  source_tree_root = os.path.abspath(
-    os.path.join(my_dirname, '..', '..', '..'))
-
-  if os.path.join(source_tree_root, 'build', 'linux', 'unbundle') != my_dirname:
-    print ('Sanity check failed: please run this script from ' +
-           'build/linux/unbundle directory.')
-    return 1
-
-  parser = optparse.OptionParser()
-  parser.add_option('--do-remove', action='store_true')
-
-  options, args = parser.parse_args(argv)
-
-  exclusion_used = {}
-  for exclusion in args:
-    exclusion_used[exclusion] = False
-
-  for root, dirs, files in os.walk(source_tree_root, topdown=False):
-    # Only look at paths which contain a "third_party" component
-    # (note that e.g. third_party.png doesn't count).
-    root_relpath = os.path.relpath(root, source_tree_root)
-    if 'third_party' not in root_relpath.split(os.sep):
-      continue
-
-    for f in files:
-      path = os.path.join(root, f)
-      relpath = os.path.relpath(path, source_tree_root)
-
-      excluded = False
-      for exclusion in args:
-        # Require precise exclusions. Find the right-most third_party
-        # in the relative path, and if there is more than one ignore
-        # the exclusion if it's completely contained within the part
-        # before right-most third_party path component.
-        split = relpath.rsplit(os.sep + 'third_party' + os.sep, 1)
-        if len(split) > 1 and split[0].startswith(exclusion):
-          continue
-
-        if relpath.startswith(exclusion):
-          # Multiple exclusions can match the same path. Go through all of them
-          # and mark each one as used.
-          exclusion_used[exclusion] = True
-          excluded = True
-      if excluded:
-        continue
-
-      # Deleting gyp files almost always leads to gyp failures.
-      # These files come from Chromium project, and can be replaced if needed.
-      if f.endswith('.gyp') or f.endswith('.gypi'):
-        continue
-
-      # Deleting .isolate files leads to gyp failures. They are usually
-      # not used by a distro build anyway.
-      # See http://www.chromium.org/developers/testing/isolated-testing
-      # for more info.
-      if f.endswith('.isolate'):
-        continue
-
-      if options.do_remove:
-        # Delete the file - best way to ensure it's not used during build.
-        os.remove(path)
-      else:
-        # By default just print paths that would be removed.
-        print path
-
-  exit_code = 0
-
-  # Fail if exclusion list contains stale entries - this helps keep it
-  # up to date.
-  for exclusion, used in exclusion_used.iteritems():
-    if not used:
-      print '%s does not exist' % exclusion
-      exit_code = 1
-
-  if not options.do_remove:
-    print ('To actually remove files printed above, please pass ' +
-           '--do-remove flag.')
-
-  return exit_code
-
-
-if __name__ == '__main__':
-  sys.exit(DoMain(sys.argv[1:]))
diff --git a/build/linux/unbundle/replace_gyp_files.py b/build/linux/unbundle/replace_gyp_files.py
deleted file mode 100755
index d06ae41..0000000
--- a/build/linux/unbundle/replace_gyp_files.py
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-Replaces gyp files in tree with files from here that
-make the build use system libraries.
-"""
-
-
-import optparse
-import os.path
-import shutil
-import sys
-
-
-REPLACEMENTS = {
-  'use_system_expat': 'third_party/expat/expat.gyp',
-  'use_system_ffmpeg': 'third_party/ffmpeg/ffmpeg.gyp',
-  'use_system_flac': 'third_party/flac/flac.gyp',
-  'use_system_harfbuzz': 'third_party/harfbuzz-ng/harfbuzz.gyp',
-  'use_system_icu': 'third_party/icu/icu.gyp',
-  'use_system_jsoncpp': 'third_party/jsoncpp/jsoncpp.gyp',
-  'use_system_libevent': 'third_party/libevent/libevent.gyp',
-  'use_system_libjpeg': 'third_party/libjpeg/libjpeg.gyp',
-  'use_system_libpng': 'third_party/libpng/libpng.gyp',
-  'use_system_libusb': 'third_party/libusb/libusb.gyp',
-  'use_system_libvpx': 'third_party/libvpx/libvpx.gyp',
-  'use_system_libwebp': 'third_party/libwebp/libwebp.gyp',
-  'use_system_libxml': 'third_party/libxml/libxml.gyp',
-  'use_system_libxnvctrl' : 'third_party/libXNVCtrl/libXNVCtrl.gyp',
-  'use_system_libxslt': 'third_party/libxslt/libxslt.gyp',
-  'use_system_opus': 'third_party/opus/opus.gyp',
-  'use_system_protobuf': 'third_party/protobuf/protobuf.gyp',
-  'use_system_re2': 'third_party/re2/re2.gyp',
-  'use_system_snappy': 'third_party/snappy/snappy.gyp',
-  'use_system_speex': 'third_party/speex/speex.gyp',
-  'use_system_sqlite': 'third_party/sqlite/sqlite.gyp',
-  'use_system_v8': 'v8/tools/gyp/v8.gyp',
-  'use_system_zlib': 'third_party/zlib/zlib.gyp',
-}
-
-
-def DoMain(argv):
-  my_dirname = os.path.dirname(__file__)
-  source_tree_root = os.path.abspath(
-    os.path.join(my_dirname, '..', '..', '..'))
-
-  parser = optparse.OptionParser()
-
-  # Accept arguments in gyp command-line syntax, so that the caller can re-use
-  # command-line for this script and gyp.
-  parser.add_option('-D', dest='defines', action='append')
-
-  parser.add_option('--undo', action='store_true')
-
-  options, args = parser.parse_args(argv)
-
-  for flag, path in REPLACEMENTS.items():
-    if '%s=1' % flag not in options.defines:
-      continue
-
-    if options.undo:
-      # Restore original file, and also remove the backup.
-      # This is meant to restore the source tree to its original state.
-      os.rename(os.path.join(source_tree_root, path + '.orig'),
-                os.path.join(source_tree_root, path))
-    else:
-      # Create a backup copy for --undo.
-      shutil.copyfile(os.path.join(source_tree_root, path),
-                      os.path.join(source_tree_root, path + '.orig'))
-
-      # Copy the gyp file from directory of this script to target path.
-      shutil.copyfile(os.path.join(my_dirname, os.path.basename(path)),
-                      os.path.join(source_tree_root, path))
-
-  return 0
-
-
-if __name__ == '__main__':
-  sys.exit(DoMain(sys.argv))
diff --git a/build/linux/unbundle/snappy.gyp b/build/linux/unbundle/snappy.gyp
deleted file mode 100644
index ab856ed..0000000
--- a/build/linux/unbundle/snappy.gyp
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'snappy',
-      'type': 'none',
-      'variables': {
-        'headers_root_path': 'src',
-        'header_filenames': [
-          'snappy-c.h',
-          'snappy-sinksource.h',
-          'snappy-stubs-public.h',
-          'snappy.h',
-        ],
-      },
-      'includes': [
-        '../../build/shim_headers.gypi',
-      ],
-      'link_settings': {
-        'libraries': [
-          '-lsnappy',
-        ],
-      },
-    },
-  ],
-}
diff --git a/build/linux/unbundle/speex.gyp b/build/linux/unbundle/speex.gyp
deleted file mode 100644
index 75376c8..0000000
--- a/build/linux/unbundle/speex.gyp
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'libspeex',
-      'type': 'none',
-      'variables': {
-        'headers_root_path': 'include',
-        'header_filenames': [
-          'speex/speex_types.h',
-          'speex/speex_callbacks.h',
-          'speex/speex_config_types.h',
-          'speex/speex_stereo.h',
-          'speex/speex_echo.h',
-          'speex/speex_preprocess.h',
-          'speex/speex_jitter.h',
-          'speex/speex.h',
-          'speex/speex_resampler.h',
-          'speex/speex_buffer.h',
-          'speex/speex_header.h',
-          'speex/speex_bits.h',
-        ],
-      },
-      'includes': [
-        '../../build/shim_headers.gypi',
-      ],
-      'direct_dependent_settings': {
-        'cflags': [
-          '<!@(pkg-config --cflags speex)',
-        ],
-      },
-      'link_settings': {
-        'ldflags': [
-          '<!@(pkg-config --libs-only-L --libs-only-other speex)',
-        ],
-        'libraries': [
-          '<!@(pkg-config --libs-only-l speex)',
-        ],
-      },
-    },
-  ],
-}
diff --git a/build/linux/unbundle/sqlite.gyp b/build/linux/unbundle/sqlite.gyp
deleted file mode 100644
index 918da928..0000000
--- a/build/linux/unbundle/sqlite.gyp
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'sqlite',
-      'type': 'none',
-      'direct_dependent_settings': {
-        'cflags': [
-          '<!@(pkg-config --cflags sqlite3)',
-        ],
-        'defines': [
-          'USE_SYSTEM_SQLITE',
-        ],
-      },
-      'link_settings': {
-        'ldflags': [
-          '<!@(pkg-config --libs-only-L --libs-only-other sqlite3)',
-        ],
-        'libraries': [
-          '<!@(pkg-config --libs-only-l sqlite3)',
-        ],
-      },
-    },
-  ],
-}
diff --git a/build/linux/unbundle/v8.gyp b/build/linux/unbundle/v8.gyp
deleted file mode 100644
index 9b06347..0000000
--- a/build/linux/unbundle/v8.gyp
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright 2013 the V8 project authors. All rights reserved.
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-#       notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-#       copyright notice, this list of conditions and the following
-#       disclaimer in the documentation and/or other materials provided
-#       with the distribution.
-#     * Neither the name of Google Inc. nor the names of its
-#       contributors may be used to endorse or promote products derived
-#       from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
-  'includes': ['../../build/toolchain.gypi', '../../build/features.gypi'],
-  'targets': [
-    {
-      'target_name': 'v8',
-      'type': 'none',
-      'toolsets': ['host', 'target'],
-      'variables': {
-        'headers_root_path': '../../include',
-        'header_filenames': [
-          'v8-debug.h',
-          'v8-preparser.h',
-          'v8-profiler.h',
-          'v8-testing.h',
-          'v8.h',
-          'v8stdint.h',
-        ],
-      },
-      'includes': [
-        '../../../build/shim_headers.gypi',
-      ],
-      'link_settings': {
-        'libraries': [
-          '-lv8',
-        ],
-      },
-    },
-    {
-      'target_name': 'v8_shell',
-      'type': 'none',
-      'toolsets': ['host', 'target'],
-      'dependencies': [
-        'v8'
-      ],
-    },
-  ],
-}
diff --git a/build/linux/unbundle/zlib.gyp b/build/linux/unbundle/zlib.gyp
deleted file mode 100644
index 0a85ff0..0000000
--- a/build/linux/unbundle/zlib.gyp
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'zlib',
-      'type': 'none',
-      'variables': {
-        'headers_root_path': '.',
-        'header_filenames': [
-          'zlib.h',
-        ],
-      },
-      'includes': [
-        '../../build/shim_headers.gypi',
-      ],
-      'direct_dependent_settings': {
-        'defines': [
-          'USE_SYSTEM_ZLIB',
-        ],
-      },
-      'link_settings': {
-        'libraries': [
-          '-lz',
-        ],
-      },
-    },
-    {
-      'target_name': 'minizip',
-      'type': 'static_library',
-      'all_dependent_settings': {
-        'defines': [
-          'USE_SYSTEM_MINIZIP',
-        ],
-      },
-      'defines': [
-        'USE_SYSTEM_MINIZIP',
-      ],
-      'link_settings': {
-        'libraries': [
-          '-lminizip',
-        ],
-      },
-    },
-    {
-      'target_name': 'zip',
-      'type': 'static_library',
-      'dependencies': [
-        'minizip',
-        '../../base/base.gyp:base',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [
-        'google/zip.cc',
-        'google/zip.h',
-        'google/zip_internal.cc',
-        'google/zip_internal.h',
-        'google/zip_reader.cc',
-        'google/zip_reader.h',
-      ],
-    },
-  ],
-}
diff --git a/build/ls.py b/build/ls.py
deleted file mode 100755
index 638c3bd..0000000
--- a/build/ls.py
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/python
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Recursively list files of the target directory. Ignores dot files."""
-
-import argparse
-import os
-import sys
-
-def main(target_directory):
-  for root, dirs, files in os.walk(target_directory):
-    files = [f for f in files if not f[0] == '.']
-    dirs[:] = [d for d in dirs if not d[0] == '.']
-    for f in files:
-      path = os.path.join(root, f)
-      print path
-
-if __name__ == '__main__':
-  parser = argparse.ArgumentParser(
-      description="Recursively list files of the target directory")
-  parser.add_argument("--target-directory",
-                      dest="target_directory",
-                      metavar="<target-directory>",
-                      type=str,
-                      required=True,
-                      help="The target directory")
-
-  args = parser.parse_args()
-  sys.exit(main(args.target_directory))
diff --git a/build/nocompile.gypi b/build/nocompile.gypi
deleted file mode 100644
index 8c0f288..0000000
--- a/build/nocompile.gypi
+++ /dev/null
@@ -1,96 +0,0 @@
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into an target to create a unittest that
-# invokes a set of no-compile tests.  A no-compile test is a test that asserts
-# a particular construct will not compile.
-#
-# Also see:
-#   http://dev.chromium.org/developers/testing/no-compile-tests
-#
-# To use this, create a gyp target with the following form:
-# {
-#   'target_name': 'my_module_nc_unittests',
-#   'type': 'executable',
-#   'sources': [
-#     'nc_testset_1.nc',
-#     'nc_testset_2.nc',
-#   ],
-#   'includes': ['path/to/this/gypi/file'],
-# }
-#
-# The .nc files are C++ files that contain code we wish to assert will not
-# compile.  Each individual test case in the file should be put in its own
-# #ifdef section.  The expected output should be appended with a C++-style
-# comment that has a python list of regular expressions.  This will likely
-# be greater than 80-characters. Giving a solid expected output test is
-# important so that random compile failures do not cause the test to pass.
-#
-# Example .nc file:
-#
-#   #if defined(TEST_NEEDS_SEMICOLON)  // [r"expected ',' or ';' at end of input"]
-#
-#   int a = 1
-#
-#   #elif defined(TEST_NEEDS_CAST)  // [r"invalid conversion from 'void*' to 'char*'"]
-#
-#   void* a = NULL;
-#   char* b = a;
-#
-#   #endif
-#
-# If we needed disable TEST_NEEDS_SEMICOLON, then change the define to:
-#
-#   DISABLE_TEST_NEEDS_SEMICOLON
-#   TEST_NEEDS_CAST
-#
-# The lines above are parsed by a regexp so avoid getting creative with the
-# formatting or ifdef logic; it will likely just not work.
-#
-# Implementation notes:
-# The .nc files are actually processed by a python script which executes the
-# compiler and generates a .cc file that is empty on success, or will have a
-# series of #error lines on failure, and a set of trivially passing gunit
-# TEST() functions on success. This allows us to fail at the compile step when
-# something goes wrong, and know during the unittest run that the test was at
-# least processed when things go right.
-
-{
-  # TODO(awong): Disabled until http://crbug.com/105388 is resolved.
-  'sources/': [['exclude', '\\.nc$']],
-  'conditions': [
-    [ 'OS!="win" and clang==1', {
-      'rules': [
-        {
-          'variables': {
-            'nocompile_driver': '<(DEPTH)/tools/nocompile_driver.py',
-            'nc_result_path': ('<(INTERMEDIATE_DIR)/<(module_dir)/'
-                               '<(RULE_INPUT_ROOT)_nc.cc'),
-           },
-          'rule_name': 'run_nocompile',
-          'extension': 'nc',
-          'inputs': [
-            '<(nocompile_driver)',
-          ],
-          'outputs': [
-            '<(nc_result_path)'
-          ],
-          'action': [
-            'python',
-            '<(nocompile_driver)',
-            '4', # number of compilers to invoke in parallel.
-            '<(RULE_INPUT_PATH)',
-            '-Wall -Werror -Wfatal-errors -I<(DEPTH)',
-            '<(nc_result_path)',
-            ],
-          'message': 'Generating no compile results for <(RULE_INPUT_PATH)',
-          'process_outputs_as_sources': 1,
-        },
-      ],
-    }, {
-      'sources/': [['exclude', '\\.nc$']]
-    }],  # 'OS!="win" and clang=="1"'
-  ],
-}
-
diff --git a/build/output_dll_copy.rules b/build/output_dll_copy.rules
deleted file mode 100644
index c6e9051..0000000
--- a/build/output_dll_copy.rules
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<VisualStudioToolFile
-	Name="Output DLL copy"
-	Version="8.00"
-	>
-	<Rules>
-		<CustomBuildRule
-			Name="Output DLL copy"
-			CommandLine="xcopy /R /C /Y $(InputPath) $(OutDir)"
-			Outputs="$(OutDir)\$(InputFileName)"
-			FileExtensions="*.dll"
-			>
-			<Properties>
-			</Properties>
-		</CustomBuildRule>
-	</Rules>
-</VisualStudioToolFile>
diff --git a/build/prebuilt_dart_sdk.gni b/build/prebuilt_dart_sdk.gni
new file mode 100644
index 0000000..1a3299a
--- /dev/null
+++ b/build/prebuilt_dart_sdk.gni
@@ -0,0 +1,18 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for 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("executable_suffix.gni")
+
+_dart_root = rebase_path("..")
+
+_prebuilt_dart_exe = "$_dart_root/tools/sdks/$host_os/dart-sdk/bin/dart"
+
+# Our gn_run_binary swallows output unless there is an error.
+_prebuilt_dart_exe_trial = exec_script("gn_run_binary.py",
+    ["exec_script", _prebuilt_dart_exe, "--version"], "string")
+if (_prebuilt_dart_exe_trial == "") {
+  prebuilt_dart_exe_works = true
+} else {
+  prebuilt_dart_exe_works = false
+}
diff --git a/build/precompile.cc b/build/precompile.cc
deleted file mode 100644
index db1ef6d..0000000
--- a/build/precompile.cc
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Precompiled header generator for Windows builds. No include is needed
-// in this file as the PCH include is forced via the "Forced Include File"
-// flag in the projects generated by GYP.
diff --git a/build/precompile.h b/build/precompile.h
deleted file mode 100644
index 32c2f11..0000000
--- a/build/precompile.h
+++ /dev/null
@@ -1,109 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Precompiled header for Chromium project on Windows, not used by
-// other build configurations. Using precompiled headers speeds the
-// build up significantly, around 1/4th on VS 2010 on an HP Z600 with 12
-// GB of memory.
-//
-// Numeric comments beside includes are the number of times they were
-// included under src/chrome/browser on 2011/8/20, which was used as a
-// baseline for deciding what to include in the PCH. Includes without
-// a numeric comment are generally included at least 5 times. It may
-// be possible to tweak the speed of the build by commenting out or
-// removing some of the less frequently used headers.
-
-#if defined(BUILD_PRECOMPILE_H_)
-#error You shouldn't include the precompiled header file more than once.
-#endif
-
-#define BUILD_PRECOMPILE_H_
-
-#define _USE_MATH_DEFINES
-
-// The Windows header needs to come before almost all the other
-// Windows-specific headers.
-#include <Windows.h>
-#include <dwmapi.h>
-#include <shellapi.h>
-#include <wtypes.h>  // 2
-
-// Defines in atlbase.h cause conflicts; if we could figure out how
-// this family of headers can be included in the PCH, it might speed
-// up the build as several of them are used frequently.
-/*
-#include <atlbase.h>
-#include <atlapp.h>
-#include <atlcom.h>
-#include <atlcrack.h>  // 2
-#include <atlctrls.h>  // 2
-#include <atlmisc.h>  // 2
-#include <atlsafe.h>  // 1
-#include <atltheme.h>  // 1
-#include <atlwin.h>  // 2
-*/
-
-// Objbase.h and other files that rely on it bring in [ #define
-// interface struct ] which can cause problems in a multi-platform
-// build like Chrome's. #undef-ing it does not work as there are
-// currently 118 targets that break if we do this, so leaving out of
-// the precompiled header for now.
-//#include <commctrl.h>  // 2
-//#include <commdlg.h>  // 3
-//#include <cryptuiapi.h>  // 2
-//#include <Objbase.h>  // 2
-//#include <objidl.h>  // 1
-//#include <ole2.h>  // 1
-//#include <oleacc.h>  // 2
-//#include <oleauto.h>  // 1
-//#include <oleidl.h>  // 1
-//#include <propkey.h>  // 2
-//#include <propvarutil.h>  // 2
-//#include <pstore.h>  // 2
-//#include <shlguid.h>  // 1
-//#include <shlwapi.h>  // 1
-//#include <shobjidl.h>  // 4
-//#include <urlhist.h>  // 2
-
-// Caused other conflicts in addition to the 'interface' issue above.
-// #include <shlobj.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <limits.h>  // 4
-#include <math.h>
-#include <memory.h>  // 1
-#include <signal.h>
-#include <stdarg.h>  // 1
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>  // 4
-
-#include <algorithm>
-#include <bitset>  // 3
-#include <cmath>
-#include <cstddef>
-#include <cstdio>  // 3
-#include <cstdlib>  // 2
-#include <cstring>
-#include <deque>
-#include <fstream>  // 3
-#include <functional>
-#include <iomanip>  // 2
-#include <iosfwd>  // 2
-#include <iterator>
-#include <limits>
-#include <list>
-#include <map>
-#include <numeric>  // 2
-#include <ostream>
-#include <queue>
-#include <set>
-#include <sstream>
-#include <stack>
-#include <string>
-#include <utility>
-#include <vector>
diff --git a/build/protoc.gypi b/build/protoc.gypi
deleted file mode 100644
index fafdf9d..0000000
--- a/build/protoc.gypi
+++ /dev/null
@@ -1,123 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into a target to provide a rule
-# to invoke protoc in a consistent manner. For Java-targets, see
-# protoc_java.gypi.
-#
-# To use this, create a gyp target with the following form:
-# {
-#   'target_name': 'my_proto_lib',
-#   'type': 'static_library',
-#   'sources': [
-#     'foo.proto',
-#     'bar.proto',
-#   ],
-#   'variables': {
-#     # Optional, see below: 'proto_in_dir': '.'
-#     'proto_out_dir': 'dir/for/my_proto_lib'
-#   },
-#   'includes': ['path/to/this/gypi/file'],
-# }
-# If necessary, you may add normal .cc files to the sources list or other gyp
-# dependencies.  The proto headers are guaranteed to be generated before any
-# source files, even within this target, are compiled.
-#
-# The 'proto_in_dir' variable must be the relative path to the
-# directory containing the .proto files.  If left out, it defaults to '.'.
-#
-# The 'proto_out_dir' variable specifies the path suffix that output
-# files are generated under.  Targets that gyp-depend on my_proto_lib
-# will be able to include the resulting proto headers with an include
-# like:
-#   #include "dir/for/my_proto_lib/foo.pb.h"
-#
-# If you need to add an EXPORT macro to a protobuf's c++ header, set the
-# 'cc_generator_options' variable with the value: 'dllexport_decl=FOO_EXPORT:'
-# e.g. 'dllexport_decl=BASE_EXPORT:'
-#
-# It is likely you also need to #include a file for the above EXPORT macro to
-# work. You can do so with the 'cc_include' variable.
-# e.g. 'base/base_export.h'
-#
-# Implementation notes:
-# A proto_out_dir of foo/bar produces
-#   <(SHARED_INTERMEDIATE_DIR)/protoc_out/foo/bar/{file1,file2}.pb.{cc,h}
-#   <(SHARED_INTERMEDIATE_DIR)/pyproto/foo/bar/{file1,file2}_pb2.py
-
-{
-  'variables': {
-    'protoc_wrapper': '<(DEPTH)/tools/protoc_wrapper/protoc_wrapper.py',
-    'cc_dir': '<(SHARED_INTERMEDIATE_DIR)/protoc_out/<(proto_out_dir)',
-    'py_dir': '<(PRODUCT_DIR)/pyproto/<(proto_out_dir)',
-    'cc_generator_options%': '',
-    'cc_include%': '',
-    'proto_in_dir%': '.',
-    'conditions': [
-      ['use_system_protobuf==0', {
-        'protoc': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)',
-      }, { # use_system_protobuf==1
-        'protoc': '<!(which protoc)',
-      }],
-    ],
-  },
-  'rules': [
-    {
-      'rule_name': 'genproto',
-      'extension': 'proto',
-      'inputs': [
-        '<(protoc_wrapper)',
-        '<(protoc)',
-      ],
-      'outputs': [
-        '<(py_dir)/<(RULE_INPUT_ROOT)_pb2.py',
-        '<(cc_dir)/<(RULE_INPUT_ROOT).pb.cc',
-        '<(cc_dir)/<(RULE_INPUT_ROOT).pb.h',
-      ],
-      'action': [
-        'python',
-        '<(protoc_wrapper)',
-        '--include',
-        '<(cc_include)',
-        '--protobuf',
-        '<(cc_dir)/<(RULE_INPUT_ROOT).pb.h',
-        # Using the --arg val form (instead of --arg=val) allows gyp's msvs rule
-        # generation to correct 'val' which is a path.
-        '--proto-in-dir','<(proto_in_dir)',
-        # Naively you'd use <(RULE_INPUT_PATH) here, but protoc requires
-        # --proto_path is a strict prefix of the path given as an argument.
-        '--proto-in-file','<(RULE_INPUT_ROOT)<(RULE_INPUT_EXT)',
-        '--use-system-protobuf=<(use_system_protobuf)',
-        '--',
-        '<(protoc)',
-        '--cpp_out', '<(cc_generator_options)<(cc_dir)',
-        '--python_out', '<(py_dir)',
-      ],
-      'message': 'Generating C++ and Python code from <(RULE_INPUT_PATH)',
-      'process_outputs_as_sources': 1,
-    },
-  ],
-  'dependencies': [
-    '<(DEPTH)/third_party/protobuf/protobuf.gyp:protoc#host',
-    '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite',
-  ],
-  'include_dirs': [
-    '<(SHARED_INTERMEDIATE_DIR)/protoc_out',
-    '<(DEPTH)',
-  ],
-  'direct_dependent_settings': {
-    'include_dirs': [
-      '<(SHARED_INTERMEDIATE_DIR)/protoc_out',
-      '<(DEPTH)',
-    ]
-  },
-  'export_dependent_settings': [
-    # The generated headers reference headers within protobuf_lite,
-    # so dependencies must be able to find those headers too.
-    '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite',
-  ],
-  # This target exports a hard dependency because it generates header
-  # files.
-  'hard_dependency': 1,
-}
diff --git a/build/protoc_java.gypi b/build/protoc_java.gypi
deleted file mode 100644
index 6fd80d85..0000000
--- a/build/protoc_java.gypi
+++ /dev/null
@@ -1,83 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into a target to provide a rule
-# to invoke protoc in a consistent manner. This is only to be included
-# for Java targets. When including this file, a .jar-file will be generated.
-# For other targets, see protoc.gypi.
-#
-# To use this, create a gyp target with the following form:
-# {
-#   'target_name': 'my_proto_lib',
-#   'sources': [
-#     'foo.proto',
-#     'bar.proto',
-#   ],
-#   'variables': {
-#     'proto_in_dir': '.'
-#   },
-#   'includes': ['path/to/this/gypi/file'],
-# }
-#
-# The 'proto_in_dir' variable must be the relative path to the
-# directory containing the .proto files.  If left out, it defaults to '.'.
-#
-# The 'output_java_files' variable specifies a list of output files that will
-# be generated. It is based on the package and java_outer_classname fields in
-# the proto. All the values must be prefixed with >(java_out_dir), since that
-# is the root directory of all the output.
-#
-# Implementation notes:
-# A target_name of foo and proto-specified 'package' java.package.path produces:
-#   <(PRODUCT_DIR)/java_proto/foo/{java/package/path/}{Foo,Bar}.java
-# where Foo and Bar are taken from 'java_outer_classname' of the protos.
-#
-# How the .jar-file is created is different than how protoc is used for other
-# targets, and as such, this lives in its own file.
-
-{
-  'variables': {
-    'protoc': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)android_protoc<(EXECUTABLE_SUFFIX)',
-    'java_out_dir': '<(PRODUCT_DIR)/java_proto/<(_target_name)/src',
-    'proto_in_dir%': '.',
-    'stamp_file': '<(java_out_dir).stamp',
-    'script': '<(DEPTH)/build/protoc_java.py',
-
-    # The rest of the variables here are for the java.gypi include.
-    'java_in_dir': '<(DEPTH)/build/android/empty',
-    'generated_src_dirs': ['<(java_out_dir)'],
-    # Adding the |stamp_file| to |additional_input_paths| makes the actions in
-    # the include of java.gypi depend on the genproto_java action.
-    'additional_input_paths': ['<(stamp_file)'],
-    'run_findbugs': 0,
-  },
-  'actions': [
-    {
-      'action_name': 'genproto_java',
-      'inputs': [
-        '<(script)',
-        '<(protoc)',
-        '<@(_sources)',
-      ],
-      # We do not know the names of the generated files, so we use a stamp.
-      'outputs': [
-        '<(stamp_file)',
-      ],
-      'action': [
-        '<(script)',
-        '--protoc=<(protoc)',
-        '--proto-path=<(proto_in_dir)',
-        '--java-out-dir=<(java_out_dir)',
-        '--stamp=<(stamp_file)',
-        '<@(_sources)',
-      ],
-      'message': 'Generating Java code from protobuf files in <(proto_in_dir)',
-    },
-  ],
-  'dependencies': [
-    '<(DEPTH)/third_party/android_protobuf/android_protobuf.gyp:android_protoc#host',
-    '<(DEPTH)/third_party/android_protobuf/android_protobuf.gyp:protobuf_nano_javalib',
-  ],
-  'includes': [ 'java.gypi' ],
-}
diff --git a/build/protoc_java.py b/build/protoc_java.py
deleted file mode 100755
index 470667c..0000000
--- a/build/protoc_java.py
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Generate java source files from protobuf files.
-
-This is a helper file for the genproto_java action in protoc_java.gypi.
-
-It performs the following steps:
-1. Deletes all old sources (ensures deleted classes are not part of new jars).
-2. Creates source directory.
-3. Generates Java files using protoc (output into either --java-out-dir or
-   --srcjar).
-4. Creates a new stamp file.
-"""
-
-import os
-import optparse
-import shutil
-import subprocess
-import sys
-
-sys.path.append(os.path.join(os.path.dirname(__file__), "android", "gyp"))
-from util import build_utils
-
-def main(argv):
-  parser = optparse.OptionParser()
-  build_utils.AddDepfileOption(parser)
-  parser.add_option("--protoc", help="Path to protoc binary.")
-  parser.add_option("--proto-path", help="Path to proto directory.")
-  parser.add_option("--java-out-dir",
-      help="Path to output directory for java files.")
-  parser.add_option("--srcjar", help="Path to output srcjar.")
-  parser.add_option("--stamp", help="File to touch on success.")
-  options, args = parser.parse_args(argv)
-
-  build_utils.CheckOptions(options, parser, ['protoc', 'proto_path'])
-  if not options.java_out_dir and not options.srcjar:
-    print 'One of --java-out-dir or --srcjar must be specified.'
-    return 1
-
-  with build_utils.TempDir() as temp_dir:
-    # Specify arguments to the generator.
-    generator_args = ['optional_field_style=reftypes',
-                      'store_unknown_fields=true']
-    out_arg = '--javanano_out=' + ','.join(generator_args) + ':' + temp_dir
-    # Generate Java files using protoc.
-    build_utils.CheckOutput(
-        [options.protoc, '--proto_path', options.proto_path, out_arg]
-        + args)
-
-    if options.java_out_dir:
-      build_utils.DeleteDirectory(options.java_out_dir)
-      shutil.copytree(temp_dir, options.java_out_dir)
-    else:
-      build_utils.ZipDir(options.srcjar, temp_dir)
-
-  if options.depfile:
-    build_utils.WriteDepfile(
-        options.depfile,
-        args + [options.protoc] + build_utils.GetPythonDependencies())
-
-  if options.stamp:
-    build_utils.Touch(options.stamp)
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
diff --git a/build/release.gypi b/build/release.gypi
deleted file mode 100644
index 9b8b11d..0000000
--- a/build/release.gypi
+++ /dev/null
@@ -1,29 +0,0 @@
-{
-  'conditions': [
-    # Handle build types.
-    ['buildtype=="Dev"', {
-      'includes': ['internal/release_impl.gypi'],
-    }],
-    ['buildtype=="Dev" and incremental_chrome_dll==1', {
-      'msvs_settings': {
-        'VCLinkerTool': {
-          # Enable incremental linking and disable conflicting link options:
-          # http://msdn.microsoft.com/en-us/library/4khtbfyf.aspx
-          'LinkIncremental': '2',
-          'OptimizeReferences': '1',
-          'EnableCOMDATFolding': '1',
-          'Profile': 'false',
-        },
-      },
-    }],
-    ['buildtype=="Official"', {
-      'includes': ['internal/release_impl_official.gypi'],
-    }],
-    # TODO(bradnelson): may also need:
-    #     checksenabled
-    #     coverage
-    #     dom_stats
-    #     pgo_instrument
-    #     pgo_optimize
-  ],
-}
diff --git a/build/repack_action.gypi b/build/repack_action.gypi
deleted file mode 100644
index 04b982a..0000000
--- a/build/repack_action.gypi
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into an action to invoke grit repack in a
-# consistent manner. To use this the following variables need to be
-# defined:
-#   pak_inputs: list: paths of pak files that need to be combined.
-#   pak_output: string: the output pak file path.
-
-{
-  # GYP version: //tools/grit/repack.gni
-  'variables': {
-    'repack_path': '<(DEPTH)/tools/grit/grit/format/repack.py',
-    'repack_options%': [],
-  },
-  'inputs': [
-    '<(repack_path)',
-    '<@(pak_inputs)',
-  ],
-  'outputs': [
-    '<(pak_output)'
-  ],
-  'action': [
-    'python',
-    '<(repack_path)',
-    '<@(repack_options)',
-    '<(pak_output)',
-    '<@(pak_inputs)',
-  ],
-}
diff --git a/build/rmdir_and_stamp.py b/build/rmdir_and_stamp.py
deleted file mode 100755
index 6aa11f8..0000000
--- a/build/rmdir_and_stamp.py
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Wipes out a directory recursively and then touches a stamp file.
-
-This odd pairing of operations is used to support build scripts which
-slurp up entire directories (e.g. build/android/javac.py when handling
-generated sources) as inputs.
-
-The general pattern of use is:
-
-  - Add a target which generates |gen_sources| into |out_path| from |inputs|.
-  - Include |stamp_file| as an input for that target or any of its rules which
-    generate files in |out_path|.
-  - Add an action which depends on |inputs| and which outputs |stamp_file|;
-    the action should run this script and pass |out_path| and |stamp_file| as
-    its arguments.
-
-The net result is that you will force |out_path| to be wiped and all
-|gen_sources| to be regenerated any time any file in |inputs| changes.
-
-See //third_party/mojo/mojom_bindings_generator.gypi for an example use case.
-
-"""
-
-import errno
-import os
-import shutil
-import sys
-
-
-def Main(dst_dir, stamp_file):
-  try:
-    shutil.rmtree(os.path.normpath(dst_dir))
-  except OSError as e:
-    # Ignore only "not found" errors.
-    if e.errno != errno.ENOENT:
-      raise e
-  with open(stamp_file, 'a'):
-    os.utime(stamp_file, None)
-
-if __name__ == '__main__':
-  sys.exit(Main(sys.argv[1], sys.argv[2]))
diff --git a/build/sanitize-mac-build-log.sed b/build/sanitize-mac-build-log.sed
deleted file mode 100644
index b4111c7..0000000
--- a/build/sanitize-mac-build-log.sed
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Use this sed script to reduce a Mac build log into something readable.
-
-# Drop uninformative lines.
-/^distcc/d
-/^Check dependencies/d
-/^    setenv /d
-/^    cd /d
-/^make: Nothing to be done/d
-/^$/d
-
-# Xcode prints a short "compiling foobar.o" line followed by the lengthy
-# full command line.  These deletions drop the command line.
-\|^    /Developer/usr/bin/|d
-\|^    /Developer/Library/PrivateFrameworks/DevToolsCore\.framework/|d
-\|^    /Developer/Library/Xcode/Plug-ins/CoreBuildTasks\.xcplugin/|d
-
-# Drop any goma command lines as well.
-\|^    .*/gomacc |d
-
-# And, if you've overridden something from your own bin directory, remove those
-# full command lines, too.
-\|^    /Users/[^/]*/bin/|d
-
-# There's already a nice note for bindings, don't need the command line.
-\|^python scripts/rule_binding\.py|d
-
-# Shorten the "compiling foobar.o" line.
-s|^Distributed-CompileC (.*) normal i386 c\+\+ com\.apple\.compilers\.gcc\.4_2|    CC \1|
-s|^CompileC (.*) normal i386 c\+\+ com\.apple\.compilers\.gcc\.4_2|    CC \1|
diff --git a/build/sanitize-mac-build-log.sh b/build/sanitize-mac-build-log.sh
deleted file mode 100755
index df5a7af..0000000
--- a/build/sanitize-mac-build-log.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-# Copyright (c) 2010 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-sed -r -f `dirname "${0}"`/`basename "${0}" sh`sed
diff --git a/build/sanitize-win-build-log.sed b/build/sanitize-win-build-log.sed
deleted file mode 100644
index c18e664..0000000
--- a/build/sanitize-win-build-log.sed
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Use this sed script to reduce a Windows build log into something
-# machine-parsable.
-
-# Drop uninformative lines.
-/The operation completed successfully\./d
-
-# Drop parallelization indicators on lines.
-s/^[0-9]+>//
-
-# Shorten bindings generation lines
-s/^.*"python".*idl_compiler\.py".*("[^"]+\.idl").*$/  idl_compiler \1/
diff --git a/build/sanitize-win-build-log.sh b/build/sanitize-win-build-log.sh
deleted file mode 100755
index df5a7af..0000000
--- a/build/sanitize-win-build-log.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-# Copyright (c) 2010 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-sed -r -f `dirname "${0}"`/`basename "${0}" sh`sed
diff --git a/build/secondary/third_party/android_tools/BUILD.gn b/build/secondary/third_party/android_tools/BUILD.gn
deleted file mode 100644
index afafffc..0000000
--- a/build/secondary/third_party/android_tools/BUILD.gn
+++ /dev/null
@@ -1,104 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import("//build/config/android/rules.gni")
-
-config("cpu_features_include") {
-  include_dirs = [ "ndk/sources/android/cpufeatures" ]
-}
-
-# This is the GN version of
-# //build/android/ndk.gyp:cpu_features
-source_set("cpu_features") {
-  sources = [
-    "ndk/sources/android/cpufeatures/cpu-features.c",
-  ]
-  public_configs = [ ":cpu_features_include" ]
-
-  configs -= [ "//build/config/compiler:chromium_code" ]
-  configs += [ "//build/config/compiler:no_chromium_code" ]
-}
-
-android_java_prebuilt("android_gcm_java") {
-  jar_path = "$android_sdk_root/extras/google/gcm/gcm-client/dist/gcm.jar"
-}
-
-android_java_prebuilt("uiautomator_java") {
-  jar_path = "$android_sdk/uiautomator.jar"
-}
-
-android_java_prebuilt("android_support_annotations_javalib") {
-  jar_path = "$android_sdk_root/extras/android/support/annotations/android-support-annotations.jar"
-}
-
-java_prebuilt("android_support_multidex_java") {
-  jar_path = "$android_sdk_root/extras/android/support/multidex/library/libs/android-support-multidex.jar"
-}
-
-android_java_prebuilt("android_support_v13_java") {
-  jar_path =
-      "$android_sdk_root/extras/android/support/v13/android-support-v13.jar"
-}
-
-android_resources("android_support_v7_appcompat_resources") {
-  v14_skip = true
-  resource_dirs =
-      [ "$android_sdk_root/extras/android/support/v7/appcompat/res" ]
-  custom_package = "android.support.v7.appcompat"
-}
-
-android_java_prebuilt("android_support_v7_appcompat_java") {
-  deps = [
-    ":android_support_v7_appcompat_resources",
-  ]
-  jar_path = "$android_sdk_root/extras/android/support/v7/appcompat/libs/android-support-v7-appcompat.jar"
-}
-
-android_resources("android_support_v7_mediarouter_resources") {
-  v14_skip = true
-  resource_dirs =
-      [ "$android_sdk_root/extras/android/support/v7/mediarouter/res" ]
-  deps = [
-    ":android_support_v7_appcompat_resources",
-  ]
-  custom_package = "android.support.v7.mediarouter"
-}
-
-android_java_prebuilt("android_support_v7_mediarouter_java") {
-  deps = [
-    ":android_support_v7_mediarouter_resources",
-    ":android_support_v7_appcompat_java",
-  ]
-  jar_path = "$android_sdk_root/extras/android/support/v7/mediarouter/libs/android-support-v7-mediarouter.jar"
-}
-
-android_resources("android_support_v7_recyclerview_resources") {
-  v14_skip = true
-  resource_dirs =
-      [ "$android_sdk_root/extras/android/support/v7/recyclerview/res" ]
-  custom_package = "android.support.v7.recyclerview"
-}
-
-android_java_prebuilt("android_support_v7_recyclerview_java") {
-  deps = [
-    ":android_support_v7_appcompat_java",
-    ":android_support_v7_recyclerview_resources",
-  ]
-  jar_path = "$android_sdk_root/extras/android/support/v7/recyclerview/libs/android-support-v7-recyclerview.jar"
-}
-
-android_resources("google_play_services_default_resources") {
-  v14_skip = true
-  resource_dirs = [ "$android_sdk_root/extras/google/google_play_services/libproject/google-play-services_lib/res" ]
-  custom_package = "com.google.android.gms"
-}
-android_java_prebuilt("google_play_services_default_java") {
-  deps = [
-    ":android_support_v13_java",
-    ":android_support_v7_mediarouter_java",
-    ":google_play_services_default_resources",
-  ]
-  proguard_preprocess = false
-  jar_path = "$android_sdk_root/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar"
-}
diff --git a/build/set_clang_warning_flags.gypi b/build/set_clang_warning_flags.gypi
deleted file mode 100644
index f6d7aea..0000000
--- a/build/set_clang_warning_flags.gypi
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright (c) 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included to set clang-specific compiler flags.
-# To use this the following variable can be defined:
-#   clang_warning_flags:       list: Compiler flags to pass to clang.
-#   clang_warning_flags_unset: list: Compiler flags to not pass to clang.
-#
-# Only use this in third-party code. In chromium_code, fix your code to not
-# warn instead!
-#
-# Note that the gypi file is included in target_defaults, so it does not need
-# to be explicitly included.
-#
-# Warning flags set by this will be used on all platforms. If you want to set
-# warning flags on only some platforms, you have to do so manually.
-#
-# To use this, create a gyp target with the following form:
-# {
-#   'target_name': 'my_target',
-#   'variables': {
-#     'clang_warning_flags': ['-Wno-awesome-warning'],
-#     'clang_warning_flags_unset': ['-Wpreviously-set-flag'],
-#   }
-# }
-
-{
-  'variables': {
-    'clang_warning_flags_unset%': [],  # Provide a default value.
-  },
-  'conditions': [
-    ['clang==1', {
-      # This uses >@ instead of @< to also see clang_warning_flags set in
-      # targets directly, not just the clang_warning_flags in target_defaults.
-      'cflags': [ '>@(clang_warning_flags)' ],
-      'cflags!': [ '>@(clang_warning_flags_unset)' ],
-      'xcode_settings': {
-        'WARNING_CFLAGS': ['>@(clang_warning_flags)'],
-        'WARNING_CFLAGS!': ['>@(clang_warning_flags_unset)'],
-      },
-      'msvs_settings': {
-        'VCCLCompilerTool': {
-          'AdditionalOptions': [ '>@(clang_warning_flags)' ],
-          'AdditionalOptions!': [ '>@(clang_warning_flags_unset)' ],
-        },
-      },
-    }],
-    ['clang==0 and host_clang==1', {
-      'target_conditions': [
-        ['_toolset=="host"', {
-          'cflags': [ '>@(clang_warning_flags)' ],
-          'cflags!': [ '>@(clang_warning_flags_unset)' ],
-        }],
-      ],
-    }],
-  ],
-}
diff --git a/build/shim_headers.gypi b/build/shim_headers.gypi
deleted file mode 100644
index 56d8d3a..0000000
--- a/build/shim_headers.gypi
+++ /dev/null
@@ -1,60 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into a target to handle shim headers
-# in a consistent manner. To use this the following variables need to be
-# defined:
-#   headers_root_path: string: path to directory containing headers
-#   header_filenames: list: list of header file names
-
-{
-  'variables': {
-    'shim_headers_path': '<(SHARED_INTERMEDIATE_DIR)/shim_headers/<(_target_name)/<(_toolset)',
-    'shim_generator_additional_args%': [],
-  },
-  'include_dirs++': [
-    '<(shim_headers_path)',
-  ],
-  'all_dependent_settings': {
-    # Repeating this with different numbers of plusses is unfortunately required
-    # to make sure that even if this include is inside nested conditions/etc, it
-    # still gets inserted at the beginning of the include_dirs list. See
-    # http://crbug.com/263818 for details.
-    'include_dirs+++': [
-      '<(shim_headers_path)',
-    ],
-    'include_dirs++++': [
-      '<(shim_headers_path)',
-    ],
-    'include_dirs+++++': [
-      '<(shim_headers_path)',
-    ],
-  },
-  'actions': [
-    {
-      'variables': {
-        'generator_path': '<(DEPTH)/tools/generate_shim_headers/generate_shim_headers.py',
-        'generator_args': [
-          '--headers-root', '<(headers_root_path)',
-          '--output-directory', '<(shim_headers_path)',
-          '<@(shim_generator_additional_args)',
-          '<@(header_filenames)',
-        ],
-      },
-      'action_name': 'generate_<(_target_name)_shim_headers',
-      'inputs': [
-        '<(generator_path)',
-      ],
-      'outputs': [
-        '<!@pymod_do_main(generate_shim_headers <@(generator_args) --outputs)',
-      ],
-      'action': ['python',
-                 '<(generator_path)',
-                 '<@(generator_args)',
-                 '--generate',
-      ],
-      'message': 'Generating <(_target_name) shim headers',
-    },
-  ],
-}
diff --git a/build/slave/OWNERS b/build/slave/OWNERS
deleted file mode 100644
index f562c92..0000000
--- a/build/slave/OWNERS
+++ /dev/null
@@ -1,20 +0,0 @@
-set noparent
-agable@chromium.org
-agable@google.com
-cmp@chromium.org
-cmp@google.com
-dpranke@chromium.org
-iannucci@chromium.org
-iannucci@google.com
-johnw@chromium.org
-johnw@google.com
-maruel@chromium.org
-maruel@google.com
-mmoss@chromium.org
-mmoss@google.com
-pschmidt@chromium.org
-pschmidt@google.com
-stip@chromium.org
-stip@google.com
-szager@chromium.org
-szager@google.com
diff --git a/build/slave/README b/build/slave/README
deleted file mode 100644
index e3718b2..0000000
--- a/build/slave/README
+++ /dev/null
@@ -1,8 +0,0 @@
-This is a directory which contains configuration information for the
-buildsystem.
-
-* Under recipes, the buildsystem should use only this directory as an
-  entry point into src/.
-
-* Scripts in this directory must not import from outside this directory or shell
-  to scripts outside this directory.
diff --git a/build/some.gyp b/build/some.gyp
deleted file mode 100644
index 44a1dd5..0000000
--- a/build/some.gyp
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'targets': [
-    {
-      'target_name': 'some',
-      'type': 'none',
-      'dependencies': [
-        # This file is intended to be locally modified. List the targets you use
-        # regularly. The generated some.sln will contains projects for only
-        # those targets and the targets they are transitively dependent on. This
-        # can result in a solution that loads and unloads faster in Visual
-        # Studio.
-        #
-        # Tip: Create a dummy CL to hold your local edits to this file, so they
-        # don't accidentally get added to another CL that you are editing.
-        #
-        # Example:
-        # '../chrome/chrome.gyp:chrome',
-      ],
-    },
-  ],
-}
diff --git a/build/symlink.py b/build/symlink.py
deleted file mode 100755
index 1c5d3dd..0000000
--- a/build/symlink.py
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-"""Make a symlink and optionally touch a file (to handle dependencies)."""
-import errno
-import optparse
-import os.path
-import shutil
-import sys
-def Main(argv):
-  parser = optparse.OptionParser()
-  parser.add_option('-f', '--force', action='store_true')
-  parser.add_option('--touch')
-  options, args = parser.parse_args(argv[1:])
-  if len(args) < 2:
-    parser.error('at least two arguments required.')
-  target = args[-1]
-  sources = args[:-1]
-  for s in sources:
-    t = os.path.join(target, os.path.basename(s))
-    if len(sources) == 1 and not os.path.isdir(target):
-      t = target
-    try:
-      os.symlink(s, t)
-    except OSError, e:
-      if e.errno == errno.EEXIST and options.force:
-        if os.path.isdir(t):
-          shutil.rmtree(t, ignore_errors=True)
-        else:
-          os.remove(t)
-        os.symlink(s, t)
-      else:
-        raise
-  if options.touch:
-    with open(options.touch, 'w') as f:
-      pass
-if __name__ == '__main__':
-  sys.exit(Main(sys.argv))
diff --git a/build/temp_gyp/README.chromium b/build/temp_gyp/README.chromium
deleted file mode 100644
index 8045d61..0000000
--- a/build/temp_gyp/README.chromium
+++ /dev/null
@@ -1,3 +0,0 @@
-This directory will be removed once the files in it are committed upstream and
-Chromium imports an upstream revision with these files.  Contact mark for
-details.
diff --git a/build/temp_gyp/pdfsqueeze.gyp b/build/temp_gyp/pdfsqueeze.gyp
deleted file mode 100644
index 2b3b1ff..0000000
--- a/build/temp_gyp/pdfsqueeze.gyp
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (c) 2009 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'pdfsqueeze',
-      'type': 'executable',
-      'sources': [
-        '../../third_party/pdfsqueeze/pdfsqueeze.m',
-      ],
-      'defines': [
-        # Use defines to map the full path names that will be used for
-        # the vars into the short forms expected by pdfsqueeze.m.
-        '______third_party_pdfsqueeze_ApplyGenericRGB_qfilter=ApplyGenericRGB_qfilter',
-        '______third_party_pdfsqueeze_ApplyGenericRGB_qfilter_len=ApplyGenericRGB_qfilter_len',
-      ],
-      'include_dirs': [
-        '<(INTERMEDIATE_DIR)',
-      ],
-      'libraries': [
-        '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
-        '$(SDKROOT)/System/Library/Frameworks/Quartz.framework',
-      ],
-      'actions': [
-        {
-          'action_name': 'Generate inline filter data',
-          'inputs': [
-            '../../third_party/pdfsqueeze/ApplyGenericRGB.qfilter',
-          ],
-          'outputs': [
-            '<(INTERMEDIATE_DIR)/ApplyGenericRGB.h',
-          ],
-          'action': ['xxd', '-i', '<@(_inputs)', '<@(_outputs)'],
-        },
-      ],
-    },
-  ],
-}
diff --git a/build/toolchain/cros/BUILD.gn b/build/toolchain/cros/BUILD.gn
deleted file mode 100644
index 140958b..0000000
--- a/build/toolchain/cros/BUILD.gn
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import("//build/toolchain/clang.gni")
-import("//build/toolchain/gcc_toolchain.gni")
-
-declare_args() {
-  # The CrOS build system supports many different kinds of targets across
-  # many different architectures. Bringing your own toolchain is also supported,
-  # so it's actually impossible to enumerate all toolchains for all targets
-  # as GN toolchain specifications.
-  # These arguments provide a mechanism for specifying your CC, CXX and AR at
-  # buildfile-generation time, allowing the CrOS build system to always use
-  # the right tools for the current target.
-  cros_target_cc = ""
-  cros_target_cxx = ""
-  cros_target_ar = ""
-}
-
-gcc_toolchain("target") {
-  assert(cros_target_cc != "", "Must provide target CC.")
-  assert(cros_target_cxx != "", "Must provide target CXX.")
-  assert(cros_target_ar != "", "Must provide target AR.")
-
-  cc = "${cros_target_cc}"
-  cxx = "${cros_target_cxx}"
-
-  ar = "${cros_target_ar}"
-  ld = cxx
-
-  toolchain_cpu = "${target_cpu}"
-  toolchain_os = "linux"
-  is_clang = is_clang
-}
diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni
index ecdad86..1175334 100644
--- a/build/toolchain/gcc_toolchain.gni
+++ b/build/toolchain/gcc_toolchain.gni
@@ -201,7 +201,8 @@
       command = "$ld {{ldflags}} -o $unstripped_outfile -Wl,--start-group @$rspfile {{solibs}} -Wl,--end-group $libs_section_prefix {{libs}} $libs_section_postfix"
       if (defined(invoker.strip)) {
         strip = invoker.strip
-        strip_command = "${strip} --strip-unneeded -o $outfile $unstripped_outfile"
+        strip_command =
+            "${strip} --strip-unneeded -o $outfile $unstripped_outfile"
         command += " && " + strip_command
       }
       if (defined(invoker.postlink)) {
diff --git a/build/toolchain/linux/BUILD.gn b/build/toolchain/linux/BUILD.gn
index ae090b0..3c51133 100644
--- a/build/toolchain/linux/BUILD.gn
+++ b/build/toolchain/linux/BUILD.gn
@@ -22,13 +22,13 @@
 }
 
 gcc_toolchain("arm") {
-  cc = "${compiler_prefix}arm-linux-gnueabi-gcc"
-  cxx = "${compiler_prefix}arm-linux-gnueabi-g++"
+  cc = "${compiler_prefix}arm-linux-gnueabihf-gcc"
+  cxx = "${compiler_prefix}arm-linux-gnueabihf-g++"
 
-  ar = "arm-linux-gnueabi-ar"
+  ar = "arm-linux-gnueabihf-ar"
   ld = cxx
-  readelf = "arm-linux-gnueabi-readelf"
-  nm = "arm-linux-gnueabi-nm"
+  readelf = "arm-linux-gnueabihf-readelf"
+  nm = "arm-linux-gnueabihf-nm"
 
   toolchain_cpu = "arm"
   toolchain_os = "linux"
@@ -88,7 +88,6 @@
   nm = "nm"
   ar = "ar"
   ld = cxx
-  strip = "strip"
 
   toolchain_cpu = "x64"
   toolchain_os = "linux"
diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn
index d77a921..b291f00 100644
--- a/build/toolchain/mac/BUILD.gn
+++ b/build/toolchain/mac/BUILD.gn
@@ -7,7 +7,6 @@
 # Linux.
 
 import("../goma.gni")
-import("//build/config/ios/ios_sdk.gni")
 import("//build/config/mac/mac_sdk.gni")
 
 assert(host_os == "mac")
@@ -25,7 +24,7 @@
 # This will copy the gyp-mac-tool to the build directory. We pass in the source
 # file of the win tool.
 gyp_mac_tool_source =
-    rebase_path("//tools/gyp/pylib/gyp/mac_tool.py", root_build_dir)
+    rebase_path("//third_party/gyp/pylib/gyp/mac_tool.py", root_build_dir)
 exec_script("setup_toolchain.py", [ gyp_mac_tool_source ])
 
 # Shared toolchain definition. Invocations should set toolchain_os to set the
@@ -208,32 +207,6 @@
   }
 }
 
-# Toolchain used for iOS device targets.
-mac_toolchain("ios_clang_arm") {
-  toolchain_cpu = "arm"
-  toolchain_os = "mac"
-  prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin",
-                       root_build_dir)
-  cc = "${goma_prefix}$prefix/clang"
-  cxx = "${goma_prefix}$prefix/clang++"
-  ld = cxx
-  is_clang = true
-  sysroot_flags = "-isysroot $ios_device_sdk_path -miphoneos-version-min=$ios_deployment_target"
-}
-
-# Toolchain used for iOS simulator targets.
-mac_toolchain("ios_clang_x64") {
-  toolchain_cpu = "x64"
-  toolchain_os = "mac"
-  prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin",
-                       root_build_dir)
-  cc = "${goma_prefix}$prefix/clang"
-  cxx = "${goma_prefix}$prefix/clang++"
-  ld = cxx
-  is_clang = true
-  sysroot_flags = "-isysroot $ios_simulator_sdk_path -mios-simulator-version-min=$ios_deployment_target"
-}
-
 # Toolchain used for Mac host targets.
 mac_toolchain("clang_x64") {
   toolchain_cpu = "x64"
diff --git a/build/toolchain/nacl/BUILD.gn b/build/toolchain/nacl/BUILD.gn
deleted file mode 100644
index 5fa637c..0000000
--- a/build/toolchain/nacl/BUILD.gn
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-toolchain("x86_newlib") {
-  toolprefix = "gen/sdk/toolchain/linux_x86_newlib/bin/x86_64-nacl-"
-  cc = toolprefix + "gcc"
-  cxx = toolprefix + "g++"
-  ld = toolprefix + "g++"
-
-  tool("cc") {
-    command = "$cc -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_c -c \$in -o \$out"
-    description = "CC(NaCl x86 Newlib) \$out"
-    depfile = "\$out.d"
-    depsformat = "gcc"
-  }
-  tool("cxx") {
-    # cflags_pch_cc
-    command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc -c \$in -o \$out"
-    description = "CXX(NaCl x86 Newlib) \$out"
-    depfile = "\$out.d"
-    depsformat = "gcc"
-  }
-  tool("alink") {
-    command = "rm -f \$out && ${toolprefix}ar rcs \$out \$in"
-    description = "AR(NaCl x86 Newlib) \$out"
-  }
-  tool("solink") {
-    command = "if [ ! -e \$lib -o ! -e \${lib}.TOC ]; then $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive \$libs && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.TOC; else $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive \$libs && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.tmp && if ! cmp -s \${lib}.tmp \${lib}.TOC; then mv \${lib}.tmp \${lib}.TOC ; fi; fi"
-    description = "SOLINK(NaCl x86 Newlib) \$lib"
-
-    #pool = "link_pool"
-    restat = "1"
-  }
-  tool("link") {
-    command = "$ld \$ldflags -o \$out -Wl,--start-group \$in \$solibs -Wl,--end-group \$libs"
-    description = "LINK(NaCl x86 Newlib) \$out"
-
-    #pool = "link_pool"
-  }
-
-  if (is_win) {
-    tool("stamp") {
-      command = "$python_path gyp-win-tool stamp \$out"
-      description = "STAMP \$out"
-    }
-  } else {
-    tool("stamp") {
-      command = "touch \$out"
-      description = "STAMP \$out"
-    }
-  }
-
-  toolchain_args() {
-    # Override the default OS detection. The build config will set the is_*
-    # flags accordingly.
-    current_os = "nacl"
-
-    # Component build not supported in NaCl, since it does not support shared
-    # libraries.
-    is_component_build = false
-  }
-}
diff --git a/build/toolchain/win/BUILD.gn b/build/toolchain/win/BUILD.gn
index d71098f..cf7b4a6 100644
--- a/build/toolchain/win/BUILD.gn
+++ b/build/toolchain/win/BUILD.gn
@@ -23,7 +23,7 @@
 # "environment.x86" and "environment.x64" to the build directory and return a
 # list to us.
 gyp_win_tool_path =
-    rebase_path("//tools/gyp/pylib/gyp/win_tool.py", root_build_dir)
+    rebase_path("//third_party/gyp/pylib/gyp/win_tool.py", root_build_dir)
 
 toolchain_data = exec_script("setup_toolchain.py",
                              [
@@ -45,17 +45,10 @@
   goma_prefix = ""
 }
 
-# This value will be inherited in the toolchain below.
-concurrent_links = exec_script("../get_concurrent_links.py", [], "value")
-
 # Parameters:
 #  current_cpu: current_cpu to pass as a build arg
 #  environment: File name of environment file.
 template("msvc_toolchain") {
-  if (defined(invoker.concurrent_links)) {
-    concurrent_links = invoker.concurrent_links
-  }
-
   env = invoker.environment
 
   if (is_debug) {
@@ -205,7 +198,7 @@
 
     # When invoking this toolchain not as the default one, these args will be
     # passed to the build. They are ignored when this is the default toolchain.
-    toolchain_args() {
+    toolchain_args = {
       current_cpu = invoker.current_cpu
       if (defined(invoker.is_clang)) {
         is_clang = invoker.is_clang
diff --git a/build/tree_truth.sh b/build/tree_truth.sh
deleted file mode 100755
index 617092d..0000000
--- a/build/tree_truth.sh
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/bin/bash
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-# Script for printing recent commits in a buildbot run.
-
-# Return the sha1 of the given tag.  If not present, return "".
-# $1: path to repo
-# $2: tag name
-tt_sha1_for_tag() {
-  oneline=$(cd $1 && git log -1 $2 --format='%H' 2>/dev/null)
-  if [ $? -eq 0 ] ; then
-    echo $oneline
-  fi
-}
-
-# Return the sha1 of HEAD, or ""
-# $1: path to repo
-tt_sha1_for_head() {
-  ( cd $1 && git log HEAD -n1 --format='%H' | cat )
-}
-
-# For the given repo, set tag to HEAD.
-# $1: path to repo
-# $2: tag name
-tt_tag_head() {
-  ( cd $1 && git tag -f $2 )
-}
-
-# For the given repo, delete the tag.
-# $1: path to repo
-# $2: tag name
-tt_delete_tag() {
-  ( cd $1 && git tag -d $2 )
-}
-
-# For the given repo, set tag to "three commits ago" (for testing).
-# $1: path to repo
-# $2: tag name
-tt_tag_three_ago() {
- local sh=$(cd $1 && git log --pretty=oneline -n 3 | tail -1 | awk '{print $1}')
-  ( cd $1 && git tag -f $2 $sh )
-}
-
-# List the commits between the given tag and HEAD.
-# If the tag does not exist, only list the last few.
-# If the tag is at HEAD, list nothing.
-# Output format has distinct build steps for repos with changes.
-# $1: path to repo
-# $2: tag name
-# $3: simple/short repo name to use for display
-tt_list_commits() {
-  local tag_sha1=$(tt_sha1_for_tag $1 $2)
-  local head_sha1=$(tt_sha1_for_head $1)
-  local display_name=$(echo $3 | sed 's#/#_#g')
-  if [ "${tag_sha1}" = "${head_sha1}" ] ; then
-    return
-  fi
-  if [ "${tag_sha1}" = "" ] ; then
-    echo "@@@BUILD_STEP Recent commits in repo $display_name@@@"
-    echo "NOTE: git tag was not found so we have no baseline."
-    echo "Here are some recent commits, but they may not be new for this build."
-    ( cd $1 && git log -n 10 --stat | cat)
-  else
-    echo "@@@BUILD_STEP New commits in repo $display_name@@@"
-    ( cd $1 && git log -n 500 $2..HEAD --stat | cat)
-  fi
-}
-
-# Clean out the tree truth tags in all repos.  For testing.
-tt_clean_all() {
- for project in $@; do
-   tt_delete_tag $CHROME_SRC/../$project tree_truth
- done
-}
-
-# Print tree truth for all clank repos.
-tt_print_all() {
- for project in $@; do
-   local full_path=$CHROME_SRC/../$project
-   tt_list_commits $full_path tree_truth $project
-   tt_tag_head $full_path tree_truth
- done
-}
-
-# Print a summary of the last 10 commits for each repo.
-tt_brief_summary() {
-  echo "@@@BUILD_STEP Brief summary of recent CLs in every branch@@@"
-  for project in $@; do
-    echo $project:
-    local full_path=$CHROME_SRC/../$project
-    (cd $full_path && git log -n 10 --format="   %H %s   %an, %ad" | cat)
-    echo "================================================================="
-  done
-}
-
-CHROME_SRC=$1
-shift
-PROJECT_LIST=$@
-tt_brief_summary $PROJECT_LIST
-tt_print_all $PROJECT_LIST
diff --git a/build/uiautomator_test.gypi b/build/uiautomator_test.gypi
deleted file mode 100644
index e9bd0bf..0000000
--- a/build/uiautomator_test.gypi
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into a target to provide a rule
-# to build uiautomator dexed tests jar.
-#
-# To use this, create a gyp target with the following form:
-# {
-#   'target_name': 'test_suite_name',
-#   'type': 'none',
-#   'includes': ['path/to/this/gypi/file'],
-# }
-#
-
-{
-  'dependencies': [
-    '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_commands',
-    '<(DEPTH)/tools/android/android_tools.gyp:android_tools',
-  ],
-  'variables': {
-    'output_dex_path': '<(PRODUCT_DIR)/lib.java/<(_target_name).dex.jar',
-  },
-  'actions': [
-    {
-      'action_name': 'dex_<(_target_name)',
-      'message': 'Dexing <(_target_name) jar',
-      'variables': {
-        'dex_input_paths': [
-          '>@(library_dexed_jars_paths)',
-        ],
-        'output_path': '<(output_dex_path)',
-      },
-      'includes': [ 'android/dex_action.gypi' ],
-    },
-  ],
-}
diff --git a/build/update-linux-sandbox.sh b/build/update-linux-sandbox.sh
deleted file mode 100755
index 735733a..0000000
--- a/build/update-linux-sandbox.sh
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/bin/sh
-
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-BUILDTYPE="${BUILDTYPE:-Debug}"
-CHROME_SRC_DIR="${CHROME_SRC_DIR:-$(dirname -- $(readlink -fn -- "$0"))/..}"
-CHROME_OUT_DIR="${CHROME_SRC_DIR}/${CHROMIUM_OUT_DIR:-out}/${BUILDTYPE}"
-CHROME_SANDBOX_BUILD_PATH="${CHROME_OUT_DIR}/chrome_sandbox"
-CHROME_SANDBOX_INST_PATH="/usr/local/sbin/chrome-devel-sandbox"
-CHROME_SANDBOX_INST_DIR=$(dirname -- "$CHROME_SANDBOX_INST_PATH")
-
-TARGET_DIR_TYPE=$(stat -f -c %t -- "${CHROME_SANDBOX_INST_DIR}" 2>/dev/null)
-if [ $? -ne 0 ]; then
-  echo "Could not get status of ${CHROME_SANDBOX_INST_DIR}"
-  exit 1
-fi
-
-# Make sure the path is not on NFS.
-if [ "${TARGET_DIR_TYPE}" = "6969" ]; then
-  echo "Please make sure ${CHROME_SANDBOX_INST_PATH} is not on NFS!"
-  exit 1
-fi
-
-installsandbox() {
-  echo "(using sudo so you may be asked for your password)"
-  sudo -- cp "${CHROME_SANDBOX_BUILD_PATH}" \
-    "${CHROME_SANDBOX_INST_PATH}" &&
-  sudo -- chown root:root "${CHROME_SANDBOX_INST_PATH}" &&
-  sudo -- chmod 4755 "${CHROME_SANDBOX_INST_PATH}"
-  return $?
-}
-
-if [ ! -d "${CHROME_OUT_DIR}" ]; then
-  echo -n "${CHROME_OUT_DIR} does not exist. Use \"BUILDTYPE=Release ${0}\" "
-  echo "If you are building in Release mode"
-  exit 1
-fi
-
-if [ ! -f "${CHROME_SANDBOX_BUILD_PATH}" ]; then
-  echo -n "Could not find ${CHROME_SANDBOX_BUILD_PATH}, "
-  echo "please make sure you build the chrome_sandbox target"
-  exit 1
-fi
-
-if [ ! -f "${CHROME_SANDBOX_INST_PATH}" ]; then
-  echo -n "Could not find ${CHROME_SANDBOX_INST_PATH}, "
-  echo "installing it now."
-  installsandbox
-fi
-
-if [ ! -f "${CHROME_SANDBOX_INST_PATH}" ]; then
-  echo "Failed to install ${CHROME_SANDBOX_INST_PATH}"
-  exit 1
-fi
-
-CURRENT_API=$("${CHROME_SANDBOX_BUILD_PATH}" --get-api)
-INSTALLED_API=$("${CHROME_SANDBOX_INST_PATH}" --get-api)
-
-if [ "${CURRENT_API}" != "${INSTALLED_API}" ]; then
-  echo "Your installed setuid sandbox is too old, installing it now."
-  if ! installsandbox; then
-    echo "Failed to install ${CHROME_SANDBOX_INST_PATH}"
-    exit 1
-  fi
-else
-  echo "Your setuid sandbox is up to date"
-  if [ "${CHROME_DEVEL_SANDBOX}" != "${CHROME_SANDBOX_INST_PATH}" ]; then
-    echo -n "Make sure you have \"export "
-    echo -n "CHROME_DEVEL_SANDBOX=${CHROME_SANDBOX_INST_PATH}\" "
-    echo "somewhere in your .bashrc"
-    echo "This variable is currently: ${CHROME_DEVEL_SANDBOX:-empty}"
-  fi
-fi
diff --git a/build/util/BUILD.gn b/build/util/BUILD.gn
deleted file mode 100644
index 29dd943..0000000
--- a/build/util/BUILD.gn
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-action("webkit_version") {
-  script = "version.py"
-
-  lastchange_file = "LASTCHANGE.blink"
-
-  # TODO(brettw) move from content to this directory.
-  template_file = "//content/webkit_version.h.in"
-  inputs = [
-    lastchange_file,
-    template_file,
-  ]
-
-  output_file = "$root_gen_dir/webkit_version.h"
-  outputs = [
-    output_file,
-  ]
-
-  args = [
-    "-f",
-    rebase_path(lastchange_file, root_build_dir),
-    rebase_path(template_file, root_build_dir),
-    rebase_path(output_file, root_build_dir),
-  ]
-}
-
-action("chrome_version_json") {
-  script = "version.py"
-  _chrome_version_path = "//chrome/VERSION"
-  inputs = [
-    _chrome_version_path,
-  ]
-  _output_file = "$root_gen_dir/CHROME_VERSION.json"
-  outputs = [
-    _output_file,
-  ]
-  args = [
-    "--file",
-    rebase_path(_chrome_version_path, root_build_dir),
-    "--template",
-    "{\"full-quoted\": \"\\\"@MAJOR@.@MINOR@.@BUILD@.@PATCH@\\\"\"}",
-    "--output",
-    rebase_path(_output_file, root_build_dir),
-  ]
-}
diff --git a/build/util/LASTCHANGE b/build/util/LASTCHANGE
deleted file mode 100644
index 438a0fe..0000000
--- a/build/util/LASTCHANGE
+++ /dev/null
@@ -1 +0,0 @@
-LASTCHANGE=a757125bae5bce3daacf60f00502f7dd6490b875
diff --git a/build/util/lastchange.py b/build/util/lastchange.py
deleted file mode 100755
index 3f3ee4a..0000000
--- a/build/util/lastchange.py
+++ /dev/null
@@ -1,309 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-lastchange.py -- Chromium revision fetching utility.
-"""
-
-import re
-import optparse
-import os
-import subprocess
-import sys
-
-_GIT_SVN_ID_REGEX = re.compile(r'.*git-svn-id:\s*([^@]*)@([0-9]+)', re.DOTALL)
-
-class VersionInfo(object):
-  def __init__(self, url, revision):
-    self.url = url
-    self.revision = revision
-
-
-def FetchSVNRevision(directory, svn_url_regex):
-  """
-  Fetch the Subversion branch and revision for a given directory.
-
-  Errors are swallowed.
-
-  Returns:
-    A VersionInfo object or None on error.
-  """
-  try:
-    proc = subprocess.Popen(['svn', 'info'],
-                            stdout=subprocess.PIPE,
-                            stderr=subprocess.PIPE,
-                            cwd=directory,
-                            shell=(sys.platform=='win32'))
-  except OSError:
-    # command is apparently either not installed or not executable.
-    return None
-  if not proc:
-    return None
-
-  attrs = {}
-  for line in proc.stdout:
-    line = line.strip()
-    if not line:
-      continue
-    key, val = line.split(': ', 1)
-    attrs[key] = val
-
-  try:
-    match = svn_url_regex.search(attrs['URL'])
-    if match:
-      url = match.group(2)
-    else:
-      url = ''
-    revision = attrs['Revision']
-  except KeyError:
-    return None
-
-  return VersionInfo(url, revision)
-
-
-def RunGitCommand(directory, command):
-  """
-  Launches git subcommand.
-
-  Errors are swallowed.
-
-  Returns:
-    A process object or None.
-  """
-  command = ['git'] + command
-  # Force shell usage under cygwin. This is a workaround for
-  # mysterious loss of cwd while invoking cygwin's git.
-  # We can't just pass shell=True to Popen, as under win32 this will
-  # cause CMD to be used, while we explicitly want a cygwin shell.
-  if sys.platform == 'cygwin':
-    command = ['sh', '-c', ' '.join(command)]
-  try:
-    proc = subprocess.Popen(command,
-                            stdout=subprocess.PIPE,
-                            stderr=subprocess.PIPE,
-                            cwd=directory,
-                            shell=(sys.platform=='win32'))
-    return proc
-  except OSError:
-    return None
-
-
-def FetchGitRevision(directory):
-  """
-  Fetch the Git hash for a given directory.
-
-  Errors are swallowed.
-
-  Returns:
-    A VersionInfo object or None on error.
-  """
-  hsh = ''
-  proc = RunGitCommand(directory, ['rev-parse', 'HEAD'])
-  if proc:
-    output = proc.communicate()[0].strip()
-    if proc.returncode == 0 and output:
-      hsh = output
-  if not hsh:
-    return None
-  pos = ''
-  proc = RunGitCommand(directory, ['cat-file', 'commit', 'HEAD'])
-  if proc:
-    output = proc.communicate()[0]
-    if proc.returncode == 0 and output:
-      for line in reversed(output.splitlines()):
-        if line.startswith('Cr-Commit-Position:'):
-          pos = line.rsplit()[-1].strip()
-          break
-  if not pos:
-    return VersionInfo('git', hsh)
-  return VersionInfo('git', '%s-%s' % (hsh, pos))
-
-
-def FetchGitSVNURLAndRevision(directory, svn_url_regex, go_deeper):
-  """
-  Fetch the Subversion URL and revision through Git.
-
-  Errors are swallowed.
-
-  Returns:
-    A tuple containing the Subversion URL and revision.
-  """
-  git_args = ['log', '-1', '--format=%b']
-  if go_deeper:
-    git_args.append('--grep=git-svn-id')
-  proc = RunGitCommand(directory, git_args)
-  if proc:
-    output = proc.communicate()[0].strip()
-    if proc.returncode == 0 and output:
-      # Extract the latest SVN revision and the SVN URL.
-      # The target line is the last "git-svn-id: ..." line like this:
-      # git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85528 0039d316....
-      match = _GIT_SVN_ID_REGEX.search(output)
-      if match:
-        revision = match.group(2)
-        url_match = svn_url_regex.search(match.group(1))
-        if url_match:
-          url = url_match.group(2)
-        else:
-          url = ''
-        return url, revision
-  return None, None
-
-
-def FetchGitSVNRevision(directory, svn_url_regex, go_deeper):
-  """
-  Fetch the Git-SVN identifier for the local tree.
-
-  Errors are swallowed.
-  """
-  url, revision = FetchGitSVNURLAndRevision(directory, svn_url_regex, go_deeper)
-  if url and revision:
-    return VersionInfo(url, revision)
-  return None
-
-
-def FetchVersionInfo(default_lastchange, directory=None,
-                     directory_regex_prior_to_src_url='chrome|blink|svn',
-                     go_deeper=False):
-  """
-  Returns the last change (in the form of a branch, revision tuple),
-  from some appropriate revision control system.
-  """
-  svn_url_regex = re.compile(
-      r'.*/(' + directory_regex_prior_to_src_url + r')(/.*)')
-
-  version_info = (FetchSVNRevision(directory, svn_url_regex) or
-                  FetchGitSVNRevision(directory, svn_url_regex, go_deeper) or
-                  FetchGitRevision(directory))
-  if not version_info:
-    if default_lastchange and os.path.exists(default_lastchange):
-      revision = open(default_lastchange, 'r').read().strip()
-      version_info = VersionInfo(None, revision)
-    else:
-      version_info = VersionInfo(None, None)
-  return version_info
-
-def GetHeaderGuard(path):
-  """
-  Returns the header #define guard for the given file path.
-  This treats everything after the last instance of "src/" as being a
-  relevant part of the guard. If there is no "src/", then the entire path
-  is used.
-  """
-  src_index = path.rfind('src/')
-  if src_index != -1:
-    guard = path[src_index + 4:]
-  else:
-    guard = path
-  guard = guard.upper()
-  return guard.replace('/', '_').replace('.', '_').replace('\\', '_') + '_'
-
-def GetHeaderContents(path, define, version):
-  """
-  Returns what the contents of the header file should be that indicate the given
-  revision. Note that the #define is specified as a string, even though it's
-  currently always a SVN revision number, in case we need to move to git hashes.
-  """
-  header_guard = GetHeaderGuard(path)
-
-  header_contents = """/* Generated by lastchange.py, do not edit.*/
-
-#ifndef %(header_guard)s
-#define %(header_guard)s
-
-#define %(define)s "%(version)s"
-
-#endif  // %(header_guard)s
-"""
-  header_contents = header_contents % { 'header_guard': header_guard,
-                                        'define': define,
-                                        'version': version }
-  return header_contents
-
-def WriteIfChanged(file_name, contents):
-  """
-  Writes the specified contents to the specified file_name
-  iff the contents are different than the current contents.
-  """
-  try:
-    old_contents = open(file_name, 'r').read()
-  except EnvironmentError:
-    pass
-  else:
-    if contents == old_contents:
-      return
-    os.unlink(file_name)
-  open(file_name, 'w').write(contents)
-
-
-def main(argv=None):
-  if argv is None:
-    argv = sys.argv
-
-  parser = optparse.OptionParser(usage="lastchange.py [options]")
-  parser.add_option("-d", "--default-lastchange", metavar="FILE",
-                    help="Default last change input FILE.")
-  parser.add_option("-m", "--version-macro",
-                    help="Name of C #define when using --header. Defaults to " +
-                    "LAST_CHANGE.",
-                    default="LAST_CHANGE")
-  parser.add_option("-o", "--output", metavar="FILE",
-                    help="Write last change to FILE. " +
-                    "Can be combined with --header to write both files.")
-  parser.add_option("", "--header", metavar="FILE",
-                    help="Write last change to FILE as a C/C++ header. " +
-                    "Can be combined with --output to write both files.")
-  parser.add_option("--revision-only", action='store_true',
-                    help="Just print the SVN revision number. Overrides any " +
-                    "file-output-related options.")
-  parser.add_option("-s", "--source-dir", metavar="DIR",
-                    help="Use repository in the given directory.")
-  parser.add_option("--git-svn-go-deeper", action='store_true',
-                    help="In a Git-SVN repo, dig down to the last committed " +
-                    "SVN change (historic behaviour).")
-  opts, args = parser.parse_args(argv[1:])
-
-  out_file = opts.output
-  header = opts.header
-
-  while len(args) and out_file is None:
-    if out_file is None:
-      out_file = args.pop(0)
-  if args:
-    sys.stderr.write('Unexpected arguments: %r\n\n' % args)
-    parser.print_help()
-    sys.exit(2)
-
-  if opts.source_dir:
-    src_dir = opts.source_dir
-  else:
-    src_dir = os.path.dirname(os.path.abspath(__file__))
-
-  version_info = FetchVersionInfo(opts.default_lastchange,
-                                  directory=src_dir,
-                                  go_deeper=opts.git_svn_go_deeper)
-
-  if version_info.revision == None:
-    version_info.revision = '0'
-
-  if opts.revision_only:
-    print version_info.revision
-  else:
-    contents = "LASTCHANGE=%s\n" % version_info.revision
-    if not out_file and not opts.header:
-      sys.stdout.write(contents)
-    else:
-      if out_file:
-        WriteIfChanged(out_file, contents)
-      if header:
-        WriteIfChanged(header,
-                       GetHeaderContents(header, opts.version_macro,
-                                         version_info.revision))
-
-  return 0
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/util/lib/common/perf_result_data_type.py b/build/util/lib/common/perf_result_data_type.py
deleted file mode 100644
index 67b550a..0000000
--- a/build/util/lib/common/perf_result_data_type.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-DEFAULT = 'default'
-UNIMPORTANT = 'unimportant'
-HISTOGRAM = 'histogram'
-UNIMPORTANT_HISTOGRAM = 'unimportant-histogram'
-INFORMATIONAL = 'informational'
-
-ALL_TYPES = [DEFAULT, UNIMPORTANT, HISTOGRAM, UNIMPORTANT_HISTOGRAM,
-             INFORMATIONAL]
-
-
-def IsValidType(datatype):
-  return datatype in ALL_TYPES
-
-
-def IsHistogram(datatype):
-  return (datatype == HISTOGRAM or datatype == UNIMPORTANT_HISTOGRAM)
diff --git a/build/util/lib/common/perf_tests_results_helper.py b/build/util/lib/common/perf_tests_results_helper.py
deleted file mode 100644
index 6cb058b..0000000
--- a/build/util/lib/common/perf_tests_results_helper.py
+++ /dev/null
@@ -1,166 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import re
-import sys
-
-import json
-import logging
-import math
-
-import perf_result_data_type
-
-
-# Mapping from result type to test output
-RESULT_TYPES = {perf_result_data_type.UNIMPORTANT: 'RESULT ',
-                perf_result_data_type.DEFAULT: '*RESULT ',
-                perf_result_data_type.INFORMATIONAL: '',
-                perf_result_data_type.UNIMPORTANT_HISTOGRAM: 'HISTOGRAM ',
-                perf_result_data_type.HISTOGRAM: '*HISTOGRAM '}
-
-
-def _EscapePerfResult(s):
-  """Escapes |s| for use in a perf result."""
-  return re.sub('[\:|=/#&,]', '_', s)
-
-
-def FlattenList(values):
-  """Returns a simple list without sub-lists."""
-  ret = []
-  for entry in values:
-    if isinstance(entry, list):
-      ret.extend(FlattenList(entry))
-    else:
-      ret.append(entry)
-  return ret
-
-
-def GeomMeanAndStdDevFromHistogram(histogram_json):
-  histogram = json.loads(histogram_json)
-  # Handle empty histograms gracefully.
-  if not 'buckets' in histogram:
-    return 0.0, 0.0
-  count = 0
-  sum_of_logs = 0
-  for bucket in histogram['buckets']:
-    if 'high' in bucket:
-      bucket['mean'] = (bucket['low'] + bucket['high']) / 2.0
-    else:
-      bucket['mean'] = bucket['low']
-    if bucket['mean'] > 0:
-      sum_of_logs += math.log(bucket['mean']) * bucket['count']
-      count += bucket['count']
-
-  if count == 0:
-    return 0.0, 0.0
-
-  sum_of_squares = 0
-  geom_mean = math.exp(sum_of_logs / count)
-  for bucket in histogram['buckets']:
-    if bucket['mean'] > 0:
-      sum_of_squares += (bucket['mean'] - geom_mean) ** 2 * bucket['count']
-  return geom_mean, math.sqrt(sum_of_squares / count)
-
-
-def _ValueToString(v):
-  # Special case for floats so we don't print using scientific notation.
-  if isinstance(v, float):
-    return '%f' % v
-  else:
-    return str(v)
-
-
-def _MeanAndStdDevFromList(values):
-  avg = None
-  sd = None
-  if len(values) > 1:
-    try:
-      value = '[%s]' % ','.join([_ValueToString(v) for v in values])
-      avg = sum([float(v) for v in values]) / len(values)
-      sqdiffs = [(float(v) - avg) ** 2 for v in values]
-      variance = sum(sqdiffs) / (len(values) - 1)
-      sd = math.sqrt(variance)
-    except ValueError:
-      value = ', '.join(values)
-  else:
-    value = values[0]
-  return value, avg, sd
-
-
-def PrintPages(page_list):
-  """Prints list of pages to stdout in the format required by perf tests."""
-  print 'Pages: [%s]' % ','.join([_EscapePerfResult(p) for p in page_list])
-
-
-def PrintPerfResult(measurement, trace, values, units,
-                    result_type=perf_result_data_type.DEFAULT,
-                    print_to_stdout=True):
-  """Prints numerical data to stdout in the format required by perf tests.
-
-  The string args may be empty but they must not contain any colons (:) or
-  equals signs (=).
-  This is parsed by the buildbot using:
-  http://src.chromium.org/viewvc/chrome/trunk/tools/build/scripts/slave/process_log_utils.py
-
-  Args:
-    measurement: A description of the quantity being measured, e.g. "vm_peak".
-        On the dashboard, this maps to a particular graph. Mandatory.
-    trace: A description of the particular data point, e.g. "reference".
-        On the dashboard, this maps to a particular "line" in the graph.
-        Mandatory.
-    values: A list of numeric measured values. An N-dimensional list will be
-        flattened and treated as a simple list.
-    units: A description of the units of measure, e.g. "bytes".
-    result_type: Accepts values of perf_result_data_type.ALL_TYPES.
-    print_to_stdout: If True, prints the output in stdout instead of returning
-        the output to caller.
-
-    Returns:
-      String of the formated perf result.
-  """
-  assert perf_result_data_type.IsValidType(result_type), \
-         'result type: %s is invalid' % result_type
-
-  trace_name = _EscapePerfResult(trace)
-
-  if (result_type == perf_result_data_type.UNIMPORTANT or
-      result_type == perf_result_data_type.DEFAULT or
-      result_type == perf_result_data_type.INFORMATIONAL):
-    assert isinstance(values, list)
-    assert '/' not in measurement
-    flattened_values = FlattenList(values)
-    assert len(flattened_values)
-    value, avg, sd = _MeanAndStdDevFromList(flattened_values)
-    output = '%s%s: %s%s%s %s' % (
-        RESULT_TYPES[result_type],
-        _EscapePerfResult(measurement),
-        trace_name,
-        # Do not show equal sign if the trace is empty. Usually it happens when
-        # measurement is enough clear to describe the result.
-        '= ' if trace_name else '',
-        value,
-        units)
-  else:
-    assert perf_result_data_type.IsHistogram(result_type)
-    assert isinstance(values, list)
-    # The histograms can only be printed individually, there's no computation
-    # across different histograms.
-    assert len(values) == 1
-    value = values[0]
-    output = '%s%s: %s= %s %s' % (
-        RESULT_TYPES[result_type],
-        _EscapePerfResult(measurement),
-        trace_name,
-        value,
-        units)
-    avg, sd = GeomMeanAndStdDevFromHistogram(value)
-
-  if avg:
-    output += '\nAvg %s: %f%s' % (measurement, avg, units)
-  if sd:
-    output += '\nSd  %s: %f%s' % (measurement, sd, units)
-  if print_to_stdout:
-    print output
-    sys.stdout.flush()
-  return output
diff --git a/build/util/lib/common/unittest_util.py b/build/util/lib/common/unittest_util.py
deleted file mode 100644
index 189f587..0000000
--- a/build/util/lib/common/unittest_util.py
+++ /dev/null
@@ -1,153 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Utilities for dealing with the python unittest module."""
-
-import fnmatch
-import sys
-import unittest
-
-
-class _TextTestResult(unittest._TextTestResult):
-  """A test result class that can print formatted text results to a stream.
-
-  Results printed in conformance with gtest output format, like:
-  [ RUN        ] autofill.AutofillTest.testAutofillInvalid: "test desc."
-  [         OK ] autofill.AutofillTest.testAutofillInvalid
-  [ RUN        ] autofill.AutofillTest.testFillProfile: "test desc."
-  [         OK ] autofill.AutofillTest.testFillProfile
-  [ RUN        ] autofill.AutofillTest.testFillProfileCrazyCharacters: "Test."
-  [         OK ] autofill.AutofillTest.testFillProfileCrazyCharacters
-  """
-  def __init__(self, stream, descriptions, verbosity):
-    unittest._TextTestResult.__init__(self, stream, descriptions, verbosity)
-    self._fails = set()
-
-  def _GetTestURI(self, test):
-    return '%s.%s.%s' % (test.__class__.__module__,
-                         test.__class__.__name__,
-                         test._testMethodName)
-
-  def getDescription(self, test):
-    return '%s: "%s"' % (self._GetTestURI(test), test.shortDescription())
-
-  def startTest(self, test):
-    unittest.TestResult.startTest(self, test)
-    self.stream.writeln('[ RUN        ] %s' % self.getDescription(test))
-
-  def addSuccess(self, test):
-    unittest.TestResult.addSuccess(self, test)
-    self.stream.writeln('[         OK ] %s' % self._GetTestURI(test))
-
-  def addError(self, test, err):
-    unittest.TestResult.addError(self, test, err)
-    self.stream.writeln('[      ERROR ] %s' % self._GetTestURI(test))
-    self._fails.add(self._GetTestURI(test))
-
-  def addFailure(self, test, err):
-    unittest.TestResult.addFailure(self, test, err)
-    self.stream.writeln('[     FAILED ] %s' % self._GetTestURI(test))
-    self._fails.add(self._GetTestURI(test))
-
-  def getRetestFilter(self):
-    return ':'.join(self._fails)
-
-
-class TextTestRunner(unittest.TextTestRunner):
-  """Test Runner for displaying test results in textual format.
-
-  Results are displayed in conformance with google test output.
-  """
-
-  def __init__(self, verbosity=1):
-    unittest.TextTestRunner.__init__(self, stream=sys.stderr,
-                                     verbosity=verbosity)
-
-  def _makeResult(self):
-    return _TextTestResult(self.stream, self.descriptions, self.verbosity)
-
-
-def GetTestsFromSuite(suite):
-  """Returns all the tests from a given test suite."""
-  tests = []
-  for x in suite:
-    if isinstance(x, unittest.TestSuite):
-      tests += GetTestsFromSuite(x)
-    else:
-      tests += [x]
-  return tests
-
-
-def GetTestNamesFromSuite(suite):
-  """Returns a list of every test name in the given suite."""
-  return map(lambda x: GetTestName(x), GetTestsFromSuite(suite))
-
-
-def GetTestName(test):
-  """Gets the test name of the given unittest test."""
-  return '.'.join([test.__class__.__module__,
-                   test.__class__.__name__,
-                   test._testMethodName])
-
-
-def FilterTestSuite(suite, gtest_filter):
-  """Returns a new filtered tests suite based on the given gtest filter.
-
-  See http://code.google.com/p/googletest/wiki/AdvancedGuide
-  for gtest_filter specification.
-  """
-  return unittest.TestSuite(FilterTests(GetTestsFromSuite(suite), gtest_filter))
-
-
-def FilterTests(all_tests, gtest_filter):
-  """Filter a list of tests based on the given gtest filter.
-
-  Args:
-    all_tests: List of tests (unittest.TestSuite)
-    gtest_filter: Filter to apply.
-
-  Returns:
-    Filtered subset of the given list of tests.
-  """
-  test_names = [GetTestName(test) for test in all_tests]
-  filtered_names = FilterTestNames(test_names, gtest_filter)
-  return [test for test in all_tests if GetTestName(test) in filtered_names]
-
-
-def FilterTestNames(all_tests, gtest_filter):
-  """Filter a list of test names based on the given gtest filter.
-
-  See http://code.google.com/p/googletest/wiki/AdvancedGuide
-  for gtest_filter specification.
-
-  Args:
-    all_tests: List of test names.
-    gtest_filter: Filter to apply.
-
-  Returns:
-    Filtered subset of the given list of test names.
-  """
-  pattern_groups = gtest_filter.split('-')
-  positive_patterns = ['*']
-  if pattern_groups[0]:
-    positive_patterns = pattern_groups[0].split(':')
-  negative_patterns = None
-  if len(pattern_groups) > 1:
-    negative_patterns = pattern_groups[1].split(':')
-
-  tests = []
-  for test in all_tests:
-    # Test name must by matched by one positive pattern.
-    for pattern in positive_patterns:
-      if fnmatch.fnmatch(test, pattern):
-        break
-    else:
-      continue
-    # Test name must not be matched by any negative patterns.
-    for pattern in negative_patterns or []:
-      if fnmatch.fnmatch(test, pattern):
-        break
-    else:
-      tests += [test]
-  return tests
diff --git a/build/util/lib/common/util.py b/build/util/lib/common/util.py
deleted file mode 100644
index a415b1f..0000000
--- a/build/util/lib/common/util.py
+++ /dev/null
@@ -1,151 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Generic utilities for all python scripts."""
-
-import atexit
-import httplib
-import os
-import signal
-import stat
-import subprocess
-import sys
-import tempfile
-import urlparse
-
-
-def GetPlatformName():
-  """Return a string to be used in paths for the platform."""
-  if IsWindows():
-    return 'win'
-  if IsMac():
-    return 'mac'
-  if IsLinux():
-    return 'linux'
-  raise NotImplementedError('Unknown platform "%s".' % sys.platform)
-
-
-def IsWindows():
-  return sys.platform == 'cygwin' or sys.platform.startswith('win')
-
-
-def IsLinux():
-  return sys.platform.startswith('linux')
-
-
-def IsMac():
-  return sys.platform.startswith('darwin')
-
-
-def _DeleteDir(path):
-  """Deletes a directory recursively, which must exist."""
-  # Don't use shutil.rmtree because it can't delete read-only files on Win.
-  for root, dirs, files in os.walk(path, topdown=False):
-    for name in files:
-      filename = os.path.join(root, name)
-      os.chmod(filename, stat.S_IWRITE)
-      os.remove(filename)
-    for name in dirs:
-      os.rmdir(os.path.join(root, name))
-  os.rmdir(path)
-
-
-def Delete(path):
-  """Deletes the given file or directory (recursively), which must exist."""
-  if os.path.isdir(path):
-    _DeleteDir(path)
-  else:
-    os.remove(path)
-
-
-def MaybeDelete(path):
-  """Deletes the given file or directory (recurisvely), if it exists."""
-  if os.path.exists(path):
-    Delete(path)
-
-
-def MakeTempDir(parent_dir=None):
-  """Creates a temporary directory and returns an absolute path to it.
-
-  The temporary directory is automatically deleted when the python interpreter
-  exits normally.
-
-  Args:
-    parent_dir: the directory to create the temp dir in. If None, the system
-                temp dir is used.
-
-  Returns:
-    The absolute path to the temporary directory.
-  """
-  path = tempfile.mkdtemp(dir=parent_dir)
-  atexit.register(MaybeDelete, path)
-  return path
-
-
-def Unzip(zip_path, output_dir):
-  """Unzips the given zip file using a system installed unzip tool.
-
-  Args:
-    zip_path: zip file to unzip.
-    output_dir: directory to unzip the contents of the zip file. The directory
-                must exist.
-
-  Raises:
-    RuntimeError if the unzip operation fails.
-  """
-  if IsWindows():
-    unzip_cmd = ['C:\\Program Files\\7-Zip\\7z.exe', 'x', '-y']
-  else:
-    unzip_cmd = ['unzip', '-o']
-  unzip_cmd += [zip_path]
-  if RunCommand(unzip_cmd, output_dir) != 0:
-    raise RuntimeError('Unable to unzip %s to %s' % (zip_path, output_dir))
-
-
-def Kill(pid):
-  """Terminate the given pid."""
-  if IsWindows():
-    subprocess.call(['taskkill.exe', '/T', '/F', '/PID', str(pid)])
-  else:
-    os.kill(pid, signal.SIGTERM)
-
-
-def RunCommand(cmd, cwd=None):
-  """Runs the given command and returns the exit code.
-
-  Args:
-    cmd: list of command arguments.
-    cwd: working directory to execute the command, or None if the current
-         working directory should be used.
-
-  Returns:
-    The exit code of the command.
-  """
-  process = subprocess.Popen(cmd, cwd=cwd)
-  process.wait()
-  return process.returncode
-
-
-def DoesUrlExist(url):
-  """Determines whether a resource exists at the given URL.
-
-  Args:
-    url: URL to be verified.
-
-  Returns:
-    True if url exists, otherwise False.
-  """
-  parsed = urlparse.urlparse(url)
-  try:
-    conn = httplib.HTTPConnection(parsed.netloc)
-    conn.request('HEAD', parsed.path)
-    response = conn.getresponse()
-  except (socket.gaierror, socket.error):
-    return False
-  finally:
-    conn.close()
-  # Follow both permanent (301) and temporary (302) redirects.
-  if response.status == 302 or response.status == 301:
-    return DoesUrlExist(response.getheader('location'))
-  return response.status == 200
diff --git a/build/util/version.gypi b/build/util/version.gypi
deleted file mode 100644
index 327a5c2..0000000
--- a/build/util/version.gypi
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'variables': {
-    'variables': {
-      'version_py_path': '<(DEPTH)/build/util/version.py',
-      'version_path': '<(DEPTH)/chrome/VERSION',
-      'lastchange_path': '<(DEPTH)/build/util/LASTCHANGE',
-    },
-    'version_py_path': '<(version_py_path)',
-    'version_path': '<(version_path)',
-    'lastchange_path': '<(lastchange_path)',
-    'version_full':
-        '<!(python <(version_py_path) -f <(version_path) -t "@MAJOR@.@MINOR@.@BUILD@.@PATCH@")',
-    'version_mac_dylib':
-        '<!(python <(version_py_path) -f <(version_path) -t "@BUILD@.@PATCH_HI@.@PATCH_LO@" -e "PATCH_HI=int(PATCH)/256" -e "PATCH_LO=int(PATCH)%256")',
-  },  # variables
-}
diff --git a/build/util/version.py b/build/util/version.py
deleted file mode 100755
index 4d3691a..0000000
--- a/build/util/version.py
+++ /dev/null
@@ -1,166 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-version.py -- Chromium version string substitution utility.
-"""
-
-import argparse
-import os
-import sys
-
-
-def fetch_values_from_file(values_dict, file_name):
-  """
-  Fetches KEYWORD=VALUE settings from the specified file.
-
-  Everything to the left of the first '=' is the keyword,
-  everything to the right is the value.  No stripping of
-  white space, so beware.
-
-  The file must exist, otherwise you get the Python exception from open().
-  """
-  for line in open(file_name, 'r').readlines():
-    key, val = line.rstrip('\r\n').split('=', 1)
-    values_dict[key] = val
-
-
-def fetch_values(file_list):
-  """
-  Returns a dictionary of values to be used for substitution, populating
-  the dictionary with KEYWORD=VALUE settings from the files in 'file_list'.
-
-  Explicitly adds the following value from internal calculations:
-
-    OFFICIAL_BUILD
-  """
-  CHROME_BUILD_TYPE = os.environ.get('CHROME_BUILD_TYPE')
-  if CHROME_BUILD_TYPE == '_official':
-    official_build = '1'
-  else:
-    official_build = '0'
-
-  values = dict(
-    OFFICIAL_BUILD = official_build,
-  )
-
-  for file_name in file_list:
-    fetch_values_from_file(values, file_name)
-
-  return values
-
-
-def subst_template(contents, values):
-  """
-  Returns the template with substituted values from the specified dictionary.
-
-  Keywords to be substituted are surrounded by '@':  @KEYWORD@.
-
-  No attempt is made to avoid recursive substitution.  The order
-  of evaluation is random based on the order of the keywords returned
-  by the Python dictionary.  So do NOT substitute a value that
-  contains any @KEYWORD@ strings expecting them to be recursively
-  substituted, okay?
-  """
-  for key, val in values.iteritems():
-    try:
-      contents = contents.replace('@' + key + '@', val)
-    except TypeError:
-      print repr(key), repr(val)
-  return contents
-
-
-def subst_file(file_name, values):
-  """
-  Returns the contents of the specified file_name with substituted
-  values from the specified dictionary.
-
-  This is like subst_template, except it operates on a file.
-  """
-  template = open(file_name, 'r').read()
-  return subst_template(template, values);
-
-
-def write_if_changed(file_name, contents):
-  """
-  Writes the specified contents to the specified file_name
-  iff the contents are different than the current contents.
-  """
-  try:
-    old_contents = open(file_name, 'r').read()
-  except EnvironmentError:
-    pass
-  else:
-    if contents == old_contents:
-      return
-    os.unlink(file_name)
-  open(file_name, 'w').write(contents)
-
-
-def main():
-  parser = argparse.ArgumentParser()
-  parser.add_argument('-f', '--file', action='append', default=[],
-                      help='Read variables from FILE.')
-  parser.add_argument('-i', '--input', default=None,
-                      help='Read strings to substitute from FILE.')
-  parser.add_argument('-o', '--output', default=None,
-                      help='Write substituted strings to FILE.')
-  parser.add_argument('-t', '--template', default=None,
-                      help='Use TEMPLATE as the strings to substitute.')
-  parser.add_argument('-e', '--eval', action='append', default=[],
-                      help='Evaluate VAL after reading variables. Can be used '
-                           'to synthesize variables. e.g. -e \'PATCH_HI=int('
-                           'PATCH)/256.')
-  parser.add_argument('args', nargs=argparse.REMAINDER,
-                      help='For compatibility: INPUT and OUTPUT can be '
-                           'passed as positional arguments.')
-  options = parser.parse_args()
-
-  evals = {}
-  for expression in options.eval:
-    try:
-      evals.update(dict([expression.split('=', 1)]))
-    except ValueError:
-      parser.error('-e requires VAR=VAL')
-
-  # Compatibility with old versions that considered the first two positional
-  # arguments shorthands for --input and --output.
-  while len(options.args) and (options.input is None or \
-                               options.output is None):
-    if options.input is None:
-      options.input = options.args.pop(0)
-    elif options.output is None:
-      options.output = options.args.pop(0)
-  if options.args:
-    parser.error('Unexpected arguments: %r' % options.args)
-
-  values = fetch_values(options.file)
-  for key, val in evals.iteritems():
-    values[key] = str(eval(val, globals(), values))
-
-  if options.template is not None:
-    contents = subst_template(options.template, values)
-  elif options.input:
-    contents = subst_file(options.input, values)
-  else:
-    # Generate a default set of version information.
-    contents = """MAJOR=%(MAJOR)s
-MINOR=%(MINOR)s
-BUILD=%(BUILD)s
-PATCH=%(PATCH)s
-LASTCHANGE=%(LASTCHANGE)s
-OFFICIAL_BUILD=%(OFFICIAL_BUILD)s
-""" % values
-
-  if options.output is not None:
-    write_if_changed(options.output, contents)
-  else:
-    print contents
-
-  return 0
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/build/vs_toolchain.py b/build/vs_toolchain.py
index 16f4477..d8a7f4c 100644
--- a/build/vs_toolchain.py
+++ b/build/vs_toolchain.py
@@ -1,11 +1,15 @@
+#!/usr/bin/env python
 # Copyright 2014 The Chromium Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
+import glob
 import json
 import os
 import pipes
+import platform
 import shutil
+import stat
 import subprocess
 import sys
 
@@ -14,23 +18,32 @@
 chrome_src = os.path.abspath(os.path.join(script_dir, os.pardir))
 SRC_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 sys.path.insert(1, os.path.join(chrome_src, 'tools'))
-sys.path.insert(0, os.path.join(chrome_src, 'tools', 'gyp', 'pylib'))
+sys.path.insert(0, os.path.join(chrome_src, 'third_party', 'gyp', 'pylib'))
 json_data_file = os.path.join(script_dir, 'win_toolchain.json')
 
 
 import gyp
 
 
+# Use MSVS2015 as the default toolchain.
+CURRENT_DEFAULT_TOOLCHAIN_VERSION = '2015'
+
+
 def SetEnvironmentAndGetRuntimeDllDirs():
   """Sets up os.environ to use the depot_tools VS toolchain with gyp, and
   returns the location of the VS runtime DLLs so they can be copied into
   the output directory after gyp generation.
+
+  Return value is [x64path, x86path] or None
   """
-  vs2013_runtime_dll_dirs = None
+  vs_runtime_dll_dirs = None
   depot_tools_win_toolchain = \
       bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', '1')))
-  if sys.platform in ('win32', 'cygwin') and depot_tools_win_toolchain:
-    if not os.path.exists(json_data_file):
+  # When running on a non-Windows host, only do this if the SDK has explicitly
+  # been downloaded before (in which case json_data_file will exist).
+  if ((sys.platform in ('win32', 'cygwin') or os.path.exists(json_data_file))
+      and depot_tools_win_toolchain):
+    if ShouldUpdateToolchain():
       Update()
     with open(json_data_file, 'r') as tempf:
       toolchain_data = json.load(tempf)
@@ -44,7 +57,7 @@
     # TODO(scottmg): The order unfortunately matters in these. They should be
     # split into separate keys for x86 and x64. (See CopyVsRuntimeDlls call
     # below). http://crbug.com/345992
-    vs2013_runtime_dll_dirs = toolchain_data['runtime_dirs']
+    vs_runtime_dll_dirs = toolchain_data['runtime_dirs']
 
     os.environ['GYP_MSVS_OVERRIDE_PATH'] = toolchain
     os.environ['GYP_MSVS_VERSION'] = version
@@ -59,33 +72,119 @@
     os.environ['WINDOWSSDKDIR'] = win_sdk
     os.environ['WDK_DIR'] = wdk
     # Include the VS runtime in the PATH in case it's not machine-installed.
-    runtime_path = ';'.join(vs2013_runtime_dll_dirs)
-    os.environ['PATH'] = runtime_path + ';' + os.environ['PATH']
-  return vs2013_runtime_dll_dirs
+    runtime_path = os.path.pathsep.join(vs_runtime_dll_dirs)
+    os.environ['PATH'] = runtime_path + os.path.pathsep + os.environ['PATH']
+  elif sys.platform == 'win32' and not depot_tools_win_toolchain:
+    if not 'GYP_MSVS_OVERRIDE_PATH' in os.environ:
+      os.environ['GYP_MSVS_OVERRIDE_PATH'] = DetectVisualStudioPath()
+    if not 'GYP_MSVS_VERSION' in os.environ:
+      os.environ['GYP_MSVS_VERSION'] = GetVisualStudioVersion()
+
+    # When using an installed toolchain these files aren't needed in the output
+    # directory in order to run binaries locally, but they are needed in order
+    # to create isolates or the mini_installer. Copying them to the output
+    # directory ensures that they are available when needed.
+    bitness = platform.architecture()[0]
+    # When running 64-bit python the x64 DLLs will be in System32
+    x64_path = 'System32' if bitness == '64bit' else 'Sysnative'
+    x64_path = os.path.join(r'C:\Windows', x64_path)
+    vs_runtime_dll_dirs = [x64_path, r'C:\Windows\SysWOW64']
+
+  return vs_runtime_dll_dirs
+
+
+def _RegistryGetValueUsingWinReg(key, value):
+  """Use the _winreg module to obtain the value of a registry key.
+
+  Args:
+    key: The registry key.
+    value: The particular registry value to read.
+  Return:
+    contents of the registry key's value, or None on failure.  Throws
+    ImportError if _winreg is unavailable.
+  """
+  import _winreg
+  try:
+    root, subkey = key.split('\\', 1)
+    assert root == 'HKLM'  # Only need HKLM for now.
+    with _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, subkey) as hkey:
+      return _winreg.QueryValueEx(hkey, value)[0]
+  except WindowsError:
+    return None
+
+
+def _RegistryGetValue(key, value):
+  try:
+    return _RegistryGetValueUsingWinReg(key, value)
+  except ImportError:
+    raise Exception('The python library _winreg not found.')
+
+
+def GetVisualStudioVersion():
+  """Return GYP_MSVS_VERSION of Visual Studio.
+  """
+  return os.environ.get('GYP_MSVS_VERSION', CURRENT_DEFAULT_TOOLCHAIN_VERSION)
+
+
+def DetectVisualStudioPath():
+  """Return path to the GYP_MSVS_VERSION of Visual Studio.
+  """
+
+  # Note that this code is used from
+  # build/toolchain/win/setup_toolchain.py as well.
+  version_as_year = GetVisualStudioVersion()
+  year_to_version = {
+      '2013': '12.0',
+      '2015': '14.0',
+  }
+  if version_as_year not in year_to_version:
+    raise Exception(('Visual Studio version %s (from GYP_MSVS_VERSION)'
+                     ' not supported. Supported versions are: %s') % (
+                       version_as_year, ', '.join(year_to_version.keys())))
+  version = year_to_version[version_as_year]
+  keys = [r'HKLM\Software\Microsoft\VisualStudio\%s' % version,
+          r'HKLM\Software\Wow6432Node\Microsoft\VisualStudio\%s' % version]
+  for key in keys:
+    path = _RegistryGetValue(key, 'InstallDir')
+    if not path:
+      continue
+    path = os.path.normpath(os.path.join(path, '..', '..'))
+    return path
+
+  raise Exception(('Visual Studio Version %s (from GYP_MSVS_VERSION)'
+                   ' not found.') % (version_as_year))
 
 
 def _VersionNumber():
   """Gets the standard version number ('120', '140', etc.) based on
   GYP_MSVS_VERSION."""
-  if os.environ['GYP_MSVS_VERSION'] == '2013':
+  vs_version = GetVisualStudioVersion()
+  if vs_version == '2013':
     return '120'
-  elif os.environ['GYP_MSVS_VERSION'] == '2015':
+  elif vs_version == '2015':
     return '140'
   else:
     raise ValueError('Unexpected GYP_MSVS_VERSION')
 
 
-def _CopyRuntimeImpl(target, source):
-  """Copy |source| to |target| if it doesn't already exist or if it
-  needs to be updated.
+def _CopyRuntimeImpl(target, source, verbose=True):
+  """Copy |source| to |target| if it doesn't already exist or if it needs to be
+  updated (comparing last modified time as an approximate float match as for
+  some reason the values tend to differ by ~1e-07 despite being copies of the
+  same file... https://crbug.com/603603).
   """
   if (os.path.isdir(os.path.dirname(target)) and
       (not os.path.isfile(target) or
-      os.stat(target).st_mtime != os.stat(source).st_mtime)):
-    print 'Copying %s to %s...' % (source, target)
+       abs(os.stat(target).st_mtime - os.stat(source).st_mtime) >= 0.01)):
+    if verbose:
+      print 'Copying %s to %s...' % (source, target)
     if os.path.exists(target):
+      # Make the file writable so that we can delete it now.
+      os.chmod(target, stat.S_IWRITE)
       os.unlink(target)
     shutil.copy2(source, target)
+    # Make the file writable so that we can overwrite or delete it later.
+    os.chmod(target, stat.S_IWRITE)
 
 
 def _CopyRuntime2013(target_dir, source_dir, dll_pattern):
@@ -98,14 +197,57 @@
     _CopyRuntimeImpl(target, source)
 
 
-def _CopyRuntime2015(target_dir, source_dir, dll_pattern):
+def _CopyRuntime2015(target_dir, source_dir, dll_pattern, suffix):
   """Copy both the msvcp and vccorlib runtime DLLs, only if the target doesn't
   exist, but the target directory does exist."""
-  for file_part in ('msvcp', 'vccorlib'):
+  for file_part in ('msvcp', 'vccorlib', 'vcruntime'):
     dll = dll_pattern % file_part
     target = os.path.join(target_dir, dll)
     source = os.path.join(source_dir, dll)
     _CopyRuntimeImpl(target, source)
+  # OS installs of Visual Studio (and all installs of Windows 10) put the
+  # universal CRT files in c:\Windows\System32\downlevel - look for them there
+  # to support DEPOT_TOOLS_WIN_TOOLCHAIN=0.
+  if os.path.exists(os.path.join(source_dir, 'downlevel')):
+    ucrt_src_glob = os.path.join(source_dir, 'downlevel', 'api-ms-win-*.dll')
+  else:
+    ucrt_src_glob = os.path.join(source_dir, 'api-ms-win-*.dll')
+  ucrt_files = glob.glob(ucrt_src_glob)
+  assert len(ucrt_files) > 0
+  for ucrt_src_file in ucrt_files:
+    file_part = os.path.basename(ucrt_src_file)
+    ucrt_dst_file = os.path.join(target_dir, file_part)
+    _CopyRuntimeImpl(ucrt_dst_file, ucrt_src_file, False)
+  _CopyRuntimeImpl(os.path.join(target_dir, 'ucrtbase' + suffix),
+                    os.path.join(source_dir, 'ucrtbase' + suffix))
+
+
+def _CopyRuntime(target_dir, source_dir, target_cpu, debug):
+  """Copy the VS runtime DLLs, only if the target doesn't exist, but the target
+  directory does exist. Handles VS 2013 and VS 2015."""
+  suffix = "d.dll" if debug else ".dll"
+  if GetVisualStudioVersion() == '2015':
+    _CopyRuntime2015(target_dir, source_dir, '%s140' + suffix, suffix)
+  else:
+    _CopyRuntime2013(target_dir, source_dir, 'msvc%s120' + suffix)
+
+  # Copy the PGO runtime library to the release directories.
+  if not debug and os.environ.get('GYP_MSVS_OVERRIDE_PATH'):
+    pgo_x86_runtime_dir = os.path.join(os.environ.get('GYP_MSVS_OVERRIDE_PATH'),
+                                        'VC', 'bin')
+    pgo_x64_runtime_dir = os.path.join(pgo_x86_runtime_dir, 'amd64')
+    pgo_runtime_dll = 'pgort' + _VersionNumber() + '.dll'
+    if target_cpu == "x86":
+      source_x86 = os.path.join(pgo_x86_runtime_dir, pgo_runtime_dll)
+      if os.path.exists(source_x86):
+        _CopyRuntimeImpl(os.path.join(target_dir, pgo_runtime_dll), source_x86)
+    elif target_cpu == "x64":
+      source_x64 = os.path.join(pgo_x64_runtime_dir, pgo_runtime_dll)
+      if os.path.exists(source_x64):
+        _CopyRuntimeImpl(os.path.join(target_dir, pgo_runtime_dll),
+                          source_x64)
+    else:
+      raise NotImplementedError("Unexpected target_cpu value:" + target_cpu)
 
 
 def CopyVsRuntimeDlls(output_dir, runtime_dirs):
@@ -115,9 +257,9 @@
 
   This needs to be run after gyp has been run so that the expected target
   output directories are already created.
-  """
-  assert sys.platform.startswith(('win32', 'cygwin'))
 
+  This is used for the GYP build and gclient runhooks.
+  """
   x86, x64 = runtime_dirs
   out_debug = os.path.join(output_dir, 'Debug')
   out_debug_nacl64 = os.path.join(output_dir, 'Debug', 'x64')
@@ -130,35 +272,12 @@
     os.makedirs(out_debug_nacl64)
   if os.path.exists(out_release) and not os.path.exists(out_release_nacl64):
     os.makedirs(out_release_nacl64)
-  if os.environ.get('GYP_MSVS_VERSION') == '2015':
-    _CopyRuntime2015(out_debug,          x86, '%s140d.dll')
-    _CopyRuntime2015(out_release,        x86, '%s140.dll')
-    _CopyRuntime2015(out_debug_x64,      x64, '%s140d.dll')
-    _CopyRuntime2015(out_release_x64,    x64, '%s140.dll')
-    _CopyRuntime2015(out_debug_nacl64,   x64, '%s140d.dll')
-    _CopyRuntime2015(out_release_nacl64, x64, '%s140.dll')
-  else:
-    # VS2013 is the default.
-    _CopyRuntime2013(out_debug,          x86, 'msvc%s120d.dll')
-    _CopyRuntime2013(out_release,        x86, 'msvc%s120.dll')
-    _CopyRuntime2013(out_debug_x64,      x64, 'msvc%s120d.dll')
-    _CopyRuntime2013(out_release_x64,    x64, 'msvc%s120.dll')
-    _CopyRuntime2013(out_debug_nacl64,   x64, 'msvc%s120d.dll')
-    _CopyRuntime2013(out_release_nacl64, x64, 'msvc%s120.dll')
-
-  # Copy the PGO runtime library to the release directories.
-  if os.environ.get('GYP_MSVS_OVERRIDE_PATH'):
-    pgo_x86_runtime_dir = os.path.join(os.environ.get('GYP_MSVS_OVERRIDE_PATH'),
-                                       'VC', 'bin')
-    pgo_x64_runtime_dir = os.path.join(pgo_x86_runtime_dir, 'amd64')
-    pgo_runtime_dll = 'pgort' + _VersionNumber() + '.dll'
-    source_x86 = os.path.join(pgo_x86_runtime_dir, pgo_runtime_dll)
-    if os.path.exists(source_x86):
-      _CopyRuntimeImpl(os.path.join(out_release, pgo_runtime_dll), source_x86)
-    source_x64 = os.path.join(pgo_x64_runtime_dir, pgo_runtime_dll)
-    if os.path.exists(source_x64):
-      _CopyRuntimeImpl(os.path.join(out_release_x64, pgo_runtime_dll),
-                       source_x64)
+  _CopyRuntime(out_debug,          x86, "x86", debug=True)
+  _CopyRuntime(out_release,        x86, "x86", debug=False)
+  _CopyRuntime(out_debug_x64,      x64, "x64", debug=True)
+  _CopyRuntime(out_release_x64,    x64, "x64", debug=False)
+  _CopyRuntime(out_debug_nacl64,   x64, "x64", debug=True)
+  _CopyRuntime(out_release_nacl64, x64, "x64", debug=False)
 
 
 def CopyDlls(target_dir, configuration, target_cpu):
@@ -169,42 +288,63 @@
 
   The debug configuration gets both the debug and release DLLs; the
   release config only the latter.
+
+  This is used for the GN build.
   """
-  vs2013_runtime_dll_dirs = SetEnvironmentAndGetRuntimeDllDirs()
-  if not vs2013_runtime_dll_dirs:
+  vs_runtime_dll_dirs = SetEnvironmentAndGetRuntimeDllDirs()
+  if not vs_runtime_dll_dirs:
     return
 
-  x64_runtime, x86_runtime = vs2013_runtime_dll_dirs
+  x64_runtime, x86_runtime = vs_runtime_dll_dirs
   runtime_dir = x64_runtime if target_cpu == 'x64' else x86_runtime
-  _CopyRuntime2013(
-      target_dir, runtime_dir, 'msvc%s' + _VersionNumber() + '.dll')
+  _CopyRuntime(target_dir, runtime_dir, target_cpu, debug=False)
   if configuration == 'Debug':
-    _CopyRuntime2013(
-        target_dir, runtime_dir, 'msvc%s' + _VersionNumber() + 'd.dll')
+    _CopyRuntime(target_dir, runtime_dir, target_cpu, debug=True)
 
 
 def _GetDesiredVsToolchainHashes():
   """Load a list of SHA1s corresponding to the toolchains that we want installed
   to build with."""
-  # TODO(scottmg): If explicitly set to VS2015 override hashes to the VS2015 RC
-  # toolchain. http://crbug.com/492774.
-  if os.environ.get('GYP_MSVS_VERSION') == '2015':
-    return ['40721575c85171cea5d7afe5ec17bd108a94796e']
+  if GetVisualStudioVersion() == '2015':
+    # Update 3 final with patches with 10.0.10586.0 SDK.
+    return ['d5dc33b15d1b2c086f2f6632e2fd15882f80dbd3']
   else:
-    # Default to VS2013.
-    return ['ee7d718ec60c2dc5d255bbe325909c2021a7efef']
+    return ['03a4e939cd325d6bc5216af41b92d02dda1366a6']
 
 
-def Update():
+def ShouldUpdateToolchain():
+  """Check if the toolchain should be upgraded."""
+  if not os.path.exists(json_data_file):
+    return True
+  with open(json_data_file, 'r') as tempf:
+    toolchain_data = json.load(tempf)
+  version = toolchain_data['version']
+  env_version = GetVisualStudioVersion()
+  # If there's a mismatch between the version set in the environment and the one
+  # in the json file then the toolchain should be updated.
+  return version != env_version
+
+
+def Update(force=False):
   """Requests an update of the toolchain to the specific hashes we have at
   this revision. The update outputs a .json of the various configuration
   information required to pass to gyp which we use in |GetToolchainDir()|.
   """
+  if force != False and force != '--force':
+    print >>sys.stderr, 'Unknown parameter "%s"' % force
+    return 1
+  if force == '--force' or os.path.exists(json_data_file):
+    force = True
+
   depot_tools_win_toolchain = \
       bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', '1')))
-  if sys.platform in ('win32', 'cygwin') and depot_tools_win_toolchain:
+  if ((sys.platform in ('win32', 'cygwin') or force) and
+        depot_tools_win_toolchain):
     import find_depot_tools
     depot_tools_path = find_depot_tools.add_depot_tools_to_path()
+    # Necessary so that get_toolchain_if_necessary.py will put the VS toolkit
+    # in the correct directory.
+    os.environ['GYP_MSVS_VERSION'] = GetVisualStudioVersion()
     get_toolchain_args = [
         sys.executable,
         os.path.join(depot_tools_path,
@@ -212,11 +352,19 @@
                     'get_toolchain_if_necessary.py'),
         '--output-json', json_data_file,
       ] + _GetDesiredVsToolchainHashes()
+    if force:
+      get_toolchain_args.append('--force')
     subprocess.check_call(get_toolchain_args)
 
   return 0
 
 
+def NormalizePath(path):
+  while path.endswith("\\"):
+    path = path[:-1]
+  return path
+
+
 def GetToolchainDir():
   """Gets location information about the current toolchain (must have been
   previously updated by 'update'). This is used for the GN build."""
@@ -224,7 +372,7 @@
 
   # If WINDOWSSDKDIR is not set, search the default SDK path and set it.
   if not 'WINDOWSSDKDIR' in os.environ:
-    default_sdk_path = 'C:\\Program Files (x86)\\Windows Kits\\8.1'
+    default_sdk_path = 'C:\\Program Files (x86)\\Windows Kits\\10'
     if os.path.isdir(default_sdk_path):
       os.environ['WINDOWSSDKDIR'] = default_sdk_path
 
@@ -234,16 +382,14 @@
 wdk_dir = "%s"
 runtime_dirs = "%s"
 ''' % (
-      os.environ['GYP_MSVS_OVERRIDE_PATH'],
-      os.environ['WINDOWSSDKDIR'],
-      os.environ['GYP_MSVS_VERSION'],
-      os.environ.get('WDK_DIR', ''),
-      ';'.join(runtime_dll_dirs or ['None']))
+      NormalizePath(os.environ['GYP_MSVS_OVERRIDE_PATH']),
+      NormalizePath(os.environ['WINDOWSSDKDIR']),
+      GetVisualStudioVersion(),
+      NormalizePath(os.environ.get('WDK_DIR', '')),
+      os.path.pathsep.join(runtime_dll_dirs or ['None']))
 
 
 def main():
-  if not sys.platform.startswith(('win32', 'cygwin')):
-    return 0
   commands = {
       'update': Update,
       'get_toolchain_dir': GetToolchainDir,
diff --git a/build/whitespace_file.txt b/build/whitespace_file.txt
deleted file mode 100644
index ea82f4e..0000000
--- a/build/whitespace_file.txt
+++ /dev/null
@@ -1,156 +0,0 @@
-Copyright 2014 The Chromium Authors. All rights reserved.
-Use of this useless file is governed by a BSD-style license that can be
-found in the LICENSE file.
-
-
-This file is used for making non-code changes to trigger buildbot cycles. Make
-any modification below this line.
-
-======================================================================
-
-Let's make a story. Add zero+ sentences for every commit:
-
-CHÄPTER 1:
-It was a dark and blinky night; the rain fell in torrents -- except at
-occasional intervals, when it was checked by a violent gust of wind which
-swept up the streets (for it is in London that our scene lies), rattling along
-the housetops, and fiercely agitating the scanty flame of the lamps that
-struggled against the elements. A hooded figure emerged.
-
-It was a Domo-Kun.
-
-"What took you so long?", inquired his wife.
-
-Silence. Oblivious to his silence, she continued, "Did Mr. Usagi enjoy the
-waffles you brought him?" "You know him, he's not one to forego a waffle,
-no matter how burnt," he snickered.
-
-The pause was filled with the sound of compile errors.
-
-CHAPTER 2:
-The jelly was as dark as night, and just as runny.
-The Domo-Kun shuddered, remembering the way Mr. Usagi had speared his waffles
-with his fork, watching the runny jelly spread and pool across his plate,
-like the blood of a dying fawn. "It reminds me of that time --" he started, as
-his wife cut in quickly: "-- please. I can't bear to hear it.". A flury of
-images coming from the past flowed through his mind.
-
-"You recall what happened on Mulholland drive?" The ceiling fan rotated slowly
-overhead, barely disturbing the thick cigarette smoke. No doubt was left about
-when the fan was last cleaned.
-
-There was a poignant pause.
-
-CHAPTER 3:
-Mr. Usagi felt that something wasn't right. Shortly after the Domo-Kun left he
-began feeling sick. He thought out loud to himself, "No, he wouldn't have done
-that to me." He considered that perhaps he shouldn't have pushed so hard.
-Perhaps he shouldn't have been so cold and sarcastic, after the unimaginable
-horror that had occurred just the week before.
-
-Next time, there won't be any sushi. Why sushi with waffles anyway?  It's like
-adorning breakfast cereal with halibut -- shameful.
-
-CHAPTER 4:
-The taste of stale sushi in his mouth the next morning was unbearable. He
-wondered where the sushi came from as he attempted to wash the taste away with
-a bottle of 3000¥ sake. He tries to recall the cook's face.  Purple? Probably.
-
-CHAPTER 5:
-Many tears later, Mr. Usagi would laugh at the memory of the earnest,
-well-intentioned Domo-Kun. Another day in the life. That is when he realized that
-life goes on.
-
-TRUISMS (1978-1983)
-JENNY HOLZER
-A LITTLE KNOWLEDGE CAN GO A LONG WAY
-A LOT OF PROFESSIONALS ARE CRACKPOTS
-A MAN CAN'T KNOW WHAT IT IS TO BE A MOTHER
-A NAME MEANS A LOT JUST BY ITSELF
-A POSITIVE ATTITUDE MEANS ALL THE DIFFERENCE IN THE WORLD
-A RELAXED MAN IS NOT NECESSARILY A BETTER MAN
-NO ONE SHOULD EVER USE SVN
-AN INFLEXIBLE POSITION SOMETIMES IS A SIGN OF PARALYSIS
-IT IS MANS FATE TO OUTSMART HIMSELF
-BEING SURE OF YOURSELF MEANS YOU'RE A FOOL
-AM NOT
-ARE TOO
-IF AT FIRST YOU DON'T SUCCEED: TRY, EXCEPT, FINALLY
-AND THEN, TIME LEAPT BACKWARDS
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAaaaaaaaaaaaaaaaaaaaaaaaaaaaahhhh LOT
-I'm really tempted to change something above the line.
-Reeccciiiipppppeeeeeesssssss!!!!!!!!!
-PEOPLE SAY "FAILURE IS NOT AN OPTION", BUT FAILURE IS ALWAYS AN OPTION.
-WHAT GOES UP MUST HAVE A NON-ZERO VELOCITY
-
-I can feel the heat closing in, feel them out there making their moves...
-What could possibly go wrong? We've already ate our cake.
-
-Stand Still. Pause Clocks. We can make the World Stop.
-WUBWUBWUBWUBWUB
-
-I want a 1917 build and you will give me what I want.
-
-This sentence is false.
-
-Beauty is in the eyes of a Beholder.
-
-I'm the best at space.
-
-The first time Yossarian saw the chaplain, he fell madly in love with him.
-*
-*
-*
-Give not thyself up, then, to fire, lest it invert thee, deaden thee; as for
-the time it did me. There is a wisdom that is woe; but there is a woe that is
-madness. And there is a Catskill eagle in some souls that can alike dive down
-into the blackest gorges, and soar out of them again and become invisible in
-the sunny spaces. And even if he for ever flies within the gorge, that gorge
-is in the mountains; so that even in his lowest swoop the mountain eagle is
-still higher than other birds upon the plain, even though they soar.
-*
-*
-*
-
-I'm here to commit lines and drop rhymes
-*
-This is a line to test and try uploading a cl.
-
-And lo, in the year 2014, there was verily an attempt to upgrade to GCC 4.8 on
-the Android bots, and it was good. Except on one bot, where it was bad. And
-lo, the change was reverted, and GCC went back to 4.6, where code is slower
-and less optimized. And verily did it break the build, because artifacts had
-been created with 4.8, and alignment was no longer the same, and a great
-sadness descended upon the Android GN buildbot, and it did refuseth to build
-any more. But the sheriffs thought to themselves: Placebo! Let us clobber the
-bot, and perhaps it will rebuild with GCC 4.6, which hath worked for many many
-seasons. And so they modified the whitespace file with these immortal lines,
-and visited it upon the bots, that great destruction might be wrought upon
-their outdated binaries. In clobberus, veritas.
-
-As the git approaches, light begins to shine through the SCM thrice again...
-However, the git, is, after all, quite stupid.
-
-Suddenly Domo-Kun found itself in a room filled with dazzling mirrors.
-
-A herd of wild gits appears!  Time for CQ :D
-And one more for sizes.py...
-
-Sigh.
-
-It was love at first sight.  The moment Yossarian first laid eyes on the chaplain, he fell madly in love with him.
-
-Cool whitespace change for git-cl land
-
-Oh god the bots are red! I'm blind! Mmmm, cronuts.
-
-If you stand on your head, you will get footprints in your hair.
-
-sigh
-sigher
-pick up cls
-
-In the BUILD we trust.
-^_^
-
-In the masters we don't.
diff --git a/build/win/use_ansi_codes.py b/build/win/use_ansi_codes.py
index cff5f43..b24ae24 100755
--- a/build/win/use_ansi_codes.py
+++ b/build/win/use_ansi_codes.py
@@ -2,7 +2,7 @@
 # Copyright (c) 2015 The Chromium Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
-"""Prints if the the terminal is likely to understand ANSI codes."""
+"""Prints if the terminal is likely to understand ANSI codes."""
 
 import os
 
diff --git a/build/win_is_xtree_patched.py b/build/win_is_xtree_patched.py
deleted file mode 100755
index 3f1994f..0000000
--- a/build/win_is_xtree_patched.py
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Determines if the VS xtree header has been patched to disable C4702."""
-
-import os
-
-
-def IsPatched():
-  # TODO(scottmg): For now, just return if we're using the packaged toolchain
-  # script (because we know it's patched). Another case could be added here to
-  # query the active VS installation and actually check the contents of xtree.
-  # http://crbug.com/346399.
-  return int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', 1)) == 1
-
-
-def DoMain(_):
-  """Hook to be called from gyp without starting a separate python
-  interpreter."""
-  return "1" if IsPatched() else "0"
-
-
-if __name__ == '__main__':
-  print DoMain([])
diff --git a/build/win_precompile.gypi b/build/win_precompile.gypi
deleted file mode 100644
index fb86076..0000000
--- a/build/win_precompile.gypi
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Include this file to make targets in your .gyp use the default
-# precompiled header on Windows, in debug builds only as the official
-# builders blow up (out of memory) if precompiled headers are used for
-# release builds.
-
-{
-  'conditions': [
-    ['OS=="win" and chromium_win_pch==1', {
-        'target_defaults': {
-          'msvs_precompiled_header': '<(DEPTH)/build/precompile.h',
-          'msvs_precompiled_source': '<(DEPTH)/build/precompile.cc',
-          'sources': ['<(DEPTH)/build/precompile.cc'],
-        }
-      }],
-  ],
-}
diff --git a/dart.gyp b/dart.gyp
index c24fbc7..5e1508d 100644
--- a/dart.gyp
+++ b/dart.gyp
@@ -30,6 +30,7 @@
         'runtime/dart-runtime.gyp:process_test',
         'runtime/dart-runtime.gyp:test_extension',
         'runtime/dart-runtime.gyp:sample_extension',
+        'runtime/dart-runtime.gyp:generate_patched_sdk#host',
       ],
     },
     {
@@ -41,6 +42,8 @@
       'dependencies': [
         'runtime/dart-runtime.gyp:dart_precompiled_runtime',
         'runtime/dart-runtime.gyp:dart_bootstrap#host',
+        'runtime/dart-runtime.gyp:process_test',
+        'runtime/dart-runtime.gyp:generate_patched_sdk#host',
       ],
     },
     {
@@ -57,8 +60,10 @@
         'runtime/dart-runtime.gyp:process_test',
         'runtime/dart-runtime.gyp:test_extension',
         'runtime/dart-runtime.gyp:sample_extension',
+        'runtime/dart-runtime.gyp:generate_patched_sdk#host',
       ],
     },
+
     {
       'target_name': 'create_sdk',
       'type': 'none',
diff --git a/docs/language/dart.sty b/docs/language/dart.sty
index 6b21815..d22dde6 100644
--- a/docs/language/dart.sty
+++ b/docs/language/dart.sty
@@ -7,95 +7,75 @@
 \def\gt{$>$}
 \def\<{$\langle$}
 \def\>{$\rangle$}
-
-  \def\ABSTRACT{\builtinId{abstract}}
-  \def\AS{\builtinId{as}}  
-  \def\ASSERT{\keyword{assert}}
-  \def\ASYNC{\keyword{async}}
-  \def\AWAIT{\keyword{await}}
-  \def\BOOLEAN{\keyword{boolean}}
-  \def\BREAK{\keyword{break}}
-  \def\CASE{\keyword{case}}
-  \def\CLASS{\keyword{class}}
-   \def\CALL{\keyword{call}}
-  \def\CATCH{\keyword{catch}}
-  \def\CONST{\keyword{const}}
-  \def\CONTINUE{\keyword{continue}}
-  \def\DEFAULT{\keyword{default}}
-  \def\DEFERRED{\keyword{deferred}}
-  \def\DYNAMIC{\builtinId{dynamic}}
-  \def\DO{\keyword{do}}
-  \def\ELSE{\keyword{else}}
-  \def\ENUM{\keyword{enum}}
-  \def\EQUALS{\keyword{equals}}
-  \def\EXPORT{\builtinId{export}}
-  \def\EXTENDS{\keyword{extends}}
-  \def\EXTERNAL{\builtinId{external}}
-  \def\FACTORY{\builtinId{factory}}  
-  \def\FALSE{\keyword{false}}  
-  \def\FINAL{\keyword{final}} 
-  \def\FINALLY{\keyword{finally}}
-  \def\FOR{\keyword{for}}
-  \def\GET{\builtinId{get}}  
-  \def\HIDE{\keyword{hide}}
-  \def\IF{\keyword{if}}  
-  \def\IMPLEMENTS{\builtinId{implements}}
-  \def\IMPORT{\builtinId{import}}
-  \def\IN{\keyword{in}}
-  \def\INT{\keyword{int}}
-  \def\INTERFACE{\keyword{interface}}
-  \def\IS{\keyword{is}}
-  \def\LIBRARY{\builtinId{library}}
-  \def\NATIVE{\keyword{native}}  
-  \def\NEGATE{\keyword{negate}}  
-  \def\NEW{\keyword{new}}      
-  \def\NULL{\keyword{null}}
-  \def\ON{\keyword{on}}  
-  \def\OF{\keyword{of}}  
-  \def\OPERATOR{\builtinId{operator}}
-  \def\PART{\builtinId{part}} 
-  \def\PRIVATE{\keyword{private}}
-  \def\RETHROW{\keyword{rethrow}}
-  \def\RETURN{\keyword{return}}
-  \def\SET{\builtinId{set}} 
-  \def\SHOW{\keyword{show}} 
-  \def\SOURCE{\keyword{source}}  
-  \def\STATIC{\builtinId{static}}
-  \def\SUPER{\keyword{super}}  
-  \def\SWITCH{\keyword{switch}}  
-  \def\SYNC{\keyword{sync}}  
-  \def\THIS{\keyword{this}}
-  \def\THROW{\keyword{throw}}
-  \def\TRUE{\keyword{true}}
-  \def\TRY{\keyword{try}}
-  \def\TYPEDEF{\builtinId{typedef}}
-  \def\THIS{\keyword{this}}
-  \def\VAR{\keyword{var}}  
-  \def\VOID{\keyword{void}}
-  \def\WHILE{\keyword{while}}
-  \def\WITH{\keyword{with}}
-  \def\YIELD{\keyword{yield}} 
-
-
-
- 
- % \def\PUBLIC{\keyword{public}}
-
-  %\def\PROTECTED{\keyword{protected}}
-
-
-
-
-    
-
- 
-
-
-
- % \def\OUTER{\keyword{outer}}
-
-  \def\TRUE{\keyword{true}}
-
+\def\metavar#1{\ensuremath{\mathit{#1}}}
+\def\ABSTRACT{\builtinId{abstract}}
+\def\AS{\builtinId{as}}
+\def\ASSERT{\keyword{assert}}
+\def\ASYNC{\keyword{async}}
+\def\AWAIT{\keyword{await}}
+\def\BOOLEAN{\keyword{boolean}}
+\def\BREAK{\keyword{break}}
+\def\CASE{\keyword{case}}
+\def\CLASS{\keyword{class}}
+\def\CALL{\keyword{call}}
+\def\CATCH{\keyword{catch}}
+\def\CONST{\keyword{const}}
+\def\CONTINUE{\keyword{continue}}
+\def\DEFAULT{\keyword{default}}
+\def\DEFERRED{\keyword{deferred}}
+\def\DYNAMIC{\builtinId{dynamic}}
+\def\DO{\keyword{do}}
+\def\ELSE{\keyword{else}}
+\def\ENUM{\keyword{enum}}
+\def\EQUALS{\keyword{equals}}
+\def\EXPORT{\builtinId{export}}
+\def\EXTENDS{\keyword{extends}}
+\def\EXTERNAL{\builtinId{external}}
+\def\FACTORY{\builtinId{factory}}
+\def\FALSE{\keyword{false}}
+\def\FINAL{\keyword{final}}
+\def\FINALLY{\keyword{finally}}
+\def\FOR{\keyword{for}}
+\def\GET{\builtinId{get}}
+\def\HIDE{\keyword{hide}}
+\def\IF{\keyword{if}}
+\def\IMPLEMENTS{\builtinId{implements}}
+\def\IMPORT{\builtinId{import}}
+\def\IN{\keyword{in}}
+\def\INT{\keyword{int}}
+\def\INTERFACE{\keyword{interface}}
+\def\IS{\keyword{is}}
+\def\LIBRARY{\builtinId{library}}
+\def\NATIVE{\keyword{native}}
+\def\NEGATE{\keyword{negate}}
+\def\NEW{\keyword{new}}
+\def\NULL{\keyword{null}}
+\def\ON{\keyword{on}}
+\def\OF{\keyword{of}}
+\def\OPERATOR{\builtinId{operator}}
+\def\PART{\builtinId{part}}
+\def\PRIVATE{\keyword{private}}
+\def\RETHROW{\keyword{rethrow}}
+\def\RETURN{\keyword{return}}
+\def\SET{\builtinId{set}}
+\def\SHOW{\keyword{show}}
+\def\SOURCE{\keyword{source}}
+\def\STATIC{\builtinId{static}}
+\def\SUPER{\keyword{super}}
+\def\SWITCH{\keyword{switch}}
+\def\SYNC{\keyword{sync}}
+\def\THIS{\keyword{this}}
+\def\THROW{\keyword{throw}}
+\def\TRUE{\keyword{true}}
+\def\TRY{\keyword{try}}
+\def\TYPEDEF{\builtinId{typedef}}
+\def\THIS{\keyword{this}}
+\def\VAR{\keyword{var}}
+\def\VOID{\keyword{void}}
+\def\WHILE{\keyword{while}}
+\def\WITH{\keyword{with}}
+\def\YIELD{\keyword{yield}}
+\def\TRUE{\keyword{true}}
 
 \newenvironment{Q}[1]{{\bf #1}}
 
@@ -114,7 +94,6 @@
   %\end{verbatim}
 }
 
-
 % ----------------------------------------------------------------------
 % Support for hash valued Location Markers
 
@@ -144,4 +123,3 @@
   \vspace{-\baselineskip}\hspace{0pt}\OriginalLMHash{\raisebox{10ex}{#1}}%
   \label{#1}}
 % ----------------------------------------------------------------------
-
diff --git a/docs/language/dartLangSpec.tex b/docs/language/dartLangSpec.tex
index e826260a..a01d8eb2 100644
--- a/docs/language/dartLangSpec.tex
+++ b/docs/language/dartLangSpec.tex
@@ -5,10 +5,11 @@
 \usepackage{bnf}
 \usepackage{hyperref}
 \usepackage{lmodern}
+\usepackage[T1]{fontenc}
 \newcommand{\code}[1]{{\sf #1}}
 \title{Dart Programming Language  Specification  \\
 {4th edition draft}\\
-{\large Version 1.14}}
+{\large Version 1.15.0}}
 
 % For information about Location Markers (and in particular the
 % commands \LMHash and \LMLabel), see the long comment at the
@@ -38,7 +39,7 @@
 A conforming  implementation of the Dart programming language must provide and support all the  APIs (libraries, types, functions, getters, setters, whether top-level, static, instance or local) mandated in this specification.
 
 \LMHash{}
-A conforming implementation is permitted to provide additional APIs, but not additional syntax, except for experimental features in support of null-aware cascades and tear-offs that are likely to be introduced in the next revision of this specification.
+A conforming implementation is permitted to provide additional APIs, but not additional syntax, except for experimental features in support of null-aware cascades that are likely to be introduced in the next revision of this specification.
 
 \section{Normative References}
 \LMLabel{ecmaNormativeReferences}
@@ -138,6 +139,10 @@
 When the specification refers to the order given in the program, it means the order of the program source code text, scanning left-to-right and top-to-bottom.
 
 \LMHash{}
+When the specification refers to a {\em fresh variable}, it means a variable with a name that doesn't occur anywhere in the current program.
+When the specification introduces a fresh variable bound to a value, the fresh variable is implicitly bound in a surrounding scope.
+
+\LMHash{}
 References to otherwise unspecified names of program entities (such as classes or functions) are interpreted as the names of members of the Dart core library.
 
 \commentary{
@@ -163,7 +168,7 @@
 }
 
 \LMHash{}
-In checked mode, assignments are dynamically checked, and certain violations of the type system raise exceptions at run time.
+In checked mode, assignments are dynamically checked, and certain violations of the type system throw exceptions at run time.
 
 \commentary{
 The coexistence between optional typing and reification is based on the following:
@@ -214,7 +219,7 @@
 
 \begin{dartCode}
 \CLASS{} HighlyStrung \{
-  String() $=>$ "?";
+  String() => "?";
 \}
 \end{dartCode}
 
@@ -233,15 +238,15 @@
 
 \LIBRARY{} L2;
 \IMPORT{} `L1.dart';
-foo() =$>$ 42;
-\CLASS{} C \EXTENDS{} S\{ bar() =$>$ foo();\}
+foo() => 42;
+\CLASS{} C \EXTENDS{} S\{ bar() => foo();\}
 \end{dartCode}
 
 \rationale{Now assume a method \code{foo()} is added to \code{S}. }
 
 \begin{dartCode}
 \LIBRARY{} L1;
-\CLASS{} S \{foo() =$>$ 91;\}
+\CLASS{} S \{foo() => 91;\}
 \end{dartCode}
 
 \rationale{
@@ -324,12 +329,11 @@
 {\em Dynamic type errors} are type errors reported in checked mode.
 
 \LMHash{}
-{\em Run-time errors} are exceptions raised during execution. Whenever we say that an exception $ex$ is {\em raised} or {\em thrown}, we mean that a throw expression  (\ref{throw}) of the form: \code{\THROW{} $ex$;} was implicitly evaluated or that a rethrow statement (\ref{rethrow}) of the form \code{\RETHROW} was executed. When we say that {\em a} $C$ {\em is thrown}, where $C$ is a class, we mean that an instance of class $C$ is thrown. When we say that a stream raises an exception, we mean that an exception occurred while computing the value(s) of the stream.
+{\em Run-time errors} are exceptions thrown during execution. Whenever we say that an exception $ex$ is {\em thrown}, it acts like an expression had {\em thrown} (\ref{completion}) with $ex$ as exception object and with a stack trace corresponding to the current system state. When we say that {\em a} $C$ {\em is thrown}, where $C$ is a class, we mean that an instance of class $C$ is thrown.
 
 \LMHash{}
 If an uncaught exception is thrown by a running isolate $A$, $A$ is immediately suspended.
 
-
 \section{Variables}
 \LMLabel{variables}
 
@@ -570,7 +574,7 @@
 }
 
 OR
-\item of the form   \code{=$>$ $e$} which is equivalent to a body of the form \code{\{\RETURN{} $e$;\}} or the form \code{\ASYNC{} =$>$ $e$} which is equivalent to a body of the form \code{\ASYNC{} \{\RETURN{} $e$;\}}. \rationale{The other modifiers do not apply here, because they apply only to generators, discussed below, and generators do not allow the form \code{\RETURN{} $e$}; values are added to the generated stream or iterable using \YIELD{} instead.}
+\item of the form   \code{=> $e$} which is equivalent to a body of the form \code{\{\RETURN{} $e$;\}} or the form \code{\ASYNC{} => $e$} which is equivalent to a body of the form \code{\ASYNC{} \{\RETURN{} $e$;\}}. \rationale{The other modifiers do not apply here, because they apply only to generators, discussed below, and generators do not allow the form \code{\RETURN{} $e$}; values are added to the generated stream or iterable using \YIELD{} instead.}
 
 \end{itemize}
 
@@ -592,7 +596,9 @@
 One could allow modifiers for factories. A factory for \code{Future} could be modified by \ASYNC{}, a factory for \code{Stream} could be modified by \ASYNC* and a factory for \code{Iterable} could be modified by \SYNC*. No other scenario makes sense because the object returned by the factory would be of the wrong type. This situation is very unusual so it is not worth making an exception to the general rule for constructors in order to allow it.
 }
 \LMHash{}
-It is a static warning if the declared return type of a function marked \ASYNC{} may not be assigned to \code{Future}. It is a static warning if the declared return type of a function marked \SYNC* may not be assigned to \code{Iterable}. It is a static warning if the declared return type of  a function marked \ASYNC* may not be assigned to \code{Stream}.
+It is a static warning if the declared return type of a function marked \ASYNC{} is not a supertype of \code{Future<\mbox{$T$}>} for some type $T$.
+It is a static warning if the declared return type of a function marked \SYNC* is not a supertype of \code{Iterable<\mbox{$T$}>} for some type $T$.
+It is a static warning if the declared return type of a function marked \ASYNC* is not a supertype of \code{Stream<\mbox{$T$}>} for some type $T$.
 
 \subsection{Function Declarations}
 \LMLabel{functionDeclarations}
@@ -739,14 +745,25 @@
 
 \begin{grammar}
 {\bf defaultFormalParameter:}
-      normalFormalParameter ('=' expression)?
+      normalFormalParameter (`=' expression)?
     .
 
-{\bf defaultNamedParameter:}
+{\bf defaultNamedParameter:}normalFormalParameter (`=' expression)?;
       normalFormalParameter ( `{\escapegrammar :}' expression)?
     .
 \end{grammar}
 
+A {\bf defaultNamedParameter} on the form:
+\begin{code}
+   normalFormalParameter : expression
+\end{code}
+is equivalent to one on the form:
+\begin{code}
+   normalFormalParameter = expression
+\end{code}
+The colon-syntax is included only for backwards compatibility.
+It is deprecated and will be removed in a later version of the language specification.
+
 \LMHash{}
 It is a compile-time error if the default value of an optional parameter is not a compile-time constant (\ref{constants}). If no default is explicitly specified for an optional parameter an implicit default of \NULL{} is provided.
 
@@ -801,7 +818,7 @@
 }
 
 \LMHash{}
-An external function is connected to its body by an implementation specific mechanism. Attempting to invoke an external function that has not been connected to its body will raise a \code{NoSuchMethodError} or some subclass thereof.
+An external function is connected to its body by an implementation specific mechanism. Attempting to invoke an external function that has not been connected to its body will throw a \code{NoSuchMethodError} or some subclass thereof.
 
 \LMHash{}
 The actual syntax is given in sections \ref{classes} and \ref{librariesAndScripts} below.
@@ -863,6 +880,7 @@
 \LMHash{}
 A class has constructors,  instance members and static members. The instance members of a class are its instance methods, getters, setters and instance variables. The static members of a class are its static methods, getters, setters and static variables. The members of a class are its static and instance members.
 
+\LMHash{}
 A class has several scopes:
 \begin{itemize}
 \item A {\em type-parameter scope}, which is empty if the class is not generic (\ref{generics}).  The enclosing scope of the type-parameter scope of a class is the enclosing scope of the class declaration.
@@ -871,8 +889,10 @@
 The enclosing scope of a class' instance scope is the class' static scope.
 \end{itemize}
 
+\LMHash{}
 The enclosing scope of an instance member declaration is the instance scope of the class in which it is declared.
 
+\LMHash{}
 The enclosing scope of a static member declaration is the static scope of the class in which it is declared.
 
 
@@ -915,7 +935,7 @@
 \CLASS{} A \{
   \VAR{} i = 0;
   \VAR{} j;
-  f(x) =$>$ 3;
+  f(x) => 3;
 \}
 
 \CLASS{} B \EXTENDS{} A \{
@@ -924,7 +944,7 @@
   //instance getter \& setter
 
   /* compile-time error: static method conflicts with instance method */
-  \STATIC{} f(x) =$>$ 3;
+  \STATIC{} f(x) => 3;
 \}
 \end{dartCode}
 
@@ -980,11 +1000,11 @@
 An operator declaration is identified using the built-in identifier (\ref{identifierReference}) \OPERATOR{}.
 
 \LMHash{}
-The following names are allowed for user-defined operators: \code{$<$, $>$, $<$=, $>$=, ==,  -, +, /, \~{}/, *, \%, $|$, \^{}, \&, $<<$, $>>$,  []=, [], \~{}.}
+The following names are allowed for user-defined operators: \code{<, >, <=, >=, ==,  -, +, /, \~{}/, *, \%, $|$, \^{}, \&, $<<$, $>>$,  []=, [], \~{}.}
 
 
 \LMHash{}
-It is a compile-time error if the arity of the user-declared operator \code{[]=} is not 2. It is a compile-time error if the arity of a user-declared operator with one of the names:  \code{ $<$, $>$, $<$=, $>$=, ==, -, +,  \~{}/, /, *, \%, $|$, \^{}, \&, $<<$, $>>$, []} is not 1. It is a compile-time error if the arity of the user-declared operator  \code{-} is not 0 or 1.
+It is a compile-time error if the arity of the user-declared operator \code{[]=} is not 2. It is a compile-time error if the arity of a user-declared operator with one of the names:  \code{ <, >, <=, >=, ==, -, +,  \~{}/, /, *, \%, $|$, \^{}, \&, $<<$, $>>$, []} is not 1. It is a compile-time error if the arity of the user-declared operator  \code{-} is not 0 or 1.
 
 \commentary{
 The \code{-} operator is unique in that two overloaded versions are permitted. If the operator has no arguments, it denotes unary minus. If it has an argument, it denotes binary subtraction.
@@ -1129,12 +1149,12 @@
 
 \begin{dartCode}
  class Base \{
-    int get one =$>$ 1;
+    int get one => 1;
  \}
 
  abstract class Mix \{
     int get one;
-    int get two =$>$ one + one;
+    int get two => one + one;
  \}
 
  class C extends Base with Mix \{ \}
@@ -1195,7 +1215,8 @@
 \LMLabel{constructors}
 
 \LMHash{}
-A {\em constructor} is a special function that is used in instance creation expressions (\ref{instanceCreation}) to produce objects. Constructors may be generative (\ref{generativeConstructors}) or they may be factories (\ref{factories}).
+A {\em constructor} is a special function that is used in instance creation expressions (\ref{instanceCreation}) to obtain objects, typically by creating or initializing them.
+Constructors may be generative (\ref{generativeConstructors}) or they may be factories (\ref{factories}).
 
 \LMHash{}
 A {\em constructor name} always begins with the name of its immediately enclosing class, and may optionally be followed by a dot and an identifier $id$. It is a compile-time error if $id$ is the name of a member  declared in the immediately enclosing class. It is a compile-time error if the name of a  constructor is not a constructor name.
@@ -1212,7 +1233,7 @@
 \LMLabel{generativeConstructors}
 
 \LMHash{}
-A {\em generative constructor} consists of a constructor name, a constructor parameter list, and either a redirect clause or an  initializer list and an optional body.
+A {\em generative constructor} consists of a constructor name, a constructor parameter list, and either a redirect clause or an initializer list and an optional body.
 
 \begin{grammar}
 {\bf constructorSignature:}
@@ -1221,10 +1242,10 @@
  \end{grammar}
 
 \LMHash{}
-A {\em constructor parameter list} is a parenthesized, comma-separated list of formal constructor parameters. A {\em formal constructor parameter} is either a formal parameter (\ref{formalParameters}) or an initializing formal. An {\em initializing formal} has the form \code{\THIS{}.id}, where \code{id} is the name of an instance variable of the immediately enclosing class.  It is a compile-time error if \code{id} is not an instance variable of the immediately enclosing class. It is a compile-time error if an initializing formal is used by a function other than a non-redirecting generative constructor.
+A {\em constructor parameter list} is a parenthesized, comma-separated list of formal constructor parameters. A {\em formal constructor parameter} is either a formal parameter (\ref{formalParameters}) or an initializing formal. An {\em initializing formal} has the form \code{\THIS{}.$id$}, where $id$ is the name of an instance variable of the immediately enclosing class.  It is a compile-time error if $id$ is not an instance variable of the immediately enclosing class. It is a compile-time error if an initializing formal is used by a function other than a non-redirecting generative constructor.
 
 \LMHash{}
-If an explicit type is attached to the initializing formal, that is its static type. Otherwise, the type of an initializing formal named \code{id} is $T_{id}$, where $T_{id}$ is the type of the field named \code{id} in the immediately enclosing class. It is a static warning if the static type of \code{id} is not assignable to $T_{id}$.
+If an explicit type is attached to the initializing formal, that is its static type. Otherwise, the type of an initializing formal named $id$ is $T_{id}$, where $T_{id}$ is the type of the field named $id$ in the immediately enclosing class. It is a static warning if the static type of $id$ is not assignable to $T_{id}$.
 
 \LMHash{}
 Initializing formals constitute an exception to the rule that every formal parameter introduces a local variable into the formal parameter scope (\ref{formalParameters}).
@@ -1238,7 +1259,7 @@
 }
 
 \LMHash{}
-Initializing formals are executed during the execution of generative constructors detailed below. Executing an initializing formal  \code{\THIS{}.id} causes the field \code{id} of the immediately surrounding class to be assigned the value of the corresponding actual parameter, unless $id$ is a final variable that has already been initialized, in which case a runtime error occurs.
+Initializing formals are executed during the execution of generative constructors detailed below. Executing an initializing formal  \code{\THIS{}.$id$} causes the field $id$ of the immediately surrounding class to be assigned the value of the corresponding actual parameter, unless $id$ is a final variable that has already been initialized, in which case a runtime error occurs.
 
 
 \commentary{
@@ -1284,9 +1305,6 @@
     .
 \end{grammar}
 
-% Need to specify exactly how executing a redirecting constructor works
-
-
 %\Q{We now have generative constructors with no bodies as well.}
 
 \paragraph{Initializer Lists}
@@ -1295,7 +1313,7 @@
 \LMHash{}
 An initializer list begins with a colon, and consists of a comma-separated list of individual {\em initializers}. There are two kinds of initializers.
 \begin{itemize}
-\item A {\em superinitializer} identifies a {\em superconstructor} - that is, a specific  constructor of the superclass.  Execution of the superinitializer causes the initializer list of the superconstructor to be executed.
+\item A {\em superinitializer} identifies a {\em superconstructor} - that is, a specific constructor of the superclass.  Execution of the superinitializer causes the initializer list of the superconstructor to be executed.
 
 \item An {\em instance variable initializer} assigns a value to an individual instance variable.
 \end{itemize}
@@ -1324,7 +1342,7 @@
 Each final instance variable $f$ declared in the immediately enclosing class must have an initializer in $k$'s initializer list unless it has already been initialized by one of the following means:
  \begin{itemize}
  \item Initialization at the declaration of $f$.
- \item Initialization by  means of an initializing formal of $k$.
+ \item Initialization by means of an initializing formal of $k$.
  \end{itemize}
 
 or a static warning occurs. It is a compile-time error if $k$'s initializer list contains an initializer for a variable that is not an instance variable declared in the immediately surrounding class.
@@ -1334,12 +1352,14 @@
 }
 
 \LMHash{}
- It is a compile-time error if a  generative constructor of class \code{Object} includes a superinitializer.
+It is a compile-time error if a generative constructor of class \code{Object} includes a superinitializer.
 
 \LMHash{}
-Execution of a generative constructor $k$ is always done with respect to a set of bindings for its formal parameters and with  \THIS{} bound to a fresh instance $i$ and the type parameters of the immediately enclosing class bound to a set of actual type arguments $V_1, \ldots , V_m$.
+Execution of a generative constructor $k$ of type $T$ to initialize a fresh instance $i$
+is always done with respect to a set of bindings for its formal parameters
+and the type parameters of the immediately enclosing class bound to a set of actual type arguments of $T$, $V_1, \ldots , V_m$.
 
-\commentary{These bindings are usually determined by the instance creation expression that invoked the constructor (directly or indirectly). However, they may also be determined by a reflective call,.
+\commentary{These bindings are usually determined by the instance creation expression that invoked the constructor (directly or indirectly). However, they may also be determined by a reflective call.
 }
 
 \LMHash{}
@@ -1347,36 +1367,63 @@
 
 \THIS{}$.g(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$
 
-where $g$ identifies another  generative constructor of the immediately surrounding class. Then execution of $k$ proceeds by evaluating the argument list $(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$, and then executing $g$ with respect to the bindings resulting from the evaluation of $(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ and with  \THIS{} bound to $i$ and the type parameters of the immediately enclosing class bound to $V_1, \ldots , V_m$.
+where $g$ identifies another  generative constructor of the immediately surrounding class. Then execution of $k$ to initialize $i$ proceeds by evaluating the argument list $(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$, and then executing $g$ to initialize $i$ with respect to the bindings resulting from the evaluation of $(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ and with  \THIS{} bound to $i$ and the type parameters of the immediately enclosing class bound to $V_1, \ldots , V_m$.
 
 \LMHash{}
 Otherwise, execution  proceeds as follows:
 
 \LMHash{}
-%First, a fresh instance (\ref{generativeConstructors}) $i$ of the immediately enclosing class is allocated.  Next, the instance variable declarations of the immediately enclosing class are visited in the order they appear in the program text. For each such declaration $d$, if $d$ has the form  \code{$finalConstVarOrType$ $v$ = $e$; } then the instance variable $v$ of $i$ is bound to the value of $e$ (which is necessarily a compile-time constant).
-%Next, a
+The instance variable declarations of the immediately enclosing class are visited in the order they appear in the program text.
+For each such declaration $d$, if $d$ has the form \code{$finalConstVarOrType$ $v$ = $e$; }
+then $e$ is evaluated to an object $o$
+and the instance variable $v$ of $i$ is bound to $o$.
+
+\LMHash{}
 Any initializing formals declared in $k$'s parameter list are executed in the order they appear in the program text.
 % In fact, this order is unobservable; this could be done any time prior to running the body, since
 % these only effect \THIS{}.
-Then, $k$'s  initializers are executed in the order they appear in the program.
+Then, the initializers of $k$'s initializer list are executed to initialize $i$
+in the order they appear in the program.
 
-\rationale {We could observe the order by side  effecting external routines called. So we need to specify the order.}
+\rationale {We could observe the order by side effecting external routines called. So we need to specify the order.}
 
 \LMHash{}
-After all the initializers  have completed, the body of $k$ is executed  in a scope where \THIS{} is bound to $i$. Execution of the body begins with execution of the body of the superconstructor  with \THIS{} bound to $i$, the type parameters of the immediately enclosing class bound to a set of actual type arguments $V_1, \ldots , V_m$ and the formal parameters bindings determined by the argument list of the superinitializer of $k$.
+Then if any instance variable of $i$ declared by the immediately enclosing class
+is not yet bound to a value,
+it is a dynamic error if such a variable is a \FINAL{} variable,
+otherwise all such variables are initialized with the \NULL{} value.
 
-\rationale{
-This process ensures that no uninitialized final field is ever seen by code. Note that \THIS{} is not in scope on the right hand side of an initializer (see \ref{this}) so no instance method can execute during initialization: an instance method cannot be directly invoked, nor can  \THIS{} be passed into any other code being invoked in the initializer.
+\LMHash{}
+Then, unless the enclosing class is \code{Object}, the explicitly specified or
+implicitly added superinitializer (\ref{initializerLists}) is executed to
+further initialize $i$.
+
+\commentary{
+The super constructor call can be written anywhere
+in the initializer list of $k$,
+but the actual call always happens after all initializers have been processed.
+It is not equivalent to moving the super call to the end of the initializer list
+because the argument expressions may have visible side effects
+which must happen in the order the expressions occur in the program text.
 }
 
 \LMHash{}
-Execution of an initializer of the form \code{\THIS{}.$v$ = $e$} proceeds as follows:
+After the superinitializer has completed, the body of $k$ is executed in a scope where \THIS{} is bound to $i$.
+
+\rationale{
+This process ensures that no uninitialized final field is ever seen by code. Note that \THIS{} is not in scope on the right hand side of an initializer (see \ref{this}) so no instance method can execute during initialization: an instance method cannot be directly invoked, nor can \THIS{} be passed into any other code being invoked in the initializer.
+}
 
 \LMHash{}
-First, the expression $e$ is evaluated to an object $o$. Then, the instance variable $v$ of the object denoted by \THIS{} is bound to $o$, unless $v$ is a final variable that has already been initialized, in which case a runtime error occurs. In checked mode, it is a dynamic type error if $o$ is not \NULL{} and the interface of the class of $o$ is not a subtype of the actual type of the field $v$.
+During the execution of a generative constructor to initialize an instance $i$,
+execution of an initializer of the form \code{\THIS{}.$v$ = $e$}
+proceeds as follows:
 
 \LMHash{}
-An initializer of the form \code{$v$ = $e$} is equivalent to an initializer of the form  \code{\THIS{}.$v$ = $e$}.
+First, the expression $e$ is evaluated to an object $o$. Then, the instance variable $v$ of $i$ is bound to $o$, unless $v$ is a final variable that has already been initialized, in which case a runtime error occurs. In checked mode, it is a dynamic type error if $o$ is not \NULL{} and the interface of the class of $o$ is not a subtype of the actual type of the field $v$.
+
+\LMHash{}
+An initializer of the form \code{$v$ = $e$} is equivalent to an initializer of the form \code{\THIS{}.$v$ = $e$}.
 
 \LMHash{}
 Execution of a superinitializer of the form
@@ -1391,10 +1438,17 @@
 First, the argument list $(a_1, \ldots, a_n, x_{n+1}: a_{n+1}, \ldots, x_{n+k}: a_{n+k})$ is evaluated.
 
 \LMHash{}
-Let $C$ be the class in which the superinitializer appears and let $S$ be the superclass of $C$.  If $S$ is generic (\ref{generics}), let $U_1, , \ldots, U_m$ be the actual type arguments passed to $S$ in the superclass clause of $C$.
+Then, after the remainder of the initializer list of $k$ has been executed,
+the superconstructor is executed as follows:
 
 \LMHash{}
-Then, the initializer list of the constructor $S$ (respectively $S.id$) is executed with respect to the bindings that resulted from the evaluation of the argument list,  with \THIS{} bound to the current binding of \THIS{}, and  the type parameters (if any) of class $S$ bound to the current bindings of $U_1, , \ldots, U_m$.
+Let $C$ be the class in which the superinitializer appears and let $S$ be the superclass of $C$.  If $S$ is generic (\ref{generics}), let $U_1, \ldots, U_m$ be the actual type arguments passed to $S$ in the superclass clause of $C$.
+
+\LMHash{}
+The generative constructor $S$ (respectively $S.id$) of $S$ is executed
+to initialize $i$ with respect to the bindings that resulted from the evaluation of
+$(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$,
+and the type parameters (if any) of class $S$ bound to $U_1, \ldots, U_m$.
 
 \LMHash{}
 It is a compile-time error if class $S$ does not declare a generative constructor named $S$ (respectively $S.id$).
@@ -1427,7 +1481,6 @@
 
 \rationale{Factories address classic weaknesses associated with constructors in other languages.
 Factories can produce instances that are not freshly allocated: they can come from a cache. Likewise, factories can return instances of different classes.
-
 }
 
 \paragraph{Redirecting Factory Constructors}
@@ -1484,25 +1537,25 @@
 
 
 %\begin{dartCode}
-%\CLASS{} W$<$T$>$ \IMPLEMENTS{} A$<$T$>$ { W(w) {...} ...}
-%\CLASS{} X$<$T$>$ \IMPLEMENTS{} A$<$T$>$ { X(x) {...} ...}
-%\CLASS{} Y$<$T$>$ \IMPLEMENTS{} A$<$T$>$ { Y(y) {...} ...}
-%\CLASS{} Z$<$T$>$ \IMPLEMENTS{} A$<$T$>$ { Z(z) {...} ...}
+%\CLASS{} W<T> \IMPLEMENTS{} A<T> { W(w) {...} ...}
+%\CLASS{} X<T> \IMPLEMENTS{} A<T> { X(x) {...} ...}
+%\CLASS{} Y<T> \IMPLEMENTS{} A<T> { Y(y) {...} ...}
+%\CLASS{} Z<T> \IMPLEMENTS{} A<T> { Z(z) {...} ...}
 
 
-%\CLASS{} F$<$T$>$ { // note that F does not implement A
-%  \STATIC{} F$<$T$>$ idw(w) $=>$ \NEW{}  W$<$T$>$(w); // illegal - T not in scope in idw
-%  \FACTORY{} F.idx(x) $=>$ \NEW{} X$<$T$>$(x);
-%  \FACTORY{} F.idy(y) $=>$ \NEW{} Y$<$T$>$(y);
-%  \STATIC{} F idz(z) $=>$ \NEW{}  Z(z); // does not capture the type argument
+%\CLASS{} F<T> { // note that F does not implement A
+%  \STATIC{} F<T> idw(w) => \NEW{}  W<T>(w); // illegal - T not in scope in idw
+%  \FACTORY{} F.idx(x) => \NEW{} X<T>(x);
+%  \FACTORY{} F.idy(y) => \NEW{} Y<T>(y);
+%  \STATIC{} F idz(z) => \NEW{}  Z(z); // does not capture the type argument
 %}
 
-%\CLASS{} A$<$T$>${
-%  \FACTORY{} A.idw(w) $=>$ F$<$T$>$.idw(w);
+%\CLASS{} A<T>{
+%  \FACTORY{} A.idw(w) => F<T>.idw(w);
 %// illegal - cannot pass type parameter to static method
-%  \FACTORY{} A.idx(x) $=> \NEW{} $F$<$T$>$.idx(x); // works, but allocates a gratuitous instance of F
-%  \FACTORY{} A.idy(y) = Y$<$T$>$; // works
-%  \FACTORY{} A.idz(z) $=>$ F.idz(z); // wrong - returns Z$<$Dynamic$>$; no way to pass type argument
+%  \FACTORY{} A.idx(x) $=> \NEW{} $F<T>.idx(x); // works, but allocates a gratuitous instance of F
+%  \FACTORY{} A.idy(y) = Y<T>; // works
+%  \FACTORY{} A.idz(z) => F.idz(z); // wrong - returns Z<Dynamic>; no way to pass type argument
 }
 %\end{dartCode}
 
@@ -1740,7 +1793,7 @@
 class T \{\}
 
 /* Compilation error: Attempt to subclass a type parameter */
-class G$<$T$>$ extends T \{\}
+class G<T> extends T \{\}
 
 \end{dartCode}
 
@@ -2156,8 +2209,8 @@
   \STATIC{} \CONST{} E id$_0$ = \CONST{} E(0);
   $\ldots$
   \STATIC{} \CONST{} E id$_{n-1}$ = const E(n - 1);
-  \STATIC{} \CONST{} List$<$E$>$ values = const $<$E$>$[id$_0 \ldots $ id$_{n-1}$];
-  String toString() =$>$ \{ 0: `E.id$_0$', $\ldots$, n-1: `E.id$_{n-1}$'\}[index]
+  \STATIC{} \CONST{} List<E> values = const <E>[id$_0 \ldots $ id$_{n-1}$];
+  String toString() => \{ 0: `E.id$_0$', $\ldots$, n-1: `E.id$_{n-1}$'\}[index]
 \}
 \end{dartCode}
 
@@ -2197,12 +2250,12 @@
 }
 
 \begin{dartCode}
-\INTERFACE{} Ordered$<$T$>$ \{
-  operator $>$ (T x);
+\INTERFACE{} Ordered<T> \{
+  operator > (T x);
 \}
 
-\CLASS{} Sorter$<$T \EXTENDS{} Ordered$<$T$>>$ \{
-   sort(List$<$T$>$ l) {... l[n] $<$ l[n+1] ...}
+\CLASS{} Sorter<T \EXTENDS{} Ordered<T$>>$ \{
+   sort(List<T> l) {... l[n] < l[n+1] ...}
 \}
 
 \end{dartCode}
@@ -2229,23 +2282,23 @@
 %\rationale {A typical recursive type declaration such as}
 
 %\begin{dartCode}
-%\CLASS{} B$<$S$>$ \{\}
-%\CLASS{} D$<$T$>$ \EXTENDS{} B$<$D$<$T$>>$ \{\}
+%\CLASS{} B<S> \{\}
+%\CLASS{} D<T> \EXTENDS{} B<D<T$>>$ \{\}
 %\end{dartCode}
 
 %\rationale{
-%poses no problem under this rule. The instantiation \cd{D$<$T$>$} has an induced
-%set consisting of: \cd{B$<$D$<$T$>>$, Object, D$<$T$>$, T}. However, the following variant
+%poses no problem under this rule. The instantiation \cd{D<T>} has an induced
+%set consisting of: \cd{B<D<T$>>$, Object, D<T>, T}. However, the following variant
 %}
 
 %\begin{dartCode}
-%\CLASS{} B$<$S$>$ \{\}
-%\CLASS{} D$<$T$>$ \EXTENDS{} B$<$D$<$D$<$T$>>>$ \{\}
+%\CLASS{} B<S> \{\}
+%\CLASS{} D<T> \EXTENDS{} B<D<D<T$>>>$ \{\}
 %\end{dartCode}
 
 %\rationale{
-%is disallowed. Consider again the instantiation \cd{D$<$T$>$}. It leads to the
-%superclass \cd{B$<$D$<$D$<$T$>>>$}, and so adds \cd{D$<$D$< $T$>>$} to the induced set. The latter in turn leads to  \cd{B$<$D$<$D$<$D$<$T$>>>>$} and \cd{D$<$D$<$D$<$T$>>>$}
+%is disallowed. Consider again the instantiation \cd{D<T>}. It leads to the
+%superclass \cd{B<D<D<T$>>>$}, and so adds \cd{D<D$< $T$>>$} to the induced set. The latter in turn leads to  \cd{B<D<D<D<T$>>>>$} and \cd{D<D<D<T$>>>$}
 %and so on ad infinitum.}
 
 %\commentary{
@@ -2335,8 +2388,20 @@
 \LMLabel{expressions}
 
 \LMHash{}
-An {\em expression} is a fragment of Dart code that can be evaluated at run time to yield a {\em value}, which is always an object. Every expression has an associated static type (\ref{staticTypes}). Every value has an associated dynamic type (\ref{dynamicTypeSystem}).
+\label{evaluation}
+An {\em expression} is a fragment of Dart code that can be evaluated at run time.
+Evaluating an expression either {\em produces a value} (an object),
+or it {\em throws} an exception object and an associated stack trace.
+In the former case, we also say that the expression {\em evaluates to a value}.
 
+\LMHash{}
+Every expression has an associated static type (\ref{staticTypes}).
+Every value has an associated dynamic type (\ref{dynamicTypeSystem}).
+
+\LMHash{}
+If evaluation of one expression, $e$, is defined in terms of evaluation of another expression, typically a subexpression of $e$,
+and the evaluation of the other expression throws an exception and a stack trace,
+the evaluation of $e$ stops at that point and throws the same exception object and stack trace.
 
 \begin{grammar}
 
@@ -2363,7 +2428,6 @@
       literal;
       identifier;
       newExpression;
-      \NEW{} type `\#' (`{\escapegrammar .}' identifier)?;
       constObjectExpression;
       `(' expression `)'
     .
@@ -2445,7 +2509,7 @@
 \item An expression of one of the forms \code{!$e$}, \code{$e_1$ \&\& $e_2$} or \code{$e_1 || e_2$}, where  $e$, $e_1$ and $e_2$ are constant expressions that evaluate to a boolean value.
 \item An expression of one of the forms \~{}$e$, $e_1$ \^{} $e_2$, \code{$e_1$ \& $e_2$}, $e_1 | e_2$, $e_1 >> e_2$ or $e_1 <<  e_2$, where  $e$, $e_1$ and $e_2$ are constant expressions that evaluate to an integer value  or to \NULL{}.
 \item An expression of the form \code{$e_1 + e_2$} where $e_1$ and $e_2$ are constant expressions that evaluate to a numeric or string value or to \NULL{}.
-\item An expression of one of the forms \code{$-e$}, \code{$e_1$ - $e_2$}, \code{$e_1$ * $e_2$}, \code{$e_1$ / $e_2$,} \code{$e_1$ \~{}/ $e_2$},  \code{$e_1  >  e_2$}, \code{$e_1  <  e_2$}, \code{$e_1$ $>$= $e_2$}, \code{$e_1$ $<$= $e_2$} or \code{$e_1$ \% $e_2$},  where $e$, $e_1$ and $e_2$ are constant expressions that evaluate to a numeric value  or to \NULL{}.
+\item An expression of one of the forms \code{$-e$}, \code{$e_1$ - $e_2$}, \code{$e_1$ * $e_2$}, \code{$e_1$ / $e_2$,} \code{$e_1$ \~{}/ $e_2$},  \code{$e_1  >  e_2$}, \code{$e_1  <  e_2$}, \code{$e_1$ >= $e_2$}, \code{$e_1$ <= $e_2$} or \code{$e_1$ \% $e_2$},  where $e$, $e_1$ and $e_2$ are constant expressions that evaluate to a numeric value  or to \NULL{}.
 \item An expression of the form \code{$e_1$?$e_2$:$e3$} where $e_1$, $e_2$ and $e_3$ are constant expressions and $e_1$ evaluates to a boolean value.
 \item An expression of the form \code{$e_1 ?? e_2$} where $e_1$ and $e_2$ are constant expressions.
 \item An expression of the form \code{$e$.length} where $e$ is a constant expression that evaluates to a string value.
@@ -2456,13 +2520,13 @@
 % designed so constants do not depend on check diode being on or not.
 
 \LMHash{}
-It is a compile-time error if an expression is required to be a constant expression but its evaluation  would raise an exception.
+It is a compile-time error if an expression is required to be a constant expression but its evaluation would throw an exception.
 
 % so, checked mode? analyzers? editor/development compilers?
 \commentary{
 Note that there is no requirement that every constant expression evaluate correctly. Only when a constant expression is required (e.g., to initialize a constant variable, or as a default value of a formal parameter, or as metadata) do we insist that a constant expression actually be evaluated successfully at compile time.
 
-The above is not dependent on program control-flow. The mere presence of a required compile time constant whose evaluation would fail within a program is an error.  This also holds recursively: since compound constants are composed out of constants, if any subpart of a constant  would raise an exception when evaluated, that is an error.
+The above is not dependent on program control-flow. The mere presence of a required compile time constant whose evaluation would fail within a program is an error.  This also holds recursively: since compound constants are composed out of constants, if any subpart of a constant would throw an exception when evaluated, that is an error.
 
 On the other hand, since implementations are free to compile code late, some compile-time errors may manifest quite late.
 }
@@ -2539,7 +2603,7 @@
 \LMLabel{null}
 
 \LMHash{}
-The reserved word \NULL{} denotes the {\em null object}.
+The reserved word \NULL{} evaluates to the {\em null object}.
 %\Q{Any methods, such as \code{isNull}?}
 
 \begin{grammar}
@@ -2549,8 +2613,8 @@
 \end{grammar}
 
 \LMHash{}
-The null object is the sole instance of the built-in class \code{Null}. Attempting to instantiate \code{Null} causes a run-time error. It is a compile-time error for a class to attempt to extend, mix in or implement \code{Null}.
-Invoking a method on \NULL{}  yields a \code{NoSuchMethodError} unless the method is explicitly implemented by class \code{Null}.
+The null object is the sole instance of the built-in class \code{Null}. Attempting to instantiate \code{Null} causes a run-time error. It is a compile-time error for a class to extend, mix in or implement \code{Null}.
+The \code{Null} class declares no methods except those also declared by \code{Object}.
 
 \LMHash{}
 The static type of \NULL{} is $\bot$.
@@ -2589,7 +2653,17 @@
  \end{grammar}
 
 \LMHash{}
-If a numeric literal begins with the prefix `0x' or `0X', it denotes the hexadecimal integer represented by the part of the literal following `0x' (respectively `0X'). Otherwise, if the numeric literal contains only decimal digits, it denotes a decimal integer.  Otherwise, the numeric literal contains either a decimal point or an exponent part and it denotes a 64 bit double precision floating point number as specified by the IEEE 754 standard.
+If a numeric literal begins with the prefix `0x' or `0X',
+it denotes the integer represented by the hexadecimal numeral
+following `0x' (respectively `0X').
+Otherwise, if the numeric literal contains only decimal digits,
+it denotes an integer represented as a decimal numeral.
+In either case the literal evaluates to an instance of the class \code{int}
+with the integer value represented by that numeral.
+Otherwise, the numeric literal contains either a decimal point or an exponent part
+and it evaluates to a an instance of the `double` class
+representing a 64 bit double precision floating point number
+as specified by the IEEE 754 standard.
 
 \LMHash{}
 In principle, the range of integers supported by a Dart implementations is unlimited. In practice, it is limited by available memory. Implementations may also be limited by other considerations.
@@ -2599,20 +2673,23 @@
 }
 
 \LMHash{}
-It is a compile-time error for a class to attempt to extend, mix in or implement \code{int}. It is a compile-time error for a class to attempt to extend, mix in or implement \code{double}. It is a compile-time error for any type other than the types \code{int} and \code{double} to attempt to extend, mix in or implement \code{num}.
+It is a compile-time error for a class to extend, mix in or implement \code{int}.
+It is a compile-time error for a class to extend, mix in or implement \code{double}.
+It is a compile-time error for any class other than \code{int} and \code{double} to extend, mix in or implement \code{num}.
 
 \LMHash{}
-An {\em integer literal} is either a hexadecimal integer literal or a  decimal integer literal. Invoking the getter \code{runtimeType} on an integer literal returns the \code{Type} object that is the value of the expression \code{int}. The static type of an integer literal is \code{int}.
+An {\em integer literal} is either a hexadecimal integer literal or a  decimal integer literal.
+The static type of an integer literal is \code{int}.
 
 \LMHash{}
-A {\em literal double} is a numeric literal that is not an integer literal. Invoking the getter \code{runtimeType} on a literal double returns the \code{Type} object that is the value of the expression \code{double}.
-The static type of a literal double is \code{double}.
+A {\em literal double} is a numeric literal that is not an integer literal. The static type of a literal double is \code{double}.
 
 \subsection{Booleans}
 \LMLabel{booleans}
 
 \LMHash{}
-The reserved words \TRUE{} and \FALSE{} denote objects that represent the boolean values true and false respectively. They are the {\em boolean literals}.
+The reserved words \TRUE{} and \FALSE{} evaluate to objects {\em true} and {\em false} that represent the boolean values true and false respectively.
+They are the {\em boolean literals}.
 
 \begin{grammar}
 {\bf booleanLiteral:}\TRUE{};
@@ -2621,14 +2698,12 @@
 \end{grammar}
 
 \LMHash{}
-Both  \TRUE{} and \FALSE{} implement the built-in class \code{bool}.  It is a compile-time error for a class to attempt to extend, mix in or implement\code{ bool}.
-
-\commentary{
-It follows that the two boolean literals are the only two instances of \code{bool}.
-}
+Both {\em true} and {\em false} are instances of the built-in class \code{bool},
+and there are no other objects that implement \code{bool}.
+It is a compile-time error for a class to extend, mix in or implement \code{bool}.
 
 \LMHash{}
-Invoking the getter \code{runtimeType} on a boolean literal returns the \code{Type} object that is the value of the expression \code{bool}. The static type of a boolean literal is \code{bool}.
+Invoking the getter \code{runtimeType} on a boolean value returns the \code{Type} object that is the value of the expression \code{bool}. The static type of a boolean literal is \code{bool}.
 
 \subsubsection{Boolean Conversion}
 \LMLabel{booleanConversion}
@@ -2829,7 +2904,9 @@
  \end{grammar}
 
 \LMHash{}
-All string literals implement the built-in class \code{String}. It is a compile-time error for a class to attempt to extend, mix in or implement \code{String}. Invoking the getter \code{runtimeType} on a string literal returns the \code{Type} object that is the value of the expression \code{String}. The static type of a string literal is \code{String}.
+All string literals evaluate to instances of the built-in class \code{String}.
+It is a compile-time error for a class to extend, mix in or implement \code{String}.
+The static type of a string literal is \code{String}.
 
 \subsubsection{String Interpolation}
 \LMLabel{stringInterpolation}
@@ -2854,7 +2931,16 @@
 \end{itemize}
 
 \LMHash{}
-The form \code{\$id} is equivalent to the form \code{\$\{id\}}.  An interpolated string \code{`$s_1$\$\{$e$\}$s_2$'}  is equivalent to the concatenation of the  strings \code{`$s_1$'},  \code{$e$.toString()} and  \code{$`s_2$'}. Likewise an interpolated string \code{``$s_1$\$\{e\}$s_2$''} is equivalent to the concatenation of the strings \code{``$s_1$''}, \code{$e$.toString()} and  \code{``$s_2$''}.
+The form \code{\$id} is equivalent to the form \code{\$\{id\}}.
+An interpolated string, $s$, with content `\code{$s_0$\$\{$e_1$\}$s_1\ldots{}s_{n-1}\$\{e_n\}s_{n}$}' (where any of $s_0 \ldots{} s_n$ can be empty)
+is evaluated by evaluating each expression $e_i$ ($1 \le i \le n$) in to a string $r_i$ in the order they occur in the source text, as follows:
+\begin{itemize}
+\item{} Evaluate $e_i$ to an object $o_i$.
+\item{} Invoke the \code{toString} method on $o_i$ with no arguments, and let
+  $r_i$ be the returned value.
+\item{} If $r_i$ is not an instance of the built-in type \code{String}, throw an \code{Error}.
+\end{itemize}
+Finally, the result of the evaluation of $s$ is the concatenation of the strings $s_0$, $r_1$, \ldots{}, $r_n$, and $s_n$.
 
 \subsection{Symbols}
 \LMLabel{symbols}
@@ -2868,10 +2954,10 @@
 \end{grammar}
 
 \LMHash{}
-A symbol literal \code{\#id} where \code{id} does not begin with an underscore ('\code{\_}')  is equivalent to the expression \code{\CONST{} Symbol('id')}.
+A symbol literal \code{\#$id$} where $id$ does not begin with an underscore ('\code{\_}')  is equivalent to the expression \code{\CONST{} Symbol('$id$')}.
 
 \LMHash{}
-A symbol literal \code{\#\_id} evaluates to the object that would be returned by the call \code{MirrorSystem.getSymbol("\_id", libraryMirror)} where \code{libraryMirror} is an instance of the class \code{LibraryMirror} defined in the library \code{dart:mirrors}, reflecting the current library.
+A symbol literal \code{\#\_$id$} evaluates to the object that would be returned by the call \code{MirrorSystem.getSymbol("\_$id$", \metavar{libraryMirror})} where \metavar{libraryMirror} is an instance of the class \code{LibraryMirror} defined in the library \code{dart:mirrors}, reflecting the current library.
 
 \rationale{
 One may well ask what is the motivation for introducing literal symbols? In some languages, symbols are canonicalized whereas strings are not. However literal strings are already canonicalized in Dart.  Symbols are slightly easier to type compared to strings and their use can become strangely addictive, but this is not nearly sufficient justification for adding a literal form to the language. The primary motivation is related to the use of reflection and a web specific practice known as minification.
@@ -2918,8 +3004,8 @@
 A run-time list literal $<E>[e_1 \ldots e_n]$  is evaluated as follows:
 \begin{itemize}
 \item
-First, the expressions $e_1 \ldots e_n$ are evaluated in order they appear in the program, yielding objects $o_1 \ldots o_n$.
-\item A fresh instance  (\ref{generativeConstructors}) $a$, of size $n$,  whose class implements the built-in class $List<E>$ is allocated.
+First, the expressions $e_1 \ldots e_n$ are evaluated in order they appear in the program, producing objects $o_1 \ldots o_n$.
+\item A fresh instance (\ref{generativeConstructors}) $a$, of size $n$,  whose class implements the built-in class $List<E>$ is allocated.
 \item
 The operator \code{[]=} is invoked on $a$ with  first  argument $i$ and second argument
 %The $i$th element of $a$ is set to
@@ -2994,12 +3080,13 @@
 A runtime map literal $<K, V>\{k_1:e_1\ldots k_n :e_n\}$  is evaluated as follows:
 \begin{itemize}
 \item
-First, the expression $k_i$ is evaluated yielding object $u_i$, the $e_i$ is vaulted yielding object $o_i$, for $i \in 1..n$ in left to right order, yielding objects $u_1, o_1\ldots u_n, o_n$.
-\item  A fresh instance (\ref{generativeConstructors}) $m$ whose class implements the built-in class
-
- $Map<K, V>$ is allocated.
+For each $i \in 1..n$ in numeric order,
+first the expression $k_i$ is evaluated producing object $u_i$,
+and then $e_i$ is evaluated producing object $o_i$.
+This produces all the objects $u_1, o_1\ldots u_n, o_n$.
+\item  A fresh instance (\ref{generativeConstructors}) $m$ whose class implements the built-in class $Map<K, V>$ is allocated.
 \item
-The operator \code{[]=} is invoked on $m$ with  first  argument $u_i$ and second argument $o_i,  i \in 1.. n$.
+The operator \code{[]=} is invoked on $m$ with  first  argument $u_i$ and second argument $o_i$ for each $i \in 1.. n$.
 \item
 The result of the evaluation is $m$.
 \end{itemize}
@@ -3029,7 +3116,7 @@
 \LMLabel{throw}
 
 \LMHash{}
-The {\em throw expression}  is used to raise an exception.
+The {\em throw expression}  is used to throw an exception.
 
  \begin{grammar}
 {\bf throwExpression:}
@@ -3043,45 +3130,32 @@
  \end{grammar}
 
 \LMHash{}
- The {\em current exception} is the last exception raised and not subsequently caught at a given moment during runtime.
+Evaluation of a throw expression of the form  \code{\THROW{} $e$;} proceeds as follows:
 
 \LMHash{}
- Evaluation of a throw expression of the form  \code{\THROW{} $e$;} proceeds as follows:
-
-\LMHash{}
-The expression $e$ is evaluated yielding a value $v$.
+The expression $e$ is evaluated to a value $v$ (\ref{evaluation}).
 
 \commentary{
-There is no requirement that the expression $e$ evaluate to a special kind of exception or error object.
+There is no requirement that the expression $e$ evaluate to any special kind of object.
 }
 
 \LMHash{}
-If $e$ evaluates to \NULL{} (\ref{null}), then a \code{NullThrownError} is thrown. Otherwise the current exception is set to $v$ and the current return value (\ref{return}) becomes undefined.
-
-\rationale{The current exception and the current return value must never be simultaneously defined, as they represent mutually exclusive options for exiting the current function.
-}
+If $v$ is the null value (\ref{null}), then a \code{NullThrownError} is thrown.
+Otherwise let $t$ be a stack trace corresponding to the current execution state,
+and the \THROW{} statement throws with $v$ as exception object
+and $t$ as stack trace (\ref{evaluation}).
 
 \LMHash{}
-Let $f$ be the immediately enclosing function.
-
-\LMHash{}
-If $f$ is synchronous (\ref{functions}), control is transferred to the nearest dynamically enclosing exception handler.
+If $v$ is an instance of class \code{Error} or a subclass thereof,
+and it is the first time that \code{Error} object is thrown,
+the stack trace $t$ is stored on $v$ so that it will be returned
+by the $v$'s \code{stackTrace} getter
 
 \commentary{
-If $f$ is marked \SYNC* then a dynamically enclosing exception handler encloses the call to \code{moveNext()} that initiated the evaluation of the throw expression.
+If the same \code{Error} object is thrown more than once, its \code{stackTrace} getter will return the stack trace from the {\em first} time it was thrown.
 }
 
 \LMHash{}
-If $f$ is asynchronous  then if there is a dynamically enclosing exception handler $h$  (\ref{try}) introduced by the current activation, control is transferred to $h$, otherwise $f$  terminates.
-
-\rationale{
-The rules for where a thrown exception will be handled must necessarily differ between the synchronous and asynchronous cases. Asynchronous functions cannot transfer control to an exception handler defined outside themselves.  Asynchronous generators post exceptions to their stream. Other asynchronous functions report exceptions via their future.
-}
-
-\LMHash{}
-If the object being thrown is an instance of class \code{Error} or a subclass thereof, its \code{stackTrace} getter will return the stack trace current at the point where the object was first thrown.
-
-\LMHash{}
 The static type of a throw expression is $\bot$.
 
 
@@ -3138,7 +3212,7 @@
 
 The  exception to that would be a type $X$ that extended or implemented \code{Future}. In that case, only one unwrapping takes place. As an example of why this is done, consider
 
-\cd{\CLASS{} C$<$T$>$  \IMPLEMENTS{}  Future$<$C$<$C$<$T$>>>$ \ldots }
+\cd{\CLASS{} C<T>  \IMPLEMENTS{}  Future<C<C<T>>> \ldots }
 
 Here, a naive definition of $flatten$ diverges; there is not even a fixed point. A more sophisticated definition of $flatten$ is possible, but the existing rule deals with most realistic examples while remaining relatively simple to understand.
 
@@ -3148,7 +3222,7 @@
 \LMHash{}
 The static type of a function literal of the form
 
-$(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots,  T_{n+k}$ $x_{n+k} : d_k\}) => e$
+$(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} = d_1, \ldots,  T_{n+k}$ $x_{n+k} = d_k\}) => e$
 is
 
 $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightarrow T_0$, where $T_0$ is the static type of $e$.
@@ -3156,7 +3230,7 @@
 \LMHash{}
 The static type of a function literal of the form
 
-$(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots,  T_{n+k}$ $x_{n+k} : d_k\})$ \ASYNC{}  $=> e$
+$(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} = d_1, \ldots,  T_{n+k}$ $x_{n+k} = d_k\})$ \ASYNC{}  $=> e$
 
 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightarrow Future<flatten(T_0)>$, where $T_0$ is the static type of $e$.
 
@@ -3197,21 +3271,21 @@
 \LMHash{}
 The static type of a function literal of the form
 
-$(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots,  T_{n+k}$ $x_{n+k} : d_k\})$ $\ASYNC{}$ $\{s\}$
+$(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} = d_1, \ldots,  T_{n+k}$ $x_{n+k} = d_k\})$ $\ASYNC{}$ $\{s\}$
 
 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightarrow  Future{}$.
 
 \LMHash{}
 The static type of a function literal of the form
 
-$(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots,  T_{n+k}$ $x_{n+k} : d_k\})$ $\ASYNC*{}$ $\{s\}$
+$(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} = d_1, \ldots,  T_{n+k}$ $x_{n+k} = d_k\})$ $\ASYNC*{}$ $\{s\}$
 
 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightarrow  Stream{}$.
 
 \LMHash{}
 The static type of a function literal of the form
 
-$(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots,  T_{n+k}$ $x_{n+k} : d_k\})$ $\SYNC*{}$ $\{s\}$
+$(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} = d_1, \ldots,  T_{n+k}$ $x_{n+k} = d_k\})$ $\SYNC*{}$ $\{s\}$
 
 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightarrow  Iterable{}$.
 
@@ -3343,22 +3417,21 @@
 
 \LMHash{}
 If $T$  is malformed or if $T$ is a type variable a dynamic error occurs. In checked mode, if $T$ or any of its superclasses is malbounded a dynamic error occurs.
- Otherwise, if $q$ is not defined or not accessible, a \code{NoSuchMethodError} is thrown.  If $q$ has  less than $n$ positional parameters or more than $n$ required parameters, or if $q$ lacks any of the keyword parameters $\{ x_{n+1}, \ldots, x_{n+k}\}$ a \code{NoSuchMethodError} is thrown.
+Otherwise, if $q$ is not defined or not accessible, a \code{NoSuchMethodError} is thrown.  If $q$ has fewer than $n$ positional parameters or more than $n$ required parameters, or if $q$ lacks any of the keyword parameters $\{ x_{n+1}, \ldots, x_{n+k}\}$ a \code{NoSuchMethodError} is thrown.
 
 \LMHash{}
 Otherwise, if $q$ is a generative constructor (\ref{generativeConstructors}), then:
 
-\commentary{Note that it this point we are assured that the number of actual type arguments match the number of formal type parameters.}
+\commentary{Note that at this point we are assured that the number of actual type arguments match the number of formal type parameters.}
 
 \LMHash{}
-A fresh instance (\ref{generativeConstructors}), $i$,  of class $R$ is allocated. For each instance variable $f$ of $i$,  if the variable declaration of $f$ has an initializer expression $e_f$, then $e_f$ is evaluated, with the type parameters (if any) of $R$ bound to the actual type arguments $V_1, \ldots, V_l$, to an object $o_f$ and $f$ is bound to $o_f$. Otherwise $f$ is bound to \NULL{}.
+A fresh instance (\ref{generativeConstructors}), $i$, of class $R$ is allocated.
+Then $q$ is executed to initialize $i$ with respect to the bindings that resulted from the evaluation of the argument list, and, if $R$ is a generic class, with its type parameters bound to $V_1 \ldots V_m$.
 
-\commentary{
-Observe that \THIS{} is not in scope in $e_f$. Hence, the initialization cannot depend on other properties of the object being instantiated.
-}
-
-\LMHash{}
-Next,  $q$ is executed  with \THIS{} bound to $i$,  the type parameters (if any) of $R$ bound to the actual type arguments $V_1, \ldots, V_l$ and the formal parameter bindings that resulted from the evaluation of the argument list. The result of the evaluation of $e$ is $i$.
+If execution of $q$ completes normally (\ref{completion}), $e$ evaluates to $i$.
+Otherwise execution of $q$ throws an exception object $x$ and stack trace $t$,
+and then evaluation of $e$ also throws exception object $x$ and stack trace $t$
+(\ref{evaluation}).
 
 \LMHash{}
 Otherwise, $q$ is a factory constructor (\ref{factories}). Then:
@@ -3366,11 +3439,18 @@
 \LMHash{}
 If $q$ is a redirecting factory constructor of the form $T(p_1, \ldots, p_{n+k}) = c;$ or of the form  $T.id(p_1, \ldots, p_{n+k}) = c;$ then the result of the evaluation of $e$ is equivalent to evaluating the expression
 
-$[V_1,  \ldots, V_m/T_1,  \ldots, T_m]($\code{\NEW{} $c(a_1, \ldots, a_n, x_{n+1}: a_{n+1}, \ldots, x_{n+k}: a_{n+k}))$}.  If evaluation of $q$ causes $q$ to be re-evaluated cyclically, a runtime error occurs.
+$[V_1,  \ldots, V_m/T_1,  \ldots, T_m]($\code{\NEW{} $c(a_1, \ldots, a_n, x_{n+1}: a_{n+1}, \ldots, x_{n+k}: a_{n+k}))$}.  If evaluation of $q$ causes $q$ to be re-evaluated cyclically, with only factory constructor redirections in-between, a runtime error occurs.
+% Used to not have the "in-between" clause, which would disallow a factory constructor redirecting to another constructor which conditionally calls the original factory constructor again with different arguments.
 
 
 \LMHash{}
-Otherwise, the body of $q$ is executed with respect to the bindings that resulted from the evaluation of the argument list and the type parameters (if any) of $q$ bound to the actual type arguments $V_1, \ldots, V_l$ resulting in an object $i$. The result of the evaluation of $e$ is $i$.
+Otherwise, the body of $q$ is executed with respect to the bindings that resulted from the evaluation of the argument list, and with the type parameters (if any) of $q$ bound to the actual type arguments $V_1, \ldots, V_l$.
+If this execution returns a value (\ref{completion}),
+then $e$ evaluates to the returned value.
+Otherwise, if the execution completes normally or returns with no value,
+then $e$ evaluates to \NULL.
+Otherwise the execution throws an exception $x$ and stack trace $t$,
+and then evaluation of $e$ also throws $x$ and $t$ (\ref{evaluation}).
 
 \LMHash{}
 It is a static warning if $q$ is a constructor of an abstract class and $q$ is not a factory constructor.
@@ -3497,7 +3577,7 @@
  \CONST{} IntPair(\THIS{}.x, \THIS{}.y);
  \FINAL{} int x;
  \FINAL{} int y;
- \OPERATOR *(v) $=>$ \NEW{} IntPair(x*v, y*v);
+ \OPERATOR *(v) => \NEW{} IntPair(x*v, y*v);
 \}
 
 \CONST{} A(\CONST{} IntPair(1,2)); // compile-time error: illegal in a subtler way
@@ -3534,37 +3614,21 @@
 Function invocation occurs in the following cases: when a function expression  (\ref{functionExpressions}) is invoked (\ref{functionExpressionInvocation}), when a method (\ref{methodInvocation}), getter (\ref{topLevelGetterInvocation}, \ref{propertyExtraction}) or setter (\ref{assignment}) is invoked or when a constructor is invoked (either via instance creation (\ref{instanceCreation}), constructor redirection (\ref{redirectingConstructors}) or super initialization). The various kinds of function invocation differ as to how the function to be invoked, $f$,  is determined, as well as whether \THIS{} (\ref{this}) is bound. Once $f$ has been determined, the formal parameters of $f$ are bound to corresponding actual arguments. When the body of $f$ is executed it will be executed with the aforementioned bindings.
 
 \LMHash{}
-If $f$ is marked \ASYNC{} (\ref{functions}), then a fresh instance (\ref{generativeConstructors}) $o$ implementing the built-in class \code{Future} is associated with the invocation and immediately returned to the caller. The body of $f$ is scheduled for execution at some future time. The future $o$ will complete when $f$ terminates. The value used to complete $o$ is the current return value (\ref{return}), if it is defined, and the current exception (\ref{throw}) otherwise.
+If $f$ is synchronous and is not a generator (\ref{functions}) then execution of the body of $f$ begins immediately.
+If the execution of the body of $f$ returns a value, $v$, (\ref{completion}), the invocation evaluates to $v$.
+If the execution completes normally or it returns without a value, the invocation evaluates to \NULL (\ref{null}).
+If the execution throws an exception object and stack trace, the invocation throws the same exception object and stack trace (\ref{evaluation}).
 
-\LMHash{}
-If $f$ is marked \ASYNC* (\ref{functions}), then a fresh instance $s$ implementing the built-in class \code{Stream} is associated with the invocation and immediately returned. When $s$ is listened to, execution of the body of $f$ will begin.  When $f$ terminates:
-\begin{itemize}
-\item If the current return value is defined then, if $s$ has been canceled then its cancellation future is completed with \NULL{} (\ref{null}).
-\item If the current exception $x$ is defined:
-  \begin{itemize}
-  \item $x$ is added to $s$.
-  \item If $s$ has been canceled then its cancellation future is completed with $x$ as an error.
-  \end{itemize}
-\item $s$ is closed.
-\end{itemize}
-
-\rationale{
-When an asynchronous generator's stream has been canceled, cleanup will occur in the \FINALLY{} clauses (\ref{try}) inside the generator. We choose to direct any exceptions that occur at this time to the cancellation future rather than have them be lost.
+\commentary{
+A complete function body can never break or contine (\ref{completion})
+because a \BREAK{} or \CONTINUE{} statement must always occur inside the statement that is the target of the \BREAK{} or \CONTINUE{}.
+This means that a function body can only either complete normally, throw, or return. Completing normally or returning without a value is treated the same as returning \NULL, so the result of executing a function body can always be used as the result of evaluating an expression, either by evaluating to a value or by the evaluation throwing.
 }
 
-\LMHash{}
-If $f$ is asynchronous then, when $f$ terminates, any open stream subscriptions associated with any asynchronous for loops  (\ref{asynchronousFor-in}) or yield-each statements  (\ref{yieldEach}) executing within $f$ are canceled, in the order of their nesting, innermost first.
-
-\rationale{Such streams may be left open by for loops that were escaped when an exception was thrown within them for example.
-}
-
-%\LMHash{}
-%When a stream is canceled, the implementation must wait for the cancelation future returned by \cd{cancell()} to complete before proceeding.
 
 \LMHash{}
 If $f$ is marked \SYNC* (\ref{functions}), then a fresh instance $i$ implementing the built-in class \code{Iterable} is associated with the invocation and immediately returned.
 
-
 \commentary{
 A Dart implementation will need to provide a specific implementation of \code{Iterable} that will be returned by \SYNC* methods. A typical strategy would be to produce an instance of a subclass of class \code{IterableBase} defined in \code{dart:core}. The only method that needs to be added by the Dart implementation in that case is \code{iterator}.
 }
@@ -3577,7 +3641,11 @@
 }
 
 \LMHash{}
-When iteration over the iterable is started, by getting an iterator $j$ from the iterable and calling \code{moveNext()}, execution of the body of $f$ will begin. When $f$ terminates, $j$ is positioned after its last element, so that its current value is \NULL{} and the current call to \code{moveNext()} on $j$ returns false, as will all further calls.
+When iteration over the iterable is started, by getting an iterator $j$ from the iterable and calling \code{moveNext()}, execution of the body of $f$ will begin. When execution of the body of $f$ completes (\ref{completion},
+\begin{itemize}
+\item If it returns without a value or it completes normally (\ref{completion}), $j$ is positioned after its last element, so that its current value is \code{null} and the current call to \code{moveNext()} on $j$ returns false, as must all further calls.
+\item If it throws an exception object $e$ and stack trace $t$ then the current value of $j$ is \NULL and the current call to \code{moveNext()} throws $e$ and $t$ as well. Further calls to \code{moveNext()} must return false.
+\end{itemize}
 
 Each iterator starts a separate computation. If the \SYNC* function is impure, the sequence of values yielded by each iterator may differ.
 
@@ -3596,21 +3664,31 @@
 }
 % The alternative would be to cache the results of an iterator in the iterable, and check the cache at each \YIELD{}.  This would have strange issues as well. The yielded value might differ from the expression in the yield. And it is a potential memory leak as the cache is kept alive by any iterator.
 
+\LMHash{}
+If $f$ is marked \ASYNC{} (\ref{functions}), then a fresh instance (\ref{generativeConstructors}) $o$ implementing the built-in class \code{Future} is associated with the invocation and immediately returned to the caller. The body of $f$ is scheduled for execution at some future time. The future $o$ will be completed when execution of the body of $f$ completes (\ref{completion}). If execution of the body returns a value, $o$ is completed with that value, if it completes normally or returns without a value, $o$ is completed with the \NULL{} value, and if it throws an exception $e$ and stack trace $t$, $o$ is completed with the error $e$ and stack trace $t$.
 
 \LMHash{}
-If $f$ is synchronous and is not a generator (\ref{functions}) then execution of the body of $f$ begins immediately.  When $f$ terminates the current return value is returned to the caller.
-
-
-\LMHash{}
-Execution of $f$ terminates when the first of the following occurs:
+If $f$ is marked \ASYNC* (\ref{functions}), then a fresh instance $s$ implementing the built-in class \code{Stream} is associated with the invocation and immediately returned. When $s$ is listened to, execution of the body of $f$ will begin.
+When execution of the body of $f$ completes:
 \begin{itemize}
-\item An exception is thrown and not caught within the current function activation.
-\item A return statement (\ref{return}) immediately nested in the body of $f$ is executed and not intercepted in a \FINALLY{} (\ref{try}) clause.
-\item The last statement of the body completes execution.
+\item If it completes normally or returns with no value (\ref{completion}), then if $s$ has been canceled then its cancellation future is completed with \NULL{} (\ref{null}).
+\item If it throws an exception object $e$ and stack trace $t$:
+  \begin{itemize}
+  \item If $s$ has been canceled then its cancellation future is completed with error $e$ and stack trace $t$.
+  \item otherwise the error $e$ and stack trace $t$ are emitted by $s$.
+  \end{itemize}
+\item $s$ is closed.
 \end{itemize}
+\commentary{
+The body of an asynchronous generator function cannot break, continue or return a value (\ref{completion}). The first two are only allowed in contexts that will handle the break or continue, and return statements with an expression are not allowed in generator functions.
+}
 
+\rationale{
+When an asynchronous generator's stream has been canceled, cleanup will occur in the \FINALLY{} clauses (\ref{try}) inside the generator. We choose to direct any exceptions that occur at this time to the cancellation future rather than have them be lost.
+}
 
-
+%\LMHash{}
+%When a stream is canceled, the implementation must wait for the cancelation future returned by \cd{cancell()} to complete before proceeding.
 
 \subsubsection{ Actual Argument List Evaluation}
 \LMLabel{actualArguments}
@@ -3645,7 +3723,7 @@
 proceeds as follows:
 
 \LMHash{}
-The arguments $a_1, \ldots, a_{m+l}$ are evaluated in the order they appear in the program, yielding objects $o_1, \ldots, o_{m+l}$.
+The arguments $a_1, \ldots, a_{m+l}$ are evaluated in the order they appear in the program, producing objects $o_1, \ldots, o_{m+l}$.
 
 \commentary{Simply stated, an argument list consisting of $m$ positional arguments and $l$ named arguments is evaluated from left to right.
 }
@@ -3697,10 +3775,15 @@
 If there exists a lexically visible declaration named $id$, let $f_{id}$ be the innermost such declaration. Then:
 \begin{itemize}
 \item
+If $id$ is a type literal, then $i$ is interpreted as a function expression invocation (ref{functionExpressionInvociation}) with $(id)$ as the expression $e_f$.
+\commentary{
+The expression $(id)$ where $id$ is a type literal always evaluates to an instance of class \code{Type} which is not a function. This ensures that a runtime error occurs when trying to call a type literal.
+}
+\item
 If $f_{id}$ is a prefix object, a compile-time error occurs.
 \item
- If $f_{id}$ is a local function, a library function, a library or static getter or a variable then $i$ is interpreted as a function expression invocation (\ref{functionExpressionInvocation}).
- \item
+If $f_{id}$ is a local function, a library function, a library or static getter or a variable then $i$ is interpreted as a function expression invocation (\ref{functionExpressionInvocation}).
+\item
 Otherwise, if $f_{id}$ is a static method of the enclosing class $C$, $i$ is equivalent to $C.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$.
 \item Otherwise, $f_{id}$ is considered equivalent to the ordinary method invocation $\THIS{}.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$.
 \end{itemize}
@@ -3727,7 +3810,14 @@
 
 $e_f(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$,
 
-where $e_f$ is an expression. If $e_f$ is an identifier $id$, then $id$ must necessarily denote a local function, a library function, a library or static getter or a variable as described above, or $i$ is not considered a function expression invocation. If $e_f$ is a property extraction expression (\ref{propertyExtraction}), then $i$ is is not a function expression invocation and is instead recognized as an ordinary method invocation (\ref{ordinaryInvocation}).
+where $e_f$ is an expression. If $e_f$ is an identifier $id$, then $id$ must necessarily denote a local function, a library function, a library or static getter or a variable as described above, or $i$ is not considered a function expression invocation.
+If $e_f$ is a type literal, then it is equivalent to the expression $(e_f)$.
+
+\commentary{
+The expression $(e_f)$ where $e_f$ is a type literal always evaluates to an instance of class \code{Type} which is not a function. This ensures that a runtime error occurs when trying to call a type literal.
+}
+
+If $e_f$ is a property extraction expression (\ref{propertyExtraction}), then $i$ is is not a function expression invocation and is instead recognized as an ordinary method invocation (\ref{ordinaryInvocation}).
 
 \commentary{
 \code{$a.b(x)$} is parsed as a method invocation of method \code{$b()$} on object \code{$a$}, not as an invocation of getter \code{$b$} on \code{$a$} followed by a function call \code{$(a.b)(x)$}.  If a method or getter \code{$b$} exists, the two will be equivalent. However, if \code{$b$} is not defined on \code{$a$}, the resulting invocation of \code{noSuchMethod()} would differ.  The \code{Invocation} passed to \code{noSuchMethod()} would describe a call to a method \code{$b$} with argument \code{$x$} in the former case, and a call to a getter \code{$b$} (with no arguments) in the latter.
@@ -3809,36 +3899,41 @@
 An ordinary method invocation can be {\em conditional} or {\em unconditional}.
 
 \LMHash{}
-Evaluation of a {\em conditional ordinary method invocation} $e$ of the form
+Evaluation of a {\em conditional ordinary method invocation} $i$ of the form
 
 \LMHash{}
-$o?.m(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$
+$e?.m(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$
 
 \LMHash{}
-is equivalent to the evaluation of the expression
+proceeds as follows:
 
 \LMHash{}
-$((x) => x == \NULL ? \NULL : x.m(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k}))(o)$.
-
-unless $o$ is  a type literal, in which case it is equivalent to $o.m(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$.
+If $e$ is a type literal, $i$ is equivalent to \code{$e$.$m$($a_1$, \ldots , $a_n$, $x_{n+1}$: $a_{n+1}$, \ldots , $x_{n+k}$: $a_{n+k}$)}.
 
 \LMHash{}
-The static type of $e$ is the same as the static type of $o.m(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$. Exactly the same static warnings that would be caused by $o.m(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ are also generated in the case of $o?.m(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$.
+Otherwise, evaluate $e$ to an object $o$.
+If $o$ is the null value, $i$ evaluates to the null value.
+Otherwise let $v$ be a fresh variable bound to $o$ and evaluate
+\code{$v$.$m$($a_1$, $\ldots$ , $a_n$, $x_{n+1}$: $a_{n+1}$, $\ldots$ , $x_{n+k}$: $a_{n+k}$))} to a value $r$, and then $e$ evaluates to $r$.
+
+
+\LMHash{}
+The static type of $i$ is the same as the static type of $e.m(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$. Exactly the same static warnings that would be caused by $e.m(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ are also generated in the case of $e?.m(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$.
 
 \LMHash{}
 An {\em unconditional ordinary method invocation} $i$ has the form
 
-$o.m(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$.
+$e.m(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$.
 
 \LMHash{}
 Evaluation of an unconditional ordinary method invocation $i$ of the form
 
-$o.m(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$
+$e.m(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$
 
 proceeds as follows:
 
 \LMHash{}
-First, the expression $o$ is evaluated to a value $v_o$. Next, the argument list $(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ is evaluated yielding actual argument objects $o_1, \ldots , o_{n+k}$. Let $f$ be the result of looking up (\ref{methodLookup}) method $m$  in $v_o$ with respect to the current library $L$.
+First, the expression $e$ is evaluated to a value $o$. Next, the argument list $(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ is evaluated yielding actual argument objects $o_1, \ldots , o_{n+k}$. Let $f$ be the result of looking up (\ref{methodLookup}) method $m$  in $o$ with respect to the current library $L$.
 
 \LMHash{}
 Let $p_1 \ldots p_h$ be the required parameters of $f$,  let $p_1 \ldots p_m$ be the positional parameters of $f$ and let $p_{h+1}, \ldots, p_{h+l}$ be the optional parameters declared by $f$.
@@ -3848,24 +3943,24 @@
 }
 
 \LMHash{}
-If  $n < h$, or $n > m$, the method lookup has failed. Furthermore, each $x_i, n+1 \le i \le n+k$,  must have a corresponding named parameter in the set $\{p_{m+1}, \ldots, p_{h+l}\}$ or the method lookup also fails.  If $v_o$ is an instance of \code{Type} but $o$ is not a constant type literal, then if $m$ is a method that forwards (\ref{functionDeclarations}) to a static method, method lookup fails. Otherwise method lookup has succeeded.
+If  $n < h$, or $n > m$, the method lookup has failed. Furthermore, each $x_i, n+1 \le i \le n+k$,  must have a corresponding named parameter in the set $\{p_{m+1}, \ldots, p_{h+l}\}$ or the method lookup also fails.  If $o$ is an instance of \code{Type} but $e$ is not a constant type literal, then if $m$ is a method that forwards (\ref{functionDeclarations}) to a static method, method lookup fails. Otherwise method lookup has succeeded.
 
 \LMHash{}
-If the method lookup succeeded, the body of $f$ is executed with respect to the bindings that resulted from the evaluation of the argument list, and with \THIS{} bound to $v_o$. The value of $i$ is the value returned after $f$ is executed.
+If the method lookup succeeded, the body of $f$ is executed with respect to the bindings that resulted from the evaluation of the argument list, and with \THIS{} bound to $o$. The value of $i$ is the value returned after $f$ is executed.
 
 \LMHash{}
-If the method lookup has failed, then let $g$ be the result of looking up getter (\ref{getterAndSetterLookup}) $m$ in $v_o$ with respect to $L$.
-If $v_o$ is an instance of \code{Type} but $o$ is not a constant type literal, then if $g$ is a getter that forwards to a static getter, getter lookup fails.
-If the getter lookup succeeded, let $v_g$ be the value of the getter invocation $o.m$. Then the value of $i$ is the result of invoking
-the static method \code{Function.apply()} with arguments $v.g, [o_1, \ldots , o_n], \{x_{n+1}: o_{n+1}, \ldots , x_{n+k}: o_{n+k}\}$.
+If the method lookup has failed, then let $g$ be the result of looking up getter (\ref{getterAndSetterLookup}) $m$ in $o$ with respect to $L$.
+If $o$ is an instance of \code{Type} but $e$ is not a constant type literal, then if $g$ is a getter that forwards to a static getter, getter lookup fails.
+If the getter lookup succeeded, let $v_g$ be the value of the getter invocation $e.m$. Then the value of $i$ is the result of invoking
+the static method \code{Function.apply()} with arguments $v.g, [o_1, \ldots , o_n], \{\#x_{n+1}: o_{n+1}, \ldots , \#x_{n+k}: o_{n+k}\}$.
 
 \LMHash{}
-If  getter lookup has also failed, then a new instance $im$  of the predefined class  \code{Invocation}  is created, such that :
+If getter lookup has also failed, then a new instance $im$ of the predefined class \code{Invocation} is created, such that:
 \begin{itemize}
 \item  \code{im.isMethod} evaluates to \code{\TRUE{}}.
 \item  \code{im.memberName} evaluates to the symbol \code{m}.
-\item \code{im.positionalArguments} evaluates to an immutable list with the same values as  \code{[$o_1, \ldots, o_n$]}.
-\item \code{im.namedArguments} evaluates to an immutable map with the same keys and values as \code{\{$x_{n+1}: o_{n+1}, \ldots, x_{n+k} : o_{n+k}$\}}.
+\item \code{im.positionalArguments} evaluates to an immutable list with the same values as \code{[$o_1, \ldots, o_n$]}.
+\item \code{im.namedArguments} evaluates to an immutable map with the same keys and values as \code{\{$\#x_{n+1}: o_{n+1}, \ldots, \#x_{n+k} : o_{n+k}$\}}.
 \end{itemize}
 
 \LMHash{}
@@ -3884,7 +3979,7 @@
 
 \begin{code}
 \CLASS{} Perverse \{
-    noSuchMethod(x,y) =$>$ x + y;
+    noSuchMethod(x,y) => x + y;
 \}
 
 \NEW{} Perverse.unknownMethod();
@@ -3913,8 +4008,8 @@
 \LMLabel{cascadedInvocations}
 
 \LMHash{}
-A {\em cascaded method invocation} has the form {\em e..suffix}
-where $e$ is an expression and {\em suffix} is a sequence of operator, method, getter or setter invocations.
+A {\em cascaded method invocation} has the form \code{$e$..\metavar{suffix}}
+where $e$ is an expression and \metavar{suffix} is a sequence of operator, method, getter or setter invocations.
 
 \begin{grammar}
 {\bf cascadeSection:}
@@ -3927,10 +4022,15 @@
 \end{grammar}
 
 \LMHash{}
-A cascaded method invocation expression of the form {\em e..suffix} is equivalent to the expression \code{(t)\{t.{\em suffix}; \RETURN{} t;\}($e$)}.
+Evaluation of a cascaded method invocation expression $e$ of the form \code{$e$..\metavar{suffix}} proceeds as follows:
+
+Evaluate $e$ to an object $o$.
+Let $t$ be a fresh variable bound to $o$.
+Evaluate \code{$t$.\metavar{suffix}} to an object.
+Then $e$ evaluates to $o$.
 
 \rationale{
-With the introduction of null-aware conditional assignable expressions (\ref{assignableExpressions}), it would make sense to extend cascades with a null-aware conditional form as well. One might define {\em e?..suffix}  to be equivalent to the expression \code{(t)\{t?.{\em suffix}; \RETURN{} t;\}($e$)}.
+With the introduction of null-aware conditional assignable expressions (\ref{assignableExpressions}), it would make sense to extend cascades with a null-aware conditional form as well. One might define \code{$e$?..\metavar{suffix}} to be equivalent to the expression \code{$t$ == null ? null : $t$.\metavar{suffix}} where $t$ is a fresh variable bound to the value of $e$.
 
 The present specification has not added such a construct, in the interests of simplicity and rapid language evolution. However, Dart implementations may experiment with such constructs, as noted in section \ref{ecmaConformance}.
 }
@@ -3947,7 +4047,7 @@
 Evaluation of $i$ proceeds as follows:
 
 \LMHash{}
-First, the argument list $(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ is evaluated  yielding actual argument objects $o_1, \ldots , o_{n+k}$. Let $g$ be the method currently executing, and let $C$ be the class in which $g$ was looked up (\ref{methodLookup}). Let $S_{dynamic}$ be the superclass of $C$, and let $f$ be the result of looking up method (\ref{methodLookup})  $m$ in $S_{dynamic}$  with respect to the current library $L$.
+First, the argument list $(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ is evaluated producing actual argument objects $o_1, \ldots , o_{n+k}$. Let $g$ be the method currently executing, and let $C$ be the class in which $g$ was looked up (\ref{methodLookup}). Let $S_{dynamic}$ be the superclass of $C$, and let $f$ be the result of looking up method (\ref{methodLookup})  $m$ in $S_{dynamic}$  with respect to the current library $L$.
 Let $p_1 \ldots p_h$ be the required parameters of $f$,  let $p_1 \ldots p_m$ be the positional parameters of $f$ and let $p_{h+1}, \ldots, p_{h+l}$ be the optional parameters declared by $f$.
 
 \LMHash{}
@@ -3958,7 +4058,7 @@
 
 \LMHash{}
 If the method lookup has failed, then let $g$ be the result of looking up getter (\ref{getterAndSetterLookup}) $m$ in $S_{dynamic}$ with respect to $L$. If the getter lookup succeeded, let $v_g$ be the value of the getter invocation $\SUPER{}.m$. Then the value of $i$ is the result of invoking
-the static method \code{Function.apply()} with arguments $v_g, [o_1, \ldots , o_n], \{x_{n+1}: o_{n+1}, \ldots , x_{n+k}: o_{n+k}\}$.
+the static method \code{Function.apply()} with arguments $v_g, [o_1, \ldots , o_n], \{x_{n+1} = o_{n+1}, \ldots , x_{n+k} = o_{n+k}\}$.
 
 \LMHash{}
 If  getter lookup has also failed, then a new instance $im$  of the predefined class  \code{Invocation}  is created, such that :
@@ -3966,7 +4066,7 @@
 \item  \code{im.isMethod} evaluates to \code{\TRUE{}}.
 \item  \code{im.memberName} evaluates to the symbol \code{m}.
 \item \code{im.positionalArguments} evaluates to an immutable list with the same  values as  \code{[$o_1, \ldots, o_n$]}.
-\item \code{im.namedArguments} evaluates to an immutable map with the same keys and values as \code{\{$x_{n+1}: o_{n+1}, \ldots, x_{n+k} : o_{n+k}$\}}.
+\item \code{im.namedArguments} evaluates to an immutable map with the same keys and values as \code{\{$\#x_{n+1}: o_{n+1}, \ldots, \#x_{n+k} : o_{n+k}$\}}.
 \end{itemize}
 Then the method \code{noSuchMethod()} is looked up in $S_{dynamic}$ and invoked on \THIS{} with argument $im$, and the result of this invocation is the result of evaluating $i$. However, if the implementation found cannot be invoked with a single positional argument, the implementation  of \code{noSuchMethod()} in class \code{Object} is invoked on \THIS{} with argument $im'$, where $im'$ is an instance of \code{Invocation} such that :
 \begin{itemize}
@@ -4017,17 +4117,25 @@
 
 Property extraction can be either {\em conditional} or {\em unconditional}.
 
-\rationale {
-Tear-offs using the \cd{ x\#id}  syntax cannot be conditional at this time; this is inconsistent, and is likely to be addressed in the near future, perhaps via  notation such as  \cd{ x?\#id} . As indicated in section \ref{ecmaConformance}, experimentation in this area is allowed.
-}
-
-Evaluation of a {\em conditional property extraction expression} $e$ of the form $e_1?.id$  is equivalent to the evaluation of the expression  $((x) => x == \NULL ? \NULL : x.id)(e_1)$.
-unless $e_1$ is  a type literal, in which case it is equivalent to $e_1.m$.
-
-The static type of $e$ is the same as the static type of $e_1.id$. Let $T$ be the static type of $e_1$ and let $y$ be a fresh variable of type $T$. Exactly the same static warnings that would be caused by $y.id$ are also generated in the case of $e_1?.id$.
+\LMHash{}
+Evaluation of a {\em conditional property extraction expression} $e$
+of the form \code{$e_1$?.\metavar{id}} proceeds as follows:
 
 \LMHash{}
-Unconditional property extraction takes several syntactic forms: $e.m$ (\ref{getterAccessAndMethodExtraction}), $\SUPER.m$ (\ref{superGetterAccessAndMethodClosurization}), $e\#m$ (\ref{generalClosurization}), $\NEW{}$ $T\#m$ (\ref{namedConstructorExtraction}), $\NEW{}$ $T\#$ (\ref{anonymousConstructorExtraction}) and $\SUPER\#m$ (\ref{generalSuperPropertyExtraction}), where $e$ is an expression, $m$ is an identifier optionally followed by an equal sign and $T$ is a type.
+If $e_1$ is a type literal, $e$ is equivalent to \code{$e_1$.$m$}.
+
+\LMHash{}
+Otherwise evaluate $e_1$ to an object $o$.
+If $o$ is the null value, $e$ evaluates to the null value.
+Otherwise let $x$ be a fresh variable bound to $o$
+and evaluate \code{$x$.\metavar{id}} to a value $r$.
+Then $e$ evaluates to $r$.
+
+
+The static type of $e$ is the same as the static type of \code{$e_1$.\metavar{id}}. Let $T$ be the static type of $e_1$ and let $y$ be a fresh variable of type $T$. Exactly the same static warnings that would be caused by \code{$y$.\metavar{id}} are also generated in the case of \code{$e_1$?.\metavar{id}}.
+
+\LMHash{}
+Unconditional property extraction has one of two syntactic forms: $e.m$ (\ref{getterAccessAndMethodExtraction}) or $\SUPER.m$ (\ref{superGetterAccessAndMethodClosurization}), where $e$ is an expression and $m$ is an identifier.
 
 \subsubsection{Getter Access and Method Extraction}
 \LMLabel{getterAccessAndMethodExtraction}
@@ -4130,148 +4238,20 @@
 \end{itemize}
 
 
-\subsubsection{General Closurization}
-\LMLabel{generalClosurization}
-
-\LMHash{}
-Evaluation of a property extraction $i$ of the form $e\#m$ proceeds as follows:
-
-\LMHash{}
-First, the expression $e$ is evaluated to an object $o$.  Then:
-
-\LMHash{}
- if $m$ is a setter name, let $f$ be the result of looking up setter $m$ in $o$ with respect to the current library $L$.   If $o$ is an instance of \cd{Type} but $e$ is not a constant type literal, then if $f$ is a method that forwards to a static setter, setter lookup fails. If setter lookup succeeds then $i$ evaluates to the closurization of setter $f$ on object $o$ (\ref{ordinaryMemberClosurization}).
- If setter lookup failed, a \cd{NoSuchMethodError} is thrown.
-
-  \rationale {
-It would be more in keeping with the rules of Dart to invoke \cd{noSuchMethod} in this and similar cases below. However,  current implementations of \cd{noSuchMethod} cannot distinguish between an invocation of a closurization and an actual call.  It is likely that future versions of Dart will provide a mechanism to detect whether \cd{noSuchMethod} is invoked in response to a closurization, say by means of a getter like \cd{isTearOff}. By being conservative at this stage and insisting on failure, we can ensure that no functioning code will break when/if this functionality is introduced.
- }
-
-
- \LMHash{}
-If $m$ is not a setter name, let $f$ be the result of looking up method $m$ in $o$ with respect to the current library $L$.   If $o$ is an instance of \cd{Type} but $e$ is not a constant type literal, then if $f$ is a method that forwards to a static method, method lookup fails. If method lookup succeeds then $i$ evaluates to the closurization of method $f$ on object $o$ (\ref{ordinaryMemberClosurization}).
-
-\LMHash{}
-If method lookup failed, let $f$ be the result of looking up getter $m$ in $o$ with respect to the current library $L$.   If $o$ is an instance of \cd{Type} but $e$ is not a constant type literal, then if $f$ is a method that forwards to a static getter, getter lookup fails. If getter lookup succeeds then $i$ evaluates to the closurization of getter $f$ on object $o$ (\ref{ordinaryMemberClosurization}).
- If getter lookup failed, a \cd{NoSuchMethodError} is thrown.
-
-
-
-
-%\LMHash{}
-%Otherwise,  a new instance $im$  of the predefined class  \code{Invocation}  is created, such that :
-%\begin{itemize}
-%\item  If $m$ is a setter name, \code{im.isSetter} evaluates to \code{\TRUE{}}; otherwise \code{im.isMethod} evaluates to \code{\TRUE{}}
-%\item  \code{im.memberName} evaluates to the symbol \code{m}.
-%\item \code{im.positionalArguments} evaluates to the value of \code{\CONST{} []}.
-%\item \code{im.namedArguments} evaluates to the value of \code{\CONST{} \{\}}.
-%\end{itemize}
-%Then the method \code{noSuchMethod()} is looked up in $o$ and invoked  with argument $im$, and the result of this invocation is the result of evaluating $i$. However, if the implementation found cannot be invoked with a single positional argument, the implementation  of \code{noSuchMethod()} in class \code{Object} is invoked on $o$ with argument $im'$, where $im'$ is an instance of \code{Invocation} such that :
-%\begin{itemize}
-%\item  \code{im'.isMethod} evaluates to \code{\TRUE{}}.
-%\item  \code{im'.memberName} evaluates to \code{\#noSuchMethod}.
-%\item \code{im'.positionalArguments} evaluates to an immutable list whose sole element is  $im$.
-%\item \code{im'.namedArguments} evaluates to the value of \code{\CONST{} \{\}}.
-%\end{itemize}
-%and the result of this latter invocation is the result of evaluating $i$.
-
-\LMHash{}
-It is a compile-time error if $e$ is a prefix object, $p$, (\ref{imports}) and $m$ refers to a type accessible via $p$ or to a member of class \cd{Object}.
-
-\commentary{
-This restriction is in line with other limitations on the use of prefixes as objects. The only permitted uses of $p\#m$ are closurizing top level methods and getters imported via the prefix $p$. Top level methods are directly available by their qualified names: $p.m$. However, getters and setters are not, and allowing their closurization is the whole point of the $e\#m$ syntax.
-}
-
-\LMHash{}
-Let $T$ be the static type of $e$. It is a static type warning if $T$ does not have an accessible instance method or getter named $m$ unless either:
-\begin{itemize}
-\item $T$ or a superinterface of $T$ is annotated with an annotation denoting a constant identical to the constant \code{@proxy} defined in \cd{dart:core}. Or
-\item $T$ is \cd{Type}, $e$ is a constant type literal and the class corresponding to $e$ declares an accessible static method or getter named $m$.
-\item $T$ is \code{Function} and $m$ is \CALL.
-\end{itemize}
-
-The static type of $i$ is:
-\begin{itemize}
-\item The static type of function $T.m$, if $T$ has an accessible instance member named $m$.
-\item The static type of function $T.m$, if $T$ is \cd{Type}, $e$ is a constant type literal and the class corresponding to $e$ declares an accessible static member or constructor named $m$.
-\item \code{Function} if $T$ is \code{Function} and $m$ is \CALL.
-\item The type  \DYNAMIC{} otherwise.
-\end{itemize}
-
-\subsubsection{Named Constructor Extraction}
-\LMLabel{namedConstructorExtraction}
-
-\LMHash{}
-Evaluation of a property extraction $i$ of the form \NEW{} $T\#m$ proceeds as follows:
-
-\LMHash{}
-If $T$ is a malformed type (\ref{staticTypes}), a dynamic error occurs. If $T$ is a deferred type with prefix $p$, then if $p$ has not been successfully loaded, a dynamic error occurs. If $T$ does not denote a class, a dynamic error occurs. In checked mode, if $T$ or any of its superclasses is malbounded a dynamic error occurs. Otherwise, if the type $T$ does not declare an accessible named constructor $f$ with name $m$, a \cd{NoSuchMethodError} is thrown. Otherwise, $i$ evaluates to the closurization of constructor $f$ of type $T$ (\ref{namedConstructorClosurization}).
-
-\commentary{Note that if $T$ is malformed or malbounded, a static warning occurs, as always.}
-
-\LMHash{}
-The static type of $i$ is the type of the constructor function, if $T$ denotes a class in the surrounding scope with an accessible constructor $f$ named $m$. Otherwise the static type of $i$ is \DYNAMIC{}.
-
-It is a compile-time error if $T$ is an enumerated type (\ref{enums}).
-
-\subsubsection{Anonymous Constructor Extraction}
-\LMLabel{anonymousConstructorExtraction}
-
-\LMHash{}
-Evaluation of a property extraction $i$ of the form \NEW{} $T\#$ proceeds as follows:
-
-\LMHash{}
-If $T$ is a malformed type (\ref{staticTypes}), a dynamic error occurs. If $T$ is a deferred type with prefix $p$, then if $p$ has not been successfully loaded, a dynamic error occurs. If $T$ does not denote a class, a dynamic error occurs. In checked mode, if $T$ or any of its superclasses is malbounded a dynamic error occurs. Otherwise, if the type $T$ does not declare an accessible anonymous constructor, a \cd{NoSuchMethodError} is thrown. Otherwise, $i$ evaluates to the closurization of the anonymous constructor of type $T$ (\ref{anonymousConstructorClosurization}).
-
-\commentary{Again, note that if $T$ is malformed or malbounded, existing rules ensure that a static warning occurs. This also means that $x\#$ where $x$ is not a type will always give a static warning.}
-
-\LMHash{}
-The static type of $i$ is the type of the constructor function $T()$, if $T$ denotes a class in the surrounding scope with an anonymous constructor $T()$. Otherwise the static type of $i$ is \DYNAMIC{}.
-
-It is a compile-time error if $T$ is an enumerated type (\ref{enums}).
-
-
-\subsubsection{General Super Property Extraction}
-\LMLabel{generalSuperPropertyExtraction}
-
-
-\LMHash{}
-Evaluation of a property extraction $i$ of the form \SUPER$\#m$ proceeds as follows:
-
- \LMHash{}
-Let $g$ be the method currently executing, and let $C$ be the class in which $g$ was looked up.  Let $S_{dynamic}$ be the superclass of $C$.
-
- \LMHash{}
-If $m$ is a setter name, let $f$ be the result of looking up setter $m$ in $S_{dynamic}$ with respect to the current library $L$. If setter lookup succeeds then $i$ evaluates to the closurization of setter $f$  with respect to superclass $S_{dynamic}$  (\ref{superClosurization}).  If setter lookup failed, a \cd{NoSuchMethodError} is thrown.
-
-If $m$ is not a setter name, let $f$ be the result of looking up method $m$ in $S_{dynamic}$ with respect to the current library $L$. If method lookup succeeds then $i$ evaluates to the closurization of method $m$ with respect to superclass $S_{dynamic}$ (\ref{superClosurization}).
-
-\LMHash{}
- Otherwise, let $f$ be the result of looking up getter $m$ in $S_{dynamic}$ with respect to the current library $L$.  If getter lookup succeeds then $i$ evaluates to the closurization of getter $f$ with respect to superclass $S_{dynamic}$ (\ref{superClosurization}).   If getter lookup failed, a \cd{NoSuchMethodError} is thrown.
-
-\LMHash{}
-Let $S_{static}$ be the superclass of the immediately enclosing class.It is a static type warning if $S_{static}$ does not have an accessible instance member named $m$.
-
-\LMHash{}
-The static type of $i$ is the static type of the function $S_{static}.m$,  if $S_{static}$ has an accessible instance member named $m$. Otherwise the static type of $i$ is \DYNAMIC{}.
-
-
-
 \subsubsection{Ordinary Member Closurization}
 \LMLabel{ordinaryMemberClosurization}
 
-
 \LMHash{}
 Let $o$ be an object, and let $u$ be a fresh final variable bound to $o$.
 The {\em closurization of method $f$ on object $o$} is defined to be equivalent to:
 \begin{itemize}
-\item $(a) \{\RETURN{}$ $u$ $op$ $a;$\} if $f$ is named $op$ and $op$ is one of  \code{$<$, $>$, $<$=, $>$=, ==,  -, +, /, \~{}/, *, \%, $|$, \^{}, \&, $<<$, $>>$} (this precludes closurization of unary -).
-\item $() \{\RETURN{}$ \~{} $u;$\} if $f$ is named \~{}.
-\item $(a) \{\RETURN{}$ $u[a];$\} if $f$ is named $[]$.
-\item $(a, b) \{\RETURN{}$ $u[a] = b;$\} if $f$ is named $[]=$.
+%\item $(a) \{\RETURN{}$ $u$ $op$ $a;$\} if $f$ is named $op$ and $op$ is one of  \code{<, >, <=, >=, ==,  -, +, /, \~{}/, *, \%, $|$, \^{}, \&, $<<$, $>>$} (this precludes closurization of unary -).
+%\item $() \{\RETURN{}$ \~{} $u;$\} if $f$ is named \~{}.
+%\item $(a) \{\RETURN{}$ $u[a];$\} if $f$ is named $[]$.
+%\item $(a, b) \{\RETURN{}$ $u[a] = b;$\} if $f$ is named $[]=$.
 \item
 \begin{dartCode}
-$(r_1, \ldots, r_n, \{p_1 : d_1, \ldots , p_k : d_k\})$ \{
+$(r_1, \ldots, r_n, \{p_1 = d_1, \ldots , p_k = d_k\})$ \{
   \RETURN{} $ u.m(r_1, \ldots, r_n, p_1: p_1, \ldots, p_k: p_k);$
 \}
 \end{dartCode}
@@ -4282,20 +4262,13 @@
   \RETURN{} $u.m(r_1, \ldots, r_n, p_1, \ldots, p_k)$;
 \}
 \end{dartCode}
-
 if $f$ is named $m$ and has required parameters $r_1, \ldots, r_n$, and optional positional parameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots, d_k$.
 \end{itemize}
 
 \LMHash{}
-Except that iff  \code{identical($o_1, o_2$)}  then  \cd{$o_1\#m$ == $o_2\#m$},  \cd{$o_1.m$ == $o_2.m$}, \cd{$o_1\#m$ == $o_2.m$} and  \cd{$o_1.m$ == $o_2\#m$}.
+Except that iff  \code{identical($o_1, o_2$)}  then \cd{$o_1.m$ == $o_2.m$}.
 %\item The static type of the property extraction is the static type of function $T.m$, where $T$ is the static type of $e$, if $T.m$ is defined. Otherwise the static type of $e.m$ is \DYNAMIC{}.
 
-\LMHash{}
-The {\em closurization of getter $f$ on object $o$} is defined to be equivalent to \cd{()\{\RETURN{} u.m;\}} if $f$ is named $m$, except that iff  \code{identical($o_1, o_2$)} then  \cd{$o_1\#m$ == $o_2\#m$}.
-
-\LMHash{}
-The {\em closurization of setter $f$ on object $o$} is defined to be equivalent to \cd{(a)\{\RETURN{} u.m = a;\}} if $f$ is named $m=$, except that iff  \code{identical($o_1, o_2$)} then \cd{$o_1\#m=$ == $o_2\#m=$}.
-
 \commentary{
 There is no guarantee that \cd{identical($o_1.m, o_2.m$)}. Dart implementations are not required to canonicalize these or any other closures.
 }
@@ -4305,73 +4278,6 @@
 The special treatment of equality in this case facilitates the use of extracted property functions in APIs where callbacks such as event listeners must often be registered and later unregistered. A common example is the DOM API in web browsers.
 }
 
-\commentary {
-Observations:
-
-One cannot closurize a constructor, getter or a setter via the dot based syntax. One must use the \# based form. One can tell whether one implemented a property via a method or via a field/getter, which means that one has to plan ahead as to what construct to use, and that choice is reflected in the interface of the class.
-}
-
-
-
-\subsubsection{Named Constructor Closurization}
-\LMLabel{namedConstructorClosurization}
-
-\LMHash{}
-The {\em closurization of constructor $f$ of type $T$} is defined to be equivalent to:
-\begin{itemize}
-\item
-\begin{dartCode}
-$(r_1, \ldots, r_n, \{p_1 : d_1, \ldots , p_k : d_k\})$ \{
-  \RETURN{} \NEW{} $T.m(r_1, \ldots, r_n, p_1: p_1, \ldots, p_k: p_k);$
-\}
-\end{dartCode}
-
-if $f$ is a named constructor with name $m$ that has required parameters $r_1, \ldots, r_n$, and named parameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots, d_k$.
-\item
-\begin{dartCode}
-$(r_1, \ldots, r_n, [p_1 = d_1, \ldots , p_k = d_k])$\{
-  \RETURN{} \NEW{} $T.m(r_1, \ldots, r_n, p_1, \ldots, p_k)$;
-\}
-\end{dartCode}
-
-if $f$ is a named constructor with name $m$ that has required parameters $r_1, \ldots, r_n$, and optional positional parameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots, d_k$.
-\end{itemize}
-
-\LMHash{}
-Except that iff  \code{identical($T_1, T_2$)}  then  \cd{\NEW{} $T_1\#m$ == \NEW{} $T_2\#m$}.
-
-\commentary{
-The above implies that for non-parameterized types, one can rely on the equality of closures resulting from closurization on the ``same'' type. For parameterized types, one cannot, since there is no requirement to canonicalize them.
-}
-
-\subsubsection{Anonymous Constructor Closurization}
-\LMLabel{anonymousConstructorClosurization}
-
-\LMHash{}
-The {\em closurization of anonymous constructor $f$ of type $T$} is defined to be equivalent to:
-\begin{itemize}
-\item
-\begin{dartCode}
-$(r_1, \ldots, r_n, \{p_1 : d_1, \ldots , p_k : d_k\})$ \{
-  \RETURN{} \NEW{} $T(r_1, \ldots, r_n, p_1: p_1, \ldots, p_k: p_k);$
-\}
-\end{dartCode}
-
-if $f$ is an anonymous constructor that has required parameters $r_1, \ldots, r_n$, and named parameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots, d_k$.
-\item
-\begin{dartCode}
-$(r_1, \ldots, r_n, [p_1 = d_1, \ldots , p_k = d_k])$\{
-  \RETURN{} \NEW{} $T(r_1, \ldots, r_n, p_1, \ldots, p_k)$;
-\}
-\end{dartCode}
-
-if $f$ is an anonymous constructor that has required parameters $r_1, \ldots, r_n$, and optional positional parameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots, d_k$.
-\end{itemize}
-
-\LMHash{}
-Except that iff  \code{identical($T_1, T_2$)}  then  \cd{\NEW{} $T_1\#$ == \NEW{} $T_2\#$}.
-
-
 \subsubsection{Super Closurization}
 \LMLabel{superClosurization}
 
@@ -4380,13 +4286,13 @@
 
 \LMHash{}
 \begin{itemize}
-\item $(a) \{\RETURN{}$ \SUPER{} $op$ $a;$\} if $f$ is named $op$ and $op$ is one of  \code{$<$, $>$, $<$=, $>$=, ==,  -, +, /, \~{}/, *, \%, $|$, \^{}, \&, $<<$, $>>$}.
-\item $() \{\RETURN{}$ \~{}\SUPER;\} if $f$ is named \~{}.
-\item $(a) \{\RETURN{}$ $\SUPER[a];$\} if $f$ is named $[]$.
-\item $(a, b) \{\RETURN{}$ $\SUPER[a] = b;$\} if $f$ is named $[]=$.
+%\item $(a) \{\RETURN{}$ \SUPER{} $op$ $a;$\} if $f$ is named $op$ and $op$ is one of  \code{<, >, <=, >=, ==,  -, +, /, \~{}/, *, \%, $|$, \^{}, \&, $<<$, $>>$}.
+%\item $() \{\RETURN{}$ \~{}\SUPER;\} if $f$ is named \~{}.
+%\item $(a) \{\RETURN{}$ $\SUPER[a];$\} if $f$ is named $[]$.
+%\item $(a, b) \{\RETURN{}$ $\SUPER[a] = b;$\} if $f$ is named $[]=$.
 \item
 \begin{dartCode}
-$(r_1, \ldots, r_n, \{p_1 : d_1, \ldots , p_k : d_k\})$ \{
+$(r_1, \ldots, r_n, \{p_1 = d_1, \ldots , p_k = d_k\})$ \{
   \RETURN{} \SUPER$.m(r_1, \ldots, r_n, p_1: p_1, \ldots, p_k: p_k);$
 \}
 \end{dartCode}
@@ -4397,20 +4303,11 @@
   \RETURN{} \SUPER$.m(r_1, \ldots, r_n, p_1, \ldots, p_k)$;
 \}
 \end{dartCode}
-
 if $f$ is named $m$ and has required parameters $r_1, \ldots, r_n$, and optional positional parameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots, d_k$.
 \end{itemize}
 
 \LMHash{}
-Except that iff two closurizations were created by code declared in the same class with identical bindings of \THIS{} then  \cd{\SUPER$_1\#m$ == \SUPER$_2\#m$},  \cd{\SUPER$_1.m$ == \SUPER$_2.m$}, \cd{\SUPER$_1\#m$ == \SUPER$_2.m$} and  \cd{\SUPER$_1.m$ == \SUPER$_2\#m$}.
-
-
-\LMHash{}
-The {\em closurization of getter $f$  with respect to superclass $S$} is defined to be equivalent to \cd{()\{\RETURN{} \SUPER.m;\}} if $f$ is named $m$, except that iff two closurizations were created by code declared in the same class with identical bindings of \THIS{} then  \cd{\SUPER$_1\#m$ == \SUPER$_2\#m$}.
-
-\LMHash{}
-The {\em closurization of setter $f$  with respect to superclass $S$} is defined to be equivalent to \cd{(a)\{\RETURN{} \SUPER.m = a;\}} if $f$ is named $m=$, except that iff two closurizations were created by code declared in the same class with identical bindings of \THIS{} then \cd{\SUPER$_1\#m=$ == \SUPER$_2\#m=$}.
-
+Except that iff two closurizations were created by code declared in the same class with identical bindings of \THIS{} then \cd{\SUPER$_1.m$ == \SUPER$_2.m$}.
 
 
 \subsection{ Assignment}
@@ -4466,12 +4363,24 @@
 It is a static type warning if the static type of $e$ may not be assigned to the static type of $v$. The static type of the expression $v$ \code{=} $e$ is the static type of $e$.
 
 \LMHash{}
-Evaluation of an assignment $a$ of the form $e_1?.v$ \code{=} $e_2$ is equivalent to the evaluation of the expression $((x) => x == \NULL? \NULL: x.v = e_2)(e_1)$
- unless $e_1$ is  a type literal, in which case it is equivalent to $e_1.v$ \code{=} $e_2$.
-. The static type of $a$ is the static type of $e_2$. Let $T$ be the static type of $e_1$ and let $y$ be a fresh variable of type $T$. Exactly the same static warnings that would be caused by $y.v = e_2$ are also generated in the case of $e_1?.v$ \code{=} $e_2$.
+Evaluation of an assignment $a$ of the form \code{$e_1$?.$v$ = $e_2$}
+proceeds as follows:
+
+\LMHash
+If $e_1$ is a type literal, $a$ is equivalent to \code{$e_1$.$v$ = $e_2$}.
 
 \LMHash{}
-Evaluation of an assignment of the form $e_1.v$ \code{=} $e_2$ proceeds as follows:
+Otherwise evaluate $e_1$ to an object $o$.
+If $o$ is the null value, $a$ evaluates to the null value.
+Otherwise let $x$ be a fresh variable bound to $o$
+and evaluate \code{$x$.$v$ = $e_2$} to an object $r$.
+Then $a$ evaluates to $r$.
+
+\LMHash{}
+The static type of $a$ is the static type of $e_2$. Let $T$ be the static type of $e_1$ and let $y$ be a fresh variable of type $T$. Exactly the same static warnings that would be caused by \code{$y$.$v$ = $e_2$} are also generated in the case of \code{$e_1$?.$v$ = $e_2$}.
+
+\LMHash{}
+Evaluation of an assignment of the form \code{$e_1$.$v$ = $e_2$} proceeds as follows:
 
 \LMHash{}
 The expression $e_1$ is evaluated to an object $o_1$. Then, the expression $e_2$  is evaluated to an object $o_2$. Then, the setter $v=$ is looked up (\ref{getterAndSetterLookup}) in $o_1$ with respect to the current library.  If $o_1$ is an instance of \code{Type} but $e_1$ is not a constant type literal, then if $v=$ is a setter that forwards (\ref{functionDeclarations}) to a static setter, setter lookup fails. Otherwise, the body  of $v=$ is executed with its formal parameter bound to $o_2$ and \THIS{} bound to $o_1$.
@@ -4551,16 +4460,20 @@
 \LMHash{}
 It is a static type warning if the static type of $e$ may not be assigned to the static type of the formal parameter of the setter $v=$.   The static type of the expression $\SUPER.v$ \code{=} $e$ is the static type of $e$.
 
-
-
-
-
+\LMHash{}
+Evaluation of an assignment $e$ of the form \code{$e_1$[$e_2$] = $e_3$}
+proceeds as follows:
 
 \LMHash{}
-Evaluation of an assignment of the form $e_1[e_2]$ \code{=} $e_3$ is equivalent to the evaluation of the expression \code{(a, i, e)\{a.[]=(i, e); \RETURN{} e; \} ($e_1, e_2, e_3$)}.  The static type of the expression $e_1[e_2]$ \code{=} $e_3$ is the static type of $e_3$.
+Evaluate $e_1$ to an object $a$, then evaluate $e_2$ to an object $i$, and finally evaluate $e_3$ to an object $v$.
+Call the method \code{[]=} on $a$ with $i$ as first argument and $v$ as second argument.
+Then $e$ evaluates to $v$.
 
 \LMHash{}
-An assignment of the form $\SUPER[e_1]$ \code{=} $e_2$ is equivalent to the expression $\SUPER.[e_1]$ \code{=} $e_2$.  The static type of the expression $\SUPER[e_1]$ \code{=} $e_2$ is the static type of $e_2$.
+The static type of the expression \code{$e_1$[$e_2$] = $e_3$} is the static type of $e_3$.
+
+\LMHash{}
+An assignment of the form \code{\SUPER[$e_1$] = $e_2$} is equivalent to the expression \code{\SUPER.[$e_1$] = $e_2$}.  The static type of the expression \code{\SUPER[$e_1$] = $e_2$} is the static type of $e_2$.
 
 
 % Should we add: It is a dynamic error if $e_1$ evaluates to an  constant list or map.
@@ -4577,27 +4490,73 @@
 \LMLabel{compoundAssignment}
 
 \LMHash{}
-Evaluation of a compound assignment of the form $v$ {\em ??=} $e$ is equivalent to the evaluation of the expression  $((x) => x == \NULL{}$ ?  $v=e : x)(v)$ where $x$ is a fresh variable that is not used in $e$.
+Evaluation of a compound assignment $a$ of the form \code{$v$ ??= $e$}
+proceeds as follows:
 
 \LMHash{}
-Evaluation of a compound assignment of the form $C.v$ {\em ??=} $e$, where $C$ is a type literal, is equivalent to the evaluation of the expression  $((x) => x == \NULL{}$?  $C.v=e: x)(C.v)$ where $x$ is a fresh variable that is not used in $e$.
+Evaluate $v$ to an object $o$.
+If $o$ is not the null value, $a$ evaluates to $o$.
+Otherwise evaluate \code{$v$ = $e$} to a value $r$,
+and then $a$ evaluates to $r$.
+
+\LMHash{}
+Evaluation of a compound assignment, $a$ of the form \code{$C$.$v$ ??= $e$}, where $C$ is a type literal, proceeds as follow:
+
+\LMHash{}
+Evaluate \code{$C$.$v$} to an object $o$.
+If $o$ is not the null value, $a$ evaluates to $o$.
+Otherwise evaluate \code{$C$.$v$ = $e$} to a value $r$,
+and then $a$ evaluates to $r$.
 
 \commentary {
 The two rules above also apply when the variable v or the type C is prefixed.
 }
 
 \LMHash{}
-Evaluation of a compound assignment of the form $e_1.v$ {\em ??=} $e_2$ is equivalent to the evaluation of the expression  $((x) =>((y) => y == \NULL{}$ ? $ x.v = e_2: y)(x.v))(e_1)$ where $x$ and $y$ are distinct fresh variables that are not used in $e_2$.
+Evaluation of a compound assignment $a$ of the form \code{$e_1$.$v$ ??= $e_2$}
+proceeds as follows:
 
 \LMHash{}
-Evaluation of a compound assignment of the form  $e_1[e_2]$  {\em ??=} $e_3$ is equivalent to the evaluation of the expression
-$((a, i) => ((x) => x == \NULL{}$ ?  $a[i] = e_3: x)(a[i]))(e_1, e_2)$ where $x$, $a$ and $i$ are distinct fresh variables that are not used in $e_3$.
+Evaluate $e_1$ to an object $u$.
+Let $x$ be a fresh variable bound to $u$.
+Evaluate \code{$x$.$v$} to an object $o$.
+If $o$ is not the null value, $a$ evaluates to $o$.
+Otherwise evaluate \code{$x$.$v$ = $e_2$} to an object $r$,
+and then $a$ evaluates to $r$.
 
 \LMHash{}
-Evaluation of a compound assignment of the form $\SUPER.v$  {\em ??=} $e$ is equivalent to the evaluation of the expression  $((x) => x == \NULL{}$ ? $\SUPER.v = e: x)(\SUPER.v)$ where $x$ is a fresh variable that is not used in $e$.
+Evaluation of a compound assignment $a$ of the form \code{$e_1$[$e_2$] ??= $e_3$}
+proceeds as follows:
 
 \LMHash{}
-Evaluation of a compound assignment of the form $e_1?.v$  {\em ??=} $e_2$ is equivalent to the evaluation of the expression \code{((x) $=>$ x == \NULL{} ?  \NULL: $x.v ??=  e_2$)($e_1$)} where $x$ is a variable that is not used in $e_2$.
+Evaluate $e_1$ to an object $u$ and then evaluate $e_2$ to an object $i$.
+Call the \code{[]} method on $u$ with argument $i$, and let $o$ be the returned value.
+If $o$ is not the null value, $a$ evaluates to $o$.
+Otherwise evaluate $e_3$ to an object $v$
+and then call the \code{[]=} method on $u$ with $i$ as first argument and $v$ as second argument.
+Then $a$ evaluates to $v$.
+
+\LMHash{}
+Evaluation of a compound assignment $a$ of the form \code{\SUPER.$v$ ??= $e$}
+proceeds as follows:
+
+\LMHash{}
+Evaluate \code{\SUPER.$v$} to an object $o$.
+If $o$ is not the null value then $a$ evaluates to $o$.
+Otherwise evaluate \code{\SUPER.$v$ = $e$} to an object $r$,
+and then $a$ evaluates to $r$.
+
+\LMHash{}
+Evaluation of a compound assignment $a$ of the form \code{$e_1$?.$v$ ??= $e_2$}
+proceeds as follows:
+
+\LMHash{}
+Evaluate $e_1$ to an object $u$ and let $x$ be a fresh variable bound to $u$.
+Evaluate \code{$x$.$v$} to an object $o$.
+If $o$ is not the null value then $a$ evaluates to $o$.
+Otherwise evaluate \code{$x$.$v$ = $e_2$} to an object $r$,
+and then $a$ evaluates to $r$.
+
 % But what about C?.v ??= e
 
 \LMHash{}
@@ -4606,7 +4565,6 @@
 \LMHash{}
 The static type of a compound assignment of the form $v$ {\em ??=} $e$ is the least upper bound of the static type of $v$ and the static type of $e$.  Exactly the same static warnings that would be caused by $v = e$ are also generated in the case of $v$ {\em ??=} $e$.
 
-
 \LMHash{}
 The static type of a compound assignment of the form  $C.v$ {\em ??=} $e$  is the least upper bound of the static type of $C.v$ and the static type of $e$.  Exactly the same static warnings that would be caused by $C.v = e$ are also generated in the case of $C.v$ {\em ??=} $e$.
 
@@ -4620,11 +4578,33 @@
 The static type of a compound assignment of the form $\SUPER.v$  {\em ??=} $e$  is the least upper bound of the static type of $\SUPER.v$ and the static type of $e$. Exactly the same static warnings that would be caused by $\SUPER.v = e$ are also generated in the case of $\SUPER.v$  {\em ??=} $e$.
 
 \LMHash{}
-For any other valid operator $op$, a compound assignment of the form $v$ $op\code{=} e$ is equivalent to $v \code{=} v$ $op$ $e$. A compound assignment of the form $C.v$ $op \code{=} e$ is equivalent to $C.v \code{=} C.v$ $op$ $e$. A compound assignment of the form $e_1.v$ $op = e_2$ is equivalent to \code{((x) $=>$ x.v = x.v $op$ $e_2$)($e_1$)} where $x$ is a variable that is not used in $e_2$. A compound assignment of the form  $e_1[e_2]$ $op\code{=} e_3$ is equivalent to
-\code{((a, i) $=>$ a[i] = a[i] $op$ $e_3$)($e_1, e_2$)} where $a$ and $i$ are a variables that are not used in $e_3$.
+For any other valid operator $op$, a compound assignment of the form \code{$v$ $op$= $e$} is equivalent to \code{$v$ = $v$ $op$ $e$}. A compound assignment of the form \code{$C$.$v$ $op$= $e$} is equivalent to \code{$C$.$v$ = $C$.$v$ $op$ $e$}.
 
 \LMHash{}
-Evaluation of a compound assignment of the form $e_1?.v$ $op = e_2$ is equivalent to \code{((x) $=>$ x?.v = x.v $op$ $e_2$)($e_1$)} where $x$ is a variable that is not used in $e_2$. The static type of $e_1?.v$ $op = e_2$ is the static type of $e_1.v$ $op$ $e_2$. Exactly the same static warnings that would be caused by $e_1.v$ $op = e_2$ are also generated in the case of $e_1?.v$ $op = e_2$.
+Evaluation of a compound assignment $a$ of the form \code{$e_1$.$v$ $op$= $e_2$} proceeds as follows:
+Evaluate $e_1$ to an object $u$ and let $x$ be a fresh variable bound to $u$.
+Evaluate \code{$x$.$v$ = $x$.$v$ $op$ $e_2$} to an object $r$
+and then $a$ evaluates to $r$.
+
+\LMHash{}
+Evaluation of s compound assignment $a$ of the form \code{$e_1$[$e_2$] $op$= $e_3$} proceeds as follows:
+Evaluate $e_1$ to an object $u$ and evaluate $e_2$ to an object $v$.
+Let $a$ and $i$ be fresh variables bound to $u$ and $v$ respectively.
+Evaluate \code{$a$[$i$] = $a$[$i$] $op$ $e_3$} to an object $r$,
+and then $a$ evaluates to $r$.
+
+\LMHash{}
+Evaluation of a compound assignment $a$ of the form \code{$e_1$?.$v$ $op$ = $e_2$} proceeds as follows:
+
+\LMHash{}
+Evaluate $e_1$ to an object $u$.
+If $u$ is the null value, then $a$ evaluates to the null value.
+Otherwise let $x$ be a fresh variable bound to $u$.
+Evaluate \code{$x$.$v$ $op$= $e_2$} to an object $r$.
+Then $a$ evaluates to $r$.
+
+\LMHash{}
+The static type of \code{$e_1$?.$v$ $op$= $e_2$} is the static type of \code{$e_1$.$v$ $op$ $e_2$}. Exactly the same static warnings that would be caused by \code{$e_1$.$v$ $op$= $e_2$} are also generated in the case of \code{$e_1$?.$v$ $op$= $e_2$}.
 
 \LMHash{}
 A compound assignment of the form $C?.v$ $op = e_2$ is equivalent to the expression
@@ -4692,7 +4672,17 @@
 \end{grammar}
 
 \LMHash{}
-Evaluation of an if-null expression $e$ of the form $e_1??e_2 $ is equivalent to the evaluation of the expression $((x) => x == \NULL? e_2: x)(e_1)$. The static type of $e$ is least upper bound (\ref{leastUpperBounds}) of the static type of $e_1$ and the static type of $e_2$.
+Evaluation of an if-null expression $e$ of the form \code{$e_1$ ?? $e_2$}
+proceeds as follows:
+
+\LMHash{}
+Evaluate $e_1$ to an object $o$.
+If $o$ is not the null value, then $e$ evaluates to $o$.
+Otherwise evaluate $e_2$ to an object $r$,
+and then $e$ evaluates to $r$.
+
+\LMHash{}
+The static type of $e$ is the least upper bound (\ref{leastUpperBounds}) of the static type of $e_1$ and the static type of $e_2$.
 
 
 \subsection{ Logical Boolean Expressions}
@@ -4717,10 +4707,10 @@
 A {\em logical boolean expression} is either an equality expression (\ref{equality}), or an invocation of a logical boolean operator on an expression $e_1$ with argument $e_2$.
 
 \LMHash{}
-Evaluation of a logical boolean expression $b$ of the form $e_1 || e_2$ causes the evaluation of $e_1$ which is then  subjected to boolean conversion, yielding an object $o_1$; if $o_1$ is \TRUE, the result of evaluating $b$ is \TRUE, otherwise $e_2$ is evaluated to an object $o_2$, which is then subjected to boolean conversion (\ref{booleanConversion}) producing an object $r$, which is the value of $b$.
+Evaluation of a logical boolean expression $b$ of the form $e_1 || e_2$ causes the evaluation of $e_1$ which is then  subjected to boolean conversion, producing an object $o_1$; if $o_1$ is \TRUE, the result of evaluating $b$ is \TRUE, otherwise $e_2$ is evaluated to an object $o_2$, which is then subjected to boolean conversion (\ref{booleanConversion}) producing an object $r$, which is the value of $b$.
 
 \LMHash{}
-Evaluation of a logical boolean expression $b$ of the form $e_1 \&\& e_2$ causes the evaluation of $e_1$ which is then subjected to boolean conversion, yielding an object $o_1$; if $o_1$ is not  \TRUE, the result of evaluating $b$ is \FALSE, otherwise $e_2$ is evaluated to an object $o_2$, which is then subjected to boolean conversion producing an object $r$, which is the value of $b$.
+Evaluation of a logical boolean expression $b$ of the form $e_1 \&\& e_2$ causes the evaluation of $e_1$ which is then subjected to boolean conversion, producing an object $o_1$; if $o_1$ is not  \TRUE, the result of evaluating $b$ is \FALSE, otherwise $e_2$ is evaluated to an object $o_2$, which is then subjected to boolean conversion evaluating to an object $r$, which is the value of $b$.
 
 \LMHash{}
 A logical boolean expression $b$ of the form $e_1 \&\& e_2$ shows that a variable $v$ has type
@@ -5007,18 +4997,24 @@
 
 \LMHash{}
 Evaluation of an await expression $a$ of the form \AWAIT{} $e$ proceeds as follows:
-First, the expression $e$ is evaluated. Next:
+First, the expression $e$ is evaluated to an object $o$.
 
 \LMHash{}
-If $e$ raises an exception $x$, then an instance $f$ of class \code{Future} is allocated and later completed with $x$. Otherwise, if $e$ evaluates to an object $o$ that is not an instance of \code{Future}, then let $f$ be the result of calling \code{Future.value()} with $o$ as its argument; otherwise let $f$ be the result of evaluating $e$.
+% NOTICE: Removed the requirement that an error thrown by $e$ is caught in a
+% future. There is no reason $var x = e; await x;$ and $await e$ should behave
+% differently, and no implementation actually implemented it.
+Then, if $o$ is not an instance of \code{Future}, then let $f$ be the result of creating a new object using the constructor \code{Future.value()} with $o$ as its argument; otherwise let $f$ be $o$.
 
 \LMHash{}
-Next,  execution of the function $m$ immediately enclosing $a$ is suspended until after $f$ completes. The stream associated with the innermost enclosing asynchronous for loop (\ref{asynchronousFor-in}), if any, is paused. At some time after $f$ is completed, control returns to the current invocation. The stream associated with the innermost enclosing asynchronous for loop  (\ref{asynchronousFor-in}), if any, is resumed. If $f$ has completed with an exception $x$, $a$ raises $x$. If $f$ completes with a value $v$, $a$ evaluates to $v$.
+Next, the stream associated with the innermost enclosing asynchronous for loop (\ref{asynchronousFor-in}), if any, is paused. The current invocation of the function body immediately enclosing $a$ is suspended until after $f$ completes. At some time after $f$ is completed, control returns to the current invocation. If $f$ has completed with an error $x$ and stack trace $t$, $a$ throws $x$ and $t$ (\ref{evaluation}). If $f$ completes with a value $v$, $a$ evaluates to $v$.
 
 %Otherwise, the value of $a$ is the value of $e$. If evaluation of $e$ raises an exception $x$, $a$ raises $x$.
 
 \commentary{
 It is a compile-time error if  the function  immediately enclosing  $a$  is not declared asynchronous.  However, this error is simply a syntax error, because in the context of a normal function, \AWAIT{} has no special meaning.
+% TODO(lrn): Update this, it's not actually correct,
+% the expression "await(expr)" is valid non-async syntax *and* a valid
+% async await expression.
 }
 
 \rationale{
@@ -5042,7 +5038,7 @@
 
  \begin{grammar}
 {\bf postfixExpression:}assignableExpression postfixOperator;
-      primary (selector* $|$ ( `\#' ( (identifier `='?) $|$ operator)))
+      primary selector*
     .
 
 {\bf postfixOperator:}
@@ -5063,7 +5059,12 @@
  A {\em postfix expression} is either a primary expression, a function, method or getter invocation, or an invocation of a postfix operator on an expression $e$.
 
 \LMHash{}
-Execution of a postfix expression of the form \code{$v$++}, where $v$ is an identifier, is equivalent to executing \code{()\{\VAR{} r = $v$; $v$ = r + 1; \RETURN{} r\}()}.
+Evaluation of a postfix expression $e$ of the form \code{$v$++}, where $v$ is an identifier, proceeds as follows:
+
+\LMHash{}
+Evaluate $v$ to an object $r$ and let $y$ be a fresh variable bound to $r$.
+Evaluate \code{$v$ = $y$ + 1}.
+Then $e$ evaluates to $r$.
 
 \LMHash{}
 The static type of such an expression is the static type of $v$.
@@ -5073,86 +5074,140 @@
 }
 
 \LMHash{}
-Execution of a postfix expression of the form \code{$C.v$ ++} is equivalent to executing
-
-\code{()\{\VAR{} r = $C.v$; $C.v$ = r + 1; \RETURN{} r\}()}.
+Evaluation of a postfix expression $e$ of the form \code{$C$.$v$++}
+proceeds as follows:
 
 \LMHash{}
-The static type of such an expression is the static type of $C.v$.
+Evaluate \code{$C$.$v$} to a value $r$
+and let $y$ be a fresh variable bound to $r$.
+Evaluate \code{$C$.$v$ = $y$ + 1}.
+Then $e$ evaluates to $r$.
+
+\LMHash{}
+The static type of such an expression is the static type of \code{$C$.$v$}.
 
 
 \LMHash{}
-Execution of a postfix expression of the form \code{$e_1.v$++} is equivalent to executing
-
-\code{(x)\{\VAR{} r = x.v; x.v = r + 1; \RETURN{} r\}($e_1$)}.
+Evaluation of a postfix expression $e$ of the form \code{$e_1$.$v$++}
+proceeds as follows:
 
 \LMHash{}
-The static type of such an expression is the static type of $e_1.v$.
+Evaluate $e_1$ to an object $u$ and let $x$ be a fresh variable bound to $u$.
+Evaluate \code{$x$.$v$} to a value $r$
+and let $y$ be a fresh variable bound to $r$.
+Evaluate \code{$x$.$v$ = $y$ + 1}.
+Then $e$ evaluates to $r$.
+
+\LMHash{}
+The static type of such an expression is the static type of \code{$e_1$.$v$}.
 
 
 \LMHash{}
-Execution of a postfix expression of the form \code{$e_1[e_2]$++},  is equivalent to executing
-
-\code{(a, i)\{\VAR{} r = a[i]; a[i] = r + 1; \RETURN{} r\}($e_1$, $e_2$)}.
+Evaluation of a postfix expression $e$ of the form \code{$e_1$[$e_2$]++}
+proceeds as follows:
 
 \LMHash{}
-The static type of such an expression is the static type of $e_1[e_2]$.
+Evaluate $e_1$ to an object $u$ and $e_2$ to an object $v$.
+Let $a$ and $i$ be fresh variables bound to $u$ and $v$ respectively.
+Evaluate \code{$a$[$i$]} to an object $r$
+and let $y$ be a fresh variable bound to $r$.
+Evaluate \code{$a$[$i$] = $y$ + 1}.
+Then $e$ evaluates to $r$.
+
+\LMHash{}
+The static type of such an expression is the static type of \code{$e_1$[$e_2$]}.
 
 
 \LMHash{}
-Execution of a postfix expression of the form \code{$v$-{}-}, where $v$ is an identifier, is equivalent to executing
+Evaluation of a postfix expression $e$ of the form \code{$v$-{}-}, where $v$ is an identifier, proceeds as follows:
 
-\code{()\{\VAR{} r = $v$; $v$ = r - 1; \RETURN{} r\}()}.
+\LMHash{}
+Evaluate the expression $v$ to an object $r$
+and let $y$ be a fresh variable bound to $r$.
+Evaluate \code{$v$ = $y$ - 1}.
+Then $e$ evaluates to $r$.
 
 \LMHash{}
 The static type of such an expression is the static type of $v$.
 
 
 \LMHash{}
-Execution of a postfix expression of the form \code{$C.v$-{}-} is equivalent to executing
-
-\code{()\{\VAR{} r = $C.v$; $C.v$ = r - 1; \RETURN{} r\}()}.
+Evaluation of a postfix expression $e$ of the form \code{$C$.$v$-{}-}
+proceeds as follows:
 
 \LMHash{}
-The static type of such an expression is the static type of $C.v$.
+Evaluate \code{$C$.$v$} to a value $r$
+and let $y$ be a fresh variable bound to $r$.
+Evaluate \code{$C$.$v$ = $y$ - 1}.
+Then $e$ evaluates to $r$.
+
+\LMHash{}
+The static type of such an expression is the static type of \code{$C$.$v$}.
 
 
 \LMHash{}
-Execution of a postfix expression of the form \code{$e_1.v$-{}-} is equivalent to executing
-
-\code{(x)\{\VAR{} r = x.v; x.v = r - 1; \RETURN{} r\}($e_1$)}.
+Evaluation of a postfix expression of the form \code{$e_1$.$v$-{}-}
+proceeds as follows:
 
 \LMHash{}
-The static type of such an expression is the static type of $e_1.v$.
+Evaluate $e_1$ to an object $u$ and let $x$ be a fresh variable bound to $u$.
+Evaluate \code{$x$.$v$} to a value $r$
+and let $y$ be a fresh variable bound to $r$.
+Evaluate \code{$x$.$v$ = $y$ - 1}.
+Then $e$ evaluates to $r$.
 
 
 \LMHash{}
-Execution of a postfix expression of the form \code{$e_1[e_2]$-{}-},  is equivalent to executing
+The static type of such an expression is the static type of \code{$e_1$.$v$}.
 
-\code{(a, i)\{\VAR{} r = a[i]; a[i] = r - 1; \RETURN{} r\}($e_1$, $e_2$)}.
 
 \LMHash{}
-The static type of such an expression is the static type of $e_1[e_2]$.
+Evaluation of a postfix expression $e$ of the form \code{$e_1$[$e_2$]-{}-}
+proceeds as follows:
 
 \LMHash{}
-Execution of a postfix expression of the form \code{$e_1?.v$++} is equivalent to executing
-
-\code{((x) =$>$ x == \NULL? \NULL : x.v++)($e_1$)}
-unless $e_1$ is a type literal, in which case it is equivalent to \code{$e_1.v$++}
-.
+Evaluate $e_1$ to an object $u$ and $e_2$ to an object $v$.
+Let $a$ and $i$ be fresh variables bound to $u$ and $v$ respectively.
+Evaluate \code{$a$[$i$]} to an object $r$
+and let $y$ be a fresh variable bound to $r$.
+Evaluate \code{$a$[$i$] = $y$ - 1}.
+Then $e$ evaluates to $r$.
 
 \LMHash{}
-The static type of such an expression is the static type of $e_1.v$.
+The static type of such an expression is the static type of \code{$e_1$[$e_2$]}.
 
 \LMHash{}
-Execution of a postfix expression of the form \code{$e_1?.v$-{}-} is equivalent to executing
-
-\code{((x) =$>$ x == \NULL? \NULL : x.v-{}-)($e_1$)}
-unless $e_1$ is a type literal, in which case it is equivalent to \code{$e_1.v$-{}-}
-.
+Evaluation of a postfix expression $e$ of the form \code{$e_1$?.$v$++}
+where $e_1$ is not a type literal, proceeds as follows:
 
 \LMHash{}
-The static type of such an expression is the static type of $e_1.v$.
+If $e_1$ is a type literal, $e$ is equivalent to \code{$e_1$.$v$++}.
+
+\LMHash{}
+Otherwise evaluate $e_1$ to an object $u$.
+if $u$ is the null value, $e$ evaluates to the null value.
+Otherwise let $x$ be a fresh variable bound to $u$.
+Evaluate \code{$x$.$v$++} to an object $o$.
+Then $e$ evaluates to $o$.
+
+\LMHash{}
+The static type of such an expression is the static type of \code{$e_1$.$v$}.
+
+\LMHash{}
+Evaluation of a postfix expression $e$ of the form \code{$e_1$?.$v$-{}-}
+where $e_1$ is not a type literal, proceeds as follows:
+
+If $e_1$ is a type literal, $e$ is equivalent to \code{$e_1$.$v$-{}-}.
+
+Otherwise evaluate $e_1$ to an object $u$.
+If $u$ is the null value, $e$ evaluates to the null value.
+Otherwise let $x$ be a fresh variable bound to $u$.
+Evaluate \code{$x$.$v$-{}-} to an object $o$.
+Then $e$ evaluates to $o$.
+
+
+\LMHash{}
+The static type of such an expression is the static type of \code{$e_1$.$v$}.
 
 
 \subsection{ Assignable Expressions}
@@ -5298,7 +5353,7 @@
 %If no such member exists, let $d$ be the declaration of the static member name $id$ declared in a superclass of the current class, if it exists.
 
 \begin{itemize}
-\item if $d$ is a prefix $p$, a compile-time error occurs unless the token immediately following $d$ is \code{'.'} or \code{'\#'}.
+\item if $d$ is a prefix $p$, a compile-time error occurs unless the token immediately following $d$ is \code{'.'}.
 \item If $d$ is a class or type alias $T$, the value of $e$ is an instance of  class \code{Type} (or a subclass thereof) reifying $T$.
 \item If $d$ is a type parameter $T$, then the value of $e$ is the value of the actual type argument corresponding to $T$ that was  passed to the generative constructor that created the current binding of \THIS{}. If, however, $e$ occurs inside a static member, a compile-time error occurs.
 
@@ -5420,10 +5475,38 @@
 \LMHash{}
 The static type of a cast expression  \code{$e$ \AS{} $T$}  is $T$.
 
-
 \section{Statements}
 \LMLabel{statements}
 
+\LMHash{}
+A {\em statement} is a fragment of Dart code that can be executed at runtime. Statements, unlike expressions, do not evaluate to a value, but are instead executed for their effect on the program state and control flow.
+
+\label{completion}
+Execution of a statement {\em completes} in one of five ways: either it {\em completes normally}, it {\em breaks} or it {\em continues} (either to a label or without a label), it {\em returns} (with or without a value), or it {\em throws} an exception object and an associated stack trace.
+
+In the description of statement execution, the default is that the execution
+completes normally unless otherwise stated.
+
+If the execution of a statement, $s$, is defined in terms of executing
+another statement,
+and the execution of that other statement does not complete normally,
+then, unless otherwise stated, the execution of $s$ stops
+at that point and completes in the same way.
+\commentary{
+For example, if execution of the body of a \DO{} loop returns a value, so does execution of the \DO{} loop statement itself.
+}
+
+If the execution of a statement is defined in terms of evaluating an expression
+and the evaluation of that expression throws,
+then, unless otherwise stated, the execution of the statement stops
+at that point and throws the same exception object and stack trace.
+\commentary{
+For example, if evaluation of the condition expression of an \IF{} statement throws,
+then so does execution of the \IF{} statement. Likewise, if evaluation of the expression of a \RETURN{} statement throws, so does execution of the \RETURN{} statement.
+}
+
+\LMHash{}
+
  \begin{grammar}
 {\bf statements:}
       statement*
@@ -5458,7 +5541,7 @@
  \LMLabel{blocks}
 
 \LMHash{}
- A {\em block statement} supports sequencing of code.
+A {\em block statement} supports sequencing of code.
 
 \LMHash{}
 Execution of a block statement $\{s_1, \ldots,  s_n\}$ proceeds as follows:
@@ -5470,9 +5553,8 @@
 A block statement introduces a new scope, which is nested in the lexically enclosing scope in which the block statement appears.
 
 
-
- \subsection{Expression Statements}
- \LMLabel{expressionStatements}
+\subsection{Expression Statements}
+\LMLabel{expressionStatements}
 
 \LMHash{}
 An {\em expression statement} consists of an expression other than a non-constant map literal (\ref{maps}) that has no explicit type arguments.
@@ -5516,7 +5598,7 @@
  A variable declaration statement of the form \VAR{} $v;$ is equivalent to \VAR{} $v = \NULL{};$. A variable declaration statement of the form $T$ $v;$ is equivalent to $T$ $v = \NULL{};$.
 
 \commentary{
-This holds regardless of the type $T$. For example, \code{int i;} does not cause \code{i} to be initialized to zero. Instead, \code{i} is initialized to \NULL{}, just as if we had written \VAR{} \code{i;} or \code{Object i;} or \code{Collection$<$String$>$ i;}.
+This holds regardless of the type $T$. For example, \code{int i;} does not cause \code{i} to be initialized to zero. Instead, \code{i} is initialized to \NULL{}, just as if we had written \VAR{} \code{i;} or \code{Object i;} or \code{Collection<String> i;}.
 }
 
 \rationale{
@@ -5556,19 +5638,19 @@
 }
 
 \begin{dartCode}
-f(x) =$>$ x++;  // a top level function
+f(x) => x++;  // a top level function
 top() \{ // another top level function
   f(3); // illegal
-  f(x) $=>$ x $>$ 0? x*f(x-1): 1;  // recursion is legal
-  g1(x) $=>$ h(x, 1); // error: h is not declared yet
-  h(x, n) $=>$ x $>$ 1? h(x-1, n*x): n; // again, recursion is fine
-  g2(x) $=>$ h(x, 1); // legal
+  f(x) => x > 0? x*f(x-1): 1;  // recursion is legal
+  g1(x) => h(x, 1); // error: h is not declared yet
+  h(x, n) => x > 1? h(x-1, n*x): n; // again, recursion is fine
+  g2(x) => h(x, 1); // legal
 
-  p1(x) $=>$ q(x,x); // illegal
-  q1(a, b)$ =>$ a $>$ 0 ? p1(a-1): b; // fine
+  p1(x) => q(x,x); // illegal
+  q1(a, b)$ =>$ a > 0 ? p1(a-1): b; // fine
 
-  q2(a, b) $=>$ a $>$ 0 ? p2(a-1): b; // illegal
-  p1(x) $=>$ q2(x,x); // fine
+  q2(a, b) => a > 0 ? p2(a-1): b; // illegal
+  p1(x) => q2(x,x); // fine
 \}
 \end{dartCode}
 
@@ -5579,8 +5661,8 @@
 \begin{dartCode}
 top2() \{ // a top level function
  \VAR{} p, q;
-  p = (x) $=>$ q(x,x);
-  q = (a, b) $=>$ a $>$ 0 ? p(a-1): b;
+  p = (x) => q(x,x);
+  q = (a, b) => a > 0 ? p(a-1): b;
 
 \}
 \end{dartCode}
@@ -5599,15 +5681,14 @@
 
 \begin{grammar}
 {\bf ifStatement:}
-      \IF{} `(' expression `)' statement ( \ELSE{} statement)? % we could allow top level expression
+      \IF{} `(' expression `)' statement ( \ELSE{} statement)?
     .
- \end{grammar}
+\end{grammar}
 
 Execution of an if statement of the form  \code {\IF{} (}$b$\code{)}$s_1$ \code{\ELSE{} } $s_2$ proceeds as follows:
 
 \LMHash{}
- First, the expression $b$ is evaluated to an object $o$. Then, $o$ is  subjected to boolean conversion (\ref{booleanConversion}), producing an object $r$. If $r$ is \TRUE{}, then the statement $\{s_1\}$ is executed, otherwise statement $\{s_2\}$ is executed.
-
+ First, the expression $b$ is evaluated to an object $o$. Then, $o$ is subjected to boolean conversion (\ref{booleanConversion}), producing an object $r$. If $r$ is \TRUE{}, then the statement $\{s_1\}$ is executed, otherwise statement $\{s_2\}$ is executed.
 
  \commentary {
  Put another way, \code {\IF{} (}$b$\code{)}$s_1$ \code{\ELSE{} } $s_2$ is equivalent to
@@ -5677,7 +5758,7 @@
 
 
 \LMHash{}
-Execution of a for statement of the form   \code{ \FOR{} (\VAR{} $v = e_0$ ; $c$; $e$) $s$} proceeds as follows:
+Execution of a for statement of the form   \code{ \FOR{} (\VAR{} $v$ = $e_0$ ; $c$; $e$) $s$} proceeds as follows:
 
 \LMHash{}
 If $c$ is empty then let $c^\prime$ be \TRUE{} otherwise let  $c^\prime$ be $c$.
@@ -5689,12 +5770,16 @@
 \label{beginFor}
 If this is the first iteration of the for loop, let $v^\prime$ be $v$. Otherwise,  let $v^\prime$ be the variable $v^{\prime\prime}$ created in the previous execution of step \ref{allocateFreshVar}.
 \item
-The expression $[v^\prime/v]c$ is evaluated and subjected to boolean conversion (\ref{booleans}). If the result is \FALSE{}, the for loop completes. Otherwise, execution continues at step
+The expression $[v^\prime/v]c$ is evaluated and subjected to boolean conversion (\ref{booleans}). If the result is \FALSE{}, the for loop completes normally. Otherwise, execution continues at step
 \ref{beginIteration}.
 \item
 \label{beginIteration}
 The statement $[v^\prime/v]\{s\}$ is executed.
-\item
+
+If this execution completes normally, continues without a label,
+or continues to a label (\ref{labels}) that prefixes this \FOR{} statement (\ref{completion}),
+then execution of the statement is treated as if it had completed normally.
+
 \label{allocateFreshVar}
 Let $v^{\prime\prime}$ be a fresh variable.  $v^{\prime\prime}$ is bound to the value of $v^\prime$.
 \item
@@ -5738,8 +5823,6 @@
 \end{dartCode}
 where \code{n0} is an identifier that does not occur anywhere in the program, except that for purposes of static typechecking, it is checked under the assumption that $n0$ is declared to be of type $T$, where $T$ is the static type of $e.iterator$.
 
-
-
 \subsubsection{Asynchronous For-in}
 \LMLabel{asynchronousFor-in}
 
@@ -5747,21 +5830,70 @@
 A for-in statement may be asynchronous. The asynchronous form is designed to iterate over streams. An asynchronous for loop is distinguished by the keyword \AWAIT{} immediately preceding the keyword \FOR.
 
 \LMHash{}
-Execution of a for-in statement of the form  \code{\AWAIT{} \FOR{} (finalConstVarOrType? id \IN{} $e$) $s$} proceeds as follows:
+Execution of a for-in statement, $f$, of the form \code{\AWAIT{} \FOR{} (finalConstVarOrType? $id$ \IN{} $e$) $s$} proceeds as follows:
 
 \LMHash{}
-The expression $e$ is evaluated to an object $o$. It is a dynamic error if $o$ is not an instance of a class that implements \code{Stream}. Otherwise, the expression \code{\AWAIT{} $v_f$}  (\ref{awaitExpressions}) is evaluated, where $v_f$ is a fresh variable whose value is a fresh instance (\ref{generativeConstructors}) $f$ implementing the built-in class \code{Future}.
+The expression $e$ is evaluated to an object $o$.
+It is a dynamic error if $o$ is not an instance of a class that implements \code{Stream}.
 
 \LMHash{}
-The stream $o$ is listened to,  and on each data event in $o$ the statement $s$ is executed with \code{id} bound to the value of the current element of the stream. If $s$ raises an exception, or if $o$ raises an exception, then $f$ is completed with that exception. Otherwise, when all events in the stream $o$ have been processed, $f$ is completed with \NULL{}  (\ref{null}).
-
-\LMHash{}
-Let $u$ be the stream associated with the immediately enclosing asynchronous for loop or generator function (\ref{functions}), if any. If another event $e_u$ of $u$ occurs before execution of $s$ is complete, handling of $e_u$ must wait until $s$ is complete.
-
-\rationale{
-The future $f$ and the corresponding \AWAIT{} expression ensure that execution suspends as an asynchronous for loop begins and resumes after the \FOR{} statement when it ends. They also ensure that the stream of any enclosing asynchronous \FOR{} loop is paused for the duration of this loop.
+The stream associated with the innermost enclosing asynchronous for loop, if any, is paused.
+The stream $o$ is listened to, producing a stream subscription $u$,
+and execution of the asynchronous for-in loop is suspended
+until a stream event is available.
+\commentary{
+This allows other asynchronous events to execute while this loop is waiting for stream events.
 }
 
+Pausing an asynchronous for loop means pausing the associated stream subscription.
+A stream subscription is paused by calling its \code{pause} method.
+If the subscription is already paused, an implementation may omit further calls to \code{pause}.
+
+\commentary{
+The \code{pause} call can throw, although that should never happen for a correctly implemented stream.
+}
+
+\LMHash{}
+For each {\em data event} from $u$,
+the statement $s$ is executed with $id$ bound to the value of the current data event.
+
+\LMHash{}
+\commentary{
+Either execution of $s$ is completely synchronous, or it contains an
+asynchronous construct (\AWAIT{}, \AWAIT{} \FOR{}, \YIELD{} or \YIELD*)
+which will pause the stream subscription of its surrounding asynchronous loop.
+This ensures that no other event of $u$ occurs before execution of $s$ is complete, if $o$ is a correctly implemented stream.
+If $o$ doesn't act as a valid stream, for example by not respecting pause requests, the behavior of the asynchronous loop may become unpredictable.
+}
+
+\LMHash{}
+If execution of $s$ continues without a label, or to a label (\ref{labels}) that prefixes the asynchronous for statement (\ref{completion}), then the execution of $s$ is treated as if it had completed normally.
+
+If execution of $s$ otherwise does not complete normally, the subscription $u$ is canceled by evaluating \code{\AWAIT{} $v$.cancel()} where $v$ is a fresh variable referencing the stream subscription $u$.
+If that evaluation throws,
+execution of $f$ throws the same exception and stack trace.
+Otherwise execution of $f$ completes in the same way as the execution of $s$.
+% Notice: The previous specification was unclear about what happened when
+% a subscripton is canceled. This text is explicit, and existing
+% implementations may not properly await the cancel call.
+Otherwise the execution of $f$ is suspended again, waiting for the next stream subscription event, and $u$ is resumed if it has been paused.
+\commentary{
+The \code{resume} call can throw, in which case the asynchronous for
+loop also throws. That should never happen for a correctly implemented stream.
+}
+
+\LMHash{}
+On an {\em error event} from $u$,
+with error object $e$ and stack trace $st$,
+the subscription $u$ is canceled by evaluating \code{\AWAIT{} v.cancel()}
+where $v$ is a fresh variable referencing the stream subscription $u$.
+If that evaluation throws,
+execution of $f$ throws the same exception object and stack trace.
+Otherwise execution of $f$ throws with $e$ as exception object and $st$ as stack trace.
+
+\LMHash{}
+When $u$ is done, execution of $f$ completes normally.
+
 \LMHash{}
 It is a compile-time error if an asynchronous for-in statement appears inside a synchronous function (\ref{functions}). It is a compile-time error if a traditional for loop  (\ref{forLoop}) is prefixed by the \AWAIT{}  keyword.
 
@@ -5781,10 +5913,23 @@
  \end{grammar}
 
 \LMHash{}
- Execution of a while statement of the form \code{\WHILE{} ($e$) $s$;} proceeds as follows:
+Execution of a while statement of the form \code{\WHILE{} ($e$) $s$;} proceeds as follows:
 
 \LMHash{}
-The expression $e$ is evaluated to an object $o$. Then, $o$ is  subjected to boolean conversion (\ref{booleanConversion}), producing an object $r$.  If $r$ is \TRUE{}, then the statement $\{s\}$ is executed and then the while statement is re-executed recursively. If $r$ is \FALSE{}, execution of the while statement is complete.
+The expression $e$ is evaluated to an object $o$. Then, $o$ is subjected to boolean conversion (\ref{booleanConversion}), producing an object $r$.
+
+\LMHash{}
+If $r$ is \FALSE{}, then execution of the while statement completes normally
+(\ref{completion}).
+
+\LMHash{}
+Otherwise $r$ is \TRUE{} and then the statement $\{s\}$ is executed.
+If that execution completes normally or it continues with no label or to a label (\ref{labels}) that prefixes the \WHILE{} statement (\ref{completion}), then the while statement is re-executed.
+If the execution breaks without a label, execution of the while statement completes normally.
+\commentary{
+If the execution breaks with a label that prefixes the \WHILE{} statement,
+it does end execution of the loop, but the break itself is handled by the surrounding labeled statement (\ref{labels}).
+}
 
 \LMHash{}
 It is a static type warning if the static type of $e$ may not be assigned to \code{bool}.
@@ -5807,7 +5952,13 @@
 Execution of a do statement of the form \code{\DO{} $s$ \WHILE{} ($e$);} proceeds as follows:
 
 \LMHash{}
-The statement $\{s\}$ is executed. Then, the expression $e$ is evaluated to an object $o$. Then, $o$ is  subjected to boolean conversion (\ref{booleanConversion}), producing an object $r$. If $r$ is \FALSE{}, execution of the do statement is complete. If $r$ is \TRUE{}, then the do statement is re-executed recursively.
+The statement $\{s\}$ is executed.
+If that execution continues with no label, or to a label (\ref{labels}) that prefixes the do statement (\ref{completion}), then the execution of $s$ is treated as if it had completed normally.
+
+\LMHash{}
+Then, the expression $e$ is evaluated to an object $o$. Then, $o$ is subjected to boolean conversion (\ref{booleanConversion}), producing an object $r$.
+If $r$ is \FALSE{}, execution of the do statement completes normally (\ref{completion}).
+If $r$ is \TRUE{}, then the do statement is re-executed.
 
 \LMHash{}
 It is a static type warning if the static type of $e$ may not be assigned to \code{bool}.
@@ -5818,7 +5969,7 @@
 \LMHash{}
 The {\em switch statement} supports dispatching control among a large number of cases.
 
- \begin{grammar}
+\begin{grammar}
 {\bf switchStatement:}
       \SWITCH{} `(' expression `)' `\{' switchCase* defaultCase? `\}'% could do top level here and in cases
     .
@@ -5902,18 +6053,15 @@
 proceeds as follows:
 
 \LMHash{}
-The statement \code{\VAR{} id = $e$;} is evaluated, where \code{id} is a variable whose name is distinct from any other variable in the program. In checked mode, it is a run time error if the value of $e$ is not an instance of the same class as the constants $e_1 \ldots e_n$.
+The statement \code{\VAR{} $id$ = $e$;} is evaluated, where $id$ is a fresh variable. In checked mode, it is a run time error if the value of $e$ is not an instance of the same class as the constants $e_1 \ldots e_n$.
 
 \commentary{Note that if there are no case clauses ($n = 0$), the type of $e$ does not matter.}
 
 \LMHash{}
-Next, the case clause \CASE{} $e_{1}: s_{1}$ is executed if it exists. If \CASE{} $e_{1}: s_{1}$ does not exist, then if there is a  \DEFAULT{} clause it is executed by executing $s_{n+1}$.
+Next, the case clause \CASE{} $e_{1}$: $s_{1}$ is matched against $id$, if $n > 0$. Otherwise if there is a \DEFAULT{} clause, the case statements $s_{n+1}$ are executed (\ref{case-execute}).
 
 \LMHash{}
-A case clause introduces a new scope, nested in the lexically surrounding scope. The scope of a case clause ends immediately after the case clause's statement list.
-
-\LMHash{}
-Execution of a \CASE{} clause \CASE{} $e_{k}: s_{k}$ of a  switch statement
+Matching of a \CASE{} clause \CASE{} $e_{k}: s_{k}$ of a switch statement
 
 \begin{dartCode}
 \SWITCH{} ($e$) \{
@@ -5924,16 +6072,15 @@
 \}
 \end{dartCode}
 
-proceeds as follows:
+against the value of a variable $id$ proceeds as follows:
 
 \LMHash{}
-The expression \code{$e_k$ == id} is evaluated to an object $o$ which is then subjected to boolean conversion yielding a value $v$.
-If $v$ is not  \TRUE{} the following case,  \CASE{} $e_{k+1}: s_{k+1}$ is executed if it exists. If  \CASE{} $e_{k+1}: s_{k+1}$ does not exist, then the \DEFAULT{} clause is executed by executing $s_{n+1}$.
-If $v$ is \TRUE{},   let $h$ be the smallest number such that $h \ge k$ and $s_h$ is non-empty. If no such $h$ exists, let $h = n + 1$. The  sequence of statements $s_h$ is then executed.
-If execution reaches the point after $s_h$  then  a runtime error occurs, unless $h = n+1$.
+The expression \code{$e_k$ == $id$} is evaluated to an object $o$ which is then subjected to boolean conversion evaluating to a value $v$.
+If $v$ is not \TRUE{} the following case, \CASE{} $e_{k+1}: s_{k+1}$ is matched against $id$ if $k < n$. If $k = n$, then the \DEFAULT{} clause's statements are executed (\ref{case-execute}).
+If $v$ is \TRUE{}, let $h$ be the smallest number such that $h \ge k$ and $s_h$ is non-empty. If no such $h$ exists, let $h = n + 1$. The case statements $s_h$ are then executed (\ref{case-execute}).
 
 \LMHash{}
-Execution of a \CASE{} clause \CASE{} $e_{k}: s_{k}$ of a  switch statement
+Matching of a \CASE{} clause \CASE{} $e_{k}: s_{k}$ of a switch statement
 
 \begin{dartCode}
 \SWITCH{} ($e$) \{
@@ -5943,21 +6090,20 @@
 \}
 \end{dartCode}
 
-proceeds as follows:
+against the value of a variable $id$ proceeds as follows:
 
 \LMHash{}
-The expression \code{$e_k$ == id} is evaluated to an object $o$ which is then subjected to boolean conversion yielding a value $v$.
-If $v$ is not  \TRUE{} the following case,  \CASE{} $e_{k+1}: s_{k+1}$ is executed if it exists.
-If $v$ is \TRUE{},   let $h$ be the smallest integer such that $h \ge k$ and $s_h$ is non-empty. The  sequence of statements $s_h$ is  executed if it exists.
-If execution reaches the point after $s_h$  then  a runtime error occurs, unless $h = n$.
+The expression \code{$e_k$ == $id$} is evaluated to an object $o$ which is then subjected to boolean conversion evaluating to a value $v$.
+If $v$ is not \TRUE{} the following case, \CASE{} $e_{k+1}: s_{k+1}$ is matched against $id$ if $k < n$.
+If $v$ is \TRUE{}, let $h$ be the smallest integer such that $h \ge k$ and $s_h$ is non-empty. If such a $h$ exists, the case statements $s_h$ are executed (\ref{case-execute}). Otherwise the switch statement completes normally (
+ref{completion}).
 
 
-\commentary{
-In other words, there is no implicit fall-through between non-empty cases. The last case in a switch (default or otherwise) can `fall-through' to the end of the statement.
-}
-
 \LMHash{}
-It is a static warning if the type of $e$ may not be assigned to the type of $e_k$. It is a static warning if the last statement of the statement sequence $s_k$ is not a \BREAK{}, \CONTINUE{}, \RETURN{} or \THROW{} statement.
+It is a static warning if the type of $e$ may not be assigned to the type of $e_k$.
+Let $s$ be the last statement of the statement sequence $s_k$.
+If $s$ is a non-empty block statement, let $s$ instead be the last statement of the block statement.
+It is a static warning $s$ is not a \BREAK{}, \CONTINUE{}, \RETHROW{} or \RETURN{} statement or an expression statement where the expression is a \THROW{} expression.
 
 \rationale{
 The behavior of switch cases intentionally differs from the C tradition.  Implicit fall through is a known cause of programming errors and therefore disallowed.  Why not simply break the flow implicitly at the end of every case, rather than requiring explicit code to do so?  This would indeed be cleaner.  It would also be cleaner to insist that each case have a single (possibly compound) statement.  We have chosen not to do so in order to facilitate porting of switch statements from other languages.  Implicitly breaking the control flow at the end of a case would silently alter the meaning of ported code that relied on fall-through, potentially forcing the programmer to deal with subtle bugs. Our design ensures that the difference is immediately brought to the coder's attention.  The programmer will be notified at compile-time if they forget to end a case with a statement that terminates the straight-line control flow. We could make this warning a compile-time error, but refrain from doing so because do not wish to force the programmer to deal with this issue immediately while porting code.  If developers ignore the warning and run their code, a run time error will prevent the program from misbehaving in hard-to-debug ways (at least with respect to this issue).
@@ -5987,13 +6133,63 @@
 In other words, a warning will be issued if a switch statement over an enum is not exhaustive.
 }
 
+\LMHash{}
+\subsubsection{Switch case statements}
+\LMLabel{case-execute}
+
+\LMHash{}
+Execution of the case statements $s_h$ of a switch statement
+
+\begin{dartCode}
+\SWITCH{} ($e$) \{
+   $label_{11} \ldots label_{1j_1}$ \CASE{} $e_1: s_1$
+   $\ldots$
+   $label_{n1} \ldots label_{nj_n}$ \CASE{} $e_n: s_n$
+\}
+\end{dartCode}
+
+or a switch statement
+
+\begin{dartCode}
+\SWITCH{} ($e$) \{
+   $label_{11} \ldots label_{1j_1}$ \CASE{} $e_1: s_1$
+   $\ldots$
+   $label_{n1} \ldots label_{nj_n}$ \CASE{} $e_n: s_n$
+   $label_{(n+1)1} \ldots label_{(n+1)j_{n+1}}$ \DEFAULT{}: $s_{n+1}$
+\}
+\end{dartCode}
+
+proceeds as follows:
+
+\LMHash{}
+Execute $\{s_h\}$.
+If this execution completes normally,
+and if $s_h$ is not the statements of the last case of the switch
+($h = n$ if there is no \DEFAULT{} clause,
+$h = n+1$ if there is a \DEFAULT{} clause),
+then the execution of the switch case throws an error.
+Otherwise $s_h$ are the last statements of the switch case,
+and execution of the switch case completes normally.
+
+\commentary{
+In other words, there is no implicit fall-through between non-empty cases. The last case in a switch (default or otherwise) can `fall-through' to the end of the statement.
+}
+
+If execution of $\{s_h\}$ breaks with no label (\ref{completion}), then the execution of the switch statement completes normally.
+
+If execution of $\{s_h\}$ continues to a label (\ref{completion}), and the label is $label_{ij}$, where $1 \le i \le n+1$ if the \SWITCH{} statement has a \DEFAULT{}, or $1 \le i \le n$ if there is no \DEFAULT{}, and where $1 \le j \le j_{i}$, then
+let $h$ be the smallest number such that $h \ge i$ and $s_h$ is non-empty. If no such $h$ exists, let $h = n + 1$ if the \SWITCH{} statement has a \DEFAULT{}, otherwise let $h = n$.
+The case statements $s_h$ are then executed (\ref{case-execute}).
+
+If execution of $\{s_h\}$ completes in any other way, execution of the \SWITCH{} statement completes in the same way.
+
 
 \subsection{ Rethrow}
 \LMLabel{rethrow}
 
 
 \LMHash{}
-The {\em rethrow statement}  is used to re-raise an exception.
+The {\em rethrow statement}  is used to re-throw an exception and its associated stack trace.
 
  \begin{grammar}
 {\bf rethrowStatement:}
@@ -6012,25 +6208,12 @@
 }
 
 \LMHash{}
-The current exception (\ref{throw}) is set to $p_1$, the current return value (\ref{return}) becomes undefined, and the active stack trace (\ref{try}) is set to $p_2$.
-
-\LMHash{}
-If $f$ is marked \ASYNC{} or \ASYNC* (\ref{functions}) and there is a dynamically enclosing exception handler (\ref{try}) $h$ introduced by the current activation, control is transferred to $h$, otherwise $f$  terminates.
-
-\rationale{
-In the case of an asynchronous function, the dynamically enclosing exception handler is only relevant within the function. If an exception is not caught within the function, the exception value is channelled through a future or stream rather than propagating via exception handlers.
-}
-
-\LMHash{}
-Otherwise, control is transferred to the  innermost enclosing exception handler.
-
-\commentary{The change in control may result in multiple functions terminating if these functions do not catch the exception via a \CATCH{} or \FINALLY{} clause, both of which introduce a dynamically enclosing exception handler.}
+The \RETHROW{} statement {\em throws} (\ref{completion}) with $p_1$ as the exception object and $p_2$ as the stack trace.
 
 \LMHash{}
 It is a compile-time error if a  \code{\RETHROW{}} statement is not enclosed within an \ON-\CATCH{} clause.
 
 
-
 \subsection{ Try}
 \LMLabel{try}
 
@@ -6056,10 +6239,10 @@
  \end{grammar}
 
 \LMHash{}
- A try statement consists of a block statement, followed by at least one of:
- \begin{enumerate}
- \item
-A set of \ON{}-\CATCH{} clauses, each of which specifies  (either explicitly or implicitly) the type of exception object to be handled, one or two exception parameters and a block statement.
+A try statement consists of a block statement, followed by at least one of:
+\begin{enumerate}
+\item
+A set of \ON{}-\CATCH{} clauses, each of which specifies (either explicitly or implicitly) the type of exception object to be handled, one or two exception parameters, and a block statement.
 \item
 A \FINALLY{} clause, which consists of a block statement.
 \end{enumerate}
@@ -6069,122 +6252,84 @@
 }
 
 \LMHash{}
-An \ON{}-\CATCH{} clause of the form   \code{\ON{} $T$ \CATCH{} ($p_1, p_2$) $s$}  {\em matches} an object $o$  if the type of $o$ is a subtype of $T$.  If $T$ is a malformed or deferred type  (\ref{staticTypes}), then performing a match causes a run time error.
-
-\commentary {
-It is of course a static warning if $T$ is a deferred or malformed type.
-}
-
-\LMHash{}
-An \ON{}-\CATCH{} clause of the form   \code{\ON{} $T$ \CATCH{} ($p_1, p_2$) $s$} introduces a new scope $CS$ in which final local variables specified by $p_1$ and $p_2$ are defined. The statement $s$ is enclosed within $CS$. The static type of $p_1$ is $T$ and the static type of $p_2$ is \code{StackTrace}.
-
-
-\LMHash{}
-An \ON{}-\CATCH{} clause of the form  \code{\ON{} $T$ \CATCH{} ($p_1$) $s$} is equivalent to an \ON{}-\CATCH{} clause  \code{\ON{} $T$ \CATCH{} ($p_1, p_2$) $s$} where $p_2$ is an identifier that does not occur anywhere else in the program.
-
-
-\LMHash{}
-An \ON{}-\CATCH{} clause of the form  \code{\CATCH{} ($p$) $s$} is equivalent to an \ON{}-\CATCH{} clause  \code{\ON{} \DYNAMIC{} \CATCH{} ($p$) $s$}. An \ON{}-\CATCH{} clause of the form  \code{\CATCH{} ($p_1, p_2$) $s$} is equivalent to an \ON{}-\CATCH{} clause  \code{\ON{} \DYNAMIC{} \CATCH{} ($p_1, p_2$) $s$}.
-
-
-%If an explicit type is associated with of $p_2$, it is a static warning if that type is not \code{Object} or \DYNAMIC{}.
-
-\LMHash{}
-The {\em active stack trace} is an object whose \code{toString()} method produces a string that is a record of exactly those function activations within the current isolate that had not completed execution at the point where the current exception (\ref{throw}) was thrown.
-%\begin{enumerate}
-%\item Started execution after the currently executing function.
-%\item Had not completed execution at the point where the exception caught by the currently executing  \ON{}-\CATCH{} clause was initially thrown.
-%\commentary{The active stack trace contains the frames between the exception handling code and the original point when an exception is thrown, not where it was rethrown.}
-%\end{enumerate}
-
- \commentary{
-This implies that no synthetic function activations may be added to the trace, nor may any source level activations be omitted.
-This means, for example, that any inlining of functions done as an optimization must not be visible in the trace. Similarly, any synthetic routines used by the implementation must not appear in the trace.
-
-Nothing is said about how any native function calls may be represented in the trace.
- }
-
-\commentary{
-Note that we say nothing about the identity of the stack trace, or what notion of equality is defined for stack traces.
-}
-
-% Sadly, the info below cannot be computed efficiently. It would need to be computed at the throw point, since at latte points it might be destroyed. Native code in calling frames executes relative to the stack pointer, which therefore needs to be reset as each frame is unwound.  This means that the
-% OS kernel can dispose of this stack memory - it is not reliably preserved. And such code must execute if only to test if the exception should be caught or sent onward.
-
-% For each such function activation, the active stack trace includes the name of the function, the bindings of all its formal parameters, local variables and \THIS{}, and the position at which the function was executing.
-
- % Is this controversial? We were thinking of viewing the trace as a List<Invocation>,
- % but that won't capture the receiver or the locals. More generally, we need a standard interface that describes these traces, so one can type the stack trace variable in the catch.
-
- \commentary{The term position should not be interpreted as a line number, but rather as a precise position - the exact character index of the  expression that raised  the exception. }
-
- % A position can be represented via a Token. If we make that part of the core reflection facility, we can state this here.
-
-\LMHash{}
-A try statement \TRY{} $s_1$ $on-catch_1 \ldots  on-catch_n$ \FINALLY{} $s_f$  defines an exception handler $h$ that executes as follows:
-
-\LMHash{}
-The \ON{}-\CATCH{} clauses are examined in order, starting with $catch_1$, until either an \ON{}-\CATCH{} clause that matches the current exception (\ref{throw}) is found, or the list of \ON{}-\CATCH{} clauses has been exhausted. If an \ON{}-\CATCH{} clause $on-catch_k$ is found, then $p_{k1}$ is bound to the current exception,  $p_{k2}$, if declared,  is bound to the active stack trace, and then $catch_k$ is executed. If no \ON{}-\CATCH{} clause is found, the \FINALLY{} clause is executed. Then, execution resumes at the end of the try statement.
-
-
-\LMHash{}
-A finally clause \FINALLY{} $s$ defines an exception handler $h$ that executes as follows:
-
-\LMHash{}
-Let $r$ be the current return value (\ref{return}). Then the current return value becomes undefined. Any open streams associated with any asynchronous for loops (\ref{asynchronousFor-in}) and yield-each (\ref{yieldEach}) statements executing within the dynamic scope of $h$ are canceled, in the order of their nesting, innermost first.
-
-\rationale{
-Streams left open by for loops that were escaped for whatever reason would be canceled at function termination, but it is best to cancel them as soon as possible.
-}
-
-\LMHash{}
-Then the \FINALLY{} clause is executed. Let $m$ be the immediately enclosing function. If $r$ is defined then the current return value is set to $r$ and then:
-\begin{itemize}
-\item
- if there is a dynamically enclosing error handler $g$ defined by a \FINALLY{} clause in $m$, control is transferred to $g$.
- \item
-Otherwise $m$ terminates.
-\end{itemize}
-
-Otherwise, execution resumes at the end of the try statement.
-
-\LMHash{}
-Execution of an \ON{}-\CATCH{} clause \code{\ON{} $T$ \CATCH{} ($p_1$, $p_2$)} $s$ of a try statement $t$ proceeds as follows: The statement $s$ is executed in the dynamic scope of the exception handler defined by the finally clause of $t$. Then, the current exception and active stack trace both become undefined.
-
-\LMHash{}
-Execution of a \FINALLY{} clause \FINALLY{} $s$ of a try statement proceeds as follows:
-
-\LMHash{}
-Let $x$ be the current exception and let $t$ be the active stack trace. Then the current exception and the active stack trace both become undefined. The statement $s$ is executed. Then, if $x$ is defined,  it is rethrown as if by a rethrow statement (\ref{rethrow}) enclosed in a \CATCH{} clause of the form \code{\CATCH{} ($v_x$, $v_t$)} where $v_x$ and $v_t$ are fresh variables bound to $x$ and $t$ respectively.
-
-
-\LMHash{}
-Execution of a try statement of the form \code{\TRY{} $s_1$ $on-catch_1 \ldots on-catch_n$ \FINALLY{} $s_f$;}  proceeds as follows:
-
-\LMHash{}
-The statement $s_1$ is executed in the dynamic scope of the exception handler defined by the try statement. Then, the \FINALLY{} clause is executed.
-
-\commentary{
-Whether any of the \ON{}-\CATCH{} clauses is executed depends on whether a matching exception has been raised by $s_1$ (see the specification of the throw statement).
-
-If $s_1$ has raised an exception, it will transfer control to the try statement's handler, which will examine the catch clauses in order for a match as specified above. If no matches are found, the handler will execute the \FINALLY{} clause.
-
-If a matching \ON{}-\CATCH{} was found, it will execute first, and then the \FINALLY{} clause will be executed.
-
-If an exception is thrown during execution of an \ON{}-\CATCH{} clause, this will transfer control to the handler for the \FINALLY{} clause, causing the \FINALLY{} clause to execute in this case as well.
-
-If no exception was raised, the \FINALLY{} clause is also executed. Execution of the \FINALLY{} clause could also raise an exception, which will cause transfer of control to the next enclosing handler.
-}
-
-\LMHash{}
 A try statement of the form \code{\TRY{} $s_1$ $on-catch_1 \ldots on-catch_n$;} is equivalent to the statement \code{\TRY{} $s_1$ $on-catch_1 \ldots on-catch_n$ \FINALLY{} $\{\}$}.
 
+\LMHash{}
+An \ON{}-\CATCH{} clause of the form  \code{\ON{} $T$ \CATCH{} ($p_1$) $s$} is equivalent to an \ON{}-\CATCH{} clause  \code{\ON{} $T$ \CATCH{} ($p_1$, $p_2$) $s$} where $p_2$ is a fresh identifier.
+
+\LMHash{}
+An \ON{}-\CATCH{} clause of the form  \code{\ON{} $T$ $s$} is equivalent to an \ON{}-\CATCH{} clause  \code{\ON{} $T$ \CATCH{} ($p_1$, $p_2$) $s$} where $p_1$ and $p_2$ are fresh identifiers.
+
+\LMHash{}
+An \ON{}-\CATCH{} clause of the form  \code{\CATCH{} ($p$) $s$} is equivalent to an \ON{}-\CATCH{} clause \code{\ON{} \DYNAMIC{} \CATCH{} ($p$, $p_2$) $s$} where $p_2$ is a fresh identifier.
+
+An \ON{}-\CATCH{} clause of the form \code{\CATCH{} ($p_1$, $p_2$) $s$} is equivalent to an \ON{}-\CATCH{} clause \code{\ON{} \DYNAMIC{} \CATCH{} ($p_1$, $p_2$) $s$}.
+
+\LMHash{}
+An \ON{}-\CATCH{} clause of the form   \code{\ON{} $T$ \CATCH{} ($p_1$, $p_2$) $s$} introduces a new scope $CS$ in which final local variables specified by $p_1$ and $p_2$ are defined. The statement $s$ is enclosed within $CS$. The static type of $p_1$ is $T$ and the static type of $p_2$ is \code{StackTrace}.
+
+\LMHash{}
+Execution of a \TRY{} statement $s$ on the form:
+\begin{dartCode}
+\TRY{} $b$
+\ON{} $T_1$ \CATCH{} ($e_1$, $t_1$) $c_1$
+\ldots{}
+\ON{} $T_n$ \CATCH{} ($e_n$, $t_n$) $c_n$
+\FINALLY{} $f$
+\end{dartCode}
+proceeds as follows:
+
+\LMHash{}
+First $b$ is executed.
+If execution of $b$ throws (\ref{completion}) with exception object $e$ and stack trace $t$, then $e$ and $t$ are matched against the \ON{}-\CATCH{} clauses to yield a new completion (\ref{on-catch}).
+
+Then, even if execution of $b$ did not complete normally or matching against the \ON{}-\CATCH{} clauses did not complete normally, the $f$ block is executed.
+
+If execution of $f$ does not complete normally,
+execution of the \TRY{} statement completes in the same way.
+Otherwise if execution of $b$ threw (\ref{completion}), the \TRY{} statement completes in the same way as the matching against the \ON{}-\CATCH{} clauses.
+Otherwise the \TRY{} statement completes in the same way as the execution of $b$.
+
+\LMHash{}
+If $T_1$ is a malformed or deferred type (\ref{staticTypes}), then performing a match causes a run time error.
+It is a static warning if $T_i$, $1 \le i \le n$ is a deferred or malformed type.
+
+\subsubsection{\ON{}-\CATCH{} clauses}
+\LMLabel{on-catch}
+
+\LMHash{}
+Matching an exception object $e$ and stack trace $t$ against a (potentially empty) sequence of \ON{}-\CATCH{} clauses on the form
+\begin{dartCode}
+\ON{} $T_1$ \CATCH{} ($e_1$, $st_1$) \{ $s_1$ \}
+\ldots
+\ON{} $T_n$ \CATCH{} ($e_n$, $st_n$) \{ $s_n$ \}
+\end{dartCode}
+proceeds as follows:
+
+\LMHash{}
+If there are no \ON{}-\CATCH{} clauses ($n = 0$), matching throws the exception object $e$ and stack trace $t$ (\ref{completion}).
+
+\LMHash{}
+Otherwise the exception is matched against the first clause.
+
+\LMHash{}
+Otherwise, if the type of $e$ is a subtype of $T_1$, then the first clause matches, and then $e_1$ is bound to the exception object $e$ and $t_1$ is bound to the stack trace $t$, and $s_1$ is executed in this scope.
+The matching completes in the same way as this execution.
+
+\LMHash{}
+Otherwise, if the first clause did not match $e$, $e$ and $t$ are recursively matched against the remaining \ON{}-\CATCH{} clauses:
+\begin{dartCode}
+\ON{} $T_2$ \CATCH{} ($e_2$, $t_2$) \{ $s_2$ \}
+\ldots
+\ON{} $T_n$ \CATCH{} ($e_n$, $t_n$) \{ $s_n$ \}
+\end{dartCode}
+
 
 \subsection{ Return}
 \LMLabel{return}
 
 \LMHash{}
-The {\em return statement} returns a result to the caller of a synchronous function,  completes the future associated with an asynchronous function or terminates the stream or iterable associated with a generator (\ref{functions}).
+The {\em return statement} returns a result to the caller of a synchronous function, completes the future associated with an asynchronous function or terminates the stream or iterable associated with a generator (\ref{functions}).
 
 
  \begin{grammar}
@@ -6193,42 +6338,23 @@
     .
  \end{grammar}
 
- \commentary{
- Due to \FINALLY{} clauses, the precise behavior of \RETURN{} is a little more involved. Whether the value a return statement is supposed to return is actually returned depends on the behavior of any \FINALLY{} clauses in effect when executing the return. A \FINALLY{} clause may choose to return another value, or throw an exception, or even redirect control flow leading to other returns or throws. All a return statement really does is set a value that is intended to be returned when the function terminates.
- }
-
-\LMHash{}
-The {\em current return value} is a unique value specific to a given function activation. It is undefined unless explicitly set in this specification.
-
 \LMHash{}
 Executing a return statement \code{\RETURN{} $e$;} proceeds as follows:
 
 \LMHash{}
-First the expression $e$ is evaluated, producing an object $o$. Next:
-\begin{itemize}
-\item
-The current return value is set to $o$ and the current exception (\ref{throw}) and active stack trace (\ref{try}) become undefined.
-\item
-Let $c$ be the \FINALLY{} clause of the innermost enclosing try-finally statement (\ref{try}), if any. If $c$ is defined, let $h$ be the handler induced by $c$. If $h$ is defined, control is transferred to $h$.
-\item
-Otherwise execution of the current method terminates.
-\end{itemize}
-
-\commentary{
-In the simplest case, the immediately enclosing function is an ordinary, synchronous non-generator, and upon function termination, the current return value is given to the caller.  The other possibility is that the function is marked \ASYNC{}, in which case the current return value is used to complete the future associated with the function invocation. Both these scenarios are specified in section \ref{functionInvocation}.
-The enclosing function cannot be marked as generator (i.e, \ASYNC* or \SYNC*), since generators are not allowed to contain a statement of the form \code{\RETURN{} $e$;} as discussed below.
-}
+First the expression $e$ is evaluated, producing an object $o$.
+Then the return statement returns the value $o$ (\ref{completion}).
 
 \LMHash{}
 Let $T$ be the static type of $e$ and let $f$ be the immediately enclosing function.
 
 \LMHash{}
-It is a static type warning if the body of $f$ is marked \ASYNC{} and the type \code{Future$<$flatten(T)$>$} (\ref{functionExpressions}) may not be assigned to the declared return type of $f$.    Otherwise, it is a static type warning if $T$ may not be assigned to the declared return type of $f$.
+It is a static type warning if the body of $f$ is marked \ASYNC{} and the type \code{Future<flatten(T)>} (\ref{functionExpressions}) may not be assigned to the declared return type of $f$.    Otherwise, it is a static type warning if $T$ may not be assigned to the declared return type of $f$.
 
 \LMHash{}
 Let $S$ be the runtime type of $o$. In checked mode:
 \begin{itemize}
-\item  If the body of $f$ is marked \ASYNC{} (\ref{functions}) it is a dynamic type error if $o$ is not \NULL{} (\ref{null}) and \code{Future$<$flatten(S)$>$} is not a subtype of the actual return type  (\ref{actualTypeOfADeclaration}) of $f$.
+\item  If the body of $f$ is marked \ASYNC{} (\ref{functions}) it is a dynamic type error if $o$ is not \NULL{} (\ref{null}) and \code{Future<flatten(S)>} is not a subtype of the actual return type  (\ref{actualTypeOfADeclaration}) of $f$.
 \item Otherwise, it is a dynamic type error if $o$ is not \NULL{} and the runtime type of $o$ is not a subtype of the actual return type of $f$.
 \end{itemize}
 
@@ -6250,51 +6376,24 @@
 Let $f$ be the function immediately enclosing a return statement of the form \RETURN{}; It is a static warning  $f$ is neither a generator nor a generative constructor and either:
 \begin{itemize}
 \item  $f$ is synchronous and the return type of $f$ may not be assigned to \VOID{} (\ref{typeVoid}) or,
-\item  $f$ is asynchronous and the return type of $f$ may not be assigned to \code{Future$<$Null$>$}.
+\item  $f$ is asynchronous and the return type of $f$ may not be assigned to \code{Future<Null>}.
 \end{itemize}
 
  \commentary{
-Hence, a static warning will not be issued if $f$ has no declared return type, since the return type would be  \DYNAMIC{} and  \DYNAMIC{} may be assigned to \VOID{} and to \code{Future$<$Null$>$}. However, any synchronous non-generator function that declares a return type must return an expression explicitly.
+Hence, a static warning will not be issued if $f$ has no declared return type, since the return type would be  \DYNAMIC{} and  \DYNAMIC{} may be assigned to \VOID{} and to \code{Future<Null>}. However, any synchronous non-generator function that declares a return type must return an expression explicitly.
 }
 \rationale{This helps catch situations where users forget to return a value in a return statement.}
 
-\rationale{ An asynchronous non-generator always returns a future of some sort. If no expression is given, the future will be completed with \NULL{} and this motivates the requirement above.} \commentary{Leaving the return type of a function marked \ASYNC{}  blank will be interpreted as \DYNAMIC{} as always, and cause no type error. Using \code{Future} or \code{Future$<$Object$>$} is acceptable as well, but any other type will cause a warning, since \NULL{} has no subtypes.}
+\rationale{ An asynchronous non-generator always returns a future of some sort. If no expression is given, the future will be completed with \NULL{} and this motivates the requirement above.} \commentary{Leaving the return type of a function marked \ASYNC{}  blank will be interpreted as \DYNAMIC{} as always, and cause no type error. Using \code{Future} or \code{Future<Object>} is acceptable as well, but any other type will cause a warning, since \NULL{} has no subtypes.}
 
 \LMHash{}
-A return statement with no expression, \code{\RETURN;} is executed as follows:
+Executing a return statement with no expression, \code{\RETURN;} returns with no value (\ref{completion}).
 
-\LMHash{}
-If the immediately enclosing function $f$ is a generator, then:
-\begin{itemize}
-\item
-The current return value is set to \NULL{}.
-\item
-Let $c$ be the \FINALLY{} clause of the innermost enclosing try-finally statement, if any. If $c$ is defined,  let $h$ be the handler induced by $c$. If $h$ is defined, control is transferred to $h$.
-\item
-Otherwise, execution of the current method terminates.
-\end{itemize}
-
-\LMHash{}
-Otherwise the return statement is executed by executing the statement  \code{\RETURN{} \NULL{};} if it occurs inside a method, getter, setter or factory; otherwise, the return statement necessarily occurs inside a generative constructor, in which case it is executed by executing  \code{\RETURN{} \THIS{};}.
-
-\commentary{Despite the fact that \code{\RETURN{};} is executed as if by a \code{\RETURN{} $e$;}, it is important to understand that it is not a static warning to include a statement of the form \code{\RETURN{};}
-%in a \VOID{} function; neither is it illegal
-in a generative constructor. The rules relate only to the specific syntactic form \code{\RETURN{} $e$;}.
-}
-
-
-\rationale{
-The motivation for formulating \code{\RETURN{};} in this way stems from the basic requirement that all function invocations indeed return a value. Function invocations are expressions, and we cannot rely on a mandatory typechecker to always prohibit use of \VOID{} functions in expressions. Hence, a return statement must always return a value, even if no expression is specified.
-
-The question then becomes, what value should a return statement return when no return expression is given. In a generative constructor, it is obviously the object being constructed (\THIS{}). A void function is not expected to participate in an expression, which is why it is marked \VOID{} in the first place. Hence, this situation is a mistake which should be detected as soon as possible. The static rules help here, but if the code is executed, using \NULL{} leads to fast failure, which is desirable in this case. The same rationale applies for function bodies that do not contain a return statement at all.
-}
 
 \LMHash{}
 It is a static warning if a  function contains both one or more explicit return statements of the form \code{\RETURN;} and one or more return statements of the form \code{\RETURN{} $e$;}.
 
 
-
-
 \subsection{ Labels}
 \LMLabel{labels}
 
@@ -6312,7 +6411,13 @@
  \end{grammar}
 
 \LMHash{}
- The semantics of a labeled statement $L: s$ are identical to those of the statement $s$. The namespace of labels is distinct from the one used for types, functions and variables.
+Execution a labeled statement $s$, $label: s_l$, consists of executing $s_l$.
+If execution of $s_l$ breaks to the label $label$ (\ref{completion}),
+then execution of $s$ completes normally,
+otherwise execution of $s$ completes in the same ways as the execution of $s_l$.
+
+\LMHash{}
+The namespace of labels is distinct from the one used for types, functions and variables.
 
 \LMHash{}
 The scope of a label that labels a statement $s$ is $s$. The scope of a label that labels a case clause of a switch statement $s$ is $s$.
@@ -6334,11 +6439,12 @@
  \end{grammar}
 
 \LMHash{}
-Let $s_b$ be a \BREAK{} statement. If $s_b$ is of the form  \code{\BREAK{} $L$;}, then let $s_E$ be the innermost labeled statement with label $L$ enclosing $s_b$. If $s_b$ is of the form \code{\BREAK{};},  then let $s_E$ be the innermost  \DO{} (\ref{do}), \FOR{} (\ref{for}), \SWITCH{} (\ref{switch}) or \WHILE{} (\ref{while}) statement enclosing  $s_b$. It is a compile-time error if no such statement $s_E$ exists within the innermost function in which  $s_b$ occurs.  Furthermore, let $s_1, \ldots, s_n$ be those \TRY{} statements that are both enclosed in $s_E$ and that enclose  $s_b$, and that have a \FINALLY{} clause. Lastly, let $f_j$ be the \FINALLY{} clause of $s_j, 1 \le j \le n$.   Executing  $s_b$ first executes $f_1, \ldots,  f_n$ in innermost-clause-first  order and then terminates $s_E$.
+Let $s_b$ be a \BREAK{} statement. If $s_b$ is of the form  \code{\BREAK{} $L$;}, then let $s_E$ be the innermost labeled statement with label $L$ enclosing $s_b$. If $s_b$ is of the form \code{\BREAK{};},  then let $s_E$ be the innermost  \DO{} (\ref{do}), \FOR{} (\ref{for}), \SWITCH{} (\ref{switch}) or \WHILE{} (\ref{while}) statement enclosing  $s_b$. It is a compile-time error if no such statement $s_E$ exists within the innermost function in which  $s_b$ occurs.
 
 \LMHash{}
-If $s_E$ is an asynchronous for loop (\ref{asynchronousFor-in}), its associated stream subscription is canceled. Furthermore, let $a_k$ be the set of asynchronous for loops  and yield-each statements (\ref{yieldEach}) enclosing $s_b$ that are enclosed in $s_E , 1 \le k \le m$, where $a_k$ is enclosed in $a_{k+1}$.   The stream subscriptions associated with $a_j$ are canceled, $1 \le j \le m$, innermost first, so that $a_j$ is canceled before $a_{j+1}$.
+Execution of a \BREAK{} statement \code{\BREAK{} $L$;} breaks to the label $L$ (\ref{completion}).
 
+Execution of a \BREAK{} statement \code{\BREAK{};} breaks without a label (\ref{completion}).
 
 
 \subsection{ Continue}
@@ -6354,25 +6460,23 @@
  \end{grammar}
 
 \LMHash{}
- Let $s_c$ be a \CONTINUE{} statement. If $s_c$ is of the form  \code{\CONTINUE{} $L$;}, then let $s_E$ be the innermost labeled \DO{} (\ref{do}), \FOR{} (\ref{for}) or \WHILE{} (\ref{while}) statement or case clause with label $L$ enclosing $s_c$. If $s_c$ is of the form \code{\CONTINUE{};}  then let $s_E$ be the innermost  \DO{} (\ref{do}), \FOR{} (\ref{for}) or \WHILE{} (\ref{while}) statement enclosing  $s_c$. It is a compile-time error if no such statement or case clause $s_E$ exists within the innermost function in which  $s_c$ occurs.  Furthermore, let $s_1, \ldots, s_n$ be those \TRY{} statements that are both enclosed in $s_E$ and that enclose  $s_c$, and that have a \FINALLY{} clause. Lastly, let $f_j$ be the \FINALLY{} clause of $s_j, 1 \le j \le n$.   Executing  $s_c$ first executes $f_1, \ldots,  f_n$ in innermost-clause-first  order. Then, if $s_E$ is a case clause, control is transferred to the case clause. Otherwise, $s_E$ is necessarily a loop and execution resumes after the last statement in the loop body.
+Let $s_c$ be a \CONTINUE{} statement. If $s_c$ is of the form  \code{\CONTINUE{} $L$;}, then let $s_E$ be the innermost labeled \DO{} (\ref{do}), \FOR{} (\ref{for}) or \WHILE{} (\ref{while}) statement or case clause with label $L$ enclosing $s_c$. If $s_c$ is of the form \code{\CONTINUE{};}  then let $s_E$ be the innermost  \DO{} (\ref{do}), \FOR{} (\ref{for}) or \WHILE{} (\ref{while}) statement enclosing  $s_c$. It is a compile-time error if no such statement or case clause $s_E$ exists within the innermost function in which  $s_c$ occurs.
 
- \commentary{
- In a while loop, that would be the boolean expression before the body. In a do loop, it would be the boolean expression after the body. In a for loop, it would be the increment clause.  In other words, execution continues to the next iteration of the loop.
- }
+Execution of a \CONTINUE{} statement \code{\CONTINUE{} $L$;} continues to the label $L$ (\ref{completion}).
+
+Execution of a \CONTINUE{} statement \code{\CONTINUE{};} continues without a label (\ref{completion}).
+
+
+\subsection{ Yield and Yield-Each}
+\LMLabel{yieldAndYieldEach}
+
+\subsubsection{ Yield}
+\LMLabel{yield}
 
 \LMHash{}
- If $s_E$ is an asynchronous for loop (\ref{asynchronousFor-in}), let $a_k$ be the set of asynchronous for loops and yield-each statements (\ref{yieldEach}) enclosing $s_c$ that are enclosed in $s_E , 1 \le k \le m$, where $a_k$ is enclosed in $a_{k+1}$.   The stream subscriptions associated with $a_j$ are canceled, $1 \le j \le m$, innermost first, so that $a_j$ is canceled before $a_{j+1}$.
+The {\em yield statement} adds an element to the result of a generator function (\ref{functions}).
 
- \subsection{ Yield and Yield-Each}
- \LMLabel{yieldAndYieldEach}
-
- \subsubsection{ Yield}
- \LMLabel{yield}
-
-\LMHash{}
- The {\em yield statement} adds an element to the result of a generator function (\ref{functions}).
-
- \begin{grammar}
+\begin{grammar}
 {\bf yieldStatement:}
    \YIELD{} expression `{\escapegrammar ;}'
       .
@@ -6382,20 +6486,20 @@
 Execution of a statement $s$ of the form \code{\YIELD{} $e$;}  proceeds as follows:
 
 \LMHash{}
-First, the expression $e$ is evaluated to an object $o$. If the enclosing function $m$ is marked \ASYNC* (\ref{functions}) and the stream $u$ associated with $m$ has been paused,  then execution of $m$ is suspended until $u$ is resumed or canceled.
+First, the expression $e$ is evaluated to an object $o$. If the enclosing function $m$ is marked \ASYNC* (\ref{functions}) and the stream $u$ associated with $m$ has been paused, then the nearest enclosing asynchronous for loop (\ref{asynchronousFor-in}), if any, is paused and execution of $m$ is suspended until $u$ is resumed or canceled.
 
 \LMHash{}
 Next, $o$ is added to the iterable or stream associated with the immediately enclosing function.
 
 \LMHash{}
-If the enclosing function $m$ is marked \ASYNC* and the stream $u$ associated with $m$ has been canceled, then let $c$ be the \FINALLY{} clause (\ref{try}) of the innermost enclosing try-finally statement, if any. If $c$ is defined, let $h$ be the handler induced by $c$. If $h$ is defined, control is transferred to $h$. If $h$ is undefined, the immediately enclosing function terminates.
+If the enclosing function $m$ is marked \ASYNC* and the stream $u$ associated with $m$ has been canceled, then the \YIELD{} statement returns without a value (\ref{completion}), otherwise it completes normally.
 
 \rationale{
 The stream associated with an asynchronous generator could be canceled by any code with a reference to that stream at any point where the generator was passivated.  Such a cancellation constitutes an irretrievable error for the generator. At this point, the only plausible action for the generator is to clean up after itself via its \FINALLY{} clauses.
 }
 
 \LMHash{}
-Otherwise, if the enclosing function $m$ is marked \ASYNC* (\ref{functions}) then the enclosing function may suspend.
+Otherwise, if the enclosing function $m$ is marked \ASYNC* (\ref{functions}) then the enclosing function may suspend, in which case the nearest enclosing asynchronous for loop (\ref{asynchronousFor-in}), if any, is paused first.
 
 \rationale {
 If a \YIELD{} occurred inside an infinite loop and the enclosing function never suspended, there might not be an opportunity for consumers of the  enclosing stream to run and access the data in the stream.  The stream might then accumulate an unbounded number of elements. Such a situation is untenable. Therefore, we allow the enclosing function to be suspended when a new value is added to its associated stream. However, it is not essential (and in fact, can be quite costly) to suspend the function on every \YIELD{}. The implementation is free to decide how often to suspend the enclosing function. The only requirement is that consumers are not blocked indefinitely.
@@ -6418,9 +6522,9 @@
 Let $T$ be the static type of $e$ and let $f$ be the immediately enclosing function.  It is a static type warning if either:
 \begin{itemize}
 \item
- the body of $f$ is marked \ASYNC* and the type \code{Stream$<$T$>$} may not be assigned to the declared return type of $f$.
+ the body of $f$ is marked \ASYNC* and the type \code{Stream<T>} may not be assigned to the declared return type of $f$.
  \item
- the body of $f$ is marked \SYNC* and the type \code{Iterable$<$T$>$} may not be assigned to the declared return type of $f$.
+ the body of $f$ is marked \SYNC* and the type \code{Iterable<T>} may not be assigned to the declared return type of $f$.
  \end{itemize}
 
 
@@ -6448,7 +6552,7 @@
 \item It is a dynamic error if the class of $o$ does not implement \code{Iterable}.  Otherwise
 \item The method \cd{iterator} is invoked upon $o$ returning an object $i$.
 \item \label{moveNext} The \cd{moveNext} method of $i$ is invoked on it with no arguments. If \cd{moveNext} returns \FALSE{} execution of $s$ is complete. Otherwise
-\item The getter \cd{current} is invoked on $i$. If the invocation raises an exception $ex$, execution of $s$ throws $ex$. Otherwise, the result $x$ of the getter invocation is added to the iterable associated with $m$.
+\item The getter \cd{current} is invoked on $i$. If the invocation throws (\ref{evaluation}), execution of $s$ throws the same exception object and stack trace (\ref{completion}). Otherwise, the result $x$ of the getter invocation is added to the iterable associated with $m$.
 Execution of the function $m$ immediately enclosing $s$ is suspended until the nullary method \code{moveNext()} is invoked upon the iterator used to initiate the current invocation of $m$, at which point execution of $s$ continues at \ref{moveNext}.
 \item
 The current call to \code{moveNext()} returns \TRUE.
@@ -6458,16 +6562,19 @@
 If $m$ is marked \ASYNC* (\ref{functions}), then:
 \begin{itemize}
 \item  It is a dynamic error if the class of $o$ does not implement \code{Stream}. Otherwise
-\item For each element $x$ of $o$:
+\item The nearest enclosing asynchronous for loop (\ref{asynchronousFor-in}), if any, is paused.
+\item The $o$ stream is listened to, creating a subscription $s$, and for each event $x$, or error $e$ with stack trace $t$, of $s$:
 \begin{itemize}
 \item
-If the stream $u$ associated with $m$ has been paused,  then execution of $m$ is suspended until $u$ is resumed or canceled.
- \item
-If the stream $u$ associated with $m$ has been canceled, then let $c$ be the \FINALLY{} clause (\ref{try}) of the innermost enclosing try-finally statement, if any. If $c$ is defined,  let $h$ be the handler induced by $c$. If $h$ is defined, control is transferred to $h$. If $h$ is undefined, the immediately enclosing function terminates.
+If the stream $u$ associated with $m$ has been paused, then execution of $m$ is suspended until $u$ is resumed or canceled.
 \item
-Otherwise,  $x$ is added to the stream associated with $m$ in the order it appears in $o$.  The function $m$ may suspend.
+If the stream $u$ associated with $m$ has been canceled,
+then $s$ is canceled by evaluating \code{\AWAIT{} v.cancel()} where $v$ is a fresh variable referencing the stream subscription $s$.
+Then, if the cancel completed normally, the stream execution of $s$ returns without a value (\ref{completion}).
+\item
+Otherwise, $x$, or $e$ with $t$, are added to the stream associated with $m$ in the order they appear in $o$.  The function $m$ may suspend.
 \end{itemize}
-\item If the stream $o$ is done, execution of $s$ is complete.
+\item If the stream $o$ is done, execution of $s$ completes normally.
 \end{itemize}
 
 
@@ -6486,19 +6593,24 @@
 
 \begin{grammar}
 {\bf assertStatement:}
-   assert `(' expression `)' `{\escapegrammar ;}'
+   assert `(' expression ( `,` expression )? `)' `{\escapegrammar ;}'
       .
 \end{grammar}
 
 \LMHash{}
-The assert statement has no effect in production mode. In checked mode, execution of an assert statement \code{\ASSERT{}($e$);} proceeds as follows:
+An assert statement on the form \code{\ASSERT($e$);)} is equivalent to a statment on the form \code{\ASSERT($e$, null);}.
 
 \LMHash{}
-The expression $e$ is evaluated to an object $o$. If the class of $o$ is a subtype of \code{Function} then let $r$ be the result of invoking $o$ with no arguments. Otherwise, let $r$ be $o$.
-It is a dynamic type error if $o$ is not of type \code{bool} or of type \code{Function}, or if $r$ is not of type \code{bool}.  If $r$ is \FALSE{}, we say that the assertion failed. If $r$ is \TRUE{}, we say that the assertion succeeded. If the assertion succeeded, execution of the assert statement is complete. If the assertion failed, an \code{AssertionError} is thrown.
+The assert statement has no effect in production mode. In checked mode, execution of an assert statement \code{\ASSERT{}($c$, $e$);} proceeds as follows:
 
-%\Q{Might be cleaner to define it as \code{if (!$e$) \{\THROW{} \NEW{} AssertionError();\}} (in checked mode only).
-%What about an error message as part of the assert?}
+\LMHash{}
+The expression $c$ is evaluated to an object $o$. If the class of $o$ is a subtype of \code{Function} then let $r$ be the result of invoking $o$ with no arguments. Otherwise, let $r$ be $o$.
+It is a dynamic type error if $o$ is not of type \code{bool} or of type \code{Function}, or if $r$ is not of type \code{bool}.
+If $r$ is \FALSE{}, we say that the assertion failed.
+If $r$ is \TRUE{}, we say that the assertion succeeded.
+If the assertion succeeded, execution of the assert statement completes normally (\ref{completion}).
+If the assertion failed, $e$ is evaluated to an object $m$.
+Then the execution of the assert statement throws (\ref{completion}) an \code{AssertionError} containing $m$ and with a stack trace corresponding to the current execution state at the \ASSERT{} statement.
 
 \LMHash{}
  It is a static type warning if the type of $e$ may not be assigned to either  \code{bool} or $() \rightarrow$ \code{bool}.
@@ -6662,7 +6774,7 @@
 The {\em current library} is the library currently being compiled. The import modifies the  namespace of the current library in a manner that is determined by the imported library and by the optional elements of  the import.
 
 \LMHash{}
-An immediate import directive $I$ may optionally include a prefix clause of the form \AS{} \code{Id} used to prefix names imported by $I$. A deferred import must include a prefix clause or a compile time error occurs. It is a compile-time error if a prefix used in a deferred import is used in another import clause.
+An immediate import directive $I$ may optionally include a prefix clause of the form \code{\AS{} $id$} used to prefix names imported by $I$. A deferred import must include a prefix clause or a compile time error occurs. It is a compile-time error if a prefix used in a deferred import is used in another import clause.
 
 \LMHash{}
 An import directive $I$ may optionally include a namespace combinator clauses used to restrict the set of names imported by $I$. Currently, two namespace combinators are supported: \HIDE{} and \SHOW{}.
@@ -6941,6 +7053,9 @@
 \LMHash{}
 Compiling a part directive of the form \code{\PART{} $s$;} causes the Dart system to attempt to compile the contents of the URI that is the value of $s$. The top-level declarations at that URI are then compiled by the Dart compiler in the scope of the current library. It is a compile-time error if the contents of the URI are not a valid part declaration. It is a static warning if the referenced part declaration $p$ names a library other than the current library as the library to which $p$ belongs.
 
+\LMHash{}
+It's a compile-time error if the same library contains two part directives with the same URI.
+
 \subsection{Scripts}
 \LMLabel{scripts}
 
@@ -6950,9 +7065,9 @@
 A script $S$ may be executed as follows:
 
 \LMHash{}
-First, $S$ is compiled as a library as specified above. Then, the top-level function \code{main} that is in the exported namespace of $S$ is invoked. If \code{main} has no positional parameters, it is invoked with no arguments. Otherwise if \code{main} has exactly one positional parameter, it is invoked with a single actual argument whose runtime type implements \code{List$<$String$>$}.  Otherwise \code{main} is invoked with the following two actual arguments:
+First, $S$ is compiled as a library as specified above. Then, the top-level function \code{main} that is in the exported namespace of $S$ is invoked. If \code{main} has no positional parameters, it is invoked with no arguments. Otherwise if \code{main} has exactly one positional parameter, it is invoked with a single actual argument whose runtime type implements \code{List<String>}.  Otherwise \code{main} is invoked with the following two actual arguments:
 \begin{enumerate}
-\item An object whose runtime type implements \code{List$<$String$>$}.
+\item An object whose runtime type implements \code{List<String>}.
 \item The initial message of the current isolate $i$ as determined by the invocation of \code{Isolate.spawnUri} that spawned $i$.
 \end{enumerate}
 
@@ -7126,7 +7241,7 @@
 
 \begin{dartCode}
 \TYPEDEF{} F(bool x);
-f(foo x) $=>$ x;
+f(foo x) => x;
 main() \{
   if (f is F) \{
     print("yoyoma");
@@ -7158,10 +7273,10 @@
 }
 
 \begin{dartCode}
-\CLASS{} I$<$T \EXTENDS{} num$>$ \{\}
+\CLASS{} I<T \EXTENDS{} num> \{\}
 \CLASS{} J \{\}
 
-\CLASS{} A$<$T$>$ \IMPLEMENTS{} J,  I$<$T$>$ // type warning: T is not a subtype of num
+\CLASS{} A<T> \IMPLEMENTS{} J,  I<T> // type warning: T is not a subtype of num
 \{ ...
 \}
 \end{dartCode}
@@ -7169,24 +7284,24 @@
 \commentary{Given the declarations above, the following}
 
 \begin{dartCode}
-I x = \NEW{} A$<$String$>$();
+I x = \NEW{} A<String>();
 \end{dartCode}
 
 \commentary{
-will cause a dynamic type error in checked mode, because the assignment requires a subtype test A$<$String$>$ $<$: I. To show that this holds, we need to show that A$<$String$>$  $<<$ I$<$String$>$, but I$<$String$>$ is a malbounded type, causing the dynamic error.  No error is thrown in production mode. Note that
+will cause a dynamic type error in checked mode, because the assignment requires a subtype test A<String> <: I. To show that this holds, we need to show that A<String>  $<<$ I<String>, but I<String> is a malbounded type, causing the dynamic error.  No error is thrown in production mode. Note that
 }
 
 \begin{dartCode}
-J x = \NEW{} A$<$String$>$();
+J x = \NEW{} A<String>();
 \end{dartCode}
 
 \commentary{
-does not cause a dynamic error, as there is no need to test against \code{I$<$String$>$} in this case.
+does not cause a dynamic error, as there is no need to test against \code{I<String>} in this case.
 Similarly, in production mode
 }
 
 \begin{dartCode}
-A x = \NEW{} A$<$String$>$();
+A x = \NEW{} A<String>();
 bool b = x is I;
 \end{dartCode}
 
@@ -7711,7 +7826,7 @@
 \hline
 Bitwise Or &  $|$ & Left & 9\\
 \hline
-Relational & $<$, $>$, $<=$, $>=$, \AS{}, \IS{}, \IS{}! &  None & 8\\
+Relational & <, >, $<=$, $>=$, \AS{}, \IS{}, \IS{}! &  None & 8\\
 \hline
 Equality &  ==, != & None & 7\\
 \hline
diff --git a/pkg/BUILD.gn b/pkg/BUILD.gn
new file mode 100644
index 0000000..e1ce11d
--- /dev/null
+++ b/pkg/BUILD.gn
@@ -0,0 +1,65 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for 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("../utils/create_timestamp.gni")
+
+template("make_third_party_pkg_files_stamp") {
+  assert(defined(invoker.id), "Must define the stamp file id")
+  path = rebase_path("../third_party/pkg")
+  if (defined(invoker.path)) {
+    path = invoker.path
+  }
+  id = invoker.id
+  create_timestamp_file(target_name) {
+    if (defined(invoker.pattern)) {
+      pattern = invoker.pattern
+    }
+    path = path
+    new_base = "//"
+    output = "$target_gen_dir/third_party_pkg_files_$id.stamp"
+  }
+}
+
+make_third_party_pkg_files_stamp("make_third_party_pkg_files_0_stamp") {
+  path = rebase_path(".")
+  id = "0"
+}
+
+make_third_party_pkg_files_stamp("make_third_party_pkg_files_1_stamp") {
+  pattern = "[a-k].*"
+  id = "1"
+}
+
+make_third_party_pkg_files_stamp("make_third_party_pkg_files_2_stamp") {
+  pattern = "[l-r].*"
+  id = "2"
+}
+
+make_third_party_pkg_files_stamp("make_third_party_pkg_files_3_stamp") {
+  pattern = "[s-z].*"
+  id = "3"
+}
+
+action("pkg_files_stamp") {
+  deps = [
+    ":make_third_party_pkg_files_0_stamp",
+    ":make_third_party_pkg_files_1_stamp",
+    ":make_third_party_pkg_files_2_stamp",
+    ":make_third_party_pkg_files_3_stamp",
+  ]
+
+  stamp0_outputs = get_target_outputs(":make_third_party_pkg_files_0_stamp")
+  stamp1_outputs = get_target_outputs(":make_third_party_pkg_files_1_stamp")
+  stamp2_outputs = get_target_outputs(":make_third_party_pkg_files_2_stamp")
+  stamp3_outputs = get_target_outputs(":make_third_party_pkg_files_3_stamp")
+
+  inputs = stamp0_outputs + stamp1_outputs + stamp2_outputs + stamp3_outputs
+
+  outputs = [
+    "$root_gen_dir/pkg_files.stamp",
+  ]
+
+  script = "../tools/create_timestamp_file.py"
+  args = [ rebase_path("$root_gen_dir/pkg_files.stamp") ]
+}
diff --git a/pkg/analysis_server/.gitignore b/pkg/analysis_server/.gitignore
new file mode 100644
index 0000000..16a1724
--- /dev/null
+++ b/pkg/analysis_server/.gitignore
@@ -0,0 +1 @@
+.packages
diff --git a/pkg/analysis_server/BUILD.gn b/pkg/analysis_server/BUILD.gn
new file mode 100644
index 0000000..9e65d54
--- /dev/null
+++ b/pkg/analysis_server/BUILD.gn
@@ -0,0 +1,25 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for 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("//build/dart/dart_package.gni")
+
+dart_package("analysis_server") {
+  package_name = "analysis_server"
+
+  source_dir = "lib"
+
+  deps = [
+    "//dart/pkg/analyzer",
+    "//third_party/dart-pkg/pub/args",
+    "//third_party/dart-pkg/pub/dart_style",
+    "//third_party/dart-pkg/pub/isolate",
+    "//third_party/dart-pkg/pub/linter",
+    "//third_party/dart-pkg/pub/logging",
+    "//third_party/dart-pkg/pub/package_config",
+    "//third_party/dart-pkg/pub/path",
+    "//third_party/dart-pkg/pub/plugin",
+    "//third_party/dart-pkg/pub/watcher",
+    "//third_party/dart-pkg/pub/yaml",
+  ]
+}
diff --git a/pkg/analysis_server/benchmark/perf/analysis_timing_tests.dart b/pkg/analysis_server/benchmark/perf/analysis_timing_tests.dart
index 731bec5..a0d4116 100644
--- a/pkg/analysis_server/benchmark/perf/analysis_timing_tests.dart
+++ b/pkg/analysis_server/benchmark/perf/analysis_timing_tests.dart
@@ -9,9 +9,8 @@
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:args/args.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
-import '../../test/utils.dart';
 import 'performance_tests.dart';
 
 /**
@@ -21,7 +20,6 @@
  * `analysis`.
  */
 main(List<String> arguments) {
-  initializeTestEnvironment();
   ArgParser parser = _createArgParser();
   var args = parser.parse(arguments);
   if (args[SOURCE_OPTION] == null) {
@@ -34,7 +32,6 @@
   for (var name in names) {
     metricNames.add(name as String);
   }
-  unittestConfiguration.timeout = new Duration(minutes: 20);
 
   var test;
 
diff --git a/pkg/analysis_server/benchmark/perf/benchmark_scenario.dart b/pkg/analysis_server/benchmark/perf/benchmark_scenario.dart
index 3ec4c4c..134ed3a 100644
--- a/pkg/analysis_server/benchmark/perf/benchmark_scenario.dart
+++ b/pkg/analysis_server/benchmark/perf/benchmark_scenario.dart
@@ -9,8 +9,9 @@
 import 'dart:math';
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
+import '../../test/integration/integration_tests.dart';
 import 'performance_tests.dart';
 
 void printBenchmarkResults(String id, String description, List<int> times) {
@@ -46,10 +47,10 @@
       String file,
       FileChange fileChange,
       int numOfRepeats}) async {
-    expect(roots, isNotNull, reason: 'roots');
-    expect(file, isNotNull, reason: 'file');
-    expect(fileChange, isNotNull, reason: 'fileChange');
-    expect(numOfRepeats, isNotNull, reason: 'numOfRepeats');
+    outOfTestExpect(roots, isNotNull, reason: 'roots');
+    outOfTestExpect(file, isNotNull, reason: 'file');
+    outOfTestExpect(fileChange, isNotNull, reason: 'fileChange');
+    outOfTestExpect(numOfRepeats, isNotNull, reason: 'numOfRepeats');
     // Initialize Analysis Server.
     await super.setUp();
     await subscribeToStatusNotifications();
@@ -95,11 +96,11 @@
       FileChange fileChange,
       String completeAfterStr,
       int numOfRepeats}) async {
-    expect(roots, isNotNull, reason: 'roots');
-    expect(file, isNotNull, reason: 'file');
-    expect(fileChange, isNotNull, reason: 'fileChange');
-    expect(completeAfterStr, isNotNull, reason: 'completeAfterStr');
-    expect(numOfRepeats, isNotNull, reason: 'numOfRepeats');
+    outOfTestExpect(roots, isNotNull, reason: 'roots');
+    outOfTestExpect(file, isNotNull, reason: 'file');
+    outOfTestExpect(fileChange, isNotNull, reason: 'fileChange');
+    outOfTestExpect(completeAfterStr, isNotNull, reason: 'completeAfterStr');
+    outOfTestExpect(numOfRepeats, isNotNull, reason: 'numOfRepeats');
     // Initialize Analysis Server.
     await super.setUp();
     await subscribeToStatusNotifications();
@@ -149,13 +150,14 @@
       RefactoringKind refactoringKind,
       RefactoringOptions refactoringOptions,
       int numOfRepeats}) async {
-    expect(roots, isNotNull, reason: 'roots');
-    expect(file, isNotNull, reason: 'file');
-    expect(fileChange, isNotNull, reason: 'fileChange');
-    expect(refactoringAtStr, isNotNull, reason: 'refactoringAtStr');
-    expect(refactoringKind, isNotNull, reason: 'refactoringKind');
-    expect(refactoringOptions, isNotNull, reason: 'refactoringOptions');
-    expect(numOfRepeats, isNotNull, reason: 'numOfRepeats');
+    outOfTestExpect(roots, isNotNull, reason: 'roots');
+    outOfTestExpect(file, isNotNull, reason: 'file');
+    outOfTestExpect(fileChange, isNotNull, reason: 'fileChange');
+    outOfTestExpect(refactoringAtStr, isNotNull, reason: 'refactoringAtStr');
+    outOfTestExpect(refactoringKind, isNotNull, reason: 'refactoringKind');
+    outOfTestExpect(refactoringOptions, isNotNull,
+        reason: 'refactoringOptions');
+    outOfTestExpect(numOfRepeats, isNotNull, reason: 'numOfRepeats');
     // Initialize Analysis Server.
     await super.setUp();
     await subscribeToStatusNotifications();
@@ -243,8 +245,8 @@
    */
   static Future<List<int>> start_waitInitialAnalysis_shutdown(
       {List<String> roots, int numOfRepeats}) async {
-    expect(roots, isNotNull, reason: 'roots');
-    expect(numOfRepeats, isNotNull, reason: 'numOfRepeats');
+    outOfTestExpect(roots, isNotNull, reason: 'roots');
+    outOfTestExpect(numOfRepeats, isNotNull, reason: 'numOfRepeats');
     // Repeat.
     List<int> times = <int>[];
     for (int i = 0; i < numOfRepeats; i++) {
@@ -265,7 +267,8 @@
 
   static String _getFileContent(String path) {
     File file = new File(path);
-    expect(file.existsSync(), isTrue, reason: 'File $path does not exist.');
+    outOfTestExpect(file.existsSync(), isTrue,
+        reason: 'File $path does not exist.');
     return file.readAsStringSync();
   }
 
@@ -274,7 +277,7 @@
    */
   static int _indexOf(String file, String where, String what) {
     int index = where.indexOf(what);
-    expect(index, isNot(-1), reason: 'Cannot find |$what| in $file.');
+    outOfTestExpect(index, isNot(-1), reason: 'Cannot find |$what| in $file.');
     return index;
   }
 
@@ -293,11 +296,16 @@
   final String replaceWhat;
   final String replaceWith;
 
-  FileChange({this.afterStr, this.afterStrBack: 0, this.insertStr, this.replaceWhat, this.replaceWith}) {
+  FileChange(
+      {this.afterStr,
+      this.afterStrBack: 0,
+      this.insertStr,
+      this.replaceWhat,
+      this.replaceWith}) {
     if (afterStr != null) {
-      expect(insertStr, isNotNull, reason: 'insertStr');
+      outOfTestExpect(insertStr, isNotNull, reason: 'insertStr');
     } else if (replaceWhat != null) {
-      expect(replaceWith, isNotNull, reason: 'replaceWith');
+      outOfTestExpect(replaceWith, isNotNull, reason: 'replaceWith');
     }
   }
 }
diff --git a/pkg/analysis_server/benchmark/perf/completion_timing_tests.dart b/pkg/analysis_server/benchmark/perf/completion_timing_tests.dart
index 7b9829a..d841521 100644
--- a/pkg/analysis_server/benchmark/perf/completion_timing_tests.dart
+++ b/pkg/analysis_server/benchmark/perf/completion_timing_tests.dart
@@ -8,9 +8,8 @@
 import 'dart:io';
 
 import 'package:args/args.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
-import '../../test/utils.dart';
 import 'performance_tests.dart';
 
 /**
@@ -19,7 +18,6 @@
  * with a `--offset`.
  */
 main(List<String> arguments) {
-  initializeTestEnvironment();
   ArgParser parser = _createArgParser();
   var args = parser.parse(arguments);
   if (args[SOURCE_OPTION] == null) {
diff --git a/pkg/analysis_server/benchmark/perf/memory_tests.dart b/pkg/analysis_server/benchmark/perf/memory_tests.dart
index a648344..4fb9b6c 100644
--- a/pkg/analysis_server/benchmark/perf/memory_tests.dart
+++ b/pkg/analysis_server/benchmark/perf/memory_tests.dart
@@ -8,7 +8,7 @@
 import 'dart:math';
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import '../../test/integration/integration_tests.dart';
 
@@ -65,7 +65,7 @@
     });
     Completer serverConnected = new Completer();
     onServerConnected.listen((_) {
-      expect(serverConnected.isCompleted, isFalse);
+      outOfTestExpect(serverConnected.isCompleted, isFalse);
       serverConnected.complete();
     });
     return startServer(servicesPort: vmServicePort).then((_) {
@@ -109,8 +109,8 @@
    */
   static Future<List<int>> start_waitInitialAnalysis_shutdown(
       {List<String> roots, int numOfRepeats}) async {
-    expect(roots, isNotNull, reason: 'roots');
-    expect(numOfRepeats, isNotNull, reason: 'numOfRepeats');
+    outOfTestExpect(roots, isNotNull, reason: 'roots');
+    outOfTestExpect(numOfRepeats, isNotNull, reason: 'numOfRepeats');
     // Repeat.
     List<int> sizes = <int>[];
     for (int i = 0; i < numOfRepeats; i++) {
diff --git a/pkg/analysis_server/benchmark/perf/performance_tests.dart b/pkg/analysis_server/benchmark/perf/performance_tests.dart
index d6be917..742171e 100644
--- a/pkg/analysis_server/benchmark/perf/performance_tests.dart
+++ b/pkg/analysis_server/benchmark/perf/performance_tests.dart
@@ -8,7 +8,7 @@
 import 'dart:io';
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import '../../test/integration/integration_tests.dart';
 
@@ -43,7 +43,7 @@
     });
     Completer serverConnected = new Completer();
     onServerConnected.listen((_) {
-      expect(serverConnected.isCompleted, isFalse);
+      outOfTestExpect(serverConnected.isCompleted, isFalse);
       serverConnected.complete();
     });
     return startServer(checked: false).then((_) {
diff --git a/pkg/analysis_server/doc/api.html b/pkg/analysis_server/doc/api.html
index 9228c47..0f5bcc7 100644
--- a/pkg/analysis_server/doc/api.html
+++ b/pkg/analysis_server/doc/api.html
@@ -95,9 +95,6 @@
 
 /* Styles for index */
 
-.subindex {
-}
-
 .subindex ul {
   padding-left: 0;
   margin-left: 0;
@@ -233,11 +230,12 @@
     <ul>
       <li><a href="#domain_server">Server</a></li>
       <li><a href="#domain_analysis">Analysis</a></li>
-      <li><a href="#domain_completion">Code Completion</a></li>
+      <li><a href="#domain_completion">Completion</a></li>
       <li><a href="#domain_search">Search</a></li>
       <li><a href="#domain_edit">Edit</a></li>
       <li><a href="#domain_execution">Execution</a></li>
-    </ul>
+      <li><a href="#domain_diagnostic">Diagnostic</a></li>
+</ul>
     <p>
       The specifications of the API’s refer to data structures beyond
       the standard JSON primitives. These data structures are
@@ -253,6 +251,34 @@
     <h4>Options</h4>
     <blockquote>
     <dl>
+      <dt>--client-id</dt>
+      <dd>
+      <p>
+      Specifies an identifier associated with the client. Used when
+      generating error reports.
+      </p>
+      <p>
+      Clients are strongly encouraged to provide this information in
+      order to improve the quality of information that can be provided
+      to them.
+      </p>
+      </dd>
+    </dl>
+    <dl>
+      <dt>--client-version</dt>
+      <dd>
+      <p>
+      Specifies the version of the client that is communicating with
+      the server. Used when generating error reports.
+      </p>
+      <p>
+        Clients are strongly encouraged to provide this information in
+        order to improve the quality of information that can be provided
+        to them.
+      </p>
+      </dd>
+    </dl>
+    <dl>
       <dt>--no-error-notification</dt>
       <dd>
       Disable notifications about errors (see analysis.error). If this
@@ -261,22 +287,6 @@
       </dd>
     </dl>
     <dl>
-      <dt>--file-read-mode</dt>
-      <dd>
-      An enumeration of the ways files can be read from disk. Some clients
-      normalize end of line characters which would make the file offset and
-      range information incorrect. The default option is <tt>as-is</tt>, but
-      can also be set to <tt>normalize-eol-always</tt>. The default option
-      (<tt>as-is</tt>) reads files as they are on disk. The
-      <tt>normalize-eol-always</tt> option does the following:
-      <ul>
-        <li>'\r\n' is converted to '\n';</li>
-        <li>'\r' by itself is converted to '\n';</li>
-        <li>this happens regardless of the OS editor is running on.</li>
-      </ul>
-      </dd>
-    </dl>
-    <dl>
       <dt>--no-index</dt>
       <dd>
       Disable the server from generating an index. If this flag is passed and an
@@ -286,6 +296,23 @@
       
       </dd>
     </dl>
+    <dl>
+      <dt>--file-read-mode</dt>
+      <dd>
+        <p><b>Deprecated</b></p>
+        An enumeration of the ways files can be read from disk. Some clients
+        normalize end of line characters which would make the file offset and
+        range information incorrect. The default option is <tt>as-is</tt>, but
+        can also be set to <tt>normalize-eol-always</tt>. The default option
+        (<tt>as-is</tt>) reads files as they are on disk. The
+        <tt>normalize-eol-always</tt> option does the following:
+        <ul>
+          <li>'\r\n' is converted to '\n';</li>
+          <li>'\r' by itself is converted to '\n';</li>
+          <li>this happens regardless of the OS editor is running on.</li>
+        </ul>
+      </dd>
+    </dl>
     </blockquote>
     <h2 class="domain"><a name="domain_server">server domain</a></h2>
       <p>
diff --git a/pkg/analysis_server/lib/plugin/protocol/generated_protocol.dart b/pkg/analysis_server/lib/plugin/protocol/generated_protocol.dart
index f3c2d98..2f69d0a 100644
--- a/pkg/analysis_server/lib/plugin/protocol/generated_protocol.dart
+++ b/pkg/analysis_server/lib/plugin/protocol/generated_protocol.dart
@@ -8195,11 +8195,11 @@
  * Clients may not extend, implement or mix-in this class.
  */
 class AnalysisErrorSeverity implements Enum {
-  static const INFO = const AnalysisErrorSeverity._("INFO");
+  static const AnalysisErrorSeverity INFO = const AnalysisErrorSeverity._("INFO");
 
-  static const WARNING = const AnalysisErrorSeverity._("WARNING");
+  static const AnalysisErrorSeverity WARNING = const AnalysisErrorSeverity._("WARNING");
 
-  static const ERROR = const AnalysisErrorSeverity._("ERROR");
+  static const AnalysisErrorSeverity ERROR = const AnalysisErrorSeverity._("ERROR");
 
   /**
    * A list containing all of the enum values that are defined.
@@ -8256,21 +8256,21 @@
  * Clients may not extend, implement or mix-in this class.
  */
 class AnalysisErrorType implements Enum {
-  static const CHECKED_MODE_COMPILE_TIME_ERROR = const AnalysisErrorType._("CHECKED_MODE_COMPILE_TIME_ERROR");
+  static const AnalysisErrorType CHECKED_MODE_COMPILE_TIME_ERROR = const AnalysisErrorType._("CHECKED_MODE_COMPILE_TIME_ERROR");
 
-  static const COMPILE_TIME_ERROR = const AnalysisErrorType._("COMPILE_TIME_ERROR");
+  static const AnalysisErrorType COMPILE_TIME_ERROR = const AnalysisErrorType._("COMPILE_TIME_ERROR");
 
-  static const HINT = const AnalysisErrorType._("HINT");
+  static const AnalysisErrorType HINT = const AnalysisErrorType._("HINT");
 
-  static const LINT = const AnalysisErrorType._("LINT");
+  static const AnalysisErrorType LINT = const AnalysisErrorType._("LINT");
 
-  static const STATIC_TYPE_WARNING = const AnalysisErrorType._("STATIC_TYPE_WARNING");
+  static const AnalysisErrorType STATIC_TYPE_WARNING = const AnalysisErrorType._("STATIC_TYPE_WARNING");
 
-  static const STATIC_WARNING = const AnalysisErrorType._("STATIC_WARNING");
+  static const AnalysisErrorType STATIC_WARNING = const AnalysisErrorType._("STATIC_WARNING");
 
-  static const SYNTACTIC_ERROR = const AnalysisErrorType._("SYNTACTIC_ERROR");
+  static const AnalysisErrorType SYNTACTIC_ERROR = const AnalysisErrorType._("SYNTACTIC_ERROR");
 
-  static const TODO = const AnalysisErrorType._("TODO");
+  static const AnalysisErrorType TODO = const AnalysisErrorType._("TODO");
 
   /**
    * A list containing all of the enum values that are defined.
@@ -8610,25 +8610,25 @@
  * Clients may not extend, implement or mix-in this class.
  */
 class AnalysisService implements Enum {
-  static const FOLDING = const AnalysisService._("FOLDING");
+  static const AnalysisService FOLDING = const AnalysisService._("FOLDING");
 
-  static const HIGHLIGHTS = const AnalysisService._("HIGHLIGHTS");
+  static const AnalysisService HIGHLIGHTS = const AnalysisService._("HIGHLIGHTS");
 
-  static const IMPLEMENTED = const AnalysisService._("IMPLEMENTED");
+  static const AnalysisService IMPLEMENTED = const AnalysisService._("IMPLEMENTED");
 
   /**
    * This service is not currently implemented and will become a
    * GeneralAnalysisService in a future release.
    */
-  static const INVALIDATE = const AnalysisService._("INVALIDATE");
+  static const AnalysisService INVALIDATE = const AnalysisService._("INVALIDATE");
 
-  static const NAVIGATION = const AnalysisService._("NAVIGATION");
+  static const AnalysisService NAVIGATION = const AnalysisService._("NAVIGATION");
 
-  static const OCCURRENCES = const AnalysisService._("OCCURRENCES");
+  static const AnalysisService OCCURRENCES = const AnalysisService._("OCCURRENCES");
 
-  static const OUTLINE = const AnalysisService._("OUTLINE");
+  static const AnalysisService OUTLINE = const AnalysisService._("OUTLINE");
 
-  static const OVERRIDES = const AnalysisService._("OVERRIDES");
+  static const AnalysisService OVERRIDES = const AnalysisService._("OVERRIDES");
 
   /**
    * A list containing all of the enum values that are defined.
@@ -9445,9 +9445,9 @@
    * the invocation and the parameterNames, parameterTypes, and
    * requiredParameterCount attributes are defined.
    */
-  static const ARGUMENT_LIST = const CompletionSuggestionKind._("ARGUMENT_LIST");
+  static const CompletionSuggestionKind ARGUMENT_LIST = const CompletionSuggestionKind._("ARGUMENT_LIST");
 
-  static const IMPORT = const CompletionSuggestionKind._("IMPORT");
+  static const CompletionSuggestionKind IMPORT = const CompletionSuggestionKind._("IMPORT");
 
   /**
    * The element identifier should be inserted at the completion location. For
@@ -9455,7 +9455,7 @@
    * suggestions of this kind, the element attribute is defined and the
    * completion field is the element's identifier.
    */
-  static const IDENTIFIER = const CompletionSuggestionKind._("IDENTIFIER");
+  static const CompletionSuggestionKind IDENTIFIER = const CompletionSuggestionKind._("IDENTIFIER");
 
   /**
    * The element is being invoked at the completion location. For example,
@@ -9463,24 +9463,24 @@
    * element attribute is defined and the completion field is the element's
    * identifier.
    */
-  static const INVOCATION = const CompletionSuggestionKind._("INVOCATION");
+  static const CompletionSuggestionKind INVOCATION = const CompletionSuggestionKind._("INVOCATION");
 
   /**
    * A keyword is being suggested. For suggestions of this kind, the completion
    * is the keyword.
    */
-  static const KEYWORD = const CompletionSuggestionKind._("KEYWORD");
+  static const CompletionSuggestionKind KEYWORD = const CompletionSuggestionKind._("KEYWORD");
 
   /**
    * A named argument for the current callsite is being suggested. For
    * suggestions of this kind, the completion is the named argument identifier
    * including a trailing ':' and space.
    */
-  static const NAMED_ARGUMENT = const CompletionSuggestionKind._("NAMED_ARGUMENT");
+  static const CompletionSuggestionKind NAMED_ARGUMENT = const CompletionSuggestionKind._("NAMED_ARGUMENT");
 
-  static const OPTIONAL_ARGUMENT = const CompletionSuggestionKind._("OPTIONAL_ARGUMENT");
+  static const CompletionSuggestionKind OPTIONAL_ARGUMENT = const CompletionSuggestionKind._("OPTIONAL_ARGUMENT");
 
-  static const PARAMETER = const CompletionSuggestionKind._("PARAMETER");
+  static const CompletionSuggestionKind PARAMETER = const CompletionSuggestionKind._("PARAMETER");
 
   /**
    * A list containing all of the enum values that are defined.
@@ -10015,57 +10015,57 @@
  * Clients may not extend, implement or mix-in this class.
  */
 class ElementKind implements Enum {
-  static const CLASS = const ElementKind._("CLASS");
+  static const ElementKind CLASS = const ElementKind._("CLASS");
 
-  static const CLASS_TYPE_ALIAS = const ElementKind._("CLASS_TYPE_ALIAS");
+  static const ElementKind CLASS_TYPE_ALIAS = const ElementKind._("CLASS_TYPE_ALIAS");
 
-  static const COMPILATION_UNIT = const ElementKind._("COMPILATION_UNIT");
+  static const ElementKind COMPILATION_UNIT = const ElementKind._("COMPILATION_UNIT");
 
-  static const CONSTRUCTOR = const ElementKind._("CONSTRUCTOR");
+  static const ElementKind CONSTRUCTOR = const ElementKind._("CONSTRUCTOR");
 
-  static const ENUM = const ElementKind._("ENUM");
+  static const ElementKind ENUM = const ElementKind._("ENUM");
 
-  static const ENUM_CONSTANT = const ElementKind._("ENUM_CONSTANT");
+  static const ElementKind ENUM_CONSTANT = const ElementKind._("ENUM_CONSTANT");
 
-  static const FIELD = const ElementKind._("FIELD");
+  static const ElementKind FIELD = const ElementKind._("FIELD");
 
-  static const FILE = const ElementKind._("FILE");
+  static const ElementKind FILE = const ElementKind._("FILE");
 
-  static const FUNCTION = const ElementKind._("FUNCTION");
+  static const ElementKind FUNCTION = const ElementKind._("FUNCTION");
 
-  static const FUNCTION_TYPE_ALIAS = const ElementKind._("FUNCTION_TYPE_ALIAS");
+  static const ElementKind FUNCTION_TYPE_ALIAS = const ElementKind._("FUNCTION_TYPE_ALIAS");
 
-  static const GETTER = const ElementKind._("GETTER");
+  static const ElementKind GETTER = const ElementKind._("GETTER");
 
-  static const LABEL = const ElementKind._("LABEL");
+  static const ElementKind LABEL = const ElementKind._("LABEL");
 
-  static const LIBRARY = const ElementKind._("LIBRARY");
+  static const ElementKind LIBRARY = const ElementKind._("LIBRARY");
 
-  static const LOCAL_VARIABLE = const ElementKind._("LOCAL_VARIABLE");
+  static const ElementKind LOCAL_VARIABLE = const ElementKind._("LOCAL_VARIABLE");
 
-  static const METHOD = const ElementKind._("METHOD");
+  static const ElementKind METHOD = const ElementKind._("METHOD");
 
-  static const PARAMETER = const ElementKind._("PARAMETER");
+  static const ElementKind PARAMETER = const ElementKind._("PARAMETER");
 
-  static const PREFIX = const ElementKind._("PREFIX");
+  static const ElementKind PREFIX = const ElementKind._("PREFIX");
 
-  static const SETTER = const ElementKind._("SETTER");
+  static const ElementKind SETTER = const ElementKind._("SETTER");
 
-  static const TOP_LEVEL_VARIABLE = const ElementKind._("TOP_LEVEL_VARIABLE");
+  static const ElementKind TOP_LEVEL_VARIABLE = const ElementKind._("TOP_LEVEL_VARIABLE");
 
-  static const TYPE_PARAMETER = const ElementKind._("TYPE_PARAMETER");
+  static const ElementKind TYPE_PARAMETER = const ElementKind._("TYPE_PARAMETER");
 
   /**
    * Deprecated: support for tests was removed.
    */
-  static const UNIT_TEST_GROUP = const ElementKind._("UNIT_TEST_GROUP");
+  static const ElementKind UNIT_TEST_GROUP = const ElementKind._("UNIT_TEST_GROUP");
 
   /**
    * Deprecated: support for tests was removed.
    */
-  static const UNIT_TEST_TEST = const ElementKind._("UNIT_TEST_TEST");
+  static const ElementKind UNIT_TEST_TEST = const ElementKind._("UNIT_TEST_TEST");
 
-  static const UNKNOWN = const ElementKind._("UNKNOWN");
+  static const ElementKind UNKNOWN = const ElementKind._("UNKNOWN");
 
   /**
    * A list containing all of the enum values that are defined.
@@ -10255,13 +10255,13 @@
  * Clients may not extend, implement or mix-in this class.
  */
 class ExecutableKind implements Enum {
-  static const CLIENT = const ExecutableKind._("CLIENT");
+  static const ExecutableKind CLIENT = const ExecutableKind._("CLIENT");
 
-  static const EITHER = const ExecutableKind._("EITHER");
+  static const ExecutableKind EITHER = const ExecutableKind._("EITHER");
 
-  static const NOT_EXECUTABLE = const ExecutableKind._("NOT_EXECUTABLE");
+  static const ExecutableKind NOT_EXECUTABLE = const ExecutableKind._("NOT_EXECUTABLE");
 
-  static const SERVER = const ExecutableKind._("SERVER");
+  static const ExecutableKind SERVER = const ExecutableKind._("SERVER");
 
   /**
    * A list containing all of the enum values that are defined.
@@ -10313,7 +10313,7 @@
  * Clients may not extend, implement or mix-in this class.
  */
 class ExecutionService implements Enum {
-  static const LAUNCH_DATA = const ExecutionService._("LAUNCH_DATA");
+  static const ExecutionService LAUNCH_DATA = const ExecutionService._("LAUNCH_DATA");
 
   /**
    * A list containing all of the enum values that are defined.
@@ -10360,9 +10360,9 @@
  * Clients may not extend, implement or mix-in this class.
  */
 class FileKind implements Enum {
-  static const LIBRARY = const FileKind._("LIBRARY");
+  static const FileKind LIBRARY = const FileKind._("LIBRARY");
 
-  static const PART = const FileKind._("PART");
+  static const FileKind PART = const FileKind._("PART");
 
   /**
    * A list containing all of the enum values that are defined.
@@ -10414,15 +10414,15 @@
  * Clients may not extend, implement or mix-in this class.
  */
 class FoldingKind implements Enum {
-  static const COMMENT = const FoldingKind._("COMMENT");
+  static const FoldingKind COMMENT = const FoldingKind._("COMMENT");
 
-  static const CLASS_MEMBER = const FoldingKind._("CLASS_MEMBER");
+  static const FoldingKind CLASS_MEMBER = const FoldingKind._("CLASS_MEMBER");
 
-  static const DIRECTIVES = const FoldingKind._("DIRECTIVES");
+  static const FoldingKind DIRECTIVES = const FoldingKind._("DIRECTIVES");
 
-  static const DOCUMENTATION_COMMENT = const FoldingKind._("DOCUMENTATION_COMMENT");
+  static const FoldingKind DOCUMENTATION_COMMENT = const FoldingKind._("DOCUMENTATION_COMMENT");
 
-  static const TOP_LEVEL_DECLARATION = const FoldingKind._("TOP_LEVEL_DECLARATION");
+  static const FoldingKind TOP_LEVEL_DECLARATION = const FoldingKind._("TOP_LEVEL_DECLARATION");
 
   /**
    * A list containing all of the enum values that are defined.
@@ -10599,7 +10599,7 @@
  * Clients may not extend, implement or mix-in this class.
  */
 class GeneralAnalysisService implements Enum {
-  static const ANALYZED_FILES = const GeneralAnalysisService._("ANALYZED_FILES");
+  static const GeneralAnalysisService ANALYZED_FILES = const GeneralAnalysisService._("ANALYZED_FILES");
 
   /**
    * A list containing all of the enum values that are defined.
@@ -10840,298 +10840,298 @@
  * Clients may not extend, implement or mix-in this class.
  */
 class HighlightRegionType implements Enum {
-  static const ANNOTATION = const HighlightRegionType._("ANNOTATION");
+  static const HighlightRegionType ANNOTATION = const HighlightRegionType._("ANNOTATION");
 
-  static const BUILT_IN = const HighlightRegionType._("BUILT_IN");
+  static const HighlightRegionType BUILT_IN = const HighlightRegionType._("BUILT_IN");
 
-  static const CLASS = const HighlightRegionType._("CLASS");
+  static const HighlightRegionType CLASS = const HighlightRegionType._("CLASS");
 
-  static const COMMENT_BLOCK = const HighlightRegionType._("COMMENT_BLOCK");
+  static const HighlightRegionType COMMENT_BLOCK = const HighlightRegionType._("COMMENT_BLOCK");
 
-  static const COMMENT_DOCUMENTATION = const HighlightRegionType._("COMMENT_DOCUMENTATION");
+  static const HighlightRegionType COMMENT_DOCUMENTATION = const HighlightRegionType._("COMMENT_DOCUMENTATION");
 
-  static const COMMENT_END_OF_LINE = const HighlightRegionType._("COMMENT_END_OF_LINE");
+  static const HighlightRegionType COMMENT_END_OF_LINE = const HighlightRegionType._("COMMENT_END_OF_LINE");
 
-  static const CONSTRUCTOR = const HighlightRegionType._("CONSTRUCTOR");
+  static const HighlightRegionType CONSTRUCTOR = const HighlightRegionType._("CONSTRUCTOR");
 
-  static const DIRECTIVE = const HighlightRegionType._("DIRECTIVE");
+  static const HighlightRegionType DIRECTIVE = const HighlightRegionType._("DIRECTIVE");
 
   /**
    * Only for version 1 of highlight.
    */
-  static const DYNAMIC_TYPE = const HighlightRegionType._("DYNAMIC_TYPE");
+  static const HighlightRegionType DYNAMIC_TYPE = const HighlightRegionType._("DYNAMIC_TYPE");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const DYNAMIC_LOCAL_VARIABLE_DECLARATION = const HighlightRegionType._("DYNAMIC_LOCAL_VARIABLE_DECLARATION");
+  static const HighlightRegionType DYNAMIC_LOCAL_VARIABLE_DECLARATION = const HighlightRegionType._("DYNAMIC_LOCAL_VARIABLE_DECLARATION");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const DYNAMIC_LOCAL_VARIABLE_REFERENCE = const HighlightRegionType._("DYNAMIC_LOCAL_VARIABLE_REFERENCE");
+  static const HighlightRegionType DYNAMIC_LOCAL_VARIABLE_REFERENCE = const HighlightRegionType._("DYNAMIC_LOCAL_VARIABLE_REFERENCE");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const DYNAMIC_PARAMETER_DECLARATION = const HighlightRegionType._("DYNAMIC_PARAMETER_DECLARATION");
+  static const HighlightRegionType DYNAMIC_PARAMETER_DECLARATION = const HighlightRegionType._("DYNAMIC_PARAMETER_DECLARATION");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const DYNAMIC_PARAMETER_REFERENCE = const HighlightRegionType._("DYNAMIC_PARAMETER_REFERENCE");
+  static const HighlightRegionType DYNAMIC_PARAMETER_REFERENCE = const HighlightRegionType._("DYNAMIC_PARAMETER_REFERENCE");
 
-  static const ENUM = const HighlightRegionType._("ENUM");
+  static const HighlightRegionType ENUM = const HighlightRegionType._("ENUM");
 
-  static const ENUM_CONSTANT = const HighlightRegionType._("ENUM_CONSTANT");
+  static const HighlightRegionType ENUM_CONSTANT = const HighlightRegionType._("ENUM_CONSTANT");
 
   /**
    * Only for version 1 of highlight.
    */
-  static const FIELD = const HighlightRegionType._("FIELD");
+  static const HighlightRegionType FIELD = const HighlightRegionType._("FIELD");
 
   /**
    * Only for version 1 of highlight.
    */
-  static const FIELD_STATIC = const HighlightRegionType._("FIELD_STATIC");
+  static const HighlightRegionType FIELD_STATIC = const HighlightRegionType._("FIELD_STATIC");
 
   /**
    * Only for version 1 of highlight.
    */
-  static const FUNCTION = const HighlightRegionType._("FUNCTION");
+  static const HighlightRegionType FUNCTION = const HighlightRegionType._("FUNCTION");
 
   /**
    * Only for version 1 of highlight.
    */
-  static const FUNCTION_DECLARATION = const HighlightRegionType._("FUNCTION_DECLARATION");
+  static const HighlightRegionType FUNCTION_DECLARATION = const HighlightRegionType._("FUNCTION_DECLARATION");
 
-  static const FUNCTION_TYPE_ALIAS = const HighlightRegionType._("FUNCTION_TYPE_ALIAS");
+  static const HighlightRegionType FUNCTION_TYPE_ALIAS = const HighlightRegionType._("FUNCTION_TYPE_ALIAS");
 
   /**
    * Only for version 1 of highlight.
    */
-  static const GETTER_DECLARATION = const HighlightRegionType._("GETTER_DECLARATION");
+  static const HighlightRegionType GETTER_DECLARATION = const HighlightRegionType._("GETTER_DECLARATION");
 
-  static const IDENTIFIER_DEFAULT = const HighlightRegionType._("IDENTIFIER_DEFAULT");
+  static const HighlightRegionType IDENTIFIER_DEFAULT = const HighlightRegionType._("IDENTIFIER_DEFAULT");
 
-  static const IMPORT_PREFIX = const HighlightRegionType._("IMPORT_PREFIX");
+  static const HighlightRegionType IMPORT_PREFIX = const HighlightRegionType._("IMPORT_PREFIX");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const INSTANCE_FIELD_DECLARATION = const HighlightRegionType._("INSTANCE_FIELD_DECLARATION");
+  static const HighlightRegionType INSTANCE_FIELD_DECLARATION = const HighlightRegionType._("INSTANCE_FIELD_DECLARATION");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const INSTANCE_FIELD_REFERENCE = const HighlightRegionType._("INSTANCE_FIELD_REFERENCE");
+  static const HighlightRegionType INSTANCE_FIELD_REFERENCE = const HighlightRegionType._("INSTANCE_FIELD_REFERENCE");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const INSTANCE_GETTER_DECLARATION = const HighlightRegionType._("INSTANCE_GETTER_DECLARATION");
+  static const HighlightRegionType INSTANCE_GETTER_DECLARATION = const HighlightRegionType._("INSTANCE_GETTER_DECLARATION");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const INSTANCE_GETTER_REFERENCE = const HighlightRegionType._("INSTANCE_GETTER_REFERENCE");
+  static const HighlightRegionType INSTANCE_GETTER_REFERENCE = const HighlightRegionType._("INSTANCE_GETTER_REFERENCE");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const INSTANCE_METHOD_DECLARATION = const HighlightRegionType._("INSTANCE_METHOD_DECLARATION");
+  static const HighlightRegionType INSTANCE_METHOD_DECLARATION = const HighlightRegionType._("INSTANCE_METHOD_DECLARATION");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const INSTANCE_METHOD_REFERENCE = const HighlightRegionType._("INSTANCE_METHOD_REFERENCE");
+  static const HighlightRegionType INSTANCE_METHOD_REFERENCE = const HighlightRegionType._("INSTANCE_METHOD_REFERENCE");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const INSTANCE_SETTER_DECLARATION = const HighlightRegionType._("INSTANCE_SETTER_DECLARATION");
+  static const HighlightRegionType INSTANCE_SETTER_DECLARATION = const HighlightRegionType._("INSTANCE_SETTER_DECLARATION");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const INSTANCE_SETTER_REFERENCE = const HighlightRegionType._("INSTANCE_SETTER_REFERENCE");
+  static const HighlightRegionType INSTANCE_SETTER_REFERENCE = const HighlightRegionType._("INSTANCE_SETTER_REFERENCE");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const INVALID_STRING_ESCAPE = const HighlightRegionType._("INVALID_STRING_ESCAPE");
+  static const HighlightRegionType INVALID_STRING_ESCAPE = const HighlightRegionType._("INVALID_STRING_ESCAPE");
 
-  static const KEYWORD = const HighlightRegionType._("KEYWORD");
+  static const HighlightRegionType KEYWORD = const HighlightRegionType._("KEYWORD");
 
-  static const LABEL = const HighlightRegionType._("LABEL");
+  static const HighlightRegionType LABEL = const HighlightRegionType._("LABEL");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const LIBRARY_NAME = const HighlightRegionType._("LIBRARY_NAME");
+  static const HighlightRegionType LIBRARY_NAME = const HighlightRegionType._("LIBRARY_NAME");
 
-  static const LITERAL_BOOLEAN = const HighlightRegionType._("LITERAL_BOOLEAN");
+  static const HighlightRegionType LITERAL_BOOLEAN = const HighlightRegionType._("LITERAL_BOOLEAN");
 
-  static const LITERAL_DOUBLE = const HighlightRegionType._("LITERAL_DOUBLE");
+  static const HighlightRegionType LITERAL_DOUBLE = const HighlightRegionType._("LITERAL_DOUBLE");
 
-  static const LITERAL_INTEGER = const HighlightRegionType._("LITERAL_INTEGER");
+  static const HighlightRegionType LITERAL_INTEGER = const HighlightRegionType._("LITERAL_INTEGER");
 
-  static const LITERAL_LIST = const HighlightRegionType._("LITERAL_LIST");
+  static const HighlightRegionType LITERAL_LIST = const HighlightRegionType._("LITERAL_LIST");
 
-  static const LITERAL_MAP = const HighlightRegionType._("LITERAL_MAP");
+  static const HighlightRegionType LITERAL_MAP = const HighlightRegionType._("LITERAL_MAP");
 
-  static const LITERAL_STRING = const HighlightRegionType._("LITERAL_STRING");
+  static const HighlightRegionType LITERAL_STRING = const HighlightRegionType._("LITERAL_STRING");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const LOCAL_FUNCTION_DECLARATION = const HighlightRegionType._("LOCAL_FUNCTION_DECLARATION");
+  static const HighlightRegionType LOCAL_FUNCTION_DECLARATION = const HighlightRegionType._("LOCAL_FUNCTION_DECLARATION");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const LOCAL_FUNCTION_REFERENCE = const HighlightRegionType._("LOCAL_FUNCTION_REFERENCE");
+  static const HighlightRegionType LOCAL_FUNCTION_REFERENCE = const HighlightRegionType._("LOCAL_FUNCTION_REFERENCE");
 
   /**
    * Only for version 1 of highlight.
    */
-  static const LOCAL_VARIABLE = const HighlightRegionType._("LOCAL_VARIABLE");
+  static const HighlightRegionType LOCAL_VARIABLE = const HighlightRegionType._("LOCAL_VARIABLE");
 
-  static const LOCAL_VARIABLE_DECLARATION = const HighlightRegionType._("LOCAL_VARIABLE_DECLARATION");
+  static const HighlightRegionType LOCAL_VARIABLE_DECLARATION = const HighlightRegionType._("LOCAL_VARIABLE_DECLARATION");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const LOCAL_VARIABLE_REFERENCE = const HighlightRegionType._("LOCAL_VARIABLE_REFERENCE");
+  static const HighlightRegionType LOCAL_VARIABLE_REFERENCE = const HighlightRegionType._("LOCAL_VARIABLE_REFERENCE");
 
   /**
    * Only for version 1 of highlight.
    */
-  static const METHOD = const HighlightRegionType._("METHOD");
+  static const HighlightRegionType METHOD = const HighlightRegionType._("METHOD");
 
   /**
    * Only for version 1 of highlight.
    */
-  static const METHOD_DECLARATION = const HighlightRegionType._("METHOD_DECLARATION");
+  static const HighlightRegionType METHOD_DECLARATION = const HighlightRegionType._("METHOD_DECLARATION");
 
   /**
    * Only for version 1 of highlight.
    */
-  static const METHOD_DECLARATION_STATIC = const HighlightRegionType._("METHOD_DECLARATION_STATIC");
+  static const HighlightRegionType METHOD_DECLARATION_STATIC = const HighlightRegionType._("METHOD_DECLARATION_STATIC");
 
   /**
    * Only for version 1 of highlight.
    */
-  static const METHOD_STATIC = const HighlightRegionType._("METHOD_STATIC");
+  static const HighlightRegionType METHOD_STATIC = const HighlightRegionType._("METHOD_STATIC");
 
   /**
    * Only for version 1 of highlight.
    */
-  static const PARAMETER = const HighlightRegionType._("PARAMETER");
+  static const HighlightRegionType PARAMETER = const HighlightRegionType._("PARAMETER");
 
   /**
    * Only for version 1 of highlight.
    */
-  static const SETTER_DECLARATION = const HighlightRegionType._("SETTER_DECLARATION");
+  static const HighlightRegionType SETTER_DECLARATION = const HighlightRegionType._("SETTER_DECLARATION");
 
   /**
    * Only for version 1 of highlight.
    */
-  static const TOP_LEVEL_VARIABLE = const HighlightRegionType._("TOP_LEVEL_VARIABLE");
+  static const HighlightRegionType TOP_LEVEL_VARIABLE = const HighlightRegionType._("TOP_LEVEL_VARIABLE");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const PARAMETER_DECLARATION = const HighlightRegionType._("PARAMETER_DECLARATION");
+  static const HighlightRegionType PARAMETER_DECLARATION = const HighlightRegionType._("PARAMETER_DECLARATION");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const PARAMETER_REFERENCE = const HighlightRegionType._("PARAMETER_REFERENCE");
+  static const HighlightRegionType PARAMETER_REFERENCE = const HighlightRegionType._("PARAMETER_REFERENCE");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const STATIC_FIELD_DECLARATION = const HighlightRegionType._("STATIC_FIELD_DECLARATION");
+  static const HighlightRegionType STATIC_FIELD_DECLARATION = const HighlightRegionType._("STATIC_FIELD_DECLARATION");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const STATIC_GETTER_DECLARATION = const HighlightRegionType._("STATIC_GETTER_DECLARATION");
+  static const HighlightRegionType STATIC_GETTER_DECLARATION = const HighlightRegionType._("STATIC_GETTER_DECLARATION");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const STATIC_GETTER_REFERENCE = const HighlightRegionType._("STATIC_GETTER_REFERENCE");
+  static const HighlightRegionType STATIC_GETTER_REFERENCE = const HighlightRegionType._("STATIC_GETTER_REFERENCE");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const STATIC_METHOD_DECLARATION = const HighlightRegionType._("STATIC_METHOD_DECLARATION");
+  static const HighlightRegionType STATIC_METHOD_DECLARATION = const HighlightRegionType._("STATIC_METHOD_DECLARATION");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const STATIC_METHOD_REFERENCE = const HighlightRegionType._("STATIC_METHOD_REFERENCE");
+  static const HighlightRegionType STATIC_METHOD_REFERENCE = const HighlightRegionType._("STATIC_METHOD_REFERENCE");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const STATIC_SETTER_DECLARATION = const HighlightRegionType._("STATIC_SETTER_DECLARATION");
+  static const HighlightRegionType STATIC_SETTER_DECLARATION = const HighlightRegionType._("STATIC_SETTER_DECLARATION");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const STATIC_SETTER_REFERENCE = const HighlightRegionType._("STATIC_SETTER_REFERENCE");
+  static const HighlightRegionType STATIC_SETTER_REFERENCE = const HighlightRegionType._("STATIC_SETTER_REFERENCE");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const TOP_LEVEL_FUNCTION_DECLARATION = const HighlightRegionType._("TOP_LEVEL_FUNCTION_DECLARATION");
+  static const HighlightRegionType TOP_LEVEL_FUNCTION_DECLARATION = const HighlightRegionType._("TOP_LEVEL_FUNCTION_DECLARATION");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const TOP_LEVEL_FUNCTION_REFERENCE = const HighlightRegionType._("TOP_LEVEL_FUNCTION_REFERENCE");
+  static const HighlightRegionType TOP_LEVEL_FUNCTION_REFERENCE = const HighlightRegionType._("TOP_LEVEL_FUNCTION_REFERENCE");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const TOP_LEVEL_GETTER_DECLARATION = const HighlightRegionType._("TOP_LEVEL_GETTER_DECLARATION");
+  static const HighlightRegionType TOP_LEVEL_GETTER_DECLARATION = const HighlightRegionType._("TOP_LEVEL_GETTER_DECLARATION");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const TOP_LEVEL_GETTER_REFERENCE = const HighlightRegionType._("TOP_LEVEL_GETTER_REFERENCE");
+  static const HighlightRegionType TOP_LEVEL_GETTER_REFERENCE = const HighlightRegionType._("TOP_LEVEL_GETTER_REFERENCE");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const TOP_LEVEL_SETTER_DECLARATION = const HighlightRegionType._("TOP_LEVEL_SETTER_DECLARATION");
+  static const HighlightRegionType TOP_LEVEL_SETTER_DECLARATION = const HighlightRegionType._("TOP_LEVEL_SETTER_DECLARATION");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const TOP_LEVEL_SETTER_REFERENCE = const HighlightRegionType._("TOP_LEVEL_SETTER_REFERENCE");
+  static const HighlightRegionType TOP_LEVEL_SETTER_REFERENCE = const HighlightRegionType._("TOP_LEVEL_SETTER_REFERENCE");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const TOP_LEVEL_VARIABLE_DECLARATION = const HighlightRegionType._("TOP_LEVEL_VARIABLE_DECLARATION");
+  static const HighlightRegionType TOP_LEVEL_VARIABLE_DECLARATION = const HighlightRegionType._("TOP_LEVEL_VARIABLE_DECLARATION");
 
-  static const TYPE_NAME_DYNAMIC = const HighlightRegionType._("TYPE_NAME_DYNAMIC");
+  static const HighlightRegionType TYPE_NAME_DYNAMIC = const HighlightRegionType._("TYPE_NAME_DYNAMIC");
 
-  static const TYPE_PARAMETER = const HighlightRegionType._("TYPE_PARAMETER");
+  static const HighlightRegionType TYPE_PARAMETER = const HighlightRegionType._("TYPE_PARAMETER");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const UNRESOLVED_INSTANCE_MEMBER_REFERENCE = const HighlightRegionType._("UNRESOLVED_INSTANCE_MEMBER_REFERENCE");
+  static const HighlightRegionType UNRESOLVED_INSTANCE_MEMBER_REFERENCE = const HighlightRegionType._("UNRESOLVED_INSTANCE_MEMBER_REFERENCE");
 
   /**
    * Only for version 2 of highlight.
    */
-  static const VALID_STRING_ESCAPE = const HighlightRegionType._("VALID_STRING_ESCAPE");
+  static const HighlightRegionType VALID_STRING_ESCAPE = const HighlightRegionType._("VALID_STRING_ESCAPE");
 
   /**
    * A list containing all of the enum values that are defined.
@@ -12145,13 +12145,13 @@
  * Clients may not extend, implement or mix-in this class.
  */
 class LinkedEditSuggestionKind implements Enum {
-  static const METHOD = const LinkedEditSuggestionKind._("METHOD");
+  static const LinkedEditSuggestionKind METHOD = const LinkedEditSuggestionKind._("METHOD");
 
-  static const PARAMETER = const LinkedEditSuggestionKind._("PARAMETER");
+  static const LinkedEditSuggestionKind PARAMETER = const LinkedEditSuggestionKind._("PARAMETER");
 
-  static const TYPE = const LinkedEditSuggestionKind._("TYPE");
+  static const LinkedEditSuggestionKind TYPE = const LinkedEditSuggestionKind._("TYPE");
 
-  static const VARIABLE = const LinkedEditSuggestionKind._("VARIABLE");
+  static const LinkedEditSuggestionKind VARIABLE = const LinkedEditSuggestionKind._("VARIABLE");
 
   /**
    * A list containing all of the enum values that are defined.
@@ -13425,23 +13425,23 @@
  * Clients may not extend, implement or mix-in this class.
  */
 class RefactoringKind implements Enum {
-  static const CONVERT_GETTER_TO_METHOD = const RefactoringKind._("CONVERT_GETTER_TO_METHOD");
+  static const RefactoringKind CONVERT_GETTER_TO_METHOD = const RefactoringKind._("CONVERT_GETTER_TO_METHOD");
 
-  static const CONVERT_METHOD_TO_GETTER = const RefactoringKind._("CONVERT_METHOD_TO_GETTER");
+  static const RefactoringKind CONVERT_METHOD_TO_GETTER = const RefactoringKind._("CONVERT_METHOD_TO_GETTER");
 
-  static const EXTRACT_LOCAL_VARIABLE = const RefactoringKind._("EXTRACT_LOCAL_VARIABLE");
+  static const RefactoringKind EXTRACT_LOCAL_VARIABLE = const RefactoringKind._("EXTRACT_LOCAL_VARIABLE");
 
-  static const EXTRACT_METHOD = const RefactoringKind._("EXTRACT_METHOD");
+  static const RefactoringKind EXTRACT_METHOD = const RefactoringKind._("EXTRACT_METHOD");
 
-  static const INLINE_LOCAL_VARIABLE = const RefactoringKind._("INLINE_LOCAL_VARIABLE");
+  static const RefactoringKind INLINE_LOCAL_VARIABLE = const RefactoringKind._("INLINE_LOCAL_VARIABLE");
 
-  static const INLINE_METHOD = const RefactoringKind._("INLINE_METHOD");
+  static const RefactoringKind INLINE_METHOD = const RefactoringKind._("INLINE_METHOD");
 
-  static const MOVE_FILE = const RefactoringKind._("MOVE_FILE");
+  static const RefactoringKind MOVE_FILE = const RefactoringKind._("MOVE_FILE");
 
-  static const RENAME = const RefactoringKind._("RENAME");
+  static const RefactoringKind RENAME = const RefactoringKind._("RENAME");
 
-  static const SORT_MEMBERS = const RefactoringKind._("SORT_MEMBERS");
+  static const RefactoringKind SORT_MEMBERS = const RefactoringKind._("SORT_MEMBERS");
 
   /**
    * A list containing all of the enum values that are defined.
@@ -13762,11 +13762,11 @@
  * Clients may not extend, implement or mix-in this class.
  */
 class RefactoringMethodParameterKind implements Enum {
-  static const REQUIRED = const RefactoringMethodParameterKind._("REQUIRED");
+  static const RefactoringMethodParameterKind REQUIRED = const RefactoringMethodParameterKind._("REQUIRED");
 
-  static const POSITIONAL = const RefactoringMethodParameterKind._("POSITIONAL");
+  static const RefactoringMethodParameterKind POSITIONAL = const RefactoringMethodParameterKind._("POSITIONAL");
 
-  static const NAMED = const RefactoringMethodParameterKind._("NAMED");
+  static const RefactoringMethodParameterKind NAMED = const RefactoringMethodParameterKind._("NAMED");
 
   /**
    * A list containing all of the enum values that are defined.
@@ -13948,7 +13948,7 @@
   /**
    * A minor code problem. No example, because it is not used yet.
    */
-  static const INFO = const RefactoringProblemSeverity._("INFO");
+  static const RefactoringProblemSeverity INFO = const RefactoringProblemSeverity._("INFO");
 
   /**
    * A minor code problem. For example names of local variables should be camel
@@ -13956,7 +13956,7 @@
    * with an upper case is OK from the language point of view, but it is nice
    * to warn the user.
    */
-  static const WARNING = const RefactoringProblemSeverity._("WARNING");
+  static const RefactoringProblemSeverity WARNING = const RefactoringProblemSeverity._("WARNING");
 
   /**
    * The refactoring technically can be performed, but there is a logical
@@ -13969,14 +13969,14 @@
    * the name conflict might be expected, and the user wants to fix it
    * afterwards.
    */
-  static const ERROR = const RefactoringProblemSeverity._("ERROR");
+  static const RefactoringProblemSeverity ERROR = const RefactoringProblemSeverity._("ERROR");
 
   /**
    * A fatal error, which prevents performing the refactoring. For example the
    * name of a local variable being extracted is not a valid identifier, or
    * selection is not a valid expression.
    */
-  static const FATAL = const RefactoringProblemSeverity._("FATAL");
+  static const RefactoringProblemSeverity FATAL = const RefactoringProblemSeverity._("FATAL");
 
   /**
    * A list containing all of the enum values that are defined.
@@ -14237,93 +14237,93 @@
    * satisfied because the content of the file changed before the requested
    * results could be computed.
    */
-  static const CONTENT_MODIFIED = const RequestErrorCode._("CONTENT_MODIFIED");
+  static const RequestErrorCode CONTENT_MODIFIED = const RequestErrorCode._("CONTENT_MODIFIED");
 
   /**
    * A request specified a FilePath which does not match a file in an analysis
    * root, or the requested operation is not available for the file.
    */
-  static const FILE_NOT_ANALYZED = const RequestErrorCode._("FILE_NOT_ANALYZED");
+  static const RequestErrorCode FILE_NOT_ANALYZED = const RequestErrorCode._("FILE_NOT_ANALYZED");
 
   /**
    * An "edit.format" request specified a FilePath which does not match a Dart
    * file in an analysis root.
    */
-  static const FORMAT_INVALID_FILE = const RequestErrorCode._("FORMAT_INVALID_FILE");
+  static const RequestErrorCode FORMAT_INVALID_FILE = const RequestErrorCode._("FORMAT_INVALID_FILE");
 
   /**
    * An "edit.format" request specified a file that contains syntax errors.
    */
-  static const FORMAT_WITH_ERRORS = const RequestErrorCode._("FORMAT_WITH_ERRORS");
+  static const RequestErrorCode FORMAT_WITH_ERRORS = const RequestErrorCode._("FORMAT_WITH_ERRORS");
 
   /**
    * An "analysis.getErrors" request specified a FilePath which does not match
    * a file currently subject to analysis.
    */
-  static const GET_ERRORS_INVALID_FILE = const RequestErrorCode._("GET_ERRORS_INVALID_FILE");
+  static const RequestErrorCode GET_ERRORS_INVALID_FILE = const RequestErrorCode._("GET_ERRORS_INVALID_FILE");
 
   /**
    * An "analysis.getNavigation" request specified a FilePath which does not
    * match a file currently subject to analysis.
    */
-  static const GET_NAVIGATION_INVALID_FILE = const RequestErrorCode._("GET_NAVIGATION_INVALID_FILE");
+  static const RequestErrorCode GET_NAVIGATION_INVALID_FILE = const RequestErrorCode._("GET_NAVIGATION_INVALID_FILE");
 
   /**
    * An "analysis.getReachableSources" request specified a FilePath which does
    * not match a file currently subject to analysis.
    */
-  static const GET_REACHABLE_SOURCES_INVALID_FILE = const RequestErrorCode._("GET_REACHABLE_SOURCES_INVALID_FILE");
+  static const RequestErrorCode GET_REACHABLE_SOURCES_INVALID_FILE = const RequestErrorCode._("GET_REACHABLE_SOURCES_INVALID_FILE");
 
   /**
    * A path passed as an argument to a request (such as analysis.reanalyze) is
    * required to be an analysis root, but isn't.
    */
-  static const INVALID_ANALYSIS_ROOT = const RequestErrorCode._("INVALID_ANALYSIS_ROOT");
+  static const RequestErrorCode INVALID_ANALYSIS_ROOT = const RequestErrorCode._("INVALID_ANALYSIS_ROOT");
 
   /**
    * The context root used to create an execution context does not exist.
    */
-  static const INVALID_EXECUTION_CONTEXT = const RequestErrorCode._("INVALID_EXECUTION_CONTEXT");
+  static const RequestErrorCode INVALID_EXECUTION_CONTEXT = const RequestErrorCode._("INVALID_EXECUTION_CONTEXT");
 
   /**
    * The format of the given file path is invalid, e.g. is not absolute and
    * normalized.
    */
-  static const INVALID_FILE_PATH_FORMAT = const RequestErrorCode._("INVALID_FILE_PATH_FORMAT");
+  static const RequestErrorCode INVALID_FILE_PATH_FORMAT = const RequestErrorCode._("INVALID_FILE_PATH_FORMAT");
 
   /**
    * An "analysis.updateContent" request contained a ChangeContentOverlay
    * object which can't be applied, due to an edit having an offset or length
    * that is out of range.
    */
-  static const INVALID_OVERLAY_CHANGE = const RequestErrorCode._("INVALID_OVERLAY_CHANGE");
+  static const RequestErrorCode INVALID_OVERLAY_CHANGE = const RequestErrorCode._("INVALID_OVERLAY_CHANGE");
 
   /**
    * One of the method parameters was invalid.
    */
-  static const INVALID_PARAMETER = const RequestErrorCode._("INVALID_PARAMETER");
+  static const RequestErrorCode INVALID_PARAMETER = const RequestErrorCode._("INVALID_PARAMETER");
 
   /**
    * A malformed request was received.
    */
-  static const INVALID_REQUEST = const RequestErrorCode._("INVALID_REQUEST");
+  static const RequestErrorCode INVALID_REQUEST = const RequestErrorCode._("INVALID_REQUEST");
 
   /**
    * The "--no-index" flag was passed when the analysis server created, but
    * this API call requires an index to have been generated.
    */
-  static const NO_INDEX_GENERATED = const RequestErrorCode._("NO_INDEX_GENERATED");
+  static const RequestErrorCode NO_INDEX_GENERATED = const RequestErrorCode._("NO_INDEX_GENERATED");
 
   /**
    * An "edit.organizeDirectives" request specified a Dart file that cannot be
    * analyzed. The reason is described in the message.
    */
-  static const ORGANIZE_DIRECTIVES_ERROR = const RequestErrorCode._("ORGANIZE_DIRECTIVES_ERROR");
+  static const RequestErrorCode ORGANIZE_DIRECTIVES_ERROR = const RequestErrorCode._("ORGANIZE_DIRECTIVES_ERROR");
 
   /**
    * Another refactoring request was received during processing of this one.
    */
-  static const REFACTORING_REQUEST_CANCELLED = const RequestErrorCode._("REFACTORING_REQUEST_CANCELLED");
+  static const RequestErrorCode REFACTORING_REQUEST_CANCELLED = const RequestErrorCode._("REFACTORING_REQUEST_CANCELLED");
 
   /**
    * The analysis server has already been started (and hence won't accept new
@@ -14333,25 +14333,25 @@
    * server can only speak to one client at a time so this error will never
    * occur.
    */
-  static const SERVER_ALREADY_STARTED = const RequestErrorCode._("SERVER_ALREADY_STARTED");
+  static const RequestErrorCode SERVER_ALREADY_STARTED = const RequestErrorCode._("SERVER_ALREADY_STARTED");
 
   /**
    * An internal error occurred in the analysis server. Also see the
    * server.error notification.
    */
-  static const SERVER_ERROR = const RequestErrorCode._("SERVER_ERROR");
+  static const RequestErrorCode SERVER_ERROR = const RequestErrorCode._("SERVER_ERROR");
 
   /**
    * An "edit.sortMembers" request specified a FilePath which does not match a
    * Dart file in an analysis root.
    */
-  static const SORT_MEMBERS_INVALID_FILE = const RequestErrorCode._("SORT_MEMBERS_INVALID_FILE");
+  static const RequestErrorCode SORT_MEMBERS_INVALID_FILE = const RequestErrorCode._("SORT_MEMBERS_INVALID_FILE");
 
   /**
    * An "edit.sortMembers" request specified a Dart file that has scan or parse
    * errors.
    */
-  static const SORT_MEMBERS_PARSE_ERRORS = const RequestErrorCode._("SORT_MEMBERS_PARSE_ERRORS");
+  static const RequestErrorCode SORT_MEMBERS_PARSE_ERRORS = const RequestErrorCode._("SORT_MEMBERS_PARSE_ERRORS");
 
   /**
    * An "analysis.setPriorityFiles" request includes one or more files that are
@@ -14360,19 +14360,19 @@
    * This is a legacy error; it will be removed before the API reaches version
    * 1.0.
    */
-  static const UNANALYZED_PRIORITY_FILES = const RequestErrorCode._("UNANALYZED_PRIORITY_FILES");
+  static const RequestErrorCode UNANALYZED_PRIORITY_FILES = const RequestErrorCode._("UNANALYZED_PRIORITY_FILES");
 
   /**
    * A request was received which the analysis server does not recognize, or
    * cannot handle in its current configuration.
    */
-  static const UNKNOWN_REQUEST = const RequestErrorCode._("UNKNOWN_REQUEST");
+  static const RequestErrorCode UNKNOWN_REQUEST = const RequestErrorCode._("UNKNOWN_REQUEST");
 
   /**
    * The analysis server was requested to perform an action on a source that
    * does not exist.
    */
-  static const UNKNOWN_SOURCE = const RequestErrorCode._("UNKNOWN_SOURCE");
+  static const RequestErrorCode UNKNOWN_SOURCE = const RequestErrorCode._("UNKNOWN_SOURCE");
 
   /**
    * The analysis server was requested to perform an action which is not
@@ -14381,7 +14381,7 @@
    * This is a legacy error; it will be removed before the API reaches version
    * 1.0.
    */
-  static const UNSUPPORTED_FEATURE = const RequestErrorCode._("UNSUPPORTED_FEATURE");
+  static const RequestErrorCode UNSUPPORTED_FEATURE = const RequestErrorCode._("UNSUPPORTED_FEATURE");
 
   /**
    * A list containing all of the enum values that are defined.
@@ -14641,38 +14641,38 @@
   /**
    * The declaration of an element.
    */
-  static const DECLARATION = const SearchResultKind._("DECLARATION");
+  static const SearchResultKind DECLARATION = const SearchResultKind._("DECLARATION");
 
   /**
    * The invocation of a function or method.
    */
-  static const INVOCATION = const SearchResultKind._("INVOCATION");
+  static const SearchResultKind INVOCATION = const SearchResultKind._("INVOCATION");
 
   /**
    * A reference to a field, parameter or variable where it is being read.
    */
-  static const READ = const SearchResultKind._("READ");
+  static const SearchResultKind READ = const SearchResultKind._("READ");
 
   /**
    * A reference to a field, parameter or variable where it is being read and
    * written.
    */
-  static const READ_WRITE = const SearchResultKind._("READ_WRITE");
+  static const SearchResultKind READ_WRITE = const SearchResultKind._("READ_WRITE");
 
   /**
    * A reference to an element.
    */
-  static const REFERENCE = const SearchResultKind._("REFERENCE");
+  static const SearchResultKind REFERENCE = const SearchResultKind._("REFERENCE");
 
   /**
    * Some other kind of search result.
    */
-  static const UNKNOWN = const SearchResultKind._("UNKNOWN");
+  static const SearchResultKind UNKNOWN = const SearchResultKind._("UNKNOWN");
 
   /**
    * A reference to a field, parameter or variable where it is being written.
    */
-  static const WRITE = const SearchResultKind._("WRITE");
+  static const SearchResultKind WRITE = const SearchResultKind._("WRITE");
 
   /**
    * A list containing all of the enum values that are defined.
@@ -14730,7 +14730,7 @@
  * Clients may not extend, implement or mix-in this class.
  */
 class ServerService implements Enum {
-  static const STATUS = const ServerService._("STATUS");
+  static const ServerService STATUS = const ServerService._("STATUS");
 
   /**
    * A list containing all of the enum values that are defined.
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index d53d90b..c8afeae 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -14,6 +14,7 @@
     hide AnalysisOptions, Element;
 import 'package:analysis_server/src/analysis_logger.dart';
 import 'package:analysis_server/src/channel/channel.dart';
+import 'package:analysis_server/src/computer/new_notifications.dart';
 import 'package:analysis_server/src/context_manager.dart';
 import 'package:analysis_server/src/operation/operation.dart';
 import 'package:analysis_server/src/operation/operation_analysis.dart';
@@ -23,22 +24,28 @@
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analysis_server/src/services/search/search_engine.dart';
 import 'package:analysis_server/src/services/search/search_engine_internal.dart';
+import 'package:analysis_server/src/services/search/search_engine_internal2.dart';
 import 'package:analysis_server/src/single_context_manager.dart';
 import 'package:analyzer/dart/ast/ast.dart';
 import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer/exception/exception.dart';
 import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/file_system/physical_file_system.dart';
 import 'package:analyzer/instrumentation/instrumentation.dart';
 import 'package:analyzer/plugin/resolver_provider.dart';
 import 'package:analyzer/source/pub_package_map_provider.dart';
 import 'package:analyzer/src/context/builder.dart';
+import 'package:analyzer/src/dart/analysis/byte_store.dart';
+import 'package:analyzer/src/dart/analysis/driver.dart' as nd;
+import 'package:analyzer/src/dart/analysis/file_byte_store.dart';
+import 'package:analyzer/src/dart/analysis/file_state.dart' as nd;
+import 'package:analyzer/src/dart/analysis/status.dart' as nd;
 import 'package:analyzer/src/dart/ast/utilities.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/source_io.dart';
 import 'package:analyzer/src/generated/utilities_general.dart';
-import 'package:analyzer/src/summary/package_bundle_reader.dart';
 import 'package:analyzer/src/summary/pub_summary.dart';
 import 'package:analyzer/src/task/dart.dart';
 import 'package:analyzer/src/util/glob.dart';
@@ -113,7 +120,7 @@
   /**
    * The [SearchEngine] for this server, may be `null` if indexing is disabled.
    */
-  final SearchEngine searchEngine;
+  SearchEngine searchEngine;
 
   /**
    * The plugin associated with this analysis server.
@@ -260,6 +267,11 @@
       new DateTime.now().millisecondsSinceEpoch + 1000;
 
   /**
+   * The content overlay for all analysis drivers.
+   */
+  final nd.FileContentOverlay fileContentOverlay = new nd.FileContentOverlay();
+
+  /**
    * The current state of overlays from the client.  This is used as the
    * content cache for all contexts.
    */
@@ -308,6 +320,21 @@
    */
   PubSummaryManager pubSummaryManager;
 
+  nd.PerformanceLog _analysisPerformanceLogger;
+  ByteStore byteStore;
+  nd.AnalysisDriverScheduler analysisDriverScheduler;
+
+  /**
+   * The set of the files that are currently priority.
+   */
+  final Set<String> priorityFiles = new Set<String>();
+
+  /**
+   * The cached results for [priorityFiles].
+   * These results must have not `null` units.
+   */
+  final Map<String, nd.AnalysisResult> priorityFileResults = {};
+
   /**
    * Initialize a newly created server to receive requests from and send
    * responses to the given [channel].
@@ -321,7 +348,7 @@
       this.channel,
       this.resourceProvider,
       PubPackageMapProvider packageMapProvider,
-      Index _index,
+      this.index,
       this.serverPlugin,
       this.options,
       this.sdkManager,
@@ -329,9 +356,7 @@
       {ResolverProvider fileResolverProvider: null,
       ResolverProvider packageResolverProvider: null,
       bool useSingleContextManager: false,
-      this.rethrowExceptions: true})
-      : index = _index,
-        searchEngine = _index != null ? new SearchEngineImpl(_index) : null {
+      this.rethrowExceptions: true}) {
     _performance = performanceDuringStartup;
     defaultContextOptions.incremental = true;
     defaultContextOptions.incrementalApi =
@@ -342,6 +367,20 @@
         options.finerGrainedInvalidation;
     defaultContextOptions.generateImplicitErrors = false;
     operationQueue = new ServerOperationQueue();
+    _analysisPerformanceLogger = new nd.PerformanceLog(io.stdout);
+    if (resourceProvider is PhysicalResourceProvider) {
+      byteStore = new MemoryCachingByteStore(
+          new FileByteStore(
+              resourceProvider.getStateLocation('.analysis-driver').path,
+              1024 * 1024 * 1024 /*1 GiB*/),
+          64 * 1024 * 1024 /*64 MiB*/);
+    } else {
+      byteStore = new MemoryByteStore();
+    }
+    analysisDriverScheduler =
+        new nd.AnalysisDriverScheduler(_analysisPerformanceLogger);
+    analysisDriverScheduler.status.listen(sendStatusNotificationNew);
+    analysisDriverScheduler.start();
     if (useSingleContextManager) {
       contextManager = new SingleContextManager(resourceProvider, sdkManager,
           packageResolverProvider, analyzedFilesGlobs, defaultContextOptions);
@@ -353,7 +392,8 @@
           packageMapProvider,
           analyzedFilesGlobs,
           instrumentationService,
-          defaultContextOptions);
+          defaultContextOptions,
+          options.enableNewAnalysisDriver);
     }
     this.fileResolverProvider = fileResolverProvider;
     this.packageResolverProvider = packageResolverProvider;
@@ -374,6 +414,11 @@
       });
     });
     _setupIndexInvalidation();
+    if (options.enableNewAnalysisDriver) {
+      searchEngine = new SearchEngineImpl2(driverMap.values);
+    } else if (index != null) {
+      searchEngine = new SearchEngineImpl(index);
+    }
     pubSummaryManager =
         new PubSummaryManager(resourceProvider, '${io.pid}.temp');
     Notification notification = new ServerConnectedParams(VERSION, io.pid,
@@ -413,6 +458,11 @@
   }
 
   /**
+   * A table mapping [Folder]s to the [AnalysisDriver]s associated with them.
+   */
+  Map<Folder, nd.AnalysisDriver> get driverMap => contextManager.driverMap;
+
+  /**
    * Return a table mapping [Folder]s to the [AnalysisContext]s associated with
    * them.
    */
@@ -538,6 +588,40 @@
     return null;
   }
 
+  /**
+   * Return an analysis driver to which the file with the given [path] is
+   * added if one exists, otherwise a driver in which the file was analyzed if
+   * one exists, otherwise the first driver, otherwise `null`.
+   */
+  nd.AnalysisDriver getAnalysisDriver(String path) {
+    Iterable<nd.AnalysisDriver> drivers = driverMap.values;
+    if (drivers.isNotEmpty) {
+      nd.AnalysisDriver driver = drivers.firstWhere(
+          (driver) => driver.addedFiles.contains(path),
+          orElse: () => null);
+      driver ??= drivers.firstWhere(
+          (driver) => driver.knownFiles.contains(path),
+          orElse: () => null);
+      driver ??= drivers.first;
+      return driver;
+    }
+    return null;
+  }
+
+  /**
+   * Return the analysis result for the file with the given [path]. The file is
+   * analyzed in one of the analysis drivers to which the file was added,
+   * otherwise in the first driver, otherwise `null` is returned.
+   */
+  Future<nd.AnalysisResult> getAnalysisResult(String path) async {
+    nd.AnalysisResult result = priorityFileResults[path];
+    if (result != null) {
+      return result;
+    }
+    nd.AnalysisDriver driver = getAnalysisDriver(path);
+    return driver?.getResult(path);
+  }
+
   CompilationUnitElement getCompilationUnitElement(String file) {
     ContextSourcePair pair = getContextSourcePair(file);
     if (pair == null) {
@@ -634,41 +718,37 @@
   }
 
   /**
-   * Returns [Element]s at the given [offset] of the given [file].
-   *
-   * May be empty if cannot be resolved, but not `null`.
+   * Return a [Future] that completes with the [Element] at the given
+   * [offset] of the given [file], or with `null` if there is no node at the
+   * [offset] or the node does not have an element.
    */
-  List<Element> getElementsAtOffset(String file, int offset) {
-    List<AstNode> nodes = getNodesAtOffset(file, offset);
-    return getElementsOfNodes(nodes);
+  Future<Element> getElementAtOffset(String file, int offset) async {
+    AstNode node = await getNodeAtOffset(file, offset);
+    return getElementOfNode(node);
   }
 
   /**
-   * Returns [Element]s of the given [nodes].
-   *
-   * May be empty if not resolved, but not `null`.
+   * Return the [Element] of the given [node], or `null` if [node] is `null` or
+   * does not have an element.
    */
-  List<Element> getElementsOfNodes(List<AstNode> nodes) {
-    List<Element> elements = <Element>[];
-    for (AstNode node in nodes) {
-      if (node is SimpleIdentifier && node.parent is LibraryIdentifier) {
-        node = node.parent;
-      }
-      if (node is LibraryIdentifier) {
-        node = node.parent;
-      }
-      if (node is StringLiteral && node.parent is UriBasedDirective) {
-        continue;
-      }
-      Element element = ElementLocator.locate(node);
-      if (node is SimpleIdentifier && element is PrefixElement) {
-        element = getImportElement(node);
-      }
-      if (element != null) {
-        elements.add(element);
-      }
+  Element getElementOfNode(AstNode node) {
+    if (node == null) {
+      return null;
     }
-    return elements;
+    if (node is SimpleIdentifier && node.parent is LibraryIdentifier) {
+      node = node.parent;
+    }
+    if (node is LibraryIdentifier) {
+      node = node.parent;
+    }
+    if (node is StringLiteral && node.parent is UriBasedDirective) {
+      return null;
+    }
+    Element element = ElementLocator.locate(node);
+    if (node is SimpleIdentifier && element is PrefixElement) {
+      element = getImportElement(node);
+    }
+    return element;
   }
 
   /**
@@ -698,49 +778,47 @@
   }
 
   /**
-   * Returns resolved [AstNode]s at the given [offset] of the given [file].
-   *
-   * May be empty, but not `null`.
+   * Return a [Future] that completes with the resolved [AstNode] at the
+   * given [offset] of the given [file], or with `null` if there is no node as
+   * the [offset].
    */
-  List<AstNode> getNodesAtOffset(String file, int offset) {
-    List<CompilationUnit> units = getResolvedCompilationUnits(file);
-    List<AstNode> nodes = <AstNode>[];
-    for (CompilationUnit unit in units) {
-      AstNode node = new NodeLocator(offset).searchWithin(unit);
-      if (node != null) {
-        nodes.add(node);
-      }
+  Future<AstNode> getNodeAtOffset(String file, int offset) async {
+    CompilationUnit unit;
+    if (options.enableNewAnalysisDriver) {
+      nd.AnalysisResult result = await getAnalysisResult(file);
+      unit = result?.unit;
+    } else {
+      unit = await getResolvedCompilationUnit(file);
     }
-    return nodes;
+    if (unit != null) {
+      return new NodeLocator(offset).searchWithin(unit);
+    }
+    return null;
   }
 
   /**
-   * Returns resolved [CompilationUnit]s of the Dart file with the given [path].
-   *
-   * May be empty, but not `null`.
+   * Return a [Future] that completes with the resolved [CompilationUnit] for
+   * the Dart file with the given [path], or with `null` if the file is not a
+   * Dart file or cannot be resolved.
    */
-  List<CompilationUnit> getResolvedCompilationUnits(String path) {
-    List<CompilationUnit> units = <CompilationUnit>[];
+  Future<CompilationUnit> getResolvedCompilationUnit(String path) async {
+    if (options.enableNewAnalysisDriver) {
+      nd.AnalysisResult result = await getAnalysisResult(path);
+      return result?.unit;
+    }
     ContextSourcePair contextSource = getContextSourcePair(path);
-    // prepare AnalysisContext
     AnalysisContext context = contextSource.context;
     if (context == null) {
-      return units;
+      return null;
     }
-    // add a unit for each unit/library combination
-    runWithActiveContext(context, () {
+    return runWithActiveContext(context, () {
       Source unitSource = contextSource.source;
       List<Source> librarySources = context.getLibrariesContaining(unitSource);
       for (Source librarySource in librarySources) {
-        CompilationUnit unit =
-            context.resolveCompilationUnit2(unitSource, librarySource);
-        if (unit != null) {
-          units.add(unit);
-        }
+        return context.resolveCompilationUnit2(unitSource, librarySource);
       }
+      return null;
     });
-    // done
-    return units;
   }
 
 // TODO(brianwilkerson) Add the following method after 'prioritySources' has
@@ -1061,6 +1139,25 @@
   }
 
   /**
+   * Send status notification to the client. The `operation` is the operation
+   * being performed or `null` if analysis is complete.
+   */
+  void sendStatusNotificationNew(nd.AnalysisStatus status) {
+    // Only send status when subscribed.
+    if (!serverServices.contains(ServerService.STATUS)) {
+      return;
+    }
+    // Only send status when it changes
+    if (statusAnalyzing == status.isAnalyzing) {
+      return;
+    }
+    statusAnalyzing = status.isAnalyzing;
+    AnalysisStatus analysis = new AnalysisStatus(status.isAnalyzing);
+    channel.sendNotification(
+        new ServerStatusParams(analysis: analysis).toNotification());
+  }
+
+  /**
    * Implementation for `analysis.setAnalysisRoots`.
    *
    * TODO(scheglov) implement complete projects/contexts semantics.
@@ -1087,6 +1184,24 @@
    */
   void setAnalysisSubscriptions(
       Map<AnalysisService, Set<String>> subscriptions) {
+    if (options.enableNewAnalysisDriver) {
+      this.analysisServices = subscriptions;
+      Iterable<nd.AnalysisDriver> drivers = driverMap.values;
+      if (drivers.isNotEmpty) {
+        Set<String> allNewFiles =
+            subscriptions.values.expand((files) => files).toSet();
+        for (String file in allNewFiles) {
+          nd.AnalysisDriver driver = drivers.firstWhere(
+              (driver) => driver.addedFiles.contains(file),
+              orElse: () => drivers.first);
+          // The result will be produced by the "results" stream with
+          // the fully resolved unit, and processed with sending analysis
+          // notifications as it happens after content changes.
+          driver.getResult(file);
+        }
+      }
+      return;
+    }
     // send notifications for already analyzed sources
     subscriptions.forEach((service, Set<String> newFiles) {
       Set<String> oldFiles = analysisServices[service];
@@ -1176,6 +1291,19 @@
    * Set the priority files to the given [files].
    */
   void setPriorityFiles(String requestId, List<String> files) {
+    if (options.enableNewAnalysisDriver) {
+      // Flush results for files that are not priority anymore.
+      priorityFiles
+          .difference(files.toSet())
+          .forEach(priorityFileResults.remove);
+      priorityFiles.clear();
+      priorityFiles.addAll(files);
+      // Set priority files in drivers.
+      driverMap.values.forEach((driver) {
+        driver.priorityFiles = files;
+      });
+      return;
+    }
     // Note: when a file is a priority file, that information needs to be
     // propagated to all contexts that analyze the file, so that all contexts
     // will be able to do incremental resolution of the file.  See
@@ -1295,6 +1423,46 @@
    * Implementation for `analysis.updateContent`.
    */
   void updateContent(String id, Map<String, dynamic> changes) {
+    if (options.enableNewAnalysisDriver) {
+      changes.forEach((file, change) {
+        priorityFileResults.remove(file);
+
+        // Prepare the new contents.
+        String oldContents = fileContentOverlay[file];
+        String newContents;
+        if (change is AddContentOverlay) {
+          newContents = change.content;
+        } else if (change is ChangeContentOverlay) {
+          if (oldContents == null) {
+            // The client may only send a ChangeContentOverlay if there is
+            // already an existing overlay for the source.
+            throw new RequestFailure(new Response(id,
+                error: new RequestError(RequestErrorCode.INVALID_OVERLAY_CHANGE,
+                    'Invalid overlay change')));
+          }
+          try {
+            newContents = SourceEdit.applySequence(oldContents, change.edits);
+          } on RangeError {
+            throw new RequestFailure(new Response(id,
+                error: new RequestError(RequestErrorCode.INVALID_OVERLAY_CHANGE,
+                    'Invalid overlay change')));
+          }
+        } else if (change is RemoveContentOverlay) {
+          newContents = null;
+        } else {
+          // Protocol parsing should have ensured that we never get here.
+          throw new AnalysisException('Illegal change type');
+        }
+
+        fileContentOverlay[file] = newContents;
+
+        driverMap.values.forEach((driver) {
+          driver.changeFile(file);
+        });
+        // TODO(scheglov) implement other cases
+      });
+      return;
+    }
     changes.forEach((file, change) {
       ContextSourcePair contextSource = getContextSourcePair(file);
       Source source = contextSource.source;
@@ -1407,6 +1575,10 @@
    * existing analysis context.
    */
   void updateOptions(List<OptionUpdater> optionUpdaters) {
+    if (options.enableNewAnalysisDriver) {
+      // TODO(scheglov) implement for the new analysis driver
+      return;
+    }
     //
     // Update existing contexts.
     //
@@ -1473,6 +1645,10 @@
     });
   }
 
+  bool _hasAnalysisServiceSubscription(AnalysisService service, String file) {
+    return analysisServices[service]?.contains(file) ?? false;
+  }
+
   _scheduleAnalysisImplementedNotification() async {
     Set<String> files = analysisServices[AnalysisService.IMPLEMENTED];
     if (files != null) {
@@ -1550,6 +1726,7 @@
 class AnalysisServerOptions {
   bool enableIncrementalResolutionApi = false;
   bool enableIncrementalResolutionValidation = false;
+  bool enableNewAnalysisDriver = false;
   bool enablePubSummaryManager = false;
   bool finerGrainedInvalidation = false;
   bool noErrorNotification = false;
@@ -1599,25 +1776,72 @@
   ServerContextManagerCallbacks(this.analysisServer, this.resourceProvider);
 
   @override
+  nd.AnalysisDriver addAnalysisDriver(Folder folder, AnalysisOptions options) {
+    SourceFactory sourceFactory;
+    AnalysisOptions analysisOptions;
+    {
+      ContextBuilder builder = createContextBuilder(folder, options);
+      AnalysisContext context = builder.buildContext(folder.path);
+      sourceFactory = context.sourceFactory;
+      analysisOptions = context.analysisOptions;
+      context.dispose();
+    }
+    nd.AnalysisDriver analysisDriver = new nd.AnalysisDriver(
+        analysisServer.analysisDriverScheduler,
+        analysisServer._analysisPerformanceLogger,
+        resourceProvider,
+        analysisServer.byteStore,
+        analysisServer.fileContentOverlay,
+        sourceFactory,
+        analysisOptions);
+    analysisDriver.name = folder.shortName;
+    analysisDriver.status.listen((status) {
+      // TODO(scheglov) send server status
+    });
+    analysisDriver.results.listen((result) {
+      if (analysisServer.priorityFiles.contains(result.path) &&
+          result.unit != null) {
+        analysisServer.priorityFileResults[result.path] = result;
+      }
+      _runDelayed(() {
+        new_sendErrorNotification(analysisServer, result);
+      });
+      String path = result.path;
+      CompilationUnit unit = result.unit;
+      if (unit != null) {
+        if (analysisServer._hasAnalysisServiceSubscription(
+            AnalysisService.HIGHLIGHTS, path)) {
+          _runDelayed(() {
+            sendAnalysisNotificationHighlights(analysisServer, path, unit);
+          });
+        }
+        if (analysisServer._hasAnalysisServiceSubscription(
+            AnalysisService.NAVIGATION, path)) {
+          _runDelayed(() {
+            new_sendDartNotificationNavigation(analysisServer, result);
+          });
+        }
+        if (analysisServer._hasAnalysisServiceSubscription(
+            AnalysisService.OVERRIDES, path)) {
+          _runDelayed(() {
+            sendAnalysisNotificationOverrides(analysisServer, path, unit);
+          });
+        }
+      }
+      // TODO(scheglov) Implement more notifications.
+      // IMPLEMENTED
+      // OCCURRENCES (not used in IDEA)
+      // OUTLINE (not used in IDEA)
+    });
+    analysisServer.driverMap[folder] = analysisDriver;
+    return analysisDriver;
+  }
+
+  @override
   AnalysisContext addContext(Folder folder, AnalysisOptions options) {
     ContextBuilder builder = createContextBuilder(folder, options);
     AnalysisContext context = builder.buildContext(folder.path);
 
-    // TODO(brianwilkerson) Move bundle discovery into ContextBuilder
-    if (analysisServer.options.enablePubSummaryManager) {
-      List<LinkedPubPackage> linkedBundles =
-          analysisServer.pubSummaryManager.getLinkedBundles(context);
-      if (linkedBundles.isNotEmpty) {
-        SummaryDataStore store = new SummaryDataStore([]);
-        for (LinkedPubPackage package in linkedBundles) {
-          store.addBundle(null, package.unlinked);
-          store.addBundle(null, package.linked);
-        }
-        (context as InternalAnalysisContext).resultProvider =
-            new InputPackagesResultProvider(context, store);
-      }
-    }
-
     analysisServer.folderMap[folder] = context;
     analysisServer._onContextsChangedController
         .add(new ContextsChangedEvent(added: [context]));
@@ -1628,15 +1852,31 @@
 
   @override
   void applyChangesToContext(Folder contextFolder, ChangeSet changeSet) {
-    AnalysisContext context = analysisServer.folderMap[contextFolder];
-    if (context != null) {
-      context.applyChanges(changeSet);
-      analysisServer.schedulePerformAnalysisOperation(context);
-      List<String> flushedFiles = new List<String>();
-      for (Source source in changeSet.removedSources) {
-        flushedFiles.add(source.fullName);
+    if (analysisServer.options.enableNewAnalysisDriver) {
+      nd.AnalysisDriver analysisDriver =
+          analysisServer.driverMap[contextFolder];
+      if (analysisDriver != null) {
+        changeSet.addedSources.forEach((source) {
+          analysisDriver.addFile(source.fullName);
+        });
+        changeSet.changedSources.forEach((source) {
+          analysisDriver.changeFile(source.fullName);
+        });
+        changeSet.removedSources.forEach((source) {
+          analysisDriver.removeFile(source.fullName);
+        });
       }
-      sendAnalysisNotificationFlushResults(analysisServer, flushedFiles);
+    } else {
+      AnalysisContext context = analysisServer.folderMap[contextFolder];
+      if (context != null) {
+        context.applyChanges(changeSet);
+        analysisServer.schedulePerformAnalysisOperation(context);
+        List<String> flushedFiles = new List<String>();
+        for (Source source in changeSet.removedSources) {
+          flushedFiles.add(source.fullName);
+        }
+        sendAnalysisNotificationFlushResults(analysisServer, flushedFiles);
+      }
     }
   }
 
@@ -1661,13 +1901,18 @@
       }
     }
 
+    ContextBuilderOptions builderOptions = new ContextBuilderOptions();
+    builderOptions.defaultOptions = options;
+    builderOptions.defaultPackageFilePath = defaultPackageFilePath;
+    builderOptions.defaultPackagesDirectoryPath = defaultPackagesDirectoryPath;
+    if (analysisServer.options.enablePubSummaryManager) {
+      builderOptions.pubSummaryManager = analysisServer.pubSummaryManager;
+    }
     ContextBuilder builder = new ContextBuilder(resourceProvider,
-        analysisServer.sdkManager, analysisServer.overlayState);
-    builder.defaultOptions = options;
+        analysisServer.sdkManager, analysisServer.overlayState,
+        options: builderOptions);
     builder.fileResolverProvider = analysisServer.fileResolverProvider;
     builder.packageResolverProvider = analysisServer.packageResolverProvider;
-    builder.defaultPackageFilePath = defaultPackageFilePath;
-    builder.defaultPackagesDirectoryPath = defaultPackagesDirectoryPath;
     return builder;
   }
 
@@ -1680,15 +1925,21 @@
 
   @override
   void removeContext(Folder folder, List<String> flushedFiles) {
-    AnalysisContext context = analysisServer.folderMap.remove(folder);
-    sendAnalysisNotificationFlushResults(analysisServer, flushedFiles);
+    if (analysisServer.options.enableNewAnalysisDriver) {
+      sendAnalysisNotificationFlushResults(analysisServer, flushedFiles);
+      nd.AnalysisDriver driver = analysisServer.driverMap.remove(folder);
+      driver.dispose();
+    } else {
+      AnalysisContext context = analysisServer.folderMap.remove(folder);
+      sendAnalysisNotificationFlushResults(analysisServer, flushedFiles);
 
-    analysisServer.operationQueue.contextRemoved(context);
-    analysisServer._onContextsChangedController
-        .add(new ContextsChangedEvent(removed: [context]));
-    analysisServer.sendContextAnalysisDoneNotifications(
-        context, AnalysisDoneReason.CONTEXT_REMOVED);
-    context.dispose();
+      analysisServer.operationQueue.contextRemoved(context);
+      analysisServer._onContextsChangedController
+          .add(new ContextsChangedEvent(removed: [context]));
+      analysisServer.sendContextAnalysisDoneNotifications(
+          context, AnalysisDoneReason.CONTEXT_REMOVED);
+      context.dispose();
+    }
   }
 
   @override
@@ -1697,6 +1948,25 @@
         .add(new ContextsChangedEvent(changed: [context]));
     analysisServer.schedulePerformAnalysisOperation(context);
   }
+
+  /**
+   * Run [f] in a new [Future].
+   *
+   * This method is used to delay sending notifications. If there is a more
+   * important consumer of an analysis results, specifically a code completion
+   * computer, we want it to run before spending time of sending notifications.
+   *
+   * TODO(scheglov) Consider replacing this with full priority based scheduler.
+   *
+   * TODO(scheglov) Alternatively, if code completion work in a way that does
+   * not produce (at first) fully resolved unit, but only part of it - a single
+   * method, or a top-level declaration, we would not have this problem - the
+   * completion computer would be the only consumer of the partial analysis
+   * result.
+   */
+  void _runDelayed(f()) {
+    new Future(f);
+  }
 }
 
 /**
diff --git a/pkg/analysis_server/lib/src/computer/computer_highlights2.dart b/pkg/analysis_server/lib/src/computer/computer_highlights2.dart
index bfc9d66..7d67c26 100644
--- a/pkg/analysis_server/lib/src/computer/computer_highlights2.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_highlights2.dart
@@ -170,7 +170,9 @@
   bool _addIdentifierRegion_field(SimpleIdentifier node) {
     Element element = node.bestElement;
     if (element is FieldFormalParameterElement) {
-      element = (element as FieldFormalParameterElement).field;
+      if (node.parent is FieldFormalParameter) {
+        element = (element as FieldFormalParameterElement).field;
+      }
     }
     // prepare type
     HighlightRegionType type;
diff --git a/pkg/analysis_server/lib/src/computer/new_notifications.dart b/pkg/analysis_server/lib/src/computer/new_notifications.dart
new file mode 100644
index 0000000..b4e3460
--- /dev/null
+++ b/pkg/analysis_server/lib/src/computer/new_notifications.dart
@@ -0,0 +1,35 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol;
+import 'package:analysis_server/src/analysis_server.dart' show AnalysisServer;
+import 'package:analysis_server/src/domains/analysis/navigation.dart';
+import 'package:analysis_server/src/domains/analysis/navigation_dart.dart';
+import 'package:analysis_server/src/protocol_server.dart' as protocol;
+import 'package:analyzer/error/error.dart';
+import 'package:analyzer/src/dart/analysis/driver.dart';
+
+void new_sendDartNotificationNavigation(
+    AnalysisServer analysisServer, AnalysisResult result) {
+  var unit = result.unit;
+  if (unit != null) {
+    NavigationCollectorImpl collector = new NavigationCollectorImpl();
+    computeSimpleDartNavigation(collector, unit);
+    collector.createRegions();
+    var params = new protocol.AnalysisNavigationParams(
+        result.path, collector.regions, collector.targets, collector.files);
+    analysisServer.sendNotification(params.toNotification());
+  }
+}
+
+void new_sendErrorNotification(
+    AnalysisServer analysisServer, AnalysisResult result) {
+  var serverErrors = <protocol.AnalysisError>[];
+  for (AnalysisError error in result.errors) {
+    serverErrors
+        .add(protocol.newAnalysisError_fromEngine(result.lineInfo, error));
+  }
+  var params = new protocol.AnalysisErrorsParams(result.path, serverErrors);
+  analysisServer.sendNotification(params.toNotification());
+}
diff --git a/pkg/analysis_server/lib/src/context_manager.dart b/pkg/analysis_server/lib/src/context_manager.dart
index 66977c4..19737b8 100644
--- a/pkg/analysis_server/lib/src/context_manager.dart
+++ b/pkg/analysis_server/lib/src/context_manager.dart
@@ -16,7 +16,6 @@
 import 'package:analyzer/plugin/options.dart';
 import 'package:analyzer/plugin/resolver_provider.dart';
 import 'package:analyzer/source/analysis_options_provider.dart';
-import 'package:analyzer/source/config.dart';
 import 'package:analyzer/source/package_map_provider.dart';
 import 'package:analyzer/source/package_map_resolver.dart';
 import 'package:analyzer/source/path_filter.dart';
@@ -24,6 +23,7 @@
 import 'package:analyzer/source/sdk_ext.dart';
 import 'package:analyzer/src/context/builder.dart';
 import 'package:analyzer/src/context/context.dart' as context;
+import 'package:analyzer/src/dart/analysis/driver.dart';
 import 'package:analyzer/src/dart/sdk/sdk.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/java_io.dart';
@@ -90,6 +90,11 @@
   Set<String> _dependencies = new Set<String>();
 
   /**
+   * The analysis driver that was created for the [folder].
+   */
+  AnalysisDriver analysisDriver;
+
+  /**
    * The analysis context that was created for the [folder].
    */
   AnalysisContext context;
@@ -246,6 +251,11 @@
   void set callbacks(ContextManagerCallbacks value);
 
   /**
+   * A table mapping [Folder]s to the [AnalysisDriver]s associated with them.
+   */
+  Map<Folder, AnalysisDriver> get driverMap;
+
+  /**
    * Return the list of excluded paths (folders and files) most recently passed
    * to [setRoots].
    */
@@ -321,6 +331,12 @@
  */
 abstract class ContextManagerCallbacks {
   /**
+   * Create and return a new analysis driver rooted at the given [folder], with
+   * the given analysis [options].
+   */
+  AnalysisDriver addAnalysisDriver(Folder folder, AnalysisOptions options);
+
+  /**
    * Create and return a new analysis context rooted at the given [folder], with
    * the given analysis [options].
    */
@@ -460,10 +476,6 @@
    */
   final PubPackageMapProvider _packageMapProvider;
 
-  /// Provider of analysis options.
-  AnalysisOptionsProvider analysisOptionsProvider =
-      new AnalysisOptionsProvider();
-
   /**
    * A list of the globs used to determine which files should be analyzed.
    */
@@ -479,6 +491,8 @@
    */
   final InstrumentationService _instrumentationService;
 
+  final bool enableNewAnalysisDriver;
+
   @override
   ContextManagerCallbacks callbacks;
 
@@ -488,11 +502,14 @@
    */
   final ContextInfo rootInfo = new ContextInfo._root();
 
+  @override
+  final Map<Folder, AnalysisDriver> driverMap =
+      new HashMap<Folder, AnalysisDriver>();
+
   /**
    * A table mapping [Folder]s to the [AnalysisContext]s associated with them.
    */
-  @override
-  final Map<Folder, AnalysisContext> folderMap =
+  final Map<Folder, AnalysisContext> _folderMap =
       new HashMap<Folder, AnalysisContext>();
 
   /**
@@ -509,7 +526,8 @@
       this._packageMapProvider,
       this.analyzedFilesGlobs,
       this._instrumentationService,
-      this.defaultContextOptions) {
+      this.defaultContextOptions,
+      this.enableNewAnalysisDriver) {
     absolutePathContext = resourceProvider.absolutePathContext;
     pathContext = resourceProvider.pathContext;
   }
@@ -517,6 +535,14 @@
   @override
   Iterable<AnalysisContext> get analysisContexts => folderMap.values;
 
+  Map<Folder, AnalysisContext> get folderMap {
+    if (enableNewAnalysisDriver) {
+      throw new StateError('Should not be used with the new analysis driver');
+    } else {
+      return _folderMap;
+    }
+  }
+
   @override
   List<AnalysisContext> contextsInAnalysisRoot(Folder analysisRoot) {
     List<AnalysisContext> contexts = <AnalysisContext>[];
@@ -650,13 +676,82 @@
   }
 
   /**
+   * Process [options] for the given context [info].
+   */
+  void processOptionsForDriver(ContextInfo info, Map<String, Object> options,
+      {bool optionsRemoved: false}) {
+    if (options == null && !optionsRemoved) {
+      return;
+    }
+    AnalysisOptions analysisOptions = info.analysisDriver.analysisOptions;
+
+    // In case options files are removed, revert to defaults.
+    if (optionsRemoved) {
+      // Start with defaults.
+      analysisOptions.resetToDefaults();
+
+      // Apply inherited options.
+      options = _toStringMap(_getEmbeddedOptions(info));
+      if (options != null) {
+        applyToAnalysisOptions(analysisOptions, options);
+      }
+    } else {
+      // Check for embedded options.
+      Map embeddedOptions = _getEmbeddedOptions(info);
+      if (embeddedOptions != null) {
+        options = _toStringMap(new Merger().merge(embeddedOptions, options));
+      }
+    }
+
+    // TODO(brianwilkerson) Figure out what to do here.
+//    // Notify options processors.
+//    AnalysisEngine.instance.optionsPlugin.optionsProcessors
+//        .forEach((OptionsProcessor p) {
+//      try {
+//        p.optionsProcessed(info.context, options);
+//      } catch (e, stacktrace) {
+//        AnalysisEngine.instance.logger.logError(
+//            'Error processing analysis options',
+//            new CaughtException(e, stacktrace));
+//      }
+//    });
+
+    applyToAnalysisOptions(analysisOptions, options);
+
+    // Nothing more to do.
+    if (options == null) {
+      return;
+    }
+
+    var analyzer = options[AnalyzerOptions.analyzer];
+    if (analyzer is Map) {
+      // Set ignore patterns.
+      YamlList exclude = analyzer[AnalyzerOptions.exclude];
+      List<String> excludeList = toStringList(exclude);
+      if (excludeList != null) {
+        setIgnorePatternsForContext(info, excludeList);
+      }
+    }
+  }
+
+  /**
    * Return the options from the analysis options file in the given [folder]
    * if exists, or in one of the parent folders, or `null` if no analysis
    * options file is found or if the contents of the file are not valid YAML.
    */
-  Map<String, Object> readOptions(Folder folder) {
+  Map<String, Object> readOptions(Folder folder, Packages packages) {
     try {
-      return analysisOptionsProvider.getOptions(folder, crawlUp: true);
+      Map<String, List<Folder>> packageMap =
+          new ContextBuilder(resourceProvider, null, null)
+              .convertPackagesToMap(packages);
+      List<UriResolver> resolvers = <UriResolver>[
+        new ResourceUriResolver(resourceProvider),
+        new PackageMapUriResolver(resourceProvider, packageMap),
+      ];
+      SourceFactory sourceFactory =
+          new SourceFactory(resolvers, packages, resourceProvider);
+      return new AnalysisOptionsProvider(sourceFactory)
+          .getOptions(folder, crawlUp: true);
     } catch (_) {
       // Parse errors are reported by GenerateOptionsErrorsTask.
     }
@@ -885,7 +980,8 @@
     if (AnalysisEngine.isAnalysisOptionsFileName(path, pathContext)) {
       var analysisContext = info.context;
       if (analysisContext is context.AnalysisContextImpl) {
-        Map<String, Object> options = readOptions(info.folder);
+        Map<String, Object> options =
+            readOptions(info.folder, info.disposition.packages);
         processOptionsForContext(info, options,
             optionsRemoved: changeType == ChangeType.REMOVE);
         analysisContext.sourceFactory = _createSourceFactory(
@@ -918,20 +1014,31 @@
    * file.)
    */
   List<String> _computeFlushedFiles(ContextInfo info) {
-    AnalysisContext context = info.context;
-    HashSet<String> flushedFiles = new HashSet<String>();
-    for (Source source in context.sources) {
-      flushedFiles.add(source.fullName);
-    }
-    for (ContextInfo contextInfo in rootInfo.descendants) {
-      AnalysisContext contextN = contextInfo.context;
-      if (context != contextN) {
-        for (Source source in contextN.sources) {
-          flushedFiles.remove(source.fullName);
+    if (enableNewAnalysisDriver) {
+      Set<String> flushedFiles = info.analysisDriver.knownFiles.toSet();
+      for (ContextInfo contextInfo in rootInfo.descendants) {
+        AnalysisDriver other = contextInfo.analysisDriver;
+        if (other != info.analysisDriver) {
+          flushedFiles.removeAll(other.knownFiles);
         }
       }
+      return flushedFiles.toList(growable: false);
+    } else {
+      AnalysisContext context = info.context;
+      HashSet<String> flushedFiles = new HashSet<String>();
+      for (Source source in context.sources) {
+        flushedFiles.add(source.fullName);
+      }
+      for (ContextInfo contextInfo in rootInfo.descendants) {
+        AnalysisContext contextN = contextInfo.context;
+        if (context != contextN) {
+          for (Source source in contextN.sources) {
+            flushedFiles.remove(source.fullName);
+          }
+        }
+      }
+      return flushedFiles.toList(growable: false);
     }
-    return flushedFiles.toList(growable: false);
   }
 
   /**
@@ -1027,15 +1134,20 @@
     ContextInfo info = new ContextInfo(this, parent, folder, packagespecFile,
         normalizedPackageRoots[folder.path], disposition);
 
-    Map<String, Object> optionMap = readOptions(info.folder);
+    Map<String, Object> optionMap =
+        readOptions(info.folder, disposition.packages);
     AnalysisOptions options =
         new AnalysisOptionsImpl.from(defaultContextOptions);
     applyToAnalysisOptions(options, optionMap);
 
     info.setDependencies(dependencies);
-    info.context = callbacks.addContext(folder, options);
-    folderMap[folder] = info.context;
-    info.context.name = folder.path;
+    if (enableNewAnalysisDriver) {
+      info.analysisDriver = callbacks.addAnalysisDriver(folder, options);
+    } else {
+      info.context = callbacks.addContext(folder, options);
+      _folderMap[folder] = info.context;
+      info.context.name = folder.path;
+    }
 
     // Look for pubspec-specified analysis configuration.
     File pubspec;
@@ -1050,15 +1162,12 @@
         pubspec = child;
       }
     }
-    if (pubspec != null) {
-      File pubSource = resourceProvider.getFile(pubspec.path);
-      setConfiguration(
-          info.context,
-          new AnalysisConfiguration.fromPubspec(
-              pubSource, resourceProvider, disposition.packages));
-    }
 
-    processOptionsForContext(info, optionMap);
+    if (enableNewAnalysisDriver) {
+      processOptionsForDriver(info, optionMap);
+    } else {
+      processOptionsForContext(info, optionMap);
+    }
 
     return info;
   }
@@ -1210,18 +1319,6 @@
     if (maps.length == 1) {
       embeddedOptions = maps.first;
     }
-
-    AnalysisConfiguration configuration = getConfiguration(info.context);
-    if (configuration != null) {
-      Map configMap = configuration.options;
-      if (configMap != null) {
-        if (embeddedOptions != null) {
-          embeddedOptions = new Merger().merge(embeddedOptions, configMap);
-        } else {
-          embeddedOptions = configMap;
-        }
-      }
-    }
     return embeddedOptions;
   }
 
@@ -1336,11 +1433,15 @@
         if (resource is File) {
           File file = resource;
           if (_shouldFileBeAnalyzed(file)) {
-            ChangeSet changeSet = new ChangeSet();
-            Source source = createSourceInContext(info.context, file);
-            changeSet.addedSource(source);
-            callbacks.applyChangesToContext(info.folder, changeSet);
-            info.sources[path] = source;
+            if (enableNewAnalysisDriver) {
+              info.analysisDriver.addFile(path);
+            } else {
+              ChangeSet changeSet = new ChangeSet();
+              Source source = createSourceInContext(info.context, file);
+              changeSet.addedSource(source);
+              callbacks.applyChangesToContext(info.folder, changeSet);
+              info.sources[path] = source;
+            }
           }
         }
         break;
@@ -1377,24 +1478,34 @@
           }
         }
 
-        List<Source> sources = info.context.getSourcesWithFullName(path);
-        if (!sources.isEmpty) {
-          ChangeSet changeSet = new ChangeSet();
-          sources.forEach((Source source) {
-            changeSet.removedSource(source);
-          });
-          callbacks.applyChangesToContext(info.folder, changeSet);
-          info.sources.remove(path);
+        if (enableNewAnalysisDriver) {
+          info.analysisDriver.removeFile(path);
+        } else {
+          List<Source> sources = info.context.getSourcesWithFullName(path);
+          if (!sources.isEmpty) {
+            ChangeSet changeSet = new ChangeSet();
+            sources.forEach((Source source) {
+              changeSet.removedSource(source);
+            });
+            callbacks.applyChangesToContext(info.folder, changeSet);
+            info.sources.remove(path);
+          }
         }
         break;
       case ChangeType.MODIFY:
-        List<Source> sources = info.context.getSourcesWithFullName(path);
-        if (!sources.isEmpty) {
-          ChangeSet changeSet = new ChangeSet();
-          sources.forEach((Source source) {
-            changeSet.changedSource(source);
-          });
-          callbacks.applyChangesToContext(info.folder, changeSet);
+        if (enableNewAnalysisDriver) {
+          for (AnalysisDriver driver in driverMap.values) {
+            driver.changeFile(path);
+          }
+        } else {
+          List<Source> sources = info.context.getSourcesWithFullName(path);
+          if (!sources.isEmpty) {
+            ChangeSet changeSet = new ChangeSet();
+            sources.forEach((Source source) {
+              changeSet.changedSource(source);
+            });
+            callbacks.applyChangesToContext(info.folder, changeSet);
+          }
         }
         break;
     }
diff --git a/pkg/analysis_server/lib/src/domain_analysis.dart b/pkg/analysis_server/lib/src/domain_analysis.dart
index 1c00252..499fd99 100644
--- a/pkg/analysis_server/lib/src/domain_analysis.dart
+++ b/pkg/analysis_server/lib/src/domain_analysis.dart
@@ -23,6 +23,7 @@
 import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer/exception/exception.dart';
 import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/src/dart/analysis/driver.dart';
 import 'package:analyzer/src/generated/engine.dart' as engine;
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/task/model.dart' show ResultDescriptor;
@@ -85,22 +86,31 @@
   /**
    * Implement the `analysis.getHover` request.
    */
-  Response getHover(Request request) {
-    // prepare parameters
+  Future<Null> getHover(Request request) async {
     var params = new AnalysisGetHoverParams.fromRequest(request);
-    // prepare hovers
+
+    // Prepare the resolved units.
+    CompilationUnit unit;
+    if (server.options.enableNewAnalysisDriver) {
+      AnalysisResult result = await server.getAnalysisResult(params.file);
+      unit = result?.unit;
+    } else {
+      unit = await server.getResolvedCompilationUnit(params.file);
+    }
+
+    // Prepare the hovers.
     List<HoverInformation> hovers = <HoverInformation>[];
-    List<CompilationUnit> units =
-        server.getResolvedCompilationUnits(params.file);
-    for (CompilationUnit unit in units) {
+    if (unit != null) {
       HoverInformation hoverInformation =
           new DartUnitHoverComputer(unit, params.offset).compute();
       if (hoverInformation != null) {
         hovers.add(hoverInformation);
       }
     }
-    // send response
-    return new AnalysisGetHoverResult(hovers).toResponse(request.id);
+
+    // Send the response.
+    server.sendResponse(
+        new AnalysisGetHoverResult(hovers).toResponse(request.id));
   }
 
   /// Implement the `analysis.getLibraryDependencies` request.
@@ -123,6 +133,10 @@
    * Implement the `analysis.getNavigation` request.
    */
   Response getNavigation(Request request) {
+    if (server.options.enableNewAnalysisDriver) {
+      // TODO(scheglov) implement for the new analysis driver
+      return new Response.getNavigationInvalidFile(request);
+    }
     var params = new AnalysisGetNavigationParams.fromRequest(request);
     String file = params.file;
     Future<AnalysisDoneReason> analysisFuture =
@@ -130,15 +144,14 @@
     if (analysisFuture == null) {
       return new Response.getNavigationInvalidFile(request);
     }
-    analysisFuture.then((AnalysisDoneReason reason) {
+    analysisFuture.then((AnalysisDoneReason reason) async {
       switch (reason) {
         case AnalysisDoneReason.COMPLETE:
-          List<CompilationUnit> units =
-              server.getResolvedCompilationUnits(file);
-          if (units.isEmpty) {
+          CompilationUnit unit = await server.getResolvedCompilationUnit(file);
+          if (unit == null) {
             server.sendResponse(new Response.getNavigationInvalidFile(request));
           } else {
-            CompilationUnitElement unitElement = units.first.element;
+            CompilationUnitElement unitElement = unit.element;
             NavigationCollectorImpl collector = computeNavigation(
                 server,
                 unitElement.context,
@@ -187,7 +200,8 @@
       if (requestName == ANALYSIS_GET_ERRORS) {
         return getErrors(request);
       } else if (requestName == ANALYSIS_GET_HOVER) {
-        return getHover(request);
+        getHover(request);
+        return Response.DELAYED_RESPONSE;
       } else if (requestName == ANALYSIS_GET_LIBRARY_DEPENDENCIES) {
         return getLibraryDependencies(request);
       } else if (requestName == ANALYSIS_GET_NAVIGATION) {
diff --git a/pkg/analysis_server/lib/src/domain_completion.dart b/pkg/analysis_server/lib/src/domain_completion.dart
index f9ea745..6bad443 100644
--- a/pkg/analysis_server/lib/src/domain_completion.dart
+++ b/pkg/analysis_server/lib/src/domain_completion.dart
@@ -12,7 +12,9 @@
 import 'package:analysis_server/src/provisional/completion/completion_core.dart';
 import 'package:analysis_server/src/services/completion/completion_core.dart';
 import 'package:analysis_server/src/services/completion/completion_performance.dart';
-import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/dart/analysis/driver.dart';
+import 'package:analyzer/src/generated/engine.dart' hide AnalysisResult;
+import 'package:analyzer/src/source/source_resource.dart';
 import 'package:analyzer/src/generated/source.dart';
 
 /**
@@ -106,13 +108,10 @@
       return new Response.noIndexGenerated(request);
     }
     return runZoned(() {
-      try {
-        String requestName = request.method;
-        if (requestName == COMPLETION_GET_SUGGESTIONS) {
-          return processRequest(request);
-        }
-      } on RequestFailure catch (exception) {
-        return exception.response;
+      String requestName = request.method;
+      if (requestName == COMPLETION_GET_SUGGESTIONS) {
+        processRequest(request);
+        return Response.DELAYED_RESPONSE;
       }
       return null;
     }, onError: (exception, stackTrace) {
@@ -126,30 +125,61 @@
   /**
    * Process a `completion.getSuggestions` request.
    */
-  Response processRequest(Request request) {
+  Future<Null> processRequest(Request request) async {
     performance = new CompletionPerformance();
 
     // extract and validate params
     CompletionGetSuggestionsParams params =
         new CompletionGetSuggestionsParams.fromRequest(request);
-    ContextSourcePair contextSource = server.getContextSourcePair(params.file);
-    AnalysisContext context = contextSource.context;
-    Source source = contextSource.source;
-    if (context == null || !context.exists(source)) {
-      return new Response.unknownSource(request);
-    }
-    TimestampedData<String> contents = context.getContents(source);
-    if (params.offset < 0 || params.offset > contents.data.length) {
-      return new Response.invalidParameter(
-          request,
-          'params.offset',
-          'Expected offset between 0 and source length inclusive,'
-          ' but found ${params.offset}');
+
+    AnalysisResult result;
+    AnalysisContext context;
+    Source source;
+    if (server.options.enableNewAnalysisDriver) {
+      result = await server.getAnalysisResult(params.file);
+
+      if (result == null) {
+        server.sendResponse(new Response.unknownSource(request));
+        return;
+      }
+
+      if (params.offset < 0 || params.offset > result.content.length) {
+        server.sendResponse(new Response.invalidParameter(
+            request,
+            'params.offset',
+            'Expected offset between 0 and source length inclusive,'
+            ' but found ${params.offset}'));
+        return;
+      }
+
+      source = new FileSource(
+          server.resourceProvider.getFile(result.path), result.uri);
+    } else {
+      ContextSourcePair contextSource =
+          server.getContextSourcePair(params.file);
+
+      context = contextSource.context;
+      source = contextSource.source;
+      if (context == null || !context.exists(source)) {
+        server.sendResponse(new Response.unknownSource(request));
+        return;
+      }
+
+      TimestampedData<String> contents = context.getContents(source);
+      if (params.offset < 0 || params.offset > contents.data.length) {
+        server.sendResponse(new Response.invalidParameter(
+            request,
+            'params.offset',
+            'Expected offset between 0 and source length inclusive,'
+            ' but found ${params.offset}'));
+        return;
+      }
     }
 
     recordRequest(performance, context, source, params.offset);
 
     CompletionRequestImpl completionRequest = new CompletionRequestImpl(
+        result,
         context,
         server.resourceProvider,
         server.searchEngine,
@@ -161,6 +191,10 @@
     _abortCurrentRequest();
     _currentRequest = completionRequest;
 
+    // initial response without results
+    server.sendResponse(new CompletionGetSuggestionsResult(completionId)
+        .toResponse(request.id));
+
     // Compute suggestions in the background
     computeSuggestions(completionRequest).then((CompletionResult result) {
       const SEND_NOTIFICATION_TAG = 'send notification';
@@ -179,10 +213,6 @@
         _currentRequest = null;
       }
     });
-
-    // initial response without results
-    return new CompletionGetSuggestionsResult(completionId)
-        .toResponse(request.id);
   }
 
   /**
diff --git a/pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart b/pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart
index 7a7a870..1ae3193 100644
--- a/pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart
+++ b/pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart
@@ -15,6 +15,16 @@
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source.dart';
 
+NavigationCollector computeSimpleDartNavigation(
+    NavigationCollector collector, CompilationUnit unit) {
+  _DartNavigationCollector dartCollector =
+      new _DartNavigationCollector(collector);
+  _DartNavigationComputerVisitor visitor =
+      new _DartNavigationComputerVisitor(dartCollector);
+  unit.accept(visitor);
+  return collector;
+}
+
 /**
  * A computer for navigation regions in a Dart [CompilationUnit].
  */
diff --git a/pkg/analysis_server/lib/src/edit/edit_domain.dart b/pkg/analysis_server/lib/src/edit/edit_domain.dart
index 44e9ea7..1cde3a7 100644
--- a/pkg/analysis_server/lib/src/edit/edit_domain.dart
+++ b/pkg/analysis_server/lib/src/edit/edit_domain.dart
@@ -7,13 +7,17 @@
 import 'dart:async';
 
 import 'package:analysis_server/plugin/edit/assist/assist_core.dart';
+import 'package:analysis_server/plugin/edit/assist/assist_dart.dart';
 import 'package:analysis_server/plugin/edit/fix/fix_core.dart';
+import 'package:analysis_server/plugin/edit/fix/fix_dart.dart';
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/collections.dart';
 import 'package:analysis_server/src/constants.dart';
 import 'package:analysis_server/src/protocol_server.dart' hide Element;
 import 'package:analysis_server/src/services/correction/assist.dart';
+import 'package:analysis_server/src/services/correction/assist_internal.dart';
 import 'package:analysis_server/src/services/correction/fix.dart';
+import 'package:analysis_server/src/services/correction/fix_internal.dart';
 import 'package:analysis_server/src/services/correction/organize_directives.dart';
 import 'package:analysis_server/src/services/correction/sort_members.dart';
 import 'package:analysis_server/src/services/correction/status.dart';
@@ -22,6 +26,8 @@
 import 'package:analyzer/dart/ast/ast.dart';
 import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer/error/error.dart' as engine;
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/src/dart/analysis/driver.dart';
 import 'package:analyzer/src/dart/scanner/scanner.dart' as engine;
 import 'package:analyzer/src/error/codes.dart' as engine;
 import 'package:analyzer/src/generated/engine.dart' as engine;
@@ -69,23 +75,19 @@
     EditFormatParams params = new EditFormatParams.fromRequest(request);
     String file = params.file;
 
-    ContextSourcePair contextSource = server.getContextSourcePair(file);
-
-    engine.AnalysisContext context = contextSource.context;
-    if (context == null) {
-      return new Response.formatInvalidFile(request);
-    }
-
-    Source source = contextSource.source;
-    engine.TimestampedData<String> contents;
+    String unformattedSource;
     try {
-      contents = context.getContents(source);
+      Source source = server.resourceProvider.getFile(file).createSource();
+      if (server.options.enableNewAnalysisDriver) {
+        unformattedSource = server.fileContentOverlay[file];
+      } else {
+        unformattedSource = server.overlayState.getContents(source);
+      }
+      unformattedSource ??= source.contents.data;
     } catch (e) {
       return new Response.formatInvalidFile(request);
     }
 
-    String unformattedSource = contents.data;
-
     int start = params.selectionOffset;
     int length = params.selectionLength;
 
@@ -136,33 +138,78 @@
 
   Future getAssists(Request request) async {
     EditGetAssistsParams params = new EditGetAssistsParams.fromRequest(request);
-    ContextSourcePair pair = server.getContextSourcePair(params.file);
-    engine.AnalysisContext context = pair.context;
-    Source source = pair.source;
-    List<SourceChange> changes = <SourceChange>[];
-    if (context != null && source != null) {
-      List<Assist> assists = await computeAssists(
-          server.serverPlugin, context, source, params.offset, params.length);
-      assists.forEach((Assist assist) {
-        changes.add(assist.change);
-      });
+    List<Assist> assists;
+    if (server.options.enableNewAnalysisDriver) {
+      AnalysisResult result = await server.getAnalysisResult(params.file);
+      if (result != null) {
+        CompilationUnit unit = result.unit;
+        DartAssistContext dartAssistContext = new _DartAssistContextForValues(
+            unit.element.source,
+            params.offset,
+            params.length,
+            unit.element.context,
+            unit);
+        try {
+          AssistProcessor processor = new AssistProcessor(dartAssistContext);
+          assists = await processor.compute();
+        } catch (_) {}
+      }
+    } else {
+      ContextSourcePair pair = server.getContextSourcePair(params.file);
+      engine.AnalysisContext context = pair.context;
+      Source source = pair.source;
+      if (context != null && source != null) {
+        assists = await computeAssists(
+            server.serverPlugin, context, source, params.offset, params.length);
+      }
     }
+    // Send the assist changes.
+    List<SourceChange> changes = <SourceChange>[];
+    assists?.forEach((Assist assist) {
+      changes.add(assist.change);
+    });
     Response response =
         new EditGetAssistsResult(changes).toResponse(request.id);
     server.sendResponse(response);
   }
 
-  getFixes(Request request) async {
+  Future getFixes(Request request) async {
     var params = new EditGetFixesParams.fromRequest(request);
     String file = params.file;
     int offset = params.offset;
-    // add fixes
+
     List<AnalysisErrorFixes> errorFixesList = <AnalysisErrorFixes>[];
-    List<CompilationUnit> units = server.getResolvedCompilationUnits(file);
-    for (CompilationUnit unit in units) {
+    if (server.options.enableNewAnalysisDriver) {
+      AnalysisResult result = await server.getAnalysisResult(file);
+      if (result != null) {
+        CompilationUnit unit = result.unit;
+        LineInfo lineInfo = result.lineInfo;
+        int requestLine = lineInfo.getLocation(offset).lineNumber;
+        for (engine.AnalysisError error in result.errors) {
+          int errorLine = lineInfo.getLocation(error.offset).lineNumber;
+          if (errorLine == requestLine) {
+            var context = new _DartFixContextImpl(
+                server.resourceProvider, unit.element.context, unit, error);
+            List<Fix> fixes =
+                await new DefaultFixContributor().internalComputeFixes(context);
+            if (fixes.isNotEmpty) {
+              AnalysisError serverError =
+                  newAnalysisError_fromEngine(lineInfo, error);
+              AnalysisErrorFixes errorFixes =
+                  new AnalysisErrorFixes(serverError);
+              errorFixesList.add(errorFixes);
+              fixes.forEach((fix) {
+                errorFixes.fixes.add(fix.change);
+              });
+            }
+          }
+        }
+      }
+    } else {
+      CompilationUnit unit = await server.getResolvedCompilationUnit(file);
       engine.AnalysisErrorInfo errorInfo = server.getErrors(file);
-      if (errorInfo != null) {
-        LineInfo lineInfo = errorInfo.lineInfo;
+      LineInfo lineInfo = errorInfo?.lineInfo;
+      if (unit != null && errorInfo != null && lineInfo != null) {
         int requestLine = lineInfo.getLocation(offset).lineNumber;
         for (engine.AnalysisError error in errorInfo.errors) {
           int errorLine = lineInfo.getLocation(error.offset).lineNumber;
@@ -183,8 +230,9 @@
         }
       }
     }
-    // respond
-    return server.sendResponse(
+
+    // Send the response.
+    server.sendResponse(
         new EditGetFixesResult(errorFixesList).toResponse(request.id));
   }
 
@@ -205,9 +253,11 @@
       } else if (requestName == EDIT_GET_REFACTORING) {
         return _getRefactoring(request);
       } else if (requestName == EDIT_ORGANIZE_DIRECTIVES) {
-        return organizeDirectives(request);
+        organizeDirectives(request);
+        return Response.DELAYED_RESPONSE;
       } else if (requestName == EDIT_SORT_MEMBERS) {
-        return sortMembers(request);
+        sortMembers(request);
+        return Response.DELAYED_RESPONSE;
       }
     } on RequestFailure catch (exception) {
       return exception.response;
@@ -215,72 +265,118 @@
     return null;
   }
 
-  Response organizeDirectives(Request request) {
+  Future<Null> organizeDirectives(Request request) async {
     var params = new EditOrganizeDirectivesParams.fromRequest(request);
     // prepare file
     String file = params.file;
     if (!engine.AnalysisEngine.isDartFileName(file)) {
-      return new Response.fileNotAnalyzed(request, file);
+      server.sendResponse(new Response.fileNotAnalyzed(request, file));
+      return;
     }
-    // prepare resolved units
-    List<CompilationUnit> units = server.getResolvedCompilationUnits(file);
-    if (units.isEmpty) {
-      return new Response.fileNotAnalyzed(request, file);
+    // Prepare the file information.
+    int fileStamp;
+    String code;
+    CompilationUnit unit;
+    List<engine.AnalysisError> errors;
+    if (server.options.enableNewAnalysisDriver) {
+      AnalysisResult result = await server.getAnalysisResult(file);
+      if (result == null) {
+        server.sendResponse(new Response.fileNotAnalyzed(request, file));
+        return;
+      }
+      fileStamp = -1;
+      code = result.content;
+      unit = result.unit;
+      errors = result.errors;
+    } else {
+      // prepare resolved unit
+      unit = await server.getResolvedCompilationUnit(file);
+      if (unit == null) {
+        server.sendResponse(new Response.fileNotAnalyzed(request, file));
+        return;
+      }
+      // prepare context
+      engine.AnalysisContext context = unit.element.context;
+      Source source = unit.element.source;
+      errors = context.computeErrors(source);
+      // prepare code
+      fileStamp = context.getModificationStamp(source);
+      code = context.getContents(source).data;
     }
-    // prepare context
-    CompilationUnit unit = units.first;
-    engine.AnalysisContext context = unit.element.context;
-    Source source = unit.element.source;
-    List<engine.AnalysisError> errors = context.computeErrors(source);
     // check if there are scan/parse errors in the file
     int numScanParseErrors = _getNumberOfScanParseErrors(errors);
     if (numScanParseErrors != 0) {
-      return new Response.organizeDirectivesError(
-          request, 'File has $numScanParseErrors scan/parse errors.');
+      server.sendResponse(new Response.organizeDirectivesError(
+          request, 'File has $numScanParseErrors scan/parse errors.'));
+      return;
     }
     // do organize
-    int fileStamp = context.getModificationStamp(source);
-    String code = context.getContents(source).data;
     DirectiveOrganizer sorter = new DirectiveOrganizer(code, unit, errors);
     List<SourceEdit> edits = sorter.organize();
     SourceFileEdit fileEdit = new SourceFileEdit(file, fileStamp, edits: edits);
-    return new EditOrganizeDirectivesResult(fileEdit).toResponse(request.id);
+    server.sendResponse(
+        new EditOrganizeDirectivesResult(fileEdit).toResponse(request.id));
   }
 
-  Response sortMembers(Request request) {
+  Future<Null> sortMembers(Request request) async {
     var params = new EditSortMembersParams.fromRequest(request);
     // prepare file
     String file = params.file;
     if (!engine.AnalysisEngine.isDartFileName(file)) {
-      return new Response.sortMembersInvalidFile(request);
+      server.sendResponse(new Response.sortMembersInvalidFile(request));
+      return;
     }
-    // prepare location
-    ContextSourcePair contextSource = server.getContextSourcePair(file);
-    engine.AnalysisContext context = contextSource.context;
-    Source source = contextSource.source;
-    if (context == null || source == null) {
-      return new Response.sortMembersInvalidFile(request);
-    }
-    // prepare parsed unit
+    // Prepare the file information.
+    int fileStamp;
+    String code;
     CompilationUnit unit;
-    try {
-      unit = context.parseCompilationUnit(source);
-    } catch (e) {
-      return new Response.sortMembersInvalidFile(request);
+    List<engine.AnalysisError> errors;
+    if (server.options.enableNewAnalysisDriver) {
+      AnalysisDriver driver = server.getAnalysisDriver(file);
+      ParseResult result = await driver.parseFile(file);
+      if (result == null) {
+        server.sendResponse(new Response.fileNotAnalyzed(request, file));
+        return;
+      }
+      fileStamp = -1;
+      code = result.content;
+      unit = result.unit;
+      errors = result.errors;
+    } else {
+      // prepare location
+      ContextSourcePair contextSource = server.getContextSourcePair(file);
+      engine.AnalysisContext context = contextSource.context;
+      Source source = contextSource.source;
+      if (context == null || source == null) {
+        server.sendResponse(new Response.sortMembersInvalidFile(request));
+        return;
+      }
+      // prepare code
+      fileStamp = context.getModificationStamp(source);
+      code = context.getContents(source).data;
+      // prepare parsed unit
+      try {
+        unit = context.parseCompilationUnit(source);
+      } catch (e) {
+        server.sendResponse(new Response.sortMembersInvalidFile(request));
+        return;
+      }
+      // Get the errors.
+      errors = context.getErrors(source).errors;
     }
-    // check if there are scan/parse errors in the file
-    engine.AnalysisErrorInfo errors = context.getErrors(source);
-    int numScanParseErrors = _getNumberOfScanParseErrors(errors.errors);
+    // Check if there are scan/parse errors in the file.
+    int numScanParseErrors = _getNumberOfScanParseErrors(errors);
     if (numScanParseErrors != 0) {
-      return new Response.sortMembersParseErrors(request, numScanParseErrors);
+      server.sendResponse(
+          new Response.sortMembersParseErrors(request, numScanParseErrors));
+      return;
     }
-    // do sort
-    int fileStamp = context.getModificationStamp(source);
-    String code = context.getContents(source).data;
+    // Do sort.
     MemberSorter sorter = new MemberSorter(code, unit);
     List<SourceEdit> edits = sorter.sort();
     SourceFileEdit fileEdit = new SourceFileEdit(file, fileStamp, edits: edits);
-    return new EditSortMembersResult(fileEdit).toResponse(request.id);
+    server.sendResponse(
+        new EditSortMembersResult(fileEdit).toResponse(request.id));
   }
 
   Response _getAvailableRefactorings(Request request) {
@@ -306,9 +402,8 @@
     }
     // check elements
     {
-      List<Element> elements = server.getElementsAtOffset(file, offset);
-      if (elements.isNotEmpty) {
-        Element element = elements[0];
+      Element element = await server.getElementAtOffset(file, offset);
+      if (element != null) {
         // try CONVERT_METHOD_TO_GETTER
         if (element is ExecutableElement) {
           Refactoring refactoring =
@@ -365,6 +460,50 @@
 }
 
 /**
+ * Implementation of [DartAssistContext] that is based on the values passed
+ * in the constructor, as opposite to be partially based on [AssistContext].
+ */
+class _DartAssistContextForValues implements DartAssistContext {
+  @override
+  final Source source;
+
+  @override
+  final int selectionOffset;
+
+  @override
+  final int selectionLength;
+
+  @override
+  final engine.AnalysisContext analysisContext;
+
+  @override
+  final CompilationUnit unit;
+
+  _DartAssistContextForValues(this.source, this.selectionOffset,
+      this.selectionLength, this.analysisContext, this.unit);
+}
+
+/**
+ * And implementation of [DartFixContext].
+ */
+class _DartFixContextImpl implements DartFixContext {
+  @override
+  final ResourceProvider resourceProvider;
+
+  @override
+  final engine.AnalysisContext analysisContext;
+
+  @override
+  final CompilationUnit unit;
+
+  @override
+  final engine.AnalysisError error;
+
+  _DartFixContextImpl(
+      this.resourceProvider, this.analysisContext, this.unit, this.error);
+}
+
+/**
  * An object managing a single [Refactoring] instance.
  *
  * The instance is identified by its kind, file, offset and length.
@@ -500,6 +639,9 @@
    * [kind] in the given [file].
    */
   Future<Null> _analyzeForRefactoring(String file, RefactoringKind kind) async {
+    if (server.options.enableNewAnalysisDriver) {
+      return;
+    }
     // "Extract Local" and "Inline Local" refactorings need only local analysis.
     if (kind == RefactoringKind.EXTRACT_LOCAL_VARIABLE ||
         kind == RefactoringKind.INLINE_LOCAL_VARIABLE) {
@@ -570,9 +712,8 @@
     }
     // create a new Refactoring instance
     if (kind == RefactoringKind.CONVERT_GETTER_TO_METHOD) {
-      List<Element> elements = server.getElementsAtOffset(file, offset);
-      if (elements.isNotEmpty) {
-        Element element = elements[0];
+      Element element = await server.getElementAtOffset(file, offset);
+      if (element != null) {
         if (element is ExecutableElement) {
           _resetOnAnalysisStarted();
           refactoring =
@@ -581,9 +722,8 @@
       }
     }
     if (kind == RefactoringKind.CONVERT_METHOD_TO_GETTER) {
-      List<Element> elements = server.getElementsAtOffset(file, offset);
-      if (elements.isNotEmpty) {
-        Element element = elements[0];
+      Element element = await server.getElementAtOffset(file, offset);
+      if (element != null) {
         if (element is ExecutableElement) {
           _resetOnAnalysisStarted();
           refactoring =
@@ -592,10 +732,10 @@
       }
     }
     if (kind == RefactoringKind.EXTRACT_LOCAL_VARIABLE) {
-      List<CompilationUnit> units = server.getResolvedCompilationUnits(file);
-      if (units.isNotEmpty) {
+      CompilationUnit unit = await server.getResolvedCompilationUnit(file);
+      if (unit != null) {
         _resetOnFileResolutionChanged(file);
-        refactoring = new ExtractLocalRefactoring(units[0], offset, length);
+        refactoring = new ExtractLocalRefactoring(unit, offset, length);
         feedback = new ExtractLocalVariableFeedback(
             <String>[], <int>[], <int>[],
             coveringExpressionOffsets: <int>[],
@@ -603,29 +743,31 @@
       }
     }
     if (kind == RefactoringKind.EXTRACT_METHOD) {
-      List<CompilationUnit> units = server.getResolvedCompilationUnits(file);
-      if (units.isNotEmpty) {
+      CompilationUnit unit = await server.getResolvedCompilationUnit(file);
+      if (unit != null) {
         _resetOnAnalysisStarted();
-        refactoring = new ExtractMethodRefactoring(
-            searchEngine, units[0], offset, length);
+        refactoring =
+            new ExtractMethodRefactoring(searchEngine, unit, offset, length);
         feedback = new ExtractMethodFeedback(offset, length, '', <String>[],
             false, <RefactoringMethodParameter>[], <int>[], <int>[]);
       }
     }
     if (kind == RefactoringKind.INLINE_LOCAL_VARIABLE) {
-      List<CompilationUnit> units = server.getResolvedCompilationUnits(file);
-      if (units.isNotEmpty) {
+      CompilationUnit unit = await server.getResolvedCompilationUnit(file);
+      if (unit != null) {
         _resetOnFileResolutionChanged(file);
-        refactoring =
-            new InlineLocalRefactoring(searchEngine, units[0], offset);
+        refactoring = new InlineLocalRefactoring(searchEngine, unit, offset);
       }
     }
     if (kind == RefactoringKind.INLINE_METHOD) {
-      List<CompilationUnit> units = server.getResolvedCompilationUnits(file);
-      if (units.isNotEmpty) {
+      CompilationUnit unit = await server.getResolvedCompilationUnit(file);
+      if (unit != null) {
         _resetOnAnalysisStarted();
         refactoring =
-            new InlineMethodRefactoring(searchEngine, units[0], offset);
+            new InlineMethodRefactoring(searchEngine, (Element element) async {
+          String elementPath = element.source.fullName;
+          return await server.getResolvedCompilationUnit(elementPath);
+        }, unit, offset);
       }
     }
     if (kind == RefactoringKind.MOVE_FILE) {
@@ -637,11 +779,9 @@
           server.resourceProvider, searchEngine, context, source, file);
     }
     if (kind == RefactoringKind.RENAME) {
-      List<AstNode> nodes = server.getNodesAtOffset(file, offset);
-      List<Element> elements = server.getElementsOfNodes(nodes);
-      if (nodes.isNotEmpty && elements.isNotEmpty) {
-        AstNode node = nodes[0];
-        Element element = elements[0];
+      AstNode node = await server.getNodeAtOffset(file, offset);
+      Element element = server.getElementOfNode(node);
+      if (node != null && element != null) {
         if (element is FieldFormalParameterElement) {
           element = (element as FieldFormalParameterElement).field;
         }
@@ -735,6 +875,9 @@
    * But when any other file is changed or analyzed, we can continue.
    */
   void _resetOnFileResolutionChanged(String file) {
+    if (server.options.enableNewAnalysisDriver) {
+      return;
+    }
     subscriptionToReset?.cancel();
     subscriptionToReset = server
         .getAnalysisContext(file)
diff --git a/pkg/analysis_server/lib/src/operation/operation_analysis.dart b/pkg/analysis_server/lib/src/operation/operation_analysis.dart
index dd72b49..0c4c85f 100644
--- a/pkg/analysis_server/lib/src/operation/operation_analysis.dart
+++ b/pkg/analysis_server/lib/src/operation/operation_analysis.dart
@@ -35,7 +35,7 @@
       context.isActive = false;
     }
   } else {
-    f();
+    return f();
   }
 }
 
diff --git a/pkg/analysis_server/lib/src/protocol_server.dart b/pkg/analysis_server/lib/src/protocol_server.dart
index 300f7a0..3b61ade 100644
--- a/pkg/analysis_server/lib/src/protocol_server.dart
+++ b/pkg/analysis_server/lib/src/protocol_server.dart
@@ -13,12 +13,12 @@
 import 'package:analyzer/dart/ast/visitor.dart' as engine;
 import 'package:analyzer/dart/element/element.dart' as engine;
 import 'package:analyzer/dart/element/type.dart' as engine;
+import 'package:analyzer/error/error.dart' as engine;
 import 'package:analyzer/exception/exception.dart';
 import 'package:analyzer/source/error_processor.dart';
 import 'package:analyzer/src/dart/ast/utilities.dart' as engine;
-import 'package:analyzer/src/generated/engine.dart' as engine;
-import 'package:analyzer/error/error.dart' as engine;
 import 'package:analyzer/src/error/codes.dart' as engine;
+import 'package:analyzer/src/generated/engine.dart' as engine;
 import 'package:analyzer/src/generated/source.dart' as engine;
 import 'package:analyzer/src/generated/utilities_dart.dart' as engine;
 
@@ -52,23 +52,22 @@
 }
 
 /**
- * Adds [edit] to the [FileEdit] for the given [element].
+ * Adds [edit] to the file containing the given [element].
  */
 void doSourceChange_addElementEdit(
     SourceChange change, engine.Element element, SourceEdit edit) {
-  engine.AnalysisContext context = element.context;
   engine.Source source = element.source;
-  doSourceChange_addSourceEdit(change, context, source, edit);
+  doSourceChange_addSourceEdit(change, source, edit);
 }
 
 /**
- * Adds [edit] to the [FileEdit] for the given [source].
+ * Adds [edit] for the given [source] to the [change].
  */
-void doSourceChange_addSourceEdit(SourceChange change,
-    engine.AnalysisContext context, engine.Source source, SourceEdit edit) {
+void doSourceChange_addSourceEdit(
+    SourceChange change, engine.Source source, SourceEdit edit,
+    {bool isNewFile: false}) {
   String file = source.fullName;
-  int fileStamp = context.getModificationStamp(source);
-  change.addEdit(file, fileStamp, edit);
+  change.addEdit(file, isNewFile ? -1 : 0, edit);
 }
 
 String getReturnTypeString(engine.Element element) {
@@ -140,7 +139,8 @@
   }
   int offset = element.nameOffset;
   int length = element.nameLength;
-  if (element is engine.CompilationUnitElement) {
+  if (element is engine.CompilationUnitElement ||
+      (element is engine.LibraryElement && offset < 0)) {
     offset = 0;
     length = 0;
   }
diff --git a/pkg/analysis_server/lib/src/provisional/completion/completion_core.dart b/pkg/analysis_server/lib/src/provisional/completion/completion_core.dart
index 1aa1c9f..b3582c9 100644
--- a/pkg/analysis_server/lib/src/provisional/completion/completion_core.dart
+++ b/pkg/analysis_server/lib/src/provisional/completion/completion_core.dart
@@ -9,6 +9,7 @@
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/services/search/search_engine.dart';
 import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/src/dart/analysis/driver.dart';
 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext;
 import 'package:analyzer/src/generated/source.dart';
 
@@ -71,6 +72,12 @@
   ResourceProvider get resourceProvider;
 
   /**
+   * The analysis result for the file in which the completion is being
+   * requested.
+   */
+  AnalysisResult get result;
+
+  /**
    * Return the search engine.
    */
   SearchEngine get searchEngine;
@@ -81,6 +88,12 @@
   Source get source;
 
   /**
+   * Return the content of the [source] in which the completion is being
+   * requested, or `null` if the content could not be accessed.
+   */
+  String get sourceContents;
+
+  /**
    * Throw [AbortCompletion] if the completion request has been aborted.
    */
   void checkAborted();
diff --git a/pkg/analysis_server/lib/src/provisional/completion/dart/completion_dart.dart b/pkg/analysis_server/lib/src/provisional/completion/dart/completion_dart.dart
index b25375ad..bec47b4 100644
--- a/pkg/analysis_server/lib/src/provisional/completion/dart/completion_dart.dart
+++ b/pkg/analysis_server/lib/src/provisional/completion/dart/completion_dart.dart
@@ -100,6 +100,11 @@
   DartType get objectType;
 
   /**
+   * Return the [SourceFactory] of the request.
+   */
+  SourceFactory get sourceFactory;
+
+  /**
    * Return the completion target.  This determines what part of the parse tree
    * will receive the newly inserted text.
    * At a minimum, all declarations in the completion scope in [target.unit]
diff --git a/pkg/analysis_server/lib/src/search/element_references.dart b/pkg/analysis_server/lib/src/search/element_references.dart
index 30ae422..476716e 100644
--- a/pkg/analysis_server/lib/src/search/element_references.dart
+++ b/pkg/analysis_server/lib/src/search/element_references.dart
@@ -6,13 +6,11 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/collections.dart';
 import 'package:analysis_server/src/protocol_server.dart'
     show SearchResult, newSearchResult_fromMatch;
 import 'package:analysis_server/src/services/search/hierarchy.dart';
 import 'package:analysis_server/src/services/search/search_engine.dart';
 import 'package:analyzer/dart/element/element.dart';
-import 'package:analyzer/src/generated/source.dart';
 
 /**
  * A computer for `search.findElementReferences` request results.
@@ -25,21 +23,23 @@
   /**
    * Computes [SearchResult]s for [element] references.
    */
-  Future<List<SearchResult>> compute(Element element, bool withPotential) {
-    var futureGroup = new _ConcatFutureGroup<SearchResult>();
-    // find element references
-    futureGroup.add(_findElementsReferences(element));
-    // add potential references
+  Future<List<SearchResult>> compute(
+      Element element, bool withPotential) async {
+    List<SearchResult> results = <SearchResult>[];
+
+    // Add element references.
+    results.addAll(await _findElementsReferences(element));
+
+    // Add potential references.
     if (withPotential && _isMemberElement(element)) {
       String name = element.displayName;
-      var matchesFuture = searchEngine.searchMemberReferences(name);
-      var resultsFuture = matchesFuture.then((List<SearchMatch> matches) {
-        return matches.where((match) => !match.isResolved).map(toResult);
-      });
-      futureGroup.add(resultsFuture);
+      List<SearchMatch> matches =
+          await searchEngine.searchMemberReferences(name);
+      matches = SearchMatch.withNotNullElement(matches);
+      results.addAll(matches.where((match) => !match.isResolved).map(toResult));
     }
-    // merge results
-    return futureGroup.future;
+
+    return results;
   }
 
   /**
@@ -47,18 +47,14 @@
    * to the corresponding hierarchy [Element]s.
    */
   Future<List<SearchResult>> _findElementsReferences(Element element) async {
+    List<SearchResult> allResults = <SearchResult>[];
     Iterable<Element> refElements = await _getRefElements(element);
-    var futureGroup = new _ConcatFutureGroup<SearchResult>();
     for (Element refElement in refElements) {
-      // add declaration
-      if (_isDeclarationInteresting(refElement)) {
-        SearchResult searchResult = _newDeclarationResult(refElement);
-        futureGroup.add(searchResult);
-      }
-      // do search
-      futureGroup.add(_findSingleElementReferences(refElement));
+      List<SearchResult> elementResults =
+          await _findSingleElementReferences(refElement);
+      allResults.addAll(elementResults);
     }
-    return futureGroup.future;
+    return allResults;
   }
 
   /**
@@ -67,6 +63,7 @@
   Future<List<SearchResult>> _findSingleElementReferences(
       Element element) async {
     List<SearchMatch> matches = await searchEngine.searchReferences(element);
+    matches = SearchMatch.withNotNullElement(matches);
     return matches.map(toResult).toList();
   }
 
@@ -85,43 +82,10 @@
     return new Future.value([element]);
   }
 
-  SearchResult _newDeclarationResult(Element refElement) {
-    int nameOffset = refElement.nameOffset;
-    int nameLength = refElement.nameLength;
-    SearchMatch searchMatch = new SearchMatch(
-        refElement.context,
-        refElement.library.source.uri.toString(),
-        refElement.source.uri.toString(),
-        MatchKind.DECLARATION,
-        new SourceRange(nameOffset, nameLength),
-        true,
-        false);
-    return newSearchResult_fromMatch(searchMatch);
-  }
-
   static SearchResult toResult(SearchMatch match) {
     return newSearchResult_fromMatch(match);
   }
 
-  static bool _isDeclarationInteresting(Element element) {
-    if (element is LabelElement) {
-      return true;
-    }
-    if (element is LocalVariableElement) {
-      return true;
-    }
-    if (element is ParameterElement) {
-      return true;
-    }
-    if (element is PrefixElement) {
-      return true;
-    }
-    if (element is PropertyInducingElement) {
-      return !element.isSynthetic;
-    }
-    return false;
-  }
-
   static bool _isMemberElement(Element element) {
     if (element is ConstructorElement) {
       return false;
@@ -129,26 +93,3 @@
     return element.enclosingElement is ClassElement;
   }
 }
-
-/**
- * A collection of [Future]s that concats [List] results of added [Future]s into
- * a single [List].
- */
-class _ConcatFutureGroup<E> {
-  final List<Future<List<E>>> _futures = <Future<List<E>>>[];
-
-  Future<List<E>> get future {
-    return Future.wait(_futures).then(concatToList);
-  }
-
-  /**
-   * Adds a [Future] or an [E] value to results.
-   */
-  void add(value) {
-    if (value is Future) {
-      _futures.add(value as Future<List<E>>);
-    } else {
-      _futures.add(new Future.value(<E>[value as E]));
-    }
-  }
-}
diff --git a/pkg/analysis_server/lib/src/search/search_domain.dart b/pkg/analysis_server/lib/src/search/search_domain.dart
index 37c58a69..9031325 100644
--- a/pkg/analysis_server/lib/src/search/search_domain.dart
+++ b/pkg/analysis_server/lib/src/search/search_domain.dart
@@ -51,40 +51,36 @@
   Future findElementReferences(protocol.Request request) async {
     var params =
         new protocol.SearchFindElementReferencesParams.fromRequest(request);
-    await server.onAnalysisComplete;
-    // prepare elements
-    List<Element> elements =
-        server.getElementsAtOffset(params.file, params.offset);
-    elements = elements.map((Element element) {
-      if (element is ImportElement) {
-        return element.prefix;
-      }
-      if (element is FieldFormalParameterElement) {
-        return element.field;
-      }
-      if (element is PropertyAccessorElement) {
-        return element.variable;
-      }
-      return element;
-    }).where((Element element) {
-      return element != null;
-    }).toList();
+    String file = params.file;
+    // prepare element
+    if (!server.options.enableNewAnalysisDriver) {
+      await server.onAnalysisComplete;
+    }
+    Element element = await server.getElementAtOffset(file, params.offset);
+    if (element is ImportElement) {
+      element = (element as ImportElement).prefix;
+    }
+    if (element is FieldFormalParameterElement) {
+      element = (element as FieldFormalParameterElement).field;
+    }
+    if (element is PropertyAccessorElement) {
+      element = (element as PropertyAccessorElement).variable;
+    }
     // respond
     String searchId = (_nextSearchId++).toString();
     var result = new protocol.SearchFindElementReferencesResult();
-    if (elements.isNotEmpty) {
+    if (element != null) {
       result.id = searchId;
-      result.element = protocol.convertElement(elements.first);
+      result.element = protocol.convertElement(element);
     }
     _sendSearchResult(request, result);
     // search elements
-    elements.forEach((Element element) async {
+    if (element != null) {
       var computer = new ElementReferencesComputer(searchEngine);
       List<protocol.SearchResult> results =
           await computer.compute(element, params.includePotential);
-      bool isLast = identical(element, elements.last);
-      _sendSearchNotification(searchId, isLast, results);
-    });
+      _sendSearchNotification(searchId, true, results);
+    }
   }
 
   Future findMemberDeclarations(protocol.Request request) async {
@@ -98,6 +94,7 @@
     // search
     List<SearchMatch> matches =
         await searchEngine.searchMemberDeclarations(params.name);
+    matches = SearchMatch.withNotNullElement(matches);
     _sendSearchNotification(searchId, true, matches.map(toResult));
   }
 
@@ -112,6 +109,7 @@
     // search
     List<SearchMatch> matches =
         await searchEngine.searchMemberReferences(params.name);
+    matches = SearchMatch.withNotNullElement(matches);
     _sendSearchNotification(searchId, true, matches.map(toResult));
   }
 
@@ -135,6 +133,7 @@
     // search
     List<SearchMatch> matches =
         await searchEngine.searchTopLevelDeclarations(params.pattern);
+    matches = SearchMatch.withNotNullElement(matches);
     _sendSearchNotification(searchId, true, matches.map(toResult));
   }
 
@@ -142,6 +141,14 @@
    * Implement the `search.getTypeHierarchy` request.
    */
   Future getTypeHierarchy(protocol.Request request) async {
+    if (server.options.enableNewAnalysisDriver) {
+      // TODO(scheglov) implement for the new analysis driver
+      protocol.Response response =
+          new protocol.SearchGetTypeHierarchyResult(hierarchyItems: [])
+              .toResponse(request.id);
+      server.sendResponse(response);
+      return;
+    }
     var params = new protocol.SearchGetTypeHierarchyParams.fromRequest(request);
     String file = params.file;
     // wait for analysis
@@ -151,12 +158,11 @@
       await server.onAnalysisComplete;
     }
     // prepare element
-    List<Element> elements = server.getElementsAtOffset(file, params.offset);
-    if (elements.isEmpty) {
+    Element element = await server.getElementAtOffset(file, params.offset);
+    if (element == null) {
       _sendTypeHierarchyNull(request);
       return;
     }
-    Element element = elements.first;
     // maybe supertype hierarchy only
     if (params.superOnly == true) {
       TypeHierarchyComputer computer =
diff --git a/pkg/analysis_server/lib/src/server/driver.dart b/pkg/analysis_server/lib/src/server/driver.dart
index dc971b8..f813e78 100644
--- a/pkg/analysis_server/lib/src/server/driver.dart
+++ b/pkg/analysis_server/lib/src/server/driver.dart
@@ -245,6 +245,11 @@
   /**
    * The name of the option used to enable using pub summary manager.
    */
+  static const String ENABLE_NEW_ANALYSIS_DRIVER = 'enable-new-analysis-driver';
+
+  /**
+   * The name of the option used to enable using pub summary manager.
+   */
   static const String ENABLE_PUB_SUMMARY_MANAGER = 'enable-pub-summary-manager';
 
   /**
@@ -383,10 +388,12 @@
         results[ENABLE_INCREMENTAL_RESOLUTION_API];
     analysisServerOptions.enableIncrementalResolutionValidation =
         results[INCREMENTAL_RESOLUTION_VALIDATION];
+    analysisServerOptions.enableNewAnalysisDriver =
+        results[ENABLE_NEW_ANALYSIS_DRIVER];
     analysisServerOptions.enablePubSummaryManager =
         results[ENABLE_PUB_SUMMARY_MANAGER];
     analysisServerOptions.finerGrainedInvalidation =
-        true /*results[FINER_GRAINED_INVALIDATION]*/;
+        results[FINER_GRAINED_INVALIDATION];
     analysisServerOptions.noErrorNotification = results[NO_ERROR_NOTIFICATION];
     analysisServerOptions.noIndex = results[NO_INDEX];
     analysisServerOptions.useAnalysisHighlight2 =
@@ -421,20 +428,12 @@
           .defaultSdkDirectory(PhysicalResourceProvider.INSTANCE)
           .path;
     }
-    bool useSummaries = analysisServerOptions.fileReadMode == 'as-is';
-    SdkCreator defaultSdkCreator = (AnalysisOptions options) {
-      PhysicalResourceProvider resourceProvider =
-          PhysicalResourceProvider.INSTANCE;
-      FolderBasedDartSdk sdk = new FolderBasedDartSdk(
-          resourceProvider, resourceProvider.getFolder(defaultSdkPath));
-      sdk.analysisOptions = options;
-      sdk.useSummary = useSummaries;
-      return sdk;
-    };
+    bool useSummaries = analysisServerOptions.fileReadMode == 'as-is' ||
+        analysisServerOptions.enableNewAnalysisDriver;
     // TODO(brianwilkerson) It would be nice to avoid creating an SDK that
     // cannot be re-used, but the SDK is needed to create a package map provider
     // in the case where we need to run `pub` in order to get the package map.
-    DartSdk defaultSdk = defaultSdkCreator(null);
+    DartSdk defaultSdk = _createDefaultSdk(defaultSdkPath, useSummaries);
     //
     // Initialize the instrumentation service.
     //
@@ -458,7 +457,7 @@
     //
     socketServer = new SocketServer(
         analysisServerOptions,
-        new DartSdkManager(defaultSdkPath, useSummaries, defaultSdkCreator),
+        new DartSdkManager(defaultSdkPath, useSummaries),
         defaultSdk,
         service,
         serverPlugin,
@@ -541,6 +540,10 @@
         help: "enable validation of incremental resolution results (slow)",
         defaultsTo: false,
         negatable: false);
+    parser.addFlag(ENABLE_NEW_ANALYSIS_DRIVER,
+        help: "enable using new analysis driver",
+        defaultsTo: false,
+        negatable: false);
     parser.addFlag(ENABLE_PUB_SUMMARY_MANAGER,
         help: "enable using summaries for pub cache packages",
         defaultsTo: false,
@@ -586,6 +589,15 @@
     return parser;
   }
 
+  DartSdk _createDefaultSdk(String defaultSdkPath, bool useSummaries) {
+    PhysicalResourceProvider resourceProvider =
+        PhysicalResourceProvider.INSTANCE;
+    FolderBasedDartSdk sdk = new FolderBasedDartSdk(
+        resourceProvider, resourceProvider.getFolder(defaultSdkPath));
+    sdk.useSummary = useSummaries;
+    return sdk;
+  }
+
   /**
    * Print information about how to use the server.
    */
diff --git a/pkg/analysis_server/lib/src/server/http_server.dart b/pkg/analysis_server/lib/src/server/http_server.dart
index 85aabea..85c3557 100644
--- a/pkg/analysis_server/lib/src/server/http_server.dart
+++ b/pkg/analysis_server/lib/src/server/http_server.dart
@@ -10,6 +10,7 @@
 import 'package:analysis_server/src/channel/web_socket_channel.dart';
 import 'package:analysis_server/src/socket_server.dart';
 import 'package:analysis_server/src/status/get_handler.dart';
+import 'package:analysis_server/src/status/get_handler2.dart';
 
 /**
  * Instances of the class [HttpServer] implement a simple HTTP server. The
@@ -31,7 +32,7 @@
   /**
    * An object that can handle GET requests.
    */
-  GetHandler getHandler;
+  AbstractGetHandler getHandler;
 
   /**
    * Future that is completed with the HTTP server once it is running.
@@ -78,7 +79,11 @@
    */
   void _handleGetRequest(HttpRequest request) {
     if (getHandler == null) {
-      getHandler = new GetHandler(socketServer, _printBuffer);
+      if (socketServer.analysisServer.options.enableNewAnalysisDriver) {
+        getHandler = new GetHandler2(socketServer, _printBuffer);
+      } else {
+        getHandler = new GetHandler(socketServer, _printBuffer);
+      }
     }
     getHandler.handleGetRequest(request);
   }
diff --git a/pkg/analysis_server/lib/src/services/completion/completion_core.dart b/pkg/analysis_server/lib/src/services/completion/completion_core.dart
index b79a9d8..0a8b431 100644
--- a/pkg/analysis_server/lib/src/services/completion/completion_core.dart
+++ b/pkg/analysis_server/lib/src/services/completion/completion_core.dart
@@ -8,7 +8,8 @@
 import 'package:analysis_server/src/services/completion/completion_performance.dart';
 import 'package:analysis_server/src/services/search/search_engine.dart';
 import 'package:analyzer/file_system/file_system.dart';
-import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/dart/analysis/driver.dart';
+import 'package:analyzer/src/generated/engine.dart' hide AnalysisResult;
 import 'package:analyzer/src/generated/source.dart';
 
 /**
@@ -16,6 +17,9 @@
  */
 class CompletionRequestImpl implements CompletionRequest {
   @override
+  final AnalysisResult result;
+
+  @override
   final AnalysisContext context;
 
   @override
@@ -63,26 +67,32 @@
   /**
    * Initialize a newly created completion request based on the given arguments.
    */
-  CompletionRequestImpl(AnalysisContext context, this.resourceProvider,
-      this.searchEngine, Source source, int offset, this.performance)
+  CompletionRequestImpl(
+      this.result,
+      AnalysisContext context,
+      this.resourceProvider,
+      this.searchEngine,
+      Source source,
+      int offset,
+      this.performance)
       : this.context = context,
         this.source = source,
         this.offset = offset,
         replacementOffset = offset,
         replacementLength = 0,
-        sourceModificationStamp = context.getModificationStamp(source);
+        sourceModificationStamp = context?.getModificationStamp(source);
 
   /**
    * Return the original text from the [replacementOffset] to the [offset]
    * that can be used to filter the suggestions on the server side.
    */
   String get filterText {
-    return context
-        .getContents(source)
-        .data
-        .substring(replacementOffset, offset);
+    return sourceContents.substring(replacementOffset, offset);
   }
 
+  @override
+  String get sourceContents => context.getContents(source)?.data;
+
   /**
    * Abort the current completion request.
    */
@@ -95,7 +105,7 @@
     if (_aborted) {
       throw new AbortCompletion();
     }
-    if (sourceModificationStamp != context.getModificationStamp(source)) {
+    if (sourceModificationStamp != context?.getModificationStamp(source)) {
       _aborted = true;
       throw new AbortCompletion();
     }
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/common_usage_sorter.dart b/pkg/analysis_server/lib/src/services/completion/dart/common_usage_sorter.dart
index 719221e..67f7137 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/common_usage_sorter.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/common_usage_sorter.dart
@@ -46,18 +46,24 @@
   }
 
   CompletionTarget _getCompletionTarget(CompletionRequest request) {
-    // TODO (danrubel) get cached completion target
-    var libSrcs = request.context.getLibrariesContaining(request.source);
-    if (libSrcs.length == 0) {
-      return null;
-    }
-    var libElem = request.context.getResult(libSrcs[0], LIBRARY_ELEMENT1);
-    if (libElem is LibraryElement) {
-      var unit = request.context.getResult(
-          new LibrarySpecificUnit(libElem.source, request.source),
-          RESOLVED_UNIT5);
-      if (unit is CompilationUnit) {
-        return new CompletionTarget.forOffset(unit, request.offset);
+    if (request.result != null) {
+      var unit = request.result.unit;
+      return new CompletionTarget.forOffset(unit, request.offset);
+    } else {
+      // TODO (danrubel) get cached completion target
+      var libSrcs = request.context.getLibrariesContaining(request.source);
+      if (libSrcs.length == 0) {
+        return null;
+      }
+      LibraryElement libElem =
+          request.context.getResult(libSrcs[0], LIBRARY_ELEMENT1);
+      if (libElem is LibraryElement) {
+        var unit = request.context.getResult(
+            new LibrarySpecificUnit(libElem.source, request.source),
+            RESOLVED_UNIT5);
+        if (unit is CompilationUnit) {
+          return new CompletionTarget.forOffset(unit, request.offset);
+        }
       }
     }
     return null;
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart b/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart
index ef95f10..e00ec2a 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart
@@ -25,8 +25,9 @@
 import 'package:analyzer/exception/exception.dart';
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/src/context/context.dart' show AnalysisFutureHelper;
+import 'package:analyzer/src/dart/analysis/driver.dart';
 import 'package:analyzer/src/dart/ast/token.dart';
-import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/engine.dart' hide AnalysisResult;
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/task/dart.dart';
 import 'package:analyzer/task/dart.dart';
@@ -106,6 +107,9 @@
  */
 class DartCompletionRequestImpl implements DartCompletionRequest {
   @override
+  final AnalysisResult result;
+
+  @override
   final AnalysisContext context;
 
   @override
@@ -158,6 +162,7 @@
   final CompletionPerformance performance;
 
   DartCompletionRequestImpl._(
+      this.result,
       this.context,
       this.resourceProvider,
       this.searchEngine,
@@ -172,8 +177,11 @@
 
   @override
   LibraryElement get coreLib {
-    if (_coreLib == null) {
-      Source coreUri = context.sourceFactory.forUri('dart:core');
+    if (result != null) {
+      AnalysisContext context = result.unit.element.context;
+      _coreLib = context.typeProvider.objectType.element.library;
+    } else {
+      Source coreUri = sourceFactory.forUri('dart:core');
       _coreLib = context.computeLibraryElement(coreUri);
     }
     return _coreLib;
@@ -217,6 +225,14 @@
     return _opType;
   }
 
+  @override
+  String get sourceContents => context.getContents(source)?.data;
+
+  @override
+  SourceFactory get sourceFactory {
+    return context?.sourceFactory ?? result.sourceFactory;
+  }
+
   /**
    * Throw [AbortCompletion] if the completion request has been aborted.
    */
@@ -254,12 +270,17 @@
     // Resolve declarations in the target unit
     // TODO(danrubel) resolve the expression or containing method
     // rather than the entire compilation unit
-    CompilationUnit resolvedUnit = await _computeAsync(
-        this,
-        new LibrarySpecificUnit(librarySource, source),
-        RESOLVED_UNIT,
-        performance,
-        'resolve expression');
+    CompilationUnit resolvedUnit;
+    if (result != null) {
+      resolvedUnit = result.unit;
+    } else {
+      resolvedUnit = await _computeAsync(
+          this,
+          new LibrarySpecificUnit(librarySource, source),
+          RESOLVED_UNIT,
+          performance,
+          'resolve expression');
+    }
 
     // TODO(danrubel) determine if the underlying source has been modified
     // in a way that invalidates the completion request
@@ -302,6 +323,10 @@
     if (_resolvedUnits != null) {
       return _resolvedUnits;
     }
+    if (result != null) {
+      _resolvedUnits = result.unit.element.library.units;
+      return _resolvedUnits;
+    }
     LibraryElement libElem = libraryElement;
     if (libElem == null) {
       return null;
@@ -365,35 +390,43 @@
     const BUILD_REQUEST_TAG = 'build DartCompletionRequest';
     performance.logStartTime(BUILD_REQUEST_TAG);
 
-    Source source = request.source;
-    AnalysisContext context = request.context;
-
-    const PARSE_TAG = 'parse unit';
-    performance.logStartTime(PARSE_TAG);
-    CompilationUnit unit = request.context.computeResult(source, PARSED_UNIT);
-    performance.logElapseTime(PARSE_TAG);
-
     Source libSource;
-    if (unit.directives.any((d) => d is PartOfDirective)) {
-      List<Source> libraries = context.getLibrariesContaining(source);
-      if (libraries.isNotEmpty) {
-        libSource = libraries[0];
-      }
+    CompilationUnit unit;
+    if (request.context == null) {
+      unit = request.result.unit;
+      // TODO(scheglov) support for parts
+      libSource = unit.element.source;
     } else {
-      libSource = source;
-    }
+      Source source = request.source;
+      AnalysisContext context = request.context;
 
-    // Most (all?) contributors need declarations in scope to be resolved
-    if (libSource != null) {
-      unit = await _computeAsync(
-          request,
-          new LibrarySpecificUnit(libSource, source),
-          resultDescriptor ?? RESOLVED_UNIT5,
-          performance,
-          'resolve declarations');
+      const PARSE_TAG = 'parse unit';
+      performance.logStartTime(PARSE_TAG);
+      unit = request.context.computeResult(source, PARSED_UNIT);
+      performance.logElapseTime(PARSE_TAG);
+
+      if (unit.directives.any((d) => d is PartOfDirective)) {
+        List<Source> libraries = context.getLibrariesContaining(source);
+        if (libraries.isNotEmpty) {
+          libSource = libraries[0];
+        }
+      } else {
+        libSource = source;
+      }
+
+      // Most (all?) contributors need declarations in scope to be resolved
+      if (libSource != null) {
+        unit = await _computeAsync(
+            request,
+            new LibrarySpecificUnit(libSource, source),
+            resultDescriptor ?? RESOLVED_UNIT5,
+            performance,
+            'resolve declarations');
+      }
     }
 
     DartCompletionRequestImpl dartRequest = new DartCompletionRequestImpl._(
+        request.result,
         request.context,
         request.resourceProvider,
         request.searchEngine,
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart
index c69d806..70b2b44 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart
@@ -209,23 +209,22 @@
 
     // If user typed identifier starting with '_'
     // then do not suppress the relevance of private members
-    var contents = request.context.getContents(request.source);
-    if (contents != null) {
-      String data = contents.data;
-      int offset = request.offset;
-      if (data != null && 0 < offset && offset <= data.length) {
-        bool isIdentifierChar(int index) {
-          int code = data.codeUnitAt(index);
-          return isLetterOrDigit(code) || code == CHAR_UNDERSCORE;
-        }
+    var data = request.result != null
+        ? request.result.content
+        : request.sourceContents;
+    int offset = request.offset;
+    if (data != null && 0 < offset && offset <= data.length) {
+      bool isIdentifierChar(int index) {
+        int code = data.codeUnitAt(index);
+        return isLetterOrDigit(code) || code == CHAR_UNDERSCORE;
+      }
 
-        if (isIdentifierChar(offset - 1)) {
-          while (offset > 0 && isIdentifierChar(offset - 1)) {
-            --offset;
-          }
-          if (data.codeUnitAt(offset) == CHAR_UNDERSCORE) {
-            privateMemberRelevance = null;
-          }
+      if (isIdentifierChar(offset - 1)) {
+        while (offset > 0 && isIdentifierChar(offset - 1)) {
+          --offset;
+        }
+        if (data.codeUnitAt(offset) == CHAR_UNDERSCORE) {
+          privateMemberRelevance = null;
         }
       }
     }
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart b/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart
index 2a537bf..a57319a 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart
@@ -29,6 +29,9 @@
     CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
     int relevance: DART_RELEVANCE_DEFAULT,
     Source importForSource}) {
+  if (element == null) {
+    return null;
+  }
   if (element is ExecutableElement && element.isOperator) {
     // Do not include operators in suggestions
     return null;
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/uri_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/uri_contributor.dart
index 7b99353..b2b624d 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/uri_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/uri_contributor.dart
@@ -66,7 +66,7 @@
             // Quoted empty string
             visitSimpleStringLiteral(uri);
           } else {
-            String data = request.source.contents.data;
+            String data = request.sourceContents;
             if (end == data.length) {
               String ch = data[end - 1];
               if (ch != '"' && ch != "'") {
@@ -77,9 +77,8 @@
             }
           }
         }
-      }
-      else if (offset == start && offset == end) {
-        String data = request.source.contents.data;
+      } else if (offset == start && offset == end) {
+        String data = request.sourceContents;
         if (end == data.length) {
           String ch = data[end - 1];
           if (ch == '"' || ch == "'") {
@@ -112,7 +111,7 @@
 
   void _addDartSuggestions() {
     _addSuggestion('dart:');
-    SourceFactory factory = request.context.sourceFactory;
+    SourceFactory factory = request.sourceFactory;
     for (SdkLibrary lib in factory.dartSdk.sdkLibraries) {
       if (!lib.isInternal && !lib.isImplementation) {
         if (!lib.shortName.startsWith('dart:_')) {
@@ -192,7 +191,7 @@
   }
 
   void _addPackageSuggestions(String partial) {
-    SourceFactory factory = request.context.sourceFactory;
+    SourceFactory factory = request.sourceFactory;
     Map<String, List<Folder>> packageMap = factory.packageMap;
     if (packageMap != null) {
       _addSuggestion('package:');
diff --git a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
index 42ccd71..9899681 100644
--- a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
@@ -87,7 +87,18 @@
   String get eol => utils.endOfLine;
 
   Future<List<Assist>> compute() async {
-    utils = new CorrectionUtils(unit);
+    // If the source was changed between the constructor and running
+    // this asynchronous method, it is not safe to use the unit.
+    if (analysisContext.getModificationStamp(source) != fileStamp) {
+      return const <Assist>[];
+    }
+
+    try {
+      utils = new CorrectionUtils(unit);
+    } catch (e) {
+      throw new CancelCorrectionException(exception: e);
+    }
+
     node = new NodeLocator(selectionOffset, selectionEnd).searchWithin(unit);
     if (node == null) {
       return assists;
@@ -2239,9 +2250,13 @@
  */
 class DefaultAssistContributor extends DartAssistContributor {
   @override
-  Future<List<Assist>> internalComputeAssists(DartAssistContext context) {
-    AssistProcessor processor = new AssistProcessor(context);
-    return processor.compute();
+  Future<List<Assist>> internalComputeAssists(DartAssistContext context) async {
+    try {
+      AssistProcessor processor = new AssistProcessor(context);
+      return processor.compute();
+    } on CancelCorrectionException {
+      return Assist.EMPTY_LIST;
+    }
   }
 }
 
diff --git a/pkg/analysis_server/lib/src/services/correction/fix.dart b/pkg/analysis_server/lib/src/services/correction/fix.dart
index a0b6d10..0d49cf4 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix.dart
@@ -105,7 +105,9 @@
     errorCode == StaticTypeWarningCode.UNDEFINED_GETTER ||
     errorCode == StaticTypeWarningCode.UNDEFINED_METHOD ||
     errorCode == StaticTypeWarningCode.UNDEFINED_SETTER ||
-    (errorCode is LintCode && errorCode.name == LintNames.annotate_overrides);
+    (errorCode is LintCode &&
+        (errorCode.name == LintNames.annotate_overrides ||
+            errorCode.name == LintNames.unnecessary_brace_in_string_interp));
 
 /**
  * An enumeration of possible quick fix kinds.
@@ -179,6 +181,10 @@
       const FixKind('INSERT_SEMICOLON', 50, "Insert ';'");
   static const LINT_ADD_OVERRIDE =
       const FixKind('LINT_ADD_OVERRIDE', 50, "Add '@override' annotation");
+  static const LINT_REMOVE_INTERPOLATION_BRACES = const FixKind(
+      'LINT_REMOVE_INTERPOLATION_BRACES',
+      50,
+      'Remove unnecessary interpolation braces');
   static const MAKE_CLASS_ABSTRACT =
       const FixKind('MAKE_CLASS_ABSTRACT', 50, "Make class '{0}' abstract");
   static const REMOVE_DEAD_CODE =
diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
index 78939c5..76ee0e1 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -69,9 +69,13 @@
  */
 class DefaultFixContributor extends DartFixContributor {
   @override
-  Future<List<Fix>> internalComputeFixes(DartFixContext context) {
-    FixProcessor processor = new FixProcessor(context);
-    return processor.compute();
+  Future<List<Fix>> internalComputeFixes(DartFixContext context) async {
+    try {
+      FixProcessor processor = new FixProcessor(context);
+      return processor.compute();
+    } on CancelCorrectionException {
+      return Fix.EMPTY_LIST;
+    }
   }
 }
 
@@ -135,7 +139,18 @@
   String get eol => utils.endOfLine;
 
   Future<List<Fix>> compute() async {
-    utils = new CorrectionUtils(unit);
+    // If the source was changed between the constructor and running
+    // this asynchronous method, it is not safe to use the unit.
+    if (context.getModificationStamp(unitSource) != fileStamp) {
+      return const <Fix>[];
+    }
+
+    try {
+      utils = new CorrectionUtils(unit);
+    } catch (e) {
+      throw new CancelCorrectionException(exception: e);
+    }
+
     errorOffset = error.offset;
     errorLength = error.length;
     errorEnd = errorOffset + errorLength;
@@ -270,15 +285,17 @@
                 .NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS) {
       // make class abstract
       _addFix_makeEnclosingClassAbstract();
-      // implement methods
-      AnalysisErrorWithProperties errorWithProperties =
-          error as AnalysisErrorWithProperties;
-      Object property =
-          errorWithProperties.getProperty(ErrorProperty.UNIMPLEMENTED_METHODS);
-      List<ExecutableElement> missingOverrides =
-          property as List<ExecutableElement>;
-      _addFix_createMissingOverrides(missingOverrides);
       _addFix_createNoSuchMethod();
+      // implement methods
+      // TODO(scheglov) Fix another way to get unimplemented methods.
+      // AnalysisErrorWithProperties does not work with the new analysis driver.
+      if (error is AnalysisErrorWithProperties) {
+        AnalysisErrorWithProperties errorWithProperties =
+            error as AnalysisErrorWithProperties;
+        List<ExecutableElement> missingOverrides = errorWithProperties
+            .getProperty(ErrorProperty.UNIMPLEMENTED_METHODS);
+        _addFix_createMissingOverrides(missingOverrides);
+      }
     }
     if (errorCode == StaticWarningCode.CAST_TO_NON_TYPE ||
         errorCode == StaticWarningCode.TYPE_TEST_WITH_UNDEFINED_NAME ||
@@ -356,6 +373,9 @@
       if (errorCode.name == LintNames.annotate_overrides) {
         _addLintFixAddOverrideAnnotation();
       }
+      if (errorCode.name == LintNames.unnecessary_brace_in_string_interp) {
+        _addLintRemoveInterpolationBraces();
+      }
     }
     // done
     return fixes;
@@ -1198,7 +1218,7 @@
         if (isAbsolute(file) && AnalysisEngine.isDartFileName(file)) {
           String libName = _computeLibraryName(file);
           SourceEdit edit = new SourceEdit(0, 0, 'library $libName;$eol$eol');
-          doSourceChange_addSourceEdit(change, context, source, edit);
+          doSourceChange_addSourceEdit(change, source, edit, isNewFile: true);
           _addFix(DartFixKind.CREATE_FILE, [source.shortName]);
         }
       }
@@ -1417,7 +1437,7 @@
       if (source != null) {
         String libName = unitLibraryElement.name;
         SourceEdit edit = new SourceEdit(0, 0, 'part of $libName;$eol$eol');
-        doSourceChange_addSourceEdit(change, context, source, edit);
+        doSourceChange_addSourceEdit(change, source, edit, isNewFile: true);
         _addFix(DartFixKind.CREATE_FILE, [source.shortName]);
       }
     }
@@ -2280,6 +2300,18 @@
     _addFix(DartFixKind.LINT_ADD_OVERRIDE, []);
   }
 
+  void _addLintRemoveInterpolationBraces() {
+    AstNode node = this.node;
+    if (node is InterpolationExpression) {
+      Token right = node.rightBracket;
+      if (node.expression != null && right != null) {
+        _addReplaceEdit(rf.rangeStartStart(node, node.expression), r'$');
+        _addRemoveEdit(rf.rangeToken(right));
+        _addFix(DartFixKind.LINT_REMOVE_INTERPOLATION_BRACES, []);
+      }
+    }
+  }
+
   /**
    * Prepares proposal for creating function corresponding to the given
    * [FunctionType].
@@ -2896,6 +2928,8 @@
  */
 class LintNames {
   static const String annotate_overrides = 'annotate_overrides';
+  static const String unnecessary_brace_in_string_interp =
+      'unnecessary_brace_in_string_interp';
 }
 
 /**
diff --git a/pkg/analysis_server/lib/src/services/correction/util.dart b/pkg/analysis_server/lib/src/services/correction/util.dart
index 8a357d6..82f2652 100644
--- a/pkg/analysis_server/lib/src/services/correction/util.dart
+++ b/pkg/analysis_server/lib/src/services/correction/util.dart
@@ -31,14 +31,19 @@
  */
 void addLibraryImports(SourceChange change, LibraryElement targetLibrary,
     Set<LibraryElement> libraries) {
-  CompilationUnitElement libUnitElement = targetLibrary.definingCompilationUnit;
-  CompilationUnit libUnit = getParsedUnit(libUnitElement);
-  CorrectionUtils libUtils = new CorrectionUtils(libUnit);
+  CorrectionUtils libUtils;
+  try {
+    CompilationUnitElement unitElement = targetLibrary.definingCompilationUnit;
+    CompilationUnit unitAst = getParsedUnit(unitElement);
+    libUtils = new CorrectionUtils(unitAst);
+  } catch (e) {
+    throw new CancelCorrectionException(exception: e);
+  }
   String eol = libUtils.endOfLine;
   // Prepare information about existing imports.
   LibraryDirective libraryDirective;
   List<_ImportDirectiveInfo> importDirectives = <_ImportDirectiveInfo>[];
-  for (Directive directive in libUnit.directives) {
+  for (Directive directive in libUtils.unit.directives) {
     if (directive is LibraryDirective) {
       libraryDirective = directive;
     } else if (directive is ImportDirective) {
@@ -664,6 +669,17 @@
 }
 
 /**
+ * This exception is thrown to cancel the current correction operation,
+ * such as quick assist or quick fix because an inconsistency was detected.
+ * These inconsistencies may happen as a part of normal workflow, e.g. because
+ * a resource was deleted, or an analysis result was invalidated.
+ */
+class CancelCorrectionException {
+  final Object exception;
+  CancelCorrectionException({this.exception});
+}
+
+/**
  * Describes the location for a newly created [ClassMember].
  */
 class ClassMemberLocation {
@@ -689,8 +705,12 @@
 
   CorrectionUtils(this.unit) {
     CompilationUnitElement unitElement = unit.element;
+    AnalysisContext context = unitElement.context;
+    if (context == null) {
+      throw new CancelCorrectionException();
+    }
     this._library = unitElement.library;
-    this._buffer = unitElement.context.getContents(unitElement.source).data;
+    this._buffer = context.getContents(unitElement.source).data;
   }
 
   /**
diff --git a/pkg/analysis_server/lib/src/services/refactoring/inline_method.dart b/pkg/analysis_server/lib/src/services/refactoring/inline_method.dart
index ca243c4..8a0322c 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/inline_method.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/inline_method.dart
@@ -191,11 +191,18 @@
 }
 
 /**
+ * Completes with the resolved [CompilationUnit] that contains the [element].
+ */
+typedef Future<CompilationUnit> GetResolvedUnitContainingElement(
+    Element element);
+
+/**
  * [InlineMethodRefactoring] implementation.
  */
 class InlineMethodRefactoringImpl extends RefactoringImpl
     implements InlineMethodRefactoring {
   final SearchEngine searchEngine;
+  final GetResolvedUnitContainingElement getResolvedUnit;
   final CompilationUnit unit;
   final int offset;
   CorrectionUtils utils;
@@ -216,8 +223,10 @@
   _SourcePart _methodExpressionPart;
   _SourcePart _methodStatementsPart;
   List<_ReferenceProcessor> _referenceProcessors = [];
+  Set<FunctionBody> _alreadyMadeAsync = new Set<FunctionBody>();
 
-  InlineMethodRefactoringImpl(this.searchEngine, this.unit, this.offset) {
+  InlineMethodRefactoringImpl(
+      this.searchEngine, this.getResolvedUnit, this.unit, this.offset) {
     utils = new CorrectionUtils(unit);
   }
 
@@ -278,7 +287,7 @@
   Future<RefactoringStatus> checkInitialConditions() async {
     RefactoringStatus result = new RefactoringStatus();
     // prepare method information
-    result.addStatus(_prepareMethod());
+    result.addStatus(await _prepareMethod());
     if (result.hasFatalError) {
       return new Future<RefactoringStatus>.value(result);
     }
@@ -287,6 +296,11 @@
       result = new RefactoringStatus.fatal('Cannot inline operator.');
       return new Future<RefactoringStatus>.value(result);
     }
+    // maybe [a]sync*
+    if (_methodElement.isGenerator) {
+      result = new RefactoringStatus.fatal('Cannot inline a generator.');
+      return new Future<RefactoringStatus>.value(result);
+    }
     // analyze method body
     result.addStatus(_prepareMethodParts());
     // process references
@@ -295,6 +309,7 @@
     _referenceProcessors.clear();
     for (SearchMatch reference in references) {
       _ReferenceProcessor processor = new _ReferenceProcessor(this, reference);
+      await processor.init();
       _referenceProcessors.add(processor);
     }
     return result;
@@ -321,7 +336,7 @@
   /**
    * Initializes [_methodElement] and related fields.
    */
-  RefactoringStatus _prepareMethod() {
+  Future<RefactoringStatus> _prepareMethod() async {
     _methodElement = null;
     _methodParameters = null;
     _methodBody = null;
@@ -346,7 +361,7 @@
     }
     _methodElement = element as ExecutableElement;
     _isAccessor = element is PropertyAccessorElement;
-    _methodUnit = element.unit;
+    _methodUnit = await getResolvedUnit(element);
     _methodUtils = new CorrectionUtils(_methodUnit);
     // class member
     bool isClassMember = element.enclosingElement is ClassElement;
@@ -429,6 +444,7 @@
  */
 class _ReferenceProcessor {
   final InlineMethodRefactoringImpl ref;
+  final SearchMatch reference;
 
   Element refElement;
   CorrectionUtils _refUtils;
@@ -436,10 +452,12 @@
   SourceRange _refLineRange;
   String _refPrefix;
 
-  _ReferenceProcessor(this.ref, SearchMatch reference) {
+  _ReferenceProcessor(this.ref, this.reference);
+
+  Future<Null> init() async {
     refElement = reference.element;
     // prepare CorrectionUtils
-    CompilationUnit refUnit = refElement.unit;
+    CompilationUnit refUnit = await ref.getResolvedUnit(refElement);
     _refUtils = new CorrectionUtils(refUnit);
     // prepare node and environment
     _node = _refUtils.findNode(reference.sourceRange.offset);
@@ -560,6 +578,33 @@
     if (!_shouldProcess()) {
       return;
     }
+    // If the element being inlined is async, ensure that the function
+    // body that encloses the method is also async.
+    if (ref._methodElement.isAsynchronous) {
+      FunctionBody body = _node.getAncestor((n) => n is FunctionBody);
+      if (body != null) {
+        if (body.isSynchronous) {
+          if (body.isGenerator) {
+            status.addFatalError(
+                'Cannot inline async into sync*.', newLocation_fromNode(_node));
+            return;
+          }
+          if (refElement is ExecutableElement) {
+            var executable = refElement as ExecutableElement;
+            if (!executable.returnType.isDartAsyncFuture) {
+              status.addFatalError(
+                  'Cannot inline async into a function that does not return a Future.',
+                  newLocation_fromNode(_node));
+              return;
+            }
+          }
+          if (ref._alreadyMadeAsync.add(body)) {
+            SourceRange bodyStart = rangeStartLength(body.offset, 0);
+            _addRefEdit(newSourceEdit_range(bodyStart, 'async '));
+          }
+        }
+      }
+    }
     // may be invocation of inline method
     if (nodeParent is MethodInvocation) {
       MethodInvocation invocation = nodeParent;
diff --git a/pkg/analysis_server/lib/src/services/refactoring/refactoring.dart b/pkg/analysis_server/lib/src/services/refactoring/refactoring.dart
index b4abf87..5cf982f 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/refactoring.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/refactoring.dart
@@ -249,8 +249,12 @@
    * Returns a new [InlineMethodRefactoring] instance.
    */
   factory InlineMethodRefactoring(
-      SearchEngine searchEngine, CompilationUnit unit, int offset) {
-    return new InlineMethodRefactoringImpl(searchEngine, unit, offset);
+      SearchEngine searchEngine,
+      GetResolvedUnitContainingElement getResolvedUnit,
+      CompilationUnit unit,
+      int offset) {
+    return new InlineMethodRefactoringImpl(
+        searchEngine, getResolvedUnit, unit, offset);
   }
 
   /**
diff --git a/pkg/analysis_server/lib/src/services/refactoring/refactoring_internal.dart b/pkg/analysis_server/lib/src/services/refactoring/refactoring_internal.dart
index 17fdb68..7e18c6b 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/refactoring_internal.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/refactoring_internal.dart
@@ -12,7 +12,6 @@
 import 'package:analysis_server/src/services/refactoring/refactoring.dart';
 import 'package:analysis_server/src/services/search/search_engine.dart';
 import 'package:analyzer/dart/element/element.dart';
-import 'package:analyzer/src/generated/engine.dart' show AnalysisContext;
 import 'package:analyzer/src/generated/source.dart';
 
 /**
@@ -68,8 +67,6 @@
 
   SourceReference(this._match);
 
-  AnalysisContext get context => _match.context;
-
   Element get element => _match.element;
 
   /**
@@ -106,7 +103,7 @@
    */
   void addEdit(SourceChange change, String newText, {String id}) {
     SourceEdit edit = createEdit(newText, id: id);
-    doSourceChange_addSourceEdit(change, context, unitSource, edit);
+    doSourceChange_addSourceEdit(change, unitSource, edit);
   }
 
   /**
diff --git a/pkg/analysis_server/lib/src/services/refactoring/rename_constructor.dart b/pkg/analysis_server/lib/src/services/refactoring/rename_constructor.dart
index 72a29ce..cb9d88d 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/rename_constructor.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/rename_constructor.dart
@@ -16,6 +16,7 @@
 import 'package:analysis_server/src/services/refactoring/rename.dart';
 import 'package:analysis_server/src/services/search/hierarchy.dart';
 import 'package:analysis_server/src/services/search/search_engine.dart';
+import 'package:analysis_server/src/services/search/search_engine_internal.dart';
 import 'package:analyzer/dart/ast/ast.dart';
 import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer/src/generated/java_core.dart';
@@ -40,7 +41,6 @@
   @override
   Future<RefactoringStatus> checkFinalConditions() {
     RefactoringStatus result = new RefactoringStatus();
-    _analyzePossibleConflicts(result);
     return new Future.value(result);
   }
 
@@ -48,6 +48,9 @@
   RefactoringStatus checkNewName() {
     RefactoringStatus result = super.checkNewName();
     result.addStatus(validateConstructorName(newName));
+    if (newName != null) {
+      _analyzePossibleConflicts(result);
+    }
     return result;
   }
 
@@ -70,8 +73,13 @@
   }
 
   void _analyzePossibleConflicts(RefactoringStatus result) {
-    // check if there are members with "newName" in the same ClassElement
     ClassElement parentClass = element.enclosingElement;
+    // Check if the "newName" is the name of the enclosing class.
+    if (parentClass.name == newName) {
+      result.addError('The constructor should not have the same name '
+          'as the name of the enclosing class.');
+    }
+    // check if there are members with "newName" in the same ClassElement
     for (Element newNameMember in getChildren(parentClass, newName)) {
       String message = format(
           "Class '{0}' already declares {1} with name '{2}'.",
@@ -89,7 +97,7 @@
     } else {
       sourceRange = rangeStartLength(element.nameEnd, 0);
     }
-    return new SourceReference(new SearchMatch(
+    return new SourceReference(new SearchMatchImpl(
         element.context,
         element.library.source.uri.toString(),
         element.source.uri.toString(),
diff --git a/pkg/analysis_server/lib/src/services/search/search_engine.dart b/pkg/analysis_server/lib/src/services/search/search_engine.dart
index 72ca482..6ea3395 100644
--- a/pkg/analysis_server/lib/src/services/search/search_engine.dart
+++ b/pkg/analysis_server/lib/src/services/search/search_engine.dart
@@ -7,11 +7,7 @@
 import 'dart:async';
 
 import 'package:analyzer/dart/element/element.dart';
-import 'package:analyzer/dart/element/visitor.dart';
-import 'package:analyzer/src/dart/element/element.dart';
-import 'package:analyzer/src/generated/engine.dart' show AnalysisContext;
 import 'package:analyzer/src/generated/source.dart';
-import 'package:analyzer/src/generated/utilities_general.dart';
 
 /**
  * Instances of the enum [MatchKind] represent the kind of reference that was
@@ -110,152 +106,61 @@
  * Instances of the class [SearchMatch] represent a match found by
  * [SearchEngine].
  */
-class SearchMatch {
+abstract class SearchMatch {
   /**
-   * The [AnalysisContext] containing the match.
+   * Return the [Element] containing the match. Can return `null` if the unit
+   * does not exist, or its element was invalidated, or the element cannot be
+   * found, etc.
    */
-  final AnalysisContext context;
-
-  /**
-   * The URI of the source of the library containing the match.
-   */
-  final String libraryUri;
-
-  /**
-   * The URI of the source of the unit containing the match.
-   */
-  final String unitUri;
-
-  /**
-   * The kind of the match.
-   */
-  final MatchKind kind;
-
-  /**
-   * The source range that was matched.
-   */
-  final SourceRange sourceRange;
-
-  /**
-   * Is `true` if the match is a resolved reference to some [Element].
-   */
-  final bool isResolved;
-
-  /**
-   * Is `true` if field or method access is done using qualifier.
-   */
-  final bool isQualified;
-
-  Source _librarySource;
-  Source _unitSource;
-  LibraryElement _libraryElement;
-  Element _element;
-
-  SearchMatch(this.context, this.libraryUri, this.unitUri, this.kind,
-      this.sourceRange, this.isResolved, this.isQualified);
-
-  /**
-   * Return the [Element] containing the match.
-   */
-  Element get element {
-    if (_element == null) {
-      CompilationUnitElement unitElement =
-          context.getCompilationUnitElement(unitSource, librarySource);
-      _ContainingElementFinder finder =
-          new _ContainingElementFinder(sourceRange.offset);
-      unitElement.accept(finder);
-      _element = finder.containingElement;
-    }
-    return _element;
-  }
+  Element get element;
 
   /**
    * The absolute path of the file containing the match.
    */
-  String get file => unitSource.fullName;
+  String get file;
 
-  @override
-  int get hashCode {
-    return JenkinsSmiHash.hash4(libraryUri, unitUri, kind, sourceRange);
-  }
+  /**
+   * Is `true` if field or method access is done using qualifier.
+   */
+  bool get isQualified;
+
+  /**
+   * Is `true` if the match is a resolved reference to some [Element].
+   */
+  bool get isResolved;
+
+  /**
+   * The kind of the match.
+   */
+  MatchKind get kind;
 
   /**
    * Return the [LibraryElement] for the [libraryUri] in the [context].
    */
-  LibraryElement get libraryElement {
-    _libraryElement ??= context.getLibraryElement(librarySource);
-    return _libraryElement;
-  }
+  LibraryElement get libraryElement;
 
   /**
    * The library [Source] of the reference.
    */
-  Source get librarySource {
-    _librarySource ??= context.sourceFactory.forUri(libraryUri);
-    return _librarySource;
-  }
+  Source get librarySource;
+
+  /**
+   * The source range that was matched.
+   */
+  SourceRange get sourceRange;
 
   /**
    * The unit [Source] of the reference.
    */
-  Source get unitSource {
-    _unitSource ??= context.sourceFactory.forUri(unitUri);
-    return _unitSource;
-  }
+  Source get unitSource;
 
-  @override
-  bool operator ==(Object object) {
-    if (identical(object, this)) {
-      return true;
-    }
-    if (object is SearchMatch) {
-      return kind == object.kind &&
-          libraryUri == object.libraryUri &&
-          unitUri == object.unitUri &&
-          isResolved == object.isResolved &&
-          isQualified == object.isQualified &&
-          sourceRange == object.sourceRange;
-    }
-    return false;
-  }
-
-  @override
-  String toString() {
-    StringBuffer buffer = new StringBuffer();
-    buffer.write("SearchMatch(kind=");
-    buffer.write(kind);
-    buffer.write(", libraryUri=");
-    buffer.write(libraryUri);
-    buffer.write(", unitUri=");
-    buffer.write(unitUri);
-    buffer.write(", range=");
-    buffer.write(sourceRange);
-    buffer.write(", isResolved=");
-    buffer.write(isResolved);
-    buffer.write(", isQualified=");
-    buffer.write(isQualified);
-    buffer.write(")");
-    return buffer.toString();
-  }
-}
-
-/**
- * A visitor that finds the deep-most [Element] that contains the [offset].
- */
-class _ContainingElementFinder extends GeneralizingElementVisitor {
-  final int offset;
-  Element containingElement;
-
-  _ContainingElementFinder(this.offset);
-
-  visitElement(Element element) {
-    if (element is ElementImpl) {
-      if (element.codeOffset != null &&
-          element.codeOffset <= offset &&
-          offset <= element.codeOffset + element.codeLength) {
-        containingElement = element;
-        super.visitElement(element);
-      }
-    }
+  /**
+   * Return elements of [matches] which has not-null elements.
+   *
+   * When [SearchMatch.element] is not `null` we cache its value, so it cannot
+   * become `null` later.
+   */
+  static List<SearchMatch> withNotNullElement(List<SearchMatch> matches) {
+    return matches.where((match) => match.element != null).toList();
   }
 }
diff --git a/pkg/analysis_server/lib/src/services/search/search_engine_internal.dart b/pkg/analysis_server/lib/src/services/search/search_engine_internal.dart
index 5b2b6e3..cdd6a91 100644
--- a/pkg/analysis_server/lib/src/services/search/search_engine_internal.dart
+++ b/pkg/analysis_server/lib/src/services/search/search_engine_internal.dart
@@ -12,10 +12,13 @@
 import 'package:analyzer/dart/ast/ast.dart';
 import 'package:analyzer/dart/ast/visitor.dart';
 import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer/dart/element/visitor.dart';
+import 'package:analyzer/src/dart/element/element.dart';
 import 'package:analyzer/src/dart/element/member.dart';
 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext;
 import 'package:analyzer/src/generated/resolver.dart' show NamespaceBuilder;
 import 'package:analyzer/src/generated/source.dart' show Source, SourceRange;
+import 'package:analyzer/src/generated/utilities_general.dart';
 import 'package:analyzer/src/summary/idl.dart';
 
 /**
@@ -127,7 +130,7 @@
         throw new ArgumentError('Unsupported relation kind $relationKind');
       }
     }
-    return new SearchMatch(
+    return new SearchMatchImpl(
         location.context,
         location.libraryUri,
         location.unitUri,
@@ -234,7 +237,7 @@
       for (Directive directive in unit.directives) {
         if (directive is PartOfDirective &&
             directive.element == libraryElement) {
-          matches.add(new SearchMatch(
+          matches.add(new SearchMatchImpl(
               context,
               librarySource.uri.toString(),
               unitSource.uri.toString(),
@@ -288,6 +291,174 @@
 }
 
 /**
+ * Implementation of [SearchMatch].
+ */
+class SearchMatchImpl implements SearchMatch {
+  /**
+   * The [AnalysisContext] containing the match.
+   */
+  final AnalysisContext _context;
+
+  /**
+   * The URI of the source of the library containing the match.
+   */
+  final String libraryUri;
+
+  /**
+   * The URI of the source of the unit containing the match.
+   */
+  final String unitUri;
+
+  /**
+   * The kind of the match.
+   */
+  final MatchKind kind;
+
+  /**
+   * The source range that was matched.
+   */
+  final SourceRange sourceRange;
+
+  /**
+   * Is `true` if the match is a resolved reference to some [Element].
+   */
+  final bool isResolved;
+
+  /**
+   * Is `true` if field or method access is done using qualifier.
+   */
+  final bool isQualified;
+
+  Source _librarySource;
+  Source _unitSource;
+  LibraryElement _libraryElement;
+  Element _element;
+
+  SearchMatchImpl(this._context, this.libraryUri, this.unitUri, this.kind,
+      this.sourceRange, this.isResolved, this.isQualified);
+
+  /**
+   * Return the [Element] containing the match. Can return `null` if the unit
+   * does not exist, or its element was invalidated, or the element cannot be
+   * found, etc.
+   */
+  Element get element {
+    if (_element == null) {
+      CompilationUnitElement unitElement =
+          _context.getCompilationUnitElement(unitSource, librarySource);
+      if (unitElement != null) {
+        _ContainingElementFinder finder =
+            new _ContainingElementFinder(sourceRange.offset);
+        unitElement.accept(finder);
+        _element = finder.containingElement;
+      }
+    }
+    return _element;
+  }
+
+  /**
+   * The absolute path of the file containing the match.
+   */
+  String get file => unitSource.fullName;
+
+  @override
+  int get hashCode {
+    return JenkinsSmiHash.hash4(libraryUri.hashCode, unitUri.hashCode,
+        kind.hashCode, sourceRange.hashCode);
+  }
+
+  /**
+   * Return the [LibraryElement] for the [libraryUri] in the [context].
+   */
+  LibraryElement get libraryElement {
+    _libraryElement ??= _context.getLibraryElement(librarySource);
+    return _libraryElement;
+  }
+
+  /**
+   * The library [Source] of the reference.
+   */
+  Source get librarySource {
+    _librarySource ??= _context.sourceFactory.forUri(libraryUri);
+    return _librarySource;
+  }
+
+  /**
+   * The unit [Source] of the reference.
+   */
+  Source get unitSource {
+    _unitSource ??= _context.sourceFactory.forUri(unitUri);
+    return _unitSource;
+  }
+
+  @override
+  bool operator ==(Object object) {
+    if (identical(object, this)) {
+      return true;
+    }
+    if (object is SearchMatchImpl) {
+      return kind == object.kind &&
+          libraryUri == object.libraryUri &&
+          unitUri == object.unitUri &&
+          isResolved == object.isResolved &&
+          isQualified == object.isQualified &&
+          sourceRange == object.sourceRange;
+    }
+    return false;
+  }
+
+  @override
+  String toString() {
+    StringBuffer buffer = new StringBuffer();
+    buffer.write("SearchMatch(kind=");
+    buffer.write(kind);
+    buffer.write(", libraryUri=");
+    buffer.write(libraryUri);
+    buffer.write(", unitUri=");
+    buffer.write(unitUri);
+    buffer.write(", range=");
+    buffer.write(sourceRange);
+    buffer.write(", isResolved=");
+    buffer.write(isResolved);
+    buffer.write(", isQualified=");
+    buffer.write(isQualified);
+    buffer.write(")");
+    return buffer.toString();
+  }
+
+  /**
+   * Return elements of [matches] which has not-null elements.
+   *
+   * When [SearchMatch.element] is not `null` we cache its value, so it cannot
+   * become `null` later.
+   */
+  static List<SearchMatch> withNotNullElement(List<SearchMatch> matches) {
+    return matches.where((match) => match.element != null).toList();
+  }
+}
+
+/**
+ * A visitor that finds the deep-most [Element] that contains the [offset].
+ */
+class _ContainingElementFinder extends GeneralizingElementVisitor {
+  final int offset;
+  Element containingElement;
+
+  _ContainingElementFinder(this.offset);
+
+  visitElement(Element element) {
+    if (element is ElementImpl) {
+      if (element.codeOffset != null &&
+          element.codeOffset <= offset &&
+          offset <= element.codeOffset + element.codeLength) {
+        containingElement = element;
+        super.visitElement(element);
+      }
+    }
+  }
+}
+
+/**
  * Visitor that adds [SearchMatch]es for [importElement], both with an explicit
  * prefix or an implicit one.
  */
@@ -350,7 +521,7 @@
   }
 
   void _addMatchForRange(SourceRange range) {
-    matches.add(new SearchMatch(
+    matches.add(new SearchMatchImpl(
         context, libraryUri, unitUri, MatchKind.REFERENCE, range, true, false));
   }
 }
@@ -407,7 +578,7 @@
 
   void _addMatch(AstNode node, MatchKind kind) {
     bool isQualified = node.parent is Label;
-    matches.add(new SearchMatch(context, libraryUri, unitUri, kind,
+    matches.add(new SearchMatchImpl(context, libraryUri, unitUri, kind,
         rangeNode(node), true, isQualified));
   }
 }
diff --git a/pkg/analysis_server/lib/src/services/search/search_engine_internal2.dart b/pkg/analysis_server/lib/src/services/search/search_engine_internal2.dart
new file mode 100644
index 0000000..72cd494
--- /dev/null
+++ b/pkg/analysis_server/lib/src/services/search/search_engine_internal2.dart
@@ -0,0 +1,149 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+
+import 'package:analysis_server/src/services/search/search_engine.dart';
+import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer/src/dart/analysis/driver.dart';
+import 'package:analyzer/src/dart/analysis/search.dart';
+import 'package:analyzer/src/generated/source.dart' show Source, SourceRange;
+
+/**
+ * A [SearchEngine] implementation.
+ */
+class SearchEngineImpl2 implements SearchEngine {
+  final Iterable<AnalysisDriver> _drivers;
+
+  SearchEngineImpl2(this._drivers);
+
+  @override
+  Future<List<SearchMatch>> searchAllSubtypes(ClassElement type) async {
+    // TODO(scheglov) implement
+    return [];
+  }
+
+  @override
+  Future<List<SearchMatch>> searchMemberDeclarations(String name) async {
+    // TODO(scheglov) implement
+    return [];
+  }
+
+  @override
+  Future<List<SearchMatch>> searchMemberReferences(String name) async {
+    // TODO(scheglov) implement
+    return [];
+  }
+
+  @override
+  Future<List<SearchMatch>> searchReferences(Element element) async {
+    List<SearchResult> allResults = [];
+    for (AnalysisDriver driver in _drivers) {
+      List<SearchResult> results = await driver.search.references(element);
+      allResults.addAll(results);
+    }
+    return allResults.map(_SearchMatch.forSearchResult).toList();
+  }
+
+  @override
+  Future<List<SearchMatch>> searchSubtypes(ClassElement type) async {
+    // TODO(scheglov) implement
+    return [];
+  }
+
+  @override
+  Future<List<SearchMatch>> searchTopLevelDeclarations(String pattern) async {
+    // TODO(scheglov) implement
+    return [];
+  }
+}
+
+class _SearchMatch implements SearchMatch {
+  @override
+  final String file;
+
+  @override
+  final Source librarySource;
+
+  @override
+  final Source unitSource;
+
+  @override
+  final LibraryElement libraryElement;
+
+  @override
+  final Element element;
+
+  @override
+  final bool isResolved;
+
+  @override
+  final bool isQualified;
+
+  @override
+  final MatchKind kind;
+
+  @override
+  final SourceRange sourceRange;
+
+  _SearchMatch(
+      this.file,
+      this.librarySource,
+      this.unitSource,
+      this.libraryElement,
+      this.element,
+      this.isResolved,
+      this.isQualified,
+      this.kind,
+      this.sourceRange);
+
+  @override
+  String toString() {
+    StringBuffer buffer = new StringBuffer();
+    buffer.write("SearchMatch(kind=");
+    buffer.write(kind);
+    buffer.write(", libraryUri=");
+    buffer.write(librarySource.uri);
+    buffer.write(", unitUri=");
+    buffer.write(unitSource.uri);
+    buffer.write(", range=");
+    buffer.write(sourceRange);
+    buffer.write(", isResolved=");
+    buffer.write(isResolved);
+    buffer.write(", isQualified=");
+    buffer.write(isQualified);
+    buffer.write(")");
+    return buffer.toString();
+  }
+
+  static _SearchMatch forSearchResult(SearchResult result) {
+    Element enclosingElement = result.enclosingElement;
+    return new _SearchMatch(
+        enclosingElement.source.fullName,
+        enclosingElement.librarySource,
+        enclosingElement.source,
+        enclosingElement.library,
+        enclosingElement,
+        result.isResolved,
+        result.isQualified,
+        toMatchKind(result.kind),
+        new SourceRange(result.offset, result.length));
+  }
+
+  static MatchKind toMatchKind(SearchResultKind kind) {
+    if (kind == SearchResultKind.READ) {
+      return MatchKind.READ;
+    }
+    if (kind == SearchResultKind.READ_WRITE) {
+      return MatchKind.READ_WRITE;
+    }
+    if (kind == SearchResultKind.WRITE) {
+      return MatchKind.WRITE;
+    }
+    if (kind == SearchResultKind.INVOCATION) {
+      return MatchKind.INVOCATION;
+    }
+    return MatchKind.REFERENCE;
+  }
+}
diff --git a/pkg/analysis_server/lib/src/single_context_manager.dart b/pkg/analysis_server/lib/src/single_context_manager.dart
index 984bc73..fa99c96 100644
--- a/pkg/analysis_server/lib/src/single_context_manager.dart
+++ b/pkg/analysis_server/lib/src/single_context_manager.dart
@@ -11,6 +11,7 @@
 import 'package:analysis_server/src/context_manager.dart';
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/plugin/resolver_provider.dart';
+import 'package:analyzer/src/dart/analysis/driver.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/source.dart';
@@ -85,6 +86,11 @@
   ContextManagerCallbacks callbacks;
 
   /**
+   * The analysis driver which analyses everything.
+   */
+  AnalysisDriver analysisDriver;
+
+  /**
    * The context in which everything is being analyzed.
    */
   AnalysisContext context;
@@ -117,6 +123,9 @@
       context == null ? <AnalysisContext>[] : <AnalysisContext>[context];
 
   @override
+  Map<Folder, AnalysisDriver> get driverMap => {contextFolder: analysisDriver};
+
+  @override
   Map<Folder, AnalysisContext> get folderMap => {contextFolder: context};
 
   @override
diff --git a/pkg/analysis_server/lib/src/status/get_handler.dart b/pkg/analysis_server/lib/src/status/get_handler.dart
index b87a33e..d6ed6eb 100644
--- a/pkg/analysis_server/lib/src/status/get_handler.dart
+++ b/pkg/analysis_server/lib/src/status/get_handler.dart
@@ -46,8 +46,6 @@
 import 'package:analyzer/src/task/driver.dart';
 import 'package:analyzer/src/task/html.dart';
 import 'package:analyzer/src/task/options.dart';
-import 'package:analyzer/src/task/options.dart'
-    show CONFIGURED_ERROR_PROCESSORS;
 import 'package:analyzer/task/dart.dart';
 import 'package:analyzer/task/general.dart';
 import 'package:analyzer/task/html.dart';
@@ -61,6 +59,16 @@
  */
 typedef void HtmlGenerator(StringBuffer buffer);
 
+/**
+ * Instances of the class [AbstractGetHandler] handle GET requests.
+ */
+abstract class AbstractGetHandler {
+  /**
+   * Handle a GET request received by the HTTP server.
+   */
+  void handleGetRequest(HttpRequest request);
+}
+
 class ElementCounter extends RecursiveElementVisitor {
   Map<Type, int> counts = new HashMap<Type, int>();
   int elementsWithDocs = 0;
@@ -199,7 +207,7 @@
 /**
  * Instances of the class [GetHandler] handle GET requests.
  */
-class GetHandler {
+class GetHandler implements AbstractGetHandler {
   /**
    * The path used to request overall performance information.
    */
@@ -413,7 +421,7 @@
    */
   String _encodeSdkDescriptor(SdkDescription descriptor) {
     StringBuffer buffer = new StringBuffer();
-    buffer.write(descriptor.options.encodeCrossContextOptions());
+    buffer.write(descriptor.options.encodeCrossContextOptions().join(','));
     for (String path in descriptor.paths) {
       buffer.write('+');
       buffer.write(path);
@@ -1407,9 +1415,6 @@
       buffer.write('<p>');
       _writeOption(
           buffer, 'Analyze functon bodies', options.analyzeFunctionBodies);
-      _writeOption(buffer, 'Cache size', options.cacheSize);
-      _writeOption(
-          buffer, 'Enable generic methods', options.enableGenericMethods);
       _writeOption(
           buffer, 'Enable strict call checks', options.enableStrictCallChecks);
       _writeOption(buffer, 'Enable super mixins', options.enableSuperMixins);
@@ -1453,8 +1458,7 @@
             });
           },
           (StringBuffer buffer) {
-            List<Linter> lints =
-                context.getConfigurationData(CONFIGURED_LINTS_KEY);
+            List<Linter> lints = context.analysisOptions.lintRules;
             buffer.write('<p><b>Lints</b></p>');
             if (lints.isEmpty) {
               buffer.write('<p>none</p>');
@@ -1467,7 +1471,7 @@
             }
 
             List<ErrorProcessor> errorProcessors =
-                context.getConfigurationData(CONFIGURED_ERROR_PROCESSORS);
+                context.analysisOptions.errorProcessors;
             int processorCount = errorProcessors?.length ?? 0;
             buffer
                 .write('<p><b>Error Processor count</b>: $processorCount</p>');
@@ -2512,6 +2516,9 @@
       }
       buffer.write('<p>');
       buffer.write('Status: Running<br>');
+      buffer.write('New analysis driver: ');
+      buffer.write(analysisServer.options.enableNewAnalysisDriver);
+      buffer.write('<br>');
       buffer.write('Instrumentation: ');
       if (AnalysisEngine.instance.instrumentationService.isActive) {
         buffer.write('<span style="color:red">Active</span>');
diff --git a/pkg/analysis_server/lib/src/status/get_handler2.dart b/pkg/analysis_server/lib/src/status/get_handler2.dart
new file mode 100644
index 0000000..8bd958e
--- /dev/null
+++ b/pkg/analysis_server/lib/src/status/get_handler2.dart
@@ -0,0 +1,1242 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:convert';
+import 'dart:io';
+import 'dart:math';
+
+import 'package:analysis_server/plugin/protocol/protocol.dart' hide Element;
+import 'package:analysis_server/src/analysis_server.dart';
+import 'package:analysis_server/src/domain_completion.dart';
+import 'package:analysis_server/src/domain_diagnostic.dart';
+import 'package:analysis_server/src/domain_execution.dart';
+import 'package:analysis_server/src/services/completion/completion_performance.dart';
+import 'package:analysis_server/src/socket_server.dart';
+import 'package:analysis_server/src/status/get_handler.dart';
+import 'package:analyzer/exception/exception.dart';
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/source/error_processor.dart';
+import 'package:analyzer/source/sdk_ext.dart';
+import 'package:analyzer/src/context/source.dart';
+import 'package:analyzer/src/dart/analysis/driver.dart';
+import 'package:analyzer/src/dart/sdk/sdk.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/sdk.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/generated/utilities_general.dart';
+import 'package:analyzer/src/services/lint.dart';
+import 'package:analyzer/task/model.dart';
+import 'package:plugin/plugin.dart';
+
+/**
+ * A function that can be used to generate HTML output into the given [buffer].
+ * The HTML that is generated must be valid (special characters must already be
+ * encoded).
+ */
+typedef void HtmlGenerator(StringBuffer buffer);
+
+/**
+ * Instances of the class [GetHandler2] handle GET requests.
+ */
+class GetHandler2 implements AbstractGetHandler {
+  /**
+   * The path used to request overall performance information.
+   */
+  static const String ANALYSIS_PERFORMANCE_PATH = '/perf/analysis';
+
+  /**
+   * The path used to request code completion information.
+   */
+  static const String COMPLETION_PATH = '/completion';
+
+  /**
+   * The path used to request communication performance information.
+   */
+  static const String COMMUNICATION_PERFORMANCE_PATH = '/perf/communication';
+
+  /**
+   * The path used to request information about a specific context.
+   */
+  static const String CONTEXT_PATH = '/context';
+
+  /**
+   * The path used to request an overlay contents.
+   */
+  static const String OVERLAY_PATH = '/overlay';
+
+  /**
+   * The path used to request overlays information.
+   */
+  static const String OVERLAYS_PATH = '/overlays';
+
+  /**
+   * The path used to request the status of the analysis server as a whole.
+   */
+  static const String STATUS_PATH = '/status';
+
+  /**
+   * Query parameter used to represent the context to search for.
+   */
+  static const String CONTEXT_QUERY_PARAM = 'context';
+
+  /**
+   * Query parameter used to represent the path of an overlayed file.
+   */
+  static const String PATH_PARAM = 'path';
+
+  static final ContentType _htmlContent =
+      new ContentType("text", "html", charset: "utf-8");
+
+  /**
+   * The socket server whose status is to be reported on.
+   */
+  SocketServer _server;
+
+  /**
+   * Buffer containing strings printed by the analysis server.
+   */
+  List<String> _printBuffer;
+
+  /**
+   * Contents of overlay files.
+   */
+  final Map<String, String> _overlayContents = <String, String>{};
+
+  /**
+   * Handler for diagnostics requests.
+   */
+  DiagnosticDomainHandler _diagnosticHandler;
+
+  /**
+   * Initialize a newly created handler for GET requests.
+   */
+  GetHandler2(this._server, this._printBuffer);
+
+  DiagnosticDomainHandler get diagnosticHandler {
+    if (_diagnosticHandler == null) {
+      _diagnosticHandler = new DiagnosticDomainHandler(_server.analysisServer);
+    }
+    return _diagnosticHandler;
+  }
+
+  /**
+   * Return the active [CompletionDomainHandler]
+   * or `null` if either analysis server is not running
+   * or there is no completion domain handler.
+   */
+  CompletionDomainHandler get _completionDomainHandler {
+    AnalysisServer analysisServer = _server.analysisServer;
+    if (analysisServer == null) {
+      return null;
+    }
+    return analysisServer.handlers
+        .firstWhere((h) => h is CompletionDomainHandler, orElse: () => null);
+  }
+
+  /**
+   * Handle a GET request received by the HTTP server.
+   */
+  void handleGetRequest(HttpRequest request) {
+    String path = request.uri.path;
+    if (path == '/' || path == STATUS_PATH) {
+      _returnServerStatus(request);
+    } else if (path == ANALYSIS_PERFORMANCE_PATH) {
+      _returnAnalysisPerformance(request);
+    } else if (path == COMPLETION_PATH) {
+      _returnCompletionInfo(request);
+    } else if (path == COMMUNICATION_PERFORMANCE_PATH) {
+      _returnCommunicationPerformance(request);
+    } else if (path == CONTEXT_PATH) {
+      _returnContextInfo(request);
+    } else if (path == OVERLAY_PATH) {
+      _returnOverlayContents(request);
+    } else if (path == OVERLAYS_PATH) {
+      _returnOverlaysInfo(request);
+    } else {
+      _returnUnknownRequest(request);
+    }
+  }
+
+  /**
+   * Return the folder being managed by the given [analysisServer] that matches
+   * the given [contextFilter], or `null` if there is none.
+   */
+  Folder _findFolder(AnalysisServer analysisServer, String contextFilter) {
+    return analysisServer.driverMap.keys.firstWhere(
+        (Folder folder) => folder.path == contextFilter,
+        orElse: () => null);
+  }
+
+  /**
+   * Return `true` if the given analysis [driver] has at least one entry with
+   * an exception.
+   */
+  bool _hasException(AnalysisDriver driver) {
+//    if (driver == null) {
+//      return false;
+//    }
+//    MapIterator<AnalysisTarget, CacheEntry> iterator =
+//        context.analysisCache.iterator();
+//    while (iterator.moveNext()) {
+//      CacheEntry entry = iterator.value;
+//      if (entry == null || entry.exception != null) {
+//        return true;
+//      }
+//    }
+    // TODO(scheglov)
+    return false;
+  }
+
+  /**
+   * Return a response displaying overall performance information.
+   */
+  void _returnAnalysisPerformance(HttpRequest request) {
+    AnalysisServer analysisServer = _server.analysisServer;
+    if (analysisServer == null) {
+      return _returnFailure(request, 'Analysis server is not running');
+    }
+    _writeResponse(request, (StringBuffer buffer) {
+      _writePage(buffer, 'Analysis Server - Analysis Performance', [],
+          (StringBuffer buffer) {
+        buffer.write('<h3>Analysis Performance</h3>');
+        _writeTwoColumns(buffer, (StringBuffer buffer) {
+          //
+          // Write performance tags.
+          //
+          buffer.write('<p><b>Performance tag data</b></p>');
+          buffer.write(
+              '<table style="border-collapse: separate; border-spacing: 10px 5px;">');
+          _writeRow(buffer, ['Time (in ms)', 'Percent', 'Tag name'],
+              header: true);
+          // prepare sorted tags
+          List<PerformanceTag> tags = PerformanceTag.all.toList();
+          tags.remove(ServerPerformanceStatistics.idle);
+          tags.sort((a, b) => b.elapsedMs - a.elapsedMs);
+          // prepare total time
+          int totalTagTime = 0;
+          tags.forEach((PerformanceTag tag) {
+            totalTagTime += tag.elapsedMs;
+          });
+          // write rows
+          void writeRow(PerformanceTag tag) {
+            double percent = (tag.elapsedMs * 100) / totalTagTime;
+            String percentStr = '${percent.toStringAsFixed(2)}%';
+            _writeRow(buffer, [tag.elapsedMs, percentStr, tag.label],
+                classes: ["right", "right", null]);
+          }
+
+          tags.forEach(writeRow);
+          buffer.write('</table>');
+        }, (StringBuffer buffer) {
+          //
+          // Write task model timing information.
+          //
+          buffer.write('<p><b>Task performance data</b></p>');
+          buffer.write(
+              '<table style="border-collapse: separate; border-spacing: 10px 5px;">');
+          _writeRow(
+              buffer,
+              [
+                'Task Name',
+                'Count',
+                'Total Time (in ms)',
+                'Average Time (in ms)'
+              ],
+              header: true);
+
+          Map<Type, int> countMap = AnalysisTask.countMap;
+          Map<Type, Stopwatch> stopwatchMap = AnalysisTask.stopwatchMap;
+          List<Type> taskClasses = stopwatchMap.keys.toList();
+          taskClasses.sort((Type first, Type second) =>
+              first.toString().compareTo(second.toString()));
+          int totalTaskTime = 0;
+          taskClasses.forEach((Type taskClass) {
+            int count = countMap[taskClass];
+            if (count == null) {
+              count = 0;
+            }
+            int taskTime = stopwatchMap[taskClass].elapsedMilliseconds;
+            totalTaskTime += taskTime;
+            _writeRow(buffer, [
+              taskClass.toString(),
+              count,
+              taskTime,
+              count <= 0 ? '-' : (taskTime / count).toStringAsFixed(3)
+            ], classes: [
+              null,
+              "right",
+              "right",
+              "right"
+            ]);
+          });
+          _writeRow(buffer, ['Total', '-', totalTaskTime, '-'],
+              classes: [null, "right", "right", "right"]);
+          buffer.write('</table>');
+        });
+      });
+    });
+  }
+
+  /**
+   * Return a response displaying overall performance information.
+   */
+  void _returnCommunicationPerformance(HttpRequest request) {
+    AnalysisServer analysisServer = _server.analysisServer;
+    if (analysisServer == null) {
+      return _returnFailure(request, 'Analysis server is not running');
+    }
+    _writeResponse(request, (StringBuffer buffer) {
+      _writePage(buffer, 'Analysis Server - Communication Performance', [],
+          (StringBuffer buffer) {
+        buffer.write('<h3>Communication Performance</h3>');
+        _writeTwoColumns(buffer, (StringBuffer buffer) {
+          ServerPerformance perf = analysisServer.performanceDuringStartup;
+          int requestCount = perf.requestCount;
+          num averageLatency = requestCount > 0
+              ? (perf.requestLatency / requestCount).round()
+              : 0;
+          int maximumLatency = perf.maxLatency;
+          num slowRequestPercent = requestCount > 0
+              ? (perf.slowRequestCount * 100 / requestCount).round()
+              : 0;
+          buffer.write('<h4>Startup</h4>');
+          buffer.write('<table>');
+          _writeRow(buffer, [requestCount, 'requests'],
+              classes: ["right", null]);
+          _writeRow(buffer, [averageLatency, 'ms average latency'],
+              classes: ["right", null]);
+          _writeRow(buffer, [maximumLatency, 'ms maximum latency'],
+              classes: ["right", null]);
+          _writeRow(buffer, [slowRequestPercent, '% > 150 ms latency'],
+              classes: ["right", null]);
+          if (analysisServer.performanceAfterStartup != null) {
+            int startupTime = analysisServer.performanceAfterStartup.startTime -
+                perf.startTime;
+            _writeRow(
+                buffer, [startupTime, 'ms for initial analysis to complete']);
+          }
+          buffer.write('</table>');
+        }, (StringBuffer buffer) {
+          ServerPerformance perf = analysisServer.performanceAfterStartup;
+          if (perf == null) {
+            return;
+          }
+          int requestCount = perf.requestCount;
+          num averageLatency = requestCount > 0
+              ? (perf.requestLatency * 10 / requestCount).round() / 10
+              : 0;
+          int maximumLatency = perf.maxLatency;
+          num slowRequestPercent = requestCount > 0
+              ? (perf.slowRequestCount * 100 / requestCount).round()
+              : 0;
+          buffer.write('<h4>Current</h4>');
+          buffer.write('<table>');
+          _writeRow(buffer, [requestCount, 'requests'],
+              classes: ["right", null]);
+          _writeRow(buffer, [averageLatency, 'ms average latency'],
+              classes: ["right", null]);
+          _writeRow(buffer, [maximumLatency, 'ms maximum latency'],
+              classes: ["right", null]);
+          _writeRow(buffer, [slowRequestPercent, '% > 150 ms latency'],
+              classes: ["right", null]);
+          buffer.write('</table>');
+        });
+      });
+    });
+  }
+
+  /**
+   * Return a response displaying code completion information.
+   */
+  void _returnCompletionInfo(HttpRequest request) {
+    String value = request.requestedUri.queryParameters['index'];
+    int index = value != null ? int.parse(value, onError: (_) => 0) : 0;
+    _writeResponse(request, (StringBuffer buffer) {
+      _writePage(buffer, 'Analysis Server - Completion Stats', [],
+          (StringBuffer buffer) {
+        _writeCompletionPerformanceDetail(buffer, index);
+        _writeCompletionPerformanceList(buffer);
+      });
+    });
+  }
+
+  /**
+   * Return a response containing information about a single source file in the
+   * cache.
+   */
+  void _returnContextInfo(HttpRequest request) {
+    AnalysisServer analysisServer = _server.analysisServer;
+    if (analysisServer == null) {
+      return _returnFailure(request, 'Analysis server not running');
+    }
+    String contextFilter = request.uri.queryParameters[CONTEXT_QUERY_PARAM];
+    if (contextFilter == null) {
+      return _returnFailure(
+          request, 'Query parameter $CONTEXT_QUERY_PARAM required');
+    }
+    AnalysisDriver driver = null;
+    Folder folder = _findFolder(analysisServer, contextFilter);
+    if (folder == null) {
+      return _returnFailure(request, 'Invalid context: $contextFilter');
+    } else {
+      driver = analysisServer.driverMap[folder];
+    }
+
+    // TODO(scheglov) Show priority files.
+//    List<String> priorityNames = <String>[];
+    List<String> addedFiles = driver.addedFiles.toList();
+    List<String> implicitFiles =
+        driver.knownFiles.difference(driver.addedFiles).toList();
+    addedFiles.sort();
+    implicitFiles.sort();
+
+    // TODO(scheglov) Use file overlays.
+//    _overlayContents.clear();
+//    context.visitContentCache((String fullName, int stamp, String contents) {
+//      _overlayContents[fullName] = contents;
+//    });
+
+    void _writeFiles(StringBuffer buffer, String title, List<String> files) {
+      buffer.write('<h3>$title</h3>');
+      if (files == null || files.isEmpty) {
+        buffer.write('<p>None</p>');
+      } else {
+        buffer.write('<p><table style="width: 100%">');
+        for (String file in files) {
+          buffer.write('<tr><td>');
+          buffer.write(file);
+          buffer.write('</td><td>');
+          if (_overlayContents.containsKey(files)) {
+            buffer.write(makeLink(OVERLAY_PATH, {PATH_PARAM: file}, 'overlay'));
+          }
+          buffer.write('</td></tr>');
+        }
+        buffer.write('</table></p>');
+      }
+    }
+
+    void writeOptions(StringBuffer buffer, AnalysisOptionsImpl options,
+        {void writeAdditionalOptions(StringBuffer buffer)}) {
+      if (options == null) {
+        buffer.write('<p>No option information available.</p>');
+        return;
+      }
+      buffer.write('<p>');
+      _writeOption(
+          buffer, 'Analyze functon bodies', options.analyzeFunctionBodies);
+      _writeOption(
+          buffer, 'Enable strict call checks', options.enableStrictCallChecks);
+      _writeOption(buffer, 'Enable super mixins', options.enableSuperMixins);
+      _writeOption(buffer, 'Generate dart2js hints', options.dart2jsHint);
+      _writeOption(buffer, 'Generate errors in implicit files',
+          options.generateImplicitErrors);
+      _writeOption(
+          buffer, 'Generate errors in SDK files', options.generateSdkErrors);
+      _writeOption(buffer, 'Generate hints', options.hint);
+      _writeOption(buffer, 'Incremental resolution', options.incremental);
+      _writeOption(buffer, 'Incremental resolution with API changes',
+          options.incrementalApi);
+      _writeOption(buffer, 'Preserve comments', options.preserveComments);
+      _writeOption(buffer, 'Strong mode', options.strongMode);
+      _writeOption(buffer, 'Strong mode hints', options.strongModeHints);
+      if (writeAdditionalOptions != null) {
+        writeAdditionalOptions(buffer);
+      }
+      buffer.write('</p>');
+    }
+
+    _writeResponse(request, (StringBuffer buffer) {
+      _writePage(
+          buffer, 'Analysis Server - Context', ['Context: $contextFilter'],
+          (StringBuffer buffer) {
+        buffer.write('<h3>Configuration</h3>');
+
+        _writeColumns(buffer, <HtmlGenerator>[
+          (StringBuffer buffer) {
+            buffer.write('<p><b>Context Options</b></p>');
+            writeOptions(buffer, driver.analysisOptions);
+          },
+          (StringBuffer buffer) {
+            buffer.write('<p><b>SDK Context Options</b></p>');
+            DartSdk sdk = driver?.sourceFactory?.dartSdk;
+            writeOptions(buffer, sdk?.context?.analysisOptions,
+                writeAdditionalOptions: (StringBuffer buffer) {
+              if (sdk is FolderBasedDartSdk) {
+                _writeOption(buffer, 'Use summaries', sdk.useSummary);
+              }
+            });
+          },
+          (StringBuffer buffer) {
+            List<Linter> lints = driver.analysisOptions.lintRules;
+            buffer.write('<p><b>Lints</b></p>');
+            if (lints.isEmpty) {
+              buffer.write('<p>none</p>');
+            } else {
+              for (Linter lint in lints) {
+                buffer.write('<p>');
+                buffer.write(lint.runtimeType);
+                buffer.write('</p>');
+              }
+            }
+
+            List<ErrorProcessor> errorProcessors =
+                driver.analysisOptions.errorProcessors;
+            int processorCount = errorProcessors?.length ?? 0;
+            buffer
+                .write('<p><b>Error Processor count</b>: $processorCount</p>');
+          }
+        ]);
+
+        SourceFactory sourceFactory = driver.sourceFactory;
+        if (sourceFactory is SourceFactoryImpl) {
+          buffer.write('<h3>Resolvers</h3>');
+          for (UriResolver resolver in sourceFactory.resolvers) {
+            buffer.write('<p>');
+            buffer.write(resolver.runtimeType);
+            if (resolver is DartUriResolver) {
+              DartSdk sdk = resolver.dartSdk;
+              buffer.write(' (sdk = ');
+              buffer.write(sdk.runtimeType);
+              if (sdk is FolderBasedDartSdk) {
+                buffer.write(' (path = ');
+                buffer.write(sdk.directory.path);
+                buffer.write(')');
+              } else if (sdk is EmbedderSdk) {
+                buffer.write(' (map = ');
+                _writeMapOfStringToString(buffer, sdk.urlMappings);
+                buffer.write(')');
+              }
+              buffer.write(')');
+            } else if (resolver is SdkExtUriResolver) {
+              buffer.write(' (map = ');
+              _writeMapOfStringToString(buffer, resolver.urlMappings);
+              buffer.write(')');
+            }
+            buffer.write('</p>');
+          }
+        }
+
+        // TODO(scheglov) Show priority files.
+//        _writeFiles(
+//            buffer, 'Priority Files (${priorityNames.length})', priorityNames);
+        _writeFiles(buffer, 'Added Files (${addedFiles.length})', addedFiles);
+        _writeFiles(
+            buffer,
+            'Implicitly Analyzed Files (${implicitFiles.length})',
+            implicitFiles);
+
+        // TODO(scheglov) Show exceptions.
+//        buffer.write('<h3>Exceptions</h3>');
+//        if (exceptions.isEmpty) {
+//          buffer.write('<p>none</p>');
+//        } else {
+//          exceptions.forEach((CaughtException exception) {
+//            _writeException(buffer, exception);
+//          });
+//        }
+      });
+    });
+  }
+
+  void _returnFailure(HttpRequest request, String message) {
+    _writeResponse(request, (StringBuffer buffer) {
+      _writePage(buffer, 'Analysis Server - Failure', [],
+          (StringBuffer buffer) {
+        buffer.write(HTML_ESCAPE.convert(message));
+      });
+    });
+  }
+
+  void _returnOverlayContents(HttpRequest request) {
+    String path = request.requestedUri.queryParameters[PATH_PARAM];
+    if (path == null) {
+      return _returnFailure(request, 'Query parameter $PATH_PARAM required');
+    }
+    String contents = _overlayContents[path];
+
+    _writeResponse(request, (StringBuffer buffer) {
+      _writePage(buffer, 'Analysis Server - Overlay', [],
+          (StringBuffer buffer) {
+        buffer.write('<pre>${HTML_ESCAPE.convert(contents)}</pre>');
+      });
+    });
+  }
+
+  /**
+   * Return a response displaying overlays information.
+   */
+  void _returnOverlaysInfo(HttpRequest request) {
+    AnalysisServer analysisServer = _server.analysisServer;
+    if (analysisServer == null) {
+      return _returnFailure(request, 'Analysis server is not running');
+    }
+
+    _writeResponse(request, (StringBuffer buffer) {
+      _writePage(buffer, 'Analysis Server - Overlays', [],
+          (StringBuffer buffer) {
+        buffer.write('<table border="1">');
+        _overlayContents.clear();
+        ContentCache overlayState = analysisServer.overlayState;
+        overlayState.accept((String fullName, int stamp, String contents) {
+          buffer.write('<tr>');
+          String link =
+              makeLink(OVERLAY_PATH, {PATH_PARAM: fullName}, fullName);
+          DateTime time = new DateTime.fromMillisecondsSinceEpoch(stamp);
+          _writeRow(buffer, [link, time]);
+          _overlayContents[fullName] = contents;
+        });
+        int count = _overlayContents.length;
+        buffer.write('<tr><td colspan="2">Total: $count entries.</td></tr>');
+        buffer.write('</table>');
+      });
+    });
+  }
+
+  /**
+   * Return a response indicating the status of the analysis server.
+   */
+  void _returnServerStatus(HttpRequest request) {
+    _writeResponse(request, (StringBuffer buffer) {
+      _writePage(buffer, 'Analysis Server - Status', [], (StringBuffer buffer) {
+        if (_writeServerStatus(buffer)) {
+          _writeAnalysisStatus(buffer);
+          _writeEditStatus(buffer);
+          _writeExecutionStatus(buffer);
+          _writePluginStatus(buffer);
+          _writeRecentOutput(buffer);
+        }
+      });
+    });
+  }
+
+  /**
+   * Return an error in response to an unrecognized request received by the HTTP
+   * server.
+   */
+  void _returnUnknownRequest(HttpRequest request) {
+    _writeResponse(request, (StringBuffer buffer) {
+      _writePage(buffer, 'Analysis Server', [], (StringBuffer buffer) {
+        buffer.write('<h3>Unknown page: ');
+        buffer.write(request.uri.path);
+        buffer.write('</h3>');
+        buffer.write('''
+        <p>
+        You have reached an un-recognized page. If you reached this page by
+        following a link from a status page, please report the broken link to
+        the Dart analyzer team:
+        <a>https://github.com/dart-lang/sdk/issues/new</a>.
+        </p><p>
+        If you mistyped the URL, you can correct it or return to
+        ${makeLink(STATUS_PATH, {}, 'the main status page')}.
+        </p>''');
+      });
+    });
+  }
+
+  /**
+   * Return a two digit decimal representation of the given non-negative integer
+   * [value].
+   */
+  String _twoDigit(int value) {
+    if (value < 10) {
+      return '0$value';
+    }
+    return value.toString();
+  }
+
+  /**
+   * Write the status of the analysis domain (on the main status page) to the
+   * given [buffer] object.
+   */
+  void _writeAnalysisStatus(StringBuffer buffer) {
+    AnalysisServer analysisServer = _server.analysisServer;
+    Map<Folder, AnalysisDriver> driverMap = analysisServer.driverMap;
+    List<Folder> folders = driverMap.keys.toList();
+    folders.sort((Folder first, Folder second) =>
+        first.shortName.compareTo(second.shortName));
+
+    buffer.write('<h3>Analysis Domain</h3>');
+    _writeTwoColumns(buffer, (StringBuffer buffer) {
+      buffer.write('<p>Using package resolver provider: ');
+      buffer.write(_server.packageResolverProvider != null);
+      buffer.write('</p>');
+      buffer.write('<p>');
+      buffer.write(makeLink(OVERLAYS_PATH, {}, 'All overlay information'));
+      buffer.write('</p>');
+
+      buffer.write('<p><b>Analysis Contexts</b></p>');
+      buffer.write('<p>');
+      bool first = true;
+      folders.forEach((Folder folder) {
+        if (first) {
+          first = false;
+        } else {
+          buffer.write('<br>');
+        }
+        String key = folder.shortName;
+        buffer.write(makeLink(CONTEXT_PATH, {CONTEXT_QUERY_PARAM: folder.path},
+            key, _hasException(driverMap[folder])));
+        if (!folder.getChild('.packages').exists) {
+          buffer.write(' <small>[no .packages file]</small>');
+        }
+      });
+      buffer.write('</p>');
+
+      int freq = AnalysisServer.performOperationDelayFrequency;
+      String delay = freq > 0 ? '1 ms every $freq ms' : 'off';
+
+      buffer.write('<p><b>Performance Data</b></p>');
+      buffer.write('<p>Perform operation delay: $delay</p>');
+      buffer.write('<p>');
+      buffer.write(makeLink(ANALYSIS_PERFORMANCE_PATH, {}, 'Task data'));
+      buffer.write('</p>');
+    }, (StringBuffer buffer) {
+      _writeSubscriptionMap(
+          buffer, AnalysisService.VALUES, analysisServer.analysisServices);
+    });
+  }
+
+  /**
+   * Write multiple columns of information to the given [buffer], where the list
+   * of [columns] functions are used to generate the content of those columns.
+   */
+  void _writeColumns(StringBuffer buffer, List<HtmlGenerator> columns) {
+    buffer
+        .write('<table class="column"><tr class="column"><td class="column">');
+    int count = columns.length;
+    for (int i = 0; i < count; i++) {
+      if (i > 0) {
+        buffer.write('</td><td class="column">');
+      }
+      columns[i](buffer);
+    }
+    buffer.write('</td></tr></table>');
+  }
+
+  /**
+   * Write performance information about a specific completion request
+   * to the given [buffer] object.
+   */
+  void _writeCompletionPerformanceDetail(StringBuffer buffer, int index) {
+    CompletionDomainHandler handler = _completionDomainHandler;
+    CompletionPerformance performance;
+    if (handler != null) {
+      List<CompletionPerformance> list = handler.performanceList;
+      if (list != null && list.isNotEmpty) {
+        performance = list[max(0, min(list.length - 1, index))];
+      }
+    }
+    if (performance == null) {
+      buffer.write('<h3>Completion Performance Detail</h3>');
+      buffer.write('<p>No completions yet</p>');
+      return;
+    }
+    buffer.write('<h3>Completion Performance Detail</h3>');
+    buffer.write('<p>${performance.startTimeAndMs} for ${performance.source}');
+    buffer.write('<table>');
+    _writeRow(buffer, ['Elapsed', '', 'Operation'], header: true);
+    performance.operations.forEach((OperationPerformance op) {
+      String elapsed = op.elapsed != null ? op.elapsed.toString() : '???';
+      _writeRow(buffer, [elapsed, '&nbsp;&nbsp;', op.name]);
+    });
+    buffer.write('</table>');
+    buffer.write('<p><b>Compute Cache Performance</b>: ');
+    if (handler.computeCachePerformance == null) {
+      buffer.write('none');
+    } else {
+      int elapsed = handler.computeCachePerformance.elapsedInMilliseconds;
+      Source source = handler.computeCachePerformance.source;
+      buffer.write(' $elapsed ms for $source');
+    }
+    buffer.write('</p>');
+  }
+
+  /**
+   * Write a table showing summary information for the last several
+   * completion requests to the given [buffer] object.
+   */
+  void _writeCompletionPerformanceList(StringBuffer buffer) {
+    CompletionDomainHandler handler = _completionDomainHandler;
+    buffer.write('<h3>Completion Performance List</h3>');
+    if (handler == null) {
+      return;
+    }
+    buffer.write('<table>');
+    _writeRow(
+        buffer,
+        [
+          'Start Time',
+          '',
+          'First (ms)',
+          '',
+          'Complete (ms)',
+          '',
+          '# Notifications',
+          '',
+          '# Suggestions',
+          '',
+          'Snippet'
+        ],
+        header: true);
+    int index = 0;
+    for (CompletionPerformance performance in handler.performanceList) {
+      String link = makeLink(COMPLETION_PATH, {'index': '$index'},
+          '${performance.startTimeAndMs}');
+      _writeRow(buffer, [
+        link,
+        '&nbsp;&nbsp;',
+        performance.firstNotificationInMilliseconds,
+        '&nbsp;&nbsp;',
+        performance.elapsedInMilliseconds,
+        '&nbsp;&nbsp;',
+        performance.notificationCount,
+        '&nbsp;&nbsp;',
+        performance.suggestionCount,
+        '&nbsp;&nbsp;',
+        HTML_ESCAPE.convert(performance.snippet)
+      ]);
+      ++index;
+    }
+
+    buffer.write('</table>');
+    buffer.write('''
+      <p><strong>First (ms)</strong> - the number of milliseconds
+        from when completion received the request until the first notification
+        with completion results was queued for sending back to the client.
+      <p><strong>Complete (ms)</strong> - the number of milliseconds
+        from when completion received the request until the final notification
+        with completion results was queued for sending back to the client.
+      <p><strong># Notifications</strong> - the total number of notifications
+        sent to the client with completion results for this request.
+      <p><strong># Suggestions</strong> - the number of suggestions
+        sent to the client in the first notification, followed by a comma,
+        followed by the number of suggestions send to the client
+        in the last notification. If there is only one notification,
+        then there will be only one number in this column.''');
+  }
+
+  /**
+   * Write the status of the edit domain (on the main status page) to the given
+   * [buffer].
+   */
+  void _writeEditStatus(StringBuffer buffer) {
+    buffer.write('<h3>Edit Domain</h3>');
+    _writeTwoColumns(buffer, (StringBuffer buffer) {
+      buffer.write('<p><b>Performance Data</b></p>');
+      buffer.write('<p>');
+      buffer.write(makeLink(COMPLETION_PATH, {}, 'Completion data'));
+      buffer.write('</p>');
+    }, (StringBuffer buffer) {});
+  }
+
+  /**
+   * Write a representation of the given [caughtException] to the given
+   * [buffer]. If [isCause] is `true`, then the exception was a cause for
+   * another exception.
+   */
+  void _writeException(StringBuffer buffer, CaughtException caughtException,
+      {bool isCause: false}) {
+    Object exception = caughtException.exception;
+
+    if (exception is AnalysisException) {
+      buffer.write('<p>');
+      if (isCause) {
+        buffer.write('Caused by ');
+      }
+      buffer.write(exception.message);
+      buffer.write('</p>');
+      _writeStackTrace(buffer, caughtException.stackTrace);
+      CaughtException cause = exception.cause;
+      if (cause != null) {
+        buffer.write('<blockquote>');
+        _writeException(buffer, cause, isCause: true);
+        buffer.write('</blockquote>');
+      }
+    } else {
+      buffer.write('<p>');
+      if (isCause) {
+        buffer.write('Caused by ');
+      }
+      buffer.write(exception.toString());
+      buffer.write('<p>');
+      _writeStackTrace(buffer, caughtException.stackTrace);
+    }
+  }
+
+  /**
+   * Write the status of the execution domain (on the main status page) to the
+   * given [buffer].
+   */
+  void _writeExecutionStatus(StringBuffer buffer) {
+    AnalysisServer analysisServer = _server.analysisServer;
+    ExecutionDomainHandler handler = analysisServer.handlers.firstWhere(
+        (RequestHandler handler) => handler is ExecutionDomainHandler,
+        orElse: () => null);
+    Set<ExecutionService> services = new Set<ExecutionService>();
+    if (handler.onFileAnalyzed != null) {
+      services.add(ExecutionService.LAUNCH_DATA);
+    }
+
+    if (handler != null) {
+      buffer.write('<h3>Execution Domain</h3>');
+      _writeTwoColumns(buffer, (StringBuffer buffer) {
+        _writeSubscriptionList(buffer, ExecutionService.VALUES, services);
+      }, (StringBuffer buffer) {});
+    }
+  }
+
+  /**
+   * Write to the given [buffer] a representation of the given [map] of strings
+   * to strings.
+   */
+  void _writeMapOfStringToString(StringBuffer buffer, Map<String, String> map) {
+    List<String> keys = map.keys.toList();
+    keys.sort();
+    int length = keys.length;
+    buffer.write('{');
+    for (int i = 0; i < length; i++) {
+      buffer.write('<br>');
+      String key = keys[i];
+      if (i > 0) {
+        buffer.write(', ');
+      }
+      buffer.write(key);
+      buffer.write(' = ');
+      buffer.write(map[key]);
+    }
+    buffer.write('<br>}');
+  }
+
+  /**
+   * Write a representation of an analysis option with the given [name] and
+   * [value] to the given [buffer]. The option should be separated from other
+   * options unless the [last] flag is true, indicating that this is the last
+   * option in the list of options.
+   */
+  void _writeOption(StringBuffer buffer, String name, Object value,
+      {bool last: false}) {
+    buffer.write(name);
+    buffer.write(' = ');
+    buffer.write(value.toString());
+    if (!last) {
+      buffer.write('<br>');
+    }
+  }
+
+  /**
+   * Write a standard HTML page to the given [buffer]. The page will have the
+   * given [title] and a body that is generated by the given [body] generator.
+   */
+  void _writePage(StringBuffer buffer, String title, List<String> subtitles,
+      HtmlGenerator body) {
+    DateTime now = new DateTime.now();
+    String date = "${now.month}/${now.day}/${now.year}";
+    String time =
+        "${now.hour}:${_twoDigit(now.minute)}:${_twoDigit(now.second)}.${now.millisecond}";
+
+    buffer.write('<!DOCTYPE html>');
+    buffer.write('<html>');
+    buffer.write('<head>');
+    buffer.write('<meta charset="utf-8">');
+    buffer.write(
+        '<meta name="viewport" content="width=device-width, initial-scale=1.0">');
+    buffer.write('<title>$title</title>');
+    buffer.write('<style>');
+    buffer.write('a {color: #0000DD; text-decoration: none;}');
+    buffer.write('a:link.error {background-color: #FFEEEE;}');
+    buffer.write('a:visited.error {background-color: #FFEEEE;}');
+    buffer.write('a:hover.error {background-color: #FFEEEE;}');
+    buffer.write('a:active.error {background-color: #FFEEEE;}');
+    buffer.write(
+        'h3 {background-color: #DDDDDD; margin-top: 0em; margin-bottom: 0em;}');
+    buffer.write('p {margin-top: 0.5em; margin-bottom: 0.5em;}');
+    buffer.write(
+        'p.commentary {margin-top: 1em; margin-bottom: 1em; margin-left: 2em; font-style: italic;}');
+//    response.write('span.error {text-decoration-line: underline; text-decoration-color: red; text-decoration-style: wavy;}');
+    buffer.write(
+        'table.column {border: 0px solid black; width: 100%; table-layout: fixed;}');
+    buffer.write('td.column {vertical-align: top; width: 50%;}');
+    buffer.write('td.right {text-align: right;}');
+    buffer.write('th {text-align: left; vertical-align:top;}');
+    buffer.write('tr {vertical-align:top;}');
+    buffer.write('</style>');
+    buffer.write('</head>');
+
+    buffer.write('<body>');
+    buffer.write(
+        '<h2>$title <small><small>(as of $time on $date)</small></small></h2>');
+    if (subtitles != null && subtitles.isNotEmpty) {
+      buffer.write('<blockquote>');
+      bool first = true;
+      for (String subtitle in subtitles) {
+        if (first) {
+          first = false;
+        } else {
+          buffer.write('<br>');
+        }
+        buffer.write('<b>');
+        buffer.write(subtitle);
+        buffer.write('</b>');
+      }
+      buffer.write('</blockquote>');
+    }
+    try {
+      body(buffer);
+    } catch (exception, stackTrace) {
+      buffer.write('<h3>Exception while creating page</h3>');
+      _writeException(buffer, new CaughtException(exception, stackTrace));
+    }
+    buffer.write('</body>');
+    buffer.write('</html>');
+  }
+
+  /**
+   * Write the recent output section (on the main status page) to the given
+   * [buffer] object.
+   */
+  void _writePluginStatus(StringBuffer buffer) {
+    void writePlugin(Plugin plugin) {
+      buffer.write(plugin.uniqueIdentifier);
+      buffer.write(' (');
+      buffer.write(plugin.runtimeType);
+      buffer.write(')<br>');
+    }
+
+    buffer.write('<h3>Plugin Status</h3><p>');
+    writePlugin(AnalysisEngine.instance.enginePlugin);
+    writePlugin(_server.serverPlugin);
+    for (Plugin plugin in _server.analysisServer.userDefinedPlugins) {
+      writePlugin(plugin);
+    }
+    buffer.write('<p>');
+  }
+
+  /**
+   * Write the recent output section (on the main status page) to the given
+   * [buffer] object.
+   */
+  void _writeRecentOutput(StringBuffer buffer) {
+    buffer.write('<h3>Recent Output</h3>');
+    String output = HTML_ESCAPE.convert(_printBuffer.join('\n'));
+    if (output.isEmpty) {
+      buffer.write('<i>none</i>');
+    } else {
+      buffer.write('<pre>');
+      buffer.write(output);
+      buffer.write('</pre>');
+    }
+  }
+
+  void _writeResponse(HttpRequest request, HtmlGenerator writePage) {
+    HttpResponse response = request.response;
+    response.statusCode = HttpStatus.OK;
+    response.headers.contentType = _htmlContent;
+    try {
+      StringBuffer buffer = new StringBuffer();
+      try {
+        writePage(buffer);
+      } catch (exception, stackTrace) {
+        buffer.clear();
+        _writePage(buffer, 'Internal Exception', [], (StringBuffer buffer) {
+          _writeException(buffer, new CaughtException(exception, stackTrace));
+        });
+      }
+      response.write(buffer.toString());
+    } finally {
+      response.close();
+    }
+  }
+
+  /**
+   * Write a single row within a table to the given [buffer]. The row will have
+   * one cell for each of the [columns], and will be a header row if [header] is
+   * `true`.
+   */
+  void _writeRow(StringBuffer buffer, List<Object> columns,
+      {bool header: false, List<String> classes}) {
+    buffer.write('<tr>');
+    int count = columns.length;
+    int maxClassIndex = classes == null ? 0 : classes.length - 1;
+    for (int i = 0; i < count; i++) {
+      String classAttribute = '';
+      if (classes != null) {
+        String className = classes[min(i, maxClassIndex)];
+        if (className != null) {
+          classAttribute = ' class="$className"';
+        }
+      }
+      if (header) {
+        buffer.write('<th$classAttribute>');
+      } else {
+        buffer.write('<td$classAttribute>');
+      }
+      buffer.write(columns[i]);
+      if (header) {
+        buffer.write('</th>');
+      } else {
+        buffer.write('</td>');
+      }
+    }
+    buffer.write('</tr>');
+  }
+
+  /**
+   * Write the status of the service domain (on the main status page) to the
+   * given [response] object.
+   */
+  bool _writeServerStatus(StringBuffer buffer) {
+    AnalysisServer analysisServer = _server.analysisServer;
+    Set<ServerService> services = analysisServer.serverServices;
+
+    buffer.write('<h3>Server Domain</h3>');
+    _writeTwoColumns(buffer, (StringBuffer buffer) {
+      if (analysisServer == null) {
+        buffer.write('Status: <span style="color:red">Not running</span>');
+        return;
+      }
+      buffer.write('<p>');
+      buffer.write('Status: Running<br>');
+      buffer.write('New analysis driver: ');
+      buffer.write(analysisServer.options.enableNewAnalysisDriver);
+      buffer.write('<br>');
+      buffer.write('Instrumentation: ');
+      if (AnalysisEngine.instance.instrumentationService.isActive) {
+        buffer.write('<span style="color:red">Active</span>');
+      } else {
+        buffer.write('Inactive');
+      }
+      buffer.write('<br>');
+      buffer.write('Version: ');
+      buffer.write(AnalysisServer.VERSION);
+      buffer.write('<br>');
+      buffer.write('Process ID: ');
+      buffer.write(pid);
+      buffer.write('</p>');
+
+      buffer.write('<p><b>Performance Data</b></p>');
+      buffer.write('<p>');
+      buffer.write(makeLink(
+          COMMUNICATION_PERFORMANCE_PATH, {}, 'Communication performance'));
+      buffer.write('</p>');
+    }, (StringBuffer buffer) {
+      _writeSubscriptionList(buffer, ServerService.VALUES, services);
+    });
+    return analysisServer != null;
+  }
+
+  /**
+   * Write a representation of the given [stackTrace] to the given [buffer].
+   */
+  void _writeStackTrace(StringBuffer buffer, StackTrace stackTrace) {
+    if (stackTrace != null) {
+      String trace = stackTrace.toString().replaceAll('#', '<br>#');
+      if (trace.startsWith('<br>#')) {
+        trace = trace.substring(4);
+      }
+      buffer.write('<p>');
+      buffer.write(trace);
+      buffer.write('</p>');
+    }
+  }
+
+  /**
+   * Given a [service] that could be subscribed to and a set of the services
+   * that are actually subscribed to ([subscribedServices]), write a
+   * representation of the service to the given [buffer].
+   */
+  void _writeSubscriptionInList(
+      StringBuffer buffer, Enum service, Set<Enum> subscribedServices) {
+    if (subscribedServices.contains(service)) {
+      buffer.write('<code>+ </code>');
+    } else {
+      buffer.write('<code>- </code>');
+    }
+    buffer.write(service.name);
+    buffer.write('<br>');
+  }
+
+  /**
+   * Given a [service] that could be subscribed to and a set of paths that are
+   * subscribed to the services ([subscribedPaths]), write a representation of
+   * the service to the given [buffer].
+   */
+  void _writeSubscriptionInMap(
+      StringBuffer buffer, Enum service, Set<String> subscribedPaths) {
+    buffer.write('<p>');
+    buffer.write(service.name);
+    buffer.write('</p>');
+    if (subscribedPaths == null || subscribedPaths.isEmpty) {
+      buffer.write('none');
+    } else {
+      List<String> paths = subscribedPaths.toList();
+      paths.sort();
+      for (String path in paths) {
+        buffer.write('<p>');
+        buffer.write(path);
+        buffer.write('</p>');
+      }
+    }
+  }
+
+  /**
+   * Given a list containing all of the services that can be subscribed to in a
+   * single domain ([allServices]) and a set of the services that are actually
+   * subscribed to ([subscribedServices]), write a representation of the
+   * subscriptions to the given [buffer].
+   */
+  void _writeSubscriptionList(StringBuffer buffer, List<Enum> allServices,
+      Set<Enum> subscribedServices) {
+    buffer.write('<p><b>Subscriptions</b></p>');
+    buffer.write('<p>');
+    for (Enum service in allServices) {
+      _writeSubscriptionInList(buffer, service, subscribedServices);
+    }
+    buffer.write('</p>');
+  }
+
+  /**
+   * Given a list containing all of the services that can be subscribed to in a
+   * single domain ([allServices]) and a set of the services that are actually
+   * subscribed to ([subscribedServices]), write a representation of the
+   * subscriptions to the given [buffer].
+   */
+  void _writeSubscriptionMap(StringBuffer buffer, List<Enum> allServices,
+      Map<Enum, Set<String>> subscribedServices) {
+    buffer.write('<p><b>Subscriptions</b></p>');
+    for (Enum service in allServices) {
+      _writeSubscriptionInMap(buffer, service, subscribedServices[service]);
+    }
+  }
+
+  /**
+   * Write two columns of information to the given [buffer], where the
+   * [leftColumn] and [rightColumn] functions are used to generate the content
+   * of those columns.
+   */
+  void _writeTwoColumns(StringBuffer buffer, HtmlGenerator leftColumn,
+      HtmlGenerator rightColumn) {
+    buffer
+        .write('<table class="column"><tr class="column"><td class="column">');
+    leftColumn(buffer);
+    buffer.write('</td><td class="column">');
+    rightColumn(buffer);
+    buffer.write('</td></tr></table>');
+  }
+
+  /**
+   * Create a link to [path] with query parameters [params], with inner HTML
+   * [innerHtml]. If [hasError] is `true`, then the link will have the class
+   * 'error'.
+   */
+  static String makeLink(
+      String path, Map<String, String> params, String innerHtml,
+      [bool hasError = false]) {
+    Uri uri = params.isEmpty
+        ? new Uri(path: path)
+        : new Uri(path: path, queryParameters: params);
+    String href = HTML_ESCAPE.convert(uri.toString());
+    String classAttribute = hasError ? ' class="error"' : '';
+    return '<a href="$href"$classAttribute>$innerHtml</a>';
+  }
+}
diff --git a/pkg/analysis_server/lib/src/status/memory_use.dart b/pkg/analysis_server/lib/src/status/memory_use.dart
index 92657bc..8f68b0f 100644
--- a/pkg/analysis_server/lib/src/status/memory_use.dart
+++ b/pkg/analysis_server/lib/src/status/memory_use.dart
@@ -225,8 +225,10 @@
     DartSdkManager manager = server.sdkManager;
     List<SdkDescription> descriptors = manager.sdkDescriptors;
     for (SdkDescription descriptor in descriptors) {
-      _processAnalysisContext(
-          manager.getSdk(descriptor, () => null).context, manager);
+      DartSdk sdk = manager.getSdk(descriptor, () => null);
+      if (sdk != null) {
+        _processAnalysisContext(sdk.context, manager);
+      }
     }
   }
 
diff --git a/pkg/analysis_server/pubspec.yaml b/pkg/analysis_server/pubspec.yaml
index 297a3b0..cb366f9 100644
--- a/pkg/analysis_server/pubspec.yaml
+++ b/pkg/analysis_server/pubspec.yaml
@@ -6,7 +6,7 @@
 environment:
   sdk: '>=1.12.0 <2.0.0'
 dependencies:
-  analyzer: ^0.27.0
+  analyzer: ^0.28.0
   args: '>=0.13.0 <0.14.0'
   dart_style: '>=0.2.0 <0.3.0'
   isolate: ^0.2.2
@@ -19,7 +19,6 @@
   yaml: any
 dev_dependencies:
   html: any
-  mock: '>=0.11.0 <0.12.0'
-  test_reflective_loader: '>=0.0.4 <0.1.0'
+  test_reflective_loader: ^0.1.0
   typed_mock: '>=0.0.4 <1.0.0'
-  unittest: '>=0.11.4 <0.12.0'
+  test: ^0.12.0
diff --git a/pkg/analysis_server/test/abstract_context.dart b/pkg/analysis_server/test/abstract_context.dart
index d7b70df..2b7a648 100644
--- a/pkg/analysis_server/test/abstract_context.dart
+++ b/pkg/analysis_server/test/abstract_context.dart
@@ -49,13 +49,13 @@
   AnalysisContext context;
 
   Source addPackageSource(String packageName, String filePath, String content) {
-    packageMap[packageName] = [(provider.newFolder('/pubcache/$packageName'))];
-    File file = provider.newFile('/pubcache/$packageName/$filePath', content);
+    packageMap[packageName] = [(newFolder('/pubcache/$packageName'))];
+    File file = newFile('/pubcache/$packageName/$filePath', content);
     return file.createSource();
   }
 
   Source addSource(String path, String content, [Uri uri]) {
-    File file = provider.newFile(path, content);
+    File file = newFile(path, content);
     Source source = file.createSource(uri);
     ChangeSet changeSet = new ChangeSet();
     changeSet.addedSource(source);
@@ -64,6 +64,12 @@
     return source;
   }
 
+  File newFile(String path, [String content]) =>
+      provider.newFile(provider.convertPath(path), content ?? '');
+
+  Folder newFolder(String path) =>
+      provider.newFolder(provider.convertPath(path));
+
   /**
    * Performs all analysis tasks in [context].
    */
diff --git a/pkg/analysis_server/test/abstract_single_unit.dart b/pkg/analysis_server/test/abstract_single_unit.dart
index 307f251..bda1d20 100644
--- a/pkg/analysis_server/test/abstract_single_unit.dart
+++ b/pkg/analysis_server/test/abstract_single_unit.dart
@@ -10,7 +10,7 @@
 import 'package:analyzer/src/dart/ast/utilities.dart';
 import 'package:analyzer/src/generated/java_engine.dart';
 import 'package:analyzer/src/generated/source.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import 'abstract_context.dart';
 
diff --git a/pkg/analysis_server/test/analysis/get_errors_test.dart b/pkg/analysis_server/test/analysis/get_errors_test.dart
index a665cfa..f58aad9 100644
--- a/pkg/analysis_server/test/analysis/get_errors_test.dart
+++ b/pkg/analysis_server/test/analysis/get_errors_test.dart
@@ -8,15 +8,15 @@
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/domain_analysis.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(GetErrorsTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(GetErrorsTest);
+  });
 }
 
 @reflectiveTest
@@ -26,7 +26,9 @@
   @override
   void setUp() {
     super.setUp();
-    server.handlers = [new AnalysisDomainHandler(server),];
+    server.handlers = [
+      new AnalysisDomainHandler(server),
+    ];
     createProject();
   }
 
diff --git a/pkg/analysis_server/test/analysis/get_hover_test.dart b/pkg/analysis_server/test/analysis/get_hover_test.dart
index bbf8cbf..7f48ae2 100644
--- a/pkg/analysis_server/test/analysis/get_hover_test.dart
+++ b/pkg/analysis_server/test/analysis/get_hover_test.dart
@@ -7,15 +7,15 @@
 import 'dart:async';
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AnalysisHoverTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisHoverTest);
+  });
 }
 
 @reflectiveTest
@@ -29,7 +29,7 @@
     await waitForTasksFinished();
     Request request =
         new AnalysisGetHoverParams(testFile, offset).toRequest('0');
-    Response response = handleSuccessfulRequest(request);
+    Response response = await waitResponse(request);
     var result = new AnalysisGetHoverResult.fromResponse(response);
     List<HoverInformation> hovers = result.hovers;
     return hovers.isNotEmpty ? hovers.first : null;
diff --git a/pkg/analysis_server/test/analysis/get_navigation_test.dart b/pkg/analysis_server/test/analysis/get_navigation_test.dart
index add8b90..5e262a7 100644
--- a/pkg/analysis_server/test/analysis/get_navigation_test.dart
+++ b/pkg/analysis_server/test/analysis/get_navigation_test.dart
@@ -7,15 +7,15 @@
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/domain_analysis.dart';
 import 'package:analyzer/file_system/file_system.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../utils.dart';
 import 'notification_navigation_test.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(GetNavigationTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(GetNavigationTest);
+  });
 }
 
 @reflectiveTest
@@ -25,7 +25,9 @@
   @override
   void setUp() {
     super.setUp();
-    server.handlers = [new AnalysisDomainHandler(server),];
+    server.handlers = [
+      new AnalysisDomainHandler(server),
+    ];
     createProject();
   }
 
diff --git a/pkg/analysis_server/test/analysis/navigation_collector_test.dart b/pkg/analysis_server/test/analysis/navigation_collector_test.dart
index e0f118f..cf71283 100644
--- a/pkg/analysis_server/test/analysis/navigation_collector_test.dart
+++ b/pkg/analysis_server/test/analysis/navigation_collector_test.dart
@@ -6,14 +6,13 @@
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/domains/analysis/navigation.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
-
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(NavigationCollectorImplTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(NavigationCollectorImplTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/analysis/notification_analysis_options_test.dart b/pkg/analysis_server/test/analysis/notification_analysis_options_test.dart
index b2d1add..7d08f0f 100644
--- a/pkg/analysis_server/test/analysis/notification_analysis_options_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_analysis_options_test.dart
@@ -9,17 +9,17 @@
 import 'package:analysis_server/src/domain_analysis.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/services/lint.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
 import '../mocks.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(NewAnalysisOptionsFileNotificationTest);
-  defineReflectiveTests(OldAnalysisOptionsFileNotificationTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(NewAnalysisOptionsFileNotificationTest);
+    defineReflectiveTests(OldAnalysisOptionsFileNotificationTest);
+  });
 }
 
 abstract class AnalysisOptionsFileNotificationTest
diff --git a/pkg/analysis_server/test/analysis/notification_analyzedFiles_test.dart b/pkg/analysis_server/test/analysis/notification_analyzedFiles_test.dart
index 0ce9e164..f9c95ae 100644
--- a/pkg/analysis_server/test/analysis/notification_analyzedFiles_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_analyzedFiles_test.dart
@@ -8,16 +8,16 @@
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
 import '../mocks.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AnalysisNotificationAnalyzedFilesTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisNotificationAnalyzedFilesTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/analysis/notification_errors_test.dart b/pkg/analysis_server/test/analysis/notification_errors_test.dart
index 02b05ec..8ab02c3 100644
--- a/pkg/analysis_server/test/analysis/notification_errors_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_errors_test.dart
@@ -10,15 +10,15 @@
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/services/lint.dart';
 import 'package:linter/src/linter.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(NotificationErrorsTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(NotificationErrorsTest);
+  });
 }
 
 @reflectiveTest
@@ -35,7 +35,9 @@
   @override
   void setUp() {
     super.setUp();
-    server.handlers = [new AnalysisDomainHandler(server),];
+    server.handlers = [
+      new AnalysisDomainHandler(server),
+    ];
   }
 
   test_importError() async {
@@ -52,7 +54,7 @@
     AnalysisError error = errors[0];
     expect(error.severity, AnalysisErrorSeverity.ERROR);
     expect(error.type, AnalysisErrorType.COMPILE_TIME_ERROR);
-    expect(error.message, startsWith('Target of URI does not exist'));
+    expect(error.message, startsWith("Target of URI doesn't exist"));
   }
 
   test_lintError() async {
diff --git a/pkg/analysis_server/test/analysis/notification_highlights_test.dart b/pkg/analysis_server/test/analysis/notification_highlights_test.dart
index 6c2b57a3..0106453 100644
--- a/pkg/analysis_server/test/analysis/notification_highlights_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_highlights_test.dart
@@ -8,16 +8,16 @@
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AnalysisNotificationHighlightsTest);
-  defineReflectiveTests(HighlightTypeTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisNotificationHighlightsTest);
+    defineReflectiveTests(HighlightTypeTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/analysis/notification_highlights_test2.dart b/pkg/analysis_server/test/analysis/notification_highlights_test2.dart
index 0342c89..28568ef 100644
--- a/pkg/analysis_server/test/analysis/notification_highlights_test2.dart
+++ b/pkg/analysis_server/test/analysis/notification_highlights_test2.dart
@@ -8,16 +8,16 @@
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AnalysisNotificationHighlightsTest);
-  defineReflectiveTests(HighlightTypeTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisNotificationHighlightsTest);
+    defineReflectiveTests(HighlightTypeTest);
+  });
 }
 
 @reflectiveTest
@@ -911,6 +911,23 @@
     assertHasRegion(HighlightRegionType.PARAMETER_REFERENCE, 'p = 42');
   }
 
+  test_PARAMETER_named() async {
+    addTestFile('''
+class C {
+  final int aaa;
+  C({this.aaa, int bbb});
+}
+main() {
+  new C(aaa: 1, bbb: 2);
+}
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.INSTANCE_FIELD_REFERENCE, 'aaa,');
+    assertHasRegion(HighlightRegionType.PARAMETER_DECLARATION, 'bbb}');
+    assertHasRegion(HighlightRegionType.PARAMETER_REFERENCE, 'aaa: 1');
+    assertHasRegion(HighlightRegionType.PARAMETER_REFERENCE, 'bbb: 2');
+  }
+
   test_SETTER_DECLARATION() async {
     addTestFile('''
 set aaa(x) {}
diff --git a/pkg/analysis_server/test/analysis/notification_implemented_test.dart b/pkg/analysis_server/test/analysis/notification_implemented_test.dart
index ee3959a..fa18586 100644
--- a/pkg/analysis_server/test/analysis/notification_implemented_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_implemented_test.dart
@@ -9,15 +9,15 @@
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
 import 'package:analysis_server/src/services/index/index.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AnalysisNotificationImplementedTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisNotificationImplementedTest);
+  });
 }
 
 @reflectiveTest
@@ -432,6 +432,7 @@
       return new Future.delayed(
           new Duration(milliseconds: 1), () => waitForNotification(times - 1));
     }
+
     return waitForNotification(30000);
   }
 }
diff --git a/pkg/analysis_server/test/analysis/notification_navigation_test.dart b/pkg/analysis_server/test/analysis/notification_navigation_test.dart
index b1fd5f1..49b55ae 100644
--- a/pkg/analysis_server/test/analysis/notification_navigation_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_navigation_test.dart
@@ -8,15 +8,15 @@
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AnalysisNotificationNavigationTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisNotificationNavigationTest);
+  });
 }
 
 class AbstractNavigationTest extends AbstractAnalysisTest {
diff --git a/pkg/analysis_server/test/analysis/notification_occurrences_test.dart b/pkg/analysis_server/test/analysis/notification_occurrences_test.dart
index c27fa10..933791e 100644
--- a/pkg/analysis_server/test/analysis/notification_occurrences_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_occurrences_test.dart
@@ -8,15 +8,15 @@
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AnalysisNotificationOccurrencesTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisNotificationOccurrencesTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/analysis/notification_outline_test.dart b/pkg/analysis_server/test/analysis/notification_outline_test.dart
index 1230dbc..eaa88d1 100644
--- a/pkg/analysis_server/test/analysis/notification_outline_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_outline_test.dart
@@ -8,15 +8,15 @@
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(_AnalysisNotificationOutlineTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(_AnalysisNotificationOutlineTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/analysis/notification_overrides_test.dart b/pkg/analysis_server/test/analysis/notification_overrides_test.dart
index 61db513..c5f964e 100644
--- a/pkg/analysis_server/test/analysis/notification_overrides_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_overrides_test.dart
@@ -8,15 +8,15 @@
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AnalysisNotificationOverridesTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisNotificationOverridesTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/analysis/reanalyze_test.dart b/pkg/analysis_server/test/analysis/reanalyze_test.dart
index b7f62d0..a6cbb89 100644
--- a/pkg/analysis_server/test/analysis/reanalyze_test.dart
+++ b/pkg/analysis_server/test/analysis/reanalyze_test.dart
@@ -7,15 +7,15 @@
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
 import 'package:analyzer/src/generated/engine.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ReanalyzeTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ReanalyzeTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/analysis/set_priority_files_test.dart b/pkg/analysis_server/test/analysis/set_priority_files_test.dart
index 9a1b5c9..5a870cc 100644
--- a/pkg/analysis_server/test/analysis/set_priority_files_test.dart
+++ b/pkg/analysis_server/test/analysis/set_priority_files_test.dart
@@ -9,16 +9,16 @@
 import 'package:analyzer/src/generated/engine.dart'
     show InternalAnalysisContext;
 import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
 import '../mocks.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(SetPriorityFilesTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(SetPriorityFilesTest);
+  });
 }
 
 @reflectiveTest
@@ -26,7 +26,9 @@
   @override
   void setUp() {
     super.setUp();
-    server.handlers = [new AnalysisDomainHandler(server),];
+    server.handlers = [
+      new AnalysisDomainHandler(server),
+    ];
     createProject();
   }
 
diff --git a/pkg/analysis_server/test/analysis/test_all.dart b/pkg/analysis_server/test/analysis/test_all.dart
index a0cd6d3..6f7817c 100644
--- a/pkg/analysis_server/test/analysis/test_all.dart
+++ b/pkg/analysis_server/test/analysis/test_all.dart
@@ -3,9 +3,8 @@
 // BSD-style license that can be found in the LICENSE file.
 library test.analysis;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../utils.dart';
 import 'get_errors_test.dart' as get_errors_test;
 import 'get_hover_test.dart' as get_hover_test;
 import 'get_navigation_test.dart' as get_navigation_test;
@@ -29,8 +28,7 @@
  * Utility for manually running all tests.
  */
 main() {
-  initializeTestEnvironment();
-  group('analysis', () {
+  defineReflectiveSuite(() {
     get_errors_test.main();
     get_hover_test.main();
     get_navigation_test.main();
@@ -47,5 +45,5 @@
     notification_overrides_test.main();
     set_priority_files_test.main();
     update_content_test.main();
-  });
+  }, name: 'analysis');
 }
diff --git a/pkg/analysis_server/test/analysis/update_content_test.dart b/pkg/analysis_server/test/analysis/update_content_test.dart
index 6ab4706..788088f 100644
--- a/pkg/analysis_server/test/analysis/update_content_test.dart
+++ b/pkg/analysis_server/test/analysis/update_content_test.dart
@@ -12,16 +12,16 @@
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:typed_mock/typed_mock.dart';
-import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(UpdateContentTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(UpdateContentTest);
+  });
 }
 
 compilationUnitMatcher(String file) {
@@ -170,7 +170,7 @@
         {'/project/main.dart': new AddContentOverlay('import "target.dart";')});
     await server.onAnalysisComplete;
     expect(filesErrors, {
-      '/project/main.dart': ["1: Target of URI does not exist: 'target.dart'"],
+      '/project/main.dart': ["1: Target of URI doesn't exist: 'target.dart'."],
       '/project/target.dart': []
     });
 
@@ -178,8 +178,8 @@
         {'/project/target.dart': new AddContentOverlay('import "none.dart";')});
     await server.onAnalysisComplete;
     expect(filesErrors, {
-      '/project/main.dart': ["1: Unused import"],
-      '/project/target.dart': ["1: Target of URI does not exist: 'none.dart'"],
+      '/project/main.dart': ["1: Unused import."],
+      '/project/target.dart': ["1: Target of URI doesn't exist: 'none.dart'."],
       '/project/none.dart': []
     });
   }
diff --git a/pkg/analysis_server/test/analysis_abstract.dart b/pkg/analysis_server/test/analysis_abstract.dart
index 0db5841..d9f8984 100644
--- a/pkg/analysis_server/test/analysis_abstract.dart
+++ b/pkg/analysis_server/test/analysis_abstract.dart
@@ -22,7 +22,7 @@
 import 'package:linter/src/plugin/linter_plugin.dart';
 import 'package:plugin/manager.dart';
 import 'package:plugin/plugin.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import 'mock_sdk.dart';
 import 'mocks.dart';
@@ -57,9 +57,9 @@
       <GeneralAnalysisService>[];
   final Map<AnalysisService, List<String>> analysisSubscriptions = {};
 
-  String projectPath = '/project';
-  String testFolder = '/project/bin';
-  String testFile = '/project/bin/test.dart';
+  String projectPath;
+  String testFolder;
+  String testFile;
   String testCode;
 
   AbstractAnalysisTest();
@@ -84,6 +84,7 @@
   }
 
   String addFile(String path, String content) {
+    path = resourceProvider.convertPath(path);
     resourceProvider.newFile(path, content);
     return path;
   }
@@ -123,9 +124,12 @@
     ExtensionManager manager = new ExtensionManager();
     manager.processPlugins(plugins);
     //
+    // Create an SDK in the mock file system.
+    //
+    new MockSdk(resourceProvider: resourceProvider);
+    //
     // Create server
     //
-    MockSdk sdk = new MockSdk(resourceProvider: resourceProvider);
     return new AnalysisServer(
         serverChannel,
         resourceProvider,
@@ -133,7 +137,7 @@
         index,
         serverPlugin,
         new AnalysisServerOptions(),
-        new DartSdkManager('/', false, (_) => sdk),
+        new DartSdkManager(resourceProvider.convertPath('/'), false),
         InstrumentationService.NULL_SERVICE);
   }
 
@@ -146,8 +150,9 @@
    */
   void createProject({Map<String, String> packageRoots}) {
     resourceProvider.newFolder(projectPath);
-    Request request =
-        new AnalysisSetAnalysisRootsParams([projectPath], [], packageRoots: packageRoots).toRequest('0');
+    Request request = new AnalysisSetAnalysisRootsParams([projectPath], [],
+            packageRoots: packageRoots)
+        .toRequest('0');
     handleSuccessfulRequest(request, handler: analysisHandler);
   }
 
@@ -206,6 +211,9 @@
   void setUp() {
     serverChannel = new MockServerChannel();
     resourceProvider = new MemoryResourceProvider();
+    projectPath = resourceProvider.convertPath('/project');
+    testFolder = resourceProvider.convertPath('/project/bin');
+    testFile = resourceProvider.convertPath('/project/bin/test.dart');
     packageMapProvider = new MockPackageMapProvider();
     Index index = createIndex();
     server = createAnalysisServer(index);
diff --git a/pkg/analysis_server/test/analysis_server_test.dart b/pkg/analysis_server/test/analysis_server_test.dart
index ed50563..a76d57b 100644
--- a/pkg/analysis_server/test/analysis_server_test.dart
+++ b/pkg/analysis_server/test/analysis_server_test.dart
@@ -23,17 +23,17 @@
 import 'package:analyzer/src/generated/source.dart';
 import 'package:plugin/manager.dart';
 import 'package:plugin/plugin.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:typed_mock/typed_mock.dart';
-import 'package:unittest/unittest.dart';
 
 import 'mock_sdk.dart';
 import 'mocks.dart';
-import 'utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AnalysisServerTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisServerTest);
+  });
 }
 
 @reflectiveTest
@@ -137,7 +137,8 @@
     manager.processPlugins([plugin]);
     channel = new MockServerChannel();
     resourceProvider = new MemoryResourceProvider();
-    MockSdk sdk = new MockSdk(resourceProvider: resourceProvider);
+    // Create an SDK in the mock file system.
+    new MockSdk(resourceProvider: resourceProvider);
     packageMapProvider = new MockPackageMapProvider();
     server = new AnalysisServer(
         channel,
@@ -146,7 +147,7 @@
         null,
         plugin,
         new AnalysisServerOptions(),
-        new DartSdkManager('/', false, (_) => sdk),
+        new DartSdkManager('/', false),
         InstrumentationService.NULL_SERVICE,
         rethrowExceptions: true);
     processRequiredPlugins();
diff --git a/pkg/analysis_server/test/channel/byte_stream_channel_test.dart b/pkg/analysis_server/test/channel/byte_stream_channel_test.dart
index d1887be..c4bab89 100644
--- a/pkg/analysis_server/test/channel/byte_stream_channel_test.dart
+++ b/pkg/analysis_server/test/channel/byte_stream_channel_test.dart
@@ -11,13 +11,11 @@
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/channel/byte_stream_channel.dart';
 import 'package:analyzer/instrumentation/instrumentation.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import '../mocks.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
   group('ByteStreamClientChannel', () {
     setUp(ByteStreamClientChannelTest.setUp);
     test('close', ByteStreamClientChannelTest.close);
diff --git a/pkg/analysis_server/test/channel/test_all.dart b/pkg/analysis_server/test/channel/test_all.dart
index d177863..2e1538d 100644
--- a/pkg/analysis_server/test/channel/test_all.dart
+++ b/pkg/analysis_server/test/channel/test_all.dart
@@ -4,9 +4,8 @@
 
 library test.channel.all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
-import '../utils.dart';
 import 'byte_stream_channel_test.dart' as byte_stream_channel_test;
 import 'web_socket_channel_test.dart' as web_socket_channel_test;
 
@@ -14,7 +13,6 @@
  * Utility for manually running all tests.
  */
 main() {
-  initializeTestEnvironment();
   group('computer', () {
     byte_stream_channel_test.main();
     web_socket_channel_test.main();
diff --git a/pkg/analysis_server/test/channel/web_socket_channel_test.dart b/pkg/analysis_server/test/channel/web_socket_channel_test.dart
index 77c47bc..b9f2e43 100644
--- a/pkg/analysis_server/test/channel/web_socket_channel_test.dart
+++ b/pkg/analysis_server/test/channel/web_socket_channel_test.dart
@@ -9,13 +9,11 @@
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/channel/web_socket_channel.dart';
 import 'package:analyzer/instrumentation/instrumentation.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import '../mocks.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
   group('WebSocketChannel', () {
     setUp(WebSocketChannelTest.setUp);
     test('close', WebSocketChannelTest.close);
diff --git a/pkg/analysis_server/test/completion_test.dart b/pkg/analysis_server/test/completion_test.dart
index 778b1f0..93483ce 100644
--- a/pkg/analysis_server/test/completion_test.dart
+++ b/pkg/analysis_server/test/completion_test.dart
@@ -7,29 +7,16 @@
 import 'dart:async';
 import 'dart:collection';
 
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import 'completion_test_support.dart';
-import 'utils.dart';
 
 main() {
-  initializeTestEnvironment();
   CompletionTestBuilder builder = new CompletionTestBuilder();
   builder.buildAll();
 }
 
 /**
- * Assigning the name of a single test to this string causes just that test to
- * be run.  Assigning null to this string causes all tests to be run.
- */
-const String SOLO_TEST = null;
-
-/**
- * Type of functions used to create tests.
- */
-typedef void _Tester(String spec, TestFunction body);
-
-/**
  * A builder that builds the completion tests.
  */
 class CompletionTestBuilder {
@@ -2848,7 +2835,8 @@
 
     // test analysis of untyped fields and top-level vars
     buildTests('test035', '''class Y {final x='hi';mth() {x.!1length;}}''',
-        <String>["1+length"], failingTests: '1');
+        <String>["1+length"],
+        failingTests: '1');
 
     // TODO(scheglov) decide what to do with Type for untyped field (not
     // supported by the new store)
@@ -2977,10 +2965,9 @@
     }
     for (LocationSpec spec in completionTests) {
       String testName = '$baseName-${spec.id}';
-      _Tester tester = testName == SOLO_TEST ? solo_test : test;
       if (failingTests.contains(spec.id)) {
         ++expectedFailCount;
-        tester("$testName (expected failure $expectedFailCount)", () {
+        test("$testName (expected failure $expectedFailCount)", () {
           CompletionTestCase test = new CompletionTestCase();
           return new Future(() => test.runTest(spec, extraFiles)).then((_) {
             fail('Test passed - expected to fail.');
@@ -2988,7 +2975,7 @@
         });
       } else {
         ++expectedPassCount;
-        tester(testName, () {
+        test(testName, () {
           CompletionTestCase test = new CompletionTestCase();
           return test.runTest(spec, extraFiles);
         });
diff --git a/pkg/analysis_server/test/completion_test_support.dart b/pkg/analysis_server/test/completion_test_support.dart
index e477c5b..3121980 100644
--- a/pkg/analysis_server/test/completion_test_support.dart
+++ b/pkg/analysis_server/test/completion_test_support.dart
@@ -8,7 +8,7 @@
 import 'dart:collection';
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import 'domain_completion_test.dart';
 
diff --git a/pkg/analysis_server/test/context_manager_test.dart b/pkg/analysis_server/test/context_manager_test.dart
index 87f62fd..46a2d44 100644
--- a/pkg/analysis_server/test/context_manager_test.dart
+++ b/pkg/analysis_server/test/context_manager_test.dart
@@ -5,7 +5,6 @@
 library test.context.directory.manager;
 
 import 'dart:collection';
-import 'dart:io' as io;
 
 import 'package:analysis_server/src/context_manager.dart';
 import 'package:analyzer/error/error.dart';
@@ -14,42 +13,41 @@
 import 'package:analyzer/instrumentation/instrumentation.dart';
 import 'package:analyzer/source/error_processor.dart';
 import 'package:analyzer/src/context/builder.dart';
+import 'package:analyzer/src/dart/analysis/driver.dart';
 import 'package:analyzer/src/error/codes.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/source_io.dart';
 import 'package:analyzer/src/services/lint.dart';
-import 'package:analyzer/src/task/options.dart'
-    show CONFIGURED_ERROR_PROCESSORS;
 import 'package:analyzer/src/util/glob.dart';
 import 'package:linter/src/plugin/linter_plugin.dart';
 import 'package:linter/src/rules/avoid_as.dart';
-import 'package:path/path.dart';
+import 'package:path/path.dart' as path;
 import 'package:plugin/manager.dart';
 import 'package:plugin/plugin.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import 'mock_sdk.dart';
 import 'mocks.dart';
-import 'utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AbstractContextManagerTest);
-  defineReflectiveTests(ContextManagerWithNewOptionsTest);
-  defineReflectiveTests(ContextManagerWithOldOptionsTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AbstractContextManagerTest);
+    defineReflectiveTests(ContextManagerWithNewOptionsTest);
+    defineReflectiveTests(ContextManagerWithOldOptionsTest);
+  });
 }
 
 @reflectiveTest
 class AbstractContextManagerTest extends ContextManagerTest {
   void test_contextsInAnalysisRoot_nestedContext() {
-    String subProjPath = posix.join(projPath, 'subproj');
+    String subProjPath = path.posix.join(projPath, 'subproj');
     Folder subProjFolder = resourceProvider.newFolder(subProjPath);
     resourceProvider.newFile(
-        posix.join(subProjPath, 'pubspec.yaml'), 'contents');
-    String subProjFilePath = posix.join(subProjPath, 'file.dart');
+        path.posix.join(subProjPath, 'pubspec.yaml'), 'contents');
+    String subProjFilePath = path.posix.join(subProjPath, 'file.dart');
     resourceProvider.newFile(subProjFilePath, 'contents');
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
     // Make sure that there really are contexts for both the main project and
@@ -156,10 +154,7 @@
     var context = contexts[0];
     var source = context.sourceFactory.forUri('dart:foobar');
     expect(source, isNotNull);
-    expect(
-        source.fullName,
-        '/my/proj/sdk_ext/entry.dart'
-            .replaceAll('/', io.Platform.pathSeparator));
+    expect(source.fullName, '/my/proj/sdk_ext/entry.dart');
     // We can't find dart:core because we didn't list it in our
     // embedded_libs map.
     expect(context.sourceFactory.forUri('dart:core'), isNull);
@@ -170,16 +165,16 @@
 
   test_ignoreFilesInPackagesFolder() {
     // create a context with a pubspec.yaml file
-    String pubspecPath = posix.join(projPath, 'pubspec.yaml');
+    String pubspecPath = path.posix.join(projPath, 'pubspec.yaml');
     resourceProvider.newFile(pubspecPath, 'pubspec');
     // create a file in the "packages" folder
-    String filePath1 = posix.join(projPath, 'packages', 'file1.dart');
+    String filePath1 = path.posix.join(projPath, 'packages', 'file1.dart');
     resourceProvider.newFile(filePath1, 'contents');
     // "packages" files are ignored initially
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
     expect(callbacks.currentContextFilePaths[projPath], isEmpty);
     // "packages" files are ignored during watch
-    String filePath2 = posix.join(projPath, 'packages', 'file2.dart');
+    String filePath2 = path.posix.join(projPath, 'packages', 'file2.dart');
     resourceProvider.newFile(filePath2, 'contents');
     return pumpEventQueue().then((_) {
       expect(callbacks.currentContextFilePaths[projPath], isEmpty);
@@ -200,11 +195,11 @@
   }
 
   void test_isInAnalysisRoot_inNestedContext() {
-    String subProjPath = posix.join(projPath, 'subproj');
+    String subProjPath = path.posix.join(projPath, 'subproj');
     Folder subProjFolder = resourceProvider.newFolder(subProjPath);
     resourceProvider.newFile(
-        posix.join(subProjPath, 'pubspec.yaml'), 'contents');
-    String subProjFilePath = posix.join(subProjPath, 'file.dart');
+        path.posix.join(subProjPath, 'pubspec.yaml'), 'contents');
+    String subProjFilePath = path.posix.join(subProjPath, 'file.dart');
     resourceProvider.newFile(subProjFilePath, 'contents');
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
     // Make sure that there really is a context for the subproject.
@@ -256,7 +251,7 @@
 
   test_refresh_folder_with_packagespec() {
     // create a context with a .packages file
-    String packagespecFile = posix.join(projPath, '.packages');
+    String packagespecFile = path.posix.join(projPath, '.packages');
     resourceProvider.newFile(packagespecFile, '');
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
     return pumpEventQueue().then((_) {
@@ -276,10 +271,10 @@
   test_refresh_folder_with_packagespec_subfolders() {
     // Create a folder with no .packages file, containing two subfolders with
     // .packages files.
-    String subdir1Path = posix.join(projPath, 'subdir1');
-    String subdir2Path = posix.join(projPath, 'subdir2');
-    String packagespec1Path = posix.join(subdir1Path, '.packages');
-    String packagespec2Path = posix.join(subdir2Path, '.packages');
+    String subdir1Path = path.posix.join(projPath, 'subdir1');
+    String subdir2Path = path.posix.join(projPath, 'subdir2');
+    String packagespec1Path = path.posix.join(subdir1Path, '.packages');
+    String packagespec2Path = path.posix.join(subdir2Path, '.packages');
     resourceProvider.newFile(packagespec1Path, '');
     resourceProvider.newFile(packagespec2Path, '');
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
@@ -300,7 +295,7 @@
 
   test_refresh_folder_with_pubspec() {
     // create a context with a pubspec.yaml file
-    String pubspecPath = posix.join(projPath, 'pubspec.yaml');
+    String pubspecPath = path.posix.join(projPath, 'pubspec.yaml');
     resourceProvider.newFile(pubspecPath, 'pubspec');
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
     return pumpEventQueue().then((_) {
@@ -317,10 +312,10 @@
   test_refresh_folder_with_pubspec_subfolders() {
     // Create a folder with no pubspec.yaml, containing two subfolders with
     // pubspec.yaml files.
-    String subdir1Path = posix.join(projPath, 'subdir1');
-    String subdir2Path = posix.join(projPath, 'subdir2');
-    String pubspec1Path = posix.join(subdir1Path, 'pubspec.yaml');
-    String pubspec2Path = posix.join(subdir2Path, 'pubspec.yaml');
+    String subdir1Path = path.posix.join(projPath, 'subdir1');
+    String subdir2Path = path.posix.join(projPath, 'subdir2');
+    String pubspec1Path = path.posix.join(subdir1Path, 'pubspec.yaml');
+    String pubspec2Path = path.posix.join(subdir2Path, 'pubspec.yaml');
     resourceProvider.newFile(pubspec1Path, 'pubspec');
     resourceProvider.newFile(pubspec2Path, 'pubspec');
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
@@ -341,12 +336,12 @@
 
   test_refresh_oneContext() {
     // create two contexts with pubspec.yaml files
-    String pubspecPath = posix.join(projPath, 'pubspec.yaml');
+    String pubspecPath = path.posix.join(projPath, 'pubspec.yaml');
     resourceProvider.newFile(pubspecPath, 'pubspec1');
 
     String proj2Path = '/my/proj2';
     resourceProvider.newFolder(proj2Path);
-    String pubspec2Path = posix.join(proj2Path, 'pubspec.yaml');
+    String pubspec2Path = path.posix.join(proj2Path, 'pubspec.yaml');
     resourceProvider.newFile(pubspec2Path, 'pubspec2');
 
     List<String> roots = <String>[projPath, proj2Path];
@@ -399,7 +394,7 @@
   }
 
   void test_setRoots_addFolderWithDartFile() {
-    String filePath = posix.join(projPath, 'foo.dart');
+    String filePath = path.posix.join(projPath, 'foo.dart');
     resourceProvider.newFile(filePath, 'contents');
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
     // verify
@@ -417,7 +412,7 @@
   }
 
   void test_setRoots_addFolderWithDartFileInSubfolder() {
-    String filePath = posix.join(projPath, 'foo', 'bar.dart');
+    String filePath = path.posix.join(projPath, 'foo', 'bar.dart');
     resourceProvider.newFile(filePath, 'contents');
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
     // verify
@@ -427,7 +422,7 @@
   }
 
   void test_setRoots_addFolderWithDummyLink() {
-    String filePath = posix.join(projPath, 'foo.dart');
+    String filePath = path.posix.join(projPath, 'foo.dart');
     resourceProvider.newDummyLink(filePath);
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
     // verify
@@ -500,12 +495,12 @@
   }
 
   void test_setRoots_addFolderWithPackagespec() {
-    String packagespecPath = posix.join(projPath, '.packages');
+    String packagespecPath = path.posix.join(projPath, '.packages');
     resourceProvider.newFile(packagespecPath,
         'unittest:file:///home/somebody/.pub/cache/unittest-0.9.9/lib/');
     String libPath = newFolder([projPath, ContextManagerTest.LIB_NAME]);
     File mainFile =
-        resourceProvider.newFile(posix.join(libPath, 'main.dart'), '');
+        resourceProvider.newFile(path.posix.join(libPath, 'main.dart'), '');
     Source source = mainFile.createSource();
 
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
@@ -526,7 +521,7 @@
 
   void test_setRoots_addFolderWithPackagespecAndPackageRoot() {
     // The package root should take priority.
-    String packagespecPath = posix.join(projPath, '.packages');
+    String packagespecPath = path.posix.join(projPath, '.packages');
     resourceProvider.newFile(packagespecPath,
         'unittest:file:///home/somebody/.pub/cache/unittest-0.9.9/lib/');
     String packageRootPath = '/package/root/';
@@ -538,7 +533,7 @@
   }
 
   void test_setRoots_addFolderWithPubspec() {
-    String pubspecPath = posix.join(projPath, 'pubspec.yaml');
+    String pubspecPath = path.posix.join(projPath, 'pubspec.yaml');
     resourceProvider.newFile(pubspecPath, 'pubspec');
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
     // verify
@@ -548,8 +543,8 @@
   }
 
   void test_setRoots_addFolderWithPubspec_andPackagespec() {
-    String pubspecPath = posix.join(projPath, 'pubspec.yaml');
-    String packagespecPath = posix.join(projPath, '.packages');
+    String pubspecPath = path.posix.join(projPath, 'pubspec.yaml');
+    String packagespecPath = path.posix.join(projPath, '.packages');
     resourceProvider.newFile(pubspecPath, 'pubspec');
     resourceProvider.newFile(packagespecPath, '');
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
@@ -934,7 +929,7 @@
   }
 
   void test_setRoots_noContext_inDotFolder() {
-    String pubspecPath = posix.join(projPath, '.pub', 'pubspec.yaml');
+    String pubspecPath = path.posix.join(projPath, '.pub', 'pubspec.yaml');
     resourceProvider.newFile(pubspecPath, 'name: test');
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
     // verify
@@ -944,7 +939,7 @@
   }
 
   void test_setRoots_noContext_inPackagesFolder() {
-    String pubspecPath = posix.join(projPath, 'packages', 'pubspec.yaml');
+    String pubspecPath = path.posix.join(projPath, 'packages', 'pubspec.yaml');
     resourceProvider.newFile(pubspecPath, 'name: test');
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
     // verify
@@ -954,7 +949,7 @@
   }
 
   void test_setRoots_packageResolver() {
-    String filePath = posix.join(projPath, 'lib', 'foo.dart');
+    String filePath = path.posix.join(projPath, 'lib', 'foo.dart');
     newFile([projPath, ContextManagerImpl.PACKAGE_SPEC_NAME], 'foo:lib/');
     resourceProvider.newFile(filePath, 'contents');
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
@@ -994,7 +989,7 @@
 
   void test_setRoots_removeFolderWithPackagespec() {
     // create a pubspec
-    String pubspecPath = posix.join(projPath, '.packages');
+    String pubspecPath = path.posix.join(projPath, '.packages');
     resourceProvider.newFile(pubspecPath, '');
     // add one root - there is a context
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
@@ -1044,7 +1039,7 @@
 
   void test_setRoots_removeFolderWithPubspec() {
     // create a pubspec
-    String pubspecPath = posix.join(projPath, 'pubspec.yaml');
+    String pubspecPath = path.posix.join(projPath, 'pubspec.yaml');
     resourceProvider.newFile(pubspecPath, 'pubspec');
     // add one root - there is a context
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
@@ -1127,7 +1122,7 @@
     Map<String, int> filePaths = callbacks.currentContextFilePaths[projPath];
     expect(filePaths, isEmpty);
     // add link
-    String filePath = posix.join(projPath, 'foo.dart');
+    String filePath = path.posix.join(projPath, 'foo.dart');
     resourceProvider.newDummyLink(filePath);
     // the link was ignored
     return pumpEventQueue().then((_) {
@@ -1141,7 +1136,7 @@
     Map<String, int> filePaths = callbacks.currentContextFilePaths[projPath];
     expect(filePaths, hasLength(0));
     // add file
-    String filePath = posix.join(projPath, 'foo.dart');
+    String filePath = path.posix.join(projPath, 'foo.dart');
     resourceProvider.newFile(filePath, 'contents');
     // the file was added
     return pumpEventQueue().then((_) {
@@ -1247,7 +1242,7 @@
     Map<String, int> filePaths = callbacks.currentContextFilePaths[projPath];
     expect(filePaths, hasLength(0));
     // add file in subfolder
-    String filePath = posix.join(projPath, 'foo', 'bar.dart');
+    String filePath = path.posix.join(projPath, 'foo', 'bar.dart');
     resourceProvider.newFile(filePath, 'contents');
     // the file was added
     return pumpEventQueue().then((_) {
@@ -1428,7 +1423,7 @@
   }
 
   test_watch_deleteFile() {
-    String filePath = posix.join(projPath, 'foo.dart');
+    String filePath = path.posix.join(projPath, 'foo.dart');
     // add root with a file
     File file = resourceProvider.newFile(filePath, 'contents');
     Folder projFolder = file.parent;
@@ -1449,7 +1444,7 @@
   }
 
   test_watch_deleteFolder() {
-    String filePath = posix.join(projPath, 'foo.dart');
+    String filePath = path.posix.join(projPath, 'foo.dart');
     // add root with a file
     File file = resourceProvider.newFile(filePath, 'contents');
     Folder projFolder = file.parent;
@@ -1598,7 +1593,7 @@
   }
 
   test_watch_modifyFile() {
-    String filePath = posix.join(projPath, 'foo.dart');
+    String filePath = path.posix.join(projPath, 'foo.dart');
     // add root with a file
     resourceProvider.newFile(filePath, 'contents');
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
@@ -1617,11 +1612,11 @@
 
   test_watch_modifyPackageMapDependency_fail() async {
     // create a dependency file
-    String dependencyPath = posix.join(projPath, 'dep');
+    String dependencyPath = path.posix.join(projPath, 'dep');
     resourceProvider.newFile(dependencyPath, 'contents');
     packageMapProvider.dependencies.add(dependencyPath);
     // create a Dart file
-    String dartFilePath = posix.join(projPath, 'main.dart');
+    String dartFilePath = path.posix.join(projPath, 'main.dart');
     resourceProvider.newFile(dartFilePath, 'contents');
     // the created context has the expected empty package map
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
@@ -1746,12 +1741,12 @@
       '**/${AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE}'
     ];
     return patterns
-        .map((pattern) => new Glob(posix.separator, pattern))
+        .map((pattern) => new Glob(path.posix.separator, pattern))
         .toList();
   }
 
-  List<ErrorProcessor> get errorProcessors => callbacks.currentContext
-      .getConfigurationData(CONFIGURED_ERROR_PROCESSORS);
+  List<ErrorProcessor> get errorProcessors =>
+      callbacks.currentContext.analysisOptions.errorProcessors;
 
   List<Linter> get lints => getLints(callbacks.currentContext);
 
@@ -1760,7 +1755,7 @@
   Map<String, List<Folder>> get _currentPackageMap => _packageMap(projPath);
 
   void deleteFile(List<String> pathComponents) {
-    String filePath = posix.joinAll(pathComponents);
+    String filePath = path.posix.joinAll(pathComponents);
     resourceProvider.deleteFile(filePath);
   }
 
@@ -1768,13 +1763,13 @@
       ErrorProcessor.getProcessor(callbacks.currentContext, error);
 
   String newFile(List<String> pathComponents, [String content = '']) {
-    String filePath = posix.joinAll(pathComponents);
+    String filePath = path.posix.joinAll(pathComponents);
     resourceProvider.newFile(filePath, content);
     return filePath;
   }
 
   String newFolder(List<String> pathComponents) {
-    String folderPath = posix.joinAll(pathComponents);
+    String folderPath = path.posix.joinAll(pathComponents);
     resourceProvider.newFolder(folderPath);
     return folderPath;
   }
@@ -1795,8 +1790,9 @@
     processRequiredPlugins();
     resourceProvider = new MemoryResourceProvider();
     packageMapProvider = new MockPackageMapProvider();
-    DartSdk sdk = new MockSdk(resourceProvider: resourceProvider);
-    DartSdkManager sdkManager = new DartSdkManager('/', false, (_) => sdk);
+    // Create an SDK in the mock file system.
+    new MockSdk(resourceProvider: resourceProvider);
+    DartSdkManager sdkManager = new DartSdkManager('/', false);
     manager = new ContextManagerImpl(
         resourceProvider,
         sdkManager,
@@ -1804,7 +1800,8 @@
         packageMapProvider,
         analysisFilesGlobs,
         InstrumentationService.NULL_SERVICE,
-        new AnalysisOptionsImpl());
+        new AnalysisOptionsImpl(),
+        false);
     callbacks = new TestContextManagerCallbacks(resourceProvider);
     manager.callbacks = callbacks;
     resourceProvider.newFolder(projPath);
@@ -1852,7 +1849,7 @@
   "dart:foobar": "../sdk_ext/entry.dart"
 analyzer:
   language:
-    enableGenericMethods: true
+    enableStrictCallChecks: true
   errors:
     unused_local_variable: false
 linter:
@@ -1867,7 +1864,7 @@
     // Verify options were set.
     expect(errorProcessors, hasLength(1));
     expect(lints, hasLength(1));
-    expect(options.enableGenericMethods, isTrue);
+    expect(options.enableStrictCallChecks, isTrue);
 
     // Remove options.
     deleteFile([projPath, optionsFileName]);
@@ -1876,7 +1873,7 @@
     // Verify defaults restored.
     expect(errorProcessors, isEmpty);
     expect(lints, isEmpty);
-    expect(options.enableGenericMethods, isFalse);
+    expect(options.enableStrictCallChecks, isFalse);
   }
 
   test_analysis_options_file_delete_with_embedder() async {
@@ -1906,7 +1903,7 @@
         r'''
 analyzer:
   language:
-    enableGenericMethods: true
+    enableStrictCallChecks: true
   errors:
     unused_local_variable: false
 linter:
@@ -1919,7 +1916,7 @@
     await pumpEventQueue();
 
     // Verify options were set.
-    expect(options.enableGenericMethods, isTrue);
+    expect(options.enableStrictCallChecks, isTrue);
     expect(options.strongMode, isTrue);
     expect(errorProcessors, hasLength(2));
     expect(lints, hasLength(2));
@@ -1929,13 +1926,49 @@
     await pumpEventQueue();
 
     // Verify defaults restored.
-    expect(options.enableGenericMethods, isFalse);
+    expect(options.enableStrictCallChecks, isFalse);
     expect(lints, hasLength(1));
     expect(lints.first, new isInstanceOf<AvoidAs>());
     expect(errorProcessors, hasLength(1));
     expect(getProcessor(missing_return).severity, isNull);
   }
 
+  test_analysis_options_include() async {
+    // Create files.
+    String libPath = newFolder([projPath, ContextManagerTest.LIB_NAME]);
+    newFile([libPath, 'main.dart']);
+    String sdkExtPath = newFolder([projPath, 'sdk_ext']);
+    newFile([sdkExtPath, 'entry.dart']);
+    String sdkExtSrcPath = newFolder([projPath, 'sdk_ext', 'src']);
+    newFile([sdkExtSrcPath, 'part.dart']);
+    // Setup analysis options file which includes another options file.
+    newFile(
+        [projPath, optionsFileName],
+        r'''
+include: other_options.yaml
+''');
+    newFile(
+        [projPath, 'other_options.yaml'],
+        r'''
+analyzer:
+  language:
+    enableStrictCallChecks: true
+  errors:
+    unused_local_variable: false
+linter:
+  rules:
+    - camel_case_types
+''');
+    // Setup context.
+    manager.setRoots(<String>[projPath], <String>[], <String, String>{});
+    await pumpEventQueue();
+    // Verify options were set.
+    expect(options.enableStrictCallChecks, isTrue);
+    expect(errorProcessors, hasLength(1));
+    expect(lints, hasLength(1));
+    expect(lints[0].name, 'camel_case_types');
+  }
+
   test_analysis_options_parse_failure() async {
     // Create files.
     String libPath = newFolder([projPath, ContextManagerTest.LIB_NAME]);
@@ -1956,220 +1989,6 @@
     // No error means success.
   }
 
-  test_configed_options() async {
-    // Create files.
-    String libPath = newFolder([projPath, ContextManagerTest.LIB_NAME]);
-    newFile([projPath, 'test', 'test.dart']);
-    newFile(
-        [projPath, 'pubspec.yaml'],
-        r'''
-dependencies:
-  test_pack: any
-analyzer:
-  configuration: test_pack/config
-''');
-
-    // Setup .packages file
-    newFile(
-        [projPath, '.packages'],
-        r'''
-test_pack:lib/''');
-
-    // Setup config.yaml.
-    newFile(
-        [libPath, 'config', 'config.yaml'],
-        r'''
-analyzer:
-  strong-mode: true
-  language:
-    enableSuperMixins: true
-  errors:
-    missing_return: false
-linter:
-  rules:
-    - avoid_as
-''');
-
-    // Setup analysis options
-    newFile(
-        [projPath, optionsFileName],
-        r'''
-analyzer:
-  exclude:
-    - 'test/**'
-  language:
-    enableGenericMethods: true
-  errors:
-    unused_local_variable: false
-linter:
-  rules:
-    - camel_case_types
-''');
-
-    // Setup context.
-    manager.setRoots(<String>[projPath], <String>[], <String, String>{});
-    await pumpEventQueue();
-
-    // Confirm that one context was created.
-    var contexts =
-        manager.contextsInAnalysisRoot(resourceProvider.newFolder(projPath));
-    expect(contexts, isNotNull);
-    expect(contexts, hasLength(1));
-
-    var context = contexts.first;
-
-    // Verify options.
-    // * from `config.yaml`:
-    expect(context.analysisOptions.strongMode, isTrue);
-    expect(context.analysisOptions.enableSuperMixins, isTrue);
-    // * from analysis options:
-    expect(context.analysisOptions.enableGenericMethods, isTrue);
-
-    // * verify tests are excluded
-    expect(callbacks.currentContextFilePaths[projPath].keys,
-        unorderedEquals(['/my/proj/$optionsFileName']));
-
-    // Verify filter setup.
-    expect(errorProcessors, hasLength(2));
-
-    // * (config.)
-    expect(getProcessor(missing_return).severity, isNull);
-
-    // * (options.)
-    expect(getProcessor(unused_local_variable).severity, isNull);
-
-    // Verify lints.
-    var lintNames = lints.map((lint) => lint.name);
-    expect(
-        lintNames,
-        unorderedEquals(
-            ['avoid_as' /* config */, 'camel_case_types' /* options */]));
-  }
-
-  test_embedder_and_configed_options() async {
-    // Create files.
-    String libPath = newFolder([projPath, ContextManagerTest.LIB_NAME]);
-    String sdkExtPath = newFolder([projPath, 'sdk_ext']);
-    newFile([projPath, 'test', 'test.dart']);
-    newFile([sdkExtPath, 'entry.dart']);
-
-    // Setup pubspec with configuration.
-    newFile(
-        [projPath, 'pubspec.yaml'],
-        r'''
-dependencies:
-  test_pack: any
-analyzer:
-  configuration: test_pack/config
-''');
-
-    // Setup _embedder.yaml.
-    newFile(
-        [libPath, '_embedder.yaml'],
-        r'''
-embedded_libs:
-  "dart:foobar": "../sdk_ext/entry.dart"
-analyzer:
-  strong-mode: true
-  language:
-    enableSuperMixins: true
-  errors:
-    missing_return: false
-linter:
-  rules:
-    - avoid_as
-''');
-
-    // Setup .packages file
-    newFile(
-        [projPath, '.packages'],
-        r'''
-test_pack:lib/''');
-
-    // Setup analysis options
-    newFile(
-        [projPath, optionsFileName],
-        r'''
-analyzer:
-  exclude:
-    - 'test/**'
-  language:
-    enableGenericMethods: true
-  errors:
-    unused_local_variable: false
-linter:
-  rules:
-    - camel_case_types
-''');
-
-    // Setup config.yaml.
-    newFile(
-        [libPath, 'config', 'config.yaml'],
-        r'''
-analyzer:
-  errors:
-    missing_required_param: error
-linter:
-  rules:
-    - always_specify_types
-''');
-
-    // Setup context.
-    manager.setRoots(<String>[projPath], <String>[], <String, String>{});
-    await pumpEventQueue();
-
-    // Confirm that one context was created.
-    var contexts =
-        manager.contextsInAnalysisRoot(resourceProvider.newFolder(projPath));
-    expect(contexts, isNotNull);
-    expect(contexts, hasLength(1));
-    var context = contexts[0];
-
-    // Verify options.
-    // * from `_embedder.yaml`:
-    expect(context.analysisOptions.strongMode, isTrue);
-    expect(context.analysisOptions.enableSuperMixins, isTrue);
-    // * from analysis options:
-    expect(context.analysisOptions.enableGenericMethods, isTrue);
-
-    // * verify tests are excluded
-    expect(
-        callbacks.currentContextFilePaths[projPath].keys,
-        unorderedEquals(
-            ['/my/proj/sdk_ext/entry.dart', '/my/proj/$optionsFileName']));
-
-    // Verify filter setup.
-    expect(errorProcessors, hasLength(3));
-
-    // * (embedder.)
-    expect(getProcessor(missing_return).severity, isNull);
-
-    // * (config.)
-    expect(getProcessor(missing_required_param).severity, ErrorSeverity.ERROR);
-
-    // * (options.)
-    expect(getProcessor(unused_local_variable).severity, isNull);
-
-    // Verify lints.
-    var lintNames = lints.map((lint) => lint.name);
-
-    expect(
-        lintNames,
-        unorderedEquals([
-          'avoid_as' /* embedder */,
-          'always_specify_types' /* config*/,
-          'camel_case_types' /* options */
-        ]));
-
-    // Sanity check embedder libs.
-    var source = context.sourceFactory.forUri('dart:foobar');
-    expect(source, isNotNull);
-    expect(
-        source.fullName,
-        '/my/proj/sdk_ext/entry.dart'
-            .replaceAll('/', io.Platform.pathSeparator));
-  }
-
   test_embedder_options() async {
     // Create files.
     String libPath = newFolder([projPath, ContextManagerTest.LIB_NAME]);
@@ -2206,7 +2025,7 @@
   exclude:
     - 'test/**'
   language:
-    enableGenericMethods: true
+    enableStrictCallChecks: true
   errors:
     unused_local_variable: false
 linter:
@@ -2230,7 +2049,7 @@
     expect(context.analysisOptions.strongMode, isTrue);
     expect(context.analysisOptions.enableSuperMixins, isTrue);
     // * from analysis options:
-    expect(context.analysisOptions.enableGenericMethods, isTrue);
+    expect(context.analysisOptions.enableStrictCallChecks, isTrue);
 
     // * verify tests are excluded
     expect(
@@ -2258,10 +2077,7 @@
     // Sanity check embedder libs.
     var source = context.sourceFactory.forUri('dart:foobar');
     expect(source, isNotNull);
-    expect(
-        source.fullName,
-        '/my/proj/sdk_ext/entry.dart'
-            .replaceAll('/', io.Platform.pathSeparator));
+    expect(source.fullName, '/my/proj/sdk_ext/entry.dart');
   }
 
   test_error_filter_analysis_option() async {
@@ -2664,6 +2480,12 @@
   Iterable<String> get currentContextPaths => currentContextTimestamps.keys;
 
   @override
+  AnalysisDriver addAnalysisDriver(Folder folder, AnalysisOptions options) {
+    // TODO: implement addAnalysisDriver
+    throw new UnimplementedError();
+  }
+
+  @override
   AnalysisContext addContext(Folder folder, AnalysisOptions options) {
     String path = folder.path;
     expect(currentContextPaths, isNot(contains(path)));
@@ -2715,10 +2537,12 @@
 
   @override
   ContextBuilder createContextBuilder(Folder folder, AnalysisOptions options) {
-    DartSdkManager sdkManager = new DartSdkManager('/', false, null);
-    ContextBuilder builder =
-        new ContextBuilder(resourceProvider, sdkManager, new ContentCache());
-    builder.defaultOptions = options;
+    DartSdkManager sdkManager = new DartSdkManager('/', false);
+    ContextBuilderOptions builderOptions = new ContextBuilderOptions();
+    builderOptions.defaultOptions = options;
+    ContextBuilder builder = new ContextBuilder(
+        resourceProvider, sdkManager, new ContentCache(),
+        options: builderOptions);
     return builder;
   }
 
diff --git a/pkg/analysis_server/test/domain_analysis_test.dart b/pkg/analysis_server/test/domain_analysis_test.dart
index 485227d..9230d23 100644
--- a/pkg/analysis_server/test/domain_analysis_test.dart
+++ b/pkg/analysis_server/test/domain_analysis_test.dart
@@ -15,19 +15,18 @@
 import 'package:analyzer/instrumentation/instrumentation.dart';
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:plugin/manager.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import 'analysis_abstract.dart';
 import 'mock_sdk.dart';
 import 'mocks.dart';
-import 'utils.dart';
 
 main() {
-  initializeTestEnvironment();
-
-  defineReflectiveTests(AnalysisDomainTest);
-  defineReflectiveTests(SetSubscriptionsTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisDomainTest);
+    defineReflectiveTests(SetSubscriptionsTest);
+  });
 
   MockServerChannel serverChannel;
   MemoryResourceProvider resourceProvider;
@@ -40,7 +39,8 @@
     ExtensionManager manager = new ExtensionManager();
     ServerPlugin serverPlugin = new ServerPlugin();
     manager.processPlugins([serverPlugin]);
-    MockSdk sdk = new MockSdk(resourceProvider: resourceProvider);
+    // Create an SDK in the mock file system.
+    new MockSdk(resourceProvider: resourceProvider);
     server = new AnalysisServer(
         serverChannel,
         resourceProvider,
@@ -48,7 +48,7 @@
         null,
         serverPlugin,
         new AnalysisServerOptions(),
-        new DartSdkManager('/', false, (_) => sdk),
+        new DartSdkManager('/', false),
         InstrumentationService.NULL_SERVICE);
     handler = new AnalysisDomainHandler(server);
   });
@@ -105,7 +105,7 @@
       }
 
       group('excluded', () {
-        test('excluded folder', () {
+        test('excluded folder', () async {
           String fileA = '/project/aaa/a.dart';
           String fileB = '/project/bbb/b.dart';
           resourceProvider.newFile(fileA, '// a');
@@ -115,10 +115,9 @@
           expect(response, isResponseSuccess('0'));
           // unit "a" is resolved eventually
           // unit "b" is not resolved
-          return server.onAnalysisComplete.then((_) {
-            expect(serverRef.getResolvedCompilationUnits(fileA), hasLength(1));
-            expect(serverRef.getResolvedCompilationUnits(fileB), isEmpty);
-          });
+          await server.onAnalysisComplete;
+          expect(await serverRef.getResolvedCompilationUnit(fileA), isNotNull);
+          expect(await serverRef.getResolvedCompilationUnit(fileB), isNull);
         });
 
         test('not absolute', () async {
@@ -139,7 +138,7 @@
       });
 
       group('included', () {
-        test('new folder', () {
+        test('new folder', () async {
           String file = '/project/bin/test.dart';
           resourceProvider.newFile('/project/pubspec.yaml', 'name: project');
           resourceProvider.newFile(file, 'main() {}');
@@ -147,10 +146,9 @@
           var serverRef = server;
           expect(response, isResponseSuccess('0'));
           // verify that unit is resolved eventually
-          return server.onAnalysisComplete.then((_) {
-            var units = serverRef.getResolvedCompilationUnits(file);
-            expect(units, hasLength(1));
-          });
+          await server.onAnalysisComplete;
+          var unit = await serverRef.getResolvedCompilationUnit(file);
+          expect(unit, isNotNull);
         });
 
         test('nonexistent folder', () async {
@@ -162,7 +160,8 @@
           // Non-existence of /project_a should not prevent files in /project_b
           // from being analyzed.
           await server.onAnalysisComplete;
-          expect(serverRef.getResolvedCompilationUnits(fileB), hasLength(1));
+          var unit = await serverRef.getResolvedCompilationUnit(fileB);
+          expect(unit, isNotNull);
         });
 
         test('not absolute', () async {
@@ -435,7 +434,8 @@
     ExtensionManager manager = new ExtensionManager();
     ServerPlugin serverPlugin = new ServerPlugin();
     manager.processPlugins([serverPlugin]);
-    MockSdk sdk = new MockSdk(resourceProvider: resourceProvider);
+    // Create an SDK in the mock file system.
+    new MockSdk(resourceProvider: resourceProvider);
     server = new AnalysisServer(
         serverChannel,
         resourceProvider,
@@ -443,7 +443,7 @@
         null,
         serverPlugin,
         new AnalysisServerOptions(),
-        new DartSdkManager('/', false, (_) => sdk),
+        new DartSdkManager('/', false),
         InstrumentationService.NULL_SERVICE);
     handler = new AnalysisDomainHandler(server);
     // listen for notifications
diff --git a/pkg/analysis_server/test/domain_completion_test.dart b/pkg/analysis_server/test/domain_completion_test.dart
index 81d8a35..b3d85f2 100644
--- a/pkg/analysis_server/test/domain_completion_test.dart
+++ b/pkg/analysis_server/test/domain_completion_test.dart
@@ -12,18 +12,18 @@
 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
 import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
 import 'package:analysis_server/src/services/completion/dart/contribution_sorter.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import 'analysis_abstract.dart';
 import 'domain_completion_util.dart';
 import 'mocks.dart' show pumpEventQueue;
-import 'utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(CompletionDomainHandlerTest);
-  defineReflectiveTests(_NoSearchEngine);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(CompletionDomainHandlerTest);
+    defineReflectiveTests(_NoSearchEngine);
+  });
 }
 
 @reflectiveTest
@@ -48,6 +48,15 @@
     expect(suggestions, hasLength(2));
   }
 
+  test_ArgumentList_imported_function_named_param2() async {
+    addTestFile('mainx() {A a = new A(); a.foo(one: 7, ^);}'
+        'class A { foo({one, two}) {} }');
+    await getSuggestions();
+    assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'two: ',
+        relevance: DART_RELEVANCE_NAMED_PARAMETER);
+    expect(suggestions, hasLength(1));
+  }
+
   test_ArgumentList_imported_function_named_param_label1() async {
     addTestFile('main() { int.parse("16", r^: 16);}');
     await getSuggestions();
@@ -68,15 +77,6 @@
     expect(suggestions, hasLength(2));
   }
 
-  test_ArgumentList_imported_function_named_param2() async {
-    addTestFile('mainx() {A a = new A(); a.foo(one: 7, ^);}'
-        'class A { foo({one, two}) {} }');
-    await getSuggestions();
-    assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'two: ',
-        relevance: DART_RELEVANCE_NAMED_PARAMETER);
-    expect(suggestions, hasLength(1));
-  }
-
   test_html() {
     testFile = '/project/web/test.html';
     addTestFile('''
@@ -89,6 +89,20 @@
     });
   }
 
+  test_import_uri_with_trailing() {
+    addFile('/project/bin/testA.dart', 'library libA;');
+    addTestFile('''
+      import '/project/bin/t^.dart';
+      main() {}''');
+    return getSuggestions().then((_) {
+      expect(replacementOffset, equals(completionOffset - 14));
+      expect(replacementLength, equals(5 + 14));
+      assertHasResult(
+          CompletionSuggestionKind.IMPORT, '/project/bin/testA.dart');
+      assertNoResult('test');
+    });
+  }
+
   test_imports() {
     addTestFile('''
       import 'dart:html';
@@ -109,13 +123,13 @@
         c^''');
 
     // Make a request for suggestions
-    Request request =
+    Request request1 =
         new CompletionGetSuggestionsParams(testFile, completionOffset)
             .toRequest('7');
-    Response response = handleSuccessfulRequest(request);
-    var result1 = new CompletionGetSuggestionsResult.fromResponse(response);
+    Response response1 = await waitResponse(request1);
+    var result1 = new CompletionGetSuggestionsResult.fromResponse(response1);
     var completionId1 = result1.id;
-    assertValidId(response.id);
+    assertValidId(completionId1);
 
     // Perform some analysis but assert that no suggestions have yet been made
     completionId = completionId1;
@@ -127,7 +141,7 @@
     Request request2 =
         new CompletionGetSuggestionsParams(testFile, completionOffset)
             .toRequest('8');
-    Response response2 = handleSuccessfulRequest(request2);
+    Response response2 = await waitResponse(request2);
     var result2 = new CompletionGetSuggestionsResult.fromResponse(response2);
     var completionId2 = result2.id;
     assertValidId(completionId2);
@@ -150,7 +164,7 @@
     Request request =
         new CompletionGetSuggestionsParams(testFile, completionOffset)
             .toRequest('0');
-    Response response = handleSuccessfulRequest(request);
+    Response response = await waitResponse(request);
     completionId = response.id;
     assertValidId(completionId);
 
@@ -213,7 +227,7 @@
         {testFile: new AddContentOverlay(revisedContent)}).toRequest('add1'));
 
     // Request code completion immediately after edit
-    Response response = handleSuccessfulRequest(
+    Response response = await waitResponse(
         new CompletionGetSuggestionsParams(testFile, completionOffset)
             .toRequest('0'));
     completionId = response.id;
@@ -452,12 +466,12 @@
     });
   }
 
-  test_offset_past_eof() {
+  test_offset_past_eof() async {
     addTestFile('main() { }', offset: 300);
     Request request =
         new CompletionGetSuggestionsParams(testFile, completionOffset)
             .toRequest('0');
-    Response response = handler.handleRequest(request);
+    Response response = await waitResponse(request);
     expect(response.id, '0');
     expect(response.error.code, RequestErrorCode.INVALID_PARAMETER);
   }
@@ -561,20 +575,6 @@
       assertNoResult('HtmlElement');
     });
   }
-
-  test_import_uri_with_trailing() {
-    addFile('/project/bin/testA.dart', 'library libA;');
-    addTestFile('''
-      import '/project/bin/t^.dart';
-      main() {}''');
-    return getSuggestions().then((_) {
-      expect(replacementOffset, equals(completionOffset - 14));
-      expect(replacementLength, equals(5 + 14));
-      assertHasResult(
-          CompletionSuggestionKind.IMPORT, '/project/bin/testA.dart');
-      assertNoResult('test');
-    });
-  }
 }
 
 class MockRelevancySorter implements DartContributionSorter {
diff --git a/pkg/analysis_server/test/domain_completion_util.dart b/pkg/analysis_server/test/domain_completion_util.dart
index 6045aee..e95b14f 100644
--- a/pkg/analysis_server/test/domain_completion_util.dart
+++ b/pkg/analysis_server/test/domain_completion_util.dart
@@ -11,16 +11,16 @@
 import 'package:analysis_server/src/domain_completion.dart';
 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
 import 'package:analysis_server/src/services/index/index.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import 'analysis_abstract.dart';
-import 'mocks.dart';
 
 class AbstractCompletionDomainTest extends AbstractAnalysisTest {
   String completionId;
   int completionOffset;
   int replacementOffset;
   int replacementLength;
+  Map<String, Completer<Null>> receivedSuggestionsCompleters = {};
   List<CompletionSuggestion> suggestions = [];
   bool suggestionsDone = false;
   Map<String, List<CompletionSuggestion>> allSuggestions = {};
@@ -82,34 +82,33 @@
     return createMemoryIndex();
   }
 
-  Future getSuggestions() {
-    return waitForTasksFinished().then((_) {
-      Request request =
-          new CompletionGetSuggestionsParams(testFile, completionOffset)
-              .toRequest('0');
-      Response response = handleSuccessfulRequest(request);
-      completionId = response.id;
-      assertValidId(completionId);
-      return pumpEventQueue().then((_) {
-        expect(suggestionsDone, isTrue);
-      });
-    });
+  Future getSuggestions() async {
+    await waitForTasksFinished();
+
+    Request request =
+        new CompletionGetSuggestionsParams(testFile, completionOffset)
+            .toRequest('0');
+    Response response = await waitResponse(request);
+    var result = new CompletionGetSuggestionsResult.fromResponse(response);
+    completionId = result.id;
+    assertValidId(completionId);
+    await _getResultsCompleter(completionId).future;
+    expect(suggestionsDone, isTrue);
   }
 
-  void processNotification(Notification notification) {
+  processNotification(Notification notification) async {
     if (notification.event == COMPLETION_RESULTS) {
       var params = new CompletionResultsParams.fromNotification(notification);
       String id = params.id;
       assertValidId(id);
-      if (id == completionId) {
-        expect(suggestionsDone, isFalse);
-        replacementOffset = params.replacementOffset;
-        replacementLength = params.replacementLength;
-        suggestionsDone = params.isLast;
-        expect(suggestionsDone, isNotNull);
-        suggestions = params.results;
-      }
+      replacementOffset = params.replacementOffset;
+      replacementLength = params.replacementLength;
+      suggestionsDone = params.isLast;
+      expect(suggestionsDone, isNotNull);
+      suggestions = params.results;
+      expect(allSuggestions.containsKey(id), isFalse);
       allSuggestions[id] = params.results;
+      _getResultsCompleter(id).complete(null);
     } else if (notification.event == SERVER_ERROR) {
       fail('server error: ${notification.toJson()}');
     }
@@ -121,4 +120,9 @@
     createProject();
     handler = new CompletionDomainHandler(server);
   }
+
+  Completer<Null> _getResultsCompleter(String id) {
+    return receivedSuggestionsCompleters.putIfAbsent(
+        id, () => new Completer<Null>());
+  }
 }
diff --git a/pkg/analysis_server/test/domain_diagnostic_test.dart b/pkg/analysis_server/test/domain_diagnostic_test.dart
index 1c4ba4a..78080e8 100644
--- a/pkg/analysis_server/test/domain_diagnostic_test.dart
+++ b/pkg/analysis_server/test/domain_diagnostic_test.dart
@@ -14,19 +14,16 @@
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:plugin/manager.dart';
 import 'package:plugin/plugin.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import 'mock_sdk.dart';
 import 'mocks.dart';
-import 'utils.dart';
 
 main() {
   AnalysisServer server;
   DiagnosticDomainHandler handler;
   MemoryResourceProvider resourceProvider;
 
-  initializeTestEnvironment();
-
   setUp(() {
     //
     // Collect plugins
@@ -47,7 +44,8 @@
     //
     var serverChannel = new MockServerChannel();
     resourceProvider = new MemoryResourceProvider();
-    MockSdk sdk = new MockSdk(resourceProvider: resourceProvider);
+    // Create an SDK in the mock file system.
+    new MockSdk(resourceProvider: resourceProvider);
     server = new AnalysisServer(
         serverChannel,
         resourceProvider,
@@ -55,7 +53,7 @@
         null,
         serverPlugin,
         new AnalysisServerOptions(),
-        new DartSdkManager('/', false, (_) => sdk),
+        new DartSdkManager('/', false),
         InstrumentationService.NULL_SERVICE);
     handler = new DiagnosticDomainHandler(server);
   });
diff --git a/pkg/analysis_server/test/domain_execution_test.dart b/pkg/analysis_server/test/domain_execution_test.dart
index fad6e1a..3ed91bd 100644
--- a/pkg/analysis_server/test/domain_execution_test.dart
+++ b/pkg/analysis_server/test/domain_execution_test.dart
@@ -20,19 +20,18 @@
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/source_io.dart';
 import 'package:plugin/manager.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:typed_mock/typed_mock.dart';
-import 'package:unittest/unittest.dart';
 
 import 'analysis_abstract.dart';
-import 'mock_sdk.dart';
 import 'mocks.dart';
 import 'operation/operation_queue_test.dart';
-import 'utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ExecutionDomainTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ExecutionDomainTest);
+  });
   group('ExecutionDomainHandler', () {
     MemoryResourceProvider provider = new MemoryResourceProvider();
     AnalysisServer server;
@@ -49,7 +48,7 @@
           null,
           serverPlugin,
           new AnalysisServerOptions(),
-          new DartSdkManager('', false, (_) => new MockSdk()),
+          new DartSdkManager('', false),
           InstrumentationService.NULL_SERVICE);
       handler = new ExecutionDomainHandler(server);
     });
diff --git a/pkg/analysis_server/test/domain_server_test.dart b/pkg/analysis_server/test/domain_server_test.dart
index 5ffd328..4fbb2b0 100644
--- a/pkg/analysis_server/test/domain_server_test.dart
+++ b/pkg/analysis_server/test/domain_server_test.dart
@@ -13,18 +13,14 @@
 import 'package:analyzer/instrumentation/instrumentation.dart';
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:plugin/manager.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
-import 'mock_sdk.dart';
 import 'mocks.dart';
-import 'utils.dart';
 
 main() {
   AnalysisServer server;
   ServerDomainHandler handler;
 
-  initializeTestEnvironment();
-
   setUp(() {
     var serverChannel = new MockServerChannel();
     var resourceProvider = new MemoryResourceProvider();
@@ -38,7 +34,7 @@
         null,
         serverPlugin,
         new AnalysisServerOptions(),
-        new DartSdkManager('', false, (_) => new MockSdk()),
+        new DartSdkManager('', false),
         InstrumentationService.NULL_SERVICE);
     handler = new ServerDomainHandler(server);
   });
diff --git a/pkg/analysis_server/test/edit/assists_test.dart b/pkg/analysis_server/test/edit/assists_test.dart
index 538a04e..0181c87 100644
--- a/pkg/analysis_server/test/edit/assists_test.dart
+++ b/pkg/analysis_server/test/edit/assists_test.dart
@@ -7,15 +7,15 @@
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/edit/edit_domain.dart';
 import 'package:plugin/manager.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart' hide ERROR;
 
 import '../analysis_abstract.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AssistsTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AssistsTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/edit/fixes_test.dart b/pkg/analysis_server/test/edit/fixes_test.dart
index 1b5cd87..3cd22c0 100644
--- a/pkg/analysis_server/test/edit/fixes_test.dart
+++ b/pkg/analysis_server/test/edit/fixes_test.dart
@@ -9,15 +9,15 @@
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/edit/edit_domain.dart';
 import 'package:plugin/manager.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart' hide ERROR;
 
 import '../analysis_abstract.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(FixesTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(FixesTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/edit/format_test.dart b/pkg/analysis_server/test/edit/format_test.dart
index d864ef9..a7e7e4e 100644
--- a/pkg/analysis_server/test/edit/format_test.dart
+++ b/pkg/analysis_server/test/edit/format_test.dart
@@ -9,16 +9,16 @@
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/edit/edit_domain.dart';
 import 'package:plugin/manager.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart' hide ERROR;
 
 import '../analysis_abstract.dart';
 import '../mocks.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(FormatTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(FormatTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/edit/organize_directives_test.dart b/pkg/analysis_server/test/edit/organize_directives_test.dart
index 5223627..d35439a 100644
--- a/pkg/analysis_server/test/edit/organize_directives_test.dart
+++ b/pkg/analysis_server/test/edit/organize_directives_test.dart
@@ -9,16 +9,16 @@
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/edit/edit_domain.dart';
 import 'package:plugin/manager.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart' hide ERROR;
 
 import '../analysis_abstract.dart';
 import '../mocks.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(OrganizeDirectivesTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(OrganizeDirectivesTest);
+  });
 }
 
 @reflectiveTest
@@ -38,7 +38,7 @@
     await waitForTasksFinished();
     Request request =
         new EditOrganizeDirectivesParams('/no/such/file.dart').toRequest('0');
-    Response response = handler.handleRequest(request);
+    Response response = await waitResponse(request);
     expect(
         response, isResponseFailure('0', RequestErrorCode.FILE_NOT_ANALYZED));
   }
@@ -51,7 +51,7 @@
 ''');
     await waitForTasksFinished();
     Request request = new EditOrganizeDirectivesParams(testFile).toRequest('0');
-    Response response = handler.handleRequest(request);
+    Response response = await waitResponse(request);
     expect(response,
         isResponseFailure('0', RequestErrorCode.ORGANIZE_DIRECTIVES_ERROR));
   }
@@ -60,7 +60,7 @@
     await waitForTasksFinished();
     Request request =
         new EditOrganizeDirectivesParams('/not-a-Dart-file.txt').toRequest('0');
-    Response response = handler.handleRequest(request);
+    Response response = await waitResponse(request);
     expect(
         response, isResponseFailure('0', RequestErrorCode.FILE_NOT_ANALYZED));
   }
@@ -158,14 +158,14 @@
 
   Future _assertOrganized(String expectedCode) async {
     await waitForTasksFinished();
-    _requestOrganize();
+    await _requestOrganize();
     String resultCode = SourceEdit.applySequence(testCode, fileEdit.edits);
     expect(resultCode, expectedCode);
   }
 
-  void _requestOrganize() {
+  Future _requestOrganize() async {
     Request request = new EditOrganizeDirectivesParams(testFile).toRequest('0');
-    Response response = handleSuccessfulRequest(request);
+    Response response = await waitResponse(request);
     var result = new EditOrganizeDirectivesResult.fromResponse(response);
     fileEdit = result.edit;
   }
diff --git a/pkg/analysis_server/test/edit/refactoring_test.dart b/pkg/analysis_server/test/edit/refactoring_test.dart
index 766e58f..ee97a1a 100644
--- a/pkg/analysis_server/test/edit/refactoring_test.dart
+++ b/pkg/analysis_server/test/edit/refactoring_test.dart
@@ -11,25 +11,25 @@
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analyzer/task/dart.dart';
 import 'package:plugin/manager.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart' hide ERROR;
 
 import '../analysis_abstract.dart';
 import '../mocks.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ConvertGetterMethodToMethodTest);
-  defineReflectiveTests(ConvertMethodToGetterTest);
-  defineReflectiveTests(ExtractLocalVariableTest);
-  defineReflectiveTests(ExtractMethodTest);
-  defineReflectiveTests(GetAvailableRefactoringsTest);
-  defineReflectiveTests(InlineLocalTest);
-  defineReflectiveTests(InlineMethodTest);
-  defineReflectiveTests(MoveFileTest);
-  defineReflectiveTests(RenameTest);
-  defineReflectiveTests(_NoSearchEngine);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ConvertGetterMethodToMethodTest);
+    defineReflectiveTests(ConvertMethodToGetterTest);
+    defineReflectiveTests(ExtractLocalVariableTest);
+    defineReflectiveTests(ExtractMethodTest);
+    defineReflectiveTests(GetAvailableRefactoringsTest);
+    defineReflectiveTests(InlineLocalTest);
+    defineReflectiveTests(InlineMethodTest);
+    defineReflectiveTests(MoveFileTest);
+    defineReflectiveTests(RenameTest);
+    defineReflectiveTests(_NoSearchEngine);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/edit/sort_members_test.dart b/pkg/analysis_server/test/edit/sort_members_test.dart
index ee801df7..b246d82 100644
--- a/pkg/analysis_server/test/edit/sort_members_test.dart
+++ b/pkg/analysis_server/test/edit/sort_members_test.dart
@@ -9,16 +9,16 @@
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/edit/edit_domain.dart';
 import 'package:plugin/manager.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart' hide ERROR;
 
 import '../analysis_abstract.dart';
 import '../mocks.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(SortMembersTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(SortMembersTest);
+  });
 }
 
 @reflectiveTest
@@ -37,7 +37,7 @@
   test_BAD_doesNotExist() async {
     Request request =
         new EditSortMembersParams('/no/such/file.dart').toRequest('0');
-    Response response = handler.handleRequest(request);
+    Response response = await waitResponse(request);
     expect(response,
         isResponseFailure('0', RequestErrorCode.SORT_MEMBERS_INVALID_FILE));
   }
@@ -49,7 +49,7 @@
 }
 ''');
     Request request = new EditSortMembersParams(testFile).toRequest('0');
-    Response response = handler.handleRequest(request);
+    Response response = await waitResponse(request);
     expect(response,
         isResponseFailure('0', RequestErrorCode.SORT_MEMBERS_PARSE_ERRORS));
   }
@@ -57,7 +57,7 @@
   test_BAD_notDartFile() async {
     Request request =
         new EditSortMembersParams('/not-a-Dart-file.txt').toRequest('0');
-    Response response = handler.handleRequest(request);
+    Response response = await waitResponse(request);
     expect(response,
         isResponseFailure('0', RequestErrorCode.SORT_MEMBERS_INVALID_FILE));
   }
@@ -192,14 +192,14 @@
   }
 
   Future _assertSorted(String expectedCode) async {
-    _requestSort();
+    await _requestSort();
     String resultCode = SourceEdit.applySequence(testCode, fileEdit.edits);
     expect(resultCode, expectedCode);
   }
 
-  void _requestSort() {
+  Future _requestSort() async {
     Request request = new EditSortMembersParams(testFile).toRequest('0');
-    Response response = handleSuccessfulRequest(request);
+    Response response = await waitResponse(request);
     var result = new EditSortMembersResult.fromResponse(response);
     fileEdit = result.edit;
   }
diff --git a/pkg/analysis_server/test/edit/test_all.dart b/pkg/analysis_server/test/edit/test_all.dart
index ef861d8..16a89ed 100644
--- a/pkg/analysis_server/test/edit/test_all.dart
+++ b/pkg/analysis_server/test/edit/test_all.dart
@@ -4,9 +4,8 @@
 
 library test.edit.all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../utils.dart';
 import 'assists_test.dart' as assists_test;
 import 'fixes_test.dart' as fixes_test;
 import 'format_test.dart' as format_test;
@@ -18,13 +17,12 @@
  * Utility for manually running all tests.
  */
 main() {
-  initializeTestEnvironment();
-  group('edit', () {
+  defineReflectiveSuite(() {
     assists_test.main();
     fixes_test.main();
     format_test.main();
     organize_directives_test.main();
     refactoring_test.main();
     sort_members_test.main();
-  });
+  }, name: 'edit');
 }
diff --git a/pkg/analysis_server/test/integration/analysis/analysis_options_test.dart b/pkg/analysis_server/test/integration/analysis/analysis_options_test.dart
index 4c55f82..a2ea8e7 100644
--- a/pkg/analysis_server/test/integration/analysis/analysis_options_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/analysis_options_test.dart
@@ -6,15 +6,15 @@
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analyzer/src/generated/engine.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(OptionsIntegrationTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(OptionsIntegrationTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/integration/analysis/error_test.dart b/pkg/analysis_server/test/integration/analysis/error_test.dart
index b01f1d8..f2abb51 100644
--- a/pkg/analysis_server/test/integration/analysis/error_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/error_test.dart
@@ -5,15 +5,15 @@
 library test.integration.analysis.error;
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AnalysisErrorIntegrationTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisErrorIntegrationTest);
+  });
 }
 
 @reflectiveTest
@@ -63,11 +63,11 @@
     expect(
         allErrorMessages,
         contains(
-            "The class 'C' cannot be used as a mixin because it extends a class other than Object"));
+            "The class 'C' can't be used as a mixin because it extends a class other than Object."));
     expect(
         allErrorMessages,
         contains(
-            "The class 'C' cannot be used as a mixin because it references 'super'"));
+            "The class 'C' can't be used as a mixin because it references 'super'."));
   }
 
   test_super_mixins_enabled() async {
diff --git a/pkg/analysis_server/test/integration/analysis/get_errors.dart b/pkg/analysis_server/test/integration/analysis/get_errors.dart
index c21d242..d7aee3c 100644
--- a/pkg/analysis_server/test/integration/analysis/get_errors.dart
+++ b/pkg/analysis_server/test/integration/analysis/get_errors.dart
@@ -6,7 +6,7 @@
 
 import 'dart:async';
 
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import '../integration_tests.dart';
 
diff --git a/pkg/analysis_server/test/integration/analysis/get_errors_after_analysis_test.dart b/pkg/analysis_server/test/integration/analysis/get_errors_after_analysis_test.dart
index 2024194..37caf81 100644
--- a/pkg/analysis_server/test/integration/analysis/get_errors_after_analysis_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/get_errors_after_analysis_test.dart
@@ -6,12 +6,12 @@
 
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
 import 'get_errors.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(Test);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(Test);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/integration/analysis/get_errors_before_analysis_test.dart b/pkg/analysis_server/test/integration/analysis/get_errors_before_analysis_test.dart
index 51ef942..4863a8d 100644
--- a/pkg/analysis_server/test/integration/analysis/get_errors_before_analysis_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/get_errors_before_analysis_test.dart
@@ -6,12 +6,12 @@
 
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
 import 'get_errors.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(Test);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(Test);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/integration/analysis/get_errors_nonStandard_sdk.dart b/pkg/analysis_server/test/integration/analysis/get_errors_nonStandard_sdk.dart
index 70bd7aa..9d34855 100644
--- a/pkg/analysis_server/test/integration/analysis/get_errors_nonStandard_sdk.dart
+++ b/pkg/analysis_server/test/integration/analysis/get_errors_nonStandard_sdk.dart
@@ -10,16 +10,16 @@
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:path/path.dart' as path;
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../mock_sdk.dart';
-import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AnalysisDomainGetErrorsTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisDomainGetErrorsTest);
+  });
 }
 
 /**
diff --git a/pkg/analysis_server/test/integration/analysis/get_hover_test.dart b/pkg/analysis_server/test/integration/analysis/get_hover_test.dart
index 7ed2989..7c6a742 100644
--- a/pkg/analysis_server/test/integration/analysis/get_hover_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/get_hover_test.dart
@@ -7,16 +7,16 @@
 import 'dart:async';
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
-import 'package:path/path.dart';
+import 'package:path/path.dart' as path;
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AnalysisGetHoverIntegrationTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisGetHoverIntegrationTest);
+  });
 }
 
 @reflectiveTest
@@ -78,7 +78,7 @@
       expect(info.offset, equals(offset));
       expect(info.length, equals(length));
       if (isCore) {
-        expect(basename(info.containingLibraryPath), equals('core.dart'));
+        expect(path.basename(info.containingLibraryPath), equals('core.dart'));
         expect(info.containingLibraryName, equals('dart.core'));
       } else if (isLocal || isLiteral) {
         expect(info.containingLibraryPath, isNull);
diff --git a/pkg/analysis_server/test/integration/analysis/highlights_test.dart b/pkg/analysis_server/test/integration/analysis/highlights_test.dart
index 7605ea3..bc20497 100644
--- a/pkg/analysis_server/test/integration/analysis/highlights_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/highlights_test.dart
@@ -5,15 +5,15 @@
 library test.integration.analysis.highlights;
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AnalysisHighlightsTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisHighlightsTest);
+  });
 }
 
 @reflectiveTest
@@ -99,6 +99,7 @@
         expect(highlights[type], equals(expected.toSet()));
         highlights.remove(type);
       }
+
       check(HighlightRegionType.ANNOTATION, ['@override']);
       check(HighlightRegionType.BUILT_IN,
           ['as', 'get', 'import', 'set', 'static', 'typedef']);
diff --git a/pkg/analysis_server/test/integration/analysis/highlights_test2.dart b/pkg/analysis_server/test/integration/analysis/highlights_test2.dart
index c8d75ee..b1a70c5 100644
--- a/pkg/analysis_server/test/integration/analysis/highlights_test2.dart
+++ b/pkg/analysis_server/test/integration/analysis/highlights_test2.dart
@@ -7,15 +7,15 @@
 import 'dart:async';
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AnalysisHighlightsTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisHighlightsTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/integration/analysis/lint_test.dart b/pkg/analysis_server/test/integration/analysis/lint_test.dart
index a1cfeb6..b8d212e 100644
--- a/pkg/analysis_server/test/integration/analysis/lint_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/lint_test.dart
@@ -6,15 +6,15 @@
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analyzer/src/generated/engine.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(LintIntegrationTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(LintIntegrationTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/integration/analysis/navigation_test.dart b/pkg/analysis_server/test/integration/analysis/navigation_test.dart
index 35dd9e2..d6ea41c 100644
--- a/pkg/analysis_server/test/integration/analysis/navigation_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/navigation_test.dart
@@ -5,15 +5,15 @@
 library test.integration.analysis.navigation;
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AnalysisNavigationTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisNavigationTest);
+  });
 }
 
 @reflectiveTest
@@ -84,6 +84,7 @@
         fail('No element found for index $index');
         return null;
       }
+
       void checkLocal(
           String source, String expectedTarget, ElementKind expectedKind) {
         int sourceIndex = text1.indexOf(source);
@@ -93,6 +94,7 @@
         expect(element.offset, equals(targetIndex));
         expect(element.kind, equals(expectedKind));
       }
+
       void checkRemote(String source, String expectedTargetRegexp,
           ElementKind expectedKind) {
         int sourceIndex = text1.indexOf(source);
@@ -100,6 +102,7 @@
         expect(targetFiles[element.fileIndex], matches(expectedTargetRegexp));
         expect(element.kind, equals(expectedKind));
       }
+
       // TODO(paulberry): will the element type 'CLASS_TYPE_ALIAS' ever appear
       // as a navigation target?
       checkLocal('Class<int>', 'Class<TypeParameter>', ElementKind.CLASS);
diff --git a/pkg/analysis_server/test/integration/analysis/occurrences_test.dart b/pkg/analysis_server/test/integration/analysis/occurrences_test.dart
index 1bcb270..2234205 100644
--- a/pkg/analysis_server/test/integration/analysis/occurrences_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/occurrences_test.dart
@@ -5,15 +5,15 @@
 library test.integration.analysis.occurrences;
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(Test);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(Test);
+  });
 }
 
 @reflectiveTest
@@ -52,6 +52,7 @@
         fail('No element found matching $elementName');
         return null;
       }
+
       void check(String elementName, Iterable<String> expectedOccurrences) {
         Set<int> expectedOffsets = expectedOccurrences
             .map((String substring) => text.indexOf(substring))
@@ -59,6 +60,7 @@
         Set<int> foundOffsets = findOffsets(elementName);
         expect(foundOffsets, equals(expectedOffsets));
       }
+
       check('i', ['i = 0', 'i < 10', 'i++', 'i;']);
       check('j', ['j = 0', 'j < i', 'j++', 'j;']);
       check('sum', ['sum = 0', 'sum +=', 'sum)']);
diff --git a/pkg/analysis_server/test/integration/analysis/outline_test.dart b/pkg/analysis_server/test/integration/analysis/outline_test.dart
index 7d7d853..23f2cbd 100644
--- a/pkg/analysis_server/test/integration/analysis/outline_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/outline_test.dart
@@ -5,15 +5,15 @@
 library test.integration.analysis.outline;
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(Test);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(Test);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/integration/analysis/overrides_test.dart b/pkg/analysis_server/test/integration/analysis/overrides_test.dart
index e7b77dc..74c179f 100644
--- a/pkg/analysis_server/test/integration/analysis/overrides_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/overrides_test.dart
@@ -5,15 +5,15 @@
 library test.integration.analysis.overrides;
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(Test);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(Test);
+  });
 }
 
 @reflectiveTest
@@ -74,6 +74,7 @@
         }
         return null;
       }
+
       void checkOverrides(String methodName, bool expectedOverridesBase,
           List<String> expectedOverridesInterfaces) {
         Override override = findOverride(methodName);
@@ -109,6 +110,7 @@
           expect(interfaceMembers, isNull);
         }
       }
+
       checkOverrides('method0', true, ['Interface1', 'Interface2']);
       checkOverrides('method1', false, ['Interface1', 'Interface2']);
       checkOverrides('method2', true, ['Interface1']);
diff --git a/pkg/analysis_server/test/integration/analysis/package_root_test.dart b/pkg/analysis_server/test/integration/analysis/package_root_test.dart
index 7ce03d2..5ad9c38 100644
--- a/pkg/analysis_server/test/integration/analysis/package_root_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/package_root_test.dart
@@ -5,25 +5,25 @@
 library test.integration.analysis.packageRoot;
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
-import 'package:path/path.dart';
+import 'package:path/path.dart' as path;
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(Test);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(Test);
+  });
 }
 
 @reflectiveTest
 class Test extends AbstractAnalysisServerIntegrationTest {
   test_package_root() {
     String projPath = sourcePath('project');
-    String mainPath = join(projPath, 'main.dart');
+    String mainPath = path.join(projPath, 'main.dart');
     String packagesPath = sourcePath('packages');
-    String fooBarPath = join(packagesPath, 'foo', 'bar.dart');
+    String fooBarPath = path.join(packagesPath, 'foo', 'bar.dart');
     String mainText = """
 library main;
 
diff --git a/pkg/analysis_server/test/integration/analysis/reanalyze_concurrent_test.dart b/pkg/analysis_server/test/integration/analysis/reanalyze_concurrent_test.dart
index 443bab1..abf05cf 100644
--- a/pkg/analysis_server/test/integration/analysis/reanalyze_concurrent_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/reanalyze_concurrent_test.dart
@@ -14,12 +14,12 @@
 
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(Test);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(Test);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/integration/analysis/reanalyze_test.dart b/pkg/analysis_server/test/integration/analysis/reanalyze_test.dart
index df1250b..ac5b889 100644
--- a/pkg/analysis_server/test/integration/analysis/reanalyze_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/reanalyze_test.dart
@@ -5,15 +5,15 @@
 library test.integration.analysis.reanalyze;
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(Test);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(Test);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/integration/analysis/test_all.dart b/pkg/analysis_server/test/integration/analysis/test_all.dart
index eb8a06e..dcdc7c8 100644
--- a/pkg/analysis_server/test/integration/analysis/test_all.dart
+++ b/pkg/analysis_server/test/integration/analysis/test_all.dart
@@ -4,9 +4,8 @@
 
 library test.integration.analysis.all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
 import 'analysis_options_test.dart' as analysis_options_test;
 import 'error_test.dart' as error_test;
 import 'get_errors_after_analysis_test.dart' as get_errors_after_analysis_test;
@@ -31,8 +30,7 @@
  * Utility for manually running all integration tests.
  */
 main() {
-  initializeTestEnvironment();
-  group('analysis', () {
+  defineReflectiveSuite(() {
     analysis_options_test.main();
     error_test.main();
     get_errors_after_analysis_test.main();
@@ -51,5 +49,5 @@
     reanalyze_test.main();
     update_content_test.main();
     update_content_list_test.main();
-  });
+  }, name: 'analysis');
 }
diff --git a/pkg/analysis_server/test/integration/analysis/update_content_list_test.dart b/pkg/analysis_server/test/integration/analysis/update_content_list_test.dart
index 3eb72ff..b235a39 100644
--- a/pkg/analysis_server/test/integration/analysis/update_content_list_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/update_content_list_test.dart
@@ -5,15 +5,15 @@
 library test.integration.analysis.update.content.list;
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(Test);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(Test);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/integration/analysis/update_content_test.dart b/pkg/analysis_server/test/integration/analysis/update_content_test.dart
index b451396..1d275ce2 100644
--- a/pkg/analysis_server/test/integration/analysis/update_content_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/update_content_test.dart
@@ -5,15 +5,15 @@
 library test.integration.analysis.update.content;
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(Test);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(Test);
+  });
 }
 
 @reflectiveTest
@@ -37,7 +37,7 @@
         .then((result) => analysisFinished)
         .then((_) {
           // There should be no errors now because the contents on disk have been
-          // overriden with goodText.
+          // overridden with goodText.
           expect(currentAnalysisErrors[pathname], isEmpty);
           return sendAnalysisUpdateContent({
             pathname: new ChangeContentOverlay(
diff --git a/pkg/analysis_server/test/integration/completion/get_suggestions_test.dart b/pkg/analysis_server/test/integration/completion/get_suggestions_test.dart
index a318ea2..653711f 100644
--- a/pkg/analysis_server/test/integration/completion/get_suggestions_test.dart
+++ b/pkg/analysis_server/test/integration/completion/get_suggestions_test.dart
@@ -5,15 +5,15 @@
 library test.integration.completion.get.suggestions;
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(Test);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(Test);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/integration/completion/test_all.dart b/pkg/analysis_server/test/integration/completion/test_all.dart
index aae07f3..580ffca 100644
--- a/pkg/analysis_server/test/integration/completion/test_all.dart
+++ b/pkg/analysis_server/test/integration/completion/test_all.dart
@@ -4,17 +4,15 @@
 
 library test.integration.completion.all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
 import 'get_suggestions_test.dart' as get_suggestions_test;
 
 /**
  * Utility for manually running all integration tests.
  */
 main() {
-  initializeTestEnvironment();
-  group('completion', () {
+  defineReflectiveSuite(() {
     get_suggestions_test.main();
-  });
+  }, name: 'completion');
 }
diff --git a/pkg/analysis_server/test/integration/integration_test_methods.dart b/pkg/analysis_server/test/integration/integration_test_methods.dart
index 9e4a5ee..4bad372 100644
--- a/pkg/analysis_server/test/integration/integration_test_methods.dart
+++ b/pkg/analysis_server/test/integration/integration_test_methods.dart
@@ -15,7 +15,7 @@
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/protocol/protocol_internal.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import 'integration_tests.dart';
 import 'protocol_matchers.dart';
@@ -51,7 +51,7 @@
    */
   Future sendServerShutdown() async {
     var result = await server.send("server.shutdown", null);
-    expect(result, isNull);
+    outOfTestExpect(result, isNull);
     return null;
   }
 
@@ -72,7 +72,7 @@
   Future sendServerSetSubscriptions(List<ServerService> subscriptions) async {
     var params = new ServerSetSubscriptionsParams(subscriptions).toJson();
     var result = await server.send("server.setSubscriptions", params);
-    expect(result, isNull);
+    outOfTestExpect(result, isNull);
     return null;
   }
 
@@ -376,7 +376,7 @@
   Future sendAnalysisReanalyze({List<String> roots}) async {
     var params = new AnalysisReanalyzeParams(roots: roots).toJson();
     var result = await server.send("analysis.reanalyze", params);
-    expect(result, isNull);
+    outOfTestExpect(result, isNull);
     return null;
   }
 
@@ -442,7 +442,7 @@
   Future sendAnalysisSetAnalysisRoots(List<String> included, List<String> excluded, {Map<String, String> packageRoots}) async {
     var params = new AnalysisSetAnalysisRootsParams(included, excluded, packageRoots: packageRoots).toJson();
     var result = await server.send("analysis.setAnalysisRoots", params);
-    expect(result, isNull);
+    outOfTestExpect(result, isNull);
     return null;
   }
 
@@ -464,7 +464,7 @@
   Future sendAnalysisSetGeneralSubscriptions(List<GeneralAnalysisService> subscriptions) async {
     var params = new AnalysisSetGeneralSubscriptionsParams(subscriptions).toJson();
     var result = await server.send("analysis.setGeneralSubscriptions", params);
-    expect(result, isNull);
+    outOfTestExpect(result, isNull);
     return null;
   }
 
@@ -496,7 +496,7 @@
   Future sendAnalysisSetPriorityFiles(List<String> files) async {
     var params = new AnalysisSetPriorityFilesParams(files).toJson();
     var result = await server.send("analysis.setPriorityFiles", params);
-    expect(result, isNull);
+    outOfTestExpect(result, isNull);
     return null;
   }
 
@@ -535,7 +535,7 @@
   Future sendAnalysisSetSubscriptions(Map<AnalysisService, List<String>> subscriptions) async {
     var params = new AnalysisSetSubscriptionsParams(subscriptions).toJson();
     var result = await server.send("analysis.setSubscriptions", params);
-    expect(result, isNull);
+    outOfTestExpect(result, isNull);
     return null;
   }
 
@@ -579,7 +579,7 @@
   Future sendAnalysisUpdateOptions(AnalysisOptions options) async {
     var params = new AnalysisUpdateOptionsParams(options).toJson();
     var result = await server.send("analysis.updateOptions", params);
-    expect(result, isNull);
+    outOfTestExpect(result, isNull);
     return null;
   }
 
@@ -1503,7 +1503,7 @@
   Future sendExecutionDeleteContext(String id) async {
     var params = new ExecutionDeleteContextParams(id).toJson();
     var result = await server.send("execution.deleteContext", params);
-    expect(result, isNull);
+    outOfTestExpect(result, isNull);
     return null;
   }
 
@@ -1579,7 +1579,7 @@
   Future sendExecutionSetSubscriptions(List<ExecutionService> subscriptions) async {
     var params = new ExecutionSetSubscriptionsParams(subscriptions).toJson();
     var result = await server.send("execution.setSubscriptions", params);
-    expect(result, isNull);
+    outOfTestExpect(result, isNull);
     return null;
   }
 
@@ -1678,71 +1678,71 @@
     ResponseDecoder decoder = new ResponseDecoder(null);
     switch (event) {
       case "server.connected":
-        expect(params, isServerConnectedParams);
+        outOfTestExpect(params, isServerConnectedParams);
         _onServerConnected.add(new ServerConnectedParams.fromJson(decoder, 'params', params));
         break;
       case "server.error":
-        expect(params, isServerErrorParams);
+        outOfTestExpect(params, isServerErrorParams);
         _onServerError.add(new ServerErrorParams.fromJson(decoder, 'params', params));
         break;
       case "server.status":
-        expect(params, isServerStatusParams);
+        outOfTestExpect(params, isServerStatusParams);
         _onServerStatus.add(new ServerStatusParams.fromJson(decoder, 'params', params));
         break;
       case "analysis.analyzedFiles":
-        expect(params, isAnalysisAnalyzedFilesParams);
+        outOfTestExpect(params, isAnalysisAnalyzedFilesParams);
         _onAnalysisAnalyzedFiles.add(new AnalysisAnalyzedFilesParams.fromJson(decoder, 'params', params));
         break;
       case "analysis.errors":
-        expect(params, isAnalysisErrorsParams);
+        outOfTestExpect(params, isAnalysisErrorsParams);
         _onAnalysisErrors.add(new AnalysisErrorsParams.fromJson(decoder, 'params', params));
         break;
       case "analysis.flushResults":
-        expect(params, isAnalysisFlushResultsParams);
+        outOfTestExpect(params, isAnalysisFlushResultsParams);
         _onAnalysisFlushResults.add(new AnalysisFlushResultsParams.fromJson(decoder, 'params', params));
         break;
       case "analysis.folding":
-        expect(params, isAnalysisFoldingParams);
+        outOfTestExpect(params, isAnalysisFoldingParams);
         _onAnalysisFolding.add(new AnalysisFoldingParams.fromJson(decoder, 'params', params));
         break;
       case "analysis.highlights":
-        expect(params, isAnalysisHighlightsParams);
+        outOfTestExpect(params, isAnalysisHighlightsParams);
         _onAnalysisHighlights.add(new AnalysisHighlightsParams.fromJson(decoder, 'params', params));
         break;
       case "analysis.implemented":
-        expect(params, isAnalysisImplementedParams);
+        outOfTestExpect(params, isAnalysisImplementedParams);
         _onAnalysisImplemented.add(new AnalysisImplementedParams.fromJson(decoder, 'params', params));
         break;
       case "analysis.invalidate":
-        expect(params, isAnalysisInvalidateParams);
+        outOfTestExpect(params, isAnalysisInvalidateParams);
         _onAnalysisInvalidate.add(new AnalysisInvalidateParams.fromJson(decoder, 'params', params));
         break;
       case "analysis.navigation":
-        expect(params, isAnalysisNavigationParams);
+        outOfTestExpect(params, isAnalysisNavigationParams);
         _onAnalysisNavigation.add(new AnalysisNavigationParams.fromJson(decoder, 'params', params));
         break;
       case "analysis.occurrences":
-        expect(params, isAnalysisOccurrencesParams);
+        outOfTestExpect(params, isAnalysisOccurrencesParams);
         _onAnalysisOccurrences.add(new AnalysisOccurrencesParams.fromJson(decoder, 'params', params));
         break;
       case "analysis.outline":
-        expect(params, isAnalysisOutlineParams);
+        outOfTestExpect(params, isAnalysisOutlineParams);
         _onAnalysisOutline.add(new AnalysisOutlineParams.fromJson(decoder, 'params', params));
         break;
       case "analysis.overrides":
-        expect(params, isAnalysisOverridesParams);
+        outOfTestExpect(params, isAnalysisOverridesParams);
         _onAnalysisOverrides.add(new AnalysisOverridesParams.fromJson(decoder, 'params', params));
         break;
       case "completion.results":
-        expect(params, isCompletionResultsParams);
+        outOfTestExpect(params, isCompletionResultsParams);
         _onCompletionResults.add(new CompletionResultsParams.fromJson(decoder, 'params', params));
         break;
       case "search.results":
-        expect(params, isSearchResultsParams);
+        outOfTestExpect(params, isSearchResultsParams);
         _onSearchResults.add(new SearchResultsParams.fromJson(decoder, 'params', params));
         break;
       case "execution.launchData":
-        expect(params, isExecutionLaunchDataParams);
+        outOfTestExpect(params, isExecutionLaunchDataParams);
         _onExecutionLaunchData.add(new ExecutionLaunchDataParams.fromJson(decoder, 'params', params));
         break;
       default:
diff --git a/pkg/analysis_server/test/integration/integration_tests.dart b/pkg/analysis_server/test/integration/integration_tests.dart
index f6748ed..71b5378 100644
--- a/pkg/analysis_server/test/integration/integration_tests.dart
+++ b/pkg/analysis_server/test/integration/integration_tests.dart
@@ -12,7 +12,7 @@
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
 import 'package:path/path.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import 'integration_test_methods.dart';
 import 'protocol_matchers.dart';
@@ -40,6 +40,38 @@
 Matcher isOneOf(List<Matcher> choiceMatchers) => new _OneOf(choiceMatchers);
 
 /**
+ * Assert that [actual] matches [matcher].
+ */
+void outOfTestExpect(actual, matcher,
+    {String reason, skip, bool verbose: false}) {
+  var matchState = {};
+  try {
+    if (matcher.matches(actual, matchState)) return;
+  } catch (e, trace) {
+    if (reason == null) {
+      reason = '${(e is String) ? e : e.toString()} at $trace';
+    }
+  }
+  fail(_defaultFailFormatter(actual, matcher, reason, matchState, verbose));
+}
+
+String _defaultFailFormatter(
+    actual, Matcher matcher, String reason, Map matchState, bool verbose) {
+  var description = new StringDescription();
+  description.add('Expected: ').addDescriptionOf(matcher).add('\n');
+  description.add('  Actual: ').addDescriptionOf(actual).add('\n');
+
+  var mismatchDescription = new StringDescription();
+  matcher.describeMismatch(actual, mismatchDescription, matchState, verbose);
+
+  if (mismatchDescription.length > 0) {
+    description.add('   Which: $mismatchDescription\n');
+  }
+  if (reason != null) description.add(reason).add('\n');
+  return description.toString();
+}
+
+/**
  * Type of closures used by LazyMatcher.
  */
 typedef Matcher MatcherCreator();
@@ -111,7 +143,7 @@
     StreamSubscription subscription;
     // This will only work if the caller has already subscribed to
     // SERVER_STATUS (e.g. using sendServerSetSubscriptions(['STATUS']))
-    expect(_subscribedToServerStatus, isTrue);
+    outOfTestExpect(_subscribedToServerStatus, isTrue);
     subscription = onServerStatus.listen((ServerStatusParams params) {
       if (params.analysis != null && !params.analysis.isAnalyzing) {
         completer.complete(params);
@@ -147,7 +179,7 @@
     });
     Completer serverConnected = new Completer();
     onServerConnected.listen((_) {
-      expect(serverConnected.isCompleted, isFalse);
+      outOfTestExpect(serverConnected.isCompleted, isFalse);
       serverConnected.complete();
     });
     onServerError.listen((ServerErrorParams params) {
@@ -525,10 +557,10 @@
         _badDataFromServer('JSON decode failure: $exception');
         return;
       }
-      expect(message, isMap);
+      outOfTestExpect(message, isMap);
       Map messageAsMap = message;
       if (messageAsMap.containsKey('id')) {
-        expect(messageAsMap['id'], isString);
+        outOfTestExpect(messageAsMap['id'], isString);
         String id = message['id'];
         Completer completer = _pendingCommands[id];
         if (completer == null) {
@@ -546,17 +578,17 @@
         // Check that the message is well-formed.  We do this after calling
         // completer.complete() or completer.completeError() so that we don't
         // stall the test in the event of an error.
-        expect(message, isResponse);
+        outOfTestExpect(message, isResponse);
       } else {
         // Message is a notification.  It should have an event and possibly
         // params.
-        expect(messageAsMap, contains('event'));
-        expect(messageAsMap['event'], isString);
+        outOfTestExpect(messageAsMap, contains('event'));
+        outOfTestExpect(messageAsMap['event'], isString);
         notificationProcessor(messageAsMap['event'], messageAsMap['params']);
         // Check that the message is well-formed.  We do this after calling
         // notificationController.add() so that we don't stall the test in the
         // event of an error.
-        expect(message, isNotification);
+        outOfTestExpect(message, isNotification);
       }
     });
     _process.stderr
diff --git a/pkg/analysis_server/test/integration/protocol_matchers.dart b/pkg/analysis_server/test/integration/protocol_matchers.dart
index fef9ef3..7f2f3ab 100644
--- a/pkg/analysis_server/test/integration/protocol_matchers.dart
+++ b/pkg/analysis_server/test/integration/protocol_matchers.dart
@@ -11,7 +11,7 @@
  */
 library test.integration.protocol.matchers;
 
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import 'integration_tests.dart';
 
diff --git a/pkg/analysis_server/test/integration/search/get_type_hierarchy_test.dart b/pkg/analysis_server/test/integration/search/get_type_hierarchy_test.dart
index 5cd0820..bcfa73e 100644
--- a/pkg/analysis_server/test/integration/search/get_type_hierarchy_test.dart
+++ b/pkg/analysis_server/test/integration/search/get_type_hierarchy_test.dart
@@ -7,15 +7,15 @@
 import 'dart:async';
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(Test);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(Test);
+  });
 }
 
 /**
diff --git a/pkg/analysis_server/test/integration/search/test_all.dart b/pkg/analysis_server/test/integration/search/test_all.dart
index 7c58783..daeb6a4 100644
--- a/pkg/analysis_server/test/integration/search/test_all.dart
+++ b/pkg/analysis_server/test/integration/search/test_all.dart
@@ -4,17 +4,15 @@
 
 library test.integration.search.all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
 import 'get_type_hierarchy_test.dart' as get_type_hierarchy_test;
 
 /**
  * Utility for manually running all integration tests.
  */
 main() {
-  initializeTestEnvironment();
-  group('search', () {
+  defineReflectiveSuite(() {
     get_type_hierarchy_test.main();
-  });
+  }, name: 'search');
 }
diff --git a/pkg/analysis_server/test/integration/server/get_version_test.dart b/pkg/analysis_server/test/integration/server/get_version_test.dart
index d1ba458..223957b 100644
--- a/pkg/analysis_server/test/integration/server/get_version_test.dart
+++ b/pkg/analysis_server/test/integration/server/get_version_test.dart
@@ -6,12 +6,12 @@
 
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(Test);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(Test);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/integration/server/set_subscriptions_invalid_service_test.dart b/pkg/analysis_server/test/integration/server/set_subscriptions_invalid_service_test.dart
index af778cf..2460ad9 100644
--- a/pkg/analysis_server/test/integration/server/set_subscriptions_invalid_service_test.dart
+++ b/pkg/analysis_server/test/integration/server/set_subscriptions_invalid_service_test.dart
@@ -4,15 +4,15 @@
 
 library test.integration.server.set.subscriptions.invalid.service;
 
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(Test);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(Test);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/integration/server/set_subscriptions_test.dart b/pkg/analysis_server/test/integration/server/set_subscriptions_test.dart
index e649594..b88618c 100644
--- a/pkg/analysis_server/test/integration/server/set_subscriptions_test.dart
+++ b/pkg/analysis_server/test/integration/server/set_subscriptions_test.dart
@@ -7,15 +7,15 @@
 import 'dart:async';
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(Test);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(Test);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/integration/server/shutdown_test.dart b/pkg/analysis_server/test/integration/server/shutdown_test.dart
index 7ba89c7..c919d4e 100644
--- a/pkg/analysis_server/test/integration/server/shutdown_test.dart
+++ b/pkg/analysis_server/test/integration/server/shutdown_test.dart
@@ -6,15 +6,15 @@
 
 import 'dart:async';
 
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(Test);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(Test);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/integration/server/status_test.dart b/pkg/analysis_server/test/integration/server/status_test.dart
index 340a4b5..9222934 100644
--- a/pkg/analysis_server/test/integration/server/status_test.dart
+++ b/pkg/analysis_server/test/integration/server/status_test.dart
@@ -7,15 +7,15 @@
 import 'dart:async';
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(Test);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(Test);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/integration/server/test_all.dart b/pkg/analysis_server/test/integration/server/test_all.dart
index 2b81672..b2a8af0 100644
--- a/pkg/analysis_server/test/integration/server/test_all.dart
+++ b/pkg/analysis_server/test/integration/server/test_all.dart
@@ -4,9 +4,8 @@
 
 library test.integration.server.all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
 import 'get_version_test.dart' as get_version_test;
 import 'set_subscriptions_invalid_service_test.dart'
     as set_subscriptions_invalid_service_test;
@@ -18,12 +17,11 @@
  * Utility for manually running all integration tests.
  */
 main() {
-  initializeTestEnvironment();
-  group('server', () {
+  defineReflectiveSuite(() {
     get_version_test.main();
     set_subscriptions_test.main();
     set_subscriptions_invalid_service_test.main();
     shutdown_test.main();
     status_test.main();
-  });
+  }, name: 'server');
 }
diff --git a/pkg/analysis_server/test/integration/test_all.dart b/pkg/analysis_server/test/integration/test_all.dart
index e217c92..3eda5bdf 100644
--- a/pkg/analysis_server/test/integration/test_all.dart
+++ b/pkg/analysis_server/test/integration/test_all.dart
@@ -4,9 +4,8 @@
 
 library test.integration.all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../utils.dart';
 import 'analysis/test_all.dart' as analysis_test_all;
 import 'completion/test_all.dart' as completion_test_all;
 import 'search/test_all.dart' as search_test_all;
@@ -16,11 +15,10 @@
  * Utility for manually running all integration tests.
  */
 main() {
-  initializeTestEnvironment();
-  group('analysis_server_integration', () {
+  defineReflectiveSuite(() {
     analysis_test_all.main();
     completion_test_all.main();
     search_test_all.main();
     server_test_all.main();
-  });
+  }, name: 'analysis_server_integration');
 }
diff --git a/pkg/analysis_server/test/mock_sdk.dart b/pkg/analysis_server/test/mock_sdk.dart
index 94d1208..acb2095 100644
--- a/pkg/analysis_server/test/mock_sdk.dart
+++ b/pkg/analysis_server/test/mock_sdk.dart
@@ -11,6 +11,7 @@
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/summary/idl.dart' show PackageBundle;
+import 'package:analyzer/src/summary/summary_file_builder.dart';
 
 class MockSdk implements DartSdk {
   static const MockSdkLibrary LIB_CORE = const MockSdkLibrary(
@@ -263,6 +264,11 @@
    */
   InternalAnalysisContext _analysisContext;
 
+  /**
+   * The cached linked bundle of the SDK.
+   */
+  PackageBundle _bundle;
+
   MockSdk({resource.ResourceProvider resourceProvider})
       : provider = resourceProvider ?? new resource.MemoryResourceProvider() {
     LIBRARIES.forEach((SdkLibrary library) {
@@ -333,7 +339,18 @@
   }
 
   @override
-  PackageBundle getLinkedBundle() => null;
+  PackageBundle getLinkedBundle() {
+    if (_bundle == null) {
+      List<Source> librarySources = sdkLibraries
+          .map((SdkLibrary library) => mapDartUri(library.shortName))
+          .toList();
+      List<int> bytes = new SummaryBuilder(
+              librarySources, context, context.analysisOptions.strongMode)
+          .build();
+      _bundle = new PackageBundle.fromBuffer(bytes);
+    }
+    return _bundle;
+  }
 
   @override
   SdkLibrary getSdkLibrary(String dartUri) {
@@ -397,4 +414,7 @@
   bool get isVmLibrary => throw unimplemented;
 
   UnimplementedError get unimplemented => new UnimplementedError();
+
+  @override
+  List<String> getPatches(int platform) => const <String>[];
 }
diff --git a/pkg/analysis_server/test/mocks.dart b/pkg/analysis_server/test/mocks.dart
index 3d719e3..fa683a3 100644
--- a/pkg/analysis_server/test/mocks.dart
+++ b/pkg/analysis_server/test/mocks.dart
@@ -20,8 +20,8 @@
 import 'package:analyzer/source/pub_package_map_provider.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:typed_mock/typed_mock.dart';
-import 'package:unittest/unittest.dart';
 
 /**
  * Answer the absolute path the SDK relative to the currently running
diff --git a/pkg/analysis_server/test/operation/operation_queue_test.dart b/pkg/analysis_server/test/operation/operation_queue_test.dart
index e6926c9..e2f8484 100644
--- a/pkg/analysis_server/test/operation/operation_queue_test.dart
+++ b/pkg/analysis_server/test/operation/operation_queue_test.dart
@@ -13,16 +13,16 @@
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:typed_mock/typed_mock.dart';
-import 'package:unittest/unittest.dart';
 
 import '../mocks.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ServerOperationQueueTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ServerOperationQueueTest);
+  });
 }
 
 /**
diff --git a/pkg/analysis_server/test/operation/operation_test.dart b/pkg/analysis_server/test/operation/operation_test.dart
index 1972129..5161c16 100644
--- a/pkg/analysis_server/test/operation/operation_test.dart
+++ b/pkg/analysis_server/test/operation/operation_test.dart
@@ -5,13 +5,9 @@
 library test.operation;
 
 import 'package:analysis_server/src/operation/operation.dart';
-import 'package:unittest/unittest.dart';
-
-import '../utils.dart';
+import 'package:test/test.dart';
 
 main() {
-  initializeTestEnvironment();
-
   group('ServerOperationPriority', () {
     test('toString', () {
       expect(ServerOperationPriority.ANALYSIS.toString(), 'ANALYSIS');
diff --git a/pkg/analysis_server/test/operation/test_all.dart b/pkg/analysis_server/test/operation/test_all.dart
index 4296f39..1b6f659 100644
--- a/pkg/analysis_server/test/operation/test_all.dart
+++ b/pkg/analysis_server/test/operation/test_all.dart
@@ -4,9 +4,8 @@
 
 library test.operation.all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../utils.dart';
 import 'operation_queue_test.dart' as operation_queue_test;
 import 'operation_test.dart' as operation_test;
 
@@ -14,9 +13,8 @@
  * Utility for manually running all tests.
  */
 main() {
-  initializeTestEnvironment();
-  group('operation', () {
+  defineReflectiveSuite(() {
     operation_queue_test.main();
     operation_test.main();
-  });
+  }, name: 'operation');
 }
diff --git a/pkg/analysis_server/test/plugin/protocol_dart_test.dart b/pkg/analysis_server/test/plugin/protocol_dart_test.dart
index ef2cd50..5f45220 100644
--- a/pkg/analysis_server/test/plugin/protocol_dart_test.dart
+++ b/pkg/analysis_server/test/plugin/protocol_dart_test.dart
@@ -15,16 +15,16 @@
 import 'package:analyzer/src/dart/element/element.dart' as engine;
 import 'package:analyzer/src/error/codes.dart' as engine;
 import 'package:analyzer/src/generated/source.dart' as engine;
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../abstract_context.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ElementTest);
-  defineReflectiveTests(ElementKindTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ElementTest);
+    defineReflectiveTests(ElementKindTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/plugin/set_analysis_domain_test.dart b/pkg/analysis_server/test/plugin/set_analysis_domain_test.dart
index 36e1522..dc5c356 100644
--- a/pkg/analysis_server/test/plugin/set_analysis_domain_test.dart
+++ b/pkg/analysis_server/test/plugin/set_analysis_domain_test.dart
@@ -17,15 +17,15 @@
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/task/dart.dart';
 import 'package:plugin/plugin.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(SetAnalysisDomainTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(SetAnalysisDomainTest);
+  });
 }
 
 /**
diff --git a/pkg/analysis_server/test/plugin/test_all.dart b/pkg/analysis_server/test/plugin/test_all.dart
index 5ad008b..385a8c7 100644
--- a/pkg/analysis_server/test/plugin/test_all.dart
+++ b/pkg/analysis_server/test/plugin/test_all.dart
@@ -3,9 +3,8 @@
 // BSD-style license that can be found in the LICENSE file.
 library test.plugin.analysis_contributor;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../utils.dart';
 import 'protocol_dart_test.dart' as protocol_dart_test;
 import 'set_analysis_domain_test.dart' as set_analysis_domain_test;
 
@@ -13,9 +12,8 @@
  * Utility for manually running all tests.
  */
 main() {
-  initializeTestEnvironment();
-  group('plugin', () {
+  defineReflectiveSuite(() {
     protocol_dart_test.main();
     set_analysis_domain_test.main();
-  });
+  }, name: 'plugin');
 }
diff --git a/pkg/analysis_server/test/protocol_server_test.dart b/pkg/analysis_server/test/protocol_server_test.dart
index bcbe18e..ba2b314 100644
--- a/pkg/analysis_server/test/protocol_server_test.dart
+++ b/pkg/analysis_server/test/protocol_server_test.dart
@@ -15,17 +15,17 @@
 import 'package:analyzer/error/error.dart' as engine;
 import 'package:analyzer/src/error/codes.dart' as engine;
 import 'package:analyzer/src/generated/source.dart' as engine;
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:typed_mock/typed_mock.dart';
-import 'package:unittest/unittest.dart';
 
 import 'mocks.dart';
-import 'utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AnalysisErrorTest);
-  defineReflectiveTests(EnumTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisErrorTest);
+    defineReflectiveTests(EnumTest);
+  });
 }
 
 class AnalysisErrorMock extends TypedMock implements engine.AnalysisError {}
diff --git a/pkg/analysis_server/test/protocol_test.dart b/pkg/analysis_server/test/protocol_test.dart
index 6428c62..ed3284a 100644
--- a/pkg/analysis_server/test/protocol_test.dart
+++ b/pkg/analysis_server/test/protocol_test.dart
@@ -9,17 +9,16 @@
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
 import 'package:analysis_server/src/protocol/protocol_internal.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
-
-import 'utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(NotificationTest);
-  defineReflectiveTests(RequestTest);
-  defineReflectiveTests(RequestErrorTest);
-  defineReflectiveTests(ResponseTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(NotificationTest);
+    defineReflectiveTests(RequestTest);
+    defineReflectiveTests(RequestErrorTest);
+    defineReflectiveTests(ResponseTest);
+  });
 }
 
 Matcher _throwsRequestFailure = throwsA(new isInstanceOf<RequestFailure>());
diff --git a/pkg/analysis_server/test/search/abstract_search_domain.dart b/pkg/analysis_server/test/search/abstract_search_domain.dart
index 9851d92..dbdacdf 100644
--- a/pkg/analysis_server/test/search/abstract_search_domain.dart
+++ b/pkg/analysis_server/test/search/abstract_search_domain.dart
@@ -11,7 +11,7 @@
 import 'package:analysis_server/src/search/search_domain.dart';
 import 'package:analysis_server/src/services/index/index.dart'
     show Index, createMemoryIndex;
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import '../analysis_abstract.dart';
 
@@ -78,6 +78,7 @@
 
   @override
   void processNotification(Notification notification) {
+    super.processNotification(notification);
     if (notification.event == SEARCH_RESULTS) {
       var params = new SearchResultsParams.fromNotification(notification);
       String id = params.id;
diff --git a/pkg/analysis_server/test/search/element_references_test.dart b/pkg/analysis_server/test/search/element_references_test.dart
index cdd7e13..3f0daba 100644
--- a/pkg/analysis_server/test/search/element_references_test.dart
+++ b/pkg/analysis_server/test/search/element_references_test.dart
@@ -8,16 +8,16 @@
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/services/index/index.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../utils.dart';
 import 'abstract_search_domain.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ElementReferencesTest);
-  defineReflectiveTests(_NoSearchEngine);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ElementReferencesTest);
+    defineReflectiveTests(_NoSearchEngine);
+  });
 }
 
 @reflectiveTest
@@ -29,7 +29,7 @@
     expect(result.isPotential, isPotential);
   }
 
-  Future findElementReferences(String search, bool includePotential) async {
+  Future<Null> findElementReferences(String search, bool includePotential) async {
     int offset = findOffset(search);
     await waitForTasksFinished();
     Request request = new SearchFindElementReferencesParams(
@@ -39,11 +39,10 @@
     var result = new SearchFindElementReferencesResult.fromResponse(response);
     searchId = result.id;
     searchElement = result.element;
-    if (searchId == null) {
-      return null;
-    } else {
-      return waitForSearchResults();
+    if (searchId != null) {
+      await waitForSearchResults();
     }
+    expect(serverErrors, isEmpty);
   }
 
   test_constructor_named() async {
@@ -153,8 +152,7 @@
 ''');
     await findElementReferences('fff; // declaration', false);
     expect(searchElement.kind, ElementKind.FIELD);
-    expect(results, hasLength(11));
-    assertHasResult(SearchResultKind.DECLARATION, 'fff; // declaration');
+    expect(results, hasLength(10));
     assertHasResult(SearchResultKind.WRITE, 'fff); // in constructor');
     assertHasResult(SearchResultKind.WRITE, 'fff = 1;');
     // m()
@@ -216,8 +214,7 @@
 ''');
     await findElementReferences('fff); // in constructor', false);
     expect(searchElement.kind, ElementKind.FIELD);
-    expect(results, hasLength(4));
-    assertHasResult(SearchResultKind.DECLARATION, 'fff; // declaration');
+    expect(results, hasLength(3));
     assertHasResult(SearchResultKind.WRITE, 'fff); // in constructor');
     assertHasResult(SearchResultKind.WRITE, 'fff = 2;');
     assertHasResult(SearchResultKind.READ, 'fff); // in m()');
@@ -257,9 +254,6 @@
   ''');
     await findElementReferences('fff; // in B', false);
     expect(searchElement.kind, ElementKind.FIELD);
-    assertHasResult(SearchResultKind.DECLARATION, 'fff; // in A');
-    assertHasResult(SearchResultKind.DECLARATION, 'fff; // in B');
-    assertHasResult(SearchResultKind.DECLARATION, 'fff; // in C');
     assertHasResult(SearchResultKind.WRITE, 'fff = 10;');
     assertHasResult(SearchResultKind.WRITE, 'fff = 20;');
     assertHasResult(SearchResultKind.WRITE, 'fff = 30;');
@@ -326,8 +320,7 @@
 ''');
     await findElementReferences('myLabel; // break', false);
     expect(searchElement.kind, ElementKind.LABEL);
-    expect(results, hasLength(3));
-    assertHasResult(SearchResultKind.DECLARATION, 'myLabel:');
+    expect(results, hasLength(2));
     assertHasResult(SearchResultKind.REFERENCE, 'myLabel; // continue');
     assertHasResult(SearchResultKind.REFERENCE, 'myLabel; // break');
   }
@@ -344,8 +337,7 @@
 ''');
     await findElementReferences('vvv = 1', false);
     expect(searchElement.kind, ElementKind.LOCAL_VARIABLE);
-    expect(results, hasLength(5));
-    assertHasResult(SearchResultKind.DECLARATION, 'vvv = 1');
+    expect(results, hasLength(4));
     assertHasResult(SearchResultKind.READ, 'vvv);');
     assertHasResult(SearchResultKind.READ_WRITE, 'vvv += 3');
     assertHasResult(SearchResultKind.WRITE, 'vvv = 2');
@@ -403,38 +395,6 @@
     expect(searchId, isNull);
   }
 
-  test_oneUnit_twoLibraries() async {
-    var pathA = '/project/bin/libA.dart';
-    var pathB = '/project/bin/libB.dart';
-    var codeA = '''
-library lib;
-part 'test.dart';
-main() {
-  fff(1);
-}
-''';
-    var codeB = '''
-library lib;
-part 'test.dart';
-main() {
-  fff(2);
-}
-''';
-    addFile(pathA, codeA);
-    addFile(pathB, codeB);
-    addTestFile('''
-part of lib;
-fff(p) {}
-''');
-    await findElementReferences('fff(p) {}', false);
-    expect(searchElement.kind, ElementKind.FUNCTION);
-    expect(results, hasLength(2));
-    findResult(
-        SearchResultKind.INVOCATION, pathA, codeA.indexOf('fff(1)'), 3, true);
-    findResult(
-        SearchResultKind.INVOCATION, pathB, codeB.indexOf('fff(2)'), 3, true);
-  }
-
   test_oneUnit_zeroLibraries() async {
     addTestFile('''
 part of lib;
@@ -458,8 +418,7 @@
 ''');
     await findElementReferences('ppp) {', false);
     expect(searchElement.kind, ElementKind.PARAMETER);
-    expect(results, hasLength(5));
-    assertHasResult(SearchResultKind.DECLARATION, 'ppp) {');
+    expect(results, hasLength(4));
     assertHasResult(SearchResultKind.READ, 'ppp);');
     assertHasResult(SearchResultKind.READ_WRITE, 'ppp += 3');
     assertHasResult(SearchResultKind.WRITE, 'ppp = 2');
@@ -626,8 +585,7 @@
     expect(searchElement.kind, ElementKind.PREFIX);
     expect(searchElement.name, 'ppp');
     expect(searchElement.location.startLine, 1);
-    expect(results, hasLength(3));
-    assertHasResult(SearchResultKind.DECLARATION, 'ppp;');
+    expect(results, hasLength(2));
     assertHasResult(SearchResultKind.REFERENCE, 'ppp.Future');
     assertHasResult(SearchResultKind.REFERENCE, 'ppp.Stream');
   }
@@ -644,8 +602,7 @@
 ''');
     await findElementReferences('vvv = 1', false);
     expect(searchElement.kind, ElementKind.TOP_LEVEL_VARIABLE);
-    expect(results, hasLength(5));
-    assertHasResult(SearchResultKind.DECLARATION, 'vvv = 1;');
+    expect(results, hasLength(4));
     assertHasResult(SearchResultKind.READ, 'vvv);');
     assertHasResult(SearchResultKind.WRITE, 'vvv += 3');
     assertHasResult(SearchResultKind.WRITE, 'vvv = 2');
diff --git a/pkg/analysis_server/test/search/member_declarations_test.dart b/pkg/analysis_server/test/search/member_declarations_test.dart
index 607e058..994f975 100644
--- a/pkg/analysis_server/test/search/member_declarations_test.dart
+++ b/pkg/analysis_server/test/search/member_declarations_test.dart
@@ -7,15 +7,15 @@
 import 'dart:async';
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../utils.dart';
 import 'abstract_search_domain.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(MemberDeclarationsTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(MemberDeclarationsTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/search/member_references_test.dart b/pkg/analysis_server/test/search/member_references_test.dart
index 23ea1c7..cdc953f 100644
--- a/pkg/analysis_server/test/search/member_references_test.dart
+++ b/pkg/analysis_server/test/search/member_references_test.dart
@@ -7,15 +7,15 @@
 import 'dart:async';
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../utils.dart';
 import 'abstract_search_domain.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(MemberReferencesTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(MemberReferencesTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/search/search_result_test.dart b/pkg/analysis_server/test/search/search_result_test.dart
index 2f3ef07..faa1dd1 100644
--- a/pkg/analysis_server/test/search/search_result_test.dart
+++ b/pkg/analysis_server/test/search/search_result_test.dart
@@ -6,14 +6,13 @@
 
 import 'package:analysis_server/src/protocol_server.dart';
 import 'package:analysis_server/src/services/search/search_engine.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
-
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(SearchResultKindTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(SearchResultKindTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/search/test_all.dart b/pkg/analysis_server/test/search/test_all.dart
index fc5de31..e385ca6 100644
--- a/pkg/analysis_server/test/search/test_all.dart
+++ b/pkg/analysis_server/test/search/test_all.dart
@@ -3,9 +3,8 @@
 // BSD-style license that can be found in the LICENSE file.
 library test.search;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../utils.dart';
 import 'element_references_test.dart' as element_references_test;
 import 'member_declarations_test.dart' as member_declarations;
 import 'member_references_test.dart' as member_references_test;
@@ -17,13 +16,12 @@
  * Utility for manually running all tests.
  */
 main() {
-  initializeTestEnvironment();
-  group('search', () {
+  defineReflectiveSuite(() {
     element_references_test.main();
     member_declarations.main();
     member_references_test.main();
     search_result_test.main();
     top_level_declarations_test.main();
     type_hierarchy_test.main();
-  });
+  }, name: 'search');
 }
diff --git a/pkg/analysis_server/test/search/top_level_declarations_test.dart b/pkg/analysis_server/test/search/top_level_declarations_test.dart
index 8b1829c..16be988 100644
--- a/pkg/analysis_server/test/search/top_level_declarations_test.dart
+++ b/pkg/analysis_server/test/search/top_level_declarations_test.dart
@@ -7,15 +7,15 @@
 import 'dart:async';
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../utils.dart';
 import 'abstract_search_domain.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(TopLevelDeclarationsTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(TopLevelDeclarationsTest);
+  });
 }
 
 @reflectiveTest
@@ -57,6 +57,11 @@
     return null;
   }
 
+  test_invalidRegex() async {
+    var result = await findTopLevelDeclarations('[A');
+    expect(result, new isInstanceOf<RequestError>());
+  }
+
   test_startEndPattern() async {
     addTestFile('''
 class A {} // A
@@ -74,9 +79,4 @@
     assertHasDeclaration(ElementKind.TOP_LEVEL_VARIABLE, 'E');
     assertNoDeclaration(ElementKind.CLASS, 'ABC');
   }
-
-  test_invalidRegex() async {
-    var result = await findTopLevelDeclarations('[A');
-    expect(result, new isInstanceOf<RequestError>());
-  }
 }
diff --git a/pkg/analysis_server/test/search/type_hierarchy_test.dart b/pkg/analysis_server/test/search/type_hierarchy_test.dart
index c3efbbf..62402c8 100644
--- a/pkg/analysis_server/test/search/type_hierarchy_test.dart
+++ b/pkg/analysis_server/test/search/type_hierarchy_test.dart
@@ -9,15 +9,15 @@
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/search/search_domain.dart';
 import 'package:analysis_server/src/services/index/index.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(GetTypeHierarchyTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(GetTypeHierarchyTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/server_options_test.dart b/pkg/analysis_server/test/server_options_test.dart
index 4a32152..8561a23 100644
--- a/pkg/analysis_server/test/server_options_test.dart
+++ b/pkg/analysis_server/test/server_options_test.dart
@@ -8,18 +8,14 @@
 library analysis_server.test.server_options;
 
 import 'package:analysis_server/src/server_options.dart';
-import 'package:unittest/unittest.dart';
-
-import 'utils.dart';
+import 'package:test/test.dart';
 
 void main() {
-  initializeTestEnvironment();
-
   group('server_options', () {
     test('basic - []', () {
       var options = new ServerOptions.fromContents('''# ignored
 foo: bar
-baz: padded   
+baz: ${"padded   "}
 ''');
       expect(options['foo'], equals('bar'));
       expect(options['baz'], equals('padded'));
diff --git a/pkg/analysis_server/test/services/completion/completion_target_test.dart b/pkg/analysis_server/test/services/completion/completion_target_test.dart
index ce02343..e796abb 100644
--- a/pkg/analysis_server/test/services/completion/completion_target_test.dart
+++ b/pkg/analysis_server/test/services/completion/completion_target_test.dart
@@ -7,15 +7,15 @@
 import 'package:analysis_server/src/provisional/completion/dart/completion_target.dart';
 import 'package:analyzer/dart/ast/ast.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../abstract_context.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(CompletionTargetTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(CompletionTargetTest);
+  });
 }
 
 @reflectiveTest
@@ -45,6 +45,7 @@
           reason: 'containingNode');
       expect(target.argIndex, argIndex, reason: 'argIndex');
     }
+
     // Assert with parsed unit
     assertCommon();
     CompilationUnit unit =
diff --git a/pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart
index 44ddc2a..78a6f4e 100644
--- a/pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart
@@ -7,15 +7,15 @@
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
 import 'package:analysis_server/src/services/completion/dart/arglist_contributor.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../../utils.dart';
 import 'completion_contributor_util.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ArgListContributorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ArgListContributorTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/completion/dart/combinator_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/combinator_contributor_test.dart
index 90856f7..7b4774c 100644
--- a/pkg/analysis_server/test/services/completion/dart/combinator_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/combinator_contributor_test.dart
@@ -10,12 +10,12 @@
 import 'package:analyzer/src/generated/source.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../../utils.dart';
 import 'completion_contributor_util.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(CombinatorContributorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(CombinatorContributorTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/completion/dart/common_usage_sorter_test.dart b/pkg/analysis_server/test/services/completion/dart/common_usage_sorter_test.dart
index 498b3d1..8b5b681 100644
--- a/pkg/analysis_server/test/services/completion/dart/common_usage_sorter_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/common_usage_sorter_test.dart
@@ -10,15 +10,15 @@
 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
 import 'package:analysis_server/src/services/completion/dart/common_usage_sorter.dart';
 import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../../domain_completion_util.dart';
-import '../../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(CommonUsageSorterTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(CommonUsageSorterTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart b/pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart
index 0bf8a6d..1a5fac8 100644
--- a/pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart
+++ b/pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart
@@ -20,7 +20,7 @@
 import 'package:analysis_server/src/services/search/search_engine_internal.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/task/dart.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import '../../../abstract_context.dart';
 
@@ -454,6 +454,7 @@
   Future computeSuggestions([int times = 200]) async {
     context.analysisPriorityOrder = [testSource];
     CompletionRequestImpl baseRequest = new CompletionRequestImpl(
+        null,
         context,
         provider,
         searchEngine,
diff --git a/pkg/analysis_server/test/services/completion/dart/completion_manager_test.dart b/pkg/analysis_server/test/services/completion/dart/completion_manager_test.dart
index b678bd1..67e691a 100644
--- a/pkg/analysis_server/test/services/completion/dart/completion_manager_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/completion_manager_test.dart
@@ -13,15 +13,15 @@
 import 'package:analysis_server/src/services/completion/dart/imported_reference_contributor.dart';
 import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer/src/task/dart.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../../utils.dart';
 import 'completion_contributor_util.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(CompletionManagerTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(CompletionManagerTest);
+  });
 }
 
 @reflectiveTest
@@ -56,6 +56,7 @@
 
     // Build the request
     CompletionRequestImpl baseRequest = new CompletionRequestImpl(
+        null,
         context,
         provider,
         searchEngine,
@@ -91,6 +92,7 @@
         fail('Failed to find $expectedUri in $importedNames');
       });
     }
+
     void assertImportedLib(String expectedUri) {
       ImportElement importElem = importNamed(expectedUri);
       expect(importElem.importedLibrary.exportNamespace, isNotNull);
diff --git a/pkg/analysis_server/test/services/completion/dart/field_formal_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/field_formal_contributor_test.dart
index cc4d6f8..18da62c 100644
--- a/pkg/analysis_server/test/services/completion/dart/field_formal_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/field_formal_contributor_test.dart
@@ -6,15 +6,15 @@
 
 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
 import 'package:analysis_server/src/services/completion/dart/field_formal_contributor.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../../utils.dart';
 import 'completion_contributor_util.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(FieldFormalContributorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(FieldFormalContributorTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/completion/dart/imported_reference_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/imported_reference_contributor_test.dart
index 84b1781..7d3acd8 100644
--- a/pkg/analysis_server/test/services/completion/dart/imported_reference_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/imported_reference_contributor_test.dart
@@ -12,16 +12,16 @@
 import 'package:analyzer/dart/ast/ast.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../../abstract_context.dart';
-import '../../../utils.dart';
 import 'completion_contributor_util.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ImportedReferenceContributorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ImportedReferenceContributorTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/completion/dart/inherited_reference_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/inherited_reference_contributor_test.dart
index 568d796..afed832 100644
--- a/pkg/analysis_server/test/services/completion/dart/inherited_reference_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/inherited_reference_contributor_test.dart
@@ -7,15 +7,15 @@
 import 'package:analysis_server/src/protocol_server.dart';
 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
 import 'package:analysis_server/src/services/completion/dart/inherited_reference_contributor.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../../utils.dart';
 import 'completion_contributor_util.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(InheritedContributorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(InheritedContributorTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/completion/dart/keyword_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/keyword_contributor_test.dart
index 2081aab..1667140 100644
--- a/pkg/analysis_server/test/services/completion/dart/keyword_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/keyword_contributor_test.dart
@@ -8,15 +8,15 @@
 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
 import 'package:analysis_server/src/services/completion/dart/keyword_contributor.dart';
 import 'package:analyzer/dart/ast/token.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../../utils.dart';
 import 'completion_contributor_util.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(KeywordContributorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(KeywordContributorTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/completion/dart/label_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/label_contributor_test.dart
index 850389c..3968e24 100644
--- a/pkg/analysis_server/test/services/completion/dart/label_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/label_contributor_test.dart
@@ -11,15 +11,15 @@
 import 'package:analysis_server/src/protocol_server.dart';
 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
 import 'package:analysis_server/src/services/completion/dart/label_contributor.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../../utils.dart';
 import 'completion_contributor_util.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(LabelContributorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(LabelContributorTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/completion/dart/library_member_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/library_member_contributor_test.dart
index ddb0211..be8318e 100644
--- a/pkg/analysis_server/test/services/completion/dart/library_member_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/library_member_contributor_test.dart
@@ -6,15 +6,15 @@
 
 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
 import 'package:analysis_server/src/services/completion/dart/library_member_contributor.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../../utils.dart';
 import 'completion_contributor_util.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(LibraryMemberContributorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(LibraryMemberContributorTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/completion/dart/library_prefix_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/library_prefix_contributor_test.dart
index 2de1f23..45d26da 100644
--- a/pkg/analysis_server/test/services/completion/dart/library_prefix_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/library_prefix_contributor_test.dart
@@ -7,15 +7,15 @@
 import 'package:analysis_server/src/protocol_server.dart';
 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
 import 'package:analysis_server/src/services/completion/dart/library_prefix_contributor.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../../utils.dart';
 import 'completion_contributor_util.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(LibraryPrefixContributorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(LibraryPrefixContributorTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/completion/dart/local_constructor_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/local_constructor_contributor_test.dart
index 0d1b13d..4977151 100644
--- a/pkg/analysis_server/test/services/completion/dart/local_constructor_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/local_constructor_contributor_test.dart
@@ -11,15 +11,15 @@
 import 'package:analysis_server/src/protocol_server.dart';
 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
 import 'package:analysis_server/src/services/completion/dart/local_constructor_contributor.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../../utils.dart';
 import 'completion_contributor_util.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(LocalConstructorContributorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(LocalConstructorContributorTest);
+  });
 }
 
 @reflectiveTest
@@ -2404,6 +2404,44 @@
     expect(suggestion.hasNamedParameters, true);
   }
 
+  test_InstanceCreationExpression_assignment_expression_filter() async {
+    addTestSource('''
+class A {} class B extends A {} class C implements A {} class D {}
+main() {
+  A a;
+  a = new ^
+}''');
+    await computeSuggestions();
+
+    assertSuggestConstructor('A',
+        elemOffset: -1,
+        relevance: DART_RELEVANCE_DEFAULT + DART_RELEVANCE_INCREMENT);
+    assertSuggestConstructor('B',
+        elemOffset: -1, relevance: DART_RELEVANCE_DEFAULT);
+    assertSuggestConstructor('C',
+        elemOffset: -1, relevance: DART_RELEVANCE_DEFAULT);
+    assertNotSuggested('D');
+  }
+
+  test_InstanceCreationExpression_assignment_expression_filter2() async {
+    addTestSource('''
+class A {} class B extends A {} class C implements A {} class D {}
+main() {
+  A a;
+  a = new ^;
+}''');
+    await computeSuggestions();
+
+    assertSuggestConstructor('A',
+        elemOffset: -1,
+        relevance: DART_RELEVANCE_DEFAULT + DART_RELEVANCE_INCREMENT);
+    assertSuggestConstructor('B',
+        elemOffset: -1, relevance: DART_RELEVANCE_DEFAULT);
+    assertSuggestConstructor('C',
+        elemOffset: -1, relevance: DART_RELEVANCE_DEFAULT);
+    assertNotSuggested('D');
+  }
+
   test_InstanceCreationExpression_imported() async {
     // SimpleIdentifier  TypeName  ConstructorName  InstanceCreationExpression
     addSource(
@@ -2485,44 +2523,6 @@
     assertNotSuggested('D');
   }
 
-  test_InstanceCreationExpression_assignment_expression_filter() async {
-    addTestSource('''
-class A {} class B extends A {} class C implements A {} class D {}
-main() {
-  A a;
-  a = new ^
-}''');
-    await computeSuggestions();
-
-    assertSuggestConstructor('A',
-        elemOffset: -1,
-        relevance: DART_RELEVANCE_DEFAULT + DART_RELEVANCE_INCREMENT);
-    assertSuggestConstructor('B',
-        elemOffset: -1, relevance: DART_RELEVANCE_DEFAULT);
-    assertSuggestConstructor('C',
-        elemOffset: -1, relevance: DART_RELEVANCE_DEFAULT);
-    assertNotSuggested('D');
-  }
-
-  test_InstanceCreationExpression_assignment_expression_filter2() async {
-    addTestSource('''
-class A {} class B extends A {} class C implements A {} class D {}
-main() {
-  A a;
-  a = new ^;
-}''');
-    await computeSuggestions();
-
-    assertSuggestConstructor('A',
-        elemOffset: -1,
-        relevance: DART_RELEVANCE_DEFAULT + DART_RELEVANCE_INCREMENT);
-    assertSuggestConstructor('B',
-        elemOffset: -1, relevance: DART_RELEVANCE_DEFAULT);
-    assertSuggestConstructor('C',
-        elemOffset: -1, relevance: DART_RELEVANCE_DEFAULT);
-    assertNotSuggested('D');
-  }
-
   test_InterpolationExpression() async {
     // SimpleIdentifier  InterpolationExpression  StringInterpolation
     addSource(
diff --git a/pkg/analysis_server/test/services/completion/dart/local_declaration_visitor_test.dart b/pkg/analysis_server/test/services/completion/dart/local_declaration_visitor_test.dart
index eff6ab6..fe3456d 100644
--- a/pkg/analysis_server/test/services/completion/dart/local_declaration_visitor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/local_declaration_visitor_test.dart
@@ -11,14 +11,13 @@
 import 'package:analyzer/src/dart/scanner/reader.dart';
 import 'package:analyzer/src/dart/scanner/scanner.dart';
 import 'package:analyzer/src/generated/parser.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
-
-import '../../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(LocalDeclarationVisitorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(LocalDeclarationVisitorTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/completion/dart/local_library_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/local_library_contributor_test.dart
index 7851d49..b5758fd 100644
--- a/pkg/analysis_server/test/services/completion/dart/local_library_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/local_library_contributor_test.dart
@@ -6,15 +6,15 @@
 
 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
 import 'package:analysis_server/src/services/completion/dart/local_library_contributor.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../../utils.dart';
 import 'completion_contributor_util.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(LocalLibraryContributorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(LocalLibraryContributorTest);
+  });
 }
 
 @reflectiveTest
@@ -102,7 +102,7 @@
     assertNotSuggested('m');
   }
 
-  test_partFile_InstanceCreationExpression_variable_declaration_filter() async {
+  test_partFile_InstanceCreationExpression_assignment_filter() async {
     // ConstructorName  InstanceCreationExpression  VariableDeclarationList
     addSource(
         '/testB.dart',
@@ -123,7 +123,9 @@
         part "/testA.dart";
         class Local { }
         main() {
-          A a = new ^
+          A a;
+          // FAIL:
+          a = new ^
         }
         var m;''');
     await computeLibrariesContaining();
@@ -155,7 +157,7 @@
     assertNotSuggested('m');
   }
 
-  test_partFile_InstanceCreationExpression_assignment_filter() async {
+  test_partFile_InstanceCreationExpression_variable_declaration_filter() async {
     // ConstructorName  InstanceCreationExpression  VariableDeclarationList
     addSource(
         '/testB.dart',
@@ -176,9 +178,7 @@
         part "/testA.dart";
         class Local { }
         main() {
-          A a;
-          // FAIL:
-          a = new ^
+          A a = new ^
         }
         var m;''');
     await computeLibrariesContaining();
diff --git a/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart
index 004e262..7e1cb94 100644
--- a/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart
@@ -11,15 +11,15 @@
 import 'package:analysis_server/src/protocol_server.dart';
 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
 import 'package:analysis_server/src/services/completion/dart/local_reference_contributor.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../../utils.dart';
 import 'completion_contributor_util.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(LocalReferenceContributorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(LocalReferenceContributorTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/completion/dart/named_constructor_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/named_constructor_contributor_test.dart
index b633efd..fd14593 100644
--- a/pkg/analysis_server/test/services/completion/dart/named_constructor_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/named_constructor_contributor_test.dart
@@ -8,15 +8,15 @@
 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
 import 'package:analysis_server/src/services/completion/dart/named_constructor_contributor.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../../utils.dart';
 import 'completion_contributor_util.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(NamedConstructorContributorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(NamedConstructorContributorTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/completion/dart/optype_test.dart b/pkg/analysis_server/test/services/completion/dart/optype_test.dart
index 2fe206b..f285173 100644
--- a/pkg/analysis_server/test/services/completion/dart/optype_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/optype_test.dart
@@ -11,15 +11,15 @@
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:plugin/manager.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../../abstract_context.dart';
-import '../../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(OpTypeTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(OpTypeTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/completion/dart/override_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/override_contributor_test.dart
index e219259..aa8fe6f 100644
--- a/pkg/analysis_server/test/services/completion/dart/override_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/override_contributor_test.dart
@@ -9,7 +9,7 @@
 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
 import 'package:analysis_server/src/services/completion/dart/override_contributor.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import 'completion_contributor_util.dart';
 
diff --git a/pkg/analysis_server/test/services/completion/dart/static_member_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/static_member_contributor_test.dart
index 878fbdb7..342dcc3 100644
--- a/pkg/analysis_server/test/services/completion/dart/static_member_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/static_member_contributor_test.dart
@@ -6,15 +6,15 @@
 
 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
 import 'package:analysis_server/src/services/completion/dart/static_member_contributor.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../../utils.dart';
 import 'completion_contributor_util.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(StaticMemberContributorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(StaticMemberContributorTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/completion/dart/test_all.dart b/pkg/analysis_server/test/services/completion/dart/test_all.dart
index e9fb6c5..8fa0c51 100644
--- a/pkg/analysis_server/test/services/completion/dart/test_all.dart
+++ b/pkg/analysis_server/test/services/completion/dart/test_all.dart
@@ -4,9 +4,8 @@
 
 library test.services.completion.dart;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../../utils.dart';
 import 'arglist_contributor_test.dart' as arglist_test;
 import 'combinator_contributor_test.dart' as combinator_test;
 import 'common_usage_sorter_test.dart' as common_usage_test;
@@ -32,8 +31,7 @@
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('dart/completion', () {
+  defineReflectiveSuite(() {
     arglist_test.main();
     combinator_test.main();
     common_usage_test.main();
@@ -56,5 +54,5 @@
     type_member_contributor_test.main();
     uri_contributor_test.main();
     variable_name_contributor_test.main();
-  });
+  }, name: 'dart');
 }
diff --git a/pkg/analysis_server/test/services/completion/dart/type_member_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/type_member_contributor_test.dart
index b3dfba3..1915011 100644
--- a/pkg/analysis_server/test/services/completion/dart/type_member_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/type_member_contributor_test.dart
@@ -9,15 +9,15 @@
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
 import 'package:analysis_server/src/services/completion/dart/type_member_contributor.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../../utils.dart';
 import 'completion_contributor_util.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(TypeMemberContributorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(TypeMemberContributorTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/completion/dart/uri_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/uri_contributor_test.dart
index 99cfd29..705b0e3 100644
--- a/pkg/analysis_server/test/services/completion/dart/uri_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/uri_contributor_test.dart
@@ -9,16 +9,16 @@
 import 'package:analysis_server/src/services/completion/dart/uri_contributor.dart';
 import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:path/path.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../../utils.dart';
 import 'completion_contributor_util.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(UriContributorTest);
-  defineReflectiveTests(UriContributorWindowsTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(UriContributorTest);
+    defineReflectiveTests(UriContributorWindowsTest);
+  });
 }
 
 @reflectiveTest
@@ -267,6 +267,16 @@
         csKind: CompletionSuggestionKind.IMPORT);
   }
 
+  test_import_package2_raw() async {
+    addPackageSource('foo', 'foo.dart', 'library foo;');
+    addPackageSource('foo', 'baz/too.dart', 'library too;');
+    addPackageSource('bar', 'bar.dart', 'library bar;');
+    addTestSource('import r"package:foo/baz/^" import');
+    await computeSuggestions();
+    assertSuggest('package:foo/baz/too.dart',
+        csKind: CompletionSuggestionKind.IMPORT);
+  }
+
   test_import_package2_with_trailing() async {
     addPackageSource('foo', 'foo.dart', 'library foo;');
     addPackageSource('foo', 'baz/too.dart', 'library too;');
@@ -279,16 +289,6 @@
     expect(replacementLength, 5 + 16);
   }
 
-  test_import_package2_raw() async {
-    addPackageSource('foo', 'foo.dart', 'library foo;');
-    addPackageSource('foo', 'baz/too.dart', 'library too;');
-    addPackageSource('bar', 'bar.dart', 'library bar;');
-    addTestSource('import r"package:foo/baz/^" import');
-    await computeSuggestions();
-    assertSuggest('package:foo/baz/too.dart',
-        csKind: CompletionSuggestionKind.IMPORT);
-  }
-
   test_import_package_missing_lib() async {
     var pkgSrc = addPackageSource('bar', 'bar.dart', 'library bar;');
     provider.deleteFolder(dirname(pkgSrc.fullName));
diff --git a/pkg/analysis_server/test/services/completion/dart/variable_name_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/variable_name_contributor_test.dart
index 6896850..a5c4446 100644
--- a/pkg/analysis_server/test/services/completion/dart/variable_name_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/variable_name_contributor_test.dart
@@ -6,15 +6,15 @@
 
 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
 import 'package:analysis_server/src/services/completion/dart/variable_name_contributor.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../../utils.dart';
 import 'completion_contributor_util.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(VariableNameContributorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(VariableNameContributorTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/completion/test_all.dart b/pkg/analysis_server/test/services/completion/test_all.dart
index f219dda..fed3fef 100644
--- a/pkg/analysis_server/test/services/completion/test_all.dart
+++ b/pkg/analysis_server/test/services/completion/test_all.dart
@@ -4,17 +4,15 @@
 
 library test.services.completion;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
 import 'completion_target_test.dart' as completion_target_test;
 import 'dart/test_all.dart' as dart_contributor_tests;
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('completion', () {
+  defineReflectiveSuite(() {
     completion_target_test.main();
     dart_contributor_tests.main();
-  });
+  }, name: 'completion');
 }
diff --git a/pkg/analysis_server/test/services/correction/assist_test.dart b/pkg/analysis_server/test/services/correction/assist_test.dart
index 4188664..a2abeee 100644
--- a/pkg/analysis_server/test/services/correction/assist_test.dart
+++ b/pkg/analysis_server/test/services/correction/assist_test.dart
@@ -14,15 +14,15 @@
 import 'package:analyzer/src/generated/source.dart';
 import 'package:plugin/manager.dart';
 import 'package:plugin/plugin.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../abstract_single_unit.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AssistProcessorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AssistProcessorTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/correction/change_test.dart b/pkg/analysis_server/test/services/correction/change_test.dart
index 0cc92b4..67b7d51 100644
--- a/pkg/analysis_server/test/services/correction/change_test.dart
+++ b/pkg/analysis_server/test/services/correction/change_test.dart
@@ -7,19 +7,18 @@
 import 'package:analysis_server/src/constants.dart';
 import 'package:analysis_server/src/protocol_server.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
-
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ChangeTest);
-  defineReflectiveTests(EditTest);
-  defineReflectiveTests(FileEditTest);
-  defineReflectiveTests(LinkedEditGroupTest);
-  defineReflectiveTests(LinkedEditSuggestionTest);
-  defineReflectiveTests(PositionTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ChangeTest);
+    defineReflectiveTests(EditTest);
+    defineReflectiveTests(FileEditTest);
+    defineReflectiveTests(LinkedEditGroupTest);
+    defineReflectiveTests(LinkedEditSuggestionTest);
+    defineReflectiveTests(PositionTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/correction/fix_test.dart b/pkg/analysis_server/test/services/correction/fix_test.dart
index c7ed0bb..dc65a97 100644
--- a/pkg/analysis_server/test/services/correction/fix_test.dart
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart
@@ -18,17 +18,17 @@
 import 'package:analyzer/src/error/codes.dart';
 import 'package:analyzer/src/generated/parser.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../abstract_context.dart';
 import '../../abstract_single_unit.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(FixProcessorTest);
-  defineReflectiveTests(LintFixTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(FixProcessorTest);
+    defineReflectiveTests(LintFixTest);
+  });
 }
 
 typedef bool AnalysisErrorFilter(AnalysisError error);
@@ -474,14 +474,14 @@
     // No fix for ";".
     {
       AnalysisError error = errors[0];
-      expect(error.message, "Expected to find ';'");
+      expect(error.message, "Expected to find ';'.");
       List<Fix> fixes = await _computeFixes(error);
       expect(fixes, isEmpty);
     }
     // Has fix for "await".
     {
       AnalysisError error = errors[1];
-      expect(error.message, startsWith("Undefined name 'await';"));
+      expect(error.message, startsWith("Undefined name 'await'."));
       List<Fix> fixes = await _computeFixes(error);
       // has exactly one fix
       expect(fixes, hasLength(1));
@@ -5273,10 +5273,10 @@
     resultCode = SourceEdit.applySequence(testCode, change.edits[0].edits);
   }
 
-  void findLint(String src, String lintCode) {
+  void findLint(String src, String lintCode, {int length: 1}) {
     int errorOffset = src.indexOf('/*LINT*/');
     resolveTestUnit(src.replaceAll('/*LINT*/', ''));
-    error = new AnalysisError(testUnit.element.source, errorOffset, 1,
+    error = new AnalysisError(testUnit.element.source, errorOffset, length,
         new LintCode(lintCode, '<ignored>'));
   }
 
@@ -5462,6 +5462,23 @@
 ''');
   }
 
+  test_lint_removeInterpolationBraces() async {
+    String src = r'''
+main() {
+  var v = 42;
+  print('v: /*LINT*/${ v}');
+}
+''';
+    findLint(src, LintNames.unnecessary_brace_in_string_interp, length: 4);
+    await applyFix(DartFixKind.LINT_REMOVE_INTERPOLATION_BRACES);
+    verifyResult(r'''
+main() {
+  var v = 42;
+  print('v: $v');
+}
+''');
+  }
+
   void verifyResult(String expectedResult) {
     expect(resultCode, expectedResult);
   }
diff --git a/pkg/analysis_server/test/services/correction/levenshtein_test.dart b/pkg/analysis_server/test/services/correction/levenshtein_test.dart
index a1b0a92..956199a 100644
--- a/pkg/analysis_server/test/services/correction/levenshtein_test.dart
+++ b/pkg/analysis_server/test/services/correction/levenshtein_test.dart
@@ -5,14 +5,13 @@
 library test.services.correction.levenshtein;
 
 import 'package:analysis_server/src/services/correction/levenshtein.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
-
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(LevenshteinTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(LevenshteinTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/correction/name_suggestion_test.dart b/pkg/analysis_server/test/services/correction/name_suggestion_test.dart
index 76b7409..fdd914e 100644
--- a/pkg/analysis_server/test/services/correction/name_suggestion_test.dart
+++ b/pkg/analysis_server/test/services/correction/name_suggestion_test.dart
@@ -8,15 +8,15 @@
 import 'package:analyzer/dart/ast/ast.dart';
 import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer/dart/element/type.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../abstract_single_unit.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(VariableNameSuggestionTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(VariableNameSuggestionTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/correction/organize_directives_test.dart b/pkg/analysis_server/test/services/correction/organize_directives_test.dart
index dc03bce..503ad05 100644
--- a/pkg/analysis_server/test/services/correction/organize_directives_test.dart
+++ b/pkg/analysis_server/test/services/correction/organize_directives_test.dart
@@ -8,15 +8,15 @@
     hide AnalysisError;
 import 'package:analysis_server/src/services/correction/organize_directives.dart';
 import 'package:analyzer/error/error.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../abstract_single_unit.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(OrganizeDirectivesTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(OrganizeDirectivesTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/correction/sort_members_test.dart b/pkg/analysis_server/test/services/correction/sort_members_test.dart
index d3f6950..b60164f 100644
--- a/pkg/analysis_server/test/services/correction/sort_members_test.dart
+++ b/pkg/analysis_server/test/services/correction/sort_members_test.dart
@@ -6,15 +6,15 @@
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/services/correction/sort_members.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../abstract_single_unit.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(SortMembersTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(SortMembersTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/correction/source_range_test.dart b/pkg/analysis_server/test/services/correction/source_range_test.dart
index 6824519..28779ac 100644
--- a/pkg/analysis_server/test/services/correction/source_range_test.dart
+++ b/pkg/analysis_server/test/services/correction/source_range_test.dart
@@ -10,15 +10,15 @@
 import 'package:analyzer/error/error.dart';
 import 'package:analyzer/src/generated/parser.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../abstract_single_unit.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(SourceRangesTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(SourceRangesTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/correction/status_test.dart b/pkg/analysis_server/test/services/correction/status_test.dart
index 0de1517..9c9169e 100644
--- a/pkg/analysis_server/test/services/correction/status_test.dart
+++ b/pkg/analysis_server/test/services/correction/status_test.dart
@@ -8,19 +8,20 @@
 import 'package:analysis_server/src/services/correction/source_range.dart';
 import 'package:analysis_server/src/services/correction/status.dart';
 import 'package:analysis_server/src/services/search/search_engine.dart';
+import 'package:analysis_server/src/services/search/search_engine_internal.dart';
 import 'package:analyzer/dart/ast/ast.dart';
 import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../abstract_single_unit.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(RefactoringLocationTest);
-  defineReflectiveTests(RefactoringStatusTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(RefactoringLocationTest);
+    defineReflectiveTests(RefactoringStatusTest);
+  });
 }
 
 @reflectiveTest
@@ -41,7 +42,7 @@
     resolveTestUnit('class MyClass {}');
     Element element = findElement('MyClass');
     SourceRange range = rangeElementName(element);
-    SearchMatch match = new SearchMatch(
+    SearchMatch match = new SearchMatchImpl(
         context,
         element.library.source.uri.toString(),
         element.source.uri.toString(),
diff --git a/pkg/analysis_server/test/services/correction/strings_test.dart b/pkg/analysis_server/test/services/correction/strings_test.dart
index a5b4779..3f44c7c 100644
--- a/pkg/analysis_server/test/services/correction/strings_test.dart
+++ b/pkg/analysis_server/test/services/correction/strings_test.dart
@@ -5,14 +5,13 @@
 library test.services.correction.strings;
 
 import 'package:analysis_server/src/services/correction/strings.dart';
+import 'package:test/test.dart' hide isEmpty;
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart' hide isEmpty;
-
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(StringsTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(StringsTest);
+  });
 }
 
 @reflectiveTest
@@ -43,6 +42,7 @@
           oldStr.substring(diff.offset + diff.length);
       expect(applied, newStr);
     }
+
     assertDiff('', '');
     assertDiff('', 'a');
     assertDiff('abc', '');
diff --git a/pkg/analysis_server/test/services/correction/test_all.dart b/pkg/analysis_server/test/services/correction/test_all.dart
index f00f310..09eee7b 100644
--- a/pkg/analysis_server/test/services/correction/test_all.dart
+++ b/pkg/analysis_server/test/services/correction/test_all.dart
@@ -4,9 +4,8 @@
 
 library test.services.correction;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
 import 'assist_test.dart' as assist_test;
 import 'change_test.dart' as change_test;
 import 'fix_test.dart' as fix_test;
@@ -21,8 +20,7 @@
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('correction', () {
+  defineReflectiveSuite(() {
     assist_test.main();
     change_test.main();
     fix_test.main();
@@ -34,5 +32,5 @@
     status_test.main();
     strings_test.main();
     util_test.main();
-  });
+  }, name: 'correction');
 }
diff --git a/pkg/analysis_server/test/services/correction/util_test.dart b/pkg/analysis_server/test/services/correction/util_test.dart
index a435b1c..2eb68bb 100644
--- a/pkg/analysis_server/test/services/correction/util_test.dart
+++ b/pkg/analysis_server/test/services/correction/util_test.dart
@@ -9,15 +9,15 @@
 import 'package:analysis_server/src/services/correction/util.dart';
 import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../abstract_single_unit.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(UtilTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(UtilTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/dependencies/library_dependencies_test.dart b/pkg/analysis_server/test/services/dependencies/library_dependencies_test.dart
index 2c1b7b9..5a58a4e 100644
--- a/pkg/analysis_server/test/services/dependencies/library_dependencies_test.dart
+++ b/pkg/analysis_server/test/services/dependencies/library_dependencies_test.dart
@@ -5,15 +5,15 @@
 library test.services.dependencies.library;
 
 import 'package:analysis_server/src/services/dependencies/library_dependencies.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../abstract_context.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(LibraryDependenciesTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(LibraryDependenciesTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/dependencies/reachable_source_collector_test.dart b/pkg/analysis_server/test/services/dependencies/reachable_source_collector_test.dart
index 89369cd..23eaf32 100644
--- a/pkg/analysis_server/test/services/dependencies/reachable_source_collector_test.dart
+++ b/pkg/analysis_server/test/services/dependencies/reachable_source_collector_test.dart
@@ -7,15 +7,15 @@
 import 'package:analysis_server/src/services/dependencies/reachable_source_collector.dart';
 import 'package:analyzer/dart/ast/ast.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../abstract_context.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ReachableSourceCollectorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ReachableSourceCollectorTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/dependencies/test_all.dart b/pkg/analysis_server/test/services/dependencies/test_all.dart
index b26ac82..fe5c16f 100644
--- a/pkg/analysis_server/test/services/dependencies/test_all.dart
+++ b/pkg/analysis_server/test/services/dependencies/test_all.dart
@@ -4,17 +4,15 @@
 
 library test.services.dependencies;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
 import 'library_dependencies_test.dart' as library_dependencies;
 import 'reachable_source_collector_test.dart' as reachable_source_collector;
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('dependencies', () {
+  defineReflectiveSuite(() {
     library_dependencies.main();
     reachable_source_collector.main();
-  });
+  }, name: 'dependencies');
 }
diff --git a/pkg/analysis_server/test/services/index/index_test.dart b/pkg/analysis_server/test/services/index/index_test.dart
index 5a1f093..2d78865 100644
--- a/pkg/analysis_server/test/services/index/index_test.dart
+++ b/pkg/analysis_server/test/services/index/index_test.dart
@@ -7,16 +7,16 @@
 import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/summary/idl.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:typed_mock/typed_mock.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../abstract_single_unit.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(IndexTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(IndexTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/index/index_unit_test.dart b/pkg/analysis_server/test/services/index/index_unit_test.dart
index 87388fd..046bdfa 100644
--- a/pkg/analysis_server/test/services/index/index_unit_test.dart
+++ b/pkg/analysis_server/test/services/index/index_unit_test.dart
@@ -9,14 +9,15 @@
 import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer/src/summary/format.dart';
 import 'package:analyzer/src/summary/idl.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../abstract_single_unit.dart';
 
 main() {
-  groupSep = ' | ';
-  defineReflectiveTests(PackageIndexAssemblerTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(PackageIndexAssemblerTest);
+  });
 }
 
 class ExpectedLocation {
diff --git a/pkg/analysis_server/test/services/index/test_all.dart b/pkg/analysis_server/test/services/index/test_all.dart
index 5c45ec5..18799f5 100644
--- a/pkg/analysis_server/test/services/index/test_all.dart
+++ b/pkg/analysis_server/test/services/index/test_all.dart
@@ -2,9 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
 import 'index_test.dart' as index_test;
 import 'index_unit_test.dart' as index_unit_test;
 
@@ -12,9 +11,8 @@
  * Utility for manually running all tests.
  */
 main() {
-  initializeTestEnvironment();
-  group('index', () {
+  defineReflectiveSuite(() {
     index_test.main();
     index_unit_test.main();
-  });
+  }, name: 'index');
 }
diff --git a/pkg/analysis_server/test/services/linter/linter_test.dart b/pkg/analysis_server/test/services/linter/linter_test.dart
index 1017bd6..5ac13392 100644
--- a/pkg/analysis_server/test/services/linter/linter_test.dart
+++ b/pkg/analysis_server/test/services/linter/linter_test.dart
@@ -9,14 +9,13 @@
 import 'package:analyzer/source/analysis_options_provider.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
-
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(LinterRuleOptionsValidatorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(LinterRuleOptionsValidatorTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/abstract_refactoring.dart b/pkg/analysis_server/test/services/refactoring/abstract_refactoring.dart
index a565c87..2ee99d1 100644
--- a/pkg/analysis_server/test/services/refactoring/abstract_refactoring.dart
+++ b/pkg/analysis_server/test/services/refactoring/abstract_refactoring.dart
@@ -14,7 +14,7 @@
 import 'package:analyzer/dart/ast/ast.dart';
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/src/generated/source.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import '../../abstract_single_unit.dart';
 
diff --git a/pkg/analysis_server/test/services/refactoring/abstract_rename.dart b/pkg/analysis_server/test/services/refactoring/abstract_rename.dart
index e6238e3..0c89003 100644
--- a/pkg/analysis_server/test/services/refactoring/abstract_rename.dart
+++ b/pkg/analysis_server/test/services/refactoring/abstract_rename.dart
@@ -9,7 +9,7 @@
 import 'package:analysis_server/src/services/refactoring/refactoring.dart';
 import 'package:analyzer/dart/ast/ast.dart';
 import 'package:analyzer/dart/element/element.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import 'abstract_refactoring.dart';
 
diff --git a/pkg/analysis_server/test/services/refactoring/convert_getter_to_method_test.dart b/pkg/analysis_server/test/services/refactoring/convert_getter_to_method_test.dart
index 4a62450..9b74f44 100644
--- a/pkg/analysis_server/test/services/refactoring/convert_getter_to_method_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/convert_getter_to_method_test.dart
@@ -12,12 +12,12 @@
 import 'package:analyzer/dart/element/element.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
 import 'abstract_refactoring.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ConvertGetterToMethodTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ConvertGetterToMethodTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/convert_method_to_getter_test.dart b/pkg/analysis_server/test/services/refactoring/convert_method_to_getter_test.dart
index 5dca20d..accf182 100644
--- a/pkg/analysis_server/test/services/refactoring/convert_method_to_getter_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/convert_method_to_getter_test.dart
@@ -12,12 +12,12 @@
 import 'package:analyzer/dart/element/element.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
 import 'abstract_refactoring.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ConvertMethodToGetterTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ConvertMethodToGetterTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/extract_local_test.dart b/pkg/analysis_server/test/services/refactoring/extract_local_test.dart
index c35969f..976e77d 100644
--- a/pkg/analysis_server/test/services/refactoring/extract_local_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/extract_local_test.dart
@@ -11,15 +11,15 @@
 import 'package:analysis_server/src/services/correction/status.dart';
 import 'package:analysis_server/src/services/refactoring/extract_local.dart';
 import 'package:analysis_server/src/services/refactoring/refactoring.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import 'abstract_refactoring.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ExtractLocalTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ExtractLocalTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/extract_method_test.dart b/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
index 2a5e7e4..6154170 100644
--- a/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
@@ -10,15 +10,15 @@
 import 'package:analysis_server/src/services/correction/status.dart';
 import 'package:analysis_server/src/services/refactoring/extract_method.dart';
 import 'package:analysis_server/src/services/refactoring/refactoring.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import 'abstract_refactoring.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ExtractMethodTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ExtractMethodTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/inline_local_test.dart b/pkg/analysis_server/test/services/refactoring/inline_local_test.dart
index 37f46cd..e3ccaa1 100644
--- a/pkg/analysis_server/test/services/refactoring/inline_local_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/inline_local_test.dart
@@ -8,15 +8,15 @@
 import 'package:analysis_server/src/services/correction/status.dart';
 import 'package:analysis_server/src/services/refactoring/inline_local.dart';
 import 'package:analysis_server/src/services/refactoring/refactoring.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import 'abstract_refactoring.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(InlineLocalTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(InlineLocalTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/inline_method_test.dart b/pkg/analysis_server/test/services/refactoring/inline_method_test.dart
index 3433f1e..c629f93 100644
--- a/pkg/analysis_server/test/services/refactoring/inline_method_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/inline_method_test.dart
@@ -11,15 +11,15 @@
 import 'package:analysis_server/src/services/refactoring/inline_method.dart';
 import 'package:analysis_server/src/services/refactoring/refactoring.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import 'abstract_refactoring.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(InlineMethodTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(InlineMethodTest);
+  });
 }
 
 @reflectiveTest
@@ -66,6 +66,56 @@
     expect(refactoring.isDeclaration, isTrue);
   }
 
+  test_bad_async_intoSyncStar() {
+    indexTestUnit(r'''
+import 'dart:async';
+class A {
+  Future<int> get test async => 42;
+  Iterable<Future<int>> foo() sync* {
+    yield test;
+  }
+}
+''');
+    _createRefactoring('test async');
+    // error
+    return _assertConditionsFatal('Cannot inline async into sync*.');
+  }
+
+  test_bad_async_targetIsSync_doesNotReturnFuture() {
+    indexTestUnit(r'''
+import 'dart:async';
+class A {
+  Future<int> get test async => 42;
+  double foo() {
+    test;
+    return 1.2;
+  }
+}
+''');
+    _createRefactoring('test async');
+    // error
+    return _assertConditionsFatal(
+        'Cannot inline async into a function that does not return a Future.');
+  }
+
+  test_bad_asyncStar() {
+    indexTestUnit(r'''
+import 'dart:async';
+class A {
+  Stream<int> test() async* {
+    yield 1;
+    yield 2;
+  }
+  foo() {
+    test();
+  }
+}
+''');
+    _createRefactoring('test() async*');
+    // error
+    return _assertConditionsFatal('Cannot inline a generator.');
+  }
+
   test_bad_cascadeInvocation() async {
     indexTestUnit(r'''
 class A {
@@ -711,6 +761,100 @@
 ''');
   }
 
+  test_getter_async_targetIsAsync() {
+    indexTestUnit(r'''
+import 'dart:async';
+class A {
+  Future<int> get test async => 42;
+  Future<int> foo() async {
+    return test;
+  }
+}
+''');
+    _createRefactoring('test async');
+    // validate change
+    return _assertSuccessfulRefactoring(r'''
+import 'dart:async';
+class A {
+  Future<int> foo() async {
+    return 42;
+  }
+}
+''');
+  }
+
+  test_getter_async_targetIsAsyncStar() {
+    indexTestUnit(r'''
+import 'dart:async';
+class A {
+  Future<int> get test async => 42;
+  Stream<int> foo() async {
+    return await test;
+  }
+}
+''');
+    _createRefactoring('test async');
+    // validate change
+    return _assertSuccessfulRefactoring(r'''
+import 'dart:async';
+class A {
+  Stream<int> foo() async {
+    return await 42;
+  }
+}
+''');
+  }
+
+  test_getter_async_targetIsSync() {
+    indexTestUnit(r'''
+import 'dart:async';
+class A {
+  Future<int> get test async => 42;
+  Future<int> foo() {
+    return test;
+  }
+}
+''');
+    _createRefactoring('test async');
+    // validate change
+    return _assertSuccessfulRefactoring(r'''
+import 'dart:async';
+class A {
+  Future<int> foo() async {
+    return 42;
+  }
+}
+''');
+  }
+
+  test_getter_async_targetIsSync2() {
+    indexTestUnit(r'''
+import 'dart:async';
+class A {
+  Future<int> get test async => 42;
+  Future<int> foo1() {
+    return test;
+  }
+  Future<int> foo2() {
+    return test;
+  }
+}
+''');
+    _createRefactoring('test async');
+    // validate change
+    return _assertSuccessfulRefactoring(r'''
+import 'dart:async';
+class A {
+  Future<int> foo1() async {
+    return 42;
+  }
+  Future<int> foo2() async {
+    return 42;
+  }
+}
+''');
+  }
+
   test_getter_classMember_instance() {
     indexTestUnit(r'''
 class A {
@@ -803,6 +947,50 @@
     expect(refactoring.inlineAll, false);
   }
 
+  test_method_async() {
+    indexTestUnit(r'''
+import 'dart:async';
+class A {
+  Future<int> test() async => 42;
+  Future<int> foo() {
+    return test();
+  }
+}
+''');
+    _createRefactoring('test() async');
+    // validate change
+    return _assertSuccessfulRefactoring(r'''
+import 'dart:async';
+class A {
+  Future<int> foo() async {
+    return 42;
+  }
+}
+''');
+  }
+
+  test_method_async2() {
+    indexTestUnit(r'''
+import 'dart:async';
+class A {
+  Future<int> test() async => 42;
+  Future foo() {
+    return [test(), test()];
+  }
+}
+''');
+    _createRefactoring('test() async');
+    // validate change
+    return _assertSuccessfulRefactoring(r'''
+import 'dart:async';
+class A {
+  Future foo() async {
+    return [42, 42];
+  }
+}
+''');
+  }
+
   test_method_emptyBody() {
     indexTestUnit(r'''
 abstract class A {
@@ -1524,6 +1712,7 @@
 
   void _createRefactoring(String search) {
     int offset = findOffset(search);
-    refactoring = new InlineMethodRefactoring(searchEngine, testUnit, offset);
+    refactoring = new InlineMethodRefactoring(
+        searchEngine, (element) async => element.unit, testUnit, offset);
   }
 }
diff --git a/pkg/analysis_server/test/services/refactoring/move_file_test.dart b/pkg/analysis_server/test/services/refactoring/move_file_test.dart
index df2e422..c0cecec 100644
--- a/pkg/analysis_server/test/services/refactoring/move_file_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/move_file_test.dart
@@ -14,12 +14,12 @@
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
 import '../../abstract_context.dart';
-import '../../utils.dart';
 import 'abstract_refactoring.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(MoveFileTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(MoveFileTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/naming_conventions_test.dart b/pkg/analysis_server/test/services/refactoring/naming_conventions_test.dart
index 7b9ead8..04afda2 100644
--- a/pkg/analysis_server/test/services/refactoring/naming_conventions_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/naming_conventions_test.dart
@@ -10,12 +10,12 @@
 import 'package:analysis_server/src/services/refactoring/refactoring.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
 import 'abstract_refactoring.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(NamingConventionsTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(NamingConventionsTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart b/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart
index d35c631..e65a6e0 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart
@@ -7,15 +7,15 @@
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/services/correction/status.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import 'abstract_rename.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(RenameClassMemberTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(RenameClassMemberTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/rename_constructor_test.dart b/pkg/analysis_server/test/services/refactoring/rename_constructor_test.dart
index f10a11d..afc7782 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_constructor_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_constructor_test.dart
@@ -9,53 +9,19 @@
 import 'package:analysis_server/src/services/refactoring/refactoring.dart';
 import 'package:analyzer/dart/ast/ast.dart';
 import 'package:analyzer/dart/element/element.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import 'abstract_rename.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(RenameConstructorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(RenameConstructorTest);
+  });
 }
 
 @reflectiveTest
 class RenameConstructorTest extends RenameRefactoringTest {
-  test_checkFinalConditions_hasMember_constructor() async {
-    indexTestUnit('''
-class A {
-  A.test() {}
-  A.newName() {} // existing
-}
-''');
-    _createConstructorDeclarationRefactoring('test() {}');
-    // check status
-    refactoring.newName = 'newName';
-    RefactoringStatus status = await refactoring.checkFinalConditions();
-    assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
-        expectedMessage:
-            "Class 'A' already declares constructor with name 'newName'.",
-        expectedContextSearch: 'newName() {} // existing');
-  }
-
-  test_checkFinalConditions_hasMember_method() async {
-    indexTestUnit('''
-class A {
-  A.test() {}
-  newName() {} // existing
-}
-''');
-    _createConstructorDeclarationRefactoring('test() {}');
-    // check status
-    refactoring.newName = 'newName';
-    RefactoringStatus status = await refactoring.checkFinalConditions();
-    assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
-        expectedMessage:
-            "Class 'A' already declares method with name 'newName'.",
-        expectedContextSearch: 'newName() {} // existing');
-  }
-
   test_checkInitialConditions_inSDK() async {
     indexTestUnit('''
 main() {
@@ -98,6 +64,40 @@
     assertRefactoringStatusOK(refactoring.checkNewName());
   }
 
+  test_checkNewName_hasMember_constructor() async {
+    indexTestUnit('''
+class A {
+  A.test() {}
+  A.newName() {} // existing
+}
+''');
+    _createConstructorDeclarationRefactoring('test() {}');
+    // check status
+    refactoring.newName = 'newName';
+    RefactoringStatus status = refactoring.checkNewName();
+    assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
+        expectedMessage:
+            "Class 'A' already declares constructor with name 'newName'.",
+        expectedContextSearch: 'newName() {} // existing');
+  }
+
+  test_checkNewName_hasMember_method() async {
+    indexTestUnit('''
+class A {
+  A.test() {}
+  newName() {} // existing
+}
+''');
+    _createConstructorDeclarationRefactoring('test() {}');
+    // check status
+    refactoring.newName = 'newName';
+    RefactoringStatus status = refactoring.checkNewName();
+    assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
+        expectedMessage:
+            "Class 'A' already declares method with name 'newName'.",
+        expectedContextSearch: 'newName() {} // existing');
+  }
+
   test_createChange_add() {
     indexTestUnit('''
 class A {
diff --git a/pkg/analysis_server/test/services/refactoring/rename_import_test.dart b/pkg/analysis_server/test/services/refactoring/rename_import_test.dart
index 8d061ed..f2df10b 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_import_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_import_test.dart
@@ -6,15 +6,15 @@
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analyzer/dart/ast/ast.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import 'abstract_rename.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(RenameImportTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(RenameImportTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/rename_label_test.dart b/pkg/analysis_server/test/services/refactoring/rename_label_test.dart
index 613a0d6..c1e995f 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_label_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_label_test.dart
@@ -5,15 +5,15 @@
 library test.services.refactoring.rename_label;
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import 'abstract_rename.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(RenameLabelTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(RenameLabelTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/rename_library_test.dart b/pkg/analysis_server/test/services/refactoring/rename_library_test.dart
index 597df6e..fd58cc2 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_library_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_library_test.dart
@@ -6,15 +6,15 @@
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import 'abstract_rename.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(RenameLibraryTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(RenameLibraryTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/rename_local_test.dart b/pkg/analysis_server/test/services/refactoring/rename_local_test.dart
index e454ece..7cc5811 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_local_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_local_test.dart
@@ -6,15 +6,15 @@
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/services/correction/status.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import 'abstract_rename.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(RenameLocalTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(RenameLocalTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/rename_unit_member_test.dart b/pkg/analysis_server/test/services/refactoring/rename_unit_member_test.dart
index 3715ced..1ce560d 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_unit_member_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_unit_member_test.dart
@@ -6,15 +6,15 @@
 
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/services/correction/status.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import 'abstract_rename.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(RenameUnitMemberTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(RenameUnitMemberTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/test_all.dart b/pkg/analysis_server/test/services/refactoring/test_all.dart
index 1dcb857..903c2f4 100644
--- a/pkg/analysis_server/test/services/refactoring/test_all.dart
+++ b/pkg/analysis_server/test/services/refactoring/test_all.dart
@@ -4,9 +4,8 @@
 
 library test.services.refactoring;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
 import 'convert_getter_to_method_test.dart' as convert_getter_to_method_test;
 import 'convert_method_to_getter_test.dart' as convert_method_to_getter_test;
 import 'extract_local_test.dart' as extract_local_test;
@@ -25,8 +24,7 @@
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('refactoring', () {
+  defineReflectiveSuite(() {
     convert_getter_to_method_test.main();
     convert_method_to_getter_test.main();
     extract_local_test.main();
@@ -42,5 +40,5 @@
     rename_library_test.main();
     rename_local_test.main();
     rename_unit_member_test.main();
-  });
+  }, name: 'refactoring');
 }
diff --git a/pkg/analysis_server/test/services/search/hierarchy_test.dart b/pkg/analysis_server/test/services/search/hierarchy_test.dart
index 802f351..618b868 100644
--- a/pkg/analysis_server/test/services/search/hierarchy_test.dart
+++ b/pkg/analysis_server/test/services/search/hierarchy_test.dart
@@ -10,15 +10,15 @@
 import 'package:analysis_server/src/services/search/hierarchy.dart';
 import 'package:analysis_server/src/services/search/search_engine_internal.dart';
 import 'package:analyzer/dart/element/element.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../abstract_single_unit.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(HierarchyTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(HierarchyTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/services/search/search_engine_test.dart b/pkg/analysis_server/test/services/search/search_engine_test.dart
index 7a9db13..8072301 100644
--- a/pkg/analysis_server/test/services/search/search_engine_test.dart
+++ b/pkg/analysis_server/test/services/search/search_engine_test.dart
@@ -13,15 +13,15 @@
 import 'package:analyzer/src/dart/element/element.dart';
 import 'package:analyzer/src/dart/element/member.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../abstract_single_unit.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(SearchEngineImplTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(SearchEngineImplTest);
+  });
 }
 
 class ExpectedMatch {
@@ -617,6 +617,23 @@
     await _verifyReferences(method, expected);
   }
 
+  test_searchReferences_null_noUnitElement() async {
+    _indexTestUnit('''
+class A {
+  m() {}
+}
+main(A a) {
+  a.m();
+}
+''');
+    MethodElement method = findElement('m');
+    List<SearchMatch> matches = await searchEngine.searchReferences(method);
+    expect(matches, hasLength(1));
+    // Set the source contents, so the element is invalidated.
+    context.setContents(testSource, '');
+    expect(matches.single.element, isNull);
+  }
+
   test_searchReferences_ParameterElement_ofConstructor() async {
     _indexTestUnit('''
 class C {
diff --git a/pkg/analysis_server/test/services/search/test_all.dart b/pkg/analysis_server/test/services/search/test_all.dart
index 187d3f3..39251a5 100644
--- a/pkg/analysis_server/test/services/search/test_all.dart
+++ b/pkg/analysis_server/test/services/search/test_all.dart
@@ -4,9 +4,8 @@
 
 library test.services.src.search.all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
 import 'hierarchy_test.dart' as hierarchy_test;
 import 'search_engine_test.dart' as search_engine_test;
 
@@ -14,9 +13,8 @@
  * Utility for manually running all tests.
  */
 main() {
-  initializeTestEnvironment();
-  group('search', () {
+  defineReflectiveSuite(() {
     hierarchy_test.main();
     search_engine_test.main();
-  });
+  }, name: 'search');
 }
diff --git a/pkg/analysis_server/test/services/test_all.dart b/pkg/analysis_server/test/services/test_all.dart
index e0c2086..5ee80ac 100644
--- a/pkg/analysis_server/test/services/test_all.dart
+++ b/pkg/analysis_server/test/services/test_all.dart
@@ -4,7 +4,8 @@
 
 library test.services;
 
-import '../utils.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
 import 'completion/test_all.dart' as completion_all;
 import 'correction/test_all.dart' as correction_all;
 import 'dependencies/test_all.dart' as dependencies_all;
@@ -15,12 +16,13 @@
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  completion_all.main();
-  correction_all.main();
-  dependencies_all.main();
-  index_all.main();
-  linter_all.main();
-  refactoring_all.main();
-  search_all.main();
+  defineReflectiveSuite(() {
+    completion_all.main();
+    correction_all.main();
+    dependencies_all.main();
+    index_all.main();
+    linter_all.main();
+    refactoring_all.main();
+    search_all.main();
+  });
 }
diff --git a/pkg/analysis_server/test/single_context_manager_test.dart b/pkg/analysis_server/test/single_context_manager_test.dart
index 62376bf..eafa488 100644
--- a/pkg/analysis_server/test/single_context_manager_test.dart
+++ b/pkg/analysis_server/test/single_context_manager_test.dart
@@ -14,20 +14,19 @@
 import 'package:analyzer/src/generated/source_io.dart';
 import 'package:analyzer/src/util/glob.dart';
 import 'package:linter/src/plugin/linter_plugin.dart';
-import 'package:path/path.dart';
+import 'package:path/path.dart' as path;
 import 'package:plugin/manager.dart';
 import 'package:plugin/plugin.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import 'context_manager_test.dart' show TestContextManagerCallbacks;
-import 'mock_sdk.dart';
 import 'mocks.dart';
-import 'utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(SingleContextManagerTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(SingleContextManagerTest);
+  });
 }
 
 @reflectiveTest
@@ -44,18 +43,18 @@
       '**/*.${AnalysisEngine.SUFFIX_HTML}',
     ];
     return patterns
-        .map((pattern) => new Glob(posix.separator, pattern))
+        .map((pattern) => new Glob(path.posix.separator, pattern))
         .toList();
   }
 
   String newFile(List<String> pathComponents, [String content = '']) {
-    String filePath = posix.joinAll(pathComponents);
+    String filePath = path.posix.joinAll(pathComponents);
     resourceProvider.newFile(filePath, content);
     return filePath;
   }
 
   String newFolder(List<String> pathComponents) {
-    String folderPath = posix.joinAll(pathComponents);
+    String folderPath = path.posix.joinAll(pathComponents);
     resourceProvider.newFolder(folderPath);
     return folderPath;
   }
@@ -64,8 +63,7 @@
     packageResolver = new TestUriResolver();
 
     _processRequiredPlugins();
-    DartSdkManager sdkManager =
-        new DartSdkManager('', false, (_) => new MockSdk());
+    DartSdkManager sdkManager = new DartSdkManager('', false);
     manager = new SingleContextManager(resourceProvider, sdkManager,
         (_) => packageResolver, analysisFilesGlobs, new AnalysisOptionsImpl());
     callbacks = new TestContextManagerCallbacks(resourceProvider);
@@ -74,12 +72,14 @@
 
   void test_isIgnored_false() {
     String project = '/project';
+    resourceProvider.newFolder(project);
     manager.setRoots(<String>[project], <String>[], <String, String>{});
     expect(manager.isIgnored('$project/file.dart'), isFalse);
   }
 
   void test_isIgnored_true_inDotFolder() {
     String project = '/project';
+    resourceProvider.newFolder(project);
     manager.setRoots(<String>[project], <String>[], <String, String>{});
     expect(manager.isIgnored('$project/foo/.bar/file.dart'), isTrue);
   }
@@ -87,6 +87,7 @@
   void test_isIgnored_true_inExcludedPath() {
     String project = '/project';
     String excludedPath = '/project/excluded';
+    resourceProvider.newFolder(project);
     manager.setRoots(
         <String>[project], <String>[excludedPath], <String, String>{});
     expect(manager.isIgnored('$excludedPath/file.dart'), isTrue);
@@ -95,13 +96,16 @@
   void test_isIgnored_true_notInRoot() {
     String root1 = '/context/root1';
     String root2 = '/context/root2';
+    resourceProvider.newFolder(root1);
+    resourceProvider.newFolder(root2);
     manager.setRoots(<String>[root1, root2], <String>[], <String, String>{});
-    expect(manager.isIgnored('$context/root3/file.dart'), isTrue);
+    expect(manager.isIgnored('/context/root3/file.dart'), isTrue);
   }
 
   void test_isInAnalysisRoot_false_inExcludedPath() {
     String project = '/project';
     String excludedPath = '/project/excluded';
+    resourceProvider.newFolder(project);
     manager.setRoots(
         <String>[project], <String>[excludedPath], <String, String>{});
     expect(manager.isInAnalysisRoot('$excludedPath/file.dart'), isFalse);
@@ -110,12 +114,15 @@
   void test_isInAnalysisRoot_false_notInRoot() {
     String root1 = '/context/root1';
     String root2 = '/context/root2';
+    resourceProvider.newFolder(root1);
+    resourceProvider.newFolder(root2);
     manager.setRoots(<String>[root1, root2], <String>[], <String, String>{});
-    expect(manager.isInAnalysisRoot('$context/root3/file.dart'), isFalse);
+    expect(manager.isInAnalysisRoot('/context/root3/file.dart'), isFalse);
   }
 
   void test_isInAnalysisRoot_true() {
     String project = '/project';
+    resourceProvider.newFolder(project);
     manager.setRoots(<String>[project], <String>[], <String, String>{});
     expect(manager.isInAnalysisRoot('$project/file.dart'), isTrue);
   }
@@ -371,6 +378,7 @@
 
   test_watch_addFile() async {
     String project = '/project';
+    resourceProvider.newFolder(project);
     manager.setRoots(<String>[project], <String>[], <String, String>{});
     // empty folder initially
     callbacks.assertContextFiles(project, []);
@@ -388,6 +396,8 @@
     String root2 = '$contextPath/root2';
     String file1 = '$root1/file1.dart';
     String file2 = '$root2/file2.dart';
+    resourceProvider.newFolder(root1);
+    resourceProvider.newFolder(root2);
     manager.setRoots(<String>[root1], <String>[], <String, String>{});
     manager.setRoots(<String>[root2], <String>[], <String, String>{});
     manager.setRoots(<String>[root1, root2], <String>[], <String, String>{});
@@ -459,8 +469,9 @@
     callbacks.assertContextFiles(project, [fileA]);
   }
 
-  test_watch_addFileInSubfolder() async {
+  test_watch_addFileInSubFolder() async {
     String project = '/project';
+    resourceProvider.newFolder(project);
     manager.setRoots(<String>[project], <String>[], <String, String>{});
     // empty folder initially
     callbacks.assertContextFiles(project, []);
diff --git a/pkg/analysis_server/test/socket_server_test.dart b/pkg/analysis_server/test/socket_server_test.dart
index 948bf43..a6ea8b1 100644
--- a/pkg/analysis_server/test/socket_server_test.dart
+++ b/pkg/analysis_server/test/socket_server_test.dart
@@ -16,13 +16,11 @@
 import 'package:analyzer/src/dart/sdk/sdk.dart';
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:plugin/manager.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import 'mocks.dart';
-import 'utils.dart';
 
 main() {
-  initializeTestEnvironment();
   group('SocketServer', () {
     test('createAnalysisServer_successful',
         SocketServerTest.createAnalysisServer_successful);
@@ -115,12 +113,11 @@
     ServerPlugin serverPlugin = new ServerPlugin();
     ExtensionManager manager = new ExtensionManager();
     manager.processPlugins([serverPlugin]);
-    SdkCreator sdkCreator = (_) => new FolderBasedDartSdk(resourceProvider,
-        FolderBasedDartSdk.defaultSdkDirectory(resourceProvider));
     return new SocketServer(
         new AnalysisServerOptions(),
-        new DartSdkManager('', false, sdkCreator),
-        sdkCreator(null),
+        new DartSdkManager('', false),
+        new FolderBasedDartSdk(resourceProvider,
+            FolderBasedDartSdk.defaultSdkDirectory(resourceProvider)),
         InstrumentationService.NULL_SERVICE,
         serverPlugin,
         null,
diff --git a/pkg/analysis_server/test/source/caching_put_package_map_provider_test.dart b/pkg/analysis_server/test/source/caching_put_package_map_provider_test.dart
index 4b78803..efc37e8 100644
--- a/pkg/analysis_server/test/source/caching_put_package_map_provider_test.dart
+++ b/pkg/analysis_server/test/source/caching_put_package_map_provider_test.dart
@@ -14,13 +14,9 @@
 import 'package:analyzer/source/package_map_provider.dart';
 import 'package:analyzer/src/dart/sdk/sdk.dart';
 import 'package:analyzer/src/generated/engine.dart';
-import 'package:unittest/unittest.dart';
-
-import '../utils.dart';
+import 'package:test/test.dart';
 
 main() {
-  initializeTestEnvironment();
-
   group('CachingPubPackageMapProvider', () {
     MemoryResourceProvider resProvider;
     _MockPubListRunner mockRunner;
@@ -72,10 +68,11 @@
     }
 
     CachingPubPackageMapProvider newPkgProvider() {
+      Folder sdkFolder = resProvider
+          .newFolder(resProvider.convertPath('/Users/user/dart-sdk'));
       return new CachingPubPackageMapProvider(
           resProvider,
-          new FolderBasedDartSdk(
-              resProvider, FolderBasedDartSdk.defaultSdkDirectory(resProvider)),
+          new FolderBasedDartSdk(resProvider, sdkFolder),
           mockRunner.runPubList,
           mockWriteFile);
     }
diff --git a/pkg/analysis_server/test/source/test_all.dart b/pkg/analysis_server/test/source/test_all.dart
index 1389dd3..317a910 100644
--- a/pkg/analysis_server/test/source/test_all.dart
+++ b/pkg/analysis_server/test/source/test_all.dart
@@ -4,11 +4,9 @@
 
 library test.source;
 
-import '../utils.dart';
 import 'caching_put_package_map_provider_test.dart' as caching_provider_test;
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
   caching_provider_test.main();
 }
diff --git a/pkg/analysis_server/test/src/test_all.dart b/pkg/analysis_server/test/src/test_all.dart
index a3642f6..e7df8d3 100644
--- a/pkg/analysis_server/test/src/test_all.dart
+++ b/pkg/analysis_server/test/src/test_all.dart
@@ -4,17 +4,15 @@
 
 library test.src;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../utils.dart';
 import 'utilities/test_all.dart' as utilities_all;
 
 /**
  * Utility for manually running all tests.
  */
 main() {
-  initializeTestEnvironment();
-  group('analysis_server', () {
+  defineReflectiveSuite(() {
     utilities_all.main();
-  });
+  }, name: 'analysis_server');
 }
diff --git a/pkg/analysis_server/test/src/utilities/change_builder_core_test.dart b/pkg/analysis_server/test/src/utilities/change_builder_core_test.dart
index c36c700..118bdb8 100644
--- a/pkg/analysis_server/test/src/utilities/change_builder_core_test.dart
+++ b/pkg/analysis_server/test/src/utilities/change_builder_core_test.dart
@@ -7,18 +7,18 @@
 import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/provisional/edit/utilities/change_builder_core.dart';
 import 'package:analysis_server/src/utilities/change_builder_core.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../domain_execution_test.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ChangeBuilderImplTest);
-  defineReflectiveTests(EditBuilderImplTest);
-  defineReflectiveTests(FileEditBuilderImplTest);
-  defineReflectiveTests(LinkedEditBuilderImplTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ChangeBuilderImplTest);
+    defineReflectiveTests(EditBuilderImplTest);
+    defineReflectiveTests(FileEditBuilderImplTest);
+    defineReflectiveTests(LinkedEditBuilderImplTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/src/utilities/change_builder_dart_test.dart b/pkg/analysis_server/test/src/utilities/change_builder_dart_test.dart
index 61f8328..a221d9b 100644
--- a/pkg/analysis_server/test/src/utilities/change_builder_dart_test.dart
+++ b/pkg/analysis_server/test/src/utilities/change_builder_dart_test.dart
@@ -11,17 +11,17 @@
 import 'package:analyzer/dart/ast/ast.dart';
 import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../abstract_context.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(DartChangeBuilderImplTest);
-  defineReflectiveTests(DartEditBuilderImplTest);
-  defineReflectiveTests(DartFileEditBuilderImplTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(DartChangeBuilderImplTest);
+    defineReflectiveTests(DartEditBuilderImplTest);
+    defineReflectiveTests(DartFileEditBuilderImplTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analysis_server/test/src/utilities/test_all.dart b/pkg/analysis_server/test/src/utilities/test_all.dart
index cdb4f83..b60e72d2 100644
--- a/pkg/analysis_server/test/src/utilities/test_all.dart
+++ b/pkg/analysis_server/test/src/utilities/test_all.dart
@@ -4,13 +4,15 @@
 
 library test.services;
 
-import '../../utils.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
 import 'change_builder_core_test.dart' as change_builder_core_test;
 import 'change_builder_dart_test.dart' as change_builder_dart_test;
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  change_builder_core_test.main();
-  change_builder_dart_test.main();
+  defineReflectiveSuite(() {
+    change_builder_core_test.main();
+    change_builder_dart_test.main();
+  });
 }
diff --git a/pkg/analysis_server/test/src/watch_manager_test.dart b/pkg/analysis_server/test/src/watch_manager_test.dart
index 99b76fc..c3dc145 100644
--- a/pkg/analysis_server/test/src/watch_manager_test.dart
+++ b/pkg/analysis_server/test/src/watch_manager_test.dart
@@ -9,17 +9,17 @@
 import 'package:analysis_server/src/watch_manager.dart';
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/file_system/memory_file_system.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 import 'package:watcher/watcher.dart';
 
 import '../mocks.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(WatchManagerTest);
-  defineReflectiveTests(WatchNodeTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(WatchManagerTest);
+    defineReflectiveTests(WatchNodeTest);
+  });
 }
 
 /**
diff --git a/pkg/analysis_server/test/test_all.dart b/pkg/analysis_server/test/test_all.dart
index e830864..50dbfaa 100644
--- a/pkg/analysis_server/test/test_all.dart
+++ b/pkg/analysis_server/test/test_all.dart
@@ -2,7 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
 import 'analysis/test_all.dart' as analysis_all;
 import 'analysis_server_test.dart' as analysis_server_test;
@@ -26,14 +26,12 @@
 import 'socket_server_test.dart' as socket_server_test;
 import 'source/test_all.dart' as source_all;
 import 'src/test_all.dart' as src_all;
-import 'utils.dart';
 
 /**
  * Utility for manually running all tests.
  */
 main() {
-  initializeTestEnvironment();
-  group('analysis_server', () {
+  defineReflectiveSuite(() {
     analysis_all.main();
     analysis_server_test.main();
     channel_test.main();
@@ -56,5 +54,5 @@
     socket_server_test.main();
     source_all.main();
     src_all.main();
-  });
+  }, name: 'analisys_server');
 }
diff --git a/pkg/analysis_server/test/utils.dart b/pkg/analysis_server/test/utils.dart
deleted file mode 100644
index e87a3c8..0000000
--- a/pkg/analysis_server/test/utils.dart
+++ /dev/null
@@ -1,11 +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 analysis_server.test.utils;
-
-import 'package:unittest/unittest.dart';
-
-void initializeTestEnvironment() {
-  groupSep = ' | ';
-}
diff --git a/pkg/analysis_server/tool/instrumentation/log/log.dart b/pkg/analysis_server/tool/instrumentation/log/log.dart
index 7042fc4..37bb4f5 100644
--- a/pkg/analysis_server/tool/instrumentation/log/log.dart
+++ b/pkg/analysis_server/tool/instrumentation/log/log.dart
@@ -5,14 +5,84 @@
 /**
  * A representation of the contents of an instrumentation log.
  */
-library analysis_server.tool.instrumentation.log;
+library analysis_server.tool.instrumentation.log.log;
 
-import 'dart:collection';
 import 'dart:convert';
+import 'dart:math' as math;
 
 import 'package:analyzer/instrumentation/instrumentation.dart';
 
 /**
+ * A boolean-valued function of one argument.
+ */
+typedef bool Predicate<T>(T value);
+
+/**
+ * A description of a group of log entries.
+ */
+class EntryGroup {
+  /**
+   * A list of all of the instances of this class.
+   */
+  static final List<EntryGroup> groups = <EntryGroup>[
+    new EntryGroup._(
+        'nonTask', 'Non-task', (LogEntry entry) => entry is! TaskEntry),
+    new EntryGroup._(
+        'errors',
+        'Errors',
+        (LogEntry entry) =>
+            entry is ErrorEntry ||
+            entry is ExceptionEntry ||
+            (entry is NotificationEntry && entry.isServerError)),
+    new EntryGroup._('malformed', 'Malformed',
+        (LogEntry entry) => entry is MalformedLogEntry),
+    new EntryGroup._('all', 'All', (LogEntry entry) => true),
+  ];
+
+  /**
+   * The unique id of the group.
+   */
+  final String id;
+
+  /**
+   * The human-readable name of the group.
+   */
+  final String name;
+
+  /**
+   * The filter used to determine which entries belong to the group. The filter
+   * should return `true` for members and `false` for non-members.
+   */
+  final Predicate<LogEntry> filter;
+
+  /**
+   * Initialize a newly created entry group with the given state.
+   */
+  EntryGroup._(this.id, this.name, this.filter);
+
+  /**
+   * Given a list of [entries], return all of the entries in the list that are
+   * members of this group.
+   */
+  List<LogEntry> computeMembers(List<LogEntry> entries) {
+    return entries.where(filter).toList();
+  }
+
+  /**
+   * Return the entry group with the given [id], or `null` if there is no group
+   * with the given id.
+   */
+  static EntryGroup withId(String id) {
+    for (EntryGroup group in groups) {
+      if (group.id == id) {
+        return group;
+      }
+    }
+    return null;
+  }
+}
+
+/**
  * A range of log entries, represented by the index of the first and last
  * entries in the range.
  */
@@ -107,34 +177,33 @@
   List<LogEntry> logEntries;
 
   /**
-   * The entries in the instrumentation log that are not instances of
-   * [TaskEntry].
+   * A table mapping the entry groups that have been computed to the list of
+   * entries in that group.
    */
-  List<LogEntry> nonTaskEntries;
+  Map<EntryGroup, List<LogEntry>> entryGroups = <EntryGroup, List<LogEntry>>{};
 
   /**
    * A table mapping entries that are paired with another entry to the entry
    * with which they are paired.
    */
-  Map<LogEntry, LogEntry> _pairedEntries = new HashMap<LogEntry, LogEntry>();
+  Map<LogEntry, LogEntry> _pairedEntries = <LogEntry, LogEntry>{};
 
   /**
    * A table mapping the id's of requests to the entry representing the request.
    */
-  Map<String, RequestEntry> _requestMap = new HashMap<String, RequestEntry>();
+  Map<String, RequestEntry> _requestMap = <String, RequestEntry>{};
 
   /**
    * A table mapping the id's of responses to the entry representing the
    * response.
    */
-  Map<String, ResponseEntry> _responseMap =
-      new HashMap<String, ResponseEntry>();
+  Map<String, ResponseEntry> _responseMap = <String, ResponseEntry>{};
 
   /**
    * A table mapping the ids of completion events to the events with those ids.
    */
   Map<String, List<NotificationEntry>> _completionMap =
-      new HashMap<String, List<NotificationEntry>>();
+      <String, List<NotificationEntry>>{};
 
   /**
    * The ranges of entries that are between analysis start and analysis end
@@ -158,6 +227,12 @@
       _completionMap[id];
 
   /**
+   * Return the log entries that are contained in the given [group].
+   */
+  List<LogEntry> entriesInGroup(EntryGroup group) =>
+      entryGroups.putIfAbsent(group, () => group.computeMembers(logEntries));
+
+  /**
    * Return the entry that is paired with the given [entry], or `null` if there
    * is no entry paired with it.
    */
@@ -181,7 +256,7 @@
    */
   List<TaskEntry> taskEntriesFor(int startIndex) {
     List<TaskEntry> taskEntries = <TaskEntry>[];
-    NotificationEntry startEntry = nonTaskEntries[startIndex];
+    NotificationEntry startEntry = logEntries[startIndex];
     LogEntry endEntry = pairedEntry(startEntry);
     int lastIndex = endEntry == null ? logEntries.length : endEntry.index;
     for (int i = startEntry.index + 1; i < lastIndex; i++) {
@@ -194,6 +269,18 @@
   }
 
   /**
+   * Return `true` if the given [logContent] appears to be from session data.
+   */
+  bool _isSessionData(List<String> logContent) {
+    if (logContent.length < 2) {
+      return false;
+    }
+    String firstLine = logContent[0];
+    return firstLine.startsWith('-----') && logContent[1].startsWith('~') ||
+        firstLine.startsWith('~');
+  }
+
+  /**
    * Merge any multi-line entries into a single line so that every element in
    * the given [logContent] is a single entry.
    */
@@ -218,14 +305,21 @@
         if (extraLines.isNotEmpty) {
           logContent[i] = merge(line, extraLines);
         }
+        extraLines.clear();
       } else {
         logContent.removeAt(i);
         extraLines.insert(0, line);
       }
     }
     if (extraLines.isNotEmpty) {
-      throw new StateError(
-          '${extraLines.length} non-entry lines before any entry');
+      int count = math.min(extraLines.length, 10);
+      StringBuffer buffer = new StringBuffer();
+      buffer.writeln('${extraLines.length} non-entry lines before any entry');
+      buffer.writeln('First $count lines:');
+      for (int i = 0; i < count; i++) {
+        buffer.writeln(extraLines[i]);
+      }
+      throw new StateError(buffer.toString());
     }
   }
 
@@ -233,9 +327,18 @@
    * Parse the given [logContent] into a list of log entries.
    */
   void _parseLogContent(List<String> logContent) {
-    _mergeEntries(logContent);
+    if (_isSessionData(logContent)) {
+      if (logContent[0].startsWith('-----')) {
+        logContent.removeAt(0);
+      }
+      int lastIndex = logContent.length - 1;
+      if (logContent[lastIndex].startsWith('extraction complete')) {
+        logContent.removeAt(lastIndex);
+      }
+    } else {
+      _mergeEntries(logContent);
+    }
     logEntries = <LogEntry>[];
-    nonTaskEntries = <LogEntry>[];
     analysisRanges = <EntryRange>[];
     NotificationEntry analysisStartEntry = null;
     int analysisStartIndex = -1;
@@ -244,9 +347,6 @@
       LogEntry entry = new LogEntry.from(logEntries.length, line);
       if (entry != null) {
         logEntries.add(entry);
-        if (entry is! TaskEntry) {
-          nonTaskEntries.add(entry);
-        }
         if (entry is RequestEntry) {
           _requestMap[entry.id] = entry;
         } else if (entry is ResponseEntry) {
@@ -439,6 +539,7 @@
     'Err': 'Error',
     'Ex': 'Exception',
     'Log': 'Log message',
+    'Mal': 'Malformed entry',
     'Noti': 'Notification',
     'Read': 'Read file',
     'Req': 'Request',
@@ -479,47 +580,54 @@
     if (entry.isEmpty) {
       return null;
     }
-    List<String> components = _parseComponents(entry);
-    int timeStamp;
     try {
-      timeStamp = int.parse(components[0]);
-    } catch (exception) {
-      print('Invalid time stamp in "${components[0]}"; entry = "$entry"');
-      return null;
-    }
-    String entryKind = components[1];
-    if (entryKind == InstrumentationService.TAG_ANALYSIS_TASK) {
-      return new TaskEntry(index, timeStamp, components[2], components[3]);
-    } else if (entryKind == InstrumentationService.TAG_ERROR) {
-      return new ErrorEntry(index, timeStamp, entryKind, components.sublist(2));
-    } else if (entryKind == InstrumentationService.TAG_EXCEPTION) {
-      return new ExceptionEntry(
+      List<String> components = _parseComponents(entry);
+      int timeStamp;
+      String component = components[0];
+      if (component.startsWith('~')) {
+        component = component.substring(1);
+      }
+      timeStamp = int.parse(component);
+      String entryKind = components[1];
+      if (entryKind == InstrumentationService.TAG_ANALYSIS_TASK) {
+        return new TaskEntry(index, timeStamp, components[2], components[3]);
+      } else if (entryKind == InstrumentationService.TAG_ERROR) {
+        return new ErrorEntry(
+            index, timeStamp, entryKind, components.sublist(2));
+      } else if (entryKind == InstrumentationService.TAG_EXCEPTION) {
+        return new ExceptionEntry(
+            index, timeStamp, entryKind, components.sublist(2));
+      } else if (entryKind == InstrumentationService.TAG_FILE_READ) {
+        // Fall through
+      } else if (entryKind == InstrumentationService.TAG_LOG_ENTRY) {
+        // Fall through
+      } else if (entryKind == InstrumentationService.TAG_NOTIFICATION) {
+        Map requestData = JSON.decode(components[2]);
+        return new NotificationEntry(index, timeStamp, requestData);
+      } else if (entryKind == InstrumentationService.TAG_PERFORMANCE) {
+        // Fall through
+      } else if (entryKind == InstrumentationService.TAG_REQUEST) {
+        Map requestData = JSON.decode(components[2]);
+        return new RequestEntry(index, timeStamp, requestData);
+      } else if (entryKind == InstrumentationService.TAG_RESPONSE) {
+        Map responseData = JSON.decode(components[2]);
+        return new ResponseEntry(index, timeStamp, responseData);
+      } else if (entryKind == InstrumentationService.TAG_SUBPROCESS_START) {
+        // Fall through
+      } else if (entryKind == InstrumentationService.TAG_SUBPROCESS_RESULT) {
+        // Fall through
+      } else if (entryKind == InstrumentationService.TAG_VERSION) {
+        // Fall through
+      } else if (entryKind == InstrumentationService.TAG_WATCH_EVENT) {
+        // Fall through
+      }
+      return new GenericEntry(
           index, timeStamp, entryKind, components.sublist(2));
-    } else if (entryKind == InstrumentationService.TAG_FILE_READ) {
-      // Fall through
-    } else if (entryKind == InstrumentationService.TAG_LOG_ENTRY) {
-      // Fall through
-    } else if (entryKind == InstrumentationService.TAG_NOTIFICATION) {
-      Map requestData = JSON.decode(components[2]);
-      return new NotificationEntry(index, timeStamp, requestData);
-    } else if (entryKind == InstrumentationService.TAG_PERFORMANCE) {
-      // Fall through
-    } else if (entryKind == InstrumentationService.TAG_REQUEST) {
-      Map requestData = JSON.decode(components[2]);
-      return new RequestEntry(index, timeStamp, requestData);
-    } else if (entryKind == InstrumentationService.TAG_RESPONSE) {
-      Map responseData = JSON.decode(components[2]);
-      return new ResponseEntry(index, timeStamp, responseData);
-    } else if (entryKind == InstrumentationService.TAG_SUBPROCESS_START) {
-      // Fall through
-    } else if (entryKind == InstrumentationService.TAG_SUBPROCESS_RESULT) {
-      // Fall through
-    } else if (entryKind == InstrumentationService.TAG_VERSION) {
-      // Fall through
-    } else if (entryKind == InstrumentationService.TAG_WATCH_EVENT) {
-      // Fall through
+    } catch (exception) {
+      LogEntry logEntry = new MalformedLogEntry(index, entry);
+      logEntry.recordProblem(exception.toString());
+      return logEntry;
     }
-    return new GenericEntry(index, timeStamp, entryKind, components.sublist(2));
   }
 
   /**
@@ -608,6 +716,25 @@
 }
 
 /**
+ * A representation of a malformed log entry.
+ */
+class MalformedLogEntry extends LogEntry {
+  final String entry;
+
+  MalformedLogEntry(int index, this.entry) : super(index, -1);
+
+  @override
+  String get kind => 'Mal';
+
+  @override
+  void _appendDetails(StringBuffer buffer) {
+    super._appendDetails(buffer);
+    buffer.write(entry);
+    buffer.write('<br>');
+  }
+}
+
+/**
  * A log entry representing a notification that was sent from the server to the
  * client.
  */
@@ -625,6 +752,11 @@
   String get event => data['event'];
 
   /**
+   * Return `true` if this is a server error notification.
+   */
+  bool get isServerError => event == 'server.error';
+
+  /**
    * Return `true` if this is a server status notification.
    */
   bool get isServerStatus => event == 'server.status';
diff --git a/pkg/analysis_server/tool/instrumentation/log_viewer.dart b/pkg/analysis_server/tool/instrumentation/log_viewer.dart
index 1d59e3b..62d5722 100644
--- a/pkg/analysis_server/tool/instrumentation/log_viewer.dart
+++ b/pkg/analysis_server/tool/instrumentation/log_viewer.dart
@@ -118,6 +118,7 @@
           stackTrace: stackTrace);
       return;
     }
+    print('Log file contains ${lines.length} lines');
 
     InstrumentationLog log =
         new InstrumentationLog(<String>[logFile.path], lines);
diff --git a/pkg/analysis_server/tool/instrumentation/page/log_page.dart b/pkg/analysis_server/tool/instrumentation/page/log_page.dart
index 83dd31d..756b2f4 100644
--- a/pkg/analysis_server/tool/instrumentation/page/log_page.dart
+++ b/pkg/analysis_server/tool/instrumentation/page/log_page.dart
@@ -2,7 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import 'dart:collection';
 import 'dart:math' as math;
 
 import '../log/log.dart';
@@ -20,6 +19,16 @@
   InstrumentationLog log;
 
   /**
+   * The id of the entry groups to be displayed.
+   */
+  EntryGroup selectedGroup;
+
+  /**
+   * The entries in the selected group.
+   */
+  List<LogEntry> entries;
+
+  /**
    * The index of the first entry to be written.
    */
   int pageStart = 0;
@@ -36,26 +45,16 @@
   int prefixLength;
 
   /**
-   * The number of each kind of log entry. Currently used only for debugging and
-   * should be removed.
-   */
-  Map<String, int> counts = new HashMap<String, int>();
-
-  /**
    * Initialize a newly created writer to write the content of the given
    * [instrumentationLog].
    */
-  LogPage(this.log) {
-    List<LogEntry> entries = log.logEntries;
-    prefixLength = computePrefixLength(entries);
-    for (LogEntry entry in entries) {
-      int count = counts.putIfAbsent(entry.kind, () => 0);
-      counts[entry.kind] = count + 1;
-    }
-  }
+  LogPage(this.log);
 
   @override
   void writeBody(StringSink sink) {
+    entries = log.entriesInGroup(selectedGroup);
+    prefixLength = computePrefixLength(entries);
+
     writeMenu(sink);
     writeTwoColumns(
         sink, 'leftColumn', _writeLeftColumn, 'rightColumn', _writeRightColumn);
@@ -89,6 +88,11 @@
     element.innerHTML = detailsContent;
   }
 }
+function selectEntryGroup(pageStart) {
+  var element = document.getElementById("entryGroup");
+  var url = "/log?group=" + element.value;
+  window.location.assign(url);
+}
 ''');
   }
 
@@ -175,6 +179,8 @@
       description = '<span class="error">$description</span>';
     } else if (entry is ExceptionEntry) {
       description = '<span class="error">$description</span>';
+    } else if (entry is MalformedLogEntry) {
+      description = '<span class="error">$description</span>';
     }
     id = id == null ? '' : 'id="$id" ';
     clickHandler = '$clickHandler; setDetails(\'${escape(entry.details())}\')';
@@ -198,7 +204,6 @@
    * Write the entries in the instrumentation log to the given [sink].
    */
   void _writeLeftColumn(StringSink sink) {
-    List<LogEntry> entries = log.nonTaskEntries;
     int length = entries.length;
     int pageEnd =
         pageLength == null ? length : math.min(pageStart + pageLength, length);
@@ -207,7 +212,24 @@
     //
     sink.writeln('<div class="columnHeader">');
     sink.writeln('<div style="float: left">');
-    sink.writeln('Events $pageStart - ${pageEnd - 1} of ${length - 1}');
+    sink.writeln('<select id="entryGroup" onchange="selectEntryGroup()">');
+    for (EntryGroup group in EntryGroup.groups) {
+      sink.write('<option value="');
+      sink.write(group.id);
+      sink.write('"');
+      if (group == selectedGroup) {
+        sink.write(' selected');
+      }
+      sink.write('>');
+      sink.write(group.name);
+      sink.writeln('</option>');
+    }
+    sink.writeln('</select>');
+    if (length == 0) {
+      sink.writeln('No matching events');
+    } else {
+      sink.writeln('Events $pageStart - ${pageEnd - 1} of $length');
+    }
     sink.writeln('</div>');
 
     sink.writeln('<div style="float: right">');
@@ -216,7 +238,7 @@
     } else {
       sink.write('<button type="button">');
       sink.write(
-          '<a href="${WebServer.logPath}?start=${pageStart - pageLength}">');
+          '<a href="${WebServer.logPath}?group=${selectedGroup.id}&start=${pageStart - pageLength}">');
       sink.write('<b>&lt;</b>');
       sink.writeln('</a></button>');
     }
@@ -226,7 +248,7 @@
     } else {
       sink.write('<button type="button">');
       sink.write(
-          '<a href="${WebServer.logPath}?start=${pageStart + pageLength}">');
+          '<a href="${WebServer.logPath}?group=${selectedGroup.id}&start=${pageStart + pageLength}">');
       sink.write('<b>&gt;</b>');
       sink.writeln('</a></button>');
     }
diff --git a/pkg/analysis_server/tool/instrumentation/page/page_writer.dart b/pkg/analysis_server/tool/instrumentation/page/page_writer.dart
index bd7e769..dca5673 100644
--- a/pkg/analysis_server/tool/instrumentation/page/page_writer.dart
+++ b/pkg/analysis_server/tool/instrumentation/page/page_writer.dart
@@ -48,7 +48,11 @@
    * Return an escaped version of the given [unsafe] text.
    */
   String escape(String unsafe) {
-    return htmlEscape.convert(unsafe);
+    // We double escape single quotes because the escaped characters are
+    // processed as part of reading the HTML, which means that single quotes
+    // end up terminating string literals too early when they appear in event
+    // handlers (which in turn leads to JavaScript syntax errors).
+    return htmlEscape.convert(unsafe).replaceAll('&#39;', '&amp;#39;');
   }
 
   /**
@@ -273,8 +277,8 @@
    */
   void writeTwoColumns(StringSink sink, String leftColumnId,
       Writer writeLeftColumn, String rightColumnId, Writer writeRightColumn) {
-    sink.writeln('<div>');
-    sink.writeln('  <div>');
+    sink.writeln('<div id="container">');
+    sink.writeln('  <div id="content">');
     sink.writeln('    <div id="$leftColumnId">');
     sink.writeln('      <div class="inset">');
     writeLeftColumn(sink);
diff --git a/pkg/analysis_server/tool/instrumentation/page/stats_page.dart b/pkg/analysis_server/tool/instrumentation/page/stats_page.dart
index 02ec025..42cd704 100644
--- a/pkg/analysis_server/tool/instrumentation/page/stats_page.dart
+++ b/pkg/analysis_server/tool/instrumentation/page/stats_page.dart
@@ -52,20 +52,8 @@
   @override
   void writeBody(StringSink sink) {
     writeMenu(sink);
-    sink.writeln('<div id="container">');
-    sink.writeln('  <div id="content">');
-    sink.writeln('    <div id="leftColumn">');
-    sink.writeln('      <div class="inset">');
-    _writeLeftColumn(sink);
-    sink.writeln('      </div>');
-    sink.writeln('    </div>');
-    sink.writeln('    <div id="rightColumn">');
-    sink.writeln('      <div class="inset">');
-    _writeRightColumn(sink);
-    sink.writeln('      </div>');
-    sink.writeln('    </div>');
-    sink.writeln('  </div>');
-    sink.writeln('</div>');
+    writeTwoColumns(
+        sink, 'leftColumn', _writeLeftColumn, 'rightColumn', _writeRightColumn);
   }
 
   /**
@@ -74,20 +62,7 @@
    */
   void writeStyleSheet(StringSink sink) {
     super.writeStyleSheet(sink);
-    sink.writeln(r'''
-#leftColumn {
-  float: left;
-  height: 100%;
-  overflow: auto;
-  width: 50%;
-}
-#rightColumn {
-  float: right;
-  height: 100%;
-  overflow: auto;
-  width: 50%;
-}
-''');
+    writeTwoColumnStyles(sink, 'leftColumn', 'rightColumn');
   }
 
   /**
diff --git a/pkg/analysis_server/tool/instrumentation/server.dart b/pkg/analysis_server/tool/instrumentation/server.dart
index 324244c..768c8b8 100644
--- a/pkg/analysis_server/tool/instrumentation/server.dart
+++ b/pkg/analysis_server/tool/instrumentation/server.dart
@@ -186,8 +186,10 @@
 
   void _writeLogPage(HttpRequest request, StringBuffer buffer) {
     Map<String, String> parameterMap = getParameterMap(request);
+    String groupId = parameterMap['group'];
     String startIndex = parameterMap['start'];
     LogPage page = new LogPage(log);
+    page.selectedGroup = EntryGroup.withId(groupId ?? 'nonTask');
     if (startIndex != null) {
       page.pageStart = int.parse(startIndex);
     } else {
diff --git a/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart b/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
index 02855a6..bdde0bc 100644
--- a/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
+++ b/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
@@ -260,7 +260,7 @@
         }));
         String valueString = literalString(value.value);
         writeln(
-            'static const ${value.value} = const $className._($valueString);');
+            'static const $className ${value.value} = const $className._($valueString);');
         writeln();
       }
 
diff --git a/pkg/analysis_server/tool/spec/codegen_inttest_methods.dart b/pkg/analysis_server/tool/spec/codegen_inttest_methods.dart
index b34cca3..b734061 100644
--- a/pkg/analysis_server/tool/spec/codegen_inttest_methods.dart
+++ b/pkg/analysis_server/tool/spec/codegen_inttest_methods.dart
@@ -104,7 +104,7 @@
     writeln("import 'package:analysis_server/plugin/protocol/protocol.dart';");
     writeln(
         "import 'package:analysis_server/src/protocol/protocol_internal.dart';");
-    writeln("import 'package:unittest/unittest.dart';");
+    writeln("import 'package:test/test.dart';");
     writeln();
     writeln("import 'integration_tests.dart';");
     writeln("import 'protocol_matchers.dart';");
@@ -179,7 +179,7 @@
       indent(() {
         String paramsValidator = camelJoin(
             ['is', notification.domainName, notification.event, 'params']);
-        writeln('expect(params, $paramsValidator);');
+        writeln('outOfTestExpect(params, $paramsValidator);');
         String constructorCall;
         if (notification.params == null) {
           constructorCall = 'new $className()';
@@ -255,7 +255,7 @@
         writeln('ResponseDecoder decoder = new ResponseDecoder($kind);');
         writeln("return new $resultClass.fromJson(decoder, 'result', result);");
       } else {
-        writeln('expect(result, isNull);');
+        writeln('outOfTestExpect(result, isNull);');
         writeln('return null;');
       }
     });
diff --git a/pkg/analysis_server/tool/spec/codegen_matchers.dart b/pkg/analysis_server/tool/spec/codegen_matchers.dart
index 10c5b85..a5bf0d1 100644
--- a/pkg/analysis_server/tool/spec/codegen_matchers.dart
+++ b/pkg/analysis_server/tool/spec/codegen_matchers.dart
@@ -105,7 +105,7 @@
     writeln(' */');
     writeln('library test.integration.protocol.matchers;');
     writeln();
-    writeln("import 'package:unittest/unittest.dart';");
+    writeln("import 'package:test/test.dart';");
     writeln();
     writeln("import 'integration_tests.dart';");
     writeln();
diff --git a/pkg/analysis_server/tool/spec/generate_files b/pkg/analysis_server/tool/spec/generate_files
index ee9e970..c37a385 100755
--- a/pkg/analysis_server/tool/spec/generate_files
+++ b/pkg/analysis_server/tool/spec/generate_files
@@ -51,6 +51,10 @@
 fi
 
 PKG_FILE="${ROOT_DIR}/pkg/analysis_server/.packages"
+if [[ !(-e $PKG_FILE) ]];
+then
+  PKG_FILE="${ROOT_DIR}/.packages"
+fi
 
 DART="${BUILD_DIR}/dart-sdk/bin/dart"
 
diff --git a/pkg/analysis_server/tool/spec/spec_input.html b/pkg/analysis_server/tool/spec/spec_input.html
index 5290921..44e480f 100644
--- a/pkg/analysis_server/tool/spec/spec_input.html
+++ b/pkg/analysis_server/tool/spec/spec_input.html
@@ -125,14 +125,7 @@
       For convenience, the API is divided into domains. Each domain is
       specified in a separate section below:
     </p>
-    <ul>
-      <li><a href="#domain_server">Server</a></li>
-      <li><a href="#domain_analysis">Analysis</a></li>
-      <li><a href="#domain_completion">Code Completion</a></li>
-      <li><a href="#domain_search">Search</a></li>
-      <li><a href="#domain_edit">Edit</a></li>
-      <li><a href="#domain_execution">Execution</a></li>
-    </ul>
+    <toc></toc>
     <p>
       The specifications of the API’s refer to data structures beyond
       the standard JSON primitives. These data structures are
@@ -148,6 +141,34 @@
     <h4>Options</h4>
     <blockquote>
     <dl>
+      <dt>--client-id</dt>
+      <dd>
+      <p>
+      Specifies an identifier associated with the client. Used when
+      generating error reports.
+      </p>
+      <p>
+      Clients are strongly encouraged to provide this information in
+      order to improve the quality of information that can be provided
+      to them.
+      </p>
+      </dd>
+    </dl>
+    <dl>
+      <dt>--client-version</dt>
+      <dd>
+      <p>
+      Specifies the version of the client that is communicating with
+      the server. Used when generating error reports.
+      </p>
+      <p>
+        Clients are strongly encouraged to provide this information in
+        order to improve the quality of information that can be provided
+        to them.
+      </p>
+      </dd>
+    </dl>
+    <dl>
       <dt>--no-error-notification</dt>
       <dd>
       Disable notifications about errors (see analysis.error). If this
@@ -156,29 +177,30 @@
       </dd>
     </dl>
     <dl>
-      <dt>--file-read-mode</dt>
-      <dd>
-      An enumeration of the ways files can be read from disk. Some clients
-      normalize end of line characters which would make the file offset and
-      range information incorrect. The default option is <tt>as-is</tt>, but
-      can also be set to <tt>normalize-eol-always</tt>. The default option
-      (<tt>as-is</tt>) reads files as they are on disk. The
-      <tt>normalize-eol-always</tt> option does the following:
-      <ul>
-        <li>'\r\n' is converted to '\n';</li>
-        <li>'\r' by itself is converted to '\n';</li>
-        <li>this happens regardless of the OS editor is running on.</li>
-      </ul>
-      </dd>
-    </dl>
-    <dl>
       <dt>--no-index</dt>
       <dd>
       Disable the server from generating an index. If this flag is passed and an
       API is used that requires an index, then an error, <tt>NO_INDEX_GENERATED</tt>,
       will be thrown. The set of API calls that require an index include:
       refactoring calls, code completions and searching.
-      <!-- TODO(jwren/scheglov): make sure that this of APIs that is complete. -->
+      <!-- TODO(jwren/scheglov): make sure that this list of APIs that is complete. -->
+      </dd>
+    </dl>
+    <dl>
+      <dt>--file-read-mode</dt>
+      <dd>
+        <p><b>Deprecated</b></p>
+        An enumeration of the ways files can be read from disk. Some clients
+        normalize end of line characters which would make the file offset and
+        range information incorrect. The default option is <tt>as-is</tt>, but
+        can also be set to <tt>normalize-eol-always</tt>. The default option
+        (<tt>as-is</tt>) reads files as they are on disk. The
+        <tt>normalize-eol-always</tt> option does the following:
+        <ul>
+          <li>'\r\n' is converted to '\n';</li>
+          <li>'\r' by itself is converted to '\n';</li>
+          <li>this happens regardless of the OS editor is running on.</li>
+        </ul>
       </dd>
     </dl>
     </blockquote>
diff --git a/pkg/analysis_server/tool/spec/to_html.dart b/pkg/analysis_server/tool/spec/to_html.dart
index b17cdfe..d71fa64 100644
--- a/pkg/analysis_server/tool/spec/to_html.dart
+++ b/pkg/analysis_server/tool/spec/to_html.dart
@@ -116,9 +116,6 @@
 
 /* Styles for index */
 
-.subindex {
-}
-
 .subindex ul {
   padding-left: 0;
   margin-left: 0;
@@ -196,6 +193,7 @@
   void head(void callback()) => element('head', {}, callback);
   void html(void callback()) => element('html', {}, callback);
   void i(void callback()) => element('i', {}, callback);
+  void li(void callback()) => element('li', {}, callback);
   void link(String id, void callback()) {
     element('a', {'href': '#$id'}, callback);
   }
@@ -204,6 +202,7 @@
   void pre(void callback()) => element('pre', {}, callback);
   void title(void callback()) => element('title', {}, callback);
   void tt(void callback()) => element('tt', {}, callback);
+  void ul(void callback()) => element('ul', {}, callback);
 }
 
 /**
@@ -270,6 +269,22 @@
     }
   }
 
+  void generateTableOfContents() {
+    ul(() {
+      writeln();
+
+      for (var domain in api.domains.where((domain) => !domain.experimental)) {
+        write('      ');
+        li(() {
+          link('domain_${domain.name}', () {
+            write(_toTitleCase(domain.name));
+          });
+        });
+        writeln();
+      }
+    });
+  }
+
   void generateIndex() {
     h3(() => write('Domains'));
     for (var domain in api.domains) {
@@ -425,6 +440,9 @@
           case 'version':
             translateHtml(node, squashParagraphs: squashParagraphs);
             break;
+          case 'toc':
+            generateTableOfContents();
+            break;
           case 'index':
             generateIndex();
             break;
@@ -769,3 +787,8 @@
     }
   }
 }
+
+String _toTitleCase(String str) {
+  if (str.isEmpty) return str;
+  return str.substring(0, 1).toUpperCase() + str.substring(1);
+}
diff --git a/pkg/analyzer/BUILD.gn b/pkg/analyzer/BUILD.gn
new file mode 100644
index 0000000..7db0a5e
--- /dev/null
+++ b/pkg/analyzer/BUILD.gn
@@ -0,0 +1,27 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for 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("//build/dart/dart_package.gni")
+
+dart_package("analyzer") {
+  package_name = "analyzer"
+
+  source_dir = "lib"
+
+  deps = [
+    "//dart/pkg/front_end",
+    "//third_party/dart-pkg/pub/args",
+    "//third_party/dart-pkg/pub/charcode",
+    "//third_party/dart-pkg/pub/crypto",
+    "//third_party/dart-pkg/pub/glob",
+    "//third_party/dart-pkg/pub/html",
+    "//third_party/dart-pkg/pub/isolate",
+    "//third_party/dart-pkg/pub/meta",
+    "//third_party/dart-pkg/pub/package_config",
+    "//third_party/dart-pkg/pub/path",
+    "//third_party/dart-pkg/pub/plugin",
+    "//third_party/dart-pkg/pub/watcher",
+    "//third_party/dart-pkg/pub/yaml",
+  ]
+}
diff --git a/pkg/analyzer/CHANGELOG.md b/pkg/analyzer/CHANGELOG.md
index f47e10a..e7a9e48 100644
--- a/pkg/analyzer/CHANGELOG.md
+++ b/pkg/analyzer/CHANGELOG.md
@@ -1,3 +1,8 @@
+## 0.30.0-alpha.0
+* Changed the API for creating BazelWorkspace.  It should now be constructed using BazelWorkspace.find().  Note that this might return `null` in the event that the given path is not part of a BazelWorkspace.
+* Added an AST structure to support asserts in constructor initializers (AssertInitializer).  AstVisitor classes must now implement visitAssertInitializer().
+* Changed the API for creating PartOfDirective.  It now accepts a StringLiteral URI, to accomodate "part of" declarations with a URI string rather than a library name.
+
 ## 0.29.0-alpha.0
 * Removed `Element.docRange`.
 
diff --git a/pkg/analyzer/lib/dart/ast/ast.dart b/pkg/analyzer/lib/dart/ast/ast.dart
index 7ec7be4..c36925f 100644
--- a/pkg/analyzer/lib/dart/ast/ast.dart
+++ b/pkg/analyzer/lib/dart/ast/ast.dart
@@ -323,29 +323,35 @@
 }
 
 /**
- * An assert statement.
+ * An assert in the initializer list of a constructor.
  *
- *    assertStatement ::=
- *        'assert' '(' [Expression] ')' ';'
+ *    assertInitializer ::=
+ *        'assert' '(' [Expression] (',' [Expression])? ')'
  *
  * Clients may not extend, implement or mix-in this class.
  */
-abstract class AssertStatement extends Statement {
+abstract class AssertInitializer implements Assertion, ConstructorInitializer {
   /**
-   * Initialize a newly created assert statement. The [comma] and [message] can
-   * be `null` if there is no message.
+   * Initialize a newly created assert initializer. The [comma] and [message]
+   * can be `null` if there is no message.
    */
-  factory AssertStatement(
+  factory AssertInitializer(
           Token assertKeyword,
           Token leftParenthesis,
           Expression condition,
           Token comma,
           Expression message,
-          Token rightParenthesis,
-          Token semicolon) =>
-      new AssertStatementImpl(assertKeyword, leftParenthesis, condition, comma,
-          message, rightParenthesis, semicolon);
+          Token rightParenthesis) =>
+      new AssertInitializerImpl(assertKeyword, leftParenthesis, condition,
+          comma, message, rightParenthesis);
+}
 
+/**
+ * An assertion, either in a block or in the initializer list of a constructor.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class Assertion implements AstNode {
   /**
    * Return the token representing the 'assert' keyword.
    */
@@ -363,7 +369,8 @@
   Token get comma;
 
   /**
-   * Set the comma between the [condition] and the [message] to the given [token].
+   * Set the comma between the [condition] and the [message] to the given
+   * [token].
    */
   void set comma(Token token);
 
@@ -409,6 +416,31 @@
    *  Set the right parenthesis to the given [token].
    */
   void set rightParenthesis(Token token);
+}
+
+/**
+ * An assert statement.
+ *
+ *    assertStatement ::=
+ *        'assert' '(' [Expression] (',' [Expression])? ')' ';'
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class AssertStatement implements Assertion, Statement {
+  /**
+   * Initialize a newly created assert statement. The [comma] and [message] can
+   * be `null` if there is no message.
+   */
+  factory AssertStatement(
+          Token assertKeyword,
+          Token leftParenthesis,
+          Expression condition,
+          Token comma,
+          Expression message,
+          Token rightParenthesis,
+          Token semicolon) =>
+      new AssertStatementImpl(assertKeyword, leftParenthesis, condition, comma,
+          message, rightParenthesis, semicolon);
 
   /**
    * Return the semicolon terminating the statement.
@@ -429,7 +461,8 @@
  *
  * Clients may not extend, implement or mix-in this class.
  */
-abstract class AssignmentExpression extends Expression {
+abstract class AssignmentExpression extends Expression
+    implements MethodReferenceExpression {
   /**
    * Initialize a newly created assignment expression.
    */
@@ -438,15 +471,6 @@
       new AssignmentExpressionImpl(leftHandSide, operator, rightHandSide);
 
   /**
-   * Return the best element available for this operator. If resolution was able
-   * to find a better element based on type propagation, that element will be
-   * returned. Otherwise, the element found using the result of static analysis
-   * will be returned. If resolution has not been performed, then `null` will be
-   * returned.
-   */
-  MethodElement get bestElement;
-
-  /**
    * Return the expression used to compute the left hand side.
    */
   Expression get leftHandSide;
@@ -467,20 +491,6 @@
   void set operator(Token token);
 
   /**
-   * Return the element associated with the operator based on the propagated
-   * type of the left-hand-side, or `null` if the AST structure has not been
-   * resolved, if the operator is not a compound operator, or if the operator
-   * could not be resolved.
-   */
-  MethodElement get propagatedElement;
-
-  /**
-   * Set the element associated with the operator based on the propagated
-   * type of the left-hand-side to the given [element].
-   */
-  void set propagatedElement(MethodElement element);
-
-  /**
    * Return the expression used to compute the right hand side.
    */
   Expression get rightHandSide;
@@ -490,20 +500,6 @@
    * [expression].
    */
   void set rightHandSide(Expression expression);
-
-  /**
-   * Return the element associated with the operator based on the static type of
-   * the left-hand-side, or `null` if the AST structure has not been resolved,
-   * if the operator is not a compound operator, or if the operator could not be
-   * resolved.
-   */
-  MethodElement get staticElement;
-
-  /**
-   * Set the element associated with the operator based on the static type of
-   * the left-hand-side to the given [element].
-   */
-  void set staticElement(MethodElement element);
 }
 
 /**
@@ -638,6 +634,8 @@
 
   R visitAsExpression(AsExpression node);
 
+  R visitAssertInitializer(AssertInitializer node);
+
   R visitAssertStatement(AssertStatement assertStatement);
 
   R visitAssignmentExpression(AssignmentExpression node);
@@ -892,7 +890,8 @@
  *
  * Clients may not extend, implement or mix-in this class.
  */
-abstract class BinaryExpression extends Expression {
+abstract class BinaryExpression extends Expression
+    implements MethodReferenceExpression {
   /**
    * Initialize a newly created binary expression.
    */
@@ -901,15 +900,6 @@
       new BinaryExpressionImpl(leftOperand, operator, rightOperand);
 
   /**
-   * Return the best element available for this operator. If resolution was able
-   * to find a better element based on type propagation, that element will be
-   * returned. Otherwise, the element found using the result of static analysis
-   * will be returned. If resolution has not been performed, then `null` will be
-   * returned.
-   */
-  MethodElement get bestElement;
-
-  /**
    * Return the expression used to compute the left operand.
    */
   Expression get leftOperand;
@@ -931,20 +921,6 @@
   void set operator(Token token);
 
   /**
-   * Return the element associated with the operator based on the propagated
-   * type of the left operand, or `null` if the AST structure has not been
-   * resolved, if the operator is not user definable, or if the operator could
-   * not be resolved.
-   */
-  MethodElement get propagatedElement;
-
-  /**
-   * Set the element associated with the operator based on the propagated
-   * type of the left operand to the given [element].
-   */
-  void set propagatedElement(MethodElement element);
-
-  /**
    * Return the expression used to compute the right operand.
    */
   Expression get rightOperand;
@@ -954,20 +930,6 @@
    * [expression].
    */
   void set rightOperand(Expression expression);
-
-  /**
-   * Return the element associated with the operator based on the static type of
-   * the left operand, or `null` if the AST structure has not been resolved, if
-   * the operator is not user definable, or if the operator could not be
-   * resolved.
-   */
-  MethodElement get staticElement;
-
-  /**
-   * Set the element associated with the operator based on the static type of
-   * the left operand to the given [element].
-   */
-  void set staticElement(MethodElement element);
 }
 
 /**
@@ -2395,7 +2357,8 @@
  *
  * Clients may not extend, implement or mix-in this class.
  */
-abstract class ConstructorName extends AstNode {
+abstract class ConstructorName extends AstNode
+    implements ConstructorReferenceNode {
   /**
    * Initialize a newly created constructor name. The [period] and [name] can be
    * `null` if the constructor being named is the unnamed constructor.
@@ -2427,19 +2390,6 @@
   void set period(Token token);
 
   /**
-   * Return the element associated with this constructor name based on static
-   * type information, or `null` if the AST structure has not been resolved or
-   * if this constructor name could not be resolved.
-   */
-  ConstructorElement get staticElement;
-
-  /**
-   * Set the element associated with this constructor name based on static type
-   * information to the given [element].
-   */
-  void set staticElement(ConstructorElement element);
-
-  /**
    * Return the name of the type defining the constructor.
    */
   TypeName get type;
@@ -2451,6 +2401,26 @@
 }
 
 /**
+ * An AST node that makes reference to a constructor.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class ConstructorReferenceNode {
+  /**
+   * Return the element associated with the referenced constructor based on
+   * static type information, or `null` if the AST structure has not been
+   * resolved or if the constructor could not be resolved.
+   */
+  ConstructorElement get staticElement;
+
+  /**
+   * Set the element associated with the referenced constructor based on static
+   * type information to the given [element].
+   */
+  void set staticElement(ConstructorElement element);
+}
+
+/**
  * A continue statement.
  *
  *    continueStatement ::=
@@ -4158,25 +4128,6 @@
   void set propagatedElement(ExecutableElement element);
 
   /**
-   * Return the function type of the method invocation based on the propagated
-   * type information, or `null` if the AST structure has not been resolved, or
-   * if the invoke could not be resolved.
-   *
-   * This will usually be a [FunctionType], but it can also be an
-   * [InterfaceType] with a `call` method, `dynamic`, `Function`, or a `@proxy`
-   * interface type that implements `Function`.
-   */
-  @override
-  DartType get propagatedInvokeType;
-
-  /**
-   * Set the function type of the method invocation based on the propagated type
-   * information to the given [type].
-   */
-  @override
-  void set propagatedInvokeType(DartType type);
-
-  /**
    * Return the element associated with the function being invoked based on
    * static type information, or `null` if the AST structure has not been
    * resolved or the function could not be resolved.
@@ -4190,25 +4141,6 @@
   void set staticElement(ExecutableElement element);
 
   /**
-   * Return the function type of the method invocation based on the static type
-   * information, or `null` if the AST structure has not been resolved, or if
-   * the invoke could not be resolved.
-   *
-   * This will usually be a [FunctionType], but it can also be an
-   * [InterfaceType] with a `call` method, `dynamic`, `Function`, or a `@proxy`
-   * interface type that implements `Function`.
-   */
-  @override
-  DartType get staticInvokeType;
-
-  /**
-   * Set the function type of the method invocation based on the static type
-   * information to the given [type].
-   */
-  @override
-  void set staticInvokeType(DartType type);
-
-  /**
    * Set the type arguments to be applied to the method being invoked to the
    * given [typeArguments].
    */
@@ -4747,7 +4679,8 @@
  *
  * Clients may not extend, implement or mix-in this class.
  */
-abstract class IndexExpression extends Expression {
+abstract class IndexExpression extends Expression
+    implements MethodReferenceExpression {
   /**
    * Initialize a newly created index expression.
    */
@@ -4781,15 +4714,6 @@
   void set auxiliaryElements(AuxiliaryElements elements);
 
   /**
-   * Return the best element available for this operator. If resolution was able
-   * to find a better element based on type propagation, that element will be
-   * returned. Otherwise, the element found using the result of static analysis
-   * will be returned. If resolution has not been performed, then `null` will be
-   * returned.
-   */
-  MethodElement get bestElement;
-
-  /**
    * Return the expression used to compute the index.
    */
   Expression get index;
@@ -4829,19 +4753,6 @@
   void set period(Token token);
 
   /**
-   * Return the element associated with the operator based on the propagated
-   * type of the target, or `null` if the AST structure has not been resolved or
-   * if the operator could not be resolved.
-   */
-  MethodElement get propagatedElement;
-
-  /**
-   * Set the element associated with the operator based on the propagated
-   * type of the target to the given [element].
-   */
-  void set propagatedElement(MethodElement element);
-
-  /**
    * Return the expression used to compute the object being indexed. If this
    * index expression is not part of a cascade expression, then this is the same
    * as [target]. If this index expression is part of a cascade expression, then
@@ -4855,19 +4766,6 @@
   Token get rightBracket;
 
   /**
-   * Return the element associated with the operator based on the static type of
-   * the target, or `null` if the AST structure has not been resolved or if the
-   * operator could not be resolved.
-   */
-  MethodElement get staticElement;
-
-  /**
-   * Set the element associated with the operator based on the static type of
-   * the target to the given [element].
-   */
-  void set staticElement(MethodElement element);
-
-  /**
    * Return the expression used to compute the object being indexed, or `null`
    * if this index expression is part of a cascade expression.
    *
@@ -4915,7 +4813,8 @@
  *
  * Clients may not extend, implement or mix-in this class.
  */
-abstract class InstanceCreationExpression extends Expression {
+abstract class InstanceCreationExpression extends Expression
+    implements ConstructorReferenceNode {
   /**
    * Initialize a newly created instance creation expression.
    */
@@ -4961,19 +4860,6 @@
    * created to the given [token].
    */
   void set keyword(Token token);
-
-  /**
-   * Return the element associated with the constructor based on static type
-   * information, or `null` if the AST structure has not been resolved or if the
-   * constructor could not be resolved.
-   */
-  ConstructorElement get staticElement;
-
-  /**
-   * Set the element associated with the constructor based on static type
-   * information to the given [element].
-   */
-  void set staticElement(ConstructorElement element);
 }
 
 /**
@@ -5804,25 +5690,6 @@
   void set operator(Token token);
 
   /**
-   * Return the function type of the method invocation based on the propagated
-   * type information, or `null` if the AST structure has not been resolved, or
-   * if the invoke could not be resolved.
-   *
-   * This will usually be a [FunctionType], but it can also be an
-   * [InterfaceType] with a `call` method, `dynamic`, `Function`, or a `@proxy`
-   * interface type that implements `Function`.
-   */
-  @override
-  DartType get propagatedInvokeType;
-
-  /**
-   * Set the function type of the method invocation based on the propagated type
-   * information to the given [type].
-   */
-  @override
-  void set propagatedInvokeType(DartType type);
-
-  /**
    * Return the expression used to compute the receiver of the invocation. If
    * this invocation is not part of a cascade expression, then this is the same
    * as [target]. If this invocation is part of a cascade expression, then the
@@ -5831,25 +5698,6 @@
   Expression get realTarget;
 
   /**
-   * Return the function type of the method invocation based on the static type
-   * information, or `null` if the AST structure has not been resolved, or if
-   * the invoke could not be resolved.
-   *
-   * This will usually be a [FunctionType], but it can also be an
-   * [InterfaceType] with a `call` method, `dynamic`, `Function`, or a `@proxy`
-   * interface type that implements `Function`.
-   */
-  @override
-  DartType get staticInvokeType;
-
-  /**
-   * Set the function type of the method invocation based on the static type
-   * information to the given [type].
-   */
-  @override
-  void set staticInvokeType(DartType type);
-
-  /**
    * Return the expression producing the object on which the method is defined,
    * or `null` if there is no target (that is, the target is implicitly `this`)
    * or if this method invocation is part of a cascade expression.
@@ -5873,6 +5721,52 @@
 }
 
 /**
+ * An expression that implicity makes reference to a method.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class MethodReferenceExpression {
+  /**
+   * Return the best element available for this expression. If resolution was
+   * able to find a better element based on type propagation, that element will
+   * be returned. Otherwise, the element found using the result of static
+   * analysis will be returned. If resolution has not been performed, then
+   * `null` will be returned.
+   */
+  MethodElement get bestElement;
+
+  /**
+   * Return the element associated with the expression based on propagated
+   * types, or `null` if the AST structure has not been resolved, or there is
+   * no meaningful propagated element to return (e.g. because this is a
+   * non-compound assignment expression, or because the method referred to could
+   * not be resolved).
+   */
+  MethodElement get propagatedElement;
+
+  /**
+   * Set the element associated with the expression based on propagated types to
+   * the given [element].
+   */
+  void set propagatedElement(MethodElement element);
+
+  /**
+   * Return the element associated with the expression based on the static
+   * types, or `null` if the AST structure has not been resolved, or there is no
+   * meaningful static element to return (e.g. because this is a non-compound
+   * assignment expression, or because the method referred to could not be
+   * resolved).
+   */
+  MethodElement get staticElement;
+
+  /**
+   * Set the element associated with the expression based on static types to the
+   * given [element].
+   */
+  void set staticElement(MethodElement element);
+}
+
+/**
  * A node that declares a single name within the scope of a compilation unit.
  *
  * Clients may not extend, implement or mix-in this class.
@@ -6304,17 +6198,19 @@
   /**
    * Initialize a newly created part-of directive. Either or both of the
    * [comment] and [metadata] can be `null` if the directive does not have the
-   * corresponding attribute.
+   * corresponding attribute. Only one of the [uri] and [libraryName] should be
+   * provided.
    */
   factory PartOfDirective(
           Comment comment,
           List<Annotation> metadata,
           Token partKeyword,
           Token ofKeyword,
+          StringLiteral uri,
           LibraryIdentifier libraryName,
           Token semicolon) =>
-      new PartOfDirectiveImpl(
-          comment, metadata, partKeyword, ofKeyword, libraryName, semicolon);
+      new PartOfDirectiveImpl(comment, metadata, partKeyword, ofKeyword, uri,
+          libraryName, semicolon);
 
   /**
    * Return the name of the library that the containing compilation unit is part
@@ -6357,6 +6253,20 @@
    * Set the semicolon terminating the directive to the given [token].
    */
   void set semicolon(Token token);
+
+  /**
+   * Return the URI of the library that the containing compilation unit is part
+   * of, or `null` if no URI was given (typically because a library name was
+   * provided).
+   */
+  StringLiteral get uri;
+
+  /**
+   * Return the URI of the library that the containing compilation unit is part
+   * of, or `null` if no URI was given (typically because a library name was
+   * provided).
+   */
+  void set uri(StringLiteral uri);
 }
 
 /**
@@ -6367,7 +6277,8 @@
  *
  * Clients may not extend, implement or mix-in this class.
  */
-abstract class PostfixExpression extends Expression {
+abstract class PostfixExpression extends Expression
+    implements MethodReferenceExpression {
   /**
    * Initialize a newly created postfix expression.
    */
@@ -6375,15 +6286,6 @@
       new PostfixExpressionImpl(operand, operator);
 
   /**
-   * Return the best element available for this operator. If resolution was able
-   * to find a better element based on type propagation, that element will be
-   * returned. Otherwise, the element found using the result of static analysis
-   * will be returned. If resolution has not been performed, then `null` will be
-   * returned.
-   */
-  MethodElement get bestElement;
-
-  /**
    * Return the expression computing the operand for the operator.
    */
   Expression get operand;
@@ -6403,33 +6305,6 @@
    * Set the postfix operator being applied to the operand to the given [token].
    */
   void set operator(Token token);
-
-  /**
-   * Return the element associated with this the operator based on the
-   * propagated type of the operand, or `null` if the AST structure has not been
-   * resolved, if the operator is not user definable, or if the operator could
-   * not be resolved.
-   */
-  MethodElement get propagatedElement;
-
-  /**
-   * Set the element associated with this the operator based on the propagated
-   * type of the operand to the given [element].
-   */
-  void set propagatedElement(MethodElement element);
-
-  /**
-   * Return the element associated with the operator based on the static type of
-   * the operand, or `null` if the AST structure has not been resolved, if the
-   * operator is not user definable, or if the operator could not be resolved.
-   */
-  MethodElement get staticElement;
-
-  /**
-   * Set the element associated with the operator based on the static type of
-   * the operand to the given [element].
-   */
-  void set staticElement(MethodElement element);
 }
 
 /**
@@ -6500,7 +6375,8 @@
  *
  * Clients may not extend, implement or mix-in this class.
  */
-abstract class PrefixExpression extends Expression {
+abstract class PrefixExpression extends Expression
+    implements MethodReferenceExpression {
   /**
    * Initialize a newly created prefix expression.
    */
@@ -6508,15 +6384,6 @@
       new PrefixExpressionImpl(operator, operand);
 
   /**
-   * Return the best element available for this operator. If resolution was able
-   * to find a better element based on type propagation, that element will be
-   * returned. Otherwise, the element found using the result of static analysis
-   * will be returned. If resolution has not been performed, then `null` will be
-   * returned.
-   */
-  MethodElement get bestElement;
-
-  /**
    * Return the expression computing the operand for the operator.
    */
   Expression get operand;
@@ -6536,33 +6403,6 @@
    * Set the prefix operator being applied to the operand to the given [token].
    */
   void set operator(Token token);
-
-  /**
-   * Return the element associated with the operator based on the propagated
-   * type of the operand, or `null` if the AST structure has not been resolved,
-   * if the operator is not user definable, or if the operator could not be
-   * resolved.
-   */
-  MethodElement get propagatedElement;
-
-  /**
-   * Set the element associated with the operator based on the propagated type
-   * of the operand to the given [element].
-   */
-  void set propagatedElement(MethodElement element);
-
-  /**
-   * Return the element associated with the operator based on the static type of
-   * the operand, or `null` if the AST structure has not been resolved, if the
-   * operator is not user definable, or if the operator could not be resolved.
-   */
-  MethodElement get staticElement;
-
-  /**
-   * Set the element associated with the operator based on the static type of
-   * the operand to the given [element].
-   */
-  void set staticElement(MethodElement element);
 }
 
 /**
@@ -6645,7 +6485,8 @@
  *
  * Clients may not extend, implement or mix-in this class.
  */
-abstract class RedirectingConstructorInvocation extends ConstructorInitializer {
+abstract class RedirectingConstructorInvocation extends ConstructorInitializer
+    implements ConstructorReferenceNode {
   /**
    * Initialize a newly created redirecting invocation to invoke the constructor
    * with the given name with the given arguments. The [constructorName] can be
@@ -6691,19 +6532,6 @@
   void set period(Token token);
 
   /**
-   * Return the element associated with the constructor based on static type
-   * information, or `null` if the AST structure has not been resolved or if the
-   * constructor could not be resolved.
-   */
-  ConstructorElement get staticElement;
-
-  /**
-   * Set the element associated with the constructor based on static type
-   * information to the given [element].
-   */
-  void set staticElement(ConstructorElement element);
-
-  /**
    * Return the token for the 'this' keyword.
    */
   Token get thisKeyword;
@@ -7143,7 +6971,8 @@
  *
  * Clients may not extend, implement or mix-in this class.
  */
-abstract class SuperConstructorInvocation extends ConstructorInitializer {
+abstract class SuperConstructorInvocation extends ConstructorInitializer
+    implements ConstructorReferenceNode {
   /**
    * Initialize a newly created super invocation to invoke the inherited
    * constructor with the given name with the given arguments. The [period] and
@@ -7190,19 +7019,6 @@
   void set period(Token token);
 
   /**
-   * Return the element associated with the constructor based on static type
-   * information, or `null` if the AST structure has not been resolved or if the
-   * constructor could not be resolved.
-   */
-  ConstructorElement get staticElement;
-
-  /**
-   * Set the element associated with the constructor based on static type
-   * information to the given [element].
-   */
-  void set staticElement(ConstructorElement element);
-
-  /**
    * Return the token for the 'super' keyword.
    */
   Token get superKeyword;
@@ -7960,28 +7776,6 @@
    * Set the source to which the [uri] was resolved to the given [source].
    */
   void set uriSource(Source source);
-
-  /**
-   * Validate this directive, but do not check for existence. Return a code
-   * indicating the problem if there is one, or `null` no problem
-   */
-  UriValidationCode validate();
-}
-
-/**
- * Validation codes returned by [UriBasedDirective.validate].
- *
- * Clients may not extend, implement or mix-in this class.
- */
-abstract class UriValidationCode {
-  static const UriValidationCode INVALID_URI =
-      UriValidationCodeImpl.INVALID_URI;
-
-  static const UriValidationCode URI_WITH_INTERPOLATION =
-      UriValidationCodeImpl.URI_WITH_INTERPOLATION;
-
-  static const UriValidationCode URI_WITH_DART_EXT_SCHEME =
-      UriValidationCodeImpl.URI_WITH_DART_EXT_SCHEME;
 }
 
 /**
diff --git a/pkg/analyzer/lib/dart/ast/ast_factory.dart b/pkg/analyzer/lib/dart/ast/ast_factory.dart
new file mode 100644
index 0000000..ffaf90e
--- /dev/null
+++ b/pkg/analyzer/lib/dart/ast/ast_factory.dart
@@ -0,0 +1,1018 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/src/generated/utilities_dart.dart';
+import 'package:front_end/src/scanner/token.dart';
+
+/**
+ * A collection of factory methods which may be used to create concrete
+ * instances of the interfaces that constitute the AST.
+ *
+ * Clients should not extend, implement or mix-in this class.
+ */
+abstract class AstFactory {
+  /**
+   * Returns a newly created list of adjacent strings. To be syntactically
+   * valid, the list of [strings] must contain at least two elements.
+   */
+  AdjacentStrings adjacentStrings(List<StringLiteral> strings);
+
+  /**
+   * Returns a newly created annotation. Both the [period] and the
+   * [constructorName] can be `null` if the annotation is not referencing a
+   * named constructor. The [arguments] can be `null` if the annotation is not
+   * referencing a constructor.
+   */
+  Annotation annotation(Token atSign, Identifier name, Token period,
+      SimpleIdentifier constructorName, ArgumentList arguments);
+
+  /**
+   * Returns a newly created list of arguments. The list of [arguments] can
+   * be `null` if there are no arguments.
+   */
+  ArgumentList argumentList(Token leftParenthesis, List<Expression> arguments,
+      Token rightParenthesis);
+
+  /**
+   * Returns a newly created as expression.
+   */
+  AsExpression asExpression(
+      Expression expression, Token asOperator, TypeName type);
+
+  /**
+   * Returns a newly created assert initializer. The [comma] and [message]
+   * can be `null` if there is no message.
+   */
+  AssertInitializer assertInitializer(
+      Token assertKeyword,
+      Token leftParenthesis,
+      Expression condition,
+      Token comma,
+      Expression message,
+      Token rightParenthesis);
+
+  /**
+   * Returns a newly created assert statement. The [comma] and [message] can
+   * be `null` if there is no message.
+   */
+  AssertStatement assertStatement(
+      Token assertKeyword,
+      Token leftParenthesis,
+      Expression condition,
+      Token comma,
+      Expression message,
+      Token rightParenthesis,
+      Token semicolon);
+
+  /**
+   * Returns a newly created assignment expression.
+   */
+  AssignmentExpression assignmentExpression(
+      Expression leftHandSide, Token operator, Expression rightHandSide);
+
+  /**
+   * Returns a newly created await expression.
+   */
+  AwaitExpression awaitExpression(Token awaitKeyword, Expression expression);
+
+  /**
+   * Returns a newly created binary expression.
+   */
+  BinaryExpression binaryExpression(
+      Expression leftOperand, Token operator, Expression rightOperand);
+  /**
+   * Returns a newly created block of code.
+   */
+  Block block(
+      Token leftBracket, List<Statement> statements, Token rightBracket);
+
+  /**
+   * Returns a block comment consisting of the given [tokens].
+   */
+  Comment blockComment(List<Token> tokens);
+
+  /**
+   * Returns a newly created function body consisting of a block of
+   * statements. The [keyword] can be `null` if there is no keyword specified
+   * for the block. The [star] can be `null` if there is no star following the
+   * keyword (and must be `null` if there is no keyword).
+   */
+  BlockFunctionBody blockFunctionBody(Token keyword, Token star, Block block);
+
+  /**
+   * Returns a newly created boolean literal.
+   */
+  BooleanLiteral booleanLiteral(Token literal, bool value);
+
+  /**
+   * Returns a newly created break statement. The [label] can be `null` if
+   * there is no label associated with the statement.
+   */
+  BreakStatement breakStatement(
+      Token breakKeyword, SimpleIdentifier label, Token semicolon);
+
+  /**
+   * Returns a newly created cascade expression. The list of
+   * [cascadeSections] must contain at least one element.
+   */
+  CascadeExpression cascadeExpression(
+      Expression target, List<Expression> cascadeSections);
+
+  /**
+   * Returns a newly created catch clause. The [onKeyword] and
+   * [exceptionType] can be `null` if the clause will catch all exceptions. The
+   * [comma] and [stackTraceParameter] can be `null` if the stack trace
+   * parameter is not defined.
+   */
+  CatchClause catchClause(
+      Token onKeyword,
+      TypeName exceptionType,
+      Token catchKeyword,
+      Token leftParenthesis,
+      SimpleIdentifier exceptionParameter,
+      Token comma,
+      SimpleIdentifier stackTraceParameter,
+      Token rightParenthesis,
+      Block body);
+
+  /**
+   * Returns a newly created class declaration. Either or both of the
+   * [comment] and [metadata] can be `null` if the class does not have the
+   * corresponding attribute. The [abstractKeyword] can be `null` if the class
+   * is not abstract. The [typeParameters] can be `null` if the class does not
+   * have any type parameters. Any or all of the [extendsClause], [withClause],
+   * and [implementsClause] can be `null` if the class does not have the
+   * corresponding clause. The list of [members] can be `null` if the class does
+   * not have any members.
+   */
+  ClassDeclaration classDeclaration(
+      Comment comment,
+      List<Annotation> metadata,
+      Token abstractKeyword,
+      Token classKeyword,
+      SimpleIdentifier name,
+      TypeParameterList typeParameters,
+      ExtendsClause extendsClause,
+      WithClause withClause,
+      ImplementsClause implementsClause,
+      Token leftBracket,
+      List<ClassMember> members,
+      Token rightBracket);
+
+  /**
+   * Returns a newly created class type alias. Either or both of the
+   * [comment] and [metadata] can be `null` if the class type alias does not
+   * have the corresponding attribute. The [typeParameters] can be `null` if the
+   * class does not have any type parameters. The [abstractKeyword] can be
+   * `null` if the class is not abstract. The [implementsClause] can be `null`
+   * if the class does not implement any interfaces.
+   */
+  ClassTypeAlias classTypeAlias(
+      Comment comment,
+      List<Annotation> metadata,
+      Token keyword,
+      SimpleIdentifier name,
+      TypeParameterList typeParameters,
+      Token equals,
+      Token abstractKeyword,
+      TypeName superclass,
+      WithClause withClause,
+      ImplementsClause implementsClause,
+      Token semicolon);
+
+  /**
+   * Returns a newly created reference to a Dart element. The [newKeyword]
+   * can be `null` if the reference is not to a constructor.
+   */
+  CommentReference commentReference(Token newKeyword, Identifier identifier);
+
+  /**
+   * Returns a newly created compilation unit to have the given directives
+   * and declarations. The [scriptTag] can be `null` if there is no script tag
+   * in the compilation unit. The list of [directives] can be `null` if there
+   * are no directives in the compilation unit. The list of [declarations] can
+   * be `null` if there are no declarations in the compilation unit.
+   */
+  CompilationUnit compilationUnit(
+      Token beginToken,
+      ScriptTag scriptTag,
+      List<Directive> directives,
+      List<CompilationUnitMember> declarations,
+      Token endToken);
+
+  /**
+   * Returns a newly created conditional expression.
+   */
+  ConditionalExpression conditionalExpression(
+      Expression condition,
+      Token question,
+      Expression thenExpression,
+      Token colon,
+      Expression elseExpression);
+
+  /**
+   * Returns a newly created configuration.
+   */
+  Configuration configuration(
+      Token ifKeyword,
+      Token leftParenthesis,
+      DottedName name,
+      Token equalToken,
+      StringLiteral value,
+      Token rightParenthesis,
+      StringLiteral libraryUri);
+
+  /**
+   * Returns a newly created constructor declaration. The [externalKeyword]
+   * can be `null` if the constructor is not external. Either or both of the
+   * [comment] and [metadata] can be `null` if the constructor does not have the
+   * corresponding attribute. The [constKeyword] can be `null` if the
+   * constructor cannot be used to create a constant. The [factoryKeyword] can
+   * be `null` if the constructor is not a factory. The [period] and [name] can
+   * both be `null` if the constructor is not a named constructor. The
+   * [separator] can be `null` if the constructor does not have any initializers
+   * and does not redirect to a different constructor. The list of
+   * [initializers] can be `null` if the constructor does not have any
+   * initializers. The [redirectedConstructor] can be `null` if the constructor
+   * does not redirect to a different constructor. The [body] can be `null` if
+   * the constructor does not have a body.
+   */
+  ConstructorDeclaration constructorDeclaration(
+      Comment comment,
+      List<Annotation> metadata,
+      Token externalKeyword,
+      Token constKeyword,
+      Token factoryKeyword,
+      Identifier returnType,
+      Token period,
+      SimpleIdentifier name,
+      FormalParameterList parameters,
+      Token separator,
+      List<ConstructorInitializer> initializers,
+      ConstructorName redirectedConstructor,
+      FunctionBody body);
+
+  /**
+   * Returns a newly created field initializer to initialize the field with
+   * the given name to the value of the given expression. The [thisKeyword] and
+   * [period] can be `null` if the 'this' keyword was not specified.
+   */
+  ConstructorFieldInitializer constructorFieldInitializer(
+      Token thisKeyword,
+      Token period,
+      SimpleIdentifier fieldName,
+      Token equals,
+      Expression expression);
+
+  /**
+   * Returns a newly created constructor name. The [period] and [name] can be
+   * `null` if the constructor being named is the unnamed constructor.
+   */
+  ConstructorName constructorName(
+      TypeName type, Token period, SimpleIdentifier name);
+
+  /**
+   * Returns a newly created continue statement. The [label] can be `null` if
+   * there is no label associated with the statement.
+   */
+  ContinueStatement continueStatement(
+      Token continueKeyword, SimpleIdentifier label, Token semicolon);
+
+  /**
+   * Returns a newly created formal parameter. Either or both of the
+   * [comment] and [metadata] can be `null` if the declaration does not have the
+   * corresponding attribute. The [keyword] can be `null` if a type name is
+   * given. The [type] must be `null` if the keyword is 'var'.
+   */
+  DeclaredIdentifier declaredIdentifier(
+      Comment comment,
+      List<Annotation> metadata,
+      Token keyword,
+      TypeName type,
+      SimpleIdentifier identifier);
+
+  /**
+   * Returns a newly created default formal parameter. The [separator] and
+   * [defaultValue] can be `null` if there is no default value.
+   */
+  DefaultFormalParameter defaultFormalParameter(NormalFormalParameter parameter,
+      ParameterKind kind, Token separator, Expression defaultValue);
+
+  /**
+   * Returns a documentation comment consisting of the given [tokens] and having
+   * the given [references] (if supplied) embedded within it.
+   */
+  Comment documentationComment(
+      List<Token> tokens, [List<CommentReference> references]);
+
+  /**
+   * Returns a newly created do loop.
+   */
+  DoStatement doStatement(
+      Token doKeyword,
+      Statement body,
+      Token whileKeyword,
+      Token leftParenthesis,
+      Expression condition,
+      Token rightParenthesis,
+      Token semicolon);
+
+  /**
+   * Returns a newly created dotted name.
+   */
+  DottedName dottedName(List<SimpleIdentifier> components);
+
+  /**
+   * Returns a newly created floating point literal.
+   */
+  DoubleLiteral doubleLiteral(Token literal, double value);
+
+  /**
+   * Returns a newly created function body.
+   */
+  EmptyFunctionBody emptyFunctionBody(Token semicolon);
+
+  /**
+   * Returns a newly created empty statement.
+   */
+  EmptyStatement emptyStatement(Token semicolon);
+
+  /**
+   * Returns an end-of-line comment consisting of the given [tokens].
+   */
+  Comment endOfLineComment(List<Token> tokens);
+
+  /**
+   * Returns a newly created enum constant declaration. Either or both of the
+   * [comment] and [metadata] can be `null` if the constant does not have the
+   * corresponding attribute. (Technically, enum constants cannot have metadata,
+   * but we allow it for consistency.)
+   */
+  EnumConstantDeclaration enumConstantDeclaration(
+      Comment comment, List<Annotation> metadata, SimpleIdentifier name);
+
+  /**
+   * Returns a newly created enumeration declaration. Either or both of the
+   * [comment] and [metadata] can be `null` if the declaration does not have the
+   * corresponding attribute. The list of [constants] must contain at least one
+   * value.
+   */
+  EnumDeclaration enumDeclaration(
+      Comment comment,
+      List<Annotation> metadata,
+      Token enumKeyword,
+      SimpleIdentifier name,
+      Token leftBracket,
+      List<EnumConstantDeclaration> constants,
+      Token rightBracket);
+
+  /**
+   * Returns a newly created export directive. Either or both of the
+   * [comment] and [metadata] can be `null` if the directive does not have the
+   * corresponding attribute. The list of [combinators] can be `null` if there
+   * are no combinators.
+   */
+  ExportDirective exportDirective(
+      Comment comment,
+      List<Annotation> metadata,
+      Token keyword,
+      StringLiteral libraryUri,
+      List<Configuration> configurations,
+      List<Combinator> combinators,
+      Token semicolon);
+  /**
+   * Returns a newly created function body consisting of a block of
+   * statements. The [keyword] can be `null` if the function body is not an
+   * async function body.
+   */
+  ExpressionFunctionBody expressionFunctionBody(Token keyword,
+      Token functionDefinition, Expression expression, Token semicolon);
+
+  /**
+   * Returns a newly created expression statement.
+   */
+  ExpressionStatement expressionStatement(
+      Expression expression, Token semicolon);
+
+  /**
+   * Returns a newly created extends clause.
+   */
+  ExtendsClause extendsClause(Token extendsKeyword, TypeName superclass);
+
+  /**
+   * Returns a newly created field declaration. Either or both of the
+   * [comment] and [metadata] can be `null` if the declaration does not have the
+   * corresponding attribute. The [staticKeyword] can be `null` if the field is
+   * not a static field.
+   */
+  FieldDeclaration fieldDeclaration(Comment comment, List<Annotation> metadata,
+      Token staticKeyword, VariableDeclarationList fieldList, Token semicolon);
+
+  /**
+   * Returns a newly created formal parameter. Either or both of the
+   * [comment] and [metadata] can be `null` if the parameter does not have the
+   * corresponding attribute. The [keyword] can be `null` if there is a type.
+   * The [type] must be `null` if the keyword is 'var'. The [thisKeyword] and
+   * [period] can be `null` if the keyword 'this' was not provided.  The
+   * [parameters] can be `null` if this is not a function-typed field formal
+   * parameter.
+   */
+  FieldFormalParameter fieldFormalParameter(
+      Comment comment,
+      List<Annotation> metadata,
+      Token keyword,
+      TypeName type,
+      Token thisKeyword,
+      Token period,
+      SimpleIdentifier identifier,
+      TypeParameterList typeParameters,
+      FormalParameterList parameters);
+
+  /**
+   * Returns a newly created for-each statement whose loop control variable
+   * is declared internally (in the for-loop part). The [awaitKeyword] can be
+   * `null` if this is not an asynchronous for loop.
+   */
+  ForEachStatement forEachStatementWithDeclaration(
+      Token awaitKeyword,
+      Token forKeyword,
+      Token leftParenthesis,
+      DeclaredIdentifier loopVariable,
+      Token inKeyword,
+      Expression iterator,
+      Token rightParenthesis,
+      Statement body);
+
+  /**
+   * Returns a newly created for-each statement whose loop control variable
+   * is declared outside the for loop. The [awaitKeyword] can be `null` if this
+   * is not an asynchronous for loop.
+   */
+  ForEachStatement forEachStatementWithReference(
+      Token awaitKeyword,
+      Token forKeyword,
+      Token leftParenthesis,
+      SimpleIdentifier identifier,
+      Token inKeyword,
+      Expression iterator,
+      Token rightParenthesis,
+      Statement body);
+
+  /**
+   * Returns a newly created parameter list. The list of [parameters] can be
+   * `null` if there are no parameters. The [leftDelimiter] and [rightDelimiter]
+   * can be `null` if there are no optional parameters.
+   */
+  FormalParameterList formalParameterList(
+      Token leftParenthesis,
+      List<FormalParameter> parameters,
+      Token leftDelimiter,
+      Token rightDelimiter,
+      Token rightParenthesis);
+
+  /**
+   * Returns a newly created for statement. Either the [variableList] or the
+   * [initialization] must be `null`. Either the [condition] and the list of
+   * [updaters] can be `null` if the loop does not have the corresponding
+   * attribute.
+   */
+  ForStatement forStatement(
+      Token forKeyword,
+      Token leftParenthesis,
+      VariableDeclarationList variableList,
+      Expression initialization,
+      Token leftSeparator,
+      Expression condition,
+      Token rightSeparator,
+      List<Expression> updaters,
+      Token rightParenthesis,
+      Statement body);
+
+  /**
+   * Returns a newly created function declaration. Either or both of the
+   * [comment] and [metadata] can be `null` if the function does not have the
+   * corresponding attribute. The [externalKeyword] can be `null` if the
+   * function is not an external function. The [returnType] can be `null` if no
+   * return type was specified. The [propertyKeyword] can be `null` if the
+   * function is neither a getter or a setter.
+   */
+  FunctionDeclaration functionDeclaration(
+      Comment comment,
+      List<Annotation> metadata,
+      Token externalKeyword,
+      TypeName returnType,
+      Token propertyKeyword,
+      SimpleIdentifier name,
+      FunctionExpression functionExpression);
+
+  /**
+   * Returns a newly created function declaration statement.
+   */
+  FunctionDeclarationStatement functionDeclarationStatement(
+      FunctionDeclaration functionDeclaration);
+
+  /**
+   * Returns a newly created function declaration.
+   */
+  FunctionExpression functionExpression(TypeParameterList typeParameters,
+      FormalParameterList parameters, FunctionBody body);
+
+  /**
+   * Returns a newly created function expression invocation.
+   */
+  FunctionExpressionInvocation functionExpressionInvocation(Expression function,
+      TypeArgumentList typeArguments, ArgumentList argumentList);
+
+  /**
+   * Returns a newly created function type alias. Either or both of the
+   * [comment] and [metadata] can be `null` if the function does not have the
+   * corresponding attribute. The [returnType] can be `null` if no return type
+   * was specified. The [typeParameters] can be `null` if the function has no
+   * type parameters.
+   */
+  FunctionTypeAlias functionTypeAlias(
+      Comment comment,
+      List<Annotation> metadata,
+      Token keyword,
+      TypeName returnType,
+      SimpleIdentifier name,
+      TypeParameterList typeParameters,
+      FormalParameterList parameters,
+      Token semicolon);
+
+  /**
+   * Returns a newly created formal parameter. Either or both of the
+   * [comment] and [metadata] can be `null` if the parameter does not have the
+   * corresponding attribute. The [returnType] can be `null` if no return type
+   * was specified.
+   */
+  FunctionTypedFormalParameter functionTypedFormalParameter(
+      Comment comment,
+      List<Annotation> metadata,
+      TypeName returnType,
+      SimpleIdentifier identifier,
+      TypeParameterList typeParameters,
+      FormalParameterList parameters,
+      {Token question: null});
+
+  /**
+   * Returns a newly created import show combinator.
+   */
+  HideCombinator hideCombinator(
+      Token keyword, List<SimpleIdentifier> hiddenNames);
+
+  /**
+   * Returns a newly created if statement. The [elseKeyword] and
+   * [elseStatement] can be `null` if there is no else clause.
+   */
+  IfStatement ifStatement(
+      Token ifKeyword,
+      Token leftParenthesis,
+      Expression condition,
+      Token rightParenthesis,
+      Statement thenStatement,
+      Token elseKeyword,
+      Statement elseStatement);
+
+  /**
+   * Returns a newly created implements clause.
+   */
+  ImplementsClause implementsClause(
+      Token implementsKeyword, List<TypeName> interfaces);
+
+  /**
+   * Returns a newly created import directive. Either or both of the
+   * [comment] and [metadata] can be `null` if the function does not have the
+   * corresponding attribute. The [deferredKeyword] can be `null` if the import
+   * is not deferred. The [asKeyword] and [prefix] can be `null` if the import
+   * does not specify a prefix. The list of [combinators] can be `null` if there
+   * are no combinators.
+   */
+  ImportDirective importDirective(
+      Comment comment,
+      List<Annotation> metadata,
+      Token keyword,
+      StringLiteral libraryUri,
+      List<Configuration> configurations,
+      Token deferredKeyword,
+      Token asKeyword,
+      SimpleIdentifier prefix,
+      List<Combinator> combinators,
+      Token semicolon);
+
+  /**
+   * Returns a newly created index expression.
+   */
+  IndexExpression indexExpressionForCascade(
+      Token period, Token leftBracket, Expression index, Token rightBracket);
+
+  /**
+   * Returns a newly created index expression.
+   */
+  IndexExpression indexExpressionForTarget(Expression target, Token leftBracket,
+      Expression index, Token rightBracket);
+
+  /**
+   * Returns a newly created instance creation expression.
+   */
+  InstanceCreationExpression instanceCreationExpression(Token keyword,
+      ConstructorName constructorName, ArgumentList argumentList);
+
+  /**
+   * Returns a newly created integer literal.
+   */
+  IntegerLiteral integerLiteral(Token literal, int value);
+
+  /**
+   * Returns a newly created interpolation expression.
+   */
+  InterpolationExpression interpolationExpression(
+      Token leftBracket, Expression expression, Token rightBracket);
+
+  /**
+   * Returns a newly created string of characters that are part of a string
+   * interpolation.
+   */
+  InterpolationString interpolationString(Token contents, String value);
+
+  /**
+   * Returns a newly created is expression. The [notOperator] can be `null`
+   * if the sense of the test is not negated.
+   */
+  IsExpression isExpression(Expression expression, Token isOperator,
+      Token notOperator, TypeName type);
+
+  /**
+   * Returns a newly created label.
+   */
+  Label label(SimpleIdentifier label, Token colon);
+
+  /**
+   * Returns a newly created labeled statement.
+   */
+  LabeledStatement labeledStatement(List<Label> labels, Statement statement);
+
+  /**
+   * Returns a newly created library directive. Either or both of the
+   * [comment] and [metadata] can be `null` if the directive does not have the
+   * corresponding attribute.
+   */
+  LibraryDirective libraryDirective(Comment comment, List<Annotation> metadata,
+      Token libraryKeyword, LibraryIdentifier name, Token semicolon);
+
+  /**
+   * Returns a newly created prefixed identifier.
+   */
+  LibraryIdentifier libraryIdentifier(List<SimpleIdentifier> components);
+
+  /**
+   * Returns a newly created list literal. The [constKeyword] can be `null`
+   * if the literal is not a constant. The [typeArguments] can be `null` if no
+   * type arguments were declared. The list of [elements] can be `null` if the
+   * list is empty.
+   */
+  ListLiteral listLiteral(Token constKeyword, TypeArgumentList typeArguments,
+      Token leftBracket, List<Expression> elements, Token rightBracket);
+
+  /**
+   * Returns a newly created map literal. The [constKeyword] can be `null` if
+   * the literal is not a constant. The [typeArguments] can be `null` if no type
+   * arguments were declared. The [entries] can be `null` if the map is empty.
+   */
+  MapLiteral mapLiteral(Token constKeyword, TypeArgumentList typeArguments,
+      Token leftBracket, List<MapLiteralEntry> entries, Token rightBracket);
+
+  /**
+   * Returns a newly created map literal entry.
+   */
+  MapLiteralEntry mapLiteralEntry(
+      Expression key, Token separator, Expression value);
+
+  /**
+   * Returns a newly created method declaration. Either or both of the
+   * [comment] and [metadata] can be `null` if the declaration does not have the
+   * corresponding attribute. The [externalKeyword] can be `null` if the method
+   * is not external. The [modifierKeyword] can be `null` if the method is
+   * neither abstract nor static. The [returnType] can be `null` if no return
+   * type was specified. The [propertyKeyword] can be `null` if the method is
+   * neither a getter or a setter. The [operatorKeyword] can be `null` if the
+   * method does not implement an operator. The [parameters] must be `null` if
+   * this method declares a getter.
+   */
+  MethodDeclaration methodDeclaration(
+      Comment comment,
+      List<Annotation> metadata,
+      Token externalKeyword,
+      Token modifierKeyword,
+      TypeName returnType,
+      Token propertyKeyword,
+      Token operatorKeyword,
+      SimpleIdentifier name,
+      TypeParameterList typeParameters,
+      FormalParameterList parameters,
+      FunctionBody body);
+
+  /**
+   * Returns a newly created method invocation. The [target] and [operator]
+   * can be `null` if there is no target.
+   */
+  MethodInvocation methodInvocation(
+      Expression target,
+      Token operator,
+      SimpleIdentifier methodName,
+      TypeArgumentList typeArguments,
+      ArgumentList argumentList);
+
+  /**
+   * Returns a newly created named expression..
+   */
+  NamedExpression namedExpression(Label name, Expression expression);
+
+  /**
+   * Returns a newly created native clause.
+   */
+  NativeClause nativeClause(Token nativeKeyword, StringLiteral name);
+
+  /**
+   * Returns a newly created function body consisting of the 'native' token,
+   * a string literal, and a semicolon.
+   */
+  NativeFunctionBody nativeFunctionBody(
+      Token nativeKeyword, StringLiteral stringLiteral, Token semicolon);
+
+  /**
+   * Returns a newly created list of nodes such that all of the nodes that
+   * are added to the list will have their parent set to the given [owner]. The
+   * list will initially be populated with the given [elements].
+   */
+  NodeList/*<E>*/ nodeList/*<E extends AstNode>*/(AstNode owner,
+      [List/*<E>*/ elements]);
+
+  /**
+   * Returns a newly created null literal.
+   */
+  NullLiteral nullLiteral(Token literal);
+
+  /**
+   * Returns a newly created parenthesized expression.
+   */
+  ParenthesizedExpression parenthesizedExpression(
+      Token leftParenthesis, Expression expression, Token rightParenthesis);
+
+  /**
+   * Returns a newly created part directive. Either or both of the [comment]
+   * and [metadata] can be `null` if the directive does not have the
+   * corresponding attribute.
+   */
+  PartDirective partDirective(Comment comment, List<Annotation> metadata,
+      Token partKeyword, StringLiteral partUri, Token semicolon);
+
+  /**
+   * Returns a newly created part-of directive. Either or both of the
+   * [comment] and [metadata] can be `null` if the directive does not have the
+   * corresponding attribute.
+   */
+  PartOfDirective partOfDirective(
+      Comment comment,
+      List<Annotation> metadata,
+      Token partKeyword,
+      Token ofKeyword,
+      StringLiteral uri,
+      LibraryIdentifier libraryName,
+      Token semicolon);
+
+  /**
+   * Returns a newly created postfix expression.
+   */
+  PostfixExpression postfixExpression(Expression operand, Token operator);
+
+  /**
+   * Returns a newly created prefixed identifier.
+   */
+  PrefixedIdentifier prefixedIdentifier(
+      SimpleIdentifier prefix, Token period, SimpleIdentifier identifier);
+
+  /**
+   * Returns a newly created prefix expression.
+   */
+  PrefixExpression prefixExpression(Token operator, Expression operand);
+
+  /**
+   * Returns a newly created property access expression.
+   */
+  PropertyAccess propertyAccess(
+      Expression target, Token operator, SimpleIdentifier propertyName);
+
+  /**
+   * Returns a newly created redirecting invocation to invoke the constructor
+   * with the given name with the given arguments. The [constructorName] can be
+   * `null` if the constructor being invoked is the unnamed constructor.
+   */
+  RedirectingConstructorInvocation redirectingConstructorInvocation(
+      Token thisKeyword,
+      Token period,
+      SimpleIdentifier constructorName,
+      ArgumentList argumentList);
+
+  /**
+   * Returns a newly created rethrow expression.
+   */
+  RethrowExpression rethrowExpression(Token rethrowKeyword);
+
+  /**
+   * Returns a newly created return statement. The [expression] can be `null`
+   * if no explicit value was provided.
+   */
+  ReturnStatement returnStatement(
+      Token returnKeyword, Expression expression, Token semicolon);
+
+  /**
+   * Returns a newly created script tag.
+   */
+  ScriptTag scriptTag(Token scriptTag);
+
+  /**
+   * Returns a newly created import show combinator.
+   */
+  ShowCombinator showCombinator(
+      Token keyword, List<SimpleIdentifier> shownNames);
+
+  /**
+   * Returns a newly created formal parameter. Either or both of the
+   * [comment] and [metadata] can be `null` if the parameter does not have the
+   * corresponding attribute. The [keyword] can be `null` if a type was
+   * specified. The [type] must be `null` if the keyword is 'var'.
+   */
+  SimpleFormalParameter simpleFormalParameter(
+      Comment comment,
+      List<Annotation> metadata,
+      Token keyword,
+      TypeName type,
+      SimpleIdentifier identifier);
+
+  /**
+   * Returns a newly created identifier.
+   */
+  SimpleIdentifier simpleIdentifier(Token token, {bool isDeclaration: false});
+
+  /**
+   * Returns a newly created simple string literal.
+   */
+  SimpleStringLiteral simpleStringLiteral(Token literal, String value);
+
+  /**
+   * Returns a newly created string interpolation expression.
+   */
+  StringInterpolation stringInterpolation(List<InterpolationElement> elements);
+
+  /**
+   * Returns a newly created super invocation to invoke the inherited
+   * constructor with the given name with the given arguments. The [period] and
+   * [constructorName] can be `null` if the constructor being invoked is the
+   * unnamed constructor.
+   */
+  SuperConstructorInvocation superConstructorInvocation(
+      Token superKeyword,
+      Token period,
+      SimpleIdentifier constructorName,
+      ArgumentList argumentList);
+
+  /**
+   * Returns a newly created super expression.
+   */
+  SuperExpression superExpression(Token superKeyword);
+
+  /**
+   * Returns a newly created switch case. The list of [labels] can be `null`
+   * if there are no labels.
+   */
+  SwitchCase switchCase(List<Label> labels, Token keyword,
+      Expression expression, Token colon, List<Statement> statements);
+
+  /**
+   * Returns a newly created switch default. The list of [labels] can be
+   * `null` if there are no labels.
+   */
+  SwitchDefault switchDefault(List<Label> labels, Token keyword, Token colon,
+      List<Statement> statements);
+  /**
+   * Returns a newly created switch statement. The list of [members] can be
+   * `null` if there are no switch members.
+   */
+  SwitchStatement switchStatement(
+      Token switchKeyword,
+      Token leftParenthesis,
+      Expression expression,
+      Token rightParenthesis,
+      Token leftBracket,
+      List<SwitchMember> members,
+      Token rightBracket);
+
+  /**
+   * Returns a newly created symbol literal.
+   */
+  SymbolLiteral symbolLiteral(Token poundSign, List<Token> components);
+
+  /**
+   * Returns a newly created this expression.
+   */
+  ThisExpression thisExpression(Token thisKeyword);
+
+  /**
+   * Returns a newly created throw expression.
+   */
+  ThrowExpression throwExpression(Token throwKeyword, Expression expression);
+
+  /**
+   * Returns a newly created top-level variable declaration. Either or both
+   * of the [comment] and [metadata] can be `null` if the variable does not have
+   * the corresponding attribute.
+   */
+  TopLevelVariableDeclaration topLevelVariableDeclaration(
+      Comment comment,
+      List<Annotation> metadata,
+      VariableDeclarationList variableList,
+      Token semicolon);
+
+  /**
+   * Returns a newly created try statement. The list of [catchClauses] can be
+   * `null` if there are no catch clauses. The [finallyKeyword] and
+   * [finallyBlock] can be `null` if there is no finally clause.
+   */
+  TryStatement tryStatement(Token tryKeyword, Block body,
+      List<CatchClause> catchClauses, Token finallyKeyword, Block finallyBlock);
+
+  /**
+   * Returns a newly created list of type arguments.
+   */
+  TypeArgumentList typeArgumentList(
+      Token leftBracket, List<TypeName> arguments, Token rightBracket);
+
+  /**
+   * Returns a newly created type name. The [typeArguments] can be `null` if
+   * there are no type arguments.
+   */
+  TypeName typeName(Identifier name, TypeArgumentList typeArguments,
+      {Token question: null});
+
+  /**
+   * Returns a newly created type parameter. Either or both of the [comment]
+   * and [metadata] can be `null` if the parameter does not have the
+   * corresponding attribute. The [extendsKeyword] and [bound] can be `null` if
+   * the parameter does not have an upper bound.
+   */
+  TypeParameter typeParameter(Comment comment, List<Annotation> metadata,
+      SimpleIdentifier name, Token extendsKeyword, TypeName bound);
+
+  /**
+   * Returns a newly created list of type parameters.
+   */
+  TypeParameterList typeParameterList(Token leftBracket,
+      List<TypeParameter> typeParameters, Token rightBracket);
+
+  /**
+   * Returns a newly created variable declaration. The [equals] and
+   * [initializer] can be `null` if there is no initializer.
+   */
+  VariableDeclaration variableDeclaration(
+      SimpleIdentifier name, Token equals, Expression initializer);
+
+  /**
+   * Returns a newly created variable declaration list. Either or both of the
+   * [comment] and [metadata] can be `null` if the variable list does not have
+   * the corresponding attribute. The [keyword] can be `null` if a type was
+   * specified. The [type] must be `null` if the keyword is 'var'.
+   */
+  VariableDeclarationList variableDeclarationList(
+      Comment comment,
+      List<Annotation> metadata,
+      Token keyword,
+      TypeName type,
+      List<VariableDeclaration> variables);
+
+  /**
+   * Returns a newly created variable declaration statement.
+   */
+  VariableDeclarationStatement variableDeclarationStatement(
+      VariableDeclarationList variableList, Token semicolon);
+
+  /**
+   * Returns a newly created while statement.
+   */
+  WhileStatement whileStatement(Token whileKeyword, Token leftParenthesis,
+      Expression condition, Token rightParenthesis, Statement body);
+
+  /**
+   * Returns a newly created with clause.
+   */
+  WithClause withClause(Token withKeyword, List<TypeName> mixinTypes);
+
+  /**
+   * Returns a newly created yield expression. The [star] can be `null` if no
+   * star was provided.
+   */
+  YieldStatement yieldStatement(
+      Token yieldKeyword, Token star, Expression expression, Token semicolon);
+}
diff --git a/pkg/analyzer/lib/dart/ast/standard_ast_factory.dart b/pkg/analyzer/lib/dart/ast/standard_ast_factory.dart
new file mode 100644
index 0000000..9333242
--- /dev/null
+++ b/pkg/analyzer/lib/dart/ast/standard_ast_factory.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:analyzer/dart/ast/ast_factory.dart';
+import 'package:analyzer/src/dart/ast/ast_factory.dart';
+
+/**
+ * Gets an instance of [AstFactory] based on the standard AST implementation.
+ */
+final AstFactory astFactory = new AstFactoryImpl();
diff --git a/pkg/analyzer/lib/dart/ast/syntactic_entity.dart b/pkg/analyzer/lib/dart/ast/syntactic_entity.dart
index bc8271a..8d6d0dc 100644
--- a/pkg/analyzer/lib/dart/ast/syntactic_entity.dart
+++ b/pkg/analyzer/lib/dart/ast/syntactic_entity.dart
@@ -4,25 +4,4 @@
 
 library analyzer.dart.ast.syntactic_entity;
 
-/**
- * Interface representing a syntactic entity (either a token or an AST node)
- * which has a location and extent in the source file.
- */
-abstract class SyntacticEntity {
-  /**
-   * Return the offset from the beginning of the file to the character after the
-   * last character of the syntactic entity.
-   */
-  int get end;
-
-  /**
-   * Return the number of characters in the syntactic entity's source range.
-   */
-  int get length;
-
-  /**
-   * Return the offset from the beginning of the file to the first character in
-   * the syntactic entity.
-   */
-  int get offset;
-}
+export 'package:front_end/src/base/syntactic_entity.dart' show SyntacticEntity;
diff --git a/pkg/analyzer/lib/dart/ast/token.dart b/pkg/analyzer/lib/dart/ast/token.dart
index fce7f24..a361c5ab 100644
--- a/pkg/analyzer/lib/dart/ast/token.dart
+++ b/pkg/analyzer/lib/dart/ast/token.dart
@@ -8,737 +8,5 @@
  */
 library analyzer.dart.ast.token;
 
-import 'dart:collection';
-
-import 'package:analyzer/dart/ast/syntactic_entity.dart';
-import 'package:analyzer/src/dart/ast/token.dart' show SimpleToken, TokenClass;
-
-/**
- * The keywords in the Dart programming language.
- *
- * Clients may not extend, implement or mix-in this class.
- */
-class Keyword {
-  static const Keyword ABSTRACT = const Keyword._('ABSTRACT', "abstract", true);
-
-  static const Keyword AS = const Keyword._('AS', "as", true);
-
-  static const Keyword ASSERT = const Keyword._('ASSERT', "assert");
-
-  static const Keyword BREAK = const Keyword._('BREAK', "break");
-
-  static const Keyword CASE = const Keyword._('CASE', "case");
-
-  static const Keyword CATCH = const Keyword._('CATCH', "catch");
-
-  static const Keyword CLASS = const Keyword._('CLASS', "class");
-
-  static const Keyword CONST = const Keyword._('CONST', "const");
-
-  static const Keyword CONTINUE = const Keyword._('CONTINUE', "continue");
-
-  static const Keyword DEFAULT = const Keyword._('DEFAULT', "default");
-
-  static const Keyword DEFERRED = const Keyword._('DEFERRED', "deferred", true);
-
-  static const Keyword DO = const Keyword._('DO', "do");
-
-  static const Keyword DYNAMIC = const Keyword._('DYNAMIC', "dynamic", true);
-
-  static const Keyword ELSE = const Keyword._('ELSE', "else");
-
-  static const Keyword ENUM = const Keyword._('ENUM', "enum");
-
-  static const Keyword EXPORT = const Keyword._('EXPORT', "export", true);
-
-  static const Keyword EXTENDS = const Keyword._('EXTENDS', "extends");
-
-  static const Keyword EXTERNAL = const Keyword._('EXTERNAL', "external", true);
-
-  static const Keyword FACTORY = const Keyword._('FACTORY', "factory", true);
-
-  static const Keyword FALSE = const Keyword._('FALSE', "false");
-
-  static const Keyword FINAL = const Keyword._('FINAL', "final");
-
-  static const Keyword FINALLY = const Keyword._('FINALLY', "finally");
-
-  static const Keyword FOR = const Keyword._('FOR', "for");
-
-  static const Keyword GET = const Keyword._('GET', "get", true);
-
-  static const Keyword IF = const Keyword._('IF', "if");
-
-  static const Keyword IMPLEMENTS =
-      const Keyword._('IMPLEMENTS', "implements", true);
-
-  static const Keyword IMPORT = const Keyword._('IMPORT', "import", true);
-
-  static const Keyword IN = const Keyword._('IN', "in");
-
-  static const Keyword IS = const Keyword._('IS', "is");
-
-  static const Keyword LIBRARY = const Keyword._('LIBRARY', "library", true);
-
-  static const Keyword NEW = const Keyword._('NEW', "new");
-
-  static const Keyword NULL = const Keyword._('NULL', "null");
-
-  static const Keyword OPERATOR = const Keyword._('OPERATOR', "operator", true);
-
-  static const Keyword PART = const Keyword._('PART', "part", true);
-
-  static const Keyword RETHROW = const Keyword._('RETHROW', "rethrow");
-
-  static const Keyword RETURN = const Keyword._('RETURN', "return");
-
-  static const Keyword SET = const Keyword._('SET', "set", true);
-
-  static const Keyword STATIC = const Keyword._('STATIC', "static", true);
-
-  static const Keyword SUPER = const Keyword._('SUPER', "super");
-
-  static const Keyword SWITCH = const Keyword._('SWITCH', "switch");
-
-  static const Keyword THIS = const Keyword._('THIS', "this");
-
-  static const Keyword THROW = const Keyword._('THROW', "throw");
-
-  static const Keyword TRUE = const Keyword._('TRUE', "true");
-
-  static const Keyword TRY = const Keyword._('TRY', "try");
-
-  static const Keyword TYPEDEF = const Keyword._('TYPEDEF', "typedef", true);
-
-  static const Keyword VAR = const Keyword._('VAR', "var");
-
-  static const Keyword VOID = const Keyword._('VOID', "void");
-
-  static const Keyword WHILE = const Keyword._('WHILE', "while");
-
-  static const Keyword WITH = const Keyword._('WITH', "with");
-
-  static const List<Keyword> values = const <Keyword>[
-    ABSTRACT,
-    AS,
-    ASSERT,
-    BREAK,
-    CASE,
-    CATCH,
-    CLASS,
-    CONST,
-    CONTINUE,
-    DEFAULT,
-    DEFERRED,
-    DO,
-    DYNAMIC,
-    ELSE,
-    ENUM,
-    EXPORT,
-    EXTENDS,
-    EXTERNAL,
-    FACTORY,
-    FALSE,
-    FINAL,
-    FINALLY,
-    FOR,
-    GET,
-    IF,
-    IMPLEMENTS,
-    IMPORT,
-    IN,
-    IS,
-    LIBRARY,
-    NEW,
-    NULL,
-    OPERATOR,
-    PART,
-    RETHROW,
-    RETURN,
-    SET,
-    STATIC,
-    SUPER,
-    SWITCH,
-    THIS,
-    THROW,
-    TRUE,
-    TRY,
-    TYPEDEF,
-    VAR,
-    VOID,
-    WHILE,
-    WITH,
-  ];
-
-  /**
-   * A table mapping the lexemes of keywords to the corresponding keyword.
-   */
-  static final Map<String, Keyword> keywords = _createKeywordMap();
-
-  /**
-   * The name of the keyword type.
-   */
-  final String name;
-
-  /**
-   * The lexeme for the keyword.
-   */
-  final String syntax;
-
-  /**
-   * A flag indicating whether the keyword is a pseudo-keyword. Pseudo keywords
-   * can be used as identifiers.
-   */
-  final bool isPseudoKeyword;
-
-  /**
-   * Initialize a newly created keyword to have the given [name] and [syntax].
-   * The keyword is a pseudo-keyword if the [isPseudoKeyword] flag is `true`.
-   */
-  const Keyword._(this.name, this.syntax, [this.isPseudoKeyword = false]);
-
-  @override
-  String toString() => name;
-
-  /**
-   * Create a table mapping the lexemes of keywords to the corresponding keyword
-   * and return the table that was created.
-   */
-  static Map<String, Keyword> _createKeywordMap() {
-    LinkedHashMap<String, Keyword> result =
-        new LinkedHashMap<String, Keyword>();
-    for (Keyword keyword in values) {
-      result[keyword.syntax] = keyword;
-    }
-    return result;
-  }
-}
-
-/**
- * A token that was scanned from the input. Each token knows which tokens
- * precede and follow it, acting as a link in a doubly linked list of tokens.
- *
- * Clients may not extend, implement or mix-in this class.
- */
-abstract class Token implements SyntacticEntity {
-  /**
-   * Initialize a newly created token to have the given [type] and [offset].
-   */
-  factory Token(TokenType type, int offset) = SimpleToken;
-
-  @override
-  int get end;
-
-  /**
-   * Return `true` if this token represents an operator.
-   */
-  bool get isOperator;
-
-  /**
-   * Return `true` if this token is a synthetic token. A synthetic token is a
-   * token that was introduced by the parser in order to recover from an error
-   * in the code.
-   */
-  bool get isSynthetic;
-
-  /**
-   * Return `true` if this token represents an operator that can be defined by
-   * users.
-   */
-  bool get isUserDefinableOperator;
-
-  /**
-   * Return the keyword, if a keyword token, or `null` otherwise.
-   */
-  Keyword get keyword;
-
-  @override
-  int get length;
-
-  /**
-   * Return the lexeme that represents this token.
-   */
-  String get lexeme;
-
-  /**
-   * Return the next token in the token stream.
-   */
-  Token get next;
-
-  @override
-  int get offset;
-
-  /**
-   * Set the offset from the beginning of the file to the first character in
-   * the token to the given [offset].
-   */
-  void set offset(int offset);
-
-  /**
-   * Return the first comment in the list of comments that precede this token,
-   * or `null` if there are no comments preceding this token. Additional
-   * comments can be reached by following the token stream using [next] until
-   * `null` is returned.
-   *
-   * For example, if the original contents were `/* one */ /* two */ id`, then
-   * the first preceding comment token will have a lexeme of `/* one */` and
-   * the next comment token will have a lexeme of `/* two */`.
-   */
-  Token get precedingComments;
-
-  /**
-   * Return the previous token in the token stream.
-   */
-  Token get previous;
-
-  /**
-   * Set the previous token in the token stream to the given [token].
-   */
-  void set previous(Token token);
-
-  /**
-   * Return the type of the token.
-   */
-  TokenType get type;
-
-  /**
-   * Apply (add) the given [delta] to this token's offset.
-   */
-  void applyDelta(int delta);
-
-  /**
-   * Return a newly created token that is a copy of this token but that is not a
-   * part of any token stream.
-   */
-  Token copy();
-
-  /**
-   * Copy a linked list of comment tokens identical to the given comment tokens.
-   */
-  Token copyComments(Token token);
-
-  /**
-   * Return `true` if this token has any one of the given [types].
-   */
-  bool matchesAny(List<TokenType> types);
-
-  /**
-   * Set the next token in the token stream to the given [token]. This has the
-   * side-effect of setting this token to be the previous token for the given
-   * token. Return the token that was passed in.
-   */
-  Token setNext(Token token);
-
-  /**
-   * Set the next token in the token stream to the given token without changing
-   * which token is the previous token for the given token. Return the token
-   * that was passed in.
-   */
-  Token setNextWithoutSettingPrevious(Token token);
-
-  /**
-   * Return the value of this token. For keyword tokens, this is the keyword
-   * associated with the token, for other tokens it is the lexeme associated
-   * with the token.
-   */
-  Object value();
-
-  /**
-   * Compare the given [tokens] to find the token that appears first in the
-   * source being parsed. That is, return the left-most of all of the tokens.
-   * The list must be non-`null`, but the elements of the list are allowed to be
-   * `null`. Return the token with the smallest offset, or `null` if the list is
-   * empty or if all of the elements of the list are `null`.
-   */
-  static Token lexicallyFirst(List<Token> tokens) {
-    Token first = null;
-    int offset = -1;
-    int length = tokens.length;
-    for (int i = 0; i < length; i++) {
-      Token token = tokens[i];
-      if (token != null && (offset < 0 || token.offset < offset)) {
-        first = token;
-        offset = token.offset;
-      }
-    }
-    return first;
-  }
-}
-
-/**
- * The types of tokens that can be returned by the scanner.
- *
- * Clients may not extend, implement or mix-in this class.
- */
-class TokenType {
-  /**
-   * The type of the token that marks the start or end of the input.
-   */
-  static const TokenType EOF = const _EndOfFileTokenType();
-
-  static const TokenType DOUBLE = const TokenType._('DOUBLE');
-
-  static const TokenType HEXADECIMAL = const TokenType._('HEXADECIMAL');
-
-  static const TokenType IDENTIFIER = const TokenType._('IDENTIFIER');
-
-  static const TokenType INT = const TokenType._('INT');
-
-  static const TokenType KEYWORD = const TokenType._('KEYWORD');
-
-  static const TokenType MULTI_LINE_COMMENT =
-      const TokenType._('MULTI_LINE_COMMENT');
-
-  static const TokenType SCRIPT_TAG = const TokenType._('SCRIPT_TAG');
-
-  static const TokenType SINGLE_LINE_COMMENT =
-      const TokenType._('SINGLE_LINE_COMMENT');
-
-  static const TokenType STRING = const TokenType._('STRING');
-
-  static const TokenType AMPERSAND =
-      const TokenType._('AMPERSAND', TokenClass.BITWISE_AND_OPERATOR, '&');
-
-  static const TokenType AMPERSAND_AMPERSAND = const TokenType._(
-      'AMPERSAND_AMPERSAND', TokenClass.LOGICAL_AND_OPERATOR, '&&');
-
-  static const TokenType AMPERSAND_AMPERSAND_EQ = const TokenType._(
-      'AMPERSAND_AMPERSAND_EQ', TokenClass.ASSIGNMENT_OPERATOR, '&&=');
-
-  static const TokenType AMPERSAND_EQ =
-      const TokenType._('AMPERSAND_EQ', TokenClass.ASSIGNMENT_OPERATOR, '&=');
-
-  static const TokenType AT = const TokenType._('AT', TokenClass.NO_CLASS, '@');
-
-  static const TokenType BANG =
-      const TokenType._('BANG', TokenClass.UNARY_PREFIX_OPERATOR, '!');
-
-  static const TokenType BANG_EQ =
-      const TokenType._('BANG_EQ', TokenClass.EQUALITY_OPERATOR, '!=');
-
-  static const TokenType BAR =
-      const TokenType._('BAR', TokenClass.BITWISE_OR_OPERATOR, '|');
-
-  static const TokenType BAR_BAR =
-      const TokenType._('BAR_BAR', TokenClass.LOGICAL_OR_OPERATOR, '||');
-
-  static const TokenType BAR_BAR_EQ =
-      const TokenType._('BAR_BAR_EQ', TokenClass.ASSIGNMENT_OPERATOR, '||=');
-
-  static const TokenType BAR_EQ =
-      const TokenType._('BAR_EQ', TokenClass.ASSIGNMENT_OPERATOR, '|=');
-
-  static const TokenType COLON =
-      const TokenType._('COLON', TokenClass.NO_CLASS, ':');
-
-  static const TokenType COMMA =
-      const TokenType._('COMMA', TokenClass.NO_CLASS, ',');
-
-  static const TokenType CARET =
-      const TokenType._('CARET', TokenClass.BITWISE_XOR_OPERATOR, '^');
-
-  static const TokenType CARET_EQ =
-      const TokenType._('CARET_EQ', TokenClass.ASSIGNMENT_OPERATOR, '^=');
-
-  static const TokenType CLOSE_CURLY_BRACKET =
-      const TokenType._('CLOSE_CURLY_BRACKET', TokenClass.NO_CLASS, '}');
-
-  static const TokenType CLOSE_PAREN =
-      const TokenType._('CLOSE_PAREN', TokenClass.NO_CLASS, ')');
-
-  static const TokenType CLOSE_SQUARE_BRACKET =
-      const TokenType._('CLOSE_SQUARE_BRACKET', TokenClass.NO_CLASS, ']');
-
-  static const TokenType EQ =
-      const TokenType._('EQ', TokenClass.ASSIGNMENT_OPERATOR, '=');
-
-  static const TokenType EQ_EQ =
-      const TokenType._('EQ_EQ', TokenClass.EQUALITY_OPERATOR, '==');
-
-  static const TokenType FUNCTION =
-      const TokenType._('FUNCTION', TokenClass.NO_CLASS, '=>');
-
-  static const TokenType GT =
-      const TokenType._('GT', TokenClass.RELATIONAL_OPERATOR, '>');
-
-  static const TokenType GT_EQ =
-      const TokenType._('GT_EQ', TokenClass.RELATIONAL_OPERATOR, '>=');
-
-  static const TokenType GT_GT =
-      const TokenType._('GT_GT', TokenClass.SHIFT_OPERATOR, '>>');
-
-  static const TokenType GT_GT_EQ =
-      const TokenType._('GT_GT_EQ', TokenClass.ASSIGNMENT_OPERATOR, '>>=');
-
-  static const TokenType HASH =
-      const TokenType._('HASH', TokenClass.NO_CLASS, '#');
-
-  static const TokenType INDEX =
-      const TokenType._('INDEX', TokenClass.UNARY_POSTFIX_OPERATOR, '[]');
-
-  static const TokenType INDEX_EQ =
-      const TokenType._('INDEX_EQ', TokenClass.UNARY_POSTFIX_OPERATOR, '[]=');
-
-  static const TokenType IS =
-      const TokenType._('IS', TokenClass.RELATIONAL_OPERATOR, 'is');
-
-  static const TokenType LT =
-      const TokenType._('LT', TokenClass.RELATIONAL_OPERATOR, '<');
-
-  static const TokenType LT_EQ =
-      const TokenType._('LT_EQ', TokenClass.RELATIONAL_OPERATOR, '<=');
-
-  static const TokenType LT_LT =
-      const TokenType._('LT_LT', TokenClass.SHIFT_OPERATOR, '<<');
-
-  static const TokenType LT_LT_EQ =
-      const TokenType._('LT_LT_EQ', TokenClass.ASSIGNMENT_OPERATOR, '<<=');
-
-  static const TokenType MINUS =
-      const TokenType._('MINUS', TokenClass.ADDITIVE_OPERATOR, '-');
-
-  static const TokenType MINUS_EQ =
-      const TokenType._('MINUS_EQ', TokenClass.ASSIGNMENT_OPERATOR, '-=');
-
-  static const TokenType MINUS_MINUS =
-      const TokenType._('MINUS_MINUS', TokenClass.UNARY_PREFIX_OPERATOR, '--');
-
-  static const TokenType OPEN_CURLY_BRACKET =
-      const TokenType._('OPEN_CURLY_BRACKET', TokenClass.NO_CLASS, '{');
-
-  static const TokenType OPEN_PAREN =
-      const TokenType._('OPEN_PAREN', TokenClass.UNARY_POSTFIX_OPERATOR, '(');
-
-  static const TokenType OPEN_SQUARE_BRACKET = const TokenType._(
-      'OPEN_SQUARE_BRACKET', TokenClass.UNARY_POSTFIX_OPERATOR, '[');
-
-  static const TokenType PERCENT =
-      const TokenType._('PERCENT', TokenClass.MULTIPLICATIVE_OPERATOR, '%');
-
-  static const TokenType PERCENT_EQ =
-      const TokenType._('PERCENT_EQ', TokenClass.ASSIGNMENT_OPERATOR, '%=');
-
-  static const TokenType PERIOD =
-      const TokenType._('PERIOD', TokenClass.UNARY_POSTFIX_OPERATOR, '.');
-
-  static const TokenType PERIOD_PERIOD =
-      const TokenType._('PERIOD_PERIOD', TokenClass.CASCADE_OPERATOR, '..');
-
-  static const TokenType PLUS =
-      const TokenType._('PLUS', TokenClass.ADDITIVE_OPERATOR, '+');
-
-  static const TokenType PLUS_EQ =
-      const TokenType._('PLUS_EQ', TokenClass.ASSIGNMENT_OPERATOR, '+=');
-
-  static const TokenType PLUS_PLUS =
-      const TokenType._('PLUS_PLUS', TokenClass.UNARY_PREFIX_OPERATOR, '++');
-
-  static const TokenType QUESTION =
-      const TokenType._('QUESTION', TokenClass.CONDITIONAL_OPERATOR, '?');
-
-  static const TokenType QUESTION_PERIOD = const TokenType._(
-      'QUESTION_PERIOD', TokenClass.UNARY_POSTFIX_OPERATOR, '?.');
-
-  static const TokenType QUESTION_QUESTION =
-      const TokenType._('QUESTION_QUESTION', TokenClass.IF_NULL_OPERATOR, '??');
-
-  static const TokenType QUESTION_QUESTION_EQ = const TokenType._(
-      'QUESTION_QUESTION_EQ', TokenClass.ASSIGNMENT_OPERATOR, '??=');
-
-  static const TokenType SEMICOLON =
-      const TokenType._('SEMICOLON', TokenClass.NO_CLASS, ';');
-
-  static const TokenType SLASH =
-      const TokenType._('SLASH', TokenClass.MULTIPLICATIVE_OPERATOR, '/');
-
-  static const TokenType SLASH_EQ =
-      const TokenType._('SLASH_EQ', TokenClass.ASSIGNMENT_OPERATOR, '/=');
-
-  static const TokenType STAR =
-      const TokenType._('STAR', TokenClass.MULTIPLICATIVE_OPERATOR, '*');
-
-  static const TokenType STAR_EQ =
-      const TokenType._('STAR_EQ', TokenClass.ASSIGNMENT_OPERATOR, "*=");
-
-  static const TokenType STRING_INTERPOLATION_EXPRESSION = const TokenType._(
-      'STRING_INTERPOLATION_EXPRESSION', TokenClass.NO_CLASS, '\${');
-
-  static const TokenType STRING_INTERPOLATION_IDENTIFIER = const TokenType._(
-      'STRING_INTERPOLATION_IDENTIFIER', TokenClass.NO_CLASS, '\$');
-
-  static const TokenType TILDE =
-      const TokenType._('TILDE', TokenClass.UNARY_PREFIX_OPERATOR, '~');
-
-  static const TokenType TILDE_SLASH = const TokenType._(
-      'TILDE_SLASH', TokenClass.MULTIPLICATIVE_OPERATOR, '~/');
-
-  static const TokenType TILDE_SLASH_EQ = const TokenType._(
-      'TILDE_SLASH_EQ', TokenClass.ASSIGNMENT_OPERATOR, '~/=');
-
-  static const TokenType BACKPING =
-      const TokenType._('BACKPING', TokenClass.NO_CLASS, '`');
-
-  static const TokenType BACKSLASH =
-      const TokenType._('BACKSLASH', TokenClass.NO_CLASS, '\\');
-
-  static const TokenType PERIOD_PERIOD_PERIOD =
-      const TokenType._('PERIOD_PERIOD_PERIOD', TokenClass.NO_CLASS, '...');
-
-  static const TokenType GENERIC_METHOD_TYPE_LIST =
-      const TokenType._('GENERIC_METHOD_TYPE_LIST');
-
-  static const TokenType GENERIC_METHOD_TYPE_ASSIGN =
-      const TokenType._('GENERIC_METHOD_TYPE_ASSIGN');
-
-  /**
-   * The class of the token.
-   */
-  final TokenClass _tokenClass;
-
-  /**
-   * The name of the token type.
-   */
-  final String name;
-
-  /**
-   * The lexeme that defines this type of token, or `null` if there is more than
-   * one possible lexeme for this type of token.
-   */
-  final String lexeme;
-
-  /**
-   * Initialize a newly created token type to have the given [name],
-   * [_tokenClass] and [lexeme].
-   */
-  const TokenType._(this.name,
-      [this._tokenClass = TokenClass.NO_CLASS, this.lexeme = null]);
-
-  /**
-   * Return `true` if this type of token represents an additive operator.
-   */
-  bool get isAdditiveOperator => _tokenClass == TokenClass.ADDITIVE_OPERATOR;
-
-  /**
-   * Return `true` if this type of token represents an assignment operator.
-   */
-  bool get isAssignmentOperator =>
-      _tokenClass == TokenClass.ASSIGNMENT_OPERATOR;
-
-  /**
-   * Return `true` if this type of token represents an associative operator. An
-   * associative operator is an operator for which the following equality is
-   * true: `(a * b) * c == a * (b * c)`. In other words, if the result of
-   * applying the operator to multiple operands does not depend on the order in
-   * which those applications occur.
-   *
-   * Note: This method considers the logical-and and logical-or operators to be
-   * associative, even though the order in which the application of those
-   * operators can have an effect because evaluation of the right-hand operand
-   * is conditional.
-   */
-  bool get isAssociativeOperator =>
-      this == AMPERSAND ||
-      this == AMPERSAND_AMPERSAND ||
-      this == BAR ||
-      this == BAR_BAR ||
-      this == CARET ||
-      this == PLUS ||
-      this == STAR;
-
-  /**
-   * Return `true` if this type of token represents an equality operator.
-   */
-  bool get isEqualityOperator => _tokenClass == TokenClass.EQUALITY_OPERATOR;
-
-  /**
-   * Return `true` if this type of token represents an increment operator.
-   */
-  bool get isIncrementOperator =>
-      identical(lexeme, '++') || identical(lexeme, '--');
-
-  /**
-   * Return `true` if this type of token represents a multiplicative operator.
-   */
-  bool get isMultiplicativeOperator =>
-      _tokenClass == TokenClass.MULTIPLICATIVE_OPERATOR;
-
-  /**
-   * Return `true` if this token type represents an operator.
-   */
-  bool get isOperator =>
-      _tokenClass != TokenClass.NO_CLASS &&
-      this != OPEN_PAREN &&
-      this != OPEN_SQUARE_BRACKET &&
-      this != PERIOD;
-
-  /**
-   * Return `true` if this type of token represents a relational operator.
-   */
-  bool get isRelationalOperator =>
-      _tokenClass == TokenClass.RELATIONAL_OPERATOR;
-
-  /**
-   * Return `true` if this type of token represents a shift operator.
-   */
-  bool get isShiftOperator => _tokenClass == TokenClass.SHIFT_OPERATOR;
-
-  /**
-   * Return `true` if this type of token represents a unary postfix operator.
-   */
-  bool get isUnaryPostfixOperator =>
-      _tokenClass == TokenClass.UNARY_POSTFIX_OPERATOR;
-
-  /**
-   * Return `true` if this type of token represents a unary prefix operator.
-   */
-  bool get isUnaryPrefixOperator =>
-      _tokenClass == TokenClass.UNARY_PREFIX_OPERATOR;
-
-  /**
-   * Return `true` if this token type represents an operator that can be defined
-   * by users.
-   */
-  bool get isUserDefinableOperator =>
-      identical(lexeme, '==') ||
-      identical(lexeme, '~') ||
-      identical(lexeme, '[]') ||
-      identical(lexeme, '[]=') ||
-      identical(lexeme, '*') ||
-      identical(lexeme, '/') ||
-      identical(lexeme, '%') ||
-      identical(lexeme, '~/') ||
-      identical(lexeme, '+') ||
-      identical(lexeme, '-') ||
-      identical(lexeme, '<<') ||
-      identical(lexeme, '>>') ||
-      identical(lexeme, '>=') ||
-      identical(lexeme, '>') ||
-      identical(lexeme, '<=') ||
-      identical(lexeme, '<') ||
-      identical(lexeme, '&') ||
-      identical(lexeme, '^') ||
-      identical(lexeme, '|');
-
-  /**
-   * Return the precedence of the token, or `0` if the token does not represent
-   * an operator.
-   */
-  int get precedence => _tokenClass.precedence;
-
-  @override
-  String toString() => name;
-}
-
-/**
- * A token representing the end (either the head or the tail) of a stream of
- * tokens.
- */
-class _EndOfFileTokenType extends TokenType {
-  /**
-   * Initialize a newly created token.
-   */
-  const _EndOfFileTokenType() : super._('EOF', TokenClass.NO_CLASS, '');
-
-  @override
-  String toString() => '-eof-';
-}
+export 'package:front_end/src/scanner/token.dart'
+    show Keyword, Token, TokenType;
diff --git a/pkg/analyzer/lib/dart/ast/visitor.dart b/pkg/analyzer/lib/dart/ast/visitor.dart
index 989e7c6..ad96bed 100644
--- a/pkg/analyzer/lib/dart/ast/visitor.dart
+++ b/pkg/analyzer/lib/dart/ast/visitor.dart
@@ -108,787 +108,23 @@
  *
  * Clients may not extend, implement or mix-in this class.
  */
-class DelegatingAstVisitor<T> implements AstVisitor<T> {
+class DelegatingAstVisitor<T> extends UnifyingAstVisitor<T> {
   /**
    * The delegates whose visit methods will be invoked.
    */
-  final Iterable<AstVisitor<T>> _delegates;
+  final Iterable<AstVisitor<T>> delegates;
 
   /**
    * Initialize a newly created visitor to use each of the given delegate
    * visitors to visit the nodes of an AST structure.
    */
-  DelegatingAstVisitor(this._delegates);
+  DelegatingAstVisitor(this.delegates);
 
   @override
-  T visitAdjacentStrings(AdjacentStrings node) {
-    _delegates.forEach((delegate) => delegate.visitAdjacentStrings(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitAnnotation(Annotation node) {
-    _delegates.forEach((delegate) => delegate.visitAnnotation(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitArgumentList(ArgumentList node) {
-    _delegates.forEach((delegate) => delegate.visitArgumentList(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitAsExpression(AsExpression node) {
-    _delegates.forEach((delegate) => delegate.visitAsExpression(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitAssertStatement(AssertStatement node) {
-    _delegates.forEach((delegate) => delegate.visitAssertStatement(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitAssignmentExpression(AssignmentExpression node) {
-    _delegates.forEach((delegate) => delegate.visitAssignmentExpression(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitAwaitExpression(AwaitExpression node) {
-    _delegates.forEach((delegate) => delegate.visitAwaitExpression(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitBinaryExpression(BinaryExpression node) {
-    _delegates.forEach((delegate) => delegate.visitBinaryExpression(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitBlock(Block node) {
-    _delegates.forEach((delegate) => delegate.visitBlock(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitBlockFunctionBody(BlockFunctionBody node) {
-    _delegates.forEach((delegate) => delegate.visitBlockFunctionBody(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitBooleanLiteral(BooleanLiteral node) {
-    _delegates.forEach((delegate) => delegate.visitBooleanLiteral(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitBreakStatement(BreakStatement node) {
-    _delegates.forEach((delegate) => delegate.visitBreakStatement(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitCascadeExpression(CascadeExpression node) {
-    _delegates.forEach((delegate) => delegate.visitCascadeExpression(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitCatchClause(CatchClause node) {
-    _delegates.forEach((delegate) => delegate.visitCatchClause(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitClassDeclaration(ClassDeclaration node) {
-    _delegates.forEach((delegate) => delegate.visitClassDeclaration(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitClassTypeAlias(ClassTypeAlias node) {
-    _delegates.forEach((delegate) => delegate.visitClassTypeAlias(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitComment(Comment node) {
-    _delegates.forEach((delegate) => delegate.visitComment(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitCommentReference(CommentReference node) {
-    _delegates.forEach((delegate) => delegate.visitCommentReference(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitCompilationUnit(CompilationUnit node) {
-    _delegates.forEach((delegate) => delegate.visitCompilationUnit(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitConditionalExpression(ConditionalExpression node) {
-    _delegates.forEach((delegate) => delegate.visitConditionalExpression(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitConfiguration(Configuration node) {
-    _delegates.forEach((delegate) => delegate.visitConfiguration(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitConstructorDeclaration(ConstructorDeclaration node) {
-    _delegates
-        .forEach((delegate) => delegate.visitConstructorDeclaration(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
-    _delegates
-        .forEach((delegate) => delegate.visitConstructorFieldInitializer(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitConstructorName(ConstructorName node) {
-    _delegates.forEach((delegate) => delegate.visitConstructorName(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitContinueStatement(ContinueStatement node) {
-    _delegates.forEach((delegate) => delegate.visitContinueStatement(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitDeclaredIdentifier(DeclaredIdentifier node) {
-    _delegates.forEach((delegate) => delegate.visitDeclaredIdentifier(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitDefaultFormalParameter(DefaultFormalParameter node) {
-    _delegates
-        .forEach((delegate) => delegate.visitDefaultFormalParameter(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitDoStatement(DoStatement node) {
-    _delegates.forEach((delegate) => delegate.visitDoStatement(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitDottedName(DottedName node) {
-    _delegates.forEach((delegate) => delegate.visitDottedName(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitDoubleLiteral(DoubleLiteral node) {
-    _delegates.forEach((delegate) => delegate.visitDoubleLiteral(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitEmptyFunctionBody(EmptyFunctionBody node) {
-    _delegates.forEach((delegate) => delegate.visitEmptyFunctionBody(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitEmptyStatement(EmptyStatement node) {
-    _delegates.forEach((delegate) => delegate.visitEmptyStatement(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitEnumConstantDeclaration(EnumConstantDeclaration node) {
-    _delegates
-        .forEach((delegate) => delegate.visitEnumConstantDeclaration(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitEnumDeclaration(EnumDeclaration node) {
-    _delegates.forEach((delegate) => delegate.visitEnumDeclaration(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitExportDirective(ExportDirective node) {
-    _delegates.forEach((delegate) => delegate.visitExportDirective(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitExpressionFunctionBody(ExpressionFunctionBody node) {
-    _delegates
-        .forEach((delegate) => delegate.visitExpressionFunctionBody(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitExpressionStatement(ExpressionStatement node) {
-    _delegates.forEach((delegate) => delegate.visitExpressionStatement(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitExtendsClause(ExtendsClause node) {
-    _delegates.forEach((delegate) => delegate.visitExtendsClause(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitFieldDeclaration(FieldDeclaration node) {
-    _delegates.forEach((delegate) => delegate.visitFieldDeclaration(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitFieldFormalParameter(FieldFormalParameter node) {
-    _delegates.forEach((delegate) => delegate.visitFieldFormalParameter(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitForEachStatement(ForEachStatement node) {
-    _delegates.forEach((delegate) => delegate.visitForEachStatement(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitFormalParameterList(FormalParameterList node) {
-    _delegates.forEach((delegate) => delegate.visitFormalParameterList(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitForStatement(ForStatement node) {
-    _delegates.forEach((delegate) => delegate.visitForStatement(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitFunctionDeclaration(FunctionDeclaration node) {
-    _delegates.forEach((delegate) => delegate.visitFunctionDeclaration(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitFunctionDeclarationStatement(FunctionDeclarationStatement node) {
-    _delegates.forEach(
-        (delegate) => delegate.visitFunctionDeclarationStatement(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitFunctionExpression(FunctionExpression node) {
-    _delegates.forEach((delegate) => delegate.visitFunctionExpression(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
-    _delegates.forEach(
-        (delegate) => delegate.visitFunctionExpressionInvocation(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitFunctionTypeAlias(FunctionTypeAlias node) {
-    _delegates.forEach((delegate) => delegate.visitFunctionTypeAlias(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
-    _delegates.forEach(
-        (delegate) => delegate.visitFunctionTypedFormalParameter(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitHideCombinator(HideCombinator node) {
-    _delegates.forEach((delegate) => delegate.visitHideCombinator(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitIfStatement(IfStatement node) {
-    _delegates.forEach((delegate) => delegate.visitIfStatement(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitImplementsClause(ImplementsClause node) {
-    _delegates.forEach((delegate) => delegate.visitImplementsClause(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitImportDirective(ImportDirective node) {
-    _delegates.forEach((delegate) => delegate.visitImportDirective(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitIndexExpression(IndexExpression node) {
-    _delegates.forEach((delegate) => delegate.visitIndexExpression(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitInstanceCreationExpression(InstanceCreationExpression node) {
-    _delegates
-        .forEach((delegate) => delegate.visitInstanceCreationExpression(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitIntegerLiteral(IntegerLiteral node) {
-    _delegates.forEach((delegate) => delegate.visitIntegerLiteral(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitInterpolationExpression(InterpolationExpression node) {
-    _delegates
-        .forEach((delegate) => delegate.visitInterpolationExpression(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitInterpolationString(InterpolationString node) {
-    _delegates.forEach((delegate) => delegate.visitInterpolationString(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitIsExpression(IsExpression node) {
-    _delegates.forEach((delegate) => delegate.visitIsExpression(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitLabel(Label node) {
-    _delegates.forEach((delegate) => delegate.visitLabel(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitLabeledStatement(LabeledStatement node) {
-    _delegates.forEach((delegate) => delegate.visitLabeledStatement(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitLibraryDirective(LibraryDirective node) {
-    _delegates.forEach((delegate) => delegate.visitLibraryDirective(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitLibraryIdentifier(LibraryIdentifier node) {
-    _delegates.forEach((delegate) => delegate.visitLibraryIdentifier(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitListLiteral(ListLiteral node) {
-    _delegates.forEach((delegate) => delegate.visitListLiteral(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitMapLiteral(MapLiteral node) {
-    _delegates.forEach((delegate) => delegate.visitMapLiteral(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitMapLiteralEntry(MapLiteralEntry node) {
-    _delegates.forEach((delegate) => delegate.visitMapLiteralEntry(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitMethodDeclaration(MethodDeclaration node) {
-    _delegates.forEach((delegate) => delegate.visitMethodDeclaration(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitMethodInvocation(MethodInvocation node) {
-    _delegates.forEach((delegate) => delegate.visitMethodInvocation(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitNamedExpression(NamedExpression node) {
-    _delegates.forEach((delegate) => delegate.visitNamedExpression(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitNativeClause(NativeClause node) {
-    _delegates.forEach((delegate) => delegate.visitNativeClause(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitNativeFunctionBody(NativeFunctionBody node) {
-    _delegates.forEach((delegate) => delegate.visitNativeFunctionBody(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitNullLiteral(NullLiteral node) {
-    _delegates.forEach((delegate) => delegate.visitNullLiteral(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitParenthesizedExpression(ParenthesizedExpression node) {
-    _delegates
-        .forEach((delegate) => delegate.visitParenthesizedExpression(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitPartDirective(PartDirective node) {
-    _delegates.forEach((delegate) => delegate.visitPartDirective(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitPartOfDirective(PartOfDirective node) {
-    _delegates.forEach((delegate) => delegate.visitPartOfDirective(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitPostfixExpression(PostfixExpression node) {
-    _delegates.forEach((delegate) => delegate.visitPostfixExpression(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitPrefixedIdentifier(PrefixedIdentifier node) {
-    _delegates.forEach((delegate) => delegate.visitPrefixedIdentifier(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitPrefixExpression(PrefixExpression node) {
-    _delegates.forEach((delegate) => delegate.visitPrefixExpression(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitPropertyAccess(PropertyAccess node) {
-    _delegates.forEach((delegate) => delegate.visitPropertyAccess(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitRedirectingConstructorInvocation(
-      RedirectingConstructorInvocation node) {
-    _delegates.forEach(
-        (delegate) => delegate.visitRedirectingConstructorInvocation(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitRethrowExpression(RethrowExpression node) {
-    _delegates.forEach((delegate) => delegate.visitRethrowExpression(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitReturnStatement(ReturnStatement node) {
-    _delegates.forEach((delegate) => delegate.visitReturnStatement(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitScriptTag(ScriptTag node) {
-    _delegates.forEach((delegate) => delegate.visitScriptTag(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitShowCombinator(ShowCombinator node) {
-    _delegates.forEach((delegate) => delegate.visitShowCombinator(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitSimpleFormalParameter(SimpleFormalParameter node) {
-    _delegates.forEach((delegate) => delegate.visitSimpleFormalParameter(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitSimpleIdentifier(SimpleIdentifier node) {
-    _delegates.forEach((delegate) => delegate.visitSimpleIdentifier(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitSimpleStringLiteral(SimpleStringLiteral node) {
-    _delegates.forEach((delegate) => delegate.visitSimpleStringLiteral(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitStringInterpolation(StringInterpolation node) {
-    _delegates.forEach((delegate) => delegate.visitStringInterpolation(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitSuperConstructorInvocation(SuperConstructorInvocation node) {
-    _delegates
-        .forEach((delegate) => delegate.visitSuperConstructorInvocation(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitSuperExpression(SuperExpression node) {
-    _delegates.forEach((delegate) => delegate.visitSuperExpression(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitSwitchCase(SwitchCase node) {
-    _delegates.forEach((delegate) => delegate.visitSwitchCase(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitSwitchDefault(SwitchDefault node) {
-    _delegates.forEach((delegate) => delegate.visitSwitchDefault(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitSwitchStatement(SwitchStatement node) {
-    _delegates.forEach((delegate) => delegate.visitSwitchStatement(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitSymbolLiteral(SymbolLiteral node) {
-    _delegates.forEach((delegate) => delegate.visitSymbolLiteral(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitThisExpression(ThisExpression node) {
-    _delegates.forEach((delegate) => delegate.visitThisExpression(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitThrowExpression(ThrowExpression node) {
-    _delegates.forEach((delegate) => delegate.visitThrowExpression(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
-    _delegates
-        .forEach((delegate) => delegate.visitTopLevelVariableDeclaration(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitTryStatement(TryStatement node) {
-    _delegates.forEach((delegate) => delegate.visitTryStatement(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitTypeArgumentList(TypeArgumentList node) {
-    _delegates.forEach((delegate) => delegate.visitTypeArgumentList(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitTypeName(TypeName node) {
-    _delegates.forEach((delegate) => delegate.visitTypeName(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitTypeParameter(TypeParameter node) {
-    _delegates.forEach((delegate) => delegate.visitTypeParameter(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitTypeParameterList(TypeParameterList node) {
-    _delegates.forEach((delegate) => delegate.visitTypeParameterList(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitVariableDeclaration(VariableDeclaration node) {
-    _delegates.forEach((delegate) => delegate.visitVariableDeclaration(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitVariableDeclarationList(VariableDeclarationList node) {
-    _delegates
-        .forEach((delegate) => delegate.visitVariableDeclarationList(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitVariableDeclarationStatement(VariableDeclarationStatement node) {
-    _delegates.forEach(
-        (delegate) => delegate.visitVariableDeclarationStatement(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitWhileStatement(WhileStatement node) {
-    _delegates.forEach((delegate) => delegate.visitWhileStatement(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitWithClause(WithClause node) {
-    _delegates.forEach((delegate) => delegate.visitWithClause(node));
-    node.visitChildren(this);
-    return null;
-  }
-
-  @override
-  T visitYieldStatement(YieldStatement node) {
-    _delegates.forEach((delegate) => delegate.visitYieldStatement(node));
+  T visitNode(AstNode node) {
+    delegates.forEach((delegate) {
+      node.accept(delegate);
+    });
     node.visitChildren(this);
     return null;
   }
@@ -929,6 +165,9 @@
   R visitAsExpression(AsExpression node) => visitExpression(node);
 
   @override
+  R visitAssertInitializer(AssertInitializer node) => visitNode(node);
+
+  @override
   R visitAssertStatement(AssertStatement node) => visitStatement(node);
 
   @override
@@ -1087,7 +326,7 @@
 
   @override
   R visitFunctionExpressionInvocation(FunctionExpressionInvocation node) =>
-      visitExpression(node);
+      visitInvocationExpression(node);
 
   @override
   R visitFunctionTypeAlias(FunctionTypeAlias node) => visitTypeAlias(node);
@@ -1130,6 +369,9 @@
   R visitInterpolationString(InterpolationString node) =>
       visitInterpolationElement(node);
 
+  R visitInvocationExpression(InvocationExpression node) =>
+      visitExpression(node);
+
   @override
   R visitIsExpression(IsExpression node) => visitExpression(node);
 
@@ -1160,7 +402,8 @@
   R visitMethodDeclaration(MethodDeclaration node) => visitClassMember(node);
 
   @override
-  R visitMethodInvocation(MethodInvocation node) => visitExpression(node);
+  R visitMethodInvocation(MethodInvocation node) =>
+      visitInvocationExpression(node);
 
   R visitNamedCompilationUnitMember(NamedCompilationUnitMember node) =>
       visitCompilationUnitMember(node);
@@ -1361,6 +604,12 @@
   }
 
   @override
+  R visitAssertInitializer(AssertInitializer node) {
+    node.visitChildren(this);
+    return null;
+  }
+
+  @override
   R visitAssertStatement(AssertStatement node) {
     node.visitChildren(this);
     return null;
@@ -2008,6 +1257,9 @@
   R visitAsExpression(AsExpression node) => null;
 
   @override
+  R visitAssertInitializer(AssertInitializer node) => null;
+
+  @override
   R visitAssertStatement(AssertStatement node) => null;
 
   @override
@@ -2380,6 +1632,14 @@
   }
 
   @override
+  T visitAssertInitializer(AssertInitializer node) {
+    stopwatch.start();
+    T result = _baseVisitor.visitAssertInitializer(node);
+    stopwatch.stop();
+    return result;
+  }
+
+  @override
   T visitAssertStatement(AssertStatement node) {
     stopwatch.start();
     T result = _baseVisitor.visitAssertStatement(node);
@@ -3239,6 +2499,9 @@
   R visitAsExpression(AsExpression node) => visitNode(node);
 
   @override
+  R visitAssertInitializer(AssertInitializer node) => visitNode(node);
+
+  @override
   R visitAssertStatement(AssertStatement node) => visitNode(node);
 
   @override
diff --git a/pkg/analyzer/lib/dart/element/type.dart b/pkg/analyzer/lib/dart/element/type.dart
index 11c97e8..b6923a0 100644
--- a/pkg/analyzer/lib/dart/element/type.dart
+++ b/pkg/analyzer/lib/dart/element/type.dart
@@ -700,4 +700,19 @@
 
   @override
   TypeParameterElement get element;
+
+  /**
+   * Return the type representing the bound associated with this parameter,
+   * or `dynamic` if there was no explicit bound.
+   */
+  DartType get bound;
+
+  /**
+   * An object that can be used to identify this type parameter with `==`.
+   *
+   * Depending on the use, [bound] may also need to be taken into account.
+   * A given type parameter, it may have different bounds in different scopes.
+   * Always consult the bound if that could be relevant.
+   */
+  ElementLocation get definition;
 }
diff --git a/pkg/analyzer/lib/error/error.dart b/pkg/analyzer/lib/error/error.dart
index 712e6ae..8a4f9e8 100644
--- a/pkg/analyzer/lib/error/error.dart
+++ b/pkg/analyzer/lib/error/error.dart
@@ -13,6 +13,629 @@
 import 'package:analyzer/src/generated/java_core.dart';
 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode;
 import 'package:analyzer/src/generated/source.dart';
+import 'package:front_end/src/base/errors.dart';
+import 'package:front_end/src/scanner/errors.dart';
+
+export 'package:front_end/src/base/errors.dart'
+    show ErrorCode, ErrorSeverity, ErrorType;
+
+const List<ErrorCode> errorCodeValues = const [
+  //
+  // Manually generated. You can mostly reproduce this list by running the
+  // following command from the root of the analyzer package:
+  //
+  // > cat
+  //       lib/src/analysis_options/error/option_codes.dart';
+  //       lib/src/dart/error/hint_codes.dart';
+  //       lib/src/dart/error/lint_codes.dart';
+  //       lib/src/dart/error/todo_codes.dart';
+  //       lib/src/html/error/html_codes.dart';
+  //       lib/src/dart/error/syntactic_errors.dart
+  //       lib/src/error/codes.dart
+  //       ../front_end/lib/src/scanner/errors.dart |
+  //     grep 'static const .*Code' |
+  //     awk '{print $3"."$4","}' |
+  //     sort > codes.txt
+  //
+  // There are a few error codes that are wrapped such that the name of the
+  // error code in on the line following the pattern we're grepping for. Those
+  // need to be filled in by hand.
+  //
+  AnalysisOptionsErrorCode.PARSE_ERROR,
+  AnalysisOptionsWarningCode.UNRECOGNIZED_ERROR_CODE,
+  AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE,
+  AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUES,
+  AnalysisOptionsWarningCode.UNSUPPORTED_VALUE,
+  CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH,
+  CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
+  CheckedModeCompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE,
+  CheckedModeCompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE,
+  CheckedModeCompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE,
+  CheckedModeCompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE,
+  CheckedModeCompileTimeErrorCode.VARIABLE_TYPE_MISMATCH,
+  CompileTimeErrorCode.ACCESS_PRIVATE_ENUM_FIELD,
+  CompileTimeErrorCode.AMBIGUOUS_EXPORT,
+  CompileTimeErrorCode.ANNOTATION_WITH_NON_CLASS,
+  CompileTimeErrorCode.ARGUMENT_DEFINITION_TEST_NON_PARAMETER,
+  CompileTimeErrorCode.ASYNC_FOR_IN_WRONG_CONTEXT,
+  CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT,
+  CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE,
+  CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME,
+  CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME,
+  CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME,
+  CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS,
+  CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD,
+  CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD,
+  CompileTimeErrorCode.CONFLICTING_GETTER_AND_METHOD,
+  CompileTimeErrorCode.CONFLICTING_METHOD_AND_GETTER,
+  CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_CLASS,
+  CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER,
+  CompileTimeErrorCode.CONST_CONSTRUCTOR_THROWS_EXCEPTION,
+  CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST,
+  CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN,
+  CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER,
+  CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD,
+  CompileTimeErrorCode.CONST_DEFERRED_CLASS,
+  CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
+  CompileTimeErrorCode.CONST_EVAL_THROWS_IDBZE,
+  CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL,
+  CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING,
+  CompileTimeErrorCode.CONST_EVAL_TYPE_INT,
+  CompileTimeErrorCode.CONST_EVAL_TYPE_NUM,
+  CompileTimeErrorCode.CONST_FORMAL_PARAMETER,
+  CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE,
+  CompileTimeErrorCode
+      .CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY,
+  CompileTimeErrorCode.CONST_INSTANCE_FIELD,
+  CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS,
+  CompileTimeErrorCode.CONST_NOT_INITIALIZED,
+  CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS,
+  CompileTimeErrorCode.CONST_WITH_NON_CONST,
+  CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT,
+  CompileTimeErrorCode.CONST_WITH_NON_TYPE,
+  CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS,
+  CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR,
+  CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT,
+  CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER,
+  CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS,
+  CompileTimeErrorCode.DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR,
+  CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT,
+  CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_NAME,
+  CompileTimeErrorCode.DUPLICATE_DEFINITION,
+  CompileTimeErrorCode.DUPLICATE_DEFINITION_INHERITANCE,
+  CompileTimeErrorCode.DUPLICATE_NAMED_ARGUMENT,
+  CompileTimeErrorCode.DUPLICATE_PART,
+  CompileTimeErrorCode.EXPORT_INTERNAL_LIBRARY,
+  CompileTimeErrorCode.EXPORT_OF_NON_LIBRARY,
+  CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS,
+  CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
+  CompileTimeErrorCode.EXTENDS_ENUM,
+  CompileTimeErrorCode.EXTENDS_NON_CLASS,
+  CompileTimeErrorCode.EXTRA_ARGUMENT_TO_ASSERT,
+  CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS,
+  CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS,
+  CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER,
+  CompileTimeErrorCode.FIELD_INITIALIZER_FACTORY_CONSTRUCTOR,
+  CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR,
+  CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR,
+  CompileTimeErrorCode.FINAL_INITIALIZED_MULTIPLE_TIMES,
+  CompileTimeErrorCode.GETTER_AND_METHOD_WITH_SAME_NAME,
+  CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS,
+  CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS,
+  CompileTimeErrorCode.IMPLEMENTS_DYNAMIC,
+  CompileTimeErrorCode.IMPLEMENTS_ENUM,
+  CompileTimeErrorCode.IMPLEMENTS_NON_CLASS,
+  CompileTimeErrorCode.IMPLEMENTS_REPEATED,
+  CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS,
+  CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER,
+  CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY,
+  CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY,
+  CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES,
+  CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD,
+  CompileTimeErrorCode.INITIALIZER_FOR_STATIC_FIELD,
+  CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD,
+  CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_STATIC_FIELD,
+  CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY,
+  CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC,
+  CompileTimeErrorCode.INSTANTIATE_ENUM,
+  CompileTimeErrorCode.INVALID_ANNOTATION,
+  CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY,
+  CompileTimeErrorCode.INVALID_CONSTANT,
+  CompileTimeErrorCode.INVALID_CONSTRUCTOR_NAME,
+  CompileTimeErrorCode.INVALID_FACTORY_NAME_NOT_A_CLASS,
+  CompileTimeErrorCode.INVALID_IDENTIFIER_IN_ASYNC,
+  CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR,
+  CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER,
+  CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS,
+  CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST,
+  CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP,
+  CompileTimeErrorCode.INVALID_URI,
+  CompileTimeErrorCode.LABEL_IN_OUTER_SCOPE,
+  CompileTimeErrorCode.LABEL_UNDEFINED,
+  CompileTimeErrorCode.MEMBER_WITH_CLASS_NAME,
+  CompileTimeErrorCode.METHOD_AND_GETTER_WITH_SAME_NAME,
+  CompileTimeErrorCode.MISSING_CONST_IN_LIST_LITERAL,
+  CompileTimeErrorCode.MISSING_CONST_IN_MAP_LITERAL,
+  CompileTimeErrorCode.MIXIN_DECLARES_CONSTRUCTOR,
+  CompileTimeErrorCode.MIXIN_DEFERRED_CLASS,
+  CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS,
+  CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT,
+  CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS,
+  CompileTimeErrorCode.MIXIN_OF_ENUM,
+  CompileTimeErrorCode.MIXIN_OF_NON_CLASS,
+  CompileTimeErrorCode.MIXIN_REFERENCES_SUPER,
+  CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS,
+  CompileTimeErrorCode.MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS,
+  CompileTimeErrorCode.MULTIPLE_SUPER_INITIALIZERS,
+  CompileTimeErrorCode.NON_CONSTANT_ANNOTATION_CONSTRUCTOR,
+  CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION,
+  CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY,
+  CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE,
+  CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY,
+  CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT,
+  CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY,
+  CompileTimeErrorCode.NON_CONSTANT_MAP_KEY,
+  CompileTimeErrorCode.NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY,
+  CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE,
+  CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY,
+  CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER,
+  CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY,
+  CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT,
+  CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR,
+  CompileTimeErrorCode.NOT_ENOUGH_REQUIRED_ARGUMENTS,
+  CompileTimeErrorCode.NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS,
+  CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT,
+  CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT,
+  CompileTimeErrorCode.OBJECT_CANNOT_EXTEND_ANOTHER_CLASS,
+  CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR,
+  CompileTimeErrorCode.PART_OF_NON_PART,
+  CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER,
+  CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT,
+  CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER,
+  CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT,
+  CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT,
+  CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+  CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+  CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS,
+  CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS,
+  CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH,
+  CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR,
+  CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR,
+  CompileTimeErrorCode.REDIRECT_TO_MISSING_CONSTRUCTOR,
+  CompileTimeErrorCode.REDIRECT_TO_NON_CLASS,
+  CompileTimeErrorCode.REDIRECT_TO_NON_CONST_CONSTRUCTOR,
+  CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION,
+  CompileTimeErrorCode.RETHROW_OUTSIDE_CATCH,
+  CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR,
+  CompileTimeErrorCode.RETURN_IN_GENERATOR,
+  CompileTimeErrorCode.SHARED_DEFERRED_PREFIX,
+  CompileTimeErrorCode.SUPER_INITIALIZER_IN_OBJECT,
+  CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT,
+  CompileTimeErrorCode.SUPER_IN_REDIRECTING_CONSTRUCTOR,
+  CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
+  CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS,
+  CompileTimeErrorCode.UNDEFINED_CLASS,
+  CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER,
+  CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT,
+  CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER,
+  CompileTimeErrorCode.URI_DOES_NOT_EXIST,
+  CompileTimeErrorCode.URI_HAS_NOT_BEEN_GENERATED,
+  CompileTimeErrorCode.URI_WITH_INTERPOLATION,
+  CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR,
+  CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS,
+  CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER,
+  CompileTimeErrorCode.YIELD_EACH_IN_NON_GENERATOR,
+  CompileTimeErrorCode.YIELD_IN_NON_GENERATOR,
+  HintCode.ABSTRACT_SUPER_MEMBER_REFERENCE,
+  HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE,
+  HintCode.CAN_BE_NULL_AFTER_NULL_AWARE,
+  HintCode.DEAD_CODE,
+  HintCode.DEAD_CODE_CATCH_FOLLOWING_CATCH,
+  HintCode.DEAD_CODE_ON_CATCH_SUBTYPE,
+  HintCode.DEPRECATED_MEMBER_USE,
+  HintCode.DIVISION_OPTIMIZATION,
+  HintCode.DUPLICATE_IMPORT,
+  HintCode.FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE,
+  HintCode.FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE,
+  HintCode.IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION,
+  HintCode.INVALID_ASSIGNMENT,
+  HintCode.INVALID_FACTORY_ANNOTATION,
+  HintCode.INVALID_FACTORY_METHOD_DECL,
+  HintCode.INVALID_FACTORY_METHOD_IMPL,
+  HintCode.INVALID_METHOD_OVERRIDE_TYPE_PARAMETERS,
+  HintCode.INVALID_METHOD_OVERRIDE_TYPE_PARAMETER_BOUND,
+  HintCode.INVALID_USE_OF_PROTECTED_MEMBER,
+  HintCode.IS_DOUBLE,
+  HintCode.IS_INT,
+  HintCode.IS_NOT_DOUBLE,
+  HintCode.IS_NOT_INT,
+  HintCode.MISSING_JS_LIB_ANNOTATION,
+  HintCode.MISSING_REQUIRED_PARAM,
+  HintCode.MISSING_REQUIRED_PARAM_WITH_DETAILS,
+  HintCode.MISSING_RETURN,
+  HintCode.MUST_CALL_SUPER,
+  HintCode.NULL_AWARE_IN_CONDITION,
+  HintCode.OVERRIDE_EQUALS_BUT_NOT_HASH_CODE,
+  HintCode.OVERRIDE_ON_NON_OVERRIDING_FIELD,
+  HintCode.OVERRIDE_ON_NON_OVERRIDING_GETTER,
+  HintCode.OVERRIDE_ON_NON_OVERRIDING_METHOD,
+  HintCode.OVERRIDE_ON_NON_OVERRIDING_SETTER,
+  HintCode.PACKAGE_IMPORT_CONTAINS_DOT_DOT,
+  HintCode.TYPE_CHECK_IS_NOT_NULL,
+  HintCode.TYPE_CHECK_IS_NULL,
+  HintCode.UNDEFINED_GETTER,
+  HintCode.UNDEFINED_HIDDEN_NAME,
+  HintCode.UNDEFINED_METHOD,
+  HintCode.UNDEFINED_OPERATOR,
+  HintCode.UNDEFINED_SETTER,
+  HintCode.UNDEFINED_SHOWN_NAME,
+  HintCode.UNNECESSARY_CAST,
+  HintCode.UNNECESSARY_NO_SUCH_METHOD,
+  HintCode.UNNECESSARY_TYPE_CHECK_FALSE,
+  HintCode.UNNECESSARY_TYPE_CHECK_TRUE,
+  HintCode.UNUSED_CATCH_CLAUSE,
+  HintCode.UNUSED_CATCH_STACK,
+  HintCode.UNUSED_ELEMENT,
+  HintCode.UNUSED_FIELD,
+  HintCode.UNUSED_IMPORT,
+  HintCode.UNUSED_LOCAL_VARIABLE,
+  HintCode.UNUSED_SHOWN_NAME,
+  HintCode.USE_OF_VOID_RESULT,
+  HintCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD,
+  HtmlErrorCode.PARSE_ERROR,
+  HtmlWarningCode.INVALID_URI,
+  HtmlWarningCode.URI_DOES_NOT_EXIST,
+  ParserErrorCode.ABSTRACT_CLASS_MEMBER,
+  ParserErrorCode.ABSTRACT_ENUM,
+  ParserErrorCode.ABSTRACT_STATIC_METHOD,
+  ParserErrorCode.ABSTRACT_TOP_LEVEL_FUNCTION,
+  ParserErrorCode.ABSTRACT_TOP_LEVEL_VARIABLE,
+  ParserErrorCode.ABSTRACT_TYPEDEF,
+  ParserErrorCode.ANNOTATION_ON_ENUM_CONSTANT,
+  ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER,
+  ParserErrorCode.BREAK_OUTSIDE_OF_LOOP,
+  ParserErrorCode.CLASS_IN_CLASS,
+  ParserErrorCode.COLON_IN_PLACE_OF_IN,
+  ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE,
+  ParserErrorCode.CONST_AND_FINAL,
+  ParserErrorCode.CONST_AND_VAR,
+  ParserErrorCode.CONST_CLASS,
+  ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY,
+  ParserErrorCode.CONST_ENUM,
+  ParserErrorCode.CONST_FACTORY,
+  ParserErrorCode.CONST_METHOD,
+  ParserErrorCode.CONST_TYPEDEF,
+  ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP,
+  ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE,
+  ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS,
+  ParserErrorCode.DIRECTIVE_AFTER_DECLARATION,
+  ParserErrorCode.DUPLICATED_MODIFIER,
+  ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT,
+  ParserErrorCode.EMPTY_ENUM_BODY,
+  ParserErrorCode.ENUM_IN_CLASS,
+  ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND,
+  ParserErrorCode.EXPECTED_CASE_OR_DEFAULT,
+  ParserErrorCode.EXPECTED_CLASS_MEMBER,
+  ParserErrorCode.EXPECTED_EXECUTABLE,
+  ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL,
+  ParserErrorCode.EXPECTED_STRING_LITERAL,
+  ParserErrorCode.EXPECTED_TOKEN,
+  ParserErrorCode.EXPECTED_TYPE_NAME,
+  ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE,
+  ParserErrorCode.EXTERNAL_AFTER_CONST,
+  ParserErrorCode.EXTERNAL_AFTER_FACTORY,
+  ParserErrorCode.EXTERNAL_AFTER_STATIC,
+  ParserErrorCode.EXTERNAL_CLASS,
+  ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY,
+  ParserErrorCode.EXTERNAL_ENUM,
+  ParserErrorCode.EXTERNAL_FIELD,
+  ParserErrorCode.EXTERNAL_GETTER_WITH_BODY,
+  ParserErrorCode.EXTERNAL_METHOD_WITH_BODY,
+  ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY,
+  ParserErrorCode.EXTERNAL_SETTER_WITH_BODY,
+  ParserErrorCode.EXTERNAL_TYPEDEF,
+  ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION,
+  ParserErrorCode.FACTORY_WITHOUT_BODY,
+  ParserErrorCode.FACTORY_WITH_INITIALIZERS,
+  ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR,
+  ParserErrorCode.FINAL_AND_VAR,
+  ParserErrorCode.FINAL_CLASS,
+  ParserErrorCode.FINAL_CONSTRUCTOR,
+  ParserErrorCode.FINAL_ENUM,
+  ParserErrorCode.FINAL_METHOD,
+  ParserErrorCode.FINAL_TYPEDEF,
+  ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR,
+  ParserErrorCode.GETTER_IN_FUNCTION,
+  ParserErrorCode.GETTER_WITH_PARAMETERS,
+  ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE,
+  ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS,
+  ParserErrorCode.IMPLEMENTS_BEFORE_WITH,
+  ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE,
+  ParserErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH,
+  ParserErrorCode.INVALID_AWAIT_IN_FOR,
+  ParserErrorCode.INVALID_CODE_POINT,
+  ParserErrorCode.INVALID_COMMENT_REFERENCE,
+  ParserErrorCode.INVALID_HEX_ESCAPE,
+  ParserErrorCode.INVALID_LITERAL_IN_CONFIGURATION,
+  ParserErrorCode.INVALID_OPERATOR,
+  ParserErrorCode.INVALID_OPERATOR_FOR_SUPER,
+  ParserErrorCode.INVALID_STAR_AFTER_ASYNC,
+  ParserErrorCode.INVALID_SYNC,
+  ParserErrorCode.INVALID_UNICODE_ESCAPE,
+  ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST,
+  ParserErrorCode.LOCAL_FUNCTION_DECLARATION_MODIFIER,
+  ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR,
+  ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER,
+  ParserErrorCode.MISSING_CATCH_OR_FINALLY,
+  ParserErrorCode.MISSING_CLASS_BODY,
+  ParserErrorCode.MISSING_CLOSING_PARENTHESIS,
+  ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE,
+  ParserErrorCode.MISSING_ENUM_BODY,
+  ParserErrorCode.MISSING_EXPRESSION_IN_INITIALIZER,
+  ParserErrorCode.MISSING_EXPRESSION_IN_THROW,
+  ParserErrorCode.MISSING_FUNCTION_BODY,
+  ParserErrorCode.MISSING_FUNCTION_PARAMETERS,
+  ParserErrorCode.MISSING_GET,
+  ParserErrorCode.MISSING_IDENTIFIER,
+  ParserErrorCode.MISSING_INITIALIZER,
+  ParserErrorCode.MISSING_KEYWORD_OPERATOR,
+  ParserErrorCode.MISSING_METHOD_PARAMETERS,
+  ParserErrorCode.MISSING_NAME_IN_LIBRARY_DIRECTIVE,
+  ParserErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE,
+  ParserErrorCode.MISSING_PREFIX_IN_DEFERRED_IMPORT,
+  ParserErrorCode.MISSING_STAR_AFTER_SYNC,
+  ParserErrorCode.MISSING_STATEMENT,
+  ParserErrorCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP,
+  ParserErrorCode.MISSING_TYPEDEF_PARAMETERS,
+  ParserErrorCode.MISSING_VARIABLE_IN_FOR_EACH,
+  ParserErrorCode.MIXED_PARAMETER_GROUPS,
+  ParserErrorCode.MULTIPLE_EXTENDS_CLAUSES,
+  ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES,
+  ParserErrorCode.MULTIPLE_LIBRARY_DIRECTIVES,
+  ParserErrorCode.MULTIPLE_NAMED_PARAMETER_GROUPS,
+  ParserErrorCode.MULTIPLE_PART_OF_DIRECTIVES,
+  ParserErrorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS,
+  ParserErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH,
+  ParserErrorCode.MULTIPLE_WITH_CLAUSES,
+  ParserErrorCode.NAMED_FUNCTION_EXPRESSION,
+  ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP,
+  ParserErrorCode.NATIVE_CLAUSE_IN_NON_SDK_CODE,
+  ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE,
+  ParserErrorCode.NON_CONSTRUCTOR_FACTORY,
+  ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME,
+  ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART,
+  ParserErrorCode.NON_STRING_LITERAL_AS_URI,
+  ParserErrorCode.NON_USER_DEFINABLE_OPERATOR,
+  ParserErrorCode.NORMAL_BEFORE_OPTIONAL_PARAMETERS,
+  ParserErrorCode.NULLABLE_TYPE_IN_EXTENDS,
+  ParserErrorCode.NULLABLE_TYPE_IN_IMPLEMENTS,
+  ParserErrorCode.NULLABLE_TYPE_IN_WITH,
+  ParserErrorCode.NULLABLE_TYPE_PARAMETER,
+  ParserErrorCode.POSITIONAL_AFTER_NAMED_ARGUMENT,
+  ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP,
+  ParserErrorCode.REDIRECTING_CONSTRUCTOR_WITH_BODY,
+  ParserErrorCode.REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR,
+  ParserErrorCode.SETTER_IN_FUNCTION,
+  ParserErrorCode.STATIC_AFTER_CONST,
+  ParserErrorCode.STATIC_AFTER_FINAL,
+  ParserErrorCode.STATIC_AFTER_VAR,
+  ParserErrorCode.STATIC_CONSTRUCTOR,
+  ParserErrorCode.STATIC_GETTER_WITHOUT_BODY,
+  ParserErrorCode.STATIC_OPERATOR,
+  ParserErrorCode.STATIC_SETTER_WITHOUT_BODY,
+  ParserErrorCode.STATIC_TOP_LEVEL_DECLARATION,
+  ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE,
+  ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES,
+  ParserErrorCode.TOP_LEVEL_OPERATOR,
+  ParserErrorCode.TYPEDEF_IN_CLASS,
+  ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP,
+  ParserErrorCode.UNEXPECTED_TOKEN,
+  ParserErrorCode.VAR_AND_TYPE,
+  ParserErrorCode.VAR_AS_TYPE_NAME,
+  ParserErrorCode.VAR_CLASS,
+  ParserErrorCode.VAR_ENUM,
+  ParserErrorCode.VAR_RETURN_TYPE,
+  ParserErrorCode.VAR_TYPEDEF,
+  ParserErrorCode.VOID_PARAMETER,
+  ParserErrorCode.VOID_VARIABLE,
+  ParserErrorCode.WITH_BEFORE_EXTENDS,
+  ParserErrorCode.WITH_WITHOUT_EXTENDS,
+  ParserErrorCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER,
+  ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP,
+  ScannerErrorCode.ILLEGAL_CHARACTER,
+  ScannerErrorCode.MISSING_DIGIT,
+  ScannerErrorCode.MISSING_HEX_DIGIT,
+  ScannerErrorCode.MISSING_QUOTE,
+  ScannerErrorCode.UNABLE_GET_CONTENT,
+  ScannerErrorCode.UNTERMINATED_MULTI_LINE_COMMENT,
+  ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
+  StaticTypeWarningCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS,
+  StaticTypeWarningCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS,
+  StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE,
+  StaticTypeWarningCode.FOR_IN_OF_INVALID_TYPE,
+  StaticTypeWarningCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE,
+  StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE,
+  StaticTypeWarningCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE,
+  StaticTypeWarningCode.INCONSISTENT_METHOD_INHERITANCE,
+  StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER,
+  StaticTypeWarningCode.INVALID_ASSIGNMENT,
+  StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION,
+  StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION,
+  StaticTypeWarningCode.NON_BOOL_CONDITION,
+  StaticTypeWarningCode.NON_BOOL_EXPRESSION,
+  StaticTypeWarningCode.NON_BOOL_NEGATION_EXPRESSION,
+  StaticTypeWarningCode.NON_BOOL_OPERAND,
+  StaticTypeWarningCode.NON_NULLABLE_FIELD_NOT_INITIALIZED,
+  StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT,
+  StaticTypeWarningCode.RETURN_OF_INVALID_TYPE,
+  StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS,
+  StaticTypeWarningCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND,
+  StaticTypeWarningCode.UNDEFINED_ENUM_CONSTANT,
+  StaticTypeWarningCode.UNDEFINED_FUNCTION,
+  StaticTypeWarningCode.UNDEFINED_GETTER,
+  StaticTypeWarningCode.UNDEFINED_METHOD,
+  StaticTypeWarningCode.UNDEFINED_METHOD_WITH_CONSTRUCTOR,
+  StaticTypeWarningCode.UNDEFINED_OPERATOR,
+  StaticTypeWarningCode.UNDEFINED_SETTER,
+  StaticTypeWarningCode.UNDEFINED_SUPER_GETTER,
+  StaticTypeWarningCode.UNDEFINED_SUPER_METHOD,
+  StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR,
+  StaticTypeWarningCode.UNDEFINED_SUPER_SETTER,
+  StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER,
+  StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS,
+  StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD,
+  StaticTypeWarningCode.YIELD_OF_INVALID_TYPE,
+  StaticWarningCode.AMBIGUOUS_IMPORT,
+  StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE,
+  StaticWarningCode.ASSIGNMENT_TO_CONST,
+  StaticWarningCode.ASSIGNMENT_TO_FINAL,
+  StaticWarningCode.ASSIGNMENT_TO_FINAL_NO_SETTER,
+  StaticWarningCode.ASSIGNMENT_TO_FUNCTION,
+  StaticWarningCode.ASSIGNMENT_TO_METHOD,
+  StaticWarningCode.ASSIGNMENT_TO_TYPE,
+  StaticWarningCode.CASE_BLOCK_NOT_TERMINATED,
+  StaticWarningCode.CAST_TO_NON_TYPE,
+  StaticWarningCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER,
+  StaticWarningCode.CONFLICTING_DART_IMPORT,
+  StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER,
+  StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER,
+  StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER2,
+  StaticWarningCode.CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER,
+  StaticWarningCode.CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER,
+  StaticWarningCode.CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER,
+  StaticWarningCode.CONST_WITH_ABSTRACT_CLASS,
+  StaticWarningCode.EQUAL_KEYS_IN_MAP,
+  StaticWarningCode.EXPORT_DUPLICATED_LIBRARY_NAMED,
+  StaticWarningCode.EXTRA_POSITIONAL_ARGUMENTS,
+  StaticWarningCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION,
+  StaticWarningCode.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR,
+  StaticWarningCode.FIELD_INITIALIZER_NOT_ASSIGNABLE,
+  StaticWarningCode.FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE,
+  StaticWarningCode.FINAL_NOT_INITIALIZED,
+  StaticWarningCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_1,
+  StaticWarningCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_2,
+  StaticWarningCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_3_PLUS,
+  StaticWarningCode.FUNCTION_WITHOUT_CALL,
+  StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_NAMED,
+  StaticWarningCode.IMPORT_OF_NON_LIBRARY,
+  StaticWarningCode.INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD,
+  StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC,
+  StaticWarningCode.INVALID_GETTER_OVERRIDE_RETURN_TYPE,
+  StaticWarningCode.INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE,
+  StaticWarningCode.INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE,
+  StaticWarningCode.INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE,
+  StaticWarningCode.INVALID_METHOD_OVERRIDE_RETURN_TYPE,
+  StaticWarningCode.INVALID_METHOD_OVERRIDE_TYPE_PARAMETERS,
+  StaticWarningCode.INVALID_METHOD_OVERRIDE_TYPE_PARAMETER_BOUND,
+  StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED,
+  StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL,
+  StaticWarningCode.INVALID_OVERRIDE_NAMED,
+  StaticWarningCode.INVALID_OVERRIDE_POSITIONAL,
+  StaticWarningCode.INVALID_OVERRIDE_REQUIRED,
+  StaticWarningCode.INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE,
+  StaticWarningCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE,
+  StaticWarningCode.MAP_KEY_TYPE_NOT_ASSIGNABLE,
+  StaticWarningCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE,
+  StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES,
+  StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE,
+  StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH,
+  StaticWarningCode.MIXED_RETURN_TYPES,
+  StaticWarningCode.NEW_WITH_ABSTRACT_CLASS,
+  StaticWarningCode.NEW_WITH_INVALID_TYPE_PARAMETERS,
+  StaticWarningCode.NEW_WITH_NON_TYPE,
+  StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR,
+  StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT,
+  StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS,
+  StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR,
+  StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE,
+  StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE,
+  StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO,
+  StaticWarningCode.NON_TYPE_IN_CATCH_CLAUSE,
+  StaticWarningCode.NON_VOID_RETURN_FOR_OPERATOR,
+  StaticWarningCode.NON_VOID_RETURN_FOR_SETTER,
+  StaticWarningCode.NOT_A_TYPE,
+  StaticWarningCode.NOT_ENOUGH_REQUIRED_ARGUMENTS,
+  StaticWarningCode.PART_OF_DIFFERENT_LIBRARY,
+  StaticWarningCode.REDIRECT_TO_INVALID_FUNCTION_TYPE,
+  StaticWarningCode.REDIRECT_TO_INVALID_RETURN_TYPE,
+  StaticWarningCode.REDIRECT_TO_MISSING_CONSTRUCTOR,
+  StaticWarningCode.REDIRECT_TO_NON_CLASS,
+  StaticWarningCode.RETURN_WITHOUT_VALUE,
+  StaticWarningCode.STATIC_ACCESS_TO_INSTANCE_MEMBER,
+  StaticWarningCode.SWITCH_EXPRESSION_NOT_ASSIGNABLE,
+  StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS,
+  StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC,
+  StaticWarningCode.TYPE_TEST_WITH_NON_TYPE,
+  StaticWarningCode.TYPE_TEST_WITH_UNDEFINED_NAME,
+  StaticWarningCode.UNDEFINED_CLASS,
+  StaticWarningCode.UNDEFINED_CLASS_BOOLEAN,
+  StaticWarningCode.UNDEFINED_GETTER,
+  StaticWarningCode.UNDEFINED_IDENTIFIER,
+  StaticWarningCode.UNDEFINED_IDENTIFIER_AWAIT,
+  StaticWarningCode.UNDEFINED_NAMED_PARAMETER,
+  StaticWarningCode.UNDEFINED_SETTER,
+  StaticWarningCode.UNDEFINED_STATIC_METHOD_OR_GETTER,
+  StaticWarningCode.UNDEFINED_SUPER_GETTER,
+  StaticWarningCode.UNDEFINED_SUPER_SETTER,
+  StaticWarningCode.VOID_RETURN_FOR_GETTER,
+  StrongModeCode.ASSIGNMENT_CAST,
+  StrongModeCode.COULD_NOT_INFER,
+  StrongModeCode.DOWN_CAST_COMPOSITE,
+  StrongModeCode.DOWN_CAST_IMPLICIT,
+  StrongModeCode.DOWN_CAST_IMPLICIT_ASSIGN,
+  StrongModeCode.DYNAMIC_CAST,
+  StrongModeCode.DYNAMIC_INVOKE,
+  StrongModeCode.IMPLICIT_DYNAMIC_FIELD,
+  StrongModeCode.IMPLICIT_DYNAMIC_FUNCTION,
+  StrongModeCode.IMPLICIT_DYNAMIC_INVOKE,
+  StrongModeCode.IMPLICIT_DYNAMIC_LIST_LITERAL,
+  StrongModeCode.IMPLICIT_DYNAMIC_MAP_LITERAL,
+  StrongModeCode.IMPLICIT_DYNAMIC_METHOD,
+  StrongModeCode.IMPLICIT_DYNAMIC_PARAMETER,
+  StrongModeCode.IMPLICIT_DYNAMIC_RETURN,
+  StrongModeCode.IMPLICIT_DYNAMIC_TYPE,
+  StrongModeCode.IMPLICIT_DYNAMIC_VARIABLE,
+  StrongModeCode.INFERRED_TYPE,
+  StrongModeCode.INFERRED_TYPE_ALLOCATION,
+  StrongModeCode.INFERRED_TYPE_CLOSURE,
+  StrongModeCode.INFERRED_TYPE_LITERAL,
+  StrongModeCode.INVALID_CAST_LITERAL,
+  StrongModeCode.INVALID_CAST_LITERAL_LIST,
+  StrongModeCode.INVALID_CAST_LITERAL_MAP,
+  StrongModeCode.INVALID_CAST_FUNCTION_EXPR,
+  StrongModeCode.INVALID_CAST_NEW_EXPR,
+  StrongModeCode.INVALID_CAST_METHOD,
+  StrongModeCode.INVALID_CAST_FUNCTION,
+  StrongModeCode.INVALID_FIELD_OVERRIDE,
+  StrongModeCode.INVALID_METHOD_OVERRIDE,
+  StrongModeCode.INVALID_METHOD_OVERRIDE_FROM_BASE,
+  StrongModeCode.INVALID_METHOD_OVERRIDE_FROM_MIXIN,
+  StrongModeCode.INVALID_PARAMETER_DECLARATION,
+  StrongModeCode.INVALID_SUPER_INVOCATION,
+  StrongModeCode.NON_GROUND_TYPE_CHECK_INFO,
+  StrongModeCode.UNSAFE_BLOCK_CLOSURE_INFERENCE,
+  TodoCode.TODO,
+];
+
+/**
+ * The lazy initialized map from [ErrorCode.uniqueName] to the [ErrorCode]
+ * instance.
+ */
+HashMap<String, ErrorCode> _uniqueNameToCodeMap;
+
+/**
+ * Return the [ErrorCode] with the given [uniqueName], or `null` if not
+ * found.
+ */
+ErrorCode errorCodeByUniqueName(String uniqueName) {
+  if (_uniqueNameToCodeMap == null) {
+    _uniqueNameToCodeMap = new HashMap<String, ErrorCode>();
+    for (ErrorCode errorCode in errorCodeValues) {
+      _uniqueNameToCodeMap[errorCode.uniqueName] = errorCode;
+    }
+  }
+  return _uniqueNameToCodeMap[uniqueName];
+}
 
 /**
  * An error discovered during the analysis of some Dart code.
@@ -231,666 +854,6 @@
 }
 
 /**
- * An error code associated with an [AnalysisError].
- *
- * Generally, we want to provide messages that consist of three sentences. From
- * the user's perspective these sentences should explain:
- * 1. what is wrong,
- * 2. why is it wrong, and
- * 3. how do I fix it.
- * However, we combine the first two in the [message] and the last in the
- * [correction].
- */
-abstract class ErrorCode {
-  /**
-   * Engine error code values.
-   */
-  static const List<ErrorCode> values = const [
-    //
-    // Manually generated.  FWIW, this get's you most of the way there:
-    //
-    // > grep 'static const .*Code' (error.dart|parser|scanner.dart)
-    //     | awk '{print $3"."$4","}'
-    //
-    // error.dart:
-    //
-    AnalysisOptionsErrorCode.PARSE_ERROR,
-    AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUES,
-    AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE,
-    AnalysisOptionsWarningCode.UNSUPPORTED_VALUE,
-    AnalysisOptionsWarningCode.UNRECOGNIZED_ERROR_CODE,
-    CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH,
-    CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
-    CheckedModeCompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE,
-    CheckedModeCompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE,
-    CheckedModeCompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE,
-    CheckedModeCompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE,
-    CheckedModeCompileTimeErrorCode.VARIABLE_TYPE_MISMATCH,
-    CompileTimeErrorCode.ACCESS_PRIVATE_ENUM_FIELD,
-    CompileTimeErrorCode.AMBIGUOUS_EXPORT,
-    CompileTimeErrorCode.ANNOTATION_WITH_NON_CLASS,
-    CompileTimeErrorCode.ARGUMENT_DEFINITION_TEST_NON_PARAMETER,
-    CompileTimeErrorCode.ASYNC_FOR_IN_WRONG_CONTEXT,
-    CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT,
-    CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE,
-    CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME,
-    CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME,
-    CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME,
-    CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS,
-    CompileTimeErrorCode.COMPILE_TIME_CONSTANT_RAISES_EXCEPTION,
-    CompileTimeErrorCode.CONFLICTING_GETTER_AND_METHOD,
-    CompileTimeErrorCode.CONFLICTING_METHOD_AND_GETTER,
-    CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD,
-    CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD,
-    CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_CLASS,
-    CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER,
-    CompileTimeErrorCode.CONST_CONSTRUCTOR_THROWS_EXCEPTION,
-    CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST,
-    CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN,
-    CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER,
-    CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD,
-    CompileTimeErrorCode.CONST_DEFERRED_CLASS,
-    CompileTimeErrorCode.CONST_FORMAL_PARAMETER,
-    CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE,
-    CompileTimeErrorCode
-        .CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY,
-    CompileTimeErrorCode.CONST_INSTANCE_FIELD,
-    CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS,
-    CompileTimeErrorCode.CONST_NOT_INITIALIZED,
-    CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL,
-    CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING,
-    CompileTimeErrorCode.CONST_EVAL_TYPE_INT,
-    CompileTimeErrorCode.CONST_EVAL_TYPE_NUM,
-    CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
-    CompileTimeErrorCode.CONST_EVAL_THROWS_IDBZE,
-    CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS,
-    CompileTimeErrorCode.CONST_WITH_NON_CONST,
-    CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT,
-    CompileTimeErrorCode.CONST_WITH_NON_TYPE,
-    CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS,
-    CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR,
-    CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT,
-    CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS,
-    CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER,
-    CompileTimeErrorCode.DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR,
-    CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT,
-    CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_NAME,
-    CompileTimeErrorCode.DUPLICATE_DEFINITION,
-    CompileTimeErrorCode.DUPLICATE_DEFINITION_INHERITANCE,
-    CompileTimeErrorCode.DUPLICATE_NAMED_ARGUMENT,
-    CompileTimeErrorCode.EXPORT_INTERNAL_LIBRARY,
-    CompileTimeErrorCode.EXPORT_OF_NON_LIBRARY,
-    CompileTimeErrorCode.EXTENDS_ENUM,
-    CompileTimeErrorCode.EXTENDS_NON_CLASS,
-    CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
-    CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS,
-    CompileTimeErrorCode.EXTRA_ARGUMENT_TO_ASSERT,
-    CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS,
-    CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS,
-    CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER,
-    CompileTimeErrorCode.FINAL_INITIALIZED_MULTIPLE_TIMES,
-    CompileTimeErrorCode.FIELD_INITIALIZER_FACTORY_CONSTRUCTOR,
-    CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR,
-    CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR,
-    CompileTimeErrorCode.GETTER_AND_METHOD_WITH_SAME_NAME,
-    CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS,
-    CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS,
-    CompileTimeErrorCode.IMPLEMENTS_DYNAMIC,
-    CompileTimeErrorCode.IMPLEMENTS_ENUM,
-    CompileTimeErrorCode.IMPLEMENTS_NON_CLASS,
-    CompileTimeErrorCode.IMPLEMENTS_REPEATED,
-    CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS,
-    CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER,
-    CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY,
-    CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY,
-    CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES,
-    CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD,
-    CompileTimeErrorCode.INITIALIZER_FOR_STATIC_FIELD,
-    CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD,
-    CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_STATIC_FIELD,
-    CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY,
-    CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC,
-    CompileTimeErrorCode.INSTANTIATE_ENUM,
-    CompileTimeErrorCode.INVALID_ANNOTATION,
-    CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY,
-    CompileTimeErrorCode.INVALID_IDENTIFIER_IN_ASYNC,
-    CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR,
-    CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER,
-    CompileTimeErrorCode.INVALID_CONSTANT,
-    CompileTimeErrorCode.INVALID_CONSTRUCTOR_NAME,
-    CompileTimeErrorCode.INVALID_FACTORY_NAME_NOT_A_CLASS,
-    CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS,
-    CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST,
-    CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP,
-    CompileTimeErrorCode.INVALID_URI,
-    CompileTimeErrorCode.LABEL_IN_OUTER_SCOPE,
-    CompileTimeErrorCode.LABEL_UNDEFINED,
-    CompileTimeErrorCode.MEMBER_WITH_CLASS_NAME,
-    CompileTimeErrorCode.METHOD_AND_GETTER_WITH_SAME_NAME,
-    CompileTimeErrorCode.MISSING_CONST_IN_LIST_LITERAL,
-    CompileTimeErrorCode.MISSING_CONST_IN_MAP_LITERAL,
-    CompileTimeErrorCode.MIXIN_DECLARES_CONSTRUCTOR,
-    CompileTimeErrorCode.MIXIN_DEFERRED_CLASS,
-    CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS,
-    CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT,
-    CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS,
-    CompileTimeErrorCode.MIXIN_OF_ENUM,
-    CompileTimeErrorCode.MIXIN_OF_NON_CLASS,
-    CompileTimeErrorCode.MIXIN_REFERENCES_SUPER,
-    CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS,
-    CompileTimeErrorCode.MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS,
-    CompileTimeErrorCode.MULTIPLE_SUPER_INITIALIZERS,
-    CompileTimeErrorCode.NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS,
-    CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT,
-    CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT,
-    CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT,
-    CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION,
-    CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY,
-    CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE,
-    CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY,
-    CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT,
-    CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY,
-    CompileTimeErrorCode.NON_CONSTANT_MAP_KEY,
-    CompileTimeErrorCode.NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY,
-    CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE,
-    CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY,
-    CompileTimeErrorCode.NON_CONSTANT_ANNOTATION_CONSTRUCTOR,
-    CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER,
-    CompileTimeErrorCode
-        .NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY,
-    CompileTimeErrorCode.NOT_ENOUGH_REQUIRED_ARGUMENTS,
-    CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR,
-    CompileTimeErrorCode.OBJECT_CANNOT_EXTEND_ANOTHER_CLASS,
-    CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR,
-    CompileTimeErrorCode.PART_OF_NON_PART,
-    CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER,
-    CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT,
-    CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER,
-    CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT,
-    CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT,
-    CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
-    CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-    CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS,
-    CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS,
-    CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH,
-    CompileTimeErrorCode.REDIRECT_TO_MISSING_CONSTRUCTOR,
-    CompileTimeErrorCode.REDIRECT_TO_NON_CLASS,
-    CompileTimeErrorCode.REDIRECT_TO_NON_CONST_CONSTRUCTOR,
-    CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR,
-    CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR,
-    CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION,
-    CompileTimeErrorCode.RETHROW_OUTSIDE_CATCH,
-    CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR,
-    CompileTimeErrorCode.RETURN_IN_GENERATOR,
-    CompileTimeErrorCode.SHARED_DEFERRED_PREFIX,
-    CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT,
-    CompileTimeErrorCode.SUPER_IN_REDIRECTING_CONSTRUCTOR,
-    CompileTimeErrorCode.SUPER_INITIALIZER_IN_OBJECT,
-    CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS,
-    CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
-    CompileTimeErrorCode.UNDEFINED_CLASS,
-    CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER,
-    CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT,
-    CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER,
-    CompileTimeErrorCode.URI_DOES_NOT_EXIST,
-    CompileTimeErrorCode.URI_WITH_INTERPOLATION,
-    CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR,
-    CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS,
-    CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER,
-    CompileTimeErrorCode.YIELD_EACH_IN_NON_GENERATOR,
-    CompileTimeErrorCode.YIELD_IN_NON_GENERATOR,
-    HintCode.ABSTRACT_SUPER_MEMBER_REFERENCE,
-    HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE,
-    HintCode.CAN_BE_NULL_AFTER_NULL_AWARE,
-    HintCode.DEAD_CODE,
-    HintCode.DEAD_CODE_CATCH_FOLLOWING_CATCH,
-    HintCode.DEAD_CODE_ON_CATCH_SUBTYPE,
-    HintCode.DEPRECATED_MEMBER_USE,
-    HintCode.DUPLICATE_IMPORT,
-    HintCode.DIVISION_OPTIMIZATION,
-    HintCode.INVALID_FACTORY_ANNOTATION,
-    HintCode.INVALID_FACTORY_METHOD_DECL,
-    HintCode.INVALID_FACTORY_METHOD_IMPL,
-    HintCode.IS_DOUBLE,
-    HintCode.IS_INT,
-    HintCode.IS_NOT_DOUBLE,
-    HintCode.IS_NOT_INT,
-    HintCode.IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION,
-    HintCode.INVALID_ASSIGNMENT,
-    HintCode.INVALID_USE_OF_PROTECTED_MEMBER,
-    HintCode.MISSING_JS_LIB_ANNOTATION,
-    HintCode.MISSING_REQUIRED_PARAM,
-    HintCode.MISSING_REQUIRED_PARAM_WITH_DETAILS,
-    HintCode.MISSING_RETURN,
-    HintCode.NULL_AWARE_IN_CONDITION,
-    HintCode.OVERRIDE_ON_NON_OVERRIDING_GETTER,
-    HintCode.OVERRIDE_ON_NON_OVERRIDING_FIELD,
-    HintCode.OVERRIDE_ON_NON_OVERRIDING_METHOD,
-    HintCode.OVERRIDE_ON_NON_OVERRIDING_SETTER,
-    HintCode.OVERRIDE_EQUALS_BUT_NOT_HASH_CODE,
-    HintCode.TYPE_CHECK_IS_NOT_NULL,
-    HintCode.TYPE_CHECK_IS_NULL,
-    HintCode.UNDEFINED_GETTER,
-    HintCode.UNDEFINED_HIDDEN_NAME,
-    HintCode.UNDEFINED_METHOD,
-    HintCode.UNDEFINED_OPERATOR,
-    HintCode.UNDEFINED_SETTER,
-    HintCode.UNDEFINED_SHOWN_NAME,
-    HintCode.UNNECESSARY_CAST,
-    HintCode.UNNECESSARY_NO_SUCH_METHOD,
-    HintCode.UNNECESSARY_TYPE_CHECK_FALSE,
-    HintCode.UNNECESSARY_TYPE_CHECK_TRUE,
-    HintCode.UNUSED_ELEMENT,
-    HintCode.UNUSED_FIELD,
-    HintCode.UNUSED_IMPORT,
-    HintCode.UNUSED_CATCH_CLAUSE,
-    HintCode.UNUSED_CATCH_STACK,
-    HintCode.UNUSED_LOCAL_VARIABLE,
-    HintCode.UNUSED_SHOWN_NAME,
-    HintCode.USE_OF_VOID_RESULT,
-    HintCode.FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE,
-    HintCode.FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE,
-    HintCode.PACKAGE_IMPORT_CONTAINS_DOT_DOT,
-    HtmlErrorCode.PARSE_ERROR,
-    HtmlWarningCode.INVALID_URI,
-    HtmlWarningCode.URI_DOES_NOT_EXIST,
-    StaticTypeWarningCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS,
-    StaticTypeWarningCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS,
-    StaticTypeWarningCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE,
-    StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE,
-    StaticTypeWarningCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE,
-    StaticTypeWarningCode.INACCESSIBLE_SETTER,
-    StaticTypeWarningCode.INCONSISTENT_METHOD_INHERITANCE,
-    StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER,
-    StaticTypeWarningCode.INVALID_ASSIGNMENT,
-    StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION,
-    StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION,
-    StaticTypeWarningCode.NON_BOOL_CONDITION,
-    StaticTypeWarningCode.NON_BOOL_EXPRESSION,
-    StaticTypeWarningCode.NON_BOOL_NEGATION_EXPRESSION,
-    StaticTypeWarningCode.NON_BOOL_OPERAND,
-    StaticTypeWarningCode.NON_NULLABLE_FIELD_NOT_INITIALIZED,
-    StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT,
-    StaticTypeWarningCode.RETURN_OF_INVALID_TYPE,
-    StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS,
-    StaticTypeWarningCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND,
-    StaticTypeWarningCode.UNDEFINED_ENUM_CONSTANT,
-    StaticTypeWarningCode.UNDEFINED_FUNCTION,
-    StaticTypeWarningCode.UNDEFINED_GETTER,
-    StaticTypeWarningCode.UNDEFINED_METHOD,
-    StaticTypeWarningCode.UNDEFINED_METHOD_WITH_CONSTRUCTOR,
-    StaticTypeWarningCode.UNDEFINED_OPERATOR,
-    StaticTypeWarningCode.UNDEFINED_SETTER,
-    StaticTypeWarningCode.UNDEFINED_SUPER_GETTER,
-    StaticTypeWarningCode.UNDEFINED_SUPER_METHOD,
-    StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR,
-    StaticTypeWarningCode.UNDEFINED_SUPER_SETTER,
-    StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER,
-    StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS,
-    StaticTypeWarningCode.YIELD_OF_INVALID_TYPE,
-    StaticTypeWarningCode.FOR_IN_OF_INVALID_TYPE,
-    StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE,
-    StaticWarningCode.AMBIGUOUS_IMPORT,
-    StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE,
-    StaticWarningCode.ASSIGNMENT_TO_CONST,
-    StaticWarningCode.ASSIGNMENT_TO_FINAL,
-    StaticWarningCode.ASSIGNMENT_TO_FINAL_NO_SETTER,
-    StaticWarningCode.ASSIGNMENT_TO_FUNCTION,
-    StaticWarningCode.ASSIGNMENT_TO_METHOD,
-    StaticWarningCode.ASSIGNMENT_TO_TYPE,
-    StaticWarningCode.CASE_BLOCK_NOT_TERMINATED,
-    StaticWarningCode.CAST_TO_NON_TYPE,
-    StaticWarningCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER,
-    StaticWarningCode.CONFLICTING_DART_IMPORT,
-    StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER,
-    StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER,
-    StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER2,
-    StaticWarningCode.CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER,
-    StaticWarningCode.CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER,
-    StaticWarningCode.CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER,
-    StaticWarningCode.CONST_WITH_ABSTRACT_CLASS,
-    StaticWarningCode.EQUAL_KEYS_IN_MAP,
-    StaticWarningCode.EXPORT_DUPLICATED_LIBRARY_NAMED,
-    StaticWarningCode.EXTRA_POSITIONAL_ARGUMENTS,
-    StaticWarningCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION,
-    StaticWarningCode.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR,
-    StaticWarningCode.FIELD_INITIALIZER_NOT_ASSIGNABLE,
-    StaticWarningCode.FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE,
-    StaticWarningCode.FINAL_NOT_INITIALIZED,
-    StaticWarningCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_1,
-    StaticWarningCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_2,
-    StaticWarningCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_3_PLUS,
-    StaticWarningCode.FUNCTION_WITHOUT_CALL,
-    StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_NAMED,
-    StaticWarningCode.IMPORT_OF_NON_LIBRARY,
-    StaticWarningCode.INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD,
-    StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC,
-    StaticWarningCode.INVALID_GETTER_OVERRIDE_RETURN_TYPE,
-    StaticWarningCode.INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE,
-    StaticWarningCode.INVALID_METHOD_OVERRIDE_TYPE_PARAMETERS,
-    StaticWarningCode.INVALID_METHOD_OVERRIDE_TYPE_PARAMETER_BOUND,
-    StaticWarningCode.INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE,
-    StaticWarningCode.INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE,
-    StaticWarningCode.INVALID_METHOD_OVERRIDE_RETURN_TYPE,
-    StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED,
-    StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL,
-    StaticWarningCode.INVALID_OVERRIDE_NAMED,
-    StaticWarningCode.INVALID_OVERRIDE_POSITIONAL,
-    StaticWarningCode.INVALID_OVERRIDE_REQUIRED,
-    StaticWarningCode.INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE,
-    StaticWarningCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE,
-    StaticWarningCode.MAP_KEY_TYPE_NOT_ASSIGNABLE,
-    StaticWarningCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE,
-    StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES,
-    StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE,
-    StaticWarningCode.MIXED_RETURN_TYPES,
-    StaticWarningCode.NEW_WITH_ABSTRACT_CLASS,
-    StaticWarningCode.NEW_WITH_INVALID_TYPE_PARAMETERS,
-    StaticWarningCode.NEW_WITH_NON_TYPE,
-    StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR,
-    StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT,
-    StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS,
-    StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR,
-    StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE,
-    StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE,
-    StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO,
-    StaticWarningCode.NON_TYPE_IN_CATCH_CLAUSE,
-    StaticWarningCode.NON_VOID_RETURN_FOR_OPERATOR,
-    StaticWarningCode.NON_VOID_RETURN_FOR_SETTER,
-    StaticWarningCode.NOT_A_TYPE,
-    StaticWarningCode.NOT_ENOUGH_REQUIRED_ARGUMENTS,
-    StaticWarningCode.PART_OF_DIFFERENT_LIBRARY,
-    StaticWarningCode.REDIRECT_TO_INVALID_FUNCTION_TYPE,
-    StaticWarningCode.REDIRECT_TO_INVALID_RETURN_TYPE,
-    StaticWarningCode.REDIRECT_TO_MISSING_CONSTRUCTOR,
-    StaticWarningCode.REDIRECT_TO_NON_CLASS,
-    StaticWarningCode.RETURN_WITHOUT_VALUE,
-    StaticWarningCode.STATIC_ACCESS_TO_INSTANCE_MEMBER,
-    StaticWarningCode.SWITCH_EXPRESSION_NOT_ASSIGNABLE,
-    StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS,
-    StaticWarningCode.TYPE_TEST_WITH_NON_TYPE,
-    StaticWarningCode.TYPE_TEST_WITH_UNDEFINED_NAME,
-    StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC,
-    StaticWarningCode.UNDEFINED_CLASS,
-    StaticWarningCode.UNDEFINED_CLASS_BOOLEAN,
-    StaticWarningCode.UNDEFINED_GETTER,
-    StaticWarningCode.UNDEFINED_IDENTIFIER,
-    StaticWarningCode.UNDEFINED_NAMED_PARAMETER,
-    StaticWarningCode.UNDEFINED_SETTER,
-    StaticWarningCode.UNDEFINED_STATIC_METHOD_OR_GETTER,
-    StaticWarningCode.UNDEFINED_SUPER_GETTER,
-    StaticWarningCode.UNDEFINED_SUPER_SETTER,
-    StaticWarningCode.VOID_RETURN_FOR_GETTER,
-    StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH,
-    StrongModeCode.ASSIGNMENT_CAST,
-    StrongModeCode.DOWN_CAST_COMPOSITE,
-    StrongModeCode.DOWN_CAST_IMPLICIT,
-    StrongModeCode.DYNAMIC_CAST,
-    StrongModeCode.DYNAMIC_INVOKE,
-    StrongModeCode.IMPLICIT_DYNAMIC_FIELD,
-    StrongModeCode.IMPLICIT_DYNAMIC_FUNCTION,
-    StrongModeCode.IMPLICIT_DYNAMIC_INVOKE,
-    StrongModeCode.IMPLICIT_DYNAMIC_LIST_LITERAL,
-    StrongModeCode.IMPLICIT_DYNAMIC_MAP_LITERAL,
-    StrongModeCode.IMPLICIT_DYNAMIC_METHOD,
-    StrongModeCode.IMPLICIT_DYNAMIC_PARAMETER,
-    StrongModeCode.IMPLICIT_DYNAMIC_RETURN,
-    StrongModeCode.IMPLICIT_DYNAMIC_TYPE,
-    StrongModeCode.IMPLICIT_DYNAMIC_VARIABLE,
-    StrongModeCode.INFERRED_TYPE,
-    StrongModeCode.INFERRED_TYPE_ALLOCATION,
-    StrongModeCode.INFERRED_TYPE_CLOSURE,
-    StrongModeCode.INFERRED_TYPE_LITERAL,
-    StrongModeCode.INVALID_FIELD_OVERRIDE,
-    StrongModeCode.INVALID_METHOD_OVERRIDE,
-    StrongModeCode.INVALID_METHOD_OVERRIDE_FROM_BASE,
-    StrongModeCode.INVALID_METHOD_OVERRIDE_FROM_MIXIN,
-    StrongModeCode.INVALID_PARAMETER_DECLARATION,
-    StrongModeCode.INVALID_SUPER_INVOCATION,
-    StrongModeCode.NON_GROUND_TYPE_CHECK_INFO,
-    StrongModeCode.STATIC_TYPE_ERROR,
-    StrongModeCode.UNSAFE_BLOCK_CLOSURE_INFERENCE,
-    TodoCode.TODO,
-    //
-    // parser.dart:
-    //
-    ParserErrorCode.ABSTRACT_CLASS_MEMBER,
-    ParserErrorCode.ABSTRACT_ENUM,
-    ParserErrorCode.ABSTRACT_STATIC_METHOD,
-    ParserErrorCode.ABSTRACT_TOP_LEVEL_FUNCTION,
-    ParserErrorCode.ABSTRACT_TOP_LEVEL_VARIABLE,
-    ParserErrorCode.ABSTRACT_TYPEDEF,
-    ParserErrorCode.ANNOTATION_ON_ENUM_CONSTANT,
-    ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER,
-    ParserErrorCode.ASYNC_NOT_SUPPORTED,
-    ParserErrorCode.BREAK_OUTSIDE_OF_LOOP,
-    ParserErrorCode.CLASS_IN_CLASS,
-    ParserErrorCode.COLON_IN_PLACE_OF_IN,
-    ParserErrorCode.CONST_AND_FINAL,
-    ParserErrorCode.CONST_AND_VAR,
-    ParserErrorCode.CONST_CLASS,
-    ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY,
-    ParserErrorCode.CONST_ENUM,
-    ParserErrorCode.CONST_FACTORY,
-    ParserErrorCode.CONST_METHOD,
-    ParserErrorCode.CONST_TYPEDEF,
-    ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE,
-    ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP,
-    ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE,
-    ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS,
-    ParserErrorCode.DIRECTIVE_AFTER_DECLARATION,
-    ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT,
-    ParserErrorCode.DUPLICATED_MODIFIER,
-    ParserErrorCode.EMPTY_ENUM_BODY,
-    ParserErrorCode.ENUM_IN_CLASS,
-    ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND,
-    ParserErrorCode.EXPECTED_CASE_OR_DEFAULT,
-    ParserErrorCode.EXPECTED_CLASS_MEMBER,
-    ParserErrorCode.EXPECTED_EXECUTABLE,
-    ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL,
-    ParserErrorCode.EXPECTED_STRING_LITERAL,
-    ParserErrorCode.EXPECTED_TOKEN,
-    ParserErrorCode.EXPECTED_TYPE_NAME,
-    ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE,
-    ParserErrorCode.EXTERNAL_AFTER_CONST,
-    ParserErrorCode.EXTERNAL_AFTER_FACTORY,
-    ParserErrorCode.EXTERNAL_AFTER_STATIC,
-    ParserErrorCode.EXTERNAL_CLASS,
-    ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY,
-    ParserErrorCode.EXTERNAL_ENUM,
-    ParserErrorCode.EXTERNAL_FIELD,
-    ParserErrorCode.EXTERNAL_GETTER_WITH_BODY,
-    ParserErrorCode.EXTERNAL_METHOD_WITH_BODY,
-    ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY,
-    ParserErrorCode.EXTERNAL_SETTER_WITH_BODY,
-    ParserErrorCode.EXTERNAL_TYPEDEF,
-    ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION,
-    ParserErrorCode.FACTORY_WITH_INITIALIZERS,
-    ParserErrorCode.FACTORY_WITHOUT_BODY,
-    ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR,
-    ParserErrorCode.FINAL_AND_VAR,
-    ParserErrorCode.FINAL_CLASS,
-    ParserErrorCode.FINAL_CONSTRUCTOR,
-    ParserErrorCode.FINAL_ENUM,
-    ParserErrorCode.FINAL_METHOD,
-    ParserErrorCode.FINAL_TYPEDEF,
-    ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR,
-    ParserErrorCode.GETTER_IN_FUNCTION,
-    ParserErrorCode.GETTER_WITH_PARAMETERS,
-    ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE,
-    ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS,
-    ParserErrorCode.IMPLEMENTS_BEFORE_WITH,
-    ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE,
-    ParserErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH,
-    ParserErrorCode.INVALID_AWAIT_IN_FOR,
-    ParserErrorCode.INVALID_CODE_POINT,
-    ParserErrorCode.INVALID_COMMENT_REFERENCE,
-    ParserErrorCode.INVALID_HEX_ESCAPE,
-    ParserErrorCode.INVALID_LITERAL_IN_CONFIGURATION,
-    ParserErrorCode.INVALID_OPERATOR,
-    ParserErrorCode.INVALID_OPERATOR_FOR_SUPER,
-    ParserErrorCode.INVALID_STAR_AFTER_ASYNC,
-    ParserErrorCode.INVALID_SYNC,
-    ParserErrorCode.INVALID_UNICODE_ESCAPE,
-    ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST,
-    ParserErrorCode.LOCAL_FUNCTION_DECLARATION_MODIFIER,
-    ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR,
-    ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER,
-    ParserErrorCode.MISSING_CATCH_OR_FINALLY,
-    ParserErrorCode.MISSING_CLASS_BODY,
-    ParserErrorCode.MISSING_CLOSING_PARENTHESIS,
-    ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE,
-    ParserErrorCode.MISSING_ENUM_BODY,
-    ParserErrorCode.MISSING_EXPRESSION_IN_INITIALIZER,
-    ParserErrorCode.MISSING_EXPRESSION_IN_THROW,
-    ParserErrorCode.MISSING_FUNCTION_BODY,
-    ParserErrorCode.MISSING_FUNCTION_PARAMETERS,
-    ParserErrorCode.MISSING_METHOD_PARAMETERS,
-    ParserErrorCode.MISSING_GET,
-    ParserErrorCode.MISSING_IDENTIFIER,
-    ParserErrorCode.MISSING_INITIALIZER,
-    ParserErrorCode.MISSING_KEYWORD_OPERATOR,
-    ParserErrorCode.MISSING_NAME_IN_LIBRARY_DIRECTIVE,
-    ParserErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE,
-    ParserErrorCode.MISSING_PREFIX_IN_DEFERRED_IMPORT,
-    ParserErrorCode.MISSING_STAR_AFTER_SYNC,
-    ParserErrorCode.MISSING_STATEMENT,
-    ParserErrorCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP,
-    ParserErrorCode.MISSING_TYPEDEF_PARAMETERS,
-    ParserErrorCode.MISSING_VARIABLE_IN_FOR_EACH,
-    ParserErrorCode.MIXED_PARAMETER_GROUPS,
-    ParserErrorCode.MULTIPLE_EXTENDS_CLAUSES,
-    ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES,
-    ParserErrorCode.MULTIPLE_LIBRARY_DIRECTIVES,
-    ParserErrorCode.MULTIPLE_NAMED_PARAMETER_GROUPS,
-    ParserErrorCode.MULTIPLE_PART_OF_DIRECTIVES,
-    ParserErrorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS,
-    ParserErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH,
-    ParserErrorCode.MULTIPLE_WITH_CLAUSES,
-    ParserErrorCode.NAMED_FUNCTION_EXPRESSION,
-    ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP,
-    ParserErrorCode.NATIVE_CLAUSE_IN_NON_SDK_CODE,
-    ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE,
-    ParserErrorCode.NON_CONSTRUCTOR_FACTORY,
-    ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME,
-    ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART,
-    ParserErrorCode.NON_STRING_LITERAL_AS_URI,
-    ParserErrorCode.NON_USER_DEFINABLE_OPERATOR,
-    ParserErrorCode.NORMAL_BEFORE_OPTIONAL_PARAMETERS,
-    ParserErrorCode.POSITIONAL_AFTER_NAMED_ARGUMENT,
-    ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP,
-    ParserErrorCode.REDIRECTING_CONSTRUCTOR_WITH_BODY,
-    ParserErrorCode.REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR,
-    ParserErrorCode.SETTER_IN_FUNCTION,
-    ParserErrorCode.STATIC_AFTER_CONST,
-    ParserErrorCode.STATIC_AFTER_FINAL,
-    ParserErrorCode.STATIC_AFTER_VAR,
-    ParserErrorCode.STATIC_CONSTRUCTOR,
-    ParserErrorCode.STATIC_GETTER_WITHOUT_BODY,
-    ParserErrorCode.STATIC_OPERATOR,
-    ParserErrorCode.STATIC_SETTER_WITHOUT_BODY,
-    ParserErrorCode.STATIC_TOP_LEVEL_DECLARATION,
-    ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE,
-    ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES,
-    ParserErrorCode.TOP_LEVEL_OPERATOR,
-    ParserErrorCode.TYPEDEF_IN_CLASS,
-    ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP,
-    ParserErrorCode.UNEXPECTED_TOKEN,
-    ParserErrorCode.WITH_BEFORE_EXTENDS,
-    ParserErrorCode.WITH_WITHOUT_EXTENDS,
-    ParserErrorCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER,
-    ParserErrorCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER,
-    ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP,
-    ParserErrorCode.VAR_AND_TYPE,
-    ParserErrorCode.VAR_AS_TYPE_NAME,
-    ParserErrorCode.VAR_CLASS,
-    ParserErrorCode.VAR_ENUM,
-    ParserErrorCode.VAR_RETURN_TYPE,
-    ParserErrorCode.VAR_TYPEDEF,
-    ParserErrorCode.VOID_PARAMETER,
-    ParserErrorCode.VOID_VARIABLE,
-    //
-    // scanner.dart:
-    //
-    ScannerErrorCode.ILLEGAL_CHARACTER,
-    ScannerErrorCode.MISSING_DIGIT,
-    ScannerErrorCode.MISSING_HEX_DIGIT,
-    ScannerErrorCode.MISSING_QUOTE,
-    ScannerErrorCode.UNABLE_GET_CONTENT,
-    ScannerErrorCode.UNTERMINATED_MULTI_LINE_COMMENT,
-    ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
-  ];
-
-  /**
-   * The lazy initialized map from [uniqueName] to the [ErrorCode] instance.
-   */
-  static HashMap<String, ErrorCode> _uniqueNameToCodeMap;
-
-  /**
-   * An empty list of error codes.
-   */
-  static const List<ErrorCode> EMPTY_LIST = const <ErrorCode>[];
-
-  /**
-   * The name of the error code.
-   */
-  final String name;
-
-  /**
-   * The template used to create the message to be displayed for this error. The
-   * message should indicate what is wrong and why it is wrong.
-   */
-  final String message;
-
-  /**
-   * The template used to create the correction to be displayed for this error,
-   * or `null` if there is no correction information for this error. The
-   * correction should indicate how the user can fix the error.
-   */
-  final String correction;
-
-  /**
-   * Initialize a newly created error code to have the given [name]. The message
-   * associated with the error will be created from the given [message]
-   * template. The correction associated with the error will be created from the
-   * given [correction] template.
-   */
-  const ErrorCode(this.name, this.message, [this.correction]);
-
-  /**
-   * The severity of the error.
-   */
-  ErrorSeverity get errorSeverity;
-
-  /**
-   * The type of the error.
-   */
-  ErrorType get type;
-
-  /**
-   * The unique name of this error code.
-   */
-  String get uniqueName => "$runtimeType.$name";
-
-  @override
-  String toString() => uniqueName;
-
-  /**
-   * Return the [ErrorCode] with the given [uniqueName], or `null` if not
-   * found.
-   */
-  static ErrorCode byUniqueName(String uniqueName) {
-    if (_uniqueNameToCodeMap == null) {
-      _uniqueNameToCodeMap = new HashMap<String, ErrorCode>();
-      for (ErrorCode errorCode in values) {
-        _uniqueNameToCodeMap[errorCode.uniqueName] = errorCode;
-      }
-    }
-    return _uniqueNameToCodeMap[uniqueName];
-  }
-}
-
-/**
  * The properties that can be associated with an [AnalysisError].
  */
 class ErrorProperty<V> implements Comparable<ErrorProperty> {
@@ -943,177 +906,3 @@
   @override
   String toString() => name;
 }
-
-/**
- * The severity of an [ErrorCode].
- */
-class ErrorSeverity implements Comparable<ErrorSeverity> {
-  /**
-   * The severity representing a non-error. This is never used for any error
-   * code, but is useful for clients.
-   */
-  static const ErrorSeverity NONE = const ErrorSeverity('NONE', 0, " ", "none");
-
-  /**
-   * The severity representing an informational level analysis issue.
-   */
-  static const ErrorSeverity INFO = const ErrorSeverity('INFO', 1, "I", "info");
-
-  /**
-   * The severity representing a warning. Warnings can become errors if the `-Werror` command
-   * line flag is specified.
-   */
-  static const ErrorSeverity WARNING =
-      const ErrorSeverity('WARNING', 2, "W", "warning");
-
-  /**
-   * The severity representing an error.
-   */
-  static const ErrorSeverity ERROR =
-      const ErrorSeverity('ERROR', 3, "E", "error");
-
-  static const List<ErrorSeverity> values = const [NONE, INFO, WARNING, ERROR];
-
-  /**
-   * The name of this error code.
-   */
-  final String name;
-
-  /**
-   * The ordinal value of the error code.
-   */
-  final int ordinal;
-
-  /**
-   * The name of the severity used when producing machine output.
-   */
-  final String machineCode;
-
-  /**
-   * The name of the severity used when producing readable output.
-   */
-  final String displayName;
-
-  /**
-   * Initialize a newly created severity with the given names.
-   */
-  const ErrorSeverity(
-      this.name, this.ordinal, this.machineCode, this.displayName);
-
-  @override
-  int get hashCode => ordinal;
-
-  @override
-  int compareTo(ErrorSeverity other) => ordinal - other.ordinal;
-
-  /**
-   * Return the severity constant that represents the greatest severity.
-   */
-  ErrorSeverity max(ErrorSeverity severity) =>
-      this.ordinal >= severity.ordinal ? this : severity;
-
-  @override
-  String toString() => name;
-}
-
-/**
- * The type of an [ErrorCode].
- */
-class ErrorType implements Comparable<ErrorType> {
-  /**
-   * Task (todo) comments in user code.
-   */
-  static const ErrorType TODO = const ErrorType('TODO', 0, ErrorSeverity.INFO);
-
-  /**
-   * Extra analysis run over the code to follow best practices, which are not in
-   * the Dart Language Specification.
-   */
-  static const ErrorType HINT = const ErrorType('HINT', 1, ErrorSeverity.INFO);
-
-  /**
-   * Compile-time errors are errors that preclude execution. A compile time
-   * error must be reported by a Dart compiler before the erroneous code is
-   * executed.
-   */
-  static const ErrorType COMPILE_TIME_ERROR =
-      const ErrorType('COMPILE_TIME_ERROR', 2, ErrorSeverity.ERROR);
-
-  /**
-   * Checked mode compile-time errors are errors that preclude execution in
-   * checked mode.
-   */
-  static const ErrorType CHECKED_MODE_COMPILE_TIME_ERROR = const ErrorType(
-      'CHECKED_MODE_COMPILE_TIME_ERROR', 3, ErrorSeverity.ERROR);
-
-  /**
-   * Static warnings are those warnings reported by the static checker. They
-   * have no effect on execution. Static warnings must be provided by Dart
-   * compilers used during development.
-   */
-  static const ErrorType STATIC_WARNING =
-      const ErrorType('STATIC_WARNING', 4, ErrorSeverity.WARNING);
-
-  /**
-   * Many, but not all, static warnings relate to types, in which case they are
-   * known as static type warnings.
-   */
-  static const ErrorType STATIC_TYPE_WARNING =
-      const ErrorType('STATIC_TYPE_WARNING', 5, ErrorSeverity.WARNING);
-
-  /**
-   * Syntactic errors are errors produced as a result of input that does not
-   * conform to the grammar.
-   */
-  static const ErrorType SYNTACTIC_ERROR =
-      const ErrorType('SYNTACTIC_ERROR', 6, ErrorSeverity.ERROR);
-
-  /**
-   * Lint warnings describe style and best practice recommendations that can be
-   * used to formalize a project's style guidelines.
-   */
-  static const ErrorType LINT = const ErrorType('LINT', 7, ErrorSeverity.INFO);
-
-  static const List<ErrorType> values = const [
-    TODO,
-    HINT,
-    COMPILE_TIME_ERROR,
-    CHECKED_MODE_COMPILE_TIME_ERROR,
-    STATIC_WARNING,
-    STATIC_TYPE_WARNING,
-    SYNTACTIC_ERROR,
-    LINT
-  ];
-
-  /**
-   * The name of this error type.
-   */
-  final String name;
-
-  /**
-   * The ordinal value of the error type.
-   */
-  final int ordinal;
-
-  /**
-   * The severity of this type of error.
-   */
-  final ErrorSeverity severity;
-
-  /**
-   * Initialize a newly created error type to have the given [name] and
-   * [severity].
-   */
-  const ErrorType(this.name, this.ordinal, this.severity);
-
-  String get displayName => name.toLowerCase().replaceAll('_', ' ');
-
-  @override
-  int get hashCode => ordinal;
-
-  @override
-  int compareTo(ErrorType other) => ordinal - other.ordinal;
-
-  @override
-  String toString() => name;
-}
diff --git a/pkg/analyzer/lib/file_system/file_system.dart b/pkg/analyzer/lib/file_system/file_system.dart
index f005eef..139330b 100644
--- a/pkg/analyzer/lib/file_system/file_system.dart
+++ b/pkg/analyzer/lib/file_system/file_system.dart
@@ -21,8 +21,14 @@
   Stream<WatchEvent> get changes;
 
   /**
+   * Synchronously get the length of the file.
+   * Throws a [FileSystemException] if the operation fails.
+   */
+  int get lengthSync;
+
+  /**
    * Return the last-modified stamp of the file.
-   * Throws [FileSystemException] if the file does not exist.
+   * Throws a [FileSystemException] if the file does not exist.
    */
   int get modificationStamp;
 
@@ -260,8 +266,8 @@
     if (!isFileUri(uri)) {
       return null;
     }
-    Resource resource =
-        _provider.getResource(_provider.pathContext.fromUri(uri));
+    String path = _provider.pathContext.fromUri(uri);
+    Resource resource = _provider.getResource(path);
     if (resource is File) {
       return resource.createSource(actualUri ?? uri);
     }
diff --git a/pkg/analyzer/lib/file_system/memory_file_system.dart b/pkg/analyzer/lib/file_system/memory_file_system.dart
index 7dd097c..42731be 100644
--- a/pkg/analyzer/lib/file_system/memory_file_system.dart
+++ b/pkg/analyzer/lib/file_system/memory_file_system.dart
@@ -13,7 +13,7 @@
 import 'package:analyzer/src/generated/source_io.dart';
 import 'package:analyzer/src/source/source_resource.dart';
 import 'package:analyzer/src/util/absolute_path.dart';
-import 'package:path/path.dart';
+import 'package:path/path.dart' as pathos;
 import 'package:watcher/watcher.dart';
 
 /**
@@ -29,17 +29,34 @@
       new HashMap<String, List<StreamController<WatchEvent>>>();
   int nextStamp = 0;
 
-  final Context _pathContext;
+  final pathos.Context _pathContext;
 
   @override
   final AbsolutePathContext absolutePathContext;
 
-  MemoryResourceProvider({bool isWindows: false})
-      : _pathContext = isWindows ? windows : posix,
-        absolutePathContext = new AbsolutePathContext(isWindows);
+  MemoryResourceProvider(
+      {pathos.Context context, @deprecated bool isWindows: false})
+      : _pathContext = (context ??= pathos.context),
+        absolutePathContext =
+            new AbsolutePathContext(context.style == pathos.Style.windows);
 
   @override
-  Context get pathContext => _pathContext;
+  pathos.Context get pathContext => _pathContext;
+
+  /**
+   * Convert the given posix [path] to conform to this provider's path context.
+   *
+   * This is a utility method for testing; paths passed in to other methods in
+   * this class are never converted automatically.
+   */
+  String convertPath(String path) {
+    if (pathContext.style == pathos.windows.style &&
+        path.startsWith(pathos.posix.separator)) {
+      path = r'C:' +
+          path.replaceAll(pathos.posix.separator, pathos.windows.separator);
+    }
+    return path;
+  }
 
   /**
    * Delete the file with the given path.
@@ -78,7 +95,13 @@
   File getFile(String path) => new _MemoryFile(this, path);
 
   @override
-  Folder getFolder(String path) => newFolder(path);
+  Folder getFolder(String path) {
+    path = pathContext.normalize(path);
+    if (!pathContext.isAbsolute(path)) {
+      throw new ArgumentError("Path must be absolute : $path");
+    }
+    return new _MemoryFolder(this, path);
+  }
 
   @override
   Future<List<int>> getModificationTimes(List<Source> sources) async {
@@ -213,6 +236,9 @@
   void _checkFileAtPath(String path) {
     _MemoryResource resource = _pathToResource[path];
     if (resource is! _MemoryFile) {
+      if (resource == null) {
+        throw new ArgumentError('File expected at "$path" but does not exist');
+      }
       throw new ArgumentError(
           'File expected at "$path" but ${resource.runtimeType} found');
     }
@@ -280,6 +306,11 @@
   bool get exists => false;
 
   @override
+  int get lengthSync {
+    throw new FileSystemException(path, 'File could not be read');
+  }
+
+  @override
   int get modificationStamp {
     int stamp = _provider._pathToTimestamp[path];
     if (stamp == null) {
@@ -324,9 +355,6 @@
   }
 
   @override
-  Uri toUri() => new Uri.file(path, windows: _provider.pathContext == windows);
-
-  @override
   void writeAsBytesSync(List<int> bytes) {
     throw new FileSystemException(path, 'File could not be written');
   }
@@ -348,6 +376,11 @@
   bool get exists => _provider._pathToResource[path] is _MemoryFile;
 
   @override
+  int get lengthSync {
+    return readAsBytesSync().length;
+  }
+
+  @override
   int get modificationStamp {
     int stamp = _provider._pathToTimestamp[path];
     if (stamp == null) {
@@ -399,9 +432,6 @@
   File resolveSymbolicLinksSync() => this;
 
   @override
-  Uri toUri() => new Uri.file(path, windows: _provider.pathContext == windows);
-
-  @override
   void writeAsBytesSync(List<int> bytes) {
     _provider._setFileContent(this, bytes);
   }
@@ -494,10 +524,6 @@
 
   @override
   Folder resolveSymbolicLinksSync() => this;
-
-  @override
-  Uri toUri() =>
-      new Uri.directory(path, windows: _provider.pathContext == windows);
 }
 
 /**
@@ -535,7 +561,7 @@
     if (parentPath == path) {
       return null;
     }
-    return _provider.getResource(parentPath);
+    return _provider.getFolder(parentPath);
   }
 
   @override
@@ -551,4 +577,7 @@
 
   @override
   String toString() => path;
+
+  @override
+  Uri toUri() => _provider.pathContext.toUri(path);
 }
diff --git a/pkg/analyzer/lib/file_system/physical_file_system.dart b/pkg/analyzer/lib/file_system/physical_file_system.dart
index a9cf94b..411d0d1 100644
--- a/pkg/analyzer/lib/file_system/physical_file_system.dart
+++ b/pkg/analyzer/lib/file_system/physical_file_system.dart
@@ -127,6 +127,15 @@
   Stream<WatchEvent> get changes => new FileWatcher(_entry.path).events;
 
   @override
+  int get lengthSync {
+    try {
+      return _file.lengthSync();
+    } on io.FileSystemException catch (exception) {
+      throw new FileSystemException(exception.path, exception.message);
+    }
+  }
+
+  @override
   int get modificationStamp {
     try {
       return _file.lastModifiedSync().millisecondsSinceEpoch;
diff --git a/pkg/analyzer/lib/source/analysis_options_provider.dart b/pkg/analyzer/lib/source/analysis_options_provider.dart
index cdd912c..90cf8a1 100644
--- a/pkg/analyzer/lib/source/analysis_options_provider.dart
+++ b/pkg/analyzer/lib/source/analysis_options_provider.dart
@@ -8,15 +8,26 @@
 
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/source/source_resource.dart';
+import 'package:analyzer/src/task/options.dart';
 import 'package:analyzer/src/util/yaml.dart';
 import 'package:source_span/source_span.dart';
 import 'package:yaml/yaml.dart';
 
 /// Provide the options found in the analysis options file.
 class AnalysisOptionsProvider {
+  /// The source factory used to resolve include declarations
+  /// in analysis options files or `null` if include is not supported.
+  SourceFactory sourceFactory;
+
+  AnalysisOptionsProvider([this.sourceFactory]);
+
   /// Provide the options found in either
   /// [root]/[AnalysisEngine.ANALYSIS_OPTIONS_FILE] or
   /// [root]/[AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE].
+  /// Recursively merge options referenced by an include directive
+  /// and remove the include directive from the resulting options map.
   /// Return an empty options map if the file does not exist.
   Map<String, YamlNode> getOptions(Folder root, {bool crawlUp: false}) {
     Resource resource;
@@ -30,18 +41,38 @@
         break;
       }
     }
-    String optionsText = _readAnalysisOptionsFile(resource);
-    return getOptionsFromString(optionsText);
+    return getOptionsFromFile(resource);
   }
 
   /// Provide the options found in [file].
+  /// Recursively merge options referenced by an include directive
+  /// and remove the include directive from the resulting options map.
   /// Return an empty options map if the file does not exist.
   Map<String, YamlNode> getOptionsFromFile(File file) {
-    var optionsSource = _readAnalysisOptionsFile(file);
-    return getOptionsFromString(optionsSource);
+    return getOptionsFromSource(new FileSource(file));
+  }
+
+  /// Provide the options found in [source].
+  /// Recursively merge options referenced by an include directive
+  /// and remove the include directive from the resulting options map.
+  /// Return an empty options map if the file does not exist.
+  Map<String, YamlNode> getOptionsFromSource(Source source) {
+    Map<String, YamlNode> options =
+        getOptionsFromString(_readAnalysisOptions(source));
+    YamlNode node = options.remove(AnalyzerOptions.include);
+    if (sourceFactory != null && node is YamlScalar) {
+      var path = node.value;
+      if (path is String) {
+        Source parent = sourceFactory.resolveUri(source, path);
+        options = merge(getOptionsFromSource(parent), options);
+      }
+    }
+    return options;
   }
 
   /// Provide the options found in [optionsSource].
+  /// An include directive, if present, will be left as-is,
+  /// and the referenced options will NOT be merged into the result.
   /// Return an empty options map if the source is null.
   Map<String, YamlNode> getOptionsFromString(String optionsSource) {
     Map<String, YamlNode> options = <String, YamlNode>{};
@@ -110,13 +141,13 @@
           Map<String, YamlNode> defaults, Map<String, YamlNode> overrides) =>
       new Merger().merge(defaults, overrides) as Map<String, YamlNode>;
 
-  /// Read the contents of [file] as a string.
-  /// Returns null if file does not exist.
-  String _readAnalysisOptionsFile(File file) {
+  /// Read the contents of [source] as a string.
+  /// Returns null if source is null or does not exist.
+  String _readAnalysisOptions(Source source) {
     try {
-      return file.readAsStringSync();
-    } on FileSystemException {
-      // File can't be read.
+      return source.contents.data;
+    } catch (e) {
+      // Source can't be read.
       return null;
     }
   }
diff --git a/pkg/analyzer/lib/source/config.dart b/pkg/analyzer/lib/source/config.dart
deleted file mode 100644
index db44b4e..0000000
--- a/pkg/analyzer/lib/source/config.dart
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
-// for 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:analyzer/file_system/file_system.dart';
-import 'package:analyzer/source/analysis_options_provider.dart';
-import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/task/model.dart';
-import 'package:analyzer/task/model.dart';
-import 'package:package_config/packages.dart';
-import 'package:yaml/src/yaml_node.dart';
-import 'package:yaml/yaml.dart';
-
-/// The descriptor used to associate analysis configuration with analysis
-/// contexts in configuration data.
-final ResultDescriptor<AnalysisConfiguration> ANALYSIS_CONFIGURATION =
-    new ResultDescriptorImpl('analysis.config', null);
-
-/// Return configuration associated with this [context], or `null` if there is
-/// none.
-AnalysisConfiguration getConfiguration(AnalysisContext context) =>
-    context.getConfigurationData(ANALYSIS_CONFIGURATION);
-
-/// Associate this [config] with the given [context].
-void setConfiguration(AnalysisContext context, AnalysisConfiguration config) {
-  context.setConfigurationData(ANALYSIS_CONFIGURATION, config);
-}
-
-/// Analysis configuration.
-abstract class AnalysisConfiguration {
-  final AnalysisOptionsProvider optionsProvider = new AnalysisOptionsProvider();
-  final Packages packages;
-  final ResourceProvider resourceProvider;
-  AnalysisConfiguration(this.resourceProvider, this.packages);
-
-  factory AnalysisConfiguration.fromPubspec(
-          File pubspec, ResourceProvider resourceProvider, Packages packages) =>
-      new PubspecConfiguration(pubspec, resourceProvider, packages);
-
-  /// Get a map of options defined by this configuration (or `null` if none
-  /// are specified).
-  Map get options;
-}
-
-/// Describes an analysis configuration.
-class AnalysisConfigurationDescriptor {
-  /// The name of the package hosting the configuration.
-  String package;
-
-  /// The name of the configuration "pragma".
-  String pragma;
-
-  AnalysisConfigurationDescriptor.fromAnalyzerOptions(Map analyzerOptions) {
-    Object config = analyzerOptions['configuration'];
-    if (config is String) {
-      List<String> items = config.split('/');
-      if (items.length == 2) {
-        package = items[0].trim();
-        pragma = items[1].trim();
-      }
-    }
-  }
-
-  /// Return true if this descriptor is valid.
-  bool get isValid => package != null && pragma != null;
-}
-
-/// Pubspec-specified analysis configuration.
-class PubspecConfiguration extends AnalysisConfiguration {
-  final File pubspec;
-  PubspecConfiguration(
-      this.pubspec, ResourceProvider resourceProvider, Packages packages)
-      : super(resourceProvider, packages);
-
-  @override
-  Map get options {
-    //Safest not to cache (requested infrequently).
-    if (pubspec.exists) {
-      try {
-        String contents = pubspec.readAsStringSync();
-        YamlNode map = loadYamlNode(contents);
-        if (map is YamlMap) {
-          YamlNode config = map['analyzer'];
-          if (config is YamlMap) {
-            AnalysisConfigurationDescriptor descriptor =
-                new AnalysisConfigurationDescriptor.fromAnalyzerOptions(config);
-
-            if (descriptor.isValid) {
-              //Create a path, given descriptor and packagemap
-              Uri uri = packages.asMap()[descriptor.package];
-              Uri pragma = new Uri.file('config/${descriptor.pragma}.yaml',
-                  windows: false);
-              Uri optionsUri = uri.resolveUri(pragma);
-              String path = resourceProvider.pathContext.fromUri(optionsUri);
-              File file = resourceProvider.getFile(path);
-              if (file.exists) {
-                return optionsProvider.getOptionsFromFile(file);
-              }
-            }
-          }
-        }
-      } catch (_) {
-        // Skip exceptional configurations.
-      }
-    }
-    return null;
-  }
-}
diff --git a/pkg/analyzer/lib/source/error_processor.dart b/pkg/analyzer/lib/source/error_processor.dart
index b5fe38f..9b09559 100644
--- a/pkg/analyzer/lib/source/error_processor.dart
+++ b/pkg/analyzer/lib/source/error_processor.dart
@@ -8,8 +8,6 @@
 import 'package:analyzer/src/error/codes.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/utilities_general.dart';
-import 'package:analyzer/src/task/options.dart'
-    show CONFIGURED_ERROR_PROCESSORS;
 import 'package:analyzer/src/task/options.dart';
 import 'package:yaml/yaml.dart';
 
@@ -98,8 +96,7 @@
     }
 
     // Let the user configure how specific errors are processed.
-    List<ErrorProcessor> processors =
-        context.getConfigurationData(CONFIGURED_ERROR_PROCESSORS);
+    List<ErrorProcessor> processors = context.analysisOptions.errorProcessors;
 
     // Give strong mode a chance to upgrade it.
     if (context.analysisOptions.strongMode) {
diff --git a/pkg/analyzer/lib/src/analysis_options/error/option_codes.dart b/pkg/analyzer/lib/src/analysis_options/error/option_codes.dart
new file mode 100644
index 0000000..768ec94
--- /dev/null
+++ b/pkg/analyzer/lib/src/analysis_options/error/option_codes.dart
@@ -0,0 +1,151 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analyzer.src.analysis_options.error.option_codes;
+
+import 'package:analyzer/error/error.dart';
+
+/**
+ * The error codes used for errors in analysis options files. The convention for
+ * this class is for the name of the error code to indicate the problem that
+ * caused the error to be generated and for the error message to explain what is
+ * wrong and, when appropriate, how the problem can be corrected.
+ */
+class AnalysisOptionsErrorCode extends ErrorCode {
+  /**
+   * An error code indicating that there is a syntactic error in the file.
+   *
+   * Parameters:
+   * 0: the error message from the parse error
+   */
+  static const AnalysisOptionsErrorCode PARSE_ERROR =
+      const AnalysisOptionsErrorCode('PARSE_ERROR', '{0}');
+
+  /**
+   * An error code indicating that there is a syntactic error
+   * in the included file.
+   *
+   * Parameters:
+   * 0: the path of the file containing the error
+   * 1: the starting offset of the text in the file that contains the error
+   * 2: the ending offset of the text in the file that contains the error
+   * 3: the error message
+   */
+  static const INCLUDED_FILE_PARSE_ERROR = const AnalysisOptionsErrorCode(
+      'INCLUDED_FILE_PARSE_ERROR', '{3} in {0}({1}..{2})');
+
+  /**
+   * Initialize a newly created error code to have the given [name].
+   */
+  const AnalysisOptionsErrorCode(String name, String message,
+      [String correction])
+      : super(name, message, correction);
+
+  @override
+  ErrorSeverity get errorSeverity => ErrorSeverity.ERROR;
+
+  @override
+  ErrorType get type => ErrorType.COMPILE_TIME_ERROR;
+}
+
+/**
+ * The error codes used for warnings in analysis options files. The convention
+ * for this class is for the name of the error code to indicate the problem that
+ * caused the error to be generated and for the error message to explain what is
+ * wrong and, when appropriate, how the problem can be corrected.
+ */
+class AnalysisOptionsWarningCode extends ErrorCode {
+  /**
+   * An error code indicating a specified include file could not be found.
+   *
+   * Parameters:
+   * 0: the uri of the file to be included
+   * 1: the path of the file containing the include directive
+   */
+  static const AnalysisOptionsWarningCode INCLUDE_FILE_NOT_FOUND =
+      const AnalysisOptionsWarningCode('INCLUDE_FILE_NOT_FOUND',
+          "The include file {0} in {1} cannot be found.");
+
+  /**
+   * An error code indicating a specified include file has a warning.
+   *
+   * Parameters:
+   * 0: the path of the file containing the warnings
+   * 1: the starting offset of the text in the file that contains the warning
+   * 2: the ending offset of the text in the file that contains the warning
+   * 3: the warning message
+   */
+  static const AnalysisOptionsWarningCode INCLUDED_FILE_WARNING =
+      const AnalysisOptionsWarningCode('INCLUDED_FILE_WARNING',
+          "Warning in the included options file {0}({1}..{2}): {3}");
+
+  /**
+   * An error code indicating that a plugin is being configured with an
+   * unsupported option and legal options are provided.
+   *
+   * Parameters:
+   * 0: the plugin name
+   * 1: the unsupported option key
+   * 2: legal values
+   */
+  static const AnalysisOptionsWarningCode UNSUPPORTED_OPTION_WITH_LEGAL_VALUES =
+      const AnalysisOptionsWarningCode(
+          'UNSUPPORTED_OPTION_WITH_LEGAL_VALUES',
+          "The option '{1}' isn't supported by '{0}'.",
+          "Try using one of the supported options: {2}.");
+
+  /**
+   * An error code indicating that a plugin is being configured with an
+   * unsupported option where there is just one legal value.
+   *
+   * Parameters:
+   * 0: the plugin name
+   * 1: the unsupported option key
+   * 2: the legal value
+   */
+  static const AnalysisOptionsWarningCode UNSUPPORTED_OPTION_WITH_LEGAL_VALUE =
+      const AnalysisOptionsWarningCode(
+          'UNSUPPORTED_OPTION_WITH_LEGAL_VALUE',
+          "The option '{1}' isn't supported by '{0}'."
+          "Try using the only supported option: '{2}'.");
+
+  /**
+   * An error code indicating that an option entry is being configured with an
+   * unsupported value.
+   *
+   * Parameters:
+   * 0: the option name
+   * 1: the unsupported value
+   * 2: legal values
+   */
+  static const AnalysisOptionsWarningCode UNSUPPORTED_VALUE =
+      const AnalysisOptionsWarningCode(
+          'UNSUPPORTED_VALUE',
+          "The value '{1}' isn't supported by '{0}'.",
+          "Try using one of the supported options: {2}.");
+
+  /**
+   * An error code indicating that an unrecognized error code is being used to
+   * specify an error filter.
+   *
+   * Parameters:
+   * 0: the unrecognized error code
+   */
+  static const AnalysisOptionsWarningCode UNRECOGNIZED_ERROR_CODE =
+      const AnalysisOptionsWarningCode(
+          'UNRECOGNIZED_ERROR_CODE', "'{0}' isn't a recognized error code.");
+
+  /**
+   * Initialize a newly created warning code to have the given [name].
+   */
+  const AnalysisOptionsWarningCode(String name, String message,
+      [String correction])
+      : super(name, message, correction);
+
+  @override
+  ErrorSeverity get errorSeverity => ErrorSeverity.WARNING;
+
+  @override
+  ErrorType get type => ErrorType.STATIC_WARNING;
+}
diff --git a/pkg/analyzer/lib/src/command_line/arguments.dart b/pkg/analyzer/lib/src/command_line/arguments.dart
new file mode 100644
index 0000000..939623d
--- /dev/null
+++ b/pkg/analyzer/lib/src/command_line/arguments.dart
@@ -0,0 +1,254 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 analyzer.src.command_line.arguments;
+
+import 'dart:collection';
+
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/src/context/builder.dart';
+import 'package:analyzer/src/dart/sdk/sdk.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/sdk.dart';
+import 'package:args/args.dart';
+import 'package:path/path.dart';
+
+const String analysisOptionsFileOption = 'options';
+const String defineVariableOption = 'D';
+const String enableInitializingFormalAccessFlag = 'initializing-formal-access';
+const String enableStrictCallChecksFlag = 'enable-strict-call-checks';
+const String enableSuperInMixinFlag = 'supermixin';
+const String ignoreUnrecognizedFlagsFlag = 'ignore_unrecognized_flags';
+const String noImplicitCastsFlag = 'no-implicit-casts';
+const String noImplicitDynamicFlag = 'no-implicit-dynamic';
+const String packageRootOption = 'package-root';
+const String packagesOption = 'packages';
+const String sdkPathOption = 'dart-sdk';
+const String sdkSummaryPathOption = 'dart-sdk-summary';
+const String strongModeFlag = 'strong';
+
+/**
+ * Use the given [resourceProvider], [contentCache] and command-line [args] to
+ * create a context builder.
+ */
+ContextBuilderOptions createContextBuilderOptions(ArgResults args) {
+  ContextBuilderOptions builderOptions = new ContextBuilderOptions();
+  //
+  // File locations.
+  //
+  builderOptions.dartSdkSummaryPath = args[sdkSummaryPathOption];
+  builderOptions.defaultAnalysisOptionsFilePath =
+      args[analysisOptionsFileOption];
+  builderOptions.defaultPackageFilePath = args[packagesOption];
+  builderOptions.defaultPackagesDirectoryPath = args[packageRootOption];
+  //
+  // Analysis options.
+  //
+  AnalysisOptionsImpl defaultOptions = new AnalysisOptionsImpl();
+  defaultOptions.enableStrictCallChecks = args[enableStrictCallChecksFlag];
+  defaultOptions.enableSuperMixins = args[enableSuperInMixinFlag];
+  defaultOptions.implicitCasts = !args[noImplicitCastsFlag];
+  defaultOptions.implicitDynamic = !args[noImplicitDynamicFlag];
+  defaultOptions.strongMode = args[strongModeFlag];
+  builderOptions.defaultOptions = defaultOptions;
+  //
+  // Declared variables.
+  //
+  Map<String, String> declaredVariables = <String, String>{};
+  List<String> variables = args[defineVariableOption] as List<String>;
+  for (String variable in variables) {
+    int index = variable.indexOf('=');
+    if (index < 0) {
+      // TODO (brianwilkerson) Decide the semantics we want in this case.
+      // The VM prints "No value given to -D option", then tries to load '-Dfoo'
+      // as a file and dies. Unless there was nothing after the '-D', in which
+      // case it prints the warning and ignores the option.
+    } else {
+      String name = variable.substring(0, index);
+      if (name.isNotEmpty) {
+        // TODO (brianwilkerson) Decide the semantics we want in the case where
+        // there is no name. If there is no name, the VM tries to load a file
+        // named '-D' and dies.
+        declaredVariables[name] = variable.substring(index + 1);
+      }
+    }
+  }
+  builderOptions.declaredVariables = declaredVariables;
+
+  return builderOptions;
+}
+
+/**
+ * Use the given [resourceProvider] and command-line [args] to create a Dart SDK
+ * manager. The manager will use summary information if [useSummaries] is `true`
+ * and if the summary information exists.
+ */
+DartSdkManager createDartSdkManager(
+    ResourceProvider resourceProvider, bool useSummaries, ArgResults args) {
+  String sdkPath = args[sdkPathOption];
+
+  bool canUseSummaries = useSummaries &&
+      args.rest.every((String sourcePath) {
+        sourcePath = context.absolute(sourcePath);
+        sourcePath = context.normalize(sourcePath);
+        return !context.isWithin(sdkPath, sourcePath);
+      });
+  return new DartSdkManager(
+      sdkPath ?? FolderBasedDartSdk.defaultSdkDirectory(resourceProvider),
+      canUseSummaries);
+}
+
+/**
+ * Add the standard flags and options to the given [parser]. The standard flags
+ * are those that are typically used to control the way in which the code is
+ * analyzed.
+ */
+void defineAnalysisArguments(ArgParser parser) {
+  parser.addOption(defineVariableOption,
+      abbr: 'D',
+      allowMultiple: true,
+      help: 'Define environment variables. For example, "-Dfoo=bar" defines an '
+          'environment variable named "foo" whose value is "bar".');
+  parser.addOption(sdkPathOption, help: 'The path to the Dart SDK.');
+  parser.addOption(sdkSummaryPathOption,
+      help: 'The path to the Dart SDK summary file.', hide: true);
+  parser.addOption(analysisOptionsFileOption,
+      help: 'Path to an analysis options file.');
+  parser.addOption(packagesOption,
+      help: 'The path to the package resolution configuration file, which '
+          'supplies a mapping of package names to paths. This option cannot be '
+          'used with --package-root.');
+  parser.addOption(packageRootOption,
+      abbr: 'p',
+      help: 'The path to a package root directory (deprecated). This option '
+          'cannot be used with --packages.');
+
+  parser.addFlag(strongModeFlag,
+      help: 'Enable strong static checks (https://goo.gl/DqcBsw)');
+  parser.addFlag(noImplicitCastsFlag,
+      negatable: false,
+      help: 'Disable implicit casts in strong mode (https://goo.gl/cTLz40)');
+  parser.addFlag(noImplicitDynamicFlag,
+      negatable: false,
+      help: 'Disable implicit dynamic (https://goo.gl/m0UgXD)');
+  //
+  // Hidden flags and options.
+  //
+//  parser.addFlag(enableNullAwareOperatorsFlag, // 'enable-null-aware-operators'
+//      help: 'Enable support for null-aware operators (DEP 9).',
+//      defaultsTo: false,
+//      negatable: false,
+//      hide: true);
+  parser.addFlag(enableStrictCallChecksFlag,
+      help: 'Fix issue 21938.',
+      defaultsTo: false,
+      negatable: false,
+      hide: true);
+  parser.addFlag(enableInitializingFormalAccessFlag,
+      help:
+          'Enable support for allowing access to field formal parameters in a '
+          'constructor\'s initializer list',
+      defaultsTo: false,
+      negatable: false,
+      hide: true);
+  parser.addFlag(enableSuperInMixinFlag,
+      help: 'Relax restrictions on mixins (DEP 34).',
+      defaultsTo: false,
+      negatable: false,
+      hide: true);
+//  parser.addFlag('enable_type_checks',
+//      help: 'Check types in constant evaluation.',
+//      defaultsTo: false,
+//      negatable: false,
+//      hide: true);
+}
+
+/**
+ * Return a list of command-line arguments containing all of the given [args]
+ * that are defined by the given [parser]. An argument is considered to be
+ * defined by the parser if
+ * - it starts with '--' and the rest of the argument (minus any value
+ *   introduced by '=') is the name of a known option,
+ * - it starts with '-' and the rest of the argument (minus any value
+ *   introduced by '=') is the name of a known abbreviation, or
+ * - it starts with something other than '--' or '-'.
+ *
+ * This function allows command-line tools to implement the
+ * '--ignore_unrecognized_flags' option.
+ */
+List<String> filterUnknownArguments(List<String> args, ArgParser parser) {
+  Set<String> knownOptions = new HashSet<String>();
+  Set<String> knownAbbreviations = new HashSet<String>();
+  parser.options.forEach((String name, Option option) {
+    knownOptions.add(name);
+    String abbreviation = option.abbreviation;
+    if (abbreviation != null) {
+      knownAbbreviations.add(abbreviation);
+    }
+  });
+  String optionName(int prefixLength, String argument) {
+    int equalsOffset = argument.lastIndexOf('=');
+    if (equalsOffset < 0) {
+      return argument.substring(prefixLength);
+    }
+    return argument.substring(prefixLength, equalsOffset);
+  }
+
+  List<String> filtered = <String>[];
+  for (int i = 0; i < args.length; i++) {
+    String argument = args[i];
+    if (argument.startsWith('--') && argument.length > 2) {
+      if (knownOptions.contains(optionName(2, argument))) {
+        filtered.add(argument);
+      }
+    } else if (argument.startsWith('-') && argument.length > 1) {
+      if (knownAbbreviations.contains(optionName(1, argument))) {
+        filtered.add(argument);
+      }
+    } else {
+      filtered.add(argument);
+    }
+  }
+  return filtered;
+}
+
+/**
+ * Use the given [parser] to parse the given command-line [args], and return the
+ * result.
+ */
+ArgResults parse(
+    ResourceProvider provider, ArgParser parser, List<String> args) {
+  args = preprocessArgs(provider, args);
+  if (args.contains('--$ignoreUnrecognizedFlagsFlag')) {
+    args = filterUnknownArguments(args, parser);
+  }
+  return parser.parse(args);
+}
+
+/**
+ * Preprocess the given list of command line [args] by checking whether the real
+ * arguments are in a file (Bazel worker mode).
+ */
+List<String> preprocessArgs(ResourceProvider provider, List<String> args) {
+  if (args.isEmpty) {
+    return args;
+  }
+  String lastArg = args.last;
+  if (lastArg.startsWith('@')) {
+    File argsFile = provider.getFile(lastArg.substring(1));
+    try {
+      List<String> newArgs = args.sublist(0, args.length - 1).toList();
+      newArgs.addAll(argsFile
+          .readAsStringSync()
+          .replaceAll('\r\n', '\n')
+          .replaceAll('\r', '\n')
+          .split('\n')
+          .where((String line) => line.isNotEmpty));
+      return newArgs;
+    } on FileSystemException {
+      // Don't modify args if the file does not exist or cannot be read.
+    }
+  }
+  return args;
+}
diff --git a/pkg/analyzer/lib/src/context/builder.dart b/pkg/analyzer/lib/src/context/builder.dart
index e72f333..5037995 100644
--- a/pkg/analyzer/lib/src/context/builder.dart
+++ b/pkg/analyzer/lib/src/context/builder.dart
@@ -14,9 +14,13 @@
 import 'package:analyzer/source/analysis_options_provider.dart';
 import 'package:analyzer/source/package_map_resolver.dart';
 import 'package:analyzer/src/dart/sdk/sdk.dart';
+import 'package:analyzer/src/generated/bazel.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/summary/package_bundle_reader.dart';
+import 'package:analyzer/src/summary/pub_summary.dart';
+import 'package:analyzer/src/summary/summary_sdk.dart';
 import 'package:analyzer/src/task/options.dart';
 import 'package:package_config/packages.dart';
 import 'package:package_config/packages_file.dart';
@@ -65,6 +69,11 @@
   final ContentCache contentCache;
 
   /**
+   * The options used by the context builder.
+   */
+  final ContextBuilderOptions builderOptions;
+
+  /**
    * The resolver provider used to create a package: URI resolver, or `null` if
    * the normal (Package Specification DEP) lookup mechanism is to be used.
    */
@@ -77,44 +86,12 @@
   ResolverProvider fileResolverProvider;
 
   /**
-   * The file path of the .packages file that should be used in place of any
-   * file found using the normal (Package Specification DEP) lookup mechanism,
-   * or `null` if the normal lookup mechanism should be used.
-   */
-  String defaultPackageFilePath;
-
-  /**
-   * The file path of the packages directory that should be used in place of any
-   * file found using the normal (Package Specification DEP) lookup mechanism,
-   * or `null` if the normal lookup mechanism should be used.
-   */
-  String defaultPackagesDirectoryPath;
-
-  /**
-   * The file path of the analysis options file that should be used in place of
-   * any file in the root directory or a parent of the root directory, or `null`
-   * if the normal lookup mechanism should be used.
-   */
-  String defaultAnalysisOptionsFilePath;
-
-  /**
-   * The default analysis options that should be used unless some or all of them
-   * are overridden in the analysis options file, or `null` if the default
-   * defaults should be used.
-   */
-  AnalysisOptions defaultOptions;
-
-  /**
-   * A table mapping variable names to values for the declared variables, or
-   * `null` if no additional variables should be declared.
-   */
-  Map<String, String> declaredVariables;
-
-  /**
    * Initialize a newly created builder to be ready to build a context rooted in
    * the directory with the given [rootDirectoryPath].
    */
-  ContextBuilder(this.resourceProvider, this.sdkManager, this.contentCache);
+  ContextBuilder(this.resourceProvider, this.sdkManager, this.contentCache,
+      {ContextBuilderOptions options})
+      : builderOptions = options ?? new ContextBuilderOptions();
 
   /**
    * Return an analysis context that is configured correctly to analyze code in
@@ -132,9 +109,29 @@
     context.name = path;
     //_processAnalysisOptions(context, optionMap);
     declareVariables(context);
+    configureSummaries(context);
     return context;
   }
 
+  /**
+   * Configure the context to make use of summaries.
+   */
+  void configureSummaries(InternalAnalysisContext context) {
+    PubSummaryManager manager = builderOptions.pubSummaryManager;
+    if (manager != null) {
+      List<LinkedPubPackage> linkedBundles = manager.getLinkedBundles(context);
+      if (linkedBundles.isNotEmpty) {
+        SummaryDataStore store = new SummaryDataStore([]);
+        for (LinkedPubPackage package in linkedBundles) {
+          store.addBundle(null, package.unlinked);
+          store.addBundle(null, package.linked);
+        }
+        context.resultProvider =
+            new InputPackagesResultProvider(context, store);
+      }
+    }
+  }
+
   Map<String, List<Folder>> convertPackagesToMap(Packages packages) {
     Map<String, List<Folder>> folderMap = new HashMap<String, List<Folder>>();
     if (packages != null && packages != Packages.noPackages) {
@@ -173,6 +170,7 @@
    * Return an analysis options object containing the default option values.
    */
   AnalysisOptions createDefaultOptions() {
+    AnalysisOptions defaultOptions = builderOptions.defaultOptions;
     if (defaultOptions == null) {
       return new AnalysisOptionsImpl();
     }
@@ -180,51 +178,40 @@
   }
 
   Packages createPackageMap(String rootDirectoryPath) {
-    if (defaultPackageFilePath != null) {
-      File configFile = resourceProvider.getFile(defaultPackageFilePath);
+    String filePath = builderOptions.defaultPackageFilePath;
+    if (filePath != null) {
+      File configFile = resourceProvider.getFile(filePath);
       List<int> bytes = configFile.readAsBytesSync();
       Map<String, Uri> map = parse(bytes, configFile.toUri());
       resolveSymbolicLinks(map);
       return new MapPackages(map);
-    } else if (defaultPackagesDirectoryPath != null) {
-      Folder folder = resourceProvider.getFolder(defaultPackagesDirectoryPath);
+    }
+    String directoryPath = builderOptions.defaultPackagesDirectoryPath;
+    if (directoryPath != null) {
+      Folder folder = resourceProvider.getFolder(directoryPath);
       return getPackagesFromFolder(folder);
     }
     return findPackagesFromFile(rootDirectoryPath);
   }
 
-  SourceFactory createSourceFactory(
-      String rootDirectoryPath, AnalysisOptions options) {
-    Folder _folder = null;
-    Folder folder() {
-      return _folder ??= resourceProvider.getFolder(rootDirectoryPath);
+  SourceFactory createSourceFactory(String rootPath, AnalysisOptions options) {
+    BazelWorkspace bazelWorkspace =
+        BazelWorkspace.find(resourceProvider, rootPath);
+    if (bazelWorkspace != null) {
+      List<UriResolver> resolvers = <UriResolver>[
+        new DartUriResolver(findSdk(null, options)),
+        new BazelPackageUriResolver(bazelWorkspace),
+        new BazelFileUriResolver(bazelWorkspace)
+      ];
+      return new SourceFactory(resolvers, null, resourceProvider);
     }
 
-    UriResolver fileResolver;
-    if (fileResolverProvider != null) {
-      fileResolver = fileResolverProvider(folder());
-    }
-    fileResolver ??= new ResourceUriResolver(resourceProvider);
-    if (packageResolverProvider != null) {
-      UriResolver packageResolver = packageResolverProvider(folder());
-      if (packageResolver != null) {
-        // TODO(brianwilkerson) This doesn't support either embedder files or
-        // sdk extensions because we don't have a way to get the package map
-        // from the resolver.
-        List<UriResolver> resolvers = <UriResolver>[
-          new DartUriResolver(findSdk(null, options)),
-          packageResolver,
-          fileResolver
-        ];
-        return new SourceFactory(resolvers, null, resourceProvider);
-      }
-    }
-    Packages packages = createPackageMap(rootDirectoryPath);
+    Packages packages = createPackageMap(rootPath);
     Map<String, List<Folder>> packageMap = convertPackagesToMap(packages);
     List<UriResolver> resolvers = <UriResolver>[
       new DartUriResolver(findSdk(packageMap, options)),
       new PackageMapUriResolver(resourceProvider, packageMap),
-      fileResolver
+      new ResourceUriResolver(resourceProvider)
     ];
     return new SourceFactory(resolvers, packages, resourceProvider);
   }
@@ -234,9 +221,10 @@
    * given [context].
    */
   void declareVariables(InternalAnalysisContext context) {
-    if (declaredVariables != null && declaredVariables.isNotEmpty) {
+    Map<String, String> variables = builderOptions.declaredVariables;
+    if (variables != null && variables.isNotEmpty) {
       DeclaredVariables contextVariables = context.declaredVariables;
-      declaredVariables.forEach((String variableName, String value) {
+      variables.forEach((String variableName, String value) {
         contextVariables.define(variableName, value);
       });
     }
@@ -268,11 +256,14 @@
 
   /**
    * Return the SDK that should be used to analyze code. Use the given
-   * [packageMap] and [options] to locate the SDK.
+   * [packageMap] and [analysisOptions] to locate the SDK.
    */
   DartSdk findSdk(
-      Map<String, List<Folder>> packageMap, AnalysisOptions options) {
-    if (packageMap != null) {
+      Map<String, List<Folder>> packageMap, AnalysisOptions analysisOptions) {
+    String summaryPath = builderOptions.dartSdkSummaryPath;
+    if (summaryPath != null) {
+      return new SummaryBasedDartSdk(summaryPath, analysisOptions.strongMode);
+    } else if (packageMap != null) {
       SdkExtensionFinder extFinder = new SdkExtensionFinder(packageMap);
       List<String> extFilePaths = extFinder.extensionFilePaths;
       EmbedderYamlLocator locator = new EmbedderYamlLocator(packageMap);
@@ -291,12 +282,12 @@
               .path);
         }
         paths.addAll(extFilePaths);
-        SdkDescription description = new SdkDescription(paths, options);
+        SdkDescription description = new SdkDescription(paths, analysisOptions);
         DartSdk dartSdk = sdkManager.getSdk(description, () {
           if (extFilePaths.isNotEmpty) {
             embedderSdk.addExtensions(extFinder.urlMappings);
           }
-          embedderSdk.analysisOptions = options;
+          embedderSdk.analysisOptions = analysisOptions;
           embedderSdk.useSummary = sdkManager.canUseSummaries;
           return embedderSdk;
         });
@@ -308,25 +299,26 @@
         String sdkPath = sdkManager.defaultSdkDirectory;
         List<String> paths = <String>[sdkPath];
         paths.addAll(extFilePaths);
-        SdkDescription description = new SdkDescription(paths, options);
+        SdkDescription description = new SdkDescription(paths, analysisOptions);
         return sdkManager.getSdk(description, () {
           FolderBasedDartSdk sdk = new FolderBasedDartSdk(
               resourceProvider, resourceProvider.getFolder(sdkPath));
           if (extFilePaths.isNotEmpty) {
             sdk.addExtensions(extFinder.urlMappings);
           }
-          sdk.analysisOptions = options;
+          sdk.analysisOptions = analysisOptions;
           sdk.useSummary = sdkManager.canUseSummaries;
           return sdk;
         });
       }
     }
     String sdkPath = sdkManager.defaultSdkDirectory;
-    SdkDescription description = new SdkDescription(<String>[sdkPath], options);
+    SdkDescription description =
+        new SdkDescription(<String>[sdkPath], analysisOptions);
     return sdkManager.getSdk(description, () {
-      FolderBasedDartSdk sdk = new FolderBasedDartSdk(
-          resourceProvider, resourceProvider.getFolder(sdkPath));
-      sdk.analysisOptions = options;
+      FolderBasedDartSdk sdk = new FolderBasedDartSdk(resourceProvider,
+          resourceProvider.getFolder(sdkPath), analysisOptions.strongMode);
+      sdk.analysisOptions = analysisOptions;
       sdk.useSummary = sdkManager.canUseSummaries;
       return sdk;
     });
@@ -342,9 +334,20 @@
     if (optionsFile != null) {
       List<OptionsProcessor> optionsProcessors =
           AnalysisEngine.instance.optionsPlugin.optionsProcessors;
+      // TODO(danrubel) restructure so that we don't recalculate the package map
+      // more than once per path.
+      Packages packages = createPackageMap(path);
+      Map<String, List<Folder>> packageMap = convertPackagesToMap(packages);
+      List<UriResolver> resolvers = <UriResolver>[
+        new ResourceUriResolver(resourceProvider),
+        new PackageMapUriResolver(resourceProvider, packageMap),
+      ];
+      SourceFactory sourceFactory =
+          new SourceFactory(resolvers, packages, resourceProvider);
       try {
         Map<String, YamlNode> optionMap =
-            new AnalysisOptionsProvider().getOptionsFromFile(optionsFile);
+            new AnalysisOptionsProvider(sourceFactory)
+                .getOptionsFromFile(optionsFile);
         optionsProcessors.forEach(
             (OptionsProcessor p) => p.optionsProcessed(context, optionMap));
         applyToAnalysisOptions(options, optionMap);
@@ -360,8 +363,9 @@
    * the directory with the given [path].
    */
   File getOptionsFile(String path) {
-    if (defaultAnalysisOptionsFilePath != null) {
-      return resourceProvider.getFile(defaultAnalysisOptionsFilePath);
+    String filePath = builderOptions.defaultAnalysisOptionsFilePath;
+    if (filePath != null) {
+      return resourceProvider.getFile(filePath);
     }
     Folder root = resourceProvider.getFolder(path);
     for (Folder folder = root; folder != null; folder = folder.parent) {
@@ -478,6 +482,62 @@
 }
 
 /**
+ * Options used by a [ContextBuilder].
+ */
+class ContextBuilderOptions {
+  /**
+   * The file path of the file containing the summary of the SDK that should be
+   * used to "analyze" the SDK. This option should only be specified by
+   * command-line tools such as 'dartanalyzer' or 'ddc'.
+   */
+  String dartSdkSummaryPath;
+
+  /**
+   * The file path of the analysis options file that should be used in place of
+   * any file in the root directory or a parent of the root directory, or `null`
+   * if the normal lookup mechanism should be used.
+   */
+  String defaultAnalysisOptionsFilePath;
+
+  /**
+   * A table mapping variable names to values for the declared variables, or
+   * `null` if no additional variables should be declared.
+   */
+  Map<String, String> declaredVariables;
+
+  /**
+   * The default analysis options that should be used unless some or all of them
+   * are overridden in the analysis options file, or `null` if the default
+   * defaults should be used.
+   */
+  AnalysisOptions defaultOptions;
+
+  /**
+   * The file path of the .packages file that should be used in place of any
+   * file found using the normal (Package Specification DEP) lookup mechanism,
+   * or `null` if the normal lookup mechanism should be used.
+   */
+  String defaultPackageFilePath;
+
+  /**
+   * The file path of the packages directory that should be used in place of any
+   * file found using the normal (Package Specification DEP) lookup mechanism,
+   * or `null` if the normal lookup mechanism should be used.
+   */
+  String defaultPackagesDirectoryPath;
+
+  /**
+   * The manager of pub package summaries.
+   */
+  PubSummaryManager pubSummaryManager;
+
+  /**
+   * Initialize a newly created set of options
+   */
+  ContextBuilderOptions();
+}
+
+/**
  * Given a package map, check in each package's lib directory for the existence
  * of an `_embedder.yaml` file. If the file contains a top level YamlMap, it
  * will be added to the [embedderYamls] map.
diff --git a/pkg/analyzer/lib/src/context/cache.dart b/pkg/analyzer/lib/src/context/cache.dart
index bf981e5..ef78031 100644
--- a/pkg/analyzer/lib/src/context/cache.dart
+++ b/pkg/analyzer/lib/src/context/cache.dart
@@ -1229,7 +1229,8 @@
    */
   CacheFlushManager _getFlushManager(ResultDescriptor descriptor) {
     ResultCachingPolicy policy = descriptor.cachingPolicy;
-    if (identical(policy, DEFAULT_CACHING_POLICY)) {
+    if (identical(policy, DEFAULT_CACHING_POLICY) ||
+        context.analysisOptions.disableCacheFlushing) {
       return UnlimitedCacheFlushManager.INSTANCE;
     }
     CacheFlushManager manager = _flushManagerMap[policy];
diff --git a/pkg/analyzer/lib/src/context/context.dart b/pkg/analyzer/lib/src/context/context.dart
index f56c12c..30d48e2 100644
--- a/pkg/analyzer/lib/src/context/context.dart
+++ b/pkg/analyzer/lib/src/context/context.dart
@@ -30,7 +30,6 @@
 import 'package:analyzer/src/task/driver.dart';
 import 'package:analyzer/src/task/incremental_element_builder.dart';
 import 'package:analyzer/src/task/manager.dart';
-import 'package:analyzer/src/task/model.dart';
 import 'package:analyzer/task/dart.dart';
 import 'package:analyzer/task/general.dart';
 import 'package:analyzer/task/html.dart';
@@ -38,13 +37,6 @@
 import 'package:html/dom.dart' show Document;
 
 /**
- * The descriptor used to associate exclude patterns with an analysis context in
- * configuration data.
- */
-final ListResultDescriptor<String> CONTEXT_EXCLUDES =
-    new ListResultDescriptorImpl('CONTEXT_EXCLUDES', const <String>[]);
-
-/**
  * Type of callback functions used by PendingFuture. Functions of this type
  * should perform a computation based on the data in [entry] and return it. If
  * the computation can't be performed yet because more analysis is needed,
@@ -281,15 +273,18 @@
             options.generateImplicitErrors ||
         this._options.generateSdkErrors != options.generateSdkErrors ||
         this._options.dart2jsHint != options.dart2jsHint ||
+        _notEqual(this._options.errorProcessors, options.errorProcessors) ||
+        _notEqual(this._options.excludePatterns, options.excludePatterns) ||
         (this._options.hint && !options.hint) ||
         (this._options.lint && !options.lint) ||
+        _notEqual(this._options.lintRules, options.lintRules) ||
         this._options.preserveComments != options.preserveComments ||
         this._options.strongMode != options.strongMode ||
         this._options.enableAssertInitializer !=
             options.enableAssertInitializer ||
         this._options.enableAssertMessage != options.enableAssertMessage ||
-        this._options.enableInitializingFormalAccess !=
-            options.enableInitializingFormalAccess ||
+        this._options.enableLazyAssignmentOperators !=
+            options.enableLazyAssignmentOperators ||
         ((options is AnalysisOptionsImpl)
             ? this._options.strongModeHints != options.strongModeHints
             : false) ||
@@ -304,37 +299,37 @@
             : false) ||
         this._options.enableStrictCallChecks !=
             options.enableStrictCallChecks ||
-        this._options.enableGenericMethods != options.enableGenericMethods ||
-        this._options.enableSuperMixins != options.enableSuperMixins;
-    int cacheSize = options.cacheSize;
-    if (this._options.cacheSize != cacheSize) {
-      this._options.cacheSize = cacheSize;
-    }
+        this._options.enableSuperMixins != options.enableSuperMixins ||
+        this._options.patchPlatform != options.patchPlatform;
     this._options.analyzeFunctionBodiesPredicate =
         options.analyzeFunctionBodiesPredicate;
     this._options.generateImplicitErrors = options.generateImplicitErrors;
     this._options.generateSdkErrors = options.generateSdkErrors;
     this._options.dart2jsHint = options.dart2jsHint;
-    this._options.enableGenericMethods = options.enableGenericMethods;
     this._options.enableAssertInitializer = options.enableAssertInitializer;
     this._options.enableAssertMessage = options.enableAssertMessage;
     this._options.enableStrictCallChecks = options.enableStrictCallChecks;
-    this._options.enableInitializingFormalAccess =
-        options.enableInitializingFormalAccess;
+    this._options.enableLazyAssignmentOperators =
+        options.enableLazyAssignmentOperators;
     this._options.enableSuperMixins = options.enableSuperMixins;
     this._options.enableTiming = options.enableTiming;
+    this._options.errorProcessors = options.errorProcessors;
+    this._options.excludePatterns = options.excludePatterns;
     this._options.hint = options.hint;
     this._options.incremental = options.incremental;
     this._options.incrementalApi = options.incrementalApi;
     this._options.incrementalValidation = options.incrementalValidation;
     this._options.lint = options.lint;
+    this._options.lintRules = options.lintRules;
     this._options.preserveComments = options.preserveComments;
     if (this._options.strongMode != options.strongMode) {
       _typeSystem = null;
     }
     this._options.strongMode = options.strongMode;
     this._options.trackCacheDependencies = options.trackCacheDependencies;
+    this._options.disableCacheFlushing = options.disableCacheFlushing;
     this._options.finerGrainedInvalidation = options.finerGrainedInvalidation;
+    this._options.patchPlatform = options.patchPlatform;
     if (options is AnalysisOptionsImpl) {
       this._options.strongModeHints = options.strongModeHints;
       this._options.implicitCasts = options.implicitCasts;
@@ -719,6 +714,12 @@
     CacheEntry entry = getCacheEntry(target);
     CacheState state = entry.getState(descriptor);
     if (state == CacheState.FLUSHED || state == CacheState.INVALID) {
+      // Check the result provider.
+      bool success = aboutToComputeResult(entry, descriptor);
+      if (success) {
+        return entry.getValue(descriptor);
+      }
+      // Compute the result.
       driver.computeResult(target, descriptor);
       entry = getCacheEntry(target);
     }
@@ -840,6 +841,7 @@
     return getResult(target, COMPILATION_UNIT_ELEMENT);
   }
 
+  @deprecated
   @override
   Object/*=V*/ getConfigurationData/*<V>*/(ResultDescriptor/*<V>*/ key) =>
       (_configurationData[key] ?? key?.defaultValue) as Object/*=V*/;
@@ -1300,6 +1302,7 @@
     }
   }
 
+  @deprecated
   @override
   void setConfigurationData(ResultDescriptor key, Object data) {
     _configurationData[key] = data;
@@ -1689,6 +1692,19 @@
     AnalysisEngine.instance.logger.logInformation(message);
   }
 
+  bool _notEqual/*<T>*/(List/*<T>*/ first, List/*<T>*/ second) {
+    int length = first.length;
+    if (length != second.length) {
+      return true;
+    }
+    for (int i = 0; i < length; i++) {
+      if (first[i] != second[i]) {
+        return true;
+      }
+    }
+    return false;
+  }
+
   /**
    * Notify all of the analysis listeners that the errors associated with the
    * given [source] has been updated to the given [errors].
diff --git a/pkg/analyzer/lib/src/dart/analysis/byte_store.dart b/pkg/analyzer/lib/src/dart/analysis/byte_store.dart
new file mode 100644
index 0000000..3f3f5db
--- /dev/null
+++ b/pkg/analyzer/lib/src/dart/analysis/byte_store.dart
@@ -0,0 +1,100 @@
+// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
+// for 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:collection';
+
+/**
+ * Store of bytes associated with string keys.
+ *
+ * Each key must be not longer than 100 characters and consist of only `[a-z]`,
+ * `[0-9]`, `.` and `_` characters. The key cannot be an empty string, the
+ * literal `.`, or contain the sequence `..`.
+ *
+ * Note that associations are not guaranteed to be persistent. The value
+ * associated with a key can change or become `null` at any point in time.
+ *
+ * TODO(scheglov) Research using asynchronous API.
+ */
+abstract class ByteStore {
+  /**
+   * Return the bytes associated with the given [key].
+   * Return `null` if the association does not exist.
+   */
+  List<int> get(String key);
+
+  /**
+   * Associate the given [bytes] with the [key].
+   */
+  void put(String key, List<int> bytes);
+}
+
+/**
+ * [ByteStore] which stores data only in memory.
+ */
+class MemoryByteStore implements ByteStore {
+  final Map<String, List<int>> _map = {};
+
+  @override
+  List<int> get(String key) {
+    return _map[key];
+  }
+
+  @override
+  void put(String key, List<int> bytes) {
+    _map[key] = bytes;
+  }
+}
+
+/**
+ * A wrapper around [ByteStore] which adds an in-memory LRU cache to it.
+ */
+class MemoryCachingByteStore implements ByteStore {
+  final ByteStore _store;
+  final int _maxSizeBytes;
+
+  final _map = new LinkedHashMap<String, List<int>>();
+  int _currentSizeBytes = 0;
+
+  MemoryCachingByteStore(this._store, this._maxSizeBytes);
+
+  @override
+  List<int> get(String key) {
+    List<int> bytes = _map.remove(key);
+    if (bytes == null) {
+      bytes = _store.get(key);
+      if (bytes != null) {
+        _map[key] = bytes;
+        _currentSizeBytes += bytes.length;
+        _evict();
+      }
+    } else {
+      _map[key] = bytes;
+    }
+    return bytes;
+  }
+
+  @override
+  void put(String key, List<int> bytes) {
+    _store.put(key, bytes);
+    _currentSizeBytes -= _map[key]?.length ?? 0;
+    _map[key] = bytes;
+    _currentSizeBytes += bytes.length;
+    _evict();
+  }
+
+  void _evict() {
+    while (_currentSizeBytes > _maxSizeBytes) {
+      if (_map.isEmpty) {
+        // Should be impossible, since _currentSizeBytes should always match
+        // _map.  But recover anyway.
+        assert(false);
+        _currentSizeBytes = 0;
+        break;
+      }
+      String key = _map.keys.first;
+      List<int> bytes = _map.remove(key);
+      _currentSizeBytes -= bytes.length;
+    }
+  }
+}
diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart
new file mode 100644
index 0000000..a903243
--- /dev/null
+++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart
@@ -0,0 +1,1308 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:collection';
+import 'dart:typed_data';
+
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/element/element.dart' show CompilationUnitElement;
+import 'package:analyzer/error/error.dart';
+import 'package:analyzer/error/listener.dart';
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/src/context/context.dart';
+import 'package:analyzer/src/dart/analysis/byte_store.dart';
+import 'package:analyzer/src/dart/analysis/file_state.dart';
+import 'package:analyzer/src/dart/analysis/index.dart';
+import 'package:analyzer/src/dart/analysis/search.dart';
+import 'package:analyzer/src/dart/analysis/status.dart';
+import 'package:analyzer/src/generated/engine.dart'
+    show AnalysisContext, AnalysisEngine, AnalysisOptions, ChangeSet;
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/summary/api_signature.dart';
+import 'package:analyzer/src/summary/format.dart';
+import 'package:analyzer/src/summary/idl.dart';
+import 'package:analyzer/src/summary/link.dart';
+import 'package:analyzer/src/summary/package_bundle_reader.dart';
+import 'package:analyzer/src/task/dart.dart' show COMPILATION_UNIT_ELEMENT;
+import 'package:analyzer/task/dart.dart' show LibrarySpecificUnit;
+
+/**
+ * This class computes [AnalysisResult]s for Dart files.
+ *
+ * Let the set of "explicitly analyzed files" denote the set of paths that have
+ * been passed to [addFile] but not subsequently passed to [removeFile]. Let
+ * the "current analysis results" denote the map from the set of explicitly
+ * analyzed files to the most recent [AnalysisResult] delivered to [results]
+ * for each file. Let the "current file state" represent a map from file path
+ * to the file contents most recently read from that file, or fetched from the
+ * content cache (considering all possible possible file paths, regardless of
+ * whether they're in the set of explicitly analyzed files). Let the
+ * "analysis state" be either "analyzing" or "idle".
+ *
+ * (These are theoretical constructs; they may not necessarily reflect data
+ * structures maintained explicitly by the driver).
+ *
+ * Then we make the following guarantees:
+ *
+ *    - Whenever the analysis state is idle, the current analysis results are
+ *      consistent with the current file state.
+ *
+ *    - A call to [addFile] or [changeFile] causes the analysis state to
+ *      transition to "analyzing", and schedules the contents of the given
+ *      files to be read into the current file state prior to the next time
+ *      the analysis state transitions back to "idle".
+ *
+ *    - If at any time the client stops making calls to [addFile], [changeFile],
+ *      and [removeFile], the analysis state will eventually transition back to
+ *      "idle" after a finite amount of processing.
+ *
+ * As a result of these guarantees, a client may ensure that the analysis
+ * results are "eventually consistent" with the file system by simply calling
+ * [changeFile] any time the contents of a file on the file system have changed.
+ *
+ *
+ * TODO(scheglov) Clean up the list of implicitly analyzed files.
+ *
+ * TODO(scheglov) Handle not existing 'dart:x' URIs (while user is typing).
+ */
+class AnalysisDriver {
+  /**
+   * The version of data format, should be incremented on every format change.
+   */
+  static const int DATA_VERSION = 9;
+
+  /**
+   * The name of the driver, e.g. the name of the folder.
+   */
+  String name;
+
+  /**
+   * The scheduler that schedules analysis work in this, and possibly other
+   * analysis drivers.
+   */
+  final AnalysisDriverScheduler _scheduler;
+
+  /**
+   * The logger to write performed operations and performance to.
+   */
+  final PerformanceLog _logger;
+
+  /**
+   * The resource provider for working with files.
+   */
+  final ResourceProvider _resourceProvider;
+
+  /**
+   * The byte storage to get and put serialized data.
+   *
+   * It can be shared with other [AnalysisDriver]s.
+   */
+  final ByteStore _byteStore;
+
+  /**
+   * This [ContentCache] is consulted for a file content before reading
+   * the content from the file.
+   */
+  final FileContentOverlay _contentOverlay;
+
+  /**
+   * The [SourceFactory] is used to resolve URIs to paths and restore URIs
+   * from file paths.
+   */
+  final SourceFactory sourceFactory;
+
+  /**
+   * The analysis options to analyze with.
+   */
+  final AnalysisOptions analysisOptions;
+
+  /**
+   * The salt to mix into all hashes used as keys for serialized data.
+   */
+  final Uint32List _salt =
+      new Uint32List(1 + AnalysisOptions.crossContextOptionsLength);
+
+  /**
+   * The current file system state.
+   */
+  FileSystemState _fsState;
+
+  /**
+   * The combined unlinked and linked package for the SDK, extracted from
+   * the given [_sourceFactory].
+   */
+  PackageBundle _sdkBundle;
+
+  /**
+   * The set of explicitly analyzed files.
+   */
+  final _explicitFiles = new LinkedHashSet<String>();
+
+  /**
+   * The set of priority files, that should be analyzed sooner.
+   */
+  final _priorityFiles = new LinkedHashSet<String>();
+
+  /**
+   * The mapping from the files for which analysis was requested using
+   * [getResult] to the [Completer]s to report the result.
+   */
+  final _requestedFiles = <String, List<Completer<AnalysisResult>>>{};
+
+  /**
+   * The list of tasks to compute files referencing a name.
+   */
+  final _referencingNameTasks = <_FilesReferencingNameTask>[];
+
+  /**
+   * The mapping from the files for which the index was requested using
+   * [getIndex] to the [Completer]s to report the result.
+   */
+  final _indexRequestedFiles = <String, List<Completer<IndexResult>>>{};
+
+  /**
+   * The set of files were reported as changed through [changeFile] and not
+   * checked for actual changes yet.
+   */
+  final _changedFiles = new LinkedHashSet<String>();
+
+  /**
+   * The set of files that are currently scheduled for analysis.
+   */
+  final _filesToAnalyze = new LinkedHashSet<String>();
+
+  /**
+   * The mapping from the files for which analysis was requested using
+   * [getResult], and which were found to be parts without known libraries,
+   * to the [Completer]s to report the result.
+   */
+  final _requestedParts = <String, List<Completer<AnalysisResult>>>{};
+
+  /**
+   * The set of part files that are currently scheduled for analysis.
+   */
+  final _partsToAnalyze = new LinkedHashSet<String>();
+
+  /**
+   * The controller for the [results] stream.
+   */
+  final _resultController = new StreamController<AnalysisResult>();
+
+  /**
+   * The instance of the status helper.
+   */
+  final StatusSupport _statusSupport = new StatusSupport();
+
+  /**
+   * The instance of the [Search] helper.
+   */
+  Search _search;
+
+  /**
+   * Create a new instance of [AnalysisDriver].
+   *
+   * The given [SourceFactory] is cloned to ensure that it does not contain a
+   * reference to a [AnalysisContext] in which it could have been used.
+   */
+  AnalysisDriver(
+      this._scheduler,
+      this._logger,
+      this._resourceProvider,
+      this._byteStore,
+      this._contentOverlay,
+      SourceFactory sourceFactory,
+      this.analysisOptions)
+      : sourceFactory = sourceFactory.clone() {
+    _fillSalt();
+    _sdkBundle = sourceFactory.dartSdk.getLinkedBundle();
+    _fsState = new FileSystemState(
+        _logger,
+        _byteStore,
+        _contentOverlay,
+        _resourceProvider,
+        sourceFactory,
+        analysisOptions,
+        _salt,
+        _sdkBundle.apiSignature);
+    _scheduler._add(this);
+    _search = new Search(this);
+  }
+
+  /**
+   * Return the set of files added to analysis using [addFile].
+   */
+  Set<String> get addedFiles => _explicitFiles;
+
+  /**
+   * Return the set of files that are known, i.e. added or used implicitly.
+   */
+  Set<String> get knownFiles => _fsState.knownFiles;
+
+  /**
+   * Set the list of files that the driver should try to analyze sooner.
+   *
+   * Every path in the list must be absolute and normalized.
+   *
+   * The driver will produce the results through the [results] stream. The
+   * exact order in which results are produced is not defined, neither
+   * between priority files, nor between priority and non-priority files.
+   */
+  void set priorityFiles(List<String> priorityPaths) {
+    _priorityFiles.clear();
+    _priorityFiles.addAll(priorityPaths);
+    _statusSupport.transitionToAnalyzing();
+    _scheduler._notify(this);
+  }
+
+  /**
+   * Return the [Stream] that produces [AnalysisResult]s for added files.
+   *
+   * Note that the stream supports only one single subscriber.
+   *
+   * Analysis starts when the [AnalysisDriverScheduler] is started and the
+   * driver is added to it. The analysis state transitions to "analyzing" and
+   * an analysis result is produced for every added file prior to the next time
+   * the analysis state transitions to "idle".
+   *
+   * At least one analysis result is produced for every file passed to
+   * [addFile] or [changeFile] prior to the next time the analysis state
+   * transitions to "idle", unless the file is later removed from analysis
+   * using [removeFile]. Analysis results for other files are produced only if
+   * the changes affect analysis results of other files.
+   *
+   * More than one result might be produced for the same file, even if the
+   * client does not change the state of the files.
+   *
+   * Results might be produced even for files that have never been added
+   * using [addFile], for example when [getResult] was called for a file.
+   */
+  Stream<AnalysisResult> get results => _resultController.stream;
+
+  /**
+   * Return the search support for the driver.
+   */
+  Search get search => _search;
+
+  /**
+   * Return the stream that produces [AnalysisStatus] events.
+   */
+  Stream<AnalysisStatus> get status => _statusSupport.stream;
+
+  /**
+   * Return the priority of work that the driver needs to perform.
+   */
+  AnalysisDriverPriority get _workPriority {
+    if (_requestedFiles.isNotEmpty) {
+      return AnalysisDriverPriority.interactive;
+    }
+    if (_referencingNameTasks.isNotEmpty) {
+      return AnalysisDriverPriority.referencingName;
+    }
+    if (_indexRequestedFiles.isNotEmpty) {
+      return AnalysisDriverPriority.getIndex;
+    }
+    if (_priorityFiles.isNotEmpty) {
+      for (String path in _priorityFiles) {
+        if (_filesToAnalyze.contains(path)) {
+          return AnalysisDriverPriority.priority;
+        }
+      }
+    }
+    if (_filesToAnalyze.isNotEmpty) {
+      return AnalysisDriverPriority.general;
+    }
+    if (_changedFiles.isNotEmpty) {
+      return AnalysisDriverPriority.general;
+    }
+    if (_requestedParts.isNotEmpty || _partsToAnalyze.isNotEmpty) {
+      return AnalysisDriverPriority.general;
+    }
+    _statusSupport.transitionToIdle();
+    return AnalysisDriverPriority.nothing;
+  }
+
+  /**
+   * Add the file with the given [path] to the set of files to analyze.
+   *
+   * The [path] must be absolute and normalized.
+   *
+   * The results of analysis are eventually produced by the [results] stream.
+   */
+  void addFile(String path) {
+    if (AnalysisEngine.isDartFileName(path)) {
+      _explicitFiles.add(path);
+      _filesToAnalyze.add(path);
+    }
+    _statusSupport.transitionToAnalyzing();
+    _scheduler._notify(this);
+  }
+
+  /**
+   * The file with the given [path] might have changed - updated, added or
+   * removed. Or not, we don't know. Or it might have, but then changed back.
+   *
+   * The [path] must be absolute and normalized.
+   *
+   * The [path] can be any file - explicitly or implicitly analyzed, or neither.
+   *
+   * Causes the analysis state to transition to "analyzing" (if it is not in
+   * that state already). Schedules the file contents for [path] to be read
+   * into the current file state prior to the next time the analysis state
+   * transitions to "idle".
+   *
+   * Invocation of this method will not prevent a [Future] returned from
+   * [getResult] from completing with a result, but the result is not
+   * guaranteed to be consistent with the new current file state after this
+   * [changeFile] invocation.
+   */
+  void changeFile(String path) {
+    if (AnalysisEngine.isDartFileName(path)) {
+      _changedFiles.add(path);
+      if (_explicitFiles.contains(path)) {
+        _filesToAnalyze.add(path);
+      }
+    }
+    _statusSupport.transitionToAnalyzing();
+    _scheduler._notify(this);
+  }
+
+  /**
+   * Notify the driver that the client is going to stop using it.
+   */
+  void dispose() {
+    _scheduler._remove(this);
+  }
+
+  /**
+   * Return a [Future] that completes with the list of added files that
+   * reference the given external [name].
+   */
+  Future<List<String>> getFilesReferencingName(String name) {
+    var task = new _FilesReferencingNameTask(this, name);
+    _referencingNameTasks.add(task);
+    _statusSupport.transitionToAnalyzing();
+    _scheduler._notify(this);
+    return task.completer.future;
+  }
+
+  /**
+   * Return a [Future] that completes with the [IndexResult] for the file with
+   * the given [path].
+   */
+  Future<IndexResult> getIndex(String path) {
+    if (AnalysisEngine.isDartFileName(path)) {
+      var completer = new Completer<IndexResult>();
+      _indexRequestedFiles
+          .putIfAbsent(path, () => <Completer<IndexResult>>[])
+          .add(completer);
+      _statusSupport.transitionToAnalyzing();
+      _scheduler._notify(this);
+      return completer.future;
+    }
+    return new Future.value();
+  }
+
+  /**
+   * Return a [Future] that completes with a [AnalysisResult] for the Dart
+   * file with the given [path]. If the file is not a Dart file, the [Future]
+   * completes with `null`.
+   *
+   * The [path] must be absolute and normalized.
+   *
+   * The [path] can be any file - explicitly or implicitly analyzed, or neither.
+   *
+   * Causes the analysis state to transition to "analyzing" (if it is not in
+   * that state already), the driver will read the file and produce the analysis
+   * result for it, which is consistent with the current file state (including
+   * the new state of the file), prior to the next time the analysis state
+   * transitions to "idle".
+   */
+  Future<AnalysisResult> getResult(String path) {
+    if (AnalysisEngine.isDartFileName(path)) {
+      var completer = new Completer<AnalysisResult>();
+      _requestedFiles
+          .putIfAbsent(path, () => <Completer<AnalysisResult>>[])
+          .add(completer);
+      _statusSupport.transitionToAnalyzing();
+      _scheduler._notify(this);
+      return completer.future;
+    }
+    return new Future.value();
+  }
+
+  /**
+   * Return a [Future] that completes with a [ParseResult] for the file
+   * with the given [path].
+   *
+   * The [path] must be absolute and normalized.
+   *
+   * The [path] can be any file - explicitly or implicitly analyzed, or neither.
+   *
+   * The parsing is performed in the method itself, and the result is not
+   * produced through the [results] stream (just because it is not a fully
+   * resolved unit).
+   */
+  Future<ParseResult> parseFile(String path) async {
+    FileState file = _fsState.getFileForPath(path);
+    RecordingErrorListener listener = new RecordingErrorListener();
+    CompilationUnit unit = file.parse(listener);
+    return new ParseResult(file.path, file.uri, file.content, file.contentHash,
+        unit.lineInfo, unit, listener.errors);
+  }
+
+  /**
+   * Remove the file with the given [path] from the list of files to analyze.
+   *
+   * The [path] must be absolute and normalized.
+   *
+   * The results of analysis of the file might still be produced by the
+   * [results] stream. The driver will try to stop producing these results,
+   * but does not guarantee this.
+   */
+  void removeFile(String path) {
+    _explicitFiles.remove(path);
+    _filesToAnalyze.remove(path);
+  }
+
+  /**
+   * TODO(scheglov) see [_addToStoreUnlinked]
+   */
+  void _addToStoreLinked(
+      SummaryDataStore store, String uri, LinkedLibrary linked) {
+    store.linkedMap[uri] = linked;
+  }
+
+  /**
+   * TODO(scheglov) The existing [SummaryDataStore.addBundle] uses
+   * [PackageBundle.unlinkedUnitUris] to add [PackageBundle.unlinkedUnits].
+   * But we store unlinked bundles with the hash of the file content. This
+   * means that when two files are the same, but have different URIs, we
+   * add [UnlinkedUnit] with wrong URI.
+   *
+   * We need to clean this up.
+   */
+  void _addToStoreUnlinked(
+      SummaryDataStore store, Uri uri, UnlinkedUnit unlinked) {
+    String uriStr = uri.toString();
+    store.unlinkedMap[uriStr] = unlinked;
+  }
+
+  /**
+   * Return the cached or newly computed analysis result of the file with the
+   * given [path].
+   *
+   * The result will have the fully resolved unit and will always be newly
+   * compute only if [withUnit] is `true`.
+   *
+   * Return `null` if the file is a part of an unknown library, so cannot be
+   * analyzed yet. But [asIsIfPartWithoutLibrary] is `true`, then the file is
+   * analyzed anyway, even without a library.
+   */
+  AnalysisResult _computeAnalysisResult(String path,
+      {bool withUnit: false, bool asIsIfPartWithoutLibrary: false}) {
+    /**
+     * If the [file] is a library, return the [file] itself.
+     * If the [file] is a part, return a library it is known to be a part of.
+     * If there is no such library, return `null`.
+     */
+    FileState getLibraryFile(FileState file) {
+      FileState libraryFile = file.isPart ? file.library : file;
+      if (libraryFile == null && asIsIfPartWithoutLibrary) {
+        libraryFile = file;
+      }
+      return libraryFile;
+    }
+
+    // If we don't need the fully resolved unit, check for the cached result.
+    if (!withUnit) {
+      FileState file = _fsState.getFileForPath(path);
+
+      // Prepare the library file - the file itself, or the known library.
+      FileState libraryFile = getLibraryFile(file);
+      if (libraryFile == null) {
+        return null;
+      }
+
+      // Check for the cached result.
+      String key = _getResolvedUnitKey(libraryFile, file);
+      List<int> bytes = _byteStore.get(key);
+      if (bytes != null) {
+        return _getAnalysisResultFromBytes(libraryFile, file, bytes);
+      }
+    }
+
+    // We need the fully resolved unit, or the result is not cached.
+    return _logger.run('Compute analysis result for $path', () {
+      FileState file = _verifyApiSignature(path);
+
+      // Prepare the library file - the file itself, or the known library.
+      FileState libraryFile = getLibraryFile(file);
+      if (libraryFile == null) {
+        return null;
+      }
+
+      _LibraryContext libraryContext = _createLibraryContext(libraryFile);
+      AnalysisContext analysisContext = _createAnalysisContext(libraryContext);
+      try {
+        analysisContext.setContents(file.source, file.content);
+        CompilationUnit resolvedUnit = analysisContext.resolveCompilationUnit2(
+            file.source, libraryFile.source);
+        List<AnalysisError> errors = analysisContext.computeErrors(file.source);
+        AnalysisDriverUnitIndexBuilder index = indexUnit(resolvedUnit);
+
+        // Store the result into the cache.
+        List<int> bytes;
+        {
+          bytes = new AnalysisDriverResolvedUnitBuilder(
+                  errors: errors
+                      .map((error) => new AnalysisDriverUnitErrorBuilder(
+                          offset: error.offset,
+                          length: error.length,
+                          uniqueName: error.errorCode.uniqueName,
+                          message: error.message,
+                          correction: error.correction))
+                      .toList(),
+                  index: index)
+              .toBuffer();
+          String key = _getResolvedUnitKey(libraryFile, file);
+          _byteStore.put(key, bytes);
+        }
+
+        // Return the result, full or partial.
+        _logger.writeln('Computed new analysis result.');
+        return _getAnalysisResultFromBytes(libraryFile, file, bytes,
+            content: withUnit ? file.content : null,
+            resolvedUnit: withUnit ? resolvedUnit : null);
+      } finally {
+        analysisContext.dispose();
+      }
+    });
+  }
+
+  IndexResult _computeIndexResult(String path) {
+    AnalysisResult analysisResult = _computeAnalysisResult(path,
+        withUnit: false, asIsIfPartWithoutLibrary: true);
+    FileState libraryFile = analysisResult._libraryFile;
+    FileState file = analysisResult._file;
+
+    // Create the AnalysisContext to resynthesize elements in.
+    _LibraryContext libraryContext = _createLibraryContext(libraryFile);
+    AnalysisContext analysisContext = _createAnalysisContext(libraryContext);
+
+    // Resynthesize the CompilationUnitElement in the context.
+    CompilationUnitElement unitElement;
+    try {
+      unitElement = analysisContext.computeResult(
+          new LibrarySpecificUnit(libraryFile.source, file.source),
+          COMPILATION_UNIT_ELEMENT);
+    } finally {
+      analysisContext.dispose();
+    }
+
+    // Return as IndexResult.
+    return new IndexResult(unitElement, analysisResult._index);
+  }
+
+  AnalysisContext _createAnalysisContext(_LibraryContext libraryContext) {
+    AnalysisContextImpl analysisContext =
+        AnalysisEngine.instance.createAnalysisContext();
+    analysisContext.analysisOptions = analysisOptions;
+
+    analysisContext.sourceFactory = sourceFactory.clone();
+    analysisContext.resultProvider =
+        new InputPackagesResultProvider(analysisContext, libraryContext.store);
+    analysisContext
+        .applyChanges(new ChangeSet()..addedSource(libraryContext.file.source));
+    return analysisContext;
+  }
+
+  /**
+   * Return the context in which the [library] should be analyzed it.
+   */
+  _LibraryContext _createLibraryContext(FileState library) {
+    return _logger.run('Create library context', () {
+      Map<String, FileState> libraries = <String, FileState>{};
+      SummaryDataStore store = new SummaryDataStore(const <String>[]);
+      store.addBundle(null, _sdkBundle);
+
+      void appendLibraryFiles(FileState library) {
+        // URIs with the 'dart:' scheme are served from the SDK bundle.
+        if (library.uri.scheme == 'dart') {
+          return null;
+        }
+
+        if (!libraries.containsKey(library.uriStr)) {
+          libraries[library.uriStr] = library;
+
+          // Append the defining unit.
+          {
+            UnlinkedUnit unlinked = library.unlinked;
+            _addToStoreUnlinked(store, library.uri, unlinked);
+          }
+
+          // Append parts.
+          for (FileState part in library.partedFiles) {
+            UnlinkedUnit unlinked = part.unlinked;
+            _addToStoreUnlinked(store, part.uri, unlinked);
+          }
+
+          // Append referenced libraries.
+          library.importedFiles.forEach(appendLibraryFiles);
+          library.exportedFiles.forEach(appendLibraryFiles);
+        }
+      }
+
+      _logger.run('Append library files', () {
+        return appendLibraryFiles(library);
+      });
+
+      Set<String> libraryUrisToLink = new Set<String>();
+      _logger.run('Load linked bundles', () {
+        for (FileState library in libraries.values) {
+          String key = '${library.transitiveSignature}.linked';
+          List<int> bytes = _byteStore.get(key);
+          if (bytes != null) {
+            LinkedLibrary linked = new LinkedLibrary.fromBuffer(bytes);
+            _addToStoreLinked(store, library.uriStr, linked);
+          } else {
+            libraryUrisToLink.add(library.uriStr);
+          }
+        }
+        int numOfLoaded = libraries.length - libraryUrisToLink.length;
+        _logger.writeln('Loaded $numOfLoaded linked bundles.');
+      });
+
+      Map<String, LinkedLibraryBuilder> linkedLibraries = {};
+      _logger.run('Link bundles', () {
+        linkedLibraries = link(libraryUrisToLink, (String uri) {
+          LinkedLibrary linkedLibrary = store.linkedMap[uri];
+          return linkedLibrary;
+        }, (String uri) {
+          UnlinkedUnit unlinkedUnit = store.unlinkedMap[uri];
+          return unlinkedUnit;
+        }, (_) => null, analysisOptions.strongMode);
+        _logger.writeln('Linked ${linkedLibraries.length} bundles.');
+      });
+
+      linkedLibraries.forEach((uri, linkedBuilder) {
+        FileState library = libraries[uri];
+        String key = '${library.transitiveSignature}.linked';
+        List<int> bytes = linkedBuilder.toBuffer();
+        LinkedLibrary linked = new LinkedLibrary.fromBuffer(bytes);
+        _addToStoreLinked(store, uri, linked);
+        _byteStore.put(key, bytes);
+      });
+
+      return new _LibraryContext(library, store);
+    });
+  }
+
+  /**
+   * Fill [_salt] with data.
+   */
+  void _fillSalt() {
+    _salt[0] = DATA_VERSION;
+    List<int> crossContextOptions = analysisOptions.encodeCrossContextOptions();
+    assert(crossContextOptions.length ==
+        AnalysisOptions.crossContextOptionsLength);
+    for (int i = 0; i < crossContextOptions.length; i++) {
+      _salt[i + 1] = crossContextOptions[i];
+    }
+  }
+
+  /**
+   * Load the [AnalysisResult] for the given [file] from the [bytes]. Set
+   * optional [content] and [resolvedUnit].
+   */
+  AnalysisResult _getAnalysisResultFromBytes(
+      FileState libraryFile, FileState file, List<int> bytes,
+      {String content, CompilationUnit resolvedUnit}) {
+    var unit = new AnalysisDriverResolvedUnit.fromBuffer(bytes);
+    List<AnalysisError> errors = unit.errors.map((error) {
+      String errorName = error.uniqueName;
+      ErrorCode errorCode = errorCodeByUniqueName(errorName);
+      if (errorCode == null) {
+        throw new StateError('No ErrorCode for $errorName in $file');
+      }
+      return new AnalysisError.forValues(file.source, error.offset,
+          error.length, errorCode, error.message, error.correction);
+    }).toList();
+    return new AnalysisResult(
+        libraryFile,
+        file,
+        sourceFactory,
+        file.path,
+        file.uri,
+        content,
+        file.contentHash,
+        file.lineInfo,
+        resolvedUnit,
+        errors,
+        unit.index);
+  }
+
+  /**
+   * Return the key to store fully resolved results for the [file] in the
+   * [library] into the cache. Return `null` if the dependency signature is
+   * not known yet.
+   */
+  String _getResolvedUnitKey(FileState library, FileState file) {
+    ApiSignature signature = new ApiSignature();
+    signature.addUint32List(_salt);
+    signature.addString(library.transitiveSignature);
+    signature.addString(file.contentHash);
+    return '${signature.toHex()}.resolved';
+  }
+
+  /**
+   * Perform a single chunk of work and produce [results].
+   */
+  Future<Null> _performWork() async {
+    // Verify all changed files one at a time.
+    if (_changedFiles.isNotEmpty) {
+      String path = _removeFirst(_changedFiles);
+      _verifyApiSignature(path);
+      return;
+    }
+
+    // Analyze a requested file.
+    if (_requestedFiles.isNotEmpty) {
+      String path = _requestedFiles.keys.first;
+      AnalysisResult result = _computeAnalysisResult(path, withUnit: true);
+      // If a part without a library, delay its analysis.
+      if (result == null) {
+        _requestedParts
+            .putIfAbsent(path, () => [])
+            .addAll(_requestedFiles.remove(path));
+        return;
+      }
+      // Notify the completers.
+      _requestedFiles.remove(path).forEach((completer) {
+        completer.complete(result);
+      });
+      // Remove from to be analyzed and produce it now.
+      _filesToAnalyze.remove(path);
+      _resultController.add(result);
+      return;
+    }
+
+    // Process an index request.
+    if (_indexRequestedFiles.isNotEmpty) {
+      String path = _indexRequestedFiles.keys.first;
+      IndexResult result = _computeIndexResult(path);
+      _indexRequestedFiles.remove(path).forEach((completer) {
+        completer.complete(result);
+      });
+      return;
+    }
+
+    // Compute files referencing a name.
+    if (_referencingNameTasks.isNotEmpty) {
+      _FilesReferencingNameTask task = _referencingNameTasks.first;
+      bool isDone = await task.perform();
+      if (isDone) {
+        _referencingNameTasks.remove(task);
+      }
+      return;
+    }
+
+    // Analyze a priority file.
+    if (_priorityFiles.isNotEmpty) {
+      for (String path in _priorityFiles) {
+        if (_filesToAnalyze.remove(path)) {
+          AnalysisResult result = _computeAnalysisResult(path, withUnit: true);
+          if (result == null) {
+            _partsToAnalyze.add(path);
+          } else {
+            _resultController.add(result);
+          }
+          return;
+        }
+      }
+    }
+
+    // Analyze a general file.
+    if (_filesToAnalyze.isNotEmpty) {
+      String path = _removeFirst(_filesToAnalyze);
+      AnalysisResult result = _computeAnalysisResult(path, withUnit: false);
+      if (result == null) {
+        _partsToAnalyze.add(path);
+      } else {
+        _resultController.add(result);
+      }
+      return;
+    }
+
+    // Analyze a requested part file.
+    if (_requestedParts.isNotEmpty) {
+      String path = _requestedParts.keys.first;
+      AnalysisResult result = _computeAnalysisResult(path,
+          withUnit: true, asIsIfPartWithoutLibrary: true);
+      // Notify the completers.
+      _requestedParts.remove(path).forEach((completer) {
+        completer.complete(result);
+      });
+      // Remove from to be analyzed and produce it now.
+      _filesToAnalyze.remove(path);
+      _resultController.add(result);
+      return;
+    }
+
+    // Analyze a general part.
+    if (_partsToAnalyze.isNotEmpty) {
+      String path = _removeFirst(_partsToAnalyze);
+      AnalysisResult result = _computeAnalysisResult(path,
+          withUnit: _priorityFiles.contains(path),
+          asIsIfPartWithoutLibrary: true);
+      _resultController.add(result);
+      return;
+    }
+  }
+
+  /**
+   * Verify the API signature for the file with the given [path], and decide
+   * which linked libraries should be invalidated, and files reanalyzed.
+   */
+  FileState _verifyApiSignature(String path) {
+    return _logger.run('Verify API signature of $path', () {
+      bool anyApiChanged = false;
+      List<FileState> files = _fsState.getFilesForPath(path);
+      for (FileState file in files) {
+        bool apiChanged = file.refresh();
+        if (apiChanged) {
+          anyApiChanged = true;
+        }
+      }
+      if (anyApiChanged) {
+        _logger.writeln('API signatures mismatch found for $path');
+        // TODO(scheglov) schedule analysis of only affected files
+        _filesToAnalyze.addAll(_explicitFiles);
+      }
+      return files[0];
+    });
+  }
+
+  /**
+   * Remove and return the first item in the given [set].
+   */
+  static Object/*=T*/ _removeFirst/*<T>*/(LinkedHashSet<Object/*=T*/ > set) {
+    Object/*=T*/ element = set.first;
+    set.remove(element);
+    return element;
+  }
+}
+
+/**
+ * Priorities of [AnalysisDriver] work. The farther a priority to the beginning
+ * of the list, the earlier the corresponding [AnalysisDriver] should be asked
+ * to perform work.
+ */
+enum AnalysisDriverPriority {
+  nothing,
+  general,
+  priority,
+  referencingName,
+  getIndex,
+  interactive
+}
+
+/**
+ * Instances of this class schedule work in multiple [AnalysisDriver]s so that
+ * work with the highest priority is performed first.
+ */
+class AnalysisDriverScheduler {
+  final PerformanceLog _logger;
+  final List<AnalysisDriver> _drivers = [];
+  final Monitor _hasWork = new Monitor();
+  final StatusSupport _statusSupport = new StatusSupport();
+
+  bool _started = false;
+
+  AnalysisDriverScheduler(this._logger);
+
+  /**
+   * Return the stream that produces [AnalysisStatus] events.
+   */
+  Stream<AnalysisStatus> get status => _statusSupport.stream;
+
+  /**
+   * Start the scheduler, so that any [AnalysisDriver] created before or
+   * after will be asked to perform work.
+   */
+  void start() {
+    if (_started) {
+      throw new StateError('The scheduler has already been started.');
+    }
+    _started = true;
+    _run();
+  }
+
+  /**
+   * Add the given [driver] and schedule it to perform its work.
+   */
+  void _add(AnalysisDriver driver) {
+    _drivers.add(driver);
+    _statusSupport.transitionToAnalyzing();
+    _hasWork.notify();
+  }
+
+  /**
+   * Notify that there is a change to the [driver], it it might need to
+   * perform some work.
+   */
+  void _notify(AnalysisDriver driver) {
+    _statusSupport.transitionToAnalyzing();
+    _hasWork.notify();
+  }
+
+  /**
+   * Remove the given [driver] from the scheduler, so that it will not be
+   * asked to perform any new work.
+   */
+  void _remove(AnalysisDriver driver) {
+    _drivers.remove(driver);
+    _statusSupport.transitionToAnalyzing();
+    _hasWork.notify();
+  }
+
+  /**
+   * Run infinitely analysis cycle, selecting the drivers with the highest
+   * priority first.
+   */
+  Future<Null> _run() async {
+    PerformanceLogSection analysisSection;
+    while (true) {
+      // Pump the event queue to allow IO and other asynchronous data
+      // processing while analysis is active. For example Analysis Server
+      // needs to be able to process `updateContent` or `setPriorityFiles`
+      // requests while background analysis is in progress.
+      //
+      // The number of pumpings is arbitrary, might be changed if we see that
+      // analysis or other data processing tasks are starving. Ideally we
+      // would need to be able to set priority of (continuous) asynchronous
+      // tasks.
+      await _pumpEventQueue(128);
+
+      await _hasWork.signal;
+
+      if (analysisSection == null) {
+        analysisSection = _logger.enter('Analyzing');
+      }
+
+      // Find the driver with the highest priority.
+      AnalysisDriver bestDriver;
+      AnalysisDriverPriority bestPriority = AnalysisDriverPriority.nothing;
+      for (AnalysisDriver driver in _drivers) {
+        AnalysisDriverPriority priority = driver._workPriority;
+        if (bestPriority == null || priority.index > bestPriority.index) {
+          bestDriver = driver;
+          bestPriority = priority;
+        }
+      }
+
+      // Continue to sleep if no work to do.
+      if (bestPriority == AnalysisDriverPriority.nothing) {
+        analysisSection.exit();
+        analysisSection = null;
+        _statusSupport.transitionToIdle();
+        continue;
+      }
+
+      // Ask the driver to perform a chunk of work.
+      await bestDriver._performWork();
+
+      // Schedule one more cycle.
+      _hasWork.notify();
+    }
+  }
+
+  /**
+   * Returns a [Future] that completes after performing [times] pumpings of
+   * the event queue.
+   */
+  static Future _pumpEventQueue(int times) {
+    if (times == 0) {
+      return new Future.value();
+    }
+    return new Future.delayed(Duration.ZERO, () => _pumpEventQueue(times - 1));
+  }
+}
+
+/**
+ * The result of analyzing of a single file.
+ *
+ * These results are self-consistent, i.e. [content], [contentHash], the
+ * resolved [unit] correspond to each other. All referenced elements, even
+ * external ones, are also self-consistent. But none of the results is
+ * guaranteed to be consistent with the state of the files.
+ *
+ * Every result is independent, and is not guaranteed to be consistent with
+ * any previously returned result, even inside of the same library.
+ */
+class AnalysisResult {
+  final FileState _libraryFile;
+  final FileState _file;
+
+  /**
+   * The [SourceFactory] with which the file was analyzed.
+   */
+  final SourceFactory sourceFactory;
+
+  /**
+   * The path of the analysed file, absolute and normalized.
+   */
+  final String path;
+
+  /**
+   * The URI of the file that corresponded to the [path] in the used
+   * [SourceFactory] at some point. Is it not guaranteed to be still consistent
+   * to the [path], and provided as FYI.
+   */
+  final Uri uri;
+
+  /**
+   * The content of the file that was scanned, parsed and resolved.
+   */
+  final String content;
+
+  /**
+   * The MD5 hash of the [content].
+   */
+  final String contentHash;
+
+  /**
+   * Information about lines in the [content].
+   */
+  final LineInfo lineInfo;
+
+  /**
+   * The fully resolved compilation unit for the [content].
+   */
+  final CompilationUnit unit;
+
+  /**
+   * The full list of computed analysis errors, both syntactic and semantic.
+   */
+  final List<AnalysisError> errors;
+
+  /**
+   * The index of the unit.
+   */
+  final AnalysisDriverUnitIndex _index;
+
+  AnalysisResult(
+      this._libraryFile,
+      this._file,
+      this.sourceFactory,
+      this.path,
+      this.uri,
+      this.content,
+      this.contentHash,
+      this.lineInfo,
+      this.unit,
+      this.errors,
+      this._index);
+}
+
+/**
+ * The result of indexing of a single file.
+ */
+class IndexResult {
+  /**
+   * The element of the file.
+   */
+  final CompilationUnitElement unitElement;
+
+  /**
+   * The index of the file.
+   */
+  final AnalysisDriverUnitIndex index;
+
+  IndexResult(this.unitElement, this.index);
+}
+
+/**
+ * The result of parsing of a single file.
+ *
+ * These results are self-consistent, i.e. [content], [contentHash], the
+ * resolved [unit] correspond to each other. But none of the results is
+ * guaranteed to be consistent with the state of the files.
+ */
+class ParseResult {
+  /**
+   * The path of the parsed file, absolute and normalized.
+   */
+  final String path;
+
+  /**
+   * The URI of the file that corresponded to the [path].
+   */
+  final Uri uri;
+
+  /**
+   * The content of the file that was scanned and parsed.
+   */
+  final String content;
+
+  /**
+   * The MD5 hash of the [content].
+   */
+  final String contentHash;
+
+  /**
+   * Information about lines in the [content].
+   */
+  final LineInfo lineInfo;
+
+  /**
+   * The parsed, unresolved compilation unit for the [content].
+   */
+  final CompilationUnit unit;
+
+  /**
+   * The scanning and parsing errors.
+   */
+  final List<AnalysisError> errors;
+
+  ParseResult(this.path, this.uri, this.content, this.contentHash,
+      this.lineInfo, this.unit, this.errors);
+}
+
+/**
+ * This class is used to gather and print performance information.
+ */
+class PerformanceLog {
+  final StringSink sink;
+  int _level = 0;
+
+  PerformanceLog(this.sink);
+
+  /**
+   * Enter a new execution section, which starts at one point of code, runs
+   * some time, and then ends at the other point of code.
+   *
+   * The client must call [PerformanceLogSection.exit] for every [enter].
+   */
+  PerformanceLogSection enter(String msg) {
+    writeln('+++ $msg.');
+    _level++;
+    return new PerformanceLogSection(this, msg);
+  }
+
+  /**
+   * Return the result of the function [f] invocation and log the elapsed time.
+   *
+   * Each invocation of [run] creates a new enclosed section in the log,
+   * which begins with printing [msg], then any log output produced during
+   * [f] invocation, and ends with printing [msg] with the elapsed time.
+   */
+  /*=T*/ run/*<T>*/(String msg, /*=T*/ f()) {
+    Stopwatch timer = new Stopwatch()..start();
+    try {
+      writeln('+++ $msg.');
+      _level++;
+      return f();
+    } finally {
+      _level--;
+      int ms = timer.elapsedMilliseconds;
+      writeln('--- $msg in $ms ms.');
+    }
+  }
+
+  /**
+   * Write a new line into the log
+   */
+  void writeln(String msg) {
+    String indent = '\t' * _level;
+    sink.writeln('$indent$msg');
+  }
+}
+
+/**
+ * The performance measurement section for operations that start and end
+ * at different place in code, so cannot be run using [PerformanceLog.run].
+ *
+ * The client must call [exit] for every [PerformanceLog.enter].
+ */
+class PerformanceLogSection {
+  final PerformanceLog _logger;
+  final String _msg;
+  final Stopwatch _timer = new Stopwatch()..start();
+
+  PerformanceLogSection(this._logger, this._msg);
+
+  /**
+   * Stop the timer, log the time.
+   */
+  void exit() {
+    _timer.stop();
+    _logger._level--;
+    int ms = _timer.elapsedMilliseconds;
+    _logger.writeln('--- $_msg in $ms ms.');
+  }
+}
+
+/**
+ * Task that computes the list of files that were added to the driver and
+ * have at least one reference to an identifier [name] defined outside of the
+ * file.
+ */
+class _FilesReferencingNameTask {
+  final AnalysisDriver driver;
+  final String name;
+  final Completer<List<String>> completer = new Completer<List<String>>();
+
+  final List<String> referencingFiles = <String>[];
+  final Set<String> checkedFiles = new Set<String>();
+  final List<String> filesToCheck = <String>[];
+
+  _FilesReferencingNameTask(this.driver, this.name);
+
+  /**
+   * Perform work for a fixed length of time, and either complete the
+   * [completer] and return `true` to indicate that the task is done, return
+   * `false` to indicate that the task should continue to be run.
+   *
+   * Relinquishing execution flow and running event loop after every file
+   * works, but has too much overhead. Instead we use a fixed length of time,
+   * so we can spend less time overall and keep quick enough response time.
+   */
+  Future<bool> perform() async {
+    Stopwatch timer = new Stopwatch()..start();
+    while (timer.elapsedMilliseconds < 5) {
+      // Prepare files to check.
+      if (filesToCheck.isEmpty) {
+        Set<String> newFiles = driver.addedFiles.difference(checkedFiles);
+        filesToCheck.addAll(newFiles);
+      }
+
+      // If no more files to check, complete and done.
+      if (filesToCheck.isEmpty) {
+        completer.complete(referencingFiles);
+        return true;
+      }
+
+      // Check the next file.
+      String path = filesToCheck.removeLast();
+      FileState file = driver._fsState.getFileForPath(path);
+      if (file.referencedNames.contains(name)) {
+        referencingFiles.add(path);
+      }
+      checkedFiles.add(path);
+    }
+
+    // We're not done yet.
+    return false;
+  }
+}
+
+/**
+ * TODO(scheglov) document
+ */
+class _LibraryContext {
+  final FileState file;
+  final SummaryDataStore store;
+  _LibraryContext(this.file, this.store);
+}
diff --git a/pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart b/pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart
new file mode 100644
index 0000000..3e18290
--- /dev/null
+++ b/pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart
@@ -0,0 +1,146 @@
+// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
+// for 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:isolate';
+
+import 'package:analyzer/src/dart/analysis/byte_store.dart';
+import 'package:path/path.dart';
+
+/**
+ * The request that is sent from the main isolate to the clean-up isolate.
+ */
+class CacheCleanUpRequest {
+  final String cachePath;
+  final int maxSizeBytes;
+  final SendPort replyTo;
+
+  CacheCleanUpRequest(this.cachePath, this.maxSizeBytes, this.replyTo);
+}
+
+/**
+ * [ByteStore] that stores values as files.
+ */
+class FileByteStore implements ByteStore {
+  static bool _cleanUpSendPortShouldBePrepared = true;
+  static SendPort _cleanUpSendPort;
+
+  final String _cachePath;
+  final String _tempName = 'temp_$pid';
+  final int _maxSizeBytes;
+
+  int _bytesWrittenSinceCleanup = 0;
+  bool _evictionIsolateIsRunning = false;
+
+  FileByteStore(this._cachePath, this._maxSizeBytes) {
+    _requestCacheCleanUp();
+  }
+
+  @override
+  List<int> get(String key) {
+    try {
+      return _getFileForKey(key).readAsBytesSync();
+    } catch (_) {
+      return null;
+    }
+  }
+
+  @override
+  void put(String key, List<int> bytes) {
+    try {
+      File tempFile = _getFileForKey(_tempName);
+      tempFile.writeAsBytesSync(bytes);
+      File file = _getFileForKey(key);
+      tempFile.renameSync(file.path);
+      // Update the current size.
+      _bytesWrittenSinceCleanup += bytes.length;
+      if (_bytesWrittenSinceCleanup > _maxSizeBytes ~/ 8) {
+        _requestCacheCleanUp();
+      }
+    } catch (_) {}
+  }
+
+  File _getFileForKey(String key) {
+    return new File(join(_cachePath, key));
+  }
+
+  /**
+   * If the cache clean up process has not been requested yet, request it.
+   */
+  Future<Null> _requestCacheCleanUp() async {
+    if (_cleanUpSendPortShouldBePrepared) {
+      _cleanUpSendPortShouldBePrepared = false;
+      ReceivePort response = new ReceivePort();
+      await Isolate.spawn(_cacheCleanUpFunction, response.sendPort);
+      _cleanUpSendPort = await response.first as SendPort;
+    } else {
+      while (_cleanUpSendPort == null) {
+        await new Future.delayed(new Duration(milliseconds: 100), () {});
+      }
+    }
+
+    if (!_evictionIsolateIsRunning) {
+      _evictionIsolateIsRunning = true;
+      try {
+        ReceivePort response = new ReceivePort();
+        _cleanUpSendPort.send(new CacheCleanUpRequest(
+            _cachePath, _maxSizeBytes, response.sendPort));
+        await response.first;
+      } finally {
+        _evictionIsolateIsRunning = false;
+        _bytesWrittenSinceCleanup = 0;
+      }
+    }
+  }
+
+  /**
+   * This function is started in a new isolate, receives cache folder clean up
+   * requests and evicts older files from the folder.
+   */
+  static void _cacheCleanUpFunction(SendPort initialReplyTo) {
+    ReceivePort port = new ReceivePort();
+    initialReplyTo.send(port.sendPort);
+    port.listen((request) async {
+      if (request is CacheCleanUpRequest) {
+        await _cleanUpFolder(request.cachePath, request.maxSizeBytes);
+        // Let the client know that we're done.
+        request.replyTo.send(true);
+      }
+    });
+  }
+
+  static Future<Null> _cleanUpFolder(String cachePath, int maxSizeBytes) async {
+    // Prepare the list of files and their statistics.
+    List<File> files = <File>[];
+    Map<File, FileStat> fileStatMap = {};
+    int currentSizeBytes = 0;
+    List<FileSystemEntity> resources = new Directory(cachePath).listSync();
+    for (FileSystemEntity resource in resources) {
+      if (resource is File) {
+        try {
+          FileStat fileStat = await resource.stat();
+          files.add(resource);
+          fileStatMap[resource] = fileStat;
+          currentSizeBytes += fileStat.size;
+        } catch (_) {}
+      }
+    }
+    files.sort((a, b) {
+      return fileStatMap[a].accessed.millisecondsSinceEpoch -
+          fileStatMap[b].accessed.millisecondsSinceEpoch;
+    });
+
+    // Delete files until the current size is less than the max.
+    for (File file in files) {
+      if (currentSizeBytes < maxSizeBytes) {
+        break;
+      }
+      try {
+        await file.delete();
+      } catch (_) {}
+      currentSizeBytes -= fileStatMap[file].size;
+    }
+  }
+}
diff --git a/pkg/analyzer/lib/src/dart/analysis/file_state.dart b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
new file mode 100644
index 0000000..3a88ed6
--- /dev/null
+++ b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
@@ -0,0 +1,564 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:convert';
+import 'dart:typed_data';
+
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/ast/token.dart';
+import 'package:analyzer/error/listener.dart';
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/src/dart/analysis/byte_store.dart';
+import 'package:analyzer/src/dart/analysis/driver.dart';
+import 'package:analyzer/src/dart/analysis/referenced_names.dart';
+import 'package:analyzer/src/dart/scanner/reader.dart';
+import 'package:analyzer/src/dart/scanner/scanner.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/parser.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/generated/utilities_dart.dart';
+import 'package:analyzer/src/source/source_resource.dart';
+import 'package:analyzer/src/summary/api_signature.dart';
+import 'package:analyzer/src/summary/format.dart';
+import 'package:analyzer/src/summary/idl.dart';
+import 'package:analyzer/src/summary/summarize_ast.dart';
+import 'package:analyzer/src/util/fast_uri.dart';
+import 'package:convert/convert.dart';
+import 'package:crypto/crypto.dart';
+import 'package:meta/meta.dart';
+
+/**
+ * [FileContentOverlay] is used to temporary override content of files.
+ */
+class FileContentOverlay {
+  final _map = <String, String>{};
+
+  /**
+   * Return the content of the file with the given [path], or `null` the
+   * overlay does not override the content of the file.
+   *
+   * The [path] must be absolute and normalized.
+   */
+  String operator [](String path) => _map[path];
+
+  /**
+   * Return the new [content] of the file with the given [path].
+   *
+   * The [path] must be absolute and normalized.
+   */
+  void operator []=(String path, String content) {
+    if (content == null) {
+      _map.remove(path);
+    } else {
+      _map[path] = content;
+    }
+  }
+}
+
+/**
+ * Information about a file being analyzed, explicitly or implicitly.
+ *
+ * It provides a consistent view on its properties.
+ *
+ * The properties are not guaranteed to represent the most recent state
+ * of the file system. To update the file to the most recent state, [refresh]
+ * should be called.
+ */
+class FileState {
+  final FileSystemState _fsState;
+
+  /**
+   * The absolute path of the file.
+   */
+  final String path;
+
+  /**
+   * The absolute URI of the file.
+   */
+  final Uri uri;
+
+  /**
+   * The [Source] of the file with the [uri].
+   */
+  Source source;
+
+  String _content;
+  String _contentHash;
+  LineInfo _lineInfo;
+  Set<String> _referencedNames;
+  UnlinkedUnit _unlinked;
+  List<int> _apiSignature;
+
+  List<FileState> _importedFiles;
+  List<FileState> _exportedFiles;
+  List<FileState> _partedFiles;
+  Set<FileState> _directReferencedFiles = new Set<FileState>();
+  Set<FileState> _transitiveFiles;
+  String _transitiveSignature;
+
+  FileState._(this._fsState, this.path, this.uri, this.source);
+
+  /**
+   * The unlinked API signature of the file.
+   */
+  List<int> get apiSignature => _apiSignature;
+
+  /**
+   * The content of the file.
+   */
+  String get content => _content;
+
+  /**
+   * The MD5 hash of the [content].
+   */
+  String get contentHash => _contentHash;
+
+  /**
+   * Return the set of all directly referenced files - imported, exported or
+   * parted.
+   */
+  Set<FileState> get directReferencedFiles => _directReferencedFiles;
+
+  /**
+   * The list of files this file exports.
+   */
+  List<FileState> get exportedFiles => _exportedFiles;
+
+  @override
+  int get hashCode => uri.hashCode;
+
+  /**
+   * The list of files this file imports.
+   */
+  List<FileState> get importedFiles => _importedFiles;
+
+  /**
+   * Return `true` if the file has a `part of` directive, so is probably a part.
+   */
+  bool get isPart => _unlinked.isPartOf;
+
+  /**
+   * If the file [isPart], return a currently know library the file is a part
+   * of. Return `null` if a library is not known, for example because we have
+   * not processed a library file yet.
+   */
+  FileState get library {
+    List<FileState> libraries = _fsState._partToLibraries[this];
+    if (libraries == null || libraries.isEmpty) {
+      return null;
+    } else {
+      return libraries.first;
+    }
+  }
+
+  /**
+   * Return information about line in the file.
+   */
+  LineInfo get lineInfo => _lineInfo;
+
+  /**
+   * The list of files this library file references as parts.
+   */
+  List<FileState> get partedFiles => _partedFiles;
+
+  /**
+   * The external names referenced by the file.
+   */
+  Set<String> get referencedNames => _referencedNames;
+
+  /**
+   * Return the set of transitive files - the file itself and all of the
+   * directly or indirectly referenced files.
+   */
+  Set<FileState> get transitiveFiles {
+    if (_transitiveFiles == null) {
+      _transitiveFiles = new Set<FileState>();
+
+      void appendReferenced(FileState file) {
+        if (_transitiveFiles.add(file)) {
+          file._directReferencedFiles.forEach(appendReferenced);
+        }
+      }
+
+      appendReferenced(this);
+    }
+    return _transitiveFiles;
+  }
+
+  /**
+   * Return the signature of the file, based on the [transitiveFiles].
+   */
+  String get transitiveSignature {
+    if (_transitiveSignature == null) {
+      ApiSignature signature = new ApiSignature();
+      signature.addUint32List(_fsState._salt);
+      signature.addString(_fsState._sdkApiSignature);
+      signature.addInt(transitiveFiles.length);
+      transitiveFiles
+          .map((file) => file.apiSignature)
+          .forEach(signature.addBytes);
+      signature.addString(uri.toString());
+      _transitiveSignature = signature.toHex();
+    }
+    return _transitiveSignature;
+  }
+
+  /**
+   * The [UnlinkedUnit] of the file.
+   */
+  UnlinkedUnit get unlinked => _unlinked;
+
+  /**
+   * Return the [uri] string.
+   */
+  String get uriStr => uri.toString();
+
+  @override
+  bool operator ==(Object other) {
+    return other is FileState && other.uri == uri;
+  }
+
+  /**
+   * Return a new parsed unresolved [CompilationUnit].
+   */
+  CompilationUnit parse(AnalysisErrorListener errorListener) {
+    AnalysisOptions analysisOptions = _fsState._analysisOptions;
+
+    CharSequenceReader reader = new CharSequenceReader(content);
+    Scanner scanner = new Scanner(source, reader, errorListener);
+    scanner.scanGenericMethodComments = analysisOptions.strongMode;
+    Token token = scanner.tokenize();
+    LineInfo lineInfo = new LineInfo(scanner.lineStarts);
+
+    Parser parser = new Parser(source, errorListener);
+    parser.parseGenericMethodComments = analysisOptions.strongMode;
+    CompilationUnit unit = parser.parseCompilationUnit(token);
+    unit.lineInfo = lineInfo;
+    return unit;
+  }
+
+  /**
+   * Read the file content and ensure that all of the file properties are
+   * consistent with the read content, including API signature.
+   *
+   * Return `true` if the API signature changed since the last refresh.
+   */
+  bool refresh() {
+    // Read the content.
+    try {
+      _content = _fsState._contentOverlay[path];
+      _content ??= _fsState._resourceProvider.getFile(path).readAsStringSync();
+    } catch (_) {
+      _content = '';
+      // TODO(scheglov) We fail to report URI_DOES_NOT_EXIST.
+      // On one hand we need to provide an unlinked bundle to prevent
+      // analysis context from reading the file (we want it to work
+      // hermetically and handle one one file at a time). OTOH,
+      // ResynthesizerResultProvider happily reports that any source in the
+      // SummaryDataStore has MODIFICATION_TIME `0`. We need to return `-1`
+      // for missing files. Maybe add this feature to SummaryDataStore?
+    }
+
+    // Compute the content hash.
+    List<int> contentBytes = UTF8.encode(_content);
+    {
+      List<int> hashBytes = md5.convert(contentBytes).bytes;
+      _contentHash = hex.encode(hashBytes);
+    }
+
+    // Prepare the unlinked bundle key.
+    String unlinkedKey;
+    {
+      ApiSignature signature = new ApiSignature();
+      signature.addUint32List(_fsState._salt);
+      signature.addBytes(contentBytes);
+      unlinkedKey = '${signature.toHex()}.unlinked';
+    }
+
+    // Prepare bytes of the unlinked bundle - existing or new.
+    List<int> bytes;
+    {
+      bytes = _fsState._byteStore.get(unlinkedKey);
+      if (bytes == null) {
+        CompilationUnit unit = parse(AnalysisErrorListener.NULL_LISTENER);
+        _fsState._logger.run('Create unlinked for $path', () {
+          UnlinkedUnitBuilder unlinkedUnit = serializeAstUnlinked(unit);
+          List<String> referencedNames = computeReferencedNames(unit).toList();
+          bytes = new AnalysisDriverUnlinkedUnitBuilder(
+                  unit: unlinkedUnit, referencedNames: referencedNames)
+              .toBuffer();
+          _fsState._byteStore.put(unlinkedKey, bytes);
+        });
+      }
+    }
+
+    // Read the unlinked bundle.
+    var driverUnlinkedUnit = new AnalysisDriverUnlinkedUnit.fromBuffer(bytes);
+    _referencedNames = new Set<String>.from(driverUnlinkedUnit.referencedNames);
+    _unlinked = driverUnlinkedUnit.unit;
+    _lineInfo = new LineInfo(_unlinked.lineStarts);
+    List<int> newApiSignature = _unlinked.apiSignature;
+    bool apiSignatureChanged = _apiSignature != null &&
+        !_equalByteLists(_apiSignature, newApiSignature);
+    _apiSignature = newApiSignature;
+
+    // If the API signature changed, flush transitive signatures.
+    if (apiSignatureChanged) {
+      for (FileState file in _fsState._uriToFile.values) {
+        if (file._transitiveFiles != null &&
+            file._transitiveFiles.contains(this)) {
+          file._transitiveSignature = null;
+        }
+      }
+    }
+
+    // This file is potentially not a library for its previous parts anymore.
+    if (_partedFiles != null) {
+      for (FileState part in _partedFiles) {
+        _fsState._partToLibraries[part]?.remove(this);
+      }
+    }
+
+    // Build the graph.
+    _importedFiles = <FileState>[];
+    _exportedFiles = <FileState>[];
+    _partedFiles = <FileState>[];
+    for (UnlinkedImport import in _unlinked.imports) {
+      if (!import.isImplicit) {
+        String uri = import.uri;
+        if (!_isDartUri(uri)) {
+          FileState file = _fileForRelativeUri(uri);
+          if (file != null) {
+            _importedFiles.add(file);
+          }
+        }
+      }
+    }
+    for (UnlinkedExportPublic export in _unlinked.publicNamespace.exports) {
+      String uri = export.uri;
+      if (!_isDartUri(uri)) {
+        FileState file = _fileForRelativeUri(uri);
+        if (file != null) {
+          _exportedFiles.add(file);
+        }
+      }
+    }
+    for (String uri in _unlinked.publicNamespace.parts) {
+      if (!_isDartUri(uri)) {
+        FileState file = _fileForRelativeUri(uri);
+        if (file != null) {
+          _partedFiles.add(file);
+          // TODO(scheglov) Sort for stable results?
+          _fsState._partToLibraries
+              .putIfAbsent(file, () => <FileState>[])
+              .add(this);
+        }
+      }
+    }
+
+    // Compute referenced files.
+    Set<FileState> oldDirectReferencedFiles = _directReferencedFiles;
+    _directReferencedFiles = new Set<FileState>()
+      ..addAll(_importedFiles)
+      ..addAll(_exportedFiles)
+      ..addAll(_partedFiles);
+
+    // If the set of directly referenced files of this file is changed,
+    // then the transitive sets of files that include this file are also
+    // changed. Reset these transitive sets.
+    if (_directReferencedFiles.length != oldDirectReferencedFiles.length ||
+        !_directReferencedFiles.containsAll(oldDirectReferencedFiles)) {
+      for (FileState file in _fsState._uriToFile.values) {
+        if (file._transitiveFiles != null &&
+            file._transitiveFiles.contains(this)) {
+          file._transitiveFiles = null;
+        }
+      }
+    }
+
+    // Return whether the API signature changed.
+    return apiSignatureChanged;
+  }
+
+  @override
+  String toString() => path;
+
+  /**
+   * Return the [FileState] for the given [relativeUri].
+   */
+  FileState _fileForRelativeUri(String relativeUri) {
+    Uri absoluteUri = resolveRelativeUri(uri, FastUri.parse(relativeUri));
+    return _fsState.getFileForUri(absoluteUri);
+  }
+
+  /**
+   * Return `true` if the given byte lists are equal.
+   */
+  static bool _equalByteLists(List<int> a, List<int> b) {
+    if (a == null) {
+      return b == null;
+    } else if (b == null) {
+      return false;
+    }
+    if (a.length != b.length) {
+      return false;
+    }
+    for (int i = 0; i < a.length; i++) {
+      if (a[i] != b[i]) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  static bool _isDartUri(String uri) {
+    return uri.startsWith('dart:');
+  }
+}
+
+/**
+ * Information about known file system state.
+ */
+class FileSystemState {
+  final PerformanceLog _logger;
+  final ResourceProvider _resourceProvider;
+  final ByteStore _byteStore;
+  final FileContentOverlay _contentOverlay;
+  final SourceFactory _sourceFactory;
+  final AnalysisOptions _analysisOptions;
+  final Uint32List _salt;
+  final String _sdkApiSignature;
+
+  /**
+   * Mapping from a URI to the corresponding [FileState].
+   */
+  final Map<Uri, FileState> _uriToFile = {};
+
+  /**
+   * Mapping from a path to the corresponding [FileState]s, canonical or not.
+   */
+  final Map<String, List<FileState>> _pathToFiles = {};
+
+  /**
+   * Mapping from a path to the corresponding canonical [FileState].
+   */
+  final Map<String, FileState> _pathToCanonicalFile = {};
+
+  /**
+   * Mapping from a part to the libraries it is a part of.
+   */
+  final Map<FileState, List<FileState>> _partToLibraries = {};
+
+  FileSystemStateTestView _testView;
+
+  FileSystemState(
+      this._logger,
+      this._byteStore,
+      this._contentOverlay,
+      this._resourceProvider,
+      this._sourceFactory,
+      this._analysisOptions,
+      this._salt,
+      this._sdkApiSignature) {
+    _testView = new FileSystemStateTestView(this);
+  }
+
+  /**
+   * Return the set of known files.
+   */
+  Set<String> get knownFiles => _pathToFiles.keys.toSet();
+
+  @visibleForTesting
+  FileSystemStateTestView get test => _testView;
+
+  /**
+   * Return the canonical [FileState] for the given absolute [path]. The
+   * returned file has the last known state since if was last refreshed.
+   *
+   * Here "canonical" means that if the [path] is in a package `lib` then the
+   * returned file will have the `package:` style URI.
+   */
+  FileState getFileForPath(String path) {
+    FileState file = _pathToCanonicalFile[path];
+    if (file == null) {
+      File resource = _resourceProvider.getFile(path);
+      Source fileSource = resource.createSource();
+      Uri uri = _sourceFactory.restoreUri(fileSource);
+      // Try to get the existing instance.
+      file = _uriToFile[uri];
+      // If we have a file, call it the canonical one and return it.
+      if (file != null) {
+        _pathToCanonicalFile[path] = file;
+        return file;
+      }
+      // Create a new file.
+      FileSource uriSource = new FileSource(resource, uri);
+      file = new FileState._(this, path, uri, uriSource);
+      _uriToFile[uri] = file;
+      _pathToFiles.putIfAbsent(path, () => <FileState>[]).add(file);
+      _pathToCanonicalFile[path] = file;
+      file.refresh();
+    }
+    return file;
+  }
+
+  /**
+   * Return the [FileState] for the given absolute [uri]. May return `null` if
+   * the [uri] is invalid, e.g. a `package:` URI without a package name. The
+   * returned file has the last known state since if was last refreshed.
+   */
+  FileState getFileForUri(Uri uri) {
+    FileState file = _uriToFile[uri];
+    if (file == null) {
+      Source uriSource = _sourceFactory.resolveUri(null, uri.toString());
+      // If the URI is invalid, for example package:/test/d.dart (note the
+      // leading '/'), then `null` is returned. We should ignore this URI.
+      if (uriSource == null) {
+        return null;
+      }
+      String path = uriSource.fullName;
+      File resource = _resourceProvider.getFile(path);
+      FileSource source = new FileSource(resource, uri);
+      file = new FileState._(this, path, uri, source);
+      _uriToFile[uri] = file;
+      _pathToFiles.putIfAbsent(path, () => <FileState>[]).add(file);
+      file.refresh();
+    }
+    return file;
+  }
+
+  /**
+   * Return the list of all [FileState]s corresponding to the given [path]. The
+   * list has at least one item, and the first item is the canonical file.
+   */
+  List<FileState> getFilesForPath(String path) {
+    FileState canonicalFile = getFileForPath(path);
+    List<FileState> allFiles = _pathToFiles[path].toList();
+    if (allFiles.length == 1) {
+      return allFiles;
+    }
+    return allFiles
+      ..remove(canonicalFile)
+      ..insert(0, canonicalFile);
+  }
+}
+
+@visibleForTesting
+class FileSystemStateTestView {
+  final FileSystemState state;
+
+  FileSystemStateTestView(this.state);
+
+  Set<FileState> get filesWithoutTransitiveFiles {
+    return state._uriToFile.values
+        .where((f) => f._transitiveFiles == null)
+        .toSet();
+  }
+
+  Set<FileState> get filesWithoutTransitiveSignature {
+    return state._uriToFile.values
+        .where((f) => f._transitiveSignature == null)
+        .toSet();
+  }
+}
diff --git a/pkg/analyzer/lib/src/dart/analysis/index.dart b/pkg/analyzer/lib/src/dart/analysis/index.dart
new file mode 100644
index 0000000..8c8c132
--- /dev/null
+++ b/pkg/analyzer/lib/src/dart/analysis/index.dart
@@ -0,0 +1,808 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/ast/token.dart';
+import 'package:analyzer/dart/ast/visitor.dart';
+import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer/dart/element/type.dart';
+import 'package:analyzer/src/dart/element/member.dart';
+import 'package:analyzer/src/generated/utilities_dart.dart';
+import 'package:analyzer/src/summary/format.dart'
+    show AnalysisDriverUnitIndexBuilder;
+import 'package:analyzer/src/summary/idl.dart';
+
+/**
+ * Return the [CompilationUnitElement] that should be used for [element].
+ * Throw [StateError] if the [element] is not linked into a unit.
+ */
+CompilationUnitElement getUnitElement(Element element) {
+  for (Element e = element; e != null; e = e.enclosingElement) {
+    if (e is CompilationUnitElement) {
+      return e;
+    }
+    if (e is LibraryElement) {
+      return e.definingCompilationUnit;
+    }
+  }
+  throw new StateError('Element not contained in compilation unit: $element');
+}
+
+/**
+ * Index the [unit] into a new [AnalysisDriverUnitIndexBuilder].
+ */
+AnalysisDriverUnitIndexBuilder indexUnit(CompilationUnit unit) {
+  return new _IndexAssembler().assemble(unit);
+}
+
+/**
+ * Information about an element that is actually put into index for some other
+ * related element. For example for a synthetic getter this is the corresponding
+ * non-synthetic field and [IndexSyntheticElementKind.getter] as the [kind].
+ */
+class IndexElementInfo {
+  final Element element;
+  final IndexSyntheticElementKind kind;
+
+  factory IndexElementInfo(Element element) {
+    IndexSyntheticElementKind kind = IndexSyntheticElementKind.notSynthetic;
+    ElementKind elementKind = element.kind;
+    if (elementKind == ElementKind.LIBRARY ||
+        elementKind == ElementKind.COMPILATION_UNIT) {
+      kind = IndexSyntheticElementKind.unit;
+    } else if (element.isSynthetic) {
+      if (elementKind == ElementKind.CONSTRUCTOR) {
+        kind = IndexSyntheticElementKind.constructor;
+        element = element.enclosingElement;
+      } else if (elementKind == ElementKind.FUNCTION &&
+          element.name == 'loadLibrary') {
+        kind = IndexSyntheticElementKind.loadLibrary;
+        element = element.library;
+      } else if (elementKind == ElementKind.FIELD) {
+        FieldElement field = element;
+        kind = IndexSyntheticElementKind.field;
+        element = field.getter ?? field.setter;
+      } else if (elementKind == ElementKind.GETTER ||
+          elementKind == ElementKind.SETTER) {
+        PropertyAccessorElement accessor = element;
+        Element enclosing = element.enclosingElement;
+        bool isEnumGetter = enclosing is ClassElement && enclosing.isEnum;
+        if (isEnumGetter && accessor.name == 'index') {
+          kind = IndexSyntheticElementKind.enumIndex;
+          element = enclosing;
+        } else if (isEnumGetter && accessor.name == 'values') {
+          kind = IndexSyntheticElementKind.enumValues;
+          element = enclosing;
+        } else {
+          kind = accessor.isGetter
+              ? IndexSyntheticElementKind.getter
+              : IndexSyntheticElementKind.setter;
+          element = accessor.variable;
+        }
+      } else if (elementKind == ElementKind.TOP_LEVEL_VARIABLE) {
+        TopLevelVariableElement property = element;
+        kind = IndexSyntheticElementKind.topLevelVariable;
+        element = property.getter ?? property.setter;
+      } else {
+        throw new ArgumentError(
+            'Unsupported synthetic element ${element.runtimeType}');
+      }
+    }
+    return new IndexElementInfo._(element, kind);
+  }
+
+  IndexElementInfo._(this.element, this.kind);
+}
+
+/**
+ * Information about an element referenced in index.
+ */
+class _ElementInfo {
+  /**
+   * The identifier of the [CompilationUnitElement] containing this element.
+   */
+  final int unitId;
+
+  /**
+   * The identifier of the top-level name, or `null` if the element is a
+   * reference to the unit.
+   */
+  final _StringInfo nameIdUnitMember;
+
+  /**
+   * The identifier of the class member name, or `null` if the element is not a
+   * class member or a named parameter of a class member.
+   */
+  final _StringInfo nameIdClassMember;
+
+  /**
+   * The identifier of the named parameter name, or `null` if the element is not
+   * a named parameter.
+   */
+  final _StringInfo nameIdParameter;
+
+  /**
+   * The kind of the element.
+   */
+  final IndexSyntheticElementKind kind;
+
+  /**
+   * The unique id of the element.  It is set after indexing of the whole
+   * package is done and we are assembling the full package index.
+   */
+  int id;
+
+  _ElementInfo(this.unitId, this.nameIdUnitMember, this.nameIdClassMember,
+      this.nameIdParameter, this.kind);
+}
+
+/**
+ * Information about a single relation in a single compilation unit.
+ */
+class _ElementRelationInfo {
+  final _ElementInfo elementInfo;
+  final IndexRelationKind kind;
+  final int offset;
+  final int length;
+  final bool isQualified;
+
+  _ElementRelationInfo(
+      this.elementInfo, this.kind, this.offset, this.length, this.isQualified);
+}
+
+/**
+ * Assembler of a single [CompilationUnit] index.
+ *
+ * The intended usage sequence:
+ *
+ *  - Call [addElementRelation] for each element relation found in the unit.
+ *  - Call [addNameRelation] for each name relation found in the unit.
+ *  - Assign ids to all the [_ElementInfo] in [elementRelations].
+ *  - Call [assemble] to produce the final unit index.
+ */
+class _IndexAssembler {
+  /**
+   * The string to use in place of the `null` string.
+   */
+  static const NULL_STRING = '--nullString--';
+
+  /**
+   * Map associating referenced elements with their [_ElementInfo]s.
+   */
+  final Map<Element, _ElementInfo> elementMap = {};
+
+  /**
+   * Map associating [CompilationUnitElement]s with their identifiers, which
+   * are indices into [unitLibraryUris] and [unitUnitUris].
+   */
+  final Map<CompilationUnitElement, int> unitMap = {};
+
+  /**
+   * The fields [unitLibraryUris] and [unitUnitUris] are used together to
+   * describe each unique [CompilationUnitElement].
+   *
+   * This field contains the library URI of a unit.
+   */
+  final List<_StringInfo> unitLibraryUris = [];
+
+  /**
+   * The fields [unitLibraryUris] and [unitUnitUris] are used together to
+   * describe each unique [CompilationUnitElement].
+   *
+   * This field contains the unit URI of a unit, which might be the same as
+   * the library URI for the defining unit, or a different one for a part.
+   */
+  final List<_StringInfo> unitUnitUris = [];
+
+  /**
+   * Map associating strings with their [_StringInfo]s.
+   */
+  final Map<String, _StringInfo> stringMap = {};
+
+  /**
+   * All element relations.
+   */
+  final List<_ElementRelationInfo> elementRelations = [];
+
+  /**
+   * All unresolved name relations.
+   */
+  final List<_NameRelationInfo> nameRelations = [];
+
+  /**
+   * The [_StringInfo] to use for `null` strings.
+   */
+  _StringInfo nullString;
+
+  _IndexAssembler() {
+    nullString = _getStringInfo(NULL_STRING);
+  }
+
+  void addElementRelation(Element element, IndexRelationKind kind, int offset,
+      int length, bool isQualified) {
+    _ElementInfo elementInfo = _getElementInfo(element);
+    elementRelations.add(new _ElementRelationInfo(
+        elementInfo, kind, offset, length, isQualified));
+  }
+
+  void addNameRelation(
+      String name, IndexRelationKind kind, int offset, bool isQualified) {
+    _StringInfo nameId = _getStringInfo(name);
+    nameRelations.add(new _NameRelationInfo(nameId, kind, offset, isQualified));
+  }
+
+  /**
+   * Index the [unit] and assemble a new [AnalysisDriverUnitIndexBuilder].
+   */
+  AnalysisDriverUnitIndexBuilder assemble(CompilationUnit unit) {
+    unit.accept(new _IndexContributor(this));
+    // sort strings end set IDs
+    List<_StringInfo> stringInfoList = stringMap.values.toList();
+    stringInfoList.sort((a, b) {
+      return a.value.compareTo(b.value);
+    });
+    for (int i = 0; i < stringInfoList.length; i++) {
+      stringInfoList[i].id = i;
+    }
+    // sort elements and set IDs
+    List<_ElementInfo> elementInfoList = elementMap.values.toList();
+    elementInfoList.sort((a, b) {
+      int delta;
+      delta = a.nameIdUnitMember.id - b.nameIdUnitMember.id;
+      if (delta != null) {
+        return delta;
+      }
+      delta = a.nameIdClassMember.id - b.nameIdClassMember.id;
+      if (delta != null) {
+        return delta;
+      }
+      return a.nameIdParameter.id - b.nameIdParameter.id;
+    });
+    for (int i = 0; i < elementInfoList.length; i++) {
+      elementInfoList[i].id = i;
+    }
+    // Sort element and name relations.
+    elementRelations.sort((a, b) {
+      return a.elementInfo.id - b.elementInfo.id;
+    });
+    nameRelations.sort((a, b) {
+      return a.nameInfo.id - b.nameInfo.id;
+    });
+    return new AnalysisDriverUnitIndexBuilder(
+        strings: stringInfoList.map((s) => s.value).toList(),
+        nullStringId: nullString.id,
+        unitLibraryUris: unitLibraryUris.map((s) => s.id).toList(),
+        unitUnitUris: unitUnitUris.map((s) => s.id).toList(),
+        elementKinds: elementInfoList.map((e) => e.kind).toList(),
+        elementUnits: elementInfoList.map((e) => e.unitId).toList(),
+        elementNameUnitMemberIds:
+            elementInfoList.map((e) => e.nameIdUnitMember.id).toList(),
+        elementNameClassMemberIds:
+            elementInfoList.map((e) => e.nameIdClassMember.id).toList(),
+        elementNameParameterIds:
+            elementInfoList.map((e) => e.nameIdParameter.id).toList(),
+        usedElements: elementRelations.map((r) => r.elementInfo.id).toList(),
+        usedElementKinds: elementRelations.map((r) => r.kind).toList(),
+        usedElementOffsets: elementRelations.map((r) => r.offset).toList(),
+        usedElementLengths: elementRelations.map((r) => r.length).toList(),
+        usedElementIsQualifiedFlags:
+            elementRelations.map((r) => r.isQualified).toList(),
+        usedNames: nameRelations.map((r) => r.nameInfo.id).toList(),
+        usedNameKinds: nameRelations.map((r) => r.kind).toList(),
+        usedNameOffsets: nameRelations.map((r) => r.offset).toList(),
+        usedNameIsQualifiedFlags:
+            nameRelations.map((r) => r.isQualified).toList());
+  }
+
+  /**
+   * Return the unique [_ElementInfo] corresponding the [element].  The field
+   * [_ElementInfo.id] is filled by [assemble] during final sorting.
+   */
+  _ElementInfo _getElementInfo(Element element) {
+    if (element is Member) {
+      element = (element as Member).baseElement;
+    }
+    return elementMap.putIfAbsent(element, () {
+      CompilationUnitElement unitElement = getUnitElement(element);
+      int unitId = _getUnitId(unitElement);
+      return _newElementInfo(unitId, element);
+    });
+  }
+
+  /**
+   * Return the unique [_StringInfo] corresponding the given [string].  The
+   * field [_StringInfo.id] is filled by [assemble] during final sorting.
+   */
+  _StringInfo _getStringInfo(String string) {
+    return stringMap.putIfAbsent(string, () {
+      return new _StringInfo(string);
+    });
+  }
+
+  /**
+   * Add information about [unitElement] to [unitUnitUris] and
+   * [unitLibraryUris] if necessary, and return the location in those
+   * arrays representing [unitElement].
+   */
+  int _getUnitId(CompilationUnitElement unitElement) {
+    return unitMap.putIfAbsent(unitElement, () {
+      assert(unitLibraryUris.length == unitUnitUris.length);
+      int id = unitUnitUris.length;
+      unitLibraryUris.add(_getUriInfo(unitElement.library.source.uri));
+      unitUnitUris.add(_getUriInfo(unitElement.source.uri));
+      return id;
+    });
+  }
+
+  /**
+   * Return the unique [_StringInfo] corresponding [uri].  The field
+   * [_StringInfo.id] is filled by [assemble] during final sorting.
+   */
+  _StringInfo _getUriInfo(Uri uri) {
+    String str = uri.toString();
+    return _getStringInfo(str);
+  }
+
+  /**
+   * Return a new [_ElementInfo] for the given [element] in the given [unitId].
+   * This method is static, so it cannot add any information to the index.
+   */
+  _ElementInfo _newElementInfo(int unitId, Element element) {
+    IndexElementInfo info = new IndexElementInfo(element);
+    element = info.element;
+    // Prepare name identifiers.
+    _StringInfo nameIdParameter = nullString;
+    _StringInfo nameIdClassMember = nullString;
+    _StringInfo nameIdUnitMember = nullString;
+    if (element is ParameterElement) {
+      nameIdParameter = _getStringInfo(element.name);
+      element = element.enclosingElement;
+    }
+    if (element?.enclosingElement is ClassElement) {
+      nameIdClassMember = _getStringInfo(element.name);
+      element = element.enclosingElement;
+    }
+    if (element?.enclosingElement is CompilationUnitElement) {
+      nameIdUnitMember = _getStringInfo(element.name);
+    }
+    return new _ElementInfo(unitId, nameIdUnitMember, nameIdClassMember,
+        nameIdParameter, info.kind);
+  }
+}
+
+/**
+ * Visits a resolved AST and adds relationships into the [assembler].
+ */
+class _IndexContributor extends GeneralizingAstVisitor {
+  final _IndexAssembler assembler;
+
+  _IndexContributor(this.assembler);
+
+  void recordIsAncestorOf(Element descendant) {
+    _recordIsAncestorOf(descendant, descendant, false, <ClassElement>[]);
+  }
+
+  /**
+   * Record that the name [node] has a relation of the given [kind].
+   */
+  void recordNameRelation(
+      SimpleIdentifier node, IndexRelationKind kind, bool isQualified) {
+    if (node != null) {
+      assembler.addNameRelation(node.name, kind, node.offset, isQualified);
+    }
+  }
+
+  /**
+   * Record reference to the given operator [Element].
+   */
+  void recordOperatorReference(Token operator, Element element) {
+    recordRelationToken(element, IndexRelationKind.IS_INVOKED_BY, operator);
+  }
+
+  /**
+   * Record that [element] has a relation of the given [kind] at the location
+   * of the given [node].  The flag [isQualified] is `true` if [node] has an
+   * explicit or implicit qualifier, so cannot be shadowed by a local
+   * declaration.
+   */
+  void recordRelation(
+      Element element, IndexRelationKind kind, AstNode node, bool isQualified) {
+    if (element != null && node != null) {
+      recordRelationOffset(
+          element, kind, node.offset, node.length, isQualified);
+    }
+  }
+
+  /**
+   * Record that [element] has a relation of the given [kind] at the given
+   * [offset] and [length].  The flag [isQualified] is `true` if the relation
+   * has an explicit or implicit qualifier, so [element] cannot be shadowed by
+   * a local declaration.
+   */
+  void recordRelationOffset(Element element, IndexRelationKind kind, int offset,
+      int length, bool isQualified) {
+    // Ignore elements that can't be referenced outside of the unit.
+    ElementKind elementKind = element?.kind;
+    if (elementKind == null ||
+        elementKind == ElementKind.DYNAMIC ||
+        elementKind == ElementKind.ERROR ||
+        elementKind == ElementKind.LABEL ||
+        elementKind == ElementKind.LOCAL_VARIABLE ||
+        elementKind == ElementKind.PREFIX ||
+        elementKind == ElementKind.TYPE_PARAMETER ||
+        elementKind == ElementKind.FUNCTION &&
+            element is FunctionElement &&
+            element.enclosingElement is ExecutableElement ||
+        elementKind == ElementKind.PARAMETER &&
+            element is ParameterElement &&
+            element.parameterKind != ParameterKind.NAMED ||
+        false) {
+      return;
+    }
+    // Ignore named parameters of synthetic functions, e.g. created for LUB.
+    // These functions are not bound to a source, we cannot index them.
+    if (elementKind == ElementKind.PARAMETER &&
+        element is ParameterElement &&
+        element.enclosingElement.isSynthetic) {
+      return;
+    }
+    // Add the relation.
+    assembler.addElementRelation(element, kind, offset, length, isQualified);
+  }
+
+  /**
+   * Record that [element] has a relation of the given [kind] at the location
+   * of the given [token].
+   */
+  void recordRelationToken(
+      Element element, IndexRelationKind kind, Token token) {
+    if (element != null && token != null) {
+      recordRelationOffset(element, kind, token.offset, token.length, true);
+    }
+  }
+
+  /**
+   * Record a relation between a super [typeName] and its [Element].
+   */
+  void recordSuperType(TypeName typeName, IndexRelationKind kind) {
+    Identifier name = typeName?.name;
+    if (name != null) {
+      Element element = name.staticElement;
+      bool isQualified;
+      SimpleIdentifier relNode;
+      if (name is PrefixedIdentifier) {
+        isQualified = true;
+        relNode = name.identifier;
+      } else {
+        isQualified = false;
+        relNode = name;
+      }
+      recordRelation(element, kind, relNode, isQualified);
+      recordRelation(
+          element, IndexRelationKind.IS_REFERENCED_BY, relNode, isQualified);
+      typeName.typeArguments?.accept(this);
+    }
+  }
+
+  void recordUriReference(Element element, UriBasedDirective directive) {
+    recordRelation(
+        element, IndexRelationKind.IS_REFERENCED_BY, directive.uri, true);
+  }
+
+  @override
+  visitAssignmentExpression(AssignmentExpression node) {
+    recordOperatorReference(node.operator, node.bestElement);
+    super.visitAssignmentExpression(node);
+  }
+
+  @override
+  visitBinaryExpression(BinaryExpression node) {
+    recordOperatorReference(node.operator, node.bestElement);
+    super.visitBinaryExpression(node);
+  }
+
+  @override
+  visitClassDeclaration(ClassDeclaration node) {
+    if (node.extendsClause == null) {
+      ClassElement objectElement = node.element.supertype?.element;
+      recordRelationOffset(objectElement, IndexRelationKind.IS_EXTENDED_BY,
+          node.name.offset, 0, true);
+    }
+    recordIsAncestorOf(node.element);
+    super.visitClassDeclaration(node);
+  }
+
+  @override
+  visitClassTypeAlias(ClassTypeAlias node) {
+    recordIsAncestorOf(node.element);
+    super.visitClassTypeAlias(node);
+  }
+
+  @override
+  visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
+    SimpleIdentifier fieldName = node.fieldName;
+    if (fieldName != null) {
+      Element element = fieldName.staticElement;
+      recordRelation(element, IndexRelationKind.IS_WRITTEN_BY, fieldName, true);
+    }
+    node.expression?.accept(this);
+  }
+
+  @override
+  visitConstructorName(ConstructorName node) {
+    ConstructorElement element = node.staticElement;
+    element = _getActualConstructorElement(element);
+    // record relation
+    if (node.name != null) {
+      int offset = node.period.offset;
+      int length = node.name.end - offset;
+      recordRelationOffset(
+          element, IndexRelationKind.IS_REFERENCED_BY, offset, length, true);
+    } else {
+      int offset = node.type.end;
+      recordRelationOffset(
+          element, IndexRelationKind.IS_REFERENCED_BY, offset, 0, true);
+    }
+    node.type.accept(this);
+  }
+
+  @override
+  visitExportDirective(ExportDirective node) {
+    ExportElement element = node.element;
+    recordUriReference(element?.exportedLibrary, node);
+    super.visitExportDirective(node);
+  }
+
+  @override
+  visitExtendsClause(ExtendsClause node) {
+    recordSuperType(node.superclass, IndexRelationKind.IS_EXTENDED_BY);
+  }
+
+  @override
+  visitImplementsClause(ImplementsClause node) {
+    for (TypeName typeName in node.interfaces) {
+      recordSuperType(typeName, IndexRelationKind.IS_IMPLEMENTED_BY);
+    }
+  }
+
+  @override
+  visitImportDirective(ImportDirective node) {
+    ImportElement element = node.element;
+    recordUriReference(element?.importedLibrary, node);
+    super.visitImportDirective(node);
+  }
+
+  @override
+  visitIndexExpression(IndexExpression node) {
+    MethodElement element = node.bestElement;
+    if (element is MethodElement) {
+      Token operator = node.leftBracket;
+      recordRelationToken(element, IndexRelationKind.IS_INVOKED_BY, operator);
+    }
+    super.visitIndexExpression(node);
+  }
+
+  @override
+  visitLibraryIdentifier(LibraryIdentifier node) {}
+
+  @override
+  visitMethodInvocation(MethodInvocation node) {
+    SimpleIdentifier name = node.methodName;
+    Element element = name.bestElement;
+    // unresolved name invocation
+    bool isQualified = node.realTarget != null;
+    if (element == null) {
+      recordNameRelation(name, IndexRelationKind.IS_INVOKED_BY, isQualified);
+    }
+    // element invocation
+    IndexRelationKind kind = element is ClassElement
+        ? IndexRelationKind.IS_REFERENCED_BY
+        : IndexRelationKind.IS_INVOKED_BY;
+    recordRelation(element, kind, name, isQualified);
+    node.target?.accept(this);
+    node.argumentList?.accept(this);
+  }
+
+  @override
+  visitPartDirective(PartDirective node) {
+    Element element = node.element;
+    recordUriReference(element, node);
+    super.visitPartDirective(node);
+  }
+
+  @override
+  visitPostfixExpression(PostfixExpression node) {
+    recordOperatorReference(node.operator, node.bestElement);
+    super.visitPostfixExpression(node);
+  }
+
+  @override
+  visitPrefixExpression(PrefixExpression node) {
+    recordOperatorReference(node.operator, node.bestElement);
+    super.visitPrefixExpression(node);
+  }
+
+  @override
+  visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
+    ConstructorElement element = node.staticElement;
+    if (node.constructorName != null) {
+      int offset = node.period.offset;
+      int length = node.constructorName.end - offset;
+      recordRelationOffset(
+          element, IndexRelationKind.IS_REFERENCED_BY, offset, length, true);
+    } else {
+      int offset = node.thisKeyword.end;
+      recordRelationOffset(
+          element, IndexRelationKind.IS_REFERENCED_BY, offset, 0, true);
+    }
+    super.visitRedirectingConstructorInvocation(node);
+  }
+
+  @override
+  visitSimpleIdentifier(SimpleIdentifier node) {
+    // name in declaration
+    if (node.inDeclarationContext()) {
+      return;
+    }
+    Element element = node.bestElement;
+    // record unresolved name reference
+    bool isQualified = _isQualified(node);
+    if (element == null) {
+      bool inGetterContext = node.inGetterContext();
+      bool inSetterContext = node.inSetterContext();
+      IndexRelationKind kind;
+      if (inGetterContext && inSetterContext) {
+        kind = IndexRelationKind.IS_READ_WRITTEN_BY;
+      } else if (inGetterContext) {
+        kind = IndexRelationKind.IS_READ_BY;
+      } else {
+        kind = IndexRelationKind.IS_WRITTEN_BY;
+      }
+      recordNameRelation(node, kind, isQualified);
+    }
+    // this.field parameter
+    if (element is FieldFormalParameterElement) {
+      AstNode parent = node.parent;
+      IndexRelationKind kind =
+          parent is FieldFormalParameter && parent.identifier == node
+              ? IndexRelationKind.IS_WRITTEN_BY
+              : IndexRelationKind.IS_REFERENCED_BY;
+      recordRelation(element.field, kind, node, true);
+      return;
+    }
+    // ignore a local reference to a parameter
+    if (element is ParameterElement && node.parent is! Label) {
+      return;
+    }
+    // record specific relations
+    recordRelation(
+        element, IndexRelationKind.IS_REFERENCED_BY, node, isQualified);
+  }
+
+  @override
+  visitSuperConstructorInvocation(SuperConstructorInvocation node) {
+    ConstructorElement element = node.staticElement;
+    if (node.constructorName != null) {
+      int offset = node.period.offset;
+      int length = node.constructorName.end - offset;
+      recordRelationOffset(
+          element, IndexRelationKind.IS_REFERENCED_BY, offset, length, true);
+    } else {
+      int offset = node.superKeyword.end;
+      recordRelationOffset(
+          element, IndexRelationKind.IS_REFERENCED_BY, offset, 0, true);
+    }
+    node.argumentList?.accept(this);
+  }
+
+  @override
+  visitTypeName(TypeName node) {
+    AstNode parent = node.parent;
+    if (parent is ClassTypeAlias && parent.superclass == node) {
+      recordSuperType(node, IndexRelationKind.IS_EXTENDED_BY);
+    } else {
+      super.visitTypeName(node);
+    }
+  }
+
+  @override
+  visitWithClause(WithClause node) {
+    for (TypeName typeName in node.mixinTypes) {
+      recordSuperType(typeName, IndexRelationKind.IS_MIXED_IN_BY);
+    }
+  }
+
+  /**
+   * If the given [constructor] is a synthetic constructor created for a
+   * [ClassTypeAlias], return the actual constructor of a [ClassDeclaration]
+   * which is invoked.  Return `null` if a redirection cycle is detected.
+   */
+  ConstructorElement _getActualConstructorElement(
+      ConstructorElement constructor) {
+    Set<ConstructorElement> seenConstructors = new Set<ConstructorElement>();
+    while (constructor != null &&
+        constructor.isSynthetic &&
+        constructor.redirectedConstructor != null) {
+      constructor = constructor.redirectedConstructor;
+      // fail if a cycle is detected
+      if (!seenConstructors.add(constructor)) {
+        return null;
+      }
+    }
+    return constructor;
+  }
+
+  /**
+   * Return `true` if [node] has an explicit or implicit qualifier, so that it
+   * cannot be shadowed by a local declaration.
+   */
+  bool _isQualified(SimpleIdentifier node) {
+    if (node.isQualified) {
+      return true;
+    }
+    AstNode parent = node.parent;
+    return parent is Combinator || parent is Label;
+  }
+
+  void _recordIsAncestorOf(Element descendant, ClassElement ancestor,
+      bool includeThis, List<ClassElement> visitedElements) {
+    if (ancestor == null) {
+      return;
+    }
+    if (visitedElements.contains(ancestor)) {
+      return;
+    }
+    visitedElements.add(ancestor);
+    if (includeThis) {
+      int offset = descendant.nameOffset;
+      int length = descendant.nameLength;
+      assembler.addElementRelation(
+          ancestor, IndexRelationKind.IS_ANCESTOR_OF, offset, length, false);
+    }
+    {
+      InterfaceType superType = ancestor.supertype;
+      if (superType != null) {
+        _recordIsAncestorOf(
+            descendant, superType.element, true, visitedElements);
+      }
+    }
+    for (InterfaceType mixinType in ancestor.mixins) {
+      _recordIsAncestorOf(descendant, mixinType.element, true, visitedElements);
+    }
+    for (InterfaceType implementedType in ancestor.interfaces) {
+      _recordIsAncestorOf(
+          descendant, implementedType.element, true, visitedElements);
+    }
+  }
+}
+
+/**
+ * Information about a single name relation in single compilation unit.
+ */
+class _NameRelationInfo {
+  final _StringInfo nameInfo;
+  final IndexRelationKind kind;
+  final int offset;
+  final bool isQualified;
+
+  _NameRelationInfo(this.nameInfo, this.kind, this.offset, this.isQualified);
+}
+
+/**
+ * Information about a string referenced in the index.
+ */
+class _StringInfo {
+  /**
+   * The value of the string.
+   */
+  final String value;
+
+  /**
+   * The unique id of the string.  It is set after indexing of the whole
+   * package is done and we are assembling the full package index.
+   */
+  int id;
+
+  _StringInfo(this.value);
+}
diff --git a/pkg/analyzer/lib/src/dart/analysis/referenced_names.dart b/pkg/analyzer/lib/src/dart/analysis/referenced_names.dart
new file mode 100644
index 0000000..811aa92
--- /dev/null
+++ b/pkg/analyzer/lib/src/dart/analysis/referenced_names.dart
@@ -0,0 +1,250 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/ast/visitor.dart';
+
+/**
+ * Compute the set of external names referenced in the [unit].
+ */
+Set<String> computeReferencedNames(CompilationUnit unit) {
+  _ReferencedNamesComputer computer = new _ReferencedNamesComputer();
+  unit.accept(computer);
+  return computer.names;
+}
+
+/**
+ * Chained set of local names, that hide corresponding external names.
+ */
+class _LocalNameScope {
+  final _LocalNameScope enclosing;
+  Set<String> names;
+
+  _LocalNameScope(this.enclosing);
+
+  factory _LocalNameScope.forBlock(_LocalNameScope enclosing, Block node) {
+    _LocalNameScope scope = new _LocalNameScope(enclosing);
+    for (Statement statement in node.statements) {
+      if (statement is FunctionDeclarationStatement) {
+        scope.add(statement.functionDeclaration.name);
+      } else if (statement is VariableDeclarationStatement) {
+        scope.addVariableNames(statement.variables);
+      }
+    }
+    return scope;
+  }
+
+  factory _LocalNameScope.forClass(
+      _LocalNameScope enclosing, ClassDeclaration node) {
+    _LocalNameScope scope = new _LocalNameScope(enclosing);
+    scope.addTypeParameters(node.typeParameters);
+    for (ClassMember member in node.members) {
+      if (member is FieldDeclaration) {
+        scope.addVariableNames(member.fields);
+      } else if (member is MethodDeclaration) {
+        scope.add(member.name);
+      }
+    }
+    return scope;
+  }
+
+  factory _LocalNameScope.forClassTypeAlias(
+      _LocalNameScope enclosing, ClassTypeAlias node) {
+    _LocalNameScope scope = new _LocalNameScope(enclosing);
+    scope.addTypeParameters(node.typeParameters);
+    return scope;
+  }
+
+  factory _LocalNameScope.forFunction(
+      _LocalNameScope enclosing, FunctionDeclaration node) {
+    _LocalNameScope scope = new _LocalNameScope(enclosing);
+    scope.addTypeParameters(node.functionExpression.typeParameters);
+    scope.addFormalParameters(node.functionExpression.parameters);
+    return scope;
+  }
+
+  factory _LocalNameScope.forFunctionTypeAlias(
+      _LocalNameScope enclosing, FunctionTypeAlias node) {
+    _LocalNameScope scope = new _LocalNameScope(enclosing);
+    scope.addTypeParameters(node.typeParameters);
+    return scope;
+  }
+
+  factory _LocalNameScope.forMethod(
+      _LocalNameScope enclosing, MethodDeclaration node) {
+    _LocalNameScope scope = new _LocalNameScope(enclosing);
+    scope.addTypeParameters(node.typeParameters);
+    scope.addFormalParameters(node.parameters);
+    return scope;
+  }
+
+  factory _LocalNameScope.forUnit(CompilationUnit node) {
+    _LocalNameScope scope = new _LocalNameScope(null);
+    for (CompilationUnitMember declaration in node.declarations) {
+      if (declaration is NamedCompilationUnitMember) {
+        scope.add(declaration.name);
+      } else if (declaration is TopLevelVariableDeclaration) {
+        scope.addVariableNames(declaration.variables);
+      }
+    }
+    return scope;
+  }
+
+  void add(SimpleIdentifier identifier) {
+    if (identifier != null) {
+      names ??= new Set<String>();
+      names.add(identifier.name);
+    }
+  }
+
+  void addFormalParameters(FormalParameterList parameterList) {
+    if (parameterList != null) {
+      parameterList.parameters
+          .map((p) => p is NormalFormalParameter ? p.identifier : null)
+          .forEach(add);
+    }
+  }
+
+  void addTypeParameters(TypeParameterList typeParameterList) {
+    if (typeParameterList != null) {
+      typeParameterList.typeParameters.map((p) => p.name).forEach(add);
+    }
+  }
+
+  void addVariableNames(VariableDeclarationList variableList) {
+    for (VariableDeclaration variable in variableList.variables) {
+      add(variable.name);
+    }
+  }
+
+  bool contains(String name) {
+    if (names != null && names.contains(name)) {
+      return true;
+    }
+    if (enclosing != null) {
+      return enclosing.contains(name);
+    }
+    return false;
+  }
+}
+
+class _ReferencedNamesComputer extends GeneralizingAstVisitor {
+  final Set<String> names = new Set<String>();
+  final Set<String> importPrefixNames = new Set<String>();
+
+  _LocalNameScope localScope = new _LocalNameScope(null);
+
+  @override
+  visitBlock(Block node) {
+    _LocalNameScope outerScope = localScope;
+    try {
+      localScope = new _LocalNameScope.forBlock(localScope, node);
+      super.visitBlock(node);
+    } finally {
+      localScope = outerScope;
+    }
+  }
+
+  @override
+  visitClassDeclaration(ClassDeclaration node) {
+    _LocalNameScope outerScope = localScope;
+    try {
+      localScope = new _LocalNameScope.forClass(localScope, node);
+      super.visitClassDeclaration(node);
+    } finally {
+      localScope = outerScope;
+    }
+  }
+
+  @override
+  visitClassTypeAlias(ClassTypeAlias node) {
+    _LocalNameScope outerScope = localScope;
+    try {
+      localScope = new _LocalNameScope.forClassTypeAlias(localScope, node);
+      super.visitClassTypeAlias(node);
+    } finally {
+      localScope = outerScope;
+    }
+  }
+
+  @override
+  visitCompilationUnit(CompilationUnit node) {
+    localScope = new _LocalNameScope.forUnit(node);
+    super.visitCompilationUnit(node);
+  }
+
+  @override
+  visitConstructorName(ConstructorName node) {
+    if (node.parent is! ConstructorDeclaration) {
+      super.visitConstructorName(node);
+    }
+  }
+
+  @override
+  visitFunctionDeclaration(FunctionDeclaration node) {
+    _LocalNameScope outerScope = localScope;
+    try {
+      localScope = new _LocalNameScope.forFunction(localScope, node);
+      super.visitFunctionDeclaration(node);
+    } finally {
+      localScope = outerScope;
+    }
+  }
+
+  @override
+  visitFunctionTypeAlias(FunctionTypeAlias node) {
+    _LocalNameScope outerScope = localScope;
+    try {
+      localScope = new _LocalNameScope.forFunctionTypeAlias(localScope, node);
+      super.visitFunctionTypeAlias(node);
+    } finally {
+      localScope = outerScope;
+    }
+  }
+
+  @override
+  visitImportDirective(ImportDirective node) {
+    if (node.prefix != null) {
+      importPrefixNames.add(node.prefix.name);
+    }
+    super.visitImportDirective(node);
+  }
+
+  @override
+  visitMethodDeclaration(MethodDeclaration node) {
+    _LocalNameScope outerScope = localScope;
+    try {
+      localScope = new _LocalNameScope.forMethod(localScope, node);
+      super.visitMethodDeclaration(node);
+    } finally {
+      localScope = outerScope;
+    }
+  }
+
+  @override
+  visitSimpleIdentifier(SimpleIdentifier node) {
+    // Ignore all declarations.
+    if (node.inDeclarationContext()) {
+      return;
+    }
+    // Ignore class names references from constructors.
+    AstNode parent = node.parent;
+    if (parent is ConstructorDeclaration && parent.returnType == node) {
+      return;
+    }
+    // Prepare name.
+    String name = node.name;
+    // Ignore unqualified names shadowed by local elements.
+    if (!node.isQualified) {
+      if (localScope.contains(name)) {
+        return;
+      }
+      if (importPrefixNames.contains(name)) {
+        return;
+      }
+    }
+    // Do add the name.
+    names.add(name);
+  }
+}
diff --git a/pkg/analyzer/lib/src/dart/analysis/search.dart b/pkg/analyzer/lib/src/dart/analysis/search.dart
new file mode 100644
index 0000000..8ca2f31
--- /dev/null
+++ b/pkg/analyzer/lib/src/dart/analysis/search.dart
@@ -0,0 +1,547 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/ast/visitor.dart';
+import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer/dart/element/visitor.dart';
+import 'package:analyzer/src/dart/analysis/driver.dart';
+import 'package:analyzer/src/dart/analysis/index.dart';
+import 'package:analyzer/src/dart/ast/utilities.dart';
+import 'package:analyzer/src/dart/element/element.dart';
+import 'package:analyzer/src/dart/element/member.dart';
+import 'package:analyzer/src/summary/idl.dart';
+import 'package:collection/collection.dart';
+
+Element _getEnclosingElement(CompilationUnitElement unitElement, int offset) {
+  var finder = new _ContainingElementFinder(offset);
+  unitElement.accept(finder);
+  return finder.containingElement;
+}
+
+/**
+ * Search support for an [AnalysisDriver].
+ */
+class Search {
+  final AnalysisDriver _driver;
+
+  Search(this._driver);
+
+  /**
+   * Returns references to the [element].
+   */
+  Future<List<SearchResult>> references(Element element) async {
+    if (element == null) {
+      return const <SearchResult>[];
+    }
+
+    ElementKind kind = element.kind;
+    if (kind == ElementKind.CLASS ||
+        kind == ElementKind.COMPILATION_UNIT ||
+        kind == ElementKind.CONSTRUCTOR ||
+        kind == ElementKind.FUNCTION_TYPE_ALIAS ||
+        kind == ElementKind.SETTER) {
+      return _searchReferences(element);
+    } else if (kind == ElementKind.GETTER) {
+      return _searchReferences_Getter(element);
+    } else if (kind == ElementKind.FIELD ||
+        kind == ElementKind.TOP_LEVEL_VARIABLE) {
+      return _searchReferences_Field(element);
+    } else if (kind == ElementKind.FUNCTION || kind == ElementKind.METHOD) {
+      if (element.enclosingElement is ExecutableElement) {
+        return _searchReferences_Local(element, (n) => n is Block);
+      }
+      return _searchReferences_Function(element);
+    } else if (kind == ElementKind.LABEL ||
+        kind == ElementKind.LOCAL_VARIABLE) {
+      return _searchReferences_Local(element, (n) => n is Block);
+    } else if (kind == ElementKind.PARAMETER) {
+      return _searchReferences_Parameter(element);
+    } else if (kind == ElementKind.PREFIX) {
+      return _searchReferences_Prefix(element);
+    } else if (kind == ElementKind.TYPE_PARAMETER) {
+      return _searchReferences_Local(
+          element, (n) => n.parent is CompilationUnit);
+    }
+    // TODO(scheglov) support other kinds
+    return const <SearchResult>[];
+  }
+
+  Future<Null> _addResults(List<SearchResult> results, Element element,
+      Map<IndexRelationKind, SearchResultKind> relationToResultKind) async {
+    String path = element.source.fullName;
+
+    // If the file with the element is not known, then the element is not used.
+    if (!_driver.knownFiles.contains(path)) {
+      return;
+    }
+
+    // TODO(scheglov) optimize for private elements
+    String name = element.displayName;
+
+    // Prepare the list of files that reference the element name.
+    List<String> files = await _driver.getFilesReferencingName(name);
+    if (!files.contains(path) && _driver.addedFiles.contains(path)) {
+      files.add(path);
+    }
+
+    // Check the index of every file that references the element name.
+    for (String file in files) {
+      IndexResult result = await _driver.getIndex(file);
+      _IndexRequest request = new _IndexRequest(result.index);
+      int elementId = request.findElementId(element);
+      if (elementId != -1) {
+        CompilationUnitElement unitElement = result.unitElement;
+        List<SearchResult> fileResults =
+            request.getRelations(elementId, relationToResultKind, unitElement);
+        results.addAll(fileResults);
+      }
+    }
+  }
+
+  Future<List<SearchResult>> _searchReferences(Element element) async {
+    List<SearchResult> results = <SearchResult>[];
+    await _addResults(results, element,
+        {IndexRelationKind.IS_REFERENCED_BY: SearchResultKind.REFERENCE});
+    return results;
+  }
+
+  Future<List<SearchResult>> _searchReferences_Field(
+      PropertyInducingElement field) async {
+    List<SearchResult> results = <SearchResult>[];
+    PropertyAccessorElement getter = field.getter;
+    PropertyAccessorElement setter = field.setter;
+    if (!field.isSynthetic) {
+      await _addResults(results, field, {
+        IndexRelationKind.IS_WRITTEN_BY: SearchResultKind.WRITE,
+        IndexRelationKind.IS_REFERENCED_BY: SearchResultKind.REFERENCE
+      });
+    }
+    if (getter != null) {
+      await _addResults(results, getter, {
+        IndexRelationKind.IS_REFERENCED_BY: SearchResultKind.READ,
+        IndexRelationKind.IS_INVOKED_BY: SearchResultKind.INVOCATION
+      });
+    }
+    if (setter != null) {
+      await _addResults(results, setter,
+          {IndexRelationKind.IS_REFERENCED_BY: SearchResultKind.WRITE});
+    }
+    return results;
+  }
+
+  Future<List<SearchResult>> _searchReferences_Function(Element element) async {
+    if (element is Member) {
+      element = (element as Member).baseElement;
+    }
+    List<SearchResult> results = <SearchResult>[];
+    await _addResults(results, element, {
+      IndexRelationKind.IS_REFERENCED_BY: SearchResultKind.REFERENCE,
+      IndexRelationKind.IS_INVOKED_BY: SearchResultKind.INVOCATION
+    });
+    return results;
+  }
+
+  Future<List<SearchResult>> _searchReferences_Getter(
+      PropertyAccessorElement getter) async {
+    List<SearchResult> results = <SearchResult>[];
+    await _addResults(results, getter, {
+      IndexRelationKind.IS_REFERENCED_BY: SearchResultKind.REFERENCE,
+      IndexRelationKind.IS_INVOKED_BY: SearchResultKind.INVOCATION
+    });
+    return results;
+  }
+
+  Future<List<SearchResult>> _searchReferences_Local(
+      Element element, bool isRootNode(AstNode n)) async {
+    String path = element.source.fullName;
+    if (!_driver.addedFiles.contains(path)) {
+      return const <SearchResult>[];
+    }
+
+    // Prepare the unit.
+    AnalysisResult analysisResult = await _driver.getResult(path);
+    CompilationUnit unit = analysisResult.unit;
+    if (unit == null) {
+      return const <SearchResult>[];
+    }
+
+    // Prepare the node.
+    AstNode node = new NodeLocator(element.nameOffset).searchWithin(unit);
+    if (node == null) {
+      return const <SearchResult>[];
+    }
+
+    // Prepare the enclosing node.
+    AstNode enclosingNode = node.getAncestor(isRootNode);
+    if (enclosingNode == null) {
+      return const <SearchResult>[];
+    }
+
+    // Find the matches.
+    _LocalReferencesVisitor visitor =
+        new _LocalReferencesVisitor(element, unit.element);
+    enclosingNode.accept(visitor);
+    return visitor.results;
+  }
+
+  Future<List<SearchResult>> _searchReferences_Parameter(
+      ParameterElement parameter) async {
+    List<SearchResult> results = <SearchResult>[];
+    results.addAll(await _searchReferences(parameter));
+    results.addAll(await _searchReferences_Local(parameter, (AstNode node) {
+      AstNode parent = node.parent;
+      return parent is ClassDeclaration || parent is CompilationUnit;
+    }));
+    return results;
+  }
+
+  Future<List<SearchResult>> _searchReferences_Prefix(
+      PrefixElement element) async {
+    // Search only in drivers to which the library with the prefix was added.
+    String path = element.source.fullName;
+    if (!_driver.addedFiles.contains(path)) {
+      return const <SearchResult>[];
+    }
+
+    List<SearchResult> results = <SearchResult>[];
+    LibraryElement libraryElement = element.library;
+    for (CompilationUnitElement unitElement in libraryElement.units) {
+      String unitPath = unitElement.source.fullName;
+      AnalysisResult unitAnalysisResult = await _driver.getResult(unitPath);
+      _LocalReferencesVisitor visitor =
+          new _LocalReferencesVisitor(element, unitElement);
+      unitAnalysisResult.unit.accept(visitor);
+      results.addAll(visitor.results);
+    }
+    return results;
+  }
+}
+
+/**
+ * A single search result.
+ */
+class SearchResult {
+  /**
+   * The element that is used at this result.
+   */
+  final Element element;
+
+  /**
+   * The deep most element that contains this result.
+   */
+  final Element enclosingElement;
+
+  /**
+   * The kind of the [element] usage.
+   */
+  final SearchResultKind kind;
+
+  /**
+   * The offset relative to the beginning of the containing file.
+   */
+  final int offset;
+
+  /**
+   * The length of the usage in the containing file context.
+   */
+  final int length;
+
+  /**
+   * Is `true` if a field or a method is using with a qualifier.
+   */
+  final bool isResolved;
+
+  /**
+   * Is `true` if the result is a resolved reference to [element].
+   */
+  final bool isQualified;
+
+  SearchResult._(this.element, this.enclosingElement, this.kind, this.offset,
+      this.length, this.isResolved, this.isQualified);
+
+  @override
+  String toString() {
+    StringBuffer buffer = new StringBuffer();
+    buffer.write("SearchResult(kind=");
+    buffer.write(kind);
+    buffer.write(", enclosingElement=");
+    buffer.write(enclosingElement);
+    buffer.write(", offset=");
+    buffer.write(offset);
+    buffer.write(", length=");
+    buffer.write(length);
+    buffer.write(", isResolved=");
+    buffer.write(isResolved);
+    buffer.write(", isQualified=");
+    buffer.write(isQualified);
+    buffer.write(")");
+    return buffer.toString();
+  }
+}
+
+/**
+ * The kind of reference in a [SearchResult].
+ */
+enum SearchResultKind { READ, READ_WRITE, WRITE, INVOCATION, REFERENCE }
+
+/**
+ * A visitor that finds the deep-most [Element] that contains the [offset].
+ */
+class _ContainingElementFinder extends GeneralizingElementVisitor {
+  final int offset;
+  Element containingElement;
+
+  _ContainingElementFinder(this.offset);
+
+  visitElement(Element element) {
+    if (element is ElementImpl) {
+      if (element.codeOffset != null &&
+          element.codeOffset <= offset &&
+          offset <= element.codeOffset + element.codeLength) {
+        containingElement = element;
+        super.visitElement(element);
+      }
+    }
+  }
+}
+
+class _IndexRequest {
+  final AnalysisDriverUnitIndex index;
+
+  _IndexRequest(this.index);
+
+  /**
+   * Return the [element]'s identifier in the [index] or `-1` if the
+   * [element] is not referenced in the [index].
+   */
+  int findElementId(Element element) {
+    IndexElementInfo info = new IndexElementInfo(element);
+    element = info.element;
+    // Find the id of the element's unit.
+    int unitId = getUnitId(element);
+    if (unitId == -1) {
+      return -1;
+    }
+    // Prepare information about the element.
+    int unitMemberId = getElementUnitMemberId(element);
+    if (unitMemberId == -1) {
+      return -1;
+    }
+    int classMemberId = getElementClassMemberId(element);
+    if (classMemberId == -1) {
+      return -1;
+    }
+    int parameterId = getElementParameterId(element);
+    if (parameterId == -1) {
+      return -1;
+    }
+    // Try to find the element id using classMemberId, parameterId, and kind.
+    int elementId =
+        _findFirstOccurrence(index.elementNameUnitMemberIds, unitMemberId);
+    if (elementId == -1) {
+      return -1;
+    }
+    for (;
+        elementId < index.elementNameUnitMemberIds.length &&
+            index.elementNameUnitMemberIds[elementId] == unitMemberId;
+        elementId++) {
+      if (index.elementUnits[elementId] == unitId &&
+          index.elementNameClassMemberIds[elementId] == classMemberId &&
+          index.elementNameParameterIds[elementId] == parameterId &&
+          index.elementKinds[elementId] == info.kind) {
+        return elementId;
+      }
+    }
+    return -1;
+  }
+
+  /**
+   * Return the [element]'s class member name identifier, `null` is not a class
+   * member, or `-1` if the [element] is not referenced in the [index].
+   */
+  int getElementClassMemberId(Element element) {
+    for (; element != null; element = element.enclosingElement) {
+      if (element.enclosingElement is ClassElement) {
+        return getStringId(element.name);
+      }
+    }
+    return index.nullStringId;
+  }
+
+  /**
+   * Return the [element]'s class member name identifier, `null` is not a class
+   * member, or `-1` if the [element] is not referenced in the [index].
+   */
+  int getElementParameterId(Element element) {
+    for (; element != null; element = element.enclosingElement) {
+      if (element is ParameterElement) {
+        return getStringId(element.name);
+      }
+    }
+    return index.nullStringId;
+  }
+
+  /**
+   * Return the [element]'s top-level name identifier, `0` is the unit, or
+   * `-1` if the [element] is not referenced in the [index].
+   */
+  int getElementUnitMemberId(Element element) {
+    for (; element != null; element = element.enclosingElement) {
+      if (element.enclosingElement is CompilationUnitElement) {
+        return getStringId(element.name);
+      }
+    }
+    return index.nullStringId;
+  }
+
+  /**
+   * Return a list of results where an element with the given [elementId] has
+   * a relation with the kind from [relationToResultKind].
+   */
+  List<SearchResult> getRelations(
+      int elementId,
+      Map<IndexRelationKind, SearchResultKind> relationToResultKind,
+      CompilationUnitElement enclosingUnitElement) {
+    // Find the first usage of the element.
+    int i = _findFirstOccurrence(index.usedElements, elementId);
+    if (i == -1) {
+      return const <SearchResult>[];
+    }
+    // Create locations for every usage of the element.
+    List<SearchResult> results = <SearchResult>[];
+    for (;
+        i < index.usedElements.length && index.usedElements[i] == elementId;
+        i++) {
+      IndexRelationKind relationKind = index.usedElementKinds[i];
+      SearchResultKind resultKind = relationToResultKind[relationKind];
+      if (resultKind != null) {
+        int offset = index.usedElementOffsets[i];
+        Element enclosingElement =
+            _getEnclosingElement(enclosingUnitElement, offset);
+        results.add(new SearchResult._(
+            null,
+            enclosingElement,
+            resultKind,
+            offset,
+            index.usedElementLengths[i],
+            true,
+            index.usedElementIsQualifiedFlags[i]));
+      }
+    }
+    return results;
+  }
+
+  /**
+   * Return the identifier of [str] in the [index] or `-1` if [str] is not
+   * used in the [index].
+   */
+  int getStringId(String str) {
+    return binarySearch(index.strings, str);
+  }
+
+  /**
+   * Return the identifier of the [CompilationUnitElement] containing the
+   * [element] in the [index] or `-1` if not found.
+   */
+  int getUnitId(Element element) {
+    CompilationUnitElement unitElement = getUnitElement(element);
+    int libraryUriId = getUriId(unitElement.library.source.uri);
+    if (libraryUriId == -1) {
+      return -1;
+    }
+    int unitUriId = getUriId(unitElement.source.uri);
+    if (unitUriId == -1) {
+      return -1;
+    }
+    for (int i = 0; i < index.unitLibraryUris.length; i++) {
+      if (index.unitLibraryUris[i] == libraryUriId &&
+          index.unitUnitUris[i] == unitUriId) {
+        return i;
+      }
+    }
+    return -1;
+  }
+
+  /**
+   * Return the identifier of the [uri] in the [index] or `-1` if the [uri] is
+   * not used in the [index].
+   */
+  int getUriId(Uri uri) {
+    String str = uri.toString();
+    return getStringId(str);
+  }
+
+  /**
+   * Return the index of the first occurrence of the [value] in the [sortedList],
+   * or `-1` if the [value] is not in the list.
+   */
+  int _findFirstOccurrence(List<int> sortedList, int value) {
+    // Find an occurrence.
+    int i = binarySearch(sortedList, value);
+    if (i == -1) {
+      return -1;
+    }
+    // Find the first occurrence.
+    while (i > 0 && sortedList[i - 1] == value) {
+      i--;
+    }
+    return i;
+  }
+}
+
+/**
+ * Visitor that adds [SearchResult]s for local elements of a block, method,
+ * class or a library - labels, local functions, local variables and parameters,
+ * type parameters, import prefixes.
+ */
+class _LocalReferencesVisitor extends RecursiveAstVisitor {
+  final List<SearchResult> results = <SearchResult>[];
+
+  final Element element;
+  final CompilationUnitElement enclosingUnitElement;
+
+  _LocalReferencesVisitor(this.element, this.enclosingUnitElement);
+
+  @override
+  visitSimpleIdentifier(SimpleIdentifier node) {
+    if (node.inDeclarationContext()) {
+      return;
+    }
+    if (node.staticElement == element) {
+      AstNode parent = node.parent;
+      SearchResultKind kind = SearchResultKind.REFERENCE;
+      if (element is FunctionElement) {
+        if (parent is MethodInvocation && parent.methodName == node) {
+          kind = SearchResultKind.INVOCATION;
+        }
+      } else if (element is VariableElement) {
+        bool isGet = node.inGetterContext();
+        bool isSet = node.inSetterContext();
+        if (isGet && isSet) {
+          kind = SearchResultKind.READ_WRITE;
+        } else if (isGet) {
+          if (parent is MethodInvocation && parent.methodName == node) {
+            kind = SearchResultKind.INVOCATION;
+          } else {
+            kind = SearchResultKind.READ;
+          }
+        } else if (isSet) {
+          kind = SearchResultKind.WRITE;
+        }
+      }
+      _addResult(node, kind);
+    }
+  }
+
+  void _addResult(AstNode node, SearchResultKind kind) {
+    bool isQualified = node.parent is Label;
+    Element enclosingElement =
+        _getEnclosingElement(enclosingUnitElement, node.offset);
+    results.add(new SearchResult._(element, enclosingElement, kind, node.offset,
+        node.length, true, isQualified));
+  }
+}
diff --git a/pkg/analyzer/lib/src/dart/analysis/status.dart b/pkg/analyzer/lib/src/dart/analysis/status.dart
new file mode 100644
index 0000000..3e2d79c
--- /dev/null
+++ b/pkg/analyzer/lib/src/dart/analysis/status.dart
@@ -0,0 +1,96 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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';
+
+/**
+ * The status of analysis.
+ */
+class AnalysisStatus {
+  static const IDLE = const AnalysisStatus._(false);
+  static const ANALYZING = const AnalysisStatus._(true);
+
+  final bool _analyzing;
+
+  const AnalysisStatus._(this._analyzing);
+
+  /**
+   * Return `true` is the driver is analyzing.
+   */
+  bool get isAnalyzing => _analyzing;
+
+  /**
+   * Return `true` is the driver is idle.
+   */
+  bool get isIdle => !_analyzing;
+}
+
+/**
+ * [Monitor] can be used to wait for a signal.
+ *
+ * Signals are not queued, the client will receive exactly one signal
+ * regardless of the number of [notify] invocations. The [signal] is reset
+ * after completion and will not complete until [notify] is called next time.
+ */
+class Monitor {
+  Completer<Null> _completer = new Completer<Null>();
+
+  /**
+   * Return a [Future] that completes when [notify] is called at least once.
+   */
+  Future<Null> get signal async {
+    await _completer.future;
+    _completer = new Completer<Null>();
+  }
+
+  /**
+   * Complete the [signal] future if it is not completed yet. It is safe to
+   * call this method multiple times, but the [signal] will complete only once.
+   */
+  void notify() {
+    if (!_completer.isCompleted) {
+      _completer.complete(null);
+    }
+  }
+}
+
+/**
+ * Helper for managing transitioning [AnalysisStatus].
+ */
+class StatusSupport {
+  /**
+   * The controller for the [stream].
+   */
+  final _statusController = new StreamController<AnalysisStatus>();
+
+  /**
+   * The last status sent to the [stream].
+   */
+  AnalysisStatus _currentStatus = AnalysisStatus.IDLE;
+
+  /**
+   * Return the stream that produces [AnalysisStatus] events.
+   */
+  Stream<AnalysisStatus> get stream => _statusController.stream;
+
+  /**
+   * Send a notifications to the [stream] that the driver started analyzing.
+   */
+  void transitionToAnalyzing() {
+    if (_currentStatus != AnalysisStatus.ANALYZING) {
+      _currentStatus = AnalysisStatus.ANALYZING;
+      _statusController.add(AnalysisStatus.ANALYZING);
+    }
+  }
+
+  /**
+   * Send a notifications to the [stream] stream that the driver is idle.
+   */
+  void transitionToIdle() {
+    if (_currentStatus != AnalysisStatus.IDLE) {
+      _currentStatus = AnalysisStatus.IDLE;
+      _statusController.add(AnalysisStatus.IDLE);
+    }
+  }
+}
diff --git a/pkg/analyzer/lib/src/dart/ast/ast.dart b/pkg/analyzer/lib/src/dart/ast/ast.dart
index 4df003d..3238aed 100644
--- a/pkg/analyzer/lib/src/dart/ast/ast.dart
+++ b/pkg/analyzer/lib/src/dart/ast/ast.dart
@@ -17,7 +17,6 @@
 import 'package:analyzer/src/dart/element/element.dart';
 import 'package:analyzer/src/dart/element/type.dart';
 import 'package:analyzer/src/generated/engine.dart' show AnalysisEngine;
-import 'package:analyzer/src/generated/java_core.dart';
 import 'package:analyzer/src/generated/java_engine.dart';
 import 'package:analyzer/src/generated/parser.dart';
 import 'package:analyzer/src/generated/source.dart' show LineInfo, Source;
@@ -283,7 +282,7 @@
   Element get element {
     if (_element != null) {
       return _element;
-    } else if (_name != null) {
+    } else if (_constructorName == null && _name != null) {
       return _name.staticElement;
     }
     return null;
@@ -559,21 +558,16 @@
 }
 
 /**
- * An assert statement.
+ * An assert in the initializer list of a constructor.
  *
- *    assertStatement ::=
- *        'assert' '(' [Expression] ')' ';'
+ *    assertInitializer ::=
+ *        'assert' '(' [Expression] (',' [Expression])? ')'
  */
-class AssertStatementImpl extends StatementImpl implements AssertStatement {
-  /**
-   * The token representing the 'assert' keyword.
-   */
+class AssertInitializerImpl extends ConstructorInitializerImpl
+    implements AssertInitializer {
   @override
   Token assertKeyword;
 
-  /**
-   * The left parenthesis.
-   */
   @override
   Token leftParenthesis;
 
@@ -582,27 +576,104 @@
    */
   Expression _condition;
 
-  /**
-   * The comma, if a message expression was supplied.  Otherwise `null`.
-   */
   @override
   Token comma;
 
   /**
-   * The message to report if the assertion fails.  `null` if no message was
+   * The message to report if the assertion fails, or `null` if no message was
    * supplied.
    */
   Expression _message;
 
-  /**
-   * The right parenthesis.
-   */
   @override
   Token rightParenthesis;
 
   /**
-   * The semicolon terminating the statement.
+   * Initialize a newly created assert initializer.
    */
+  AssertInitializerImpl(
+      this.assertKeyword,
+      this.leftParenthesis,
+      ExpressionImpl condition,
+      this.comma,
+      ExpressionImpl message,
+      this.rightParenthesis) {
+    _condition = _becomeParentOf(condition);
+    _message = _becomeParentOf(message);
+  }
+
+  @override
+  Token get beginToken => assertKeyword;
+
+  @override
+  Iterable<SyntacticEntity> get childEntities => new ChildEntities()
+    ..add(assertKeyword)
+    ..add(leftParenthesis)
+    ..add(_condition)
+    ..add(comma)
+    ..add(_message)
+    ..add(rightParenthesis);
+
+  @override
+  Expression get condition => _condition;
+
+  @override
+  void set condition(Expression condition) {
+    _condition = _becomeParentOf(condition as AstNodeImpl);
+  }
+
+  @override
+  Token get endToken => rightParenthesis;
+
+  @override
+  Expression get message => _message;
+
+  @override
+  void set message(Expression expression) {
+    _message = _becomeParentOf(expression as AstNodeImpl);
+  }
+
+  @override
+  dynamic/*=E*/ accept/*<E>*/(AstVisitor/*<E>*/ visitor) =>
+      visitor.visitAssertInitializer(this);
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    _condition?.accept(visitor);
+    message?.accept(visitor);
+  }
+}
+
+/**
+ * An assert statement.
+ *
+ *    assertStatement ::=
+ *        'assert' '(' [Expression] ')' ';'
+ */
+class AssertStatementImpl extends StatementImpl implements AssertStatement {
+  @override
+  Token assertKeyword;
+
+  @override
+  Token leftParenthesis;
+
+  /**
+   * The condition that is being asserted to be `true`.
+   */
+  Expression _condition;
+
+  @override
+  Token comma;
+
+  /**
+   * The message to report if the assertion fails, or `null` if no message was
+   * supplied.
+   */
+  Expression _message;
+
+  @override
+  Token rightParenthesis;
+
   @override
   Token semicolon;
 
@@ -941,9 +1012,9 @@
 
   @override
   String toSource() {
-    PrintStringWriter writer = new PrintStringWriter();
-    accept(new ToSourceVisitor(writer));
-    return writer.toString();
+    StringBuffer buffer = new StringBuffer();
+    accept(new ToSourceVisitor2(buffer));
+    return buffer.toString();
   }
 
   @override
@@ -8103,7 +8174,13 @@
   Token ofKeyword;
 
   /**
-   * The name of the library that the containing compilation unit is part of.
+   * The URI of the library that the containing compilation unit is part of.
+   */
+  StringLiteralImpl _uri;
+
+  /**
+   * The name of the library that the containing compilation unit is part of, or
+   * `null` if no name was given (typically because a library URI was provided).
    */
   LibraryIdentifier _libraryName;
 
@@ -8123,9 +8200,11 @@
       List<Annotation> metadata,
       this.partKeyword,
       this.ofKeyword,
+      StringLiteralImpl uri,
       LibraryIdentifierImpl libraryName,
       this.semicolon)
       : super(comment, metadata) {
+    _uri = _becomeParentOf(uri);
     _libraryName = _becomeParentOf(libraryName);
   }
 
@@ -8154,6 +8233,14 @@
   }
 
   @override
+  StringLiteral get uri => _uri;
+
+  @override
+  void set uri(StringLiteral uri) {
+    _uri = _becomeParentOf(uri as AstNodeImpl);
+  }
+
+  @override
   dynamic/*=E*/ accept/*<E>*/(AstVisitor/*<E>*/ visitor) =>
       visitor.visitPartOfDirective(this);
 
@@ -8161,6 +8248,7 @@
   void visitChildren(AstVisitor visitor) {
     super.visitChildren(visitor);
     _libraryName?.accept(visitor);
+    _uri?.accept(visitor);
   }
 }
 
@@ -10597,7 +10685,6 @@
     _uri = _becomeParentOf(uri as AstNodeImpl);
   }
 
-  @override
   UriValidationCode validate() {
     return validateUri(this is ImportDirective, uri, uriContent);
   }
@@ -10639,15 +10726,15 @@
 /**
  * Validation codes returned by [UriBasedDirective.validate].
  */
-class UriValidationCodeImpl implements UriValidationCode {
+class UriValidationCode {
   static const UriValidationCode INVALID_URI =
-      const UriValidationCodeImpl('INVALID_URI');
+      const UriValidationCode('INVALID_URI');
 
   static const UriValidationCode URI_WITH_INTERPOLATION =
-      const UriValidationCodeImpl('URI_WITH_INTERPOLATION');
+      const UriValidationCode('URI_WITH_INTERPOLATION');
 
   static const UriValidationCode URI_WITH_DART_EXT_SCHEME =
-      const UriValidationCodeImpl('URI_WITH_DART_EXT_SCHEME');
+      const UriValidationCode('URI_WITH_DART_EXT_SCHEME');
 
   /**
    * The name of the validation code.
@@ -10657,7 +10744,7 @@
   /**
    * Initialize a newly created validation code to have the given [name].
    */
-  const UriValidationCodeImpl(this.name);
+  const UriValidationCode(this.name);
 
   @override
   String toString() => name;
diff --git a/pkg/analyzer/lib/src/dart/ast/ast_factory.dart b/pkg/analyzer/lib/src/dart/ast/ast_factory.dart
new file mode 100644
index 0000000..72079b6
--- /dev/null
+++ b/pkg/analyzer/lib/src/dart/ast/ast_factory.dart
@@ -0,0 +1,897 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/ast/ast_factory.dart';
+import 'package:analyzer/src/dart/ast/ast.dart';
+import 'package:analyzer/src/generated/utilities_dart.dart';
+import 'package:front_end/src/scanner/token.dart';
+
+/**
+ * Concrete implementation of [AstFactory] based on the standard AST
+ * implementation.
+ */
+class AstFactoryImpl extends AstFactory {
+  @override
+  AdjacentStrings adjacentStrings(List<StringLiteral> strings) =>
+      new AdjacentStringsImpl(strings);
+
+  @override
+  Annotation annotation(Token atSign, Identifier name, Token period,
+          SimpleIdentifier constructorName, ArgumentList arguments) =>
+      new AnnotationImpl(atSign, name, period, constructorName, arguments);
+
+  @override
+  ArgumentList argumentList(Token leftParenthesis, List<Expression> arguments,
+          Token rightParenthesis) =>
+      new ArgumentListImpl(leftParenthesis, arguments, rightParenthesis);
+
+  @override
+  AsExpression asExpression(
+          Expression expression, Token asOperator, TypeName type) =>
+      new AsExpressionImpl(expression, asOperator, type);
+
+  @override
+  AssertInitializer assertInitializer(
+          Token assertKeyword,
+          Token leftParenthesis,
+          Expression condition,
+          Token comma,
+          Expression message,
+          Token rightParenthesis) =>
+      new AssertInitializerImpl(assertKeyword, leftParenthesis, condition,
+          comma, message, rightParenthesis);
+
+  @override
+  AssertStatement assertStatement(
+          Token assertKeyword,
+          Token leftParenthesis,
+          Expression condition,
+          Token comma,
+          Expression message,
+          Token rightParenthesis,
+          Token semicolon) =>
+      new AssertStatementImpl(assertKeyword, leftParenthesis, condition, comma,
+          message, rightParenthesis, semicolon);
+
+  @override
+  AssignmentExpression assignmentExpression(
+          Expression leftHandSide, Token operator, Expression rightHandSide) =>
+      new AssignmentExpressionImpl(leftHandSide, operator, rightHandSide);
+
+  @override
+  AwaitExpression awaitExpression(Token awaitKeyword, Expression expression) =>
+      new AwaitExpressionImpl(awaitKeyword, expression);
+
+  @override
+  BinaryExpression binaryExpression(
+          Expression leftOperand, Token operator, Expression rightOperand) =>
+      new BinaryExpressionImpl(leftOperand, operator, rightOperand);
+  @override
+  Block block(
+          Token leftBracket, List<Statement> statements, Token rightBracket) =>
+      new BlockImpl(leftBracket, statements, rightBracket);
+
+  @override
+  Comment blockComment(List<Token> tokens) =>
+      CommentImpl.createBlockComment(tokens);
+
+  @override
+  BlockFunctionBody blockFunctionBody(Token keyword, Token star, Block block) =>
+      new BlockFunctionBodyImpl(keyword, star, block);
+
+  @override
+  BooleanLiteral booleanLiteral(Token literal, bool value) =>
+      new BooleanLiteralImpl(literal, value);
+
+  @override
+  BreakStatement breakStatement(
+          Token breakKeyword, SimpleIdentifier label, Token semicolon) =>
+      new BreakStatementImpl(breakKeyword, label, semicolon);
+
+  @override
+  CascadeExpression cascadeExpression(
+          Expression target, List<Expression> cascadeSections) =>
+      new CascadeExpressionImpl(target, cascadeSections);
+
+  @override
+  CatchClause catchClause(
+          Token onKeyword,
+          TypeName exceptionType,
+          Token catchKeyword,
+          Token leftParenthesis,
+          SimpleIdentifier exceptionParameter,
+          Token comma,
+          SimpleIdentifier stackTraceParameter,
+          Token rightParenthesis,
+          Block body) =>
+      new CatchClauseImpl(
+          onKeyword,
+          exceptionType,
+          catchKeyword,
+          leftParenthesis,
+          exceptionParameter,
+          comma,
+          stackTraceParameter,
+          rightParenthesis,
+          body);
+
+  @override
+  ClassDeclaration classDeclaration(
+          Comment comment,
+          List<Annotation> metadata,
+          Token abstractKeyword,
+          Token classKeyword,
+          SimpleIdentifier name,
+          TypeParameterList typeParameters,
+          ExtendsClause extendsClause,
+          WithClause withClause,
+          ImplementsClause implementsClause,
+          Token leftBracket,
+          List<ClassMember> members,
+          Token rightBracket) =>
+      new ClassDeclarationImpl(
+          comment,
+          metadata,
+          abstractKeyword,
+          classKeyword,
+          name,
+          typeParameters,
+          extendsClause,
+          withClause,
+          implementsClause,
+          leftBracket,
+          members,
+          rightBracket);
+
+  @override
+  ClassTypeAlias classTypeAlias(
+          Comment comment,
+          List<Annotation> metadata,
+          Token keyword,
+          SimpleIdentifier name,
+          TypeParameterList typeParameters,
+          Token equals,
+          Token abstractKeyword,
+          TypeName superclass,
+          WithClause withClause,
+          ImplementsClause implementsClause,
+          Token semicolon) =>
+      new ClassTypeAliasImpl(
+          comment,
+          metadata,
+          keyword,
+          name,
+          typeParameters,
+          equals,
+          abstractKeyword,
+          superclass,
+          withClause,
+          implementsClause,
+          semicolon);
+
+  @override
+  CommentReference commentReference(Token newKeyword, Identifier identifier) =>
+      new CommentReferenceImpl(newKeyword, identifier);
+
+  @override
+  CompilationUnit compilationUnit(
+          Token beginToken,
+          ScriptTag scriptTag,
+          List<Directive> directives,
+          List<CompilationUnitMember> declarations,
+          Token endToken) =>
+      new CompilationUnitImpl(
+          beginToken, scriptTag, directives, declarations, endToken);
+
+  @override
+  ConditionalExpression conditionalExpression(
+          Expression condition,
+          Token question,
+          Expression thenExpression,
+          Token colon,
+          Expression elseExpression) =>
+      new ConditionalExpressionImpl(
+          condition, question, thenExpression, colon, elseExpression);
+
+  @override
+  Configuration configuration(
+          Token ifKeyword,
+          Token leftParenthesis,
+          DottedName name,
+          Token equalToken,
+          StringLiteral value,
+          Token rightParenthesis,
+          StringLiteral libraryUri) =>
+      new ConfigurationImpl(ifKeyword, leftParenthesis, name, equalToken, value,
+          rightParenthesis, libraryUri);
+
+  @override
+  ConstructorDeclaration constructorDeclaration(
+          Comment comment,
+          List<Annotation> metadata,
+          Token externalKeyword,
+          Token constKeyword,
+          Token factoryKeyword,
+          Identifier returnType,
+          Token period,
+          SimpleIdentifier name,
+          FormalParameterList parameters,
+          Token separator,
+          List<ConstructorInitializer> initializers,
+          ConstructorName redirectedConstructor,
+          FunctionBody body) =>
+      new ConstructorDeclarationImpl(
+          comment,
+          metadata,
+          externalKeyword,
+          constKeyword,
+          factoryKeyword,
+          returnType,
+          period,
+          name,
+          parameters,
+          separator,
+          initializers,
+          redirectedConstructor,
+          body);
+
+  @override
+  ConstructorFieldInitializer constructorFieldInitializer(
+          Token thisKeyword,
+          Token period,
+          SimpleIdentifier fieldName,
+          Token equals,
+          Expression expression) =>
+      new ConstructorFieldInitializerImpl(
+          thisKeyword, period, fieldName, equals, expression);
+
+  @override
+  ConstructorName constructorName(
+          TypeName type, Token period, SimpleIdentifier name) =>
+      new ConstructorNameImpl(type, period, name);
+
+  @override
+  ContinueStatement continueStatement(
+          Token continueKeyword, SimpleIdentifier label, Token semicolon) =>
+      new ContinueStatementImpl(continueKeyword, label, semicolon);
+
+  @override
+  DeclaredIdentifier declaredIdentifier(
+          Comment comment,
+          List<Annotation> metadata,
+          Token keyword,
+          TypeName type,
+          SimpleIdentifier identifier) =>
+      new DeclaredIdentifierImpl(comment, metadata, keyword, type, identifier);
+
+  @override
+  DefaultFormalParameter defaultFormalParameter(NormalFormalParameter parameter,
+          ParameterKind kind, Token separator, Expression defaultValue) =>
+      new DefaultFormalParameterImpl(parameter, kind, separator, defaultValue);
+
+  @override
+  Comment documentationComment(List<Token> tokens,
+          [List<CommentReference> references]) =>
+      CommentImpl.createDocumentationCommentWithReferences(
+          tokens, references ?? <CommentReference>[]);
+
+  @override
+  DoStatement doStatement(
+          Token doKeyword,
+          Statement body,
+          Token whileKeyword,
+          Token leftParenthesis,
+          Expression condition,
+          Token rightParenthesis,
+          Token semicolon) =>
+      new DoStatementImpl(doKeyword, body, whileKeyword, leftParenthesis,
+          condition, rightParenthesis, semicolon);
+
+  @override
+  DottedName dottedName(List<SimpleIdentifier> components) =>
+      new DottedNameImpl(components);
+
+  @override
+  DoubleLiteral doubleLiteral(Token literal, double value) =>
+      new DoubleLiteralImpl(literal, value);
+
+  @override
+  EmptyFunctionBody emptyFunctionBody(Token semicolon) =>
+      new EmptyFunctionBodyImpl(semicolon);
+
+  @override
+  EmptyStatement emptyStatement(Token semicolon) =>
+      new EmptyStatementImpl(semicolon);
+
+  @override
+  Comment endOfLineComment(List<Token> tokens) =>
+      CommentImpl.createEndOfLineComment(tokens);
+
+  @override
+  EnumConstantDeclaration enumConstantDeclaration(
+          Comment comment, List<Annotation> metadata, SimpleIdentifier name) =>
+      new EnumConstantDeclarationImpl(comment, metadata, name);
+
+  @override
+  EnumDeclaration enumDeclaration(
+          Comment comment,
+          List<Annotation> metadata,
+          Token enumKeyword,
+          SimpleIdentifier name,
+          Token leftBracket,
+          List<EnumConstantDeclaration> constants,
+          Token rightBracket) =>
+      new EnumDeclarationImpl(comment, metadata, enumKeyword, name, leftBracket,
+          constants, rightBracket);
+
+  @override
+  ExportDirective exportDirective(
+          Comment comment,
+          List<Annotation> metadata,
+          Token keyword,
+          StringLiteral libraryUri,
+          List<Configuration> configurations,
+          List<Combinator> combinators,
+          Token semicolon) =>
+      new ExportDirectiveImpl(comment, metadata, keyword, libraryUri,
+          configurations, combinators, semicolon);
+  @override
+  ExpressionFunctionBody expressionFunctionBody(Token keyword,
+          Token functionDefinition, Expression expression, Token semicolon) =>
+      new ExpressionFunctionBodyImpl(
+          keyword, functionDefinition, expression, semicolon);
+
+  @override
+  ExpressionStatement expressionStatement(
+          Expression expression, Token semicolon) =>
+      new ExpressionStatementImpl(expression, semicolon);
+
+  @override
+  ExtendsClause extendsClause(Token extendsKeyword, TypeName superclass) =>
+      new ExtendsClauseImpl(extendsKeyword, superclass);
+
+  @override
+  FieldDeclaration fieldDeclaration(
+          Comment comment,
+          List<Annotation> metadata,
+          Token staticKeyword,
+          VariableDeclarationList fieldList,
+          Token semicolon) =>
+      new FieldDeclarationImpl(
+          comment, metadata, staticKeyword, fieldList, semicolon);
+
+  @override
+  FieldFormalParameter fieldFormalParameter(
+          Comment comment,
+          List<Annotation> metadata,
+          Token keyword,
+          TypeName type,
+          Token thisKeyword,
+          Token period,
+          SimpleIdentifier identifier,
+          TypeParameterList typeParameters,
+          FormalParameterList parameters) =>
+      new FieldFormalParameterImpl(comment, metadata, keyword, type,
+          thisKeyword, period, identifier, typeParameters, parameters);
+
+  @override
+  ForEachStatement forEachStatementWithDeclaration(
+          Token awaitKeyword,
+          Token forKeyword,
+          Token leftParenthesis,
+          DeclaredIdentifier loopVariable,
+          Token inKeyword,
+          Expression iterator,
+          Token rightParenthesis,
+          Statement body) =>
+      new ForEachStatementImpl.withDeclaration(
+          awaitKeyword,
+          forKeyword,
+          leftParenthesis,
+          loopVariable,
+          inKeyword,
+          iterator,
+          rightParenthesis,
+          body);
+
+  @override
+  ForEachStatement forEachStatementWithReference(
+          Token awaitKeyword,
+          Token forKeyword,
+          Token leftParenthesis,
+          SimpleIdentifier identifier,
+          Token inKeyword,
+          Expression iterator,
+          Token rightParenthesis,
+          Statement body) =>
+      new ForEachStatementImpl.withReference(
+          awaitKeyword,
+          forKeyword,
+          leftParenthesis,
+          identifier,
+          inKeyword,
+          iterator,
+          rightParenthesis,
+          body);
+
+  @override
+  FormalParameterList formalParameterList(
+          Token leftParenthesis,
+          List<FormalParameter> parameters,
+          Token leftDelimiter,
+          Token rightDelimiter,
+          Token rightParenthesis) =>
+      new FormalParameterListImpl(leftParenthesis, parameters, leftDelimiter,
+          rightDelimiter, rightParenthesis);
+
+  @override
+  ForStatement forStatement(
+          Token forKeyword,
+          Token leftParenthesis,
+          VariableDeclarationList variableList,
+          Expression initialization,
+          Token leftSeparator,
+          Expression condition,
+          Token rightSeparator,
+          List<Expression> updaters,
+          Token rightParenthesis,
+          Statement body) =>
+      new ForStatementImpl(
+          forKeyword,
+          leftParenthesis,
+          variableList,
+          initialization,
+          leftSeparator,
+          condition,
+          rightSeparator,
+          updaters,
+          rightParenthesis,
+          body);
+
+  @override
+  FunctionDeclaration functionDeclaration(
+          Comment comment,
+          List<Annotation> metadata,
+          Token externalKeyword,
+          TypeName returnType,
+          Token propertyKeyword,
+          SimpleIdentifier name,
+          FunctionExpression functionExpression) =>
+      new FunctionDeclarationImpl(comment, metadata, externalKeyword,
+          returnType, propertyKeyword, name, functionExpression);
+
+  @override
+  FunctionDeclarationStatement functionDeclarationStatement(
+          FunctionDeclaration functionDeclaration) =>
+      new FunctionDeclarationStatementImpl(functionDeclaration);
+
+  @override
+  FunctionExpression functionExpression(TypeParameterList typeParameters,
+          FormalParameterList parameters, FunctionBody body) =>
+      new FunctionExpressionImpl(typeParameters, parameters, body);
+
+  @override
+  FunctionExpressionInvocation functionExpressionInvocation(Expression function,
+          TypeArgumentList typeArguments, ArgumentList argumentList) =>
+      new FunctionExpressionInvocationImpl(
+          function, typeArguments, argumentList);
+
+  @override
+  FunctionTypeAlias functionTypeAlias(
+          Comment comment,
+          List<Annotation> metadata,
+          Token keyword,
+          TypeName returnType,
+          SimpleIdentifier name,
+          TypeParameterList typeParameters,
+          FormalParameterList parameters,
+          Token semicolon) =>
+      new FunctionTypeAliasImpl(comment, metadata, keyword, returnType, name,
+          typeParameters, parameters, semicolon);
+
+  @override
+  FunctionTypedFormalParameter functionTypedFormalParameter(
+          Comment comment,
+          List<Annotation> metadata,
+          TypeName returnType,
+          SimpleIdentifier identifier,
+          TypeParameterList typeParameters,
+          FormalParameterList parameters,
+          {Token question: null}) =>
+      new FunctionTypedFormalParameterImpl(comment, metadata, returnType,
+          identifier, typeParameters, parameters, question);
+
+  @override
+  HideCombinator hideCombinator(
+          Token keyword, List<SimpleIdentifier> hiddenNames) =>
+      new HideCombinatorImpl(keyword, hiddenNames);
+
+  @override
+  IfStatement ifStatement(
+          Token ifKeyword,
+          Token leftParenthesis,
+          Expression condition,
+          Token rightParenthesis,
+          Statement thenStatement,
+          Token elseKeyword,
+          Statement elseStatement) =>
+      new IfStatementImpl(ifKeyword, leftParenthesis, condition,
+          rightParenthesis, thenStatement, elseKeyword, elseStatement);
+
+  @override
+  ImplementsClause implementsClause(
+          Token implementsKeyword, List<TypeName> interfaces) =>
+      new ImplementsClauseImpl(implementsKeyword, interfaces);
+
+  @override
+  ImportDirective importDirective(
+          Comment comment,
+          List<Annotation> metadata,
+          Token keyword,
+          StringLiteral libraryUri,
+          List<Configuration> configurations,
+          Token deferredKeyword,
+          Token asKeyword,
+          SimpleIdentifier prefix,
+          List<Combinator> combinators,
+          Token semicolon) =>
+      new ImportDirectiveImpl(
+          comment,
+          metadata,
+          keyword,
+          libraryUri,
+          configurations,
+          deferredKeyword,
+          asKeyword,
+          prefix,
+          combinators,
+          semicolon);
+
+  @override
+  IndexExpression indexExpressionForCascade(Token period, Token leftBracket,
+          Expression index, Token rightBracket) =>
+      new IndexExpressionImpl.forCascade(
+          period, leftBracket, index, rightBracket);
+
+  @override
+  IndexExpression indexExpressionForTarget(Expression target, Token leftBracket,
+          Expression index, Token rightBracket) =>
+      new IndexExpressionImpl.forTarget(
+          target, leftBracket, index, rightBracket);
+
+  @override
+  InstanceCreationExpression instanceCreationExpression(Token keyword,
+          ConstructorName constructorName, ArgumentList argumentList) =>
+      new InstanceCreationExpressionImpl(
+          keyword, constructorName, argumentList);
+
+  @override
+  IntegerLiteral integerLiteral(Token literal, int value) =>
+      new IntegerLiteralImpl(literal, value);
+
+  @override
+  InterpolationExpression interpolationExpression(
+          Token leftBracket, Expression expression, Token rightBracket) =>
+      new InterpolationExpressionImpl(leftBracket, expression, rightBracket);
+
+  @override
+  InterpolationString interpolationString(Token contents, String value) =>
+      new InterpolationStringImpl(contents, value);
+
+  @override
+  IsExpression isExpression(Expression expression, Token isOperator,
+          Token notOperator, TypeName type) =>
+      new IsExpressionImpl(expression, isOperator, notOperator, type);
+
+  @override
+  Label label(SimpleIdentifier label, Token colon) =>
+      new LabelImpl(label, colon);
+
+  @override
+  LabeledStatement labeledStatement(List<Label> labels, Statement statement) =>
+      new LabeledStatementImpl(labels, statement);
+
+  @override
+  LibraryDirective libraryDirective(Comment comment, List<Annotation> metadata,
+          Token libraryKeyword, LibraryIdentifier name, Token semicolon) =>
+      new LibraryDirectiveImpl(
+          comment, metadata, libraryKeyword, name, semicolon);
+
+  @override
+  LibraryIdentifier libraryIdentifier(List<SimpleIdentifier> components) =>
+      new LibraryIdentifierImpl(components);
+
+  @override
+  ListLiteral listLiteral(Token constKeyword, TypeArgumentList typeArguments,
+          Token leftBracket, List<Expression> elements, Token rightBracket) =>
+      new ListLiteralImpl(
+          constKeyword, typeArguments, leftBracket, elements, rightBracket);
+
+  @override
+  MapLiteral mapLiteral(
+          Token constKeyword,
+          TypeArgumentList typeArguments,
+          Token leftBracket,
+          List<MapLiteralEntry> entries,
+          Token rightBracket) =>
+      new MapLiteralImpl(
+          constKeyword, typeArguments, leftBracket, entries, rightBracket);
+
+  @override
+  MapLiteralEntry mapLiteralEntry(
+          Expression key, Token separator, Expression value) =>
+      new MapLiteralEntryImpl(key, separator, value);
+
+  @override
+  MethodDeclaration methodDeclaration(
+          Comment comment,
+          List<Annotation> metadata,
+          Token externalKeyword,
+          Token modifierKeyword,
+          TypeName returnType,
+          Token propertyKeyword,
+          Token operatorKeyword,
+          SimpleIdentifier name,
+          TypeParameterList typeParameters,
+          FormalParameterList parameters,
+          FunctionBody body) =>
+      new MethodDeclarationImpl(
+          comment,
+          metadata,
+          externalKeyword,
+          modifierKeyword,
+          returnType,
+          propertyKeyword,
+          operatorKeyword,
+          name,
+          typeParameters,
+          parameters,
+          body);
+
+  @override
+  MethodInvocation methodInvocation(
+          Expression target,
+          Token operator,
+          SimpleIdentifier methodName,
+          TypeArgumentList typeArguments,
+          ArgumentList argumentList) =>
+      new MethodInvocationImpl(
+          target, operator, methodName, typeArguments, argumentList);
+
+  @override
+  NamedExpression namedExpression(Label name, Expression expression) =>
+      new NamedExpressionImpl(name, expression);
+
+  @override
+  NativeClause nativeClause(Token nativeKeyword, StringLiteral name) =>
+      new NativeClauseImpl(nativeKeyword, name);
+
+  @override
+  NativeFunctionBody nativeFunctionBody(
+          Token nativeKeyword, StringLiteral stringLiteral, Token semicolon) =>
+      new NativeFunctionBodyImpl(nativeKeyword, stringLiteral, semicolon);
+
+  @override
+  NodeList/*<E>*/ nodeList/*<E extends AstNode>*/(AstNode owner,
+          [List/*<E>*/ elements]) =>
+      new NodeListImpl/*<E>*/(owner as AstNodeImpl, elements);
+
+  @override
+  NullLiteral nullLiteral(Token literal) => new NullLiteralImpl(literal);
+
+  @override
+  ParenthesizedExpression parenthesizedExpression(Token leftParenthesis,
+          Expression expression, Token rightParenthesis) =>
+      new ParenthesizedExpressionImpl(
+          leftParenthesis, expression, rightParenthesis);
+
+  @override
+  PartDirective partDirective(Comment comment, List<Annotation> metadata,
+          Token partKeyword, StringLiteral partUri, Token semicolon) =>
+      new PartDirectiveImpl(comment, metadata, partKeyword, partUri, semicolon);
+
+  @override
+  PartOfDirective partOfDirective(
+          Comment comment,
+          List<Annotation> metadata,
+          Token partKeyword,
+          Token ofKeyword,
+          StringLiteral uri,
+          LibraryIdentifier libraryName,
+          Token semicolon) =>
+      new PartOfDirectiveImpl(comment, metadata, partKeyword, ofKeyword, uri,
+          libraryName, semicolon);
+
+  @override
+  PostfixExpression postfixExpression(Expression operand, Token operator) =>
+      new PostfixExpressionImpl(operand, operator);
+
+  @override
+  PrefixedIdentifier prefixedIdentifier(
+          SimpleIdentifier prefix, Token period, SimpleIdentifier identifier) =>
+      new PrefixedIdentifierImpl(prefix, period, identifier);
+
+  @override
+  PrefixExpression prefixExpression(Token operator, Expression operand) =>
+      new PrefixExpressionImpl(operator, operand);
+
+  @override
+  PropertyAccess propertyAccess(
+          Expression target, Token operator, SimpleIdentifier propertyName) =>
+      new PropertyAccessImpl(target, operator, propertyName);
+
+  @override
+  RedirectingConstructorInvocation redirectingConstructorInvocation(
+          Token thisKeyword,
+          Token period,
+          SimpleIdentifier constructorName,
+          ArgumentList argumentList) =>
+      new RedirectingConstructorInvocationImpl(
+          thisKeyword, period, constructorName, argumentList);
+
+  @override
+  RethrowExpression rethrowExpression(Token rethrowKeyword) =>
+      new RethrowExpressionImpl(rethrowKeyword);
+
+  @override
+  ReturnStatement returnStatement(
+          Token returnKeyword, Expression expression, Token semicolon) =>
+      new ReturnStatementImpl(returnKeyword, expression, semicolon);
+
+  @override
+  ScriptTag scriptTag(Token scriptTag) => new ScriptTagImpl(scriptTag);
+
+  @override
+  ShowCombinator showCombinator(
+          Token keyword, List<SimpleIdentifier> shownNames) =>
+      new ShowCombinatorImpl(keyword, shownNames);
+
+  @override
+  SimpleFormalParameter simpleFormalParameter(
+          Comment comment,
+          List<Annotation> metadata,
+          Token keyword,
+          TypeName type,
+          SimpleIdentifier identifier) =>
+      new SimpleFormalParameterImpl(
+          comment, metadata, keyword, type, identifier);
+
+  @override
+  SimpleIdentifier simpleIdentifier(Token token, {bool isDeclaration: false}) {
+    if (isDeclaration) {
+      return new DeclaredSimpleIdentifier(token);
+    }
+    return new SimpleIdentifierImpl(token);
+  }
+
+  @override
+  SimpleStringLiteral simpleStringLiteral(Token literal, String value) =>
+      new SimpleStringLiteralImpl(literal, value);
+
+  @override
+  StringInterpolation stringInterpolation(
+          List<InterpolationElement> elements) =>
+      new StringInterpolationImpl(elements);
+
+  @override
+  SuperConstructorInvocation superConstructorInvocation(
+          Token superKeyword,
+          Token period,
+          SimpleIdentifier constructorName,
+          ArgumentList argumentList) =>
+      new SuperConstructorInvocationImpl(
+          superKeyword, period, constructorName, argumentList);
+
+  @override
+  SuperExpression superExpression(Token superKeyword) =>
+      new SuperExpressionImpl(superKeyword);
+
+  @override
+  SwitchCase switchCase(List<Label> labels, Token keyword,
+          Expression expression, Token colon, List<Statement> statements) =>
+      new SwitchCaseImpl(labels, keyword, expression, colon, statements);
+
+  @override
+  SwitchDefault switchDefault(List<Label> labels, Token keyword, Token colon,
+          List<Statement> statements) =>
+      new SwitchDefaultImpl(labels, keyword, colon, statements);
+  @override
+  SwitchStatement switchStatement(
+          Token switchKeyword,
+          Token leftParenthesis,
+          Expression expression,
+          Token rightParenthesis,
+          Token leftBracket,
+          List<SwitchMember> members,
+          Token rightBracket) =>
+      new SwitchStatementImpl(switchKeyword, leftParenthesis, expression,
+          rightParenthesis, leftBracket, members, rightBracket);
+
+  @override
+  SymbolLiteral symbolLiteral(Token poundSign, List<Token> components) =>
+      new SymbolLiteralImpl(poundSign, components);
+
+  @override
+  ThisExpression thisExpression(Token thisKeyword) =>
+      new ThisExpressionImpl(thisKeyword);
+
+  @override
+  ThrowExpression throwExpression(Token throwKeyword, Expression expression) =>
+      new ThrowExpressionImpl(throwKeyword, expression);
+
+  @override
+  TopLevelVariableDeclaration topLevelVariableDeclaration(
+          Comment comment,
+          List<Annotation> metadata,
+          VariableDeclarationList variableList,
+          Token semicolon) =>
+      new TopLevelVariableDeclarationImpl(
+          comment, metadata, variableList, semicolon);
+
+  @override
+  TryStatement tryStatement(
+          Token tryKeyword,
+          Block body,
+          List<CatchClause> catchClauses,
+          Token finallyKeyword,
+          Block finallyBlock) =>
+      new TryStatementImpl(
+          tryKeyword, body, catchClauses, finallyKeyword, finallyBlock);
+
+  @override
+  TypeArgumentList typeArgumentList(
+          Token leftBracket, List<TypeName> arguments, Token rightBracket) =>
+      new TypeArgumentListImpl(leftBracket, arguments, rightBracket);
+
+  @override
+  TypeName typeName(Identifier name, TypeArgumentList typeArguments,
+          {Token question: null}) =>
+      new TypeNameImpl(name, typeArguments, question);
+
+  @override
+  TypeParameter typeParameter(Comment comment, List<Annotation> metadata,
+          SimpleIdentifier name, Token extendsKeyword, TypeName bound) =>
+      new TypeParameterImpl(comment, metadata, name, extendsKeyword, bound);
+
+  @override
+  TypeParameterList typeParameterList(Token leftBracket,
+          List<TypeParameter> typeParameters, Token rightBracket) =>
+      new TypeParameterListImpl(leftBracket, typeParameters, rightBracket);
+
+  @override
+  VariableDeclaration variableDeclaration(
+          SimpleIdentifier name, Token equals, Expression initializer) =>
+      new VariableDeclarationImpl(name, equals, initializer);
+
+  @override
+  VariableDeclarationList variableDeclarationList(
+          Comment comment,
+          List<Annotation> metadata,
+          Token keyword,
+          TypeName type,
+          List<VariableDeclaration> variables) =>
+      new VariableDeclarationListImpl(
+          comment, metadata, keyword, type, variables);
+
+  @override
+  VariableDeclarationStatement variableDeclarationStatement(
+          VariableDeclarationList variableList, Token semicolon) =>
+      new VariableDeclarationStatementImpl(variableList, semicolon);
+
+  @override
+  WhileStatement whileStatement(Token whileKeyword, Token leftParenthesis,
+          Expression condition, Token rightParenthesis, Statement body) =>
+      new WhileStatementImpl(
+          whileKeyword, leftParenthesis, condition, rightParenthesis, body);
+
+  @override
+  WithClause withClause(Token withKeyword, List<TypeName> mixinTypes) =>
+      new WithClauseImpl(withKeyword, mixinTypes);
+
+  @override
+  YieldStatement yieldStatement(Token yieldKeyword, Token star,
+          Expression expression, Token semicolon) =>
+      new YieldStatementImpl(yieldKeyword, star, expression, semicolon);
+}
diff --git a/pkg/analyzer/lib/src/dart/ast/token.dart b/pkg/analyzer/lib/src/dart/ast/token.dart
index baae1b8..ee5df9f 100644
--- a/pkg/analyzer/lib/src/dart/ast/token.dart
+++ b/pkg/analyzer/lib/src/dart/ast/token.dart
@@ -4,400 +4,21 @@
 
 library analyzer.src.dart.ast.token;
 
-import 'package:analyzer/dart/ast/token.dart';
-import 'package:analyzer/src/generated/java_engine.dart';
+import 'package:front_end/src/scanner/token.dart';
 
-/**
- * The opening half of a grouping pair of tokens. This is used for curly
- * brackets ('{'), parentheses ('('), and square brackets ('[').
- */
-class BeginToken extends SimpleToken {
-  /**
-   * The token that corresponds to this token.
-   */
-  Token endToken;
-
-  /**
-   * Initialize a newly created token to have the given [type] at the given
-   * [offset].
-   */
-  BeginToken(TokenType type, int offset) : super(type, offset) {
-    assert(type == TokenType.OPEN_CURLY_BRACKET ||
-        type == TokenType.OPEN_PAREN ||
-        type == TokenType.OPEN_SQUARE_BRACKET ||
-        type == TokenType.STRING_INTERPOLATION_EXPRESSION);
-  }
-
-  @override
-  Token copy() => new BeginToken(type, offset);
-}
-
-/**
- * A begin token that is preceded by comments.
- */
-class BeginTokenWithComment extends BeginToken implements TokenWithComment {
-  /**
-   * The first comment in the list of comments that precede this token.
-   */
-  @override
-  CommentToken _precedingComment;
-
-  /**
-   * Initialize a newly created token to have the given [type] at the given
-   * [offset] and to be preceded by the comments reachable from the given
-   * [_precedingComment].
-   */
-  BeginTokenWithComment(TokenType type, int offset, this._precedingComment)
-      : super(type, offset) {
-    _setCommentParent(_precedingComment);
-  }
-
-  @override
-  CommentToken get precedingComments => _precedingComment;
-
-  @override
-  void set precedingComments(CommentToken comment) {
-    _precedingComment = comment;
-    _setCommentParent(_precedingComment);
-  }
-
-  @override
-  void applyDelta(int delta) {
-    super.applyDelta(delta);
-    Token token = precedingComments;
-    while (token != null) {
-      token.applyDelta(delta);
-      token = token.next;
-    }
-  }
-
-  @override
-  Token copy() =>
-      new BeginTokenWithComment(type, offset, copyComments(precedingComments));
-}
-
-/**
- * A token representing a comment.
- */
-class CommentToken extends StringToken {
-  /**
-   * The token that contains this comment.
-   */
-  TokenWithComment parent;
-
-  /**
-   * Initialize a newly created token to represent a token of the given [type]
-   * with the given [value] at the given [offset].
-   */
-  CommentToken(TokenType type, String value, int offset)
-      : super(type, value, offset);
-
-  @override
-  CommentToken copy() => new CommentToken(type, _value, offset);
-
-  /**
-   * Remove this comment token from the list.
-   *
-   * This is used when we decide to interpret the comment as syntax.
-   */
-  void remove() {
-    if (previous != null) {
-      previous.setNextWithoutSettingPrevious(next);
-      next?.previous = previous;
-    } else {
-      assert(parent.precedingComments == this);
-      parent.precedingComments = next;
-    }
-  }
-}
-
-/**
- * A documentation comment token.
- */
-class DocumentationCommentToken extends CommentToken {
-  /**
-   * The references embedded within the documentation comment.
-   * This list will be empty unless this is a documentation comment that has
-   * references embedded within it.
-   */
-  final List<Token> references = <Token>[];
-
-  /**
-   * Initialize a newly created token to represent a token of the given [type]
-   * with the given [value] at the given [offset].
-   */
-  DocumentationCommentToken(TokenType type, String value, int offset)
-      : super(type, value, offset);
-
-  @override
-  CommentToken copy() {
-    DocumentationCommentToken copy =
-        new DocumentationCommentToken(type, _value, offset);
-    references.forEach((ref) => copy.references.add(ref.copy()));
-    return copy;
-  }
-}
-
-/**
- * A token representing a keyword in the language.
- */
-class KeywordToken extends SimpleToken {
-  @override
-  final Keyword keyword;
-
-  /**
-   * Initialize a newly created token to represent the given [keyword] at the
-   * given [offset].
-   */
-  KeywordToken(this.keyword, int offset) : super(TokenType.KEYWORD, offset);
-
-  @override
-  String get lexeme => keyword.syntax;
-
-  @override
-  Token copy() => new KeywordToken(keyword, offset);
-
-  @override
-  Keyword value() => keyword;
-}
-
-/**
- * A keyword token that is preceded by comments.
- */
-class KeywordTokenWithComment extends KeywordToken implements TokenWithComment {
-  /**
-   * The first comment in the list of comments that precede this token.
-   */
-  @override
-  CommentToken _precedingComment;
-
-  /**
-   * Initialize a newly created token to to represent the given [keyword] at the
-   * given [offset] and to be preceded by the comments reachable from the given
-   * [_precedingComment].
-   */
-  KeywordTokenWithComment(Keyword keyword, int offset, this._precedingComment)
-      : super(keyword, offset) {
-    _setCommentParent(_precedingComment);
-  }
-
-  @override
-  CommentToken get precedingComments => _precedingComment;
-
-  void set precedingComments(CommentToken comment) {
-    _precedingComment = comment;
-    _setCommentParent(_precedingComment);
-  }
-
-  @override
-  void applyDelta(int delta) {
-    super.applyDelta(delta);
-    Token token = precedingComments;
-    while (token != null) {
-      token.applyDelta(delta);
-      token = token.next;
-    }
-  }
-
-  @override
-  Token copy() => new KeywordTokenWithComment(
-      keyword, offset, copyComments(precedingComments));
-}
-
-/**
- * A token that was scanned from the input. Each token knows which tokens
- * precede and follow it, acting as a link in a doubly linked list of tokens.
- */
-class SimpleToken implements Token {
-  /**
-   * The type of the token.
-   */
-  @override
-  final TokenType type;
-
-  /**
-   * The offset from the beginning of the file to the first character in the
-   * token.
-   */
-  @override
-  int offset = 0;
-
-  /**
-   * The previous token in the token stream.
-   */
-  @override
-  Token previous;
-
-  /**
-   * The next token in the token stream.
-   */
-  Token _next;
-
-  /**
-   * Initialize a newly created token to have the given [type] and [offset].
-   */
-  SimpleToken(this.type, this.offset);
-
-  @override
-  int get end => offset + length;
-
-  @override
-  bool get isOperator => type.isOperator;
-
-  @override
-  bool get isSynthetic => length == 0;
-
-  @override
-  bool get isUserDefinableOperator => type.isUserDefinableOperator;
-
-  @override
-  Keyword get keyword => null;
-
-  @override
-  int get length => lexeme.length;
-
-  @override
-  String get lexeme => type.lexeme;
-
-  @override
-  Token get next => _next;
-
-  @override
-  CommentToken get precedingComments => null;
-
-  @override
-  void applyDelta(int delta) {
-    offset += delta;
-  }
-
-  @override
-  Token copy() => new Token(type, offset);
-
-  @override
-  Token copyComments(Token token) {
-    if (token == null) {
-      return null;
-    }
-    Token head = token.copy();
-    Token tail = head;
-    token = token.next;
-    while (token != null) {
-      tail = tail.setNext(token.copy());
-      token = token.next;
-    }
-    return head;
-  }
-
-  @override
-  bool matchesAny(List<TokenType> types) {
-    for (TokenType type in types) {
-      if (this.type == type) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  @override
-  Token setNext(Token token) {
-    _next = token;
-    token.previous = this;
-    return token;
-  }
-
-  @override
-  Token setNextWithoutSettingPrevious(Token token) {
-    _next = token;
-    return token;
-  }
-
-  @override
-  String toString() => lexeme;
-
-  @override
-  Object value() => type.lexeme;
-
-  /**
-   * Sets the `parent` property to `this` for the given [comment] and all the
-   * next tokens.
-   */
-  void _setCommentParent(CommentToken comment) {
-    while (comment != null) {
-      comment.parent = this;
-      comment = comment.next;
-    }
-  }
-}
-
-/**
- * A token whose value is independent of it's type.
- */
-class StringToken extends SimpleToken {
-  /**
-   * The lexeme represented by this token.
-   */
-  String _value;
-
-  /**
-   * Initialize a newly created token to represent a token of the given [type]
-   * with the given [value] at the given [offset].
-   */
-  StringToken(TokenType type, String value, int offset) : super(type, offset) {
-    this._value = StringUtilities.intern(value);
-  }
-
-  @override
-  String get lexeme => _value;
-
-  @override
-  Token copy() => new StringToken(type, _value, offset);
-
-  @override
-  String value() => _value;
-}
-
-/**
- * A string token that is preceded by comments.
- */
-class StringTokenWithComment extends StringToken implements TokenWithComment {
-  /**
-   * The first comment in the list of comments that precede this token.
-   */
-  CommentToken _precedingComment;
-
-  /**
-   * Initialize a newly created token to have the given [type] at the given
-   * [offset] and to be preceded by the comments reachable from the given
-   * [comment].
-   */
-  StringTokenWithComment(
-      TokenType type, String value, int offset, this._precedingComment)
-      : super(type, value, offset) {
-    _setCommentParent(_precedingComment);
-  }
-
-  @override
-  CommentToken get precedingComments => _precedingComment;
-
-  void set precedingComments(CommentToken comment) {
-    _precedingComment = comment;
-    _setCommentParent(_precedingComment);
-  }
-
-  @override
-  void applyDelta(int delta) {
-    super.applyDelta(delta);
-    Token token = precedingComments;
-    while (token != null) {
-      token.applyDelta(delta);
-      token = token.next;
-    }
-  }
-
-  @override
-  Token copy() => new StringTokenWithComment(
-      type, lexeme, offset, copyComments(precedingComments));
-}
+export 'package:front_end/src/scanner/token.dart'
+    show
+        BeginToken,
+        BeginTokenWithComment,
+        CommentToken,
+        DocumentationCommentToken,
+        KeywordToken,
+        KeywordTokenWithComment,
+        SimpleToken,
+        StringToken,
+        StringTokenWithComment,
+        TokenClass,
+        TokenWithComment;
 
 /**
  * A token whose value is independent of it's type.
@@ -413,162 +34,3 @@
   @override
   bool get isSynthetic => true;
 }
-
-/**
- * The classes (or groups) of tokens with a similar use.
- */
-class TokenClass {
-  /**
-   * A value used to indicate that the token type is not part of any specific
-   * class of token.
-   */
-  static const TokenClass NO_CLASS = const TokenClass('NO_CLASS');
-
-  /**
-   * A value used to indicate that the token type is an additive operator.
-   */
-  static const TokenClass ADDITIVE_OPERATOR =
-      const TokenClass('ADDITIVE_OPERATOR', 13);
-
-  /**
-   * A value used to indicate that the token type is an assignment operator.
-   */
-  static const TokenClass ASSIGNMENT_OPERATOR =
-      const TokenClass('ASSIGNMENT_OPERATOR', 1);
-
-  /**
-   * A value used to indicate that the token type is a bitwise-and operator.
-   */
-  static const TokenClass BITWISE_AND_OPERATOR =
-      const TokenClass('BITWISE_AND_OPERATOR', 11);
-
-  /**
-   * A value used to indicate that the token type is a bitwise-or operator.
-   */
-  static const TokenClass BITWISE_OR_OPERATOR =
-      const TokenClass('BITWISE_OR_OPERATOR', 9);
-
-  /**
-   * A value used to indicate that the token type is a bitwise-xor operator.
-   */
-  static const TokenClass BITWISE_XOR_OPERATOR =
-      const TokenClass('BITWISE_XOR_OPERATOR', 10);
-
-  /**
-   * A value used to indicate that the token type is a cascade operator.
-   */
-  static const TokenClass CASCADE_OPERATOR =
-      const TokenClass('CASCADE_OPERATOR', 2);
-
-  /**
-   * A value used to indicate that the token type is a conditional operator.
-   */
-  static const TokenClass CONDITIONAL_OPERATOR =
-      const TokenClass('CONDITIONAL_OPERATOR', 3);
-
-  /**
-   * A value used to indicate that the token type is an equality operator.
-   */
-  static const TokenClass EQUALITY_OPERATOR =
-      const TokenClass('EQUALITY_OPERATOR', 7);
-
-  /**
-   * A value used to indicate that the token type is an if-null operator.
-   */
-  static const TokenClass IF_NULL_OPERATOR =
-      const TokenClass('IF_NULL_OPERATOR', 4);
-
-  /**
-   * A value used to indicate that the token type is a logical-and operator.
-   */
-  static const TokenClass LOGICAL_AND_OPERATOR =
-      const TokenClass('LOGICAL_AND_OPERATOR', 6);
-
-  /**
-   * A value used to indicate that the token type is a logical-or operator.
-   */
-  static const TokenClass LOGICAL_OR_OPERATOR =
-      const TokenClass('LOGICAL_OR_OPERATOR', 5);
-
-  /**
-   * A value used to indicate that the token type is a multiplicative operator.
-   */
-  static const TokenClass MULTIPLICATIVE_OPERATOR =
-      const TokenClass('MULTIPLICATIVE_OPERATOR', 14);
-
-  /**
-   * A value used to indicate that the token type is a relational operator.
-   */
-  static const TokenClass RELATIONAL_OPERATOR =
-      const TokenClass('RELATIONAL_OPERATOR', 8);
-
-  /**
-   * A value used to indicate that the token type is a shift operator.
-   */
-  static const TokenClass SHIFT_OPERATOR =
-      const TokenClass('SHIFT_OPERATOR', 12);
-
-  /**
-   * A value used to indicate that the token type is a unary operator.
-   */
-  static const TokenClass UNARY_POSTFIX_OPERATOR =
-      const TokenClass('UNARY_POSTFIX_OPERATOR', 16);
-
-  /**
-   * A value used to indicate that the token type is a unary operator.
-   */
-  static const TokenClass UNARY_PREFIX_OPERATOR =
-      const TokenClass('UNARY_PREFIX_OPERATOR', 15);
-
-  /**
-   * The name of the token class.
-   */
-  final String name;
-
-  /**
-   * The precedence of tokens of this class, or `0` if the such tokens do not
-   * represent an operator.
-   */
-  final int precedence;
-
-  /**
-   * Initialize a newly created class of tokens to have the given [name] and
-   * [precedence].
-   */
-  const TokenClass(this.name, [this.precedence = 0]);
-
-  @override
-  String toString() => name;
-}
-
-/**
- * A normal token that is preceded by comments.
- */
-class TokenWithComment extends SimpleToken {
-  /**
-   * The first comment in the list of comments that precede this token.
-   */
-  CommentToken _precedingComment;
-
-  /**
-   * Initialize a newly created token to have the given [type] at the given
-   * [offset] and to be preceded by the comments reachable from the given
-   * [comment].
-   */
-  TokenWithComment(TokenType type, int offset, this._precedingComment)
-      : super(type, offset) {
-    _setCommentParent(_precedingComment);
-  }
-
-  @override
-  CommentToken get precedingComments => _precedingComment;
-
-  void set precedingComments(CommentToken comment) {
-    _precedingComment = comment;
-    _setCommentParent(_precedingComment);
-  }
-
-  @override
-  Token copy() =>
-      new TokenWithComment(type, offset, copyComments(precedingComments));
-}
diff --git a/pkg/analyzer/lib/src/dart/ast/utilities.dart b/pkg/analyzer/lib/src/dart/ast/utilities.dart
index f8ecce5..7dd0e48 100644
--- a/pkg/analyzer/lib/src/dart/ast/utilities.dart
+++ b/pkg/analyzer/lib/src/dart/ast/utilities.dart
@@ -17,6 +17,14 @@
 import 'package:analyzer/src/generated/java_core.dart';
 import 'package:analyzer/src/generated/utilities_collection.dart' show TokenMap;
 import 'package:analyzer/src/generated/utilities_dart.dart';
+import 'package:meta/meta.dart';
+
+/**
+ * A function used to handle exceptions that are thrown by delegates while using
+ * an [ExceptionHandlingDelegatingAstVisitor].
+ */
+typedef void ExceptionInDelegateHandler(
+    AstNode node, AstVisitor visitor, dynamic exception, StackTrace stackTrace);
 
 /**
  * An AST visitor that will clone any AST structure that it visits. The cloner
@@ -135,6 +143,16 @@
       cloneNode(node.type));
 
   @override
+  AstNode visitAssertInitializer(AssertInitializer node) =>
+      new AssertInitializer(
+          cloneToken(node.assertKeyword),
+          cloneToken(node.leftParenthesis),
+          cloneNode(node.condition),
+          cloneToken(node.comma),
+          cloneNode(node.message),
+          cloneToken(node.rightParenthesis));
+
+  @override
   AstNode visitAssertStatement(AssertStatement node) => new AssertStatement(
       cloneToken(node.assertKeyword),
       cloneToken(node.leftParenthesis),
@@ -722,6 +740,7 @@
           cloneNodeList(node.metadata),
           cloneToken(node.partKeyword),
           cloneToken(node.ofKeyword),
+          cloneNode(node.uri),
           cloneNode(node.libraryName),
           cloneToken(node.semicolon));
 
@@ -1108,6 +1127,17 @@
   }
 
   @override
+  bool visitAssertInitializer(AssertInitializer node) {
+    AssertStatement other = _other as AssertStatement;
+    return isEqualTokens(node.assertKeyword, other.assertKeyword) &&
+        isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
+        isEqualNodes(node.condition, other.condition) &&
+        isEqualTokens(node.comma, other.comma) &&
+        isEqualNodes(node.message, other.message) &&
+        isEqualTokens(node.rightParenthesis, other.rightParenthesis);
+  }
+
+  @override
   bool visitAssertStatement(AssertStatement node) {
     AssertStatement other = _other as AssertStatement;
     return isEqualTokens(node.assertKeyword, other.assertKeyword) &&
@@ -2631,6 +2661,69 @@
 }
 
 /**
+ * A [DelegatingAstVisitor] that will additionally catch all exceptions from the
+ * delegates without stopping the visiting. A function must be provided that
+ * will be invoked for each such exception.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ExceptionHandlingDelegatingAstVisitor<T> extends DelegatingAstVisitor<T> {
+  /**
+   * The function that will be executed for each exception that is thrown by one
+   * of the visit methods on the delegate.
+   */
+  final ExceptionInDelegateHandler handler;
+
+  /**
+   * Initialize a newly created visitor to use each of the given delegate
+   * visitors to visit the nodes of an AST structure.
+   */
+  ExceptionHandlingDelegatingAstVisitor(
+      Iterable<AstVisitor<T>> delegates, this.handler)
+      : super(delegates) {
+    if (handler == null) {
+      throw new ArgumentError('A handler must be provided');
+    }
+  }
+
+  @override
+  T visitNode(AstNode node) {
+    delegates.forEach((delegate) {
+      try {
+        node.accept(delegate);
+      } catch (exception, stackTrace) {
+        handler(node, delegate, exception, stackTrace);
+      }
+    });
+    node.visitChildren(this);
+    return null;
+  }
+
+  /**
+   * A function that can be used with instances of this class to log and then
+   * ignore any exceptions that are thrown by any of the delegates.
+   */
+  static void logException(AstNode node, AstVisitor visitor, dynamic exception,
+      StackTrace stackTrace) {
+    StringBuffer buffer = new StringBuffer();
+    buffer.write('Exception while using a ${visitor.runtimeType} to visit a ');
+    AstNode currentNode = node;
+    bool first = true;
+    while (currentNode != null) {
+      if (first) {
+        first = false;
+      } else {
+        buffer.write('in ');
+      }
+      buffer.write(currentNode.runtimeType);
+      currentNode = currentNode.parent;
+    }
+    AnalysisEngine.instance.logger.logError(
+        buffer.toString(), new CaughtException(exception, stackTrace));
+  }
+}
+
+/**
  * An object that will clone any AST structure that it visits. The cloner will
  * clone the structure, replacing the specified ASTNode with a new ASTNode,
  * mapping the old token stream to a new token stream, and preserving resolution
@@ -2692,6 +2785,16 @@
   }
 
   @override
+  AstNode visitAssertInitializer(AssertInitializer node) =>
+      new AssertInitializer(
+          _mapToken(node.assertKeyword),
+          _mapToken(node.leftParenthesis),
+          _cloneNode(node.condition),
+          _mapToken(node.comma),
+          _cloneNode(node.message),
+          _mapToken(node.rightParenthesis));
+
+  @override
   AstNode visitAssertStatement(AssertStatement node) => new AssertStatement(
       _mapToken(node.assertKeyword),
       _mapToken(node.leftParenthesis),
@@ -3378,6 +3481,7 @@
         _cloneNodeList(node.metadata),
         _mapToken(node.partKeyword),
         _mapToken(node.ofKeyword),
+        _cloneNode(node.uri),
         _cloneNode(node.libraryName),
         _mapToken(node.semicolon));
     copy.element = node.element;
@@ -3972,6 +4076,19 @@
   }
 
   @override
+  bool visitAssertInitializer(AssertInitializer node) {
+    if (identical(node.condition, _oldNode)) {
+      node.condition = _newNode as Expression;
+      return true;
+    }
+    if (identical(node.message, _oldNode)) {
+      node.message = _newNode as Expression;
+      return true;
+    }
+    return visitNode(node);
+  }
+
+  @override
   bool visitAssertStatement(AssertStatement node) {
     if (identical(node.condition, _oldNode)) {
       node.condition = _newNode as Expression;
@@ -5150,6 +5267,18 @@
   }
 
   @override
+  bool visitAssertInitializer(AssertInitializer node) {
+    AssertInitializer toNode = this._toNode as AssertInitializer;
+    return _and(
+        _isEqualTokens(node.assertKeyword, toNode.assertKeyword),
+        _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
+        _isEqualNodes(node.condition, toNode.condition),
+        _isEqualTokens(node.comma, toNode.comma),
+        _isEqualNodes(node.message, toNode.message),
+        _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis));
+  }
+
+  @override
   bool visitAssertStatement(AssertStatement node) {
     AssertStatement toNode = this._toNode as AssertStatement;
     return _and(
@@ -6698,7 +6827,10 @@
 /**
  * A visitor used to write a source representation of a visited AST node (and
  * all of it's children) to a writer.
+ *
+ * This class has been deprecated. Use the class ToSourceVisitor2 instead.
  */
+@deprecated
 class ToSourceVisitor implements AstVisitor<Object> {
   /**
    * The writer to which the source is to be written.
@@ -6743,6 +6875,18 @@
   }
 
   @override
+  bool visitAssertInitializer(AssertInitializer node) {
+    _writer.print("assert (");
+    _visitNode(node.condition);
+    if (node.message != null) {
+      _writer.print(', ');
+      _visitNode(node.message);
+    }
+    _writer.print(")");
+    return null;
+  }
+
+  @override
   Object visitAssertStatement(AssertStatement node) {
     _writer.print("assert (");
     _visitNode(node.condition);
@@ -7843,3 +7987,1175 @@
     }
   }
 }
+
+/**
+ * A visitor used to write a source representation of a visited AST node (and
+ * all of it's children) to a sink.
+ */
+class ToSourceVisitor2 implements AstVisitor<Object> {
+  /**
+   * The sink to which the source is to be written.
+   */
+  @protected
+  final StringSink sink;
+
+  /**
+   * Initialize a newly created visitor to write source code representing the
+   * visited nodes to the given [sink].
+   */
+  ToSourceVisitor2(this.sink);
+
+  /**
+   * Visit the given function [body], printing the [prefix] before if the body
+   * is not empty.
+   */
+  @protected
+  void safelyVisitFunctionWithPrefix(String prefix, FunctionBody body) {
+    if (body is! EmptyFunctionBody) {
+      sink.write(prefix);
+    }
+    safelyVisitNode(body);
+  }
+
+  /**
+   * Safely visit the given [node].
+   */
+  @protected
+  void safelyVisitNode(AstNode node) {
+    if (node != null) {
+      node.accept(this);
+    }
+  }
+
+  /**
+   * Print a list of [nodes] without any separation.
+   */
+  @protected
+  void safelyVisitNodeList(NodeList<AstNode> nodes) {
+    safelyVisitNodeListWithSeparator(nodes, "");
+  }
+
+  /**
+   * Print a list of [nodes], separated by the given [separator].
+   */
+  @protected
+  void safelyVisitNodeListWithSeparator(
+      NodeList<AstNode> nodes, String separator) {
+    if (nodes != null) {
+      int size = nodes.length;
+      for (int i = 0; i < size; i++) {
+        if (i > 0) {
+          sink.write(separator);
+        }
+        nodes[i].accept(this);
+      }
+    }
+  }
+
+  /**
+   * Print a list of [nodes], prefixed by the given [prefix] if the list is not
+   * empty, and separated by the given [separator].
+   */
+  @protected
+  void safelyVisitNodeListWithSeparatorAndPrefix(
+      String prefix, NodeList<AstNode> nodes, String separator) {
+    if (nodes != null) {
+      int size = nodes.length;
+      if (size > 0) {
+        sink.write(prefix);
+        for (int i = 0; i < size; i++) {
+          if (i > 0) {
+            sink.write(separator);
+          }
+          nodes[i].accept(this);
+        }
+      }
+    }
+  }
+
+  /**
+   * Print a list of [nodes], separated by the given [separator], followed by
+   * the given [suffix] if the list is not empty.
+   */
+  @protected
+  void safelyVisitNodeListWithSeparatorAndSuffix(
+      NodeList<AstNode> nodes, String separator, String suffix) {
+    if (nodes != null) {
+      int size = nodes.length;
+      if (size > 0) {
+        for (int i = 0; i < size; i++) {
+          if (i > 0) {
+            sink.write(separator);
+          }
+          nodes[i].accept(this);
+        }
+        sink.write(suffix);
+      }
+    }
+  }
+
+  /**
+   * Safely visit the given [node], printing the [prefix] before the node if it
+   * is non-`null`.
+   */
+  @protected
+  void safelyVisitNodeWithPrefix(String prefix, AstNode node) {
+    if (node != null) {
+      sink.write(prefix);
+      node.accept(this);
+    }
+  }
+
+  /**
+   * Safely visit the given [node], printing the [suffix] after the node if it
+   * is non-`null`.
+   */
+  @protected
+  void safelyVisitNodeWithSuffix(AstNode node, String suffix) {
+    if (node != null) {
+      node.accept(this);
+      sink.write(suffix);
+    }
+  }
+
+  /**
+   * Safely visit the given [token], printing the [suffix] after the token if it
+   * is non-`null`.
+   */
+  @protected
+  void safelyVisitTokenWithSuffix(Token token, String suffix) {
+    if (token != null) {
+      sink.write(token.lexeme);
+      sink.write(suffix);
+    }
+  }
+
+  @override
+  Object visitAdjacentStrings(AdjacentStrings node) {
+    safelyVisitNodeListWithSeparator(node.strings, " ");
+    return null;
+  }
+
+  @override
+  Object visitAnnotation(Annotation node) {
+    sink.write('@');
+    safelyVisitNode(node.name);
+    safelyVisitNodeWithPrefix(".", node.constructorName);
+    safelyVisitNode(node.arguments);
+    return null;
+  }
+
+  @override
+  Object visitArgumentList(ArgumentList node) {
+    sink.write('(');
+    safelyVisitNodeListWithSeparator(node.arguments, ", ");
+    sink.write(')');
+    return null;
+  }
+
+  @override
+  Object visitAsExpression(AsExpression node) {
+    safelyVisitNode(node.expression);
+    sink.write(" as ");
+    safelyVisitNode(node.type);
+    return null;
+  }
+
+  @override
+  bool visitAssertInitializer(AssertInitializer node) {
+    sink.write("assert (");
+    safelyVisitNode(node.condition);
+    if (node.message != null) {
+      sink.write(', ');
+      safelyVisitNode(node.message);
+    }
+    sink.write(");");
+    return null;
+  }
+
+  @override
+  Object visitAssertStatement(AssertStatement node) {
+    sink.write("assert (");
+    safelyVisitNode(node.condition);
+    if (node.message != null) {
+      sink.write(', ');
+      safelyVisitNode(node.message);
+    }
+    sink.write(");");
+    return null;
+  }
+
+  @override
+  Object visitAssignmentExpression(AssignmentExpression node) {
+    safelyVisitNode(node.leftHandSide);
+    sink.write(' ');
+    sink.write(node.operator.lexeme);
+    sink.write(' ');
+    safelyVisitNode(node.rightHandSide);
+    return null;
+  }
+
+  @override
+  Object visitAwaitExpression(AwaitExpression node) {
+    sink.write("await ");
+    safelyVisitNode(node.expression);
+    return null;
+  }
+
+  @override
+  Object visitBinaryExpression(BinaryExpression node) {
+    safelyVisitNode(node.leftOperand);
+    sink.write(' ');
+    sink.write(node.operator.lexeme);
+    sink.write(' ');
+    safelyVisitNode(node.rightOperand);
+    return null;
+  }
+
+  @override
+  Object visitBlock(Block node) {
+    sink.write('{');
+    safelyVisitNodeListWithSeparator(node.statements, " ");
+    sink.write('}');
+    return null;
+  }
+
+  @override
+  Object visitBlockFunctionBody(BlockFunctionBody node) {
+    Token keyword = node.keyword;
+    if (keyword != null) {
+      sink.write(keyword.lexeme);
+      if (node.star != null) {
+        sink.write('*');
+      }
+      sink.write(' ');
+    }
+    safelyVisitNode(node.block);
+    return null;
+  }
+
+  @override
+  Object visitBooleanLiteral(BooleanLiteral node) {
+    sink.write(node.literal.lexeme);
+    return null;
+  }
+
+  @override
+  Object visitBreakStatement(BreakStatement node) {
+    sink.write("break");
+    safelyVisitNodeWithPrefix(" ", node.label);
+    sink.write(";");
+    return null;
+  }
+
+  @override
+  Object visitCascadeExpression(CascadeExpression node) {
+    safelyVisitNode(node.target);
+    safelyVisitNodeList(node.cascadeSections);
+    return null;
+  }
+
+  @override
+  Object visitCatchClause(CatchClause node) {
+    safelyVisitNodeWithPrefix("on ", node.exceptionType);
+    if (node.catchKeyword != null) {
+      if (node.exceptionType != null) {
+        sink.write(' ');
+      }
+      sink.write("catch (");
+      safelyVisitNode(node.exceptionParameter);
+      safelyVisitNodeWithPrefix(", ", node.stackTraceParameter);
+      sink.write(") ");
+    } else {
+      sink.write(" ");
+    }
+    safelyVisitNode(node.body);
+    return null;
+  }
+
+  @override
+  Object visitClassDeclaration(ClassDeclaration node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, " ", " ");
+    safelyVisitTokenWithSuffix(node.abstractKeyword, " ");
+    sink.write("class ");
+    safelyVisitNode(node.name);
+    safelyVisitNode(node.typeParameters);
+    safelyVisitNodeWithPrefix(" ", node.extendsClause);
+    safelyVisitNodeWithPrefix(" ", node.withClause);
+    safelyVisitNodeWithPrefix(" ", node.implementsClause);
+    sink.write(" {");
+    safelyVisitNodeListWithSeparator(node.members, " ");
+    sink.write("}");
+    return null;
+  }
+
+  @override
+  Object visitClassTypeAlias(ClassTypeAlias node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, " ", " ");
+    if (node.abstractKeyword != null) {
+      sink.write("abstract ");
+    }
+    sink.write("class ");
+    safelyVisitNode(node.name);
+    safelyVisitNode(node.typeParameters);
+    sink.write(" = ");
+    safelyVisitNode(node.superclass);
+    safelyVisitNodeWithPrefix(" ", node.withClause);
+    safelyVisitNodeWithPrefix(" ", node.implementsClause);
+    sink.write(";");
+    return null;
+  }
+
+  @override
+  Object visitComment(Comment node) => null;
+
+  @override
+  Object visitCommentReference(CommentReference node) => null;
+
+  @override
+  Object visitCompilationUnit(CompilationUnit node) {
+    ScriptTag scriptTag = node.scriptTag;
+    NodeList<Directive> directives = node.directives;
+    safelyVisitNode(scriptTag);
+    String prefix = scriptTag == null ? "" : " ";
+    safelyVisitNodeListWithSeparatorAndPrefix(prefix, directives, " ");
+    prefix = scriptTag == null && directives.isEmpty ? "" : " ";
+    safelyVisitNodeListWithSeparatorAndPrefix(prefix, node.declarations, " ");
+    return null;
+  }
+
+  @override
+  Object visitConditionalExpression(ConditionalExpression node) {
+    safelyVisitNode(node.condition);
+    sink.write(" ? ");
+    safelyVisitNode(node.thenExpression);
+    sink.write(" : ");
+    safelyVisitNode(node.elseExpression);
+    return null;
+  }
+
+  @override
+  Object visitConfiguration(Configuration node) {
+    sink.write('if (');
+    safelyVisitNode(node.name);
+    safelyVisitNodeWithPrefix(" == ", node.value);
+    sink.write(') ');
+    safelyVisitNode(node.uri);
+    return null;
+  }
+
+  @override
+  Object visitConstructorDeclaration(ConstructorDeclaration node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, " ", " ");
+    safelyVisitTokenWithSuffix(node.externalKeyword, " ");
+    safelyVisitTokenWithSuffix(node.constKeyword, " ");
+    safelyVisitTokenWithSuffix(node.factoryKeyword, " ");
+    safelyVisitNode(node.returnType);
+    safelyVisitNodeWithPrefix(".", node.name);
+    safelyVisitNode(node.parameters);
+    safelyVisitNodeListWithSeparatorAndPrefix(" : ", node.initializers, ", ");
+    safelyVisitNodeWithPrefix(" = ", node.redirectedConstructor);
+    safelyVisitFunctionWithPrefix(" ", node.body);
+    return null;
+  }
+
+  @override
+  Object visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
+    safelyVisitTokenWithSuffix(node.thisKeyword, ".");
+    safelyVisitNode(node.fieldName);
+    sink.write(" = ");
+    safelyVisitNode(node.expression);
+    return null;
+  }
+
+  @override
+  Object visitConstructorName(ConstructorName node) {
+    safelyVisitNode(node.type);
+    safelyVisitNodeWithPrefix(".", node.name);
+    return null;
+  }
+
+  @override
+  Object visitContinueStatement(ContinueStatement node) {
+    sink.write("continue");
+    safelyVisitNodeWithPrefix(" ", node.label);
+    sink.write(";");
+    return null;
+  }
+
+  @override
+  Object visitDeclaredIdentifier(DeclaredIdentifier node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, " ", " ");
+    safelyVisitTokenWithSuffix(node.keyword, " ");
+    safelyVisitNodeWithSuffix(node.type, " ");
+    safelyVisitNode(node.identifier);
+    return null;
+  }
+
+  @override
+  Object visitDefaultFormalParameter(DefaultFormalParameter node) {
+    safelyVisitNode(node.parameter);
+    if (node.separator != null) {
+      sink.write(" ");
+      sink.write(node.separator.lexeme);
+      safelyVisitNodeWithPrefix(" ", node.defaultValue);
+    }
+    return null;
+  }
+
+  @override
+  Object visitDoStatement(DoStatement node) {
+    sink.write("do ");
+    safelyVisitNode(node.body);
+    sink.write(" while (");
+    safelyVisitNode(node.condition);
+    sink.write(");");
+    return null;
+  }
+
+  @override
+  Object visitDottedName(DottedName node) {
+    safelyVisitNodeListWithSeparator(node.components, ".");
+    return null;
+  }
+
+  @override
+  Object visitDoubleLiteral(DoubleLiteral node) {
+    sink.write(node.literal.lexeme);
+    return null;
+  }
+
+  @override
+  Object visitEmptyFunctionBody(EmptyFunctionBody node) {
+    sink.write(';');
+    return null;
+  }
+
+  @override
+  Object visitEmptyStatement(EmptyStatement node) {
+    sink.write(';');
+    return null;
+  }
+
+  @override
+  Object visitEnumConstantDeclaration(EnumConstantDeclaration node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, " ", " ");
+    safelyVisitNode(node.name);
+    return null;
+  }
+
+  @override
+  Object visitEnumDeclaration(EnumDeclaration node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, " ", " ");
+    sink.write("enum ");
+    safelyVisitNode(node.name);
+    sink.write(" {");
+    safelyVisitNodeListWithSeparator(node.constants, ", ");
+    sink.write("}");
+    return null;
+  }
+
+  @override
+  Object visitExportDirective(ExportDirective node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, " ", " ");
+    sink.write("export ");
+    safelyVisitNode(node.uri);
+    safelyVisitNodeListWithSeparatorAndPrefix(" ", node.combinators, " ");
+    sink.write(';');
+    return null;
+  }
+
+  @override
+  Object visitExpressionFunctionBody(ExpressionFunctionBody node) {
+    Token keyword = node.keyword;
+    if (keyword != null) {
+      sink.write(keyword.lexeme);
+      sink.write(' ');
+    }
+    sink.write("=> ");
+    safelyVisitNode(node.expression);
+    if (node.semicolon != null) {
+      sink.write(';');
+    }
+    return null;
+  }
+
+  @override
+  Object visitExpressionStatement(ExpressionStatement node) {
+    safelyVisitNode(node.expression);
+    sink.write(';');
+    return null;
+  }
+
+  @override
+  Object visitExtendsClause(ExtendsClause node) {
+    sink.write("extends ");
+    safelyVisitNode(node.superclass);
+    return null;
+  }
+
+  @override
+  Object visitFieldDeclaration(FieldDeclaration node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, " ", " ");
+    safelyVisitTokenWithSuffix(node.staticKeyword, " ");
+    safelyVisitNode(node.fields);
+    sink.write(";");
+    return null;
+  }
+
+  @override
+  Object visitFieldFormalParameter(FieldFormalParameter node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, ' ', ' ');
+    safelyVisitTokenWithSuffix(node.keyword, " ");
+    safelyVisitNodeWithSuffix(node.type, " ");
+    sink.write("this.");
+    safelyVisitNode(node.identifier);
+    safelyVisitNode(node.typeParameters);
+    safelyVisitNode(node.parameters);
+    return null;
+  }
+
+  @override
+  Object visitForEachStatement(ForEachStatement node) {
+    DeclaredIdentifier loopVariable = node.loopVariable;
+    if (node.awaitKeyword != null) {
+      sink.write("await ");
+    }
+    sink.write("for (");
+    if (loopVariable == null) {
+      safelyVisitNode(node.identifier);
+    } else {
+      safelyVisitNode(loopVariable);
+    }
+    sink.write(" in ");
+    safelyVisitNode(node.iterable);
+    sink.write(") ");
+    safelyVisitNode(node.body);
+    return null;
+  }
+
+  @override
+  Object visitFormalParameterList(FormalParameterList node) {
+    String groupEnd = null;
+    sink.write('(');
+    NodeList<FormalParameter> parameters = node.parameters;
+    int size = parameters.length;
+    for (int i = 0; i < size; i++) {
+      FormalParameter parameter = parameters[i];
+      if (i > 0) {
+        sink.write(", ");
+      }
+      if (groupEnd == null && parameter is DefaultFormalParameter) {
+        if (parameter.kind == ParameterKind.NAMED) {
+          groupEnd = "}";
+          sink.write('{');
+        } else {
+          groupEnd = "]";
+          sink.write('[');
+        }
+      }
+      parameter.accept(this);
+    }
+    if (groupEnd != null) {
+      sink.write(groupEnd);
+    }
+    sink.write(')');
+    return null;
+  }
+
+  @override
+  Object visitForStatement(ForStatement node) {
+    Expression initialization = node.initialization;
+    sink.write("for (");
+    if (initialization != null) {
+      safelyVisitNode(initialization);
+    } else {
+      safelyVisitNode(node.variables);
+    }
+    sink.write(";");
+    safelyVisitNodeWithPrefix(" ", node.condition);
+    sink.write(";");
+    safelyVisitNodeListWithSeparatorAndPrefix(" ", node.updaters, ", ");
+    sink.write(") ");
+    safelyVisitNode(node.body);
+    return null;
+  }
+
+  @override
+  Object visitFunctionDeclaration(FunctionDeclaration node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, " ", " ");
+    safelyVisitTokenWithSuffix(node.externalKeyword, " ");
+    safelyVisitNodeWithSuffix(node.returnType, " ");
+    safelyVisitTokenWithSuffix(node.propertyKeyword, " ");
+    safelyVisitNode(node.name);
+    safelyVisitNode(node.functionExpression);
+    return null;
+  }
+
+  @override
+  Object visitFunctionDeclarationStatement(FunctionDeclarationStatement node) {
+    safelyVisitNode(node.functionDeclaration);
+    return null;
+  }
+
+  @override
+  Object visitFunctionExpression(FunctionExpression node) {
+    safelyVisitNode(node.typeParameters);
+    safelyVisitNode(node.parameters);
+    if (node.body is! EmptyFunctionBody) {
+      sink.write(' ');
+    }
+    safelyVisitNode(node.body);
+    return null;
+  }
+
+  @override
+  Object visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
+    safelyVisitNode(node.function);
+    safelyVisitNode(node.typeArguments);
+    safelyVisitNode(node.argumentList);
+    return null;
+  }
+
+  @override
+  Object visitFunctionTypeAlias(FunctionTypeAlias node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, " ", " ");
+    sink.write("typedef ");
+    safelyVisitNodeWithSuffix(node.returnType, " ");
+    safelyVisitNode(node.name);
+    safelyVisitNode(node.typeParameters);
+    safelyVisitNode(node.parameters);
+    sink.write(";");
+    return null;
+  }
+
+  @override
+  Object visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, ' ', ' ');
+    safelyVisitNodeWithSuffix(node.returnType, " ");
+    safelyVisitNode(node.identifier);
+    safelyVisitNode(node.typeParameters);
+    safelyVisitNode(node.parameters);
+    if (node.question != null) {
+      sink.write('?');
+    }
+    return null;
+  }
+
+  @override
+  Object visitHideCombinator(HideCombinator node) {
+    sink.write("hide ");
+    safelyVisitNodeListWithSeparator(node.hiddenNames, ", ");
+    return null;
+  }
+
+  @override
+  Object visitIfStatement(IfStatement node) {
+    sink.write("if (");
+    safelyVisitNode(node.condition);
+    sink.write(") ");
+    safelyVisitNode(node.thenStatement);
+    safelyVisitNodeWithPrefix(" else ", node.elseStatement);
+    return null;
+  }
+
+  @override
+  Object visitImplementsClause(ImplementsClause node) {
+    sink.write("implements ");
+    safelyVisitNodeListWithSeparator(node.interfaces, ", ");
+    return null;
+  }
+
+  @override
+  Object visitImportDirective(ImportDirective node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, " ", " ");
+    sink.write("import ");
+    safelyVisitNode(node.uri);
+    if (node.deferredKeyword != null) {
+      sink.write(" deferred");
+    }
+    safelyVisitNodeWithPrefix(" as ", node.prefix);
+    safelyVisitNodeListWithSeparatorAndPrefix(" ", node.combinators, " ");
+    sink.write(';');
+    return null;
+  }
+
+  @override
+  Object visitIndexExpression(IndexExpression node) {
+    if (node.isCascaded) {
+      sink.write("..");
+    } else {
+      safelyVisitNode(node.target);
+    }
+    sink.write('[');
+    safelyVisitNode(node.index);
+    sink.write(']');
+    return null;
+  }
+
+  @override
+  Object visitInstanceCreationExpression(InstanceCreationExpression node) {
+    safelyVisitTokenWithSuffix(node.keyword, " ");
+    safelyVisitNode(node.constructorName);
+    safelyVisitNode(node.argumentList);
+    return null;
+  }
+
+  @override
+  Object visitIntegerLiteral(IntegerLiteral node) {
+    sink.write(node.literal.lexeme);
+    return null;
+  }
+
+  @override
+  Object visitInterpolationExpression(InterpolationExpression node) {
+    if (node.rightBracket != null) {
+      sink.write("\${");
+      safelyVisitNode(node.expression);
+      sink.write("}");
+    } else {
+      sink.write("\$");
+      safelyVisitNode(node.expression);
+    }
+    return null;
+  }
+
+  @override
+  Object visitInterpolationString(InterpolationString node) {
+    sink.write(node.contents.lexeme);
+    return null;
+  }
+
+  @override
+  Object visitIsExpression(IsExpression node) {
+    safelyVisitNode(node.expression);
+    if (node.notOperator == null) {
+      sink.write(" is ");
+    } else {
+      sink.write(" is! ");
+    }
+    safelyVisitNode(node.type);
+    return null;
+  }
+
+  @override
+  Object visitLabel(Label node) {
+    safelyVisitNode(node.label);
+    sink.write(":");
+    return null;
+  }
+
+  @override
+  Object visitLabeledStatement(LabeledStatement node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.labels, " ", " ");
+    safelyVisitNode(node.statement);
+    return null;
+  }
+
+  @override
+  Object visitLibraryDirective(LibraryDirective node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, " ", " ");
+    sink.write("library ");
+    safelyVisitNode(node.name);
+    sink.write(';');
+    return null;
+  }
+
+  @override
+  Object visitLibraryIdentifier(LibraryIdentifier node) {
+    sink.write(node.name);
+    return null;
+  }
+
+  @override
+  Object visitListLiteral(ListLiteral node) {
+    if (node.constKeyword != null) {
+      sink.write(node.constKeyword.lexeme);
+      sink.write(' ');
+    }
+    safelyVisitNodeWithSuffix(node.typeArguments, " ");
+    sink.write("[");
+    safelyVisitNodeListWithSeparator(node.elements, ", ");
+    sink.write("]");
+    return null;
+  }
+
+  @override
+  Object visitMapLiteral(MapLiteral node) {
+    if (node.constKeyword != null) {
+      sink.write(node.constKeyword.lexeme);
+      sink.write(' ');
+    }
+    safelyVisitNodeWithSuffix(node.typeArguments, " ");
+    sink.write("{");
+    safelyVisitNodeListWithSeparator(node.entries, ", ");
+    sink.write("}");
+    return null;
+  }
+
+  @override
+  Object visitMapLiteralEntry(MapLiteralEntry node) {
+    safelyVisitNode(node.key);
+    sink.write(" : ");
+    safelyVisitNode(node.value);
+    return null;
+  }
+
+  @override
+  Object visitMethodDeclaration(MethodDeclaration node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, " ", " ");
+    safelyVisitTokenWithSuffix(node.externalKeyword, " ");
+    safelyVisitTokenWithSuffix(node.modifierKeyword, " ");
+    safelyVisitNodeWithSuffix(node.returnType, " ");
+    safelyVisitTokenWithSuffix(node.propertyKeyword, " ");
+    safelyVisitTokenWithSuffix(node.operatorKeyword, " ");
+    safelyVisitNode(node.name);
+    if (!node.isGetter) {
+      safelyVisitNode(node.typeParameters);
+      safelyVisitNode(node.parameters);
+    }
+    safelyVisitFunctionWithPrefix(" ", node.body);
+    return null;
+  }
+
+  @override
+  Object visitMethodInvocation(MethodInvocation node) {
+    if (node.isCascaded) {
+      sink.write("..");
+    } else {
+      if (node.target != null) {
+        node.target.accept(this);
+        sink.write(node.operator.lexeme);
+      }
+    }
+    safelyVisitNode(node.methodName);
+    safelyVisitNode(node.typeArguments);
+    safelyVisitNode(node.argumentList);
+    return null;
+  }
+
+  @override
+  Object visitNamedExpression(NamedExpression node) {
+    safelyVisitNode(node.name);
+    safelyVisitNodeWithPrefix(" ", node.expression);
+    return null;
+  }
+
+  @override
+  Object visitNativeClause(NativeClause node) {
+    sink.write("native ");
+    safelyVisitNode(node.name);
+    return null;
+  }
+
+  @override
+  Object visitNativeFunctionBody(NativeFunctionBody node) {
+    sink.write("native ");
+    safelyVisitNode(node.stringLiteral);
+    sink.write(';');
+    return null;
+  }
+
+  @override
+  Object visitNullLiteral(NullLiteral node) {
+    sink.write("null");
+    return null;
+  }
+
+  @override
+  Object visitParenthesizedExpression(ParenthesizedExpression node) {
+    sink.write('(');
+    safelyVisitNode(node.expression);
+    sink.write(')');
+    return null;
+  }
+
+  @override
+  Object visitPartDirective(PartDirective node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, " ", " ");
+    sink.write("part ");
+    safelyVisitNode(node.uri);
+    sink.write(';');
+    return null;
+  }
+
+  @override
+  Object visitPartOfDirective(PartOfDirective node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, " ", " ");
+    sink.write("part of ");
+    safelyVisitNode(node.libraryName);
+    sink.write(';');
+    return null;
+  }
+
+  @override
+  Object visitPostfixExpression(PostfixExpression node) {
+    safelyVisitNode(node.operand);
+    sink.write(node.operator.lexeme);
+    return null;
+  }
+
+  @override
+  Object visitPrefixedIdentifier(PrefixedIdentifier node) {
+    safelyVisitNode(node.prefix);
+    sink.write('.');
+    safelyVisitNode(node.identifier);
+    return null;
+  }
+
+  @override
+  Object visitPrefixExpression(PrefixExpression node) {
+    sink.write(node.operator.lexeme);
+    safelyVisitNode(node.operand);
+    return null;
+  }
+
+  @override
+  Object visitPropertyAccess(PropertyAccess node) {
+    if (node.isCascaded) {
+      sink.write("..");
+    } else {
+      safelyVisitNode(node.target);
+      sink.write(node.operator.lexeme);
+    }
+    safelyVisitNode(node.propertyName);
+    return null;
+  }
+
+  @override
+  Object visitRedirectingConstructorInvocation(
+      RedirectingConstructorInvocation node) {
+    sink.write("this");
+    safelyVisitNodeWithPrefix(".", node.constructorName);
+    safelyVisitNode(node.argumentList);
+    return null;
+  }
+
+  @override
+  Object visitRethrowExpression(RethrowExpression node) {
+    sink.write("rethrow");
+    return null;
+  }
+
+  @override
+  Object visitReturnStatement(ReturnStatement node) {
+    Expression expression = node.expression;
+    if (expression == null) {
+      sink.write("return;");
+    } else {
+      sink.write("return ");
+      expression.accept(this);
+      sink.write(";");
+    }
+    return null;
+  }
+
+  @override
+  Object visitScriptTag(ScriptTag node) {
+    sink.write(node.scriptTag.lexeme);
+    return null;
+  }
+
+  @override
+  Object visitShowCombinator(ShowCombinator node) {
+    sink.write("show ");
+    safelyVisitNodeListWithSeparator(node.shownNames, ", ");
+    return null;
+  }
+
+  @override
+  Object visitSimpleFormalParameter(SimpleFormalParameter node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, ' ', ' ');
+    safelyVisitTokenWithSuffix(node.keyword, " ");
+    safelyVisitNodeWithSuffix(node.type, " ");
+    safelyVisitNode(node.identifier);
+    return null;
+  }
+
+  @override
+  Object visitSimpleIdentifier(SimpleIdentifier node) {
+    sink.write(node.token.lexeme);
+    return null;
+  }
+
+  @override
+  Object visitSimpleStringLiteral(SimpleStringLiteral node) {
+    sink.write(node.literal.lexeme);
+    return null;
+  }
+
+  @override
+  Object visitStringInterpolation(StringInterpolation node) {
+    safelyVisitNodeList(node.elements);
+    return null;
+  }
+
+  @override
+  Object visitSuperConstructorInvocation(SuperConstructorInvocation node) {
+    sink.write("super");
+    safelyVisitNodeWithPrefix(".", node.constructorName);
+    safelyVisitNode(node.argumentList);
+    return null;
+  }
+
+  @override
+  Object visitSuperExpression(SuperExpression node) {
+    sink.write("super");
+    return null;
+  }
+
+  @override
+  Object visitSwitchCase(SwitchCase node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.labels, " ", " ");
+    sink.write("case ");
+    safelyVisitNode(node.expression);
+    sink.write(": ");
+    safelyVisitNodeListWithSeparator(node.statements, " ");
+    return null;
+  }
+
+  @override
+  Object visitSwitchDefault(SwitchDefault node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.labels, " ", " ");
+    sink.write("default: ");
+    safelyVisitNodeListWithSeparator(node.statements, " ");
+    return null;
+  }
+
+  @override
+  Object visitSwitchStatement(SwitchStatement node) {
+    sink.write("switch (");
+    safelyVisitNode(node.expression);
+    sink.write(") {");
+    safelyVisitNodeListWithSeparator(node.members, " ");
+    sink.write("}");
+    return null;
+  }
+
+  @override
+  Object visitSymbolLiteral(SymbolLiteral node) {
+    sink.write("#");
+    List<Token> components = node.components;
+    for (int i = 0; i < components.length; i++) {
+      if (i > 0) {
+        sink.write(".");
+      }
+      sink.write(components[i].lexeme);
+    }
+    return null;
+  }
+
+  @override
+  Object visitThisExpression(ThisExpression node) {
+    sink.write("this");
+    return null;
+  }
+
+  @override
+  Object visitThrowExpression(ThrowExpression node) {
+    sink.write("throw ");
+    safelyVisitNode(node.expression);
+    return null;
+  }
+
+  @override
+  Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
+    safelyVisitNodeWithSuffix(node.variables, ";");
+    return null;
+  }
+
+  @override
+  Object visitTryStatement(TryStatement node) {
+    sink.write("try ");
+    safelyVisitNode(node.body);
+    safelyVisitNodeListWithSeparatorAndPrefix(" ", node.catchClauses, " ");
+    safelyVisitNodeWithPrefix(" finally ", node.finallyBlock);
+    return null;
+  }
+
+  @override
+  Object visitTypeArgumentList(TypeArgumentList node) {
+    sink.write('<');
+    safelyVisitNodeListWithSeparator(node.arguments, ", ");
+    sink.write('>');
+    return null;
+  }
+
+  @override
+  Object visitTypeName(TypeName node) {
+    safelyVisitNode(node.name);
+    safelyVisitNode(node.typeArguments);
+    if (node.question != null) {
+      sink.write('?');
+    }
+    return null;
+  }
+
+  @override
+  Object visitTypeParameter(TypeParameter node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, " ", " ");
+    safelyVisitNode(node.name);
+    safelyVisitNodeWithPrefix(" extends ", node.bound);
+    return null;
+  }
+
+  @override
+  Object visitTypeParameterList(TypeParameterList node) {
+    sink.write('<');
+    safelyVisitNodeListWithSeparator(node.typeParameters, ", ");
+    sink.write('>');
+    return null;
+  }
+
+  @override
+  Object visitVariableDeclaration(VariableDeclaration node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, " ", " ");
+    safelyVisitNode(node.name);
+    safelyVisitNodeWithPrefix(" = ", node.initializer);
+    return null;
+  }
+
+  @override
+  Object visitVariableDeclarationList(VariableDeclarationList node) {
+    safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, " ", " ");
+    safelyVisitTokenWithSuffix(node.keyword, " ");
+    safelyVisitNodeWithSuffix(node.type, " ");
+    safelyVisitNodeListWithSeparator(node.variables, ", ");
+    return null;
+  }
+
+  @override
+  Object visitVariableDeclarationStatement(VariableDeclarationStatement node) {
+    safelyVisitNode(node.variables);
+    sink.write(";");
+    return null;
+  }
+
+  @override
+  Object visitWhileStatement(WhileStatement node) {
+    sink.write("while (");
+    safelyVisitNode(node.condition);
+    sink.write(") ");
+    safelyVisitNode(node.body);
+    return null;
+  }
+
+  @override
+  Object visitWithClause(WithClause node) {
+    sink.write("with ");
+    safelyVisitNodeListWithSeparator(node.mixinTypes, ", ");
+    return null;
+  }
+
+  @override
+  Object visitYieldStatement(YieldStatement node) {
+    if (node.star != null) {
+      sink.write("yield* ");
+    } else {
+      sink.write("yield ");
+    }
+    safelyVisitNode(node.expression);
+    sink.write(";");
+    return null;
+  }
+}
diff --git a/pkg/analyzer/lib/src/dart/constant/utilities.dart b/pkg/analyzer/lib/src/dart/constant/utilities.dart
index 90c8a38..d9ef263 100644
--- a/pkg/analyzer/lib/src/dart/constant/utilities.dart
+++ b/pkg/analyzer/lib/src/dart/constant/utilities.dart
@@ -46,6 +46,13 @@
   }
 
   @override
+  Annotation visitAnnotation(Annotation node) {
+    Annotation annotation = super.visitAnnotation(node);
+    annotation.element = node.element;
+    return annotation;
+  }
+
+  @override
   FunctionExpression visitFunctionExpression(FunctionExpression node) {
     FunctionExpression expression = super.visitFunctionExpression(node);
     expression.element = node.element;
diff --git a/pkg/analyzer/lib/src/dart/element/builder.dart b/pkg/analyzer/lib/src/dart/element/builder.dart
index 7e06a56..17af70d 100644
--- a/pkg/analyzer/lib/src/dart/element/builder.dart
+++ b/pkg/analyzer/lib/src/dart/element/builder.dart
@@ -23,6 +23,719 @@
 import 'package:analyzer/src/generated/utilities_dart.dart';
 
 /**
+ * Instances of the class `ApiElementBuilder` traverse an AST structure and
+ * build elements outside of function bodies and initializers.
+ */
+class ApiElementBuilder extends _BaseElementBuilder {
+  /**
+   * A table mapping field names to field elements for the fields defined in the current class, or
+   * `null` if we are not in the scope of a class.
+   */
+  HashMap<String, FieldElement> _fieldMap;
+
+  /**
+   * Initialize a newly created element builder to build the elements for a
+   * compilation unit. The [initialHolder] is the element holder to which the
+   * children of the visited compilation unit node will be added.
+   */
+  ApiElementBuilder(ElementHolder initialHolder,
+      CompilationUnitElementImpl compilationUnitElement)
+      : super(initialHolder, compilationUnitElement);
+
+  @override
+  Object visitAnnotation(Annotation node) {
+    // Although it isn't valid to do so because closures are not constant
+    // expressions, it's possible for one of the arguments to the constructor to
+    // contain a closure. Wrapping the processing of the annotation this way
+    // prevents these closures from being added to the list of functions in the
+    // annotated declaration.
+    ElementHolder holder = new ElementHolder();
+    ElementHolder previousHolder = _currentHolder;
+    _currentHolder = holder;
+    try {
+      super.visitAnnotation(node);
+    } finally {
+      _currentHolder = previousHolder;
+    }
+    return null;
+  }
+
+  @override
+  Object visitBlockFunctionBody(BlockFunctionBody node) {
+    return null;
+  }
+
+  @override
+  Object visitClassDeclaration(ClassDeclaration node) {
+    ElementHolder holder = new ElementHolder();
+    //
+    // Process field declarations before constructors and methods so that field
+    // formal parameters can be correctly resolved to their fields.
+    //
+    ElementHolder previousHolder = _currentHolder;
+    _currentHolder = holder;
+    try {
+      List<ClassMember> nonFields = new List<ClassMember>();
+      node.visitChildren(
+          new _ElementBuilder_visitClassDeclaration(this, nonFields));
+      _buildFieldMap(holder.fieldsWithoutFlushing);
+      int count = nonFields.length;
+      for (int i = 0; i < count; i++) {
+        nonFields[i].accept(this);
+      }
+    } finally {
+      _currentHolder = previousHolder;
+    }
+    SimpleIdentifier className = node.name;
+    ClassElementImpl element = new ClassElementImpl.forNode(className);
+    _setCodeRange(element, node);
+    element.metadata = _createElementAnnotations(node.metadata);
+    element.typeParameters = holder.typeParameters;
+    setElementDocumentationComment(element, node);
+    element.abstract = node.isAbstract;
+    element.accessors = holder.accessors;
+    List<ConstructorElement> constructors = holder.constructors;
+    if (constructors.isEmpty) {
+      constructors = _createDefaultConstructors(element);
+    }
+    element.constructors = constructors;
+    element.fields = holder.fields;
+    element.methods = holder.methods;
+    _currentHolder.addType(element);
+    className.staticElement = element;
+    _fieldMap = null;
+    holder.validate();
+    return null;
+  }
+
+  @override
+  Object visitClassTypeAlias(ClassTypeAlias node) {
+    ElementHolder holder = new ElementHolder();
+    _visitChildren(holder, node);
+    SimpleIdentifier className = node.name;
+    ClassElementImpl element = new ClassElementImpl.forNode(className);
+    _setCodeRange(element, node);
+    element.metadata = _createElementAnnotations(node.metadata);
+    element.abstract = node.abstractKeyword != null;
+    element.mixinApplication = true;
+    element.typeParameters = holder.typeParameters;
+    setElementDocumentationComment(element, node);
+    _currentHolder.addType(element);
+    className.staticElement = element;
+    holder.validate();
+    return null;
+  }
+
+  @override
+  Object visitCompilationUnit(CompilationUnit node) {
+    if (_unitElement is ElementImpl) {
+      _setCodeRange(_unitElement, node);
+    }
+    return super.visitCompilationUnit(node);
+  }
+
+  @override
+  Object visitConstructorDeclaration(ConstructorDeclaration node) {
+    ElementHolder holder = new ElementHolder();
+    _visitChildren(holder, node);
+    FunctionBody body = node.body;
+    SimpleIdentifier constructorName = node.name;
+    ConstructorElementImpl element =
+        new ConstructorElementImpl.forNode(constructorName);
+    _setCodeRange(element, node);
+    element.metadata = _createElementAnnotations(node.metadata);
+    setElementDocumentationComment(element, node);
+    if (node.externalKeyword != null) {
+      element.external = true;
+    }
+    if (node.factoryKeyword != null) {
+      element.factory = true;
+    }
+    element.functions = holder.functions;
+    element.labels = holder.labels;
+    element.localVariables = holder.localVariables;
+    element.parameters = holder.parameters;
+    element.isConst = node.constKeyword != null;
+    if (body.isAsynchronous) {
+      element.asynchronous = true;
+    }
+    if (body.isGenerator) {
+      element.generator = true;
+    }
+    _currentHolder.addConstructor(element);
+    node.element = element;
+    if (constructorName == null) {
+      Identifier returnType = node.returnType;
+      if (returnType != null) {
+        element.nameOffset = returnType.offset;
+        element.nameEnd = returnType.end;
+      }
+    } else {
+      constructorName.staticElement = element;
+      element.periodOffset = node.period.offset;
+      element.nameEnd = constructorName.end;
+    }
+    holder.validate();
+    return null;
+  }
+
+  @override
+  Object visitEnumDeclaration(EnumDeclaration node) {
+    SimpleIdentifier enumName = node.name;
+    EnumElementImpl enumElement = new EnumElementImpl.forNode(enumName);
+    _setCodeRange(enumElement, node);
+    enumElement.metadata = _createElementAnnotations(node.metadata);
+    setElementDocumentationComment(enumElement, node);
+    InterfaceTypeImpl enumType = enumElement.type;
+    //
+    // Build the elements for the constants. These are minimal elements; the
+    // rest of the constant elements (and elements for other fields) must be
+    // built later after we can access the type provider.
+    //
+    List<FieldElement> fields = new List<FieldElement>();
+    NodeList<EnumConstantDeclaration> constants = node.constants;
+    for (EnumConstantDeclaration constant in constants) {
+      SimpleIdentifier constantName = constant.name;
+      FieldElementImpl constantField =
+          new ConstFieldElementImpl.forNode(constantName);
+      constantField.isStatic = true;
+      constantField.isConst = true;
+      constantField.type = enumType;
+      setElementDocumentationComment(constantField, constant);
+      fields.add(constantField);
+      new PropertyAccessorElementImpl_ImplicitGetter(constantField);
+      constantName.staticElement = constantField;
+    }
+    enumElement.fields = fields;
+
+    _currentHolder.addEnum(enumElement);
+    enumName.staticElement = enumElement;
+    return super.visitEnumDeclaration(node);
+  }
+
+  @override
+  Object visitExportDirective(ExportDirective node) {
+    List<ElementAnnotation> annotations =
+        _createElementAnnotations(node.metadata);
+    _unitElement.setAnnotations(node.offset, annotations);
+    return super.visitExportDirective(node);
+  }
+
+  @override
+  Object visitExpressionFunctionBody(ExpressionFunctionBody node) {
+    return null;
+  }
+
+  @override
+  Object visitFieldFormalParameter(FieldFormalParameter node) {
+    if (node.parent is! DefaultFormalParameter) {
+      SimpleIdentifier parameterName = node.identifier;
+      FieldElement field =
+          _fieldMap == null ? null : _fieldMap[parameterName.name];
+      FieldFormalParameterElementImpl parameter =
+          new FieldFormalParameterElementImpl.forNode(parameterName);
+      _setCodeRange(parameter, node);
+      parameter.isConst = node.isConst;
+      parameter.isFinal = node.isFinal;
+      parameter.parameterKind = node.kind;
+      if (field != null) {
+        parameter.field = field;
+      }
+      _currentHolder.addParameter(parameter);
+      parameterName.staticElement = parameter;
+    }
+    //
+    // The children of this parameter include any parameters defined on the type
+    // of this parameter.
+    //
+    ElementHolder holder = new ElementHolder();
+    _visitChildren(holder, node);
+    ParameterElementImpl element = node.element;
+    element.metadata = _createElementAnnotations(node.metadata);
+    element.parameters = holder.parameters;
+    element.typeParameters = holder.typeParameters;
+    holder.validate();
+    return null;
+  }
+
+  @override
+  Object visitFunctionDeclaration(FunctionDeclaration node) {
+    FunctionExpression expression = node.functionExpression;
+    if (expression != null) {
+      ElementHolder holder = new ElementHolder();
+      _visitChildren(holder, node);
+      FunctionBody body = expression.body;
+      Token property = node.propertyKeyword;
+      if (property == null) {
+        SimpleIdentifier functionName = node.name;
+        FunctionElementImpl element =
+            new FunctionElementImpl.forNode(functionName);
+        _setCodeRange(element, node);
+        element.metadata = _createElementAnnotations(node.metadata);
+        setElementDocumentationComment(element, node);
+        if (node.externalKeyword != null) {
+          element.external = true;
+        }
+        element.functions = holder.functions;
+        element.labels = holder.labels;
+        element.localVariables = holder.localVariables;
+        element.parameters = holder.parameters;
+        element.typeParameters = holder.typeParameters;
+        if (body.isAsynchronous) {
+          element.asynchronous = true;
+        }
+        if (body.isGenerator) {
+          element.generator = true;
+        }
+        if (node.returnType == null) {
+          element.hasImplicitReturnType = true;
+        }
+        _currentHolder.addFunction(element);
+        expression.element = element;
+        functionName.staticElement = element;
+      } else {
+        SimpleIdentifier propertyNameNode = node.name;
+        if (propertyNameNode == null) {
+          // TODO(brianwilkerson) Report this internal error.
+          return null;
+        }
+        String propertyName = propertyNameNode.name;
+        TopLevelVariableElementImpl variable = _currentHolder
+            .getTopLevelVariable(propertyName) as TopLevelVariableElementImpl;
+        if (variable == null) {
+          variable = new TopLevelVariableElementImpl(node.name.name, -1);
+          variable.isFinal = true;
+          variable.isSynthetic = true;
+          _currentHolder.addTopLevelVariable(variable);
+        }
+        if (node.isGetter) {
+          PropertyAccessorElementImpl getter =
+              new PropertyAccessorElementImpl.forNode(propertyNameNode);
+          _setCodeRange(getter, node);
+          getter.metadata = _createElementAnnotations(node.metadata);
+          setElementDocumentationComment(getter, node);
+          if (node.externalKeyword != null) {
+            getter.external = true;
+          }
+          getter.functions = holder.functions;
+          getter.labels = holder.labels;
+          getter.localVariables = holder.localVariables;
+          if (body.isAsynchronous) {
+            getter.asynchronous = true;
+          }
+          if (body.isGenerator) {
+            getter.generator = true;
+          }
+          getter.variable = variable;
+          getter.getter = true;
+          getter.isStatic = true;
+          variable.getter = getter;
+          if (node.returnType == null) {
+            getter.hasImplicitReturnType = true;
+          }
+          _currentHolder.addAccessor(getter);
+          expression.element = getter;
+          propertyNameNode.staticElement = getter;
+        } else {
+          PropertyAccessorElementImpl setter =
+              new PropertyAccessorElementImpl.forNode(propertyNameNode);
+          _setCodeRange(setter, node);
+          setter.metadata = _createElementAnnotations(node.metadata);
+          setElementDocumentationComment(setter, node);
+          if (node.externalKeyword != null) {
+            setter.external = true;
+          }
+          setter.functions = holder.functions;
+          setter.labels = holder.labels;
+          setter.localVariables = holder.localVariables;
+          setter.parameters = holder.parameters;
+          if (body.isAsynchronous) {
+            setter.asynchronous = true;
+          }
+          if (body.isGenerator) {
+            setter.generator = true;
+          }
+          setter.variable = variable;
+          setter.setter = true;
+          setter.isStatic = true;
+          if (node.returnType == null) {
+            setter.hasImplicitReturnType = true;
+          }
+          variable.setter = setter;
+          variable.isFinal = false;
+          _currentHolder.addAccessor(setter);
+          expression.element = setter;
+          propertyNameNode.staticElement = setter;
+        }
+      }
+      holder.validate();
+    }
+    return null;
+  }
+
+  @override
+  Object visitFunctionExpression(FunctionExpression node) {
+    if (node.parent is FunctionDeclaration) {
+      // visitFunctionDeclaration has already created the element for the
+      // declaration.  We just need to visit children.
+      return super.visitFunctionExpression(node);
+    }
+    ElementHolder holder = new ElementHolder();
+    _visitChildren(holder, node);
+    FunctionBody body = node.body;
+    FunctionElementImpl element =
+        new FunctionElementImpl.forOffset(node.beginToken.offset);
+    _setCodeRange(element, node);
+    element.functions = holder.functions;
+    element.labels = holder.labels;
+    element.localVariables = holder.localVariables;
+    element.parameters = holder.parameters;
+    element.typeParameters = holder.typeParameters;
+    if (body.isAsynchronous) {
+      element.asynchronous = true;
+    }
+    if (body.isGenerator) {
+      element.generator = true;
+    }
+    element.type = new FunctionTypeImpl(element);
+    element.hasImplicitReturnType = true;
+    _currentHolder.addFunction(element);
+    node.element = element;
+    holder.validate();
+    return null;
+  }
+
+  @override
+  Object visitFunctionTypeAlias(FunctionTypeAlias node) {
+    ElementHolder holder = new ElementHolder();
+    _visitChildren(holder, node);
+    SimpleIdentifier aliasName = node.name;
+    List<ParameterElement> parameters = holder.parameters;
+    List<TypeParameterElement> typeParameters = holder.typeParameters;
+    FunctionTypeAliasElementImpl element =
+        new FunctionTypeAliasElementImpl.forNode(aliasName);
+    _setCodeRange(element, node);
+    element.metadata = _createElementAnnotations(node.metadata);
+    setElementDocumentationComment(element, node);
+    element.parameters = parameters;
+    element.typeParameters = typeParameters;
+    _createTypeParameterTypes(typeParameters);
+    element.type = new FunctionTypeImpl.forTypedef(element);
+    _currentHolder.addTypeAlias(element);
+    aliasName.staticElement = element;
+    holder.validate();
+    return null;
+  }
+
+  @override
+  Object visitImportDirective(ImportDirective node) {
+    List<ElementAnnotation> annotations =
+        _createElementAnnotations(node.metadata);
+    _unitElement.setAnnotations(node.offset, annotations);
+    return super.visitImportDirective(node);
+  }
+
+  @override
+  Object visitLibraryDirective(LibraryDirective node) {
+    List<ElementAnnotation> annotations =
+        _createElementAnnotations(node.metadata);
+    _unitElement.setAnnotations(node.offset, annotations);
+    return super.visitLibraryDirective(node);
+  }
+
+  @override
+  Object visitMethodDeclaration(MethodDeclaration node) {
+    try {
+      ElementHolder holder = new ElementHolder();
+      _visitChildren(holder, node);
+      bool isStatic = node.isStatic;
+      Token property = node.propertyKeyword;
+      FunctionBody body = node.body;
+      if (property == null) {
+        SimpleIdentifier methodName = node.name;
+        String nameOfMethod = methodName.name;
+        if (nameOfMethod == TokenType.MINUS.lexeme &&
+            node.parameters.parameters.length == 0) {
+          nameOfMethod = "unary-";
+        }
+        MethodElementImpl element =
+            new MethodElementImpl(nameOfMethod, methodName.offset);
+        _setCodeRange(element, node);
+        element.metadata = _createElementAnnotations(node.metadata);
+        setElementDocumentationComment(element, node);
+        element.abstract = node.isAbstract;
+        if (node.externalKeyword != null) {
+          element.external = true;
+        }
+        element.functions = holder.functions;
+        element.labels = holder.labels;
+        element.localVariables = holder.localVariables;
+        element.parameters = holder.parameters;
+        element.isStatic = isStatic;
+        element.typeParameters = holder.typeParameters;
+        if (body.isAsynchronous) {
+          element.asynchronous = true;
+        }
+        if (body.isGenerator) {
+          element.generator = true;
+        }
+        if (node.returnType == null) {
+          element.hasImplicitReturnType = true;
+        }
+        _currentHolder.addMethod(element);
+        methodName.staticElement = element;
+      } else {
+        SimpleIdentifier propertyNameNode = node.name;
+        String propertyName = propertyNameNode.name;
+        FieldElementImpl field = _currentHolder.getField(propertyName,
+            synthetic: true) as FieldElementImpl;
+        if (field == null) {
+          field = new FieldElementImpl(node.name.name, -1);
+          field.isFinal = true;
+          field.isStatic = isStatic;
+          field.isSynthetic = true;
+          _currentHolder.addField(field);
+        }
+        if (node.isGetter) {
+          PropertyAccessorElementImpl getter =
+              new PropertyAccessorElementImpl.forNode(propertyNameNode);
+          _setCodeRange(getter, node);
+          getter.metadata = _createElementAnnotations(node.metadata);
+          setElementDocumentationComment(getter, node);
+          if (node.externalKeyword != null) {
+            getter.external = true;
+          }
+          getter.functions = holder.functions;
+          getter.labels = holder.labels;
+          getter.localVariables = holder.localVariables;
+          if (body.isAsynchronous) {
+            getter.asynchronous = true;
+          }
+          if (body.isGenerator) {
+            getter.generator = true;
+          }
+          getter.variable = field;
+          getter.abstract = node.isAbstract;
+          getter.getter = true;
+          getter.isStatic = isStatic;
+          field.getter = getter;
+          if (node.returnType == null) {
+            getter.hasImplicitReturnType = true;
+          }
+          _currentHolder.addAccessor(getter);
+          propertyNameNode.staticElement = getter;
+        } else {
+          PropertyAccessorElementImpl setter =
+              new PropertyAccessorElementImpl.forNode(propertyNameNode);
+          _setCodeRange(setter, node);
+          setter.metadata = _createElementAnnotations(node.metadata);
+          setElementDocumentationComment(setter, node);
+          if (node.externalKeyword != null) {
+            setter.external = true;
+          }
+          setter.functions = holder.functions;
+          setter.labels = holder.labels;
+          setter.localVariables = holder.localVariables;
+          setter.parameters = holder.parameters;
+          if (body.isAsynchronous) {
+            setter.asynchronous = true;
+          }
+          if (body.isGenerator) {
+            setter.generator = true;
+          }
+          setter.variable = field;
+          setter.abstract = node.isAbstract;
+          setter.setter = true;
+          setter.isStatic = isStatic;
+          if (node.returnType == null) {
+            setter.hasImplicitReturnType = true;
+          }
+          field.setter = setter;
+          field.isFinal = false;
+          _currentHolder.addAccessor(setter);
+          propertyNameNode.staticElement = setter;
+        }
+      }
+      holder.validate();
+    } catch (exception, stackTrace) {
+      if (node.name.staticElement == null) {
+        ClassDeclaration classNode =
+            node.getAncestor((node) => node is ClassDeclaration);
+        StringBuffer buffer = new StringBuffer();
+        buffer.write("The element for the method ");
+        buffer.write(node.name);
+        buffer.write(" in ");
+        buffer.write(classNode.name);
+        buffer.write(" was not set while trying to build the element model.");
+        AnalysisEngine.instance.logger.logError(
+            buffer.toString(), new CaughtException(exception, stackTrace));
+      } else {
+        String message =
+            "Exception caught in ElementBuilder.visitMethodDeclaration()";
+        AnalysisEngine.instance.logger
+            .logError(message, new CaughtException(exception, stackTrace));
+      }
+    } finally {
+      if (node.name.staticElement == null) {
+        ClassDeclaration classNode =
+            node.getAncestor((node) => node is ClassDeclaration);
+        StringBuffer buffer = new StringBuffer();
+        buffer.write("The element for the method ");
+        buffer.write(node.name);
+        buffer.write(" in ");
+        buffer.write(classNode.name);
+        buffer.write(" was not set while trying to resolve types.");
+        AnalysisEngine.instance.logger.logError(
+            buffer.toString(),
+            new CaughtException(
+                new AnalysisException(buffer.toString()), null));
+      }
+    }
+    return null;
+  }
+
+  @override
+  Object visitPartDirective(PartDirective node) {
+    List<ElementAnnotation> annotations =
+        _createElementAnnotations(node.metadata);
+    _unitElement.setAnnotations(node.offset, annotations);
+    return super.visitPartDirective(node);
+  }
+
+  @override
+  Object visitVariableDeclaration(VariableDeclaration node) {
+    bool isConst = node.isConst;
+    bool isFinal = node.isFinal;
+    Expression initializerNode = node.initializer;
+    bool hasInitializer = initializerNode != null;
+    VariableDeclarationList varList = node.parent;
+    FieldDeclaration fieldNode =
+        varList.parent is FieldDeclaration ? varList.parent : null;
+    VariableElementImpl element;
+    if (fieldNode != null) {
+      SimpleIdentifier fieldName = node.name;
+      FieldElementImpl field;
+      if ((isConst || isFinal && !fieldNode.isStatic) && hasInitializer) {
+        field = new ConstFieldElementImpl.forNode(fieldName);
+      } else {
+        field = new FieldElementImpl.forNode(fieldName);
+      }
+      element = field;
+      field.isStatic = fieldNode.isStatic;
+      _setCodeRange(element, node);
+      setElementDocumentationComment(element, fieldNode);
+      field.hasImplicitType = varList.type == null;
+      _currentHolder.addField(field);
+      fieldName.staticElement = field;
+    } else {
+      SimpleIdentifier variableName = node.name;
+      TopLevelVariableElementImpl variable;
+      if (isConst && hasInitializer) {
+        variable = new ConstTopLevelVariableElementImpl.forNode(variableName);
+      } else {
+        variable = new TopLevelVariableElementImpl.forNode(variableName);
+      }
+      element = variable;
+      _setCodeRange(element, node);
+      if (varList.parent is TopLevelVariableDeclaration) {
+        setElementDocumentationComment(element, varList.parent);
+      }
+      variable.hasImplicitType = varList.type == null;
+      _currentHolder.addTopLevelVariable(variable);
+      variableName.staticElement = element;
+    }
+    element.isConst = isConst;
+    element.isFinal = isFinal;
+    if (element is PropertyInducingElementImpl) {
+      PropertyAccessorElementImpl_ImplicitGetter getter =
+          new PropertyAccessorElementImpl_ImplicitGetter(element);
+      _currentHolder.addAccessor(getter);
+      if (!isConst && !isFinal) {
+        PropertyAccessorElementImpl_ImplicitSetter setter =
+            new PropertyAccessorElementImpl_ImplicitSetter(element);
+        _currentHolder.addAccessor(setter);
+      }
+    }
+    return null;
+  }
+
+  @override
+  Object visitVariableDeclarationList(VariableDeclarationList node) {
+    super.visitVariableDeclarationList(node);
+    AstNode parent = node.parent;
+    List<ElementAnnotation> elementAnnotations;
+    if (parent is FieldDeclaration) {
+      elementAnnotations = _createElementAnnotations(parent.metadata);
+    } else if (parent is TopLevelVariableDeclaration) {
+      elementAnnotations = _createElementAnnotations(parent.metadata);
+    } else {
+      // Local variable declaration
+      elementAnnotations = _createElementAnnotations(node.metadata);
+    }
+    _setVariableDeclarationListAnnotations(node, elementAnnotations);
+    return null;
+  }
+
+  /**
+   * Build the table mapping field names to field elements for the [fields]
+   * defined in the current class.
+   */
+  void _buildFieldMap(List<FieldElement> fields) {
+    _fieldMap = new HashMap<String, FieldElement>();
+    int count = fields.length;
+    for (int i = 0; i < count; i++) {
+      FieldElement field = fields[i];
+      _fieldMap[field.name] ??= field;
+    }
+  }
+
+  /**
+   * Creates the [ConstructorElement]s array with the single default constructor element.
+   *
+   * @param interfaceType the interface type for which to create a default constructor
+   * @return the [ConstructorElement]s array with the single default constructor element
+   */
+  List<ConstructorElement> _createDefaultConstructors(
+      ClassElementImpl definingClass) {
+    ConstructorElementImpl constructor =
+        new ConstructorElementImpl.forNode(null);
+    constructor.isSynthetic = true;
+    constructor.enclosingElement = definingClass;
+    return <ConstructorElement>[constructor];
+  }
+
+  /**
+   * Create the types associated with the given type parameters, setting the type of each type
+   * parameter, and return an array of types corresponding to the given parameters.
+   *
+   * @param typeParameters the type parameters for which types are to be created
+   * @return an array of types corresponding to the given parameters
+   */
+  List<DartType> _createTypeParameterTypes(
+      List<TypeParameterElement> typeParameters) {
+    int typeParameterCount = typeParameters.length;
+    List<DartType> typeArguments = new List<DartType>(typeParameterCount);
+    for (int i = 0; i < typeParameterCount; i++) {
+      TypeParameterElementImpl typeParameter =
+          typeParameters[i] as TypeParameterElementImpl;
+      TypeParameterTypeImpl typeParameterType =
+          new TypeParameterTypeImpl(typeParameter);
+      typeParameter.type = typeParameterType;
+      typeArguments[i] = typeParameterType;
+    }
+    return typeArguments;
+  }
+
+  @override
+  void _setFieldParameterField(FieldFormalParameterElementImpl parameter) {
+    FieldElement field = _fieldMap == null ? null : _fieldMap[parameter.name];
+    if (field != null) {
+      parameter.field = field;
+    }
+  }
+}
+
+/**
  * A `CompilationUnitBuilder` builds an element model for a single compilation
  * unit.
  */
@@ -154,7 +867,7 @@
     if (!explicitlyImportsCore && coreLibrarySource != librarySource) {
       ImportElementImpl importElement = new ImportElementImpl(-1);
       importElement.importedLibrary = importLibraryMap[coreLibrarySource];
-      importElement.synthetic = true;
+      importElement.isSynthetic = true;
       imports.add(importElement);
     }
     //
@@ -309,73 +1022,67 @@
  * Instances of the class `ElementBuilder` traverse an AST structure and build the element
  * model representing the AST structure.
  */
-class ElementBuilder extends RecursiveAstVisitor<Object> {
-  /**
-   * The compilation unit element into which the elements being built will be
-   * stored.
-   */
-  final CompilationUnitElementImpl compilationUnitElement;
-
-  /**
-   * The element holder associated with the element that is currently being built.
-   */
-  ElementHolder _currentHolder;
-
-  /**
-   * A flag indicating whether a variable declaration is within the body of a method or function.
-   */
-  bool _inFunction = false;
-
-  /**
-   * A collection holding the elements defined in a class that need to have
-   * their function type fixed to take into account type parameters of the
-   * enclosing class, or `null` if we are not currently processing nodes within
-   * a class.
-   */
-  List<ExecutableElementImpl> _functionTypesToFix = null;
-
-  /**
-   * A table mapping field names to field elements for the fields defined in the current class, or
-   * `null` if we are not in the scope of a class.
-   */
-  HashMap<String, FieldElement> _fieldMap;
-
+class ElementBuilder extends ApiElementBuilder {
   /**
    * Initialize a newly created element builder to build the elements for a
    * compilation unit. The [initialHolder] is the element holder to which the
    * children of the visited compilation unit node will be added.
    */
-  ElementBuilder(ElementHolder initialHolder, this.compilationUnitElement) {
-    _currentHolder = initialHolder;
-  }
-
-  /**
-   * Prepares for incremental resolution of a function body.
-   */
-  void initForFunctionBodyIncrementalResolution() {
-    _inFunction = true;
-  }
+  ElementBuilder(ElementHolder initialHolder,
+      CompilationUnitElement compilationUnitElement)
+      : super(initialHolder, compilationUnitElement);
 
   @override
-  Object visitAnnotation(Annotation node) {
-    // Although it isn't valid to do so because closures are not constant
-    // expressions, it's possible for one of the arguments to the constructor to
-    // contain a closure. Wrapping the processing of the annotation this way
-    // prevents these closures from being added to the list of functions in the
-    // annotated declaration.
-    ElementHolder holder = new ElementHolder();
-    ElementHolder previousHolder = _currentHolder;
-    _currentHolder = holder;
-    try {
-      super.visitAnnotation(node);
-    } finally {
-      _currentHolder = previousHolder;
-    }
+  Object visitBlockFunctionBody(BlockFunctionBody node) {
+    _buildLocal(node);
     return null;
   }
 
   @override
-  Object visitCatchClause(CatchClause node) {
+  Object visitDefaultFormalParameter(DefaultFormalParameter node) {
+    super.visitDefaultFormalParameter(node);
+    buildParameterInitializer(
+        node.element as ParameterElementImpl, node.defaultValue);
+    return null;
+  }
+
+  @override
+  Object visitExpressionFunctionBody(ExpressionFunctionBody node) {
+    _buildLocal(node);
+    return null;
+  }
+
+  @override
+  Object visitVariableDeclaration(VariableDeclaration node) {
+    super.visitVariableDeclaration(node);
+    VariableElementImpl element = node.element as VariableElementImpl;
+    buildVariableInitializer(element, node.initializer);
+    return null;
+  }
+
+  void _buildLocal(AstNode node) {
+    node.accept(new LocalElementBuilder(_currentHolder, _unitElement));
+  }
+}
+
+/**
+ * Traverse a [FunctionBody] and build elements for AST structures.
+ */
+class LocalElementBuilder extends _BaseElementBuilder {
+  /**
+   * Initialize a newly created element builder to build the elements for a
+   * compilation unit. The [initialHolder] is the element holder to which the
+   * children of the visited compilation unit node will be added.
+   */
+  LocalElementBuilder(ElementHolder initialHolder,
+      CompilationUnitElementImpl compilationUnitElement)
+      : super(initialHolder, compilationUnitElement);
+
+  /**
+   * Builds the variable elements associated with [node] and stores them in
+   * the element holder.
+   */
+  void buildCatchVariableElements(CatchClause node) {
     SimpleIdentifier exceptionParameter = node.exceptionParameter;
     if (exceptionParameter != null) {
       // exception
@@ -398,137 +1105,30 @@
         stackTraceParameter.staticElement = stackTrace;
       }
     }
+  }
+
+  /**
+   * Builds the label elements associated with [labels] and stores them in the
+   * element holder.
+   */
+  void buildLabelElements(
+      NodeList<Label> labels, bool onSwitchStatement, bool onSwitchMember) {
+    for (Label label in labels) {
+      SimpleIdentifier labelName = label.label;
+      LabelElementImpl element = new LabelElementImpl.forNode(
+          labelName, onSwitchStatement, onSwitchMember);
+      labelName.staticElement = element;
+      _currentHolder.addLabel(element);
+    }
+  }
+
+  @override
+  Object visitCatchClause(CatchClause node) {
+    buildCatchVariableElements(node);
     return super.visitCatchClause(node);
   }
 
   @override
-  Object visitClassDeclaration(ClassDeclaration node) {
-    ElementHolder holder = new ElementHolder();
-    _functionTypesToFix = new List<ExecutableElementImpl>();
-    //
-    // Process field declarations before constructors and methods so that field
-    // formal parameters can be correctly resolved to their fields.
-    //
-    ElementHolder previousHolder = _currentHolder;
-    _currentHolder = holder;
-    try {
-      List<ClassMember> nonFields = new List<ClassMember>();
-      node.visitChildren(
-          new _ElementBuilder_visitClassDeclaration(this, nonFields));
-      _buildFieldMap(holder.fieldsWithoutFlushing);
-      int count = nonFields.length;
-      for (int i = 0; i < count; i++) {
-        nonFields[i].accept(this);
-      }
-    } finally {
-      _currentHolder = previousHolder;
-    }
-    SimpleIdentifier className = node.name;
-    ClassElementImpl element = new ClassElementImpl.forNode(className);
-    _setCodeRange(element, node);
-    element.metadata = _createElementAnnotations(node.metadata);
-    element.typeParameters = holder.typeParameters;
-    setElementDocumentationComment(element, node);
-    element.abstract = node.isAbstract;
-    element.accessors = holder.accessors;
-    List<ConstructorElement> constructors = holder.constructors;
-    if (constructors.isEmpty) {
-      constructors = _createDefaultConstructors(element);
-    }
-    element.constructors = constructors;
-    element.fields = holder.fields;
-    element.methods = holder.methods;
-    // Function types must be initialized after the enclosing element has been
-    // set, for them to pick up the type parameters.
-    for (ExecutableElementImpl e in _functionTypesToFix) {
-      e.type = new FunctionTypeImpl(e);
-    }
-    _functionTypesToFix = null;
-    _currentHolder.addType(element);
-    className.staticElement = element;
-    _fieldMap = null;
-    holder.validate();
-    return null;
-  }
-
-  @override
-  Object visitClassTypeAlias(ClassTypeAlias node) {
-    ElementHolder holder = new ElementHolder();
-    _visitChildren(holder, node);
-    SimpleIdentifier className = node.name;
-    ClassElementImpl element = new ClassElementImpl.forNode(className);
-    _setCodeRange(element, node);
-    element.metadata = _createElementAnnotations(node.metadata);
-    element.abstract = node.abstractKeyword != null;
-    element.mixinApplication = true;
-    element.typeParameters = holder.typeParameters;
-    setElementDocumentationComment(element, node);
-    _currentHolder.addType(element);
-    className.staticElement = element;
-    holder.validate();
-    return null;
-  }
-
-  @override
-  Object visitCompilationUnit(CompilationUnit node) {
-    if (compilationUnitElement is ElementImpl) {
-      _setCodeRange(compilationUnitElement, node);
-    }
-    return super.visitCompilationUnit(node);
-  }
-
-  @override
-  Object visitConstructorDeclaration(ConstructorDeclaration node) {
-    ElementHolder holder = new ElementHolder();
-    bool wasInFunction = _inFunction;
-    _inFunction = true;
-    try {
-      _visitChildren(holder, node);
-    } finally {
-      _inFunction = wasInFunction;
-    }
-    FunctionBody body = node.body;
-    SimpleIdentifier constructorName = node.name;
-    ConstructorElementImpl element =
-        new ConstructorElementImpl.forNode(constructorName);
-    _setCodeRange(element, node);
-    element.metadata = _createElementAnnotations(node.metadata);
-    setElementDocumentationComment(element, node);
-    if (node.externalKeyword != null) {
-      element.external = true;
-    }
-    if (node.factoryKeyword != null) {
-      element.factory = true;
-    }
-    element.functions = holder.functions;
-    element.labels = holder.labels;
-    element.localVariables = holder.localVariables;
-    element.parameters = holder.parameters;
-    element.const2 = node.constKeyword != null;
-    if (body.isAsynchronous) {
-      element.asynchronous = true;
-    }
-    if (body.isGenerator) {
-      element.generator = true;
-    }
-    _currentHolder.addConstructor(element);
-    node.element = element;
-    if (constructorName == null) {
-      Identifier returnType = node.returnType;
-      if (returnType != null) {
-        element.nameOffset = returnType.offset;
-        element.nameEnd = returnType.end;
-      }
-    } else {
-      constructorName.staticElement = element;
-      element.periodOffset = node.period.offset;
-      element.nameEnd = constructorName.end;
-    }
-    holder.validate();
-    return null;
-  }
-
-  @override
   Object visitDeclaredIdentifier(DeclaredIdentifier node) {
     SimpleIdentifier variableName = node.identifier;
     LocalVariableElementImpl element =
@@ -537,265 +1137,70 @@
     element.metadata = _createElementAnnotations(node.metadata);
     ForEachStatement statement = node.parent as ForEachStatement;
     element.setVisibleRange(statement.offset, statement.length);
-    element.const3 = node.isConst;
-    element.final2 = node.isFinal;
+    element.isConst = node.isConst;
+    element.isFinal = node.isFinal;
     if (node.type == null) {
       element.hasImplicitType = true;
     }
     _currentHolder.addLocalVariable(element);
     variableName.staticElement = element;
-    return super.visitDeclaredIdentifier(node);
-  }
-
-  @override
-  Object visitDefaultFormalParameter(DefaultFormalParameter node) {
-    ElementHolder holder = new ElementHolder();
-    NormalFormalParameter normalParameter = node.parameter;
-    SimpleIdentifier parameterName = normalParameter.identifier;
-    ParameterElementImpl parameter;
-    if (normalParameter is FieldFormalParameter) {
-      parameter =
-          new DefaultFieldFormalParameterElementImpl.forNode(parameterName);
-      FieldElement field =
-          _fieldMap == null ? null : _fieldMap[parameterName.name];
-      if (field != null) {
-        (parameter as DefaultFieldFormalParameterElementImpl).field = field;
-      }
-    } else {
-      parameter = new DefaultParameterElementImpl.forNode(parameterName);
-    }
-    _setCodeRange(parameter, node);
-    parameter.const3 = node.isConst;
-    parameter.final2 = node.isFinal;
-    parameter.parameterKind = node.kind;
-    // set initializer, default value range
-    Expression defaultValue = node.defaultValue;
-    if (defaultValue != null) {
-      _visit(holder, defaultValue);
-      FunctionElementImpl initializer =
-          new FunctionElementImpl.forOffset(defaultValue.beginToken.offset);
-      initializer.hasImplicitReturnType = true;
-      initializer.functions = holder.functions;
-      initializer.labels = holder.labels;
-      initializer.localVariables = holder.localVariables;
-      initializer.parameters = holder.parameters;
-      initializer.synthetic = true;
-      initializer.type = new FunctionTypeImpl(initializer);
-      parameter.initializer = initializer;
-      parameter.defaultValueCode = defaultValue.toSource();
-    }
-    // visible range
-    _setParameterVisibleRange(node, parameter);
-    if (normalParameter is SimpleFormalParameter &&
-        normalParameter.type == null) {
-      parameter.hasImplicitType = true;
-    }
-    _currentHolder.addParameter(parameter);
-    parameterName.staticElement = parameter;
-    normalParameter.accept(this);
-    holder.validate();
     return null;
   }
 
   @override
-  Object visitEnumDeclaration(EnumDeclaration node) {
-    SimpleIdentifier enumName = node.name;
-    EnumElementImpl enumElement = new EnumElementImpl.forNode(enumName);
-    _setCodeRange(enumElement, node);
-    enumElement.metadata = _createElementAnnotations(node.metadata);
-    setElementDocumentationComment(enumElement, node);
-    InterfaceTypeImpl enumType = enumElement.type;
-    //
-    // Build the elements for the constants. These are minimal elements; the
-    // rest of the constant elements (and elements for other fields) must be
-    // built later after we can access the type provider.
-    //
-    List<FieldElement> fields = new List<FieldElement>();
-    NodeList<EnumConstantDeclaration> constants = node.constants;
-    for (EnumConstantDeclaration constant in constants) {
-      SimpleIdentifier constantName = constant.name;
-      FieldElementImpl constantField =
-          new ConstFieldElementImpl.forNode(constantName);
-      constantField.static = true;
-      constantField.const3 = true;
-      constantField.type = enumType;
-      setElementDocumentationComment(constantField, constant);
-      fields.add(constantField);
-      new PropertyAccessorElementImpl_ImplicitGetter(constantField);
-      constantName.staticElement = constantField;
-    }
-    enumElement.fields = fields;
-
-    _currentHolder.addEnum(enumElement);
-    enumName.staticElement = enumElement;
-    return super.visitEnumDeclaration(node);
-  }
-
-  @override
-  Object visitExportDirective(ExportDirective node) {
-    List<ElementAnnotation> annotations =
-        _createElementAnnotations(node.metadata);
-    compilationUnitElement.setAnnotations(node.offset, annotations);
-    return super.visitExportDirective(node);
-  }
-
-  @override
-  Object visitFieldFormalParameter(FieldFormalParameter node) {
-    if (node.parent is! DefaultFormalParameter) {
-      SimpleIdentifier parameterName = node.identifier;
-      FieldElement field =
-          _fieldMap == null ? null : _fieldMap[parameterName.name];
-      FieldFormalParameterElementImpl parameter =
-          new FieldFormalParameterElementImpl.forNode(parameterName);
-      _setCodeRange(parameter, node);
-      parameter.const3 = node.isConst;
-      parameter.final2 = node.isFinal;
-      parameter.parameterKind = node.kind;
-      if (field != null) {
-        parameter.field = field;
-      }
-      _currentHolder.addParameter(parameter);
-      parameterName.staticElement = parameter;
-    }
-    //
-    // The children of this parameter include any parameters defined on the type
-    // of this parameter.
-    //
-    ElementHolder holder = new ElementHolder();
-    _visitChildren(holder, node);
-    ParameterElementImpl element = node.element;
-    element.metadata = _createElementAnnotations(node.metadata);
-    element.parameters = holder.parameters;
-    element.typeParameters = holder.typeParameters;
-    holder.validate();
+  Object visitDefaultFormalParameter(DefaultFormalParameter node) {
+    super.visitDefaultFormalParameter(node);
+    buildParameterInitializer(
+        node.element as ParameterElementImpl, node.defaultValue);
     return null;
   }
 
   @override
   Object visitFunctionDeclaration(FunctionDeclaration node) {
     FunctionExpression expression = node.functionExpression;
-    if (expression != null) {
-      ElementHolder holder = new ElementHolder();
-      bool wasInFunction = _inFunction;
-      _inFunction = true;
-      try {
-        _visitChildren(holder, node);
-      } finally {
-        _inFunction = wasInFunction;
-      }
-      FunctionBody body = expression.body;
-      Token property = node.propertyKeyword;
-      if (property == null || _inFunction) {
-        SimpleIdentifier functionName = node.name;
-        FunctionElementImpl element =
-            new FunctionElementImpl.forNode(functionName);
-        _setCodeRange(element, node);
-        element.metadata = _createElementAnnotations(node.metadata);
-        setElementDocumentationComment(element, node);
-        if (node.externalKeyword != null) {
-          element.external = true;
-        }
-        element.functions = holder.functions;
-        element.labels = holder.labels;
-        element.localVariables = holder.localVariables;
-        element.parameters = holder.parameters;
-        element.typeParameters = holder.typeParameters;
-        if (body.isAsynchronous) {
-          element.asynchronous = true;
-        }
-        if (body.isGenerator) {
-          element.generator = true;
-        }
-        if (_inFunction) {
-          Block enclosingBlock = node.getAncestor((node) => node is Block);
-          if (enclosingBlock != null) {
-            element.setVisibleRange(
-                enclosingBlock.offset, enclosingBlock.length);
-          }
-        }
-        if (node.returnType == null) {
-          element.hasImplicitReturnType = true;
-        }
-        _currentHolder.addFunction(element);
-        expression.element = element;
-        functionName.staticElement = element;
-      } else {
-        SimpleIdentifier propertyNameNode = node.name;
-        if (propertyNameNode == null) {
-          // TODO(brianwilkerson) Report this internal error.
-          return null;
-        }
-        String propertyName = propertyNameNode.name;
-        TopLevelVariableElementImpl variable = _currentHolder
-            .getTopLevelVariable(propertyName) as TopLevelVariableElementImpl;
-        if (variable == null) {
-          variable = new TopLevelVariableElementImpl(node.name.name, -1);
-          variable.final2 = true;
-          variable.synthetic = true;
-          _currentHolder.addTopLevelVariable(variable);
-        }
-        if (node.isGetter) {
-          PropertyAccessorElementImpl getter =
-              new PropertyAccessorElementImpl.forNode(propertyNameNode);
-          _setCodeRange(getter, node);
-          getter.metadata = _createElementAnnotations(node.metadata);
-          setElementDocumentationComment(getter, node);
-          if (node.externalKeyword != null) {
-            getter.external = true;
-          }
-          getter.functions = holder.functions;
-          getter.labels = holder.labels;
-          getter.localVariables = holder.localVariables;
-          if (body.isAsynchronous) {
-            getter.asynchronous = true;
-          }
-          if (body.isGenerator) {
-            getter.generator = true;
-          }
-          getter.variable = variable;
-          getter.getter = true;
-          getter.static = true;
-          variable.getter = getter;
-          if (node.returnType == null) {
-            getter.hasImplicitReturnType = true;
-          }
-          _currentHolder.addAccessor(getter);
-          expression.element = getter;
-          propertyNameNode.staticElement = getter;
-        } else {
-          PropertyAccessorElementImpl setter =
-              new PropertyAccessorElementImpl.forNode(propertyNameNode);
-          _setCodeRange(setter, node);
-          setter.metadata = _createElementAnnotations(node.metadata);
-          setElementDocumentationComment(setter, node);
-          if (node.externalKeyword != null) {
-            setter.external = true;
-          }
-          setter.functions = holder.functions;
-          setter.labels = holder.labels;
-          setter.localVariables = holder.localVariables;
-          setter.parameters = holder.parameters;
-          if (body.isAsynchronous) {
-            setter.asynchronous = true;
-          }
-          if (body.isGenerator) {
-            setter.generator = true;
-          }
-          setter.variable = variable;
-          setter.setter = true;
-          setter.static = true;
-          if (node.returnType == null) {
-            setter.hasImplicitReturnType = true;
-          }
-          variable.setter = setter;
-          variable.final2 = false;
-          _currentHolder.addAccessor(setter);
-          expression.element = setter;
-          propertyNameNode.staticElement = setter;
-        }
-      }
-      holder.validate();
+    if (expression == null) {
+      return null;
     }
+
+    ElementHolder holder = new ElementHolder();
+    _visitChildren(holder, node);
+
+    FunctionElementImpl element = new FunctionElementImpl.forNode(node.name);
+    _setCodeRange(element, node);
+    setElementDocumentationComment(element, node);
+    element.metadata = _createElementAnnotations(node.metadata);
+    if (node.externalKeyword != null) {
+      element.external = true;
+    }
+    element.functions = holder.functions;
+    element.labels = holder.labels;
+    element.localVariables = holder.localVariables;
+    element.parameters = holder.parameters;
+    element.typeParameters = holder.typeParameters;
+
+    FunctionBody body = expression.body;
+    if (body.isAsynchronous) {
+      element.asynchronous = body.isAsynchronous;
+    }
+    if (body.isGenerator) {
+      element.generator = true;
+    }
+
+    {
+      Block enclosingBlock = node.getAncestor((node) => node is Block);
+      if (enclosingBlock != null) {
+        element.setVisibleRange(enclosingBlock.offset, enclosingBlock.length);
+      }
+    }
+
+    if (node.returnType == null) {
+      element.hasImplicitReturnType = true;
+    }
+
+    _currentHolder.addFunction(element);
+    expression.element = element;
+    node.name.staticElement = element;
+    holder.validate();
     return null;
   }
 
@@ -806,15 +1211,9 @@
       // declaration.  We just need to visit children.
       return super.visitFunctionExpression(node);
     }
+
     ElementHolder holder = new ElementHolder();
-    bool wasInFunction = _inFunction;
-    _inFunction = true;
-    try {
-      _visitChildren(holder, node);
-    } finally {
-      _inFunction = wasInFunction;
-    }
-    FunctionBody body = node.body;
+    _visitChildren(holder, node);
     FunctionElementImpl element =
         new FunctionElementImpl.forOffset(node.beginToken.offset);
     _setCodeRange(element, node);
@@ -823,23 +1222,23 @@
     element.localVariables = holder.localVariables;
     element.parameters = holder.parameters;
     element.typeParameters = holder.typeParameters;
+
+    FunctionBody body = node.body;
     if (body.isAsynchronous) {
       element.asynchronous = true;
     }
     if (body.isGenerator) {
       element.generator = true;
     }
-    if (_inFunction) {
+
+    {
       Block enclosingBlock = node.getAncestor((node) => node is Block);
       if (enclosingBlock != null) {
         element.setVisibleRange(enclosingBlock.offset, enclosingBlock.length);
       }
     }
-    if (_functionTypesToFix != null) {
-      _functionTypesToFix.add(element);
-    } else {
-      element.type = new FunctionTypeImpl(element);
-    }
+
+    element.type = new FunctionTypeImpl(element);
     element.hasImplicitReturnType = true;
     _currentHolder.addFunction(element);
     node.element = element;
@@ -848,24 +1247,159 @@
   }
 
   @override
-  Object visitFunctionTypeAlias(FunctionTypeAlias node) {
-    ElementHolder holder = new ElementHolder();
-    _visitChildren(holder, node);
-    SimpleIdentifier aliasName = node.name;
-    List<ParameterElement> parameters = holder.parameters;
-    List<TypeParameterElement> typeParameters = holder.typeParameters;
-    FunctionTypeAliasElementImpl element =
-        new FunctionTypeAliasElementImpl.forNode(aliasName);
+  Object visitLabeledStatement(LabeledStatement node) {
+    bool onSwitchStatement = node.statement is SwitchStatement;
+    buildLabelElements(node.labels, onSwitchStatement, false);
+    return super.visitLabeledStatement(node);
+  }
+
+  @override
+  Object visitSwitchCase(SwitchCase node) {
+    buildLabelElements(node.labels, false, true);
+    return super.visitSwitchCase(node);
+  }
+
+  @override
+  Object visitSwitchDefault(SwitchDefault node) {
+    buildLabelElements(node.labels, false, true);
+    return super.visitSwitchDefault(node);
+  }
+
+  @override
+  Object visitVariableDeclaration(VariableDeclaration node) {
+    bool isConst = node.isConst;
+    bool isFinal = node.isFinal;
+    Expression initializerNode = node.initializer;
+    VariableDeclarationList varList = node.parent;
+    SimpleIdentifier variableName = node.name;
+    LocalVariableElementImpl element;
+    if (isConst && initializerNode != null) {
+      element = new ConstLocalVariableElementImpl.forNode(variableName);
+    } else {
+      element = new LocalVariableElementImpl.forNode(variableName);
+    }
     _setCodeRange(element, node);
-    element.metadata = _createElementAnnotations(node.metadata);
-    setElementDocumentationComment(element, node);
-    element.parameters = parameters;
-    element.typeParameters = typeParameters;
-    _createTypeParameterTypes(typeParameters);
-    element.type = new FunctionTypeImpl.forTypedef(element);
-    _currentHolder.addTypeAlias(element);
-    aliasName.staticElement = element;
-    holder.validate();
+    _setVariableVisibleRange(element, node);
+    element.hasImplicitType = varList.type == null;
+    _currentHolder.addLocalVariable(element);
+    variableName.staticElement = element;
+    element.isConst = isConst;
+    element.isFinal = isFinal;
+    buildVariableInitializer(element, initializerNode);
+    return null;
+  }
+
+  @override
+  Object visitVariableDeclarationList(VariableDeclarationList node) {
+    super.visitVariableDeclarationList(node);
+    List<ElementAnnotation> elementAnnotations =
+        _createElementAnnotations(node.metadata);
+    _setVariableDeclarationListAnnotations(node, elementAnnotations);
+    return null;
+  }
+
+  void _setVariableVisibleRange(
+      LocalVariableElementImpl element, VariableDeclaration node) {
+    AstNode scopeNode;
+    AstNode parent2 = node.parent.parent;
+    if (parent2 is ForStatement) {
+      scopeNode = parent2;
+    } else {
+      scopeNode = node.getAncestor((node) => node is Block);
+    }
+    element.setVisibleRange(scopeNode.offset, scopeNode.length);
+  }
+}
+
+/**
+ * Base class for API and local element builders.
+ */
+abstract class _BaseElementBuilder extends RecursiveAstVisitor<Object> {
+  /**
+   * The compilation unit element into which the elements being built will be
+   * stored.
+   */
+  final CompilationUnitElementImpl _unitElement;
+
+  /**
+   * The element holder associated with the element that is currently being built.
+   */
+  ElementHolder _currentHolder;
+
+  _BaseElementBuilder(this._currentHolder, this._unitElement);
+
+  /**
+   * If the [defaultValue] is not `null`, build the [FunctionElementImpl]
+   * that corresponds it, and set it as the initializer for the [parameter].
+   */
+  void buildParameterInitializer(
+      ParameterElementImpl parameter, Expression defaultValue) {
+    if (defaultValue != null) {
+      ElementHolder holder = new ElementHolder();
+      _visit(holder, defaultValue);
+      FunctionElementImpl initializer =
+          new FunctionElementImpl.forOffset(defaultValue.beginToken.offset);
+      initializer.hasImplicitReturnType = true;
+      initializer.functions = holder.functions;
+      initializer.labels = holder.labels;
+      initializer.localVariables = holder.localVariables;
+      initializer.parameters = holder.parameters;
+      initializer.isSynthetic = true;
+      initializer.type = new FunctionTypeImpl(initializer);
+      parameter.initializer = initializer;
+      parameter.defaultValueCode = defaultValue.toSource();
+      holder.validate();
+    }
+  }
+
+  /**
+   * If the [initializer] is not `null`, build the [FunctionElementImpl] that
+   * corresponds it, and set it as the initializer for the [variable].
+   */
+  void buildVariableInitializer(
+      VariableElementImpl variable, Expression initializer) {
+    if (initializer != null) {
+      ElementHolder holder = new ElementHolder();
+      _visit(holder, initializer);
+      FunctionElementImpl initializerElement =
+          new FunctionElementImpl.forOffset(initializer.beginToken.offset);
+      initializerElement.hasImplicitReturnType = true;
+      initializerElement.functions = holder.functions;
+      initializerElement.labels = holder.labels;
+      initializerElement.localVariables = holder.localVariables;
+      initializerElement.isSynthetic = true;
+      initializerElement.type = new FunctionTypeImpl(initializerElement);
+      variable.initializer = initializerElement;
+      holder.validate();
+    }
+  }
+
+  @override
+  Object visitDefaultFormalParameter(DefaultFormalParameter node) {
+    NormalFormalParameter normalParameter = node.parameter;
+    SimpleIdentifier parameterName = normalParameter.identifier;
+    ParameterElementImpl parameter;
+    if (normalParameter is FieldFormalParameter) {
+      DefaultFieldFormalParameterElementImpl fieldParameter =
+          new DefaultFieldFormalParameterElementImpl.forNode(parameterName);
+      _setFieldParameterField(fieldParameter);
+      parameter = fieldParameter;
+    } else {
+      parameter = new DefaultParameterElementImpl.forNode(parameterName);
+    }
+    _setCodeRange(parameter, node);
+    parameter.isConst = node.isConst;
+    parameter.isFinal = node.isFinal;
+    parameter.parameterKind = node.kind;
+    // visible range
+    _setParameterVisibleRange(node, parameter);
+    if (normalParameter is SimpleFormalParameter &&
+        normalParameter.type == null) {
+      parameter.hasImplicitType = true;
+    }
+    _currentHolder.addParameter(parameter);
+    parameterName.staticElement = parameter;
+    normalParameter.accept(this);
     return null;
   }
 
@@ -896,208 +1430,14 @@
   }
 
   @override
-  Object visitImportDirective(ImportDirective node) {
-    List<ElementAnnotation> annotations =
-        _createElementAnnotations(node.metadata);
-    compilationUnitElement.setAnnotations(node.offset, annotations);
-    return super.visitImportDirective(node);
-  }
-
-  @override
-  Object visitLabeledStatement(LabeledStatement node) {
-    bool onSwitchStatement = node.statement is SwitchStatement;
-    for (Label label in node.labels) {
-      SimpleIdentifier labelName = label.label;
-      LabelElementImpl element =
-          new LabelElementImpl.forNode(labelName, onSwitchStatement, false);
-      _currentHolder.addLabel(element);
-      labelName.staticElement = element;
-    }
-    return super.visitLabeledStatement(node);
-  }
-
-  @override
-  Object visitLibraryDirective(LibraryDirective node) {
-    List<ElementAnnotation> annotations =
-        _createElementAnnotations(node.metadata);
-    compilationUnitElement.setAnnotations(node.offset, annotations);
-    return super.visitLibraryDirective(node);
-  }
-
-  @override
-  Object visitMethodDeclaration(MethodDeclaration node) {
-    try {
-      ElementHolder holder = new ElementHolder();
-      bool wasInFunction = _inFunction;
-      _inFunction = true;
-      try {
-        _visitChildren(holder, node);
-      } finally {
-        _inFunction = wasInFunction;
-      }
-      bool isStatic = node.isStatic;
-      Token property = node.propertyKeyword;
-      FunctionBody body = node.body;
-      if (property == null) {
-        SimpleIdentifier methodName = node.name;
-        String nameOfMethod = methodName.name;
-        if (nameOfMethod == TokenType.MINUS.lexeme &&
-            node.parameters.parameters.length == 0) {
-          nameOfMethod = "unary-";
-        }
-        MethodElementImpl element =
-            new MethodElementImpl(nameOfMethod, methodName.offset);
-        _setCodeRange(element, node);
-        element.metadata = _createElementAnnotations(node.metadata);
-        setElementDocumentationComment(element, node);
-        element.abstract = node.isAbstract;
-        if (node.externalKeyword != null) {
-          element.external = true;
-        }
-        element.functions = holder.functions;
-        element.labels = holder.labels;
-        element.localVariables = holder.localVariables;
-        element.parameters = holder.parameters;
-        element.static = isStatic;
-        element.typeParameters = holder.typeParameters;
-        if (body.isAsynchronous) {
-          element.asynchronous = true;
-        }
-        if (body.isGenerator) {
-          element.generator = true;
-        }
-        if (node.returnType == null) {
-          element.hasImplicitReturnType = true;
-        }
-        _currentHolder.addMethod(element);
-        methodName.staticElement = element;
-      } else {
-        SimpleIdentifier propertyNameNode = node.name;
-        String propertyName = propertyNameNode.name;
-        FieldElementImpl field = _currentHolder.getField(propertyName,
-            synthetic: true) as FieldElementImpl;
-        if (field == null) {
-          field = new FieldElementImpl(node.name.name, -1);
-          field.final2 = true;
-          field.static = isStatic;
-          field.synthetic = true;
-          _currentHolder.addField(field);
-        }
-        if (node.isGetter) {
-          PropertyAccessorElementImpl getter =
-              new PropertyAccessorElementImpl.forNode(propertyNameNode);
-          _setCodeRange(getter, node);
-          getter.metadata = _createElementAnnotations(node.metadata);
-          setElementDocumentationComment(getter, node);
-          if (node.externalKeyword != null) {
-            getter.external = true;
-          }
-          getter.functions = holder.functions;
-          getter.labels = holder.labels;
-          getter.localVariables = holder.localVariables;
-          if (body.isAsynchronous) {
-            getter.asynchronous = true;
-          }
-          if (body.isGenerator) {
-            getter.generator = true;
-          }
-          getter.variable = field;
-          getter.abstract = node.isAbstract;
-          getter.getter = true;
-          getter.static = isStatic;
-          field.getter = getter;
-          if (node.returnType == null) {
-            getter.hasImplicitReturnType = true;
-          }
-          _currentHolder.addAccessor(getter);
-          propertyNameNode.staticElement = getter;
-        } else {
-          PropertyAccessorElementImpl setter =
-              new PropertyAccessorElementImpl.forNode(propertyNameNode);
-          _setCodeRange(setter, node);
-          setter.metadata = _createElementAnnotations(node.metadata);
-          setElementDocumentationComment(setter, node);
-          if (node.externalKeyword != null) {
-            setter.external = true;
-          }
-          setter.functions = holder.functions;
-          setter.labels = holder.labels;
-          setter.localVariables = holder.localVariables;
-          setter.parameters = holder.parameters;
-          if (body.isAsynchronous) {
-            setter.asynchronous = true;
-          }
-          if (body.isGenerator) {
-            setter.generator = true;
-          }
-          setter.variable = field;
-          setter.abstract = node.isAbstract;
-          setter.setter = true;
-          setter.static = isStatic;
-          if (node.returnType == null) {
-            setter.hasImplicitReturnType = true;
-          }
-          field.setter = setter;
-          field.final2 = false;
-          _currentHolder.addAccessor(setter);
-          propertyNameNode.staticElement = setter;
-        }
-      }
-      holder.validate();
-    } catch (exception, stackTrace) {
-      if (node.name.staticElement == null) {
-        ClassDeclaration classNode =
-            node.getAncestor((node) => node is ClassDeclaration);
-        StringBuffer buffer = new StringBuffer();
-        buffer.write("The element for the method ");
-        buffer.write(node.name);
-        buffer.write(" in ");
-        buffer.write(classNode.name);
-        buffer.write(" was not set while trying to build the element model.");
-        AnalysisEngine.instance.logger.logError(
-            buffer.toString(), new CaughtException(exception, stackTrace));
-      } else {
-        String message =
-            "Exception caught in ElementBuilder.visitMethodDeclaration()";
-        AnalysisEngine.instance.logger
-            .logError(message, new CaughtException(exception, stackTrace));
-      }
-    } finally {
-      if (node.name.staticElement == null) {
-        ClassDeclaration classNode =
-            node.getAncestor((node) => node is ClassDeclaration);
-        StringBuffer buffer = new StringBuffer();
-        buffer.write("The element for the method ");
-        buffer.write(node.name);
-        buffer.write(" in ");
-        buffer.write(classNode.name);
-        buffer.write(" was not set while trying to resolve types.");
-        AnalysisEngine.instance.logger.logError(
-            buffer.toString(),
-            new CaughtException(
-                new AnalysisException(buffer.toString()), null));
-      }
-    }
-    return null;
-  }
-
-  @override
-  Object visitPartDirective(PartDirective node) {
-    List<ElementAnnotation> annotations =
-        _createElementAnnotations(node.metadata);
-    compilationUnitElement.setAnnotations(node.offset, annotations);
-    return super.visitPartDirective(node);
-  }
-
-  @override
   Object visitSimpleFormalParameter(SimpleFormalParameter node) {
     if (node.parent is! DefaultFormalParameter) {
       SimpleIdentifier parameterName = node.identifier;
       ParameterElementImpl parameter =
           new ParameterElementImpl.forNode(parameterName);
       _setCodeRange(parameter, node);
-      parameter.const3 = node.isConst;
-      parameter.final2 = node.isFinal;
+      parameter.isConst = node.isConst;
+      parameter.isFinal = node.isFinal;
       parameter.parameterKind = node.kind;
       _setParameterVisibleRange(node, parameter);
       if (node.type == null) {
@@ -1113,30 +1453,6 @@
   }
 
   @override
-  Object visitSwitchCase(SwitchCase node) {
-    for (Label label in node.labels) {
-      SimpleIdentifier labelName = label.label;
-      LabelElementImpl element =
-          new LabelElementImpl.forNode(labelName, false, true);
-      _currentHolder.addLabel(element);
-      labelName.staticElement = element;
-    }
-    return super.visitSwitchCase(node);
-  }
-
-  @override
-  Object visitSwitchDefault(SwitchDefault node) {
-    for (Label label in node.labels) {
-      SimpleIdentifier labelName = label.label;
-      LabelElementImpl element =
-          new LabelElementImpl.forNode(labelName, false, true);
-      _currentHolder.addLabel(element);
-      labelName.staticElement = element;
-    }
-    return super.visitSwitchDefault(node);
-  }
-
-  @override
   Object visitTypeParameter(TypeParameter node) {
     SimpleIdentifier parameterName = node.name;
     TypeParameterElementImpl typeParameter =
@@ -1151,141 +1467,6 @@
     return super.visitTypeParameter(node);
   }
 
-  @override
-  Object visitVariableDeclaration(VariableDeclaration node) {
-    bool isConst = node.isConst;
-    bool isFinal = node.isFinal;
-    bool hasInitializer = node.initializer != null;
-    VariableDeclarationList varList = node.parent;
-    FieldDeclaration fieldNode =
-        varList.parent is FieldDeclaration ? varList.parent : null;
-    VariableElementImpl element;
-    if (fieldNode != null) {
-      SimpleIdentifier fieldName = node.name;
-      FieldElementImpl field;
-      if ((isConst || isFinal && !fieldNode.isStatic) && hasInitializer) {
-        field = new ConstFieldElementImpl.forNode(fieldName);
-      } else {
-        field = new FieldElementImpl.forNode(fieldName);
-      }
-      element = field;
-      field.static = fieldNode.isStatic;
-      _setCodeRange(element, node);
-      setElementDocumentationComment(element, fieldNode);
-      field.hasImplicitType = varList.type == null;
-      _currentHolder.addField(field);
-      fieldName.staticElement = field;
-    } else if (_inFunction) {
-      SimpleIdentifier variableName = node.name;
-      LocalVariableElementImpl variable;
-      if (isConst && hasInitializer) {
-        variable = new ConstLocalVariableElementImpl.forNode(variableName);
-      } else {
-        variable = new LocalVariableElementImpl.forNode(variableName);
-      }
-      element = variable;
-      _setCodeRange(element, node);
-      _setVariableVisibleRange(variable, node);
-      variable.hasImplicitType = varList.type == null;
-      _currentHolder.addLocalVariable(variable);
-      variableName.staticElement = element;
-    } else {
-      SimpleIdentifier variableName = node.name;
-      TopLevelVariableElementImpl variable;
-      if (isConst && hasInitializer) {
-        variable = new ConstTopLevelVariableElementImpl.forNode(variableName);
-      } else {
-        variable = new TopLevelVariableElementImpl.forNode(variableName);
-      }
-      element = variable;
-      _setCodeRange(element, node);
-      if (varList.parent is TopLevelVariableDeclaration) {
-        setElementDocumentationComment(element, varList.parent);
-      }
-      variable.hasImplicitType = varList.type == null;
-      _currentHolder.addTopLevelVariable(variable);
-      variableName.staticElement = element;
-    }
-    element.const3 = isConst;
-    element.final2 = isFinal;
-    if (hasInitializer) {
-      ElementHolder holder = new ElementHolder();
-      _visit(holder, node.initializer);
-      FunctionElementImpl initializer =
-          new FunctionElementImpl.forOffset(node.initializer.beginToken.offset);
-      initializer.hasImplicitReturnType = true;
-      initializer.functions = holder.functions;
-      initializer.labels = holder.labels;
-      initializer.localVariables = holder.localVariables;
-      initializer.synthetic = true;
-      initializer.type = new FunctionTypeImpl(initializer);
-      element.initializer = initializer;
-      holder.validate();
-    }
-    if (element is PropertyInducingElementImpl) {
-      PropertyAccessorElementImpl_ImplicitGetter getter =
-          new PropertyAccessorElementImpl_ImplicitGetter(element);
-      _currentHolder.addAccessor(getter);
-      if (!isConst && !isFinal) {
-        PropertyAccessorElementImpl_ImplicitSetter setter =
-            new PropertyAccessorElementImpl_ImplicitSetter(element);
-        _currentHolder.addAccessor(setter);
-      }
-    }
-    return null;
-  }
-
-  @override
-  Object visitVariableDeclarationList(VariableDeclarationList node) {
-    super.visitVariableDeclarationList(node);
-    AstNode parent = node.parent;
-    List<ElementAnnotation> elementAnnotations;
-    if (parent is FieldDeclaration) {
-      elementAnnotations = _createElementAnnotations(parent.metadata);
-    } else if (parent is TopLevelVariableDeclaration) {
-      elementAnnotations = _createElementAnnotations(parent.metadata);
-    } else {
-      // Local variable declaration
-      elementAnnotations = _createElementAnnotations(node.metadata);
-    }
-    for (VariableDeclaration variableDeclaration in node.variables) {
-      ElementImpl element = variableDeclaration.element as ElementImpl;
-      _setCodeRange(element, node.parent);
-      element.metadata = elementAnnotations;
-    }
-    return null;
-  }
-
-  /**
-   * Build the table mapping field names to field elements for the fields defined in the current
-   * class.
-   *
-   * @param fields the field elements defined in the current class
-   */
-  void _buildFieldMap(List<FieldElement> fields) {
-    _fieldMap = new HashMap<String, FieldElement>();
-    int count = fields.length;
-    for (int i = 0; i < count; i++) {
-      FieldElement field = fields[i];
-      _fieldMap[field.name] ??= field;
-    }
-  }
-
-  /**
-   * Creates the [ConstructorElement]s array with the single default constructor element.
-   *
-   * @param interfaceType the interface type for which to create a default constructor
-   * @return the [ConstructorElement]s array with the single default constructor element
-   */
-  List<ConstructorElement> _createDefaultConstructors(
-      ClassElementImpl definingClass) {
-    ConstructorElementImpl constructor =
-        new ConstructorElementImpl.forNode(null);
-    constructor.synthetic = true;
-    constructor.enclosingElement = definingClass;
-    return <ConstructorElement>[constructor];
-  }
-
   /**
    * For each [Annotation] found in [annotations], create a new
    * [ElementAnnotation] object and set the [Annotation] to point to it.
@@ -1297,35 +1478,13 @@
     }
     return annotations.map((Annotation a) {
       ElementAnnotationImpl elementAnnotation =
-          new ElementAnnotationImpl(compilationUnitElement);
+          new ElementAnnotationImpl(_unitElement);
       a.elementAnnotation = elementAnnotation;
       return elementAnnotation;
     }).toList();
   }
 
   /**
-   * Create the types associated with the given type parameters, setting the type of each type
-   * parameter, and return an array of types corresponding to the given parameters.
-   *
-   * @param typeParameters the type parameters for which types are to be created
-   * @return an array of types corresponding to the given parameters
-   */
-  List<DartType> _createTypeParameterTypes(
-      List<TypeParameterElement> typeParameters) {
-    int typeParameterCount = typeParameters.length;
-    List<DartType> typeArguments = new List<DartType>(typeParameterCount);
-    for (int i = 0; i < typeParameterCount; i++) {
-      TypeParameterElementImpl typeParameter =
-          typeParameters[i] as TypeParameterElementImpl;
-      TypeParameterTypeImpl typeParameterType =
-          new TypeParameterTypeImpl(typeParameter);
-      typeParameter.type = typeParameterType;
-      typeArguments[i] = typeParameterType;
-    }
-    return typeArguments;
-  }
-
-  /**
    * Return the body of the function that contains the given [parameter], or
    * `null` if no function body could be found.
    */
@@ -1345,6 +1504,8 @@
     element.setCodeRange(node.offset, node.length);
   }
 
+  void _setFieldParameterField(FieldFormalParameterElementImpl parameter) {}
+
   /**
    * Sets the visible source range for formal parameter.
    */
@@ -1356,16 +1517,13 @@
     }
   }
 
-  void _setVariableVisibleRange(
-      LocalVariableElementImpl element, VariableDeclaration node) {
-    AstNode scopeNode;
-    AstNode parent2 = node.parent.parent;
-    if (parent2 is ForStatement) {
-      scopeNode = parent2;
-    } else {
-      scopeNode = node.getAncestor((node) => node is Block);
+  void _setVariableDeclarationListAnnotations(VariableDeclarationList node,
+      List<ElementAnnotation> elementAnnotations) {
+    for (VariableDeclaration variableDeclaration in node.variables) {
+      ElementImpl element = variableDeclaration.element as ElementImpl;
+      _setCodeRange(element, node.parent);
+      element.metadata = elementAnnotations;
     }
-    element.setVisibleRange(scopeNode.offset, scopeNode.length);
   }
 
   /**
@@ -1406,7 +1564,7 @@
 }
 
 class _ElementBuilder_visitClassDeclaration extends UnifyingAstVisitor<Object> {
-  final ElementBuilder builder;
+  final ApiElementBuilder builder;
 
   List<ClassMember> nonFields;
 
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart
index 9cb2c7b..22f961b 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -25,7 +25,7 @@
 import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/sdk.dart' show DartSdk;
 import 'package:analyzer/src/generated/source.dart';
-import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
 import 'package:analyzer/src/generated/utilities_collection.dart';
 import 'package:analyzer/src/generated/utilities_dart.dart';
 import 'package:analyzer/src/generated/utilities_general.dart';
@@ -33,6 +33,18 @@
 import 'package:analyzer/src/task/dart.dart';
 
 /**
+ * Assert that the given [object] is null, which in the places where this
+ * function is called means that the element is not resynthesized.
+ */
+void _assertNotResynthesized(Object object) {
+  // TODO(scheglov) I comment this check for now.
+  // When we make a decision about switch to the new analysis driver,
+  // we will need to rework the analysis code to don't call the setters
+  // or restore / inline it.
+//  assert(object == null);
+}
+
+/**
  * A concrete implementation of a [ClassElement].
  */
 abstract class AbstractClassElementImpl extends ElementImpl
@@ -179,45 +191,61 @@
   @override
   MethodElement lookUpConcreteMethod(
           String methodName, LibraryElement library) =>
-      _internalLookUpConcreteMethod(
-          methodName, library, true, new HashSet<ClassElement>());
+      _first(_implementationsOfMethod(methodName).where(
+          (MethodElement method) =>
+              !method.isAbstract && method.isAccessibleIn(library)));
 
   @override
   PropertyAccessorElement lookUpGetter(
           String getterName, LibraryElement library) =>
-      _internalLookUpGetter(getterName, library, true);
+      _first(_implementationsOfGetter(getterName).where(
+          (PropertyAccessorElement getter) => getter.isAccessibleIn(library)));
 
   @override
   PropertyAccessorElement lookUpInheritedConcreteGetter(
           String getterName, LibraryElement library) =>
-      _internalLookUpConcreteGetter(getterName, library, false);
+      _first(_implementationsOfGetter(getterName).where(
+          (PropertyAccessorElement getter) =>
+              !getter.isAbstract &&
+              getter.isAccessibleIn(library) &&
+              getter.enclosingElement != this));
 
   @override
   MethodElement lookUpInheritedConcreteMethod(
           String methodName, LibraryElement library) =>
-      _internalLookUpConcreteMethod(
-          methodName, library, false, new HashSet<ClassElement>());
+      _first(_implementationsOfMethod(methodName).where(
+          (MethodElement method) =>
+              !method.isAbstract &&
+              method.isAccessibleIn(library) &&
+              method.enclosingElement != this));
 
   @override
   PropertyAccessorElement lookUpInheritedConcreteSetter(
           String setterName, LibraryElement library) =>
-      _internalLookUpConcreteSetter(setterName, library, false);
+      _first(_implementationsOfSetter(setterName).where(
+          (PropertyAccessorElement setter) =>
+              !setter.isAbstract &&
+              setter.isAccessibleIn(library) &&
+              setter.enclosingElement != this));
 
   @override
   MethodElement lookUpInheritedMethod(
           String methodName, LibraryElement library) =>
-      _internalLookUpMethod(
-          methodName, library, false, new HashSet<ClassElement>());
+      _first(_implementationsOfMethod(methodName).where(
+          (MethodElement method) =>
+              method.isAccessibleIn(library) &&
+              method.enclosingElement != this));
 
   @override
   MethodElement lookUpMethod(String methodName, LibraryElement library) =>
-      _internalLookUpMethod(
-          methodName, library, true, new HashSet<ClassElement>());
+      _first(_implementationsOfMethod(methodName)
+          .where((MethodElement method) => method.isAccessibleIn(library)));
 
   @override
   PropertyAccessorElement lookUpSetter(
           String setterName, LibraryElement library) =>
-      _internalLookUpSetter(setterName, library, true);
+      _first(_implementationsOfSetter(setterName).where(
+          (PropertyAccessorElement setter) => setter.isAccessibleIn(library)));
 
   @override
   void visitChildren(ElementVisitor visitor) {
@@ -226,151 +254,110 @@
     safelyVisitChildren(fields, visitor);
   }
 
-  PropertyAccessorElement _internalLookUpConcreteGetter(
-      String getterName, LibraryElement library, bool includeThisClass) {
-    PropertyAccessorElement getter =
-        _internalLookUpGetter(getterName, library, includeThisClass);
-    while (getter != null && getter.isAbstract) {
-      Element definingClass = getter.enclosingElement;
-      if (definingClass is! ClassElement) {
-        return null;
-      }
-      getter = getImpl(definingClass)
-          ._internalLookUpGetter(getterName, library, false);
+  /**
+   * Return the first element from the given [iterable], or `null` if the
+   * iterable is empty.
+   */
+  Object/*=E*/ _first/*<E>*/(Iterable/*<E>*/ iterable) {
+    if (iterable.isEmpty) {
+      return null;
     }
-    return getter;
+    return iterable.first;
   }
 
-  MethodElement _internalLookUpConcreteMethod(
-      String methodName,
-      LibraryElement library,
-      bool includeThisClass,
-      HashSet<ClassElement> visitedClasses) {
-    MethodElement method = _internalLookUpMethod(
-        methodName, library, includeThisClass, visitedClasses);
-    while (method != null && method.isAbstract) {
-      ClassElement definingClass = method.enclosingElement;
-      if (definingClass == null) {
-        return null;
-      }
-      method = getImpl(definingClass)
-          ._internalLookUpMethod(methodName, library, false, visitedClasses);
-    }
-    return method;
-  }
-
-  PropertyAccessorElement _internalLookUpConcreteSetter(
-      String setterName, LibraryElement library, bool includeThisClass) {
-    PropertyAccessorElement setter =
-        _internalLookUpSetter(setterName, library, includeThisClass);
-    while (setter != null && setter.isAbstract) {
-      Element definingClass = setter.enclosingElement;
-      if (definingClass is ClassElementImpl) {
-        setter =
-            definingClass._internalLookUpSetter(setterName, library, false);
-      } else {
-        return null;
-      }
-    }
-    return setter;
-  }
-
-  PropertyAccessorElement _internalLookUpGetter(
-      String getterName, LibraryElement library, bool includeThisClass) {
+  /**
+   * Return an iterable containing all of the implementations of a getter with
+   * the given [getterName] that are defined in this class any any superclass of
+   * this class (but not in interfaces).
+   *
+   * The getters that are returned are not filtered in any way. In particular,
+   * they can include getters that are not visible in some context. Clients must
+   * perform any necessary filtering.
+   *
+   * The getters are returned based on the depth of their defining class; if
+   * this class contains a definition of the getter it will occur first, if
+   * Object contains a definition of the getter it will occur last.
+   */
+  Iterable<PropertyAccessorElement> _implementationsOfGetter(
+      String getterName) sync* {
+    ClassElement classElement = this;
     HashSet<ClassElement> visitedClasses = new HashSet<ClassElement>();
-    ClassElement currentElement = this;
-    if (includeThisClass) {
-      PropertyAccessorElement element = currentElement.getGetter(getterName);
-      if (element != null && element.isAccessibleIn(library)) {
-        return element;
+    while (classElement != null && visitedClasses.add(classElement)) {
+      PropertyAccessorElement getter = classElement.getGetter(getterName);
+      if (getter != null) {
+        yield getter;
       }
-    }
-    while (currentElement != null && visitedClasses.add(currentElement)) {
-      for (InterfaceType mixin in currentElement.mixins.reversed) {
-        ClassElement mixinElement = mixin.element;
-        if (mixinElement != null) {
-          PropertyAccessorElement element = mixinElement.getGetter(getterName);
-          if (element != null && element.isAccessibleIn(library)) {
-            return element;
-          }
+      for (InterfaceType mixin in classElement.mixins.reversed) {
+        getter = mixin.element?.getGetter(getterName);
+        if (getter != null) {
+          yield getter;
         }
       }
-      InterfaceType supertype = currentElement.supertype;
-      if (supertype == null) {
-        return null;
-      }
-      currentElement = supertype.element;
-      PropertyAccessorElement element = currentElement.getGetter(getterName);
-      if (element != null && element.isAccessibleIn(library)) {
-        return element;
-      }
+      classElement = classElement.supertype?.element;
     }
-    return null;
   }
 
-  MethodElement _internalLookUpMethod(String methodName, LibraryElement library,
-      bool includeThisClass, HashSet<ClassElement> visitedClasses) {
-    ClassElement currentElement = this;
-    if (includeThisClass) {
-      MethodElement element = currentElement.getMethod(methodName);
-      if (element != null && element.isAccessibleIn(library)) {
-        return element;
-      }
-    }
-    while (currentElement != null && visitedClasses.add(currentElement)) {
-      for (InterfaceType mixin in currentElement.mixins.reversed) {
-        ClassElement mixinElement = mixin.element;
-        if (mixinElement != null) {
-          MethodElement element = mixinElement.getMethod(methodName);
-          if (element != null && element.isAccessibleIn(library)) {
-            return element;
-          }
-        }
-      }
-      InterfaceType supertype = currentElement.supertype;
-      if (supertype == null) {
-        return null;
-      }
-      currentElement = supertype.element;
-      MethodElement element = currentElement.getMethod(methodName);
-      if (element != null && element.isAccessibleIn(library)) {
-        return element;
-      }
-    }
-    return null;
-  }
-
-  PropertyAccessorElement _internalLookUpSetter(
-      String setterName, LibraryElement library, bool includeThisClass) {
+  /**
+   * Return an iterable containing all of the implementations of a method with
+   * the given [methodName] that are defined in this class any any superclass of
+   * this class (but not in interfaces).
+   *
+   * The methods that are returned are not filtered in any way. In particular,
+   * they can include methods that are not visible in some context. Clients must
+   * perform any necessary filtering.
+   *
+   * The methods are returned based on the depth of their defining class; if
+   * this class contains a definition of the method it will occur first, if
+   * Object contains a definition of the method it will occur last.
+   */
+  Iterable<MethodElement> _implementationsOfMethod(String methodName) sync* {
+    ClassElement classElement = this;
     HashSet<ClassElement> visitedClasses = new HashSet<ClassElement>();
-    ClassElement currentElement = this;
-    if (includeThisClass) {
-      PropertyAccessorElement element = currentElement.getSetter(setterName);
-      if (element != null && element.isAccessibleIn(library)) {
-        return element;
+    while (classElement != null && visitedClasses.add(classElement)) {
+      MethodElement method = classElement.getMethod(methodName);
+      if (method != null) {
+        yield method;
       }
-    }
-    while (currentElement != null && visitedClasses.add(currentElement)) {
-      for (InterfaceType mixin in currentElement.mixins.reversed) {
-        ClassElement mixinElement = mixin.element;
-        if (mixinElement != null) {
-          PropertyAccessorElement element = mixinElement.getSetter(setterName);
-          if (element != null && element.isAccessibleIn(library)) {
-            return element;
-          }
+      for (InterfaceType mixin in classElement.mixins.reversed) {
+        method = mixin.element?.getMethod(methodName);
+        if (method != null) {
+          yield method;
         }
       }
-      InterfaceType supertype = currentElement.supertype;
-      if (supertype == null) {
-        return null;
-      }
-      currentElement = supertype.element;
-      PropertyAccessorElement element = currentElement.getSetter(setterName);
-      if (element != null && element.isAccessibleIn(library)) {
-        return element;
-      }
+      classElement = classElement.supertype?.element;
     }
-    return null;
+  }
+
+  /**
+   * Return an iterable containing all of the implementations of a setter with
+   * the given [setterName] that are defined in this class any any superclass of
+   * this class (but not in interfaces).
+   *
+   * The setters that are returned are not filtered in any way. In particular,
+   * they can include setters that are not visible in some context. Clients must
+   * perform any necessary filtering.
+   *
+   * The setters are returned based on the depth of their defining class; if
+   * this class contains a definition of the setter it will occur first, if
+   * Object contains a definition of the setter it will occur last.
+   */
+  Iterable<PropertyAccessorElement> _implementationsOfSetter(
+      String setterName) sync* {
+    ClassElement classElement = this;
+    HashSet<ClassElement> visitedClasses = new HashSet<ClassElement>();
+    while (classElement != null && visitedClasses.add(classElement)) {
+      PropertyAccessorElement setter = classElement.getSetter(setterName);
+      if (setter != null) {
+        yield setter;
+      }
+      for (InterfaceType mixin in classElement.mixins.reversed) {
+        setter = mixin.element?.getSetter(setterName);
+        if (setter != null) {
+          yield setter;
+        }
+      }
+      classElement = classElement.supertype?.element;
+    }
   }
 
   /**
@@ -505,7 +492,7 @@
    * Set whether this class is abstract.
    */
   void set abstract(bool isAbstract) {
-    assert(_unlinkedClass == null);
+    _assertNotResynthesized(_unlinkedClass);
     setModifier(Modifier.ABSTRACT, isAbstract);
   }
 
@@ -519,7 +506,7 @@
 
   @override
   void set accessors(List<PropertyAccessorElement> accessors) {
-    assert(_unlinkedClass == null);
+    _assertNotResynthesized(_unlinkedClass);
     super.accessors = accessors;
   }
 
@@ -559,7 +546,7 @@
       // Ensure at least implicit default constructor.
       if (_constructors.isEmpty) {
         ConstructorElementImpl constructor = new ConstructorElementImpl('', -1);
-        constructor.synthetic = true;
+        constructor.isSynthetic = true;
         constructor.enclosingElement = this;
         _constructors = <ConstructorElement>[constructor];
       }
@@ -574,7 +561,7 @@
    * Should only be used for class elements that are not mixin applications.
    */
   void set constructors(List<ConstructorElement> constructors) {
-    assert(_unlinkedClass == null);
+    _assertNotResynthesized(_unlinkedClass);
     assert(!isMixinApplication);
     for (ConstructorElement constructor in constructors) {
       (constructor as ConstructorElementImpl).enclosingElement = this;
@@ -647,7 +634,7 @@
 
   @override
   void set fields(List<FieldElement> fields) {
-    assert(_unlinkedClass == null);
+    _assertNotResynthesized(_unlinkedClass);
     super.fields = fields;
   }
 
@@ -659,7 +646,7 @@
   }
 
   void set hasBeenInferred(bool hasBeenInferred) {
-    assert(_unlinkedClass == null);
+    _assertNotResynthesized(_unlinkedClass);
     _hasBeenInferred = hasBeenInferred;
   }
 
@@ -749,7 +736,7 @@
   }
 
   void set interfaces(List<InterfaceType> interfaces) {
-    assert(_unlinkedClass == null);
+    _assertNotResynthesized(_unlinkedClass);
     _interfaces = interfaces;
   }
 
@@ -828,7 +815,7 @@
    * Set the methods contained in this class to the given [methods].
    */
   void set methods(List<MethodElement> methods) {
-    assert(_unlinkedClass == null);
+    _assertNotResynthesized(_unlinkedClass);
     for (MethodElement method in methods) {
       (method as MethodElementImpl).enclosingElement = this;
     }
@@ -839,7 +826,7 @@
    * Set whether this class is a mixin application.
    */
   void set mixinApplication(bool isMixinApplication) {
-    assert(_unlinkedClass == null);
+    _assertNotResynthesized(_unlinkedClass);
     setModifier(Modifier.MIXIN_APPLICATION, isMixinApplication);
   }
 
@@ -856,7 +843,7 @@
   }
 
   void set mixins(List<InterfaceType> mixins) {
-    assert(_unlinkedClass == null);
+    _assertNotResynthesized(_unlinkedClass);
     _mixins = mixins;
   }
 
@@ -870,10 +857,11 @@
 
   @override
   int get nameOffset {
-    if (_unlinkedClass != null) {
+    int offset = super.nameOffset;
+    if (offset == 0 && _unlinkedClass != null) {
       return _unlinkedClass.nameOffset;
     }
-    return super.nameOffset;
+    return offset;
   }
 
   @override
@@ -897,7 +885,7 @@
   }
 
   void set supertype(InterfaceType supertype) {
-    assert(_unlinkedClass == null);
+    _assertNotResynthesized(_unlinkedClass);
     _supertype = supertype;
   }
 
@@ -927,7 +915,7 @@
    * [typeParameters].
    */
   void set typeParameters(List<TypeParameterElement> typeParameters) {
-    assert(_unlinkedClass == null);
+    _assertNotResynthesized(_unlinkedClass);
     for (TypeParameterElement typeParameter in typeParameters) {
       (typeParameter as TypeParameterElementImpl).enclosingElement = this;
     }
@@ -1061,9 +1049,9 @@
   @override
   void visitChildren(ElementVisitor visitor) {
     super.visitChildren(visitor);
-    safelyVisitChildren(_constructors, visitor);
+    safelyVisitChildren(constructors, visitor);
     safelyVisitChildren(methods, visitor);
-    safelyVisitChildren(_typeParameters, visitor);
+    safelyVisitChildren(typeParameters, visitor);
   }
 
   void _collectAllSupertypes(List<InterfaceType> supertypes) {
@@ -1161,7 +1149,7 @@
         .map((ConstructorElement superclassConstructor) {
       ConstructorElementImpl implicitConstructor =
           new ConstructorElementImpl(superclassConstructor.name, -1);
-      implicitConstructor.synthetic = true;
+      implicitConstructor.isSynthetic = true;
       implicitConstructor.redirectedConstructor = superclassConstructor;
       List<ParameterElement> superParameters = superclassConstructor.parameters;
       int count = superParameters.length;
@@ -1172,10 +1160,10 @@
           ParameterElement superParameter = superParameters[i];
           ParameterElementImpl implicitParameter =
               new ParameterElementImpl(superParameter.name, -1);
-          implicitParameter.const3 = superParameter.isConst;
-          implicitParameter.final2 = superParameter.isFinal;
+          implicitParameter.isConst = superParameter.isConst;
+          implicitParameter.isFinal = superParameter.isFinal;
           implicitParameter.parameterKind = superParameter.parameterKind;
-          implicitParameter.synthetic = true;
+          implicitParameter.isSynthetic = true;
           implicitParameter.type =
               superParameter.type.substitute2(argumentTypes, parameterTypes);
           implicitParameters[i] = implicitParameter;
@@ -1233,11 +1221,12 @@
           field = new FieldElementImpl(fieldName, -1);
           implicitFields[fieldName] = field;
           field.enclosingElement = this;
-          field.synthetic = true;
-          field.final2 = e.kind == UnlinkedExecutableKind.getter;
+          field.isSynthetic = true;
+          field.isFinal = e.kind == UnlinkedExecutableKind.getter;
           field.type = fieldType;
+          field.isStatic = e.isStatic;
         } else {
-          field.final2 = false;
+          field.isFinal = false;
         }
         accessor.variable = field;
         if (e.kind == UnlinkedExecutableKind.getter) {
@@ -1476,7 +1465,7 @@
    * Set the enums contained in this compilation unit to the given [enums].
    */
   void set enums(List<ClassElement> enums) {
-    assert(_unlinkedUnit == null);
+    _assertNotResynthesized(_unlinkedUnit);
     for (ClassElement enumDeclaration in enums) {
       (enumDeclaration as EnumElementImpl).enclosingElement = this;
     }
@@ -1590,7 +1579,7 @@
    * given [typeAliases].
    */
   void set typeAliases(List<FunctionTypeAliasElement> typeAliases) {
-    assert(_unlinkedUnit == null);
+    _assertNotResynthesized(_unlinkedUnit);
     for (FunctionTypeAliasElement typeAlias in typeAliases) {
       (typeAlias as FunctionTypeAliasElementImpl).enclosingElement = this;
     }
@@ -1614,7 +1603,7 @@
    * Set the types contained in this compilation unit to the given [types].
    */
   void set types(List<ClassElement> types) {
-    assert(_unlinkedUnit == null);
+    _assertNotResynthesized(_unlinkedUnit);
     for (ClassElement type in types) {
       // Another implementation of ClassElement is _DeferredClassElement,
       // which is used to resynthesize classes lazily. We cannot cast it
@@ -1851,10 +1840,11 @@
 
   @override
   int get nameOffset {
-    if (_unlinkedEnumValue != null) {
+    int offset = super.nameOffset;
+    if (offset == -1 && _unlinkedEnumValue != null) {
       return _unlinkedEnumValue.nameOffset;
     }
-    return super.nameOffset;
+    return offset;
   }
 
   @override
@@ -1867,7 +1857,7 @@
 class ConstFieldElementImpl_EnumValues extends ConstFieldElementImpl_ofEnum {
   ConstFieldElementImpl_EnumValues(EnumElementImpl enumElement)
       : super(enumElement) {
-    synthetic = true;
+    isSynthetic = true;
   }
 
   @override
@@ -1909,28 +1899,28 @@
   }
 
   @override
-  void set const3(bool isConst) {
-    assert(false);
-  }
-
-  @override
   void set evaluationResult(_) {
     assert(false);
   }
 
   @override
-  void set final2(bool isFinal) {
-    assert(false);
-  }
-
-  @override
   bool get isConst => true;
 
   @override
+  void set isConst(bool isConst) {
+    assert(false);
+  }
+
+  @override
+  void set isFinal(bool isFinal) {
+    assert(false);
+  }
+
+  @override
   bool get isStatic => true;
 
   @override
-  void set static(bool isStatic) {
+  void set isStatic(bool isStatic) {
     assert(false);
   }
 
@@ -2015,14 +2005,6 @@
       UnlinkedExecutable serializedExecutable, ClassElementImpl enclosingClass)
       : super.forSerialized(serializedExecutable, enclosingClass);
 
-  /**
-   * Set whether this constructor represents a 'const' constructor.
-   */
-  void set const2(bool isConst) {
-    assert(serializedExecutable == null);
-    setModifier(Modifier.CONST, isConst);
-  }
-
   List<ConstructorInitializer> get constantInitializers {
     if (serializedExecutable != null && _constantInitializers == null) {
       _constantInitializers ??= serializedExecutable.constantInitializers
@@ -2034,7 +2016,7 @@
 
   void set constantInitializers(
       List<ConstructorInitializer> constantInitializers) {
-    assert(serializedExecutable == null);
+    _assertNotResynthesized(serializedExecutable);
     _constantInitializers = constantInitializers;
   }
 
@@ -2050,7 +2032,7 @@
    * Set whether this constructor represents a factory method.
    */
   void set factory(bool isFactory) {
-    assert(serializedExecutable == null);
+    _assertNotResynthesized(serializedExecutable);
     setModifier(Modifier.FACTORY, isFactory);
   }
 
@@ -2062,6 +2044,14 @@
     return hasModifier(Modifier.CONST);
   }
 
+  /**
+   * Set whether this constructor represents a 'const' constructor.
+   */
+  void set isConst(bool isConst) {
+    _assertNotResynthesized(serializedExecutable);
+    setModifier(Modifier.CONST, isConst);
+  }
+
   bool get isCycleFree {
     if (serializedExecutable != null) {
       return serializedExecutable.isConst &&
@@ -2121,7 +2111,7 @@
   }
 
   void set nameEnd(int nameEnd) {
-    assert(serializedExecutable == null);
+    _assertNotResynthesized(serializedExecutable);
     _nameEnd = nameEnd;
   }
 
@@ -2136,7 +2126,7 @@
   }
 
   void set periodOffset(int periodOffset) {
-    assert(serializedExecutable == null);
+    _assertNotResynthesized(serializedExecutable);
     _periodOffset = periodOffset;
   }
 
@@ -2160,7 +2150,7 @@
   }
 
   void set redirectedConstructor(ConstructorElement redirectedConstructor) {
-    assert(serializedExecutable == null);
+    _assertNotResynthesized(serializedExecutable);
     _redirectedConstructor = redirectedConstructor;
   }
 
@@ -2227,7 +2217,7 @@
             .buildExpression(this, serialized.arguments[i]);
         int nameIndex = numNames + i - numArguments;
         if (nameIndex >= 0) {
-          expression = AstFactory.namedExpression2(
+          expression = AstTestFactory.namedExpression2(
               serialized.argumentNames[nameIndex], expression);
         }
         arguments.add(expression);
@@ -2236,7 +2226,7 @@
     switch (kind) {
       case UnlinkedConstructorInitializerKind.field:
         ConstructorFieldInitializer initializer =
-            AstFactory.constructorFieldInitializer(
+            AstTestFactory.constructorFieldInitializer(
                 false,
                 name,
                 enclosingUnit.resynthesizerContext
@@ -2245,7 +2235,7 @@
         return initializer;
       case UnlinkedConstructorInitializerKind.superInvocation:
         SuperConstructorInvocation initializer =
-            AstFactory.superConstructorInvocation2(
+            AstTestFactory.superConstructorInvocation2(
                 name.isNotEmpty ? name : null, arguments);
         ClassElement superElement = enclosingElement.supertype.element;
         ConstructorElement element = name.isEmpty
@@ -2256,7 +2246,7 @@
         return initializer;
       case UnlinkedConstructorInitializerKind.thisInvocation:
         RedirectingConstructorInvocation initializer =
-            AstFactory.redirectingConstructorInvocation2(
+            AstTestFactory.redirectingConstructorInvocation2(
                 name.isNotEmpty ? name : null, arguments);
         ConstructorElement element = name.isEmpty
             ? enclosingElement.unnamedConstructor
@@ -2332,7 +2322,7 @@
   }
 
   void set constantInitializer(Expression constantInitializer) {
-    assert(_unlinkedConst == null);
+    _assertNotResynthesized(_unlinkedConst);
     _constantInitializer = constantInitializer;
   }
 
@@ -2346,7 +2336,7 @@
    * If this element is resynthesized from the summary, return the unlinked
    * initializer, otherwise return `null`.
    */
-  UnlinkedConst get _unlinkedConst;
+  UnlinkedExpr get _unlinkedConst;
 
   /**
    * Return a representation of the value of this variable, forcing the value
@@ -2898,6 +2888,13 @@
   @override
   bool get isSynthetic => hasModifier(Modifier.SYNTHETIC);
 
+  /**
+   * Set whether this element is synthetic.
+   */
+  void set isSynthetic(bool isSynthetic) {
+    setModifier(Modifier.SYNTHETIC, isSynthetic);
+  }
+
   @override
   LibraryElement get library =>
       getAncestor((element) => element is LibraryElement);
@@ -2962,13 +2959,6 @@
   }
 
   /**
-   * Set whether this element is synthetic.
-   */
-  void set synthetic(bool isSynthetic) {
-    setModifier(Modifier.SYNTHETIC, isSynthetic);
-  }
-
-  /**
    * Return the context to resolve type parameters in, or `null` if neither this
    * element nor any of its ancestors is of a kind that can declare type
    * parameters.
@@ -3139,7 +3129,7 @@
    * Return annotations for the given [unlinkedConsts] in the [unit].
    */
   List<ElementAnnotation> _buildAnnotations(
-      CompilationUnitElementImpl unit, List<UnlinkedConst> unlinkedConsts) {
+      CompilationUnitElementImpl unit, List<UnlinkedExpr> unlinkedConsts) {
     int length = unlinkedConsts.length;
     if (length != 0) {
       List<ElementAnnotation> annotations = new List<ElementAnnotation>(length);
@@ -3153,7 +3143,7 @@
     }
   }
 
-  static int _findElementIndexUsingIdentical(List items, Object item) {
+  static int findElementIndexUsingIdentical(List items, Object item) {
     int length = items.length;
     for (int i = 0; i < length; i++) {
       if (identical(items[i], item)) {
@@ -3355,7 +3345,7 @@
    * Set whether this class is abstract.
    */
   void set abstract(bool isAbstract) {
-    assert(_unlinkedEnum == null);
+    _assertNotResynthesized(_unlinkedEnum);
   }
 
   @override
@@ -3368,7 +3358,7 @@
 
   @override
   void set accessors(List<PropertyAccessorElement> accessors) {
-    assert(_unlinkedEnum == null);
+    _assertNotResynthesized(_unlinkedEnum);
     super.accessors = accessors;
   }
 
@@ -3418,7 +3408,7 @@
 
   @override
   void set fields(List<FieldElement> fields) {
-    assert(_unlinkedEnum == null);
+    _assertNotResynthesized(_unlinkedEnum);
     super.fields = fields;
   }
 
@@ -3477,10 +3467,11 @@
 
   @override
   int get nameOffset {
-    if (_unlinkedEnum != null) {
+    int offset = super.nameOffset;
+    if (offset == 0 && _unlinkedEnum != null && _unlinkedEnum.nameOffset != 0) {
       return _unlinkedEnum.nameOffset;
     }
-    return super.nameOffset;
+    return offset;
   }
 
   @override
@@ -3528,8 +3519,8 @@
     // Build the 'index' field.
     fields.add(new FieldElementImpl('index', -1)
       ..enclosingElement = this
-      ..synthetic = true
-      ..final2 = true
+      ..isSynthetic = true
+      ..isFinal = true
       ..type = context.typeProvider.intType);
     // Build the 'values' field.
     fields.add(new ConstFieldElementImpl_EnumValues(this));
@@ -3590,7 +3581,12 @@
   List<TypeParameterElement> _typeParameters;
 
   /**
-   * The return type defined by this executable element.
+   * The declared return type of this executable element.
+   */
+  DartType _declaredReturnType;
+
+  /**
+   * The inferred return type of this executable element.
    */
   DartType _returnType;
 
@@ -3625,7 +3621,7 @@
    * Set whether this executable element's body is asynchronous.
    */
   void set asynchronous(bool isAsynchronous) {
-    assert(serializedExecutable == null);
+    _assertNotResynthesized(serializedExecutable);
     setModifier(Modifier.ASYNCHRONOUS, isAsynchronous);
   }
 
@@ -3645,6 +3641,11 @@
     return super.codeOffset;
   }
 
+  void set declaredReturnType(DartType returnType) {
+    _assertNotResynthesized(serializedExecutable);
+    _declaredReturnType = returnType;
+  }
+
   @override
   String get displayName {
     if (serializedExecutable != null) {
@@ -3665,7 +3666,7 @@
    * Set whether this executable element is external.
    */
   void set external(bool isExternal) {
-    assert(serializedExecutable == null);
+    _assertNotResynthesized(serializedExecutable);
     setModifier(Modifier.EXTERNAL, isExternal);
   }
 
@@ -3683,7 +3684,7 @@
    * [functions].
    */
   void set functions(List<FunctionElement> functions) {
-    assert(serializedExecutable == null);
+    _assertNotResynthesized(serializedExecutable);
     for (FunctionElement function in functions) {
       (function as FunctionElementImpl).enclosingElement = this;
     }
@@ -3694,7 +3695,7 @@
    * Set whether this method's body is a generator.
    */
   void set generator(bool isGenerator) {
-    assert(serializedExecutable == null);
+    _assertNotResynthesized(serializedExecutable);
     setModifier(Modifier.GENERATOR, isGenerator);
   }
 
@@ -3711,7 +3712,7 @@
    * Set whether this executable element has an implicit return type.
    */
   void set hasImplicitReturnType(bool hasImplicitReturnType) {
-    assert(serializedExecutable == null);
+    _assertNotResynthesized(serializedExecutable);
     setModifier(Modifier.IMPLICIT_TYPE, hasImplicitReturnType);
   }
 
@@ -3767,7 +3768,7 @@
    * [labels].
    */
   void set labels(List<LabelElement> labels) {
-    assert(serializedExecutable == null);
+    _assertNotResynthesized(serializedExecutable);
     for (LabelElement label in labels) {
       (label as LabelElementImpl).enclosingElement = this;
     }
@@ -3800,7 +3801,7 @@
    * [variables].
    */
   void set localVariables(List<LocalVariableElement> variables) {
-    assert(serializedExecutable == null);
+    _assertNotResynthesized(serializedExecutable);
     for (LocalVariableElement variable in variables) {
       (variable as LocalVariableElementImpl).enclosingElement = this;
     }
@@ -3826,10 +3827,11 @@
 
   @override
   int get nameOffset {
-    if (serializedExecutable != null) {
+    int offset = super.nameOffset;
+    if (offset == 0 && serializedExecutable != null) {
       return serializedExecutable.nameOffset;
     }
-    return super.nameOffset;
+    return offset;
   }
 
   @override
@@ -3846,7 +3848,7 @@
    * [parameters].
    */
   void set parameters(List<ParameterElement> parameters) {
-    assert(serializedExecutable == null);
+    _assertNotResynthesized(serializedExecutable);
     for (ParameterElement parameter in parameters) {
       (parameter as ParameterElementImpl).enclosingElement = this;
     }
@@ -3855,21 +3857,22 @@
 
   @override
   DartType get returnType {
-    if (serializedExecutable != null && _returnType == null) {
+    if (serializedExecutable != null &&
+        _declaredReturnType == null &&
+        _returnType == null) {
       bool isSetter =
           serializedExecutable.kind == UnlinkedExecutableKind.setter;
       _returnType = enclosingUnit.resynthesizerContext.resolveLinkedType(
-              serializedExecutable.inferredReturnTypeSlot,
-              typeParameterContext) ??
-          enclosingUnit.resynthesizerContext.resolveTypeRef(
-              serializedExecutable.returnType, typeParameterContext,
-              defaultVoid: isSetter && context.analysisOptions.strongMode);
+          serializedExecutable.inferredReturnTypeSlot, typeParameterContext);
+      _declaredReturnType = enclosingUnit.resynthesizerContext.resolveTypeRef(
+          serializedExecutable.returnType, typeParameterContext,
+          defaultVoid: isSetter && context.analysisOptions.strongMode);
     }
-    return _returnType;
+    return _returnType ?? _declaredReturnType;
   }
 
   void set returnType(DartType returnType) {
-    assert(serializedExecutable == null);
+    _assertNotResynthesized(serializedExecutable);
     _returnType = returnType;
   }
 
@@ -3883,7 +3886,7 @@
   }
 
   void set type(FunctionType type) {
-    assert(serializedExecutable == null);
+    _assertNotResynthesized(serializedExecutable);
     _type = type;
   }
 
@@ -3903,7 +3906,7 @@
    * [typeParameters].
    */
   void set typeParameters(List<TypeParameterElement> typeParameters) {
-    assert(serializedExecutable == null);
+    _assertNotResynthesized(serializedExecutable);
     for (TypeParameterElement parameter in typeParameters) {
       (parameter as TypeParameterElementImpl).enclosingElement = this;
     }
@@ -4062,7 +4065,7 @@
   }
 
   void set combinators(List<NamespaceCombinator> combinators) {
-    assert(_unlinkedExportPublic == null);
+    _assertNotResynthesized(_unlinkedExportPublic);
     _combinators = combinators;
   }
 
@@ -4076,7 +4079,7 @@
   }
 
   void set exportedLibrary(LibraryElement exportedLibrary) {
-    assert(_unlinkedExportNonPublic == null);
+    _assertNotResynthesized(_unlinkedExportNonPublic);
     _exportedLibrary = exportedLibrary;
   }
 
@@ -4097,16 +4100,17 @@
   }
 
   void set metadata(List<ElementAnnotation> metadata) {
-    assert(_unlinkedExportNonPublic == null);
+    _assertNotResynthesized(_unlinkedExportNonPublic);
     super.metadata = metadata;
   }
 
   @override
   int get nameOffset {
-    if (_unlinkedExportNonPublic != null) {
+    int offset = super.nameOffset;
+    if (offset == 0 && _unlinkedExportNonPublic != null) {
       return _unlinkedExportNonPublic.offset;
     }
-    return super.nameOffset;
+    return offset;
   }
 
   @override
@@ -4120,7 +4124,7 @@
 
   @override
   void set uri(String uri) {
-    assert(_unlinkedExportPublic == null);
+    _assertNotResynthesized(_unlinkedExportPublic);
     super.uri = uri;
   }
 
@@ -4134,7 +4138,7 @@
 
   @override
   void set uriEnd(int uriEnd) {
-    assert(_unlinkedExportNonPublic == null);
+    _assertNotResynthesized(_unlinkedExportNonPublic);
     super.uriEnd = uriEnd;
   }
 
@@ -4148,7 +4152,7 @@
 
   @override
   void set uriOffset(int uriOffset) {
-    assert(_unlinkedExportNonPublic == null);
+    _assertNotResynthesized(_unlinkedExportNonPublic);
     super.uriOffset = uriOffset;
   }
 
@@ -4216,6 +4220,14 @@
     return hasModifier(Modifier.STATIC);
   }
 
+  /**
+   * Set whether this field is static.
+   */
+  void set isStatic(bool isStatic) {
+    _assertNotResynthesized(_unlinkedVariable);
+    setModifier(Modifier.STATIC, isStatic);
+  }
+
   @override
   bool get isVirtual {
     for (ElementAnnotationImpl annotation in metadata) {
@@ -4229,14 +4241,6 @@
   @override
   ElementKind get kind => ElementKind.FIELD;
 
-  /**
-   * Set whether this field is static.
-   */
-  void set static(bool isStatic) {
-    assert(_unlinkedVariable == null);
-    setModifier(Modifier.STATIC, isStatic);
-  }
-
   @override
   accept(ElementVisitor visitor) => visitor.visitFieldElement(this);
 
@@ -4293,7 +4297,7 @@
   }
 
   void set field(FieldElement field) {
-    assert(_unlinkedParam == null);
+    _assertNotResynthesized(_unlinkedParam);
     _field = field;
   }
 
@@ -4310,7 +4314,7 @@
 
   @override
   void set type(DartType type) {
-    assert(_unlinkedParam == null);
+    _assertNotResynthesized(_unlinkedParam);
     _type = type;
   }
 
@@ -4366,7 +4370,7 @@
   FunctionElementImpl.synthetic(
       List<ParameterElement> parameters, DartType returnType)
       : super("", -1) {
-    synthetic = true;
+    isSynthetic = true;
     this.returnType = returnType;
     this.parameters = parameters;
 
@@ -4383,8 +4387,8 @@
     String identifier = super.identifier;
     Element enclosing = this.enclosingElement;
     if (enclosing is ExecutableElement) {
-      int id = ElementImpl._findElementIndexUsingIdentical(
-          enclosing.functions, this);
+      int id =
+          ElementImpl.findElementIndexUsingIdentical(enclosing.functions, this);
       identifier += "@$id";
     }
     return identifier;
@@ -4437,7 +4441,7 @@
    * [offset] with the given [length].
    */
   void setVisibleRange(int offset, int length) {
-    assert(serializedExecutable == null);
+    _assertNotResynthesized(serializedExecutable);
     _visibleRangeOffset = offset;
     _visibleRangeLength = length;
   }
@@ -4676,10 +4680,11 @@
 
   @override
   int get nameOffset {
-    if (_unlinkedTypedef != null) {
+    int offset = super.nameOffset;
+    if (offset == 0 && _unlinkedTypedef != null) {
       return _unlinkedTypedef.nameOffset;
     }
-    return super.nameOffset;
+    return offset;
   }
 
   @override
@@ -4695,7 +4700,7 @@
    * Set the parameters defined by this type alias to the given [parameters].
    */
   void set parameters(List<ParameterElement> parameters) {
-    assert(_unlinkedTypedef == null);
+    _assertNotResynthesized(_unlinkedTypedef);
     if (parameters != null) {
       for (ParameterElement parameter in parameters) {
         (parameter as ParameterElementImpl).enclosingElement = this;
@@ -4714,7 +4719,7 @@
   }
 
   void set returnType(DartType returnType) {
-    assert(_unlinkedTypedef == null);
+    _assertNotResynthesized(_unlinkedTypedef);
     _returnType = returnType;
   }
 
@@ -4727,7 +4732,7 @@
   }
 
   void set type(FunctionType type) {
-    assert(_unlinkedTypedef == null);
+    _assertNotResynthesized(_unlinkedTypedef);
     _type = type;
   }
 
@@ -4747,7 +4752,7 @@
    * [typeParameters].
    */
   void set typeParameters(List<TypeParameterElement> typeParameters) {
-    assert(_unlinkedTypedef == null);
+    _assertNotResynthesized(_unlinkedTypedef);
     for (TypeParameterElement typeParameter in typeParameters) {
       (typeParameter as TypeParameterElementImpl).enclosingElement = this;
     }
@@ -4854,7 +4859,7 @@
   }
 
   void set hiddenNames(List<String> hiddenNames) {
-    assert(_unlinkedCombinator == null);
+    _assertNotResynthesized(_unlinkedCombinator);
     _hiddenNames = hiddenNames;
   }
 
@@ -4941,7 +4946,7 @@
   }
 
   void set combinators(List<NamespaceCombinator> combinators) {
-    assert(_unlinkedImport == null);
+    _assertNotResynthesized(_unlinkedImport);
     _combinators = combinators;
   }
 
@@ -4949,7 +4954,7 @@
    * Set whether this import is for a deferred library.
    */
   void set deferred(bool isDeferred) {
-    assert(_unlinkedImport == null);
+    _assertNotResynthesized(_unlinkedImport);
     setModifier(Modifier.DEFERRED, isDeferred);
   }
 
@@ -4973,7 +4978,7 @@
   }
 
   void set importedLibrary(LibraryElement importedLibrary) {
-    assert(_unlinkedImport == null);
+    _assertNotResynthesized(_unlinkedImport);
     _importedLibrary = importedLibrary;
   }
 
@@ -5007,19 +5012,20 @@
   }
 
   void set metadata(List<ElementAnnotation> metadata) {
-    assert(_unlinkedImport == null);
+    _assertNotResynthesized(_unlinkedImport);
     super.metadata = metadata;
   }
 
   @override
   int get nameOffset {
-    if (_unlinkedImport != null) {
+    int offset = super.nameOffset;
+    if (offset == 0 && _unlinkedImport != null) {
       if (_unlinkedImport.isImplicit) {
         return -1;
       }
       return _unlinkedImport.offset;
     }
-    return super.nameOffset;
+    return offset;
   }
 
   PrefixElement get prefix {
@@ -5033,7 +5039,7 @@
   }
 
   void set prefix(PrefixElement prefix) {
-    assert(_unlinkedImport == null);
+    _assertNotResynthesized(_unlinkedImport);
     _prefix = prefix;
   }
 
@@ -5046,7 +5052,7 @@
   }
 
   void set prefixOffset(int prefixOffset) {
-    assert(_unlinkedImport == null);
+    _assertNotResynthesized(_unlinkedImport);
     _prefixOffset = prefixOffset;
   }
 
@@ -5064,7 +5070,7 @@
 
   @override
   void set uri(String uri) {
-    assert(_unlinkedImport == null);
+    _assertNotResynthesized(_unlinkedImport);
     super.uri = uri;
   }
 
@@ -5081,7 +5087,7 @@
 
   @override
   void set uriEnd(int uriEnd) {
-    assert(_unlinkedImport == null);
+    _assertNotResynthesized(_unlinkedImport);
     super.uriEnd = uriEnd;
   }
 
@@ -5098,7 +5104,7 @@
 
   @override
   void set uriOffset(int uriOffset) {
-    assert(_unlinkedImport == null);
+    _assertNotResynthesized(_unlinkedImport);
     super.uriOffset = uriOffset;
   }
 
@@ -5222,10 +5228,13 @@
 
   @override
   int get nameOffset {
-    if (_unlinkedLabel != null) {
+    int offset = super.nameOffset;
+    if (offset == 0 &&
+        _unlinkedLabel != null &&
+        _unlinkedLabel.nameOffset != 0) {
       return _unlinkedLabel.nameOffset;
     }
-    return super.nameOffset;
+    return offset;
   }
 
   @override
@@ -5452,14 +5461,20 @@
           _unlinkedDefiningUnit.exports.length == unlinkedPublicExports.length);
       int length = unlinkedNonPublicExports.length;
       if (length != 0) {
-        List<ExportElement> exports = new List<ExportElement>(length);
+        List<ExportElement> exports = new List<ExportElement>();
         for (int i = 0; i < length; i++) {
           UnlinkedExportPublic serializedExportPublic =
               unlinkedPublicExports[i];
-          UnlinkedExportNonPublic serializedExportNonPublic =
-              unlinkedNonPublicExports[i];
-          exports[i] = new ExportElementImpl.forSerialized(
-              serializedExportPublic, serializedExportNonPublic, library);
+          LibraryElement exportedLibrary = resynthesizerContext
+              .buildExportedLibrary(serializedExportPublic.uri);
+          if (exportedLibrary != null) {
+            UnlinkedExportNonPublic serializedExportNonPublic =
+                unlinkedNonPublicExports[i];
+            ExportElementImpl exportElement =
+                new ExportElementImpl.forSerialized(
+                    serializedExportPublic, serializedExportNonPublic, library);
+            exports.add(exportElement);
+          }
         }
         _exports = exports;
       } else {
@@ -5474,7 +5489,7 @@
    * given list of [exports].
    */
   void set exports(List<ExportElement> exports) {
-    assert(_unlinkedDefiningUnit == null);
+    _assertNotResynthesized(_unlinkedDefiningUnit);
     for (ExportElement exportElement in exports) {
       (exportElement as ExportElementImpl).enclosingElement = this;
     }
@@ -5525,11 +5540,18 @@
       List<UnlinkedImport> unlinkedImports = _unlinkedDefiningUnit.imports;
       int length = unlinkedImports.length;
       if (length != 0) {
-        List<ImportElement> imports = new List<ImportElement>(length);
+        List<ImportElement> imports = new List<ImportElement>();
         LinkedLibrary linkedLibrary = resynthesizerContext.linkedLibrary;
         for (int i = 0; i < length; i++) {
-          imports[i] = new ImportElementImpl.forSerialized(
-              unlinkedImports[i], linkedLibrary.importDependencies[i], library);
+          int dependency = linkedLibrary.importDependencies[i];
+          LibraryElement importedLibrary =
+              resynthesizerContext.buildImportedLibrary(dependency);
+          if (importedLibrary != null) {
+            ImportElementImpl importElement =
+                new ImportElementImpl.forSerialized(
+                    unlinkedImports[i], dependency, library);
+            imports.add(importElement);
+          }
         }
         _imports = imports;
       } else {
@@ -5544,7 +5566,7 @@
    * given list of [imports].
    */
   void set imports(List<ImportElement> imports) {
-    assert(_unlinkedDefiningUnit == null);
+    _assertNotResynthesized(_unlinkedDefiningUnit);
     for (ImportElement importElement in imports) {
       (importElement as ImportElementImpl).enclosingElement = this;
       PrefixElementImpl prefix = importElement.prefix as PrefixElementImpl;
@@ -5775,7 +5797,7 @@
   void createLoadLibraryFunction(TypeProvider typeProvider) {
     FunctionElementImpl function =
         new FunctionElementImpl(FunctionElement.LOAD_LIBRARY_NAME, -1);
-    function.synthetic = true;
+    function.isSynthetic = true;
     function.enclosingElement = this;
     function.returnType = typeProvider.futureDynamicType;
     function.type = new FunctionTypeImpl(function);
@@ -6024,7 +6046,7 @@
     String identifier = super.identifier;
     Element enclosing = this.enclosingElement;
     if (enclosing is ExecutableElement) {
-      int id = ElementImpl._findElementIndexUsingIdentical(
+      int id = ElementImpl.findElementIndexUsingIdentical(
           enclosing.localVariables, this);
       identifier += "@$id";
     }
@@ -6074,7 +6096,7 @@
    * [offset] with the given [length].
    */
   void setVisibleRange(int offset, int length) {
-    assert(_unlinkedVariable == null);
+    _assertNotResynthesized(_unlinkedVariable);
     _visibleRangeOffset = offset;
     _visibleRangeLength = length;
   }
@@ -6106,7 +6128,7 @@
    * Set whether this method is abstract.
    */
   void set abstract(bool isAbstract) {
-    assert(serializedExecutable == null);
+    _assertNotResynthesized(serializedExecutable);
     setModifier(Modifier.ABSTRACT, isAbstract);
   }
 
@@ -6155,6 +6177,14 @@
     return hasModifier(Modifier.STATIC);
   }
 
+  /**
+   * Set whether this method is static.
+   */
+  void set isStatic(bool isStatic) {
+    _assertNotResynthesized(serializedExecutable);
+    setModifier(Modifier.STATIC, isStatic);
+  }
+
   @override
   ElementKind get kind => ElementKind.METHOD;
 
@@ -6167,14 +6197,6 @@
     return super.name;
   }
 
-  /**
-   * Set whether this method is static.
-   */
-  void set static(bool isStatic) {
-    assert(serializedExecutable == null);
-    setModifier(Modifier.STATIC, isStatic);
-  }
-
   @override
   accept(ElementVisitor visitor) => visitor.visitMethodElement(this);
 
@@ -6584,7 +6606,7 @@
   List<ExecutableElement> _elements = MethodElement.EMPTY_LIST;
 
   MultiplyInheritedMethodElementImpl(Identifier name) : super.forNode(name) {
-    synthetic = true;
+    isSynthetic = true;
   }
 
   @override
@@ -6610,7 +6632,7 @@
 
   MultiplyInheritedPropertyAccessorElementImpl(Identifier name)
       : super.forNode(name) {
-    synthetic = true;
+    isSynthetic = true;
   }
 
   @override
@@ -6672,12 +6694,6 @@
   }
 
   @override
-  void set const3(bool isConst) {
-    assert(_unlinkedVariable == null);
-    super.const3 = isConst;
-  }
-
-  @override
   String get documentationComment {
     if (_unlinkedVariable != null) {
       return _unlinkedVariable?.documentationComment?.text;
@@ -6686,12 +6702,6 @@
   }
 
   @override
-  void set final2(bool isFinal) {
-    assert(_unlinkedVariable == null);
-    super.final2 = isFinal;
-  }
-
-  @override
   bool get hasImplicitType {
     if (_unlinkedVariable != null) {
       return _unlinkedVariable.type == null;
@@ -6701,7 +6711,7 @@
 
   @override
   void set hasImplicitType(bool hasImplicitType) {
-    assert(_unlinkedVariable == null);
+    _assertNotResynthesized(_unlinkedVariable);
     super.hasImplicitType = hasImplicitType;
   }
 
@@ -6711,7 +6721,7 @@
       UnlinkedExecutable unlinkedInitializer = _unlinkedVariable.initializer;
       if (unlinkedInitializer != null) {
         _initializer = new FunctionElementImpl.forSerialized(
-            unlinkedInitializer, this)..synthetic = true;
+            unlinkedInitializer, this)..isSynthetic = true;
       } else {
         return null;
       }
@@ -6724,7 +6734,7 @@
    * [function].
    */
   void set initializer(FunctionElement function) {
-    assert(_unlinkedVariable == null);
+    _assertNotResynthesized(_unlinkedVariable);
     super.initializer = function;
   }
 
@@ -6737,6 +6747,12 @@
   }
 
   @override
+  void set isConst(bool isConst) {
+    _assertNotResynthesized(_unlinkedVariable);
+    super.isConst = isConst;
+  }
+
+  @override
   bool get isFinal {
     if (_unlinkedVariable != null) {
       return _unlinkedVariable.isFinal;
@@ -6745,6 +6761,12 @@
   }
 
   @override
+  void set isFinal(bool isFinal) {
+    _assertNotResynthesized(_unlinkedVariable);
+    super.isFinal = isFinal;
+  }
+
+  @override
   List<ElementAnnotation> get metadata {
     if (_unlinkedVariable != null) {
       return _metadata ??=
@@ -6763,32 +6785,33 @@
 
   @override
   int get nameOffset {
-    if (_unlinkedVariable != null) {
+    int offset = super.nameOffset;
+    if (offset == 0 && _unlinkedVariable != null) {
       return _unlinkedVariable.nameOffset;
     }
-    return super.nameOffset;
+    return offset;
   }
 
   @override
   DartType get type {
-    if (_unlinkedVariable != null && _type == null) {
+    if (_unlinkedVariable != null && _declaredType == null && _type == null) {
       _type = enclosingUnit.resynthesizerContext.resolveLinkedType(
-              _unlinkedVariable.inferredTypeSlot, typeParameterContext) ??
-          enclosingUnit.resynthesizerContext
-              .resolveTypeRef(_unlinkedVariable.type, typeParameterContext);
+          _unlinkedVariable.inferredTypeSlot, typeParameterContext);
+      _declaredType = enclosingUnit.resynthesizerContext
+          .resolveTypeRef(_unlinkedVariable.type, typeParameterContext);
     }
     return super.type;
   }
 
   void set type(DartType type) {
-    assert(_unlinkedVariable == null);
+    _assertNotResynthesized(_unlinkedVariable);
     _type = type;
   }
 
   /**
    * Subclasses need this getter, see [ConstVariableElement._unlinkedConst].
    */
-  UnlinkedConst get _unlinkedConst => _unlinkedVariable?.initializer?.bodyExpr;
+  UnlinkedExpr get _unlinkedConst => _unlinkedVariable?.initializer?.bodyExpr;
 }
 
 /**
@@ -6837,12 +6860,7 @@
    */
   int _visibleRangeLength = -1;
 
-  /**
-   * True if this parameter inherits from a covariant parameter. This happens
-   * when it overrides a method in a supertype that has a corresponding
-   * covariant parameter.
-   */
-  bool inheritsCovariant = false;
+  bool _inheritsCovariant = false;
 
   /**
    * Initialize a newly created parameter element to have the given [name] and
@@ -6890,7 +6908,7 @@
             unlinkedParameter, enclosingElement);
       }
     }
-    element.synthetic = synthetic;
+    element.isSynthetic = synthetic;
     return element;
   }
 
@@ -6901,7 +6919,7 @@
       String name, DartType type, ParameterKind kind) {
     ParameterElementImpl element = new ParameterElementImpl(name, -1);
     element.type = type;
-    element.synthetic = true;
+    element.isSynthetic = true;
     element.parameterKind = kind;
     return element;
   }
@@ -6923,12 +6941,6 @@
   }
 
   @override
-  void set const3(bool isConst) {
-    assert(_unlinkedParam == null);
-    super.const3 = isConst;
-  }
-
-  @override
   String get defaultValueCode {
     if (_unlinkedParam != null) {
       if (_unlinkedParam.initializer?.bodyExpr == null) {
@@ -6943,17 +6955,11 @@
    * Set Dart code of the default value.
    */
   void set defaultValueCode(String defaultValueCode) {
-    assert(_unlinkedParam == null);
+    _assertNotResynthesized(_unlinkedParam);
     this._defaultValueCode = StringUtilities.intern(defaultValueCode);
   }
 
   @override
-  void set final2(bool isFinal) {
-    assert(_unlinkedParam == null);
-    super.final2 = isFinal;
-  }
-
-  @override
   bool get hasImplicitType {
     if (_unlinkedParam != null) {
       return _unlinkedParam.type == null;
@@ -6963,17 +6969,39 @@
 
   @override
   void set hasImplicitType(bool hasImplicitType) {
-    assert(_unlinkedParam == null);
+    _assertNotResynthesized(_unlinkedParam);
     super.hasImplicitType = hasImplicitType;
   }
 
+  /**
+   * True if this parameter inherits from a covariant parameter. This happens
+   * when it overrides a method in a supertype that has a corresponding
+   * covariant parameter.
+   */
+  bool get inheritsCovariant {
+    if (_unlinkedParam != null) {
+      return enclosingUnit.resynthesizerContext
+          .inheritsCovariant(_unlinkedParam.inheritsCovariantSlot);
+    } else {
+      return _inheritsCovariant;
+    }
+  }
+
+  /**
+   * Record whether or not this parameter inherits from a covariant parameter.
+   */
+  void set inheritsCovariant(bool value) {
+    _assertNotResynthesized(_unlinkedParam);
+    _inheritsCovariant = value;
+  }
+
   @override
   FunctionElement get initializer {
     if (_unlinkedParam != null && _initializer == null) {
       UnlinkedExecutable unlinkedInitializer = _unlinkedParam.initializer;
       if (unlinkedInitializer != null) {
         _initializer = new FunctionElementImpl.forSerialized(
-            unlinkedInitializer, this)..synthetic = true;
+            unlinkedInitializer, this)..isSynthetic = true;
       } else {
         return null;
       }
@@ -6986,7 +7014,7 @@
    * [function].
    */
   void set initializer(FunctionElement function) {
-    assert(_unlinkedParam == null);
+    _assertNotResynthesized(_unlinkedParam);
     super.initializer = function;
   }
 
@@ -6999,6 +7027,12 @@
   }
 
   @override
+  void set isConst(bool isConst) {
+    _assertNotResynthesized(_unlinkedParam);
+    super.isConst = isConst;
+  }
+
+  @override
   bool get isCovariant {
     if (inheritsCovariant) {
       return true;
@@ -7020,6 +7054,12 @@
   }
 
   @override
+  void set isFinal(bool isFinal) {
+    _assertNotResynthesized(_unlinkedParam);
+    super.isFinal = isFinal;
+  }
+
+  @override
   bool get isInitializingFormal => false;
 
   @override
@@ -7050,13 +7090,14 @@
 
   @override
   int get nameOffset {
-    if (_unlinkedParam != null) {
+    int offset = super.nameOffset;
+    if (offset == 0 && _unlinkedParam != null) {
       if (isSynthetic) {
         return -1;
       }
       return _unlinkedParam.nameOffset;
     }
-    return super.nameOffset;
+    return offset;
   }
 
   @override
@@ -7078,7 +7119,7 @@
   }
 
   void set parameterKind(ParameterKind parameterKind) {
-    assert(_unlinkedParam == null);
+    _assertNotResynthesized(_unlinkedParam);
     _parameterKind = parameterKind;
   }
 
@@ -7137,7 +7178,7 @@
   /**
    * Subclasses need this getter, see [ConstVariableElement._unlinkedConst].
    */
-  UnlinkedConst get _unlinkedConst => _unlinkedParam?.initializer?.bodyExpr;
+  UnlinkedExpr get _unlinkedConst => _unlinkedParam?.initializer?.bodyExpr;
 
   @override
   accept(ElementVisitor visitor) => visitor.visitParameterElement(this);
@@ -7181,7 +7222,7 @@
    * [offset] with the given [length].
    */
   void setVisibleRange(int offset, int length) {
-    assert(_unlinkedParam == null);
+    _assertNotResynthesized(_unlinkedParam);
     _visibleRangeOffset = offset;
     _visibleRangeLength = length;
   }
@@ -7197,7 +7238,7 @@
    * been build yet, build them and remember in the corresponding fields.
    */
   void _resynthesizeTypeAndParameters() {
-    if (_unlinkedParam != null && _type == null) {
+    if (_unlinkedParam != null && _declaredType == null && _type == null) {
       if (_unlinkedParam.isFunctionTyped) {
         CompilationUnitElementImpl enclosingUnit = this.enclosingUnit;
         FunctionElementImpl parameterTypeElement =
@@ -7224,9 +7265,9 @@
         _type = parameterType;
       } else {
         _type = enclosingUnit.resynthesizerContext.resolveLinkedType(
-                _unlinkedParam.inferredTypeSlot, typeParameterContext) ??
-            enclosingUnit.resynthesizerContext
-                .resolveTypeRef(_unlinkedParam.type, typeParameterContext);
+            _unlinkedParam.inferredTypeSlot, typeParameterContext);
+        _declaredType = enclosingUnit.resynthesizerContext
+            .resolveTypeRef(_unlinkedParam.type, typeParameterContext);
       }
     }
   }
@@ -7263,7 +7304,7 @@
       : setter = setter,
         super('_${setter.variable.name}', setter.variable.nameOffset) {
     enclosingElement = setter;
-    synthetic = true;
+    isSynthetic = true;
     parameterKind = ParameterKind.REQUIRED;
   }
 
@@ -7372,10 +7413,11 @@
 
   @override
   int get nameOffset {
-    if (_unlinkedImport != null) {
+    int offset = super.nameOffset;
+    if (offset == 0 && _unlinkedImport != null) {
       return _unlinkedImport.prefixOffset;
     }
-    return super.nameOffset;
+    return offset;
   }
 
   @override
@@ -7424,15 +7466,15 @@
   PropertyAccessorElementImpl.forVariable(PropertyInducingElementImpl variable)
       : super(variable.name, variable.nameOffset) {
     this.variable = variable;
-    static = variable.isStatic;
-    synthetic = true;
+    isStatic = variable.isStatic;
+    isSynthetic = true;
   }
 
   /**
    * Set whether this accessor is abstract.
    */
   void set abstract(bool isAbstract) {
-    assert(serializedExecutable == null);
+    _assertNotResynthesized(serializedExecutable);
     setModifier(Modifier.ABSTRACT, isAbstract);
   }
 
@@ -7479,7 +7521,7 @@
    * Set whether this accessor is a getter.
    */
   void set getter(bool isGetter) {
-    assert(serializedExecutable == null);
+    _assertNotResynthesized(serializedExecutable);
     setModifier(Modifier.GETTER, isGetter);
   }
 
@@ -7515,6 +7557,14 @@
     return hasModifier(Modifier.STATIC);
   }
 
+  /**
+   * Set whether this accessor is static.
+   */
+  void set isStatic(bool isStatic) {
+    _assertNotResynthesized(serializedExecutable);
+    setModifier(Modifier.STATIC, isStatic);
+  }
+
   @override
   ElementKind get kind {
     if (isGetter) {
@@ -7538,18 +7588,10 @@
    * Set whether this accessor is a setter.
    */
   void set setter(bool isSetter) {
-    assert(serializedExecutable == null);
+    _assertNotResynthesized(serializedExecutable);
     setModifier(Modifier.SETTER, isSetter);
   }
 
-  /**
-   * Set whether this accessor is static.
-   */
-  void set static(bool isStatic) {
-    assert(serializedExecutable == null);
-    setModifier(Modifier.STATIC, isStatic);
-  }
-
   @override
   accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this);
 
@@ -7708,7 +7750,7 @@
   }
 
   void set propagatedType(DartType propagatedType) {
-    assert(_unlinkedVariable == null);
+    _assertNotResynthesized(_unlinkedVariable);
     _propagatedType = propagatedType;
   }
 }
@@ -7718,14 +7760,14 @@
  */
 abstract class ResynthesizerContext {
   /**
-   * Build [ElementAnnotationImpl] for the given [UnlinkedConst].
+   * Build [ElementAnnotationImpl] for the given [UnlinkedExpr].
    */
-  ElementAnnotationImpl buildAnnotation(ElementImpl context, UnlinkedConst uc);
+  ElementAnnotationImpl buildAnnotation(ElementImpl context, UnlinkedExpr uc);
 
   /**
-   * Build [Expression] for the given [UnlinkedConst].
+   * Build [Expression] for the given [UnlinkedExpr].
    */
-  Expression buildExpression(ElementImpl context, UnlinkedConst uc);
+  Expression buildExpression(ElementImpl context, UnlinkedExpr uc);
 
   /**
    * Build explicit top-level property accessors.
@@ -7738,6 +7780,11 @@
   UnitExplicitTopLevelVariables buildTopLevelVariables();
 
   /**
+   * Return `true` if the given parameter [slot] inherits `@covariant` behavior.
+   */
+  bool inheritsCovariant(int slot);
+
+  /**
    * Return `true` if the given const constructor [slot] is a part of a cycle.
    */
   bool isInConstCycle(int slot);
@@ -7810,7 +7857,7 @@
   }
 
   void set end(int end) {
-    assert(_unlinkedCombinator == null);
+    _assertNotResynthesized(_unlinkedCombinator);
     _end = end;
   }
 
@@ -7823,7 +7870,7 @@
   }
 
   void set offset(int offset) {
-    assert(_unlinkedCombinator == null);
+    _assertNotResynthesized(_unlinkedCombinator);
     _offset = offset;
   }
 
@@ -7836,7 +7883,7 @@
   }
 
   void set shownNames(List<String> shownNames) {
-    assert(_unlinkedCombinator == null);
+    _assertNotResynthesized(_unlinkedCombinator);
     _shownNames = shownNames;
   }
 
@@ -7954,7 +8001,7 @@
       : _unlinkedTypeParam = null,
         nestingLevel = null,
         super(name, -1) {
-    synthetic = true;
+    isSynthetic = true;
   }
 
   DartType get bound {
@@ -7970,7 +8017,7 @@
   }
 
   void set bound(DartType bound) {
-    assert(_unlinkedTypeParam == null);
+    _assertNotResynthesized(_unlinkedTypeParam);
     _bound = bound;
   }
 
@@ -8015,10 +8062,11 @@
 
   @override
   int get nameOffset {
-    if (_unlinkedTypeParam != null) {
+    int offset = super.nameOffset;
+    if (offset == 0 && _unlinkedTypeParam != null) {
       return _unlinkedTypeParam.nameOffset;
     }
-    return super.nameOffset;
+    return offset;
   }
 
   TypeParameterType get type {
@@ -8278,6 +8326,11 @@
   /**
    * The declared type of this variable.
    */
+  DartType _declaredType;
+
+  /**
+   * The inferred type of this variable.
+   */
   DartType _type;
 
   /**
@@ -8304,13 +8357,6 @@
       : super.forSerialized(enclosingElement);
 
   /**
-   * Set whether this variable is const.
-   */
-  void set const3(bool isConst) {
-    setModifier(Modifier.CONST, isConst);
-  }
-
-  /**
    * If this element represents a constant variable, and it has an initializer,
    * a copy of the initializer for the constant.  Otherwise `null`.
    *
@@ -8324,6 +8370,10 @@
   @override
   DartObject get constantValue => evaluationResult?.value;
 
+  void set declaredType(DartType type) {
+    _declaredType = type;
+  }
+
   @override
   String get displayName => name;
 
@@ -8344,13 +8394,6 @@
         "Invalid attempt to set a compile-time constant result");
   }
 
-  /**
-   * Set whether this variable is final.
-   */
-  void set final2(bool isFinal) {
-    setModifier(Modifier.FINAL, isFinal);
-  }
-
   @override
   bool get hasImplicitType {
     return hasModifier(Modifier.IMPLICIT_TYPE);
@@ -8382,11 +8425,25 @@
     return hasModifier(Modifier.CONST);
   }
 
+  /**
+   * Set whether this variable is const.
+   */
+  void set isConst(bool isConst) {
+    setModifier(Modifier.CONST, isConst);
+  }
+
   @override
   bool get isFinal {
     return hasModifier(Modifier.FINAL);
   }
 
+  /**
+   * Set whether this variable is final.
+   */
+  void set isFinal(bool isFinal) {
+    setModifier(Modifier.FINAL, isFinal);
+  }
+
   @override
   bool get isPotentiallyMutatedInClosure => false;
 
@@ -8397,7 +8454,7 @@
   bool get isStatic => hasModifier(Modifier.STATIC);
 
   @override
-  DartType get type => _type;
+  DartType get type => _type ?? _declaredType;
 
   void set type(DartType type) {
     _type = type;
diff --git a/pkg/analyzer/lib/src/dart/element/member.dart b/pkg/analyzer/lib/src/dart/element/member.dart
index 29b347f..6210e77 100644
--- a/pkg/analyzer/lib/src/dart/element/member.dart
+++ b/pkg/analyzer/lib/src/dart/element/member.dart
@@ -742,34 +742,6 @@
     super.visitChildren(visitor);
     safelyVisitChildren(parameters, visitor);
   }
-
-  /**
-   * If the given [parameter]'s type is different when any type parameters from
-   * the defining type's declaration are replaced with the actual type
-   * arguments from the [definingType], create a parameter member representing
-   * the given parameter. Return the member that was created, or the base
-   * parameter if no member was created.
-   */
-  static ParameterElement from(
-      ParameterElement parameter, ParameterizedType definingType) {
-    if (parameter == null || definingType.typeArguments.length == 0) {
-      return parameter;
-    }
-    // Check if parameter type depends on defining type type arguments.
-    // It is possible that we did not resolve field formal parameter yet,
-    // so skip this check for it.
-    if (parameter is FieldFormalParameterElement) {
-      return new FieldFormalParameterMember(parameter, definingType);
-    } else {
-      DartType baseType = parameter.type;
-      List<DartType> argumentTypes = definingType.typeArguments;
-      List<DartType> parameterTypes =
-          TypeParameterTypeImpl.getTypes(definingType.typeParameters);
-      DartType substitutedType =
-          baseType.substitute2(argumentTypes, parameterTypes);
-      return new ParameterMember(parameter, definingType, substitutedType);
-    }
-  }
 }
 
 /**
@@ -951,12 +923,6 @@
   TypeParameterType get type => _type;
 
   @override
-  bool operator ==(obj) =>
-      // TODO(jmesserly): this equality should consider the bound, see:
-      // https://github.com/dart-lang/sdk/issues/27210
-      obj is TypeParameterMember && obj.baseElement == baseElement;
-
-  @override
   accept(ElementVisitor visitor) => visitor.visitTypeParameterElement(this);
 
   /**
diff --git a/pkg/analyzer/lib/src/dart/element/type.dart b/pkg/analyzer/lib/src/dart/element/type.dart
index 4c2e971..bf898e0 100644
--- a/pkg/analyzer/lib/src/dart/element/type.dart
+++ b/pkg/analyzer/lib/src/dart/element/type.dart
@@ -515,13 +515,41 @@
     if (parameterCount == 0) {
       return baseParameters;
     }
+
     // create specialized parameters
-    List<ParameterElement> specializedParameters =
-        new List<ParameterElement>(parameterCount);
+    var specializedParams = new List<ParameterElement>(parameterCount);
+
+    var parameterTypes = TypeParameterTypeImpl.getTypes(typeParameters);
     for (int i = 0; i < parameterCount; i++) {
-      specializedParameters[i] = ParameterMember.from(baseParameters[i], this);
+      var parameter = baseParameters[i];
+      if (parameter?.type == null) {
+        specializedParams[i] = parameter;
+        continue;
+      }
+
+      // Check if parameter type depends on defining type type arguments, or
+      // if it needs to be pruned.
+
+      if (parameter is FieldFormalParameterElement) {
+        // TODO(jmesserly): this seems like it won't handle pruning correctly.
+        specializedParams[i] = new FieldFormalParameterMember(parameter, this);
+        continue;
+      }
+
+      var baseType = parameter.type as TypeImpl;
+      TypeImpl type;
+      if (typeArguments.isEmpty ||
+          typeArguments.length != typeParameters.length) {
+        type = baseType.pruned(newPrune);
+      } else {
+        type = baseType.substitute2(typeArguments, parameterTypes, newPrune);
+      }
+
+      specializedParams[i] = identical(type, baseType)
+          ? parameter
+          : new ParameterMember(parameter, this, type);
     }
-    return specializedParameters;
+    return specializedParams;
   }
 
   @override
@@ -634,6 +662,7 @@
         return instantiate(freshVariables) ==
             object.instantiate(freshVariables);
       }
+
       return returnType == object.returnType &&
           TypeImpl.equalArrays(
               normalParameterTypes, object.normalParameterTypes) &&
@@ -2526,6 +2555,12 @@
       : super(element, element.name);
 
   @override
+  ElementLocation get definition => element.location;
+
+  @override
+  DartType get bound => element.bound ?? DynamicTypeImpl.instance;
+
+  @override
   TypeParameterElement get element => super.element as TypeParameterElement;
 
   @override
diff --git a/pkg/analyzer/lib/src/dart/element/utilities.dart b/pkg/analyzer/lib/src/dart/element/utilities.dart
deleted file mode 100644
index 7c5aa4c..0000000
--- a/pkg/analyzer/lib/src/dart/element/utilities.dart
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library analyzer.src.dart.element.utilities;
-
-import 'dart:collection';
-
-import 'package:analyzer/dart/element/element.dart';
-import 'package:analyzer/dart/element/visitor.dart';
-
-/**
- * A visitor that can be used to collect all of the non-synthetic elements in an
- * element model.
- */
-class ElementGatherer extends GeneralizingElementVisitor {
-  /**
-   * The set in which the elements are collected.
-   */
-  final Set<Element> elements = new HashSet<Element>();
-
-  /**
-   * Initialize the visitor.
-   */
-  ElementGatherer();
-
-  @override
-  void visitElement(Element element) {
-    if (!element.isSynthetic) {
-      elements.add(element);
-    }
-    super.visitElement(element);
-  }
-}
diff --git a/pkg/analyzer/lib/src/dart/error/hint_codes.dart b/pkg/analyzer/lib/src/dart/error/hint_codes.dart
new file mode 100644
index 0000000..a81585b
--- /dev/null
+++ b/pkg/analyzer/lib/src/dart/error/hint_codes.dart
@@ -0,0 +1,621 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analyzer.src.dart.error.hint_codes;
+
+import 'package:analyzer/error/error.dart';
+import 'package:analyzer/src/dart/element/element.dart';
+
+/**
+ * The hints and coding recommendations for best practices which are not
+ * mentioned in the Dart Language Specification.
+ */
+class HintCode extends ErrorCode {
+  /**
+   * When an abstract supertype member is referenced with `super` as its target,
+   * it cannot be overridden, so it is always a runtime error.
+   *
+   * Parameters:
+   * 0: the display name for the kind of the referenced element
+   * 1: the name of the referenced element
+   */
+  static const HintCode ABSTRACT_SUPER_MEMBER_REFERENCE = const HintCode(
+      'ABSTRACT_SUPER_MEMBER_REFERENCE',
+      "The {0} '{1}' is always abstract in the supertype.");
+
+  /**
+   * This hint is generated anywhere where the
+   * [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE] would have been generated,
+   * if we used propagated information for the warnings.
+   *
+   * Parameters:
+   * 0: the name of the actual argument type
+   * 1: the name of the expected type
+   */
+  static const HintCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const HintCode(
+      'ARGUMENT_TYPE_NOT_ASSIGNABLE',
+      "The argument type '{0}' can't be assigned to the parameter type '{1}'.");
+
+  /**
+   * When the target expression uses '?.' operator, it can be `null`, so all the
+   * subsequent invocations should also use '?.' operator.
+   */
+  static const HintCode CAN_BE_NULL_AFTER_NULL_AWARE = const HintCode(
+      'CAN_BE_NULL_AFTER_NULL_AWARE',
+      "The target expression uses '?.', so its value can be null.",
+      "Replace the '.' with a '?.' in the invocation.");
+
+  /**
+   * Dead code is code that is never reached, this can happen for instance if a
+   * statement follows a return statement.
+   */
+  static const HintCode DEAD_CODE = const HintCode(
+      'DEAD_CODE',
+      "Dead code.",
+      "Try removing the code, or "
+      "fixing the code before it so that it can be reached.");
+
+  /**
+   * Dead code is code that is never reached. This case covers cases where the
+   * user has catch clauses after `catch (e)` or `on Object catch (e)`.
+   */
+  static const HintCode DEAD_CODE_CATCH_FOLLOWING_CATCH = const HintCode(
+      'DEAD_CODE_CATCH_FOLLOWING_CATCH',
+      "Dead code: catch clauses after a 'catch (e)' or "
+      "an 'on Object catch (e)' are never reached.",
+      "Try reordering the catch clauses so that they can be reached, or "
+      "removing the unreachable catch clauses.");
+
+  /**
+   * Dead code is code that is never reached. This case covers cases where the
+   * user has an on-catch clause such as `on A catch (e)`, where a supertype of
+   * `A` was already caught.
+   *
+   * Parameters:
+   * 0: name of the subtype
+   * 1: name of the supertype
+   */
+  static const HintCode DEAD_CODE_ON_CATCH_SUBTYPE = const HintCode(
+      'DEAD_CODE_ON_CATCH_SUBTYPE',
+      "Dead code: this on-catch block will never be executed because '{0}' is "
+      "a subtype of '{1}' and hence will have been caught above.",
+      "Try reordering the catch clauses so that this block can be reached, or "
+      "removing the unreachable catch clause.");
+
+  /**
+   * Deprecated members should not be invoked or used.
+   *
+   * Parameters:
+   * 0: the name of the member
+   */
+  static const HintCode DEPRECATED_MEMBER_USE = const HintCode(
+      'DEPRECATED_MEMBER_USE',
+      "'{0}' is deprecated and shouldn't be used.",
+      "Try replacing the use of the deprecated member with the replacement.");
+
+  /**
+   * Hint to use the ~/ operator.
+   */
+  static const HintCode DIVISION_OPTIMIZATION = const HintCode(
+      'DIVISION_OPTIMIZATION',
+      "The operator x ~/ y is more efficient than (x / y).toInt().",
+      "Try re-writing the expression to use the '~/' operator.");
+
+  /**
+   * Duplicate imports.
+   */
+  static const HintCode DUPLICATE_IMPORT = const HintCode('DUPLICATE_IMPORT',
+      "Duplicate import.", "Try removing all but one import of the library.");
+
+  /**
+   * It is a bad practice for a source file in a package "lib" directory
+   * hierarchy to traverse outside that directory hierarchy. For example, a
+   * source file in the "lib" directory should not contain a directive such as
+   * `import '../web/some.dart'` which references a file outside the lib
+   * directory.
+   */
+  static const HintCode FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE =
+  const HintCode(
+      'FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE',
+      "A file in the 'lib' directory shouldn't import a file outside the "
+          "'lib' directory.",
+      "Try removing the import, or "
+          "moving the imported file inside the 'lib' directory.");
+
+  /**
+   * It is a bad practice for a source file ouside a package "lib" directory
+   * hierarchy to traverse into that directory hierarchy. For example, a source
+   * file in the "web" directory should not contain a directive such as
+   * `import '../lib/some.dart'` which references a file inside the lib
+   * directory.
+   */
+  static const HintCode FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE =
+  const HintCode(
+      'FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE',
+      "A file outside the 'lib' directory shouldn't reference a file "
+          "inside the 'lib' directory using a relative path.",
+      "Try using a package: URI instead.");
+
+  /**
+   * Deferred libraries shouldn't define a top level function 'loadLibrary'.
+   */
+  static const HintCode IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION =
+      const HintCode(
+          'IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION',
+          "The library '{0}' defines a top-level function named 'loadLibrary' "
+          "which is hidden by deferring this library.",
+          "Try changing the import to not be deferred, or "
+          "rename the function in the imported library.");
+
+  /**
+   * This hint is generated anywhere where the
+   * [StaticTypeWarningCode.INVALID_ASSIGNMENT] would have been generated, if we
+   * used propagated information for the warnings.
+   *
+   * Parameters:
+   * 0: the name of the right hand side type
+   * 1: the name of the left hand side type
+   */
+  static const HintCode INVALID_ASSIGNMENT = const HintCode(
+      'INVALID_ASSIGNMENT',
+      "A value of type '{0}' can't be assigned to a variable of type '{1}'.",
+      "Try changing the type of the variable, or "
+      "casting the right-hand type to '{1}'.");
+
+  /**
+   * This hint is generated anywhere a @factory annotation is associated with
+   * anything other than a method.
+   */
+  static const HintCode INVALID_FACTORY_ANNOTATION = const HintCode(
+      'INVALID_FACTORY_ANNOTATION',
+      "Only methods can be annotated as factories.");
+
+  /**
+   * This hint is generated anywhere a @factory annotation is associated with
+   * a method that does not declare a return type.
+   */
+  static const HintCode INVALID_FACTORY_METHOD_DECL = const HintCode(
+      'INVALID_FACTORY_METHOD_DECL',
+      "Factory method '{0}' must have a return type.");
+
+  /**
+   * This hint is generated anywhere a @factory annotation is associated with
+   * a non-abstract method that can return anything other than a newly allocated
+   * object.
+   *
+   * Parameters:
+   * 0: the name of the method
+   */
+  static const HintCode INVALID_FACTORY_METHOD_IMPL = const HintCode(
+      'INVALID_FACTORY_METHOD_IMPL',
+      "Factory method '{0}' doesn't return a newly allocated object.");
+
+  /**
+   * Generic Method DEP: number of type parameters must match.
+   * <https://github.com/leafpetersen/dep-generic-methods/blob/master/proposal.md#function-subtyping>
+   *
+   * Parameters:
+   * 0: the number of type parameters in the method
+   * 1: the number of type parameters in the overridden method
+   * 2: the name of the class where the overridden method is declared
+   */
+  static const HintCode INVALID_METHOD_OVERRIDE_TYPE_PARAMETERS =
+  const HintCode(
+      'INVALID_METHOD_OVERRIDE_TYPE_PARAMETERS',
+      "The method has {0} type parameters, but it is overriding a method "
+          "with {1} type parameters from '{2}'.",
+      "Try changing the number of type parameters so that they are the same.");
+
+  /**
+   * Generic Method DEP: bounds of type parameters must be compatible.
+   * <https://github.com/leafpetersen/dep-generic-methods/blob/master/proposal.md#function-subtyping>
+   *
+   * Parameters:
+   * 0: the type parameter name
+   * 1: the type parameter bound
+   * 2: the overridden type parameter name
+   * 3: the overridden type parameter bound
+   * 4: the name of the class where the overridden method is declared
+   */
+  static const HintCode INVALID_METHOD_OVERRIDE_TYPE_PARAMETER_BOUND =
+  const HintCode(
+      'INVALID_METHOD_OVERRIDE_TYPE_PARAMETER_BOUND',
+      "The type parameter '{0}' extends '{1}', but that is stricter than "
+          "'{2}' extends '{3}' in the overridden method from '{4}'.",
+      "Try changing the bounds on the type parameters so that they are compatible.");
+
+  /**
+   * This hint is generated anywhere where a member annotated with `@protected`
+   * is used outside an instance member of a subclass.
+   *
+   * Parameters:
+   * 0: the name of the member
+   * 1: the name of the defining class
+   */
+  static const HintCode INVALID_USE_OF_PROTECTED_MEMBER = const HintCode(
+      'INVALID_USE_OF_PROTECTED_MEMBER',
+      "The member '{0}' can only be used within instance members of subclasses "
+      "of '{1}'.");
+
+  /**
+   * Hint for the `x is double` type checks.
+   */
+  static const HintCode IS_DOUBLE = const HintCode(
+      'IS_DOUBLE',
+      "When compiled to JS, this test might return true when the left hand "
+          "side is an int.",
+      "Try testing for 'num' instead.");
+
+  /**
+   * Hint for the `x is int` type checks.
+   */
+  static const HintCode IS_INT = const HintCode(
+      'IS_INT',
+      "When compiled to JS, this test might return true when the left hand "
+          "side is a double.",
+      "Try testing for 'num' instead.");
+
+  /**
+   * Hint for the `x is! double` type checks.
+   */
+  static const HintCode IS_NOT_DOUBLE = const HintCode(
+      'IS_NOT_DOUBLE',
+      "When compiled to JS, this test might return false when the left hand "
+          "side is an int.",
+      "Try testing for 'num' instead.");
+
+  /**
+   * Hint for the `x is! int` type checks.
+   */
+  static const HintCode IS_NOT_INT = const HintCode(
+      'IS_NOT_INT',
+      "When compiled to JS, this test might return false when the left hand "
+          "side is a double.",
+      "Try testing for 'num' instead.");
+
+  /**
+   * Generate a hint for an element that is annotated with `@JS(...)` whose
+   * library declaration is not similarly annotated.
+   */
+  static const HintCode MISSING_JS_LIB_ANNOTATION = const HintCode(
+      'MISSING_JS_LIB_ANNOTATION',
+      "The @JS() annotation can only be used if it is also declared on the "
+          "library directive.",
+      "Try adding the annotation to the library directive.");
+
+  /**
+   * Generate a hint for a constructor, function or method invocation where a
+   * required parameter is missing.
+   *
+   * Parameters:
+   * 0: the name of the parameter
+   */
+  static const HintCode MISSING_REQUIRED_PARAM = const HintCode(
+      'MISSING_REQUIRED_PARAM', "The parameter '{0}' is required.");
+
+  /**
+   * Generate a hint for a constructor, function or method invocation where a
+   * required parameter is missing.
+   *
+   * Parameters:
+   * 0: the name of the parameter
+   * 1: message details
+   */
+  static const HintCode MISSING_REQUIRED_PARAM_WITH_DETAILS = const HintCode(
+      'MISSING_REQUIRED_PARAM_WITH_DETAILS',
+      "The parameter '{0}' is required. {1}.");
+
+  /**
+   * Generate a hint for methods or functions that have a return type, but do
+   * not have a non-void return statement on all branches. At the end of methods
+   * or functions with no return, Dart implicitly returns `null`, avoiding these
+   * implicit returns is considered a best practice.
+   *
+   * Parameters:
+   * 0: the name of the declared return type
+   */
+  static const HintCode MISSING_RETURN = const HintCode(
+      'MISSING_RETURN',
+      "This function declares a return type of '{0}', but doesn't end with a "
+      "return statement.",
+      "Try adding a return statement, or changing the return type to 'void'.");
+
+  /**
+   * Generate a hint for methods that override methods annotated `@mustCallSuper`
+   * that do not invoke the overridden super method.
+   *
+   * Parameters:
+   * 0: the name of the class declaring the overridden method
+   */
+  static const HintCode MUST_CALL_SUPER = const HintCode(
+      'MUST_CALL_SUPER',
+      "This method overrides a method annotated as @mustCallSuper in '{0}', "
+      "but does invoke the overridden method.");
+
+  /**
+   * A condition in a control flow statement could evaluate to `null` because it
+   * uses the null-aware '?.' operator.
+   */
+  static const HintCode NULL_AWARE_IN_CONDITION = const HintCode(
+      'NULL_AWARE_IN_CONDITION',
+      "The value of the '?.' operator can be 'null', which isn't appropriate "
+      "in a condition.",
+      "Try replacing the '?.' with a '.', testing the left-hand side for null if "
+      "necessary.");
+
+  /**
+   * Hint for classes that override equals, but not hashCode.
+   *
+   * Parameters:
+   * 0: the name of the current class
+   */
+  static const HintCode OVERRIDE_EQUALS_BUT_NOT_HASH_CODE = const HintCode(
+      'OVERRIDE_EQUALS_BUT_NOT_HASH_CODE',
+      "The class '{0}' overrides 'operator==', but not 'get hashCode'.",
+      "Try implementing 'hashCode'.");
+
+  /**
+   * A getter with the override annotation does not override an existing getter.
+   */
+  static const HintCode OVERRIDE_ON_NON_OVERRIDING_GETTER = const HintCode(
+      'OVERRIDE_ON_NON_OVERRIDING_GETTER',
+      "Getter doesn't override an inherited getter.",
+      "Try updating this class to match the superclass, or "
+      "removing the override annotation.");
+
+  /**
+   * A field with the override annotation does not override a getter or setter.
+   */
+  static const HintCode OVERRIDE_ON_NON_OVERRIDING_FIELD = const HintCode(
+      'OVERRIDE_ON_NON_OVERRIDING_FIELD',
+      "Field doesn't override an inherited getter or setter.",
+      "Try updating this class to match the superclass, or "
+      "removing the override annotation.");
+
+  /**
+   * A method with the override annotation does not override an existing method.
+   */
+  static const HintCode OVERRIDE_ON_NON_OVERRIDING_METHOD = const HintCode(
+      'OVERRIDE_ON_NON_OVERRIDING_METHOD',
+      "Method doesn't override an inherited method.",
+      "Try updating this class to match the superclass, or "
+      "removing the override annotation.");
+
+  /**
+   * A setter with the override annotation does not override an existing setter.
+   */
+  static const HintCode OVERRIDE_ON_NON_OVERRIDING_SETTER = const HintCode(
+      'OVERRIDE_ON_NON_OVERRIDING_SETTER',
+      "Setter doesn't override an inherited setter.",
+      "Try updating this class to match the superclass, or "
+      "removing the override annotation.");
+
+  /**
+   * It is a bad practice for a package import to reference anything outside the
+   * given package, or more generally, it is bad practice for a package import
+   * to contain a "..". For example, a source file should not contain a
+   * directive such as `import 'package:foo/../some.dart'`.
+   */
+  static const HintCode PACKAGE_IMPORT_CONTAINS_DOT_DOT = const HintCode(
+      'PACKAGE_IMPORT_CONTAINS_DOT_DOT',
+      "A package import shouldn't contain '..'.");
+
+  /**
+   * Type checks of the type `x is! Null` should be done with `x != null`.
+   */
+  static const HintCode TYPE_CHECK_IS_NOT_NULL = const HintCode(
+      'TYPE_CHECK_IS_NOT_NULL',
+      "Tests for non-null should be done with '!= null'.",
+      "Try replacing the 'is! Null' check with '!= null'.");
+
+  /**
+   * Type checks of the type `x is Null` should be done with `x == null`.
+   */
+  static const HintCode TYPE_CHECK_IS_NULL = const HintCode(
+      'TYPE_CHECK_IS_NULL',
+      "Tests for null should be done with '== null'.",
+      "Try replacing the 'is Null' check with '== null'.");
+
+  /**
+   * This hint is generated anywhere where the
+   * [StaticTypeWarningCode.UNDEFINED_GETTER] or
+   * [StaticWarningCode.UNDEFINED_GETTER] would have been generated, if we used
+   * propagated information for the warnings.
+   *
+   * Parameters:
+   * 0: the name of the getter
+   * 1: the name of the enclosing type where the getter is being looked for
+   */
+  static const HintCode UNDEFINED_GETTER = const HintCode(
+      'UNDEFINED_GETTER',
+      "The getter '{0}' isn't defined for the class '{1}'.",
+      "Try defining a getter or field named '{0}', or invoke a different getter.");
+
+  /**
+   * An undefined name hidden in an import or export directive.
+   */
+  static const HintCode UNDEFINED_HIDDEN_NAME = const HintCode(
+      'UNDEFINED_HIDDEN_NAME',
+      "The library '{0}' doesn't export a member with the hidden name '{1}'.",
+      "Try removing the name from the list of hidden members.");
+
+  /**
+   * This hint is generated anywhere where the
+   * [StaticTypeWarningCode.UNDEFINED_METHOD] would have been generated, if we
+   * used propagated information for the warnings.
+   *
+   * Parameters:
+   * 0: the name of the method that is undefined
+   * 1: the resolved type name that the method lookup is happening on
+   */
+  static const HintCode UNDEFINED_METHOD = const HintCode(
+      'UNDEFINED_METHOD',
+      "The method '{0}' isn't defined for the class '{1}'.",
+      "Try correcting the name to the name of an existing method, or "
+      "defining a method named '{0}'.");
+
+  /**
+   * This hint is generated anywhere where the
+   * [StaticTypeWarningCode.UNDEFINED_OPERATOR] would have been generated, if we
+   * used propagated information for the warnings.
+   *
+   * Parameters:
+   * 0: the name of the operator
+   * 1: the name of the enclosing type where the operator is being looked for
+   */
+  static const HintCode UNDEFINED_OPERATOR = const HintCode(
+      'UNDEFINED_OPERATOR',
+      "The operator '{0}' isn't defined for the class '{1}'.",
+      "Try defining the operator '{0}'.");
+
+  /**
+   * This hint is generated anywhere where the
+   * [StaticTypeWarningCode.UNDEFINED_SETTER] or
+   * [StaticWarningCode.UNDEFINED_SETTER] would have been generated, if we used
+   * propagated information for the warnings.
+   *
+   * Parameters:
+   * 0: the name of the setter
+   * 1: the name of the enclosing type where the setter is being looked for
+   */
+  static const HintCode UNDEFINED_SETTER = const HintCode(
+      'UNDEFINED_SETTER',
+      "The setter '{0}' isn't defined for the class '{1}'.",
+      "Try defining a setter or field named '{0}', or invoke a different setter.");
+
+  /**
+   * An undefined name shown in an import or export directive.
+   */
+  static const HintCode UNDEFINED_SHOWN_NAME = const HintCode(
+      'UNDEFINED_SHOWN_NAME',
+      "The library '{0}' doesn't export a member with the shown name '{1}'.",
+      "Try removing the name from the list of shown members.");
+
+  /**
+   * Unnecessary cast.
+   */
+  static const HintCode UNNECESSARY_CAST = const HintCode(
+      'UNNECESSARY_CAST', "Unnecessary cast.", "Try removing the cast.");
+
+  /**
+   * Unnecessary `noSuchMethod` declaration.
+   */
+  static const HintCode UNNECESSARY_NO_SUCH_METHOD = const HintCode(
+      'UNNECESSARY_NO_SUCH_METHOD',
+      "Unnecessary 'noSuchMethod' declaration.",
+      "Try removing the declaration of 'noSuchMethod'.");
+
+  /**
+   * Unnecessary type checks, the result is always false.
+   */
+  static const HintCode UNNECESSARY_TYPE_CHECK_FALSE = const HintCode(
+      'UNNECESSARY_TYPE_CHECK_FALSE',
+      "Unnecessary type check, the result is always false.",
+      "Try correcting the type check, or removing the type check.");
+
+  /**
+   * Unnecessary type checks, the result is always true.
+   */
+  static const HintCode UNNECESSARY_TYPE_CHECK_TRUE = const HintCode(
+      'UNNECESSARY_TYPE_CHECK_TRUE',
+      "Unnecessary type check, the result is always true.",
+      "Try correcting the type check, or removing the type check.");
+
+  /**
+   * Unused catch exception variables.
+   */
+  static const HintCode UNUSED_CATCH_CLAUSE = const HintCode(
+      'UNUSED_CATCH_CLAUSE',
+      "The exception variable '{0}' isn't used, so the 'catch' clause can be removed.",
+  // TODO(brianwilkerson) Split this error code so that we can differentiate
+  // between removing the catch clause and replacing the catch clause with
+  // an on clause.
+      "Try removing the catch clause.");
+
+  /**
+   * Unused catch stack trace variables.
+   */
+  static const HintCode UNUSED_CATCH_STACK = const HintCode(
+      'UNUSED_CATCH_STACK',
+      "The stack trace variable '{0}' isn't used and can be removed.",
+      "Try removing the stack trace variable, or using it.");
+
+  /**
+   * See [Modifier.IS_USED_IN_LIBRARY].
+   */
+  static const HintCode UNUSED_ELEMENT = const HintCode('UNUSED_ELEMENT',
+      "The {0} '{1}' isn't used.", "Try removing the declaration of '{1}'.");
+
+  /**
+   * Unused fields are fields which are never read.
+   */
+  static const HintCode UNUSED_FIELD = const HintCode(
+      'UNUSED_FIELD',
+      "The value of the field '{0}' isn't used.",
+      "Try removing the field, or using it.");
+
+  /**
+   * Unused imports are imports which are never used.
+   */
+  static const HintCode UNUSED_IMPORT = const HintCode(
+      'UNUSED_IMPORT', "Unused import.", "Try removing the import directive.");
+
+  /**
+   * Unused local variables are local variables which are never read.
+   */
+  static const HintCode UNUSED_LOCAL_VARIABLE = const HintCode(
+      'UNUSED_LOCAL_VARIABLE',
+      "The value of the local variable '{0}' isn't used.",
+      "Try removing the variable, or using it.");
+
+  /**
+   * Unused shown names are names shown on imports which are never used.
+   */
+  static const HintCode UNUSED_SHOWN_NAME = const HintCode(
+      'UNUSED_SHOWN_NAME',
+      "The name {0} is shown, but not used.",
+      "Try removing the name from the list of shown members.");
+
+  /**
+   * Hint for cases where the source expects a method or function to return a
+   * non-void result, but the method or function signature returns void.
+   *
+   * Parameters:
+   * 0: the name of the method or function that returns void
+   */
+  static const HintCode USE_OF_VOID_RESULT = const HintCode(
+      'USE_OF_VOID_RESULT',
+      "The result of '{0}' is being used, even though it is declared to be 'void'.");
+
+  /**
+   * It will be a static type warning if <i>m</i> is not a generic method with
+   * exactly <i>n</i> type parameters.
+   *
+   * Parameters:
+   * 0: the name of the method being referenced (<i>G</i>)
+   * 1: the number of type parameters that were declared
+   * 2: the number of type arguments provided
+   */
+  static const HintCode WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD =
+  const HintCode(
+      'WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD',
+      "The method '{0}' is declared with {1} type parameters, "
+          "but {2} type arguments were given.",
+      "Try adjusting the number of type arguments.");
+
+  /**
+   * Initialize a newly created error code to have the given [name]. The message
+   * associated with the error will be created from the given [message]
+   * template. The correction associated with the error will be created from the
+   * given [correction] template.
+   */
+  const HintCode(String name, String message, [String correction])
+      : super(name, message, correction);
+
+  @override
+  ErrorSeverity get errorSeverity => ErrorType.HINT.severity;
+
+  @override
+  ErrorType get type => ErrorType.HINT;
+}
diff --git a/pkg/analyzer/lib/src/dart/error/lint_codes.dart b/pkg/analyzer/lib/src/dart/error/lint_codes.dart
new file mode 100644
index 0000000..0fd6824
--- /dev/null
+++ b/pkg/analyzer/lib/src/dart/error/lint_codes.dart
@@ -0,0 +1,25 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analyzer.src.dart.error.lint_codes;
+
+import 'package:analyzer/error/error.dart';
+
+/**
+ * Defines style and best practice recommendations.
+ *
+ * Unlike [HintCode]s, which are akin to traditional static warnings from a
+ * compiler, lint recommendations focus on matters of style and practices that
+ * might aggregated to define a project's style guide.
+ */
+class LintCode extends ErrorCode {
+  const LintCode(String name, String message, [String correction])
+      : super(name, message, correction);
+
+  @override
+  ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
+
+  @override
+  ErrorType get type => ErrorType.LINT;
+}
diff --git a/pkg/analyzer/lib/src/dart/error/syntactic_errors.dart b/pkg/analyzer/lib/src/dart/error/syntactic_errors.dart
index 31ee726..74d54d7 100644
--- a/pkg/analyzer/lib/src/dart/error/syntactic_errors.dart
+++ b/pkg/analyzer/lib/src/dart/error/syntactic_errors.dart
@@ -3,12 +3,14 @@
 // BSD-style license that can be found in the LICENSE file.
 
 /**
- * The errors produced during sytactic analysis (scanning and parsing).
+ * The errors produced during syntactic analysis (scanning and parsing).
  */
 library analyzer.src.dart.error.syntactic_errors;
 
 import 'package:analyzer/error/error.dart';
 
+export 'package:front_end/src/scanner/errors.dart' show ScannerErrorCode;
+
 /**
  * The error codes used for errors detected by the parser. The convention for
  * this class is for the name of the error code to indicate the problem that
@@ -18,29 +20,41 @@
 class ParserErrorCode extends ErrorCode {
   static const ParserErrorCode ABSTRACT_CLASS_MEMBER = const ParserErrorCode(
       'ABSTRACT_CLASS_MEMBER',
-      "Members of classes cannot be declared to be 'abstract'");
+      "Members of classes can't be declared to be 'abstract'.",
+      "Try removing the keyword 'abstract'.");
 
   static const ParserErrorCode ABSTRACT_ENUM = const ParserErrorCode(
-      'ABSTRACT_ENUM', "Enums cannot be declared to be 'abstract'");
+      'ABSTRACT_ENUM',
+      "Enums can't be declared to be 'abstract'.",
+      "Try removing the keyword 'abstract'.");
 
   static const ParserErrorCode ABSTRACT_STATIC_METHOD = const ParserErrorCode(
       'ABSTRACT_STATIC_METHOD',
-      "Static methods cannot be declared to be 'abstract'");
+      "Static methods can't be declared to be 'abstract'.",
+      "Try removing the keyword 'abstract'.");
 
   static const ParserErrorCode ABSTRACT_TOP_LEVEL_FUNCTION =
-      const ParserErrorCode('ABSTRACT_TOP_LEVEL_FUNCTION',
-          "Top-level functions cannot be declared to be 'abstract'");
+      const ParserErrorCode(
+          'ABSTRACT_TOP_LEVEL_FUNCTION',
+          "Top-level functions can't be declared to be 'abstract'.",
+          "Try removing the keyword 'abstract'.");
 
   static const ParserErrorCode ABSTRACT_TOP_LEVEL_VARIABLE =
-      const ParserErrorCode('ABSTRACT_TOP_LEVEL_VARIABLE',
-          "Top-level variables cannot be declared to be 'abstract'");
+      const ParserErrorCode(
+          'ABSTRACT_TOP_LEVEL_VARIABLE',
+          "Top-level variables can't be declared to be 'abstract'.",
+          "Try removing the keyword 'abstract'.");
 
   static const ParserErrorCode ABSTRACT_TYPEDEF = const ParserErrorCode(
-      'ABSTRACT_TYPEDEF', "Type aliases cannot be declared to be 'abstract'");
+      'ABSTRACT_TYPEDEF',
+      "Typedefs can't be declared to be 'abstract'.",
+      "Try removing the keyword 'abstract'.");
 
   static const ParserErrorCode ANNOTATION_ON_ENUM_CONSTANT =
-      const ParserErrorCode('ANNOTATION_ON_ENUM_CONSTANT',
-          "Enum constants cannot have annotations");
+      const ParserErrorCode(
+          'ANNOTATION_ON_ENUM_CONSTANT',
+          "Enum constants can't have annotations.",
+          "Try removing the annotation.");
 
   /**
    * 16.32 Identifier Reference: It is a compile-time error if any of the
@@ -48,19 +62,15 @@
    * body marked with either async, async*, or sync*.
    */
   static const ParserErrorCode ASYNC_KEYWORD_USED_AS_IDENTIFIER =
-      const ParserErrorCode('ASYNC_KEYWORD_USED_AS_IDENTIFIER',
-          "The keywords 'async', 'await', and 'yield' may not be used as identifiers in an asynchronous or generator function.");
-
-  /**
-   * Some environments, such as Fletch, do not support async.
-   */
-  static const ParserErrorCode ASYNC_NOT_SUPPORTED = const ParserErrorCode(
-      'ASYNC_NOT_SUPPORTED',
-      "Async and sync are not supported in this environment.");
+      const ParserErrorCode(
+          'ASYNC_KEYWORD_USED_AS_IDENTIFIER',
+          "The keywords 'async', 'await', and 'yield' can't be used as "
+          "identifiers in an asynchronous or generator function.");
 
   static const ParserErrorCode BREAK_OUTSIDE_OF_LOOP = const ParserErrorCode(
       'BREAK_OUTSIDE_OF_LOOP',
-      "A break statement cannot be used outside of a loop or switch statement");
+      "A break statement can't be used outside of a loop or switch statement.",
+      "Try removing the break statement.");
 
   static const ParserErrorCode CLASS_IN_CLASS = const ParserErrorCode(
       'CLASS_IN_CLASS',
@@ -68,7 +78,9 @@
       "Try moving the class to the top-level.");
 
   static const ParserErrorCode COLON_IN_PLACE_OF_IN = const ParserErrorCode(
-      'COLON_IN_PLACE_OF_IN', "For-in loops use 'in' rather than a colon");
+      'COLON_IN_PLACE_OF_IN',
+      "For-in loops use 'in' rather than a colon.",
+      "Try replacing the colon with the keyword 'in'.");
 
   static const ParserErrorCode CONST_AND_FINAL = const ParserErrorCode(
       'CONST_AND_FINAL',
@@ -83,13 +95,15 @@
   static const ParserErrorCode CONST_CLASS = const ParserErrorCode(
       'CONST_CLASS',
       "Classes can't be declared to be 'const'.",
-      "Try removing the 'const' keyword or moving to the class' constructor(s).");
+      "Try removing the 'const' keyword. If you're trying to indicate that "
+      "instances of the class can be constants, place the 'const' keyword on "
+      "the class' constructor(s).");
 
   static const ParserErrorCode CONST_CONSTRUCTOR_WITH_BODY =
       const ParserErrorCode(
           'CONST_CONSTRUCTOR_WITH_BODY',
-          "Const constructor can't have a body.",
-          "Try removing the 'const' keyword or the body.");
+          "Const constructors can't have a body.",
+          "Try removing either the 'const' keyword or the body.");
 
   static const ParserErrorCode CONST_ENUM = const ParserErrorCode(
       'CONST_ENUM',
@@ -99,7 +113,8 @@
   static const ParserErrorCode CONST_FACTORY = const ParserErrorCode(
       'CONST_FACTORY',
       "Only redirecting factory constructors can be declared to be 'const'.",
-      "Try removing the 'const' keyword or replacing the body with '=' followed by a valid target.");
+      "Try removing the 'const' keyword, or "
+      "replacing the body with '=' followed by a valid target.");
 
   static const ParserErrorCode CONST_METHOD = const ParserErrorCode(
       'CONST_METHOD',
@@ -119,537 +134,797 @@
 
   static const ParserErrorCode CONTINUE_OUTSIDE_OF_LOOP = const ParserErrorCode(
       'CONTINUE_OUTSIDE_OF_LOOP',
-      "A continue statement cannot be used outside of a loop or switch statement");
+      "A continue statement can't be used outside of a loop or switch statement.",
+      "Try removing the continue statement.");
 
-  static const ParserErrorCode CONTINUE_WITHOUT_LABEL_IN_CASE =
-      const ParserErrorCode('CONTINUE_WITHOUT_LABEL_IN_CASE',
-          "A continue statement in a switch statement must have a label as a target");
+  static const ParserErrorCode CONTINUE_WITHOUT_LABEL_IN_CASE = const ParserErrorCode(
+      'CONTINUE_WITHOUT_LABEL_IN_CASE',
+      "A continue statement in a switch statement must have a label as a target.",
+      "Try adding a label associated with one of the case clauses to the continue statement.");
 
   static const ParserErrorCode DEPRECATED_CLASS_TYPE_ALIAS =
-      const ParserErrorCode('DEPRECATED_CLASS_TYPE_ALIAS',
-          "The 'typedef' mixin application was replaced with 'class'");
+      const ParserErrorCode(
+          'DEPRECATED_CLASS_TYPE_ALIAS',
+          "The 'typedef' mixin application was replaced with 'class'.",
+          "Try re-writing the typedef as 'class C = S with M'.");
 
   static const ParserErrorCode DIRECTIVE_AFTER_DECLARATION =
-      const ParserErrorCode('DIRECTIVE_AFTER_DECLARATION',
-          "Directives must appear before any declarations");
+      const ParserErrorCode(
+          'DIRECTIVE_AFTER_DECLARATION',
+          "Directives must appear before any declarations.",
+          "Try moving the directive before any declarations.");
 
+  /**
+   * Parameters:
+   * 0: the label that was duplicated
+   */
   static const ParserErrorCode DUPLICATE_LABEL_IN_SWITCH_STATEMENT =
-      const ParserErrorCode('DUPLICATE_LABEL_IN_SWITCH_STATEMENT',
-          "The label {0} was already used in this switch statement");
+      const ParserErrorCode(
+          'DUPLICATE_LABEL_IN_SWITCH_STATEMENT',
+          "The label '{0}' was already used in this switch statement.",
+          "Try choosing a different name for this label.");
 
+  /**
+   * Parameters:
+   * 0: the modifier that was duplicated
+   */
   static const ParserErrorCode DUPLICATED_MODIFIER = const ParserErrorCode(
-      'DUPLICATED_MODIFIER', "The modifier '{0}' was already specified.");
+      'DUPLICATED_MODIFIER',
+      "The modifier '{0}' was already specified.",
+      "Try removing all but one occurance of the modifier.");
 
   static const ParserErrorCode EMPTY_ENUM_BODY = const ParserErrorCode(
-      'EMPTY_ENUM_BODY', "An enum must declare at least one constant name");
+      'EMPTY_ENUM_BODY',
+      "An enum must declare at least one constant name.",
+      "Try declaring a constant.");
 
   static const ParserErrorCode ENUM_IN_CLASS = const ParserErrorCode(
-      'ENUM_IN_CLASS', "Enums cannot be declared inside classes");
+      'ENUM_IN_CLASS',
+      "Enums can't be declared inside classes.",
+      "Try moving the enum to the top-level.");
 
   static const ParserErrorCode EQUALITY_CANNOT_BE_EQUALITY_OPERAND =
-      const ParserErrorCode('EQUALITY_CANNOT_BE_EQUALITY_OPERAND',
-          "Equality expression cannot be operand of another equality expression.");
+      const ParserErrorCode(
+          'EQUALITY_CANNOT_BE_EQUALITY_OPERAND',
+          "An equality expression can't be an operand of another equality expression.",
+          "Try re-writing the expression.");
 
   static const ParserErrorCode EXPECTED_CASE_OR_DEFAULT = const ParserErrorCode(
-      'EXPECTED_CASE_OR_DEFAULT', "Expected 'case' or 'default'");
+      'EXPECTED_CASE_OR_DEFAULT',
+      "Expected 'case' or 'default'.",
+      "Try placing this code inside a case clause.");
 
-  static const ParserErrorCode EXPECTED_CLASS_MEMBER =
-      const ParserErrorCode('EXPECTED_CLASS_MEMBER', "Expected a class member");
+  static const ParserErrorCode EXPECTED_CLASS_MEMBER = const ParserErrorCode(
+      'EXPECTED_CLASS_MEMBER',
+      "Expected a class member.",
+      "Try placing this code inside a class member.");
 
   static const ParserErrorCode EXPECTED_EXECUTABLE = const ParserErrorCode(
       'EXPECTED_EXECUTABLE',
-      "Expected a method, getter, setter or operator declaration");
+      "Expected a method, getter, setter or operator declaration.",
+      "This appears to be incomplete code. Try removing it or completing it.");
 
   static const ParserErrorCode EXPECTED_LIST_OR_MAP_LITERAL =
       const ParserErrorCode(
-          'EXPECTED_LIST_OR_MAP_LITERAL', "Expected a list or map literal");
+          'EXPECTED_LIST_OR_MAP_LITERAL',
+          "Expected a list or map literal.",
+          "Try inserting a list or map literal, or remove the type arguments.");
 
   static const ParserErrorCode EXPECTED_STRING_LITERAL = const ParserErrorCode(
-      'EXPECTED_STRING_LITERAL', "Expected a string literal");
+      'EXPECTED_STRING_LITERAL', "Expected a string literal.");
 
+  /**
+   * Parameters:
+   * 0: the token that was expected but not found
+   */
   static const ParserErrorCode EXPECTED_TOKEN =
-      const ParserErrorCode('EXPECTED_TOKEN', "Expected to find '{0}'");
+      const ParserErrorCode('EXPECTED_TOKEN', "Expected to find '{0}'.");
 
   static const ParserErrorCode EXPECTED_TYPE_NAME =
-      const ParserErrorCode('EXPECTED_TYPE_NAME', "Expected a type name");
+      const ParserErrorCode('EXPECTED_TYPE_NAME', "Expected a type name.");
 
   static const ParserErrorCode EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE =
-      const ParserErrorCode('EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE',
-          "Export directives must preceed part directives");
+      const ParserErrorCode(
+          'EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE',
+          "Export directives must preceed part directives.",
+          "Try moving the export directives before the part directives.");
 
   static const ParserErrorCode EXTERNAL_AFTER_CONST = const ParserErrorCode(
       'EXTERNAL_AFTER_CONST',
-      "The modifier 'external' should be before the modifier 'const'");
+      "The modifier 'external' should be before the modifier 'const'.",
+      "Try re-ordering the modifiers.");
 
   static const ParserErrorCode EXTERNAL_AFTER_FACTORY = const ParserErrorCode(
       'EXTERNAL_AFTER_FACTORY',
-      "The modifier 'external' should be before the modifier 'factory'");
+      "The modifier 'external' should be before the modifier 'factory'.",
+      "Try re-ordering the modifiers.");
 
   static const ParserErrorCode EXTERNAL_AFTER_STATIC = const ParserErrorCode(
       'EXTERNAL_AFTER_STATIC',
-      "The modifier 'external' should be before the modifier 'static'");
+      "The modifier 'external' should be before the modifier 'static'.",
+      "Try re-ordering the modifiers.");
 
   static const ParserErrorCode EXTERNAL_CLASS = const ParserErrorCode(
-      'EXTERNAL_CLASS', "Classes cannot be declared to be 'external'");
+      'EXTERNAL_CLASS',
+      "Classes can't be declared to be 'external'.",
+      "Try removing the keyword 'external'.");
 
   static const ParserErrorCode EXTERNAL_CONSTRUCTOR_WITH_BODY =
-      const ParserErrorCode('EXTERNAL_CONSTRUCTOR_WITH_BODY',
-          "External constructors cannot have a body");
+      const ParserErrorCode(
+          'EXTERNAL_CONSTRUCTOR_WITH_BODY',
+          "External constructors can't have a body.",
+          "Try removing the body of the constructor, or "
+          "removing the keyword 'external'.");
 
   static const ParserErrorCode EXTERNAL_ENUM = const ParserErrorCode(
-      'EXTERNAL_ENUM', "Enums cannot be declared to be 'external'");
+      'EXTERNAL_ENUM',
+      "Enums can't be declared to be 'external'.",
+      "Try removing the keyword 'external'.");
 
   static const ParserErrorCode EXTERNAL_FIELD = const ParserErrorCode(
-      'EXTERNAL_FIELD', "Fields cannot be declared to be 'external'");
+      'EXTERNAL_FIELD',
+      "Fields can't be declared to be 'external'.",
+      "Try removing the keyword 'external'.");
 
   static const ParserErrorCode EXTERNAL_GETTER_WITH_BODY =
       const ParserErrorCode(
-          'EXTERNAL_GETTER_WITH_BODY', "External getters cannot have a body");
+          'EXTERNAL_GETTER_WITH_BODY',
+          "External getters can't have a body.",
+          "Try removing the body of the getter, or "
+          "removing the keyword 'external'.");
 
   static const ParserErrorCode EXTERNAL_METHOD_WITH_BODY =
       const ParserErrorCode(
-          'EXTERNAL_METHOD_WITH_BODY', "External methods cannot have a body");
+          'EXTERNAL_METHOD_WITH_BODY',
+          "External methods can't have a body.",
+          "Try removing the body of the method, or "
+          "removing the keyword 'external'.");
 
   static const ParserErrorCode EXTERNAL_OPERATOR_WITH_BODY =
-      const ParserErrorCode('EXTERNAL_OPERATOR_WITH_BODY',
-          "External operators cannot have a body");
+      const ParserErrorCode(
+          'EXTERNAL_OPERATOR_WITH_BODY',
+          "External operators can't have a body.",
+          "Try removing the body of the operator, or "
+          "removing the keyword 'external'.");
 
   static const ParserErrorCode EXTERNAL_SETTER_WITH_BODY =
       const ParserErrorCode(
-          'EXTERNAL_SETTER_WITH_BODY', "External setters cannot have a body");
+          'EXTERNAL_SETTER_WITH_BODY',
+          "External setters can't have a body.",
+          "Try removing the body of the setter, or "
+          "removing the keyword 'external'.");
 
   static const ParserErrorCode EXTERNAL_TYPEDEF = const ParserErrorCode(
-      'EXTERNAL_TYPEDEF', "Type aliases cannot be declared to be 'external'");
+      'EXTERNAL_TYPEDEF',
+      "Typedefs can't be declared to be 'external'.",
+      "Try removing the keyword 'external'.");
 
   static const ParserErrorCode FACTORY_TOP_LEVEL_DECLARATION =
-      const ParserErrorCode('FACTORY_TOP_LEVEL_DECLARATION',
-          "Top-level declarations cannot be declared to be 'factory'");
-
-  static const ParserErrorCode FACTORY_WITH_INITIALIZERS =
       const ParserErrorCode(
-          'FACTORY_WITH_INITIALIZERS',
-          "A 'factory' constructor cannot have initializers",
-          "Either remove the 'factory' keyword to make this a generative "
-          "constructor or remove the initializers.");
+          'FACTORY_TOP_LEVEL_DECLARATION',
+          "Top-level declarations can't be declared to be 'factory'.",
+          "Try removing the keyword 'factory'.");
+
+  static const ParserErrorCode FACTORY_WITH_INITIALIZERS = const ParserErrorCode(
+      'FACTORY_WITH_INITIALIZERS',
+      "A 'factory' constructor can't have initializers.",
+      "Try removing the 'factory' keyword to make this a generative constructor, or "
+      "removing the initializers.");
 
   static const ParserErrorCode FACTORY_WITHOUT_BODY = const ParserErrorCode(
       'FACTORY_WITHOUT_BODY',
-      "A non-redirecting 'factory' constructor must have a body");
+      "A non-redirecting 'factory' constructor must have a body.",
+      "Try adding a body to the constructor.");
 
   static const ParserErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR =
-      const ParserErrorCode('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR',
-          "Field initializers can only be used in a constructor");
+      const ParserErrorCode(
+          'FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR',
+          "Field formal parameters can only be used in a constructor.",
+          "Try replacing the field formal parameter with a normal parameter.");
 
   static const ParserErrorCode FINAL_AND_VAR = const ParserErrorCode(
       'FINAL_AND_VAR',
-      "Members cannot be declared to be both 'final' and 'var'");
+      "Members can't be declared to be both 'final' and 'var'.",
+      "Try removing the keyword 'var'.");
 
   static const ParserErrorCode FINAL_CLASS = const ParserErrorCode(
-      'FINAL_CLASS', "Classes cannot be declared to be 'final'");
+      'FINAL_CLASS',
+      "Classes can't be declared to be 'final'.",
+      "Try removing the keyword 'final'.");
 
   static const ParserErrorCode FINAL_CONSTRUCTOR = const ParserErrorCode(
-      'FINAL_CONSTRUCTOR', "A constructor cannot be declared to be 'final'");
+      'FINAL_CONSTRUCTOR',
+      "A constructor can't be declared to be 'final'.",
+      "Try removing the keyword 'final'.");
 
   static const ParserErrorCode FINAL_ENUM = const ParserErrorCode(
-      'FINAL_ENUM', "Enums cannot be declared to be 'final'");
+      'FINAL_ENUM',
+      "Enums can't be declared to be 'final'.",
+      "Try removing the keyword 'final'.");
 
   static const ParserErrorCode FINAL_METHOD = const ParserErrorCode(
       'FINAL_METHOD',
-      "Getters, setters and methods cannot be declared to be 'final'");
+      "Getters, setters and methods can't be declared to be 'final'.",
+      "Try removing the keyword 'final'.");
 
   static const ParserErrorCode FINAL_TYPEDEF = const ParserErrorCode(
-      'FINAL_TYPEDEF', "Type aliases cannot be declared to be 'final'");
+      'FINAL_TYPEDEF',
+      "Typedefs can't be declared to be 'final'.",
+      "Try removing the keyword 'final'.");
 
   static const ParserErrorCode FUNCTION_TYPED_PARAMETER_VAR = const ParserErrorCode(
       'FUNCTION_TYPED_PARAMETER_VAR',
-      "Function typed parameters cannot specify 'const', 'final' or 'var' instead of return type");
+      "Function-typed parameters can't specify 'const', 'final' or 'var' in place of a return type.",
+      "Try replacing the keyword with a return type.");
 
   static const ParserErrorCode GETTER_IN_FUNCTION = const ParserErrorCode(
       'GETTER_IN_FUNCTION',
-      "Getters cannot be defined within methods or functions");
+      "Getters can't be defined within methods or functions.",
+      "Try moving the getter outside the method or function, or "
+      "converting the getter to a function.");
 
   static const ParserErrorCode GETTER_WITH_PARAMETERS = const ParserErrorCode(
       'GETTER_WITH_PARAMETERS',
-      "Getter should be declared without a parameter list");
+      "Getters must be declared without a parameter list.",
+      "Try removing the parameter list, or "
+      "removing the keyword 'get' to define a method rather than a getter.");
 
   static const ParserErrorCode ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE =
       const ParserErrorCode('ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE',
-          "Illegal assignment to non-assignable expression");
+          "Illegal assignment to non-assignable expression.");
 
   static const ParserErrorCode IMPLEMENTS_BEFORE_EXTENDS =
-      const ParserErrorCode('IMPLEMENTS_BEFORE_EXTENDS',
-          "The extends clause must be before the implements clause");
+      const ParserErrorCode(
+          'IMPLEMENTS_BEFORE_EXTENDS',
+          "The extends clause must be before the implements clause.",
+          "Try moving the extends clause before the implements clause.");
 
   static const ParserErrorCode IMPLEMENTS_BEFORE_WITH = const ParserErrorCode(
       'IMPLEMENTS_BEFORE_WITH',
-      "The with clause must be before the implements clause");
+      "The with clause must be before the implements clause.",
+      "Try moving the with clause before the implements clause.");
 
   static const ParserErrorCode IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE =
-      const ParserErrorCode('IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE',
-          "Import directives must preceed part directives");
+      const ParserErrorCode(
+          'IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE',
+          "Import directives must preceed part directives.",
+          "Try moving the import directives before the part directives.");
 
   static const ParserErrorCode INITIALIZED_VARIABLE_IN_FOR_EACH =
-      const ParserErrorCode('INITIALIZED_VARIABLE_IN_FOR_EACH',
-          "The loop variable in a for-each loop cannot be initialized");
+      const ParserErrorCode(
+          'INITIALIZED_VARIABLE_IN_FOR_EACH',
+          "The loop variable in a for-each loop can't be initialized.",
+          "Try removing the initializer, or using a different kind of loop.");
 
   static const ParserErrorCode INVALID_AWAIT_IN_FOR = const ParserErrorCode(
       'INVALID_AWAIT_IN_FOR',
-      "The modifier 'await' is not allowed for a normal 'for' statement",
-      "Remove the keyword or use a for-each statement.");
+      "The keyword 'await' isn't allowed for a normal 'for' statement.",
+      "Try removing the keyword, or use a for-each statement.");
 
+  /**
+   * Parameters:
+   * 0: the invalid escape sequence
+   */
   static const ParserErrorCode INVALID_CODE_POINT = const ParserErrorCode(
       'INVALID_CODE_POINT',
-      "The escape sequence '{0}' is not a valid code point");
+      "The escape sequence '{0}' isn't a valid code point.");
 
   static const ParserErrorCode INVALID_COMMENT_REFERENCE = const ParserErrorCode(
       'INVALID_COMMENT_REFERENCE',
-      "Comment references should contain a possibly prefixed identifier and can start with 'new', but should not contain anything else");
+      "Comment references should contain a possibly prefixed identifier and "
+      "can start with 'new', but shouldn't contain anything else.");
 
   static const ParserErrorCode INVALID_HEX_ESCAPE = const ParserErrorCode(
       'INVALID_HEX_ESCAPE',
-      "An escape sequence starting with '\\x' must be followed by 2 hexidecimal digits");
+      "An escape sequence starting with '\\x' must be followed by 2 hexidecimal digits.");
 
   static const ParserErrorCode INVALID_LITERAL_IN_CONFIGURATION =
-      const ParserErrorCode('INVALID_LITERAL_IN_CONFIGURATION',
-          "The literal in a configuration cannot contain interpolation");
+      const ParserErrorCode(
+          'INVALID_LITERAL_IN_CONFIGURATION',
+          "The literal in a configuration can't contain interpolation.",
+          "Try removing the interpolation expressions.");
 
+  /**
+   * Parameters:
+   * 0: the operator that is invalid
+   */
   static const ParserErrorCode INVALID_OPERATOR = const ParserErrorCode(
-      'INVALID_OPERATOR', "The string '{0}' is not a valid operator");
+      'INVALID_OPERATOR', "The string '{0}' isn't a user-definable operator.");
 
+  /**
+   * Parameters:
+   * 0: the operator being applied to 'super'
+   */
   static const ParserErrorCode INVALID_OPERATOR_FOR_SUPER =
       const ParserErrorCode('INVALID_OPERATOR_FOR_SUPER',
-          "The operator '{0}' cannot be used with 'super'");
+          "The operator '{0}' can't be used with 'super'.");
 
   static const ParserErrorCode INVALID_STAR_AFTER_ASYNC = const ParserErrorCode(
       'INVALID_STAR_AFTER_ASYNC',
-      "The modifier 'async*' is not allowed for an expression function body",
-      "Convert the body to a block.");
+      "The modifier 'async*' isn't allowed for an expression function body.",
+      "Try converting the body to a block.");
 
   static const ParserErrorCode INVALID_SYNC = const ParserErrorCode(
       'INVALID_SYNC',
-      "The modifier 'sync' is not allowed for an exrpression function body",
-      "Convert the body to a block.");
+      "The modifier 'sync' isn't allowed for an exrpression function body.",
+      "Try converting the body to a block.");
 
   static const ParserErrorCode INVALID_UNICODE_ESCAPE = const ParserErrorCode(
       'INVALID_UNICODE_ESCAPE',
-      "An escape sequence starting with '\\u' must be followed by 4 hexidecimal digits or from 1 to 6 digits between '{' and '}'");
+      "An escape sequence starting with '\\u' must be followed by 4 "
+      "hexidecimal digits or from 1 to 6 digits between '{' and '}'.");
 
   static const ParserErrorCode LIBRARY_DIRECTIVE_NOT_FIRST =
-      const ParserErrorCode('LIBRARY_DIRECTIVE_NOT_FIRST',
-          "The library directive must appear before all other directives");
+      const ParserErrorCode(
+          'LIBRARY_DIRECTIVE_NOT_FIRST',
+          "The library directive must appear before all other directives.",
+          "Try moving the library directive before any other directives.");
 
   static const ParserErrorCode LOCAL_FUNCTION_DECLARATION_MODIFIER =
-      const ParserErrorCode('LOCAL_FUNCTION_DECLARATION_MODIFIER',
-          "Local function declarations cannot specify any modifier");
+      const ParserErrorCode(
+          'LOCAL_FUNCTION_DECLARATION_MODIFIER',
+          "Local function declarations can't specify any modifiers.",
+          "Try removing the modifier.");
 
   static const ParserErrorCode MISSING_ASSIGNABLE_SELECTOR =
-      const ParserErrorCode('MISSING_ASSIGNABLE_SELECTOR',
-          "Missing selector such as \".<identifier>\" or \"[0]\"");
+      const ParserErrorCode(
+          'MISSING_ASSIGNABLE_SELECTOR',
+          "Missing selector such as '.<identifier>' or '[0]'.",
+          "Try adding a selector.");
 
   static const ParserErrorCode MISSING_ASSIGNMENT_IN_INITIALIZER =
-      const ParserErrorCode('MISSING_ASSIGNMENT_IN_INITIALIZER',
-          "Expected an assignment after the field name");
+      const ParserErrorCode(
+          'MISSING_ASSIGNMENT_IN_INITIALIZER',
+          "Expected an assignment after the field name.",
+          "Try adding an assignment to initialize the field.");
 
   static const ParserErrorCode MISSING_CATCH_OR_FINALLY = const ParserErrorCode(
       'MISSING_CATCH_OR_FINALLY',
-      "A try statement must have either a catch or finally clause");
+      "A try statement must have either a catch or finally clause.",
+      "Try adding either a catch or finally clause, or "
+      "remove the try statement.");
 
   static const ParserErrorCode MISSING_CLASS_BODY = const ParserErrorCode(
       'MISSING_CLASS_BODY',
-      "A class definition must have a body, even if it is empty");
+      "A class definition must have a body, even if it is empty.",
+      "Try adding a class body.");
 
   static const ParserErrorCode MISSING_CLOSING_PARENTHESIS =
       const ParserErrorCode(
-          'MISSING_CLOSING_PARENTHESIS', "The closing parenthesis is missing");
+          'MISSING_CLOSING_PARENTHESIS',
+          "The closing parenthesis is missing.",
+          "Try adding the closing parenthesis.");
 
-  static const ParserErrorCode MISSING_CONST_FINAL_VAR_OR_TYPE =
-      const ParserErrorCode('MISSING_CONST_FINAL_VAR_OR_TYPE',
-          "Variables must be declared using the keywords 'const', 'final', 'var' or a type name");
+  static const ParserErrorCode MISSING_CONST_FINAL_VAR_OR_TYPE = const ParserErrorCode(
+      'MISSING_CONST_FINAL_VAR_OR_TYPE',
+      "Variables must be declared using the keywords 'const', 'final', 'var' or a type name.",
+      "Try adding the name of the type of the variable or the keyword 'var'.");
 
   static const ParserErrorCode MISSING_ENUM_BODY = const ParserErrorCode(
       'MISSING_ENUM_BODY',
-      "An enum definition must have a body with at least one constant name");
+      "An enum definition must have a body with at least one constant name.",
+      "Try adding a body and defining at least one constant.");
 
   static const ParserErrorCode MISSING_EXPRESSION_IN_INITIALIZER =
-      const ParserErrorCode('MISSING_EXPRESSION_IN_INITIALIZER',
-          "Expected an expression after the assignment operator");
+      const ParserErrorCode(
+          'MISSING_EXPRESSION_IN_INITIALIZER',
+          "Expected an expression after the assignment operator.",
+          "Try adding the value to be assigned, or "
+          "remove the assignment operator.");
 
   static const ParserErrorCode MISSING_EXPRESSION_IN_THROW =
-      const ParserErrorCode('MISSING_EXPRESSION_IN_THROW',
-          "Missing expression after 'throw'.", "Did you mean 'rethrow'?");
+      const ParserErrorCode(
+          'MISSING_EXPRESSION_IN_THROW',
+          "Missing expression after 'throw'.",
+          "Try using 'rethrow' to throw the caught exception.");
 
   static const ParserErrorCode MISSING_FUNCTION_BODY = const ParserErrorCode(
-      'MISSING_FUNCTION_BODY', "A function body must be provided");
+      'MISSING_FUNCTION_BODY',
+      "A function body must be provided.",
+      "Try adding a function body.");
 
   static const ParserErrorCode MISSING_FUNCTION_PARAMETERS =
-      const ParserErrorCode('MISSING_FUNCTION_PARAMETERS',
-          "Functions must have an explicit list of parameters");
+      const ParserErrorCode(
+          'MISSING_FUNCTION_PARAMETERS',
+          "Functions must have an explicit list of parameters.",
+          "Try adding a parameter list.");
 
   static const ParserErrorCode MISSING_METHOD_PARAMETERS =
-      const ParserErrorCode('MISSING_METHOD_PARAMETERS',
-          "Methods must have an explicit list of parameters");
+      const ParserErrorCode(
+          'MISSING_METHOD_PARAMETERS',
+          "Methods must have an explicit list of parameters.",
+          "Try adding a parameter list.");
 
   static const ParserErrorCode MISSING_GET = const ParserErrorCode(
       'MISSING_GET',
-      "Getters must have the keyword 'get' before the getter name");
+      "Getters must have the keyword 'get' before the getter name.",
+      "Try adding the keyword 'get'.");
 
   static const ParserErrorCode MISSING_IDENTIFIER =
-      const ParserErrorCode('MISSING_IDENTIFIER', "Expected an identifier");
+      const ParserErrorCode('MISSING_IDENTIFIER', "Expected an identifier.");
 
   static const ParserErrorCode MISSING_INITIALIZER =
-      const ParserErrorCode('MISSING_INITIALIZER', "Expected an initializer");
+      const ParserErrorCode('MISSING_INITIALIZER', "Expected an initializer.");
 
   static const ParserErrorCode MISSING_KEYWORD_OPERATOR = const ParserErrorCode(
       'MISSING_KEYWORD_OPERATOR',
-      "Operator declarations must be preceeded by the keyword 'operator'");
+      "Operator declarations must be preceeded by the keyword 'operator'.",
+      "Try adding the keyword 'operator'.");
 
   static const ParserErrorCode MISSING_NAME_IN_LIBRARY_DIRECTIVE =
-      const ParserErrorCode('MISSING_NAME_IN_LIBRARY_DIRECTIVE',
-          "Library directives must include a library name");
+      const ParserErrorCode(
+          'MISSING_NAME_IN_LIBRARY_DIRECTIVE',
+          "Library directives must include a library name.",
+          "Try adding a library name after the keyword 'library', or "
+          "remove the library directive if the library doesn't have any parts.");
 
   static const ParserErrorCode MISSING_NAME_IN_PART_OF_DIRECTIVE =
-      const ParserErrorCode('MISSING_NAME_IN_PART_OF_DIRECTIVE',
-          "Library directives must include a library name");
+      const ParserErrorCode(
+          'MISSING_NAME_IN_PART_OF_DIRECTIVE',
+          "Part-of directives must include a library name.",
+          "Try adding a library name after the 'of'.");
 
   static const ParserErrorCode MISSING_PREFIX_IN_DEFERRED_IMPORT =
-      const ParserErrorCode('MISSING_PREFIX_IN_DEFERRED_IMPORT',
-          "Deferred imports must have a prefix");
+      const ParserErrorCode(
+          'MISSING_PREFIX_IN_DEFERRED_IMPORT',
+          "Deferred imports must have a prefix.",
+          "Try adding a prefix to the import.");
 
   static const ParserErrorCode MISSING_STAR_AFTER_SYNC = const ParserErrorCode(
       'MISSING_STAR_AFTER_SYNC',
-      "The modifier 'sync' must be followed by a star ('*')",
-      "Remove the modifier or add a star.");
+      "The modifier 'sync' must be followed by a star ('*').",
+      "Try removing the modifier, or add a star.");
 
   static const ParserErrorCode MISSING_STATEMENT =
-      const ParserErrorCode('MISSING_STATEMENT', "Expected a statement");
+      const ParserErrorCode('MISSING_STATEMENT', "Expected a statement.");
 
+  /**
+   * Parameters:
+   * 0: the terminator that is missing
+   */
   static const ParserErrorCode MISSING_TERMINATOR_FOR_PARAMETER_GROUP =
-      const ParserErrorCode('MISSING_TERMINATOR_FOR_PARAMETER_GROUP',
-          "There is no '{0}' to close the parameter group");
+      const ParserErrorCode(
+          'MISSING_TERMINATOR_FOR_PARAMETER_GROUP',
+          "There is no '{0}' to close the parameter group.",
+          "Try inserting a '{0}' at the end of the group.");
 
   static const ParserErrorCode MISSING_TYPEDEF_PARAMETERS =
-      const ParserErrorCode('MISSING_TYPEDEF_PARAMETERS',
-          "Type aliases for functions must have an explicit list of parameters");
+      const ParserErrorCode(
+          'MISSING_TYPEDEF_PARAMETERS',
+          "Typedefs must have an explicit list of parameters.",
+          "Try adding a parameter list.");
 
   static const ParserErrorCode MISSING_VARIABLE_IN_FOR_EACH = const ParserErrorCode(
       'MISSING_VARIABLE_IN_FOR_EACH',
-      "A loop variable must be declared in a for-each loop before the 'in', but none were found");
+      "A loop variable must be declared in a for-each loop before the 'in', but none was found.",
+      "Try declaring a loop variable.");
 
   static const ParserErrorCode MIXED_PARAMETER_GROUPS = const ParserErrorCode(
       'MIXED_PARAMETER_GROUPS',
-      "Cannot have both positional and named parameters in a single parameter list");
+      "Can't have both positional and named parameters in a single parameter list.",
+      "Try choosing a single style of optional parameters.");
 
   static const ParserErrorCode MULTIPLE_EXTENDS_CLAUSES = const ParserErrorCode(
       'MULTIPLE_EXTENDS_CLAUSES',
-      "Each class definition can have at most one extends clause");
+      "Each class definition can have at most one extends clause.",
+      "Try choosing one superclass and define your class to implement (or mix in) the others.");
 
   static const ParserErrorCode MULTIPLE_IMPLEMENTS_CLAUSES =
-      const ParserErrorCode('MULTIPLE_IMPLEMENTS_CLAUSES',
-          "Each class definition can have at most one implements clause");
+      const ParserErrorCode(
+          'MULTIPLE_IMPLEMENTS_CLAUSES',
+          "Each class definition can have at most one implements clause.",
+          "Try combining all of the implements clauses into a single clause.");
 
   static const ParserErrorCode MULTIPLE_LIBRARY_DIRECTIVES =
-      const ParserErrorCode('MULTIPLE_LIBRARY_DIRECTIVES',
-          "Only one library directive may be declared in a file");
+      const ParserErrorCode(
+          'MULTIPLE_LIBRARY_DIRECTIVES',
+          "Only one library directive may be declared in a file.",
+          "Try removing all but one of the library directives.");
 
   static const ParserErrorCode MULTIPLE_NAMED_PARAMETER_GROUPS =
-      const ParserErrorCode('MULTIPLE_NAMED_PARAMETER_GROUPS',
-          "Cannot have multiple groups of named parameters in a single parameter list");
+      const ParserErrorCode(
+          'MULTIPLE_NAMED_PARAMETER_GROUPS',
+          "Can't have multiple groups of named parameters in a single parameter list.",
+          "Try combining all of the groups into a single group.");
 
   static const ParserErrorCode MULTIPLE_PART_OF_DIRECTIVES =
-      const ParserErrorCode('MULTIPLE_PART_OF_DIRECTIVES',
-          "Only one part-of directive may be declared in a file");
+      const ParserErrorCode(
+          'MULTIPLE_PART_OF_DIRECTIVES',
+          "Only one part-of directive may be declared in a file.",
+          "Try removing all but one of the part-of directives.");
 
   static const ParserErrorCode MULTIPLE_POSITIONAL_PARAMETER_GROUPS =
-      const ParserErrorCode('MULTIPLE_POSITIONAL_PARAMETER_GROUPS',
-          "Cannot have multiple groups of positional parameters in a single parameter list");
+      const ParserErrorCode(
+          'MULTIPLE_POSITIONAL_PARAMETER_GROUPS',
+          "Can't have multiple groups of positional parameters in a single parameter list.",
+          "Try combining all of the groups into a single group.");
 
+  /**
+   * Parameters:
+   * 0: the number of variables being declared
+   */
   static const ParserErrorCode MULTIPLE_VARIABLES_IN_FOR_EACH =
-      const ParserErrorCode('MULTIPLE_VARIABLES_IN_FOR_EACH',
-          "A single loop variable must be declared in a for-each loop before the 'in', but {0} were found");
+      const ParserErrorCode(
+          'MULTIPLE_VARIABLES_IN_FOR_EACH',
+          "A single loop variable must be declared in a for-each loop before "
+          "the 'in', but {0} were found.",
+          "Try moving all but one of the declarations inside the loop body.");
 
   static const ParserErrorCode MULTIPLE_WITH_CLAUSES = const ParserErrorCode(
       'MULTIPLE_WITH_CLAUSES',
-      "Each class definition can have at most one with clause");
+      "Each class definition can have at most one with clause.",
+      "Try combining all of the with clauses into a single clause.");
 
-  static const ParserErrorCode NAMED_FUNCTION_EXPRESSION =
-      const ParserErrorCode(
-          'NAMED_FUNCTION_EXPRESSION', "Function expressions cannot be named");
+  static const ParserErrorCode NAMED_FUNCTION_EXPRESSION = const ParserErrorCode(
+      'NAMED_FUNCTION_EXPRESSION',
+      "Function expressions can't be named.",
+      "Try removing the name, or "
+      "moving the function expression to a function declaration statement.");
 
   static const ParserErrorCode NAMED_PARAMETER_OUTSIDE_GROUP =
-      const ParserErrorCode('NAMED_PARAMETER_OUTSIDE_GROUP',
-          "Named parameters must be enclosed in curly braces ('{' and '}')");
+      const ParserErrorCode(
+          'NAMED_PARAMETER_OUTSIDE_GROUP',
+          "Named parameters must be enclosed in curly braces ('{' and '}').",
+          "Try surrounding the named parameters in curly braces.");
 
   static const ParserErrorCode NATIVE_CLAUSE_IN_NON_SDK_CODE =
-      const ParserErrorCode('NATIVE_CLAUSE_IN_NON_SDK_CODE',
-          "Native clause can only be used in the SDK and code that is loaded through native extensions");
+      const ParserErrorCode(
+          'NATIVE_CLAUSE_IN_NON_SDK_CODE',
+          "Native clause can only be used in the SDK and code that is loaded "
+          "through native extensions.",
+          "Try removing the native clause.");
 
   static const ParserErrorCode NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE =
-      const ParserErrorCode('NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE',
-          "Native functions can only be declared in the SDK and code that is loaded through native extensions");
+      const ParserErrorCode(
+          'NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE',
+          "Native functions can only be declared in the SDK and code that is "
+          "loaded through native extensions.",
+          "Try removing the word 'native'.");
 
   static const ParserErrorCode NON_CONSTRUCTOR_FACTORY = const ParserErrorCode(
       'NON_CONSTRUCTOR_FACTORY',
-      "Only constructors can be declared to be a 'factory'");
+      "Only a constructor can be declared to be a factory.",
+      "Try removing the keyword 'factory'.");
 
   static const ParserErrorCode NON_IDENTIFIER_LIBRARY_NAME =
-      const ParserErrorCode('NON_IDENTIFIER_LIBRARY_NAME',
-          "The name of a library must be an identifier");
+      const ParserErrorCode(
+          'NON_IDENTIFIER_LIBRARY_NAME',
+          "The name of a library must be an identifier.",
+          "Try using an identifier as the name of the library.");
 
   static const ParserErrorCode NON_PART_OF_DIRECTIVE_IN_PART =
-      const ParserErrorCode('NON_PART_OF_DIRECTIVE_IN_PART',
-          "The part-of directive must be the only directive in a part");
+      const ParserErrorCode(
+          'NON_PART_OF_DIRECTIVE_IN_PART',
+          "The part-of directive must be the only directive in a part.",
+          "Try removing the other directives, or "
+          "moving them to the library for which this is a part.");
 
   static const ParserErrorCode NON_STRING_LITERAL_AS_URI =
       const ParserErrorCode(
           'NON_STRING_LITERAL_AS_URI',
-          "The URI must be a string literal",
-          "Enclose the URI in either single or double quotes.");
+          "The URI must be a string literal.",
+          "Try enclosing the URI in either single or double quotes.");
 
+  /**
+   * Parameters:
+   * 0: the operator that the user is trying to define
+   */
   static const ParserErrorCode NON_USER_DEFINABLE_OPERATOR =
       const ParserErrorCode('NON_USER_DEFINABLE_OPERATOR',
-          "The operator '{0}' is not user definable");
+          "The operator '{0}' isn't user definable.");
 
   static const ParserErrorCode NORMAL_BEFORE_OPTIONAL_PARAMETERS =
-      const ParserErrorCode('NORMAL_BEFORE_OPTIONAL_PARAMETERS',
-          "Normal parameters must occur before optional parameters");
+      const ParserErrorCode(
+          'NORMAL_BEFORE_OPTIONAL_PARAMETERS',
+          "Normal parameters must occur before optional parameters.",
+          "Try moving all of the normal parameters before the optional parameters.");
 
   static const ParserErrorCode NULLABLE_TYPE_IN_EXTENDS = const ParserErrorCode(
       'NULLABLE_TYPE_IN_EXTENDS',
-      "A nullable type cannot be used in an extends clause",
-      "Remove the '?' from the type name");
+      "A nullable type can't be used in an extends clause.",
+      "Try removing the '?' from the type name.");
 
   static const ParserErrorCode NULLABLE_TYPE_IN_IMPLEMENTS =
       const ParserErrorCode(
           'NULLABLE_TYPE_IN_IMPLEMENTS',
-          "A nullable type cannot be used in an implements clause",
-          "Remove the '?' from the type name");
+          "A nullable type can't be used in an implements clause.",
+          "Try removing the '?' from the type name.");
 
   static const ParserErrorCode NULLABLE_TYPE_IN_WITH = const ParserErrorCode(
       'NULLABLE_TYPE_IN_WITH',
-      "A nullable type cannot be used in a with clause",
-      "Remove the '?' from the type name");
+      "A nullable type can't be used in a with clause.",
+      "Try removing the '?' from the type name.");
 
   static const ParserErrorCode NULLABLE_TYPE_PARAMETER = const ParserErrorCode(
       'NULLABLE_TYPE_PARAMETER',
-      "Type parameters cannot be nullable",
-      "Remove the '?' from the type name");
+      "Type parameters can't be nullable.",
+      "Try removing the '?' from the type name.");
 
   static const ParserErrorCode POSITIONAL_AFTER_NAMED_ARGUMENT =
-      const ParserErrorCode('POSITIONAL_AFTER_NAMED_ARGUMENT',
-          "Positional arguments must occur before named arguments");
+      const ParserErrorCode(
+          'POSITIONAL_AFTER_NAMED_ARGUMENT',
+          "Positional arguments must occur before named arguments.",
+          "Try moving all of the positional arguments before the named arguments.");
 
   static const ParserErrorCode POSITIONAL_PARAMETER_OUTSIDE_GROUP =
-      const ParserErrorCode('POSITIONAL_PARAMETER_OUTSIDE_GROUP',
-          "Positional parameters must be enclosed in square brackets ('[' and ']')");
+      const ParserErrorCode(
+          'POSITIONAL_PARAMETER_OUTSIDE_GROUP',
+          "Positional parameters must be enclosed in square brackets ('[' and ']').",
+          "Try surrounding the positional parameters in square brackets.");
 
   static const ParserErrorCode REDIRECTING_CONSTRUCTOR_WITH_BODY =
-      const ParserErrorCode('REDIRECTING_CONSTRUCTOR_WITH_BODY',
-          "Redirecting constructors cannot have a body");
+      const ParserErrorCode(
+          'REDIRECTING_CONSTRUCTOR_WITH_BODY',
+          "Redirecting constructors can't have a body.",
+          "Try removing the body, or "
+          "not making this a redirecting constructor.");
 
   static const ParserErrorCode REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR =
-      const ParserErrorCode('REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR',
-          "Only factory constructor can specify '=' redirection.");
+      const ParserErrorCode(
+          'REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR',
+          "Only factory constructor can specify '=' redirection.",
+          "Try making this a factory constructor, or "
+          "not making this a redirecting constructor.");
 
   static const ParserErrorCode SETTER_IN_FUNCTION = const ParserErrorCode(
       'SETTER_IN_FUNCTION',
-      "Setters cannot be defined within methods or functions");
+      "Setters can't be defined within methods or functions.",
+      "Try moving the setter outside the method or function.");
 
   static const ParserErrorCode STATIC_AFTER_CONST = const ParserErrorCode(
       'STATIC_AFTER_CONST',
-      "The modifier 'static' should be before the modifier 'const'");
+      "The modifier 'static' should be before the modifier 'const'.",
+      "Try re-ordering the modifiers.");
 
   static const ParserErrorCode STATIC_AFTER_FINAL = const ParserErrorCode(
       'STATIC_AFTER_FINAL',
-      "The modifier 'static' should be before the modifier 'final'");
+      "The modifier 'static' should be before the modifier 'final'.",
+      "Try re-ordering the modifiers.");
 
   static const ParserErrorCode STATIC_AFTER_VAR = const ParserErrorCode(
       'STATIC_AFTER_VAR',
-      "The modifier 'static' should be before the modifier 'var'");
+      "The modifier 'static' should be before the modifier 'var'.",
+      "Try re-ordering the modifiers.");
 
   static const ParserErrorCode STATIC_CONSTRUCTOR = const ParserErrorCode(
-      'STATIC_CONSTRUCTOR', "Constructors cannot be static");
+      'STATIC_CONSTRUCTOR',
+      "Constructors can't be static.",
+      "Try removing the keyword 'static'.");
 
   static const ParserErrorCode STATIC_GETTER_WITHOUT_BODY =
       const ParserErrorCode(
-          'STATIC_GETTER_WITHOUT_BODY', "A 'static' getter must have a body");
+          'STATIC_GETTER_WITHOUT_BODY',
+          "A 'static' getter must have a body.",
+          "Try adding a body to the getter, or removing the keyword 'static'.");
 
-  static const ParserErrorCode STATIC_OPERATOR =
-      const ParserErrorCode('STATIC_OPERATOR', "Operators cannot be static");
+  static const ParserErrorCode STATIC_OPERATOR = const ParserErrorCode(
+      'STATIC_OPERATOR',
+      "Operators can't be static.",
+      "Try removing the keyword 'static'.");
 
   static const ParserErrorCode STATIC_SETTER_WITHOUT_BODY =
       const ParserErrorCode(
-          'STATIC_SETTER_WITHOUT_BODY', "A 'static' setter must have a body");
+          'STATIC_SETTER_WITHOUT_BODY',
+          "A 'static' setter must have a body.",
+          "Try adding a body to the setter, or removing the keyword 'static'.");
 
   static const ParserErrorCode STATIC_TOP_LEVEL_DECLARATION =
-      const ParserErrorCode('STATIC_TOP_LEVEL_DECLARATION',
-          "Top-level declarations cannot be declared to be 'static'");
+      const ParserErrorCode(
+          'STATIC_TOP_LEVEL_DECLARATION',
+          "Top-level declarations can't be declared to be static.",
+          "Try removing the keyword 'static'.");
 
   static const ParserErrorCode SWITCH_HAS_CASE_AFTER_DEFAULT_CASE =
-      const ParserErrorCode('SWITCH_HAS_CASE_AFTER_DEFAULT_CASE',
-          "The 'default' case should be the last case in a switch statement");
+      const ParserErrorCode(
+          'SWITCH_HAS_CASE_AFTER_DEFAULT_CASE',
+          "The default case should be the last case in a switch statement.",
+          "Try moving the default case after the other case clauses.");
 
   static const ParserErrorCode SWITCH_HAS_MULTIPLE_DEFAULT_CASES =
-      const ParserErrorCode('SWITCH_HAS_MULTIPLE_DEFAULT_CASES',
-          "The 'default' case can only be declared once");
+      const ParserErrorCode(
+          'SWITCH_HAS_MULTIPLE_DEFAULT_CASES',
+          "The 'default' case can only be declared once.",
+          "Try removing all but one default case.");
 
   static const ParserErrorCode TOP_LEVEL_OPERATOR = const ParserErrorCode(
-      'TOP_LEVEL_OPERATOR', "Operators must be declared within a class");
+      'TOP_LEVEL_OPERATOR',
+      "Operators must be declared within a class.",
+      "Try removing the operator, "
+      "moving it to a class, or "
+      "converting it to be a function.");
 
   static const ParserErrorCode TYPEDEF_IN_CLASS = const ParserErrorCode(
       'TYPEDEF_IN_CLASS',
-      "Function type aliases cannot be declared inside classes");
+      "Typedefs can't be declared inside classes.",
+      "Try moving the typedef to the top-level.");
 
+  /**
+   * Parameters:
+   * 0: the starting character that was missing
+   */
   static const ParserErrorCode UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP =
-      const ParserErrorCode('UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP',
-          "There is no '{0}' to open a parameter group");
+      const ParserErrorCode(
+          'UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP',
+          "There is no '{0}' to open a parameter group.",
+          "Try inserting the '{0}' at the appropriate location.");
 
-  static const ParserErrorCode UNEXPECTED_TOKEN =
-      const ParserErrorCode('UNEXPECTED_TOKEN', "Unexpected token '{0}'");
+  /**
+   * Parameters:
+   * 0: the unexpected text that was found
+   */
+  static const ParserErrorCode UNEXPECTED_TOKEN = const ParserErrorCode(
+      'UNEXPECTED_TOKEN', "Unexpected text '{0}'.", "Try removing the text.");
 
   static const ParserErrorCode WITH_BEFORE_EXTENDS = const ParserErrorCode(
       'WITH_BEFORE_EXTENDS',
-      "The extends clause must be before the with clause");
+      "The extends clause must be before the with clause.",
+      "Try moving the extends clause before the with clause.");
 
   static const ParserErrorCode WITH_WITHOUT_EXTENDS = const ParserErrorCode(
       'WITH_WITHOUT_EXTENDS',
-      "The with clause cannot be used without an extends clause");
-
-  static const ParserErrorCode WRONG_SEPARATOR_FOR_NAMED_PARAMETER =
-      const ParserErrorCode('WRONG_SEPARATOR_FOR_NAMED_PARAMETER',
-          "The default value of a named parameter should be preceeded by ':'");
+      "The with clause can't be used without an extends clause.",
+      "Try adding an extends clause such as 'extends Object'.");
 
   static const ParserErrorCode WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER =
-      const ParserErrorCode('WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER',
-          "The default value of a positional parameter should be preceeded by '='");
+      const ParserErrorCode(
+          'WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER',
+          "The default value of a positional parameter should be preceeded by '='.",
+          "Try replacing the ':' with '='.");
 
+  /**
+   * Parameters:
+   * 0: the terminator that was expected
+   * 1: the terminator that was found
+   */
   static const ParserErrorCode WRONG_TERMINATOR_FOR_PARAMETER_GROUP =
-      const ParserErrorCode('WRONG_TERMINATOR_FOR_PARAMETER_GROUP',
-          "Expected '{0}' to close parameter group");
+      const ParserErrorCode(
+          'WRONG_TERMINATOR_FOR_PARAMETER_GROUP',
+          "Expected '{0}' to close parameter group.",
+          "Try replacing '{0}' with '{1}'.");
 
   static const ParserErrorCode VAR_AND_TYPE = const ParserErrorCode(
       'VAR_AND_TYPE',
-      "Variables cannot be declared using both 'var' and a type name; remove the 'var'");
+      "Variables can't be declared using both 'var' and a type name.",
+      "Try removing the keyword 'var'.");
 
   static const ParserErrorCode VAR_AS_TYPE_NAME = const ParserErrorCode(
-      'VAR_AS_TYPE_NAME', "The keyword 'var' cannot be used as a type name");
+      'VAR_AS_TYPE_NAME',
+      "The keyword 'var' can't be used as a type name.",
+      "Try using 'dynamic' instead of 'var'.");
 
   static const ParserErrorCode VAR_CLASS = const ParserErrorCode(
-      'VAR_CLASS', "Classes cannot be declared to be 'var'");
+      'VAR_CLASS',
+      "Classes can't be declared to be 'var'.",
+      "Try removing the keyword 'var'.");
 
-  static const ParserErrorCode VAR_ENUM =
-      const ParserErrorCode('VAR_ENUM', "Enums cannot be declared to be 'var'");
+  static const ParserErrorCode VAR_ENUM = const ParserErrorCode(
+      'VAR_ENUM',
+      "Enums can't be declared to be 'var'.",
+      "Try removing the keyword 'var'.");
 
   static const ParserErrorCode VAR_RETURN_TYPE = const ParserErrorCode(
-      'VAR_RETURN_TYPE', "The return type cannot be 'var'");
+      'VAR_RETURN_TYPE',
+      "The return type can't be 'var'.",
+      "Try removing the keyword 'var', or "
+      "replacing it with the name of the return type.");
 
   static const ParserErrorCode VAR_TYPEDEF = const ParserErrorCode(
-      'VAR_TYPEDEF', "Type aliases cannot be declared to be 'var'");
+      'VAR_TYPEDEF',
+      "Typedefs can't be declared to be 'var'.",
+      "Try removing the keyword 'var', or "
+      "replacing it with the name of the return type.");
 
   static const ParserErrorCode VOID_PARAMETER = const ParserErrorCode(
-      'VOID_PARAMETER', "Parameters cannot have a type of 'void'");
+      'VOID_PARAMETER',
+      "Parameters can't have a type of 'void'.",
+      "Try removing the keyword 'var', or "
+      "replacing it with the name of the type of the parameter.");
 
   static const ParserErrorCode VOID_VARIABLE = const ParserErrorCode(
-      'VOID_VARIABLE', "Variables cannot have a type of 'void'");
+      'VOID_VARIABLE',
+      "Variables can't have a type of 'void'.",
+      "Try removing the keyword 'void', or "
+      "replacing it with the name of the type of the variable.");
 
   /**
    * Initialize a newly created error code to have the given [name]. The message
@@ -666,46 +941,3 @@
   @override
   ErrorType get type => ErrorType.SYNTACTIC_ERROR;
 }
-
-/**
- * The error codes used for errors detected by the scanner.
- */
-class ScannerErrorCode extends ErrorCode {
-  static const ScannerErrorCode ILLEGAL_CHARACTER =
-      const ScannerErrorCode('ILLEGAL_CHARACTER', "Illegal character {0}");
-
-  static const ScannerErrorCode MISSING_DIGIT =
-      const ScannerErrorCode('MISSING_DIGIT', "Decimal digit expected");
-
-  static const ScannerErrorCode MISSING_HEX_DIGIT =
-      const ScannerErrorCode('MISSING_HEX_DIGIT', "Hexidecimal digit expected");
-
-  static const ScannerErrorCode MISSING_QUOTE =
-      const ScannerErrorCode('MISSING_QUOTE', "Expected quote (' or \")");
-
-  static const ScannerErrorCode UNABLE_GET_CONTENT = const ScannerErrorCode(
-      'UNABLE_GET_CONTENT', "Unable to get content: {0}");
-
-  static const ScannerErrorCode UNTERMINATED_MULTI_LINE_COMMENT =
-      const ScannerErrorCode(
-          'UNTERMINATED_MULTI_LINE_COMMENT', "Unterminated multi-line comment");
-
-  static const ScannerErrorCode UNTERMINATED_STRING_LITERAL =
-      const ScannerErrorCode(
-          'UNTERMINATED_STRING_LITERAL', "Unterminated string literal");
-
-  /**
-   * Initialize a newly created error code to have the given [name]. The message
-   * associated with the error will be created from the given [message]
-   * template. The correction associated with the error will be created from the
-   * given [correction] template.
-   */
-  const ScannerErrorCode(String name, String message, [String correction])
-      : super(name, message, correction);
-
-  @override
-  ErrorSeverity get errorSeverity => ErrorSeverity.ERROR;
-
-  @override
-  ErrorType get type => ErrorType.SYNTACTIC_ERROR;
-}
diff --git a/pkg/analyzer/lib/src/dart/error/todo_codes.dart b/pkg/analyzer/lib/src/dart/error/todo_codes.dart
new file mode 100644
index 0000000..3980f57
--- /dev/null
+++ b/pkg/analyzer/lib/src/dart/error/todo_codes.dart
@@ -0,0 +1,45 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analyzer.src.dart.error.todo_codes;
+
+import 'package:analyzer/error/error.dart';
+
+/**
+ * The error code indicating a marker in code for work that needs to be finished
+ * or revisited.
+ */
+class TodoCode extends ErrorCode {
+  /**
+   * The single enum of TodoCode.
+   */
+  static const TodoCode TODO = const TodoCode('TODO');
+
+  /**
+   * This matches the two common Dart task styles
+   *
+   * * TODO:
+   * * TODO(username):
+   *
+   * As well as
+   * * TODO
+   *
+   * But not
+   * * todo
+   * * TODOS
+   */
+  static RegExp TODO_REGEX =
+      new RegExp("([\\s/\\*])((TODO[^\\w\\d][^\\r\\n]*)|(TODO:?\$))");
+
+  /**
+   * Initialize a newly created error code to have the given [name].
+   */
+  const TodoCode(String name) : super(name, "{0}");
+
+  @override
+  ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
+
+  @override
+  ErrorType get type => ErrorType.TODO;
+}
diff --git a/pkg/analyzer/lib/src/dart/resolver/inheritance_manager.dart b/pkg/analyzer/lib/src/dart/resolver/inheritance_manager.dart
index 57c4169..69d3948 100644
--- a/pkg/analyzer/lib/src/dart/resolver/inheritance_manager.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/inheritance_manager.dart
@@ -54,12 +54,22 @@
       new HashMap<ClassElement, Set<AnalysisError>>();
 
   /**
+   * Indicates whether errors should be ignored.
+   *
+   * When this bool is `true`, we skip the logic that figures out which error
+   * to report; this avoids a crash when the inheritance manager is used in the
+   * context of summary linking (where there is not enough information available
+   * to determine error locations).
+   */
+  final bool ignoreErrors;
+
+  /**
    * Initialize a newly created inheritance manager.
    *
    * @param library the library element context that the inheritance mappings are being generated
    */
   InheritanceManager(LibraryElement library,
-      {bool includeAbstractFromSuperclasses: false}) {
+      {bool includeAbstractFromSuperclasses: false, this.ignoreErrors: false}) {
     this._library = library;
     _includeAbstractFromSuperclasses = includeAbstractFromSuperclasses;
     _classLookup = new HashMap<ClassElement, Map<String, ExecutableElement>>();
@@ -654,15 +664,15 @@
    * @param errorCode the error code to be associated with this error
    * @param arguments the arguments used to build the error message
    */
-  void _reportError(ClassElement classElt, int offset, int length,
-      ErrorCode errorCode, List<Object> arguments) {
-    HashSet<AnalysisError> errorSet = _errorsInClassElement[classElt];
-    if (errorSet == null) {
-      errorSet = new HashSet<AnalysisError>();
-      _errorsInClassElement[classElt] = errorSet;
+  void _reportError(
+      ClassElement classElt, ErrorCode errorCode, List<Object> arguments) {
+    if (ignoreErrors) {
+      return;
     }
-    errorSet.add(new AnalysisError(
-        classElt.source, offset, length, errorCode, arguments));
+    HashSet<AnalysisError> errorSet = _errorsInClassElement.putIfAbsent(
+        classElt, () => new HashSet<AnalysisError>());
+    errorSet.add(new AnalysisError(classElt.source, classElt.nameOffset,
+        classElt.nameLength, errorCode, arguments));
   }
 
   /**
@@ -793,8 +803,6 @@
                     "${executableElementTypes[0]}, ${executableElementTypes[1]}";
                 _reportError(
                     classElt,
-                    classElt.nameOffset,
-                    classElt.nameLength,
                     StaticTypeWarningCode.INCONSISTENT_METHOD_INHERITANCE,
                     [key, firstTwoFuntionTypesStr]);
               }
@@ -823,8 +831,6 @@
         } else {
           _reportError(
               classElt,
-              classElt.nameOffset,
-              classElt.nameLength,
               StaticWarningCode
                   .INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD,
               [key]);
diff --git a/pkg/analyzer/lib/src/dart/scanner/reader.dart b/pkg/analyzer/lib/src/dart/scanner/reader.dart
index 81f506e..6e111e2 100644
--- a/pkg/analyzer/lib/src/dart/scanner/reader.dart
+++ b/pkg/analyzer/lib/src/dart/scanner/reader.dart
@@ -4,6 +4,11 @@
 
 library analyzer.src.dart.scanner.reader;
 
+import 'package:front_end/src/scanner/reader.dart';
+
+export 'package:front_end/src/scanner/reader.dart'
+    show CharacterReader, CharSequenceReader, SubSequenceReader;
+
 /**
  * A [CharacterReader] that reads a range of characters from another character
  * reader.
@@ -55,133 +60,3 @@
     return baseReader.peek();
   }
 }
-
-/**
- * An object used by the scanner to read the characters to be scanned.
- */
-abstract class CharacterReader {
-  /**
-   * The current offset relative to the beginning of the source. Return the
-   * initial offset if the scanner has not yet scanned the source code, and one
-   * (1) past the end of the source code if the entire source code has been
-   * scanned.
-   */
-  int get offset;
-
-  /**
-   * Set the current offset relative to the beginning of the source to the given
-   * [offset]. The new offset must be between the initial offset and one (1)
-   * past the end of the source code.
-   */
-  void set offset(int offset);
-
-  /**
-   * Advance the current position and return the character at the new current
-   * position.
-   */
-  int advance();
-
-  /**
-   * Return the substring of the source code between the [start] offset and the
-   * modified current position. The current position is modified by adding the
-   * [endDelta], which is the number of characters after the current location to
-   * be included in the string, or the number of characters before the current
-   * location to be excluded if the offset is negative.
-   */
-  String getString(int start, int endDelta);
-
-  /**
-   * Return the character at the current position without changing the current
-   * position.
-   */
-  int peek();
-}
-
-/**
- * A [CharacterReader] that reads characters from a character sequence.
- */
-class CharSequenceReader implements CharacterReader {
-  /**
-   * The sequence from which characters will be read.
-   */
-  final String _sequence;
-
-  /**
-   * The number of characters in the string.
-   */
-  int _stringLength;
-
-  /**
-   * The index, relative to the string, of the next character to be read.
-   */
-  int _charOffset;
-
-  /**
-   * Initialize a newly created reader to read the characters in the given
-   * [_sequence].
-   */
-  CharSequenceReader(this._sequence) {
-    this._stringLength = _sequence.length;
-    this._charOffset = 0;
-  }
-
-  @override
-  int get offset => _charOffset - 1;
-
-  @override
-  void set offset(int offset) {
-    _charOffset = offset + 1;
-  }
-
-  @override
-  int advance() {
-    if (_charOffset >= _stringLength) {
-      return -1;
-    }
-    return _sequence.codeUnitAt(_charOffset++);
-  }
-
-  @override
-  String getString(int start, int endDelta) =>
-      _sequence.substring(start, _charOffset + endDelta);
-
-  @override
-  int peek() {
-    if (_charOffset >= _stringLength) {
-      return -1;
-    }
-    return _sequence.codeUnitAt(_charOffset);
-  }
-}
-
-/**
- * A [CharacterReader] that reads characters from a character sequence, but adds
- * a delta when reporting the current character offset so that the character
- * sequence can be a subsequence from a larger sequence.
- */
-class SubSequenceReader extends CharSequenceReader {
-  /**
-   * The offset from the beginning of the file to the beginning of the source
-   * being scanned.
-   */
-  final int _offsetDelta;
-
-  /**
-   * Initialize a newly created reader to read the characters in the given
-   * [sequence]. The [_offsetDelta] is the offset from the beginning of the file
-   * to the beginning of the source being scanned
-   */
-  SubSequenceReader(String sequence, this._offsetDelta) : super(sequence);
-
-  @override
-  int get offset => _offsetDelta + super.offset;
-
-  @override
-  void set offset(int offset) {
-    super.offset = offset - _offsetDelta;
-  }
-
-  @override
-  String getString(int start, int endDelta) =>
-      super.getString(start - _offsetDelta, endDelta);
-}
diff --git a/pkg/analyzer/lib/src/dart/scanner/scanner.dart b/pkg/analyzer/lib/src/dart/scanner/scanner.dart
index 3c74e78..3f87b84 100644
--- a/pkg/analyzer/lib/src/dart/scanner/scanner.dart
+++ b/pkg/analyzer/lib/src/dart/scanner/scanner.dart
@@ -4,123 +4,15 @@
 
 library analyzer.src.dart.scanner.scanner;
 
-import 'package:analyzer/dart/ast/token.dart';
 import 'package:analyzer/error/error.dart';
 import 'package:analyzer/error/listener.dart';
-import 'package:analyzer/src/dart/ast/token.dart';
 import 'package:analyzer/src/dart/error/syntactic_errors.dart';
 import 'package:analyzer/src/dart/scanner/reader.dart';
-import 'package:analyzer/src/generated/java_engine.dart';
 import 'package:analyzer/src/generated/source.dart';
-import 'package:charcode/ascii.dart';
+import 'package:front_end/src/scanner/scanner.dart' as fe;
 
 export 'package:analyzer/src/dart/error/syntactic_errors.dart';
-
-/**
- * A state in a state machine used to scan keywords.
- */
-class KeywordState {
-  /**
-   * An empty transition table used by leaf states.
-   */
-  static List<KeywordState> _EMPTY_TABLE = new List<KeywordState>(26);
-
-  /**
-   * The initial state in the state machine.
-   */
-  static final KeywordState KEYWORD_STATE = _createKeywordStateTable();
-
-  /**
-   * A table mapping characters to the states to which those characters will
-   * transition. (The index into the array is the offset from the character
-   * `'a'` to the transitioning character.)
-   */
-  final List<KeywordState> _table;
-
-  /**
-   * The keyword that is recognized by this state, or `null` if this state is
-   * not a terminal state.
-   */
-  Keyword _keyword;
-
-  /**
-   * Initialize a newly created state to have the given transitions and to
-   * recognize the keyword with the given [syntax].
-   */
-  KeywordState(this._table, String syntax) {
-    this._keyword = (syntax == null) ? null : Keyword.keywords[syntax];
-  }
-
-  /**
-   * Return the keyword that was recognized by this state, or `null` if this
-   * state does not recognized a keyword.
-   */
-  Keyword keyword() => _keyword;
-
-  /**
-   * Return the state that follows this state on a transition of the given
-   * [character], or `null` if there is no valid state reachable from this state
-   * with such a transition.
-   */
-  KeywordState next(int character) => _table[character - $a];
-
-  /**
-   * Create the next state in the state machine where we have already recognized
-   * the subset of strings in the given array of [strings] starting at the given
-   * [offset] and having the given [length]. All of these strings have a common
-   * prefix and the next character is at the given [start] index.
-   */
-  static KeywordState _computeKeywordStateTable(
-      int start, List<String> strings, int offset, int length) {
-    List<KeywordState> result = new List<KeywordState>(26);
-    assert(length != 0);
-    int chunk = $nul;
-    int chunkStart = -1;
-    bool isLeaf = false;
-    for (int i = offset; i < offset + length; i++) {
-      if (strings[i].length == start) {
-        isLeaf = true;
-      }
-      if (strings[i].length > start) {
-        int c = strings[i].codeUnitAt(start);
-        if (chunk != c) {
-          if (chunkStart != -1) {
-            result[chunk - $a] = _computeKeywordStateTable(
-                start + 1, strings, chunkStart, i - chunkStart);
-          }
-          chunkStart = i;
-          chunk = c;
-        }
-      }
-    }
-    if (chunkStart != -1) {
-      assert(result[chunk - $a] == null);
-      result[chunk - $a] = _computeKeywordStateTable(
-          start + 1, strings, chunkStart, offset + length - chunkStart);
-    } else {
-      assert(length == 1);
-      return new KeywordState(_EMPTY_TABLE, strings[offset]);
-    }
-    if (isLeaf) {
-      return new KeywordState(result, strings[offset]);
-    } else {
-      return new KeywordState(result, null);
-    }
-  }
-
-  /**
-   * Create and return the initial state in the state machine.
-   */
-  static KeywordState _createKeywordStateTable() {
-    List<Keyword> values = Keyword.values;
-    List<String> strings = new List<String>(values.length);
-    for (int i = 0; i < values.length; i++) {
-      strings[i] = values[i].syntax;
-    }
-    strings.sort();
-    return _computeKeywordStateTable(0, strings, 0, strings.length);
-  }
-}
+export 'package:front_end/src/scanner/scanner.dart' show KeywordState;
 
 /**
  * The class `Scanner` implements a scanner for Dart code.
@@ -132,1224 +24,31 @@
  * any context, so it always resolves such conflicts by scanning the longest
  * possible token.
  */
-class Scanner {
+class Scanner extends fe.Scanner {
   /**
    * The source being scanned.
    */
   final Source source;
 
   /**
-   * The reader used to access the characters in the source.
-   */
-  final CharacterReader _reader;
-
-  /**
    * The error listener that will be informed of any errors that are found
    * during the scan.
    */
   final AnalysisErrorListener _errorListener;
 
   /**
-   * The flag specifying whether documentation comments should be parsed.
-   */
-  bool _preserveComments = true;
-
-  /**
-   * The token pointing to the head of the linked list of tokens.
-   */
-  Token _tokens;
-
-  /**
-   * The last token that was scanned.
-   */
-  Token _tail;
-
-  /**
-   * The first token in the list of comment tokens found since the last
-   * non-comment token.
-   */
-  Token _firstComment;
-
-  /**
-   * The last token in the list of comment tokens found since the last
-   * non-comment token.
-   */
-  Token _lastComment;
-
-  /**
-   * The index of the first character of the current token.
-   */
-  int _tokenStart = 0;
-
-  /**
-   * A list containing the offsets of the first character of each line in the
-   * source code.
-   */
-  List<int> _lineStarts = new List<int>();
-
-  /**
-   * A list, treated something like a stack, of tokens representing the
-   * beginning of a matched pair. It is used to pair the end tokens with the
-   * begin tokens.
-   */
-  List<BeginToken> _groupingStack = new List<BeginToken>();
-
-  /**
-   * The index of the last item in the [_groupingStack], or `-1` if the stack is
-   * empty.
-   */
-  int _stackEnd = -1;
-
-  /**
-   * A flag indicating whether any unmatched groups were found during the parse.
-   */
-  bool _hasUnmatchedGroups = false;
-
-  /**
-   * A flag indicating whether to parse generic method comments, of the form
-   * `/*=T*/` and `/*<T>*/`.
-   */
-  bool scanGenericMethodComments = false;
-
-  /**
-   * A flag indicating whether the lazy compound assignment operators '&&=' and
-   * '||=' are enabled.
-   */
-  bool scanLazyAssignmentOperators = false;
-
-  /**
    * Initialize a newly created scanner to scan characters from the given
-   * [source]. The given character [_reader] will be used to read the characters
+   * [source]. The given character [reader] will be used to read the characters
    * in the source. The given [_errorListener] will be informed of any errors
    * that are found.
    */
-  Scanner(this.source, this._reader, this._errorListener) {
-    _tokens = new Token(TokenType.EOF, -1);
-    _tokens.setNext(_tokens);
-    _tail = _tokens;
-    _tokenStart = -1;
-    _lineStarts.add(0);
-  }
+  Scanner(this.source, CharacterReader reader, this._errorListener)
+      : super(reader);
 
-  /**
-   * Return the first token in the token stream that was scanned.
-   */
-  Token get firstToken => _tokens.next;
-
-  /**
-   * Return `true` if any unmatched groups were found during the parse.
-   */
-  bool get hasUnmatchedGroups => _hasUnmatchedGroups;
-
-  /**
-   * Return an array containing the offsets of the first character of each line
-   * in the source code.
-   */
-  List<int> get lineStarts => _lineStarts;
-
-  /**
-   * Set whether documentation tokens should be preserved.
-   */
-  void set preserveComments(bool preserveComments) {
-    this._preserveComments = preserveComments;
-  }
-
-  /**
-   * Return the last token that was scanned.
-   */
-  Token get tail => _tail;
-
-  /**
-   * Append the given [token] to the end of the token stream being scanned. This
-   * method is intended to be used by subclasses that copy existing tokens and
-   * should not normally be used because it will fail to correctly associate any
-   * comments with the token being passed in.
-   */
-  void appendToken(Token token) {
-    _tail = _tail.setNext(token);
-  }
-
-  int bigSwitch(int next) {
-    _beginToken();
-    if (next == $cr) {
-      // '\r'
-      next = _reader.advance();
-      if (next == $lf) {
-        // '\n'
-        next = _reader.advance();
-      }
-      recordStartOfLine();
-      return next;
-    } else if (next == $lf) {
-      // '\n'
-      next = _reader.advance();
-      recordStartOfLine();
-      return next;
-    } else if (next == $tab || next == $space) {
-      // '\t' || ' '
-      return _reader.advance();
-    }
-    if (next == $r) {
-      // 'r'
-      int peek = _reader.peek();
-      if (peek == $double_quote || peek == $single_quote) {
-        // '"' || "'"
-        int start = _reader.offset;
-        return _tokenizeString(_reader.advance(), start, true);
-      }
-    }
-    if ($a <= next && next <= $z) {
-      // 'a'-'z'
-      return _tokenizeKeywordOrIdentifier(next, true);
-    }
-    if (($A <= next && next <= $Z) || next == $_ || next == $$) {
-      // 'A'-'Z' || '_' || '$'
-      return _tokenizeIdentifier(next, _reader.offset, true);
-    }
-    if (next == $lt) {
-      // '<'
-      return _tokenizeLessThan(next);
-    }
-    if (next == $gt) {
-      // '>'
-      return _tokenizeGreaterThan(next);
-    }
-    if (next == $equal) {
-      // '='
-      return _tokenizeEquals(next);
-    }
-    if (next == $exclamation) {
-      // '!'
-      return _tokenizeExclamation(next);
-    }
-    if (next == $plus) {
-      // '+'
-      return _tokenizePlus(next);
-    }
-    if (next == $minus) {
-      // '-'
-      return _tokenizeMinus(next);
-    }
-    if (next == $asterisk) {
-      // '*'
-      return _tokenizeMultiply(next);
-    }
-    if (next == $percent) {
-      // '%'
-      return _tokenizePercent(next);
-    }
-    if (next == $ampersand) {
-      // '&'
-      return _tokenizeAmpersand(next);
-    }
-    if (next == $bar) {
-      // '|'
-      return _tokenizeBar(next);
-    }
-    if (next == $caret) {
-      // '^'
-      return _tokenizeCaret(next);
-    }
-    if (next == $open_bracket) {
-      // '['
-      return _tokenizeOpenSquareBracket(next);
-    }
-    if (next == $tilde) {
-      // '~'
-      return _tokenizeTilde(next);
-    }
-    if (next == $backslash) {
-      // '\\'
-      _appendTokenOfType(TokenType.BACKSLASH);
-      return _reader.advance();
-    }
-    if (next == $hash) {
-      // '#'
-      return _tokenizeTag(next);
-    }
-    if (next == $open_paren) {
-      // '('
-      _appendBeginToken(TokenType.OPEN_PAREN);
-      return _reader.advance();
-    }
-    if (next == $close_paren) {
-      // ')'
-      _appendEndToken(TokenType.CLOSE_PAREN, TokenType.OPEN_PAREN);
-      return _reader.advance();
-    }
-    if (next == $comma) {
-      // ','
-      _appendTokenOfType(TokenType.COMMA);
-      return _reader.advance();
-    }
-    if (next == $colon) {
-      // ':'
-      _appendTokenOfType(TokenType.COLON);
-      return _reader.advance();
-    }
-    if (next == $semicolon) {
-      // ';'
-      _appendTokenOfType(TokenType.SEMICOLON);
-      return _reader.advance();
-    }
-    if (next == $question) {
-      // '?'
-      return _tokenizeQuestion();
-    }
-    if (next == $close_bracket) {
-      // ']'
-      _appendEndToken(
-          TokenType.CLOSE_SQUARE_BRACKET, TokenType.OPEN_SQUARE_BRACKET);
-      return _reader.advance();
-    }
-    if (next == $backquote) {
-      // '`'
-      _appendTokenOfType(TokenType.BACKPING);
-      return _reader.advance();
-    }
-    if (next == $lbrace) {
-      // '{'
-      _appendBeginToken(TokenType.OPEN_CURLY_BRACKET);
-      return _reader.advance();
-    }
-    if (next == $rbrace) {
-      // '}'
-      _appendEndToken(
-          TokenType.CLOSE_CURLY_BRACKET, TokenType.OPEN_CURLY_BRACKET);
-      return _reader.advance();
-    }
-    if (next == $slash) {
-      // '/'
-      return _tokenizeSlashOrComment(next);
-    }
-    if (next == $at) {
-      // '@'
-      _appendTokenOfType(TokenType.AT);
-      return _reader.advance();
-    }
-    if (next == $double_quote || next == $single_quote) {
-      // '"' || "'"
-      return _tokenizeString(next, _reader.offset, false);
-    }
-    if (next == $dot) {
-      // '.'
-      return _tokenizeDotOrNumber(next);
-    }
-    if (next == $0) {
-      // '0'
-      return _tokenizeHexOrNumber(next);
-    }
-    if ($1 <= next && next <= $9) {
-      // '1'-'9'
-      return _tokenizeNumber(next);
-    }
-    if (next == -1) {
-      // EOF
-      return -1;
-    }
-    _reportError(ScannerErrorCode.ILLEGAL_CHARACTER, [next]);
-    return _reader.advance();
-  }
-
-  /**
-   * Record the fact that we are at the beginning of a new line in the source.
-   */
-  void recordStartOfLine() {
-    _lineStarts.add(_reader.offset);
-  }
-
-  /**
-   * Record that the source begins on the given [line] and [column] at the
-   * current offset as given by the reader. Both the line and the column are
-   * one-based indexes. The line starts for lines before the given line will not
-   * be correct.
-   *
-   * This method must be invoked at most one time and must be invoked before
-   * scanning begins. The values provided must be sensible. The results are
-   * undefined if these conditions are violated.
-   */
-  void setSourceStart(int line, int column) {
-    int offset = _reader.offset;
-    if (line < 1 || column < 1 || offset < 0 || (line + column - 2) >= offset) {
-      return;
-    }
-    for (int i = 2; i < line; i++) {
-      _lineStarts.add(1);
-    }
-    _lineStarts.add(offset - column + 1);
-  }
-
-  /**
-   * Scan the source code to produce a list of tokens representing the source,
-   * and return the first token in the list of tokens that were produced.
-   */
-  Token tokenize() {
-    int next = _reader.advance();
-    while (next != -1) {
-      next = bigSwitch(next);
-    }
-    _appendEofToken();
-    return firstToken;
-  }
-
-  void _appendBeginToken(TokenType type) {
-    BeginToken token;
-    if (_firstComment == null) {
-      token = new BeginToken(type, _tokenStart);
-    } else {
-      token = new BeginTokenWithComment(type, _tokenStart, _firstComment);
-      _firstComment = null;
-      _lastComment = null;
-    }
-    _tail = _tail.setNext(token);
-    _groupingStack.add(token);
-    _stackEnd++;
-  }
-
-  void _appendCommentToken(TokenType type, String value) {
-    CommentToken token = null;
-    TokenType genericComment = _matchGenericMethodCommentType(value);
-    if (genericComment != null) {
-      token = new CommentToken(genericComment, value, _tokenStart);
-    } else if (!_preserveComments) {
-      // Ignore comment tokens if client specified that it doesn't need them.
-      return;
-    } else {
-      // OK, remember comment tokens.
-      if (_isDocumentationComment(value)) {
-        token = new DocumentationCommentToken(type, value, _tokenStart);
-      } else {
-        token = new CommentToken(type, value, _tokenStart);
-      }
-    }
-    if (_firstComment == null) {
-      _firstComment = token;
-      _lastComment = _firstComment;
-    } else {
-      _lastComment = _lastComment.setNext(token);
-    }
-  }
-
-  void _appendEndToken(TokenType type, TokenType beginType) {
-    Token token;
-    if (_firstComment == null) {
-      token = new Token(type, _tokenStart);
-    } else {
-      token = new TokenWithComment(type, _tokenStart, _firstComment);
-      _firstComment = null;
-      _lastComment = null;
-    }
-    _tail = _tail.setNext(token);
-    if (_stackEnd >= 0) {
-      BeginToken begin = _groupingStack[_stackEnd];
-      if (begin.type == beginType) {
-        begin.endToken = token;
-        _groupingStack.removeAt(_stackEnd--);
-      }
-    }
-  }
-
-  void _appendEofToken() {
-    Token eofToken;
-    if (_firstComment == null) {
-      eofToken = new Token(TokenType.EOF, _reader.offset + 1);
-    } else {
-      eofToken = new TokenWithComment(
-          TokenType.EOF, _reader.offset + 1, _firstComment);
-      _firstComment = null;
-      _lastComment = null;
-    }
-    // The EOF token points to itself so that there is always infinite
-    // look-ahead.
-    eofToken.setNext(eofToken);
-    _tail = _tail.setNext(eofToken);
-    if (_stackEnd >= 0) {
-      _hasUnmatchedGroups = true;
-      // TODO(brianwilkerson) Fix the ungrouped tokens?
-    }
-  }
-
-  void _appendKeywordToken(Keyword keyword) {
-    if (_firstComment == null) {
-      _tail = _tail.setNext(new KeywordToken(keyword, _tokenStart));
-    } else {
-      _tail = _tail.setNext(
-          new KeywordTokenWithComment(keyword, _tokenStart, _firstComment));
-      _firstComment = null;
-      _lastComment = null;
-    }
-  }
-
-  void _appendStringToken(TokenType type, String value) {
-    if (_firstComment == null) {
-      _tail = _tail.setNext(new StringToken(type, value, _tokenStart));
-    } else {
-      _tail = _tail.setNext(
-          new StringTokenWithComment(type, value, _tokenStart, _firstComment));
-      _firstComment = null;
-      _lastComment = null;
-    }
-  }
-
-  void _appendStringTokenWithOffset(TokenType type, String value, int offset) {
-    if (_firstComment == null) {
-      _tail = _tail.setNext(new StringToken(type, value, _tokenStart + offset));
-    } else {
-      _tail = _tail.setNext(new StringTokenWithComment(
-          type, value, _tokenStart + offset, _firstComment));
-      _firstComment = null;
-      _lastComment = null;
-    }
-  }
-
-  void _appendTokenOfType(TokenType type) {
-    if (_firstComment == null) {
-      _tail = _tail.setNext(new Token(type, _tokenStart));
-    } else {
-      _tail =
-          _tail.setNext(new TokenWithComment(type, _tokenStart, _firstComment));
-      _firstComment = null;
-      _lastComment = null;
-    }
-  }
-
-  void _appendTokenOfTypeWithOffset(TokenType type, int offset) {
-    if (_firstComment == null) {
-      _tail = _tail.setNext(new Token(type, offset));
-    } else {
-      _tail = _tail.setNext(new TokenWithComment(type, offset, _firstComment));
-      _firstComment = null;
-      _lastComment = null;
-    }
-  }
-
-  void _beginToken() {
-    _tokenStart = _reader.offset;
-  }
-
-  /**
-   * Return the beginning token corresponding to a closing brace that was found
-   * while scanning inside a string interpolation expression. Tokens that cannot
-   * be matched with the closing brace will be dropped from the stack.
-   */
-  BeginToken _findTokenMatchingClosingBraceInInterpolationExpression() {
-    while (_stackEnd >= 0) {
-      BeginToken begin = _groupingStack[_stackEnd];
-      if (begin.type == TokenType.OPEN_CURLY_BRACKET ||
-          begin.type == TokenType.STRING_INTERPOLATION_EXPRESSION) {
-        return begin;
-      }
-      _hasUnmatchedGroups = true;
-      _groupingStack.removeAt(_stackEnd--);
-    }
-    //
-    // We should never get to this point because we wouldn't be inside a string
-    // interpolation expression unless we had previously found the start of the
-    // expression.
-    //
-    return null;
-  }
-
-  /**
-   * Checks if [value] is the start of a generic method type annotation comment.
-   *
-   * This can either be of the form `/*<T>*/` or `/*=T*/`. The token type is
-   * returned, or null if it was not a generic method comment.
-   */
-  TokenType _matchGenericMethodCommentType(String value) {
-    if (scanGenericMethodComments) {
-      // Match /*< and >*/
-      if (StringUtilities.startsWith3(value, 0, $slash, $asterisk, $lt) &&
-          StringUtilities.endsWith3(value, $gt, $asterisk, $slash)) {
-        return TokenType.GENERIC_METHOD_TYPE_LIST;
-      }
-      // Match /*=
-      if (StringUtilities.startsWith3(value, 0, $slash, $asterisk, $equal)) {
-        return TokenType.GENERIC_METHOD_TYPE_ASSIGN;
-      }
-    }
-    return null;
-  }
-
-  /**
-   * Report an error at the current offset. The [errorCode] is the error code
-   * indicating the nature of the error. The [arguments] are any arguments
-   * needed to complete the error message
-   */
-  void _reportError(ScannerErrorCode errorCode, [List<Object> arguments]) {
-    _errorListener.onError(
-        new AnalysisError(source, _reader.offset, 1, errorCode, arguments));
-  }
-
-  int _select(int choice, TokenType yesType, TokenType noType) {
-    int next = _reader.advance();
-    if (next == choice) {
-      _appendTokenOfType(yesType);
-      return _reader.advance();
-    } else {
-      _appendTokenOfType(noType);
-      return next;
-    }
-  }
-
-  int _selectWithOffset(
-      int choice, TokenType yesType, TokenType noType, int offset) {
-    int next = _reader.advance();
-    if (next == choice) {
-      _appendTokenOfTypeWithOffset(yesType, offset);
-      return _reader.advance();
-    } else {
-      _appendTokenOfTypeWithOffset(noType, offset);
-      return next;
-    }
-  }
-
-  int _tokenizeAmpersand(int next) {
-    // &&= && &= &
-    next = _reader.advance();
-    if (next == $ampersand) {
-      next = _reader.advance();
-      if (scanLazyAssignmentOperators && next == $equal) {
-        _appendTokenOfType(TokenType.AMPERSAND_AMPERSAND_EQ);
-        return _reader.advance();
-      }
-      _appendTokenOfType(TokenType.AMPERSAND_AMPERSAND);
-      return next;
-    } else if (next == $equal) {
-      _appendTokenOfType(TokenType.AMPERSAND_EQ);
-      return _reader.advance();
-    } else {
-      _appendTokenOfType(TokenType.AMPERSAND);
-      return next;
-    }
-  }
-
-  int _tokenizeBar(int next) {
-    // ||= || |= |
-    next = _reader.advance();
-    if (next == $bar) {
-      next = _reader.advance();
-      if (scanLazyAssignmentOperators && next == $equal) {
-        _appendTokenOfType(TokenType.BAR_BAR_EQ);
-        return _reader.advance();
-      }
-      _appendTokenOfType(TokenType.BAR_BAR);
-      return next;
-    } else if (next == $equal) {
-      _appendTokenOfType(TokenType.BAR_EQ);
-      return _reader.advance();
-    } else {
-      _appendTokenOfType(TokenType.BAR);
-      return next;
-    }
-  }
-
-  int _tokenizeCaret(int next) =>
-      _select($equal, TokenType.CARET_EQ, TokenType.CARET);
-
-  int _tokenizeDotOrNumber(int next) {
-    int start = _reader.offset;
-    next = _reader.advance();
-    if ($0 <= next && next <= $9) {
-      return _tokenizeFractionPart(next, start);
-    } else if ($dot == next) {
-      return _select(
-          $dot, TokenType.PERIOD_PERIOD_PERIOD, TokenType.PERIOD_PERIOD);
-    } else {
-      _appendTokenOfType(TokenType.PERIOD);
-      return next;
-    }
-  }
-
-  int _tokenizeEquals(int next) {
-    // = == =>
-    next = _reader.advance();
-    if (next == $equal) {
-      _appendTokenOfType(TokenType.EQ_EQ);
-      return _reader.advance();
-    } else if (next == $gt) {
-      _appendTokenOfType(TokenType.FUNCTION);
-      return _reader.advance();
-    }
-    _appendTokenOfType(TokenType.EQ);
-    return next;
-  }
-
-  int _tokenizeExclamation(int next) {
-    // ! !=
-    next = _reader.advance();
-    if (next == $equal) {
-      _appendTokenOfType(TokenType.BANG_EQ);
-      return _reader.advance();
-    }
-    _appendTokenOfType(TokenType.BANG);
-    return next;
-  }
-
-  int _tokenizeExponent(int next) {
-    if (next == $plus || next == $minus) {
-      next = _reader.advance();
-    }
-    bool hasDigits = false;
-    while (true) {
-      if ($0 <= next && next <= $9) {
-        hasDigits = true;
-      } else {
-        if (!hasDigits) {
-          _reportError(ScannerErrorCode.MISSING_DIGIT);
-        }
-        return next;
-      }
-      next = _reader.advance();
-    }
-  }
-
-  int _tokenizeFractionPart(int next, int start) {
-    bool done = false;
-    bool hasDigit = false;
-    LOOP:
-    while (!done) {
-      if ($0 <= next && next <= $9) {
-        hasDigit = true;
-      } else if ($e == next || $E == next) {
-        hasDigit = true;
-        next = _tokenizeExponent(_reader.advance());
-        done = true;
-        continue LOOP;
-      } else {
-        done = true;
-        continue LOOP;
-      }
-      next = _reader.advance();
-    }
-    if (!hasDigit) {
-      _appendStringToken(TokenType.INT, _reader.getString(start, -2));
-      if ($dot == next) {
-        return _selectWithOffset($dot, TokenType.PERIOD_PERIOD_PERIOD,
-            TokenType.PERIOD_PERIOD, _reader.offset - 1);
-      }
-      _appendTokenOfTypeWithOffset(TokenType.PERIOD, _reader.offset - 1);
-      return bigSwitch(next);
-    }
-    _appendStringToken(
-        TokenType.DOUBLE, _reader.getString(start, next < 0 ? 0 : -1));
-    return next;
-  }
-
-  int _tokenizeGreaterThan(int next) {
-    // > >= >> >>=
-    next = _reader.advance();
-    if ($equal == next) {
-      _appendTokenOfType(TokenType.GT_EQ);
-      return _reader.advance();
-    } else if ($gt == next) {
-      next = _reader.advance();
-      if ($equal == next) {
-        _appendTokenOfType(TokenType.GT_GT_EQ);
-        return _reader.advance();
-      } else {
-        _appendTokenOfType(TokenType.GT_GT);
-        return next;
-      }
-    } else {
-      _appendTokenOfType(TokenType.GT);
-      return next;
-    }
-  }
-
-  int _tokenizeHex(int next) {
-    int start = _reader.offset - 1;
-    bool hasDigits = false;
-    while (true) {
-      next = _reader.advance();
-      if (($0 <= next && next <= $9) ||
-          ($A <= next && next <= $F) ||
-          ($a <= next && next <= $f)) {
-        hasDigits = true;
-      } else {
-        if (!hasDigits) {
-          _reportError(ScannerErrorCode.MISSING_HEX_DIGIT);
-        }
-        _appendStringToken(
-            TokenType.HEXADECIMAL, _reader.getString(start, next < 0 ? 0 : -1));
-        return next;
-      }
-    }
-  }
-
-  int _tokenizeHexOrNumber(int next) {
-    int x = _reader.peek();
-    if (x == $x || x == $X) {
-      _reader.advance();
-      return _tokenizeHex(x);
-    }
-    return _tokenizeNumber(next);
-  }
-
-  int _tokenizeIdentifier(int next, int start, bool allowDollar) {
-    while (($a <= next && next <= $z) ||
-        ($A <= next && next <= $Z) ||
-        ($0 <= next && next <= $9) ||
-        next == $_ ||
-        (next == $$ && allowDollar)) {
-      next = _reader.advance();
-    }
-    _appendStringToken(
-        TokenType.IDENTIFIER, _reader.getString(start, next < 0 ? 0 : -1));
-    return next;
-  }
-
-  int _tokenizeInterpolatedExpression(int next, int start) {
-    _appendBeginToken(TokenType.STRING_INTERPOLATION_EXPRESSION);
-    next = _reader.advance();
-    while (next != -1) {
-      if (next == $rbrace) {
-        BeginToken begin =
-            _findTokenMatchingClosingBraceInInterpolationExpression();
-        if (begin == null) {
-          _beginToken();
-          _appendTokenOfType(TokenType.CLOSE_CURLY_BRACKET);
-          next = _reader.advance();
-          _beginToken();
-          return next;
-        } else if (begin.type == TokenType.OPEN_CURLY_BRACKET) {
-          _beginToken();
-          _appendEndToken(
-              TokenType.CLOSE_CURLY_BRACKET, TokenType.OPEN_CURLY_BRACKET);
-          next = _reader.advance();
-          _beginToken();
-        } else if (begin.type == TokenType.STRING_INTERPOLATION_EXPRESSION) {
-          _beginToken();
-          _appendEndToken(TokenType.CLOSE_CURLY_BRACKET,
-              TokenType.STRING_INTERPOLATION_EXPRESSION);
-          next = _reader.advance();
-          _beginToken();
-          return next;
-        }
-      } else {
-        next = bigSwitch(next);
-      }
-    }
-    return next;
-  }
-
-  int _tokenizeInterpolatedIdentifier(int next, int start) {
-    _appendStringTokenWithOffset(
-        TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 0);
-    if (($A <= next && next <= $Z) ||
-        ($a <= next && next <= $z) ||
-        next == $_) {
-      _beginToken();
-      next = _tokenizeKeywordOrIdentifier(next, false);
-    }
-    _beginToken();
-    return next;
-  }
-
-  int _tokenizeKeywordOrIdentifier(int next, bool allowDollar) {
-    KeywordState state = KeywordState.KEYWORD_STATE;
-    int start = _reader.offset;
-    while (state != null && $a <= next && next <= $z) {
-      state = state.next(next);
-      next = _reader.advance();
-    }
-    if (state == null || state.keyword() == null) {
-      return _tokenizeIdentifier(next, start, allowDollar);
-    }
-    if (($A <= next && next <= $Z) ||
-        ($0 <= next && next <= $9) ||
-        next == $_ ||
-        next == $$) {
-      return _tokenizeIdentifier(next, start, allowDollar);
-    } else if (next < 128) {
-      _appendKeywordToken(state.keyword());
-      return next;
-    } else {
-      return _tokenizeIdentifier(next, start, allowDollar);
-    }
-  }
-
-  int _tokenizeLessThan(int next) {
-    // < <= << <<=
-    next = _reader.advance();
-    if ($equal == next) {
-      _appendTokenOfType(TokenType.LT_EQ);
-      return _reader.advance();
-    } else if ($lt == next) {
-      return _select($equal, TokenType.LT_LT_EQ, TokenType.LT_LT);
-    } else {
-      _appendTokenOfType(TokenType.LT);
-      return next;
-    }
-  }
-
-  int _tokenizeMinus(int next) {
-    // - -- -=
-    next = _reader.advance();
-    if (next == $minus) {
-      _appendTokenOfType(TokenType.MINUS_MINUS);
-      return _reader.advance();
-    } else if (next == $equal) {
-      _appendTokenOfType(TokenType.MINUS_EQ);
-      return _reader.advance();
-    } else {
-      _appendTokenOfType(TokenType.MINUS);
-      return next;
-    }
-  }
-
-  int _tokenizeMultiLineComment(int next) {
-    int nesting = 1;
-    next = _reader.advance();
-    while (true) {
-      if (-1 == next) {
-        _reportError(ScannerErrorCode.UNTERMINATED_MULTI_LINE_COMMENT);
-        _appendCommentToken(
-            TokenType.MULTI_LINE_COMMENT, _reader.getString(_tokenStart, 0));
-        return next;
-      } else if ($asterisk == next) {
-        next = _reader.advance();
-        if ($slash == next) {
-          --nesting;
-          if (0 == nesting) {
-            _appendCommentToken(TokenType.MULTI_LINE_COMMENT,
-                _reader.getString(_tokenStart, 0));
-            return _reader.advance();
-          } else {
-            next = _reader.advance();
-          }
-        }
-      } else if ($slash == next) {
-        next = _reader.advance();
-        if ($asterisk == next) {
-          next = _reader.advance();
-          ++nesting;
-        }
-      } else if (next == $cr) {
-        next = _reader.advance();
-        if (next == $lf) {
-          next = _reader.advance();
-        }
-        recordStartOfLine();
-      } else if (next == $lf) {
-        next = _reader.advance();
-        recordStartOfLine();
-      } else {
-        next = _reader.advance();
-      }
-    }
-  }
-
-  int _tokenizeMultiLineRawString(int quoteChar, int start) {
-    int next = _reader.advance();
-    outer:
-    while (next != -1) {
-      while (next != quoteChar) {
-        if (next == -1) {
-          break outer;
-        } else if (next == $cr) {
-          next = _reader.advance();
-          if (next == $lf) {
-            next = _reader.advance();
-          }
-          recordStartOfLine();
-        } else if (next == $lf) {
-          next = _reader.advance();
-          recordStartOfLine();
-        } else {
-          next = _reader.advance();
-        }
-      }
-      next = _reader.advance();
-      if (next == quoteChar) {
-        next = _reader.advance();
-        if (next == quoteChar) {
-          _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
-          return _reader.advance();
-        }
-      }
-    }
-    _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL);
-    _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
-    return _reader.advance();
-  }
-
-  int _tokenizeMultiLineString(int quoteChar, int start, bool raw) {
-    if (raw) {
-      return _tokenizeMultiLineRawString(quoteChar, start);
-    }
-    int next = _reader.advance();
-    while (next != -1) {
-      if (next == $$) {
-        _appendStringToken(TokenType.STRING, _reader.getString(start, -1));
-        next = _tokenizeStringInterpolation(start);
-        _beginToken();
-        start = _reader.offset;
-        continue;
-      }
-      if (next == quoteChar) {
-        next = _reader.advance();
-        if (next == quoteChar) {
-          next = _reader.advance();
-          if (next == quoteChar) {
-            _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
-            return _reader.advance();
-          }
-        }
-        continue;
-      }
-      if (next == $backslash) {
-        next = _reader.advance();
-        if (next == -1) {
-          break;
-        }
-        if (next == $cr) {
-          next = _reader.advance();
-          if (next == $lf) {
-            next = _reader.advance();
-          }
-          recordStartOfLine();
-        } else if (next == $lf) {
-          recordStartOfLine();
-          next = _reader.advance();
-        } else {
-          next = _reader.advance();
-        }
-      } else if (next == $cr) {
-        next = _reader.advance();
-        if (next == $lf) {
-          next = _reader.advance();
-        }
-        recordStartOfLine();
-      } else if (next == $lf) {
-        recordStartOfLine();
-        next = _reader.advance();
-      } else {
-        next = _reader.advance();
-      }
-    }
-    _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL);
-    if (start == _reader.offset) {
-      _appendStringTokenWithOffset(TokenType.STRING, "", 1);
-    } else {
-      _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
-    }
-    return _reader.advance();
-  }
-
-  int _tokenizeMultiply(int next) =>
-      _select($equal, TokenType.STAR_EQ, TokenType.STAR);
-
-  int _tokenizeNumber(int next) {
-    int start = _reader.offset;
-    while (true) {
-      next = _reader.advance();
-      if ($0 <= next && next <= $9) {
-        continue;
-      } else if (next == $dot) {
-        return _tokenizeFractionPart(_reader.advance(), start);
-      } else if (next == $e || next == $E) {
-        return _tokenizeFractionPart(next, start);
-      } else {
-        _appendStringToken(
-            TokenType.INT, _reader.getString(start, next < 0 ? 0 : -1));
-        return next;
-      }
-    }
-  }
-
-  int _tokenizeOpenSquareBracket(int next) {
-    // [ []  []=
-    next = _reader.advance();
-    if (next == $close_bracket) {
-      return _select($equal, TokenType.INDEX_EQ, TokenType.INDEX);
-    } else {
-      _appendBeginToken(TokenType.OPEN_SQUARE_BRACKET);
-      return next;
-    }
-  }
-
-  int _tokenizePercent(int next) =>
-      _select($equal, TokenType.PERCENT_EQ, TokenType.PERCENT);
-
-  int _tokenizePlus(int next) {
-    // + ++ +=
-    next = _reader.advance();
-    if ($plus == next) {
-      _appendTokenOfType(TokenType.PLUS_PLUS);
-      return _reader.advance();
-    } else if ($equal == next) {
-      _appendTokenOfType(TokenType.PLUS_EQ);
-      return _reader.advance();
-    } else {
-      _appendTokenOfType(TokenType.PLUS);
-      return next;
-    }
-  }
-
-  int _tokenizeQuestion() {
-    // ? ?. ?? ??=
-    int next = _reader.advance();
-    if (next == $dot) {
-      // '.'
-      _appendTokenOfType(TokenType.QUESTION_PERIOD);
-      return _reader.advance();
-    } else if (next == $question) {
-      // '?'
-      next = _reader.advance();
-      if (next == $equal) {
-        // '='
-        _appendTokenOfType(TokenType.QUESTION_QUESTION_EQ);
-        return _reader.advance();
-      } else {
-        _appendTokenOfType(TokenType.QUESTION_QUESTION);
-        return next;
-      }
-    } else {
-      _appendTokenOfType(TokenType.QUESTION);
-      return next;
-    }
-  }
-
-  int _tokenizeSingleLineComment(int next) {
-    while (true) {
-      next = _reader.advance();
-      if (-1 == next) {
-        _appendCommentToken(
-            TokenType.SINGLE_LINE_COMMENT, _reader.getString(_tokenStart, 0));
-        return next;
-      } else if ($lf == next || $cr == next) {
-        _appendCommentToken(
-            TokenType.SINGLE_LINE_COMMENT, _reader.getString(_tokenStart, -1));
-        return next;
-      }
-    }
-  }
-
-  int _tokenizeSingleLineRawString(int next, int quoteChar, int start) {
-    next = _reader.advance();
-    while (next != -1) {
-      if (next == quoteChar) {
-        _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
-        return _reader.advance();
-      } else if (next == $cr || next == $lf) {
-        _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL);
-        _appendStringToken(TokenType.STRING, _reader.getString(start, -1));
-        return _reader.advance();
-      }
-      next = _reader.advance();
-    }
-    _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL);
-    _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
-    return _reader.advance();
-  }
-
-  int _tokenizeSingleLineString(int next, int quoteChar, int start) {
-    while (next != quoteChar) {
-      if (next == $backslash) {
-        next = _reader.advance();
-      } else if (next == $$) {
-        _appendStringToken(TokenType.STRING, _reader.getString(start, -1));
-        next = _tokenizeStringInterpolation(start);
-        _beginToken();
-        start = _reader.offset;
-        continue;
-      }
-      if (next <= $cr && (next == $lf || next == $cr || next == -1)) {
-        _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL);
-        if (start == _reader.offset) {
-          _appendStringTokenWithOffset(TokenType.STRING, "", 1);
-        } else if (next == -1) {
-          _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
-        } else {
-          _appendStringToken(TokenType.STRING, _reader.getString(start, -1));
-        }
-        return _reader.advance();
-      }
-      next = _reader.advance();
-    }
-    _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
-    return _reader.advance();
-  }
-
-  int _tokenizeSlashOrComment(int next) {
-    next = _reader.advance();
-    if ($asterisk == next) {
-      return _tokenizeMultiLineComment(next);
-    } else if ($slash == next) {
-      return _tokenizeSingleLineComment(next);
-    } else if ($equal == next) {
-      _appendTokenOfType(TokenType.SLASH_EQ);
-      return _reader.advance();
-    } else {
-      _appendTokenOfType(TokenType.SLASH);
-      return next;
-    }
-  }
-
-  int _tokenizeString(int next, int start, bool raw) {
-    int quoteChar = next;
-    next = _reader.advance();
-    if (quoteChar == next) {
-      next = _reader.advance();
-      if (quoteChar == next) {
-        // Multiline string.
-        return _tokenizeMultiLineString(quoteChar, start, raw);
-      } else {
-        // Empty string.
-        _appendStringToken(TokenType.STRING, _reader.getString(start, -1));
-        return next;
-      }
-    }
-    if (raw) {
-      return _tokenizeSingleLineRawString(next, quoteChar, start);
-    } else {
-      return _tokenizeSingleLineString(next, quoteChar, start);
-    }
-  }
-
-  int _tokenizeStringInterpolation(int start) {
-    _beginToken();
-    int next = _reader.advance();
-    if (next == $lbrace) {
-      return _tokenizeInterpolatedExpression(next, start);
-    } else {
-      return _tokenizeInterpolatedIdentifier(next, start);
-    }
-  }
-
-  int _tokenizeTag(int next) {
-    // # or #!.*[\n\r]
-    if (_reader.offset == 0) {
-      if (_reader.peek() == $exclamation) {
-        do {
-          next = _reader.advance();
-        } while (next != $lf && next != $cr && next > 0);
-        _appendStringToken(
-            TokenType.SCRIPT_TAG, _reader.getString(_tokenStart, 0));
-        return next;
-      }
-    }
-    _appendTokenOfType(TokenType.HASH);
-    return _reader.advance();
-  }
-
-  int _tokenizeTilde(int next) {
-    // ~ ~/ ~/=
-    next = _reader.advance();
-    if (next == $slash) {
-      return _select($equal, TokenType.TILDE_SLASH_EQ, TokenType.TILDE_SLASH);
-    } else {
-      _appendTokenOfType(TokenType.TILDE);
-      return next;
-    }
-  }
-
-  /**
-   * Checks if [value] is a single-line or multi-line comment.
-   */
-  static bool _isDocumentationComment(String value) {
-    return StringUtilities.startsWith3(value, 0, $slash, $slash, $slash) ||
-        StringUtilities.startsWith3(value, 0, $slash, $asterisk, $asterisk);
+  @override
+  void reportError(
+      ScannerErrorCode errorCode, int offset, List<Object> arguments) {
+    _errorListener
+        .onError(new AnalysisError(source, offset, 1, errorCode, arguments));
   }
 }
diff --git a/pkg/analyzer/lib/src/dart/sdk/patch.dart b/pkg/analyzer/lib/src/dart/sdk/patch.dart
new file mode 100644
index 0000000..88a122e
--- /dev/null
+++ b/pkg/analyzer/lib/src/dart/sdk/patch.dart
@@ -0,0 +1,371 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 analyzer.src.dart.sdk.patch;
+
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/ast/token.dart';
+import 'package:analyzer/error/listener.dart';
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/src/dart/scanner/reader.dart';
+import 'package:analyzer/src/dart/scanner/scanner.dart';
+import 'package:analyzer/src/dart/sdk/sdk.dart';
+import 'package:analyzer/src/generated/parser.dart';
+import 'package:analyzer/src/generated/sdk.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:meta/meta.dart';
+import 'package:path/src/context.dart';
+
+/**
+ * [SdkPatcher] applies patches to SDK [CompilationUnit].
+ */
+class SdkPatcher {
+  bool _allowNewPublicNames;
+  String _baseDesc;
+  String _patchDesc;
+  CompilationUnit _patchUnit;
+
+  /**
+   * Patch the given [unit] of a SDK [source] with the patches defined in
+   * the [sdk] for the given [platform].  Throw [ArgumentError] if a patch
+   * file cannot be read, or the contents violates rules for patch files.
+   */
+  void patch(
+      FolderBasedDartSdk sdk,
+      int platform,
+      AnalysisErrorListener errorListener,
+      Source source,
+      CompilationUnit unit) {
+    // Process URI.
+    String libraryUriStr;
+    bool isLibraryDefiningUnit;
+    {
+      Uri uri = source.uri;
+      if (uri.scheme != 'dart') {
+        throw new ArgumentError(
+            'The URI of the unit to patch must have the "dart" scheme: $uri');
+      }
+      List<String> uriSegments = uri.pathSegments;
+      String libraryName = uriSegments.first;
+      libraryUriStr = 'dart:$libraryName';
+      isLibraryDefiningUnit = uriSegments.length == 1;
+      _allowNewPublicNames = libraryName == '_internal';
+    }
+    // Prepare the patch files to apply.
+    List<String> patchPaths;
+    {
+      SdkLibrary sdkLibrary = sdk.getSdkLibrary(libraryUriStr);
+      if (sdkLibrary == null) {
+        throw new ArgumentError(
+            'The library $libraryUriStr is not defined in the SDK.');
+      }
+      patchPaths = sdkLibrary.getPatches(platform);
+    }
+
+    bool strongMode = sdk.analysisOptions.strongMode;
+    Context pathContext = sdk.resourceProvider.pathContext;
+    for (String path in patchPaths) {
+      String pathInLib = pathContext.joinAll(path.split('/'));
+      File patchFile = sdk.libraryDirectory.getChildAssumingFile(pathInLib);
+      if (!patchFile.exists) {
+        throw new ArgumentError(
+            'The patch file ${patchFile.path} for $source does not exist.');
+      }
+      Source patchSource = patchFile.createSource();
+      CompilationUnit patchUnit = parse(patchSource, strongMode, errorListener);
+
+      // Prepare for reporting errors.
+      _baseDesc = source.toString();
+      _patchDesc = patchFile.path;
+      _patchUnit = patchUnit;
+
+      if (isLibraryDefiningUnit) {
+        _patchDirectives(source, unit, patchSource, patchUnit);
+      }
+      _patchTopLevelDeclarations(unit, patchUnit, isLibraryDefiningUnit);
+    }
+  }
+
+  void _failExternalKeyword(String name, int offset) {
+    throw new ArgumentError(
+        'The keyword "external" was expected for "$name" in $_baseDesc @ $offset.');
+  }
+
+  void _failIfPublicName(AstNode node, String name) {
+    if (_allowNewPublicNames) {
+      return;
+    }
+    if (!Identifier.isPrivateName(name)) {
+      _failInPatch('contains a public declaration "$name"', node.offset);
+    }
+  }
+
+  void _failInPatch(String message, int offset) {
+    String loc = _getLocationDesc3(_patchUnit, offset);
+    throw new ArgumentError(
+        'The patch file $_patchDesc for $_baseDesc $message at $loc.');
+  }
+
+  String _getLocationDesc3(CompilationUnit unit, int offset) {
+    LineInfo_Location location = unit.lineInfo.getLocation(offset);
+    return 'the line ${location.lineNumber}';
+  }
+
+  void _patchClassMembers(
+      ClassDeclaration baseClass, ClassDeclaration patchClass) {
+    String className = baseClass.name.name;
+    List<ClassMember> membersToAppend = [];
+    for (ClassMember patchMember in patchClass.members) {
+      if (patchMember is FieldDeclaration) {
+        if (_hasPatchAnnotation(patchMember.metadata)) {
+          _failInPatch('attempts to patch a field', patchMember.offset);
+        }
+        List<VariableDeclaration> fields = patchMember.fields.variables;
+        if (fields.length != 1) {
+          _failInPatch('contains a field declaration with more than one field',
+              patchMember.offset);
+        }
+        String name = fields[0].name.name;
+        if (!_allowNewPublicNames &&
+            !Identifier.isPrivateName(className) &&
+            !Identifier.isPrivateName(name)) {
+          _failInPatch('contains a public field', patchMember.offset);
+        }
+        membersToAppend.add(patchMember);
+      } else if (patchMember is MethodDeclaration) {
+        String name = patchMember.name.name;
+        if (_hasPatchAnnotation(patchMember.metadata)) {
+          for (ClassMember baseMember in baseClass.members) {
+            if (baseMember is MethodDeclaration &&
+                baseMember.name.name == name) {
+              // Remove the "external" keyword.
+              Token externalKeyword = baseMember.externalKeyword;
+              if (externalKeyword != null) {
+                baseMember.externalKeyword = null;
+                _removeToken(externalKeyword);
+              } else {
+                _failExternalKeyword(name, baseMember.offset);
+              }
+              // Replace the body.
+              FunctionBody oldBody = baseMember.body;
+              FunctionBody newBody = patchMember.body;
+              _replaceNodeTokens(oldBody, newBody);
+              baseMember.body = newBody;
+            }
+          }
+        } else {
+          _failIfPublicName(patchMember, name);
+          membersToAppend.add(patchMember);
+        }
+      } else if (patchMember is ConstructorDeclaration) {
+        String name = patchMember.name?.name;
+        if (_hasPatchAnnotation(patchMember.metadata)) {
+          for (ClassMember baseMember in baseClass.members) {
+            if (baseMember is ConstructorDeclaration &&
+                baseMember.name?.name == name) {
+              // Remove the "external" keyword.
+              Token externalKeyword = baseMember.externalKeyword;
+              if (externalKeyword != null) {
+                baseMember.externalKeyword = null;
+                _removeToken(externalKeyword);
+              } else {
+                _failExternalKeyword(name, baseMember.offset);
+              }
+              // Factory vs. generative.
+              if (baseMember.factoryKeyword == null &&
+                  patchMember.factoryKeyword != null) {
+                _failInPatch(
+                    'attempts to replace generative constructor with a factory one',
+                    patchMember.offset);
+              } else if (baseMember.factoryKeyword != null &&
+                  patchMember.factoryKeyword == null) {
+                _failInPatch(
+                    'attempts to replace factory constructor with a generative one',
+                    patchMember.offset);
+              }
+              // The base constructor should not have initializers.
+              if (baseMember.initializers.isNotEmpty) {
+                throw new ArgumentError(
+                    'Cannot patch external constructors with initializers '
+                    'in $_baseDesc.');
+              }
+              // Prepare nodes.
+              FunctionBody baseBody = baseMember.body;
+              FunctionBody patchBody = patchMember.body;
+              NodeList<ConstructorInitializer> baseInitializers =
+                  baseMember.initializers;
+              NodeList<ConstructorInitializer> patchInitializers =
+                  patchMember.initializers;
+              // Replace initializers and link tokens.
+              if (patchInitializers.isNotEmpty) {
+                baseMember.parameters.endToken
+                    .setNext(patchInitializers.beginToken.previous);
+                baseInitializers.addAll(patchInitializers);
+                patchBody.endToken.setNext(baseBody.endToken.next);
+              } else {
+                _replaceNodeTokens(baseBody, patchBody);
+              }
+              // Replace the body.
+              baseMember.body = patchBody;
+            }
+          }
+        } else {
+          if (name == null) {
+            if (!_allowNewPublicNames && !Identifier.isPrivateName(className)) {
+              _failInPatch(
+                  'contains an unnamed public constructor', patchMember.offset);
+            }
+          } else {
+            _failIfPublicName(patchMember, name);
+          }
+          membersToAppend.add(patchMember);
+        }
+      } else {
+        String className = patchClass.name.name;
+        _failInPatch('contains an unsupported class member in $className',
+            patchMember.offset);
+      }
+    }
+    // Append new class members.
+    _appendToNodeList(
+        baseClass.members, membersToAppend, baseClass.leftBracket);
+  }
+
+  void _patchDirectives(Source baseSource, CompilationUnit baseUnit,
+      Source patchSource, CompilationUnit patchUnit) {
+    for (Directive patchDirective in patchUnit.directives) {
+      if (patchDirective is ImportDirective) {
+        baseUnit.directives.add(patchDirective);
+      } else {
+        _failInPatch('contains an unsupported "$patchDirective" directive',
+            patchDirective.offset);
+      }
+    }
+  }
+
+  void _patchTopLevelDeclarations(CompilationUnit baseUnit,
+      CompilationUnit patchUnit, bool appendNewTopLevelDeclarations) {
+    List<CompilationUnitMember> declarationsToAppend = [];
+    for (CompilationUnitMember patchDeclaration in patchUnit.declarations) {
+      if (patchDeclaration is FunctionDeclaration) {
+        String name = patchDeclaration.name.name;
+        if (_hasPatchAnnotation(patchDeclaration.metadata)) {
+          for (CompilationUnitMember baseDeclaration in baseUnit.declarations) {
+            if (patchDeclaration is FunctionDeclaration &&
+                baseDeclaration is FunctionDeclaration &&
+                baseDeclaration.name.name == name) {
+              // Remove the "external" keyword.
+              Token externalKeyword = baseDeclaration.externalKeyword;
+              if (externalKeyword != null) {
+                baseDeclaration.externalKeyword = null;
+                _removeToken(externalKeyword);
+              } else {
+                _failExternalKeyword(name, baseDeclaration.offset);
+              }
+              // Replace the body.
+              FunctionExpression oldExpr = baseDeclaration.functionExpression;
+              FunctionBody newBody = patchDeclaration.functionExpression.body;
+              _replaceNodeTokens(oldExpr.body, newBody);
+              oldExpr.body = newBody;
+            }
+          }
+        } else if (appendNewTopLevelDeclarations) {
+          _failIfPublicName(patchDeclaration, name);
+          declarationsToAppend.add(patchDeclaration);
+        }
+      } else if (patchDeclaration is FunctionTypeAlias) {
+        if (patchDeclaration.metadata.isNotEmpty) {
+          _failInPatch('contains a function type alias with an annotation',
+              patchDeclaration.offset);
+        }
+        _failIfPublicName(patchDeclaration, patchDeclaration.name.name);
+        declarationsToAppend.add(patchDeclaration);
+      } else if (patchDeclaration is ClassDeclaration) {
+        if (_hasPatchAnnotation(patchDeclaration.metadata)) {
+          String name = patchDeclaration.name.name;
+          for (CompilationUnitMember baseDeclaration in baseUnit.declarations) {
+            if (baseDeclaration is ClassDeclaration &&
+                baseDeclaration.name.name == name) {
+              _patchClassMembers(baseDeclaration, patchDeclaration);
+            }
+          }
+        } else {
+          _failIfPublicName(patchDeclaration, patchDeclaration.name.name);
+          declarationsToAppend.add(patchDeclaration);
+        }
+      } else {
+        _failInPatch('contains an unsupported top-level declaration',
+            patchDeclaration.offset);
+      }
+    }
+    // Append new top-level declarations.
+    if (appendNewTopLevelDeclarations) {
+      _appendToNodeList(baseUnit.declarations, declarationsToAppend,
+          baseUnit.endToken.previous);
+    }
+  }
+
+  /**
+   * Parse the given [source] into AST.
+   */
+  @visibleForTesting
+  static CompilationUnit parse(
+      Source source, bool strong, AnalysisErrorListener errorListener) {
+    String code = source.contents.data;
+
+    CharSequenceReader reader = new CharSequenceReader(code);
+    Scanner scanner = new Scanner(source, reader, errorListener);
+    scanner.scanGenericMethodComments = strong;
+    Token token = scanner.tokenize();
+    LineInfo lineInfo = new LineInfo(scanner.lineStarts);
+
+    Parser parser = new Parser(source, errorListener);
+    parser.parseGenericMethodComments = strong;
+    CompilationUnit unit = parser.parseCompilationUnit(token);
+    unit.lineInfo = lineInfo;
+    return unit;
+  }
+
+  /**
+   * Append [newNodes] to the given [nodes] and attach new tokens to the end
+   * token of the last [nodes] items, or, if it is empty, to [defaultPrevToken].
+   */
+  static void _appendToNodeList(
+      NodeList<AstNode> nodes, List<AstNode> newNodes, Token defaultPrevToken) {
+    Token prevToken = nodes.endToken ?? defaultPrevToken;
+    for (AstNode newNode in newNodes) {
+      newNode.endToken.setNext(prevToken.next);
+      prevToken.setNext(newNode.beginToken);
+      nodes.add(newNode);
+      prevToken = newNode.endToken;
+    }
+  }
+
+  /**
+   * Return `true` if [metadata] has the `@patch` annotation.
+   */
+  static bool _hasPatchAnnotation(List<Annotation> metadata) {
+    return metadata.any((annotation) {
+      Identifier name = annotation.name;
+      return annotation.constructorName == null &&
+          name is SimpleIdentifier &&
+          name.name == 'patch';
+    });
+  }
+
+  /**
+   * Remove the [token] from the stream.
+   */
+  static void _removeToken(Token token) {
+    token.previous.setNext(token.next);
+  }
+
+  /**
+   * Replace tokens of the [oldNode] with tokens of the [newNode].
+   */
+  static void _replaceNodeTokens(AstNode oldNode, AstNode newNode) {
+    oldNode.beginToken.previous.setNext(newNode.beginToken);
+    newNode.endToken.setNext(oldNode.endToken.next);
+  }
+}
diff --git a/pkg/analyzer/lib/src/dart/sdk/sdk.dart b/pkg/analyzer/lib/src/dart/sdk/sdk.dart
index 7ab8272..303e6a4 100644
--- a/pkg/analyzer/lib/src/dart/sdk/sdk.dart
+++ b/pkg/analyzer/lib/src/dart/sdk/sdk.dart
@@ -66,6 +66,11 @@
   PackageBundle _sdkBundle;
 
   /**
+   * Return the analysis options for this SDK analysis context.
+   */
+  AnalysisOptions get analysisOptions => _analysisOptions;
+
+  /**
    * Set the [options] for this SDK analysis context.  Throw [StateError] if the
    * context has been already created.
    */
@@ -680,6 +685,15 @@
       return null;
     }
     pathos.Context pathContext = resourceProvider.pathContext;
+    if (pathContext.style != pathos.context.style) {
+      // This will only happen when running tests.
+      if (exec.startsWith(new RegExp('[a-zA-Z]:'))) {
+        exec = exec.substring(2);
+      } else if (resourceProvider is MemoryResourceProvider) {
+        exec = resourceProvider.convertPath(exec);
+      }
+      exec = pathContext.fromUri(pathos.context.toUri(exec));
+    }
     // Might be "xcodebuild/ReleaseIA32/dart" with "sdk" sibling
     String outDir = pathContext.dirname(pathContext.dirname(exec));
     String sdkPath = pathContext.join(pathContext.dirname(outDir), "sdk");
diff --git a/pkg/analyzer/lib/src/error/codes.dart b/pkg/analyzer/lib/src/error/codes.dart
index 06d6ae3..c73de06 100644
--- a/pkg/analyzer/lib/src/error/codes.dart
+++ b/pkg/analyzer/lib/src/error/codes.dart
@@ -5,108 +5,12 @@
 library analyzer.src.error.codes;
 
 import 'package:analyzer/error/error.dart';
-import 'package:analyzer/src/dart/element/element.dart';
 
-/**
- * The error codes used for errors in analysis options files. The convention for
- * this class is for the name of the error code to indicate the problem that
- * caused the error to be generated and for the error message to explain what is
- * wrong and, when appropriate, how the problem can be corrected.
- */
-class AnalysisOptionsErrorCode extends ErrorCode {
-  /**
-   * An error code indicating that there is a syntactic error in the file.
-   *
-   * Parameters:
-   * 0: the error message from the parse error
-   */
-  static const AnalysisOptionsErrorCode PARSE_ERROR =
-      const AnalysisOptionsErrorCode('PARSE_ERROR', '{0}');
-
-  /**
-   * Initialize a newly created error code to have the given [name].
-   */
-  const AnalysisOptionsErrorCode(String name, String message,
-      [String correction])
-      : super(name, message, correction);
-
-  @override
-  ErrorSeverity get errorSeverity => ErrorSeverity.ERROR;
-
-  @override
-  ErrorType get type => ErrorType.COMPILE_TIME_ERROR;
-}
-
-/**
- * The error codes used for warnings in analysis options files. The convention
- * for this class is for the name of the error code to indicate the problem that
- * caused the error to be generated and for the error message to explain what is
- * wrong and, when appropriate, how the problem can be corrected.
- */
-class AnalysisOptionsWarningCode extends ErrorCode {
-  /**
-   * An error code indicating that a plugin is being configured with an
-   * unsupported option and legal options are provided.
-   *
-   * Parameters:
-   * 0: the plugin name
-   * 1: the unsupported option key
-   * 2: legal values
-   */
-  static const AnalysisOptionsWarningCode UNSUPPORTED_OPTION_WITH_LEGAL_VALUES =
-      const AnalysisOptionsWarningCode('UNSUPPORTED_OPTION_WITH_LEGAL_VALUES',
-          "The option '{1}' is not supported by {0}, supported values are {2}");
-
-  /**
-   * An error code indicating that a plugin is being configured with an
-   * unsupported option where there is just one legal value.
-   *
-   * Parameters:
-   * 0: the plugin name
-   * 1: the unsupported option key
-   * 2: the legal value
-   */
-  static const AnalysisOptionsWarningCode UNSUPPORTED_OPTION_WITH_LEGAL_VALUE =
-      const AnalysisOptionsWarningCode('UNSUPPORTED_OPTION_WITH_LEGAL_VALUE',
-          "The option '{1}' is not supported by {0}, did you mean {2}?");
-
-  /**
-   * An error code indicating that an option entry is being configured with an
-   * unsupported value.
-   *
-   * Parameters:
-   * 0: the option name
-   * 1: the unsupported value
-   * 2: legal values
-   */
-  static const AnalysisOptionsWarningCode UNSUPPORTED_VALUE =
-      const AnalysisOptionsWarningCode('UNSUPPORTED_VALUE',
-          "The value '{1}' is not supported by {0}, legal values are {2}");
-
-  /**
-   * An error code indicating that an unrecognized error code is being used to
-   * specify an error filter.
-   *
-   * Parameters:
-   * 0: the unrecognized error code
-   */
-  static const AnalysisOptionsWarningCode UNRECOGNIZED_ERROR_CODE =
-      const AnalysisOptionsWarningCode(
-          'UNRECOGNIZED_ERROR_CODE', "'{0}' is not a recognized error code");
-
-  /**
-   * Initialize a newly created warning code to have the given [name].
-   */
-  const AnalysisOptionsWarningCode(String name, String message,
-      [String correction])
-      : super(name, message, correction);
-
-  @override
-  ErrorSeverity get errorSeverity => ErrorSeverity.WARNING;
-
-  @override
-  ErrorType get type => ErrorType.STATIC_WARNING;
-}
+export 'package:analyzer/src/analysis_options/error/option_codes.dart';
+export 'package:analyzer/src/dart/error/hint_codes.dart';
+export 'package:analyzer/src/dart/error/lint_codes.dart';
+export 'package:analyzer/src/dart/error/todo_codes.dart';
+export 'package:analyzer/src/html/error/html_codes.dart';
 
 /**
  * The error codes used for compile time errors caused by constant evaluation
@@ -125,31 +29,33 @@
   // errors.
 
   /**
-   * 12.11.2 Const: It is a compile-time error if evaluation of a constant
+   * 16.12.2 Const: It is a compile-time error if evaluation of a constant
    * object results in an uncaught exception being thrown.
    */
   static const CheckedModeCompileTimeErrorCode
       CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH =
       const CheckedModeCompileTimeErrorCode(
           'CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH',
-          "The object type '{0}' cannot be assigned to the field '{1}', which has type '{2}'");
+          "A value of type '{0}' can't be assigned to the field '{1}', which "
+          "has type '{2}'.");
 
   /**
-   * 12.11.2 Const: It is a compile-time error if evaluation of a constant
+   * 16.12.2 Const: It is a compile-time error if evaluation of a constant
    * object results in an uncaught exception being thrown.
    */
   static const CheckedModeCompileTimeErrorCode
       CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH =
       const CheckedModeCompileTimeErrorCode(
           'CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH',
-          "The object type '{0}' cannot be assigned to a parameter of type '{1}'");
+          "A value of type '{0}' can't be assigned to a parameter of type "
+          "'{1}'.");
 
   /**
    * 7.6.1 Generative Constructors: In checked mode, it is a dynamic type error
    * if o is not <b>null</b> and the interface of the class of <i>o</i> is not a
    * subtype of the static type of the field <i>v</i>.
    *
-   * 12.11.2 Const: It is a compile-time error if evaluation of a constant
+   * 16.12.2 Const: It is a compile-time error if evaluation of a constant
    * object results in an uncaught exception being thrown.
    *
    * Parameters:
@@ -160,7 +66,8 @@
       CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE =
       const CheckedModeCompileTimeErrorCode(
           'CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE',
-          "The initializer type '{0}' cannot be assigned to the field type '{1}'");
+          "The initializer type '{0}' can't be assigned to the field type "
+          "'{1}'.");
 
   /**
    * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i>
@@ -178,7 +85,7 @@
   static const CheckedModeCompileTimeErrorCode
       LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = const CheckedModeCompileTimeErrorCode(
           'LIST_ELEMENT_TYPE_NOT_ASSIGNABLE',
-          "The element type '{0}' cannot be assigned to the list type '{1}'");
+          "The element type '{0}' can't be assigned to the list type '{1}'.");
 
   /**
    * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt;
@@ -197,7 +104,7 @@
    */
   static const CheckedModeCompileTimeErrorCode MAP_KEY_TYPE_NOT_ASSIGNABLE =
       const CheckedModeCompileTimeErrorCode('MAP_KEY_TYPE_NOT_ASSIGNABLE',
-          "The element type '{0}' cannot be assigned to the map key type '{1}'");
+          "The element type '{0}' can't be assigned to the map key type '{1}'.");
 
   /**
    * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt;
@@ -215,16 +122,20 @@
    * &lt;= j &lt;= m</i>.
    */
   static const CheckedModeCompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE =
-      const CheckedModeCompileTimeErrorCode('MAP_VALUE_TYPE_NOT_ASSIGNABLE',
-          "The element type '{0}' cannot be assigned to the map value type '{1}'");
+      const CheckedModeCompileTimeErrorCode(
+          'MAP_VALUE_TYPE_NOT_ASSIGNABLE',
+          "The element type '{0}' can't be assigned to the map value type "
+          "'{1}'.");
 
   /**
-   * 12.11.2 Const: It is a compile-time error if evaluation of a constant
+   * 16.12.2 Const: It is a compile-time error if evaluation of a constant
    * object results in an uncaught exception being thrown.
    */
   static const CheckedModeCompileTimeErrorCode VARIABLE_TYPE_MISMATCH =
-      const CheckedModeCompileTimeErrorCode('VARIABLE_TYPE_MISMATCH',
-          "The object type '{0}' cannot be assigned to a variable of type '{1}'");
+      const CheckedModeCompileTimeErrorCode(
+          'VARIABLE_TYPE_MISMATCH',
+          "A value of type '{0}' can't be assigned to a variable of type "
+          "'{1}'.");
 
   /**
    * Initialize a newly created error code to have the given [name]. The message
@@ -256,8 +167,10 @@
    * enum via 'new' or 'const' or to access its private fields.
    */
   static const CompileTimeErrorCode ACCESS_PRIVATE_ENUM_FIELD =
-      const CompileTimeErrorCode('ACCESS_PRIVATE_ENUM_FIELD',
-          "The private fields of an enum cannot be accessed, even within the same library");
+      const CompileTimeErrorCode(
+          'ACCESS_PRIVATE_ENUM_FIELD',
+          "The private fields of an enum can't be accessed, even within the "
+          "same library.");
 
   /**
    * 14.2 Exports: It is a compile-time error if a name <i>N</i> is re-exported
@@ -267,21 +180,24 @@
    *
    * Parameters:
    * 0: the name of the ambiguous element
-   * 1: the name of the first library that the type is found
-   * 2: the name of the second library that the type is found
+   * 1: the name of the first library in which the type is found
+   * 2: the name of the second library in which the type is found
    */
   static const CompileTimeErrorCode AMBIGUOUS_EXPORT =
-      const CompileTimeErrorCode('AMBIGUOUS_EXPORT',
-          "The name '{0}' is defined in the libraries '{1}' and '{2}'");
+      const CompileTimeErrorCode(
+          'AMBIGUOUS_EXPORT',
+          "The name '{0}' is defined in the libraries '{1}' and '{2}'.",
+          "Try removing the export of one of the libraries, or "
+          "explicitly hiding the name in one of the export directives.");
 
   /**
    * 15 Metadata: The constant expression given in an annotation is type checked
    * and evaluated in the scope surrounding the declaration being annotated.
    *
-   * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class
+   * 16.12.2 Const: It is a compile-time error if <i>T</i> is not a class
    * accessible in the current scope, optionally followed by type arguments.
    *
-   * 12.11.2 Const: If <i>e</i> is of the form <i>const T.id(a<sub>1</sub>,
+   * 16.12.2 Const: If <i>e</i> is of the form <i>const T.id(a<sub>1</sub>,
    * &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;
    * x<sub>n+k</sub>: a<sub>n+k</sub>)</i> it is a compile-time error if
    * <i>T</i> is not a class accessible in the current scope, optionally
@@ -292,7 +208,11 @@
    */
   static const CompileTimeErrorCode ANNOTATION_WITH_NON_CLASS =
       const CompileTimeErrorCode(
-          'ANNOTATION_WITH_NON_CLASS', "The name '{0}' is not a class");
+          'ANNOTATION_WITH_NON_CLASS',
+          "The name '{0}' isn't a class.",
+          "Try importing the library that declares the class, "
+          "correcting the name to match a defined class, or "
+          "defining a class with the given name.");
 
   /**
    * 12.33 Argument Definition Test: It is a compile time error if <i>v</i> does
@@ -304,151 +224,222 @@
    */
   static const CompileTimeErrorCode ARGUMENT_DEFINITION_TEST_NON_PARAMETER =
       const CompileTimeErrorCode(
-          'ARGUMENT_DEFINITION_TEST_NON_PARAMETER', "'{0}' is not a parameter");
+          'ARGUMENT_DEFINITION_TEST_NON_PARAMETER', "'{0}' isn't a parameter.");
 
   /**
-   * ?? Asynchronous For-in: It is a compile-time error if an asynchronous
+   * 17.6.3 Asynchronous For-in: It is a compile-time error if an asynchronous
    * for-in statement appears inside a synchronous function.
    */
   static const CompileTimeErrorCode ASYNC_FOR_IN_WRONG_CONTEXT =
-      const CompileTimeErrorCode('ASYNC_FOR_IN_WRONG_CONTEXT',
-          "The asynchronous for-in can only be used in a function marked with async or async*");
+      const CompileTimeErrorCode(
+          'ASYNC_FOR_IN_WRONG_CONTEXT',
+          "The asynchronous for-in can only be used in an asynchronous function.",
+          "Try marking the function body with either 'async' or 'async*', or "
+          "removing the 'await' before the for loop.");
 
   /**
-   * ??: It is a compile-time error if the function immediately enclosing a is
-   * not declared asynchronous.
+   * 16.30 Await Expressions: It is a compile-time error if the function
+   * immediately enclosing _a_ is not declared asynchronous. (Where _a_ is the
+   * await expression.)
    */
   static const CompileTimeErrorCode AWAIT_IN_WRONG_CONTEXT =
-      const CompileTimeErrorCode('AWAIT_IN_WRONG_CONTEXT',
-          "The await expression can only be used in a function marked as async or async*");
+      const CompileTimeErrorCode(
+          'AWAIT_IN_WRONG_CONTEXT',
+          "The await expression can only be used in an asynchronous function.",
+          "Try marking the function body with either 'async' or 'async*'.");
 
   /**
    * 12.30 Identifier Reference: It is a compile-time error to use a built-in
    * identifier other than dynamic as a type annotation.
+   *
+   * Parameters:
+   * 0: the built-in identifier that is being used
    */
   static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE =
-      const CompileTimeErrorCode('BUILT_IN_IDENTIFIER_AS_TYPE',
-          "The built-in identifier '{0}' cannot be used as a type");
+      const CompileTimeErrorCode(
+          'BUILT_IN_IDENTIFIER_AS_TYPE',
+          "The built-in identifier '{0}' can't be used as a type.",
+          "Try correcting the name to match an existing type.");
 
   /**
    * 12.30 Identifier Reference: It is a compile-time error if a built-in
    * identifier is used as the declared name of a class, type parameter or type
    * alias.
+   *
+   * Parameters:
+   * 0: the built-in identifier that is being used
    */
   static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_NAME =
-      const CompileTimeErrorCode('BUILT_IN_IDENTIFIER_AS_TYPE_NAME',
-          "The built-in identifier '{0}' cannot be used as a type name");
+      const CompileTimeErrorCode(
+          'BUILT_IN_IDENTIFIER_AS_TYPE_NAME',
+          "The built-in identifier '{0}' can't be used as a type name.",
+          "Try choosing a different name for the type.");
 
   /**
    * 12.30 Identifier Reference: It is a compile-time error if a built-in
    * identifier is used as the declared name of a class, type parameter or type
    * alias.
+   *
+   * Parameters:
+   * 0: the built-in identifier that is being used
    */
   static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME =
-      const CompileTimeErrorCode('BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME',
-          "The built-in identifier '{0}' cannot be used as a type alias name");
+      const CompileTimeErrorCode(
+          'BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME',
+          "The built-in identifier '{0}' can't be used as a typedef name.",
+          "Try choosing a different name for the typedef.");
 
   /**
    * 12.30 Identifier Reference: It is a compile-time error if a built-in
    * identifier is used as the declared name of a class, type parameter or type
    * alias.
+   *
+   * Parameters:
+   * 0: the built-in identifier that is being used
    */
   static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME =
-      const CompileTimeErrorCode('BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME',
-          "The built-in identifier '{0}' cannot be used as a type parameter name");
+      const CompileTimeErrorCode(
+          'BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME',
+          "The built-in identifier '{0}' can't be used as a type parameter name.",
+          "Try choosing a different name for the type parameter.");
 
   /**
    * 13.9 Switch: It is a compile-time error if the class <i>C</i> implements
    * the operator <i>==</i>.
+   *
+   * Parameters:
+   * 0: the this of the switch case expression
    */
   static const CompileTimeErrorCode CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS =
       const CompileTimeErrorCode('CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS',
-          "The switch case expression type '{0}' cannot override the == operator");
-
-  /**
-   * 12.1 Constants: It is a compile-time error if evaluation of a compile-time
-   * constant would raise
-   * an exception.
-   */
-  static const CompileTimeErrorCode COMPILE_TIME_CONSTANT_RAISES_EXCEPTION =
-      const CompileTimeErrorCode('COMPILE_TIME_CONSTANT_RAISES_EXCEPTION', "");
+          "The switch case expression type '{0}' can't override the == operator.");
 
   /**
    * 7.2 Getters: It is a compile-time error if a class has both a getter and a
    * method with the same name. This restriction holds regardless of whether the
    * getter is defined explicitly or implicitly, or whether the getter or the
    * method are inherited or not.
+   *
+   * Parameters:
+   * 0: the name of the class defining the conflicting method
+   * 1: the name of the class defining the getter with which the method conflicts
+   * 2: the name of the conflicting method
    */
   static const CompileTimeErrorCode CONFLICTING_GETTER_AND_METHOD =
-      const CompileTimeErrorCode('CONFLICTING_GETTER_AND_METHOD',
-          "Class '{0}' cannot have both getter '{1}.{2}' and method with the same name");
+      const CompileTimeErrorCode(
+          'CONFLICTING_GETTER_AND_METHOD',
+          "Class '{0}' can't have both getter '{1}.{2}' and method with the "
+          "same name.",
+          "Try converting the method to a getter, or "
+          "renaming the method to a name that doesn't conflit.");
 
   /**
    * 7.2 Getters: It is a compile-time error if a class has both a getter and a
    * method with the same name. This restriction holds regardless of whether the
    * getter is defined explicitly or implicitly, or whether the getter or the
    * method are inherited or not.
+   *
+   * Parameters:
+   * 0: the name of the class defining the conflicting getter
+   * 1: the name of the class defining the method with which the getter conflicts
+   * 2: the name of the conflicting getter
    */
   static const CompileTimeErrorCode CONFLICTING_METHOD_AND_GETTER =
-      const CompileTimeErrorCode('CONFLICTING_METHOD_AND_GETTER',
-          "Class '{0}' cannot have both method '{1}.{2}' and getter with the same name");
+      const CompileTimeErrorCode(
+          'CONFLICTING_METHOD_AND_GETTER',
+          "Class '{0}' can't have both method '{1}.{2}' and getter with the "
+          "same name.",
+          "Try converting the getter to a method, or "
+          "renaming the getter to a name that doesn't conflit.");
 
   /**
    * 7.6 Constructors: A constructor name always begins with the name of its
    * immediately enclosing class, and may optionally be followed by a dot and an
    * identifier <i>id</i>. It is a compile-time error if <i>id</i> is the name
    * of a member declared in the immediately enclosing class.
+   *
+   * Parameters:
+   * 0: the name of the constructor
    */
   static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD =
-      const CompileTimeErrorCode('CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD',
-          "'{0}' cannot be used to name a constructor and a field in this class");
+      const CompileTimeErrorCode(
+          'CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD',
+          "'{0}' can't be used to name both a constructor and a field in this "
+          "class.",
+          "Try renaming either the constructor or the field.");
 
   /**
    * 7.6 Constructors: A constructor name always begins with the name of its
    * immediately enclosing class, and may optionally be followed by a dot and an
    * identifier <i>id</i>. It is a compile-time error if <i>id</i> is the name
    * of a member declared in the immediately enclosing class.
+   *
+   * Parameters:
+   * 0: the name of the constructor
    */
   static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD =
-      const CompileTimeErrorCode('CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD',
-          "'{0}' cannot be used to name a constructor and a method in this class");
+      const CompileTimeErrorCode(
+          'CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD',
+          "'{0}' can't be used to name both a constructor and a method in this "
+          "class.",
+          "Try renaming either the constructor or the field.");
 
   /**
    * 7. Classes: It is a compile time error if a generic class declares a type
    * variable with the same name as the class or any of its members or
    * constructors.
+   *
+   * Parameters:
+   * 0: the name of the type variable
    */
   static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_CLASS =
-      const CompileTimeErrorCode('CONFLICTING_TYPE_VARIABLE_AND_CLASS',
-          "'{0}' cannot be used to name a type variable in a class with the same name");
+      const CompileTimeErrorCode(
+          'CONFLICTING_TYPE_VARIABLE_AND_CLASS',
+          "'{0}' can't be used to name both a type variable and the class in "
+          "which the type variable is defined.",
+          "Try renaming either the type variable or the class.");
 
   /**
    * 7. Classes: It is a compile time error if a generic class declares a type
    * variable with the same name as the class or any of its members or
    * constructors.
+   *
+   * Parameters:
+   * 0: the name of the type variable
    */
   static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_MEMBER =
-      const CompileTimeErrorCode('CONFLICTING_TYPE_VARIABLE_AND_MEMBER',
-          "'{0}' cannot be used to name a type variable and member in this class");
+      const CompileTimeErrorCode(
+          'CONFLICTING_TYPE_VARIABLE_AND_MEMBER',
+          "'{0}' can't be used to name both a type variable and a member in "
+          "this class.",
+          "Try renaming either the type variable or the member.");
 
   /**
-   * 12.11.2 Const: It is a compile-time error if evaluation of a constant
+   * 16.12.2 Const: It is a compile-time error if evaluation of a constant
    * object results in an uncaught exception being thrown.
    */
   static const CompileTimeErrorCode CONST_CONSTRUCTOR_THROWS_EXCEPTION =
-      const CompileTimeErrorCode('CONST_CONSTRUCTOR_THROWS_EXCEPTION',
-          "'const' constructors cannot throw exceptions");
+      const CompileTimeErrorCode(
+          'CONST_CONSTRUCTOR_THROWS_EXCEPTION',
+          "Const constructors can't throw exceptions.",
+          "Try removing the throw statement, or removing the keyword 'const'.");
 
   /**
    * 10.6.3 Constant Constructors: It is a compile-time error if a constant
    * constructor is declared by a class C if any instance variable declared in C
    * is initialized with an expression that is not a constant expression.
+   *
+   * Parameters:
+   * 0: the name of the field
    */
   static const CompileTimeErrorCode
       CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST =
       const CompileTimeErrorCode(
           'CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST',
-          "Can't define the 'const' constructor because the field '{0}' is initialized with a non-constant value");
+          "Can't define the const constructor because the field '{0}' "
+          "is initialized with a non-constant value.",
+          "Try initializing the field to a constant value, or "
+          "removing the keyword 'const' from the constructor.");
 
   /**
    * 7.6.3 Constant Constructors: The superinitializer that appears, explicitly
@@ -460,18 +451,28 @@
    * constructor named ... is declared.
    */
   static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_MIXIN =
-      const CompileTimeErrorCode('CONST_CONSTRUCTOR_WITH_MIXIN',
-          "Constant constructor cannot be declared for a class with a mixin");
+      const CompileTimeErrorCode(
+          'CONST_CONSTRUCTOR_WITH_MIXIN',
+          "Const constructor can't be declared for a class with a mixin.",
+          "Try removing the 'const' keyword, or "
+          "removing the 'with' clause from the class declaration.");
 
   /**
    * 7.6.3 Constant Constructors: The superinitializer that appears, explicitly
    * or implicitly, in the initializer list of a constant constructor must
    * specify a constant constructor of the superclass of the immediately
    * enclosing class or a compile-time error occurs.
+   *
+   * Parameters:
+   * 0: the name of the superclass
    */
   static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER =
-      const CompileTimeErrorCode('CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER',
-          "Constant constructor cannot call non-constant super constructor of '{0}'");
+      const CompileTimeErrorCode(
+          'CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER',
+          "Constant constructor can't call non-constant super constructor of "
+          "'{0}'.",
+          "Try calling a const constructor in the superclass, or "
+          "removing the keyword 'const' from the constructor.");
 
   /**
    * 7.6.3 Constant Constructors: It is a compile-time error if a constant
@@ -480,31 +481,39 @@
    * The above refers to both locally declared and inherited instance variables.
    */
   static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD =
-      const CompileTimeErrorCode('CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD',
-          "Cannot define the 'const' constructor for a class with non-final fields");
+      const CompileTimeErrorCode(
+          'CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD',
+          "Can't define a const constructor for a class with non-final fields.",
+          "Try making all of the fields final, or "
+          "removing the keyword 'const' from the constructor.");
 
   /**
    * 12.12.2 Const: It is a compile-time error if <i>T</i> is a deferred type.
    */
   static const CompileTimeErrorCode CONST_DEFERRED_CLASS =
-      const CompileTimeErrorCode('CONST_DEFERRED_CLASS',
-          "Deferred classes cannot be created with 'const'");
+      const CompileTimeErrorCode(
+          'CONST_DEFERRED_CLASS',
+          "Deferred classes can't be created with 'const'.",
+          "Try using 'new' to create the instance, or "
+          "changing the import to not be deferred.");
 
   /**
    * 6.2 Formal Parameters: It is a compile-time error if a formal parameter is
    * declared as a constant variable.
    */
   static const CompileTimeErrorCode CONST_FORMAL_PARAMETER =
-      const CompileTimeErrorCode(
-          'CONST_FORMAL_PARAMETER', "Parameters cannot be 'const'");
+      const CompileTimeErrorCode('CONST_FORMAL_PARAMETER',
+          "Parameters can't be const.", "Try removing the 'const' keyword.");
 
   /**
    * 5 Variables: A constant variable must be initialized to a compile-time
    * constant or a compile-time error occurs.
    */
   static const CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE =
-      const CompileTimeErrorCode('CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE',
-          "'const' variables must be constant value");
+      const CompileTimeErrorCode(
+          'CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE',
+          "Const variables must be initialized with a constant value.",
+          "Try changing the initializer to be a constant expression.");
 
   /**
    * 5 Variables: A constant variable must be initialized to a compile-time
@@ -517,26 +526,38 @@
       CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY =
       const CompileTimeErrorCode(
           'CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY',
-          "Constant values from a deferred library cannot be used to initialized a 'const' variable");
+          "Constant values from a deferred library can't be used to "
+          "initialized a const variable.",
+          "Try initializing the variable without referencing members of the "
+          "deferred library, or "
+          "changing the import to not be deferred.");
 
   /**
    * 7.5 Instance Variables: It is a compile-time error if an instance variable
    * is declared to be constant.
    */
   static const CompileTimeErrorCode CONST_INSTANCE_FIELD =
-      const CompileTimeErrorCode('CONST_INSTANCE_FIELD',
-          "Only static fields can be declared as 'const'");
+      const CompileTimeErrorCode(
+          'CONST_INSTANCE_FIELD',
+          "Only static fields can be declared as const.",
+          "Try declaring the field as final, or adding the keyword 'static'.");
 
   /**
    * 12.8 Maps: It is a compile-time error if the key of an entry in a constant
    * map literal is an instance of a class that implements the operator
    * <i>==</i> unless the key is a string or integer.
+   *
+   * Parameters:
+   * 0: the type of the entry's key
    */
   static const CompileTimeErrorCode
       CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS =
       const CompileTimeErrorCode(
           'CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS',
-          "The constant map entry key expression type '{0}' cannot override the == operator");
+          "The constant map entry key expression type '{0}' can't override "
+          "the == operator.",
+          "Try using a different value for the key, or "
+          "removing the keyword 'const' from the map.");
 
   /**
    * 5 Variables: A constant variable must be initialized to a compile-time
@@ -546,64 +567,76 @@
    * 0: the name of the uninitialized final variable
    */
   static const CompileTimeErrorCode CONST_NOT_INITIALIZED =
-      const CompileTimeErrorCode('CONST_NOT_INITIALIZED',
-          "The const variable '{0}' must be initialized");
+      const CompileTimeErrorCode(
+          'CONST_NOT_INITIALIZED',
+          "The const variable '{0}' must be initialized.",
+          "Try adding an initialization to the declaration.");
 
   /**
-   * 12.11.2 Const: An expression of one of the forms !e, e1 && e2 or e1 || e2,
+   * 16.12.2 Const: An expression of one of the forms !e, e1 && e2 or e1 || e2,
    * where e, e1 and e2 are constant expressions that evaluate to a boolean
    * value.
    */
   static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL =
-      const CompileTimeErrorCode('CONST_EVAL_TYPE_BOOL',
-          "In constant expressions, operand(s) of this operator must be of type 'bool'");
+      const CompileTimeErrorCode(
+          'CONST_EVAL_TYPE_BOOL',
+          "In constant expressions, operands of this operator must be of type "
+          "'bool'.");
 
   /**
-   * 12.11.2 Const: An expression of one of the forms e1 == e2 or e1 != e2 where
+   * 16.12.2 Const: An expression of one of the forms e1 == e2 or e1 != e2 where
    * e1 and e2 are constant expressions that evaluate to a numeric, string or
    * boolean value or to null.
    */
   static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL_NUM_STRING =
-      const CompileTimeErrorCode('CONST_EVAL_TYPE_BOOL_NUM_STRING',
-          "In constant expressions, operands of this operator must be of type 'bool', 'num', 'String' or 'null'");
+      const CompileTimeErrorCode(
+          'CONST_EVAL_TYPE_BOOL_NUM_STRING',
+          "In constant expressions, operands of this operator must be of type "
+          "'bool', 'num', 'String' or 'null'.");
 
   /**
-   * 12.11.2 Const: An expression of one of the forms ~e, e1 ^ e2, e1 & e2,
+   * 16.12.2 Const: An expression of one of the forms ~e, e1 ^ e2, e1 & e2,
    * e1 | e2, e1 >> e2 or e1 << e2, where e, e1 and e2 are constant expressions
    * that evaluate to an integer value or to null.
    */
   static const CompileTimeErrorCode CONST_EVAL_TYPE_INT =
-      const CompileTimeErrorCode('CONST_EVAL_TYPE_INT',
-          "In constant expressions, operand(s) of this operator must be of type 'int'");
+      const CompileTimeErrorCode(
+          'CONST_EVAL_TYPE_INT',
+          "In constant expressions, operands of this operator must be of type "
+          "'int'.");
 
   /**
-   * 12.11.2 Const: An expression of one of the forms e, e1 + e2, e1 - e2, e1 *
+   * 16.12.2 Const: An expression of one of the forms e, e1 + e2, e1 - e2, e1 *
    * e2, e1 / e2, e1 ~/ e2, e1 > e2, e1 < e2, e1 >= e2, e1 <= e2 or e1 % e2,
    * where e, e1 and e2 are constant expressions that evaluate to a numeric
    * value or to null.
    */
   static const CompileTimeErrorCode CONST_EVAL_TYPE_NUM =
-      const CompileTimeErrorCode('CONST_EVAL_TYPE_NUM',
-          "In constant expressions, operand(s) of this operator must be of type 'num'");
+      const CompileTimeErrorCode(
+          'CONST_EVAL_TYPE_NUM',
+          "In constant expressions, operands of this operator must be of type "
+          "'num'.");
 
   /**
-   * 12.11.2 Const: It is a compile-time error if evaluation of a constant
+   * 16.12.2 Const: It is a compile-time error if evaluation of a constant
    * object results in an uncaught exception being thrown.
    */
   static const CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION =
       const CompileTimeErrorCode('CONST_EVAL_THROWS_EXCEPTION',
-          "Evaluation of this constant expression causes exception");
+          "Evaluation of this constant expression throws an exception.");
 
   /**
-   * 12.11.2 Const: It is a compile-time error if evaluation of a constant
+   * 16.12.2 Const: It is a compile-time error if evaluation of a constant
    * object results in an uncaught exception being thrown.
    */
   static const CompileTimeErrorCode CONST_EVAL_THROWS_IDBZE =
-      const CompileTimeErrorCode('CONST_EVAL_THROWS_IDBZE',
-          "Evaluation of this constant expression throws IntegerDivisionByZeroException");
+      const CompileTimeErrorCode(
+          'CONST_EVAL_THROWS_IDBZE',
+          "Evaluation of this constant expression throws an "
+          "IntegerDivisionByZeroException.");
 
   /**
-   * 12.11.2 Const: If <i>T</i> is a parameterized type <i>S&lt;U<sub>1</sub>,
+   * 16.12.2 Const: If <i>T</i> is a parameterized type <i>S&lt;U<sub>1</sub>,
    * &hellip;, U<sub>m</sub>&gt;</i>, let <i>R = S</i>; It is a compile time
    * error if <i>S</i> is not a generic type with <i>m</i> type parameters.
    *
@@ -616,34 +649,43 @@
    * [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS].
    */
   static const CompileTimeErrorCode CONST_WITH_INVALID_TYPE_PARAMETERS =
-      const CompileTimeErrorCode('CONST_WITH_INVALID_TYPE_PARAMETERS',
-          "The type '{0}' is declared with {1} type parameters, but {2} type arguments were given");
+      const CompileTimeErrorCode(
+          'CONST_WITH_INVALID_TYPE_PARAMETERS',
+          "The type '{0}' is declared with {1} type parameters, but {2} type "
+          "arguments were given.",
+          "Try adjusting the number of type arguments to match the number of "
+          "type parameters.");
 
   /**
-   * 12.11.2 Const: If <i>e</i> is of the form <i>const T(a<sub>1</sub>,
+   * 16.12.2 Const: If <i>e</i> is of the form <i>const T(a<sub>1</sub>,
    * &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;,
    * x<sub>n+k</sub>: a<sub>n+k</sub>)</i> it is a compile-time error if the
    * type <i>T</i> does not declare a constant constructor with the same name as
    * the declaration of <i>T</i>.
    */
   static const CompileTimeErrorCode CONST_WITH_NON_CONST =
-      const CompileTimeErrorCode('CONST_WITH_NON_CONST',
-          "The constructor being called is not a 'const' constructor");
+      const CompileTimeErrorCode(
+          'CONST_WITH_NON_CONST',
+          "The constructor being called isn't a const constructor.",
+          "Try using 'new' to call the constructor.");
 
   /**
-   * 12.11.2 Const: In all of the above cases, it is a compile-time error if
+   * 16.12.2 Const: In all of the above cases, it is a compile-time error if
    * <i>a<sub>i</sub>, 1 &lt;= i &lt;= n + k</i>, is not a compile-time constant
    * expression.
    */
   static const CompileTimeErrorCode CONST_WITH_NON_CONSTANT_ARGUMENT =
-      const CompileTimeErrorCode('CONST_WITH_NON_CONSTANT_ARGUMENT',
-          "Arguments of a constant creation must be constant expressions");
+      const CompileTimeErrorCode(
+          'CONST_WITH_NON_CONSTANT_ARGUMENT',
+          "Arguments of a constant creation must be constant expressions.",
+          "Try making the argument a valid constant, or "
+          "use 'new' to call the constructor.");
 
   /**
-   * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class
+   * 16.12.2 Const: It is a compile-time error if <i>T</i> is not a class
    * accessible in the current scope, optionally followed by type arguments.
    *
-   * 12.11.2 Const: If <i>e</i> is of the form <i>const T.id(a<sub>1</sub>,
+   * 16.12.2 Const: If <i>e</i> is of the form <i>const T.id(a<sub>1</sub>,
    * &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;
    * x<sub>n+k</sub>: a<sub>n+k</sub>)</i> it is a compile-time error if
    * <i>T</i> is not a class accessible in the current scope, optionally
@@ -654,18 +696,22 @@
    */
   static const CompileTimeErrorCode CONST_WITH_NON_TYPE =
       const CompileTimeErrorCode(
-          'CONST_WITH_NON_TYPE', "The name '{0}' is not a class");
+          'CONST_WITH_NON_TYPE',
+          "The name '{0}' isn't a class.",
+          "Try correcting the name to match an existing class.");
 
   /**
-   * 12.11.2 Const: It is a compile-time error if <i>T</i> includes any type
-   * parameters.
+   * 16.12.2 Const: If <i>T</i> is a parameterized type, it is a compile-time
+   * error if <i>T</i> includes a type variable among its type arguments.
    */
   static const CompileTimeErrorCode CONST_WITH_TYPE_PARAMETERS =
-      const CompileTimeErrorCode('CONST_WITH_TYPE_PARAMETERS',
-          "The constant creation cannot use a type parameter");
+      const CompileTimeErrorCode(
+          'CONST_WITH_TYPE_PARAMETERS',
+          "A constant creation can't use a type parameter as a type argument.",
+          "Try replacing the type parameter with a different type.");
 
   /**
-   * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of
+   * 16.12.2 Const: It is a compile-time error if <i>T.id</i> is not the name of
    * a constant constructor declared by the type <i>T</i>.
    *
    * Parameters:
@@ -673,27 +719,33 @@
    * 1: the name of the requested constant constructor
    */
   static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR =
-      const CompileTimeErrorCode('CONST_WITH_UNDEFINED_CONSTRUCTOR',
-          "The class '{0}' does not have a constant constructor '{1}'");
+      const CompileTimeErrorCode(
+          'CONST_WITH_UNDEFINED_CONSTRUCTOR',
+          "The class '{0}' doesn't have a constant constructor '{1}'.",
+          "Try calling a different contructor.");
 
   /**
-   * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of
+   * 16.12.2 Const: It is a compile-time error if <i>T.id</i> is not the name of
    * a constant constructor declared by the type <i>T</i>.
    *
    * Parameters:
    * 0: the name of the type
    */
   static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT =
-      const CompileTimeErrorCode('CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT',
-          "The class '{0}' does not have a default constant constructor");
+      const CompileTimeErrorCode(
+          'CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT',
+          "The class '{0}' doesn't have a default constant constructor.",
+          "Try calling a different contructor.");
 
   /**
    * 15.3.1 Typedef: It is a compile-time error if any default values are
    * specified in the signature of a function type alias.
    */
   static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS =
-      const CompileTimeErrorCode('DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS',
-          "Default values aren't allowed in typedefs");
+      const CompileTimeErrorCode(
+          'DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS',
+          "Default parameter values aren't allowed in typedefs.",
+          "Try removing the default value.");
 
   /**
    * 6.2.1 Required Formals: By means of a function signature that names the
@@ -702,8 +754,10 @@
    * function type.
    */
   static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER =
-      const CompileTimeErrorCode('DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER',
-          "Default values aren't allowed in function type parameters");
+      const CompileTimeErrorCode(
+          'DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER',
+          "Default values aren't allowed in function typed parameters.",
+          "Try removing the default value.");
 
   /**
    * 7.6.2 Factories: It is a compile-time error if <i>k</i> explicitly
@@ -713,15 +767,19 @@
       DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR =
       const CompileTimeErrorCode(
           'DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR',
-          "Default values aren't allowed in factory constructors that redirect to another constructor");
+          "Default values aren't allowed in factory constructors that redirect "
+          "to another constructor.",
+          "Try removing the default value.");
 
   /**
    * 3.1 Scoping: It is a compile-time error if there is more than one entity
    * with the same name declared in the same scope.
    */
   static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_DEFAULT =
-      const CompileTimeErrorCode('DUPLICATE_CONSTRUCTOR_DEFAULT',
-          "The default constructor is already defined");
+      const CompileTimeErrorCode(
+          'DUPLICATE_CONSTRUCTOR_DEFAULT',
+          "The default constructor is already defined.",
+          "Try giving one of the constructors a name.");
 
   /**
    * 3.1 Scoping: It is a compile-time error if there is more than one entity
@@ -731,8 +789,10 @@
    * 0: the name of the duplicate entity
    */
   static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_NAME =
-      const CompileTimeErrorCode('DUPLICATE_CONSTRUCTOR_NAME',
-          "The constructor with name '{0}' is already defined");
+      const CompileTimeErrorCode(
+          'DUPLICATE_CONSTRUCTOR_NAME',
+          "The constructor with name '{0}' is already defined.",
+          "Try renaming one of the constructors.");
 
   /**
    * 3.1 Scoping: It is a compile-time error if there is more than one entity
@@ -749,7 +809,21 @@
    */
   static const CompileTimeErrorCode DUPLICATE_DEFINITION =
       const CompileTimeErrorCode(
-          'DUPLICATE_DEFINITION', "The name '{0}' is already defined");
+          'DUPLICATE_DEFINITION',
+          "The name '{0}' is already defined.",
+          "Try renaming one of the declarations.");
+
+  /**
+   * 18.3 Parts: It's a compile-time error if the same library contains two part
+   * directives with the same URI.
+   *
+   * Parameters:
+   * 0: the URI of the duplicate part
+   */
+  static const CompileTimeErrorCode DUPLICATE_PART = const CompileTimeErrorCode(
+      'DUPLICATE_PART',
+      "The library already contains a part with the uri '{0}'.",
+      "Try removing all but one of the duplicated part directives.");
 
   /**
    * 7. Classes: It is a compile-time error if a class has an instance member
@@ -760,22 +834,30 @@
    *
    * Parameters:
    * 0: the name of the class that has conflicting instance/static members
-   * 1: the name of the conflicting members
+   * 1: the name of the conflicting member
    *
    * See [DUPLICATE_DEFINITION].
    */
   static const CompileTimeErrorCode DUPLICATE_DEFINITION_INHERITANCE =
-      const CompileTimeErrorCode('DUPLICATE_DEFINITION_INHERITANCE',
-          "The name '{0}' is already defined in '{1}'");
+      const CompileTimeErrorCode(
+          'DUPLICATE_DEFINITION_INHERITANCE',
+          "The name '{0}' is already defined in '{1}'.",
+          "Try renaming one of the declarations.");
 
   /**
    * 12.14.2 Binding Actuals to Formals: It is a compile-time error if
    * <i>q<sub>i</sub> = q<sub>j</sub></i> for any <i>i != j</i> [where
    * <i>q<sub>i</sub></i> is the label for a named argument].
+   *
+   * Parameters:
+   * 0: the name of the parameter that was duplicated
    */
   static const CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT =
-      const CompileTimeErrorCode('DUPLICATE_NAMED_ARGUMENT',
-          "The argument for the named parameter '{0}' was already specified");
+      const CompileTimeErrorCode(
+          'DUPLICATE_NAMED_ARGUMENT',
+          "The argument for the named parameter '{0}' was already specified.",
+          "Try removing one of the named arguments, or "
+          "correcting one of the names to reference a different named parameter.");
 
   /**
    * SDK implementation libraries can be exported only by other SDK libraries.
@@ -785,7 +867,7 @@
    */
   static const CompileTimeErrorCode EXPORT_INTERNAL_LIBRARY =
       const CompileTimeErrorCode('EXPORT_INTERNAL_LIBRARY',
-          "The library '{0}' is internal and cannot be exported");
+          "The library '{0}' is internal and can't be exported.");
 
   /**
    * 14.2 Exports: It is a compile-time error if the compilation unit found at
@@ -795,15 +877,19 @@
    * 0: the uri pointing to a non-library declaration
    */
   static const CompileTimeErrorCode EXPORT_OF_NON_LIBRARY =
-      const CompileTimeErrorCode('EXPORT_OF_NON_LIBRARY',
-          "The exported library '{0}' must not have a part-of directive");
+      const CompileTimeErrorCode(
+          'EXPORT_OF_NON_LIBRARY',
+          "The exported library '{0}' can't have a part-of directive.",
+          "Try exporting the library that the part is a part of.");
 
   /**
    * Enum proposal: It is a compile-time error to subclass, mix-in or implement
    * an enum.
    */
   static const CompileTimeErrorCode EXTENDS_ENUM = const CompileTimeErrorCode(
-      'EXTENDS_ENUM', "Classes cannot extend an enum");
+      'EXTENDS_ENUM',
+      "Classes can't extend an enum.",
+      "Try specifying a different superclass, or removing the extends clause.");
 
   /**
    * 7.9 Superclasses: It is a compile-time error if the extends clause of a
@@ -813,9 +899,10 @@
    * Parameters:
    * 0: the name of the superclass that was not found
    */
-  static const CompileTimeErrorCode EXTENDS_NON_CLASS =
-      const CompileTimeErrorCode(
-          'EXTENDS_NON_CLASS', "Classes can only extend other classes");
+  static const CompileTimeErrorCode EXTENDS_NON_CLASS = const CompileTimeErrorCode(
+      'EXTENDS_NON_CLASS',
+      "Classes can only extend other classes.",
+      "Try specifying a different superclass, or removing the extends clause.");
 
   /**
    * 12.2 Null: It is a compile-time error for a class to attempt to extend or
@@ -844,7 +931,10 @@
    */
   static const CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS =
       const CompileTimeErrorCode(
-          'EXTENDS_DISALLOWED_CLASS', "Classes cannot extend '{0}'");
+          'EXTENDS_DISALLOWED_CLASS',
+          "Classes can't extend '{0}'.",
+          "Try specifying a different superclass, or "
+          "removing the extends clause.");
 
   /**
    * 7.9 Superclasses: It is a compile-time error if the extends clause of a
@@ -856,8 +946,11 @@
    * See [IMPLEMENTS_DEFERRED_CLASS], and [MIXIN_DEFERRED_CLASS].
    */
   static const CompileTimeErrorCode EXTENDS_DEFERRED_CLASS =
-      const CompileTimeErrorCode('EXTENDS_DEFERRED_CLASS',
-          "This class cannot extend the deferred class '{0}'");
+      const CompileTimeErrorCode(
+          'EXTENDS_DEFERRED_CLASS',
+          "This class can't extend the deferred class '{0}'.",
+          "Try specifying a different superclass, or "
+          "removing the extends clause.");
 
   /**
    * DEP 37 extends the syntax for assert() to allow a second "message"
@@ -865,14 +958,16 @@
    * argument but the DEP is not enabled.
    */
   static const CompileTimeErrorCode EXTRA_ARGUMENT_TO_ASSERT =
-      const CompileTimeErrorCode('EXTRA_ARGUMENT_TO_ASSERT',
-          "Assertions only accept a single argument");
+      const CompileTimeErrorCode(
+          'EXTRA_ARGUMENT_TO_ASSERT',
+          "Assertions only accept a single argument.",
+          "Try removing the message, or enable messages in assert statements.");
 
   /**
    * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt;
    * h</i> or if <i>m &gt; n</i>.
    *
-   * 12.11.2 Const: It is a compile-time error if evaluation of a constant
+   * 16.12.2 Const: It is a compile-time error if evaluation of a constant
    * object results in an uncaught exception being thrown.
    *
    * Parameters:
@@ -880,17 +975,24 @@
    * 1: the actual number of positional arguments given
    */
   static const CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS =
-      const CompileTimeErrorCode('EXTRA_POSITIONAL_ARGUMENTS',
-          "{0} positional arguments expected, but {1} found");
+      const CompileTimeErrorCode(
+          'EXTRA_POSITIONAL_ARGUMENTS',
+          "{0} positional arguments expected, but {1} found.",
+          "Try removing the extra arguments.");
 
   /**
    * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
    * is a compile time error if more than one initializer corresponding to a
    * given instance variable appears in <i>k</i>'s list.
+   *
+   * Parameters:
+   * 0: the name of the field being initialized multiple times
    */
   static const CompileTimeErrorCode FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS =
-      const CompileTimeErrorCode('FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS',
-          "The field '{0}' cannot be initialized twice in the same constructor");
+      const CompileTimeErrorCode(
+          'FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS',
+          "The field '{0}' can't be initialized twice in the same constructor.",
+          "Try removing one of the initializations.");
 
   /**
    * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
@@ -902,7 +1004,9 @@
       FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER =
       const CompileTimeErrorCode(
           'FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER',
-          "Fields cannot be initialized in both the parameter list and the initializers");
+          "Fields can't be initialized in both the parameter list and the "
+          "initializers.",
+          "Try removing one of the initializations.");
 
   /**
    * 5 Variables: It is a compile-time error if a final instance variable that
@@ -913,8 +1017,10 @@
    * 0: the name of the field in question
    */
   static const CompileTimeErrorCode FINAL_INITIALIZED_MULTIPLE_TIMES =
-      const CompileTimeErrorCode('FINAL_INITIALIZED_MULTIPLE_TIMES',
-          "'{0}' is a final field and so can only be set once");
+      const CompileTimeErrorCode(
+          'FINAL_INITIALIZED_MULTIPLE_TIMES',
+          "'{0}' is a final field and so can only be set once.",
+          "Try removing all but one of the initializations.");
 
   /**
    * 7.6.1 Generative Constructors: It is a compile-time error if an
@@ -922,8 +1028,10 @@
    * generative constructor.
    */
   static const CompileTimeErrorCode FIELD_INITIALIZER_FACTORY_CONSTRUCTOR =
-      const CompileTimeErrorCode('FIELD_INITIALIZER_FACTORY_CONSTRUCTOR',
-          "Initializing formal fields cannot be used in factory constructors");
+      const CompileTimeErrorCode(
+          'FIELD_INITIALIZER_FACTORY_CONSTRUCTOR',
+          "Initializing formal parameters can't be used in factory constructors.",
+          "Try using a normal parameter.");
 
   /**
    * 7.6.1 Generative Constructors: It is a compile-time error if an
@@ -931,8 +1039,10 @@
    * generative constructor.
    */
   static const CompileTimeErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR =
-      const CompileTimeErrorCode('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR',
-          "Initializing formal fields can only be used in constructors");
+      const CompileTimeErrorCode(
+          'FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR',
+          "Initializing formal parameters can only be used in constructors.",
+          "Try using a normal parameter.");
 
   /**
    * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
@@ -943,8 +1053,10 @@
    * generative constructor.
    */
   static const CompileTimeErrorCode FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR =
-      const CompileTimeErrorCode('FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR',
-          "The redirecting constructor cannot have a field initializer");
+      const CompileTimeErrorCode(
+          'FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR',
+          "The redirecting constructor can't have a field initializer.",
+          "Try using a normal parameter.");
 
   /**
    * 7.2 Getters: It is a compile-time error if a class has both a getter and a
@@ -954,8 +1066,11 @@
    * 0: the conflicting name of the getter and method
    */
   static const CompileTimeErrorCode GETTER_AND_METHOD_WITH_SAME_NAME =
-      const CompileTimeErrorCode('GETTER_AND_METHOD_WITH_SAME_NAME',
-          "'{0}' cannot be used to name a getter, there is already a method with the same name");
+      const CompileTimeErrorCode(
+          'GETTER_AND_METHOD_WITH_SAME_NAME',
+          "'{0}' can't be used to name a getter, there is already a method "
+          "with the same name.",
+          "Try renaming either the getter or the method.");
 
   /**
    * 7.10 Superinterfaces: It is a compile-time error if the implements clause
@@ -963,13 +1078,17 @@
    * superinterface.
    *
    * Parameters:
-   * 0: the name of the type that cannot be extended
+   * 0: the name of the type that is deferred
    *
    * See [EXTENDS_DEFERRED_CLASS], and [MIXIN_DEFERRED_CLASS].
    */
   static const CompileTimeErrorCode IMPLEMENTS_DEFERRED_CLASS =
-      const CompileTimeErrorCode('IMPLEMENTS_DEFERRED_CLASS',
-          "This class cannot implement the deferred class '{0}'");
+      const CompileTimeErrorCode(
+          'IMPLEMENTS_DEFERRED_CLASS',
+          "This class can't implement the deferred class '{0}'.",
+          "Try specifying a different interface, "
+          "removing the class from the list, or "
+          "changing the import to not be deferred..");
 
   /**
    * 12.2 Null: It is a compile-time error for a class to attempt to extend or
@@ -998,7 +1117,10 @@
    */
   static const CompileTimeErrorCode IMPLEMENTS_DISALLOWED_CLASS =
       const CompileTimeErrorCode(
-          'IMPLEMENTS_DISALLOWED_CLASS', "Classes cannot implement '{0}'");
+          'IMPLEMENTS_DISALLOWED_CLASS',
+          "Classes can't implement '{0}'.",
+          "Try specifying a different interface, or "
+          "remove the class from the list.");
 
   /**
    * 7.10 Superinterfaces: It is a compile-time error if the implements clause
@@ -1006,7 +1128,9 @@
    */
   static const CompileTimeErrorCode IMPLEMENTS_DYNAMIC =
       const CompileTimeErrorCode(
-          'IMPLEMENTS_DYNAMIC', "Classes cannot implement 'dynamic'");
+          'IMPLEMENTS_DYNAMIC',
+          "Classes can't implement 'dynamic'.",
+          "Try specifying an interface, or remove 'dynamic' from the list.");
 
   /**
    * Enum proposal: It is a compile-time error to subclass, mix-in or implement
@@ -1014,7 +1138,9 @@
    */
   static const CompileTimeErrorCode IMPLEMENTS_ENUM =
       const CompileTimeErrorCode(
-          'IMPLEMENTS_ENUM', "Classes cannot implement an enum");
+          'IMPLEMENTS_ENUM',
+          "Classes can't implement an enum.",
+          "Try specifying an interface, or remove the enum from the list.");
 
   /**
    * 7.10 Superinterfaces: It is a compile-time error if the implements clause
@@ -1026,7 +1152,9 @@
    */
   static const CompileTimeErrorCode IMPLEMENTS_NON_CLASS =
       const CompileTimeErrorCode(
-          'IMPLEMENTS_NON_CLASS', "Classes can only implement other classes");
+          'IMPLEMENTS_NON_CLASS',
+          "Classes can only implement other classes.",
+          "Try specifying a class, or remove the name from the list.");
 
   /**
    * 7.10 Superinterfaces: It is a compile-time error if a type <i>T</i> appears
@@ -1037,7 +1165,9 @@
    */
   static const CompileTimeErrorCode IMPLEMENTS_REPEATED =
       const CompileTimeErrorCode(
-          'IMPLEMENTS_REPEATED', "'{0}' can only be implemented once");
+          'IMPLEMENTS_REPEATED',
+          "'{0}' can only be implemented once.",
+          "Try removing all but one occurance of the class name.");
 
   /**
    * 7.10 Superinterfaces: It is a compile-time error if the superclass of a
@@ -1048,8 +1178,10 @@
    *    clauses
    */
   static const CompileTimeErrorCode IMPLEMENTS_SUPER_CLASS =
-      const CompileTimeErrorCode('IMPLEMENTS_SUPER_CLASS',
-          "'{0}' cannot be used in both 'extends' and 'implements' clauses");
+      const CompileTimeErrorCode(
+          'IMPLEMENTS_SUPER_CLASS',
+          "'{0}' can't be used in both 'extends' and 'implements' clauses.",
+          "Try removing one of the occurances.");
 
   /**
    * 7.6.1 Generative Constructors: Note that <b>this</b> is not in scope on the
@@ -1059,13 +1191,10 @@
    * function or variable initializer, in a factory constructor, or in a static
    * method or variable initializer, or in the initializer of an instance
    * variable.
-   *
-   * Parameters:
-   * 0: the name of the type in question
    */
   static const CompileTimeErrorCode IMPLICIT_THIS_REFERENCE_IN_INITIALIZER =
       const CompileTimeErrorCode('IMPLICIT_THIS_REFERENCE_IN_INITIALIZER',
-          "Only static members can be accessed in initializers");
+          "Only static members can be accessed in initializers.");
 
   /**
    * SDK implementation libraries can be imported only by other SDK libraries.
@@ -1075,7 +1204,7 @@
    */
   static const CompileTimeErrorCode IMPORT_INTERNAL_LIBRARY =
       const CompileTimeErrorCode('IMPORT_INTERNAL_LIBRARY',
-          "The library '{0}' is internal and cannot be imported");
+          "The library '{0}' is internal and can't be imported.");
 
   /**
    * 14.1 Imports: It is a compile-time error if the specified URI of an
@@ -1087,8 +1216,10 @@
    * See [StaticWarningCode.IMPORT_OF_NON_LIBRARY].
    */
   static const CompileTimeErrorCode IMPORT_OF_NON_LIBRARY =
-      const CompileTimeErrorCode('IMPORT_OF_NON_LIBRARY',
-          "The imported library '{0}' must not have a part-of directive");
+      const CompileTimeErrorCode(
+          'IMPORT_OF_NON_LIBRARY',
+          "The imported library '{0}' can't have a part-of directive.",
+          "Try importing the library that the part is a part of.");
 
   /**
    * 13.9 Switch: It is a compile-time error if values of the expressions
@@ -1101,7 +1232,7 @@
    */
   static const CompileTimeErrorCode INCONSISTENT_CASE_EXPRESSION_TYPES =
       const CompileTimeErrorCode('INCONSISTENT_CASE_EXPRESSION_TYPES',
-          "Case expressions must have the same types, '{0}' is not a '{1}'");
+          "Case expressions must have the same types, '{0}' isn't a '{1}'.");
 
   /**
    * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
@@ -1116,8 +1247,11 @@
    * See [INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD].
    */
   static const CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTENT_FIELD =
-      const CompileTimeErrorCode('INITIALIZER_FOR_NON_EXISTENT_FIELD',
-          "'{0}' is not a variable in the enclosing class");
+      const CompileTimeErrorCode(
+          'INITIALIZER_FOR_NON_EXISTENT_FIELD',
+          "'{0}' isn't a field in the enclosing class.",
+          "Try correcting the name to match an existing field, or "
+          "defining a field named '{0}'.");
 
   /**
    * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
@@ -1132,8 +1266,11 @@
    * See [INITIALIZING_FORMAL_FOR_STATIC_FIELD].
    */
   static const CompileTimeErrorCode INITIALIZER_FOR_STATIC_FIELD =
-      const CompileTimeErrorCode('INITIALIZER_FOR_STATIC_FIELD',
-          "'{0}' is a static variable in the enclosing class, variables initialized in a constructor cannot be static");
+      const CompileTimeErrorCode(
+          'INITIALIZER_FOR_STATIC_FIELD',
+          "'{0}' is a static field in the enclosing class. Fields initialized "
+          "in a constructor can't be static.",
+          "Try removing the initialization.");
 
   /**
    * 7.6.1 Generative Constructors: An initializing formal has the form
@@ -1148,8 +1285,11 @@
    * [INITIALIZER_FOR_NON_EXISTENT_FIELD].
    */
   static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD =
-      const CompileTimeErrorCode('INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD',
-          "'{0}' is not a variable in the enclosing class");
+      const CompileTimeErrorCode(
+          'INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD',
+          "'{0}' isn't a field in the enclosing class.",
+          "Try correcting the name to match an existing field, or "
+          "defining a field named '{0}'.");
 
   /**
    * 7.6.1 Generative Constructors: An initializing formal has the form
@@ -1163,24 +1303,32 @@
    * See [INITIALIZER_FOR_STATIC_FIELD].
    */
   static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD =
-      const CompileTimeErrorCode('INITIALIZING_FORMAL_FOR_STATIC_FIELD',
-          "'{0}' is a static field in the enclosing class, fields initialized in a constructor cannot be static");
+      const CompileTimeErrorCode(
+          'INITIALIZING_FORMAL_FOR_STATIC_FIELD',
+          "'{0}' is a static field in the enclosing class. Fields initialized "
+          "in a constructor can't be static.",
+          "Try removing the initialization.");
 
   /**
    * 12.30 Identifier Reference: Otherwise, e is equivalent to the property
    * extraction <b>this</b>.<i>id</i>.
    */
   static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_FACTORY =
-      const CompileTimeErrorCode('INSTANCE_MEMBER_ACCESS_FROM_FACTORY',
-          "Instance members cannot be accessed from a factory constructor");
+      const CompileTimeErrorCode(
+          'INSTANCE_MEMBER_ACCESS_FROM_FACTORY',
+          "Instance members can't be accessed from a factory constructor.",
+          "Try removing the reference to the instance member.");
 
   /**
    * 12.30 Identifier Reference: Otherwise, e is equivalent to the property
    * extraction <b>this</b>.<i>id</i>.
    */
   static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_STATIC =
-      const CompileTimeErrorCode('INSTANCE_MEMBER_ACCESS_FROM_STATIC',
-          "Instance members cannot be accessed from a static method");
+      const CompileTimeErrorCode(
+          'INSTANCE_MEMBER_ACCESS_FROM_STATIC',
+          "Instance members can't be accessed from a static method.",
+          "Try removing the reference to the instance member, or ."
+          "removing the keyword 'static' from the method.");
 
   /**
    * Enum proposal: It is also a compile-time error to explicitly instantiate an
@@ -1188,20 +1336,24 @@
    */
   static const CompileTimeErrorCode INSTANTIATE_ENUM =
       const CompileTimeErrorCode(
-          'INSTANTIATE_ENUM', "Enums cannot be instantiated");
+          'INSTANTIATE_ENUM',
+          "Enums can't be instantiated.",
+          "Try using one of the defined constants.");
 
   /**
-   * 11 Metadata: Metadata consists of a series of annotations, each of which
+   * 15 Metadata: Metadata consists of a series of annotations, each of which
    * begin with the character @, followed by a constant expression that must be
    * either a reference to a compile-time constant variable, or a call to a
    * constant constructor.
    */
-  static const CompileTimeErrorCode INVALID_ANNOTATION = const CompileTimeErrorCode(
-      'INVALID_ANNOTATION',
-      "Annotation can be only constant variable or constant constructor invocation");
+  static const CompileTimeErrorCode INVALID_ANNOTATION =
+      const CompileTimeErrorCode(
+          'INVALID_ANNOTATION',
+          "Annotation must be either a const variable reference or const "
+          "constructor invocation.");
 
   /**
-   * 11 Metadata: Metadata consists of a series of annotations, each of which
+   * 15 Metadata: Metadata consists of a series of annotations, each of which
    * begin with the character @, followed by a constant expression that must be
    * either a reference to a compile-time constant variable, or a call to a
    * constant constructor.
@@ -1210,8 +1362,11 @@
    * not qualified by a deferred prefix.
    */
   static const CompileTimeErrorCode INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY =
-      const CompileTimeErrorCode('INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY',
-          "Constant values from a deferred library cannot be used as annotations");
+      const CompileTimeErrorCode(
+          'INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY',
+          "Constant values from a deferred library can't be used as annotations.",
+          "Try removing the annotation, or "
+          "changing the import to not be deferred.");
 
   /**
    * 15.31 Identifier Reference: It is a compile-time error if any of the
@@ -1219,24 +1374,32 @@
    * body marked with either async, async* or sync*.
    */
   static const CompileTimeErrorCode INVALID_IDENTIFIER_IN_ASYNC =
-      const CompileTimeErrorCode('INVALID_IDENTIFIER_IN_ASYNC',
-          "The identifier '{0}' cannot be used in a function marked with async, async* or sync*");
+      const CompileTimeErrorCode(
+          'INVALID_IDENTIFIER_IN_ASYNC',
+          "The identifier '{0}' can't be used in a function marked with "
+          "'async', 'async*' or 'sync*'.",
+          "Try using a different name, or "
+          "remove the modifier on the function body.");
 
   /**
    * 9. Functions: It is a compile-time error if an async, async* or sync*
    * modifier is attached to the body of a setter or constructor.
    */
   static const CompileTimeErrorCode INVALID_MODIFIER_ON_CONSTRUCTOR =
-      const CompileTimeErrorCode('INVALID_MODIFIER_ON_CONSTRUCTOR',
-          "The modifier '{0}' cannot be applied to the body of a constructor");
+      const CompileTimeErrorCode(
+          'INVALID_MODIFIER_ON_CONSTRUCTOR',
+          "The modifier '{0}' can't be applied to the body of a constructor.",
+          "Try removing the modifier.");
 
   /**
    * 9. Functions: It is a compile-time error if an async, async* or sync*
    * modifier is attached to the body of a setter or constructor.
    */
   static const CompileTimeErrorCode INVALID_MODIFIER_ON_SETTER =
-      const CompileTimeErrorCode('INVALID_MODIFIER_ON_SETTER',
-          "The modifier '{0}' cannot be applied to the body of a setter");
+      const CompileTimeErrorCode(
+          'INVALID_MODIFIER_ON_SETTER',
+          "The modifier '{0}' can't be applied to the body of a setter.",
+          "Try removing the modifier.");
 
   /**
    * TODO(brianwilkerson) Remove this when we have decided on how to report
@@ -1246,7 +1409,7 @@
    * See TODOs in ConstantVisitor
    */
   static const CompileTimeErrorCode INVALID_CONSTANT =
-      const CompileTimeErrorCode('INVALID_CONSTANT', "Invalid constant value");
+      const CompileTimeErrorCode('INVALID_CONSTANT', "Invalid constant value.");
 
   /**
    * 7.6 Constructors: It is a compile-time error if the name of a constructor
@@ -1254,15 +1417,17 @@
    */
   static const CompileTimeErrorCode INVALID_CONSTRUCTOR_NAME =
       const CompileTimeErrorCode(
-          'INVALID_CONSTRUCTOR_NAME', "Invalid constructor name");
+          'INVALID_CONSTRUCTOR_NAME', "Invalid constructor name.");
 
   /**
    * 7.6.2 Factories: It is a compile-time error if <i>M</i> is not the name of
    * the immediately enclosing class.
    */
   static const CompileTimeErrorCode INVALID_FACTORY_NAME_NOT_A_CLASS =
-      const CompileTimeErrorCode('INVALID_FACTORY_NAME_NOT_A_CLASS',
-          "The name of the immediately enclosing class expected");
+      const CompileTimeErrorCode(
+          'INVALID_FACTORY_NAME_NOT_A_CLASS',
+          "The name of a factory constructor must be the same as the name of "
+          "the immediately enclosing class.");
 
   /**
    * 12.10 This: It is a compile-time error if this appears in a top-level
@@ -1272,7 +1437,7 @@
    */
   static const CompileTimeErrorCode INVALID_REFERENCE_TO_THIS =
       const CompileTimeErrorCode('INVALID_REFERENCE_TO_THIS',
-          "Invalid reference to 'this' expression");
+          "Invalid reference to 'this' expression.");
 
   /**
    * 12.6 Lists: It is a compile time error if the type argument of a constant
@@ -1282,8 +1447,11 @@
    * 0: the name of the type parameter
    */
   static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST =
-      const CompileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_LIST',
-          "Constant list literals cannot include a type parameter as a type argument, such as '{0}'");
+      const CompileTimeErrorCode(
+          'INVALID_TYPE_ARGUMENT_IN_CONST_LIST',
+          "Constant list literals can't include a type parameter as a type "
+          "argument, such as '{0}'.",
+          "Try replacing the type parameter with a different type.");
 
   /**
    * 12.7 Maps: It is a compile time error if the type arguments of a constant
@@ -1293,8 +1461,11 @@
    * 0: the name of the type parameter
    */
   static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP =
-      const CompileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_MAP',
-          "Constant map literals cannot include a type parameter as a type argument, such as '{0}'");
+      const CompileTimeErrorCode(
+          'INVALID_TYPE_ARGUMENT_IN_CONST_MAP',
+          "Constant map literals can't include a type parameter as a type "
+          "argument, such as '{0}'.",
+          "Try replacing the type parameter with a different type.");
 
   /**
    * 14.2 Exports: It is a compile-time error if the compilation unit found at
@@ -1312,7 +1483,7 @@
    * See [URI_DOES_NOT_EXIST].
    */
   static const CompileTimeErrorCode INVALID_URI =
-      const CompileTimeErrorCode('INVALID_URI', "Invalid URI syntax: '{0}'");
+      const CompileTimeErrorCode('INVALID_URI', "Invalid URI syntax: '{0}'.");
 
   /**
    * 13.13 Break: It is a compile-time error if no such statement
@@ -1328,7 +1499,7 @@
    */
   static const CompileTimeErrorCode LABEL_IN_OUTER_SCOPE =
       const CompileTimeErrorCode('LABEL_IN_OUTER_SCOPE',
-          "Cannot reference label '{0}' declared in an outer method");
+          "Can't reference label '{0}' declared in an outer method.");
 
   /**
    * 13.13 Break: It is a compile-time error if no such statement
@@ -1344,7 +1515,10 @@
    */
   static const CompileTimeErrorCode LABEL_UNDEFINED =
       const CompileTimeErrorCode(
-          'LABEL_UNDEFINED', "Cannot reference undefined label '{0}'");
+          'LABEL_UNDEFINED',
+          "Can't reference undefined label '{0}'.",
+          "Try defining the label, or "
+          "correcting the name to match an existing label.");
 
   /**
    * 7 Classes: It is a compile time error if a class <i>C</i> declares a member
@@ -1352,7 +1526,7 @@
    */
   static const CompileTimeErrorCode MEMBER_WITH_CLASS_NAME =
       const CompileTimeErrorCode('MEMBER_WITH_CLASS_NAME',
-          "Class members cannot have the same name as the enclosing class");
+          "Class members can't have the same name as the enclosing class.");
 
   /**
    * 7.2 Getters: It is a compile-time error if a class has both a getter and a
@@ -1362,22 +1536,30 @@
    * 0: the conflicting name of the getter and method
    */
   static const CompileTimeErrorCode METHOD_AND_GETTER_WITH_SAME_NAME =
-      const CompileTimeErrorCode('METHOD_AND_GETTER_WITH_SAME_NAME',
-          "'{0}' cannot be used to name a method, there is already a getter with the same name");
+      const CompileTimeErrorCode(
+          'METHOD_AND_GETTER_WITH_SAME_NAME',
+          "'{0}' can't be used to name a method, there is already a getter "
+          "with the same name.");
 
   /**
    * 12.1 Constants: A constant expression is ... a constant list literal.
    */
   static const CompileTimeErrorCode MISSING_CONST_IN_LIST_LITERAL =
-      const CompileTimeErrorCode('MISSING_CONST_IN_LIST_LITERAL',
-          "List literals must be prefixed with 'const' when used as a constant expression");
+      const CompileTimeErrorCode(
+          'MISSING_CONST_IN_LIST_LITERAL',
+          "List literals must be prefixed with 'const' when used as a constant "
+          "expression.",
+          "Try adding the keyword 'const' before the literal.");
 
   /**
    * 12.1 Constants: A constant expression is ... a constant map literal.
    */
   static const CompileTimeErrorCode MISSING_CONST_IN_MAP_LITERAL =
-      const CompileTimeErrorCode('MISSING_CONST_IN_MAP_LITERAL',
-          "Map literals must be prefixed with 'const' when used as a constant expression");
+      const CompileTimeErrorCode(
+          'MISSING_CONST_IN_MAP_LITERAL',
+          "Map literals must be prefixed with 'const' when used as a constant "
+          "expression.",
+          "Try adding the keyword 'const' before the literal.");
 
   /**
    * 9 Mixins: It is a compile-time error if a declared or derived mixin
@@ -1387,8 +1569,10 @@
    * 0: the name of the mixin that is invalid
    */
   static const CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR =
-      const CompileTimeErrorCode('MIXIN_DECLARES_CONSTRUCTOR',
-          "The class '{0}' cannot be used as a mixin because it declares a constructor");
+      const CompileTimeErrorCode(
+          'MIXIN_DECLARES_CONSTRUCTOR',
+          "The class '{0}' can't be used as a mixin because it declares a "
+          "constructor.");
 
   /**
    * 9.1 Mixin Application: It is a compile-time error if the with clause of a
@@ -1400,8 +1584,10 @@
    * See [EXTENDS_DEFERRED_CLASS], and [IMPLEMENTS_DEFERRED_CLASS].
    */
   static const CompileTimeErrorCode MIXIN_DEFERRED_CLASS =
-      const CompileTimeErrorCode('MIXIN_DEFERRED_CLASS',
-          "This class cannot mixin the deferred class '{0}'");
+      const CompileTimeErrorCode(
+          'MIXIN_DEFERRED_CLASS',
+          "This class can't mixin the deferred class '{0}'.",
+          "Try changing the import to not be deferred.");
 
   /**
    * Not yet in the spec, but consistent with VM behavior.  It is a
@@ -1424,8 +1610,10 @@
    * 0: the name of the mixin that is invalid
    */
   static const CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT =
-      const CompileTimeErrorCode('MIXIN_INHERITS_FROM_NOT_OBJECT',
-          "The class '{0}' cannot be used as a mixin because it extends a class other than Object");
+      const CompileTimeErrorCode(
+          'MIXIN_INHERITS_FROM_NOT_OBJECT',
+          "The class '{0}' can't be used as a mixin because it extends a class "
+          "other than Object.");
 
   /**
    * 12.2 Null: It is a compile-time error for a class to attempt to extend or
@@ -1453,14 +1641,14 @@
    */
   static const CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS =
       const CompileTimeErrorCode(
-          'MIXIN_OF_DISALLOWED_CLASS', "Classes cannot mixin '{0}'");
+          'MIXIN_OF_DISALLOWED_CLASS', "Classes can't mixin '{0}'.");
 
   /**
    * Enum proposal: It is a compile-time error to subclass, mix-in or implement
    * an enum.
    */
   static const CompileTimeErrorCode MIXIN_OF_ENUM = const CompileTimeErrorCode(
-      'MIXIN_OF_ENUM', "Classes cannot mixin an enum");
+      'MIXIN_OF_ENUM', "Classes can't mixin an enum.");
 
   /**
    * 9.1 Mixin Application: It is a compile-time error if <i>M</i> does not
@@ -1468,15 +1656,17 @@
    */
   static const CompileTimeErrorCode MIXIN_OF_NON_CLASS =
       const CompileTimeErrorCode(
-          'MIXIN_OF_NON_CLASS', "Classes can only mixin other classes");
+          'MIXIN_OF_NON_CLASS', "Classes can only mixin other classes.");
 
   /**
    * 9 Mixins: It is a compile-time error if a declared or derived mixin refers
    * to super.
    */
   static const CompileTimeErrorCode MIXIN_REFERENCES_SUPER =
-      const CompileTimeErrorCode('MIXIN_REFERENCES_SUPER',
-          "The class '{0}' cannot be used as a mixin because it references 'super'");
+      const CompileTimeErrorCode(
+          'MIXIN_REFERENCES_SUPER',
+          "The class '{0}' can't be used as a mixin because it references "
+          "'super'.");
 
   /**
    * 9.1 Mixin Application: It is a compile-time error if <i>S</i> does not
@@ -1484,7 +1674,7 @@
    */
   static const CompileTimeErrorCode MIXIN_WITH_NON_CLASS_SUPERCLASS =
       const CompileTimeErrorCode('MIXIN_WITH_NON_CLASS_SUPERCLASS',
-          "Mixin can only be applied to class");
+          "Mixin can only be applied to class.");
 
   /**
    * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
@@ -1493,7 +1683,8 @@
   static const CompileTimeErrorCode
       MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS = const CompileTimeErrorCode(
           'MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS',
-          "Constructor may have at most one 'this' redirection");
+          "Constructors can have at most one 'this' redirection.",
+          "Try removing all but one of the redirections.");
 
   /**
    * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor.
@@ -1501,20 +1692,28 @@
    * list or a compile time error occurs.
    */
   static const CompileTimeErrorCode MULTIPLE_SUPER_INITIALIZERS =
-      const CompileTimeErrorCode('MULTIPLE_SUPER_INITIALIZERS',
-          "Constructor may have at most one 'super' initializer");
+      const CompileTimeErrorCode(
+          'MULTIPLE_SUPER_INITIALIZERS',
+          "Constructor may have at most one 'super' initializer.",
+          "Try removing all but one of the 'super' initializers.");
 
   /**
-   * 11 Metadata: Metadata consists of a series of annotations, each of which
+   * 15 Metadata: Metadata consists of a series of annotations, each of which
    * begin with the character @, followed by a constant expression that must be
    * either a reference to a compile-time constant variable, or a call to a
    * constant constructor.
    */
   static const CompileTimeErrorCode NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS =
-      const CompileTimeErrorCode('NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS',
-          "Annotation creation must have arguments");
+      const CompileTimeErrorCode(
+          'NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS',
+          "Annotation creation must have arguments.",
+          "Try adding an empty argument list.");
 
   /**
+   * This error is generated if a constructor declaration has an implicit
+   * invocation of a zero argument super constructor (`super()`), but the
+   * superclass does not define a zero argument constructor.
+   *
    * 7.6.1 Generative Constructors: If no superinitializer is provided, an
    * implicit superinitializer of the form <b>super</b>() is added at the end of
    * <i>k</i>'s initializer list, unless the enclosing class is class
@@ -1523,12 +1722,24 @@
    * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i>
    * does not declare a generative constructor named <i>S</i> (respectively
    * <i>S.id</i>)
+   *
+   * Parameters:
+   * 0: the name of the superclass that does not define the implicitly invoked
+   *    constructor
    */
   static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT =
-      const CompileTimeErrorCode('NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT',
-          "The class '{0}' does not have a default constructor");
+      const CompileTimeErrorCode(
+          'NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT',
+          "The superclass '{0}' doesn't have a zero argument constructor.",
+          "Try declaring a zero argument constructor in '{0}', or "
+          "explicitly invoking a different constructor in '{0}'.");
 
   /**
+   * This error is generated if a class declaration has an implicit default
+   * constructor, which implicitly invokes a zero argument super constructor
+   * (`super()`), but the superclass does not define a zero argument
+   * constructor.
+   *
    * 7.6 Constructors: Iff no constructor is specified for a class <i>C</i>, it
    * implicitly has a default constructor C() : <b>super<b>() {}, unless
    * <i>C</i> is class <i>Object</i>.
@@ -1536,10 +1747,19 @@
    * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i>
    * does not declare a generative constructor named <i>S</i> (respectively
    * <i>S.id</i>)
+   *
+   * Parameters:
+   * 0: the name of the superclass that does not define the implicitly invoked
+   *    constructor
+   * 1: the name of the subclass that does not contain any explicit constructors
    */
   static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT =
-      const CompileTimeErrorCode('NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT',
-          "The class '{0}' does not have a default constructor");
+      const CompileTimeErrorCode(
+          'NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT',
+          "The superclass '{0}' doesn't have a zero argument constructor.",
+          "Try declaring a zero argument constructor in '{0}', or "
+          "declaring a constructor in {1} that explicitly invokes a "
+          "constructor in '{0}'.");
 
   /**
    * 13.2 Expression Statements: It is a compile-time error if a non-constant
@@ -1547,8 +1767,10 @@
    * statement is expected.
    */
   static const CompileTimeErrorCode NON_CONST_MAP_AS_EXPRESSION_STATEMENT =
-      const CompileTimeErrorCode('NON_CONST_MAP_AS_EXPRESSION_STATEMENT',
-          "A non-constant map literal without type arguments cannot be used as an expression statement");
+      const CompileTimeErrorCode(
+          'NON_CONST_MAP_AS_EXPRESSION_STATEMENT',
+          "A non-constant map literal without type arguments can't be used as "
+          "an expression statement.");
 
   /**
    * 13.9 Switch: Given a switch statement of the form <i>switch (e) {
@@ -1563,7 +1785,7 @@
    */
   static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION =
       const CompileTimeErrorCode(
-          'NON_CONSTANT_CASE_EXPRESSION', "Case expressions must be constant");
+          'NON_CONSTANT_CASE_EXPRESSION', "Case expressions must be constant.");
 
   /**
    * 13.9 Switch: Given a switch statement of the form <i>switch (e) {
@@ -1583,7 +1805,10 @@
       NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY =
       const CompileTimeErrorCode(
           'NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY',
-          "Constant values from a deferred library cannot be used as a case expression");
+          "Constant values from a deferred library can't be used as a case "
+          "expression.",
+          "Try re-writing the switch as a series of if statements, or "
+          "changing the import to not be deferred.");
 
   /**
    * 6.2.2 Optional Formals: It is a compile-time error if the default value of
@@ -1591,7 +1816,7 @@
    */
   static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE =
       const CompileTimeErrorCode('NON_CONSTANT_DEFAULT_VALUE',
-          "Default values of an optional parameter must be constant");
+          "Default values of an optional parameter must be constant.");
 
   /**
    * 6.2.2 Optional Formals: It is a compile-time error if the default value of
@@ -1604,15 +1829,20 @@
       NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY =
       const CompileTimeErrorCode(
           'NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY',
-          "Constant values from a deferred library cannot be used as a default parameter value");
+          "Constant values from a deferred library can't be used as a default "
+          "parameter value.",
+          "Try leaving the default as null and initializing the parameter "
+          "inside the function body.");
 
   /**
    * 12.6 Lists: It is a compile time error if an element of a constant list
    * literal is not a compile-time constant.
    */
   static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT =
-      const CompileTimeErrorCode('NON_CONSTANT_LIST_ELEMENT',
-          "'const' lists must have all constant values");
+      const CompileTimeErrorCode(
+          'NON_CONSTANT_LIST_ELEMENT',
+          "The values in a const list literal must be constants.",
+          "Try removing the keyword 'const' from the map literal.");
 
   /**
    * 12.6 Lists: It is a compile time error if an element of a constant list
@@ -1625,7 +1855,9 @@
       NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY =
       const CompileTimeErrorCode(
           'NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY',
-          "Constant values from a deferred library cannot be used as values in a 'const' list");
+          "Constant values from a deferred library can't be used as values in "
+          "a 'const' list.",
+          "Try removing the keyword 'const' from the list literal.");
 
   /**
    * 12.7 Maps: It is a compile time error if either a key or a value of an
@@ -1633,7 +1865,9 @@
    */
   static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY =
       const CompileTimeErrorCode(
-          'NON_CONSTANT_MAP_KEY', "The keys in a map must be constant");
+          'NON_CONSTANT_MAP_KEY',
+          "The keys in a const map literal must be constant.",
+          "Try removing the keyword 'const' from the map literal.");
 
   /**
    * 12.7 Maps: It is a compile time error if either a key or a value of an
@@ -1643,16 +1877,21 @@
    * not qualified by a deferred prefix.
    */
   static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY =
-      const CompileTimeErrorCode('NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY',
-          "Constant values from a deferred library cannot be used as keys in a map");
+      const CompileTimeErrorCode(
+          'NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY',
+          "Constant values from a deferred library can't be used as keys in a "
+          "const map literal.",
+          "Try removing the keyword 'const' from the map literal.");
 
   /**
    * 12.7 Maps: It is a compile time error if either a key or a value of an
    * entry in a constant map literal is not a compile-time constant.
    */
   static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE =
-      const CompileTimeErrorCode('NON_CONSTANT_MAP_VALUE',
-          "The values in a 'const' map must be constant");
+      const CompileTimeErrorCode(
+          'NON_CONSTANT_MAP_VALUE',
+          "The values in a const map literal must be constant.",
+          "Try removing the keyword 'const' from the map literal.");
 
   /**
    * 12.7 Maps: It is a compile time error if either a key or a value of an
@@ -1664,10 +1903,12 @@
   static const CompileTimeErrorCode
       NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode(
           'NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY',
-          "Constant values from a deferred library cannot be used as values in a 'const' map");
+          "Constant values from a deferred library can't be used as values in "
+          "a const map literal.",
+          "Try removing the keyword 'const' from the map literal.");
 
   /**
-   * 11 Metadata: Metadata consists of a series of annotations, each of which
+   * 15 Metadata: Metadata consists of a series of annotations, each of which
    * begin with the character @, followed by a constant expression that must be
    * either a reference to a compile-time constant variable, or a call to a
    * constant constructor.
@@ -1677,7 +1918,7 @@
    */
   static const CompileTimeErrorCode NON_CONSTANT_ANNOTATION_CONSTRUCTOR =
       const CompileTimeErrorCode('NON_CONSTANT_ANNOTATION_CONSTRUCTOR',
-          "Annotation creation can use only 'const' constructor");
+          "Annotation creation can only call a const constructor.");
 
   /**
    * 7.6.3 Constant Constructors: Any expression that appears within the
@@ -1686,7 +1927,7 @@
    */
   static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER =
       const CompileTimeErrorCode('NON_CONSTANT_VALUE_IN_INITIALIZER',
-          "Initializer expressions in constant constructors must be constants");
+          "Initializer expressions in constant constructors must be constants.");
 
   /**
    * 7.6.3 Constant Constructors: Any expression that appears within the
@@ -1700,13 +1941,15 @@
       NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY =
       const CompileTimeErrorCode(
           'NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY',
-          "Constant values from a deferred library cannot be used as constant initializers");
+          "Constant values from a deferred library can't be used as constant "
+          "initializers.",
+          "Try changing the import to not be deferred.");
 
   /**
    * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</i>
    * or if <i>m > n</i>.
    *
-   * 12.11.2 Const: It is a compile-time error if evaluation of a constant
+   * 16.12.2 Const: It is a compile-time error if evaluation of a constant
    * object results in an uncaught exception being thrown.
    *
    * Parameters:
@@ -1714,8 +1957,10 @@
    * 1: the actual number of positional arguments given
    */
   static const CompileTimeErrorCode NOT_ENOUGH_REQUIRED_ARGUMENTS =
-      const CompileTimeErrorCode('NOT_ENOUGH_REQUIRED_ARGUMENTS',
-          "{0} required argument(s) expected, but {1} found");
+      const CompileTimeErrorCode(
+          'NOT_ENOUGH_REQUIRED_ARGUMENTS',
+          "{0} required argument(s) expected, but {1} found.",
+          "Try adding the missing arguments.");
 
   /**
    * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the
@@ -1725,23 +1970,29 @@
    * (respectively <i>S.id</i>)
    */
   static const CompileTimeErrorCode NON_GENERATIVE_CONSTRUCTOR =
-      const CompileTimeErrorCode('NON_GENERATIVE_CONSTRUCTOR',
-          "The generative constructor '{0}' expected, but factory found");
+      const CompileTimeErrorCode(
+          'NON_GENERATIVE_CONSTRUCTOR',
+          "The generative constructor '{0}' expected, but factory found.",
+          "Try calling a different constructor in the superclass, or "
+          "making the called constructor not be a factory constructor.");
 
   /**
    * 7.9 Superclasses: It is a compile-time error to specify an extends clause
    * for class Object.
    */
   static const CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS =
-      const CompileTimeErrorCode('OBJECT_CANNOT_EXTEND_ANOTHER_CLASS', "");
+      const CompileTimeErrorCode('OBJECT_CANNOT_EXTEND_ANOTHER_CLASS',
+          "The class 'Object' can't extend any other class.");
 
   /**
    * 7.1.1 Operators: It is a compile-time error to declare an optional
    * parameter in an operator.
    */
   static const CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR =
-      const CompileTimeErrorCode('OPTIONAL_PARAMETER_IN_OPERATOR',
-          "Optional parameters are not allowed when defining an operator");
+      const CompileTimeErrorCode(
+          'OPTIONAL_PARAMETER_IN_OPERATOR',
+          "Optional parameters aren't allowed when defining an operator.",
+          "Try removing the optional parameters.");
 
   /**
    * 14.3 Parts: It is a compile time error if the contents of the URI are not a
@@ -1751,24 +2002,33 @@
    * 0: the uri pointing to a non-library declaration
    */
   static const CompileTimeErrorCode PART_OF_NON_PART =
-      const CompileTimeErrorCode('PART_OF_NON_PART',
-          "The included part '{0}' must have a part-of directive");
+      const CompileTimeErrorCode(
+          'PART_OF_NON_PART',
+          "The included part '{0}' must have a part-of directive.",
+          "Try adding a part-of directive to '{0}'.");
 
   /**
    * 14.1 Imports: It is a compile-time error if the current library declares a
    * top-level member named <i>p</i>.
    */
   static const CompileTimeErrorCode PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER =
-      const CompileTimeErrorCode('PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER',
-          "The name '{0}' is already used as an import prefix and cannot be used to name a top-level element");
+      const CompileTimeErrorCode(
+          'PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER',
+          "The name '{0}' is already used as an import prefix and can't be "
+          "used to name a top-level element.",
+          "Try renaming either the top-level element or the prefix.");
 
   /**
    * 16.32 Identifier Reference: If d is a prefix p, a compile-time error
    * occurs unless the token immediately following d is '.'.
    */
   static const CompileTimeErrorCode PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT =
-      const CompileTimeErrorCode('PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT',
-          "The name '{0}' refers to an import prefix, so it must be followed by '.'");
+      const CompileTimeErrorCode(
+          'PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT',
+          "The name '{0}' refers to an import prefix, so it must be followed "
+          "by '.'.",
+          "Try correcting the name to refer to something other than a prefix, or "
+          "renaming the prefix.");
 
   /**
    * 6.2.2 Optional Formals: It is a compile-time error if the name of a named
@@ -1776,7 +2036,7 @@
    */
   static const CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER =
       const CompileTimeErrorCode('PRIVATE_OPTIONAL_PARAMETER',
-          "Named optional parameters cannot start with an underscore");
+          "Named optional parameters can't start with an underscore.");
 
   /**
    * 12.1 Constants: It is a compile-time error if the value of a compile-time
@@ -1784,7 +2044,7 @@
    */
   static const CompileTimeErrorCode RECURSIVE_COMPILE_TIME_CONSTANT =
       const CompileTimeErrorCode('RECURSIVE_COMPILE_TIME_CONSTANT',
-          "Compile-time constant expression depends on itself");
+          "Compile-time constant expression depends on itself.");
 
   /**
    * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
@@ -1798,7 +2058,7 @@
    */
   static const CompileTimeErrorCode RECURSIVE_CONSTRUCTOR_REDIRECT =
       const CompileTimeErrorCode('RECURSIVE_CONSTRUCTOR_REDIRECT',
-          "Cycle in redirecting generative constructors");
+          "Cycle in redirecting generative constructors.");
 
   /**
    * 7.6.2 Factories: It is a compile-time error if a redirecting factory
@@ -1807,7 +2067,7 @@
    */
   static const CompileTimeErrorCode RECURSIVE_FACTORY_REDIRECT =
       const CompileTimeErrorCode('RECURSIVE_FACTORY_REDIRECT',
-          "Cycle in redirecting factory constructors");
+          "Cycle in redirecting factory constructors.");
 
   /**
    * 7.10 Superinterfaces: It is a compile-time error if the interface of a
@@ -1825,7 +2085,7 @@
    */
   static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE =
       const CompileTimeErrorCode('RECURSIVE_INTERFACE_INHERITANCE',
-          "'{0}' cannot be a superinterface of itself: {1}");
+          "'{0}' can't be a superinterface of itself: {1}.");
 
   /**
    * 7.10 Superinterfaces: It is a compile-time error if the interface of a
@@ -1844,7 +2104,7 @@
       RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS =
       const CompileTimeErrorCode(
           'RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS',
-          "'{0}' cannot extend itself");
+          "'{0}' can't extend itself.");
 
   /**
    * 7.10 Superinterfaces: It is a compile-time error if the interface of a
@@ -1863,7 +2123,7 @@
       RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS =
       const CompileTimeErrorCode(
           'RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS',
-          "'{0}' cannot implement itself");
+          "'{0}' can't implement itself.");
 
   /**
    * 7.10 Superinterfaces: It is a compile-time error if the interface of a
@@ -1882,31 +2142,40 @@
       RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH =
       const CompileTimeErrorCode(
           'RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH',
-          "'{0}' cannot use itself as a mixin");
+          "'{0}' can't use itself as a mixin.");
 
   /**
    * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with
    * the const modifier but <i>k'</i> is not a constant constructor.
    */
   static const CompileTimeErrorCode REDIRECT_TO_MISSING_CONSTRUCTOR =
-      const CompileTimeErrorCode('REDIRECT_TO_MISSING_CONSTRUCTOR',
-          "The constructor '{0}' could not be found in '{1}'");
+      const CompileTimeErrorCode(
+          'REDIRECT_TO_MISSING_CONSTRUCTOR',
+          "The constructor '{0}' couldn't be found in '{1}'.",
+          "Try redirecting to a different constructor, or "
+          "define the constructor named '{0}'.");
 
   /**
    * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with
    * the const modifier but <i>k'</i> is not a constant constructor.
    */
   static const CompileTimeErrorCode REDIRECT_TO_NON_CLASS =
-      const CompileTimeErrorCode('REDIRECT_TO_NON_CLASS',
-          "The name '{0}' is not a type and cannot be used in a redirected constructor");
+      const CompileTimeErrorCode(
+          'REDIRECT_TO_NON_CLASS',
+          "The name '{0}' isn't a type and can't be used in a redirected "
+          "constructor.",
+          "Try redirecting to a different constructor.");
 
   /**
    * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with
    * the const modifier but <i>k'</i> is not a constant constructor.
    */
   static const CompileTimeErrorCode REDIRECT_TO_NON_CONST_CONSTRUCTOR =
-      const CompileTimeErrorCode('REDIRECT_TO_NON_CONST_CONSTRUCTOR',
-          "Constant factory constructor cannot delegate to a non-constant constructor");
+      const CompileTimeErrorCode(
+          'REDIRECT_TO_NON_CONST_CONSTRUCTOR',
+          "Constant factory constructor can't delegate to a non-constant "
+          "constructor.",
+          "Try redirecting to a different constructor.");
 
   /**
    * 7.6.1 Generative constructors: A generative constructor may be
@@ -1914,8 +2183,11 @@
    * generative constructor.
    */
   static const CompileTimeErrorCode REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR =
-      const CompileTimeErrorCode('REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR',
-          "The constructor '{0}' could not be found in '{1}'");
+      const CompileTimeErrorCode(
+          'REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR',
+          "The constructor '{0}' couldn't be found in '{1}'.",
+          "Try redirecting to a different constructor, or "
+          "defining the constructor named '{0}'.");
 
   /**
    * 7.6.1 Generative constructors: A generative constructor may be
@@ -1926,7 +2198,8 @@
       REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR =
       const CompileTimeErrorCode(
           'REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR',
-          "Generative constructor cannot redirect to a factory constructor");
+          "Generative constructor can't redirect to a factory constructor.",
+          "Try redirecting to a different constructor.");
 
   /**
    * 5 Variables: A local variable may only be referenced at a source code
@@ -1934,8 +2207,12 @@
    * compile-time error occurs.
    */
   static const CompileTimeErrorCode REFERENCED_BEFORE_DECLARATION =
-      const CompileTimeErrorCode('REFERENCED_BEFORE_DECLARATION',
-          "Local variable '{0}' cannot be referenced before it is declared");
+      const CompileTimeErrorCode(
+          'REFERENCED_BEFORE_DECLARATION',
+          "Local variable '{0}' can't be referenced before it is declared.",
+          "Try moving the declaration to before the first use, or "
+          "renaming the local variable so that it doesn't hide a name from an "
+          "enclosing scope.");
 
   /**
    * 12.8.1 Rethrow: It is a compile-time error if an expression of the form
@@ -1945,7 +2222,8 @@
       const CompileTimeErrorCode(
           'RETHROW_OUTSIDE_CATCH',
           "Rethrow must be inside of catch clause.",
-          "Try moving the expression into a catch clause, or using a 'throw' expression.");
+          "Try moving the expression into a catch clause, or using a 'throw' "
+          "expression.");
 
   /**
    * 13.12 Return: It is a compile-time error if a return statement of the form
@@ -1964,15 +2242,19 @@
   static const CompileTimeErrorCode RETURN_IN_GENERATOR = const CompileTimeErrorCode(
       'RETURN_IN_GENERATOR',
       "Can't return a value from a generator function (using the '{0}' modifier).",
-      "Try removing the value, replacing 'return' with 'yield' or changing the method body modifier.");
+      "Try removing the value, replacing 'return' with 'yield' or changing the "
+      "method body modifier.");
 
   /**
    * 14.1 Imports: It is a compile-time error if a prefix used in a deferred
    * import is used in another import clause.
    */
   static const CompileTimeErrorCode SHARED_DEFERRED_PREFIX =
-      const CompileTimeErrorCode('SHARED_DEFERRED_PREFIX',
-          "The prefix of a deferred import cannot be used in other import directives");
+      const CompileTimeErrorCode(
+          'SHARED_DEFERRED_PREFIX',
+          "The prefix of a deferred import can't be used in other import "
+          "directives.",
+          "Try renaming one of the prefixes.");
 
   /**
    * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form
@@ -1984,8 +2266,8 @@
    * method or variable initializer.
    */
   static const CompileTimeErrorCode SUPER_IN_INVALID_CONTEXT =
-      const CompileTimeErrorCode(
-          'SUPER_IN_INVALID_CONTEXT', "Invalid context for 'super' invocation");
+      const CompileTimeErrorCode('SUPER_IN_INVALID_CONTEXT',
+          "Invalid context for 'super' invocation.");
 
   /**
    * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
@@ -1993,7 +2275,7 @@
    */
   static const CompileTimeErrorCode SUPER_IN_REDIRECTING_CONSTRUCTOR =
       const CompileTimeErrorCode('SUPER_IN_REDIRECTING_CONSTRUCTOR',
-          "The redirecting constructor cannot have a 'super' initializer");
+          "The redirecting constructor can't have a 'super' initializer.");
 
   /**
    * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
@@ -2001,7 +2283,8 @@
    * includes a superinitializer.
    */
   static const CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT =
-      const CompileTimeErrorCode('SUPER_INITIALIZER_IN_OBJECT', "");
+      const CompileTimeErrorCode('SUPER_INITIALIZER_IN_OBJECT',
+          "The class 'Object' can't invoke a constructor from a superclass.");
 
   /**
    * 12.11 Instance Creation: It is a static type warning if any of the type
@@ -2024,22 +2307,27 @@
    */
   static const CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS =
       const CompileTimeErrorCode(
-          'TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', "'{0}' does not extend '{1}'");
+          'TYPE_ARGUMENT_NOT_MATCHING_BOUNDS',
+          "'{0}' doesn't extend '{1}'.",
+          "Try using a type that is or is a subclass of '{1}'.");
 
   /**
    * 15.3.1 Typedef: Any self reference, either directly, or recursively via
    * another typedef, is a compile time error.
    */
   static const CompileTimeErrorCode TYPE_ALIAS_CANNOT_REFERENCE_ITSELF =
-      const CompileTimeErrorCode('TYPE_ALIAS_CANNOT_REFERENCE_ITSELF',
-          "Type alias cannot reference itself directly or recursively via another typedef");
+      const CompileTimeErrorCode(
+          'TYPE_ALIAS_CANNOT_REFERENCE_ITSELF',
+          "Typedefs can't reference themselves directly or recursively via "
+          "another typedef.");
 
   /**
-   * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class
+   * 16.12.2 Const: It is a compile-time error if <i>T</i> is not a class
    * accessible in the current scope, optionally followed by type arguments.
    */
   static const CompileTimeErrorCode UNDEFINED_CLASS =
-      const CompileTimeErrorCode('UNDEFINED_CLASS', "Undefined class '{0}'");
+      const CompileTimeErrorCode('UNDEFINED_CLASS', "Undefined class '{0}'.",
+          "Try defining the class.");
 
   /**
    * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the
@@ -2047,10 +2335,17 @@
    * Let <i>k</i> be a generative constructor. It is a compile-time error if
    * class <i>S</i> does not declare a generative constructor named <i>S</i>
    * (respectively <i>S.id</i>)
+   *
+   * Parameters:
+   * 0: the name of the superclass that does not define the invoked constructor
+   * 1: the name of the constructor being invoked
    */
   static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER =
-      const CompileTimeErrorCode('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER',
-          "The class '{0}' does not have a generative constructor '{1}'");
+      const CompileTimeErrorCode(
+          'UNDEFINED_CONSTRUCTOR_IN_INITIALIZER',
+          "The class '{0}' doesn't have a constructor named '{1}'.",
+          "Try defining a constructor named '{1}' in '{0}', or "
+          "invoking a different constructor.");
 
   /**
    * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the
@@ -2058,11 +2353,16 @@
    * Let <i>k</i> be a generative constructor. It is a compile-time error if
    * class <i>S</i> does not declare a generative constructor named <i>S</i>
    * (respectively <i>S.id</i>)
+   *
+   * Parameters:
+   * 0: the name of the superclass that does not define the invoked constructor
    */
   static const CompileTimeErrorCode
       UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT = const CompileTimeErrorCode(
           'UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT',
-          "The class '{0}' does not have a default generative constructor");
+          "The class '{0}' doesn't have an unnamed constructor.",
+          "Try defining an unnamed constructor in '{0}', or "
+          "invoking a different constructor.");
 
   /**
    * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>,
@@ -2070,15 +2370,18 @@
    * {<i>p<sub>n+1</sub></i> ... <i>p<sub>n+k</sub></i>} or a static warning
    * occurs.
    *
-   * 12.11.2 Const: It is a compile-time error if evaluation of a constant
+   * 16.12.2 Const: It is a compile-time error if evaluation of a constant
    * object results in an uncaught exception being thrown.
    *
    * Parameters:
    * 0: the name of the requested named parameter
    */
   static const CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER =
-      const CompileTimeErrorCode('UNDEFINED_NAMED_PARAMETER',
-          "The named parameter '{0}' is not defined");
+      const CompileTimeErrorCode(
+          'UNDEFINED_NAMED_PARAMETER',
+          "The named parameter '{0}' isn't defined.",
+          "Try correcting the name to an existing named parameter's name, or "
+          "defining a named parameter with the name '{0}'.");
 
   /**
    * 14.2 Exports: It is a compile-time error if the compilation unit found at
@@ -2097,7 +2400,10 @@
    */
   static const CompileTimeErrorCode URI_DOES_NOT_EXIST =
       const CompileTimeErrorCode(
-          'URI_DOES_NOT_EXIST', "Target of URI does not exist: '{0}'");
+          'URI_DOES_NOT_EXIST',
+          "Target of URI doesn't exist: '{0}'.",
+          "Try creating the file referenced by the URI, or "
+          "try using a URI for a file that does exist.");
 
   /**
    * Just like [URI_DOES_NOT_EXIST], but used when the URI refers to a file that
@@ -2109,8 +2415,11 @@
    * See [INVALID_URI], [URI_DOES_NOT_EXIST].
    */
   static const CompileTimeErrorCode URI_HAS_NOT_BEEN_GENERATED =
-      const CompileTimeErrorCode('URI_HAS_NOT_BEEN_GENERATED',
-          "Target of URI has not been generated: '{0}'");
+      const CompileTimeErrorCode(
+          'URI_HAS_NOT_BEEN_GENERATED',
+          "Target of URI hasn't been generated: '{0}'.",
+          "Try running the generator that will generate the file referenced by "
+          "the URI.");
 
   /**
    * 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time
@@ -2125,7 +2434,7 @@
    */
   static const CompileTimeErrorCode URI_WITH_INTERPOLATION =
       const CompileTimeErrorCode(
-          'URI_WITH_INTERPOLATION', "URIs cannot use string interpolation");
+          'URI_WITH_INTERPOLATION', "URIs can't use string interpolation.");
 
   /**
    * 7.1.1 Operators: It is a compile-time error if the arity of the
@@ -2143,7 +2452,7 @@
    */
   static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR =
       const CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR',
-          "Operator '{0}' should declare exactly {1} parameter(s), but {2} found");
+          "Operator '{0}' should declare exactly {1} parameter(s), but {2} found.");
 
   /**
    * 7.1.1 Operators: It is a compile time error if the arity of the
@@ -2156,7 +2465,7 @@
       WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS =
       const CompileTimeErrorCode(
           'WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS',
-          "Operator '-' should declare 0 or 1 parameter, but {0} found");
+          "Operator '-' should declare 0 or 1 parameter, but {0} found.");
 
   /**
    * 7.3 Setters: It is a compile-time error if a setter's formal parameter list
@@ -2164,23 +2473,29 @@
    */
   static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER =
       const CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER',
-          "Setters should declare exactly one required parameter");
+          "Setters should declare exactly one required parameter.");
 
   /**
    * ?? Yield: It is a compile-time error if a yield statement appears in a
    * function that is not a generator function.
    */
   static const CompileTimeErrorCode YIELD_EACH_IN_NON_GENERATOR =
-      const CompileTimeErrorCode('YIELD_EACH_IN_NON_GENERATOR',
-          "Yield-each statements must be in a generator function (one marked with either 'async*' or 'sync*')");
+      const CompileTimeErrorCode(
+          'YIELD_EACH_IN_NON_GENERATOR',
+          "Yield-each statements must be in a generator function "
+          "(one marked with either 'async*' or 'sync*').",
+          "Try adding 'async*' or 'sync*' to the enclosing function.");
 
   /**
    * ?? Yield: It is a compile-time error if a yield statement appears in a
    * function that is not a generator function.
    */
   static const CompileTimeErrorCode YIELD_IN_NON_GENERATOR =
-      const CompileTimeErrorCode('YIELD_IN_NON_GENERATOR',
-          "Yield statements must be in a generator function (one marked with either 'async*' or 'sync*')");
+      const CompileTimeErrorCode(
+          'YIELD_IN_NON_GENERATOR',
+          "Yield statements must be in a generator function "
+          "(one marked with either 'async*' or 'sync*').",
+          "Try adding 'async*' or 'sync*' to the enclosing function.");
 
   /**
    * Initialize a newly created error code to have the given [name]. The message
@@ -2199,585 +2514,6 @@
 }
 
 /**
- * The hints and coding recommendations for best practices which are not
- * mentioned in the Dart Language Specification.
- */
-class HintCode extends ErrorCode {
-  /**
-   * When an abstract supertype member is references with `super` as its target,
-   * it cannot be overridden, so it is always a runtime error.
-   *
-   * Parameters:
-   * 0: the display name for the kind of the referenced element
-   * 1: the name of the referenced element
-   */
-  static const HintCode ABSTRACT_SUPER_MEMBER_REFERENCE = const HintCode(
-      'ABSTRACT_SUPER_MEMBER_REFERENCE',
-      "The {0} '{1}' is always abstract in the supertype.",
-      null);
-
-  /**
-   * This hint is generated anywhere where the
-   * [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE] would have been generated,
-   * if we used propagated information for the warnings.
-   *
-   * Parameters:
-   * 0: the name of the actual argument type
-   * 1: the name of the expected type
-   */
-  static const HintCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const HintCode(
-      'ARGUMENT_TYPE_NOT_ASSIGNABLE',
-      "The argument type '{0}' cannot be assigned to the parameter type '{1}'.",
-      null);
-
-  /**
-   * When the target expression uses '?.' operator, it can be `null`, so all the
-   * subsequent invocations should also use '?.' operator.
-   */
-  static const HintCode CAN_BE_NULL_AFTER_NULL_AWARE = const HintCode(
-      'CAN_BE_NULL_AFTER_NULL_AWARE',
-      "The expression uses '?.', so can be 'null'",
-      "Replace the '.' with a '?.' in the invocation");
-
-  /**
-   * Dead code is code that is never reached, this can happen for instance if a
-   * statement follows a return statement.
-   */
-  static const HintCode DEAD_CODE = const HintCode('DEAD_CODE', "Dead code");
-
-  /**
-   * Dead code is code that is never reached. This case covers cases where the
-   * user has catch clauses after `catch (e)` or `on Object catch (e)`.
-   */
-  static const HintCode DEAD_CODE_CATCH_FOLLOWING_CATCH = const HintCode(
-      'DEAD_CODE_CATCH_FOLLOWING_CATCH',
-      "Dead code, catch clauses after a 'catch (e)' or an 'on Object catch (e)' are never reached");
-
-  /**
-   * Dead code is code that is never reached. This case covers cases where the
-   * user has an on-catch clause such as `on A catch (e)`, where a supertype of
-   * `A` was already caught.
-   *
-   * Parameters:
-   * 0: name of the subtype
-   * 1: name of the supertype
-   */
-  static const HintCode DEAD_CODE_ON_CATCH_SUBTYPE = const HintCode(
-      'DEAD_CODE_ON_CATCH_SUBTYPE',
-      "Dead code, this on-catch block will never be executed since '{0}' is a subtype of '{1}'");
-
-  /**
-   * Deprecated members should not be invoked or used.
-   *
-   * Parameters:
-   * 0: the name of the member
-   */
-  static const HintCode DEPRECATED_MEMBER_USE =
-      const HintCode('DEPRECATED_MEMBER_USE', "'{0}' is deprecated");
-
-  /**
-   * Duplicate imports.
-   */
-  static const HintCode DUPLICATE_IMPORT =
-      const HintCode('DUPLICATE_IMPORT', "Duplicate import");
-
-  /**
-   * Hint to use the ~/ operator.
-   */
-  static const HintCode DIVISION_OPTIMIZATION = const HintCode(
-      'DIVISION_OPTIMIZATION',
-      "The operator x ~/ y is more efficient than (x / y).toInt()");
-
-  /**
-   * Hint for the `x is double` type checks.
-   */
-  static const HintCode IS_DOUBLE = const HintCode('IS_DOUBLE',
-      "When compiled to JS, this test might return true when the left hand side is an int");
-
-  /**
-   * Hint for the `x is int` type checks.
-   */
-  static const HintCode IS_INT = const HintCode('IS_INT',
-      "When compiled to JS, this test might return true when the left hand side is a double");
-
-  /**
-   * Hint for the `x is! double` type checks.
-   */
-  static const HintCode IS_NOT_DOUBLE = const HintCode('IS_NOT_DOUBLE',
-      "When compiled to JS, this test might return false when the left hand side is an int");
-
-  /**
-   * Hint for the `x is! int` type checks.
-   */
-  static const HintCode IS_NOT_INT = const HintCode('IS_NOT_INT',
-      "When compiled to JS, this test might return false when the left hand side is a double");
-
-  /**
-   * Deferred libraries shouldn't define a top level function 'loadLibrary'.
-   */
-  static const HintCode IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION = const HintCode(
-      'IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION',
-      "The library '{0}' defines a top-level function named 'loadLibrary' which is hidden by deferring this library");
-
-  /**
-   * This hint is generated anywhere where the
-   * [StaticTypeWarningCode.INVALID_ASSIGNMENT] would have been generated, if we
-   * used propagated information for the warnings.
-   *
-   * Parameters:
-   * 0: the name of the right hand side type
-   * 1: the name of the left hand side type
-   */
-  static const HintCode INVALID_ASSIGNMENT = const HintCode(
-      'INVALID_ASSIGNMENT',
-      "A value of type '{0}' cannot be assigned to a variable of type '{1}'");
-
-  /**
-   * This hint is generated anywhere a @factory annotation is associated with
-   * anything other than a method.
-   */
-  static const HintCode INVALID_FACTORY_ANNOTATION = const HintCode(
-      'INVALID_FACTORY_ANNOTATION',
-      "Only methods can be annotated as factories.");
-
-  /**
-   * This hint is generated anywhere a @factory annotation is associated with
-   * a method that does not declare a return type.
-   */
-  static const HintCode INVALID_FACTORY_METHOD_DECL = const HintCode(
-      'INVALID_FACTORY_METHOD_DECL',
-      "Factory method '{0}' must have a return type.");
-
-  /**
-   * This hint is generated anywhere a @factory annotation is associated with
-   * a non-abstract method that can return anything other than a newly allocated
-   * object.
-   *
-   * Parameters:
-   * 0: the name of the method
-   */
-  static const HintCode INVALID_FACTORY_METHOD_IMPL = const HintCode(
-      'INVALID_FACTORY_METHOD_IMPL',
-      "Factory method '{0}' does not return a newly allocated object.");
-
-  /**
-   * This hint is generated anywhere where a member annotated with `@protected`
-   * is used outside an instance member of a subclass.
-   *
-   * Parameters:
-   * 0: the name of the member
-   * 1: the name of the defining class
-   */
-  static const HintCode INVALID_USE_OF_PROTECTED_MEMBER = const HintCode(
-      'INVALID_USE_OF_PROTECTED_MEMBER',
-      "The member '{0}' can only be used within instance members of subclasses of '{1}'");
-
-  /**
-   * Generate a hint for a constructor, function or method invocation where a
-   * required parameter is missing.
-   *
-   * Parameters:
-   * 0: the name of the parameter
-   */
-  static const HintCode MISSING_REQUIRED_PARAM = const HintCode(
-      'MISSING_REQUIRED_PARAM', "The parameter '{0}' is required.");
-
-  /**
-   * Generate a hint for a constructor, function or method invocation where a
-   * required parameter is missing.
-   *
-   * Parameters:
-   * 0: the name of the parameter
-   * 1: message details
-   */
-  static const HintCode MISSING_REQUIRED_PARAM_WITH_DETAILS = const HintCode(
-      'MISSING_REQUIRED_PARAM_WITH_DETAILS',
-      "The parameter '{0}' is required. {1}");
-
-  /**
-   * Generate a hint for an element that is annotated with `@JS(...)` whose
-   * library declaration is not similarly annotated.
-   */
-  static const HintCode MISSING_JS_LIB_ANNOTATION = const HintCode(
-      'MISSING_JS_LIB_ANNOTATION',
-      "The @JS() annotation can only be used if it is also declared on the library directive.");
-
-  /**
-   * Generate a hint for methods or functions that have a return type, but do
-   * not have a non-void return statement on all branches. At the end of methods
-   * or functions with no return, Dart implicitly returns `null`, avoiding these
-   * implicit returns is considered a best practice.
-   *
-   * Parameters:
-   * 0: the name of the declared return type
-   */
-  static const HintCode MISSING_RETURN = const HintCode(
-      'MISSING_RETURN',
-      "This function declares a return type of '{0}', but does not end with a return statement",
-      "Either add a return statement or change the return type to 'void'");
-
-  /**
-   * Generate a hint for methods that override methods annotated `@mustCallSuper`
-   * that do not invoke the overridden super method.
-   *
-   * Parameters:
-   * 0: the name of the class declaring the overriden method
-   */
-  static const HintCode MUST_CALL_SUPER = const HintCode(
-      'MUST_CALL_SUPER',
-      "This method overrides a method annotated as @mustCall super in '{0}', "
-      "but does invoke the overriden method");
-
-  /**
-   * A condition in a control flow statement could evaluate to `null` because it
-   * uses the null-aware '?.' operator.
-   */
-  static const HintCode NULL_AWARE_IN_CONDITION = const HintCode(
-      'NULL_AWARE_IN_CONDITION',
-      "The value of the '?.' operator can be 'null', which is not appropriate in a condition",
-      "Replace the '?.' with a '.', testing the left-hand side for null if necessary");
-
-  /**
-   * A getter with the override annotation does not override an existing getter.
-   */
-  static const HintCode OVERRIDE_ON_NON_OVERRIDING_GETTER = const HintCode(
-      'OVERRIDE_ON_NON_OVERRIDING_GETTER',
-      "Getter does not override an inherited getter");
-
-  /**
-   * A field with the override annotation does not override a getter or setter.
-   */
-  static const HintCode OVERRIDE_ON_NON_OVERRIDING_FIELD = const HintCode(
-      'OVERRIDE_ON_NON_OVERRIDING_FIELD',
-      "Field does not override an inherited getter or setter");
-
-  /**
-   * A method with the override annotation does not override an existing method.
-   */
-  static const HintCode OVERRIDE_ON_NON_OVERRIDING_METHOD = const HintCode(
-      'OVERRIDE_ON_NON_OVERRIDING_METHOD',
-      "Method does not override an inherited method");
-
-  /**
-   * A setter with the override annotation does not override an existing setter.
-   */
-  static const HintCode OVERRIDE_ON_NON_OVERRIDING_SETTER = const HintCode(
-      'OVERRIDE_ON_NON_OVERRIDING_SETTER',
-      "Setter does not override an inherited setter");
-
-  /**
-   * Hint for classes that override equals, but not hashCode.
-   *
-   * Parameters:
-   * 0: the name of the current class
-   */
-  static const HintCode OVERRIDE_EQUALS_BUT_NOT_HASH_CODE = const HintCode(
-      'OVERRIDE_EQUALS_BUT_NOT_HASH_CODE',
-      "The class '{0}' overrides 'operator==', but not 'get hashCode'");
-
-  /**
-   * Type checks of the type `x is! Null` should be done with `x != null`.
-   */
-  static const HintCode TYPE_CHECK_IS_NOT_NULL = const HintCode(
-      'TYPE_CHECK_IS_NOT_NULL',
-      "Tests for non-null should be done with '!= null'");
-
-  /**
-   * Type checks of the type `x is Null` should be done with `x == null`.
-   */
-  static const HintCode TYPE_CHECK_IS_NULL = const HintCode(
-      'TYPE_CHECK_IS_NULL', "Tests for null should be done with '== null'");
-
-  /**
-   * This hint is generated anywhere where the
-   * [StaticTypeWarningCode.UNDEFINED_GETTER] or
-   * [StaticWarningCode.UNDEFINED_GETTER] would have been generated, if we used
-   * propagated information for the warnings.
-   *
-   * Parameters:
-   * 0: the name of the getter
-   * 1: the name of the enclosing type where the getter is being looked for
-   */
-  static const HintCode UNDEFINED_GETTER = const HintCode('UNDEFINED_GETTER',
-      "The getter '{0}' is not defined for the class '{1}'.", null);
-
-  /**
-   * An undefined name hidden in an import or export directive.
-   */
-  static const HintCode UNDEFINED_HIDDEN_NAME = const HintCode(
-      'UNDEFINED_HIDDEN_NAME',
-      "The library '{0}' doesn't export a member with the hidden name '{1}'");
-
-  /**
-   * This hint is generated anywhere where the
-   * [StaticTypeWarningCode.UNDEFINED_METHOD] would have been generated, if we
-   * used propagated information for the warnings.
-   *
-   * Parameters:
-   * 0: the name of the method that is undefined
-   * 1: the resolved type name that the method lookup is happening on
-   */
-  static const HintCode UNDEFINED_METHOD = const HintCode('UNDEFINED_METHOD',
-      "The method '{0}' is not defined for the class '{1}'.", null);
-
-  /**
-   * This hint is generated anywhere where the
-   * [StaticTypeWarningCode.UNDEFINED_OPERATOR] would have been generated, if we
-   * used propagated information for the warnings.
-   *
-   * Parameters:
-   * 0: the name of the operator
-   * 1: the name of the enclosing type where the operator is being looked for
-   */
-  static const HintCode UNDEFINED_OPERATOR = const HintCode(
-      'UNDEFINED_OPERATOR',
-      "The operator '{0}' is not defined for the class '{1}'.",
-      null);
-
-  /**
-   * This hint is generated anywhere where the
-   * [StaticTypeWarningCode.UNDEFINED_SETTER] or
-   * [StaticWarningCode.UNDEFINED_SETTER] would have been generated, if we used
-   * propagated information for the warnings.
-   *
-   * Parameters:
-   * 0: the name of the setter
-   * 1: the name of the enclosing type where the setter is being looked for
-   */
-  static const HintCode UNDEFINED_SETTER = const HintCode('UNDEFINED_SETTER',
-      "The setter '{0}' is not defined for the class '{1}'.", null);
-
-  /**
-   * An undefined name shown in an import or export directive.
-   */
-  static const HintCode UNDEFINED_SHOWN_NAME = const HintCode(
-      'UNDEFINED_SHOWN_NAME',
-      "The library '{0}' doesn't export a member with the shown name '{1}'");
-
-  /**
-   * Unnecessary cast.
-   */
-  static const HintCode UNNECESSARY_CAST =
-      const HintCode('UNNECESSARY_CAST', "Unnecessary cast");
-
-  /**
-   * Unnecessary `noSuchMethod` declaration.
-   */
-  static const HintCode UNNECESSARY_NO_SUCH_METHOD = const HintCode(
-      'UNNECESSARY_NO_SUCH_METHOD', "Unnecessary 'noSuchMethod' declaration");
-
-  /**
-   * Unnecessary type checks, the result is always true.
-   */
-  static const HintCode UNNECESSARY_TYPE_CHECK_FALSE = const HintCode(
-      'UNNECESSARY_TYPE_CHECK_FALSE',
-      "Unnecessary type check, the result is always false");
-
-  /**
-   * Unnecessary type checks, the result is always false.
-   */
-  static const HintCode UNNECESSARY_TYPE_CHECK_TRUE = const HintCode(
-      'UNNECESSARY_TYPE_CHECK_TRUE',
-      "Unnecessary type check, the result is always true");
-
-  /**
-   * See [Modifier.IS_USED_IN_LIBRARY].
-   */
-  static const HintCode UNUSED_ELEMENT =
-      const HintCode('UNUSED_ELEMENT', "The {0} '{1}' is not used");
-
-  /**
-   * Unused fields are fields which are never read.
-   */
-  static const HintCode UNUSED_FIELD = const HintCode(
-      'UNUSED_FIELD', "The value of the field '{0}' is not used");
-
-  /**
-   * Unused imports are imports which are never used.
-   */
-  static const HintCode UNUSED_IMPORT =
-      const HintCode('UNUSED_IMPORT', "Unused import");
-
-  /**
-   * Unused catch exception variables.
-   */
-  static const HintCode UNUSED_CATCH_CLAUSE = const HintCode(
-      'UNUSED_CATCH_CLAUSE',
-      "The exception variable '{0}' is not used, so the 'catch' clause can be removed");
-
-  /**
-   * Unused catch stack trace variables.
-   */
-  static const HintCode UNUSED_CATCH_STACK = const HintCode(
-      'UNUSED_CATCH_STACK',
-      "The stack trace variable '{0}' is not used and can be removed");
-
-  /**
-   * Unused local variables are local variables which are never read.
-   */
-  static const HintCode UNUSED_LOCAL_VARIABLE = const HintCode(
-      'UNUSED_LOCAL_VARIABLE',
-      "The value of the local variable '{0}' is not used");
-
-  /**
-   * Unused shown names are names shown on imports which are never used.
-   */
-  static const HintCode UNUSED_SHOWN_NAME = const HintCode(
-      'UNUSED_SHOWN_NAME', "The name {0} is shown, but not used.");
-
-  /**
-   * Hint for cases where the source expects a method or function to return a
-   * non-void result, but the method or function signature returns void.
-   *
-   * Parameters:
-   * 0: the name of the method or function that returns void
-   */
-  static const HintCode USE_OF_VOID_RESULT = const HintCode(
-      'USE_OF_VOID_RESULT',
-      "The result of '{0}' is being used, even though it is declared to be 'void'");
-
-  /**
-   * It is a bad practice for a source file in a package "lib" directory
-   * hierarchy to traverse outside that directory hierarchy. For example, a
-   * source file in the "lib" directory should not contain a directive such as
-   * `import '../web/some.dart'` which references a file outside the lib
-   * directory.
-   */
-  static const HintCode FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE =
-      const HintCode('FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE',
-          "A file in the 'lib' directory hierarchy should not reference a file outside that hierarchy");
-
-  /**
-   * It is a bad practice for a source file ouside a package "lib" directory
-   * hierarchy to traverse into that directory hierarchy. For example, a source
-   * file in the "web" directory should not contain a directive such as
-   * `import '../lib/some.dart'` which references a file inside the lib
-   * directory.
-   */
-  static const HintCode FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE =
-      const HintCode('FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE',
-          "A file outside the 'lib' directory hierarchy should not reference a file inside that hierarchy. Use a package: reference instead.");
-
-  /**
-   * It is a bad practice for a package import to reference anything outside the
-   * given package, or more generally, it is bad practice for a package import
-   * to contain a "..". For example, a source file should not contain a
-   * directive such as `import 'package:foo/../some.dart'`.
-   */
-  static const HintCode PACKAGE_IMPORT_CONTAINS_DOT_DOT = const HintCode(
-      'PACKAGE_IMPORT_CONTAINS_DOT_DOT',
-      "A package import should not contain '..'");
-
-  /**
-   * Initialize a newly created error code to have the given [name]. The message
-   * associated with the error will be created from the given [message]
-   * template. The correction associated with the error will be created from the
-   * given [correction] template.
-   */
-  const HintCode(String name, String message, [String correction])
-      : super(name, message, correction);
-
-  @override
-  ErrorSeverity get errorSeverity => ErrorType.HINT.severity;
-
-  @override
-  ErrorType get type => ErrorType.HINT;
-}
-
-/**
- * The error codes used for errors in HTML files. The convention for this
- * class is for the name of the error code to indicate the problem that caused
- * the error to be generated and for the error message to explain what is wrong
- * and, when appropriate, how the problem can be corrected.
- */
-class HtmlErrorCode extends ErrorCode {
-  /**
-   * An error code indicating that there is a syntactic error in the file.
-   *
-   * Parameters:
-   * 0: the error message from the parse error
-   */
-  static const HtmlErrorCode PARSE_ERROR =
-      const HtmlErrorCode('PARSE_ERROR', '{0}');
-
-  /**
-   * Initialize a newly created error code to have the given [name]. The message
-   * associated with the error will be created from the given [message]
-   * template. The correction associated with the error will be created from the
-   * given [correction] template.
-   */
-  const HtmlErrorCode(String name, String message, [String correction])
-      : super(name, message, correction);
-
-  @override
-  ErrorSeverity get errorSeverity => ErrorSeverity.ERROR;
-
-  @override
-  ErrorType get type => ErrorType.COMPILE_TIME_ERROR;
-}
-
-/**
- * The error codes used for warnings in HTML files. The convention for this
- * class is for the name of the error code to indicate the problem that caused
- * the error to be generated and for the error message to explain what is wrong
- * and, when appropriate, how the problem can be corrected.
- */
-class HtmlWarningCode extends ErrorCode {
-  /**
-   * An error code indicating that the value of the 'src' attribute of a Dart
-   * script tag is not a valid URI.
-   *
-   * Parameters:
-   * 0: the URI that is invalid
-   */
-  static const HtmlWarningCode INVALID_URI =
-      const HtmlWarningCode('INVALID_URI', "Invalid URI syntax: '{0}'");
-
-  /**
-   * An error code indicating that the value of the 'src' attribute of a Dart
-   * script tag references a file that does not exist.
-   *
-   * Parameters:
-   * 0: the URI pointing to a non-existent file
-   */
-  static const HtmlWarningCode URI_DOES_NOT_EXIST = const HtmlWarningCode(
-      'URI_DOES_NOT_EXIST', "Target of URI does not exist: '{0}'");
-
-  /**
-   * Initialize a newly created error code to have the given [name]. The message
-   * associated with the error will be created from the given [message]
-   * template. The correction associated with the error will be created from the
-   * given [correction] template.
-   */
-  const HtmlWarningCode(String name, String message, [String correction])
-      : super(name, message, correction);
-
-  @override
-  ErrorSeverity get errorSeverity => ErrorSeverity.WARNING;
-
-  @override
-  ErrorType get type => ErrorType.STATIC_WARNING;
-}
-
-/**
- * Defines style and best practice recommendations.
- *
- * Unlike [HintCode]s, which are akin to traditional static warnings from a
- * compiler, lint recommendations focus on matters of style and practices that
- * might aggregated to define a project's style guide.
- */
-class LintCode extends ErrorCode {
-  const LintCode(String name, String message, [String correction])
-      : super(name, message, correction);
-
-  @override
-  ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
-
-  @override
-  ErrorType get type => ErrorType.LINT;
-}
-
-/**
  * The error codes used for static type warnings. The convention for this class
  * is for the name of the error code to indicate the problem that caused the
  * error to be generated and for the error message to explain what is wrong and,
@@ -2792,8 +2528,11 @@
    * 0: the number of provided type arguments
    */
   static const StaticTypeWarningCode EXPECTED_ONE_LIST_TYPE_ARGUMENTS =
-      const StaticTypeWarningCode('EXPECTED_ONE_LIST_TYPE_ARGUMENTS',
-          "List literal requires exactly one type arguments or none, but {0} found");
+      const StaticTypeWarningCode(
+          'EXPECTED_ONE_LIST_TYPE_ARGUMENTS',
+          "List literals require exactly one type argument or none, "
+          "but {0} found.",
+          "Try adjusting the number of type arguments.");
 
   /**
    * 12.8 Maps: A fresh instance (7.6.1) <i>m</i>, of size <i>n</i>, whose class
@@ -2803,42 +2542,46 @@
    * 0: the number of provided type arguments
    */
   static const StaticTypeWarningCode EXPECTED_TWO_MAP_TYPE_ARGUMENTS =
-      const StaticTypeWarningCode('EXPECTED_TWO_MAP_TYPE_ARGUMENTS',
-          "Map literal requires exactly two type arguments or none, but {0} found");
+      const StaticTypeWarningCode(
+          'EXPECTED_TWO_MAP_TYPE_ARGUMENTS',
+          "Map literals require exactly two type arguments or none, "
+          "but {0} found.",
+          "Try adjusting the number of type arguments.");
 
   /**
    * 9 Functions: It is a static warning if the declared return type of a
    * function marked async* may not be assigned to Stream.
    */
   static const StaticTypeWarningCode ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE =
-      const StaticTypeWarningCode('ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE',
-          "Functions marked 'async*' must have a return type assignable to 'Stream'");
+      const StaticTypeWarningCode(
+          'ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE',
+          "Functions marked 'async*' must have a return type assignable to "
+          "'Stream'.",
+          "Try fixing the return type of the function, or "
+          "removing the modifier 'async*' from the function body.");
 
   /**
    * 9 Functions: It is a static warning if the declared return type of a
    * function marked async may not be assigned to Future.
    */
   static const StaticTypeWarningCode ILLEGAL_ASYNC_RETURN_TYPE =
-      const StaticTypeWarningCode('ILLEGAL_ASYNC_RETURN_TYPE',
-          "Functions marked 'async' must have a return type assignable to 'Future'");
+      const StaticTypeWarningCode(
+          'ILLEGAL_ASYNC_RETURN_TYPE',
+          "Functions marked 'async' must have a return type assignable to "
+          "'Future'.",
+          "Try fixing the return type of the function, or "
+          "removing the modifier 'async' from the function body.");
 
   /**
    * 9 Functions: It is a static warning if the declared return type of a
    * function marked sync* may not be assigned to Iterable.
    */
   static const StaticTypeWarningCode ILLEGAL_SYNC_GENERATOR_RETURN_TYPE =
-      const StaticTypeWarningCode('ILLEGAL_SYNC_GENERATOR_RETURN_TYPE',
-          "Functions marked 'sync*' must have a return type assignable to 'Iterable'");
-
-  /**
-   * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
-   * It is a static type warning if <i>T</i> does not have an accessible
-   * instance setter named <i>v=</i>.
-   *
-   * See [UNDEFINED_SETTER].
-   */
-  static const StaticTypeWarningCode INACCESSIBLE_SETTER =
-      const StaticTypeWarningCode('INACCESSIBLE_SETTER', "");
+      const StaticTypeWarningCode(
+          'ILLEGAL_SYNC_GENERATOR_RETURN_TYPE',
+          "Functions marked 'sync*' must have a return type assignable to 'Iterable'.",
+          "Try fixing the return type of the function, or "
+          "removing the modifier 'sync*' from the function body.");
 
   /**
    * 8.1.1 Inheritance and Overriding: However, if the above rules would cause
@@ -2869,8 +2612,11 @@
    *   m<sub>k</sub></i> is inherited.
    */
   static const StaticTypeWarningCode INCONSISTENT_METHOD_INHERITANCE =
-      const StaticTypeWarningCode('INCONSISTENT_METHOD_INHERITANCE',
-          "'{0}' is inherited by at least two interfaces inconsistently, from {1}");
+      const StaticTypeWarningCode(
+          'INCONSISTENT_METHOD_INHERITANCE',
+          "Inconsistent declarations of '{0}' are inherited from {1}.",
+          "Try adjusting the supertypes of this class to remove the "
+          "inconsistency.");
 
   /**
    * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does
@@ -2878,12 +2624,16 @@
    *
    * Parameters:
    * 0: the name of the static member
+   * 1: the kind of the static member (field, getter, setter, or method)
+   * 2: the name of the defining class
    *
    * See [UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER].
    */
   static const StaticTypeWarningCode INSTANCE_ACCESS_TO_STATIC_MEMBER =
-      const StaticTypeWarningCode('INSTANCE_ACCESS_TO_STATIC_MEMBER',
-          "Static member '{0}' cannot be accessed using instance access");
+      const StaticTypeWarningCode(
+          'INSTANCE_ACCESS_TO_STATIC_MEMBER',
+          "Static {1} '{0}' can't be accessed through an instance.",
+          "Try using the class '{2}' to access the {1}.");
 
   /**
    * 12.18 Assignment: It is a static type warning if the static type of
@@ -2903,8 +2653,11 @@
    * 1: the name of the left hand side type
    */
   static const StaticTypeWarningCode INVALID_ASSIGNMENT =
-      const StaticTypeWarningCode('INVALID_ASSIGNMENT',
-          "A value of type '{0}' cannot be assigned to a variable of type '{1}'");
+      const StaticTypeWarningCode(
+          'INVALID_ASSIGNMENT',
+          "A value of type '{0}' can't be assigned to a variable of type '{1}'.",
+          "Try changing the type of the variable, or "
+          "casting the right-hand type to '{1}'.");
 
   /**
    * 12.15.1 Ordinary Invocation: An ordinary method invocation <i>i</i> has the
@@ -2932,7 +2685,12 @@
    */
   static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION =
       const StaticTypeWarningCode(
-          'INVOCATION_OF_NON_FUNCTION', "'{0}' is not a method");
+          'INVOCATION_OF_NON_FUNCTION',
+          "'{0}' isn't a function.",
+          // TODO(brianwilkerson) Split this error code so that we can provide
+          // better error and correction messages.
+          "Try correcting the name to match an existing function, or "
+          "define a method or function named '{0}'.");
 
   /**
    * 12.14.4 Function Expression Invocation: A function expression invocation
@@ -2945,7 +2703,7 @@
    */
   static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION_EXPRESSION =
       const StaticTypeWarningCode('INVOCATION_OF_NON_FUNCTION_EXPRESSION',
-          "Cannot invoke a non-function");
+          "The expression doesn't evaluate to a function, so it can't invoked.");
 
   /**
    * 12.20 Conditional: It is a static type warning if the type of
@@ -2962,15 +2720,19 @@
    */
   static const StaticTypeWarningCode NON_BOOL_CONDITION =
       const StaticTypeWarningCode(
-          'NON_BOOL_CONDITION', "Conditions must have a static type of 'bool'");
+          'NON_BOOL_CONDITION',
+          "Conditions must have a static type of 'bool'.",
+          "Try changing the condition.");
 
   /**
    * 13.15 Assert: It is a static type warning if the type of <i>e</i> may not
    * be assigned to either bool or () &rarr; bool
    */
   static const StaticTypeWarningCode NON_BOOL_EXPRESSION =
-      const StaticTypeWarningCode('NON_BOOL_EXPRESSION',
-          "Assertions must be on either a 'bool' or '() -> bool'");
+      const StaticTypeWarningCode(
+          'NON_BOOL_EXPRESSION',
+          "Assertions must be on either a 'bool' or '() -> bool'.",
+          "Try changing the expression.");
 
   /**
    * 12.28 Unary Expressions: The expression !<i>e</i> is equivalent to the
@@ -2980,8 +2742,10 @@
    * <i>e<sub>1</sub></i> may not be assigned to bool.
    */
   static const StaticTypeWarningCode NON_BOOL_NEGATION_EXPRESSION =
-      const StaticTypeWarningCode('NON_BOOL_NEGATION_EXPRESSION',
-          "Negation argument must have a static type of 'bool'");
+      const StaticTypeWarningCode(
+          'NON_BOOL_NEGATION_EXPRESSION',
+          "Negation argument must have a static type of 'bool'.",
+          "Try changing the argument to the '!' operator.");
 
   /**
    * 12.21 Logical Boolean Expressions: It is a static type warning if the
@@ -2993,19 +2757,30 @@
    */
   static const StaticTypeWarningCode NON_BOOL_OPERAND =
       const StaticTypeWarningCode('NON_BOOL_OPERAND',
-          "The operands of the '{0}' operator must be assignable to 'bool'");
+          "The operands of the '{0}' operator must be assignable to 'bool'.");
 
+  /**
+   * Parameters:
+   * 0: the name of the variable
+   * 1: the type of the variable
+   */
   static const StaticTypeWarningCode NON_NULLABLE_FIELD_NOT_INITIALIZED =
-      const StaticTypeWarningCode('NON_NULLABLE_FIELD_NOT_INITIALIZED',
-          "Variable '{0}' of non-nullable type '{1}' must be initialized");
+      const StaticTypeWarningCode(
+          'NON_NULLABLE_FIELD_NOT_INITIALIZED',
+          "Variable '{0}' of non-nullable type '{1}' must be initialized.",
+          "Try adding an initializer to the declaration, or "
+          "making the variable nullable by adding a '?' after the type name.");
 
   /**
    * 15.8 Parameterized Types: It is a static type warning if <i>A<sub>i</sub>,
    * 1 &lt;= i &lt;= n</i> does not denote a type in the enclosing lexical scope.
    */
   static const StaticTypeWarningCode NON_TYPE_AS_TYPE_ARGUMENT =
-      const StaticTypeWarningCode('NON_TYPE_AS_TYPE_ARGUMENT',
-          "The name '{0}' is not a type and cannot be used as a parameterized type");
+      const StaticTypeWarningCode(
+          'NON_TYPE_AS_TYPE_ARGUMENT',
+          "The name '{0}' isn't a type so it can't be used as a type argument.",
+          "Try correcting the name to an existing type, or "
+          "defining a type named '{0}'.");
 
   /**
    * 13.11 Return: It is a static type warning if the type of <i>e</i> may not
@@ -3018,10 +2793,8 @@
    * 2: the name of the method
    */
   static const StaticTypeWarningCode RETURN_OF_INVALID_TYPE =
-      const StaticTypeWarningCode(
-          'RETURN_OF_INVALID_TYPE',
-          "The return type '{0}' is not a '{1}', as defined by the method '{2}'.",
-          null);
+      const StaticTypeWarningCode('RETURN_OF_INVALID_TYPE',
+          "The return type '{0}' isn't a '{1}', as defined by the method '{2}'.");
 
   /**
    * 12.11 Instance Creation: It is a static type warning if any of the type
@@ -3053,7 +2826,9 @@
    */
   static const StaticTypeWarningCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS =
       const StaticTypeWarningCode(
-          'TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', "'{0}' does not extend '{1}'");
+          'TYPE_ARGUMENT_NOT_MATCHING_BOUNDS',
+          "'{0}' doesn't extend '{1}'.",
+          "Try using a type that is or is a subclass of '{1}'.");
 
   /**
    * 10 Generics: It is a static type warning if a type parameter is a supertype
@@ -3061,12 +2836,15 @@
    *
    * Parameters:
    * 0: the name of the type parameter
+   * 1: the name of the bounding type
    *
    * See [TYPE_ARGUMENT_NOT_MATCHING_BOUNDS].
    */
   static const StaticTypeWarningCode TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND =
-      const StaticTypeWarningCode('TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND',
-          "'{0}' cannot be a supertype of its upper bound");
+      const StaticTypeWarningCode(
+          'TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND',
+          "'{0}' can't be a supertype of its upper bound.",
+          "Try using a type that is or is a subclass of '{1}'.");
 
   /**
    * 12.17 Getter Invocation: It is a static warning if there is no class
@@ -3078,8 +2856,11 @@
    * 1: the name of the enumeration used to access the constant
    */
   static const StaticTypeWarningCode UNDEFINED_ENUM_CONSTANT =
-      const StaticTypeWarningCode('UNDEFINED_ENUM_CONSTANT',
-          "There is no constant named '{0}' in '{1}'.", null);
+      const StaticTypeWarningCode(
+          'UNDEFINED_ENUM_CONSTANT',
+          "There is no constant named '{0}' in '{1}'.",
+          "Try correcting the name to the name of an existing constant, or "
+          "defining a constant named '{0}'.");
 
   /**
    * 12.15.3 Unqualified Invocation: If there exists a lexically visible
@@ -3095,7 +2876,11 @@
    */
   static const StaticTypeWarningCode UNDEFINED_FUNCTION =
       const StaticTypeWarningCode(
-          'UNDEFINED_FUNCTION', "The function '{0}' is not defined.", null);
+          'UNDEFINED_FUNCTION',
+          "The function '{0}' isn't defined.",
+          "Try importing the library that defines '{0}', "
+          "correcting the name to the name of an existing function, or "
+          "defining a funtion named '{0}'.");
 
   /**
    * 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is
@@ -3106,8 +2891,12 @@
    * 1: the name of the enclosing type where the getter is being looked for
    */
   static const StaticTypeWarningCode UNDEFINED_GETTER =
-      const StaticTypeWarningCode('UNDEFINED_GETTER',
-          "The getter '{0}' is not defined for the class '{1}'.", null);
+      const StaticTypeWarningCode(
+          'UNDEFINED_GETTER',
+          "The getter '{0}' isn't defined for the class '{1}'.",
+          "Try importing the library that defines '{0}', "
+          "correcting the name to the name of an existing getter, or "
+          "defining a getter or field named '{0}'.");
 
   /**
    * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>.
@@ -3119,8 +2908,11 @@
    * 1: the resolved type name that the method lookup is happening on
    */
   static const StaticTypeWarningCode UNDEFINED_METHOD =
-      const StaticTypeWarningCode('UNDEFINED_METHOD',
-          "The method '{0}' is not defined for the class '{1}'.", null);
+      const StaticTypeWarningCode(
+          'UNDEFINED_METHOD',
+          "The method '{0}' isn't defined for the class '{1}'.",
+          "Try correcting the name to the name of an existing method, or "
+          "defining a method named '{0}'.");
 
   /**
    * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>.
@@ -3134,8 +2926,9 @@
   static const StaticTypeWarningCode UNDEFINED_METHOD_WITH_CONSTRUCTOR =
       const StaticTypeWarningCode(
           'UNDEFINED_METHOD_WITH_CONSTRUCTOR',
-          "The method '{0}' is not defined for the class '{1}', but a constructor with that name is defined.",
-          "Try adding 'new' or 'const' to invoke the constuctor, or change the method name.");
+          "The method '{0}' isn't defined for the class '{1}', but a constructor with that name is defined.",
+          "Try adding 'new' or 'const' to invoke the constuctor, or "
+          "correcting the name to the name of an existing method.");
 
   /**
    * 12.18 Assignment: Evaluation of an assignment of the form
@@ -3158,8 +2951,10 @@
    * 1: the name of the enclosing type where the operator is being looked for
    */
   static const StaticTypeWarningCode UNDEFINED_OPERATOR =
-      const StaticTypeWarningCode('UNDEFINED_OPERATOR',
-          "The operator '{0}' is not defined for the class '{1}'.", null);
+      const StaticTypeWarningCode(
+          'UNDEFINED_OPERATOR',
+          "The operator '{0}' isn't defined for the class '{1}'.",
+          "Try defining the operator '{0}'.");
 
   /**
    * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
@@ -3169,12 +2964,14 @@
    * Parameters:
    * 0: the name of the setter
    * 1: the name of the enclosing type where the setter is being looked for
-   *
-   * See [INACCESSIBLE_SETTER].
    */
   static const StaticTypeWarningCode UNDEFINED_SETTER =
-      const StaticTypeWarningCode('UNDEFINED_SETTER',
-          "The setter '{0}' is not defined for the class '{1}'.", null);
+      const StaticTypeWarningCode(
+          'UNDEFINED_SETTER',
+          "The setter '{0}' isn't defined for the class '{1}'.",
+          "Try importing the library that defines '{0}', "
+          "correcting the name to the name of an existing setter, or "
+          "defining a setter or field named '{0}'.");
 
   /**
    * 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is
@@ -3185,8 +2982,11 @@
    * 1: the name of the enclosing type where the getter is being looked for
    */
   static const StaticTypeWarningCode UNDEFINED_SUPER_GETTER =
-      const StaticTypeWarningCode('UNDEFINED_SUPER_GETTER',
-          "The getter '{0}' is not defined in a superclass of '{1}'.", null);
+      const StaticTypeWarningCode(
+          'UNDEFINED_SUPER_GETTER',
+          "The getter '{0}' isn't defined in a superclass of '{1}'.",
+          "Try correcting the name to the name of an existing getter, or "
+          "defining a getter or field named '{0}' in a superclass.");
 
   /**
    * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form
@@ -3200,8 +3000,11 @@
    * 1: the resolved type name that the method lookup is happening on
    */
   static const StaticTypeWarningCode UNDEFINED_SUPER_METHOD =
-      const StaticTypeWarningCode('UNDEFINED_SUPER_METHOD',
-          "The method '{0}' is not defined in a superclass of '{1}'.", null);
+      const StaticTypeWarningCode(
+          'UNDEFINED_SUPER_METHOD',
+          "The method '{0}' isn't defined in a superclass of '{1}'.",
+          "Try correcting the name to the name of an existing method, or "
+          "defining a method named '{0}' in a superclass.");
 
   /**
    * 12.18 Assignment: Evaluation of an assignment of the form
@@ -3224,8 +3027,10 @@
    * 1: the name of the enclosing type where the operator is being looked for
    */
   static const StaticTypeWarningCode UNDEFINED_SUPER_OPERATOR =
-      const StaticTypeWarningCode('UNDEFINED_SUPER_OPERATOR',
-          "The operator '{0}' is not defined in a superclass of '{1}'.", null);
+      const StaticTypeWarningCode(
+          'UNDEFINED_SUPER_OPERATOR',
+          "The operator '{0}' isn't defined in a superclass of '{1}'.",
+          "Try defining the operator '{0}' in a superclass.");
 
   /**
    * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
@@ -3235,12 +3040,13 @@
    * Parameters:
    * 0: the name of the setter
    * 1: the name of the enclosing type where the setter is being looked for
-   *
-   * See [INACCESSIBLE_SETTER].
    */
   static const StaticTypeWarningCode UNDEFINED_SUPER_SETTER =
-      const StaticTypeWarningCode('UNDEFINED_SUPER_SETTER',
-          "The setter '{0}' is not defined in a superclass of '{1}'.", null);
+      const StaticTypeWarningCode(
+          'UNDEFINED_SUPER_SETTER',
+          "The setter '{0}' isn't defined in a superclass of '{1}'.",
+          "Try correcting the name to the name of an existing setter, or "
+          "defining a setter or field named '{0}' in a superclass.");
 
   /**
    * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does
@@ -3249,12 +3055,16 @@
    * This is a specialization of [INSTANCE_ACCESS_TO_STATIC_MEMBER] that is used
    * when we are able to find the name defined in a supertype. It exists to
    * provide a more informative error message.
+   *
+   * Parameters:
+   * 0: the name of the defining type
    */
   static const StaticTypeWarningCode
       UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER =
       const StaticTypeWarningCode(
           'UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER',
-          "Static members from supertypes must be qualified by the name of the defining type");
+          "Static members from supertypes must be qualified by the name of the defining type.",
+          "Try adding '{0}.' before the name.");
 
   /**
    * 15.8 Parameterized Types: It is a static type warning if <i>G</i> is not a
@@ -3269,8 +3079,27 @@
    * [CompileTimeErrorCode.NEW_WITH_INVALID_TYPE_PARAMETERS].
    */
   static const StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS =
-      const StaticTypeWarningCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS',
-          "The type '{0}' is declared with {1} type parameters, but {2} type arguments were given");
+      const StaticTypeWarningCode(
+          'WRONG_NUMBER_OF_TYPE_ARGUMENTS',
+          "The type '{0}' is declared with {1} type parameters, "
+          "but {2} type arguments were given.",
+          "Try adjusting the number of type arguments.");
+
+  /**
+   * It will be a static type warning if <i>m</i> is not a generic method with
+   * exactly <i>n</i> type parameters.
+   *
+   * Parameters:
+   * 0: the name of the method being referenced (<i>G</i>)
+   * 1: the number of type parameters that were declared
+   * 2: the number of type arguments provided
+   */
+  static const StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD =
+      const StaticTypeWarningCode(
+          'WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD',
+          "The method '{0}' is declared with {1} type parameters, "
+          "but {2} type arguments were given.",
+          "Try adjusting the number of type arguments.");
 
   /**
    * 17.16.1 Yield: Let T be the static type of e [the expression to the right
@@ -3291,8 +3120,10 @@
    * T may not be assigned to Stream.
    */
   static const StaticTypeWarningCode YIELD_OF_INVALID_TYPE =
-      const StaticTypeWarningCode('YIELD_OF_INVALID_TYPE',
-          "The type '{0}' implied by the 'yield' expression must be assignable to '{1}'");
+      const StaticTypeWarningCode(
+          'YIELD_OF_INVALID_TYPE',
+          "The type '{0}' implied by the 'yield' expression must be assignable "
+          "to '{1}'.");
 
   /**
    * 17.6.2 For-in. If the iterable expression does not implement Iterable,
@@ -3304,7 +3135,7 @@
    */
   static const StaticTypeWarningCode FOR_IN_OF_INVALID_TYPE =
       const StaticTypeWarningCode('FOR_IN_OF_INVALID_TYPE',
-          "The type '{0}' used in the 'for' loop must implement {1}");
+          "The type '{0}' used in the 'for' loop must implement {1}.");
 
   /**
    * 17.6.2 For-in. It the iterable expression does not implement Iterable with
@@ -3317,8 +3148,10 @@
    * 2: The loop variable type.
    */
   static const StaticTypeWarningCode FOR_IN_OF_INVALID_ELEMENT_TYPE =
-      const StaticTypeWarningCode('FOR_IN_OF_INVALID_ELEMENT_TYPE',
-          "The type '{0}' used in the 'for' loop must implement {1} with a type argument that can be assigned to '{2}'");
+      const StaticTypeWarningCode(
+          'FOR_IN_OF_INVALID_ELEMENT_TYPE',
+          "The type '{0}' used in the 'for' loop must implement {1} with a "
+          "type argument that can be assigned to '{2}'.");
 
   /**
    * Initialize a newly created error code to have the given [name]. The message
@@ -3359,9 +3192,9 @@
    */
   static const StaticWarningCode AMBIGUOUS_IMPORT = const StaticWarningCode(
       'AMBIGUOUS_IMPORT',
-      "The name '{0}' is defined in the libraries {1}",
-      "Consider using 'as prefix' for one of the import directives "
-      "or hiding the name from all but one of the imports.");
+      "The name '{0}' is defined in the libraries {1}.",
+      "Try using 'as prefix' for one of the import directives, or "
+      "hiding the name from all but one of the imports.");
 
   /**
    * 12.11.1 New: It is a static warning if the static type of <i>a<sub>i</sub>,
@@ -3369,7 +3202,7 @@
    * corresponding formal parameter of the constructor <i>T.id</i> (respectively
    * <i>T</i>).
    *
-   * 12.11.2 Const: It is a static warning if the static type of
+   * 16.12.2 Const: It is a static warning if the static type of
    * <i>a<sub>i</sub>, 1 &lt;= i &lt;= n+ k</i> may not be assigned to the type
    * of the corresponding formal parameter of the constructor <i>T.id</i>
    * (respectively <i>T</i>).
@@ -3393,10 +3226,8 @@
    * 1: the name of the expected type
    */
   static const StaticWarningCode ARGUMENT_TYPE_NOT_ASSIGNABLE =
-      const StaticWarningCode(
-          'ARGUMENT_TYPE_NOT_ASSIGNABLE',
-          "The argument type '{0}' cannot be assigned to the parameter type '{1}'.",
-          null);
+      const StaticWarningCode('ARGUMENT_TYPE_NOT_ASSIGNABLE',
+          "The argument type '{0}' can't be assigned to the parameter type '{1}'.");
 
   /**
    * 5 Variables: Attempting to assign to a final variable elsewhere will cause
@@ -3406,7 +3237,10 @@
    * A constant variable is always implicitly final.
    */
   static const StaticWarningCode ASSIGNMENT_TO_CONST = const StaticWarningCode(
-      'ASSIGNMENT_TO_CONST', "Constant variables cannot be assigned a value");
+      'ASSIGNMENT_TO_CONST',
+      "Constant variables can't be assigned a value.",
+      "Try removing the assignment, or "
+      "remove the modifier 'const' from the variable.");
 
   /**
    * 5 Variables: Attempting to assign to a final variable elsewhere will cause
@@ -3414,7 +3248,9 @@
    * assignment will also give rise to a static warning for the same reason.
    */
   static const StaticWarningCode ASSIGNMENT_TO_FINAL = const StaticWarningCode(
-      'ASSIGNMENT_TO_FINAL', "'{0}' cannot be used as a setter, it is final");
+      'ASSIGNMENT_TO_FINAL',
+      "'{0}' can't be used as a setter because it is final.",
+      "Try finding a different setter, or making '{0}' non-final.");
 
   /**
    * 5 Variables: Attempting to assign to a final variable elsewhere will cause
@@ -3422,8 +3258,11 @@
    * assignment will also give rise to a static warning for the same reason.
    */
   static const StaticWarningCode ASSIGNMENT_TO_FINAL_NO_SETTER =
-      const StaticWarningCode('ASSIGNMENT_TO_FINAL_NO_SETTER',
-          "No setter named '{0}' in class '{1}'");
+      const StaticWarningCode(
+          'ASSIGNMENT_TO_FINAL_NO_SETTER',
+          "No setter named '{0}' in class '{1}'.",
+          "Try correcting the name to reference an existing setter, or "
+          "declare the setter.");
 
   /**
    * 12.18 Assignment: It is as static warning if an assignment of the form
@@ -3434,7 +3273,7 @@
    */
   static const StaticWarningCode ASSIGNMENT_TO_FUNCTION =
       const StaticWarningCode(
-          'ASSIGNMENT_TO_FUNCTION', "Functions cannot be assigned a value");
+          'ASSIGNMENT_TO_FUNCTION', "Functions can't be assigned a value.");
 
   /**
    * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>
@@ -3442,7 +3281,7 @@
    * instance setter named <i>v=</i>.
    */
   static const StaticWarningCode ASSIGNMENT_TO_METHOD = const StaticWarningCode(
-      'ASSIGNMENT_TO_METHOD', "Methods cannot be assigned a value");
+      'ASSIGNMENT_TO_METHOD', "Methods can't be assigned a value.");
 
   /**
    * 12.18 Assignment: It is as static warning if an assignment of the form
@@ -3452,16 +3291,19 @@
    * name <i>v=</i> in the lexical scope enclosing the assignment.
    */
   static const StaticWarningCode ASSIGNMENT_TO_TYPE = const StaticWarningCode(
-      'ASSIGNMENT_TO_TYPE', "Types cannot be assigned a value");
+      'ASSIGNMENT_TO_TYPE', "Types can't be assigned a value.");
 
   /**
    * 13.9 Switch: It is a static warning if the last statement of the statement
-   * sequence <i>s<sub>k</sub></i> is not a break, continue, return or throw
-   * statement.
+   * sequence <i>s<sub>k</sub></i> is not a break, continue, rethrow, return
+   * or throw statement.
    */
   static const StaticWarningCode CASE_BLOCK_NOT_TERMINATED =
-      const StaticWarningCode('CASE_BLOCK_NOT_TERMINATED',
-          "The last statement of the 'case' should be 'break', 'continue', 'return' or 'throw'");
+      const StaticWarningCode(
+          'CASE_BLOCK_NOT_TERMINATED',
+          "The last statement of the 'case' should be 'break', 'continue', "
+          "'rethrow', 'return' or 'throw'.",
+          "Try adding one of the required statements.");
 
   /**
    * 12.32 Type Cast: It is a static warning if <i>T</i> does not denote a type
@@ -3469,15 +3311,23 @@
    */
   static const StaticWarningCode CAST_TO_NON_TYPE = const StaticWarningCode(
       'CAST_TO_NON_TYPE',
-      "The name '{0}' is not a type and cannot be used in an 'as' expression");
+      "The name '{0}' isn't a type, so it can't be used in an 'as' expression.",
+      "Try changing the name to the name of an existing type, or "
+      "creating a type with the name '{0}'.");
 
   /**
    * 7.4 Abstract Instance Members: It is a static warning if an abstract member
    * is declared or inherited in a concrete class.
+   *
+   * Parameters:
+   * 0: the name of the abstract method
+   * 1: the name of the enclosing class
    */
   static const StaticWarningCode CONCRETE_CLASS_WITH_ABSTRACT_MEMBER =
-      const StaticWarningCode('CONCRETE_CLASS_WITH_ABSTRACT_MEMBER',
-          "'{0}' must have a method body because '{1}' is not abstract");
+      const StaticWarningCode(
+          'CONCRETE_CLASS_WITH_ABSTRACT_MEMBER',
+          "'{0}' must have a method body because '{1}' isn't abstract.",
+          "Try making '{1}' abstract, or adding a body to '{0}'.");
 
   /**
    * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and
@@ -3493,8 +3343,10 @@
    * 2: the name of the non-dart: library in which the element is found
    */
   static const StaticWarningCode CONFLICTING_DART_IMPORT =
-      const StaticWarningCode('CONFLICTING_DART_IMPORT',
-          "Element '{0}' from SDK library '{1}' is implicitly hidden by '{2}'");
+      const StaticWarningCode(
+          'CONFLICTING_DART_IMPORT',
+          "Element '{0}' from SDK library '{1}' is implicitly hidden by '{2}'.",
+          "Try adding an explicit hide combinator.");
 
   /**
    * 7.2 Getters: It is a static warning if a class <i>C</i> declares an
@@ -3508,23 +3360,30 @@
       CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER =
       const StaticWarningCode(
           'CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER',
-          "Superclass '{0}' declares static member with the same name");
+          "Superclass '{0}' declares static member with the same name.",
+          "Try renaming either the getter or the static member.");
 
   /**
    * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares
    * an instance method named <i>n</i> and has a setter named <i>n=</i>.
    */
   static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER =
-      const StaticWarningCode('CONFLICTING_INSTANCE_METHOD_SETTER',
-          "Class '{0}' declares instance method '{1}', but also has a setter with the same name from '{2}'");
+      const StaticWarningCode(
+          'CONFLICTING_INSTANCE_METHOD_SETTER',
+          "Class '{0}' declares instance method '{1}', "
+          "but also has a setter with the same name from '{2}'.",
+          "Try renaming either the method or the setter.");
 
   /**
    * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares
    * an instance method named <i>n</i> and has a setter named <i>n=</i>.
    */
   static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER2 =
-      const StaticWarningCode('CONFLICTING_INSTANCE_METHOD_SETTER2',
-          "Class '{0}' declares the setter '{1}', but also has an instance method in the same class");
+      const StaticWarningCode(
+          'CONFLICTING_INSTANCE_METHOD_SETTER2',
+          "Class '{0}' declares the setter '{1}', "
+          "but also has an instance method in the same class.",
+          "Try renaming either the method or the setter.");
 
   /**
    * 7.3 Setters: It is a static warning if a class <i>C</i> declares an
@@ -3538,40 +3397,47 @@
       CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER =
       const StaticWarningCode(
           'CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER',
-          "Superclass '{0}' declares static member with the same name");
+          "Superclass '{0}' declares a static member with the same name.",
+          "Try renaming either the setter or the inherited member.");
 
   /**
    * 7.2 Getters: It is a static warning if a class declares a static getter
    * named <i>v</i> and also has a non-static setter named <i>v=</i>.
    */
   static const StaticWarningCode CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER =
-      const StaticWarningCode('CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER',
-          "Class '{0}' declares non-static setter with the same name");
+      const StaticWarningCode(
+          'CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER',
+          "Class '{0}' declares non-static setter with the same name.",
+          "Try renaming either the getter or the setter.");
 
   /**
    * 7.3 Setters: It is a static warning if a class declares a static setter
    * named <i>v=</i> and also has a non-static member named <i>v</i>.
    */
   static const StaticWarningCode CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER =
-      const StaticWarningCode('CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER',
-          "Class '{0}' declares non-static member with the same name");
+      const StaticWarningCode(
+          'CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER',
+          "Class '{0}' declares non-static member with the same name.",
+          "Try renaming either the inherited member or the setter.");
 
   /**
-   * 12.11.2 Const: Given an instance creation expression of the form <i>const
+   * 16.12.2 Const: Given an instance creation expression of the form <i>const
    * q(a<sub>1</sub>, &hellip; a<sub>n</sub>)</i> it is a static warning if
    * <i>q</i> is the constructor of an abstract class but <i>q</i> is not a
    * factory constructor.
    */
   static const StaticWarningCode CONST_WITH_ABSTRACT_CLASS =
-      const StaticWarningCode('CONST_WITH_ABSTRACT_CLASS',
-          "Abstract classes cannot be created with a 'const' expression");
+      const StaticWarningCode(
+          'CONST_WITH_ABSTRACT_CLASS',
+          "Abstract classes can't be created with a 'const' expression.",
+          "Try creating an instance of a subtype.");
 
   /**
    * 12.7 Maps: It is a static warning if the values of any two keys in a map
    * literal are equal.
    */
   static const StaticWarningCode EQUAL_KEYS_IN_MAP = const StaticWarningCode(
-      'EQUAL_KEYS_IN_MAP', "Keys in a map cannot be equal");
+      'EQUAL_KEYS_IN_MAP', "Two keys in a map literal can't be equal.");
 
   /**
    * 14.2 Exports: It is a static warning to export two different libraries with
@@ -3583,8 +3449,10 @@
    * 2:e the shared name of the exported libraries
    */
   static const StaticWarningCode EXPORT_DUPLICATED_LIBRARY_NAMED =
-      const StaticWarningCode('EXPORT_DUPLICATED_LIBRARY_NAMED',
-          "The exported libraries '{0}' and '{1}' cannot have the same name '{2}'");
+      const StaticWarningCode(
+          'EXPORT_DUPLICATED_LIBRARY_NAMED',
+          "The exported libraries '{0}' and '{1}' can't have the same name '{2}'.",
+          "Try adding a hide clause to one of the export directives.");
 
   /**
    * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt;
@@ -3597,8 +3465,10 @@
    * See [NOT_ENOUGH_REQUIRED_ARGUMENTS].
    */
   static const StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS =
-      const StaticWarningCode('EXTRA_POSITIONAL_ARGUMENTS',
-          "{0} positional arguments expected, but {1} found");
+      const StaticWarningCode(
+          'EXTRA_POSITIONAL_ARGUMENTS',
+          "{0} positional arguments expected, but {1} found.",
+          "Try removing the extra positional arguments.");
 
   /**
    * 5. Variables: It is a static warning if a final instance variable that has
@@ -3609,7 +3479,9 @@
       FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION =
       const StaticWarningCode(
           'FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION',
-          "Values cannot be set in the constructor if they are final, and have already been set");
+          "Fields can't be initialized in the constructor if they are final "
+          "and have already been initialized at their declaration.",
+          "Try removing one of the initializations.");
 
   /**
    * 5. Variables: It is a static warning if a final instance variable that has
@@ -3623,7 +3495,9 @@
       FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR =
       const StaticWarningCode(
           'FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR',
-          "'{0}' is final and was given a value when it was declared, so it cannot be set to a new value");
+          "'{0}' is final and was given a value when it was declared, "
+          "so it can't be set to a new value.",
+          "Try removing one of the initializations.");
 
   /**
    * 7.6.1 Generative Constructors: Execution of an initializer of the form
@@ -3644,7 +3518,7 @@
    */
   static const StaticWarningCode FIELD_INITIALIZER_NOT_ASSIGNABLE =
       const StaticWarningCode('FIELD_INITIALIZER_NOT_ASSIGNABLE',
-          "The initializer type '{0}' cannot be assigned to the field type '{1}'");
+          "The initializer type '{0}' can't be assigned to the field type '{1}'.");
 
   /**
    * 7.6.1 Generative Constructors: An initializing formal has the form
@@ -3656,8 +3530,11 @@
    * 1: the name of the type of the field
    */
   static const StaticWarningCode FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE =
-      const StaticWarningCode('FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE',
-          "The parameter type '{0}' is incompatable with the field type '{1}'");
+      const StaticWarningCode(
+          'FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE',
+          "The parameter type '{0}' is incompatable with the field type '{1}'.",
+          "Try changing or removing the parameter's type, or "
+          "changing the field's type.");
 
   /**
    * 5 Variables: It is a static warning if a library, static or local variable
@@ -3668,8 +3545,14 @@
    * 0: the name of the uninitialized final variable
    */
   static const StaticWarningCode FINAL_NOT_INITIALIZED =
-      const StaticWarningCode('FINAL_NOT_INITIALIZED',
-          "The final variable '{0}' must be initialized", null, false);
+      const StaticWarningCode(
+          'FINAL_NOT_INITIALIZED',
+          "The final variable '{0}' must be initialized.",
+          // TODO(brianwilkerson) Split this error code so that we can suggest
+          // initializing fields in constructors (FINAL_FIELD_NOT_INITIALIZED
+          // and FINAL_VARIABLE_NOT_INITIALIZED).
+          "Try initializing the variable.",
+          false);
 
   /**
    * 7.6.1 Generative Constructors: Each final instance variable <i>f</i>
@@ -3684,8 +3567,11 @@
    * 0: the name of the uninitialized final variable
    */
   static const StaticWarningCode FINAL_NOT_INITIALIZED_CONSTRUCTOR_1 =
-      const StaticWarningCode('FINAL_NOT_INITIALIZED_CONSTRUCTOR_1',
-          "The final variable '{0}' must be initialized", null, false);
+      const StaticWarningCode(
+          'FINAL_NOT_INITIALIZED_CONSTRUCTOR_1',
+          "The final variable '{0}' must be initialized.",
+          "Try adding an initializer for the field.",
+          false);
 
   /**
    * 7.6.1 Generative Constructors: Each final instance variable <i>f</i>
@@ -3703,8 +3589,8 @@
   static const StaticWarningCode FINAL_NOT_INITIALIZED_CONSTRUCTOR_2 =
       const StaticWarningCode(
           'FINAL_NOT_INITIALIZED_CONSTRUCTOR_2',
-          "The final variables '{0}' and '{1}' must be initialized",
-          null,
+          "The final variables '{0}' and '{1}' must be initialized.",
+          "Try adding initializers for the fields.",
           false);
 
   /**
@@ -3724,8 +3610,8 @@
   static const StaticWarningCode FINAL_NOT_INITIALIZED_CONSTRUCTOR_3_PLUS =
       const StaticWarningCode(
           'FINAL_NOT_INITIALIZED_CONSTRUCTOR_3',
-          "The final variables '{0}', '{1}' and '{2}' more must be initialized",
-          null,
+          "The final variables '{0}', '{1}' and '{2}' more must be initialized.",
+          "Try adding initializers for the fields.",
           false);
 
   /**
@@ -3734,7 +3620,8 @@
    */
   static const StaticWarningCode FUNCTION_WITHOUT_CALL = const StaticWarningCode(
       'FUNCTION_WITHOUT_CALL',
-      "Concrete classes that implement Function must implement the method call()");
+      "Concrete classes that implement 'Function' must implement the method 'call'.",
+      "Try implementing a 'call' method, or don't implement 'Function'.");
 
   /**
    * 14.1 Imports: It is a static warning to import two different libraries with
@@ -3746,8 +3633,10 @@
    * 2: the shared name of the imported libraries
    */
   static const StaticWarningCode IMPORT_DUPLICATED_LIBRARY_NAMED =
-      const StaticWarningCode('IMPORT_DUPLICATED_LIBRARY_NAMED',
-          "The imported libraries '{0}' and '{1}' cannot have the same name '{2}'");
+      const StaticWarningCode(
+          'IMPORT_DUPLICATED_LIBRARY_NAMED',
+          "The imported libraries '{0}' and '{1}' can't have the same name '{2}'.",
+          "Try adding a hide clause to one of the imports.");
 
   /**
    * 14.1 Imports: It is a static warning if the specified URI of a deferred
@@ -3759,8 +3648,10 @@
    * See [CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY].
    */
   static const StaticWarningCode IMPORT_OF_NON_LIBRARY =
-      const StaticWarningCode('IMPORT_OF_NON_LIBRARY',
-          "The imported library '{0}' must not have a part-of directive");
+      const StaticWarningCode(
+          'IMPORT_OF_NON_LIBRARY',
+          "The imported library '{0}' can't have a part-of directive.",
+          "Try importing the library that the part is a part of.");
 
   /**
    * 8.1.1 Inheritance and Overriding: However, if the above rules would cause
@@ -3777,7 +3668,9 @@
       INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD =
       const StaticWarningCode(
           'INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD',
-          "'{0}' is inherited as a getter and also a method");
+          "'{0}' is inherited as a getter and also a method.",
+          "Try adjusting the supertypes of this class to remove the "
+          "inconsistency.");
 
   /**
    * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares
@@ -3792,7 +3685,8 @@
       INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC =
       const StaticWarningCode(
           'INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC',
-          "'{0}' collides with a static member in the superclass '{1}'");
+          "'{0}' collides with a static member in the superclass '{1}'.",
+          "Try renaming either the method or the inherited member.");
 
   /**
    * 7.2 Getters: It is a static warning if a getter <i>m1</i> overrides a
@@ -3808,8 +3702,11 @@
    * See [INVALID_METHOD_OVERRIDE_RETURN_TYPE].
    */
   static const StaticWarningCode INVALID_GETTER_OVERRIDE_RETURN_TYPE =
-      const StaticWarningCode('INVALID_GETTER_OVERRIDE_RETURN_TYPE',
-          "The return type '{0}' is not assignable to '{1}' as required by the getter it is overriding from '{2}'");
+      const StaticWarningCode(
+          'INVALID_GETTER_OVERRIDE_RETURN_TYPE',
+          "The return type '{0}' isn't assignable to '{1}' as required by the "
+          "getter it is overriding from '{2}'.",
+          "Try changing the return types so that they are compatible.");
 
   /**
    * 7.1 Instance Methods: It is a static warning if an instance method
@@ -3823,8 +3720,11 @@
    * 2: the name of the class where the overridden method is declared
    */
   static const StaticWarningCode INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE =
-      const StaticWarningCode('INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE',
-          "The parameter type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'");
+      const StaticWarningCode(
+          'INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE',
+          "The parameter type '{0}' isn't assignable to '{1}' as required by "
+          "the method it is overriding from '{2}'.",
+          "Try changing the parameter types so that they are compatible.");
 
   /**
    * Generic Method DEP: number of type parameters must match.
@@ -3836,8 +3736,11 @@
    * 2: the name of the class where the overridden method is declared
    */
   static const StaticWarningCode INVALID_METHOD_OVERRIDE_TYPE_PARAMETERS =
-      const StaticWarningCode('INVALID_METHOD_OVERRIDE_TYPE_PARAMETERS',
-          "The method has {0} type parameters, but it is overriding a method with {1} type parameters from '{2}'");
+      const StaticWarningCode(
+          'INVALID_METHOD_OVERRIDE_TYPE_PARAMETERS',
+          "The method has {0} type parameters, but it is overriding a method "
+          "with {1} type parameters from '{2}'.",
+          "Try changing the number of type parameters so that they are the same.");
 
   /**
    * Generic Method DEP: bounds of type parameters must be compatible.
@@ -3851,8 +3754,11 @@
    * 4: the name of the class where the overridden method is declared
    */
   static const StaticWarningCode INVALID_METHOD_OVERRIDE_TYPE_PARAMETER_BOUND =
-      const StaticWarningCode('INVALID_METHOD_OVERRIDE_TYPE_PARAMETER_BOUND',
-          "The type parameter '{0}' extends '{1}', but that is stricter than '{2}' extends '{3}' in the overridden method from '{4}'");
+      const StaticWarningCode(
+          'INVALID_METHOD_OVERRIDE_TYPE_PARAMETER_BOUND',
+          "The type parameter '{0}' extends '{1}', but that is stricter than "
+          "'{2}' extends '{3}' in the overridden method from '{4}'.",
+          "Try changing the bounds on the type parameters so that they are compatible.");
 
   /**
    * 7.1 Instance Methods: It is a static warning if an instance method
@@ -3867,8 +3773,11 @@
    * See [INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE].
    */
   static const StaticWarningCode INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE =
-      const StaticWarningCode('INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE',
-          "The parameter type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'");
+      const StaticWarningCode(
+          'INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE',
+          "The parameter type '{0}' isn't assignable to '{1}' as required by "
+          "the method it is overriding from '{2}'.",
+          "Try changing the parameter types so that they are compatible.");
 
   /**
    * 7.1 Instance Methods: It is a static warning if an instance method
@@ -3882,8 +3791,11 @@
    * 2: the name of the class where the overridden method is declared
    */
   static const StaticWarningCode INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE =
-      const StaticWarningCode('INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE',
-          "The parameter type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'");
+      const StaticWarningCode(
+          'INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE',
+          "The parameter type '{0}' isn't assignable to '{1}' as required by "
+          "the method it is overriding from '{2}'.",
+          "Try changing the parameter types so that they are compatible.");
 
   /**
    * 7.1 Instance Methods: It is a static warning if an instance method
@@ -3899,8 +3811,11 @@
    * See [INVALID_GETTER_OVERRIDE_RETURN_TYPE].
    */
   static const StaticWarningCode INVALID_METHOD_OVERRIDE_RETURN_TYPE =
-      const StaticWarningCode('INVALID_METHOD_OVERRIDE_RETURN_TYPE',
-          "The return type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'");
+      const StaticWarningCode(
+          'INVALID_METHOD_OVERRIDE_RETURN_TYPE',
+          "The return type '{0}' isn't assignable to '{1}' as required by the "
+          "method it is overriding from '{2}'.",
+          "Try changing the return types so that they are compatible.");
 
   /**
    * 7.1 Instance Methods: It is a static warning if an instance method
@@ -3912,7 +3827,9 @@
   static const StaticWarningCode
       INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED = const StaticWarningCode(
           'INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED',
-          "Parameters cannot override default values, this method overrides '{0}.{1}' where '{2}' has a different value");
+          "Parameters can't override default values, "
+          "this method overrides '{0}.{1}' where '{2}' has a different value.",
+          "Try using the same default value in both methods.");
 
   /**
    * 7.1 Instance Methods: It is a static warning if an instance method
@@ -3925,7 +3842,9 @@
       INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL =
       const StaticWarningCode(
           'INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL',
-          "Parameters cannot override default values, this method overrides '{0}.{1}' where this positional parameter has a different value");
+          "Parameters can't override default values, this method overrides "
+          "'{0}.{1}' where this positional parameter has a different value.",
+          "Try using the same default value in both methods.");
 
   /**
    * 7.1 Instance Methods: It is a static warning if an instance method
@@ -3937,9 +3856,13 @@
    * 1: the signature of the overridden member
    * 2: the name of the class from the overridden method
    */
-  static const StaticWarningCode INVALID_OVERRIDE_NAMED = const StaticWarningCode(
-      'INVALID_OVERRIDE_NAMED',
-      "Missing the named parameter '{0}' to match the overridden method from '{1}' from '{2}'");
+  static const StaticWarningCode INVALID_OVERRIDE_NAMED =
+      const StaticWarningCode(
+          'INVALID_OVERRIDE_NAMED',
+          "Missing the named parameter '{0}' "
+          "to match the overridden method from '{1}' from '{2}'.",
+          "Try adding the named parameter to this method, or "
+          "removing it from the overridden method.");
 
   /**
    * 7.1 Instance Methods: It is a static warning if an instance method
@@ -3952,8 +3875,11 @@
    * 2: the name of the class from the overridden method
    */
   static const StaticWarningCode INVALID_OVERRIDE_POSITIONAL =
-      const StaticWarningCode('INVALID_OVERRIDE_POSITIONAL',
-          "Must have at least {0} parameters to match the overridden method '{1}' from '{2}'");
+      const StaticWarningCode(
+          'INVALID_OVERRIDE_POSITIONAL',
+          "Must have at least {0} parameters "
+          "to match the overridden method '{1}' from '{2}'.",
+          "Try adding the necessary parameters.");
 
   /**
    * 7.1 Instance Methods: It is a static warning if an instance method
@@ -3966,8 +3892,11 @@
    * 2: the name of the class from the overridden method
    */
   static const StaticWarningCode INVALID_OVERRIDE_REQUIRED =
-      const StaticWarningCode('INVALID_OVERRIDE_REQUIRED',
-          "Must have {0} required parameters or less to match the overridden method '{1}' from '{2}'");
+      const StaticWarningCode(
+          'INVALID_OVERRIDE_REQUIRED',
+          "Must have {0} required parameters or less "
+          "to match the overridden method '{1}' from '{2}'.",
+          "Try removing the extra parameters.");
 
   /**
    * 7.3 Setters: It is a static warning if a setter <i>m1</i> overrides a
@@ -3983,8 +3912,11 @@
    * See [INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE].
    */
   static const StaticWarningCode INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE =
-      const StaticWarningCode('INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE',
-          "The parameter type '{0}' is not assignable to '{1}' as required by the setter it is overriding from '{2}'");
+      const StaticWarningCode(
+          'INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE',
+          "The parameter type '{0}' isn't assignable to '{1}' as required by "
+          "the setter it is overriding from '{2}'.",
+          "Try changing the parameter types so that they are compatible.");
 
   /**
    * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i>
@@ -4001,7 +3933,7 @@
    */
   static const StaticWarningCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE =
       const StaticWarningCode('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE',
-          "The element type '{0}' cannot be assigned to the list type '{1}'");
+          "The element type '{0}' can't be assigned to the list type '{1}'.");
 
   /**
    * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt;
@@ -4020,7 +3952,7 @@
    */
   static const StaticWarningCode MAP_KEY_TYPE_NOT_ASSIGNABLE =
       const StaticWarningCode('MAP_KEY_TYPE_NOT_ASSIGNABLE',
-          "The element type '{0}' cannot be assigned to the map key type '{1}'");
+          "The element type '{0}' can't be assigned to the map key type '{1}'.");
 
   /**
    * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt;
@@ -4039,7 +3971,7 @@
    */
   static const StaticWarningCode MAP_VALUE_TYPE_NOT_ASSIGNABLE =
       const StaticWarningCode('MAP_VALUE_TYPE_NOT_ASSIGNABLE',
-          "The element type '{0}' cannot be assigned to the map value type '{1}'");
+          "The element type '{0}' can't be assigned to the map value type '{1}'.");
 
   /**
    * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i>
@@ -4049,8 +3981,9 @@
   static const StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES =
       const StaticWarningCode(
           'MISMATCHED_GETTER_AND_SETTER_TYPES',
-          "The parameter type for setter '{0}' is '{1}' which is not assignable to its getter (of type '{2}')",
-          null,
+          "The parameter type for setter '{0}' is '{1}' which isn't assignable "
+          "to its getter (of type '{2}').",
+          "Try changing the types so that they are compatible.",
           false);
 
   /**
@@ -4062,8 +3995,9 @@
       MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE =
       const StaticWarningCode(
           'MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE',
-          "The parameter type for setter '{0}' is '{1}' which is not assignable to its getter (of type '{2}'), from superclass '{3}'",
-          null,
+          "The parameter type for setter '{0}' is '{1}' which isn't assignable "
+          "to its getter (of type '{2}'), from superclass '{3}'.",
+          "Try changing the types so that they are compatible.",
           false);
 
   /**
@@ -4082,8 +4016,9 @@
   static const StaticWarningCode MISSING_ENUM_CONSTANT_IN_SWITCH =
       const StaticWarningCode(
           'MISSING_ENUM_CONSTANT_IN_SWITCH',
-          "Missing case clause for '{0}'",
-          "Add a case clause for the missing constant or add a default clause.",
+          "Missing case clause for '{0}'.",
+          "Try adding a case clause for the missing constant, or "
+          "adding a default clause.",
           false);
 
   /**
@@ -4093,8 +4028,11 @@
    */
   static const StaticWarningCode MIXED_RETURN_TYPES = const StaticWarningCode(
       'MIXED_RETURN_TYPES',
-      "Methods and functions cannot use return both with and without values",
-      null,
+      "Functions can't include return statements both with and without values.",
+      // TODO(brianwilkerson) Split this error code depending on whether the
+      // function declares a return type.
+      "Try making all the return statements consistent "
+      "(either include a value or not).",
       false);
 
   /**
@@ -4102,8 +4040,10 @@
    * abstract class and <i>q</i> is not a factory constructor.
    */
   static const StaticWarningCode NEW_WITH_ABSTRACT_CLASS =
-      const StaticWarningCode('NEW_WITH_ABSTRACT_CLASS',
-          "Abstract classes cannot be created with a 'new' expression");
+      const StaticWarningCode(
+          'NEW_WITH_ABSTRACT_CLASS',
+          "Abstract classes can't be created with a 'new' expression.",
+          "Try creating an instance of a subtype.");
 
   /**
    * 15.8 Parameterized Types: Any use of a malbounded type gives rise to a
@@ -4118,8 +4058,11 @@
    * [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS].
    */
   static const StaticWarningCode NEW_WITH_INVALID_TYPE_PARAMETERS =
-      const StaticWarningCode('NEW_WITH_INVALID_TYPE_PARAMETERS',
-          "The type '{0}' is declared with {1} type parameters, but {2} type arguments were given");
+      const StaticWarningCode(
+          'NEW_WITH_INVALID_TYPE_PARAMETERS',
+          "The type '{0}' is declared with {1} type parameters, "
+          "but {2} type arguments were given.",
+          "Try adjusting the number of type arguments.");
 
   /**
    * 12.11.1 New: It is a static warning if <i>T</i> is not a class accessible
@@ -4129,7 +4072,9 @@
    * 0: the name of the non-type element
    */
   static const StaticWarningCode NEW_WITH_NON_TYPE = const StaticWarningCode(
-      'NEW_WITH_NON_TYPE', "The name '{0}' is not a class");
+      'NEW_WITH_NON_TYPE',
+      "The name '{0}' isn't a class.",
+      "Try correcting the name to match an existing class.");
 
   /**
    * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the
@@ -4145,8 +4090,11 @@
    * declare a constructor with the same name as the declaration of <i>T</i>.
    */
   static const StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR =
-      const StaticWarningCode('NEW_WITH_UNDEFINED_CONSTRUCTOR',
-          "The class '{0}' does not have a constructor '{1}'");
+      const StaticWarningCode(
+          'NEW_WITH_UNDEFINED_CONSTRUCTOR',
+          "The class '{0}' doesn't have a constructor named '{1}'.",
+          "Try invoking a different constructor, or "
+          "define a constructor named '{1}'.");
 
   /**
    * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the
@@ -4161,8 +4109,10 @@
    * same name as the declaration of <i>T</i>.
    */
   static const StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT =
-      const StaticWarningCode('NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT',
-          "The class '{0}' does not have a default constructor");
+      const StaticWarningCode(
+          'NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT',
+          "The class '{0}' doesn't have a default constructor.",
+          "Try using one of the named constructors defined in '{0}'.");
 
   /**
    * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
@@ -4189,7 +4139,8 @@
       NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS =
       const StaticWarningCode(
           'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS',
-          "Missing concrete implementation of {0}, {1}, {2}, {3} and {4} more");
+          "Missing concrete implementations of {0}, {1}, {2}, {3} and {4} more.",
+          "Try implementing the missing methods, or make the class abstract.");
 
   /**
    * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
@@ -4215,7 +4166,8 @@
       NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR =
       const StaticWarningCode(
           'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR',
-          "Missing concrete implementation of {0}, {1}, {2} and {3}");
+          "Missing concrete implementations of {0}, {1}, {2} and {3}.",
+          "Try implementing the missing methods, or make the class abstract.");
 
   /**
    * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
@@ -4237,7 +4189,8 @@
   static const StaticWarningCode
       NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE = const StaticWarningCode(
           'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE',
-          "Missing concrete implementation of {0}");
+          "Missing concrete implementation of {0}.",
+          "Try implementing the missing method, or make the class abstract.");
 
   /**
    * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
@@ -4262,7 +4215,8 @@
       NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE =
       const StaticWarningCode(
           'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE',
-          "Missing concrete implementation of {0}, {1} and {2}");
+          "Missing concrete implementations of {0}, {1} and {2}.",
+          "Try implementing the missing methods, or make the class abstract.");
 
   /**
    * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
@@ -4285,7 +4239,8 @@
   static const StaticWarningCode
       NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO = const StaticWarningCode(
           'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO',
-          "Missing concrete implementation of {0} and {1}");
+          "Missing concrete implementations of {0} and {1}.",
+          "Try implementing the missing methods, or make the class abstract.");
 
   /**
    * 13.11 Try: An on-catch clause of the form <i>on T catch (p<sub>1</sub>,
@@ -4298,24 +4253,33 @@
    * 0: the name of the non-type element
    */
   static const StaticWarningCode NON_TYPE_IN_CATCH_CLAUSE =
-      const StaticWarningCode('NON_TYPE_IN_CATCH_CLAUSE',
-          "The name '{0}' is not a type and cannot be used in an on-catch clause");
+      const StaticWarningCode(
+          'NON_TYPE_IN_CATCH_CLAUSE',
+          "The name '{0}' isn't a type and can't be used in an on-catch clause.",
+          "Try correcting the name to match an existing class.");
 
   /**
    * 7.1.1 Operators: It is a static warning if the return type of the
    * user-declared operator []= is explicitly declared and not void.
    */
   static const StaticWarningCode NON_VOID_RETURN_FOR_OPERATOR =
-      const StaticWarningCode('NON_VOID_RETURN_FOR_OPERATOR',
-          "The return type of the operator []= must be 'void'", null, false);
+      const StaticWarningCode(
+          'NON_VOID_RETURN_FOR_OPERATOR',
+          "The return type of the operator []= must be 'void'.",
+          "Try changing the return type to 'void'.",
+          false);
 
   /**
    * 7.3 Setters: It is a static warning if a setter declares a return type
    * other than void.
    */
   static const StaticWarningCode NON_VOID_RETURN_FOR_SETTER =
-      const StaticWarningCode('NON_VOID_RETURN_FOR_SETTER',
-          "The return type of the setter must be 'void'", null, false);
+      const StaticWarningCode(
+          'NON_VOID_RETURN_FOR_SETTER',
+          "The return type of the setter must be 'void' or absent.",
+          "Try removing the return type, or "
+          "define a method rather than a setter.",
+          false);
 
   /**
    * 15.1 Static Types: A type <i>T</i> is malformed iff:
@@ -4332,8 +4296,10 @@
    * Parameters:
    * 0: the name that is not a type
    */
-  static const StaticWarningCode NOT_A_TYPE =
-      const StaticWarningCode('NOT_A_TYPE', "{0} is not a type");
+  static const StaticWarningCode NOT_A_TYPE = const StaticWarningCode(
+      'NOT_A_TYPE',
+      "{0} isn't a type.",
+      "Try correcting the name to match an existing type.");
 
   /**
    * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt;
@@ -4346,8 +4312,10 @@
    * See [EXTRA_POSITIONAL_ARGUMENTS].
    */
   static const StaticWarningCode NOT_ENOUGH_REQUIRED_ARGUMENTS =
-      const StaticWarningCode('NOT_ENOUGH_REQUIRED_ARGUMENTS',
-          "{0} required argument(s) expected, but {1} found");
+      const StaticWarningCode(
+          'NOT_ENOUGH_REQUIRED_ARGUMENTS',
+          "{0} required argument(s) expected, but {1} found.",
+          "Try adding the additional required arguments.");
 
   /**
    * 14.3 Parts: It is a static warning if the referenced part declaration
@@ -4359,8 +4327,11 @@
    * 1: the non-matching actual library name from the "part of" declaration
    */
   static const StaticWarningCode PART_OF_DIFFERENT_LIBRARY =
-      const StaticWarningCode('PART_OF_DIFFERENT_LIBRARY',
-          "Expected this library to be part of '{0}', not '{1}'");
+      const StaticWarningCode(
+          'PART_OF_DIFFERENT_LIBRARY',
+          "Expected this library to be part of '{0}', not '{1}'.",
+          "Try including a different part, or "
+          "changing the name of the library in the part's part-of directive.");
 
   /**
    * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i>
@@ -4371,20 +4342,26 @@
    * 1: the name of the redirecting constructor
    */
   static const StaticWarningCode REDIRECT_TO_INVALID_FUNCTION_TYPE =
-      const StaticWarningCode('REDIRECT_TO_INVALID_FUNCTION_TYPE',
-          "The redirected constructor '{0}' has incompatible parameters with '{1}'");
+      const StaticWarningCode(
+          'REDIRECT_TO_INVALID_FUNCTION_TYPE',
+          "The redirected constructor '{0}' has incompatible parameters with '{1}'.",
+          "Try redirecting to a different constructor, or "
+          "directly invoking the desired constructor rather than redirecting to it.");
 
   /**
    * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i>
    * is not a subtype of the type of <i>k</i>.
    *
    * Parameters:
-   * 0: the name of the redirected constructor return type
-   * 1: the name of the redirecting constructor return type
+   * 0: the name of the redirected constructor's return type
+   * 1: the name of the redirecting constructor's return type
    */
   static const StaticWarningCode REDIRECT_TO_INVALID_RETURN_TYPE =
-      const StaticWarningCode('REDIRECT_TO_INVALID_RETURN_TYPE',
-          "The return type '{0}' of the redirected constructor is not assignable to '{1}'");
+      const StaticWarningCode(
+          'REDIRECT_TO_INVALID_RETURN_TYPE',
+          "The return type '{0}' of the redirected constructor isn't assignable to '{1}'.",
+          "Try redirecting to a different constructor, or "
+          "directly invoking the desired constructor rather than redirecting to it.");
 
   /**
    * 7.6.2 Factories: It is a static warning if type does not denote a class
@@ -4393,8 +4370,11 @@
    * <i>type.id</i>) is not a constructor of <i>C</i>.
    */
   static const StaticWarningCode REDIRECT_TO_MISSING_CONSTRUCTOR =
-      const StaticWarningCode('REDIRECT_TO_MISSING_CONSTRUCTOR',
-          "The constructor '{0}' could not be found in '{1}'");
+      const StaticWarningCode(
+          'REDIRECT_TO_MISSING_CONSTRUCTOR',
+          "The constructor '{0}' couldn't be found in '{1}'.",
+          "Try correcting the constructor name to an existing constructor, or "
+          "defining the constructor in '{1}'.");
 
   /**
    * 7.6.2 Factories: It is a static warning if type does not denote a class
@@ -4404,7 +4384,8 @@
    */
   static const StaticWarningCode REDIRECT_TO_NON_CLASS = const StaticWarningCode(
       'REDIRECT_TO_NON_CLASS',
-      "The name '{0}' is not a type and cannot be used in a redirected constructor");
+      "The name '{0}' isn't a type and can't be used in a redirected constructor.",
+      "Try correcting the name to match an existing class.");
 
   /**
    * 13.12 Return: Let <i>f</i> be the function immediately enclosing a return
@@ -4415,7 +4396,7 @@
    */
   static const StaticWarningCode RETURN_WITHOUT_VALUE = const StaticWarningCode(
       'RETURN_WITHOUT_VALUE',
-      "Missing return value after 'return'",
+      "Missing return value after 'return'.",
       null,
       false);
 
@@ -4428,15 +4409,17 @@
    */
   static const StaticWarningCode STATIC_ACCESS_TO_INSTANCE_MEMBER =
       const StaticWarningCode('STATIC_ACCESS_TO_INSTANCE_MEMBER',
-          "Instance member '{0}' cannot be accessed using static access");
+          "Instance member '{0}' can't be accessed using static access.");
 
   /**
    * 13.9 Switch: It is a static warning if the type of <i>e</i> may not be
    * assigned to the type of <i>e<sub>k</sub></i>.
    */
   static const StaticWarningCode SWITCH_EXPRESSION_NOT_ASSIGNABLE =
-      const StaticWarningCode('SWITCH_EXPRESSION_NOT_ASSIGNABLE',
-          "Type '{0}' of the switch expression is not assignable to the type '{1}' of case expressions");
+      const StaticWarningCode(
+          'SWITCH_EXPRESSION_NOT_ASSIGNABLE',
+          "Type '{0}' of the switch expression isn't assignable to "
+          "the type '{1}' of case expressions.");
 
   /**
    * 15.1 Static Types: It is a static warning to use a deferred type in a type
@@ -4447,24 +4430,45 @@
    *    annotation
    */
   static const StaticWarningCode TYPE_ANNOTATION_DEFERRED_CLASS =
-      const StaticWarningCode('TYPE_ANNOTATION_DEFERRED_CLASS',
-          "The deferred type '{0}' cannot be used in a declaration, cast or type test");
+      const StaticWarningCode(
+          'TYPE_ANNOTATION_DEFERRED_CLASS',
+          "The deferred type '{0}' can't be used in a declaration, cast or type test.",
+          "Try using a different type, or "
+          "changing the import to not be deferred.");
+
+  /**
+   * Not yet spec'd.
+   *
+   * Parameters:
+   * 0: the name of the generic function's type parameter that is being used in
+   *    an `is` expression
+   */
+  static const StaticWarningCode TYPE_ANNOTATION_GENERIC_FUNCTION_PARAMETER =
+      const StaticWarningCode(
+          'TYPE_ANNOTATION_GENERIC_FUNCTION_PARAMETER',
+          "The type parameter '{0}' can't be used in a type test.",
+          "Try using a different type.");
 
   /**
    * 12.31 Type Test: It is a static warning if <i>T</i> does not denote a type
    * available in the current lexical scope.
    */
-  static const StaticWarningCode TYPE_TEST_WITH_NON_TYPE = const StaticWarningCode(
-      'TYPE_TEST_WITH_NON_TYPE',
-      "The name '{0}' is not a type and cannot be used in an 'is' expression");
+  static const StaticWarningCode TYPE_TEST_WITH_NON_TYPE =
+      const StaticWarningCode(
+          'TYPE_TEST_WITH_NON_TYPE',
+          "The name '{0}' isn't a type and can't be used in an 'is' expression.",
+          "Try correcting the name to match an existing type.");
 
   /**
    * 12.31 Type Test: It is a static warning if <i>T</i> does not denote a type
    * available in the current lexical scope.
    */
   static const StaticWarningCode TYPE_TEST_WITH_UNDEFINED_NAME =
-      const StaticWarningCode('TYPE_TEST_WITH_UNDEFINED_NAME',
-          "The name '{0}' is not defined and cannot be used in an 'is' expression");
+      const StaticWarningCode(
+          'TYPE_TEST_WITH_UNDEFINED_NAME',
+          "The name '{0}' isn't defined, so it can't be used in an 'is' expression.",
+          "Try changing the name to the name of an existing type, or "
+          "creating a type with the name '{0}'.");
 
   /**
    * 10 Generics: However, a type parameter is considered to be a malformed type
@@ -4475,8 +4479,11 @@
    * checker and the runtime.
    */
   static const StaticWarningCode TYPE_PARAMETER_REFERENCED_BY_STATIC =
-      const StaticWarningCode('TYPE_PARAMETER_REFERENCED_BY_STATIC',
-          "Static members cannot reference type parameters of the class");
+      const StaticWarningCode(
+          'TYPE_PARAMETER_REFERENCED_BY_STATIC',
+          "Static members can't reference type parameters of the class.",
+          "Try removing the reference to the type parameter, or "
+          "making the member an instance member.");
 
   /**
    * 12.16.3 Static Invocation: A static method invocation <i>i</i> has the form
@@ -4487,15 +4494,18 @@
    * Parameters:
    * 0: the name of the undefined class
    */
-  static const StaticWarningCode UNDEFINED_CLASS =
-      const StaticWarningCode('UNDEFINED_CLASS', "Undefined class '{0}'");
+  static const StaticWarningCode UNDEFINED_CLASS = const StaticWarningCode(
+      'UNDEFINED_CLASS',
+      "Undefined class '{0}'.",
+      "Try changing the name to the name of an existing class, or "
+      "creating a class with the name '{0}'.");
 
   /**
    * Same as [UNDEFINED_CLASS], but to catch using "boolean" instead of "bool".
    */
   static const StaticWarningCode UNDEFINED_CLASS_BOOLEAN =
       const StaticWarningCode('UNDEFINED_CLASS_BOOLEAN',
-          "Undefined class 'boolean'; did you mean 'bool'?");
+          "Undefined class 'boolean'.", "Try using the type 'bool'.");
 
   /**
    * 12.17 Getter Invocation: It is a static warning if there is no class
@@ -4508,8 +4518,8 @@
    */
   static const StaticWarningCode UNDEFINED_GETTER = const StaticWarningCode(
       'UNDEFINED_GETTER',
-      "The getter '{0}' is not defined for the class '{1}'.",
-      null);
+      "The getter '{0}' isn't defined for the class '{1}'.",
+      "Try defining a getter or field named '{0}', or invoke a different getter.");
 
   /**
    * 12.30 Identifier Reference: It is as static warning if an identifier
@@ -4521,15 +4531,22 @@
    * Parameters:
    * 0: the name of the identifier
    */
-  static const StaticWarningCode UNDEFINED_IDENTIFIER =
-      const StaticWarningCode('UNDEFINED_IDENTIFIER', "Undefined name '{0}'");
+  static const StaticWarningCode UNDEFINED_IDENTIFIER = const StaticWarningCode(
+      'UNDEFINED_IDENTIFIER',
+      "Undefined name '{0}'.",
+      "Try correcting the name to one that is defined, or "
+      "defining the name.");
 
   /**
    * If the identifier is 'await', be helpful about it.
    */
   static const StaticWarningCode UNDEFINED_IDENTIFIER_AWAIT =
-      const StaticWarningCode('UNDEFINED_IDENTIFIER_AWAIT',
-          "Undefined name 'await'; did you mean to add the 'async' marker to '{0}'?");
+      const StaticWarningCode(
+          'UNDEFINED_IDENTIFIER_AWAIT',
+          "Undefined name 'await'.",
+          "Try correcting the name to one that is defined, "
+          "defining the name, or "
+          "adding 'async' to the enclosing function body.");
 
   /**
    * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>,
@@ -4541,8 +4558,11 @@
    * 0: the name of the requested named parameter
    */
   static const StaticWarningCode UNDEFINED_NAMED_PARAMETER =
-      const StaticWarningCode('UNDEFINED_NAMED_PARAMETER',
-          "The named parameter '{0}' is not defined");
+      const StaticWarningCode(
+          'UNDEFINED_NAMED_PARAMETER',
+          "The named parameter '{0}' isn't defined.",
+          "Try correcting the name to an existing named parameter, or "
+          "defining a new parameter with this name.");
 
   /**
    * 12.18 Assignment: It is as static warning if an assignment of the form
@@ -4561,8 +4581,8 @@
    */
   static const StaticWarningCode UNDEFINED_SETTER = const StaticWarningCode(
       'UNDEFINED_SETTER',
-      "The setter '{0}' is not defined for the class '{1}'.",
-      null);
+      "The setter '{0}' isn't defined for the class '{1}'.",
+      "Try defining a setter or field named '{0}', or invoke a different setter.");
 
   /**
    * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not
@@ -4573,8 +4593,11 @@
    * 1: the name of the enclosing type where the method is being looked for
    */
   static const StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER =
-      const StaticWarningCode('UNDEFINED_STATIC_METHOD_OR_GETTER',
-          "The static method, getter or setter '{0}' is not defined for the class '{1}'");
+      const StaticWarningCode(
+          'UNDEFINED_STATIC_METHOD_OR_GETTER',
+          "The static method, getter or setter '{0}' isn't defined for the class '{1}'.",
+          "Try correcting the name to an existing member, or "
+          "defining the member in '{1}'.");
 
   /**
    * 12.17 Getter Invocation: It is a static warning if there is no class
@@ -4586,8 +4609,11 @@
    * 1: the name of the enclosing type where the getter is being looked for
    */
   static const StaticWarningCode UNDEFINED_SUPER_GETTER =
-      const StaticWarningCode('UNDEFINED_SUPER_GETTER',
-          "The getter '{0}' is not defined in a superclass of '{1}'.", null);
+      const StaticWarningCode(
+          'UNDEFINED_SUPER_GETTER',
+          "The getter '{0}' isn't defined in a superclass of '{1}'.",
+          "Try correcting the name to an existing getter, or "
+          "defining the getter in a superclass of '{1}'.");
 
   /**
    * 12.18 Assignment: It is as static warning if an assignment of the form
@@ -4605,15 +4631,21 @@
    * 1: the name of the enclosing type where the setter is being looked for
    */
   static const StaticWarningCode UNDEFINED_SUPER_SETTER =
-      const StaticWarningCode('UNDEFINED_SUPER_SETTER',
-          "The setter '{0}' is not defined in a superclass of '{1}'.", null);
+      const StaticWarningCode(
+          'UNDEFINED_SUPER_SETTER',
+          "The setter '{0}' isn't defined in a superclass of '{1}'.",
+          "Try correcting the name to an existing setter, or "
+          "defining the setter in a superclass of '{1}'.");
 
   /**
    * 7.2 Getters: It is a static warning if the return type of a getter is void.
    */
   static const StaticWarningCode VOID_RETURN_FOR_GETTER =
-      const StaticWarningCode('VOID_RETURN_FOR_GETTER',
-          "The return type of the getter must not be 'void'", null, false);
+      const StaticWarningCode(
+          'VOID_RETURN_FOR_GETTER',
+          "The return type of a getter can't be 'void'.",
+          "Try providing a return type for the getter.",
+          false);
 
   /**
    * A flag indicating whether this warning is an error when running with strong
@@ -4648,19 +4680,15 @@
  */
 class StrongModeCode extends ErrorCode {
   static const String _implicitCastMessage =
-      'Unsound implicit cast from {0} to {1}';
+      "Unsafe implicit cast from '{0}' to '{1}'. "
+      "This usually indicates that type information was lost and resulted in "
+      "'dynamic' and/or a place that will have a failure at runtime.";
 
-  static const String _unsafeBlockClosureInferenceMessage =
-      'Unsafe use of block closure in a type-inferred variable outside a '
-      'function body.  Workaround: add a type annotation for `{0}`.  See '
-      'dartbug.com/26947';
-
-  static const String _typeCheckMessage =
-      'Type check failed: {0} is not of type {1}';
+  static const String _implicitCastCorrection =
+      "Try adding an explicit cast to '{1}' or improving the type of '{0}'.";
 
   static const String _invalidOverrideMessage =
-      'The type of {0}.{1} ({2}) is not a '
-      'subtype of {3}.{1} ({4}).';
+      "The type of '{0}.{1}' ('{2}') isn't a subtype of '{3}.{1}' ('{4}').";
 
   /**
    * This is appended to the end of an error message about implicit dynamic.
@@ -4669,35 +4697,52 @@
    * result of turning on a particular option, and they are free to turn it
    * back off.
    */
-  static const String _implicitDynamicTip =
-      ". Either add an explicit type like 'dynamic'"
-      ", or enable implicit-dynamic in your Analyzer options.";
+  static const String _implicitDynamicCorrection =
+      "Try adding an explicit type like 'dynamic', or "
+      "enable implicit-dynamic in your analysis options file.";
 
-  static const String _inferredTypeMessage = '{0} has inferred type {1}';
+  static const String _inferredTypeMessage = "'{0}' has inferred type '{1}'.";
 
   static const StrongModeCode DOWN_CAST_COMPOSITE = const StrongModeCode(
-      ErrorType.STATIC_WARNING, 'DOWN_CAST_COMPOSITE', _implicitCastMessage);
+      ErrorType.STATIC_WARNING,
+      'DOWN_CAST_COMPOSITE',
+      _implicitCastMessage,
+      _implicitCastCorrection);
 
   static const StrongModeCode DOWN_CAST_IMPLICIT = const StrongModeCode(
-      ErrorType.HINT, 'DOWN_CAST_IMPLICIT', _implicitCastMessage);
+      ErrorType.HINT,
+      'DOWN_CAST_IMPLICIT',
+      _implicitCastMessage,
+      _implicitCastCorrection);
 
   static const StrongModeCode DOWN_CAST_IMPLICIT_ASSIGN = const StrongModeCode(
-      ErrorType.HINT, 'DOWN_CAST_IMPLICIT_ASSIGN', _implicitCastMessage);
+      ErrorType.HINT,
+      'DOWN_CAST_IMPLICIT_ASSIGN',
+      _implicitCastMessage,
+      _implicitCastCorrection);
 
   static const StrongModeCode DYNAMIC_CAST = const StrongModeCode(
-      ErrorType.HINT, 'DYNAMIC_CAST', _implicitCastMessage);
+      ErrorType.HINT,
+      'DYNAMIC_CAST',
+      _implicitCastMessage,
+      _implicitCastCorrection);
 
   static const StrongModeCode ASSIGNMENT_CAST = const StrongModeCode(
-      ErrorType.HINT, 'ASSIGNMENT_CAST', _implicitCastMessage);
+      ErrorType.HINT,
+      'ASSIGNMENT_CAST',
+      _implicitCastMessage,
+      _implicitCastCorrection);
 
   static const StrongModeCode INVALID_PARAMETER_DECLARATION =
-      const StrongModeCode(ErrorType.COMPILE_TIME_ERROR,
-          'INVALID_PARAMETER_DECLARATION', _typeCheckMessage);
+      const StrongModeCode(
+          ErrorType.COMPILE_TIME_ERROR,
+          'INVALID_PARAMETER_DECLARATION',
+          "Type check failed: '{0}' isn't of type '{1}'.");
 
   static const StrongModeCode COULD_NOT_INFER = const StrongModeCode(
       ErrorType.COMPILE_TIME_ERROR,
       'COULD_NOT_INFER',
-      "Could not infer type parameter {0}, {1} must be of type {2}.");
+      "Couldn't infer type parameter '{0}'; '{1}' must be of type '{2}'.");
 
   static const StrongModeCode INFERRED_TYPE = const StrongModeCode(
       ErrorType.HINT, 'INFERRED_TYPE', _inferredTypeMessage);
@@ -4711,110 +4756,154 @@
   static const StrongModeCode INFERRED_TYPE_CLOSURE = const StrongModeCode(
       ErrorType.HINT, 'INFERRED_TYPE_CLOSURE', _inferredTypeMessage);
 
-  static const StrongModeCode STATIC_TYPE_ERROR = const StrongModeCode(
+  static const StrongModeCode INVALID_CAST_LITERAL = const StrongModeCode(
       ErrorType.COMPILE_TIME_ERROR,
-      'STATIC_TYPE_ERROR',
-      'Type check failed: {0} ({1}) is not of type {2}');
+      'INVALID_CAST_LITERAL',
+      "The literal '{0}' with type '{1}' isn't of expected type '{2}'.");
+
+  static const StrongModeCode INVALID_CAST_LITERAL_LIST = const StrongModeCode(
+      ErrorType.COMPILE_TIME_ERROR,
+      'INVALID_CAST_LITERAL_LIST',
+      "The list literal type '{0}' isn't of expected type '{1}'. The list's "
+      "type can be changed with an explicit generic type argument or by "
+      "changing the element types.");
+
+  static const StrongModeCode INVALID_CAST_LITERAL_MAP = const StrongModeCode(
+      ErrorType.COMPILE_TIME_ERROR,
+      'INVALID_CAST_LITERAL_MAP',
+      "The map literal type '{0}' isn't of expected type '{1}'. The maps's "
+      "type can be changed with an explicit generic type arguments or by "
+      "changing the key and value types.");
+
+  static const StrongModeCode INVALID_CAST_FUNCTION_EXPR = const StrongModeCode(
+      ErrorType.COMPILE_TIME_ERROR,
+      'INVALID_CAST_FUNCTION_EXPR',
+      "The function expression type '{0}' isn't of type '{1}'. "
+      "This means its parameter or return type does not match what is "
+      "expected. Consider changing parameter type(s) or the returned type(s).");
+
+  static const StrongModeCode INVALID_CAST_NEW_EXPR = const StrongModeCode(
+      ErrorType.COMPILE_TIME_ERROR,
+      'INVALID_CAST_NEW_EXPR',
+      "The constructor returns type '{0}' that isn't of expected type '{1}'.");
+
+  static const StrongModeCode INVALID_CAST_METHOD = const StrongModeCode(
+      ErrorType.COMPILE_TIME_ERROR,
+      'INVALID_CAST_METHOD',
+      "The method tear-off '{0}' has type '{1}' that isn't of expected type "
+      "'{2}'. This means its parameter or return type does not match what is "
+      "expected.");
+
+  static const StrongModeCode INVALID_CAST_FUNCTION = const StrongModeCode(
+      ErrorType.COMPILE_TIME_ERROR,
+      'INVALID_CAST_FUNCTION',
+      "The function '{0}' has type '{1}' that isn't of expected type "
+      "'{2}'. This means its parameter or return type does not match what is "
+      "expected.");
 
   static const StrongModeCode INVALID_SUPER_INVOCATION = const StrongModeCode(
       ErrorType.COMPILE_TIME_ERROR,
       'INVALID_SUPER_INVOCATION',
       "super call must be last in an initializer "
-      "list (see https://goo.gl/EY6hDP): {0}");
+      "list (see https://goo.gl/EY6hDP): '{0}'.");
 
   static const StrongModeCode NON_GROUND_TYPE_CHECK_INFO = const StrongModeCode(
       ErrorType.HINT,
       'NON_GROUND_TYPE_CHECK_INFO',
-      "Runtime check on non-ground type {0} may throw StrongModeError");
+      "Runtime check on non-ground type '{0}' may throw StrongModeError.");
 
   static const StrongModeCode DYNAMIC_INVOKE = const StrongModeCode(
-      ErrorType.HINT, 'DYNAMIC_INVOKE', '{0} requires a dynamic invoke');
+      ErrorType.HINT, 'DYNAMIC_INVOKE', "'{0}' requires a dynamic invoke.");
 
   static const StrongModeCode INVALID_METHOD_OVERRIDE = const StrongModeCode(
       ErrorType.COMPILE_TIME_ERROR,
       'INVALID_METHOD_OVERRIDE',
-      'Invalid override. $_invalidOverrideMessage');
+      "Invalid override. $_invalidOverrideMessage");
 
   static const StrongModeCode INVALID_METHOD_OVERRIDE_FROM_BASE =
       const StrongModeCode(
           ErrorType.COMPILE_TIME_ERROR,
           'INVALID_METHOD_OVERRIDE_FROM_BASE',
-          'Base class introduces an invalid override. '
-          '$_invalidOverrideMessage');
+          "Base class introduces an invalid override. $_invalidOverrideMessage");
 
   static const StrongModeCode INVALID_METHOD_OVERRIDE_FROM_MIXIN =
       const StrongModeCode(
           ErrorType.COMPILE_TIME_ERROR,
           'INVALID_METHOD_OVERRIDE_FROM_MIXIN',
-          'Mixin introduces an invalid override. $_invalidOverrideMessage');
+          "Mixin introduces an invalid override. $_invalidOverrideMessage");
 
   static const StrongModeCode INVALID_FIELD_OVERRIDE = const StrongModeCode(
       ErrorType.COMPILE_TIME_ERROR,
       'INVALID_FIELD_OVERRIDE',
-      'Field declaration {3}.{1} cannot be '
-      'overridden in {0}.');
+      "Field declaration '{3}.{1}' can't be overridden in '{0}'.");
 
   static const StrongModeCode IMPLICIT_DYNAMIC_PARAMETER = const StrongModeCode(
       ErrorType.COMPILE_TIME_ERROR,
       'IMPLICIT_DYNAMIC_PARAMETER',
-      "Missing parameter type for '{0}'$_implicitDynamicTip");
+      "Missing parameter type for '{0}'.",
+      _implicitDynamicCorrection);
 
   static const StrongModeCode IMPLICIT_DYNAMIC_RETURN = const StrongModeCode(
       ErrorType.COMPILE_TIME_ERROR,
       'IMPLICIT_DYNAMIC_RETURN',
-      "Missing return type for '{0}'$_implicitDynamicTip");
+      "Missing return type for '{0}'.",
+      _implicitDynamicCorrection);
 
   static const StrongModeCode IMPLICIT_DYNAMIC_VARIABLE = const StrongModeCode(
       ErrorType.COMPILE_TIME_ERROR,
       'IMPLICIT_DYNAMIC_VARIABLE',
-      "Missing variable type for '{0}'$_implicitDynamicTip");
+      "Missing variable type for '{0}'.",
+      _implicitDynamicCorrection);
 
   static const StrongModeCode IMPLICIT_DYNAMIC_FIELD = const StrongModeCode(
       ErrorType.COMPILE_TIME_ERROR,
       'IMPLICIT_DYNAMIC_FIELD',
-      "Missing field type for '{0}'$_implicitDynamicTip");
+      "Missing field type for '{0}'.",
+      _implicitDynamicCorrection);
 
   static const StrongModeCode IMPLICIT_DYNAMIC_TYPE = const StrongModeCode(
       ErrorType.COMPILE_TIME_ERROR,
       'IMPLICIT_DYNAMIC_TYPE',
-      "Missing type arguments for generic type '{0}'"
-      "$_implicitDynamicTip");
+      "Missing type arguments for generic type '{0}'.",
+      _implicitDynamicCorrection);
 
   static const StrongModeCode IMPLICIT_DYNAMIC_LIST_LITERAL =
       const StrongModeCode(
           ErrorType.COMPILE_TIME_ERROR,
           'IMPLICIT_DYNAMIC_LIST_LITERAL',
-          "Missing type argument for list literal$_implicitDynamicTip");
+          "Missing type argument for list literal.",
+          _implicitDynamicCorrection);
 
   static const StrongModeCode IMPLICIT_DYNAMIC_MAP_LITERAL =
       const StrongModeCode(
           ErrorType.COMPILE_TIME_ERROR,
           'IMPLICIT_DYNAMIC_MAP_LITERAL',
-          'Missing type arguments for map literal$_implicitDynamicTip');
+          "Missing type arguments for map literal.",
+          _implicitDynamicCorrection);
 
   static const StrongModeCode IMPLICIT_DYNAMIC_FUNCTION = const StrongModeCode(
       ErrorType.COMPILE_TIME_ERROR,
       'IMPLICIT_DYNAMIC_FUNCTION',
-      "Missing type arguments for generic function '{0}<{1}>'"
-      "$_implicitDynamicTip");
+      "Missing type arguments for generic function '{0}<{1}>'.",
+      _implicitDynamicCorrection);
 
   static const StrongModeCode IMPLICIT_DYNAMIC_METHOD = const StrongModeCode(
       ErrorType.COMPILE_TIME_ERROR,
       'IMPLICIT_DYNAMIC_METHOD',
-      "Missing type arguments for generic method '{0}<{1}>'"
-      "$_implicitDynamicTip");
+      "Missing type arguments for generic method '{0}<{1}>'.",
+      _implicitDynamicCorrection);
 
   static const StrongModeCode IMPLICIT_DYNAMIC_INVOKE = const StrongModeCode(
       ErrorType.COMPILE_TIME_ERROR,
       'IMPLICIT_DYNAMIC_INVOKE',
-      "Missing type arguments for calling generic function type '{0}'"
-      "$_implicitDynamicTip");
+      "Missing type arguments for calling generic function type '{0}'.",
+      _implicitDynamicCorrection);
 
-  static const StrongModeCode UNSAFE_BLOCK_CLOSURE_INFERENCE =
-      const StrongModeCode(
-          ErrorType.STATIC_WARNING,
-          'UNSAFE_BLOCK_CLOSURE_INFERENCE',
-          _unsafeBlockClosureInferenceMessage);
+  static const StrongModeCode UNSAFE_BLOCK_CLOSURE_INFERENCE = const StrongModeCode(
+      ErrorType.STATIC_WARNING,
+      'UNSAFE_BLOCK_CLOSURE_INFERENCE',
+      "Unsafe use of a block closure in a type-inferred variable outside a function body.",
+      "Try adding a type annotation for '{0}'. See dartbug.com/26947.");
 
   @override
   final ErrorType type;
@@ -4834,41 +4923,3 @@
   @override
   ErrorSeverity get errorSeverity => type.severity;
 }
-
-/**
- * The error code indicating a marker in code for work that needs to be finished
- * or revisited.
- */
-class TodoCode extends ErrorCode {
-  /**
-   * The single enum of TodoCode.
-   */
-  static const TodoCode TODO = const TodoCode('TODO');
-
-  /**
-   * This matches the two common Dart task styles
-   *
-   * * TODO:
-   * * TODO(username):
-   *
-   * As well as
-   * * TODO
-   *
-   * But not
-   * * todo
-   * * TODOS
-   */
-  static RegExp TODO_REGEX =
-      new RegExp("([\\s/\\*])((TODO[^\\w\\d][^\\r\\n]*)|(TODO:?\$))");
-
-  /**
-   * Initialize a newly created error code to have the given [name].
-   */
-  const TodoCode(String name) : super(name, "{0}");
-
-  @override
-  ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
-
-  @override
-  ErrorType get type => ErrorType.TODO;
-}
diff --git a/pkg/analyzer/lib/src/generated/bazel.dart b/pkg/analyzer/lib/src/generated/bazel.dart
index debd300..8d014c7 100644
--- a/pkg/analyzer/lib/src/generated/bazel.dart
+++ b/pkg/analyzer/lib/src/generated/bazel.dart
@@ -4,11 +4,14 @@
 
 library analyzer.src.generated.bazel;
 
+import 'dart:collection';
 import 'dart:core';
 
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/source_io.dart';
+import 'package:analyzer/src/util/fast_uri.dart';
+import 'package:path/path.dart';
 
 /**
  * Instances of the class `BazelFileUriResolver` resolve `file` URI's by first
@@ -16,54 +19,292 @@
  * corresponding generated directories.
  */
 class BazelFileUriResolver extends ResourceUriResolver {
-  /**
-   * The Bazel workspace directory.
-   */
-  final Folder _workspaceDir;
+  final BazelWorkspace workspace;
 
-  /**
-   * The build directories that relative `file` URI's should use to resolve
-   * relative URIs.
-   */
-  final List<Folder> _buildDirectories;
-
-  BazelFileUriResolver(
-      ResourceProvider provider, this._workspaceDir, this._buildDirectories)
-      : super(provider);
+  BazelFileUriResolver(BazelWorkspace workspace)
+      : workspace = workspace,
+        super(workspace.provider);
 
   @override
   Source resolveAbsolute(Uri uri, [Uri actualUri]) {
     if (!ResourceUriResolver.isFileUri(uri)) {
       return null;
     }
-
-    File uriFile = provider.getFile(provider.pathContext.fromUri(uri));
-    if (uriFile.exists) {
-      return uriFile.createSource(actualUri ?? uri);
-    }
-
-    String relativeFromWorkspaceDir = _getPathFromWorkspaceDir(uri);
-    if (_buildDirectories.isEmpty || relativeFromWorkspaceDir.isEmpty) {
-      return null;
-    }
-
-    for (Folder buildDir in _buildDirectories) {
-      File file = buildDir.getChildAssumingFile(relativeFromWorkspaceDir);
-      if (file.exists) {
-        return file.createSource(actualUri ?? uri);
-      }
+    String path = provider.pathContext.fromUri(uri);
+    File file = workspace.findFile(path);
+    if (file != null) {
+      return file.createSource(actualUri ?? uri);
     }
     return null;
   }
+}
 
-  String _getPathFromWorkspaceDir(Uri uri) {
-    String uriPath = uri.path;
-    String workspacePath = _workspaceDir.path;
+/**
+ * The [UriResolver] that can resolve `package` URIs in [BazelWorkspace].
+ */
+class BazelPackageUriResolver extends UriResolver {
+  final BazelWorkspace _workspace;
+  final Context _context;
 
-    if (uriPath.startsWith(workspacePath) &&
-        workspacePath.length < uriPath.length) {
-      return uriPath.substring(workspacePath.length + 1);
+  /**
+   * The cache of absolute [Uri]s to [Source]s mappings.
+   */
+  final Map<Uri, Source> _sourceCache = new HashMap<Uri, Source>();
+
+  BazelPackageUriResolver(BazelWorkspace workspace)
+      : _workspace = workspace,
+        _context = workspace.provider.pathContext;
+
+  @override
+  Source resolveAbsolute(Uri uri, [Uri actualUri]) {
+    return _sourceCache.putIfAbsent(uri, () {
+      if (uri.scheme != 'package') {
+        return null;
+      }
+      String uriPath = uri.path;
+      int slash = uriPath.indexOf('/');
+
+      // If the path either starts with a slash or has no slash, it is invalid.
+      if (slash < 1) {
+        return null;
+      }
+
+      String packageName = uriPath.substring(0, slash);
+      String fileUriPart = uriPath.substring(slash + 1);
+      String filePath = fileUriPart.replaceAll('/', _context.separator);
+
+      if (packageName.indexOf('.') == -1) {
+        String path = _context.join(_workspace.root, 'third_party', 'dart',
+            packageName, 'lib', filePath);
+        File file = _workspace.findFile(path);
+        return file?.createSource(uri);
+      } else {
+        String packagePath = packageName.replaceAll('.', _context.separator);
+        String path =
+            _context.join(_workspace.root, packagePath, 'lib', filePath);
+        File file = _workspace.findFile(path);
+        return file?.createSource(uri);
+      }
+    });
+  }
+
+  @override
+  Uri restoreAbsolute(Source source) {
+    Context context = _workspace.provider.pathContext;
+    String path = source.fullName;
+
+    Uri restore(String root, String path) {
+      if (root != null && context.isWithin(root, path)) {
+        String relative = context.relative(path, from: root);
+        List<String> components = context.split(relative);
+        if (components.length >= 1 && components[0] == 'third_party') {
+          if (components.length > 4 &&
+              components[1] == 'dart' &&
+              components[3] == 'lib') {
+            String packageName = components[2];
+            String pathInLib = components.skip(4).join('/');
+            return FastUri.parse('package:$packageName/$pathInLib');
+          }
+        } else {
+          for (int i = 2; i < components.length - 1; i++) {
+            String component = components[i];
+            if (component == 'lib') {
+              String packageName = components.getRange(0, i).join('.');
+              String pathInLib = components.skip(i + 1).join('/');
+              return FastUri.parse('package:$packageName/$pathInLib');
+            }
+          }
+        }
+      }
+      return null;
     }
-    return '';
+
+    // Search in each root.
+    for (String root in [
+      _workspace.bin,
+      _workspace.genfiles,
+      _workspace.readonly,
+      _workspace.root
+    ]) {
+      Uri uri = restore(root, path);
+      if (uri != null) {
+        return uri;
+      }
+    }
+
+    return null;
+  }
+}
+
+/**
+ * Information about a Bazel workspace.
+ */
+class BazelWorkspace {
+  static const String _WORKSPACE = 'WORKSPACE';
+  static const String _READONLY = 'READONLY';
+
+  /**
+   * Default prefix for "-genfiles" and "-bin" that will be assumed if no build
+   * output symlinks are found.
+   */
+  static const defaultSymlinkPrefix = 'bazel';
+
+  final ResourceProvider provider;
+
+  /**
+   * The absolute workspace root path.
+   *
+   * It contains the `WORKSPACE` file or its parent contains the `READONLY`
+   * folder.
+   */
+  final String root;
+
+  /**
+   * The absolute path to the optional read only workspace root, in the
+   * `READONLY` folder if a git-based workspace, or `null`.
+   */
+  final String readonly;
+
+  /**
+   * The absolute path to the `bazel-bin` folder.
+   */
+  final String bin;
+
+  /**
+   * The absolute path to the `bazel-genfiles` folder.
+   */
+  final String genfiles;
+
+  BazelWorkspace._(
+      this.provider, this.root, this.readonly, this.bin, this.genfiles);
+
+  /**
+   * Return the file with the given [absolutePath], looking first into
+   * directories for generated files: `bazel-bin` and `bazel-genfiles`, and
+   * then into the workspace root. The file in the workspace root is returned
+   * even if it does not exist. Return `null` if the given [absolutePath] is
+   * not in the workspace [root].
+   */
+  File findFile(String absolutePath) {
+    Context context = provider.pathContext;
+    try {
+      String relative = context.relative(absolutePath, from: root);
+      // genfiles
+      if (genfiles != null) {
+        File file = provider.getFile(context.join(genfiles, relative));
+        if (file.exists) {
+          return file;
+        }
+      }
+      // bin
+      if (bin != null) {
+        File file = provider.getFile(context.join(bin, relative));
+        if (file.exists) {
+          return file;
+        }
+      }
+      // Writable
+      File writableFile = provider.getFile(absolutePath);
+      if (writableFile.exists) {
+        return writableFile;
+      }
+      // READONLY
+      if (readonly != null) {
+        File file = provider.getFile(context.join(readonly, relative));
+        if (file.exists) {
+          return file;
+        }
+      }
+      // Not generated, return the default one.
+      return writableFile;
+    } catch (_) {
+      return null;
+    }
+  }
+
+  /**
+   * Find the Bazel workspace that contains the given [path].
+   *
+   * Return `null` if a workspace markers, such as the `WORKSPACE` file, or
+   * the sibling `READONLY` folder cannot be found.
+   *
+   * Return `null` if the workspace does not have `bazel-genfiles` or
+   * `blaze-genfiles` folders, so we don't know where to search generated files.
+   *
+   * Return `null` if there is a folder 'foo' with the sibling `READONLY`
+   * folder, but there is corresponding folder 'foo' in `READONLY`, i.e. the
+   * corresponding readonly workspace root.
+   */
+  static BazelWorkspace find(ResourceProvider provider, String path) {
+    Context context = provider.pathContext;
+
+    // Ensure that the path is absolute and normalized.
+    if (!context.isAbsolute(path)) {
+      throw new ArgumentError('not absolute: $path');
+    }
+    path = context.normalize(path);
+
+    Folder folder = provider.getFolder(path);
+    while (true) {
+      Folder parent = folder.parent;
+      if (parent == null) {
+        return null;
+      }
+
+      // Found the READONLY folder, might be a git-based workspace.
+      Folder readonlyFolder = parent.getChildAssumingFolder(_READONLY);
+      if (readonlyFolder.exists) {
+        String root = folder.path;
+        String readonlyRoot =
+            context.join(readonlyFolder.path, folder.shortName);
+        if (provider.getFolder(readonlyRoot).exists) {
+          String symlinkPrefix = _findSymlinkPrefix(provider, root);
+          if (symlinkPrefix != null) {
+            return new BazelWorkspace._(
+                provider,
+                root,
+                readonlyRoot,
+                context.join(root, '$symlinkPrefix-bin'),
+                context.join(root, '$symlinkPrefix-genfiles'));
+          }
+        }
+      }
+
+      // Found the WORKSPACE file, must be a non-git workspace.
+      if (folder.getChildAssumingFile(_WORKSPACE).exists) {
+        String root = folder.path;
+        String symlinkPrefix = _findSymlinkPrefix(provider, root);
+        if (symlinkPrefix == null) {
+          return null;
+        }
+        return new BazelWorkspace._(
+            provider,
+            root,
+            null,
+            context.join(root, '$symlinkPrefix-bin'),
+            context.join(root, '$symlinkPrefix-genfiles'));
+      }
+
+      // Go up the folder.
+      folder = parent;
+    }
+  }
+
+  /**
+   * Return the symlink prefix for folders `X-bin` or `X-genfiles` by probing
+   * the internal `blaze-genfiles` and `bazel-genfiles`. Make a default
+   * assumption according to defaultSymlinkPrefix if neither of the folders
+   * exists.
+   */
+  static String _findSymlinkPrefix(ResourceProvider provider, String root) {
+    Context context = provider.pathContext;
+    if (provider.getFolder(context.join(root, 'blaze-genfiles')).exists) {
+      return 'blaze';
+    }
+    if (provider.getFolder(context.join(root, 'bazel-genfiles')).exists) {
+      return 'bazel';
+    }
+    // Couldn't find it.  Make a default assumption.
+    return defaultSymlinkPrefix;
   }
 }
diff --git a/pkg/analyzer/lib/src/generated/constant.dart b/pkg/analyzer/lib/src/generated/constant.dart
index 6dd6c16..db0eb79 100644
--- a/pkg/analyzer/lib/src/generated/constant.dart
+++ b/pkg/analyzer/lib/src/generated/constant.dart
@@ -97,7 +97,6 @@
 /// In addition, this class defines several values that can be returned to
 /// indicate various conditions encountered during evaluation. These are
 /// documented with the static fields that define those values.
-@deprecated
 class ConstantEvaluator {
   /**
    * The source containing the expression(s) that will be evaluated.
diff --git a/pkg/analyzer/lib/src/generated/declaration_resolver.dart b/pkg/analyzer/lib/src/generated/declaration_resolver.dart
new file mode 100644
index 0000000..90f3483
--- /dev/null
+++ b/pkg/analyzer/lib/src/generated/declaration_resolver.dart
@@ -0,0 +1,724 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 analyzer.src.generated.declaration_resolver;
+
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/ast/token.dart';
+import 'package:analyzer/dart/ast/visitor.dart';
+import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer/exception/exception.dart';
+import 'package:analyzer/src/dart/element/builder.dart';
+import 'package:analyzer/src/dart/element/element.dart';
+import 'package:analyzer/src/generated/resolver.dart';
+
+/**
+ * A visitor that resolves declarations in an AST structure to already built
+ * elements.
+ *
+ * The resulting AST must have everything resolved that would have been resolved
+ * by a [CompilationUnitBuilder] (that is, must be a valid [RESOLVED_UNIT1]).
+ * This class must not assume that the [CompilationUnitElement] passed to it is
+ * any more complete than a [COMPILATION_UNIT_ELEMENT].
+ */
+class DeclarationResolver extends RecursiveAstVisitor<Object> {
+  /**
+   * The compilation unit containing the AST nodes being visited.
+   */
+  CompilationUnitElementImpl _enclosingUnit;
+
+  /**
+   * The [ElementWalker] we are using to keep track of progress through the
+   * element model.
+   */
+  ElementWalker _walker;
+
+  /**
+   * Resolve the declarations within the given compilation [unit] to the
+   * elements rooted at the given [element]. Throw an [ElementMismatchException]
+   * if the element model and compilation unit do not match each other.
+   */
+  void resolve(CompilationUnit unit, CompilationUnitElement element) {
+    _enclosingUnit = element;
+    _walker = new ElementWalker.forCompilationUnit(element);
+    unit.element = element;
+    try {
+      unit.accept(this);
+      _walker.validate();
+    } on Error catch (e, st) {
+      throw new _ElementMismatchException(
+          element, _walker.element, new CaughtException(e, st));
+    }
+  }
+
+  @override
+  Object visitAnnotation(Annotation node) {
+    // Annotations can only contain elements in certain erroneous situations,
+    // in which case the elements are disconnected from the rest of the element
+    // model, thus we can't reconnect to them.  To avoid crashes, just create
+    // fresh elements.
+    ElementHolder elementHolder = new ElementHolder();
+    new ElementBuilder(elementHolder, _enclosingUnit).visitAnnotation(node);
+    return null;
+  }
+
+  @override
+  Object visitBlockFunctionBody(BlockFunctionBody node) {
+    if (_isBodyToCreateElementsFor(node)) {
+      _walker.consumeLocalElements();
+      node.accept(_walker.elementBuilder);
+      return null;
+    } else {
+      return super.visitBlockFunctionBody(node);
+    }
+  }
+
+  @override
+  Object visitCatchClause(CatchClause node) {
+    _walker.elementBuilder.buildCatchVariableElements(node);
+    return super.visitCatchClause(node);
+  }
+
+  @override
+  Object visitClassDeclaration(ClassDeclaration node) {
+    ClassElement element = _match(node.name, _walker.getClass());
+    _walk(new ElementWalker.forClass(element), () {
+      super.visitClassDeclaration(node);
+    });
+    _resolveMetadata(node, node.metadata, element);
+    return null;
+  }
+
+  @override
+  Object visitClassTypeAlias(ClassTypeAlias node) {
+    ClassElement element = _match(node.name, _walker.getClass());
+    _walk(new ElementWalker.forClass(element), () {
+      super.visitClassTypeAlias(node);
+    });
+    _resolveMetadata(node, node.metadata, element);
+    return null;
+  }
+
+  @override
+  Object visitConstructorDeclaration(ConstructorDeclaration node) {
+    ConstructorElement element = _match(node.name, _walker.getConstructor(),
+        offset: node.name?.offset ?? node.returnType.offset);
+    _walk(new ElementWalker.forExecutable(element, _enclosingUnit), () {
+      node.element = element;
+      super.visitConstructorDeclaration(node);
+    });
+    _resolveMetadata(node, node.metadata, element);
+    return null;
+  }
+
+  @override
+  Object visitDeclaredIdentifier(DeclaredIdentifier node) {
+    // Declared identifiers can only occur inside executable elements.
+    _walker.elementBuilder.visitDeclaredIdentifier(node);
+    return null;
+  }
+
+  @override
+  Object visitDefaultFormalParameter(DefaultFormalParameter node) {
+    ParameterElement element =
+        _match(node.parameter.identifier, _walker.getParameter());
+    Expression defaultValue = node.defaultValue;
+    if (defaultValue != null) {
+      _walk(
+          new ElementWalker.forExecutable(element.initializer, _enclosingUnit),
+          () {
+        defaultValue.accept(this);
+      });
+    }
+    _walk(new ElementWalker.forParameter(element), () {
+      node.parameter.accept(this);
+    });
+    _resolveMetadata(node, node.metadata, element);
+    return null;
+  }
+
+  @override
+  Object visitEnumDeclaration(EnumDeclaration node) {
+    ClassElement element = _match(node.name, _walker.getEnum());
+    _walk(new ElementWalker.forClass(element), () {
+      for (EnumConstantDeclaration constant in node.constants) {
+        _match(constant.name, _walker.getVariable());
+      }
+      super.visitEnumDeclaration(node);
+    });
+    _resolveMetadata(node, node.metadata, element);
+    return null;
+  }
+
+  @override
+  Object visitExportDirective(ExportDirective node) {
+    super.visitExportDirective(node);
+    List<ElementAnnotation> annotations =
+        _enclosingUnit.getAnnotations(node.offset);
+    if (annotations.isEmpty && node.metadata.isNotEmpty) {
+      int index = (node.parent as CompilationUnit)
+          .directives
+          .where((directive) => directive is ExportDirective)
+          .toList()
+          .indexOf(node);
+      annotations = _walker.element.library.exports[index].metadata;
+    }
+    _resolveAnnotations(node, node.metadata, annotations);
+    return null;
+  }
+
+  @override
+  Object visitExpressionFunctionBody(ExpressionFunctionBody node) {
+    if (_isBodyToCreateElementsFor(node)) {
+      _walker.consumeLocalElements();
+      node.accept(_walker.elementBuilder);
+      return null;
+    } else {
+      return super.visitExpressionFunctionBody(node);
+    }
+  }
+
+  @override
+  Object visitFieldDeclaration(FieldDeclaration node) {
+    super.visitFieldDeclaration(node);
+    _resolveMetadata(node, node.metadata, node.fields.variables[0].element);
+    return null;
+  }
+
+  @override
+  Object visitFieldFormalParameter(FieldFormalParameter node) {
+    if (node.parent is! DefaultFormalParameter) {
+      ParameterElement element =
+          _match(node.identifier, _walker.getParameter());
+      _walk(new ElementWalker.forParameter(element), () {
+        super.visitFieldFormalParameter(node);
+      });
+      _resolveMetadata(node, node.metadata, element);
+      return null;
+    } else {
+      return super.visitFieldFormalParameter(node);
+    }
+  }
+
+  @override
+  Object visitFunctionDeclaration(FunctionDeclaration node) {
+    SimpleIdentifier functionName = node.name;
+    Token property = node.propertyKeyword;
+    ExecutableElement element;
+    if (property == null) {
+      element = _match(functionName, _walker.getFunction());
+    } else {
+      if (_walker.element is ExecutableElement) {
+        element = _match(functionName, _walker.getFunction());
+      } else if (property.keyword == Keyword.GET) {
+        element = _match(functionName, _walker.getAccessor());
+      } else {
+        assert(property.keyword == Keyword.SET);
+        element = _match(functionName, _walker.getAccessor(),
+            elementName: functionName.name + '=');
+      }
+    }
+    node.functionExpression.element = element;
+    _walker._elementHolder?.addFunction(element);
+    _walk(new ElementWalker.forExecutable(element, _enclosingUnit), () {
+      super.visitFunctionDeclaration(node);
+    });
+    _resolveMetadata(node, node.metadata, element);
+    return null;
+  }
+
+  @override
+  Object visitFunctionExpression(FunctionExpression node) {
+    if (node.parent is! FunctionDeclaration) {
+      FunctionElement element = _walker.getFunction();
+      _matchOffset(element, node.offset);
+      node.element = element;
+      _walker._elementHolder.addFunction(element);
+      _walk(new ElementWalker.forExecutable(element, _enclosingUnit), () {
+        super.visitFunctionExpression(node);
+      });
+      return null;
+    } else {
+      return super.visitFunctionExpression(node);
+    }
+  }
+
+  @override
+  Object visitFunctionTypeAlias(FunctionTypeAlias node) {
+    FunctionTypeAliasElement element = _match(node.name, _walker.getTypedef());
+    _walk(new ElementWalker.forTypedef(element), () {
+      super.visitFunctionTypeAlias(node);
+    });
+    _resolveMetadata(node, node.metadata, element);
+    return null;
+  }
+
+  @override
+  Object visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
+    if (node.parent is! DefaultFormalParameter) {
+      ParameterElement element =
+          _match(node.identifier, _walker.getParameter());
+      _walk(new ElementWalker.forParameter(element), () {
+        super.visitFunctionTypedFormalParameter(node);
+      });
+      _resolveMetadata(node, node.metadata, element);
+      return null;
+    } else {
+      return super.visitFunctionTypedFormalParameter(node);
+    }
+  }
+
+  @override
+  Object visitImportDirective(ImportDirective node) {
+    super.visitImportDirective(node);
+    List<ElementAnnotation> annotations =
+        _enclosingUnit.getAnnotations(node.offset);
+    if (annotations.isEmpty && node.metadata.isNotEmpty) {
+      int index = (node.parent as CompilationUnit)
+          .directives
+          .where((directive) => directive is ImportDirective)
+          .toList()
+          .indexOf(node);
+      annotations = _walker.element.library.imports[index].metadata;
+    }
+    _resolveAnnotations(node, node.metadata, annotations);
+    return null;
+  }
+
+  @override
+  Object visitLabeledStatement(LabeledStatement node) {
+    bool onSwitchStatement = node.statement is SwitchStatement;
+    _walker.elementBuilder
+        .buildLabelElements(node.labels, onSwitchStatement, false);
+    return super.visitLabeledStatement(node);
+  }
+
+  @override
+  Object visitLibraryDirective(LibraryDirective node) {
+    super.visitLibraryDirective(node);
+    List<ElementAnnotation> annotations =
+        _enclosingUnit.getAnnotations(node.offset);
+    if (annotations.isEmpty && node.metadata.isNotEmpty) {
+      annotations = _walker.element.library.metadata;
+    }
+    _resolveAnnotations(node, node.metadata, annotations);
+    return null;
+  }
+
+  @override
+  Object visitMethodDeclaration(MethodDeclaration node) {
+    Token property = node.propertyKeyword;
+    SimpleIdentifier methodName = node.name;
+    String nameOfMethod = methodName.name;
+    ExecutableElement element;
+    if (property == null) {
+      String elementName = nameOfMethod == '-' &&
+              node.parameters != null &&
+              node.parameters.parameters.isEmpty
+          ? 'unary-'
+          : nameOfMethod;
+      element =
+          _match(methodName, _walker.getFunction(), elementName: elementName);
+    } else {
+      if (property.keyword == Keyword.GET) {
+        element = _match(methodName, _walker.getAccessor());
+      } else {
+        assert(property.keyword == Keyword.SET);
+        element = _match(methodName, _walker.getAccessor(),
+            elementName: nameOfMethod + '=');
+      }
+    }
+    _walk(new ElementWalker.forExecutable(element, _enclosingUnit), () {
+      super.visitMethodDeclaration(node);
+    });
+    _resolveMetadata(node, node.metadata, element);
+    return null;
+  }
+
+  @override
+  Object visitPartDirective(PartDirective node) {
+    super.visitPartDirective(node);
+    _resolveAnnotations(
+        node, node.metadata, _enclosingUnit.getAnnotations(node.offset));
+    return null;
+  }
+
+  @override
+  Object visitPartOfDirective(PartOfDirective node) {
+    node.element = _enclosingUnit.library;
+    return super.visitPartOfDirective(node);
+  }
+
+  @override
+  Object visitSimpleFormalParameter(SimpleFormalParameter node) {
+    if (node.parent is! DefaultFormalParameter) {
+      ParameterElement element =
+          _match(node.identifier, _walker.getParameter());
+      _walk(new ElementWalker.forParameter(element), () {
+        super.visitSimpleFormalParameter(node);
+      });
+      _resolveMetadata(node, node.metadata, element);
+      return null;
+    } else {
+      return super.visitSimpleFormalParameter(node);
+    }
+  }
+
+  @override
+  Object visitSwitchCase(SwitchCase node) {
+    _walker.elementBuilder.buildLabelElements(node.labels, false, true);
+    return super.visitSwitchCase(node);
+  }
+
+  @override
+  Object visitSwitchDefault(SwitchDefault node) {
+    _walker.elementBuilder.buildLabelElements(node.labels, false, true);
+    return super.visitSwitchDefault(node);
+  }
+
+  @override
+  Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
+    super.visitTopLevelVariableDeclaration(node);
+    _resolveMetadata(node, node.metadata, node.variables.variables[0].element);
+    return null;
+  }
+
+  @override
+  Object visitTypeParameter(TypeParameter node) {
+    Element element = _match(node.name, _walker.getTypeParameter());
+    super.visitTypeParameter(node);
+    _resolveMetadata(node, node.metadata, element);
+    return null;
+  }
+
+  @override
+  Object visitVariableDeclaration(VariableDeclaration node) {
+    VariableElement element = _match(node.name, _walker.getVariable());
+    Expression initializer = node.initializer;
+    if (initializer != null) {
+      _walk(
+          new ElementWalker.forExecutable(element.initializer, _enclosingUnit),
+          () {
+        super.visitVariableDeclaration(node);
+      });
+      return null;
+    } else {
+      return super.visitVariableDeclaration(node);
+    }
+  }
+
+  @override
+  Object visitVariableDeclarationList(VariableDeclarationList node) {
+    if (_walker.elementBuilder != null) {
+      return _walker.elementBuilder.visitVariableDeclarationList(node);
+    } else {
+      super.visitVariableDeclarationList(node);
+      if (node.parent is! FieldDeclaration &&
+          node.parent is! TopLevelVariableDeclaration) {
+        _resolveMetadata(node, node.metadata, node.variables[0].element);
+      }
+      return null;
+    }
+  }
+
+  /**
+   * Updates [identifier] to point to [element], after ensuring that the
+   * element has the expected name.
+   *
+   * If no [elementName] is given, it defaults to the name of the [identifier]
+   * (or the empty string if [identifier] is `null`).
+   *
+   * If [identifier] is `null`, nothing is updated, but the element name is
+   * still checked.
+   */
+  Element/*=E*/ _match/*<E extends Element>*/(
+      SimpleIdentifier identifier, Element/*=E*/ element,
+      {String elementName, int offset}) {
+    elementName ??= identifier?.name ?? '';
+    offset ??= identifier.offset;
+    if (element.name != elementName) {
+      throw new StateError(
+          'Expected an element matching `$elementName`, got `${element.name}`');
+    }
+    identifier?.staticElement = element;
+    _matchOffset(element, offset);
+    return element;
+  }
+
+  void _matchOffset(Element element, int offset) {
+    if (element.nameOffset != 0 && element.nameOffset != offset) {
+      throw new StateError('Element offset mismatch');
+    } else {
+      (element as ElementImpl).nameOffset = offset;
+    }
+  }
+
+  /**
+   * Associate each of the annotation [nodes] with the corresponding
+   * [ElementAnnotation] in [annotations]. If there is a problem, report it
+   * against the given [parent] node.
+   */
+  void _resolveAnnotations(AstNode parent, NodeList<Annotation> nodes,
+      List<ElementAnnotation> annotations) {
+    int nodeCount = nodes.length;
+    if (nodeCount != annotations.length) {
+      throw new StateError('Found $nodeCount annotation nodes and '
+          '${annotations.length} element annotations');
+    }
+    for (int i = 0; i < nodeCount; i++) {
+      nodes[i].elementAnnotation = annotations[i];
+    }
+  }
+
+  /**
+   * If [element] is not `null`, associate each of the annotation [nodes] with
+   * the corresponding [ElementAnnotation] in [element.metadata]. If there is a
+   * problem, report it against the given [parent] node.
+   *
+   * If [element] is `null`, do nothing--this allows us to be robust in the
+   * case where we are operating on an element model that hasn't been fully
+   * built.
+   */
+  void _resolveMetadata(
+      AstNode parent, NodeList<Annotation> nodes, Element element) {
+    if (element != null) {
+      _resolveAnnotations(parent, nodes, element.metadata);
+    }
+  }
+
+  /**
+   * Recurses through the element model and AST, verifying that all elements are
+   * matched.
+   *
+   * Executes [callback] with [_walker] pointing to the given [walker] (which
+   * should be a new instance of [ElementWalker]).  Once [callback] returns,
+   * uses [ElementWalker.validate] to verify that all expected elements have
+   * been matched.
+   */
+  void _walk(ElementWalker walker, void callback()) {
+    ElementWalker outerWalker = _walker;
+    _walker = walker;
+    callback();
+    walker.validate();
+    _walker = outerWalker;
+  }
+
+  static bool _isBodyToCreateElementsFor(FunctionBody node) {
+    AstNode parent = node.parent;
+    return parent is ConstructorDeclaration ||
+        parent is MethodDeclaration ||
+        parent.parent is FunctionDeclaration &&
+            parent.parent.parent is CompilationUnit;
+  }
+}
+
+/**
+ * Keeps track of the set of non-synthetic child elements of an element,
+ * yielding them one at a time in response to "get" method calls.
+ */
+class ElementWalker {
+  /**
+   * The element whose child elements are being walked.
+   */
+  final Element element;
+
+  /**
+   * If [element] is an executable element, an element builder which is
+   * accumulating the executable element's local variables and labels.
+   * Otherwise `null`.
+   */
+  LocalElementBuilder elementBuilder;
+
+  /**
+   * If [element] is an executable element, the element holder associated with
+   * [elementBuilder].  Otherwise `null`.
+   */
+  ElementHolder _elementHolder;
+
+  List<PropertyAccessorElement> _accessors;
+  int _accessorIndex = 0;
+  List<ClassElement> _classes;
+  int _classIndex = 0;
+  List<ConstructorElement> _constructors;
+  int _constructorIndex = 0;
+  List<ClassElement> _enums;
+  int _enumIndex = 0;
+  List<ExecutableElement> _functions;
+  int _functionIndex = 0;
+  List<ParameterElement> _parameters;
+  int _parameterIndex = 0;
+  List<FunctionTypeAliasElement> _typedefs;
+  int _typedefIndex = 0;
+  List<TypeParameterElement> _typeParameters;
+  int _typeParameterIndex = 0;
+  List<VariableElement> _variables;
+  int _variableIndex = 0;
+
+  /**
+   * Creates an [ElementWalker] which walks the child elements of a class
+   * element.
+   */
+  ElementWalker.forClass(ClassElement element)
+      : element = element,
+        _accessors = element.accessors.where(_isNotSynthetic).toList(),
+        _constructors = element.isMixinApplication
+            ? null
+            : element.constructors.where(_isNotSynthetic).toList(),
+        _functions = element.methods,
+        _typeParameters = element.typeParameters,
+        _variables = element.fields.where(_isNotSynthetic).toList();
+
+  /**
+   * Creates an [ElementWalker] which walks the child elements of a compilation
+   * unit element.
+   */
+  ElementWalker.forCompilationUnit(CompilationUnitElement compilationUnit)
+      : element = compilationUnit,
+        _accessors = compilationUnit.accessors.where(_isNotSynthetic).toList(),
+        _classes = compilationUnit.types,
+        _enums = compilationUnit.enums,
+        _functions = compilationUnit.functions,
+        _typedefs = compilationUnit.functionTypeAliases,
+        _variables =
+            compilationUnit.topLevelVariables.where(_isNotSynthetic).toList();
+
+  /**
+   * Creates an [ElementWalker] which walks the child elements of a compilation
+   * unit element.
+   */
+  ElementWalker.forExecutable(
+      ExecutableElement element, CompilationUnitElement compilationUnit)
+      : this._forExecutable(element, compilationUnit, new ElementHolder());
+
+  /**
+   * Creates an [ElementWalker] which walks the child elements of a parameter
+   * element.
+   */
+  ElementWalker.forParameter(ParameterElement element)
+      : element = element,
+        _parameters = element.parameters,
+        _typeParameters = element.typeParameters;
+
+  /**
+   * Creates an [ElementWalker] which walks the child elements of a typedef
+   * element.
+   */
+  ElementWalker.forTypedef(FunctionTypeAliasElement element)
+      : element = element,
+        _parameters = element.parameters,
+        _typeParameters = element.typeParameters;
+
+  ElementWalker._forExecutable(ExecutableElement element,
+      CompilationUnitElement compilationUnit, ElementHolder elementHolder)
+      : element = element,
+        elementBuilder =
+            new LocalElementBuilder(elementHolder, compilationUnit),
+        _elementHolder = elementHolder,
+        _functions = element.functions,
+        _parameters = element.parameters,
+        _typeParameters = element.typeParameters;
+
+  void consumeLocalElements() {
+    _functionIndex = _functions.length;
+  }
+
+  /**
+   * Returns the next non-synthetic child of [element] which is an accessor;
+   * throws an [IndexError] if there are no more.
+   */
+  PropertyAccessorElement getAccessor() => _accessors[_accessorIndex++];
+
+  /**
+   * Returns the next non-synthetic child of [element] which is a class; throws
+   * an [IndexError] if there are no more.
+   */
+  ClassElement getClass() => _classes[_classIndex++];
+
+  /**
+   * Returns the next non-synthetic child of [element] which is a constructor;
+   * throws an [IndexError] if there are no more.
+   */
+  ConstructorElement getConstructor() => _constructors[_constructorIndex++];
+
+  /**
+   * Returns the next non-synthetic child of [element] which is an enum; throws
+   * an [IndexError] if there are no more.
+   */
+  ClassElement getEnum() => _enums[_enumIndex++];
+
+  /**
+   * Returns the next non-synthetic child of [element] which is a top level
+   * function, method, or local function; throws an [IndexError] if there are no
+   * more.
+   */
+  ExecutableElement getFunction() => _functions[_functionIndex++];
+
+  /**
+   * Returns the next non-synthetic child of [element] which is a parameter;
+   * throws an [IndexError] if there are no more.
+   */
+  ParameterElement getParameter() => _parameters[_parameterIndex++];
+
+  /**
+   * Returns the next non-synthetic child of [element] which is a typedef;
+   * throws an [IndexError] if there are no more.
+   */
+  FunctionTypeAliasElement getTypedef() => _typedefs[_typedefIndex++];
+
+  /**
+   * Returns the next non-synthetic child of [element] which is a type
+   * parameter; throws an [IndexError] if there are no more.
+   */
+  TypeParameterElement getTypeParameter() =>
+      _typeParameters[_typeParameterIndex++];
+
+  /**
+   * Returns the next non-synthetic child of [element] which is a top level
+   * variable, field, or local variable; throws an [IndexError] if there are no
+   * more.
+   */
+  VariableElement getVariable() => _variables[_variableIndex++];
+
+  /**
+   * Verifies that all non-synthetic children of [element] have been obtained
+   * from their corresponding "get" method calls; if not, throws a [StateError].
+   */
+  void validate() {
+    void check(List<Element> elements, int index) {
+      if (elements != null && elements.length != index) {
+        throw new StateError(
+            'Unmatched ${elements[index].runtimeType} ${elements[index]}');
+      }
+    }
+
+    check(_accessors, _accessorIndex);
+    check(_classes, _classIndex);
+    check(_constructors, _constructorIndex);
+    check(_enums, _enumIndex);
+    check(_functions, _functionIndex);
+    check(_parameters, _parameterIndex);
+    check(_typedefs, _typedefIndex);
+    check(_typeParameters, _typeParameterIndex);
+    check(_variables, _variableIndex);
+    Element element = this.element;
+    if (element is ExecutableElementImpl) {
+      element.functions = _elementHolder.functions;
+      element.labels = _elementHolder.labels;
+      element.localVariables = _elementHolder.localVariables;
+    }
+  }
+
+  static bool _isNotSynthetic(Element e) => !e.isSynthetic;
+}
+
+class _ElementMismatchException extends AnalysisException {
+  /**
+   * Creates an exception to refer to the given [compilationUnit], [element],
+   * and [cause].
+   */
+  _ElementMismatchException(
+      CompilationUnitElement compilationUnit, Element element,
+      [CaughtException cause = null])
+      : super('Element mismatch in $compilationUnit at $element', cause);
+}
diff --git a/pkg/analyzer/lib/src/generated/element_resolver.dart b/pkg/analyzer/lib/src/generated/element_resolver.dart
index d3fdd99..5c44f86 100644
--- a/pkg/analyzer/lib/src/generated/element_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/element_resolver.dart
@@ -1577,11 +1577,17 @@
 
       NodeList<TypeName> arguments = typeArguments?.arguments;
       if (arguments != null && arguments.length != parameters.length) {
-        _resolver.errorReporter.reportErrorForNode(
-            StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS,
-            node,
-            [invokeType, parameters.length, arguments?.length ?? 0]);
-
+        if (_resolver.strongMode) {
+          _resolver.errorReporter.reportErrorForNode(
+              StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD,
+              node,
+              [invokeType, parameters.length, arguments?.length ?? 0]);
+        } else {
+          _resolver.errorReporter.reportErrorForNode(
+              HintCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD,
+              node,
+              [invokeType, parameters.length, arguments?.length ?? 0]);
+        }
         // Wrong number of type arguments. Ignore them.
         arguments = null;
       }
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
index 01b2ced..3860533 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -14,6 +14,7 @@
 import 'package:analyzer/exception/exception.dart';
 import 'package:analyzer/instrumentation/instrumentation.dart';
 import 'package:analyzer/plugin/resolver_provider.dart';
+import 'package:analyzer/source/error_processor.dart';
 import 'package:analyzer/src/cancelable_future.dart';
 import 'package:analyzer/src/context/builder.dart' show EmbedderYamlLocator;
 import 'package:analyzer/src/context/cache.dart';
@@ -26,15 +27,18 @@
 import 'package:analyzer/src/plugin/command_line_plugin.dart';
 import 'package:analyzer/src/plugin/engine_plugin.dart';
 import 'package:analyzer/src/plugin/options_plugin.dart';
+import 'package:analyzer/src/services/lint.dart';
 import 'package:analyzer/src/task/manager.dart';
 import 'package:analyzer/task/dart.dart';
 import 'package:analyzer/task/model.dart';
+import 'package:front_end/src/base/timestamped_data.dart';
 import 'package:html/dom.dart' show Document;
 import 'package:path/path.dart' as pathos;
 import 'package:plugin/manager.dart';
 import 'package:plugin/plugin.dart';
 
 export 'package:analyzer/error/listener.dart' show RecordingErrorListener;
+export 'package:front_end/src/base/timestamped_data.dart' show TimestampedData;
 
 /**
  * Used by [AnalysisOptions] to allow function bodies to be analyzed in some
@@ -355,6 +359,7 @@
    *
    * See [setConfigurationData].
    */
+  @deprecated
   Object/*=V*/ getConfigurationData/*<V>*/(ResultDescriptor/*<V>*/ key);
 
   /**
@@ -622,6 +627,7 @@
    *
    * See [getConfigurationData].
    */
+  @deprecated
   void setConfigurationData(ResultDescriptor key, Object data);
 
   /**
@@ -1055,15 +1061,23 @@
  */
 abstract class AnalysisOptions {
   /**
+   * The length of the list returned by [encodeCrossContextOptions].
+   */
+  static const int crossContextOptionsLength = 2;
+
+  /**
    * Function that returns `true` if analysis is to parse and analyze function
    * bodies for a given source.
    */
   AnalyzeFunctionBodiesPredicate get analyzeFunctionBodiesPredicate;
 
   /**
-   * Return the maximum number of sources for which AST structures should be
+   * DEPRECATED: Return the maximum number of sources for which AST structures should be
    * kept in the cache.
+   *
+   * This setting no longer has any effect.
    */
+  @deprecated
   int get cacheSize;
 
   /**
@@ -1072,6 +1086,17 @@
   bool get dart2jsHint;
 
   /**
+   * Return `true` if cache flushing should be disabled.  Setting this option to
+   * `true` can improve analysis speed at the expense of memory usage.  It may
+   * also be useful for working around bugs.
+   *
+   * This option should not be used when the analyzer is part of a long running
+   * process (such as the analysis server) because it has the potential to
+   * prevent memory from being reclaimed.
+   */
+  bool get disableCacheFlushing;
+
+  /**
    * Return `true` if the parser is to parse asserts in the initializer list of
    * a constructor.
    */
@@ -1097,12 +1122,14 @@
   /**
    * Return `true` to enable generic methods (DEP 22).
    */
+  @deprecated
   bool get enableGenericMethods => null;
 
   /**
    * Return `true` if access to field formal parameters should be allowed in a
    * constructor's initializer list.
    */
+  @deprecated
   bool get enableInitializingFormalAccess;
 
   /**
@@ -1129,6 +1156,23 @@
   bool get enableTiming;
 
   /**
+   * Return `true` to enable the use of URIs in part-of directives.
+   */
+  bool get enableUriInPartOf;
+
+  /**
+   * Return a list of error processors that are to be used when reporting
+   * errors in some analysis context.
+   */
+  List<ErrorProcessor> get errorProcessors;
+
+  /**
+   * Return a list of exclude patterns used to exclude some sources from
+   * analysis.
+   */
+  List<String> get excludePatterns;
+
+  /**
    * A flag indicating whether finer grained dependencies should be used
    * instead of just source level dependencies.
    *
@@ -1177,6 +1221,18 @@
   bool get lint;
 
   /**
+   * Return a list of the lint rules that are to be run in an analysis context
+   * if [lint] returns `true`.
+   */
+  List<Linter> get lintRules;
+
+  /**
+   * Return the "platform" bit mask which should be used to apply patch files,
+   * or `0` if no patch files should be applied.
+   */
+  int get patchPlatform;
+
+  /**
    * Return `true` if analysis is to parse comments.
    */
   bool get preserveComments;
@@ -1195,17 +1251,42 @@
   bool get trackCacheDependencies;
 
   /**
-   * Return an integer encoding of the values of the options that need to be the
-   * same across all of the contexts associated with partitions that are to be
-   * shared by a single analysis context.
+   * Return a list of integers encoding of the values of the options that need
+   * to be the same across all of the contexts associated with partitions that
+   * are to be shared by a single analysis context.
+   *
+   * The length of the list is guaranteed to equal [crossContextOptionsLength].
    */
-  int encodeCrossContextOptions();
+  List<int> encodeCrossContextOptions();
+
+  /**
+   * Reset the state of this set of analysis options to its original state.
+   */
+  void resetToDefaults();
 
   /**
    * Set the values of the cross-context options to match those in the given set
    * of [options].
    */
   void setCrossContextOptionsFrom(AnalysisOptions options);
+
+  /**
+   * Determine whether two lists returned by [encodeCrossContextOptions] are
+   * equal.
+   */
+  static bool crossContextOptionsEqual(List<int> a, List<int> b) {
+    assert(a.length == crossContextOptionsLength);
+    assert(b.length == crossContextOptionsLength);
+    if (a.length != b.length) {
+      return false;
+    }
+    for (int i = 0; i < a.length; i++) {
+      if (a[i] != b[i]) {
+        return false;
+      }
+    }
+    return true;
+  }
 }
 
 /**
@@ -1214,12 +1295,16 @@
  */
 class AnalysisOptionsImpl implements AnalysisOptions {
   /**
-   * The maximum number of sources for which data should be kept in the cache.
+   * DEPRECATED: The maximum number of sources for which data should be kept in
+   * the cache.
+   *
+   * This constant no longer has any effect.
    */
+  @deprecated
   static const int DEFAULT_CACHE_SIZE = 64;
 
   static const int ENABLE_ASSERT_FLAG = 0x01;
-  static const int ENABLE_GENERIC_METHODS_FLAG = 0x02;
+  static const int ENABLE_LAZY_ASSIGNMENT_OPERATORS = 0x02;
   static const int ENABLE_STRICT_CALL_CHECKS_FLAG = 0x04;
   static const int ENABLE_STRONG_MODE_FLAG = 0x08;
   static const int ENABLE_STRONG_MODE_HINTS_FLAG = 0x10;
@@ -1238,7 +1323,8 @@
       _analyzeAllFunctionBodies;
 
   @override
-  int cacheSize = DEFAULT_CACHE_SIZE;
+  @deprecated
+  int cacheSize = 64;
 
   @override
   bool dart2jsHint = false;
@@ -1250,12 +1336,6 @@
   bool enableAssertMessage = false;
 
   @override
-  bool enableGenericMethods = false;
-
-  @override
-  bool enableInitializingFormalAccess = false;
-
-  @override
   bool enableLazyAssignmentOperators = false;
 
   @override
@@ -1267,6 +1347,20 @@
   @override
   bool enableTiming = false;
 
+  /**
+   * A list of error processors that are to be used when reporting errors in
+   * some analysis context.
+   */
+  List<ErrorProcessor> _errorProcessors;
+
+  /**
+   * A list of exclude patterns used to exclude some sources from analysis.
+   */
+  List<String> _excludePatterns;
+
+  @override
+  bool enableUriInPartOf = false;
+
   @override
   bool generateImplicitErrors = true;
 
@@ -1288,6 +1382,15 @@
   @override
   bool lint = false;
 
+  /**
+   * The lint rules that are to be run in an analysis context if [lint] returns
+   * `true`.
+   */
+  List<Linter> _lintRules;
+
+  @override
+  int patchPlatform = 0;
+
   @override
   bool preserveComments = true;
 
@@ -1305,6 +1408,9 @@
   @override
   bool trackCacheDependencies = true;
 
+  @override
+  bool disableCacheFlushing = false;
+
   /**
    * A flag indicating whether implicit casts are allowed in [strongMode]
    * (they are always allowed in Dart 1.0 mode).
@@ -1346,15 +1452,15 @@
    */
   AnalysisOptionsImpl.from(AnalysisOptions options) {
     analyzeFunctionBodiesPredicate = options.analyzeFunctionBodiesPredicate;
-    cacheSize = options.cacheSize;
     dart2jsHint = options.dart2jsHint;
     enableAssertInitializer = options.enableAssertInitializer;
     enableAssertMessage = options.enableAssertMessage;
     enableStrictCallChecks = options.enableStrictCallChecks;
-    enableGenericMethods = options.enableGenericMethods;
-    enableInitializingFormalAccess = options.enableInitializingFormalAccess;
+    enableLazyAssignmentOperators = options.enableLazyAssignmentOperators;
     enableSuperMixins = options.enableSuperMixins;
     enableTiming = options.enableTiming;
+    errorProcessors = options.errorProcessors;
+    excludePatterns = options.excludePatterns;
     generateImplicitErrors = options.generateImplicitErrors;
     generateSdkErrors = options.generateSdkErrors;
     hint = options.hint;
@@ -1362,6 +1468,7 @@
     incrementalApi = options.incrementalApi;
     incrementalValidation = options.incrementalValidation;
     lint = options.lint;
+    lintRules = options.lintRules;
     preserveComments = options.preserveComments;
     strongMode = options.strongMode;
     if (options is AnalysisOptionsImpl) {
@@ -1371,7 +1478,9 @@
       implicitDynamic = options.implicitDynamic;
     }
     trackCacheDependencies = options.trackCacheDependencies;
+    disableCacheFlushing = options.disableCacheFlushing;
     finerGrainedInvalidation = options.finerGrainedInvalidation;
+    patchPlatform = options.patchPlatform;
   }
 
   bool get analyzeFunctionBodies {
@@ -1420,24 +1529,107 @@
   void set enableConditionalDirectives(_) {}
 
   @override
-  int encodeCrossContextOptions() =>
-      (enableAssertMessage ? ENABLE_ASSERT_FLAG : 0) |
-      (enableGenericMethods ? ENABLE_GENERIC_METHODS_FLAG : 0) |
-      (enableStrictCallChecks ? ENABLE_STRICT_CALL_CHECKS_FLAG : 0) |
-      (strongMode ? ENABLE_STRONG_MODE_FLAG : 0) |
-      (strongModeHints ? ENABLE_STRONG_MODE_HINTS_FLAG : 0) |
-      (enableSuperMixins ? ENABLE_SUPER_MIXINS_FLAG : 0);
+  @deprecated
+  bool get enableGenericMethods => true;
+
+  @deprecated
+  void set enableGenericMethods(bool enable) {}
+
+  @deprecated
+  @override
+  bool get enableInitializingFormalAccess => true;
+
+  @deprecated
+  void set enableInitializingFormalAccess(bool enable) {}
+
+  @override
+  List<ErrorProcessor> get errorProcessors =>
+      _errorProcessors ??= const <ErrorProcessor>[];
+
+  /**
+   * Set the list of error [processors] that are to be used when reporting
+   * errors in some analysis context.
+   */
+  void set errorProcessors(List<ErrorProcessor> processors) {
+    _errorProcessors = processors;
+  }
+
+  @override
+  List<String> get excludePatterns => _excludePatterns ??= const <String>[];
+
+  /**
+   * Set the exclude patterns used to exclude some sources from analysis to
+   * those in the given list of [patterns].
+   */
+  void set excludePatterns(List<String> patterns) {
+    _excludePatterns = patterns;
+  }
+
+  @override
+  List<Linter> get lintRules => _lintRules ??= const <Linter>[];
+
+  /**
+   * Set the lint rules that are to be run in an analysis context if [lint]
+   * returns `true`.
+   */
+  void set lintRules(List<Linter> rules) {
+    _lintRules = rules;
+  }
+
+  @override
+  List<int> encodeCrossContextOptions() {
+    int flags = (enableAssertMessage ? ENABLE_ASSERT_FLAG : 0) |
+        (enableLazyAssignmentOperators ? ENABLE_LAZY_ASSIGNMENT_OPERATORS : 0) |
+        (enableStrictCallChecks ? ENABLE_STRICT_CALL_CHECKS_FLAG : 0) |
+        (enableSuperMixins ? ENABLE_SUPER_MIXINS_FLAG : 0) |
+        (strongMode ? ENABLE_STRONG_MODE_FLAG : 0) |
+        (strongModeHints ? ENABLE_STRONG_MODE_HINTS_FLAG : 0);
+    return <int>[flags, patchPlatform];
+  }
+
+  @override
+  void resetToDefaults() {
+    dart2jsHint = false;
+    disableCacheFlushing = false;
+    enableAssertInitializer = false;
+    enableAssertMessage = false;
+    enableLazyAssignmentOperators = false;
+    enableStrictCallChecks = false;
+    enableSuperMixins = false;
+    enableTiming = false;
+    enableUriInPartOf = false;
+    _errorProcessors = null;
+    _excludePatterns = null;
+    finerGrainedInvalidation = false;
+    generateImplicitErrors = true;
+    generateSdkErrors = false;
+    hint = true;
+    implicitCasts = true;
+    implicitDynamic = true;
+    incremental = false;
+    incrementalApi = false;
+    incrementalValidation = false;
+    lint = false;
+    _lintRules = null;
+    nonnullableTypes = NONNULLABLE_TYPES;
+    patchPlatform = 0;
+    preserveComments = true;
+    strongMode = false;
+    strongModeHints = false;
+    trackCacheDependencies = true;
+  }
 
   @override
   void setCrossContextOptionsFrom(AnalysisOptions options) {
     enableAssertMessage = options.enableAssertMessage;
-    enableGenericMethods = options.enableGenericMethods;
+    enableLazyAssignmentOperators = options.enableLazyAssignmentOperators;
     enableStrictCallChecks = options.enableStrictCallChecks;
     enableSuperMixins = options.enableSuperMixins;
     strongMode = options.strongMode;
     if (options is AnalysisOptionsImpl) {
       strongModeHints = options.strongModeHints;
     }
+    patchPlatform = options.patchPlatform;
   }
 
   /**
@@ -1445,39 +1637,36 @@
    * encoded in the given [encoding], presumably from invoking the method
    * [encodeCrossContextOptions].
    */
-  static String decodeCrossContextOptions(int encoding) {
-    if (encoding == 0) {
+  static String decodeCrossContextOptions(List<int> encoding) {
+    List<String> parts = [];
+    int flags = encoding[0];
+    if (flags & ENABLE_ASSERT_FLAG > 0) {
+      parts.add('assert');
+    }
+    if (flags & ENABLE_LAZY_ASSIGNMENT_OPERATORS > 0) {
+      parts.add('lazyAssignmentOperators');
+    }
+    if (flags & ENABLE_STRICT_CALL_CHECKS_FLAG > 0) {
+      parts.add('strictCallChecks');
+    }
+    if (flags & ENABLE_SUPER_MIXINS_FLAG > 0) {
+      parts.add('superMixins');
+    }
+    if (flags & ENABLE_STRONG_MODE_FLAG > 0) {
+      parts.add('strongMode');
+    }
+    if (flags & ENABLE_STRONG_MODE_HINTS_FLAG > 0) {
+      parts.add('strongModeHints');
+    }
+    int patchPlatform = encoding[1];
+    if (patchPlatform != 0) {
+      parts.add('patchPlatform=$patchPlatform');
+    }
+    if (parts.isEmpty) {
       return 'none';
+    } else {
+      return parts.join(', ');
     }
-    StringBuffer buffer = new StringBuffer();
-    bool needsSeparator = false;
-    void add(String optionName) {
-      if (needsSeparator) {
-        buffer.write(', ');
-      }
-      buffer.write(optionName);
-      needsSeparator = true;
-    }
-
-    if (encoding & ENABLE_ASSERT_FLAG > 0) {
-      add('assert');
-    }
-    if (encoding & ENABLE_GENERIC_METHODS_FLAG > 0) {
-      add('genericMethods');
-    }
-    if (encoding & ENABLE_STRICT_CALL_CHECKS_FLAG > 0) {
-      add('strictCallChecks');
-    }
-    if (encoding & ENABLE_STRONG_MODE_FLAG > 0) {
-      add('strongMode');
-    }
-    if (encoding & ENABLE_STRONG_MODE_HINTS_FLAG > 0) {
-      add('strongModeHints');
-    }
-    if (encoding & ENABLE_SUPER_MIXINS_FLAG > 0) {
-      add('superMixins');
-    }
-    return buffer.toString();
   }
 
   /**
@@ -2657,24 +2846,3 @@
       _changeSet.removedSources.length > 0 ||
       _changeSet.removedContainers.length > 0;
 }
-
-/**
- * Analysis data for which we have a modification time.
- */
-class TimestampedData<E> {
-  /**
-   * The modification time of the source from which the data was created.
-   */
-  final int modificationTime;
-
-  /**
-   * The data that was created from the source.
-   */
-  final E data;
-
-  /**
-   * Initialize a newly created holder to associate the given [data] with the
-   * given [modificationTime].
-   */
-  TimestampedData(this.modificationTime, this.data);
-}
diff --git a/pkg/analyzer/lib/src/generated/error.dart b/pkg/analyzer/lib/src/generated/error.dart
index b04e50b..3d71368 100644
--- a/pkg/analyzer/lib/src/generated/error.dart
+++ b/pkg/analyzer/lib/src/generated/error.dart
@@ -8,5 +8,3 @@
 export 'package:analyzer/error/error.dart';
 export 'package:analyzer/error/listener.dart';
 export 'package:analyzer/src/error/codes.dart';
-export 'package:analyzer/src/task/options.dart'
-    show CONFIGURED_ERROR_PROCESSORS;
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index 13964ba..30a50cc 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -347,6 +347,13 @@
   }
 
   @override
+  Object visitAssertInitializer(AssertInitializer node) {
+    _checkForNonBoolExpression(node);
+    _checkAssertMessage(node);
+    return super.visitAssertInitializer(node);
+  }
+
+  @override
   Object visitAssertStatement(AssertStatement node) {
     _checkForNonBoolExpression(node);
     _checkAssertMessage(node);
@@ -924,6 +931,7 @@
   @override
   Object visitIsExpression(IsExpression node) {
     _checkForTypeAnnotationDeferredClass(node.type);
+    _checkForTypeAnnotationGenericFunctionParameter(node.type);
     return super.visitIsExpression(node);
   }
 
@@ -1294,11 +1302,11 @@
   }
 
   /**
-   * If the given assert [statement] specifies a message, verify that support
+   * If the given [assertion] specifies a message, verify that support
    * for assertions with messages is enabled.
    */
-  void _checkAssertMessage(AssertStatement statement) {
-    Expression expression = statement.message;
+  void _checkAssertMessage(Assertion assertion) {
+    Expression expression = assertion.message;
     if (expression != null && !enableAssertMessage) {
       _errorReporter.reportErrorForNode(
           CompileTimeErrorCode.EXTRA_ARGUMENT_TO_ASSERT, expression);
@@ -1754,7 +1762,7 @@
         int count = params1.length;
         if (params2.length != count) {
           _errorReporter.reportErrorForNode(
-              StaticWarningCode.INVALID_METHOD_OVERRIDE_TYPE_PARAMETERS,
+              HintCode.INVALID_METHOD_OVERRIDE_TYPE_PARAMETERS,
               errorNameTarget, [
             count,
             params2.length,
@@ -1788,7 +1796,7 @@
           pFresh.bound = bound2;
           if (!_typeSystem.isSubtypeOf(bound2, bound1)) {
             _errorReporter.reportErrorForNode(
-                StaticWarningCode.INVALID_METHOD_OVERRIDE_TYPE_PARAMETER_BOUND,
+                HintCode.INVALID_METHOD_OVERRIDE_TYPE_PARAMETER_BOUND,
                 errorNameTarget, [
               p1.displayName,
               p1.bound,
@@ -2355,7 +2363,7 @@
       libraryNames.sort();
       _errorReporter.reportErrorForNode(StaticWarningCode.AMBIGUOUS_IMPORT,
           node, [name, StringUtilities.printListOfQuotedNames(libraryNames)]);
-    } else {
+    } else if (element != null) {
       List<Element> sdkElements =
           node.getProperty(LibraryImportScope.conflictingSdkElements);
       if (sdkElements != null) {
@@ -2596,7 +2604,11 @@
       }
       // no other switch member after this one
     } else {
-      Statement statement = statements[statements.length - 1];
+      Statement statement = statements.last;
+      if (statement is Block && statement.statements.isNotEmpty) {
+        Block block = statement;
+        statement = block.statements.last;
+      }
       // terminated with statement
       if (statement is BreakStatement ||
           statement is ContinueStatement ||
@@ -2606,7 +2618,7 @@
       // terminated with 'throw' expression
       if (statement is ExpressionStatement) {
         Expression expression = statement.expression;
-        if (expression is ThrowExpression) {
+        if (expression is ThrowExpression || expression is RethrowExpression) {
           return;
         }
       }
@@ -2618,7 +2630,7 @@
 
   /**
    * Verify that the switch cases in the given switch [statement] are terminated
-   * with 'break', 'continue', 'return' or 'throw'.
+   * with 'break', 'continue', 'rethrow', 'return' or 'throw'.
    *
    * See [StaticWarningCode.CASE_BLOCK_NOT_TERMINATED].
    */
@@ -3767,16 +3779,19 @@
     if (_isInNativeClass || list.isSynthetic) {
       return;
     }
-
+    bool isConst = list.isConst;
+    if (!(isConst || list.isFinal)) {
+      return;
+    }
     NodeList<VariableDeclaration> variables = list.variables;
     for (VariableDeclaration variable in variables) {
       if (variable.initializer == null) {
-        if (list.isConst) {
+        if (isConst) {
           _errorReporter.reportErrorForNode(
               CompileTimeErrorCode.CONST_NOT_INITIALIZED,
               variable.name,
               [variable.name.name]);
-        } else if (list.isFinal) {
+        } else {
           _errorReporter.reportErrorForNode(
               StaticWarningCode.FINAL_NOT_INITIALIZED,
               variable.name,
@@ -4256,7 +4271,7 @@
       _errorReporter.reportErrorForNode(
           StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER,
           name,
-          [name.name]);
+          [name.name, _getKind(element), element.enclosingElement.name]);
     }
   }
 
@@ -4952,7 +4967,7 @@
     _errorReporter.reportErrorForNode(
         CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT,
         declaration.name,
-        [superType.displayName]);
+        [superType.displayName, _enclosingClass.displayName]);
   }
 
   /**
@@ -5155,13 +5170,13 @@
   }
 
   /**
-   * Verify that the given assert [statement] has either a 'bool' or
-   * '() -> bool' input.
+   * Verify that the given [assertion] has either a 'bool' or '() -> bool'
+   * condition.
    *
    * See [StaticTypeWarningCode.NON_BOOL_EXPRESSION].
    */
-  void _checkForNonBoolExpression(AssertStatement statement) {
-    Expression expression = statement.condition;
+  void _checkForNonBoolExpression(Assertion assertion) {
+    Expression expression = assertion.condition;
     DartType type = getStaticType(expression);
     if (type is InterfaceType) {
       if (!_typeSystem.isAssignableTo(type, _boolType)) {
@@ -5682,6 +5697,29 @@
   }
 
   /**
+   * Verify that the given type [name] is not a type parameter in a generic
+   * method.
+   *
+   * See [StaticWarningCode.TYPE_ANNOTATION_GENERIC_FUNCTION_PARAMETER].
+   */
+  void _checkForTypeAnnotationGenericFunctionParameter(TypeName typeName) {
+    if (typeName == null) {
+      return;
+    }
+    Identifier name = typeName.name;
+    if (name is SimpleIdentifier) {
+      Element element = name.staticElement;
+      if (element is TypeParameterElement &&
+          element.enclosingElement is ExecutableElement) {
+        _errorReporter.reportErrorForNode(
+            StaticWarningCode.TYPE_ANNOTATION_GENERIC_FUNCTION_PARAMETER,
+            name,
+            [name.name]);
+      }
+    }
+  }
+
+  /**
    * Verify that the type arguments in the given [typeName] are all within
    * their bounds.
    *
@@ -5773,7 +5811,7 @@
     _errorReporter.reportErrorForNode(
         StaticTypeWarningCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND,
         parameter,
-        [element.displayName]);
+        [element.displayName, bound.displayName]);
   }
 
   /**
@@ -5868,14 +5906,13 @@
     if (enclosingElement is! ClassElement) {
       return;
     }
-    if ((element is MethodElement && !element.isStatic) ||
-        (element is PropertyAccessorElement && !element.isStatic)) {
+    if (element is ExecutableElement && !element.isStatic) {
       return;
     }
     _errorReporter.reportErrorForNode(
         StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER,
         name,
-        [name.name]);
+        [enclosingElement.name]);
   }
 
   void _checkForValidField(FieldFormalParameter parameter) {
@@ -6314,6 +6351,32 @@
   }
 
   /**
+   * Return a human-readable representation of the kind of the [element].
+   */
+  String _getKind(ExecutableElement element) {
+    if (element is MethodElement) {
+      return 'method';
+    } else if (element is PropertyAccessorElement) {
+      if (element.isSynthetic) {
+        PropertyInducingElement variable = element.variable;
+        if (variable is FieldElement) {
+          return 'field';
+        }
+        return 'variable';
+      } else if (element.isGetter) {
+        return 'getter';
+      } else {
+        return 'setter';
+      }
+    } else if (element is ConstructorElement) {
+      return 'constructor';
+    } else if (element is FunctionElement) {
+      return 'function';
+    }
+    return 'member';
+  }
+
+  /**
    * Return the name of the library that defines given [element].
    */
   String _getLibraryName(Element element) {
@@ -6372,7 +6435,9 @@
     String name = member.name;
     ClassElement superclass = classElement.supertype?.element;
     while (superclass != null) {
-      ExecutableElement member = superclass.getMethod(name) ?? superclass.getGetter(name) ?? superclass.getSetter(name);
+      ExecutableElement member = superclass.getMethod(name) ??
+          superclass.getGetter(name) ??
+          superclass.getSetter(name);
       if (member != null) {
         return member;
       }
diff --git a/pkg/analyzer/lib/src/generated/incremental_resolver.dart b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
index f17e793..1787b4a 100644
--- a/pkg/analyzer/lib/src/generated/incremental_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
@@ -274,9 +274,7 @@
     LoggingTimer timer = logger.startTimer();
     try {
       ElementHolder holder = new ElementHolder();
-      ElementBuilder builder = new ElementBuilder(holder, _definingUnit);
-      builder.initForFunctionBodyIncrementalResolution();
-      node.accept(builder);
+      node.accept(new LocalElementBuilder(holder, _definingUnit));
       // Move local elements into the ExecutableElementImpl.
       ExecutableElementImpl executableElement =
           executable.element as ExecutableElementImpl;
@@ -667,6 +665,14 @@
             } else if (oldParent is FunctionBody && newParent is FunctionBody) {
               if (oldParent is BlockFunctionBody &&
                   newParent is BlockFunctionBody) {
+                if (oldParent.isAsynchronous != newParent.isAsynchronous) {
+                  logger.log('Failure: body async mismatch.');
+                  return false;
+                }
+                if (oldParent.isGenerator != newParent.isGenerator) {
+                  logger.log('Failure: body generator mismatch.');
+                  return false;
+                }
                 oldNode = oldParent;
                 newNode = newParent;
                 found = true;
@@ -745,7 +751,6 @@
       Parser parser = new Parser(_unitSource, errorListener);
       AnalysisOptions options = _unitElement.context.analysisOptions;
       parser.parseGenericMethodComments = options.strongMode;
-      parser.parseGenericMethods = options.enableGenericMethods;
       CompilationUnit unit = parser.parseCompilationUnit(token);
       _newParseErrors = errorListener.errors;
       return unit;
diff --git a/pkg/analyzer/lib/src/generated/interner.dart b/pkg/analyzer/lib/src/generated/interner.dart
index 9741f28..7bb6e5b 100644
--- a/pkg/analyzer/lib/src/generated/interner.dart
+++ b/pkg/analyzer/lib/src/generated/interner.dart
@@ -6,17 +6,10 @@
 
 import 'dart:collection';
 
-/**
- * The interface `Interner` defines the behavior of objects that can intern
- * strings.
- */
-abstract class Interner {
-  /**
-   * Return a string that is identical to all of the other strings that have
-   * been interned that are equal to the given [string].
-   */
-  String intern(String string);
-}
+import 'package:front_end/src/scanner/interner.dart';
+
+export 'package:front_end/src/scanner/interner.dart'
+    show Interner, NullInterner;
 
 /**
  * The class `MappedInterner` implements an interner that uses a map to manage
@@ -38,12 +31,3 @@
     return original;
   }
 }
-
-/**
- * The class `NullInterner` implements an interner that does nothing (does not
- * actually intern any strings).
- */
-class NullInterner implements Interner {
-  @override
-  String intern(String string) => string;
-}
diff --git a/pkg/analyzer/lib/src/generated/java_core.dart b/pkg/analyzer/lib/src/generated/java_core.dart
index edaccce..994f553 100644
--- a/pkg/analyzer/lib/src/generated/java_core.dart
+++ b/pkg/analyzer/lib/src/generated/java_core.dart
@@ -138,6 +138,7 @@
   String toString() => name;
 }
 
+@deprecated
 class PrintStringWriter extends PrintWriter {
   final StringBuffer _sb = new StringBuffer();
 
diff --git a/pkg/analyzer/lib/src/generated/java_io.dart b/pkg/analyzer/lib/src/generated/java_io.dart
index 9b07d6d..3c147bf 100644
--- a/pkg/analyzer/lib/src/generated/java_io.dart
+++ b/pkg/analyzer/lib/src/generated/java_io.dart
@@ -9,6 +9,7 @@
 import 'package:path/path.dart' as path;
 
 class JavaFile {
+  @deprecated
   static path.Context pathContext = path.context;
   static final String separator = Platform.pathSeparator;
   static final int separatorChar = Platform.pathSeparator.codeUnitAt(0);
@@ -16,12 +17,12 @@
   JavaFile(String path) {
     _path = path;
   }
-  JavaFile.fromUri(Uri uri) : this(pathContext.fromUri(uri));
+  JavaFile.fromUri(Uri uri) : this(path.context.fromUri(uri));
   JavaFile.relative(JavaFile base, String child) {
     if (child.isEmpty) {
       this._path = base._path;
     } else {
-      this._path = pathContext.join(base._path, child);
+      this._path = path.context.join(base._path, child);
     }
   }
   @override
@@ -43,9 +44,9 @@
 
   JavaFile getAbsoluteFile() => new JavaFile(getAbsolutePath());
   String getAbsolutePath() {
-    String path = pathContext.absolute(_path);
-    path = pathContext.normalize(path);
-    return path;
+    String abolutePath = path.context.absolute(_path);
+    abolutePath = path.context.normalize(abolutePath);
+    return abolutePath;
   }
 
   JavaFile getCanonicalFile() => new JavaFile(getCanonicalPath());
@@ -53,9 +54,9 @@
     return _newFile().resolveSymbolicLinksSync();
   }
 
-  String getName() => pathContext.basename(_path);
+  String getName() => path.context.basename(_path);
   String getParent() {
-    var result = pathContext.dirname(_path);
+    var result = path.context.dirname(_path);
     // "." or  "/" or  "C:\"
     if (result.length < 4) return null;
     return result;
@@ -101,8 +102,8 @@
   @override
   String toString() => _path.toString();
   Uri toURI() {
-    String path = getAbsolutePath();
-    return pathContext.toUri(path);
+    String absolutePath = getAbsolutePath();
+    return path.context.toUri(absolutePath);
   }
 
   Directory _newDirectory() => new Directory(_path);
@@ -134,18 +135,15 @@
         String sdkPath;
         // may be "xcodebuild/ReleaseIA32/dart" with "sdk" sibling
         {
-          var outDir =
-              JavaFile.pathContext.dirname(JavaFile.pathContext.dirname(exec));
-          sdkPath = JavaFile.pathContext
-              .join(JavaFile.pathContext.dirname(outDir), "sdk");
+          var outDir = path.context.dirname(path.context.dirname(exec));
+          sdkPath = path.context.join(path.context.dirname(outDir), "sdk");
           if (new Directory(sdkPath).existsSync()) {
             _properties[name] = sdkPath;
             return sdkPath;
           }
         }
         // probably be "dart-sdk/bin/dart"
-        sdkPath =
-            JavaFile.pathContext.dirname(JavaFile.pathContext.dirname(exec));
+        sdkPath = path.context.dirname(path.context.dirname(exec));
         _properties[name] = sdkPath;
         return sdkPath;
       }
diff --git a/pkg/analyzer/lib/src/generated/package.dart b/pkg/analyzer/lib/src/generated/package.dart
index b715e3b..dddce5a 100644
--- a/pkg/analyzer/lib/src/generated/package.dart
+++ b/pkg/analyzer/lib/src/generated/package.dart
@@ -157,7 +157,10 @@
 
   @override
   int get hashCode {
-    int hashCode = options.encodeCrossContextOptions();
+    int hashCode = 0;
+    for (int value in options.encodeCrossContextOptions()) {
+      hashCode = JenkinsSmiHash.combine(hashCode, value);
+    }
     hashCode = JenkinsSmiHash.combine(hashCode, id.hashCode);
     hashCode = JenkinsSmiHash.combine(hashCode, sdk.hashCode);
     return JenkinsSmiHash.finish(hashCode);
@@ -167,8 +170,9 @@
   bool operator ==(Object other) {
     return other is PackageDescription &&
         other.sdk == sdk &&
-        other.options.encodeCrossContextOptions() ==
-            options.encodeCrossContextOptions() &&
+        AnalysisOptions.crossContextOptionsEqual(
+            other.options.encodeCrossContextOptions(),
+            options.encodeCrossContextOptions()) &&
         other.id == id;
   }
 }
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart
index fb111ff..58b4ba0 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -198,6 +198,12 @@
   bool _enableNnbd = false;
 
   /**
+   * A flag indicating whether the parser is to allow URI's in part-of
+   * directives.
+   */
+  bool _enableUriInPartOf = false;
+
+  /**
    * A flag indicating whether parser is to parse function bodies.
    */
   bool _parseFunctionBodies = true;
@@ -238,6 +244,7 @@
   /**
    * A flag indicating whether the parser is to parse generic method syntax.
    */
+  @deprecated
   bool parseGenericMethods = false;
 
   /**
@@ -293,13 +300,27 @@
   }
 
   /**
+   * Return `true` if the parser is to allow URI's in part-of directives.
+   */
+  bool get enableUriInPartOf => _enableUriInPartOf;
+
+  /**
+   * Set whether the parser is to allow URI's in part-of directives to the given
+   * [enable] flag.
+   */
+  void set enableUriInPartOf(bool enable) {
+    _enableUriInPartOf = enable;
+  }
+
+  /**
    * Return `true` if the current token is the first token of a return type that
    * is followed by an identifier, possibly followed by a list of type
    * parameters, followed by a left-parenthesis. This is used by
    * [parseTypeAlias] to determine whether or not to parse a return type.
    */
-  @deprecated
   bool get hasReturnTypeInTypeAlias {
+    // TODO(brianwilkerson) This is too expensive as implemented and needs to be
+    // re-implemented or removed.
     Token next = skipReturnType(_currentToken);
     if (next == null) {
       return false;
@@ -780,6 +801,13 @@
         }
         Token operator = getAndAdvance();
         return new PropertyAccess(prefix, operator, parseSimpleIdentifier());
+      } else if (type == TokenType.INDEX) {
+        _splitIndex();
+        Token leftBracket = getAndAdvance();
+        Expression index = parseSimpleIdentifier();
+        Token rightBracket = getAndAdvance();
+        return new IndexExpression.forTarget(
+            prefix, leftBracket, index, rightBracket);
       } else {
         if (!optional) {
           // Report the missing selector.
@@ -1393,7 +1421,7 @@
       // function type alias that was parsed.
       _parseFunctionTypeAlias(commentAndMetadata, getAndAdvance());
       return null;
-    } else if (parseGenericMethods) {
+    } else {
       Token token = _skipTypeParameterList(_peek());
       if (token != null && _tokenMatches(token, TokenType.OPEN_PAREN)) {
         return _parseMethodDeclarationAfterReturnType(commentAndMetadata,
@@ -1482,7 +1510,7 @@
           methodName,
           typeParameters,
           parameters);
-    } else if (parseGenericMethods && _tokenMatches(next, TokenType.LT)) {
+    } else if (_tokenMatches(next, TokenType.LT)) {
       return _parseMethodDeclarationAfterReturnType(commentAndMetadata,
           modifiers.externalKeyword, modifiers.staticKeyword, type);
     } else if (_tokenMatches(next, TokenType.OPEN_CURLY_BRACKET)) {
@@ -2780,6 +2808,7 @@
    *         normalFormalParameter ('=' expression)?
    *
    *     defaultNamedParameter ::=
+   *         normalFormalParameter ('=' expression)?
    *         normalFormalParameter (':' expression)?
    */
   FormalParameter parseFormalParameter(ParameterKind kind) {
@@ -2788,12 +2817,10 @@
     if (type == TokenType.EQ) {
       Token separator = getAndAdvance();
       Expression defaultValue = parseExpression2();
-      if (kind == ParameterKind.NAMED) {
-        _reportErrorForToken(
-            ParserErrorCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER, separator);
-      } else if (kind == ParameterKind.REQUIRED) {
+      if (kind == ParameterKind.REQUIRED) {
         _reportErrorForNode(
             ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP, parameter);
+        kind = ParameterKind.POSITIONAL;
       }
       return new DefaultFormalParameter(
           parameter, kind, separator, defaultValue);
@@ -2807,6 +2834,7 @@
       } else if (kind == ParameterKind.REQUIRED) {
         _reportErrorForNode(
             ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP, parameter);
+        kind = ParameterKind.NAMED;
       }
       return new DefaultFormalParameter(
           parameter, kind, separator, defaultValue);
@@ -3512,19 +3540,9 @@
    */
   ListLiteral parseListLiteral(Token modifier, TypeArgumentList typeArguments) {
     if (_matches(TokenType.INDEX)) {
-      // Split the token into two separate tokens.
-      BeginToken leftBracket = _createToken(
-          _currentToken, TokenType.OPEN_SQUARE_BRACKET,
-          isBegin: true);
-      Token rightBracket =
-          new Token(TokenType.CLOSE_SQUARE_BRACKET, _currentToken.offset + 1);
-      leftBracket.endToken = rightBracket;
-      rightBracket.setNext(_currentToken.next);
-      leftBracket.setNext(rightBracket);
-      _currentToken.previous.setNext(leftBracket);
-      _currentToken = _currentToken.next;
+      _splitIndex();
       return new ListLiteral(
-          modifier, typeArguments, leftBracket, null, rightBracket);
+          modifier, typeArguments, getAndAdvance(), null, getAndAdvance());
     }
     Token leftBracket = getAndAdvance();
     if (_matches(TokenType.CLOSE_SQUARE_BRACKET)) {
@@ -4121,7 +4139,8 @@
         type == TokenType.PERIOD ||
         type == TokenType.QUESTION_PERIOD ||
         type == TokenType.OPEN_PAREN ||
-        (parseGenericMethods && type == TokenType.LT)) {
+        type == TokenType.LT ||
+        type == TokenType.INDEX) {
       do {
         if (_isLikelyArgumentList()) {
           TypeArgumentList typeArguments = _parseOptionalTypeArguments();
@@ -4145,7 +4164,8 @@
       } while (type == TokenType.OPEN_SQUARE_BRACKET ||
           type == TokenType.PERIOD ||
           type == TokenType.QUESTION_PERIOD ||
-          type == TokenType.OPEN_PAREN);
+          type == TokenType.OPEN_PAREN ||
+          type == TokenType.INDEX);
       return operand;
     }
     if (!_currentToken.type.isIncrementOperator) {
@@ -4272,6 +4292,9 @@
         _inInitializer = wasInInitializer;
       }
     } else if (type == TokenType.LT || _injectGenericCommentTypeList()) {
+      if (isFunctionExpression(currentToken)) {
+        return parseFunctionExpression();
+      }
       return parseListOrMapLiteral(null);
     } else if (type == TokenType.OPEN_CURLY_BRACKET) {
       return parseMapLiteral(null, null);
@@ -5761,9 +5784,6 @@
     if (_matches(TokenType.OPEN_PAREN)) {
       return true;
     }
-    if (!parseGenericMethods) {
-      return false;
-    }
     Token token = skipTypeArgumentList(_currentToken);
     return token != null && _tokenMatches(token, TokenType.OPEN_PAREN);
   }
@@ -5822,9 +5842,6 @@
   }
 
   bool _isPeekGenericTypeParametersAndOpenParen() {
-    if (!parseGenericMethods) {
-      return false;
-    }
     Token token = _skipTypeParameterList(_peek());
     return token != null && _tokenMatches(token, TokenType.OPEN_PAREN);
   }
@@ -5979,9 +5996,7 @@
    *     assertInitializer ::=
    *         'assert' '(' expression [',' expression] ')'
    */
-  void _parseAssertInitializer() {
-    // TODO(brianwilkerson) Capture the syntax in the AST using a new class,
-    // such as AssertInitializer
+  AssertInitializer _parseAssertInitializer() {
     Token keyword = getAndAdvance();
     Token leftParen = _expect(TokenType.OPEN_PAREN);
     Expression expression = parseExpression2();
@@ -5992,8 +6007,8 @@
       message = parseExpression2();
     }
     Token rightParen = _expect(TokenType.CLOSE_PAREN);
-//    return new AssertInitializer(
-//        keyword, leftParen, expression, comma, message, rightParen);
+    return new AssertInitializer(
+        keyword, leftParen, expression, comma, message, rightParen);
   }
 
   /**
@@ -6228,7 +6243,7 @@
           _reportErrorForCurrentToken(ParserErrorCode.MISSING_INITIALIZER);
         } else if (_enableAssertInitializer &&
             _matchesKeyword(Keyword.ASSERT)) {
-          _parseAssertInitializer();
+          initializers.add(_parseAssertInitializer());
         } else {
           initializers.add(parseConstructorFieldInitializer(false));
         }
@@ -6254,7 +6269,8 @@
           parseFunctionBody(true, ParserErrorCode.MISSING_FUNCTION_BODY, false);
       if (constKeyword != null &&
           factoryKeyword != null &&
-          externalKeyword == null) {
+          externalKeyword == null &&
+          body is! NativeFunctionBody) {
         _reportErrorForToken(ParserErrorCode.CONST_FACTORY, factoryKeyword);
       } else if (body is EmptyFunctionBody) {
         if (factoryKeyword != null &&
@@ -6264,7 +6280,7 @@
               ParserErrorCode.FACTORY_WITHOUT_BODY, factoryKeyword);
         }
       } else {
-        if (constKeyword != null) {
+        if (constKeyword != null && body is! NativeFunctionBody) {
           _reportErrorForNode(
               ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY, body);
         } else if (externalKeyword != null) {
@@ -6432,7 +6448,8 @@
         if (leftSquareBracket == null) {
           if (leftCurlyBracket != null) {
             _reportErrorForCurrentToken(
-                ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP, ["}"]);
+                ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP,
+                ['}', ']']);
             rightCurlyBracket = rightSquareBracket;
             rightSquareBracket = null;
           } else {
@@ -6447,7 +6464,8 @@
         if (leftCurlyBracket == null) {
           if (leftSquareBracket != null) {
             _reportErrorForCurrentToken(
-                ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP, ["]"]);
+                ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP,
+                [']', '}']);
             rightSquareBracket = rightCurlyBracket;
             rightCurlyBracket = null;
           } else {
@@ -6613,8 +6631,7 @@
    * See [parseGenericMethodComments].
    */
   TypeParameterList _parseGenericMethodTypeParameters() {
-    if (parseGenericMethods && _matches(TokenType.LT) ||
-        _injectGenericCommentTypeList()) {
+    if (_matches(TokenType.LT) || _injectGenericCommentTypeList()) {
       return parseTypeParameterList();
     }
     return null;
@@ -6829,6 +6846,14 @@
           keyword != Keyword.OPERATOR &&
           (_tokenMatchesIdentifier(next) ||
               _tokenMatches(next, TokenType.LT))) {
+        Token afterTypeParameters = _skipTypeParameterList(next);
+        if (afterTypeParameters != null &&
+            _tokenMatches(afterTypeParameters, TokenType.OPEN_PAREN)) {
+          // If the identifier is followed by type parameters and a parenthesis,
+          // then the identifier is the name of a generic method, not a return
+          // type.
+          return null;
+        }
         return parseReturnType();
       }
       Token next2 = next.next;
@@ -6893,6 +6918,18 @@
   Directive _parsePartOfDirective(CommentAndMetadata commentAndMetadata) {
     Token partKeyword = getAndAdvance();
     Token ofKeyword = getAndAdvance();
+    if (enableUriInPartOf && _matches(TokenType.STRING)) {
+      StringLiteral libraryUri = _parseUri();
+      Token semicolon = _expect(TokenType.SEMICOLON);
+      return new PartOfDirective(
+          commentAndMetadata.comment,
+          commentAndMetadata.metadata,
+          partKeyword,
+          ofKeyword,
+          libraryUri,
+          null,
+          semicolon);
+    }
     LibraryIdentifier libraryName = _parseLibraryName(
         ParserErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE, ofKeyword);
     Token semicolon = _expect(TokenType.SEMICOLON);
@@ -6901,6 +6938,7 @@
         commentAndMetadata.metadata,
         partKeyword,
         ofKeyword,
+        null,
         libraryName,
         semicolon);
   }
@@ -7584,6 +7622,24 @@
   }
 
   /**
+   * Assuming that the current token is an index token ('[]'), split it into two
+   * tokens ('[' and ']'), leaving the left bracket as the current token.
+   */
+  void _splitIndex() {
+    // Split the token into two separate tokens.
+    BeginToken leftBracket = _createToken(
+        _currentToken, TokenType.OPEN_SQUARE_BRACKET,
+        isBegin: true);
+    Token rightBracket =
+        new Token(TokenType.CLOSE_SQUARE_BRACKET, _currentToken.offset + 1);
+    leftBracket.endToken = rightBracket;
+    rightBracket.setNext(_currentToken.next);
+    leftBracket.setNext(rightBracket);
+    _currentToken.previous.setNext(leftBracket);
+    _currentToken = leftBracket;
+  }
+
+  /**
    * Return `true` if the given [token] has the given [type].
    */
   bool _tokenMatches(Token token, TokenType type) => token.type == type;
@@ -7844,7 +7900,7 @@
   }
 
   /**
-   * Validate that the given set of [modifiers] is appropriate for a class and
+   * Validate that the given set of [modifiers] is appropriate for an enum and
    * return the 'abstract' keyword if there is one.
    */
   void _validateModifiersForEnum(Modifiers modifiers) {
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 3e1dc6b..df3ad03 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -19,7 +19,6 @@
 import 'package:analyzer/src/dart/ast/utilities.dart';
 import 'package:analyzer/src/dart/element/element.dart';
 import 'package:analyzer/src/dart/element/type.dart';
-import 'package:analyzer/src/dart/element/utilities.dart';
 import 'package:analyzer/src/dart/resolver/inheritance_manager.dart';
 import 'package:analyzer/src/dart/resolver/scope.dart';
 import 'package:analyzer/src/error/codes.dart';
@@ -137,6 +136,12 @@
   }
 
   @override
+  Object visitAssertInitializer(AssertInitializer node) {
+    _checkForPossibleNullCondition(node.condition);
+    return super.visitAssertInitializer(node);
+  }
+
+  @override
   Object visitAssertStatement(AssertStatement node) {
     _checkForPossibleNullCondition(node.condition);
     return super.visitAssertStatement(node);
@@ -419,7 +424,8 @@
 
   void _checkForAbstractSuperMemberReference(
       Expression target, SimpleIdentifier name) {
-    if (target is SuperExpression) {
+    if (target is SuperExpression &&
+        !_currentLibrary.context.analysisOptions.enableSuperMixins) {
       Element element = name.staticElement;
       if (element is ExecutableElement && element.isAbstract) {
         if (!_enclosingClass.hasNoSuchMethod) {
@@ -1638,25 +1644,28 @@
   }
 
   /**
-   * Validates that the expressions of the given initializers (of a constant constructor) are all
-   * compile time constants.
-   *
-   * @param constructor the constant constructor declaration to validate
+   * Validates that the expressions of the initializers of the given constant
+   * [constructor] are all compile time constants.
    */
   void _validateConstructorInitializers(ConstructorDeclaration constructor) {
     List<ParameterElement> parameterElements =
         constructor.parameters.parameterElements;
     NodeList<ConstructorInitializer> initializers = constructor.initializers;
     for (ConstructorInitializer initializer in initializers) {
-      if (initializer is ConstructorFieldInitializer) {
+      if (initializer is AssertInitializer) {
+        _validateInitializerExpression(
+            parameterElements, initializer.condition);
+        Expression message = initializer.message;
+        if (message != null) {
+          _validateInitializerExpression(parameterElements, message);
+        }
+      } else if (initializer is ConstructorFieldInitializer) {
         _validateInitializerExpression(
             parameterElements, initializer.expression);
-      }
-      if (initializer is RedirectingConstructorInvocation) {
+      } else if (initializer is RedirectingConstructorInvocation) {
         _validateInitializerInvocationArguments(
             parameterElements, initializer.argumentList);
-      }
-      if (initializer is SuperConstructorInvocation) {
+      } else if (initializer is SuperConstructorInvocation) {
         _validateInitializerInvocationArguments(
             parameterElements, initializer.argumentList);
       }
@@ -2267,658 +2276,6 @@
 }
 
 /**
- * A visitor that resolves declarations in an AST structure to already built
- * elements.
- *
- * The resulting AST must have everything resolved that would have been resolved
- * by a [CompilationUnitBuilder] (that is, must be a valid [RESOLVED_UNIT1]).
- * This class must not assume that the [CompilationUnitElement] passed to it is
- * any more complete than a [COMPILATION_UNIT_ELEMENT].
- */
-class DeclarationResolver extends RecursiveAstVisitor<Object>
-    with ExistingElementResolver {
-  /**
-   * The analysis context containing the sources to be analyzed.
-   */
-  AnalysisContext _context;
-
-  /**
-   * The elements that are reachable from the compilation unit element. When a
-   * compilation unit has been resolved, this set should be empty.
-   */
-  Set<Element> _expectedElements;
-
-  /**
-   * The function type alias containing the AST nodes being visited, or `null`
-   * if we are not in the scope of a function type alias.
-   */
-  FunctionTypeAliasElement _enclosingAlias;
-
-  /**
-   * The class containing the AST nodes being visited, or `null` if we are not
-   * in the scope of a class.
-   */
-  ClassElement _enclosingClass;
-
-  /**
-   * The method or function containing the AST nodes being visited, or `null` if
-   * we are not in the scope of a method or function.
-   */
-  ExecutableElement _enclosingExecutable;
-
-  /**
-   * The parameter containing the AST nodes being visited, or `null` if we are
-   * not in the scope of a parameter.
-   */
-  ParameterElement _enclosingParameter;
-
-  /**
-   * Resolve the declarations within the given compilation [unit] to the
-   * elements rooted at the given [element]. Throw an [ElementMismatchException]
-   * if the element model and compilation unit do not match each other.
-   */
-  void resolve(CompilationUnit unit, CompilationUnitElement element) {
-    _context = element.context;
-    ElementGatherer gatherer = new ElementGatherer();
-    element.accept(gatherer);
-    _expectedElements = gatherer.elements;
-    _enclosingUnit = element;
-    _expectedElements.remove(element);
-    unit.element = element;
-    unit.accept(this);
-    _validateResolution();
-  }
-
-  @override
-  Object visitCatchClause(CatchClause node) {
-    SimpleIdentifier exceptionParameter = node.exceptionParameter;
-    if (exceptionParameter != null) {
-      List<LocalVariableElement> localVariables =
-          _enclosingExecutable.localVariables;
-      _findIdentifier(localVariables, exceptionParameter);
-      SimpleIdentifier stackTraceParameter = node.stackTraceParameter;
-      if (stackTraceParameter != null) {
-        _findIdentifier(localVariables, stackTraceParameter);
-      }
-    }
-    return super.visitCatchClause(node);
-  }
-
-  @override
-  Object visitClassDeclaration(ClassDeclaration node) {
-    ClassElement outerClass = _enclosingClass;
-    try {
-      SimpleIdentifier className = node.name;
-      _enclosingClass = _findIdentifier(_enclosingUnit.types, className);
-      super.visitClassDeclaration(node);
-      _resolveMetadata(node, node.metadata, _enclosingClass);
-      return null;
-    } finally {
-      _enclosingClass = outerClass;
-    }
-  }
-
-  @override
-  Object visitClassTypeAlias(ClassTypeAlias node) {
-    ClassElement outerClass = _enclosingClass;
-    try {
-      SimpleIdentifier className = node.name;
-      _enclosingClass = _findIdentifier(_enclosingUnit.types, className);
-      super.visitClassTypeAlias(node);
-      _resolveMetadata(node, node.metadata, _enclosingClass);
-      return null;
-    } finally {
-      _enclosingClass = outerClass;
-    }
-  }
-
-  @override
-  Object visitConstructorDeclaration(ConstructorDeclaration node) {
-    ExecutableElement outerExecutable = _enclosingExecutable;
-    try {
-      SimpleIdentifier constructorName = node.name;
-      if (constructorName == null) {
-        _enclosingExecutable = _enclosingClass.unnamedConstructor;
-        if (_enclosingExecutable == null) {
-          _mismatch('Could not find default constructor', node);
-        }
-      } else {
-        _enclosingExecutable =
-            _enclosingClass.getNamedConstructor(constructorName.name);
-        if (_enclosingExecutable == null) {
-          _mismatch(
-              'Could not find constructor element with name "${constructorName.name}',
-              node);
-        }
-        constructorName.staticElement = _enclosingExecutable;
-      }
-      _expectedElements.remove(_enclosingExecutable);
-      node.element = _enclosingExecutable as ConstructorElement;
-      super.visitConstructorDeclaration(node);
-      _resolveMetadata(node, node.metadata, _enclosingExecutable);
-      return null;
-    } finally {
-      _enclosingExecutable = outerExecutable;
-    }
-  }
-
-  @override
-  Object visitDeclaredIdentifier(DeclaredIdentifier node) {
-    SimpleIdentifier variableName = node.identifier;
-    Element element =
-        _findIdentifier(_enclosingExecutable.localVariables, variableName);
-    super.visitDeclaredIdentifier(node);
-    _resolveMetadata(node, node.metadata, element);
-    return null;
-  }
-
-  @override
-  Object visitDefaultFormalParameter(DefaultFormalParameter node) {
-    SimpleIdentifier parameterName = node.parameter.identifier;
-    ParameterElement element = _getElementForParameter(node, parameterName);
-    Expression defaultValue = node.defaultValue;
-    if (defaultValue != null) {
-      ExecutableElement outerExecutable = _enclosingExecutable;
-      try {
-        _enclosingExecutable = element.initializer;
-        defaultValue.accept(this);
-      } finally {
-        _enclosingExecutable = outerExecutable;
-      }
-    }
-    ParameterElement outerParameter = _enclosingParameter;
-    try {
-      _enclosingParameter = element;
-      super.visitDefaultFormalParameter(node);
-      _resolveMetadata(node, node.metadata, element);
-      return null;
-    } finally {
-      _enclosingParameter = outerParameter;
-    }
-  }
-
-  @override
-  Object visitEnumDeclaration(EnumDeclaration node) {
-    ClassElement enclosingEnum =
-        _findIdentifier(_enclosingUnit.enums, node.name);
-    List<FieldElement> constants = enclosingEnum.fields;
-    for (EnumConstantDeclaration constant in node.constants) {
-      _findIdentifier(constants, constant.name);
-    }
-    super.visitEnumDeclaration(node);
-    _resolveMetadata(node, node.metadata, enclosingEnum);
-    return null;
-  }
-
-  @override
-  Object visitExportDirective(ExportDirective node) {
-    super.visitExportDirective(node);
-    _resolveAnnotations(
-        node, node.metadata, _enclosingUnit.getAnnotations(node.offset));
-    return null;
-  }
-
-  @override
-  Object visitFieldDeclaration(FieldDeclaration node) {
-    super.visitFieldDeclaration(node);
-    _resolveMetadata(node, node.metadata, node.fields.variables[0].element);
-    return null;
-  }
-
-  @override
-  Object visitFieldFormalParameter(FieldFormalParameter node) {
-    if (node.parent is! DefaultFormalParameter) {
-      SimpleIdentifier parameterName = node.identifier;
-      ParameterElement element = _getElementForParameter(node, parameterName);
-      ParameterElement outerParameter = _enclosingParameter;
-      try {
-        _enclosingParameter = element;
-        super.visitFieldFormalParameter(node);
-        _resolveMetadata(node, node.metadata, element);
-        return null;
-      } finally {
-        _enclosingParameter = outerParameter;
-      }
-    } else {
-      return super.visitFieldFormalParameter(node);
-    }
-  }
-
-  @override
-  Object visitFunctionDeclaration(FunctionDeclaration node) {
-    ExecutableElement outerExecutable = _enclosingExecutable;
-    try {
-      SimpleIdentifier functionName = node.name;
-      Token property = node.propertyKeyword;
-      if (property == null) {
-        if (_enclosingExecutable != null) {
-          _enclosingExecutable =
-              _findIdentifier(_enclosingExecutable.functions, functionName);
-        } else {
-          _enclosingExecutable =
-              _findIdentifier(_enclosingUnit.functions, functionName);
-        }
-      } else {
-        if (_enclosingExecutable != null) {
-          _enclosingExecutable =
-              _findIdentifier(_enclosingExecutable.functions, functionName);
-        } else {
-          List<PropertyAccessorElement> accessors;
-          if (_enclosingClass != null) {
-            accessors = _enclosingClass.accessors;
-          } else {
-            accessors = _enclosingUnit.accessors;
-          }
-          PropertyAccessorElement accessor;
-          if (property.keyword == Keyword.GET) {
-            accessor = _findIdentifier(accessors, functionName);
-          } else if (property.keyword == Keyword.SET) {
-            accessor = _findWithNameAndOffset(accessors, functionName,
-                functionName.name + '=', functionName.offset);
-            _expectedElements.remove(accessor);
-            functionName.staticElement = accessor;
-          }
-          _enclosingExecutable = accessor;
-        }
-      }
-      node.functionExpression.element = _enclosingExecutable;
-      super.visitFunctionDeclaration(node);
-      _resolveMetadata(node, node.metadata, _enclosingExecutable);
-      return null;
-    } finally {
-      _enclosingExecutable = outerExecutable;
-    }
-  }
-
-  @override
-  Object visitFunctionExpression(FunctionExpression node) {
-    if (node.parent is! FunctionDeclaration) {
-      FunctionElement element = _findAtOffset(
-          _enclosingExecutable.functions, node, node.beginToken.offset);
-      _expectedElements.remove(element);
-      node.element = element;
-    }
-    ExecutableElement outerExecutable = _enclosingExecutable;
-    try {
-      _enclosingExecutable = node.element;
-      return super.visitFunctionExpression(node);
-    } finally {
-      _enclosingExecutable = outerExecutable;
-    }
-  }
-
-  @override
-  Object visitFunctionTypeAlias(FunctionTypeAlias node) {
-    FunctionTypeAliasElement outerAlias = _enclosingAlias;
-    try {
-      SimpleIdentifier aliasName = node.name;
-      _enclosingAlias =
-          _findIdentifier(_enclosingUnit.functionTypeAliases, aliasName);
-      super.visitFunctionTypeAlias(node);
-      _resolveMetadata(node, node.metadata, _enclosingAlias);
-      return null;
-    } finally {
-      _enclosingAlias = outerAlias;
-    }
-  }
-
-  @override
-  Object visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
-    if (node.parent is! DefaultFormalParameter) {
-      SimpleIdentifier parameterName = node.identifier;
-      ParameterElement element = _getElementForParameter(node, parameterName);
-      ParameterElement outerParameter = _enclosingParameter;
-      try {
-        _enclosingParameter = element;
-        super.visitFunctionTypedFormalParameter(node);
-        _resolveMetadata(node, node.metadata, _enclosingParameter);
-        return null;
-      } finally {
-        _enclosingParameter = outerParameter;
-      }
-    } else {
-      return super.visitFunctionTypedFormalParameter(node);
-    }
-  }
-
-  @override
-  Object visitImportDirective(ImportDirective node) {
-    super.visitImportDirective(node);
-    _resolveAnnotations(
-        node, node.metadata, _enclosingUnit.getAnnotations(node.offset));
-    return null;
-  }
-
-  @override
-  Object visitLabeledStatement(LabeledStatement node) {
-    for (Label label in node.labels) {
-      SimpleIdentifier labelName = label.label;
-      _findIdentifier(_enclosingExecutable.labels, labelName);
-    }
-    return super.visitLabeledStatement(node);
-  }
-
-  @override
-  Object visitLibraryDirective(LibraryDirective node) {
-    super.visitLibraryDirective(node);
-    _resolveAnnotations(
-        node, node.metadata, _enclosingUnit.getAnnotations(node.offset));
-    return null;
-  }
-
-  @override
-  Object visitMethodDeclaration(MethodDeclaration node) {
-    ExecutableElement outerExecutable = _enclosingExecutable;
-    try {
-      Token property = node.propertyKeyword;
-      SimpleIdentifier methodName = node.name;
-      String nameOfMethod = methodName.name;
-      if (property == null) {
-        String elementName = nameOfMethod == '-' &&
-                node.parameters != null &&
-                node.parameters.parameters.isEmpty
-            ? 'unary-'
-            : nameOfMethod;
-        _enclosingExecutable = _findWithNameAndOffset(_enclosingClass.methods,
-            methodName, elementName, methodName.offset);
-        _expectedElements.remove(_enclosingExecutable);
-        methodName.staticElement = _enclosingExecutable;
-      } else {
-        PropertyAccessorElement accessor;
-        if (property.keyword == Keyword.GET) {
-          accessor = _findIdentifier(_enclosingClass.accessors, methodName);
-        } else if (property.keyword == Keyword.SET) {
-          accessor = _findWithNameAndOffset(_enclosingClass.accessors,
-              methodName, nameOfMethod + '=', methodName.offset);
-          _expectedElements.remove(accessor);
-          methodName.staticElement = accessor;
-        }
-        _enclosingExecutable = accessor;
-      }
-      super.visitMethodDeclaration(node);
-      _resolveMetadata(node, node.metadata, _enclosingExecutable);
-      return null;
-    } finally {
-      _enclosingExecutable = outerExecutable;
-    }
-  }
-
-  @override
-  Object visitPartDirective(PartDirective node) {
-    super.visitPartDirective(node);
-    _resolveAnnotations(
-        node, node.metadata, _enclosingUnit.getAnnotations(node.offset));
-    return null;
-  }
-
-  @override
-  Object visitPartOfDirective(PartOfDirective node) {
-    node.element = _enclosingUnit.library;
-    return super.visitPartOfDirective(node);
-  }
-
-  @override
-  Object visitSimpleFormalParameter(SimpleFormalParameter node) {
-    if (node.parent is! DefaultFormalParameter) {
-      SimpleIdentifier parameterName = node.identifier;
-      ParameterElement element = _getElementForParameter(node, parameterName);
-      ParameterElement outerParameter = _enclosingParameter;
-      try {
-        _enclosingParameter = element;
-        super.visitSimpleFormalParameter(node);
-        _resolveMetadata(node, node.metadata, element);
-        return null;
-      } finally {
-        _enclosingParameter = outerParameter;
-      }
-    } else {}
-    return super.visitSimpleFormalParameter(node);
-  }
-
-  @override
-  Object visitSwitchCase(SwitchCase node) {
-    for (Label label in node.labels) {
-      SimpleIdentifier labelName = label.label;
-      _findIdentifier(_enclosingExecutable.labels, labelName);
-    }
-    return super.visitSwitchCase(node);
-  }
-
-  @override
-  Object visitSwitchDefault(SwitchDefault node) {
-    for (Label label in node.labels) {
-      SimpleIdentifier labelName = label.label;
-      _findIdentifier(_enclosingExecutable.labels, labelName);
-    }
-    return super.visitSwitchDefault(node);
-  }
-
-  @override
-  Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
-    super.visitTopLevelVariableDeclaration(node);
-    _resolveMetadata(node, node.metadata, node.variables.variables[0].element);
-    return null;
-  }
-
-  @override
-  Object visitTypeParameter(TypeParameter node) {
-    SimpleIdentifier parameterName = node.name;
-    Element element = null;
-    if (_enclosingExecutable != null) {
-      element = _findIdentifier(
-          _enclosingExecutable.typeParameters, parameterName,
-          required: false);
-    }
-    if (element == null) {
-      if (_enclosingClass != null) {
-        element =
-            _findIdentifier(_enclosingClass.typeParameters, parameterName);
-      } else if (_enclosingAlias != null) {
-        element =
-            _findIdentifier(_enclosingAlias.typeParameters, parameterName);
-      }
-    }
-    if (element == null) {
-      String name = parameterName.name;
-      int offset = parameterName.offset;
-      _mismatch(
-          'Could not find type parameter with name "$name" at $offset', node);
-    }
-    super.visitTypeParameter(node);
-    _resolveMetadata(node, node.metadata, element);
-    return null;
-  }
-
-  @override
-  Object visitVariableDeclaration(VariableDeclaration node) {
-    VariableElement element = null;
-    SimpleIdentifier variableName = node.name;
-    if (_enclosingExecutable != null) {
-      element = _findIdentifier(
-          _enclosingExecutable.localVariables, variableName,
-          required: false);
-    }
-    if (element == null && _enclosingClass != null) {
-      element = _findIdentifier(_enclosingClass.fields, variableName,
-          required: false);
-    }
-    if (element == null && _enclosingUnit != null) {
-      element = _findIdentifier(_enclosingUnit.topLevelVariables, variableName);
-    }
-    Expression initializer = node.initializer;
-    if (initializer != null) {
-      ExecutableElement outerExecutable = _enclosingExecutable;
-      try {
-        _enclosingExecutable = element.initializer;
-        return super.visitVariableDeclaration(node);
-      } finally {
-        _enclosingExecutable = outerExecutable;
-      }
-    }
-    return super.visitVariableDeclaration(node);
-  }
-
-  @override
-  Object visitVariableDeclarationList(VariableDeclarationList node) {
-    super.visitVariableDeclarationList(node);
-    if (node.parent is! FieldDeclaration &&
-        node.parent is! TopLevelVariableDeclaration) {
-      _resolveMetadata(node, node.metadata, node.variables[0].element);
-    }
-    return null;
-  }
-
-  /**
-   * Return the element in the given list of [elements] that was created for the
-   * declaration at the given [offset]. Throw an [ElementMismatchException] if
-   * an element at that offset cannot be found.
-   *
-   * This method should only be used when there is no name associated with the
-   * node.
-   */
-  Element _findAtOffset(List<Element> elements, AstNode node, int offset) =>
-      _findWithNameAndOffset(elements, node, '', offset);
-
-  /**
-   * Return the element in the given list of [elements] that was created for the
-   * declaration with the given [identifier]. As a side-effect, associate the
-   * returned element with the identifier. Throw an [ElementMismatchException]
-   * if an element corresponding to the identifier cannot be found unless
-   * [required] is `false`, in which case return `null`.
-   */
-  Element _findIdentifier(List<Element> elements, SimpleIdentifier identifier,
-      {bool required: true}) {
-    Element element = _findWithNameAndOffset(
-        elements, identifier, identifier.name, identifier.offset,
-        required: required);
-    _expectedElements.remove(element);
-    identifier.staticElement = element;
-    return element;
-  }
-
-  /**
-   * Return the element in the given list of [elements] that was created for the
-   * declaration with the given [name] at the given [offset]. Throw an
-   * [ElementMismatchException] if an element corresponding to the identifier
-   * cannot be found unless [required] is `false`, in which case return `null`.
-   */
-  Element _findWithNameAndOffset(
-      List<Element> elements, AstNode node, String name, int offset,
-      {bool required: true}) {
-    int length = elements.length;
-    for (int i = 0; i < length; i++) {
-      Element element = elements[i];
-      if (element.nameOffset == offset && element.name == name) {
-        return element;
-      }
-    }
-    if (!required) {
-      return null;
-    }
-    for (int i = 0; i < length; i++) {
-      Element element = elements[i];
-      if (element.name == name) {
-        _mismatch(
-            'Found element with name "$name" at ${element.nameOffset}, '
-            'but expected offset of $offset',
-            node);
-      }
-      if (element.nameOffset == offset) {
-        _mismatch(
-            'Found element with name "${element.name}" at $offset, '
-            'but expected element with name "$name"',
-            node);
-      }
-    }
-    _mismatch('Could not find element with name "$name" at $offset', node);
-    return null; // Never reached
-  }
-
-  /**
-   * Search the most closely enclosing list of parameter elements for a
-   * parameter, defined by the given [node], with the given [parameterName].
-   * Return the element that was found, or throw an [ElementMismatchException]
-   * if an element corresponding to the identifier cannot be found.
-   */
-  ParameterElement _getElementForParameter(
-      FormalParameter node, SimpleIdentifier parameterName) {
-    List<ParameterElement> parameters = null;
-    if (_enclosingParameter != null) {
-      parameters = _enclosingParameter.parameters;
-    }
-    if (parameters == null && _enclosingExecutable != null) {
-      parameters = _enclosingExecutable.parameters;
-    }
-    if (parameters == null && _enclosingAlias != null) {
-      parameters = _enclosingAlias.parameters;
-    }
-    if (parameters == null) {
-      StringBuffer buffer = new StringBuffer();
-      buffer.writeln('Could not find parameter in enclosing scope');
-      buffer.writeln(
-          '(_enclosingParameter == null) == ${_enclosingParameter == null}');
-      buffer.writeln(
-          '(_enclosingExecutable == null) == ${_enclosingExecutable == null}');
-      buffer.writeln('(_enclosingAlias == null) == ${_enclosingAlias == null}');
-      _mismatch(buffer.toString(), parameterName);
-    }
-    return _findIdentifier(parameters, parameterName);
-  }
-
-  /**
-   * Associate each of the annotation [nodes] with the corresponding
-   * [ElementAnnotation] in [annotations]. If there is a problem, report it
-   * against the given [parent] node.
-   */
-  void _resolveAnnotations(AstNode parent, NodeList<Annotation> nodes,
-      List<ElementAnnotation> annotations) {
-    int nodeCount = nodes.length;
-    if (nodeCount != annotations.length) {
-      _mismatch(
-          'Found $nodeCount annotation nodes and '
-          '${annotations.length} element annotations',
-          parent);
-    }
-    for (int i = 0; i < nodeCount; i++) {
-      nodes[i].elementAnnotation = annotations[i];
-    }
-  }
-
-  /**
-   * If [element] is not `null`, associate each of the annotation [nodes] with
-   * the corresponding [ElementAnnotation] in [element.metadata]. If there is a
-   * problem, report it against the given [parent] node.
-   *
-   * If [element] is `null`, do nothing--this allows us to be robust in the
-   * case where we are operating on an element model that hasn't been fully
-   * built.
-   */
-  void _resolveMetadata(
-      AstNode parent, NodeList<Annotation> nodes, Element element) {
-    if (element != null) {
-      _resolveAnnotations(parent, nodes, element.metadata);
-    }
-  }
-
-  /**
-   * Throw an exception if there are non-synthetic elements in the element model
-   * that were not associated with an AST node.
-   */
-  void _validateResolution() {
-    if (_expectedElements.isNotEmpty) {
-      StringBuffer buffer = new StringBuffer();
-      buffer.write(_expectedElements.length);
-      buffer.writeln(' unmatched elements found:');
-      for (Element element in _expectedElements) {
-        buffer.write('  ');
-        buffer.writeln(element);
-      }
-      throw new ElementMismatchException(buffer.toString());
-    }
-  }
-}
-
-/**
  * A visitor that resolves directives in an AST structure to already built
  * elements.
  *
@@ -3331,15 +2688,6 @@
   }
 }
 
-class ElementMismatchException extends AnalysisException {
-  /**
-   * Initialize a newly created exception to have the given [message] and
-   * [cause].
-   */
-  ElementMismatchException(String message, [CaughtException cause = null])
-      : super(message, cause);
-}
-
 /**
  * Instances of the class `EnumMemberBuilder` build the members in enum declarations.
  */
@@ -3373,15 +2721,15 @@
     InterfaceType intType = _typeProvider.intType;
     String indexFieldName = "index";
     FieldElementImpl indexField = new FieldElementImpl(indexFieldName, -1);
-    indexField.final2 = true;
-    indexField.synthetic = true;
+    indexField.isFinal = true;
+    indexField.isSynthetic = true;
     indexField.type = intType;
     fields.add(indexField);
     getters.add(_createGetter(indexField));
     ConstFieldElementImpl valuesField = new ConstFieldElementImpl("values", -1);
-    valuesField.static = true;
-    valuesField.const3 = true;
-    valuesField.synthetic = true;
+    valuesField.isStatic = true;
+    valuesField.isConst = true;
+    valuesField.isSynthetic = true;
     valuesField.type = _typeProvider.listType.instantiate(<DartType>[enumType]);
     fields.add(valuesField);
     getters.add(_createGetter(valuesField));
@@ -3431,41 +2779,6 @@
 }
 
 /**
- * A mixin for classes that use an existing element model to resolve a portion
- * of an AST structure.
- */
-class ExistingElementResolver {
-  /**
-   * The compilation unit containing the AST nodes being visited.
-   */
-  CompilationUnitElementImpl _enclosingUnit;
-
-  /**
-   * Throw an [ElementMismatchException] to report that the element model and the
-   * AST do not match. The [message] will have the path to the given [node]
-   * appended to it.
-   */
-  void _mismatch(String message, AstNode node) {
-    StringBuffer buffer = new StringBuffer();
-    buffer.write('Mismatch in ');
-    buffer.write(runtimeType);
-    buffer.write(' while resolving ');
-    buffer.writeln(_enclosingUnit?.source?.fullName);
-    buffer.writeln(message);
-    buffer.write('Path to root:');
-    String separator = ' ';
-    AstNode parent = node;
-    while (parent != null) {
-      buffer.write(separator);
-      buffer.write(parent.runtimeType.toString());
-      separator = ', ';
-      parent = parent.parent;
-    }
-    throw new ElementMismatchException(buffer.toString());
-  }
-}
-
-/**
  * Instances of the class `ExitDetector` determine whether the visited AST node is guaranteed
  * to terminate by executing a `return` statement, `throw` expression, `rethrow`
  * expression, or simple infinite loop such as `while(true)`.
@@ -3496,6 +2809,9 @@
   bool visitAsExpression(AsExpression node) => _nodeExits(node.expression);
 
   @override
+  bool visitAssertInitializer(AssertInitializer node) => false;
+
+  @override
   bool visitAssertStatement(AssertStatement node) => false;
 
   @override
@@ -6481,8 +5797,7 @@
     }
     // Clone the ASTs for default formal parameters, so that we can use them
     // during constant evaluation.
-    if (!LibraryElementImpl.hasResolutionCapability(
-        definingLibrary, LibraryResolutionCapability.constantExpressions)) {
+    if (!_hasSerializedConstantInitializer(element)) {
       (element as ConstVariableElement).constantInitializer =
           new ConstantAstCloner().cloneNode(node.defaultValue);
     }
@@ -7340,6 +6655,25 @@
     return null;
   }
 
+  /**
+   * Return `true` if the given [parameter] element of the AST being resolved
+   * is resynthesized and is an API-level, not local, so has its initializer
+   * serialized.
+   */
+  bool _hasSerializedConstantInitializer(ParameterElement parameter) {
+    if (LibraryElementImpl.hasResolutionCapability(
+        definingLibrary, LibraryResolutionCapability.constantExpressions)) {
+      Element executable = parameter.enclosingElement;
+      if (executable is MethodElement) {
+        return true;
+      }
+      if (executable is FunctionElement) {
+        return executable.enclosingElement is CompilationUnitElement;
+      }
+    }
+    return false;
+  }
+
   void _inferArgumentTypesFromContext(InvocationExpression node) {
     if (!strongMode) {
       // Use propagated type inference for lambdas if not in strong mode.
@@ -7584,9 +6918,10 @@
       potentialType ??= DynamicTypeImpl.instance;
 
       // Check if we can promote to potentialType from type.
-      if (typeSystem.canPromoteToType(potentialType, type)) {
+      DartType promoteType = typeSystem.tryPromoteToType(potentialType, type);
+      if (promoteType != null) {
         // Do promote type of variable.
-        _promoteManager.setType(element, potentialType);
+        _promoteManager.setType(element, promoteType);
       }
     }
   }
@@ -7834,12 +7169,6 @@
   LabelScope labelScope;
 
   /**
-   * A flag indicating whether to enable support for allowing access to field
-   * formal parameters in a constructor's initializer list.
-   */
-  bool enableInitializingFormalAccess = false;
-
-  /**
    * The class containing the AST nodes being visited,
    * or `null` if we are not in the scope of a class.
    */
@@ -7870,8 +7199,6 @@
     } else {
       this.nameScope = nameScope;
     }
-    enableInitializingFormalAccess =
-        definingLibrary.context.analysisOptions.enableInitializingFormalAccess;
   }
 
   /**
@@ -8033,7 +7360,7 @@
       node.parameters?.accept(this);
       Scope functionScope = nameScope;
       try {
-        if (constructorElement != null && enableInitializingFormalAccess) {
+        if (constructorElement != null) {
           nameScope =
               new ConstructorInitializerScope(nameScope, constructorElement);
         }
@@ -9334,7 +8661,7 @@
   /**
    * A table mapping elements to the overridden type of that element.
    */
-  Map<VariableElement, DartType> _overridenTypes =
+  Map<VariableElement, DartType> _overriddenTypes =
       new HashMap<VariableElement, DartType>();
 
   /**
@@ -9350,7 +8677,7 @@
    * @param overrides the overrides to be applied
    */
   void applyOverrides(Map<VariableElement, DartType> overrides) {
-    _overridenTypes.addAll(overrides);
+    _overriddenTypes.addAll(overrides);
   }
 
   /**
@@ -9359,7 +8686,7 @@
    *
    * @return the overrides in the current scope
    */
-  Map<VariableElement, DartType> captureLocalOverrides() => _overridenTypes;
+  Map<VariableElement, DartType> captureLocalOverrides() => _overriddenTypes;
 
   /**
    * Return a map from the elements for the variables in the given list that have their types
@@ -9376,7 +8703,7 @@
       for (VariableDeclaration variable in variableList.variables) {
         VariableElement element = variable.element;
         if (element != null) {
-          DartType type = _overridenTypes[element];
+          DartType type = _overriddenTypes[element];
           if (type != null) {
             overrides[element] = type;
           }
@@ -9396,8 +8723,8 @@
   DartType getType(Element element) {
     Element nonAccessor =
         element is PropertyAccessorElement ? element.variable : element;
-    DartType type = _overridenTypes[nonAccessor];
-    if (_overridenTypes.containsKey(nonAccessor)) {
+    DartType type = _overriddenTypes[nonAccessor];
+    if (_overriddenTypes.containsKey(nonAccessor)) {
       return type;
     }
     return type ?? _outerScope?.getType(element);
@@ -9407,7 +8734,7 @@
    * Clears the overridden type of the given [element].
    */
   void resetType(VariableElement element) {
-    _overridenTypes[element] = null;
+    _overriddenTypes[element] = null;
   }
 
   /**
@@ -9417,7 +8744,7 @@
    * @param type the overridden type of the given element
    */
   void setType(VariableElement element, DartType type) {
-    _overridenTypes[element] = type;
+    _overriddenTypes[element] = type;
   }
 }
 
@@ -10076,6 +9403,31 @@
 }
 
 /**
+ * Modes in which [TypeResolverVisitor] works.
+ */
+enum TypeResolverMode {
+  /**
+   * Resolve all names types of all nodes.
+   */
+  everything,
+
+  /**
+   * Resolve only type names outside of function bodies, variable initializers,
+   * and parameter default values.
+   */
+  api,
+
+  /**
+   * Resolve only type names that would be skipped during [api].
+   *
+   * Resolution must start from a unit member or a class member. For example
+   * it is not allowed to resolve types in a separate statement, or a function
+   * body.
+   */
+  local
+}
+
+/**
  * Instances of the class `TypeResolverVisitor` are used to resolve the types associated with
  * the elements in the element model. This includes the types of superclasses, mixins, interfaces,
  * fields, methods, parameters, and local variables. As a side-effect, this also finishes building
@@ -10112,6 +9464,19 @@
    */
   TypeNameResolver _typeNameResolver;
 
+  final TypeResolverMode mode;
+
+  /**
+   * Is `true` when we are visiting all nodes in [TypeResolverMode.local] mode.
+   */
+  bool _localModeVisitAll = false;
+
+  /**
+   * Is `true` if we are in [TypeResolverMode.local] mode, and the initial
+   * [nameScope] was computed.
+   */
+  bool _localModeScopeReady = false;
+
   /**
    * Initialize a newly created visitor to resolve the nodes in an AST node.
    *
@@ -10129,7 +9494,7 @@
    */
   TypeResolverVisitor(LibraryElement definingLibrary, Source source,
       TypeProvider typeProvider, AnalysisErrorListener errorListener,
-      {Scope nameScope})
+      {Scope nameScope, this.mode: TypeResolverMode.everything})
       : super(definingLibrary, source, typeProvider, errorListener,
             nameScope: nameScope) {
     _dynamicType = typeProvider.dynamicType;
@@ -10187,7 +9552,7 @@
       _recordType(exception, exceptionType);
       Element element = exception.staticElement;
       if (element is VariableElementImpl) {
-        element.type = exceptionType;
+        element.declaredType = exceptionType;
       } else {
         // TODO(brianwilkerson) Report the internal error
       }
@@ -10197,7 +9562,7 @@
       _recordType(stackTrace, typeProvider.stackTraceType);
       Element element = stackTrace.staticElement;
       if (element is VariableElementImpl) {
-        element.type = typeProvider.stackTraceType;
+        element.declaredType = typeProvider.stackTraceType;
       } else {
         // TODO(brianwilkerson) Report the internal error
       }
@@ -10323,7 +9688,7 @@
       declaredType = _typeNameResolver._getType(typeName);
     }
     LocalVariableElementImpl element = node.element as LocalVariableElementImpl;
-    element.type = declaredType;
+    element.declaredType = declaredType;
     return null;
   }
 
@@ -10346,7 +9711,7 @@
         } else {
           type = _typeNameResolver._getType(typeName);
         }
-        element.type = type ?? _dynamicType;
+        element.declaredType = type ?? _dynamicType;
       } else {
         _setFunctionTypedParameterType(element, node.type, node.parameters);
       }
@@ -10370,7 +9735,7 @@
       AnalysisEngine.instance.logger.logError(buffer.toString(),
           new CaughtException(new AnalysisException(), null));
     }
-    element.returnType = _computeReturnType(node.returnType);
+    element.declaredReturnType = _computeReturnType(node.returnType);
     element.type = new FunctionTypeImpl(element);
     _inferSetterReturnType(element);
     return null;
@@ -10419,7 +9784,15 @@
       AnalysisEngine.instance.logger.logError(buffer.toString(),
           new CaughtException(new AnalysisException(), null));
     }
-    element.returnType = _computeReturnType(node.returnType);
+
+    // When the library is resynthesized, types of all of its elements are
+    // already set - statically or inferred. We don't want to overwrite them.
+    if (LibraryElementImpl.hasResolutionCapability(
+        definingLibrary, LibraryResolutionCapability.resolvedTypeNames)) {
+      return null;
+    }
+
+    element.declaredReturnType = _computeReturnType(node.returnType);
     element.type = new FunctionTypeImpl(element);
     _inferSetterReturnType(element);
     if (element is PropertyAccessorElement) {
@@ -10427,18 +9800,125 @@
       PropertyInducingElementImpl variable =
           accessor.variable as PropertyInducingElementImpl;
       if (accessor.isGetter) {
-        variable.type = element.returnType;
+        variable.declaredType = element.returnType;
       } else if (variable.type == null) {
         List<ParameterElement> parameters = element.parameters;
         if (parameters != null && parameters.length > 0) {
-          variable.type = parameters[0].type;
+          variable.declaredType = parameters[0].type;
         }
       }
     }
+
     return null;
   }
 
   @override
+  Object visitNode(AstNode node) {
+    // In API mode we need to skip:
+    //   - function bodies;
+    //   - default values of parameters;
+    //   - initializers of top-level variables.
+    if (mode == TypeResolverMode.api) {
+      if (node is FunctionBody) {
+        return null;
+      }
+      if (node is DefaultFormalParameter) {
+        node.parameter.accept(this);
+        return null;
+      }
+      if (node is VariableDeclaration) {
+        return null;
+      }
+    }
+
+    // In local mode we need to resolve only:
+    //   - function bodies;
+    //   - default values of parameters;
+    //   - initializers of top-level variables.
+    // So, we carefully visit only nodes that are, or contain, these nodes.
+    // The client may choose to start visiting any node, but we still want to
+    // resolve only type names that are local.
+    if (mode == TypeResolverMode.local) {
+      // We are in the state of visiting all nodes.
+      if (_localModeVisitAll) {
+        return super.visitNode(node);
+      }
+
+      // Ensure that the name scope is ready.
+      if (!_localModeScopeReady) {
+        void fillNameScope(AstNode node) {
+          if (node is FunctionBody ||
+              node is FormalParameterList ||
+              node is VariableDeclaration) {
+            throw new StateError(
+                'Local type resolution must start from a class or unit member.');
+          }
+          // Create enclosing name scopes.
+          AstNode parent = node.parent;
+          if (parent != null) {
+            fillNameScope(parent);
+          }
+          // Create the name scope for the node.
+          if (node is ClassDeclaration) {
+            ClassElement classElement = node.element;
+            nameScope = new TypeParameterScope(nameScope, classElement);
+            nameScope = new ClassScope(nameScope, classElement);
+          }
+        }
+
+        fillNameScope(node);
+        _localModeScopeReady = true;
+      }
+
+      /**
+       * Visit the given [node] and all its children.
+       */
+      void visitAllNodes(AstNode node) {
+        if (node != null) {
+          bool wasVisitAllInLocalMode = _localModeVisitAll;
+          try {
+            _localModeVisitAll = true;
+            node.accept(this);
+          } finally {
+            _localModeVisitAll = wasVisitAllInLocalMode;
+          }
+        }
+      }
+
+      // Visit only nodes that may contain type names to resolve.
+      if (node is CompilationUnit) {
+        node.declarations.forEach(visitNode);
+      } else if (node is ClassDeclaration) {
+        node.members.forEach(visitNode);
+      } else if (node is DefaultFormalParameter) {
+        visitAllNodes(node.defaultValue);
+      } else if (node is FieldDeclaration) {
+        visitNode(node.fields);
+      } else if (node is FunctionBody) {
+        visitAllNodes(node);
+      } else if (node is FunctionDeclaration) {
+        visitNode(node.functionExpression.parameters);
+        visitAllNodes(node.functionExpression.body);
+      } else if (node is FormalParameterList) {
+        node.parameters.accept(this);
+      } else if (node is MethodDeclaration) {
+        visitNode(node.parameters);
+        visitAllNodes(node.body);
+      } else if (node is TopLevelVariableDeclaration) {
+        visitNode(node.variables);
+      } else if (node is VariableDeclaration) {
+        visitAllNodes(node.initializer);
+      } else if (node is VariableDeclarationList) {
+        node.variables.forEach(visitNode);
+      }
+      return null;
+    }
+
+    // The mode in which we visit all nodes.
+    return super.visitNode(node);
+  }
+
+  @override
   Object visitSimpleFormalParameter(SimpleFormalParameter node) {
     super.visitSimpleFormalParameter(node);
     DartType declaredType;
@@ -10450,7 +9930,7 @@
     }
     Element element = node.identifier.staticElement;
     if (element is ParameterElementImpl) {
-      element.type = declaredType;
+      element.declaredType = declaredType;
     } else {
       // TODO(brianwilkerson) Report the internal error.
     }
@@ -10496,8 +9976,17 @@
   @override
   Object visitVariableDeclaration(VariableDeclaration node) {
     super.visitVariableDeclaration(node);
+    var variableList = node.parent as VariableDeclarationList;
+    // When the library is resynthesized, the types of field elements are
+    // already set - statically or inferred. We don't want to overwrite them.
+    if (variableList.parent is FieldDeclaration &&
+        LibraryElementImpl.hasResolutionCapability(
+            definingLibrary, LibraryResolutionCapability.resolvedTypeNames)) {
+      return null;
+    }
+    // Resolve the type.
     DartType declaredType;
-    TypeName typeName = (node.parent as VariableDeclarationList).type;
+    TypeName typeName = variableList.type;
     if (typeName == null) {
       declaredType = _dynamicType;
     } else {
@@ -10505,7 +9994,7 @@
     }
     Element element = node.name.staticElement;
     if (element is VariableElementImpl) {
-      element.type = declaredType;
+      element.declaredType = declaredType;
     }
     return null;
   }
@@ -10579,7 +10068,7 @@
         element is PropertyAccessorElementImpl &&
         element.isSetter &&
         element.hasImplicitReturnType) {
-      element.returnType = VoidTypeImpl.instance;
+      element.declaredReturnType = VoidTypeImpl.instance;
     }
   }
 
@@ -10725,9 +10214,9 @@
       TypeName returnType, FormalParameterList parameterList) {
     List<ParameterElement> parameters = _getElements(parameterList);
     FunctionElementImpl functionElement = new FunctionElementImpl.forNode(null);
-    functionElement.synthetic = true;
+    functionElement.isSynthetic = true;
     functionElement.shareParameters(parameters);
-    functionElement.returnType = _computeReturnType(returnType);
+    functionElement.declaredReturnType = _computeReturnType(returnType);
     functionElement.enclosingElement = element;
     functionElement.shareTypeParameters(element.typeParameters);
     element.type = new FunctionTypeImpl(functionElement);
diff --git a/pkg/analyzer/lib/src/generated/sdk.dart b/pkg/analyzer/lib/src/generated/sdk.dart
index 7e86d8d..397fb9d 100644
--- a/pkg/analyzer/lib/src/generated/sdk.dart
+++ b/pkg/analyzer/lib/src/generated/sdk.dart
@@ -7,6 +7,7 @@
 import 'dart:collection';
 
 import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/ast/token.dart';
 import 'package:analyzer/dart/ast/visitor.dart';
 import 'package:analyzer/src/generated/engine.dart'
     show AnalysisContext, AnalysisOptions, AnalysisOptionsImpl;
@@ -15,12 +16,6 @@
 import 'package:analyzer/src/summary/idl.dart' show PackageBundle;
 
 /**
- * A function used to create a new DartSdk with the given [options]. If the
- * passed [options] are `null`, then default options are used.
- */
-typedef DartSdk SdkCreator(AnalysisOptions options);
-
-/**
  * A Dart SDK installed in a specified location.
  */
 abstract class DartSdk {
@@ -117,11 +112,6 @@
   final bool canUseSummaries;
 
   /**
-   * The function used to create new SDK's.
-   */
-  final SdkCreator sdkCreator;
-
-  /**
    * A table mapping (an encoding of) analysis options and SDK locations to the
    * DartSdk from that location that has been configured with those options.
    */
@@ -130,8 +120,8 @@
   /**
    * Initialize a newly created manager.
    */
-  DartSdkManager(
-      this.defaultSdkDirectory, this.canUseSummaries, this.sdkCreator);
+  DartSdkManager(this.defaultSdkDirectory, this.canUseSummaries,
+      [dynamic ignored]);
 
   /**
    * Return any SDK that has been created, or `null` if no SDKs have been
@@ -151,25 +141,13 @@
   List<SdkDescription> get sdkDescriptors => sdkMap.keys.toList();
 
   /**
-   * Return the Dart SDK that is appropriate for the given analysis [options].
-   * If such an SDK has not yet been created, then the [sdkCreator] will be
-   * invoked to create it.
+   * Return the Dart SDK that is appropriate for the given SDK [description].
+   * If such an SDK has not yet been created, then the [ifAbsent] function will
+   * be invoked to create it.
    */
   DartSdk getSdk(SdkDescription description, DartSdk ifAbsent()) {
     return sdkMap.putIfAbsent(description, ifAbsent);
   }
-
-  /**
-   * Return the Dart SDK that is appropriate for the given analysis [options].
-   * If such an SDK has not yet been created, then the [sdkCreator] will be
-   * invoked to create it.
-   */
-  DartSdk getSdkForOptions(AnalysisOptions options) {
-    // TODO(brianwilkerson) Remove this method and the field sdkCreator.
-    SdkDescription description =
-        new SdkDescription(<String>[defaultSdkDirectory], options);
-    return getSdk(description, () => sdkCreator(options));
-  }
 }
 
 /**
@@ -235,7 +213,10 @@
 
   @override
   int get hashCode {
-    int hashCode = options.encodeCrossContextOptions();
+    int hashCode = 0;
+    for (int value in options.encodeCrossContextOptions()) {
+      hashCode = JenkinsSmiHash.combine(hashCode, value);
+    }
     for (String path in paths) {
       hashCode = JenkinsSmiHash.combine(hashCode, path.hashCode);
     }
@@ -245,8 +226,9 @@
   @override
   bool operator ==(Object other) {
     if (other is SdkDescription) {
-      if (options.encodeCrossContextOptions() !=
-          other.options.encodeCrossContextOptions()) {
+      if (!AnalysisOptions.crossContextOptionsEqual(
+          options.encodeCrossContextOptions(),
+          other.options.encodeCrossContextOptions())) {
         return false;
       }
       int length = paths.length;
@@ -274,6 +256,7 @@
       buffer.write(optionName);
       needsSeparator = true;
     }
+
     for (String path in paths) {
       add(path);
     }
@@ -308,6 +291,11 @@
   static String _DART2JS_PATH = "dart2jsPath";
 
   /**
+   * The name of the `dart2js` platform.
+   */
+  static String _DART2JS_PLATFORM = 'DART2JS_PLATFORM';
+
+  /**
    * The name of the optional parameter used to indicate whether the library is
    * documented.
    */
@@ -320,6 +308,12 @@
   static String _CATEGORIES = "categories";
 
   /**
+   * The name of the optional parameter used to specify the patches for
+   * the library.
+   */
+  static String _PATCHES = "patches";
+
+  /**
    * The name of the optional parameter used to specify the platforms on which
    * the library can be used.
    */
@@ -397,6 +391,30 @@
             library._implementation = (expression as BooleanLiteral).value;
           } else if (name == _DOCUMENTED) {
             library.documented = (expression as BooleanLiteral).value;
+          } else if (name == _PATCHES) {
+            if (expression is MapLiteral) {
+              expression.entries.forEach((MapLiteralEntry entry) {
+                int platforms = _convertPlatforms(entry.key);
+                Expression pathsListLiteral = entry.value;
+                if (pathsListLiteral is ListLiteral) {
+                  List<String> paths = <String>[];
+                  pathsListLiteral.elements.forEach((Expression pathExpr) {
+                    if (pathExpr is SimpleStringLiteral) {
+                      String path = pathExpr.value;
+                      _validatePatchPath(path);
+                      paths.add(path);
+                    } else {
+                      throw new ArgumentError(
+                          'The "patch" argument items must be simple strings.');
+                    }
+                  });
+                  library.setPatchPaths(platforms, paths);
+                } else {
+                  throw new ArgumentError(
+                      'The "patch" argument values must be list literals.');
+                }
+              });
+            }
           } else if (name == _PLATFORMS) {
             if (expression is SimpleIdentifier) {
               String identifier = expression.name;
@@ -417,6 +435,61 @@
     }
     return null;
   }
+
+  /**
+   * Validate the given [path] to a patch file. Throw [ArgumentError] if not a
+   * valid path: is absolute, or contains `..`.
+   */
+  void _validatePatchPath(String path) {
+    if (path.contains(r'\')) {
+      throw new ArgumentError('The path to a patch file must be posix: $path');
+    }
+    if (path.contains('..')) {
+      throw new ArgumentError(
+          'The path to a patch file cannot contain "..": $path');
+    }
+    if (path.startsWith('/')) {
+      throw new ArgumentError(
+          'The path to a patch file cannot be absolute: $path');
+    }
+  }
+
+  /**
+   * Return the platform constant value for the given [expr].
+   * Throw [ArgumentError] if not a valid platform name given.
+   */
+  static int _convertPlatform(Expression expr) {
+    if (expr is SimpleIdentifier) {
+      String name = expr.name;
+      if (name == _DART2JS_PLATFORM) {
+        return SdkLibraryImpl.DART2JS_PLATFORM;
+      }
+      if (name == _VM_PLATFORM) {
+        return SdkLibraryImpl.VM_PLATFORM;
+      }
+      throw new ArgumentError('Invalid platform name: $name');
+    }
+    throw new ArgumentError('Invalid platform type: ${expr.runtimeType}');
+  }
+
+  /**
+   * Return the platforms combination value for the [expr], which should be
+   * either `name1 | name2` or `name`.  Throw [ArgumentError] if any of the
+   * names is not a valid platform name.
+   */
+  static int _convertPlatforms(Expression expr) {
+    if (expr is BinaryExpression) {
+      TokenType operator = expr.operator?.type;
+      if (operator == TokenType.BAR) {
+        return _convertPlatforms(expr.leftOperand) |
+            _convertPlatforms(expr.rightOperand);
+      } else {
+        throw new ArgumentError('Invalid platforms combination: $operator');
+      }
+    } else {
+      return _convertPlatform(expr);
+    }
+  }
 }
 
 /**
@@ -469,6 +542,12 @@
    * including `dart:`.
    */
   String get shortName;
+
+  /**
+   * Return the list of paths to the patch files that should be applied
+   * to this library for the given [platform], not `null`.
+   */
+  List<String> getPatches(int platform);
 }
 
 /**
@@ -521,6 +600,14 @@
   int _platforms = 0;
 
   /**
+   * The mapping from the platform combination to the list of paths (relative
+   * to the `sdk/lib` folder) of patches that should be applied to this library
+   * on every platform in the combination.
+   */
+  final Map<int, List<String>> _platformsToPatchPaths =
+      new HashMap<int, List<String>>();
+
+  /**
    * Initialize a newly created library to represent the library with the given
    * [name].
    */
@@ -551,6 +638,17 @@
   @override
   bool get isVmLibrary => (_platforms & VM_PLATFORM) != 0;
 
+  @override
+  List<String> getPatches(int platform) {
+    List<String> paths = <String>[];
+    _platformsToPatchPaths.forEach((int platforms, List<String> value) {
+      if ((platforms & platform) != 0) {
+        paths.addAll(value);
+      }
+    });
+    return paths;
+  }
+
   /**
    * Record that this library can be compiled to JavaScript by dart2js.
    */
@@ -559,6 +657,14 @@
   }
 
   /**
+   * Add a new patch with the given [path] that should be applied for the
+   * given [platforms].
+   */
+  void setPatchPaths(int platforms, List<String> paths) {
+    _platformsToPatchPaths[platforms] = paths;
+  }
+
+  /**
    * Record that this library can be run on the VM.
    */
   void setVmLibrary() {
diff --git a/pkg/analyzer/lib/src/generated/source.dart b/pkg/analyzer/lib/src/generated/source.dart
index 7f95c01..e4ceae7 100644
--- a/pkg/analyzer/lib/src/generated/source.dart
+++ b/pkg/analyzer/lib/src/generated/source.dart
@@ -8,17 +8,20 @@
 import "dart:math" as math;
 
 import 'package:analyzer/file_system/file_system.dart';
-import 'package:analyzer/source/package_map_resolver.dart';
 import 'package:analyzer/src/context/source.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/java_engine.dart';
 import 'package:analyzer/src/generated/java_io.dart' show JavaFile;
 import 'package:analyzer/src/generated/sdk.dart' show DartSdk;
 import 'package:analyzer/src/generated/source_io.dart' show FileBasedSource;
-import 'package:analyzer/task/model.dart';
+import 'package:front_end/src/base/source.dart';
+import 'package:front_end/src/base/uri_kind.dart';
 import 'package:package_config/packages.dart';
 import 'package:path/path.dart' as pathos;
 
+export 'package:front_end/src/base/source.dart' show Source;
+export 'package:front_end/src/base/uri_kind.dart' show UriKind;
+
 /**
  * A function that is used to visit [ContentCache] entries.
  */
@@ -411,147 +414,6 @@
 }
 
 /**
- * The interface `Source` defines the behavior of objects representing source code that can be
- * analyzed by the analysis engine.
- *
- * Implementations of this interface need to be aware of some assumptions made by the analysis
- * engine concerning sources:
- * * Sources are not required to be unique. That is, there can be multiple instances representing
- * the same source.
- * * Sources are long lived. That is, the engine is allowed to hold on to a source for an extended
- * period of time and that source must continue to report accurate and up-to-date information.
- * Because of these assumptions, most implementations will not maintain any state but will delegate
- * to an authoritative system of record in order to implement this API. For example, a source that
- * represents files on disk would typically query the file system to determine the state of the
- * file.
- *
- * If the instances that implement this API are the system of record, then they will typically be
- * unique. In that case, sources that are created that represent non-existent files must also be
- * retained so that if those files are created at a later date the long-lived sources representing
- * those files will know that they now exist.
- */
-abstract class Source implements AnalysisTarget {
-  /**
-   * An empty list of sources.
-   */
-  static const List<Source> EMPTY_LIST = const <Source>[];
-
-  /**
-   * Get the contents and timestamp of this source.
-   *
-   * Clients should consider using the method [AnalysisContext.getContents]
-   * because contexts can have local overrides of the content of a source that the source is not
-   * aware of.
-   *
-   * @return the contents and timestamp of the source
-   * @throws Exception if the contents of this source could not be accessed
-   */
-  TimestampedData<String> get contents;
-
-  /**
-   * Return an encoded representation of this source that can be used to create a source that is
-   * equal to this source.
-   *
-   * @return an encoded representation of this source
-   * See [SourceFactory.fromEncoding].
-   */
-  String get encoding;
-
-  /**
-   * Return the full (long) version of the name that can be displayed to the user to denote this
-   * source. For example, for a source representing a file this would typically be the absolute path
-   * of the file.
-   *
-   * @return a name that can be displayed to the user to denote this source
-   */
-  String get fullName;
-
-  /**
-   * Return a hash code for this source.
-   *
-   * @return a hash code for this source
-   * See [Object.hashCode].
-   */
-  @override
-  int get hashCode;
-
-  /**
-   * Return `true` if this source is in one of the system libraries.
-   *
-   * @return `true` if this is in a system library
-   */
-  bool get isInSystemLibrary;
-
-  @override
-  Source get librarySource => null;
-
-  /**
-   * Return the modification stamp for this source, or a negative value if the
-   * source does not exist. A modification stamp is a non-negative integer with
-   * the property that if the contents of the source have not been modified
-   * since the last time the modification stamp was accessed then the same value
-   * will be returned, but if the contents of the source have been modified one
-   * or more times (even if the net change is zero) the stamps will be different.
-   *
-   * Clients should consider using the method
-   * [AnalysisContext.getModificationStamp] because contexts can have local
-   * overrides of the content of a source that the source is not aware of.
-   */
-  int get modificationStamp;
-
-  /**
-   * Return a short version of the name that can be displayed to the user to denote this source. For
-   * example, for a source representing a file this would typically be the name of the file.
-   *
-   * @return a name that can be displayed to the user to denote this source
-   */
-  String get shortName;
-
-  @override
-  Source get source => this;
-
-  /**
-   * Return the URI from which this source was originally derived.
-   *
-   * @return the URI from which this source was originally derived
-   */
-  Uri get uri;
-
-  /**
-   * Return the kind of URI from which this source was originally derived. If this source was
-   * created from an absolute URI, then the returned kind will reflect the scheme of the absolute
-   * URI. If it was created from a relative URI, then the returned kind will be the same as the kind
-   * of the source against which the relative URI was resolved.
-   *
-   * @return the kind of URI from which this source was originally derived
-   */
-  UriKind get uriKind;
-
-  /**
-   * Return `true` if the given object is a source that represents the same source code as
-   * this source.
-   *
-   * @param object the object to be compared with this object
-   * @return `true` if the given object is a source that represents the same source code as
-   *         this source
-   * See [Object.==].
-   */
-  @override
-  bool operator ==(Object object);
-
-  /**
-   * Return `true` if this source exists.
-   *
-   * Clients should consider using the method [AnalysisContext.exists] because
-   * contexts can have local overrides of the content of a source that the source is not aware of
-   * and a source with local content is considered to exist even if there is no file on disk.
-   *
-   * @return `true` if this source exists
-   */
-  bool exists();
-}
-
-/**
  * The interface `ContentReceiver` defines the behavior of objects that can receive the
  * content of a source.
  */
@@ -863,90 +725,6 @@
 }
 
 /**
- * The enumeration `UriKind` defines the different kinds of URI's that are known to the
- * analysis engine. These are used to keep track of the kind of URI associated with a given source.
- */
-class UriKind implements Comparable<UriKind> {
-  /**
-   * A 'dart:' URI.
-   */
-  static const UriKind DART_URI = const UriKind('DART_URI', 0, 0x64);
-
-  /**
-   * A 'file:' URI.
-   */
-  static const UriKind FILE_URI = const UriKind('FILE_URI', 1, 0x66);
-
-  /**
-   * A 'package:' URI.
-   */
-  static const UriKind PACKAGE_URI = const UriKind('PACKAGE_URI', 2, 0x70);
-
-  static const List<UriKind> values = const [DART_URI, FILE_URI, PACKAGE_URI];
-
-  /**
-   * The name of this URI kind.
-   */
-  final String name;
-
-  /**
-   * The ordinal value of the URI kind.
-   */
-  final int ordinal;
-
-  /**
-   * The single character encoding used to identify this kind of URI.
-   */
-  final int encoding;
-
-  /**
-   * Initialize a newly created URI kind to have the given encoding.
-   */
-  const UriKind(this.name, this.ordinal, this.encoding);
-
-  @override
-  int get hashCode => ordinal;
-
-  @override
-  int compareTo(UriKind other) => ordinal - other.ordinal;
-
-  @override
-  String toString() => name;
-
-  /**
-   * Return the URI kind represented by the given [encoding], or `null` if there
-   * is no kind with the given encoding.
-   */
-  static UriKind fromEncoding(int encoding) {
-    while (true) {
-      if (encoding == 0x64) {
-        return DART_URI;
-      } else if (encoding == 0x66) {
-        return FILE_URI;
-      } else if (encoding == 0x70) {
-        return PACKAGE_URI;
-      }
-      break;
-    }
-    return null;
-  }
-
-  /**
-   * Return the URI kind corresponding to the given scheme string.
-   */
-  static UriKind fromScheme(String scheme) {
-    if (scheme == PackageMapUriResolver.PACKAGE_SCHEME) {
-      return UriKind.PACKAGE_URI;
-    } else if (scheme == DartUriResolver.DART_SCHEME) {
-      return UriKind.DART_URI;
-    } else if (scheme == ResourceUriResolver.FILE_SCHEME) {
-      return UriKind.FILE_URI;
-    }
-    return UriKind.FILE_URI;
-  }
-}
-
-/**
  * The abstract class `UriResolver` defines the behavior of objects that are used to resolve
  * URI's for a source factory. Subclasses of this class are expected to resolve a single scheme of
  * absolute URI.
diff --git a/pkg/analyzer/lib/src/generated/source_io.dart b/pkg/analyzer/lib/src/generated/source_io.dart
index 025e209..43dfb42 100644
--- a/pkg/analyzer/lib/src/generated/source_io.dart
+++ b/pkg/analyzer/lib/src/generated/source_io.dart
@@ -10,6 +10,7 @@
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/java_io.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:path/path.dart' as path;
 
 export 'package:analyzer/src/generated/source.dart';
 
@@ -508,8 +509,7 @@
    * Convert the given file path to a "file:" URI.  On Windows, this transforms
    * backslashes to forward slashes.
    */
-  String _toFileUri(String filePath) =>
-      JavaFile.pathContext.toUri(filePath).toString();
+  String _toFileUri(String filePath) => path.context.toUri(filePath).toString();
 
   /**
    * Return `true` if the given URI is a `package` URI.
diff --git a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
index 47e5599..53745d2 100644
--- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
+++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
@@ -1630,7 +1630,7 @@
     type = type.substitute2(freshTypeVars, typeVars);
 
     var function = new FunctionElementImpl("", -1);
-    function.synthetic = true;
+    function.isSynthetic = true;
     function.returnType = type.returnType;
     function.typeParameters = freshVarElements;
     function.shareParameters(type.parameters);
@@ -2002,7 +2002,7 @@
 
             // Adjust the expected parameter type to have this return type.
             var function = new FunctionElementImpl(firstParamType.name, -1)
-              ..synthetic = true
+              ..isSynthetic = true
               ..shareParameters(firstParamType.parameters)
               ..returnType = paramReturnType;
             function.type = new FunctionTypeImpl(function);
diff --git a/pkg/analyzer/lib/src/generated/testing/ast_factory.dart b/pkg/analyzer/lib/src/generated/testing/ast_factory.dart
deleted file mode 100644
index 6983cc8..0000000
--- a/pkg/analyzer/lib/src/generated/testing/ast_factory.dart
+++ /dev/null
@@ -1,1294 +0,0 @@
-// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library analyzer.src.generated.testing.ast_factory;
-
-import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/ast/token.dart';
-import 'package:analyzer/dart/element/element.dart';
-import 'package:analyzer/src/dart/ast/ast.dart';
-import 'package:analyzer/src/generated/testing/token_factory.dart';
-import 'package:analyzer/src/generated/utilities_dart.dart';
-
-/**
- * The class `AstFactory` defines utility methods that can be used to create AST nodes. The
- * nodes that are created are complete in the sense that all of the tokens that would have been
- * associated with the nodes by a parser are also created, but the token stream is not constructed.
- * None of the nodes are resolved.
- *
- * The general pattern is for the name of the factory method to be the same as the name of the class
- * of AST node being created. There are two notable exceptions. The first is for methods creating
- * nodes that are part of a cascade expression. These methods are all prefixed with 'cascaded'. The
- * second is places where a shorter name seemed unambiguous and easier to read, such as using
- * 'identifier' rather than 'prefixedIdentifier', or 'integer' rather than 'integerLiteral'.
- */
-class AstFactory {
-  static AdjacentStrings adjacentStrings(List<StringLiteral> strings) =>
-      new AdjacentStrings(strings);
-
-  static Annotation annotation(Identifier name) => new Annotation(
-      TokenFactory.tokenFromType(TokenType.AT), name, null, null, null);
-
-  static Annotation annotation2(Identifier name,
-          SimpleIdentifier constructorName, ArgumentList arguments) =>
-      new Annotation(
-          TokenFactory.tokenFromType(TokenType.AT),
-          name,
-          constructorName == null
-              ? null
-              : TokenFactory.tokenFromType(TokenType.PERIOD),
-          constructorName,
-          arguments);
-
-  static ArgumentList argumentList([List<Expression> arguments]) =>
-      new ArgumentList(TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
-          arguments, TokenFactory.tokenFromType(TokenType.CLOSE_PAREN));
-
-  static AsExpression asExpression(Expression expression, TypeName type) =>
-      new AsExpression(
-          expression, TokenFactory.tokenFromKeyword(Keyword.AS), type);
-
-  static AssertStatement assertStatement(Expression condition,
-          [Expression message]) =>
-      new AssertStatement(
-          TokenFactory.tokenFromKeyword(Keyword.ASSERT),
-          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
-          condition,
-          message == null ? null : TokenFactory.tokenFromType(TokenType.COMMA),
-          message,
-          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
-          TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static AssignmentExpression assignmentExpression(Expression leftHandSide,
-          TokenType operator, Expression rightHandSide) =>
-      new AssignmentExpression(
-          leftHandSide, TokenFactory.tokenFromType(operator), rightHandSide);
-
-  static BlockFunctionBody asyncBlockFunctionBody(
-          [List<Statement> statements]) =>
-      new BlockFunctionBody(
-          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "async"),
-          null,
-          block(statements));
-
-  static ExpressionFunctionBody asyncExpressionFunctionBody(
-          Expression expression) =>
-      new ExpressionFunctionBody(
-          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "async"),
-          TokenFactory.tokenFromType(TokenType.FUNCTION),
-          expression,
-          TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static BlockFunctionBody asyncGeneratorBlockFunctionBody(
-          [List<Statement> statements]) =>
-      new BlockFunctionBody(
-          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "async"),
-          TokenFactory.tokenFromType(TokenType.STAR),
-          block(statements));
-
-  static AwaitExpression awaitExpression(Expression expression) =>
-      new AwaitExpression(
-          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "await"),
-          expression);
-
-  static BinaryExpression binaryExpression(Expression leftOperand,
-          TokenType operator, Expression rightOperand) =>
-      new BinaryExpression(
-          leftOperand, TokenFactory.tokenFromType(operator), rightOperand);
-
-  static Block block([List<Statement> statements]) => new Block(
-      TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET),
-      statements,
-      TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
-
-  static BlockFunctionBody blockFunctionBody(Block block) =>
-      new BlockFunctionBody(null, null, block);
-
-  static BlockFunctionBody blockFunctionBody2([List<Statement> statements]) =>
-      new BlockFunctionBody(null, null, block(statements));
-
-  static BooleanLiteral booleanLiteral(bool value) => new BooleanLiteral(
-      value
-          ? TokenFactory.tokenFromKeyword(Keyword.TRUE)
-          : TokenFactory.tokenFromKeyword(Keyword.FALSE),
-      value);
-
-  static BreakStatement breakStatement() => new BreakStatement(
-      TokenFactory.tokenFromKeyword(Keyword.BREAK),
-      null,
-      TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static BreakStatement breakStatement2(String label) => new BreakStatement(
-      TokenFactory.tokenFromKeyword(Keyword.BREAK),
-      identifier3(label),
-      TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static IndexExpression cascadedIndexExpression(Expression index) =>
-      new IndexExpression.forCascade(
-          TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD),
-          TokenFactory.tokenFromType(TokenType.OPEN_SQUARE_BRACKET),
-          index,
-          TokenFactory.tokenFromType(TokenType.CLOSE_SQUARE_BRACKET));
-
-  static MethodInvocation cascadedMethodInvocation(String methodName,
-          [List<Expression> arguments]) =>
-      new MethodInvocation(
-          null,
-          TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD),
-          identifier3(methodName),
-          null,
-          argumentList(arguments));
-
-  static PropertyAccess cascadedPropertyAccess(String propertyName) =>
-      new PropertyAccess(
-          null,
-          TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD),
-          identifier3(propertyName));
-
-  static CascadeExpression cascadeExpression(Expression target,
-          [List<Expression> cascadeSections]) =>
-      new CascadeExpression(target, cascadeSections);
-
-  static CatchClause catchClause(String exceptionParameter,
-          [List<Statement> statements]) =>
-      catchClause5(null, exceptionParameter, null, statements);
-
-  static CatchClause catchClause2(
-          String exceptionParameter, String stackTraceParameter,
-          [List<Statement> statements]) =>
-      catchClause5(null, exceptionParameter, stackTraceParameter, statements);
-
-  static CatchClause catchClause3(TypeName exceptionType,
-          [List<Statement> statements]) =>
-      catchClause5(exceptionType, null, null, statements);
-
-  static CatchClause catchClause4(
-          TypeName exceptionType, String exceptionParameter,
-          [List<Statement> statements]) =>
-      catchClause5(exceptionType, exceptionParameter, null, statements);
-
-  static CatchClause catchClause5(TypeName exceptionType,
-          String exceptionParameter, String stackTraceParameter,
-          [List<Statement> statements]) =>
-      new CatchClause(
-          exceptionType == null
-              ? null
-              : TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "on"),
-          exceptionType,
-          exceptionParameter == null
-              ? null
-              : TokenFactory.tokenFromKeyword(Keyword.CATCH),
-          exceptionParameter == null
-              ? null
-              : TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
-          exceptionParameter == null ? null : identifier3(exceptionParameter),
-          stackTraceParameter == null
-              ? null
-              : TokenFactory.tokenFromType(TokenType.COMMA),
-          stackTraceParameter == null ? null : identifier3(stackTraceParameter),
-          exceptionParameter == null
-              ? null
-              : TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
-          block(statements));
-
-  static ClassDeclaration classDeclaration(
-          Keyword abstractKeyword,
-          String name,
-          TypeParameterList typeParameters,
-          ExtendsClause extendsClause,
-          WithClause withClause,
-          ImplementsClause implementsClause,
-          [List<ClassMember> members]) =>
-      new ClassDeclaration(
-          null,
-          null,
-          abstractKeyword == null
-              ? null
-              : TokenFactory.tokenFromKeyword(abstractKeyword),
-          TokenFactory.tokenFromKeyword(Keyword.CLASS),
-          identifier3(name),
-          typeParameters,
-          extendsClause,
-          withClause,
-          implementsClause,
-          TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET),
-          members,
-          TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
-
-  static ClassTypeAlias classTypeAlias(
-          String name,
-          TypeParameterList typeParameters,
-          Keyword abstractKeyword,
-          TypeName superclass,
-          WithClause withClause,
-          ImplementsClause implementsClause) =>
-      new ClassTypeAlias(
-          null,
-          null,
-          TokenFactory.tokenFromKeyword(Keyword.CLASS),
-          identifier3(name),
-          typeParameters,
-          TokenFactory.tokenFromType(TokenType.EQ),
-          abstractKeyword == null
-              ? null
-              : TokenFactory.tokenFromKeyword(abstractKeyword),
-          superclass,
-          withClause,
-          implementsClause,
-          TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static CompilationUnit compilationUnit() =>
-      compilationUnit8(null, null, null);
-
-  static CompilationUnit compilationUnit2(
-          List<CompilationUnitMember> declarations) =>
-      compilationUnit8(null, null, declarations);
-
-  static CompilationUnit compilationUnit3(List<Directive> directives) =>
-      compilationUnit8(null, directives, null);
-
-  static CompilationUnit compilationUnit4(List<Directive> directives,
-          List<CompilationUnitMember> declarations) =>
-      compilationUnit8(null, directives, declarations);
-
-  static CompilationUnit compilationUnit5(String scriptTag) =>
-      compilationUnit8(scriptTag, null, null);
-
-  static CompilationUnit compilationUnit6(
-          String scriptTag, List<CompilationUnitMember> declarations) =>
-      compilationUnit8(scriptTag, null, declarations);
-
-  static CompilationUnit compilationUnit7(
-          String scriptTag, List<Directive> directives) =>
-      compilationUnit8(scriptTag, directives, null);
-
-  static CompilationUnit compilationUnit8(
-          String scriptTag,
-          List<Directive> directives,
-          List<CompilationUnitMember> declarations) =>
-      new CompilationUnit(
-          TokenFactory.tokenFromType(TokenType.EOF),
-          scriptTag == null ? null : AstFactory.scriptTag(scriptTag),
-          directives == null ? new List<Directive>() : directives,
-          declarations == null
-              ? new List<CompilationUnitMember>()
-              : declarations,
-          TokenFactory.tokenFromType(TokenType.EOF));
-
-  static ConditionalExpression conditionalExpression(Expression condition,
-          Expression thenExpression, Expression elseExpression) =>
-      new ConditionalExpression(
-          condition,
-          TokenFactory.tokenFromType(TokenType.QUESTION),
-          thenExpression,
-          TokenFactory.tokenFromType(TokenType.COLON),
-          elseExpression);
-
-  static ConstructorDeclaration constructorDeclaration(
-          Identifier returnType,
-          String name,
-          FormalParameterList parameters,
-          List<ConstructorInitializer> initializers) =>
-      new ConstructorDeclaration(
-          null,
-          null,
-          TokenFactory.tokenFromKeyword(Keyword.EXTERNAL),
-          null,
-          null,
-          returnType,
-          name == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD),
-          name == null ? null : identifier3(name),
-          parameters,
-          initializers == null || initializers.isEmpty
-              ? null
-              : TokenFactory.tokenFromType(TokenType.PERIOD),
-          initializers == null
-              ? new List<ConstructorInitializer>()
-              : initializers,
-          null,
-          emptyFunctionBody());
-
-  static ConstructorDeclaration constructorDeclaration2(
-          Keyword constKeyword,
-          Keyword factoryKeyword,
-          Identifier returnType,
-          String name,
-          FormalParameterList parameters,
-          List<ConstructorInitializer> initializers,
-          FunctionBody body) =>
-      new ConstructorDeclaration(
-          null,
-          null,
-          null,
-          constKeyword == null
-              ? null
-              : TokenFactory.tokenFromKeyword(constKeyword),
-          factoryKeyword == null
-              ? null
-              : TokenFactory.tokenFromKeyword(factoryKeyword),
-          returnType,
-          name == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD),
-          name == null ? null : identifier3(name),
-          parameters,
-          initializers == null || initializers.isEmpty
-              ? null
-              : TokenFactory.tokenFromType(TokenType.PERIOD),
-          initializers == null
-              ? new List<ConstructorInitializer>()
-              : initializers,
-          null,
-          body);
-
-  static ConstructorFieldInitializer constructorFieldInitializer(
-          bool prefixedWithThis, String fieldName, Expression expression) =>
-      new ConstructorFieldInitializer(
-          prefixedWithThis ? TokenFactory.tokenFromKeyword(Keyword.THIS) : null,
-          prefixedWithThis
-              ? TokenFactory.tokenFromType(TokenType.PERIOD)
-              : null,
-          identifier3(fieldName),
-          TokenFactory.tokenFromType(TokenType.EQ),
-          expression);
-
-  static ConstructorName constructorName(TypeName type, String name) =>
-      new ConstructorName(
-          type,
-          name == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD),
-          name == null ? null : identifier3(name));
-
-  static ContinueStatement continueStatement([String label]) =>
-      new ContinueStatement(
-          TokenFactory.tokenFromKeyword(Keyword.CONTINUE),
-          label == null ? null : identifier3(label),
-          TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static DeclaredIdentifier declaredIdentifier(
-          Keyword keyword, String identifier) =>
-      declaredIdentifier2(keyword, null, identifier);
-
-  static DeclaredIdentifier declaredIdentifier2(
-          Keyword keyword, TypeName type, String identifier) =>
-      new DeclaredIdentifier(
-          null,
-          null,
-          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
-          type,
-          identifier3(identifier));
-
-  static DeclaredIdentifier declaredIdentifier3(String identifier) =>
-      declaredIdentifier2(Keyword.VAR, null, identifier);
-
-  static DeclaredIdentifier declaredIdentifier4(
-          TypeName type, String identifier) =>
-      declaredIdentifier2(null, type, identifier);
-
-  static Comment documentationComment(
-      List<Token> tokens, List<CommentReference> references) {
-    return new Comment(tokens, CommentType.DOCUMENTATION, references);
-  }
-
-  static DoStatement doStatement(Statement body, Expression condition) =>
-      new DoStatement(
-          TokenFactory.tokenFromKeyword(Keyword.DO),
-          body,
-          TokenFactory.tokenFromKeyword(Keyword.WHILE),
-          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
-          condition,
-          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
-          TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static DoubleLiteral doubleLiteral(double value) =>
-      new DoubleLiteral(TokenFactory.tokenFromString(value.toString()), value);
-
-  static EmptyFunctionBody emptyFunctionBody() =>
-      new EmptyFunctionBody(TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static EmptyStatement emptyStatement() =>
-      new EmptyStatement(TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static EnumDeclaration enumDeclaration(
-          SimpleIdentifier name, List<EnumConstantDeclaration> constants) =>
-      new EnumDeclaration(
-          null,
-          null,
-          TokenFactory.tokenFromKeyword(Keyword.ENUM),
-          name,
-          TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET),
-          constants,
-          TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
-
-  static EnumDeclaration enumDeclaration2(
-      String name, List<String> constantNames) {
-    int count = constantNames.length;
-    List<EnumConstantDeclaration> constants =
-        new List<EnumConstantDeclaration>(count);
-    for (int i = 0; i < count; i++) {
-      constants[i] = new EnumConstantDeclaration(
-          null, null, identifier3(constantNames[i]));
-    }
-    return enumDeclaration(identifier3(name), constants);
-  }
-
-  static ExportDirective exportDirective(List<Annotation> metadata, String uri,
-          [List<Combinator> combinators]) =>
-      new ExportDirective(
-          null,
-          metadata,
-          TokenFactory.tokenFromKeyword(Keyword.EXPORT),
-          string2(uri),
-          null,
-          combinators,
-          TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static ExportDirective exportDirective2(String uri,
-          [List<Combinator> combinators]) =>
-      exportDirective(null, uri, combinators);
-
-  static ExpressionFunctionBody expressionFunctionBody(Expression expression) =>
-      new ExpressionFunctionBody(
-          null,
-          TokenFactory.tokenFromType(TokenType.FUNCTION),
-          expression,
-          TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static ExpressionStatement expressionStatement(Expression expression) =>
-      new ExpressionStatement(
-          expression, TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static ExtendsClause extendsClause(TypeName type) =>
-      new ExtendsClause(TokenFactory.tokenFromKeyword(Keyword.EXTENDS), type);
-
-  static FieldDeclaration fieldDeclaration(bool isStatic, Keyword keyword,
-          TypeName type, List<VariableDeclaration> variables) =>
-      new FieldDeclaration(
-          null,
-          null,
-          isStatic ? TokenFactory.tokenFromKeyword(Keyword.STATIC) : null,
-          variableDeclarationList(keyword, type, variables),
-          TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static FieldDeclaration fieldDeclaration2(bool isStatic, Keyword keyword,
-          List<VariableDeclaration> variables) =>
-      fieldDeclaration(isStatic, keyword, null, variables);
-
-  static FieldFormalParameter fieldFormalParameter(
-          Keyword keyword, TypeName type, String identifier,
-          [FormalParameterList parameterList]) =>
-      new FieldFormalParameter(
-          null,
-          null,
-          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
-          type,
-          TokenFactory.tokenFromKeyword(Keyword.THIS),
-          TokenFactory.tokenFromType(TokenType.PERIOD),
-          identifier3(identifier),
-          null,
-          parameterList);
-
-  static FieldFormalParameter fieldFormalParameter2(String identifier) =>
-      fieldFormalParameter(null, null, identifier);
-
-  static ForEachStatement forEachStatement(DeclaredIdentifier loopVariable,
-          Expression iterator, Statement body) =>
-      new ForEachStatement.withDeclaration(
-          null,
-          TokenFactory.tokenFromKeyword(Keyword.FOR),
-          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
-          loopVariable,
-          TokenFactory.tokenFromKeyword(Keyword.IN),
-          iterator,
-          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
-          body);
-
-  static ForEachStatement forEachStatement2(
-          SimpleIdentifier identifier, Expression iterator, Statement body) =>
-      new ForEachStatement.withReference(
-          null,
-          TokenFactory.tokenFromKeyword(Keyword.FOR),
-          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
-          identifier,
-          TokenFactory.tokenFromKeyword(Keyword.IN),
-          iterator,
-          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
-          body);
-
-  static FormalParameterList formalParameterList(
-          [List<FormalParameter> parameters]) =>
-      new FormalParameterList(
-          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
-          parameters,
-          null,
-          null,
-          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN));
-
-  static ForStatement forStatement(Expression initialization,
-          Expression condition, List<Expression> updaters, Statement body) =>
-      new ForStatement(
-          TokenFactory.tokenFromKeyword(Keyword.FOR),
-          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
-          null,
-          initialization,
-          TokenFactory.tokenFromType(TokenType.SEMICOLON),
-          condition,
-          TokenFactory.tokenFromType(TokenType.SEMICOLON),
-          updaters,
-          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
-          body);
-
-  static ForStatement forStatement2(VariableDeclarationList variableList,
-          Expression condition, List<Expression> updaters, Statement body) =>
-      new ForStatement(
-          TokenFactory.tokenFromKeyword(Keyword.FOR),
-          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
-          variableList,
-          null,
-          TokenFactory.tokenFromType(TokenType.SEMICOLON),
-          condition,
-          TokenFactory.tokenFromType(TokenType.SEMICOLON),
-          updaters,
-          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
-          body);
-
-  static FunctionDeclaration functionDeclaration(TypeName type, Keyword keyword,
-          String name, FunctionExpression functionExpression) =>
-      new FunctionDeclaration(
-          null,
-          null,
-          null,
-          type,
-          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
-          identifier3(name),
-          functionExpression);
-
-  static FunctionDeclarationStatement functionDeclarationStatement(
-          TypeName type,
-          Keyword keyword,
-          String name,
-          FunctionExpression functionExpression) =>
-      new FunctionDeclarationStatement(
-          functionDeclaration(type, keyword, name, functionExpression));
-
-  static FunctionExpression functionExpression() =>
-      new FunctionExpression(null, formalParameterList(), blockFunctionBody2());
-
-  static FunctionExpression functionExpression2(
-          FormalParameterList parameters, FunctionBody body) =>
-      new FunctionExpression(null, parameters, body);
-
-  static FunctionExpression functionExpression3(
-          TypeParameterList typeParameters,
-          FormalParameterList parameters,
-          FunctionBody body) =>
-      new FunctionExpression(typeParameters, parameters, body);
-
-  static FunctionExpressionInvocation functionExpressionInvocation(
-          Expression function,
-          [List<Expression> arguments]) =>
-      functionExpressionInvocation2(function, null, arguments);
-
-  static FunctionExpressionInvocation functionExpressionInvocation2(
-          Expression function,
-          [TypeArgumentList typeArguments,
-          List<Expression> arguments]) =>
-      new FunctionExpressionInvocation(
-          function, typeArguments, argumentList(arguments));
-
-  static FunctionTypedFormalParameter functionTypedFormalParameter(
-          TypeName returnType, String identifier,
-          [List<FormalParameter> parameters]) =>
-      new FunctionTypedFormalParameter(null, null, returnType,
-          identifier3(identifier), null, formalParameterList(parameters));
-
-  static HideCombinator hideCombinator(List<SimpleIdentifier> identifiers) =>
-      new HideCombinator(TokenFactory.tokenFromString("hide"), identifiers);
-
-  static HideCombinator hideCombinator2(List<String> identifiers) =>
-      new HideCombinator(
-          TokenFactory.tokenFromString("hide"), identifierList(identifiers));
-
-  static PrefixedIdentifier identifier(
-          SimpleIdentifier prefix, SimpleIdentifier identifier) =>
-      new PrefixedIdentifier(
-          prefix, TokenFactory.tokenFromType(TokenType.PERIOD), identifier);
-
-  static SimpleIdentifier identifier3(String lexeme) => new SimpleIdentifier(
-      TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, lexeme));
-
-  static PrefixedIdentifier identifier4(
-          String prefix, SimpleIdentifier identifier) =>
-      new PrefixedIdentifier(identifier3(prefix),
-          TokenFactory.tokenFromType(TokenType.PERIOD), identifier);
-
-  static PrefixedIdentifier identifier5(String prefix, String identifier) =>
-      new PrefixedIdentifier(
-          identifier3(prefix),
-          TokenFactory.tokenFromType(TokenType.PERIOD),
-          identifier3(identifier));
-
-  static List<SimpleIdentifier> identifierList(List<String> identifiers) {
-    if (identifiers == null) {
-      return null;
-    }
-    return identifiers
-        .map((String identifier) => identifier3(identifier))
-        .toList();
-  }
-
-  static IfStatement ifStatement(
-          Expression condition, Statement thenStatement) =>
-      ifStatement2(condition, thenStatement, null);
-
-  static IfStatement ifStatement2(Expression condition, Statement thenStatement,
-          Statement elseStatement) =>
-      new IfStatement(
-          TokenFactory.tokenFromKeyword(Keyword.IF),
-          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
-          condition,
-          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
-          thenStatement,
-          elseStatement == null
-              ? null
-              : TokenFactory.tokenFromKeyword(Keyword.ELSE),
-          elseStatement);
-
-  static ImplementsClause implementsClause(List<TypeName> types) =>
-      new ImplementsClause(
-          TokenFactory.tokenFromKeyword(Keyword.IMPLEMENTS), types);
-
-  static ImportDirective importDirective(
-          List<Annotation> metadata, String uri, bool isDeferred, String prefix,
-          [List<Combinator> combinators]) =>
-      new ImportDirective(
-          null,
-          metadata,
-          TokenFactory.tokenFromKeyword(Keyword.IMPORT),
-          string2(uri),
-          null,
-          !isDeferred ? null : TokenFactory.tokenFromKeyword(Keyword.DEFERRED),
-          prefix == null ? null : TokenFactory.tokenFromKeyword(Keyword.AS),
-          prefix == null ? null : identifier3(prefix),
-          combinators,
-          TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static ImportDirective importDirective2(
-          String uri, bool isDeferred, String prefix,
-          [List<Combinator> combinators]) =>
-      importDirective(null, uri, isDeferred, prefix, combinators);
-
-  static ImportDirective importDirective3(String uri, String prefix,
-          [List<Combinator> combinators]) =>
-      importDirective(null, uri, false, prefix, combinators);
-
-  static IndexExpression indexExpression(Expression array, Expression index) =>
-      new IndexExpression.forTarget(
-          array,
-          TokenFactory.tokenFromType(TokenType.OPEN_SQUARE_BRACKET),
-          index,
-          TokenFactory.tokenFromType(TokenType.CLOSE_SQUARE_BRACKET));
-
-  static InstanceCreationExpression instanceCreationExpression(
-          Keyword keyword, ConstructorName name,
-          [List<Expression> arguments]) =>
-      new InstanceCreationExpression(
-          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
-          name,
-          argumentList(arguments));
-
-  static InstanceCreationExpression instanceCreationExpression2(
-          Keyword keyword, TypeName type,
-          [List<Expression> arguments]) =>
-      instanceCreationExpression3(keyword, type, null, arguments);
-
-  static InstanceCreationExpression instanceCreationExpression3(
-          Keyword keyword, TypeName type, String identifier,
-          [List<Expression> arguments]) =>
-      instanceCreationExpression(
-          keyword,
-          new ConstructorName(
-              type,
-              identifier == null
-                  ? null
-                  : TokenFactory.tokenFromType(TokenType.PERIOD),
-              identifier == null ? null : identifier3(identifier)),
-          arguments);
-
-  static IntegerLiteral integer(int value) => new IntegerLiteral(
-      TokenFactory.tokenFromTypeAndString(TokenType.INT, value.toString()),
-      value);
-
-  static InterpolationExpression interpolationExpression(
-          Expression expression) =>
-      new InterpolationExpression(
-          TokenFactory.tokenFromType(TokenType.STRING_INTERPOLATION_EXPRESSION),
-          expression,
-          TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
-
-  static InterpolationExpression interpolationExpression2(String identifier) =>
-      new InterpolationExpression(
-          TokenFactory.tokenFromType(TokenType.STRING_INTERPOLATION_IDENTIFIER),
-          identifier3(identifier),
-          null);
-
-  static InterpolationString interpolationString(
-          String contents, String value) =>
-      new InterpolationString(TokenFactory.tokenFromString(contents), value);
-
-  static IsExpression isExpression(
-          Expression expression, bool negated, TypeName type) =>
-      new IsExpression(expression, TokenFactory.tokenFromKeyword(Keyword.IS),
-          negated ? TokenFactory.tokenFromType(TokenType.BANG) : null, type);
-
-  static Label label(SimpleIdentifier label) =>
-      new Label(label, TokenFactory.tokenFromType(TokenType.COLON));
-
-  static Label label2(String label) => AstFactory.label(identifier3(label));
-
-  static LabeledStatement labeledStatement(
-          List<Label> labels, Statement statement) =>
-      new LabeledStatement(labels, statement);
-
-  static LibraryDirective libraryDirective(
-          List<Annotation> metadata, LibraryIdentifier libraryName) =>
-      new LibraryDirective(
-          null,
-          metadata,
-          TokenFactory.tokenFromKeyword(Keyword.LIBRARY),
-          libraryName,
-          TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static LibraryDirective libraryDirective2(String libraryName) =>
-      libraryDirective(
-          new List<Annotation>(), libraryIdentifier2([libraryName]));
-
-  static LibraryIdentifier libraryIdentifier(
-          List<SimpleIdentifier> components) =>
-      new LibraryIdentifier(components);
-
-  static LibraryIdentifier libraryIdentifier2(List<String> components) {
-    return new LibraryIdentifier(identifierList(components));
-  }
-
-  static List list(List<Object> elements) {
-    return elements;
-  }
-
-  static ListLiteral listLiteral([List<Expression> elements]) =>
-      listLiteral2(null, null, elements);
-
-  static ListLiteral listLiteral2(
-          Keyword keyword, TypeArgumentList typeArguments,
-          [List<Expression> elements]) =>
-      new ListLiteral(
-          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
-          typeArguments,
-          TokenFactory.tokenFromType(TokenType.OPEN_SQUARE_BRACKET),
-          elements,
-          TokenFactory.tokenFromType(TokenType.CLOSE_SQUARE_BRACKET));
-
-  static MapLiteral mapLiteral(Keyword keyword, TypeArgumentList typeArguments,
-          [List<MapLiteralEntry> entries]) =>
-      new MapLiteral(
-          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
-          typeArguments,
-          TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET),
-          entries,
-          TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
-
-  static MapLiteral mapLiteral2([List<MapLiteralEntry> entries]) =>
-      mapLiteral(null, null, entries);
-
-  static MapLiteralEntry mapLiteralEntry(String key, Expression value) =>
-      new MapLiteralEntry(
-          string2(key), TokenFactory.tokenFromType(TokenType.COLON), value);
-
-  static MapLiteralEntry mapLiteralEntry2(Expression key, Expression value) =>
-      new MapLiteralEntry(
-          key, TokenFactory.tokenFromType(TokenType.COLON), value);
-
-  static MethodDeclaration methodDeclaration(
-          Keyword modifier,
-          TypeName returnType,
-          Keyword property,
-          Keyword operator,
-          SimpleIdentifier name,
-          FormalParameterList parameters) =>
-      new MethodDeclaration(
-          null,
-          null,
-          TokenFactory.tokenFromKeyword(Keyword.EXTERNAL),
-          modifier == null ? null : TokenFactory.tokenFromKeyword(modifier),
-          returnType,
-          property == null ? null : TokenFactory.tokenFromKeyword(property),
-          operator == null ? null : TokenFactory.tokenFromKeyword(operator),
-          name,
-          null,
-          parameters,
-          emptyFunctionBody());
-
-  static MethodDeclaration methodDeclaration2(
-          Keyword modifier,
-          TypeName returnType,
-          Keyword property,
-          Keyword operator,
-          SimpleIdentifier name,
-          FormalParameterList parameters,
-          FunctionBody body) =>
-      new MethodDeclaration(
-          null,
-          null,
-          null,
-          modifier == null ? null : TokenFactory.tokenFromKeyword(modifier),
-          returnType,
-          property == null ? null : TokenFactory.tokenFromKeyword(property),
-          operator == null ? null : TokenFactory.tokenFromKeyword(operator),
-          name,
-          null,
-          parameters,
-          body);
-
-  static MethodDeclaration methodDeclaration3(
-          Keyword modifier,
-          TypeName returnType,
-          Keyword property,
-          Keyword operator,
-          SimpleIdentifier name,
-          TypeParameterList typeParameters,
-          FormalParameterList parameters,
-          FunctionBody body) =>
-      new MethodDeclaration(
-          null,
-          null,
-          null,
-          modifier == null ? null : TokenFactory.tokenFromKeyword(modifier),
-          returnType,
-          property == null ? null : TokenFactory.tokenFromKeyword(property),
-          operator == null ? null : TokenFactory.tokenFromKeyword(operator),
-          name,
-          typeParameters,
-          parameters,
-          body);
-
-  static MethodDeclaration methodDeclaration4(
-          {bool external: false,
-          Keyword modifier,
-          TypeName returnType,
-          Keyword property,
-          bool operator: false,
-          String name,
-          FormalParameterList parameters,
-          FunctionBody body}) =>
-      new MethodDeclaration(
-          null,
-          null,
-          external ? TokenFactory.tokenFromKeyword(Keyword.EXTERNAL) : null,
-          modifier == null ? null : TokenFactory.tokenFromKeyword(modifier),
-          returnType,
-          property == null ? null : TokenFactory.tokenFromKeyword(property),
-          operator ? TokenFactory.tokenFromKeyword(Keyword.OPERATOR) : null,
-          identifier3(name),
-          null,
-          parameters,
-          body);
-
-  static MethodInvocation methodInvocation(Expression target, String methodName,
-          [List<Expression> arguments,
-          TokenType operator = TokenType.PERIOD]) =>
-      new MethodInvocation(
-          target,
-          target == null ? null : TokenFactory.tokenFromType(operator),
-          identifier3(methodName),
-          null,
-          argumentList(arguments));
-
-  static MethodInvocation methodInvocation2(String methodName,
-          [List<Expression> arguments]) =>
-      methodInvocation(null, methodName, arguments);
-
-  static MethodInvocation methodInvocation3(
-          Expression target, String methodName, TypeArgumentList typeArguments,
-          [List<Expression> arguments,
-          TokenType operator = TokenType.PERIOD]) =>
-      new MethodInvocation(
-          target,
-          target == null ? null : TokenFactory.tokenFromType(operator),
-          identifier3(methodName),
-          typeArguments,
-          argumentList(arguments));
-
-  static NamedExpression namedExpression(Label label, Expression expression) =>
-      new NamedExpression(label, expression);
-
-  static NamedExpression namedExpression2(
-          String label, Expression expression) =>
-      namedExpression(label2(label), expression);
-
-  static DefaultFormalParameter namedFormalParameter(
-          NormalFormalParameter parameter, Expression expression) =>
-      new DefaultFormalParameter(
-          parameter,
-          ParameterKind.NAMED,
-          expression == null
-              ? null
-              : TokenFactory.tokenFromType(TokenType.COLON),
-          expression);
-
-  static NativeClause nativeClause(String nativeCode) => new NativeClause(
-      TokenFactory.tokenFromString("native"), string2(nativeCode));
-
-  static NativeFunctionBody nativeFunctionBody(String nativeMethodName) =>
-      new NativeFunctionBody(
-          TokenFactory.tokenFromString("native"),
-          string2(nativeMethodName),
-          TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static NullLiteral nullLiteral() =>
-      new NullLiteral(TokenFactory.tokenFromKeyword(Keyword.NULL));
-
-  static ParenthesizedExpression parenthesizedExpression(
-          Expression expression) =>
-      new ParenthesizedExpression(
-          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
-          expression,
-          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN));
-
-  static PartDirective partDirective(List<Annotation> metadata, String url) =>
-      new PartDirective(
-          null,
-          metadata,
-          TokenFactory.tokenFromKeyword(Keyword.PART),
-          string2(url),
-          TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static PartDirective partDirective2(String url) =>
-      partDirective(new List<Annotation>(), url);
-
-  static PartOfDirective partOfDirective(LibraryIdentifier libraryName) =>
-      partOfDirective2(new List<Annotation>(), libraryName);
-
-  static PartOfDirective partOfDirective2(
-          List<Annotation> metadata, LibraryIdentifier libraryName) =>
-      new PartOfDirective(
-          null,
-          metadata,
-          TokenFactory.tokenFromKeyword(Keyword.PART),
-          TokenFactory.tokenFromString("of"),
-          libraryName,
-          TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static DefaultFormalParameter positionalFormalParameter(
-          NormalFormalParameter parameter, Expression expression) =>
-      new DefaultFormalParameter(
-          parameter,
-          ParameterKind.POSITIONAL,
-          expression == null ? null : TokenFactory.tokenFromType(TokenType.EQ),
-          expression);
-
-  static PostfixExpression postfixExpression(
-          Expression expression, TokenType operator) =>
-      new PostfixExpression(expression, TokenFactory.tokenFromType(operator));
-
-  static PrefixExpression prefixExpression(
-          TokenType operator, Expression expression) =>
-      new PrefixExpression(TokenFactory.tokenFromType(operator), expression);
-
-  static PropertyAccess propertyAccess(
-          Expression target, SimpleIdentifier propertyName) =>
-      new PropertyAccess(
-          target, TokenFactory.tokenFromType(TokenType.PERIOD), propertyName);
-
-  static PropertyAccess propertyAccess2(Expression target, String propertyName,
-          [TokenType operator = TokenType.PERIOD]) =>
-      new PropertyAccess(target, TokenFactory.tokenFromType(operator),
-          identifier3(propertyName));
-
-  static RedirectingConstructorInvocation redirectingConstructorInvocation(
-          [List<Expression> arguments]) =>
-      redirectingConstructorInvocation2(null, arguments);
-
-  static RedirectingConstructorInvocation redirectingConstructorInvocation2(
-          String constructorName,
-          [List<Expression> arguments]) =>
-      new RedirectingConstructorInvocation(
-          TokenFactory.tokenFromKeyword(Keyword.THIS),
-          constructorName == null
-              ? null
-              : TokenFactory.tokenFromType(TokenType.PERIOD),
-          constructorName == null ? null : identifier3(constructorName),
-          argumentList(arguments));
-
-  static RethrowExpression rethrowExpression() =>
-      new RethrowExpression(TokenFactory.tokenFromKeyword(Keyword.RETHROW));
-
-  static ReturnStatement returnStatement() => returnStatement2(null);
-
-  static ReturnStatement returnStatement2(Expression expression) =>
-      new ReturnStatement(TokenFactory.tokenFromKeyword(Keyword.RETURN),
-          expression, TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static ScriptTag scriptTag(String scriptTag) =>
-      new ScriptTag(TokenFactory.tokenFromString(scriptTag));
-
-  static ShowCombinator showCombinator(List<SimpleIdentifier> identifiers) =>
-      new ShowCombinator(TokenFactory.tokenFromString("show"), identifiers);
-
-  static ShowCombinator showCombinator2(List<String> identifiers) =>
-      new ShowCombinator(
-          TokenFactory.tokenFromString("show"), identifierList(identifiers));
-
-  static SimpleFormalParameter simpleFormalParameter(
-          Keyword keyword, String parameterName) =>
-      simpleFormalParameter2(keyword, null, parameterName);
-
-  static SimpleFormalParameter simpleFormalParameter2(
-          Keyword keyword, TypeName type, String parameterName) =>
-      new SimpleFormalParameter(
-          null,
-          null,
-          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
-          type,
-          identifier3(parameterName));
-
-  static SimpleFormalParameter simpleFormalParameter3(String parameterName) =>
-      simpleFormalParameter2(null, null, parameterName);
-
-  static SimpleFormalParameter simpleFormalParameter4(
-          TypeName type, String parameterName) =>
-      simpleFormalParameter2(null, type, parameterName);
-
-  static StringInterpolation string([List<InterpolationElement> elements]) =>
-      new StringInterpolation(elements);
-
-  static SimpleStringLiteral string2(String content) => new SimpleStringLiteral(
-      TokenFactory.tokenFromString("'$content'"), content);
-
-  static SuperConstructorInvocation superConstructorInvocation(
-          [List<Expression> arguments]) =>
-      superConstructorInvocation2(null, arguments);
-
-  static SuperConstructorInvocation superConstructorInvocation2(String name,
-          [List<Expression> arguments]) =>
-      new SuperConstructorInvocation(
-          TokenFactory.tokenFromKeyword(Keyword.SUPER),
-          name == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD),
-          name == null ? null : identifier3(name),
-          argumentList(arguments));
-
-  static SuperExpression superExpression() =>
-      new SuperExpression(TokenFactory.tokenFromKeyword(Keyword.SUPER));
-
-  static SwitchCase switchCase(
-          Expression expression, List<Statement> statements) =>
-      switchCase2(new List<Label>(), expression, statements);
-
-  static SwitchCase switchCase2(List<Label> labels, Expression expression,
-          List<Statement> statements) =>
-      new SwitchCase(labels, TokenFactory.tokenFromKeyword(Keyword.CASE),
-          expression, TokenFactory.tokenFromType(TokenType.COLON), statements);
-
-  static SwitchDefault switchDefault(
-          List<Label> labels, List<Statement> statements) =>
-      new SwitchDefault(labels, TokenFactory.tokenFromKeyword(Keyword.DEFAULT),
-          TokenFactory.tokenFromType(TokenType.COLON), statements);
-
-  static SwitchDefault switchDefault2(List<Statement> statements) =>
-      switchDefault(new List<Label>(), statements);
-
-  static SwitchStatement switchStatement(
-          Expression expression, List<SwitchMember> members) =>
-      new SwitchStatement(
-          TokenFactory.tokenFromKeyword(Keyword.SWITCH),
-          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
-          expression,
-          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
-          TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET),
-          members,
-          TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
-
-  static SymbolLiteral symbolLiteral(List<String> components) {
-    List<Token> identifierList = new List<Token>();
-    for (String component in components) {
-      identifierList.add(
-          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, component));
-    }
-    return new SymbolLiteral(
-        TokenFactory.tokenFromType(TokenType.HASH), identifierList);
-  }
-
-  static BlockFunctionBody syncBlockFunctionBody(
-          [List<Statement> statements]) =>
-      new BlockFunctionBody(
-          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "sync"),
-          null,
-          block(statements));
-
-  static BlockFunctionBody syncGeneratorBlockFunctionBody(
-          [List<Statement> statements]) =>
-      new BlockFunctionBody(
-          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "sync"),
-          TokenFactory.tokenFromType(TokenType.STAR),
-          block(statements));
-
-  static ThisExpression thisExpression() =>
-      new ThisExpression(TokenFactory.tokenFromKeyword(Keyword.THIS));
-
-  static ThrowExpression throwExpression() => throwExpression2(null);
-
-  static ThrowExpression throwExpression2(Expression expression) =>
-      new ThrowExpression(
-          TokenFactory.tokenFromKeyword(Keyword.THROW), expression);
-
-  static TopLevelVariableDeclaration topLevelVariableDeclaration(
-          Keyword keyword,
-          TypeName type,
-          List<VariableDeclaration> variables) =>
-      new TopLevelVariableDeclaration(
-          null,
-          null,
-          variableDeclarationList(keyword, type, variables),
-          TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static TopLevelVariableDeclaration topLevelVariableDeclaration2(
-          Keyword keyword, List<VariableDeclaration> variables) =>
-      new TopLevelVariableDeclaration(
-          null,
-          null,
-          variableDeclarationList(keyword, null, variables),
-          TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static TryStatement tryStatement(Block body, Block finallyClause) =>
-      tryStatement3(body, new List<CatchClause>(), finallyClause);
-
-  static TryStatement tryStatement2(
-          Block body, List<CatchClause> catchClauses) =>
-      tryStatement3(body, catchClauses, null);
-
-  static TryStatement tryStatement3(
-          Block body, List<CatchClause> catchClauses, Block finallyClause) =>
-      new TryStatement(
-          TokenFactory.tokenFromKeyword(Keyword.TRY),
-          body,
-          catchClauses,
-          finallyClause == null
-              ? null
-              : TokenFactory.tokenFromKeyword(Keyword.FINALLY),
-          finallyClause);
-
-  static FunctionTypeAlias typeAlias(TypeName returnType, String name,
-          TypeParameterList typeParameters, FormalParameterList parameters) =>
-      new FunctionTypeAlias(
-          null,
-          null,
-          TokenFactory.tokenFromKeyword(Keyword.TYPEDEF),
-          returnType,
-          identifier3(name),
-          typeParameters,
-          parameters,
-          TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static TypeArgumentList typeArgumentList(List<TypeName> typeNames) {
-    if (typeNames == null || typeNames.length == 0) {
-      return null;
-    }
-    return new TypeArgumentList(TokenFactory.tokenFromType(TokenType.LT),
-        typeNames, TokenFactory.tokenFromType(TokenType.GT));
-  }
-
-  /**
-   * Create a type name whose name has been resolved to the given [element] and
-   * whose type has been resolved to the type of the given element.
-   *
-   * <b>Note:</b> This method does not correctly handle class elements that have
-   * type parameters.
-   */
-  static TypeName typeName(ClassElement element, [List<TypeName> arguments]) {
-    SimpleIdentifier name = identifier3(element.name);
-    name.staticElement = element;
-    TypeName typeName = typeName3(name, arguments);
-    typeName.type = element.type;
-    return typeName;
-  }
-
-  static TypeName typeName3(Identifier name, [List<TypeName> arguments]) =>
-      new TypeName(name, typeArgumentList(arguments));
-
-  static TypeName typeName4(String name, [List<TypeName> arguments]) =>
-      new TypeName(identifier3(name), typeArgumentList(arguments));
-
-  static TypeParameter typeParameter(String name) =>
-      new TypeParameter(null, null, identifier3(name), null, null);
-
-  static TypeParameter typeParameter2(String name, TypeName bound) =>
-      new TypeParameter(null, null, identifier3(name),
-          TokenFactory.tokenFromKeyword(Keyword.EXTENDS), bound);
-
-  static TypeParameterList typeParameterList([List<String> typeNames]) {
-    List<TypeParameter> typeParameters = null;
-    if (typeNames != null && !typeNames.isEmpty) {
-      typeParameters = new List<TypeParameter>();
-      for (String typeName in typeNames) {
-        typeParameters.add(typeParameter(typeName));
-      }
-    }
-    return new TypeParameterList(TokenFactory.tokenFromType(TokenType.LT),
-        typeParameters, TokenFactory.tokenFromType(TokenType.GT));
-  }
-
-  static VariableDeclaration variableDeclaration(String name) =>
-      new VariableDeclaration(identifier3(name), null, null);
-
-  static VariableDeclaration variableDeclaration2(
-          String name, Expression initializer) =>
-      new VariableDeclaration(identifier3(name),
-          TokenFactory.tokenFromType(TokenType.EQ), initializer);
-
-  static VariableDeclarationList variableDeclarationList(Keyword keyword,
-          TypeName type, List<VariableDeclaration> variables) =>
-      new VariableDeclarationList(
-          null,
-          null,
-          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
-          type,
-          variables);
-
-  static VariableDeclarationList variableDeclarationList2(
-          Keyword keyword, List<VariableDeclaration> variables) =>
-      variableDeclarationList(keyword, null, variables);
-
-  static VariableDeclarationStatement variableDeclarationStatement(
-          Keyword keyword,
-          TypeName type,
-          List<VariableDeclaration> variables) =>
-      new VariableDeclarationStatement(
-          variableDeclarationList(keyword, type, variables),
-          TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static VariableDeclarationStatement variableDeclarationStatement2(
-          Keyword keyword, List<VariableDeclaration> variables) =>
-      variableDeclarationStatement(keyword, null, variables);
-
-  static WhileStatement whileStatement(Expression condition, Statement body) =>
-      new WhileStatement(
-          TokenFactory.tokenFromKeyword(Keyword.WHILE),
-          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
-          condition,
-          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
-          body);
-
-  static WithClause withClause(List<TypeName> types) =>
-      new WithClause(TokenFactory.tokenFromKeyword(Keyword.WITH), types);
-
-  static YieldStatement yieldEachStatement(Expression expression) =>
-      new YieldStatement(
-          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "yield"),
-          TokenFactory.tokenFromType(TokenType.STAR),
-          expression,
-          TokenFactory.tokenFromType(TokenType.SEMICOLON));
-
-  static YieldStatement yieldStatement(Expression expression) =>
-      new YieldStatement(
-          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "yield"),
-          null,
-          expression,
-          TokenFactory.tokenFromType(TokenType.SEMICOLON));
-}
diff --git a/pkg/analyzer/lib/src/generated/testing/ast_test_factory.dart b/pkg/analyzer/lib/src/generated/testing/ast_test_factory.dart
new file mode 100644
index 0000000..4cb8cb6
--- /dev/null
+++ b/pkg/analyzer/lib/src/generated/testing/ast_test_factory.dart
@@ -0,0 +1,1295 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analyzer.src.generated.testing.ast_test_factory;
+
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/ast/token.dart';
+import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer/src/dart/ast/ast.dart';
+import 'package:analyzer/src/generated/testing/token_factory.dart';
+import 'package:analyzer/src/generated/utilities_dart.dart';
+
+/**
+ * The class `AstTestFactory` defines utility methods that can be used to create AST nodes. The
+ * nodes that are created are complete in the sense that all of the tokens that would have been
+ * associated with the nodes by a parser are also created, but the token stream is not constructed.
+ * None of the nodes are resolved.
+ *
+ * The general pattern is for the name of the factory method to be the same as the name of the class
+ * of AST node being created. There are two notable exceptions. The first is for methods creating
+ * nodes that are part of a cascade expression. These methods are all prefixed with 'cascaded'. The
+ * second is places where a shorter name seemed unambiguous and easier to read, such as using
+ * 'identifier' rather than 'prefixedIdentifier', or 'integer' rather than 'integerLiteral'.
+ */
+class AstTestFactory {
+  static AdjacentStrings adjacentStrings(List<StringLiteral> strings) =>
+      new AdjacentStrings(strings);
+
+  static Annotation annotation(Identifier name) => new Annotation(
+      TokenFactory.tokenFromType(TokenType.AT), name, null, null, null);
+
+  static Annotation annotation2(Identifier name,
+          SimpleIdentifier constructorName, ArgumentList arguments) =>
+      new Annotation(
+          TokenFactory.tokenFromType(TokenType.AT),
+          name,
+          constructorName == null
+              ? null
+              : TokenFactory.tokenFromType(TokenType.PERIOD),
+          constructorName,
+          arguments);
+
+  static ArgumentList argumentList([List<Expression> arguments]) =>
+      new ArgumentList(TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          arguments, TokenFactory.tokenFromType(TokenType.CLOSE_PAREN));
+
+  static AsExpression asExpression(Expression expression, TypeName type) =>
+      new AsExpression(
+          expression, TokenFactory.tokenFromKeyword(Keyword.AS), type);
+
+  static AssertStatement assertStatement(Expression condition,
+          [Expression message]) =>
+      new AssertStatement(
+          TokenFactory.tokenFromKeyword(Keyword.ASSERT),
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          condition,
+          message == null ? null : TokenFactory.tokenFromType(TokenType.COMMA),
+          message,
+          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static AssignmentExpression assignmentExpression(Expression leftHandSide,
+          TokenType operator, Expression rightHandSide) =>
+      new AssignmentExpression(
+          leftHandSide, TokenFactory.tokenFromType(operator), rightHandSide);
+
+  static BlockFunctionBody asyncBlockFunctionBody(
+          [List<Statement> statements]) =>
+      new BlockFunctionBody(
+          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "async"),
+          null,
+          block(statements));
+
+  static ExpressionFunctionBody asyncExpressionFunctionBody(
+          Expression expression) =>
+      new ExpressionFunctionBody(
+          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "async"),
+          TokenFactory.tokenFromType(TokenType.FUNCTION),
+          expression,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static BlockFunctionBody asyncGeneratorBlockFunctionBody(
+          [List<Statement> statements]) =>
+      new BlockFunctionBody(
+          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "async"),
+          TokenFactory.tokenFromType(TokenType.STAR),
+          block(statements));
+
+  static AwaitExpression awaitExpression(Expression expression) =>
+      new AwaitExpression(
+          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "await"),
+          expression);
+
+  static BinaryExpression binaryExpression(Expression leftOperand,
+          TokenType operator, Expression rightOperand) =>
+      new BinaryExpression(
+          leftOperand, TokenFactory.tokenFromType(operator), rightOperand);
+
+  static Block block([List<Statement> statements]) => new Block(
+      TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET),
+      statements,
+      TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
+
+  static BlockFunctionBody blockFunctionBody(Block block) =>
+      new BlockFunctionBody(null, null, block);
+
+  static BlockFunctionBody blockFunctionBody2([List<Statement> statements]) =>
+      new BlockFunctionBody(null, null, block(statements));
+
+  static BooleanLiteral booleanLiteral(bool value) => new BooleanLiteral(
+      value
+          ? TokenFactory.tokenFromKeyword(Keyword.TRUE)
+          : TokenFactory.tokenFromKeyword(Keyword.FALSE),
+      value);
+
+  static BreakStatement breakStatement() => new BreakStatement(
+      TokenFactory.tokenFromKeyword(Keyword.BREAK),
+      null,
+      TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static BreakStatement breakStatement2(String label) => new BreakStatement(
+      TokenFactory.tokenFromKeyword(Keyword.BREAK),
+      identifier3(label),
+      TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static IndexExpression cascadedIndexExpression(Expression index) =>
+      new IndexExpression.forCascade(
+          TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD),
+          TokenFactory.tokenFromType(TokenType.OPEN_SQUARE_BRACKET),
+          index,
+          TokenFactory.tokenFromType(TokenType.CLOSE_SQUARE_BRACKET));
+
+  static MethodInvocation cascadedMethodInvocation(String methodName,
+          [List<Expression> arguments]) =>
+      new MethodInvocation(
+          null,
+          TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD),
+          identifier3(methodName),
+          null,
+          argumentList(arguments));
+
+  static PropertyAccess cascadedPropertyAccess(String propertyName) =>
+      new PropertyAccess(
+          null,
+          TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD),
+          identifier3(propertyName));
+
+  static CascadeExpression cascadeExpression(Expression target,
+          [List<Expression> cascadeSections]) =>
+      new CascadeExpression(target, cascadeSections);
+
+  static CatchClause catchClause(String exceptionParameter,
+          [List<Statement> statements]) =>
+      catchClause5(null, exceptionParameter, null, statements);
+
+  static CatchClause catchClause2(
+          String exceptionParameter, String stackTraceParameter,
+          [List<Statement> statements]) =>
+      catchClause5(null, exceptionParameter, stackTraceParameter, statements);
+
+  static CatchClause catchClause3(TypeName exceptionType,
+          [List<Statement> statements]) =>
+      catchClause5(exceptionType, null, null, statements);
+
+  static CatchClause catchClause4(
+          TypeName exceptionType, String exceptionParameter,
+          [List<Statement> statements]) =>
+      catchClause5(exceptionType, exceptionParameter, null, statements);
+
+  static CatchClause catchClause5(TypeName exceptionType,
+          String exceptionParameter, String stackTraceParameter,
+          [List<Statement> statements]) =>
+      new CatchClause(
+          exceptionType == null
+              ? null
+              : TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "on"),
+          exceptionType,
+          exceptionParameter == null
+              ? null
+              : TokenFactory.tokenFromKeyword(Keyword.CATCH),
+          exceptionParameter == null
+              ? null
+              : TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          exceptionParameter == null ? null : identifier3(exceptionParameter),
+          stackTraceParameter == null
+              ? null
+              : TokenFactory.tokenFromType(TokenType.COMMA),
+          stackTraceParameter == null ? null : identifier3(stackTraceParameter),
+          exceptionParameter == null
+              ? null
+              : TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+          block(statements));
+
+  static ClassDeclaration classDeclaration(
+          Keyword abstractKeyword,
+          String name,
+          TypeParameterList typeParameters,
+          ExtendsClause extendsClause,
+          WithClause withClause,
+          ImplementsClause implementsClause,
+          [List<ClassMember> members]) =>
+      new ClassDeclaration(
+          null,
+          null,
+          abstractKeyword == null
+              ? null
+              : TokenFactory.tokenFromKeyword(abstractKeyword),
+          TokenFactory.tokenFromKeyword(Keyword.CLASS),
+          identifier3(name),
+          typeParameters,
+          extendsClause,
+          withClause,
+          implementsClause,
+          TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET),
+          members,
+          TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
+
+  static ClassTypeAlias classTypeAlias(
+          String name,
+          TypeParameterList typeParameters,
+          Keyword abstractKeyword,
+          TypeName superclass,
+          WithClause withClause,
+          ImplementsClause implementsClause) =>
+      new ClassTypeAlias(
+          null,
+          null,
+          TokenFactory.tokenFromKeyword(Keyword.CLASS),
+          identifier3(name),
+          typeParameters,
+          TokenFactory.tokenFromType(TokenType.EQ),
+          abstractKeyword == null
+              ? null
+              : TokenFactory.tokenFromKeyword(abstractKeyword),
+          superclass,
+          withClause,
+          implementsClause,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static CompilationUnit compilationUnit() =>
+      compilationUnit8(null, null, null);
+
+  static CompilationUnit compilationUnit2(
+          List<CompilationUnitMember> declarations) =>
+      compilationUnit8(null, null, declarations);
+
+  static CompilationUnit compilationUnit3(List<Directive> directives) =>
+      compilationUnit8(null, directives, null);
+
+  static CompilationUnit compilationUnit4(List<Directive> directives,
+          List<CompilationUnitMember> declarations) =>
+      compilationUnit8(null, directives, declarations);
+
+  static CompilationUnit compilationUnit5(String scriptTag) =>
+      compilationUnit8(scriptTag, null, null);
+
+  static CompilationUnit compilationUnit6(
+          String scriptTag, List<CompilationUnitMember> declarations) =>
+      compilationUnit8(scriptTag, null, declarations);
+
+  static CompilationUnit compilationUnit7(
+          String scriptTag, List<Directive> directives) =>
+      compilationUnit8(scriptTag, directives, null);
+
+  static CompilationUnit compilationUnit8(
+          String scriptTag,
+          List<Directive> directives,
+          List<CompilationUnitMember> declarations) =>
+      new CompilationUnit(
+          TokenFactory.tokenFromType(TokenType.EOF),
+          scriptTag == null ? null : AstTestFactory.scriptTag(scriptTag),
+          directives == null ? new List<Directive>() : directives,
+          declarations == null
+              ? new List<CompilationUnitMember>()
+              : declarations,
+          TokenFactory.tokenFromType(TokenType.EOF));
+
+  static ConditionalExpression conditionalExpression(Expression condition,
+          Expression thenExpression, Expression elseExpression) =>
+      new ConditionalExpression(
+          condition,
+          TokenFactory.tokenFromType(TokenType.QUESTION),
+          thenExpression,
+          TokenFactory.tokenFromType(TokenType.COLON),
+          elseExpression);
+
+  static ConstructorDeclaration constructorDeclaration(
+          Identifier returnType,
+          String name,
+          FormalParameterList parameters,
+          List<ConstructorInitializer> initializers) =>
+      new ConstructorDeclaration(
+          null,
+          null,
+          TokenFactory.tokenFromKeyword(Keyword.EXTERNAL),
+          null,
+          null,
+          returnType,
+          name == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD),
+          name == null ? null : identifier3(name),
+          parameters,
+          initializers == null || initializers.isEmpty
+              ? null
+              : TokenFactory.tokenFromType(TokenType.PERIOD),
+          initializers == null
+              ? new List<ConstructorInitializer>()
+              : initializers,
+          null,
+          emptyFunctionBody());
+
+  static ConstructorDeclaration constructorDeclaration2(
+          Keyword constKeyword,
+          Keyword factoryKeyword,
+          Identifier returnType,
+          String name,
+          FormalParameterList parameters,
+          List<ConstructorInitializer> initializers,
+          FunctionBody body) =>
+      new ConstructorDeclaration(
+          null,
+          null,
+          null,
+          constKeyword == null
+              ? null
+              : TokenFactory.tokenFromKeyword(constKeyword),
+          factoryKeyword == null
+              ? null
+              : TokenFactory.tokenFromKeyword(factoryKeyword),
+          returnType,
+          name == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD),
+          name == null ? null : identifier3(name),
+          parameters,
+          initializers == null || initializers.isEmpty
+              ? null
+              : TokenFactory.tokenFromType(TokenType.PERIOD),
+          initializers == null
+              ? new List<ConstructorInitializer>()
+              : initializers,
+          null,
+          body);
+
+  static ConstructorFieldInitializer constructorFieldInitializer(
+          bool prefixedWithThis, String fieldName, Expression expression) =>
+      new ConstructorFieldInitializer(
+          prefixedWithThis ? TokenFactory.tokenFromKeyword(Keyword.THIS) : null,
+          prefixedWithThis
+              ? TokenFactory.tokenFromType(TokenType.PERIOD)
+              : null,
+          identifier3(fieldName),
+          TokenFactory.tokenFromType(TokenType.EQ),
+          expression);
+
+  static ConstructorName constructorName(TypeName type, String name) =>
+      new ConstructorName(
+          type,
+          name == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD),
+          name == null ? null : identifier3(name));
+
+  static ContinueStatement continueStatement([String label]) =>
+      new ContinueStatement(
+          TokenFactory.tokenFromKeyword(Keyword.CONTINUE),
+          label == null ? null : identifier3(label),
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static DeclaredIdentifier declaredIdentifier(
+          Keyword keyword, String identifier) =>
+      declaredIdentifier2(keyword, null, identifier);
+
+  static DeclaredIdentifier declaredIdentifier2(
+          Keyword keyword, TypeName type, String identifier) =>
+      new DeclaredIdentifier(
+          null,
+          null,
+          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
+          type,
+          identifier3(identifier));
+
+  static DeclaredIdentifier declaredIdentifier3(String identifier) =>
+      declaredIdentifier2(Keyword.VAR, null, identifier);
+
+  static DeclaredIdentifier declaredIdentifier4(
+          TypeName type, String identifier) =>
+      declaredIdentifier2(null, type, identifier);
+
+  static Comment documentationComment(
+      List<Token> tokens, List<CommentReference> references) {
+    return new Comment(tokens, CommentType.DOCUMENTATION, references);
+  }
+
+  static DoStatement doStatement(Statement body, Expression condition) =>
+      new DoStatement(
+          TokenFactory.tokenFromKeyword(Keyword.DO),
+          body,
+          TokenFactory.tokenFromKeyword(Keyword.WHILE),
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          condition,
+          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static DoubleLiteral doubleLiteral(double value) =>
+      new DoubleLiteral(TokenFactory.tokenFromString(value.toString()), value);
+
+  static EmptyFunctionBody emptyFunctionBody() =>
+      new EmptyFunctionBody(TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static EmptyStatement emptyStatement() =>
+      new EmptyStatement(TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static EnumDeclaration enumDeclaration(
+          SimpleIdentifier name, List<EnumConstantDeclaration> constants) =>
+      new EnumDeclaration(
+          null,
+          null,
+          TokenFactory.tokenFromKeyword(Keyword.ENUM),
+          name,
+          TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET),
+          constants,
+          TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
+
+  static EnumDeclaration enumDeclaration2(
+      String name, List<String> constantNames) {
+    int count = constantNames.length;
+    List<EnumConstantDeclaration> constants =
+        new List<EnumConstantDeclaration>(count);
+    for (int i = 0; i < count; i++) {
+      constants[i] = new EnumConstantDeclaration(
+          null, null, identifier3(constantNames[i]));
+    }
+    return enumDeclaration(identifier3(name), constants);
+  }
+
+  static ExportDirective exportDirective(List<Annotation> metadata, String uri,
+          [List<Combinator> combinators]) =>
+      new ExportDirective(
+          null,
+          metadata,
+          TokenFactory.tokenFromKeyword(Keyword.EXPORT),
+          string2(uri),
+          null,
+          combinators,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static ExportDirective exportDirective2(String uri,
+          [List<Combinator> combinators]) =>
+      exportDirective(null, uri, combinators);
+
+  static ExpressionFunctionBody expressionFunctionBody(Expression expression) =>
+      new ExpressionFunctionBody(
+          null,
+          TokenFactory.tokenFromType(TokenType.FUNCTION),
+          expression,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static ExpressionStatement expressionStatement(Expression expression) =>
+      new ExpressionStatement(
+          expression, TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static ExtendsClause extendsClause(TypeName type) =>
+      new ExtendsClause(TokenFactory.tokenFromKeyword(Keyword.EXTENDS), type);
+
+  static FieldDeclaration fieldDeclaration(bool isStatic, Keyword keyword,
+          TypeName type, List<VariableDeclaration> variables) =>
+      new FieldDeclaration(
+          null,
+          null,
+          isStatic ? TokenFactory.tokenFromKeyword(Keyword.STATIC) : null,
+          variableDeclarationList(keyword, type, variables),
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static FieldDeclaration fieldDeclaration2(bool isStatic, Keyword keyword,
+          List<VariableDeclaration> variables) =>
+      fieldDeclaration(isStatic, keyword, null, variables);
+
+  static FieldFormalParameter fieldFormalParameter(
+          Keyword keyword, TypeName type, String identifier,
+          [FormalParameterList parameterList]) =>
+      new FieldFormalParameter(
+          null,
+          null,
+          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
+          type,
+          TokenFactory.tokenFromKeyword(Keyword.THIS),
+          TokenFactory.tokenFromType(TokenType.PERIOD),
+          identifier3(identifier),
+          null,
+          parameterList);
+
+  static FieldFormalParameter fieldFormalParameter2(String identifier) =>
+      fieldFormalParameter(null, null, identifier);
+
+  static ForEachStatement forEachStatement(DeclaredIdentifier loopVariable,
+          Expression iterator, Statement body) =>
+      new ForEachStatement.withDeclaration(
+          null,
+          TokenFactory.tokenFromKeyword(Keyword.FOR),
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          loopVariable,
+          TokenFactory.tokenFromKeyword(Keyword.IN),
+          iterator,
+          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+          body);
+
+  static ForEachStatement forEachStatement2(
+          SimpleIdentifier identifier, Expression iterator, Statement body) =>
+      new ForEachStatement.withReference(
+          null,
+          TokenFactory.tokenFromKeyword(Keyword.FOR),
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          identifier,
+          TokenFactory.tokenFromKeyword(Keyword.IN),
+          iterator,
+          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+          body);
+
+  static FormalParameterList formalParameterList(
+          [List<FormalParameter> parameters]) =>
+      new FormalParameterList(
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          parameters,
+          null,
+          null,
+          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN));
+
+  static ForStatement forStatement(Expression initialization,
+          Expression condition, List<Expression> updaters, Statement body) =>
+      new ForStatement(
+          TokenFactory.tokenFromKeyword(Keyword.FOR),
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          null,
+          initialization,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON),
+          condition,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON),
+          updaters,
+          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+          body);
+
+  static ForStatement forStatement2(VariableDeclarationList variableList,
+          Expression condition, List<Expression> updaters, Statement body) =>
+      new ForStatement(
+          TokenFactory.tokenFromKeyword(Keyword.FOR),
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          variableList,
+          null,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON),
+          condition,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON),
+          updaters,
+          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+          body);
+
+  static FunctionDeclaration functionDeclaration(TypeName type, Keyword keyword,
+          String name, FunctionExpression functionExpression) =>
+      new FunctionDeclaration(
+          null,
+          null,
+          null,
+          type,
+          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
+          identifier3(name),
+          functionExpression);
+
+  static FunctionDeclarationStatement functionDeclarationStatement(
+          TypeName type,
+          Keyword keyword,
+          String name,
+          FunctionExpression functionExpression) =>
+      new FunctionDeclarationStatement(
+          functionDeclaration(type, keyword, name, functionExpression));
+
+  static FunctionExpression functionExpression() =>
+      new FunctionExpression(null, formalParameterList(), blockFunctionBody2());
+
+  static FunctionExpression functionExpression2(
+          FormalParameterList parameters, FunctionBody body) =>
+      new FunctionExpression(null, parameters, body);
+
+  static FunctionExpression functionExpression3(
+          TypeParameterList typeParameters,
+          FormalParameterList parameters,
+          FunctionBody body) =>
+      new FunctionExpression(typeParameters, parameters, body);
+
+  static FunctionExpressionInvocation functionExpressionInvocation(
+          Expression function,
+          [List<Expression> arguments]) =>
+      functionExpressionInvocation2(function, null, arguments);
+
+  static FunctionExpressionInvocation functionExpressionInvocation2(
+          Expression function,
+          [TypeArgumentList typeArguments,
+          List<Expression> arguments]) =>
+      new FunctionExpressionInvocation(
+          function, typeArguments, argumentList(arguments));
+
+  static FunctionTypedFormalParameter functionTypedFormalParameter(
+          TypeName returnType, String identifier,
+          [List<FormalParameter> parameters]) =>
+      new FunctionTypedFormalParameter(null, null, returnType,
+          identifier3(identifier), null, formalParameterList(parameters));
+
+  static HideCombinator hideCombinator(List<SimpleIdentifier> identifiers) =>
+      new HideCombinator(TokenFactory.tokenFromString("hide"), identifiers);
+
+  static HideCombinator hideCombinator2(List<String> identifiers) =>
+      new HideCombinator(
+          TokenFactory.tokenFromString("hide"), identifierList(identifiers));
+
+  static PrefixedIdentifier identifier(
+          SimpleIdentifier prefix, SimpleIdentifier identifier) =>
+      new PrefixedIdentifier(
+          prefix, TokenFactory.tokenFromType(TokenType.PERIOD), identifier);
+
+  static SimpleIdentifier identifier3(String lexeme) => new SimpleIdentifier(
+      TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, lexeme));
+
+  static PrefixedIdentifier identifier4(
+          String prefix, SimpleIdentifier identifier) =>
+      new PrefixedIdentifier(identifier3(prefix),
+          TokenFactory.tokenFromType(TokenType.PERIOD), identifier);
+
+  static PrefixedIdentifier identifier5(String prefix, String identifier) =>
+      new PrefixedIdentifier(
+          identifier3(prefix),
+          TokenFactory.tokenFromType(TokenType.PERIOD),
+          identifier3(identifier));
+
+  static List<SimpleIdentifier> identifierList(List<String> identifiers) {
+    if (identifiers == null) {
+      return null;
+    }
+    return identifiers
+        .map((String identifier) => identifier3(identifier))
+        .toList();
+  }
+
+  static IfStatement ifStatement(
+          Expression condition, Statement thenStatement) =>
+      ifStatement2(condition, thenStatement, null);
+
+  static IfStatement ifStatement2(Expression condition, Statement thenStatement,
+          Statement elseStatement) =>
+      new IfStatement(
+          TokenFactory.tokenFromKeyword(Keyword.IF),
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          condition,
+          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+          thenStatement,
+          elseStatement == null
+              ? null
+              : TokenFactory.tokenFromKeyword(Keyword.ELSE),
+          elseStatement);
+
+  static ImplementsClause implementsClause(List<TypeName> types) =>
+      new ImplementsClause(
+          TokenFactory.tokenFromKeyword(Keyword.IMPLEMENTS), types);
+
+  static ImportDirective importDirective(
+          List<Annotation> metadata, String uri, bool isDeferred, String prefix,
+          [List<Combinator> combinators]) =>
+      new ImportDirective(
+          null,
+          metadata,
+          TokenFactory.tokenFromKeyword(Keyword.IMPORT),
+          string2(uri),
+          null,
+          !isDeferred ? null : TokenFactory.tokenFromKeyword(Keyword.DEFERRED),
+          prefix == null ? null : TokenFactory.tokenFromKeyword(Keyword.AS),
+          prefix == null ? null : identifier3(prefix),
+          combinators,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static ImportDirective importDirective2(
+          String uri, bool isDeferred, String prefix,
+          [List<Combinator> combinators]) =>
+      importDirective(null, uri, isDeferred, prefix, combinators);
+
+  static ImportDirective importDirective3(String uri, String prefix,
+          [List<Combinator> combinators]) =>
+      importDirective(null, uri, false, prefix, combinators);
+
+  static IndexExpression indexExpression(Expression array, Expression index) =>
+      new IndexExpression.forTarget(
+          array,
+          TokenFactory.tokenFromType(TokenType.OPEN_SQUARE_BRACKET),
+          index,
+          TokenFactory.tokenFromType(TokenType.CLOSE_SQUARE_BRACKET));
+
+  static InstanceCreationExpression instanceCreationExpression(
+          Keyword keyword, ConstructorName name,
+          [List<Expression> arguments]) =>
+      new InstanceCreationExpression(
+          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
+          name,
+          argumentList(arguments));
+
+  static InstanceCreationExpression instanceCreationExpression2(
+          Keyword keyword, TypeName type,
+          [List<Expression> arguments]) =>
+      instanceCreationExpression3(keyword, type, null, arguments);
+
+  static InstanceCreationExpression instanceCreationExpression3(
+          Keyword keyword, TypeName type, String identifier,
+          [List<Expression> arguments]) =>
+      instanceCreationExpression(
+          keyword,
+          new ConstructorName(
+              type,
+              identifier == null
+                  ? null
+                  : TokenFactory.tokenFromType(TokenType.PERIOD),
+              identifier == null ? null : identifier3(identifier)),
+          arguments);
+
+  static IntegerLiteral integer(int value) => new IntegerLiteral(
+      TokenFactory.tokenFromTypeAndString(TokenType.INT, value.toString()),
+      value);
+
+  static InterpolationExpression interpolationExpression(
+          Expression expression) =>
+      new InterpolationExpression(
+          TokenFactory.tokenFromType(TokenType.STRING_INTERPOLATION_EXPRESSION),
+          expression,
+          TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
+
+  static InterpolationExpression interpolationExpression2(String identifier) =>
+      new InterpolationExpression(
+          TokenFactory.tokenFromType(TokenType.STRING_INTERPOLATION_IDENTIFIER),
+          identifier3(identifier),
+          null);
+
+  static InterpolationString interpolationString(
+          String contents, String value) =>
+      new InterpolationString(TokenFactory.tokenFromString(contents), value);
+
+  static IsExpression isExpression(
+          Expression expression, bool negated, TypeName type) =>
+      new IsExpression(expression, TokenFactory.tokenFromKeyword(Keyword.IS),
+          negated ? TokenFactory.tokenFromType(TokenType.BANG) : null, type);
+
+  static Label label(SimpleIdentifier label) =>
+      new Label(label, TokenFactory.tokenFromType(TokenType.COLON));
+
+  static Label label2(String label) => AstTestFactory.label(identifier3(label));
+
+  static LabeledStatement labeledStatement(
+          List<Label> labels, Statement statement) =>
+      new LabeledStatement(labels, statement);
+
+  static LibraryDirective libraryDirective(
+          List<Annotation> metadata, LibraryIdentifier libraryName) =>
+      new LibraryDirective(
+          null,
+          metadata,
+          TokenFactory.tokenFromKeyword(Keyword.LIBRARY),
+          libraryName,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static LibraryDirective libraryDirective2(String libraryName) =>
+      libraryDirective(
+          new List<Annotation>(), libraryIdentifier2([libraryName]));
+
+  static LibraryIdentifier libraryIdentifier(
+          List<SimpleIdentifier> components) =>
+      new LibraryIdentifier(components);
+
+  static LibraryIdentifier libraryIdentifier2(List<String> components) {
+    return new LibraryIdentifier(identifierList(components));
+  }
+
+  static List list(List<Object> elements) {
+    return elements;
+  }
+
+  static ListLiteral listLiteral([List<Expression> elements]) =>
+      listLiteral2(null, null, elements);
+
+  static ListLiteral listLiteral2(
+          Keyword keyword, TypeArgumentList typeArguments,
+          [List<Expression> elements]) =>
+      new ListLiteral(
+          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
+          typeArguments,
+          TokenFactory.tokenFromType(TokenType.OPEN_SQUARE_BRACKET),
+          elements,
+          TokenFactory.tokenFromType(TokenType.CLOSE_SQUARE_BRACKET));
+
+  static MapLiteral mapLiteral(Keyword keyword, TypeArgumentList typeArguments,
+          [List<MapLiteralEntry> entries]) =>
+      new MapLiteral(
+          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
+          typeArguments,
+          TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET),
+          entries,
+          TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
+
+  static MapLiteral mapLiteral2([List<MapLiteralEntry> entries]) =>
+      mapLiteral(null, null, entries);
+
+  static MapLiteralEntry mapLiteralEntry(String key, Expression value) =>
+      new MapLiteralEntry(
+          string2(key), TokenFactory.tokenFromType(TokenType.COLON), value);
+
+  static MapLiteralEntry mapLiteralEntry2(Expression key, Expression value) =>
+      new MapLiteralEntry(
+          key, TokenFactory.tokenFromType(TokenType.COLON), value);
+
+  static MethodDeclaration methodDeclaration(
+          Keyword modifier,
+          TypeName returnType,
+          Keyword property,
+          Keyword operator,
+          SimpleIdentifier name,
+          FormalParameterList parameters) =>
+      new MethodDeclaration(
+          null,
+          null,
+          TokenFactory.tokenFromKeyword(Keyword.EXTERNAL),
+          modifier == null ? null : TokenFactory.tokenFromKeyword(modifier),
+          returnType,
+          property == null ? null : TokenFactory.tokenFromKeyword(property),
+          operator == null ? null : TokenFactory.tokenFromKeyword(operator),
+          name,
+          null,
+          parameters,
+          emptyFunctionBody());
+
+  static MethodDeclaration methodDeclaration2(
+          Keyword modifier,
+          TypeName returnType,
+          Keyword property,
+          Keyword operator,
+          SimpleIdentifier name,
+          FormalParameterList parameters,
+          FunctionBody body) =>
+      new MethodDeclaration(
+          null,
+          null,
+          null,
+          modifier == null ? null : TokenFactory.tokenFromKeyword(modifier),
+          returnType,
+          property == null ? null : TokenFactory.tokenFromKeyword(property),
+          operator == null ? null : TokenFactory.tokenFromKeyword(operator),
+          name,
+          null,
+          parameters,
+          body);
+
+  static MethodDeclaration methodDeclaration3(
+          Keyword modifier,
+          TypeName returnType,
+          Keyword property,
+          Keyword operator,
+          SimpleIdentifier name,
+          TypeParameterList typeParameters,
+          FormalParameterList parameters,
+          FunctionBody body) =>
+      new MethodDeclaration(
+          null,
+          null,
+          null,
+          modifier == null ? null : TokenFactory.tokenFromKeyword(modifier),
+          returnType,
+          property == null ? null : TokenFactory.tokenFromKeyword(property),
+          operator == null ? null : TokenFactory.tokenFromKeyword(operator),
+          name,
+          typeParameters,
+          parameters,
+          body);
+
+  static MethodDeclaration methodDeclaration4(
+          {bool external: false,
+          Keyword modifier,
+          TypeName returnType,
+          Keyword property,
+          bool operator: false,
+          String name,
+          FormalParameterList parameters,
+          FunctionBody body}) =>
+      new MethodDeclaration(
+          null,
+          null,
+          external ? TokenFactory.tokenFromKeyword(Keyword.EXTERNAL) : null,
+          modifier == null ? null : TokenFactory.tokenFromKeyword(modifier),
+          returnType,
+          property == null ? null : TokenFactory.tokenFromKeyword(property),
+          operator ? TokenFactory.tokenFromKeyword(Keyword.OPERATOR) : null,
+          identifier3(name),
+          null,
+          parameters,
+          body);
+
+  static MethodInvocation methodInvocation(Expression target, String methodName,
+          [List<Expression> arguments,
+          TokenType operator = TokenType.PERIOD]) =>
+      new MethodInvocation(
+          target,
+          target == null ? null : TokenFactory.tokenFromType(operator),
+          identifier3(methodName),
+          null,
+          argumentList(arguments));
+
+  static MethodInvocation methodInvocation2(String methodName,
+          [List<Expression> arguments]) =>
+      methodInvocation(null, methodName, arguments);
+
+  static MethodInvocation methodInvocation3(
+          Expression target, String methodName, TypeArgumentList typeArguments,
+          [List<Expression> arguments,
+          TokenType operator = TokenType.PERIOD]) =>
+      new MethodInvocation(
+          target,
+          target == null ? null : TokenFactory.tokenFromType(operator),
+          identifier3(methodName),
+          typeArguments,
+          argumentList(arguments));
+
+  static NamedExpression namedExpression(Label label, Expression expression) =>
+      new NamedExpression(label, expression);
+
+  static NamedExpression namedExpression2(
+          String label, Expression expression) =>
+      namedExpression(label2(label), expression);
+
+  static DefaultFormalParameter namedFormalParameter(
+          NormalFormalParameter parameter, Expression expression) =>
+      new DefaultFormalParameter(
+          parameter,
+          ParameterKind.NAMED,
+          expression == null
+              ? null
+              : TokenFactory.tokenFromType(TokenType.COLON),
+          expression);
+
+  static NativeClause nativeClause(String nativeCode) => new NativeClause(
+      TokenFactory.tokenFromString("native"), string2(nativeCode));
+
+  static NativeFunctionBody nativeFunctionBody(String nativeMethodName) =>
+      new NativeFunctionBody(
+          TokenFactory.tokenFromString("native"),
+          string2(nativeMethodName),
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static NullLiteral nullLiteral() =>
+      new NullLiteral(TokenFactory.tokenFromKeyword(Keyword.NULL));
+
+  static ParenthesizedExpression parenthesizedExpression(
+          Expression expression) =>
+      new ParenthesizedExpression(
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          expression,
+          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN));
+
+  static PartDirective partDirective(List<Annotation> metadata, String url) =>
+      new PartDirective(
+          null,
+          metadata,
+          TokenFactory.tokenFromKeyword(Keyword.PART),
+          string2(url),
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static PartDirective partDirective2(String url) =>
+      partDirective(new List<Annotation>(), url);
+
+  static PartOfDirective partOfDirective(LibraryIdentifier libraryName) =>
+      partOfDirective2(new List<Annotation>(), libraryName);
+
+  static PartOfDirective partOfDirective2(
+          List<Annotation> metadata, LibraryIdentifier libraryName) =>
+      new PartOfDirective(
+          null,
+          metadata,
+          TokenFactory.tokenFromKeyword(Keyword.PART),
+          TokenFactory.tokenFromString("of"),
+          null,
+          libraryName,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static DefaultFormalParameter positionalFormalParameter(
+          NormalFormalParameter parameter, Expression expression) =>
+      new DefaultFormalParameter(
+          parameter,
+          ParameterKind.POSITIONAL,
+          expression == null ? null : TokenFactory.tokenFromType(TokenType.EQ),
+          expression);
+
+  static PostfixExpression postfixExpression(
+          Expression expression, TokenType operator) =>
+      new PostfixExpression(expression, TokenFactory.tokenFromType(operator));
+
+  static PrefixExpression prefixExpression(
+          TokenType operator, Expression expression) =>
+      new PrefixExpression(TokenFactory.tokenFromType(operator), expression);
+
+  static PropertyAccess propertyAccess(
+          Expression target, SimpleIdentifier propertyName) =>
+      new PropertyAccess(
+          target, TokenFactory.tokenFromType(TokenType.PERIOD), propertyName);
+
+  static PropertyAccess propertyAccess2(Expression target, String propertyName,
+          [TokenType operator = TokenType.PERIOD]) =>
+      new PropertyAccess(target, TokenFactory.tokenFromType(operator),
+          identifier3(propertyName));
+
+  static RedirectingConstructorInvocation redirectingConstructorInvocation(
+          [List<Expression> arguments]) =>
+      redirectingConstructorInvocation2(null, arguments);
+
+  static RedirectingConstructorInvocation redirectingConstructorInvocation2(
+          String constructorName,
+          [List<Expression> arguments]) =>
+      new RedirectingConstructorInvocation(
+          TokenFactory.tokenFromKeyword(Keyword.THIS),
+          constructorName == null
+              ? null
+              : TokenFactory.tokenFromType(TokenType.PERIOD),
+          constructorName == null ? null : identifier3(constructorName),
+          argumentList(arguments));
+
+  static RethrowExpression rethrowExpression() =>
+      new RethrowExpression(TokenFactory.tokenFromKeyword(Keyword.RETHROW));
+
+  static ReturnStatement returnStatement() => returnStatement2(null);
+
+  static ReturnStatement returnStatement2(Expression expression) =>
+      new ReturnStatement(TokenFactory.tokenFromKeyword(Keyword.RETURN),
+          expression, TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static ScriptTag scriptTag(String scriptTag) =>
+      new ScriptTag(TokenFactory.tokenFromString(scriptTag));
+
+  static ShowCombinator showCombinator(List<SimpleIdentifier> identifiers) =>
+      new ShowCombinator(TokenFactory.tokenFromString("show"), identifiers);
+
+  static ShowCombinator showCombinator2(List<String> identifiers) =>
+      new ShowCombinator(
+          TokenFactory.tokenFromString("show"), identifierList(identifiers));
+
+  static SimpleFormalParameter simpleFormalParameter(
+          Keyword keyword, String parameterName) =>
+      simpleFormalParameter2(keyword, null, parameterName);
+
+  static SimpleFormalParameter simpleFormalParameter2(
+          Keyword keyword, TypeName type, String parameterName) =>
+      new SimpleFormalParameter(
+          null,
+          null,
+          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
+          type,
+          identifier3(parameterName));
+
+  static SimpleFormalParameter simpleFormalParameter3(String parameterName) =>
+      simpleFormalParameter2(null, null, parameterName);
+
+  static SimpleFormalParameter simpleFormalParameter4(
+          TypeName type, String parameterName) =>
+      simpleFormalParameter2(null, type, parameterName);
+
+  static StringInterpolation string([List<InterpolationElement> elements]) =>
+      new StringInterpolation(elements);
+
+  static SimpleStringLiteral string2(String content) => new SimpleStringLiteral(
+      TokenFactory.tokenFromString("'$content'"), content);
+
+  static SuperConstructorInvocation superConstructorInvocation(
+          [List<Expression> arguments]) =>
+      superConstructorInvocation2(null, arguments);
+
+  static SuperConstructorInvocation superConstructorInvocation2(String name,
+          [List<Expression> arguments]) =>
+      new SuperConstructorInvocation(
+          TokenFactory.tokenFromKeyword(Keyword.SUPER),
+          name == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD),
+          name == null ? null : identifier3(name),
+          argumentList(arguments));
+
+  static SuperExpression superExpression() =>
+      new SuperExpression(TokenFactory.tokenFromKeyword(Keyword.SUPER));
+
+  static SwitchCase switchCase(
+          Expression expression, List<Statement> statements) =>
+      switchCase2(new List<Label>(), expression, statements);
+
+  static SwitchCase switchCase2(List<Label> labels, Expression expression,
+          List<Statement> statements) =>
+      new SwitchCase(labels, TokenFactory.tokenFromKeyword(Keyword.CASE),
+          expression, TokenFactory.tokenFromType(TokenType.COLON), statements);
+
+  static SwitchDefault switchDefault(
+          List<Label> labels, List<Statement> statements) =>
+      new SwitchDefault(labels, TokenFactory.tokenFromKeyword(Keyword.DEFAULT),
+          TokenFactory.tokenFromType(TokenType.COLON), statements);
+
+  static SwitchDefault switchDefault2(List<Statement> statements) =>
+      switchDefault(new List<Label>(), statements);
+
+  static SwitchStatement switchStatement(
+          Expression expression, List<SwitchMember> members) =>
+      new SwitchStatement(
+          TokenFactory.tokenFromKeyword(Keyword.SWITCH),
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          expression,
+          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+          TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET),
+          members,
+          TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
+
+  static SymbolLiteral symbolLiteral(List<String> components) {
+    List<Token> identifierList = new List<Token>();
+    for (String component in components) {
+      identifierList.add(
+          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, component));
+    }
+    return new SymbolLiteral(
+        TokenFactory.tokenFromType(TokenType.HASH), identifierList);
+  }
+
+  static BlockFunctionBody syncBlockFunctionBody(
+          [List<Statement> statements]) =>
+      new BlockFunctionBody(
+          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "sync"),
+          null,
+          block(statements));
+
+  static BlockFunctionBody syncGeneratorBlockFunctionBody(
+          [List<Statement> statements]) =>
+      new BlockFunctionBody(
+          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "sync"),
+          TokenFactory.tokenFromType(TokenType.STAR),
+          block(statements));
+
+  static ThisExpression thisExpression() =>
+      new ThisExpression(TokenFactory.tokenFromKeyword(Keyword.THIS));
+
+  static ThrowExpression throwExpression() => throwExpression2(null);
+
+  static ThrowExpression throwExpression2(Expression expression) =>
+      new ThrowExpression(
+          TokenFactory.tokenFromKeyword(Keyword.THROW), expression);
+
+  static TopLevelVariableDeclaration topLevelVariableDeclaration(
+          Keyword keyword,
+          TypeName type,
+          List<VariableDeclaration> variables) =>
+      new TopLevelVariableDeclaration(
+          null,
+          null,
+          variableDeclarationList(keyword, type, variables),
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static TopLevelVariableDeclaration topLevelVariableDeclaration2(
+          Keyword keyword, List<VariableDeclaration> variables) =>
+      new TopLevelVariableDeclaration(
+          null,
+          null,
+          variableDeclarationList(keyword, null, variables),
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static TryStatement tryStatement(Block body, Block finallyClause) =>
+      tryStatement3(body, new List<CatchClause>(), finallyClause);
+
+  static TryStatement tryStatement2(
+          Block body, List<CatchClause> catchClauses) =>
+      tryStatement3(body, catchClauses, null);
+
+  static TryStatement tryStatement3(
+          Block body, List<CatchClause> catchClauses, Block finallyClause) =>
+      new TryStatement(
+          TokenFactory.tokenFromKeyword(Keyword.TRY),
+          body,
+          catchClauses,
+          finallyClause == null
+              ? null
+              : TokenFactory.tokenFromKeyword(Keyword.FINALLY),
+          finallyClause);
+
+  static FunctionTypeAlias typeAlias(TypeName returnType, String name,
+          TypeParameterList typeParameters, FormalParameterList parameters) =>
+      new FunctionTypeAlias(
+          null,
+          null,
+          TokenFactory.tokenFromKeyword(Keyword.TYPEDEF),
+          returnType,
+          identifier3(name),
+          typeParameters,
+          parameters,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static TypeArgumentList typeArgumentList(List<TypeName> typeNames) {
+    if (typeNames == null || typeNames.length == 0) {
+      return null;
+    }
+    return new TypeArgumentList(TokenFactory.tokenFromType(TokenType.LT),
+        typeNames, TokenFactory.tokenFromType(TokenType.GT));
+  }
+
+  /**
+   * Create a type name whose name has been resolved to the given [element] and
+   * whose type has been resolved to the type of the given element.
+   *
+   * <b>Note:</b> This method does not correctly handle class elements that have
+   * type parameters.
+   */
+  static TypeName typeName(ClassElement element, [List<TypeName> arguments]) {
+    SimpleIdentifier name = identifier3(element.name);
+    name.staticElement = element;
+    TypeName typeName = typeName3(name, arguments);
+    typeName.type = element.type;
+    return typeName;
+  }
+
+  static TypeName typeName3(Identifier name, [List<TypeName> arguments]) =>
+      new TypeName(name, typeArgumentList(arguments));
+
+  static TypeName typeName4(String name, [List<TypeName> arguments]) =>
+      new TypeName(identifier3(name), typeArgumentList(arguments));
+
+  static TypeParameter typeParameter(String name) =>
+      new TypeParameter(null, null, identifier3(name), null, null);
+
+  static TypeParameter typeParameter2(String name, TypeName bound) =>
+      new TypeParameter(null, null, identifier3(name),
+          TokenFactory.tokenFromKeyword(Keyword.EXTENDS), bound);
+
+  static TypeParameterList typeParameterList([List<String> typeNames]) {
+    List<TypeParameter> typeParameters = null;
+    if (typeNames != null && !typeNames.isEmpty) {
+      typeParameters = new List<TypeParameter>();
+      for (String typeName in typeNames) {
+        typeParameters.add(typeParameter(typeName));
+      }
+    }
+    return new TypeParameterList(TokenFactory.tokenFromType(TokenType.LT),
+        typeParameters, TokenFactory.tokenFromType(TokenType.GT));
+  }
+
+  static VariableDeclaration variableDeclaration(String name) =>
+      new VariableDeclaration(identifier3(name), null, null);
+
+  static VariableDeclaration variableDeclaration2(
+          String name, Expression initializer) =>
+      new VariableDeclaration(identifier3(name),
+          TokenFactory.tokenFromType(TokenType.EQ), initializer);
+
+  static VariableDeclarationList variableDeclarationList(Keyword keyword,
+          TypeName type, List<VariableDeclaration> variables) =>
+      new VariableDeclarationList(
+          null,
+          null,
+          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
+          type,
+          variables);
+
+  static VariableDeclarationList variableDeclarationList2(
+          Keyword keyword, List<VariableDeclaration> variables) =>
+      variableDeclarationList(keyword, null, variables);
+
+  static VariableDeclarationStatement variableDeclarationStatement(
+          Keyword keyword,
+          TypeName type,
+          List<VariableDeclaration> variables) =>
+      new VariableDeclarationStatement(
+          variableDeclarationList(keyword, type, variables),
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static VariableDeclarationStatement variableDeclarationStatement2(
+          Keyword keyword, List<VariableDeclaration> variables) =>
+      variableDeclarationStatement(keyword, null, variables);
+
+  static WhileStatement whileStatement(Expression condition, Statement body) =>
+      new WhileStatement(
+          TokenFactory.tokenFromKeyword(Keyword.WHILE),
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          condition,
+          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+          body);
+
+  static WithClause withClause(List<TypeName> types) =>
+      new WithClause(TokenFactory.tokenFromKeyword(Keyword.WITH), types);
+
+  static YieldStatement yieldEachStatement(Expression expression) =>
+      new YieldStatement(
+          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "yield"),
+          TokenFactory.tokenFromType(TokenType.STAR),
+          expression,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
+  static YieldStatement yieldStatement(Expression expression) =>
+      new YieldStatement(
+          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "yield"),
+          null,
+          expression,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
+}
diff --git a/pkg/analyzer/lib/src/generated/testing/element_factory.dart b/pkg/analyzer/lib/src/generated/testing/element_factory.dart
index 2075999..9069137 100644
--- a/pkg/analyzer/lib/src/generated/testing/element_factory.dart
+++ b/pkg/analyzer/lib/src/generated/testing/element_factory.dart
@@ -16,7 +16,7 @@
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/source.dart';
-import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
 import 'package:analyzer/src/generated/utilities_dart.dart';
 import 'package:path/path.dart';
 
@@ -98,8 +98,8 @@
         constructor.nameEnd = definingClass.name.length + name.length + 1;
       }
     }
-    constructor.synthetic = name == null;
-    constructor.const2 = isConst;
+    constructor.isSynthetic = name == null;
+    constructor.isConst = isConst;
     if (argumentTypes != null) {
       int count = argumentTypes.length;
       List<ParameterElement> parameters = new List<ParameterElement>(count);
@@ -140,17 +140,17 @@
     InterfaceType stringType = typeProvider.stringType;
     String indexFieldName = "index";
     FieldElementImpl indexField = new FieldElementImpl(indexFieldName, -1);
-    indexField.final2 = true;
+    indexField.isFinal = true;
     indexField.type = intType;
     fields.add(indexField);
     String nameFieldName = "_name";
     FieldElementImpl nameField = new FieldElementImpl(nameFieldName, -1);
-    nameField.final2 = true;
+    nameField.isFinal = true;
     nameField.type = stringType;
     fields.add(nameField);
     FieldElementImpl valuesField = new FieldElementImpl("values", -1);
-    valuesField.static = true;
-    valuesField.const3 = true;
+    valuesField.isStatic = true;
+    valuesField.isConst = true;
     valuesField.type = typeProvider.listType.instantiate(<DartType>[enumType]);
     fields.add(valuesField);
     //
@@ -162,8 +162,8 @@
         String constantName = constantNames[i];
         FieldElementImpl constantElement =
             new ConstFieldElementImpl(constantName, -1);
-        constantElement.static = true;
-        constantElement.const3 = true;
+        constantElement.isStatic = true;
+        constantElement.isConst = true;
         constantElement.type = enumType;
         HashMap<String, DartObjectImpl> fieldMap =
             new HashMap<String, DartObjectImpl>();
@@ -199,9 +199,9 @@
     FieldElementImpl field = isConst
         ? new ConstFieldElementImpl(name, 0)
         : new FieldElementImpl(name, 0);
-    field.const3 = isConst;
-    field.final2 = isFinal;
-    field.static = isStatic;
+    field.isConst = isConst;
+    field.isFinal = isFinal;
+    field.isStatic = isStatic;
     field.type = type;
     if (isConst) {
       (field as ConstFieldElementImpl).constantInitializer = initializer;
@@ -391,17 +391,17 @@
   static PropertyAccessorElementImpl getterElement(
       String name, bool isStatic, DartType type) {
     FieldElementImpl field = new FieldElementImpl(name, -1);
-    field.static = isStatic;
-    field.synthetic = true;
+    field.isStatic = isStatic;
+    field.isSynthetic = true;
     field.type = type;
-    field.final2 = true;
+    field.isFinal = true;
     PropertyAccessorElementImpl getter =
         new PropertyAccessorElementImpl(name, 0);
-    getter.synthetic = false;
+    getter.isSynthetic = false;
     getter.getter = true;
     getter.variable = field;
     getter.returnType = type;
-    getter.static = isStatic;
+    getter.isStatic = isStatic;
     field.getter = getter;
     FunctionTypeImpl getterType = new FunctionTypeImpl(getter);
     getter.type = getterType;
@@ -526,8 +526,8 @@
   static PropertyAccessorElementImpl setterElement(
       String name, bool isStatic, DartType type) {
     FieldElementImpl field = new FieldElementImpl(name, -1);
-    field.static = isStatic;
-    field.synthetic = true;
+    field.isStatic = isStatic;
+    field.isSynthetic = true;
     field.type = type;
     PropertyAccessorElementImpl getter =
         new PropertyAccessorElementImpl(name, -1);
@@ -541,7 +541,7 @@
     PropertyAccessorElementImpl setter =
         new PropertyAccessorElementImpl(name, -1);
     setter.setter = true;
-    setter.synthetic = true;
+    setter.isSynthetic = true;
     setter.variable = field;
     setter.parameters = <ParameterElement>[parameter];
     setter.returnType = VoidTypeImpl.instance;
@@ -562,10 +562,10 @@
     if (isConst) {
       ConstTopLevelVariableElementImpl constant =
           new ConstTopLevelVariableElementImpl.forNode(
-              AstFactory.identifier3(name));
+              AstTestFactory.identifier3(name));
       InstanceCreationExpression initializer =
-          AstFactory.instanceCreationExpression2(
-              Keyword.CONST, AstFactory.typeName(type.element));
+          AstTestFactory.instanceCreationExpression2(
+              Keyword.CONST, AstTestFactory.typeName(type.element));
       if (type is InterfaceType) {
         ConstructorElement element = type.element.unnamedConstructor;
         initializer.staticElement = element;
@@ -576,9 +576,9 @@
     } else {
       variable = new TopLevelVariableElementImpl(name, -1);
     }
-    variable.const3 = isConst;
-    variable.final2 = isFinal;
-    variable.synthetic = false;
+    variable.isConst = isConst;
+    variable.isFinal = isFinal;
+    variable.isSynthetic = false;
     variable.type = type;
     new PropertyAccessorElementImpl_ImplicitGetter(variable);
     if (!isConst && !isFinal) {
diff --git a/pkg/analyzer/lib/src/generated/testing/test_type_provider.dart b/pkg/analyzer/lib/src/generated/testing/test_type_provider.dart
index 6a36a8b..953dcee 100644
--- a/pkg/analyzer/lib/src/generated/testing/test_type_provider.dart
+++ b/pkg/analyzer/lib/src/generated/testing/test_type_provider.dart
@@ -15,7 +15,7 @@
 import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/sdk.dart' show DartSdk;
 import 'package:analyzer/src/generated/source.dart' show Source;
-import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
 import 'package:analyzer/src/generated/testing/element_factory.dart';
 
 /**
@@ -172,7 +172,7 @@
         ElementFactory.requiredParameter2("name", stringType),
         ElementFactory.namedParameter3("defaultValue",
             type: _boolType,
-            initializer: AstFactory.booleanLiteral(false),
+            initializer: AstTestFactory.booleanLiteral(false),
             initializerCode: 'false')
       ];
       fromEnvironment.factory = true;
@@ -205,8 +205,8 @@
           .constructorElement(deprecatedElement, '', true, [stringType]);
       (constructor.parameters[0] as ParameterElementImpl).name = 'expires';
       ConstructorFieldInitializer expiresInit =
-          AstFactory.constructorFieldInitializer(
-              true, 'expires', AstFactory.identifier3('expires'));
+          AstTestFactory.constructorFieldInitializer(
+              true, 'expires', AstTestFactory.identifier3('expires'));
       expiresInit.fieldName.staticElement = expiresField;
       (expiresInit.expression as SimpleIdentifier).staticElement =
           constructor.parameters[0];
@@ -269,7 +269,7 @@
       CompilationUnitElementImpl asyncUnit =
           new CompilationUnitElementImpl("async.dart");
       LibraryElementImpl asyncLibrary = new LibraryElementImpl.forNode(
-          _context, AstFactory.libraryIdentifier2(["dart.async"]));
+          _context, AstTestFactory.libraryIdentifier2(["dart.async"]));
       asyncLibrary.definingCompilationUnit = asyncUnit;
       asyncUnit.librarySource = asyncUnit.source = asyncSource;
 
@@ -516,7 +516,7 @@
       ClassElementImpl typeClass = ElementFactory.classElement2("Type");
       typeClass.constructors = <ConstructorElement>[
         ElementFactory.constructorElement(typeClass, null, false)
-          ..synthetic = true
+          ..isSynthetic = true
       ];
       _typeType = typeClass.type;
     }
@@ -611,30 +611,30 @@
     fromEnvironment.isCycleFree = true;
     numElement.constructors = <ConstructorElement>[
       ElementFactory.constructorElement(numElement, null, false)
-        ..synthetic = true
+        ..isSynthetic = true
     ];
     intElement.constructors = <ConstructorElement>[fromEnvironment];
     doubleElement.constructors = <ConstructorElement>[
       ElementFactory.constructorElement(doubleElement, null, false)
-        ..synthetic = true
+        ..isSynthetic = true
     ];
     ConstFieldElementImpl varINFINITY = ElementFactory.fieldElement(
         "INFINITY", true, false, true, _doubleType,
-        initializer: AstFactory.doubleLiteral(double.INFINITY));
-    varINFINITY.constantInitializer = AstFactory.binaryExpression(
-        AstFactory.integer(1), TokenType.SLASH, AstFactory.integer(0));
+        initializer: AstTestFactory.doubleLiteral(double.INFINITY));
+    varINFINITY.constantInitializer = AstTestFactory.binaryExpression(
+        AstTestFactory.integer(1), TokenType.SLASH, AstTestFactory.integer(0));
     List<FieldElement> fields = <FieldElement>[
       ElementFactory.fieldElement("NAN", true, false, true, _doubleType,
-          initializer: AstFactory.doubleLiteral(double.NAN)),
+          initializer: AstTestFactory.doubleLiteral(double.NAN)),
       varINFINITY,
       ElementFactory.fieldElement(
           "NEGATIVE_INFINITY", true, false, true, _doubleType,
-          initializer: AstFactory.doubleLiteral(double.NEGATIVE_INFINITY)),
+          initializer: AstTestFactory.doubleLiteral(double.NEGATIVE_INFINITY)),
       ElementFactory.fieldElement(
           "MIN_POSITIVE", true, false, true, _doubleType,
-          initializer: AstFactory.doubleLiteral(double.MIN_POSITIVE)),
+          initializer: AstTestFactory.doubleLiteral(double.MIN_POSITIVE)),
       ElementFactory.fieldElement("MAX_FINITE", true, false, true, _doubleType,
-          initializer: AstFactory.doubleLiteral(double.MAX_FINITE))
+          initializer: AstTestFactory.doubleLiteral(double.MAX_FINITE))
     ];
     doubleElement.fields = fields;
     int fieldCount = fields.length;
diff --git a/pkg/analyzer/lib/src/generated/type_system.dart b/pkg/analyzer/lib/src/generated/type_system.dart
index 5574aed..2f42296 100644
--- a/pkg/analyzer/lib/src/generated/type_system.dart
+++ b/pkg/analyzer/lib/src/generated/type_system.dart
@@ -13,6 +13,7 @@
 import 'package:analyzer/dart/element/type.dart';
 import 'package:analyzer/error/listener.dart' show ErrorReporter;
 import 'package:analyzer/src/dart/element/element.dart';
+import 'package:analyzer/src/dart/element/member.dart' show TypeParameterMember;
 import 'package:analyzer/src/dart/element/type.dart';
 import 'package:analyzer/src/error/codes.dart' show StrongModeCode;
 import 'package:analyzer/src/generated/engine.dart'
@@ -170,7 +171,7 @@
   }
 
   @override
-  bool canPromoteToType(DartType to, DartType from) {
+  DartType tryPromoteToType(DartType to, DartType from) {
     // Allow promoting to a subtype, for example:
     //
     //     f(Base b) {
@@ -182,25 +183,17 @@
     // This allows the variable to be used wherever the supertype (here `Base`)
     // is expected, while gaining a more precise type.
     if (isSubtypeOf(to, from)) {
-      return true;
+      return to;
     }
-    // For a type parameter `T extends U`, allow promoting from the upper bound
-    // `U` to `S` where `S <: U`.
-    //
-    // This does restrict the variable, because `S </: T`, it can no longer be
-    // used as a `T` without another cast.
-    //
-    // However the members you could access from a variable of type `T`, were
-    // already those on the upper bound `U`. So all members on `U` will be
-    // accessible, as well as those on `S`. Pragmatically this feels like a
-    // useful enough trade-off to allow promotion.
-    //
-    // (In general we would need union types to support this feature precisely.)
+    // For a type parameter `T extends U`, allow promoting the upper bound
+    // `U` to `S` where `S <: U`, yielding a type parameter `T extends S`.
     if (from is TypeParameterType) {
-      return isSubtypeOf(to, from.resolveToBound(DynamicTypeImpl.instance));
+      if (isSubtypeOf(to, from.resolveToBound(DynamicTypeImpl.instance))) {
+        return new TypeParameterMember(from.element, null, to).type;
+      }
     }
 
-    return false;
+    return null;
   }
 
   @override
@@ -226,7 +219,7 @@
 
     List<ParameterElement> parameters = t.parameters.map(shave).toList();
     FunctionElementImpl function = new FunctionElementImpl("", -1);
-    function.synthetic = true;
+    function.isSynthetic = true;
     function.returnType = t.returnType;
     function.shareTypeParameters(t.typeFormals);
     function.shareParameters(parameters);
@@ -419,16 +412,6 @@
         new _StrongInferenceTypeSystem(typeProvider, this, typeFormals);
 
     if (returnContextType != null) {
-      // If we're in a future union context, choose either the Future<T>
-      // or the T based on the declared return type.
-      if (returnContextType is FutureUnionType) {
-        var futureUnion = returnContextType as FutureUnionType;
-        returnContextType =
-            isSubtypeOf(declaredReturnType, typeProvider.futureDynamicType)
-                ? futureUnion.futureOfType
-                : futureUnion.type;
-      }
-
       inferringTypeSystem.isSubtypeOf(declaredReturnType, returnContextType);
     }
 
@@ -851,7 +834,7 @@
     if (identical(i1, i2)) {
       return true;
     }
-    
+
     // Guard recursive calls
     _GuardedSubtypeChecker<InterfaceType> guardedInterfaceSubtype = _guard(
         (DartType i1, DartType i2, Set<Element> visited) =>
@@ -932,7 +915,9 @@
     //  True if T == S
     //  Or true if bound of S is S' and S' <: T
     if (t1 is TypeParameterType) {
-      if (t1 == t2) {
+      if (t2 is TypeParameterType &&
+          t1.definition == t2.definition &&
+          guardedSubtype(t1.bound, t2.bound, visited)) {
         return true;
       }
       if (guardedInferTypeParameter(t1, t2, visited)) {
@@ -946,6 +931,19 @@
       return guardedInferTypeParameter(t1, t2, visited);
     }
 
+    if (t1 is FutureUnionType) {
+      // given t1 is Future<A> | A, then:
+      // (Future<A> | A) <: t2 iff t2 <: Future<A> and t2 <: A.
+      return guardedSubtype(t1.futureOfType, t2, visited) &&
+          guardedSubtype(t1.type, t2, visited);
+    }
+    if (t2 is FutureUnionType) {
+      // given t2 is Future<A> | A, then:
+      // t1 <: (Future<A> | A) iff t1 <: Future<A> or t1 <: A
+      return guardedSubtype(t1, t2.futureOfType, visited) ||
+          guardedSubtype(t1, t2.type, visited);
+    }
+
     // Void only appears as the return type of a function, and we handle it
     // directly in the function subtype rules. We should not get to a point
     // where we're doing a subtype test on a "bare" void, but just in case we
@@ -1048,15 +1046,18 @@
  */
 abstract class TypeSystem {
   /**
-   * Returns `true` if we can promote to the first type from the second type.
+   * Tries to promote from the first type from the second type, and returns the
+   * promoted type if it succeeds, otherwise null.
    *
-   * In the standard Dart type system, it is not possible to promote from or to
+   * In the Dart 1 type system, it is not possible to promote from or to
    * `dynamic`, and we must be promoting to a more specific type, see
-   * [isMoreSpecificThan].
+   * [isMoreSpecificThan]. Also it will always return the promote [to] type or
+   * null.
    *
-   * In strong mode, this is equivalent to [isSubtypeOf].
+   * In strong mode, this can potentially return a different type, see
+   * the override in [StrongTypeSystemImpl].
    */
-  bool canPromoteToType(DartType to, DartType from);
+  DartType tryPromoteToType(DartType to, DartType from);
 
   /**
    * Make a function type concrete.
@@ -1422,11 +1423,15 @@
   TypeSystemImpl();
 
   @override
-  bool canPromoteToType(DartType to, DartType from) {
+  DartType tryPromoteToType(DartType to, DartType from) {
     // Declared type should not be "dynamic".
     // Promoted type should not be "dynamic".
     // Promoted type should be more specific than declared.
-    return !from.isDynamic && !to.isDynamic && to.isMoreSpecificThan(from);
+    if (!from.isDynamic && !to.isDynamic && to.isMoreSpecificThan(from)) {
+      return to;
+    } else {
+      return null;
+    }
   }
 
   @override
@@ -1578,6 +1583,39 @@
       DartType lowerBound = bound.lower;
       DartType upperBound = bound.upper;
 
+      // Collapse future unions if we inferred them somehow.
+      //
+      // TODO(jmesserly): in our initial upward phase it would be fine to
+      // keep the FutureUnionType for the argument downward context.
+      //
+      // We need to track in `inferGenericFunctionCall` whether we are going up
+      // or down. This would also allow for an improved heuristic: if we are
+      // doing our final inference, the downward context can take priority.
+      if (lowerBound is FutureUnionType) {
+        // lowerBound <: T, where lowerBound is Future<A> | A.
+        // So we choose lowerBound as LUB(A, Future<A>).
+        //
+        // This will typically lead to top with the current rules, but it will
+        // work with `bottom` or if we remove Future flattening.
+        var f = lowerBound as FutureUnionType;
+        lowerBound = _typeSystem.getLeastUpperBound(
+            _typeProvider, f.futureOfType, f.type);
+      }
+      if (upperBound is FutureUnionType) {
+        // T <: upperBound, where upperBound is Future<A> | A.
+        // Therefore we need T <: Future<A> or T <: A.
+        //
+        // This is just an arbitrarily heuristic.
+        var f = upperBound as FutureUnionType;
+        if (_typeSystem.isSubtypeOf(lowerBound, f.type)) {
+          upperBound = f.type;
+        } else if (_typeSystem.isSubtypeOf(lowerBound, f.futureOfType)) {
+          upperBound = f.futureOfType;
+        } else {
+          upperBound = f.type;
+        }
+      }
+
       // See if the bounds can be satisfied.
       // TODO(jmesserly): also we should have an error for unconstrained type
       // parameters, rather than silently inferring dynamic.
diff --git a/pkg/analyzer/lib/src/generated/utilities_general.dart b/pkg/analyzer/lib/src/generated/utilities_general.dart
index b9dca93..d13ad35 100644
--- a/pkg/analyzer/lib/src/generated/utilities_general.dart
+++ b/pkg/analyzer/lib/src/generated/utilities_general.dart
@@ -7,6 +7,8 @@
 import 'dart:collection';
 import 'dart:developer' show UserTag;
 
+export 'package:front_end/src/base/jenkins_smi_hash.dart' show JenkinsSmiHash;
+
 /**
  * Test if the given [value] is `false` or the string "false" (case-insensitive).
  */
@@ -50,31 +52,6 @@
 String toUpperCase(Object value) => value?.toString()?.toUpperCase();
 
 /**
- * Jenkins hash function, optimized for small integers.
- * Borrowed from sdk/lib/math/jenkins_smi_hash.dart.
- */
-class JenkinsSmiHash {
-  static int combine(int hash, int value) {
-    hash = 0x1fffffff & (hash + value);
-    hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
-    return hash ^ (hash >> 6);
-  }
-
-  static int finish(int hash) {
-    hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
-    hash = hash ^ (hash >> 11);
-    return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
-  }
-
-  static int hash2(a, b) => finish(combine(combine(0, a), b));
-
-  static int hash3(a, b, c) => finish(combine(combine(combine(0, a), b), c));
-
-  static int hash4(a, b, c, d) =>
-      finish(combine(combine(combine(combine(0, a), b), c), d));
-}
-
-/**
  * A simple limited queue.
  */
 class LimitedQueue<E> extends ListQueue<E> {
diff --git a/pkg/analyzer/lib/src/html/error/html_codes.dart b/pkg/analyzer/lib/src/html/error/html_codes.dart
new file mode 100644
index 0000000..1af2fcf
--- /dev/null
+++ b/pkg/analyzer/lib/src/html/error/html_codes.dart
@@ -0,0 +1,82 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analyzer.src.html.error.lint_codes;
+
+import 'package:analyzer/error/error.dart';
+
+/**
+ * The error codes used for errors in HTML files. The convention for this
+ * class is for the name of the error code to indicate the problem that caused
+ * the error to be generated and for the error message to explain what is wrong
+ * and, when appropriate, how the problem can be corrected.
+ */
+class HtmlErrorCode extends ErrorCode {
+  /**
+   * An error code indicating that there is a syntactic error in the file.
+   *
+   * Parameters:
+   * 0: the error message from the parse error
+   */
+  static const HtmlErrorCode PARSE_ERROR =
+      const HtmlErrorCode('PARSE_ERROR', '{0}');
+
+  /**
+   * Initialize a newly created error code to have the given [name]. The message
+   * associated with the error will be created from the given [message]
+   * template. The correction associated with the error will be created from the
+   * given [correction] template.
+   */
+  const HtmlErrorCode(String name, String message, [String correction])
+      : super(name, message, correction);
+
+  @override
+  ErrorSeverity get errorSeverity => ErrorSeverity.ERROR;
+
+  @override
+  ErrorType get type => ErrorType.COMPILE_TIME_ERROR;
+}
+
+/**
+ * The error codes used for warnings in HTML files. The convention for this
+ * class is for the name of the error code to indicate the problem that caused
+ * the error to be generated and for the error message to explain what is wrong
+ * and, when appropriate, how the problem can be corrected.
+ */
+class HtmlWarningCode extends ErrorCode {
+  /**
+   * An error code indicating that the value of the 'src' attribute of a Dart
+   * script tag is not a valid URI.
+   *
+   * Parameters:
+   * 0: the URI that is invalid
+   */
+  static const HtmlWarningCode INVALID_URI =
+      const HtmlWarningCode('INVALID_URI', "Invalid URI syntax: '{0}'.");
+
+  /**
+   * An error code indicating that the value of the 'src' attribute of a Dart
+   * script tag references a file that does not exist.
+   *
+   * Parameters:
+   * 0: the URI pointing to a non-existent file
+   */
+  static const HtmlWarningCode URI_DOES_NOT_EXIST = const HtmlWarningCode(
+      'URI_DOES_NOT_EXIST', "Target of URI doesn't exist: '{0}'.");
+
+  /**
+   * Initialize a newly created error code to have the given [name]. The message
+   * associated with the error will be created from the given [message]
+   * template. The correction associated with the error will be created from the
+   * given [correction] template.
+   */
+  const HtmlWarningCode(String name, String message, [String correction])
+      : super(name, message, correction);
+
+  @override
+  ErrorSeverity get errorSeverity => ErrorSeverity.WARNING;
+
+  @override
+  ErrorType get type => ErrorType.STATIC_WARNING;
+}
diff --git a/pkg/analyzer/lib/src/services/lint.dart b/pkg/analyzer/lib/src/services/lint.dart
index 795b032..097a8df 100644
--- a/pkg/analyzer/lib/src/services/lint.dart
+++ b/pkg/analyzer/lib/src/services/lint.dart
@@ -9,15 +9,6 @@
 import 'package:analyzer/dart/ast/ast.dart';
 import 'package:analyzer/error/listener.dart';
 import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/task/model.dart';
-import 'package:analyzer/task/model.dart';
-
-const List<Linter> _noLints = const <Linter>[];
-
-/// The descriptor used to associate lints with analysis contexts in
-/// configuration data.
-final ResultDescriptor<List<Linter>> CONFIGURED_LINTS_KEY =
-    new ResultDescriptorImpl('configured.lints', _noLints);
 
 /// Shared lint registry.
 LintRegistry lintRegistry = new LintRegistry();
@@ -25,11 +16,14 @@
 /// Return lints associated with this [context], or an empty list if there are
 /// none.
 List<Linter> getLints(AnalysisContext context) =>
-    context.getConfigurationData(CONFIGURED_LINTS_KEY) ?? _noLints;
+    context.analysisOptions.lintRules;
 
 /// Associate these [lints] with the given [context].
 void setLints(AnalysisContext context, List<Linter> lints) {
-  context.setConfigurationData(CONFIGURED_LINTS_KEY, lints);
+  AnalysisOptionsImpl options =
+      new AnalysisOptionsImpl.from(context.analysisOptions);
+  options.lintRules = lints;
+  context.analysisOptions = options;
 }
 
 /// Implementers contribute lint warnings via the provided error [reporter].
diff --git a/pkg/analyzer/lib/src/summary/api_signature.dart b/pkg/analyzer/lib/src/summary/api_signature.dart
index f2fd506..d8c29c6 100644
--- a/pkg/analyzer/lib/src/summary/api_signature.dart
+++ b/pkg/analyzer/lib/src/summary/api_signature.dart
@@ -72,10 +72,12 @@
    * `addBytes([1]); addBytes([2]);`.
    */
   void addBytes(List<int> bytes) {
-    _makeRoom(bytes.length);
-    new Uint8List.view(_data.buffer)
-        .setRange(_offset, _offset + bytes.length, bytes);
-    _offset += bytes.length;
+    int length = bytes.length;
+    _makeRoom(length);
+    for (int i = 0; i < length; i++) {
+      _data.setUint8(_offset + i, bytes[i]);
+    }
+    _offset += length;
   }
 
   /**
@@ -106,6 +108,13 @@
   }
 
   /**
+   * Collect the given [Uint32List].
+   */
+  void addUint32List(Uint32List data) {
+    addBytes(data.buffer.asUint8List());
+  }
+
+  /**
    * For testing only: retrieve the internal representation of the data that
    * has been collected.
    */
@@ -114,11 +123,17 @@
   }
 
   /**
+   * Return the bytes of the MD5 hash of the data collected so far.
+   */
+  List<int> toByteList() {
+    return md5.convert(new Uint8List.view(_data.buffer, 0, _offset)).bytes;
+  }
+
+  /**
    * Return a hex-encoded MD5 signature of the data collected so far.
    */
   String toHex() {
-    return hex.encode(
-        md5.convert(new Uint8List.view(_data.buffer, 0, _offset)).bytes);
+    return hex.encode(toByteList());
   }
 
   /**
diff --git a/pkg/analyzer/lib/src/summary/bazel_summary.dart b/pkg/analyzer/lib/src/summary/bazel_summary.dart
index f307395..a7b9b88 100644
--- a/pkg/analyzer/lib/src/summary/bazel_summary.dart
+++ b/pkg/analyzer/lib/src/summary/bazel_summary.dart
@@ -8,79 +8,143 @@
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/utilities_collection.dart';
+import 'package:analyzer/src/summary/api_signature.dart';
+import 'package:analyzer/src/summary/format.dart';
 import 'package:analyzer/src/summary/idl.dart';
+import 'package:analyzer/src/summary/link.dart';
+import 'package:analyzer/src/summary/package_bundle_reader.dart';
+import 'package:analyzer/src/summary/summarize_elements.dart';
+import 'package:analyzer/src/util/fast_uri.dart';
 import 'package:convert/convert.dart';
 import 'package:crypto/crypto.dart';
 import 'package:meta/meta.dart';
 
 /**
- * Return the path of the directory where bundles for the given [uri] should be
- * looked for.  This directory should contain corresponding pairs of `*.api.ds`
- * and `*.full.ds` files, possibly more than one pair.  Return `null` if the
- * given [uri] does not have the expected structure, so the output path cannot
- * be computed.
+ * Return the [Folder] where bundles for the given [absoluteUri] should be
+ * looked for. This folder should contain corresponding `*.full.ds` files,
+ * possibly more than one one.  Return `null` if the given [absoluteUri]
+ * does not have the expected structure, so the output path cannot be computed.
  */
-typedef String GetOutputPath(ResourceProvider provider, Uri uri);
+typedef Folder GetOutputFolder(Uri absoluteUri);
+
+/**
+ * Load linked packages on demand from [SummaryProvider].
+ */
+class BazelResultProvider extends ResynthesizerResultProvider {
+  final SummaryDataStore dataStore;
+  final SummaryProvider summaryProvider;
+
+  final Map<Source, bool> sourceToSuccessMap = <Source, bool>{};
+  final Set<Package> addedPackages = new Set<Package>();
+
+  factory BazelResultProvider(SummaryProvider summaryProvider) {
+    SummaryDataStore dataStore = new SummaryDataStore(const <String>[]);
+    return new BazelResultProvider._(dataStore, summaryProvider);
+  }
+
+  BazelResultProvider._(
+      SummaryDataStore dataStore, SummaryProvider summaryProvider)
+      : dataStore = dataStore,
+        summaryProvider = summaryProvider,
+        super(summaryProvider.context, dataStore) {
+    AnalysisContext sdkContext = context.sourceFactory.dartSdk.context;
+    createResynthesizer(sdkContext, sdkContext.typeProvider);
+  }
+
+  @override
+  bool hasResultsForSource(Source source) {
+    return sourceToSuccessMap.putIfAbsent(source, () {
+      List<Package> packages = summaryProvider.getLinkedPackages(source);
+      if (packages == null) {
+        return false;
+      }
+      for (Package package in packages) {
+        if (addedPackages.add(package)) {
+          dataStore.addBundle(null, package.unlinked);
+          dataStore.addBundle(null, package.linked);
+        }
+      }
+      String uriString = source.uri.toString();
+      return resynthesizer.hasLibrarySummary(uriString);
+    });
+  }
+}
 
 /**
  * Information about a Dart package in Bazel.
  */
 class Package {
-  final String bundlePath;
-  final PackageBundle bundle;
+  final File unlinkedFile;
+  final PackageBundle unlinked;
   final Set<String> _unitUris = new Set<String>();
 
-  Package(this.bundlePath, this.bundle) {
-    _unitUris.addAll(bundle.unlinkedUnitUris);
+  PackageBundle _linked;
+
+  Package(this.unlinkedFile, this.unlinked) {
+    _unitUris.addAll(unlinked.unlinkedUnitUris);
   }
+
+  PackageBundle get linked => _linked;
+
+  @override
+  String toString() => '$unlinkedFile';
 }
 
 /**
  * Class that reads summaries of Bazel packages.
  *
  * When the client needs to produce a resolution result for a new [Source], it
- * should call [getPackages] to checked whether there is the set of packages
- * to resynthesize resolution results.
+ * should call [getLinkedPackages] to check whether there is the set of
+ * packages to resynthesize resolution results.
  */
 class SummaryProvider {
   final ResourceProvider provider;
-  final GetOutputPath getOutputPath;
+  final String tempFileName;
+  final GetOutputFolder getOutputFolder;
+  final Folder linkedCacheFolder;
   final AnalysisContext context;
+  final PackageBundle sdkBundle;
+
+  /**
+   * If `true` (by default), then linking new bundles is allowed.
+   * Otherwise only using existing cached bundles can be used.
+   */
+  final bool allowLinking;
+
+  /**
+   * See [PackageBundleAssembler.currentMajorVersion].
+   */
+  final int majorVersion;
 
   /**
    * Mapping from bundle paths to corresponding [Package]s.  The packages in
    * the map were consistent with their constituent sources at the moment when
    * they were put into the map.
    */
-  final Map<String, Package> bundlePathToPackageMap = <String, Package>{};
+  final Map<Folder, List<Package>> folderToPackagesMap = {};
 
   /**
-   * When we detected than some bundle is not consistent with its constituent
-   * sources (i.e. even its unlinked state is not consistent), we remember
-   * this fact to avoid loading and checking consistency next time.
+   * Mapping from [Uri]s to corresponding [Package]s.
    */
-  final Set<String> knownInconsistentBundlePaths = new Set<String>();
-
-  SummaryProvider(this.provider, this.getOutputPath, this.context);
+  final Map<Uri, Package> uriToPackageMap = {};
 
   /**
-   * Return the [Package] that contains information about the source with
-   * the given [uri], or `null` if such package does not exist.
+   * Mapping from [Package]s to corresponding [_LinkNode]s.
    */
-  @visibleForTesting
-  Package getPackageForUri(Uri uri) {
-    String outputPath = getOutputPath(provider, uri);
-    if (outputPath != null) {
-      List<Package> packages = _getPackages(outputPath);
-      for (Package package in packages) {
-        String uriStr = uri.toString();
-        if (package._unitUris.contains(uriStr)) {
-          return package;
-        }
-      }
-    }
-    return null;
-  }
+  final Map<Package, _LinkNode> packageToNodeMap = {};
+
+  SummaryProvider(
+      this.provider,
+      this.tempFileName,
+      this.getOutputFolder,
+      this.linkedCacheFolder,
+      AnalysisContext context,
+      {@visibleForTesting
+          this.allowLinking: true,
+      @visibleForTesting
+          this.majorVersion: PackageBundleAssembler.currentMajorVersion})
+      : context = context,
+        sdkBundle = context.sourceFactory.dartSdk?.getLinkedBundle();
 
   /**
    * Return the complete list of [Package]s that are required to provide all
@@ -94,13 +158,64 @@
    * If the full set of packages cannot be produced, for example because some
    * bundles are not built, or out of date, etc, then `null` is returned.
    */
-  List<PackageBundle> getPackages(Source source) {
-    // TODO(scheglov) implement
-    return null;
+  List<Package> getLinkedPackages(Source source) {
+    // Find the node that contains the source.
+    _LinkNode node = _getLinkNodeForUri(source.uri);
+    if (node == null) {
+      return null;
+    }
+
+    // Compute all transitive dependencies.
+    node.computeTransitiveDependencies();
+    List<_LinkNode> nodes = node.transitiveDependencies.toList();
+    nodes.forEach((dependency) => dependency.computeTransitiveDependencies());
+
+    // Fail if any dependency cannot be resolved.
+    if (node.failed) {
+      return null;
+    }
+
+    // Read existing cached linked bundles.
+    for (_LinkNode node in nodes) {
+      _readLinked(node);
+    }
+
+    // Link new packages, if allowed.
+    if (allowLinking) {
+      _link(nodes);
+    }
+
+    // Create successfully linked packages.
+    return nodes
+        .map((node) => node.package)
+        .where((package) => package.linked != null)
+        .toList();
   }
 
   /**
-   * Return the hexadecimal string for the given [source] contents.
+   * Return the [Package] that contains information about the source with
+   * the given [uri], or `null` if such package does not exist.
+   */
+  @visibleForTesting
+  Package getUnlinkedForUri(Uri uri) {
+    return uriToPackageMap.putIfAbsent(uri, () {
+      Folder outputFolder = getOutputFolder(uri);
+      if (outputFolder != null) {
+        String uriStr = uri.toString();
+        List<Package> packages = _getUnlinkedPackages(outputFolder);
+        for (Package package in packages) {
+          if (package._unitUris.contains(uriStr)) {
+            return package;
+          }
+        }
+      }
+      return null;
+    });
+  }
+
+  /**
+   * Return the hexadecimal string of the MD5 hash of the contents of the
+   * given [source] in [context].
    */
   String _computeSourceHashHex(Source source) {
     String text = context.getContents(source).data;
@@ -110,63 +225,60 @@
   }
 
   /**
-   * Return the [Package] from the file with the given [path], or `null` if the
-   * file does not exist, or it cannot be read, or is not consistent with the
-   * sources it contains, etc.
+   * Return the name of the file for a linked bundle, in strong or spec mode.
    */
-  Package _getPackage(String path) {
-    // Check if the bundle know to be inconsistent, missing, etc.
-    if (knownInconsistentBundlePaths.contains(path)) {
-      return null;
-    }
-    // Attempt to get from the cache or read from the file system.
-    try {
-      Package package = bundlePathToPackageMap[path];
-      if (package == null) {
-        File file = provider.getFile(path);
-        List<int> bytes = file.readAsBytesSync();
-        PackageBundle bundle = new PackageBundle.fromBuffer(bytes);
-        // Check for consistency, and fail if it's not.
-        if (!_isUnlinkedBundleConsistent(bundle)) {
-          knownInconsistentBundlePaths.add(path);
-          return null;
-        }
-        // OK, put the package into the cache.
-        package = new Package(path, bundle);
-        bundlePathToPackageMap[path] = package;
-      }
-      return package;
-    } catch (_) {
-      return null;
+  String _getLinkedName(String hash) {
+    if (context.analysisOptions.strongMode) {
+      return 'linked_$hash.ds';
+    } else {
+      return 'linked_spec_$hash.ds';
     }
   }
 
   /**
-   * Return all consistent [Package]s in the given [folderPath].
+   * Return the node for the given [uri], or `null` if there is no unlinked
+   * bundle that contains [uri].
    */
-  List<Package> _getPackages(String folderPath) {
-    List<Package> packages = <Package>[];
-    try {
-      Folder folder = provider.getFolder(folderPath);
-      List<Resource> children = folder.getChildren();
-      for (Resource child in children) {
-        if (child is File) {
-          String packagePath = child.path;
-          if (packagePath.toLowerCase().endsWith('.full.ds')) {
-            Package package = _getPackage(packagePath);
-            if (package != null) {
-              packages.add(package);
+  _LinkNode _getLinkNodeForUri(Uri uri) {
+    Package package = getUnlinkedForUri(uri);
+    return packageToNodeMap.putIfAbsent(package, () {
+      if (package == null) {
+        return null;
+      }
+      return new _LinkNode(this, package);
+    });
+  }
+
+  /**
+   * Return all consistent unlinked [Package]s in the given [folder].  Some of
+   * the returned packages might be already linked.
+   */
+  List<Package> _getUnlinkedPackages(Folder folder) {
+    List<Package> packages = folderToPackagesMap[folder];
+    if (packages == null) {
+      packages = <Package>[];
+      try {
+        List<Resource> children = folder.getChildren();
+        for (Resource child in children) {
+          if (child is File) {
+            String packagePath = child.path;
+            if (packagePath.toLowerCase().endsWith('.full.ds')) {
+              Package package = _readUnlinkedPackage(child);
+              if (package != null) {
+                packages.add(package);
+              }
             }
           }
         }
-      }
-    } on FileSystemException {}
+      } on FileSystemException {}
+      folderToPackagesMap[folder] = packages;
+    }
     return packages;
   }
 
   /**
    * Return `true` if the unlinked information of the [bundle] is consistent
-   * with its constituent sources.
+   * with its constituent sources in [context].
    */
   bool _isUnlinkedBundleConsistent(PackageBundle bundle) {
     try {
@@ -184,8 +296,266 @@
       List<String> bundleHashes = bundle.unlinkedUnitHashes.toList()..sort();
       actualHashes.sort();
       return listsEqual(actualHashes, bundleHashes);
-    } catch (_) {
-      return false;
+    } on FileSystemException {}
+    return false;
+  }
+
+  /**
+   * Link the given [nodes].
+   */
+  void _link(List<_LinkNode> nodes) {
+    // Fill the store with bundles.
+    // Append the linked SDK bundle.
+    // Append unlinked and (if read from a cache) linked package bundles.
+    SummaryDataStore store = new SummaryDataStore(const <String>[]);
+    store.addBundle(null, sdkBundle);
+    for (_LinkNode node in nodes) {
+      store.addBundle(null, node.package.unlinked);
+      if (node.package.linked != null) {
+        store.addBundle(null, node.package.linked);
+      }
+    }
+
+    // Prepare URIs to link.
+    Map<String, _LinkNode> uriToNode = <String, _LinkNode>{};
+    for (_LinkNode node in nodes) {
+      if (!node.isReady) {
+        for (String uri in node.package.unlinked.unlinkedUnitUris) {
+          uriToNode[uri] = node;
+        }
+      }
+    }
+    Set<String> libraryUris = uriToNode.keys.toSet();
+
+    // Perform linking.
+    Map<String, LinkedLibraryBuilder> linkedLibraries =
+        link(libraryUris, (String uri) {
+      return store.linkedMap[uri];
+    }, (String uri) {
+      return store.unlinkedMap[uri];
+    }, context.declaredVariables.get, context.analysisOptions.strongMode);
+
+    // Assemble newly linked bundles.
+    for (_LinkNode node in nodes) {
+      if (!node.isReady) {
+        PackageBundleAssembler assembler = new PackageBundleAssembler();
+        linkedLibraries.forEach((uri, linkedLibrary) {
+          if (identical(uriToNode[uri], node)) {
+            assembler.addLinkedLibrary(uri, linkedLibrary);
+          }
+        });
+        List<int> bytes = assembler.assemble().toBuffer();
+        node.package._linked = new PackageBundle.fromBuffer(bytes);
+        _writeLinked(node, bytes);
+      }
     }
   }
+
+  /**
+   * Attempt to read the linked bundle that corresponds to the given [node]
+   * with all its transitive dependencies.
+   */
+  void _readLinked(_LinkNode node) {
+    String hash = node.linkedHash;
+    if (!node.isReady && hash != null) {
+      String fileName = _getLinkedName(hash);
+      File file = linkedCacheFolder.getChildAssumingFile(fileName);
+      // Try to read from the file system.
+      if (file.exists) {
+        try {
+          List<int> bytes = file.readAsBytesSync();
+          node.package._linked = new PackageBundle.fromBuffer(bytes);
+        } on FileSystemException {
+          // Ignore file system exceptions.
+        }
+      }
+    }
+  }
+
+  /**
+   * Read the unlinked [Package] from the given [file], or return `null` if the
+   * file does not exist, or it cannot be read, or is not consistent with the
+   * constituent sources on the file system.
+   */
+  Package _readUnlinkedPackage(File file) {
+    try {
+      List<int> bytes = file.readAsBytesSync();
+      PackageBundle bundle = new PackageBundle.fromBuffer(bytes);
+      // Check the major version.
+      if (bundle.majorVersion != majorVersion) {
+        return null;
+      }
+      // Check for consistency, and fail if it's not.
+      if (!_isUnlinkedBundleConsistent(bundle)) {
+        return null;
+      }
+      // OK, use the bundle.
+      return new Package(file, bundle);
+    } on FileSystemException {}
+    return null;
+  }
+
+  /**
+   * Atomically write the given [bytes] into the file in the [folder].
+   */
+  void _writeAtomic(Folder folder, String fileName, List<int> bytes) {
+    String filePath = folder.getChildAssumingFile(fileName).path;
+    File tempFile = folder.getChildAssumingFile(tempFileName);
+    tempFile.writeAsBytesSync(bytes);
+    tempFile.renameSync(filePath);
+  }
+
+  /**
+   * If a new linked bundle was linked for the given [node], write the bundle
+   * into the memory cache and the file system.
+   */
+  void _writeLinked(_LinkNode node, List<int> bytes) {
+    String hash = node.linkedHash;
+    if (hash != null) {
+      String fileName = _getLinkedName(hash);
+      _writeAtomic(linkedCacheFolder, fileName, bytes);
+    }
+  }
+}
+
+/**
+ * Information about a single [Package].
+ */
+class _LinkNode {
+  final SummaryProvider linker;
+  final Package package;
+
+  bool failed = false;
+  Set<_LinkNode> transitiveDependencies;
+
+  List<_LinkNode> _dependencies;
+  String _linkedHash;
+
+  _LinkNode(this.linker, this.package);
+
+  /**
+   * Retrieve the dependencies of this node.
+   */
+  List<_LinkNode> get dependencies {
+    if (_dependencies == null) {
+      Set<_LinkNode> dependencies = new Set<_LinkNode>();
+
+      void appendDependency(String uriStr) {
+        Uri uri = FastUri.parse(uriStr);
+        if (!uri.hasScheme) {
+          // A relative path in this package, skip it.
+        } else if (uri.scheme == 'dart') {
+          // Dependency on the SDK is implicit and always added.
+          // The SDK linked bundle is precomputed before linking packages.
+        } else if (uri.scheme == 'package') {
+          _LinkNode packageNode = linker._getLinkNodeForUri(uri);
+          if (packageNode == null) {
+            failed = true;
+          }
+          if (packageNode != null) {
+            dependencies.add(packageNode);
+          }
+        } else {
+          failed = true;
+        }
+      }
+
+      for (UnlinkedUnit unit in package.unlinked.unlinkedUnits) {
+        for (UnlinkedImport import in unit.imports) {
+          if (!import.isImplicit) {
+            appendDependency(import.uri);
+          }
+        }
+        for (UnlinkedExportPublic export in unit.publicNamespace.exports) {
+          appendDependency(export.uri);
+        }
+      }
+
+      _dependencies = dependencies.toList();
+    }
+    return _dependencies;
+  }
+
+  /**
+   * Return `true` is the node is ready - has the linked bundle or failed (does
+   * not have all required dependencies).
+   */
+  bool get isReady => package.linked != null || failed;
+
+  /**
+   * Return the hash string that corresponds to this linked bundle in the
+   * context of its SDK bundle and transitive dependencies.  Return `null` if
+   * the hash computation fails, because for example the full transitive
+   * dependencies cannot computed.
+   */
+  String get linkedHash {
+    if (_linkedHash == null && transitiveDependencies != null && !failed) {
+      ApiSignature signature = new ApiSignature();
+      // Add all unlinked API signatures.
+      List<String> signatures = <String>[];
+      signatures.add(linker.sdkBundle.apiSignature);
+      transitiveDependencies
+          .map((node) => node.package.unlinked.apiSignature)
+          .forEach(signatures.add);
+      signatures.sort();
+      signatures.forEach(signature.addString);
+      // Combine into a single hash.
+      appendDeclaredVariables(signature);
+      _linkedHash = signature.toHex();
+    }
+    return _linkedHash;
+  }
+
+  /**
+   * Append names and values of all referenced declared variables (even the
+   * ones without actually declared values) to the given [signature].
+   */
+  void appendDeclaredVariables(ApiSignature signature) {
+    Set<String> nameSet = new Set<String>();
+    for (_LinkNode node in transitiveDependencies) {
+      for (UnlinkedUnit unit in node.package.unlinked.unlinkedUnits) {
+        for (UnlinkedImport import in unit.imports) {
+          for (UnlinkedConfiguration configuration in import.configurations) {
+            nameSet.add(configuration.name);
+          }
+        }
+        for (UnlinkedExportPublic export in unit.publicNamespace.exports) {
+          for (UnlinkedConfiguration configuration in export.configurations) {
+            nameSet.add(configuration.name);
+          }
+        }
+      }
+    }
+    List<String> sortedNameList = nameSet.toList()..sort();
+    signature.addInt(sortedNameList.length);
+    for (String name in sortedNameList) {
+      signature.addString(name);
+      signature.addString(linker.context.declaredVariables.get(name) ?? '');
+    }
+  }
+
+  /**
+   * Compute the set of existing transitive dependencies for this node.
+   * If any dependency cannot be resolved, then set [failed] to `true`.
+   * Only unlinked bundle is used, so this method can be called before linking.
+   */
+  void computeTransitiveDependencies() {
+    if (transitiveDependencies == null) {
+      transitiveDependencies = new Set<_LinkNode>();
+
+      void appendDependencies(_LinkNode node) {
+        if (transitiveDependencies.add(node)) {
+          node.dependencies.forEach(appendDependencies);
+        }
+      }
+
+      appendDependencies(this);
+      if (transitiveDependencies.any((node) => node.failed)) {
+        failed = true;
+      }
+    }
+  }
+
+  @override
+  String toString() => package.toString();
 }
diff --git a/pkg/analyzer/lib/src/summary/format.dart b/pkg/analyzer/lib/src/summary/format.dart
index 2f7fc97..c38e50b 100644
--- a/pkg/analyzer/lib/src/summary/format.dart
+++ b/pkg/analyzer/lib/src/summary/format.dart
@@ -64,19 +64,6 @@
   }
 }
 
-class _UnlinkedConstOperationReader extends fb.Reader<idl.UnlinkedConstOperation> {
-  const _UnlinkedConstOperationReader() : super();
-
-  @override
-  int get size => 1;
-
-  @override
-  idl.UnlinkedConstOperation read(fb.BufferContext bc, int offset) {
-    int index = const fb.Uint8Reader().read(bc, offset);
-    return index < idl.UnlinkedConstOperation.values.length ? idl.UnlinkedConstOperation.values[index] : idl.UnlinkedConstOperation.pushInt;
-  }
-}
-
 class _UnlinkedConstructorInitializerKindReader extends fb.Reader<idl.UnlinkedConstructorInitializerKind> {
   const _UnlinkedConstructorInitializerKindReader() : super();
 
@@ -116,6 +103,19 @@
   }
 }
 
+class _UnlinkedExprOperationReader extends fb.Reader<idl.UnlinkedExprOperation> {
+  const _UnlinkedExprOperationReader() : super();
+
+  @override
+  int get size => 1;
+
+  @override
+  idl.UnlinkedExprOperation read(fb.BufferContext bc, int offset) {
+    int index = const fb.Uint8Reader().read(bc, offset);
+    return index < idl.UnlinkedExprOperation.values.length ? idl.UnlinkedExprOperation.values[index] : idl.UnlinkedExprOperation.pushInt;
+  }
+}
+
 class _UnlinkedParamKindReader extends fb.Reader<idl.UnlinkedParamKind> {
   const _UnlinkedParamKindReader() : super();
 
@@ -129,6 +129,1192 @@
   }
 }
 
+class AnalysisDriverResolvedUnitBuilder extends Object with _AnalysisDriverResolvedUnitMixin implements idl.AnalysisDriverResolvedUnit {
+  List<AnalysisDriverUnitErrorBuilder> _errors;
+  AnalysisDriverUnitIndexBuilder _index;
+
+  @override
+  List<AnalysisDriverUnitErrorBuilder> get errors => _errors ??= <AnalysisDriverUnitErrorBuilder>[];
+
+  /**
+   * The full list of analysis errors, both syntactic and semantic.
+   */
+  void set errors(List<AnalysisDriverUnitErrorBuilder> value) {
+    this._errors = value;
+  }
+
+  @override
+  AnalysisDriverUnitIndexBuilder get index => _index;
+
+  /**
+   * The index of the unit.
+   */
+  void set index(AnalysisDriverUnitIndexBuilder value) {
+    this._index = value;
+  }
+
+  AnalysisDriverResolvedUnitBuilder({List<AnalysisDriverUnitErrorBuilder> errors, AnalysisDriverUnitIndexBuilder index})
+    : _errors = errors,
+      _index = index;
+
+  /**
+   * Flush [informative] data recursively.
+   */
+  void flushInformative() {
+    _errors?.forEach((b) => b.flushInformative());
+    _index?.flushInformative();
+  }
+
+  /**
+   * Accumulate non-[informative] data into [signature].
+   */
+  void collectApiSignature(api_sig.ApiSignature signature) {
+    if (this._errors == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._errors.length);
+      for (var x in this._errors) {
+        x?.collectApiSignature(signature);
+      }
+    }
+    signature.addBool(this._index != null);
+    this._index?.collectApiSignature(signature);
+  }
+
+  List<int> toBuffer() {
+    fb.Builder fbBuilder = new fb.Builder();
+    return fbBuilder.finish(finish(fbBuilder), "ADRU");
+  }
+
+  fb.Offset finish(fb.Builder fbBuilder) {
+    fb.Offset offset_errors;
+    fb.Offset offset_index;
+    if (!(_errors == null || _errors.isEmpty)) {
+      offset_errors = fbBuilder.writeList(_errors.map((b) => b.finish(fbBuilder)).toList());
+    }
+    if (_index != null) {
+      offset_index = _index.finish(fbBuilder);
+    }
+    fbBuilder.startTable();
+    if (offset_errors != null) {
+      fbBuilder.addOffset(0, offset_errors);
+    }
+    if (offset_index != null) {
+      fbBuilder.addOffset(1, offset_index);
+    }
+    return fbBuilder.endTable();
+  }
+}
+
+idl.AnalysisDriverResolvedUnit readAnalysisDriverResolvedUnit(List<int> buffer) {
+  fb.BufferContext rootRef = new fb.BufferContext.fromBytes(buffer);
+  return const _AnalysisDriverResolvedUnitReader().read(rootRef, 0);
+}
+
+class _AnalysisDriverResolvedUnitReader extends fb.TableReader<_AnalysisDriverResolvedUnitImpl> {
+  const _AnalysisDriverResolvedUnitReader();
+
+  @override
+  _AnalysisDriverResolvedUnitImpl createObject(fb.BufferContext bc, int offset) => new _AnalysisDriverResolvedUnitImpl(bc, offset);
+}
+
+class _AnalysisDriverResolvedUnitImpl extends Object with _AnalysisDriverResolvedUnitMixin implements idl.AnalysisDriverResolvedUnit {
+  final fb.BufferContext _bc;
+  final int _bcOffset;
+
+  _AnalysisDriverResolvedUnitImpl(this._bc, this._bcOffset);
+
+  List<idl.AnalysisDriverUnitError> _errors;
+  idl.AnalysisDriverUnitIndex _index;
+
+  @override
+  List<idl.AnalysisDriverUnitError> get errors {
+    _errors ??= const fb.ListReader<idl.AnalysisDriverUnitError>(const _AnalysisDriverUnitErrorReader()).vTableGet(_bc, _bcOffset, 0, const <idl.AnalysisDriverUnitError>[]);
+    return _errors;
+  }
+
+  @override
+  idl.AnalysisDriverUnitIndex get index {
+    _index ??= const _AnalysisDriverUnitIndexReader().vTableGet(_bc, _bcOffset, 1, null);
+    return _index;
+  }
+}
+
+abstract class _AnalysisDriverResolvedUnitMixin implements idl.AnalysisDriverResolvedUnit {
+  @override
+  Map<String, Object> toJson() {
+    Map<String, Object> _result = <String, Object>{};
+    if (errors.isNotEmpty) _result["errors"] = errors.map((_value) => _value.toJson()).toList();
+    if (index != null) _result["index"] = index.toJson();
+    return _result;
+  }
+
+  @override
+  Map<String, Object> toMap() => {
+    "errors": errors,
+    "index": index,
+  };
+
+  @override
+  String toString() => convert.JSON.encode(toJson());
+}
+
+class AnalysisDriverUnitErrorBuilder extends Object with _AnalysisDriverUnitErrorMixin implements idl.AnalysisDriverUnitError {
+  String _correction;
+  int _length;
+  String _message;
+  int _offset;
+  String _uniqueName;
+
+  @override
+  String get correction => _correction ??= '';
+
+  /**
+   * The optional correction hint for the error.
+   */
+  void set correction(String value) {
+    this._correction = value;
+  }
+
+  @override
+  int get length => _length ??= 0;
+
+  /**
+   * The length of the error in the file.
+   */
+  void set length(int value) {
+    assert(value == null || value >= 0);
+    this._length = value;
+  }
+
+  @override
+  String get message => _message ??= '';
+
+  /**
+   * The message of the error.
+   */
+  void set message(String value) {
+    this._message = value;
+  }
+
+  @override
+  int get offset => _offset ??= 0;
+
+  /**
+   * The offset from the beginning of the file.
+   */
+  void set offset(int value) {
+    assert(value == null || value >= 0);
+    this._offset = value;
+  }
+
+  @override
+  String get uniqueName => _uniqueName ??= '';
+
+  /**
+   * The unique name of the error code.
+   */
+  void set uniqueName(String value) {
+    this._uniqueName = value;
+  }
+
+  AnalysisDriverUnitErrorBuilder({String correction, int length, String message, int offset, String uniqueName})
+    : _correction = correction,
+      _length = length,
+      _message = message,
+      _offset = offset,
+      _uniqueName = uniqueName;
+
+  /**
+   * Flush [informative] data recursively.
+   */
+  void flushInformative() {
+  }
+
+  /**
+   * Accumulate non-[informative] data into [signature].
+   */
+  void collectApiSignature(api_sig.ApiSignature signature) {
+    signature.addInt(this._offset ?? 0);
+    signature.addInt(this._length ?? 0);
+    signature.addString(this._uniqueName ?? '');
+    signature.addString(this._message ?? '');
+    signature.addString(this._correction ?? '');
+  }
+
+  fb.Offset finish(fb.Builder fbBuilder) {
+    fb.Offset offset_correction;
+    fb.Offset offset_message;
+    fb.Offset offset_uniqueName;
+    if (_correction != null) {
+      offset_correction = fbBuilder.writeString(_correction);
+    }
+    if (_message != null) {
+      offset_message = fbBuilder.writeString(_message);
+    }
+    if (_uniqueName != null) {
+      offset_uniqueName = fbBuilder.writeString(_uniqueName);
+    }
+    fbBuilder.startTable();
+    if (offset_correction != null) {
+      fbBuilder.addOffset(4, offset_correction);
+    }
+    if (_length != null && _length != 0) {
+      fbBuilder.addUint32(1, _length);
+    }
+    if (offset_message != null) {
+      fbBuilder.addOffset(3, offset_message);
+    }
+    if (_offset != null && _offset != 0) {
+      fbBuilder.addUint32(0, _offset);
+    }
+    if (offset_uniqueName != null) {
+      fbBuilder.addOffset(2, offset_uniqueName);
+    }
+    return fbBuilder.endTable();
+  }
+}
+
+class _AnalysisDriverUnitErrorReader extends fb.TableReader<_AnalysisDriverUnitErrorImpl> {
+  const _AnalysisDriverUnitErrorReader();
+
+  @override
+  _AnalysisDriverUnitErrorImpl createObject(fb.BufferContext bc, int offset) => new _AnalysisDriverUnitErrorImpl(bc, offset);
+}
+
+class _AnalysisDriverUnitErrorImpl extends Object with _AnalysisDriverUnitErrorMixin implements idl.AnalysisDriverUnitError {
+  final fb.BufferContext _bc;
+  final int _bcOffset;
+
+  _AnalysisDriverUnitErrorImpl(this._bc, this._bcOffset);
+
+  String _correction;
+  int _length;
+  String _message;
+  int _offset;
+  String _uniqueName;
+
+  @override
+  String get correction {
+    _correction ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 4, '');
+    return _correction;
+  }
+
+  @override
+  int get length {
+    _length ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 1, 0);
+    return _length;
+  }
+
+  @override
+  String get message {
+    _message ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 3, '');
+    return _message;
+  }
+
+  @override
+  int get offset {
+    _offset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 0, 0);
+    return _offset;
+  }
+
+  @override
+  String get uniqueName {
+    _uniqueName ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 2, '');
+    return _uniqueName;
+  }
+}
+
+abstract class _AnalysisDriverUnitErrorMixin implements idl.AnalysisDriverUnitError {
+  @override
+  Map<String, Object> toJson() {
+    Map<String, Object> _result = <String, Object>{};
+    if (correction != '') _result["correction"] = correction;
+    if (length != 0) _result["length"] = length;
+    if (message != '') _result["message"] = message;
+    if (offset != 0) _result["offset"] = offset;
+    if (uniqueName != '') _result["uniqueName"] = uniqueName;
+    return _result;
+  }
+
+  @override
+  Map<String, Object> toMap() => {
+    "correction": correction,
+    "length": length,
+    "message": message,
+    "offset": offset,
+    "uniqueName": uniqueName,
+  };
+
+  @override
+  String toString() => convert.JSON.encode(toJson());
+}
+
+class AnalysisDriverUnitIndexBuilder extends Object with _AnalysisDriverUnitIndexMixin implements idl.AnalysisDriverUnitIndex {
+  List<idl.IndexSyntheticElementKind> _elementKinds;
+  List<int> _elementNameClassMemberIds;
+  List<int> _elementNameParameterIds;
+  List<int> _elementNameUnitMemberIds;
+  List<int> _elementUnits;
+  int _nullStringId;
+  List<String> _strings;
+  List<int> _unitLibraryUris;
+  List<int> _unitUnitUris;
+  List<bool> _usedElementIsQualifiedFlags;
+  List<idl.IndexRelationKind> _usedElementKinds;
+  List<int> _usedElementLengths;
+  List<int> _usedElementOffsets;
+  List<int> _usedElements;
+  List<bool> _usedNameIsQualifiedFlags;
+  List<idl.IndexRelationKind> _usedNameKinds;
+  List<int> _usedNameOffsets;
+  List<int> _usedNames;
+
+  @override
+  List<idl.IndexSyntheticElementKind> get elementKinds => _elementKinds ??= <idl.IndexSyntheticElementKind>[];
+
+  /**
+   * Each item of this list corresponds to a unique referenced element.  It is
+   * the kind of the synthetic element.
+   */
+  void set elementKinds(List<idl.IndexSyntheticElementKind> value) {
+    this._elementKinds = value;
+  }
+
+  @override
+  List<int> get elementNameClassMemberIds => _elementNameClassMemberIds ??= <int>[];
+
+  /**
+   * Each item of this list corresponds to a unique referenced element.  It is
+   * the identifier of the class member element name, or `null` if the element
+   * is a top-level element.  The list is sorted in ascending order, so that the
+   * client can quickly check whether an element is referenced in this index.
+   */
+  void set elementNameClassMemberIds(List<int> value) {
+    assert(value == null || value.every((e) => e >= 0));
+    this._elementNameClassMemberIds = value;
+  }
+
+  @override
+  List<int> get elementNameParameterIds => _elementNameParameterIds ??= <int>[];
+
+  /**
+   * Each item of this list corresponds to a unique referenced element.  It is
+   * the identifier of the named parameter name, or `null` if the element is not
+   * a named parameter.  The list is sorted in ascending order, so that the
+   * client can quickly check whether an element is referenced in this index.
+   */
+  void set elementNameParameterIds(List<int> value) {
+    assert(value == null || value.every((e) => e >= 0));
+    this._elementNameParameterIds = value;
+  }
+
+  @override
+  List<int> get elementNameUnitMemberIds => _elementNameUnitMemberIds ??= <int>[];
+
+  /**
+   * Each item of this list corresponds to a unique referenced element.  It is
+   * the identifier of the top-level element name, or `null` if the element is
+   * the unit.  The list is sorted in ascending order, so that the client can
+   * quickly check whether an element is referenced in this index.
+   */
+  void set elementNameUnitMemberIds(List<int> value) {
+    assert(value == null || value.every((e) => e >= 0));
+    this._elementNameUnitMemberIds = value;
+  }
+
+  @override
+  List<int> get elementUnits => _elementUnits ??= <int>[];
+
+  /**
+   * Each item of this list corresponds to a unique referenced element.  It is
+   * the index into [unitLibraryUris] and [unitUnitUris] for the library
+   * specific unit where the element is declared.
+   */
+  void set elementUnits(List<int> value) {
+    assert(value == null || value.every((e) => e >= 0));
+    this._elementUnits = value;
+  }
+
+  @override
+  int get nullStringId => _nullStringId ??= 0;
+
+  /**
+   * Identifier of the null string in [strings].
+   */
+  void set nullStringId(int value) {
+    assert(value == null || value >= 0);
+    this._nullStringId = value;
+  }
+
+  @override
+  List<String> get strings => _strings ??= <String>[];
+
+  /**
+   * List of unique element strings used in this index.  The list is sorted in
+   * ascending order, so that the client can quickly check the presence of a
+   * string in this index.
+   */
+  void set strings(List<String> value) {
+    this._strings = value;
+  }
+
+  @override
+  List<int> get unitLibraryUris => _unitLibraryUris ??= <int>[];
+
+  /**
+   * Each item of this list corresponds to the library URI of a unique library
+   * specific unit referenced in the index.  It is an index into [strings] list.
+   */
+  void set unitLibraryUris(List<int> value) {
+    assert(value == null || value.every((e) => e >= 0));
+    this._unitLibraryUris = value;
+  }
+
+  @override
+  List<int> get unitUnitUris => _unitUnitUris ??= <int>[];
+
+  /**
+   * Each item of this list corresponds to the unit URI of a unique library
+   * specific unit referenced in the index.  It is an index into [strings] list.
+   */
+  void set unitUnitUris(List<int> value) {
+    assert(value == null || value.every((e) => e >= 0));
+    this._unitUnitUris = value;
+  }
+
+  @override
+  List<bool> get usedElementIsQualifiedFlags => _usedElementIsQualifiedFlags ??= <bool>[];
+
+  /**
+   * Each item of this list is the `true` if the corresponding element usage
+   * is qualified with some prefix.
+   */
+  void set usedElementIsQualifiedFlags(List<bool> value) {
+    this._usedElementIsQualifiedFlags = value;
+  }
+
+  @override
+  List<idl.IndexRelationKind> get usedElementKinds => _usedElementKinds ??= <idl.IndexRelationKind>[];
+
+  /**
+   * Each item of this list is the kind of the element usage.
+   */
+  void set usedElementKinds(List<idl.IndexRelationKind> value) {
+    this._usedElementKinds = value;
+  }
+
+  @override
+  List<int> get usedElementLengths => _usedElementLengths ??= <int>[];
+
+  /**
+   * Each item of this list is the length of the element usage.
+   */
+  void set usedElementLengths(List<int> value) {
+    assert(value == null || value.every((e) => e >= 0));
+    this._usedElementLengths = value;
+  }
+
+  @override
+  List<int> get usedElementOffsets => _usedElementOffsets ??= <int>[];
+
+  /**
+   * Each item of this list is the offset of the element usage relative to the
+   * beginning of the file.
+   */
+  void set usedElementOffsets(List<int> value) {
+    assert(value == null || value.every((e) => e >= 0));
+    this._usedElementOffsets = value;
+  }
+
+  @override
+  List<int> get usedElements => _usedElements ??= <int>[];
+
+  /**
+   * Each item of this list is the index into [elementUnits],
+   * [elementNameUnitMemberIds], [elementNameClassMemberIds] and
+   * [elementNameParameterIds].  The list is sorted in ascending order, so
+   * that the client can quickly find element references in this index.
+   */
+  void set usedElements(List<int> value) {
+    assert(value == null || value.every((e) => e >= 0));
+    this._usedElements = value;
+  }
+
+  @override
+  List<bool> get usedNameIsQualifiedFlags => _usedNameIsQualifiedFlags ??= <bool>[];
+
+  /**
+   * Each item of this list is the `true` if the corresponding name usage
+   * is qualified with some prefix.
+   */
+  void set usedNameIsQualifiedFlags(List<bool> value) {
+    this._usedNameIsQualifiedFlags = value;
+  }
+
+  @override
+  List<idl.IndexRelationKind> get usedNameKinds => _usedNameKinds ??= <idl.IndexRelationKind>[];
+
+  /**
+   * Each item of this list is the kind of the name usage.
+   */
+  void set usedNameKinds(List<idl.IndexRelationKind> value) {
+    this._usedNameKinds = value;
+  }
+
+  @override
+  List<int> get usedNameOffsets => _usedNameOffsets ??= <int>[];
+
+  /**
+   * Each item of this list is the offset of the name usage relative to the
+   * beginning of the file.
+   */
+  void set usedNameOffsets(List<int> value) {
+    assert(value == null || value.every((e) => e >= 0));
+    this._usedNameOffsets = value;
+  }
+
+  @override
+  List<int> get usedNames => _usedNames ??= <int>[];
+
+  /**
+   * Each item of this list is the index into [strings] for a used name.  The
+   * list is sorted in ascending order, so that the client can quickly find
+   * whether a name is used in this index.
+   */
+  void set usedNames(List<int> value) {
+    assert(value == null || value.every((e) => e >= 0));
+    this._usedNames = value;
+  }
+
+  AnalysisDriverUnitIndexBuilder({List<idl.IndexSyntheticElementKind> elementKinds, List<int> elementNameClassMemberIds, List<int> elementNameParameterIds, List<int> elementNameUnitMemberIds, List<int> elementUnits, int nullStringId, List<String> strings, List<int> unitLibraryUris, List<int> unitUnitUris, List<bool> usedElementIsQualifiedFlags, List<idl.IndexRelationKind> usedElementKinds, List<int> usedElementLengths, List<int> usedElementOffsets, List<int> usedElements, List<bool> usedNameIsQualifiedFlags, List<idl.IndexRelationKind> usedNameKinds, List<int> usedNameOffsets, List<int> usedNames})
+    : _elementKinds = elementKinds,
+      _elementNameClassMemberIds = elementNameClassMemberIds,
+      _elementNameParameterIds = elementNameParameterIds,
+      _elementNameUnitMemberIds = elementNameUnitMemberIds,
+      _elementUnits = elementUnits,
+      _nullStringId = nullStringId,
+      _strings = strings,
+      _unitLibraryUris = unitLibraryUris,
+      _unitUnitUris = unitUnitUris,
+      _usedElementIsQualifiedFlags = usedElementIsQualifiedFlags,
+      _usedElementKinds = usedElementKinds,
+      _usedElementLengths = usedElementLengths,
+      _usedElementOffsets = usedElementOffsets,
+      _usedElements = usedElements,
+      _usedNameIsQualifiedFlags = usedNameIsQualifiedFlags,
+      _usedNameKinds = usedNameKinds,
+      _usedNameOffsets = usedNameOffsets,
+      _usedNames = usedNames;
+
+  /**
+   * Flush [informative] data recursively.
+   */
+  void flushInformative() {
+  }
+
+  /**
+   * Accumulate non-[informative] data into [signature].
+   */
+  void collectApiSignature(api_sig.ApiSignature signature) {
+    if (this._strings == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._strings.length);
+      for (var x in this._strings) {
+        signature.addString(x);
+      }
+    }
+    signature.addInt(this._nullStringId ?? 0);
+    if (this._unitLibraryUris == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._unitLibraryUris.length);
+      for (var x in this._unitLibraryUris) {
+        signature.addInt(x);
+      }
+    }
+    if (this._unitUnitUris == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._unitUnitUris.length);
+      for (var x in this._unitUnitUris) {
+        signature.addInt(x);
+      }
+    }
+    if (this._elementKinds == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._elementKinds.length);
+      for (var x in this._elementKinds) {
+        signature.addInt(x.index);
+      }
+    }
+    if (this._elementUnits == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._elementUnits.length);
+      for (var x in this._elementUnits) {
+        signature.addInt(x);
+      }
+    }
+    if (this._elementNameUnitMemberIds == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._elementNameUnitMemberIds.length);
+      for (var x in this._elementNameUnitMemberIds) {
+        signature.addInt(x);
+      }
+    }
+    if (this._elementNameClassMemberIds == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._elementNameClassMemberIds.length);
+      for (var x in this._elementNameClassMemberIds) {
+        signature.addInt(x);
+      }
+    }
+    if (this._elementNameParameterIds == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._elementNameParameterIds.length);
+      for (var x in this._elementNameParameterIds) {
+        signature.addInt(x);
+      }
+    }
+    if (this._usedElements == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._usedElements.length);
+      for (var x in this._usedElements) {
+        signature.addInt(x);
+      }
+    }
+    if (this._usedElementKinds == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._usedElementKinds.length);
+      for (var x in this._usedElementKinds) {
+        signature.addInt(x.index);
+      }
+    }
+    if (this._usedElementOffsets == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._usedElementOffsets.length);
+      for (var x in this._usedElementOffsets) {
+        signature.addInt(x);
+      }
+    }
+    if (this._usedElementLengths == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._usedElementLengths.length);
+      for (var x in this._usedElementLengths) {
+        signature.addInt(x);
+      }
+    }
+    if (this._usedElementIsQualifiedFlags == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._usedElementIsQualifiedFlags.length);
+      for (var x in this._usedElementIsQualifiedFlags) {
+        signature.addBool(x);
+      }
+    }
+    if (this._usedNames == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._usedNames.length);
+      for (var x in this._usedNames) {
+        signature.addInt(x);
+      }
+    }
+    if (this._usedNameKinds == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._usedNameKinds.length);
+      for (var x in this._usedNameKinds) {
+        signature.addInt(x.index);
+      }
+    }
+    if (this._usedNameOffsets == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._usedNameOffsets.length);
+      for (var x in this._usedNameOffsets) {
+        signature.addInt(x);
+      }
+    }
+    if (this._usedNameIsQualifiedFlags == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._usedNameIsQualifiedFlags.length);
+      for (var x in this._usedNameIsQualifiedFlags) {
+        signature.addBool(x);
+      }
+    }
+  }
+
+  List<int> toBuffer() {
+    fb.Builder fbBuilder = new fb.Builder();
+    return fbBuilder.finish(finish(fbBuilder), "ADUI");
+  }
+
+  fb.Offset finish(fb.Builder fbBuilder) {
+    fb.Offset offset_elementKinds;
+    fb.Offset offset_elementNameClassMemberIds;
+    fb.Offset offset_elementNameParameterIds;
+    fb.Offset offset_elementNameUnitMemberIds;
+    fb.Offset offset_elementUnits;
+    fb.Offset offset_strings;
+    fb.Offset offset_unitLibraryUris;
+    fb.Offset offset_unitUnitUris;
+    fb.Offset offset_usedElementIsQualifiedFlags;
+    fb.Offset offset_usedElementKinds;
+    fb.Offset offset_usedElementLengths;
+    fb.Offset offset_usedElementOffsets;
+    fb.Offset offset_usedElements;
+    fb.Offset offset_usedNameIsQualifiedFlags;
+    fb.Offset offset_usedNameKinds;
+    fb.Offset offset_usedNameOffsets;
+    fb.Offset offset_usedNames;
+    if (!(_elementKinds == null || _elementKinds.isEmpty)) {
+      offset_elementKinds = fbBuilder.writeListUint8(_elementKinds.map((b) => b.index).toList());
+    }
+    if (!(_elementNameClassMemberIds == null || _elementNameClassMemberIds.isEmpty)) {
+      offset_elementNameClassMemberIds = fbBuilder.writeListUint32(_elementNameClassMemberIds);
+    }
+    if (!(_elementNameParameterIds == null || _elementNameParameterIds.isEmpty)) {
+      offset_elementNameParameterIds = fbBuilder.writeListUint32(_elementNameParameterIds);
+    }
+    if (!(_elementNameUnitMemberIds == null || _elementNameUnitMemberIds.isEmpty)) {
+      offset_elementNameUnitMemberIds = fbBuilder.writeListUint32(_elementNameUnitMemberIds);
+    }
+    if (!(_elementUnits == null || _elementUnits.isEmpty)) {
+      offset_elementUnits = fbBuilder.writeListUint32(_elementUnits);
+    }
+    if (!(_strings == null || _strings.isEmpty)) {
+      offset_strings = fbBuilder.writeList(_strings.map((b) => fbBuilder.writeString(b)).toList());
+    }
+    if (!(_unitLibraryUris == null || _unitLibraryUris.isEmpty)) {
+      offset_unitLibraryUris = fbBuilder.writeListUint32(_unitLibraryUris);
+    }
+    if (!(_unitUnitUris == null || _unitUnitUris.isEmpty)) {
+      offset_unitUnitUris = fbBuilder.writeListUint32(_unitUnitUris);
+    }
+    if (!(_usedElementIsQualifiedFlags == null || _usedElementIsQualifiedFlags.isEmpty)) {
+      offset_usedElementIsQualifiedFlags = fbBuilder.writeListBool(_usedElementIsQualifiedFlags);
+    }
+    if (!(_usedElementKinds == null || _usedElementKinds.isEmpty)) {
+      offset_usedElementKinds = fbBuilder.writeListUint8(_usedElementKinds.map((b) => b.index).toList());
+    }
+    if (!(_usedElementLengths == null || _usedElementLengths.isEmpty)) {
+      offset_usedElementLengths = fbBuilder.writeListUint32(_usedElementLengths);
+    }
+    if (!(_usedElementOffsets == null || _usedElementOffsets.isEmpty)) {
+      offset_usedElementOffsets = fbBuilder.writeListUint32(_usedElementOffsets);
+    }
+    if (!(_usedElements == null || _usedElements.isEmpty)) {
+      offset_usedElements = fbBuilder.writeListUint32(_usedElements);
+    }
+    if (!(_usedNameIsQualifiedFlags == null || _usedNameIsQualifiedFlags.isEmpty)) {
+      offset_usedNameIsQualifiedFlags = fbBuilder.writeListBool(_usedNameIsQualifiedFlags);
+    }
+    if (!(_usedNameKinds == null || _usedNameKinds.isEmpty)) {
+      offset_usedNameKinds = fbBuilder.writeListUint8(_usedNameKinds.map((b) => b.index).toList());
+    }
+    if (!(_usedNameOffsets == null || _usedNameOffsets.isEmpty)) {
+      offset_usedNameOffsets = fbBuilder.writeListUint32(_usedNameOffsets);
+    }
+    if (!(_usedNames == null || _usedNames.isEmpty)) {
+      offset_usedNames = fbBuilder.writeListUint32(_usedNames);
+    }
+    fbBuilder.startTable();
+    if (offset_elementKinds != null) {
+      fbBuilder.addOffset(4, offset_elementKinds);
+    }
+    if (offset_elementNameClassMemberIds != null) {
+      fbBuilder.addOffset(7, offset_elementNameClassMemberIds);
+    }
+    if (offset_elementNameParameterIds != null) {
+      fbBuilder.addOffset(8, offset_elementNameParameterIds);
+    }
+    if (offset_elementNameUnitMemberIds != null) {
+      fbBuilder.addOffset(6, offset_elementNameUnitMemberIds);
+    }
+    if (offset_elementUnits != null) {
+      fbBuilder.addOffset(5, offset_elementUnits);
+    }
+    if (_nullStringId != null && _nullStringId != 0) {
+      fbBuilder.addUint32(1, _nullStringId);
+    }
+    if (offset_strings != null) {
+      fbBuilder.addOffset(0, offset_strings);
+    }
+    if (offset_unitLibraryUris != null) {
+      fbBuilder.addOffset(2, offset_unitLibraryUris);
+    }
+    if (offset_unitUnitUris != null) {
+      fbBuilder.addOffset(3, offset_unitUnitUris);
+    }
+    if (offset_usedElementIsQualifiedFlags != null) {
+      fbBuilder.addOffset(13, offset_usedElementIsQualifiedFlags);
+    }
+    if (offset_usedElementKinds != null) {
+      fbBuilder.addOffset(10, offset_usedElementKinds);
+    }
+    if (offset_usedElementLengths != null) {
+      fbBuilder.addOffset(12, offset_usedElementLengths);
+    }
+    if (offset_usedElementOffsets != null) {
+      fbBuilder.addOffset(11, offset_usedElementOffsets);
+    }
+    if (offset_usedElements != null) {
+      fbBuilder.addOffset(9, offset_usedElements);
+    }
+    if (offset_usedNameIsQualifiedFlags != null) {
+      fbBuilder.addOffset(17, offset_usedNameIsQualifiedFlags);
+    }
+    if (offset_usedNameKinds != null) {
+      fbBuilder.addOffset(15, offset_usedNameKinds);
+    }
+    if (offset_usedNameOffsets != null) {
+      fbBuilder.addOffset(16, offset_usedNameOffsets);
+    }
+    if (offset_usedNames != null) {
+      fbBuilder.addOffset(14, offset_usedNames);
+    }
+    return fbBuilder.endTable();
+  }
+}
+
+idl.AnalysisDriverUnitIndex readAnalysisDriverUnitIndex(List<int> buffer) {
+  fb.BufferContext rootRef = new fb.BufferContext.fromBytes(buffer);
+  return const _AnalysisDriverUnitIndexReader().read(rootRef, 0);
+}
+
+class _AnalysisDriverUnitIndexReader extends fb.TableReader<_AnalysisDriverUnitIndexImpl> {
+  const _AnalysisDriverUnitIndexReader();
+
+  @override
+  _AnalysisDriverUnitIndexImpl createObject(fb.BufferContext bc, int offset) => new _AnalysisDriverUnitIndexImpl(bc, offset);
+}
+
+class _AnalysisDriverUnitIndexImpl extends Object with _AnalysisDriverUnitIndexMixin implements idl.AnalysisDriverUnitIndex {
+  final fb.BufferContext _bc;
+  final int _bcOffset;
+
+  _AnalysisDriverUnitIndexImpl(this._bc, this._bcOffset);
+
+  List<idl.IndexSyntheticElementKind> _elementKinds;
+  List<int> _elementNameClassMemberIds;
+  List<int> _elementNameParameterIds;
+  List<int> _elementNameUnitMemberIds;
+  List<int> _elementUnits;
+  int _nullStringId;
+  List<String> _strings;
+  List<int> _unitLibraryUris;
+  List<int> _unitUnitUris;
+  List<bool> _usedElementIsQualifiedFlags;
+  List<idl.IndexRelationKind> _usedElementKinds;
+  List<int> _usedElementLengths;
+  List<int> _usedElementOffsets;
+  List<int> _usedElements;
+  List<bool> _usedNameIsQualifiedFlags;
+  List<idl.IndexRelationKind> _usedNameKinds;
+  List<int> _usedNameOffsets;
+  List<int> _usedNames;
+
+  @override
+  List<idl.IndexSyntheticElementKind> get elementKinds {
+    _elementKinds ??= const fb.ListReader<idl.IndexSyntheticElementKind>(const _IndexSyntheticElementKindReader()).vTableGet(_bc, _bcOffset, 4, const <idl.IndexSyntheticElementKind>[]);
+    return _elementKinds;
+  }
+
+  @override
+  List<int> get elementNameClassMemberIds {
+    _elementNameClassMemberIds ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 7, const <int>[]);
+    return _elementNameClassMemberIds;
+  }
+
+  @override
+  List<int> get elementNameParameterIds {
+    _elementNameParameterIds ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 8, const <int>[]);
+    return _elementNameParameterIds;
+  }
+
+  @override
+  List<int> get elementNameUnitMemberIds {
+    _elementNameUnitMemberIds ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 6, const <int>[]);
+    return _elementNameUnitMemberIds;
+  }
+
+  @override
+  List<int> get elementUnits {
+    _elementUnits ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 5, const <int>[]);
+    return _elementUnits;
+  }
+
+  @override
+  int get nullStringId {
+    _nullStringId ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 1, 0);
+    return _nullStringId;
+  }
+
+  @override
+  List<String> get strings {
+    _strings ??= const fb.ListReader<String>(const fb.StringReader()).vTableGet(_bc, _bcOffset, 0, const <String>[]);
+    return _strings;
+  }
+
+  @override
+  List<int> get unitLibraryUris {
+    _unitLibraryUris ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 2, const <int>[]);
+    return _unitLibraryUris;
+  }
+
+  @override
+  List<int> get unitUnitUris {
+    _unitUnitUris ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 3, const <int>[]);
+    return _unitUnitUris;
+  }
+
+  @override
+  List<bool> get usedElementIsQualifiedFlags {
+    _usedElementIsQualifiedFlags ??= const fb.BoolListReader().vTableGet(_bc, _bcOffset, 13, const <bool>[]);
+    return _usedElementIsQualifiedFlags;
+  }
+
+  @override
+  List<idl.IndexRelationKind> get usedElementKinds {
+    _usedElementKinds ??= const fb.ListReader<idl.IndexRelationKind>(const _IndexRelationKindReader()).vTableGet(_bc, _bcOffset, 10, const <idl.IndexRelationKind>[]);
+    return _usedElementKinds;
+  }
+
+  @override
+  List<int> get usedElementLengths {
+    _usedElementLengths ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 12, const <int>[]);
+    return _usedElementLengths;
+  }
+
+  @override
+  List<int> get usedElementOffsets {
+    _usedElementOffsets ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 11, const <int>[]);
+    return _usedElementOffsets;
+  }
+
+  @override
+  List<int> get usedElements {
+    _usedElements ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 9, const <int>[]);
+    return _usedElements;
+  }
+
+  @override
+  List<bool> get usedNameIsQualifiedFlags {
+    _usedNameIsQualifiedFlags ??= const fb.BoolListReader().vTableGet(_bc, _bcOffset, 17, const <bool>[]);
+    return _usedNameIsQualifiedFlags;
+  }
+
+  @override
+  List<idl.IndexRelationKind> get usedNameKinds {
+    _usedNameKinds ??= const fb.ListReader<idl.IndexRelationKind>(const _IndexRelationKindReader()).vTableGet(_bc, _bcOffset, 15, const <idl.IndexRelationKind>[]);
+    return _usedNameKinds;
+  }
+
+  @override
+  List<int> get usedNameOffsets {
+    _usedNameOffsets ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 16, const <int>[]);
+    return _usedNameOffsets;
+  }
+
+  @override
+  List<int> get usedNames {
+    _usedNames ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 14, const <int>[]);
+    return _usedNames;
+  }
+}
+
+abstract class _AnalysisDriverUnitIndexMixin implements idl.AnalysisDriverUnitIndex {
+  @override
+  Map<String, Object> toJson() {
+    Map<String, Object> _result = <String, Object>{};
+    if (elementKinds.isNotEmpty) _result["elementKinds"] = elementKinds.map((_value) => _value.toString().split('.')[1]).toList();
+    if (elementNameClassMemberIds.isNotEmpty) _result["elementNameClassMemberIds"] = elementNameClassMemberIds;
+    if (elementNameParameterIds.isNotEmpty) _result["elementNameParameterIds"] = elementNameParameterIds;
+    if (elementNameUnitMemberIds.isNotEmpty) _result["elementNameUnitMemberIds"] = elementNameUnitMemberIds;
+    if (elementUnits.isNotEmpty) _result["elementUnits"] = elementUnits;
+    if (nullStringId != 0) _result["nullStringId"] = nullStringId;
+    if (strings.isNotEmpty) _result["strings"] = strings;
+    if (unitLibraryUris.isNotEmpty) _result["unitLibraryUris"] = unitLibraryUris;
+    if (unitUnitUris.isNotEmpty) _result["unitUnitUris"] = unitUnitUris;
+    if (usedElementIsQualifiedFlags.isNotEmpty) _result["usedElementIsQualifiedFlags"] = usedElementIsQualifiedFlags;
+    if (usedElementKinds.isNotEmpty) _result["usedElementKinds"] = usedElementKinds.map((_value) => _value.toString().split('.')[1]).toList();
+    if (usedElementLengths.isNotEmpty) _result["usedElementLengths"] = usedElementLengths;
+    if (usedElementOffsets.isNotEmpty) _result["usedElementOffsets"] = usedElementOffsets;
+    if (usedElements.isNotEmpty) _result["usedElements"] = usedElements;
+    if (usedNameIsQualifiedFlags.isNotEmpty) _result["usedNameIsQualifiedFlags"] = usedNameIsQualifiedFlags;
+    if (usedNameKinds.isNotEmpty) _result["usedNameKinds"] = usedNameKinds.map((_value) => _value.toString().split('.')[1]).toList();
+    if (usedNameOffsets.isNotEmpty) _result["usedNameOffsets"] = usedNameOffsets;
+    if (usedNames.isNotEmpty) _result["usedNames"] = usedNames;
+    return _result;
+  }
+
+  @override
+  Map<String, Object> toMap() => {
+    "elementKinds": elementKinds,
+    "elementNameClassMemberIds": elementNameClassMemberIds,
+    "elementNameParameterIds": elementNameParameterIds,
+    "elementNameUnitMemberIds": elementNameUnitMemberIds,
+    "elementUnits": elementUnits,
+    "nullStringId": nullStringId,
+    "strings": strings,
+    "unitLibraryUris": unitLibraryUris,
+    "unitUnitUris": unitUnitUris,
+    "usedElementIsQualifiedFlags": usedElementIsQualifiedFlags,
+    "usedElementKinds": usedElementKinds,
+    "usedElementLengths": usedElementLengths,
+    "usedElementOffsets": usedElementOffsets,
+    "usedElements": usedElements,
+    "usedNameIsQualifiedFlags": usedNameIsQualifiedFlags,
+    "usedNameKinds": usedNameKinds,
+    "usedNameOffsets": usedNameOffsets,
+    "usedNames": usedNames,
+  };
+
+  @override
+  String toString() => convert.JSON.encode(toJson());
+}
+
+class AnalysisDriverUnlinkedUnitBuilder extends Object with _AnalysisDriverUnlinkedUnitMixin implements idl.AnalysisDriverUnlinkedUnit {
+  List<String> _referencedNames;
+  UnlinkedUnitBuilder _unit;
+
+  @override
+  List<String> get referencedNames => _referencedNames ??= <String>[];
+
+  /**
+   * List of external names referenced by the unit.
+   */
+  void set referencedNames(List<String> value) {
+    this._referencedNames = value;
+  }
+
+  @override
+  UnlinkedUnitBuilder get unit => _unit;
+
+  /**
+   * Unlinked information for the unit.
+   */
+  void set unit(UnlinkedUnitBuilder value) {
+    this._unit = value;
+  }
+
+  AnalysisDriverUnlinkedUnitBuilder({List<String> referencedNames, UnlinkedUnitBuilder unit})
+    : _referencedNames = referencedNames,
+      _unit = unit;
+
+  /**
+   * Flush [informative] data recursively.
+   */
+  void flushInformative() {
+    _unit?.flushInformative();
+  }
+
+  /**
+   * Accumulate non-[informative] data into [signature].
+   */
+  void collectApiSignature(api_sig.ApiSignature signature) {
+    if (this._referencedNames == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._referencedNames.length);
+      for (var x in this._referencedNames) {
+        signature.addString(x);
+      }
+    }
+    signature.addBool(this._unit != null);
+    this._unit?.collectApiSignature(signature);
+  }
+
+  List<int> toBuffer() {
+    fb.Builder fbBuilder = new fb.Builder();
+    return fbBuilder.finish(finish(fbBuilder), "ADUU");
+  }
+
+  fb.Offset finish(fb.Builder fbBuilder) {
+    fb.Offset offset_referencedNames;
+    fb.Offset offset_unit;
+    if (!(_referencedNames == null || _referencedNames.isEmpty)) {
+      offset_referencedNames = fbBuilder.writeList(_referencedNames.map((b) => fbBuilder.writeString(b)).toList());
+    }
+    if (_unit != null) {
+      offset_unit = _unit.finish(fbBuilder);
+    }
+    fbBuilder.startTable();
+    if (offset_referencedNames != null) {
+      fbBuilder.addOffset(0, offset_referencedNames);
+    }
+    if (offset_unit != null) {
+      fbBuilder.addOffset(1, offset_unit);
+    }
+    return fbBuilder.endTable();
+  }
+}
+
+idl.AnalysisDriverUnlinkedUnit readAnalysisDriverUnlinkedUnit(List<int> buffer) {
+  fb.BufferContext rootRef = new fb.BufferContext.fromBytes(buffer);
+  return const _AnalysisDriverUnlinkedUnitReader().read(rootRef, 0);
+}
+
+class _AnalysisDriverUnlinkedUnitReader extends fb.TableReader<_AnalysisDriverUnlinkedUnitImpl> {
+  const _AnalysisDriverUnlinkedUnitReader();
+
+  @override
+  _AnalysisDriverUnlinkedUnitImpl createObject(fb.BufferContext bc, int offset) => new _AnalysisDriverUnlinkedUnitImpl(bc, offset);
+}
+
+class _AnalysisDriverUnlinkedUnitImpl extends Object with _AnalysisDriverUnlinkedUnitMixin implements idl.AnalysisDriverUnlinkedUnit {
+  final fb.BufferContext _bc;
+  final int _bcOffset;
+
+  _AnalysisDriverUnlinkedUnitImpl(this._bc, this._bcOffset);
+
+  List<String> _referencedNames;
+  idl.UnlinkedUnit _unit;
+
+  @override
+  List<String> get referencedNames {
+    _referencedNames ??= const fb.ListReader<String>(const fb.StringReader()).vTableGet(_bc, _bcOffset, 0, const <String>[]);
+    return _referencedNames;
+  }
+
+  @override
+  idl.UnlinkedUnit get unit {
+    _unit ??= const _UnlinkedUnitReader().vTableGet(_bc, _bcOffset, 1, null);
+    return _unit;
+  }
+}
+
+abstract class _AnalysisDriverUnlinkedUnitMixin implements idl.AnalysisDriverUnlinkedUnit {
+  @override
+  Map<String, Object> toJson() {
+    Map<String, Object> _result = <String, Object>{};
+    if (referencedNames.isNotEmpty) _result["referencedNames"] = referencedNames;
+    if (unit != null) _result["unit"] = unit.toJson();
+    return _result;
+  }
+
+  @override
+  Map<String, Object> toMap() => {
+    "referencedNames": referencedNames,
+    "unit": unit,
+  };
+
+  @override
+  String toString() => convert.JSON.encode(toJson());
+}
+
 class CodeRangeBuilder extends Object with _CodeRangeMixin implements idl.CodeRange {
   int _length;
   int _offset;
@@ -841,7 +2027,6 @@
   List<LinkedDependencyBuilder> _dependencies;
   List<int> _exportDependencies;
   List<LinkedExportNameBuilder> _exportNames;
-  bool _fallbackMode;
   List<int> _importDependencies;
   int _numPrelinkedDependencies;
   List<LinkedUnitBuilder> _units;
@@ -896,15 +2081,7 @@
   }
 
   @override
-  bool get fallbackMode => _fallbackMode ??= false;
-
-  /**
-   * Indicates whether this library was summarized in "fallback mode".  If
-   * true, all other fields in the data structure have their default values.
-   */
-  void set fallbackMode(bool value) {
-    this._fallbackMode = value;
-  }
+  bool get fallbackMode => throw new UnimplementedError('attempt to access deprecated field');
 
   @override
   List<int> get importDependencies => _importDependencies ??= <int>[];
@@ -944,11 +2121,10 @@
     this._units = value;
   }
 
-  LinkedLibraryBuilder({List<LinkedDependencyBuilder> dependencies, List<int> exportDependencies, List<LinkedExportNameBuilder> exportNames, bool fallbackMode, List<int> importDependencies, int numPrelinkedDependencies, List<LinkedUnitBuilder> units})
+  LinkedLibraryBuilder({List<LinkedDependencyBuilder> dependencies, List<int> exportDependencies, List<LinkedExportNameBuilder> exportNames, List<int> importDependencies, int numPrelinkedDependencies, List<LinkedUnitBuilder> units})
     : _dependencies = dependencies,
       _exportDependencies = exportDependencies,
       _exportNames = exportNames,
-      _fallbackMode = fallbackMode,
       _importDependencies = importDependencies,
       _numPrelinkedDependencies = numPrelinkedDependencies,
       _units = units;
@@ -999,7 +2175,6 @@
         x?.collectApiSignature(signature);
       }
     }
-    signature.addBool(this._fallbackMode == true);
     if (this._exportDependencies == null) {
       signature.addInt(0);
     } else {
@@ -1046,9 +2221,6 @@
     if (offset_exportNames != null) {
       fbBuilder.addOffset(4, offset_exportNames);
     }
-    if (_fallbackMode == true) {
-      fbBuilder.addBool(5, true);
-    }
     if (offset_importDependencies != null) {
       fbBuilder.addOffset(1, offset_importDependencies);
     }
@@ -1083,7 +2255,6 @@
   List<idl.LinkedDependency> _dependencies;
   List<int> _exportDependencies;
   List<idl.LinkedExportName> _exportNames;
-  bool _fallbackMode;
   List<int> _importDependencies;
   int _numPrelinkedDependencies;
   List<idl.LinkedUnit> _units;
@@ -1107,10 +2278,7 @@
   }
 
   @override
-  bool get fallbackMode {
-    _fallbackMode ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 5, false);
-    return _fallbackMode;
-  }
+  bool get fallbackMode => throw new UnimplementedError('attempt to access deprecated field');
 
   @override
   List<int> get importDependencies {
@@ -1138,7 +2306,6 @@
     if (dependencies.isNotEmpty) _result["dependencies"] = dependencies.map((_value) => _value.toJson()).toList();
     if (exportDependencies.isNotEmpty) _result["exportDependencies"] = exportDependencies;
     if (exportNames.isNotEmpty) _result["exportNames"] = exportNames.map((_value) => _value.toJson()).toList();
-    if (fallbackMode != false) _result["fallbackMode"] = fallbackMode;
     if (importDependencies.isNotEmpty) _result["importDependencies"] = importDependencies;
     if (numPrelinkedDependencies != 0) _result["numPrelinkedDependencies"] = numPrelinkedDependencies;
     if (units.isNotEmpty) _result["units"] = units.map((_value) => _value.toJson()).toList();
@@ -1150,7 +2317,6 @@
     "dependencies": dependencies,
     "exportDependencies": exportDependencies,
     "exportNames": exportNames,
-    "fallbackMode": fallbackMode,
     "importDependencies": importDependencies,
     "numPrelinkedDependencies": numPrelinkedDependencies,
     "units": units,
@@ -1425,6 +2591,7 @@
 
 class LinkedUnitBuilder extends Object with _LinkedUnitMixin implements idl.LinkedUnit {
   List<int> _constCycles;
+  List<int> _parametersInheritingCovariant;
   List<LinkedReferenceBuilder> _references;
   List<EntityRefBuilder> _types;
 
@@ -1441,6 +2608,19 @@
   }
 
   @override
+  List<int> get parametersInheritingCovariant => _parametersInheritingCovariant ??= <int>[];
+
+  /**
+   * List of slot ids (referring to [UnlinkedParam.inheritsCovariantSlot])
+   * corresponding to parameters that inherit `@covariant` behavior from a base
+   * class.
+   */
+  void set parametersInheritingCovariant(List<int> value) {
+    assert(value == null || value.every((e) => e >= 0));
+    this._parametersInheritingCovariant = value;
+  }
+
+  @override
   List<LinkedReferenceBuilder> get references => _references ??= <LinkedReferenceBuilder>[];
 
   /**
@@ -1466,8 +2646,9 @@
     this._types = value;
   }
 
-  LinkedUnitBuilder({List<int> constCycles, List<LinkedReferenceBuilder> references, List<EntityRefBuilder> types})
+  LinkedUnitBuilder({List<int> constCycles, List<int> parametersInheritingCovariant, List<LinkedReferenceBuilder> references, List<EntityRefBuilder> types})
     : _constCycles = constCycles,
+      _parametersInheritingCovariant = parametersInheritingCovariant,
       _references = references,
       _types = types;
 
@@ -1507,15 +2688,27 @@
         signature.addInt(x);
       }
     }
+    if (this._parametersInheritingCovariant == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._parametersInheritingCovariant.length);
+      for (var x in this._parametersInheritingCovariant) {
+        signature.addInt(x);
+      }
+    }
   }
 
   fb.Offset finish(fb.Builder fbBuilder) {
     fb.Offset offset_constCycles;
+    fb.Offset offset_parametersInheritingCovariant;
     fb.Offset offset_references;
     fb.Offset offset_types;
     if (!(_constCycles == null || _constCycles.isEmpty)) {
       offset_constCycles = fbBuilder.writeListUint32(_constCycles);
     }
+    if (!(_parametersInheritingCovariant == null || _parametersInheritingCovariant.isEmpty)) {
+      offset_parametersInheritingCovariant = fbBuilder.writeListUint32(_parametersInheritingCovariant);
+    }
     if (!(_references == null || _references.isEmpty)) {
       offset_references = fbBuilder.writeList(_references.map((b) => b.finish(fbBuilder)).toList());
     }
@@ -1526,6 +2719,9 @@
     if (offset_constCycles != null) {
       fbBuilder.addOffset(2, offset_constCycles);
     }
+    if (offset_parametersInheritingCovariant != null) {
+      fbBuilder.addOffset(3, offset_parametersInheritingCovariant);
+    }
     if (offset_references != null) {
       fbBuilder.addOffset(0, offset_references);
     }
@@ -1550,6 +2746,7 @@
   _LinkedUnitImpl(this._bc, this._bcOffset);
 
   List<int> _constCycles;
+  List<int> _parametersInheritingCovariant;
   List<idl.LinkedReference> _references;
   List<idl.EntityRef> _types;
 
@@ -1560,6 +2757,12 @@
   }
 
   @override
+  List<int> get parametersInheritingCovariant {
+    _parametersInheritingCovariant ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 3, const <int>[]);
+    return _parametersInheritingCovariant;
+  }
+
+  @override
   List<idl.LinkedReference> get references {
     _references ??= const fb.ListReader<idl.LinkedReference>(const _LinkedReferenceReader()).vTableGet(_bc, _bcOffset, 0, const <idl.LinkedReference>[]);
     return _references;
@@ -1577,6 +2780,7 @@
   Map<String, Object> toJson() {
     Map<String, Object> _result = <String, Object>{};
     if (constCycles.isNotEmpty) _result["constCycles"] = constCycles;
+    if (parametersInheritingCovariant.isNotEmpty) _result["parametersInheritingCovariant"] = parametersInheritingCovariant;
     if (references.isNotEmpty) _result["references"] = references.map((_value) => _value.toJson()).toList();
     if (types.isNotEmpty) _result["types"] = types.map((_value) => _value.toJson()).toList();
     return _result;
@@ -1585,6 +2789,7 @@
   @override
   Map<String, Object> toMap() => {
     "constCycles": constCycles,
+    "parametersInheritingCovariant": parametersInheritingCovariant,
     "references": references,
     "types": types,
   };
@@ -3096,7 +4301,7 @@
 }
 
 class UnlinkedClassBuilder extends Object with _UnlinkedClassMixin implements idl.UnlinkedClass {
-  List<UnlinkedConstBuilder> _annotations;
+  List<UnlinkedExprBuilder> _annotations;
   CodeRangeBuilder _codeRange;
   UnlinkedDocumentationCommentBuilder _documentationComment;
   List<UnlinkedExecutableBuilder> _executables;
@@ -3112,12 +4317,12 @@
   List<UnlinkedTypeParamBuilder> _typeParameters;
 
   @override
-  List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstBuilder>[];
+  List<UnlinkedExprBuilder> get annotations => _annotations ??= <UnlinkedExprBuilder>[];
 
   /**
    * Annotations for this class.
    */
-  void set annotations(List<UnlinkedConstBuilder> value) {
+  void set annotations(List<UnlinkedExprBuilder> value) {
     this._annotations = value;
   }
 
@@ -3256,7 +4461,7 @@
     this._typeParameters = value;
   }
 
-  UnlinkedClassBuilder({List<UnlinkedConstBuilder> annotations, CodeRangeBuilder codeRange, UnlinkedDocumentationCommentBuilder documentationComment, List<UnlinkedExecutableBuilder> executables, List<UnlinkedVariableBuilder> fields, bool hasNoSupertype, List<EntityRefBuilder> interfaces, bool isAbstract, bool isMixinApplication, List<EntityRefBuilder> mixins, String name, int nameOffset, EntityRefBuilder supertype, List<UnlinkedTypeParamBuilder> typeParameters})
+  UnlinkedClassBuilder({List<UnlinkedExprBuilder> annotations, CodeRangeBuilder codeRange, UnlinkedDocumentationCommentBuilder documentationComment, List<UnlinkedExecutableBuilder> executables, List<UnlinkedVariableBuilder> fields, bool hasNoSupertype, List<EntityRefBuilder> interfaces, bool isAbstract, bool isMixinApplication, List<EntityRefBuilder> mixins, String name, int nameOffset, EntityRefBuilder supertype, List<UnlinkedTypeParamBuilder> typeParameters})
     : _annotations = annotations,
       _codeRange = codeRange,
       _documentationComment = documentationComment,
@@ -3449,7 +4654,7 @@
 
   _UnlinkedClassImpl(this._bc, this._bcOffset);
 
-  List<idl.UnlinkedConst> _annotations;
+  List<idl.UnlinkedExpr> _annotations;
   idl.CodeRange _codeRange;
   idl.UnlinkedDocumentationComment _documentationComment;
   List<idl.UnlinkedExecutable> _executables;
@@ -3465,8 +4670,8 @@
   List<idl.UnlinkedTypeParam> _typeParameters;
 
   @override
-  List<idl.UnlinkedConst> get annotations {
-    _annotations ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConstReader()).vTableGet(_bc, _bcOffset, 5, const <idl.UnlinkedConst>[]);
+  List<idl.UnlinkedExpr> get annotations {
+    _annotations ??= const fb.ListReader<idl.UnlinkedExpr>(const _UnlinkedExprReader()).vTableGet(_bc, _bcOffset, 5, const <idl.UnlinkedExpr>[]);
     return _annotations;
   }
 
@@ -3911,313 +5116,10 @@
   String toString() => convert.JSON.encode(toJson());
 }
 
-class UnlinkedConstBuilder extends Object with _UnlinkedConstMixin implements idl.UnlinkedConst {
-  List<idl.UnlinkedExprAssignOperator> _assignmentOperators;
-  List<double> _doubles;
-  List<int> _ints;
-  bool _isValidConst;
-  List<idl.UnlinkedConstOperation> _operations;
-  List<EntityRefBuilder> _references;
-  List<String> _strings;
-
-  @override
-  List<idl.UnlinkedExprAssignOperator> get assignmentOperators => _assignmentOperators ??= <idl.UnlinkedExprAssignOperator>[];
-
-  /**
-   * Sequence of operators used by assignment operations.
-   */
-  void set assignmentOperators(List<idl.UnlinkedExprAssignOperator> value) {
-    this._assignmentOperators = value;
-  }
-
-  @override
-  List<double> get doubles => _doubles ??= <double>[];
-
-  /**
-   * Sequence of 64-bit doubles consumed by the operation `pushDouble`.
-   */
-  void set doubles(List<double> value) {
-    this._doubles = value;
-  }
-
-  @override
-  List<int> get ints => _ints ??= <int>[];
-
-  /**
-   * Sequence of unsigned 32-bit integers consumed by the operations
-   * `pushArgument`, `pushInt`, `shiftOr`, `concatenate`, `invokeConstructor`,
-   * `makeList`, and `makeMap`.
-   */
-  void set ints(List<int> value) {
-    assert(value == null || value.every((e) => e >= 0));
-    this._ints = value;
-  }
-
-  @override
-  bool get isValidConst => _isValidConst ??= false;
-
-  /**
-   * Indicates whether the expression is a valid potentially constant
-   * expression.
-   */
-  void set isValidConst(bool value) {
-    this._isValidConst = value;
-  }
-
-  @override
-  List<idl.UnlinkedConstOperation> get operations => _operations ??= <idl.UnlinkedConstOperation>[];
-
-  /**
-   * Sequence of operations to execute (starting with an empty stack) to form
-   * the constant value.
-   */
-  void set operations(List<idl.UnlinkedConstOperation> value) {
-    this._operations = value;
-  }
-
-  @override
-  List<EntityRefBuilder> get references => _references ??= <EntityRefBuilder>[];
-
-  /**
-   * Sequence of language constructs consumed by the operations
-   * `pushReference`, `invokeConstructor`, `makeList`, and `makeMap`.  Note
-   * that in the case of `pushReference` (and sometimes `invokeConstructor` the
-   * actual entity being referred to may be something other than a type.
-   */
-  void set references(List<EntityRefBuilder> value) {
-    this._references = value;
-  }
-
-  @override
-  List<String> get strings => _strings ??= <String>[];
-
-  /**
-   * Sequence of strings consumed by the operations `pushString` and
-   * `invokeConstructor`.
-   */
-  void set strings(List<String> value) {
-    this._strings = value;
-  }
-
-  UnlinkedConstBuilder({List<idl.UnlinkedExprAssignOperator> assignmentOperators, List<double> doubles, List<int> ints, bool isValidConst, List<idl.UnlinkedConstOperation> operations, List<EntityRefBuilder> references, List<String> strings})
-    : _assignmentOperators = assignmentOperators,
-      _doubles = doubles,
-      _ints = ints,
-      _isValidConst = isValidConst,
-      _operations = operations,
-      _references = references,
-      _strings = strings;
-
-  /**
-   * Flush [informative] data recursively.
-   */
-  void flushInformative() {
-    _references?.forEach((b) => b.flushInformative());
-  }
-
-  /**
-   * Accumulate non-[informative] data into [signature].
-   */
-  void collectApiSignature(api_sig.ApiSignature signature) {
-    if (this._operations == null) {
-      signature.addInt(0);
-    } else {
-      signature.addInt(this._operations.length);
-      for (var x in this._operations) {
-        signature.addInt(x.index);
-      }
-    }
-    if (this._ints == null) {
-      signature.addInt(0);
-    } else {
-      signature.addInt(this._ints.length);
-      for (var x in this._ints) {
-        signature.addInt(x);
-      }
-    }
-    if (this._references == null) {
-      signature.addInt(0);
-    } else {
-      signature.addInt(this._references.length);
-      for (var x in this._references) {
-        x?.collectApiSignature(signature);
-      }
-    }
-    if (this._strings == null) {
-      signature.addInt(0);
-    } else {
-      signature.addInt(this._strings.length);
-      for (var x in this._strings) {
-        signature.addString(x);
-      }
-    }
-    if (this._doubles == null) {
-      signature.addInt(0);
-    } else {
-      signature.addInt(this._doubles.length);
-      for (var x in this._doubles) {
-        signature.addDouble(x);
-      }
-    }
-    signature.addBool(this._isValidConst == true);
-    if (this._assignmentOperators == null) {
-      signature.addInt(0);
-    } else {
-      signature.addInt(this._assignmentOperators.length);
-      for (var x in this._assignmentOperators) {
-        signature.addInt(x.index);
-      }
-    }
-  }
-
-  fb.Offset finish(fb.Builder fbBuilder) {
-    fb.Offset offset_assignmentOperators;
-    fb.Offset offset_doubles;
-    fb.Offset offset_ints;
-    fb.Offset offset_operations;
-    fb.Offset offset_references;
-    fb.Offset offset_strings;
-    if (!(_assignmentOperators == null || _assignmentOperators.isEmpty)) {
-      offset_assignmentOperators = fbBuilder.writeListUint8(_assignmentOperators.map((b) => b.index).toList());
-    }
-    if (!(_doubles == null || _doubles.isEmpty)) {
-      offset_doubles = fbBuilder.writeListFloat64(_doubles);
-    }
-    if (!(_ints == null || _ints.isEmpty)) {
-      offset_ints = fbBuilder.writeListUint32(_ints);
-    }
-    if (!(_operations == null || _operations.isEmpty)) {
-      offset_operations = fbBuilder.writeListUint8(_operations.map((b) => b.index).toList());
-    }
-    if (!(_references == null || _references.isEmpty)) {
-      offset_references = fbBuilder.writeList(_references.map((b) => b.finish(fbBuilder)).toList());
-    }
-    if (!(_strings == null || _strings.isEmpty)) {
-      offset_strings = fbBuilder.writeList(_strings.map((b) => fbBuilder.writeString(b)).toList());
-    }
-    fbBuilder.startTable();
-    if (offset_assignmentOperators != null) {
-      fbBuilder.addOffset(6, offset_assignmentOperators);
-    }
-    if (offset_doubles != null) {
-      fbBuilder.addOffset(4, offset_doubles);
-    }
-    if (offset_ints != null) {
-      fbBuilder.addOffset(1, offset_ints);
-    }
-    if (_isValidConst == true) {
-      fbBuilder.addBool(5, true);
-    }
-    if (offset_operations != null) {
-      fbBuilder.addOffset(0, offset_operations);
-    }
-    if (offset_references != null) {
-      fbBuilder.addOffset(2, offset_references);
-    }
-    if (offset_strings != null) {
-      fbBuilder.addOffset(3, offset_strings);
-    }
-    return fbBuilder.endTable();
-  }
-}
-
-class _UnlinkedConstReader extends fb.TableReader<_UnlinkedConstImpl> {
-  const _UnlinkedConstReader();
-
-  @override
-  _UnlinkedConstImpl createObject(fb.BufferContext bc, int offset) => new _UnlinkedConstImpl(bc, offset);
-}
-
-class _UnlinkedConstImpl extends Object with _UnlinkedConstMixin implements idl.UnlinkedConst {
-  final fb.BufferContext _bc;
-  final int _bcOffset;
-
-  _UnlinkedConstImpl(this._bc, this._bcOffset);
-
-  List<idl.UnlinkedExprAssignOperator> _assignmentOperators;
-  List<double> _doubles;
-  List<int> _ints;
-  bool _isValidConst;
-  List<idl.UnlinkedConstOperation> _operations;
-  List<idl.EntityRef> _references;
-  List<String> _strings;
-
-  @override
-  List<idl.UnlinkedExprAssignOperator> get assignmentOperators {
-    _assignmentOperators ??= const fb.ListReader<idl.UnlinkedExprAssignOperator>(const _UnlinkedExprAssignOperatorReader()).vTableGet(_bc, _bcOffset, 6, const <idl.UnlinkedExprAssignOperator>[]);
-    return _assignmentOperators;
-  }
-
-  @override
-  List<double> get doubles {
-    _doubles ??= const fb.Float64ListReader().vTableGet(_bc, _bcOffset, 4, const <double>[]);
-    return _doubles;
-  }
-
-  @override
-  List<int> get ints {
-    _ints ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 1, const <int>[]);
-    return _ints;
-  }
-
-  @override
-  bool get isValidConst {
-    _isValidConst ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 5, false);
-    return _isValidConst;
-  }
-
-  @override
-  List<idl.UnlinkedConstOperation> get operations {
-    _operations ??= const fb.ListReader<idl.UnlinkedConstOperation>(const _UnlinkedConstOperationReader()).vTableGet(_bc, _bcOffset, 0, const <idl.UnlinkedConstOperation>[]);
-    return _operations;
-  }
-
-  @override
-  List<idl.EntityRef> get references {
-    _references ??= const fb.ListReader<idl.EntityRef>(const _EntityRefReader()).vTableGet(_bc, _bcOffset, 2, const <idl.EntityRef>[]);
-    return _references;
-  }
-
-  @override
-  List<String> get strings {
-    _strings ??= const fb.ListReader<String>(const fb.StringReader()).vTableGet(_bc, _bcOffset, 3, const <String>[]);
-    return _strings;
-  }
-}
-
-abstract class _UnlinkedConstMixin implements idl.UnlinkedConst {
-  @override
-  Map<String, Object> toJson() {
-    Map<String, Object> _result = <String, Object>{};
-    if (assignmentOperators.isNotEmpty) _result["assignmentOperators"] = assignmentOperators.map((_value) => _value.toString().split('.')[1]).toList();
-    if (doubles.isNotEmpty) _result["doubles"] = doubles.map((_value) => _value.isFinite ? _value : _value.toString()).toList();
-    if (ints.isNotEmpty) _result["ints"] = ints;
-    if (isValidConst != false) _result["isValidConst"] = isValidConst;
-    if (operations.isNotEmpty) _result["operations"] = operations.map((_value) => _value.toString().split('.')[1]).toList();
-    if (references.isNotEmpty) _result["references"] = references.map((_value) => _value.toJson()).toList();
-    if (strings.isNotEmpty) _result["strings"] = strings;
-    return _result;
-  }
-
-  @override
-  Map<String, Object> toMap() => {
-    "assignmentOperators": assignmentOperators,
-    "doubles": doubles,
-    "ints": ints,
-    "isValidConst": isValidConst,
-    "operations": operations,
-    "references": references,
-    "strings": strings,
-  };
-
-  @override
-  String toString() => convert.JSON.encode(toJson());
-}
-
 class UnlinkedConstructorInitializerBuilder extends Object with _UnlinkedConstructorInitializerMixin implements idl.UnlinkedConstructorInitializer {
   List<String> _argumentNames;
-  List<UnlinkedConstBuilder> _arguments;
-  UnlinkedConstBuilder _expression;
+  List<UnlinkedExprBuilder> _arguments;
+  UnlinkedExprBuilder _expression;
   idl.UnlinkedConstructorInitializerKind _kind;
   String _name;
 
@@ -4234,24 +5136,24 @@
   }
 
   @override
-  List<UnlinkedConstBuilder> get arguments => _arguments ??= <UnlinkedConstBuilder>[];
+  List<UnlinkedExprBuilder> get arguments => _arguments ??= <UnlinkedExprBuilder>[];
 
   /**
    * If [kind] is `thisInvocation` or `superInvocation`, the arguments of the
    * invocation.  Otherwise empty.
    */
-  void set arguments(List<UnlinkedConstBuilder> value) {
+  void set arguments(List<UnlinkedExprBuilder> value) {
     this._arguments = value;
   }
 
   @override
-  UnlinkedConstBuilder get expression => _expression;
+  UnlinkedExprBuilder get expression => _expression;
 
   /**
    * If [kind] is `field`, the expression of the field initializer.
    * Otherwise `null`.
    */
-  void set expression(UnlinkedConstBuilder value) {
+  void set expression(UnlinkedExprBuilder value) {
     this._expression = value;
   }
 
@@ -4278,7 +5180,7 @@
     this._name = value;
   }
 
-  UnlinkedConstructorInitializerBuilder({List<String> argumentNames, List<UnlinkedConstBuilder> arguments, UnlinkedConstBuilder expression, idl.UnlinkedConstructorInitializerKind kind, String name})
+  UnlinkedConstructorInitializerBuilder({List<String> argumentNames, List<UnlinkedExprBuilder> arguments, UnlinkedExprBuilder expression, idl.UnlinkedConstructorInitializerKind kind, String name})
     : _argumentNames = argumentNames,
       _arguments = arguments,
       _expression = expression,
@@ -4370,8 +5272,8 @@
   _UnlinkedConstructorInitializerImpl(this._bc, this._bcOffset);
 
   List<String> _argumentNames;
-  List<idl.UnlinkedConst> _arguments;
-  idl.UnlinkedConst _expression;
+  List<idl.UnlinkedExpr> _arguments;
+  idl.UnlinkedExpr _expression;
   idl.UnlinkedConstructorInitializerKind _kind;
   String _name;
 
@@ -4382,14 +5284,14 @@
   }
 
   @override
-  List<idl.UnlinkedConst> get arguments {
-    _arguments ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConstReader()).vTableGet(_bc, _bcOffset, 3, const <idl.UnlinkedConst>[]);
+  List<idl.UnlinkedExpr> get arguments {
+    _arguments ??= const fb.ListReader<idl.UnlinkedExpr>(const _UnlinkedExprReader()).vTableGet(_bc, _bcOffset, 3, const <idl.UnlinkedExpr>[]);
     return _arguments;
   }
 
   @override
-  idl.UnlinkedConst get expression {
-    _expression ??= const _UnlinkedConstReader().vTableGet(_bc, _bcOffset, 1, null);
+  idl.UnlinkedExpr get expression {
+    _expression ??= const _UnlinkedExprReader().vTableGet(_bc, _bcOffset, 1, null);
     return _expression;
   }
 
@@ -4528,7 +5430,7 @@
 }
 
 class UnlinkedEnumBuilder extends Object with _UnlinkedEnumMixin implements idl.UnlinkedEnum {
-  List<UnlinkedConstBuilder> _annotations;
+  List<UnlinkedExprBuilder> _annotations;
   CodeRangeBuilder _codeRange;
   UnlinkedDocumentationCommentBuilder _documentationComment;
   String _name;
@@ -4536,12 +5438,12 @@
   List<UnlinkedEnumValueBuilder> _values;
 
   @override
-  List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstBuilder>[];
+  List<UnlinkedExprBuilder> get annotations => _annotations ??= <UnlinkedExprBuilder>[];
 
   /**
    * Annotations for this enum.
    */
-  void set annotations(List<UnlinkedConstBuilder> value) {
+  void set annotations(List<UnlinkedExprBuilder> value) {
     this._annotations = value;
   }
 
@@ -4597,7 +5499,7 @@
     this._values = value;
   }
 
-  UnlinkedEnumBuilder({List<UnlinkedConstBuilder> annotations, CodeRangeBuilder codeRange, UnlinkedDocumentationCommentBuilder documentationComment, String name, int nameOffset, List<UnlinkedEnumValueBuilder> values})
+  UnlinkedEnumBuilder({List<UnlinkedExprBuilder> annotations, CodeRangeBuilder codeRange, UnlinkedDocumentationCommentBuilder documentationComment, String name, int nameOffset, List<UnlinkedEnumValueBuilder> values})
     : _annotations = annotations,
       _codeRange = codeRange,
       _documentationComment = documentationComment,
@@ -4696,7 +5598,7 @@
 
   _UnlinkedEnumImpl(this._bc, this._bcOffset);
 
-  List<idl.UnlinkedConst> _annotations;
+  List<idl.UnlinkedExpr> _annotations;
   idl.CodeRange _codeRange;
   idl.UnlinkedDocumentationComment _documentationComment;
   String _name;
@@ -4704,8 +5606,8 @@
   List<idl.UnlinkedEnumValue> _values;
 
   @override
-  List<idl.UnlinkedConst> get annotations {
-    _annotations ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConstReader()).vTableGet(_bc, _bcOffset, 4, const <idl.UnlinkedConst>[]);
+  List<idl.UnlinkedExpr> get annotations {
+    _annotations ??= const fb.ListReader<idl.UnlinkedExpr>(const _UnlinkedExprReader()).vTableGet(_bc, _bcOffset, 4, const <idl.UnlinkedExpr>[]);
     return _annotations;
   }
 
@@ -4905,8 +5807,8 @@
 }
 
 class UnlinkedExecutableBuilder extends Object with _UnlinkedExecutableMixin implements idl.UnlinkedExecutable {
-  List<UnlinkedConstBuilder> _annotations;
-  UnlinkedConstBuilder _bodyExpr;
+  List<UnlinkedExprBuilder> _annotations;
+  UnlinkedExprBuilder _bodyExpr;
   CodeRangeBuilder _codeRange;
   List<UnlinkedConstructorInitializerBuilder> _constantInitializers;
   int _constCycleSlot;
@@ -4937,24 +5839,24 @@
   int _visibleOffset;
 
   @override
-  List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstBuilder>[];
+  List<UnlinkedExprBuilder> get annotations => _annotations ??= <UnlinkedExprBuilder>[];
 
   /**
    * Annotations for this executable.
    */
-  void set annotations(List<UnlinkedConstBuilder> value) {
+  void set annotations(List<UnlinkedExprBuilder> value) {
     this._annotations = value;
   }
 
   @override
-  UnlinkedConstBuilder get bodyExpr => _bodyExpr;
+  UnlinkedExprBuilder get bodyExpr => _bodyExpr;
 
   /**
    * If this executable's function body is declared using `=>`, the expression
    * to the right of the `=>`.  May be omitted if neither type inference nor
    * constant evaluation depends on the function body.
    */
-  void set bodyExpr(UnlinkedConstBuilder value) {
+  void set bodyExpr(UnlinkedExprBuilder value) {
     this._bodyExpr = value;
   }
 
@@ -5278,7 +6180,7 @@
     this._visibleOffset = value;
   }
 
-  UnlinkedExecutableBuilder({List<UnlinkedConstBuilder> annotations, UnlinkedConstBuilder bodyExpr, CodeRangeBuilder codeRange, List<UnlinkedConstructorInitializerBuilder> constantInitializers, int constCycleSlot, UnlinkedDocumentationCommentBuilder documentationComment, int inferredReturnTypeSlot, bool isAbstract, bool isAsynchronous, bool isConst, bool isExternal, bool isFactory, bool isGenerator, bool isRedirectedConstructor, bool isStatic, idl.UnlinkedExecutableKind kind, List<UnlinkedExecutableBuilder> localFunctions, List<UnlinkedLabelBuilder> localLabels, List<UnlinkedVariableBuilder> localVariables, String name, int nameEnd, int nameOffset, List<UnlinkedParamBuilder> parameters, int periodOffset, EntityRefBuilder redirectedConstructor, String redirectedConstructorName, EntityRefBuilder returnType, List<UnlinkedTypeParamBuilder> typeParameters, int visibleLength, int visibleOffset})
+  UnlinkedExecutableBuilder({List<UnlinkedExprBuilder> annotations, UnlinkedExprBuilder bodyExpr, CodeRangeBuilder codeRange, List<UnlinkedConstructorInitializerBuilder> constantInitializers, int constCycleSlot, UnlinkedDocumentationCommentBuilder documentationComment, int inferredReturnTypeSlot, bool isAbstract, bool isAsynchronous, bool isConst, bool isExternal, bool isFactory, bool isGenerator, bool isRedirectedConstructor, bool isStatic, idl.UnlinkedExecutableKind kind, List<UnlinkedExecutableBuilder> localFunctions, List<UnlinkedLabelBuilder> localLabels, List<UnlinkedVariableBuilder> localVariables, String name, int nameEnd, int nameOffset, List<UnlinkedParamBuilder> parameters, int periodOffset, EntityRefBuilder redirectedConstructor, String redirectedConstructorName, EntityRefBuilder returnType, List<UnlinkedTypeParamBuilder> typeParameters, int visibleLength, int visibleOffset})
     : _annotations = annotations,
       _bodyExpr = bodyExpr,
       _codeRange = codeRange,
@@ -5331,6 +6233,8 @@
     _redirectedConstructor?.flushInformative();
     _returnType?.flushInformative();
     _typeParameters?.forEach((b) => b.flushInformative());
+    _visibleLength = null;
+    _visibleOffset = null;
   }
 
   /**
@@ -5391,8 +6295,6 @@
         x?.collectApiSignature(signature);
       }
     }
-    signature.addInt(this._visibleLength ?? 0);
-    signature.addInt(this._visibleOffset ?? 0);
     signature.addInt(this._constCycleSlot ?? 0);
     signature.addBool(this._bodyExpr != null);
     this._bodyExpr?.collectApiSignature(signature);
@@ -5563,8 +6465,8 @@
 
   _UnlinkedExecutableImpl(this._bc, this._bcOffset);
 
-  List<idl.UnlinkedConst> _annotations;
-  idl.UnlinkedConst _bodyExpr;
+  List<idl.UnlinkedExpr> _annotations;
+  idl.UnlinkedExpr _bodyExpr;
   idl.CodeRange _codeRange;
   List<idl.UnlinkedConstructorInitializer> _constantInitializers;
   int _constCycleSlot;
@@ -5595,14 +6497,14 @@
   int _visibleOffset;
 
   @override
-  List<idl.UnlinkedConst> get annotations {
-    _annotations ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConstReader()).vTableGet(_bc, _bcOffset, 6, const <idl.UnlinkedConst>[]);
+  List<idl.UnlinkedExpr> get annotations {
+    _annotations ??= const fb.ListReader<idl.UnlinkedExpr>(const _UnlinkedExprReader()).vTableGet(_bc, _bcOffset, 6, const <idl.UnlinkedExpr>[]);
     return _annotations;
   }
 
   @override
-  idl.UnlinkedConst get bodyExpr {
-    _bodyExpr ??= const _UnlinkedConstReader().vTableGet(_bc, _bcOffset, 29, null);
+  idl.UnlinkedExpr get bodyExpr {
+    _bodyExpr ??= const _UnlinkedExprReader().vTableGet(_bc, _bcOffset, 29, null);
     return _bodyExpr;
   }
 
@@ -5851,18 +6753,18 @@
 }
 
 class UnlinkedExportNonPublicBuilder extends Object with _UnlinkedExportNonPublicMixin implements idl.UnlinkedExportNonPublic {
-  List<UnlinkedConstBuilder> _annotations;
+  List<UnlinkedExprBuilder> _annotations;
   int _offset;
   int _uriEnd;
   int _uriOffset;
 
   @override
-  List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstBuilder>[];
+  List<UnlinkedExprBuilder> get annotations => _annotations ??= <UnlinkedExprBuilder>[];
 
   /**
    * Annotations for this export directive.
    */
-  void set annotations(List<UnlinkedConstBuilder> value) {
+  void set annotations(List<UnlinkedExprBuilder> value) {
     this._annotations = value;
   }
 
@@ -5901,7 +6803,7 @@
     this._uriOffset = value;
   }
 
-  UnlinkedExportNonPublicBuilder({List<UnlinkedConstBuilder> annotations, int offset, int uriEnd, int uriOffset})
+  UnlinkedExportNonPublicBuilder({List<UnlinkedExprBuilder> annotations, int offset, int uriEnd, int uriOffset})
     : _annotations = annotations,
       _offset = offset,
       _uriEnd = uriEnd,
@@ -5966,14 +6868,14 @@
 
   _UnlinkedExportNonPublicImpl(this._bc, this._bcOffset);
 
-  List<idl.UnlinkedConst> _annotations;
+  List<idl.UnlinkedExpr> _annotations;
   int _offset;
   int _uriEnd;
   int _uriOffset;
 
   @override
-  List<idl.UnlinkedConst> get annotations {
-    _annotations ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConstReader()).vTableGet(_bc, _bcOffset, 3, const <idl.UnlinkedConst>[]);
+  List<idl.UnlinkedExpr> get annotations {
+    _annotations ??= const fb.ListReader<idl.UnlinkedExpr>(const _UnlinkedExprReader()).vTableGet(_bc, _bcOffset, 3, const <idl.UnlinkedExpr>[]);
     return _annotations;
   }
 
@@ -6175,8 +7077,311 @@
   String toString() => convert.JSON.encode(toJson());
 }
 
+class UnlinkedExprBuilder extends Object with _UnlinkedExprMixin implements idl.UnlinkedExpr {
+  List<idl.UnlinkedExprAssignOperator> _assignmentOperators;
+  List<double> _doubles;
+  List<int> _ints;
+  bool _isValidConst;
+  List<idl.UnlinkedExprOperation> _operations;
+  List<EntityRefBuilder> _references;
+  List<String> _strings;
+
+  @override
+  List<idl.UnlinkedExprAssignOperator> get assignmentOperators => _assignmentOperators ??= <idl.UnlinkedExprAssignOperator>[];
+
+  /**
+   * Sequence of operators used by assignment operations.
+   */
+  void set assignmentOperators(List<idl.UnlinkedExprAssignOperator> value) {
+    this._assignmentOperators = value;
+  }
+
+  @override
+  List<double> get doubles => _doubles ??= <double>[];
+
+  /**
+   * Sequence of 64-bit doubles consumed by the operation `pushDouble`.
+   */
+  void set doubles(List<double> value) {
+    this._doubles = value;
+  }
+
+  @override
+  List<int> get ints => _ints ??= <int>[];
+
+  /**
+   * Sequence of unsigned 32-bit integers consumed by the operations
+   * `pushArgument`, `pushInt`, `shiftOr`, `concatenate`, `invokeConstructor`,
+   * `makeList`, and `makeMap`.
+   */
+  void set ints(List<int> value) {
+    assert(value == null || value.every((e) => e >= 0));
+    this._ints = value;
+  }
+
+  @override
+  bool get isValidConst => _isValidConst ??= false;
+
+  /**
+   * Indicates whether the expression is a valid potentially constant
+   * expression.
+   */
+  void set isValidConst(bool value) {
+    this._isValidConst = value;
+  }
+
+  @override
+  List<idl.UnlinkedExprOperation> get operations => _operations ??= <idl.UnlinkedExprOperation>[];
+
+  /**
+   * Sequence of operations to execute (starting with an empty stack) to form
+   * the constant value.
+   */
+  void set operations(List<idl.UnlinkedExprOperation> value) {
+    this._operations = value;
+  }
+
+  @override
+  List<EntityRefBuilder> get references => _references ??= <EntityRefBuilder>[];
+
+  /**
+   * Sequence of language constructs consumed by the operations
+   * `pushReference`, `invokeConstructor`, `makeList`, and `makeMap`.  Note
+   * that in the case of `pushReference` (and sometimes `invokeConstructor` the
+   * actual entity being referred to may be something other than a type.
+   */
+  void set references(List<EntityRefBuilder> value) {
+    this._references = value;
+  }
+
+  @override
+  List<String> get strings => _strings ??= <String>[];
+
+  /**
+   * Sequence of strings consumed by the operations `pushString` and
+   * `invokeConstructor`.
+   */
+  void set strings(List<String> value) {
+    this._strings = value;
+  }
+
+  UnlinkedExprBuilder({List<idl.UnlinkedExprAssignOperator> assignmentOperators, List<double> doubles, List<int> ints, bool isValidConst, List<idl.UnlinkedExprOperation> operations, List<EntityRefBuilder> references, List<String> strings})
+    : _assignmentOperators = assignmentOperators,
+      _doubles = doubles,
+      _ints = ints,
+      _isValidConst = isValidConst,
+      _operations = operations,
+      _references = references,
+      _strings = strings;
+
+  /**
+   * Flush [informative] data recursively.
+   */
+  void flushInformative() {
+    _references?.forEach((b) => b.flushInformative());
+  }
+
+  /**
+   * Accumulate non-[informative] data into [signature].
+   */
+  void collectApiSignature(api_sig.ApiSignature signature) {
+    if (this._operations == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._operations.length);
+      for (var x in this._operations) {
+        signature.addInt(x.index);
+      }
+    }
+    if (this._ints == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._ints.length);
+      for (var x in this._ints) {
+        signature.addInt(x);
+      }
+    }
+    if (this._references == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._references.length);
+      for (var x in this._references) {
+        x?.collectApiSignature(signature);
+      }
+    }
+    if (this._strings == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._strings.length);
+      for (var x in this._strings) {
+        signature.addString(x);
+      }
+    }
+    if (this._doubles == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._doubles.length);
+      for (var x in this._doubles) {
+        signature.addDouble(x);
+      }
+    }
+    signature.addBool(this._isValidConst == true);
+    if (this._assignmentOperators == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._assignmentOperators.length);
+      for (var x in this._assignmentOperators) {
+        signature.addInt(x.index);
+      }
+    }
+  }
+
+  fb.Offset finish(fb.Builder fbBuilder) {
+    fb.Offset offset_assignmentOperators;
+    fb.Offset offset_doubles;
+    fb.Offset offset_ints;
+    fb.Offset offset_operations;
+    fb.Offset offset_references;
+    fb.Offset offset_strings;
+    if (!(_assignmentOperators == null || _assignmentOperators.isEmpty)) {
+      offset_assignmentOperators = fbBuilder.writeListUint8(_assignmentOperators.map((b) => b.index).toList());
+    }
+    if (!(_doubles == null || _doubles.isEmpty)) {
+      offset_doubles = fbBuilder.writeListFloat64(_doubles);
+    }
+    if (!(_ints == null || _ints.isEmpty)) {
+      offset_ints = fbBuilder.writeListUint32(_ints);
+    }
+    if (!(_operations == null || _operations.isEmpty)) {
+      offset_operations = fbBuilder.writeListUint8(_operations.map((b) => b.index).toList());
+    }
+    if (!(_references == null || _references.isEmpty)) {
+      offset_references = fbBuilder.writeList(_references.map((b) => b.finish(fbBuilder)).toList());
+    }
+    if (!(_strings == null || _strings.isEmpty)) {
+      offset_strings = fbBuilder.writeList(_strings.map((b) => fbBuilder.writeString(b)).toList());
+    }
+    fbBuilder.startTable();
+    if (offset_assignmentOperators != null) {
+      fbBuilder.addOffset(6, offset_assignmentOperators);
+    }
+    if (offset_doubles != null) {
+      fbBuilder.addOffset(4, offset_doubles);
+    }
+    if (offset_ints != null) {
+      fbBuilder.addOffset(1, offset_ints);
+    }
+    if (_isValidConst == true) {
+      fbBuilder.addBool(5, true);
+    }
+    if (offset_operations != null) {
+      fbBuilder.addOffset(0, offset_operations);
+    }
+    if (offset_references != null) {
+      fbBuilder.addOffset(2, offset_references);
+    }
+    if (offset_strings != null) {
+      fbBuilder.addOffset(3, offset_strings);
+    }
+    return fbBuilder.endTable();
+  }
+}
+
+class _UnlinkedExprReader extends fb.TableReader<_UnlinkedExprImpl> {
+  const _UnlinkedExprReader();
+
+  @override
+  _UnlinkedExprImpl createObject(fb.BufferContext bc, int offset) => new _UnlinkedExprImpl(bc, offset);
+}
+
+class _UnlinkedExprImpl extends Object with _UnlinkedExprMixin implements idl.UnlinkedExpr {
+  final fb.BufferContext _bc;
+  final int _bcOffset;
+
+  _UnlinkedExprImpl(this._bc, this._bcOffset);
+
+  List<idl.UnlinkedExprAssignOperator> _assignmentOperators;
+  List<double> _doubles;
+  List<int> _ints;
+  bool _isValidConst;
+  List<idl.UnlinkedExprOperation> _operations;
+  List<idl.EntityRef> _references;
+  List<String> _strings;
+
+  @override
+  List<idl.UnlinkedExprAssignOperator> get assignmentOperators {
+    _assignmentOperators ??= const fb.ListReader<idl.UnlinkedExprAssignOperator>(const _UnlinkedExprAssignOperatorReader()).vTableGet(_bc, _bcOffset, 6, const <idl.UnlinkedExprAssignOperator>[]);
+    return _assignmentOperators;
+  }
+
+  @override
+  List<double> get doubles {
+    _doubles ??= const fb.Float64ListReader().vTableGet(_bc, _bcOffset, 4, const <double>[]);
+    return _doubles;
+  }
+
+  @override
+  List<int> get ints {
+    _ints ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 1, const <int>[]);
+    return _ints;
+  }
+
+  @override
+  bool get isValidConst {
+    _isValidConst ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 5, false);
+    return _isValidConst;
+  }
+
+  @override
+  List<idl.UnlinkedExprOperation> get operations {
+    _operations ??= const fb.ListReader<idl.UnlinkedExprOperation>(const _UnlinkedExprOperationReader()).vTableGet(_bc, _bcOffset, 0, const <idl.UnlinkedExprOperation>[]);
+    return _operations;
+  }
+
+  @override
+  List<idl.EntityRef> get references {
+    _references ??= const fb.ListReader<idl.EntityRef>(const _EntityRefReader()).vTableGet(_bc, _bcOffset, 2, const <idl.EntityRef>[]);
+    return _references;
+  }
+
+  @override
+  List<String> get strings {
+    _strings ??= const fb.ListReader<String>(const fb.StringReader()).vTableGet(_bc, _bcOffset, 3, const <String>[]);
+    return _strings;
+  }
+}
+
+abstract class _UnlinkedExprMixin implements idl.UnlinkedExpr {
+  @override
+  Map<String, Object> toJson() {
+    Map<String, Object> _result = <String, Object>{};
+    if (assignmentOperators.isNotEmpty) _result["assignmentOperators"] = assignmentOperators.map((_value) => _value.toString().split('.')[1]).toList();
+    if (doubles.isNotEmpty) _result["doubles"] = doubles.map((_value) => _value.isFinite ? _value : _value.toString()).toList();
+    if (ints.isNotEmpty) _result["ints"] = ints;
+    if (isValidConst != false) _result["isValidConst"] = isValidConst;
+    if (operations.isNotEmpty) _result["operations"] = operations.map((_value) => _value.toString().split('.')[1]).toList();
+    if (references.isNotEmpty) _result["references"] = references.map((_value) => _value.toJson()).toList();
+    if (strings.isNotEmpty) _result["strings"] = strings;
+    return _result;
+  }
+
+  @override
+  Map<String, Object> toMap() => {
+    "assignmentOperators": assignmentOperators,
+    "doubles": doubles,
+    "ints": ints,
+    "isValidConst": isValidConst,
+    "operations": operations,
+    "references": references,
+    "strings": strings,
+  };
+
+  @override
+  String toString() => convert.JSON.encode(toJson());
+}
+
 class UnlinkedImportBuilder extends Object with _UnlinkedImportMixin implements idl.UnlinkedImport {
-  List<UnlinkedConstBuilder> _annotations;
+  List<UnlinkedExprBuilder> _annotations;
   List<UnlinkedCombinatorBuilder> _combinators;
   List<UnlinkedConfigurationBuilder> _configurations;
   bool _isDeferred;
@@ -6189,12 +7394,12 @@
   int _uriOffset;
 
   @override
-  List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstBuilder>[];
+  List<UnlinkedExprBuilder> get annotations => _annotations ??= <UnlinkedExprBuilder>[];
 
   /**
    * Annotations for this import declaration.
    */
-  void set annotations(List<UnlinkedConstBuilder> value) {
+  void set annotations(List<UnlinkedExprBuilder> value) {
     this._annotations = value;
   }
 
@@ -6311,7 +7516,7 @@
     this._uriOffset = value;
   }
 
-  UnlinkedImportBuilder({List<UnlinkedConstBuilder> annotations, List<UnlinkedCombinatorBuilder> combinators, List<UnlinkedConfigurationBuilder> configurations, bool isDeferred, bool isImplicit, int offset, int prefixOffset, int prefixReference, String uri, int uriEnd, int uriOffset})
+  UnlinkedImportBuilder({List<UnlinkedExprBuilder> annotations, List<UnlinkedCombinatorBuilder> combinators, List<UnlinkedConfigurationBuilder> configurations, bool isDeferred, bool isImplicit, int offset, int prefixOffset, int prefixReference, String uri, int uriEnd, int uriOffset})
     : _annotations = annotations,
       _combinators = combinators,
       _configurations = configurations,
@@ -6439,7 +7644,7 @@
 
   _UnlinkedImportImpl(this._bc, this._bcOffset);
 
-  List<idl.UnlinkedConst> _annotations;
+  List<idl.UnlinkedExpr> _annotations;
   List<idl.UnlinkedCombinator> _combinators;
   List<idl.UnlinkedConfiguration> _configurations;
   bool _isDeferred;
@@ -6452,8 +7657,8 @@
   int _uriOffset;
 
   @override
-  List<idl.UnlinkedConst> get annotations {
-    _annotations ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConstReader()).vTableGet(_bc, _bcOffset, 8, const <idl.UnlinkedConst>[]);
+  List<idl.UnlinkedExpr> get annotations {
+    _annotations ??= const fb.ListReader<idl.UnlinkedExpr>(const _UnlinkedExprReader()).vTableGet(_bc, _bcOffset, 8, const <idl.UnlinkedExpr>[]);
     return _annotations;
   }
 
@@ -6714,10 +7919,11 @@
 }
 
 class UnlinkedParamBuilder extends Object with _UnlinkedParamMixin implements idl.UnlinkedParam {
-  List<UnlinkedConstBuilder> _annotations;
+  List<UnlinkedExprBuilder> _annotations;
   CodeRangeBuilder _codeRange;
   String _defaultValueCode;
   int _inferredTypeSlot;
+  int _inheritsCovariantSlot;
   UnlinkedExecutableBuilder _initializer;
   bool _isFunctionTyped;
   bool _isInitializingFormal;
@@ -6730,12 +7936,12 @@
   int _visibleOffset;
 
   @override
-  List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstBuilder>[];
+  List<UnlinkedExprBuilder> get annotations => _annotations ??= <UnlinkedExprBuilder>[];
 
   /**
    * Annotations for this parameter.
    */
-  void set annotations(List<UnlinkedConstBuilder> value) {
+  void set annotations(List<UnlinkedExprBuilder> value) {
     this._annotations = value;
   }
 
@@ -6780,6 +7986,22 @@
   }
 
   @override
+  int get inheritsCovariantSlot => _inheritsCovariantSlot ??= 0;
+
+  /**
+   * If this is a parameter of an instance method, a nonzero slot id which is
+   * unique within this compilation unit.  If this id is found in
+   * [LinkedUnit.parametersInheritingCovariant], then this parameter inherits
+   * `@covariant` behavior from a base class.
+   *
+   * Otherwise, zero.
+   */
+  void set inheritsCovariantSlot(int value) {
+    assert(value == null || value >= 0);
+    this._inheritsCovariantSlot = value;
+  }
+
+  @override
   UnlinkedExecutableBuilder get initializer => _initializer;
 
   /**
@@ -6886,11 +8108,12 @@
     this._visibleOffset = value;
   }
 
-  UnlinkedParamBuilder({List<UnlinkedConstBuilder> annotations, CodeRangeBuilder codeRange, String defaultValueCode, int inferredTypeSlot, UnlinkedExecutableBuilder initializer, bool isFunctionTyped, bool isInitializingFormal, idl.UnlinkedParamKind kind, String name, int nameOffset, List<UnlinkedParamBuilder> parameters, EntityRefBuilder type, int visibleLength, int visibleOffset})
+  UnlinkedParamBuilder({List<UnlinkedExprBuilder> annotations, CodeRangeBuilder codeRange, String defaultValueCode, int inferredTypeSlot, int inheritsCovariantSlot, UnlinkedExecutableBuilder initializer, bool isFunctionTyped, bool isInitializingFormal, idl.UnlinkedParamKind kind, String name, int nameOffset, List<UnlinkedParamBuilder> parameters, EntityRefBuilder type, int visibleLength, int visibleOffset})
     : _annotations = annotations,
       _codeRange = codeRange,
       _defaultValueCode = defaultValueCode,
       _inferredTypeSlot = inferredTypeSlot,
+      _inheritsCovariantSlot = inheritsCovariantSlot,
       _initializer = initializer,
       _isFunctionTyped = isFunctionTyped,
       _isInitializingFormal = isInitializingFormal,
@@ -6913,6 +8136,8 @@
     _nameOffset = null;
     _parameters?.forEach((b) => b.flushInformative());
     _type?.flushInformative();
+    _visibleLength = null;
+    _visibleOffset = null;
   }
 
   /**
@@ -6942,10 +8167,9 @@
         x?.collectApiSignature(signature);
       }
     }
-    signature.addInt(this._visibleLength ?? 0);
-    signature.addInt(this._visibleOffset ?? 0);
     signature.addBool(this._initializer != null);
     this._initializer?.collectApiSignature(signature);
+    signature.addInt(this._inheritsCovariantSlot ?? 0);
   }
 
   fb.Offset finish(fb.Builder fbBuilder) {
@@ -6990,6 +8214,9 @@
     if (_inferredTypeSlot != null && _inferredTypeSlot != 0) {
       fbBuilder.addUint32(2, _inferredTypeSlot);
     }
+    if (_inheritsCovariantSlot != null && _inheritsCovariantSlot != 0) {
+      fbBuilder.addUint32(14, _inheritsCovariantSlot);
+    }
     if (offset_initializer != null) {
       fbBuilder.addOffset(12, offset_initializer);
     }
@@ -7037,10 +8264,11 @@
 
   _UnlinkedParamImpl(this._bc, this._bcOffset);
 
-  List<idl.UnlinkedConst> _annotations;
+  List<idl.UnlinkedExpr> _annotations;
   idl.CodeRange _codeRange;
   String _defaultValueCode;
   int _inferredTypeSlot;
+  int _inheritsCovariantSlot;
   idl.UnlinkedExecutable _initializer;
   bool _isFunctionTyped;
   bool _isInitializingFormal;
@@ -7053,8 +8281,8 @@
   int _visibleOffset;
 
   @override
-  List<idl.UnlinkedConst> get annotations {
-    _annotations ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConstReader()).vTableGet(_bc, _bcOffset, 9, const <idl.UnlinkedConst>[]);
+  List<idl.UnlinkedExpr> get annotations {
+    _annotations ??= const fb.ListReader<idl.UnlinkedExpr>(const _UnlinkedExprReader()).vTableGet(_bc, _bcOffset, 9, const <idl.UnlinkedExpr>[]);
     return _annotations;
   }
 
@@ -7077,6 +8305,12 @@
   }
 
   @override
+  int get inheritsCovariantSlot {
+    _inheritsCovariantSlot ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 14, 0);
+    return _inheritsCovariantSlot;
+  }
+
+  @override
   idl.UnlinkedExecutable get initializer {
     _initializer ??= const _UnlinkedExecutableReader().vTableGet(_bc, _bcOffset, 12, null);
     return _initializer;
@@ -7145,6 +8379,7 @@
     if (codeRange != null) _result["codeRange"] = codeRange.toJson();
     if (defaultValueCode != '') _result["defaultValueCode"] = defaultValueCode;
     if (inferredTypeSlot != 0) _result["inferredTypeSlot"] = inferredTypeSlot;
+    if (inheritsCovariantSlot != 0) _result["inheritsCovariantSlot"] = inheritsCovariantSlot;
     if (initializer != null) _result["initializer"] = initializer.toJson();
     if (isFunctionTyped != false) _result["isFunctionTyped"] = isFunctionTyped;
     if (isInitializingFormal != false) _result["isInitializingFormal"] = isInitializingFormal;
@@ -7164,6 +8399,7 @@
     "codeRange": codeRange,
     "defaultValueCode": defaultValueCode,
     "inferredTypeSlot": inferredTypeSlot,
+    "inheritsCovariantSlot": inheritsCovariantSlot,
     "initializer": initializer,
     "isFunctionTyped": isFunctionTyped,
     "isInitializingFormal": isInitializingFormal,
@@ -7181,17 +8417,17 @@
 }
 
 class UnlinkedPartBuilder extends Object with _UnlinkedPartMixin implements idl.UnlinkedPart {
-  List<UnlinkedConstBuilder> _annotations;
+  List<UnlinkedExprBuilder> _annotations;
   int _uriEnd;
   int _uriOffset;
 
   @override
-  List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstBuilder>[];
+  List<UnlinkedExprBuilder> get annotations => _annotations ??= <UnlinkedExprBuilder>[];
 
   /**
    * Annotations for this part declaration.
    */
-  void set annotations(List<UnlinkedConstBuilder> value) {
+  void set annotations(List<UnlinkedExprBuilder> value) {
     this._annotations = value;
   }
 
@@ -7219,7 +8455,7 @@
     this._uriOffset = value;
   }
 
-  UnlinkedPartBuilder({List<UnlinkedConstBuilder> annotations, int uriEnd, int uriOffset})
+  UnlinkedPartBuilder({List<UnlinkedExprBuilder> annotations, int uriEnd, int uriOffset})
     : _annotations = annotations,
       _uriEnd = uriEnd,
       _uriOffset = uriOffset;
@@ -7279,13 +8515,13 @@
 
   _UnlinkedPartImpl(this._bc, this._bcOffset);
 
-  List<idl.UnlinkedConst> _annotations;
+  List<idl.UnlinkedExpr> _annotations;
   int _uriEnd;
   int _uriOffset;
 
   @override
-  List<idl.UnlinkedConst> get annotations {
-    _annotations ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConstReader()).vTableGet(_bc, _bcOffset, 2, const <idl.UnlinkedConst>[]);
+  List<idl.UnlinkedExpr> get annotations {
+    _annotations ??= const fb.ListReader<idl.UnlinkedExpr>(const _UnlinkedExprReader()).vTableGet(_bc, _bcOffset, 2, const <idl.UnlinkedExpr>[]);
     return _annotations;
   }
 
@@ -7788,7 +9024,7 @@
 }
 
 class UnlinkedTypedefBuilder extends Object with _UnlinkedTypedefMixin implements idl.UnlinkedTypedef {
-  List<UnlinkedConstBuilder> _annotations;
+  List<UnlinkedExprBuilder> _annotations;
   CodeRangeBuilder _codeRange;
   UnlinkedDocumentationCommentBuilder _documentationComment;
   String _name;
@@ -7798,12 +9034,12 @@
   List<UnlinkedTypeParamBuilder> _typeParameters;
 
   @override
-  List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstBuilder>[];
+  List<UnlinkedExprBuilder> get annotations => _annotations ??= <UnlinkedExprBuilder>[];
 
   /**
    * Annotations for this typedef.
    */
-  void set annotations(List<UnlinkedConstBuilder> value) {
+  void set annotations(List<UnlinkedExprBuilder> value) {
     this._annotations = value;
   }
 
@@ -7879,7 +9115,7 @@
     this._typeParameters = value;
   }
 
-  UnlinkedTypedefBuilder({List<UnlinkedConstBuilder> annotations, CodeRangeBuilder codeRange, UnlinkedDocumentationCommentBuilder documentationComment, String name, int nameOffset, List<UnlinkedParamBuilder> parameters, EntityRefBuilder returnType, List<UnlinkedTypeParamBuilder> typeParameters})
+  UnlinkedTypedefBuilder({List<UnlinkedExprBuilder> annotations, CodeRangeBuilder codeRange, UnlinkedDocumentationCommentBuilder documentationComment, String name, int nameOffset, List<UnlinkedParamBuilder> parameters, EntityRefBuilder returnType, List<UnlinkedTypeParamBuilder> typeParameters})
     : _annotations = annotations,
       _codeRange = codeRange,
       _documentationComment = documentationComment,
@@ -8006,7 +9242,7 @@
 
   _UnlinkedTypedefImpl(this._bc, this._bcOffset);
 
-  List<idl.UnlinkedConst> _annotations;
+  List<idl.UnlinkedExpr> _annotations;
   idl.CodeRange _codeRange;
   idl.UnlinkedDocumentationComment _documentationComment;
   String _name;
@@ -8016,8 +9252,8 @@
   List<idl.UnlinkedTypeParam> _typeParameters;
 
   @override
-  List<idl.UnlinkedConst> get annotations {
-    _annotations ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConstReader()).vTableGet(_bc, _bcOffset, 4, const <idl.UnlinkedConst>[]);
+  List<idl.UnlinkedExpr> get annotations {
+    _annotations ??= const fb.ListReader<idl.UnlinkedExpr>(const _UnlinkedExprReader()).vTableGet(_bc, _bcOffset, 4, const <idl.UnlinkedExpr>[]);
     return _annotations;
   }
 
@@ -8096,19 +9332,19 @@
 }
 
 class UnlinkedTypeParamBuilder extends Object with _UnlinkedTypeParamMixin implements idl.UnlinkedTypeParam {
-  List<UnlinkedConstBuilder> _annotations;
+  List<UnlinkedExprBuilder> _annotations;
   EntityRefBuilder _bound;
   CodeRangeBuilder _codeRange;
   String _name;
   int _nameOffset;
 
   @override
-  List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstBuilder>[];
+  List<UnlinkedExprBuilder> get annotations => _annotations ??= <UnlinkedExprBuilder>[];
 
   /**
    * Annotations for this type parameter.
    */
-  void set annotations(List<UnlinkedConstBuilder> value) {
+  void set annotations(List<UnlinkedExprBuilder> value) {
     this._annotations = value;
   }
 
@@ -8154,7 +9390,7 @@
     this._nameOffset = value;
   }
 
-  UnlinkedTypeParamBuilder({List<UnlinkedConstBuilder> annotations, EntityRefBuilder bound, CodeRangeBuilder codeRange, String name, int nameOffset})
+  UnlinkedTypeParamBuilder({List<UnlinkedExprBuilder> annotations, EntityRefBuilder bound, CodeRangeBuilder codeRange, String name, int nameOffset})
     : _annotations = annotations,
       _bound = bound,
       _codeRange = codeRange,
@@ -8238,15 +9474,15 @@
 
   _UnlinkedTypeParamImpl(this._bc, this._bcOffset);
 
-  List<idl.UnlinkedConst> _annotations;
+  List<idl.UnlinkedExpr> _annotations;
   idl.EntityRef _bound;
   idl.CodeRange _codeRange;
   String _name;
   int _nameOffset;
 
   @override
-  List<idl.UnlinkedConst> get annotations {
-    _annotations ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConstReader()).vTableGet(_bc, _bcOffset, 3, const <idl.UnlinkedConst>[]);
+  List<idl.UnlinkedExpr> get annotations {
+    _annotations ??= const fb.ListReader<idl.UnlinkedExpr>(const _UnlinkedExprReader()).vTableGet(_bc, _bcOffset, 3, const <idl.UnlinkedExpr>[]);
     return _annotations;
   }
 
@@ -8301,14 +9537,15 @@
 }
 
 class UnlinkedUnitBuilder extends Object with _UnlinkedUnitMixin implements idl.UnlinkedUnit {
+  List<int> _apiSignature;
   List<UnlinkedClassBuilder> _classes;
   CodeRangeBuilder _codeRange;
   List<UnlinkedEnumBuilder> _enums;
   List<UnlinkedExecutableBuilder> _executables;
   List<UnlinkedExportNonPublicBuilder> _exports;
-  String _fallbackModePath;
   List<UnlinkedImportBuilder> _imports;
-  List<UnlinkedConstBuilder> _libraryAnnotations;
+  bool _isPartOf;
+  List<UnlinkedExprBuilder> _libraryAnnotations;
   UnlinkedDocumentationCommentBuilder _libraryDocumentationComment;
   String _libraryName;
   int _libraryNameLength;
@@ -8321,6 +9558,19 @@
   List<UnlinkedVariableBuilder> _variables;
 
   @override
+  List<int> get apiSignature => _apiSignature ??= <int>[];
+
+  /**
+   * MD5 hash of the non-informative fields of the [UnlinkedUnit] (not
+   * including this one) as 16 unsigned 8-bit integer values.  This can be used
+   * to identify when the API of a unit may have changed.
+   */
+  void set apiSignature(List<int> value) {
+    assert(value == null || value.every((e) => e >= 0));
+    this._apiSignature = value;
+  }
+
+  @override
   List<UnlinkedClassBuilder> get classes => _classes ??= <UnlinkedClassBuilder>[];
 
   /**
@@ -8372,18 +9622,7 @@
   }
 
   @override
-  String get fallbackModePath => _fallbackModePath ??= '';
-
-  /**
-   * If this compilation unit was summarized in fallback mode, the path where
-   * the compilation unit may be found on disk.  Otherwise empty.
-   *
-   * When this field is non-empty, all other fields in the data structure have
-   * their default values.
-   */
-  void set fallbackModePath(String value) {
-    this._fallbackModePath = value;
-  }
+  String get fallbackModePath => throw new UnimplementedError('attempt to access deprecated field');
 
   @override
   List<UnlinkedImportBuilder> get imports => _imports ??= <UnlinkedImportBuilder>[];
@@ -8396,13 +9635,23 @@
   }
 
   @override
-  List<UnlinkedConstBuilder> get libraryAnnotations => _libraryAnnotations ??= <UnlinkedConstBuilder>[];
+  bool get isPartOf => _isPartOf ??= false;
+
+  /**
+   * Indicates whether the unit contains a "part of" declaration.
+   */
+  void set isPartOf(bool value) {
+    this._isPartOf = value;
+  }
+
+  @override
+  List<UnlinkedExprBuilder> get libraryAnnotations => _libraryAnnotations ??= <UnlinkedExprBuilder>[];
 
   /**
    * Annotations for the library declaration, or the empty list if there is no
    * library declaration.
    */
-  void set libraryAnnotations(List<UnlinkedConstBuilder> value) {
+  void set libraryAnnotations(List<UnlinkedExprBuilder> value) {
     this._libraryAnnotations = value;
   }
 
@@ -8516,14 +9765,15 @@
     this._variables = value;
   }
 
-  UnlinkedUnitBuilder({List<UnlinkedClassBuilder> classes, CodeRangeBuilder codeRange, List<UnlinkedEnumBuilder> enums, List<UnlinkedExecutableBuilder> executables, List<UnlinkedExportNonPublicBuilder> exports, String fallbackModePath, List<UnlinkedImportBuilder> imports, List<UnlinkedConstBuilder> libraryAnnotations, UnlinkedDocumentationCommentBuilder libraryDocumentationComment, String libraryName, int libraryNameLength, int libraryNameOffset, List<int> lineStarts, List<UnlinkedPartBuilder> parts, UnlinkedPublicNamespaceBuilder publicNamespace, List<UnlinkedReferenceBuilder> references, List<UnlinkedTypedefBuilder> typedefs, List<UnlinkedVariableBuilder> variables})
-    : _classes = classes,
+  UnlinkedUnitBuilder({List<int> apiSignature, List<UnlinkedClassBuilder> classes, CodeRangeBuilder codeRange, List<UnlinkedEnumBuilder> enums, List<UnlinkedExecutableBuilder> executables, List<UnlinkedExportNonPublicBuilder> exports, List<UnlinkedImportBuilder> imports, bool isPartOf, List<UnlinkedExprBuilder> libraryAnnotations, UnlinkedDocumentationCommentBuilder libraryDocumentationComment, String libraryName, int libraryNameLength, int libraryNameOffset, List<int> lineStarts, List<UnlinkedPartBuilder> parts, UnlinkedPublicNamespaceBuilder publicNamespace, List<UnlinkedReferenceBuilder> references, List<UnlinkedTypedefBuilder> typedefs, List<UnlinkedVariableBuilder> variables})
+    : _apiSignature = apiSignature,
+      _classes = classes,
       _codeRange = codeRange,
       _enums = enums,
       _executables = executables,
       _exports = exports,
-      _fallbackModePath = fallbackModePath,
       _imports = imports,
+      _isPartOf = isPartOf,
       _libraryAnnotations = libraryAnnotations,
       _libraryDocumentationComment = libraryDocumentationComment,
       _libraryName = libraryName,
@@ -8645,7 +9895,15 @@
         x?.collectApiSignature(signature);
       }
     }
-    signature.addString(this._fallbackModePath ?? '');
+    signature.addBool(this._isPartOf == true);
+    if (this._apiSignature == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._apiSignature.length);
+      for (var x in this._apiSignature) {
+        signature.addInt(x);
+      }
+    }
   }
 
   List<int> toBuffer() {
@@ -8654,12 +9912,12 @@
   }
 
   fb.Offset finish(fb.Builder fbBuilder) {
+    fb.Offset offset_apiSignature;
     fb.Offset offset_classes;
     fb.Offset offset_codeRange;
     fb.Offset offset_enums;
     fb.Offset offset_executables;
     fb.Offset offset_exports;
-    fb.Offset offset_fallbackModePath;
     fb.Offset offset_imports;
     fb.Offset offset_libraryAnnotations;
     fb.Offset offset_libraryDocumentationComment;
@@ -8670,6 +9928,9 @@
     fb.Offset offset_references;
     fb.Offset offset_typedefs;
     fb.Offset offset_variables;
+    if (!(_apiSignature == null || _apiSignature.isEmpty)) {
+      offset_apiSignature = fbBuilder.writeListUint32(_apiSignature);
+    }
     if (!(_classes == null || _classes.isEmpty)) {
       offset_classes = fbBuilder.writeList(_classes.map((b) => b.finish(fbBuilder)).toList());
     }
@@ -8685,9 +9946,6 @@
     if (!(_exports == null || _exports.isEmpty)) {
       offset_exports = fbBuilder.writeList(_exports.map((b) => b.finish(fbBuilder)).toList());
     }
-    if (_fallbackModePath != null) {
-      offset_fallbackModePath = fbBuilder.writeString(_fallbackModePath);
-    }
     if (!(_imports == null || _imports.isEmpty)) {
       offset_imports = fbBuilder.writeList(_imports.map((b) => b.finish(fbBuilder)).toList());
     }
@@ -8719,6 +9977,9 @@
       offset_variables = fbBuilder.writeList(_variables.map((b) => b.finish(fbBuilder)).toList());
     }
     fbBuilder.startTable();
+    if (offset_apiSignature != null) {
+      fbBuilder.addOffset(19, offset_apiSignature);
+    }
     if (offset_classes != null) {
       fbBuilder.addOffset(2, offset_classes);
     }
@@ -8734,12 +9995,12 @@
     if (offset_exports != null) {
       fbBuilder.addOffset(13, offset_exports);
     }
-    if (offset_fallbackModePath != null) {
-      fbBuilder.addOffset(16, offset_fallbackModePath);
-    }
     if (offset_imports != null) {
       fbBuilder.addOffset(5, offset_imports);
     }
+    if (_isPartOf == true) {
+      fbBuilder.addBool(18, true);
+    }
     if (offset_libraryAnnotations != null) {
       fbBuilder.addOffset(14, offset_libraryAnnotations);
     }
@@ -8795,14 +10056,15 @@
 
   _UnlinkedUnitImpl(this._bc, this._bcOffset);
 
+  List<int> _apiSignature;
   List<idl.UnlinkedClass> _classes;
   idl.CodeRange _codeRange;
   List<idl.UnlinkedEnum> _enums;
   List<idl.UnlinkedExecutable> _executables;
   List<idl.UnlinkedExportNonPublic> _exports;
-  String _fallbackModePath;
   List<idl.UnlinkedImport> _imports;
-  List<idl.UnlinkedConst> _libraryAnnotations;
+  bool _isPartOf;
+  List<idl.UnlinkedExpr> _libraryAnnotations;
   idl.UnlinkedDocumentationComment _libraryDocumentationComment;
   String _libraryName;
   int _libraryNameLength;
@@ -8815,6 +10077,12 @@
   List<idl.UnlinkedVariable> _variables;
 
   @override
+  List<int> get apiSignature {
+    _apiSignature ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 19, const <int>[]);
+    return _apiSignature;
+  }
+
+  @override
   List<idl.UnlinkedClass> get classes {
     _classes ??= const fb.ListReader<idl.UnlinkedClass>(const _UnlinkedClassReader()).vTableGet(_bc, _bcOffset, 2, const <idl.UnlinkedClass>[]);
     return _classes;
@@ -8845,10 +10113,7 @@
   }
 
   @override
-  String get fallbackModePath {
-    _fallbackModePath ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 16, '');
-    return _fallbackModePath;
-  }
+  String get fallbackModePath => throw new UnimplementedError('attempt to access deprecated field');
 
   @override
   List<idl.UnlinkedImport> get imports {
@@ -8857,8 +10122,14 @@
   }
 
   @override
-  List<idl.UnlinkedConst> get libraryAnnotations {
-    _libraryAnnotations ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConstReader()).vTableGet(_bc, _bcOffset, 14, const <idl.UnlinkedConst>[]);
+  bool get isPartOf {
+    _isPartOf ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 18, false);
+    return _isPartOf;
+  }
+
+  @override
+  List<idl.UnlinkedExpr> get libraryAnnotations {
+    _libraryAnnotations ??= const fb.ListReader<idl.UnlinkedExpr>(const _UnlinkedExprReader()).vTableGet(_bc, _bcOffset, 14, const <idl.UnlinkedExpr>[]);
     return _libraryAnnotations;
   }
 
@@ -8927,13 +10198,14 @@
   @override
   Map<String, Object> toJson() {
     Map<String, Object> _result = <String, Object>{};
+    if (apiSignature.isNotEmpty) _result["apiSignature"] = apiSignature;
     if (classes.isNotEmpty) _result["classes"] = classes.map((_value) => _value.toJson()).toList();
     if (codeRange != null) _result["codeRange"] = codeRange.toJson();
     if (enums.isNotEmpty) _result["enums"] = enums.map((_value) => _value.toJson()).toList();
     if (executables.isNotEmpty) _result["executables"] = executables.map((_value) => _value.toJson()).toList();
     if (exports.isNotEmpty) _result["exports"] = exports.map((_value) => _value.toJson()).toList();
-    if (fallbackModePath != '') _result["fallbackModePath"] = fallbackModePath;
     if (imports.isNotEmpty) _result["imports"] = imports.map((_value) => _value.toJson()).toList();
+    if (isPartOf != false) _result["isPartOf"] = isPartOf;
     if (libraryAnnotations.isNotEmpty) _result["libraryAnnotations"] = libraryAnnotations.map((_value) => _value.toJson()).toList();
     if (libraryDocumentationComment != null) _result["libraryDocumentationComment"] = libraryDocumentationComment.toJson();
     if (libraryName != '') _result["libraryName"] = libraryName;
@@ -8950,13 +10222,14 @@
 
   @override
   Map<String, Object> toMap() => {
+    "apiSignature": apiSignature,
     "classes": classes,
     "codeRange": codeRange,
     "enums": enums,
     "executables": executables,
     "exports": exports,
-    "fallbackModePath": fallbackModePath,
     "imports": imports,
+    "isPartOf": isPartOf,
     "libraryAnnotations": libraryAnnotations,
     "libraryDocumentationComment": libraryDocumentationComment,
     "libraryName": libraryName,
@@ -8975,7 +10248,7 @@
 }
 
 class UnlinkedVariableBuilder extends Object with _UnlinkedVariableMixin implements idl.UnlinkedVariable {
-  List<UnlinkedConstBuilder> _annotations;
+  List<UnlinkedExprBuilder> _annotations;
   CodeRangeBuilder _codeRange;
   UnlinkedDocumentationCommentBuilder _documentationComment;
   int _inferredTypeSlot;
@@ -8991,12 +10264,12 @@
   int _visibleOffset;
 
   @override
-  List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstBuilder>[];
+  List<UnlinkedExprBuilder> get annotations => _annotations ??= <UnlinkedExprBuilder>[];
 
   /**
    * Annotations for this variable.
    */
-  void set annotations(List<UnlinkedConstBuilder> value) {
+  void set annotations(List<UnlinkedExprBuilder> value) {
     this._annotations = value;
   }
 
@@ -9149,7 +10422,7 @@
     this._visibleOffset = value;
   }
 
-  UnlinkedVariableBuilder({List<UnlinkedConstBuilder> annotations, CodeRangeBuilder codeRange, UnlinkedDocumentationCommentBuilder documentationComment, int inferredTypeSlot, UnlinkedExecutableBuilder initializer, bool isConst, bool isFinal, bool isStatic, String name, int nameOffset, int propagatedTypeSlot, EntityRefBuilder type, int visibleLength, int visibleOffset})
+  UnlinkedVariableBuilder({List<UnlinkedExprBuilder> annotations, CodeRangeBuilder codeRange, UnlinkedDocumentationCommentBuilder documentationComment, int inferredTypeSlot, UnlinkedExecutableBuilder initializer, bool isConst, bool isFinal, bool isStatic, String name, int nameOffset, int propagatedTypeSlot, EntityRefBuilder type, int visibleLength, int visibleOffset})
     : _annotations = annotations,
       _codeRange = codeRange,
       _documentationComment = documentationComment,
@@ -9175,6 +10448,8 @@
     _initializer?.flushInformative();
     _nameOffset = null;
     _type?.flushInformative();
+    _visibleLength = null;
+    _visibleOffset = null;
   }
 
   /**
@@ -9197,8 +10472,6 @@
       }
     }
     signature.addInt(this._inferredTypeSlot ?? 0);
-    signature.addInt(this._visibleLength ?? 0);
-    signature.addInt(this._visibleOffset ?? 0);
     signature.addBool(this._initializer != null);
     this._initializer?.collectApiSignature(signature);
   }
@@ -9288,7 +10561,7 @@
 
   _UnlinkedVariableImpl(this._bc, this._bcOffset);
 
-  List<idl.UnlinkedConst> _annotations;
+  List<idl.UnlinkedExpr> _annotations;
   idl.CodeRange _codeRange;
   idl.UnlinkedDocumentationComment _documentationComment;
   int _inferredTypeSlot;
@@ -9304,8 +10577,8 @@
   int _visibleOffset;
 
   @override
-  List<idl.UnlinkedConst> get annotations {
-    _annotations ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConstReader()).vTableGet(_bc, _bcOffset, 8, const <idl.UnlinkedConst>[]);
+  List<idl.UnlinkedExpr> get annotations {
+    _annotations ??= const fb.ListReader<idl.UnlinkedExpr>(const _UnlinkedExprReader()).vTableGet(_bc, _bcOffset, 8, const <idl.UnlinkedExpr>[]);
     return _annotations;
   }
 
diff --git a/pkg/analyzer/lib/src/summary/format.fbs b/pkg/analyzer/lib/src/summary/format.fbs
index c7afabc..de75fea 100644
--- a/pkg/analyzer/lib/src/summary/format.fbs
+++ b/pkg/analyzer/lib/src/summary/format.fbs
@@ -210,13 +210,152 @@
 }
 
 /**
+ * Enum used to indicate the kind of an constructor initializer.
+ */
+enum UnlinkedConstructorInitializerKind : byte {
+  /**
+   * Initialization of a field.
+   */
+  field,
+
+  /**
+   * Invocation of a constructor in the same class.
+   */
+  thisInvocation,
+
+  /**
+   * Invocation of a superclass' constructor.
+   */
+  superInvocation
+}
+
+/**
+ * Enum used to indicate the kind of an executable.
+ */
+enum UnlinkedExecutableKind : byte {
+  /**
+   * Executable is a function or method.
+   */
+  functionOrMethod,
+
+  /**
+   * Executable is a getter.
+   */
+  getter,
+
+  /**
+   * Executable is a setter.
+   */
+  setter,
+
+  /**
+   * Executable is a constructor.
+   */
+  constructor
+}
+
+/**
+ * Enum representing the various kinds of assignment operations combined
+ * with:
+ *    [UnlinkedExprOperation.assignToRef],
+ *    [UnlinkedExprOperation.assignToProperty],
+ *    [UnlinkedExprOperation.assignToIndex].
+ */
+enum UnlinkedExprAssignOperator : byte {
+  /**
+   * Perform simple assignment `target = operand`.
+   */
+  assign,
+
+  /**
+   * Perform `target ??= operand`.
+   */
+  ifNull,
+
+  /**
+   * Perform `target *= operand`.
+   */
+  multiply,
+
+  /**
+   * Perform `target /= operand`.
+   */
+  divide,
+
+  /**
+   * Perform `target ~/= operand`.
+   */
+  floorDivide,
+
+  /**
+   * Perform `target %= operand`.
+   */
+  modulo,
+
+  /**
+   * Perform `target += operand`.
+   */
+  plus,
+
+  /**
+   * Perform `target -= operand`.
+   */
+  minus,
+
+  /**
+   * Perform `target <<= operand`.
+   */
+  shiftLeft,
+
+  /**
+   * Perform `target >>= operand`.
+   */
+  shiftRight,
+
+  /**
+   * Perform `target &= operand`.
+   */
+  bitAnd,
+
+  /**
+   * Perform `target ^= operand`.
+   */
+  bitXor,
+
+  /**
+   * Perform `target |= operand`.
+   */
+  bitOr,
+
+  /**
+   * Perform `++target`.
+   */
+  prefixIncrement,
+
+  /**
+   * Perform `--target`.
+   */
+  prefixDecrement,
+
+  /**
+   * Perform `target++`.
+   */
+  postfixIncrement,
+
+  /**
+   * Perform `target++`.
+   */
+  postfixDecrement
+}
+
+/**
  * Enum representing the various kinds of operations which may be performed to
- * produce a constant value.  These options are assumed to execute in the
+ * in an expression.  These options are assumed to execute in the
  * context of a stack which is initially empty.
  */
-enum UnlinkedConstOperation : byte {
+enum UnlinkedExprOperation : byte {
   /**
-   * Push the next value from [UnlinkedConst.ints] (a 32-bit unsigned integer)
+   * Push the next value from [UnlinkedExpr.ints] (a 32-bit unsigned integer)
    * onto the stack.
    *
    * Note that Dart supports integers larger than 32 bits; these are
@@ -225,15 +364,15 @@
   pushInt,
 
   /**
-   * Get the number of components from [UnlinkedConst.ints], then do this number
+   * Get the number of components from [UnlinkedExpr.ints], then do this number
    * of times the following operations: multiple the current value by 2^32, "or"
-   * it with the next value in [UnlinkedConst.ints]. The initial value is zero.
+   * it with the next value in [UnlinkedExpr.ints]. The initial value is zero.
    * Push the result into the stack.
    */
   pushLongInt,
 
   /**
-   * Push the next value from [UnlinkedConst.doubles] (a double precision
+   * Push the next value from [UnlinkedExpr.doubles] (a double precision
    * floating point value) onto the stack.
    */
   pushDouble,
@@ -249,13 +388,13 @@
   pushFalse,
 
   /**
-   * Push the next value from [UnlinkedConst.strings] onto the stack.
+   * Push the next value from [UnlinkedExpr.strings] onto the stack.
    */
   pushString,
 
   /**
    * Pop the top n values from the stack (where n is obtained from
-   * [UnlinkedConst.ints]), convert them to strings (if they aren't already),
+   * [UnlinkedExpr.ints]), convert them to strings (if they aren't already),
    * concatenate them into a single string, and push it back onto the stack.
    *
    * This operation is used to represent constants whose value is a literal
@@ -264,7 +403,7 @@
   concatenate,
 
   /**
-   * Get the next value from [UnlinkedConst.strings], convert it to a symbol,
+   * Get the next value from [UnlinkedExpr.strings], convert it to a symbol,
    * and push it onto the stack.
    */
   makeSymbol,
@@ -276,14 +415,14 @@
 
   /**
    * Push the value of the function parameter with the name obtained from
-   * [UnlinkedConst.strings].
+   * [UnlinkedExpr.strings].
    */
   pushParameter,
 
   /**
    * Evaluate a (potentially qualified) identifier expression and push the
    * resulting value onto the stack.  The identifier to be evaluated is
-   * obtained from [UnlinkedConst.references].
+   * obtained from [UnlinkedExpr.references].
    *
    * This operation is used to represent the following kinds of constants
    * (which are indistinguishable from an unresolved AST alone):
@@ -299,20 +438,20 @@
 
   /**
    * Pop the top value from the stack, extract the value of the property with
-   * the name obtained from [UnlinkedConst.strings], and push the result back
+   * the name obtained from [UnlinkedExpr.strings], and push the result back
    * onto the stack.
    */
   extractProperty,
 
   /**
    * Pop the top `n` values from the stack (where `n` is obtained from
-   * [UnlinkedConst.ints]) into a list (filled from the end) and take the next
-   * `n` values from [UnlinkedConst.strings] and use the lists of names and
+   * [UnlinkedExpr.ints]) into a list (filled from the end) and take the next
+   * `n` values from [UnlinkedExpr.strings] and use the lists of names and
    * values to create named arguments.  Then pop the top `m` values from the
-   * stack (where `m` is obtained from [UnlinkedConst.ints]) into a list (filled
+   * stack (where `m` is obtained from [UnlinkedExpr.ints]) into a list (filled
    * from the end) and use them as positional arguments.  Use the lists of
    * positional and names arguments to invoke a constant constructor obtained
-   * from [UnlinkedConst.references], and push the resulting value back onto the
+   * from [UnlinkedExpr.references], and push the resulting value back onto the
    * stack.
    *
    * Note that for an invocation of the form `const a.b(...)` (where no type
@@ -326,14 +465,14 @@
 
   /**
    * Pop the top n values from the stack (where n is obtained from
-   * [UnlinkedConst.ints]), place them in a [List], and push the result back
+   * [UnlinkedExpr.ints]), place them in a [List], and push the result back
    * onto the stack.  The type parameter for the [List] is implicitly `dynamic`.
    */
   makeUntypedList,
 
   /**
    * Pop the top 2*n values from the stack (where n is obtained from
-   * [UnlinkedConst.ints]), interpret them as key/value pairs, place them in a
+   * [UnlinkedExpr.ints]), interpret them as key/value pairs, place them in a
    * [Map], and push the result back onto the stack.  The two type parameters
    * for the [Map] are implicitly `dynamic`.
    */
@@ -341,17 +480,17 @@
 
   /**
    * Pop the top n values from the stack (where n is obtained from
-   * [UnlinkedConst.ints]), place them in a [List], and push the result back
+   * [UnlinkedExpr.ints]), place them in a [List], and push the result back
    * onto the stack.  The type parameter for the [List] is obtained from
-   * [UnlinkedConst.references].
+   * [UnlinkedExpr.references].
    */
   makeTypedList,
 
   /**
    * Pop the top 2*n values from the stack (where n is obtained from
-   * [UnlinkedConst.ints]), interpret them as key/value pairs, place them in a
+   * [UnlinkedExpr.ints]), interpret them as key/value pairs, place them in a
    * [Map], and push the result back onto the stack.  The two type parameters for
-   * the [Map] are obtained from [UnlinkedConst.references].
+   * the [Map] are obtained from [UnlinkedExpr.references].
    */
   makeTypedMap,
 
@@ -495,13 +634,13 @@
 
   /**
    * Pop from the stack `value` and get the next `target` reference from
-   * [UnlinkedConst.references] - a top-level variable (prefixed or not), an
+   * [UnlinkedExpr.references] - a top-level variable (prefixed or not), an
    * assignable field of a class (prefixed or not), or a sequence of getters
    * ending with an assignable property `a.b.b.c.d.e`.  In general `a.b` cannot
    * not be distinguished between: `a` is a prefix and `b` is a top-level
    * variable; or `a` is an object and `b` is the name of a property.  Perform
    * `reference op= value` where `op` is the next assignment operator from
-   * [UnlinkedConst.assignmentOperators].  Push `value` back into the stack.
+   * [UnlinkedExpr.assignmentOperators].  Push `value` back into the stack.
    *
    * If the assignment operator is a prefix/postfix increment/decrement, then
    * `value` is not present in the stack, so it should not be popped and the
@@ -516,7 +655,7 @@
    * `target`.  This operation is used when we know that the `target` is an
    * object reference expression, e.g. `new Foo().a.b.c` or `a.b[0].c.d`.
    * Perform `target.property op= value` where `op` is the next assignment
-   * operator from [UnlinkedConst.assignmentOperators].  Push `value` back into
+   * operator from [UnlinkedExpr.assignmentOperators].  Push `value` back into
    * the stack.
    *
    * If the assignment operator is a prefix/postfix increment/decrement, then
@@ -529,7 +668,7 @@
   /**
    * Pop from the stack `index`, `target` and `value`.  Perform
    * `target[index] op= value`  where `op` is the next assignment operator from
-   * [UnlinkedConst.assignmentOperators].  Push `value` back into the stack.
+   * [UnlinkedExpr.assignmentOperators].  Push `value` back into the stack.
    *
    * If the assignment operator is a prefix/postfix increment/decrement, then
    * `value` is not present in the stack, so it should not be popped and the
@@ -546,15 +685,15 @@
 
   /**
    * Pop the top `n` values from the stack (where `n` is obtained from
-   * [UnlinkedConst.ints]) into a list (filled from the end) and take the next
-   * `n` values from [UnlinkedConst.strings] and use the lists of names and
+   * [UnlinkedExpr.ints]) into a list (filled from the end) and take the next
+   * `n` values from [UnlinkedExpr.strings] and use the lists of names and
    * values to create named arguments.  Then pop the top `m` values from the
-   * stack (where `m` is obtained from [UnlinkedConst.ints]) into a list (filled
+   * stack (where `m` is obtained from [UnlinkedExpr.ints]) into a list (filled
    * from the end) and use them as positional arguments.  Use the lists of
    * positional and names arguments to invoke a method (or a function) with
-   * the reference from [UnlinkedConst.references].  If `k` is nonzero (where
-   * `k` is obtained from [UnlinkedConst.ints]), obtain `k` type arguments from
-   * [UnlinkedConst.references] and use them as generic type arguments for the
+   * the reference from [UnlinkedExpr.references].  If `k` is nonzero (where
+   * `k` is obtained from [UnlinkedExpr.ints]), obtain `k` type arguments from
+   * [UnlinkedExpr.references] and use them as generic type arguments for the
    * aforementioned method or function.  Push the result of the invocation onto
    * the stack.
    *
@@ -567,15 +706,15 @@
 
   /**
    * Pop the top `n` values from the stack (where `n` is obtained from
-   * [UnlinkedConst.ints]) into a list (filled from the end) and take the next
-   * `n` values from [UnlinkedConst.strings] and use the lists of names and
+   * [UnlinkedExpr.ints]) into a list (filled from the end) and take the next
+   * `n` values from [UnlinkedExpr.strings] and use the lists of names and
    * values to create named arguments.  Then pop the top `m` values from the
-   * stack (where `m` is obtained from [UnlinkedConst.ints]) into a list (filled
+   * stack (where `m` is obtained from [UnlinkedExpr.ints]) into a list (filled
    * from the end) and use them as positional arguments.  Use the lists of
    * positional and names arguments to invoke the method with the name from
-   * [UnlinkedConst.strings] of the target popped from the stack.  If `k` is
-   * nonzero (where `k` is obtained from [UnlinkedConst.ints]), obtain `k` type
-   * arguments from [UnlinkedConst.references] and use them as generic type
+   * [UnlinkedExpr.strings] of the target popped from the stack.  If `k` is
+   * nonzero (where `k` is obtained from [UnlinkedExpr.ints]), obtain `k` type
+   * arguments from [UnlinkedExpr.references] and use them as generic type
    * arguments for the aforementioned method.  Push the result of the
    * invocation onto the stack.
    *
@@ -597,13 +736,13 @@
 
   /**
    * Pop the top value from the stack and cast it to the type with reference
-   * from [UnlinkedConst.references], push the result into the stack.
+   * from [UnlinkedExpr.references], push the result into the stack.
    */
   typeCast,
 
   /**
    * Pop the top value from the stack and check whether it is a subclass of the
-   * type with reference from [UnlinkedConst.references], push the result into
+   * type with reference from [UnlinkedExpr.references], push the result into
    * the stack.
    */
   typeCheck,
@@ -614,151 +753,25 @@
   throwException,
 
   /**
-   * Obtain two values `n` and `m` from [UnlinkedConst.ints].  Then, starting at
+   * Obtain two values `n` and `m` from [UnlinkedExpr.ints].  Then, starting at
    * the executable element for the expression being evaluated, if n > 0, pop to
    * the nth enclosing function element.  Then, push the mth local function of
    * that element onto the stack.
    */
-  pushLocalFunctionReference
-}
-
-/**
- * Enum used to indicate the kind of an constructor initializer.
- */
-enum UnlinkedConstructorInitializerKind : byte {
-  /**
-   * Initialization of a field.
-   */
-  field,
+  pushLocalFunctionReference,
 
   /**
-   * Invocation of a constructor in the same class.
-   */
-  thisInvocation,
-
-  /**
-   * Invocation of a superclass' constructor.
-   */
-  superInvocation
-}
-
-/**
- * Enum used to indicate the kind of an executable.
- */
-enum UnlinkedExecutableKind : byte {
-  /**
-   * Executable is a function or method.
-   */
-  functionOrMethod,
-
-  /**
-   * Executable is a getter.
-   */
-  getter,
-
-  /**
-   * Executable is a setter.
-   */
-  setter,
-
-  /**
-   * Executable is a constructor.
-   */
-  constructor
-}
-
-/**
- * Enum representing the various kinds of assignment operations combined
- * with:
- *    [UnlinkedConstOperation.assignToRef],
- *    [UnlinkedConstOperation.assignToProperty],
- *    [UnlinkedConstOperation.assignToIndex].
- */
-enum UnlinkedExprAssignOperator : byte {
-  /**
-   * Perform simple assignment `target = operand`.
-   */
-  assign,
-
-  /**
-   * Perform `target ??= operand`.
+   * Pop the top two values from the stack.  If the first value is non-null,
+   * keep it and discard the second.  Otherwise, keep the second and discard the
+   * first.
    */
   ifNull,
 
   /**
-   * Perform `target *= operand`.
+   * Pop the top value from the stack.  Treat it as a Future and await its
+   * completion.  Then push the awaited value onto the stack.
    */
-  multiply,
-
-  /**
-   * Perform `target /= operand`.
-   */
-  divide,
-
-  /**
-   * Perform `target ~/= operand`.
-   */
-  floorDivide,
-
-  /**
-   * Perform `target %= operand`.
-   */
-  modulo,
-
-  /**
-   * Perform `target += operand`.
-   */
-  plus,
-
-  /**
-   * Perform `target -= operand`.
-   */
-  minus,
-
-  /**
-   * Perform `target <<= operand`.
-   */
-  shiftLeft,
-
-  /**
-   * Perform `target >>= operand`.
-   */
-  shiftRight,
-
-  /**
-   * Perform `target &= operand`.
-   */
-  bitAnd,
-
-  /**
-   * Perform `target ^= operand`.
-   */
-  bitXor,
-
-  /**
-   * Perform `target |= operand`.
-   */
-  bitOr,
-
-  /**
-   * Perform `++target`.
-   */
-  prefixIncrement,
-
-  /**
-   * Perform `--target`.
-   */
-  prefixDecrement,
-
-  /**
-   * Perform `target++`.
-   */
-  postfixIncrement,
-
-  /**
-   * Perform `target++`.
-   */
-  postfixDecrement
+  await
 }
 
 /**
@@ -782,6 +795,186 @@
 }
 
 /**
+ * Information about a resolved unit.
+ */
+table AnalysisDriverResolvedUnit {
+  /**
+   * The full list of analysis errors, both syntactic and semantic.
+   */
+  errors:[AnalysisDriverUnitError] (id: 0);
+
+  /**
+   * The index of the unit.
+   */
+  index:AnalysisDriverUnitIndex (id: 1);
+}
+
+/**
+ * Information about an error in a resolved unit.
+ */
+table AnalysisDriverUnitError {
+  /**
+   * The optional correction hint for the error.
+   */
+  correction:string (id: 4);
+
+  /**
+   * The length of the error in the file.
+   */
+  length:uint (id: 1);
+
+  /**
+   * The message of the error.
+   */
+  message:string (id: 3);
+
+  /**
+   * The offset from the beginning of the file.
+   */
+  offset:uint (id: 0);
+
+  /**
+   * The unique name of the error code.
+   */
+  uniqueName:string (id: 2);
+}
+
+/**
+ * Information about a resolved unit.
+ */
+table AnalysisDriverUnitIndex {
+  /**
+   * Each item of this list corresponds to a unique referenced element.  It is
+   * the kind of the synthetic element.
+   */
+  elementKinds:[IndexSyntheticElementKind] (id: 4);
+
+  /**
+   * Each item of this list corresponds to a unique referenced element.  It is
+   * the identifier of the class member element name, or `null` if the element
+   * is a top-level element.  The list is sorted in ascending order, so that the
+   * client can quickly check whether an element is referenced in this index.
+   */
+  elementNameClassMemberIds:[uint] (id: 7);
+
+  /**
+   * Each item of this list corresponds to a unique referenced element.  It is
+   * the identifier of the named parameter name, or `null` if the element is not
+   * a named parameter.  The list is sorted in ascending order, so that the
+   * client can quickly check whether an element is referenced in this index.
+   */
+  elementNameParameterIds:[uint] (id: 8);
+
+  /**
+   * Each item of this list corresponds to a unique referenced element.  It is
+   * the identifier of the top-level element name, or `null` if the element is
+   * the unit.  The list is sorted in ascending order, so that the client can
+   * quickly check whether an element is referenced in this index.
+   */
+  elementNameUnitMemberIds:[uint] (id: 6);
+
+  /**
+   * Each item of this list corresponds to a unique referenced element.  It is
+   * the index into [unitLibraryUris] and [unitUnitUris] for the library
+   * specific unit where the element is declared.
+   */
+  elementUnits:[uint] (id: 5);
+
+  /**
+   * Identifier of the null string in [strings].
+   */
+  nullStringId:uint (id: 1);
+
+  /**
+   * List of unique element strings used in this index.  The list is sorted in
+   * ascending order, so that the client can quickly check the presence of a
+   * string in this index.
+   */
+  strings:[string] (id: 0);
+
+  /**
+   * Each item of this list corresponds to the library URI of a unique library
+   * specific unit referenced in the index.  It is an index into [strings] list.
+   */
+  unitLibraryUris:[uint] (id: 2);
+
+  /**
+   * Each item of this list corresponds to the unit URI of a unique library
+   * specific unit referenced in the index.  It is an index into [strings] list.
+   */
+  unitUnitUris:[uint] (id: 3);
+
+  /**
+   * Each item of this list is the `true` if the corresponding element usage
+   * is qualified with some prefix.
+   */
+  usedElementIsQualifiedFlags:[ubyte] (id: 13);
+
+  /**
+   * Each item of this list is the kind of the element usage.
+   */
+  usedElementKinds:[IndexRelationKind] (id: 10);
+
+  /**
+   * Each item of this list is the length of the element usage.
+   */
+  usedElementLengths:[uint] (id: 12);
+
+  /**
+   * Each item of this list is the offset of the element usage relative to the
+   * beginning of the file.
+   */
+  usedElementOffsets:[uint] (id: 11);
+
+  /**
+   * Each item of this list is the index into [elementUnits],
+   * [elementNameUnitMemberIds], [elementNameClassMemberIds] and
+   * [elementNameParameterIds].  The list is sorted in ascending order, so
+   * that the client can quickly find element references in this index.
+   */
+  usedElements:[uint] (id: 9);
+
+  /**
+   * Each item of this list is the `true` if the corresponding name usage
+   * is qualified with some prefix.
+   */
+  usedNameIsQualifiedFlags:[ubyte] (id: 17);
+
+  /**
+   * Each item of this list is the kind of the name usage.
+   */
+  usedNameKinds:[IndexRelationKind] (id: 15);
+
+  /**
+   * Each item of this list is the offset of the name usage relative to the
+   * beginning of the file.
+   */
+  usedNameOffsets:[uint] (id: 16);
+
+  /**
+   * Each item of this list is the index into [strings] for a used name.  The
+   * list is sorted in ascending order, so that the client can quickly find
+   * whether a name is used in this index.
+   */
+  usedNames:[uint] (id: 14);
+}
+
+/**
+ * Information about an unlinked unit.
+ */
+table AnalysisDriverUnlinkedUnit {
+  /**
+   * List of external names referenced by the unit.
+   */
+  referencedNames:[string] (id: 0);
+
+  /**
+   * Unlinked information for the unit.
+   */
+  unit:UnlinkedUnit (id: 1);
+}
+
+/**
  * Information about an element code range.
  */
 table CodeRange {
@@ -977,7 +1170,7 @@
    * Indicates whether this library was summarized in "fallback mode".  If
    * true, all other fields in the data structure have their default values.
    */
-  fallbackMode:bool (id: 5);
+  fallbackMode:bool (id: 5, deprecated);
 
   /**
    * For each import in [UnlinkedUnit.imports], an index into [dependencies]
@@ -1079,6 +1272,13 @@
   constCycles:[uint] (id: 2);
 
   /**
+   * List of slot ids (referring to [UnlinkedParam.inheritsCovariantSlot])
+   * corresponding to parameters that inherit `@covariant` behavior from a base
+   * class.
+   */
+  parametersInheritingCovariant:[uint] (id: 3);
+
+  /**
    * Information about the resolution of references within the compilation
    * unit.  Each element of [UnlinkedUnit.references] has a corresponding
    * element in this list (at the same index).  If this list has additional
@@ -1351,7 +1551,7 @@
   /**
    * Annotations for this class.
    */
-  annotations:[UnlinkedConst] (id: 5);
+  annotations:[UnlinkedExpr] (id: 5);
 
   /**
    * Code range of the class.
@@ -1474,61 +1674,6 @@
 }
 
 /**
- * Unlinked summary information about a compile-time constant expression, or a
- * potentially constant expression.
- *
- * Constant expressions are represented using a simple stack-based language
- * where [operations] is a sequence of operations to execute starting with an
- * empty stack.  Once all operations have been executed, the stack should
- * contain a single value which is the value of the constant.  Note that some
- * operations consume additional data from the other fields of this class.
- */
-table UnlinkedConst {
-  /**
-   * Sequence of operators used by assignment operations.
-   */
-  assignmentOperators:[UnlinkedExprAssignOperator] (id: 6);
-
-  /**
-   * Sequence of 64-bit doubles consumed by the operation `pushDouble`.
-   */
-  doubles:[double] (id: 4);
-
-  /**
-   * Sequence of unsigned 32-bit integers consumed by the operations
-   * `pushArgument`, `pushInt`, `shiftOr`, `concatenate`, `invokeConstructor`,
-   * `makeList`, and `makeMap`.
-   */
-  ints:[uint] (id: 1);
-
-  /**
-   * Indicates whether the expression is a valid potentially constant
-   * expression.
-   */
-  isValidConst:bool (id: 5);
-
-  /**
-   * Sequence of operations to execute (starting with an empty stack) to form
-   * the constant value.
-   */
-  operations:[UnlinkedConstOperation] (id: 0);
-
-  /**
-   * Sequence of language constructs consumed by the operations
-   * `pushReference`, `invokeConstructor`, `makeList`, and `makeMap`.  Note
-   * that in the case of `pushReference` (and sometimes `invokeConstructor` the
-   * actual entity being referred to may be something other than a type.
-   */
-  references:[EntityRef] (id: 2);
-
-  /**
-   * Sequence of strings consumed by the operations `pushString` and
-   * `invokeConstructor`.
-   */
-  strings:[string] (id: 3);
-}
-
-/**
  * Unlinked summary information about a constructor initializer.
  */
 table UnlinkedConstructorInitializer {
@@ -1543,13 +1688,13 @@
    * If [kind] is `thisInvocation` or `superInvocation`, the arguments of the
    * invocation.  Otherwise empty.
    */
-  arguments:[UnlinkedConst] (id: 3);
+  arguments:[UnlinkedExpr] (id: 3);
 
   /**
    * If [kind] is `field`, the expression of the field initializer.
    * Otherwise `null`.
    */
-  expression:UnlinkedConst (id: 1);
+  expression:UnlinkedExpr (id: 1);
 
   /**
    * The kind of the constructor initializer (field, redirect, super).
@@ -1596,7 +1741,7 @@
   /**
    * Annotations for this enum.
    */
-  annotations:[UnlinkedConst] (id: 4);
+  annotations:[UnlinkedExpr] (id: 4);
 
   /**
    * Code range of the enum.
@@ -1655,14 +1800,14 @@
   /**
    * Annotations for this executable.
    */
-  annotations:[UnlinkedConst] (id: 6);
+  annotations:[UnlinkedExpr] (id: 6);
 
   /**
    * If this executable's function body is declared using `=>`, the expression
    * to the right of the `=>`.  May be omitted if neither type inference nor
    * constant evaluation depends on the function body.
    */
-  bodyExpr:UnlinkedConst (id: 29);
+  bodyExpr:UnlinkedExpr (id: 29);
 
   /**
    * Code range of the executable.
@@ -1846,7 +1991,7 @@
   /**
    * Annotations for this export directive.
    */
-  annotations:[UnlinkedConst] (id: 3);
+  annotations:[UnlinkedExpr] (id: 3);
 
   /**
    * Offset of the "export" keyword.
@@ -1889,13 +2034,67 @@
 }
 
 /**
+ * Unlinked summary information about an expression.
+ *
+ * Expressions are represented using a simple stack-based language
+ * where [operations] is a sequence of operations to execute starting with an
+ * empty stack.  Once all operations have been executed, the stack should
+ * contain a single value which is the value of the constant.  Note that some
+ * operations consume additional data from the other fields of this class.
+ */
+table UnlinkedExpr {
+  /**
+   * Sequence of operators used by assignment operations.
+   */
+  assignmentOperators:[UnlinkedExprAssignOperator] (id: 6);
+
+  /**
+   * Sequence of 64-bit doubles consumed by the operation `pushDouble`.
+   */
+  doubles:[double] (id: 4);
+
+  /**
+   * Sequence of unsigned 32-bit integers consumed by the operations
+   * `pushArgument`, `pushInt`, `shiftOr`, `concatenate`, `invokeConstructor`,
+   * `makeList`, and `makeMap`.
+   */
+  ints:[uint] (id: 1);
+
+  /**
+   * Indicates whether the expression is a valid potentially constant
+   * expression.
+   */
+  isValidConst:bool (id: 5);
+
+  /**
+   * Sequence of operations to execute (starting with an empty stack) to form
+   * the constant value.
+   */
+  operations:[UnlinkedExprOperation] (id: 0);
+
+  /**
+   * Sequence of language constructs consumed by the operations
+   * `pushReference`, `invokeConstructor`, `makeList`, and `makeMap`.  Note
+   * that in the case of `pushReference` (and sometimes `invokeConstructor` the
+   * actual entity being referred to may be something other than a type.
+   */
+  references:[EntityRef] (id: 2);
+
+  /**
+   * Sequence of strings consumed by the operations `pushString` and
+   * `invokeConstructor`.
+   */
+  strings:[string] (id: 3);
+}
+
+/**
  * Unlinked summary information about an import declaration.
  */
 table UnlinkedImport {
   /**
    * Annotations for this import declaration.
    */
-  annotations:[UnlinkedConst] (id: 8);
+  annotations:[UnlinkedExpr] (id: 8);
 
   /**
    * Combinators contained in this import declaration.
@@ -1989,7 +2188,7 @@
   /**
    * Annotations for this parameter.
    */
-  annotations:[UnlinkedConst] (id: 9);
+  annotations:[UnlinkedExpr] (id: 9);
 
   /**
    * Code range of the parameter.
@@ -2016,6 +2215,16 @@
   inferredTypeSlot:uint (id: 2);
 
   /**
+   * If this is a parameter of an instance method, a nonzero slot id which is
+   * unique within this compilation unit.  If this id is found in
+   * [LinkedUnit.parametersInheritingCovariant], then this parameter inherits
+   * `@covariant` behavior from a base class.
+   *
+   * Otherwise, zero.
+   */
+  inheritsCovariantSlot:uint (id: 14);
+
+  /**
    * The synthetic initializer function of the parameter.  Absent if the variable
    * does not have an initializer.
    */
@@ -2077,7 +2286,7 @@
   /**
    * Annotations for this part declaration.
    */
-  annotations:[UnlinkedConst] (id: 2);
+  annotations:[UnlinkedExpr] (id: 2);
 
   /**
    * End of the URI string (including quotes) relative to the beginning of the
@@ -2183,7 +2392,7 @@
   /**
    * Annotations for this typedef.
    */
-  annotations:[UnlinkedConst] (id: 4);
+  annotations:[UnlinkedExpr] (id: 4);
 
   /**
    * Code range of the typedef.
@@ -2229,7 +2438,7 @@
   /**
    * Annotations for this type parameter.
    */
-  annotations:[UnlinkedConst] (id: 3);
+  annotations:[UnlinkedExpr] (id: 3);
 
   /**
    * Bound of the type parameter, if a bound is explicitly declared.  Otherwise
@@ -2258,6 +2467,13 @@
  */
 table UnlinkedUnit {
   /**
+   * MD5 hash of the non-informative fields of the [UnlinkedUnit] (not
+   * including this one) as 16 unsigned 8-bit integer values.  This can be used
+   * to identify when the API of a unit may have changed.
+   */
+  apiSignature:[uint] (id: 19);
+
+  /**
    * Classes declared in the compilation unit.
    */
   classes:[UnlinkedClass] (id: 2);
@@ -2290,7 +2506,7 @@
    * When this field is non-empty, all other fields in the data structure have
    * their default values.
    */
-  fallbackModePath:string (id: 16);
+  fallbackModePath:string (id: 16, deprecated);
 
   /**
    * Import declarations in the compilation unit.
@@ -2298,10 +2514,15 @@
   imports:[UnlinkedImport] (id: 5);
 
   /**
+   * Indicates whether the unit contains a "part of" declaration.
+   */
+  isPartOf:bool (id: 18);
+
+  /**
    * Annotations for the library declaration, or the empty list if there is no
    * library declaration.
    */
-  libraryAnnotations:[UnlinkedConst] (id: 14);
+  libraryAnnotations:[UnlinkedExpr] (id: 14);
 
   /**
    * Documentation comment for the library, or `null` if there is no
@@ -2369,7 +2590,7 @@
   /**
    * Annotations for this variable.
    */
-  annotations:[UnlinkedConst] (id: 8);
+  annotations:[UnlinkedExpr] (id: 8);
 
   /**
    * Code range of the variable.
diff --git a/pkg/analyzer/lib/src/summary/idl.dart b/pkg/analyzer/lib/src/summary/idl.dart
index 4eff005..9c07aff 100644
--- a/pkg/analyzer/lib/src/summary/idl.dart
+++ b/pkg/analyzer/lib/src/summary/idl.dart
@@ -58,6 +58,225 @@
 const informative = null;
 
 /**
+ * Information about a resolved unit.
+ */
+@TopLevel('ADRU')
+abstract class AnalysisDriverResolvedUnit extends base.SummaryClass {
+  factory AnalysisDriverResolvedUnit.fromBuffer(List<int> buffer) =>
+      generated.readAnalysisDriverResolvedUnit(buffer);
+
+  /**
+   * The full list of analysis errors, both syntactic and semantic.
+   */
+  @Id(0)
+  List<AnalysisDriverUnitError> get errors;
+
+  /**
+   * The index of the unit.
+   */
+  @Id(1)
+  AnalysisDriverUnitIndex get index;
+}
+
+/**
+ * Information about an error in a resolved unit.
+ */
+abstract class AnalysisDriverUnitError extends base.SummaryClass {
+  /**
+   * The optional correction hint for the error.
+   */
+  @Id(4)
+  String get correction;
+
+  /**
+   * The length of the error in the file.
+   */
+  @Id(1)
+  int get length;
+
+  /**
+   * The message of the error.
+   */
+  @Id(3)
+  String get message;
+
+  /**
+   * The offset from the beginning of the file.
+   */
+  @Id(0)
+  int get offset;
+
+  /**
+   * The unique name of the error code.
+   */
+  @Id(2)
+  String get uniqueName;
+}
+
+/**
+ * Information about a resolved unit.
+ */
+@TopLevel('ADUI')
+abstract class AnalysisDriverUnitIndex extends base.SummaryClass {
+  factory AnalysisDriverUnitIndex.fromBuffer(List<int> buffer) =>
+      generated.readAnalysisDriverUnitIndex(buffer);
+
+  /**
+   * Each item of this list corresponds to a unique referenced element.  It is
+   * the kind of the synthetic element.
+   */
+  @Id(4)
+  List<IndexSyntheticElementKind> get elementKinds;
+
+  /**
+   * Each item of this list corresponds to a unique referenced element.  It is
+   * the identifier of the class member element name, or `null` if the element
+   * is a top-level element.  The list is sorted in ascending order, so that the
+   * client can quickly check whether an element is referenced in this index.
+   */
+  @Id(7)
+  List<int> get elementNameClassMemberIds;
+
+  /**
+   * Each item of this list corresponds to a unique referenced element.  It is
+   * the identifier of the named parameter name, or `null` if the element is not
+   * a named parameter.  The list is sorted in ascending order, so that the
+   * client can quickly check whether an element is referenced in this index.
+   */
+  @Id(8)
+  List<int> get elementNameParameterIds;
+
+  /**
+   * Each item of this list corresponds to a unique referenced element.  It is
+   * the identifier of the top-level element name, or `null` if the element is
+   * the unit.  The list is sorted in ascending order, so that the client can
+   * quickly check whether an element is referenced in this index.
+   */
+  @Id(6)
+  List<int> get elementNameUnitMemberIds;
+
+  /**
+   * Each item of this list corresponds to a unique referenced element.  It is
+   * the index into [unitLibraryUris] and [unitUnitUris] for the library
+   * specific unit where the element is declared.
+   */
+  @Id(5)
+  List<int> get elementUnits;
+
+  /**
+   * Identifier of the null string in [strings].
+   */
+  @Id(1)
+  int get nullStringId;
+
+  /**
+   * List of unique element strings used in this index.  The list is sorted in
+   * ascending order, so that the client can quickly check the presence of a
+   * string in this index.
+   */
+  @Id(0)
+  List<String> get strings;
+
+  /**
+   * Each item of this list corresponds to the library URI of a unique library
+   * specific unit referenced in the index.  It is an index into [strings] list.
+   */
+  @Id(2)
+  List<int> get unitLibraryUris;
+
+  /**
+   * Each item of this list corresponds to the unit URI of a unique library
+   * specific unit referenced in the index.  It is an index into [strings] list.
+   */
+  @Id(3)
+  List<int> get unitUnitUris;
+
+  /**
+   * Each item of this list is the `true` if the corresponding element usage
+   * is qualified with some prefix.
+   */
+  @Id(13)
+  List<bool> get usedElementIsQualifiedFlags;
+
+  /**
+   * Each item of this list is the kind of the element usage.
+   */
+  @Id(10)
+  List<IndexRelationKind> get usedElementKinds;
+
+  /**
+   * Each item of this list is the length of the element usage.
+   */
+  @Id(12)
+  List<int> get usedElementLengths;
+
+  /**
+   * Each item of this list is the offset of the element usage relative to the
+   * beginning of the file.
+   */
+  @Id(11)
+  List<int> get usedElementOffsets;
+
+  /**
+   * Each item of this list is the index into [elementUnits],
+   * [elementNameUnitMemberIds], [elementNameClassMemberIds] and
+   * [elementNameParameterIds].  The list is sorted in ascending order, so
+   * that the client can quickly find element references in this index.
+   */
+  @Id(9)
+  List<int> get usedElements;
+
+  /**
+   * Each item of this list is the `true` if the corresponding name usage
+   * is qualified with some prefix.
+   */
+  @Id(17)
+  List<bool> get usedNameIsQualifiedFlags;
+
+  /**
+   * Each item of this list is the kind of the name usage.
+   */
+  @Id(15)
+  List<IndexRelationKind> get usedNameKinds;
+
+  /**
+   * Each item of this list is the offset of the name usage relative to the
+   * beginning of the file.
+   */
+  @Id(16)
+  List<int> get usedNameOffsets;
+
+  /**
+   * Each item of this list is the index into [strings] for a used name.  The
+   * list is sorted in ascending order, so that the client can quickly find
+   * whether a name is used in this index.
+   */
+  @Id(14)
+  List<int> get usedNames;
+}
+
+/**
+ * Information about an unlinked unit.
+ */
+@TopLevel('ADUU')
+abstract class AnalysisDriverUnlinkedUnit extends base.SummaryClass {
+  factory AnalysisDriverUnlinkedUnit.fromBuffer(List<int> buffer) =>
+      generated.readAnalysisDriverUnlinkedUnit(buffer);
+
+  /**
+   * List of external names referenced by the unit.
+   */
+  @Id(0)
+  List<String> get referencedNames;
+
+  /**
+   * Unlinked information for the unit.
+   */
+  @Id(1)
+  UnlinkedUnit get unit;
+}
+
+/**
  * Information about an element code range.
  */
 abstract class CodeRange extends base.SummaryClass {
@@ -415,6 +634,7 @@
    * Indicates whether this library was summarized in "fallback mode".  If
    * true, all other fields in the data structure have their default values.
    */
+  @deprecated
   @Id(5)
   bool get fallbackMode;
 
@@ -529,6 +749,14 @@
   List<int> get constCycles;
 
   /**
+   * List of slot ids (referring to [UnlinkedParam.inheritsCovariantSlot])
+   * corresponding to parameters that inherit `@covariant` behavior from a base
+   * class.
+   */
+  @Id(3)
+  List<int> get parametersInheritingCovariant;
+
+  /**
    * Information about the resolution of references within the compilation
    * unit.  Each element of [UnlinkedUnit.references] has a corresponding
    * element in this list (at the same index).  If this list has additional
@@ -913,7 +1141,7 @@
    * Annotations for this class.
    */
   @Id(5)
-  List<UnlinkedConst> get annotations;
+  List<UnlinkedExpr> get annotations;
 
   /**
    * Code range of the class.
@@ -1061,481 +1289,6 @@
 }
 
 /**
- * Unlinked summary information about a compile-time constant expression, or a
- * potentially constant expression.
- *
- * Constant expressions are represented using a simple stack-based language
- * where [operations] is a sequence of operations to execute starting with an
- * empty stack.  Once all operations have been executed, the stack should
- * contain a single value which is the value of the constant.  Note that some
- * operations consume additional data from the other fields of this class.
- */
-abstract class UnlinkedConst extends base.SummaryClass {
-  /**
-   * Sequence of operators used by assignment operations.
-   */
-  @Id(6)
-  List<UnlinkedExprAssignOperator> get assignmentOperators;
-
-  /**
-   * Sequence of 64-bit doubles consumed by the operation `pushDouble`.
-   */
-  @Id(4)
-  List<double> get doubles;
-
-  /**
-   * Sequence of unsigned 32-bit integers consumed by the operations
-   * `pushArgument`, `pushInt`, `shiftOr`, `concatenate`, `invokeConstructor`,
-   * `makeList`, and `makeMap`.
-   */
-  @Id(1)
-  List<int> get ints;
-
-  /**
-   * Indicates whether the expression is a valid potentially constant
-   * expression.
-   */
-  @Id(5)
-  bool get isValidConst;
-
-  /**
-   * Sequence of operations to execute (starting with an empty stack) to form
-   * the constant value.
-   */
-  @Id(0)
-  List<UnlinkedConstOperation> get operations;
-
-  /**
-   * Sequence of language constructs consumed by the operations
-   * `pushReference`, `invokeConstructor`, `makeList`, and `makeMap`.  Note
-   * that in the case of `pushReference` (and sometimes `invokeConstructor` the
-   * actual entity being referred to may be something other than a type.
-   */
-  @Id(2)
-  List<EntityRef> get references;
-
-  /**
-   * Sequence of strings consumed by the operations `pushString` and
-   * `invokeConstructor`.
-   */
-  @Id(3)
-  List<String> get strings;
-}
-
-/**
- * Enum representing the various kinds of operations which may be performed to
- * produce a constant value.  These options are assumed to execute in the
- * context of a stack which is initially empty.
- */
-enum UnlinkedConstOperation {
-  /**
-   * Push the next value from [UnlinkedConst.ints] (a 32-bit unsigned integer)
-   * onto the stack.
-   *
-   * Note that Dart supports integers larger than 32 bits; these are
-   * represented by composing 32-bit values using the [pushLongInt] operation.
-   */
-  pushInt,
-
-  /**
-   * Get the number of components from [UnlinkedConst.ints], then do this number
-   * of times the following operations: multiple the current value by 2^32, "or"
-   * it with the next value in [UnlinkedConst.ints]. The initial value is zero.
-   * Push the result into the stack.
-   */
-  pushLongInt,
-
-  /**
-   * Push the next value from [UnlinkedConst.doubles] (a double precision
-   * floating point value) onto the stack.
-   */
-  pushDouble,
-
-  /**
-   * Push the constant `true` onto the stack.
-   */
-  pushTrue,
-
-  /**
-   * Push the constant `false` onto the stack.
-   */
-  pushFalse,
-
-  /**
-   * Push the next value from [UnlinkedConst.strings] onto the stack.
-   */
-  pushString,
-
-  /**
-   * Pop the top n values from the stack (where n is obtained from
-   * [UnlinkedConst.ints]), convert them to strings (if they aren't already),
-   * concatenate them into a single string, and push it back onto the stack.
-   *
-   * This operation is used to represent constants whose value is a literal
-   * string containing string interpolations.
-   */
-  concatenate,
-
-  /**
-   * Get the next value from [UnlinkedConst.strings], convert it to a symbol,
-   * and push it onto the stack.
-   */
-  makeSymbol,
-
-  /**
-   * Push the constant `null` onto the stack.
-   */
-  pushNull,
-
-  /**
-   * Push the value of the function parameter with the name obtained from
-   * [UnlinkedConst.strings].
-   */
-  pushParameter,
-
-  /**
-   * Evaluate a (potentially qualified) identifier expression and push the
-   * resulting value onto the stack.  The identifier to be evaluated is
-   * obtained from [UnlinkedConst.references].
-   *
-   * This operation is used to represent the following kinds of constants
-   * (which are indistinguishable from an unresolved AST alone):
-   *
-   * - A qualified reference to a static constant variable (e.g. `C.v`, where
-   *   C is a class and `v` is a constant static variable in `C`).
-   * - An identifier expression referring to a constant variable.
-   * - A simple or qualified identifier denoting a class or type alias.
-   * - A simple or qualified identifier denoting a top-level function or a
-   *   static method.
-   */
-  pushReference,
-
-  /**
-   * Pop the top value from the stack, extract the value of the property with
-   * the name obtained from [UnlinkedConst.strings], and push the result back
-   * onto the stack.
-   */
-  extractProperty,
-
-  /**
-   * Pop the top `n` values from the stack (where `n` is obtained from
-   * [UnlinkedConst.ints]) into a list (filled from the end) and take the next
-   * `n` values from [UnlinkedConst.strings] and use the lists of names and
-   * values to create named arguments.  Then pop the top `m` values from the
-   * stack (where `m` is obtained from [UnlinkedConst.ints]) into a list (filled
-   * from the end) and use them as positional arguments.  Use the lists of
-   * positional and names arguments to invoke a constant constructor obtained
-   * from [UnlinkedConst.references], and push the resulting value back onto the
-   * stack.
-   *
-   * Note that for an invocation of the form `const a.b(...)` (where no type
-   * arguments are specified), it is impossible to tell from the unresolved AST
-   * alone whether `a` is a class name and `b` is a constructor name, or `a` is
-   * a prefix name and `b` is a class name.  For consistency between AST based
-   * and elements based summaries, references to default constructors are always
-   * recorded as references to corresponding classes.
-   */
-  invokeConstructor,
-
-  /**
-   * Pop the top n values from the stack (where n is obtained from
-   * [UnlinkedConst.ints]), place them in a [List], and push the result back
-   * onto the stack.  The type parameter for the [List] is implicitly `dynamic`.
-   */
-  makeUntypedList,
-
-  /**
-   * Pop the top 2*n values from the stack (where n is obtained from
-   * [UnlinkedConst.ints]), interpret them as key/value pairs, place them in a
-   * [Map], and push the result back onto the stack.  The two type parameters
-   * for the [Map] are implicitly `dynamic`.
-   */
-  makeUntypedMap,
-
-  /**
-   * Pop the top n values from the stack (where n is obtained from
-   * [UnlinkedConst.ints]), place them in a [List], and push the result back
-   * onto the stack.  The type parameter for the [List] is obtained from
-   * [UnlinkedConst.references].
-   */
-  makeTypedList,
-
-  /**
-   * Pop the top 2*n values from the stack (where n is obtained from
-   * [UnlinkedConst.ints]), interpret them as key/value pairs, place them in a
-   * [Map], and push the result back onto the stack.  The two type parameters for
-   * the [Map] are obtained from [UnlinkedConst.references].
-   */
-  makeTypedMap,
-
-  /**
-   * Pop the top 2 values from the stack, evaluate `v1 == v2`, and push the
-   * result back onto the stack.
-   */
-  equal,
-
-  /**
-   * Pop the top 2 values from the stack, evaluate `v1 != v2`, and push the
-   * result back onto the stack.
-   */
-  notEqual,
-
-  /**
-   * Pop the top value from the stack, compute its boolean negation, and push
-   * the result back onto the stack.
-   */
-  not,
-
-  /**
-   * Pop the top 2 values from the stack, compute `v1 && v2`, and push the
-   * result back onto the stack.
-   */
-  and,
-
-  /**
-   * Pop the top 2 values from the stack, compute `v1 || v2`, and push the
-   * result back onto the stack.
-   */
-  or,
-
-  /**
-   * Pop the top value from the stack, compute its integer complement, and push
-   * the result back onto the stack.
-   */
-  complement,
-
-  /**
-   * Pop the top 2 values from the stack, compute `v1 ^ v2`, and push the
-   * result back onto the stack.
-   */
-  bitXor,
-
-  /**
-   * Pop the top 2 values from the stack, compute `v1 & v2`, and push the
-   * result back onto the stack.
-   */
-  bitAnd,
-
-  /**
-   * Pop the top 2 values from the stack, compute `v1 | v2`, and push the
-   * result back onto the stack.
-   */
-  bitOr,
-
-  /**
-   * Pop the top 2 values from the stack, compute `v1 >> v2`, and push the
-   * result back onto the stack.
-   */
-  bitShiftRight,
-
-  /**
-   * Pop the top 2 values from the stack, compute `v1 << v2`, and push the
-   * result back onto the stack.
-   */
-  bitShiftLeft,
-
-  /**
-   * Pop the top 2 values from the stack, compute `v1 + v2`, and push the
-   * result back onto the stack.
-   */
-  add,
-
-  /**
-   * Pop the top value from the stack, compute its integer negation, and push
-   * the result back onto the stack.
-   */
-  negate,
-
-  /**
-   * Pop the top 2 values from the stack, compute `v1 - v2`, and push the
-   * result back onto the stack.
-   */
-  subtract,
-
-  /**
-   * Pop the top 2 values from the stack, compute `v1 * v2`, and push the
-   * result back onto the stack.
-   */
-  multiply,
-
-  /**
-   * Pop the top 2 values from the stack, compute `v1 / v2`, and push the
-   * result back onto the stack.
-   */
-  divide,
-
-  /**
-   * Pop the top 2 values from the stack, compute `v1 ~/ v2`, and push the
-   * result back onto the stack.
-   */
-  floorDivide,
-
-  /**
-   * Pop the top 2 values from the stack, compute `v1 > v2`, and push the
-   * result back onto the stack.
-   */
-  greater,
-
-  /**
-   * Pop the top 2 values from the stack, compute `v1 < v2`, and push the
-   * result back onto the stack.
-   */
-  less,
-
-  /**
-   * Pop the top 2 values from the stack, compute `v1 >= v2`, and push the
-   * result back onto the stack.
-   */
-  greaterEqual,
-
-  /**
-   * Pop the top 2 values from the stack, compute `v1 <= v2`, and push the
-   * result back onto the stack.
-   */
-  lessEqual,
-
-  /**
-   * Pop the top 2 values from the stack, compute `v1 % v2`, and push the
-   * result back onto the stack.
-   */
-  modulo,
-
-  /**
-   * Pop the top 3 values from the stack, compute `v1 ? v2 : v3`, and push the
-   * result back onto the stack.
-   */
-  conditional,
-
-  /**
-   * Pop from the stack `value` and get the next `target` reference from
-   * [UnlinkedConst.references] - a top-level variable (prefixed or not), an
-   * assignable field of a class (prefixed or not), or a sequence of getters
-   * ending with an assignable property `a.b.b.c.d.e`.  In general `a.b` cannot
-   * not be distinguished between: `a` is a prefix and `b` is a top-level
-   * variable; or `a` is an object and `b` is the name of a property.  Perform
-   * `reference op= value` where `op` is the next assignment operator from
-   * [UnlinkedConst.assignmentOperators].  Push `value` back into the stack.
-   *
-   * If the assignment operator is a prefix/postfix increment/decrement, then
-   * `value` is not present in the stack, so it should not be popped and the
-   * corresponding value of the `target` after/before update is pushed into the
-   * stack instead.
-   */
-  assignToRef,
-
-  /**
-   * Pop from the stack `target` and `value`.  Get the name of the property from
-   * `UnlinkedConst.strings` and assign the `value` to the named property of the
-   * `target`.  This operation is used when we know that the `target` is an
-   * object reference expression, e.g. `new Foo().a.b.c` or `a.b[0].c.d`.
-   * Perform `target.property op= value` where `op` is the next assignment
-   * operator from [UnlinkedConst.assignmentOperators].  Push `value` back into
-   * the stack.
-   *
-   * If the assignment operator is a prefix/postfix increment/decrement, then
-   * `value` is not present in the stack, so it should not be popped and the
-   * corresponding value of the `target` after/before update is pushed into the
-   * stack instead.
-   */
-  assignToProperty,
-
-  /**
-   * Pop from the stack `index`, `target` and `value`.  Perform
-   * `target[index] op= value`  where `op` is the next assignment operator from
-   * [UnlinkedConst.assignmentOperators].  Push `value` back into the stack.
-   *
-   * If the assignment operator is a prefix/postfix increment/decrement, then
-   * `value` is not present in the stack, so it should not be popped and the
-   * corresponding value of the `target` after/before update is pushed into the
-   * stack instead.
-   */
-  assignToIndex,
-
-  /**
-   * Pop from the stack `index` and `target`.  Push into the stack the result
-   * of evaluation of `target[index]`.
-   */
-  extractIndex,
-
-  /**
-   * Pop the top `n` values from the stack (where `n` is obtained from
-   * [UnlinkedConst.ints]) into a list (filled from the end) and take the next
-   * `n` values from [UnlinkedConst.strings] and use the lists of names and
-   * values to create named arguments.  Then pop the top `m` values from the
-   * stack (where `m` is obtained from [UnlinkedConst.ints]) into a list (filled
-   * from the end) and use them as positional arguments.  Use the lists of
-   * positional and names arguments to invoke a method (or a function) with
-   * the reference from [UnlinkedConst.references].  If `k` is nonzero (where
-   * `k` is obtained from [UnlinkedConst.ints]), obtain `k` type arguments from
-   * [UnlinkedConst.references] and use them as generic type arguments for the
-   * aforementioned method or function.  Push the result of the invocation onto
-   * the stack.
-   *
-   * In general `a.b` cannot not be distinguished between: `a` is a prefix and
-   * `b` is a top-level function; or `a` is an object and `b` is the name of a
-   * method.  This operation should be used for a sequence of identifiers
-   * `a.b.b.c.d.e` ending with an invokable result.
-   */
-  invokeMethodRef,
-
-  /**
-   * Pop the top `n` values from the stack (where `n` is obtained from
-   * [UnlinkedConst.ints]) into a list (filled from the end) and take the next
-   * `n` values from [UnlinkedConst.strings] and use the lists of names and
-   * values to create named arguments.  Then pop the top `m` values from the
-   * stack (where `m` is obtained from [UnlinkedConst.ints]) into a list (filled
-   * from the end) and use them as positional arguments.  Use the lists of
-   * positional and names arguments to invoke the method with the name from
-   * [UnlinkedConst.strings] of the target popped from the stack.  If `k` is
-   * nonzero (where `k` is obtained from [UnlinkedConst.ints]), obtain `k` type
-   * arguments from [UnlinkedConst.references] and use them as generic type
-   * arguments for the aforementioned method.  Push the result of the
-   * invocation onto the stack.
-   *
-   * This operation should be used for invocation of a method invocation
-   * where `target` is known to be an object instance.
-   */
-  invokeMethod,
-
-  /**
-   * Begin a new cascade section.  Duplicate the top value of the stack.
-   */
-  cascadeSectionBegin,
-
-  /**
-   * End a new cascade section.  Pop the top value from the stack and throw it
-   * away.
-   */
-  cascadeSectionEnd,
-
-  /**
-   * Pop the top value from the stack and cast it to the type with reference
-   * from [UnlinkedConst.references], push the result into the stack.
-   */
-  typeCast,
-
-  /**
-   * Pop the top value from the stack and check whether it is a subclass of the
-   * type with reference from [UnlinkedConst.references], push the result into
-   * the stack.
-   */
-  typeCheck,
-
-  /**
-   * Pop the top value from the stack and raise an exception with this value.
-   */
-  throwException,
-
-  /**
-   * Obtain two values `n` and `m` from [UnlinkedConst.ints].  Then, starting at
-   * the executable element for the expression being evaluated, if n > 0, pop to
-   * the nth enclosing function element.  Then, push the mth local function of
-   * that element onto the stack.
-   */
-  pushLocalFunctionReference,
-}
-
-/**
  * Unlinked summary information about a constructor initializer.
  */
 abstract class UnlinkedConstructorInitializer extends base.SummaryClass {
@@ -1552,14 +1305,14 @@
    * invocation.  Otherwise empty.
    */
   @Id(3)
-  List<UnlinkedConst> get arguments;
+  List<UnlinkedExpr> get arguments;
 
   /**
    * If [kind] is `field`, the expression of the field initializer.
    * Otherwise `null`.
    */
   @Id(1)
-  UnlinkedConst get expression;
+  UnlinkedExpr get expression;
 
   /**
    * The kind of the constructor initializer (field, redirect, super).
@@ -1634,7 +1387,7 @@
    * Annotations for this enum.
    */
   @Id(4)
-  List<UnlinkedConst> get annotations;
+  List<UnlinkedExpr> get annotations;
 
   /**
    * Code range of the enum.
@@ -1707,7 +1460,7 @@
    * Annotations for this executable.
    */
   @Id(6)
-  List<UnlinkedConst> get annotations;
+  List<UnlinkedExpr> get annotations;
 
   /**
    * If this executable's function body is declared using `=>`, the expression
@@ -1715,7 +1468,7 @@
    * constant evaluation depends on the function body.
    */
   @Id(29)
-  UnlinkedConst get bodyExpr;
+  UnlinkedExpr get bodyExpr;
 
   /**
    * Code range of the executable.
@@ -1918,12 +1671,14 @@
   /**
    * If a local function, the length of the visible range; zero otherwise.
    */
+  @informative
   @Id(20)
   int get visibleLength;
 
   /**
    * If a local function, the beginning of the visible range; zero otherwise.
    */
+  @informative
   @Id(21)
   int get visibleOffset;
 }
@@ -1962,7 +1717,7 @@
    * Annotations for this export directive.
    */
   @Id(3)
-  List<UnlinkedConst> get annotations;
+  List<UnlinkedExpr> get annotations;
 
   /**
    * Offset of the "export" keyword.
@@ -2014,11 +1769,72 @@
 }
 
 /**
+ * Unlinked summary information about an expression.
+ *
+ * Expressions are represented using a simple stack-based language
+ * where [operations] is a sequence of operations to execute starting with an
+ * empty stack.  Once all operations have been executed, the stack should
+ * contain a single value which is the value of the constant.  Note that some
+ * operations consume additional data from the other fields of this class.
+ */
+abstract class UnlinkedExpr extends base.SummaryClass {
+  /**
+   * Sequence of operators used by assignment operations.
+   */
+  @Id(6)
+  List<UnlinkedExprAssignOperator> get assignmentOperators;
+
+  /**
+   * Sequence of 64-bit doubles consumed by the operation `pushDouble`.
+   */
+  @Id(4)
+  List<double> get doubles;
+
+  /**
+   * Sequence of unsigned 32-bit integers consumed by the operations
+   * `pushArgument`, `pushInt`, `shiftOr`, `concatenate`, `invokeConstructor`,
+   * `makeList`, and `makeMap`.
+   */
+  @Id(1)
+  List<int> get ints;
+
+  /**
+   * Indicates whether the expression is a valid potentially constant
+   * expression.
+   */
+  @Id(5)
+  bool get isValidConst;
+
+  /**
+   * Sequence of operations to execute (starting with an empty stack) to form
+   * the constant value.
+   */
+  @Id(0)
+  List<UnlinkedExprOperation> get operations;
+
+  /**
+   * Sequence of language constructs consumed by the operations
+   * `pushReference`, `invokeConstructor`, `makeList`, and `makeMap`.  Note
+   * that in the case of `pushReference` (and sometimes `invokeConstructor` the
+   * actual entity being referred to may be something other than a type.
+   */
+  @Id(2)
+  List<EntityRef> get references;
+
+  /**
+   * Sequence of strings consumed by the operations `pushString` and
+   * `invokeConstructor`.
+   */
+  @Id(3)
+  List<String> get strings;
+}
+
+/**
  * Enum representing the various kinds of assignment operations combined
  * with:
- *    [UnlinkedConstOperation.assignToRef],
- *    [UnlinkedConstOperation.assignToProperty],
- *    [UnlinkedConstOperation.assignToIndex].
+ *    [UnlinkedExprOperation.assignToRef],
+ *    [UnlinkedExprOperation.assignToProperty],
+ *    [UnlinkedExprOperation.assignToIndex].
  */
 enum UnlinkedExprAssignOperator {
   /**
@@ -2108,6 +1924,432 @@
 }
 
 /**
+ * Enum representing the various kinds of operations which may be performed to
+ * in an expression.  These options are assumed to execute in the
+ * context of a stack which is initially empty.
+ */
+enum UnlinkedExprOperation {
+  /**
+   * Push the next value from [UnlinkedExpr.ints] (a 32-bit unsigned integer)
+   * onto the stack.
+   *
+   * Note that Dart supports integers larger than 32 bits; these are
+   * represented by composing 32-bit values using the [pushLongInt] operation.
+   */
+  pushInt,
+
+  /**
+   * Get the number of components from [UnlinkedExpr.ints], then do this number
+   * of times the following operations: multiple the current value by 2^32, "or"
+   * it with the next value in [UnlinkedExpr.ints]. The initial value is zero.
+   * Push the result into the stack.
+   */
+  pushLongInt,
+
+  /**
+   * Push the next value from [UnlinkedExpr.doubles] (a double precision
+   * floating point value) onto the stack.
+   */
+  pushDouble,
+
+  /**
+   * Push the constant `true` onto the stack.
+   */
+  pushTrue,
+
+  /**
+   * Push the constant `false` onto the stack.
+   */
+  pushFalse,
+
+  /**
+   * Push the next value from [UnlinkedExpr.strings] onto the stack.
+   */
+  pushString,
+
+  /**
+   * Pop the top n values from the stack (where n is obtained from
+   * [UnlinkedExpr.ints]), convert them to strings (if they aren't already),
+   * concatenate them into a single string, and push it back onto the stack.
+   *
+   * This operation is used to represent constants whose value is a literal
+   * string containing string interpolations.
+   */
+  concatenate,
+
+  /**
+   * Get the next value from [UnlinkedExpr.strings], convert it to a symbol,
+   * and push it onto the stack.
+   */
+  makeSymbol,
+
+  /**
+   * Push the constant `null` onto the stack.
+   */
+  pushNull,
+
+  /**
+   * Push the value of the function parameter with the name obtained from
+   * [UnlinkedExpr.strings].
+   */
+  pushParameter,
+
+  /**
+   * Evaluate a (potentially qualified) identifier expression and push the
+   * resulting value onto the stack.  The identifier to be evaluated is
+   * obtained from [UnlinkedExpr.references].
+   *
+   * This operation is used to represent the following kinds of constants
+   * (which are indistinguishable from an unresolved AST alone):
+   *
+   * - A qualified reference to a static constant variable (e.g. `C.v`, where
+   *   C is a class and `v` is a constant static variable in `C`).
+   * - An identifier expression referring to a constant variable.
+   * - A simple or qualified identifier denoting a class or type alias.
+   * - A simple or qualified identifier denoting a top-level function or a
+   *   static method.
+   */
+  pushReference,
+
+  /**
+   * Pop the top value from the stack, extract the value of the property with
+   * the name obtained from [UnlinkedExpr.strings], and push the result back
+   * onto the stack.
+   */
+  extractProperty,
+
+  /**
+   * Pop the top `n` values from the stack (where `n` is obtained from
+   * [UnlinkedExpr.ints]) into a list (filled from the end) and take the next
+   * `n` values from [UnlinkedExpr.strings] and use the lists of names and
+   * values to create named arguments.  Then pop the top `m` values from the
+   * stack (where `m` is obtained from [UnlinkedExpr.ints]) into a list (filled
+   * from the end) and use them as positional arguments.  Use the lists of
+   * positional and names arguments to invoke a constant constructor obtained
+   * from [UnlinkedExpr.references], and push the resulting value back onto the
+   * stack.
+   *
+   * Note that for an invocation of the form `const a.b(...)` (where no type
+   * arguments are specified), it is impossible to tell from the unresolved AST
+   * alone whether `a` is a class name and `b` is a constructor name, or `a` is
+   * a prefix name and `b` is a class name.  For consistency between AST based
+   * and elements based summaries, references to default constructors are always
+   * recorded as references to corresponding classes.
+   */
+  invokeConstructor,
+
+  /**
+   * Pop the top n values from the stack (where n is obtained from
+   * [UnlinkedExpr.ints]), place them in a [List], and push the result back
+   * onto the stack.  The type parameter for the [List] is implicitly `dynamic`.
+   */
+  makeUntypedList,
+
+  /**
+   * Pop the top 2*n values from the stack (where n is obtained from
+   * [UnlinkedExpr.ints]), interpret them as key/value pairs, place them in a
+   * [Map], and push the result back onto the stack.  The two type parameters
+   * for the [Map] are implicitly `dynamic`.
+   */
+  makeUntypedMap,
+
+  /**
+   * Pop the top n values from the stack (where n is obtained from
+   * [UnlinkedExpr.ints]), place them in a [List], and push the result back
+   * onto the stack.  The type parameter for the [List] is obtained from
+   * [UnlinkedExpr.references].
+   */
+  makeTypedList,
+
+  /**
+   * Pop the top 2*n values from the stack (where n is obtained from
+   * [UnlinkedExpr.ints]), interpret them as key/value pairs, place them in a
+   * [Map], and push the result back onto the stack.  The two type parameters for
+   * the [Map] are obtained from [UnlinkedExpr.references].
+   */
+  makeTypedMap,
+
+  /**
+   * Pop the top 2 values from the stack, evaluate `v1 == v2`, and push the
+   * result back onto the stack.
+   */
+  equal,
+
+  /**
+   * Pop the top 2 values from the stack, evaluate `v1 != v2`, and push the
+   * result back onto the stack.
+   */
+  notEqual,
+
+  /**
+   * Pop the top value from the stack, compute its boolean negation, and push
+   * the result back onto the stack.
+   */
+  not,
+
+  /**
+   * Pop the top 2 values from the stack, compute `v1 && v2`, and push the
+   * result back onto the stack.
+   */
+  and,
+
+  /**
+   * Pop the top 2 values from the stack, compute `v1 || v2`, and push the
+   * result back onto the stack.
+   */
+  or,
+
+  /**
+   * Pop the top value from the stack, compute its integer complement, and push
+   * the result back onto the stack.
+   */
+  complement,
+
+  /**
+   * Pop the top 2 values from the stack, compute `v1 ^ v2`, and push the
+   * result back onto the stack.
+   */
+  bitXor,
+
+  /**
+   * Pop the top 2 values from the stack, compute `v1 & v2`, and push the
+   * result back onto the stack.
+   */
+  bitAnd,
+
+  /**
+   * Pop the top 2 values from the stack, compute `v1 | v2`, and push the
+   * result back onto the stack.
+   */
+  bitOr,
+
+  /**
+   * Pop the top 2 values from the stack, compute `v1 >> v2`, and push the
+   * result back onto the stack.
+   */
+  bitShiftRight,
+
+  /**
+   * Pop the top 2 values from the stack, compute `v1 << v2`, and push the
+   * result back onto the stack.
+   */
+  bitShiftLeft,
+
+  /**
+   * Pop the top 2 values from the stack, compute `v1 + v2`, and push the
+   * result back onto the stack.
+   */
+  add,
+
+  /**
+   * Pop the top value from the stack, compute its integer negation, and push
+   * the result back onto the stack.
+   */
+  negate,
+
+  /**
+   * Pop the top 2 values from the stack, compute `v1 - v2`, and push the
+   * result back onto the stack.
+   */
+  subtract,
+
+  /**
+   * Pop the top 2 values from the stack, compute `v1 * v2`, and push the
+   * result back onto the stack.
+   */
+  multiply,
+
+  /**
+   * Pop the top 2 values from the stack, compute `v1 / v2`, and push the
+   * result back onto the stack.
+   */
+  divide,
+
+  /**
+   * Pop the top 2 values from the stack, compute `v1 ~/ v2`, and push the
+   * result back onto the stack.
+   */
+  floorDivide,
+
+  /**
+   * Pop the top 2 values from the stack, compute `v1 > v2`, and push the
+   * result back onto the stack.
+   */
+  greater,
+
+  /**
+   * Pop the top 2 values from the stack, compute `v1 < v2`, and push the
+   * result back onto the stack.
+   */
+  less,
+
+  /**
+   * Pop the top 2 values from the stack, compute `v1 >= v2`, and push the
+   * result back onto the stack.
+   */
+  greaterEqual,
+
+  /**
+   * Pop the top 2 values from the stack, compute `v1 <= v2`, and push the
+   * result back onto the stack.
+   */
+  lessEqual,
+
+  /**
+   * Pop the top 2 values from the stack, compute `v1 % v2`, and push the
+   * result back onto the stack.
+   */
+  modulo,
+
+  /**
+   * Pop the top 3 values from the stack, compute `v1 ? v2 : v3`, and push the
+   * result back onto the stack.
+   */
+  conditional,
+
+  /**
+   * Pop from the stack `value` and get the next `target` reference from
+   * [UnlinkedExpr.references] - a top-level variable (prefixed or not), an
+   * assignable field of a class (prefixed or not), or a sequence of getters
+   * ending with an assignable property `a.b.b.c.d.e`.  In general `a.b` cannot
+   * not be distinguished between: `a` is a prefix and `b` is a top-level
+   * variable; or `a` is an object and `b` is the name of a property.  Perform
+   * `reference op= value` where `op` is the next assignment operator from
+   * [UnlinkedExpr.assignmentOperators].  Push `value` back into the stack.
+   *
+   * If the assignment operator is a prefix/postfix increment/decrement, then
+   * `value` is not present in the stack, so it should not be popped and the
+   * corresponding value of the `target` after/before update is pushed into the
+   * stack instead.
+   */
+  assignToRef,
+
+  /**
+   * Pop from the stack `target` and `value`.  Get the name of the property from
+   * `UnlinkedConst.strings` and assign the `value` to the named property of the
+   * `target`.  This operation is used when we know that the `target` is an
+   * object reference expression, e.g. `new Foo().a.b.c` or `a.b[0].c.d`.
+   * Perform `target.property op= value` where `op` is the next assignment
+   * operator from [UnlinkedExpr.assignmentOperators].  Push `value` back into
+   * the stack.
+   *
+   * If the assignment operator is a prefix/postfix increment/decrement, then
+   * `value` is not present in the stack, so it should not be popped and the
+   * corresponding value of the `target` after/before update is pushed into the
+   * stack instead.
+   */
+  assignToProperty,
+
+  /**
+   * Pop from the stack `index`, `target` and `value`.  Perform
+   * `target[index] op= value`  where `op` is the next assignment operator from
+   * [UnlinkedExpr.assignmentOperators].  Push `value` back into the stack.
+   *
+   * If the assignment operator is a prefix/postfix increment/decrement, then
+   * `value` is not present in the stack, so it should not be popped and the
+   * corresponding value of the `target` after/before update is pushed into the
+   * stack instead.
+   */
+  assignToIndex,
+
+  /**
+   * Pop from the stack `index` and `target`.  Push into the stack the result
+   * of evaluation of `target[index]`.
+   */
+  extractIndex,
+
+  /**
+   * Pop the top `n` values from the stack (where `n` is obtained from
+   * [UnlinkedExpr.ints]) into a list (filled from the end) and take the next
+   * `n` values from [UnlinkedExpr.strings] and use the lists of names and
+   * values to create named arguments.  Then pop the top `m` values from the
+   * stack (where `m` is obtained from [UnlinkedExpr.ints]) into a list (filled
+   * from the end) and use them as positional arguments.  Use the lists of
+   * positional and names arguments to invoke a method (or a function) with
+   * the reference from [UnlinkedExpr.references].  If `k` is nonzero (where
+   * `k` is obtained from [UnlinkedExpr.ints]), obtain `k` type arguments from
+   * [UnlinkedExpr.references] and use them as generic type arguments for the
+   * aforementioned method or function.  Push the result of the invocation onto
+   * the stack.
+   *
+   * In general `a.b` cannot not be distinguished between: `a` is a prefix and
+   * `b` is a top-level function; or `a` is an object and `b` is the name of a
+   * method.  This operation should be used for a sequence of identifiers
+   * `a.b.b.c.d.e` ending with an invokable result.
+   */
+  invokeMethodRef,
+
+  /**
+   * Pop the top `n` values from the stack (where `n` is obtained from
+   * [UnlinkedExpr.ints]) into a list (filled from the end) and take the next
+   * `n` values from [UnlinkedExpr.strings] and use the lists of names and
+   * values to create named arguments.  Then pop the top `m` values from the
+   * stack (where `m` is obtained from [UnlinkedExpr.ints]) into a list (filled
+   * from the end) and use them as positional arguments.  Use the lists of
+   * positional and names arguments to invoke the method with the name from
+   * [UnlinkedExpr.strings] of the target popped from the stack.  If `k` is
+   * nonzero (where `k` is obtained from [UnlinkedExpr.ints]), obtain `k` type
+   * arguments from [UnlinkedExpr.references] and use them as generic type
+   * arguments for the aforementioned method.  Push the result of the
+   * invocation onto the stack.
+   *
+   * This operation should be used for invocation of a method invocation
+   * where `target` is known to be an object instance.
+   */
+  invokeMethod,
+
+  /**
+   * Begin a new cascade section.  Duplicate the top value of the stack.
+   */
+  cascadeSectionBegin,
+
+  /**
+   * End a new cascade section.  Pop the top value from the stack and throw it
+   * away.
+   */
+  cascadeSectionEnd,
+
+  /**
+   * Pop the top value from the stack and cast it to the type with reference
+   * from [UnlinkedExpr.references], push the result into the stack.
+   */
+  typeCast,
+
+  /**
+   * Pop the top value from the stack and check whether it is a subclass of the
+   * type with reference from [UnlinkedExpr.references], push the result into
+   * the stack.
+   */
+  typeCheck,
+
+  /**
+   * Pop the top value from the stack and raise an exception with this value.
+   */
+  throwException,
+
+  /**
+   * Obtain two values `n` and `m` from [UnlinkedExpr.ints].  Then, starting at
+   * the executable element for the expression being evaluated, if n > 0, pop to
+   * the nth enclosing function element.  Then, push the mth local function of
+   * that element onto the stack.
+   */
+  pushLocalFunctionReference,
+
+  /**
+   * Pop the top two values from the stack.  If the first value is non-null,
+   * keep it and discard the second.  Otherwise, keep the second and discard the
+   * first.
+   */
+  ifNull,
+
+  /**
+   * Pop the top value from the stack.  Treat it as a Future and await its
+   * completion.  Then push the awaited value onto the stack.
+   */
+  await,
+}
+
+/**
  * Unlinked summary information about an import declaration.
  */
 abstract class UnlinkedImport extends base.SummaryClass {
@@ -2115,7 +2357,7 @@
    * Annotations for this import declaration.
    */
   @Id(8)
-  List<UnlinkedConst> get annotations;
+  List<UnlinkedExpr> get annotations;
 
   /**
    * Combinators contained in this import declaration.
@@ -2229,7 +2471,7 @@
    * Annotations for this parameter.
    */
   @Id(9)
-  List<UnlinkedConst> get annotations;
+  List<UnlinkedExpr> get annotations;
 
   /**
    * Code range of the parameter.
@@ -2261,6 +2503,17 @@
   int get inferredTypeSlot;
 
   /**
+   * If this is a parameter of an instance method, a nonzero slot id which is
+   * unique within this compilation unit.  If this id is found in
+   * [LinkedUnit.parametersInheritingCovariant], then this parameter inherits
+   * `@covariant` behavior from a base class.
+   *
+   * Otherwise, zero.
+   */
+  @Id(14)
+  int get inheritsCovariantSlot;
+
+  /**
    * The synthetic initializer function of the parameter.  Absent if the variable
    * does not have an initializer.
    */
@@ -2316,12 +2569,14 @@
   /**
    * The length of the visible range.
    */
+  @informative
   @Id(10)
   int get visibleLength;
 
   /**
    * The beginning of the visible range.
    */
+  @informative
   @Id(11)
   int get visibleOffset;
 }
@@ -2354,7 +2609,7 @@
    * Annotations for this part declaration.
    */
   @Id(2)
-  List<UnlinkedConst> get annotations;
+  List<UnlinkedExpr> get annotations;
 
   /**
    * End of the URI string (including quotes) relative to the beginning of the
@@ -2478,7 +2733,7 @@
    * Annotations for this typedef.
    */
   @Id(4)
-  List<UnlinkedConst> get annotations;
+  List<UnlinkedExpr> get annotations;
 
   /**
    * Code range of the typedef.
@@ -2535,7 +2790,7 @@
    * Annotations for this type parameter.
    */
   @Id(3)
-  List<UnlinkedConst> get annotations;
+  List<UnlinkedExpr> get annotations;
 
   /**
    * Bound of the type parameter, if a bound is explicitly declared.  Otherwise
@@ -2574,6 +2829,14 @@
       generated.readUnlinkedUnit(buffer);
 
   /**
+   * MD5 hash of the non-informative fields of the [UnlinkedUnit] (not
+   * including this one) as 16 unsigned 8-bit integer values.  This can be used
+   * to identify when the API of a unit may have changed.
+   */
+  @Id(19)
+  List<int> get apiSignature;
+
+  /**
    * Classes declared in the compilation unit.
    */
   @Id(2)
@@ -2612,6 +2875,7 @@
    * When this field is non-empty, all other fields in the data structure have
    * their default values.
    */
+  @deprecated
   @Id(16)
   String get fallbackModePath;
 
@@ -2622,11 +2886,17 @@
   List<UnlinkedImport> get imports;
 
   /**
+   * Indicates whether the unit contains a "part of" declaration.
+   */
+  @Id(18)
+  bool get isPartOf;
+
+  /**
    * Annotations for the library declaration, or the empty list if there is no
    * library declaration.
    */
   @Id(14)
-  List<UnlinkedConst> get libraryAnnotations;
+  List<UnlinkedExpr> get libraryAnnotations;
 
   /**
    * Documentation comment for the library, or `null` if there is no
@@ -2709,7 +2979,7 @@
    * Annotations for this variable.
    */
   @Id(8)
-  List<UnlinkedConst> get annotations;
+  List<UnlinkedExpr> get annotations;
 
   /**
    * Code range of the variable.
@@ -2797,12 +3067,14 @@
   /**
    * If a local variable, the length of the visible range; zero otherwise.
    */
+  @informative
   @Id(11)
   int get visibleLength;
 
   /**
    * If a local variable, the beginning of the visible range; zero otherwise.
    */
+  @informative
   @Id(12)
   int get visibleOffset;
 }
diff --git a/pkg/analyzer/lib/src/summary/link.dart b/pkg/analyzer/lib/src/summary/link.dart
index 42f2994..ec0806e 100644
--- a/pkg/analyzer/lib/src/summary/link.dart
+++ b/pkg/analyzer/lib/src/summary/link.dart
@@ -1216,14 +1216,19 @@
           // TODO(paulberry): implement other cases as necessary
           throw new UnimplementedError('${element._unlinkedExecutable.kind}');
       }
-      return addRawReference(element.name,
-          numTypeParameters: element.typeParameters.length,
-          containingReference:
-              enclosingClass != null ? addReference(enclosingClass) : null,
-          dependency: enclosingClass != null
-              ? null
-              : library.addDependency(element.library as LibraryElementForLink),
-          kind: kind);
+      if (enclosingClass == null) {
+        return addRawReference(element.name,
+            numTypeParameters: element.typeParameters.length,
+            dependency:
+                library.addDependency(element.library as LibraryElementForLink),
+            unitNum: element.compilationUnit.unitNum,
+            kind: kind);
+      } else {
+        return addRawReference(element.name,
+            numTypeParameters: element.typeParameters.length,
+            containingReference: addReference(enclosingClass),
+            kind: kind);
+      }
     } else if (element is FunctionElementForLink_Initializer) {
       return addRawReference('',
           containingReference: addReference(element.enclosingElement),
@@ -1231,6 +1236,7 @@
     } else if (element is TopLevelVariableElementForLink) {
       return addRawReference(element.name,
           dependency: library.addDependency(element.library),
+          unitNum: element.compilationUnit.unitNum,
           kind: ReferenceKind.topLevelPropertyAccessor);
     } else if (element is FieldElementForLink_ClassField) {
       ClassElementForLink_Class enclosingClass = element.enclosingElement;
@@ -1280,6 +1286,7 @@
    */
   void unlink() {
     _linkedUnit.constCycles.clear();
+    _linkedUnit.parametersInheritingCovariant.clear();
     _linkedUnit.references.length = _unlinkedUnit.references.length;
     _linkedUnit.types.clear();
   }
@@ -1293,6 +1300,14 @@
   }
 
   /**
+   * Store the fact that the given [slot] represents a parameter that inherits
+   * `@covariant` behavior.
+   */
+  void _storeInheritsCovariant(int slot) {
+    _linkedUnit.parametersInheritingCovariant.add(slot);
+  }
+
+  /**
    * Store the given [linkedType] in the given [slot] of the this compilation
    * unit's linked type list.
    */
@@ -1434,7 +1449,7 @@
             constructorElement.enclosingElement.enclosingElement;
         collectDependencies(
             dependencies, constructorInitializer.expression, compilationUnit);
-        for (UnlinkedConst unlinkedConst in constructorInitializer.arguments) {
+        for (UnlinkedExpr unlinkedConst in constructorInitializer.arguments) {
           collectDependencies(dependencies, unlinkedConst, compilationUnit);
         }
       }
@@ -1519,26 +1534,26 @@
    */
   void collectDependencies(
       List<ConstNode> dependencies,
-      UnlinkedConst unlinkedConst,
+      UnlinkedExpr unlinkedConst,
       CompilationUnitElementForLink compilationUnit) {
     if (unlinkedConst == null) {
       return;
     }
     int refPtr = 0;
     int intPtr = 0;
-    for (UnlinkedConstOperation operation in unlinkedConst.operations) {
+    for (UnlinkedExprOperation operation in unlinkedConst.operations) {
       switch (operation) {
-        case UnlinkedConstOperation.pushInt:
+        case UnlinkedExprOperation.pushInt:
           intPtr++;
           break;
-        case UnlinkedConstOperation.pushLongInt:
+        case UnlinkedExprOperation.pushLongInt:
           int numInts = unlinkedConst.ints[intPtr++];
           intPtr += numInts;
           break;
-        case UnlinkedConstOperation.concatenate:
+        case UnlinkedExprOperation.concatenate:
           intPtr++;
           break;
-        case UnlinkedConstOperation.pushReference:
+        case UnlinkedExprOperation.pushReference:
           EntityRef ref = unlinkedConst.references[refPtr++];
           ConstVariableNode variable =
               compilationUnit.resolveRef(ref.reference).asConstVariable;
@@ -1546,14 +1561,14 @@
             dependencies.add(variable);
           }
           break;
-        case UnlinkedConstOperation.makeUntypedList:
-        case UnlinkedConstOperation.makeUntypedMap:
+        case UnlinkedExprOperation.makeUntypedList:
+        case UnlinkedExprOperation.makeUntypedMap:
           intPtr++;
           break;
-        case UnlinkedConstOperation.assignToRef:
+        case UnlinkedExprOperation.assignToRef:
           refPtr++;
           break;
-        case UnlinkedConstOperation.invokeMethodRef:
+        case UnlinkedExprOperation.invokeMethodRef:
           EntityRef ref = unlinkedConst.references[refPtr++];
           ConstVariableNode variable =
               compilationUnit.resolveRef(ref.reference).asConstVariable;
@@ -1564,20 +1579,20 @@
           int numTypeArguments = unlinkedConst.ints[intPtr++];
           refPtr += numTypeArguments;
           break;
-        case UnlinkedConstOperation.invokeMethod:
+        case UnlinkedExprOperation.invokeMethod:
           intPtr += 2;
           int numTypeArguments = unlinkedConst.ints[intPtr++];
           refPtr += numTypeArguments;
           break;
-        case UnlinkedConstOperation.makeTypedList:
+        case UnlinkedExprOperation.makeTypedList:
           refPtr++;
           intPtr++;
           break;
-        case UnlinkedConstOperation.makeTypedMap:
+        case UnlinkedExprOperation.makeTypedMap:
           refPtr += 2;
           intPtr++;
           break;
-        case UnlinkedConstOperation.invokeConstructor:
+        case UnlinkedExprOperation.invokeConstructor:
           EntityRef ref = unlinkedConst.references[refPtr++];
           ConstructorElementForLink element =
               compilationUnit.resolveRef(ref.reference).asConstructor;
@@ -1586,11 +1601,11 @@
           }
           intPtr += 2;
           break;
-        case UnlinkedConstOperation.typeCast:
-        case UnlinkedConstOperation.typeCheck:
+        case UnlinkedExprOperation.typeCast:
+        case UnlinkedExprOperation.typeCheck:
           refPtr++;
           break;
-        case UnlinkedConstOperation.pushLocalFunctionReference:
+        case UnlinkedExprOperation.pushLocalFunctionReference:
           intPtr += 2;
           break;
         default:
@@ -2057,7 +2072,7 @@
   final LibraryElementForLink library;
   final Linker linker;
   final TypeProvider typeProvider;
-  final UnlinkedConst unlinkedConst;
+  final UnlinkedExpr unlinkedConst;
 
   final List<DartType> stack = <DartType>[];
   int intPtr = 0;
@@ -2070,7 +2085,7 @@
     LibraryElementForLink library = unit.enclosingElement;
     Linker linker = library._linker;
     TypeProvider typeProvider = linker.typeProvider;
-    UnlinkedConst unlinkedConst = functionElement._unlinkedExecutable.bodyExpr;
+    UnlinkedExpr unlinkedConst = functionElement._unlinkedExecutable.bodyExpr;
     return new ExprTypeComputer._(
         functionElement, unit, library, linker, typeProvider, unlinkedConst);
   }
@@ -2085,171 +2100,177 @@
       return DynamicTypeImpl.instance;
     }
     // Perform RPN evaluation of the constant, using a stack of inferred types.
-    for (UnlinkedConstOperation operation in unlinkedConst.operations) {
+    for (UnlinkedExprOperation operation in unlinkedConst.operations) {
       switch (operation) {
-        case UnlinkedConstOperation.pushInt:
+        case UnlinkedExprOperation.pushInt:
           intPtr++;
           stack.add(typeProvider.intType);
           break;
-        case UnlinkedConstOperation.pushLongInt:
+        case UnlinkedExprOperation.pushLongInt:
           int numInts = _getNextInt();
           intPtr += numInts;
           stack.add(typeProvider.intType);
           break;
-        case UnlinkedConstOperation.pushDouble:
+        case UnlinkedExprOperation.pushDouble:
           stack.add(typeProvider.doubleType);
           break;
-        case UnlinkedConstOperation.pushTrue:
-        case UnlinkedConstOperation.pushFalse:
+        case UnlinkedExprOperation.pushTrue:
+        case UnlinkedExprOperation.pushFalse:
           stack.add(typeProvider.boolType);
           break;
-        case UnlinkedConstOperation.pushString:
+        case UnlinkedExprOperation.pushString:
           strPtr++;
           stack.add(typeProvider.stringType);
           break;
-        case UnlinkedConstOperation.concatenate:
+        case UnlinkedExprOperation.concatenate:
           stack.length -= _getNextInt();
           stack.add(typeProvider.stringType);
           break;
-        case UnlinkedConstOperation.makeSymbol:
+        case UnlinkedExprOperation.makeSymbol:
           strPtr++;
           stack.add(typeProvider.symbolType);
           break;
-        case UnlinkedConstOperation.pushNull:
+        case UnlinkedExprOperation.pushNull:
           stack.add(BottomTypeImpl.instance);
           break;
-        case UnlinkedConstOperation.pushReference:
+        case UnlinkedExprOperation.pushReference:
           _doPushReference();
           break;
-        case UnlinkedConstOperation.extractProperty:
+        case UnlinkedExprOperation.extractProperty:
           _doExtractProperty();
           break;
-        case UnlinkedConstOperation.invokeConstructor:
+        case UnlinkedExprOperation.invokeConstructor:
           _doInvokeConstructor();
           break;
-        case UnlinkedConstOperation.makeUntypedList:
+        case UnlinkedExprOperation.makeUntypedList:
           _doMakeUntypedList();
           break;
-        case UnlinkedConstOperation.makeUntypedMap:
+        case UnlinkedExprOperation.makeUntypedMap:
           _doMakeUntypedMap();
           break;
-        case UnlinkedConstOperation.makeTypedList:
+        case UnlinkedExprOperation.makeTypedList:
           _doMakeTypedList();
           break;
-        case UnlinkedConstOperation.makeTypedMap:
+        case UnlinkedExprOperation.makeTypedMap:
           _doMakeTypeMap();
           break;
-        case UnlinkedConstOperation.not:
+        case UnlinkedExprOperation.not:
           stack.length -= 1;
           stack.add(typeProvider.boolType);
           break;
-        case UnlinkedConstOperation.complement:
+        case UnlinkedExprOperation.complement:
           _computePrefixExpressionType('~');
           break;
-        case UnlinkedConstOperation.negate:
+        case UnlinkedExprOperation.negate:
           _computePrefixExpressionType('unary-');
           break;
-        case UnlinkedConstOperation.and:
-        case UnlinkedConstOperation.or:
-        case UnlinkedConstOperation.equal:
-        case UnlinkedConstOperation.notEqual:
+        case UnlinkedExprOperation.and:
+        case UnlinkedExprOperation.or:
+        case UnlinkedExprOperation.equal:
+        case UnlinkedExprOperation.notEqual:
           stack.length -= 2;
           stack.add(typeProvider.boolType);
           break;
-        case UnlinkedConstOperation.bitXor:
+        case UnlinkedExprOperation.bitXor:
           _computeBinaryExpressionType(TokenType.CARET);
           break;
-        case UnlinkedConstOperation.bitAnd:
+        case UnlinkedExprOperation.bitAnd:
           _computeBinaryExpressionType(TokenType.AMPERSAND);
           break;
-        case UnlinkedConstOperation.bitOr:
+        case UnlinkedExprOperation.bitOr:
           _computeBinaryExpressionType(TokenType.BAR);
           break;
-        case UnlinkedConstOperation.bitShiftRight:
+        case UnlinkedExprOperation.bitShiftRight:
           _computeBinaryExpressionType(TokenType.GT_GT);
           break;
-        case UnlinkedConstOperation.bitShiftLeft:
+        case UnlinkedExprOperation.bitShiftLeft:
           _computeBinaryExpressionType(TokenType.LT_LT);
           break;
-        case UnlinkedConstOperation.add:
+        case UnlinkedExprOperation.add:
           _computeBinaryExpressionType(TokenType.PLUS);
           break;
-        case UnlinkedConstOperation.subtract:
+        case UnlinkedExprOperation.subtract:
           _computeBinaryExpressionType(TokenType.MINUS);
           break;
-        case UnlinkedConstOperation.multiply:
+        case UnlinkedExprOperation.multiply:
           _computeBinaryExpressionType(TokenType.STAR);
           break;
-        case UnlinkedConstOperation.divide:
+        case UnlinkedExprOperation.divide:
           _computeBinaryExpressionType(TokenType.SLASH);
           break;
-        case UnlinkedConstOperation.floorDivide:
+        case UnlinkedExprOperation.floorDivide:
           _computeBinaryExpressionType(TokenType.TILDE_SLASH);
           break;
-        case UnlinkedConstOperation.greater:
+        case UnlinkedExprOperation.greater:
           _computeBinaryExpressionType(TokenType.GT);
           break;
-        case UnlinkedConstOperation.less:
+        case UnlinkedExprOperation.less:
           _computeBinaryExpressionType(TokenType.LT);
           break;
-        case UnlinkedConstOperation.greaterEqual:
+        case UnlinkedExprOperation.greaterEqual:
           _computeBinaryExpressionType(TokenType.GT_EQ);
           break;
-        case UnlinkedConstOperation.lessEqual:
+        case UnlinkedExprOperation.lessEqual:
           _computeBinaryExpressionType(TokenType.LT_EQ);
           break;
-        case UnlinkedConstOperation.modulo:
+        case UnlinkedExprOperation.modulo:
           _computeBinaryExpressionType(TokenType.PERCENT);
           break;
-        case UnlinkedConstOperation.conditional:
+        case UnlinkedExprOperation.conditional:
           _doConditional();
           break;
-        case UnlinkedConstOperation.assignToRef:
+        case UnlinkedExprOperation.assignToRef:
           _doAssignToRef();
           break;
-        case UnlinkedConstOperation.assignToProperty:
+        case UnlinkedExprOperation.assignToProperty:
           _doAssignToProperty();
           break;
-        case UnlinkedConstOperation.assignToIndex:
+        case UnlinkedExprOperation.assignToIndex:
           _doAssignToIndex();
           break;
-        case UnlinkedConstOperation.extractIndex:
+        case UnlinkedExprOperation.await:
+          _doAwait();
+          break;
+        case UnlinkedExprOperation.extractIndex:
           _doExtractIndex();
           break;
-        case UnlinkedConstOperation.invokeMethodRef:
+        case UnlinkedExprOperation.invokeMethodRef:
           _doInvokeMethodRef();
           break;
-        case UnlinkedConstOperation.invokeMethod:
+        case UnlinkedExprOperation.invokeMethod:
           _doInvokeMethod();
           break;
-        case UnlinkedConstOperation.cascadeSectionBegin:
+        case UnlinkedExprOperation.cascadeSectionBegin:
           stack.add(stack.last);
           break;
-        case UnlinkedConstOperation.cascadeSectionEnd:
+        case UnlinkedExprOperation.cascadeSectionEnd:
           stack.removeLast();
           break;
-        case UnlinkedConstOperation.typeCast:
+        case UnlinkedExprOperation.typeCast:
           stack.removeLast();
           DartType type = _getNextTypeRef();
           stack.add(type);
           break;
-        case UnlinkedConstOperation.typeCheck:
+        case UnlinkedExprOperation.typeCheck:
           stack.removeLast();
           refPtr++;
           stack.add(typeProvider.boolType);
           break;
-        case UnlinkedConstOperation.throwException:
+        case UnlinkedExprOperation.throwException:
           stack.removeLast();
           stack.add(BottomTypeImpl.instance);
           break;
-        case UnlinkedConstOperation.pushLocalFunctionReference:
+        case UnlinkedExprOperation.pushLocalFunctionReference:
           int popCount = _getNextInt();
           assert(popCount == 0); // TODO(paulberry): handle the nonzero case.
           stack.add(function.functions[_getNextInt()].type);
           break;
-        case UnlinkedConstOperation.pushParameter:
+        case UnlinkedExprOperation.pushParameter:
           stack.add(_findParameterType(_getNextString()));
           break;
+        case UnlinkedExprOperation.ifNull:
+          _doIfNull();
+          break;
         default:
           // TODO(paulberry): implement.
           throw new UnimplementedError('$operation');
@@ -2345,6 +2366,13 @@
     }
   }
 
+  void _doAwait() {
+    DartType type = stack.removeLast();
+    DartType typeArgument = type?.flattenFutures(linker.typeSystem);
+    typeArgument = _dynamicIfNull(typeArgument);
+    stack.add(typeArgument);
+  }
+
   void _doConditional() {
     DartType elseType = stack.removeLast();
     DartType thenType = stack.removeLast();
@@ -2389,6 +2417,14 @@
     }());
   }
 
+  void _doIfNull() {
+    DartType secondType = stack.removeLast();
+    DartType firstType = stack.removeLast();
+    DartType type = _leastUpperBound(firstType, secondType);
+    type = _dynamicIfNull(type);
+    stack.add(type);
+  }
+
   void _doInvokeConstructor() {
     int numNamed = _getNextInt();
     int numPositional = _getNextInt();
@@ -2947,6 +2983,9 @@
           .toList();
 
   @override
+  String get identifier => '';
+
+  @override
   DartType get returnType {
     // If this is a variable whose type needs inferring, infer it.
     if (_variable.hasImplicitType) {
@@ -3070,6 +3109,18 @@
           .toList();
 
   @override
+  String get identifier {
+    String identifier = _unlinkedExecutable.name;
+    Element enclosing = this.enclosingElement;
+    if (enclosing is ExecutableElement) {
+      int id =
+          ElementImpl.findElementIndexUsingIdentical(enclosing.functions, this);
+      identifier += "@$id";
+    }
+    return identifier;
+  }
+
+  @override
   bool get _hasTypeBeenInferred => _inferredReturnType != null;
 
   @override
@@ -3089,8 +3140,10 @@
    * Store the results of type inference for this function in [compilationUnit].
    */
   void link(CompilationUnitElementInBuildUnit compilationUnit) {
-    compilationUnit._storeLinkedType(
-        _unlinkedExecutable.inferredReturnTypeSlot, inferredReturnType, this);
+    if (_unlinkedExecutable.returnType == null) {
+      compilationUnit._storeLinkedType(
+          _unlinkedExecutable.inferredReturnTypeSlot, inferredReturnType, this);
+    }
     for (FunctionElementForLink_Local_NonSynthetic function in functions) {
       function.link(compilationUnit);
     }
@@ -3370,10 +3423,10 @@
       _linkedLibrary.importDependencies.map(_getDependency).toList();
 
   @override
-  bool get isDartAsync => _absoluteUri == 'dart:async';
+  bool get isDartAsync => _absoluteUri.toString() == 'dart:async';
 
   @override
-  bool get isDartCore => _absoluteUri == 'dart:core';
+  bool get isDartCore => _absoluteUri.toString() == 'dart:core';
 
   /**
    * If this library is part of the build unit being linked, return the library
@@ -3382,6 +3435,11 @@
   LibraryCycleForLink get libraryCycleForLink;
 
   @override
+  String get name {
+    return _definingUnlinkedUnit.libraryName;
+  }
+
+  @override
   List<UnitElement> get units {
     if (_units == null) {
       UnlinkedUnit definingUnit = definingUnlinkedUnit;
@@ -3481,7 +3539,7 @@
    * Get the inheritance manager for this library (creating it if necessary).
    */
   InheritanceManager get inheritanceManager =>
-      _inheritanceManager ??= new InheritanceManager(this);
+      _inheritanceManager ??= new InheritanceManager(this, ignoreErrors: true);
 
   @override
   LibraryCycleForLink get libraryCycleForLink {
@@ -3503,9 +3561,15 @@
       }
     }
     int result = _linkedLibrary.dependencies.length;
+    Uri libraryUri = library._absoluteUri;
+    List<String> partsRelativeToDependency =
+        library.definingUnlinkedUnit.publicNamespace.parts;
+    List<String> partsRelativeToLibraryBeingLinked = partsRelativeToDependency
+        .map((partUri) =>
+            resolveRelativeUri(libraryUri, Uri.parse(partUri)).toString())
+        .toList();
     _linkedLibrary.dependencies.add(new LinkedDependencyBuilder(
-        parts: library.definingUnlinkedUnit.publicNamespace.parts,
-        uri: library._absoluteUri.toString()));
+        parts: partsRelativeToLibraryBeingLinked, uri: libraryUri.toString()));
     _dependencies.add(library);
     return result;
   }
@@ -3937,9 +4001,7 @@
 
   DartType _inferredType;
   DartType _declaredType;
-
-  @override
-  bool inheritsCovariant = false;
+  bool _inheritsCovariant = false;
 
   ParameterElementForLink(this.enclosingElement, this._unlinkedParam,
       this._typeParameterContext, this.compilationUnit, this._parameterIndex) {
@@ -3956,7 +4018,32 @@
       !_unlinkedParam.isFunctionTyped && _unlinkedParam.type == null;
 
   @override
-  bool get isCovariant => false;
+  bool get inheritsCovariant => _inheritsCovariant;
+
+  @override
+  void set inheritsCovariant(bool value) {
+    _inheritsCovariant = value;
+  }
+
+  @override
+  bool get isCovariant {
+    if (inheritsCovariant) {
+      return true;
+    }
+    for (UnlinkedExpr annotation in _unlinkedParam.annotations) {
+      if (annotation.operations.length == 1 &&
+          annotation.operations[0] == UnlinkedExprOperation.pushReference) {
+        ReferenceableElementForLink element =
+            this.compilationUnit.resolveRef(annotation.references[0].reference);
+        if (element is PropertyAccessorElementForLink &&
+            element.name == 'checked' &&
+            element.library.name == 'meta') {
+          return true;
+        }
+      }
+    }
+    return false;
+  }
 
   @override
   String get name => _unlinkedParam.name;
@@ -4012,6 +4099,10 @@
   void link(CompilationUnitElementInBuildUnit compilationUnit) {
     compilationUnit._storeLinkedType(
         _unlinkedParam.inferredTypeSlot, _inferredType, _typeParameterContext);
+    if (inheritsCovariant) {
+      compilationUnit
+          ._storeInheritsCovariant(_unlinkedParam.inheritsCovariantSlot);
+    }
   }
 
   @override
@@ -4276,6 +4367,9 @@
   TypeInferenceNode get asTypeInferenceNode => variable._typeInferenceNode;
 
   @override
+  String get displayName => variable.displayName;
+
+  @override
   Element get enclosingElement => variable.enclosingElement;
 
   @override
@@ -4614,26 +4708,26 @@
       List<TypeInferenceNode> dependencies,
       UnlinkedExecutable unlinkedExecutable,
       CompilationUnitElementForLink compilationUnit) {
-    UnlinkedConst unlinkedConst = unlinkedExecutable?.bodyExpr;
+    UnlinkedExpr unlinkedConst = unlinkedExecutable?.bodyExpr;
     if (unlinkedConst == null) {
       return;
     }
     int refPtr = 0;
     int intPtr = 0;
 
-    for (UnlinkedConstOperation operation in unlinkedConst.operations) {
+    for (UnlinkedExprOperation operation in unlinkedConst.operations) {
       switch (operation) {
-        case UnlinkedConstOperation.pushInt:
+        case UnlinkedExprOperation.pushInt:
           intPtr++;
           break;
-        case UnlinkedConstOperation.pushLongInt:
+        case UnlinkedExprOperation.pushLongInt:
           int numInts = unlinkedConst.ints[intPtr++];
           intPtr += numInts;
           break;
-        case UnlinkedConstOperation.concatenate:
+        case UnlinkedExprOperation.concatenate:
           intPtr++;
           break;
-        case UnlinkedConstOperation.pushReference:
+        case UnlinkedExprOperation.pushReference:
           EntityRef ref = unlinkedConst.references[refPtr++];
           // TODO(paulberry): cache these resolved references for
           // later use by evaluate().
@@ -4643,28 +4737,28 @@
             dependencies.add(dependency);
           }
           break;
-        case UnlinkedConstOperation.invokeConstructor:
+        case UnlinkedExprOperation.invokeConstructor:
           refPtr++;
           intPtr += 2;
           break;
-        case UnlinkedConstOperation.makeUntypedList:
-        case UnlinkedConstOperation.makeUntypedMap:
+        case UnlinkedExprOperation.makeUntypedList:
+        case UnlinkedExprOperation.makeUntypedMap:
           intPtr++;
           break;
-        case UnlinkedConstOperation.makeTypedList:
+        case UnlinkedExprOperation.makeTypedList:
           refPtr++;
           intPtr++;
           break;
-        case UnlinkedConstOperation.makeTypedMap:
+        case UnlinkedExprOperation.makeTypedMap:
           refPtr += 2;
           intPtr++;
           break;
-        case UnlinkedConstOperation.assignToRef:
+        case UnlinkedExprOperation.assignToRef:
           // TODO(paulberry): if this reference refers to a variable, should it
           // be considered a type inference dependency?
           refPtr++;
           break;
-        case UnlinkedConstOperation.invokeMethodRef:
+        case UnlinkedExprOperation.invokeMethodRef:
           // TODO(paulberry): if this reference refers to a variable, should it
           // be considered a type inference dependency?
           refPtr++;
@@ -4672,16 +4766,16 @@
           int numTypeArguments = unlinkedConst.ints[intPtr++];
           refPtr += numTypeArguments;
           break;
-        case UnlinkedConstOperation.invokeMethod:
+        case UnlinkedExprOperation.invokeMethod:
           intPtr += 2;
           int numTypeArguments = unlinkedConst.ints[intPtr++];
           refPtr += numTypeArguments;
           break;
-        case UnlinkedConstOperation.typeCast:
-        case UnlinkedConstOperation.typeCheck:
+        case UnlinkedExprOperation.typeCast:
+        case UnlinkedExprOperation.typeCheck:
           refPtr++;
           break;
-        case UnlinkedConstOperation.pushLocalFunctionReference:
+        case UnlinkedExprOperation.pushLocalFunctionReference:
           int popCount = unlinkedConst.ints[intPtr++];
           assert(popCount == 0); // TODO(paulberry): handle the nonzero case.
           dependencies.add(functionElement
@@ -4926,12 +5020,18 @@
   }
 
   @override
+  String get displayName => unlinkedVariable.name;
+
+  @override
   PropertyAccessorElementForLink_Variable get getter =>
       _getter ??= new PropertyAccessorElementForLink_Variable(this, false);
 
   @override
   bool get hasImplicitType => unlinkedVariable.type == null;
 
+  @override
+  String get identifier => unlinkedVariable.name;
+
   /**
    * Return the inferred type of the variable element.  Should only be called if
    * no type was explicitly declared.
diff --git a/pkg/analyzer/lib/src/summary/package_bundle_reader.dart b/pkg/analyzer/lib/src/summary/package_bundle_reader.dart
index c60f8ba..d178797 100644
--- a/pkg/analyzer/lib/src/summary/package_bundle_reader.dart
+++ b/pkg/analyzer/lib/src/summary/package_bundle_reader.dart
@@ -6,12 +6,10 @@
 import 'package:analyzer/src/context/context.dart';
 import 'package:analyzer/src/dart/element/element.dart';
 import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/java_io.dart';
 import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/source_io.dart';
 import 'package:analyzer/src/generated/utilities_dart.dart';
-import 'package:analyzer/src/source/source_resource.dart';
 import 'package:analyzer/src/summary/format.dart';
 import 'package:analyzer/src/summary/idl.dart';
 import 'package:analyzer/src/summary/resynthesize.dart';
@@ -57,12 +55,7 @@
     UnlinkedUnit unit = _dataStore.unlinkedMap[uriString];
     if (unit != null) {
       String summaryPath = _dataStore.uriToSummaryPath[uriString];
-      if (unit.fallbackModePath.isNotEmpty) {
-        return new _InSummaryFallbackSource(
-            new JavaFile(unit.fallbackModePath), actualUri, summaryPath);
-      } else {
-        return new InSummarySource(actualUri, summaryPath);
-      }
+      return new InSummarySource(actualUri, summaryPath);
     }
     return null;
   }
@@ -134,14 +127,7 @@
     UnlinkedUnit unit = _dataStore.unlinkedMap[uriString];
     if (unit != null) {
       String summaryPath = _dataStore.uriToSummaryPath[uriString];
-      if (unit.fallbackModePath.isNotEmpty) {
-        return new _InSummaryFallbackFileSource(
-            resourceProvider.getFile(unit.fallbackModePath),
-            actualUri,
-            summaryPath);
-      } else {
-        return new InSummarySource(actualUri, summaryPath);
-      }
+      return new InSummarySource(actualUri, summaryPath);
     }
     return null;
   }
@@ -174,6 +160,23 @@
       return true;
     }
     AnalysisTarget target = entry.target;
+
+    // LINE_INFO can be provided using just the UnlinkedUnit.
+    if (target is Source && result == LINE_INFO) {
+      String uriString = target.uri.toString();
+      UnlinkedUnit unlinkedUnit = _dataStore.unlinkedMap[uriString];
+      if (unlinkedUnit != null) {
+        List<int> lineStarts = unlinkedUnit.lineStarts;
+        if (lineStarts.isNotEmpty) {
+          LineInfo lineInfo = new LineInfo(lineStarts);
+          entry.setValue(result as ResultDescriptor<LineInfo>, lineInfo,
+              TargetedResult.EMPTY_LIST);
+          return true;
+        }
+      }
+      return false;
+    }
+
     // Check whether there are results for the source.
     if (!hasResultsForSource(target.librarySource ?? target.source)) {
       return false;
@@ -239,16 +242,6 @@
           return true;
         }
         return false;
-      } else if (result == LINE_INFO) {
-        UnlinkedUnit unlinkedUnit = _dataStore.unlinkedMap[uriString];
-        List<int> lineStarts = unlinkedUnit.lineStarts;
-        if (lineStarts.isNotEmpty) {
-          LineInfo lineInfo = new LineInfo(lineStarts);
-          entry.setValue(result as ResultDescriptor<LineInfo>, lineInfo,
-              TargetedResult.EMPTY_LIST);
-          return true;
-        }
-        return false;
       }
     } else if (target is LibrarySpecificUnit) {
       if (result == CREATED_RESOLVED_UNIT1 ||
@@ -465,35 +458,6 @@
   @override
   bool hasLibrarySummary(String uri) {
     LinkedLibrary linkedLibrary = _dataStore.linkedMap[uri];
-    return linkedLibrary != null && !linkedLibrary.fallbackMode;
+    return linkedLibrary != null;
   }
 }
-
-/**
- * A source that is part of a package whose summary was generated in fallback
- * mode. This source behaves identically to a [FileSource] except that it also
- * provides [summaryPath].
- */
-class _InSummaryFallbackFileSource extends FileSource
-    implements InSummarySource {
-  @override
-  final String summaryPath;
-
-  _InSummaryFallbackFileSource(File file, Uri uri, this.summaryPath)
-      : super(file, uri);
-}
-
-/**
- * A source that is part of a package whose summary was generated in fallback
- * mode. This source behaves identically to a [FileBasedSource] except that it
- * also provides [summaryPath].
- */
-@deprecated
-class _InSummaryFallbackSource extends FileBasedSource
-    implements InSummarySource {
-  @override
-  final String summaryPath;
-
-  _InSummaryFallbackSource(JavaFile file, Uri uri, this.summaryPath)
-      : super(file, uri);
-}
diff --git a/pkg/analyzer/lib/src/summary/pub_summary.dart b/pkg/analyzer/lib/src/summary/pub_summary.dart
index 0113564..171c2ff 100644
--- a/pkg/analyzer/lib/src/summary/pub_summary.dart
+++ b/pkg/analyzer/lib/src/summary/pub_summary.dart
@@ -33,12 +33,6 @@
 import 'package:path/path.dart' as pathos;
 
 /**
- * Return the raw string value of the variable with the given [name],
- * or `null` of the variable is not defined.
- */
-typedef String _GetDeclaredVariable(String name);
-
-/**
  * Unlinked and linked information about a [PubPackage].
  */
 class LinkedPubPackage {
@@ -180,94 +174,7 @@
    * referencing the same packages.
    */
   List<LinkedPubPackage> getLinkedBundles(AnalysisContext context) {
-//    Stopwatch timer = new Stopwatch()..start();
-
-    _GetDeclaredVariable getDeclaredVariable = context.declaredVariables.get;
-    SourceFactory sourceFactory = context.sourceFactory;
-    _ListedPackages listedPackages = new _ListedPackages(sourceFactory);
-
-    PackageBundle sdkBundle = sourceFactory.dartSdk.getLinkedBundle();
-    if (sdkBundle == null) {
-      return const <LinkedPubPackage>[];
-    }
-
-    bool strong = context.analysisOptions.strongMode;
-    Map<PubPackage, PackageBundle> unlinkedBundles =
-        getUnlinkedBundles(context);
-
-    // TODO(scheglov) remove debug output after optimizing
-//    print('LOADED ${unlinkedBundles.length} unlinked bundles'
-//        ' in ${timer.elapsedMilliseconds} ms');
-//    timer..reset();
-
-    // If no unlinked bundles, there is nothing we can try to link.
-    if (unlinkedBundles.isEmpty) {
-      return const <LinkedPubPackage>[];
-    }
-
-    // Create graph nodes for packages.
-    List<_LinkNode> nodes = <_LinkNode>[];
-    Map<String, _LinkNode> packageToNode = <String, _LinkNode>{};
-    unlinkedBundles.forEach((package, unlinked) {
-      _LinkNode node = new _LinkNode(sdkBundle, getDeclaredVariable,
-          listedPackages, package, unlinked, packageToNode);
-      nodes.add(node);
-      packageToNode[package.name] = node;
-    });
-
-    // Compute transitive dependencies, mark some nodes as failed.
-    for (_LinkNode node in nodes) {
-      node.computeTransitiveDependencies();
-    }
-
-    // Attempt to read existing linked bundles.
-    for (_LinkNode node in nodes) {
-      _readLinked(node, strong);
-    }
-
-    // Link new bundles, if allowed.
-    if (allowLinking) {
-      // Fill the store with bundles.
-      // Append the linked SDK bundle.
-      // Append unlinked and (if read from a cache) linked package bundles.
-      SummaryDataStore store = new SummaryDataStore(const <String>[]);
-      store.addBundle(null, sdkBundle);
-      for (_LinkNode node in nodes) {
-        store.addBundle(null, node.unlinked);
-        if (node.linked != null) {
-          store.addBundle(null, node.linked);
-        }
-      }
-
-      // Link each package node.
-      for (_LinkNode node in nodes) {
-        if (!node.isEvaluated) {
-          new _LinkWalker(getDeclaredVariable, listedPackages, store, strong)
-              .walk(node);
-        }
-      }
-
-      // Write newly linked bundles.
-      for (_LinkNode node in nodes) {
-        _writeLinked(node, strong);
-      }
-    }
-
-    // Create successfully linked packages.
-    List<LinkedPubPackage> linkedPackages = <LinkedPubPackage>[];
-    for (_LinkNode node in nodes) {
-      if (node.linked != null) {
-        linkedPackages.add(new LinkedPubPackage(
-            node.package, node.unlinked, node.linked, node.linkedHash));
-      }
-    }
-
-    // TODO(scheglov) remove debug output after optimizing
-//    print('LINKED ${linkedPackages.length} bundles'
-//        ' in ${timer.elapsedMilliseconds} ms');
-
-    // Done.
-    return linkedPackages;
+    return new _ContextLinker(this, context).getLinkedBundles();
   }
 
   /**
@@ -381,17 +288,6 @@
   }
 
   /**
-   * Return the name of the file for a linked bundle, in strong or spec mode.
-   */
-  String _getLinkedName(String hash, bool strong) {
-    if (strong) {
-      return 'linked_$hash.ds';
-    } else {
-      return 'linked_spec_$hash.ds';
-    }
-  }
-
-  /**
    * Return the name of the file for an unlinked bundle, in strong or spec mode.
    */
   String _getUnlinkedName(bool strong) {
@@ -511,35 +407,6 @@
   }
 
   /**
-   * Attempt to find the linked bundle that corresponds to the given [node]
-   * with all its transitive dependencies and put it into [_LinkNode.linked].
-   */
-  void _readLinked(_LinkNode node, bool strong) {
-    String hash = node.linkedHash;
-    if (hash != null) {
-      String fileName = _getLinkedName(hash, strong);
-      File file = node.package.folder.getChildAssumingFile(fileName);
-      // Try to find in the cache.
-      PackageBundle linked = linkedBundleMap[file.path];
-      if (linked != null) {
-        node.linked = linked;
-        return;
-      }
-      // Try to read from the file system.
-      if (file.exists) {
-        try {
-          List<int> bytes = file.readAsBytesSync();
-          linked = new PackageBundle.fromBuffer(bytes);
-          linkedBundleMap[file.path] = linked;
-          node.linked = linked;
-        } on FileSystemException {
-          // Ignore file system exceptions.
-        }
-      }
-    }
-  }
-
-  /**
    * Schedule delayed computation of the next package unlinked bundle from the
    * set of [packagesToComputeUnlinked].  We delay each computation because we
    * want operations in analysis server to proceed, and computing bundles of
@@ -570,20 +437,6 @@
   }
 
   /**
-   * If a new linked bundle was linked for the given [node], write the bundle
-   * into the memory cache and the file system.
-   */
-  void _writeLinked(_LinkNode node, bool strong) {
-    String hash = node.linkedHash;
-    if (hash != null && node.linkedNewBytes != null) {
-      String fileName = _getLinkedName(hash, strong);
-      File file = node.package.folder.getChildAssumingFile(fileName);
-      linkedBundleMap[file.path] = node.linked;
-      _writeAtomic(node.package.folder, fileName, node.linkedNewBytes);
-    }
-  }
-
-  /**
    * If the given [uri] has the `package` scheme, return the name of the
    * package that contains the referenced resource.  Otherwise return `null`.
    *
@@ -617,33 +470,270 @@
   }
 }
 
-/**
- * Specialization of [Node] for linking packages in proper dependency order.
- */
-class _LinkNode extends Node<_LinkNode> {
-  final PackageBundle sdkBundle;
-  final _GetDeclaredVariable getDeclaredVariable;
+class _ContextLinker {
+  final PubSummaryManager manager;
+  final AnalysisContext context;
+
+  final strong;
   final _ListedPackages listedPackages;
+  final PackageBundle sdkBundle;
+
+  final List<_LinkNode> nodes = <_LinkNode>[];
+  final Map<String, _LinkNode> packageToNode = <String, _LinkNode>{};
+
+  _ContextLinker(this.manager, AnalysisContext context)
+      : context = context,
+        strong = context.analysisOptions.strongMode,
+        listedPackages = new _ListedPackages(context.sourceFactory),
+        sdkBundle = context.sourceFactory.dartSdk.getLinkedBundle();
+
+  /**
+   * Return the list of linked [LinkedPubPackage]s that can be provided at this
+   * time for a subset of the packages used by the [context].
+   */
+  List<LinkedPubPackage> getLinkedBundles() {
+//    Stopwatch timer = new Stopwatch()..start();
+
+    if (sdkBundle == null) {
+      return const <LinkedPubPackage>[];
+    }
+
+    Map<PubPackage, PackageBundle> unlinkedBundles =
+        manager.getUnlinkedBundles(context);
+
+    // TODO(scheglov) remove debug output after optimizing
+//    print('LOADED ${unlinkedBundles.length} unlinked bundles'
+//        ' in ${timer.elapsedMilliseconds} ms');
+//    timer..reset();
+
+    // If no unlinked bundles, there is nothing we can try to link.
+    if (unlinkedBundles.isEmpty) {
+      return const <LinkedPubPackage>[];
+    }
+
+    // Create nodes for packages.
+    unlinkedBundles.forEach((package, unlinked) {
+      _LinkNode node = new _LinkNode(this, package, unlinked);
+      nodes.add(node);
+      packageToNode[package.name] = node;
+    });
+
+    // Compute transitive dependencies, mark some nodes as failed.
+    for (_LinkNode node in nodes) {
+      node.computeTransitiveDependencies();
+    }
+
+    // Attempt to read existing linked bundles.
+    for (_LinkNode node in nodes) {
+      _readLinked(node);
+    }
+
+    // Link new packages, if allowed.
+    if (manager.allowLinking) {
+      _link();
+    }
+
+    // Create successfully linked packages.
+    List<LinkedPubPackage> linkedPackages = <LinkedPubPackage>[];
+    for (_LinkNode node in nodes) {
+      if (node.linked != null) {
+        linkedPackages.add(new LinkedPubPackage(
+            node.package, node.unlinked, node.linked, node.linkedHash));
+      }
+    }
+
+    // TODO(scheglov) remove debug output after optimizing
+//    print('LINKED ${linkedPackages.length} bundles'
+//        ' in ${timer.elapsedMilliseconds} ms');
+
+    // Done.
+    return linkedPackages;
+  }
+
+  String _getDeclaredVariable(String name) {
+    return context.declaredVariables.get(name);
+  }
+
+  /**
+   * Return the name of the file for a linked bundle, in strong or spec mode.
+   */
+  String _getLinkedName(String hash) {
+    if (strong) {
+      return 'linked_$hash.ds';
+    } else {
+      return 'linked_spec_$hash.ds';
+    }
+  }
+
+  void _link() {
+    // Fill the store with bundles.
+    // Append the linked SDK bundle.
+    // Append unlinked and (if read from a cache) linked package bundles.
+    SummaryDataStore store = new SummaryDataStore(const <String>[]);
+    store.addBundle(null, sdkBundle);
+    for (_LinkNode node in nodes) {
+      store.addBundle(null, node.unlinked);
+      if (node.linked != null) {
+        store.addBundle(null, node.linked);
+      }
+    }
+
+    // Prepare URIs to link.
+    Map<String, _LinkNode> uriToNode = <String, _LinkNode>{};
+    for (_LinkNode node in nodes) {
+      if (!node.isReady) {
+        for (String uri in node.unlinked.unlinkedUnitUris) {
+          uriToNode[uri] = node;
+        }
+      }
+    }
+    Set<String> libraryUris = uriToNode.keys.toSet();
+
+    // Perform linking.
+    Map<String, LinkedLibraryBuilder> linkedLibraries =
+        link(libraryUris, (String uri) {
+      return store.linkedMap[uri];
+    }, (String uri) {
+      return store.unlinkedMap[uri];
+    }, _getDeclaredVariable, strong);
+
+    // Assemble newly linked bundles.
+    for (_LinkNode node in nodes) {
+      if (!node.isReady) {
+        PackageBundleAssembler assembler = new PackageBundleAssembler();
+        linkedLibraries.forEach((uri, linkedLibrary) {
+          if (identical(uriToNode[uri], node)) {
+            assembler.addLinkedLibrary(uri, linkedLibrary);
+          }
+        });
+        List<int> bytes = assembler.assemble().toBuffer();
+        node.linkedNewBytes = bytes;
+        node.linked = new PackageBundle.fromBuffer(bytes);
+      }
+    }
+
+    // Write newly linked bundles.
+    for (_LinkNode node in nodes) {
+      _writeLinked(node);
+    }
+  }
+
+  /**
+   * Attempt to find the linked bundle that corresponds to the given [node]
+   * with all its transitive dependencies and put it into [_LinkNode.linked].
+   */
+  void _readLinked(_LinkNode node) {
+    String hash = node.linkedHash;
+    if (hash != null) {
+      String fileName = _getLinkedName(hash);
+      File file = node.package.folder.getChildAssumingFile(fileName);
+      // Try to find in the cache.
+      PackageBundle linked = manager.linkedBundleMap[file.path];
+      if (linked != null) {
+        node.linked = linked;
+        return;
+      }
+      // Try to read from the file system.
+      if (file.exists) {
+        try {
+          List<int> bytes = file.readAsBytesSync();
+          linked = new PackageBundle.fromBuffer(bytes);
+          manager.linkedBundleMap[file.path] = linked;
+          node.linked = linked;
+        } on FileSystemException {
+          // Ignore file system exceptions.
+        }
+      }
+    }
+  }
+
+  /**
+   * If a new linked bundle was linked for the given [node], write the bundle
+   * into the memory cache and the file system.
+   */
+  void _writeLinked(_LinkNode node) {
+    String hash = node.linkedHash;
+    if (hash != null && node.linkedNewBytes != null) {
+      String fileName = _getLinkedName(hash);
+      File file = node.package.folder.getChildAssumingFile(fileName);
+      manager.linkedBundleMap[file.path] = node.linked;
+      manager._writeAtomic(node.package.folder, fileName, node.linkedNewBytes);
+    }
+  }
+}
+
+/**
+ * Information about a package to link.
+ */
+class _LinkNode {
+  final _ContextLinker linker;
   final PubPackage package;
   final PackageBundle unlinked;
-  final Map<String, _LinkNode> packageToNode;
 
   bool failed = false;
   Set<_LinkNode> transitiveDependencies;
+
+  List<_LinkNode> _dependencies;
   String _linkedHash;
 
   List<int> linkedNewBytes;
   PackageBundle linked;
 
-  _LinkNode(this.sdkBundle, this.getDeclaredVariable, this.listedPackages,
-      this.package, this.unlinked, this.packageToNode);
+  _LinkNode(this.linker, this.package, this.unlinked);
 
-  @override
-  bool get isEvaluated => linked != null || failed;
+  /**
+   * Retrieve the dependencies of this node.
+   */
+  List<_LinkNode> get dependencies {
+    if (_dependencies == null) {
+      Set<_LinkNode> dependencies = new Set<_LinkNode>();
+
+      void appendDependency(String uriStr) {
+        Uri uri = FastUri.parse(uriStr);
+        if (!uri.hasScheme) {
+          // A relative path in this package, skip it.
+        } else if (uri.scheme == 'dart') {
+          // Dependency on the SDK is implicit and always added.
+          // The SDK linked bundle is precomputed before linking packages.
+        } else if (uriStr.startsWith('package:')) {
+          String package = PubSummaryManager.getPackageName(uriStr);
+          _LinkNode packageNode = linker.packageToNode[package];
+          if (packageNode == null && linker.listedPackages.isListed(uriStr)) {
+            failed = true;
+          }
+          if (packageNode != null) {
+            dependencies.add(packageNode);
+          }
+        } else {
+          failed = true;
+        }
+      }
+
+      for (UnlinkedUnit unit in unlinked.unlinkedUnits) {
+        for (UnlinkedImport import in unit.imports) {
+          if (!import.isImplicit) {
+            appendDependency(import.uri);
+          }
+        }
+        for (UnlinkedExportPublic export in unit.publicNamespace.exports) {
+          appendDependency(export.uri);
+        }
+      }
+
+      _dependencies = dependencies.toList();
+    }
+    return _dependencies;
+  }
+
+  /**
+   * Return `true` is the node is ready - has the linked bundle or failed (does
+   * not have all required dependencies).
+   */
+  bool get isReady => linked != null || failed;
 
   /**
    * Return the hash string that corresponds to this linked bundle in the
-   * context of its [sdkBundle] and transitive dependencies.  Return `null` if
+   * context of its SDK bundle and transitive dependencies.  Return `null` if
    * the hash computation fails, because for example the full transitive
    * dependencies cannot computed.
    */
@@ -652,56 +742,45 @@
       ApiSignature signature = new ApiSignature();
       // Add all unlinked API signatures.
       List<String> signatures = <String>[];
-      signatures.add(sdkBundle.apiSignature);
+      signatures.add(linker.sdkBundle.apiSignature);
       transitiveDependencies
           .map((node) => node.unlinked.apiSignature)
           .forEach(signatures.add);
       signatures.sort();
       signatures.forEach(signature.addString);
       // Combine into a single hash.
-      _appendDeclaredVariables(signature);
+      appendDeclaredVariables(signature);
       _linkedHash = signature.toHex();
     }
     return _linkedHash;
   }
 
-  @override
-  List<_LinkNode> computeDependencies() {
-    Set<_LinkNode> dependencies = new Set<_LinkNode>();
-
-    void appendDependency(String uriStr) {
-      Uri uri = FastUri.parse(uriStr);
-      if (!uri.hasScheme) {
-        // A relative path in this package, skip it.
-      } else if (uri.scheme == 'dart') {
-        // Dependency on the SDK is implicit and always added.
-        // The SDK linked bundle is precomputed before linking packages.
-      } else if (uriStr.startsWith('package:')) {
-        String package = PubSummaryManager.getPackageName(uriStr);
-        _LinkNode packageNode = packageToNode[package];
-        if (packageNode == null && listedPackages.isListed(uriStr)) {
-          failed = true;
+  /**
+   * Append names and values of all referenced declared variables (even the
+   * ones without actually declared values) to the given [signature].
+   */
+  void appendDeclaredVariables(ApiSignature signature) {
+    Set<String> nameSet = new Set<String>();
+    for (_LinkNode node in transitiveDependencies) {
+      for (UnlinkedUnit unit in node.unlinked.unlinkedUnits) {
+        for (UnlinkedImport import in unit.imports) {
+          for (UnlinkedConfiguration configuration in import.configurations) {
+            nameSet.add(configuration.name);
+          }
         }
-        if (packageNode != null) {
-          dependencies.add(packageNode);
+        for (UnlinkedExportPublic export in unit.publicNamespace.exports) {
+          for (UnlinkedConfiguration configuration in export.configurations) {
+            nameSet.add(configuration.name);
+          }
         }
-      } else {
-        failed = true;
       }
     }
-
-    for (UnlinkedUnit unit in unlinked.unlinkedUnits) {
-      for (UnlinkedImport import in unit.imports) {
-        if (!import.isImplicit) {
-          appendDependency(import.uri);
-        }
-      }
-      for (UnlinkedExportPublic export in unit.publicNamespace.exports) {
-        appendDependency(export.uri);
-      }
+    List<String> sortedNameList = nameSet.toList()..sort();
+    signature.addInt(sortedNameList.length);
+    for (String name in sortedNameList) {
+      signature.addString(name);
+      signature.addString(linker._getDeclaredVariable(name) ?? '');
     }
-
-    return dependencies.toList();
   }
 
   /**
@@ -729,83 +808,6 @@
 
   @override
   String toString() => package.toString();
-
-  /**
-   * Append names and values of all referenced declared variables (even the
-   * ones without actually declared values) to the given [signature].
-   */
-  void _appendDeclaredVariables(ApiSignature signature) {
-    Set<String> nameSet = new Set<String>();
-    for (_LinkNode node in transitiveDependencies) {
-      for (UnlinkedUnit unit in node.unlinked.unlinkedUnits) {
-        for (UnlinkedImport import in unit.imports) {
-          for (UnlinkedConfiguration configuration in import.configurations) {
-            nameSet.add(configuration.name);
-          }
-        }
-        for (UnlinkedExportPublic export in unit.publicNamespace.exports) {
-          for (UnlinkedConfiguration configuration in export.configurations) {
-            nameSet.add(configuration.name);
-          }
-        }
-      }
-    }
-    List<String> sortedNameList = nameSet.toList()..sort();
-    signature.addInt(sortedNameList.length);
-    for (String name in sortedNameList) {
-      signature.addString(name);
-      signature.addString(getDeclaredVariable(name) ?? '');
-    }
-  }
-}
-
-/**
- * Specialization of [DependencyWalker] for linking packages.
- */
-class _LinkWalker extends DependencyWalker<_LinkNode> {
-  final _GetDeclaredVariable getDeclaredVariable;
-  final _ListedPackages listedPackages;
-  final SummaryDataStore store;
-  final bool strong;
-
-  _LinkWalker(
-      this.getDeclaredVariable, this.listedPackages, this.store, this.strong);
-
-  @override
-  void evaluate(_LinkNode node) {
-    evaluateScc([node]);
-  }
-
-  @override
-  void evaluateScc(List<_LinkNode> scc) {
-    Map<String, _LinkNode> uriToNode = <String, _LinkNode>{};
-    for (_LinkNode node in scc) {
-      for (String uri in node.unlinked.unlinkedUnitUris) {
-        uriToNode[uri] = node;
-      }
-    }
-    Set<String> libraryUris = uriToNode.keys.toSet();
-    // Perform linking.
-    Map<String, LinkedLibraryBuilder> linkedLibraries =
-        link(libraryUris, (String uri) {
-      return store.linkedMap[uri];
-    }, (String uri) {
-      return store.unlinkedMap[uri];
-    }, getDeclaredVariable, strong);
-    // Assemble linked bundles and put them into the store.
-    for (_LinkNode node in scc) {
-      PackageBundleAssembler assembler = new PackageBundleAssembler();
-      linkedLibraries.forEach((uri, linkedLibrary) {
-        if (identical(uriToNode[uri], node)) {
-          assembler.addLinkedLibrary(uri, linkedLibrary);
-        }
-      });
-      List<int> bytes = assembler.assemble().toBuffer();
-      node.linkedNewBytes = bytes;
-      node.linked = new PackageBundle.fromBuffer(bytes);
-      store.addBundle(null, node.linked);
-    }
-  }
 }
 
 /**
diff --git a/pkg/analyzer/lib/src/summary/resynthesize.dart b/pkg/analyzer/lib/src/summary/resynthesize.dart
index 2df51d4..bee1e9e 100644
--- a/pkg/analyzer/lib/src/summary/resynthesize.dart
+++ b/pkg/analyzer/lib/src/summary/resynthesize.dart
@@ -17,7 +17,7 @@
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/source_io.dart';
-import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
 import 'package:analyzer/src/generated/testing/token_factory.dart';
 import 'package:analyzer/src/summary/format.dart';
 import 'package:analyzer/src/summary/idl.dart';
@@ -211,13 +211,13 @@
       if (serializedLibrary == null) {
         LibraryElementImpl libraryElement =
             new LibraryElementImpl(context, '', -1, 0);
-        libraryElement.synthetic = true;
+        libraryElement.isSynthetic = true;
         CompilationUnitElementImpl unitElement =
             new CompilationUnitElementImpl(librarySource.shortName);
         libraryElement.definingCompilationUnit = unitElement;
         unitElement.source = librarySource;
         unitElement.librarySource = librarySource;
-        return libraryElement..synthetic = true;
+        return libraryElement..isSynthetic = true;
       }
       UnlinkedUnit unlinkedSummary = _getUnlinkedSummaryOrNull(uri);
       if (unlinkedSummary == null) {
@@ -301,12 +301,12 @@
 }
 
 /**
- * Builder of [Expression]s from [UnlinkedConst]s.
+ * Builder of [Expression]s from [UnlinkedExpr]s.
  */
 class _ConstExprBuilder {
   final _UnitResynthesizer resynthesizer;
   final ElementImpl context;
-  final UnlinkedConst uc;
+  final UnlinkedExpr uc;
 
   int intPtr = 0;
   int doublePtr = 0;
@@ -331,48 +331,48 @@
 
   Expression build() {
     if (!uc.isValidConst) {
-      return AstFactory.identifier3(r'$$invalidConstExpr$$');
+      return AstTestFactory.identifier3(r'$$invalidConstExpr$$');
     }
-    for (UnlinkedConstOperation operation in uc.operations) {
+    for (UnlinkedExprOperation operation in uc.operations) {
       switch (operation) {
-        case UnlinkedConstOperation.pushNull:
-          _push(AstFactory.nullLiteral());
+        case UnlinkedExprOperation.pushNull:
+          _push(AstTestFactory.nullLiteral());
           break;
         // bool
-        case UnlinkedConstOperation.pushFalse:
-          _push(AstFactory.booleanLiteral(false));
+        case UnlinkedExprOperation.pushFalse:
+          _push(AstTestFactory.booleanLiteral(false));
           break;
-        case UnlinkedConstOperation.pushTrue:
-          _push(AstFactory.booleanLiteral(true));
+        case UnlinkedExprOperation.pushTrue:
+          _push(AstTestFactory.booleanLiteral(true));
           break;
         // literals
-        case UnlinkedConstOperation.pushInt:
+        case UnlinkedExprOperation.pushInt:
           int value = uc.ints[intPtr++];
-          _push(AstFactory.integer(value));
+          _push(AstTestFactory.integer(value));
           break;
-        case UnlinkedConstOperation.pushLongInt:
+        case UnlinkedExprOperation.pushLongInt:
           int value = 0;
           int count = uc.ints[intPtr++];
           for (int i = 0; i < count; i++) {
             int next = uc.ints[intPtr++];
             value = value << 32 | next;
           }
-          _push(AstFactory.integer(value));
+          _push(AstTestFactory.integer(value));
           break;
-        case UnlinkedConstOperation.pushDouble:
+        case UnlinkedExprOperation.pushDouble:
           double value = uc.doubles[doublePtr++];
-          _push(AstFactory.doubleLiteral(value));
+          _push(AstTestFactory.doubleLiteral(value));
           break;
-        case UnlinkedConstOperation.makeSymbol:
+        case UnlinkedExprOperation.makeSymbol:
           String component = uc.strings[stringPtr++];
-          _push(AstFactory.symbolLiteral([component]));
+          _push(AstTestFactory.symbolLiteral([component]));
           break;
         // String
-        case UnlinkedConstOperation.pushString:
+        case UnlinkedExprOperation.pushString:
           String value = uc.strings[stringPtr++];
-          _push(AstFactory.string2(value));
+          _push(AstTestFactory.string2(value));
           break;
-        case UnlinkedConstOperation.concatenate:
+        case UnlinkedExprOperation.concatenate:
           int count = uc.ints[intPtr++];
           List<InterpolationElement> elements = <InterpolationElement>[];
           for (int i = 0; i < count; i++) {
@@ -380,133 +380,141 @@
             InterpolationElement element = _newInterpolationElement(expr);
             elements.insert(0, element);
           }
-          _push(AstFactory.string(elements));
+          _push(AstTestFactory.string(elements));
           break;
         // binary
-        case UnlinkedConstOperation.equal:
+        case UnlinkedExprOperation.equal:
           _pushBinary(TokenType.EQ_EQ);
           break;
-        case UnlinkedConstOperation.notEqual:
+        case UnlinkedExprOperation.notEqual:
           _pushBinary(TokenType.BANG_EQ);
           break;
-        case UnlinkedConstOperation.and:
+        case UnlinkedExprOperation.and:
           _pushBinary(TokenType.AMPERSAND_AMPERSAND);
           break;
-        case UnlinkedConstOperation.or:
+        case UnlinkedExprOperation.or:
           _pushBinary(TokenType.BAR_BAR);
           break;
-        case UnlinkedConstOperation.bitXor:
+        case UnlinkedExprOperation.bitXor:
           _pushBinary(TokenType.CARET);
           break;
-        case UnlinkedConstOperation.bitAnd:
+        case UnlinkedExprOperation.bitAnd:
           _pushBinary(TokenType.AMPERSAND);
           break;
-        case UnlinkedConstOperation.bitOr:
+        case UnlinkedExprOperation.bitOr:
           _pushBinary(TokenType.BAR);
           break;
-        case UnlinkedConstOperation.bitShiftLeft:
+        case UnlinkedExprOperation.bitShiftLeft:
           _pushBinary(TokenType.LT_LT);
           break;
-        case UnlinkedConstOperation.bitShiftRight:
+        case UnlinkedExprOperation.bitShiftRight:
           _pushBinary(TokenType.GT_GT);
           break;
-        case UnlinkedConstOperation.add:
+        case UnlinkedExprOperation.add:
           _pushBinary(TokenType.PLUS);
           break;
-        case UnlinkedConstOperation.subtract:
+        case UnlinkedExprOperation.subtract:
           _pushBinary(TokenType.MINUS);
           break;
-        case UnlinkedConstOperation.multiply:
+        case UnlinkedExprOperation.multiply:
           _pushBinary(TokenType.STAR);
           break;
-        case UnlinkedConstOperation.divide:
+        case UnlinkedExprOperation.divide:
           _pushBinary(TokenType.SLASH);
           break;
-        case UnlinkedConstOperation.floorDivide:
+        case UnlinkedExprOperation.floorDivide:
           _pushBinary(TokenType.TILDE_SLASH);
           break;
-        case UnlinkedConstOperation.modulo:
+        case UnlinkedExprOperation.modulo:
           _pushBinary(TokenType.PERCENT);
           break;
-        case UnlinkedConstOperation.greater:
+        case UnlinkedExprOperation.greater:
           _pushBinary(TokenType.GT);
           break;
-        case UnlinkedConstOperation.greaterEqual:
+        case UnlinkedExprOperation.greaterEqual:
           _pushBinary(TokenType.GT_EQ);
           break;
-        case UnlinkedConstOperation.less:
+        case UnlinkedExprOperation.less:
           _pushBinary(TokenType.LT);
           break;
-        case UnlinkedConstOperation.lessEqual:
+        case UnlinkedExprOperation.lessEqual:
           _pushBinary(TokenType.LT_EQ);
           break;
         // prefix
-        case UnlinkedConstOperation.complement:
+        case UnlinkedExprOperation.complement:
           _pushPrefix(TokenType.TILDE);
           break;
-        case UnlinkedConstOperation.negate:
+        case UnlinkedExprOperation.negate:
           _pushPrefix(TokenType.MINUS);
           break;
-        case UnlinkedConstOperation.not:
+        case UnlinkedExprOperation.not:
           _pushPrefix(TokenType.BANG);
           break;
         // conditional
-        case UnlinkedConstOperation.conditional:
+        case UnlinkedExprOperation.conditional:
           Expression elseExpr = _pop();
           Expression thenExpr = _pop();
           Expression condition = _pop();
-          _push(
-              AstFactory.conditionalExpression(condition, thenExpr, elseExpr));
+          _push(AstTestFactory.conditionalExpression(
+              condition, thenExpr, elseExpr));
           break;
         // invokeMethodRef
-        case UnlinkedConstOperation.invokeMethodRef:
+        case UnlinkedExprOperation.invokeMethodRef:
           _pushInvokeMethodRef();
           break;
         // containers
-        case UnlinkedConstOperation.makeUntypedList:
+        case UnlinkedExprOperation.makeUntypedList:
           _pushList(null);
           break;
-        case UnlinkedConstOperation.makeTypedList:
+        case UnlinkedExprOperation.makeTypedList:
           TypeName itemType = _newTypeName();
-          _pushList(AstFactory.typeArgumentList(<TypeName>[itemType]));
+          _pushList(AstTestFactory.typeArgumentList(<TypeName>[itemType]));
           break;
-        case UnlinkedConstOperation.makeUntypedMap:
+        case UnlinkedExprOperation.makeUntypedMap:
           _pushMap(null);
           break;
-        case UnlinkedConstOperation.makeTypedMap:
+        case UnlinkedExprOperation.makeTypedMap:
           TypeName keyType = _newTypeName();
           TypeName valueType = _newTypeName();
-          _pushMap(AstFactory.typeArgumentList(<TypeName>[keyType, valueType]));
+          _pushMap(
+              AstTestFactory.typeArgumentList(<TypeName>[keyType, valueType]));
           break;
-        case UnlinkedConstOperation.pushReference:
+        case UnlinkedExprOperation.pushReference:
           _pushReference();
           break;
-        case UnlinkedConstOperation.extractProperty:
+        case UnlinkedExprOperation.extractProperty:
           _pushExtractProperty();
           break;
-        case UnlinkedConstOperation.invokeConstructor:
+        case UnlinkedExprOperation.invokeConstructor:
           _pushInstanceCreation();
           break;
-        case UnlinkedConstOperation.pushParameter:
+        case UnlinkedExprOperation.pushParameter:
           String name = uc.strings[stringPtr++];
-          SimpleIdentifier identifier = AstFactory.identifier3(name);
+          SimpleIdentifier identifier = AstTestFactory.identifier3(name);
           identifier.staticElement = _enclosingConstructor.parameters
               .firstWhere((parameter) => parameter.name == name,
                   orElse: () => throw new StateError(
                       'Unable to resolve constructor parameter: $name'));
           _push(identifier);
           break;
-        case UnlinkedConstOperation.assignToRef:
-        case UnlinkedConstOperation.assignToProperty:
-        case UnlinkedConstOperation.assignToIndex:
-        case UnlinkedConstOperation.extractIndex:
-        case UnlinkedConstOperation.invokeMethod:
-        case UnlinkedConstOperation.cascadeSectionBegin:
-        case UnlinkedConstOperation.cascadeSectionEnd:
-        case UnlinkedConstOperation.typeCast:
-        case UnlinkedConstOperation.typeCheck:
-        case UnlinkedConstOperation.throwException:
-        case UnlinkedConstOperation.pushLocalFunctionReference:
+        case UnlinkedExprOperation.ifNull:
+          _pushBinary(TokenType.QUESTION_QUESTION);
+          break;
+        case UnlinkedExprOperation.await:
+          Expression expression = _pop();
+          _push(AstTestFactory.awaitExpression(expression));
+          break;
+        case UnlinkedExprOperation.assignToRef:
+        case UnlinkedExprOperation.assignToProperty:
+        case UnlinkedExprOperation.assignToIndex:
+        case UnlinkedExprOperation.extractIndex:
+        case UnlinkedExprOperation.invokeMethod:
+        case UnlinkedExprOperation.cascadeSectionBegin:
+        case UnlinkedExprOperation.cascadeSectionEnd:
+        case UnlinkedExprOperation.typeCast:
+        case UnlinkedExprOperation.typeCheck:
+        case UnlinkedExprOperation.throwException:
+        case UnlinkedExprOperation.pushLocalFunctionReference:
           throw new UnimplementedError(
               'Unexpected $operation in a constant expression.');
       }
@@ -525,7 +533,8 @@
       for (int i = 0; i < numNamedArgs; i++) {
         String name = uc.strings[stringPtr++];
         int index = numPositionalArgs + i;
-        arguments[index] = AstFactory.namedExpression2(name, arguments[index]);
+        arguments[index] =
+            AstTestFactory.namedExpression2(name, arguments[index]);
       }
     }
     return arguments;
@@ -545,16 +554,16 @@
       element = _getStringLengthElement();
     }
     if (enclosing == null) {
-      return AstFactory.identifier3(info.name)..staticElement = element;
+      return AstTestFactory.identifier3(info.name)..staticElement = element;
     }
     if (enclosing is SimpleIdentifier) {
-      SimpleIdentifier identifier = AstFactory.identifier3(info.name)
+      SimpleIdentifier identifier = AstTestFactory.identifier3(info.name)
         ..staticElement = element;
-      return AstFactory.identifier(enclosing, identifier);
+      return AstTestFactory.identifier(enclosing, identifier);
     }
-    SimpleIdentifier property = AstFactory.identifier3(info.name)
+    SimpleIdentifier property = AstTestFactory.identifier3(info.name)
       ..staticElement = element;
-    return AstFactory.propertyAccess(enclosing, property);
+    return AstTestFactory.propertyAccess(enclosing, property);
   }
 
   TypeName _buildTypeAst(DartType type) {
@@ -568,7 +577,7 @@
             : typeArguments.map(_buildTypeAst).toList();
       }
     }
-    TypeName node = AstFactory.typeName4(type.name, argumentNodes);
+    TypeName node = AstTestFactory.typeName4(type.name, argumentNodes);
     node.type = type;
     (node.name as SimpleIdentifier).staticElement = type.element;
     return node;
@@ -608,18 +617,18 @@
   void _pushBinary(TokenType operator) {
     Expression right = _pop();
     Expression left = _pop();
-    _push(AstFactory.binaryExpression(left, operator, right));
+    _push(AstTestFactory.binaryExpression(left, operator, right));
   }
 
   void _pushExtractProperty() {
     Expression target = _pop();
     String name = uc.strings[stringPtr++];
-    SimpleIdentifier propertyNode = AstFactory.identifier3(name);
+    SimpleIdentifier propertyNode = AstTestFactory.identifier3(name);
     // Only String.length property access can be potentially resolved.
     if (name == 'length') {
       propertyNode.staticElement = _getStringLengthElement();
     }
-    _push(AstFactory.propertyAccess(target, propertyNode));
+    _push(AstTestFactory.propertyAccess(target, propertyNode));
   }
 
   void _pushInstanceCreation() {
@@ -646,29 +655,29 @@
     } else {
       if (info.enclosing != null) {
         if (info.enclosing.enclosing != null) {
-          PrefixedIdentifier typeName = AstFactory.identifier5(
+          PrefixedIdentifier typeName = AstTestFactory.identifier5(
               info.enclosing.enclosing.name, info.enclosing.name);
           typeName.prefix.staticElement = info.enclosing.enclosing.element;
           typeName.identifier.staticElement = info.enclosing.element;
           typeName.identifier.staticType = info.enclosing.type;
-          typeNode = AstFactory.typeName3(typeName);
+          typeNode = AstTestFactory.typeName3(typeName);
           typeNode.type = info.enclosing.type;
           constructorName = info.name;
         } else if (info.enclosing.element != null) {
           SimpleIdentifier typeName =
-              AstFactory.identifier3(info.enclosing.name);
+              AstTestFactory.identifier3(info.enclosing.name);
           typeName.staticElement = info.enclosing.element;
           typeName.staticType = info.enclosing.type;
-          typeNode = AstFactory.typeName3(typeName);
+          typeNode = AstTestFactory.typeName3(typeName);
           typeNode.type = info.enclosing.type;
           constructorName = info.name;
         } else {
-          typeNode = AstFactory.typeName3(
-              AstFactory.identifier5(info.enclosing.name, info.name));
+          typeNode = AstTestFactory.typeName3(
+              AstTestFactory.identifier5(info.enclosing.name, info.name));
           constructorName = null;
         }
       } else {
-        typeNode = AstFactory.typeName4(info.name);
+        typeNode = AstTestFactory.typeName4(info.name);
       }
     }
     // prepare arguments
@@ -676,14 +685,15 @@
     // create ConstructorName
     ConstructorName constructorNode;
     if (constructorName != null) {
-      constructorNode = AstFactory.constructorName(typeNode, constructorName);
+      constructorNode =
+          AstTestFactory.constructorName(typeNode, constructorName);
       constructorNode.name.staticElement = constructorElement;
     } else {
-      constructorNode = AstFactory.constructorName(typeNode, null);
+      constructorNode = AstTestFactory.constructorName(typeNode, null);
     }
     constructorNode.staticElement = constructorElement;
     // create InstanceCreationExpression
-    InstanceCreationExpression instanceCreation = AstFactory
+    InstanceCreationExpression instanceCreation = AstTestFactory
         .instanceCreationExpression(Keyword.CONST, constructorNode, arguments);
     instanceCreation.staticElement = constructorElement;
     _push(instanceCreation);
@@ -701,7 +711,7 @@
       for (int i = 0; i < numTypeArguments; i++) {
         typeNames[i] = _newTypeName();
       }
-      typeArguments = AstFactory.typeArgumentList(typeNames);
+      typeArguments = AstTestFactory.typeArgumentList(typeNames);
     }
     if (node is SimpleIdentifier) {
       _push(new MethodInvocation(
@@ -709,7 +719,7 @@
           TokenFactory.tokenFromType(TokenType.PERIOD),
           node,
           typeArguments,
-          AstFactory.argumentList(arguments)));
+          AstTestFactory.argumentList(arguments)));
     } else {
       throw new UnimplementedError('For ${node?.runtimeType}: $node');
     }
@@ -721,7 +731,7 @@
     for (int i = 0; i < count; i++) {
       elements.insert(0, _pop());
     }
-    _push(AstFactory.listLiteral2(Keyword.CONST, typeArguments, elements));
+    _push(AstTestFactory.listLiteral2(Keyword.CONST, typeArguments, elements));
   }
 
   void _pushMap(TypeArgumentList typeArguments) {
@@ -730,14 +740,14 @@
     for (int i = 0; i < count; i++) {
       Expression value = _pop();
       Expression key = _pop();
-      entries.insert(0, AstFactory.mapLiteralEntry2(key, value));
+      entries.insert(0, AstTestFactory.mapLiteralEntry2(key, value));
     }
-    _push(AstFactory.mapLiteral(Keyword.CONST, typeArguments, entries));
+    _push(AstTestFactory.mapLiteral(Keyword.CONST, typeArguments, entries));
   }
 
   void _pushPrefix(TokenType operator) {
     Expression operand = _pop();
-    _push(AstFactory.prefixExpression(operator, operand));
+    _push(AstTestFactory.prefixExpression(operator, operand));
   }
 
   void _pushReference() {
@@ -1160,10 +1170,12 @@
   }
 
   LibraryElementHandle _getLibraryByRelativeUri(String depUri) {
-    String absoluteUri = resynthesizer.summaryResynthesizer.sourceFactory
-        .resolveUri(resynthesizer.librarySource, depUri)
-        .uri
-        .toString();
+    Source source = resynthesizer.summaryResynthesizer.sourceFactory
+        .resolveUri(resynthesizer.librarySource, depUri);
+    if (source == null) {
+      return null;
+    }
+    String absoluteUri = source.uri.toString();
     return new LibraryElementHandle(resynthesizer.summaryResynthesizer,
         new ElementLocationImpl.con3(<String>[absoluteUri]));
   }
@@ -1368,12 +1380,12 @@
   _ResynthesizerContext(this._unitResynthesizer);
 
   @override
-  ElementAnnotationImpl buildAnnotation(ElementImpl context, UnlinkedConst uc) {
+  ElementAnnotationImpl buildAnnotation(ElementImpl context, UnlinkedExpr uc) {
     return _unitResynthesizer.buildAnnotation(context, uc);
   }
 
   @override
-  Expression buildExpression(ElementImpl context, UnlinkedConst uc) {
+  Expression buildExpression(ElementImpl context, UnlinkedExpr uc) {
     return _unitResynthesizer._buildConstExpression(context, uc);
   }
 
@@ -1388,6 +1400,11 @@
   }
 
   @override
+  bool inheritsCovariant(int slot) {
+    return _unitResynthesizer.parametersInheritingCovariant.contains(slot);
+  }
+
+  @override
   bool isInConstCycle(int slot) {
     return _unitResynthesizer.constCycles.contains(slot);
   }
@@ -1453,6 +1470,12 @@
    */
   Set<int> constCycles;
 
+  /**
+   * Set of slot ids corresponding to parameters that inherit `@covariant`
+   * behavior.
+   */
+  Set<int> parametersInheritingCovariant;
+
   int numLinkedReferences;
   int numUnlinkedReferences;
 
@@ -1481,6 +1504,8 @@
       linkedTypeMap[t.slot] = t;
     }
     constCycles = linkedUnit.constCycles.toSet();
+    parametersInheritingCovariant =
+        linkedUnit.parametersInheritingCovariant.toSet();
     numLinkedReferences = linkedUnit.references.length;
     numUnlinkedReferences = unlinkedUnit.references.length;
     referenceInfos = new List<_ReferenceInfo>(numLinkedReferences);
@@ -1492,14 +1517,14 @@
   TypeProvider get typeProvider => summaryResynthesizer.typeProvider;
 
   /**
-   * Build [ElementAnnotationImpl] for the given [UnlinkedConst].
+   * Build [ElementAnnotationImpl] for the given [UnlinkedExpr].
    */
-  ElementAnnotationImpl buildAnnotation(ElementImpl context, UnlinkedConst uc) {
+  ElementAnnotationImpl buildAnnotation(ElementImpl context, UnlinkedExpr uc) {
     ElementAnnotationImpl elementAnnotation = new ElementAnnotationImpl(unit);
     Expression constExpr = _buildConstExpression(context, uc);
     if (constExpr is Identifier) {
       elementAnnotation.element = constExpr.staticElement;
-      elementAnnotation.annotationAst = AstFactory.annotation(constExpr);
+      elementAnnotation.annotationAst = AstTestFactory.annotation(constExpr);
     } else if (constExpr is InstanceCreationExpression) {
       elementAnnotation.element = constExpr.staticElement;
       Identifier typeName = constExpr.constructorName.type.name;
@@ -1507,11 +1532,12 @@
       if (typeName is SimpleIdentifier && constructorName != null) {
         // E.g. `@cls.ctor()`.  Since `cls.ctor` would have been parsed as
         // a PrefixedIdentifier, we need to resynthesize it as one.
-        typeName = AstFactory.identifier(typeName, constructorName);
+        typeName = AstTestFactory.identifier(typeName, constructorName);
         constructorName = null;
       }
-      elementAnnotation.annotationAst = AstFactory.annotation2(
-          typeName, constructorName, constExpr.argumentList);
+      elementAnnotation.annotationAst = AstTestFactory.annotation2(
+          typeName, constructorName, constExpr.argumentList)
+        ..element = constExpr.staticElement;
     } else {
       throw new StateError(
           'Unexpected annotation type: ${constExpr.runtimeType}');
@@ -1629,10 +1655,10 @@
           variable.enclosingElement = unit;
           implicitVariables[name] = variable;
           accessorsData.implicitVariables.add(variable);
-          variable.synthetic = true;
-          variable.final2 = kind == UnlinkedExecutableKind.getter;
+          variable.isSynthetic = true;
+          variable.isFinal = kind == UnlinkedExecutableKind.getter;
         } else {
-          variable.final2 = false;
+          variable.isFinal = false;
         }
         accessor.variable = variable;
         // link
@@ -1788,13 +1814,14 @@
     return result;
   }
 
-  Expression _buildConstExpression(ElementImpl context, UnlinkedConst uc) {
+  Expression _buildConstExpression(ElementImpl context, UnlinkedExpr uc) {
     return new _ConstExprBuilder(this, context, uc).build();
   }
 
   /**
    * Return the defining type for a [ConstructorElement] by applying
-   * [typeArgumentRefs] to the given linked [info].
+   * [typeArgumentRefs] to the given linked [info].  Return [DynamicTypeImpl]
+   * if the [info] is unresolved.
    */
   DartType _createConstructorDefiningType(
       TypeParameterizedElementMixin typeParameterContext,
@@ -1802,6 +1829,9 @@
       List<EntityRef> typeArgumentRefs) {
     bool isClass = info.element is ClassElement;
     _ReferenceInfo classInfo = isClass ? info : info.enclosing;
+    if (classInfo == null) {
+      return DynamicTypeImpl.instance;
+    }
     List<DartType> typeArguments = typeArgumentRefs
         .map((t) => buildType(t, typeParameterContext))
         .toList();
diff --git a/pkg/analyzer/lib/src/summary/summarize_ast.dart b/pkg/analyzer/lib/src/summary/summarize_ast.dart
index 87bf1d1..5d35783 100644
--- a/pkg/analyzer/lib/src/summary/summarize_ast.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_ast.dart
@@ -9,6 +9,7 @@
 import 'package:analyzer/dart/ast/visitor.dart';
 import 'package:analyzer/dart/element/type.dart' show DartType;
 import 'package:analyzer/src/generated/utilities_dart.dart';
+import 'package:analyzer/src/summary/api_signature.dart';
 import 'package:analyzer/src/summary/format.dart';
 import 'package:analyzer/src/summary/idl.dart';
 import 'package:analyzer/src/summary/public_namespace_computer.dart';
@@ -298,6 +299,11 @@
   bool isCoreLibrary = false;
 
   /**
+   * True is a [PartOfDirective] was found, so the unit is a part.
+   */
+  bool isPartOf = false;
+
+  /**
    * If the library has a library directive, the library name derived from it.
    * Otherwise `null`.
    */
@@ -325,7 +331,7 @@
    * If the library has a library directive, the annotations for it (if any).
    * Otherwise `null`.
    */
-  List<UnlinkedConst> libraryAnnotations = const <UnlinkedConstBuilder>[];
+  List<UnlinkedExpr> libraryAnnotations = const <UnlinkedExprBuilder>[];
 
   /**
    * The number of slot ids which have been assigned to this compilation unit.
@@ -359,6 +365,12 @@
   Set<String> _parameterNames;
 
   /**
+   * Indicates whether parameters found during visitors might inherit
+   * covariance.
+   */
+  bool _parametersMayInheritCovariance = false;
+
+  /**
    * Create a slot id for storing a propagated or inferred type or const cycle
    * info.
    */
@@ -395,10 +407,10 @@
    * Serialize the given list of [annotations].  If there are no annotations,
    * the empty list is returned.
    */
-  List<UnlinkedConstBuilder> serializeAnnotations(
+  List<UnlinkedExprBuilder> serializeAnnotations(
       NodeList<Annotation> annotations) {
     if (annotations == null || annotations.isEmpty) {
-      return const <UnlinkedConstBuilder>[];
+      return const <UnlinkedExprBuilder>[];
     }
     return annotations.map((Annotation a) {
       // Closures can't appear inside annotations, so we don't need a
@@ -512,6 +524,7 @@
     compilationUnit.declarations.accept(this);
     UnlinkedUnitBuilder b = new UnlinkedUnitBuilder();
     b.lineStarts = compilationUnit.lineInfo?.lineStarts;
+    b.isPartOf = isPartOf;
     b.libraryName = libraryName;
     b.libraryNameOffset = libraryNameOffset;
     b.libraryNameLength = libraryNameLength;
@@ -528,13 +541,14 @@
     b.typedefs = typedefs;
     b.variables = variables;
     b.publicNamespace = computePublicNamespace(compilationUnit);
+    _computeApiSignature(b);
     return b;
   }
 
   /**
-   * Serialize the given [expression], creating an [UnlinkedConstBuilder].
+   * Serialize the given [expression], creating an [UnlinkedExprBuilder].
    */
-  UnlinkedConstBuilder serializeConstExpr(
+  UnlinkedExprBuilder serializeConstExpr(
       Map<int, int> localClosureIndexMap, Expression expression,
       [Set<String> parameterNames]) {
     _ConstExprSerializer serializer =
@@ -610,7 +624,8 @@
       NodeList<Annotation> annotations,
       TypeParameterList typeParameters,
       bool isExternal,
-      bool serializeBodyExpr) {
+      bool serializeBodyExpr,
+      bool serializeBody) {
     int oldScopesLength = scopes.length;
     _TypeParameterScope typeParameterScope = new _TypeParameterScope();
     scopes.add(typeParameterScope);
@@ -638,9 +653,12 @@
     b.returnType = serializeTypeName(returnType);
     bool isSemanticallyStatic = isTopLevel || isDeclaredStatic;
     if (formalParameters != null) {
+      bool oldMayInheritCovariance = _parametersMayInheritCovariance;
+      _parametersMayInheritCovariance = !isTopLevel && !isDeclaredStatic;
       b.parameters = formalParameters.parameters
           .map((FormalParameter p) => p.accept(this) as UnlinkedParamBuilder)
           .toList();
+      _parametersMayInheritCovariance = oldMayInheritCovariance;
       if (!isSemanticallyStatic) {
         for (int i = 0; i < formalParameters.parameters.length; i++) {
           if (!b.parameters[i].isFunctionTyped &&
@@ -665,7 +683,7 @@
       _parameterNames.addAll(formalParameters.parameters
           .map((FormalParameter p) => p.identifier.name));
     }
-    serializeFunctionBody(b, null, body, serializeBodyExpr);
+    serializeFunctionBody(b, null, body, serializeBodyExpr, serializeBody);
     _parameterNames = oldParameterNames;
     scopes.removeLast();
     assert(scopes.length == oldScopesLength);
@@ -692,7 +710,8 @@
       UnlinkedExecutableBuilder b,
       List<ConstructorInitializer> initializers,
       AstNode body,
-      bool serializeBodyExpr) {
+      bool serializeBodyExpr,
+      bool serializeBody) {
     if (body is BlockFunctionBody || body is ExpressionFunctionBody) {
       for (UnlinkedParamBuilder parameter in b.parameters) {
         parameter.visibleOffset = body.offset;
@@ -714,7 +733,9 @@
         initializer.accept(this);
       }
     }
-    body.accept(this);
+    if (serializeBody) {
+      body.accept(this);
+    }
     if (serializeBodyExpr) {
       if (body is Expression) {
         b.bodyExpr =
@@ -748,9 +769,12 @@
     if (serializedReturnType != null) {
       b.type = serializedReturnType;
     }
+    bool oldMayInheritCovariance = _parametersMayInheritCovariance;
+    _parametersMayInheritCovariance = false;
     b.parameters = parameters.parameters
         .map((FormalParameter p) => p.accept(this) as UnlinkedParamBuilder)
         .toList();
+    _parametersMayInheritCovariance = oldMayInheritCovariance;
   }
 
   /**
@@ -767,7 +791,8 @@
     }
     UnlinkedExecutableBuilder initializer =
         new UnlinkedExecutableBuilder(nameOffset: expression.offset);
-    serializeFunctionBody(initializer, null, expression, serializeBodyExpr);
+    serializeFunctionBody(
+        initializer, null, expression, serializeBodyExpr, true);
     initializer.inferredReturnTypeSlot = assignSlot();
     return initializer;
   }
@@ -782,6 +807,9 @@
     b.nameOffset = node.identifier.offset;
     b.annotations = serializeAnnotations(node.metadata);
     b.codeRange = serializeCodeRange(node);
+    if (_parametersMayInheritCovariance) {
+      b.inheritsCovariantSlot = assignSlot();
+    }
     switch (node.kind) {
       case ParameterKind.REQUIRED:
         b.kind = UnlinkedParamKind.required;
@@ -1073,7 +1101,7 @@
     b.annotations = serializeAnnotations(node.metadata);
     b.codeRange = serializeCodeRange(node);
     Map<int, int> localClosureIndexMap = serializeFunctionBody(
-        b, node.initializers, node.body, node.constKeyword != null);
+        b, node.initializers, node.body, node.constKeyword != null, false);
     if (node.constKeyword != null) {
       Set<String> constructorParameterNames =
           node.parameters.parameters.map((p) => p.identifier.name).toSet();
@@ -1191,7 +1219,8 @@
         node.metadata,
         node.functionExpression.typeParameters,
         node.externalKeyword != null,
-        false));
+        false,
+        node.parent is FunctionDeclarationStatement));
   }
 
   @override
@@ -1215,7 +1244,8 @@
           null,
           node.typeParameters,
           false,
-          _serializeClosureBodyExprs));
+          _serializeClosureBodyExprs,
+          true));
     }
   }
 
@@ -1316,6 +1346,7 @@
         node.metadata,
         node.typeParameters,
         node.externalKeyword != null,
+        false,
         false));
   }
 
@@ -1330,6 +1361,7 @@
   @override
   void visitPartOfDirective(PartOfDirective node) {
     isCoreLibrary = node.libraryName.name == 'dart.core';
+    isPartOf = true;
   }
 
   @override
@@ -1371,6 +1403,15 @@
     Identifier name = typeName.name;
     return name is SimpleIdentifier && name.name == 'dynamic';
   }
+
+  /**
+   * Compute the API signature of the unit and record it.
+   */
+  static void _computeApiSignature(UnlinkedUnitBuilder b) {
+    ApiSignature apiSignature = new ApiSignature();
+    b.collectApiSignature(apiSignature);
+    b.apiSignature = apiSignature.toByteList();
+  }
 }
 
 /**
diff --git a/pkg/analyzer/lib/src/summary/summarize_const_expr.dart b/pkg/analyzer/lib/src/summary/summarize_const_expr.dart
index 18db39f..5a8702a 100644
--- a/pkg/analyzer/lib/src/summary/summarize_const_expr.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_const_expr.dart
@@ -15,7 +15,7 @@
  */
 UnlinkedConstructorInitializer serializeConstructorInitializer(
     ConstructorInitializer node,
-    UnlinkedConstBuilder serializeConstExpr(Expression expr)) {
+    UnlinkedExprBuilder serializeConstExpr(Expression expr)) {
   if (node is ConstructorFieldInitializer) {
     return new UnlinkedConstructorInitializerBuilder(
         kind: UnlinkedConstructorInitializerKind.field,
@@ -23,7 +23,7 @@
         expression: serializeConstExpr(node.expression));
   }
 
-  List<UnlinkedConstBuilder> arguments = <UnlinkedConstBuilder>[];
+  List<UnlinkedExprBuilder> arguments = <UnlinkedExprBuilder>[];
   List<String> argumentNames = <String>[];
   void serializeArguments(List<Expression> args) {
     for (Expression arg in args) {
@@ -61,43 +61,43 @@
  */
 abstract class AbstractConstExprSerializer {
   /**
-   * See [UnlinkedConstBuilder.isValidConst].
+   * See [UnlinkedExprBuilder.isValidConst].
    */
   bool isValidConst = true;
 
   /**
-   * See [UnlinkedConstBuilder.nmae].
+   * See [UnlinkedExprBuilder.name].
    */
   String name = null;
 
   /**
-   * See [UnlinkedConstBuilder.operations].
+   * See [UnlinkedExprBuilder.operations].
    */
-  final List<UnlinkedConstOperation> operations = <UnlinkedConstOperation>[];
+  final List<UnlinkedExprOperation> operations = <UnlinkedExprOperation>[];
 
   /**
-   * See [UnlinkedConstBuilder.assignmentOperators].
+   * See [UnlinkedExprBuilder.assignmentOperators].
    */
   final List<UnlinkedExprAssignOperator> assignmentOperators =
       <UnlinkedExprAssignOperator>[];
 
   /**
-   * See [UnlinkedConstBuilder.ints].
+   * See [UnlinkedExprBuilder.ints].
    */
   final List<int> ints = <int>[];
 
   /**
-   * See [UnlinkedConstBuilder.doubles].
+   * See [UnlinkedExprBuilder.doubles].
    */
   final List<double> doubles = <double>[];
 
   /**
-   * See [UnlinkedConstBuilder.strings].
+   * See [UnlinkedExprBuilder.strings].
    */
   final List<String> strings = <String>[];
 
   /**
-   * See [UnlinkedConstBuilder.references].
+   * See [UnlinkedExprBuilder.references].
    */
   final List<EntityRefBuilder> references = <EntityRefBuilder>[];
 
@@ -163,7 +163,7 @@
       EntityRefBuilder constructor, ArgumentList argumentList) {
     _serializeArguments(argumentList);
     references.add(constructor);
-    operations.add(UnlinkedConstOperation.invokeConstructor);
+    operations.add(UnlinkedExprOperation.invokeConstructor);
   }
 
   /**
@@ -183,11 +183,11 @@
   }
 
   /**
-   * Return the [UnlinkedConstBuilder] that corresponds to the state of this
+   * Return the [UnlinkedExprBuilder] that corresponds to the state of this
    * serializer.
    */
-  UnlinkedConstBuilder toBuilder() {
-    return new UnlinkedConstBuilder(
+  UnlinkedExprBuilder toBuilder() {
+    return new UnlinkedExprBuilder(
         isValidConst: isValidConst,
         operations: operations,
         assignmentOperators: assignmentOperators,
@@ -232,24 +232,24 @@
     if (_isIdentifierSequence(expr)) {
       EntityRefBuilder ref = serializeIdentifierSequence(expr);
       references.add(ref);
-      operations.add(UnlinkedConstOperation.assignToRef);
+      operations.add(UnlinkedExprOperation.assignToRef);
     } else if (expr is PropertyAccess) {
       if (!expr.isCascaded) {
         _serialize(expr.target);
       }
       strings.add(expr.propertyName.name);
-      operations.add(UnlinkedConstOperation.assignToProperty);
+      operations.add(UnlinkedExprOperation.assignToProperty);
     } else if (expr is IndexExpression) {
       if (!expr.isCascaded) {
         _serialize(expr.target);
       }
       _serialize(expr.index);
-      operations.add(UnlinkedConstOperation.assignToIndex);
+      operations.add(UnlinkedExprOperation.assignToIndex);
     } else if (expr is PrefixedIdentifier) {
       strings.add(expr.prefix.name);
-      operations.add(UnlinkedConstOperation.pushParameter);
+      operations.add(UnlinkedExprOperation.pushParameter);
       strings.add(expr.identifier.name);
-      operations.add(UnlinkedConstOperation.assignToProperty);
+      operations.add(UnlinkedExprOperation.assignToProperty);
     } else {
       throw new StateError('Unsupported assignable: $expr');
     }
@@ -267,11 +267,12 @@
         numOfComponents++;
         ints.add(value & 0xFFFFFFFF);
       }
+
       pushComponents(value);
       ints[ints.length - 1 - numOfComponents] = numOfComponents;
-      operations.add(UnlinkedConstOperation.pushLongInt);
+      operations.add(UnlinkedExprOperation.pushLongInt);
     } else {
-      operations.add(UnlinkedConstOperation.pushInt);
+      operations.add(UnlinkedExprOperation.pushInt);
       ints.add(value);
     }
   }
@@ -283,34 +284,34 @@
     if (expr is IntegerLiteral) {
       _pushInt(expr.value);
     } else if (expr is DoubleLiteral) {
-      operations.add(UnlinkedConstOperation.pushDouble);
+      operations.add(UnlinkedExprOperation.pushDouble);
       doubles.add(expr.value);
     } else if (expr is BooleanLiteral) {
       if (expr.value) {
-        operations.add(UnlinkedConstOperation.pushTrue);
+        operations.add(UnlinkedExprOperation.pushTrue);
       } else {
-        operations.add(UnlinkedConstOperation.pushFalse);
+        operations.add(UnlinkedExprOperation.pushFalse);
       }
     } else if (expr is StringLiteral) {
       _serializeString(expr);
     } else if (expr is SymbolLiteral) {
       strings.add(expr.components.map((token) => token.lexeme).join('.'));
-      operations.add(UnlinkedConstOperation.makeSymbol);
+      operations.add(UnlinkedExprOperation.makeSymbol);
     } else if (expr is NullLiteral) {
-      operations.add(UnlinkedConstOperation.pushNull);
+      operations.add(UnlinkedExprOperation.pushNull);
     } else if (expr is Identifier) {
       if (expr is SimpleIdentifier && isParameterName(expr.name)) {
         strings.add(expr.name);
-        operations.add(UnlinkedConstOperation.pushParameter);
+        operations.add(UnlinkedExprOperation.pushParameter);
       } else if (expr is PrefixedIdentifier &&
           isParameterName(expr.prefix.name)) {
         strings.add(expr.prefix.name);
-        operations.add(UnlinkedConstOperation.pushParameter);
+        operations.add(UnlinkedExprOperation.pushParameter);
         strings.add(expr.identifier.name);
-        operations.add(UnlinkedConstOperation.extractProperty);
+        operations.add(UnlinkedExprOperation.extractProperty);
       } else {
         references.add(serializeIdentifier(expr));
-        operations.add(UnlinkedConstOperation.pushReference);
+        operations.add(UnlinkedExprOperation.pushReference);
       }
     } else if (expr is InstanceCreationExpression) {
       if (!expr.isConst) {
@@ -333,7 +334,7 @@
       _serialize(expr.condition);
       _serialize(expr.thenExpression);
       _serialize(expr.elseExpression);
-      operations.add(UnlinkedConstOperation.conditional);
+      operations.add(UnlinkedExprOperation.conditional);
     } else if (expr is PrefixExpression) {
       _serializePrefixExpression(expr);
     } else if (expr is PostfixExpression) {
@@ -346,7 +347,7 @@
       isValidConst = false;
       _serialize(expr.target);
       _serialize(expr.index);
-      operations.add(UnlinkedConstOperation.extractIndex);
+      operations.add(UnlinkedExprOperation.extractIndex);
     } else if (expr is AssignmentExpression) {
       _serializeAssignment(expr);
     } else if (expr is CascadeExpression) {
@@ -356,29 +357,33 @@
       List<int> indices = serializeFunctionExpression(expr);
       if (indices != null) {
         ints.addAll(serializeFunctionExpression(expr));
-        operations.add(UnlinkedConstOperation.pushLocalFunctionReference);
+        operations.add(UnlinkedExprOperation.pushLocalFunctionReference);
       } else {
         // Invalid expression; just push null.
-        operations.add(UnlinkedConstOperation.pushNull);
+        operations.add(UnlinkedExprOperation.pushNull);
       }
     } else if (expr is FunctionExpressionInvocation) {
       isValidConst = false;
       // TODO(scheglov) implement
-      operations.add(UnlinkedConstOperation.pushNull);
+      operations.add(UnlinkedExprOperation.pushNull);
     } else if (expr is AsExpression) {
       isValidConst = false;
       _serialize(expr.expression);
       references.add(serializeTypeName(expr.type));
-      operations.add(UnlinkedConstOperation.typeCast);
+      operations.add(UnlinkedExprOperation.typeCast);
     } else if (expr is IsExpression) {
       isValidConst = false;
       _serialize(expr.expression);
       references.add(serializeTypeName(expr.type));
-      operations.add(UnlinkedConstOperation.typeCheck);
+      operations.add(UnlinkedExprOperation.typeCheck);
     } else if (expr is ThrowExpression) {
       isValidConst = false;
       _serialize(expr.expression);
-      operations.add(UnlinkedConstOperation.throwException);
+      operations.add(UnlinkedExprOperation.throwException);
+    } else if (expr is AwaitExpression) {
+      isValidConst = false;
+      _serialize(expr.expression);
+      operations.add(UnlinkedExprOperation.await);
     } else {
       throw new StateError('Unknown expression type: $expr');
     }
@@ -448,43 +453,45 @@
     _serialize(expr.rightOperand);
     TokenType operator = expr.operator.type;
     if (operator == TokenType.EQ_EQ) {
-      operations.add(UnlinkedConstOperation.equal);
+      operations.add(UnlinkedExprOperation.equal);
     } else if (operator == TokenType.BANG_EQ) {
-      operations.add(UnlinkedConstOperation.notEqual);
+      operations.add(UnlinkedExprOperation.notEqual);
     } else if (operator == TokenType.AMPERSAND_AMPERSAND) {
-      operations.add(UnlinkedConstOperation.and);
+      operations.add(UnlinkedExprOperation.and);
     } else if (operator == TokenType.BAR_BAR) {
-      operations.add(UnlinkedConstOperation.or);
+      operations.add(UnlinkedExprOperation.or);
     } else if (operator == TokenType.CARET) {
-      operations.add(UnlinkedConstOperation.bitXor);
+      operations.add(UnlinkedExprOperation.bitXor);
     } else if (operator == TokenType.AMPERSAND) {
-      operations.add(UnlinkedConstOperation.bitAnd);
+      operations.add(UnlinkedExprOperation.bitAnd);
     } else if (operator == TokenType.BAR) {
-      operations.add(UnlinkedConstOperation.bitOr);
+      operations.add(UnlinkedExprOperation.bitOr);
     } else if (operator == TokenType.GT_GT) {
-      operations.add(UnlinkedConstOperation.bitShiftRight);
+      operations.add(UnlinkedExprOperation.bitShiftRight);
     } else if (operator == TokenType.LT_LT) {
-      operations.add(UnlinkedConstOperation.bitShiftLeft);
+      operations.add(UnlinkedExprOperation.bitShiftLeft);
     } else if (operator == TokenType.PLUS) {
-      operations.add(UnlinkedConstOperation.add);
+      operations.add(UnlinkedExprOperation.add);
     } else if (operator == TokenType.MINUS) {
-      operations.add(UnlinkedConstOperation.subtract);
+      operations.add(UnlinkedExprOperation.subtract);
     } else if (operator == TokenType.STAR) {
-      operations.add(UnlinkedConstOperation.multiply);
+      operations.add(UnlinkedExprOperation.multiply);
     } else if (operator == TokenType.SLASH) {
-      operations.add(UnlinkedConstOperation.divide);
+      operations.add(UnlinkedExprOperation.divide);
     } else if (operator == TokenType.TILDE_SLASH) {
-      operations.add(UnlinkedConstOperation.floorDivide);
+      operations.add(UnlinkedExprOperation.floorDivide);
     } else if (operator == TokenType.GT) {
-      operations.add(UnlinkedConstOperation.greater);
+      operations.add(UnlinkedExprOperation.greater);
     } else if (operator == TokenType.LT) {
-      operations.add(UnlinkedConstOperation.less);
+      operations.add(UnlinkedExprOperation.less);
     } else if (operator == TokenType.GT_EQ) {
-      operations.add(UnlinkedConstOperation.greaterEqual);
+      operations.add(UnlinkedExprOperation.greaterEqual);
     } else if (operator == TokenType.LT_EQ) {
-      operations.add(UnlinkedConstOperation.lessEqual);
+      operations.add(UnlinkedExprOperation.lessEqual);
     } else if (operator == TokenType.PERCENT) {
-      operations.add(UnlinkedConstOperation.modulo);
+      operations.add(UnlinkedExprOperation.modulo);
+    } else if (operator == TokenType.QUESTION_QUESTION) {
+      operations.add(UnlinkedExprOperation.ifNull);
     } else {
       throw new StateError('Unknown operator: $operator');
     }
@@ -493,9 +500,9 @@
   void _serializeCascadeExpression(CascadeExpression expr) {
     _serialize(expr.target);
     for (Expression section in expr.cascadeSections) {
-      operations.add(UnlinkedConstOperation.cascadeSectionBegin);
+      operations.add(UnlinkedExprOperation.cascadeSectionBegin);
       _serialize(section);
-      operations.add(UnlinkedConstOperation.cascadeSectionEnd);
+      operations.add(UnlinkedExprOperation.cascadeSectionEnd);
     }
   }
 
@@ -506,9 +513,9 @@
     if (expr.typeArguments != null &&
         expr.typeArguments.arguments.length == 1) {
       references.add(serializeTypeName(expr.typeArguments.arguments[0]));
-      operations.add(UnlinkedConstOperation.makeTypedList);
+      operations.add(UnlinkedExprOperation.makeTypedList);
     } else {
-      operations.add(UnlinkedConstOperation.makeUntypedList);
+      operations.add(UnlinkedExprOperation.makeUntypedList);
     }
   }
 
@@ -522,9 +529,9 @@
         expr.typeArguments.arguments.length == 2) {
       references.add(serializeTypeName(expr.typeArguments.arguments[0]));
       references.add(serializeTypeName(expr.typeArguments.arguments[1]));
-      operations.add(UnlinkedConstOperation.makeTypedMap);
+      operations.add(UnlinkedExprOperation.makeTypedMap);
     } else {
-      operations.add(UnlinkedConstOperation.makeUntypedMap);
+      operations.add(UnlinkedExprOperation.makeUntypedMap);
     }
   }
 
@@ -541,7 +548,7 @@
       _serializeArguments(argumentList);
       references.add(ref);
       _serializeTypeArguments(invocation.typeArguments);
-      operations.add(UnlinkedConstOperation.invokeMethodRef);
+      operations.add(UnlinkedExprOperation.invokeMethodRef);
     } else {
       if (!invocation.isCascaded) {
         _serialize(target);
@@ -549,7 +556,7 @@
       _serializeArguments(argumentList);
       strings.add(methodName.name);
       _serializeTypeArguments(invocation.typeArguments);
-      operations.add(UnlinkedConstOperation.invokeMethod);
+      operations.add(UnlinkedExprOperation.invokeMethod);
     }
   }
 
@@ -572,13 +579,13 @@
     Expression operand = expr.operand;
     if (operator == TokenType.BANG) {
       _serialize(operand);
-      operations.add(UnlinkedConstOperation.not);
+      operations.add(UnlinkedExprOperation.not);
     } else if (operator == TokenType.MINUS) {
       _serialize(operand);
-      operations.add(UnlinkedConstOperation.negate);
+      operations.add(UnlinkedExprOperation.negate);
     } else if (operator == TokenType.TILDE) {
       _serialize(operand);
-      operations.add(UnlinkedConstOperation.complement);
+      operations.add(UnlinkedExprOperation.complement);
     } else if (operator == TokenType.PLUS_PLUS) {
       _serializePrefixPostfixIncDec(
           operand, UnlinkedExprAssignOperator.prefixIncrement);
@@ -601,38 +608,38 @@
     if (_isIdentifierSequence(expr)) {
       EntityRefBuilder ref = serializeIdentifierSequence(expr);
       references.add(ref);
-      operations.add(UnlinkedConstOperation.pushReference);
+      operations.add(UnlinkedExprOperation.pushReference);
     } else {
       _serialize(expr.target);
       strings.add(expr.propertyName.name);
-      operations.add(UnlinkedConstOperation.extractProperty);
+      operations.add(UnlinkedExprOperation.extractProperty);
     }
   }
 
   void _serializeString(StringLiteral expr) {
     if (expr is AdjacentStrings) {
       if (expr.strings.every((string) => string is SimpleStringLiteral)) {
-        operations.add(UnlinkedConstOperation.pushString);
+        operations.add(UnlinkedExprOperation.pushString);
         strings.add(expr.stringValue);
       } else {
         expr.strings.forEach(_serializeString);
-        operations.add(UnlinkedConstOperation.concatenate);
+        operations.add(UnlinkedExprOperation.concatenate);
         ints.add(expr.strings.length);
       }
     } else if (expr is SimpleStringLiteral) {
-      operations.add(UnlinkedConstOperation.pushString);
+      operations.add(UnlinkedExprOperation.pushString);
       strings.add(expr.value);
     } else {
       StringInterpolation interpolation = expr as StringInterpolation;
       for (InterpolationElement element in interpolation.elements) {
         if (element is InterpolationString) {
-          operations.add(UnlinkedConstOperation.pushString);
+          operations.add(UnlinkedExprOperation.pushString);
           strings.add(element.value);
         } else {
           _serialize((element as InterpolationExpression).expression);
         }
       }
-      operations.add(UnlinkedConstOperation.concatenate);
+      operations.add(UnlinkedExprOperation.concatenate);
       ints.add(interpolation.elements.length);
     }
   }
diff --git a/pkg/analyzer/lib/src/summary/summary_sdk.dart b/pkg/analyzer/lib/src/summary/summary_sdk.dart
index 5857d8b..3142b29 100644
--- a/pkg/analyzer/lib/src/summary/summary_sdk.dart
+++ b/pkg/analyzer/lib/src/summary/summary_sdk.dart
@@ -48,7 +48,7 @@
 
   @override
   bool hasResultsForSource(Source source) {
-    return source.source != null && source.isInSystemLibrary;
+    return source != null && source.isInSystemLibrary;
   }
 
   void _buildAsyncLibrary() {
diff --git a/pkg/analyzer/lib/src/task/dart.dart b/pkg/analyzer/lib/src/task/dart.dart
index 01f9495..9e3b31e 100644
--- a/pkg/analyzer/lib/src/task/dart.dart
+++ b/pkg/analyzer/lib/src/task/dart.dart
@@ -16,16 +16,18 @@
 import 'package:analyzer/exception/exception.dart';
 import 'package:analyzer/src/context/cache.dart';
 import 'package:analyzer/src/dart/ast/ast.dart'
-    show NamespaceDirectiveImpl, UriBasedDirectiveImpl;
+    show NamespaceDirectiveImpl, UriBasedDirectiveImpl, UriValidationCode;
 import 'package:analyzer/src/dart/ast/utilities.dart';
 import 'package:analyzer/src/dart/element/builder.dart';
 import 'package:analyzer/src/dart/element/element.dart';
 import 'package:analyzer/src/dart/resolver/inheritance_manager.dart';
 import 'package:analyzer/src/dart/scanner/reader.dart';
 import 'package:analyzer/src/dart/scanner/scanner.dart';
+import 'package:analyzer/src/dart/sdk/patch.dart';
 import 'package:analyzer/src/error/codes.dart';
 import 'package:analyzer/src/error/pending_error.dart';
 import 'package:analyzer/src/generated/constant.dart';
+import 'package:analyzer/src/generated/declaration_resolver.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/error_verifier.dart';
 import 'package:analyzer/src/generated/incremental_resolver.dart';
@@ -1510,6 +1512,7 @@
     LibraryIdentifier libraryNameNode = null;
     String partsLibraryName = _UNKNOWN_LIBRARY_NAME;
     bool hasPartDirective = false;
+    Set<Source> seenPartSources = new Set<Source>();
     FunctionElement entryPoint =
         _findEntryPoint(definingCompilationUnitElement);
     List<Directive> directivesToResolve = <Directive>[];
@@ -1533,32 +1536,58 @@
           partElement.uriEnd = partUri.end;
           partElement.uri = directive.uriContent;
           //
+          // Validate that the part source is unique in the library.
+          //
+          if (!seenPartSources.add(partSource)) {
+            errors.add(new AnalysisError(
+                librarySource,
+                partUri.offset,
+                partUri.length,
+                CompileTimeErrorCode.DUPLICATE_PART,
+                [partSource.uri]));
+          }
+          //
           // Validate that the part contains a part-of directive with the same
           // name as the library.
           //
           if (context.exists(partSource)) {
-            String partLibraryName =
-                _getPartLibraryName(partSource, partUnit, directivesToResolve);
-            if (partLibraryName == null) {
+            _NameOrSource nameOrSource = _getPartLibraryNameOrUri(
+                context, partSource, partUnit, directivesToResolve);
+            if (nameOrSource == null) {
               errors.add(new AnalysisError(
                   librarySource,
                   partUri.offset,
                   partUri.length,
                   CompileTimeErrorCode.PART_OF_NON_PART,
                   [partUri.toSource()]));
-            } else if (libraryNameNode == null) {
-              if (partsLibraryName == _UNKNOWN_LIBRARY_NAME) {
-                partsLibraryName = partLibraryName;
-              } else if (partsLibraryName != partLibraryName) {
-                partsLibraryName = null;
+            } else {
+              String name = nameOrSource.name;
+              if (name != null) {
+                if (libraryNameNode == null) {
+                  if (partsLibraryName == _UNKNOWN_LIBRARY_NAME) {
+                    partsLibraryName = name;
+                  } else if (partsLibraryName != name) {
+                    partsLibraryName = null;
+                  }
+                } else if (libraryNameNode.name != name) {
+                  errors.add(new AnalysisError(
+                      librarySource,
+                      partUri.offset,
+                      partUri.length,
+                      StaticWarningCode.PART_OF_DIFFERENT_LIBRARY,
+                      [libraryNameNode.name, name]));
+                }
+              } else {
+                Source source = nameOrSource.source;
+                if (source != librarySource) {
+                  errors.add(new AnalysisError(
+                      librarySource,
+                      partUri.offset,
+                      partUri.length,
+                      StaticWarningCode.PART_OF_DIFFERENT_LIBRARY,
+                      [librarySource.uri.toString(), source.uri.toString()]));
+                }
               }
-            } else if (libraryNameNode.name != partLibraryName) {
-              errors.add(new AnalysisError(
-                  librarySource,
-                  partUri.offset,
-                  partUri.length,
-                  StaticWarningCode.PART_OF_DIFFERENT_LIBRARY,
-                  [libraryNameNode.name, partLibraryName]));
             }
           }
           if (entryPoint == null) {
@@ -1613,7 +1642,7 @@
     if (libraryElement == null) {
       libraryElement =
           new LibraryElementImpl.forNode(owningContext, libraryNameNode);
-      libraryElement.synthetic = modificationTime < 0;
+      libraryElement.isSynthetic = modificationTime < 0;
       libraryElement.definingCompilationUnit = definingCompilationUnitElement;
       libraryElement.entryPoint = entryPoint;
       libraryElement.parts = sourcedCompilationUnits;
@@ -1665,7 +1694,10 @@
    * Return the name of the library that the given part is declared to be a
    * part of, or `null` if the part does not contain a part-of directive.
    */
-  String _getPartLibraryName(Source partSource, CompilationUnit partUnit,
+  _NameOrSource _getPartLibraryNameOrUri(
+      AnalysisContext context,
+      Source partSource,
+      CompilationUnit partUnit,
       List<Directive> directivesToResolve) {
     NodeList<Directive> directives = partUnit.directives;
     int length = directives.length;
@@ -1675,7 +1707,15 @@
         directivesToResolve.add(directive);
         LibraryIdentifier libraryName = directive.libraryName;
         if (libraryName != null) {
-          return libraryName.name;
+          return new _NameOrSource(libraryName.name, null);
+        }
+        String uri = directive.uri?.stringValue;
+        if (uri != null) {
+          Source librarySource =
+              context.sourceFactory.resolveUri(partSource, uri);
+          if (librarySource != null) {
+            return new _NameOrSource(null, librarySource);
+          }
         }
       }
     }
@@ -2198,8 +2238,10 @@
     // re-run if anything reachable from this target has been invalidated,
     // and the invalidation code (invalidateLibraryCycles) will ensure that
     // element model results will be re-used here only if they are still valid.
-    if (context.analysisOptions.strongMode) {
-      LibraryElement library = getRequiredInput(LIBRARY_ELEMENT_INPUT);
+    LibraryElement library = getRequiredInput(LIBRARY_ELEMENT_INPUT);
+    if (context.analysisOptions.strongMode &&
+        !LibraryElementImpl.hasResolutionCapability(
+            library, LibraryResolutionCapability.resolvedTypeNames)) {
       List<LibraryElement> component = library.libraryCycle;
       Set<LibraryElement> filter = component.toSet();
       Set<CompilationUnitElement> deps = new Set<CompilationUnitElement>();
@@ -3237,12 +3279,10 @@
     // Prepare inputs.
     //
     CompilationUnit unit = getRequiredInput(RESOLVED_UNIT_INPUT);
-
     //
     // Generate lints.
     //
     List<AstVisitor> visitors = <AstVisitor>[];
-
     bool timeVisits = analysisOptions.enableTiming;
     List<Linter> linters = getLints(context);
     int length = linters.length;
@@ -3257,10 +3297,9 @@
         visitors.add(visitor);
       }
     }
-
-    DelegatingAstVisitor dv = new DelegatingAstVisitor(visitors);
-    unit.accept(dv);
-
+    AstVisitor visitor = new ExceptionHandlingDelegatingAstVisitor(
+        visitors, ExceptionHandlingDelegatingAstVisitor.logException);
+    unit.accept(visitor);
     //
     // Record outputs.
     //
@@ -4007,11 +4046,16 @@
     parser.enableAssertInitializer = options.enableAssertInitializer;
     parser.parseFunctionBodies =
         options.analyzeFunctionBodiesPredicate(_source);
-    parser.parseGenericMethods = options.enableGenericMethods;
     parser.parseGenericMethodComments = options.strongMode;
+    parser.enableUriInPartOf = options.enableUriInPartOf;
     CompilationUnit unit = parser.parseCompilationUnit(tokenStream);
     unit.lineInfo = lineInfo;
 
+    if (options.patchPlatform != 0 && _source.uri.scheme == 'dart') {
+      new SdkPatcher().patch(context.sourceFactory.dartSdk,
+          options.patchPlatform, errorListener, _source, unit);
+    }
+
     bool hasNonPartOfDirective = false;
     bool hasPartOfDirective = false;
     HashSet<Source> explicitlyImportedSourceSet = new HashSet<Source>();
@@ -6222,8 +6266,8 @@
    * Check the given [directive] to see if the referenced source exists and
    * report an error if it does not.
    */
-  void validateReferencedSource(UriBasedDirective directive) {
-    if (directive is NamespaceDirective) {
+  void validateReferencedSource(UriBasedDirectiveImpl directive) {
+    if (directive is NamespaceDirectiveImpl) {
       for (Configuration configuration in directive.configurations) {
         Source source = configuration.uriSource;
         StringLiteral uriLiteral = configuration.uri;
@@ -6363,6 +6407,18 @@
 }
 
 /**
+ * An object holding either the name or the source associated with a part-of
+ * directive.
+ */
+class _NameOrSource {
+  final String name;
+
+  final Source source;
+
+  _NameOrSource(this.name, this.source);
+}
+
+/**
  * The kind of the source closure to build.
  */
 enum _SourceClosureKind { IMPORT, EXPORT, IMPORT_EXPORT }
diff --git a/pkg/analyzer/lib/src/task/html_work_manager.dart b/pkg/analyzer/lib/src/task/html_work_manager.dart
index 911ef16..d8bc76f 100644
--- a/pkg/analyzer/lib/src/task/html_work_manager.dart
+++ b/pkg/analyzer/lib/src/task/html_work_manager.dart
@@ -40,7 +40,7 @@
    * Initialize a newly created manager.
    */
   HtmlWorkManager(this.context) {
-    analysisCache.onResultInvalidated.listen(onResultInvalidated);
+    context.onResultInvalidated.listen(onResultInvalidated);
   }
 
   /**
diff --git a/pkg/analyzer/lib/src/task/incremental_element_builder.dart b/pkg/analyzer/lib/src/task/incremental_element_builder.dart
index 6ae19ff..bbb460e 100644
--- a/pkg/analyzer/lib/src/task/incremental_element_builder.dart
+++ b/pkg/analyzer/lib/src/task/incremental_element_builder.dart
@@ -382,7 +382,7 @@
     if (classElement.constructors.isEmpty) {
       ConstructorElementImpl constructor =
           new ConstructorElementImpl.forNode(null);
-      constructor.synthetic = true;
+      constructor.isSynthetic = true;
       classElement.constructors = <ConstructorElement>[constructor];
       classDelta.addedConstructors.add(constructor);
     }
diff --git a/pkg/analyzer/lib/src/task/options.dart b/pkg/analyzer/lib/src/task/options.dart
index 4047b3b..4cf2afe 100644
--- a/pkg/analyzer/lib/src/task/options.dart
+++ b/pkg/analyzer/lib/src/task/options.dart
@@ -10,7 +10,6 @@
 import 'package:analyzer/plugin/options.dart';
 import 'package:analyzer/source/analysis_options_provider.dart';
 import 'package:analyzer/source/error_processor.dart';
-import 'package:analyzer/src/context/context.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/java_engine.dart';
 import 'package:analyzer/src/generated/source.dart';
@@ -29,14 +28,6 @@
     new ListResultDescriptor<AnalysisError>(
         'ANALYSIS_OPTIONS_ERRORS', AnalysisError.NO_ERRORS);
 
-/**
- * The descriptor used to associate error processors with analysis contexts in
- * configuration data.
- */
-final ListResultDescriptor<ErrorProcessor> CONFIGURED_ERROR_PROCESSORS =
-    new ListResultDescriptor<ErrorProcessor>(
-        'configured.errors', const <ErrorProcessor>[]);
-
 final _OptionsProcessor _processor = new _OptionsProcessor();
 
 void applyToAnalysisOptions(
@@ -63,6 +54,7 @@
 
   static const String errors = 'errors';
   static const String exclude = 'exclude';
+  static const String include = 'include';
   static const String language = 'language';
   static const String plugins = 'plugins';
   static const String strong_mode = 'strong-mode';
@@ -173,7 +165,7 @@
     if (_errorCodes == null) {
       _errorCodes = new HashSet<String>();
       // Engine codes.
-      _errorCodes.addAll(ErrorCode.values.map((ErrorCode code) => code.name));
+      _errorCodes.addAll(errorCodeValues.map((ErrorCode code) => code.name));
     }
     return _errorCodes;
   }
@@ -228,10 +220,12 @@
       <ResultDescriptor>[ANALYSIS_OPTIONS_ERRORS, LINE_INFO],
       suitabilityFor: suitabilityFor);
 
-  final AnalysisOptionsProvider optionsProvider = new AnalysisOptionsProvider();
+  AnalysisOptionsProvider optionsProvider;
 
   GenerateOptionsErrorsTask(AnalysisContext context, AnalysisTarget target)
-      : super(context, target);
+      : super(context, target) {
+    optionsProvider = new AnalysisOptionsProvider(context?.sourceFactory);
+  }
 
   @override
   TaskDescriptor get descriptor => DESCRIPTOR;
@@ -243,16 +237,80 @@
     String content = getRequiredInput(CONTENT_INPUT_NAME);
 
     List<AnalysisError> errors = <AnalysisError>[];
+    Source initialSource = source;
+    SourceSpan initialIncludeSpan;
+
+    // Validate the specified options and any included option files
+    void validate(Source source, Map<String, YamlNode> options) {
+      List<AnalysisError> validationErrors =
+          new OptionsFileValidator(source).validate(options);
+      if (initialIncludeSpan != null && validationErrors.isNotEmpty) {
+        for (AnalysisError error in validationErrors) {
+          var args = [
+            source.fullName,
+            error.offset.toString(),
+            (error.offset + error.length - 1).toString(),
+            error.message,
+          ];
+          errors.add(new AnalysisError(
+              initialSource,
+              initialIncludeSpan.start.column + 1,
+              initialIncludeSpan.length,
+              AnalysisOptionsWarningCode.INCLUDED_FILE_WARNING,
+              args));
+        }
+      } else {
+        errors.addAll(validationErrors);
+      }
+
+      YamlNode node = options[AnalyzerOptions.include];
+      if (node == null) {
+        return;
+      }
+      SourceSpan span = node.span;
+      initialIncludeSpan ??= span;
+      String includeUri = span.text;
+      Source includedSource =
+          context.sourceFactory.resolveUri(source, includeUri);
+      if (!includedSource.exists()) {
+        errors.add(new AnalysisError(
+            initialSource,
+            initialIncludeSpan.start.column + 1,
+            initialIncludeSpan.length,
+            AnalysisOptionsWarningCode.INCLUDE_FILE_NOT_FOUND,
+            [includeUri, source.fullName]));
+        return;
+      }
+      try {
+        Map<String, YamlNode> options =
+            optionsProvider.getOptionsFromString(includedSource.contents.data);
+        validate(includedSource, options);
+      } on OptionsFormatException catch (e) {
+        var args = [
+          includedSource.fullName,
+          e.span.start.offset.toString(),
+          e.span.end.offset.toString(),
+          e.message,
+        ];
+        // Report errors for included option files
+        // on the include directive located in the initial options file.
+        errors.add(new AnalysisError(
+            initialSource,
+            initialIncludeSpan.start.column + 1,
+            initialIncludeSpan.length,
+            AnalysisOptionsErrorCode.INCLUDED_FILE_PARSE_ERROR,
+            args));
+      }
+    }
 
     try {
       Map<String, YamlNode> options =
           optionsProvider.getOptionsFromString(content);
-      errors.addAll(_validate(options));
+      validate(source, options);
     } on OptionsFormatException catch (e) {
       SourceSpan span = e.span;
-      var error = new AnalysisError(source, span.start.column + 1, span.length,
-          AnalysisOptionsErrorCode.PARSE_ERROR, [e.message]);
-      errors.add(error);
+      errors.add(new AnalysisError(source, span.start.column + 1, span.length,
+          AnalysisOptionsErrorCode.PARSE_ERROR, [e.message]));
     }
 
     //
@@ -262,9 +320,6 @@
     outputs[LINE_INFO] = computeLineInfo(content);
   }
 
-  List<AnalysisError> _validate(Map<String, YamlNode> options) =>
-      new OptionsFileValidator(source).validate(options);
-
   /// Return a map from the names of the inputs of this kind of task to the
   /// task input descriptors describing those inputs for a task with the
   /// given [target].
@@ -446,9 +501,17 @@
       var strongMode = analyzer[AnalyzerOptions.strong_mode];
       _applyStrongOptions(options, strongMode);
 
+      // Set filters.
+      var filters = analyzer[AnalyzerOptions.errors];
+      _applyProcessors(options, filters);
+
       // Process language options.
       var language = analyzer[AnalyzerOptions.language];
       _applyLanguageOptions(options, language);
+
+      // Process excludes.
+      var excludes = analyzer[AnalyzerOptions.exclude];
+      _applyExcludes(options, excludes);
     }
   }
 
@@ -483,7 +546,10 @@
     if (excludes is YamlList) {
       List<String> excludeList = toStringList(excludes);
       if (excludeList != null) {
-        context.setConfigurationData(CONTEXT_EXCLUDES, excludeList);
+        AnalysisOptionsImpl options =
+            new AnalysisOptionsImpl.from(context.analysisOptions);
+        options.excludePatterns = excludeList;
+        context.analysisOptions = options;
       }
     }
   }
@@ -514,14 +580,6 @@
         context.analysisOptions = options;
       }
     }
-    if (feature == AnalyzerOptions.enableGenericMethods) {
-      if (isTrue(value)) {
-        AnalysisOptionsImpl options =
-            new AnalysisOptionsImpl.from(context.analysisOptions);
-        options.enableGenericMethods = true;
-        context.analysisOptions = options;
-      }
-    }
   }
 
   void setLanguageOptions(AnalysisContext context, Object configs) {
@@ -539,8 +597,10 @@
 
   void setProcessors(AnalysisContext context, Object codes) {
     ErrorConfig config = new ErrorConfig(codes);
-    context.setConfigurationData(
-        CONFIGURED_ERROR_PROCESSORS, config.processors);
+    AnalysisOptionsImpl options =
+        new AnalysisOptionsImpl.from(context.analysisOptions);
+    options.errorProcessors = config.processors;
+    context.analysisOptions = options;
   }
 
   void setStrongMode(AnalysisContext context, Object strongMode) {
@@ -560,18 +620,23 @@
     }
   }
 
+  void _applyExcludes(AnalysisOptionsImpl options, Object excludes) {
+    if (excludes is YamlList) {
+      List<String> excludeList = toStringList(excludes);
+      if (excludeList != null) {
+        options.excludePatterns = excludeList;
+      }
+    }
+  }
+
   void _applyLanguageOption(
       AnalysisOptionsImpl options, Object feature, Object value) {
     bool boolValue = toBool(value);
     if (boolValue != null) {
       if (feature == AnalyzerOptions.enableAssertInitializer) {
         options.enableAssertInitializer = boolValue;
-      } else if (feature == AnalyzerOptions.enableInitializingFormalAccess) {
-        options.enableInitializingFormalAccess = boolValue;
       } else if (feature == AnalyzerOptions.enableSuperMixins) {
         options.enableSuperMixins = boolValue;
-      } else if (feature == AnalyzerOptions.enableGenericMethods) {
-        options.enableGenericMethods = boolValue;
       }
     }
   }
@@ -590,6 +655,11 @@
     }
   }
 
+  void _applyProcessors(AnalysisOptionsImpl options, Object codes) {
+    ErrorConfig config = new ErrorConfig(codes);
+    options.errorProcessors = config.processors;
+  }
+
   void _applyStrongModeOption(
       AnalysisOptionsImpl options, Object feature, Object value) {
     bool boolValue = toBool(value);
diff --git a/pkg/analyzer/lib/src/task/strong/checker.dart b/pkg/analyzer/lib/src/task/strong/checker.dart
index b32ff6e..4e2a092 100644
--- a/pkg/analyzer/lib/src/task/strong/checker.dart
+++ b/pkg/analyzer/lib/src/task/strong/checker.dart
@@ -1051,10 +1051,25 @@
     assert(rules.isSubtypeOf(to, from));
 
     // Inference "casts":
-    if (expr is Literal || expr is FunctionExpression) {
+    if (expr is Literal) {
       // fromT should be an exact type - this will almost certainly fail at
       // runtime.
-      _recordMessage(expr, StrongModeCode.STATIC_TYPE_ERROR, [expr, from, to]);
+      if (expr is ListLiteral) {
+        _recordMessage(
+            expr, StrongModeCode.INVALID_CAST_LITERAL_LIST, [from, to]);
+      } else if (expr is MapLiteral) {
+        _recordMessage(
+            expr, StrongModeCode.INVALID_CAST_LITERAL_MAP, [from, to]);
+      } else {
+        _recordMessage(
+            expr, StrongModeCode.INVALID_CAST_LITERAL, [expr, from, to]);
+      }
+      return;
+    }
+
+    if (expr is FunctionExpression) {
+      _recordMessage(
+          expr, StrongModeCode.INVALID_CAST_FUNCTION_EXPR, [from, to]);
       return;
     }
 
@@ -1063,15 +1078,19 @@
       if (e == null || !e.isFactory) {
         // fromT should be an exact type - this will almost certainly fail at
         // runtime.
-
-        _recordMessage(
-            expr, StrongModeCode.STATIC_TYPE_ERROR, [expr, from, to]);
+        _recordMessage(expr, StrongModeCode.INVALID_CAST_NEW_EXPR, [from, to]);
         return;
       }
     }
 
     if (isKnownFunction(expr)) {
-      _recordMessage(expr, StrongModeCode.STATIC_TYPE_ERROR, [expr, from, to]);
+      Element e = _getKnownElement(expr);
+      _recordMessage(
+          expr,
+          e is MethodElement
+              ? StrongModeCode.INVALID_CAST_METHOD
+              : StrongModeCode.INVALID_CAST_FUNCTION,
+          [e.name, from, to]);
       return;
     }
 
@@ -1088,7 +1107,7 @@
         downCastComposite =
             typeArgs.isEmpty || typeArgs.any((t) => t.isDynamic);
       } else {
-        downCastComposite = true;
+        downCastComposite = !from.isDynamic;
       }
     }
 
diff --git a/pkg/analyzer/lib/src/util/fast_uri.dart b/pkg/analyzer/lib/src/util/fast_uri.dart
index 40681bd..691a51d 100644
--- a/pkg/analyzer/lib/src/util/fast_uri.dart
+++ b/pkg/analyzer/lib/src/util/fast_uri.dart
@@ -183,7 +183,8 @@
     }
     if (refPath.startsWith('../') ||
         refPath.contains('/../') ||
-        refPath.contains('/./')) {
+        refPath.contains('/./') ||
+        refPath.startsWith('/')) {
       Uri slowResult = _fallbackUri.resolveUri(reference);
       return FastUri.parse(slowResult.toString());
     }
diff --git a/pkg/analyzer/lib/task/model.dart b/pkg/analyzer/lib/task/model.dart
index 2a6f6c5..9d1f6ba 100644
--- a/pkg/analyzer/lib/task/model.dart
+++ b/pkg/analyzer/lib/task/model.dart
@@ -14,6 +14,9 @@
 import 'package:analyzer/src/generated/utilities_general.dart';
 import 'package:analyzer/src/task/driver.dart';
 import 'package:analyzer/src/task/model.dart';
+import 'package:front_end/src/base/analysis_target.dart';
+
+export 'package:front_end/src/base/analysis_target.dart' show AnalysisTarget;
 
 /**
  * A function that converts the given [key] and [value] into a [TaskInput].
@@ -68,27 +71,6 @@
 }
 
 /**
- * An object with which an analysis result can be associated.
- *
- * Clients may implement this class when creating new kinds of targets.
- * Instances of this type are used in hashed data structures, so subtypes are
- * required to correctly implement [==] and [hashCode].
- */
-abstract class AnalysisTarget {
-  /**
-   * If this target is associated with a library, return the source of the
-   * library's defining compilation unit; otherwise return `null`.
-   */
-  Source get librarySource;
-
-  /**
-   * Return the source associated with this target, or `null` if this target is
-   * not associated with a source.
-   */
-  Source get source;
-}
-
-/**
  * An object used to compute one or more analysis results associated with a
  * single target.
  *
diff --git a/pkg/analyzer/pubspec.yaml b/pkg/analyzer/pubspec.yaml
index 6521345..eebe9df 100644
--- a/pkg/analyzer/pubspec.yaml
+++ b/pkg/analyzer/pubspec.yaml
@@ -1,5 +1,5 @@
 name: analyzer
-version: 0.29.0-alpha.1
+version: 0.30.0-alpha.0
 author: Dart Team <misc@dartlang.org>
 description: Static analyzer for Dart.
 homepage: https://github.com/dart-lang/sdk/tree/master/pkg/analyzer
@@ -9,6 +9,7 @@
   args: '>=0.12.1 <0.14.0'
   charcode: ^1.1.0
   crypto: '>=1.1.1 <3.0.0'
+  front_end: 0.1.0-alpha.0
   glob: ^1.0.3
   html: '>=0.12.0 <1.14.0'
   isolate: ^0.2.2
@@ -19,6 +20,6 @@
   watcher: '>=0.9.6 <0.10.0'
   yaml: ^2.1.2
 dev_dependencies:
-  test_reflective_loader: '>=0.0.4 <0.1.0'
+  test_reflective_loader: ^0.1.0
   typed_mock: '>=0.0.4 <1.0.0'
-  unittest: '>=0.9.0 <0.12.0'
+  test: ^0.12.0
diff --git a/pkg/analyzer/test/cancelable_future_test.dart b/pkg/analyzer/test/cancelable_future_test.dart
index d22ca56..8f38b6a 100644
--- a/pkg/analyzer/test/cancelable_future_test.dart
+++ b/pkg/analyzer/test/cancelable_future_test.dart
@@ -7,16 +7,15 @@
 import 'dart:async';
 
 import 'package:analyzer/src/cancelable_future.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 import 'package:watcher/src/utils.dart';
 
-import 'utils.dart';
-
 void main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(CancelableCompleterTests);
-  defineReflectiveTests(CancelableFutureTests);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(CancelableCompleterTests);
+    defineReflectiveTests(CancelableFutureTests);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/context/declared_variables_test.dart b/pkg/analyzer/test/context/declared_variables_test.dart
index 9007855..1d131c6 100644
--- a/pkg/analyzer/test/context/declared_variables_test.dart
+++ b/pkg/analyzer/test/context/declared_variables_test.dart
@@ -8,15 +8,15 @@
 import 'package:analyzer/dart/element/type.dart';
 import 'package:analyzer/src/generated/constant.dart';
 import 'package:analyzer/src/generated/testing/test_type_provider.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../generated/test_support.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(DeclaredVariablesTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(DeclaredVariablesTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/context/test_all.dart b/pkg/analyzer/test/context/test_all.dart
index b5387ba..af0e8b8 100644
--- a/pkg/analyzer/test/context/test_all.dart
+++ b/pkg/analyzer/test/context/test_all.dart
@@ -4,15 +4,13 @@
 
 library analyzer.test.context.test_all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../utils.dart';
 import 'declared_variables_test.dart' as declared_variables;
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('context tests', () {
+  defineReflectiveSuite(() {
     declared_variables.main();
-  });
+  }, name: 'context');
 }
diff --git a/pkg/analyzer/test/dart/ast/ast_test.dart b/pkg/analyzer/test/dart/ast/ast_test.dart
index cfc85bd..3a887f8 100644
--- a/pkg/analyzer/test/dart/ast/ast_test.dart
+++ b/pkg/analyzer/test/dart/ast/ast_test.dart
@@ -7,28 +7,28 @@
 import 'package:analyzer/dart/ast/ast.dart';
 import 'package:analyzer/dart/ast/token.dart';
 import 'package:analyzer/src/dart/ast/token.dart';
-import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
 import 'package:analyzer/src/generated/testing/token_factory.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../generated/parser_test.dart' show ParserTestCase;
 import '../../generated/test_support.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ClassDeclarationTest);
-  defineReflectiveTests(ClassTypeAliasTest);
-  defineReflectiveTests(ConstructorDeclarationTest);
-  defineReflectiveTests(FieldFormalParameterTest);
-  defineReflectiveTests(IndexExpressionTest);
-  defineReflectiveTests(MethodDeclarationTest);
-  defineReflectiveTests(NodeListTest);
-  defineReflectiveTests(SimpleIdentifierTest);
-  defineReflectiveTests(SimpleStringLiteralTest);
-  defineReflectiveTests(StringInterpolationTest);
-  defineReflectiveTests(VariableDeclarationTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ClassDeclarationTest);
+    defineReflectiveTests(ClassTypeAliasTest);
+    defineReflectiveTests(ConstructorDeclarationTest);
+    defineReflectiveTests(FieldFormalParameterTest);
+    defineReflectiveTests(IndexExpressionTest);
+    defineReflectiveTests(MethodDeclarationTest);
+    defineReflectiveTests(NodeListTest);
+    defineReflectiveTests(SimpleIdentifierTest);
+    defineReflectiveTests(SimpleStringLiteralTest);
+    defineReflectiveTests(StringInterpolationTest);
+    defineReflectiveTests(VariableDeclarationTest);
+  });
 }
 
 @reflectiveTest
@@ -37,19 +37,22 @@
     List<ConstructorInitializer> initializers =
         new List<ConstructorInitializer>();
     ConstructorDeclaration defaultConstructor =
-        AstFactory.constructorDeclaration(AstFactory.identifier3("Test"), null,
-            AstFactory.formalParameterList(), initializers);
-    ConstructorDeclaration aConstructor = AstFactory.constructorDeclaration(
-        AstFactory.identifier3("Test"),
+        AstTestFactory.constructorDeclaration(
+            AstTestFactory.identifier3("Test"),
+            null,
+            AstTestFactory.formalParameterList(),
+            initializers);
+    ConstructorDeclaration aConstructor = AstTestFactory.constructorDeclaration(
+        AstTestFactory.identifier3("Test"),
         "a",
-        AstFactory.formalParameterList(),
+        AstTestFactory.formalParameterList(),
         initializers);
-    ConstructorDeclaration bConstructor = AstFactory.constructorDeclaration(
-        AstFactory.identifier3("Test"),
+    ConstructorDeclaration bConstructor = AstTestFactory.constructorDeclaration(
+        AstTestFactory.identifier3("Test"),
         "b",
-        AstFactory.formalParameterList(),
+        AstTestFactory.formalParameterList(),
         initializers);
-    ClassDeclaration clazz = AstFactory.classDeclaration(null, "Test", null,
+    ClassDeclaration clazz = AstTestFactory.classDeclaration(null, "Test", null,
         null, null, null, [defaultConstructor, aConstructor, bConstructor]);
     expect(clazz.getConstructor(null), same(defaultConstructor));
     expect(clazz.getConstructor("a"), same(aConstructor));
@@ -58,13 +61,13 @@
   }
 
   void test_getField() {
-    VariableDeclaration aVar = AstFactory.variableDeclaration("a");
-    VariableDeclaration bVar = AstFactory.variableDeclaration("b");
-    VariableDeclaration cVar = AstFactory.variableDeclaration("c");
+    VariableDeclaration aVar = AstTestFactory.variableDeclaration("a");
+    VariableDeclaration bVar = AstTestFactory.variableDeclaration("b");
+    VariableDeclaration cVar = AstTestFactory.variableDeclaration("c");
     ClassDeclaration clazz =
-        AstFactory.classDeclaration(null, "Test", null, null, null, null, [
-      AstFactory.fieldDeclaration2(false, null, [aVar]),
-      AstFactory.fieldDeclaration2(false, null, [bVar, cVar])
+        AstTestFactory.classDeclaration(null, "Test", null, null, null, null, [
+      AstTestFactory.fieldDeclaration2(false, null, [aVar]),
+      AstTestFactory.fieldDeclaration2(false, null, [bVar, cVar])
     ]);
     expect(clazz.getField("a"), same(aVar));
     expect(clazz.getField("b"), same(bVar));
@@ -73,11 +76,21 @@
   }
 
   void test_getMethod() {
-    MethodDeclaration aMethod = AstFactory.methodDeclaration(null, null, null,
-        null, AstFactory.identifier3("a"), AstFactory.formalParameterList());
-    MethodDeclaration bMethod = AstFactory.methodDeclaration(null, null, null,
-        null, AstFactory.identifier3("b"), AstFactory.formalParameterList());
-    ClassDeclaration clazz = AstFactory.classDeclaration(
+    MethodDeclaration aMethod = AstTestFactory.methodDeclaration(
+        null,
+        null,
+        null,
+        null,
+        AstTestFactory.identifier3("a"),
+        AstTestFactory.formalParameterList());
+    MethodDeclaration bMethod = AstTestFactory.methodDeclaration(
+        null,
+        null,
+        null,
+        null,
+        AstTestFactory.identifier3("b"),
+        AstTestFactory.formalParameterList());
+    ClassDeclaration clazz = AstTestFactory.classDeclaration(
         null, "Test", null, null, null, null, [aMethod, bMethod]);
     expect(clazz.getMethod("a"), same(aMethod));
     expect(clazz.getMethod("b"), same(bMethod));
@@ -86,12 +99,12 @@
 
   void test_isAbstract() {
     expect(
-        AstFactory
+        AstTestFactory
             .classDeclaration(null, "A", null, null, null, null)
             .isAbstract,
         isFalse);
     expect(
-        AstFactory
+        AstTestFactory
             .classDeclaration(Keyword.ABSTRACT, "B", null, null, null, null)
             .isAbstract,
         isTrue);
@@ -102,10 +115,12 @@
 class ClassTypeAliasTest extends ParserTestCase {
   void test_isAbstract() {
     expect(
-        AstFactory.classTypeAlias("A", null, null, null, null, null).isAbstract,
+        AstTestFactory
+            .classTypeAlias("A", null, null, null, null, null)
+            .isAbstract,
         isFalse);
     expect(
-        AstFactory
+        AstTestFactory
             .classTypeAlias("B", null, Keyword.ABSTRACT, null, null, null)
             .isAbstract,
         isTrue);
@@ -117,10 +132,10 @@
   void test_firstTokenAfterCommentAndMetadata_all_inverted() {
     Token externalKeyword = TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
     externalKeyword.offset = 14;
-    ConstructorDeclaration declaration = AstFactory.constructorDeclaration2(
+    ConstructorDeclaration declaration = AstTestFactory.constructorDeclaration2(
         Keyword.CONST,
         Keyword.FACTORY,
-        AstFactory.identifier3('int'),
+        AstTestFactory.identifier3('int'),
         null,
         null,
         null,
@@ -135,10 +150,10 @@
   void test_firstTokenAfterCommentAndMetadata_all_normal() {
     Token token = TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
     token.offset = 0;
-    ConstructorDeclaration declaration = AstFactory.constructorDeclaration2(
+    ConstructorDeclaration declaration = AstTestFactory.constructorDeclaration2(
         Keyword.CONST,
         Keyword.FACTORY,
-        AstFactory.identifier3('int'),
+        AstTestFactory.identifier3('int'),
         null,
         null,
         null,
@@ -150,10 +165,10 @@
   }
 
   void test_firstTokenAfterCommentAndMetadata_constOnly() {
-    ConstructorDeclaration declaration = AstFactory.constructorDeclaration2(
+    ConstructorDeclaration declaration = AstTestFactory.constructorDeclaration2(
         Keyword.CONST,
         null,
-        AstFactory.identifier3('int'),
+        AstTestFactory.identifier3('int'),
         null,
         null,
         null,
@@ -164,17 +179,17 @@
 
   void test_firstTokenAfterCommentAndMetadata_externalOnly() {
     Token externalKeyword = TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
-    ConstructorDeclaration declaration = AstFactory.constructorDeclaration2(
-        null, null, AstFactory.identifier3('int'), null, null, null, null);
+    ConstructorDeclaration declaration = AstTestFactory.constructorDeclaration2(
+        null, null, AstTestFactory.identifier3('int'), null, null, null, null);
     declaration.externalKeyword = externalKeyword;
     expect(declaration.firstTokenAfterCommentAndMetadata, externalKeyword);
   }
 
   void test_firstTokenAfterCommentAndMetadata_factoryOnly() {
-    ConstructorDeclaration declaration = AstFactory.constructorDeclaration2(
+    ConstructorDeclaration declaration = AstTestFactory.constructorDeclaration2(
         null,
         Keyword.FACTORY,
-        AstFactory.identifier3('int'),
+        AstTestFactory.identifier3('int'),
         null,
         null,
         null,
@@ -187,13 +202,14 @@
 @reflectiveTest
 class FieldFormalParameterTest extends EngineTestCase {
   void test_endToken_noParameters() {
-    FieldFormalParameter parameter = AstFactory.fieldFormalParameter2('field');
+    FieldFormalParameter parameter =
+        AstTestFactory.fieldFormalParameter2('field');
     expect(parameter.endToken, parameter.identifier.endToken);
   }
 
   void test_endToken_parameters() {
-    FieldFormalParameter parameter = AstFactory.fieldFormalParameter(
-        null, null, 'field', AstFactory.formalParameterList([]));
+    FieldFormalParameter parameter = AstTestFactory.fieldFormalParameter(
+        null, null, 'field', AstTestFactory.formalParameterList([]));
     expect(parameter.endToken, parameter.parameters.endToken);
   }
 }
@@ -201,106 +217,106 @@
 @reflectiveTest
 class IndexExpressionTest extends EngineTestCase {
   void test_inGetterContext_assignment_compound_left() {
-    IndexExpression expression = AstFactory.indexExpression(
-        AstFactory.identifier3("a"), AstFactory.identifier3("b"));
+    IndexExpression expression = AstTestFactory.indexExpression(
+        AstTestFactory.identifier3("a"), AstTestFactory.identifier3("b"));
     // a[b] += c
-    AstFactory.assignmentExpression(
-        expression, TokenType.PLUS_EQ, AstFactory.identifier3("c"));
+    AstTestFactory.assignmentExpression(
+        expression, TokenType.PLUS_EQ, AstTestFactory.identifier3("c"));
     expect(expression.inGetterContext(), isTrue);
   }
 
   void test_inGetterContext_assignment_simple_left() {
-    IndexExpression expression = AstFactory.indexExpression(
-        AstFactory.identifier3("a"), AstFactory.identifier3("b"));
+    IndexExpression expression = AstTestFactory.indexExpression(
+        AstTestFactory.identifier3("a"), AstTestFactory.identifier3("b"));
     // a[b] = c
-    AstFactory.assignmentExpression(
-        expression, TokenType.EQ, AstFactory.identifier3("c"));
+    AstTestFactory.assignmentExpression(
+        expression, TokenType.EQ, AstTestFactory.identifier3("c"));
     expect(expression.inGetterContext(), isFalse);
   }
 
   void test_inGetterContext_nonAssignment() {
-    IndexExpression expression = AstFactory.indexExpression(
-        AstFactory.identifier3("a"), AstFactory.identifier3("b"));
+    IndexExpression expression = AstTestFactory.indexExpression(
+        AstTestFactory.identifier3("a"), AstTestFactory.identifier3("b"));
     // a[b] + c
-    AstFactory.binaryExpression(
-        expression, TokenType.PLUS, AstFactory.identifier3("c"));
+    AstTestFactory.binaryExpression(
+        expression, TokenType.PLUS, AstTestFactory.identifier3("c"));
     expect(expression.inGetterContext(), isTrue);
   }
 
   void test_inSetterContext_assignment_compound_left() {
-    IndexExpression expression = AstFactory.indexExpression(
-        AstFactory.identifier3("a"), AstFactory.identifier3("b"));
+    IndexExpression expression = AstTestFactory.indexExpression(
+        AstTestFactory.identifier3("a"), AstTestFactory.identifier3("b"));
     // a[b] += c
-    AstFactory.assignmentExpression(
-        expression, TokenType.PLUS_EQ, AstFactory.identifier3("c"));
+    AstTestFactory.assignmentExpression(
+        expression, TokenType.PLUS_EQ, AstTestFactory.identifier3("c"));
     expect(expression.inSetterContext(), isTrue);
   }
 
   void test_inSetterContext_assignment_compound_right() {
-    IndexExpression expression = AstFactory.indexExpression(
-        AstFactory.identifier3("a"), AstFactory.identifier3("b"));
+    IndexExpression expression = AstTestFactory.indexExpression(
+        AstTestFactory.identifier3("a"), AstTestFactory.identifier3("b"));
     // c += a[b]
-    AstFactory.assignmentExpression(
-        AstFactory.identifier3("c"), TokenType.PLUS_EQ, expression);
+    AstTestFactory.assignmentExpression(
+        AstTestFactory.identifier3("c"), TokenType.PLUS_EQ, expression);
     expect(expression.inSetterContext(), isFalse);
   }
 
   void test_inSetterContext_assignment_simple_left() {
-    IndexExpression expression = AstFactory.indexExpression(
-        AstFactory.identifier3("a"), AstFactory.identifier3("b"));
+    IndexExpression expression = AstTestFactory.indexExpression(
+        AstTestFactory.identifier3("a"), AstTestFactory.identifier3("b"));
     // a[b] = c
-    AstFactory.assignmentExpression(
-        expression, TokenType.EQ, AstFactory.identifier3("c"));
+    AstTestFactory.assignmentExpression(
+        expression, TokenType.EQ, AstTestFactory.identifier3("c"));
     expect(expression.inSetterContext(), isTrue);
   }
 
   void test_inSetterContext_assignment_simple_right() {
-    IndexExpression expression = AstFactory.indexExpression(
-        AstFactory.identifier3("a"), AstFactory.identifier3("b"));
+    IndexExpression expression = AstTestFactory.indexExpression(
+        AstTestFactory.identifier3("a"), AstTestFactory.identifier3("b"));
     // c = a[b]
-    AstFactory.assignmentExpression(
-        AstFactory.identifier3("c"), TokenType.EQ, expression);
+    AstTestFactory.assignmentExpression(
+        AstTestFactory.identifier3("c"), TokenType.EQ, expression);
     expect(expression.inSetterContext(), isFalse);
   }
 
   void test_inSetterContext_nonAssignment() {
-    IndexExpression expression = AstFactory.indexExpression(
-        AstFactory.identifier3("a"), AstFactory.identifier3("b"));
-    AstFactory.binaryExpression(
-        expression, TokenType.PLUS, AstFactory.identifier3("c"));
+    IndexExpression expression = AstTestFactory.indexExpression(
+        AstTestFactory.identifier3("a"), AstTestFactory.identifier3("b"));
+    AstTestFactory.binaryExpression(
+        expression, TokenType.PLUS, AstTestFactory.identifier3("c"));
     // a[b] + cc
     expect(expression.inSetterContext(), isFalse);
   }
 
   void test_inSetterContext_postfix() {
-    IndexExpression expression = AstFactory.indexExpression(
-        AstFactory.identifier3("a"), AstFactory.identifier3("b"));
-    AstFactory.postfixExpression(expression, TokenType.PLUS_PLUS);
+    IndexExpression expression = AstTestFactory.indexExpression(
+        AstTestFactory.identifier3("a"), AstTestFactory.identifier3("b"));
+    AstTestFactory.postfixExpression(expression, TokenType.PLUS_PLUS);
     // a[b]++
     expect(expression.inSetterContext(), isTrue);
   }
 
   void test_inSetterContext_prefix_bang() {
-    IndexExpression expression = AstFactory.indexExpression(
-        AstFactory.identifier3("a"), AstFactory.identifier3("b"));
+    IndexExpression expression = AstTestFactory.indexExpression(
+        AstTestFactory.identifier3("a"), AstTestFactory.identifier3("b"));
     // !a[b]
-    AstFactory.prefixExpression(TokenType.BANG, expression);
+    AstTestFactory.prefixExpression(TokenType.BANG, expression);
     expect(expression.inSetterContext(), isFalse);
   }
 
   void test_inSetterContext_prefix_minusMinus() {
-    IndexExpression expression = AstFactory.indexExpression(
-        AstFactory.identifier3("a"), AstFactory.identifier3("b"));
+    IndexExpression expression = AstTestFactory.indexExpression(
+        AstTestFactory.identifier3("a"), AstTestFactory.identifier3("b"));
     // --a[b]
-    AstFactory.prefixExpression(TokenType.MINUS_MINUS, expression);
+    AstTestFactory.prefixExpression(TokenType.MINUS_MINUS, expression);
     expect(expression.inSetterContext(), isTrue);
   }
 
   void test_inSetterContext_prefix_plusPlus() {
-    IndexExpression expression = AstFactory.indexExpression(
-        AstFactory.identifier3("a"), AstFactory.identifier3("b"));
+    IndexExpression expression = AstTestFactory.indexExpression(
+        AstTestFactory.identifier3("a"), AstTestFactory.identifier3("b"));
     // ++a[b]
-    AstFactory.prefixExpression(TokenType.PLUS_PLUS, expression);
+    AstTestFactory.prefixExpression(TokenType.PLUS_PLUS, expression);
     expect(expression.inSetterContext(), isTrue);
   }
 }
@@ -309,20 +325,20 @@
 class MethodDeclarationTest extends EngineTestCase {
   void test_firstTokenAfterCommentAndMetadata_external() {
     MethodDeclaration declaration =
-        AstFactory.methodDeclaration4(external: true, name: 'm');
+        AstTestFactory.methodDeclaration4(external: true, name: 'm');
     expect(declaration.firstTokenAfterCommentAndMetadata,
         declaration.externalKeyword);
   }
 
   void test_firstTokenAfterCommentAndMetadata_external_getter() {
-    MethodDeclaration declaration = AstFactory.methodDeclaration4(
+    MethodDeclaration declaration = AstTestFactory.methodDeclaration4(
         external: true, property: Keyword.GET, name: 'm');
     expect(declaration.firstTokenAfterCommentAndMetadata,
         declaration.externalKeyword);
   }
 
   void test_firstTokenAfterCommentAndMetadata_external_operator() {
-    MethodDeclaration declaration = AstFactory.methodDeclaration4(
+    MethodDeclaration declaration = AstTestFactory.methodDeclaration4(
         external: true, operator: true, name: 'm');
     expect(declaration.firstTokenAfterCommentAndMetadata,
         declaration.externalKeyword);
@@ -330,14 +346,14 @@
 
   void test_firstTokenAfterCommentAndMetadata_getter() {
     MethodDeclaration declaration =
-        AstFactory.methodDeclaration4(property: Keyword.GET, name: 'm');
+        AstTestFactory.methodDeclaration4(property: Keyword.GET, name: 'm');
     expect(declaration.firstTokenAfterCommentAndMetadata,
         declaration.propertyKeyword);
   }
 
   void test_firstTokenAfterCommentAndMetadata_operator() {
     MethodDeclaration declaration =
-        AstFactory.methodDeclaration4(operator: true, name: 'm');
+        AstTestFactory.methodDeclaration4(operator: true, name: 'm');
     expect(declaration.firstTokenAfterCommentAndMetadata,
         declaration.operatorKeyword);
   }
@@ -346,9 +362,9 @@
 @reflectiveTest
 class NodeListTest extends EngineTestCase {
   void test_add() {
-    AstNode parent = AstFactory.argumentList();
-    AstNode firstNode = AstFactory.booleanLiteral(true);
-    AstNode secondNode = AstFactory.booleanLiteral(false);
+    AstNode parent = AstTestFactory.argumentList();
+    AstNode firstNode = AstTestFactory.booleanLiteral(true);
+    AstNode secondNode = AstTestFactory.booleanLiteral(false);
     NodeList<AstNode> list = new NodeList<AstNode>(parent);
     list.insert(0, secondNode);
     list.insert(0, firstNode);
@@ -357,7 +373,7 @@
     expect(list[1], same(secondNode));
     expect(firstNode.parent, same(parent));
     expect(secondNode.parent, same(parent));
-    AstNode thirdNode = AstFactory.booleanLiteral(false);
+    AstNode thirdNode = AstTestFactory.booleanLiteral(false);
     list.insert(1, thirdNode);
     expect(list, hasLength(3));
     expect(list[0], same(firstNode));
@@ -369,9 +385,10 @@
   }
 
   void test_add_negative() {
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
+    NodeList<AstNode> list =
+        new NodeList<AstNode>(AstTestFactory.argumentList());
     try {
-      list.insert(-1, AstFactory.booleanLiteral(true));
+      list.insert(-1, AstTestFactory.booleanLiteral(true));
       fail("Expected IndexOutOfBoundsException");
     } on RangeError {
       // Expected
@@ -379,9 +396,10 @@
   }
 
   void test_add_tooBig() {
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
+    NodeList<AstNode> list =
+        new NodeList<AstNode>(AstTestFactory.argumentList());
     try {
-      list.insert(1, AstFactory.booleanLiteral(true));
+      list.insert(1, AstTestFactory.booleanLiteral(true));
       fail("Expected IndexOutOfBoundsException");
     } on RangeError {
       // Expected
@@ -389,10 +407,10 @@
   }
 
   void test_addAll() {
-    AstNode parent = AstFactory.argumentList();
+    AstNode parent = AstTestFactory.argumentList();
     List<AstNode> firstNodes = new List<AstNode>();
-    AstNode firstNode = AstFactory.booleanLiteral(true);
-    AstNode secondNode = AstFactory.booleanLiteral(false);
+    AstNode firstNode = AstTestFactory.booleanLiteral(true);
+    AstNode secondNode = AstTestFactory.booleanLiteral(false);
     firstNodes.add(firstNode);
     firstNodes.add(secondNode);
     NodeList<AstNode> list = new NodeList<AstNode>(parent);
@@ -403,8 +421,8 @@
     expect(firstNode.parent, same(parent));
     expect(secondNode.parent, same(parent));
     List<AstNode> secondNodes = new List<AstNode>();
-    AstNode thirdNode = AstFactory.booleanLiteral(true);
-    AstNode fourthNode = AstFactory.booleanLiteral(false);
+    AstNode thirdNode = AstTestFactory.booleanLiteral(true);
+    AstNode fourthNode = AstTestFactory.booleanLiteral(false);
     secondNodes.add(thirdNode);
     secondNodes.add(fourthNode);
     list.addAll(secondNodes);
@@ -420,7 +438,7 @@
   }
 
   void test_creation() {
-    AstNode owner = AstFactory.argumentList();
+    AstNode owner = AstTestFactory.argumentList();
     NodeList<AstNode> list = new NodeList<AstNode>(owner);
     expect(list, isNotNull);
     expect(list, hasLength(0));
@@ -428,7 +446,8 @@
   }
 
   void test_get_negative() {
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
+    NodeList<AstNode> list =
+        new NodeList<AstNode>(AstTestFactory.argumentList());
     try {
       list[-1];
       fail("Expected IndexOutOfBoundsException");
@@ -438,7 +457,8 @@
   }
 
   void test_get_tooBig() {
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
+    NodeList<AstNode> list =
+        new NodeList<AstNode>(AstTestFactory.argumentList());
     try {
       list[1];
       fail("Expected IndexOutOfBoundsException");
@@ -448,41 +468,46 @@
   }
 
   void test_getBeginToken_empty() {
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
+    NodeList<AstNode> list =
+        new NodeList<AstNode>(AstTestFactory.argumentList());
     expect(list.beginToken, isNull);
   }
 
   void test_getBeginToken_nonEmpty() {
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
-    AstNode node =
-        AstFactory.parenthesizedExpression(AstFactory.booleanLiteral(true));
+    NodeList<AstNode> list =
+        new NodeList<AstNode>(AstTestFactory.argumentList());
+    AstNode node = AstTestFactory
+        .parenthesizedExpression(AstTestFactory.booleanLiteral(true));
     list.add(node);
     expect(list.beginToken, same(node.beginToken));
   }
 
   void test_getEndToken_empty() {
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
+    NodeList<AstNode> list =
+        new NodeList<AstNode>(AstTestFactory.argumentList());
     expect(list.endToken, isNull);
   }
 
   void test_getEndToken_nonEmpty() {
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
-    AstNode node =
-        AstFactory.parenthesizedExpression(AstFactory.booleanLiteral(true));
+    NodeList<AstNode> list =
+        new NodeList<AstNode>(AstTestFactory.argumentList());
+    AstNode node = AstTestFactory
+        .parenthesizedExpression(AstTestFactory.booleanLiteral(true));
     list.add(node);
     expect(list.endToken, same(node.endToken));
   }
 
   void test_indexOf() {
     List<AstNode> nodes = new List<AstNode>();
-    AstNode firstNode = AstFactory.booleanLiteral(true);
-    AstNode secondNode = AstFactory.booleanLiteral(false);
-    AstNode thirdNode = AstFactory.booleanLiteral(true);
-    AstNode fourthNode = AstFactory.booleanLiteral(false);
+    AstNode firstNode = AstTestFactory.booleanLiteral(true);
+    AstNode secondNode = AstTestFactory.booleanLiteral(false);
+    AstNode thirdNode = AstTestFactory.booleanLiteral(true);
+    AstNode fourthNode = AstTestFactory.booleanLiteral(false);
     nodes.add(firstNode);
     nodes.add(secondNode);
     nodes.add(thirdNode);
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
+    NodeList<AstNode> list =
+        new NodeList<AstNode>(AstTestFactory.argumentList());
     list.addAll(nodes);
     expect(list, hasLength(3));
     expect(list.indexOf(firstNode), 0);
@@ -494,13 +519,14 @@
 
   void test_remove() {
     List<AstNode> nodes = new List<AstNode>();
-    AstNode firstNode = AstFactory.booleanLiteral(true);
-    AstNode secondNode = AstFactory.booleanLiteral(false);
-    AstNode thirdNode = AstFactory.booleanLiteral(true);
+    AstNode firstNode = AstTestFactory.booleanLiteral(true);
+    AstNode secondNode = AstTestFactory.booleanLiteral(false);
+    AstNode thirdNode = AstTestFactory.booleanLiteral(true);
     nodes.add(firstNode);
     nodes.add(secondNode);
     nodes.add(thirdNode);
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
+    NodeList<AstNode> list =
+        new NodeList<AstNode>(AstTestFactory.argumentList());
     list.addAll(nodes);
     expect(list, hasLength(3));
     expect(list.removeAt(1), same(secondNode));
@@ -510,7 +536,8 @@
   }
 
   void test_remove_negative() {
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
+    NodeList<AstNode> list =
+        new NodeList<AstNode>(AstTestFactory.argumentList());
     try {
       list.removeAt(-1);
       fail("Expected IndexOutOfBoundsException");
@@ -520,7 +547,8 @@
   }
 
   void test_remove_tooBig() {
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
+    NodeList<AstNode> list =
+        new NodeList<AstNode>(AstTestFactory.argumentList());
     try {
       list.removeAt(1);
       fail("Expected IndexOutOfBoundsException");
@@ -531,16 +559,17 @@
 
   void test_set() {
     List<AstNode> nodes = new List<AstNode>();
-    AstNode firstNode = AstFactory.booleanLiteral(true);
-    AstNode secondNode = AstFactory.booleanLiteral(false);
-    AstNode thirdNode = AstFactory.booleanLiteral(true);
+    AstNode firstNode = AstTestFactory.booleanLiteral(true);
+    AstNode secondNode = AstTestFactory.booleanLiteral(false);
+    AstNode thirdNode = AstTestFactory.booleanLiteral(true);
     nodes.add(firstNode);
     nodes.add(secondNode);
     nodes.add(thirdNode);
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
+    NodeList<AstNode> list =
+        new NodeList<AstNode>(AstTestFactory.argumentList());
     list.addAll(nodes);
     expect(list, hasLength(3));
-    AstNode fourthNode = AstFactory.integer(0);
+    AstNode fourthNode = AstTestFactory.integer(0);
     list[1] = fourthNode;
     expect(list, hasLength(3));
     expect(list[0], same(firstNode));
@@ -549,8 +578,9 @@
   }
 
   void test_set_negative() {
-    AstNode node = AstFactory.booleanLiteral(true);
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
+    AstNode node = AstTestFactory.booleanLiteral(true);
+    NodeList<AstNode> list =
+        new NodeList<AstNode>(AstTestFactory.argumentList());
     try {
       list[-1] = node;
       fail("Expected IndexOutOfBoundsException");
@@ -560,8 +590,9 @@
   }
 
   void test_set_tooBig() {
-    AstNode node = AstFactory.booleanLiteral(true);
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
+    AstNode node = AstTestFactory.booleanLiteral(true);
+    NodeList<AstNode> list =
+        new NodeList<AstNode>(AstTestFactory.argumentList());
     try {
       list[1] = node;
       fail("Expected IndexOutOfBoundsException");
@@ -593,24 +624,24 @@
   }
 
   void test_inGetterContext_constructorFieldInitializer() {
-    ConstructorFieldInitializer initializer = AstFactory
-        .constructorFieldInitializer(false, 'f', AstFactory.integer(0));
+    ConstructorFieldInitializer initializer = AstTestFactory
+        .constructorFieldInitializer(false, 'f', AstTestFactory.integer(0));
     SimpleIdentifier identifier = initializer.fieldName;
     expect(identifier.inGetterContext(), isFalse);
   }
 
   void test_inGetterContext_forEachLoop() {
-    SimpleIdentifier identifier = AstFactory.identifier3("a");
-    Expression iterator = AstFactory.listLiteral();
-    Statement body = AstFactory.block();
-    AstFactory.forEachStatement2(identifier, iterator, body);
+    SimpleIdentifier identifier = AstTestFactory.identifier3("a");
+    Expression iterator = AstTestFactory.listLiteral();
+    Statement body = AstTestFactory.block();
+    AstTestFactory.forEachStatement2(identifier, iterator, body);
     expect(identifier.inGetterContext(), isFalse);
   }
 
   void test_inReferenceContext() {
-    SimpleIdentifier identifier = AstFactory.identifier3("id");
-    AstFactory.namedExpression(
-        AstFactory.label(identifier), AstFactory.identifier3("_"));
+    SimpleIdentifier identifier = AstTestFactory.identifier3("id");
+    AstTestFactory.namedExpression(
+        AstTestFactory.label(identifier), AstTestFactory.identifier3("_"));
     expect(identifier.inGetterContext(), isFalse);
     expect(identifier.inSetterContext(), isFalse);
   }
@@ -639,102 +670,104 @@
   }
 
   void test_inSetterContext_forEachLoop() {
-    SimpleIdentifier identifier = AstFactory.identifier3("a");
-    Expression iterator = AstFactory.listLiteral();
-    Statement body = AstFactory.block();
-    AstFactory.forEachStatement2(identifier, iterator, body);
+    SimpleIdentifier identifier = AstTestFactory.identifier3("a");
+    Expression iterator = AstTestFactory.listLiteral();
+    Statement body = AstTestFactory.block();
+    AstTestFactory.forEachStatement2(identifier, iterator, body);
     expect(identifier.inSetterContext(), isTrue);
   }
 
   void test_isQualified_inMethodInvocation_noTarget() {
-    MethodInvocation invocation =
-        AstFactory.methodInvocation2("test", [AstFactory.identifier3("arg0")]);
+    MethodInvocation invocation = AstTestFactory
+        .methodInvocation2("test", [AstTestFactory.identifier3("arg0")]);
     SimpleIdentifier identifier = invocation.methodName;
     expect(identifier.isQualified, isFalse);
   }
 
   void test_isQualified_inMethodInvocation_withTarget() {
-    MethodInvocation invocation = AstFactory.methodInvocation(
-        AstFactory.identifier3("target"),
+    MethodInvocation invocation = AstTestFactory.methodInvocation(
+        AstTestFactory.identifier3("target"),
         "test",
-        [AstFactory.identifier3("arg0")]);
+        [AstTestFactory.identifier3("arg0")]);
     SimpleIdentifier identifier = invocation.methodName;
     expect(identifier.isQualified, isTrue);
   }
 
   void test_isQualified_inPrefixedIdentifier_name() {
-    SimpleIdentifier identifier = AstFactory.identifier3("test");
-    AstFactory.identifier4("prefix", identifier);
+    SimpleIdentifier identifier = AstTestFactory.identifier3("test");
+    AstTestFactory.identifier4("prefix", identifier);
     expect(identifier.isQualified, isTrue);
   }
 
   void test_isQualified_inPrefixedIdentifier_prefix() {
-    SimpleIdentifier identifier = AstFactory.identifier3("test");
-    AstFactory.identifier(identifier, AstFactory.identifier3("name"));
+    SimpleIdentifier identifier = AstTestFactory.identifier3("test");
+    AstTestFactory.identifier(identifier, AstTestFactory.identifier3("name"));
     expect(identifier.isQualified, isFalse);
   }
 
   void test_isQualified_inPropertyAccess_name() {
-    SimpleIdentifier identifier = AstFactory.identifier3("test");
-    AstFactory.propertyAccess(AstFactory.identifier3("target"), identifier);
+    SimpleIdentifier identifier = AstTestFactory.identifier3("test");
+    AstTestFactory.propertyAccess(
+        AstTestFactory.identifier3("target"), identifier);
     expect(identifier.isQualified, isTrue);
   }
 
   void test_isQualified_inPropertyAccess_target() {
-    SimpleIdentifier identifier = AstFactory.identifier3("test");
-    AstFactory.propertyAccess(identifier, AstFactory.identifier3("name"));
+    SimpleIdentifier identifier = AstTestFactory.identifier3("test");
+    AstTestFactory.propertyAccess(
+        identifier, AstTestFactory.identifier3("name"));
     expect(identifier.isQualified, isFalse);
   }
 
   void test_isQualified_inReturnStatement() {
-    SimpleIdentifier identifier = AstFactory.identifier3("test");
-    AstFactory.returnStatement2(identifier);
+    SimpleIdentifier identifier = AstTestFactory.identifier3("test");
+    AstTestFactory.returnStatement2(identifier);
     expect(identifier.isQualified, isFalse);
   }
 
   SimpleIdentifier _createIdentifier(
       _WrapperKind wrapper, _AssignmentKind assignment) {
-    SimpleIdentifier identifier = AstFactory.identifier3("a");
+    SimpleIdentifier identifier = AstTestFactory.identifier3("a");
     Expression expression = identifier;
     while (true) {
       if (wrapper == _WrapperKind.PREFIXED_LEFT) {
-        expression =
-            AstFactory.identifier(identifier, AstFactory.identifier3("_"));
+        expression = AstTestFactory.identifier(
+            identifier, AstTestFactory.identifier3("_"));
       } else if (wrapper == _WrapperKind.PREFIXED_RIGHT) {
-        expression =
-            AstFactory.identifier(AstFactory.identifier3("_"), identifier);
+        expression = AstTestFactory.identifier(
+            AstTestFactory.identifier3("_"), identifier);
       } else if (wrapper == _WrapperKind.PROPERTY_LEFT) {
-        expression = AstFactory.propertyAccess2(expression, "_");
+        expression = AstTestFactory.propertyAccess2(expression, "_");
       } else if (wrapper == _WrapperKind.PROPERTY_RIGHT) {
-        expression =
-            AstFactory.propertyAccess(AstFactory.identifier3("_"), identifier);
+        expression = AstTestFactory.propertyAccess(
+            AstTestFactory.identifier3("_"), identifier);
       } else if (wrapper == _WrapperKind.NONE) {}
       break;
     }
     while (true) {
       if (assignment == _AssignmentKind.BINARY) {
-        AstFactory.binaryExpression(
-            expression, TokenType.PLUS, AstFactory.identifier3("_"));
+        AstTestFactory.binaryExpression(
+            expression, TokenType.PLUS, AstTestFactory.identifier3("_"));
       } else if (assignment == _AssignmentKind.COMPOUND_LEFT) {
-        AstFactory.assignmentExpression(
-            expression, TokenType.PLUS_EQ, AstFactory.identifier3("_"));
+        AstTestFactory.assignmentExpression(
+            expression, TokenType.PLUS_EQ, AstTestFactory.identifier3("_"));
       } else if (assignment == _AssignmentKind.COMPOUND_RIGHT) {
-        AstFactory.assignmentExpression(
-            AstFactory.identifier3("_"), TokenType.PLUS_EQ, expression);
+        AstTestFactory.assignmentExpression(
+            AstTestFactory.identifier3("_"), TokenType.PLUS_EQ, expression);
       } else if (assignment == _AssignmentKind.POSTFIX_INC) {
-        AstFactory.postfixExpression(expression, TokenType.PLUS_PLUS);
+        AstTestFactory.postfixExpression(expression, TokenType.PLUS_PLUS);
       } else if (assignment == _AssignmentKind.PREFIX_DEC) {
-        AstFactory.prefixExpression(TokenType.MINUS_MINUS, expression);
+        AstTestFactory.prefixExpression(TokenType.MINUS_MINUS, expression);
       } else if (assignment == _AssignmentKind.PREFIX_INC) {
-        AstFactory.prefixExpression(TokenType.PLUS_PLUS, expression);
+        AstTestFactory.prefixExpression(TokenType.PLUS_PLUS, expression);
       } else if (assignment == _AssignmentKind.PREFIX_NOT) {
-        AstFactory.prefixExpression(TokenType.BANG, expression);
+        AstTestFactory.prefixExpression(TokenType.BANG, expression);
       } else if (assignment == _AssignmentKind.SIMPLE_LEFT) {
-        AstFactory.assignmentExpression(
-            expression, TokenType.EQ, AstFactory.identifier3("_"));
+        AstTestFactory.assignmentExpression(
+            expression, TokenType.EQ, AstTestFactory.identifier3("_"));
       } else if (assignment == _AssignmentKind.SIMPLE_RIGHT) {
-        AstFactory.assignmentExpression(
-            AstFactory.identifier3("_"), TokenType.EQ, expression);
+        AstTestFactory.assignmentExpression(
+            AstTestFactory.identifier3("_"), TokenType.EQ, expression);
       } else if (assignment == _AssignmentKind.NONE) {}
       break;
     }
@@ -996,128 +1029,130 @@
 @reflectiveTest
 class StringInterpolationTest extends ParserTestCase {
   void test_contentsOffsetEnd() {
-    AstFactory.interpolationExpression(AstFactory.identifier3('bb'));
+    AstTestFactory.interpolationExpression(AstTestFactory.identifier3('bb'));
     // 'a${bb}ccc'
     {
-      var ae = AstFactory.interpolationString("'a", "a");
+      var ae = AstTestFactory.interpolationString("'a", "a");
       var cToken = new StringToken(TokenType.STRING, "ccc'", 10);
       var cElement = new InterpolationString(cToken, 'ccc');
-      StringInterpolation node = AstFactory.string([ae, ae, cElement]);
+      StringInterpolation node = AstTestFactory.string([ae, ae, cElement]);
       expect(node.contentsOffset, 1);
       expect(node.contentsEnd, 10 + 4 - 1);
     }
     // '''a${bb}ccc'''
     {
-      var ae = AstFactory.interpolationString("'''a", "a");
+      var ae = AstTestFactory.interpolationString("'''a", "a");
       var cToken = new StringToken(TokenType.STRING, "ccc'''", 10);
       var cElement = new InterpolationString(cToken, 'ccc');
-      StringInterpolation node = AstFactory.string([ae, ae, cElement]);
+      StringInterpolation node = AstTestFactory.string([ae, ae, cElement]);
       expect(node.contentsOffset, 3);
       expect(node.contentsEnd, 10 + 4 - 1);
     }
     // """a${bb}ccc"""
     {
-      var ae = AstFactory.interpolationString('"""a', "a");
+      var ae = AstTestFactory.interpolationString('"""a', "a");
       var cToken = new StringToken(TokenType.STRING, 'ccc"""', 10);
       var cElement = new InterpolationString(cToken, 'ccc');
-      StringInterpolation node = AstFactory.string([ae, ae, cElement]);
+      StringInterpolation node = AstTestFactory.string([ae, ae, cElement]);
       expect(node.contentsOffset, 3);
       expect(node.contentsEnd, 10 + 4 - 1);
     }
     // r'a${bb}ccc'
     {
-      var ae = AstFactory.interpolationString("r'a", "a");
+      var ae = AstTestFactory.interpolationString("r'a", "a");
       var cToken = new StringToken(TokenType.STRING, "ccc'", 10);
       var cElement = new InterpolationString(cToken, 'ccc');
-      StringInterpolation node = AstFactory.string([ae, ae, cElement]);
+      StringInterpolation node = AstTestFactory.string([ae, ae, cElement]);
       expect(node.contentsOffset, 2);
       expect(node.contentsEnd, 10 + 4 - 1);
     }
     // r'''a${bb}ccc'''
     {
-      var ae = AstFactory.interpolationString("r'''a", "a");
+      var ae = AstTestFactory.interpolationString("r'''a", "a");
       var cToken = new StringToken(TokenType.STRING, "ccc'''", 10);
       var cElement = new InterpolationString(cToken, 'ccc');
-      StringInterpolation node = AstFactory.string([ae, ae, cElement]);
+      StringInterpolation node = AstTestFactory.string([ae, ae, cElement]);
       expect(node.contentsOffset, 4);
       expect(node.contentsEnd, 10 + 4 - 1);
     }
     // r"""a${bb}ccc"""
     {
-      var ae = AstFactory.interpolationString('r"""a', "a");
+      var ae = AstTestFactory.interpolationString('r"""a', "a");
       var cToken = new StringToken(TokenType.STRING, 'ccc"""', 10);
       var cElement = new InterpolationString(cToken, 'ccc');
-      StringInterpolation node = AstFactory.string([ae, ae, cElement]);
+      StringInterpolation node = AstTestFactory.string([ae, ae, cElement]);
       expect(node.contentsOffset, 4);
       expect(node.contentsEnd, 10 + 4 - 1);
     }
   }
 
   void test_isMultiline() {
-    var b = AstFactory.interpolationExpression(AstFactory.identifier3('bb'));
+    var b = AstTestFactory
+        .interpolationExpression(AstTestFactory.identifier3('bb'));
     // '
     {
-      var a = AstFactory.interpolationString("'a", "a");
-      var c = AstFactory.interpolationString("ccc'", "ccc");
-      StringInterpolation node = AstFactory.string([a, b, c]);
+      var a = AstTestFactory.interpolationString("'a", "a");
+      var c = AstTestFactory.interpolationString("ccc'", "ccc");
+      StringInterpolation node = AstTestFactory.string([a, b, c]);
       expect(node.isMultiline, isFalse);
     }
     // '''
     {
-      var a = AstFactory.interpolationString("'''a", "a");
-      var c = AstFactory.interpolationString("ccc'''", "ccc");
-      StringInterpolation node = AstFactory.string([a, b, c]);
+      var a = AstTestFactory.interpolationString("'''a", "a");
+      var c = AstTestFactory.interpolationString("ccc'''", "ccc");
+      StringInterpolation node = AstTestFactory.string([a, b, c]);
       expect(node.isMultiline, isTrue);
     }
     // "
     {
-      var a = AstFactory.interpolationString('"a', "a");
-      var c = AstFactory.interpolationString('ccc"', "ccc");
-      StringInterpolation node = AstFactory.string([a, b, c]);
+      var a = AstTestFactory.interpolationString('"a', "a");
+      var c = AstTestFactory.interpolationString('ccc"', "ccc");
+      StringInterpolation node = AstTestFactory.string([a, b, c]);
       expect(node.isMultiline, isFalse);
     }
     // """
     {
-      var a = AstFactory.interpolationString('"""a', "a");
-      var c = AstFactory.interpolationString('ccc"""', "ccc");
-      StringInterpolation node = AstFactory.string([a, b, c]);
+      var a = AstTestFactory.interpolationString('"""a', "a");
+      var c = AstTestFactory.interpolationString('ccc"""', "ccc");
+      StringInterpolation node = AstTestFactory.string([a, b, c]);
       expect(node.isMultiline, isTrue);
     }
   }
 
   void test_isRaw() {
-    StringInterpolation node = AstFactory.string();
+    StringInterpolation node = AstTestFactory.string();
     expect(node.isRaw, isFalse);
   }
 
   void test_isSingleQuoted() {
-    var b = AstFactory.interpolationExpression(AstFactory.identifier3('bb'));
+    var b = AstTestFactory
+        .interpolationExpression(AstTestFactory.identifier3('bb'));
     // "
     {
-      var a = AstFactory.interpolationString('"a', "a");
-      var c = AstFactory.interpolationString('ccc"', "ccc");
-      StringInterpolation node = AstFactory.string([a, b, c]);
+      var a = AstTestFactory.interpolationString('"a', "a");
+      var c = AstTestFactory.interpolationString('ccc"', "ccc");
+      StringInterpolation node = AstTestFactory.string([a, b, c]);
       expect(node.isSingleQuoted, isFalse);
     }
     // """
     {
-      var a = AstFactory.interpolationString('"""a', "a");
-      var c = AstFactory.interpolationString('ccc"""', "ccc");
-      StringInterpolation node = AstFactory.string([a, b, c]);
+      var a = AstTestFactory.interpolationString('"""a', "a");
+      var c = AstTestFactory.interpolationString('ccc"""', "ccc");
+      StringInterpolation node = AstTestFactory.string([a, b, c]);
       expect(node.isSingleQuoted, isFalse);
     }
     // '
     {
-      var a = AstFactory.interpolationString("'a", "a");
-      var c = AstFactory.interpolationString("ccc'", "ccc");
-      StringInterpolation node = AstFactory.string([a, b, c]);
+      var a = AstTestFactory.interpolationString("'a", "a");
+      var c = AstTestFactory.interpolationString("ccc'", "ccc");
+      StringInterpolation node = AstTestFactory.string([a, b, c]);
       expect(node.isSingleQuoted, isTrue);
     }
     // '''
     {
-      var a = AstFactory.interpolationString("'''a", "a");
-      var c = AstFactory.interpolationString("ccc'''", "ccc");
-      StringInterpolation node = AstFactory.string([a, b, c]);
+      var a = AstTestFactory.interpolationString("'''a", "a");
+      var c = AstTestFactory.interpolationString("ccc'''", "ccc");
+      StringInterpolation node = AstTestFactory.string([a, b, c]);
       expect(node.isSingleQuoted, isTrue);
     }
   }
@@ -1126,9 +1161,9 @@
 @reflectiveTest
 class VariableDeclarationTest extends ParserTestCase {
   void test_getDocumentationComment_onGrandParent() {
-    VariableDeclaration varDecl = AstFactory.variableDeclaration("a");
+    VariableDeclaration varDecl = AstTestFactory.variableDeclaration("a");
     TopLevelVariableDeclaration decl =
-        AstFactory.topLevelVariableDeclaration2(Keyword.VAR, [varDecl]);
+        AstTestFactory.topLevelVariableDeclaration2(Keyword.VAR, [varDecl]);
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     expect(varDecl.documentationComment, isNull);
     decl.documentationComment = comment;
@@ -1137,7 +1172,7 @@
   }
 
   void test_getDocumentationComment_onNode() {
-    VariableDeclaration decl = AstFactory.variableDeclaration("a");
+    VariableDeclaration decl = AstTestFactory.variableDeclaration("a");
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     decl.documentationComment = comment;
     expect(decl.documentationComment, isNotNull);
diff --git a/pkg/analyzer/test/dart/ast/test_all.dart b/pkg/analyzer/test/dart/ast/test_all.dart
index 64f8170..4babcdf 100644
--- a/pkg/analyzer/test/dart/ast/test_all.dart
+++ b/pkg/analyzer/test/dart/ast/test_all.dart
@@ -4,17 +4,15 @@
 
 library analyzer.test.dart.ast.test_all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
 import 'ast_test.dart' as ast;
 import 'visitor_test.dart' as visitor;
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('ast tests', () {
+  defineReflectiveSuite(() {
     ast.main();
     visitor.main();
-  });
+  }, name: 'ast');
 }
diff --git a/pkg/analyzer/test/dart/ast/visitor_test.dart b/pkg/analyzer/test/dart/ast/visitor_test.dart
index 45ba196..5c7d14f 100644
--- a/pkg/analyzer/test/dart/ast/visitor_test.dart
+++ b/pkg/analyzer/test/dart/ast/visitor_test.dart
@@ -6,16 +6,16 @@
 
 import 'package:analyzer/dart/ast/ast.dart';
 import 'package:analyzer/dart/ast/visitor.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../generated/parser_test.dart' show ParserTestCase;
 import '../../generated/test_support.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(BreadthFirstVisitorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(BreadthFirstVisitorTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/dart/element/builder_test.dart b/pkg/analyzer/test/dart/element/builder_test.dart
new file mode 100644
index 0000000..c9b22c9
--- /dev/null
+++ b/pkg/analyzer/test/dart/element/builder_test.dart
@@ -0,0 +1,2493 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analyzer.test.dart.element.builder_test;
+
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/ast/token.dart';
+import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer/src/dart/ast/ast.dart';
+import 'package:analyzer/src/dart/element/builder.dart';
+import 'package:analyzer/src/dart/element/element.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/resolver.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
+import 'package:analyzer/src/generated/testing/element_factory.dart';
+import 'package:analyzer/src/generated/testing/token_factory.dart';
+import 'package:analyzer/src/generated/utilities_dart.dart';
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import '../../generated/parser_test.dart';
+import '../../generated/test_support.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ApiElementBuilderTest);
+    defineReflectiveTests(ElementBuilderTest);
+    defineReflectiveTests(LocalElementBuilderTest);
+  });
+}
+
+@reflectiveTest
+class ApiElementBuilderTest extends _BaseTest with _ApiElementBuilderTestMixin {
+  @override
+  AstVisitor createElementBuilder(ElementHolder holder) {
+    return new ApiElementBuilder(holder, compilationUnitElement);
+  }
+
+  void test_api_class_field() {
+    List<FieldElement> fields = buildElementsForText(r'''
+class C {
+  var a = 42;
+  var b = () {
+    int v = 0;
+    localFunction() {}
+  };
+}
+''').types[0].fields;
+    expect(fields, hasLength(2));
+    {
+      FieldElement a = fields[0];
+      expect(a.displayName, 'a');
+      expect(a.initializer, isNull);
+    }
+    {
+      FieldElement b = fields[1];
+      expect(b.displayName, 'b');
+      expect(b.initializer, isNull);
+    }
+  }
+
+  void test_api_class_method_blockBody() {
+    MethodElement method = buildElementsForText(r'''
+class C {
+  void m(int a, {int b: 42}) {
+    int v = 0;
+    localFunction() {}
+  }
+}
+''').types[0].methods[0];
+    {
+      expect(method.parameters, hasLength(2));
+      expect(method.parameters[0].displayName, 'a');
+      expect(method.parameters[0].initializer, isNull);
+      expect(method.parameters[1].displayName, 'b');
+      expect(method.parameters[1].initializer, isNull);
+    }
+    expect(method.localVariables, isEmpty);
+    expect(method.functions, isEmpty);
+  }
+
+  void test_api_topLevelFunction_blockBody() {
+    FunctionElement function = buildElementsForText(r'''
+void topLevelFunction() {
+  int v = 0;
+  localFunction() {}
+}
+''').functions[0];
+    expect(function.localVariables, isEmpty);
+    expect(function.functions, isEmpty);
+  }
+
+  void test_api_topLevelFunction_expressionBody() {
+    FunctionElement function = buildElementsForText(r'''
+topLevelFunction() => () {
+  int localVar = 0;
+};
+''').functions[0];
+    expect(function.localVariables, isEmpty);
+    expect(function.functions, isEmpty);
+  }
+
+  void test_api_topLevelFunction_parameters() {
+    FunctionElement function = buildElementsForText(r'''
+void topLevelFunction(int a, int b(double b2), {c: () {int c2; c3() {} }}) {
+}
+''').functions[0];
+    List<ParameterElement> parameters = function.parameters;
+    expect(parameters, hasLength(3));
+    {
+      ParameterElement a = parameters[0];
+      expect(a.displayName, 'a');
+      expect(a.initializer, isNull);
+    }
+    {
+      ParameterElement b = parameters[1];
+      expect(b.displayName, 'b');
+      expect(b.initializer, isNull);
+      expect(b.parameters, hasLength(1));
+      expect(b.parameters[0].displayName, 'b2');
+    }
+    {
+      var c = parameters[2] as DefaultParameterElementImpl;
+      expect(c.displayName, 'c');
+      expect(c.initializer, isNull);
+    }
+  }
+
+  void test_api_topLevelVariable() {
+    List<TopLevelVariableElement> variables = buildElementsForText(r'''
+var A = 42;
+var B = () {
+  int v = 0;
+  localFunction(int _) {}
+};
+''').topLevelVariables;
+    expect(variables, hasLength(2));
+    {
+      TopLevelVariableElement a = variables[0];
+      expect(a.displayName, 'A');
+      expect(a.initializer, isNull);
+    }
+    {
+      TopLevelVariableElement b = variables[1];
+      expect(b.displayName, 'B');
+      expect(b.initializer, isNull);
+    }
+  }
+}
+
+@reflectiveTest
+class ElementBuilderTest extends _BaseTest with _ApiElementBuilderTestMixin {
+  /**
+   * Parse the given [code], pass it through [ElementBuilder], and return the
+   * resulting [ElementHolder].
+   */
+  ElementHolder buildElementsForText(String code) {
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = new ElementBuilder(holder, compilationUnitElement);
+    _visitAstOfCode(code, builder);
+    return holder;
+  }
+
+  AstVisitor createElementBuilder(ElementHolder holder) {
+    return new ElementBuilder(holder, compilationUnitElement);
+  }
+
+  void fail_visitMethodDeclaration_setter_duplicate() {
+    // https://github.com/dart-lang/sdk/issues/25601
+    String code = r'''
+class C {
+  set zzz(x) {}
+  set zzz(y) {}
+}
+''';
+    ClassElement classElement = buildElementsForText(code).types[0];
+    for (PropertyAccessorElement accessor in classElement.accessors) {
+      expect(accessor.variable.setter, same(accessor));
+    }
+  }
+
+  @override
+  void setUp() {
+    super.setUp();
+    compilationUnitElement = new CompilationUnitElementImpl('test.dart');
+  }
+
+  void test_metadata_localVariableDeclaration() {
+    List<LocalVariableElement> localVariables =
+        buildElementsForText('f() { @a int x, y; }')
+            .functions[0]
+            .localVariables;
+    checkMetadata(localVariables[0]);
+    checkMetadata(localVariables[1]);
+    expect(localVariables[0].metadata, same(localVariables[1].metadata));
+  }
+
+  void test_metadata_visitDeclaredIdentifier() {
+    LocalVariableElement localVariableElement =
+        buildElementsForText('f() { for (@a var x in y) {} }')
+            .functions[0]
+            .localVariables[0];
+    checkMetadata(localVariableElement);
+  }
+
+  void test_visitCatchClause() {
+    List<LocalVariableElement> variables =
+        buildElementsForText('f() { try {} catch (e, s) {} }')
+            .functions[0]
+            .localVariables;
+    String exceptionParameterName = "e";
+    String stackParameterName = "s";
+    expect(variables, hasLength(2));
+
+    LocalVariableElement exceptionVariable = variables[0];
+    expect(exceptionVariable, isNotNull);
+    expect(exceptionVariable.name, exceptionParameterName);
+    expect(exceptionVariable.hasImplicitType, isTrue);
+    expect(exceptionVariable.isSynthetic, isFalse);
+    expect(exceptionVariable.isConst, isFalse);
+    expect(exceptionVariable.isFinal, isFalse);
+    expect(exceptionVariable.initializer, isNull);
+    _assertVisibleRange(exceptionVariable, 13, 28);
+
+    LocalVariableElement stackVariable = variables[1];
+    expect(stackVariable, isNotNull);
+    expect(stackVariable.name, stackParameterName);
+    expect(stackVariable.isSynthetic, isFalse);
+    expect(stackVariable.isConst, isFalse);
+    expect(stackVariable.isFinal, isFalse);
+    expect(stackVariable.initializer, isNull);
+    _assertVisibleRange(stackVariable, 13, 28);
+  }
+
+  void test_visitCatchClause_withType() {
+    List<LocalVariableElement> variables =
+        buildElementsForText('f() { try {} on E catch (e) {} }')
+            .functions[0]
+            .localVariables;
+    String exceptionParameterName = "e";
+    expect(variables, hasLength(1));
+    VariableElement exceptionVariable = variables[0];
+    expect(exceptionVariable, isNotNull);
+    expect(exceptionVariable.name, exceptionParameterName);
+    expect(exceptionVariable.hasImplicitType, isFalse);
+  }
+
+  void test_visitCompilationUnit_codeRange() {
+    TopLevelVariableDeclaration topLevelVariableDeclaration = AstTestFactory
+        .topLevelVariableDeclaration(null, AstTestFactory.typeName4('int'),
+            [AstTestFactory.variableDeclaration('V')]);
+    CompilationUnit unit = new CompilationUnit(
+        topLevelVariableDeclaration.beginToken,
+        null,
+        [],
+        [topLevelVariableDeclaration],
+        topLevelVariableDeclaration.endToken);
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = _makeBuilder(holder);
+    unit.beginToken.offset = 10;
+    unit.endToken.offset = 40;
+    unit.accept(builder);
+
+    assertHasCodeRange(compilationUnitElement, 0, 41);
+  }
+
+  void test_visitDeclaredIdentifier_noType() {
+    LocalVariableElement variable =
+        buildElementsForText('f() { for (var i in []) {} }')
+            .functions[0]
+            .localVariables[0];
+    assertHasCodeRange(variable, 11, 5);
+    expect(variable, isNotNull);
+    expect(variable.hasImplicitType, isTrue);
+    expect(variable.isConst, isFalse);
+    expect(variable.isDeprecated, isFalse);
+    expect(variable.isFinal, isFalse);
+    expect(variable.isOverride, isFalse);
+    expect(variable.isPrivate, isFalse);
+    expect(variable.isPublic, isTrue);
+    expect(variable.isSynthetic, isFalse);
+    expect(variable.name, 'i');
+  }
+
+  void test_visitDeclaredIdentifier_type() {
+    LocalVariableElement variable =
+        buildElementsForText('f() { for (int i in []) {} }')
+            .functions[0]
+            .localVariables[0];
+    assertHasCodeRange(variable, 11, 5);
+    expect(variable.hasImplicitType, isFalse);
+    expect(variable.isConst, isFalse);
+    expect(variable.isDeprecated, isFalse);
+    expect(variable.isFinal, isFalse);
+    expect(variable.isOverride, isFalse);
+    expect(variable.isPrivate, isFalse);
+    expect(variable.isPublic, isTrue);
+    expect(variable.isSynthetic, isFalse);
+    expect(variable.name, 'i');
+  }
+
+  void test_visitDefaultFormalParameter_noType() {
+    // p = 0
+    String parameterName = 'p';
+    DefaultFormalParameter formalParameter =
+        AstTestFactory.positionalFormalParameter(
+            AstTestFactory.simpleFormalParameter3(parameterName),
+            AstTestFactory.integer(0));
+    formalParameter.beginToken.offset = 50;
+    formalParameter.endToken.offset = 80;
+
+    ElementHolder holder = buildElementsForAst(formalParameter);
+    List<ParameterElement> parameters = holder.parameters;
+    expect(parameters, hasLength(1));
+    ParameterElement parameter = parameters[0];
+    assertHasCodeRange(parameter, 50, 31);
+    expect(parameter.hasImplicitType, isTrue);
+    expect(parameter.initializer, isNotNull);
+    expect(parameter.initializer.type, isNotNull);
+    expect(parameter.initializer.hasImplicitReturnType, isTrue);
+    expect(parameter.isConst, isFalse);
+    expect(parameter.isDeprecated, isFalse);
+    expect(parameter.isFinal, isFalse);
+    expect(parameter.isInitializingFormal, isFalse);
+    expect(parameter.isOverride, isFalse);
+    expect(parameter.isPrivate, isFalse);
+    expect(parameter.isPublic, isTrue);
+    expect(parameter.isSynthetic, isFalse);
+    expect(parameter.name, parameterName);
+  }
+
+  void test_visitDefaultFormalParameter_type() {
+    // E p = 0
+    String parameterName = 'p';
+    DefaultFormalParameter formalParameter =
+        AstTestFactory.namedFormalParameter(
+            AstTestFactory.simpleFormalParameter4(
+                AstTestFactory.typeName4('E'), parameterName),
+            AstTestFactory.integer(0));
+
+    ElementHolder holder = buildElementsForAst(formalParameter);
+    List<ParameterElement> parameters = holder.parameters;
+    expect(parameters, hasLength(1));
+    ParameterElement parameter = parameters[0];
+    expect(parameter.hasImplicitType, isFalse);
+    expect(parameter.initializer, isNotNull);
+    expect(parameter.initializer.type, isNotNull);
+    expect(parameter.initializer.hasImplicitReturnType, isTrue);
+    expect(parameter.isConst, isFalse);
+    expect(parameter.isDeprecated, isFalse);
+    expect(parameter.isFinal, isFalse);
+    expect(parameter.isInitializingFormal, isFalse);
+    expect(parameter.isOverride, isFalse);
+    expect(parameter.isPrivate, isFalse);
+    expect(parameter.isPublic, isTrue);
+    expect(parameter.isSynthetic, isFalse);
+    expect(parameter.name, parameterName);
+  }
+
+  void test_visitFunctionExpression() {
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = _makeBuilder(holder);
+    FunctionExpression expression = AstTestFactory.functionExpression2(
+        AstTestFactory.formalParameterList(),
+        AstTestFactory.blockFunctionBody2());
+    expression.accept(builder);
+    List<FunctionElement> functions = holder.functions;
+    expect(functions, hasLength(1));
+    FunctionElement function = functions[0];
+    expect(function, isNotNull);
+    expect(expression.element, same(function));
+    expect(function.hasImplicitReturnType, isTrue);
+    expect(function.isSynthetic, isFalse);
+    expect(function.typeParameters, hasLength(0));
+  }
+
+  void test_visitFunctionExpression_inBlockBody() {
+    List<FunctionElement> functions =
+        buildElementsForText('f() { return () => 42; }').functions[0].functions;
+    expect(functions, hasLength(1));
+    FunctionElement function = functions[0];
+    expect(function, isNotNull);
+    expect(function.hasImplicitReturnType, isTrue);
+    expect(function.isSynthetic, isFalse);
+    expect(function.typeParameters, hasLength(0));
+  }
+
+  void test_visitFunctionExpression_inExpressionBody() {
+    List<FunctionElement> functions =
+        buildElementsForText('f() => () => 42;').functions[0].functions;
+    expect(functions, hasLength(1));
+    FunctionElement function = functions[0];
+    expect(function, isNotNull);
+    expect(function.hasImplicitReturnType, isTrue);
+    expect(function.isSynthetic, isFalse);
+    expect(function.typeParameters, hasLength(0));
+  }
+
+  void test_visitFunctionTypeAlias() {
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = _makeBuilder(holder);
+    String aliasName = "F";
+    String parameterName = "E";
+    FunctionTypeAlias aliasNode = AstTestFactory.typeAlias(null, aliasName,
+        AstTestFactory.typeParameterList([parameterName]), null);
+    aliasNode.documentationComment = AstTestFactory.documentationComment(
+        [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
+    aliasNode.endToken.offset = 80;
+    aliasNode.accept(builder);
+
+    List<FunctionTypeAliasElement> aliases = holder.typeAliases;
+    expect(aliases, hasLength(1));
+    FunctionTypeAliasElement alias = aliases[0];
+    expect(alias, isNotNull);
+    assertHasCodeRange(alias, 50, 31);
+    expect(alias.documentationComment, '/// aaa');
+    expect(alias.name, aliasName);
+    expect(alias.parameters, hasLength(0));
+    List<TypeParameterElement> typeParameters = alias.typeParameters;
+    expect(typeParameters, hasLength(1));
+    TypeParameterElement typeParameter = typeParameters[0];
+    expect(typeParameter, isNotNull);
+    expect(typeParameter.name, parameterName);
+  }
+
+  void test_visitFunctionTypedFormalParameter() {
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = _makeBuilder(holder);
+    String parameterName = "p";
+    FunctionTypedFormalParameter formalParameter =
+        AstTestFactory.functionTypedFormalParameter(null, parameterName);
+    _useParameterInMethod(formalParameter, 100, 110);
+    formalParameter.accept(builder);
+    List<ParameterElement> parameters = holder.parameters;
+    expect(parameters, hasLength(1));
+    ParameterElement parameter = parameters[0];
+    expect(parameter, isNotNull);
+    expect(parameter.name, parameterName);
+    expect(parameter.initializer, isNull);
+    expect(parameter.isConst, isFalse);
+    expect(parameter.isFinal, isFalse);
+    expect(parameter.isSynthetic, isFalse);
+    expect(parameter.parameterKind, ParameterKind.REQUIRED);
+    _assertVisibleRange(parameter, 100, 110);
+  }
+
+  void test_visitFunctionTypedFormalParameter_withTypeParameters() {
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = _makeBuilder(holder);
+    String parameterName = "p";
+    FunctionTypedFormalParameter formalParameter =
+        AstTestFactory.functionTypedFormalParameter(null, parameterName);
+    formalParameter.typeParameters = AstTestFactory.typeParameterList(['F']);
+    _useParameterInMethod(formalParameter, 100, 110);
+    formalParameter.accept(builder);
+    List<ParameterElement> parameters = holder.parameters;
+    expect(parameters, hasLength(1));
+    ParameterElement parameter = parameters[0];
+    expect(parameter, isNotNull);
+    expect(parameter.name, parameterName);
+    expect(parameter.initializer, isNull);
+    expect(parameter.isConst, isFalse);
+    expect(parameter.isFinal, isFalse);
+    expect(parameter.isSynthetic, isFalse);
+    expect(parameter.parameterKind, ParameterKind.REQUIRED);
+    expect(parameter.typeParameters, hasLength(1));
+    _assertVisibleRange(parameter, 100, 110);
+  }
+
+  void test_visitLabeledStatement() {
+    List<LabelElement> labels =
+        buildElementsForText('f() { l: print(42); }').functions[0].labels;
+    expect(labels, hasLength(1));
+    LabelElement label = labels[0];
+    expect(label, isNotNull);
+    expect(label.name, 'l');
+    expect(label.isSynthetic, isFalse);
+  }
+
+  void test_visitMethodDeclaration_withMembers() {
+    MethodElement method = buildElementsForText(
+            'class C { m(p) { var v; try { l: return; } catch (e) {} } }')
+        .types[0]
+        .methods[0];
+    String methodName = "m";
+    String parameterName = "p";
+    String localVariableName = "v";
+    String labelName = "l";
+    String exceptionParameterName = "e";
+    expect(method, isNotNull);
+    expect(method.hasImplicitReturnType, isTrue);
+    expect(method.name, methodName);
+    expect(method.typeParameters, hasLength(0));
+    expect(method.isAbstract, isFalse);
+    expect(method.isExternal, isFalse);
+    expect(method.isStatic, isFalse);
+    expect(method.isSynthetic, isFalse);
+    List<VariableElement> parameters = method.parameters;
+    expect(parameters, hasLength(1));
+    VariableElement parameter = parameters[0];
+    expect(parameter, isNotNull);
+    expect(parameter.name, parameterName);
+    List<VariableElement> localVariables = method.localVariables;
+    expect(localVariables, hasLength(2));
+    VariableElement firstVariable = localVariables[0];
+    VariableElement secondVariable = localVariables[1];
+    expect(firstVariable, isNotNull);
+    expect(secondVariable, isNotNull);
+    expect(
+        (firstVariable.name == localVariableName &&
+                secondVariable.name == exceptionParameterName) ||
+            (firstVariable.name == exceptionParameterName &&
+                secondVariable.name == localVariableName),
+        isTrue);
+    List<LabelElement> labels = method.labels;
+    expect(labels, hasLength(1));
+    LabelElement label = labels[0];
+    expect(label, isNotNull);
+    expect(label.name, labelName);
+  }
+
+  void test_visitNamedFormalParameter() {
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = _makeBuilder(holder);
+    String parameterName = "p";
+    DefaultFormalParameter formalParameter =
+        AstTestFactory.namedFormalParameter(
+            AstTestFactory.simpleFormalParameter3(parameterName),
+            AstTestFactory.identifier3("42"));
+    _useParameterInMethod(formalParameter, 100, 110);
+    formalParameter.beginToken.offset = 50;
+    formalParameter.endToken.offset = 80;
+    formalParameter.accept(builder);
+    List<ParameterElement> parameters = holder.parameters;
+    expect(parameters, hasLength(1));
+    ParameterElement parameter = parameters[0];
+    expect(parameter, isNotNull);
+    assertHasCodeRange(parameter, 50, 32);
+    expect(parameter.name, parameterName);
+    expect(parameter.isConst, isFalse);
+    expect(parameter.isFinal, isFalse);
+    expect(parameter.isSynthetic, isFalse);
+    expect(parameter.parameterKind, ParameterKind.NAMED);
+    _assertVisibleRange(parameter, 100, 110);
+    expect(parameter.defaultValueCode, "42");
+    FunctionElement initializer = parameter.initializer;
+    expect(initializer, isNotNull);
+    expect(initializer.isSynthetic, isTrue);
+    expect(initializer.hasImplicitReturnType, isTrue);
+  }
+
+  void test_visitSimpleFormalParameter_noType() {
+    // p
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = _makeBuilder(holder);
+    String parameterName = "p";
+    SimpleFormalParameter formalParameter =
+        AstTestFactory.simpleFormalParameter3(parameterName);
+    _useParameterInMethod(formalParameter, 100, 110);
+    formalParameter.accept(builder);
+    List<ParameterElement> parameters = holder.parameters;
+    expect(parameters, hasLength(1));
+    ParameterElement parameter = parameters[0];
+    expect(parameter, isNotNull);
+    expect(parameter.hasImplicitType, isTrue);
+    expect(parameter.initializer, isNull);
+    expect(parameter.isConst, isFalse);
+    expect(parameter.isFinal, isFalse);
+    expect(parameter.isSynthetic, isFalse);
+    expect(parameter.name, parameterName);
+    expect(parameter.parameterKind, ParameterKind.REQUIRED);
+    _assertVisibleRange(parameter, 100, 110);
+  }
+
+  void test_visitSimpleFormalParameter_type() {
+    // T p
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = _makeBuilder(holder);
+    String parameterName = "p";
+    SimpleFormalParameter formalParameter = AstTestFactory
+        .simpleFormalParameter4(AstTestFactory.typeName4('T'), parameterName);
+    _useParameterInMethod(formalParameter, 100, 110);
+    formalParameter.accept(builder);
+    List<ParameterElement> parameters = holder.parameters;
+    expect(parameters, hasLength(1));
+    ParameterElement parameter = parameters[0];
+    expect(parameter, isNotNull);
+    expect(parameter.hasImplicitType, isFalse);
+    expect(parameter.initializer, isNull);
+    expect(parameter.isConst, isFalse);
+    expect(parameter.isFinal, isFalse);
+    expect(parameter.isSynthetic, isFalse);
+    expect(parameter.name, parameterName);
+    expect(parameter.parameterKind, ParameterKind.REQUIRED);
+    _assertVisibleRange(parameter, 100, 110);
+  }
+
+  void test_visitVariableDeclaration_inConstructor() {
+    List<ConstructorElement> constructors =
+        buildElementsForText('class C { C() { var v = 1; } }')
+            .types[0]
+            .constructors;
+    expect(constructors, hasLength(1));
+    List<LocalVariableElement> variableElements =
+        constructors[0].localVariables;
+    expect(variableElements, hasLength(1));
+    LocalVariableElement variableElement = variableElements[0];
+    assertHasCodeRange(variableElement, 16, 10);
+    expect(variableElement.hasImplicitType, isTrue);
+    expect(variableElement.name, 'v');
+    _assertVisibleRange(variableElement, 14, 28);
+  }
+
+  void test_visitVariableDeclaration_inForEachStatement() {
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = _makeBuilder(holder);
+    //
+    // m() { for (var v in []) }
+    //
+    String variableName = "v";
+    Statement statement = AstTestFactory.forEachStatement(
+        AstTestFactory.declaredIdentifier3('v'),
+        AstTestFactory.listLiteral(),
+        AstTestFactory.block());
+    _setNodeSourceRange(statement, 100, 110);
+    MethodDeclaration method = AstTestFactory.methodDeclaration2(
+        null,
+        null,
+        null,
+        null,
+        AstTestFactory.identifier3("m"),
+        AstTestFactory.formalParameterList(),
+        AstTestFactory.blockFunctionBody2([statement]));
+    _setBlockBodySourceRange(method.body, 200, 220);
+    method.accept(builder);
+
+    List<MethodElement> methods = holder.methods;
+    expect(methods, hasLength(1));
+    List<LocalVariableElement> variableElements = methods[0].localVariables;
+    expect(variableElements, hasLength(1));
+    LocalVariableElement variableElement = variableElements[0];
+    expect(variableElement.name, variableName);
+    _assertVisibleRange(variableElement, 100, 110);
+  }
+
+  void test_visitVariableDeclaration_inForStatement() {
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = _makeBuilder(holder);
+    //
+    // m() { for (T v;;) }
+    //
+    String variableName = "v";
+    ForStatement statement = AstTestFactory.forStatement2(
+        AstTestFactory.variableDeclarationList(
+            null,
+            AstTestFactory.typeName4('T'),
+            [AstTestFactory.variableDeclaration('v')]),
+        null,
+        null,
+        AstTestFactory.block());
+    _setNodeSourceRange(statement, 100, 110);
+    MethodDeclaration method = AstTestFactory.methodDeclaration2(
+        null,
+        null,
+        null,
+        null,
+        AstTestFactory.identifier3("m"),
+        AstTestFactory.formalParameterList(),
+        AstTestFactory.blockFunctionBody2([statement]));
+    _setBlockBodySourceRange(method.body, 200, 220);
+    method.accept(builder);
+
+    List<MethodElement> methods = holder.methods;
+    expect(methods, hasLength(1));
+    List<LocalVariableElement> variableElements = methods[0].localVariables;
+    expect(variableElements, hasLength(1));
+    LocalVariableElement variableElement = variableElements[0];
+    expect(variableElement.name, variableName);
+    _assertVisibleRange(variableElement, 100, 110);
+  }
+
+  void test_visitVariableDeclaration_inMethod() {
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = _makeBuilder(holder);
+    //
+    // m() {T v;}
+    //
+    String variableName = "v";
+    VariableDeclaration variable =
+        AstTestFactory.variableDeclaration2(variableName, null);
+    Statement statement = AstTestFactory.variableDeclarationStatement(
+        null, AstTestFactory.typeName4('T'), [variable]);
+    MethodDeclaration method = AstTestFactory.methodDeclaration2(
+        null,
+        null,
+        null,
+        null,
+        AstTestFactory.identifier3("m"),
+        AstTestFactory.formalParameterList(),
+        AstTestFactory.blockFunctionBody2([statement]));
+    _setBlockBodySourceRange(method.body, 100, 110);
+    method.accept(builder);
+
+    List<MethodElement> methods = holder.methods;
+    expect(methods, hasLength(1));
+    List<LocalVariableElement> variableElements = methods[0].localVariables;
+    expect(variableElements, hasLength(1));
+    LocalVariableElement variableElement = variableElements[0];
+    expect(variableElement.hasImplicitType, isFalse);
+    expect(variableElement.name, variableName);
+    _assertVisibleRange(variableElement, 100, 110);
+  }
+
+  void test_visitVariableDeclaration_localNestedInFunction() {
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = _makeBuilder(holder);
+    //
+    // var f = () {var v;};
+    //
+    String variableName = "v";
+    VariableDeclaration variable =
+        AstTestFactory.variableDeclaration2(variableName, null);
+    Statement statement =
+        AstTestFactory.variableDeclarationStatement2(null, [variable]);
+    Expression initializer = AstTestFactory.functionExpression2(
+        AstTestFactory.formalParameterList(),
+        AstTestFactory.blockFunctionBody2([statement]));
+    String fieldName = "f";
+    VariableDeclaration field =
+        AstTestFactory.variableDeclaration2(fieldName, initializer);
+    FieldDeclaration fieldDeclaration =
+        AstTestFactory.fieldDeclaration2(false, null, [field]);
+    fieldDeclaration.accept(builder);
+
+    List<FieldElement> variables = holder.fields;
+    expect(variables, hasLength(1));
+    FieldElement fieldElement = variables[0];
+    expect(fieldElement, isNotNull);
+    FunctionElement initializerElement = fieldElement.initializer;
+    expect(initializerElement, isNotNull);
+    expect(initializerElement.hasImplicitReturnType, isTrue);
+    List<FunctionElement> functionElements = initializerElement.functions;
+    expect(functionElements, hasLength(1));
+    List<LocalVariableElement> variableElements =
+        functionElements[0].localVariables;
+    expect(variableElements, hasLength(1));
+    LocalVariableElement variableElement = variableElements[0];
+    expect(variableElement.hasImplicitType, isTrue);
+    expect(variableElement.isConst, isFalse);
+    expect(variableElement.isFinal, isFalse);
+    expect(variableElement.isSynthetic, isFalse);
+    expect(variableElement.name, variableName);
+  }
+
+  void test_visitVariableDeclaration_noInitializer() {
+    // var v;
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = _makeBuilder(holder);
+    String variableName = "v";
+    VariableDeclaration variableDeclaration =
+        AstTestFactory.variableDeclaration2(variableName, null);
+    AstTestFactory.variableDeclarationList2(null, [variableDeclaration]);
+    variableDeclaration.accept(builder);
+
+    List<TopLevelVariableElement> variables = holder.topLevelVariables;
+    expect(variables, hasLength(1));
+    TopLevelVariableElement variable = variables[0];
+    expect(variable, isNotNull);
+    expect(variable.hasImplicitType, isTrue);
+    expect(variable.initializer, isNull);
+    expect(variable.name, variableName);
+    expect(variable.isConst, isFalse);
+    expect(variable.isFinal, isFalse);
+    expect(variable.isSynthetic, isFalse);
+    expect(variable.getter, isNotNull);
+    expect(variable.setter, isNotNull);
+  }
+
+  void test_visitVariableDeclaration_top() {
+    // final a, b;
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = _makeBuilder(holder);
+    VariableDeclaration variableDeclaration1 =
+        AstTestFactory.variableDeclaration('a');
+    VariableDeclaration variableDeclaration2 =
+        AstTestFactory.variableDeclaration('b');
+    TopLevelVariableDeclaration topLevelVariableDeclaration = AstTestFactory
+        .topLevelVariableDeclaration(
+            Keyword.FINAL, null, [variableDeclaration1, variableDeclaration2]);
+    topLevelVariableDeclaration.documentationComment = AstTestFactory
+        .documentationComment(
+            [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
+
+    topLevelVariableDeclaration.accept(builder);
+    List<TopLevelVariableElement> variables = holder.topLevelVariables;
+    expect(variables, hasLength(2));
+
+    TopLevelVariableElement variable1 = variables[0];
+    expect(variable1, isNotNull);
+    expect(variable1.documentationComment, '/// aaa');
+
+    TopLevelVariableElement variable2 = variables[1];
+    expect(variable2, isNotNull);
+    expect(variable2.documentationComment, '/// aaa');
+  }
+
+  void test_visitVariableDeclaration_top_const_hasInitializer() {
+    // const v = 42;
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = _makeBuilder(holder);
+    String variableName = "v";
+    VariableDeclaration variableDeclaration = AstTestFactory
+        .variableDeclaration2(variableName, AstTestFactory.integer(42));
+    AstTestFactory
+        .variableDeclarationList2(Keyword.CONST, [variableDeclaration]);
+    variableDeclaration.accept(builder);
+
+    List<TopLevelVariableElement> variables = holder.topLevelVariables;
+    expect(variables, hasLength(1));
+    TopLevelVariableElement variable = variables[0];
+    expect(variable, new isInstanceOf<ConstTopLevelVariableElementImpl>());
+    expect(variable.initializer, isNotNull);
+    expect(variable.initializer.type, isNotNull);
+    expect(variable.initializer.hasImplicitReturnType, isTrue);
+    expect(variable.name, variableName);
+    expect(variable.hasImplicitType, isTrue);
+    expect(variable.isConst, isTrue);
+    expect(variable.isFinal, isFalse);
+    expect(variable.isSynthetic, isFalse);
+    expect(variable.getter, isNotNull);
+    expect(variable.setter, isNull);
+  }
+
+  void test_visitVariableDeclaration_top_final() {
+    // final v;
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = _makeBuilder(holder);
+    String variableName = "v";
+    VariableDeclaration variableDeclaration =
+        AstTestFactory.variableDeclaration2(variableName, null);
+    AstTestFactory
+        .variableDeclarationList2(Keyword.FINAL, [variableDeclaration]);
+    variableDeclaration.accept(builder);
+    List<TopLevelVariableElement> variables = holder.topLevelVariables;
+    expect(variables, hasLength(1));
+    TopLevelVariableElement variable = variables[0];
+    expect(variable, isNotNull);
+    expect(variable.hasImplicitType, isTrue);
+    expect(variable.initializer, isNull);
+    expect(variable.name, variableName);
+    expect(variable.isConst, isFalse);
+    expect(variable.isFinal, isTrue);
+    expect(variable.isSynthetic, isFalse);
+    expect(variable.getter, isNotNull);
+    expect(variable.setter, isNull);
+  }
+
+  ElementBuilder _makeBuilder(ElementHolder holder) =>
+      new ElementBuilder(holder, compilationUnitElement);
+
+  void _setBlockBodySourceRange(BlockFunctionBody body, int offset, int end) {
+    _setNodeSourceRange(body.block, offset, end);
+  }
+
+  void _setNodeSourceRange(AstNode node, int offset, int end) {
+    node.beginToken.offset = offset;
+    Token endToken = node.endToken;
+    endToken.offset = end - endToken.length;
+  }
+
+  void _useParameterInMethod(
+      FormalParameter formalParameter, int blockOffset, int blockEnd) {
+    Block block = AstTestFactory.block();
+    block.leftBracket.offset = blockOffset;
+    block.rightBracket.offset = blockEnd - 1;
+    BlockFunctionBody body = AstTestFactory.blockFunctionBody(block);
+    AstTestFactory.methodDeclaration2(
+        null,
+        null,
+        null,
+        null,
+        AstTestFactory.identifier3("main"),
+        AstTestFactory.formalParameterList([formalParameter]),
+        body);
+  }
+}
+
+@reflectiveTest
+class LocalElementBuilderTest extends _BaseTest {
+  @override
+  AstVisitor createElementBuilder(ElementHolder holder) {
+    return new LocalElementBuilder(holder, compilationUnitElement);
+  }
+
+  void test_buildLocalElements() {
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(r'''
+main() {
+  int v1;
+  f1() {
+    int v2;
+    f2() {
+      int v3;
+    }
+  }
+}
+''');
+    var mainAst = unit.declarations.single as FunctionDeclaration;
+    // Build API elements.
+    FunctionElementImpl main;
+    {
+      ElementHolder holder = new ElementHolder();
+      unit.accept(new ApiElementBuilder(holder, compilationUnitElement));
+      main = holder.functions.single as FunctionElementImpl;
+    }
+    expect(main.localVariables, isEmpty);
+    expect(main.functions, isEmpty);
+    // Build local elements in body.
+    ElementHolder holder = new ElementHolder();
+    FunctionBody mainBody = mainAst.functionExpression.body;
+    mainBody.accept(new LocalElementBuilder(holder, compilationUnitElement));
+    main.functions = holder.functions;
+    main.localVariables = holder.localVariables;
+    expect(main.localVariables.map((v) => v.name), ['v1']);
+    expect(main.functions, hasLength(1));
+    {
+      FunctionElement f1 = main.functions[0];
+      expect(f1.name, 'f1');
+      expect(f1.localVariables.map((v) => v.name), ['v2']);
+      expect(f1.functions, hasLength(1));
+      {
+        FunctionElement f2 = f1.functions[0];
+        expect(f2.name, 'f2');
+        expect(f2.localVariables.map((v) => v.name), ['v3']);
+        expect(f2.functions, isEmpty);
+      }
+    }
+  }
+
+  void test_buildParameterInitializer() {
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit('f({p: 42}) {}');
+    var function = unit.declarations.single as FunctionDeclaration;
+    var parameter = function.functionExpression.parameters.parameters.single
+        as DefaultFormalParameter;
+    // Build API elements.
+    {
+      ElementHolder holder = new ElementHolder();
+      unit.accept(new ApiElementBuilder(holder, compilationUnitElement));
+    }
+    // Validate the parameter element.
+    var parameterElement = parameter.element as ParameterElementImpl;
+    expect(parameterElement, isNotNull);
+    expect(parameterElement.initializer, isNull);
+    // Build the initializer element.
+    new LocalElementBuilder(new ElementHolder(), compilationUnitElement)
+        .buildParameterInitializer(parameterElement, parameter.defaultValue);
+    expect(parameterElement.initializer, isNotNull);
+  }
+
+  void test_buildVariableInitializer() {
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit('var V = 42;');
+    TopLevelVariableDeclaration topLevelDecl =
+        unit.declarations[0] as TopLevelVariableDeclaration;
+    VariableDeclaration variable = topLevelDecl.variables.variables.single;
+    // Build the variable element.
+    {
+      ElementHolder holder = new ElementHolder();
+      unit.accept(new ApiElementBuilder(holder, compilationUnitElement));
+    }
+    // Validate the variable element.
+    var variableElement = variable.element as VariableElementImpl;
+    expect(variableElement, isNotNull);
+    expect(variableElement.initializer, isNull);
+    // Build the initializer element.
+    new LocalElementBuilder(new ElementHolder(), compilationUnitElement)
+        .buildVariableInitializer(variableElement, variable.initializer);
+    expect(variableElement.initializer, isNotNull);
+  }
+
+  void test_visitDefaultFormalParameter_local() {
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit('''
+main() {
+  f({bool b: false}) {}
+}
+''');
+    var mainAst = unit.declarations.single as FunctionDeclaration;
+    // Build API elements.
+    FunctionElementImpl main;
+    {
+      ElementHolder holder = new ElementHolder();
+      unit.accept(new ApiElementBuilder(holder, compilationUnitElement));
+      main = holder.functions.single as FunctionElementImpl;
+    }
+    // Build local elements in body.
+    ElementHolder holder = new ElementHolder();
+    FunctionBody mainBody = mainAst.functionExpression.body;
+    mainBody.accept(new LocalElementBuilder(holder, compilationUnitElement));
+    main.functions = holder.functions;
+    main.localVariables = holder.localVariables;
+    expect(main.functions, hasLength(1));
+    FunctionElement f = main.functions[0];
+    expect(f.parameters, hasLength(1));
+    expect(f.parameters[0].initializer, isNotNull);
+  }
+
+  void test_visitVariableDeclaration_local() {
+    var holder = buildElementsForText('class C { m() { T v = null; } }');
+    List<LocalVariableElement> variableElements = holder.localVariables;
+    expect(variableElements, hasLength(1));
+    LocalVariableElement variableElement = variableElements[0];
+    expect(variableElement.hasImplicitType, isFalse);
+    expect(variableElement.name, 'v');
+    expect(variableElement.initializer, isNotNull);
+    _assertVisibleRange(variableElement, 14, 29);
+  }
+}
+
+/**
+ * Mixin with test methods for testing element building in [ApiElementBuilder].
+ * It is used to test the [ApiElementBuilder] itself, and its usage by
+ * [ElementBuilder].
+ */
+abstract class _ApiElementBuilderTestMixin {
+  CompilationUnit get compilationUnit;
+
+  void assertHasCodeRange(Element element, int offset, int length);
+
+  /**
+   * Build elements using [ApiElementBuilder].
+   */
+  ElementHolder buildElementsForAst(AstNode node);
+
+  /**
+   * Parse the given [code], and build elements using [ApiElementBuilder].
+   */
+  ElementHolder buildElementsForText(String code);
+
+  /**
+   * Verify that the given [metadata] has exactly one annotation, and that its
+   * [ElementAnnotationImpl] is unresolved.
+   */
+  void checkAnnotation(NodeList<Annotation> metadata);
+
+  /**
+   * Verify that the given [element] has exactly one annotation, and that its
+   * [ElementAnnotationImpl] is unresolved.
+   */
+  void checkMetadata(Element element);
+
+  void test_metadata_fieldDeclaration() {
+    List<FieldElement> fields =
+        buildElementsForText('class C { @a int x, y; }').types[0].fields;
+    checkMetadata(fields[0]);
+    checkMetadata(fields[1]);
+    expect(fields[0].metadata, same(fields[1].metadata));
+  }
+
+  void test_metadata_topLevelVariableDeclaration() {
+    List<TopLevelVariableElement> topLevelVariables =
+        buildElementsForText('@a int x, y;').topLevelVariables;
+    checkMetadata(topLevelVariables[0]);
+    checkMetadata(topLevelVariables[1]);
+    expect(topLevelVariables[0].metadata, same(topLevelVariables[1].metadata));
+  }
+
+  void test_metadata_visitClassDeclaration() {
+    ClassElement classElement = buildElementsForText('@a class C {}').types[0];
+    checkMetadata(classElement);
+  }
+
+  void test_metadata_visitClassTypeAlias() {
+    ClassElement classElement =
+        buildElementsForText('@a class C = D with E;').types[0];
+    checkMetadata(classElement);
+  }
+
+  void test_metadata_visitConstructorDeclaration() {
+    ConstructorElement constructorElement =
+        buildElementsForText('class C { @a C(); }').types[0].constructors[0];
+    checkMetadata(constructorElement);
+  }
+
+  void test_metadata_visitDefaultFormalParameter_fieldFormalParameter() {
+    ParameterElement parameterElement =
+        buildElementsForText('class C { var x; C([@a this.x = null]); }')
+            .types[0]
+            .constructors[0]
+            .parameters[0];
+    checkMetadata(parameterElement);
+  }
+
+  void
+      test_metadata_visitDefaultFormalParameter_functionTypedFormalParameter() {
+    ParameterElement parameterElement =
+        buildElementsForText('f([@a g() = null]) {}').functions[0].parameters[
+            0];
+    checkMetadata(parameterElement);
+  }
+
+  void test_metadata_visitDefaultFormalParameter_simpleFormalParameter() {
+    ParameterElement parameterElement =
+        buildElementsForText('f([@a gx = null]) {}').functions[0].parameters[0];
+    checkMetadata(parameterElement);
+  }
+
+  void test_metadata_visitEnumDeclaration() {
+    ClassElement classElement =
+        buildElementsForText('@a enum E { v }').enums[0];
+    checkMetadata(classElement);
+  }
+
+  void test_metadata_visitExportDirective() {
+    buildElementsForText('@a export "foo.dart";');
+    expect(compilationUnit.directives[0], new isInstanceOf<ExportDirective>());
+    ExportDirective exportDirective = compilationUnit.directives[0];
+    checkAnnotation(exportDirective.metadata);
+  }
+
+  void test_metadata_visitFieldFormalParameter() {
+    ParameterElement parameterElement =
+        buildElementsForText('class C { var x; C(@a this.x); }')
+            .types[0]
+            .constructors[0]
+            .parameters[0];
+    checkMetadata(parameterElement);
+  }
+
+  void test_metadata_visitFunctionDeclaration_function() {
+    FunctionElement functionElement =
+        buildElementsForText('@a f() {}').functions[0];
+    checkMetadata(functionElement);
+  }
+
+  void test_metadata_visitFunctionDeclaration_getter() {
+    PropertyAccessorElement propertyAccessorElement =
+        buildElementsForText('@a get f => null;').accessors[0];
+    checkMetadata(propertyAccessorElement);
+  }
+
+  void test_metadata_visitFunctionDeclaration_setter() {
+    PropertyAccessorElement propertyAccessorElement =
+        buildElementsForText('@a set f(value) {}').accessors[0];
+    checkMetadata(propertyAccessorElement);
+  }
+
+  void test_metadata_visitFunctionTypeAlias() {
+    FunctionTypeAliasElement functionTypeAliasElement =
+        buildElementsForText('@a typedef F();').typeAliases[0];
+    checkMetadata(functionTypeAliasElement);
+  }
+
+  void test_metadata_visitFunctionTypedFormalParameter() {
+    ParameterElement parameterElement =
+        buildElementsForText('f(@a g()) {}').functions[0].parameters[0];
+    checkMetadata(parameterElement);
+  }
+
+  void test_metadata_visitImportDirective() {
+    buildElementsForText('@a import "foo.dart";');
+    expect(compilationUnit.directives[0], new isInstanceOf<ImportDirective>());
+    ImportDirective importDirective = compilationUnit.directives[0];
+    checkAnnotation(importDirective.metadata);
+  }
+
+  void test_metadata_visitLibraryDirective() {
+    buildElementsForText('@a library L;');
+    expect(compilationUnit.directives[0], new isInstanceOf<LibraryDirective>());
+    LibraryDirective libraryDirective = compilationUnit.directives[0];
+    checkAnnotation(libraryDirective.metadata);
+  }
+
+  void test_metadata_visitMethodDeclaration_getter() {
+    PropertyAccessorElement propertyAccessorElement =
+        buildElementsForText('class C { @a get m => null; }')
+            .types[0]
+            .accessors[0];
+    checkMetadata(propertyAccessorElement);
+  }
+
+  void test_metadata_visitMethodDeclaration_method() {
+    MethodElement methodElement =
+        buildElementsForText('class C { @a m() {} }').types[0].methods[0];
+    checkMetadata(methodElement);
+  }
+
+  void test_metadata_visitMethodDeclaration_setter() {
+    PropertyAccessorElement propertyAccessorElement =
+        buildElementsForText('class C { @a set f(value) {} }')
+            .types[0]
+            .accessors[0];
+    checkMetadata(propertyAccessorElement);
+  }
+
+  void test_metadata_visitPartDirective() {
+    buildElementsForText('@a part "foo.dart";');
+    expect(compilationUnit.directives[0], new isInstanceOf<PartDirective>());
+    PartDirective partDirective = compilationUnit.directives[0];
+    checkAnnotation(partDirective.metadata);
+  }
+
+  void test_metadata_visitPartOfDirective() {
+    // We don't build ElementAnnotation objects for `part of` directives, since
+    // analyzer ignores them in favor of annotations on the library directive.
+    buildElementsForText('@a part of L;');
+    expect(compilationUnit.directives[0], new isInstanceOf<PartOfDirective>());
+    PartOfDirective partOfDirective = compilationUnit.directives[0];
+    expect(partOfDirective.metadata, hasLength(1));
+    expect(partOfDirective.metadata[0].elementAnnotation, isNull);
+  }
+
+  void test_metadata_visitSimpleFormalParameter() {
+    ParameterElement parameterElement =
+        buildElementsForText('f(@a x) {}').functions[0].parameters[0];
+    checkMetadata(parameterElement);
+  }
+
+  void test_metadata_visitTypeParameter() {
+    TypeParameterElement typeParameterElement =
+        buildElementsForText('class C<@a T> {}').types[0].typeParameters[0];
+    checkMetadata(typeParameterElement);
+  }
+
+  void test_visitClassDeclaration_abstract() {
+    List<ClassElement> types =
+        buildElementsForText('abstract class C {}').types;
+    expect(types, hasLength(1));
+    ClassElement type = types[0];
+    expect(type, isNotNull);
+    expect(type.name, 'C');
+    List<TypeParameterElement> typeParameters = type.typeParameters;
+    expect(typeParameters, hasLength(0));
+    expect(type.isAbstract, isTrue);
+    expect(type.isMixinApplication, isFalse);
+    expect(type.isSynthetic, isFalse);
+  }
+
+  void test_visitClassDeclaration_invalidFunctionInAnnotation_class() {
+    // https://github.com/dart-lang/sdk/issues/25696
+    String code = r'''
+class A {
+  const A({f});
+}
+
+@A(f: () {})
+class C {}
+''';
+    buildElementsForText(code);
+  }
+
+  void test_visitClassDeclaration_invalidFunctionInAnnotation_method() {
+    String code = r'''
+class A {
+  const A({f});
+}
+
+class C {
+  @A(f: () {})
+  void m() {}
+}
+''';
+    ElementHolder holder = buildElementsForText(code);
+    ClassElement elementC = holder.types[1];
+    expect(elementC, isNotNull);
+    MethodElement methodM = elementC.methods[0];
+    expect(methodM, isNotNull);
+    expect(methodM.functions, isEmpty);
+  }
+
+  void test_visitClassDeclaration_minimal() {
+    String className = "C";
+    ClassDeclaration classDeclaration = AstTestFactory.classDeclaration(
+        null, className, null, null, null, null);
+    classDeclaration.documentationComment = AstTestFactory.documentationComment(
+        [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
+    classDeclaration.endToken.offset = 80;
+
+    ElementHolder holder = buildElementsForAst(classDeclaration);
+    List<ClassElement> types = holder.types;
+    expect(types, hasLength(1));
+    ClassElement type = types[0];
+    expect(type, isNotNull);
+    expect(type.name, className);
+    List<TypeParameterElement> typeParameters = type.typeParameters;
+    expect(typeParameters, hasLength(0));
+    expect(type.isAbstract, isFalse);
+    expect(type.isMixinApplication, isFalse);
+    expect(type.isSynthetic, isFalse);
+    expect(type.documentationComment, '/// aaa');
+    assertHasCodeRange(type, 50, 31);
+  }
+
+  void test_visitClassDeclaration_parameterized() {
+    String className = "C";
+    String firstVariableName = "E";
+    String secondVariableName = "F";
+    ClassDeclaration classDeclaration = AstTestFactory.classDeclaration(
+        null,
+        className,
+        AstTestFactory
+            .typeParameterList([firstVariableName, secondVariableName]),
+        null,
+        null,
+        null);
+
+    ElementHolder holder = buildElementsForAst(classDeclaration);
+    List<ClassElement> types = holder.types;
+    expect(types, hasLength(1));
+    ClassElement type = types[0];
+    expect(type, isNotNull);
+    expect(type.name, className);
+    List<TypeParameterElement> typeParameters = type.typeParameters;
+    expect(typeParameters, hasLength(2));
+    expect(typeParameters[0].name, firstVariableName);
+    expect(typeParameters[1].name, secondVariableName);
+    expect(type.isAbstract, isFalse);
+    expect(type.isMixinApplication, isFalse);
+    expect(type.isSynthetic, isFalse);
+  }
+
+  void test_visitClassDeclaration_withMembers() {
+    String className = "C";
+    String typeParameterName = "E";
+    String fieldName = "f";
+    String methodName = "m";
+    ClassDeclaration classDeclaration = AstTestFactory.classDeclaration(
+        null,
+        className,
+        AstTestFactory.typeParameterList([typeParameterName]),
+        null,
+        null,
+        null, [
+      AstTestFactory.fieldDeclaration2(
+          false, null, [AstTestFactory.variableDeclaration(fieldName)]),
+      AstTestFactory.methodDeclaration2(
+          null,
+          null,
+          null,
+          null,
+          AstTestFactory.identifier3(methodName),
+          AstTestFactory.formalParameterList(),
+          AstTestFactory.blockFunctionBody2())
+    ]);
+
+    ElementHolder holder = buildElementsForAst(classDeclaration);
+    List<ClassElement> types = holder.types;
+    expect(types, hasLength(1));
+    ClassElement type = types[0];
+    expect(type, isNotNull);
+    expect(type.name, className);
+    expect(type.isAbstract, isFalse);
+    expect(type.isMixinApplication, isFalse);
+    expect(type.isSynthetic, isFalse);
+    List<TypeParameterElement> typeParameters = type.typeParameters;
+    expect(typeParameters, hasLength(1));
+    TypeParameterElement typeParameter = typeParameters[0];
+    expect(typeParameter, isNotNull);
+    expect(typeParameter.name, typeParameterName);
+    List<FieldElement> fields = type.fields;
+    expect(fields, hasLength(1));
+    FieldElement field = fields[0];
+    expect(field, isNotNull);
+    expect(field.name, fieldName);
+    List<MethodElement> methods = type.methods;
+    expect(methods, hasLength(1));
+    MethodElement method = methods[0];
+    expect(method, isNotNull);
+    expect(method.name, methodName);
+  }
+
+  void test_visitClassTypeAlias() {
+    // class B {}
+    // class M {}
+    // class C = B with M
+    ClassElementImpl classB = ElementFactory.classElement2('B', []);
+    ConstructorElementImpl constructorB =
+        ElementFactory.constructorElement2(classB, '', []);
+    constructorB.setModifier(Modifier.SYNTHETIC, true);
+    classB.constructors = [constructorB];
+    ClassElement classM = ElementFactory.classElement2('M', []);
+    WithClause withClause =
+        AstTestFactory.withClause([AstTestFactory.typeName(classM, [])]);
+    ClassTypeAlias alias = AstTestFactory.classTypeAlias(
+        'C', null, null, AstTestFactory.typeName(classB, []), withClause, null);
+
+    ElementHolder holder = buildElementsForAst(alias);
+    List<ClassElement> types = holder.types;
+    expect(types, hasLength(1));
+    ClassElement type = types[0];
+    expect(alias.element, same(type));
+    expect(type.name, equals('C'));
+    expect(type.isAbstract, isFalse);
+    expect(type.isMixinApplication, isTrue);
+    expect(type.isSynthetic, isFalse);
+    expect(type.typeParameters, isEmpty);
+    expect(type.fields, isEmpty);
+    expect(type.methods, isEmpty);
+  }
+
+  void test_visitClassTypeAlias_abstract() {
+    // class B {}
+    // class M {}
+    // abstract class C = B with M
+    ClassElementImpl classB = ElementFactory.classElement2('B', []);
+    ConstructorElementImpl constructorB =
+        ElementFactory.constructorElement2(classB, '', []);
+    constructorB.setModifier(Modifier.SYNTHETIC, true);
+    classB.constructors = [constructorB];
+    ClassElement classM = ElementFactory.classElement2('M', []);
+    WithClause withClause =
+        AstTestFactory.withClause([AstTestFactory.typeName(classM, [])]);
+    ClassTypeAlias alias = AstTestFactory.classTypeAlias(
+        'C',
+        null,
+        Keyword.ABSTRACT,
+        AstTestFactory.typeName(classB, []),
+        withClause,
+        null);
+
+    ElementHolder holder = buildElementsForAst(alias);
+    List<ClassElement> types = holder.types;
+    expect(types, hasLength(1));
+    ClassElement type = types[0];
+    expect(type.isAbstract, isTrue);
+    expect(type.isMixinApplication, isTrue);
+  }
+
+  void test_visitClassTypeAlias_typeParams() {
+    // class B {}
+    // class M {}
+    // class C<T> = B with M
+    ClassElementImpl classB = ElementFactory.classElement2('B', []);
+    ConstructorElementImpl constructorB =
+        ElementFactory.constructorElement2(classB, '', []);
+    constructorB.setModifier(Modifier.SYNTHETIC, true);
+    classB.constructors = [constructorB];
+    ClassElementImpl classM = ElementFactory.classElement2('M', []);
+    WithClause withClause =
+        AstTestFactory.withClause([AstTestFactory.typeName(classM, [])]);
+    ClassTypeAlias alias = AstTestFactory.classTypeAlias(
+        'C',
+        AstTestFactory.typeParameterList(['T']),
+        null,
+        AstTestFactory.typeName(classB, []),
+        withClause,
+        null);
+
+    ElementHolder holder = buildElementsForAst(alias);
+    List<ClassElement> types = holder.types;
+    expect(types, hasLength(1));
+    ClassElement type = types[0];
+    expect(type.typeParameters, hasLength(1));
+    expect(type.typeParameters[0].name, equals('T'));
+  }
+
+  void test_visitConstructorDeclaration_external() {
+    String className = "A";
+    ConstructorDeclaration constructorDeclaration =
+        AstTestFactory.constructorDeclaration2(
+            null,
+            null,
+            AstTestFactory.identifier3(className),
+            null,
+            AstTestFactory.formalParameterList(),
+            null,
+            AstTestFactory.blockFunctionBody2());
+    constructorDeclaration.externalKeyword =
+        TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
+
+    ElementHolder holder = buildElementsForAst(constructorDeclaration);
+    List<ConstructorElement> constructors = holder.constructors;
+    expect(constructors, hasLength(1));
+    ConstructorElement constructor = constructors[0];
+    expect(constructor, isNotNull);
+    expect(constructor.isExternal, isTrue);
+    expect(constructor.isFactory, isFalse);
+    expect(constructor.name, "");
+    expect(constructor.functions, hasLength(0));
+    expect(constructor.labels, hasLength(0));
+    expect(constructor.localVariables, hasLength(0));
+    expect(constructor.parameters, hasLength(0));
+  }
+
+  void test_visitConstructorDeclaration_factory() {
+    String className = "A";
+    ConstructorDeclaration constructorDeclaration =
+        AstTestFactory.constructorDeclaration2(
+            null,
+            Keyword.FACTORY,
+            AstTestFactory.identifier3(className),
+            null,
+            AstTestFactory.formalParameterList(),
+            null,
+            AstTestFactory.blockFunctionBody2());
+
+    ElementHolder holder = buildElementsForAst(constructorDeclaration);
+    List<ConstructorElement> constructors = holder.constructors;
+    expect(constructors, hasLength(1));
+    ConstructorElement constructor = constructors[0];
+    expect(constructor, isNotNull);
+    expect(constructor.isExternal, isFalse);
+    expect(constructor.isFactory, isTrue);
+    expect(constructor.name, "");
+    expect(constructor.functions, hasLength(0));
+    expect(constructor.labels, hasLength(0));
+    expect(constructor.localVariables, hasLength(0));
+    expect(constructor.parameters, hasLength(0));
+  }
+
+  void test_visitConstructorDeclaration_minimal() {
+    String className = "A";
+    ConstructorDeclaration constructorDeclaration =
+        AstTestFactory.constructorDeclaration2(
+            null,
+            null,
+            AstTestFactory.identifier3(className),
+            null,
+            AstTestFactory.formalParameterList(),
+            null,
+            AstTestFactory.blockFunctionBody2());
+    constructorDeclaration.documentationComment = AstTestFactory
+        .documentationComment(
+            [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
+    constructorDeclaration.endToken.offset = 80;
+
+    ElementHolder holder = buildElementsForAst(constructorDeclaration);
+    List<ConstructorElement> constructors = holder.constructors;
+    expect(constructors, hasLength(1));
+    ConstructorElement constructor = constructors[0];
+    expect(constructor, isNotNull);
+    assertHasCodeRange(constructor, 50, 31);
+    expect(constructor.documentationComment, '/// aaa');
+    expect(constructor.isExternal, isFalse);
+    expect(constructor.isFactory, isFalse);
+    expect(constructor.name, "");
+    expect(constructor.functions, hasLength(0));
+    expect(constructor.labels, hasLength(0));
+    expect(constructor.localVariables, hasLength(0));
+    expect(constructor.parameters, hasLength(0));
+  }
+
+  void test_visitConstructorDeclaration_named() {
+    String className = "A";
+    String constructorName = "c";
+    ConstructorDeclaration constructorDeclaration =
+        AstTestFactory.constructorDeclaration2(
+            null,
+            null,
+            AstTestFactory.identifier3(className),
+            constructorName,
+            AstTestFactory.formalParameterList(),
+            null,
+            AstTestFactory.blockFunctionBody2());
+
+    ElementHolder holder = buildElementsForAst(constructorDeclaration);
+    List<ConstructorElement> constructors = holder.constructors;
+    expect(constructors, hasLength(1));
+    ConstructorElement constructor = constructors[0];
+    expect(constructor, isNotNull);
+    expect(constructor.isExternal, isFalse);
+    expect(constructor.isFactory, isFalse);
+    expect(constructor.name, constructorName);
+    expect(constructor.functions, hasLength(0));
+    expect(constructor.labels, hasLength(0));
+    expect(constructor.localVariables, hasLength(0));
+    expect(constructor.parameters, hasLength(0));
+    expect(constructorDeclaration.name.staticElement, same(constructor));
+    expect(constructorDeclaration.element, same(constructor));
+  }
+
+  void test_visitConstructorDeclaration_unnamed() {
+    String className = "A";
+    ConstructorDeclaration constructorDeclaration =
+        AstTestFactory.constructorDeclaration2(
+            null,
+            null,
+            AstTestFactory.identifier3(className),
+            null,
+            AstTestFactory.formalParameterList(),
+            null,
+            AstTestFactory.blockFunctionBody2());
+
+    ElementHolder holder = buildElementsForAst(constructorDeclaration);
+    List<ConstructorElement> constructors = holder.constructors;
+    expect(constructors, hasLength(1));
+    ConstructorElement constructor = constructors[0];
+    expect(constructor, isNotNull);
+    expect(constructor.isExternal, isFalse);
+    expect(constructor.isFactory, isFalse);
+    expect(constructor.name, "");
+    expect(constructor.functions, hasLength(0));
+    expect(constructor.labels, hasLength(0));
+    expect(constructor.localVariables, hasLength(0));
+    expect(constructor.parameters, hasLength(0));
+    expect(constructorDeclaration.element, same(constructor));
+  }
+
+  void test_visitEnumDeclaration() {
+    String enumName = "E";
+    EnumDeclaration enumDeclaration =
+        AstTestFactory.enumDeclaration2(enumName, ["ONE"]);
+    enumDeclaration.documentationComment = AstTestFactory.documentationComment(
+        [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
+    enumDeclaration.endToken.offset = 80;
+    ElementHolder holder = buildElementsForAst(enumDeclaration);
+    List<ClassElement> enums = holder.enums;
+    expect(enums, hasLength(1));
+    ClassElement enumElement = enums[0];
+    expect(enumElement, isNotNull);
+    assertHasCodeRange(enumElement, 50, 31);
+    expect(enumElement.documentationComment, '/// aaa');
+    expect(enumElement.name, enumName);
+  }
+
+  void test_visitFieldDeclaration() {
+    String firstFieldName = "x";
+    String secondFieldName = "y";
+    FieldDeclaration fieldDeclaration =
+        AstTestFactory.fieldDeclaration2(false, null, [
+      AstTestFactory.variableDeclaration(firstFieldName),
+      AstTestFactory.variableDeclaration(secondFieldName)
+    ]);
+    fieldDeclaration.documentationComment = AstTestFactory.documentationComment(
+        [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
+    fieldDeclaration.endToken.offset = 110;
+
+    ElementHolder holder = buildElementsForAst(fieldDeclaration);
+    List<FieldElement> fields = holder.fields;
+    expect(fields, hasLength(2));
+
+    FieldElement firstField = fields[0];
+    expect(firstField, isNotNull);
+    assertHasCodeRange(firstField, 50, 61);
+    expect(firstField.documentationComment, '/// aaa');
+    expect(firstField.name, firstFieldName);
+    expect(firstField.initializer, isNull);
+    expect(firstField.isConst, isFalse);
+    expect(firstField.isFinal, isFalse);
+    expect(firstField.isSynthetic, isFalse);
+
+    FieldElement secondField = fields[1];
+    expect(secondField, isNotNull);
+    assertHasCodeRange(secondField, 50, 61);
+    expect(secondField.documentationComment, '/// aaa');
+    expect(secondField.name, secondFieldName);
+    expect(secondField.initializer, isNull);
+    expect(secondField.isConst, isFalse);
+    expect(secondField.isFinal, isFalse);
+    expect(secondField.isSynthetic, isFalse);
+  }
+
+  void test_visitFieldFormalParameter() {
+    String parameterName = "p";
+    FieldFormalParameter formalParameter =
+        AstTestFactory.fieldFormalParameter(null, null, parameterName);
+    formalParameter.beginToken.offset = 50;
+    formalParameter.endToken.offset = 80;
+    ElementHolder holder = buildElementsForAst(formalParameter);
+    List<ParameterElement> parameters = holder.parameters;
+    expect(parameters, hasLength(1));
+    ParameterElement parameter = parameters[0];
+    expect(parameter, isNotNull);
+    assertHasCodeRange(parameter, 50, 31);
+    expect(parameter.name, parameterName);
+    expect(parameter.initializer, isNull);
+    expect(parameter.isConst, isFalse);
+    expect(parameter.isFinal, isFalse);
+    expect(parameter.isSynthetic, isFalse);
+    expect(parameter.parameterKind, ParameterKind.REQUIRED);
+    expect(parameter.parameters, hasLength(0));
+  }
+
+  void test_visitFieldFormalParameter_functionTyped() {
+    String parameterName = "p";
+    FieldFormalParameter formalParameter = AstTestFactory.fieldFormalParameter(
+        null,
+        null,
+        parameterName,
+        AstTestFactory
+            .formalParameterList([AstTestFactory.simpleFormalParameter3("a")]));
+    ElementHolder holder = buildElementsForAst(formalParameter);
+    List<ParameterElement> parameters = holder.parameters;
+    expect(parameters, hasLength(1));
+    ParameterElement parameter = parameters[0];
+    expect(parameter, isNotNull);
+    expect(parameter.name, parameterName);
+    expect(parameter.initializer, isNull);
+    expect(parameter.isConst, isFalse);
+    expect(parameter.isFinal, isFalse);
+    expect(parameter.isSynthetic, isFalse);
+    expect(parameter.parameterKind, ParameterKind.REQUIRED);
+    expect(parameter.parameters, hasLength(1));
+  }
+
+  void test_visitFormalParameterList() {
+    String firstParameterName = "a";
+    String secondParameterName = "b";
+    FormalParameterList parameterList = AstTestFactory.formalParameterList([
+      AstTestFactory.simpleFormalParameter3(firstParameterName),
+      AstTestFactory.simpleFormalParameter3(secondParameterName)
+    ]);
+    ElementHolder holder = buildElementsForAst(parameterList);
+    List<ParameterElement> parameters = holder.parameters;
+    expect(parameters, hasLength(2));
+    expect(parameters[0].name, firstParameterName);
+    expect(parameters[1].name, secondParameterName);
+  }
+
+  void test_visitFunctionDeclaration_external() {
+    // external f();
+    String functionName = "f";
+    FunctionDeclaration declaration = AstTestFactory.functionDeclaration(
+        null,
+        null,
+        functionName,
+        AstTestFactory.functionExpression2(AstTestFactory.formalParameterList(),
+            AstTestFactory.emptyFunctionBody()));
+    declaration.externalKeyword =
+        TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
+
+    ElementHolder holder = buildElementsForAst(declaration);
+    List<FunctionElement> functions = holder.functions;
+    expect(functions, hasLength(1));
+    FunctionElement function = functions[0];
+    expect(function, isNotNull);
+    expect(function.name, functionName);
+    expect(declaration.element, same(function));
+    expect(declaration.functionExpression.element, same(function));
+    expect(function.hasImplicitReturnType, isTrue);
+    expect(function.isExternal, isTrue);
+    expect(function.isSynthetic, isFalse);
+    expect(function.typeParameters, hasLength(0));
+  }
+
+  void test_visitFunctionDeclaration_getter() {
+    // get f() {}
+    String functionName = "f";
+    FunctionDeclaration declaration = AstTestFactory.functionDeclaration(
+        null,
+        Keyword.GET,
+        functionName,
+        AstTestFactory.functionExpression2(AstTestFactory.formalParameterList(),
+            AstTestFactory.blockFunctionBody2()));
+    declaration.documentationComment = AstTestFactory.documentationComment(
+        [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
+    declaration.endToken.offset = 80;
+
+    ElementHolder holder = buildElementsForAst(declaration);
+    List<PropertyAccessorElement> accessors = holder.accessors;
+    expect(accessors, hasLength(1));
+    PropertyAccessorElement accessor = accessors[0];
+    expect(accessor, isNotNull);
+    assertHasCodeRange(accessor, 50, 31);
+    expect(accessor.documentationComment, '/// aaa');
+    expect(accessor.name, functionName);
+    expect(declaration.element, same(accessor));
+    expect(declaration.functionExpression.element, same(accessor));
+    expect(accessor.hasImplicitReturnType, isTrue);
+    expect(accessor.isGetter, isTrue);
+    expect(accessor.isExternal, isFalse);
+    expect(accessor.isSetter, isFalse);
+    expect(accessor.isSynthetic, isFalse);
+    expect(accessor.typeParameters, hasLength(0));
+    PropertyInducingElement variable = accessor.variable;
+    EngineTestCase.assertInstanceOf((obj) => obj is TopLevelVariableElement,
+        TopLevelVariableElement, variable);
+    expect(variable.isSynthetic, isTrue);
+  }
+
+  void test_visitFunctionDeclaration_plain() {
+    // T f() {}
+    String functionName = "f";
+    FunctionDeclaration declaration = AstTestFactory.functionDeclaration(
+        AstTestFactory.typeName4('T'),
+        null,
+        functionName,
+        AstTestFactory.functionExpression2(AstTestFactory.formalParameterList(),
+            AstTestFactory.blockFunctionBody2()));
+    declaration.documentationComment = AstTestFactory.documentationComment(
+        [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
+    declaration.endToken.offset = 80;
+
+    ElementHolder holder = buildElementsForAst(declaration);
+    List<FunctionElement> functions = holder.functions;
+    expect(functions, hasLength(1));
+    FunctionElement function = functions[0];
+    expect(function, isNotNull);
+    assertHasCodeRange(function, 50, 31);
+    expect(function.documentationComment, '/// aaa');
+    expect(function.hasImplicitReturnType, isFalse);
+    expect(function.name, functionName);
+    expect(declaration.element, same(function));
+    expect(declaration.functionExpression.element, same(function));
+    expect(function.isExternal, isFalse);
+    expect(function.isSynthetic, isFalse);
+    expect(function.typeParameters, hasLength(0));
+  }
+
+  void test_visitFunctionDeclaration_setter() {
+    // set f() {}
+    String functionName = "f";
+    FunctionDeclaration declaration = AstTestFactory.functionDeclaration(
+        null,
+        Keyword.SET,
+        functionName,
+        AstTestFactory.functionExpression2(AstTestFactory.formalParameterList(),
+            AstTestFactory.blockFunctionBody2()));
+    declaration.documentationComment = AstTestFactory.documentationComment(
+        [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
+    declaration.endToken.offset = 80;
+
+    ElementHolder holder = buildElementsForAst(declaration);
+    List<PropertyAccessorElement> accessors = holder.accessors;
+    expect(accessors, hasLength(1));
+    PropertyAccessorElement accessor = accessors[0];
+    expect(accessor, isNotNull);
+    assertHasCodeRange(accessor, 50, 31);
+    expect(accessor.documentationComment, '/// aaa');
+    expect(accessor.hasImplicitReturnType, isTrue);
+    expect(accessor.name, "$functionName=");
+    expect(declaration.element, same(accessor));
+    expect(declaration.functionExpression.element, same(accessor));
+    expect(accessor.isGetter, isFalse);
+    expect(accessor.isExternal, isFalse);
+    expect(accessor.isSetter, isTrue);
+    expect(accessor.isSynthetic, isFalse);
+    expect(accessor.typeParameters, hasLength(0));
+    PropertyInducingElement variable = accessor.variable;
+    EngineTestCase.assertInstanceOf((obj) => obj is TopLevelVariableElement,
+        TopLevelVariableElement, variable);
+    expect(variable.isSynthetic, isTrue);
+  }
+
+  void test_visitFunctionDeclaration_typeParameters() {
+    // f<E>() {}
+    String functionName = 'f';
+    String typeParameterName = 'E';
+    FunctionExpression expression = AstTestFactory.functionExpression3(
+        AstTestFactory.typeParameterList([typeParameterName]),
+        AstTestFactory.formalParameterList(),
+        AstTestFactory.blockFunctionBody2());
+    FunctionDeclaration declaration = AstTestFactory.functionDeclaration(
+        null, null, functionName, expression);
+
+    ElementHolder holder = buildElementsForAst(declaration);
+    List<FunctionElement> functions = holder.functions;
+    expect(functions, hasLength(1));
+    FunctionElement function = functions[0];
+    expect(function, isNotNull);
+    expect(function.hasImplicitReturnType, isTrue);
+    expect(function.name, functionName);
+    expect(function.isExternal, isFalse);
+    expect(function.isSynthetic, isFalse);
+    expect(declaration.element, same(function));
+    expect(expression.element, same(function));
+    List<TypeParameterElement> typeParameters = function.typeParameters;
+    expect(typeParameters, hasLength(1));
+    TypeParameterElement typeParameter = typeParameters[0];
+    expect(typeParameter, isNotNull);
+    expect(typeParameter.name, typeParameterName);
+  }
+
+  void test_visitMethodDeclaration_abstract() {
+    // m();
+    String methodName = "m";
+    MethodDeclaration methodDeclaration = AstTestFactory.methodDeclaration2(
+        null,
+        null,
+        null,
+        null,
+        AstTestFactory.identifier3(methodName),
+        AstTestFactory.formalParameterList(),
+        AstTestFactory.emptyFunctionBody());
+
+    ElementHolder holder = buildElementsForAst(methodDeclaration);
+    List<MethodElement> methods = holder.methods;
+    expect(methods, hasLength(1));
+    MethodElement method = methods[0];
+    expect(method, isNotNull);
+    expect(method.hasImplicitReturnType, isTrue);
+    expect(method.name, methodName);
+    expect(method.functions, hasLength(0));
+    expect(method.labels, hasLength(0));
+    expect(method.localVariables, hasLength(0));
+    expect(method.parameters, hasLength(0));
+    expect(method.typeParameters, hasLength(0));
+    expect(method.isAbstract, isTrue);
+    expect(method.isExternal, isFalse);
+    expect(method.isStatic, isFalse);
+    expect(method.isSynthetic, isFalse);
+  }
+
+  void test_visitMethodDeclaration_duplicateField_synthetic() {
+    buildElementsForText(r'''
+class A {
+  int f;
+  int get f => 42;
+}
+''');
+    ClassDeclaration classNode = compilationUnit.declarations.single;
+    // ClassElement
+    ClassElement classElement = classNode.element;
+    expect(classElement.fields, hasLength(2));
+    expect(classElement.accessors, hasLength(3));
+    FieldElement notSyntheticFieldElement = classElement.fields
+        .singleWhere((f) => f.displayName == 'f' && !f.isSynthetic);
+    FieldElement syntheticFieldElement = classElement.fields
+        .singleWhere((f) => f.displayName == 'f' && f.isSynthetic);
+    PropertyAccessorElement syntheticGetterElement = classElement.accessors
+        .singleWhere(
+            (a) => a.displayName == 'f' && a.isGetter && a.isSynthetic);
+    PropertyAccessorElement syntheticSetterElement = classElement.accessors
+        .singleWhere(
+            (a) => a.displayName == 'f' && a.isSetter && a.isSynthetic);
+    PropertyAccessorElement notSyntheticGetterElement = classElement.accessors
+        .singleWhere(
+            (a) => a.displayName == 'f' && a.isGetter && !a.isSynthetic);
+    expect(notSyntheticFieldElement.getter, same(syntheticGetterElement));
+    expect(notSyntheticFieldElement.setter, same(syntheticSetterElement));
+    expect(syntheticFieldElement.getter, same(notSyntheticGetterElement));
+    expect(syntheticFieldElement.setter, isNull);
+    // class members nodes and their elements
+    FieldDeclaration fieldDeclNode = classNode.members[0];
+    VariableDeclaration fieldNode = fieldDeclNode.fields.variables.single;
+    MethodDeclaration getterNode = classNode.members[1];
+    expect(fieldNode.element, notSyntheticFieldElement);
+    expect(getterNode.element, notSyntheticGetterElement);
+  }
+
+  void test_visitMethodDeclaration_external() {
+    // external m();
+    String methodName = "m";
+    MethodDeclaration methodDeclaration = AstTestFactory.methodDeclaration2(
+        null,
+        null,
+        null,
+        null,
+        AstTestFactory.identifier3(methodName),
+        AstTestFactory.formalParameterList(),
+        AstTestFactory.emptyFunctionBody());
+    methodDeclaration.externalKeyword =
+        TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
+
+    ElementHolder holder = buildElementsForAst(methodDeclaration);
+    List<MethodElement> methods = holder.methods;
+    expect(methods, hasLength(1));
+    MethodElement method = methods[0];
+    expect(method, isNotNull);
+    expect(method.hasImplicitReturnType, isTrue);
+    expect(method.name, methodName);
+    expect(method.functions, hasLength(0));
+    expect(method.labels, hasLength(0));
+    expect(method.localVariables, hasLength(0));
+    expect(method.parameters, hasLength(0));
+    expect(method.typeParameters, hasLength(0));
+    expect(method.isAbstract, isFalse);
+    expect(method.isExternal, isTrue);
+    expect(method.isStatic, isFalse);
+    expect(method.isSynthetic, isFalse);
+  }
+
+  void test_visitMethodDeclaration_getter() {
+    // get m() {}
+    String methodName = "m";
+    MethodDeclaration methodDeclaration = AstTestFactory.methodDeclaration2(
+        null,
+        null,
+        Keyword.GET,
+        null,
+        AstTestFactory.identifier3(methodName),
+        AstTestFactory.formalParameterList(),
+        AstTestFactory.blockFunctionBody2());
+    methodDeclaration.documentationComment = AstTestFactory
+        .documentationComment(
+            [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
+    methodDeclaration.endToken.offset = 80;
+
+    ElementHolder holder = buildElementsForAst(methodDeclaration);
+    List<FieldElement> fields = holder.fields;
+    expect(fields, hasLength(1));
+    FieldElement field = fields[0];
+    expect(field, isNotNull);
+    expect(field.name, methodName);
+    expect(field.isSynthetic, isTrue);
+    expect(field.setter, isNull);
+    PropertyAccessorElement getter = field.getter;
+    expect(getter, isNotNull);
+    assertHasCodeRange(getter, 50, 31);
+    expect(getter.documentationComment, '/// aaa');
+    expect(getter.hasImplicitReturnType, isTrue);
+    expect(getter.isAbstract, isFalse);
+    expect(getter.isExternal, isFalse);
+    expect(getter.isGetter, isTrue);
+    expect(getter.isSynthetic, isFalse);
+    expect(getter.name, methodName);
+    expect(getter.variable, field);
+    expect(getter.functions, hasLength(0));
+    expect(getter.labels, hasLength(0));
+    expect(getter.localVariables, hasLength(0));
+    expect(getter.parameters, hasLength(0));
+  }
+
+  void test_visitMethodDeclaration_getter_abstract() {
+    // get m();
+    String methodName = "m";
+    MethodDeclaration methodDeclaration = AstTestFactory.methodDeclaration2(
+        null,
+        null,
+        Keyword.GET,
+        null,
+        AstTestFactory.identifier3(methodName),
+        AstTestFactory.formalParameterList(),
+        AstTestFactory.emptyFunctionBody());
+
+    ElementHolder holder = buildElementsForAst(methodDeclaration);
+    List<FieldElement> fields = holder.fields;
+    expect(fields, hasLength(1));
+    FieldElement field = fields[0];
+    expect(field, isNotNull);
+    expect(field.name, methodName);
+    expect(field.isSynthetic, isTrue);
+    expect(field.setter, isNull);
+    PropertyAccessorElement getter = field.getter;
+    expect(getter, isNotNull);
+    expect(getter.hasImplicitReturnType, isTrue);
+    expect(getter.isAbstract, isTrue);
+    expect(getter.isExternal, isFalse);
+    expect(getter.isGetter, isTrue);
+    expect(getter.isSynthetic, isFalse);
+    expect(getter.name, methodName);
+    expect(getter.variable, field);
+    expect(getter.functions, hasLength(0));
+    expect(getter.labels, hasLength(0));
+    expect(getter.localVariables, hasLength(0));
+    expect(getter.parameters, hasLength(0));
+  }
+
+  void test_visitMethodDeclaration_getter_external() {
+    // external get m();
+    String methodName = "m";
+    MethodDeclaration methodDeclaration = AstTestFactory.methodDeclaration(
+        null,
+        null,
+        Keyword.GET,
+        null,
+        AstTestFactory.identifier3(methodName),
+        AstTestFactory.formalParameterList());
+    methodDeclaration.externalKeyword =
+        TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
+
+    ElementHolder holder = buildElementsForAst(methodDeclaration);
+    List<FieldElement> fields = holder.fields;
+    expect(fields, hasLength(1));
+    FieldElement field = fields[0];
+    expect(field, isNotNull);
+    expect(field.name, methodName);
+    expect(field.isSynthetic, isTrue);
+    expect(field.setter, isNull);
+    PropertyAccessorElement getter = field.getter;
+    expect(getter, isNotNull);
+    expect(getter.hasImplicitReturnType, isTrue);
+    expect(getter.isAbstract, isFalse);
+    expect(getter.isExternal, isTrue);
+    expect(getter.isGetter, isTrue);
+    expect(getter.isSynthetic, isFalse);
+    expect(getter.name, methodName);
+    expect(getter.variable, field);
+    expect(getter.functions, hasLength(0));
+    expect(getter.labels, hasLength(0));
+    expect(getter.localVariables, hasLength(0));
+    expect(getter.parameters, hasLength(0));
+  }
+
+  void test_visitMethodDeclaration_minimal() {
+    // T m() {}
+    String methodName = "m";
+    MethodDeclaration methodDeclaration = AstTestFactory.methodDeclaration2(
+        null,
+        AstTestFactory.typeName4('T'),
+        null,
+        null,
+        AstTestFactory.identifier3(methodName),
+        AstTestFactory.formalParameterList(),
+        AstTestFactory.blockFunctionBody2());
+    methodDeclaration.documentationComment = AstTestFactory
+        .documentationComment(
+            [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
+    methodDeclaration.endToken.offset = 80;
+
+    ElementHolder holder = buildElementsForAst(methodDeclaration);
+    List<MethodElement> methods = holder.methods;
+    expect(methods, hasLength(1));
+    MethodElement method = methods[0];
+    expect(method, isNotNull);
+    assertHasCodeRange(method, 50, 31);
+    expect(method.documentationComment, '/// aaa');
+    expect(method.hasImplicitReturnType, isFalse);
+    expect(method.name, methodName);
+    expect(method.functions, hasLength(0));
+    expect(method.labels, hasLength(0));
+    expect(method.localVariables, hasLength(0));
+    expect(method.parameters, hasLength(0));
+    expect(method.typeParameters, hasLength(0));
+    expect(method.isAbstract, isFalse);
+    expect(method.isExternal, isFalse);
+    expect(method.isStatic, isFalse);
+    expect(method.isSynthetic, isFalse);
+  }
+
+  void test_visitMethodDeclaration_operator() {
+    // operator +(addend) {}
+    String methodName = "+";
+    MethodDeclaration methodDeclaration = AstTestFactory.methodDeclaration2(
+        null,
+        null,
+        null,
+        Keyword.OPERATOR,
+        AstTestFactory.identifier3(methodName),
+        AstTestFactory.formalParameterList(
+            [AstTestFactory.simpleFormalParameter3("addend")]),
+        AstTestFactory.blockFunctionBody2());
+
+    ElementHolder holder = buildElementsForAst(methodDeclaration);
+    List<MethodElement> methods = holder.methods;
+    expect(methods, hasLength(1));
+    MethodElement method = methods[0];
+    expect(method, isNotNull);
+    expect(method.hasImplicitReturnType, isTrue);
+    expect(method.name, methodName);
+    expect(method.functions, hasLength(0));
+    expect(method.labels, hasLength(0));
+    expect(method.localVariables, hasLength(0));
+    expect(method.parameters, hasLength(1));
+    expect(method.typeParameters, hasLength(0));
+    expect(method.isAbstract, isFalse);
+    expect(method.isExternal, isFalse);
+    expect(method.isStatic, isFalse);
+    expect(method.isSynthetic, isFalse);
+  }
+
+  void test_visitMethodDeclaration_setter() {
+    // set m() {}
+    String methodName = "m";
+    MethodDeclaration methodDeclaration = AstTestFactory.methodDeclaration2(
+        null,
+        null,
+        Keyword.SET,
+        null,
+        AstTestFactory.identifier3(methodName),
+        AstTestFactory.formalParameterList(),
+        AstTestFactory.blockFunctionBody2());
+    methodDeclaration.documentationComment = AstTestFactory
+        .documentationComment(
+            [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
+    methodDeclaration.endToken.offset = 80;
+
+    ElementHolder holder = buildElementsForAst(methodDeclaration);
+    List<FieldElement> fields = holder.fields;
+    expect(fields, hasLength(1));
+    FieldElement field = fields[0];
+    expect(field, isNotNull);
+    expect(field.name, methodName);
+    expect(field.isSynthetic, isTrue);
+    expect(field.getter, isNull);
+
+    PropertyAccessorElement setter = field.setter;
+    expect(setter, isNotNull);
+    assertHasCodeRange(setter, 50, 31);
+    expect(setter.documentationComment, '/// aaa');
+    expect(setter.hasImplicitReturnType, isTrue);
+    expect(setter.isAbstract, isFalse);
+    expect(setter.isExternal, isFalse);
+    expect(setter.isSetter, isTrue);
+    expect(setter.isSynthetic, isFalse);
+    expect(setter.name, "$methodName=");
+    expect(setter.displayName, methodName);
+    expect(setter.variable, field);
+    expect(setter.functions, hasLength(0));
+    expect(setter.labels, hasLength(0));
+    expect(setter.localVariables, hasLength(0));
+    expect(setter.parameters, hasLength(0));
+  }
+
+  void test_visitMethodDeclaration_setter_abstract() {
+    // set m();
+    String methodName = "m";
+    MethodDeclaration methodDeclaration = AstTestFactory.methodDeclaration2(
+        null,
+        null,
+        Keyword.SET,
+        null,
+        AstTestFactory.identifier3(methodName),
+        AstTestFactory.formalParameterList(),
+        AstTestFactory.emptyFunctionBody());
+
+    ElementHolder holder = buildElementsForAst(methodDeclaration);
+    List<FieldElement> fields = holder.fields;
+    expect(fields, hasLength(1));
+    FieldElement field = fields[0];
+    expect(field, isNotNull);
+    expect(field.name, methodName);
+    expect(field.isSynthetic, isTrue);
+    expect(field.getter, isNull);
+    PropertyAccessorElement setter = field.setter;
+    expect(setter, isNotNull);
+    expect(setter.hasImplicitReturnType, isTrue);
+    expect(setter.isAbstract, isTrue);
+    expect(setter.isExternal, isFalse);
+    expect(setter.isSetter, isTrue);
+    expect(setter.isSynthetic, isFalse);
+    expect(setter.name, "$methodName=");
+    expect(setter.displayName, methodName);
+    expect(setter.variable, field);
+    expect(setter.functions, hasLength(0));
+    expect(setter.labels, hasLength(0));
+    expect(setter.localVariables, hasLength(0));
+    expect(setter.parameters, hasLength(0));
+  }
+
+  void test_visitMethodDeclaration_setter_external() {
+    // external m();
+    String methodName = "m";
+    MethodDeclaration methodDeclaration = AstTestFactory.methodDeclaration(
+        null,
+        null,
+        Keyword.SET,
+        null,
+        AstTestFactory.identifier3(methodName),
+        AstTestFactory.formalParameterList());
+    methodDeclaration.externalKeyword =
+        TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
+
+    ElementHolder holder = buildElementsForAst(methodDeclaration);
+    List<FieldElement> fields = holder.fields;
+    expect(fields, hasLength(1));
+    FieldElement field = fields[0];
+    expect(field, isNotNull);
+    expect(field.name, methodName);
+    expect(field.isSynthetic, isTrue);
+    expect(field.getter, isNull);
+    PropertyAccessorElement setter = field.setter;
+    expect(setter, isNotNull);
+    expect(setter.hasImplicitReturnType, isTrue);
+    expect(setter.isAbstract, isFalse);
+    expect(setter.isExternal, isTrue);
+    expect(setter.isSetter, isTrue);
+    expect(setter.isSynthetic, isFalse);
+    expect(setter.name, "$methodName=");
+    expect(setter.displayName, methodName);
+    expect(setter.variable, field);
+    expect(setter.functions, hasLength(0));
+    expect(setter.labels, hasLength(0));
+    expect(setter.localVariables, hasLength(0));
+    expect(setter.parameters, hasLength(0));
+  }
+
+  void test_visitMethodDeclaration_static() {
+    // static m() {}
+    String methodName = "m";
+    MethodDeclaration methodDeclaration = AstTestFactory.methodDeclaration2(
+        Keyword.STATIC,
+        null,
+        null,
+        null,
+        AstTestFactory.identifier3(methodName),
+        AstTestFactory.formalParameterList(),
+        AstTestFactory.blockFunctionBody2());
+    ElementHolder holder = buildElementsForAst(methodDeclaration);
+    List<MethodElement> methods = holder.methods;
+    expect(methods, hasLength(1));
+    MethodElement method = methods[0];
+    expect(method, isNotNull);
+    expect(method.hasImplicitReturnType, isTrue);
+    expect(method.name, methodName);
+    expect(method.functions, hasLength(0));
+    expect(method.labels, hasLength(0));
+    expect(method.localVariables, hasLength(0));
+    expect(method.parameters, hasLength(0));
+    expect(method.typeParameters, hasLength(0));
+    expect(method.isAbstract, isFalse);
+    expect(method.isExternal, isFalse);
+    expect(method.isStatic, isTrue);
+    expect(method.isSynthetic, isFalse);
+  }
+
+  void test_visitMethodDeclaration_typeParameters() {
+    // m<E>() {}
+    String methodName = "m";
+    MethodDeclaration methodDeclaration = AstTestFactory.methodDeclaration2(
+        null,
+        null,
+        null,
+        null,
+        AstTestFactory.identifier3(methodName),
+        AstTestFactory.formalParameterList(),
+        AstTestFactory.blockFunctionBody2());
+    methodDeclaration.typeParameters = AstTestFactory.typeParameterList(['E']);
+
+    ElementHolder holder = buildElementsForAst(methodDeclaration);
+    List<MethodElement> methods = holder.methods;
+    expect(methods, hasLength(1));
+    MethodElement method = methods[0];
+    expect(method, isNotNull);
+    expect(method.hasImplicitReturnType, isTrue);
+    expect(method.name, methodName);
+    expect(method.functions, hasLength(0));
+    expect(method.labels, hasLength(0));
+    expect(method.localVariables, hasLength(0));
+    expect(method.parameters, hasLength(0));
+    expect(method.typeParameters, hasLength(1));
+    expect(method.isAbstract, isFalse);
+    expect(method.isExternal, isFalse);
+    expect(method.isStatic, isFalse);
+    expect(method.isSynthetic, isFalse);
+  }
+
+  void test_visitTypeAlias_minimal() {
+    String aliasName = "F";
+    TypeAlias typeAlias = AstTestFactory.typeAlias(null, aliasName, null, null);
+    ElementHolder holder = buildElementsForAst(typeAlias);
+    List<FunctionTypeAliasElement> aliases = holder.typeAliases;
+    expect(aliases, hasLength(1));
+    FunctionTypeAliasElement alias = aliases[0];
+    expect(alias, isNotNull);
+    expect(alias.name, aliasName);
+    expect(alias.type, isNotNull);
+    expect(alias.isSynthetic, isFalse);
+  }
+
+  void test_visitTypeAlias_withFormalParameters() {
+    String aliasName = "F";
+    String firstParameterName = "x";
+    String secondParameterName = "y";
+    TypeAlias typeAlias = AstTestFactory.typeAlias(
+        null,
+        aliasName,
+        AstTestFactory.typeParameterList(),
+        AstTestFactory.formalParameterList([
+          AstTestFactory.simpleFormalParameter3(firstParameterName),
+          AstTestFactory.simpleFormalParameter3(secondParameterName)
+        ]));
+    typeAlias.beginToken.offset = 50;
+    typeAlias.endToken.offset = 80;
+    ElementHolder holder = buildElementsForAst(typeAlias);
+    List<FunctionTypeAliasElement> aliases = holder.typeAliases;
+    expect(aliases, hasLength(1));
+    FunctionTypeAliasElement alias = aliases[0];
+    expect(alias, isNotNull);
+    assertHasCodeRange(alias, 50, 31);
+    expect(alias.name, aliasName);
+    expect(alias.type, isNotNull);
+    expect(alias.isSynthetic, isFalse);
+    List<VariableElement> parameters = alias.parameters;
+    expect(parameters, hasLength(2));
+    expect(parameters[0].name, firstParameterName);
+    expect(parameters[1].name, secondParameterName);
+    List<TypeParameterElement> typeParameters = alias.typeParameters;
+    expect(typeParameters, isNotNull);
+    expect(typeParameters, hasLength(0));
+  }
+
+  void test_visitTypeAlias_withTypeParameters() {
+    String aliasName = "F";
+    String firstTypeParameterName = "A";
+    String secondTypeParameterName = "B";
+    TypeAlias typeAlias = AstTestFactory.typeAlias(
+        null,
+        aliasName,
+        AstTestFactory.typeParameterList(
+            [firstTypeParameterName, secondTypeParameterName]),
+        AstTestFactory.formalParameterList());
+    ElementHolder holder = buildElementsForAst(typeAlias);
+    List<FunctionTypeAliasElement> aliases = holder.typeAliases;
+    expect(aliases, hasLength(1));
+    FunctionTypeAliasElement alias = aliases[0];
+    expect(alias, isNotNull);
+    expect(alias.name, aliasName);
+    expect(alias.type, isNotNull);
+    expect(alias.isSynthetic, isFalse);
+    List<VariableElement> parameters = alias.parameters;
+    expect(parameters, isNotNull);
+    expect(parameters, hasLength(0));
+    List<TypeParameterElement> typeParameters = alias.typeParameters;
+    expect(typeParameters, hasLength(2));
+    expect(typeParameters[0].name, firstTypeParameterName);
+    expect(typeParameters[1].name, secondTypeParameterName);
+  }
+
+  void test_visitTypeParameter() {
+    String parameterName = "E";
+    TypeParameter typeParameter = AstTestFactory.typeParameter(parameterName);
+    typeParameter.beginToken.offset = 50;
+    ElementHolder holder = buildElementsForAst(typeParameter);
+    List<TypeParameterElement> typeParameters = holder.typeParameters;
+    expect(typeParameters, hasLength(1));
+    TypeParameterElement typeParameterElement = typeParameters[0];
+    expect(typeParameterElement, isNotNull);
+    assertHasCodeRange(typeParameterElement, 50, 1);
+    expect(typeParameterElement.name, parameterName);
+    expect(typeParameterElement.bound, isNull);
+    expect(typeParameterElement.isSynthetic, isFalse);
+  }
+}
+
+abstract class _BaseTest {
+  CompilationUnitElement compilationUnitElement;
+  CompilationUnit _compilationUnit;
+
+  CompilationUnit get compilationUnit => _compilationUnit;
+
+  void assertHasCodeRange(Element element, int offset, int length) {
+    ElementImpl elementImpl = element;
+    expect(elementImpl.codeOffset, offset);
+    expect(elementImpl.codeLength, length);
+  }
+
+  /**
+   * Build elements using [ApiElementBuilder].
+   */
+  ElementHolder buildElementsForAst(AstNode node) {
+    ElementHolder holder = new ElementHolder();
+    AstVisitor builder = createElementBuilder(holder);
+    node.accept(builder);
+    return holder;
+  }
+
+  /**
+   * Parse the given [code], and build elements using [ApiElementBuilder].
+   */
+  ElementHolder buildElementsForText(String code) {
+    ElementHolder holder = new ElementHolder();
+    AstVisitor builder = createElementBuilder(holder);
+    _visitAstOfCode(code, builder);
+    return holder;
+  }
+
+  /**
+   * Verify that the given [metadata] has exactly one annotation, and that its
+   * [ElementAnnotationImpl] is unresolved.
+   */
+  void checkAnnotation(NodeList<Annotation> metadata) {
+    expect(metadata, hasLength(1));
+    expect(metadata[0], new isInstanceOf<AnnotationImpl>());
+    AnnotationImpl annotation = metadata[0];
+    expect(annotation.elementAnnotation,
+        new isInstanceOf<ElementAnnotationImpl>());
+    ElementAnnotationImpl elementAnnotation = annotation.elementAnnotation;
+    expect(elementAnnotation.element, isNull); // Not yet resolved
+    expect(elementAnnotation.compilationUnit, isNotNull);
+    expect(elementAnnotation.compilationUnit, compilationUnitElement);
+  }
+
+  /**
+   * Verify that the given [element] has exactly one annotation, and that its
+   * [ElementAnnotationImpl] is unresolved.
+   */
+  void checkMetadata(Element element) {
+    expect(element.metadata, hasLength(1));
+    expect(element.metadata[0], new isInstanceOf<ElementAnnotationImpl>());
+    ElementAnnotationImpl elementAnnotation = element.metadata[0];
+    expect(elementAnnotation.element, isNull); // Not yet resolved
+    expect(elementAnnotation.compilationUnit, isNotNull);
+    expect(elementAnnotation.compilationUnit, compilationUnitElement);
+  }
+
+  AstVisitor createElementBuilder(ElementHolder holder);
+
+  void setUp() {
+    compilationUnitElement = new CompilationUnitElementImpl('test.dart');
+  }
+
+  void _assertVisibleRange(LocalElement element, int offset, int end) {
+    SourceRange visibleRange = element.visibleRange;
+    expect(visibleRange.offset, offset);
+    expect(visibleRange.end, end);
+  }
+
+  /**
+   * Parse the given [code], and visit it with the given [visitor].
+   * Fail if any error is logged.
+   */
+  void _visitAstOfCode(String code, AstVisitor visitor) {
+    TestLogger logger = new TestLogger();
+    AnalysisEngine.instance.logger = logger;
+    try {
+      _compilationUnit = ParserTestCase.parseCompilationUnit(code);
+      compilationUnit.accept(visitor);
+    } finally {
+      expect(logger.log, hasLength(0));
+      AnalysisEngine.instance.logger = Logger.NULL;
+    }
+  }
+}
diff --git a/pkg/analyzer/test/dart/element/element_test.dart b/pkg/analyzer/test/dart/element/element_test.dart
index 615d7b2..c4490fc 100644
--- a/pkg/analyzer/test/dart/element/element_test.dart
+++ b/pkg/analyzer/test/dart/element/element_test.dart
@@ -6,15 +6,15 @@
 
 import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer/src/generated/testing/element_factory.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../generated/test_support.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ElementKindTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ElementKindTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/dart/element/test_all.dart b/pkg/analyzer/test/dart/element/test_all.dart
index 5dac037..d0e4cea 100644
--- a/pkg/analyzer/test/dart/element/test_all.dart
+++ b/pkg/analyzer/test/dart/element/test_all.dart
@@ -4,15 +4,15 @@
 
 library analyzer.test.dart.element.test_all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
+import 'builder_test.dart' as builder;
 import 'element_test.dart' as element;
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('element tests', () {
+  defineReflectiveSuite(() {
+    builder.main();
     element.main();
-  });
+  }, name: 'element');
 }
diff --git a/pkg/analyzer/test/dart/test_all.dart b/pkg/analyzer/test/dart/test_all.dart
index df7ff55..7827a63 100644
--- a/pkg/analyzer/test/dart/test_all.dart
+++ b/pkg/analyzer/test/dart/test_all.dart
@@ -4,17 +4,15 @@
 
 library analyzer.test.generated.test_all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../utils.dart';
 import 'ast/test_all.dart' as ast;
 import 'element/test_all.dart' as element;
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('dart tests', () {
+  defineReflectiveSuite(() {
     ast.main();
     element.main();
-  });
+  }, name: 'dart');
 }
diff --git a/pkg/analyzer/test/embedder_tests.dart b/pkg/analyzer/test/embedder_tests.dart
index f10606f..18083dd 100644
--- a/pkg/analyzer/test/embedder_tests.dart
+++ b/pkg/analyzer/test/embedder_tests.dart
@@ -8,10 +8,8 @@
 
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/file_system/memory_file_system.dart';
-import 'package:path/path.dart' as path;
 
 import 'resource_utils.dart';
-import 'utils.dart';
 
 abstract class EmbedderRelatedTest {
   final String emptyPath = '/home/.pub-cache/empty';
@@ -22,8 +20,7 @@
   ResourceProvider resourceProvider;
 
   buildResourceProvider() {
-    MemoryResourceProvider rawProvider =
-        new MemoryResourceProvider(isWindows: isWindows);
+    MemoryResourceProvider rawProvider = new MemoryResourceProvider();
     resourceProvider = new TestResourceProvider(rawProvider);
     pathTranslator = new TestPathTranslator(rawProvider)
       ..newFolder('/home/.pub-cache/empty')
@@ -47,12 +44,10 @@
   }
 
   void setUp() {
-    initializeTestEnvironment(path.context);
     buildResourceProvider();
   }
 
   void tearDown() {
-    initializeTestEnvironment();
     clearResourceProvider();
   }
 }
diff --git a/pkg/analyzer/test/file_system/memory_file_system_test.dart b/pkg/analyzer/test/file_system/memory_file_system_test.dart
index 0878963..cb39b49 100644
--- a/pkg/analyzer/test/file_system/memory_file_system_test.dart
+++ b/pkg/analyzer/test/file_system/memory_file_system_test.dart
@@ -12,21 +12,20 @@
 import 'package:analyzer/src/generated/engine.dart' show TimestampedData;
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/utilities_dart.dart';
-import 'package:path/path.dart';
+import 'package:path/path.dart' as pathos;
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 import 'package:watcher/watcher.dart';
 
-import '../utils.dart';
-
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(FileSystemExceptionTest);
-  defineReflectiveTests(FileTest);
-  defineReflectiveTests(FolderTest);
-  defineReflectiveTests(MemoryFileSourceExistingTest);
-  defineReflectiveTests(MemoryFileSourceNotExistingTest);
-  defineReflectiveTests(MemoryResourceProviderTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(FileSystemExceptionTest);
+    defineReflectiveTests(FileTest);
+    defineReflectiveTests(FolderTest);
+    defineReflectiveTests(MemoryFileSourceExistingTest);
+    defineReflectiveTests(MemoryFileSourceNotExistingTest);
+    defineReflectiveTests(MemoryResourceProviderTest);
+  });
 }
 
 var _isFile = new isInstanceOf<File>();
@@ -49,7 +48,8 @@
   MemoryResourceProvider provider = new MemoryResourceProvider();
 
   void test_delete() {
-    File file = provider.newFile('/foo/file.txt', 'content');
+    File file =
+        provider.newFile(provider.convertPath('/foo/file.txt'), 'content');
     expect(file.exists, isTrue);
     // delete
     file.delete();
@@ -57,7 +57,7 @@
   }
 
   void test_equals_beforeAndAfterCreate() {
-    String path = '/file.txt';
+    String path = provider.convertPath('/file.txt');
     File file1 = provider.getResource(path);
     provider.newFile(path, 'contents');
     File file2 = provider.getResource(path);
@@ -65,37 +65,39 @@
   }
 
   void test_equals_false() {
-    File fileA = provider.getResource('/fileA.txt');
-    File fileB = provider.getResource('/fileB.txt');
+    File fileA = provider.getResource(provider.convertPath('/fileA.txt'));
+    File fileB = provider.getResource(provider.convertPath('/fileB.txt'));
     expect(fileA == new Object(), isFalse);
     expect(fileA == fileB, isFalse);
   }
 
   void test_equals_true() {
-    File file = provider.getResource('/file.txt');
+    File file = provider.getResource(provider.convertPath('/file.txt'));
     expect(file == file, isTrue);
   }
 
   void test_exists_false() {
-    File file = provider.getResource('/file.txt');
+    File file = provider.getResource(provider.convertPath('/file.txt'));
     expect(file, isNotNull);
     expect(file.exists, isFalse);
   }
 
   void test_exists_true() {
-    provider.newFile('/foo/file.txt', 'qwerty');
-    File file = provider.getResource('/foo/file.txt');
+    String path = provider.convertPath('/foo/file.txt');
+    provider.newFile(path, 'qwerty');
+    File file = provider.getResource(path);
     expect(file, isNotNull);
     expect(file.exists, isTrue);
   }
 
   void test_fullName() {
-    File file = provider.getResource('/foo/bar/file.txt');
-    expect(file.path, '/foo/bar/file.txt');
+    String path = provider.convertPath('/foo/bar/file.txt');
+    File file = provider.getResource(path);
+    expect(file.path, path);
   }
 
   void test_hashCode() {
-    String path = '/foo/bar/file.txt';
+    String path = provider.convertPath('/foo/bar/file.txt');
     File file1 = provider.getResource(path);
     provider.newFile(path, 'contents');
     File file2 = provider.getResource(path);
@@ -103,14 +105,28 @@
   }
 
   void test_isOrContains() {
-    String path = '/foo/bar/file.txt';
+    String path = provider.convertPath('/foo/bar/file.txt');
     File file = provider.getResource(path);
     expect(file.isOrContains(path), isTrue);
-    expect(file.isOrContains('/foo/bar'), isFalse);
+    expect(file.isOrContains(provider.convertPath('/foo/bar')), isFalse);
+  }
+
+  void test_lengthSync_doesNotExist() {
+    File file = provider.getResource(provider.convertPath('/test.txt'));
+    expect(() {
+      file.lengthSync;
+    }, throwsA(_isFileSystemException));
+  }
+
+  void test_lengthSync_exists() {
+    List<int> bytes = <int>[1, 2, 3, 4, 5];
+    File file =
+        provider.newFileWithBytes(provider.convertPath('/file.bin'), bytes);
+    expect(file.lengthSync, bytes.length);
   }
 
   void test_modificationStamp_doesNotExist() {
-    String path = '/foo/bar/file.txt';
+    String path = provider.convertPath('/foo/bar/file.txt');
     File file = provider.newFile(path, 'qwerty');
     provider.deleteFile(path);
     expect(() {
@@ -119,21 +135,22 @@
   }
 
   void test_modificationStamp_exists() {
-    String path = '/foo/bar/file.txt';
+    String path = provider.convertPath('/foo/bar/file.txt');
     File file = provider.newFile(path, 'qwerty');
     expect(file.modificationStamp, isNonNegative);
   }
 
   void test_parent() {
-    provider.newFile('/foo/bar/file.txt', 'content');
-    File file = provider.getResource('/foo/bar/file.txt');
+    String path = provider.convertPath('/foo/bar/file.txt');
+    provider.newFile(path, 'content');
+    File file = provider.getResource(path);
     Resource parent = file.parent;
     expect(parent, new isInstanceOf<Folder>());
-    expect(parent.path, equals('/foo/bar'));
+    expect(parent.path, equals(provider.convertPath('/foo/bar')));
   }
 
   void test_readAsBytesSync_doesNotExist() {
-    File file = provider.getResource('/test.bin');
+    File file = provider.getResource(provider.convertPath('/test.bin'));
     expect(() {
       file.readAsBytesSync();
     }, throwsA(_isFileSystemException));
@@ -141,25 +158,26 @@
 
   void test_readAsBytesSync_exists() {
     List<int> bytes = <int>[1, 2, 3, 4, 5];
-    File file = provider.newFileWithBytes('/file.bin', bytes);
+    File file =
+        provider.newFileWithBytes(provider.convertPath('/file.bin'), bytes);
     expect(file.readAsBytesSync(), bytes);
   }
 
   void test_readAsStringSync_doesNotExist() {
-    File file = provider.getResource('/test.txt');
+    File file = provider.getResource(provider.convertPath('/test.txt'));
     expect(() {
       file.readAsStringSync();
     }, throwsA(_isFileSystemException));
   }
 
   void test_readAsStringSync_exists() {
-    File file = provider.newFile('/file.txt', 'abc');
+    File file = provider.newFile(provider.convertPath('/file.txt'), 'abc');
     expect(file.readAsStringSync(), 'abc');
   }
 
   void test_renameSync_newDoesNotExist() {
-    String oldPath = '/foo/bar/file.txt';
-    String newPath = '/foo/bar/new-file.txt';
+    String oldPath = provider.convertPath('/foo/bar/file.txt');
+    String newPath = provider.convertPath('/foo/bar/new-file.txt');
     File file = provider.newFile(oldPath, 'text');
     File newFile = file.renameSync(newPath);
     expect(file.path, oldPath);
@@ -170,8 +188,8 @@
   }
 
   void test_renameSync_newExists_file() {
-    String oldPath = '/foo/bar/file.txt';
-    String newPath = '/foo/bar/new-file.txt';
+    String oldPath = provider.convertPath('/foo/bar/file.txt');
+    String newPath = provider.convertPath('/foo/bar/new-file.txt');
     File file = provider.newFile(oldPath, 'text');
     provider.newFile(newPath, 'new text');
     File newFile = file.renameSync(newPath);
@@ -183,8 +201,8 @@
   }
 
   void test_renameSync_newExists_folder() {
-    String oldPath = '/foo/bar/file.txt';
-    String newPath = '/foo/bar/baz';
+    String oldPath = provider.convertPath('/foo/bar/file.txt');
+    String newPath = provider.convertPath('/foo/bar/baz');
     File file = provider.newFile(oldPath, 'text');
     provider.newFolder(newPath);
     expect(() {
@@ -195,29 +213,31 @@
   }
 
   void test_resolveSymbolicLinksSync() {
-    File file = provider.newFile('/test.txt', 'text');
+    File file = provider.newFile(provider.convertPath('/test.txt'), 'text');
     expect(file.resolveSymbolicLinksSync(), file);
   }
 
   void test_shortName() {
-    File file = provider.getResource('/foo/bar/file.txt');
+    File file = provider.getResource(provider.convertPath('/foo/bar/file.txt'));
     expect(file.shortName, 'file.txt');
   }
 
   void test_toString() {
-    File file = provider.getResource('/foo/bar/file.txt');
-    expect(file.toString(), '/foo/bar/file.txt');
+    String path = provider.convertPath('/foo/bar/file.txt');
+    File file = provider.getResource(path);
+    expect(file.toString(), path);
   }
 
   void test_toUri() {
-    String path = '/foo/file.txt';
+    String path = provider.convertPath('/foo/file.txt');
     File file = provider.newFile(path, '');
-    expect(file.toUri(), new Uri.file(path, windows: false));
+    expect(file.toUri(), provider.pathContext.toUri(path));
   }
 
   void test_writeAsBytesSync_existing() {
     List<int> content = <int>[1, 2];
-    File file = provider.newFileWithBytes('/foo/file.bin', content);
+    File file = provider.newFileWithBytes(
+        provider.convertPath('/foo/file.bin'), content);
     expect(file.readAsBytesSync(), content);
     // write new bytes
     content = <int>[10, 20];
@@ -226,7 +246,7 @@
   }
 
   void test_writeAsBytesSync_new() {
-    File file = provider.getFile('/foo/file.bin');
+    File file = provider.getFile(provider.convertPath('/foo/file.bin'));
     expect(file.exists, false);
     // write new bytes
     List<int> content = <int>[10, 20];
@@ -237,7 +257,8 @@
 
   void test_writeAsStringSync_existing() {
     String content = 'ab';
-    File file = provider.newFile('/foo/file.txt', content);
+    File file =
+        provider.newFile(provider.convertPath('/foo/file.txt'), content);
     expect(file.readAsStringSync(), content);
     // write new bytes
     content = 'CD';
@@ -246,7 +267,7 @@
   }
 
   void test_writeAsStringSync_new() {
-    File file = provider.getFile('/foo/file.txt');
+    File file = provider.getFile(provider.convertPath('/foo/file.txt'));
     expect(file.exists, false);
     // write new bytes
     String content = 'ef';
@@ -258,36 +279,43 @@
 
 @reflectiveTest
 class FolderTest {
-  static const String path = '/foo/bar';
-
   MemoryResourceProvider provider = new MemoryResourceProvider();
+  String path;
   Folder folder;
 
   void setUp() {
+    path = provider.convertPath('/foo/bar');
     folder = provider.newFolder(path);
   }
 
   void test_canonicalizePath() {
-    expect(folder.canonicalizePath('baz'), equals('/foo/bar/baz'));
-    expect(folder.canonicalizePath('/baz'), equals('/baz'));
-    expect(folder.canonicalizePath('../baz'), equals('/foo/baz'));
-    expect(folder.canonicalizePath('/a/b/../c'), equals('/a/c'));
-    expect(folder.canonicalizePath('./baz'), equals('/foo/bar/baz'));
-    expect(folder.canonicalizePath('/a/b/./c'), equals('/a/b/c'));
+    expect(folder.canonicalizePath(provider.convertPath('baz')),
+        equals(provider.convertPath('/foo/bar/baz')));
+    expect(folder.canonicalizePath(provider.convertPath('/baz')),
+        equals(provider.convertPath('/baz')));
+    expect(folder.canonicalizePath(provider.convertPath('../baz')),
+        equals(provider.convertPath('/foo/baz')));
+    expect(folder.canonicalizePath(provider.convertPath('/a/b/../c')),
+        equals(provider.convertPath('/a/c')));
+    expect(folder.canonicalizePath(provider.convertPath('./baz')),
+        equals(provider.convertPath('/foo/bar/baz')));
+    expect(folder.canonicalizePath(provider.convertPath('/a/b/./c')),
+        equals(provider.convertPath('/a/b/c')));
   }
 
   void test_contains() {
-    expect(folder.contains('/foo/bar/aaa.txt'), isTrue);
-    expect(folder.contains('/foo/bar/aaa/bbb.txt'), isTrue);
-    expect(folder.contains('/baz.txt'), isFalse);
-    expect(folder.contains('/foo/bar'), isFalse);
+    expect(folder.contains(provider.convertPath('/foo/bar/aaa.txt')), isTrue);
+    expect(
+        folder.contains(provider.convertPath('/foo/bar/aaa/bbb.txt')), isTrue);
+    expect(folder.contains(provider.convertPath('/baz.txt')), isFalse);
+    expect(folder.contains(provider.convertPath('/foo/bar')), isFalse);
   }
 
   void test_delete() {
-    Folder folder = provider.newFolder('/foo');
-    Folder barFolder = provider.newFolder('/foo/bar');
-    File aFile = provider.newFile('/foo/bar/a.txt', '');
-    File bFile = provider.newFile('/foo/b.txt', '');
+    Folder folder = provider.newFolder(provider.convertPath('/foo'));
+    Folder barFolder = provider.newFolder(provider.convertPath('/foo/bar'));
+    File aFile = provider.newFile(provider.convertPath('/foo/bar/a.txt'), '');
+    File bFile = provider.newFile(provider.convertPath('/foo/b.txt'), '');
     expect(folder.exists, isTrue);
     expect(barFolder.exists, isTrue);
     expect(aFile.exists, isTrue);
@@ -301,7 +329,7 @@
   }
 
   void test_equal_false() {
-    String path2 = '/foo/baz';
+    String path2 = provider.convertPath('/foo/baz');
     Folder folder2 = provider.newFolder(path2);
     expect(folder == folder2, isFalse);
   }
@@ -318,14 +346,14 @@
   }
 
   void test_getChild_file() {
-    provider.newFile('/foo/bar/file.txt', 'content');
+    provider.newFile(provider.convertPath('/foo/bar/file.txt'), 'content');
     File child = folder.getChild('file.txt');
     expect(child, isNotNull);
     expect(child.exists, isTrue);
   }
 
   void test_getChild_folder() {
-    provider.newFolder('/foo/bar/baz');
+    provider.newFolder(provider.convertPath('/foo/bar/baz'));
     Folder child = folder.getChild('baz');
     expect(child, isNotNull);
     expect(child.exists, isTrue);
@@ -338,14 +366,14 @@
   }
 
   void test_getChildAssumingFile_file() {
-    provider.newFile('/foo/bar/name', 'content');
+    provider.newFile(provider.convertPath('/foo/bar/name'), 'content');
     File child = folder.getChildAssumingFile('name');
     expect(child, isNotNull);
     expect(child.exists, isTrue);
   }
 
   void test_getChildAssumingFile_folder() {
-    provider.newFolder('/foo/bar/name');
+    provider.newFolder(provider.convertPath('/foo/bar/name'));
     File child = folder.getChildAssumingFile('name');
     expect(child, isNotNull);
     expect(child.exists, isFalse);
@@ -358,14 +386,14 @@
   }
 
   void test_getChildAssumingFolder_file() {
-    provider.newFile('/foo/bar/foldername', 'content');
+    provider.newFile(provider.convertPath('/foo/bar/foldername'), 'content');
     Folder child = folder.getChildAssumingFolder('foldername');
     expect(child, isNotNull);
     expect(child.exists, isFalse);
   }
 
   void test_getChildAssumingFolder_folder() {
-    provider.newFolder('/foo/bar/foldername');
+    provider.newFolder(provider.convertPath('/foo/bar/foldername'));
     Folder child = folder.getChildAssumingFolder('foldername');
     expect(child, isNotNull);
     expect(child.exists, isTrue);
@@ -379,9 +407,9 @@
   }
 
   void test_getChildren_exists() {
-    provider.newFile('/foo/bar/a.txt', 'aaa');
-    provider.newFolder('/foo/bar/bFolder');
-    provider.newFile('/foo/bar/c.txt', 'ccc');
+    provider.newFile(provider.convertPath('/foo/bar/a.txt'), 'aaa');
+    provider.newFolder(provider.convertPath('/foo/bar/bFolder'));
+    provider.newFile(provider.convertPath('/foo/bar/c.txt'), 'ccc');
     // prepare 3 children
     List<Resource> children = folder.getChildren();
     expect(children, hasLength(3));
@@ -406,36 +434,40 @@
   }
 
   void test_isOrContains() {
-    expect(folder.isOrContains('/foo/bar'), isTrue);
-    expect(folder.isOrContains('/foo/bar/aaa.txt'), isTrue);
-    expect(folder.isOrContains('/foo/bar/aaa/bbb.txt'), isTrue);
-    expect(folder.isOrContains('/baz.txt'), isFalse);
+    expect(folder.isOrContains(provider.convertPath('/foo/bar')), isTrue);
+    expect(
+        folder.isOrContains(provider.convertPath('/foo/bar/aaa.txt')), isTrue);
+    expect(folder.isOrContains(provider.convertPath('/foo/bar/aaa/bbb.txt')),
+        isTrue);
+    expect(folder.isOrContains(provider.convertPath('/baz.txt')), isFalse);
   }
 
   void test_parent() {
     Resource parent1 = folder.parent;
     expect(parent1, new isInstanceOf<Folder>());
-    expect(parent1.path, equals('/foo'));
+    expect(parent1.path, equals(provider.convertPath('/foo')));
     Resource parent2 = parent1.parent;
     expect(parent2, new isInstanceOf<Folder>());
-    expect(parent2.path, equals('/'));
+    expect(parent2.path, equals(provider.convertPath('/')));
     expect(parent2.parent, isNull);
   }
 
   void test_toUri() {
-    String path = '/foo/directory';
+    String path = provider.convertPath('/foo/directory');
     Folder folder = provider.newFolder(path);
-    expect(folder.toUri(), new Uri.directory(path, windows: false));
+    expect(folder.toUri(), provider.pathContext.toUri(path));
   }
 }
 
 @reflectiveTest
 class MemoryFileSourceExistingTest {
   MemoryResourceProvider provider = new MemoryResourceProvider();
+  String path;
   Source source;
 
   setUp() {
-    File file = provider.newFile('/foo/test.dart', 'library test;');
+    path = provider.convertPath('/foo/test.dart');
+    File file = provider.newFile(path, 'library test;');
     source = file.createSource();
   }
 
@@ -445,32 +477,36 @@
   }
 
   void test_encoding() {
-    expect(source.encoding, 'file:///foo/test.dart');
+    String expected = 'file:///foo/test.dart';
+    if (provider.pathContext.style == pathos.windows.style) {
+      expected = 'file:///C:/foo/test.dart';
+    }
+    expect(source.encoding, expected);
   }
 
   void test_equals_false_differentFile() {
-    File fileA = provider.newFile('/foo/a.dart', '');
-    File fileB = provider.newFile('/foo/b.dart', '');
+    File fileA = provider.newFile(provider.convertPath('/foo/a.dart'), '');
+    File fileB = provider.newFile(provider.convertPath('/foo/b.dart'), '');
     Source sourceA = fileA.createSource();
     Source sourceB = fileB.createSource();
     expect(sourceA == sourceB, isFalse);
   }
 
   void test_equals_false_notMemorySource() {
-    File file = provider.newFile('/foo/test.dart', '');
+    File file = provider.newFile(path, '');
     Source source = file.createSource();
     expect(source == new Object(), isFalse);
   }
 
   void test_equals_true_sameFile() {
-    File file = provider.newFile('/foo/test.dart', '');
+    File file = provider.newFile(path, '');
     Source sourceA = file.createSource();
     Source sourceB = file.createSource();
     expect(sourceA == sourceB, isTrue);
   }
 
   void test_equals_true_self() {
-    File file = provider.newFile('/foo/test.dart', '');
+    File file = provider.newFile(path, '');
     Source source = file.createSource();
     expect(source == source, isTrue);
   }
@@ -480,7 +516,7 @@
   }
 
   void test_fullName() {
-    expect(source.fullName, '/foo/test.dart');
+    expect(source.fullName, path);
   }
 
   void test_hashCode() {
@@ -488,12 +524,17 @@
   }
 
   void test_resolveRelative() {
-    Uri relative = resolveRelativeUri(source.uri, new Uri.file('bar/baz.dart'));
-    expect(relative.path, '/foo/bar/baz.dart');
+    Uri relative = resolveRelativeUri(
+        source.uri,
+        provider.pathContext
+            .toUri(provider.pathContext.join('bar', 'baz.dart')));
+    expect(relative,
+        provider.pathContext.toUri(provider.convertPath('/foo/bar/baz.dart')));
   }
 
   void test_resolveRelative_dart() {
-    File file = provider.newFile('/sdk/lib/core/core.dart', '');
+    File file =
+        provider.newFile(provider.convertPath('/sdk/lib/core/core.dart'), '');
     Source source = file.createSource(Uri.parse('dart:core'));
     Uri resolved = resolveRelativeUri(source.uri, Uri.parse('int.dart'));
     expect(resolved.toString(), 'dart:core/int.dart');
@@ -507,10 +548,12 @@
 @reflectiveTest
 class MemoryFileSourceNotExistingTest {
   MemoryResourceProvider provider = new MemoryResourceProvider();
+  String path;
   Source source;
 
   setUp() {
-    File file = provider.getResource('/foo/test.dart');
+    path = provider.convertPath('/foo/test.dart');
+    File file = provider.getResource(path);
     source = file.createSource();
   }
 
@@ -521,7 +564,11 @@
   }
 
   void test_encoding() {
-    expect(source.encoding, 'file:///foo/test.dart');
+    String expected = 'file:///foo/test.dart';
+    if (provider.pathContext.style == pathos.windows.style) {
+      expected = 'file:///C:/foo/test.dart';
+    }
+    expect(source.encoding, expected);
   }
 
   void test_exists() {
@@ -529,7 +576,7 @@
   }
 
   void test_fullName() {
-    expect(source.fullName, '/foo/test.dart');
+    expect(source.fullName, path);
   }
 
   void test_modificationStamp() {
@@ -537,8 +584,12 @@
   }
 
   void test_resolveRelative() {
-    Uri relative = resolveRelativeUri(source.uri, new Uri.file('bar/baz.dart'));
-    expect(relative.path, '/foo/bar/baz.dart');
+    Uri relative = resolveRelativeUri(
+        source.uri,
+        provider.pathContext
+            .toUri(provider.pathContext.join('bar', 'baz.dart')));
+    expect(relative,
+        provider.pathContext.toUri(provider.convertPath('/foo/bar/baz.dart')));
   }
 
   void test_shortName() {
@@ -551,7 +602,7 @@
   MemoryResourceProvider provider = new MemoryResourceProvider();
 
   void test_deleteFile_folder() {
-    String path = '/my/file';
+    String path = provider.convertPath('/my/file');
     provider.newFolder(path);
     expect(() {
       provider.deleteFile(path);
@@ -560,7 +611,7 @@
   }
 
   void test_deleteFile_notExistent() {
-    String path = '/my/file';
+    String path = provider.convertPath('/my/file');
     expect(() {
       provider.deleteFile(path);
     }, throwsA(new isInstanceOf<ArgumentError>()));
@@ -570,7 +621,7 @@
   }
 
   void test_deleteFile_success() {
-    String path = '/my/file';
+    String path = provider.convertPath('/my/file');
     provider.newFile(path, 'contents');
     Resource file = provider.getResource(path);
     expect(file, new isInstanceOf<File>());
@@ -579,8 +630,25 @@
     expect(file.exists, isFalse);
   }
 
+  test_getFolder_existing() async {
+    String path = provider.convertPath('/foo/bar');
+    provider.newFolder(path);
+    Folder folder = provider.getFolder(path);
+    expect(folder, isNotNull);
+    expect(folder.path, path);
+    expect(folder.exists, isTrue);
+  }
+
+  test_getFolder_notExisting() async {
+    String path = provider.convertPath('/foo/bar');
+    Folder folder = provider.getFolder(path);
+    expect(folder, isNotNull);
+    expect(folder.path, path);
+    expect(folder.exists, isFalse);
+  }
+
   test_getModificationTimes() async {
-    File file = provider.newFile('/test.dart', '');
+    File file = provider.newFile(provider.convertPath('/test.dart'), '');
     Source source = file.createSource();
     List<int> times = await provider.getModificationTimes([source]);
     expect(times, [source.modificationStamp]);
@@ -598,7 +666,7 @@
   }
 
   void test_modifyFile_isFolder() {
-    String path = '/my/file';
+    String path = provider.convertPath('/my/file');
     provider.newFolder(path);
     expect(() {
       provider.modifyFile(path, 'contents');
@@ -607,7 +675,7 @@
   }
 
   void test_modifyFile_notExistent() {
-    String path = '/my/file';
+    String path = provider.convertPath('/my/file');
     expect(() {
       provider.modifyFile(path, 'contents');
     }, throwsA(new isInstanceOf<ArgumentError>()));
@@ -617,7 +685,7 @@
   }
 
   void test_modifyFile_success() {
-    String path = '/my/file';
+    String path = provider.convertPath('/my/file');
     provider.newFile(path, 'contents 1');
     Resource file = provider.getResource(path);
     expect(file, new isInstanceOf<File>());
@@ -628,7 +696,7 @@
   }
 
   void test_newFileWithBytes() {
-    String path = '/my/file';
+    String path = provider.convertPath('/my/file');
     List<int> bytes = <int>[1, 2, 3, 4, 5];
     provider.newFileWithBytes(path, bytes);
     File file = provider.getResource(path);
@@ -638,15 +706,16 @@
   }
 
   void test_newFolder_alreadyExists_asFile() {
-    provider.newFile('/my/file', 'qwerty');
+    provider.newFile(provider.convertPath('/my/file'), 'qwerty');
     expect(() {
-      provider.newFolder('/my/file');
+      provider.newFolder(provider.convertPath('/my/file'));
     }, throwsA(new isInstanceOf<ArgumentError>()));
   }
 
   void test_newFolder_alreadyExists_asFolder() {
-    Folder folder = provider.newFolder('/my/folder');
-    Folder newFolder = provider.newFolder('/my/folder');
+    String path = provider.convertPath('/my/folder');
+    Folder folder = provider.newFolder(path);
+    Folder newFolder = provider.newFolder(path);
     expect(newFolder, folder);
   }
 
@@ -663,11 +732,11 @@
   }
 
   test_watch_createFile() {
-    String rootPath = '/my/path';
+    String rootPath = provider.convertPath('/my/path');
     provider.newFolder(rootPath);
     return _watchingFolder(rootPath, (changesReceived) {
       expect(changesReceived, hasLength(0));
-      String path = posix.join(rootPath, 'foo');
+      String path = provider.pathContext.join(rootPath, 'foo');
       provider.newFile(path, 'contents');
       return _delayed(() {
         expect(changesReceived, hasLength(1));
@@ -678,9 +747,9 @@
   }
 
   test_watch_deleteFile() {
-    String rootPath = '/my/path';
+    String rootPath = provider.convertPath('/my/path');
     provider.newFolder(rootPath);
-    String path = posix.join(rootPath, 'foo');
+    String path = provider.pathContext.join(rootPath, 'foo');
     provider.newFile(path, 'contents 1');
     return _watchingFolder(rootPath, (changesReceived) {
       expect(changesReceived, hasLength(0));
@@ -694,9 +763,9 @@
   }
 
   test_watch_modifyFile() {
-    String rootPath = '/my/path';
+    String rootPath = provider.convertPath('/my/path');
     provider.newFolder(rootPath);
-    String path = posix.join(rootPath, 'foo');
+    String path = provider.pathContext.join(rootPath, 'foo');
     provider.newFile(path, 'contents 1');
     return _watchingFolder(rootPath, (changesReceived) {
       expect(changesReceived, hasLength(0));
@@ -710,11 +779,11 @@
   }
 
   test_watch_modifyFile_inSubDir() {
-    String rootPath = '/my/path';
+    String rootPath = provider.convertPath('/my/path');
     provider.newFolder(rootPath);
-    String subdirPath = posix.join(rootPath, 'foo');
+    String subdirPath = provider.pathContext.join(rootPath, 'foo');
     provider.newFolder(subdirPath);
-    String path = posix.join(rootPath, 'bar');
+    String path = provider.pathContext.join(rootPath, 'bar');
     provider.newFile(path, 'contents 1');
     return _watchingFolder(rootPath, (changesReceived) {
       expect(changesReceived, hasLength(0));
diff --git a/pkg/analyzer/test/file_system/physical_resource_provider_test.dart b/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
index 6be1f2b..62b4bba 100644
--- a/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
+++ b/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
@@ -11,19 +11,18 @@
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/file_system/physical_file_system.dart';
 import 'package:analyzer/src/generated/source_io.dart';
-import 'package:path/path.dart';
+import 'package:path/path.dart' as pathos;
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 import 'package:watcher/watcher.dart';
 
-import '../utils.dart';
-
 main() {
-  initializeTestEnvironment();
   if (!new bool.fromEnvironment('skipPhysicalResourceProviderTests')) {
-    defineReflectiveTests(PhysicalResourceProviderTest);
-    defineReflectiveTests(FileTest);
-    defineReflectiveTests(FolderTest);
+    defineReflectiveSuite(() {
+      defineReflectiveTests(PhysicalResourceProviderTest);
+      defineReflectiveTests(FileTest);
+      defineReflectiveTests(FolderTest);
+    });
   }
 }
 
@@ -31,6 +30,9 @@
 var _isFileSystemException = new isInstanceOf<FileSystemException>();
 var _isFolder = new isInstanceOf<Folder>();
 
+String join(String part1, [String part2, String part3]) =>
+    pathos.join(part1, part2, part3);
+
 @reflectiveTest
 class FileTest extends _BaseTest {
   String path;
@@ -95,6 +97,19 @@
     expect(file.isOrContains('foo'), isFalse);
   }
 
+  void test_lengthSync_doesNotExist() {
+    File file = PhysicalResourceProvider.INSTANCE.getResource(path);
+    expect(() {
+      file.lengthSync;
+    }, throwsA(_isFileSystemException));
+  }
+
+  void test_lengthSync_exists() {
+    List<int> bytes = <int>[1, 2, 3, 4, 5];
+    new io.File(path).writeAsBytesSync(bytes);
+    expect(file.lengthSync, bytes.length);
+  }
+
   void test_modificationStamp_doesNotExist() {
     File file = PhysicalResourceProvider.INSTANCE.getResource(path);
     expect(() {
@@ -181,7 +196,7 @@
   }
 
   void test_resolveSymbolicLinksSync_links() {
-    Context pathContext = PhysicalResourceProvider.INSTANCE.pathContext;
+    pathos.Context pathContext = PhysicalResourceProvider.INSTANCE.pathContext;
     String pathA = pathContext.join(tempPath, 'a');
     String pathB = pathContext.join(pathA, 'b');
     new io.Directory(pathB).createSync(recursive: true);
@@ -441,7 +456,7 @@
   test_getFolder_trailingSeparator() {
     String path = tempPath;
     PhysicalResourceProvider provider = PhysicalResourceProvider.INSTANCE;
-    Folder folder = provider.getFolder('$path$separator');
+    Folder folder = provider.getFolder('$path${pathos.separator}');
     expect(folder.path, path);
   }
 
diff --git a/pkg/analyzer/test/file_system/resource_uri_resolver_test.dart b/pkg/analyzer/test/file_system/resource_uri_resolver_test.dart
index 92e1148..610048d 100644
--- a/pkg/analyzer/test/file_system/resource_uri_resolver_test.dart
+++ b/pkg/analyzer/test/file_system/resource_uri_resolver_test.dart
@@ -7,14 +7,13 @@
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
-
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ResourceUriResolverTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ResourceUriResolverTest);
+  });
 }
 
 @reflectiveTest
@@ -25,8 +24,8 @@
   void setUp() {
     provider = new MemoryResourceProvider();
     resolver = new ResourceUriResolver(provider);
-    provider.newFile('/test.dart', '');
-    provider.newFolder('/folder');
+    provider.newFile(provider.convertPath('/test.dart'), '');
+    provider.newFolder(provider.convertPath('/folder'));
   }
 
   void test_creation() {
@@ -35,15 +34,15 @@
   }
 
   void test_resolveAbsolute_file() {
-    var uri = new Uri(scheme: 'file', path: '/test.dart');
+    var uri = provider.pathContext.toUri(provider.convertPath('/test.dart'));
     Source source = resolver.resolveAbsolute(uri);
     expect(source, isNotNull);
     expect(source.exists(), isTrue);
-    expect(source.fullName, '/test.dart');
+    expect(source.fullName, provider.convertPath('/test.dart'));
   }
 
   void test_resolveAbsolute_folder() {
-    var uri = new Uri(scheme: 'file', path: '/folder');
+    var uri = provider.pathContext.toUri(provider.convertPath('/folder'));
     Source source = resolver.resolveAbsolute(uri);
     expect(source, isNull);
   }
@@ -61,7 +60,7 @@
   }
 
   void test_restoreAbsolute() {
-    var uri = new Uri(scheme: 'file', path: '/test.dart');
+    var uri = provider.pathContext.toUri(provider.convertPath('/test.dart'));
     Source source = resolver.resolveAbsolute(uri);
     expect(source, isNotNull);
     expect(resolver.restoreAbsolute(source), uri);
diff --git a/pkg/analyzer/test/file_system/test_all.dart b/pkg/analyzer/test/file_system/test_all.dart
index 1714c0b..75a06d2 100644
--- a/pkg/analyzer/test/file_system/test_all.dart
+++ b/pkg/analyzer/test/file_system/test_all.dart
@@ -4,9 +4,8 @@
 
 library analyzer.test.file_system.test_all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../utils.dart';
 import 'memory_file_system_test.dart' as memory_file_system_test;
 import 'physical_resource_provider_test.dart'
     as physical_resource_provider_test;
@@ -14,10 +13,9 @@
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('file_system', () {
+  defineReflectiveSuite(() {
     memory_file_system_test.main();
     physical_resource_provider_test.main();
     resource_uri_resolver_test.main();
-  });
+  }, name: 'file system');
 }
diff --git a/pkg/analyzer/test/generated/all_the_rest_test.dart b/pkg/analyzer/test/generated/all_the_rest_test.dart
index a8411f4..6229305 100644
--- a/pkg/analyzer/test/generated/all_the_rest_test.dart
+++ b/pkg/analyzer/test/generated/all_the_rest_test.dart
@@ -13,7 +13,6 @@
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:analyzer/file_system/physical_file_system.dart';
-import 'package:analyzer/src/dart/ast/ast.dart';
 import 'package:analyzer/src/dart/ast/utilities.dart' hide ConstantEvaluator;
 import 'package:analyzer/src/dart/element/builder.dart';
 import 'package:analyzer/src/dart/element/element.dart';
@@ -27,44 +26,43 @@
 import 'package:analyzer/src/generated/sdk_io.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/source_io.dart';
-import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
 import 'package:analyzer/src/generated/testing/element_factory.dart';
 import 'package:analyzer/src/generated/testing/test_type_provider.dart';
 import 'package:analyzer/src/generated/testing/token_factory.dart';
 import 'package:analyzer/src/generated/utilities_dart.dart';
 import 'package:analyzer/src/source/source_resource.dart';
-import 'package:path/path.dart';
+import 'package:path/path.dart' as path;
 import 'package:source_span/source_span.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../utils.dart';
 import 'parser_test.dart';
 import 'resolver_test_case.dart';
 import 'test_support.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ContentCacheTest);
-  // ignore: deprecated_member_use
-  defineReflectiveTests(CustomUriResolverTest);
-  defineReflectiveTests(DartUriResolverTest);
-  // ignore: deprecated_member_use
-  defineReflectiveTests(DirectoryBasedDartSdkTest);
-  // ignore: deprecated_member_use
-  defineReflectiveTests(DirectoryBasedSourceContainerTest);
-  defineReflectiveTests(ElementBuilderTest);
-  defineReflectiveTests(ElementLocatorTest);
-  defineReflectiveTests(EnumMemberBuilderTest);
-  defineReflectiveTests(ErrorReporterTest);
-  defineReflectiveTests(ErrorSeverityTest);
-  defineReflectiveTests(ExitDetectorTest);
-  defineReflectiveTests(ExitDetectorTest2);
-  defineReflectiveTests(FileBasedSourceTest);
-  defineReflectiveTests(ResolveRelativeUriTest);
-  // ignore: deprecated_member_use
-  defineReflectiveTests(SDKLibrariesReaderTest);
-  defineReflectiveTests(UriKindTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ContentCacheTest);
+    // ignore: deprecated_member_use
+    defineReflectiveTests(CustomUriResolverTest);
+    defineReflectiveTests(DartUriResolverTest);
+    // ignore: deprecated_member_use
+    defineReflectiveTests(DirectoryBasedDartSdkTest);
+    // ignore: deprecated_member_use
+    defineReflectiveTests(DirectoryBasedSourceContainerTest);
+    defineReflectiveTests(ElementLocatorTest);
+    defineReflectiveTests(EnumMemberBuilderTest);
+    defineReflectiveTests(ErrorReporterTest);
+    defineReflectiveTests(ErrorSeverityTest);
+    defineReflectiveTests(ExitDetectorTest);
+    defineReflectiveTests(ExitDetectorTest2);
+    defineReflectiveTests(FileBasedSourceTest);
+    defineReflectiveTests(ResolveRelativeUriTest);
+    // ignore: deprecated_member_use
+    defineReflectiveTests(SDKLibrariesReaderTest);
+    defineReflectiveTests(UriKindTest);
+  });
 }
 
 /**
@@ -128,14 +126,14 @@
   }
 
   void test_resolve_uri() {
-    String path =
+    String filePath =
         FileUtilities2.createFile("/path/to/library.dart").getAbsolutePath();
     UriResolver resolver = new CustomUriResolver({
-      'custom:library': path,
+      'custom:library': filePath,
     });
     Source result = resolver.resolveAbsolute(Uri.parse("custom:library"));
     expect(result, isNotNull);
-    expect(result.fullName, path);
+    expect(result.fullName, filePath);
   }
 }
 
@@ -352,2260 +350,6 @@
 }
 
 @reflectiveTest
-class ElementBuilderTest extends ParserTestCase {
-  CompilationUnitElement compilationUnitElement;
-  CompilationUnit compilationUnit;
-
-  /**
-   * Parse the given [code], pass it through [ElementBuilder], and return the
-   * resulting [ElementHolder].
-   */
-  ElementHolder buildElementsForText(String code) {
-    TestLogger logger = new TestLogger();
-    AnalysisEngine.instance.logger = logger;
-    try {
-      compilationUnit = ParserTestCase.parseCompilationUnit(code);
-      ElementHolder holder = new ElementHolder();
-      ElementBuilder builder =
-          new ElementBuilder(holder, compilationUnitElement);
-      compilationUnit.accept(builder);
-      return holder;
-    } finally {
-      expect(logger.log, hasLength(0));
-      AnalysisEngine.instance.logger = Logger.NULL;
-    }
-  }
-
-  /**
-   * Verify that the given [metadata] has exactly one annotation, and that its
-   * [ElementAnnotationImpl] is unresolved.
-   */
-  void checkAnnotation(NodeList<Annotation> metadata) {
-    expect(metadata, hasLength(1));
-    expect(metadata[0], new isInstanceOf<AnnotationImpl>());
-    AnnotationImpl annotation = metadata[0];
-    expect(annotation.elementAnnotation,
-        new isInstanceOf<ElementAnnotationImpl>());
-    ElementAnnotationImpl elementAnnotation = annotation.elementAnnotation;
-    expect(elementAnnotation.element, isNull); // Not yet resolved
-    expect(elementAnnotation.compilationUnit, isNotNull);
-    expect(elementAnnotation.compilationUnit, compilationUnitElement);
-  }
-
-  /**
-   * Verify that the given [element] has exactly one annotation, and that its
-   * [ElementAnnotationImpl] is unresolved.
-   */
-  void checkMetadata(Element element) {
-    expect(element.metadata, hasLength(1));
-    expect(element.metadata[0], new isInstanceOf<ElementAnnotationImpl>());
-    ElementAnnotationImpl elementAnnotation = element.metadata[0];
-    expect(elementAnnotation.element, isNull); // Not yet resolved
-    expect(elementAnnotation.compilationUnit, isNotNull);
-    expect(elementAnnotation.compilationUnit, compilationUnitElement);
-  }
-
-  void fail_visitMethodDeclaration_setter_duplicate() {
-    // https://github.com/dart-lang/sdk/issues/25601
-    String code = r'''
-class C {
-  set zzz(x) {}
-  set zzz(y) {}
-}
-''';
-    ClassElement classElement = buildElementsForText(code).types[0];
-    for (PropertyAccessorElement accessor in classElement.accessors) {
-      expect(accessor.variable.setter, same(accessor));
-    }
-  }
-
-  @override
-  void setUp() {
-    super.setUp();
-    compilationUnitElement = new CompilationUnitElementImpl('test.dart');
-  }
-
-  void test_metadata_fieldDeclaration() {
-    List<FieldElement> fields =
-        buildElementsForText('class C { @a int x, y; }').types[0].fields;
-    checkMetadata(fields[0]);
-    checkMetadata(fields[1]);
-    expect(fields[0].metadata, same(fields[1].metadata));
-  }
-
-  void test_metadata_localVariableDeclaration() {
-    List<LocalVariableElement> localVariables =
-        buildElementsForText('f() { @a int x, y; }')
-            .functions[0]
-            .localVariables;
-    checkMetadata(localVariables[0]);
-    checkMetadata(localVariables[1]);
-    expect(localVariables[0].metadata, same(localVariables[1].metadata));
-  }
-
-  void test_metadata_topLevelVariableDeclaration() {
-    List<TopLevelVariableElement> topLevelVariables =
-        buildElementsForText('@a int x, y;').topLevelVariables;
-    checkMetadata(topLevelVariables[0]);
-    checkMetadata(topLevelVariables[1]);
-    expect(topLevelVariables[0].metadata, same(topLevelVariables[1].metadata));
-  }
-
-  void test_metadata_visitClassDeclaration() {
-    ClassElement classElement = buildElementsForText('@a class C {}').types[0];
-    checkMetadata(classElement);
-  }
-
-  void test_metadata_visitClassTypeAlias() {
-    ClassElement classElement =
-        buildElementsForText('@a class C = D with E;').types[0];
-    checkMetadata(classElement);
-  }
-
-  void test_metadata_visitConstructorDeclaration() {
-    ConstructorElement constructorElement =
-        buildElementsForText('class C { @a C(); }').types[0].constructors[0];
-    checkMetadata(constructorElement);
-  }
-
-  void test_metadata_visitDeclaredIdentifier() {
-    LocalVariableElement localVariableElement =
-        buildElementsForText('f() { for (@a var x in y) {} }')
-            .functions[0]
-            .localVariables[0];
-    checkMetadata(localVariableElement);
-  }
-
-  void test_metadata_visitDefaultFormalParameter_fieldFormalParameter() {
-    ParameterElement parameterElement =
-        buildElementsForText('class C { var x; C([@a this.x = null]); }')
-            .types[0]
-            .constructors[0]
-            .parameters[0];
-    checkMetadata(parameterElement);
-  }
-
-  void
-      test_metadata_visitDefaultFormalParameter_functionTypedFormalParameter() {
-    ParameterElement parameterElement =
-        buildElementsForText('f([@a g() = null]) {}').functions[0].parameters[
-            0];
-    checkMetadata(parameterElement);
-  }
-
-  void test_metadata_visitDefaultFormalParameter_simpleFormalParameter() {
-    ParameterElement parameterElement =
-        buildElementsForText('f([@a gx = null]) {}').functions[0].parameters[0];
-    checkMetadata(parameterElement);
-  }
-
-  void test_metadata_visitEnumDeclaration() {
-    ClassElement classElement =
-        buildElementsForText('@a enum E { v }').enums[0];
-    checkMetadata(classElement);
-  }
-
-  void test_metadata_visitExportDirective() {
-    buildElementsForText('@a export "foo.dart";');
-    expect(compilationUnit.directives[0], new isInstanceOf<ExportDirective>());
-    ExportDirective exportDirective = compilationUnit.directives[0];
-    checkAnnotation(exportDirective.metadata);
-  }
-
-  void test_metadata_visitFieldFormalParameter() {
-    ParameterElement parameterElement =
-        buildElementsForText('class C { var x; C(@a this.x); }')
-            .types[0]
-            .constructors[0]
-            .parameters[0];
-    checkMetadata(parameterElement);
-  }
-
-  void test_metadata_visitFunctionDeclaration_function() {
-    FunctionElement functionElement =
-        buildElementsForText('@a f() {}').functions[0];
-    checkMetadata(functionElement);
-  }
-
-  void test_metadata_visitFunctionDeclaration_getter() {
-    PropertyAccessorElement propertyAccessorElement =
-        buildElementsForText('@a get f => null;').accessors[0];
-    checkMetadata(propertyAccessorElement);
-  }
-
-  void test_metadata_visitFunctionDeclaration_setter() {
-    PropertyAccessorElement propertyAccessorElement =
-        buildElementsForText('@a set f(value) {}').accessors[0];
-    checkMetadata(propertyAccessorElement);
-  }
-
-  void test_metadata_visitFunctionTypeAlias() {
-    FunctionTypeAliasElement functionTypeAliasElement =
-        buildElementsForText('@a typedef F();').typeAliases[0];
-    checkMetadata(functionTypeAliasElement);
-  }
-
-  void test_metadata_visitFunctionTypedFormalParameter() {
-    ParameterElement parameterElement =
-        buildElementsForText('f(@a g()) {}').functions[0].parameters[0];
-    checkMetadata(parameterElement);
-  }
-
-  void test_metadata_visitImportDirective() {
-    buildElementsForText('@a import "foo.dart";');
-    expect(compilationUnit.directives[0], new isInstanceOf<ImportDirective>());
-    ImportDirective importDirective = compilationUnit.directives[0];
-    checkAnnotation(importDirective.metadata);
-  }
-
-  void test_metadata_visitLibraryDirective() {
-    buildElementsForText('@a library L;');
-    expect(compilationUnit.directives[0], new isInstanceOf<LibraryDirective>());
-    LibraryDirective libraryDirective = compilationUnit.directives[0];
-    checkAnnotation(libraryDirective.metadata);
-  }
-
-  void test_metadata_visitMethodDeclaration_getter() {
-    PropertyAccessorElement propertyAccessorElement =
-        buildElementsForText('class C { @a get m => null; }')
-            .types[0]
-            .accessors[0];
-    checkMetadata(propertyAccessorElement);
-  }
-
-  void test_metadata_visitMethodDeclaration_method() {
-    MethodElement methodElement =
-        buildElementsForText('class C { @a m() {} }').types[0].methods[0];
-    checkMetadata(methodElement);
-  }
-
-  void test_metadata_visitMethodDeclaration_setter() {
-    PropertyAccessorElement propertyAccessorElement =
-        buildElementsForText('class C { @a set f(value) {} }')
-            .types[0]
-            .accessors[0];
-    checkMetadata(propertyAccessorElement);
-  }
-
-  void test_metadata_visitPartDirective() {
-    buildElementsForText('@a part "foo.dart";');
-    expect(compilationUnit.directives[0], new isInstanceOf<PartDirective>());
-    PartDirective partDirective = compilationUnit.directives[0];
-    checkAnnotation(partDirective.metadata);
-  }
-
-  void test_metadata_visitPartOfDirective() {
-    // We don't build ElementAnnotation objects for `part of` directives, since
-    // analyzer ignores them in favor of annotations on the library directive.
-    buildElementsForText('@a part of L;');
-    expect(compilationUnit.directives[0], new isInstanceOf<PartOfDirective>());
-    PartOfDirective partOfDirective = compilationUnit.directives[0];
-    expect(partOfDirective.metadata, hasLength(1));
-    expect(partOfDirective.metadata[0].elementAnnotation, isNull);
-  }
-
-  void test_metadata_visitSimpleFormalParameter() {
-    ParameterElement parameterElement =
-        buildElementsForText('f(@a x) {}').functions[0].parameters[0];
-    checkMetadata(parameterElement);
-  }
-
-  void test_metadata_visitTypeParameter() {
-    TypeParameterElement typeParameterElement =
-        buildElementsForText('class C<@a T> {}').types[0].typeParameters[0];
-    checkMetadata(typeParameterElement);
-  }
-
-  void test_visitCatchClause() {
-    // } catch (e, s) {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String exceptionParameterName = "e";
-    String stackParameterName = "s";
-    CatchClause clause =
-        AstFactory.catchClause2(exceptionParameterName, stackParameterName);
-    _setNodeSourceRange(clause, 100, 110);
-    clause.accept(builder);
-
-    List<LocalVariableElement> variables = holder.localVariables;
-    expect(variables, hasLength(2));
-
-    LocalVariableElement exceptionVariable = variables[0];
-    expect(exceptionVariable, isNotNull);
-    expect(exceptionVariable.name, exceptionParameterName);
-    expect(exceptionVariable.hasImplicitType, isTrue);
-    expect(exceptionVariable.isSynthetic, isFalse);
-    expect(exceptionVariable.isConst, isFalse);
-    expect(exceptionVariable.isFinal, isFalse);
-    expect(exceptionVariable.initializer, isNull);
-    _assertVisibleRange(exceptionVariable, 100, 110);
-
-    LocalVariableElement stackVariable = variables[1];
-    expect(stackVariable, isNotNull);
-    expect(stackVariable.name, stackParameterName);
-    expect(stackVariable.isSynthetic, isFalse);
-    expect(stackVariable.isConst, isFalse);
-    expect(stackVariable.isFinal, isFalse);
-    expect(stackVariable.initializer, isNull);
-    _assertVisibleRange(stackVariable, 100, 110);
-  }
-
-  void test_visitCatchClause_withType() {
-    // } on E catch (e) {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String exceptionParameterName = "e";
-    CatchClause clause = AstFactory.catchClause4(
-        AstFactory.typeName4('E'), exceptionParameterName);
-    clause.accept(builder);
-
-    List<LocalVariableElement> variables = holder.localVariables;
-    expect(variables, hasLength(1));
-    VariableElement exceptionVariable = variables[0];
-    expect(exceptionVariable, isNotNull);
-    expect(exceptionVariable.name, exceptionParameterName);
-    expect(exceptionVariable.hasImplicitType, isFalse);
-  }
-
-  void test_visitClassDeclaration_abstract() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String className = "C";
-    ClassDeclaration classDeclaration = AstFactory.classDeclaration(
-        Keyword.ABSTRACT, className, null, null, null, null);
-    classDeclaration.accept(builder);
-    List<ClassElement> types = holder.types;
-    expect(types, hasLength(1));
-    ClassElement type = types[0];
-    expect(type, isNotNull);
-    expect(type.name, className);
-    List<TypeParameterElement> typeParameters = type.typeParameters;
-    expect(typeParameters, hasLength(0));
-    expect(type.isAbstract, isTrue);
-    expect(type.isMixinApplication, isFalse);
-    expect(type.isSynthetic, isFalse);
-  }
-
-  void test_visitClassDeclaration_invalidFunctionInAnnotation_class() {
-    // https://github.com/dart-lang/sdk/issues/25696
-    String code = r'''
-class A {
-  const A({f});
-}
-
-@A(f: () {})
-class C {}
-''';
-    buildElementsForText(code);
-  }
-
-  void test_visitClassDeclaration_invalidFunctionInAnnotation_method() {
-    String code = r'''
-class A {
-  const A({f});
-}
-
-class C {
-  @A(f: () {})
-  void m() {}
-}
-''';
-    ElementHolder holder = buildElementsForText(code);
-    ClassElement elementC = holder.types[1];
-    expect(elementC, isNotNull);
-    MethodElement methodM = elementC.methods[0];
-    expect(methodM, isNotNull);
-    expect(methodM.functions, isEmpty);
-  }
-
-  void test_visitClassDeclaration_minimal() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String className = "C";
-    ClassDeclaration classDeclaration =
-        AstFactory.classDeclaration(null, className, null, null, null, null);
-    classDeclaration.documentationComment = AstFactory.documentationComment(
-        [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
-    classDeclaration.endToken.offset = 80;
-    classDeclaration.accept(builder);
-    List<ClassElement> types = holder.types;
-    expect(types, hasLength(1));
-    ClassElement type = types[0];
-    expect(type, isNotNull);
-    expect(type.name, className);
-    List<TypeParameterElement> typeParameters = type.typeParameters;
-    expect(typeParameters, hasLength(0));
-    expect(type.isAbstract, isFalse);
-    expect(type.isMixinApplication, isFalse);
-    expect(type.isSynthetic, isFalse);
-    expect(type.documentationComment, '/// aaa');
-    _assertHasCodeRange(type, 50, 31);
-  }
-
-  void test_visitClassDeclaration_parameterized() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String className = "C";
-    String firstVariableName = "E";
-    String secondVariableName = "F";
-    ClassDeclaration classDeclaration = AstFactory.classDeclaration(
-        null,
-        className,
-        AstFactory.typeParameterList([firstVariableName, secondVariableName]),
-        null,
-        null,
-        null);
-    classDeclaration.accept(builder);
-    List<ClassElement> types = holder.types;
-    expect(types, hasLength(1));
-    ClassElement type = types[0];
-    expect(type, isNotNull);
-    expect(type.name, className);
-    List<TypeParameterElement> typeParameters = type.typeParameters;
-    expect(typeParameters, hasLength(2));
-    expect(typeParameters[0].name, firstVariableName);
-    expect(typeParameters[1].name, secondVariableName);
-    expect(type.isAbstract, isFalse);
-    expect(type.isMixinApplication, isFalse);
-    expect(type.isSynthetic, isFalse);
-  }
-
-  void test_visitClassDeclaration_withMembers() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String className = "C";
-    String typeParameterName = "E";
-    String fieldName = "f";
-    String methodName = "m";
-    ClassDeclaration classDeclaration = AstFactory.classDeclaration(
-        null,
-        className,
-        AstFactory.typeParameterList([typeParameterName]),
-        null,
-        null,
-        null, [
-      AstFactory.fieldDeclaration2(
-          false, null, [AstFactory.variableDeclaration(fieldName)]),
-      AstFactory.methodDeclaration2(
-          null,
-          null,
-          null,
-          null,
-          AstFactory.identifier3(methodName),
-          AstFactory.formalParameterList(),
-          AstFactory.blockFunctionBody2())
-    ]);
-    classDeclaration.accept(builder);
-    List<ClassElement> types = holder.types;
-    expect(types, hasLength(1));
-    ClassElement type = types[0];
-    expect(type, isNotNull);
-    expect(type.name, className);
-    expect(type.isAbstract, isFalse);
-    expect(type.isMixinApplication, isFalse);
-    expect(type.isSynthetic, isFalse);
-    List<TypeParameterElement> typeParameters = type.typeParameters;
-    expect(typeParameters, hasLength(1));
-    TypeParameterElement typeParameter = typeParameters[0];
-    expect(typeParameter, isNotNull);
-    expect(typeParameter.name, typeParameterName);
-    List<FieldElement> fields = type.fields;
-    expect(fields, hasLength(1));
-    FieldElement field = fields[0];
-    expect(field, isNotNull);
-    expect(field.name, fieldName);
-    List<MethodElement> methods = type.methods;
-    expect(methods, hasLength(1));
-    MethodElement method = methods[0];
-    expect(method, isNotNull);
-    expect(method.name, methodName);
-  }
-
-  void test_visitClassTypeAlias() {
-    // class B {}
-    // class M {}
-    // class C = B with M
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    ClassElementImpl classB = ElementFactory.classElement2('B', []);
-    ConstructorElementImpl constructorB =
-        ElementFactory.constructorElement2(classB, '', []);
-    constructorB.setModifier(Modifier.SYNTHETIC, true);
-    classB.constructors = [constructorB];
-    ClassElement classM = ElementFactory.classElement2('M', []);
-    WithClause withClause =
-        AstFactory.withClause([AstFactory.typeName(classM, [])]);
-    ClassTypeAlias alias = AstFactory.classTypeAlias(
-        'C', null, null, AstFactory.typeName(classB, []), withClause, null);
-    alias.accept(builder);
-    List<ClassElement> types = holder.types;
-    expect(types, hasLength(1));
-    ClassElement type = types[0];
-    expect(alias.element, same(type));
-    expect(type.name, equals('C'));
-    expect(type.isAbstract, isFalse);
-    expect(type.isMixinApplication, isTrue);
-    expect(type.isSynthetic, isFalse);
-    expect(type.typeParameters, isEmpty);
-    expect(type.fields, isEmpty);
-    expect(type.methods, isEmpty);
-  }
-
-  void test_visitClassTypeAlias_abstract() {
-    // class B {}
-    // class M {}
-    // abstract class C = B with M
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    ClassElementImpl classB = ElementFactory.classElement2('B', []);
-    ConstructorElementImpl constructorB =
-        ElementFactory.constructorElement2(classB, '', []);
-    constructorB.setModifier(Modifier.SYNTHETIC, true);
-    classB.constructors = [constructorB];
-    ClassElement classM = ElementFactory.classElement2('M', []);
-    WithClause withClause =
-        AstFactory.withClause([AstFactory.typeName(classM, [])]);
-    ClassTypeAlias classCAst = AstFactory.classTypeAlias('C', null,
-        Keyword.ABSTRACT, AstFactory.typeName(classB, []), withClause, null);
-    classCAst.accept(builder);
-    List<ClassElement> types = holder.types;
-    expect(types, hasLength(1));
-    ClassElement type = types[0];
-    expect(type.isAbstract, isTrue);
-    expect(type.isMixinApplication, isTrue);
-  }
-
-  void test_visitClassTypeAlias_typeParams() {
-    // class B {}
-    // class M {}
-    // class C<T> = B with M
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    ClassElementImpl classB = ElementFactory.classElement2('B', []);
-    ConstructorElementImpl constructorB =
-        ElementFactory.constructorElement2(classB, '', []);
-    constructorB.setModifier(Modifier.SYNTHETIC, true);
-    classB.constructors = [constructorB];
-    ClassElementImpl classM = ElementFactory.classElement2('M', []);
-    WithClause withClause =
-        AstFactory.withClause([AstFactory.typeName(classM, [])]);
-    ClassTypeAlias classCAst = AstFactory.classTypeAlias(
-        'C',
-        AstFactory.typeParameterList(['T']),
-        null,
-        AstFactory.typeName(classB, []),
-        withClause,
-        null);
-    classCAst.accept(builder);
-    List<ClassElement> types = holder.types;
-    expect(types, hasLength(1));
-    ClassElement type = types[0];
-    expect(type.typeParameters, hasLength(1));
-    expect(type.typeParameters[0].name, equals('T'));
-  }
-
-  void test_visitCompilationUnit_codeRange() {
-    TopLevelVariableDeclaration topLevelVariableDeclaration = AstFactory
-        .topLevelVariableDeclaration(null, AstFactory.typeName4('int'),
-            [AstFactory.variableDeclaration('V')]);
-    CompilationUnit unit = new CompilationUnit(
-        topLevelVariableDeclaration.beginToken,
-        null,
-        [],
-        [topLevelVariableDeclaration],
-        topLevelVariableDeclaration.endToken);
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    unit.beginToken.offset = 10;
-    unit.endToken.offset = 40;
-    unit.accept(builder);
-
-    CompilationUnitElement element = builder.compilationUnitElement;
-    _assertHasCodeRange(element, 0, 41);
-  }
-
-  void test_visitConstructorDeclaration_external() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String className = "A";
-    ConstructorDeclaration constructorDeclaration =
-        AstFactory.constructorDeclaration2(
-            null,
-            null,
-            AstFactory.identifier3(className),
-            null,
-            AstFactory.formalParameterList(),
-            null,
-            AstFactory.blockFunctionBody2());
-    constructorDeclaration.externalKeyword =
-        TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
-    constructorDeclaration.accept(builder);
-    List<ConstructorElement> constructors = holder.constructors;
-    expect(constructors, hasLength(1));
-    ConstructorElement constructor = constructors[0];
-    expect(constructor, isNotNull);
-    expect(constructor.isExternal, isTrue);
-    expect(constructor.isFactory, isFalse);
-    expect(constructor.name, "");
-    expect(constructor.functions, hasLength(0));
-    expect(constructor.labels, hasLength(0));
-    expect(constructor.localVariables, hasLength(0));
-    expect(constructor.parameters, hasLength(0));
-  }
-
-  void test_visitConstructorDeclaration_factory() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String className = "A";
-    ConstructorDeclaration constructorDeclaration =
-        AstFactory.constructorDeclaration2(
-            null,
-            Keyword.FACTORY,
-            AstFactory.identifier3(className),
-            null,
-            AstFactory.formalParameterList(),
-            null,
-            AstFactory.blockFunctionBody2());
-    constructorDeclaration.accept(builder);
-    List<ConstructorElement> constructors = holder.constructors;
-    expect(constructors, hasLength(1));
-    ConstructorElement constructor = constructors[0];
-    expect(constructor, isNotNull);
-    expect(constructor.isExternal, isFalse);
-    expect(constructor.isFactory, isTrue);
-    expect(constructor.name, "");
-    expect(constructor.functions, hasLength(0));
-    expect(constructor.labels, hasLength(0));
-    expect(constructor.localVariables, hasLength(0));
-    expect(constructor.parameters, hasLength(0));
-  }
-
-  void test_visitConstructorDeclaration_minimal() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String className = "A";
-    ConstructorDeclaration constructorDeclaration =
-        AstFactory.constructorDeclaration2(
-            null,
-            null,
-            AstFactory.identifier3(className),
-            null,
-            AstFactory.formalParameterList(),
-            null,
-            AstFactory.blockFunctionBody2());
-    constructorDeclaration.documentationComment = AstFactory
-        .documentationComment(
-            [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
-    constructorDeclaration.endToken.offset = 80;
-    constructorDeclaration.accept(builder);
-
-    List<ConstructorElement> constructors = holder.constructors;
-    expect(constructors, hasLength(1));
-    ConstructorElement constructor = constructors[0];
-    expect(constructor, isNotNull);
-    _assertHasCodeRange(constructor, 50, 31);
-    expect(constructor.documentationComment, '/// aaa');
-    expect(constructor.isExternal, isFalse);
-    expect(constructor.isFactory, isFalse);
-    expect(constructor.name, "");
-    expect(constructor.functions, hasLength(0));
-    expect(constructor.labels, hasLength(0));
-    expect(constructor.localVariables, hasLength(0));
-    expect(constructor.parameters, hasLength(0));
-  }
-
-  void test_visitConstructorDeclaration_named() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String className = "A";
-    String constructorName = "c";
-    ConstructorDeclaration constructorDeclaration =
-        AstFactory.constructorDeclaration2(
-            null,
-            null,
-            AstFactory.identifier3(className),
-            constructorName,
-            AstFactory.formalParameterList(),
-            null,
-            AstFactory.blockFunctionBody2());
-    constructorDeclaration.accept(builder);
-    List<ConstructorElement> constructors = holder.constructors;
-    expect(constructors, hasLength(1));
-    ConstructorElement constructor = constructors[0];
-    expect(constructor, isNotNull);
-    expect(constructor.isExternal, isFalse);
-    expect(constructor.isFactory, isFalse);
-    expect(constructor.name, constructorName);
-    expect(constructor.functions, hasLength(0));
-    expect(constructor.labels, hasLength(0));
-    expect(constructor.localVariables, hasLength(0));
-    expect(constructor.parameters, hasLength(0));
-    expect(constructorDeclaration.name.staticElement, same(constructor));
-    expect(constructorDeclaration.element, same(constructor));
-  }
-
-  void test_visitConstructorDeclaration_unnamed() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String className = "A";
-    ConstructorDeclaration constructorDeclaration =
-        AstFactory.constructorDeclaration2(
-            null,
-            null,
-            AstFactory.identifier3(className),
-            null,
-            AstFactory.formalParameterList(),
-            null,
-            AstFactory.blockFunctionBody2());
-    constructorDeclaration.accept(builder);
-    List<ConstructorElement> constructors = holder.constructors;
-    expect(constructors, hasLength(1));
-    ConstructorElement constructor = constructors[0];
-    expect(constructor, isNotNull);
-    expect(constructor.isExternal, isFalse);
-    expect(constructor.isFactory, isFalse);
-    expect(constructor.name, "");
-    expect(constructor.functions, hasLength(0));
-    expect(constructor.labels, hasLength(0));
-    expect(constructor.localVariables, hasLength(0));
-    expect(constructor.parameters, hasLength(0));
-    expect(constructorDeclaration.element, same(constructor));
-  }
-
-  void test_visitDeclaredIdentifier_noType() {
-    // var i
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    var variableName = 'i';
-    DeclaredIdentifier identifier =
-        AstFactory.declaredIdentifier3(variableName);
-    AstFactory.forEachStatement(
-        identifier, AstFactory.nullLiteral(), AstFactory.emptyStatement());
-    identifier.beginToken.offset = 50;
-    identifier.endToken.offset = 80;
-    identifier.accept(builder);
-
-    List<LocalVariableElement> variables = holder.localVariables;
-    expect(variables, hasLength(1));
-    LocalVariableElement variable = variables[0];
-    _assertHasCodeRange(variable, 50, 31);
-    expect(variable, isNotNull);
-    expect(variable.hasImplicitType, isTrue);
-    expect(variable.isConst, isFalse);
-    expect(variable.isDeprecated, isFalse);
-    expect(variable.isFinal, isFalse);
-    expect(variable.isOverride, isFalse);
-    expect(variable.isPrivate, isFalse);
-    expect(variable.isPublic, isTrue);
-    expect(variable.isSynthetic, isFalse);
-    expect(variable.name, variableName);
-  }
-
-  void test_visitDeclaredIdentifier_type() {
-    // E i
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    var variableName = 'i';
-    DeclaredIdentifier identifier =
-        AstFactory.declaredIdentifier4(AstFactory.typeName4('E'), variableName);
-    AstFactory.forEachStatement(
-        identifier, AstFactory.nullLiteral(), AstFactory.emptyStatement());
-    identifier.beginToken.offset = 50;
-    identifier.endToken.offset = 80;
-    identifier.accept(builder);
-
-    List<LocalVariableElement> variables = holder.localVariables;
-    expect(variables, hasLength(1));
-    LocalVariableElement variable = variables[0];
-    expect(variable, isNotNull);
-    _assertHasCodeRange(variable, 50, 31);
-    expect(variable.hasImplicitType, isFalse);
-    expect(variable.isConst, isFalse);
-    expect(variable.isDeprecated, isFalse);
-    expect(variable.isFinal, isFalse);
-    expect(variable.isOverride, isFalse);
-    expect(variable.isPrivate, isFalse);
-    expect(variable.isPublic, isTrue);
-    expect(variable.isSynthetic, isFalse);
-    expect(variable.name, variableName);
-  }
-
-  void test_visitDefaultFormalParameter_noType() {
-    // p = 0
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String parameterName = 'p';
-    DefaultFormalParameter formalParameter =
-        AstFactory.positionalFormalParameter(
-            AstFactory.simpleFormalParameter3(parameterName),
-            AstFactory.integer(0));
-    formalParameter.beginToken.offset = 50;
-    formalParameter.endToken.offset = 80;
-    formalParameter.accept(builder);
-
-    List<ParameterElement> parameters = holder.parameters;
-    expect(parameters, hasLength(1));
-    ParameterElement parameter = parameters[0];
-    _assertHasCodeRange(parameter, 50, 31);
-    expect(parameter.hasImplicitType, isTrue);
-    expect(parameter.initializer, isNotNull);
-    expect(parameter.initializer.type, isNotNull);
-    expect(parameter.initializer.hasImplicitReturnType, isTrue);
-    expect(parameter.isConst, isFalse);
-    expect(parameter.isDeprecated, isFalse);
-    expect(parameter.isFinal, isFalse);
-    expect(parameter.isInitializingFormal, isFalse);
-    expect(parameter.isOverride, isFalse);
-    expect(parameter.isPrivate, isFalse);
-    expect(parameter.isPublic, isTrue);
-    expect(parameter.isSynthetic, isFalse);
-    expect(parameter.name, parameterName);
-  }
-
-  void test_visitDefaultFormalParameter_type() {
-    // E p = 0
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String parameterName = 'p';
-    DefaultFormalParameter formalParameter = AstFactory.namedFormalParameter(
-        AstFactory.simpleFormalParameter4(
-            AstFactory.typeName4('E'), parameterName),
-        AstFactory.integer(0));
-    formalParameter.accept(builder);
-
-    List<ParameterElement> parameters = holder.parameters;
-    expect(parameters, hasLength(1));
-    ParameterElement parameter = parameters[0];
-    expect(parameter.hasImplicitType, isFalse);
-    expect(parameter.initializer, isNotNull);
-    expect(parameter.initializer.type, isNotNull);
-    expect(parameter.initializer.hasImplicitReturnType, isTrue);
-    expect(parameter.isConst, isFalse);
-    expect(parameter.isDeprecated, isFalse);
-    expect(parameter.isFinal, isFalse);
-    expect(parameter.isInitializingFormal, isFalse);
-    expect(parameter.isOverride, isFalse);
-    expect(parameter.isPrivate, isFalse);
-    expect(parameter.isPublic, isTrue);
-    expect(parameter.isSynthetic, isFalse);
-    expect(parameter.name, parameterName);
-  }
-
-  void test_visitEnumDeclaration() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String enumName = "E";
-    EnumDeclaration enumDeclaration =
-        AstFactory.enumDeclaration2(enumName, ["ONE"]);
-    enumDeclaration.documentationComment = AstFactory.documentationComment(
-        [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
-    enumDeclaration.endToken.offset = 80;
-    enumDeclaration.accept(builder);
-    List<ClassElement> enums = holder.enums;
-    expect(enums, hasLength(1));
-    ClassElement enumElement = enums[0];
-    expect(enumElement, isNotNull);
-    _assertHasCodeRange(enumElement, 50, 31);
-    expect(enumElement.documentationComment, '/// aaa');
-    expect(enumElement.name, enumName);
-  }
-
-  void test_visitFieldDeclaration() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String firstFieldName = "x";
-    String secondFieldName = "y";
-    FieldDeclaration fieldDeclaration =
-        AstFactory.fieldDeclaration2(false, null, [
-      AstFactory.variableDeclaration(firstFieldName),
-      AstFactory.variableDeclaration(secondFieldName)
-    ]);
-    fieldDeclaration.documentationComment = AstFactory.documentationComment(
-        [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
-    fieldDeclaration.endToken.offset = 110;
-    fieldDeclaration.accept(builder);
-
-    List<FieldElement> fields = holder.fields;
-    expect(fields, hasLength(2));
-
-    FieldElement firstField = fields[0];
-    expect(firstField, isNotNull);
-    _assertHasCodeRange(firstField, 50, 61);
-    expect(firstField.documentationComment, '/// aaa');
-    expect(firstField.name, firstFieldName);
-    expect(firstField.initializer, isNull);
-    expect(firstField.isConst, isFalse);
-    expect(firstField.isFinal, isFalse);
-    expect(firstField.isSynthetic, isFalse);
-
-    FieldElement secondField = fields[1];
-    expect(secondField, isNotNull);
-    _assertHasCodeRange(secondField, 50, 61);
-    expect(secondField.documentationComment, '/// aaa');
-    expect(secondField.name, secondFieldName);
-    expect(secondField.initializer, isNull);
-    expect(secondField.isConst, isFalse);
-    expect(secondField.isFinal, isFalse);
-    expect(secondField.isSynthetic, isFalse);
-  }
-
-  void test_visitFieldFormalParameter() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String parameterName = "p";
-    FieldFormalParameter formalParameter =
-        AstFactory.fieldFormalParameter(null, null, parameterName);
-    formalParameter.beginToken.offset = 50;
-    formalParameter.endToken.offset = 80;
-    formalParameter.accept(builder);
-    List<ParameterElement> parameters = holder.parameters;
-    expect(parameters, hasLength(1));
-    ParameterElement parameter = parameters[0];
-    expect(parameter, isNotNull);
-    _assertHasCodeRange(parameter, 50, 31);
-    expect(parameter.name, parameterName);
-    expect(parameter.initializer, isNull);
-    expect(parameter.isConst, isFalse);
-    expect(parameter.isFinal, isFalse);
-    expect(parameter.isSynthetic, isFalse);
-    expect(parameter.parameterKind, ParameterKind.REQUIRED);
-    expect(parameter.parameters, hasLength(0));
-  }
-
-  void test_visitFieldFormalParameter_functionTyped() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String parameterName = "p";
-    FieldFormalParameter formalParameter = AstFactory.fieldFormalParameter(
-        null,
-        null,
-        parameterName,
-        AstFactory
-            .formalParameterList([AstFactory.simpleFormalParameter3("a")]));
-    formalParameter.accept(builder);
-    List<ParameterElement> parameters = holder.parameters;
-    expect(parameters, hasLength(1));
-    ParameterElement parameter = parameters[0];
-    expect(parameter, isNotNull);
-    expect(parameter.name, parameterName);
-    expect(parameter.initializer, isNull);
-    expect(parameter.isConst, isFalse);
-    expect(parameter.isFinal, isFalse);
-    expect(parameter.isSynthetic, isFalse);
-    expect(parameter.parameterKind, ParameterKind.REQUIRED);
-    expect(parameter.parameters, hasLength(1));
-  }
-
-  void test_visitFormalParameterList() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String firstParameterName = "a";
-    String secondParameterName = "b";
-    FormalParameterList parameterList = AstFactory.formalParameterList([
-      AstFactory.simpleFormalParameter3(firstParameterName),
-      AstFactory.simpleFormalParameter3(secondParameterName)
-    ]);
-    parameterList.accept(builder);
-    List<ParameterElement> parameters = holder.parameters;
-    expect(parameters, hasLength(2));
-    expect(parameters[0].name, firstParameterName);
-    expect(parameters[1].name, secondParameterName);
-  }
-
-  void test_visitFunctionDeclaration_external() {
-    // external f();
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String functionName = "f";
-    FunctionDeclaration declaration = AstFactory.functionDeclaration(
-        null,
-        null,
-        functionName,
-        AstFactory.functionExpression2(
-            AstFactory.formalParameterList(), AstFactory.emptyFunctionBody()));
-    declaration.externalKeyword =
-        TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
-    declaration.accept(builder);
-
-    List<FunctionElement> functions = holder.functions;
-    expect(functions, hasLength(1));
-    FunctionElement function = functions[0];
-    expect(function, isNotNull);
-    expect(function.name, functionName);
-    expect(declaration.element, same(function));
-    expect(declaration.functionExpression.element, same(function));
-    expect(function.hasImplicitReturnType, isTrue);
-    expect(function.isExternal, isTrue);
-    expect(function.isSynthetic, isFalse);
-    expect(function.typeParameters, hasLength(0));
-  }
-
-  void test_visitFunctionDeclaration_getter() {
-    // get f() {}
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String functionName = "f";
-    FunctionDeclaration declaration = AstFactory.functionDeclaration(
-        null,
-        Keyword.GET,
-        functionName,
-        AstFactory.functionExpression2(
-            AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
-    declaration.documentationComment = AstFactory.documentationComment(
-        [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
-    declaration.endToken.offset = 80;
-    declaration.accept(builder);
-
-    List<PropertyAccessorElement> accessors = holder.accessors;
-    expect(accessors, hasLength(1));
-    PropertyAccessorElement accessor = accessors[0];
-    expect(accessor, isNotNull);
-    _assertHasCodeRange(accessor, 50, 31);
-    expect(accessor.documentationComment, '/// aaa');
-    expect(accessor.name, functionName);
-    expect(declaration.element, same(accessor));
-    expect(declaration.functionExpression.element, same(accessor));
-    expect(accessor.hasImplicitReturnType, isTrue);
-    expect(accessor.isGetter, isTrue);
-    expect(accessor.isExternal, isFalse);
-    expect(accessor.isSetter, isFalse);
-    expect(accessor.isSynthetic, isFalse);
-    expect(accessor.typeParameters, hasLength(0));
-    PropertyInducingElement variable = accessor.variable;
-    EngineTestCase.assertInstanceOf((obj) => obj is TopLevelVariableElement,
-        TopLevelVariableElement, variable);
-    expect(variable.isSynthetic, isTrue);
-  }
-
-  void test_visitFunctionDeclaration_plain() {
-    // T f() {}
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String functionName = "f";
-    FunctionDeclaration declaration = AstFactory.functionDeclaration(
-        AstFactory.typeName4('T'),
-        null,
-        functionName,
-        AstFactory.functionExpression2(
-            AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
-    declaration.documentationComment = AstFactory.documentationComment(
-        [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
-    declaration.endToken.offset = 80;
-    declaration.accept(builder);
-
-    List<FunctionElement> functions = holder.functions;
-    expect(functions, hasLength(1));
-    FunctionElement function = functions[0];
-    expect(function, isNotNull);
-    _assertHasCodeRange(function, 50, 31);
-    expect(function.documentationComment, '/// aaa');
-    expect(function.hasImplicitReturnType, isFalse);
-    expect(function.name, functionName);
-    expect(declaration.element, same(function));
-    expect(declaration.functionExpression.element, same(function));
-    expect(function.isExternal, isFalse);
-    expect(function.isSynthetic, isFalse);
-    expect(function.typeParameters, hasLength(0));
-  }
-
-  void test_visitFunctionDeclaration_setter() {
-    // set f() {}
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String functionName = "f";
-    FunctionDeclaration declaration = AstFactory.functionDeclaration(
-        null,
-        Keyword.SET,
-        functionName,
-        AstFactory.functionExpression2(
-            AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
-    declaration.documentationComment = AstFactory.documentationComment(
-        [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
-    declaration.endToken.offset = 80;
-    declaration.accept(builder);
-
-    List<PropertyAccessorElement> accessors = holder.accessors;
-    expect(accessors, hasLength(1));
-    PropertyAccessorElement accessor = accessors[0];
-    expect(accessor, isNotNull);
-    _assertHasCodeRange(accessor, 50, 31);
-    expect(accessor.documentationComment, '/// aaa');
-    expect(accessor.hasImplicitReturnType, isTrue);
-    expect(accessor.name, "$functionName=");
-    expect(declaration.element, same(accessor));
-    expect(declaration.functionExpression.element, same(accessor));
-    expect(accessor.isGetter, isFalse);
-    expect(accessor.isExternal, isFalse);
-    expect(accessor.isSetter, isTrue);
-    expect(accessor.isSynthetic, isFalse);
-    expect(accessor.typeParameters, hasLength(0));
-    PropertyInducingElement variable = accessor.variable;
-    EngineTestCase.assertInstanceOf((obj) => obj is TopLevelVariableElement,
-        TopLevelVariableElement, variable);
-    expect(variable.isSynthetic, isTrue);
-  }
-
-  void test_visitFunctionDeclaration_typeParameters() {
-    // f<E>() {}
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String functionName = 'f';
-    String typeParameterName = 'E';
-    FunctionExpression expression = AstFactory.functionExpression3(
-        AstFactory.typeParameterList([typeParameterName]),
-        AstFactory.formalParameterList(),
-        AstFactory.blockFunctionBody2());
-    FunctionDeclaration declaration =
-        AstFactory.functionDeclaration(null, null, functionName, expression);
-    declaration.accept(builder);
-
-    List<FunctionElement> functions = holder.functions;
-    expect(functions, hasLength(1));
-    FunctionElement function = functions[0];
-    expect(function, isNotNull);
-    expect(function.hasImplicitReturnType, isTrue);
-    expect(function.name, functionName);
-    expect(function.isExternal, isFalse);
-    expect(function.isSynthetic, isFalse);
-    expect(declaration.element, same(function));
-    expect(expression.element, same(function));
-    List<TypeParameterElement> typeParameters = function.typeParameters;
-    expect(typeParameters, hasLength(1));
-    TypeParameterElement typeParameter = typeParameters[0];
-    expect(typeParameter, isNotNull);
-    expect(typeParameter.name, typeParameterName);
-  }
-
-  void test_visitFunctionExpression() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    FunctionExpression expression = AstFactory.functionExpression2(
-        AstFactory.formalParameterList(), AstFactory.blockFunctionBody2());
-    expression.accept(builder);
-    List<FunctionElement> functions = holder.functions;
-    expect(functions, hasLength(1));
-    FunctionElement function = functions[0];
-    expect(function, isNotNull);
-    expect(expression.element, same(function));
-    expect(function.hasImplicitReturnType, isTrue);
-    expect(function.isSynthetic, isFalse);
-    expect(function.typeParameters, hasLength(0));
-  }
-
-  void test_visitFunctionTypeAlias() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String aliasName = "F";
-    String parameterName = "E";
-    FunctionTypeAlias aliasNode = AstFactory.typeAlias(
-        null, aliasName, AstFactory.typeParameterList([parameterName]), null);
-    aliasNode.documentationComment = AstFactory.documentationComment(
-        [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
-    aliasNode.endToken.offset = 80;
-    aliasNode.accept(builder);
-
-    List<FunctionTypeAliasElement> aliases = holder.typeAliases;
-    expect(aliases, hasLength(1));
-    FunctionTypeAliasElement alias = aliases[0];
-    expect(alias, isNotNull);
-    _assertHasCodeRange(alias, 50, 31);
-    expect(alias.documentationComment, '/// aaa');
-    expect(alias.name, aliasName);
-    expect(alias.parameters, hasLength(0));
-    List<TypeParameterElement> typeParameters = alias.typeParameters;
-    expect(typeParameters, hasLength(1));
-    TypeParameterElement typeParameter = typeParameters[0];
-    expect(typeParameter, isNotNull);
-    expect(typeParameter.name, parameterName);
-  }
-
-  void test_visitFunctionTypedFormalParameter() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String parameterName = "p";
-    FunctionTypedFormalParameter formalParameter =
-        AstFactory.functionTypedFormalParameter(null, parameterName);
-    _useParameterInMethod(formalParameter, 100, 110);
-    formalParameter.accept(builder);
-    List<ParameterElement> parameters = holder.parameters;
-    expect(parameters, hasLength(1));
-    ParameterElement parameter = parameters[0];
-    expect(parameter, isNotNull);
-    expect(parameter.name, parameterName);
-    expect(parameter.initializer, isNull);
-    expect(parameter.isConst, isFalse);
-    expect(parameter.isFinal, isFalse);
-    expect(parameter.isSynthetic, isFalse);
-    expect(parameter.parameterKind, ParameterKind.REQUIRED);
-    _assertVisibleRange(parameter, 100, 110);
-  }
-
-  void test_visitFunctionTypedFormalParameter_withTypeParameters() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String parameterName = "p";
-    FunctionTypedFormalParameter formalParameter =
-        AstFactory.functionTypedFormalParameter(null, parameterName);
-    formalParameter.typeParameters = AstFactory.typeParameterList(['F']);
-    _useParameterInMethod(formalParameter, 100, 110);
-    formalParameter.accept(builder);
-    List<ParameterElement> parameters = holder.parameters;
-    expect(parameters, hasLength(1));
-    ParameterElement parameter = parameters[0];
-    expect(parameter, isNotNull);
-    expect(parameter.name, parameterName);
-    expect(parameter.initializer, isNull);
-    expect(parameter.isConst, isFalse);
-    expect(parameter.isFinal, isFalse);
-    expect(parameter.isSynthetic, isFalse);
-    expect(parameter.parameterKind, ParameterKind.REQUIRED);
-    expect(parameter.typeParameters, hasLength(1));
-    _assertVisibleRange(parameter, 100, 110);
-  }
-
-  void test_visitLabeledStatement() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String labelName = "l";
-    LabeledStatement statement = AstFactory.labeledStatement(
-        [AstFactory.label2(labelName)], AstFactory.breakStatement());
-    statement.accept(builder);
-    List<LabelElement> labels = holder.labels;
-    expect(labels, hasLength(1));
-    LabelElement label = labels[0];
-    expect(label, isNotNull);
-    expect(label.name, labelName);
-    expect(label.isSynthetic, isFalse);
-  }
-
-  void test_visitMethodDeclaration_abstract() {
-    // m();
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String methodName = "m";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration2(
-        null,
-        null,
-        null,
-        null,
-        AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList(),
-        AstFactory.emptyFunctionBody());
-    methodDeclaration.accept(builder);
-
-    List<MethodElement> methods = holder.methods;
-    expect(methods, hasLength(1));
-    MethodElement method = methods[0];
-    expect(method, isNotNull);
-    expect(method.hasImplicitReturnType, isTrue);
-    expect(method.name, methodName);
-    expect(method.functions, hasLength(0));
-    expect(method.labels, hasLength(0));
-    expect(method.localVariables, hasLength(0));
-    expect(method.parameters, hasLength(0));
-    expect(method.typeParameters, hasLength(0));
-    expect(method.isAbstract, isTrue);
-    expect(method.isExternal, isFalse);
-    expect(method.isStatic, isFalse);
-    expect(method.isSynthetic, isFalse);
-  }
-
-  void test_visitMethodDeclaration_duplicateField_synthetic() {
-    buildElementsForText(r'''
-class A {
-  int f;
-  int get f => 42;
-}
-''');
-    ClassDeclaration classNode = compilationUnit.declarations.single;
-    // ClassElement
-    ClassElement classElement = classNode.element;
-    expect(classElement.fields, hasLength(2));
-    expect(classElement.accessors, hasLength(3));
-    FieldElement notSyntheticFieldElement = classElement.fields
-        .singleWhere((f) => f.displayName == 'f' && !f.isSynthetic);
-    FieldElement syntheticFieldElement = classElement.fields
-        .singleWhere((f) => f.displayName == 'f' && f.isSynthetic);
-    PropertyAccessorElement syntheticGetterElement = classElement.accessors
-        .singleWhere(
-            (a) => a.displayName == 'f' && a.isGetter && a.isSynthetic);
-    PropertyAccessorElement syntheticSetterElement = classElement.accessors
-        .singleWhere(
-            (a) => a.displayName == 'f' && a.isSetter && a.isSynthetic);
-    PropertyAccessorElement notSyntheticGetterElement = classElement.accessors
-        .singleWhere(
-            (a) => a.displayName == 'f' && a.isGetter && !a.isSynthetic);
-    expect(notSyntheticFieldElement.getter, same(syntheticGetterElement));
-    expect(notSyntheticFieldElement.setter, same(syntheticSetterElement));
-    expect(syntheticFieldElement.getter, same(notSyntheticGetterElement));
-    expect(syntheticFieldElement.setter, isNull);
-    // class members nodes and their elements
-    FieldDeclaration fieldDeclNode = classNode.members[0];
-    VariableDeclaration fieldNode = fieldDeclNode.fields.variables.single;
-    MethodDeclaration getterNode = classNode.members[1];
-    expect(fieldNode.element, notSyntheticFieldElement);
-    expect(getterNode.element, notSyntheticGetterElement);
-  }
-
-  void test_visitMethodDeclaration_external() {
-    // external m();
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String methodName = "m";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration2(
-        null,
-        null,
-        null,
-        null,
-        AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList(),
-        AstFactory.emptyFunctionBody());
-    methodDeclaration.externalKeyword =
-        TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
-    methodDeclaration.accept(builder);
-
-    List<MethodElement> methods = holder.methods;
-    expect(methods, hasLength(1));
-    MethodElement method = methods[0];
-    expect(method, isNotNull);
-    expect(method.hasImplicitReturnType, isTrue);
-    expect(method.name, methodName);
-    expect(method.functions, hasLength(0));
-    expect(method.labels, hasLength(0));
-    expect(method.localVariables, hasLength(0));
-    expect(method.parameters, hasLength(0));
-    expect(method.typeParameters, hasLength(0));
-    expect(method.isAbstract, isFalse);
-    expect(method.isExternal, isTrue);
-    expect(method.isStatic, isFalse);
-    expect(method.isSynthetic, isFalse);
-  }
-
-  void test_visitMethodDeclaration_getter() {
-    // get m() {}
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String methodName = "m";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration2(
-        null,
-        null,
-        Keyword.GET,
-        null,
-        AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList(),
-        AstFactory.blockFunctionBody2());
-    methodDeclaration.documentationComment = AstFactory.documentationComment(
-        [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
-    methodDeclaration.endToken.offset = 80;
-    methodDeclaration.accept(builder);
-
-    List<FieldElement> fields = holder.fields;
-    expect(fields, hasLength(1));
-    FieldElement field = fields[0];
-    expect(field, isNotNull);
-    expect(field.name, methodName);
-    expect(field.isSynthetic, isTrue);
-    expect(field.setter, isNull);
-    PropertyAccessorElement getter = field.getter;
-    expect(getter, isNotNull);
-    _assertHasCodeRange(getter, 50, 31);
-    expect(getter.documentationComment, '/// aaa');
-    expect(getter.hasImplicitReturnType, isTrue);
-    expect(getter.isAbstract, isFalse);
-    expect(getter.isExternal, isFalse);
-    expect(getter.isGetter, isTrue);
-    expect(getter.isSynthetic, isFalse);
-    expect(getter.name, methodName);
-    expect(getter.variable, field);
-    expect(getter.functions, hasLength(0));
-    expect(getter.labels, hasLength(0));
-    expect(getter.localVariables, hasLength(0));
-    expect(getter.parameters, hasLength(0));
-  }
-
-  void test_visitMethodDeclaration_getter_abstract() {
-    // get m();
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String methodName = "m";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration2(
-        null,
-        null,
-        Keyword.GET,
-        null,
-        AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList(),
-        AstFactory.emptyFunctionBody());
-    methodDeclaration.accept(builder);
-
-    List<FieldElement> fields = holder.fields;
-    expect(fields, hasLength(1));
-    FieldElement field = fields[0];
-    expect(field, isNotNull);
-    expect(field.name, methodName);
-    expect(field.isSynthetic, isTrue);
-    expect(field.setter, isNull);
-    PropertyAccessorElement getter = field.getter;
-    expect(getter, isNotNull);
-    expect(getter.hasImplicitReturnType, isTrue);
-    expect(getter.isAbstract, isTrue);
-    expect(getter.isExternal, isFalse);
-    expect(getter.isGetter, isTrue);
-    expect(getter.isSynthetic, isFalse);
-    expect(getter.name, methodName);
-    expect(getter.variable, field);
-    expect(getter.functions, hasLength(0));
-    expect(getter.labels, hasLength(0));
-    expect(getter.localVariables, hasLength(0));
-    expect(getter.parameters, hasLength(0));
-  }
-
-  void test_visitMethodDeclaration_getter_external() {
-    // external get m();
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String methodName = "m";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration(
-        null,
-        null,
-        Keyword.GET,
-        null,
-        AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList());
-    methodDeclaration.externalKeyword =
-        TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
-    methodDeclaration.accept(builder);
-
-    List<FieldElement> fields = holder.fields;
-    expect(fields, hasLength(1));
-    FieldElement field = fields[0];
-    expect(field, isNotNull);
-    expect(field.name, methodName);
-    expect(field.isSynthetic, isTrue);
-    expect(field.setter, isNull);
-    PropertyAccessorElement getter = field.getter;
-    expect(getter, isNotNull);
-    expect(getter.hasImplicitReturnType, isTrue);
-    expect(getter.isAbstract, isFalse);
-    expect(getter.isExternal, isTrue);
-    expect(getter.isGetter, isTrue);
-    expect(getter.isSynthetic, isFalse);
-    expect(getter.name, methodName);
-    expect(getter.variable, field);
-    expect(getter.functions, hasLength(0));
-    expect(getter.labels, hasLength(0));
-    expect(getter.localVariables, hasLength(0));
-    expect(getter.parameters, hasLength(0));
-  }
-
-  void test_visitMethodDeclaration_minimal() {
-    // T m() {}
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String methodName = "m";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration2(
-        null,
-        AstFactory.typeName4('T'),
-        null,
-        null,
-        AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList(),
-        AstFactory.blockFunctionBody2());
-    methodDeclaration.documentationComment = AstFactory.documentationComment(
-        [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
-    methodDeclaration.endToken.offset = 80;
-    methodDeclaration.accept(builder);
-
-    List<MethodElement> methods = holder.methods;
-    expect(methods, hasLength(1));
-    MethodElement method = methods[0];
-    expect(method, isNotNull);
-    _assertHasCodeRange(method, 50, 31);
-    expect(method.documentationComment, '/// aaa');
-    expect(method.hasImplicitReturnType, isFalse);
-    expect(method.name, methodName);
-    expect(method.functions, hasLength(0));
-    expect(method.labels, hasLength(0));
-    expect(method.localVariables, hasLength(0));
-    expect(method.parameters, hasLength(0));
-    expect(method.typeParameters, hasLength(0));
-    expect(method.isAbstract, isFalse);
-    expect(method.isExternal, isFalse);
-    expect(method.isStatic, isFalse);
-    expect(method.isSynthetic, isFalse);
-  }
-
-  void test_visitMethodDeclaration_operator() {
-    // operator +(addend) {}
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String methodName = "+";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration2(
-        null,
-        null,
-        null,
-        Keyword.OPERATOR,
-        AstFactory.identifier3(methodName),
-        AstFactory
-            .formalParameterList([AstFactory.simpleFormalParameter3("addend")]),
-        AstFactory.blockFunctionBody2());
-    methodDeclaration.accept(builder);
-
-    List<MethodElement> methods = holder.methods;
-    expect(methods, hasLength(1));
-    MethodElement method = methods[0];
-    expect(method, isNotNull);
-    expect(method.hasImplicitReturnType, isTrue);
-    expect(method.name, methodName);
-    expect(method.functions, hasLength(0));
-    expect(method.labels, hasLength(0));
-    expect(method.localVariables, hasLength(0));
-    expect(method.parameters, hasLength(1));
-    expect(method.typeParameters, hasLength(0));
-    expect(method.isAbstract, isFalse);
-    expect(method.isExternal, isFalse);
-    expect(method.isStatic, isFalse);
-    expect(method.isSynthetic, isFalse);
-  }
-
-  void test_visitMethodDeclaration_setter() {
-    // set m() {}
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String methodName = "m";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration2(
-        null,
-        null,
-        Keyword.SET,
-        null,
-        AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList(),
-        AstFactory.blockFunctionBody2());
-    methodDeclaration.documentationComment = AstFactory.documentationComment(
-        [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
-    methodDeclaration.endToken.offset = 80;
-    methodDeclaration.accept(builder);
-
-    List<FieldElement> fields = holder.fields;
-    expect(fields, hasLength(1));
-    FieldElement field = fields[0];
-    expect(field, isNotNull);
-    expect(field.name, methodName);
-    expect(field.isSynthetic, isTrue);
-    expect(field.getter, isNull);
-
-    PropertyAccessorElement setter = field.setter;
-    expect(setter, isNotNull);
-    _assertHasCodeRange(setter, 50, 31);
-    expect(setter.documentationComment, '/// aaa');
-    expect(setter.hasImplicitReturnType, isTrue);
-    expect(setter.isAbstract, isFalse);
-    expect(setter.isExternal, isFalse);
-    expect(setter.isSetter, isTrue);
-    expect(setter.isSynthetic, isFalse);
-    expect(setter.name, "$methodName=");
-    expect(setter.displayName, methodName);
-    expect(setter.variable, field);
-    expect(setter.functions, hasLength(0));
-    expect(setter.labels, hasLength(0));
-    expect(setter.localVariables, hasLength(0));
-    expect(setter.parameters, hasLength(0));
-  }
-
-  void test_visitMethodDeclaration_setter_abstract() {
-    // set m();
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String methodName = "m";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration2(
-        null,
-        null,
-        Keyword.SET,
-        null,
-        AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList(),
-        AstFactory.emptyFunctionBody());
-    methodDeclaration.accept(builder);
-
-    List<FieldElement> fields = holder.fields;
-    expect(fields, hasLength(1));
-    FieldElement field = fields[0];
-    expect(field, isNotNull);
-    expect(field.name, methodName);
-    expect(field.isSynthetic, isTrue);
-    expect(field.getter, isNull);
-    PropertyAccessorElement setter = field.setter;
-    expect(setter, isNotNull);
-    expect(setter.hasImplicitReturnType, isTrue);
-    expect(setter.isAbstract, isTrue);
-    expect(setter.isExternal, isFalse);
-    expect(setter.isSetter, isTrue);
-    expect(setter.isSynthetic, isFalse);
-    expect(setter.name, "$methodName=");
-    expect(setter.displayName, methodName);
-    expect(setter.variable, field);
-    expect(setter.functions, hasLength(0));
-    expect(setter.labels, hasLength(0));
-    expect(setter.localVariables, hasLength(0));
-    expect(setter.parameters, hasLength(0));
-  }
-
-  void test_visitMethodDeclaration_setter_external() {
-    // external m();
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String methodName = "m";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration(
-        null,
-        null,
-        Keyword.SET,
-        null,
-        AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList());
-    methodDeclaration.externalKeyword =
-        TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
-    methodDeclaration.accept(builder);
-
-    List<FieldElement> fields = holder.fields;
-    expect(fields, hasLength(1));
-    FieldElement field = fields[0];
-    expect(field, isNotNull);
-    expect(field.name, methodName);
-    expect(field.isSynthetic, isTrue);
-    expect(field.getter, isNull);
-    PropertyAccessorElement setter = field.setter;
-    expect(setter, isNotNull);
-    expect(setter.hasImplicitReturnType, isTrue);
-    expect(setter.isAbstract, isFalse);
-    expect(setter.isExternal, isTrue);
-    expect(setter.isSetter, isTrue);
-    expect(setter.isSynthetic, isFalse);
-    expect(setter.name, "$methodName=");
-    expect(setter.displayName, methodName);
-    expect(setter.variable, field);
-    expect(setter.functions, hasLength(0));
-    expect(setter.labels, hasLength(0));
-    expect(setter.localVariables, hasLength(0));
-    expect(setter.parameters, hasLength(0));
-  }
-
-  void test_visitMethodDeclaration_static() {
-    // static m() {}
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String methodName = "m";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration2(
-        Keyword.STATIC,
-        null,
-        null,
-        null,
-        AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList(),
-        AstFactory.blockFunctionBody2());
-    methodDeclaration.accept(builder);
-    List<MethodElement> methods = holder.methods;
-    expect(methods, hasLength(1));
-    MethodElement method = methods[0];
-    expect(method, isNotNull);
-    expect(method.hasImplicitReturnType, isTrue);
-    expect(method.name, methodName);
-    expect(method.functions, hasLength(0));
-    expect(method.labels, hasLength(0));
-    expect(method.localVariables, hasLength(0));
-    expect(method.parameters, hasLength(0));
-    expect(method.typeParameters, hasLength(0));
-    expect(method.isAbstract, isFalse);
-    expect(method.isExternal, isFalse);
-    expect(method.isStatic, isTrue);
-    expect(method.isSynthetic, isFalse);
-  }
-
-  void test_visitMethodDeclaration_typeParameters() {
-    // m<E>() {}
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String methodName = "m";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration2(
-        null,
-        null,
-        null,
-        null,
-        AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList(),
-        AstFactory.blockFunctionBody2());
-    methodDeclaration.typeParameters = AstFactory.typeParameterList(['E']);
-    methodDeclaration.accept(builder);
-
-    List<MethodElement> methods = holder.methods;
-    expect(methods, hasLength(1));
-    MethodElement method = methods[0];
-    expect(method, isNotNull);
-    expect(method.hasImplicitReturnType, isTrue);
-    expect(method.name, methodName);
-    expect(method.functions, hasLength(0));
-    expect(method.labels, hasLength(0));
-    expect(method.localVariables, hasLength(0));
-    expect(method.parameters, hasLength(0));
-    expect(method.typeParameters, hasLength(1));
-    expect(method.isAbstract, isFalse);
-    expect(method.isExternal, isFalse);
-    expect(method.isStatic, isFalse);
-    expect(method.isSynthetic, isFalse);
-  }
-
-  void test_visitMethodDeclaration_withMembers() {
-    // m(p) { var v; try { l: return; } catch (e) {} }
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String methodName = "m";
-    String parameterName = "p";
-    String localVariableName = "v";
-    String labelName = "l";
-    String exceptionParameterName = "e";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration2(
-        null,
-        null,
-        null,
-        null,
-        AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList(
-            [AstFactory.simpleFormalParameter3(parameterName)]),
-        AstFactory.blockFunctionBody2([
-          AstFactory.variableDeclarationStatement2(
-              Keyword.VAR, [AstFactory.variableDeclaration(localVariableName)]),
-          AstFactory.tryStatement2(
-              AstFactory.block([
-                AstFactory.labeledStatement([AstFactory.label2(labelName)],
-                    AstFactory.returnStatement())
-              ]),
-              [AstFactory.catchClause(exceptionParameterName)])
-        ]));
-    methodDeclaration.accept(builder);
-
-    List<MethodElement> methods = holder.methods;
-    expect(methods, hasLength(1));
-    MethodElement method = methods[0];
-    expect(method, isNotNull);
-    expect(method.hasImplicitReturnType, isTrue);
-    expect(method.name, methodName);
-    expect(method.typeParameters, hasLength(0));
-    expect(method.isAbstract, isFalse);
-    expect(method.isExternal, isFalse);
-    expect(method.isStatic, isFalse);
-    expect(method.isSynthetic, isFalse);
-    List<VariableElement> parameters = method.parameters;
-    expect(parameters, hasLength(1));
-    VariableElement parameter = parameters[0];
-    expect(parameter, isNotNull);
-    expect(parameter.name, parameterName);
-    List<VariableElement> localVariables = method.localVariables;
-    expect(localVariables, hasLength(2));
-    VariableElement firstVariable = localVariables[0];
-    VariableElement secondVariable = localVariables[1];
-    expect(firstVariable, isNotNull);
-    expect(secondVariable, isNotNull);
-    expect(
-        (firstVariable.name == localVariableName &&
-                secondVariable.name == exceptionParameterName) ||
-            (firstVariable.name == exceptionParameterName &&
-                secondVariable.name == localVariableName),
-        isTrue);
-    List<LabelElement> labels = method.labels;
-    expect(labels, hasLength(1));
-    LabelElement label = labels[0];
-    expect(label, isNotNull);
-    expect(label.name, labelName);
-  }
-
-  void test_visitNamedFormalParameter() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String parameterName = "p";
-    DefaultFormalParameter formalParameter = AstFactory.namedFormalParameter(
-        AstFactory.simpleFormalParameter3(parameterName),
-        AstFactory.identifier3("42"));
-    _useParameterInMethod(formalParameter, 100, 110);
-    formalParameter.beginToken.offset = 50;
-    formalParameter.endToken.offset = 80;
-    formalParameter.accept(builder);
-    List<ParameterElement> parameters = holder.parameters;
-    expect(parameters, hasLength(1));
-    ParameterElement parameter = parameters[0];
-    expect(parameter, isNotNull);
-    _assertHasCodeRange(parameter, 50, 32);
-    expect(parameter.name, parameterName);
-    expect(parameter.isConst, isFalse);
-    expect(parameter.isFinal, isFalse);
-    expect(parameter.isSynthetic, isFalse);
-    expect(parameter.parameterKind, ParameterKind.NAMED);
-    _assertVisibleRange(parameter, 100, 110);
-    expect(parameter.defaultValueCode, "42");
-    FunctionElement initializer = parameter.initializer;
-    expect(initializer, isNotNull);
-    expect(initializer.isSynthetic, isTrue);
-    expect(initializer.hasImplicitReturnType, isTrue);
-  }
-
-  void test_visitSimpleFormalParameter_noType() {
-    // p
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String parameterName = "p";
-    SimpleFormalParameter formalParameter =
-        AstFactory.simpleFormalParameter3(parameterName);
-    _useParameterInMethod(formalParameter, 100, 110);
-    formalParameter.accept(builder);
-    List<ParameterElement> parameters = holder.parameters;
-    expect(parameters, hasLength(1));
-    ParameterElement parameter = parameters[0];
-    expect(parameter, isNotNull);
-    expect(parameter.hasImplicitType, isTrue);
-    expect(parameter.initializer, isNull);
-    expect(parameter.isConst, isFalse);
-    expect(parameter.isFinal, isFalse);
-    expect(parameter.isSynthetic, isFalse);
-    expect(parameter.name, parameterName);
-    expect(parameter.parameterKind, ParameterKind.REQUIRED);
-    _assertVisibleRange(parameter, 100, 110);
-  }
-
-  void test_visitSimpleFormalParameter_type() {
-    // T p
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String parameterName = "p";
-    SimpleFormalParameter formalParameter = AstFactory.simpleFormalParameter4(
-        AstFactory.typeName4('T'), parameterName);
-    _useParameterInMethod(formalParameter, 100, 110);
-    formalParameter.accept(builder);
-    List<ParameterElement> parameters = holder.parameters;
-    expect(parameters, hasLength(1));
-    ParameterElement parameter = parameters[0];
-    expect(parameter, isNotNull);
-    expect(parameter.hasImplicitType, isFalse);
-    expect(parameter.initializer, isNull);
-    expect(parameter.isConst, isFalse);
-    expect(parameter.isFinal, isFalse);
-    expect(parameter.isSynthetic, isFalse);
-    expect(parameter.name, parameterName);
-    expect(parameter.parameterKind, ParameterKind.REQUIRED);
-    _assertVisibleRange(parameter, 100, 110);
-  }
-
-  void test_visitTypeAlias_minimal() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String aliasName = "F";
-    TypeAlias typeAlias = AstFactory.typeAlias(null, aliasName, null, null);
-    typeAlias.accept(builder);
-    List<FunctionTypeAliasElement> aliases = holder.typeAliases;
-    expect(aliases, hasLength(1));
-    FunctionTypeAliasElement alias = aliases[0];
-    expect(alias, isNotNull);
-    expect(alias.name, aliasName);
-    expect(alias.type, isNotNull);
-    expect(alias.isSynthetic, isFalse);
-  }
-
-  void test_visitTypeAlias_withFormalParameters() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String aliasName = "F";
-    String firstParameterName = "x";
-    String secondParameterName = "y";
-    TypeAlias typeAlias = AstFactory.typeAlias(
-        null,
-        aliasName,
-        AstFactory.typeParameterList(),
-        AstFactory.formalParameterList([
-          AstFactory.simpleFormalParameter3(firstParameterName),
-          AstFactory.simpleFormalParameter3(secondParameterName)
-        ]));
-    typeAlias.beginToken.offset = 50;
-    typeAlias.endToken.offset = 80;
-    typeAlias.accept(builder);
-    List<FunctionTypeAliasElement> aliases = holder.typeAliases;
-    expect(aliases, hasLength(1));
-    FunctionTypeAliasElement alias = aliases[0];
-    expect(alias, isNotNull);
-    _assertHasCodeRange(alias, 50, 31);
-    expect(alias.name, aliasName);
-    expect(alias.type, isNotNull);
-    expect(alias.isSynthetic, isFalse);
-    List<VariableElement> parameters = alias.parameters;
-    expect(parameters, hasLength(2));
-    expect(parameters[0].name, firstParameterName);
-    expect(parameters[1].name, secondParameterName);
-    List<TypeParameterElement> typeParameters = alias.typeParameters;
-    expect(typeParameters, isNotNull);
-    expect(typeParameters, hasLength(0));
-  }
-
-  void test_visitTypeAlias_withTypeParameters() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String aliasName = "F";
-    String firstTypeParameterName = "A";
-    String secondTypeParameterName = "B";
-    TypeAlias typeAlias = AstFactory.typeAlias(
-        null,
-        aliasName,
-        AstFactory.typeParameterList(
-            [firstTypeParameterName, secondTypeParameterName]),
-        AstFactory.formalParameterList());
-    typeAlias.accept(builder);
-    List<FunctionTypeAliasElement> aliases = holder.typeAliases;
-    expect(aliases, hasLength(1));
-    FunctionTypeAliasElement alias = aliases[0];
-    expect(alias, isNotNull);
-    expect(alias.name, aliasName);
-    expect(alias.type, isNotNull);
-    expect(alias.isSynthetic, isFalse);
-    List<VariableElement> parameters = alias.parameters;
-    expect(parameters, isNotNull);
-    expect(parameters, hasLength(0));
-    List<TypeParameterElement> typeParameters = alias.typeParameters;
-    expect(typeParameters, hasLength(2));
-    expect(typeParameters[0].name, firstTypeParameterName);
-    expect(typeParameters[1].name, secondTypeParameterName);
-  }
-
-  void test_visitTypeParameter() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String parameterName = "E";
-    TypeParameter typeParameter = AstFactory.typeParameter(parameterName);
-    typeParameter.beginToken.offset = 50;
-    typeParameter.accept(builder);
-    List<TypeParameterElement> typeParameters = holder.typeParameters;
-    expect(typeParameters, hasLength(1));
-    TypeParameterElement typeParameterElement = typeParameters[0];
-    expect(typeParameterElement, isNotNull);
-    _assertHasCodeRange(typeParameterElement, 50, 1);
-    expect(typeParameterElement.name, parameterName);
-    expect(typeParameterElement.bound, isNull);
-    expect(typeParameterElement.isSynthetic, isFalse);
-  }
-
-  void test_visitVariableDeclaration_inConstructor() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    //
-    // C() {var v;}
-    //
-    String variableName = "v";
-    VariableDeclaration variable =
-        AstFactory.variableDeclaration2(variableName, null);
-    VariableDeclarationStatement statement =
-        AstFactory.variableDeclarationStatement2(Keyword.VAR, [variable]);
-    ConstructorDeclaration constructor = AstFactory.constructorDeclaration2(
-        null,
-        null,
-        AstFactory.identifier3("C"),
-        "C",
-        AstFactory.formalParameterList(),
-        null,
-        AstFactory.blockFunctionBody2([statement]));
-    statement.beginToken.offset = 50;
-    statement.endToken.offset = 80;
-    _setBlockBodySourceRange(constructor.body, 100, 110);
-    constructor.accept(builder);
-
-    List<ConstructorElement> constructors = holder.constructors;
-    expect(constructors, hasLength(1));
-    List<LocalVariableElement> variableElements =
-        constructors[0].localVariables;
-    expect(variableElements, hasLength(1));
-    LocalVariableElement variableElement = variableElements[0];
-    _assertHasCodeRange(variableElement, 50, 31);
-    expect(variableElement.hasImplicitType, isTrue);
-    expect(variableElement.name, variableName);
-    _assertVisibleRange(variableElement, 100, 110);
-  }
-
-  void test_visitVariableDeclaration_inForEachStatement() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    //
-    // m() { for (var v in []) }
-    //
-    String variableName = "v";
-    Statement statement = AstFactory.forEachStatement(
-        AstFactory.declaredIdentifier3('v'),
-        AstFactory.listLiteral(),
-        AstFactory.block());
-    _setNodeSourceRange(statement, 100, 110);
-    MethodDeclaration method = AstFactory.methodDeclaration2(
-        null,
-        null,
-        null,
-        null,
-        AstFactory.identifier3("m"),
-        AstFactory.formalParameterList(),
-        AstFactory.blockFunctionBody2([statement]));
-    _setBlockBodySourceRange(method.body, 200, 220);
-    method.accept(builder);
-
-    List<MethodElement> methods = holder.methods;
-    expect(methods, hasLength(1));
-    List<LocalVariableElement> variableElements = methods[0].localVariables;
-    expect(variableElements, hasLength(1));
-    LocalVariableElement variableElement = variableElements[0];
-    expect(variableElement.name, variableName);
-    _assertVisibleRange(variableElement, 100, 110);
-  }
-
-  void test_visitVariableDeclaration_inForStatement() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    //
-    // m() { for (T v;;) }
-    //
-    String variableName = "v";
-    ForStatement statement = AstFactory.forStatement2(
-        AstFactory.variableDeclarationList(null, AstFactory.typeName4('T'),
-            [AstFactory.variableDeclaration('v')]),
-        null,
-        null,
-        AstFactory.block());
-    _setNodeSourceRange(statement, 100, 110);
-    MethodDeclaration method = AstFactory.methodDeclaration2(
-        null,
-        null,
-        null,
-        null,
-        AstFactory.identifier3("m"),
-        AstFactory.formalParameterList(),
-        AstFactory.blockFunctionBody2([statement]));
-    _setBlockBodySourceRange(method.body, 200, 220);
-    method.accept(builder);
-
-    List<MethodElement> methods = holder.methods;
-    expect(methods, hasLength(1));
-    List<LocalVariableElement> variableElements = methods[0].localVariables;
-    expect(variableElements, hasLength(1));
-    LocalVariableElement variableElement = variableElements[0];
-    expect(variableElement.name, variableName);
-    _assertVisibleRange(variableElement, 100, 110);
-  }
-
-  void test_visitVariableDeclaration_inMethod() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    //
-    // m() {T v;}
-    //
-    String variableName = "v";
-    VariableDeclaration variable =
-        AstFactory.variableDeclaration2(variableName, null);
-    Statement statement = AstFactory.variableDeclarationStatement(
-        null, AstFactory.typeName4('T'), [variable]);
-    MethodDeclaration method = AstFactory.methodDeclaration2(
-        null,
-        null,
-        null,
-        null,
-        AstFactory.identifier3("m"),
-        AstFactory.formalParameterList(),
-        AstFactory.blockFunctionBody2([statement]));
-    _setBlockBodySourceRange(method.body, 100, 110);
-    method.accept(builder);
-
-    List<MethodElement> methods = holder.methods;
-    expect(methods, hasLength(1));
-    List<LocalVariableElement> variableElements = methods[0].localVariables;
-    expect(variableElements, hasLength(1));
-    LocalVariableElement variableElement = variableElements[0];
-    expect(variableElement.hasImplicitType, isFalse);
-    expect(variableElement.name, variableName);
-    _assertVisibleRange(variableElement, 100, 110);
-  }
-
-  void test_visitVariableDeclaration_localNestedInFunction() {
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    //
-    // var f = () {var v;};
-    //
-    String variableName = "v";
-    VariableDeclaration variable =
-        AstFactory.variableDeclaration2(variableName, null);
-    Statement statement =
-        AstFactory.variableDeclarationStatement2(null, [variable]);
-    Expression initializer = AstFactory.functionExpression2(
-        AstFactory.formalParameterList(),
-        AstFactory.blockFunctionBody2([statement]));
-    String fieldName = "f";
-    VariableDeclaration field =
-        AstFactory.variableDeclaration2(fieldName, initializer);
-    FieldDeclaration fieldDeclaration =
-        AstFactory.fieldDeclaration2(false, null, [field]);
-    fieldDeclaration.accept(builder);
-
-    List<FieldElement> variables = holder.fields;
-    expect(variables, hasLength(1));
-    FieldElement fieldElement = variables[0];
-    expect(fieldElement, isNotNull);
-    FunctionElement initializerElement = fieldElement.initializer;
-    expect(initializerElement, isNotNull);
-    expect(initializerElement.hasImplicitReturnType, isTrue);
-    List<FunctionElement> functionElements = initializerElement.functions;
-    expect(functionElements, hasLength(1));
-    List<LocalVariableElement> variableElements =
-        functionElements[0].localVariables;
-    expect(variableElements, hasLength(1));
-    LocalVariableElement variableElement = variableElements[0];
-    expect(variableElement.hasImplicitType, isTrue);
-    expect(variableElement.isConst, isFalse);
-    expect(variableElement.isFinal, isFalse);
-    expect(variableElement.isSynthetic, isFalse);
-    expect(variableElement.name, variableName);
-  }
-
-  void test_visitVariableDeclaration_noInitializer() {
-    // var v;
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String variableName = "v";
-    VariableDeclaration variableDeclaration =
-        AstFactory.variableDeclaration2(variableName, null);
-    AstFactory.variableDeclarationList2(null, [variableDeclaration]);
-    variableDeclaration.accept(builder);
-
-    List<TopLevelVariableElement> variables = holder.topLevelVariables;
-    expect(variables, hasLength(1));
-    TopLevelVariableElement variable = variables[0];
-    expect(variable, isNotNull);
-    expect(variable.hasImplicitType, isTrue);
-    expect(variable.initializer, isNull);
-    expect(variable.name, variableName);
-    expect(variable.isConst, isFalse);
-    expect(variable.isFinal, isFalse);
-    expect(variable.isSynthetic, isFalse);
-    expect(variable.getter, isNotNull);
-    expect(variable.setter, isNotNull);
-  }
-
-  void test_visitVariableDeclaration_top() {
-    // final a, b;
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    VariableDeclaration variableDeclaration1 =
-        AstFactory.variableDeclaration('a');
-    VariableDeclaration variableDeclaration2 =
-        AstFactory.variableDeclaration('b');
-    TopLevelVariableDeclaration topLevelVariableDeclaration = AstFactory
-        .topLevelVariableDeclaration(
-            Keyword.FINAL, null, [variableDeclaration1, variableDeclaration2]);
-    topLevelVariableDeclaration.documentationComment = AstFactory
-        .documentationComment(
-            [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
-
-    topLevelVariableDeclaration.accept(builder);
-    List<TopLevelVariableElement> variables = holder.topLevelVariables;
-    expect(variables, hasLength(2));
-
-    TopLevelVariableElement variable1 = variables[0];
-    expect(variable1, isNotNull);
-    expect(variable1.documentationComment, '/// aaa');
-
-    TopLevelVariableElement variable2 = variables[1];
-    expect(variable2, isNotNull);
-    expect(variable2.documentationComment, '/// aaa');
-  }
-
-  void test_visitVariableDeclaration_top_const_hasInitializer() {
-    // const v = 42;
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String variableName = "v";
-    VariableDeclaration variableDeclaration =
-        AstFactory.variableDeclaration2(variableName, AstFactory.integer(42));
-    AstFactory.variableDeclarationList2(Keyword.CONST, [variableDeclaration]);
-    variableDeclaration.accept(builder);
-
-    List<TopLevelVariableElement> variables = holder.topLevelVariables;
-    expect(variables, hasLength(1));
-    TopLevelVariableElement variable = variables[0];
-    expect(variable, new isInstanceOf<ConstTopLevelVariableElementImpl>());
-    expect(variable.initializer, isNotNull);
-    expect(variable.initializer.type, isNotNull);
-    expect(variable.initializer.hasImplicitReturnType, isTrue);
-    expect(variable.name, variableName);
-    expect(variable.hasImplicitType, isTrue);
-    expect(variable.isConst, isTrue);
-    expect(variable.isFinal, isFalse);
-    expect(variable.isSynthetic, isFalse);
-    expect(variable.getter, isNotNull);
-    expect(variable.setter, isNull);
-  }
-
-  void test_visitVariableDeclaration_top_final() {
-    // final v;
-    ElementHolder holder = new ElementHolder();
-    ElementBuilder builder = _makeBuilder(holder);
-    String variableName = "v";
-    VariableDeclaration variableDeclaration =
-        AstFactory.variableDeclaration2(variableName, null);
-    AstFactory.variableDeclarationList2(Keyword.FINAL, [variableDeclaration]);
-    variableDeclaration.accept(builder);
-    List<TopLevelVariableElement> variables = holder.topLevelVariables;
-    expect(variables, hasLength(1));
-    TopLevelVariableElement variable = variables[0];
-    expect(variable, isNotNull);
-    expect(variable.hasImplicitType, isTrue);
-    expect(variable.initializer, isNull);
-    expect(variable.name, variableName);
-    expect(variable.isConst, isFalse);
-    expect(variable.isFinal, isTrue);
-    expect(variable.isSynthetic, isFalse);
-    expect(variable.getter, isNotNull);
-    expect(variable.setter, isNull);
-  }
-
-  void _assertHasCodeRange(Element element, int offset, int length) {
-    ElementImpl elementImpl = element;
-    expect(elementImpl.codeOffset, offset);
-    expect(elementImpl.codeLength, length);
-  }
-
-  void _assertVisibleRange(LocalElement element, int offset, int end) {
-    SourceRange visibleRange = element.visibleRange;
-    expect(visibleRange.offset, offset);
-    expect(visibleRange.end, end);
-  }
-
-  ElementBuilder _makeBuilder(ElementHolder holder) =>
-      new ElementBuilder(holder, new CompilationUnitElementImpl('test.dart'));
-
-  void _setBlockBodySourceRange(BlockFunctionBody body, int offset, int end) {
-    _setNodeSourceRange(body.block, offset, end);
-  }
-
-  void _setNodeSourceRange(AstNode node, int offset, int end) {
-    node.beginToken.offset = offset;
-    Token endToken = node.endToken;
-    endToken.offset = end - endToken.length;
-  }
-
-  void _useParameterInMethod(
-      FormalParameter formalParameter, int blockOffset, int blockEnd) {
-    Block block = AstFactory.block();
-    block.leftBracket.offset = blockOffset;
-    block.rightBracket.offset = blockEnd - 1;
-    BlockFunctionBody body = AstFactory.blockFunctionBody(block);
-    AstFactory.methodDeclaration2(
-        null,
-        null,
-        null,
-        null,
-        AstFactory.identifier3("main"),
-        AstFactory.formalParameterList([formalParameter]),
-        body);
-  }
-}
-
-@reflectiveTest
 class ElementLocatorTest extends ResolverTestCase {
   void fail_locate_Identifier_partOfDirective() {
     // Can't resolve the library element without the library declaration.
@@ -2815,12 +559,12 @@
 
   void test_locate_InstanceCreationExpression_type_prefixedIdentifier() {
     // prepare: new pref.A()
-    SimpleIdentifier identifier = AstFactory.identifier3("A");
+    SimpleIdentifier identifier = AstTestFactory.identifier3("A");
     PrefixedIdentifier prefixedIdentifier =
-        AstFactory.identifier4("pref", identifier);
+        AstTestFactory.identifier4("pref", identifier);
     InstanceCreationExpression creation =
-        AstFactory.instanceCreationExpression2(
-            Keyword.NEW, AstFactory.typeName3(prefixedIdentifier));
+        AstTestFactory.instanceCreationExpression2(
+            Keyword.NEW, AstTestFactory.typeName3(prefixedIdentifier));
     // set ClassElement
     ClassElement classElement = ElementFactory.classElement2("A");
     identifier.staticElement = classElement;
@@ -2835,10 +579,10 @@
 
   void test_locate_InstanceCreationExpression_type_simpleIdentifier() {
     // prepare: new A()
-    SimpleIdentifier identifier = AstFactory.identifier3("A");
+    SimpleIdentifier identifier = AstTestFactory.identifier3("A");
     InstanceCreationExpression creation =
-        AstFactory.instanceCreationExpression2(
-            Keyword.NEW, AstFactory.typeName3(identifier));
+        AstTestFactory.instanceCreationExpression2(
+            Keyword.NEW, AstTestFactory.typeName3(identifier));
     // set ClassElement
     ClassElement classElement = ElementFactory.classElement2("A");
     identifier.staticElement = classElement;
@@ -3053,8 +797,8 @@
     String firstName = "ONE";
     String secondName = "TWO";
     String thirdName = "THREE";
-    EnumDeclaration enumDeclaration =
-        AstFactory.enumDeclaration2("E", [firstName, secondName, thirdName]);
+    EnumDeclaration enumDeclaration = AstTestFactory
+        .enumDeclaration2("E", [firstName, secondName, thirdName]);
 
     ClassElement enumElement = _buildElement(enumDeclaration);
     List<FieldElement> fields = enumElement.fields;
@@ -3085,8 +829,8 @@
   void test_visitEnumDeclaration_single() {
     String firstName = "ONE";
     EnumDeclaration enumDeclaration =
-        AstFactory.enumDeclaration2("E", [firstName]);
-    enumDeclaration.constants[0].documentationComment = AstFactory
+        AstTestFactory.enumDeclaration2("E", [firstName]);
+    enumDeclaration.constants[0].documentationComment = AstTestFactory
         .documentationComment(
             [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
 
@@ -3183,7 +927,7 @@
     ErrorReporter reporter = new ErrorReporter(
         listener,
         new NonExistingSource(
-            '/test.dart', toUri('/test.dart'), UriKind.FILE_URI));
+            '/test.dart', path.toUri('/test.dart'), UriKind.FILE_URI));
     reporter.reportErrorForElement(
         StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER,
         element,
@@ -3223,7 +967,7 @@
         new ErrorReporter(listener, firstType.element.source);
     reporter.reportTypeErrorForNode(
         StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE,
-        AstFactory.identifier3("x"),
+        AstTestFactory.identifier3("x"),
         [firstType, secondType]);
     AnalysisError error = listener.errors[0];
     expect(error.message.indexOf("(") < 0, isTrue);
@@ -3238,7 +982,7 @@
         new ErrorReporter(listener, firstType.element.source);
     reporter.reportTypeErrorForNode(
         StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE,
-        AstFactory.identifier3("x"),
+        AstTestFactory.identifier3("x"),
         [firstType, secondType]);
     AnalysisError error = listener.errors[0];
     expect(error.message.indexOf("(") >= 0, isTrue);
diff --git a/pkg/analyzer/test/generated/analysis_context_factory.dart b/pkg/analyzer/test/generated/analysis_context_factory.dart
index 272e26e..ffbe349 100644
--- a/pkg/analyzer/test/generated/analysis_context_factory.dart
+++ b/pkg/analyzer/test/generated/analysis_context_factory.dart
@@ -21,13 +21,12 @@
 import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/source_io.dart';
-import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
 import 'package:analyzer/src/generated/testing/element_factory.dart';
 import 'package:analyzer/src/generated/testing/test_type_provider.dart';
 import 'package:analyzer/src/generated/utilities_dart.dart';
-import 'package:analyzer/src/source/source_resource.dart';
 import 'package:analyzer/src/string_source.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 /**
  * The class `AnalysisContextFactory` defines utility methods used to create analysis contexts
@@ -157,11 +156,11 @@
             "override", true, false, overrideClassElement.type);
     {
       ClassElement deprecatedElement = provider.deprecatedType.element;
-      InstanceCreationExpression initializer = AstFactory
+      InstanceCreationExpression initializer = AstTestFactory
           .instanceCreationExpression2(
               Keyword.CONST,
-              AstFactory.typeName(deprecatedElement),
-              [AstFactory.string2('next release')]);
+              AstTestFactory.typeName(deprecatedElement),
+              [AstTestFactory.string2('next release')]);
       ConstructorElement constructor = deprecatedElement.constructors.single;
       initializer.staticElement = constructor;
       initializer.constructorName.staticElement = constructor;
@@ -178,13 +177,13 @@
       proxyTopLevelVariableElt
     ];
     LibraryElementImpl coreLibrary = new LibraryElementImpl.forNode(
-        coreContext, AstFactory.libraryIdentifier2(["dart", "core"]));
+        coreContext, AstTestFactory.libraryIdentifier2(["dart", "core"]));
     coreLibrary.definingCompilationUnit = coreUnit;
     //
     // dart:async
     //
     LibraryElementImpl asyncLibrary = new LibraryElementImpl.forNode(
-        coreContext, AstFactory.libraryIdentifier2(["dart", "async"]));
+        coreContext, AstTestFactory.libraryIdentifier2(["dart", "async"]));
     CompilationUnitElementImpl asyncUnit =
         new CompilationUnitElementImpl("async.dart");
     Source asyncSource = sourceFactory.forUri(DartSdk.DART_ASYNC);
@@ -210,7 +209,7 @@
     }
     FunctionElementImpl thenOnValue = ElementFactory.functionElement3('onValue',
         DynamicElementImpl.instance, [futureElement.typeParameters[0]], null);
-    thenOnValue.synthetic = true;
+    thenOnValue.isSynthetic = true;
 
     DartType futureRType = futureElement.type.instantiate([futureThenR.type]);
     MethodElementImpl thenMethod = ElementFactory
@@ -249,7 +248,7 @@
         VoidTypeImpl.instance.element,
         <TypeDefiningElement>[streamElement.typeParameters[0]],
         null);
-    listenOnData.synthetic = true;
+    listenOnData.isSynthetic = true;
     List<DartType> parameterTypes = <DartType>[
       listenOnData.type,
     ];
@@ -329,8 +328,8 @@
             "document", false, true, htmlDocumentElement.type);
     htmlUnit.topLevelVariables = <TopLevelVariableElement>[document];
     htmlUnit.accessors = <PropertyAccessorElement>[document.getter];
-    LibraryElementImpl htmlLibrary = new LibraryElementImpl.forNode(
-        coreContext, AstFactory.libraryIdentifier2(["dart", "dom", "html"]));
+    LibraryElementImpl htmlLibrary = new LibraryElementImpl.forNode(coreContext,
+        AstTestFactory.libraryIdentifier2(["dart", "dom", "html"]));
     htmlLibrary.definingCompilationUnit = htmlUnit;
     //
     // dart:math
@@ -391,7 +390,7 @@
     ];
     mathUnit.types = <ClassElement>[randomElement];
     LibraryElementImpl mathLibrary = new LibraryElementImpl.forNode(
-        coreContext, AstFactory.libraryIdentifier2(["dart", "math"]));
+        coreContext, AstTestFactory.libraryIdentifier2(["dart", "math"]));
     mathLibrary.definingCompilationUnit = mathUnit;
     //
     // Set empty sources for the rest of the libraries.
@@ -489,25 +488,24 @@
  * Helper for creating and managing single [AnalysisContext].
  */
 class AnalysisContextHelper {
-  ResourceProvider resourceProvider;
+  MemoryResourceProvider resourceProvider;
   AnalysisContext context;
 
   /**
    * Creates new [AnalysisContext] using [AnalysisContextFactory].
    */
   AnalysisContextHelper(
-      [AnalysisOptionsImpl options, ResourceProvider provider]) {
+      [AnalysisOptionsImpl options, MemoryResourceProvider provider]) {
     resourceProvider = provider ?? new MemoryResourceProvider();
-    if (options == null) {
-      options = new AnalysisOptionsImpl();
-    }
-    options.cacheSize = 256;
-    context = AnalysisContextFactory.contextWithCoreAndOptions(options,
+    context = AnalysisContextFactory.contextWithCoreAndOptions(
+        options ?? new AnalysisOptionsImpl(),
         resourceProvider: resourceProvider);
   }
 
   Source addSource(String path, String code) {
-    Source source = new FileSource(resourceProvider.getFile(path));
+    Source source = resourceProvider
+        .getFile(resourceProvider.convertPath(path))
+        .createSource();
     if (path.endsWith(".dart") || path.endsWith(".html")) {
       ChangeSet changeSet = new ChangeSet();
       changeSet.addedSource(source);
diff --git a/pkg/analyzer/test/generated/bazel_test.dart b/pkg/analyzer/test/generated/bazel_test.dart
index 227681c..884ffb5 100644
--- a/pkg/analyzer/test/generated/bazel_test.dart
+++ b/pkg/analyzer/test/generated/bazel_test.dart
@@ -4,98 +4,85 @@
 
 library analyzer.test.generated.bazel_test;
 
-import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:analyzer/src/generated/bazel.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
-
-import '../utils.dart';
+import 'package:typed_mock/typed_mock.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(BazelFileUriResolverTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(BazelFileUriResolverTest);
+    defineReflectiveTests(BazelPackageUriResolverTest);
+    defineReflectiveTests(BazelWorkspaceTest);
+  });
 }
 
 @reflectiveTest
-class BazelFileUriResolverTest {
-  MemoryResourceProvider provider;
-  Folder workspace;
-  List<Folder> buildDirs;
-  ResourceUriResolver resolver;
+class BazelFileUriResolverTest extends _BaseTest {
+  BazelWorkspace workspace;
+  BazelFileUriResolver resolver;
 
   void setUp() {
-    provider = new MemoryResourceProvider();
-    workspace = provider.newFolder('/workspace');
-    buildDirs = [
-      provider.newFolder('/workspace/one'),
-      provider.newFolder('/workspace/two')
-    ];
-    resolver = new BazelFileUriResolver(provider, workspace, buildDirs);
-    provider.newFile('/workspace/test.dart', '');
-    provider.newFile('/workspace/one/gen1.dart', '');
-    provider.newFile('/workspace/two/gen2.dart', '');
+    provider.newFile(_p('/workspace/WORKSPACE'), '');
+    provider.newFolder(_p('/workspace/bazel-genfiles'));
+    workspace = BazelWorkspace.find(provider, _p('/workspace'));
+    resolver = new BazelFileUriResolver(workspace);
+    provider.newFile(_p('/workspace/test.dart'), '');
+    provider.newFile(_p('/workspace/bazel-bin/gen1.dart'), '');
+    provider.newFile(_p('/workspace/bazel-genfiles/gen2.dart'), '');
   }
 
-  void test_creation() {
-    expect(provider, isNotNull);
-    expect(workspace, isNotNull);
-    expect(buildDirs, isNotNull);
-    expect(buildDirs.length, 2);
-    expect(resolver, isNotNull);
+  void test_resolveAbsolute_doesNotExist() {
+    Source source = _resolvePath('/workspace/foo.dart');
+    expect(source, isNotNull);
+    expect(source.exists(), isFalse);
+    expect(source.fullName, _p('/workspace/foo.dart'));
   }
 
   void test_resolveAbsolute_file() {
-    var uri = new Uri(scheme: 'file', path: '/workspace/test.dart');
-    Source source = resolver.resolveAbsolute(uri);
+    Source source = _resolvePath('/workspace/test.dart');
     expect(source, isNotNull);
     expect(source.exists(), isTrue);
-    expect(source.fullName, '/workspace/test.dart');
+    expect(source.fullName, _p('/workspace/test.dart'));
   }
 
   void test_resolveAbsolute_folder() {
-    var uri = new Uri(scheme: 'file', path: '/workspace');
-    Source source = resolver.resolveAbsolute(uri);
-    expect(source, isNull);
-  }
-
-  void test_resolveAbsolute_generated_file_does_not_exist_three() {
-    var uri = new Uri(scheme: 'file', path: '/workspace/gen3.dart');
-    Source source = resolver.resolveAbsolute(uri);
-    expect(source, isNull);
+    Source source = _resolvePath('/workspace');
+    expect(source, isNotNull);
+    expect(source.exists(), isFalse);
+    expect(source.fullName, _p('/workspace'));
   }
 
   void test_resolveAbsolute_generated_file_exists_one() {
-    var uri = new Uri(scheme: 'file', path: '/workspace/gen1.dart');
-    Source source = resolver.resolveAbsolute(uri);
+    Source source = _resolvePath('/workspace/gen1.dart');
     expect(source, isNotNull);
     expect(source.exists(), isTrue);
-    expect(source.fullName, '/workspace/one/gen1.dart');
+    expect(source.fullName, _p('/workspace/bazel-bin/gen1.dart'));
   }
 
   void test_resolveAbsolute_generated_file_exists_two() {
-    var uri = new Uri(scheme: 'file', path: '/workspace/gen2.dart');
-    Source source = resolver.resolveAbsolute(uri);
+    Source source = _resolvePath('/workspace/gen2.dart');
     expect(source, isNotNull);
     expect(source.exists(), isTrue);
-    expect(source.fullName, '/workspace/two/gen2.dart');
+    expect(source.fullName, _p('/workspace/bazel-genfiles/gen2.dart'));
   }
 
   void test_resolveAbsolute_notFile_dartUri() {
-    var uri = new Uri(scheme: 'dart', path: 'core');
+    Uri uri = new Uri(scheme: 'dart', path: 'core');
     Source source = resolver.resolveAbsolute(uri);
     expect(source, isNull);
   }
 
   void test_resolveAbsolute_notFile_httpsUri() {
-    var uri = new Uri(scheme: 'https', path: '127.0.0.1/test.dart');
+    Uri uri = new Uri(scheme: 'https', path: '127.0.0.1/test.dart');
     Source source = resolver.resolveAbsolute(uri);
     expect(source, isNull);
   }
 
   void test_restoreAbsolute() {
-    var uri = new Uri(scheme: 'file', path: '/workspace/test.dart');
+    Uri uri = provider.pathContext.toUri(_p('/workspace/test.dart'));
     Source source = resolver.resolveAbsolute(uri);
     expect(source, isNotNull);
     expect(resolver.restoreAbsolute(source), uri);
@@ -104,4 +91,575 @@
             new NonExistingSource(source.fullName, null, null)),
         uri);
   }
+
+  Source _resolvePath(String absolutePosixPath) {
+    String absolutePath = provider.convertPath(absolutePosixPath);
+    Uri uri = provider.pathContext.toUri(absolutePath);
+    return resolver.resolveAbsolute(uri);
+  }
+}
+
+@reflectiveTest
+class BazelPackageUriResolverTest extends _BaseTest {
+  BazelWorkspace workspace;
+  BazelPackageUriResolver resolver;
+
+  void test_resolveAbsolute_bin() {
+    _addResources([
+      '/workspace/WORKSPACE',
+      '/workspace/bazel-genfiles/',
+      '/workspace/my/foo/lib/foo1.dart',
+      '/workspace/bazel-bin/my/foo/lib/foo1.dart'
+    ]);
+    _assertResolve(
+        'package:my.foo/foo1.dart', '/workspace/bazel-bin/my/foo/lib/foo1.dart',
+        exists: true);
+  }
+
+  void test_resolveAbsolute_bin_notInWorkspace() {
+    _addResources([
+      '/workspace/WORKSPACE',
+      '/workspace/bazel-genfiles/',
+      '/workspace/bazel-bin/my/foo/lib/foo1.dart'
+    ]);
+    _assertResolve(
+        'package:my.foo/foo1.dart', '/workspace/bazel-bin/my/foo/lib/foo1.dart',
+        exists: true);
+  }
+
+  void test_resolveAbsolute_genfiles() {
+    _addResources([
+      '/workspace/WORKSPACE',
+      '/workspace/bazel-genfiles/',
+      '/workspace/my/foo/lib/foo1.dart',
+      '/workspace/bazel-genfiles/my/foo/lib/foo1.dart'
+    ]);
+    _assertResolve('package:my.foo/foo1.dart',
+        '/workspace/bazel-genfiles/my/foo/lib/foo1.dart',
+        exists: true);
+  }
+
+  void test_resolveAbsolute_genfiles_notInWorkspace() {
+    _addResources([
+      '/workspace/WORKSPACE',
+      '/workspace/bazel-genfiles/',
+      '/workspace/bazel-genfiles/my/foo/lib/foo1.dart'
+    ]);
+    _assertResolve('package:my.foo/foo1.dart',
+        '/workspace/bazel-genfiles/my/foo/lib/foo1.dart',
+        exists: true);
+  }
+
+  void test_resolveAbsolute_null_noSlash() {
+    _addResources([
+      '/workspace/WORKSPACE',
+      '/workspace/bazel-genfiles/',
+    ]);
+    Source source = resolver.resolveAbsolute(Uri.parse('package:foo'));
+    expect(source, isNull);
+  }
+
+  void test_resolveAbsolute_null_notPackage() {
+    _addResources([
+      '/workspace/WORKSPACE',
+      '/workspace/bazel-genfiles/',
+    ]);
+    Source source = resolver.resolveAbsolute(Uri.parse('dart:async'));
+    expect(source, isNull);
+  }
+
+  void test_resolveAbsolute_null_startsWithSlash() {
+    _addResources([
+      '/workspace/WORKSPACE',
+      '/workspace/bazel-genfiles/',
+      '/workspace/my/foo/lib/bar.dart',
+    ]);
+    Source source =
+        resolver.resolveAbsolute(Uri.parse('package:/foo/bar.dart'));
+    expect(source, isNull);
+  }
+
+  void test_resolveAbsolute_readonly_bin() {
+    _addResources([
+      '/Users/user/test/READONLY/prime/',
+      '/Users/user/test/READONLY/prime/my/foo/lib/foo1.dart',
+      '/Users/user/test/prime/bazel-genfiles/',
+      '/Users/user/test/prime/my/module/',
+      '/Users/user/test/prime/bazel-bin/my/foo/lib/foo1.dart',
+    ], workspacePath: '/Users/user/test/prime/my/module');
+    _assertResolve('package:my.foo/foo1.dart',
+        '/Users/user/test/prime/bazel-bin/my/foo/lib/foo1.dart',
+        exists: true);
+  }
+
+  void test_resolveAbsolute_readonly_bin_notInWorkspace() {
+    _addResources([
+      '/Users/user/test/READONLY/prime/',
+      '/Users/user/test/prime/bazel-genfiles/',
+      '/Users/user/test/prime/my/module/',
+      '/Users/user/test/prime/bazel-bin/my/foo/lib/foo1.dart',
+    ], workspacePath: '/Users/user/test/prime/my/module');
+    _assertResolve('package:my.foo/foo1.dart',
+        '/Users/user/test/prime/bazel-bin/my/foo/lib/foo1.dart',
+        exists: true);
+  }
+
+  void test_resolveAbsolute_readonly_genfiles() {
+    _addResources([
+      '/Users/user/test/READONLY/prime/',
+      '/Users/user/test/READONLY/prime/my/foo/lib/foo1.dart',
+      '/Users/user/test/prime/bazel-genfiles/',
+      '/Users/user/test/prime/my/module/',
+      '/Users/user/test/prime/bazel-genfiles/my/foo/lib/foo1.dart',
+    ], workspacePath: '/Users/user/test/prime/my/module');
+    _assertResolve('package:my.foo/foo1.dart',
+        '/Users/user/test/prime/bazel-genfiles/my/foo/lib/foo1.dart',
+        exists: true);
+  }
+
+  void test_resolveAbsolute_readonly_genfiles_notInWorkspace() {
+    _addResources([
+      '/Users/user/test/READONLY/prime/',
+      '/Users/user/test/prime/bazel-genfiles/',
+      '/Users/user/test/prime/my/module/',
+      '/Users/user/test/prime/bazel-genfiles/my/foo/lib/foo1.dart',
+    ], workspacePath: '/Users/user/test/prime/my/module');
+    _assertResolve('package:my.foo/foo1.dart',
+        '/Users/user/test/prime/bazel-genfiles/my/foo/lib/foo1.dart',
+        exists: true);
+  }
+
+  void test_resolveAbsolute_readonly_thirdParty_bin() {
+    _addResources([
+      '/Users/user/test/READONLY/prime/',
+      '/Users/user/test/READONLY/prime/third_party/dart/foo/lib/foo1.dart',
+      '/Users/user/test/prime/bazel-genfiles/',
+      '/Users/user/test/prime/my/module/',
+      '/Users/user/test/prime/bazel-bin/third_party/dart/foo/lib/foo1.dart',
+    ], workspacePath: '/Users/user/test/prime/my/module');
+    _assertResolve('package:foo/foo1.dart',
+        '/Users/user/test/prime/bazel-bin/third_party/dart/foo/lib/foo1.dart',
+        exists: true);
+  }
+
+  void test_resolveAbsolute_readonly_thirdParty_genfiles() {
+    _addResources([
+      '/Users/user/test/READONLY/prime/',
+      '/Users/user/test/READONLY/prime/third_party/dart/foo/lib/foo1.dart',
+      '/Users/user/test/prime/bazel-genfiles/',
+      '/Users/user/test/prime/my/module/',
+      '/Users/user/test/prime/bazel-genfiles/third_party/dart/foo/lib/foo1.dart',
+    ], workspacePath: '/Users/user/test/prime/my/module');
+    _assertResolve('package:foo/foo1.dart',
+        '/Users/user/test/prime/bazel-genfiles/third_party/dart/foo/lib/foo1.dart',
+        exists: true);
+  }
+
+  void test_resolveAbsolute_readonly_thirdParty_workspace_doesNotExist() {
+    _addResources([
+      '/Users/user/test/READONLY/prime/',
+      '/Users/user/test/READONLY/prime/third_party/dart/foo/lib/foo1.dart',
+      '/Users/user/test/prime/bazel-genfiles/',
+      '/Users/user/test/prime/my/module/',
+    ], workspacePath: '/Users/user/test/prime/my/module');
+    _assertResolve('package:foo/foo2.dart',
+        '/Users/user/test/prime/third_party/dart/foo/lib/foo2.dart',
+        exists: false);
+  }
+
+  void test_resolveAbsolute_readonly_thirdParty_workspace_exists() {
+    _addResources([
+      '/Users/user/test/READONLY/prime/',
+      '/Users/user/test/READONLY/prime/third_party/dart/foo/lib/foo1.dart',
+      '/Users/user/test/prime/bazel-genfiles/',
+      '/Users/user/test/prime/my/module/',
+    ], workspacePath: '/Users/user/test/prime/my/module');
+    _assertResolve('package:foo/foo1.dart',
+        '/Users/user/test/READONLY/prime/third_party/dart/foo/lib/foo1.dart',
+        exists: true);
+  }
+
+  void test_resolveAbsolute_readonly_workspace_doesNotExist() {
+    _addResources([
+      '/Users/user/test/READONLY/prime/',
+      '/Users/user/test/prime/bazel-genfiles/',
+      '/Users/user/test/prime/my/module/',
+    ], workspacePath: '/Users/user/test/prime/my/module');
+    _assertResolve('package:my.foo/foo1.dart',
+        '/Users/user/test/prime/my/foo/lib/foo1.dart',
+        exists: false);
+  }
+
+  void test_resolveAbsolute_readonly_workspace_exists() {
+    _addResources([
+      '/Users/user/test/READONLY/prime/',
+      '/Users/user/test/READONLY/prime/my/foo/lib/foo1.dart',
+      '/Users/user/test/prime/bazel-genfiles/',
+      '/Users/user/test/prime/my/module/',
+    ], workspacePath: '/Users/user/test/prime/my/module');
+    _assertResolve('package:my.foo/foo1.dart',
+        '/Users/user/test/READONLY/prime/my/foo/lib/foo1.dart',
+        exists: true);
+  }
+
+  void test_resolveAbsolute_thirdParty_bin() {
+    _addResources([
+      '/workspace/WORKSPACE',
+      '/workspace/bazel-genfiles/',
+      '/workspace/third_party/dart/foo/lib/foo1.dart',
+      '/workspace/bazel-bin/third_party/dart/foo/lib/foo1.dart',
+    ]);
+    _assertResolve('package:foo/foo1.dart',
+        '/workspace/bazel-bin/third_party/dart/foo/lib/foo1.dart',
+        exists: true);
+  }
+
+  void test_resolveAbsolute_thirdParty_bin_notInWorkspace() {
+    _addResources([
+      '/workspace/WORKSPACE',
+      '/workspace/bazel-genfiles/',
+      '/workspace/bazel-bin/third_party/dart/foo/lib/foo1.dart',
+    ]);
+    _assertResolve('package:foo/foo1.dart',
+        '/workspace/bazel-bin/third_party/dart/foo/lib/foo1.dart',
+        exists: true);
+  }
+
+  void test_resolveAbsolute_thirdParty_doesNotExist() {
+    _addResources([
+      '/workspace/WORKSPACE',
+      '/workspace/bazel-genfiles/',
+      '/workspace/third_party/dart/foo/lib/foo1.dart',
+    ]);
+    _assertResolve('package:foo/foo2.dart',
+        '/workspace/third_party/dart/foo/lib/foo2.dart',
+        exists: false);
+  }
+
+  void test_resolveAbsolute_thirdParty_exists() {
+    _addResources([
+      '/workspace/WORKSPACE',
+      '/workspace/bazel-genfiles/',
+      '/workspace/third_party/dart/foo/lib/foo1.dart',
+    ]);
+    _assertResolve('package:foo/foo1.dart',
+        '/workspace/third_party/dart/foo/lib/foo1.dart',
+        exists: true);
+  }
+
+  void test_resolveAbsolute_thirdParty_genfiles() {
+    _addResources([
+      '/workspace/WORKSPACE',
+      '/workspace/bazel-genfiles/',
+      '/workspace/third_party/dart/foo/lib/foo1.dart',
+      '/workspace/bazel-genfiles/third_party/dart/foo/lib/foo1.dart',
+    ]);
+    _assertResolve('package:foo/foo1.dart',
+        '/workspace/bazel-genfiles/third_party/dart/foo/lib/foo1.dart',
+        exists: true);
+  }
+
+  void test_resolveAbsolute_thirdParty_genfiles_notInWorkspace() {
+    _addResources([
+      '/workspace/WORKSPACE',
+      '/workspace/bazel-genfiles/',
+      '/workspace/bazel-genfiles/third_party/dart/foo/lib/foo1.dart',
+    ]);
+    _assertResolve('package:foo/foo1.dart',
+        '/workspace/bazel-genfiles/third_party/dart/foo/lib/foo1.dart',
+        exists: true);
+  }
+
+  void test_resolveAbsolute_workspace_doesNotExist() {
+    _addResources([
+      '/workspace/WORKSPACE',
+      '/workspace/bazel-genfiles/',
+    ]);
+    _assertResolve('package:my.foo/doesNotExist.dart',
+        '/workspace/my/foo/lib/doesNotExist.dart',
+        exists: false);
+  }
+
+  void test_resolveAbsolute_workspace_exists() {
+    _addResources([
+      '/workspace/WORKSPACE',
+      '/workspace/bazel-genfiles/',
+      '/workspace/my/foo/lib/foo1.dart',
+    ]);
+    _assertResolve(
+        'package:my.foo/foo1.dart', '/workspace/my/foo/lib/foo1.dart',
+        exists: true);
+  }
+
+  void test_restoreAbsolute_noPackageName_workspace() {
+    _addResources([
+      '/workspace/WORKSPACE',
+      '/workspace/bazel-genfiles/',
+      '/workspace/lib/foo1.dart',
+      '/workspace/foo/lib/foo2.dart',
+    ]);
+    _assertRestore('/workspace/lib/foo1.dart', null);
+    _assertRestore('/workspace/foo/lib/foo2.dart', null);
+  }
+
+  void test_restoreAbsolute_noPathInLib_bin() {
+    _addResources([
+      '/workspace/WORKSPACE',
+      '/workspace/bazel-genfiles/',
+      '/workspace/bazel-bin/my/foo/lib/foo1.dart',
+    ]);
+    _assertRestore('/workspace/bazel-bin', null);
+    _assertRestore('/workspace/bazel-bin/my', null);
+    _assertRestore('/workspace/bazel-bin/my/foo', null);
+    _assertRestore('/workspace/bazel-bin/my/foo/lib', null);
+  }
+
+  void test_restoreAbsolute_noPathInLib_genfiles() {
+    _addResources([
+      '/workspace/WORKSPACE',
+      '/workspace/bazel-genfiles/',
+      '/workspace/bazel-genfiles/my/foo/lib/foo1.dart',
+    ]);
+    _assertRestore('/workspace/bazel-genfiles', null);
+    _assertRestore('/workspace/bazel-genfiles/my', null);
+    _assertRestore('/workspace/bazel-genfiles/my/foo', null);
+    _assertRestore('/workspace/bazel-genfiles/my/foo/lib', null);
+  }
+
+  void test_restoreAbsolute_noPathInLib_workspace() {
+    _addResources([
+      '/workspace/WORKSPACE',
+      '/workspace/bazel-genfiles/',
+      '/workspace/my/foo/lib/foo1.dart',
+    ]);
+    _assertRestore('/workspace', null);
+    _assertRestore('/workspace/my', null);
+    _assertRestore('/workspace/my/foo', null);
+    _assertRestore('/workspace/my/foo/lib', null);
+  }
+
+  void _addResources(List<String> paths, {String workspacePath: '/workspace'}) {
+    for (String path in paths) {
+      if (path.endsWith('/')) {
+        provider.newFolder(_p(path.substring(0, path.length - 1)));
+      } else {
+        provider.newFile(_p(path), '');
+      }
+    }
+    workspace = BazelWorkspace.find(provider, _p(workspacePath));
+    resolver = new BazelPackageUriResolver(workspace);
+  }
+
+  void _assertResolve(String uriStr, String posixPath,
+      {bool exists: true, bool restore: true}) {
+    Uri uri = Uri.parse(uriStr);
+    Source source = resolver.resolveAbsolute(uri);
+    expect(source, isNotNull);
+    expect(source.fullName, _p(posixPath));
+    expect(source.uri, uri);
+    expect(source.exists(), exists);
+    // If enabled, test also "restoreAbsolute".
+    if (restore) {
+      Uri uri = resolver.restoreAbsolute(source);
+      expect(uri.toString(), uriStr);
+    }
+  }
+
+  void _assertRestore(String posixPath, String expectedUri) {
+    String path = _p(posixPath);
+    _MockSource source = new _MockSource(path);
+    Uri uri = resolver.restoreAbsolute(source);
+    expect(uri?.toString(), expectedUri);
+  }
+}
+
+@reflectiveTest
+class BazelWorkspaceTest extends _BaseTest {
+  void test_find_fail_notAbsolute() {
+    expect(() => BazelWorkspace.find(provider, _p('not_absolute')),
+        throwsArgumentError);
+  }
+
+  void test_find_hasReadonlyFolder() {
+    provider.newFolder(_p('/Users/user/test/READONLY/prime'));
+    provider.newFolder(_p('/Users/user/test/prime'));
+    provider.newFolder(_p('/Users/user/test/prime/bazel-genfiles'));
+    BazelWorkspace workspace =
+        BazelWorkspace.find(provider, _p('/Users/user/test/prime/my/module'));
+    expect(workspace.root, _p('/Users/user/test/prime'));
+    expect(workspace.readonly, _p('/Users/user/test/READONLY/prime'));
+    expect(workspace.bin, _p('/Users/user/test/prime/bazel-bin'));
+    expect(workspace.genfiles, _p('/Users/user/test/prime/bazel-genfiles'));
+  }
+
+  void test_find_hasReadonlyFolder_bad_actuallyHasWorkspaceFile() {
+    provider.newFolder(_p('/Users/user/test/READONLY'));
+    provider.newFile(_p('/Users/user/test/prime/WORKSPACE'), '');
+    provider.newFolder(_p('/Users/user/test/prime/bazel-genfiles'));
+    BazelWorkspace workspace =
+        BazelWorkspace.find(provider, _p('/Users/user/test/prime/my/module'));
+    expect(workspace.root, _p('/Users/user/test/prime'));
+    expect(workspace.readonly, isNull);
+    expect(workspace.bin, _p('/Users/user/test/prime/bazel-bin'));
+    expect(workspace.genfiles, _p('/Users/user/test/prime/bazel-genfiles'));
+  }
+
+  void test_find_hasReadonlyFolder_blaze() {
+    provider.newFolder(_p('/Users/user/test/READONLY/prime'));
+    provider.newFolder(_p('/Users/user/test/prime'));
+    provider.newFolder(_p('/Users/user/test/prime/blaze-genfiles'));
+    BazelWorkspace workspace =
+        BazelWorkspace.find(provider, _p('/Users/user/test/prime/my/module'));
+    expect(workspace.root, _p('/Users/user/test/prime'));
+    expect(workspace.readonly, _p('/Users/user/test/READONLY/prime'));
+    expect(workspace.bin, _p('/Users/user/test/prime/blaze-bin'));
+    expect(workspace.genfiles, _p('/Users/user/test/prime/blaze-genfiles'));
+  }
+
+  void test_find_hasWorkspaceFile() {
+    provider.newFile(_p('/workspace/WORKSPACE'), '');
+    provider.newFolder(_p('/workspace/bazel-genfiles'));
+    BazelWorkspace workspace =
+        BazelWorkspace.find(provider, _p('/workspace/my/module'));
+    expect(workspace.root, _p('/workspace'));
+    expect(workspace.readonly, isNull);
+    expect(workspace.bin, _p('/workspace/bazel-bin'));
+    expect(workspace.genfiles, _p('/workspace/bazel-genfiles'));
+  }
+
+  void test_find_hasWorkspaceFile_forModuleInWorkspace() {
+    provider.newFile(_p('/workspace/WORKSPACE'), '');
+    provider.newFolder(_p('/workspace/bazel-genfiles'));
+    BazelWorkspace workspace =
+        BazelWorkspace.find(provider, _p('/workspace/my/module'));
+    expect(workspace.root, _p('/workspace'));
+    expect(workspace.readonly, isNull);
+    expect(workspace.bin, _p('/workspace/bazel-bin'));
+    expect(workspace.genfiles, _p('/workspace/bazel-genfiles'));
+  }
+
+  void test_find_hasWorkspaceFile_forWorkspace() {
+    provider.newFile(_p('/workspace/WORKSPACE'), '');
+    provider.newFolder(_p('/workspace/bazel-genfiles'));
+    BazelWorkspace workspace = BazelWorkspace.find(provider, _p('/workspace'));
+    expect(workspace.root, _p('/workspace'));
+    expect(workspace.readonly, isNull);
+    expect(workspace.bin, _p('/workspace/bazel-bin'));
+    expect(workspace.genfiles, _p('/workspace/bazel-genfiles'));
+  }
+
+  void test_find_hasWorkspaceFile_forWorkspace_blaze() {
+    provider.newFile(_p('/workspace/WORKSPACE'), '');
+    provider.newFolder(_p('/workspace/blaze-genfiles'));
+    BazelWorkspace workspace = BazelWorkspace.find(provider, _p('/workspace'));
+    expect(workspace.root, _p('/workspace'));
+    expect(workspace.readonly, isNull);
+    expect(workspace.bin, _p('/workspace/blaze-bin'));
+    expect(workspace.genfiles, _p('/workspace/blaze-genfiles'));
+  }
+
+  void test_find_null_noWorkspaceMarkers() {
+    BazelWorkspace workspace =
+        BazelWorkspace.find(provider, _p('/workspace/my/module'));
+    expect(workspace, isNull);
+  }
+
+  void test_find_null_noWorkspaceMarkers_inRoot() {
+    BazelWorkspace workspace = BazelWorkspace.find(provider, _p('/'));
+    expect(workspace, isNull);
+  }
+
+  void test_find_null_symlinkPrefix() {
+    String prefix = BazelWorkspace.defaultSymlinkPrefix;
+    provider.newFile(_p('/workspace/WORKSPACE'), '');
+    BazelWorkspace workspace =
+        BazelWorkspace.find(provider, _p('/workspace/my/module'));
+    expect(workspace.root, _p('/workspace'));
+    expect(workspace.readonly, isNull);
+    expect(workspace.bin, _p('/workspace/$prefix-bin'));
+    expect(workspace.genfiles, _p('/workspace/$prefix-genfiles'));
+  }
+
+  void test_findFile_hasReadonlyFolder() {
+    provider.newFolder(_p('/Users/user/test/READONLY/prime'));
+    provider.newFolder(_p('/Users/user/test/prime'));
+    provider.newFile(_p('/Users/user/test/prime/my/module/test1.dart'), '');
+    provider.newFile(_p('/Users/user/test/prime/my/module/test2.dart'), '');
+    provider.newFile(_p('/Users/user/test/prime/my/module/test3.dart'), '');
+    provider.newFile(
+        _p('/Users/user/test/prime/bazel-bin/my/module/test2.dart'), '');
+    provider.newFile(
+        _p('/Users/user/test/prime/bazel-genfiles/my/module/test3.dart'), '');
+    provider.newFile(
+        _p('/Users/user/test/READONLY/prime/other/module/test4.dart'), '');
+    BazelWorkspace workspace =
+        BazelWorkspace.find(provider, _p('/Users/user/test/prime/my/module'));
+    expect(
+        workspace
+            .findFile(_p('/Users/user/test/prime/my/module/test1.dart'))
+            .path,
+        _p('/Users/user/test/prime/my/module/test1.dart'));
+    expect(
+        workspace
+            .findFile(_p('/Users/user/test/prime/my/module/test2.dart'))
+            .path,
+        _p('/Users/user/test/prime/bazel-bin/my/module/test2.dart'));
+    expect(
+        workspace
+            .findFile(_p('/Users/user/test/prime/my/module/test3.dart'))
+            .path,
+        _p('/Users/user/test/prime/bazel-genfiles/my/module/test3.dart'));
+    expect(
+        workspace
+            .findFile(_p('/Users/user/test/prime/other/module/test4.dart'))
+            .path,
+        _p('/Users/user/test/READONLY/prime/other/module/test4.dart'));
+  }
+
+  void test_findFile_main_overrides_readonly() {
+    provider.newFolder(_p('/Users/user/test/READONLY/prime'));
+    provider.newFolder(_p('/Users/user/test/prime'));
+    provider.newFolder(_p('/Users/user/test/prime/bazel-genfiles'));
+    provider.newFile(_p('/Users/user/test/prime/my/module/test.dart'), '');
+    provider.newFile(
+        _p('/Users/user/test/READONLY/prime/my/module/test.dart'), '');
+    BazelWorkspace workspace =
+        BazelWorkspace.find(provider, _p('/Users/user/test/prime/my/module'));
+    expect(
+        workspace
+            .findFile(_p('/Users/user/test/prime/my/module/test.dart'))
+            .path,
+        _p('/Users/user/test/prime/my/module/test.dart'));
+  }
+
+  void test_findFile_noReadOnly() {
+    provider.newFile(_p('/workspace/WORKSPACE'), '');
+    provider.newFile(_p('/workspace/my/module/test1.dart'), '');
+    provider.newFile(_p('/workspace/my/module/test2.dart'), '');
+    provider.newFile(_p('/workspace/my/module/test3.dart'), '');
+    provider.newFile(_p('/workspace/bazel-bin/my/module/test2.dart'), '');
+    provider.newFile(_p('/workspace/bazel-genfiles/my/module/test3.dart'), '');
+    BazelWorkspace workspace =
+        BazelWorkspace.find(provider, _p('/workspace/my/module'));
+    expect(workspace.findFile(_p('/workspace/my/module/test1.dart')).path,
+        _p('/workspace/my/module/test1.dart'));
+    expect(workspace.findFile(_p('/workspace/my/module/test2.dart')).path,
+        _p('/workspace/bazel-bin/my/module/test2.dart'));
+    expect(workspace.findFile(_p('/workspace/my/module/test3.dart')).path,
+        _p('/workspace/bazel-genfiles/my/module/test3.dart'));
+  }
+}
+
+class _BaseTest {
+  final MemoryResourceProvider provider = new MemoryResourceProvider();
+
+  /**
+   * Return the [provider] specific path for the given Posix [path].
+   */
+  String _p(String path) => provider.convertPath(path);
+}
+
+class _MockSource extends TypedMock implements Source {
+  final String fullName;
+  _MockSource(this.fullName);
 }
diff --git a/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_test.dart b/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_test.dart
index b252888..7fa42f2 100644
--- a/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_test.dart
+++ b/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_test.dart
@@ -8,12 +8,12 @@
 import 'package:analyzer/src/generated/source_io.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../utils.dart';
 import 'resolver_test_case.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(CheckedModeCompileTimeErrorCodeTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(CheckedModeCompileTimeErrorCodeTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/generated/compile_time_error_code_test.dart b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
index cae5fd7..4b4bf3d 100644
--- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart
+++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
@@ -9,15 +9,15 @@
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode;
 import 'package:analyzer/src/generated/source_io.dart';
+import 'package:test/test.dart' show expect;
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart' show expect;
 
-import '../utils.dart';
 import 'resolver_test_case.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(CompileTimeErrorCodeTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(CompileTimeErrorCodeTest);
+  });
 }
 
 @reflectiveTest
@@ -48,15 +48,6 @@
     verify([source]);
   }
 
-  void fail_compileTimeConstantRaisesException() {
-    Source source = addSource(r'''
-''');
-    computeLibrarySourceErrors(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.COMPILE_TIME_CONSTANT_RAISES_EXCEPTION]);
-    verify([source]);
-  }
-
   void fail_constEvalThrowsException() {
     Source source = addSource(r'''
 class C {
@@ -1959,6 +1950,30 @@
     verify([source]);
   }
 
+  void test_duplicatePart_sameSource() {
+    addNamedSource('/part.dart', 'part of lib;');
+    Source source = addSource(r'''
+library lib;
+part 'part.dart';
+part 'foo/../part.dart';
+''');
+    computeLibrarySourceErrors(source);
+    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_PART]);
+    verify([source]);
+  }
+
+  void test_duplicatePart_sameUri() {
+    addNamedSource('/part.dart', 'part of lib;');
+    Source source = addSource(r'''
+library lib;
+part 'part.dart';
+part 'part.dart';
+''');
+    computeLibrarySourceErrors(source);
+    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_PART]);
+    verify([source]);
+  }
+
   void test_exportInternalLibrary() {
     Source source = addSource("export 'dart:_interceptors';");
     computeLibrarySourceErrors(source);
@@ -4581,6 +4596,32 @@
     ]);
   }
 
+  void test_nonConstValueInInitializer_assert_condition() {
+    resetWithOptions(new AnalysisOptionsImpl()..enableAssertInitializer = true);
+    Source source = addSource(r'''
+class A {
+  const A(int i) : assert(i.isNegative);
+}''');
+    computeLibrarySourceErrors(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER]);
+    verify([source]);
+  }
+
+  void test_nonConstValueInInitializer_assert_message() {
+    resetWithOptions(new AnalysisOptionsImpl()
+      ..enableAssertInitializer = true
+      ..enableAssertMessage = true);
+    Source source = addSource(r'''
+class A {
+  const A(int i) : assert(i < 0, 'isNegative = ${i.isNegative}');
+}''');
+    computeLibrarySourceErrors(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER]);
+    verify([source]);
+  }
+
   void test_nonConstValueInInitializer_binary_notBool_left() {
     Source source = addSource(r'''
 class A {
@@ -6144,8 +6185,9 @@
     assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]);
 
     // Check that the file is represented as missing.
-    Source target =
-        analysisContext2.getSourcesWithFullName("/target.dart").first;
+    Source target = analysisContext2
+        .getSourcesWithFullName(resourceProvider.convertPath("/target.dart"))
+        .first;
     expect(analysisContext2.getModificationStamp(target), -1);
 
     // Add an overlay in the same way as AnalysisServer.
diff --git a/pkg/analyzer/test/generated/constant_test.dart b/pkg/analyzer/test/generated/constant_test.dart
index a136753..c267a84 100644
--- a/pkg/analyzer/test/generated/constant_test.dart
+++ b/pkg/analyzer/test/generated/constant_test.dart
@@ -11,16 +11,16 @@
 import 'package:analyzer/src/generated/constant.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/source_io.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../utils.dart';
 import 'resolver_test_case.dart';
 import 'test_support.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ConstantEvaluatorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ConstantEvaluatorTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/generated/declaration_resolver_test.dart b/pkg/analyzer/test/generated/declaration_resolver_test.dart
index fd1dd8a..eeaf82d 100644
--- a/pkg/analyzer/test/generated/declaration_resolver_test.dart
+++ b/pkg/analyzer/test/generated/declaration_resolver_test.dart
@@ -8,23 +8,24 @@
 import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer/src/dart/ast/ast.dart';
 import 'package:analyzer/src/dart/ast/utilities.dart';
+import 'package:analyzer/src/dart/element/element.dart';
+import 'package:analyzer/src/generated/declaration_resolver.dart';
 import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/task/dart.dart';
 import 'package:analyzer/task/dart.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../utils.dart';
 import 'resolver_test_case.dart';
 import 'test_support.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(DeclarationResolverMetadataTest);
-  defineReflectiveTests(DeclarationResolverTest);
-  defineReflectiveTests(StrongModeDeclarationResolverTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(DeclarationResolverMetadataTest);
+    defineReflectiveTests(DeclarationResolverTest);
+    defineReflectiveTests(StrongModeDeclarationResolverTest);
+  });
 }
 
 CompilationUnit _cloneResolveUnit(CompilationUnit unit) {
@@ -45,13 +46,16 @@
   CompilationUnit unit;
   CompilationUnit unit2;
 
-  void checkMetadata(String search) {
+  void checkMetadata(String search, {bool expectDifferent: false}) {
     NodeList<Annotation> metadata = _findMetadata(unit, search);
     NodeList<Annotation> metadata2 = _findMetadata(unit2, search);
     expect(metadata, isNotEmpty);
     for (int i = 0; i < metadata.length; i++) {
-      expect(
-          metadata2[i].elementAnnotation, same(metadata[i].elementAnnotation));
+      Matcher expectation = same(metadata[i].elementAnnotation);
+      if (expectDifferent) {
+        expectation = isNot(expectation);
+      }
+      expect(metadata2[i].elementAnnotation, expectation);
     }
   }
 
@@ -83,7 +87,7 @@
 
   void test_metadata_declaredIdentifier() {
     setupCode('f(x, y) { for (@a var x in y) {} }');
-    checkMetadata('var');
+    checkMetadata('var', expectDifferent: true);
   }
 
   void test_metadata_enumDeclaration() {
@@ -97,6 +101,33 @@
     checkMetadata('export');
   }
 
+  void test_metadata_exportDirective_resynthesized() {
+    CompilationUnit unit = resolveSource(r'''
+@a
+export "dart:async";
+
+@b
+export "dart:math";
+
+const a = null;
+const b = null;
+''');
+    expect(unit.directives[0].metadata.single.name.name, 'a');
+    expect(unit.directives[1].metadata.single.name.name, 'b');
+    var unitElement = unit.element as CompilationUnitElementImpl;
+    // Damage the unit element - as if "setAnnotations" were not called.
+    // The ExportElement(s) still have the metadata, we should use it.
+    unitElement.setAnnotations(unit.directives[0].offset, []);
+    unitElement.setAnnotations(unit.directives[1].offset, []);
+    expect(unitElement.library.exports[0].metadata, hasLength(1));
+    expect(unitElement.library.exports[1].metadata, hasLength(1));
+    // DeclarationResolver on the clone should succeed.
+    CompilationUnit clonedUnit = AstCloner.clone(unit);
+    new DeclarationResolver().resolve(clonedUnit, unit.element);
+    expect(unit.directives[0].metadata.single.name.name, 'a');
+    expect(unit.directives[1].metadata.single.name.name, 'b');
+  }
+
   void test_metadata_fieldDeclaration() {
     setupCode('class C { @a int x; }');
     checkMetadata('x');
@@ -159,11 +190,52 @@
     checkMetadata('import');
   }
 
+  void test_metadata_importDirective_resynthesized() {
+    CompilationUnit unit = resolveSource(r'''
+@a
+import "dart:async";
+
+@b
+import "dart:math";
+
+const a = null;
+const b = null;
+''');
+    expect(unit.directives[0].metadata.single.name.name, 'a');
+    expect(unit.directives[1].metadata.single.name.name, 'b');
+    var unitElement = unit.element as CompilationUnitElementImpl;
+    // Damage the unit element - as if "setAnnotations" were not called.
+    // The ImportElement(s) still have the metadata, we should use it.
+    unitElement.setAnnotations(unit.directives[0].offset, []);
+    unitElement.setAnnotations(unit.directives[1].offset, []);
+    expect(unitElement.library.imports[0].metadata, hasLength(1));
+    expect(unitElement.library.imports[1].metadata, hasLength(1));
+    // DeclarationResolver on the clone should succeed.
+    CompilationUnit clonedUnit = AstCloner.clone(unit);
+    new DeclarationResolver().resolve(clonedUnit, unit.element);
+    expect(unit.directives[0].metadata.single.name.name, 'a');
+    expect(unit.directives[1].metadata.single.name.name, 'b');
+  }
+
   void test_metadata_libraryDirective() {
     setupCode('@a library L;');
     checkMetadata('L');
   }
 
+  void test_metadata_libraryDirective_resynthesized() {
+    CompilationUnit unit = resolveSource('@a library L; const a = null;');
+    expect(unit.directives.single.metadata.single.name.name, 'a');
+    var unitElement = unit.element as CompilationUnitElementImpl;
+    // Damage the unit element - as if "setAnnotations" were not called.
+    // The LibraryElement still has the metadata, we should use it.
+    unitElement.setAnnotations(unit.directives.single.offset, []);
+    expect(unitElement.library.metadata, hasLength(1));
+    // DeclarationResolver on the clone should succeed.
+    CompilationUnit clonedUnit = AstCloner.clone(unit);
+    new DeclarationResolver().resolve(clonedUnit, unit.element);
+    expect(clonedUnit.directives.single.metadata.single.name.name, 'a');
+  }
+
   void test_metadata_localFunctionDeclaration() {
     setupCode('f() { @a g() {} }');
     // Note: metadata on local function declarations is ignored by the
@@ -175,7 +247,7 @@
 
   void test_metadata_localVariableDeclaration() {
     setupCode('f() { @a int x; }');
-    checkMetadata('x');
+    checkMetadata('x', expectDifferent: true);
   }
 
   void test_metadata_methodDeclaration_getter() {
@@ -258,6 +330,70 @@
     super.setUp();
   }
 
+  void test_closure_inside_catch_block() {
+    String code = '''
+f() {
+  try {
+  } catch (e) {
+    return () => null;
+  }
+}
+''';
+    CompilationUnit unit = resolveSource(code);
+    // re-resolve
+    _cloneResolveUnit(unit);
+    // no other validations than built into DeclarationResolver
+  }
+
+  void test_closure_inside_labeled_statement() {
+    String code = '''
+f(b) {
+  foo: while (true) {
+    if (b) {
+      break foo;
+    }
+    return () => null;
+  }
+}
+''';
+    CompilationUnit unit = resolveSource(code);
+    // re-resolve
+    _cloneResolveUnit(unit);
+    // no other validations than built into DeclarationResolver
+  }
+
+  void test_closure_inside_switch_case() {
+    String code = '''
+void f(k, m) {
+  switch (k) {
+    case 0:
+      m.forEach((key, value) {});
+    break;
+  }
+}
+''';
+    CompilationUnit unit = resolveSource(code);
+    // re-resolve
+    _cloneResolveUnit(unit);
+    // no other validations than built into DeclarationResolver
+  }
+
+  void test_closure_inside_switch_default() {
+    String code = '''
+void f(k, m) {
+  switch (k) {
+    default:
+      m.forEach((key, value) {});
+    break;
+  }
+}
+''';
+    CompilationUnit unit = resolveSource(code);
+    // re-resolve
+    _cloneResolveUnit(unit);
+    // no other validations than built into DeclarationResolver
+  }
+
   void test_enumConstant_partiallyResolved() {
     String code = r'''
 enum Fruit {apple, pear}
@@ -300,9 +436,11 @@
 
   void test_invalid_functionDeclaration_getter_inFunction() {
     String code = r'''
-main() {
-  int get zzz => 42;
-}
+var v = (() {
+  main() {
+    int get zzz => 42;
+  }
+});
 ''';
     CompilationUnit unit = resolveSource(code);
     FunctionElement getterElement =
@@ -315,9 +453,11 @@
 
   void test_invalid_functionDeclaration_setter_inFunction() {
     String code = r'''
-main() {
-  set zzz(x) {}
-}
+var v = (() {
+  main() {
+    set zzz(x) {}
+  }
+});
 ''';
     CompilationUnit unit = resolveSource(code);
     FunctionElement setterElement =
diff --git a/pkg/analyzer/test/generated/element_resolver_test.dart b/pkg/analyzer/test/generated/element_resolver_test.dart
index e911f73..9824236 100644
--- a/pkg/analyzer/test/generated/element_resolver_test.dart
+++ b/pkg/analyzer/test/generated/element_resolver_test.dart
@@ -14,22 +14,22 @@
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/source.dart';
-import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
 import 'package:analyzer/src/generated/testing/element_factory.dart';
 import 'package:analyzer/src/generated/testing/test_type_provider.dart';
 import 'package:analyzer/src/source/source_resource.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../utils.dart';
 import 'analysis_context_factory.dart';
 import 'resolver_test_case.dart';
 import 'test_support.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ElementResolverCodeTest);
-  defineReflectiveTests(ElementResolverTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ElementResolverCodeTest);
+    defineReflectiveTests(ElementResolverTest);
+  });
 }
 
 @reflectiveTest
@@ -330,8 +330,8 @@
     fail("Not yet tested");
     // Need to set up the exported library so that the identifier can be
     // resolved.
-    ExportDirective directive = AstFactory.exportDirective2(null, [
-      AstFactory.hideCombinator2(["A"])
+    ExportDirective directive = AstTestFactory.exportDirective2(null, [
+      AstTestFactory.hideCombinator2(["A"])
     ]);
     _resolveNode(directive);
     _listener.assertNoErrors();
@@ -346,8 +346,8 @@
     fail("Not yet tested");
     // Need to set up the imported library so that the identifier can be
     // resolved.
-    ImportDirective directive = AstFactory.importDirective3(null, null, [
-      AstFactory.showCombinator2(["A"])
+    ImportDirective directive = AstTestFactory.importDirective3(null, null, [
+      AstTestFactory.showCombinator2(["A"])
     ]);
     _resolveNode(directive);
     _listener.assertNoErrors();
@@ -361,9 +361,10 @@
     _definingLibrary.imports = <ImportElement>[
       ElementFactory.importFor(null, ElementFactory.prefix(prefixName))
     ];
-    ImportDirective directive = AstFactory.importDirective3(null, prefixName, [
-      AstFactory.showCombinator2(["A"]),
-      AstFactory.hideCombinator2(["B"])
+    ImportDirective directive =
+        AstTestFactory.importDirective3(null, prefixName, [
+      AstTestFactory.showCombinator2(["A"]),
+      AstTestFactory.hideCombinator2(["B"])
     ]);
     _resolveNode(directive);
     _listener.assertNoErrors();
@@ -409,20 +410,20 @@
     // D a;
     // a[i];
     //
-    SimpleIdentifier array = AstFactory.identifier3("a");
+    SimpleIdentifier array = AstTestFactory.identifier3("a");
     array.staticType = classD.type;
     IndexExpression expression =
-        AstFactory.indexExpression(array, AstFactory.identifier3("i"));
+        AstTestFactory.indexExpression(array, AstTestFactory.identifier3("i"));
     expect(_resolveIndexExpression(expression), same(operator));
     _listener.assertNoErrors();
   }
 
   void test_visitAssignmentExpression_compound() {
     InterfaceType intType = _typeProvider.intType;
-    SimpleIdentifier leftHandSide = AstFactory.identifier3("a");
+    SimpleIdentifier leftHandSide = AstTestFactory.identifier3("a");
     leftHandSide.staticType = intType;
-    AssignmentExpression assignment = AstFactory.assignmentExpression(
-        leftHandSide, TokenType.PLUS_EQ, AstFactory.integer(1));
+    AssignmentExpression assignment = AstTestFactory.assignmentExpression(
+        leftHandSide, TokenType.PLUS_EQ, AstTestFactory.integer(1));
     _resolveNode(assignment);
     expect(
         assignment.staticElement, same(getMethod(_typeProvider.numType, "+")));
@@ -430,8 +431,10 @@
   }
 
   void test_visitAssignmentExpression_simple() {
-    AssignmentExpression expression = AstFactory.assignmentExpression(
-        AstFactory.identifier3("x"), TokenType.EQ, AstFactory.integer(0));
+    AssignmentExpression expression = AstTestFactory.assignmentExpression(
+        AstTestFactory.identifier3("x"),
+        TokenType.EQ,
+        AstTestFactory.integer(0));
     _resolveNode(expression);
     expect(expression.staticElement, isNull);
     _listener.assertNoErrors();
@@ -442,10 +445,10 @@
     // var j;
     // i == j
     InterfaceType stringType = _typeProvider.stringType;
-    SimpleIdentifier left = AstFactory.identifier3("i");
+    SimpleIdentifier left = AstTestFactory.identifier3("i");
     left.staticType = stringType;
-    BinaryExpression expression = AstFactory.binaryExpression(
-        left, TokenType.BANG_EQ, AstFactory.identifier3("j"));
+    BinaryExpression expression = AstTestFactory.binaryExpression(
+        left, TokenType.BANG_EQ, AstTestFactory.identifier3("j"));
     _resolveNode(expression);
     var stringElement = stringType.element;
     expect(expression.staticElement, isNotNull);
@@ -462,10 +465,10 @@
     // var j;
     // i == j
     InterfaceType stringType = _typeProvider.stringType;
-    SimpleIdentifier left = AstFactory.identifier3("i");
+    SimpleIdentifier left = AstTestFactory.identifier3("i");
     left.staticType = stringType;
-    BinaryExpression expression = AstFactory.binaryExpression(
-        left, TokenType.EQ_EQ, AstFactory.identifier3("j"));
+    BinaryExpression expression = AstTestFactory.binaryExpression(
+        left, TokenType.EQ_EQ, AstTestFactory.identifier3("j"));
     _resolveNode(expression);
     var stringElement = stringType.element;
     expect(
@@ -481,10 +484,10 @@
     // var j;
     // i + j
     InterfaceType numType = _typeProvider.numType;
-    SimpleIdentifier left = AstFactory.identifier3("i");
+    SimpleIdentifier left = AstTestFactory.identifier3("i");
     left.staticType = numType;
-    BinaryExpression expression = AstFactory.binaryExpression(
-        left, TokenType.PLUS, AstFactory.identifier3("j"));
+    BinaryExpression expression = AstTestFactory.binaryExpression(
+        left, TokenType.PLUS, AstTestFactory.identifier3("j"));
     _resolveNode(expression);
     expect(expression.staticElement, getMethod(numType, "+"));
     expect(expression.propagatedElement, isNull);
@@ -496,10 +499,10 @@
     // var j;
     // i + j
     InterfaceType numType = _typeProvider.numType;
-    SimpleIdentifier left = AstFactory.identifier3("i");
+    SimpleIdentifier left = AstTestFactory.identifier3("i");
     left.propagatedType = numType;
-    BinaryExpression expression = AstFactory.binaryExpression(
-        left, TokenType.PLUS, AstFactory.identifier3("j"));
+    BinaryExpression expression = AstTestFactory.binaryExpression(
+        left, TokenType.PLUS, AstTestFactory.identifier3("j"));
     _resolveNode(expression);
     expect(expression.staticElement, isNull);
     expect(expression.propagatedElement, getMethod(numType, "+"));
@@ -512,11 +515,11 @@
     // }
     String label = "loop";
     LabelElementImpl labelElement = new LabelElementImpl.forNode(
-        AstFactory.identifier3(label), false, false);
-    BreakStatement breakStatement = AstFactory.breakStatement2(label);
-    Expression condition = AstFactory.booleanLiteral(true);
+        AstTestFactory.identifier3(label), false, false);
+    BreakStatement breakStatement = AstTestFactory.breakStatement2(label);
+    Expression condition = AstTestFactory.booleanLiteral(true);
     WhileStatement whileStatement =
-        AstFactory.whileStatement(condition, breakStatement);
+        AstTestFactory.whileStatement(condition, breakStatement);
     expect(_resolveBreak(breakStatement, labelElement, whileStatement),
         same(labelElement));
     expect(breakStatement.target, same(whileStatement));
@@ -524,7 +527,7 @@
   }
 
   void test_visitBreakStatement_withoutLabel() {
-    BreakStatement statement = AstFactory.breakStatement();
+    BreakStatement statement = AstTestFactory.breakStatement();
     _resolveStatement(statement, null, null);
     _listener.assertNoErrors();
   }
@@ -542,7 +545,7 @@
     _visitor.nameScope = new EnclosedScope(null)
       ..defineNameWithoutChecking('A', classA);
     // prepare "A.p"
-    PrefixedIdentifier prefixed = AstFactory.identifier5('A', 'p');
+    PrefixedIdentifier prefixed = AstTestFactory.identifier5('A', 'p');
     CommentReference commentReference = new CommentReference(null, prefixed);
     // resolve
     _resolveNode(commentReference);
@@ -561,7 +564,7 @@
     _visitor.nameScope = new EnclosedScope(null)
       ..defineNameWithoutChecking('A', classA);
     // prepare "A.m"
-    PrefixedIdentifier prefixed = AstFactory.identifier5('A', 'm');
+    PrefixedIdentifier prefixed = AstTestFactory.identifier5('A', 'm');
     CommentReference commentReference = new CommentReference(null, prefixed);
     // resolve
     _resolveNode(commentReference);
@@ -580,7 +583,7 @@
     _visitor.nameScope = new EnclosedScope(null)
       ..defineNameWithoutChecking('A', classA);
     // prepare "A.=="
-    PrefixedIdentifier prefixed = AstFactory.identifier5('A', '==');
+    PrefixedIdentifier prefixed = AstTestFactory.identifier5('A', '==');
     CommentReference commentReference = new CommentReference(null, prefixed);
     // resolve
     _resolveNode(commentReference);
@@ -595,8 +598,8 @@
     ConstructorElement constructor =
         ElementFactory.constructorElement2(classA, constructorName);
     classA.constructors = <ConstructorElement>[constructor];
-    ConstructorName name = AstFactory.constructorName(
-        AstFactory.typeName(classA), constructorName);
+    ConstructorName name = AstTestFactory.constructorName(
+        AstTestFactory.typeName(classA), constructorName);
     _resolveNode(name);
     expect(name.staticElement, same(constructor));
     _listener.assertNoErrors();
@@ -608,8 +611,8 @@
     ConstructorElement constructor =
         ElementFactory.constructorElement2(classA, constructorName);
     classA.constructors = <ConstructorElement>[constructor];
-    ConstructorName name = AstFactory.constructorName(
-        AstFactory.typeName(classA), constructorName);
+    ConstructorName name = AstTestFactory.constructorName(
+        AstTestFactory.typeName(classA), constructorName);
     _resolveNode(name);
     expect(name.staticElement, same(constructor));
     _listener.assertNoErrors();
@@ -621,11 +624,12 @@
     // }
     String label = "loop";
     LabelElementImpl labelElement = new LabelElementImpl.forNode(
-        AstFactory.identifier3(label), false, false);
-    ContinueStatement continueStatement = AstFactory.continueStatement(label);
-    Expression condition = AstFactory.booleanLiteral(true);
+        AstTestFactory.identifier3(label), false, false);
+    ContinueStatement continueStatement =
+        AstTestFactory.continueStatement(label);
+    Expression condition = AstTestFactory.booleanLiteral(true);
     WhileStatement whileStatement =
-        AstFactory.whileStatement(condition, continueStatement);
+        AstTestFactory.whileStatement(condition, continueStatement);
     expect(_resolveContinue(continueStatement, labelElement, whileStatement),
         same(labelElement));
     expect(continueStatement.target, same(whileStatement));
@@ -633,7 +637,7 @@
   }
 
   void test_visitContinueStatement_withoutLabel() {
-    ContinueStatement statement = AstFactory.continueStatement();
+    ContinueStatement statement = AstTestFactory.continueStatement();
     _resolveStatement(statement, null, null);
     _listener.assertNoErrors();
   }
@@ -644,9 +648,9 @@
     EnumElementImpl enumElement =
         ElementFactory.enumElement(_typeProvider, ('E'));
     compilationUnitElement.enums = <ClassElement>[enumElement];
-    EnumDeclaration enumNode = AstFactory.enumDeclaration2('E', []);
+    EnumDeclaration enumNode = AstTestFactory.enumDeclaration2('E', []);
     Annotation annotationNode =
-        AstFactory.annotation(AstFactory.identifier3('a'));
+        AstTestFactory.annotation(AstTestFactory.identifier3('a'));
     annotationNode.element = ElementFactory.classElement2('A');
     annotationNode.elementAnnotation =
         new ElementAnnotationImpl(compilationUnitElement);
@@ -660,7 +664,7 @@
   }
 
   void test_visitExportDirective_noCombinators() {
-    ExportDirective directive = AstFactory.exportDirective2(null);
+    ExportDirective directive = AstTestFactory.exportDirective2(null);
     directive.element = ElementFactory
         .exportFor(ElementFactory.library(_definingLibrary.context, "lib"));
     _resolveNode(directive);
@@ -675,7 +679,7 @@
     ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.fields = <FieldElement>[fieldElement];
     FieldFormalParameter parameter =
-        AstFactory.fieldFormalParameter2(fieldName);
+        AstTestFactory.fieldFormalParameter2(fieldName);
     FieldFormalParameterElementImpl parameterElement =
         ElementFactory.fieldFormalParameter(parameter.identifier);
     parameterElement.field = fieldElement;
@@ -686,7 +690,7 @@
   }
 
   void test_visitImportDirective_noCombinators_noPrefix() {
-    ImportDirective directive = AstFactory.importDirective3(null, null);
+    ImportDirective directive = AstTestFactory.importDirective3(null, null);
     directive.element = ElementFactory.importFor(
         ElementFactory.library(_definingLibrary.context, "lib"), null);
     _resolveNode(directive);
@@ -699,16 +703,17 @@
         ElementFactory.library(_definingLibrary.context, "lib"),
         ElementFactory.prefix(prefixName));
     _definingLibrary.imports = <ImportElement>[importElement];
-    ImportDirective directive = AstFactory.importDirective3(null, prefixName);
+    ImportDirective directive =
+        AstTestFactory.importDirective3(null, prefixName);
     directive.element = importElement;
     _resolveNode(directive);
     _listener.assertNoErrors();
   }
 
   void test_visitImportDirective_withCombinators() {
-    ShowCombinator combinator = AstFactory.showCombinator2(["A", "B", "C"]);
+    ShowCombinator combinator = AstTestFactory.showCombinator2(["A", "B", "C"]);
     ImportDirective directive =
-        AstFactory.importDirective3(null, null, [combinator]);
+        AstTestFactory.importDirective3(null, null, [combinator]);
     LibraryElementImpl library =
         ElementFactory.library(_definingLibrary.context, "lib");
     TopLevelVariableElementImpl varA =
@@ -740,10 +745,10 @@
     MethodElement getter =
         ElementFactory.methodElement("[]", intType, [intType]);
     classA.methods = <MethodElement>[getter];
-    SimpleIdentifier array = AstFactory.identifier3("a");
+    SimpleIdentifier array = AstTestFactory.identifier3("a");
     array.staticType = classA.type;
     IndexExpression expression =
-        AstFactory.indexExpression(array, AstFactory.identifier3("i"));
+        AstTestFactory.indexExpression(array, AstTestFactory.identifier3("i"));
     expect(_resolveIndexExpression(expression), same(getter));
     _listener.assertNoErrors();
   }
@@ -754,12 +759,12 @@
     MethodElement setter =
         ElementFactory.methodElement("[]=", intType, [intType]);
     classA.methods = <MethodElement>[setter];
-    SimpleIdentifier array = AstFactory.identifier3("a");
+    SimpleIdentifier array = AstTestFactory.identifier3("a");
     array.staticType = classA.type;
     IndexExpression expression =
-        AstFactory.indexExpression(array, AstFactory.identifier3("i"));
-    AstFactory.assignmentExpression(
-        expression, TokenType.EQ, AstFactory.integer(0));
+        AstTestFactory.indexExpression(array, AstTestFactory.identifier3("i"));
+    AstTestFactory.assignmentExpression(
+        expression, TokenType.EQ, AstTestFactory.integer(0));
     expect(_resolveIndexExpression(expression), same(setter));
     _listener.assertNoErrors();
   }
@@ -770,11 +775,11 @@
     ConstructorElement constructor =
         ElementFactory.constructorElement2(classA, constructorName);
     classA.constructors = <ConstructorElement>[constructor];
-    ConstructorName name = AstFactory.constructorName(
-        AstFactory.typeName(classA), constructorName);
+    ConstructorName name = AstTestFactory.constructorName(
+        AstTestFactory.typeName(classA), constructorName);
     name.staticElement = constructor;
     InstanceCreationExpression creation =
-        AstFactory.instanceCreationExpression(Keyword.NEW, name);
+        AstTestFactory.instanceCreationExpression(Keyword.NEW, name);
     _resolveNode(creation);
     expect(creation.staticElement, same(constructor));
     _listener.assertNoErrors();
@@ -786,11 +791,11 @@
     ConstructorElement constructor =
         ElementFactory.constructorElement2(classA, constructorName);
     classA.constructors = <ConstructorElement>[constructor];
-    ConstructorName name = AstFactory.constructorName(
-        AstFactory.typeName(classA), constructorName);
+    ConstructorName name = AstTestFactory.constructorName(
+        AstTestFactory.typeName(classA), constructorName);
     name.staticElement = constructor;
     InstanceCreationExpression creation =
-        AstFactory.instanceCreationExpression(Keyword.NEW, name);
+        AstTestFactory.instanceCreationExpression(Keyword.NEW, name);
     _resolveNode(creation);
     expect(creation.staticElement, same(constructor));
     _listener.assertNoErrors();
@@ -805,13 +810,13 @@
     ParameterElement parameter = ElementFactory.namedParameter(parameterName);
     constructor.parameters = <ParameterElement>[parameter];
     classA.constructors = <ConstructorElement>[constructor];
-    ConstructorName name = AstFactory.constructorName(
-        AstFactory.typeName(classA), constructorName);
+    ConstructorName name = AstTestFactory.constructorName(
+        AstTestFactory.typeName(classA), constructorName);
     name.staticElement = constructor;
-    InstanceCreationExpression creation = AstFactory.instanceCreationExpression(
-        Keyword.NEW,
-        name,
-        [AstFactory.namedExpression2(parameterName, AstFactory.integer(0))]);
+    InstanceCreationExpression creation = AstTestFactory
+        .instanceCreationExpression(Keyword.NEW, name, [
+      AstTestFactory.namedExpression2(parameterName, AstTestFactory.integer(0))
+    ]);
     _resolveNode(creation);
     expect(creation.staticElement, same(constructor));
     expect(
@@ -825,10 +830,11 @@
 
   void test_visitMethodInvocation() {
     InterfaceType numType = _typeProvider.numType;
-    SimpleIdentifier left = AstFactory.identifier3("i");
+    SimpleIdentifier left = AstTestFactory.identifier3("i");
     left.staticType = numType;
     String methodName = "abs";
-    MethodInvocation invocation = AstFactory.methodInvocation(left, methodName);
+    MethodInvocation invocation =
+        AstTestFactory.methodInvocation(left, methodName);
     _resolveNode(invocation);
     expect(invocation.methodName.staticElement,
         same(getMethod(numType, methodName)));
@@ -843,10 +849,12 @@
     ParameterElement parameter = ElementFactory.namedParameter(parameterName);
     method.parameters = <ParameterElement>[parameter];
     classA.methods = <MethodElement>[method];
-    SimpleIdentifier left = AstFactory.identifier3("i");
+    SimpleIdentifier left = AstTestFactory.identifier3("i");
     left.staticType = classA.type;
-    MethodInvocation invocation = AstFactory.methodInvocation(left, methodName,
-        [AstFactory.namedExpression2(parameterName, AstFactory.integer(0))]);
+    MethodInvocation invocation = AstTestFactory.methodInvocation(
+        left, methodName, [
+      AstTestFactory.namedExpression2(parameterName, AstTestFactory.integer(0))
+    ]);
     _resolveNode(invocation);
     expect(invocation.methodName.staticElement, same(method));
     expect(
@@ -860,10 +868,10 @@
 
   void test_visitPostfixExpression() {
     InterfaceType numType = _typeProvider.numType;
-    SimpleIdentifier operand = AstFactory.identifier3("i");
+    SimpleIdentifier operand = AstTestFactory.identifier3("i");
     operand.staticType = numType;
     PostfixExpression expression =
-        AstFactory.postfixExpression(operand, TokenType.PLUS_PLUS);
+        AstTestFactory.postfixExpression(operand, TokenType.PLUS_PLUS);
     _resolveNode(expression);
     expect(expression.staticElement, getMethod(numType, "+"));
     _listener.assertNoErrors();
@@ -871,13 +879,13 @@
 
   void test_visitPrefixedIdentifier_dynamic() {
     DartType dynamicType = _typeProvider.dynamicType;
-    SimpleIdentifier target = AstFactory.identifier3("a");
+    SimpleIdentifier target = AstTestFactory.identifier3("a");
     VariableElementImpl variable = ElementFactory.localVariableElement(target);
     variable.type = dynamicType;
     target.staticElement = variable;
     target.staticType = dynamicType;
     PrefixedIdentifier identifier =
-        AstFactory.identifier(target, AstFactory.identifier3("b"));
+        AstTestFactory.identifier(target, AstTestFactory.identifier3("b"));
     _resolveNode(identifier);
     expect(identifier.staticElement, isNull);
     expect(identifier.identifier.staticElement, isNull);
@@ -890,13 +898,13 @@
     PropertyAccessorElement getter =
         ElementFactory.getterElement(getterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement>[getter];
-    SimpleIdentifier target = AstFactory.identifier3("a");
+    SimpleIdentifier target = AstTestFactory.identifier3("a");
     VariableElementImpl variable = ElementFactory.localVariableElement(target);
     variable.type = classA.type;
     target.staticElement = variable;
     target.staticType = classA.type;
-    PrefixedIdentifier identifier =
-        AstFactory.identifier(target, AstFactory.identifier3(getterName));
+    PrefixedIdentifier identifier = AstTestFactory.identifier(
+        target, AstTestFactory.identifier3(getterName));
     _resolveNode(identifier);
     expect(identifier.staticElement, same(getter));
     expect(identifier.identifier.staticElement, same(getter));
@@ -913,11 +921,11 @@
         ElementFactory.setterElement(propName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement>[getter, setter];
     // prepare "A.m"
-    SimpleIdentifier target = AstFactory.identifier3("A");
+    SimpleIdentifier target = AstTestFactory.identifier3("A");
     target.staticElement = classA;
     target.staticType = classA.type;
     PrefixedIdentifier identifier =
-        AstFactory.identifier(target, AstFactory.identifier3(propName));
+        AstTestFactory.identifier(target, AstTestFactory.identifier3(propName));
     // resolve
     _resolveNode(identifier);
     expect(identifier.staticElement, same(getter));
@@ -933,13 +941,13 @@
         ElementFactory.methodElement("m", _typeProvider.intType);
     classA.methods = <MethodElement>[method];
     // prepare "A.m"
-    SimpleIdentifier target = AstFactory.identifier3("A");
+    SimpleIdentifier target = AstTestFactory.identifier3("A");
     target.staticElement = classA;
     target.staticType = classA.type;
     PrefixedIdentifier identifier =
-        AstFactory.identifier(target, AstFactory.identifier3(propName));
-    AstFactory.assignmentExpression(
-        identifier, TokenType.EQ, AstFactory.nullLiteral());
+        AstTestFactory.identifier(target, AstTestFactory.identifier3(propName));
+    AstTestFactory.assignmentExpression(
+        identifier, TokenType.EQ, AstTestFactory.nullLiteral());
     // resolve
     _resolveNode(identifier);
     expect(identifier.staticElement, same(method));
@@ -957,13 +965,13 @@
         ElementFactory.setterElement(propName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement>[getter, setter];
     // prepare "A.b = null"
-    SimpleIdentifier target = AstFactory.identifier3("A");
+    SimpleIdentifier target = AstTestFactory.identifier3("A");
     target.staticElement = classA;
     target.staticType = classA.type;
     PrefixedIdentifier identifier =
-        AstFactory.identifier(target, AstFactory.identifier3(propName));
-    AstFactory.assignmentExpression(
-        identifier, TokenType.EQ, AstFactory.nullLiteral());
+        AstTestFactory.identifier(target, AstTestFactory.identifier3(propName));
+    AstTestFactory.assignmentExpression(
+        identifier, TokenType.EQ, AstTestFactory.nullLiteral());
     // resolve
     _resolveNode(identifier);
     expect(identifier.staticElement, same(setter));
@@ -973,10 +981,10 @@
 
   void test_visitPrefixExpression() {
     InterfaceType numType = _typeProvider.numType;
-    SimpleIdentifier operand = AstFactory.identifier3("i");
+    SimpleIdentifier operand = AstTestFactory.identifier3("i");
     operand.staticType = numType;
     PrefixExpression expression =
-        AstFactory.prefixExpression(TokenType.PLUS_PLUS, operand);
+        AstTestFactory.prefixExpression(TokenType.PLUS_PLUS, operand);
     _resolveNode(expression);
     expect(expression.staticElement, getMethod(numType, "+"));
     _listener.assertNoErrors();
@@ -988,9 +996,9 @@
     PropertyAccessorElement getter =
         ElementFactory.getterElement(getterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement>[getter];
-    SimpleIdentifier target = AstFactory.identifier3("a");
+    SimpleIdentifier target = AstTestFactory.identifier3("a");
     target.staticType = classA.type;
-    PropertyAccess access = AstFactory.propertyAccess2(target, getterName);
+    PropertyAccess access = AstTestFactory.propertyAccess2(target, getterName);
     _resolveNode(access);
     expect(access.propertyName.staticElement, same(getter));
     _listener.assertNoErrors();
@@ -1010,17 +1018,17 @@
     PropertyAccessorElement getter =
         ElementFactory.getterElement(getterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement>[getter];
-    SuperExpression target = AstFactory.superExpression();
+    SuperExpression target = AstTestFactory.superExpression();
     target.staticType = ElementFactory.classElement("B", classA.type).type;
-    PropertyAccess access = AstFactory.propertyAccess2(target, getterName);
-    AstFactory.methodDeclaration2(
+    PropertyAccess access = AstTestFactory.propertyAccess2(target, getterName);
+    AstTestFactory.methodDeclaration2(
         null,
         null,
         null,
         null,
-        AstFactory.identifier3("m"),
-        AstFactory.formalParameterList(),
-        AstFactory.expressionFunctionBody(access));
+        AstTestFactory.identifier3("m"),
+        AstTestFactory.formalParameterList(),
+        AstTestFactory.expressionFunctionBody(access));
     _resolveNode(access);
     expect(access.propertyName.staticElement, same(getter));
     _listener.assertNoErrors();
@@ -1032,11 +1040,11 @@
     PropertyAccessorElement setter =
         ElementFactory.setterElement(setterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement>[setter];
-    ThisExpression target = AstFactory.thisExpression();
+    ThisExpression target = AstTestFactory.thisExpression();
     target.staticType = classA.type;
-    PropertyAccess access = AstFactory.propertyAccess2(target, setterName);
-    AstFactory.assignmentExpression(
-        access, TokenType.EQ, AstFactory.integer(0));
+    PropertyAccess access = AstTestFactory.propertyAccess2(target, setterName);
+    AstTestFactory.assignmentExpression(
+        access, TokenType.EQ, AstTestFactory.integer(0));
     _resolveNode(access);
     expect(access.propertyName.staticElement, same(setter));
     _listener.assertNoErrors();
@@ -1045,14 +1053,14 @@
   void test_visitSimpleIdentifier_classScope() {
     InterfaceType doubleType = _typeProvider.doubleType;
     String fieldName = "NAN";
-    SimpleIdentifier node = AstFactory.identifier3(fieldName);
+    SimpleIdentifier node = AstTestFactory.identifier3(fieldName);
     _resolveInClass(node, doubleType.element);
     expect(node.staticElement, getGetter(doubleType, fieldName));
     _listener.assertNoErrors();
   }
 
   void test_visitSimpleIdentifier_dynamic() {
-    SimpleIdentifier node = AstFactory.identifier3("dynamic");
+    SimpleIdentifier node = AstTestFactory.identifier3("dynamic");
     _resolveIdentifier(node);
     expect(node.staticElement, same(_typeProvider.dynamicType.element));
     expect(node.staticType, same(_typeProvider.typeType));
@@ -1060,7 +1068,7 @@
   }
 
   void test_visitSimpleIdentifier_lexicalScope() {
-    SimpleIdentifier node = AstFactory.identifier3("i");
+    SimpleIdentifier node = AstTestFactory.identifier3("i");
     VariableElementImpl element = ElementFactory.localVariableElement(node);
     expect(_resolveIdentifier(node, [element]), same(element));
     _listener.assertNoErrors();
@@ -1074,8 +1082,9 @@
         ElementFactory.fieldElement(fieldName, false, false, false, intType);
     classA.fields = <FieldElement>[field];
     classA.accessors = <PropertyAccessorElement>[field.getter, field.setter];
-    SimpleIdentifier node = AstFactory.identifier3(fieldName);
-    AstFactory.assignmentExpression(node, TokenType.EQ, AstFactory.integer(0));
+    SimpleIdentifier node = AstTestFactory.identifier3(fieldName);
+    AstTestFactory.assignmentExpression(
+        node, TokenType.EQ, AstTestFactory.integer(0));
     _resolveInClass(node, classA);
     Element element = node.staticElement;
     EngineTestCase.assertInstanceOf((obj) => obj is PropertyAccessorElement,
@@ -1095,9 +1104,9 @@
         ElementFactory.constructorElement2(subclass, null);
     subclass.constructors = <ConstructorElement>[subConstructor];
     SuperConstructorInvocation invocation =
-        AstFactory.superConstructorInvocation();
-    AstFactory.classDeclaration(null, 'C', null, null, null, null, [
-      AstFactory.constructorDeclaration(null, 'C', null, [invocation])
+        AstTestFactory.superConstructorInvocation();
+    AstTestFactory.classDeclaration(null, 'C', null, null, null, null, [
+      AstTestFactory.constructorDeclaration(null, 'C', null, [invocation])
     ]);
     _resolveInClass(invocation, subclass);
     expect(invocation.staticElement, superConstructor);
@@ -1117,12 +1126,12 @@
     ConstructorElementImpl subConstructor =
         ElementFactory.constructorElement2(subclass, null);
     subclass.constructors = <ConstructorElement>[subConstructor];
-    SuperConstructorInvocation invocation = AstFactory
+    SuperConstructorInvocation invocation = AstTestFactory
         .superConstructorInvocation([
-      AstFactory.namedExpression2(parameterName, AstFactory.integer(0))
+      AstTestFactory.namedExpression2(parameterName, AstTestFactory.integer(0))
     ]);
-    AstFactory.classDeclaration(null, 'C', null, null, null, null, [
-      AstFactory.constructorDeclaration(null, 'C', null, [invocation])
+    AstTestFactory.classDeclaration(null, 'C', null, null, null, null, [
+      AstTestFactory.constructorDeclaration(null, 'C', null, [invocation])
     ]);
     _resolveInClass(invocation, subclass);
     expect(invocation.staticElement, superConstructor);
diff --git a/pkg/analyzer/test/generated/engine_test.dart b/pkg/analyzer/test/generated/engine_test.dart
index 1c681c4..93b3108 100644
--- a/pkg/analyzer/test/generated/engine_test.dart
+++ b/pkg/analyzer/test/generated/engine_test.dart
@@ -22,15 +22,84 @@
 import 'package:analyzer/src/string_source.dart';
 import 'package:analyzer/task/model.dart';
 import 'package:html/dom.dart' show Document;
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:typed_mock/typed_mock.dart';
-import 'package:unittest/unittest.dart';
-
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(SourcesChangedEventTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisOptionsImplTest);
+    defineReflectiveTests(SourcesChangedEventTest);
+  });
+}
+
+@reflectiveTest
+class AnalysisOptionsImplTest {
+  test_resetToDefaults() {
+    // Note that this only tests options visible from the interface.
+    AnalysisOptionsImpl defaultOptions = new AnalysisOptionsImpl();
+    AnalysisOptionsImpl modifiedOptions = new AnalysisOptionsImpl();
+    modifiedOptions.dart2jsHint = true;
+    modifiedOptions.disableCacheFlushing = true;
+    modifiedOptions.enableAssertInitializer = true;
+    modifiedOptions.enableAssertMessage = true;
+    modifiedOptions.enableLazyAssignmentOperators = true;
+    modifiedOptions.enableStrictCallChecks = true;
+    modifiedOptions.enableSuperMixins = true;
+    modifiedOptions.enableTiming = true;
+    modifiedOptions.enableUriInPartOf = true;
+    modifiedOptions.errorProcessors = [null];
+    modifiedOptions.excludePatterns = ['a'];
+    modifiedOptions.finerGrainedInvalidation = true;
+    modifiedOptions.generateImplicitErrors = false;
+    modifiedOptions.generateSdkErrors = true;
+    modifiedOptions.hint = false;
+    modifiedOptions.incremental = true;
+    modifiedOptions.incrementalApi = true;
+    modifiedOptions.incrementalValidation = true;
+    modifiedOptions.lint = true;
+    modifiedOptions.lintRules = [null];
+    modifiedOptions.patchPlatform = 3;
+    modifiedOptions.preserveComments = false;
+    modifiedOptions.strongMode = true;
+    modifiedOptions.trackCacheDependencies = false;
+
+    modifiedOptions.resetToDefaults();
+
+    expect(modifiedOptions.dart2jsHint, defaultOptions.dart2jsHint);
+    expect(modifiedOptions.disableCacheFlushing,
+        defaultOptions.disableCacheFlushing);
+    expect(modifiedOptions.enableAssertInitializer,
+        defaultOptions.enableAssertInitializer);
+    expect(modifiedOptions.enableAssertMessage,
+        defaultOptions.enableAssertMessage);
+    expect(modifiedOptions.enableLazyAssignmentOperators,
+        defaultOptions.enableLazyAssignmentOperators);
+    expect(modifiedOptions.enableStrictCallChecks,
+        defaultOptions.enableStrictCallChecks);
+    expect(modifiedOptions.enableSuperMixins, defaultOptions.enableSuperMixins);
+    expect(modifiedOptions.enableTiming, defaultOptions.enableTiming);
+    expect(modifiedOptions.enableUriInPartOf, defaultOptions.enableUriInPartOf);
+    expect(modifiedOptions.errorProcessors, defaultOptions.errorProcessors);
+    expect(modifiedOptions.excludePatterns, defaultOptions.excludePatterns);
+    expect(modifiedOptions.finerGrainedInvalidation,
+        defaultOptions.finerGrainedInvalidation);
+    expect(modifiedOptions.generateImplicitErrors,
+        defaultOptions.generateImplicitErrors);
+    expect(modifiedOptions.generateSdkErrors, defaultOptions.generateSdkErrors);
+    expect(modifiedOptions.hint, defaultOptions.hint);
+    expect(modifiedOptions.incremental, defaultOptions.incremental);
+    expect(modifiedOptions.incrementalApi, defaultOptions.incrementalApi);
+    expect(modifiedOptions.incrementalValidation,
+        defaultOptions.incrementalValidation);
+    expect(modifiedOptions.lint, defaultOptions.lint);
+    expect(modifiedOptions.lintRules, defaultOptions.lintRules);
+    expect(modifiedOptions.patchPlatform, defaultOptions.patchPlatform);
+    expect(modifiedOptions.preserveComments, defaultOptions.preserveComments);
+    expect(modifiedOptions.strongMode, defaultOptions.strongMode);
+    expect(modifiedOptions.trackCacheDependencies,
+        defaultOptions.trackCacheDependencies);
+  }
 }
 
 /**
@@ -484,6 +553,7 @@
     return null;
   }
 
+  @deprecated
   @override
   Object/*=V*/ getConfigurationData/*<V>*/(ResultDescriptor/*<V>*/ key) {
     fail("Unexpected invocation of getConfigurationData");
@@ -686,6 +756,7 @@
     fail("Unexpected invocation of setChangedContents");
   }
 
+  @deprecated
   @override
   void setConfigurationData(ResultDescriptor key, Object data) {
     fail("Unexpected invocation of setConfigurationData");
diff --git a/pkg/analyzer/test/generated/error_suppression_test.dart b/pkg/analyzer/test/generated/error_suppression_test.dart
index 00355f6..20a3312 100644
--- a/pkg/analyzer/test/generated/error_suppression_test.dart
+++ b/pkg/analyzer/test/generated/error_suppression_test.dart
@@ -7,12 +7,12 @@
 import 'package:analyzer/src/generated/source_io.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../utils.dart';
 import 'resolver_test_case.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ErrorSuppressionTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ErrorSuppressionTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/generated/hint_code_test.dart b/pkg/analyzer/test/generated/hint_code_test.dart
index bbec137..4e5009f 100644
--- a/pkg/analyzer/test/generated/hint_code_test.dart
+++ b/pkg/analyzer/test/generated/hint_code_test.dart
@@ -9,16 +9,16 @@
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/parser.dart';
 import 'package:analyzer/src/generated/source_io.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../utils.dart';
 import 'analysis_context_factory.dart';
 import 'resolver_test_case.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(HintCodeTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(HintCodeTest);
+  });
 }
 
 @reflectiveTest
@@ -62,7 +62,7 @@
   const JS([String js]) { }
 }
 '''
-    });
+    }, resourceProvider: resourceProvider);
   }
 
   void test_abstractSuperMemberReference_getter() {
@@ -1504,8 +1504,7 @@
 ''');
     List<AnalysisError> errors = analysisContext2.computeErrors(source2);
     expect(errors, hasLength(1));
-    expect(errors[0].message,
-        "The member 'a' can only be used within instance members of subclasses of 'A'");
+    expect(errors[0].errorCode, HintCode.INVALID_USE_OF_PROTECTED_MEMBER);
     verify([source, source2]);
   }
 
diff --git a/pkg/analyzer/test/generated/incremental_resolver_test.dart b/pkg/analyzer/test/generated/incremental_resolver_test.dart
index e80ea99..381d3c2 100644
--- a/pkg/analyzer/test/generated/incremental_resolver_test.dart
+++ b/pkg/analyzer/test/generated/incremental_resolver_test.dart
@@ -23,14 +23,14 @@
 import 'package:analyzer/src/generated/parser.dart';
 import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/source_io.dart';
-import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
 import 'package:analyzer/src/generated/testing/element_factory.dart';
 import 'package:analyzer/src/generated/utilities_collection.dart';
 import 'package:analyzer/src/task/dart.dart';
 import 'package:analyzer/task/dart.dart';
 import 'package:analyzer/task/model.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import 'analysis_context_factory.dart';
 import 'resolver_test_case.dart';
@@ -38,9 +38,11 @@
 
 main() {
   initializeTestEnvironment();
-  defineReflectiveTests(IncrementalResolverTest);
-  defineReflectiveTests(PoorMansIncrementalResolutionTest);
-  defineReflectiveTests(ResolutionContextBuilderTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(IncrementalResolverTest);
+    defineReflectiveTests(PoorMansIncrementalResolutionTest);
+    defineReflectiveTests(ResolutionContextBuilderTest);
+  });
 }
 
 void initializeTestEnvironment() {}
@@ -144,16 +146,6 @@
   LibraryElement library;
   CompilationUnit unit;
 
-  @override
-  void reset() {
-    analysisContext2 = AnalysisContextFactory.contextWithCore();
-  }
-
-  @override
-  void resetWithOptions(AnalysisOptions options) {
-    AnalysisContextFactory.contextWithCoreAndOptions(options);
-  }
-
   void setUp() {
     super.setUp();
     logging.logger = logging.NULL_LOGGER;
@@ -1019,6 +1011,55 @@
         expectedSuccess: false);
   }
 
+  void test_false_inBody_addAsync() {
+    _resolveUnit(r'''
+class C {
+  test() {}
+}
+''');
+    _updateAndValidate(
+        r'''
+class C {
+  test() async {}
+}
+''',
+        expectedSuccess: false);
+  }
+
+  void test_false_inBody_async_addStar() {
+    _resolveUnit(r'''
+import 'dart:async';
+class C {
+  Stream test() async {}
+}
+''');
+    _updateAndValidate(
+        r'''
+import 'dart:async';
+class C {
+  Stream test() async* {}
+}
+''',
+        expectedSuccess: false);
+  }
+
+  void test_false_inBody_async_removeStar() {
+    _resolveUnit(r'''
+import 'dart:async';
+class C {
+  Stream test() async* {}
+}
+''');
+    _updateAndValidate(
+        r'''
+import 'dart:async';
+class C {
+  Stream test() async {}
+}
+''',
+        expectedSuccess: false);
+  }
+
   void test_false_inBody_functionExpression() {
     _resolveUnit(r'''
 class C extends D {
@@ -1042,6 +1083,36 @@
         expectedSuccess: false);
   }
 
+  void test_false_inBody_removeAsync() {
+    _resolveUnit(r'''
+class C {
+  test() async {}
+}
+''');
+    _updateAndValidate(
+        r'''
+class C {
+  test() {}
+}
+''',
+        expectedSuccess: false);
+  }
+
+  void test_false_inBody_sync_addStar() {
+    _resolveUnit(r'''
+class C {
+  test() {}
+}
+''');
+    _updateAndValidate(
+        r'''
+class C {
+  test() sync* {}
+}
+''',
+        expectedSuccess: false);
+  }
+
   void test_false_topLevelFunction_name() {
     _resolveUnit(r'''
 a() {}
@@ -2184,7 +2255,7 @@
 
   void test_scopeFor_notInCompilationUnit() {
     try {
-      _scopeFor(AstFactory.identifier3("x"));
+      _scopeFor(AstTestFactory.identifier3("x"));
       fail("Expected AnalysisException");
     } on AnalysisException {
       // Expected
@@ -2202,7 +2273,7 @@
 
   void test_scopeFor_unresolved() {
     try {
-      _scopeFor(AstFactory.compilationUnit());
+      _scopeFor(AstTestFactory.compilationUnit());
       fail("Expected AnalysisException");
     } on AnalysisException {
       // Expected
@@ -2212,8 +2283,8 @@
   ClassDeclaration _createResolvedClassDeclaration() {
     CompilationUnit unit = _createResolvedCompilationUnit();
     String className = "C";
-    ClassDeclaration classNode = AstFactory.classDeclaration(
-        null, className, AstFactory.typeParameterList(), null, null, null);
+    ClassDeclaration classNode = AstTestFactory.classDeclaration(
+        null, className, AstTestFactory.typeParameterList(), null, null, null);
     unit.declarations.add(classNode);
     ClassElement classElement = ElementFactory.classElement2(className);
     classNode.name.staticElement = classElement;
@@ -2226,8 +2297,8 @@
   ClassTypeAlias _createResolvedClassTypeAlias() {
     CompilationUnit unit = _createResolvedCompilationUnit();
     String className = "C";
-    ClassTypeAlias classNode = AstFactory.classTypeAlias(
-        className, AstFactory.typeParameterList(), null, null, null, null);
+    ClassTypeAlias classNode = AstTestFactory.classTypeAlias(
+        className, AstTestFactory.typeParameterList(), null, null, null, null);
     unit.declarations.add(classNode);
     ClassElement classElement = ElementFactory.classElement2(className);
     classNode.name.staticElement = classElement;
@@ -2238,7 +2309,7 @@
   }
 
   CompilationUnit _createResolvedCompilationUnit() {
-    CompilationUnit unit = AstFactory.compilationUnit();
+    CompilationUnit unit = AstTestFactory.compilationUnit();
     LibraryElementImpl library =
         ElementFactory.library(AnalysisContextFactory.contextWithCore(), "lib");
     unit.element = library.definingCompilationUnit;
@@ -2248,11 +2319,12 @@
   ConstructorDeclaration _createResolvedConstructorDeclaration() {
     ClassDeclaration classNode = _createResolvedClassDeclaration();
     String constructorName = "f";
-    ConstructorDeclaration constructorNode = AstFactory.constructorDeclaration(
-        AstFactory.identifier3(constructorName),
-        null,
-        AstFactory.formalParameterList(),
-        null);
+    ConstructorDeclaration constructorNode =
+        AstTestFactory.constructorDeclaration(
+            AstTestFactory.identifier3(constructorName),
+            null,
+            AstTestFactory.formalParameterList(),
+            null);
     classNode.members.add(constructorNode);
     ConstructorElement constructorElement =
         ElementFactory.constructorElement2(classNode.element, null);
@@ -2266,8 +2338,8 @@
   FunctionDeclaration _createResolvedFunctionDeclaration() {
     CompilationUnit unit = _createResolvedCompilationUnit();
     String functionName = "f";
-    FunctionDeclaration functionNode = AstFactory.functionDeclaration(
-        null, null, functionName, AstFactory.functionExpression());
+    FunctionDeclaration functionNode = AstTestFactory.functionDeclaration(
+        null, null, functionName, AstTestFactory.functionExpression());
     unit.declarations.add(functionNode);
     FunctionElement functionElement =
         ElementFactory.functionElement(functionName);
@@ -2280,11 +2352,11 @@
 
   FunctionTypeAlias _createResolvedFunctionTypeAlias() {
     CompilationUnit unit = _createResolvedCompilationUnit();
-    FunctionTypeAlias aliasNode = AstFactory.typeAlias(
-        AstFactory.typeName4("A"),
+    FunctionTypeAlias aliasNode = AstTestFactory.typeAlias(
+        AstTestFactory.typeName4("A"),
         "F",
-        AstFactory.typeParameterList(),
-        AstFactory.formalParameterList());
+        AstTestFactory.typeParameterList(),
+        AstTestFactory.formalParameterList());
     unit.declarations.add(aliasNode);
     SimpleIdentifier aliasName = aliasNode.name;
     FunctionTypeAliasElement aliasElement =
@@ -2298,13 +2370,13 @@
   MethodDeclaration _createResolvedMethodDeclaration() {
     ClassDeclaration classNode = _createResolvedClassDeclaration();
     String methodName = "f";
-    MethodDeclaration methodNode = AstFactory.methodDeclaration(
+    MethodDeclaration methodNode = AstTestFactory.methodDeclaration(
         null,
         null,
         null,
         null,
-        AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList());
+        AstTestFactory.identifier3(methodName),
+        AstTestFactory.formalParameterList());
     classNode.members.add(methodNode);
     MethodElement methodElement =
         ElementFactory.methodElement(methodName, null);
diff --git a/pkg/analyzer/test/generated/inheritance_manager_test.dart b/pkg/analyzer/test/generated/inheritance_manager_test.dart
index 0be0549..9cae945 100644
--- a/pkg/analyzer/test/generated/inheritance_manager_test.dart
+++ b/pkg/analyzer/test/generated/inheritance_manager_test.dart
@@ -16,21 +16,21 @@
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/source_io.dart';
-import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
 import 'package:analyzer/src/generated/testing/element_factory.dart';
 import 'package:analyzer/src/generated/testing/test_type_provider.dart';
 import 'package:analyzer/src/generated/utilities_dart.dart';
 import 'package:analyzer/src/source/source_resource.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../utils.dart';
 import 'analysis_context_factory.dart';
 import 'test_support.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(InheritanceManagerTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(InheritanceManagerTest);
+  });
 }
 
 @reflectiveTest
@@ -399,11 +399,11 @@
     MethodElementImpl methodM1 =
         ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
     ParameterElementImpl parameter1 =
-        new ParameterElementImpl.forNode(AstFactory.identifier3("a1"));
+        new ParameterElementImpl.forNode(AstTestFactory.identifier3("a1"));
     parameter1.type = _typeProvider.intType;
     parameter1.parameterKind = ParameterKind.REQUIRED;
     ParameterElementImpl parameter2 =
-        new ParameterElementImpl.forNode(AstFactory.identifier3("a2"));
+        new ParameterElementImpl.forNode(AstTestFactory.identifier3("a2"));
     parameter2.type = _typeProvider.intType;
     parameter2.parameterKind = ParameterKind.POSITIONAL;
     methodM1.parameters = <ParameterElement>[parameter1, parameter2];
@@ -412,15 +412,15 @@
     MethodElementImpl methodM2 =
         ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
     ParameterElementImpl parameter3 =
-        new ParameterElementImpl.forNode(AstFactory.identifier3("a3"));
+        new ParameterElementImpl.forNode(AstTestFactory.identifier3("a3"));
     parameter3.type = _typeProvider.intType;
     parameter3.parameterKind = ParameterKind.REQUIRED;
     ParameterElementImpl parameter4 =
-        new ParameterElementImpl.forNode(AstFactory.identifier3("a4"));
+        new ParameterElementImpl.forNode(AstTestFactory.identifier3("a4"));
     parameter4.type = _typeProvider.intType;
     parameter4.parameterKind = ParameterKind.REQUIRED;
     ParameterElementImpl parameter5 =
-        new ParameterElementImpl.forNode(AstFactory.identifier3("a5"));
+        new ParameterElementImpl.forNode(AstTestFactory.identifier3("a5"));
     parameter5.type = _typeProvider.intType;
     parameter5.parameterKind = ParameterKind.REQUIRED;
     methodM2.parameters = <ParameterElement>[
@@ -584,7 +584,7 @@
     MethodElementImpl methodM1 =
         ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
     ParameterElementImpl parameter1 =
-        new ParameterElementImpl.forNode(AstFactory.identifier3("a0"));
+        new ParameterElementImpl.forNode(AstTestFactory.identifier3("a0"));
     parameter1.type = _typeProvider.intType;
     parameter1.parameterKind = ParameterKind.REQUIRED;
     methodM1.parameters = <ParameterElement>[parameter1];
@@ -593,7 +593,7 @@
     MethodElementImpl methodM2 =
         ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
     ParameterElementImpl parameter2 =
-        new ParameterElementImpl.forNode(AstFactory.identifier3("a0"));
+        new ParameterElementImpl.forNode(AstTestFactory.identifier3("a0"));
     parameter2.type = _typeProvider.numType;
     parameter2.parameterKind = ParameterKind.REQUIRED;
     methodM2.parameters = <ParameterElement>[parameter2];
@@ -692,7 +692,7 @@
     MethodElementImpl methodM1 =
         ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
     ParameterElementImpl parameter1 =
-        new ParameterElementImpl.forNode(AstFactory.identifier3("a0"));
+        new ParameterElementImpl.forNode(AstTestFactory.identifier3("a0"));
     parameter1.type = classA.type;
     parameter1.parameterKind = ParameterKind.REQUIRED;
     methodM1.parameters = <ParameterElement>[parameter1];
@@ -701,7 +701,7 @@
     MethodElementImpl methodM2 =
         ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
     ParameterElementImpl parameter2 =
-        new ParameterElementImpl.forNode(AstFactory.identifier3("a0"));
+        new ParameterElementImpl.forNode(AstTestFactory.identifier3("a0"));
     parameter2.type = classB.type;
     parameter2.parameterKind = ParameterKind.REQUIRED;
     methodM2.parameters = <ParameterElement>[parameter2];
@@ -710,7 +710,7 @@
     MethodElementImpl methodM3 =
         ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
     ParameterElementImpl parameter3 =
-        new ParameterElementImpl.forNode(AstFactory.identifier3("a0"));
+        new ParameterElementImpl.forNode(AstTestFactory.identifier3("a0"));
     parameter3.type = classC.type;
     parameter3.parameterKind = ParameterKind.REQUIRED;
     methodM3.parameters = <ParameterElement>[parameter3];
@@ -785,7 +785,7 @@
     MethodElementImpl methodM2 =
         ElementFactory.methodElement(methodName, _typeProvider.intType);
     ParameterElementImpl parameter1 =
-        new ParameterElementImpl.forNode(AstFactory.identifier3("a1"));
+        new ParameterElementImpl.forNode(AstTestFactory.identifier3("a1"));
     parameter1.type = _typeProvider.intType;
     parameter1.parameterKind = ParameterKind.POSITIONAL;
     methodM2.parameters = <ParameterElement>[parameter1];
@@ -814,7 +814,7 @@
     MethodElementImpl methodM2 =
         ElementFactory.methodElement(methodName, _typeProvider.intType);
     ParameterElementImpl parameter1 =
-        new ParameterElementImpl.forNode(AstFactory.identifier3("a1"));
+        new ParameterElementImpl.forNode(AstTestFactory.identifier3("a1"));
     parameter1.type = _typeProvider.intType;
     parameter1.parameterKind = ParameterKind.POSITIONAL;
     methodM1.parameters = <ParameterElement>[parameter1];
@@ -823,11 +823,11 @@
     MethodElementImpl methodM3 =
         ElementFactory.methodElement(methodName, _typeProvider.intType);
     ParameterElementImpl parameter2 =
-        new ParameterElementImpl.forNode(AstFactory.identifier3("a2"));
+        new ParameterElementImpl.forNode(AstTestFactory.identifier3("a2"));
     parameter2.type = _typeProvider.intType;
     parameter2.parameterKind = ParameterKind.POSITIONAL;
     ParameterElementImpl parameter3 =
-        new ParameterElementImpl.forNode(AstFactory.identifier3("a3"));
+        new ParameterElementImpl.forNode(AstTestFactory.identifier3("a3"));
     parameter3.type = _typeProvider.intType;
     parameter3.parameterKind = ParameterKind.POSITIONAL;
     methodM3.parameters = <ParameterElement>[parameter2, parameter3];
@@ -865,7 +865,7 @@
     MethodElementImpl methodM3 =
         ElementFactory.methodElement(methodName, _typeProvider.intType);
     ParameterElementImpl parameter1 =
-        new ParameterElementImpl.forNode(AstFactory.identifier3("a1"));
+        new ParameterElementImpl.forNode(AstTestFactory.identifier3("a1"));
     parameter1.type = _typeProvider.intType;
     parameter1.parameterKind = ParameterKind.POSITIONAL;
     methodM3.parameters = <ParameterElement>[parameter1];
@@ -874,11 +874,11 @@
     MethodElementImpl methodM4 =
         ElementFactory.methodElement(methodName, _typeProvider.intType);
     ParameterElementImpl parameter2 =
-        new ParameterElementImpl.forNode(AstFactory.identifier3("a2"));
+        new ParameterElementImpl.forNode(AstTestFactory.identifier3("a2"));
     parameter2.type = _typeProvider.intType;
     parameter2.parameterKind = ParameterKind.POSITIONAL;
     ParameterElementImpl parameter3 =
-        new ParameterElementImpl.forNode(AstFactory.identifier3("a3"));
+        new ParameterElementImpl.forNode(AstTestFactory.identifier3("a3"));
     parameter3.type = _typeProvider.intType;
     parameter3.parameterKind = ParameterKind.POSITIONAL;
     methodM4.parameters = <ParameterElement>[parameter2, parameter3];
@@ -968,7 +968,7 @@
     String methodName = "m";
     MethodElement methodM =
         ElementFactory.methodElement(methodName, _typeProvider.intType);
-    (methodM as MethodElementImpl).static = true;
+    (methodM as MethodElementImpl).isStatic = true;
     classA.methods = <MethodElement>[methodM];
     ClassElementImpl classB = ElementFactory.classElement2("B");
     classB.interfaces = <InterfaceType>[classA.type];
@@ -1064,7 +1064,7 @@
     String methodName = "m";
     MethodElement methodM =
         ElementFactory.methodElement(methodName, _typeProvider.intType);
-    (methodM as MethodElementImpl).static = true;
+    (methodM as MethodElementImpl).isStatic = true;
     classA.methods = <MethodElement>[methodM];
     ClassElementImpl classB = ElementFactory.classElement2("B");
     classB.mixins = <InterfaceType>[classA.type];
@@ -1140,7 +1140,7 @@
     String methodName = "m";
     MethodElement methodM =
         ElementFactory.methodElement(methodName, _typeProvider.intType);
-    (methodM as MethodElementImpl).static = true;
+    (methodM as MethodElementImpl).isStatic = true;
     classA.methods = <MethodElement>[methodM];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     expect(_inheritanceManager.lookupInheritance(classB, methodName), isNull);
@@ -1183,7 +1183,7 @@
     String methodName = "m";
     MethodElement methodM =
         ElementFactory.methodElement(methodName, _typeProvider.intType);
-    (methodM as MethodElementImpl).static = true;
+    (methodM as MethodElementImpl).isStatic = true;
     classA.methods = <MethodElement>[methodM];
     expect(_inheritanceManager.lookupMember(classA, methodName), isNull);
     _assertNoErrors(classA);
@@ -1286,7 +1286,7 @@
   }
 
   void _assertErrors(ClassElement classElt,
-      [List<ErrorCode> expectedErrorCodes = ErrorCode.EMPTY_LIST]) {
+      [List<ErrorCode> expectedErrorCodes = const <ErrorCode>[]]) {
     GatheringErrorListener errorListener = new GatheringErrorListener();
     HashSet<AnalysisError> actualErrors =
         _inheritanceManager.getErrors(classElt);
diff --git a/pkg/analyzer/test/generated/java_core_test.dart b/pkg/analyzer/test/generated/java_core_test.dart
index f98895e..9571c87 100644
--- a/pkg/analyzer/test/generated/java_core_test.dart
+++ b/pkg/analyzer/test/generated/java_core_test.dart
@@ -5,12 +5,9 @@
 library analyzer.test.generated.java_core_test;
 
 import 'package:analyzer/src/generated/java_core.dart';
-import 'package:unittest/unittest.dart';
-
-import '../utils.dart';
+import 'package:test/test.dart';
 
 main() {
-  initializeTestEnvironment();
   group('Character', () {
     group('isLetter', () {
       test('digits', () {
diff --git a/pkg/analyzer/test/generated/java_io_test.dart b/pkg/analyzer/test/generated/java_io_test.dart
index 0316817..c844cda 100644
--- a/pkg/analyzer/test/generated/java_io_test.dart
+++ b/pkg/analyzer/test/generated/java_io_test.dart
@@ -5,34 +5,32 @@
 library analyzer.test.generated.java_io_test;
 
 import 'package:analyzer/src/generated/java_io.dart';
-import 'package:unittest/unittest.dart';
-
-import '../utils.dart';
+import 'package:path/path.dart' as path;
+import 'package:test/test.dart';
 
 main() {
-  initializeTestEnvironment();
   group('JavaFile', () {
     group('toURI', () {
       test('forAbsolute', () {
         String tempPath = '/temp';
-        String path = JavaFile.pathContext.join(tempPath, 'foo.dart');
+        String absolutePath = path.context.join(tempPath, 'foo.dart');
         // we use an absolute path
-        expect(JavaFile.pathContext.isAbsolute(path), isTrue,
-            reason: '"$path" is not absolute');
+        expect(path.context.isAbsolute(absolutePath), isTrue,
+            reason: '"$absolutePath" is not absolute');
         // test that toURI() returns an absolute URI
-        Uri uri = new JavaFile(path).toURI();
+        Uri uri = new JavaFile(absolutePath).toURI();
         expect(uri.isAbsolute, isTrue);
         expect(uri.scheme, 'file');
       });
       test('forRelative', () {
         String tempPath = '/temp';
-        String path = JavaFile.pathContext.join(tempPath, 'foo.dart');
-        expect(JavaFile.pathContext.isAbsolute(path), isTrue,
-            reason: '"$path" is not absolute');
+        String absolutePath = path.context.join(tempPath, 'foo.dart');
+        expect(path.context.isAbsolute(absolutePath), isTrue,
+            reason: '"$absolutePath" is not absolute');
         // prepare a relative path
         // We should not check that "relPath" is actually relative -
         // it may be not on Windows, if "temp" is on other disk.
-        String relPath = JavaFile.pathContext.relative(path);
+        String relPath = path.context.relative(absolutePath);
         // test that toURI() returns an absolute URI
         Uri uri = new JavaFile(relPath).toURI();
         expect(uri.isAbsolute, isTrue);
diff --git a/pkg/analyzer/test/generated/non_error_resolver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_test.dart
index 6dd2519..067627d 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart
@@ -11,16 +11,16 @@
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode;
 import 'package:analyzer/src/generated/source_io.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../utils.dart';
 import 'resolver_test_case.dart';
 import 'test_support.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(NonErrorResolverTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(NonErrorResolverTest);
+  });
 }
 
 @reflectiveTest
@@ -36,6 +36,28 @@
     verify([source]);
   }
 
+  void
+      test_abstractSuperMemberReference_superHasConcrete_mixinHasAbstract_method() {
+    Source source = addSource('''
+class A {
+  void method() {}
+}
+
+abstract class B {
+  void method();
+}
+
+class C extends A with B {
+  void method() {
+    super.method();
+  }
+}
+''');
+    computeLibrarySourceErrors(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
   void test_abstractSuperMemberReference_superHasNoSuchMethod() {
     Source source = addSource('''
 abstract class A {
@@ -1709,6 +1731,19 @@
     verify([source]);
   }
 
+  void test_duplicatePart() {
+    addNamedSource('/part1.dart', 'part of lib;');
+    addNamedSource('/part2.dart', 'part of lib;');
+    Source source = addSource(r'''
+library lib;
+part 'part1.dart';
+part 'part2.dart';
+''');
+    computeLibrarySourceErrors(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
   void test_dynamicIdentifier() {
     Source source = addSource(r'''
 main() {
@@ -3705,6 +3740,18 @@
     verify([source]);
   }
 
+  void test_nativeConstConstructor() {
+    Source source = addSource(r'''
+import 'dart-ext:x';
+class Foo {
+  const Foo() native 'Foo_Foo';
+  const factory Foo.foo() native 'Foo_Foo_foo';
+}''');
+    computeLibrarySourceErrors(source);
+    assertNoErrors(source);
+    // Cannot verify the AST because the import's URI cannot be resolved.
+  }
+
   void test_nativeFunctionBodyInNonSDKCode_function() {
     Source source = addSource(r'''
 import 'dart-ext:x';
diff --git a/pkg/analyzer/test/generated/non_hint_code_test.dart b/pkg/analyzer/test/generated/non_hint_code_test.dart
index b023ed5..2ef678b 100644
--- a/pkg/analyzer/test/generated/non_hint_code_test.dart
+++ b/pkg/analyzer/test/generated/non_hint_code_test.dart
@@ -6,19 +6,37 @@
 
 import 'package:analyzer/error/error.dart';
 import 'package:analyzer/src/error/codes.dart';
+import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source_io.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../utils.dart';
 import 'resolver_test_case.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(NonHintCodeTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(NonHintCodeTest);
+  });
 }
 
 @reflectiveTest
 class NonHintCodeTest extends ResolverTestCase {
+  void test_() {
+    resetWithOptions(new AnalysisOptionsImpl()..enableSuperMixins = true);
+    Source source = addSource(r'''
+abstract class A {
+  void test();
+}
+class B extends A {
+  void test() {
+    super.test;
+  }
+}
+''');
+    computeLibrarySourceErrors(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
   void test_deadCode_afterTryCatch() {
     Source source = addSource('''
 main() {
@@ -392,7 +410,7 @@
 library root;
 import 'lib1.dart' deferred as lib1;
 main() { lib1.f(); }'''
-    ], ErrorCode.EMPTY_LIST);
+    ], const <ErrorCode>[]);
   }
 
   void test_issue20904BuggyTypePromotionAtIfJoin_1() {
diff --git a/pkg/analyzer/test/generated/package_test.dart b/pkg/analyzer/test/generated/package_test.dart
index d138acd..03cceff 100644
--- a/pkg/analyzer/test/generated/package_test.dart
+++ b/pkg/analyzer/test/generated/package_test.dart
@@ -5,24 +5,23 @@
 library analyzer.test.generated.package_test;
 
 import 'package:analyzer/file_system/file_system.dart';
-import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/package.dart';
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:package_config/packages.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../src/context/mock_sdk.dart';
-import '../utils.dart';
 import 'resolver_test_case.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(DependencyFinderTest);
-  defineReflectiveTests(PackageDescriptionTest);
-  defineReflectiveTests(PackageManagerTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(DependencyFinderTest);
+    defineReflectiveTests(PackageDescriptionTest);
+    defineReflectiveTests(PackageManagerTest);
+  });
 }
 
 /**
@@ -32,20 +31,10 @@
 
 @reflectiveTest
 class DependencyFinderTest extends ResolverTestCase {
-  /**
-   * The resource provider to be used by tests.
-   */
-  MemoryResourceProvider resourceProvider;
-
-  @override
-  void setUp() {
-    resourceProvider = new MemoryResourceProvider();
-  }
-
   void test_transitiveDependenciesFor_circularDependencies() {
-    String packageA = '/pub-cache/a-1.0';
-    String packageB = '/pub-cache/b-1.0';
-    String packageC = '/pub-cache/c-1.0';
+    String packageA = resourceProvider.convertPath('/pub-cache/a-1.0');
+    String packageB = resourceProvider.convertPath('/pub-cache/b-1.0');
+    String packageC = resourceProvider.convertPath('/pub-cache/c-1.0');
     resourceProvider.newFile(
         '$packageA/$pubspecName',
         '''
@@ -101,10 +90,10 @@
   }
 
   void test_transitiveDependenciesFor_overlappingDependencies() {
-    String packageA = '/pub-cache/a-1.0';
-    String packageB = '/pub-cache/b-1.0';
-    String packageC = '/pub-cache/c-1.0';
-    String packageD = '/pub-cache/d-1.0';
+    String packageA = resourceProvider.convertPath('/pub-cache/a-1.0');
+    String packageB = resourceProvider.convertPath('/pub-cache/b-1.0');
+    String packageC = resourceProvider.convertPath('/pub-cache/c-1.0');
+    String packageD = resourceProvider.convertPath('/pub-cache/d-1.0');
     resourceProvider.newFile(
         '$packageA/$pubspecName',
         '''
@@ -139,9 +128,9 @@
   }
 
   void test_transitiveDependenciesFor_simpleDependencies() {
-    String packageA = '/pub-cache/a-1.0';
-    String packageB = '/pub-cache/b-1.0';
-    String packageC = '/pub-cache/c-1.0';
+    String packageA = resourceProvider.convertPath('/pub-cache/a-1.0');
+    String packageB = resourceProvider.convertPath('/pub-cache/b-1.0');
+    String packageC = resourceProvider.convertPath('/pub-cache/c-1.0');
     resourceProvider.newFile(
         '$packageA/$pubspecName',
         '''
@@ -171,7 +160,8 @@
     DartSdk sdk = new MockSdk();
     AnalysisOptionsImpl options1 = new AnalysisOptionsImpl();
     AnalysisOptionsImpl options2 = new AnalysisOptionsImpl();
-    options2.enableGenericMethods = !options1.enableGenericMethods;
+    options2.enableLazyAssignmentOperators =
+        !options1.enableLazyAssignmentOperators;
     PackageDescription first = new PackageDescription(packageId, sdk, options1);
     PackageDescription second =
         new PackageDescription(packageId, sdk, options2);
@@ -212,21 +202,11 @@
 
 @reflectiveTest
 class PackageManagerTest extends ResolverTestCase {
-  /**
-   * The resource provider to be used by tests.
-   */
-  MemoryResourceProvider resourceProvider;
-
-  @override
-  void setUp() {
-    resourceProvider = new MemoryResourceProvider();
-  }
-
   void test_getContext() {
-    String packageA = '/pub-cache/a-1.0';
-    String packageB1 = '/pub-cache/b-1.0';
-    String packageB2 = '/pub-cache/b-2.0';
-    String packageC = '/pub-cache/c-1.0';
+    String packageA = resourceProvider.convertPath('/pub-cache/a-1.0');
+    String packageB1 = resourceProvider.convertPath('/pub-cache/b-1.0');
+    String packageB2 = resourceProvider.convertPath('/pub-cache/b-2.0');
+    String packageC = resourceProvider.convertPath('/pub-cache/c-1.0');
     resourceProvider.newFile(
         '$packageA/$pubspecName',
         '''
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index fa7e4e6..87feeb2 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -8,26 +8,28 @@
 import 'package:analyzer/dart/ast/token.dart';
 import 'package:analyzer/dart/ast/visitor.dart';
 import 'package:analyzer/error/error.dart';
+import 'package:analyzer/error/listener.dart';
 import 'package:analyzer/src/dart/ast/token.dart';
 import 'package:analyzer/src/dart/scanner/reader.dart';
 import 'package:analyzer/src/dart/scanner/scanner.dart';
 import 'package:analyzer/src/generated/parser.dart';
-import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
 import 'package:analyzer/src/generated/testing/token_factory.dart';
 import 'package:analyzer/src/generated/utilities_dart.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart' hide Configuration;
 
-import '../utils.dart';
 import 'test_support.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ComplexParserTest);
-  defineReflectiveTests(ErrorParserTest);
-  defineReflectiveTests(NonErrorParserTest);
-  defineReflectiveTests(RecoveryParserTest);
-  defineReflectiveTests(SimpleParserTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ComplexParserTest);
+    defineReflectiveTests(ErrorParserTest);
+    defineReflectiveTests(NonErrorParserTest);
+    defineReflectiveTests(RecoveryParserTest);
+    defineReflectiveTests(SimpleParserTest);
+  });
 }
 
 /**
@@ -199,7 +201,6 @@
   }
 
   void test_assignableExpression_arguments_normal_chain_typeArguments() {
-    enableGenericMethods = true;
     _validate_assignableExpression_arguments_normal_chain_typeArguments(
         "a<E>(b)<F>(c).d<G>(e).f");
   }
@@ -530,7 +531,6 @@
   }
 
   void test_topLevelFunction_nestedGenericFunction() {
-    enableGenericMethods = true;
     parseCompilationUnitWithOptions('''
 void f() {
   void g<T>() {
@@ -1681,7 +1681,6 @@
     // Regression test for https://github.com/dart-lang/sdk/issues/25739.
 
     // TODO(jmesserly): ideally we'd be better at parser recovery here.
-    enableGenericMethods = true;
     createParser('f<E>(E extends num p);');
     ClassMember member = parser.parseClassMember('C');
     expectNotNullIfNoErrors(member);
@@ -1727,7 +1726,6 @@
     // It doesn't try to advance past the invalid token `!` to find the
     // valid `>`. If it did we'd get less cascading errors, at least for this
     // particular example.
-    enableGenericMethods = true;
     createParser('void m<E, hello!>() {}');
     ClassMember member = parser.parseClassMember('C');
     expectNotNullIfNoErrors(member);
@@ -1920,13 +1918,6 @@
         [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN]);
   }
 
-  void test_missingIdentifier_functionDeclaration_returnTypeWithoutName() {
-    createParser('A<T> () {}');
-    Statement statement = parser.parseFunctionDeclarationStatement();
-    expectNotNullIfNoErrors(statement);
-    listener.assertErrorsWithCodes([ParserErrorCode.MISSING_IDENTIFIER]);
-  }
-
   void test_missingIdentifier_inEnum() {
     createParser('enum E {, TWO}');
     EnumDeclaration declaration =
@@ -2164,6 +2155,8 @@
     expectNotNullIfNoErrors(list);
     listener
         .assertErrorsWithCodes([ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP]);
+    expect(list.parameters[0].kind, ParameterKind.REQUIRED);
+    expect(list.parameters[1].kind, ParameterKind.NAMED);
   }
 
   void test_nonConstructorFactory_field() {
@@ -2265,7 +2258,6 @@
   }
 
   void test_parseCascadeSection_missingIdentifier_typeArguments() {
-    enableGenericMethods = true;
     createParser('..<E>()');
     MethodInvocation methodInvocation = parser.parseCascadeSection();
     expectNotNullIfNoErrors(methodInvocation);
@@ -2290,6 +2282,8 @@
     expectNotNullIfNoErrors(list);
     listener.assertErrorsWithCodes(
         [ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP]);
+    expect(list.parameters[0].kind, ParameterKind.REQUIRED);
+    expect(list.parameters[1].kind, ParameterKind.POSITIONAL);
   }
 
   void test_redirectingConstructorWithBody_named() {
@@ -2770,14 +2764,6 @@
     listener.assertErrorsWithCodes([ParserErrorCode.WITH_WITHOUT_EXTENDS]);
   }
 
-  void test_wrongSeparatorForNamedParameter() {
-    createParser('(a, {b = 0})');
-    FormalParameterList list = parser.parseFormalParameterList();
-    expectNotNullIfNoErrors(list);
-    listener.assertErrorsWithCodes(
-        [ParserErrorCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER]);
-  }
-
   void test_wrongSeparatorForPositionalParameter() {
     createParser('(a, [b : 0])');
     FormalParameterList list = parser.parseFormalParameterList();
@@ -2843,12 +2829,6 @@
   bool parseAsync = true;
 
   /**
-   * A flag indicating whether generic method support should be enabled for a
-   * specific test.
-   */
-  bool enableGenericMethods = false;
-
-  /**
    * Whether generic method comments should be enabled for the test.
    */
   bool enableGenericMethodComments = false;
@@ -2866,6 +2846,12 @@
   bool enableNnbd = false;
 
   /**
+   * A flag indicating whether the parser is to parse part-of directives that
+   * specify a URI rather than a library name.
+   */
+  bool enableUriInPartOf = false;
+
+  /**
    * The error listener to which scanner and parser errors will be reported.
    *
    * This field is typically initialized by invoking [createParser].
@@ -2912,10 +2898,10 @@
     //
     parser = new Parser(source, listener);
     parser.enableAssertInitializer = enableAssertInitializer;
-    parser.parseGenericMethods = enableGenericMethods;
     parser.parseGenericMethodComments = enableGenericMethodComments;
     parser.parseFunctionBodies = parseFunctionBodies;
     parser.enableNnbd = enableNnbd;
+    parser.enableUriInPartOf = enableUriInPartOf;
     parser.currentToken = tokenStream;
   }
 
@@ -2939,7 +2925,7 @@
    * match those that are expected, or if the result would have been `null`.
    */
   CompilationUnit parseCompilationUnitWithOptions(String source,
-      [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST]) {
+      [List<ErrorCode> errorCodes = const <ErrorCode>[]]) {
     createParser(source);
     CompilationUnit unit = parser.parseCompilationUnit2();
     expect(unit, isNotNull);
@@ -2957,7 +2943,7 @@
    *           not match those that are expected, or if the result would have been `null`
    */
   Expression parseExpression(String source,
-      [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST]) {
+      [List<ErrorCode> errorCodes = const <ErrorCode>[]]) {
     createParser(source);
     Expression expression = parser.parseExpression2();
     expectNotNullIfNoErrors(expression);
@@ -2981,7 +2967,7 @@
    *           not match those that are expected, or if the result would have been `null`
    */
   static CompilationUnit parseCompilationUnit(String source,
-      [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST]) {
+      [List<ErrorCode> errorCodes = const <ErrorCode>[]]) {
     GatheringErrorListener listener = new GatheringErrorListener();
     Scanner scanner =
         new Scanner(null, new CharSequenceReader(source), listener);
@@ -2995,13 +2981,27 @@
   }
 
   /**
+   * Parse the given [code] as a compilation unit.
+   */
+  static CompilationUnit parseCompilationUnit2(String code,
+      {AnalysisErrorListener listener}) {
+    listener ??= AnalysisErrorListener.NULL_LISTENER;
+    Scanner scanner = new Scanner(null, new CharSequenceReader(code), listener);
+    Token token = scanner.tokenize();
+    Parser parser = new Parser(null, listener);
+    CompilationUnit unit = parser.parseCompilationUnit(token);
+    unit.lineInfo = new LineInfo(scanner.lineStarts);
+    return unit;
+  }
+
+  /**
    * Parse the given [source] as a statement. The [errorCodes] are the error
    * codes of the errors that are expected to be found. If
    * [enableLazyAssignmentOperators] is `true`, then lazy assignment operators
    * should be enabled.
    */
   static Statement parseStatement(String source,
-      [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST,
+      [List<ErrorCode> errorCodes = const <ErrorCode>[],
       bool enableLazyAssignmentOperators]) {
     GatheringErrorListener listener = new GatheringErrorListener();
     Scanner scanner =
@@ -3028,7 +3028,7 @@
    *           are expected, or if the result would have been `null`
    */
   static List<Statement> parseStatements(String source, int expectedCount,
-      [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST]) {
+      [List<ErrorCode> errorCodes = const <ErrorCode>[]]) {
     GatheringErrorListener listener = new GatheringErrorListener();
     Scanner scanner =
         new Scanner(null, new CharSequenceReader(source), listener);
@@ -3114,6 +3114,14 @@
         BinaryExpression, expression.leftOperand);
   }
 
+  void test_assignableSelector() {
+    IndexExpression expression =
+        parseExpression("a.b[]", [ParserErrorCode.MISSING_IDENTIFIER]);
+    Expression index = expression.index;
+    expect(index, new isInstanceOf<SimpleIdentifier>());
+    expect(index.isSynthetic, isTrue);
+  }
+
   void test_assignmentExpression_missing_compound1() {
     AssignmentExpression expression =
         parseExpression("= y = 0", [ParserErrorCode.MISSING_IDENTIFIER]);
@@ -4406,12 +4414,10 @@
   }
 
   void test_isFunctionDeclaration_nameButNoReturn_typeParameters_block() {
-    enableGenericMethods = true;
     expect(_isFunctionDeclaration("f<E>() {}"), isTrue);
   }
 
   void test_isFunctionDeclaration_nameButNoReturn_typeParameters_expression() {
-    enableGenericMethods = true;
     expect(_isFunctionDeclaration("f<E>() => e"), isTrue);
   }
 
@@ -4424,12 +4430,10 @@
   }
 
   void test_isFunctionDeclaration_normalReturn_typeParameters_block() {
-    enableGenericMethods = true;
     expect(_isFunctionDeclaration("C f<E>() {}"), isTrue);
   }
 
   void test_isFunctionDeclaration_normalReturn_typeParameters_expression() {
-    enableGenericMethods = true;
     expect(_isFunctionDeclaration("C f<E>() => e"), isTrue);
   }
 
@@ -4442,12 +4446,10 @@
   }
 
   void test_isFunctionDeclaration_voidReturn_typeParameters_block() {
-    enableGenericMethods = true;
     expect(_isFunctionDeclaration("void f<E>() {}"), isTrue);
   }
 
   void test_isFunctionDeclaration_voidReturn_typeParameters_expression() {
-    enableGenericMethods = true;
     expect(_isFunctionDeclaration("void f<E>() => e"), isTrue);
   }
 
@@ -4468,12 +4470,10 @@
   }
 
   void test_isFunctionExpression_noParameters_typeParameters_block() {
-    enableGenericMethods = true;
     expect(_isFunctionExpression("<E>() {}"), isTrue);
   }
 
   void test_isFunctionExpression_noParameters_typeParameters_expression() {
-    enableGenericMethods = true;
     expect(_isFunctionExpression("<E>() => e"), isTrue);
   }
 
@@ -4852,7 +4852,6 @@
   }
 
   void test_parseAssignableExpression_expression_args_dot_typeParameters() {
-    enableGenericMethods = true;
     createParser('(x)<F>(y).z');
     Expression expression = parser.parseAssignableExpression(false);
     expectNotNullIfNoErrors(expression);
@@ -4954,7 +4953,6 @@
   }
 
   void test_parseAssignableExpression_identifier_args_dot_typeParameters() {
-    enableGenericMethods = true;
     createParser('x<E>(y).z');
     Expression expression = parser.parseAssignableExpression(false);
     expectNotNullIfNoErrors(expression);
@@ -5307,7 +5305,6 @@
   }
 
   void test_parseCascadeSection_ia_typeArguments() {
-    enableGenericMethods = true;
     createParser('..[i]<E>(b)');
     Expression expression = parser.parseCascadeSection();
     expectNotNullIfNoErrors(expression);
@@ -5351,7 +5348,6 @@
   }
 
   void test_parseCascadeSection_ii_typeArguments() {
-    enableGenericMethods = true;
     createParser('..a<E>(b).c<F>(d)');
     Expression expression = parser.parseCascadeSection();
     expectNotNullIfNoErrors(expression);
@@ -5421,7 +5417,6 @@
   }
 
   void test_parseCascadeSection_p_assign_withCascade_typeArguments() {
-    enableGenericMethods = true;
     createParser('..a = 3..m<E>()');
     Expression expression = parser.parseCascadeSection();
     expectNotNullIfNoErrors(expression);
@@ -5479,7 +5474,6 @@
   }
 
   void test_parseCascadeSection_pa_typeArguments() {
-    enableGenericMethods = true;
     createParser('..a<E>(b)');
     Expression expression = parser.parseCascadeSection();
     expectNotNullIfNoErrors(expression);
@@ -5522,7 +5516,6 @@
   }
 
   void test_parseCascadeSection_paa_typeArguments() {
-    enableGenericMethods = true;
     createParser('..a<E>(b)<F>(c)');
     Expression expression = parser.parseCascadeSection();
     expectNotNullIfNoErrors(expression);
@@ -5563,7 +5556,6 @@
   }
 
   void test_parseCascadeSection_paapaa_typeArguments() {
-    enableGenericMethods = true;
     createParser('..a<E>(b)<F>(c).d<G>(e)<H>(f)');
     Expression expression = parser.parseCascadeSection();
     expectNotNullIfNoErrors(expression);
@@ -5602,7 +5594,6 @@
   }
 
   void test_parseCascadeSection_pap_typeArguments() {
-    enableGenericMethods = true;
     createParser('..a<E>(b).c');
     Expression expression = parser.parseCascadeSection();
     expectNotNullIfNoErrors(expression);
@@ -6103,7 +6094,6 @@
   }
 
   void test_parseClassMember_method_generic_noReturnType() {
-    enableGenericMethods = true;
     createParser('m<T>() {}');
     ClassMember member = parser.parseClassMember('C');
     expectNotNullIfNoErrors(member);
@@ -6123,7 +6113,6 @@
   }
 
   void test_parseClassMember_method_generic_returnType() {
-    enableGenericMethods = true;
     createParser('T m<T>() {}');
     ClassMember member = parser.parseClassMember('C');
     expectNotNullIfNoErrors(member);
@@ -6143,7 +6132,6 @@
   }
 
   void test_parseClassMember_method_generic_void() {
-    enableGenericMethods = true;
     createParser('void m<T>() {}');
     ClassMember member = parser.parseClassMember('C');
     expectNotNullIfNoErrors(member);
@@ -7333,7 +7321,6 @@
   }
 
   void test_parseCompilationUnitMember_function_generic_noReturnType() {
-    enableGenericMethods = true;
     createParser('f<E>() {}');
     CompilationUnitMember member =
         parser.parseCompilationUnitMember(emptyCommentAndMetadata());
@@ -7347,7 +7334,6 @@
 
   void
       test_parseCompilationUnitMember_function_generic_noReturnType_annotated() {
-    enableGenericMethods = true;
     createParser('f<@a E>() {}');
     CompilationUnitMember member =
         parser.parseCompilationUnitMember(emptyCommentAndMetadata());
@@ -7360,7 +7346,6 @@
   }
 
   void test_parseCompilationUnitMember_function_generic_returnType() {
-    enableGenericMethods = true;
     createParser('E f<E>() {}');
     CompilationUnitMember member =
         parser.parseCompilationUnitMember(emptyCommentAndMetadata());
@@ -7373,7 +7358,6 @@
   }
 
   void test_parseCompilationUnitMember_function_generic_void() {
-    enableGenericMethods = true;
     createParser('void f<T>(T t) {}');
     CompilationUnitMember member =
         parser.parseCompilationUnitMember(emptyCommentAndMetadata());
@@ -7825,7 +7809,12 @@
     expect(member, new isInstanceOf<ConstructorDeclaration>());
     ConstructorDeclaration constructor = member as ConstructorDeclaration;
     NodeList<ConstructorInitializer> initializers = constructor.initializers;
-    expect(initializers, hasLength(2));
+    expect(initializers, hasLength(3));
+    ConstructorInitializer initializer = initializers[1];
+    expect(initializer, new isInstanceOf<AssertInitializer>());
+    AssertInitializer assertInitializer = initializer;
+    expect(assertInitializer.condition, isNotNull);
+    expect(assertInitializer.message, isNull);
   }
 
   void test_parseConstructor_with_pseudo_function_literal() {
@@ -8392,7 +8381,6 @@
   }
 
   void test_parseExpression_superMethodInvocation_typeArguments() {
-    enableGenericMethods = true;
     Expression expression = parseExpression('super.m<E>()');
     expect(expression, new isInstanceOf<MethodInvocation>());
     MethodInvocation invocation = expression;
@@ -8475,7 +8463,6 @@
 
   void
       test_parseExpressionWithoutCascade_superMethodInvocation_typeArguments() {
-    enableGenericMethods = true;
     createParser('super.m<E>()');
     Expression expression = parser.parseExpressionWithoutCascade();
     expectNotNullIfNoErrors(expression);
@@ -9448,7 +9435,6 @@
   }
 
   void test_parseFunctionDeclaration_functionWithTypeParameters() {
-    enableGenericMethods = true;
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
     createParser('f<E>() {}');
@@ -9550,7 +9536,6 @@
   }
 
   void test_parseFunctionDeclarationStatement_typeParameters() {
-    enableGenericMethods = true;
     createParser('E f<E>(E p) => p * 2;');
     FunctionDeclarationStatement statement =
         parser.parseFunctionDeclarationStatement();
@@ -9561,6 +9546,17 @@
         isNotNull);
   }
 
+  void test_parseFunctionDeclarationStatement_typeParameters_noReturnType() {
+    createParser('f<E>(E p) => p * 2;');
+    FunctionDeclarationStatement statement =
+        parser.parseFunctionDeclarationStatement();
+    expectNotNullIfNoErrors(statement);
+    listener.assertNoErrors();
+    expect(statement.functionDeclaration, isNotNull);
+    expect(statement.functionDeclaration.functionExpression.typeParameters,
+        isNotNull);
+  }
+
   void test_parseFunctionExpression_body_inExpression() {
     createParser('(int i) => i++');
     FunctionExpression expression = parser.parseFunctionExpression();
@@ -9587,7 +9583,6 @@
   }
 
   void test_parseFunctionExpression_typeParameters() {
-    enableGenericMethods = true;
     createParser('<E>(E i) => i++');
     FunctionExpression expression = parser.parseFunctionExpression();
     expectNotNullIfNoErrors(expression);
@@ -10332,8 +10327,8 @@
 
   void test_parseMapLiteral_empty() {
     Token token = TokenFactory.tokenFromKeyword(Keyword.CONST);
-    TypeArgumentList typeArguments = AstFactory.typeArgumentList(
-        [AstFactory.typeName4("String"), AstFactory.typeName4("int")]);
+    TypeArgumentList typeArguments = AstTestFactory.typeArgumentList(
+        [AstTestFactory.typeName4("String"), AstTestFactory.typeName4("int")]);
     createParser('{}');
     MapLiteral literal = parser.parseMapLiteral(token, typeArguments);
     expectNotNullIfNoErrors(literal);
@@ -10831,7 +10826,6 @@
   }
 
   void test_parseNormalFormalParameter_function_noType_typeParameters() {
-    enableGenericMethods = true;
     createParser('a<E>())');
     NormalFormalParameter parameter = parser.parseNormalFormalParameter();
     expectNotNullIfNoErrors(parameter);
@@ -10848,7 +10842,6 @@
 
   void
       test_parseNormalFormalParameter_function_noType_typeParameters_nullable() {
-    enableGenericMethods = true;
     enableNnbd = true;
     createParser('a<E>()?)');
     NormalFormalParameter parameter = parser.parseNormalFormalParameter();
@@ -10908,7 +10901,6 @@
   }
 
   void test_parseNormalFormalParameter_function_type_typeParameters() {
-    enableGenericMethods = true;
     createParser('A a<E>())');
     NormalFormalParameter parameter = parser.parseNormalFormalParameter();
     expectNotNullIfNoErrors(parameter);
@@ -10923,7 +10915,6 @@
   }
 
   void test_parseNormalFormalParameter_function_type_typeParameters_nullable() {
-    enableGenericMethods = true;
     enableNnbd = true;
     createParser('A a<E>()?)');
     NormalFormalParameter parameter = parser.parseNormalFormalParameter();
@@ -10983,7 +10974,6 @@
   }
 
   void test_parseNormalFormalParameter_function_void_typeParameters() {
-    enableGenericMethods = true;
     createParser('void a<E>())');
     NormalFormalParameter parameter = parser.parseNormalFormalParameter();
     expectNotNullIfNoErrors(parameter);
@@ -10998,7 +10988,6 @@
   }
 
   void test_parseNormalFormalParameter_function_void_typeParameters_nullable() {
-    enableGenericMethods = true;
     enableNnbd = true;
     createParser('void a<E>()?)');
     NormalFormalParameter parameter = parser.parseNormalFormalParameter();
@@ -11109,7 +11098,7 @@
     // TODO(brianwilkerson) Implement tests for this method.
   }
 
-  void test_parsePartDirective_part() {
+  void test_parsePartDirective() {
     createParser("part 'lib/lib.dart';");
     PartDirective directive =
         parser.parsePartOrPartOfDirective(emptyCommentAndMetadata());
@@ -11120,15 +11109,27 @@
     expect(directive.semicolon, isNotNull);
   }
 
-  void test_parsePartDirective_partOf() {
-    createParser('part of l;');
+  void test_parsePartOfDirective_name() {
+    enableUriInPartOf = true;
+    createParser("part of l;");
     PartOfDirective directive =
         parser.parsePartOrPartOfDirective(emptyCommentAndMetadata());
-    expectNotNullIfNoErrors(directive);
-    listener.assertNoErrors();
     expect(directive.partKeyword, isNotNull);
     expect(directive.ofKeyword, isNotNull);
     expect(directive.libraryName, isNotNull);
+    expect(directive.uri, isNull);
+    expect(directive.semicolon, isNotNull);
+  }
+
+  void test_parsePartOfDirective_uri() {
+    enableUriInPartOf = true;
+    createParser("part of 'lib.dart';");
+    PartOfDirective directive =
+        parser.parsePartOrPartOfDirective(emptyCommentAndMetadata());
+    expect(directive.partKeyword, isNotNull);
+    expect(directive.ofKeyword, isNotNull);
+    expect(directive.libraryName, isNull);
+    expect(directive.uri, isNotNull);
     expect(directive.semicolon, isNotNull);
   }
 
@@ -11213,7 +11214,6 @@
 
   void
       test_parsePostfixExpression_none_methodInvocation_question_dot_typeArguments() {
-    enableGenericMethods = true;
     createParser('a?.m<E>()');
     Expression expression = parser.parsePostfixExpression();
     expectNotNullIfNoErrors(expression);
@@ -11244,7 +11244,6 @@
   }
 
   void test_parsePostfixExpression_none_methodInvocation_typeArguments() {
-    enableGenericMethods = true;
     createParser('a.m<E>()');
     Expression expression = parser.parsePostfixExpression();
     expectNotNullIfNoErrors(expression);
@@ -11347,6 +11346,16 @@
     expect(functionExpression.body, isNotNull);
   }
 
+  void test_parsePrimaryExpression_genericFunctionExpression() {
+    createParser('<X, Y>(Map<X, Y> m, X x) => m[x]');
+    Expression expression = parser.parsePrimaryExpression();
+    expectNotNullIfNoErrors(expression);
+    listener.assertNoErrors();
+    expect(expression, new isInstanceOf<FunctionExpression>());
+    FunctionExpression function = expression;
+    expect(function.typeParameters, isNotNull);
+  }
+
   void test_parsePrimaryExpression_hex() {
     String hexLiteral = "3F";
     createParser('0x$hexLiteral');
@@ -11850,9 +11859,7 @@
         isNotNull);
   }
 
-  @failingTest
   void test_parseStatement_functionDeclaration_noReturnType_typeParameters() {
-    enableGenericMethods = true;
     createParser('f<E>(a, b) {};');
     Statement statement = parser.parseStatement2();
     expectNotNullIfNoErrors(statement);
@@ -11874,7 +11881,6 @@
   }
 
   void test_parseStatement_functionDeclaration_returnType_typeParameters() {
-    enableGenericMethods = true;
     createParser('int f<E>(a, b) {};');
     Statement statement = parser.parseStatement2();
     expectNotNullIfNoErrors(statement);
@@ -13440,7 +13446,7 @@
    *           not match those that are expected, or if the result would have been `null`
    */
   CompilationUnit _parseDirectives(String source,
-      [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST]) {
+      [List<ErrorCode> errorCodes = const <ErrorCode>[]]) {
     createParser(source);
     CompilationUnit unit = parser.parseDirectives2();
     expect(unit, isNotNull);
diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart
index 1abacd6..416f980 100644
--- a/pkg/analyzer/test/generated/resolver_test.dart
+++ b/pkg/analyzer/test/generated/resolver_test.dart
@@ -12,6 +12,7 @@
 import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer/dart/element/type.dart';
 import 'package:analyzer/file_system/memory_file_system.dart';
+import 'package:analyzer/src/dart/element/builder.dart';
 import 'package:analyzer/src/dart/element/element.dart';
 import 'package:analyzer/src/dart/element/type.dart';
 import 'package:analyzer/src/error/codes.dart';
@@ -19,35 +20,36 @@
 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode;
 import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/source_io.dart';
-import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
 import 'package:analyzer/src/generated/testing/element_factory.dart';
 import 'package:analyzer/src/generated/testing/test_type_provider.dart';
 import 'package:analyzer/src/generated/utilities_dart.dart';
 import 'package:analyzer/src/source/source_resource.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../utils.dart';
 import 'analysis_context_factory.dart';
+import 'parser_test.dart';
 import 'resolver_test_case.dart';
 import 'test_support.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AnalysisDeltaTest);
-  defineReflectiveTests(ChangeSetTest);
-  defineReflectiveTests(EnclosedScopeTest);
-  defineReflectiveTests(ErrorResolverTest);
-  defineReflectiveTests(LibraryImportScopeTest);
-  defineReflectiveTests(LibraryScopeTest);
-  defineReflectiveTests(PrefixedNamespaceTest);
-  defineReflectiveTests(ScopeTest);
-  defineReflectiveTests(StrictModeTest);
-  defineReflectiveTests(SubtypeManagerTest);
-  defineReflectiveTests(TypeOverrideManagerTest);
-  defineReflectiveTests(TypePropagationTest);
-  defineReflectiveTests(TypeProviderImplTest);
-  defineReflectiveTests(TypeResolverVisitorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisDeltaTest);
+    defineReflectiveTests(ChangeSetTest);
+    defineReflectiveTests(EnclosedScopeTest);
+    defineReflectiveTests(ErrorResolverTest);
+    defineReflectiveTests(LibraryImportScopeTest);
+    defineReflectiveTests(LibraryScopeTest);
+    defineReflectiveTests(PrefixedNamespaceTest);
+    defineReflectiveTests(ScopeTest);
+    defineReflectiveTests(StrictModeTest);
+    defineReflectiveTests(SubtypeManagerTest);
+    defineReflectiveTests(TypeOverrideManagerTest);
+    defineReflectiveTests(TypePropagationTest);
+    defineReflectiveTests(TypeProviderImplTest);
+    defineReflectiveTests(TypeResolverVisitorTest);
+  });
 }
 
 @reflectiveTest
@@ -145,7 +147,7 @@
   void test_define_duplicate() {
     Scope rootScope = new _RootScope();
     EnclosedScope scope = new EnclosedScope(rootScope);
-    SimpleIdentifier identifier = AstFactory.identifier3('v');
+    SimpleIdentifier identifier = AstTestFactory.identifier3('v');
     VariableElement element1 = ElementFactory.localVariableElement(identifier);
     VariableElement element2 = ElementFactory.localVariableElement(identifier);
     scope.define(element1);
@@ -222,13 +224,6 @@
  */
 @reflectiveTest
 class GenericMethodResolverTest extends StaticTypeAnalyzer2TestShared {
-  void setUp() {
-    super.setUp();
-    AnalysisOptionsImpl options = new AnalysisOptionsImpl();
-    options.enableGenericMethods = true;
-    resetWithOptions(options);
-  }
-
   void test_genericMethod_propagatedType_promotion() {
     // Regression test for:
     // https://github.com/dart-lang/sdk/issues/25340
@@ -262,8 +257,8 @@
   void test_creation_nonEmpty() {
     AnalysisContext context = AnalysisContextFactory.contextWithCore();
     String importedTypeName = "A";
-    ClassElement importedType =
-        new ClassElementImpl.forNode(AstFactory.identifier3(importedTypeName));
+    ClassElement importedType = new ClassElementImpl.forNode(
+        AstTestFactory.identifier3(importedTypeName));
     LibraryElement importedLibrary = createTestLibrary(context, "imported");
     (importedLibrary.definingCompilationUnit as CompilationUnitElementImpl)
         .types = <ClassElement>[importedType];
@@ -274,7 +269,8 @@
     definingLibrary.imports = <ImportElement>[importElement];
     Scope scope = new LibraryImportScope(definingLibrary);
     expect(
-        scope.lookup(AstFactory.identifier3(importedTypeName), definingLibrary),
+        scope.lookup(
+            AstTestFactory.identifier3(importedTypeName), definingLibrary),
         importedType);
   }
 
@@ -304,10 +300,10 @@
     ];
     Scope scope = new LibraryImportScope(importingLibrary);
     Element prefixedElement = scope.lookup(
-        AstFactory.identifier5(prefixName, typeName), importingLibrary);
+        AstTestFactory.identifier5(prefixName, typeName), importingLibrary);
     expect(prefixedElement, same(prefixedType));
     Element nonPrefixedElement =
-        scope.lookup(AstFactory.identifier3(typeName), importingLibrary);
+        scope.lookup(AstTestFactory.identifier3(typeName), importingLibrary);
     expect(nonPrefixedElement, same(nonPrefixedType));
   }
 }
@@ -321,8 +317,8 @@
   void test_creation_nonEmpty() {
     AnalysisContext context = AnalysisContextFactory.contextWithCore();
     String importedTypeName = "A";
-    ClassElement importedType =
-        new ClassElementImpl.forNode(AstFactory.identifier3(importedTypeName));
+    ClassElement importedType = new ClassElementImpl.forNode(
+        AstTestFactory.identifier3(importedTypeName));
     LibraryElement importedLibrary = createTestLibrary(context, "imported");
     (importedLibrary.definingCompilationUnit as CompilationUnitElementImpl)
         .types = <ClassElement>[importedType];
@@ -333,7 +329,8 @@
     definingLibrary.imports = <ImportElement>[importElement];
     Scope scope = new LibraryScope(definingLibrary);
     expect(
-        scope.lookup(AstFactory.identifier3(importedTypeName), definingLibrary),
+        scope.lookup(
+            AstTestFactory.identifier3(importedTypeName), definingLibrary),
         importedType);
   }
 }
@@ -371,7 +368,7 @@
 class ScopeTest extends ResolverTestCase {
   void test_define_duplicate() {
     Scope scope = new _RootScope();
-    SimpleIdentifier identifier = AstFactory.identifier3('v');
+    SimpleIdentifier identifier = AstTestFactory.identifier3('v');
     VariableElement element1 = ElementFactory.localVariableElement(identifier);
     VariableElement element2 = ElementFactory.localVariableElement(identifier);
     scope.define(element1);
@@ -2478,10 +2475,10 @@
     asyncUnit.types = <ClassElement>[futureType.element, streamType.element];
     AnalysisContext context = AnalysisEngine.instance.createAnalysisContext();
     LibraryElementImpl coreLibrary = new LibraryElementImpl.forNode(
-        context, AstFactory.libraryIdentifier2(["dart.core"]));
+        context, AstTestFactory.libraryIdentifier2(["dart.core"]));
     coreLibrary.definingCompilationUnit = coreUnit;
     LibraryElementImpl asyncLibrary = new LibraryElementImpl.forNode(
-        context, AstFactory.libraryIdentifier2(["dart.async"]));
+        context, AstTestFactory.libraryIdentifier2(["dart.async"]));
     asyncLibrary.definingCompilationUnit = asyncUnit;
     //
     // Create a type provider and ensure that it can return the expected types.
@@ -2507,7 +2504,7 @@
   ClassElement _classElement(String typeName, InterfaceType superclassType,
       [List<String> parameterNames]) {
     ClassElementImpl element =
-        new ClassElementImpl.forNode(AstFactory.identifier3(typeName));
+        new ClassElementImpl.forNode(AstTestFactory.identifier3(typeName));
     element.supertype = superclassType;
     if (parameterNames != null) {
       int count = parameterNames.length;
@@ -2519,7 +2516,7 @@
         for (int i = 0; i < count; i++) {
           TypeParameterElementImpl typeParameter =
               new TypeParameterElementImpl.forNode(
-                  AstFactory.identifier3(parameterNames[i]));
+                  AstTestFactory.identifier3(parameterNames[i]));
           typeParameters[i] = typeParameter;
           typeArguments[i] = new TypeParameterTypeImpl(typeParameter);
           typeParameter.type = typeArguments[i];
@@ -2566,8 +2563,9 @@
   void fail_visitVariableDeclaration() {
     fail("Not yet tested");
     ClassElement type = ElementFactory.classElement2("A");
-    VariableDeclaration node = AstFactory.variableDeclaration("a");
-    AstFactory.variableDeclarationList(null, AstFactory.typeName(type), [node]);
+    VariableDeclaration node = AstTestFactory.variableDeclaration("a");
+    AstTestFactory
+        .variableDeclarationList(null, AstTestFactory.typeName(type), [node]);
     //resolve(node);
     expect(node.name.staticType, same(type.type));
     _listener.assertNoErrors();
@@ -2581,7 +2579,7 @@
     Source librarySource =
         new FileSource(resourceProvider.getFile("/lib.dart"));
     LibraryElementImpl element = new LibraryElementImpl.forNode(
-        context, AstFactory.libraryIdentifier2(["lib"]));
+        context, AstTestFactory.libraryIdentifier2(["lib"]));
     element.definingCompilationUnit =
         new CompilationUnitElementImpl("lib.dart");
     _typeProvider = new TestTypeProvider();
@@ -2591,9 +2589,403 @@
         nameScope: libraryScope);
   }
 
+  void test_modeApi() {
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(r'''
+class C extends A with A implements A {
+  A f = new A();
+  A m() {
+    A v1;
+  }
+}
+A f([A p = const A()]) {
+  A v2;
+}
+A V = new A();
+''');
+    var unitElement = new CompilationUnitElementImpl('/test.dart');
+    ClassElementImpl A = ElementFactory.classElement2('A');
+
+    // Build API elements.
+    {
+      var holder = new ElementHolder();
+      unit.accept(new ApiElementBuilder(holder, unitElement));
+    }
+
+    // Resolve API types.
+    {
+      MemoryResourceProvider resourceProvider = new MemoryResourceProvider();
+      InternalAnalysisContext context = AnalysisContextFactory.contextWithCore(
+          resourceProvider: resourceProvider);
+      var source = resourceProvider.getFile('/test.dart').createSource();
+      var libraryElement = new LibraryElementImpl.forNode(context, null)
+        ..definingCompilationUnit = unitElement;
+      var libraryScope = new LibraryScope(libraryElement);
+      var visitor = new TypeResolverVisitor(
+          libraryElement, source, _typeProvider, _listener,
+          nameScope: libraryScope, mode: TypeResolverMode.api);
+      libraryScope.define(A);
+      unit.accept(visitor);
+    }
+
+    // Top-level: C
+    {
+      var c = unit.declarations[0] as ClassDeclaration;
+
+      // The extends/with/implements types are resolved.
+      expect(c.extendsClause.superclass.toString(), 'A');
+      expect(c.withClause.mixinTypes[0].type.toString(), 'A');
+      expect(c.implementsClause.interfaces[0].type.toString(), 'A');
+
+      {
+        var fd = c.members[0] as FieldDeclaration;
+        // The field type is resolved.
+        expect(fd.fields.type.type.toString(), 'A');
+        // The type in the initializer is not resolved.
+        var f = fd.fields.variables[0];
+        var fi = f.initializer as InstanceCreationExpression;
+        expect(fi.constructorName.type.type, isNull);
+      }
+
+      {
+        var m = c.members[1] as MethodDeclaration;
+        // The return type is resolved.
+        expect(m.returnType.type.toString(), 'A');
+        // The local variable type is not resolved.
+        var body = m.body as BlockFunctionBody;
+        var vd = body.block.statements.single as VariableDeclarationStatement;
+        expect(vd.variables.type.type, isNull);
+      }
+    }
+
+    // Top-level: f
+    {
+      var f = unit.declarations[1] as FunctionDeclaration;
+      FunctionExpression fe = f.functionExpression;
+      // The return type is resolved.
+      expect(f.returnType.type.toString(), 'A');
+      // The parameter type is resolved.
+      var pd = fe.parameters.parameters[0] as DefaultFormalParameter;
+      var p = pd.parameter as SimpleFormalParameter;
+      expect(p.type.type.toString(), 'A');
+      // The parameter default is not resolved.
+      {
+        var pde = pd.defaultValue as InstanceCreationExpression;
+        expect(pde.constructorName.type.type, isNull);
+      }
+      // The local variable type is not resolved.
+      var body = fe.body as BlockFunctionBody;
+      var vd = body.block.statements.single as VariableDeclarationStatement;
+      expect(vd.variables.type.type, isNull);
+    }
+
+    // Top-level: V
+    {
+      var vd = unit.declarations[2] as TopLevelVariableDeclaration;
+      // The type is resolved.
+      expect(vd.variables.type.toString(), 'A');
+      // The initializer is not resolved.
+      VariableDeclaration v = vd.variables.variables[0];
+      var vi = v.initializer as InstanceCreationExpression;
+      expect(vi.constructorName.type.type, isNull);
+    }
+  }
+
+  void test_modeLocal_noContext() {
+    CompilationUnit unit;
+    _resolveTypeModeLocal(
+        r'''
+class C {
+  A f = new A();
+  A m([A p = const A()]) {
+    A v;
+  }
+}
+A f([A p = const A()]) {
+  A v1 = new A();
+  A f2(A p2) {
+    A v2;
+  }
+}
+A V = new A();
+A get G => new A();
+''', (CompilationUnit u) {
+      unit = u;
+      return u;
+    });
+
+    // Top-level: C
+    {
+      var c = unit.declarations[0] as ClassDeclaration;
+      {
+        var fd = c.members[0] as FieldDeclaration;
+        // The type of "f" is not resolved.
+        expect(fd.fields.type.type, isNull);
+        // The initializer of "f" is resolved.
+        var f = fd.fields.variables[0];
+        var fi = f.initializer as InstanceCreationExpression;
+        expect(fi.constructorName.type.type.toString(), 'A');
+      }
+      {
+        var m = c.members[1] as MethodDeclaration;
+        // The return type of "m" is not resolved.
+        expect(m.returnType.type, isNull);
+        // The type of the parameter "p" is not resolved.
+        var pd = m.parameters.parameters[0] as DefaultFormalParameter;
+        var p = pd.parameter as SimpleFormalParameter;
+        expect(p.type.type, isNull);
+        // The default value of the parameter "p" is resolved.
+        var pdd = pd.defaultValue as InstanceCreationExpression;
+        expect(pdd.constructorName.type.type.toString(), 'A');
+        // The type of "v" is resolved.
+        var mb = m.body as BlockFunctionBody;
+        var vd = mb.block.statements[0] as VariableDeclarationStatement;
+        expect(vd.variables.type.type.toString(), 'A');
+      }
+    }
+
+    // Top-level: f
+    {
+      var f = unit.declarations[1] as FunctionDeclaration;
+      // The return type of "f" is not resolved.
+      expect(f.returnType.type, isNull);
+      // The type of the parameter "p" is not resolved.
+      var fe = f.functionExpression;
+      var pd = fe.parameters.parameters[0] as DefaultFormalParameter;
+      var p = pd.parameter as SimpleFormalParameter;
+      expect(p.type.type, isNull);
+      // The default value of the parameter "p" is resolved.
+      var pdd = pd.defaultValue as InstanceCreationExpression;
+      expect(pdd.constructorName.type.type.toString(), 'A');
+      // The type of "v1" is resolved.
+      var fb = fe.body as BlockFunctionBody;
+      var vd = fb.block.statements[0] as VariableDeclarationStatement;
+      expect(vd.variables.type.type.toString(), 'A');
+      // The initializer of "v1" is resolved.
+      var v = vd.variables.variables[0];
+      var vi = v.initializer as InstanceCreationExpression;
+      expect(vi.constructorName.type.type.toString(), 'A');
+      // Local: f2
+      {
+        var f2s = fb.block.statements[1] as FunctionDeclarationStatement;
+        var f2 = f2s.functionDeclaration;
+        // The return type of "f2" is resolved.
+        expect(f2.returnType.type.toString(), 'A');
+        // The type of the parameter "p2" is resolved.
+        var f2e = f2.functionExpression;
+        var p2 = f2e.parameters.parameters[0] as SimpleFormalParameter;
+        expect(p2.type.type.toString(), 'A');
+        // The type of "v2" is resolved.
+        var f2b = f2e.body as BlockFunctionBody;
+        var v2d = f2b.block.statements[0] as VariableDeclarationStatement;
+        expect(v2d.variables.type.type.toString(), 'A');
+      }
+    }
+
+    // Top-level: V
+    {
+      var vd = unit.declarations[2] as TopLevelVariableDeclaration;
+      // The type is not resolved.
+      expect(vd.variables.type.type, isNull);
+      // The initializer is resolved.
+      VariableDeclaration v = vd.variables.variables[0];
+      var vi = v.initializer as InstanceCreationExpression;
+      expect(vi.constructorName.type.type.toString(), 'A');
+    }
+
+    // Top-level: G
+    {
+      var g = unit.declarations[3] as FunctionDeclaration;
+      // The return type is not resolved.
+      expect(g.returnType.type, isNull);
+      // The body is resolved.
+      var gb = g.functionExpression.body as ExpressionFunctionBody;
+      var ge = gb.expression as InstanceCreationExpression;
+      expect(ge.constructorName.type.type.toString(), 'A');
+    }
+  }
+
+  void test_modeLocal_withContext_bad_methodBody() {
+    expect(() {
+      _resolveTypeModeLocal(
+          r'''
+class C<T1> {
+  A m<T2>() {
+    T1 v1;
+    T2 v2;
+  }
+}
+''', (CompilationUnit u) {
+        var c = u.declarations[0] as ClassDeclaration;
+        var m = c.members[0] as MethodDeclaration;
+        var mb = m.body as BlockFunctionBody;
+        return mb;
+      });
+    }, throwsStateError);
+  }
+
+  void test_modeLocal_withContext_bad_topLevelVariable_declaration() {
+    expect(() {
+      _resolveTypeModeLocal(
+          r'''
+var v = new A();
+''', (CompilationUnit u) {
+        var tlv = u.declarations[0] as TopLevelVariableDeclaration;
+        return tlv.variables.variables[0];
+      });
+    }, throwsStateError);
+  }
+
+  void test_modeLocal_withContext_bad_topLevelVariable_initializer() {
+    expect(() {
+      _resolveTypeModeLocal(
+          r'''
+var v = new A();
+''', (CompilationUnit u) {
+        var tlv = u.declarations[0] as TopLevelVariableDeclaration;
+        return tlv.variables.variables[0].initializer;
+      });
+    }, throwsStateError);
+  }
+
+  void test_modeLocal_withContext_class() {
+    ClassDeclaration c;
+    _resolveTypeModeLocal(
+        r'''
+class C<T1> {
+  A m<T2>() {
+    T1 v1;
+    T2 v2;
+  }
+}
+''', (CompilationUnit u) {
+      c = u.declarations[0] as ClassDeclaration;
+      return c;
+    });
+    var m = c.members[0] as MethodDeclaration;
+
+    // The return type of "m" is not resolved.
+    expect(m.returnType.type, isNull);
+
+    var mb = m.body as BlockFunctionBody;
+    var ms = mb.block.statements;
+
+    // The type of "v1" is resolved.
+    {
+      var vd = ms[0] as VariableDeclarationStatement;
+      expect(vd.variables.type.type.toString(), 'T1');
+    }
+
+    // The type of "v2" is resolved.
+    {
+      var vd = ms[1] as VariableDeclarationStatement;
+      expect(vd.variables.type.type.toString(), 'T2');
+    }
+  }
+
+  void test_modeLocal_withContext_inClass_constructor() {
+    ConstructorDeclaration cc;
+    _resolveTypeModeLocal(
+        r'''
+class C<T> {
+  C() {
+    T v1;
+  }
+}
+''', (CompilationUnit u) {
+      var c = u.declarations[0] as ClassDeclaration;
+      cc = c.members[0] as ConstructorDeclaration;
+      return cc;
+    });
+
+    var ccb = cc.body as BlockFunctionBody;
+    var ccs = ccb.block.statements;
+
+    // The type of "v" is resolved.
+    {
+      var vd = ccs[0] as VariableDeclarationStatement;
+      expect(vd.variables.type.type.toString(), 'T');
+    }
+  }
+
+  void test_modeLocal_withContext_inClass_method() {
+    MethodDeclaration m;
+    _resolveTypeModeLocal(
+        r'''
+class C<T1> {
+  A m<T2>() {
+    T1 v1;
+    T2 v2;
+  }
+}
+''', (CompilationUnit u) {
+      var c = u.declarations[0] as ClassDeclaration;
+      m = c.members[0] as MethodDeclaration;
+      return m;
+    });
+
+    // The return type of "m" is not resolved.
+    expect(m.returnType.type, isNull);
+
+    var mb = m.body as BlockFunctionBody;
+    var ms = mb.block.statements;
+
+    // The type of "v1" is resolved.
+    {
+      var vd = ms[0] as VariableDeclarationStatement;
+      expect(vd.variables.type.type.toString(), 'T1');
+    }
+
+    // The type of "v2" is resolved.
+    {
+      var vd = ms[1] as VariableDeclarationStatement;
+      expect(vd.variables.type.type.toString(), 'T2');
+    }
+  }
+
+  void test_modeLocal_withContext_topLevelFunction() {
+    FunctionDeclaration f;
+    _resolveTypeModeLocal(
+        r'''
+A m<T>() {
+  T v;
+}
+''', (CompilationUnit u) {
+      f = u.declarations[0] as FunctionDeclaration;
+      return f;
+    });
+
+    // The return type of "f" is not resolved.
+    expect(f.returnType.type, isNull);
+
+    var fb = f.functionExpression.body as BlockFunctionBody;
+    var fs = fb.block.statements;
+
+    // The type of "v" is resolved.
+    var vd = fs[0] as VariableDeclarationStatement;
+    expect(vd.variables.type.type.toString(), 'T');
+  }
+
+  void test_modeLocal_withContext_topLevelVariable() {
+    TopLevelVariableDeclaration v;
+    _resolveTypeModeLocal(
+        r'''
+A v = new A();
+''', (CompilationUnit u) {
+      v = u.declarations[0] as TopLevelVariableDeclaration;
+      return v;
+    });
+
+    // The type of "v" is not resolved.
+    expect(v.variables.type.type, isNull);
+
+    // The type of "v" initializer is resolved.
+    var vi = v.variables.variables[0].initializer as InstanceCreationExpression;
+    expect(vi.constructorName.type.type.toString(), 'A');
+  }
+
   void test_visitCatchClause_exception() {
     // catch (e)
-    CatchClause clause = AstFactory.catchClause("e");
+    CatchClause clause = AstTestFactory.catchClause("e");
     SimpleIdentifier exceptionParameter = clause.exceptionParameter;
     exceptionParameter.staticElement =
         new LocalVariableElementImpl.forNode(exceptionParameter);
@@ -2603,7 +2995,7 @@
 
   void test_visitCatchClause_exception_stackTrace() {
     // catch (e, s)
-    CatchClause clause = AstFactory.catchClause2("e", "s");
+    CatchClause clause = AstTestFactory.catchClause2("e", "s");
     SimpleIdentifier exceptionParameter = clause.exceptionParameter;
     exceptionParameter.staticElement =
         new LocalVariableElementImpl.forNode(exceptionParameter);
@@ -2618,8 +3010,8 @@
   void test_visitCatchClause_on_exception() {
     // on E catch (e)
     ClassElement exceptionElement = ElementFactory.classElement2("E");
-    TypeName exceptionType = AstFactory.typeName(exceptionElement);
-    CatchClause clause = AstFactory.catchClause4(exceptionType, "e");
+    TypeName exceptionType = AstTestFactory.typeName(exceptionElement);
+    CatchClause clause = AstTestFactory.catchClause4(exceptionType, "e");
     SimpleIdentifier exceptionParameter = clause.exceptionParameter;
     exceptionParameter.staticElement =
         new LocalVariableElementImpl.forNode(exceptionParameter);
@@ -2631,9 +3023,9 @@
   void test_visitCatchClause_on_exception_stackTrace() {
     // on E catch (e, s)
     ClassElement exceptionElement = ElementFactory.classElement2("E");
-    TypeName exceptionType = AstFactory.typeName(exceptionElement);
+    TypeName exceptionType = AstTestFactory.typeName(exceptionElement);
     (exceptionType.name as SimpleIdentifier).staticElement = exceptionElement;
-    CatchClause clause = AstFactory.catchClause5(exceptionType, "e", "s");
+    CatchClause clause = AstTestFactory.catchClause5(exceptionType, "e", "s");
     SimpleIdentifier exceptionParameter = clause.exceptionParameter;
     exceptionParameter.staticElement =
         new LocalVariableElementImpl.forNode(exceptionParameter);
@@ -2655,12 +3047,12 @@
     ClassElement elementC = ElementFactory.classElement2("C");
     ClassElement elementD = ElementFactory.classElement2("D");
     ExtendsClause extendsClause =
-        AstFactory.extendsClause(AstFactory.typeName(elementB));
+        AstTestFactory.extendsClause(AstTestFactory.typeName(elementB));
     WithClause withClause =
-        AstFactory.withClause([AstFactory.typeName(elementC)]);
+        AstTestFactory.withClause([AstTestFactory.typeName(elementC)]);
     ImplementsClause implementsClause =
-        AstFactory.implementsClause([AstFactory.typeName(elementD)]);
-    ClassDeclaration declaration = AstFactory.classDeclaration(
+        AstTestFactory.implementsClause([AstTestFactory.typeName(elementD)]);
+    ClassDeclaration declaration = AstTestFactory.classDeclaration(
         null, "A", null, extendsClause, withClause, implementsClause);
     declaration.name.staticElement = elementA;
     _resolveNode(declaration, [elementA, elementB, elementC, elementD]);
@@ -2685,9 +3077,9 @@
       ElementFactory.methodElement("A", VoidTypeImpl.instance)
     ];
     ExtendsClause extendsClause =
-        AstFactory.extendsClause(AstFactory.typeName(elementA));
-    ClassDeclaration declaration =
-        AstFactory.classDeclaration(null, "B", null, extendsClause, null, null);
+        AstTestFactory.extendsClause(AstTestFactory.typeName(elementA));
+    ClassDeclaration declaration = AstTestFactory.classDeclaration(
+        null, "B", null, extendsClause, null, null);
     declaration.name.staticElement = elementB;
     _resolveNode(declaration, [elementA, elementB]);
     expect(elementB.supertype, same(elementA.type));
@@ -2701,11 +3093,11 @@
     ClassElement elementC = ElementFactory.classElement2("C");
     ClassElement elementD = ElementFactory.classElement2("D");
     WithClause withClause =
-        AstFactory.withClause([AstFactory.typeName(elementC)]);
+        AstTestFactory.withClause([AstTestFactory.typeName(elementC)]);
     ImplementsClause implementsClause =
-        AstFactory.implementsClause([AstFactory.typeName(elementD)]);
-    ClassTypeAlias alias = AstFactory.classTypeAlias("A", null, null,
-        AstFactory.typeName(elementB), withClause, implementsClause);
+        AstTestFactory.implementsClause([AstTestFactory.typeName(elementD)]);
+    ClassTypeAlias alias = AstTestFactory.classTypeAlias("A", null, null,
+        AstTestFactory.typeName(elementB), withClause, implementsClause);
     alias.name.staticElement = elementA;
     _resolveNode(alias, [elementA, elementB, elementC, elementD]);
     expect(elementA.supertype, same(elementB.type));
@@ -2742,10 +3134,10 @@
     classB.constructors = [constructorBc1, constructorBc2, constructorBc3];
     ClassElement classM = ElementFactory.classElement2('M', []);
     WithClause withClause =
-        AstFactory.withClause([AstFactory.typeName(classM, [])]);
+        AstTestFactory.withClause([AstTestFactory.typeName(classM, [])]);
     ClassElement classC = ElementFactory.classTypeAlias2('C', []);
-    ClassTypeAlias alias = AstFactory.classTypeAlias(
-        'C', null, null, AstFactory.typeName(classB, []), withClause, null);
+    ClassTypeAlias alias = AstTestFactory.classTypeAlias(
+        'C', null, null, AstTestFactory.typeName(classB, []), withClause, null);
     alias.name.staticElement = classC;
     _resolveNode(alias, [classT, classB, classM, classC]);
     expect(classC.constructors, hasLength(1));
@@ -2773,10 +3165,10 @@
     classB.constructors = [constructorB];
     ClassElement classM = ElementFactory.classElement2('M', []);
     WithClause withClause =
-        AstFactory.withClause([AstFactory.typeName(classM, [])]);
+        AstTestFactory.withClause([AstTestFactory.typeName(classM, [])]);
     ClassElement classC = ElementFactory.classTypeAlias2('C', []);
-    ClassTypeAlias alias = AstFactory.classTypeAlias(
-        'C', null, null, AstFactory.typeName(classB, []), withClause, null);
+    ClassTypeAlias alias = AstTestFactory.classTypeAlias(
+        'C', null, null, AstTestFactory.typeName(classB, []), withClause, null);
     alias.name.staticElement = classC;
     _resolveNode(alias, [classT, classB, classM, classC]);
     expect(classC.constructors, hasLength(1));
@@ -2804,10 +3196,10 @@
     classB.constructors = [constructorB];
     ClassElement classM = ElementFactory.classElement2('M', []);
     WithClause withClause =
-        AstFactory.withClause([AstFactory.typeName(classM, [])]);
+        AstTestFactory.withClause([AstTestFactory.typeName(classM, [])]);
     ClassElement classC = ElementFactory.classTypeAlias2('C', []);
-    ClassTypeAlias alias = AstFactory.classTypeAlias(
-        'C', null, null, AstFactory.typeName(classB, []), withClause, null);
+    ClassTypeAlias alias = AstTestFactory.classTypeAlias(
+        'C', null, null, AstTestFactory.typeName(classB, []), withClause, null);
     alias.name.staticElement = classC;
     _resolveNode(alias, [classB, classM, classC]);
     expect(classC.constructors, hasLength(1));
@@ -2823,15 +3215,18 @@
 
   void test_visitFieldFormalParameter_functionType() {
     InterfaceType intType = _typeProvider.intType;
-    TypeName intTypeName = AstFactory.typeName4("int");
+    TypeName intTypeName = AstTestFactory.typeName4("int");
     String innerParameterName = "a";
     SimpleFormalParameter parameter =
-        AstFactory.simpleFormalParameter3(innerParameterName);
+        AstTestFactory.simpleFormalParameter3(innerParameterName);
     parameter.identifier.staticElement =
         ElementFactory.requiredParameter(innerParameterName);
     String outerParameterName = "p";
-    FormalParameter node = AstFactory.fieldFormalParameter(null, intTypeName,
-        outerParameterName, AstFactory.formalParameterList([parameter]));
+    FormalParameter node = AstTestFactory.fieldFormalParameter(
+        null,
+        intTypeName,
+        outerParameterName,
+        AstTestFactory.formalParameterList([parameter]));
     node.identifier.staticElement =
         ElementFactory.requiredParameter(outerParameterName);
     DartType parameterType = _resolveFormalParameter(node, [intType.element]);
@@ -2846,7 +3241,7 @@
   void test_visitFieldFormalParameter_noType() {
     String parameterName = "p";
     FormalParameter node =
-        AstFactory.fieldFormalParameter(Keyword.VAR, null, parameterName);
+        AstTestFactory.fieldFormalParameter(Keyword.VAR, null, parameterName);
     node.identifier.staticElement =
         ElementFactory.requiredParameter(parameterName);
     expect(_resolveFormalParameter(node), same(_typeProvider.dynamicType));
@@ -2855,10 +3250,10 @@
 
   void test_visitFieldFormalParameter_type() {
     InterfaceType intType = _typeProvider.intType;
-    TypeName intTypeName = AstFactory.typeName4("int");
+    TypeName intTypeName = AstTestFactory.typeName4("int");
     String parameterName = "p";
     FormalParameter node =
-        AstFactory.fieldFormalParameter(null, intTypeName, parameterName);
+        AstTestFactory.fieldFormalParameter(null, intTypeName, parameterName);
     node.identifier.staticElement =
         ElementFactory.requiredParameter(parameterName);
     expect(_resolveFormalParameter(node, [intType.element]), same(intType));
@@ -2872,13 +3267,14 @@
     ClassElement elementR = ElementFactory.classElement2('R');
     ClassElement elementP = ElementFactory.classElement2('P');
     FunctionElement elementF = ElementFactory.functionElement('f');
-    FunctionDeclaration declaration = AstFactory.functionDeclaration(
-        AstFactory.typeName4('R'),
+    FunctionDeclaration declaration = AstTestFactory.functionDeclaration(
+        AstTestFactory.typeName4('R'),
         null,
         'f',
-        AstFactory.functionExpression2(
-            AstFactory.formalParameterList([
-              AstFactory.simpleFormalParameter4(AstFactory.typeName4('P'), 'p')
+        AstTestFactory.functionExpression2(
+            AstTestFactory.formalParameterList([
+              AstTestFactory.simpleFormalParameter4(
+                  AstTestFactory.typeName4('P'), 'p')
             ]),
             null));
     declaration.name.staticElement = elementF;
@@ -2895,13 +3291,14 @@
     TypeParameterElement elementE = ElementFactory.typeParameterElement('E');
     FunctionElementImpl elementF = ElementFactory.functionElement('f');
     elementF.typeParameters = <TypeParameterElement>[elementE];
-    FunctionDeclaration declaration = AstFactory.functionDeclaration(
-        AstFactory.typeName4('E'),
+    FunctionDeclaration declaration = AstTestFactory.functionDeclaration(
+        AstTestFactory.typeName4('E'),
         null,
         'f',
-        AstFactory.functionExpression2(
-            AstFactory.formalParameterList([
-              AstFactory.simpleFormalParameter4(AstFactory.typeName4('E'), 'e')
+        AstTestFactory.functionExpression2(
+            AstTestFactory.formalParameterList([
+              AstTestFactory.simpleFormalParameter4(
+                  AstTestFactory.typeName4('E'), 'e')
             ]),
             null));
     declaration.name.staticElement = elementF;
@@ -2922,17 +3319,17 @@
     FunctionElement elementF = ElementFactory.functionElement('f');
     ParameterElementImpl requiredParameter =
         ElementFactory.requiredParameter('p');
-    FunctionTypedFormalParameter parameterDeclaration = AstFactory
-        .functionTypedFormalParameter(AstFactory.typeName4('R'), 'g', [
-      AstFactory.simpleFormalParameter4(AstFactory.typeName4('P'), 'p')
+    FunctionTypedFormalParameter parameterDeclaration = AstTestFactory
+        .functionTypedFormalParameter(AstTestFactory.typeName4('R'), 'g', [
+      AstTestFactory.simpleFormalParameter4(AstTestFactory.typeName4('P'), 'p')
     ]);
     parameterDeclaration.identifier.staticElement = requiredParameter;
-    FunctionDeclaration declaration = AstFactory.functionDeclaration(
-        AstFactory.typeName4('R'),
+    FunctionDeclaration declaration = AstTestFactory.functionDeclaration(
+        AstTestFactory.typeName4('R'),
         null,
         'f',
-        AstFactory.functionExpression2(
-            AstFactory.formalParameterList([parameterDeclaration]), null));
+        AstTestFactory.functionExpression2(
+            AstTestFactory.formalParameterList([parameterDeclaration]), null));
     declaration.name.staticElement = elementF;
     _resolveNode(declaration, [elementR, elementP]);
     expect(declaration.returnType.type, elementR.type);
@@ -2953,17 +3350,17 @@
     ParameterElementImpl requiredParameter =
         ElementFactory.requiredParameter('g');
     requiredParameter.typeParameters = <TypeParameterElement>[elementE];
-    FunctionTypedFormalParameter parameterDeclaration = AstFactory
-        .functionTypedFormalParameter(AstFactory.typeName4('R'), 'g', [
-      AstFactory.simpleFormalParameter4(AstFactory.typeName4('E'), 'e')
+    FunctionTypedFormalParameter parameterDeclaration = AstTestFactory
+        .functionTypedFormalParameter(AstTestFactory.typeName4('R'), 'g', [
+      AstTestFactory.simpleFormalParameter4(AstTestFactory.typeName4('E'), 'e')
     ]);
     parameterDeclaration.identifier.staticElement = requiredParameter;
-    FunctionDeclaration declaration = AstFactory.functionDeclaration(
-        AstFactory.typeName4('R'),
+    FunctionDeclaration declaration = AstTestFactory.functionDeclaration(
+        AstTestFactory.typeName4('R'),
         null,
         'f',
-        AstFactory.functionExpression2(
-            AstFactory.formalParameterList([parameterDeclaration]), null));
+        AstTestFactory.functionExpression2(
+            AstTestFactory.formalParameterList([parameterDeclaration]), null));
     declaration.name.staticElement = elementF;
     _resolveNode(declaration, [elementR]);
     expect(declaration.returnType.type, elementR.type);
@@ -2986,14 +3383,15 @@
     ClassElement elementP = ElementFactory.classElement2('P');
     MethodElement elementM = ElementFactory.methodElement('m', null);
     elementA.methods = <MethodElement>[elementM];
-    MethodDeclaration declaration = AstFactory.methodDeclaration(
+    MethodDeclaration declaration = AstTestFactory.methodDeclaration(
         null,
-        AstFactory.typeName4('R'),
+        AstTestFactory.typeName4('R'),
         null,
         null,
-        AstFactory.identifier3('m'),
-        AstFactory.formalParameterList([
-          AstFactory.simpleFormalParameter4(AstFactory.typeName4('P'), 'p')
+        AstTestFactory.identifier3('m'),
+        AstTestFactory.formalParameterList([
+          AstTestFactory.simpleFormalParameter4(
+              AstTestFactory.typeName4('P'), 'p')
         ]));
     declaration.name.staticElement = elementM;
     _resolveNode(declaration, [elementA, elementR, elementP]);
@@ -3012,14 +3410,15 @@
     MethodElementImpl elementM = ElementFactory.methodElement('m', null);
     elementM.typeParameters = <TypeParameterElement>[elementE];
     elementA.methods = <MethodElement>[elementM];
-    MethodDeclaration declaration = AstFactory.methodDeclaration(
+    MethodDeclaration declaration = AstTestFactory.methodDeclaration(
         null,
-        AstFactory.typeName4('E'),
+        AstTestFactory.typeName4('E'),
         null,
         null,
-        AstFactory.identifier3('m'),
-        AstFactory.formalParameterList([
-          AstFactory.simpleFormalParameter4(AstFactory.typeName4('E'), 'e')
+        AstTestFactory.identifier3('m'),
+        AstTestFactory.formalParameterList([
+          AstTestFactory.simpleFormalParameter4(
+              AstTestFactory.typeName4('E'), 'e')
         ]));
     declaration.name.staticElement = elementM;
     _resolveNode(declaration, [elementA]);
@@ -3031,9 +3430,9 @@
 
   void test_visitSimpleFormalParameter_noType() {
     // p
-    FormalParameter node = AstFactory.simpleFormalParameter3("p");
+    FormalParameter node = AstTestFactory.simpleFormalParameter3("p");
     node.identifier.staticElement =
-        new ParameterElementImpl.forNode(AstFactory.identifier3("p"));
+        new ParameterElementImpl.forNode(AstTestFactory.identifier3("p"));
     expect(_resolveFormalParameter(node), same(_typeProvider.dynamicType));
     _listener.assertNoErrors();
   }
@@ -3042,8 +3441,8 @@
     // int p
     InterfaceType intType = _typeProvider.intType;
     ClassElement intElement = intType.element;
-    FormalParameter node =
-        AstFactory.simpleFormalParameter4(AstFactory.typeName(intElement), "p");
+    FormalParameter node = AstTestFactory.simpleFormalParameter4(
+        AstTestFactory.typeName(intElement), "p");
     SimpleIdentifier identifier = node.identifier;
     ParameterElementImpl element = new ParameterElementImpl.forNode(identifier);
     identifier.staticElement = element;
@@ -3053,7 +3452,7 @@
 
   void test_visitTypeName_noParameters_noArguments() {
     ClassElement classA = ElementFactory.classElement2("A");
-    TypeName typeName = AstFactory.typeName(classA);
+    TypeName typeName = AstTestFactory.typeName(classA);
     typeName.type = null;
     _resolveNode(typeName, [classA]);
     expect(typeName.type, same(classA.type));
@@ -3061,7 +3460,7 @@
   }
 
   void test_visitTypeName_noParameters_noArguments_undefined() {
-    SimpleIdentifier id = AstFactory.identifier3("unknown")
+    SimpleIdentifier id = AstTestFactory.identifier3("unknown")
       ..staticElement = new _StaleElement();
     TypeName typeName = new TypeName(id, null);
     _resolveNode(typeName, []);
@@ -3074,7 +3473,7 @@
     ClassElement classA = ElementFactory.classElement2("A", ["E"]);
     ClassElement classB = ElementFactory.classElement2("B");
     TypeName typeName =
-        AstFactory.typeName(classA, [AstFactory.typeName(classB)]);
+        AstTestFactory.typeName(classA, [AstTestFactory.typeName(classB)]);
     typeName.type = null;
     _resolveNode(typeName, [classA, classB]);
     InterfaceType resultType = typeName.type as InterfaceType;
@@ -3087,7 +3486,7 @@
 
   void test_visitTypeName_parameters_noArguments() {
     ClassElement classA = ElementFactory.classElement2("A", ["E"]);
-    TypeName typeName = AstFactory.typeName(classA);
+    TypeName typeName = AstTestFactory.typeName(classA);
     typeName.type = null;
     _resolveNode(typeName, [classA]);
     InterfaceType resultType = typeName.type as InterfaceType;
@@ -3099,12 +3498,12 @@
   }
 
   void test_visitTypeName_prefixed_noParameters_noArguments_undefined() {
-    SimpleIdentifier prefix = AstFactory.identifier3("unknownPrefix")
+    SimpleIdentifier prefix = AstTestFactory.identifier3("unknownPrefix")
       ..staticElement = new _StaleElement();
-    SimpleIdentifier suffix = AstFactory.identifier3("unknownSuffix")
+    SimpleIdentifier suffix = AstTestFactory.identifier3("unknownSuffix")
       ..staticElement = new _StaleElement();
     TypeName typeName =
-        new TypeName(AstFactory.identifier(prefix, suffix), null);
+        new TypeName(AstTestFactory.identifier(prefix, suffix), null);
     _resolveNode(typeName, []);
     expect(typeName.type, UndefinedTypeImpl.instance);
     expect(prefix.staticElement, null);
@@ -3114,7 +3513,7 @@
 
   void test_visitTypeName_void() {
     ClassElement classA = ElementFactory.classElement2("A");
-    TypeName typeName = AstFactory.typeName4("void");
+    TypeName typeName = AstTestFactory.typeName4("void");
     _resolveNode(typeName, [classA]);
     expect(typeName.type, same(VoidTypeImpl.instance));
     _listener.assertNoErrors();
@@ -3177,6 +3576,47 @@
     }
     node.accept(_visitor);
   }
+
+  /**
+   * Parse the given [code], build elements and resolve in the
+   * [TypeResolverMode.local] mode. The [code] is allowed to use only the type
+   * named `A`.
+   */
+  void _resolveTypeModeLocal(
+      String code, AstNode getNodeToResolve(CompilationUnit unit)) {
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit2(code);
+    var unitElement = new CompilationUnitElementImpl('/test.dart');
+
+    // Build API elements.
+    {
+      var holder = new ElementHolder();
+      unit.accept(new ElementBuilder(holder, unitElement));
+    }
+
+    // Prepare for resolution.
+    LibraryScope libraryScope;
+    TypeResolverVisitor visitor;
+    {
+      MemoryResourceProvider resourceProvider = new MemoryResourceProvider();
+      InternalAnalysisContext context = AnalysisContextFactory.contextWithCore(
+          resourceProvider: resourceProvider);
+      var source = resourceProvider.getFile('/test.dart').createSource();
+      var libraryElement = new LibraryElementImpl.forNode(context, null)
+        ..definingCompilationUnit = unitElement;
+      libraryScope = new LibraryScope(libraryElement);
+      visitor = new TypeResolverVisitor(
+          libraryElement, source, _typeProvider, _listener,
+          nameScope: libraryScope, mode: TypeResolverMode.local);
+    }
+
+    // Define top-level types.
+    ClassElementImpl A = ElementFactory.classElement2('A');
+    libraryScope.define(A);
+
+    // Perform resolution.
+    AstNode nodeToResolve = getNodeToResolve(unit);
+    nodeToResolve.accept(visitor);
+  }
 }
 
 class _RootScope extends Scope {
diff --git a/pkg/analyzer/test/generated/resolver_test_case.dart b/pkg/analyzer/test/generated/resolver_test_case.dart
index 1b7f5e2..5cd095d 100644
--- a/pkg/analyzer/test/generated/resolver_test_case.dart
+++ b/pkg/analyzer/test/generated/resolver_test_case.dart
@@ -9,7 +9,7 @@
 import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer/dart/element/type.dart';
 import 'package:analyzer/error/error.dart';
-import 'package:analyzer/file_system/physical_file_system.dart';
+import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:analyzer/src/dart/element/element.dart';
 import 'package:analyzer/src/dart/element/type.dart';
 import 'package:analyzer/src/error/codes.dart';
@@ -17,9 +17,9 @@
 import 'package:analyzer/src/generated/java_engine.dart';
 import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/source_io.dart';
-import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
 import 'package:analyzer/src/generated/testing/element_factory.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import 'analysis_context_factory.dart';
 import 'test_support.dart';
@@ -299,6 +299,11 @@
 
 class ResolverTestCase extends EngineTestCase {
   /**
+   * The resource provider used by the test case.
+   */
+  MemoryResourceProvider resourceProvider = new MemoryResourceProvider();
+
+  /**
    * The analysis context used to parse the compilation units being resolved.
    */
   InternalAnalysisContext analysisContext2;
@@ -332,14 +337,13 @@
   TypeSystem get typeSystem => analysisContext2.typeSystem;
 
   /**
-   * Add a source file to the content provider. The file path should be absolute.
-   *
-   * @param filePath the path of the file being added
-   * @param contents the contents to be returned by the content provider for the specified file
-   * @return the source object representing the added file
+   * Add a source file with the given [filePath] in the root of the file system.
+   * The file path should be absolute. The file will have the given [contents]
+   * set in the content provider. Return the source representing the added file.
    */
   Source addNamedSource(String filePath, String contents) {
-    Source source = cacheSource(filePath, contents);
+    Source source =
+        cacheSource(resourceProvider.convertPath(filePath), contents);
     ChangeSet changeSet = new ChangeSet();
     changeSet.addedSource(source);
     analysisContext2.applyChanges(changeSet);
@@ -347,10 +351,9 @@
   }
 
   /**
-   * Add a source file to the content provider.
-   *
-   * @param contents the contents to be returned by the content provider for the specified file
-   * @return the source object representing the added file
+   * Add a source file named 'test.dart' in the root of the file system. The
+   * file will have the given [contents] set in the content provider. Return the
+   * source representing the added file.
    */
   Source addSource(String contents) => addNamedSource("/test.dart", contents);
 
@@ -366,7 +369,7 @@
    *           expected
    */
   void assertErrors(Source source,
-      [List<ErrorCode> expectedErrorCodes = ErrorCode.EMPTY_LIST]) {
+      [List<ErrorCode> expectedErrorCodes = const <ErrorCode>[]]) {
     GatheringErrorListener errorListener = new GatheringErrorListener();
     for (AnalysisError error in analysisContext2.computeErrors(source)) {
       expect(error.source, source);
@@ -477,8 +480,7 @@
    * source to the analysis context. The file path must be absolute.
    */
   Source cacheSource(String filePath, String contents) {
-    Source source =
-        PhysicalResourceProvider.INSTANCE.getFile(filePath).createSource();
+    Source source = resourceProvider.getFile(filePath).createSource();
     analysisContext2.setContents(source, contents);
     return source;
   }
@@ -516,8 +518,7 @@
    * give it an empty content. Return the source that was created.
    */
   Source createNamedSource(String fileName) {
-    Source source =
-        PhysicalResourceProvider.INSTANCE.getFile(fileName).createSource();
+    Source source = resourceProvider.getFile(fileName).createSource();
     analysisContext2.setContents(source, '');
     return source;
   }
@@ -543,7 +544,7 @@
       for (int i = 0; i < count; i++) {
         String typeName = typeNames[i];
         ClassElementImpl type =
-            new ClassElementImpl.forNode(AstFactory.identifier3(typeName));
+            new ClassElementImpl.forNode(AstTestFactory.identifier3(typeName));
         String fileName = "$typeName.dart";
         CompilationUnitElementImpl compilationUnit =
             new CompilationUnitElementImpl(fileName);
@@ -558,7 +559,7 @@
     compilationUnit.librarySource =
         compilationUnit.source = definingCompilationUnitSource;
     LibraryElementImpl library = new LibraryElementImpl.forNode(
-        context, AstFactory.libraryIdentifier2([libraryName]));
+        context, AstTestFactory.libraryIdentifier2([libraryName]));
     library.definingCompilationUnit = compilationUnit;
     library.parts = sourcedCompilationUnits;
     return library;
@@ -614,21 +615,20 @@
   }
 
   /**
-   * In the rare cases we want to group several tests into single "test_" method, so need a way to
-   * reset test instance to reuse it.
+   * Re-create the analysis context being used by the test case.
    */
   void reset() {
-    analysisContext2 = AnalysisContextFactory.contextWithCore();
+    analysisContext2 = AnalysisContextFactory.contextWithCore(
+        resourceProvider: resourceProvider);
   }
 
   /**
-   * Reset the analysis context to have the given options applied.
-   *
-   * @param options the analysis options to be applied to the context
+   * Re-create the analysis context being used by the test case and set the
+   * [options] in the newly created context to the given [options].
    */
   void resetWithOptions(AnalysisOptions options) {
-    analysisContext2 =
-        AnalysisContextFactory.contextWithCoreAndOptions(options);
+    analysisContext2 = AnalysisContextFactory.contextWithCoreAndOptions(options,
+        resourceProvider: resourceProvider);
   }
 
   /**
diff --git a/pkg/analyzer/test/generated/scanner_test.dart b/pkg/analyzer/test/generated/scanner_test.dart
index 3937ce8..92d6621 100644
--- a/pkg/analyzer/test/generated/scanner_test.dart
+++ b/pkg/analyzer/test/generated/scanner_test.dart
@@ -5,24 +5,19 @@
 library analyzer.test.generated.scanner_test;
 
 import 'package:analyzer/dart/ast/token.dart';
-import 'package:analyzer/error/error.dart';
-import 'package:analyzer/error/listener.dart';
 import 'package:analyzer/src/dart/ast/token.dart';
 import 'package:analyzer/src/dart/scanner/reader.dart';
 import 'package:analyzer/src/dart/scanner/scanner.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../utils.dart';
 import 'test_support.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(CharSequenceReaderTest);
-  defineReflectiveTests(KeywordStateTest);
-  defineReflectiveTests(ScannerTest);
-  defineReflectiveTests(TokenTypeTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(LineInfoTest);
+  });
 }
 
 class CharacterRangeReaderTest extends EngineTestCase {
@@ -82,547 +77,7 @@
 }
 
 @reflectiveTest
-class CharSequenceReaderTest {
-  void test_advance() {
-    CharSequenceReader reader = new CharSequenceReader("x");
-    expect(reader.advance(), 0x78);
-    expect(reader.advance(), -1);
-    expect(reader.advance(), -1);
-  }
-
-  void test_creation() {
-    expect(new CharSequenceReader("x"), isNotNull);
-  }
-
-  void test_getOffset() {
-    CharSequenceReader reader = new CharSequenceReader("x");
-    expect(reader.offset, -1);
-    reader.advance();
-    expect(reader.offset, 0);
-    reader.advance();
-    expect(reader.offset, 0);
-  }
-
-  void test_getString() {
-    CharSequenceReader reader = new CharSequenceReader("xyzzy");
-    reader.offset = 3;
-    expect(reader.getString(1, 0), "yzz");
-    expect(reader.getString(2, 1), "zzy");
-  }
-
-  void test_peek() {
-    CharSequenceReader reader = new CharSequenceReader("xy");
-    expect(reader.peek(), 0x78);
-    expect(reader.peek(), 0x78);
-    reader.advance();
-    expect(reader.peek(), 0x79);
-    expect(reader.peek(), 0x79);
-    reader.advance();
-    expect(reader.peek(), -1);
-    expect(reader.peek(), -1);
-  }
-
-  void test_setOffset() {
-    CharSequenceReader reader = new CharSequenceReader("xyz");
-    reader.offset = 2;
-    expect(reader.offset, 2);
-  }
-}
-
-@reflectiveTest
-class KeywordStateTest {
-  void test_KeywordState() {
-    //
-    // Generate the test data to be scanned.
-    //
-    List<Keyword> keywords = Keyword.values;
-    int keywordCount = keywords.length;
-    List<String> textToTest = new List<String>(keywordCount * 3);
-    for (int i = 0; i < keywordCount; i++) {
-      String syntax = keywords[i].syntax;
-      textToTest[i] = syntax;
-      textToTest[i + keywordCount] = "${syntax}x";
-      textToTest[i + keywordCount * 2] = syntax.substring(0, syntax.length - 1);
-    }
-    //
-    // Scan each of the identifiers.
-    //
-    KeywordState firstState = KeywordState.KEYWORD_STATE;
-    for (int i = 0; i < textToTest.length; i++) {
-      String text = textToTest[i];
-      int index = 0;
-      int length = text.length;
-      KeywordState state = firstState;
-      while (index < length && state != null) {
-        state = state.next(text.codeUnitAt(index));
-        index++;
-      }
-      if (i < keywordCount) {
-        // keyword
-        expect(state, isNotNull);
-        expect(state.keyword(), isNotNull);
-        expect(state.keyword(), keywords[i]);
-      } else if (i < keywordCount * 2) {
-        // keyword + "x"
-        expect(state, isNull);
-      } else {
-        // keyword.substring(0, keyword.length() - 1)
-        expect(state, isNotNull);
-      }
-    }
-  }
-}
-
-@reflectiveTest
-class ScannerTest {
-  void fail_incomplete_string_interpolation() {
-    // https://code.google.com/p/dart/issues/detail?id=18073
-    _assertErrorAndTokens(
-        ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 9, "\"foo \${bar", [
-      new StringToken(TokenType.STRING, "\"foo ", 0),
-      new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 5),
-      new StringToken(TokenType.IDENTIFIER, "bar", 7)
-    ]);
-  }
-
-  void test_ampersand() {
-    _assertToken(TokenType.AMPERSAND, "&");
-  }
-
-  void test_ampersand_ampersand() {
-    _assertToken(TokenType.AMPERSAND_AMPERSAND, "&&");
-  }
-
-  void test_ampersand_ampersand_eq() {
-    _assertToken(TokenType.AMPERSAND_AMPERSAND_EQ, "&&=",
-        lazyAssignmentOperators: true);
-  }
-
-  void test_ampersand_eq() {
-    _assertToken(TokenType.AMPERSAND_EQ, "&=");
-  }
-
-  void test_at() {
-    _assertToken(TokenType.AT, "@");
-  }
-
-  void test_backping() {
-    _assertToken(TokenType.BACKPING, "`");
-  }
-
-  void test_backslash() {
-    _assertToken(TokenType.BACKSLASH, "\\");
-  }
-
-  void test_bang() {
-    _assertToken(TokenType.BANG, "!");
-  }
-
-  void test_bang_eq() {
-    _assertToken(TokenType.BANG_EQ, "!=");
-  }
-
-  void test_bar() {
-    _assertToken(TokenType.BAR, "|");
-  }
-
-  void test_bar_bar() {
-    _assertToken(TokenType.BAR_BAR, "||");
-  }
-
-  void test_bar_bar_eq() {
-    _assertToken(TokenType.BAR_BAR_EQ, "||=", lazyAssignmentOperators: true);
-  }
-
-  void test_bar_eq() {
-    _assertToken(TokenType.BAR_EQ, "|=");
-  }
-
-  void test_caret() {
-    _assertToken(TokenType.CARET, "^");
-  }
-
-  void test_caret_eq() {
-    _assertToken(TokenType.CARET_EQ, "^=");
-  }
-
-  void test_close_curly_bracket() {
-    _assertToken(TokenType.CLOSE_CURLY_BRACKET, "}");
-  }
-
-  void test_close_paren() {
-    _assertToken(TokenType.CLOSE_PAREN, ")");
-  }
-
-  void test_close_quare_bracket() {
-    _assertToken(TokenType.CLOSE_SQUARE_BRACKET, "]");
-  }
-
-  void test_colon() {
-    _assertToken(TokenType.COLON, ":");
-  }
-
-  void test_comma() {
-    _assertToken(TokenType.COMMA, ",");
-  }
-
-  void test_comment_disabled_multi() {
-    Scanner scanner = new Scanner(
-        null,
-        new CharSequenceReader("/* comment */ "),
-        AnalysisErrorListener.NULL_LISTENER);
-    scanner.preserveComments = false;
-    Token token = scanner.tokenize();
-    expect(token, isNotNull);
-    expect(token.precedingComments, isNull);
-  }
-
-  void test_comment_generic_method_type_assign() {
-    _assertComment(TokenType.MULTI_LINE_COMMENT, "/*=comment*/");
-    _assertComment(TokenType.GENERIC_METHOD_TYPE_ASSIGN, "/*=comment*/",
-        genericMethodComments: true);
-  }
-
-  void test_comment_generic_method_type_list() {
-    _assertComment(TokenType.MULTI_LINE_COMMENT, "/*<comment>*/");
-    _assertComment(TokenType.GENERIC_METHOD_TYPE_LIST, "/*<comment>*/",
-        genericMethodComments: true);
-  }
-
-  void test_comment_multi() {
-    _assertComment(TokenType.MULTI_LINE_COMMENT, "/* comment */");
-  }
-
-  void test_comment_multi_lineEnds() {
-    String code = r'''
-/**
- * aa
- * bbb
- * c
- */''';
-    GatheringErrorListener listener = new GatheringErrorListener();
-    Scanner scanner = new Scanner(null, new CharSequenceReader(code), listener);
-    scanner.tokenize();
-    expect(
-        scanner.lineStarts,
-        equals(<int>[
-          code.indexOf('/**'),
-          code.indexOf(' * aa'),
-          code.indexOf(' * bbb'),
-          code.indexOf(' * c'),
-          code.indexOf(' */')
-        ]));
-  }
-
-  void test_comment_multi_unterminated() {
-    _assertError(ScannerErrorCode.UNTERMINATED_MULTI_LINE_COMMENT, 3, "/* x");
-  }
-
-  void test_comment_nested() {
-    _assertComment(
-        TokenType.MULTI_LINE_COMMENT, "/* comment /* within a */ comment */");
-  }
-
-  void test_comment_single() {
-    _assertComment(TokenType.SINGLE_LINE_COMMENT, "// comment");
-  }
-
-  void test_double_both_E() {
-    _assertToken(TokenType.DOUBLE, "0.123E4");
-  }
-
-  void test_double_both_e() {
-    _assertToken(TokenType.DOUBLE, "0.123e4");
-  }
-
-  void test_double_fraction() {
-    _assertToken(TokenType.DOUBLE, ".123");
-  }
-
-  void test_double_fraction_E() {
-    _assertToken(TokenType.DOUBLE, ".123E4");
-  }
-
-  void test_double_fraction_e() {
-    _assertToken(TokenType.DOUBLE, ".123e4");
-  }
-
-  void test_double_missingDigitInExponent() {
-    _assertError(ScannerErrorCode.MISSING_DIGIT, 1, "1e");
-  }
-
-  void test_double_whole_E() {
-    _assertToken(TokenType.DOUBLE, "12E4");
-  }
-
-  void test_double_whole_e() {
-    _assertToken(TokenType.DOUBLE, "12e4");
-  }
-
-  void test_eq() {
-    _assertToken(TokenType.EQ, "=");
-  }
-
-  void test_eq_eq() {
-    _assertToken(TokenType.EQ_EQ, "==");
-  }
-
-  void test_gt() {
-    _assertToken(TokenType.GT, ">");
-  }
-
-  void test_gt_eq() {
-    _assertToken(TokenType.GT_EQ, ">=");
-  }
-
-  void test_gt_gt() {
-    _assertToken(TokenType.GT_GT, ">>");
-  }
-
-  void test_gt_gt_eq() {
-    _assertToken(TokenType.GT_GT_EQ, ">>=");
-  }
-
-  void test_hash() {
-    _assertToken(TokenType.HASH, "#");
-  }
-
-  void test_hexidecimal() {
-    _assertToken(TokenType.HEXADECIMAL, "0x1A2B3C");
-  }
-
-  void test_hexidecimal_missingDigit() {
-    _assertError(ScannerErrorCode.MISSING_HEX_DIGIT, 1, "0x");
-  }
-
-  void test_identifier() {
-    _assertToken(TokenType.IDENTIFIER, "result");
-  }
-
-  void test_illegalChar_cyrillicLetter_middle() {
-    _assertError(ScannerErrorCode.ILLEGAL_CHARACTER, 5, "Shche\u0433lov");
-  }
-
-  void test_illegalChar_cyrillicLetter_start() {
-    _assertError(ScannerErrorCode.ILLEGAL_CHARACTER, 0, "\u0429");
-  }
-
-  void test_illegalChar_nbsp() {
-    _assertError(ScannerErrorCode.ILLEGAL_CHARACTER, 0, "\u00A0");
-  }
-
-  void test_illegalChar_notLetter() {
-    _assertError(ScannerErrorCode.ILLEGAL_CHARACTER, 0, "\u0312");
-  }
-
-  void test_index() {
-    _assertToken(TokenType.INDEX, "[]");
-  }
-
-  void test_index_eq() {
-    _assertToken(TokenType.INDEX_EQ, "[]=");
-  }
-
-  void test_int() {
-    _assertToken(TokenType.INT, "123");
-  }
-
-  void test_int_initialZero() {
-    _assertToken(TokenType.INT, "0123");
-  }
-
-  void test_keyword_abstract() {
-    _assertKeywordToken("abstract");
-  }
-
-  void test_keyword_as() {
-    _assertKeywordToken("as");
-  }
-
-  void test_keyword_assert() {
-    _assertKeywordToken("assert");
-  }
-
-  void test_keyword_break() {
-    _assertKeywordToken("break");
-  }
-
-  void test_keyword_case() {
-    _assertKeywordToken("case");
-  }
-
-  void test_keyword_catch() {
-    _assertKeywordToken("catch");
-  }
-
-  void test_keyword_class() {
-    _assertKeywordToken("class");
-  }
-
-  void test_keyword_const() {
-    _assertKeywordToken("const");
-  }
-
-  void test_keyword_continue() {
-    _assertKeywordToken("continue");
-  }
-
-  void test_keyword_default() {
-    _assertKeywordToken("default");
-  }
-
-  void test_keyword_deferred() {
-    _assertKeywordToken("deferred");
-  }
-
-  void test_keyword_do() {
-    _assertKeywordToken("do");
-  }
-
-  void test_keyword_dynamic() {
-    _assertKeywordToken("dynamic");
-  }
-
-  void test_keyword_else() {
-    _assertKeywordToken("else");
-  }
-
-  void test_keyword_enum() {
-    _assertKeywordToken("enum");
-  }
-
-  void test_keyword_export() {
-    _assertKeywordToken("export");
-  }
-
-  void test_keyword_extends() {
-    _assertKeywordToken("extends");
-  }
-
-  void test_keyword_factory() {
-    _assertKeywordToken("factory");
-  }
-
-  void test_keyword_false() {
-    _assertKeywordToken("false");
-  }
-
-  void test_keyword_final() {
-    _assertKeywordToken("final");
-  }
-
-  void test_keyword_finally() {
-    _assertKeywordToken("finally");
-  }
-
-  void test_keyword_for() {
-    _assertKeywordToken("for");
-  }
-
-  void test_keyword_get() {
-    _assertKeywordToken("get");
-  }
-
-  void test_keyword_if() {
-    _assertKeywordToken("if");
-  }
-
-  void test_keyword_implements() {
-    _assertKeywordToken("implements");
-  }
-
-  void test_keyword_import() {
-    _assertKeywordToken("import");
-  }
-
-  void test_keyword_in() {
-    _assertKeywordToken("in");
-  }
-
-  void test_keyword_is() {
-    _assertKeywordToken("is");
-  }
-
-  void test_keyword_library() {
-    _assertKeywordToken("library");
-  }
-
-  void test_keyword_new() {
-    _assertKeywordToken("new");
-  }
-
-  void test_keyword_null() {
-    _assertKeywordToken("null");
-  }
-
-  void test_keyword_operator() {
-    _assertKeywordToken("operator");
-  }
-
-  void test_keyword_part() {
-    _assertKeywordToken("part");
-  }
-
-  void test_keyword_rethrow() {
-    _assertKeywordToken("rethrow");
-  }
-
-  void test_keyword_return() {
-    _assertKeywordToken("return");
-  }
-
-  void test_keyword_set() {
-    _assertKeywordToken("set");
-  }
-
-  void test_keyword_static() {
-    _assertKeywordToken("static");
-  }
-
-  void test_keyword_super() {
-    _assertKeywordToken("super");
-  }
-
-  void test_keyword_switch() {
-    _assertKeywordToken("switch");
-  }
-
-  void test_keyword_this() {
-    _assertKeywordToken("this");
-  }
-
-  void test_keyword_throw() {
-    _assertKeywordToken("throw");
-  }
-
-  void test_keyword_true() {
-    _assertKeywordToken("true");
-  }
-
-  void test_keyword_try() {
-    _assertKeywordToken("try");
-  }
-
-  void test_keyword_typedef() {
-    _assertKeywordToken("typedef");
-  }
-
-  void test_keyword_var() {
-    _assertKeywordToken("var");
-  }
-
-  void test_keyword_void() {
-    _assertKeywordToken("void");
-  }
-
-  void test_keyword_while() {
-    _assertKeywordToken("while");
-  }
-
-  void test_keyword_with() {
-    _assertKeywordToken("with");
-  }
-
+class LineInfoTest extends EngineTestCase {
   void test_lineInfo_multilineComment() {
     String source = "/*\r *\r */";
     _assertLineInfo(source, [
@@ -668,503 +123,6 @@
     ]);
   }
 
-  void test_lt() {
-    _assertToken(TokenType.LT, "<");
-  }
-
-  void test_lt_eq() {
-    _assertToken(TokenType.LT_EQ, "<=");
-  }
-
-  void test_lt_lt() {
-    _assertToken(TokenType.LT_LT, "<<");
-  }
-
-  void test_lt_lt_eq() {
-    _assertToken(TokenType.LT_LT_EQ, "<<=");
-  }
-
-  void test_minus() {
-    _assertToken(TokenType.MINUS, "-");
-  }
-
-  void test_minus_eq() {
-    _assertToken(TokenType.MINUS_EQ, "-=");
-  }
-
-  void test_minus_minus() {
-    _assertToken(TokenType.MINUS_MINUS, "--");
-  }
-
-  void test_open_curly_bracket() {
-    _assertToken(TokenType.OPEN_CURLY_BRACKET, "{");
-  }
-
-  void test_open_paren() {
-    _assertToken(TokenType.OPEN_PAREN, "(");
-  }
-
-  void test_open_square_bracket() {
-    _assertToken(TokenType.OPEN_SQUARE_BRACKET, "[");
-  }
-
-  void test_openSquareBracket() {
-    _assertToken(TokenType.OPEN_SQUARE_BRACKET, "[");
-  }
-
-  void test_percent() {
-    _assertToken(TokenType.PERCENT, "%");
-  }
-
-  void test_percent_eq() {
-    _assertToken(TokenType.PERCENT_EQ, "%=");
-  }
-
-  void test_period() {
-    _assertToken(TokenType.PERIOD, ".");
-  }
-
-  void test_period_period() {
-    _assertToken(TokenType.PERIOD_PERIOD, "..");
-  }
-
-  void test_period_period_period() {
-    _assertToken(TokenType.PERIOD_PERIOD_PERIOD, "...");
-  }
-
-  void test_periodAfterNumberNotIncluded_identifier() {
-    _assertTokens("42.isEven()", [
-      new StringToken(TokenType.INT, "42", 0),
-      new Token(TokenType.PERIOD, 2),
-      new StringToken(TokenType.IDENTIFIER, "isEven", 3),
-      new Token(TokenType.OPEN_PAREN, 9),
-      new Token(TokenType.CLOSE_PAREN, 10)
-    ]);
-  }
-
-  void test_periodAfterNumberNotIncluded_period() {
-    _assertTokens("42..isEven()", [
-      new StringToken(TokenType.INT, "42", 0),
-      new Token(TokenType.PERIOD_PERIOD, 2),
-      new StringToken(TokenType.IDENTIFIER, "isEven", 4),
-      new Token(TokenType.OPEN_PAREN, 10),
-      new Token(TokenType.CLOSE_PAREN, 11)
-    ]);
-  }
-
-  void test_plus() {
-    _assertToken(TokenType.PLUS, "+");
-  }
-
-  void test_plus_eq() {
-    _assertToken(TokenType.PLUS_EQ, "+=");
-  }
-
-  void test_plus_plus() {
-    _assertToken(TokenType.PLUS_PLUS, "++");
-  }
-
-  void test_question() {
-    _assertToken(TokenType.QUESTION, "?");
-  }
-
-  void test_question_dot() {
-    _assertToken(TokenType.QUESTION_PERIOD, "?.");
-  }
-
-  void test_question_question() {
-    _assertToken(TokenType.QUESTION_QUESTION, "??");
-  }
-
-  void test_question_question_eq() {
-    _assertToken(TokenType.QUESTION_QUESTION_EQ, "??=");
-  }
-
-  void test_scriptTag_withArgs() {
-    _assertToken(TokenType.SCRIPT_TAG, "#!/bin/dart -debug");
-  }
-
-  void test_scriptTag_withoutSpace() {
-    _assertToken(TokenType.SCRIPT_TAG, "#!/bin/dart");
-  }
-
-  void test_scriptTag_withSpace() {
-    _assertToken(TokenType.SCRIPT_TAG, "#! /bin/dart");
-  }
-
-  void test_semicolon() {
-    _assertToken(TokenType.SEMICOLON, ";");
-  }
-
-  void test_setSourceStart() {
-    int offsetDelta = 42;
-    GatheringErrorListener listener = new GatheringErrorListener();
-    Scanner scanner =
-        new Scanner(null, new SubSequenceReader("a", offsetDelta), listener);
-    scanner.setSourceStart(3, 9);
-    scanner.tokenize();
-    List<int> lineStarts = scanner.lineStarts;
-    expect(lineStarts, isNotNull);
-    expect(lineStarts.length, 3);
-    expect(lineStarts[2], 33);
-  }
-
-  void test_slash() {
-    _assertToken(TokenType.SLASH, "/");
-  }
-
-  void test_slash_eq() {
-    _assertToken(TokenType.SLASH_EQ, "/=");
-  }
-
-  void test_star() {
-    _assertToken(TokenType.STAR, "*");
-  }
-
-  void test_star_eq() {
-    _assertToken(TokenType.STAR_EQ, "*=");
-  }
-
-  void test_startAndEnd() {
-    Token token = _scan("a");
-    Token previous = token.previous;
-    expect(previous.next, token);
-    expect(previous.previous, previous);
-    Token next = token.next;
-    expect(next.next, next);
-    expect(next.previous, token);
-  }
-
-  void test_string_multi_double() {
-    _assertToken(TokenType.STRING, "\"\"\"line1\nline2\"\"\"");
-  }
-
-  void test_string_multi_embeddedQuotes() {
-    _assertToken(TokenType.STRING, "\"\"\"line1\n\"\"\nline2\"\"\"");
-  }
-
-  void test_string_multi_embeddedQuotes_escapedChar() {
-    _assertToken(TokenType.STRING, "\"\"\"a\"\"\\tb\"\"\"");
-  }
-
-  void test_string_multi_interpolation_block() {
-    _assertTokens("\"Hello \${name}!\"", [
-      new StringToken(TokenType.STRING, "\"Hello ", 0),
-      new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 7),
-      new StringToken(TokenType.IDENTIFIER, "name", 9),
-      new Token(TokenType.CLOSE_CURLY_BRACKET, 13),
-      new StringToken(TokenType.STRING, "!\"", 14)
-    ]);
-  }
-
-  void test_string_multi_interpolation_identifier() {
-    _assertTokens("\"Hello \$name!\"", [
-      new StringToken(TokenType.STRING, "\"Hello ", 0),
-      new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 7),
-      new StringToken(TokenType.IDENTIFIER, "name", 8),
-      new StringToken(TokenType.STRING, "!\"", 12)
-    ]);
-  }
-
-  void test_string_multi_single() {
-    _assertToken(TokenType.STRING, "'''string'''");
-  }
-
-  void test_string_multi_slashEnter() {
-    _assertToken(TokenType.STRING, "'''\\\n'''");
-  }
-
-  void test_string_multi_unterminated() {
-    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 8,
-        "'''string", [new StringToken(TokenType.STRING, "'''string", 0)]);
-  }
-
-  void test_string_multi_unterminated_interpolation_block() {
-    _assertErrorAndTokens(
-        ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 8, "'''\${name", [
-      new StringToken(TokenType.STRING, "'''", 0),
-      new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 3),
-      new StringToken(TokenType.IDENTIFIER, "name", 5),
-      new StringToken(TokenType.STRING, "", 9)
-    ]);
-  }
-
-  void test_string_multi_unterminated_interpolation_identifier() {
-    _assertErrorAndTokens(
-        ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 7, "'''\$name", [
-      new StringToken(TokenType.STRING, "'''", 0),
-      new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 3),
-      new StringToken(TokenType.IDENTIFIER, "name", 4),
-      new StringToken(TokenType.STRING, "", 8)
-    ]);
-  }
-
-  void test_string_raw_multi_double() {
-    _assertToken(TokenType.STRING, "r\"\"\"line1\nline2\"\"\"");
-  }
-
-  void test_string_raw_multi_single() {
-    _assertToken(TokenType.STRING, "r'''string'''");
-  }
-
-  void test_string_raw_multi_unterminated() {
-    String source = "r'''string";
-    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 9,
-        source, [new StringToken(TokenType.STRING, source, 0)]);
-  }
-
-  void test_string_raw_simple_double() {
-    _assertToken(TokenType.STRING, "r\"string\"");
-  }
-
-  void test_string_raw_simple_single() {
-    _assertToken(TokenType.STRING, "r'string'");
-  }
-
-  void test_string_raw_simple_unterminated_eof() {
-    String source = "r'string";
-    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 7,
-        source, [new StringToken(TokenType.STRING, source, 0)]);
-  }
-
-  void test_string_raw_simple_unterminated_eol() {
-    String source = "r'string";
-    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 8,
-        "$source\n", [new StringToken(TokenType.STRING, source, 0)]);
-  }
-
-  void test_string_simple_double() {
-    _assertToken(TokenType.STRING, "\"string\"");
-  }
-
-  void test_string_simple_escapedDollar() {
-    _assertToken(TokenType.STRING, "'a\\\$b'");
-  }
-
-  void test_string_simple_interpolation_adjacentIdentifiers() {
-    _assertTokens("'\$a\$b'", [
-      new StringToken(TokenType.STRING, "'", 0),
-      new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1),
-      new StringToken(TokenType.IDENTIFIER, "a", 2),
-      new StringToken(TokenType.STRING, "", 3),
-      new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 3),
-      new StringToken(TokenType.IDENTIFIER, "b", 4),
-      new StringToken(TokenType.STRING, "'", 5)
-    ]);
-  }
-
-  void test_string_simple_interpolation_block() {
-    _assertTokens("'Hello \${name}!'", [
-      new StringToken(TokenType.STRING, "'Hello ", 0),
-      new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 7),
-      new StringToken(TokenType.IDENTIFIER, "name", 9),
-      new Token(TokenType.CLOSE_CURLY_BRACKET, 13),
-      new StringToken(TokenType.STRING, "!'", 14)
-    ]);
-  }
-
-  void test_string_simple_interpolation_blockWithNestedMap() {
-    _assertTokens("'a \${f({'b' : 'c'})} d'", [
-      new StringToken(TokenType.STRING, "'a ", 0),
-      new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 3),
-      new StringToken(TokenType.IDENTIFIER, "f", 5),
-      new Token(TokenType.OPEN_PAREN, 6),
-      new Token(TokenType.OPEN_CURLY_BRACKET, 7),
-      new StringToken(TokenType.STRING, "'b'", 8),
-      new Token(TokenType.COLON, 12),
-      new StringToken(TokenType.STRING, "'c'", 14),
-      new Token(TokenType.CLOSE_CURLY_BRACKET, 17),
-      new Token(TokenType.CLOSE_PAREN, 18),
-      new Token(TokenType.CLOSE_CURLY_BRACKET, 19),
-      new StringToken(TokenType.STRING, " d'", 20)
-    ]);
-  }
-
-  void test_string_simple_interpolation_firstAndLast() {
-    _assertTokens("'\$greeting \$name'", [
-      new StringToken(TokenType.STRING, "'", 0),
-      new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1),
-      new StringToken(TokenType.IDENTIFIER, "greeting", 2),
-      new StringToken(TokenType.STRING, " ", 10),
-      new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 11),
-      new StringToken(TokenType.IDENTIFIER, "name", 12),
-      new StringToken(TokenType.STRING, "'", 16)
-    ]);
-  }
-
-  void test_string_simple_interpolation_identifier() {
-    _assertTokens("'Hello \$name!'", [
-      new StringToken(TokenType.STRING, "'Hello ", 0),
-      new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 7),
-      new StringToken(TokenType.IDENTIFIER, "name", 8),
-      new StringToken(TokenType.STRING, "!'", 12)
-    ]);
-  }
-
-  void test_string_simple_interpolation_missingIdentifier() {
-    _assertTokens("'\$x\$'", [
-      new StringToken(TokenType.STRING, "'", 0),
-      new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1),
-      new StringToken(TokenType.IDENTIFIER, "x", 2),
-      new StringToken(TokenType.STRING, "", 3),
-      new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 3),
-      new StringToken(TokenType.STRING, "'", 4)
-    ]);
-  }
-
-  void test_string_simple_interpolation_nonIdentifier() {
-    _assertTokens("'\$1'", [
-      new StringToken(TokenType.STRING, "'", 0),
-      new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1),
-      new StringToken(TokenType.STRING, "1'", 2)
-    ]);
-  }
-
-  void test_string_simple_single() {
-    _assertToken(TokenType.STRING, "'string'");
-  }
-
-  void test_string_simple_unterminated_eof() {
-    String source = "'string";
-    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 6,
-        source, [new StringToken(TokenType.STRING, source, 0)]);
-  }
-
-  void test_string_simple_unterminated_eol() {
-    String source = "'string";
-    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 7,
-        "$source\r", [new StringToken(TokenType.STRING, source, 0)]);
-  }
-
-  void test_string_simple_unterminated_interpolation_block() {
-    _assertErrorAndTokens(
-        ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 6, "'\${name", [
-      new StringToken(TokenType.STRING, "'", 0),
-      new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 1),
-      new StringToken(TokenType.IDENTIFIER, "name", 3),
-      new StringToken(TokenType.STRING, "", 7)
-    ]);
-  }
-
-  void test_string_simple_unterminated_interpolation_identifier() {
-    _assertErrorAndTokens(
-        ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 5, "'\$name", [
-      new StringToken(TokenType.STRING, "'", 0),
-      new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1),
-      new StringToken(TokenType.IDENTIFIER, "name", 2),
-      new StringToken(TokenType.STRING, "", 6)
-    ]);
-  }
-
-  void test_tilde() {
-    _assertToken(TokenType.TILDE, "~");
-  }
-
-  void test_tilde_slash() {
-    _assertToken(TokenType.TILDE_SLASH, "~/");
-  }
-
-  void test_tilde_slash_eq() {
-    _assertToken(TokenType.TILDE_SLASH_EQ, "~/=");
-  }
-
-  void test_unclosedPairInInterpolation() {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    _scanWithListener("'\${(}'", listener);
-  }
-
-  void _assertComment(TokenType commentType, String source,
-      {bool genericMethodComments: false}) {
-    //
-    // Test without a trailing end-of-line marker
-    //
-    Token token = _scan(source, genericMethodComments: genericMethodComments);
-    expect(token, isNotNull);
-    expect(token.type, TokenType.EOF);
-    Token comment = token.precedingComments;
-    expect(comment, isNotNull);
-    expect(comment.type, commentType);
-    expect(comment.offset, 0);
-    expect(comment.length, source.length);
-    expect(comment.lexeme, source);
-    //
-    // Test with a trailing end-of-line marker
-    //
-    token = _scan("$source\n", genericMethodComments: genericMethodComments);
-    expect(token, isNotNull);
-    expect(token.type, TokenType.EOF);
-    comment = token.precedingComments;
-    expect(comment, isNotNull);
-    expect(comment.type, commentType);
-    expect(comment.offset, 0);
-    expect(comment.length, source.length);
-    expect(comment.lexeme, source);
-  }
-
-  /**
-   * Assert that scanning the given [source] produces an error with the given
-   * code.
-   *
-   * [expectedError] the error that should be produced
-   * [expectedOffset] the string offset that should be associated with the error
-   * [source] the source to be scanned to produce the error
-   */
-  void _assertError(
-      ScannerErrorCode expectedError, int expectedOffset, String source) {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    _scanWithListener(source, listener);
-    listener.assertErrors([
-      new AnalysisError(null, expectedOffset, 1, expectedError,
-          [source.codeUnitAt(expectedOffset)])
-    ]);
-  }
-
-  /**
-   * Assert that scanning the given [source] produces an error with the given
-   * code, and also produces the given tokens.
-   *
-   * [expectedError] the error that should be produced
-   * [expectedOffset] the string offset that should be associated with the error
-   * [source] the source to be scanned to produce the error
-   * [expectedTokens] the tokens that are expected to be in the source
-   */
-  void _assertErrorAndTokens(ScannerErrorCode expectedError, int expectedOffset,
-      String source, List<Token> expectedTokens) {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    Token token = _scanWithListener(source, listener);
-    listener.assertErrors([
-      new AnalysisError(null, expectedOffset, 1, expectedError,
-          [source.codeUnitAt(expectedOffset)])
-    ]);
-    _checkTokens(token, expectedTokens);
-  }
-
-  /**
-   * Assert that when scanned the given [source] contains a single keyword token
-   * with the same lexeme as the original source.
-   */
-  void _assertKeywordToken(String source) {
-    Token token = _scan(source);
-    expect(token, isNotNull);
-    expect(token.type, TokenType.KEYWORD);
-    expect(token.offset, 0);
-    expect(token.length, source.length);
-    expect(token.lexeme, source);
-    Object value = token.value();
-    expect(value is Keyword, isTrue);
-    expect((value as Keyword).syntax, source);
-    token = _scan(" $source ");
-    expect(token, isNotNull);
-    expect(token.type, TokenType.KEYWORD);
-    expect(token.offset, 1);
-    expect(token.length, source.length);
-    expect(token.lexeme, source);
-    value = token.value();
-    expect(value is Keyword, isTrue);
-    expect((value as Keyword).syntax, source);
-    expect(token.next.type, TokenType.EOF);
-  }
-
   void _assertLineInfo(
       String source, List<ScannerTest_ExpectedLocation> expectedLocations) {
     GatheringErrorListener listener = new GatheringErrorListener();
@@ -1183,99 +141,6 @@
     }
   }
 
-  /**
-   * Assert that the token scanned from the given [source] has the
-   * [expectedType].
-   */
-  Token _assertToken(TokenType expectedType, String source,
-      {bool lazyAssignmentOperators: false}) {
-    Token originalToken =
-        _scan(source, lazyAssignmentOperators: lazyAssignmentOperators);
-    expect(originalToken, isNotNull);
-    expect(originalToken.type, expectedType);
-    expect(originalToken.offset, 0);
-    expect(originalToken.length, source.length);
-    expect(originalToken.lexeme, source);
-    if (expectedType == TokenType.SCRIPT_TAG) {
-      // Adding space before the script tag is not allowed, and adding text at
-      // the end changes nothing.
-      return originalToken;
-    } else if (expectedType == TokenType.SINGLE_LINE_COMMENT) {
-      // Adding space to an end-of-line comment changes the comment.
-      Token tokenWithSpaces =
-          _scan(" $source", lazyAssignmentOperators: lazyAssignmentOperators);
-      expect(tokenWithSpaces, isNotNull);
-      expect(tokenWithSpaces.type, expectedType);
-      expect(tokenWithSpaces.offset, 1);
-      expect(tokenWithSpaces.length, source.length);
-      expect(tokenWithSpaces.lexeme, source);
-      return originalToken;
-    } else if (expectedType == TokenType.INT ||
-        expectedType == TokenType.DOUBLE) {
-      Token tokenWithLowerD =
-          _scan("${source}d", lazyAssignmentOperators: lazyAssignmentOperators);
-      expect(tokenWithLowerD, isNotNull);
-      expect(tokenWithLowerD.type, expectedType);
-      expect(tokenWithLowerD.offset, 0);
-      expect(tokenWithLowerD.length, source.length);
-      expect(tokenWithLowerD.lexeme, source);
-      Token tokenWithUpperD =
-          _scan("${source}D", lazyAssignmentOperators: lazyAssignmentOperators);
-      expect(tokenWithUpperD, isNotNull);
-      expect(tokenWithUpperD.type, expectedType);
-      expect(tokenWithUpperD.offset, 0);
-      expect(tokenWithUpperD.length, source.length);
-      expect(tokenWithUpperD.lexeme, source);
-    }
-    Token tokenWithSpaces =
-        _scan(" $source ", lazyAssignmentOperators: lazyAssignmentOperators);
-    expect(tokenWithSpaces, isNotNull);
-    expect(tokenWithSpaces.type, expectedType);
-    expect(tokenWithSpaces.offset, 1);
-    expect(tokenWithSpaces.length, source.length);
-    expect(tokenWithSpaces.lexeme, source);
-    expect(originalToken.next.type, TokenType.EOF);
-    return originalToken;
-  }
-
-  /**
-   * Assert that when scanned the given [source] contains a sequence of tokens
-   * identical to the given list of [expectedTokens].
-   */
-  void _assertTokens(String source, List<Token> expectedTokens) {
-    Token token = _scan(source);
-    _checkTokens(token, expectedTokens);
-  }
-
-  void _checkTokens(Token firstToken, List<Token> expectedTokens) {
-    expect(firstToken, isNotNull);
-    Token token = firstToken;
-    for (int i = 0; i < expectedTokens.length; i++) {
-      Token expectedToken = expectedTokens[i];
-      expect(token.type, expectedToken.type, reason: "Wrong type for token $i");
-      expect(token.offset, expectedToken.offset,
-          reason: "Wrong offset for token $i");
-      expect(token.length, expectedToken.length,
-          reason: "Wrong length for token $i");
-      expect(token.lexeme, expectedToken.lexeme,
-          reason: "Wrong lexeme for token $i");
-      token = token.next;
-      expect(token, isNotNull);
-    }
-    expect(token.type, TokenType.EOF);
-  }
-
-  Token _scan(String source,
-      {bool genericMethodComments: false,
-      bool lazyAssignmentOperators: false}) {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    Token token = _scanWithListener(source, listener,
-        genericMethodComments: genericMethodComments,
-        lazyAssignmentOperators: lazyAssignmentOperators);
-    listener.assertNoErrors();
-    return token;
-  }
-
   Token _scanWithListener(String source, GatheringErrorListener listener,
       {bool genericMethodComments: false,
       bool lazyAssignmentOperators: false}) {
@@ -1369,71 +234,3 @@
     buffer.write("]");
   }
 }
-
-@reflectiveTest
-class TokenTypeTest extends EngineTestCase {
-  void test_isOperator() {
-    expect(TokenType.AMPERSAND.isOperator, isTrue);
-    expect(TokenType.AMPERSAND_AMPERSAND.isOperator, isTrue);
-    expect(TokenType.AMPERSAND_EQ.isOperator, isTrue);
-    expect(TokenType.BANG.isOperator, isTrue);
-    expect(TokenType.BANG_EQ.isOperator, isTrue);
-    expect(TokenType.BAR.isOperator, isTrue);
-    expect(TokenType.BAR_BAR.isOperator, isTrue);
-    expect(TokenType.BAR_EQ.isOperator, isTrue);
-    expect(TokenType.CARET.isOperator, isTrue);
-    expect(TokenType.CARET_EQ.isOperator, isTrue);
-    expect(TokenType.EQ.isOperator, isTrue);
-    expect(TokenType.EQ_EQ.isOperator, isTrue);
-    expect(TokenType.GT.isOperator, isTrue);
-    expect(TokenType.GT_EQ.isOperator, isTrue);
-    expect(TokenType.GT_GT.isOperator, isTrue);
-    expect(TokenType.GT_GT_EQ.isOperator, isTrue);
-    expect(TokenType.INDEX.isOperator, isTrue);
-    expect(TokenType.INDEX_EQ.isOperator, isTrue);
-    expect(TokenType.IS.isOperator, isTrue);
-    expect(TokenType.LT.isOperator, isTrue);
-    expect(TokenType.LT_EQ.isOperator, isTrue);
-    expect(TokenType.LT_LT.isOperator, isTrue);
-    expect(TokenType.LT_LT_EQ.isOperator, isTrue);
-    expect(TokenType.MINUS.isOperator, isTrue);
-    expect(TokenType.MINUS_EQ.isOperator, isTrue);
-    expect(TokenType.MINUS_MINUS.isOperator, isTrue);
-    expect(TokenType.PERCENT.isOperator, isTrue);
-    expect(TokenType.PERCENT_EQ.isOperator, isTrue);
-    expect(TokenType.PERIOD_PERIOD.isOperator, isTrue);
-    expect(TokenType.PLUS.isOperator, isTrue);
-    expect(TokenType.PLUS_EQ.isOperator, isTrue);
-    expect(TokenType.PLUS_PLUS.isOperator, isTrue);
-    expect(TokenType.QUESTION.isOperator, isTrue);
-    expect(TokenType.SLASH.isOperator, isTrue);
-    expect(TokenType.SLASH_EQ.isOperator, isTrue);
-    expect(TokenType.STAR.isOperator, isTrue);
-    expect(TokenType.STAR_EQ.isOperator, isTrue);
-    expect(TokenType.TILDE.isOperator, isTrue);
-    expect(TokenType.TILDE_SLASH.isOperator, isTrue);
-    expect(TokenType.TILDE_SLASH_EQ.isOperator, isTrue);
-  }
-
-  void test_isUserDefinableOperator() {
-    expect(TokenType.AMPERSAND.isUserDefinableOperator, isTrue);
-    expect(TokenType.BAR.isUserDefinableOperator, isTrue);
-    expect(TokenType.CARET.isUserDefinableOperator, isTrue);
-    expect(TokenType.EQ_EQ.isUserDefinableOperator, isTrue);
-    expect(TokenType.GT.isUserDefinableOperator, isTrue);
-    expect(TokenType.GT_EQ.isUserDefinableOperator, isTrue);
-    expect(TokenType.GT_GT.isUserDefinableOperator, isTrue);
-    expect(TokenType.INDEX.isUserDefinableOperator, isTrue);
-    expect(TokenType.INDEX_EQ.isUserDefinableOperator, isTrue);
-    expect(TokenType.LT.isUserDefinableOperator, isTrue);
-    expect(TokenType.LT_EQ.isUserDefinableOperator, isTrue);
-    expect(TokenType.LT_LT.isUserDefinableOperator, isTrue);
-    expect(TokenType.MINUS.isUserDefinableOperator, isTrue);
-    expect(TokenType.PERCENT.isUserDefinableOperator, isTrue);
-    expect(TokenType.PLUS.isUserDefinableOperator, isTrue);
-    expect(TokenType.SLASH.isUserDefinableOperator, isTrue);
-    expect(TokenType.STAR.isUserDefinableOperator, isTrue);
-    expect(TokenType.TILDE.isUserDefinableOperator, isTrue);
-    expect(TokenType.TILDE_SLASH.isUserDefinableOperator, isTrue);
-  }
-}
diff --git a/pkg/analyzer/test/generated/sdk_test.dart b/pkg/analyzer/test/generated/sdk_test.dart
index 5e40081..69c774e 100644
--- a/pkg/analyzer/test/generated/sdk_test.dart
+++ b/pkg/analyzer/test/generated/sdk_test.dart
@@ -6,24 +6,23 @@
 
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/sdk.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../src/context/mock_sdk.dart';
-import '../utils.dart';
 import 'test_support.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(DartSdkManagerTest);
-  defineReflectiveTests(SdkDescriptionTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(DartSdkManagerTest);
+    defineReflectiveTests(SdkDescriptionTest);
+  });
 }
 
 @reflectiveTest
 class DartSdkManagerTest extends EngineTestCase {
   void test_anySdk() {
-    DartSdkManager manager =
-        new DartSdkManager('/a/b/c', false, _failIfCreated);
+    DartSdkManager manager = new DartSdkManager('/a/b/c', false);
     expect(manager.anySdk, isNull);
 
     AnalysisOptions options = new AnalysisOptionsImpl();
@@ -34,8 +33,7 @@
   }
 
   void test_getSdk_differentDescriptors() {
-    DartSdkManager manager =
-        new DartSdkManager('/a/b/c', false, _failIfCreated);
+    DartSdkManager manager = new DartSdkManager('/a/b/c', false);
     AnalysisOptions options = new AnalysisOptionsImpl();
     SdkDescription description1 = new SdkDescription(<String>['/c/d'], options);
     DartSdk sdk1 = new MockSdk();
@@ -51,8 +49,7 @@
   }
 
   void test_getSdk_sameDescriptor() {
-    DartSdkManager manager =
-        new DartSdkManager('/a/b/c', false, _failIfCreated);
+    DartSdkManager manager = new DartSdkManager('/a/b/c', false);
     AnalysisOptions options = new AnalysisOptionsImpl();
     SdkDescription description = new SdkDescription(<String>['/c/d'], options);
     DartSdk sdk = new MockSdk();
@@ -65,11 +62,6 @@
     fail('Use of ifAbsent function');
     return null;
   }
-
-  DartSdk _failIfCreated(AnalysisOptions _) {
-    fail('Use of sdkCreator');
-    return null;
-  }
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/generated/simple_resolver_test.dart b/pkg/analyzer/test/generated/simple_resolver_test.dart
index 13a0766..4df27be 100644
--- a/pkg/analyzer/test/generated/simple_resolver_test.dart
+++ b/pkg/analyzer/test/generated/simple_resolver_test.dart
@@ -12,16 +12,16 @@
 import 'package:analyzer/src/error/codes.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source_io.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../utils.dart';
 import 'resolver_test_case.dart';
 import 'test_support.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(SimpleResolverTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(SimpleResolverTest);
+  });
 }
 
 @reflectiveTest
@@ -656,9 +656,6 @@
   }
 
   void test_fieldFormalParameter() {
-    AnalysisOptionsImpl options = new AnalysisOptionsImpl();
-    options.enableInitializingFormalAccess = true;
-    resetWithOptions(options);
     Source source = addSource(r'''
 class A {
   int x;
diff --git a/pkg/analyzer/test/generated/source_factory_test.dart b/pkg/analyzer/test/generated/source_factory_test.dart
index bc1e830..e373d67 100644
--- a/pkg/analyzer/test/generated/source_factory_test.dart
+++ b/pkg/analyzer/test/generated/source_factory_test.dart
@@ -18,17 +18,17 @@
 import 'package:package_config/packages.dart';
 import 'package:package_config/packages_file.dart' as pkgfile show parse;
 import 'package:package_config/src/packages_impl.dart';
-import 'package:path/path.dart';
+import 'package:path/path.dart' as pathos;
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../utils.dart';
 import 'test_support.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(SourceFactoryTest);
   runPackageMapTests();
+  defineReflectiveSuite(() {
+    defineReflectiveTests(SourceFactoryTest);
+  });
 }
 
 Source createSource({String path, String uri}) =>
@@ -284,7 +284,7 @@
 
   void test_resolveUri_nonAbsolute_relative_package() {
     MemoryResourceProvider provider = new MemoryResourceProvider();
-    Context context = provider.pathContext;
+    pathos.Context context = provider.pathContext;
     String packagePath =
         context.joinAll([context.separator, 'path', 'to', 'package']);
     String libPath = context.joinAll([packagePath, 'lib']);
diff --git a/pkg/analyzer/test/generated/static_type_analyzer_test.dart b/pkg/analyzer/test/generated/static_type_analyzer_test.dart
index 60854a9..ae59f48 100644
--- a/pkg/analyzer/test/generated/static_type_analyzer_test.dart
+++ b/pkg/analyzer/test/generated/static_type_analyzer_test.dart
@@ -18,23 +18,23 @@
 import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/static_type_analyzer.dart';
-import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
 import 'package:analyzer/src/generated/testing/element_factory.dart';
 import 'package:analyzer/src/generated/testing/test_type_provider.dart';
 import 'package:analyzer/src/generated/testing/token_factory.dart';
 import 'package:analyzer/src/source/source_resource.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../utils.dart';
 import 'analysis_context_factory.dart';
 import 'resolver_test_case.dart';
 import 'test_support.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(StaticTypeAnalyzerTest);
-  defineReflectiveTests(StaticTypeAnalyzer2Test);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(StaticTypeAnalyzerTest);
+    defineReflectiveTests(StaticTypeAnalyzer2Test);
+  });
 }
 
 /**
@@ -127,9 +127,6 @@
   }
 
   void test_staticMethods_classTypeParameters_genericMethod() {
-    AnalysisOptionsImpl options = new AnalysisOptionsImpl();
-    options.enableGenericMethods = true;
-    resetWithOptions(options);
     String code = r'''
 class C<T> {
   static void m<S>(S s) {
@@ -357,7 +354,7 @@
 
   void test_visitAdjacentStrings() {
     // "a" "b"
-    Expression node = AstFactory
+    Expression node = AstTestFactory
         .adjacentStrings([_resolvedString("a"), _resolvedString("b")]);
     expect(_analyze(node), same(_typeProvider.stringType));
     _listener.assertNoErrors();
@@ -369,8 +366,8 @@
     ClassElement superclass = ElementFactory.classElement2("A");
     InterfaceType superclassType = superclass.type;
     ClassElement subclass = ElementFactory.classElement("B", superclassType);
-    Expression node = AstFactory.asExpression(
-        AstFactory.thisExpression(), AstFactory.typeName(subclass));
+    Expression node = AstTestFactory.asExpression(
+        AstTestFactory.thisExpression(), AstTestFactory.typeName(subclass));
     expect(_analyze3(node, superclassType), same(subclass.type));
     _listener.assertNoErrors();
   }
@@ -380,7 +377,7 @@
       InterfaceType numType = _typeProvider.numType;
       InterfaceType intType = _typeProvider.intType;
       SimpleIdentifier identifier = _resolvedVariable(intType, "i");
-      AssignmentExpression node = AstFactory.assignmentExpression(
+      AssignmentExpression node = AstTestFactory.assignmentExpression(
           identifier, operator, _resolvedInteger(1));
       MethodElement plusMethod = getMethod(numType, "+");
       node.staticElement = plusMethod;
@@ -399,7 +396,7 @@
     validate(TokenType operator) {
       InterfaceType boolType = _typeProvider.boolType;
       SimpleIdentifier identifier = _resolvedVariable(boolType, "b");
-      AssignmentExpression node = AstFactory.assignmentExpression(
+      AssignmentExpression node = AstTestFactory.assignmentExpression(
           identifier, operator, _resolvedBool(true));
       expect(_analyze(node), same(boolType));
       _listener.assertNoErrors();
@@ -415,7 +412,7 @@
       InterfaceType intType = _typeProvider.intType;
       InterfaceType doubleType = _typeProvider.doubleType;
       SimpleIdentifier identifier = _resolvedVariable(intType, "i");
-      AssignmentExpression node = AstFactory.assignmentExpression(
+      AssignmentExpression node = AstTestFactory.assignmentExpression(
           identifier, operator, _resolvedDouble(1.0));
       MethodElement plusMethod = getMethod(numType, "+");
       node.staticElement = plusMethod;
@@ -431,7 +428,7 @@
 
   void test_visitAssignmentExpression_compoundIfNull_differentTypes() {
     // double d; d ??= 0
-    Expression node = AstFactory.assignmentExpression(
+    Expression node = AstTestFactory.assignmentExpression(
         _resolvedVariable(_typeProvider.doubleType, 'd'),
         TokenType.QUESTION_QUESTION_EQ,
         _resolvedInteger(0));
@@ -441,7 +438,7 @@
 
   void test_visitAssignmentExpression_compoundIfNull_sameTypes() {
     // int i; i ??= 0
-    Expression node = AstFactory.assignmentExpression(
+    Expression node = AstTestFactory.assignmentExpression(
         _resolvedVariable(_typeProvider.intType, 'i'),
         TokenType.QUESTION_QUESTION_EQ,
         _resolvedInteger(0));
@@ -452,7 +449,7 @@
   void test_visitAssignmentExpression_simple() {
     // i = 0
     InterfaceType intType = _typeProvider.intType;
-    Expression node = AstFactory.assignmentExpression(
+    Expression node = AstTestFactory.assignmentExpression(
         _resolvedVariable(intType, "i"), TokenType.EQ, _resolvedInteger(0));
     expect(_analyze(node), same(intType));
     _listener.assertNoErrors();
@@ -465,8 +462,8 @@
         _typeProvider.futureType.instantiate(<DartType>[intType]);
     InterfaceType futureFutureIntType =
         _typeProvider.futureType.instantiate(<DartType>[futureIntType]);
-    Expression node =
-        AstFactory.awaitExpression(_resolvedVariable(futureFutureIntType, 'e'));
+    Expression node = AstTestFactory
+        .awaitExpression(_resolvedVariable(futureFutureIntType, 'e'));
     expect(_analyze(node), same(intType));
     _listener.assertNoErrors();
   }
@@ -477,14 +474,14 @@
     InterfaceType futureIntType =
         _typeProvider.futureType.instantiate(<DartType>[intType]);
     Expression node =
-        AstFactory.awaitExpression(_resolvedVariable(futureIntType, 'e'));
+        AstTestFactory.awaitExpression(_resolvedVariable(futureIntType, 'e'));
     expect(_analyze(node), same(intType));
     _listener.assertNoErrors();
   }
 
   void test_visitBinaryExpression_equals() {
     // 2 == 3
-    Expression node = AstFactory.binaryExpression(
+    Expression node = AstTestFactory.binaryExpression(
         _resolvedInteger(2), TokenType.EQ_EQ, _resolvedInteger(3));
     expect(_analyze(node), same(_typeProvider.boolType));
     _listener.assertNoErrors();
@@ -492,7 +489,7 @@
 
   void test_visitBinaryExpression_ifNull() {
     // 1 ?? 1.5
-    Expression node = AstFactory.binaryExpression(
+    Expression node = AstTestFactory.binaryExpression(
         _resolvedInteger(1), TokenType.QUESTION_QUESTION, _resolvedDouble(1.5));
     expect(_analyze(node), same(_typeProvider.numType));
     _listener.assertNoErrors();
@@ -500,27 +497,27 @@
 
   void test_visitBinaryExpression_logicalAnd() {
     // false && true
-    Expression node = AstFactory.binaryExpression(
-        AstFactory.booleanLiteral(false),
+    Expression node = AstTestFactory.binaryExpression(
+        AstTestFactory.booleanLiteral(false),
         TokenType.AMPERSAND_AMPERSAND,
-        AstFactory.booleanLiteral(true));
+        AstTestFactory.booleanLiteral(true));
     expect(_analyze(node), same(_typeProvider.boolType));
     _listener.assertNoErrors();
   }
 
   void test_visitBinaryExpression_logicalOr() {
     // false || true
-    Expression node = AstFactory.binaryExpression(
-        AstFactory.booleanLiteral(false),
+    Expression node = AstTestFactory.binaryExpression(
+        AstTestFactory.booleanLiteral(false),
         TokenType.BAR_BAR,
-        AstFactory.booleanLiteral(true));
+        AstTestFactory.booleanLiteral(true));
     expect(_analyze(node), same(_typeProvider.boolType));
     _listener.assertNoErrors();
   }
 
   void test_visitBinaryExpression_minusID_propagated() {
     // a - b
-    BinaryExpression node = AstFactory.binaryExpression(
+    BinaryExpression node = AstTestFactory.binaryExpression(
         _propagatedVariable(_typeProvider.intType, 'a'),
         TokenType.MINUS,
         _propagatedVariable(_typeProvider.doubleType, 'b'));
@@ -532,7 +529,7 @@
 
   void test_visitBinaryExpression_notEquals() {
     // 2 != 3
-    Expression node = AstFactory.binaryExpression(
+    Expression node = AstTestFactory.binaryExpression(
         _resolvedInteger(2), TokenType.BANG_EQ, _resolvedInteger(3));
     expect(_analyze(node), same(_typeProvider.boolType));
     _listener.assertNoErrors();
@@ -540,7 +537,7 @@
 
   void test_visitBinaryExpression_plusID() {
     // 1 + 2.0
-    BinaryExpression node = AstFactory.binaryExpression(
+    BinaryExpression node = AstTestFactory.binaryExpression(
         _resolvedInteger(1), TokenType.PLUS, _resolvedDouble(2.0));
     node.staticElement = getMethod(_typeProvider.numType, "+");
     expect(_analyze(node), same(_typeProvider.doubleType));
@@ -549,7 +546,7 @@
 
   void test_visitBinaryExpression_plusII() {
     // 1 + 2
-    BinaryExpression node = AstFactory.binaryExpression(
+    BinaryExpression node = AstTestFactory.binaryExpression(
         _resolvedInteger(1), TokenType.PLUS, _resolvedInteger(2));
     node.staticElement = getMethod(_typeProvider.numType, "+");
     expect(_analyze(node), same(_typeProvider.intType));
@@ -558,7 +555,7 @@
 
   void test_visitBinaryExpression_plusII_propagated() {
     // a + b
-    BinaryExpression node = AstFactory.binaryExpression(
+    BinaryExpression node = AstTestFactory.binaryExpression(
         _propagatedVariable(_typeProvider.intType, 'a'),
         TokenType.PLUS,
         _propagatedVariable(_typeProvider.intType, 'b'));
@@ -570,7 +567,7 @@
 
   void test_visitBinaryExpression_slash() {
     // 2 / 2
-    BinaryExpression node = AstFactory.binaryExpression(
+    BinaryExpression node = AstTestFactory.binaryExpression(
         _resolvedInteger(2), TokenType.SLASH, _resolvedInteger(2));
     node.staticElement = getMethod(_typeProvider.numType, "/");
     expect(_analyze(node), same(_typeProvider.doubleType));
@@ -587,9 +584,9 @@
     MethodElement operator =
         ElementFactory.methodElement("*", typeA, [_typeProvider.doubleType]);
     classA.methods = <MethodElement>[operator];
-    BinaryExpression node = AstFactory.binaryExpression(
-        AstFactory.asExpression(
-            AstFactory.identifier3("a"), AstFactory.typeName(classA)),
+    BinaryExpression node = AstTestFactory.binaryExpression(
+        AstTestFactory.asExpression(
+            AstTestFactory.identifier3("a"), AstTestFactory.typeName(classA)),
         TokenType.PLUS,
         _resolvedDouble(2.0));
     node.staticElement = operator;
@@ -599,7 +596,7 @@
 
   void test_visitBinaryExpression_starID() {
     // 1 * 2.0
-    BinaryExpression node = AstFactory.binaryExpression(
+    BinaryExpression node = AstTestFactory.binaryExpression(
         _resolvedInteger(1), TokenType.PLUS, _resolvedDouble(2.0));
     node.staticElement = getMethod(_typeProvider.numType, "*");
     expect(_analyze(node), same(_typeProvider.doubleType));
@@ -608,30 +605,30 @@
 
   void test_visitBooleanLiteral_false() {
     // false
-    Expression node = AstFactory.booleanLiteral(false);
+    Expression node = AstTestFactory.booleanLiteral(false);
     expect(_analyze(node), same(_typeProvider.boolType));
     _listener.assertNoErrors();
   }
 
   void test_visitBooleanLiteral_true() {
     // true
-    Expression node = AstFactory.booleanLiteral(true);
+    Expression node = AstTestFactory.booleanLiteral(true);
     expect(_analyze(node), same(_typeProvider.boolType));
     _listener.assertNoErrors();
   }
 
   void test_visitCascadeExpression() {
     // a..length
-    Expression node = AstFactory.cascadeExpression(
-        _resolvedString("a"), [AstFactory.propertyAccess2(null, "length")]);
+    Expression node = AstTestFactory.cascadeExpression(
+        _resolvedString("a"), [AstTestFactory.propertyAccess2(null, "length")]);
     expect(_analyze(node), same(_typeProvider.stringType));
     _listener.assertNoErrors();
   }
 
   void test_visitConditionalExpression_differentTypes() {
     // true ? 1.0 : 0
-    Expression node = AstFactory.conditionalExpression(
-        AstFactory.booleanLiteral(true),
+    Expression node = AstTestFactory.conditionalExpression(
+        AstTestFactory.booleanLiteral(true),
         _resolvedDouble(1.0),
         _resolvedInteger(0));
     expect(_analyze(node), same(_typeProvider.numType));
@@ -640,8 +637,8 @@
 
   void test_visitConditionalExpression_sameTypes() {
     // true ? 1 : 0
-    Expression node = AstFactory.conditionalExpression(
-        AstFactory.booleanLiteral(true),
+    Expression node = AstTestFactory.conditionalExpression(
+        AstTestFactory.booleanLiteral(true),
         _resolvedInteger(1),
         _resolvedInteger(0));
     expect(_analyze(node), same(_typeProvider.intType));
@@ -650,17 +647,17 @@
 
   void test_visitDoubleLiteral() {
     // 4.33
-    Expression node = AstFactory.doubleLiteral(4.33);
+    Expression node = AstTestFactory.doubleLiteral(4.33);
     expect(_analyze(node), same(_typeProvider.doubleType));
     _listener.assertNoErrors();
   }
 
   void test_visitFunctionExpression_async_block() {
     // () async {}
-    BlockFunctionBody body = AstFactory.blockFunctionBody2();
+    BlockFunctionBody body = AstTestFactory.blockFunctionBody2();
     body.keyword = TokenFactory.tokenFromString('async');
-    FunctionExpression node =
-        _resolvedFunctionExpression(AstFactory.formalParameterList([]), body);
+    FunctionExpression node = _resolvedFunctionExpression(
+        AstTestFactory.formalParameterList([]), body);
     DartType resultType = _analyze(node);
     _assertFunctionType(
         _typeProvider.futureDynamicType, null, null, null, resultType);
@@ -673,10 +670,11 @@
     InterfaceType futureIntType =
         _typeProvider.futureType.instantiate(<DartType>[intType]);
     Expression expression = _resolvedVariable(intType, 'e');
-    ExpressionFunctionBody body = AstFactory.expressionFunctionBody(expression);
+    ExpressionFunctionBody body =
+        AstTestFactory.expressionFunctionBody(expression);
     body.keyword = TokenFactory.tokenFromString('async');
-    FunctionExpression node =
-        _resolvedFunctionExpression(AstFactory.formalParameterList([]), body);
+    FunctionExpression node = _resolvedFunctionExpression(
+        AstTestFactory.formalParameterList([]), body);
     DartType resultType = _analyze(node);
     _assertFunctionType(futureIntType, null, null, null, resultType);
     _listener.assertNoErrors();
@@ -688,10 +686,11 @@
     InterfaceType futureIntType =
         _typeProvider.futureType.instantiate(<DartType>[intType]);
     Expression expression = _resolvedVariable(futureIntType, 'e');
-    ExpressionFunctionBody body = AstFactory.expressionFunctionBody(expression);
+    ExpressionFunctionBody body =
+        AstTestFactory.expressionFunctionBody(expression);
     body.keyword = TokenFactory.tokenFromString('async');
-    FunctionExpression node =
-        _resolvedFunctionExpression(AstFactory.formalParameterList([]), body);
+    FunctionExpression node = _resolvedFunctionExpression(
+        AstTestFactory.formalParameterList([]), body);
     DartType resultType = _analyze(node);
     _assertFunctionType(futureIntType, null, null, null, resultType);
     _listener.assertNoErrors();
@@ -705,10 +704,11 @@
     InterfaceType futureFutureIntType =
         _typeProvider.futureType.instantiate(<DartType>[futureIntType]);
     Expression expression = _resolvedVariable(futureFutureIntType, 'e');
-    ExpressionFunctionBody body = AstFactory.expressionFunctionBody(expression);
+    ExpressionFunctionBody body =
+        AstTestFactory.expressionFunctionBody(expression);
     body.keyword = TokenFactory.tokenFromString('async');
-    FunctionExpression node =
-        _resolvedFunctionExpression(AstFactory.formalParameterList([]), body);
+    FunctionExpression node = _resolvedFunctionExpression(
+        AstTestFactory.formalParameterList([]), body);
     DartType resultType = _analyze(node);
     _assertFunctionType(futureIntType, null, null, null, resultType);
     _listener.assertNoErrors();
@@ -716,11 +716,11 @@
 
   void test_visitFunctionExpression_generator_async() {
     // () async* {}
-    BlockFunctionBody body = AstFactory.blockFunctionBody2();
+    BlockFunctionBody body = AstTestFactory.blockFunctionBody2();
     body.keyword = TokenFactory.tokenFromString('async');
     body.star = TokenFactory.tokenFromType(TokenType.STAR);
-    FunctionExpression node =
-        _resolvedFunctionExpression(AstFactory.formalParameterList([]), body);
+    FunctionExpression node = _resolvedFunctionExpression(
+        AstTestFactory.formalParameterList([]), body);
     DartType resultType = _analyze(node);
     _assertFunctionType(
         _typeProvider.streamDynamicType, null, null, null, resultType);
@@ -729,11 +729,11 @@
 
   void test_visitFunctionExpression_generator_sync() {
     // () sync* {}
-    BlockFunctionBody body = AstFactory.blockFunctionBody2();
+    BlockFunctionBody body = AstTestFactory.blockFunctionBody2();
     body.keyword = TokenFactory.tokenFromString('sync');
     body.star = TokenFactory.tokenFromType(TokenType.STAR);
-    FunctionExpression node =
-        _resolvedFunctionExpression(AstFactory.formalParameterList([]), body);
+    FunctionExpression node = _resolvedFunctionExpression(
+        AstTestFactory.formalParameterList([]), body);
     DartType resultType = _analyze(node);
     _assertFunctionType(
         _typeProvider.iterableDynamicType, null, null, null, resultType);
@@ -743,15 +743,15 @@
   void test_visitFunctionExpression_named_block() {
     // ({p1 : 0, p2 : 0}) {}
     DartType dynamicType = _typeProvider.dynamicType;
-    FormalParameter p1 = AstFactory.namedFormalParameter(
-        AstFactory.simpleFormalParameter3("p1"), _resolvedInteger(0));
+    FormalParameter p1 = AstTestFactory.namedFormalParameter(
+        AstTestFactory.simpleFormalParameter3("p1"), _resolvedInteger(0));
     _setType(p1, dynamicType);
-    FormalParameter p2 = AstFactory.namedFormalParameter(
-        AstFactory.simpleFormalParameter3("p2"), _resolvedInteger(0));
+    FormalParameter p2 = AstTestFactory.namedFormalParameter(
+        AstTestFactory.simpleFormalParameter3("p2"), _resolvedInteger(0));
     _setType(p2, dynamicType);
     FunctionExpression node = _resolvedFunctionExpression(
-        AstFactory.formalParameterList([p1, p2]),
-        AstFactory.blockFunctionBody2());
+        AstTestFactory.formalParameterList([p1, p2]),
+        AstTestFactory.blockFunctionBody2());
     _analyze5(p1);
     _analyze5(p2);
     DartType resultType = _analyze(node);
@@ -766,12 +766,12 @@
   void test_visitFunctionExpression_named_expression() {
     // ({p : 0}) -> 0;
     DartType dynamicType = _typeProvider.dynamicType;
-    FormalParameter p = AstFactory.namedFormalParameter(
-        AstFactory.simpleFormalParameter3("p"), _resolvedInteger(0));
+    FormalParameter p = AstTestFactory.namedFormalParameter(
+        AstTestFactory.simpleFormalParameter3("p"), _resolvedInteger(0));
     _setType(p, dynamicType);
     FunctionExpression node = _resolvedFunctionExpression(
-        AstFactory.formalParameterList([p]),
-        AstFactory.expressionFunctionBody(_resolvedInteger(0)));
+        AstTestFactory.formalParameterList([p]),
+        AstTestFactory.expressionFunctionBody(_resolvedInteger(0)));
     _analyze5(p);
     DartType resultType = _analyze(node);
     Map<String, DartType> expectedNamedTypes = new HashMap<String, DartType>();
@@ -784,13 +784,13 @@
   void test_visitFunctionExpression_normal_block() {
     // (p1, p2) {}
     DartType dynamicType = _typeProvider.dynamicType;
-    FormalParameter p1 = AstFactory.simpleFormalParameter3("p1");
+    FormalParameter p1 = AstTestFactory.simpleFormalParameter3("p1");
     _setType(p1, dynamicType);
-    FormalParameter p2 = AstFactory.simpleFormalParameter3("p2");
+    FormalParameter p2 = AstTestFactory.simpleFormalParameter3("p2");
     _setType(p2, dynamicType);
     FunctionExpression node = _resolvedFunctionExpression(
-        AstFactory.formalParameterList([p1, p2]),
-        AstFactory.blockFunctionBody2());
+        AstTestFactory.formalParameterList([p1, p2]),
+        AstTestFactory.blockFunctionBody2());
     _analyze5(p1);
     _analyze5(p2);
     DartType resultType = _analyze(node);
@@ -802,11 +802,11 @@
   void test_visitFunctionExpression_normal_expression() {
     // (p1, p2) -> 0
     DartType dynamicType = _typeProvider.dynamicType;
-    FormalParameter p = AstFactory.simpleFormalParameter3("p");
+    FormalParameter p = AstTestFactory.simpleFormalParameter3("p");
     _setType(p, dynamicType);
     FunctionExpression node = _resolvedFunctionExpression(
-        AstFactory.formalParameterList([p]),
-        AstFactory.expressionFunctionBody(_resolvedInteger(0)));
+        AstTestFactory.formalParameterList([p]),
+        AstTestFactory.expressionFunctionBody(_resolvedInteger(0)));
     _analyze5(p);
     DartType resultType = _analyze(node);
     _assertFunctionType(
@@ -817,14 +817,14 @@
   void test_visitFunctionExpression_normalAndNamed_block() {
     // (p1, {p2 : 0}) {}
     DartType dynamicType = _typeProvider.dynamicType;
-    FormalParameter p1 = AstFactory.simpleFormalParameter3("p1");
+    FormalParameter p1 = AstTestFactory.simpleFormalParameter3("p1");
     _setType(p1, dynamicType);
-    FormalParameter p2 = AstFactory.namedFormalParameter(
-        AstFactory.simpleFormalParameter3("p2"), _resolvedInteger(0));
+    FormalParameter p2 = AstTestFactory.namedFormalParameter(
+        AstTestFactory.simpleFormalParameter3("p2"), _resolvedInteger(0));
     _setType(p2, dynamicType);
     FunctionExpression node = _resolvedFunctionExpression(
-        AstFactory.formalParameterList([p1, p2]),
-        AstFactory.blockFunctionBody2());
+        AstTestFactory.formalParameterList([p1, p2]),
+        AstTestFactory.blockFunctionBody2());
     _analyze5(p2);
     DartType resultType = _analyze(node);
     Map<String, DartType> expectedNamedTypes = new HashMap<String, DartType>();
@@ -837,14 +837,14 @@
   void test_visitFunctionExpression_normalAndNamed_expression() {
     // (p1, {p2 : 0}) -> 0
     DartType dynamicType = _typeProvider.dynamicType;
-    FormalParameter p1 = AstFactory.simpleFormalParameter3("p1");
+    FormalParameter p1 = AstTestFactory.simpleFormalParameter3("p1");
     _setType(p1, dynamicType);
-    FormalParameter p2 = AstFactory.namedFormalParameter(
-        AstFactory.simpleFormalParameter3("p2"), _resolvedInteger(0));
+    FormalParameter p2 = AstTestFactory.namedFormalParameter(
+        AstTestFactory.simpleFormalParameter3("p2"), _resolvedInteger(0));
     _setType(p2, dynamicType);
     FunctionExpression node = _resolvedFunctionExpression(
-        AstFactory.formalParameterList([p1, p2]),
-        AstFactory.expressionFunctionBody(_resolvedInteger(0)));
+        AstTestFactory.formalParameterList([p1, p2]),
+        AstTestFactory.expressionFunctionBody(_resolvedInteger(0)));
     _analyze5(p2);
     DartType resultType = _analyze(node);
     Map<String, DartType> expectedNamedTypes = new HashMap<String, DartType>();
@@ -857,14 +857,14 @@
   void test_visitFunctionExpression_normalAndPositional_block() {
     // (p1, [p2 = 0]) {}
     DartType dynamicType = _typeProvider.dynamicType;
-    FormalParameter p1 = AstFactory.simpleFormalParameter3("p1");
+    FormalParameter p1 = AstTestFactory.simpleFormalParameter3("p1");
     _setType(p1, dynamicType);
-    FormalParameter p2 = AstFactory.positionalFormalParameter(
-        AstFactory.simpleFormalParameter3("p2"), _resolvedInteger(0));
+    FormalParameter p2 = AstTestFactory.positionalFormalParameter(
+        AstTestFactory.simpleFormalParameter3("p2"), _resolvedInteger(0));
     _setType(p2, dynamicType);
     FunctionExpression node = _resolvedFunctionExpression(
-        AstFactory.formalParameterList([p1, p2]),
-        AstFactory.blockFunctionBody2());
+        AstTestFactory.formalParameterList([p1, p2]),
+        AstTestFactory.blockFunctionBody2());
     _analyze5(p1);
     _analyze5(p2);
     DartType resultType = _analyze(node);
@@ -876,14 +876,14 @@
   void test_visitFunctionExpression_normalAndPositional_expression() {
     // (p1, [p2 = 0]) -> 0
     DartType dynamicType = _typeProvider.dynamicType;
-    FormalParameter p1 = AstFactory.simpleFormalParameter3("p1");
+    FormalParameter p1 = AstTestFactory.simpleFormalParameter3("p1");
     _setType(p1, dynamicType);
-    FormalParameter p2 = AstFactory.positionalFormalParameter(
-        AstFactory.simpleFormalParameter3("p2"), _resolvedInteger(0));
+    FormalParameter p2 = AstTestFactory.positionalFormalParameter(
+        AstTestFactory.simpleFormalParameter3("p2"), _resolvedInteger(0));
     _setType(p2, dynamicType);
     FunctionExpression node = _resolvedFunctionExpression(
-        AstFactory.formalParameterList([p1, p2]),
-        AstFactory.expressionFunctionBody(_resolvedInteger(0)));
+        AstTestFactory.formalParameterList([p1, p2]),
+        AstTestFactory.expressionFunctionBody(_resolvedInteger(0)));
     _analyze5(p1);
     _analyze5(p2);
     DartType resultType = _analyze(node);
@@ -895,15 +895,15 @@
   void test_visitFunctionExpression_positional_block() {
     // ([p1 = 0, p2 = 0]) {}
     DartType dynamicType = _typeProvider.dynamicType;
-    FormalParameter p1 = AstFactory.positionalFormalParameter(
-        AstFactory.simpleFormalParameter3("p1"), _resolvedInteger(0));
+    FormalParameter p1 = AstTestFactory.positionalFormalParameter(
+        AstTestFactory.simpleFormalParameter3("p1"), _resolvedInteger(0));
     _setType(p1, dynamicType);
-    FormalParameter p2 = AstFactory.positionalFormalParameter(
-        AstFactory.simpleFormalParameter3("p2"), _resolvedInteger(0));
+    FormalParameter p2 = AstTestFactory.positionalFormalParameter(
+        AstTestFactory.simpleFormalParameter3("p2"), _resolvedInteger(0));
     _setType(p2, dynamicType);
     FunctionExpression node = _resolvedFunctionExpression(
-        AstFactory.formalParameterList([p1, p2]),
-        AstFactory.blockFunctionBody2());
+        AstTestFactory.formalParameterList([p1, p2]),
+        AstTestFactory.blockFunctionBody2());
     _analyze5(p1);
     _analyze5(p2);
     DartType resultType = _analyze(node);
@@ -915,12 +915,12 @@
   void test_visitFunctionExpression_positional_expression() {
     // ([p1 = 0, p2 = 0]) -> 0
     DartType dynamicType = _typeProvider.dynamicType;
-    FormalParameter p = AstFactory.positionalFormalParameter(
-        AstFactory.simpleFormalParameter3("p"), _resolvedInteger(0));
+    FormalParameter p = AstTestFactory.positionalFormalParameter(
+        AstTestFactory.simpleFormalParameter3("p"), _resolvedInteger(0));
     _setType(p, dynamicType);
     FunctionExpression node = _resolvedFunctionExpression(
-        AstFactory.formalParameterList([p]),
-        AstFactory.expressionFunctionBody(_resolvedInteger(0)));
+        AstTestFactory.formalParameterList([p]),
+        AstTestFactory.expressionFunctionBody(_resolvedInteger(0)));
     _analyze5(p);
     DartType resultType = _analyze(node);
     _assertFunctionType(
@@ -934,7 +934,7 @@
     InterfaceType listType = _typeProvider.listType;
     SimpleIdentifier identifier = _resolvedVariable(listType, "a");
     IndexExpression node =
-        AstFactory.indexExpression(identifier, _resolvedInteger(2));
+        AstTestFactory.indexExpression(identifier, _resolvedInteger(2));
     MethodElement indexMethod = listType.element.methods[0];
     node.staticElement = indexMethod;
     expect(_analyze(node), same(listType.typeArguments[0]));
@@ -947,10 +947,11 @@
     InterfaceType listType = _typeProvider.listType;
     SimpleIdentifier identifier = _resolvedVariable(listType, "a");
     IndexExpression node =
-        AstFactory.indexExpression(identifier, _resolvedInteger(2));
+        AstTestFactory.indexExpression(identifier, _resolvedInteger(2));
     MethodElement indexMethod = listType.element.methods[1];
     node.staticElement = indexMethod;
-    AstFactory.assignmentExpression(node, TokenType.EQ, AstFactory.integer(0));
+    AstTestFactory.assignmentExpression(
+        node, TokenType.EQ, AstTestFactory.integer(0));
     expect(_analyze(node), same(listType.typeArguments[0]));
     _listener.assertNoErrors();
   }
@@ -963,12 +964,12 @@
     // (int) -> E
     MethodElement methodElement = getMethod(listType, "[]");
     // "list" has type List<int>
-    SimpleIdentifier identifier = AstFactory.identifier3("list");
+    SimpleIdentifier identifier = AstTestFactory.identifier3("list");
     InterfaceType listOfIntType = listType.instantiate(<DartType>[intType]);
     identifier.staticType = listOfIntType;
     // list[0] has MethodElement element (int) -> E
     IndexExpression indexExpression =
-        AstFactory.indexExpression(identifier, AstFactory.integer(0));
+        AstTestFactory.indexExpression(identifier, AstTestFactory.integer(0));
     MethodElement indexMethod = MethodMember.from(methodElement, listOfIntType);
     indexExpression.staticElement = indexMethod;
     // analyze and assert result of the index expression
@@ -984,17 +985,17 @@
     // (int, E) -> void
     MethodElement methodElement = getMethod(listType, "[]=");
     // "list" has type List<int>
-    SimpleIdentifier identifier = AstFactory.identifier3("list");
+    SimpleIdentifier identifier = AstTestFactory.identifier3("list");
     InterfaceType listOfIntType = listType.instantiate(<DartType>[intType]);
     identifier.staticType = listOfIntType;
     // list[0] has MethodElement element (int) -> E
     IndexExpression indexExpression =
-        AstFactory.indexExpression(identifier, AstFactory.integer(0));
+        AstTestFactory.indexExpression(identifier, AstTestFactory.integer(0));
     MethodElement indexMethod = MethodMember.from(methodElement, listOfIntType);
     indexExpression.staticElement = indexMethod;
     // list[0] should be in a setter context
-    AstFactory.assignmentExpression(
-        indexExpression, TokenType.EQ, AstFactory.integer(0));
+    AstTestFactory.assignmentExpression(
+        indexExpression, TokenType.EQ, AstTestFactory.integer(0));
     // analyze and assert result of the index expression
     expect(_analyze(indexExpression), same(intType));
     _listener.assertNoErrors();
@@ -1007,10 +1008,11 @@
     ConstructorElementImpl constructor =
         ElementFactory.constructorElement2(classElement, constructorName);
     classElement.constructors = <ConstructorElement>[constructor];
-    InstanceCreationExpression node = AstFactory.instanceCreationExpression2(
-        null,
-        AstFactory.typeName(classElement),
-        [AstFactory.identifier3(constructorName)]);
+    InstanceCreationExpression node = AstTestFactory
+        .instanceCreationExpression2(
+            null,
+            AstTestFactory.typeName(classElement),
+            [AstTestFactory.identifier3(constructorName)]);
     node.staticElement = constructor;
     expect(_analyze(node), same(classElement.type));
     _listener.assertNoErrors();
@@ -1024,10 +1026,10 @@
         ElementFactory.constructorElement2(elementC, null);
     elementC.constructors = <ConstructorElement>[constructor];
     TypeName typeName =
-        AstFactory.typeName(elementC, [AstFactory.typeName(elementI)]);
+        AstTestFactory.typeName(elementC, [AstTestFactory.typeName(elementI)]);
     typeName.type = elementC.type.instantiate(<DartType>[elementI.type]);
     InstanceCreationExpression node =
-        AstFactory.instanceCreationExpression2(null, typeName);
+        AstTestFactory.instanceCreationExpression2(null, typeName);
     node.staticElement = constructor;
     InterfaceType interfaceType = _analyze(node) as InterfaceType;
     List<DartType> typeArgs = interfaceType.typeArguments;
@@ -1042,8 +1044,9 @@
     ConstructorElementImpl constructor =
         ElementFactory.constructorElement2(classElement, null);
     classElement.constructors = <ConstructorElement>[constructor];
-    InstanceCreationExpression node = AstFactory.instanceCreationExpression2(
-        null, AstFactory.typeName(classElement));
+    InstanceCreationExpression node =
+        AstTestFactory.instanceCreationExpression2(
+            null, AstTestFactory.typeName(classElement));
     node.staticElement = constructor;
     expect(_analyze(node), same(classElement.type));
     _listener.assertNoErrors();
@@ -1058,23 +1061,23 @@
 
   void test_visitIsExpression_negated() {
     // a is! String
-    Expression node = AstFactory.isExpression(
-        _resolvedString("a"), true, AstFactory.typeName4("String"));
+    Expression node = AstTestFactory.isExpression(
+        _resolvedString("a"), true, AstTestFactory.typeName4("String"));
     expect(_analyze(node), same(_typeProvider.boolType));
     _listener.assertNoErrors();
   }
 
   void test_visitIsExpression_notNegated() {
     // a is String
-    Expression node = AstFactory.isExpression(
-        _resolvedString("a"), false, AstFactory.typeName4("String"));
+    Expression node = AstTestFactory.isExpression(
+        _resolvedString("a"), false, AstTestFactory.typeName4("String"));
     expect(_analyze(node), same(_typeProvider.boolType));
     _listener.assertNoErrors();
   }
 
   void test_visitListLiteral_empty() {
     // []
-    Expression node = AstFactory.listLiteral();
+    Expression node = AstTestFactory.listLiteral();
     DartType resultType = _analyze(node);
     _assertType2(
         _typeProvider.listType
@@ -1085,7 +1088,7 @@
 
   void test_visitListLiteral_nonEmpty() {
     // [0]
-    Expression node = AstFactory.listLiteral([_resolvedInteger(0)]);
+    Expression node = AstTestFactory.listLiteral([_resolvedInteger(0)]);
     DartType resultType = _analyze(node);
     _assertType2(
         _typeProvider.listType
@@ -1097,8 +1100,8 @@
   void test_visitListLiteral_unresolved() {
     _analyzer = _createAnalyzer(strongMode: true);
     // [a] // where 'a' is not resolved
-    Identifier identifier = AstFactory.identifier3('a');
-    Expression node = AstFactory.listLiteral([identifier]);
+    Identifier identifier = AstTestFactory.identifier3('a');
+    Expression node = AstTestFactory.listLiteral([identifier]);
     DartType resultType = _analyze(node);
     _assertType2(
         _typeProvider.listType
@@ -1110,8 +1113,8 @@
   void test_visitListLiteral_unresolved_multiple() {
     _analyzer = _createAnalyzer(strongMode: true);
     // [0, a, 1] // where 'a' is not resolved
-    Identifier identifier = AstFactory.identifier3('a');
-    Expression node = AstFactory
+    Identifier identifier = AstTestFactory.identifier3('a');
+    Expression node = AstTestFactory
         .listLiteral([_resolvedInteger(0), identifier, _resolvedInteger(1)]);
     DartType resultType = _analyze(node);
     _assertType2(
@@ -1122,7 +1125,7 @@
 
   void test_visitMapLiteral_empty() {
     // {}
-    Expression node = AstFactory.mapLiteral2();
+    Expression node = AstTestFactory.mapLiteral2();
     DartType resultType = _analyze(node);
     _assertType2(
         _typeProvider.mapType.instantiate(
@@ -1133,8 +1136,8 @@
 
   void test_visitMapLiteral_nonEmpty() {
     // {"k" : 0}
-    Expression node = AstFactory
-        .mapLiteral2([AstFactory.mapLiteralEntry("k", _resolvedInteger(0))]);
+    Expression node = AstTestFactory.mapLiteral2(
+        [AstTestFactory.mapLiteralEntry("k", _resolvedInteger(0))]);
     DartType resultType = _analyze(node);
     _assertType2(
         _typeProvider.mapType.instantiate(
@@ -1145,35 +1148,37 @@
 
   void test_visitMethodInvocation_then() {
     // then()
-    Expression node = AstFactory.methodInvocation(null, "then");
+    Expression node = AstTestFactory.methodInvocation(null, "then");
     _analyze(node);
     _listener.assertNoErrors();
   }
 
   void test_visitNamedExpression() {
     // n: a
-    Expression node = AstFactory.namedExpression2("n", _resolvedString("a"));
+    Expression node =
+        AstTestFactory.namedExpression2("n", _resolvedString("a"));
     expect(_analyze(node), same(_typeProvider.stringType));
     _listener.assertNoErrors();
   }
 
   void test_visitNullLiteral() {
     // null
-    Expression node = AstFactory.nullLiteral();
+    Expression node = AstTestFactory.nullLiteral();
     expect(_analyze(node), same(_typeProvider.bottomType));
     _listener.assertNoErrors();
   }
 
   void test_visitParenthesizedExpression() {
     // (0)
-    Expression node = AstFactory.parenthesizedExpression(_resolvedInteger(0));
+    Expression node =
+        AstTestFactory.parenthesizedExpression(_resolvedInteger(0));
     expect(_analyze(node), same(_typeProvider.intType));
     _listener.assertNoErrors();
   }
 
   void test_visitPostfixExpression_minusMinus() {
     // 0--
-    PostfixExpression node = AstFactory.postfixExpression(
+    PostfixExpression node = AstTestFactory.postfixExpression(
         _resolvedInteger(0), TokenType.MINUS_MINUS);
     expect(_analyze(node), same(_typeProvider.intType));
     _listener.assertNoErrors();
@@ -1181,8 +1186,8 @@
 
   void test_visitPostfixExpression_plusPlus() {
     // 0++
-    PostfixExpression node =
-        AstFactory.postfixExpression(_resolvedInteger(0), TokenType.PLUS_PLUS);
+    PostfixExpression node = AstTestFactory.postfixExpression(
+        _resolvedInteger(0), TokenType.PLUS_PLUS);
     expect(_analyze(node), same(_typeProvider.intType));
     _listener.assertNoErrors();
   }
@@ -1191,7 +1196,7 @@
     DartType boolType = _typeProvider.boolType;
     PropertyAccessorElementImpl getter =
         ElementFactory.getterElement("b", false, boolType);
-    PrefixedIdentifier node = AstFactory.identifier5("a", "b");
+    PrefixedIdentifier node = AstTestFactory.identifier5("a", "b");
     node.identifier.staticElement = getter;
     expect(_analyze(node), same(boolType));
     _listener.assertNoErrors();
@@ -1202,7 +1207,7 @@
     FieldElementImpl field =
         ElementFactory.fieldElement("b", false, false, false, boolType);
     PropertyAccessorElement setter = field.setter;
-    PrefixedIdentifier node = AstFactory.identifier5("a", "b");
+    PrefixedIdentifier node = AstTestFactory.identifier5("a", "b");
     node.identifier.staticElement = setter;
     expect(_analyze(node), same(boolType));
     _listener.assertNoErrors();
@@ -1211,7 +1216,7 @@
   void test_visitPrefixedIdentifier_variable() {
     VariableElementImpl variable = ElementFactory.localVariableElement2("b");
     variable.type = _typeProvider.boolType;
-    PrefixedIdentifier node = AstFactory.identifier5("a", "b");
+    PrefixedIdentifier node = AstTestFactory.identifier5("a", "b");
     node.identifier.staticElement = variable;
     expect(_analyze(node), same(_typeProvider.boolType));
     _listener.assertNoErrors();
@@ -1220,7 +1225,7 @@
   void test_visitPrefixExpression_bang() {
     // !0
     PrefixExpression node =
-        AstFactory.prefixExpression(TokenType.BANG, _resolvedInteger(0));
+        AstTestFactory.prefixExpression(TokenType.BANG, _resolvedInteger(0));
     expect(_analyze(node), same(_typeProvider.boolType));
     _listener.assertNoErrors();
   }
@@ -1228,7 +1233,7 @@
   void test_visitPrefixExpression_minus() {
     // -0
     PrefixExpression node =
-        AstFactory.prefixExpression(TokenType.MINUS, _resolvedInteger(0));
+        AstTestFactory.prefixExpression(TokenType.MINUS, _resolvedInteger(0));
     MethodElement minusMethod = getMethod(_typeProvider.numType, "-");
     node.staticElement = minusMethod;
     expect(_analyze(node), same(_typeProvider.numType));
@@ -1237,8 +1242,8 @@
 
   void test_visitPrefixExpression_minusMinus() {
     // --0
-    PrefixExpression node =
-        AstFactory.prefixExpression(TokenType.MINUS_MINUS, _resolvedInteger(0));
+    PrefixExpression node = AstTestFactory.prefixExpression(
+        TokenType.MINUS_MINUS, _resolvedInteger(0));
     MethodElement minusMethod = getMethod(_typeProvider.numType, "-");
     node.staticElement = minusMethod;
     expect(_analyze(node), same(_typeProvider.intType));
@@ -1247,16 +1252,16 @@
 
   void test_visitPrefixExpression_not() {
     // !true
-    Expression node = AstFactory.prefixExpression(
-        TokenType.BANG, AstFactory.booleanLiteral(true));
+    Expression node = AstTestFactory.prefixExpression(
+        TokenType.BANG, AstTestFactory.booleanLiteral(true));
     expect(_analyze(node), same(_typeProvider.boolType));
     _listener.assertNoErrors();
   }
 
   void test_visitPrefixExpression_plusPlus() {
     // ++0
-    PrefixExpression node =
-        AstFactory.prefixExpression(TokenType.PLUS_PLUS, _resolvedInteger(0));
+    PrefixExpression node = AstTestFactory.prefixExpression(
+        TokenType.PLUS_PLUS, _resolvedInteger(0));
     MethodElement plusMethod = getMethod(_typeProvider.numType, "+");
     node.staticElement = plusMethod;
     expect(_analyze(node), same(_typeProvider.intType));
@@ -1266,7 +1271,7 @@
   void test_visitPrefixExpression_tilde() {
     // ~0
     PrefixExpression node =
-        AstFactory.prefixExpression(TokenType.TILDE, _resolvedInteger(0));
+        AstTestFactory.prefixExpression(TokenType.TILDE, _resolvedInteger(0));
     MethodElement tildeMethod = getMethod(_typeProvider.intType, "~");
     node.staticElement = tildeMethod;
     expect(_analyze(node), same(_typeProvider.intType));
@@ -1278,7 +1283,7 @@
     PropertyAccessorElementImpl getter =
         ElementFactory.getterElement("b", false, boolType);
     PropertyAccess node =
-        AstFactory.propertyAccess2(AstFactory.identifier3("a"), "b");
+        AstTestFactory.propertyAccess2(AstTestFactory.identifier3("a"), "b");
     node.propertyName.propagatedElement = getter;
     expect(_analyze2(node, false), same(boolType));
     _listener.assertNoErrors();
@@ -1290,7 +1295,7 @@
         ElementFactory.fieldElement("b", false, false, false, boolType);
     PropertyAccessorElement setter = field.setter;
     PropertyAccess node =
-        AstFactory.propertyAccess2(AstFactory.identifier3("a"), "b");
+        AstTestFactory.propertyAccess2(AstTestFactory.identifier3("a"), "b");
     node.propertyName.propagatedElement = setter;
     expect(_analyze2(node, false), same(boolType));
     _listener.assertNoErrors();
@@ -1301,7 +1306,7 @@
     PropertyAccessorElementImpl getter =
         ElementFactory.getterElement("b", false, boolType);
     PropertyAccess node =
-        AstFactory.propertyAccess2(AstFactory.identifier3("a"), "b");
+        AstTestFactory.propertyAccess2(AstTestFactory.identifier3("a"), "b");
     node.propertyName.staticElement = getter;
     expect(_analyze(node), same(boolType));
     _listener.assertNoErrors();
@@ -1313,7 +1318,7 @@
         ElementFactory.fieldElement("b", false, false, false, boolType);
     PropertyAccessorElement setter = field.setter;
     PropertyAccess node =
-        AstFactory.propertyAccess2(AstFactory.identifier3("a"), "b");
+        AstTestFactory.propertyAccess2(AstTestFactory.identifier3("a"), "b");
     node.propertyName.staticElement = setter;
     expect(_analyze(node), same(boolType));
     _listener.assertNoErrors();
@@ -1321,7 +1326,7 @@
 
   void test_visitSimpleIdentifier_dynamic() {
     // "dynamic"
-    SimpleIdentifier identifier = AstFactory.identifier3('dynamic');
+    SimpleIdentifier identifier = AstTestFactory.identifier3('dynamic');
     DynamicElementImpl element = DynamicElementImpl.instance;
     identifier.staticElement = element;
     identifier.staticType = _typeProvider.typeType;
@@ -1338,10 +1343,10 @@
 
   void test_visitStringInterpolation() {
     // "a${'b'}c"
-    Expression node = AstFactory.string([
-      AstFactory.interpolationString("a", "a"),
-      AstFactory.interpolationExpression(_resolvedString("b")),
-      AstFactory.interpolationString("c", "c")
+    Expression node = AstTestFactory.string([
+      AstTestFactory.interpolationString("a", "a"),
+      AstTestFactory.interpolationExpression(_resolvedString("b")),
+      AstTestFactory.interpolationString("c", "c")
     ]);
     expect(_analyze(node), same(_typeProvider.stringType));
     _listener.assertNoErrors();
@@ -1351,13 +1356,13 @@
     // super
     InterfaceType superType = ElementFactory.classElement2("A").type;
     InterfaceType thisType = ElementFactory.classElement("B", superType).type;
-    Expression node = AstFactory.superExpression();
+    Expression node = AstTestFactory.superExpression();
     expect(_analyze3(node, thisType), same(thisType));
     _listener.assertNoErrors();
   }
 
   void test_visitSymbolLiteral() {
-    expect(_analyze(AstFactory.symbolLiteral(["a"])),
+    expect(_analyze(AstTestFactory.symbolLiteral(["a"])),
         same(_typeProvider.symbolType));
   }
 
@@ -1366,21 +1371,21 @@
     InterfaceType thisType = ElementFactory
         .classElement("B", ElementFactory.classElement2("A").type)
         .type;
-    Expression node = AstFactory.thisExpression();
+    Expression node = AstTestFactory.thisExpression();
     expect(_analyze3(node, thisType), same(thisType));
     _listener.assertNoErrors();
   }
 
   void test_visitThrowExpression_withoutValue() {
     // throw
-    Expression node = AstFactory.throwExpression();
+    Expression node = AstTestFactory.throwExpression();
     expect(_analyze(node), same(_typeProvider.bottomType));
     _listener.assertNoErrors();
   }
 
   void test_visitThrowExpression_withValue() {
     // throw 0
-    Expression node = AstFactory.throwExpression2(_resolvedInteger(0));
+    Expression node = AstTestFactory.throwExpression2(_resolvedInteger(0));
     expect(_analyze(node), same(_typeProvider.bottomType));
     _listener.assertNoErrors();
   }
@@ -1565,7 +1570,7 @@
    */
   SimpleIdentifier _propagatedVariable(
       InterfaceType type, String variableName) {
-    SimpleIdentifier identifier = AstFactory.identifier3(variableName);
+    SimpleIdentifier identifier = AstTestFactory.identifier3(variableName);
     VariableElementImpl element =
         ElementFactory.localVariableElement(identifier);
     element.type = type;
@@ -1580,7 +1585,7 @@
    * the correct type.
    */
   BooleanLiteral _resolvedBool(bool value) {
-    BooleanLiteral literal = AstFactory.booleanLiteral(value);
+    BooleanLiteral literal = AstTestFactory.booleanLiteral(value);
     literal.staticType = _typeProvider.intType;
     return literal;
   }
@@ -1592,7 +1597,7 @@
    * @return an integer literal that has been resolved to the correct type
    */
   DoubleLiteral _resolvedDouble(double value) {
-    DoubleLiteral literal = AstFactory.doubleLiteral(value);
+    DoubleLiteral literal = AstTestFactory.doubleLiteral(value);
     literal.staticType = _typeProvider.doubleType;
     return literal;
   }
@@ -1618,7 +1623,8 @@
       parameter.identifier.staticElement = element;
       parameterElements.add(element);
     }
-    FunctionExpression node = AstFactory.functionExpression2(parameters, body);
+    FunctionExpression node =
+        AstTestFactory.functionExpression2(parameters, body);
     FunctionElementImpl element = new FunctionElementImpl.forNode(null);
     element.parameters = parameterElements;
     element.type = new FunctionTypeImpl(element);
@@ -1633,7 +1639,7 @@
    * @return an integer literal that has been resolved to the correct type
    */
   IntegerLiteral _resolvedInteger(int value) {
-    IntegerLiteral literal = AstFactory.integer(value);
+    IntegerLiteral literal = AstTestFactory.integer(value);
     literal.staticType = _typeProvider.intType;
     return literal;
   }
@@ -1645,7 +1651,7 @@
    * @return a string literal that has been resolved to the correct type
    */
   SimpleStringLiteral _resolvedString(String value) {
-    SimpleStringLiteral string = AstFactory.string2(value);
+    SimpleStringLiteral string = AstTestFactory.string2(value);
     string.staticType = _typeProvider.stringType;
     return string;
   }
@@ -1658,7 +1664,7 @@
    * @return a simple identifier that has been resolved to a variable element with the given type
    */
   SimpleIdentifier _resolvedVariable(InterfaceType type, String variableName) {
-    SimpleIdentifier identifier = AstFactory.identifier3(variableName);
+    SimpleIdentifier identifier = AstTestFactory.identifier3(variableName);
     VariableElementImpl element =
         ElementFactory.localVariableElement(identifier);
     element.type = type;
diff --git a/pkg/analyzer/test/generated/static_type_warning_code_test.dart b/pkg/analyzer/test/generated/static_type_warning_code_test.dart
index 858d10a..82b972c 100644
--- a/pkg/analyzer/test/generated/static_type_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_type_warning_code_test.dart
@@ -9,28 +9,20 @@
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/java_core.dart' show formatList;
 import 'package:analyzer/src/generated/source_io.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../utils.dart';
 import 'resolver_test_case.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(StaticTypeWarningCodeTest);
-  defineReflectiveTests(StrongModeStaticTypeWarningCodeTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(StaticTypeWarningCodeTest);
+    defineReflectiveTests(StrongModeStaticTypeWarningCodeTest);
+  });
 }
 
 @reflectiveTest
 class StaticTypeWarningCodeTest extends ResolverTestCase {
-  void fail_inaccessibleSetter() {
-    // TODO(rnystrom): This doesn't look right.
-    assertErrorsInCode(
-        r'''
-''',
-        [StaticTypeWarningCode.INACCESSIBLE_SETTER]);
-  }
-
   void fail_method_lookup_mixin_of_extends() {
     // See dartbug.com/25605
     resetWithOptions(new AnalysisOptionsImpl()..enableSuperMixins = true);
@@ -2439,7 +2431,7 @@
 ''');
     computeLibrarySourceErrors(source);
     assertErrors(
-        source, [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
+        source, [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD]);
     for (AnalysisError error in analysisContext2.computeErrors(source)) {
       if (error.errorCode ==
           StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS) {
diff --git a/pkg/analyzer/test/generated/static_warning_code_test.dart b/pkg/analyzer/test/generated/static_warning_code_test.dart
index 3acd138..1fc56f4 100644
--- a/pkg/analyzer/test/generated/static_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_warning_code_test.dart
@@ -8,15 +8,15 @@
 import 'package:analyzer/src/error/codes.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source_io.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../utils.dart';
 import 'resolver_test_case.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(StaticWarningCodeTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(StaticWarningCodeTest);
+  });
 }
 
 @reflectiveTest
@@ -3373,6 +3373,45 @@
     ]);
   }
 
+  void test_typeAnnotationGenericFunctionParameter_localFunction() {
+    Source source = addSource(r'''
+class A {
+  void method() {
+    T local<T>(Object t) {
+      return (t is T) ? t : null;
+    }
+  }
+}''');
+    computeLibrarySourceErrors(source);
+    assertErrors(
+        source, [StaticWarningCode.TYPE_ANNOTATION_GENERIC_FUNCTION_PARAMETER]);
+    verify([source]);
+  }
+
+  void test_typeAnnotationGenericFunctionParameter_method() {
+    Source source = addSource(r'''
+class A {
+  T method<T>(Object t) {
+    return (t is T) ? t : null;
+  }
+}''');
+    computeLibrarySourceErrors(source);
+    assertErrors(
+        source, [StaticWarningCode.TYPE_ANNOTATION_GENERIC_FUNCTION_PARAMETER]);
+    verify([source]);
+  }
+
+  void test_typeAnnotationGenericFunctionParameter_topLevelFunction() {
+    Source source = addSource(r'''
+T function<T>(Object t) {
+  return (t is T) ? t : null;
+}''');
+    computeLibrarySourceErrors(source);
+    assertErrors(
+        source, [StaticWarningCode.TYPE_ANNOTATION_GENERIC_FUNCTION_PARAMETER]);
+    verify([source]);
+  }
+
   void test_typeParameterReferencedByStatic_field() {
     Source source = addSource(r'''
 class A<K> {
diff --git a/pkg/analyzer/test/generated/strong_mode_test.dart b/pkg/analyzer/test/generated/strong_mode_test.dart
index ec467c7..783b462 100644
--- a/pkg/analyzer/test/generated/strong_mode_test.dart
+++ b/pkg/analyzer/test/generated/strong_mode_test.dart
@@ -11,17 +11,18 @@
 import 'package:analyzer/src/error/codes.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source_io.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../utils.dart';
 import 'resolver_test_case.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(StrongModeDownwardsInferenceTest);
-  defineReflectiveTests(StrongModeStaticTypeAnalyzer2Test);
-  defineReflectiveTests(StrongModeTypePropagationTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(StrongModeDownwardsInferenceTest);
+    defineReflectiveTests(StrongModeStaticTypeAnalyzer2Test);
+    defineReflectiveTests(StrongModeTypePropagationTest);
+  });
 }
 
 /**
diff --git a/pkg/analyzer/test/generated/test_all.dart b/pkg/analyzer/test/generated/test_all.dart
index 63b357d..37c9268 100644
--- a/pkg/analyzer/test/generated/test_all.dart
+++ b/pkg/analyzer/test/generated/test_all.dart
@@ -4,9 +4,8 @@
 
 library analyzer.test.generated.test_all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../utils.dart';
 import 'all_the_rest_test.dart' as all_the_rest;
 import 'bazel_test.dart' as bazel_test;
 import 'checked_mode_compile_time_error_code_test.dart'
@@ -40,8 +39,7 @@
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('generated tests', () {
+  defineReflectiveSuite(() {
     all_the_rest.main();
     bazel_test.main();
     checked_mode_compile_time_error_code_test.main();
@@ -71,5 +69,5 @@
     type_system_test.main();
     utilities_dart_test.main();
     utilities_test.main();
-  });
+  }, name: 'generated');
 }
diff --git a/pkg/analyzer/test/generated/test_support.dart b/pkg/analyzer/test/generated/test_support.dart
index 7b36770..ce0b3f0 100644
--- a/pkg/analyzer/test/generated/test_support.dart
+++ b/pkg/analyzer/test/generated/test_support.dart
@@ -18,7 +18,7 @@
 import 'package:analyzer/src/generated/source.dart';
 import 'package:plugin/manager.dart';
 import 'package:plugin/plugin.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import 'analysis_context_factory.dart';
 
@@ -242,7 +242,7 @@
    *           expected
    */
   void assertErrorsWithCodes(
-      [List<ErrorCode> expectedErrorCodes = ErrorCode.EMPTY_LIST]) {
+      [List<ErrorCode> expectedErrorCodes = const <ErrorCode>[]]) {
     StringBuffer buffer = new StringBuffer();
     //
     // Verify that the expected error codes have a non-empty message.
diff --git a/pkg/analyzer/test/generated/type_system_test.dart b/pkg/analyzer/test/generated/type_system_test.dart
index af08bb4..6aa2ad1 100644
--- a/pkg/analyzer/test/generated/type_system_test.dart
+++ b/pkg/analyzer/test/generated/type_system_test.dart
@@ -14,20 +14,20 @@
 import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/testing/element_factory.dart';
 import 'package:analyzer/src/generated/testing/test_type_provider.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../utils.dart';
 import 'analysis_context_factory.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(StrongAssignabilityTest);
-  defineReflectiveTests(StrongSubtypingTest);
-  defineReflectiveTests(StrongGenericFunctionInferenceTest);
-  defineReflectiveTests(LeastUpperBoundTest);
-  defineReflectiveTests(StrongLeastUpperBoundTest);
-  defineReflectiveTests(StrongGreatestLowerBoundTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(StrongAssignabilityTest);
+    defineReflectiveTests(StrongSubtypingTest);
+    defineReflectiveTests(StrongGenericFunctionInferenceTest);
+    defineReflectiveTests(LeastUpperBoundTest);
+    defineReflectiveTests(StrongLeastUpperBoundTest);
+    defineReflectiveTests(StrongGreatestLowerBoundTest);
+  });
 }
 
 /**
diff --git a/pkg/analyzer/test/generated/utilities_dart_test.dart b/pkg/analyzer/test/generated/utilities_dart_test.dart
index c300c21..1917b16 100644
--- a/pkg/analyzer/test/generated/utilities_dart_test.dart
+++ b/pkg/analyzer/test/generated/utilities_dart_test.dart
@@ -5,14 +5,13 @@
 library analyzer.test.generated.utilities_dart_test;
 
 import 'package:analyzer/src/generated/utilities_dart.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
-
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ResolveRelativeUriTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ResolveRelativeUriTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/generated/utilities_test.dart b/pkg/analyzer/test/generated/utilities_test.dart
index 8e23ae1..88b88d5 100644
--- a/pkg/analyzer/test/generated/utilities_test.dart
+++ b/pkg/analyzer/test/generated/utilities_test.dart
@@ -8,6 +8,7 @@
 
 import 'package:analyzer/dart/ast/ast.dart';
 import 'package:analyzer/dart/ast/token.dart';
+import 'package:analyzer/dart/ast/visitor.dart';
 import 'package:analyzer/src/dart/ast/token.dart';
 import 'package:analyzer/src/dart/ast/utilities.dart';
 import 'package:analyzer/src/dart/scanner/reader.dart';
@@ -15,27 +16,28 @@
 import 'package:analyzer/src/generated/java_engine.dart';
 import 'package:analyzer/src/generated/parser.dart';
 import 'package:analyzer/src/generated/source.dart';
-import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
 import 'package:analyzer/src/generated/testing/token_factory.dart';
 import 'package:analyzer/src/generated/utilities_collection.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../utils.dart';
 import 'test_support.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AstClonerTest);
-  defineReflectiveTests(NodeReplacerTest);
-  defineReflectiveTests(LineInfoTest);
-  defineReflectiveTests(SourceRangeTest);
-  defineReflectiveTests(BooleanArrayTest);
-  defineReflectiveTests(DirectedGraphTest);
-  defineReflectiveTests(MultipleMapIteratorTest);
-  defineReflectiveTests(SingleMapIteratorTest);
-  defineReflectiveTests(TokenMapTest);
-  defineReflectiveTests(StringUtilitiesTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AstClonerTest);
+    defineReflectiveTests(BooleanArrayTest);
+    defineReflectiveTests(DirectedGraphTest);
+    defineReflectiveTests(ExceptionHandlingDelegatingAstVisitorTest);
+    defineReflectiveTests(LineInfoTest);
+    defineReflectiveTests(MultipleMapIteratorTest);
+    defineReflectiveTests(NodeReplacerTest);
+    defineReflectiveTests(SingleMapIteratorTest);
+    defineReflectiveTests(SourceRangeTest);
+    defineReflectiveTests(StringUtilitiesTest);
+    defineReflectiveTests(TokenMapTest);
+  });
 }
 
 class AstCloneComparator extends AstComparator {
@@ -1594,6 +1596,21 @@
  */
 class DirectedGraphTest_Node {}
 
+@reflectiveTest
+class ExceptionHandlingDelegatingAstVisitorTest extends EngineTestCase {
+  void test_handlerIsCalled() {
+    AstVisitor exceptionThrowingVisitor = new _ExceptionThrowingVisitor();
+    bool handlerInvoked = false;
+    AstVisitor visitor = new ExceptionHandlingDelegatingAstVisitor(
+        [exceptionThrowingVisitor], (AstNode node, AstVisitor visitor,
+            dynamic exception, StackTrace stackTrace) {
+      handlerInvoked = true;
+    });
+    new NullLiteral(null).accept(visitor);
+    expect(handlerInvoked, isTrue);
+  }
+}
+
 class Getter_NodeReplacerTest_test_annotation
     implements NodeReplacerTest_Getter<Annotation, ArgumentList> {
   @override
@@ -2934,8 +2951,8 @@
   static const List<Token> EMPTY_TOKEN_LIST = const <Token>[];
 
   void test_adjacentStrings() {
-    AdjacentStrings node = AstFactory
-        .adjacentStrings([AstFactory.string2("a"), AstFactory.string2("b")]);
+    AdjacentStrings node = AstTestFactory.adjacentStrings(
+        [AstTestFactory.string2("a"), AstTestFactory.string2("b")]);
     _assertReplace(
         node, new ListGetter_NodeReplacerTest_test_adjacentStrings_2(0));
     _assertReplace(
@@ -2943,39 +2960,42 @@
   }
 
   void test_annotation() {
-    Annotation node = AstFactory.annotation2(
-        AstFactory.identifier3("C"),
-        AstFactory.identifier3("c"),
-        AstFactory.argumentList([AstFactory.integer(0)]));
+    Annotation node = AstTestFactory.annotation2(
+        AstTestFactory.identifier3("C"),
+        AstTestFactory.identifier3("c"),
+        AstTestFactory.argumentList([AstTestFactory.integer(0)]));
     _assertReplace(node, new Getter_NodeReplacerTest_test_annotation());
     _assertReplace(node, new Getter_NodeReplacerTest_test_annotation_3());
     _assertReplace(node, new Getter_NodeReplacerTest_test_annotation_2());
   }
 
   void test_argumentList() {
-    ArgumentList node = AstFactory.argumentList([AstFactory.integer(0)]);
+    ArgumentList node =
+        AstTestFactory.argumentList([AstTestFactory.integer(0)]);
     _assertReplace(node, new ListGetter_NodeReplacerTest_test_argumentList(0));
   }
 
   void test_asExpression() {
-    AsExpression node = AstFactory.asExpression(
-        AstFactory.integer(0),
-        AstFactory.typeName3(
-            AstFactory.identifier3("a"), [AstFactory.typeName4("C")]));
+    AsExpression node = AstTestFactory.asExpression(
+        AstTestFactory.integer(0),
+        AstTestFactory.typeName3(
+            AstTestFactory.identifier3("a"), [AstTestFactory.typeName4("C")]));
     _assertReplace(node, new Getter_NodeReplacerTest_test_asExpression_2());
     _assertReplace(node, new Getter_NodeReplacerTest_test_asExpression());
   }
 
   void test_assertStatement() {
-    AssertStatement node = AstFactory.assertStatement(
-        AstFactory.booleanLiteral(true), AstFactory.string2('foo'));
+    AssertStatement node = AstTestFactory.assertStatement(
+        AstTestFactory.booleanLiteral(true), AstTestFactory.string2('foo'));
     _assertReplace(node, new Getter_NodeReplacerTest_test_assertStatement());
     _assertReplace(node, new Getter_NodeReplacerTest_test_assertStatement_2());
   }
 
   void test_assignmentExpression() {
-    AssignmentExpression node = AstFactory.assignmentExpression(
-        AstFactory.identifier3("l"), TokenType.EQ, AstFactory.identifier3("r"));
+    AssignmentExpression node = AstTestFactory.assignmentExpression(
+        AstTestFactory.identifier3("l"),
+        TokenType.EQ,
+        AstTestFactory.identifier3("r"));
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_assignmentExpression_2());
     _assertReplace(
@@ -2983,65 +3003,71 @@
   }
 
   void test_awaitExpression() {
-    var node = AstFactory.awaitExpression(AstFactory.identifier3("A"));
+    var node = AstTestFactory.awaitExpression(AstTestFactory.identifier3("A"));
     _assertReplace(node, new Getter_NodeReplacerTest_test_awaitExpression());
   }
 
   void test_binaryExpression() {
-    BinaryExpression node = AstFactory.binaryExpression(
-        AstFactory.identifier3("l"),
+    BinaryExpression node = AstTestFactory.binaryExpression(
+        AstTestFactory.identifier3("l"),
         TokenType.PLUS,
-        AstFactory.identifier3("r"));
+        AstTestFactory.identifier3("r"));
     _assertReplace(node, new Getter_NodeReplacerTest_test_binaryExpression());
     _assertReplace(node, new Getter_NodeReplacerTest_test_binaryExpression_2());
   }
 
   void test_block() {
-    Block node = AstFactory.block([AstFactory.emptyStatement()]);
+    Block node = AstTestFactory.block([AstTestFactory.emptyStatement()]);
     _assertReplace(node, new ListGetter_NodeReplacerTest_test_block(0));
   }
 
   void test_blockFunctionBody() {
-    BlockFunctionBody node = AstFactory.blockFunctionBody(AstFactory.block());
+    BlockFunctionBody node =
+        AstTestFactory.blockFunctionBody(AstTestFactory.block());
     _assertReplace(node, new Getter_NodeReplacerTest_test_blockFunctionBody());
   }
 
   void test_breakStatement() {
-    BreakStatement node = AstFactory.breakStatement2("l");
+    BreakStatement node = AstTestFactory.breakStatement2("l");
     _assertReplace(node, new Getter_NodeReplacerTest_test_breakStatement());
   }
 
   void test_cascadeExpression() {
-    CascadeExpression node = AstFactory.cascadeExpression(AstFactory.integer(0),
-        [AstFactory.propertyAccess(null, AstFactory.identifier3("b"))]);
+    CascadeExpression node = AstTestFactory.cascadeExpression(
+        AstTestFactory.integer(0),
+        [AstTestFactory.propertyAccess(null, AstTestFactory.identifier3("b"))]);
     _assertReplace(node, new Getter_NodeReplacerTest_test_cascadeExpression());
     _assertReplace(
         node, new ListGetter_NodeReplacerTest_test_cascadeExpression(0));
   }
 
   void test_catchClause() {
-    CatchClause node = AstFactory.catchClause5(
-        AstFactory.typeName4("E"), "e", "s", [AstFactory.emptyStatement()]);
+    CatchClause node = AstTestFactory.catchClause5(
+        AstTestFactory.typeName4("E"),
+        "e",
+        "s",
+        [AstTestFactory.emptyStatement()]);
     _assertReplace(node, new Getter_NodeReplacerTest_test_catchClause_3());
     _assertReplace(node, new Getter_NodeReplacerTest_test_catchClause_2());
     _assertReplace(node, new Getter_NodeReplacerTest_test_catchClause());
   }
 
   void test_classDeclaration() {
-    ClassDeclaration node = AstFactory.classDeclaration(
+    ClassDeclaration node = AstTestFactory.classDeclaration(
         null,
         "A",
-        AstFactory.typeParameterList(["E"]),
-        AstFactory.extendsClause(AstFactory.typeName4("B")),
-        AstFactory.withClause([AstFactory.typeName4("C")]),
-        AstFactory.implementsClause([AstFactory.typeName4("D")]), [
-      AstFactory
-          .fieldDeclaration2(false, null, [AstFactory.variableDeclaration("f")])
+        AstTestFactory.typeParameterList(["E"]),
+        AstTestFactory.extendsClause(AstTestFactory.typeName4("B")),
+        AstTestFactory.withClause([AstTestFactory.typeName4("C")]),
+        AstTestFactory.implementsClause([AstTestFactory.typeName4("D")]), [
+      AstTestFactory.fieldDeclaration2(
+          false, null, [AstTestFactory.variableDeclaration("f")])
     ]);
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
-    node.metadata.add(AstFactory.annotation(AstFactory.identifier3("a")));
-    node.nativeClause = AstFactory.nativeClause("");
+    node.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
+    node.nativeClause = AstTestFactory.nativeClause("");
     _assertReplace(node, new Getter_NodeReplacerTest_test_classDeclaration_6());
     _assertReplace(node, new Getter_NodeReplacerTest_test_classDeclaration_5());
     _assertReplace(node, new Getter_NodeReplacerTest_test_classDeclaration_4());
@@ -3054,16 +3080,17 @@
   }
 
   void test_classTypeAlias() {
-    ClassTypeAlias node = AstFactory.classTypeAlias(
+    ClassTypeAlias node = AstTestFactory.classTypeAlias(
         "A",
-        AstFactory.typeParameterList(["E"]),
+        AstTestFactory.typeParameterList(["E"]),
         null,
-        AstFactory.typeName4("B"),
-        AstFactory.withClause([AstFactory.typeName4("C")]),
-        AstFactory.implementsClause([AstFactory.typeName4("D")]));
+        AstTestFactory.typeName4("B"),
+        AstTestFactory.withClause([AstTestFactory.typeName4("C")]),
+        AstTestFactory.implementsClause([AstTestFactory.typeName4("D")]));
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
-    node.metadata.add(AstFactory.annotation(AstFactory.identifier3("a")));
+    node.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
     _assertReplace(node, new Getter_NodeReplacerTest_test_classTypeAlias_4());
     _assertReplace(node, new Getter_NodeReplacerTest_test_classTypeAlias_5());
     _assertReplace(node, new Getter_NodeReplacerTest_test_classTypeAlias());
@@ -3075,22 +3102,22 @@
   void test_comment() {
     Comment node = Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
     node.references
-        .add(new CommentReference(null, AstFactory.identifier3("x")));
+        .add(new CommentReference(null, AstTestFactory.identifier3("x")));
     _assertReplace(node, new ListGetter_NodeReplacerTest_test_comment(0));
   }
 
   void test_commentReference() {
     CommentReference node =
-        new CommentReference(null, AstFactory.identifier3("x"));
+        new CommentReference(null, AstTestFactory.identifier3("x"));
     _assertReplace(node, new Getter_NodeReplacerTest_test_commentReference());
   }
 
   void test_compilationUnit() {
-    CompilationUnit node = AstFactory.compilationUnit8("", [
-      AstFactory.libraryDirective2("lib")
+    CompilationUnit node = AstTestFactory.compilationUnit8("", [
+      AstTestFactory.libraryDirective2("lib")
     ], [
-      AstFactory.topLevelVariableDeclaration2(
-          null, [AstFactory.variableDeclaration("X")])
+      AstTestFactory.topLevelVariableDeclaration2(
+          null, [AstTestFactory.variableDeclaration("X")])
     ]);
     _assertReplace(node, new Getter_NodeReplacerTest_test_compilationUnit());
     _assertReplace(
@@ -3100,10 +3127,10 @@
   }
 
   void test_conditionalExpression() {
-    ConditionalExpression node = AstFactory.conditionalExpression(
-        AstFactory.booleanLiteral(true),
-        AstFactory.integer(0),
-        AstFactory.integer(1));
+    ConditionalExpression node = AstTestFactory.conditionalExpression(
+        AstTestFactory.booleanLiteral(true),
+        AstTestFactory.integer(0),
+        AstTestFactory.integer(1));
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_conditionalExpression_3());
     _assertReplace(
@@ -3113,22 +3140,23 @@
   }
 
   void test_constructorDeclaration() {
-    ConstructorDeclaration node = AstFactory.constructorDeclaration2(
+    ConstructorDeclaration node = AstTestFactory.constructorDeclaration2(
         null,
         null,
-        AstFactory.identifier3("C"),
+        AstTestFactory.identifier3("C"),
         "d",
-        AstFactory.formalParameterList(),
+        AstTestFactory.formalParameterList(),
         [
-          AstFactory.constructorFieldInitializer(
-              false, "x", AstFactory.integer(0))
+          AstTestFactory.constructorFieldInitializer(
+              false, "x", AstTestFactory.integer(0))
         ],
-        AstFactory.emptyFunctionBody());
+        AstTestFactory.emptyFunctionBody());
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
-    node.metadata.add(AstFactory.annotation(AstFactory.identifier3("a")));
+    node.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
     node.redirectedConstructor =
-        AstFactory.constructorName(AstFactory.typeName4("B"), "a");
+        AstTestFactory.constructorName(AstTestFactory.typeName4("B"), "a");
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_constructorDeclaration_3());
     _assertReplace(
@@ -3145,8 +3173,8 @@
   }
 
   void test_constructorFieldInitializer() {
-    ConstructorFieldInitializer node = AstFactory.constructorFieldInitializer(
-        false, "f", AstFactory.integer(0));
+    ConstructorFieldInitializer node = AstTestFactory
+        .constructorFieldInitializer(false, "f", AstTestFactory.integer(0));
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_constructorFieldInitializer());
     _assertReplace(
@@ -3155,22 +3183,23 @@
 
   void test_constructorName() {
     ConstructorName node =
-        AstFactory.constructorName(AstFactory.typeName4("C"), "n");
+        AstTestFactory.constructorName(AstTestFactory.typeName4("C"), "n");
     _assertReplace(node, new Getter_NodeReplacerTest_test_constructorName());
     _assertReplace(node, new Getter_NodeReplacerTest_test_constructorName_2());
   }
 
   void test_continueStatement() {
-    ContinueStatement node = AstFactory.continueStatement("l");
+    ContinueStatement node = AstTestFactory.continueStatement("l");
     _assertReplace(node, new Getter_NodeReplacerTest_test_continueStatement());
   }
 
   void test_declaredIdentifier() {
     DeclaredIdentifier node =
-        AstFactory.declaredIdentifier4(AstFactory.typeName4("C"), "i");
+        AstTestFactory.declaredIdentifier4(AstTestFactory.typeName4("C"), "i");
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
-    node.metadata.add(AstFactory.annotation(AstFactory.identifier3("a")));
+    node.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
     _assertReplace(node, new Getter_NodeReplacerTest_test_declaredIdentifier());
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_declaredIdentifier_2());
@@ -3178,8 +3207,8 @@
   }
 
   void test_defaultFormalParameter() {
-    DefaultFormalParameter node = AstFactory.positionalFormalParameter(
-        AstFactory.simpleFormalParameter3("p"), AstFactory.integer(0));
+    DefaultFormalParameter node = AstTestFactory.positionalFormalParameter(
+        AstTestFactory.simpleFormalParameter3("p"), AstTestFactory.integer(0));
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_defaultFormalParameter());
     _assertReplace(
@@ -3187,8 +3216,8 @@
   }
 
   void test_doStatement() {
-    DoStatement node = AstFactory.doStatement(
-        AstFactory.block(), AstFactory.booleanLiteral(true));
+    DoStatement node = AstTestFactory.doStatement(
+        AstTestFactory.block(), AstTestFactory.booleanLiteral(true));
     _assertReplace(node, new Getter_NodeReplacerTest_test_doStatement_2());
     _assertReplace(node, new Getter_NodeReplacerTest_test_doStatement());
   }
@@ -3196,67 +3225,79 @@
   void test_enumConstantDeclaration() {
     EnumConstantDeclaration node = new EnumConstantDeclaration(
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST),
-        [AstFactory.annotation(AstFactory.identifier3("a"))],
-        AstFactory.identifier3("C"));
+        [AstTestFactory.annotation(AstTestFactory.identifier3("a"))],
+        AstTestFactory.identifier3("C"));
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_enumConstantDeclaration());
     _testAnnotatedNode(node);
   }
 
   void test_enumDeclaration() {
-    EnumDeclaration node = AstFactory.enumDeclaration2("E", ["ONE", "TWO"]);
+    EnumDeclaration node = AstTestFactory.enumDeclaration2("E", ["ONE", "TWO"]);
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
-    node.metadata.add(AstFactory.annotation(AstFactory.identifier3("a")));
+    node.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
     _assertReplace(node, new Getter_NodeReplacerTest_test_enumDeclaration());
     _testAnnotatedNode(node);
   }
 
   void test_exportDirective() {
-    ExportDirective node = AstFactory.exportDirective2("", [
-      AstFactory.hideCombinator2(["C"])
+    ExportDirective node = AstTestFactory.exportDirective2("", [
+      AstTestFactory.hideCombinator2(["C"])
     ]);
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
-    node.metadata.add(AstFactory.annotation(AstFactory.identifier3("a")));
+    node.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
     _testNamespaceDirective(node);
   }
 
   void test_expressionFunctionBody() {
     ExpressionFunctionBody node =
-        AstFactory.expressionFunctionBody(AstFactory.integer(0));
+        AstTestFactory.expressionFunctionBody(AstTestFactory.integer(0));
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_expressionFunctionBody());
   }
 
   void test_expressionStatement() {
     ExpressionStatement node =
-        AstFactory.expressionStatement(AstFactory.integer(0));
+        AstTestFactory.expressionStatement(AstTestFactory.integer(0));
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_expressionStatement());
   }
 
   void test_extendsClause() {
-    ExtendsClause node = AstFactory.extendsClause(AstFactory.typeName4("S"));
+    ExtendsClause node =
+        AstTestFactory.extendsClause(AstTestFactory.typeName4("S"));
     _assertReplace(node, new Getter_NodeReplacerTest_test_extendsClause());
   }
 
   void test_fieldDeclaration() {
-    FieldDeclaration node = AstFactory.fieldDeclaration(false, null,
-        AstFactory.typeName4("C"), [AstFactory.variableDeclaration("c")]);
+    FieldDeclaration node = AstTestFactory.fieldDeclaration(
+        false,
+        null,
+        AstTestFactory.typeName4("C"),
+        [AstTestFactory.variableDeclaration("c")]);
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
-    node.metadata.add(AstFactory.annotation(AstFactory.identifier3("a")));
+    node.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
     _assertReplace(node, new Getter_NodeReplacerTest_test_fieldDeclaration());
     _testAnnotatedNode(node);
   }
 
   void test_fieldFormalParameter() {
-    FieldFormalParameter node = AstFactory.fieldFormalParameter(
-        null, AstFactory.typeName4("C"), "f", AstFactory.formalParameterList());
+    FieldFormalParameter node = AstTestFactory.fieldFormalParameter(
+        null,
+        AstTestFactory.typeName4("C"),
+        "f",
+        AstTestFactory.formalParameterList());
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
-    node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
+    node.metadata = [
+      AstTestFactory.annotation(AstTestFactory.identifier3("a"))
+    ];
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_fieldFormalParameter_2());
     _assertReplace(
@@ -3265,10 +3306,10 @@
   }
 
   void test_forEachStatement_withIdentifier() {
-    ForEachStatement node = AstFactory.forEachStatement2(
-        AstFactory.identifier3("i"),
-        AstFactory.identifier3("l"),
-        AstFactory.block());
+    ForEachStatement node = AstTestFactory.forEachStatement2(
+        AstTestFactory.identifier3("i"),
+        AstTestFactory.identifier3("l"),
+        AstTestFactory.block());
     _assertReplace(node,
         new Getter_NodeReplacerTest_test_forEachStatement_withIdentifier_2());
     _assertReplace(node,
@@ -3278,10 +3319,10 @@
   }
 
   void test_forEachStatement_withLoopVariable() {
-    ForEachStatement node = AstFactory.forEachStatement(
-        AstFactory.declaredIdentifier3("e"),
-        AstFactory.identifier3("l"),
-        AstFactory.block());
+    ForEachStatement node = AstTestFactory.forEachStatement(
+        AstTestFactory.declaredIdentifier3("e"),
+        AstTestFactory.identifier3("l"),
+        AstTestFactory.block());
     _assertReplace(node,
         new Getter_NodeReplacerTest_test_forEachStatement_withLoopVariable_2());
     _assertReplace(node,
@@ -3291,18 +3332,18 @@
   }
 
   void test_formalParameterList() {
-    FormalParameterList node = AstFactory
-        .formalParameterList([AstFactory.simpleFormalParameter3("p")]);
+    FormalParameterList node = AstTestFactory
+        .formalParameterList([AstTestFactory.simpleFormalParameter3("p")]);
     _assertReplace(
         node, new ListGetter_NodeReplacerTest_test_formalParameterList(0));
   }
 
   void test_forStatement_withInitialization() {
-    ForStatement node = AstFactory.forStatement(
-        AstFactory.identifier3("a"),
-        AstFactory.booleanLiteral(true),
-        [AstFactory.integer(0)],
-        AstFactory.block());
+    ForStatement node = AstTestFactory.forStatement(
+        AstTestFactory.identifier3("a"),
+        AstTestFactory.booleanLiteral(true),
+        [AstTestFactory.integer(0)],
+        AstTestFactory.block());
     _assertReplace(node,
         new Getter_NodeReplacerTest_test_forStatement_withInitialization_3());
     _assertReplace(node,
@@ -3316,12 +3357,12 @@
   }
 
   void test_forStatement_withVariables() {
-    ForStatement node = AstFactory.forStatement2(
-        AstFactory.variableDeclarationList2(
-            null, [AstFactory.variableDeclaration("i")]),
-        AstFactory.booleanLiteral(true),
-        [AstFactory.integer(0)],
-        AstFactory.block());
+    ForStatement node = AstTestFactory.forStatement2(
+        AstTestFactory.variableDeclarationList2(
+            null, [AstTestFactory.variableDeclaration("i")]),
+        AstTestFactory.booleanLiteral(true),
+        [AstTestFactory.integer(0)],
+        AstTestFactory.block());
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_forStatement_withVariables_2());
     _assertReplace(
@@ -3333,15 +3374,16 @@
   }
 
   void test_functionDeclaration() {
-    FunctionDeclaration node = AstFactory.functionDeclaration(
-        AstFactory.typeName4("R"),
+    FunctionDeclaration node = AstTestFactory.functionDeclaration(
+        AstTestFactory.typeName4("R"),
         null,
         "f",
-        AstFactory.functionExpression2(AstFactory.formalParameterList(),
-            AstFactory.blockFunctionBody(AstFactory.block())));
+        AstTestFactory.functionExpression2(AstTestFactory.formalParameterList(),
+            AstTestFactory.blockFunctionBody(AstTestFactory.block())));
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
-    node.metadata.add(AstFactory.annotation(AstFactory.identifier3("a")));
+    node.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_functionDeclaration());
     _assertReplace(
@@ -3352,28 +3394,31 @@
   }
 
   void test_functionDeclarationStatement() {
-    FunctionDeclarationStatement node = AstFactory.functionDeclarationStatement(
-        AstFactory.typeName4("R"),
-        null,
-        "f",
-        AstFactory.functionExpression2(AstFactory.formalParameterList(),
-            AstFactory.blockFunctionBody(AstFactory.block())));
+    FunctionDeclarationStatement node =
+        AstTestFactory.functionDeclarationStatement(
+            AstTestFactory.typeName4("R"),
+            null,
+            "f",
+            AstTestFactory.functionExpression2(
+                AstTestFactory.formalParameterList(),
+                AstTestFactory.blockFunctionBody(AstTestFactory.block())));
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_functionDeclarationStatement());
   }
 
   void test_functionExpression() {
-    FunctionExpression node = AstFactory.functionExpression2(
-        AstFactory.formalParameterList(),
-        AstFactory.blockFunctionBody(AstFactory.block()));
+    FunctionExpression node = AstTestFactory.functionExpression2(
+        AstTestFactory.formalParameterList(),
+        AstTestFactory.blockFunctionBody(AstTestFactory.block()));
     _assertReplace(node, new Getter_NodeReplacerTest_test_functionExpression());
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_functionExpression_2());
   }
 
   void test_functionExpressionInvocation() {
-    FunctionExpressionInvocation node = AstFactory.functionExpressionInvocation(
-        AstFactory.identifier3("f"), [AstFactory.integer(0)]);
+    FunctionExpressionInvocation node = AstTestFactory
+        .functionExpressionInvocation(
+            AstTestFactory.identifier3("f"), [AstTestFactory.integer(0)]);
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_functionExpressionInvocation());
     _assertReplace(node,
@@ -3381,14 +3426,15 @@
   }
 
   void test_functionTypeAlias() {
-    FunctionTypeAlias node = AstFactory.typeAlias(
-        AstFactory.typeName4("R"),
+    FunctionTypeAlias node = AstTestFactory.typeAlias(
+        AstTestFactory.typeName4("R"),
         "F",
-        AstFactory.typeParameterList(["E"]),
-        AstFactory.formalParameterList());
+        AstTestFactory.typeParameterList(["E"]),
+        AstTestFactory.formalParameterList());
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
-    node.metadata.add(AstFactory.annotation(AstFactory.identifier3("a")));
+    node.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_functionTypeAlias_3());
     _assertReplace(
@@ -3400,13 +3446,14 @@
   }
 
   void test_functionTypedFormalParameter() {
-    FunctionTypedFormalParameter node = AstFactory.functionTypedFormalParameter(
-        AstFactory.typeName4("R"),
-        "f",
-        [AstFactory.simpleFormalParameter3("p")]);
+    FunctionTypedFormalParameter node = AstTestFactory
+        .functionTypedFormalParameter(AstTestFactory.typeName4("R"), "f",
+            [AstTestFactory.simpleFormalParameter3("p")]);
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
-    node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
+    node.metadata = [
+      AstTestFactory.annotation(AstTestFactory.identifier3("a"))
+    ];
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_functionTypedFormalParameter());
     _assertReplace(node,
@@ -3415,48 +3462,52 @@
   }
 
   void test_hideCombinator() {
-    HideCombinator node = AstFactory.hideCombinator2(["A", "B"]);
+    HideCombinator node = AstTestFactory.hideCombinator2(["A", "B"]);
     _assertReplace(
         node, new ListGetter_NodeReplacerTest_test_hideCombinator(0));
   }
 
   void test_ifStatement() {
-    IfStatement node = AstFactory.ifStatement2(AstFactory.booleanLiteral(true),
-        AstFactory.block(), AstFactory.block());
+    IfStatement node = AstTestFactory.ifStatement2(
+        AstTestFactory.booleanLiteral(true),
+        AstTestFactory.block(),
+        AstTestFactory.block());
     _assertReplace(node, new Getter_NodeReplacerTest_test_ifStatement());
     _assertReplace(node, new Getter_NodeReplacerTest_test_ifStatement_3());
     _assertReplace(node, new Getter_NodeReplacerTest_test_ifStatement_2());
   }
 
   void test_implementsClause() {
-    ImplementsClause node = AstFactory.implementsClause(
-        [AstFactory.typeName4("I"), AstFactory.typeName4("J")]);
+    ImplementsClause node = AstTestFactory.implementsClause(
+        [AstTestFactory.typeName4("I"), AstTestFactory.typeName4("J")]);
     _assertReplace(
         node, new ListGetter_NodeReplacerTest_test_implementsClause(0));
   }
 
   void test_importDirective() {
-    ImportDirective node = AstFactory.importDirective3("", "p", [
-      AstFactory.showCombinator2(["A"]),
-      AstFactory.hideCombinator2(["B"])
+    ImportDirective node = AstTestFactory.importDirective3("", "p", [
+      AstTestFactory.showCombinator2(["A"]),
+      AstTestFactory.hideCombinator2(["B"])
     ]);
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
-    node.metadata.add(AstFactory.annotation(AstFactory.identifier3("a")));
+    node.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
     _assertReplace(node, new Getter_NodeReplacerTest_test_importDirective());
     _testNamespaceDirective(node);
   }
 
   void test_indexExpression() {
-    IndexExpression node = AstFactory.indexExpression(
-        AstFactory.identifier3("a"), AstFactory.identifier3("i"));
+    IndexExpression node = AstTestFactory.indexExpression(
+        AstTestFactory.identifier3("a"), AstTestFactory.identifier3("i"));
     _assertReplace(node, new Getter_NodeReplacerTest_test_indexExpression());
     _assertReplace(node, new Getter_NodeReplacerTest_test_indexExpression_2());
   }
 
   void test_instanceCreationExpression() {
-    InstanceCreationExpression node = AstFactory.instanceCreationExpression3(
-        null, AstFactory.typeName4("C"), "c", [AstFactory.integer(2)]);
+    InstanceCreationExpression node = AstTestFactory
+        .instanceCreationExpression3(null, AstTestFactory.typeName4("C"), "c",
+            [AstTestFactory.integer(2)]);
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_instanceCreationExpression_2());
     _assertReplace(
@@ -3464,83 +3515,85 @@
   }
 
   void test_interpolationExpression() {
-    InterpolationExpression node = AstFactory.interpolationExpression2("x");
+    InterpolationExpression node = AstTestFactory.interpolationExpression2("x");
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_interpolationExpression());
   }
 
   void test_isExpression() {
-    IsExpression node = AstFactory.isExpression(
-        AstFactory.identifier3("v"), false, AstFactory.typeName4("T"));
+    IsExpression node = AstTestFactory.isExpression(
+        AstTestFactory.identifier3("v"), false, AstTestFactory.typeName4("T"));
     _assertReplace(node, new Getter_NodeReplacerTest_test_isExpression());
     _assertReplace(node, new Getter_NodeReplacerTest_test_isExpression_2());
   }
 
   void test_label() {
-    Label node = AstFactory.label2("l");
+    Label node = AstTestFactory.label2("l");
     _assertReplace(node, new Getter_NodeReplacerTest_test_label());
   }
 
   void test_labeledStatement() {
-    LabeledStatement node = AstFactory
-        .labeledStatement([AstFactory.label2("l")], AstFactory.block());
+    LabeledStatement node = AstTestFactory
+        .labeledStatement([AstTestFactory.label2("l")], AstTestFactory.block());
     _assertReplace(
         node, new ListGetter_NodeReplacerTest_test_labeledStatement(0));
     _assertReplace(node, new Getter_NodeReplacerTest_test_labeledStatement());
   }
 
   void test_libraryDirective() {
-    LibraryDirective node = AstFactory.libraryDirective2("lib");
+    LibraryDirective node = AstTestFactory.libraryDirective2("lib");
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
-    node.metadata.add(AstFactory.annotation(AstFactory.identifier3("a")));
+    node.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
     _assertReplace(node, new Getter_NodeReplacerTest_test_libraryDirective());
     _testAnnotatedNode(node);
   }
 
   void test_libraryIdentifier() {
-    LibraryIdentifier node = AstFactory.libraryIdentifier2(["lib"]);
+    LibraryIdentifier node = AstTestFactory.libraryIdentifier2(["lib"]);
     _assertReplace(
         node, new ListGetter_NodeReplacerTest_test_libraryIdentifier(0));
   }
 
   void test_listLiteral() {
-    ListLiteral node = AstFactory.listLiteral2(
+    ListLiteral node = AstTestFactory.listLiteral2(
         null,
-        AstFactory.typeArgumentList([AstFactory.typeName4("E")]),
-        [AstFactory.identifier3("e")]);
+        AstTestFactory.typeArgumentList([AstTestFactory.typeName4("E")]),
+        [AstTestFactory.identifier3("e")]);
     _assertReplace(node, new ListGetter_NodeReplacerTest_test_listLiteral(0));
     _testTypedLiteral(node);
   }
 
   void test_mapLiteral() {
-    MapLiteral node = AstFactory.mapLiteral(
+    MapLiteral node = AstTestFactory.mapLiteral(
         null,
-        AstFactory.typeArgumentList([AstFactory.typeName4("E")]),
-        [AstFactory.mapLiteralEntry("k", AstFactory.identifier3("v"))]);
+        AstTestFactory.typeArgumentList([AstTestFactory.typeName4("E")]),
+        [AstTestFactory.mapLiteralEntry("k", AstTestFactory.identifier3("v"))]);
     _assertReplace(node, new ListGetter_NodeReplacerTest_test_mapLiteral(0));
     _testTypedLiteral(node);
   }
 
   void test_mapLiteralEntry() {
     MapLiteralEntry node =
-        AstFactory.mapLiteralEntry("k", AstFactory.identifier3("v"));
+        AstTestFactory.mapLiteralEntry("k", AstTestFactory.identifier3("v"));
     _assertReplace(node, new Getter_NodeReplacerTest_test_mapLiteralEntry_2());
     _assertReplace(node, new Getter_NodeReplacerTest_test_mapLiteralEntry());
   }
 
   void test_methodDeclaration() {
-    MethodDeclaration node = AstFactory.methodDeclaration2(
+    MethodDeclaration node = AstTestFactory.methodDeclaration2(
         null,
-        AstFactory.typeName4("A"),
+        AstTestFactory.typeName4("A"),
         null,
         null,
-        AstFactory.identifier3("m"),
-        AstFactory.formalParameterList(),
-        AstFactory.blockFunctionBody(AstFactory.block()));
+        AstTestFactory.identifier3("m"),
+        AstTestFactory.formalParameterList(),
+        AstTestFactory.blockFunctionBody(AstTestFactory.block()));
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
-    node.metadata.add(AstFactory.annotation(AstFactory.identifier3("a")));
+    node.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
     _assertReplace(node, new Getter_NodeReplacerTest_test_methodDeclaration());
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_methodDeclaration_3());
@@ -3552,8 +3605,8 @@
   }
 
   void test_methodInvocation() {
-    MethodInvocation node = AstFactory.methodInvocation(
-        AstFactory.identifier3("t"), "m", [AstFactory.integer(0)]);
+    MethodInvocation node = AstTestFactory.methodInvocation(
+        AstTestFactory.identifier3("t"), "m", [AstTestFactory.integer(0)]);
     _assertReplace(node, new Getter_NodeReplacerTest_test_methodInvocation_2());
     _assertReplace(node, new Getter_NodeReplacerTest_test_methodInvocation_3());
     _assertReplace(node, new Getter_NodeReplacerTest_test_methodInvocation());
@@ -3561,75 +3614,77 @@
 
   void test_namedExpression() {
     NamedExpression node =
-        AstFactory.namedExpression2("l", AstFactory.identifier3("v"));
+        AstTestFactory.namedExpression2("l", AstTestFactory.identifier3("v"));
     _assertReplace(node, new Getter_NodeReplacerTest_test_namedExpression());
     _assertReplace(node, new Getter_NodeReplacerTest_test_namedExpression_2());
   }
 
   void test_nativeClause() {
-    NativeClause node = AstFactory.nativeClause("");
+    NativeClause node = AstTestFactory.nativeClause("");
     _assertReplace(node, new Getter_NodeReplacerTest_test_nativeClause());
   }
 
   void test_nativeFunctionBody() {
-    NativeFunctionBody node = AstFactory.nativeFunctionBody("m");
+    NativeFunctionBody node = AstTestFactory.nativeFunctionBody("m");
     _assertReplace(node, new Getter_NodeReplacerTest_test_nativeFunctionBody());
   }
 
   void test_parenthesizedExpression() {
     ParenthesizedExpression node =
-        AstFactory.parenthesizedExpression(AstFactory.integer(0));
+        AstTestFactory.parenthesizedExpression(AstTestFactory.integer(0));
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_parenthesizedExpression());
   }
 
   void test_partDirective() {
-    PartDirective node = AstFactory.partDirective2("");
+    PartDirective node = AstTestFactory.partDirective2("");
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
-    node.metadata.add(AstFactory.annotation(AstFactory.identifier3("a")));
+    node.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
     _testUriBasedDirective(node);
   }
 
   void test_partOfDirective() {
-    PartOfDirective node =
-        AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["lib"]));
+    PartOfDirective node = AstTestFactory
+        .partOfDirective(AstTestFactory.libraryIdentifier2(["lib"]));
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
-    node.metadata.add(AstFactory.annotation(AstFactory.identifier3("a")));
+    node.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
     _assertReplace(node, new Getter_NodeReplacerTest_test_partOfDirective());
     _testAnnotatedNode(node);
   }
 
   void test_postfixExpression() {
-    PostfixExpression node = AstFactory.postfixExpression(
-        AstFactory.identifier3("x"), TokenType.MINUS_MINUS);
+    PostfixExpression node = AstTestFactory.postfixExpression(
+        AstTestFactory.identifier3("x"), TokenType.MINUS_MINUS);
     _assertReplace(node, new Getter_NodeReplacerTest_test_postfixExpression());
   }
 
   void test_prefixedIdentifier() {
-    PrefixedIdentifier node = AstFactory.identifier5("a", "b");
+    PrefixedIdentifier node = AstTestFactory.identifier5("a", "b");
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_prefixedIdentifier_2());
     _assertReplace(node, new Getter_NodeReplacerTest_test_prefixedIdentifier());
   }
 
   void test_prefixExpression() {
-    PrefixExpression node = AstFactory.prefixExpression(
-        TokenType.PLUS_PLUS, AstFactory.identifier3("y"));
+    PrefixExpression node = AstTestFactory.prefixExpression(
+        TokenType.PLUS_PLUS, AstTestFactory.identifier3("y"));
     _assertReplace(node, new Getter_NodeReplacerTest_test_prefixExpression());
   }
 
   void test_propertyAccess() {
     PropertyAccess node =
-        AstFactory.propertyAccess2(AstFactory.identifier3("x"), "y");
+        AstTestFactory.propertyAccess2(AstTestFactory.identifier3("x"), "y");
     _assertReplace(node, new Getter_NodeReplacerTest_test_propertyAccess());
     _assertReplace(node, new Getter_NodeReplacerTest_test_propertyAccess_2());
   }
 
   void test_redirectingConstructorInvocation() {
-    RedirectingConstructorInvocation node = AstFactory
-        .redirectingConstructorInvocation2("c", [AstFactory.integer(0)]);
+    RedirectingConstructorInvocation node = AstTestFactory
+        .redirectingConstructorInvocation2("c", [AstTestFactory.integer(0)]);
     _assertReplace(node,
         new Getter_NodeReplacerTest_test_redirectingConstructorInvocation());
     _assertReplace(node,
@@ -3637,22 +3692,25 @@
   }
 
   void test_returnStatement() {
-    ReturnStatement node = AstFactory.returnStatement2(AstFactory.integer(0));
+    ReturnStatement node =
+        AstTestFactory.returnStatement2(AstTestFactory.integer(0));
     _assertReplace(node, new Getter_NodeReplacerTest_test_returnStatement());
   }
 
   void test_showCombinator() {
-    ShowCombinator node = AstFactory.showCombinator2(["X", "Y"]);
+    ShowCombinator node = AstTestFactory.showCombinator2(["X", "Y"]);
     _assertReplace(
         node, new ListGetter_NodeReplacerTest_test_showCombinator(0));
   }
 
   void test_simpleFormalParameter() {
-    SimpleFormalParameter node =
-        AstFactory.simpleFormalParameter4(AstFactory.typeName4("T"), "p");
+    SimpleFormalParameter node = AstTestFactory.simpleFormalParameter4(
+        AstTestFactory.typeName4("T"), "p");
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
-    node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
+    node.metadata = [
+      AstTestFactory.annotation(AstTestFactory.identifier3("a"))
+    ];
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_simpleFormalParameter());
     _testNormalFormalParameter(node);
@@ -3660,14 +3718,14 @@
 
   void test_stringInterpolation() {
     StringInterpolation node =
-        AstFactory.string([AstFactory.interpolationExpression2("a")]);
+        AstTestFactory.string([AstTestFactory.interpolationExpression2("a")]);
     _assertReplace(
         node, new ListGetter_NodeReplacerTest_test_stringInterpolation(0));
   }
 
   void test_superConstructorInvocation() {
-    SuperConstructorInvocation node =
-        AstFactory.superConstructorInvocation2("s", [AstFactory.integer(1)]);
+    SuperConstructorInvocation node = AstTestFactory
+        .superConstructorInvocation2("s", [AstTestFactory.integer(1)]);
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_superConstructorInvocation());
     _assertReplace(
@@ -3675,24 +3733,25 @@
   }
 
   void test_switchCase() {
-    SwitchCase node = AstFactory.switchCase2(
-        [AstFactory.label2("l")], AstFactory.integer(0), [AstFactory.block()]);
+    SwitchCase node = AstTestFactory.switchCase2([AstTestFactory.label2("l")],
+        AstTestFactory.integer(0), [AstTestFactory.block()]);
     _assertReplace(node, new Getter_NodeReplacerTest_test_switchCase());
     _testSwitchMember(node);
   }
 
   void test_switchDefault() {
-    SwitchDefault node = AstFactory
-        .switchDefault([AstFactory.label2("l")], [AstFactory.block()]);
+    SwitchDefault node = AstTestFactory
+        .switchDefault([AstTestFactory.label2("l")], [AstTestFactory.block()]);
     _testSwitchMember(node);
   }
 
   void test_switchStatement() {
     SwitchStatement node =
-        AstFactory.switchStatement(AstFactory.identifier3("x"), [
-      AstFactory.switchCase2([AstFactory.label2("l")], AstFactory.integer(0),
-          [AstFactory.block()]),
-      AstFactory.switchDefault([AstFactory.label2("l")], [AstFactory.block()])
+        AstTestFactory.switchStatement(AstTestFactory.identifier3("x"), [
+      AstTestFactory.switchCase2([AstTestFactory.label2("l")],
+          AstTestFactory.integer(0), [AstTestFactory.block()]),
+      AstTestFactory
+          .switchDefault([AstTestFactory.label2("l")], [AstTestFactory.block()])
     ]);
     _assertReplace(node, new Getter_NodeReplacerTest_test_switchStatement());
     _assertReplace(
@@ -3701,28 +3760,30 @@
 
   void test_throwExpression() {
     ThrowExpression node =
-        AstFactory.throwExpression2(AstFactory.identifier3("e"));
+        AstTestFactory.throwExpression2(AstTestFactory.identifier3("e"));
     _assertReplace(node, new Getter_NodeReplacerTest_test_throwExpression());
   }
 
   void test_topLevelVariableDeclaration() {
-    TopLevelVariableDeclaration node = AstFactory.topLevelVariableDeclaration(
-        null, AstFactory.typeName4("T"), [AstFactory.variableDeclaration("t")]);
+    TopLevelVariableDeclaration node = AstTestFactory
+        .topLevelVariableDeclaration(null, AstTestFactory.typeName4("T"),
+            [AstTestFactory.variableDeclaration("t")]);
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
-    node.metadata.add(AstFactory.annotation(AstFactory.identifier3("a")));
+    node.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_topLevelVariableDeclaration());
     _testAnnotatedNode(node);
   }
 
   void test_tryStatement() {
-    TryStatement node = AstFactory.tryStatement3(
-        AstFactory.block(),
+    TryStatement node = AstTestFactory.tryStatement3(
+        AstTestFactory.block(),
         [
-          AstFactory.catchClause("e", [AstFactory.block()])
+          AstTestFactory.catchClause("e", [AstTestFactory.block()])
         ],
-        AstFactory.block());
+        AstTestFactory.block());
     _assertReplace(node, new Getter_NodeReplacerTest_test_tryStatement_2());
     _assertReplace(node, new Getter_NodeReplacerTest_test_tryStatement());
     _assertReplace(node, new ListGetter_NodeReplacerTest_test_tryStatement(0));
@@ -3730,37 +3791,38 @@
 
   void test_typeArgumentList() {
     TypeArgumentList node =
-        AstFactory.typeArgumentList([AstFactory.typeName4("A")]);
+        AstTestFactory.typeArgumentList([AstTestFactory.typeName4("A")]);
     _assertReplace(
         node, new ListGetter_NodeReplacerTest_test_typeArgumentList(0));
   }
 
   void test_typeName() {
-    TypeName node = AstFactory
-        .typeName4("T", [AstFactory.typeName4("E"), AstFactory.typeName4("F")]);
+    TypeName node = AstTestFactory.typeName4(
+        "T", [AstTestFactory.typeName4("E"), AstTestFactory.typeName4("F")]);
     _assertReplace(node, new Getter_NodeReplacerTest_test_typeName_2());
     _assertReplace(node, new Getter_NodeReplacerTest_test_typeName());
   }
 
   void test_typeParameter() {
     TypeParameter node =
-        AstFactory.typeParameter2("E", AstFactory.typeName4("B"));
+        AstTestFactory.typeParameter2("E", AstTestFactory.typeName4("B"));
     _assertReplace(node, new Getter_NodeReplacerTest_test_typeParameter_2());
     _assertReplace(node, new Getter_NodeReplacerTest_test_typeParameter());
   }
 
   void test_typeParameterList() {
-    TypeParameterList node = AstFactory.typeParameterList(["A", "B"]);
+    TypeParameterList node = AstTestFactory.typeParameterList(["A", "B"]);
     _assertReplace(
         node, new ListGetter_NodeReplacerTest_test_typeParameterList(0));
   }
 
   void test_variableDeclaration() {
     VariableDeclaration node =
-        AstFactory.variableDeclaration2("a", AstFactory.nullLiteral());
+        AstTestFactory.variableDeclaration2("a", AstTestFactory.nullLiteral());
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
-    node.metadata.add(AstFactory.annotation(AstFactory.identifier3("a")));
+    node.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_variableDeclaration());
     _assertReplace(
@@ -3769,11 +3831,14 @@
   }
 
   void test_variableDeclarationList() {
-    VariableDeclarationList node = AstFactory.variableDeclarationList(
-        null, AstFactory.typeName4("T"), [AstFactory.variableDeclaration("a")]);
+    VariableDeclarationList node = AstTestFactory.variableDeclarationList(
+        null,
+        AstTestFactory.typeName4("T"),
+        [AstTestFactory.variableDeclaration("a")]);
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
-    node.metadata.add(AstFactory.annotation(AstFactory.identifier3("a")));
+    node.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_variableDeclarationList());
     _assertReplace(
@@ -3782,26 +3847,28 @@
   }
 
   void test_variableDeclarationStatement() {
-    VariableDeclarationStatement node = AstFactory.variableDeclarationStatement(
-        null, AstFactory.typeName4("T"), [AstFactory.variableDeclaration("a")]);
+    VariableDeclarationStatement node = AstTestFactory
+        .variableDeclarationStatement(null, AstTestFactory.typeName4("T"),
+            [AstTestFactory.variableDeclaration("a")]);
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_variableDeclarationStatement());
   }
 
   void test_whileStatement() {
-    WhileStatement node = AstFactory.whileStatement(
-        AstFactory.booleanLiteral(true), AstFactory.block());
+    WhileStatement node = AstTestFactory.whileStatement(
+        AstTestFactory.booleanLiteral(true), AstTestFactory.block());
     _assertReplace(node, new Getter_NodeReplacerTest_test_whileStatement());
     _assertReplace(node, new Getter_NodeReplacerTest_test_whileStatement_2());
   }
 
   void test_withClause() {
-    WithClause node = AstFactory.withClause([AstFactory.typeName4("M")]);
+    WithClause node =
+        AstTestFactory.withClause([AstTestFactory.typeName4("M")]);
     _assertReplace(node, new ListGetter_NodeReplacerTest_test_withClause(0));
   }
 
   void test_yieldStatement() {
-    var node = AstFactory.yieldStatement(AstFactory.identifier3("A"));
+    var node = AstTestFactory.yieldStatement(AstTestFactory.identifier3("A"));
     _assertReplace(node, new Getter_NodeReplacerTest_test_yieldStatement());
   }
 
@@ -4340,3 +4407,9 @@
     expect(tokenMap.get(key), same(value));
   }
 }
+
+class _ExceptionThrowingVisitor extends SimpleAstVisitor {
+  visitNullLiteral(NullLiteral node) {
+    throw new ArgumentError('');
+  }
+}
diff --git a/pkg/analyzer/test/instrumentation/instrumentation_test.dart b/pkg/analyzer/test/instrumentation/instrumentation_test.dart
index e6cafc0..8eff1cf 100644
--- a/pkg/analyzer/test/instrumentation/instrumentation_test.dart
+++ b/pkg/analyzer/test/instrumentation/instrumentation_test.dart
@@ -7,14 +7,12 @@
 import 'dart:async';
 
 import 'package:analyzer/instrumentation/instrumentation.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 main() {
-  group('instrumentation', () {
-    defineReflectiveTests(InstrumentationServiceTest);
-    defineReflectiveTests(MulticastInstrumentationServerTest);
-  });
+  defineReflectiveTests(InstrumentationServiceTest);
+  defineReflectiveTests(MulticastInstrumentationServerTest);
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/instrumentation/test_all.dart b/pkg/analyzer/test/instrumentation/test_all.dart
index 46bb206..8ef3a56 100644
--- a/pkg/analyzer/test/instrumentation/test_all.dart
+++ b/pkg/analyzer/test/instrumentation/test_all.dart
@@ -4,14 +4,13 @@
 
 library analyzer.test.instrumentation.test_all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
 import 'instrumentation_test.dart' as instrumentation_test;
 
 /// Utility for manually running all tests.
 main() {
-  groupSep = ' | ';
-  group('instrumentation', () {
+  defineReflectiveSuite(() {
     instrumentation_test.main();
-  });
+  }, name: 'instrumentation');
 }
diff --git a/pkg/analyzer/test/parse_compilation_unit_test.dart b/pkg/analyzer/test/parse_compilation_unit_test.dart
index c5313da..87f441d 100644
--- a/pkg/analyzer/test/parse_compilation_unit_test.dart
+++ b/pkg/analyzer/test/parse_compilation_unit_test.dart
@@ -5,12 +5,9 @@
 library analyzer.test.parse_compilation_unit_test;
 
 import 'package:analyzer/analyzer.dart';
-import 'package:unittest/unittest.dart';
-
-import 'utils.dart';
+import 'package:test/test.dart';
 
 void main() {
-  initializeTestEnvironment();
   test("parses a valid compilation unit successfully", () {
     var unit = parseCompilationUnit("void main() => print('Hello, world!');");
     expect(unit.toString(), equals("void main() => print('Hello, world!');"));
diff --git a/pkg/analyzer/test/resource_utils.dart b/pkg/analyzer/test/resource_utils.dart
index ef01daf..c03eb1d 100644
--- a/pkg/analyzer/test/resource_utils.dart
+++ b/pkg/analyzer/test/resource_utils.dart
@@ -12,7 +12,7 @@
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/util/absolute_path.dart';
 import 'package:path/path.dart' as path;
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 bool get isWindows => path.Style.platform == path.Style.windows;
 
diff --git a/pkg/analyzer/test/source/analysis_options_provider_test.dart b/pkg/analyzer/test/source/analysis_options_provider_test.dart
index adbadc7..8ada91c 100644
--- a/pkg/analyzer/test/source/analysis_options_provider_test.dart
+++ b/pkg/analyzer/test/source/analysis_options_provider_test.dart
@@ -10,17 +10,18 @@
 import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:analyzer/source/analysis_options_provider.dart';
 import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 import 'package:yaml/yaml.dart';
 
 import '../resource_utils.dart';
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AnalysisOptionsProviderOldTest);
-  defineReflectiveTests(AnalysisOptionsProviderNewTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisOptionsProviderOldTest);
+    defineReflectiveTests(AnalysisOptionsProviderNewTest);
+  });
   group('AnalysisOptionsProvider', () {
     void expectMergesTo(String defaults, String overrides, String expected) {
       var optionsProvider = new AnalysisOptionsProvider();
@@ -115,14 +116,17 @@
   TestPathTranslator pathTranslator;
   ResourceProvider resourceProvider;
 
-  AnalysisOptionsProvider provider = new AnalysisOptionsProvider();
+  AnalysisOptionsProvider provider;
 
   String get optionsFileName;
 
   void setUp() {
-    var rawProvider = new MemoryResourceProvider(isWindows: isWindows);
+    var rawProvider = new MemoryResourceProvider();
     resourceProvider = new TestResourceProvider(rawProvider);
     pathTranslator = new TestPathTranslator(rawProvider);
+    provider = new AnalysisOptionsProvider(new SourceFactory([
+      new ResourceUriResolver(rawProvider),
+    ]));
   }
 
   void test_getOptions_crawlUp_hasInFolder() {
@@ -188,6 +192,44 @@
     expect(options, isEmpty);
   }
 
+  void test_getOptions_include() {
+    pathTranslator.newFile(
+        '/foo.include',
+        r'''
+analyzer:
+  ignore:
+    - ignoreme.dart
+    - 'sdk_ext/**'
+''');
+    pathTranslator.newFile(
+        '/$optionsFileName',
+        r'''
+include: foo.include
+''');
+    Map<String, YamlNode> options = _getOptions('/');
+    expect(options, hasLength(1));
+    {
+      YamlMap analyzer = options['analyzer'];
+      expect(analyzer, hasLength(1));
+      {
+        YamlList ignore = analyzer['ignore'];
+        expect(ignore, hasLength(2));
+        expect(ignore[0], 'ignoreme.dart');
+        expect(ignore[1], 'sdk_ext/**');
+      }
+    }
+  }
+
+  void test_getOptions_include_missing() {
+    pathTranslator.newFile(
+        '/$optionsFileName',
+        r'''
+include: /foo.include
+''');
+    Map<String, YamlNode> options = _getOptions('/');
+    expect(options, hasLength(0));
+  }
+
   void test_getOptions_invalid() {
     pathTranslator.newFile('/$optionsFileName', r''':''');
     expect(() {
diff --git a/pkg/analyzer/test/source/config_test.dart b/pkg/analyzer/test/source/config_test.dart
deleted file mode 100644
index ccbc056..0000000
--- a/pkg/analyzer/test/source/config_test.dart
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
-// for 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:analyzer/source/config.dart';
-import 'package:unittest/unittest.dart';
-import 'package:yaml/yaml.dart';
-
-main() {
-  group('Analysis Config', () {
-    test('parseConfigSource', () {
-      String source = r'''
-analyzer:
-  configuration: google/strict
-''';
-      YamlMap options = loadYamlNode(source);
-      AnalysisConfigurationDescriptor descriptor =
-          new AnalysisConfigurationDescriptor.fromAnalyzerOptions(
-              options['analyzer']);
-      expect(descriptor.package, 'google');
-      expect(descriptor.pragma, 'strict');
-    });
-  });
-}
diff --git a/pkg/analyzer/test/source/embedder_test.dart b/pkg/analyzer/test/source/embedder_test.dart
index fb3df17..2068361 100644
--- a/pkg/analyzer/test/source/embedder_test.dart
+++ b/pkg/analyzer/test/source/embedder_test.dart
@@ -11,16 +11,18 @@
 import 'package:analyzer/source/embedder.dart';
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../embedder_tests.dart';
 import '../resource_utils.dart';
 
 main() {
-  defineReflectiveTests(DartUriResolverTest);
-  defineReflectiveTests(EmbedderSdkTest);
-  defineReflectiveTests(EmbedderUriResolverTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(DartUriResolverTest);
+    defineReflectiveTests(EmbedderSdkTest);
+    defineReflectiveTests(EmbedderUriResolverTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/source/error_processor_test.dart b/pkg/analyzer/test/source/error_processor_test.dart
index c170fc9..fcf3f1e 100644
--- a/pkg/analyzer/test/source/error_processor_test.dart
+++ b/pkg/analyzer/test/source/error_processor_test.dart
@@ -13,7 +13,7 @@
 import 'package:analyzer/src/task/options.dart';
 import 'package:plugin/manager.dart';
 import 'package:plugin/plugin.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 import 'package:yaml/src/yaml_node.dart';
 
 import '../generated/test_support.dart';
diff --git a/pkg/analyzer/test/source/package_map_provider_test.dart b/pkg/analyzer/test/source/package_map_provider_test.dart
index 23b8511..5959e42 100644
--- a/pkg/analyzer/test/source/package_map_provider_test.dart
+++ b/pkg/analyzer/test/source/package_map_provider_test.dart
@@ -10,23 +10,21 @@
 import 'package:analyzer/source/pub_package_map_provider.dart';
 import 'package:analyzer/src/dart/sdk/sdk.dart';
 import 'package:analyzer/src/generated/sdk.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
-
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(PubPackageMapProviderTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(PubPackageMapProviderTest);
+  });
 }
 
 @reflectiveTest
 class PubPackageMapProviderTest {
-  static const String projectPath = '/path/to/project';
-
   DartSdk sdk;
   MemoryResourceProvider resourceProvider;
   PubPackageMapProvider packageMapProvider;
+  String projectPath;
   Folder projectFolder;
 
   PackageMapInfo parsePackageMap(Map obj) {
@@ -35,9 +33,11 @@
 
   void setUp() {
     resourceProvider = new MemoryResourceProvider();
-    sdk = new FolderBasedDartSdk(resourceProvider,
-        FolderBasedDartSdk.defaultSdkDirectory(resourceProvider));
+    Folder sdkFolder = resourceProvider
+        .newFolder(resourceProvider.convertPath('/Users/user/dart-sdk'));
+    sdk = new FolderBasedDartSdk(resourceProvider, sdkFolder);
     packageMapProvider = new PubPackageMapProvider(resourceProvider, sdk);
+    projectPath = resourceProvider.convertPath('/path/to/project');
     projectFolder = resourceProvider.newFolder(projectPath);
   }
 
@@ -48,12 +48,15 @@
     });
     PackageMapInfo info = packageMapProvider.computePackageMap(projectFolder);
     expect(info.packageMap, isNull);
-    expect(info.dependencies, unorderedEquals(['$projectPath/pubspec.lock']));
+    expect(
+        info.dependencies,
+        unorderedEquals(
+            [resourceProvider.pathContext.join(projectPath, 'pubspec.lock')]));
   }
 
   void test_parsePackageMap_dontIgnoreNonExistingFolder() {
     String packageName = 'foo';
-    String folderPath = '/path/to/folder';
+    String folderPath = resourceProvider.convertPath('/path/to/folder');
     Map<String, List<Folder>> result = parsePackageMap({
       'packages': {packageName: folderPath}
     }).packageMap;
@@ -65,8 +68,10 @@
   }
 
   void test_parsePackageMap_handleDependencies() {
-    String path1 = '/path/to/folder1/pubspec.lock';
-    String path2 = '/path/to/folder2/pubspec.lock';
+    String path1 =
+        resourceProvider.convertPath('/path/to/folder1/pubspec.lock');
+    String path2 =
+        resourceProvider.convertPath('/path/to/folder2/pubspec.lock');
     resourceProvider.newFile(path1, '...');
     resourceProvider.newFile(path2, '...');
     Set<String> dependencies = parsePackageMap({
@@ -80,7 +85,7 @@
 
   void test_parsePackageMap_normalFolder() {
     String packageName = 'foo';
-    String folderPath = '/path/to/folder';
+    String folderPath = resourceProvider.convertPath('/path/to/folder');
     resourceProvider.newFolder(folderPath);
     Map<String, List<Folder>> result = parsePackageMap({
       'packages': {packageName: folderPath}
@@ -94,8 +99,8 @@
 
   void test_parsePackageMap_packageMapsToList() {
     String packageName = 'foo';
-    String folderPath1 = '/path/to/folder1';
-    String folderPath2 = '/path/to/folder2';
+    String folderPath1 = resourceProvider.convertPath('/path/to/folder1');
+    String folderPath2 = resourceProvider.convertPath('/path/to/folder2');
     resourceProvider.newFolder(folderPath1);
     resourceProvider.newFolder(folderPath2);
     Map<String, List<Folder>> result = parsePackageMap({
@@ -113,7 +118,7 @@
   }
 
   void test_parsePackageMap_relativePahInPackages() {
-    String packagePath = '/path/to/package';
+    String packagePath = resourceProvider.convertPath('/path/to/package');
     String relativePackagePath = '../package';
     String packageName = 'foo';
     resourceProvider.newFolder(projectPath);
@@ -127,7 +132,8 @@
   }
 
   void test_parsePackageMap_relativePathInDependencies() {
-    String dependencyPath = '/path/to/pubspec.lock';
+    String dependencyPath =
+        resourceProvider.convertPath('/path/to/pubspec.lock');
     String relativeDependencyPath = '../pubspec.lock';
     resourceProvider.newFolder(projectPath);
     resourceProvider.newFile(dependencyPath, 'contents');
diff --git a/pkg/analyzer/test/source/package_map_resolver_test.dart b/pkg/analyzer/test/source/package_map_resolver_test.dart
index bcdd5be..f6b9a3d 100644
--- a/pkg/analyzer/test/source/package_map_resolver_test.dart
+++ b/pkg/analyzer/test/source/package_map_resolver_test.dart
@@ -9,14 +9,13 @@
 import 'package:analyzer/source/package_map_resolver.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:path/path.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
-
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(_PackageMapUriResolverTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(_PackageMapUriResolverTest);
+  });
 }
 
 @reflectiveTest
@@ -56,15 +55,15 @@
   }
 
   void test_resolve_multiple_folders() {
-    const pkgFileA = '/part1/lib/libA.dart';
-    const pkgFileB = '/part2/lib/libB.dart';
+    String pkgFileA = provider.convertPath('/part1/lib/libA.dart');
+    String pkgFileB = provider.convertPath('/part2/lib/libB.dart');
     provider.newFile(pkgFileA, 'library lib_a');
     provider.newFile(pkgFileB, 'library lib_b');
     PackageMapUriResolver resolver =
         new PackageMapUriResolver(provider, <String, List<Folder>>{
       'pkg': <Folder>[
-        provider.getResource('/part1/lib/'),
-        provider.getResource('/part2/lib/')
+        provider.getResource(provider.convertPath('/part1/lib/')),
+        provider.getResource(provider.convertPath('/part2/lib/'))
       ]
     });
     {
@@ -93,14 +92,16 @@
   }
 
   void test_resolve_OK() {
-    const pkgFileA = '/pkgA/lib/libA.dart';
-    const pkgFileB = '/pkgB/lib/libB.dart';
+    String pkgFileA = provider.convertPath('/pkgA/lib/libA.dart');
+    String pkgFileB = provider.convertPath('/pkgB/lib/libB.dart');
     provider.newFile(pkgFileA, 'library lib_a;');
     provider.newFile(pkgFileB, 'library lib_b;');
     PackageMapUriResolver resolver =
         new PackageMapUriResolver(provider, <String, List<Folder>>{
-      'pkgA': <Folder>[provider.getResource('/pkgA/lib/')],
-      'pkgB': <Folder>[provider.getResource('/pkgB/lib/')]
+      'pkgA': <Folder>[
+        provider.getResource(provider.convertPath('/pkgA/lib/'))
+      ],
+      'pkgB': <Folder>[provider.getResource(provider.convertPath('/pkgB/lib/'))]
     });
     {
       Uri uri = Uri.parse('package:pkgA/libA.dart');
@@ -152,23 +153,27 @@
   }
 
   void test_restoreAbsolute() {
-    const pkgFileA = '/pkgA/lib/libA.dart';
-    const pkgFileB = '/pkgB/lib/src/libB.dart';
+    String pkgFileA = provider.convertPath('/pkgA/lib/libA.dart');
+    String pkgFileB = provider.convertPath('/pkgB/lib/src/libB.dart');
     provider.newFile(pkgFileA, 'library lib_a;');
     provider.newFile(pkgFileB, 'library lib_b;');
     PackageMapUriResolver resolver =
         new PackageMapUriResolver(provider, <String, List<Folder>>{
-      'pkgA': <Folder>[provider.getResource('/pkgA/lib/')],
-      'pkgB': <Folder>[provider.getResource('/pkgB/lib/')]
+      'pkgA': <Folder>[
+        provider.getResource(provider.convertPath('/pkgA/lib/'))
+      ],
+      'pkgB': <Folder>[provider.getResource(provider.convertPath('/pkgB/lib/'))]
     });
     {
-      Source source = _createFileSource('/pkgA/lib/libA.dart');
+      Source source =
+          _createFileSource(provider.convertPath('/pkgA/lib/libA.dart'));
       Uri uri = resolver.restoreAbsolute(source);
       expect(uri, isNotNull);
       expect(uri.toString(), 'package:pkgA/libA.dart');
     }
     {
-      Source source = _createFileSource('/pkgB/lib/src/libB.dart');
+      Source source =
+          _createFileSource(provider.convertPath('/pkgB/lib/src/libB.dart'));
       Uri uri = resolver.restoreAbsolute(source);
       expect(uri, isNotNull);
       expect(uri.toString(), 'package:pkgB/src/libB.dart');
@@ -181,15 +186,15 @@
   }
 
   void test_restoreAbsolute_ambiguous() {
-    const file1 = '/foo1/lib/bar.dart';
-    const file2 = '/foo2/lib/bar.dart';
+    String file1 = provider.convertPath('/foo1/lib/bar.dart');
+    String file2 = provider.convertPath('/foo2/lib/bar.dart');
     provider.newFile(file1, 'library bar');
     provider.newFile(file2, 'library bar');
     PackageMapUriResolver resolver =
         new PackageMapUriResolver(provider, <String, List<Folder>>{
       'foo': <Folder>[
-        provider.getResource('/foo1/lib'),
-        provider.getResource('/foo2/lib')
+        provider.getResource(provider.convertPath('/foo1/lib')),
+        provider.getResource(provider.convertPath('/foo2/lib'))
       ]
     });
     // Restoring file1 should yield a package URI, and that package URI should
@@ -205,19 +210,19 @@
   }
 
   void test_restoreAbsolute_longestMatch() {
-    const file1 = '/foo1/bar1/lib.dart';
-    const file2 = '/foo2/bar2/lib.dart';
+    String file1 = provider.convertPath('/foo1/bar1/lib.dart');
+    String file2 = provider.convertPath('/foo2/bar2/lib.dart');
     provider.newFile(file1, 'library lib');
     provider.newFile(file2, 'library lib');
     PackageMapUriResolver resolver =
         new PackageMapUriResolver(provider, <String, List<Folder>>{
       'pkg1': <Folder>[
-        provider.getResource('/foo1'),
-        provider.getResource('/foo2/bar2')
+        provider.getResource(provider.convertPath('/foo1')),
+        provider.getResource(provider.convertPath('/foo2/bar2'))
       ],
       'pkg2': <Folder>[
-        provider.getResource('/foo1/bar1'),
-        provider.getResource('/foo2')
+        provider.getResource(provider.convertPath('/foo1/bar1')),
+        provider.getResource(provider.convertPath('/foo2'))
       ]
     });
     // Restoring file1 should yield a package URI for pkg2, since pkg2's match
diff --git a/pkg/analyzer/test/source/path_filter_test.dart b/pkg/analyzer/test/source/path_filter_test.dart
index 1cada77..172a421 100644
--- a/pkg/analyzer/test/source/path_filter_test.dart
+++ b/pkg/analyzer/test/source/path_filter_test.dart
@@ -6,12 +6,9 @@
 
 import 'package:analyzer/source/path_filter.dart';
 import 'package:path/path.dart';
-import 'package:unittest/unittest.dart';
-
-import '../utils.dart';
+import 'package:test/test.dart';
 
 main() {
-  initializeTestEnvironment();
   String root(String path) => context.absolute(context.normalize(path));
   group('PathFilterTest', () {
     setUp(() {});
diff --git a/pkg/analyzer/test/source/sdk_ext_test.dart b/pkg/analyzer/test/source/sdk_ext_test.dart
index 7c6b19f..0ca54be 100644
--- a/pkg/analyzer/test/source/sdk_ext_test.dart
+++ b/pkg/analyzer/test/source/sdk_ext_test.dart
@@ -7,14 +7,13 @@
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:analyzer/source/sdk_ext.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
-
-import '../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(SdkExtUriResolverTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(SdkExtUriResolverTest);
+  });
 }
 
 @reflectiveTest
@@ -22,17 +21,23 @@
   MemoryResourceProvider resourceProvider;
 
   void setUp() {
+    String joinAndEscape(List<String> components) {
+      return resourceProvider.pathContext
+          .joinAll(components)
+          .replaceAll(r'\', r'\\');
+    }
+
     resourceProvider = new MemoryResourceProvider();
-    resourceProvider.newFolder('/empty');
-    resourceProvider.newFolder('/tmp');
+    resourceProvider.newFolder(resourceProvider.convertPath('/empty'));
+    resourceProvider.newFolder(resourceProvider.convertPath('/tmp'));
     resourceProvider.newFile(
-        '/tmp/_sdkext',
-        r'''
+        resourceProvider.convertPath('/tmp/_sdkext'),
+        '''
 {
   "dart:fox": "slippy.dart",
   "dart:bear": "grizzly.dart",
-  "dart:relative": "../relative.dart",
-  "dart:deep": "deep/directory/file.dart",
+  "dart:relative": "${joinAndEscape(['..', 'relative.dart'])}",
+  "dart:deep": "${joinAndEscape(['deep', 'directory', 'file.dart'])}",
   "fart:loudly": "nomatter.dart"
 }''');
   }
@@ -45,7 +50,9 @@
 
   test_create_noSdkExtPackageMap() {
     var resolver = new SdkExtUriResolver({
-      'fox': <Folder>[resourceProvider.getResource('/empty')]
+      'fox': <Folder>[
+        resourceProvider.getFolder(resourceProvider.convertPath('/empty'))
+      ]
     });
     expect(resolver.length, equals(0));
   }
@@ -57,20 +64,28 @@
 
   test_create_sdkExtPackageMap() {
     var resolver = new SdkExtUriResolver({
-      'fox': <Folder>[resourceProvider.getResource('/tmp')]
+      'fox': <Folder>[
+        resourceProvider.newFolder(resourceProvider.convertPath('/tmp'))
+      ]
     });
     // We have four mappings.
     expect(resolver.length, equals(4));
     // Check that they map to the correct paths.
-    expect(resolver['dart:fox'], equals("/tmp/slippy.dart"));
-    expect(resolver['dart:bear'], equals("/tmp/grizzly.dart"));
-    expect(resolver['dart:relative'], equals("/relative.dart"));
-    expect(resolver['dart:deep'], equals("/tmp/deep/directory/file.dart"));
+    expect(resolver['dart:fox'],
+        equals(resourceProvider.convertPath('/tmp/slippy.dart')));
+    expect(resolver['dart:bear'],
+        equals(resourceProvider.convertPath('/tmp/grizzly.dart')));
+    expect(resolver['dart:relative'],
+        equals(resourceProvider.convertPath('/relative.dart')));
+    expect(resolver['dart:deep'],
+        equals(resourceProvider.convertPath('/tmp/deep/directory/file.dart')));
   }
 
   test_restoreAbsolute() {
     var resolver = new SdkExtUriResolver({
-      'fox': <Folder>[resourceProvider.getResource('/tmp')]
+      'fox': <Folder>[
+        resourceProvider.newFolder(resourceProvider.convertPath('/tmp'))
+      ]
     });
     var source = resolver.resolveAbsolute(Uri.parse('dart:fox'));
     expect(source, isNotNull);
diff --git a/pkg/analyzer/test/source/test_all.dart b/pkg/analyzer/test/source/test_all.dart
index bca740b..a995c9b 100644
--- a/pkg/analyzer/test/source/test_all.dart
+++ b/pkg/analyzer/test/source/test_all.dart
@@ -4,11 +4,9 @@
 
 library analyzer.test.source.test_all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../utils.dart';
 import 'analysis_options_provider_test.dart' as analysis_options_provider_test;
-import 'config_test.dart' as config_test;
 import 'embedder_test.dart' as embedder_test;
 import 'error_processor_test.dart' as error_processor_test;
 import 'package_map_provider_test.dart' as package_map_provider_test;
@@ -18,15 +16,13 @@
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('source', () {
+  defineReflectiveSuite(() {
     analysis_options_provider_test.main();
-    config_test.main();
     embedder_test.main();
     error_processor_test.main();
     package_map_provider_test.main();
     package_map_resolver_test.main();
     path_filter_test.main();
     sdk_ext_test.main();
-  });
+  }, name: 'source');
 }
diff --git a/pkg/analyzer/test/src/abstract_single_unit.dart b/pkg/analyzer/test/src/abstract_single_unit.dart
index 428948e..550e2ff 100644
--- a/pkg/analyzer/test/src/abstract_single_unit.dart
+++ b/pkg/analyzer/test/src/abstract_single_unit.dart
@@ -10,7 +10,7 @@
 import 'package:analyzer/src/dart/ast/utilities.dart';
 import 'package:analyzer/src/generated/java_engine.dart';
 import 'package:analyzer/src/generated/source.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import 'context/abstract_context.dart';
 
diff --git a/pkg/analyzer/test/src/command_line/arguments_test.dart b/pkg/analyzer/test/src/command_line/arguments_test.dart
new file mode 100644
index 0000000..eb6704c
--- /dev/null
+++ b/pkg/analyzer/test/src/command_line/arguments_test.dart
@@ -0,0 +1,205 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 analyzer.test.src.context.context_builder_test;
+
+import 'package:analyzer/file_system/memory_file_system.dart';
+import 'package:analyzer/src/command_line/arguments.dart';
+import 'package:analyzer/src/context/builder.dart';
+import 'package:analyzer/src/dart/sdk/sdk.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/sdk.dart';
+import 'package:args/args.dart';
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ArgumentsTest);
+  });
+}
+
+@reflectiveTest
+class ArgumentsTest {
+  void test_createContextBuilderOptions_all() {
+    String dartSdkSummaryPath = 'a';
+    String defaultAnalysisOptionsFilePath = 'b';
+    String defaultPackageFilePath = 'c';
+    String defaultPackagesDirectoryPath = 'd';
+    MemoryResourceProvider provider = new MemoryResourceProvider();
+    ArgParser parser = new ArgParser();
+    defineAnalysisArguments(parser);
+    List<String> args = [
+      '--dart-sdk-summary=$dartSdkSummaryPath',
+      '-Dfoo=1',
+      '-Dbar=2',
+      '--enable-strict-call-checks',
+      '--no-implicit-casts',
+      '--no-implicit-dynamic',
+      '--options=$defaultAnalysisOptionsFilePath',
+      '--packages=$defaultPackageFilePath',
+      '--package-root=$defaultPackagesDirectoryPath',
+      '--strong',
+      '--supermixin',
+    ];
+    ArgResults result = parse(provider, parser, args);
+    ContextBuilderOptions options = createContextBuilderOptions(result);
+    expect(options, isNotNull);
+    expect(options.dartSdkSummaryPath, dartSdkSummaryPath);
+    Map<String, String> declaredVariables = options.declaredVariables;
+    expect(declaredVariables, hasLength(2));
+    expect(declaredVariables['foo'], '1');
+    expect(declaredVariables['bar'], '2');
+    expect(
+        options.defaultAnalysisOptionsFilePath, defaultAnalysisOptionsFilePath);
+    expect(options.defaultPackageFilePath, defaultPackageFilePath);
+    expect(options.defaultPackagesDirectoryPath, defaultPackagesDirectoryPath);
+    AnalysisOptionsImpl defaultOptions = options.defaultOptions;
+    expect(defaultOptions, isNotNull);
+    expect(defaultOptions.enableStrictCallChecks, true);
+    expect(defaultOptions.strongMode, true);
+    expect(defaultOptions.implicitCasts, false);
+    expect(defaultOptions.implicitDynamic, false);
+    expect(options.pubSummaryManager, isNull);
+  }
+
+  void test_createContextBuilderOptions_none() {
+    MemoryResourceProvider provider = new MemoryResourceProvider();
+    ArgParser parser = new ArgParser();
+    defineAnalysisArguments(parser);
+    List<String> args = [];
+    ArgResults result = parse(provider, parser, args);
+    ContextBuilderOptions options = createContextBuilderOptions(result);
+    expect(options, isNotNull);
+    expect(options.dartSdkSummaryPath, isNull);
+    expect(options.declaredVariables, isEmpty);
+    expect(options.defaultAnalysisOptionsFilePath, isNull);
+    expect(options.defaultPackageFilePath, isNull);
+    expect(options.defaultPackagesDirectoryPath, isNull);
+    AnalysisOptionsImpl defaultOptions = options.defaultOptions;
+    expect(defaultOptions, isNotNull);
+    expect(defaultOptions.enableStrictCallChecks, false);
+    expect(defaultOptions.strongMode, false);
+    expect(defaultOptions.implicitCasts, true);
+    expect(defaultOptions.implicitDynamic, true);
+    expect(options.pubSummaryManager, isNull);
+  }
+
+  void test_createDartSdkManager_noPath_noSummaries() {
+    MemoryResourceProvider provider = new MemoryResourceProvider();
+    ArgParser parser = new ArgParser();
+    defineAnalysisArguments(parser);
+    List<String> args = [];
+    ArgResults result = parse(provider, parser, args);
+    DartSdkManager manager = createDartSdkManager(provider, false, result);
+    expect(manager, isNotNull);
+    expect(manager.defaultSdkDirectory,
+        FolderBasedDartSdk.defaultSdkDirectory(provider));
+    expect(manager.canUseSummaries, false);
+  }
+
+  void test_createDartSdkManager_noPath_summaries() {
+    MemoryResourceProvider provider = new MemoryResourceProvider();
+    ArgParser parser = new ArgParser();
+    defineAnalysisArguments(parser);
+    List<String> args = [];
+    ArgResults result = parse(provider, parser, args);
+    DartSdkManager manager = createDartSdkManager(provider, true, result);
+    expect(manager, isNotNull);
+    expect(manager.defaultSdkDirectory,
+        FolderBasedDartSdk.defaultSdkDirectory(provider));
+    expect(manager.canUseSummaries, true);
+  }
+
+  void test_createDartSdkManager_path_noSummaries() {
+    MemoryResourceProvider provider = new MemoryResourceProvider();
+    ArgParser parser = new ArgParser();
+    defineAnalysisArguments(parser);
+    List<String> args = ['--dart-sdk=x'];
+    ArgResults result = parse(provider, parser, args);
+    DartSdkManager manager = createDartSdkManager(provider, false, result);
+    expect(manager, isNotNull);
+    expect(manager.defaultSdkDirectory, 'x');
+    expect(manager.canUseSummaries, false);
+  }
+
+  void test_createDartSdkManager_path_summaries() {
+    MemoryResourceProvider provider = new MemoryResourceProvider();
+    ArgParser parser = new ArgParser();
+    defineAnalysisArguments(parser);
+    List<String> args = ['--dart-sdk=y'];
+    ArgResults result = parse(provider, parser, args);
+    DartSdkManager manager = createDartSdkManager(provider, true, result);
+    expect(manager, isNotNull);
+    expect(manager.defaultSdkDirectory, 'y');
+    expect(manager.canUseSummaries, true);
+  }
+
+  void test_defineAnalysisArguments() {
+    ArgParser parser = new ArgParser();
+    defineAnalysisArguments(parser);
+    expect(parser.options, hasLength(12));
+  }
+
+  void test_filterUnknownArguments() {
+    List<String> args = ['--a', '--b', '--c', 'foo', 'bar'];
+    ArgParser parser = new ArgParser();
+    parser.addFlag('a');
+    parser.addFlag('c');
+    List<String> result = filterUnknownArguments(args, parser);
+    expect(result, orderedEquals(['--a', '--c', 'foo', 'bar']));
+  }
+
+  void test_parse_noReplacement_noIgnored() {
+    MemoryResourceProvider provider = new MemoryResourceProvider();
+    ArgParser parser = new ArgParser();
+    parser.addFlag('xx');
+    parser.addOption('yy');
+    List<String> args = ['--xx', '--yy=abc', 'foo', 'bar'];
+    ArgResults result = parse(provider, parser, args);
+    expect(result, isNotNull);
+    expect(result['xx'], true);
+    expect(result['yy'], 'abc');
+    expect(result.rest, orderedEquals(['foo', 'bar']));
+  }
+
+  void test_preprocessArgs_noReplacement() {
+    MemoryResourceProvider provider = new MemoryResourceProvider();
+    List<String> result = preprocessArgs(provider, ['--xx' '--yy' 'baz']);
+    expect(result, orderedEquals(['--xx' '--yy' 'baz']));
+  }
+
+  void test_preprocessArgs_replacement_exists() {
+    MemoryResourceProvider provider = new MemoryResourceProvider();
+    String filePath = provider.convertPath('/args.txt');
+    provider.newFile(
+        filePath,
+        '''
+-a
+--xx
+
+foo
+bar
+''');
+    List<String> result =
+        preprocessArgs(provider, ['--preserved', '@$filePath']);
+    expect(result, orderedEquals(['--preserved', '-a', '--xx', 'foo', 'bar']));
+  }
+
+  void test_preprocessArgs_replacement_nonexistent() {
+    MemoryResourceProvider provider = new MemoryResourceProvider();
+    String filePath = provider.convertPath('/args.txt');
+    List<String> args = ['ignored', '@$filePath'];
+    List<String> result = preprocessArgs(provider, args);
+    expect(result, orderedEquals(args));
+  }
+
+  void test_preprocessArgs_replacement_notLast() {
+    MemoryResourceProvider provider = new MemoryResourceProvider();
+    String filePath = provider.convertPath('/args.txt');
+    List<String> args = ['a', '@$filePath', 'b'];
+    List<String> result = preprocessArgs(provider, args);
+    expect(result, orderedEquals(args));
+  }
+}
diff --git a/pkg/analyzer/test/src/command_line/test_all.dart b/pkg/analyzer/test/src/command_line/test_all.dart
new file mode 100644
index 0000000..c3239f9
--- /dev/null
+++ b/pkg/analyzer/test/src/command_line/test_all.dart
@@ -0,0 +1,15 @@
+// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
+// for 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 analyzer.test.src.command_line.test_all;
+
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'arguments_test.dart' as arguments_test;
+
+main() {
+  defineReflectiveSuite(() {
+    arguments_test.main();
+  }, name: 'command_line');
+}
diff --git a/pkg/analyzer/test/src/context/abstract_context.dart b/pkg/analyzer/test/src/context/abstract_context.dart
index ba11f84..ae77652 100644
--- a/pkg/analyzer/test/src/context/abstract_context.dart
+++ b/pkg/analyzer/test/src/context/abstract_context.dart
@@ -18,7 +18,7 @@
 import 'package:analyzer/task/model.dart';
 import 'package:plugin/manager.dart';
 import 'package:plugin/plugin.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import 'mock_sdk.dart';
 
@@ -126,7 +126,8 @@
   DartSdk createDartSdk() => new MockSdk(resourceProvider: resourceProvider);
 
   Source newSource(String path, [String content = '']) {
-    File file = resourceProvider.newFile(path, content);
+    File file =
+        resourceProvider.newFile(resourceProvider.convertPath(path), content);
     return file.createSource();
   }
 
diff --git a/pkg/analyzer/test/src/context/builder_test.dart b/pkg/analyzer/test/src/context/builder_test.dart
index 6de0ec6..9ddf64f 100644
--- a/pkg/analyzer/test/src/context/builder_test.dart
+++ b/pkg/analyzer/test/src/context/builder_test.dart
@@ -7,9 +7,9 @@
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:analyzer/plugin/options.dart';
-import 'package:analyzer/source/package_map_resolver.dart';
 import 'package:analyzer/src/context/builder.dart';
 import 'package:analyzer/src/context/source.dart';
+import 'package:analyzer/src/generated/bazel.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/source.dart';
@@ -18,18 +18,18 @@
 import 'package:package_config/src/packages_impl.dart';
 import 'package:path/path.dart' as path;
 import 'package:plugin/src/plugin_impl.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../embedder_tests.dart';
 import '../../generated/test_support.dart';
-import '../../utils.dart';
 import 'mock_sdk.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ContextBuilderTest);
-  defineReflectiveTests(EmbedderYamlLocatorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ContextBuilderTest);
+    defineReflectiveTests(EmbedderYamlLocatorTest);
+  });
 }
 
 @reflectiveTest
@@ -55,6 +55,11 @@
   ContentCache contentCache;
 
   /**
+   * The options passed to the context builder.
+   */
+  ContextBuilderOptions builderOptions = new ContextBuilderOptions();
+
+  /**
    * The context builder to be used in the test.
    */
   ContextBuilder builder;
@@ -65,6 +70,11 @@
    */
   String defaultSdkPath = null;
 
+  Uri convertedDirectoryUri(String directoryPath) {
+    return new Uri.directory(resourceProvider.convertPath(directoryPath),
+        windows: pathContext.style == path.windows.style);
+  }
+
   void createDefaultSdk(Folder sdkDir) {
     defaultSdkPath = pathContext.join(sdkDir.path, 'default', 'sdk');
     String librariesFilePath = pathContext.join(defaultSdkPath, 'lib',
@@ -77,9 +87,9 @@
   "core": const LibraryInfo("core/core.dart"),
 };
 ''');
-    sdkManager =
-        new DartSdkManager(defaultSdkPath, false, (_) => new MockSdk());
-    builder = new ContextBuilder(resourceProvider, sdkManager, contentCache);
+    sdkManager = new DartSdkManager(defaultSdkPath, false);
+    builder = new ContextBuilder(resourceProvider, sdkManager, contentCache,
+        options: builderOptions);
   }
 
   void createFile(String path, String content) {
@@ -91,11 +101,11 @@
     resourceProvider = new MemoryResourceProvider();
     pathContext = resourceProvider.pathContext;
     new MockSdk(resourceProvider: resourceProvider);
-    sdkManager = new DartSdkManager('/', false, (_) {
-      fail('Should not be used to create an SDK');
-    });
+    sdkManager =
+        new DartSdkManager(resourceProvider.convertPath('/sdk'), false);
     contentCache = new ContentCache();
-    builder = new ContextBuilder(resourceProvider, sdkManager, contentCache);
+    builder = new ContextBuilder(resourceProvider, sdkManager, contentCache,
+        options: builderOptions);
   }
 
   @failingTest
@@ -113,11 +123,11 @@
 
   void test_convertPackagesToMap_packages() {
     String fooName = 'foo';
-    String fooPath = '/pkg/foo';
-    Uri fooUri = new Uri.directory(fooPath);
+    String fooPath = resourceProvider.convertPath('/pkg/foo');
+    Uri fooUri = pathContext.toUri(fooPath);
     String barName = 'bar';
-    String barPath = '/pkg/bar';
-    Uri barUri = new Uri.directory(barPath);
+    String barPath = resourceProvider.convertPath('/pkg/bar');
+    Uri barUri = pathContext.toUri(barPath);
 
     MapPackages packages = new MapPackages({fooName: fooUri, barName: barUri});
     Map<String, List<Folder>> result = builder.convertPackagesToMap(packages);
@@ -135,11 +145,12 @@
     AnalysisOptionsImpl defaultOptions = new AnalysisOptionsImpl();
     defaultOptions.dart2jsHint = !defaultOptions.dart2jsHint;
     defaultOptions.enableAssertMessage = !defaultOptions.enableAssertMessage;
-    defaultOptions.enableGenericMethods = !defaultOptions.enableGenericMethods;
+    defaultOptions.enableLazyAssignmentOperators =
+        !defaultOptions.enableLazyAssignmentOperators;
     defaultOptions.enableStrictCallChecks =
         !defaultOptions.enableStrictCallChecks;
     defaultOptions.enableSuperMixins = !defaultOptions.enableSuperMixins;
-    builder.defaultOptions = defaultOptions;
+    builderOptions.defaultOptions = defaultOptions;
     AnalysisOptions options = builder.createDefaultOptions();
     _expectEqualOptions(options, defaultOptions);
   }
@@ -151,7 +162,7 @@
 
   void test_createPackageMap_fromPackageDirectory_explicit() {
     // Use a package directory that is outside the project directory.
-    String rootPath = '/root';
+    String rootPath = resourceProvider.convertPath('/root');
     String projectPath = pathContext.join(rootPath, 'project');
     String packageDirPath = pathContext.join(rootPath, 'packages');
     String fooName = 'foo';
@@ -162,19 +173,19 @@
     resourceProvider.newFolder(fooPath);
     resourceProvider.newFolder(barPath);
 
-    builder.defaultPackagesDirectoryPath = packageDirPath;
+    builderOptions.defaultPackagesDirectoryPath = packageDirPath;
 
     Packages packages = builder.createPackageMap(projectPath);
     expect(packages, isNotNull);
     Map<String, Uri> map = packages.asMap();
     expect(map, hasLength(2));
-    expect(map[fooName], new Uri.directory(fooPath));
-    expect(map[barName], new Uri.directory(barPath));
+    expect(map[fooName], convertedDirectoryUri(fooPath));
+    expect(map[barName], convertedDirectoryUri(barPath));
   }
 
   void test_createPackageMap_fromPackageDirectory_inRoot() {
     // Use a package directory that is inside the project directory.
-    String projectPath = '/root/project';
+    String projectPath = resourceProvider.convertPath('/root/project');
     String packageDirPath = pathContext.join(projectPath, 'packages');
     String fooName = 'foo';
     String fooPath = pathContext.join(packageDirPath, fooName);
@@ -187,104 +198,107 @@
     expect(packages, isNotNull);
     Map<String, Uri> map = packages.asMap();
     expect(map, hasLength(2));
-    expect(map[fooName], new Uri.directory(fooPath));
-    expect(map[barName], new Uri.directory(barPath));
+    expect(map[fooName], convertedDirectoryUri(fooPath));
+    expect(map[barName], convertedDirectoryUri(barPath));
   }
 
   void test_createPackageMap_fromPackageFile_explicit() {
     // Use a package file that is outside the project directory's hierarchy.
-    String rootPath = '/root';
+    String rootPath = resourceProvider.convertPath('/root');
     String projectPath = pathContext.join(rootPath, 'project');
     String packageFilePath = pathContext.join(rootPath, 'child', '.packages');
     resourceProvider.newFolder(projectPath);
+    Uri fooUri = convertedDirectoryUri('/pkg/foo');
+    Uri barUri = convertedDirectoryUri('/pkg/bar');
     createFile(
         packageFilePath,
-        r'''
-foo:/pkg/foo
-bar:/pkg/bar
+        '''
+foo:$fooUri
+bar:$barUri
 ''');
 
-    builder.defaultPackageFilePath = packageFilePath;
+    builderOptions.defaultPackageFilePath = packageFilePath;
     Packages packages = builder.createPackageMap(projectPath);
     expect(packages, isNotNull);
     Map<String, Uri> map = packages.asMap();
     expect(map, hasLength(2));
-    expect(map['foo'], new Uri.directory('/pkg/foo'));
-    expect(map['bar'], new Uri.directory('/pkg/bar'));
+    expect(map['foo'], fooUri);
+    expect(map['bar'], barUri);
   }
 
   void test_createPackageMap_fromPackageFile_inParentOfRoot() {
     // Use a package file that is inside the parent of the project directory.
-    String rootPath = '/root';
+    String rootPath = resourceProvider.convertPath('/root');
     String projectPath = pathContext.join(rootPath, 'project');
     String packageFilePath = pathContext.join(rootPath, '.packages');
     resourceProvider.newFolder(projectPath);
+    Uri fooUri = convertedDirectoryUri('/pkg/foo');
+    Uri barUri = convertedDirectoryUri('/pkg/bar');
     createFile(
         packageFilePath,
-        r'''
-foo:/pkg/foo
-bar:/pkg/bar
+        '''
+foo:$fooUri
+bar:$barUri
 ''');
 
     Packages packages = builder.createPackageMap(projectPath);
     expect(packages, isNotNull);
     Map<String, Uri> map = packages.asMap();
     expect(map, hasLength(2));
-    expect(map['foo'], new Uri.directory('/pkg/foo'));
-    expect(map['bar'], new Uri.directory('/pkg/bar'));
+    expect(map['foo'], fooUri);
+    expect(map['bar'], barUri);
   }
 
   void test_createPackageMap_fromPackageFile_inRoot() {
     // Use a package file that is inside the project directory.
-    String rootPath = '/root';
+    String rootPath = resourceProvider.convertPath('/root');
     String projectPath = pathContext.join(rootPath, 'project');
     String packageFilePath = pathContext.join(projectPath, '.packages');
     resourceProvider.newFolder(projectPath);
+    Uri fooUri = convertedDirectoryUri('/pkg/foo');
+    Uri barUri = convertedDirectoryUri('/pkg/bar');
     createFile(
         packageFilePath,
-        r'''
-foo:/pkg/foo
-bar:/pkg/bar
+        '''
+foo:$fooUri
+bar:$barUri
 ''');
 
     Packages packages = builder.createPackageMap(projectPath);
     expect(packages, isNotNull);
     Map<String, Uri> map = packages.asMap();
     expect(map, hasLength(2));
-    expect(map['foo'], new Uri.directory('/pkg/foo'));
-    expect(map['bar'], new Uri.directory('/pkg/bar'));
+    expect(map['foo'], fooUri);
+    expect(map['bar'], barUri);
   }
 
   void test_createPackageMap_none() {
-    String rootPath = '/root';
+    String rootPath = resourceProvider.convertPath('/root');
+    resourceProvider.newFolder(rootPath);
     Packages packages = builder.createPackageMap(rootPath);
     expect(packages, same(Packages.noPackages));
   }
 
-  void test_createSourceFactory_fileProvider() {
-    String rootPath = '/root';
-    Folder rootFolder = resourceProvider.getFolder(rootPath);
-    createDefaultSdk(rootFolder);
-    String projectPath = pathContext.join(rootPath, 'project');
-    String packageFilePath = pathContext.join(projectPath, '.packages');
-    String packageA = pathContext.join(rootPath, 'pkgs', 'a');
-    String packageB = pathContext.join(rootPath, 'pkgs', 'b');
-    createFile(
-        packageFilePath,
-        '''
-a:${pathContext.toUri(packageA)}
-b:${pathContext.toUri(packageB)}
-''');
+  void test_createSourceFactory_bazelWorkspace_fileProvider() {
+    String _p(String path) => resourceProvider.convertPath(path);
+
+    String projectPath = _p('/workspace/my/module');
+    resourceProvider.newFile(_p('/workspace/WORKSPACE'), '');
+    resourceProvider.newFolder(_p('/workspace/bazel-bin'));
+    resourceProvider.newFolder(_p('/workspace/bazel-genfiles'));
+    resourceProvider.newFolder(projectPath);
+
     AnalysisOptionsImpl options = new AnalysisOptionsImpl();
-    UriResolver resolver = new ResourceUriResolver(resourceProvider);
-    builder.fileResolverProvider = (folder) => resolver;
     SourceFactoryImpl factory =
         builder.createSourceFactory(projectPath, options);
-    expect(factory.resolvers, contains(same(resolver)));
+    expect(factory.resolvers,
+        contains(predicate((r) => r is BazelFileUriResolver)));
+    expect(factory.resolvers,
+        contains(predicate((r) => r is BazelPackageUriResolver)));
   }
 
   void test_createSourceFactory_noProvider_packages_embedder_extensions() {
-    String rootPath = '/root';
+    String rootPath = resourceProvider.convertPath('/root');
     Folder rootFolder = resourceProvider.getFolder(rootPath);
     createDefaultSdk(rootFolder);
     String projectPath = pathContext.join(rootPath, 'project');
@@ -332,7 +346,7 @@
   }
 
   void test_createSourceFactory_noProvider_packages_embedder_noExtensions() {
-    String rootPath = '/root';
+    String rootPath = resourceProvider.convertPath('/root');
     Folder rootFolder = resourceProvider.getFolder(rootPath);
     createDefaultSdk(rootFolder);
     String projectPath = pathContext.join(rootPath, 'project');
@@ -374,7 +388,7 @@
   }
 
   void test_createSourceFactory_noProvider_packages_noEmbedder_noExtensions() {
-    String rootPath = '/root';
+    String rootPath = resourceProvider.convertPath('/root');
     Folder rootFolder = resourceProvider.getFolder(rootPath);
     createDefaultSdk(rootFolder);
     String projectPath = pathContext.join(rootPath, 'project');
@@ -393,30 +407,18 @@
 
     Source dartSource = factory.forUri('dart:core');
     expect(dartSource, isNotNull);
-    expect(dartSource.fullName, '$defaultSdkPath/lib/core/core.dart');
+    expect(dartSource.fullName,
+        pathContext.join(defaultSdkPath, 'lib', 'core', 'core.dart'));
 
     Source packageSource = factory.forUri('package:a/a.dart');
     expect(packageSource, isNotNull);
     expect(packageSource.fullName, pathContext.join(packageA, 'a.dart'));
   }
 
-  void test_createSourceFactory_packageProvider() {
-    String rootPath = '/root';
-    Folder rootFolder = resourceProvider.getFolder(rootPath);
-    createDefaultSdk(rootFolder);
-    String projectPath = pathContext.join(rootPath, 'project');
-    AnalysisOptionsImpl options = new AnalysisOptionsImpl();
-    UriResolver resolver = new PackageMapUriResolver(resourceProvider, {});
-    builder.packageResolverProvider = (folder) => resolver;
-    SourceFactoryImpl factory =
-        builder.createSourceFactory(projectPath, options);
-    expect(factory.resolvers, contains(same(resolver)));
-  }
-
   void test_declareVariables_emptyMap() {
     AnalysisContext context = AnalysisEngine.instance.createAnalysisContext();
     Iterable<String> expected = context.declaredVariables.variableNames;
-    builder.declaredVariables = <String, String>{};
+    builderOptions.declaredVariables = <String, String>{};
 
     builder.declareVariables(context);
     expect(context.declaredVariables.variableNames, unorderedEquals(expected));
@@ -428,7 +430,7 @@
     expect(expected, isNot(contains('a')));
     expect(expected, isNot(contains('b')));
     expected.addAll(['a', 'b']);
-    builder.declaredVariables = <String, String>{'a': 'a', 'b': 'b'};
+    builderOptions.declaredVariables = <String, String>{'a': 'a', 'b': 'b'};
 
     builder.declareVariables(context);
     expect(context.declaredVariables.variableNames, unorderedEquals(expected));
@@ -471,14 +473,38 @@
     expect(sdk, isNotNull);
   }
 
+  void test_findSdk_noPackageMap_html_spec() {
+    DartSdk sdk = builder.findSdk(null, new AnalysisOptionsImpl());
+    expect(sdk, isNotNull);
+    Source htmlSource = sdk.mapDartUri('dart:html');
+    expect(
+        htmlSource.fullName,
+        resourceProvider
+            .convertPath('/sdk/lib/html/dartium/html_dartium.dart'));
+    expect(htmlSource.exists(), isTrue);
+  }
+
+  void test_findSdk_noPackageMap_html_strong() {
+    DartSdk sdk =
+        builder.findSdk(null, new AnalysisOptionsImpl()..strongMode = true);
+    expect(sdk, isNotNull);
+    Source htmlSource = sdk.mapDartUri('dart:html');
+    expect(
+        htmlSource.fullName,
+        resourceProvider
+            .convertPath('/sdk/lib/html/dart2js/html_dart2js.dart'));
+    expect(htmlSource.exists(), isTrue);
+  }
+
   void test_getAnalysisOptions_default_noOverrides() {
     AnalysisOptionsImpl defaultOptions = new AnalysisOptionsImpl();
-    defaultOptions.enableGenericMethods = true;
-    builder.defaultOptions = defaultOptions;
+    defaultOptions.enableLazyAssignmentOperators = true;
+    builderOptions.defaultOptions = defaultOptions;
     AnalysisOptionsImpl expected = new AnalysisOptionsImpl();
-    expected.enableGenericMethods = true;
-    String path = '/some/directory/path';
-    String filePath = '$path/${AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE}';
+    expected.enableLazyAssignmentOperators = true;
+    String path = resourceProvider.convertPath('/some/directory/path');
+    String filePath =
+        pathContext.join(path, AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE);
     resourceProvider.newFile(
         filePath,
         '''
@@ -494,13 +520,14 @@
 
   void test_getAnalysisOptions_default_overrides() {
     AnalysisOptionsImpl defaultOptions = new AnalysisOptionsImpl();
-    defaultOptions.enableGenericMethods = true;
-    builder.defaultOptions = defaultOptions;
+    defaultOptions.enableLazyAssignmentOperators = true;
+    builderOptions.defaultOptions = defaultOptions;
     AnalysisOptionsImpl expected = new AnalysisOptionsImpl();
     expected.enableSuperMixins = true;
-    expected.enableGenericMethods = true;
-    String path = '/some/directory/path';
-    String filePath = '$path/${AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE}';
+    expected.enableLazyAssignmentOperators = true;
+    String path = resourceProvider.convertPath('/some/directory/path');
+    String filePath =
+        pathContext.join(path, AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE);
     resourceProvider.newFile(
         filePath,
         '''
@@ -529,9 +556,65 @@
     }
   }
 
+  void test_getAnalysisOptions_includes() {
+    AnalysisOptionsImpl defaultOptions = new AnalysisOptionsImpl();
+    builderOptions.defaultOptions = defaultOptions;
+    AnalysisOptionsImpl expected = new AnalysisOptionsImpl();
+    expected.enableSuperMixins = true;
+    resourceProvider.newFile(
+        resourceProvider.convertPath('/mypkgs/somepkg/lib/here.yaml'),
+        '''
+two: {boo: newt}
+''');
+    String path = resourceProvider.convertPath('/some/directory/path');
+    resourceProvider.newFile(
+        pathContext.join(path, '.packages'),
+        '''
+somepkg:../../../mypkgs/somepkg/lib
+''');
+    resourceProvider.newFile(
+        pathContext.join(path, 'bar.yaml'),
+        '''
+include: package:somepkg/here.yaml
+foo: {bar: baz}
+''');
+    String filePath =
+        pathContext.join(path, AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE);
+    resourceProvider.newFile(
+        filePath,
+        '''
+include: bar.yaml
+analyzer:
+  language:
+    enableSuperMixins : true
+''');
+
+    AnalysisEngine engine = AnalysisEngine.instance;
+    OptionsPlugin plugin = engine.optionsPlugin;
+    plugin.registerExtensionPoints((_) {});
+    try {
+      _TestOptionsProcessor processor = new _TestOptionsProcessor();
+      processor.expectedOptions = <String, Object>{
+        'analyzer': {
+          'language': {'enableSuperMixins': true}
+        },
+        'foo': {'bar': 'baz'},
+        'two': {'boo': 'newt'},
+      };
+      (plugin.optionsProcessorExtensionPoint as ExtensionPointImpl)
+          .add(processor);
+      AnalysisContext context = engine.createAnalysisContext();
+      AnalysisOptions options = builder.getAnalysisOptions(context, path);
+      _expectEqualOptions(options, expected);
+    } finally {
+      plugin.registerExtensionPoints((_) {});
+    }
+  }
+
   void test_getAnalysisOptions_invalid() {
-    String path = '/some/directory/path';
-    String filePath = '$path/${AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE}';
+    String path = resourceProvider.convertPath('/some/directory/path');
+    String filePath =
+        pathContext.join(path, AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE);
     resourceProvider.newFile(filePath, ';');
 
     AnalysisEngine engine = AnalysisEngine.instance;
@@ -551,8 +634,9 @@
   }
 
   void test_getAnalysisOptions_noDefault_noOverrides() {
-    String path = '/some/directory/path';
-    String filePath = '$path/${AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE}';
+    String path = resourceProvider.convertPath('/some/directory/path');
+    String filePath =
+        pathContext.join(path, AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE);
     resourceProvider.newFile(
         filePath,
         '''
@@ -569,8 +653,9 @@
   void test_getAnalysisOptions_noDefault_overrides() {
     AnalysisOptionsImpl expected = new AnalysisOptionsImpl();
     expected.enableSuperMixins = true;
-    String path = '/some/directory/path';
-    String filePath = '$path/${AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE}';
+    String path = resourceProvider.convertPath('/some/directory/path');
+    String filePath =
+        pathContext.join(path, AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE);
     resourceProvider.newFile(
         filePath,
         '''
@@ -585,21 +670,21 @@
   }
 
   void test_getOptionsFile_explicit() {
-    String path = '/some/directory/path';
-    String filePath = '/options/analysis.yaml';
+    String path = resourceProvider.convertPath('/some/directory/path');
+    String filePath = resourceProvider.convertPath('/options/analysis.yaml');
     resourceProvider.newFile(filePath, '');
 
-    builder.defaultAnalysisOptionsFilePath = filePath;
+    builderOptions.defaultAnalysisOptionsFilePath = filePath;
     File result = builder.getOptionsFile(path);
     expect(result, isNotNull);
     expect(result.path, filePath);
   }
 
   void test_getOptionsFile_inParentOfRoot_new() {
-    String parentPath = '/some/directory';
-    String path = '$parentPath/path';
+    String parentPath = resourceProvider.convertPath('/some/directory');
+    String path = pathContext.join(parentPath, 'path');
     String filePath =
-        '$parentPath/${AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE}';
+        pathContext.join(parentPath, AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE);
     resourceProvider.newFile(filePath, '');
 
     File result = builder.getOptionsFile(path);
@@ -608,9 +693,10 @@
   }
 
   void test_getOptionsFile_inParentOfRoot_old() {
-    String parentPath = '/some/directory';
-    String path = '$parentPath/path';
-    String filePath = '$parentPath/${AnalysisEngine.ANALYSIS_OPTIONS_FILE}';
+    String parentPath = resourceProvider.convertPath('/some/directory');
+    String path = pathContext.join(parentPath, 'path');
+    String filePath =
+        pathContext.join(parentPath, AnalysisEngine.ANALYSIS_OPTIONS_FILE);
     resourceProvider.newFile(filePath, '');
 
     File result = builder.getOptionsFile(path);
@@ -619,8 +705,9 @@
   }
 
   void test_getOptionsFile_inRoot_new() {
-    String path = '/some/directory/path';
-    String filePath = '$path/${AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE}';
+    String path = resourceProvider.convertPath('/some/directory/path');
+    String filePath =
+        pathContext.join(path, AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE);
     resourceProvider.newFile(filePath, '');
 
     File result = builder.getOptionsFile(path);
@@ -629,8 +716,9 @@
   }
 
   void test_getOptionsFile_inRoot_old() {
-    String path = '/some/directory/path';
-    String filePath = '$path/${AnalysisEngine.ANALYSIS_OPTIONS_FILE}';
+    String path = resourceProvider.convertPath('/some/directory/path');
+    String filePath =
+        pathContext.join(path, AnalysisEngine.ANALYSIS_OPTIONS_FILE);
     resourceProvider.newFile(filePath, '');
 
     File result = builder.getOptionsFile(path);
@@ -643,11 +731,11 @@
     // TODO(brianwilkerson) Consider moving this to AnalysisOptionsImpl.==.
     expect(actual.analyzeFunctionBodiesPredicate,
         same(expected.analyzeFunctionBodiesPredicate));
-    expect(actual.cacheSize, expected.cacheSize);
     expect(actual.dart2jsHint, expected.dart2jsHint);
     expect(actual.enableAssertMessage, expected.enableAssertMessage);
+    expect(actual.enableLazyAssignmentOperators,
+        expected.enableLazyAssignmentOperators);
     expect(actual.enableStrictCallChecks, expected.enableStrictCallChecks);
-    expect(actual.enableGenericMethods, expected.enableGenericMethods);
     expect(actual.enableSuperMixins, expected.enableSuperMixins);
     expect(actual.enableTiming, expected.enableTiming);
     expect(actual.generateImplicitErrors, expected.generateImplicitErrors);
@@ -663,6 +751,7 @@
     expect(actual.implicitCasts, expected.implicitCasts);
     expect(actual.implicitDynamic, expected.implicitDynamic);
     expect(actual.trackCacheDependencies, expected.trackCacheDependencies);
+    expect(actual.disableCacheFlushing, expected.disableCacheFlushing);
     expect(actual.finerGrainedInvalidation, expected.finerGrainedInvalidation);
   }
 
diff --git a/pkg/analyzer/test/src/context/cache_test.dart b/pkg/analyzer/test/src/context/cache_test.dart
index d6af6ce..e91b8d9 100644
--- a/pkg/analyzer/test/src/context/cache_test.dart
+++ b/pkg/analyzer/test/src/context/cache_test.dart
@@ -16,21 +16,21 @@
 import 'package:analyzer/src/generated/utilities_collection.dart';
 import 'package:analyzer/src/task/model.dart';
 import 'package:analyzer/task/model.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:typed_mock/typed_mock.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../generated/test_support.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AnalysisCacheTest);
-  defineReflectiveTests(CacheEntryTest);
-  defineReflectiveTests(CacheFlushManagerTest);
-  defineReflectiveTests(SdkCachePartitionTest);
-  defineReflectiveTests(UniversalCachePartitionTest);
-  defineReflectiveTests(ResultDataTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisCacheTest);
+    defineReflectiveTests(CacheEntryTest);
+    defineReflectiveTests(CacheFlushManagerTest);
+    defineReflectiveTests(SdkCachePartitionTest);
+    defineReflectiveTests(UniversalCachePartitionTest);
+    defineReflectiveTests(ResultDataTest);
+  });
 }
 
 AnalysisCache createCache({AnalysisContext context}) {
@@ -1287,7 +1287,10 @@
 }
 
 class _InternalAnalysisContextMock extends TypedMock
-    implements InternalAnalysisContext {}
+    implements InternalAnalysisContext {
+  @override
+  final AnalysisOptions analysisOptions = new AnalysisOptionsImpl();
+}
 
 /**
  * Keep the given [keepDescriptor], invalidate all the other results.
diff --git a/pkg/analyzer/test/src/context/context_test.dart b/pkg/analyzer/test/src/context/context_test.dart
index 7da5f3f..b9d77b1 100644
--- a/pkg/analyzer/test/src/context/context_test.dart
+++ b/pkg/analyzer/test/src/context/context_test.dart
@@ -31,8 +31,8 @@
 import 'package:analyzer/task/general.dart';
 import 'package:analyzer/task/model.dart';
 import 'package:html/dom.dart' show Document;
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 import 'package:watcher/src/utils.dart';
 
 import '../../generated/engine_test.dart';
@@ -41,9 +41,10 @@
 import 'abstract_context.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AnalysisContextImplTest);
-  defineReflectiveTests(LimitedInvalidateTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisContextImplTest);
+    defineReflectiveTests(LimitedInvalidateTest);
+  });
 }
 
 @reflectiveTest
@@ -319,7 +320,7 @@
   }
 
   void test_applyChanges_changedSource_updateModificationTime() {
-    String path = '/test.dart';
+    String path = resourceProvider.convertPath('/test.dart');
     File file = resourceProvider.newFile(path, 'var V = 1;');
     Source source = file.createSource();
     context.applyChanges(new ChangeSet()..addedSource(source));
@@ -976,15 +977,6 @@
         });
   }
 
-  void test_configurationData() {
-    var key = new ResultDescriptor('test_key', 'TEST_DEFAULT');
-    var testData = ['test', 'data'];
-    context.setConfigurationData(key, testData);
-    expect(context.getConfigurationData(key), testData);
-    var unusedKey = new ResultDescriptor('unused_key', 'UNUSED_DEFAULT');
-    expect(context.getConfigurationData(unusedKey), 'UNUSED_DEFAULT');
-  }
-
   void test_dispose() {
     expect(context.isDisposed, isFalse);
     context.dispose();
@@ -1116,7 +1108,7 @@
     String newCode = r'''
 import 'dart:async';
 ''';
-    String path = '/test.dart';
+    String path = resourceProvider.convertPath('/test.dart');
     Source source = resourceProvider.newFile(path, oldCode).createSource();
     context.applyChanges(new ChangeSet()..addedSource(source));
     context.resolveCompilationUnit2(source, source);
@@ -1142,7 +1134,7 @@
 import 'dart:async';
 main() {}
 ''';
-    String path = '/test.dart';
+    String path = resourceProvider.convertPath('/test.dart');
     Source source = resourceProvider.newFile(path, oldCode).createSource();
     context.applyChanges(new ChangeSet()..addedSource(source));
     context.resolveCompilationUnit2(source, source);
@@ -1162,6 +1154,125 @@
     expect(unit, isNotNull);
   }
 
+  void test_flushSingleResolvedUnit_instanceField() {
+    _checkFlushSingleResolvedUnit('class C { var x = 0; }',
+        (CompilationUnitElement unitElement, String reason) {
+      expect(unitElement.types, hasLength(1), reason: reason);
+      ClassElement cls = unitElement.types[0];
+      expect(cls.fields, hasLength(1), reason: reason);
+      expect(cls.fields[0].type.toString(), 'int', reason: reason);
+      expect(cls.accessors, hasLength(2), reason: reason);
+      expect(cls.accessors[0].isGetter, isTrue, reason: reason);
+      expect(cls.accessors[0].returnType.toString(), 'int', reason: reason);
+      expect(cls.accessors[1].isSetter, isTrue, reason: reason);
+      expect(cls.accessors[1].returnType.toString(), 'void', reason: reason);
+      expect(cls.accessors[1].parameters, hasLength(1), reason: reason);
+      expect(cls.accessors[1].parameters[0].type.toString(), 'int',
+          reason: reason);
+    });
+  }
+
+  void test_flushSingleResolvedUnit_instanceGetter() {
+    _checkFlushSingleResolvedUnit(
+        '''
+abstract class B {
+  int get x;
+}
+class C extends B {
+  get x => null;
+}
+''', (CompilationUnitElement unitElement, String reason) {
+      expect(unitElement.types, hasLength(2), reason: reason);
+      ClassElement cls = unitElement.types[1];
+      expect(cls.name, 'C', reason: reason);
+      expect(cls.accessors, hasLength(1), reason: reason);
+      expect(cls.accessors[0].returnType.toString(), 'int', reason: reason);
+      expect(cls.fields, hasLength(1), reason: reason);
+      expect(cls.fields[0].type.toString(), 'int', reason: reason);
+    });
+  }
+
+  void test_flushSingleResolvedUnit_instanceMethod() {
+    _checkFlushSingleResolvedUnit(
+        '''
+abstract class B {
+  int f(String s);
+}
+class C extends B {
+  f(s) => null;
+}
+''', (CompilationUnitElement unitElement, String reason) {
+      expect(unitElement.types, hasLength(2), reason: reason);
+      ClassElement cls = unitElement.types[1];
+      expect(cls.name, 'C', reason: reason);
+      expect(cls.methods, hasLength(1), reason: reason);
+      expect(cls.methods[0].returnType.toString(), 'int', reason: reason);
+      expect(cls.methods[0].parameters, hasLength(1), reason: reason);
+      expect(cls.methods[0].parameters[0].type.toString(), 'String',
+          reason: reason);
+    });
+  }
+
+  void test_flushSingleResolvedUnit_instanceSetter() {
+    _checkFlushSingleResolvedUnit(
+        '''
+abstract class B {
+  set x(int value);
+}
+class C extends B {
+  set x(value) {}
+}
+''', (CompilationUnitElement unitElement, String reason) {
+      expect(unitElement.types, hasLength(2), reason: reason);
+      ClassElement cls = unitElement.types[1];
+      expect(cls.name, 'C', reason: reason);
+      expect(cls.accessors, hasLength(1), reason: reason);
+      expect(cls.accessors[0].returnType.toString(), 'void', reason: reason);
+      expect(cls.accessors[0].parameters, hasLength(1), reason: reason);
+      expect(cls.accessors[0].parameters[0].type.toString(), 'int',
+          reason: reason);
+      expect(cls.fields, hasLength(1), reason: reason);
+      expect(cls.fields[0].type.toString(), 'int', reason: reason);
+    });
+  }
+
+  void test_flushSingleResolvedUnit_staticField() {
+    _checkFlushSingleResolvedUnit('class C { static var x = 0; }',
+        (CompilationUnitElement unitElement, String reason) {
+      expect(unitElement.types, hasLength(1), reason: reason);
+      ClassElement cls = unitElement.types[0];
+      expect(cls.fields, hasLength(1), reason: reason);
+      expect(cls.fields[0].type.toString(), 'int', reason: reason);
+      expect(cls.accessors, hasLength(2), reason: reason);
+      expect(cls.accessors[0].isGetter, isTrue, reason: reason);
+      expect(cls.accessors[0].returnType.toString(), 'int', reason: reason);
+      expect(cls.accessors[1].isSetter, isTrue, reason: reason);
+      expect(cls.accessors[1].returnType.toString(), 'void', reason: reason);
+      expect(cls.accessors[1].parameters, hasLength(1), reason: reason);
+      expect(cls.accessors[1].parameters[0].type.toString(), 'int',
+          reason: reason);
+    });
+  }
+
+  void test_flushSingleResolvedUnit_topLevelVariable() {
+    _checkFlushSingleResolvedUnit('var x = 0;',
+        (CompilationUnitElement unitElement, String reason) {
+      expect(unitElement.topLevelVariables, hasLength(1), reason: reason);
+      expect(unitElement.topLevelVariables[0].type.toString(), 'int',
+          reason: reason);
+      expect(unitElement.accessors, hasLength(2), reason: reason);
+      expect(unitElement.accessors[0].isGetter, isTrue, reason: reason);
+      expect(unitElement.accessors[0].returnType.toString(), 'int',
+          reason: reason);
+      expect(unitElement.accessors[1].isSetter, isTrue, reason: reason);
+      expect(unitElement.accessors[1].returnType.toString(), 'void',
+          reason: reason);
+      expect(unitElement.accessors[1].parameters, hasLength(1), reason: reason);
+      expect(unitElement.accessors[1].parameters[0].type.toString(), 'int',
+          reason: reason);
+    });
+  }
+
   void test_getAnalysisOptions() {
     expect(context.analysisOptions, isNotNull);
   }
@@ -1751,7 +1862,8 @@
     // 3. Notify the context, and because this is the first time when we
     //    update the content cache, we don't know "originalContents".
     // The source must be invalidated, because it has different contents now.
-    resourceProvider.updateFile('/test.dart', newCode);
+    resourceProvider.updateFile(
+        resourceProvider.convertPath('/test.dart'), newCode);
     contentCache.setContents(source, newCode);
     context.handleContentsChanged(source, null, newCode, true);
     expect(context.getResolvedCompilationUnit2(source, source), isNull);
@@ -1900,7 +2012,7 @@
 
   void test_parseCompilationUnit_nonExistentSource() {
     Source source = newSource('/test.dart');
-    resourceProvider.deleteFile('/test.dart');
+    resourceProvider.deleteFile(resourceProvider.convertPath('/test.dart'));
     try {
       context.parseCompilationUnit(source);
       fail("Expected AnalysisException because file does not exist");
@@ -2358,9 +2470,13 @@
     addSource('/test.dart', 'main() {}');
     _analyzeAll_assertFinished();
     // verify
-    expect(libraryElementUris, contains('file:///test.dart'));
-    expect(parsedUnitUris, contains('file:///test.dart'));
-    expect(resolvedUnitUris, contains('file:///test.dart'));
+    String testUri = resourceProvider
+        .getFile(resourceProvider.convertPath('/test.dart'))
+        .toUri()
+        .toString();
+    expect(libraryElementUris, contains(testUri));
+    expect(parsedUnitUris, contains(testUri));
+    expect(resolvedUnitUris, contains(testUri));
   }
 
   void test_performAnalysisTask_switchPackageVersion() {
@@ -2418,6 +2534,7 @@
   }
 
   void test_resolveCompilationUnit_existingElementModel() {
+    prepareAnalysisContext(new AnalysisOptionsImpl()..strongMode = true);
     Source source = addSource(
         '/test.dart',
         r'''
@@ -2432,6 +2549,11 @@
 
 enum EnumeratedType {Invalid, Valid}
 
+class A {
+  const A(x);
+}
+
+@A(const [(_) => null])
 class ClassOne {
   int instanceField;
   static int staticField;
@@ -2455,6 +2577,13 @@
 class ClassTwo {
   // Implicit no-argument constructor
 }
+
+void topLevelFunctionWithLocalFunction() {
+  void localFunction({bool b: false}) {}
+}
+
+void functionWithGenericFunctionTypedParam/*<S>*/(/*=T*/ pf/*<T>*/(/*=T*/ e)) {}
+void functionWithClosureAsDefaultParam([x = () => null]) {}
 ''');
     context.resolveCompilationUnit2(source, source);
     LibraryElement firstElement = context.computeLibraryElement(source);
@@ -2508,6 +2637,15 @@
     assertNamedElements(importedLibraries, ["dart.core", "libB"]);
   }
 
+  void test_resolveCompilationUnit_library() {
+    Source source = addSource("/lib.dart", "library lib;");
+    LibraryElement library = context.computeLibraryElement(source);
+    CompilationUnit compilationUnit =
+        context.resolveCompilationUnit(source, library);
+    expect(compilationUnit, isNotNull);
+    expect(compilationUnit.element, isNotNull);
+  }
+
 //  void test_resolveCompilationUnit_sourceChangeDuringResolution() {
 //    _context = new _AnalysisContext_sourceChangeDuringResolution();
 //    AnalysisContextFactory.initContextWithCore(_context);
@@ -2519,15 +2657,6 @@
 //    expect(_context.getLineInfo(source), isNotNull);
 //  }
 
-  void test_resolveCompilationUnit_library() {
-    Source source = addSource("/lib.dart", "library lib;");
-    LibraryElement library = context.computeLibraryElement(source);
-    CompilationUnit compilationUnit =
-        context.resolveCompilationUnit(source, library);
-    expect(compilationUnit, isNotNull);
-    expect(compilationUnit.element, isNotNull);
-  }
-
   void test_resolveCompilationUnit_source() {
     Source source = addSource("/lib.dart", "library lib;");
     CompilationUnit compilationUnit =
@@ -2537,12 +2666,10 @@
 
   void test_setAnalysisOptions() {
     AnalysisOptionsImpl options = new AnalysisOptionsImpl();
-    options.cacheSize = 42;
     options.dart2jsHint = false;
     options.hint = false;
     context.analysisOptions = options;
     AnalysisOptions result = context.analysisOptions;
-    expect(result.cacheSize, options.cacheSize);
     expect(result.dart2jsHint, options.dart2jsHint);
     expect(result.hint, options.hint);
   }
@@ -2714,8 +2841,10 @@
 
   void test_validateCacheConsistency_deletedFile() {
     MemoryResourceProvider resourceProvider = new MemoryResourceProvider();
-    var fileA = resourceProvider.newFile('/a.dart', "");
-    var fileB = resourceProvider.newFile('/b.dart', "import 'a.dart';");
+    String pathA = resourceProvider.convertPath('/a.dart');
+    String pathB = resourceProvider.convertPath('/b.dart');
+    var fileA = resourceProvider.newFile(pathA, "");
+    var fileB = resourceProvider.newFile(pathB, "import 'a.dart';");
     Source sourceA = fileA.createSource();
     Source sourceB = fileB.createSource();
     context.applyChanges(
@@ -2723,7 +2852,7 @@
     // analyze everything
     _analyzeAll_assertFinished();
     // delete a.dart
-    resourceProvider.deleteFile('/a.dart');
+    resourceProvider.deleteFile(pathA);
     // analysis should eventually stop
     _analyzeAll_assertFinished();
   }
@@ -2732,7 +2861,6 @@
     int maxCacheSize = 4;
     AnalysisOptionsImpl options =
         new AnalysisOptionsImpl.from(context.analysisOptions);
-    options.cacheSize = maxCacheSize;
     context.analysisOptions = options;
     int sourceCount = maxCacheSize + 2;
     List<Source> sources = <Source>[];
@@ -2809,6 +2937,25 @@
     context.applyChanges(changeSet);
   }
 
+  void _checkFlushSingleResolvedUnit(String code,
+      void validate(CompilationUnitElement unitElement, String reason)) {
+    prepareAnalysisContext(new AnalysisOptionsImpl()..strongMode = true);
+    String path = resourceProvider.convertPath('/test.dart');
+    Source source = resourceProvider.newFile(path, code).createSource();
+    context.applyChanges(new ChangeSet()..addedSource(source));
+    CompilationUnitElement unitElement =
+        context.resolveCompilationUnit2(source, source).element;
+    validate(unitElement, 'initial state');
+    for (ResultDescriptor<CompilationUnit> descriptor
+        in RESOLVED_UNIT_RESULTS) {
+      context.analysisCache.flush(
+          (target, result) => target.source == source && result == descriptor);
+      context.computeResult(
+          new LibrarySpecificUnit(source, source), descriptor);
+      validate(unitElement, 'after flushing $descriptor');
+    }
+  }
+
   /**
    * Search the given compilation unit for a class with the given name. Return the class with the
    * given name, or `null` if the class cannot be found.
@@ -3676,7 +3823,7 @@
 ''');
     _performPendingAnalysisTasks();
     resourceProvider.updateFile(
-        '/a.dart',
+        resourceProvider.convertPath('/a.dart'),
         r'''
 class A2 {}
 class B {}
@@ -5237,7 +5384,10 @@
   @override
   void visitElement(Element element) {
     Element previousElement = previousElements[element];
-    if (!identical(previousElement, element)) {
+    bool ok = _expectedIdentical(element)
+        ? identical(previousElement, element)
+        : previousElement == element;
+    if (!ok) {
       if (overwrittenCount == 0) {
         buffer.writeln();
       }
@@ -5252,6 +5402,23 @@
     }
     super.visitElement(element);
   }
+
+  /**
+   * Return `true` if the given [element] should be the same as the previous
+   * element at the same position in the element model.
+   */
+  static bool _expectedIdentical(Element element) {
+    while (element != null) {
+      if (element is ConstructorElement ||
+          element is MethodElement ||
+          element is FunctionElement &&
+              element.enclosingElement is CompilationUnitElement) {
+        return false;
+      }
+      element = element.enclosingElement;
+    }
+    return true;
+  }
 }
 
 /**
diff --git a/pkg/analyzer/test/src/context/mock_sdk.dart b/pkg/analyzer/test/src/context/mock_sdk.dart
index b864e53..464dec0 100644
--- a/pkg/analyzer/test/src/context/mock_sdk.dart
+++ b/pkg/analyzer/test/src/context/mock_sdk.dart
@@ -20,7 +20,9 @@
   "collection": const LibraryInfo("collection/collection.dart"),
   "convert": const LibraryInfo("convert/convert.dart"),
   "core": const LibraryInfo("core/core.dart"),
-  "html": const LibraryInfo("html/dartium/html_dartium.dart"),
+  "html": const LibraryInfo(
+    "html/dartium/html_dartium.dart",
+    dart2jsPath: "html/dart2js/html_dart2js.dart"),
   "math": const LibraryInfo("math/math.dart"),
   "_foreign_helper": const LibraryInfo("_internal/js_runtime/lib/foreign_helper.dart"),
 };
@@ -265,7 +267,15 @@
 {}
 ''');
 
-const _MockSdkLibrary _LIB_HTML = const _MockSdkLibrary(
+const _MockSdkLibrary _LIB_HTML_DART2JS = const _MockSdkLibrary(
+    'dart:html',
+    '$sdkRoot/lib/html/dart2js/html_dart2js.dart',
+    '''
+library dart.html;
+class HtmlElement {}
+''');
+
+const _MockSdkLibrary _LIB_HTML_DARTIUM = const _MockSdkLibrary(
     'dart:html',
     '$sdkRoot/lib/html/dartium/html_dartium.dart',
     '''
@@ -303,7 +313,8 @@
   _LIB_CONVERT,
   _LIB_FOREIGN_HELPER,
   _LIB_MATH,
-  _LIB_HTML,
+  _LIB_HTML_DART2JS,
+  _LIB_HTML_DARTIUM,
 ];
 
 class MockSdk implements DartSdk {
@@ -339,18 +350,21 @@
    */
   PackageBundle _bundle;
 
-  MockSdk({bool dartAsync: true, resource.ResourceProvider resourceProvider})
+  MockSdk(
+      {bool dartAsync: true, resource.MemoryResourceProvider resourceProvider})
       : provider = resourceProvider ?? new resource.MemoryResourceProvider(),
         sdkLibraries = dartAsync ? _LIBRARIES : [_LIB_CORE],
         uriMap = dartAsync ? FULL_URI_MAP : NO_ASYNC_URI_MAP {
     for (_MockSdkLibrary library in sdkLibraries) {
-      provider.newFile(library.path, library.content);
+      provider.newFile(provider.convertPath(library.path), library.content);
       library.parts.forEach((String path, String content) {
-        provider.newFile(path, content);
+        provider.newFile(provider.convertPath(path), content);
       });
     }
     provider.newFile(
-        '/_internal/sdk_library_metadata/lib/libraries.dart', librariesContent);
+        provider.convertPath(
+            '$sdkRoot/lib/_internal/sdk_library_metadata/lib/libraries.dart'),
+        librariesContent);
   }
 
   @override
@@ -381,7 +395,8 @@
       String libraryPath = library.path;
       if (filePath.replaceAll('\\', '/') == libraryPath) {
         try {
-          resource.File file = provider.getResource(uri.path);
+          resource.File file =
+              provider.getResource(provider.convertPath(filePath));
           Uri dartUri = Uri.parse(library.shortName);
           return file.createSource(dartUri);
         } catch (exception) {
@@ -392,7 +407,8 @@
         String pathInLibrary = filePath.substring(libraryPath.length + 1);
         String path = '${library.shortName}/$pathInLibrary';
         try {
-          resource.File file = provider.getResource(uri.path);
+          resource.File file =
+              provider.getResource(provider.convertPath(filePath));
           Uri dartUri = new Uri(scheme: 'dart', path: path);
           return file.createSource(dartUri);
         } catch (exception) {
@@ -429,11 +445,10 @@
   Source mapDartUri(String dartUri) {
     String path = uriMap[dartUri];
     if (path != null) {
-      resource.File file = provider.getResource(path);
+      resource.File file = provider.getResource(provider.convertPath(path));
       Uri uri = new Uri(scheme: 'dart', path: dartUri.substring(5));
       return file.createSource(uri);
     }
-
     // If we reach here then we tried to use a dartUri that's not in the
     // table above.
     return null;
@@ -447,6 +462,7 @@
     assert(_analysisContext == null);
     String path = FULL_URI_MAP[uri];
     assert(path != null);
+    path = provider.convertPath(path);
     String content = provider.getFile(path).readAsStringSync();
     String newContent = updateContent(content);
     provider.updateFile(path, newContent);
@@ -482,6 +498,9 @@
 
   @override
   bool get isVmLibrary => throw new UnimplementedError();
+
+  @override
+  List<String> getPatches(int platform) => const <String>[];
 }
 
 /**
diff --git a/pkg/analyzer/test/src/context/test_all.dart b/pkg/analyzer/test/src/context/test_all.dart
index d0f1619..ec38b52 100644
--- a/pkg/analyzer/test/src/context/test_all.dart
+++ b/pkg/analyzer/test/src/context/test_all.dart
@@ -4,19 +4,17 @@
 
 library analyzer.test.src.context.test_all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
 import 'builder_test.dart' as builder_test;
 import 'cache_test.dart' as cache_test;
 import 'context_test.dart' as context_test;
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('context tests', () {
+  defineReflectiveSuite(() {
     builder_test.main();
     cache_test.main();
     context_test.main();
-  });
+  }, name: 'context');
 }
diff --git a/pkg/analyzer/test/src/dart/analysis/base.dart b/pkg/analyzer/test/src/dart/analysis/base.dart
new file mode 100644
index 0000000..bb716cf
--- /dev/null
+++ b/pkg/analyzer/test/src/dart/analysis/base.dart
@@ -0,0 +1,164 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+
+import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer/dart/element/visitor.dart';
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/file_system/memory_file_system.dart';
+import 'package:analyzer/source/package_map_resolver.dart';
+import 'package:analyzer/src/dart/analysis/byte_store.dart';
+import 'package:analyzer/src/dart/analysis/driver.dart';
+import 'package:analyzer/src/dart/analysis/file_state.dart';
+import 'package:analyzer/src/dart/analysis/status.dart';
+import 'package:analyzer/src/generated/engine.dart' show AnalysisOptionsImpl;
+import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
+
+import '../../context/mock_sdk.dart';
+
+/**
+ * Finds an [Element] with the given [name].
+ */
+Element findChildElement(Element root, String name, [ElementKind kind]) {
+  Element result = null;
+  root.accept(new _ElementVisitorFunctionWrapper((Element element) {
+    if (element.name != name) {
+      return;
+    }
+    if (kind != null && element.kind != kind) {
+      return;
+    }
+    result = element;
+  }));
+  return result;
+}
+
+typedef bool Predicate<E>(E argument);
+
+/**
+ * A function to be called for every [Element].
+ */
+typedef void _ElementVisitorFunction(Element element);
+
+class BaseAnalysisDriverTest {
+  static final MockSdk sdk = new MockSdk();
+
+  final MemoryResourceProvider provider = new MemoryResourceProvider();
+  final ByteStore byteStore = new MemoryByteStore();
+  final FileContentOverlay contentOverlay = new FileContentOverlay();
+
+  final StringBuffer logBuffer = new StringBuffer();
+  PerformanceLog logger;
+
+  AnalysisDriverScheduler scheduler;
+  AnalysisDriver driver;
+  final _Monitor idleStatusMonitor = new _Monitor();
+  final List<AnalysisStatus> allStatuses = <AnalysisStatus>[];
+  final List<AnalysisResult> allResults = <AnalysisResult>[];
+
+  String testProject;
+  String testFile;
+  String testCode;
+
+  void addTestFile(String content, {bool priority: false}) {
+    testCode = content;
+    provider.newFile(testFile, content);
+    driver.addFile(testFile);
+    if (priority) {
+      driver.priorityFiles = [testFile];
+    }
+  }
+
+  int findOffset(String search) {
+    int offset = testCode.indexOf(search);
+    if (offset < 0) {
+      fail("Did not find '$search' in\n$testCode");
+    }
+    return offset;
+  }
+
+  int getLeadingIdentifierLength(String search) {
+    int length = 0;
+    while (length < search.length) {
+      int c = search.codeUnitAt(length);
+      if (c >= 'a'.codeUnitAt(0) && c <= 'z'.codeUnitAt(0)) {
+        length++;
+        continue;
+      }
+      if (c >= 'A'.codeUnitAt(0) && c <= 'Z'.codeUnitAt(0)) {
+        length++;
+        continue;
+      }
+      if (c >= '0'.codeUnitAt(0) && c <= '9'.codeUnitAt(0)) {
+        length++;
+        continue;
+      }
+      break;
+    }
+    return length;
+  }
+
+  void setUp() {
+    new MockSdk();
+    testProject = _p('/test/lib');
+    testFile = _p('/test/lib/test.dart');
+    logger = new PerformanceLog(logBuffer);
+    scheduler = new AnalysisDriverScheduler(logger);
+    driver = new AnalysisDriver(
+        scheduler,
+        logger,
+        provider,
+        byteStore,
+        contentOverlay,
+        new SourceFactory([
+          new DartUriResolver(sdk),
+          new PackageMapUriResolver(provider, <String, List<Folder>>{
+            'test': [provider.getFolder(testProject)]
+          }),
+          new ResourceUriResolver(provider)
+        ], null, provider),
+        new AnalysisOptionsImpl()..strongMode = true);
+    scheduler.start();
+    driver.status.lastWhere((status) {
+      allStatuses.add(status);
+      if (status.isIdle) {
+        idleStatusMonitor.notify();
+      }
+    });
+    driver.results.listen(allResults.add);
+  }
+
+  String _p(String path) => provider.convertPath(path);
+}
+
+/**
+ * Wraps an [_ElementVisitorFunction] into a [GeneralizingElementVisitor].
+ */
+class _ElementVisitorFunctionWrapper extends GeneralizingElementVisitor {
+  final _ElementVisitorFunction function;
+
+  _ElementVisitorFunctionWrapper(this.function);
+
+  visitElement(Element element) {
+    function(element);
+    super.visitElement(element);
+  }
+}
+
+class _Monitor {
+  Completer<Null> _completer = new Completer<Null>();
+
+  Future<Null> get signal async {
+    await _completer.future;
+    _completer = new Completer<Null>();
+  }
+
+  void notify() {
+    if (!_completer.isCompleted) {
+      _completer.complete(null);
+    }
+  }
+}
diff --git a/pkg/analyzer/test/src/dart/analysis/byte_store_test.dart b/pkg/analyzer/test/src/dart/analysis/byte_store_test.dart
new file mode 100644
index 0000000..9da3f0b
--- /dev/null
+++ b/pkg/analyzer/test/src/dart/analysis/byte_store_test.dart
@@ -0,0 +1,108 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:analyzer/src/dart/analysis/byte_store.dart';
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+import 'package:typed_mock/typed_mock.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(MemoryCachingByteStoreTest);
+  });
+}
+
+@reflectiveTest
+class MemoryCachingByteStoreTest {
+  test_get_notFound_evict() {
+    var store = new _TestByteStore();
+    var cachingStore = new MemoryCachingByteStore(store, 100);
+
+    // Request '1'.  Nothing found.
+    cachingStore.get('1');
+
+    // Add enough data to the store to force an eviction.
+    cachingStore.put('2', _b(40));
+    cachingStore.put('3', _b(40));
+    cachingStore.put('4', _b(40));
+  }
+
+  test_get_notFound_retry() {
+    var mockStore = new _TestByteStore();
+    var baseStore = new MemoryCachingByteStore(mockStore, 1000);
+    var cachingStore = new MemoryCachingByteStore(baseStore, 100);
+
+    // Request '1'.  Nothing found.
+    expect(cachingStore.get('1'), isNull);
+
+    // Add data to the base store, bypassing the caching store.
+    baseStore.put('1', _b(40));
+
+    // Request '1' again.  The previous `null` result should not have been
+    // cached.
+    expect(cachingStore.get('1'), isNotNull);
+  }
+
+  test_get_put_evict() {
+    var store = new _TestByteStore();
+    var cachingStore = new MemoryCachingByteStore(store, 100);
+
+    // Keys: [1, 2].
+    cachingStore.put('1', _b(40));
+    cachingStore.put('2', _b(50));
+
+    // Request '1', so now it is the most recently used.
+    // Keys: [2, 1].
+    cachingStore.get('1');
+
+    // 40 + 50 + 30 > 100
+    // So, '2' is evicted.
+    cachingStore.put('3', _b(30));
+    expect(cachingStore.get('1'), hasLength(40));
+    expect(cachingStore.get('2'), isNull);
+    expect(cachingStore.get('3'), hasLength(30));
+  }
+
+  test_put_evict_first() {
+    var store = new _TestByteStore();
+    var cachingStore = new MemoryCachingByteStore(store, 100);
+
+    // 40 + 50 < 100
+    cachingStore.put('1', _b(40));
+    cachingStore.put('2', _b(50));
+    expect(cachingStore.get('1'), hasLength(40));
+    expect(cachingStore.get('2'), hasLength(50));
+
+    // 40 + 50 + 30 > 100
+    // So, '1' is evicted.
+    cachingStore.put('3', _b(30));
+    expect(cachingStore.get('1'), isNull);
+    expect(cachingStore.get('2'), hasLength(50));
+    expect(cachingStore.get('3'), hasLength(30));
+  }
+
+  test_put_evict_firstAndSecond() {
+    var store = new _TestByteStore();
+    var cachingStore = new MemoryCachingByteStore(store, 100);
+
+    // 10 + 80 < 100
+    cachingStore.put('1', _b(10));
+    cachingStore.put('2', _b(80));
+    expect(cachingStore.get('1'), hasLength(10));
+    expect(cachingStore.get('2'), hasLength(80));
+
+    // 10 + 80 + 30 > 100
+    // So, '1' and '2' are evicted.
+    cachingStore.put('3', _b(30));
+    expect(cachingStore.get('1'), isNull);
+    expect(cachingStore.get('2'), isNull);
+    expect(cachingStore.get('3'), hasLength(30));
+  }
+
+  static List<int> _b(int length) {
+    return new List<int>(length);
+  }
+}
+
+class _TestByteStore extends TypedMock implements ByteStore {}
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
new file mode 100644
index 0000000..6b4231e
--- /dev/null
+++ b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
@@ -0,0 +1,1235 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 analyzer.test.driver;
+
+import 'dart:async';
+import 'dart:convert';
+
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer/error/error.dart';
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/file_system/memory_file_system.dart';
+import 'package:analyzer/src/dart/analysis/byte_store.dart';
+import 'package:analyzer/src/dart/analysis/driver.dart';
+import 'package:analyzer/src/dart/analysis/file_state.dart';
+import 'package:analyzer/src/dart/analysis/status.dart';
+import 'package:analyzer/src/error/codes.dart';
+import 'package:analyzer/src/generated/engine.dart' show AnalysisOptionsImpl;
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/summary/idl.dart';
+import 'package:convert/convert.dart';
+import 'package:crypto/crypto.dart';
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import '../../context/mock_sdk.dart';
+import 'base.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisDriverTest);
+    defineReflectiveTests(AnalysisDriverSchedulerTest);
+  });
+}
+
+/**
+ * Returns a [Future] that completes after pumping the event queue [times]
+ * times. By default, this should pump the event queue enough times to allow
+ * any code to run, as long as it's not waiting on some external event.
+ */
+Future pumpEventQueue([int times = 5000]) {
+  if (times == 0) return new Future.value();
+  // We use a delayed future to allow microtask events to finish. The
+  // Future.value or Future() constructors use scheduleMicrotask themselves and
+  // would therefore not wait for microtask callbacks that are scheduled after
+  // invoking this method.
+  return new Future.delayed(Duration.ZERO, () => pumpEventQueue(times - 1));
+}
+
+@reflectiveTest
+class AnalysisDriverSchedulerTest {
+  static final MockSdk sdk = new MockSdk();
+
+  final MemoryResourceProvider provider = new MemoryResourceProvider();
+  final ByteStore byteStore = new MemoryByteStore();
+  final FileContentOverlay contentOverlay = new FileContentOverlay();
+
+  final StringBuffer logBuffer = new StringBuffer();
+  PerformanceLog logger;
+
+  AnalysisDriverScheduler scheduler;
+
+  List<AnalysisResult> allResults = [];
+
+  AnalysisDriver newDriver() {
+    AnalysisDriver driver = new AnalysisDriver(
+        scheduler,
+        logger,
+        provider,
+        byteStore,
+        contentOverlay,
+        new SourceFactory(
+            [new DartUriResolver(sdk), new ResourceUriResolver(provider)],
+            null,
+            provider),
+        new AnalysisOptionsImpl()..strongMode = true);
+    driver.results.forEach(allResults.add);
+    return driver;
+  }
+
+  void setUp() {
+    logger = new PerformanceLog(logBuffer);
+    scheduler = new AnalysisDriverScheduler(logger);
+    scheduler.start();
+  }
+
+  test_priorities_getResult_beforePriority() async {
+    AnalysisDriver driver1 = newDriver();
+    AnalysisDriver driver2 = newDriver();
+
+    String a = _p('/a.dart');
+    String b = _p('/b.dart');
+    String c = _p('/c.dart');
+    provider.newFile(a, 'class A {}');
+    provider.newFile(b, 'class B {}');
+    provider.newFile(c, 'class C {}');
+    driver1.addFile(a);
+    driver2.addFile(b);
+    driver2.addFile(c);
+    driver1.priorityFiles = [a];
+    driver2.priorityFiles = [a];
+
+    AnalysisResult result = await driver2.getResult(b);
+    expect(result.path, b);
+
+    await driver1.status.firstWhere((status) => status.isIdle);
+    await driver2.status.firstWhere((status) => status.isIdle);
+
+    expect(allResults, hasLength(3));
+    expect(allResults[0].path, b);
+    expect(allResults[1].path, a);
+    expect(allResults[2].path, c);
+  }
+
+  test_priorities_priorityBeforeGeneral1() async {
+    AnalysisDriver driver1 = newDriver();
+    AnalysisDriver driver2 = newDriver();
+
+    String a = _p('/a.dart');
+    String b = _p('/b.dart');
+    provider.newFile(a, 'class A {}');
+    provider.newFile(b, 'class B {}');
+    driver1.addFile(a);
+    driver2.addFile(b);
+    driver1.priorityFiles = [a];
+    driver2.priorityFiles = [a];
+
+    await driver1.status.firstWhere((status) => status.isIdle);
+    await driver2.status.firstWhere((status) => status.isIdle);
+
+    expect(allResults, hasLength(2));
+    expect(allResults[0].path, a);
+    expect(allResults[1].path, b);
+  }
+
+  test_priorities_priorityBeforeGeneral2() async {
+    AnalysisDriver driver1 = newDriver();
+    AnalysisDriver driver2 = newDriver();
+
+    String a = _p('/a.dart');
+    String b = _p('/b.dart');
+    provider.newFile(a, 'class A {}');
+    provider.newFile(b, 'class B {}');
+    driver1.addFile(a);
+    driver2.addFile(b);
+    driver1.priorityFiles = [b];
+    driver2.priorityFiles = [b];
+
+    await driver1.status.firstWhere((status) => status.isIdle);
+    await driver2.status.firstWhere((status) => status.isIdle);
+
+    expect(allResults, hasLength(2));
+    expect(allResults[0].path, b);
+    expect(allResults[1].path, a);
+  }
+
+  test_priorities_priorityBeforeGeneral3() async {
+    AnalysisDriver driver1 = newDriver();
+    AnalysisDriver driver2 = newDriver();
+
+    String a = _p('/a.dart');
+    String b = _p('/b.dart');
+    String c = _p('/c.dart');
+    provider.newFile(a, 'class A {}');
+    provider.newFile(b, 'class B {}');
+    provider.newFile(c, 'class C {}');
+    driver1.addFile(a);
+    driver1.addFile(b);
+    driver2.addFile(c);
+    driver1.priorityFiles = [a, c];
+    driver2.priorityFiles = [a, c];
+
+    await driver1.status.firstWhere((status) => status.isIdle);
+    await driver2.status.firstWhere((status) => status.isIdle);
+
+    expect(allResults, hasLength(3));
+    expect(allResults[0].path, a);
+    expect(allResults[1].path, c);
+    expect(allResults[2].path, b);
+  }
+
+  test_status() async {
+    AnalysisDriver driver1 = newDriver();
+    AnalysisDriver driver2 = newDriver();
+
+    String a = _p('/a.dart');
+    String b = _p('/b.dart');
+    String c = _p('/c.dart');
+    provider.newFile(a, 'class A {}');
+    provider.newFile(b, 'class B {}');
+    provider.newFile(c, 'class C {}');
+    driver1.addFile(a);
+    driver2.addFile(b);
+    driver2.addFile(c);
+
+    Monitor idleStatusMonitor = new Monitor();
+    List<AnalysisStatus> allStatuses = [];
+    scheduler.status.forEach((status) {
+      allStatuses.add(status);
+      if (status.isIdle) {
+        idleStatusMonitor.notify();
+      }
+    });
+
+    await idleStatusMonitor.signal;
+
+    expect(allStatuses, hasLength(2));
+    expect(allStatuses[0].isAnalyzing, isTrue);
+    expect(allStatuses[1].isAnalyzing, isFalse);
+
+    expect(allResults, hasLength(3));
+  }
+
+  String _p(String path) => provider.convertPath(path);
+}
+
+@reflectiveTest
+class AnalysisDriverTest extends BaseAnalysisDriverTest {
+  test_addedFiles() async {
+    var a = _p('/test/lib/a.dart');
+    var b = _p('/test/lib/b.dart');
+
+    driver.addFile(a);
+    expect(driver.addedFiles, contains(a));
+    expect(driver.addedFiles, isNot(contains(b)));
+
+    driver.removeFile(a);
+    expect(driver.addedFiles, isNot(contains(a)));
+    expect(driver.addedFiles, isNot(contains(b)));
+  }
+
+  test_addFile_thenRemove() async {
+    var a = _p('/test/lib/a.dart');
+    var b = _p('/test/lib/b.dart');
+    provider.newFile(a, 'class A {}');
+    provider.newFile(b, 'class B {}');
+    driver.addFile(a);
+    driver.addFile(b);
+
+    // Now remove 'a'.
+    driver.removeFile(a);
+
+    await _waitForIdle();
+
+    // Only 'b' has been analyzed, because 'a' was removed before we started.
+    expect(allResults, hasLength(1));
+    expect(allResults[0].path, b);
+  }
+
+  test_changeFile_implicitlyAnalyzed() async {
+    var a = _p('/test/lib/a.dart');
+    var b = _p('/test/lib/b.dart');
+    provider.newFile(
+        a,
+        r'''
+import 'b.dart';
+var A = B;
+''');
+    provider.newFile(b, 'var B = 1;');
+
+    driver.priorityFiles = [a];
+    driver.addFile(a);
+
+    // We have a result only for "a".
+    await _waitForIdle();
+    expect(allResults, hasLength(1));
+    {
+      AnalysisResult ar = allResults.firstWhere((r) => r.path == a);
+      expect(_getTopLevelVarType(ar.unit, 'A'), 'int');
+    }
+    allResults.clear();
+
+    // Change "b" and notify.
+    provider.updateFile(b, 'var B = 1.2;');
+    driver.changeFile(b);
+
+    // While "b" is not analyzed explicitly, it is analyzed implicitly.
+    // The change causes "a" to be reanalyzed.
+    await _waitForIdle();
+    expect(allResults, hasLength(1));
+    {
+      AnalysisResult ar = allResults.firstWhere((r) => r.path == a);
+      expect(_getTopLevelVarType(ar.unit, 'A'), 'double');
+    }
+  }
+
+  test_changeFile_selfConsistent() async {
+    var a = _p('/test/lib/a.dart');
+    var b = _p('/test/lib/b.dart');
+    provider.newFile(
+        a,
+        r'''
+import 'b.dart';
+var A1 = 1;
+var A2 = B1;
+''');
+    provider.newFile(
+        b,
+        r'''
+import 'a.dart';
+var B1 = A1;
+''');
+
+    driver.priorityFiles = [a, b];
+    driver.addFile(a);
+    driver.addFile(b);
+    await _waitForIdle();
+
+    // We have results for both "a" and "b".
+    expect(allResults, hasLength(2));
+    {
+      AnalysisResult ar = allResults.firstWhere((r) => r.path == a);
+      expect(_getTopLevelVarType(ar.unit, 'A1'), 'int');
+      expect(_getTopLevelVarType(ar.unit, 'A2'), 'int');
+    }
+    {
+      AnalysisResult br = allResults.firstWhere((r) => r.path == b);
+      expect(_getTopLevelVarType(br.unit, 'B1'), 'int');
+    }
+
+    // Clear the results and update "a".
+    allResults.clear();
+    provider.updateFile(
+        a,
+        r'''
+import 'b.dart';
+var A1 = 1.2;
+var A2 = B1;
+''');
+    driver.changeFile(a);
+
+    // We again get results for both "a" and "b".
+    // The results are consistent.
+    await _waitForIdle();
+    expect(allResults, hasLength(2));
+    {
+      AnalysisResult ar = allResults.firstWhere((r) => r.path == a);
+      expect(_getTopLevelVarType(ar.unit, 'A1'), 'double');
+      expect(_getTopLevelVarType(ar.unit, 'A2'), 'double');
+    }
+    {
+      AnalysisResult br = allResults.firstWhere((r) => r.path == b);
+      expect(_getTopLevelVarType(br.unit, 'B1'), 'double');
+    }
+  }
+
+  test_changeFile_single() async {
+    addTestFile('var V = 1;', priority: true);
+
+    // Initial analysis.
+    {
+      await _waitForIdle();
+      expect(allResults, hasLength(1));
+      AnalysisResult result = allResults[0];
+      expect(result.path, testFile);
+      expect(_getTopLevelVarType(result.unit, 'V'), 'int');
+    }
+
+    // Update the file, but don't notify the driver.
+    allResults.clear();
+    provider.updateFile(testFile, 'var V = 1.2');
+
+    // No new results.
+    await pumpEventQueue();
+    expect(allResults, isEmpty);
+
+    // Notify the driver about the change.
+    driver.changeFile(testFile);
+
+    // We get a new result.
+    {
+      await _waitForIdle();
+      expect(allResults, hasLength(1));
+      AnalysisResult result = allResults[0];
+      expect(result.path, testFile);
+      expect(_getTopLevelVarType(result.unit, 'V'), 'double');
+    }
+  }
+
+  test_getFilesReferencingName() async {
+    var a = _p('/test/bin/a.dart');
+    var b = _p('/test/bin/b.dart');
+    var c = _p('/test/bin/c.dart');
+    var d = _p('/test/bin/d.dart');
+    var e = _p('/test/bin/e.dart');
+
+    provider.newFile(a, 'class A {}');
+    provider.newFile(b, "import 'a.dart'; A a;");
+    provider.newFile(c, "import 'a.dart'; var a = new A();");
+    provider.newFile(d, "classs A{} A a;");
+    provider.newFile(e, "import 'a.dart'; main() {}");
+
+    driver.addFile(a);
+    driver.addFile(b);
+    driver.addFile(c);
+    driver.addFile(d);
+    driver.addFile(e);
+
+    // 'b.dart' references an external 'A'.
+    // 'c.dart' references an external 'A'.
+    // 'd.dart' references the local 'A'.
+    // 'e.dart' does not reference 'A' at all.
+    List<String> files = await driver.getFilesReferencingName('A');
+    expect(files, unorderedEquals([b, c]));
+
+    // We get the same results second time.
+    List<String> files2 = await driver.getFilesReferencingName('A');
+    expect(files2, unorderedEquals([b, c]));
+  }
+
+  test_getIndex() async {
+    String content = r'''
+foo(int p) {}
+main() {
+  foo(42);
+}
+''';
+    addTestFile(content);
+
+    IndexResult result = await driver.getIndex(testFile);
+
+    CompilationUnitElement unitElement = result.unitElement;
+    expect(unitElement, isNotNull);
+    expect(unitElement.source.fullName, testFile);
+    expect(unitElement.functions.map((c) => c.name),
+        unorderedEquals(['foo', 'main']));
+
+    AnalysisDriverUnitIndex index = result.index;
+    int unitId = index.strings.indexOf('package:test/test.dart');
+    int fooId = index.strings.indexOf('foo');
+    expect(unitId, isNonNegative);
+    expect(fooId, isNonNegative);
+  }
+
+  test_getResult() async {
+    String content = 'int f() => 42;';
+    addTestFile(content, priority: true);
+
+    AnalysisResult result = await driver.getResult(testFile);
+    expect(result.path, testFile);
+    expect(result.uri.toString(), 'package:test/test.dart');
+    expect(result.content, content);
+    expect(result.contentHash, _md5(content));
+    expect(result.unit, isNotNull);
+    expect(result.errors, hasLength(0));
+
+    var f = result.unit.declarations[0] as FunctionDeclaration;
+    expect(f.name.staticType.toString(), '() → int');
+    expect(f.returnType.type.toString(), 'int');
+
+    // The same result is also received through the stream.
+    await _waitForIdle();
+    expect(allResults, [result]);
+  }
+
+  test_getResult_constants_defaultParameterValue_localFunction() async {
+    var a = _p('/test/bin/a.dart');
+    var b = _p('/test/bin/b.dart');
+    provider.newFile(a, 'const C = 42;');
+    provider.newFile(
+        b,
+        r'''
+import 'a.dart';
+main() {
+  foo({int p: C}) {}
+  foo();
+}
+''');
+    driver.addFile(a);
+    driver.addFile(b);
+    await _waitForIdle();
+
+    AnalysisResult result = await driver.getResult(b);
+    expect(result.errors, isEmpty);
+  }
+
+  test_getResult_errors() async {
+    String content = 'main() { int vv; }';
+    addTestFile(content, priority: true);
+
+    AnalysisResult result = await driver.getResult(testFile);
+    expect(result.path, testFile);
+    expect(result.errors, hasLength(1));
+    {
+      AnalysisError error = result.errors[0];
+      expect(error.offset, 13);
+      expect(error.length, 2);
+      expect(error.errorCode, HintCode.UNUSED_LOCAL_VARIABLE);
+      expect(error.message, "The value of the local variable 'vv' isn't used.");
+      expect(error.correction, "Try removing the variable, or using it.");
+    }
+  }
+
+  test_getResult_inferTypes_finalField() async {
+    addTestFile(
+        r'''
+class C {
+  final f = 42;
+}
+''',
+        priority: true);
+    await _waitForIdle();
+
+    AnalysisResult result = await driver.getResult(testFile);
+    expect(_getClassFieldType(result.unit, 'C', 'f'), 'int');
+  }
+
+  test_getResult_inferTypes_instanceMethod() async {
+    addTestFile(
+        r'''
+class A {
+  int m(double p) => 1;
+}
+class B extends A {
+  m(double p) => 2;
+}
+''',
+        priority: true);
+    await _waitForIdle();
+
+    AnalysisResult result = await driver.getResult(testFile);
+    expect(_getClassMethodReturnType(result.unit, 'A', 'm'), 'int');
+    expect(_getClassMethodReturnType(result.unit, 'B', 'm'), 'int');
+  }
+
+  test_getResult_invalidUri_exports_dart() async {
+    String content = r'''
+export 'dart:async';
+export 'dart:noSuchLib';
+export 'dart:math';
+''';
+    addTestFile(content, priority: true);
+
+    AnalysisResult result = await driver.getResult(testFile);
+    expect(result.path, testFile);
+    // Has only exports for valid URIs.
+    List<ExportElement> imports = result.unit.element.library.exports;
+    expect(
+        imports.map((import) => import.exportedLibrary.source.uri.toString()),
+        unorderedEquals(['dart:async', 'dart:math']));
+  }
+
+  test_getResult_invalidUri_imports_dart() async {
+    String content = r'''
+import 'dart:async';
+import 'dart:noSuchLib';
+import 'dart:math';
+''';
+    addTestFile(content, priority: true);
+
+    AnalysisResult result = await driver.getResult(testFile);
+    expect(result.path, testFile);
+    // Has only imports for valid URIs.
+    List<ImportElement> imports = result.unit.element.library.imports;
+    expect(
+        imports.map((import) => import.importedLibrary.source.uri.toString()),
+        unorderedEquals(['dart:async', 'dart:math', 'dart:core']));
+  }
+
+  test_getResult_mix_fileAndPackageUris() async {
+    var a = _p('/test/bin/a.dart');
+    var b = _p('/test/bin/b.dart');
+    var c = _p('/test/lib/c.dart');
+    var d = _p('/test/test/d.dart');
+    provider.newFile(
+        a,
+        r'''
+import 'package:test/c.dart';
+int x = y;
+''');
+    provider.newFile(
+        b,
+        r'''
+import '../lib/c.dart';
+int x = y;
+''');
+    provider.newFile(
+        c,
+        r'''
+import '../test/d.dart';
+var y = z;
+''');
+    provider.newFile(
+        d,
+        r'''
+String z = "string";
+''');
+
+    // Analysis of my_pkg/bin/a.dart produces no error because
+    // file:///my_pkg/bin/a.dart imports package:my_pkg/c.dart, and
+    // package:my_pkg/c.dart's import is erroneous, causing y's reference to z
+    // to be unresolved (and therefore have type dynamic).
+    {
+      AnalysisResult result = await driver.getResult(a);
+      expect(result.errors, isEmpty);
+    }
+
+    // Analysis of my_pkg/bin/b.dart produces the error "A value of type
+    // 'String' can't be assigned to a variable of type 'int'", because
+    // file:///my_pkg/bin/b.dart imports file:///my_pkg/lib/c.dart, which
+    // successfully imports file:///my_pkg/test/d.dart, causing y to have an
+    // inferred type of String.
+    {
+      AnalysisResult result = await driver.getResult(b);
+      List<AnalysisError> errors = result.errors;
+      expect(errors, hasLength(1));
+      expect(errors[0].errorCode, StaticTypeWarningCode.INVALID_ASSIGNMENT);
+    }
+  }
+
+  test_getResult_notDartFile() async {
+    var path = _p('/test/lib/test.txt');
+    provider.newFile(path, 'foo bar');
+
+    AnalysisResult result = await driver.getResult(path);
+    expect(result, isNull);
+  }
+
+  test_getResult_sameFile_twoUris() async {
+    var a = _p('/test/lib/a.dart');
+    var b = _p('/test/lib/b.dart');
+    var c = _p('/test/test/c.dart');
+    provider.newFile(a, 'class A<T> {}');
+    provider.newFile(
+        b,
+        r'''
+import 'a.dart';
+var VB = new A<int>();
+''');
+    provider.newFile(
+        c,
+        r'''
+import '../lib/a.dart';
+var VC = new A<double>();
+''');
+
+    driver.addFile(a);
+    driver.addFile(b);
+    await _waitForIdle();
+
+    {
+      AnalysisResult result = await driver.getResult(b);
+      expect(_getImportSource(result.unit, 0).uri.toString(),
+          'package:test/a.dart');
+      expect(_getTopLevelVarType(result.unit, 'VB'), 'A<int>');
+    }
+
+    {
+      AnalysisResult result = await driver.getResult(c);
+      expect(_getImportSource(result.unit, 0).uri,
+          provider.pathContext.toUri(_p('/test/lib/a.dart')));
+      expect(_getTopLevelVarType(result.unit, 'VC'), 'A<double>');
+    }
+  }
+
+  test_getResult_selfConsistent() async {
+    var a = _p('/test/lib/a.dart');
+    var b = _p('/test/lib/b.dart');
+    provider.newFile(
+        a,
+        r'''
+import 'b.dart';
+var A1 = 1;
+var A2 = B1;
+''');
+    provider.newFile(
+        b,
+        r'''
+import 'a.dart';
+var B1 = A1;
+''');
+
+    driver.addFile(a);
+    driver.addFile(b);
+    await _waitForIdle();
+
+    {
+      AnalysisResult result = await driver.getResult(a);
+      expect(_getTopLevelVarType(result.unit, 'A1'), 'int');
+      expect(_getTopLevelVarType(result.unit, 'A2'), 'int');
+    }
+
+    // Update "a" so that "A1" is now "double".
+    // Get result for "a".
+    //
+    // Even though we have not notified the driver about the change,
+    // we still get "double" for "A1", because getResult() re-read the content.
+    //
+    // We also get "double" for "A2", even though "A2" has the type from "b".
+    // That's because we check for "a" API signature consistency, and because
+    // it has changed, we invalidated the dependency cache, relinked libraries
+    // and recomputed types.
+    provider.updateFile(
+        a,
+        r'''
+import 'b.dart';
+var A1 = 1.2;
+var A2 = B1;
+''');
+    {
+      AnalysisResult result = await driver.getResult(a);
+      expect(_getTopLevelVarType(result.unit, 'A1'), 'double');
+      expect(_getTopLevelVarType(result.unit, 'A2'), 'double');
+    }
+  }
+
+  test_getResult_thenRemove() async {
+    addTestFile('main() {}', priority: true);
+
+    Future<AnalysisResult> resultFuture = driver.getResult(testFile);
+    driver.removeFile(testFile);
+
+    AnalysisResult result = await resultFuture;
+    expect(result, isNotNull);
+    expect(result.path, testFile);
+    expect(result.unit, isNotNull);
+  }
+
+  test_getResult_twoPendingFutures() async {
+    String content = 'main() {}';
+    addTestFile(content, priority: true);
+
+    Future<AnalysisResult> future1 = driver.getResult(testFile);
+    Future<AnalysisResult> future2 = driver.getResult(testFile);
+
+    // Both futures complete, with the same result.
+    AnalysisResult result1 = await future1;
+    AnalysisResult result2 = await future2;
+    expect(result2, same(result1));
+    expect(result1.path, testFile);
+    expect(result1.unit, isNotNull);
+  }
+
+  test_knownFiles() async {
+    var a = _p('/test/lib/a.dart');
+    var b = _p('/test/lib/b.dart');
+
+    provider.newFile(
+        a,
+        r'''
+import 'b.dart';
+''');
+
+    driver.addFile(a);
+    await _waitForIdle();
+
+    expect(driver.knownFiles, contains(a));
+    expect(driver.knownFiles, contains(b));
+
+    driver.removeFile(a);
+
+    // a.dart was removed, but we don't clean up the file state state yet.
+    expect(driver.knownFiles, contains(a));
+    expect(driver.knownFiles, contains(b));
+  }
+
+  test_part_getResult_afterLibrary() async {
+    var a = _p('/test/lib/a.dart');
+    var b = _p('/test/lib/b.dart');
+    var c = _p('/test/lib/c.dart');
+    provider.newFile(
+        a,
+        r'''
+library a;
+import 'b.dart';
+part 'c.dart';
+class A {}
+var c = new C();
+''');
+    provider.newFile(b, 'class B {}');
+    provider.newFile(
+        c,
+        r'''
+part of a;
+class C {}
+var a = new A();
+var b = new B();
+''');
+
+    driver.addFile(a);
+    driver.addFile(b);
+    driver.addFile(c);
+
+    // Process a.dart so that we know that it's a library for c.dart later.
+    {
+      AnalysisResult result = await driver.getResult(a);
+      expect(result.errors, isEmpty);
+      expect(_getTopLevelVarType(result.unit, 'c'), 'C');
+    }
+
+    // Now c.dart can be resolved without errors in the context of a.dart
+    {
+      AnalysisResult result = await driver.getResult(c);
+      expect(result.errors, isEmpty);
+      expect(_getTopLevelVarType(result.unit, 'a'), 'A');
+      expect(_getTopLevelVarType(result.unit, 'b'), 'B');
+    }
+  }
+
+  test_part_getResult_beforeLibrary() async {
+    var a = _p('/test/lib/a.dart');
+    var b = _p('/test/lib/b.dart');
+    var c = _p('/test/lib/c.dart');
+    provider.newFile(
+        a,
+        r'''
+library a;
+import 'b.dart';
+part 'c.dart';
+class A {}
+var c = new C();
+''');
+    provider.newFile(b, 'class B {}');
+    provider.newFile(
+        c,
+        r'''
+part of a;
+class C {}
+var a = new A();
+var b = new B();
+''');
+
+    driver.addFile(a);
+    driver.addFile(b);
+    driver.addFile(c);
+
+    // b.dart will be analyzed after a.dart is analyzed.
+    // So, A and B references are resolved.
+    AnalysisResult result = await driver.getResult(c);
+    expect(result.errors, isEmpty);
+    expect(_getTopLevelVarType(result.unit, 'a'), 'A');
+    expect(_getTopLevelVarType(result.unit, 'b'), 'B');
+  }
+
+  test_part_getResult_noLibrary() async {
+    var c = _p('/test/lib/c.dart');
+    provider.newFile(
+        c,
+        r'''
+part of a;
+class C {}
+var a = new A();
+var b = new B();
+''');
+
+    driver.addFile(c);
+
+    // There is no library which c.dart is a part of, so it has unresolved
+    // A and B references.
+    AnalysisResult result = await driver.getResult(c);
+    expect(result.errors, isNotEmpty);
+    expect(result.unit, isNotNull);
+  }
+
+  test_part_results_afterLibrary() async {
+    var a = _p('/test/lib/a.dart');
+    var b = _p('/test/lib/b.dart');
+    var c = _p('/test/lib/c.dart');
+    provider.newFile(
+        a,
+        r'''
+library a;
+import 'b.dart';
+part 'c.dart';
+class A {}
+var c = new C();
+''');
+    provider.newFile(b, 'class B {}');
+    provider.newFile(
+        c,
+        r'''
+part of a;
+class C {}
+var a = new A();
+var b = new B();
+''');
+
+    // The order is important for creating the test case.
+    driver.addFile(a);
+    driver.addFile(b);
+    driver.addFile(c);
+
+    {
+      await _waitForIdle();
+
+      // c.dart was added after a.dart, so it is analyzed after a.dart,
+      // so we know that a.dart is the library of c.dart, so no errors.
+      AnalysisResult result = allResults.lastWhere((r) => r.path == c);
+      expect(result.errors, isEmpty);
+      expect(result.unit, isNull);
+    }
+
+    // Update a.dart so that c.dart is not a part.
+    {
+      provider.updateFile(a, '// does not use c.dart anymore');
+      driver.changeFile(a);
+      await _waitForIdle();
+
+      // Now c.dart does not have a library context, so A and B cannot be
+      // resolved, so there are errors.
+      AnalysisResult result = allResults.lastWhere((r) => r.path == c);
+      expect(result.errors, isNotEmpty);
+      expect(result.unit, isNull);
+    }
+  }
+
+  test_part_results_beforeLibrary() async {
+    var a = _p('/test/lib/a.dart');
+    var b = _p('/test/lib/b.dart');
+    var c = _p('/test/lib/c.dart');
+    provider.newFile(
+        a,
+        r'''
+library a;
+import 'b.dart';
+part 'c.dart';
+class A {}
+var c = new C();
+''');
+    provider.newFile(b, 'class B {}');
+    provider.newFile(
+        c,
+        r'''
+part of a;
+class C {}
+var a = new A();
+var b = new B();
+''');
+
+    // The order is important for creating the test case.
+    driver.addFile(c);
+    driver.addFile(a);
+    driver.addFile(b);
+
+    await _waitForIdle();
+
+    // c.dart was added before a.dart, so we attempt to analyze it before
+    // a.dart, but we cannot find the library for it, so we delay analysis
+    // until all other files are analyzed, including a.dart, after which we
+    // analyze the delayed parts.
+    AnalysisResult result = allResults.lastWhere((r) => r.path == c);
+    expect(result.errors, isEmpty);
+    expect(result.unit, isNull);
+  }
+
+  test_part_results_noLibrary() async {
+    var c = _p('/test/lib/c.dart');
+    provider.newFile(
+        c,
+        r'''
+part of a;
+class C {}
+var a = new A();
+var b = new B();
+''');
+
+    driver.addFile(c);
+
+    await _waitForIdle();
+
+    // There is no library which c.dart is a part of, so it has unresolved
+    // A and B references.
+    AnalysisResult result = allResults.lastWhere((r) => r.path == c);
+    expect(result.errors, isNotEmpty);
+    expect(result.unit, isNull);
+  }
+
+  test_part_results_priority_beforeLibrary() async {
+    var a = _p('/test/lib/a.dart');
+    var b = _p('/test/lib/b.dart');
+    var c = _p('/test/lib/c.dart');
+    provider.newFile(
+        a,
+        r'''
+library a;
+import 'b.dart';
+part 'c.dart';
+class A {}
+var c = new C();
+''');
+    provider.newFile(b, 'class B {}');
+    provider.newFile(
+        c,
+        r'''
+part of a;
+class C {}
+var a = new A();
+var b = new B();
+''');
+
+    // The order is important for creating the test case.
+    driver.priorityFiles = [c];
+    driver.addFile(c);
+    driver.addFile(a);
+    driver.addFile(b);
+
+    await _waitForIdle();
+
+    // c.dart was added before a.dart, so we attempt to analyze it before
+    // a.dart, but we cannot find the library for it, so we delay analysis
+    // until all other files are analyzed, including a.dart, after which we
+    // analyze the delayed parts.
+    AnalysisResult result = allResults.lastWhere((r) => r.path == c);
+    expect(result.errors, isEmpty);
+    expect(result.unit, isNotNull);
+  }
+
+  test_removeFile_changeFile_implicitlyAnalyzed() async {
+    var a = _p('/test/lib/a.dart');
+    var b = _p('/test/lib/b.dart');
+    provider.newFile(
+        a,
+        r'''
+import 'b.dart';
+var A = B;
+''');
+    provider.newFile(b, 'var B = 1;');
+
+    driver.priorityFiles = [a, b];
+    driver.addFile(a);
+    driver.addFile(b);
+
+    // We have results for both "a" and "b".
+    await _waitForIdle();
+    expect(allResults, hasLength(2));
+    {
+      AnalysisResult ar = allResults.firstWhere((r) => r.path == a);
+      expect(_getTopLevelVarType(ar.unit, 'A'), 'int');
+    }
+    {
+      AnalysisResult br = allResults.firstWhere((r) => r.path == b);
+      expect(_getTopLevelVarType(br.unit, 'B'), 'int');
+    }
+    allResults.clear();
+
+    // Remove "b" and send the change notification.
+    provider.updateFile(b, 'var B = 1.2;');
+    driver.removeFile(b);
+    driver.changeFile(b);
+
+    // While "b" is not analyzed explicitly, it is analyzed implicitly.
+    // We don't get a result for "b".
+    // But the change causes "a" to be reanalyzed.
+    await _waitForIdle();
+    expect(allResults, hasLength(1));
+    {
+      AnalysisResult ar = allResults.firstWhere((r) => r.path == a);
+      expect(_getTopLevelVarType(ar.unit, 'A'), 'double');
+    }
+  }
+
+  test_removeFile_changeFile_notAnalyzed() async {
+    addTestFile('main() {}');
+
+    // We have a result.
+    await _waitForIdle();
+    expect(allResults, hasLength(1));
+    expect(allResults[0].path, testFile);
+    allResults.clear();
+
+    // Remove the file and send the change notification.
+    // The change notification does nothing, because the file is explicitly
+    // or implicitly analyzed.
+    driver.removeFile(testFile);
+    driver.changeFile(testFile);
+
+    await _waitForIdle();
+    expect(allResults, isEmpty);
+  }
+
+  test_results_priority() async {
+    String content = 'int f() => 42;';
+    addTestFile(content, priority: true);
+
+    await _waitForIdle();
+
+    expect(allResults, hasLength(1));
+    AnalysisResult result = allResults.single;
+    expect(result.path, testFile);
+    expect(result.uri.toString(), 'package:test/test.dart');
+    expect(result.content, content);
+    expect(result.contentHash, _md5(content));
+    expect(result.unit, isNotNull);
+    expect(result.errors, hasLength(0));
+
+    var f = result.unit.declarations[0] as FunctionDeclaration;
+    expect(f.name.staticType.toString(), '() → int');
+    expect(f.returnType.type.toString(), 'int');
+  }
+
+  test_results_priorityFirst() async {
+    var a = _p('/test/lib/a.dart');
+    var b = _p('/test/lib/b.dart');
+    var c = _p('/test/lib/c.dart');
+    provider.newFile(a, 'class A {}');
+    provider.newFile(b, 'class B {}');
+    provider.newFile(c, 'class C {}');
+
+    driver.addFile(a);
+    driver.addFile(b);
+    driver.addFile(c);
+    driver.priorityFiles = [b];
+    await _waitForIdle();
+
+    expect(allResults, hasLength(3));
+    AnalysisResult result = allResults[0];
+    expect(result.path, b);
+    expect(result.unit, isNotNull);
+    expect(result.errors, hasLength(0));
+  }
+
+  test_results_regular() async {
+    String content = 'int f() => 42;';
+    addTestFile(content);
+    await _waitForIdle();
+
+    expect(allResults, hasLength(1));
+    AnalysisResult result = allResults.single;
+    expect(result.path, testFile);
+    expect(result.uri.toString(), 'package:test/test.dart');
+    expect(result.content, isNull);
+    expect(result.contentHash, _md5(content));
+    expect(result.unit, isNull);
+    expect(result.errors, hasLength(0));
+  }
+
+  test_results_status() async {
+    addTestFile('int f() => 42;');
+    await _waitForIdle();
+
+    expect(allStatuses, hasLength(2));
+    expect(allStatuses[0].isAnalyzing, isTrue);
+    expect(allStatuses[0].isIdle, isFalse);
+    expect(allStatuses[1].isAnalyzing, isFalse);
+    expect(allStatuses[1].isIdle, isTrue);
+  }
+
+  ClassDeclaration _getClass(CompilationUnit unit, String name) {
+    for (CompilationUnitMember declaration in unit.declarations) {
+      if (declaration is ClassDeclaration) {
+        if (declaration.name.name == name) {
+          return declaration;
+        }
+      }
+    }
+    fail('Cannot find the class $name in\n$unit');
+    return null;
+  }
+
+  VariableDeclaration _getClassField(
+      CompilationUnit unit, String className, String fieldName) {
+    ClassDeclaration classDeclaration = _getClass(unit, className);
+    for (ClassMember declaration in classDeclaration.members) {
+      if (declaration is FieldDeclaration) {
+        for (var field in declaration.fields.variables) {
+          if (field.name.name == fieldName) {
+            return field;
+          }
+        }
+      }
+    }
+    fail('Cannot find the field $fieldName in the class $className in\n$unit');
+    return null;
+  }
+
+  String _getClassFieldType(
+      CompilationUnit unit, String className, String fieldName) {
+    return _getClassField(unit, className, fieldName).element.type.toString();
+  }
+
+  MethodDeclaration _getClassMethod(
+      CompilationUnit unit, String className, String methodName) {
+    ClassDeclaration classDeclaration = _getClass(unit, className);
+    for (ClassMember declaration in classDeclaration.members) {
+      if (declaration is MethodDeclaration &&
+          declaration.name.name == methodName) {
+        return declaration;
+      }
+    }
+    fail('Cannot find the method $methodName in the class $className in\n'
+        '$unit');
+    return null;
+  }
+
+  String _getClassMethodReturnType(
+      CompilationUnit unit, String className, String fieldName) {
+    return _getClassMethod(unit, className, fieldName)
+        .element
+        .type
+        .returnType
+        .toString();
+  }
+
+  ImportElement _getImportElement(CompilationUnit unit, int directiveIndex) {
+    var import = unit.directives[directiveIndex] as ImportDirective;
+    return import.element as ImportElement;
+  }
+
+  Source _getImportSource(CompilationUnit unit, int directiveIndex) {
+    return _getImportElement(unit, directiveIndex).importedLibrary.source;
+  }
+
+  VariableDeclaration _getTopLevelVar(CompilationUnit unit, String name) {
+    for (CompilationUnitMember declaration in unit.declarations) {
+      if (declaration is TopLevelVariableDeclaration) {
+        for (VariableDeclaration variable in declaration.variables.variables) {
+          if (variable.name.name == name) {
+            return variable;
+          }
+        }
+      }
+    }
+    fail('Cannot find the top-level variable $name in\n$unit');
+    return null;
+  }
+
+  String _getTopLevelVarType(CompilationUnit unit, String name) {
+    return _getTopLevelVar(unit, name).element.type.toString();
+  }
+
+  /**
+   * Return the [provider] specific path for the given Posix [path].
+   */
+  String _p(String path) => provider.convertPath(path);
+
+  Future<Null> _waitForIdle() async {
+    await idleStatusMonitor.signal;
+  }
+
+  static String _md5(String content) {
+    return hex.encode(md5.convert(UTF8.encode(content)).bytes);
+  }
+}
diff --git a/pkg/analyzer/test/src/dart/analysis/file_state_test.dart b/pkg/analyzer/test/src/dart/analysis/file_state_test.dart
new file mode 100644
index 0000000..a97f9c3
--- /dev/null
+++ b/pkg/analyzer/test/src/dart/analysis/file_state_test.dart
@@ -0,0 +1,416 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:convert';
+import 'dart:typed_data';
+
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/file_system/memory_file_system.dart';
+import 'package:analyzer/source/package_map_resolver.dart';
+import 'package:analyzer/src/dart/analysis/byte_store.dart';
+import 'package:analyzer/src/dart/analysis/driver.dart' show PerformanceLog;
+import 'package:analyzer/src/dart/analysis/file_state.dart';
+import 'package:analyzer/src/generated/engine.dart'
+    show AnalysisOptions, AnalysisOptionsImpl;
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/util/fast_uri.dart';
+import 'package:convert/convert.dart';
+import 'package:crypto/crypto.dart';
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import '../../context/mock_sdk.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(FileSystemStateTest);
+  });
+}
+
+@reflectiveTest
+class FileSystemStateTest {
+  static final MockSdk sdk = new MockSdk();
+
+  final MemoryResourceProvider provider = new MemoryResourceProvider();
+  final ByteStore byteStore = new MemoryByteStore();
+  final FileContentOverlay contentOverlay = new FileContentOverlay();
+
+  final StringBuffer logBuffer = new StringBuffer();
+  PerformanceLog logger;
+
+  FileSystemState fileSystemState;
+
+  void setUp() {
+    logger = new PerformanceLog(logBuffer);
+    SourceFactory sourceFactory = new SourceFactory([
+      new DartUriResolver(sdk),
+      new PackageMapUriResolver(provider, <String, List<Folder>>{
+        'aaa': [provider.getFolder(_p('/aaa/lib'))],
+        'bbb': [provider.getFolder(_p('/bbb/lib'))],
+      }),
+      new ResourceUriResolver(provider)
+    ], null, provider);
+    AnalysisOptions analysisOptions = new AnalysisOptionsImpl()
+      ..strongMode = true;
+    fileSystemState = new FileSystemState(logger, byteStore, contentOverlay,
+        provider, sourceFactory, analysisOptions, new Uint32List(0), '');
+  }
+
+  test_getFileForPath_doesNotExist() {
+    String path = _p('/aaa/lib/a.dart');
+    FileState file = fileSystemState.getFileForPath(path);
+    expect(file.path, path);
+    expect(file.uri, FastUri.parse('package:aaa/a.dart'));
+    expect(file.content, '');
+    expect(file.contentHash, _md5(''));
+    expect(file.importedFiles, isEmpty);
+    expect(file.exportedFiles, isEmpty);
+    expect(file.partedFiles, isEmpty);
+    expect(file.directReferencedFiles, isEmpty);
+    expect(file.isPart, isFalse);
+    expect(file.library, isNull);
+    expect(file.unlinked, isNotNull);
+    expect(file.unlinked.classes, isEmpty);
+  }
+
+  test_getFileForPath_library() {
+    String a1 = _p('/aaa/lib/a1.dart');
+    String a2 = _p('/aaa/lib/a2.dart');
+    String a3 = _p('/aaa/lib/a3.dart');
+    String a4 = _p('/aaa/lib/a4.dart');
+    String b1 = _p('/bbb/lib/b1.dart');
+    String b2 = _p('/bbb/lib/b2.dart');
+    String content_a1 = r'''
+import 'package:aaa/a2.dart';
+import 'package:bbb/b1.dart';
+export 'package:bbb/b2.dart';
+export 'package:aaa/a3.dart';
+part 'a4.dart';
+
+class A1 {}
+''';
+    provider.newFile(a1, content_a1);
+
+    FileState file = fileSystemState.getFileForPath(a1);
+    expect(file.path, a1);
+    expect(file.content, content_a1);
+    expect(file.contentHash, _md5(content_a1));
+
+    expect(file.isPart, isFalse);
+    expect(file.library, isNull);
+    expect(file.unlinked, isNotNull);
+    expect(file.unlinked.classes, hasLength(1));
+    expect(file.unlinked.classes[0].name, 'A1');
+
+    expect(file.importedFiles, hasLength(2));
+    expect(file.importedFiles[0].path, a2);
+    expect(file.importedFiles[0].uri, FastUri.parse('package:aaa/a2.dart'));
+    expect(file.importedFiles[0].source, isNotNull);
+    expect(file.importedFiles[1].path, b1);
+    expect(file.importedFiles[1].uri, FastUri.parse('package:bbb/b1.dart'));
+    expect(file.importedFiles[1].source, isNotNull);
+
+    expect(file.exportedFiles, hasLength(2));
+    expect(file.exportedFiles[0].path, b2);
+    expect(file.exportedFiles[0].uri, FastUri.parse('package:bbb/b2.dart'));
+    expect(file.exportedFiles[0].source, isNotNull);
+    expect(file.exportedFiles[1].path, a3);
+    expect(file.exportedFiles[1].uri, FastUri.parse('package:aaa/a3.dart'));
+    expect(file.exportedFiles[1].source, isNotNull);
+
+    expect(file.partedFiles, hasLength(1));
+    expect(file.partedFiles[0].path, a4);
+    expect(file.partedFiles[0].uri, FastUri.parse('package:aaa/a4.dart'));
+
+    expect(file.directReferencedFiles, hasLength(5));
+
+    expect(fileSystemState.getFilesForPath(a1), [file]);
+  }
+
+  test_getFileForPath_part() {
+    String a1 = _p('/aaa/lib/a1.dart');
+    String a2 = _p('/aaa/lib/a2.dart');
+    provider.newFile(
+        a1,
+        r'''
+library a1;
+part 'a2.dart';
+''');
+    provider.newFile(
+        a2,
+        r'''
+part of a1;
+class A2 {}
+''');
+
+    FileState file_a2 = fileSystemState.getFileForPath(a2);
+    expect(file_a2.path, a2);
+    expect(file_a2.uri, FastUri.parse('package:aaa/a2.dart'));
+
+    expect(file_a2.unlinked, isNotNull);
+    expect(file_a2.unlinked.classes, hasLength(1));
+    expect(file_a2.unlinked.classes[0].name, 'A2');
+
+    expect(file_a2.importedFiles, isEmpty);
+    expect(file_a2.exportedFiles, isEmpty);
+    expect(file_a2.partedFiles, isEmpty);
+    expect(file_a2.directReferencedFiles, isEmpty);
+
+    // The library is not known yet.
+    expect(file_a2.isPart, isTrue);
+    expect(file_a2.library, isNull);
+
+    // Ask for the library.
+    FileState file_a1 = fileSystemState.getFileForPath(a1);
+    expect(file_a1.partedFiles, hasLength(1));
+    expect(file_a1.partedFiles[0], same(file_a2));
+    expect(file_a1.directReferencedFiles, unorderedEquals([file_a2]));
+
+    // Now the part knows its library.
+    expect(file_a2.library, same(file_a1));
+
+    // Now update the library, and refresh its file.
+    // The 'a2.dart' is not referenced anymore.
+    // So the part file does not have the library anymore.
+    provider.newFile(
+        a1,
+        r'''
+library a1;
+part 'not-a2.dart';
+''');
+    file_a1.refresh();
+    expect(file_a2.library, isNull);
+  }
+
+  test_getFileForPath_samePath() {
+    String path = _p('/aaa/lib/a.dart');
+    FileState file1 = fileSystemState.getFileForPath(path);
+    FileState file2 = fileSystemState.getFileForPath(path);
+    expect(file2, same(file1));
+  }
+
+  test_getFileForUri_packageVsFileUri() {
+    String path = _p('/aaa/lib/a.dart');
+    var packageUri = FastUri.parse('package:aaa/a.dart');
+    var fileUri = provider.pathContext.toUri(path);
+
+    // The files with `package:` and `file:` URIs are different.
+    FileState filePackageUri = fileSystemState.getFileForUri(packageUri);
+    FileState fileFileUri = fileSystemState.getFileForUri(fileUri);
+    expect(filePackageUri, isNot(same(fileFileUri)));
+
+    expect(filePackageUri.path, path);
+    expect(filePackageUri.uri, packageUri);
+
+    expect(fileFileUri.path, path);
+    expect(fileFileUri.uri, fileUri);
+
+    // The file with the `package:` style URI is canonical, and is the first.
+    var files = fileSystemState.getFilesForPath(path);
+    expect(files, [filePackageUri, fileFileUri]);
+  }
+
+  test_referencedNames() {
+    String path = _p('/aaa/lib/a.dart');
+    provider.newFile(
+        path,
+        r'''
+A foo(B p) {
+  foo(null);
+  C c = new C(p);
+  return c;
+}
+''');
+    FileState file = fileSystemState.getFileForPath(path);
+    expect(file.referencedNames, unorderedEquals(['A', 'B', 'C']));
+  }
+
+  test_refresh_differentApiSignature() {
+    String path = _p('/aaa/lib/a.dart');
+    provider.newFile(
+        path,
+        r'''
+class A {}
+''');
+    FileState file = fileSystemState.getFileForPath(path);
+    expect(file.unlinked.classes[0].name, 'A');
+    List<int> signature = file.apiSignature;
+
+    // Update the resource and refresh the file state.
+    provider.newFile(
+        path,
+        r'''
+class B {}
+''');
+    bool apiSignatureChanged = file.refresh();
+    expect(apiSignatureChanged, isTrue);
+
+    expect(file.unlinked.classes[0].name, 'B');
+    expect(file.apiSignature, isNot(signature));
+  }
+
+  test_refresh_sameApiSignature() {
+    String path = _p('/aaa/lib/a.dart');
+    provider.newFile(
+        path,
+        r'''
+class C {
+  foo() {
+    print(111);
+  }
+}
+''');
+    FileState file = fileSystemState.getFileForPath(path);
+    List<int> signature = file.apiSignature;
+
+    // Update the resource and refresh the file state.
+    provider.newFile(
+        path,
+        r'''
+class C {
+  foo() {
+    print(222);
+  }
+}
+''');
+    bool apiSignatureChanged = file.refresh();
+    expect(apiSignatureChanged, isFalse);
+
+    expect(file.apiSignature, signature);
+  }
+
+  test_transitiveFiles() {
+    String pa = _p('/aaa/lib/a.dart');
+    String pb = _p('/aaa/lib/b.dart');
+    String pc = _p('/aaa/lib/c.dart');
+    String pd = _p('/aaa/lib/d.dart');
+
+    FileState fa = fileSystemState.getFileForPath(pa);
+    FileState fb = fileSystemState.getFileForPath(pb);
+    FileState fc = fileSystemState.getFileForPath(pc);
+    FileState fd = fileSystemState.getFileForPath(pd);
+
+    // Compute transitive closures for all files.
+    fa.transitiveFiles;
+    fb.transitiveFiles;
+    fc.transitiveFiles;
+    fd.transitiveFiles;
+    expect(fileSystemState.test.filesWithoutTransitiveFiles, isEmpty);
+
+    // No imports, so just a single file.
+    provider.newFile(pa, "");
+    _assertTransitiveFiles(fa, [fa]);
+
+    // Import b.dart into a.dart, two files now.
+    provider.newFile(pa, "import 'b.dart';");
+    fa.refresh();
+    _assertFilesWithoutTransitiveFiles([fa]);
+    _assertTransitiveFiles(fa, [fa, fb]);
+
+    // Update b.dart so that it imports c.dart now.
+    provider.newFile(pb, "import 'c.dart';");
+    fb.refresh();
+    _assertFilesWithoutTransitiveFiles([fa, fb]);
+    _assertTransitiveFiles(fa, [fa, fb, fc]);
+    _assertTransitiveFiles(fb, [fb, fc]);
+    _assertFilesWithoutTransitiveFiles([]);
+
+    // Update b.dart so that it exports d.dart instead.
+    provider.newFile(pb, "export 'd.dart';");
+    fb.refresh();
+    _assertFilesWithoutTransitiveFiles([fa, fb]);
+    _assertTransitiveFiles(fa, [fa, fb, fd]);
+    _assertTransitiveFiles(fb, [fb, fd]);
+    _assertFilesWithoutTransitiveFiles([]);
+
+    // Update a.dart so that it does not import b.dart anymore.
+    provider.newFile(pa, "");
+    fa.refresh();
+    _assertFilesWithoutTransitiveFiles([fa]);
+    _assertTransitiveFiles(fa, [fa]);
+  }
+
+  test_transitiveFiles_cycle() {
+    String pa = _p('/aaa/lib/a.dart');
+    String pb = _p('/aaa/lib/b.dart');
+
+    provider.newFile(pa, "import 'b.dart';");
+    provider.newFile(pb, "import 'a.dart';");
+
+    FileState fa = fileSystemState.getFileForPath(pa);
+    FileState fb = fileSystemState.getFileForPath(pb);
+
+    // Compute transitive closures for all files.
+    fa.transitiveFiles;
+    fb.transitiveFiles;
+    _assertFilesWithoutTransitiveFiles([]);
+
+    // It's a cycle.
+    _assertTransitiveFiles(fa, [fa, fb]);
+    _assertTransitiveFiles(fb, [fa, fb]);
+
+    // Update a.dart so that it does not import b.dart anymore.
+    provider.newFile(pa, "");
+    fa.refresh();
+    _assertFilesWithoutTransitiveFiles([fa, fb]);
+    _assertTransitiveFiles(fa, [fa]);
+    _assertTransitiveFiles(fb, [fa, fb]);
+  }
+
+  test_transitiveSignature() {
+    String pa = _p('/aaa/lib/a.dart');
+    String pb = _p('/aaa/lib/b.dart');
+    String pc = _p('/aaa/lib/c.dart');
+    String pd = _p('/aaa/lib/d.dart');
+
+    provider.newFile(pa, "class A {}");
+    provider.newFile(pb, "import 'a.dart';");
+    provider.newFile(pc, "import 'b.dart';");
+    provider.newFile(pd, "class D {}");
+
+    FileState fa = fileSystemState.getFileForPath(pa);
+    FileState fb = fileSystemState.getFileForPath(pb);
+    FileState fc = fileSystemState.getFileForPath(pc);
+    FileState fd = fileSystemState.getFileForPath(pd);
+
+    // Compute transitive closures for all files.
+    expect(fa.transitiveSignature, isNotNull);
+    expect(fb.transitiveSignature, isNotNull);
+    expect(fc.transitiveSignature, isNotNull);
+    expect(fd.transitiveSignature, isNotNull);
+    expect(fileSystemState.test.filesWithoutTransitiveFiles, isEmpty);
+
+    // Make an update to a.dart that does not change its API signature.
+    // All transitive signatures are still valid.
+    provider.newFile(pa, "class A {} // the same API signature");
+    fa.refresh();
+    expect(fileSystemState.test.filesWithoutTransitiveFiles, isEmpty);
+
+    // Change a.dart API signature, also flush signatures of b.dart and c.dart,
+    // but d.dart is still OK.
+    provider.newFile(pa, "class A2 {}");
+    fa.refresh();
+    _assertFilesWithoutTransitiveSignatures([fa, fb, fc]);
+  }
+
+  void _assertFilesWithoutTransitiveFiles(List<FileState> expected) {
+    var actual = fileSystemState.test.filesWithoutTransitiveFiles;
+    expect(actual, unorderedEquals(expected));
+  }
+
+  void _assertFilesWithoutTransitiveSignatures(List<FileState> expected) {
+    var actual = fileSystemState.test.filesWithoutTransitiveSignature;
+    expect(actual, unorderedEquals(expected));
+  }
+
+  void _assertTransitiveFiles(FileState file, List<FileState> expected) {
+    expect(file.transitiveFiles, unorderedEquals(expected));
+  }
+
+  String _p(String path) => provider.convertPath(path);
+
+  static String _md5(String content) {
+    return hex.encode(md5.convert(UTF8.encode(content)).bytes);
+  }
+}
diff --git a/pkg/analyzer/test/src/dart/analysis/index_test.dart b/pkg/analyzer/test/src/dart/analysis/index_test.dart
new file mode 100644
index 0000000..51fb995
--- /dev/null
+++ b/pkg/analyzer/test/src/dart/analysis/index_test.dart
@@ -0,0 +1,1252 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:convert';
+
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer/src/dart/analysis/driver.dart';
+import 'package:analyzer/src/dart/analysis/index.dart';
+import 'package:analyzer/src/summary/format.dart';
+import 'package:analyzer/src/summary/idl.dart';
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'base.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(IndexTest);
+  });
+}
+
+class ExpectedLocation {
+  final CompilationUnitElement unitElement;
+  final int offset;
+  final int length;
+  final bool isQualified;
+
+  ExpectedLocation(
+      this.unitElement, this.offset, this.length, this.isQualified);
+
+  @override
+  String toString() {
+    return '(unit=$unitElement; offset=$offset; length=$length;'
+        ' isQualified=$isQualified)';
+  }
+}
+
+@reflectiveTest
+class IndexTest extends BaseAnalysisDriverTest {
+  CompilationUnit testUnit;
+  CompilationUnitElement testUnitElement;
+  LibraryElement testLibraryElement;
+
+  AnalysisDriverUnitIndex index;
+
+  _ElementIndexAssert assertThat(Element element) {
+    List<_Relation> relations = _getElementRelations(element);
+    return new _ElementIndexAssert(this, element, relations);
+  }
+
+  _NameIndexAssert assertThatName(String name) {
+    return new _NameIndexAssert(this, name);
+  }
+
+  Element findElement(String name, [ElementKind kind]) {
+    return findChildElement(testUnitElement, name, kind);
+  }
+
+  CompilationUnitElement importedUnit({int index: 0}) {
+    List<ImportElement> imports = testLibraryElement.imports;
+    return imports[index].importedLibrary.definingCompilationUnit;
+  }
+
+  test_hasAncestor_ClassDeclaration() async {
+    await _indexTestUnit('''
+class A {}
+class B1 extends A {}
+class B2 implements A {}
+class C1 extends B1 {}
+class C2 extends B2 {}
+class C3 implements B1 {}
+class C4 implements B2 {}
+class M extends Object with A {}
+''');
+    ClassElement classElementA = findElement("A");
+    assertThat(classElementA)
+      ..isAncestorOf('B1 extends A')
+      ..isAncestorOf('B2 implements A')
+      ..isAncestorOf('C1 extends B1')
+      ..isAncestorOf('C2 extends B2')
+      ..isAncestorOf('C3 implements B1')
+      ..isAncestorOf('C4 implements B2')
+      ..isAncestorOf('M extends Object with A');
+  }
+
+  test_hasAncestor_ClassTypeAlias() async {
+    await _indexTestUnit('''
+class A {}
+class B extends A {}
+class C1 = Object with A;
+class C2 = Object with B;
+''');
+    ClassElement classElementA = findElement('A');
+    ClassElement classElementB = findElement('B');
+    assertThat(classElementA)
+      ..isAncestorOf('C1 = Object with A')
+      ..isAncestorOf('C2 = Object with B');
+    assertThat(classElementB)..isAncestorOf('C2 = Object with B');
+  }
+
+  test_isExtendedBy_ClassDeclaration() async {
+    await _indexTestUnit('''
+class A {} // 1
+class B extends A {} // 2
+''');
+    ClassElement elementA = findElement('A');
+    assertThat(elementA)
+      ..isExtendedAt('A {} // 2', false)
+      ..isReferencedAt('A {} // 2', false);
+  }
+
+  test_isExtendedBy_ClassDeclaration_isQualified() async {
+    provider.newFile(
+        _p('$testProject/lib.dart'),
+        '''
+class A {}
+''');
+    await _indexTestUnit('''
+import 'lib.dart' as p;
+class B extends p.A {} // 2
+''');
+    ClassElement elementA = importedUnit().getType('A');
+    assertThat(elementA).isExtendedAt('A {} // 2', true);
+  }
+
+  test_isExtendedBy_ClassDeclaration_Object() async {
+    await _indexTestUnit('''
+class A {}
+''');
+    ClassElement elementA = findElement('A');
+    ClassElement elementObject = elementA.supertype.element;
+    assertThat(elementObject).isExtendedAt('A {}', true, length: 0);
+  }
+
+  test_isExtendedBy_ClassTypeAlias() async {
+    await _indexTestUnit('''
+class A {}
+class B {}
+class C = A with B;
+''');
+    ClassElement elementA = findElement('A');
+    assertThat(elementA)
+      ..isExtendedAt('A with', false)
+      ..isReferencedAt('A with', false);
+  }
+
+  test_isExtendedBy_ClassTypeAlias_isQualified() async {
+    provider.newFile(
+        _p('$testProject/lib.dart'),
+        '''
+class A {}
+''');
+    await _indexTestUnit('''
+import 'lib.dart' as p;
+class B {}
+class C = p.A with B;
+''');
+    ClassElement elementA = importedUnit().getType('A');
+    assertThat(elementA)
+      ..isExtendedAt('A with', true)
+      ..isReferencedAt('A with', true);
+  }
+
+  test_isImplementedBy_ClassDeclaration() async {
+    await _indexTestUnit('''
+class A {} // 1
+class B implements A {} // 2
+''');
+    ClassElement elementA = findElement('A');
+    assertThat(elementA)
+      ..isImplementedAt('A {} // 2', false)
+      ..isReferencedAt('A {} // 2', false);
+  }
+
+  test_isImplementedBy_ClassDeclaration_isQualified() async {
+    provider.newFile(
+        _p('$testProject/lib.dart'),
+        '''
+class A {}
+''');
+    await _indexTestUnit('''
+import 'lib.dart' as p;
+class B implements p.A {} // 2
+''');
+    ClassElement elementA = importedUnit().getType('A');
+    assertThat(elementA)
+      ..isImplementedAt('A {} // 2', true)
+      ..isReferencedAt('A {} // 2', true);
+  }
+
+  test_isImplementedBy_ClassTypeAlias() async {
+    await _indexTestUnit('''
+class A {} // 1
+class B {} // 2
+class C = Object with A implements B; // 3
+''');
+    ClassElement elementB = findElement('B');
+    assertThat(elementB)
+      ..isImplementedAt('B; // 3', false)
+      ..isReferencedAt('B; // 3', false);
+  }
+
+  test_isInvokedBy_FieldElement() async {
+    await _indexTestUnit('''
+class A {
+  var field;
+  main() {
+    this.field(); // q
+    field(); // nq
+  }
+}''');
+    FieldElement field = findElement('field');
+    assertThat(field.getter)
+      ..isInvokedAt('field(); // q', true)
+      ..isInvokedAt('field(); // nq', false);
+  }
+
+  test_isInvokedBy_FunctionElement() async {
+    provider.newFile(
+        _p('$testProject/lib.dart'),
+        '''
+library lib;
+foo() {}
+''');
+    await _indexTestUnit('''
+import 'lib.dart';
+import 'lib.dart' as pref;
+main() {
+  pref.foo(); // q
+  foo(); // nq
+}''');
+    FunctionElement element = importedUnit().functions[0];
+    assertThat(element)
+      ..isInvokedAt('foo(); // q', true)
+      ..isInvokedAt('foo(); // nq', false);
+  }
+
+  test_isInvokedBy_FunctionElement_synthetic_loadLibrary() async {
+    await _indexTestUnit('''
+import 'dart:math' deferred as math;
+main() {
+  math.loadLibrary(); // 1
+  math.loadLibrary(); // 2
+}
+''');
+    LibraryElement mathLib = testLibraryElement.imports[0].importedLibrary;
+    FunctionElement element = mathLib.loadLibraryFunction;
+    assertThat(element).isInvokedAt('loadLibrary(); // 1', true);
+    assertThat(element).isInvokedAt('loadLibrary(); // 2', true);
+  }
+
+  test_isInvokedBy_MethodElement() async {
+    await _indexTestUnit('''
+class A {
+  foo() {}
+  main() {
+    this.foo(); // q
+    foo(); // nq
+  }
+}''');
+    Element element = findElement('foo');
+    assertThat(element)
+      ..isInvokedAt('foo(); // q', true)
+      ..isInvokedAt('foo(); // nq', false);
+  }
+
+  test_isInvokedBy_MethodElement_propagatedType() async {
+    await _indexTestUnit('''
+class A {
+  foo() {}
+}
+main() {
+  var a = new A();
+  a.foo();
+}
+''');
+    Element element = findElement('foo');
+    assertThat(element).isInvokedAt('foo();', true);
+  }
+
+  test_isInvokedBy_operator_binary() async {
+    await _indexTestUnit('''
+class A {
+  operator +(other) => this;
+}
+main(A a) {
+  print(a + 1);
+  a += 2;
+  ++a;
+  a++;
+}
+''');
+    MethodElement element = findElement('+');
+    assertThat(element)
+      ..isInvokedAt('+ 1', true, length: 1)
+      ..isInvokedAt('+= 2', true, length: 2)
+      ..isInvokedAt('++a', true, length: 2)
+      ..isInvokedAt('++;', true, length: 2);
+  }
+
+  test_isInvokedBy_operator_index() async {
+    await _indexTestUnit('''
+class A {
+  operator [](i) => null;
+  operator []=(i, v) {}
+}
+main(A a) {
+  print(a[0]);
+  a[1] = 42;
+}
+''');
+    MethodElement readElement = findElement('[]');
+    MethodElement writeElement = findElement('[]=');
+    assertThat(readElement).isInvokedAt('[0]', true, length: 1);
+    assertThat(writeElement).isInvokedAt('[1]', true, length: 1);
+  }
+
+  test_isInvokedBy_operator_prefix() async {
+    await _indexTestUnit('''
+class A {
+  A operator ~() => this;
+}
+main(A a) {
+  print(~a);
+}
+''');
+    MethodElement element = findElement('~');
+    assertThat(element).isInvokedAt('~a', true, length: 1);
+  }
+
+  test_isInvokedBy_PropertyAccessorElement_getter() async {
+    await _indexTestUnit('''
+class A {
+  get ggg => null;
+  main() {
+    this.ggg(); // q
+    ggg(); // nq
+  }
+}''');
+    PropertyAccessorElement element = findElement('ggg', ElementKind.GETTER);
+    assertThat(element)
+      ..isInvokedAt('ggg(); // q', true)
+      ..isInvokedAt('ggg(); // nq', false);
+  }
+
+  test_isMixedInBy_ClassDeclaration() async {
+    await _indexTestUnit('''
+class A {} // 1
+class B extends Object with A {} // 2
+''');
+    ClassElement elementA = findElement('A');
+    assertThat(elementA)
+      ..isMixedInAt('A {} // 2', false)
+      ..isReferencedAt('A {} // 2', false);
+  }
+
+  test_isMixedInBy_ClassDeclaration_isQualified() async {
+    provider.newFile(
+        _p('$testProject/lib.dart'),
+        '''
+class A {}
+''');
+    await _indexTestUnit('''
+import 'lib.dart' as p;
+class B extends Object with p.A {} // 2
+''');
+    ClassElement elementA = importedUnit().getType('A');
+    assertThat(elementA).isMixedInAt('A {} // 2', true);
+  }
+
+  test_isMixedInBy_ClassTypeAlias() async {
+    await _indexTestUnit('''
+class A {} // 1
+class B = Object with A; // 2
+''');
+    ClassElement elementA = findElement('A');
+    assertThat(elementA).isMixedInAt('A; // 2', false);
+  }
+
+  test_isReferencedBy_ClassElement() async {
+    await _indexTestUnit('''
+class A {
+  static var field;
+}
+main(A p) {
+  A v;
+  new A(); // 2
+  A.field = 1;
+  print(A.field); // 3
+}
+''');
+    ClassElement element = findElement('A');
+    assertThat(element)
+      ..isReferencedAt('A p) {', false)
+      ..isReferencedAt('A v;', false)
+      ..isReferencedAt('A(); // 2', false)
+      ..isReferencedAt('A.field = 1;', false)
+      ..isReferencedAt('A.field); // 3', false);
+  }
+
+  test_isReferencedBy_ClassElement_invocation() async {
+    await _indexTestUnit('''
+class A {}
+main() {
+  A(); // invalid code, but still a reference
+}''');
+    Element element = findElement('A');
+    assertThat(element).isReferencedAt('A();', false);
+  }
+
+  test_isReferencedBy_ClassElement_invocation_isQualified() async {
+    provider.newFile(
+        _p('$testProject/lib.dart'),
+        '''
+class A {}
+''');
+    await _indexTestUnit('''
+import 'lib.dart' as p;
+main() {
+  p.A(); // invalid code, but still a reference
+}''');
+    Element element = importedUnit().getType('A');
+    assertThat(element).isReferencedAt('A();', true);
+  }
+
+  test_isReferencedBy_ClassTypeAlias() async {
+    await _indexTestUnit('''
+class A {}
+class B = Object with A;
+main(B p) {
+  B v;
+}
+''');
+    ClassElement element = findElement('B');
+    assertThat(element)
+      ..isReferencedAt('B p) {', false)
+      ..isReferencedAt('B v;', false);
+  }
+
+  test_isReferencedBy_CompilationUnitElement_export() async {
+    provider.newFile(
+        _p('$testProject/lib.dart'),
+        '''
+library lib;
+''');
+    await _indexTestUnit('''
+export 'lib.dart';
+''');
+    LibraryElement element = testLibraryElement.exports[0].exportedLibrary;
+    assertThat(element)..isReferencedAt("'lib.dart'", true, length: 10);
+  }
+
+  test_isReferencedBy_CompilationUnitElement_import() async {
+    provider.newFile(
+        _p('$testProject/lib.dart'),
+        '''
+library lib;
+''');
+    await _indexTestUnit('''
+import 'lib.dart';
+''');
+    LibraryElement element = testLibraryElement.imports[0].importedLibrary;
+    assertThat(element)..isReferencedAt("'lib.dart'", true, length: 10);
+  }
+
+  test_isReferencedBy_CompilationUnitElement_part() async {
+    provider.newFile(_p('$testProject/my_unit.dart'), 'part of my_lib;');
+    await _indexTestUnit('''
+library my_lib;
+part 'my_unit.dart';
+''');
+    CompilationUnitElement element = testLibraryElement.parts[0];
+    assertThat(element)..isReferencedAt("'my_unit.dart';", true, length: 14);
+  }
+
+  test_isReferencedBy_ConstructorElement() async {
+    await _indexTestUnit('''
+class A implements B {
+  A() {}
+  A.foo() {}
+}
+class B extends A {
+  B() : super(); // 1
+  B.foo() : super.foo(); // 2
+  factory B.bar() = A.foo; // 3
+}
+main() {
+  new A(); // 4
+  new A.foo(); // 5
+}
+''');
+    ClassElement classA = findElement('A');
+    ConstructorElement constA = classA.constructors[0];
+    ConstructorElement constA_foo = classA.constructors[1];
+    // A()
+    assertThat(constA)
+      ..hasRelationCount(2)
+      ..isReferencedAt('(); // 1', true, length: 0)
+      ..isReferencedAt('(); // 4', true, length: 0);
+    // A.foo()
+    assertThat(constA_foo)
+      ..hasRelationCount(3)
+      ..isReferencedAt('.foo(); // 2', true, length: 4)
+      ..isReferencedAt('.foo; // 3', true, length: 4)
+      ..isReferencedAt('.foo(); // 5', true, length: 4);
+  }
+
+  test_isReferencedBy_ConstructorElement_classTypeAlias() async {
+    await _indexTestUnit('''
+class M {}
+class A implements B {
+  A() {}
+  A.named() {}
+}
+class B = A with M;
+class C = B with M;
+main() {
+  new B(); // B1
+  new B.named(); // B2
+  new C(); // C1
+  new C.named(); // C2
+}
+''');
+    ClassElement classA = findElement('A');
+    ConstructorElement constA = classA.constructors[0];
+    ConstructorElement constA_named = classA.constructors[1];
+    assertThat(constA)
+      ..isReferencedAt('(); // B1', true, length: 0)
+      ..isReferencedAt('(); // C1', true, length: 0);
+    assertThat(constA_named)
+      ..isReferencedAt('.named(); // B2', true, length: 6)
+      ..isReferencedAt('.named(); // C2', true, length: 6);
+  }
+
+  test_isReferencedBy_ConstructorElement_classTypeAlias_cycle() async {
+    await _indexTestUnit('''
+class M {}
+class A = B with M;
+class B = A with M;
+main() {
+  new A();
+  new B();
+}
+''');
+    // No additional validation, but it should not fail with stack overflow.
+  }
+
+  test_isReferencedBy_ConstructorElement_namedOnlyWithDot() async {
+    await _indexTestUnit('''
+class A {
+  A.named() {}
+}
+main() {
+  new A.named();
+}
+''');
+    // has ".named()", but does not have "named()"
+    int offsetWithoutDot = findOffset('named();');
+    int offsetWithDot = findOffset('.named();');
+    expect(index.usedElementOffsets, isNot(contains(offsetWithoutDot)));
+    expect(index.usedElementOffsets, contains(offsetWithDot));
+  }
+
+  test_isReferencedBy_ConstructorElement_redirection() async {
+    await _indexTestUnit('''
+class A {
+  A() : this.bar(); // 1
+  A.foo() : this(); // 2
+  A.bar();
+}
+''');
+    ClassElement classA = findElement('A');
+    ConstructorElement constA = classA.constructors[0];
+    ConstructorElement constA_bar = classA.constructors[2];
+    assertThat(constA).isReferencedAt('(); // 2', true, length: 0);
+    assertThat(constA_bar).isReferencedAt('.bar(); // 1', true, length: 4);
+  }
+
+  test_isReferencedBy_ConstructorElement_synthetic() async {
+    await _indexTestUnit('''
+class A {}
+main() {
+  new A(); // 1
+}
+''');
+    ClassElement classA = findElement('A');
+    ConstructorElement constA = classA.constructors[0];
+    // A()
+    assertThat(constA)..isReferencedAt('(); // 1', true, length: 0);
+  }
+
+  test_isReferencedBy_DynamicElement() async {
+    await _indexTestUnit('''
+dynamic f() {
+}''');
+    expect(index.usedElementOffsets, isEmpty);
+  }
+
+  test_isReferencedBy_FieldElement() async {
+    await _indexTestUnit('''
+class A {
+  var field;
+  A({this.field});
+  m() {
+    field = 2; // nq
+    print(field); // nq
+  }
+}
+main(A a) {
+  a.field = 3; // q
+  print(a.field); // q
+  new A(field: 4);
+}
+''');
+    FieldElement field = findElement('field', ElementKind.FIELD);
+    PropertyAccessorElement getter = field.getter;
+    PropertyAccessorElement setter = field.setter;
+    // A()
+    assertThat(field)..isWrittenAt('field});', true);
+    // m()
+    assertThat(setter)..isReferencedAt('field = 2; // nq', false);
+    assertThat(getter)..isReferencedAt('field); // nq', false);
+    // main()
+    assertThat(setter)..isReferencedAt('field = 3; // q', true);
+    assertThat(getter)..isReferencedAt('field); // q', true);
+    assertThat(field)..isReferencedAt('field: 4', true);
+  }
+
+  test_isReferencedBy_FieldElement_multiple() async {
+    await _indexTestUnit('''
+class A {
+  var aaa;
+  var bbb;
+  A(this.aaa, this.bbb) {}
+  m() {
+    print(aaa);
+    aaa = 1;
+    print(bbb);
+    bbb = 2;
+  }
+}
+''');
+    // aaa
+    {
+      FieldElement field = findElement('aaa', ElementKind.FIELD);
+      PropertyAccessorElement getter = field.getter;
+      PropertyAccessorElement setter = field.setter;
+      assertThat(field)..isWrittenAt('aaa, ', true);
+      assertThat(getter)..isReferencedAt('aaa);', false);
+      assertThat(setter)..isReferencedAt('aaa = 1;', false);
+    }
+    // bbb
+    {
+      FieldElement field = findElement('bbb', ElementKind.FIELD);
+      PropertyAccessorElement getter = field.getter;
+      PropertyAccessorElement setter = field.setter;
+      assertThat(field)..isWrittenAt('bbb) {}', true);
+      assertThat(getter)..isReferencedAt('bbb);', false);
+      assertThat(setter)..isReferencedAt('bbb = 2;', false);
+    }
+  }
+
+  test_isReferencedBy_FieldElement_ofEnum() async {
+    await _indexTestUnit('''
+enum MyEnum {
+  A, B, C
+}
+main() {
+  print(MyEnum.values);
+  print(MyEnum.A.index);
+  print(MyEnum.A);
+  print(MyEnum.B);
+}
+''');
+    ClassElement enumElement = findElement('MyEnum');
+    assertThat(enumElement.getGetter('values'))
+      ..isReferencedAt('values);', true);
+    assertThat(enumElement.getGetter('index'))..isReferencedAt('index);', true);
+    assertThat(enumElement.getGetter('A'))..isReferencedAt('A);', true);
+    assertThat(enumElement.getGetter('B'))..isReferencedAt('B);', true);
+  }
+
+  test_isReferencedBy_FieldElement_synthetic_hasGetter() async {
+    await _indexTestUnit('''
+class A {
+  A() : f = 42;
+  int get f => 0;
+}
+''');
+    ClassElement element2 = findElement('A');
+    assertThat(element2.getField('f')).isWrittenAt('f = 42', true);
+  }
+
+  test_isReferencedBy_FieldElement_synthetic_hasGetterSetter() async {
+    await _indexTestUnit('''
+class A {
+  A() : f = 42;
+  int get f => 0;
+  set f(_) {}
+}
+''');
+    ClassElement element2 = findElement('A');
+    assertThat(element2.getField('f')).isWrittenAt('f = 42', true);
+  }
+
+  test_isReferencedBy_FieldElement_synthetic_hasSetter() async {
+    await _indexTestUnit('''
+class A {
+  A() : f = 42;
+  set f(_) {}
+}
+''');
+    ClassElement element2 = findElement('A');
+    assertThat(element2.getField('f')).isWrittenAt('f = 42', true);
+  }
+
+  test_isReferencedBy_FunctionElement() async {
+    await _indexTestUnit('''
+foo() {}
+main() {
+  print(foo);
+  print(foo());
+}
+''');
+    FunctionElement element = findElement('foo');
+    assertThat(element)
+      ..isReferencedAt('foo);', false)
+      ..isInvokedAt('foo());', false);
+  }
+
+  test_isReferencedBy_FunctionElement_with_LibraryElement() async {
+    provider.newFile(
+        _p('$testProject/foo.dart'),
+        r'''
+bar() {}
+''');
+    await _indexTestUnit('''
+import "foo.dart";
+main() {
+  bar();
+}
+''');
+    LibraryElement fooLibrary = testLibraryElement.imports[0].importedLibrary;
+    assertThat(fooLibrary)..isReferencedAt('"foo.dart";', true, length: 10);
+    {
+      FunctionElement bar = fooLibrary.definingCompilationUnit.functions[0];
+      assertThat(bar)..isInvokedAt('bar();', false);
+    }
+  }
+
+  test_isReferencedBy_FunctionTypeAliasElement() async {
+    await _indexTestUnit('''
+typedef A();
+main(A p) {
+}
+''');
+    Element element = findElement('A');
+    assertThat(element)..isReferencedAt('A p) {', false);
+  }
+
+  /**
+   * There was a bug in the AST structure, when single [Comment] was cloned and
+   * assigned to both [FieldDeclaration] and [VariableDeclaration].
+   *
+   * This caused duplicate indexing.
+   * Here we test that the problem is fixed one way or another.
+   */
+  test_isReferencedBy_identifierInComment() async {
+    await _indexTestUnit('''
+class A {}
+/// [A] text
+var myVariable = null;
+''');
+    Element element = findElement('A');
+    assertThat(element)..isReferencedAt('A] text', false);
+  }
+
+  test_isReferencedBy_MethodElement() async {
+    await _indexTestUnit('''
+class A {
+  method() {}
+  main() {
+    print(this.method); // q
+    print(method); // nq
+  }
+}''');
+    MethodElement element = findElement('method');
+    assertThat(element)
+      ..isReferencedAt('method); // q', true)
+      ..isReferencedAt('method); // nq', false);
+  }
+
+  test_isReferencedBy_MultiplyDefinedElement() async {
+    provider.newFile(_p('$testProject/a1.dart'), 'class A {}');
+    provider.newFile(_p('$testProject/a2.dart'), 'class A {}');
+    await _indexTestUnit('''
+import 'a1.dart';
+import 'a2.dart';
+A v = null;
+''');
+  }
+
+  test_isReferencedBy_ParameterElement() async {
+    await _indexTestUnit('''
+foo({var p}) {}
+main() {
+  foo(p: 1);
+}
+''');
+    Element element = findElement('p');
+    assertThat(element)..isReferencedAt('p: 1', true);
+  }
+
+  test_isReferencedBy_synthetic_leastUpperBound() async {
+    await _indexTestUnit('''
+int f1({int p}) => 1;
+int f2({int p}) => 2;
+main(bool b) {
+  var f = b ? f1 : f2;
+  f(p: 0);
+}''');
+    // We should not crash because of reference to "p" - a named parameter
+    // of a synthetic LUB FunctionElement created for "f".
+  }
+
+  test_isReferencedBy_TopLevelVariableElement() async {
+    provider.newFile(
+        _p('$testProject/lib.dart'),
+        '''
+library lib;
+var V;
+''');
+    await _indexTestUnit('''
+import 'lib.dart' show V; // imp
+import 'lib.dart' as pref;
+main() {
+  pref.V = 5; // q
+  print(pref.V); // q
+  V = 5; // nq
+  print(V); // nq
+}''');
+    TopLevelVariableElement variable = importedUnit().topLevelVariables[0];
+    assertThat(variable)..isReferencedAt('V; // imp', true);
+    assertThat(variable.getter)
+      ..isReferencedAt('V); // q', true)
+      ..isReferencedAt('V); // nq', false);
+    assertThat(variable.setter)
+      ..isReferencedAt('V = 5; // q', true)
+      ..isReferencedAt('V = 5; // nq', false);
+  }
+
+  test_isReferencedBy_TopLevelVariableElement_synthetic_hasGetterSetter() async {
+    provider.newFile(
+        _p('$testProject/lib.dart'),
+        '''
+int get V => 0;
+void set V(_) {}
+''');
+    await _indexTestUnit('''
+import 'lib.dart' show V;
+''');
+    TopLevelVariableElement element = importedUnit().topLevelVariables[0];
+    assertThat(element).isReferencedAt('V;', true);
+  }
+
+  test_isReferencedBy_TopLevelVariableElement_synthetic_hasSetter() async {
+    provider.newFile(
+        _p('$testProject/lib.dart'),
+        '''
+void set V(_) {}
+''');
+    await _indexTestUnit('''
+import 'lib.dart' show V;
+''');
+    TopLevelVariableElement element = importedUnit().topLevelVariables[0];
+    assertThat(element).isReferencedAt('V;', true);
+  }
+
+  test_isReferencedBy_typeInVariableList() async {
+    await _indexTestUnit('''
+class A {}
+A myVariable = null;
+''');
+    Element element = findElement('A');
+    assertThat(element).isReferencedAt('A myVariable', false);
+  }
+
+  test_isWrittenBy_FieldElement() async {
+    await _indexTestUnit('''
+class A {
+  int field;
+  A.foo({this.field});
+  A.bar() : field = 5;
+}
+''');
+    FieldElement element = findElement('field', ElementKind.FIELD);
+    assertThat(element)
+      ..isWrittenAt('field})', true)
+      ..isWrittenAt('field = 5', true);
+  }
+
+  test_usedName_inLibraryIdentifier() async {
+    await _indexTestUnit('''
+library aaa.bbb.ccc;
+class C {
+  var bbb;
+}
+main(p) {
+  p.bbb = 1;
+}
+''');
+    assertThatName('bbb')
+      ..isNotUsed('bbb.ccc', IndexRelationKind.IS_READ_BY)
+      ..isUsedQ('bbb = 1;', IndexRelationKind.IS_WRITTEN_BY);
+  }
+
+  test_usedName_qualified_resolved() async {
+    await _indexTestUnit('''
+class C {
+  var x;
+}
+main(C c) {
+  c.x;
+  c.x = 1;
+  c.x += 2;
+  c.x();
+}
+''');
+    assertThatName('x')
+      ..isNotUsedQ('x;', IndexRelationKind.IS_READ_BY)
+      ..isNotUsedQ('x = 1;', IndexRelationKind.IS_WRITTEN_BY)
+      ..isNotUsedQ('x += 2;', IndexRelationKind.IS_READ_WRITTEN_BY)
+      ..isNotUsedQ('x();', IndexRelationKind.IS_INVOKED_BY);
+  }
+
+  test_usedName_qualified_unresolved() async {
+    await _indexTestUnit('''
+main(p) {
+  p.x;
+  p.x = 1;
+  p.x += 2;
+  p.x();
+}
+''');
+    assertThatName('x')
+      ..isUsedQ('x;', IndexRelationKind.IS_READ_BY)
+      ..isUsedQ('x = 1;', IndexRelationKind.IS_WRITTEN_BY)
+      ..isUsedQ('x += 2;', IndexRelationKind.IS_READ_WRITTEN_BY)
+      ..isUsedQ('x();', IndexRelationKind.IS_INVOKED_BY);
+  }
+
+  test_usedName_unqualified_resolved() async {
+    await _indexTestUnit('''
+class C {
+  var x;
+  m() {
+    x;
+    x = 1;
+    x += 2;
+    x();
+  }
+}
+''');
+    assertThatName('x')
+      ..isNotUsedQ('x;', IndexRelationKind.IS_READ_BY)
+      ..isNotUsedQ('x = 1;', IndexRelationKind.IS_WRITTEN_BY)
+      ..isNotUsedQ('x += 2;', IndexRelationKind.IS_READ_WRITTEN_BY)
+      ..isNotUsedQ('x();', IndexRelationKind.IS_INVOKED_BY);
+  }
+
+  test_usedName_unqualified_unresolved() async {
+    await _indexTestUnit('''
+main() {
+  x;
+  x = 1;
+  x += 2;
+  x();
+}
+''');
+    assertThatName('x')
+      ..isUsed('x;', IndexRelationKind.IS_READ_BY)
+      ..isUsed('x = 1;', IndexRelationKind.IS_WRITTEN_BY)
+      ..isUsed('x += 2;', IndexRelationKind.IS_READ_WRITTEN_BY)
+      ..isUsed('x();', IndexRelationKind.IS_INVOKED_BY);
+  }
+
+  /**
+   * Asserts that [index] has an item with the expected properties.
+   */
+  void _assertHasRelation(
+      Element element,
+      List<_Relation> relations,
+      IndexRelationKind expectedRelationKind,
+      ExpectedLocation expectedLocation) {
+    for (_Relation relation in relations) {
+      if (relation.kind == expectedRelationKind &&
+          relation.offset == expectedLocation.offset &&
+          relation.length == expectedLocation.length &&
+          relation.isQualified == expectedLocation.isQualified) {
+        return;
+      }
+    }
+    _failWithIndexDump(
+        'not found\n$element $expectedRelationKind at $expectedLocation');
+  }
+
+  void _assertUsedName(String name, IndexRelationKind kind,
+      ExpectedLocation expectedLocation, bool isNot) {
+    int nameId = _getStringId(name);
+    for (int i = 0; i < index.usedNames.length; i++) {
+      if (index.usedNames[i] == nameId &&
+          index.usedNameKinds[i] == kind &&
+          index.usedNameOffsets[i] == expectedLocation.offset &&
+          index.usedNameIsQualifiedFlags[i] == expectedLocation.isQualified) {
+        if (isNot) {
+          _failWithIndexDump('Unexpected $name $kind at $expectedLocation');
+        }
+        return;
+      }
+    }
+    if (isNot) {
+      return;
+    }
+    _failWithIndexDump('Not found $name $kind at $expectedLocation');
+  }
+
+  ExpectedLocation _expectedLocation(String search, bool isQualified,
+      {int length}) {
+    int offset = findOffset(search);
+    if (length == null) {
+      length = getLeadingIdentifierLength(search);
+    }
+    return new ExpectedLocation(testUnitElement, offset, length, isQualified);
+  }
+
+  void _failWithIndexDump(String msg) {
+    String packageIndexJsonString =
+        new JsonEncoder.withIndent('  ').convert(index.toJson());
+    fail('$msg in\n' + packageIndexJsonString);
+  }
+
+  /**
+   * Return the [element] identifier in [index] or fail.
+   */
+  int _findElementId(Element element) {
+    int unitId = _getUnitId(element);
+    // Prepare the element that was put into the index.
+    IndexElementInfo info = new IndexElementInfo(element);
+    element = info.element;
+    // Prepare element's name components.
+    int unitMemberId = index.nullStringId;
+    int classMemberId = index.nullStringId;
+    int parameterId = index.nullStringId;
+    for (Element e = element; e != null; e = e.enclosingElement) {
+      if (e.enclosingElement is CompilationUnitElement) {
+        unitMemberId = _getStringId(e.name);
+        break;
+      }
+    }
+    for (Element e = element; e != null; e = e.enclosingElement) {
+      if (e.enclosingElement is ClassElement) {
+        classMemberId = _getStringId(e.name);
+        break;
+      }
+    }
+    if (element is ParameterElement) {
+      parameterId = _getStringId(element.name);
+    }
+    // Find the element's id.
+    for (int elementId = 0;
+        elementId < index.elementUnits.length;
+        elementId++) {
+      if (index.elementUnits[elementId] == unitId &&
+          index.elementNameUnitMemberIds[elementId] == unitMemberId &&
+          index.elementNameClassMemberIds[elementId] == classMemberId &&
+          index.elementNameParameterIds[elementId] == parameterId &&
+          index.elementKinds[elementId] == info.kind) {
+        return elementId;
+      }
+    }
+    _failWithIndexDump('Element $element is not referenced');
+    return 0;
+  }
+
+  /**
+   * Return all relations with [element] in [index].
+   */
+  List<_Relation> _getElementRelations(Element element) {
+    int elementId = _findElementId(element);
+    List<_Relation> relations = <_Relation>[];
+    for (int i = 0; i < index.usedElementOffsets.length; i++) {
+      if (index.usedElements[i] == elementId) {
+        relations.add(new _Relation(
+            index.usedElementKinds[i],
+            index.usedElementOffsets[i],
+            index.usedElementLengths[i],
+            index.usedElementIsQualifiedFlags[i]));
+      }
+    }
+    return relations;
+  }
+
+  int _getStringId(String str) {
+    int id = index.strings.indexOf(str);
+    if (id < 0) {
+      _failWithIndexDump('String "$str" is not referenced');
+    }
+    return id;
+  }
+
+  int _getUnitId(Element element) {
+    CompilationUnitElement unitElement = getUnitElement(element);
+    int libraryUriId = _getUriId(unitElement.library.source.uri);
+    int unitUriId = _getUriId(unitElement.source.uri);
+    expect(index.unitLibraryUris, hasLength(index.unitUnitUris.length));
+    for (int i = 0; i < index.unitLibraryUris.length; i++) {
+      if (index.unitLibraryUris[i] == libraryUriId &&
+          index.unitUnitUris[i] == unitUriId) {
+        return i;
+      }
+    }
+    _failWithIndexDump('Unit $unitElement of $element is not referenced');
+    return -1;
+  }
+
+  int _getUriId(Uri uri) {
+    String str = uri.toString();
+    return _getStringId(str);
+  }
+
+  Future<Null> _indexTestUnit(String code) async {
+    addTestFile(code);
+
+    AnalysisResult result = await driver.getResult(testFile);
+    testUnit = result.unit;
+    testUnitElement = testUnit.element;
+    testLibraryElement = testUnitElement.library;
+
+    AnalysisDriverUnitIndexBuilder indexBuilder = indexUnit(testUnit);
+    List<int> indexBytes = indexBuilder.toBuffer();
+    index = new AnalysisDriverUnitIndex.fromBuffer(indexBytes);
+  }
+
+  String _p(String path) => provider.convertPath(path);
+}
+
+class _ElementIndexAssert {
+  final IndexTest test;
+  final Element element;
+  final List<_Relation> relations;
+
+  _ElementIndexAssert(this.test, this.element, this.relations);
+
+  void hasRelationCount(int expectedCount) {
+    expect(relations, hasLength(expectedCount));
+  }
+
+  void isAncestorOf(String search, {int length}) {
+    test._assertHasRelation(
+        element,
+        relations,
+        IndexRelationKind.IS_ANCESTOR_OF,
+        test._expectedLocation(search, false, length: length));
+  }
+
+  void isExtendedAt(String search, bool isQualified, {int length}) {
+    test._assertHasRelation(
+        element,
+        relations,
+        IndexRelationKind.IS_EXTENDED_BY,
+        test._expectedLocation(search, isQualified, length: length));
+  }
+
+  void isImplementedAt(String search, bool isQualified, {int length}) {
+    test._assertHasRelation(
+        element,
+        relations,
+        IndexRelationKind.IS_IMPLEMENTED_BY,
+        test._expectedLocation(search, isQualified, length: length));
+  }
+
+  void isInvokedAt(String search, bool isQualified, {int length}) {
+    test._assertHasRelation(element, relations, IndexRelationKind.IS_INVOKED_BY,
+        test._expectedLocation(search, isQualified, length: length));
+  }
+
+  void isMixedInAt(String search, bool isQualified, {int length}) {
+    test._assertHasRelation(
+        element,
+        relations,
+        IndexRelationKind.IS_MIXED_IN_BY,
+        test._expectedLocation(search, isQualified, length: length));
+  }
+
+  void isReferencedAt(String search, bool isQualified, {int length}) {
+    test._assertHasRelation(
+        element,
+        relations,
+        IndexRelationKind.IS_REFERENCED_BY,
+        test._expectedLocation(search, isQualified, length: length));
+  }
+
+  void isWrittenAt(String search, bool isQualified, {int length}) {
+    test._assertHasRelation(element, relations, IndexRelationKind.IS_WRITTEN_BY,
+        test._expectedLocation(search, isQualified, length: length));
+  }
+}
+
+class _NameIndexAssert {
+  final IndexTest test;
+  final String name;
+
+  _NameIndexAssert(this.test, this.name);
+
+  void isNotUsed(String search, IndexRelationKind kind) {
+    test._assertUsedName(
+        name, kind, test._expectedLocation(search, false), true);
+  }
+
+  void isNotUsedQ(String search, IndexRelationKind kind) {
+    test._assertUsedName(
+        name, kind, test._expectedLocation(search, true), true);
+  }
+
+  void isUsed(String search, IndexRelationKind kind) {
+    test._assertUsedName(
+        name, kind, test._expectedLocation(search, false), false);
+  }
+
+  void isUsedQ(String search, IndexRelationKind kind) {
+    test._assertUsedName(
+        name, kind, test._expectedLocation(search, true), false);
+  }
+}
+
+class _Relation {
+  final IndexRelationKind kind;
+  final int offset;
+  final int length;
+  final bool isQualified;
+
+  _Relation(this.kind, this.offset, this.length, this.isQualified);
+
+  @override
+  String toString() {
+    return '_Relation{kind: $kind, offset: $offset, length: $length, '
+        'isQualified: $isQualified}lified)';
+  }
+}
diff --git a/pkg/analyzer/test/src/dart/analysis/referenced_names_test.dart b/pkg/analyzer/test/src/dart/analysis/referenced_names_test.dart
new file mode 100644
index 0000000..97a1bdca
--- /dev/null
+++ b/pkg/analyzer/test/src/dart/analysis/referenced_names_test.dart
@@ -0,0 +1,389 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/src/dart/analysis/referenced_names.dart';
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import '../../../generated/parser_test.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ReferencedNamesBuilderTest);
+  });
+}
+
+@reflectiveTest
+class ReferencedNamesBuilderTest {
+  test_class_constructor() {
+    Set<String> names = _computeReferencedNames('''
+class U {
+  U.named(A a, B b) {
+    C c = null;
+  }
+}
+''');
+    expect(names, unorderedEquals(['A', 'B', 'C']));
+  }
+
+  test_class_field() {
+    Set<String> names = _computeReferencedNames('''
+class U {
+  A f = new B();
+}
+''');
+    expect(names, unorderedEquals(['A', 'B']));
+  }
+
+  test_class_getter() {
+    Set<String> names = _computeReferencedNames('''
+class U {
+  A get a => new B();
+}
+''');
+    expect(names, unorderedEquals(['A', 'B']));
+  }
+
+  test_class_members() {
+    Set<String> names = _computeReferencedNames('''
+class U {
+  int a;
+  int get b;
+  set c(_) {}
+  m(D d) {
+    a;
+    b;
+    c = 1;
+    m();
+  }
+}
+''');
+    expect(names, unorderedEquals(['int', 'D']));
+  }
+
+  test_class_members_dontHideQualified() {
+    Set<String> names = _computeReferencedNames('''
+class U {
+  int a;
+  int get b;
+  set c(_) {}
+  m(D d) {
+    d.a;
+    d.b;
+    d.c;
+  }
+}
+''');
+    expect(names, unorderedEquals(['int', 'D', 'a', 'b', 'c']));
+  }
+
+  test_class_method() {
+    Set<String> names = _computeReferencedNames('''
+class U {
+  A m(B p) {
+    C v = 0;
+  }
+}
+''');
+    expect(names, unorderedEquals(['A', 'B', 'C']));
+  }
+
+  test_class_method_localVariables() {
+    Set<String> names = _computeReferencedNames('''
+class U {
+  A m() {
+    B b = null;
+    b;
+    {
+      C c = null;
+      b;
+      c;
+    }
+    d;
+  }
+}
+''');
+    expect(names, unorderedEquals(['A', 'B', 'C', 'd']));
+  }
+
+  test_class_method_parameters() {
+    Set<String> names = _computeReferencedNames('''
+class U {
+  m(A a) {
+    a;
+    b;
+  }
+}
+''');
+    expect(names, unorderedEquals(['A', 'b']));
+  }
+
+  test_class_method_typeParameters() {
+    Set<String> names = _computeReferencedNames('''
+class U {
+  A m<T>(B b, T t) {
+    C c = 0;
+  }
+}
+''');
+    expect(names, unorderedEquals(['A', 'B', 'C']));
+  }
+
+  test_class_setter() {
+    Set<String> names = _computeReferencedNames('''
+class U {
+  set a(A a) {
+    B b = null;
+  }
+}
+''');
+    expect(names, unorderedEquals(['A', 'B']));
+  }
+
+  test_class_typeParameters() {
+    Set<String> names = _computeReferencedNames('''
+class U<T> {
+  T f = new A<T>();
+}
+''');
+    expect(names, unorderedEquals(['A']));
+  }
+
+  test_instantiatedNames_importPrefix() {
+    Set<String> names = _computeReferencedNames('''
+import 'a.dart' as p1;
+import 'b.dart' as p2;
+main() {
+  new p1.A();
+  new p1.A.c1();
+  new p1.B();
+  new p2.C();
+  new D();
+  new D.c2();
+}
+''');
+    expect(names, unorderedEquals(['A', 'B', 'C', 'D', 'c1', 'c2']));
+  }
+
+  test_localFunction() {
+    Set<String> names = _computeReferencedNames('''
+f(A a) {
+  g(B b) {}
+}
+''');
+    expect(names, unorderedEquals(['A', 'B']));
+  }
+
+  test_superToSubs_importPrefix() {
+    Set<String> names = _computeReferencedNames('''
+import 'a.dart' as p1;
+import 'b.dart' as p2;
+class U extends p1.A with p2.B implements p2.C {}
+''');
+    expect(names, unorderedEquals(['A', 'B', 'C']));
+  }
+
+  test_topLevelVariable() {
+    Set<String> names = _computeReferencedNames('''
+A v = new B(c);
+''');
+    expect(names, unorderedEquals(['A', 'B', 'c']));
+  }
+
+  test_topLevelVariable_multiple() {
+    Set<String> names = _computeReferencedNames('''
+A v1 = new B(c), v2 = new D<E>(f);
+''');
+    expect(names, unorderedEquals(['A', 'B', 'c', 'D', 'E', 'f']));
+  }
+
+  test_unit_classTypeAlias() {
+    Set<String> names = _computeReferencedNames('''
+class U = A with B implements C;
+''');
+    expect(names, unorderedEquals(['A', 'B', 'C']));
+  }
+
+  test_unit_classTypeAlias_typeParameters() {
+    Set<String> names = _computeReferencedNames('''
+class U<T1, T2 extends D> = A<T1> with B<T2> implements C<T1, T2>;
+''');
+    expect(names, unorderedEquals(['A', 'B', 'C', 'D']));
+  }
+
+  test_unit_function() {
+    Set<String> names = _computeReferencedNames('''
+A f(B b) {
+  C c = 0;
+}
+''');
+    expect(names, unorderedEquals(['A', 'B', 'C']));
+  }
+
+  test_unit_function_doc() {
+    Set<String> names = _computeReferencedNames('''
+/**
+ * Documentation [C.d] reference.
+ */
+A f(B b) {}
+''');
+    expect(names, unorderedEquals(['A', 'B', 'C', 'd']));
+  }
+
+  test_unit_function_dontHideQualified() {
+    Set<String> names = _computeReferencedNames('''
+class U {
+  int a;
+  int get b;
+  set c(_) {}
+  m(D d) {
+    d.a;
+    d.b;
+    d.c;
+  }
+}
+''');
+    expect(names, unorderedEquals(['int', 'D', 'a', 'b', 'c']));
+  }
+
+  test_unit_function_localFunction_parameter() {
+    Set<String> names = _computeReferencedNames('''
+A f() {
+  B g(x) {
+    x;
+    return null;
+  }
+  return null;
+}
+''');
+    expect(names, unorderedEquals(['A', 'B']));
+  }
+
+  test_unit_function_localFunctions() {
+    Set<String> names = _computeReferencedNames('''
+A f() {
+  B b = null;
+  C g() {}
+  g();
+}
+''');
+    expect(names, unorderedEquals(['A', 'B', 'C']));
+  }
+
+  test_unit_function_localsDontHideQualified() {
+    Set<String> names = _computeReferencedNames('''
+f(A a, B b) {
+  var v = 0;
+  a.v;
+  a.b;
+}
+''');
+    expect(names, unorderedEquals(['A', 'B', 'v', 'b']));
+  }
+
+  test_unit_function_localVariables() {
+    Set<String> names = _computeReferencedNames('''
+A f() {
+  B b = null;
+  b;
+  {
+    C c = null;
+    b;
+    c;
+  }
+  d;
+}
+''');
+    expect(names, unorderedEquals(['A', 'B', 'C', 'd']));
+  }
+
+  test_unit_function_parameters() {
+    Set<String> names = _computeReferencedNames('''
+A f(B b) {
+  C c = 0;
+  b;
+}
+''');
+    expect(names, unorderedEquals(['A', 'B', 'C']));
+  }
+
+  test_unit_function_parameters_dontHideQualified() {
+    Set<String> names = _computeReferencedNames('''
+f(x, C g()) {
+  g().x;
+}
+''');
+    expect(names, unorderedEquals(['C', 'x']));
+  }
+
+  test_unit_function_typeParameters() {
+    Set<String> names = _computeReferencedNames('''
+A f<T>(B b, T t) {
+  C c = 0;
+}
+''');
+    expect(names, unorderedEquals(['A', 'B', 'C']));
+  }
+
+  test_unit_functionTypeAlias() {
+    Set<String> names = _computeReferencedNames('''
+typedef A F(B B, C c(D d));
+''');
+    expect(names, unorderedEquals(['A', 'B', 'C', 'D']));
+  }
+
+  test_unit_functionTypeAlias_typeParameters() {
+    Set<String> names = _computeReferencedNames('''
+typedef A F<T>(B b, T t);
+''');
+    expect(names, unorderedEquals(['A', 'B']));
+  }
+
+  test_unit_getter() {
+    Set<String> names = _computeReferencedNames('''
+A get aaa {
+  return new B();
+}
+''');
+    expect(names, unorderedEquals(['A', 'B']));
+  }
+
+  test_unit_setter() {
+    Set<String> names = _computeReferencedNames('''
+set aaa(A a) {
+  B b = null;
+}
+''');
+    expect(names, unorderedEquals(['A', 'B']));
+  }
+
+  test_unit_topLevelDeclarations() {
+    Set<String> names = _computeReferencedNames('''
+class L1 {}
+class L2 = A with B implements C;
+A L3() => null;
+typedef A L4(B b);
+A get L5 => null;
+set L6(_) {}
+A L7, L8;
+main() {
+  L1;
+  L2;
+  L3;
+  L4;
+  L5;
+  L6;
+  L7;
+  L8;
+}
+''');
+    expect(names, unorderedEquals(['A', 'B', 'C']));
+  }
+
+  Set<String> _computeReferencedNames(String code) {
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit2(code);
+    return computeReferencedNames(unit);
+  }
+}
diff --git a/pkg/analyzer/test/src/dart/analysis/search_test.dart b/pkg/analyzer/test/src/dart/analysis/search_test.dart
new file mode 100644
index 0000000..e473ffc
--- /dev/null
+++ b/pkg/analyzer/test/src/dart/analysis/search_test.dart
@@ -0,0 +1,738 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer/src/dart/analysis/driver.dart';
+import 'package:analyzer/src/dart/analysis/search.dart';
+import 'package:analyzer/src/dart/ast/utilities.dart';
+import 'package:analyzer/src/dart/element/member.dart';
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'base.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(SearchTest);
+  });
+}
+
+class ExpectedResult {
+  final Element enclosingElement;
+  final SearchResultKind kind;
+  final int offset;
+  final int length;
+  final bool isResolved;
+  final bool isQualified;
+
+  ExpectedResult(this.enclosingElement, this.kind, this.offset, this.length,
+      {this.isResolved: true, this.isQualified: false});
+
+  bool operator ==(Object result) {
+    return result is SearchResult &&
+        result.kind == this.kind &&
+        result.isResolved == this.isResolved &&
+        result.isQualified == this.isQualified &&
+        result.offset == this.offset &&
+        result.length == this.length &&
+        result.enclosingElement == this.enclosingElement;
+  }
+
+  @override
+  String toString() {
+    StringBuffer buffer = new StringBuffer();
+    buffer.write("ExpectedResult(kind=");
+    buffer.write(kind);
+    buffer.write(", enclosingElement=");
+    buffer.write(enclosingElement);
+    buffer.write(", offset=");
+    buffer.write(offset);
+    buffer.write(", length=");
+    buffer.write(length);
+    buffer.write(", isResolved=");
+    buffer.write(isResolved);
+    buffer.write(", isQualified=");
+    buffer.write(isQualified);
+    buffer.write(")");
+    return buffer.toString();
+  }
+}
+
+@reflectiveTest
+class SearchTest extends BaseAnalysisDriverTest {
+  static const testUri = 'package:test/test.dart';
+
+  CompilationUnit testUnit;
+  CompilationUnitElement testUnitElement;
+  LibraryElement testLibraryElement;
+
+  test_searchReferences_ClassElement_definedInside() async {
+    await _resolveTestUnit('''
+class A {};
+main(A p) {
+  A v;
+}
+class B1 extends A {} // extends
+class B2 implements A {} // implements
+class B3 extends Object with A {} // with
+List<A> v2 = null;
+''');
+    ClassElement element = _findElementAtString('A {}');
+    Element p = _findElement('p');
+    Element main = _findElement('main');
+    Element b1 = _findElement('B1');
+    Element b2 = _findElement('B2');
+    Element b3 = _findElement('B3');
+    Element v2 = _findElement('v2');
+    var expected = [
+      _expectId(p, SearchResultKind.REFERENCE, 'A p'),
+      _expectId(main, SearchResultKind.REFERENCE, 'A v'),
+      _expectId(b1, SearchResultKind.REFERENCE, 'A {} // extends'),
+      _expectId(b2, SearchResultKind.REFERENCE, 'A {} // implements'),
+      _expectId(b3, SearchResultKind.REFERENCE, 'A {} // with'),
+      _expectId(v2, SearchResultKind.REFERENCE, 'A> v2'),
+    ];
+    await _verifyReferences(element, expected);
+  }
+
+  test_searchReferences_ClassElement_definedOutside() async {
+    provider.newFile(
+        _p('$testProject/lib.dart'),
+        r'''
+class A {};
+''');
+    await _resolveTestUnit('''
+import 'lib.dart';
+main(A p) {
+  A v;
+}
+''');
+    ClassElement element = _findElementAtString('A p');
+    Element p = _findElement('p');
+    Element main = _findElement('main');
+    var expected = [
+      _expectId(p, SearchResultKind.REFERENCE, 'A p'),
+      _expectId(main, SearchResultKind.REFERENCE, 'A v')
+    ];
+    await _verifyReferences(element, expected);
+  }
+
+  @failingTest
+  test_searchReferences_CompilationUnitElement() async {
+    provider.newFile(
+        _p('$testProject/my_part.dart'),
+        '''
+part of lib;
+''');
+    await _resolveTestUnit('''
+library lib;
+part 'my_part.dart';
+''');
+    CompilationUnitElement element = _findElementAtString('my_part');
+    var expected = [
+      _expectIdQ(element.library.definingCompilationUnit,
+          SearchResultKind.REFERENCE, "'my_part.dart'",
+          length: "'my_part.dart'".length)
+    ];
+    await _verifyReferences(element, expected);
+  }
+
+  test_searchReferences_ConstructorElement() async {
+    await _resolveTestUnit('''
+class A {
+  A.named() {}
+}
+main() {
+  new A.named();
+}
+''');
+    ConstructorElement element = _findElement('named');
+    Element mainElement = _findElement('main');
+    var expected = [
+      _expectIdQ(mainElement, SearchResultKind.REFERENCE, '.named();',
+          length: 6)
+    ];
+    await _verifyReferences(element, expected);
+  }
+
+  test_searchReferences_ConstructorElement_synthetic() async {
+    await _resolveTestUnit('''
+class A {
+}
+main() {
+  new A();
+}
+''');
+    ClassElement classElement = _findElement('A');
+    ConstructorElement element = classElement.unnamedConstructor;
+    Element mainElement = _findElement('main');
+    var expected = [
+      _expectIdQ(mainElement, SearchResultKind.REFERENCE, '();', length: 0)
+    ];
+    await _verifyReferences(element, expected);
+  }
+
+  test_searchReferences_FieldElement() async {
+    await _resolveTestUnit('''
+class A {
+  var field;
+  A({this.field});
+  main() {
+    new A(field: 1);
+    // getter
+    print(field); // ref-nq
+    print(this.field); // ref-q
+    field(); // inv-nq
+    this.field(); // inv-q
+    // setter
+    field = 2; // ref-nq;
+    this.field = 3; // ref-q;
+  }
+}
+''');
+    FieldElement element = _findElement('field', ElementKind.FIELD);
+    Element main = _findElement('main');
+    Element fieldParameter = _findElement('field', ElementKind.PARAMETER);
+    var expected = [
+      _expectIdQ(fieldParameter, SearchResultKind.WRITE, 'field}'),
+      _expectIdQ(main, SearchResultKind.REFERENCE, 'field: 1'),
+      _expectId(main, SearchResultKind.READ, 'field); // ref-nq'),
+      _expectIdQ(main, SearchResultKind.READ, 'field); // ref-q'),
+      _expectId(main, SearchResultKind.INVOCATION, 'field(); // inv-nq'),
+      _expectIdQ(main, SearchResultKind.INVOCATION, 'field(); // inv-q'),
+      _expectId(main, SearchResultKind.WRITE, 'field = 2; // ref-nq'),
+      _expectIdQ(main, SearchResultKind.WRITE, 'field = 3; // ref-q'),
+    ];
+    await _verifyReferences(element, expected);
+  }
+
+  test_searchReferences_FieldElement_ofEnum() async {
+    await _resolveTestUnit('''
+enum MyEnum {
+  A, B, C
+}
+main() {
+  print(MyEnum.A.index);
+  print(MyEnum.values);
+  print(MyEnum.A);
+  print(MyEnum.B);
+}
+''');
+    ClassElement enumElement = _findElement('MyEnum');
+    Element mainElement = _findElement('main');
+    await _verifyReferences(enumElement.getField('index'),
+        [_expectIdQ(mainElement, SearchResultKind.READ, 'index);')]);
+    await _verifyReferences(enumElement.getField('values'),
+        [_expectIdQ(mainElement, SearchResultKind.READ, 'values);')]);
+    await _verifyReferences(enumElement.getField('A'), [
+      _expectIdQ(mainElement, SearchResultKind.READ, 'A.index);'),
+      _expectIdQ(mainElement, SearchResultKind.READ, 'A);')
+    ]);
+    await _verifyReferences(enumElement.getField('B'),
+        [_expectIdQ(mainElement, SearchResultKind.READ, 'B);')]);
+  }
+
+  test_searchReferences_FieldElement_synthetic() async {
+    await _resolveTestUnit('''
+class A {
+  get field => null;
+  set field(x) {}
+  main() {
+    // getter
+    print(field); // ref-nq
+    print(this.field); // ref-q
+    field(); // inv-nq
+    this.field(); // inv-q
+    // setter
+    field = 2; // ref-nq;
+    this.field = 3; // ref-q;
+  }
+}
+''');
+    FieldElement element = _findElement('field', ElementKind.FIELD);
+    Element main = _findElement('main');
+    var expected = [
+      _expectId(main, SearchResultKind.READ, 'field); // ref-nq'),
+      _expectIdQ(main, SearchResultKind.READ, 'field); // ref-q'),
+      _expectId(main, SearchResultKind.INVOCATION, 'field(); // inv-nq'),
+      _expectIdQ(main, SearchResultKind.INVOCATION, 'field(); // inv-q'),
+      _expectId(main, SearchResultKind.WRITE, 'field = 2; // ref-nq'),
+      _expectIdQ(main, SearchResultKind.WRITE, 'field = 3; // ref-q'),
+    ];
+    await _verifyReferences(element, expected);
+  }
+
+  test_searchReferences_FunctionElement() async {
+    await _resolveTestUnit('''
+test() {}
+main() {
+  test();
+  print(test);
+}
+''');
+    FunctionElement element = _findElement('test');
+    Element mainElement = _findElement('main');
+    var expected = [
+      _expectId(mainElement, SearchResultKind.INVOCATION, 'test();'),
+      _expectId(mainElement, SearchResultKind.REFERENCE, 'test);')
+    ];
+    await _verifyReferences(element, expected);
+  }
+
+  test_searchReferences_FunctionElement_local() async {
+    await _resolveTestUnit('''
+main() {
+  test() {}
+  test();
+  print(test);
+}
+''');
+    FunctionElement element = _findElement('test');
+    Element main = _findElement('main');
+    var expected = [
+      _expectId(main, SearchResultKind.INVOCATION, 'test();'),
+      _expectId(main, SearchResultKind.REFERENCE, 'test);')
+    ];
+    await _verifyReferences(element, expected);
+  }
+
+  test_searchReferences_LabelElement() async {
+    await _resolveTestUnit('''
+main() {
+label:
+  while (true) {
+    if (true) {
+      break label; // 1
+    }
+    break label; // 2
+  }
+}
+''');
+    Element element = _findElement('label');
+    Element main = _findElement('main');
+    var expected = [
+      _expectId(main, SearchResultKind.REFERENCE, 'label; // 1'),
+      _expectId(main, SearchResultKind.REFERENCE, 'label; // 2')
+    ];
+    await _verifyReferences(element, expected);
+  }
+
+  test_searchReferences_LocalVariableElement() async {
+    await _resolveTestUnit(r'''
+main() {
+  var v;
+  v = 1;
+  v += 2;
+  print(v);
+  v();
+}
+''');
+    Element element = _findElement('v');
+    Element main = _findElement('main');
+    var expected = [
+      _expectId(main, SearchResultKind.WRITE, 'v = 1;'),
+      _expectId(main, SearchResultKind.READ_WRITE, 'v += 2;'),
+      _expectId(main, SearchResultKind.READ, 'v);'),
+      _expectId(main, SearchResultKind.INVOCATION, 'v();')
+    ];
+    await _verifyReferences(element, expected);
+  }
+
+  test_searchReferences_localVariableElement_inForEachLoop() async {
+    await _resolveTestUnit('''
+main() {
+  for (var v in []) {
+    v = 1;
+    v += 2;
+    print(v);
+    v();
+  }
+}
+''');
+    Element element = _findElementAtString('v in []');
+    Element main = _findElement('main');
+    var expected = [
+      _expectId(main, SearchResultKind.WRITE, 'v = 1;'),
+      _expectId(main, SearchResultKind.READ_WRITE, 'v += 2;'),
+      _expectId(main, SearchResultKind.READ, 'v);'),
+      _expectId(main, SearchResultKind.INVOCATION, 'v();')
+    ];
+    await _verifyReferences(element, expected);
+  }
+
+  test_searchReferences_MethodElement() async {
+    await _resolveTestUnit('''
+class A {
+  m() {}
+  main() {
+    m(); // 1
+    this.m(); // 2
+    print(m); // 3
+    print(this.m); // 4
+  }
+}
+''');
+    MethodElement method = _findElement('m');
+    Element mainElement = _findElement('main');
+    var expected = [
+      _expectId(mainElement, SearchResultKind.INVOCATION, 'm(); // 1'),
+      _expectIdQ(mainElement, SearchResultKind.INVOCATION, 'm(); // 2'),
+      _expectId(mainElement, SearchResultKind.REFERENCE, 'm); // 3'),
+      _expectIdQ(mainElement, SearchResultKind.REFERENCE, 'm); // 4')
+    ];
+    await _verifyReferences(method, expected);
+  }
+
+  test_searchReferences_MethodMember() async {
+    await _resolveTestUnit('''
+class A<T> {
+  T m() => null;
+}
+main(A<int> a) {
+  a.m(); // ref
+}
+''');
+    MethodMember method = _findElementAtString('m(); // ref');
+    Element mainElement = _findElement('main');
+    var expected = [
+      _expectIdQ(mainElement, SearchResultKind.INVOCATION, 'm(); // ref')
+    ];
+    await _verifyReferences(method, expected);
+  }
+
+  test_searchReferences_ParameterElement_ofConstructor() async {
+    await _resolveTestUnit('''
+class C {
+  var f;
+  C({p}) : f = p + 1 {
+    p = 2;
+    p += 3;
+    print(p);
+    p();
+  }
+}
+main() {
+  new C(p: 42);
+}
+''');
+    ParameterElement element = _findElement('p');
+    ClassElement classC = _findElement('C');
+    ConstructorElement constructorA = classC.unnamedConstructor;
+    Element mainElement = _findElement('main');
+    var expected = [
+      _expectId(constructorA, SearchResultKind.READ, 'p + 1 {'),
+      _expectId(constructorA, SearchResultKind.WRITE, 'p = 2;'),
+      _expectId(constructorA, SearchResultKind.READ_WRITE, 'p += 3;'),
+      _expectId(constructorA, SearchResultKind.READ, 'p);'),
+      _expectId(constructorA, SearchResultKind.INVOCATION, 'p();'),
+      _expectIdQ(mainElement, SearchResultKind.REFERENCE, 'p: 42')
+    ];
+    await _verifyReferences(element, expected);
+  }
+
+  test_searchReferences_ParameterElement_ofLocalFunction() async {
+    await _resolveTestUnit('''
+main() {
+  foo({p}) {
+    p = 1;
+    p += 2;
+    print(p);
+    p();
+  }
+  foo(p: 42);
+}
+''');
+    ParameterElement element = _findElement('p');
+    Element fooElement = _findElement('foo');
+    Element mainElement = _findElement('main');
+    var expected = [
+      _expectId(fooElement, SearchResultKind.WRITE, 'p = 1;'),
+      _expectId(fooElement, SearchResultKind.READ_WRITE, 'p += 2;'),
+      _expectId(fooElement, SearchResultKind.READ, 'p);'),
+      _expectId(fooElement, SearchResultKind.INVOCATION, 'p();'),
+      _expectIdQ(mainElement, SearchResultKind.REFERENCE, 'p: 42')
+    ];
+    await _verifyReferences(element, expected);
+  }
+
+  test_searchReferences_ParameterElement_ofMethod() async {
+    await _resolveTestUnit('''
+class C {
+  foo({p}) {
+    p = 1;
+    p += 2;
+    print(p);
+    p();
+  }
+}
+main(C c) {
+  c.foo(p: 42);
+}
+''');
+    ParameterElement element = _findElement('p');
+    Element fooElement = _findElement('foo');
+    Element mainElement = _findElement('main');
+    var expected = [
+      _expectId(fooElement, SearchResultKind.WRITE, 'p = 1;'),
+      _expectId(fooElement, SearchResultKind.READ_WRITE, 'p += 2;'),
+      _expectId(fooElement, SearchResultKind.READ, 'p);'),
+      _expectId(fooElement, SearchResultKind.INVOCATION, 'p();'),
+      _expectIdQ(mainElement, SearchResultKind.REFERENCE, 'p: 42')
+    ];
+    await _verifyReferences(element, expected);
+  }
+
+  test_searchReferences_ParameterElement_ofTopLevelFunction() async {
+    await _resolveTestUnit('''
+foo({p}) {
+  p = 1;
+  p += 2;
+  print(p);
+  p();
+}
+main() {
+  foo(p: 42);
+}
+''');
+    ParameterElement element = _findElement('p');
+    Element fooElement = _findElement('foo');
+    Element mainElement = _findElement('main');
+    var expected = [
+      _expectId(fooElement, SearchResultKind.WRITE, 'p = 1;'),
+      _expectId(fooElement, SearchResultKind.READ_WRITE, 'p += 2;'),
+      _expectId(fooElement, SearchResultKind.READ, 'p);'),
+      _expectId(fooElement, SearchResultKind.INVOCATION, 'p();'),
+      _expectIdQ(mainElement, SearchResultKind.REFERENCE, 'p: 42')
+    ];
+    await _verifyReferences(element, expected);
+  }
+
+  test_searchReferences_PrefixElement() async {
+    String partCode = r'''
+part of my_lib;
+ppp.Future c;
+''';
+    provider.newFile(_p('$testProject/my_part.dart'), partCode);
+    await _resolveTestUnit('''
+library my_lib;
+import 'dart:async' as ppp;
+part 'my_part.dart';
+main() {
+  ppp.Future a;
+  ppp.Stream b;
+}
+''');
+    PrefixElement element = _findElementAtString('ppp;');
+    Element a = _findElement('a');
+    Element b = _findElement('b');
+    Element c = findChildElement(testLibraryElement, 'c');
+    var expected = [
+      _expectId(a, SearchResultKind.REFERENCE, 'ppp.Future'),
+      _expectId(b, SearchResultKind.REFERENCE, 'ppp.Stream'),
+      new ExpectedResult(c, SearchResultKind.REFERENCE,
+          partCode.indexOf('ppp.Future c'), 'ppp'.length)
+    ];
+    await _verifyReferences(element, expected);
+  }
+
+  test_searchReferences_PropertyAccessorElement_getter() async {
+    await _resolveTestUnit('''
+class A {
+  get ggg => null;
+  main() {
+    print(ggg); // ref-nq
+    print(this.ggg); // ref-q
+    ggg(); // inv-nq
+    this.ggg(); // inv-q
+  }
+}
+''');
+    PropertyAccessorElement element = _findElement('ggg', ElementKind.GETTER);
+    Element main = _findElement('main');
+    var expected = [
+      _expectId(main, SearchResultKind.REFERENCE, 'ggg); // ref-nq'),
+      _expectIdQ(main, SearchResultKind.REFERENCE, 'ggg); // ref-q'),
+      _expectId(main, SearchResultKind.INVOCATION, 'ggg(); // inv-nq'),
+      _expectIdQ(main, SearchResultKind.INVOCATION, 'ggg(); // inv-q'),
+    ];
+    await _verifyReferences(element, expected);
+  }
+
+  test_searchReferences_PropertyAccessorElement_setter() async {
+    await _resolveTestUnit('''
+class A {
+  set s(x) {}
+  main() {
+    s = 1;
+    this.s = 2;
+  }
+}
+''');
+    PropertyAccessorElement element = _findElement('s=');
+    Element mainElement = _findElement('main');
+    var expected = [
+      _expectId(mainElement, SearchResultKind.REFERENCE, 's = 1'),
+      _expectIdQ(mainElement, SearchResultKind.REFERENCE, 's = 2')
+    ];
+    await _verifyReferences(element, expected);
+  }
+
+  test_searchReferences_TopLevelVariableElement() async {
+    provider.newFile(
+        _p('$testProject/lib.dart'),
+        '''
+library lib;
+var V;
+''');
+    await _resolveTestUnit('''
+import 'lib.dart' show V; // imp
+import 'lib.dart' as pref;
+main() {
+  pref.V = 1; // q
+  print(pref.V); // q
+  pref.V(); // q
+  V = 1; // nq
+  print(V); // nq
+  V(); // nq
+}
+''');
+    ImportElement importElement = testLibraryElement.imports[0];
+    CompilationUnitElement impUnit =
+        importElement.importedLibrary.definingCompilationUnit;
+    TopLevelVariableElement variable = impUnit.topLevelVariables[0];
+    Element main = _findElement('main');
+    var expected = [
+      _expectIdQ(testUnitElement, SearchResultKind.REFERENCE, 'V; // imp'),
+      _expectIdQ(main, SearchResultKind.WRITE, 'V = 1; // q'),
+      _expectIdQ(main, SearchResultKind.READ, 'V); // q'),
+      _expectIdQ(main, SearchResultKind.INVOCATION, 'V(); // q'),
+      _expectId(main, SearchResultKind.WRITE, 'V = 1; // nq'),
+      _expectId(main, SearchResultKind.READ, 'V); // nq'),
+      _expectId(main, SearchResultKind.INVOCATION, 'V(); // nq'),
+    ];
+    await _verifyReferences(variable, expected);
+  }
+
+  test_searchReferences_TypeParameterElement_ofClass() async {
+    await _resolveTestUnit('''
+class A<T> {
+  foo(T a) {}
+  bar(T b) {}
+}
+''');
+    TypeParameterElement element = _findElement('T');
+    Element a = _findElement('a');
+    Element b = _findElement('b');
+    var expected = [
+      _expectId(a, SearchResultKind.REFERENCE, 'T a'),
+      _expectId(b, SearchResultKind.REFERENCE, 'T b'),
+    ];
+    await _verifyReferences(element, expected);
+  }
+
+  test_searchReferences_TypeParameterElement_ofLocalFunction() async {
+    await _resolveTestUnit('''
+main() {
+  void foo<T>(T a) {
+    void bar(T b) {}
+  }
+}
+''');
+    TypeParameterElement element = _findElement('T');
+    Element a = _findElement('a');
+    Element b = _findElement('b');
+    var expected = [
+      _expectId(a, SearchResultKind.REFERENCE, 'T a'),
+      _expectId(b, SearchResultKind.REFERENCE, 'T b'),
+    ];
+    await _verifyReferences(element, expected);
+  }
+
+  test_searchReferences_TypeParameterElement_ofMethod() async {
+    await _resolveTestUnit('''
+class A {
+  foo<T>(T p) {}
+}
+''');
+    TypeParameterElement element = _findElement('T');
+    Element p = _findElement('p');
+    var expected = [
+      _expectId(p, SearchResultKind.REFERENCE, 'T p'),
+    ];
+    await _verifyReferences(element, expected);
+  }
+
+  test_searchReferences_TypeParameterElement_ofTopLevelFunction() async {
+    await _resolveTestUnit('''
+foo<T>(T a) {
+  bar(T b) {}
+}
+''');
+    TypeParameterElement element = _findElement('T');
+    Element a = _findElement('a');
+    Element b = _findElement('b');
+    var expected = [
+      _expectId(a, SearchResultKind.REFERENCE, 'T a'),
+      _expectId(b, SearchResultKind.REFERENCE, 'T b'),
+    ];
+    await _verifyReferences(element, expected);
+  }
+
+  ExpectedResult _expectId(
+      Element enclosingElement, SearchResultKind kind, String search,
+      {int length, bool isResolved: true, bool isQualified: false}) {
+    int offset = findOffset(search);
+    if (length == null) {
+      length = getLeadingIdentifierLength(search);
+    }
+    return new ExpectedResult(enclosingElement, kind, offset, length,
+        isResolved: isResolved, isQualified: isQualified);
+  }
+
+  /**
+   * Create [ExpectedResult] for a qualified and resolved match.
+   */
+  ExpectedResult _expectIdQ(
+      Element element, SearchResultKind kind, String search,
+      {int length, bool isResolved: true}) {
+    return _expectId(element, kind, search, isQualified: true, length: length);
+  }
+
+  Element _findElement(String name, [ElementKind kind]) {
+    return findChildElement(testUnit.element, name, kind);
+  }
+
+  Element _findElementAtString(String search) {
+    int offset = findOffset(search);
+    AstNode node = new NodeLocator(offset).searchWithin(testUnit);
+    return ElementLocator.locate(node);
+  }
+
+  String _p(String path) => provider.convertPath(path);
+
+  Future<Null> _resolveTestUnit(String code) async {
+    addTestFile(code);
+    if (testUnit == null) {
+      AnalysisResult result = await driver.getResult(testFile);
+      testUnit = result.unit;
+      testUnitElement = testUnit.element;
+      testLibraryElement = testUnitElement.library;
+    }
+  }
+
+  Future _verifyReferences(
+      Element element, List<ExpectedResult> expectedMatches) async {
+    List<SearchResult> results = await driver.search.references(element);
+    _assertResults(results, expectedMatches);
+    expect(results, hasLength(expectedMatches.length));
+  }
+
+  static void _assertResults(
+      List<SearchResult> matches, List<ExpectedResult> expectedMatches) {
+    expect(matches, unorderedEquals(expectedMatches));
+  }
+}
diff --git a/pkg/analyzer/test/src/dart/analysis/test_all.dart b/pkg/analyzer/test/src/dart/analysis/test_all.dart
new file mode 100644
index 0000000..9abcfca
--- /dev/null
+++ b/pkg/analyzer/test/src/dart/analysis/test_all.dart
@@ -0,0 +1,26 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 analyzer.test.src.dart.analysis.test_all;
+
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'byte_store_test.dart' as byte_store;
+import 'driver_test.dart' as driver;
+import 'file_state_test.dart' as file_state;
+import 'index_test.dart' as index;
+import 'referenced_names_test.dart' as referenced_names;
+import 'search_test.dart' as search_test;
+
+/// Utility for manually running all tests.
+main() {
+  defineReflectiveSuite(() {
+    byte_store.main();
+    driver.main();
+    file_state.main();
+    index.main();
+    referenced_names.main();
+    search_test.main();
+  }, name: 'analysis');
+}
diff --git a/pkg/analyzer/test/src/dart/ast/test_all.dart b/pkg/analyzer/test/src/dart/ast/test_all.dart
index f0648c4..da75f77 100644
--- a/pkg/analyzer/test/src/dart/ast/test_all.dart
+++ b/pkg/analyzer/test/src/dart/ast/test_all.dart
@@ -4,15 +4,13 @@
 
 library analyzer.test.src.dart.ast.test_all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../../utils.dart';
 import 'utilities_test.dart' as utilities;
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('ast tests', () {
+  defineReflectiveSuite(() {
     utilities.main();
-  });
+  }, name: 'ast');
 }
diff --git a/pkg/analyzer/test/src/dart/ast/utilities_test.dart b/pkg/analyzer/test/src/dart/ast/utilities_test.dart
index a48fb6e..5a18e5f 100644
--- a/pkg/analyzer/test/src/dart/ast/utilities_test.dart
+++ b/pkg/analyzer/test/src/dart/ast/utilities_test.dart
@@ -13,23 +13,25 @@
 import 'package:analyzer/src/generated/java_core.dart';
 import 'package:analyzer/src/generated/java_engine.dart' show Predicate;
 import 'package:analyzer/src/generated/java_engine.dart';
-import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
 import 'package:analyzer/src/generated/testing/element_factory.dart';
 import 'package:analyzer/src/generated/testing/token_factory.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../../generated/parser_test.dart' show ParserTestCase;
 import '../../../generated/test_support.dart';
-import '../../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ConstantEvaluatorTest);
-  defineReflectiveTests(NodeLocatorTest);
-  defineReflectiveTests(NodeLocator2Test);
-  defineReflectiveTests(ResolutionCopierTest);
-  defineReflectiveTests(ToSourceVisitorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ConstantEvaluatorTest);
+    defineReflectiveTests(NodeLocatorTest);
+    defineReflectiveTests(NodeLocator2Test);
+    defineReflectiveTests(ResolutionCopierTest);
+    // ignore: deprecated_member_use
+    defineReflectiveTests(ToSourceVisitorTest);
+    defineReflectiveTests(ToSourceVisitor2Test);
+  });
 }
 
 @reflectiveTest
@@ -455,34 +457,34 @@
   void test_visitAnnotation() {
     String annotationName = "proxy";
     Annotation fromNode =
-        AstFactory.annotation(AstFactory.identifier3(annotationName));
+        AstTestFactory.annotation(AstTestFactory.identifier3(annotationName));
     Element element = ElementFactory.topLevelVariableElement2(annotationName);
     fromNode.element = element;
     Annotation toNode =
-        AstFactory.annotation(AstFactory.identifier3(annotationName));
+        AstTestFactory.annotation(AstTestFactory.identifier3(annotationName));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.element, same(element));
   }
 
   void test_visitAsExpression() {
-    AsExpression fromNode = AstFactory.asExpression(
-        AstFactory.identifier3("x"), AstFactory.typeName4("A"));
+    AsExpression fromNode = AstTestFactory.asExpression(
+        AstTestFactory.identifier3("x"), AstTestFactory.typeName4("A"));
     DartType propagatedType = ElementFactory.classElement2("A").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("B").type;
     fromNode.staticType = staticType;
-    AsExpression toNode = AstFactory.asExpression(
-        AstFactory.identifier3("x"), AstFactory.typeName4("A"));
+    AsExpression toNode = AstTestFactory.asExpression(
+        AstTestFactory.identifier3("x"), AstTestFactory.typeName4("A"));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
   }
 
   void test_visitAssignmentExpression() {
-    AssignmentExpression fromNode = AstFactory.assignmentExpression(
-        AstFactory.identifier3("a"),
+    AssignmentExpression fromNode = AstTestFactory.assignmentExpression(
+        AstTestFactory.identifier3("a"),
         TokenType.PLUS_EQ,
-        AstFactory.identifier3("b"));
+        AstTestFactory.identifier3("b"));
     DartType propagatedType = ElementFactory.classElement2("C").type;
     MethodElement propagatedElement =
         ElementFactory.methodElement("+", propagatedType);
@@ -492,10 +494,10 @@
     MethodElement staticElement = ElementFactory.methodElement("+", staticType);
     fromNode.staticElement = staticElement;
     fromNode.staticType = staticType;
-    AssignmentExpression toNode = AstFactory.assignmentExpression(
-        AstFactory.identifier3("a"),
+    AssignmentExpression toNode = AstTestFactory.assignmentExpression(
+        AstTestFactory.identifier3("a"),
         TokenType.PLUS_EQ,
-        AstFactory.identifier3("b"));
+        AstTestFactory.identifier3("b"));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedElement, same(propagatedElement));
     expect(toNode.propagatedType, same(propagatedType));
@@ -504,10 +506,10 @@
   }
 
   void test_visitBinaryExpression() {
-    BinaryExpression fromNode = AstFactory.binaryExpression(
-        AstFactory.identifier3("a"),
+    BinaryExpression fromNode = AstTestFactory.binaryExpression(
+        AstTestFactory.identifier3("a"),
         TokenType.PLUS,
-        AstFactory.identifier3("b"));
+        AstTestFactory.identifier3("b"));
     DartType propagatedType = ElementFactory.classElement2("C").type;
     MethodElement propagatedElement =
         ElementFactory.methodElement("+", propagatedType);
@@ -517,10 +519,10 @@
     MethodElement staticElement = ElementFactory.methodElement("+", staticType);
     fromNode.staticElement = staticElement;
     fromNode.staticType = staticType;
-    BinaryExpression toNode = AstFactory.binaryExpression(
-        AstFactory.identifier3("a"),
+    BinaryExpression toNode = AstTestFactory.binaryExpression(
+        AstTestFactory.identifier3("a"),
         TokenType.PLUS,
-        AstFactory.identifier3("b"));
+        AstTestFactory.identifier3("b"));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedElement, same(propagatedElement));
     expect(toNode.propagatedType, same(propagatedType));
@@ -529,54 +531,54 @@
   }
 
   void test_visitBooleanLiteral() {
-    BooleanLiteral fromNode = AstFactory.booleanLiteral(true);
+    BooleanLiteral fromNode = AstTestFactory.booleanLiteral(true);
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    BooleanLiteral toNode = AstFactory.booleanLiteral(true);
+    BooleanLiteral toNode = AstTestFactory.booleanLiteral(true);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
   }
 
   void test_visitCascadeExpression() {
-    CascadeExpression fromNode = AstFactory.cascadeExpression(
-        AstFactory.identifier3("a"), [AstFactory.identifier3("b")]);
+    CascadeExpression fromNode = AstTestFactory.cascadeExpression(
+        AstTestFactory.identifier3("a"), [AstTestFactory.identifier3("b")]);
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    CascadeExpression toNode = AstFactory.cascadeExpression(
-        AstFactory.identifier3("a"), [AstFactory.identifier3("b")]);
+    CascadeExpression toNode = AstTestFactory.cascadeExpression(
+        AstTestFactory.identifier3("a"), [AstTestFactory.identifier3("b")]);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
   }
 
   void test_visitCompilationUnit() {
-    CompilationUnit fromNode = AstFactory.compilationUnit();
+    CompilationUnit fromNode = AstTestFactory.compilationUnit();
     CompilationUnitElement element =
         new CompilationUnitElementImpl("test.dart");
     fromNode.element = element;
-    CompilationUnit toNode = AstFactory.compilationUnit();
+    CompilationUnit toNode = AstTestFactory.compilationUnit();
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.element, same(element));
   }
 
   void test_visitConditionalExpression() {
-    ConditionalExpression fromNode = AstFactory.conditionalExpression(
-        AstFactory.identifier3("c"),
-        AstFactory.identifier3("a"),
-        AstFactory.identifier3("b"));
+    ConditionalExpression fromNode = AstTestFactory.conditionalExpression(
+        AstTestFactory.identifier3("c"),
+        AstTestFactory.identifier3("a"),
+        AstTestFactory.identifier3("b"));
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    ConditionalExpression toNode = AstFactory.conditionalExpression(
-        AstFactory.identifier3("c"),
-        AstFactory.identifier3("a"),
-        AstFactory.identifier3("b"));
+    ConditionalExpression toNode = AstTestFactory.conditionalExpression(
+        AstTestFactory.identifier3("c"),
+        AstTestFactory.identifier3("a"),
+        AstTestFactory.identifier3("b"));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
@@ -585,18 +587,18 @@
   void test_visitConstructorDeclaration() {
     String className = "A";
     String constructorName = "c";
-    ConstructorDeclaration fromNode = AstFactory.constructorDeclaration(
-        AstFactory.identifier3(className),
+    ConstructorDeclaration fromNode = AstTestFactory.constructorDeclaration(
+        AstTestFactory.identifier3(className),
         constructorName,
-        AstFactory.formalParameterList(),
+        AstTestFactory.formalParameterList(),
         null);
     ConstructorElement element = ElementFactory.constructorElement2(
         ElementFactory.classElement2(className), constructorName);
     fromNode.element = element;
-    ConstructorDeclaration toNode = AstFactory.constructorDeclaration(
-        AstFactory.identifier3(className),
+    ConstructorDeclaration toNode = AstTestFactory.constructorDeclaration(
+        AstTestFactory.identifier3(className),
         constructorName,
-        AstFactory.formalParameterList(),
+        AstTestFactory.formalParameterList(),
         null);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.element, same(element));
@@ -604,40 +606,41 @@
 
   void test_visitConstructorName() {
     ConstructorName fromNode =
-        AstFactory.constructorName(AstFactory.typeName4("A"), "c");
+        AstTestFactory.constructorName(AstTestFactory.typeName4("A"), "c");
     ConstructorElement staticElement = ElementFactory.constructorElement2(
         ElementFactory.classElement2("A"), "c");
     fromNode.staticElement = staticElement;
     ConstructorName toNode =
-        AstFactory.constructorName(AstFactory.typeName4("A"), "c");
+        AstTestFactory.constructorName(AstTestFactory.typeName4("A"), "c");
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.staticElement, same(staticElement));
   }
 
   void test_visitDoubleLiteral() {
-    DoubleLiteral fromNode = AstFactory.doubleLiteral(1.0);
+    DoubleLiteral fromNode = AstTestFactory.doubleLiteral(1.0);
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    DoubleLiteral toNode = AstFactory.doubleLiteral(1.0);
+    DoubleLiteral toNode = AstTestFactory.doubleLiteral(1.0);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
   }
 
   void test_visitExportDirective() {
-    ExportDirective fromNode = AstFactory.exportDirective2("dart:uri");
+    ExportDirective fromNode = AstTestFactory.exportDirective2("dart:uri");
     ExportElement element = new ExportElementImpl(-1);
     fromNode.element = element;
-    ExportDirective toNode = AstFactory.exportDirective2("dart:uri");
+    ExportDirective toNode = AstTestFactory.exportDirective2("dart:uri");
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.element, same(element));
   }
 
   void test_visitFunctionExpression() {
-    FunctionExpression fromNode = AstFactory.functionExpression2(
-        AstFactory.formalParameterList(), AstFactory.emptyFunctionBody());
+    FunctionExpression fromNode = AstTestFactory.functionExpression2(
+        AstTestFactory.formalParameterList(),
+        AstTestFactory.emptyFunctionBody());
     MethodElement element = ElementFactory.methodElement(
         "m", ElementFactory.classElement2("C").type);
     fromNode.element = element;
@@ -645,8 +648,9 @@
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    FunctionExpression toNode = AstFactory.functionExpression2(
-        AstFactory.formalParameterList(), AstFactory.emptyFunctionBody());
+    FunctionExpression toNode = AstTestFactory.functionExpression2(
+        AstTestFactory.formalParameterList(),
+        AstTestFactory.emptyFunctionBody());
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.element, same(element));
     expect(toNode.propagatedType, same(propagatedType));
@@ -654,21 +658,21 @@
   }
 
   void test_visitFunctionExpressionInvocation() {
-    FunctionExpressionInvocation fromNode =
-        AstFactory.functionExpressionInvocation(AstFactory.identifier3("f"));
+    FunctionExpressionInvocation fromNode = AstTestFactory
+        .functionExpressionInvocation(AstTestFactory.identifier3("f"));
     MethodElement propagatedElement = ElementFactory.methodElement(
         "m", ElementFactory.classElement2("C").type);
     fromNode.propagatedElement = propagatedElement;
     MethodElement staticElement = ElementFactory.methodElement(
         "m", ElementFactory.classElement2("C").type);
     fromNode.staticElement = staticElement;
-    FunctionExpressionInvocation toNode =
-        AstFactory.functionExpressionInvocation(AstFactory.identifier3("f"));
+    FunctionExpressionInvocation toNode = AstTestFactory
+        .functionExpressionInvocation(AstTestFactory.identifier3("f"));
     ClassElement elementT = ElementFactory.classElement2('T');
-    fromNode.typeArguments =
-        AstFactory.typeArgumentList(<TypeName>[AstFactory.typeName(elementT)]);
-    toNode.typeArguments =
-        AstFactory.typeArgumentList(<TypeName>[AstFactory.typeName4('T')]);
+    fromNode.typeArguments = AstTestFactory
+        .typeArgumentList(<TypeName>[AstTestFactory.typeName(elementT)]);
+    toNode.typeArguments = AstTestFactory
+        .typeArgumentList(<TypeName>[AstTestFactory.typeName4('T')]);
 
     _copyAndVerifyInvocation(fromNode, toNode);
 
@@ -677,17 +681,18 @@
   }
 
   void test_visitImportDirective() {
-    ImportDirective fromNode = AstFactory.importDirective3("dart:uri", null);
+    ImportDirective fromNode =
+        AstTestFactory.importDirective3("dart:uri", null);
     ImportElement element = new ImportElementImpl(0);
     fromNode.element = element;
-    ImportDirective toNode = AstFactory.importDirective3("dart:uri", null);
+    ImportDirective toNode = AstTestFactory.importDirective3("dart:uri", null);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.element, same(element));
   }
 
   void test_visitIndexExpression() {
-    IndexExpression fromNode = AstFactory.indexExpression(
-        AstFactory.identifier3("a"), AstFactory.integer(0));
+    IndexExpression fromNode = AstTestFactory.indexExpression(
+        AstTestFactory.identifier3("a"), AstTestFactory.integer(0));
     MethodElement propagatedElement = ElementFactory.methodElement(
         "m", ElementFactory.classElement2("C").type);
     MethodElement staticElement = ElementFactory.methodElement(
@@ -701,8 +706,8 @@
     fromNode.staticElement = staticElement;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    IndexExpression toNode = AstFactory.indexExpression(
-        AstFactory.identifier3("a"), AstFactory.integer(0));
+    IndexExpression toNode = AstTestFactory.indexExpression(
+        AstTestFactory.identifier3("a"), AstTestFactory.integer(0));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.auxiliaryElements, same(auxiliaryElements));
     expect(toNode.propagatedElement, same(propagatedElement));
@@ -712,8 +717,9 @@
   }
 
   void test_visitInstanceCreationExpression() {
-    InstanceCreationExpression fromNode = AstFactory
-        .instanceCreationExpression2(Keyword.NEW, AstFactory.typeName4("C"));
+    InstanceCreationExpression fromNode =
+        AstTestFactory.instanceCreationExpression2(
+            Keyword.NEW, AstTestFactory.typeName4("C"));
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     ConstructorElement staticElement = ElementFactory.constructorElement2(
@@ -721,8 +727,9 @@
     fromNode.staticElement = staticElement;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    InstanceCreationExpression toNode = AstFactory.instanceCreationExpression2(
-        Keyword.NEW, AstFactory.typeName4("C"));
+    InstanceCreationExpression toNode =
+        AstTestFactory.instanceCreationExpression2(
+            Keyword.NEW, AstTestFactory.typeName4("C"));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticElement, same(staticElement));
@@ -730,26 +737,26 @@
   }
 
   void test_visitIntegerLiteral() {
-    IntegerLiteral fromNode = AstFactory.integer(2);
+    IntegerLiteral fromNode = AstTestFactory.integer(2);
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    IntegerLiteral toNode = AstFactory.integer(2);
+    IntegerLiteral toNode = AstTestFactory.integer(2);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
   }
 
   void test_visitIsExpression() {
-    IsExpression fromNode = AstFactory.isExpression(
-        AstFactory.identifier3("x"), false, AstFactory.typeName4("A"));
+    IsExpression fromNode = AstTestFactory.isExpression(
+        AstTestFactory.identifier3("x"), false, AstTestFactory.typeName4("A"));
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    IsExpression toNode = AstFactory.isExpression(
-        AstFactory.identifier3("x"), false, AstFactory.typeName4("A"));
+    IsExpression toNode = AstTestFactory.isExpression(
+        AstTestFactory.identifier3("x"), false, AstTestFactory.typeName4("A"));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
@@ -757,74 +764,74 @@
 
   void test_visitLibraryIdentifier() {
     LibraryIdentifier fromNode =
-        AstFactory.libraryIdentifier([AstFactory.identifier3("lib")]);
+        AstTestFactory.libraryIdentifier([AstTestFactory.identifier3("lib")]);
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     LibraryIdentifier toNode =
-        AstFactory.libraryIdentifier([AstFactory.identifier3("lib")]);
+        AstTestFactory.libraryIdentifier([AstTestFactory.identifier3("lib")]);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
   }
 
   void test_visitListLiteral() {
-    ListLiteral fromNode = AstFactory.listLiteral();
+    ListLiteral fromNode = AstTestFactory.listLiteral();
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    ListLiteral toNode = AstFactory.listLiteral();
+    ListLiteral toNode = AstTestFactory.listLiteral();
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
   }
 
   void test_visitMapLiteral() {
-    MapLiteral fromNode = AstFactory.mapLiteral2();
+    MapLiteral fromNode = AstTestFactory.mapLiteral2();
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    MapLiteral toNode = AstFactory.mapLiteral2();
+    MapLiteral toNode = AstTestFactory.mapLiteral2();
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
   }
 
   void test_visitMethodInvocation() {
-    MethodInvocation fromNode = AstFactory.methodInvocation2("m");
-    MethodInvocation toNode = AstFactory.methodInvocation2("m");
+    MethodInvocation fromNode = AstTestFactory.methodInvocation2("m");
+    MethodInvocation toNode = AstTestFactory.methodInvocation2("m");
     ClassElement elementT = ElementFactory.classElement2('T');
-    fromNode.typeArguments =
-        AstFactory.typeArgumentList(<TypeName>[AstFactory.typeName(elementT)]);
-    toNode.typeArguments =
-        AstFactory.typeArgumentList(<TypeName>[AstFactory.typeName4('T')]);
+    fromNode.typeArguments = AstTestFactory
+        .typeArgumentList(<TypeName>[AstTestFactory.typeName(elementT)]);
+    toNode.typeArguments = AstTestFactory
+        .typeArgumentList(<TypeName>[AstTestFactory.typeName4('T')]);
     _copyAndVerifyInvocation(fromNode, toNode);
   }
 
   void test_visitNamedExpression() {
     NamedExpression fromNode =
-        AstFactory.namedExpression2("n", AstFactory.integer(0));
+        AstTestFactory.namedExpression2("n", AstTestFactory.integer(0));
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     NamedExpression toNode =
-        AstFactory.namedExpression2("n", AstFactory.integer(0));
+        AstTestFactory.namedExpression2("n", AstTestFactory.integer(0));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
   }
 
   void test_visitNullLiteral() {
-    NullLiteral fromNode = AstFactory.nullLiteral();
+    NullLiteral fromNode = AstTestFactory.nullLiteral();
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    NullLiteral toNode = AstFactory.nullLiteral();
+    NullLiteral toNode = AstTestFactory.nullLiteral();
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
@@ -832,44 +839,44 @@
 
   void test_visitParenthesizedExpression() {
     ParenthesizedExpression fromNode =
-        AstFactory.parenthesizedExpression(AstFactory.integer(0));
+        AstTestFactory.parenthesizedExpression(AstTestFactory.integer(0));
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     ParenthesizedExpression toNode =
-        AstFactory.parenthesizedExpression(AstFactory.integer(0));
+        AstTestFactory.parenthesizedExpression(AstTestFactory.integer(0));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
   }
 
   void test_visitPartDirective() {
-    PartDirective fromNode = AstFactory.partDirective2("part.dart");
+    PartDirective fromNode = AstTestFactory.partDirective2("part.dart");
     LibraryElement element = new LibraryElementImpl.forNode(
-        null, AstFactory.libraryIdentifier2(["lib"]));
+        null, AstTestFactory.libraryIdentifier2(["lib"]));
     fromNode.element = element;
-    PartDirective toNode = AstFactory.partDirective2("part.dart");
+    PartDirective toNode = AstTestFactory.partDirective2("part.dart");
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.element, same(element));
   }
 
   void test_visitPartOfDirective() {
-    PartOfDirective fromNode =
-        AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["lib"]));
+    PartOfDirective fromNode = AstTestFactory
+        .partOfDirective(AstTestFactory.libraryIdentifier2(["lib"]));
     LibraryElement element = new LibraryElementImpl.forNode(
-        null, AstFactory.libraryIdentifier2(["lib"]));
+        null, AstTestFactory.libraryIdentifier2(["lib"]));
     fromNode.element = element;
-    PartOfDirective toNode =
-        AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["lib"]));
+    PartOfDirective toNode = AstTestFactory
+        .partOfDirective(AstTestFactory.libraryIdentifier2(["lib"]));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.element, same(element));
   }
 
   void test_visitPostfixExpression() {
     String variableName = "x";
-    PostfixExpression fromNode = AstFactory.postfixExpression(
-        AstFactory.identifier3(variableName), TokenType.PLUS_PLUS);
+    PostfixExpression fromNode = AstTestFactory.postfixExpression(
+        AstTestFactory.identifier3(variableName), TokenType.PLUS_PLUS);
     MethodElement propagatedElement = ElementFactory.methodElement(
         "+", ElementFactory.classElement2("C").type);
     fromNode.propagatedElement = propagatedElement;
@@ -880,8 +887,8 @@
     fromNode.staticElement = staticElement;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    PostfixExpression toNode = AstFactory.postfixExpression(
-        AstFactory.identifier3(variableName), TokenType.PLUS_PLUS);
+    PostfixExpression toNode = AstTestFactory.postfixExpression(
+        AstTestFactory.identifier3(variableName), TokenType.PLUS_PLUS);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedElement, same(propagatedElement));
     expect(toNode.propagatedType, same(propagatedType));
@@ -890,20 +897,20 @@
   }
 
   void test_visitPrefixedIdentifier() {
-    PrefixedIdentifier fromNode = AstFactory.identifier5("p", "f");
+    PrefixedIdentifier fromNode = AstTestFactory.identifier5("p", "f");
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    PrefixedIdentifier toNode = AstFactory.identifier5("p", "f");
+    PrefixedIdentifier toNode = AstTestFactory.identifier5("p", "f");
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
   }
 
   void test_visitPrefixExpression() {
-    PrefixExpression fromNode = AstFactory.prefixExpression(
-        TokenType.PLUS_PLUS, AstFactory.identifier3("x"));
+    PrefixExpression fromNode = AstTestFactory.prefixExpression(
+        TokenType.PLUS_PLUS, AstTestFactory.identifier3("x"));
     MethodElement propagatedElement = ElementFactory.methodElement(
         "+", ElementFactory.classElement2("C").type);
     DartType propagatedType = ElementFactory.classElement2("C").type;
@@ -914,8 +921,8 @@
         "+", ElementFactory.classElement2("C").type);
     fromNode.staticElement = staticElement;
     fromNode.staticType = staticType;
-    PrefixExpression toNode = AstFactory.prefixExpression(
-        TokenType.PLUS_PLUS, AstFactory.identifier3("x"));
+    PrefixExpression toNode = AstTestFactory.prefixExpression(
+        TokenType.PLUS_PLUS, AstTestFactory.identifier3("x"));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedElement, same(propagatedElement));
     expect(toNode.propagatedType, same(propagatedType));
@@ -925,13 +932,13 @@
 
   void test_visitPropertyAccess() {
     PropertyAccess fromNode =
-        AstFactory.propertyAccess2(AstFactory.identifier3("x"), "y");
+        AstTestFactory.propertyAccess2(AstTestFactory.identifier3("x"), "y");
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     PropertyAccess toNode =
-        AstFactory.propertyAccess2(AstFactory.identifier3("x"), "y");
+        AstTestFactory.propertyAccess2(AstTestFactory.identifier3("x"), "y");
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
@@ -939,30 +946,30 @@
 
   void test_visitRedirectingConstructorInvocation() {
     RedirectingConstructorInvocation fromNode =
-        AstFactory.redirectingConstructorInvocation();
+        AstTestFactory.redirectingConstructorInvocation();
     ConstructorElement staticElement = ElementFactory.constructorElement2(
         ElementFactory.classElement2("C"), null);
     fromNode.staticElement = staticElement;
     RedirectingConstructorInvocation toNode =
-        AstFactory.redirectingConstructorInvocation();
+        AstTestFactory.redirectingConstructorInvocation();
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.staticElement, same(staticElement));
   }
 
   void test_visitRethrowExpression() {
-    RethrowExpression fromNode = AstFactory.rethrowExpression();
+    RethrowExpression fromNode = AstTestFactory.rethrowExpression();
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    RethrowExpression toNode = AstFactory.rethrowExpression();
+    RethrowExpression toNode = AstTestFactory.rethrowExpression();
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
   }
 
   void test_visitSimpleIdentifier() {
-    SimpleIdentifier fromNode = AstFactory.identifier3("x");
+    SimpleIdentifier fromNode = AstTestFactory.identifier3("x");
     MethodElement propagatedElement = ElementFactory.methodElement(
         "m", ElementFactory.classElement2("C").type);
     MethodElement staticElement = ElementFactory.methodElement(
@@ -976,7 +983,7 @@
     fromNode.staticElement = staticElement;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    SimpleIdentifier toNode = AstFactory.identifier3("x");
+    SimpleIdentifier toNode = AstTestFactory.identifier3("x");
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.auxiliaryElements, same(auxiliaryElements));
     expect(toNode.propagatedElement, same(propagatedElement));
@@ -986,12 +993,12 @@
   }
 
   void test_visitSimpleStringLiteral() {
-    SimpleStringLiteral fromNode = AstFactory.string2("abc");
+    SimpleStringLiteral fromNode = AstTestFactory.string2("abc");
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    SimpleStringLiteral toNode = AstFactory.string2("abc");
+    SimpleStringLiteral toNode = AstTestFactory.string2("abc");
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
@@ -999,13 +1006,13 @@
 
   void test_visitStringInterpolation() {
     StringInterpolation fromNode =
-        AstFactory.string([AstFactory.interpolationString("a", "'a'")]);
+        AstTestFactory.string([AstTestFactory.interpolationString("a", "'a'")]);
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     StringInterpolation toNode =
-        AstFactory.string([AstFactory.interpolationString("a", "'a'")]);
+        AstTestFactory.string([AstTestFactory.interpolationString("a", "'a'")]);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
@@ -1013,68 +1020,69 @@
 
   void test_visitSuperConstructorInvocation() {
     SuperConstructorInvocation fromNode =
-        AstFactory.superConstructorInvocation();
+        AstTestFactory.superConstructorInvocation();
     ConstructorElement staticElement = ElementFactory.constructorElement2(
         ElementFactory.classElement2("C"), null);
     fromNode.staticElement = staticElement;
-    SuperConstructorInvocation toNode = AstFactory.superConstructorInvocation();
+    SuperConstructorInvocation toNode =
+        AstTestFactory.superConstructorInvocation();
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.staticElement, same(staticElement));
   }
 
   void test_visitSuperExpression() {
-    SuperExpression fromNode = AstFactory.superExpression();
+    SuperExpression fromNode = AstTestFactory.superExpression();
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    SuperExpression toNode = AstFactory.superExpression();
+    SuperExpression toNode = AstTestFactory.superExpression();
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
   }
 
   void test_visitSymbolLiteral() {
-    SymbolLiteral fromNode = AstFactory.symbolLiteral(["s"]);
+    SymbolLiteral fromNode = AstTestFactory.symbolLiteral(["s"]);
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    SymbolLiteral toNode = AstFactory.symbolLiteral(["s"]);
+    SymbolLiteral toNode = AstTestFactory.symbolLiteral(["s"]);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
   }
 
   void test_visitThisExpression() {
-    ThisExpression fromNode = AstFactory.thisExpression();
+    ThisExpression fromNode = AstTestFactory.thisExpression();
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    ThisExpression toNode = AstFactory.thisExpression();
+    ThisExpression toNode = AstTestFactory.thisExpression();
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
   }
 
   void test_visitThrowExpression() {
-    ThrowExpression fromNode = AstFactory.throwExpression();
+    ThrowExpression fromNode = AstTestFactory.throwExpression();
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    ThrowExpression toNode = AstFactory.throwExpression();
+    ThrowExpression toNode = AstTestFactory.throwExpression();
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
   }
 
   void test_visitTypeName() {
-    TypeName fromNode = AstFactory.typeName4("C");
+    TypeName fromNode = AstTestFactory.typeName4("C");
     DartType type = ElementFactory.classElement2("C").type;
     fromNode.type = type;
-    TypeName toNode = AstFactory.typeName4("C");
+    TypeName toNode = AstTestFactory.typeName4("C");
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.type, same(type));
   }
@@ -1109,250 +1117,261 @@
 }
 
 @reflectiveTest
-class ToSourceVisitorTest extends EngineTestCase {
+class ToSourceVisitor2Test extends EngineTestCase {
   void test_visitAdjacentStrings() {
     _assertSource(
         "'a' 'b'",
-        AstFactory.adjacentStrings(
-            [AstFactory.string2("a"), AstFactory.string2("b")]));
+        AstTestFactory.adjacentStrings(
+            [AstTestFactory.string2("a"), AstTestFactory.string2("b")]));
   }
 
   void test_visitAnnotation_constant() {
-    _assertSource("@A", AstFactory.annotation(AstFactory.identifier3("A")));
+    _assertSource(
+        "@A", AstTestFactory.annotation(AstTestFactory.identifier3("A")));
   }
 
   void test_visitAnnotation_constructor() {
     _assertSource(
         "@A.c()",
-        AstFactory.annotation2(AstFactory.identifier3("A"),
-            AstFactory.identifier3("c"), AstFactory.argumentList()));
+        AstTestFactory.annotation2(AstTestFactory.identifier3("A"),
+            AstTestFactory.identifier3("c"), AstTestFactory.argumentList()));
   }
 
   void test_visitArgumentList() {
     _assertSource(
         "(a, b)",
-        AstFactory.argumentList(
-            [AstFactory.identifier3("a"), AstFactory.identifier3("b")]));
+        AstTestFactory.argumentList([
+          AstTestFactory.identifier3("a"),
+          AstTestFactory.identifier3("b")
+        ]));
   }
 
   void test_visitAsExpression() {
     _assertSource(
         "e as T",
-        AstFactory.asExpression(
-            AstFactory.identifier3("e"), AstFactory.typeName4("T")));
+        AstTestFactory.asExpression(
+            AstTestFactory.identifier3("e"), AstTestFactory.typeName4("T")));
   }
 
   void test_visitAssertStatement() {
-    _assertSource(
-        "assert (a);", AstFactory.assertStatement(AstFactory.identifier3("a")));
+    _assertSource("assert (a);",
+        AstTestFactory.assertStatement(AstTestFactory.identifier3("a")));
   }
 
   void test_visitAssertStatement_withMessage() {
     _assertSource(
         "assert (a, b);",
-        AstFactory.assertStatement(
-            AstFactory.identifier3("a"), AstFactory.identifier3('b')));
+        AstTestFactory.assertStatement(
+            AstTestFactory.identifier3("a"), AstTestFactory.identifier3('b')));
   }
 
   void test_visitAssignmentExpression() {
     _assertSource(
         "a = b",
-        AstFactory.assignmentExpression(AstFactory.identifier3("a"),
-            TokenType.EQ, AstFactory.identifier3("b")));
+        AstTestFactory.assignmentExpression(AstTestFactory.identifier3("a"),
+            TokenType.EQ, AstTestFactory.identifier3("b")));
   }
 
   void test_visitAwaitExpression() {
-    _assertSource(
-        "await e", AstFactory.awaitExpression(AstFactory.identifier3("e")));
+    _assertSource("await e",
+        AstTestFactory.awaitExpression(AstTestFactory.identifier3("e")));
   }
 
   void test_visitBinaryExpression() {
     _assertSource(
         "a + b",
-        AstFactory.binaryExpression(AstFactory.identifier3("a"), TokenType.PLUS,
-            AstFactory.identifier3("b")));
+        AstTestFactory.binaryExpression(AstTestFactory.identifier3("a"),
+            TokenType.PLUS, AstTestFactory.identifier3("b")));
   }
 
   void test_visitBlock_empty() {
-    _assertSource("{}", AstFactory.block());
+    _assertSource("{}", AstTestFactory.block());
   }
 
   void test_visitBlock_nonEmpty() {
     _assertSource(
         "{break; break;}",
-        AstFactory
-            .block([AstFactory.breakStatement(), AstFactory.breakStatement()]));
+        AstTestFactory.block([
+          AstTestFactory.breakStatement(),
+          AstTestFactory.breakStatement()
+        ]));
   }
 
   void test_visitBlockFunctionBody_async() {
-    _assertSource("async {}", AstFactory.asyncBlockFunctionBody());
+    _assertSource("async {}", AstTestFactory.asyncBlockFunctionBody());
   }
 
   void test_visitBlockFunctionBody_async_star() {
-    _assertSource("async* {}", AstFactory.asyncGeneratorBlockFunctionBody());
+    _assertSource(
+        "async* {}", AstTestFactory.asyncGeneratorBlockFunctionBody());
   }
 
   void test_visitBlockFunctionBody_simple() {
-    _assertSource("{}", AstFactory.blockFunctionBody2());
+    _assertSource("{}", AstTestFactory.blockFunctionBody2());
   }
 
   void test_visitBlockFunctionBody_sync() {
-    _assertSource("sync {}", AstFactory.syncBlockFunctionBody());
+    _assertSource("sync {}", AstTestFactory.syncBlockFunctionBody());
   }
 
   void test_visitBlockFunctionBody_sync_star() {
-    _assertSource("sync* {}", AstFactory.syncGeneratorBlockFunctionBody());
+    _assertSource("sync* {}", AstTestFactory.syncGeneratorBlockFunctionBody());
   }
 
   void test_visitBooleanLiteral_false() {
-    _assertSource("false", AstFactory.booleanLiteral(false));
+    _assertSource("false", AstTestFactory.booleanLiteral(false));
   }
 
   void test_visitBooleanLiteral_true() {
-    _assertSource("true", AstFactory.booleanLiteral(true));
+    _assertSource("true", AstTestFactory.booleanLiteral(true));
   }
 
   void test_visitBreakStatement_label() {
-    _assertSource("break l;", AstFactory.breakStatement2("l"));
+    _assertSource("break l;", AstTestFactory.breakStatement2("l"));
   }
 
   void test_visitBreakStatement_noLabel() {
-    _assertSource("break;", AstFactory.breakStatement());
+    _assertSource("break;", AstTestFactory.breakStatement());
   }
 
   void test_visitCascadeExpression_field() {
     _assertSource(
         "a..b..c",
-        AstFactory.cascadeExpression(AstFactory.identifier3("a"), [
-          AstFactory.cascadedPropertyAccess("b"),
-          AstFactory.cascadedPropertyAccess("c")
+        AstTestFactory.cascadeExpression(AstTestFactory.identifier3("a"), [
+          AstTestFactory.cascadedPropertyAccess("b"),
+          AstTestFactory.cascadedPropertyAccess("c")
         ]));
   }
 
   void test_visitCascadeExpression_index() {
     _assertSource(
         "a..[0]..[1]",
-        AstFactory.cascadeExpression(AstFactory.identifier3("a"), [
-          AstFactory.cascadedIndexExpression(AstFactory.integer(0)),
-          AstFactory.cascadedIndexExpression(AstFactory.integer(1))
+        AstTestFactory.cascadeExpression(AstTestFactory.identifier3("a"), [
+          AstTestFactory.cascadedIndexExpression(AstTestFactory.integer(0)),
+          AstTestFactory.cascadedIndexExpression(AstTestFactory.integer(1))
         ]));
   }
 
   void test_visitCascadeExpression_method() {
     _assertSource(
         "a..b()..c()",
-        AstFactory.cascadeExpression(AstFactory.identifier3("a"), [
-          AstFactory.cascadedMethodInvocation("b"),
-          AstFactory.cascadedMethodInvocation("c")
+        AstTestFactory.cascadeExpression(AstTestFactory.identifier3("a"), [
+          AstTestFactory.cascadedMethodInvocation("b"),
+          AstTestFactory.cascadedMethodInvocation("c")
         ]));
   }
 
   void test_visitCatchClause_catch_noStack() {
-    _assertSource("catch (e) {}", AstFactory.catchClause("e"));
+    _assertSource("catch (e) {}", AstTestFactory.catchClause("e"));
   }
 
   void test_visitCatchClause_catch_stack() {
-    _assertSource("catch (e, s) {}", AstFactory.catchClause2("e", "s"));
+    _assertSource("catch (e, s) {}", AstTestFactory.catchClause2("e", "s"));
   }
 
   void test_visitCatchClause_on() {
     _assertSource(
-        "on E {}", AstFactory.catchClause3(AstFactory.typeName4("E")));
+        "on E {}", AstTestFactory.catchClause3(AstTestFactory.typeName4("E")));
   }
 
   void test_visitCatchClause_on_catch() {
     _assertSource("on E catch (e) {}",
-        AstFactory.catchClause4(AstFactory.typeName4("E"), "e"));
+        AstTestFactory.catchClause4(AstTestFactory.typeName4("E"), "e"));
   }
 
   void test_visitClassDeclaration_abstract() {
     _assertSource(
         "abstract class C {}",
-        AstFactory.classDeclaration(
+        AstTestFactory.classDeclaration(
             Keyword.ABSTRACT, "C", null, null, null, null));
   }
 
   void test_visitClassDeclaration_empty() {
     _assertSource("class C {}",
-        AstFactory.classDeclaration(null, "C", null, null, null, null));
+        AstTestFactory.classDeclaration(null, "C", null, null, null, null));
   }
 
   void test_visitClassDeclaration_extends() {
     _assertSource(
         "class C extends A {}",
-        AstFactory.classDeclaration(null, "C", null,
-            AstFactory.extendsClause(AstFactory.typeName4("A")), null, null));
+        AstTestFactory.classDeclaration(
+            null,
+            "C",
+            null,
+            AstTestFactory.extendsClause(AstTestFactory.typeName4("A")),
+            null,
+            null));
   }
 
   void test_visitClassDeclaration_extends_implements() {
     _assertSource(
         "class C extends A implements B {}",
-        AstFactory.classDeclaration(
+        AstTestFactory.classDeclaration(
             null,
             "C",
             null,
-            AstFactory.extendsClause(AstFactory.typeName4("A")),
+            AstTestFactory.extendsClause(AstTestFactory.typeName4("A")),
             null,
-            AstFactory.implementsClause([AstFactory.typeName4("B")])));
+            AstTestFactory.implementsClause([AstTestFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_extends_with() {
     _assertSource(
         "class C extends A with M {}",
-        AstFactory.classDeclaration(
+        AstTestFactory.classDeclaration(
             null,
             "C",
             null,
-            AstFactory.extendsClause(AstFactory.typeName4("A")),
-            AstFactory.withClause([AstFactory.typeName4("M")]),
+            AstTestFactory.extendsClause(AstTestFactory.typeName4("A")),
+            AstTestFactory.withClause([AstTestFactory.typeName4("M")]),
             null));
   }
 
   void test_visitClassDeclaration_extends_with_implements() {
     _assertSource(
         "class C extends A with M implements B {}",
-        AstFactory.classDeclaration(
+        AstTestFactory.classDeclaration(
             null,
             "C",
             null,
-            AstFactory.extendsClause(AstFactory.typeName4("A")),
-            AstFactory.withClause([AstFactory.typeName4("M")]),
-            AstFactory.implementsClause([AstFactory.typeName4("B")])));
+            AstTestFactory.extendsClause(AstTestFactory.typeName4("A")),
+            AstTestFactory.withClause([AstTestFactory.typeName4("M")]),
+            AstTestFactory.implementsClause([AstTestFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_implements() {
     _assertSource(
         "class C implements B {}",
-        AstFactory.classDeclaration(null, "C", null, null, null,
-            AstFactory.implementsClause([AstFactory.typeName4("B")])));
+        AstTestFactory.classDeclaration(null, "C", null, null, null,
+            AstTestFactory.implementsClause([AstTestFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_multipleMember() {
     _assertSource(
         "class C {var a; var b;}",
-        AstFactory.classDeclaration(null, "C", null, null, null, null, [
-          AstFactory.fieldDeclaration2(
-              false, Keyword.VAR, [AstFactory.variableDeclaration("a")]),
-          AstFactory.fieldDeclaration2(
-              false, Keyword.VAR, [AstFactory.variableDeclaration("b")])
+        AstTestFactory.classDeclaration(null, "C", null, null, null, null, [
+          AstTestFactory.fieldDeclaration2(
+              false, Keyword.VAR, [AstTestFactory.variableDeclaration("a")]),
+          AstTestFactory.fieldDeclaration2(
+              false, Keyword.VAR, [AstTestFactory.variableDeclaration("b")])
         ]));
   }
 
   void test_visitClassDeclaration_parameters() {
     _assertSource(
         "class C<E> {}",
-        AstFactory.classDeclaration(
-            null, "C", AstFactory.typeParameterList(["E"]), null, null, null));
+        AstTestFactory.classDeclaration(null, "C",
+            AstTestFactory.typeParameterList(["E"]), null, null, null));
   }
 
   void test_visitClassDeclaration_parameters_extends() {
     _assertSource(
         "class C<E> extends A {}",
-        AstFactory.classDeclaration(
+        AstTestFactory.classDeclaration(
             null,
             "C",
-            AstFactory.typeParameterList(["E"]),
-            AstFactory.extendsClause(AstFactory.typeName4("A")),
+            AstTestFactory.typeParameterList(["E"]),
+            AstTestFactory.extendsClause(AstTestFactory.typeName4("A")),
             null,
             null));
   }
@@ -1360,102 +1379,102 @@
   void test_visitClassDeclaration_parameters_extends_implements() {
     _assertSource(
         "class C<E> extends A implements B {}",
-        AstFactory.classDeclaration(
+        AstTestFactory.classDeclaration(
             null,
             "C",
-            AstFactory.typeParameterList(["E"]),
-            AstFactory.extendsClause(AstFactory.typeName4("A")),
+            AstTestFactory.typeParameterList(["E"]),
+            AstTestFactory.extendsClause(AstTestFactory.typeName4("A")),
             null,
-            AstFactory.implementsClause([AstFactory.typeName4("B")])));
+            AstTestFactory.implementsClause([AstTestFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_parameters_extends_with() {
     _assertSource(
         "class C<E> extends A with M {}",
-        AstFactory.classDeclaration(
+        AstTestFactory.classDeclaration(
             null,
             "C",
-            AstFactory.typeParameterList(["E"]),
-            AstFactory.extendsClause(AstFactory.typeName4("A")),
-            AstFactory.withClause([AstFactory.typeName4("M")]),
+            AstTestFactory.typeParameterList(["E"]),
+            AstTestFactory.extendsClause(AstTestFactory.typeName4("A")),
+            AstTestFactory.withClause([AstTestFactory.typeName4("M")]),
             null));
   }
 
   void test_visitClassDeclaration_parameters_extends_with_implements() {
     _assertSource(
         "class C<E> extends A with M implements B {}",
-        AstFactory.classDeclaration(
+        AstTestFactory.classDeclaration(
             null,
             "C",
-            AstFactory.typeParameterList(["E"]),
-            AstFactory.extendsClause(AstFactory.typeName4("A")),
-            AstFactory.withClause([AstFactory.typeName4("M")]),
-            AstFactory.implementsClause([AstFactory.typeName4("B")])));
+            AstTestFactory.typeParameterList(["E"]),
+            AstTestFactory.extendsClause(AstTestFactory.typeName4("A")),
+            AstTestFactory.withClause([AstTestFactory.typeName4("M")]),
+            AstTestFactory.implementsClause([AstTestFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_parameters_implements() {
     _assertSource(
         "class C<E> implements B {}",
-        AstFactory.classDeclaration(
+        AstTestFactory.classDeclaration(
             null,
             "C",
-            AstFactory.typeParameterList(["E"]),
+            AstTestFactory.typeParameterList(["E"]),
             null,
             null,
-            AstFactory.implementsClause([AstFactory.typeName4("B")])));
+            AstTestFactory.implementsClause([AstTestFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_singleMember() {
     _assertSource(
         "class C {var a;}",
-        AstFactory.classDeclaration(null, "C", null, null, null, null, [
-          AstFactory.fieldDeclaration2(
-              false, Keyword.VAR, [AstFactory.variableDeclaration("a")])
+        AstTestFactory.classDeclaration(null, "C", null, null, null, null, [
+          AstTestFactory.fieldDeclaration2(
+              false, Keyword.VAR, [AstTestFactory.variableDeclaration("a")])
         ]));
   }
 
   void test_visitClassDeclaration_withMetadata() {
     ClassDeclaration declaration =
-        AstFactory.classDeclaration(null, "C", null, null, null, null);
-    declaration.metadata
-        .add(AstFactory.annotation(AstFactory.identifier3("deprecated")));
+        AstTestFactory.classDeclaration(null, "C", null, null, null, null);
+    declaration.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
     _assertSource("@deprecated class C {}", declaration);
   }
 
   void test_visitClassTypeAlias_abstract() {
     _assertSource(
         "abstract class C = S with M1;",
-        AstFactory.classTypeAlias(
+        AstTestFactory.classTypeAlias(
             "C",
             null,
             Keyword.ABSTRACT,
-            AstFactory.typeName4("S"),
-            AstFactory.withClause([AstFactory.typeName4("M1")]),
+            AstTestFactory.typeName4("S"),
+            AstTestFactory.withClause([AstTestFactory.typeName4("M1")]),
             null));
   }
 
   void test_visitClassTypeAlias_abstract_implements() {
     _assertSource(
         "abstract class C = S with M1 implements I;",
-        AstFactory.classTypeAlias(
+        AstTestFactory.classTypeAlias(
             "C",
             null,
             Keyword.ABSTRACT,
-            AstFactory.typeName4("S"),
-            AstFactory.withClause([AstFactory.typeName4("M1")]),
-            AstFactory.implementsClause([AstFactory.typeName4("I")])));
+            AstTestFactory.typeName4("S"),
+            AstTestFactory.withClause([AstTestFactory.typeName4("M1")]),
+            AstTestFactory.implementsClause([AstTestFactory.typeName4("I")])));
   }
 
   void test_visitClassTypeAlias_generic() {
     _assertSource(
         "class C<E> = S<E> with M1<E>;",
-        AstFactory.classTypeAlias(
+        AstTestFactory.classTypeAlias(
             "C",
-            AstFactory.typeParameterList(["E"]),
+            AstTestFactory.typeParameterList(["E"]),
             null,
-            AstFactory.typeName4("S", [AstFactory.typeName4("E")]),
-            AstFactory.withClause([
-              AstFactory.typeName4("M1", [AstFactory.typeName4("E")])
+            AstTestFactory.typeName4("S", [AstTestFactory.typeName4("E")]),
+            AstTestFactory.withClause([
+              AstTestFactory.typeName4("M1", [AstTestFactory.typeName4("E")])
             ]),
             null));
   }
@@ -1463,68 +1482,73 @@
   void test_visitClassTypeAlias_implements() {
     _assertSource(
         "class C = S with M1 implements I;",
-        AstFactory.classTypeAlias(
+        AstTestFactory.classTypeAlias(
             "C",
             null,
             null,
-            AstFactory.typeName4("S"),
-            AstFactory.withClause([AstFactory.typeName4("M1")]),
-            AstFactory.implementsClause([AstFactory.typeName4("I")])));
+            AstTestFactory.typeName4("S"),
+            AstTestFactory.withClause([AstTestFactory.typeName4("M1")]),
+            AstTestFactory.implementsClause([AstTestFactory.typeName4("I")])));
   }
 
   void test_visitClassTypeAlias_minimal() {
     _assertSource(
         "class C = S with M1;",
-        AstFactory.classTypeAlias("C", null, null, AstFactory.typeName4("S"),
-            AstFactory.withClause([AstFactory.typeName4("M1")]), null));
+        AstTestFactory.classTypeAlias(
+            "C",
+            null,
+            null,
+            AstTestFactory.typeName4("S"),
+            AstTestFactory.withClause([AstTestFactory.typeName4("M1")]),
+            null));
   }
 
   void test_visitClassTypeAlias_parameters_abstract() {
     _assertSource(
         "abstract class C<E> = S with M1;",
-        AstFactory.classTypeAlias(
+        AstTestFactory.classTypeAlias(
             "C",
-            AstFactory.typeParameterList(["E"]),
+            AstTestFactory.typeParameterList(["E"]),
             Keyword.ABSTRACT,
-            AstFactory.typeName4("S"),
-            AstFactory.withClause([AstFactory.typeName4("M1")]),
+            AstTestFactory.typeName4("S"),
+            AstTestFactory.withClause([AstTestFactory.typeName4("M1")]),
             null));
   }
 
   void test_visitClassTypeAlias_parameters_abstract_implements() {
     _assertSource(
         "abstract class C<E> = S with M1 implements I;",
-        AstFactory.classTypeAlias(
+        AstTestFactory.classTypeAlias(
             "C",
-            AstFactory.typeParameterList(["E"]),
+            AstTestFactory.typeParameterList(["E"]),
             Keyword.ABSTRACT,
-            AstFactory.typeName4("S"),
-            AstFactory.withClause([AstFactory.typeName4("M1")]),
-            AstFactory.implementsClause([AstFactory.typeName4("I")])));
+            AstTestFactory.typeName4("S"),
+            AstTestFactory.withClause([AstTestFactory.typeName4("M1")]),
+            AstTestFactory.implementsClause([AstTestFactory.typeName4("I")])));
   }
 
   void test_visitClassTypeAlias_parameters_implements() {
     _assertSource(
         "class C<E> = S with M1 implements I;",
-        AstFactory.classTypeAlias(
+        AstTestFactory.classTypeAlias(
             "C",
-            AstFactory.typeParameterList(["E"]),
+            AstTestFactory.typeParameterList(["E"]),
             null,
-            AstFactory.typeName4("S"),
-            AstFactory.withClause([AstFactory.typeName4("M1")]),
-            AstFactory.implementsClause([AstFactory.typeName4("I")])));
+            AstTestFactory.typeName4("S"),
+            AstTestFactory.withClause([AstTestFactory.typeName4("M1")]),
+            AstTestFactory.implementsClause([AstTestFactory.typeName4("I")])));
   }
 
   void test_visitClassTypeAlias_withMetadata() {
-    ClassTypeAlias declaration = AstFactory.classTypeAlias(
+    ClassTypeAlias declaration = AstTestFactory.classTypeAlias(
         "C",
         null,
         null,
-        AstFactory.typeName4("S"),
-        AstFactory.withClause([AstFactory.typeName4("M1")]),
+        AstTestFactory.typeName4("S"),
+        AstTestFactory.withClause([AstTestFactory.typeName4("M1")]),
         null);
-    declaration.metadata
-        .add(AstFactory.annotation(AstFactory.identifier3("deprecated")));
+    declaration.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
     _assertSource("@deprecated class C = S with M1;", declaration);
   }
 
@@ -1536,374 +1560,388 @@
   }
 
   void test_visitCommentReference() {
-    _assertSource("", new CommentReference(null, AstFactory.identifier3("a")));
+    _assertSource(
+        "", new CommentReference(null, AstTestFactory.identifier3("a")));
   }
 
   void test_visitCompilationUnit_declaration() {
     _assertSource(
         "var a;",
-        AstFactory.compilationUnit2([
-          AstFactory.topLevelVariableDeclaration2(
-              Keyword.VAR, [AstFactory.variableDeclaration("a")])
+        AstTestFactory.compilationUnit2([
+          AstTestFactory.topLevelVariableDeclaration2(
+              Keyword.VAR, [AstTestFactory.variableDeclaration("a")])
         ]));
   }
 
   void test_visitCompilationUnit_directive() {
-    _assertSource("library l;",
-        AstFactory.compilationUnit3([AstFactory.libraryDirective2("l")]));
+    _assertSource(
+        "library l;",
+        AstTestFactory
+            .compilationUnit3([AstTestFactory.libraryDirective2("l")]));
   }
 
   void test_visitCompilationUnit_directive_declaration() {
     _assertSource(
         "library l; var a;",
-        AstFactory.compilationUnit4([
-          AstFactory.libraryDirective2("l")
+        AstTestFactory.compilationUnit4([
+          AstTestFactory.libraryDirective2("l")
         ], [
-          AstFactory.topLevelVariableDeclaration2(
-              Keyword.VAR, [AstFactory.variableDeclaration("a")])
+          AstTestFactory.topLevelVariableDeclaration2(
+              Keyword.VAR, [AstTestFactory.variableDeclaration("a")])
         ]));
   }
 
   void test_visitCompilationUnit_empty() {
-    _assertSource("", AstFactory.compilationUnit());
+    _assertSource("", AstTestFactory.compilationUnit());
   }
 
   void test_visitCompilationUnit_script() {
     _assertSource(
-        "!#/bin/dartvm", AstFactory.compilationUnit5("!#/bin/dartvm"));
+        "!#/bin/dartvm", AstTestFactory.compilationUnit5("!#/bin/dartvm"));
   }
 
   void test_visitCompilationUnit_script_declaration() {
     _assertSource(
         "!#/bin/dartvm var a;",
-        AstFactory.compilationUnit6("!#/bin/dartvm", [
-          AstFactory.topLevelVariableDeclaration2(
-              Keyword.VAR, [AstFactory.variableDeclaration("a")])
+        AstTestFactory.compilationUnit6("!#/bin/dartvm", [
+          AstTestFactory.topLevelVariableDeclaration2(
+              Keyword.VAR, [AstTestFactory.variableDeclaration("a")])
         ]));
   }
 
   void test_visitCompilationUnit_script_directive() {
     _assertSource(
         "!#/bin/dartvm library l;",
-        AstFactory.compilationUnit7(
-            "!#/bin/dartvm", [AstFactory.libraryDirective2("l")]));
+        AstTestFactory.compilationUnit7(
+            "!#/bin/dartvm", [AstTestFactory.libraryDirective2("l")]));
   }
 
   void test_visitCompilationUnit_script_directives_declarations() {
     _assertSource(
         "!#/bin/dartvm library l; var a;",
-        AstFactory.compilationUnit8("!#/bin/dartvm", [
-          AstFactory.libraryDirective2("l")
+        AstTestFactory.compilationUnit8("!#/bin/dartvm", [
+          AstTestFactory.libraryDirective2("l")
         ], [
-          AstFactory.topLevelVariableDeclaration2(
-              Keyword.VAR, [AstFactory.variableDeclaration("a")])
+          AstTestFactory.topLevelVariableDeclaration2(
+              Keyword.VAR, [AstTestFactory.variableDeclaration("a")])
         ]));
   }
 
   void test_visitConditionalExpression() {
     _assertSource(
         "a ? b : c",
-        AstFactory.conditionalExpression(AstFactory.identifier3("a"),
-            AstFactory.identifier3("b"), AstFactory.identifier3("c")));
+        AstTestFactory.conditionalExpression(AstTestFactory.identifier3("a"),
+            AstTestFactory.identifier3("b"), AstTestFactory.identifier3("c")));
   }
 
   void test_visitConstructorDeclaration_const() {
     _assertSource(
         "const C() {}",
-        AstFactory.constructorDeclaration2(
+        AstTestFactory.constructorDeclaration2(
             Keyword.CONST,
             null,
-            AstFactory.identifier3("C"),
+            AstTestFactory.identifier3("C"),
             null,
-            AstFactory.formalParameterList(),
+            AstTestFactory.formalParameterList(),
             null,
-            AstFactory.blockFunctionBody2()));
+            AstTestFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_external() {
     _assertSource(
         "external C();",
-        AstFactory.constructorDeclaration(AstFactory.identifier3("C"), null,
-            AstFactory.formalParameterList(), null));
+        AstTestFactory.constructorDeclaration(AstTestFactory.identifier3("C"),
+            null, AstTestFactory.formalParameterList(), null));
   }
 
   void test_visitConstructorDeclaration_minimal() {
     _assertSource(
         "C() {}",
-        AstFactory.constructorDeclaration2(
+        AstTestFactory.constructorDeclaration2(
             null,
             null,
-            AstFactory.identifier3("C"),
+            AstTestFactory.identifier3("C"),
             null,
-            AstFactory.formalParameterList(),
+            AstTestFactory.formalParameterList(),
             null,
-            AstFactory.blockFunctionBody2()));
+            AstTestFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_multipleInitializers() {
     _assertSource(
         "C() : a = b, c = d {}",
-        AstFactory.constructorDeclaration2(
+        AstTestFactory.constructorDeclaration2(
             null,
             null,
-            AstFactory.identifier3("C"),
+            AstTestFactory.identifier3("C"),
             null,
-            AstFactory.formalParameterList(),
+            AstTestFactory.formalParameterList(),
             [
-              AstFactory.constructorFieldInitializer(
-                  false, "a", AstFactory.identifier3("b")),
-              AstFactory.constructorFieldInitializer(
-                  false, "c", AstFactory.identifier3("d"))
+              AstTestFactory.constructorFieldInitializer(
+                  false, "a", AstTestFactory.identifier3("b")),
+              AstTestFactory.constructorFieldInitializer(
+                  false, "c", AstTestFactory.identifier3("d"))
             ],
-            AstFactory.blockFunctionBody2()));
+            AstTestFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_multipleParameters() {
     _assertSource(
         "C(var a, var b) {}",
-        AstFactory.constructorDeclaration2(
+        AstTestFactory.constructorDeclaration2(
             null,
             null,
-            AstFactory.identifier3("C"),
+            AstTestFactory.identifier3("C"),
             null,
-            AstFactory.formalParameterList([
-              AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
-              AstFactory.simpleFormalParameter(Keyword.VAR, "b")
+            AstTestFactory.formalParameterList([
+              AstTestFactory.simpleFormalParameter(Keyword.VAR, "a"),
+              AstTestFactory.simpleFormalParameter(Keyword.VAR, "b")
             ]),
             null,
-            AstFactory.blockFunctionBody2()));
+            AstTestFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_named() {
     _assertSource(
         "C.m() {}",
-        AstFactory.constructorDeclaration2(
+        AstTestFactory.constructorDeclaration2(
             null,
             null,
-            AstFactory.identifier3("C"),
+            AstTestFactory.identifier3("C"),
             "m",
-            AstFactory.formalParameterList(),
+            AstTestFactory.formalParameterList(),
             null,
-            AstFactory.blockFunctionBody2()));
+            AstTestFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_singleInitializer() {
     _assertSource(
         "C() : a = b {}",
-        AstFactory.constructorDeclaration2(
+        AstTestFactory.constructorDeclaration2(
             null,
             null,
-            AstFactory.identifier3("C"),
+            AstTestFactory.identifier3("C"),
             null,
-            AstFactory.formalParameterList(),
+            AstTestFactory.formalParameterList(),
             [
-              AstFactory.constructorFieldInitializer(
-                  false, "a", AstFactory.identifier3("b"))
+              AstTestFactory.constructorFieldInitializer(
+                  false, "a", AstTestFactory.identifier3("b"))
             ],
-            AstFactory.blockFunctionBody2()));
+            AstTestFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_withMetadata() {
-    ConstructorDeclaration declaration = AstFactory.constructorDeclaration2(
+    ConstructorDeclaration declaration = AstTestFactory.constructorDeclaration2(
         null,
         null,
-        AstFactory.identifier3("C"),
+        AstTestFactory.identifier3("C"),
         null,
-        AstFactory.formalParameterList(),
+        AstTestFactory.formalParameterList(),
         null,
-        AstFactory.blockFunctionBody2());
-    declaration.metadata
-        .add(AstFactory.annotation(AstFactory.identifier3("deprecated")));
+        AstTestFactory.blockFunctionBody2());
+    declaration.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
     _assertSource("@deprecated C() {}", declaration);
   }
 
   void test_visitConstructorFieldInitializer_withoutThis() {
     _assertSource(
         "a = b",
-        AstFactory.constructorFieldInitializer(
-            false, "a", AstFactory.identifier3("b")));
+        AstTestFactory.constructorFieldInitializer(
+            false, "a", AstTestFactory.identifier3("b")));
   }
 
   void test_visitConstructorFieldInitializer_withThis() {
     _assertSource(
         "this.a = b",
-        AstFactory.constructorFieldInitializer(
-            true, "a", AstFactory.identifier3("b")));
+        AstTestFactory.constructorFieldInitializer(
+            true, "a", AstTestFactory.identifier3("b")));
   }
 
   void test_visitConstructorName_named_prefix() {
-    _assertSource("p.C.n",
-        AstFactory.constructorName(AstFactory.typeName4("p.C.n"), null));
+    _assertSource(
+        "p.C.n",
+        AstTestFactory.constructorName(
+            AstTestFactory.typeName4("p.C.n"), null));
   }
 
   void test_visitConstructorName_unnamed_noPrefix() {
-    _assertSource(
-        "C", AstFactory.constructorName(AstFactory.typeName4("C"), null));
+    _assertSource("C",
+        AstTestFactory.constructorName(AstTestFactory.typeName4("C"), null));
   }
 
   void test_visitConstructorName_unnamed_prefix() {
     _assertSource(
         "p.C",
-        AstFactory.constructorName(
-            AstFactory.typeName3(AstFactory.identifier5("p", "C")), null));
+        AstTestFactory.constructorName(
+            AstTestFactory.typeName3(AstTestFactory.identifier5("p", "C")),
+            null));
   }
 
   void test_visitContinueStatement_label() {
-    _assertSource("continue l;", AstFactory.continueStatement("l"));
+    _assertSource("continue l;", AstTestFactory.continueStatement("l"));
   }
 
   void test_visitContinueStatement_noLabel() {
-    _assertSource("continue;", AstFactory.continueStatement());
+    _assertSource("continue;", AstTestFactory.continueStatement());
   }
 
   void test_visitDefaultFormalParameter_annotation() {
-    DefaultFormalParameter parameter = AstFactory.positionalFormalParameter(
-        AstFactory.simpleFormalParameter3("p"), AstFactory.integer(0));
-    parameter.metadata.add(AstFactory.annotation(AstFactory.identifier3("A")));
+    DefaultFormalParameter parameter = AstTestFactory.positionalFormalParameter(
+        AstTestFactory.simpleFormalParameter3("p"), AstTestFactory.integer(0));
+    parameter.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("A")));
     _assertSource('@A p = 0', parameter);
   }
 
   void test_visitDefaultFormalParameter_named_noValue() {
     _assertSource(
         "p",
-        AstFactory.namedFormalParameter(
-            AstFactory.simpleFormalParameter3("p"), null));
+        AstTestFactory.namedFormalParameter(
+            AstTestFactory.simpleFormalParameter3("p"), null));
   }
 
   void test_visitDefaultFormalParameter_named_value() {
     _assertSource(
         "p : 0",
-        AstFactory.namedFormalParameter(
-            AstFactory.simpleFormalParameter3("p"), AstFactory.integer(0)));
+        AstTestFactory.namedFormalParameter(
+            AstTestFactory.simpleFormalParameter3("p"),
+            AstTestFactory.integer(0)));
   }
 
   void test_visitDefaultFormalParameter_positional_noValue() {
     _assertSource(
         "p",
-        AstFactory.positionalFormalParameter(
-            AstFactory.simpleFormalParameter3("p"), null));
+        AstTestFactory.positionalFormalParameter(
+            AstTestFactory.simpleFormalParameter3("p"), null));
   }
 
   void test_visitDefaultFormalParameter_positional_value() {
     _assertSource(
         "p = 0",
-        AstFactory.positionalFormalParameter(
-            AstFactory.simpleFormalParameter3("p"), AstFactory.integer(0)));
+        AstTestFactory.positionalFormalParameter(
+            AstTestFactory.simpleFormalParameter3("p"),
+            AstTestFactory.integer(0)));
   }
 
   void test_visitDoStatement() {
     _assertSource(
         "do {} while (c);",
-        AstFactory.doStatement(
-            AstFactory.block(), AstFactory.identifier3("c")));
+        AstTestFactory.doStatement(
+            AstTestFactory.block(), AstTestFactory.identifier3("c")));
   }
 
   void test_visitDoubleLiteral() {
-    _assertSource("4.2", AstFactory.doubleLiteral(4.2));
+    _assertSource("4.2", AstTestFactory.doubleLiteral(4.2));
   }
 
   void test_visitEmptyFunctionBody() {
-    _assertSource(";", AstFactory.emptyFunctionBody());
+    _assertSource(";", AstTestFactory.emptyFunctionBody());
   }
 
   void test_visitEmptyStatement() {
-    _assertSource(";", AstFactory.emptyStatement());
+    _assertSource(";", AstTestFactory.emptyStatement());
   }
 
   void test_visitEnumDeclaration_multiple() {
-    _assertSource(
-        "enum E {ONE, TWO}", AstFactory.enumDeclaration2("E", ["ONE", "TWO"]));
+    _assertSource("enum E {ONE, TWO}",
+        AstTestFactory.enumDeclaration2("E", ["ONE", "TWO"]));
   }
 
   void test_visitEnumDeclaration_single() {
-    _assertSource("enum E {ONE}", AstFactory.enumDeclaration2("E", ["ONE"]));
+    _assertSource(
+        "enum E {ONE}", AstTestFactory.enumDeclaration2("E", ["ONE"]));
   }
 
   void test_visitExportDirective_combinator() {
     _assertSource(
         "export 'a.dart' show A;",
-        AstFactory.exportDirective2("a.dart", [
-          AstFactory.showCombinator([AstFactory.identifier3("A")])
+        AstTestFactory.exportDirective2("a.dart", [
+          AstTestFactory.showCombinator([AstTestFactory.identifier3("A")])
         ]));
   }
 
   void test_visitExportDirective_combinators() {
     _assertSource(
         "export 'a.dart' show A hide B;",
-        AstFactory.exportDirective2("a.dart", [
-          AstFactory.showCombinator([AstFactory.identifier3("A")]),
-          AstFactory.hideCombinator([AstFactory.identifier3("B")])
+        AstTestFactory.exportDirective2("a.dart", [
+          AstTestFactory.showCombinator([AstTestFactory.identifier3("A")]),
+          AstTestFactory.hideCombinator([AstTestFactory.identifier3("B")])
         ]));
   }
 
   void test_visitExportDirective_minimal() {
-    _assertSource("export 'a.dart';", AstFactory.exportDirective2("a.dart"));
+    _assertSource(
+        "export 'a.dart';", AstTestFactory.exportDirective2("a.dart"));
   }
 
   void test_visitExportDirective_withMetadata() {
-    ExportDirective directive = AstFactory.exportDirective2("a.dart");
-    directive.metadata
-        .add(AstFactory.annotation(AstFactory.identifier3("deprecated")));
+    ExportDirective directive = AstTestFactory.exportDirective2("a.dart");
+    directive.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
     _assertSource("@deprecated export 'a.dart';", directive);
   }
 
   void test_visitExpressionFunctionBody_async() {
-    _assertSource("async => a;",
-        AstFactory.asyncExpressionFunctionBody(AstFactory.identifier3("a")));
+    _assertSource(
+        "async => a;",
+        AstTestFactory
+            .asyncExpressionFunctionBody(AstTestFactory.identifier3("a")));
   }
 
   void test_visitExpressionFunctionBody_simple() {
     _assertSource("=> a;",
-        AstFactory.expressionFunctionBody(AstFactory.identifier3("a")));
+        AstTestFactory.expressionFunctionBody(AstTestFactory.identifier3("a")));
   }
 
   void test_visitExpressionStatement() {
-    _assertSource(
-        "a;", AstFactory.expressionStatement(AstFactory.identifier3("a")));
+    _assertSource("a;",
+        AstTestFactory.expressionStatement(AstTestFactory.identifier3("a")));
   }
 
   void test_visitExtendsClause() {
-    _assertSource(
-        "extends C", AstFactory.extendsClause(AstFactory.typeName4("C")));
+    _assertSource("extends C",
+        AstTestFactory.extendsClause(AstTestFactory.typeName4("C")));
   }
 
   void test_visitFieldDeclaration_instance() {
     _assertSource(
         "var a;",
-        AstFactory.fieldDeclaration2(
-            false, Keyword.VAR, [AstFactory.variableDeclaration("a")]));
+        AstTestFactory.fieldDeclaration2(
+            false, Keyword.VAR, [AstTestFactory.variableDeclaration("a")]));
   }
 
   void test_visitFieldDeclaration_static() {
     _assertSource(
         "static var a;",
-        AstFactory.fieldDeclaration2(
-            true, Keyword.VAR, [AstFactory.variableDeclaration("a")]));
+        AstTestFactory.fieldDeclaration2(
+            true, Keyword.VAR, [AstTestFactory.variableDeclaration("a")]));
   }
 
   void test_visitFieldDeclaration_withMetadata() {
-    FieldDeclaration declaration = AstFactory.fieldDeclaration2(
-        false, Keyword.VAR, [AstFactory.variableDeclaration("a")]);
-    declaration.metadata
-        .add(AstFactory.annotation(AstFactory.identifier3("deprecated")));
+    FieldDeclaration declaration = AstTestFactory.fieldDeclaration2(
+        false, Keyword.VAR, [AstTestFactory.variableDeclaration("a")]);
+    declaration.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
     _assertSource("@deprecated var a;", declaration);
   }
 
   void test_visitFieldFormalParameter_annotation() {
-    FieldFormalParameter parameter = AstFactory.fieldFormalParameter2('f');
-    parameter.metadata.add(AstFactory.annotation(AstFactory.identifier3("A")));
+    FieldFormalParameter parameter = AstTestFactory.fieldFormalParameter2('f');
+    parameter.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("A")));
     _assertSource('@A this.f', parameter);
   }
 
   void test_visitFieldFormalParameter_functionTyped() {
     _assertSource(
         "A this.a(b)",
-        AstFactory.fieldFormalParameter(
+        AstTestFactory.fieldFormalParameter(
             null,
-            AstFactory.typeName4("A"),
+            AstTestFactory.typeName4("A"),
             "a",
-            AstFactory.formalParameterList(
-                [AstFactory.simpleFormalParameter3("b")])));
+            AstTestFactory.formalParameterList(
+                [AstTestFactory.simpleFormalParameter3("b")])));
   }
 
   void test_visitFieldFormalParameter_functionTyped_typeParameters() {
@@ -1913,37 +1951,39 @@
             null,
             null,
             null,
-            AstFactory.typeName4('A'),
+            AstTestFactory.typeName4('A'),
             TokenFactory.tokenFromKeyword(Keyword.THIS),
             TokenFactory.tokenFromType(TokenType.PERIOD),
-            AstFactory.identifier3('a'),
-            AstFactory.typeParameterList(['E', 'F']),
-            AstFactory.formalParameterList(
-                [AstFactory.simpleFormalParameter3("b")])));
+            AstTestFactory.identifier3('a'),
+            AstTestFactory.typeParameterList(['E', 'F']),
+            AstTestFactory.formalParameterList(
+                [AstTestFactory.simpleFormalParameter3("b")])));
   }
 
   void test_visitFieldFormalParameter_keyword() {
-    _assertSource(
-        "var this.a", AstFactory.fieldFormalParameter(Keyword.VAR, null, "a"));
+    _assertSource("var this.a",
+        AstTestFactory.fieldFormalParameter(Keyword.VAR, null, "a"));
   }
 
   void test_visitFieldFormalParameter_keywordAndType() {
     _assertSource(
         "final A this.a",
-        AstFactory.fieldFormalParameter(
-            Keyword.FINAL, AstFactory.typeName4("A"), "a"));
+        AstTestFactory.fieldFormalParameter(
+            Keyword.FINAL, AstTestFactory.typeName4("A"), "a"));
   }
 
   void test_visitFieldFormalParameter_type() {
-    _assertSource("A this.a",
-        AstFactory.fieldFormalParameter(null, AstFactory.typeName4("A"), "a"));
+    _assertSource(
+        "A this.a",
+        AstTestFactory.fieldFormalParameter(
+            null, AstTestFactory.typeName4("A"), "a"));
   }
 
   void test_visitForEachStatement_declared() {
     _assertSource(
         "for (var a in b) {}",
-        AstFactory.forEachStatement(AstFactory.declaredIdentifier3("a"),
-            AstFactory.identifier3("b"), AstFactory.block()));
+        AstTestFactory.forEachStatement(AstTestFactory.declaredIdentifier3("a"),
+            AstTestFactory.identifier3("b"), AstTestFactory.block()));
   }
 
   void test_visitForEachStatement_variable() {
@@ -1953,11 +1993,11 @@
             null,
             TokenFactory.tokenFromKeyword(Keyword.FOR),
             TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
-            AstFactory.identifier3("a"),
+            AstTestFactory.identifier3("a"),
             TokenFactory.tokenFromKeyword(Keyword.IN),
-            AstFactory.identifier3("b"),
+            AstTestFactory.identifier3("b"),
             TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
-            AstFactory.block()));
+            AstTestFactory.block()));
   }
 
   void test_visitForEachStatement_variable_await() {
@@ -1967,268 +2007,288 @@
             TokenFactory.tokenFromString("await"),
             TokenFactory.tokenFromKeyword(Keyword.FOR),
             TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
-            AstFactory.identifier3("a"),
+            AstTestFactory.identifier3("a"),
             TokenFactory.tokenFromKeyword(Keyword.IN),
-            AstFactory.identifier3("b"),
+            AstTestFactory.identifier3("b"),
             TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
-            AstFactory.block()));
+            AstTestFactory.block()));
   }
 
   void test_visitFormalParameterList_empty() {
-    _assertSource("()", AstFactory.formalParameterList());
+    _assertSource("()", AstTestFactory.formalParameterList());
   }
 
   void test_visitFormalParameterList_n() {
     _assertSource(
         "({a : 0})",
-        AstFactory.formalParameterList([
-          AstFactory.namedFormalParameter(
-              AstFactory.simpleFormalParameter3("a"), AstFactory.integer(0))
+        AstTestFactory.formalParameterList([
+          AstTestFactory.namedFormalParameter(
+              AstTestFactory.simpleFormalParameter3("a"),
+              AstTestFactory.integer(0))
         ]));
   }
 
   void test_visitFormalParameterList_nn() {
     _assertSource(
         "({a : 0, b : 1})",
-        AstFactory.formalParameterList([
-          AstFactory.namedFormalParameter(
-              AstFactory.simpleFormalParameter3("a"), AstFactory.integer(0)),
-          AstFactory.namedFormalParameter(
-              AstFactory.simpleFormalParameter3("b"), AstFactory.integer(1))
+        AstTestFactory.formalParameterList([
+          AstTestFactory.namedFormalParameter(
+              AstTestFactory.simpleFormalParameter3("a"),
+              AstTestFactory.integer(0)),
+          AstTestFactory.namedFormalParameter(
+              AstTestFactory.simpleFormalParameter3("b"),
+              AstTestFactory.integer(1))
         ]));
   }
 
   void test_visitFormalParameterList_p() {
     _assertSource(
         "([a = 0])",
-        AstFactory.formalParameterList([
-          AstFactory.positionalFormalParameter(
-              AstFactory.simpleFormalParameter3("a"), AstFactory.integer(0))
+        AstTestFactory.formalParameterList([
+          AstTestFactory.positionalFormalParameter(
+              AstTestFactory.simpleFormalParameter3("a"),
+              AstTestFactory.integer(0))
         ]));
   }
 
   void test_visitFormalParameterList_pp() {
     _assertSource(
         "([a = 0, b = 1])",
-        AstFactory.formalParameterList([
-          AstFactory.positionalFormalParameter(
-              AstFactory.simpleFormalParameter3("a"), AstFactory.integer(0)),
-          AstFactory.positionalFormalParameter(
-              AstFactory.simpleFormalParameter3("b"), AstFactory.integer(1))
+        AstTestFactory.formalParameterList([
+          AstTestFactory.positionalFormalParameter(
+              AstTestFactory.simpleFormalParameter3("a"),
+              AstTestFactory.integer(0)),
+          AstTestFactory.positionalFormalParameter(
+              AstTestFactory.simpleFormalParameter3("b"),
+              AstTestFactory.integer(1))
         ]));
   }
 
   void test_visitFormalParameterList_r() {
     _assertSource(
         "(a)",
-        AstFactory
-            .formalParameterList([AstFactory.simpleFormalParameter3("a")]));
+        AstTestFactory
+            .formalParameterList([AstTestFactory.simpleFormalParameter3("a")]));
   }
 
   void test_visitFormalParameterList_rn() {
     _assertSource(
         "(a, {b : 1})",
-        AstFactory.formalParameterList([
-          AstFactory.simpleFormalParameter3("a"),
-          AstFactory.namedFormalParameter(
-              AstFactory.simpleFormalParameter3("b"), AstFactory.integer(1))
+        AstTestFactory.formalParameterList([
+          AstTestFactory.simpleFormalParameter3("a"),
+          AstTestFactory.namedFormalParameter(
+              AstTestFactory.simpleFormalParameter3("b"),
+              AstTestFactory.integer(1))
         ]));
   }
 
   void test_visitFormalParameterList_rnn() {
     _assertSource(
         "(a, {b : 1, c : 2})",
-        AstFactory.formalParameterList([
-          AstFactory.simpleFormalParameter3("a"),
-          AstFactory.namedFormalParameter(
-              AstFactory.simpleFormalParameter3("b"), AstFactory.integer(1)),
-          AstFactory.namedFormalParameter(
-              AstFactory.simpleFormalParameter3("c"), AstFactory.integer(2))
+        AstTestFactory.formalParameterList([
+          AstTestFactory.simpleFormalParameter3("a"),
+          AstTestFactory.namedFormalParameter(
+              AstTestFactory.simpleFormalParameter3("b"),
+              AstTestFactory.integer(1)),
+          AstTestFactory.namedFormalParameter(
+              AstTestFactory.simpleFormalParameter3("c"),
+              AstTestFactory.integer(2))
         ]));
   }
 
   void test_visitFormalParameterList_rp() {
     _assertSource(
         "(a, [b = 1])",
-        AstFactory.formalParameterList([
-          AstFactory.simpleFormalParameter3("a"),
-          AstFactory.positionalFormalParameter(
-              AstFactory.simpleFormalParameter3("b"), AstFactory.integer(1))
+        AstTestFactory.formalParameterList([
+          AstTestFactory.simpleFormalParameter3("a"),
+          AstTestFactory.positionalFormalParameter(
+              AstTestFactory.simpleFormalParameter3("b"),
+              AstTestFactory.integer(1))
         ]));
   }
 
   void test_visitFormalParameterList_rpp() {
     _assertSource(
         "(a, [b = 1, c = 2])",
-        AstFactory.formalParameterList([
-          AstFactory.simpleFormalParameter3("a"),
-          AstFactory.positionalFormalParameter(
-              AstFactory.simpleFormalParameter3("b"), AstFactory.integer(1)),
-          AstFactory.positionalFormalParameter(
-              AstFactory.simpleFormalParameter3("c"), AstFactory.integer(2))
+        AstTestFactory.formalParameterList([
+          AstTestFactory.simpleFormalParameter3("a"),
+          AstTestFactory.positionalFormalParameter(
+              AstTestFactory.simpleFormalParameter3("b"),
+              AstTestFactory.integer(1)),
+          AstTestFactory.positionalFormalParameter(
+              AstTestFactory.simpleFormalParameter3("c"),
+              AstTestFactory.integer(2))
         ]));
   }
 
   void test_visitFormalParameterList_rr() {
     _assertSource(
         "(a, b)",
-        AstFactory.formalParameterList([
-          AstFactory.simpleFormalParameter3("a"),
-          AstFactory.simpleFormalParameter3("b")
+        AstTestFactory.formalParameterList([
+          AstTestFactory.simpleFormalParameter3("a"),
+          AstTestFactory.simpleFormalParameter3("b")
         ]));
   }
 
   void test_visitFormalParameterList_rrn() {
     _assertSource(
         "(a, b, {c : 3})",
-        AstFactory.formalParameterList([
-          AstFactory.simpleFormalParameter3("a"),
-          AstFactory.simpleFormalParameter3("b"),
-          AstFactory.namedFormalParameter(
-              AstFactory.simpleFormalParameter3("c"), AstFactory.integer(3))
+        AstTestFactory.formalParameterList([
+          AstTestFactory.simpleFormalParameter3("a"),
+          AstTestFactory.simpleFormalParameter3("b"),
+          AstTestFactory.namedFormalParameter(
+              AstTestFactory.simpleFormalParameter3("c"),
+              AstTestFactory.integer(3))
         ]));
   }
 
   void test_visitFormalParameterList_rrnn() {
     _assertSource(
         "(a, b, {c : 3, d : 4})",
-        AstFactory.formalParameterList([
-          AstFactory.simpleFormalParameter3("a"),
-          AstFactory.simpleFormalParameter3("b"),
-          AstFactory.namedFormalParameter(
-              AstFactory.simpleFormalParameter3("c"), AstFactory.integer(3)),
-          AstFactory.namedFormalParameter(
-              AstFactory.simpleFormalParameter3("d"), AstFactory.integer(4))
+        AstTestFactory.formalParameterList([
+          AstTestFactory.simpleFormalParameter3("a"),
+          AstTestFactory.simpleFormalParameter3("b"),
+          AstTestFactory.namedFormalParameter(
+              AstTestFactory.simpleFormalParameter3("c"),
+              AstTestFactory.integer(3)),
+          AstTestFactory.namedFormalParameter(
+              AstTestFactory.simpleFormalParameter3("d"),
+              AstTestFactory.integer(4))
         ]));
   }
 
   void test_visitFormalParameterList_rrp() {
     _assertSource(
         "(a, b, [c = 3])",
-        AstFactory.formalParameterList([
-          AstFactory.simpleFormalParameter3("a"),
-          AstFactory.simpleFormalParameter3("b"),
-          AstFactory.positionalFormalParameter(
-              AstFactory.simpleFormalParameter3("c"), AstFactory.integer(3))
+        AstTestFactory.formalParameterList([
+          AstTestFactory.simpleFormalParameter3("a"),
+          AstTestFactory.simpleFormalParameter3("b"),
+          AstTestFactory.positionalFormalParameter(
+              AstTestFactory.simpleFormalParameter3("c"),
+              AstTestFactory.integer(3))
         ]));
   }
 
   void test_visitFormalParameterList_rrpp() {
     _assertSource(
         "(a, b, [c = 3, d = 4])",
-        AstFactory.formalParameterList([
-          AstFactory.simpleFormalParameter3("a"),
-          AstFactory.simpleFormalParameter3("b"),
-          AstFactory.positionalFormalParameter(
-              AstFactory.simpleFormalParameter3("c"), AstFactory.integer(3)),
-          AstFactory.positionalFormalParameter(
-              AstFactory.simpleFormalParameter3("d"), AstFactory.integer(4))
+        AstTestFactory.formalParameterList([
+          AstTestFactory.simpleFormalParameter3("a"),
+          AstTestFactory.simpleFormalParameter3("b"),
+          AstTestFactory.positionalFormalParameter(
+              AstTestFactory.simpleFormalParameter3("c"),
+              AstTestFactory.integer(3)),
+          AstTestFactory.positionalFormalParameter(
+              AstTestFactory.simpleFormalParameter3("d"),
+              AstTestFactory.integer(4))
         ]));
   }
 
   void test_visitForStatement_c() {
     _assertSource(
         "for (; c;) {}",
-        AstFactory.forStatement(
-            null, AstFactory.identifier3("c"), null, AstFactory.block()));
+        AstTestFactory.forStatement(null, AstTestFactory.identifier3("c"), null,
+            AstTestFactory.block()));
   }
 
   void test_visitForStatement_cu() {
     _assertSource(
         "for (; c; u) {}",
-        AstFactory.forStatement(null, AstFactory.identifier3("c"),
-            [AstFactory.identifier3("u")], AstFactory.block()));
+        AstTestFactory.forStatement(null, AstTestFactory.identifier3("c"),
+            [AstTestFactory.identifier3("u")], AstTestFactory.block()));
   }
 
   void test_visitForStatement_e() {
     _assertSource(
         "for (e;;) {}",
-        AstFactory.forStatement(
-            AstFactory.identifier3("e"), null, null, AstFactory.block()));
+        AstTestFactory.forStatement(AstTestFactory.identifier3("e"), null, null,
+            AstTestFactory.block()));
   }
 
   void test_visitForStatement_ec() {
     _assertSource(
         "for (e; c;) {}",
-        AstFactory.forStatement(AstFactory.identifier3("e"),
-            AstFactory.identifier3("c"), null, AstFactory.block()));
+        AstTestFactory.forStatement(AstTestFactory.identifier3("e"),
+            AstTestFactory.identifier3("c"), null, AstTestFactory.block()));
   }
 
   void test_visitForStatement_ecu() {
     _assertSource(
         "for (e; c; u) {}",
-        AstFactory.forStatement(
-            AstFactory.identifier3("e"),
-            AstFactory.identifier3("c"),
-            [AstFactory.identifier3("u")],
-            AstFactory.block()));
+        AstTestFactory.forStatement(
+            AstTestFactory.identifier3("e"),
+            AstTestFactory.identifier3("c"),
+            [AstTestFactory.identifier3("u")],
+            AstTestFactory.block()));
   }
 
   void test_visitForStatement_eu() {
     _assertSource(
         "for (e;; u) {}",
-        AstFactory.forStatement(AstFactory.identifier3("e"), null,
-            [AstFactory.identifier3("u")], AstFactory.block()));
+        AstTestFactory.forStatement(AstTestFactory.identifier3("e"), null,
+            [AstTestFactory.identifier3("u")], AstTestFactory.block()));
   }
 
   void test_visitForStatement_i() {
     _assertSource(
         "for (var i;;) {}",
-        AstFactory.forStatement2(
-            AstFactory.variableDeclarationList2(
-                Keyword.VAR, [AstFactory.variableDeclaration("i")]),
+        AstTestFactory.forStatement2(
+            AstTestFactory.variableDeclarationList2(
+                Keyword.VAR, [AstTestFactory.variableDeclaration("i")]),
             null,
             null,
-            AstFactory.block()));
+            AstTestFactory.block()));
   }
 
   void test_visitForStatement_ic() {
     _assertSource(
         "for (var i; c;) {}",
-        AstFactory.forStatement2(
-            AstFactory.variableDeclarationList2(
-                Keyword.VAR, [AstFactory.variableDeclaration("i")]),
-            AstFactory.identifier3("c"),
+        AstTestFactory.forStatement2(
+            AstTestFactory.variableDeclarationList2(
+                Keyword.VAR, [AstTestFactory.variableDeclaration("i")]),
+            AstTestFactory.identifier3("c"),
             null,
-            AstFactory.block()));
+            AstTestFactory.block()));
   }
 
   void test_visitForStatement_icu() {
     _assertSource(
         "for (var i; c; u) {}",
-        AstFactory.forStatement2(
-            AstFactory.variableDeclarationList2(
-                Keyword.VAR, [AstFactory.variableDeclaration("i")]),
-            AstFactory.identifier3("c"),
-            [AstFactory.identifier3("u")],
-            AstFactory.block()));
+        AstTestFactory.forStatement2(
+            AstTestFactory.variableDeclarationList2(
+                Keyword.VAR, [AstTestFactory.variableDeclaration("i")]),
+            AstTestFactory.identifier3("c"),
+            [AstTestFactory.identifier3("u")],
+            AstTestFactory.block()));
   }
 
   void test_visitForStatement_iu() {
     _assertSource(
         "for (var i;; u) {}",
-        AstFactory.forStatement2(
-            AstFactory.variableDeclarationList2(
-                Keyword.VAR, [AstFactory.variableDeclaration("i")]),
+        AstTestFactory.forStatement2(
+            AstTestFactory.variableDeclarationList2(
+                Keyword.VAR, [AstTestFactory.variableDeclaration("i")]),
             null,
-            [AstFactory.identifier3("u")],
-            AstFactory.block()));
+            [AstTestFactory.identifier3("u")],
+            AstTestFactory.block()));
   }
 
   void test_visitForStatement_u() {
     _assertSource(
         "for (;; u) {}",
-        AstFactory.forStatement(
-            null, null, [AstFactory.identifier3("u")], AstFactory.block()));
+        AstTestFactory.forStatement(null, null,
+            [AstTestFactory.identifier3("u")], AstTestFactory.block()));
   }
 
   void test_visitFunctionDeclaration_external() {
-    FunctionDeclaration functionDeclaration = AstFactory.functionDeclaration(
-        null,
-        null,
-        "f",
-        AstFactory.functionExpression2(
-            AstFactory.formalParameterList(), AstFactory.emptyFunctionBody()));
+    FunctionDeclaration functionDeclaration =
+        AstTestFactory.functionDeclaration(
+            null,
+            null,
+            "f",
+            AstTestFactory.functionExpression2(
+                AstTestFactory.formalParameterList(),
+                AstTestFactory.emptyFunctionBody()));
     functionDeclaration.externalKeyword =
         TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
     _assertSource("external f();", functionDeclaration);
@@ -2237,158 +2297,168 @@
   void test_visitFunctionDeclaration_getter() {
     _assertSource(
         "get f() {}",
-        AstFactory.functionDeclaration(
-            null, Keyword.GET, "f", AstFactory.functionExpression()));
+        AstTestFactory.functionDeclaration(
+            null, Keyword.GET, "f", AstTestFactory.functionExpression()));
   }
 
   void test_visitFunctionDeclaration_local_blockBody() {
-    FunctionDeclaration f = AstFactory.functionDeclaration(
-        null, null, "f", AstFactory.functionExpression());
+    FunctionDeclaration f = AstTestFactory.functionDeclaration(
+        null, null, "f", AstTestFactory.functionExpression());
     FunctionDeclarationStatement fStatement =
         new FunctionDeclarationStatement(f);
     _assertSource(
         "main() {f() {} 42;}",
-        AstFactory.functionDeclaration(
+        AstTestFactory.functionDeclaration(
             null,
             null,
             "main",
-            AstFactory.functionExpression2(
-                AstFactory.formalParameterList(),
-                AstFactory.blockFunctionBody2([
+            AstTestFactory.functionExpression2(
+                AstTestFactory.formalParameterList(),
+                AstTestFactory.blockFunctionBody2([
                   fStatement,
-                  AstFactory.expressionStatement(AstFactory.integer(42))
+                  AstTestFactory.expressionStatement(AstTestFactory.integer(42))
                 ]))));
   }
 
   void test_visitFunctionDeclaration_local_expressionBody() {
-    FunctionDeclaration f = AstFactory.functionDeclaration(
+    FunctionDeclaration f = AstTestFactory.functionDeclaration(
         null,
         null,
         "f",
-        AstFactory.functionExpression2(AstFactory.formalParameterList(),
-            AstFactory.expressionFunctionBody(AstFactory.integer(1))));
+        AstTestFactory.functionExpression2(AstTestFactory.formalParameterList(),
+            AstTestFactory.expressionFunctionBody(AstTestFactory.integer(1))));
     FunctionDeclarationStatement fStatement =
         new FunctionDeclarationStatement(f);
     _assertSource(
         "main() {f() => 1; 2;}",
-        AstFactory.functionDeclaration(
+        AstTestFactory.functionDeclaration(
             null,
             null,
             "main",
-            AstFactory.functionExpression2(
-                AstFactory.formalParameterList(),
-                AstFactory.blockFunctionBody2([
+            AstTestFactory.functionExpression2(
+                AstTestFactory.formalParameterList(),
+                AstTestFactory.blockFunctionBody2([
                   fStatement,
-                  AstFactory.expressionStatement(AstFactory.integer(2))
+                  AstTestFactory.expressionStatement(AstTestFactory.integer(2))
                 ]))));
   }
 
   void test_visitFunctionDeclaration_normal() {
     _assertSource(
         "f() {}",
-        AstFactory.functionDeclaration(
-            null, null, "f", AstFactory.functionExpression()));
+        AstTestFactory.functionDeclaration(
+            null, null, "f", AstTestFactory.functionExpression()));
   }
 
   void test_visitFunctionDeclaration_setter() {
     _assertSource(
         "set f() {}",
-        AstFactory.functionDeclaration(
-            null, Keyword.SET, "f", AstFactory.functionExpression()));
+        AstTestFactory.functionDeclaration(
+            null, Keyword.SET, "f", AstTestFactory.functionExpression()));
   }
 
   void test_visitFunctionDeclaration_typeParameters() {
     _assertSource(
         "f<E>() {}",
-        AstFactory.functionDeclaration(
+        AstTestFactory.functionDeclaration(
             null,
             null,
             "f",
-            AstFactory.functionExpression3(
-                AstFactory.typeParameterList(['E']),
-                AstFactory.formalParameterList(),
-                AstFactory.blockFunctionBody2())));
+            AstTestFactory.functionExpression3(
+                AstTestFactory.typeParameterList(['E']),
+                AstTestFactory.formalParameterList(),
+                AstTestFactory.blockFunctionBody2())));
   }
 
   void test_visitFunctionDeclaration_withMetadata() {
-    FunctionDeclaration declaration = AstFactory.functionDeclaration(
-        null, null, "f", AstFactory.functionExpression());
-    declaration.metadata
-        .add(AstFactory.annotation(AstFactory.identifier3("deprecated")));
+    FunctionDeclaration declaration = AstTestFactory.functionDeclaration(
+        null, null, "f", AstTestFactory.functionExpression());
+    declaration.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
     _assertSource("@deprecated f() {}", declaration);
   }
 
   void test_visitFunctionDeclarationStatement() {
     _assertSource(
         "f() {}",
-        AstFactory.functionDeclarationStatement(
-            null, null, "f", AstFactory.functionExpression()));
+        AstTestFactory.functionDeclarationStatement(
+            null, null, "f", AstTestFactory.functionExpression()));
   }
 
   void test_visitFunctionExpression() {
-    _assertSource("() {}", AstFactory.functionExpression());
+    _assertSource("() {}", AstTestFactory.functionExpression());
   }
 
   void test_visitFunctionExpression_typeParameters() {
     _assertSource(
         "<E>() {}",
-        AstFactory.functionExpression3(AstFactory.typeParameterList(['E']),
-            AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
+        AstTestFactory.functionExpression3(
+            AstTestFactory.typeParameterList(['E']),
+            AstTestFactory.formalParameterList(),
+            AstTestFactory.blockFunctionBody2()));
   }
 
   void test_visitFunctionExpressionInvocation_minimal() {
-    _assertSource("f()",
-        AstFactory.functionExpressionInvocation(AstFactory.identifier3("f")));
+    _assertSource(
+        "f()",
+        AstTestFactory
+            .functionExpressionInvocation(AstTestFactory.identifier3("f")));
   }
 
   void test_visitFunctionExpressionInvocation_typeArguments() {
     _assertSource(
         "f<A>()",
-        AstFactory.functionExpressionInvocation2(AstFactory.identifier3("f"),
-            AstFactory.typeArgumentList([AstFactory.typeName4('A')])));
+        AstTestFactory.functionExpressionInvocation2(
+            AstTestFactory.identifier3("f"),
+            AstTestFactory.typeArgumentList([AstTestFactory.typeName4('A')])));
   }
 
   void test_visitFunctionTypeAlias_generic() {
     _assertSource(
         "typedef A F<B>();",
-        AstFactory.typeAlias(
-            AstFactory.typeName4("A"),
+        AstTestFactory.typeAlias(
+            AstTestFactory.typeName4("A"),
             "F",
-            AstFactory.typeParameterList(["B"]),
-            AstFactory.formalParameterList()));
+            AstTestFactory.typeParameterList(["B"]),
+            AstTestFactory.formalParameterList()));
   }
 
   void test_visitFunctionTypeAlias_nonGeneric() {
     _assertSource(
         "typedef A F();",
-        AstFactory.typeAlias(AstFactory.typeName4("A"), "F", null,
-            AstFactory.formalParameterList()));
+        AstTestFactory.typeAlias(AstTestFactory.typeName4("A"), "F", null,
+            AstTestFactory.formalParameterList()));
   }
 
   void test_visitFunctionTypeAlias_withMetadata() {
-    FunctionTypeAlias declaration = AstFactory.typeAlias(
-        AstFactory.typeName4("A"), "F", null, AstFactory.formalParameterList());
-    declaration.metadata
-        .add(AstFactory.annotation(AstFactory.identifier3("deprecated")));
+    FunctionTypeAlias declaration = AstTestFactory.typeAlias(
+        AstTestFactory.typeName4("A"),
+        "F",
+        null,
+        AstTestFactory.formalParameterList());
+    declaration.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
     _assertSource("@deprecated typedef A F();", declaration);
   }
 
   void test_visitFunctionTypedFormalParameter_annotation() {
     FunctionTypedFormalParameter parameter =
-        AstFactory.functionTypedFormalParameter(null, "f");
-    parameter.metadata.add(AstFactory.annotation(AstFactory.identifier3("A")));
+        AstTestFactory.functionTypedFormalParameter(null, "f");
+    parameter.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("A")));
     _assertSource('@A f()', parameter);
   }
 
   void test_visitFunctionTypedFormalParameter_noType() {
-    _assertSource("f()", AstFactory.functionTypedFormalParameter(null, "f"));
+    _assertSource(
+        "f()", AstTestFactory.functionTypedFormalParameter(null, "f"));
   }
 
   void test_visitFunctionTypedFormalParameter_type() {
     _assertSource(
         "T f()",
-        AstFactory.functionTypedFormalParameter(
-            AstFactory.typeName4("T"), "f"));
+        AstTestFactory.functionTypedFormalParameter(
+            AstTestFactory.typeName4("T"), "f"));
   }
 
   void test_visitFunctionTypedFormalParameter_typeParameters() {
@@ -2397,948 +2467,3306 @@
         new FunctionTypedFormalParameter(
             null,
             null,
-            AstFactory.typeName4("T"),
-            AstFactory.identifier3('f'),
-            AstFactory.typeParameterList(['E']),
-            AstFactory.formalParameterList([])));
+            AstTestFactory.typeName4("T"),
+            AstTestFactory.identifier3('f'),
+            AstTestFactory.typeParameterList(['E']),
+            AstTestFactory.formalParameterList([])));
   }
 
   void test_visitIfStatement_withElse() {
     _assertSource(
         "if (c) {} else {}",
-        AstFactory.ifStatement2(AstFactory.identifier3("c"), AstFactory.block(),
-            AstFactory.block()));
+        AstTestFactory.ifStatement2(AstTestFactory.identifier3("c"),
+            AstTestFactory.block(), AstTestFactory.block()));
   }
 
   void test_visitIfStatement_withoutElse() {
     _assertSource(
         "if (c) {}",
-        AstFactory.ifStatement(
-            AstFactory.identifier3("c"), AstFactory.block()));
+        AstTestFactory.ifStatement(
+            AstTestFactory.identifier3("c"), AstTestFactory.block()));
   }
 
   void test_visitImplementsClause_multiple() {
     _assertSource(
         "implements A, B",
-        AstFactory.implementsClause(
-            [AstFactory.typeName4("A"), AstFactory.typeName4("B")]));
+        AstTestFactory.implementsClause(
+            [AstTestFactory.typeName4("A"), AstTestFactory.typeName4("B")]));
   }
 
   void test_visitImplementsClause_single() {
     _assertSource("implements A",
-        AstFactory.implementsClause([AstFactory.typeName4("A")]));
+        AstTestFactory.implementsClause([AstTestFactory.typeName4("A")]));
   }
 
   void test_visitImportDirective_combinator() {
     _assertSource(
         "import 'a.dart' show A;",
-        AstFactory.importDirective3("a.dart", null, [
-          AstFactory.showCombinator([AstFactory.identifier3("A")])
+        AstTestFactory.importDirective3("a.dart", null, [
+          AstTestFactory.showCombinator([AstTestFactory.identifier3("A")])
         ]));
   }
 
   void test_visitImportDirective_combinators() {
     _assertSource(
         "import 'a.dart' show A hide B;",
-        AstFactory.importDirective3("a.dart", null, [
-          AstFactory.showCombinator([AstFactory.identifier3("A")]),
-          AstFactory.hideCombinator([AstFactory.identifier3("B")])
+        AstTestFactory.importDirective3("a.dart", null, [
+          AstTestFactory.showCombinator([AstTestFactory.identifier3("A")]),
+          AstTestFactory.hideCombinator([AstTestFactory.identifier3("B")])
         ]));
   }
 
   void test_visitImportDirective_deferred() {
     _assertSource("import 'a.dart' deferred as p;",
-        AstFactory.importDirective2("a.dart", true, "p"));
+        AstTestFactory.importDirective2("a.dart", true, "p"));
   }
 
   void test_visitImportDirective_minimal() {
     _assertSource(
-        "import 'a.dart';", AstFactory.importDirective3("a.dart", null));
+        "import 'a.dart';", AstTestFactory.importDirective3("a.dart", null));
   }
 
   void test_visitImportDirective_prefix() {
-    _assertSource(
-        "import 'a.dart' as p;", AstFactory.importDirective3("a.dart", "p"));
+    _assertSource("import 'a.dart' as p;",
+        AstTestFactory.importDirective3("a.dart", "p"));
   }
 
   void test_visitImportDirective_prefix_combinator() {
     _assertSource(
         "import 'a.dart' as p show A;",
-        AstFactory.importDirective3("a.dart", "p", [
-          AstFactory.showCombinator([AstFactory.identifier3("A")])
+        AstTestFactory.importDirective3("a.dart", "p", [
+          AstTestFactory.showCombinator([AstTestFactory.identifier3("A")])
         ]));
   }
 
   void test_visitImportDirective_prefix_combinators() {
     _assertSource(
         "import 'a.dart' as p show A hide B;",
-        AstFactory.importDirective3("a.dart", "p", [
-          AstFactory.showCombinator([AstFactory.identifier3("A")]),
-          AstFactory.hideCombinator([AstFactory.identifier3("B")])
+        AstTestFactory.importDirective3("a.dart", "p", [
+          AstTestFactory.showCombinator([AstTestFactory.identifier3("A")]),
+          AstTestFactory.hideCombinator([AstTestFactory.identifier3("B")])
         ]));
   }
 
   void test_visitImportDirective_withMetadata() {
-    ImportDirective directive = AstFactory.importDirective3("a.dart", null);
-    directive.metadata
-        .add(AstFactory.annotation(AstFactory.identifier3("deprecated")));
+    ImportDirective directive = AstTestFactory.importDirective3("a.dart", null);
+    directive.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
     _assertSource("@deprecated import 'a.dart';", directive);
   }
 
   void test_visitImportHideCombinator_multiple() {
     _assertSource(
         "hide a, b",
-        AstFactory.hideCombinator(
-            [AstFactory.identifier3("a"), AstFactory.identifier3("b")]));
+        AstTestFactory.hideCombinator([
+          AstTestFactory.identifier3("a"),
+          AstTestFactory.identifier3("b")
+        ]));
   }
 
   void test_visitImportHideCombinator_single() {
-    _assertSource(
-        "hide a", AstFactory.hideCombinator([AstFactory.identifier3("a")]));
+    _assertSource("hide a",
+        AstTestFactory.hideCombinator([AstTestFactory.identifier3("a")]));
   }
 
   void test_visitImportShowCombinator_multiple() {
     _assertSource(
         "show a, b",
-        AstFactory.showCombinator(
-            [AstFactory.identifier3("a"), AstFactory.identifier3("b")]));
+        AstTestFactory.showCombinator([
+          AstTestFactory.identifier3("a"),
+          AstTestFactory.identifier3("b")
+        ]));
   }
 
   void test_visitImportShowCombinator_single() {
-    _assertSource(
-        "show a", AstFactory.showCombinator([AstFactory.identifier3("a")]));
+    _assertSource("show a",
+        AstTestFactory.showCombinator([AstTestFactory.identifier3("a")]));
   }
 
   void test_visitIndexExpression() {
     _assertSource(
         "a[i]",
-        AstFactory.indexExpression(
-            AstFactory.identifier3("a"), AstFactory.identifier3("i")));
+        AstTestFactory.indexExpression(
+            AstTestFactory.identifier3("a"), AstTestFactory.identifier3("i")));
   }
 
   void test_visitInstanceCreationExpression_const() {
     _assertSource(
         "const C()",
-        AstFactory.instanceCreationExpression2(
-            Keyword.CONST, AstFactory.typeName4("C")));
+        AstTestFactory.instanceCreationExpression2(
+            Keyword.CONST, AstTestFactory.typeName4("C")));
   }
 
   void test_visitInstanceCreationExpression_named() {
     _assertSource(
         "new C.c()",
-        AstFactory.instanceCreationExpression3(
-            Keyword.NEW, AstFactory.typeName4("C"), "c"));
+        AstTestFactory.instanceCreationExpression3(
+            Keyword.NEW, AstTestFactory.typeName4("C"), "c"));
   }
 
   void test_visitInstanceCreationExpression_unnamed() {
     _assertSource(
         "new C()",
-        AstFactory.instanceCreationExpression2(
-            Keyword.NEW, AstFactory.typeName4("C")));
+        AstTestFactory.instanceCreationExpression2(
+            Keyword.NEW, AstTestFactory.typeName4("C")));
   }
 
   void test_visitIntegerLiteral() {
-    _assertSource("42", AstFactory.integer(42));
+    _assertSource("42", AstTestFactory.integer(42));
   }
 
   void test_visitInterpolationExpression_expression() {
-    _assertSource("\${a}",
-        AstFactory.interpolationExpression(AstFactory.identifier3("a")));
+    _assertSource(
+        "\${a}",
+        AstTestFactory
+            .interpolationExpression(AstTestFactory.identifier3("a")));
   }
 
   void test_visitInterpolationExpression_identifier() {
-    _assertSource("\$a", AstFactory.interpolationExpression2("a"));
+    _assertSource("\$a", AstTestFactory.interpolationExpression2("a"));
   }
 
   void test_visitInterpolationString() {
-    _assertSource("'x", AstFactory.interpolationString("'x", "x"));
+    _assertSource("'x", AstTestFactory.interpolationString("'x", "x"));
   }
 
   void test_visitIsExpression_negated() {
     _assertSource(
         "a is! C",
-        AstFactory.isExpression(
-            AstFactory.identifier3("a"), true, AstFactory.typeName4("C")));
+        AstTestFactory.isExpression(AstTestFactory.identifier3("a"), true,
+            AstTestFactory.typeName4("C")));
   }
 
   void test_visitIsExpression_normal() {
     _assertSource(
         "a is C",
-        AstFactory.isExpression(
-            AstFactory.identifier3("a"), false, AstFactory.typeName4("C")));
+        AstTestFactory.isExpression(AstTestFactory.identifier3("a"), false,
+            AstTestFactory.typeName4("C")));
   }
 
   void test_visitLabel() {
-    _assertSource("a:", AstFactory.label2("a"));
+    _assertSource("a:", AstTestFactory.label2("a"));
   }
 
   void test_visitLabeledStatement_multiple() {
     _assertSource(
         "a: b: return;",
-        AstFactory.labeledStatement(
-            [AstFactory.label2("a"), AstFactory.label2("b")],
-            AstFactory.returnStatement()));
+        AstTestFactory.labeledStatement(
+            [AstTestFactory.label2("a"), AstTestFactory.label2("b")],
+            AstTestFactory.returnStatement()));
   }
 
   void test_visitLabeledStatement_single() {
     _assertSource(
         "a: return;",
-        AstFactory.labeledStatement(
-            [AstFactory.label2("a")], AstFactory.returnStatement()));
+        AstTestFactory.labeledStatement(
+            [AstTestFactory.label2("a")], AstTestFactory.returnStatement()));
   }
 
   void test_visitLibraryDirective() {
-    _assertSource("library l;", AstFactory.libraryDirective2("l"));
+    _assertSource("library l;", AstTestFactory.libraryDirective2("l"));
   }
 
   void test_visitLibraryDirective_withMetadata() {
-    LibraryDirective directive = AstFactory.libraryDirective2("l");
-    directive.metadata
-        .add(AstFactory.annotation(AstFactory.identifier3("deprecated")));
+    LibraryDirective directive = AstTestFactory.libraryDirective2("l");
+    directive.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
     _assertSource("@deprecated library l;", directive);
   }
 
   void test_visitLibraryIdentifier_multiple() {
     _assertSource(
         "a.b.c",
-        AstFactory.libraryIdentifier([
-          AstFactory.identifier3("a"),
-          AstFactory.identifier3("b"),
-          AstFactory.identifier3("c")
+        AstTestFactory.libraryIdentifier([
+          AstTestFactory.identifier3("a"),
+          AstTestFactory.identifier3("b"),
+          AstTestFactory.identifier3("c")
         ]));
   }
 
   void test_visitLibraryIdentifier_single() {
-    _assertSource(
-        "a", AstFactory.libraryIdentifier([AstFactory.identifier3("a")]));
+    _assertSource("a",
+        AstTestFactory.libraryIdentifier([AstTestFactory.identifier3("a")]));
   }
 
   void test_visitListLiteral_const() {
-    _assertSource("const []", AstFactory.listLiteral2(Keyword.CONST, null));
+    _assertSource("const []", AstTestFactory.listLiteral2(Keyword.CONST, null));
   }
 
   void test_visitListLiteral_empty() {
-    _assertSource("[]", AstFactory.listLiteral());
+    _assertSource("[]", AstTestFactory.listLiteral());
   }
 
   void test_visitListLiteral_nonEmpty() {
     _assertSource(
         "[a, b, c]",
-        AstFactory.listLiteral([
-          AstFactory.identifier3("a"),
-          AstFactory.identifier3("b"),
-          AstFactory.identifier3("c")
+        AstTestFactory.listLiteral([
+          AstTestFactory.identifier3("a"),
+          AstTestFactory.identifier3("b"),
+          AstTestFactory.identifier3("c")
         ]));
   }
 
   void test_visitMapLiteral_const() {
-    _assertSource("const {}", AstFactory.mapLiteral(Keyword.CONST, null));
+    _assertSource("const {}", AstTestFactory.mapLiteral(Keyword.CONST, null));
   }
 
   void test_visitMapLiteral_empty() {
-    _assertSource("{}", AstFactory.mapLiteral2());
+    _assertSource("{}", AstTestFactory.mapLiteral2());
   }
 
   void test_visitMapLiteral_nonEmpty() {
     _assertSource(
         "{'a' : a, 'b' : b, 'c' : c}",
-        AstFactory.mapLiteral2([
-          AstFactory.mapLiteralEntry("a", AstFactory.identifier3("a")),
-          AstFactory.mapLiteralEntry("b", AstFactory.identifier3("b")),
-          AstFactory.mapLiteralEntry("c", AstFactory.identifier3("c"))
+        AstTestFactory.mapLiteral2([
+          AstTestFactory.mapLiteralEntry("a", AstTestFactory.identifier3("a")),
+          AstTestFactory.mapLiteralEntry("b", AstTestFactory.identifier3("b")),
+          AstTestFactory.mapLiteralEntry("c", AstTestFactory.identifier3("c"))
         ]));
   }
 
   void test_visitMapLiteralEntry() {
     _assertSource("'a' : b",
-        AstFactory.mapLiteralEntry("a", AstFactory.identifier3("b")));
+        AstTestFactory.mapLiteralEntry("a", AstTestFactory.identifier3("b")));
   }
 
   void test_visitMethodDeclaration_external() {
     _assertSource(
         "external m();",
-        AstFactory.methodDeclaration(null, null, null, null,
-            AstFactory.identifier3("m"), AstFactory.formalParameterList()));
+        AstTestFactory.methodDeclaration(
+            null,
+            null,
+            null,
+            null,
+            AstTestFactory.identifier3("m"),
+            AstTestFactory.formalParameterList()));
   }
 
   void test_visitMethodDeclaration_external_returnType() {
     _assertSource(
         "external T m();",
-        AstFactory.methodDeclaration(
+        AstTestFactory.methodDeclaration(
             null,
-            AstFactory.typeName4("T"),
+            AstTestFactory.typeName4("T"),
             null,
             null,
-            AstFactory.identifier3("m"),
-            AstFactory.formalParameterList()));
+            AstTestFactory.identifier3("m"),
+            AstTestFactory.formalParameterList()));
   }
 
   void test_visitMethodDeclaration_getter() {
     _assertSource(
         "get m {}",
-        AstFactory.methodDeclaration2(
+        AstTestFactory.methodDeclaration2(
             null,
             null,
             Keyword.GET,
             null,
-            AstFactory.identifier3("m"),
+            AstTestFactory.identifier3("m"),
             null,
-            AstFactory.blockFunctionBody2()));
+            AstTestFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_getter_returnType() {
     _assertSource(
         "T get m {}",
-        AstFactory.methodDeclaration2(
+        AstTestFactory.methodDeclaration2(
             null,
-            AstFactory.typeName4("T"),
+            AstTestFactory.typeName4("T"),
             Keyword.GET,
             null,
-            AstFactory.identifier3("m"),
+            AstTestFactory.identifier3("m"),
             null,
-            AstFactory.blockFunctionBody2()));
+            AstTestFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_getter_seturnType() {
     _assertSource(
         "T set m(var v) {}",
-        AstFactory.methodDeclaration2(
+        AstTestFactory.methodDeclaration2(
             null,
-            AstFactory.typeName4("T"),
+            AstTestFactory.typeName4("T"),
             Keyword.SET,
             null,
-            AstFactory.identifier3("m"),
-            AstFactory.formalParameterList(
-                [AstFactory.simpleFormalParameter(Keyword.VAR, "v")]),
-            AstFactory.blockFunctionBody2()));
+            AstTestFactory.identifier3("m"),
+            AstTestFactory.formalParameterList(
+                [AstTestFactory.simpleFormalParameter(Keyword.VAR, "v")]),
+            AstTestFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_minimal() {
     _assertSource(
         "m() {}",
-        AstFactory.methodDeclaration2(
+        AstTestFactory.methodDeclaration2(
             null,
             null,
             null,
             null,
-            AstFactory.identifier3("m"),
-            AstFactory.formalParameterList(),
-            AstFactory.blockFunctionBody2()));
+            AstTestFactory.identifier3("m"),
+            AstTestFactory.formalParameterList(),
+            AstTestFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_multipleParameters() {
     _assertSource(
         "m(var a, var b) {}",
-        AstFactory.methodDeclaration2(
+        AstTestFactory.methodDeclaration2(
             null,
             null,
             null,
             null,
-            AstFactory.identifier3("m"),
-            AstFactory.formalParameterList([
-              AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
-              AstFactory.simpleFormalParameter(Keyword.VAR, "b")
+            AstTestFactory.identifier3("m"),
+            AstTestFactory.formalParameterList([
+              AstTestFactory.simpleFormalParameter(Keyword.VAR, "a"),
+              AstTestFactory.simpleFormalParameter(Keyword.VAR, "b")
             ]),
-            AstFactory.blockFunctionBody2()));
+            AstTestFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_operator() {
     _assertSource(
         "operator +() {}",
-        AstFactory.methodDeclaration2(
+        AstTestFactory.methodDeclaration2(
             null,
             null,
             null,
             Keyword.OPERATOR,
-            AstFactory.identifier3("+"),
-            AstFactory.formalParameterList(),
-            AstFactory.blockFunctionBody2()));
+            AstTestFactory.identifier3("+"),
+            AstTestFactory.formalParameterList(),
+            AstTestFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_operator_returnType() {
     _assertSource(
         "T operator +() {}",
-        AstFactory.methodDeclaration2(
+        AstTestFactory.methodDeclaration2(
             null,
-            AstFactory.typeName4("T"),
+            AstTestFactory.typeName4("T"),
             null,
             Keyword.OPERATOR,
-            AstFactory.identifier3("+"),
-            AstFactory.formalParameterList(),
-            AstFactory.blockFunctionBody2()));
+            AstTestFactory.identifier3("+"),
+            AstTestFactory.formalParameterList(),
+            AstTestFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_returnType() {
     _assertSource(
         "T m() {}",
-        AstFactory.methodDeclaration2(
+        AstTestFactory.methodDeclaration2(
             null,
-            AstFactory.typeName4("T"),
+            AstTestFactory.typeName4("T"),
             null,
             null,
-            AstFactory.identifier3("m"),
-            AstFactory.formalParameterList(),
-            AstFactory.blockFunctionBody2()));
+            AstTestFactory.identifier3("m"),
+            AstTestFactory.formalParameterList(),
+            AstTestFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_setter() {
     _assertSource(
         "set m(var v) {}",
-        AstFactory.methodDeclaration2(
+        AstTestFactory.methodDeclaration2(
             null,
             null,
             Keyword.SET,
             null,
-            AstFactory.identifier3("m"),
-            AstFactory.formalParameterList(
-                [AstFactory.simpleFormalParameter(Keyword.VAR, "v")]),
-            AstFactory.blockFunctionBody2()));
+            AstTestFactory.identifier3("m"),
+            AstTestFactory.formalParameterList(
+                [AstTestFactory.simpleFormalParameter(Keyword.VAR, "v")]),
+            AstTestFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_static() {
     _assertSource(
         "static m() {}",
-        AstFactory.methodDeclaration2(
+        AstTestFactory.methodDeclaration2(
             Keyword.STATIC,
             null,
             null,
             null,
-            AstFactory.identifier3("m"),
-            AstFactory.formalParameterList(),
-            AstFactory.blockFunctionBody2()));
+            AstTestFactory.identifier3("m"),
+            AstTestFactory.formalParameterList(),
+            AstTestFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_static_returnType() {
     _assertSource(
         "static T m() {}",
-        AstFactory.methodDeclaration2(
+        AstTestFactory.methodDeclaration2(
             Keyword.STATIC,
-            AstFactory.typeName4("T"),
+            AstTestFactory.typeName4("T"),
             null,
             null,
-            AstFactory.identifier3("m"),
-            AstFactory.formalParameterList(),
-            AstFactory.blockFunctionBody2()));
+            AstTestFactory.identifier3("m"),
+            AstTestFactory.formalParameterList(),
+            AstTestFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_typeParameters() {
     _assertSource(
         "m<E>() {}",
-        AstFactory.methodDeclaration3(
+        AstTestFactory.methodDeclaration3(
             null,
             null,
             null,
             null,
-            AstFactory.identifier3("m"),
-            AstFactory.typeParameterList(['E']),
-            AstFactory.formalParameterList(),
-            AstFactory.blockFunctionBody2()));
+            AstTestFactory.identifier3("m"),
+            AstTestFactory.typeParameterList(['E']),
+            AstTestFactory.formalParameterList(),
+            AstTestFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_withMetadata() {
-    MethodDeclaration declaration = AstFactory.methodDeclaration2(
+    MethodDeclaration declaration = AstTestFactory.methodDeclaration2(
         null,
         null,
         null,
         null,
-        AstFactory.identifier3("m"),
-        AstFactory.formalParameterList(),
-        AstFactory.blockFunctionBody2());
-    declaration.metadata
-        .add(AstFactory.annotation(AstFactory.identifier3("deprecated")));
+        AstTestFactory.identifier3("m"),
+        AstTestFactory.formalParameterList(),
+        AstTestFactory.blockFunctionBody2());
+    declaration.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
     _assertSource("@deprecated m() {}", declaration);
   }
 
   void test_visitMethodInvocation_conditional() {
     _assertSource(
         "t?.m()",
-        AstFactory.methodInvocation(
-            AstFactory.identifier3("t"), "m", null, TokenType.QUESTION_PERIOD));
+        AstTestFactory.methodInvocation(AstTestFactory.identifier3("t"), "m",
+            null, TokenType.QUESTION_PERIOD));
   }
 
   void test_visitMethodInvocation_noTarget() {
-    _assertSource("m()", AstFactory.methodInvocation2("m"));
+    _assertSource("m()", AstTestFactory.methodInvocation2("m"));
   }
 
   void test_visitMethodInvocation_target() {
-    _assertSource(
-        "t.m()", AstFactory.methodInvocation(AstFactory.identifier3("t"), "m"));
+    _assertSource("t.m()",
+        AstTestFactory.methodInvocation(AstTestFactory.identifier3("t"), "m"));
   }
 
   void test_visitMethodInvocation_typeArguments() {
     _assertSource(
         "m<A>()",
-        AstFactory.methodInvocation3(null, "m",
-            AstFactory.typeArgumentList([AstFactory.typeName4('A')])));
+        AstTestFactory.methodInvocation3(null, "m",
+            AstTestFactory.typeArgumentList([AstTestFactory.typeName4('A')])));
   }
 
   void test_visitNamedExpression() {
-    _assertSource(
-        "a: b", AstFactory.namedExpression2("a", AstFactory.identifier3("b")));
+    _assertSource("a: b",
+        AstTestFactory.namedExpression2("a", AstTestFactory.identifier3("b")));
   }
 
   void test_visitNamedFormalParameter() {
     _assertSource(
         "var a : 0",
-        AstFactory.namedFormalParameter(
-            AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
-            AstFactory.integer(0)));
+        AstTestFactory.namedFormalParameter(
+            AstTestFactory.simpleFormalParameter(Keyword.VAR, "a"),
+            AstTestFactory.integer(0)));
   }
 
   void test_visitNativeClause() {
-    _assertSource("native 'code'", AstFactory.nativeClause("code"));
+    _assertSource("native 'code'", AstTestFactory.nativeClause("code"));
   }
 
   void test_visitNativeFunctionBody() {
-    _assertSource("native 'str';", AstFactory.nativeFunctionBody("str"));
+    _assertSource("native 'str';", AstTestFactory.nativeFunctionBody("str"));
   }
 
   void test_visitNullLiteral() {
-    _assertSource("null", AstFactory.nullLiteral());
+    _assertSource("null", AstTestFactory.nullLiteral());
   }
 
   void test_visitParenthesizedExpression() {
     _assertSource(
-        "(a)", AstFactory.parenthesizedExpression(AstFactory.identifier3("a")));
+        "(a)",
+        AstTestFactory
+            .parenthesizedExpression(AstTestFactory.identifier3("a")));
   }
 
   void test_visitPartDirective() {
-    _assertSource("part 'a.dart';", AstFactory.partDirective2("a.dart"));
+    _assertSource("part 'a.dart';", AstTestFactory.partDirective2("a.dart"));
   }
 
   void test_visitPartDirective_withMetadata() {
-    PartDirective directive = AstFactory.partDirective2("a.dart");
-    directive.metadata
-        .add(AstFactory.annotation(AstFactory.identifier3("deprecated")));
+    PartDirective directive = AstTestFactory.partDirective2("a.dart");
+    directive.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
     _assertSource("@deprecated part 'a.dart';", directive);
   }
 
   void test_visitPartOfDirective() {
-    _assertSource("part of l;",
-        AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["l"])));
+    _assertSource(
+        "part of l;",
+        AstTestFactory
+            .partOfDirective(AstTestFactory.libraryIdentifier2(["l"])));
   }
 
   void test_visitPartOfDirective_withMetadata() {
-    PartOfDirective directive =
-        AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["l"]));
-    directive.metadata
-        .add(AstFactory.annotation(AstFactory.identifier3("deprecated")));
+    PartOfDirective directive = AstTestFactory
+        .partOfDirective(AstTestFactory.libraryIdentifier2(["l"]));
+    directive.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
     _assertSource("@deprecated part of l;", directive);
   }
 
   void test_visitPositionalFormalParameter() {
     _assertSource(
         "var a = 0",
-        AstFactory.positionalFormalParameter(
-            AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
-            AstFactory.integer(0)));
+        AstTestFactory.positionalFormalParameter(
+            AstTestFactory.simpleFormalParameter(Keyword.VAR, "a"),
+            AstTestFactory.integer(0)));
   }
 
   void test_visitPostfixExpression() {
     _assertSource(
         "a++",
-        AstFactory.postfixExpression(
-            AstFactory.identifier3("a"), TokenType.PLUS_PLUS));
+        AstTestFactory.postfixExpression(
+            AstTestFactory.identifier3("a"), TokenType.PLUS_PLUS));
   }
 
   void test_visitPrefixedIdentifier() {
-    _assertSource("a.b", AstFactory.identifier5("a", "b"));
+    _assertSource("a.b", AstTestFactory.identifier5("a", "b"));
   }
 
   void test_visitPrefixExpression() {
     _assertSource(
         "-a",
-        AstFactory.prefixExpression(
-            TokenType.MINUS, AstFactory.identifier3("a")));
+        AstTestFactory.prefixExpression(
+            TokenType.MINUS, AstTestFactory.identifier3("a")));
   }
 
   void test_visitPropertyAccess() {
-    _assertSource(
-        "a.b", AstFactory.propertyAccess2(AstFactory.identifier3("a"), "b"));
+    _assertSource("a.b",
+        AstTestFactory.propertyAccess2(AstTestFactory.identifier3("a"), "b"));
   }
 
   void test_visitPropertyAccess_conditional() {
     _assertSource(
         "a?.b",
-        AstFactory.propertyAccess2(
-            AstFactory.identifier3("a"), "b", TokenType.QUESTION_PERIOD));
+        AstTestFactory.propertyAccess2(
+            AstTestFactory.identifier3("a"), "b", TokenType.QUESTION_PERIOD));
   }
 
   void test_visitRedirectingConstructorInvocation_named() {
     _assertSource(
-        "this.c()", AstFactory.redirectingConstructorInvocation2("c"));
+        "this.c()", AstTestFactory.redirectingConstructorInvocation2("c"));
   }
 
   void test_visitRedirectingConstructorInvocation_unnamed() {
-    _assertSource("this()", AstFactory.redirectingConstructorInvocation());
+    _assertSource("this()", AstTestFactory.redirectingConstructorInvocation());
   }
 
   void test_visitRethrowExpression() {
-    _assertSource("rethrow", AstFactory.rethrowExpression());
+    _assertSource("rethrow", AstTestFactory.rethrowExpression());
   }
 
   void test_visitReturnStatement_expression() {
-    _assertSource(
-        "return a;", AstFactory.returnStatement2(AstFactory.identifier3("a")));
+    _assertSource("return a;",
+        AstTestFactory.returnStatement2(AstTestFactory.identifier3("a")));
   }
 
   void test_visitReturnStatement_noExpression() {
-    _assertSource("return;", AstFactory.returnStatement());
+    _assertSource("return;", AstTestFactory.returnStatement());
   }
 
   void test_visitScriptTag() {
     String scriptTag = "!#/bin/dart.exe";
-    _assertSource(scriptTag, AstFactory.scriptTag(scriptTag));
+    _assertSource(scriptTag, AstTestFactory.scriptTag(scriptTag));
   }
 
   void test_visitSimpleFormalParameter_annotation() {
-    SimpleFormalParameter parameter = AstFactory.simpleFormalParameter3('x');
-    parameter.metadata.add(AstFactory.annotation(AstFactory.identifier3("A")));
+    SimpleFormalParameter parameter =
+        AstTestFactory.simpleFormalParameter3('x');
+    parameter.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("A")));
     _assertSource('@A x', parameter);
   }
 
   void test_visitSimpleFormalParameter_keyword() {
-    _assertSource("var a", AstFactory.simpleFormalParameter(Keyword.VAR, "a"));
+    _assertSource(
+        "var a", AstTestFactory.simpleFormalParameter(Keyword.VAR, "a"));
   }
 
   void test_visitSimpleFormalParameter_keyword_type() {
     _assertSource(
         "final A a",
-        AstFactory.simpleFormalParameter2(
-            Keyword.FINAL, AstFactory.typeName4("A"), "a"));
+        AstTestFactory.simpleFormalParameter2(
+            Keyword.FINAL, AstTestFactory.typeName4("A"), "a"));
   }
 
   void test_visitSimpleFormalParameter_type() {
-    _assertSource("A a",
-        AstFactory.simpleFormalParameter4(AstFactory.typeName4("A"), "a"));
+    _assertSource(
+        "A a",
+        AstTestFactory.simpleFormalParameter4(
+            AstTestFactory.typeName4("A"), "a"));
   }
 
   void test_visitSimpleIdentifier() {
-    _assertSource("a", AstFactory.identifier3("a"));
+    _assertSource("a", AstTestFactory.identifier3("a"));
   }
 
   void test_visitSimpleStringLiteral() {
-    _assertSource("'a'", AstFactory.string2("a"));
+    _assertSource("'a'", AstTestFactory.string2("a"));
   }
 
   void test_visitStringInterpolation() {
     _assertSource(
         "'a\${e}b'",
-        AstFactory.string([
-          AstFactory.interpolationString("'a", "a"),
-          AstFactory.interpolationExpression(AstFactory.identifier3("e")),
-          AstFactory.interpolationString("b'", "b")
+        AstTestFactory.string([
+          AstTestFactory.interpolationString("'a", "a"),
+          AstTestFactory
+              .interpolationExpression(AstTestFactory.identifier3("e")),
+          AstTestFactory.interpolationString("b'", "b")
         ]));
   }
 
   void test_visitSuperConstructorInvocation() {
-    _assertSource("super()", AstFactory.superConstructorInvocation());
+    _assertSource("super()", AstTestFactory.superConstructorInvocation());
   }
 
   void test_visitSuperConstructorInvocation_named() {
-    _assertSource("super.c()", AstFactory.superConstructorInvocation2("c"));
+    _assertSource("super.c()", AstTestFactory.superConstructorInvocation2("c"));
   }
 
   void test_visitSuperExpression() {
-    _assertSource("super", AstFactory.superExpression());
+    _assertSource("super", AstTestFactory.superExpression());
   }
 
   void test_visitSwitchCase_multipleLabels() {
     _assertSource(
         "l1: l2: case a: {}",
-        AstFactory.switchCase2(
-            [AstFactory.label2("l1"), AstFactory.label2("l2")],
-            AstFactory.identifier3("a"),
-            [AstFactory.block()]));
+        AstTestFactory.switchCase2(
+            [AstTestFactory.label2("l1"), AstTestFactory.label2("l2")],
+            AstTestFactory.identifier3("a"),
+            [AstTestFactory.block()]));
   }
 
   void test_visitSwitchCase_multipleStatements() {
     _assertSource(
         "case a: {} {}",
-        AstFactory.switchCase(AstFactory.identifier3("a"),
-            [AstFactory.block(), AstFactory.block()]));
+        AstTestFactory.switchCase(AstTestFactory.identifier3("a"),
+            [AstTestFactory.block(), AstTestFactory.block()]));
   }
 
   void test_visitSwitchCase_noLabels() {
     _assertSource(
         "case a: {}",
-        AstFactory
-            .switchCase(AstFactory.identifier3("a"), [AstFactory.block()]));
+        AstTestFactory.switchCase(
+            AstTestFactory.identifier3("a"), [AstTestFactory.block()]));
   }
 
   void test_visitSwitchCase_singleLabel() {
     _assertSource(
         "l1: case a: {}",
-        AstFactory.switchCase2([AstFactory.label2("l1")],
-            AstFactory.identifier3("a"), [AstFactory.block()]));
+        AstTestFactory.switchCase2([AstTestFactory.label2("l1")],
+            AstTestFactory.identifier3("a"), [AstTestFactory.block()]));
   }
 
   void test_visitSwitchDefault_multipleLabels() {
     _assertSource(
         "l1: l2: default: {}",
-        AstFactory.switchDefault(
-            [AstFactory.label2("l1"), AstFactory.label2("l2")],
-            [AstFactory.block()]));
+        AstTestFactory.switchDefault(
+            [AstTestFactory.label2("l1"), AstTestFactory.label2("l2")],
+            [AstTestFactory.block()]));
   }
 
   void test_visitSwitchDefault_multipleStatements() {
-    _assertSource("default: {} {}",
-        AstFactory.switchDefault2([AstFactory.block(), AstFactory.block()]));
+    _assertSource(
+        "default: {} {}",
+        AstTestFactory
+            .switchDefault2([AstTestFactory.block(), AstTestFactory.block()]));
   }
 
   void test_visitSwitchDefault_noLabels() {
     _assertSource(
-        "default: {}", AstFactory.switchDefault2([AstFactory.block()]));
+        "default: {}", AstTestFactory.switchDefault2([AstTestFactory.block()]));
   }
 
   void test_visitSwitchDefault_singleLabel() {
     _assertSource(
         "l1: default: {}",
-        AstFactory
-            .switchDefault([AstFactory.label2("l1")], [AstFactory.block()]));
+        AstTestFactory.switchDefault(
+            [AstTestFactory.label2("l1")], [AstTestFactory.block()]));
   }
 
   void test_visitSwitchStatement() {
     _assertSource(
         "switch (a) {case 'b': {} default: {}}",
-        AstFactory.switchStatement(AstFactory.identifier3("a"), [
-          AstFactory.switchCase(AstFactory.string2("b"), [AstFactory.block()]),
-          AstFactory.switchDefault2([AstFactory.block()])
+        AstTestFactory.switchStatement(AstTestFactory.identifier3("a"), [
+          AstTestFactory.switchCase(
+              AstTestFactory.string2("b"), [AstTestFactory.block()]),
+          AstTestFactory.switchDefault2([AstTestFactory.block()])
         ]));
   }
 
   void test_visitSymbolLiteral_multiple() {
-    _assertSource("#a.b.c", AstFactory.symbolLiteral(["a", "b", "c"]));
+    _assertSource("#a.b.c", AstTestFactory.symbolLiteral(["a", "b", "c"]));
   }
 
   void test_visitSymbolLiteral_single() {
-    _assertSource("#a", AstFactory.symbolLiteral(["a"]));
+    _assertSource("#a", AstTestFactory.symbolLiteral(["a"]));
   }
 
   void test_visitThisExpression() {
-    _assertSource("this", AstFactory.thisExpression());
+    _assertSource("this", AstTestFactory.thisExpression());
   }
 
   void test_visitThrowStatement() {
-    _assertSource(
-        "throw e", AstFactory.throwExpression2(AstFactory.identifier3("e")));
+    _assertSource("throw e",
+        AstTestFactory.throwExpression2(AstTestFactory.identifier3("e")));
   }
 
   void test_visitTopLevelVariableDeclaration_multiple() {
     _assertSource(
         "var a;",
-        AstFactory.topLevelVariableDeclaration2(
-            Keyword.VAR, [AstFactory.variableDeclaration("a")]));
+        AstTestFactory.topLevelVariableDeclaration2(
+            Keyword.VAR, [AstTestFactory.variableDeclaration("a")]));
   }
 
   void test_visitTopLevelVariableDeclaration_single() {
     _assertSource(
         "var a, b;",
-        AstFactory.topLevelVariableDeclaration2(Keyword.VAR, [
-          AstFactory.variableDeclaration("a"),
-          AstFactory.variableDeclaration("b")
+        AstTestFactory.topLevelVariableDeclaration2(Keyword.VAR, [
+          AstTestFactory.variableDeclaration("a"),
+          AstTestFactory.variableDeclaration("b")
         ]));
   }
 
   void test_visitTryStatement_catch() {
     _assertSource(
         "try {} on E {}",
-        AstFactory.tryStatement2(AstFactory.block(),
-            [AstFactory.catchClause3(AstFactory.typeName4("E"))]));
+        AstTestFactory.tryStatement2(AstTestFactory.block(),
+            [AstTestFactory.catchClause3(AstTestFactory.typeName4("E"))]));
   }
 
   void test_visitTryStatement_catches() {
     _assertSource(
         "try {} on E {} on F {}",
-        AstFactory.tryStatement2(AstFactory.block(), [
-          AstFactory.catchClause3(AstFactory.typeName4("E")),
-          AstFactory.catchClause3(AstFactory.typeName4("F"))
+        AstTestFactory.tryStatement2(AstTestFactory.block(), [
+          AstTestFactory.catchClause3(AstTestFactory.typeName4("E")),
+          AstTestFactory.catchClause3(AstTestFactory.typeName4("F"))
         ]));
   }
 
   void test_visitTryStatement_catchFinally() {
     _assertSource(
         "try {} on E {} finally {}",
-        AstFactory.tryStatement3(
-            AstFactory.block(),
-            [AstFactory.catchClause3(AstFactory.typeName4("E"))],
-            AstFactory.block()));
+        AstTestFactory.tryStatement3(
+            AstTestFactory.block(),
+            [AstTestFactory.catchClause3(AstTestFactory.typeName4("E"))],
+            AstTestFactory.block()));
   }
 
   void test_visitTryStatement_finally() {
-    _assertSource("try {} finally {}",
-        AstFactory.tryStatement(AstFactory.block(), AstFactory.block()));
+    _assertSource(
+        "try {} finally {}",
+        AstTestFactory.tryStatement(
+            AstTestFactory.block(), AstTestFactory.block()));
   }
 
   void test_visitTypeArgumentList_multiple() {
     _assertSource(
         "<E, F>",
-        AstFactory.typeArgumentList(
-            [AstFactory.typeName4("E"), AstFactory.typeName4("F")]));
+        AstTestFactory.typeArgumentList(
+            [AstTestFactory.typeName4("E"), AstTestFactory.typeName4("F")]));
   }
 
   void test_visitTypeArgumentList_single() {
-    _assertSource(
-        "<E>", AstFactory.typeArgumentList([AstFactory.typeName4("E")]));
+    _assertSource("<E>",
+        AstTestFactory.typeArgumentList([AstTestFactory.typeName4("E")]));
   }
 
   void test_visitTypeName_multipleArgs() {
     _assertSource(
         "C<D, E>",
-        AstFactory.typeName4(
-            "C", [AstFactory.typeName4("D"), AstFactory.typeName4("E")]));
+        AstTestFactory.typeName4("C",
+            [AstTestFactory.typeName4("D"), AstTestFactory.typeName4("E")]));
   }
 
   void test_visitTypeName_nestedArg() {
     _assertSource(
         "C<D<E>>",
-        AstFactory.typeName4("C", [
-          AstFactory.typeName4("D", [AstFactory.typeName4("E")])
+        AstTestFactory.typeName4("C", [
+          AstTestFactory.typeName4("D", [AstTestFactory.typeName4("E")])
         ]));
   }
 
   void test_visitTypeName_noArgs() {
-    _assertSource("C", AstFactory.typeName4("C"));
+    _assertSource("C", AstTestFactory.typeName4("C"));
   }
 
   void test_visitTypeName_singleArg() {
     _assertSource(
-        "C<D>", AstFactory.typeName4("C", [AstFactory.typeName4("D")]));
+        "C<D>", AstTestFactory.typeName4("C", [AstTestFactory.typeName4("D")]));
   }
 
   void test_visitTypeParameter_withExtends() {
     _assertSource("E extends C",
-        AstFactory.typeParameter2("E", AstFactory.typeName4("C")));
+        AstTestFactory.typeParameter2("E", AstTestFactory.typeName4("C")));
   }
 
   void test_visitTypeParameter_withMetadata() {
-    TypeParameter parameter = AstFactory.typeParameter("E");
-    parameter.metadata
-        .add(AstFactory.annotation(AstFactory.identifier3("deprecated")));
+    TypeParameter parameter = AstTestFactory.typeParameter("E");
+    parameter.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
     _assertSource("@deprecated E", parameter);
   }
 
   void test_visitTypeParameter_withoutExtends() {
-    _assertSource("E", AstFactory.typeParameter("E"));
+    _assertSource("E", AstTestFactory.typeParameter("E"));
   }
 
   void test_visitTypeParameterList_multiple() {
-    _assertSource("<E, F>", AstFactory.typeParameterList(["E", "F"]));
+    _assertSource("<E, F>", AstTestFactory.typeParameterList(["E", "F"]));
   }
 
   void test_visitTypeParameterList_single() {
-    _assertSource("<E>", AstFactory.typeParameterList(["E"]));
+    _assertSource("<E>", AstTestFactory.typeParameterList(["E"]));
   }
 
   void test_visitVariableDeclaration_initialized() {
-    _assertSource("a = b",
-        AstFactory.variableDeclaration2("a", AstFactory.identifier3("b")));
+    _assertSource(
+        "a = b",
+        AstTestFactory.variableDeclaration2(
+            "a", AstTestFactory.identifier3("b")));
   }
 
   void test_visitVariableDeclaration_uninitialized() {
-    _assertSource("a", AstFactory.variableDeclaration("a"));
+    _assertSource("a", AstTestFactory.variableDeclaration("a"));
   }
 
   void test_visitVariableDeclaration_withMetadata() {
-    VariableDeclaration declaration = AstFactory.variableDeclaration("a");
-    declaration.metadata
-        .add(AstFactory.annotation(AstFactory.identifier3("deprecated")));
+    VariableDeclaration declaration = AstTestFactory.variableDeclaration("a");
+    declaration.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
     _assertSource("@deprecated a", declaration);
   }
 
   void test_visitVariableDeclarationList_const_type() {
     _assertSource(
         "const C a, b",
-        AstFactory.variableDeclarationList(
-            Keyword.CONST, AstFactory.typeName4("C"), [
-          AstFactory.variableDeclaration("a"),
-          AstFactory.variableDeclaration("b")
+        AstTestFactory.variableDeclarationList(
+            Keyword.CONST, AstTestFactory.typeName4("C"), [
+          AstTestFactory.variableDeclaration("a"),
+          AstTestFactory.variableDeclaration("b")
         ]));
   }
 
   void test_visitVariableDeclarationList_final_noType() {
     _assertSource(
         "final a, b",
-        AstFactory.variableDeclarationList2(Keyword.FINAL, [
-          AstFactory.variableDeclaration("a"),
-          AstFactory.variableDeclaration("b")
+        AstTestFactory.variableDeclarationList2(Keyword.FINAL, [
+          AstTestFactory.variableDeclaration("a"),
+          AstTestFactory.variableDeclaration("b")
         ]));
   }
 
   void test_visitVariableDeclarationList_final_withMetadata() {
-    VariableDeclarationList declarationList = AstFactory
+    VariableDeclarationList declarationList = AstTestFactory
         .variableDeclarationList2(Keyword.FINAL, [
-      AstFactory.variableDeclaration("a"),
-      AstFactory.variableDeclaration("b")
+      AstTestFactory.variableDeclaration("a"),
+      AstTestFactory.variableDeclaration("b")
     ]);
-    declarationList.metadata
-        .add(AstFactory.annotation(AstFactory.identifier3("deprecated")));
+    declarationList.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
     _assertSource("@deprecated final a, b", declarationList);
   }
 
   void test_visitVariableDeclarationList_type() {
     _assertSource(
         "C a, b",
-        AstFactory.variableDeclarationList(null, AstFactory.typeName4("C"), [
-          AstFactory.variableDeclaration("a"),
-          AstFactory.variableDeclaration("b")
+        AstTestFactory.variableDeclarationList(
+            null, AstTestFactory.typeName4("C"), [
+          AstTestFactory.variableDeclaration("a"),
+          AstTestFactory.variableDeclaration("b")
         ]));
   }
 
   void test_visitVariableDeclarationList_var() {
     _assertSource(
         "var a, b",
-        AstFactory.variableDeclarationList2(Keyword.VAR, [
-          AstFactory.variableDeclaration("a"),
-          AstFactory.variableDeclaration("b")
+        AstTestFactory.variableDeclarationList2(Keyword.VAR, [
+          AstTestFactory.variableDeclaration("a"),
+          AstTestFactory.variableDeclaration("b")
         ]));
   }
 
   void test_visitVariableDeclarationStatement() {
     _assertSource(
         "C c;",
-        AstFactory.variableDeclarationStatement(null, AstFactory.typeName4("C"),
-            [AstFactory.variableDeclaration("c")]));
+        AstTestFactory.variableDeclarationStatement(
+            null,
+            AstTestFactory.typeName4("C"),
+            [AstTestFactory.variableDeclaration("c")]));
   }
 
   void test_visitWhileStatement() {
     _assertSource(
         "while (c) {}",
-        AstFactory.whileStatement(
-            AstFactory.identifier3("c"), AstFactory.block()));
+        AstTestFactory.whileStatement(
+            AstTestFactory.identifier3("c"), AstTestFactory.block()));
   }
 
   void test_visitWithClause_multiple() {
     _assertSource(
         "with A, B, C",
-        AstFactory.withClause([
-          AstFactory.typeName4("A"),
-          AstFactory.typeName4("B"),
-          AstFactory.typeName4("C")
+        AstTestFactory.withClause([
+          AstTestFactory.typeName4("A"),
+          AstTestFactory.typeName4("B"),
+          AstTestFactory.typeName4("C")
         ]));
   }
 
   void test_visitWithClause_single() {
-    _assertSource("with A", AstFactory.withClause([AstFactory.typeName4("A")]));
+    _assertSource(
+        "with A", AstTestFactory.withClause([AstTestFactory.typeName4("A")]));
   }
 
   void test_visitYieldStatement() {
-    _assertSource(
-        "yield e;", AstFactory.yieldStatement(AstFactory.identifier3("e")));
+    _assertSource("yield e;",
+        AstTestFactory.yieldStatement(AstTestFactory.identifier3("e")));
   }
 
   void test_visitYieldStatement_each() {
     _assertSource("yield* e;",
-        AstFactory.yieldEachStatement(AstFactory.identifier3("e")));
+        AstTestFactory.yieldEachStatement(AstTestFactory.identifier3("e")));
   }
 
   /**
-   * Assert that a `ToSourceVisitor` will produce the expected source when visiting the given
-   * node.
-   *
-   * @param expectedSource the source string that the visitor is expected to produce
-   * @param node the AST node being visited to produce the actual source
-   * @throws AFE if the visitor does not produce the expected source for the given node
+   * Assert that a `ToSourceVisitor2` will produce the [expectedSource] when
+   * visiting the given [node].
+   */
+  void _assertSource(String expectedSource, AstNode node) {
+    StringBuffer buffer = new StringBuffer();
+    node.accept(new ToSourceVisitor2(buffer));
+    expect(buffer.toString(), expectedSource);
+  }
+}
+
+@deprecated
+@reflectiveTest
+class ToSourceVisitorTest extends EngineTestCase {
+  void test_visitAdjacentStrings() {
+    _assertSource(
+        "'a' 'b'",
+        AstTestFactory.adjacentStrings(
+            [AstTestFactory.string2("a"), AstTestFactory.string2("b")]));
+  }
+
+  void test_visitAnnotation_constant() {
+    _assertSource(
+        "@A", AstTestFactory.annotation(AstTestFactory.identifier3("A")));
+  }
+
+  void test_visitAnnotation_constructor() {
+    _assertSource(
+        "@A.c()",
+        AstTestFactory.annotation2(AstTestFactory.identifier3("A"),
+            AstTestFactory.identifier3("c"), AstTestFactory.argumentList()));
+  }
+
+  void test_visitArgumentList() {
+    _assertSource(
+        "(a, b)",
+        AstTestFactory.argumentList([
+          AstTestFactory.identifier3("a"),
+          AstTestFactory.identifier3("b")
+        ]));
+  }
+
+  void test_visitAsExpression() {
+    _assertSource(
+        "e as T",
+        AstTestFactory.asExpression(
+            AstTestFactory.identifier3("e"), AstTestFactory.typeName4("T")));
+  }
+
+  void test_visitAssertStatement() {
+    _assertSource("assert (a);",
+        AstTestFactory.assertStatement(AstTestFactory.identifier3("a")));
+  }
+
+  void test_visitAssertStatement_withMessage() {
+    _assertSource(
+        "assert (a, b);",
+        AstTestFactory.assertStatement(
+            AstTestFactory.identifier3("a"), AstTestFactory.identifier3('b')));
+  }
+
+  void test_visitAssignmentExpression() {
+    _assertSource(
+        "a = b",
+        AstTestFactory.assignmentExpression(AstTestFactory.identifier3("a"),
+            TokenType.EQ, AstTestFactory.identifier3("b")));
+  }
+
+  void test_visitAwaitExpression() {
+    _assertSource("await e",
+        AstTestFactory.awaitExpression(AstTestFactory.identifier3("e")));
+  }
+
+  void test_visitBinaryExpression() {
+    _assertSource(
+        "a + b",
+        AstTestFactory.binaryExpression(AstTestFactory.identifier3("a"),
+            TokenType.PLUS, AstTestFactory.identifier3("b")));
+  }
+
+  void test_visitBlock_empty() {
+    _assertSource("{}", AstTestFactory.block());
+  }
+
+  void test_visitBlock_nonEmpty() {
+    _assertSource(
+        "{break; break;}",
+        AstTestFactory.block([
+          AstTestFactory.breakStatement(),
+          AstTestFactory.breakStatement()
+        ]));
+  }
+
+  void test_visitBlockFunctionBody_async() {
+    _assertSource("async {}", AstTestFactory.asyncBlockFunctionBody());
+  }
+
+  void test_visitBlockFunctionBody_async_star() {
+    _assertSource(
+        "async* {}", AstTestFactory.asyncGeneratorBlockFunctionBody());
+  }
+
+  void test_visitBlockFunctionBody_simple() {
+    _assertSource("{}", AstTestFactory.blockFunctionBody2());
+  }
+
+  void test_visitBlockFunctionBody_sync() {
+    _assertSource("sync {}", AstTestFactory.syncBlockFunctionBody());
+  }
+
+  void test_visitBlockFunctionBody_sync_star() {
+    _assertSource("sync* {}", AstTestFactory.syncGeneratorBlockFunctionBody());
+  }
+
+  void test_visitBooleanLiteral_false() {
+    _assertSource("false", AstTestFactory.booleanLiteral(false));
+  }
+
+  void test_visitBooleanLiteral_true() {
+    _assertSource("true", AstTestFactory.booleanLiteral(true));
+  }
+
+  void test_visitBreakStatement_label() {
+    _assertSource("break l;", AstTestFactory.breakStatement2("l"));
+  }
+
+  void test_visitBreakStatement_noLabel() {
+    _assertSource("break;", AstTestFactory.breakStatement());
+  }
+
+  void test_visitCascadeExpression_field() {
+    _assertSource(
+        "a..b..c",
+        AstTestFactory.cascadeExpression(AstTestFactory.identifier3("a"), [
+          AstTestFactory.cascadedPropertyAccess("b"),
+          AstTestFactory.cascadedPropertyAccess("c")
+        ]));
+  }
+
+  void test_visitCascadeExpression_index() {
+    _assertSource(
+        "a..[0]..[1]",
+        AstTestFactory.cascadeExpression(AstTestFactory.identifier3("a"), [
+          AstTestFactory.cascadedIndexExpression(AstTestFactory.integer(0)),
+          AstTestFactory.cascadedIndexExpression(AstTestFactory.integer(1))
+        ]));
+  }
+
+  void test_visitCascadeExpression_method() {
+    _assertSource(
+        "a..b()..c()",
+        AstTestFactory.cascadeExpression(AstTestFactory.identifier3("a"), [
+          AstTestFactory.cascadedMethodInvocation("b"),
+          AstTestFactory.cascadedMethodInvocation("c")
+        ]));
+  }
+
+  void test_visitCatchClause_catch_noStack() {
+    _assertSource("catch (e) {}", AstTestFactory.catchClause("e"));
+  }
+
+  void test_visitCatchClause_catch_stack() {
+    _assertSource("catch (e, s) {}", AstTestFactory.catchClause2("e", "s"));
+  }
+
+  void test_visitCatchClause_on() {
+    _assertSource(
+        "on E {}", AstTestFactory.catchClause3(AstTestFactory.typeName4("E")));
+  }
+
+  void test_visitCatchClause_on_catch() {
+    _assertSource("on E catch (e) {}",
+        AstTestFactory.catchClause4(AstTestFactory.typeName4("E"), "e"));
+  }
+
+  void test_visitClassDeclaration_abstract() {
+    _assertSource(
+        "abstract class C {}",
+        AstTestFactory.classDeclaration(
+            Keyword.ABSTRACT, "C", null, null, null, null));
+  }
+
+  void test_visitClassDeclaration_empty() {
+    _assertSource("class C {}",
+        AstTestFactory.classDeclaration(null, "C", null, null, null, null));
+  }
+
+  void test_visitClassDeclaration_extends() {
+    _assertSource(
+        "class C extends A {}",
+        AstTestFactory.classDeclaration(
+            null,
+            "C",
+            null,
+            AstTestFactory.extendsClause(AstTestFactory.typeName4("A")),
+            null,
+            null));
+  }
+
+  void test_visitClassDeclaration_extends_implements() {
+    _assertSource(
+        "class C extends A implements B {}",
+        AstTestFactory.classDeclaration(
+            null,
+            "C",
+            null,
+            AstTestFactory.extendsClause(AstTestFactory.typeName4("A")),
+            null,
+            AstTestFactory.implementsClause([AstTestFactory.typeName4("B")])));
+  }
+
+  void test_visitClassDeclaration_extends_with() {
+    _assertSource(
+        "class C extends A with M {}",
+        AstTestFactory.classDeclaration(
+            null,
+            "C",
+            null,
+            AstTestFactory.extendsClause(AstTestFactory.typeName4("A")),
+            AstTestFactory.withClause([AstTestFactory.typeName4("M")]),
+            null));
+  }
+
+  void test_visitClassDeclaration_extends_with_implements() {
+    _assertSource(
+        "class C extends A with M implements B {}",
+        AstTestFactory.classDeclaration(
+            null,
+            "C",
+            null,
+            AstTestFactory.extendsClause(AstTestFactory.typeName4("A")),
+            AstTestFactory.withClause([AstTestFactory.typeName4("M")]),
+            AstTestFactory.implementsClause([AstTestFactory.typeName4("B")])));
+  }
+
+  void test_visitClassDeclaration_implements() {
+    _assertSource(
+        "class C implements B {}",
+        AstTestFactory.classDeclaration(null, "C", null, null, null,
+            AstTestFactory.implementsClause([AstTestFactory.typeName4("B")])));
+  }
+
+  void test_visitClassDeclaration_multipleMember() {
+    _assertSource(
+        "class C {var a; var b;}",
+        AstTestFactory.classDeclaration(null, "C", null, null, null, null, [
+          AstTestFactory.fieldDeclaration2(
+              false, Keyword.VAR, [AstTestFactory.variableDeclaration("a")]),
+          AstTestFactory.fieldDeclaration2(
+              false, Keyword.VAR, [AstTestFactory.variableDeclaration("b")])
+        ]));
+  }
+
+  void test_visitClassDeclaration_parameters() {
+    _assertSource(
+        "class C<E> {}",
+        AstTestFactory.classDeclaration(null, "C",
+            AstTestFactory.typeParameterList(["E"]), null, null, null));
+  }
+
+  void test_visitClassDeclaration_parameters_extends() {
+    _assertSource(
+        "class C<E> extends A {}",
+        AstTestFactory.classDeclaration(
+            null,
+            "C",
+            AstTestFactory.typeParameterList(["E"]),
+            AstTestFactory.extendsClause(AstTestFactory.typeName4("A")),
+            null,
+            null));
+  }
+
+  void test_visitClassDeclaration_parameters_extends_implements() {
+    _assertSource(
+        "class C<E> extends A implements B {}",
+        AstTestFactory.classDeclaration(
+            null,
+            "C",
+            AstTestFactory.typeParameterList(["E"]),
+            AstTestFactory.extendsClause(AstTestFactory.typeName4("A")),
+            null,
+            AstTestFactory.implementsClause([AstTestFactory.typeName4("B")])));
+  }
+
+  void test_visitClassDeclaration_parameters_extends_with() {
+    _assertSource(
+        "class C<E> extends A with M {}",
+        AstTestFactory.classDeclaration(
+            null,
+            "C",
+            AstTestFactory.typeParameterList(["E"]),
+            AstTestFactory.extendsClause(AstTestFactory.typeName4("A")),
+            AstTestFactory.withClause([AstTestFactory.typeName4("M")]),
+            null));
+  }
+
+  void test_visitClassDeclaration_parameters_extends_with_implements() {
+    _assertSource(
+        "class C<E> extends A with M implements B {}",
+        AstTestFactory.classDeclaration(
+            null,
+            "C",
+            AstTestFactory.typeParameterList(["E"]),
+            AstTestFactory.extendsClause(AstTestFactory.typeName4("A")),
+            AstTestFactory.withClause([AstTestFactory.typeName4("M")]),
+            AstTestFactory.implementsClause([AstTestFactory.typeName4("B")])));
+  }
+
+  void test_visitClassDeclaration_parameters_implements() {
+    _assertSource(
+        "class C<E> implements B {}",
+        AstTestFactory.classDeclaration(
+            null,
+            "C",
+            AstTestFactory.typeParameterList(["E"]),
+            null,
+            null,
+            AstTestFactory.implementsClause([AstTestFactory.typeName4("B")])));
+  }
+
+  void test_visitClassDeclaration_singleMember() {
+    _assertSource(
+        "class C {var a;}",
+        AstTestFactory.classDeclaration(null, "C", null, null, null, null, [
+          AstTestFactory.fieldDeclaration2(
+              false, Keyword.VAR, [AstTestFactory.variableDeclaration("a")])
+        ]));
+  }
+
+  void test_visitClassDeclaration_withMetadata() {
+    ClassDeclaration declaration =
+        AstTestFactory.classDeclaration(null, "C", null, null, null, null);
+    declaration.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
+    _assertSource("@deprecated class C {}", declaration);
+  }
+
+  void test_visitClassTypeAlias_abstract() {
+    _assertSource(
+        "abstract class C = S with M1;",
+        AstTestFactory.classTypeAlias(
+            "C",
+            null,
+            Keyword.ABSTRACT,
+            AstTestFactory.typeName4("S"),
+            AstTestFactory.withClause([AstTestFactory.typeName4("M1")]),
+            null));
+  }
+
+  void test_visitClassTypeAlias_abstract_implements() {
+    _assertSource(
+        "abstract class C = S with M1 implements I;",
+        AstTestFactory.classTypeAlias(
+            "C",
+            null,
+            Keyword.ABSTRACT,
+            AstTestFactory.typeName4("S"),
+            AstTestFactory.withClause([AstTestFactory.typeName4("M1")]),
+            AstTestFactory.implementsClause([AstTestFactory.typeName4("I")])));
+  }
+
+  void test_visitClassTypeAlias_generic() {
+    _assertSource(
+        "class C<E> = S<E> with M1<E>;",
+        AstTestFactory.classTypeAlias(
+            "C",
+            AstTestFactory.typeParameterList(["E"]),
+            null,
+            AstTestFactory.typeName4("S", [AstTestFactory.typeName4("E")]),
+            AstTestFactory.withClause([
+              AstTestFactory.typeName4("M1", [AstTestFactory.typeName4("E")])
+            ]),
+            null));
+  }
+
+  void test_visitClassTypeAlias_implements() {
+    _assertSource(
+        "class C = S with M1 implements I;",
+        AstTestFactory.classTypeAlias(
+            "C",
+            null,
+            null,
+            AstTestFactory.typeName4("S"),
+            AstTestFactory.withClause([AstTestFactory.typeName4("M1")]),
+            AstTestFactory.implementsClause([AstTestFactory.typeName4("I")])));
+  }
+
+  void test_visitClassTypeAlias_minimal() {
+    _assertSource(
+        "class C = S with M1;",
+        AstTestFactory.classTypeAlias(
+            "C",
+            null,
+            null,
+            AstTestFactory.typeName4("S"),
+            AstTestFactory.withClause([AstTestFactory.typeName4("M1")]),
+            null));
+  }
+
+  void test_visitClassTypeAlias_parameters_abstract() {
+    _assertSource(
+        "abstract class C<E> = S with M1;",
+        AstTestFactory.classTypeAlias(
+            "C",
+            AstTestFactory.typeParameterList(["E"]),
+            Keyword.ABSTRACT,
+            AstTestFactory.typeName4("S"),
+            AstTestFactory.withClause([AstTestFactory.typeName4("M1")]),
+            null));
+  }
+
+  void test_visitClassTypeAlias_parameters_abstract_implements() {
+    _assertSource(
+        "abstract class C<E> = S with M1 implements I;",
+        AstTestFactory.classTypeAlias(
+            "C",
+            AstTestFactory.typeParameterList(["E"]),
+            Keyword.ABSTRACT,
+            AstTestFactory.typeName4("S"),
+            AstTestFactory.withClause([AstTestFactory.typeName4("M1")]),
+            AstTestFactory.implementsClause([AstTestFactory.typeName4("I")])));
+  }
+
+  void test_visitClassTypeAlias_parameters_implements() {
+    _assertSource(
+        "class C<E> = S with M1 implements I;",
+        AstTestFactory.classTypeAlias(
+            "C",
+            AstTestFactory.typeParameterList(["E"]),
+            null,
+            AstTestFactory.typeName4("S"),
+            AstTestFactory.withClause([AstTestFactory.typeName4("M1")]),
+            AstTestFactory.implementsClause([AstTestFactory.typeName4("I")])));
+  }
+
+  void test_visitClassTypeAlias_withMetadata() {
+    ClassTypeAlias declaration = AstTestFactory.classTypeAlias(
+        "C",
+        null,
+        null,
+        AstTestFactory.typeName4("S"),
+        AstTestFactory.withClause([AstTestFactory.typeName4("M1")]),
+        null);
+    declaration.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
+    _assertSource("@deprecated class C = S with M1;", declaration);
+  }
+
+  void test_visitComment() {
+    _assertSource(
+        "",
+        Comment.createBlockComment(
+            <Token>[TokenFactory.tokenFromString("/* comment */")]));
+  }
+
+  void test_visitCommentReference() {
+    _assertSource(
+        "", new CommentReference(null, AstTestFactory.identifier3("a")));
+  }
+
+  void test_visitCompilationUnit_declaration() {
+    _assertSource(
+        "var a;",
+        AstTestFactory.compilationUnit2([
+          AstTestFactory.topLevelVariableDeclaration2(
+              Keyword.VAR, [AstTestFactory.variableDeclaration("a")])
+        ]));
+  }
+
+  void test_visitCompilationUnit_directive() {
+    _assertSource(
+        "library l;",
+        AstTestFactory
+            .compilationUnit3([AstTestFactory.libraryDirective2("l")]));
+  }
+
+  void test_visitCompilationUnit_directive_declaration() {
+    _assertSource(
+        "library l; var a;",
+        AstTestFactory.compilationUnit4([
+          AstTestFactory.libraryDirective2("l")
+        ], [
+          AstTestFactory.topLevelVariableDeclaration2(
+              Keyword.VAR, [AstTestFactory.variableDeclaration("a")])
+        ]));
+  }
+
+  void test_visitCompilationUnit_empty() {
+    _assertSource("", AstTestFactory.compilationUnit());
+  }
+
+  void test_visitCompilationUnit_script() {
+    _assertSource(
+        "!#/bin/dartvm", AstTestFactory.compilationUnit5("!#/bin/dartvm"));
+  }
+
+  void test_visitCompilationUnit_script_declaration() {
+    _assertSource(
+        "!#/bin/dartvm var a;",
+        AstTestFactory.compilationUnit6("!#/bin/dartvm", [
+          AstTestFactory.topLevelVariableDeclaration2(
+              Keyword.VAR, [AstTestFactory.variableDeclaration("a")])
+        ]));
+  }
+
+  void test_visitCompilationUnit_script_directive() {
+    _assertSource(
+        "!#/bin/dartvm library l;",
+        AstTestFactory.compilationUnit7(
+            "!#/bin/dartvm", [AstTestFactory.libraryDirective2("l")]));
+  }
+
+  void test_visitCompilationUnit_script_directives_declarations() {
+    _assertSource(
+        "!#/bin/dartvm library l; var a;",
+        AstTestFactory.compilationUnit8("!#/bin/dartvm", [
+          AstTestFactory.libraryDirective2("l")
+        ], [
+          AstTestFactory.topLevelVariableDeclaration2(
+              Keyword.VAR, [AstTestFactory.variableDeclaration("a")])
+        ]));
+  }
+
+  void test_visitConditionalExpression() {
+    _assertSource(
+        "a ? b : c",
+        AstTestFactory.conditionalExpression(AstTestFactory.identifier3("a"),
+            AstTestFactory.identifier3("b"), AstTestFactory.identifier3("c")));
+  }
+
+  void test_visitConstructorDeclaration_const() {
+    _assertSource(
+        "const C() {}",
+        AstTestFactory.constructorDeclaration2(
+            Keyword.CONST,
+            null,
+            AstTestFactory.identifier3("C"),
+            null,
+            AstTestFactory.formalParameterList(),
+            null,
+            AstTestFactory.blockFunctionBody2()));
+  }
+
+  void test_visitConstructorDeclaration_external() {
+    _assertSource(
+        "external C();",
+        AstTestFactory.constructorDeclaration(AstTestFactory.identifier3("C"),
+            null, AstTestFactory.formalParameterList(), null));
+  }
+
+  void test_visitConstructorDeclaration_minimal() {
+    _assertSource(
+        "C() {}",
+        AstTestFactory.constructorDeclaration2(
+            null,
+            null,
+            AstTestFactory.identifier3("C"),
+            null,
+            AstTestFactory.formalParameterList(),
+            null,
+            AstTestFactory.blockFunctionBody2()));
+  }
+
+  void test_visitConstructorDeclaration_multipleInitializers() {
+    _assertSource(
+        "C() : a = b, c = d {}",
+        AstTestFactory.constructorDeclaration2(
+            null,
+            null,
+            AstTestFactory.identifier3("C"),
+            null,
+            AstTestFactory.formalParameterList(),
+            [
+              AstTestFactory.constructorFieldInitializer(
+                  false, "a", AstTestFactory.identifier3("b")),
+              AstTestFactory.constructorFieldInitializer(
+                  false, "c", AstTestFactory.identifier3("d"))
+            ],
+            AstTestFactory.blockFunctionBody2()));
+  }
+
+  void test_visitConstructorDeclaration_multipleParameters() {
+    _assertSource(
+        "C(var a, var b) {}",
+        AstTestFactory.constructorDeclaration2(
+            null,
+            null,
+            AstTestFactory.identifier3("C"),
+            null,
+            AstTestFactory.formalParameterList([
+              AstTestFactory.simpleFormalParameter(Keyword.VAR, "a"),
+              AstTestFactory.simpleFormalParameter(Keyword.VAR, "b")
+            ]),
+            null,
+            AstTestFactory.blockFunctionBody2()));
+  }
+
+  void test_visitConstructorDeclaration_named() {
+    _assertSource(
+        "C.m() {}",
+        AstTestFactory.constructorDeclaration2(
+            null,
+            null,
+            AstTestFactory.identifier3("C"),
+            "m",
+            AstTestFactory.formalParameterList(),
+            null,
+            AstTestFactory.blockFunctionBody2()));
+  }
+
+  void test_visitConstructorDeclaration_singleInitializer() {
+    _assertSource(
+        "C() : a = b {}",
+        AstTestFactory.constructorDeclaration2(
+            null,
+            null,
+            AstTestFactory.identifier3("C"),
+            null,
+            AstTestFactory.formalParameterList(),
+            [
+              AstTestFactory.constructorFieldInitializer(
+                  false, "a", AstTestFactory.identifier3("b"))
+            ],
+            AstTestFactory.blockFunctionBody2()));
+  }
+
+  void test_visitConstructorDeclaration_withMetadata() {
+    ConstructorDeclaration declaration = AstTestFactory.constructorDeclaration2(
+        null,
+        null,
+        AstTestFactory.identifier3("C"),
+        null,
+        AstTestFactory.formalParameterList(),
+        null,
+        AstTestFactory.blockFunctionBody2());
+    declaration.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
+    _assertSource("@deprecated C() {}", declaration);
+  }
+
+  void test_visitConstructorFieldInitializer_withoutThis() {
+    _assertSource(
+        "a = b",
+        AstTestFactory.constructorFieldInitializer(
+            false, "a", AstTestFactory.identifier3("b")));
+  }
+
+  void test_visitConstructorFieldInitializer_withThis() {
+    _assertSource(
+        "this.a = b",
+        AstTestFactory.constructorFieldInitializer(
+            true, "a", AstTestFactory.identifier3("b")));
+  }
+
+  void test_visitConstructorName_named_prefix() {
+    _assertSource(
+        "p.C.n",
+        AstTestFactory.constructorName(
+            AstTestFactory.typeName4("p.C.n"), null));
+  }
+
+  void test_visitConstructorName_unnamed_noPrefix() {
+    _assertSource("C",
+        AstTestFactory.constructorName(AstTestFactory.typeName4("C"), null));
+  }
+
+  void test_visitConstructorName_unnamed_prefix() {
+    _assertSource(
+        "p.C",
+        AstTestFactory.constructorName(
+            AstTestFactory.typeName3(AstTestFactory.identifier5("p", "C")),
+            null));
+  }
+
+  void test_visitContinueStatement_label() {
+    _assertSource("continue l;", AstTestFactory.continueStatement("l"));
+  }
+
+  void test_visitContinueStatement_noLabel() {
+    _assertSource("continue;", AstTestFactory.continueStatement());
+  }
+
+  void test_visitDefaultFormalParameter_annotation() {
+    DefaultFormalParameter parameter = AstTestFactory.positionalFormalParameter(
+        AstTestFactory.simpleFormalParameter3("p"), AstTestFactory.integer(0));
+    parameter.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("A")));
+    _assertSource('@A p = 0', parameter);
+  }
+
+  void test_visitDefaultFormalParameter_named_noValue() {
+    _assertSource(
+        "p",
+        AstTestFactory.namedFormalParameter(
+            AstTestFactory.simpleFormalParameter3("p"), null));
+  }
+
+  void test_visitDefaultFormalParameter_named_value() {
+    _assertSource(
+        "p : 0",
+        AstTestFactory.namedFormalParameter(
+            AstTestFactory.simpleFormalParameter3("p"),
+            AstTestFactory.integer(0)));
+  }
+
+  void test_visitDefaultFormalParameter_positional_noValue() {
+    _assertSource(
+        "p",
+        AstTestFactory.positionalFormalParameter(
+            AstTestFactory.simpleFormalParameter3("p"), null));
+  }
+
+  void test_visitDefaultFormalParameter_positional_value() {
+    _assertSource(
+        "p = 0",
+        AstTestFactory.positionalFormalParameter(
+            AstTestFactory.simpleFormalParameter3("p"),
+            AstTestFactory.integer(0)));
+  }
+
+  void test_visitDoStatement() {
+    _assertSource(
+        "do {} while (c);",
+        AstTestFactory.doStatement(
+            AstTestFactory.block(), AstTestFactory.identifier3("c")));
+  }
+
+  void test_visitDoubleLiteral() {
+    _assertSource("4.2", AstTestFactory.doubleLiteral(4.2));
+  }
+
+  void test_visitEmptyFunctionBody() {
+    _assertSource(";", AstTestFactory.emptyFunctionBody());
+  }
+
+  void test_visitEmptyStatement() {
+    _assertSource(";", AstTestFactory.emptyStatement());
+  }
+
+  void test_visitEnumDeclaration_multiple() {
+    _assertSource("enum E {ONE, TWO}",
+        AstTestFactory.enumDeclaration2("E", ["ONE", "TWO"]));
+  }
+
+  void test_visitEnumDeclaration_single() {
+    _assertSource(
+        "enum E {ONE}", AstTestFactory.enumDeclaration2("E", ["ONE"]));
+  }
+
+  void test_visitExportDirective_combinator() {
+    _assertSource(
+        "export 'a.dart' show A;",
+        AstTestFactory.exportDirective2("a.dart", [
+          AstTestFactory.showCombinator([AstTestFactory.identifier3("A")])
+        ]));
+  }
+
+  void test_visitExportDirective_combinators() {
+    _assertSource(
+        "export 'a.dart' show A hide B;",
+        AstTestFactory.exportDirective2("a.dart", [
+          AstTestFactory.showCombinator([AstTestFactory.identifier3("A")]),
+          AstTestFactory.hideCombinator([AstTestFactory.identifier3("B")])
+        ]));
+  }
+
+  void test_visitExportDirective_minimal() {
+    _assertSource(
+        "export 'a.dart';", AstTestFactory.exportDirective2("a.dart"));
+  }
+
+  void test_visitExportDirective_withMetadata() {
+    ExportDirective directive = AstTestFactory.exportDirective2("a.dart");
+    directive.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
+    _assertSource("@deprecated export 'a.dart';", directive);
+  }
+
+  void test_visitExpressionFunctionBody_async() {
+    _assertSource(
+        "async => a;",
+        AstTestFactory
+            .asyncExpressionFunctionBody(AstTestFactory.identifier3("a")));
+  }
+
+  void test_visitExpressionFunctionBody_simple() {
+    _assertSource("=> a;",
+        AstTestFactory.expressionFunctionBody(AstTestFactory.identifier3("a")));
+  }
+
+  void test_visitExpressionStatement() {
+    _assertSource("a;",
+        AstTestFactory.expressionStatement(AstTestFactory.identifier3("a")));
+  }
+
+  void test_visitExtendsClause() {
+    _assertSource("extends C",
+        AstTestFactory.extendsClause(AstTestFactory.typeName4("C")));
+  }
+
+  void test_visitFieldDeclaration_instance() {
+    _assertSource(
+        "var a;",
+        AstTestFactory.fieldDeclaration2(
+            false, Keyword.VAR, [AstTestFactory.variableDeclaration("a")]));
+  }
+
+  void test_visitFieldDeclaration_static() {
+    _assertSource(
+        "static var a;",
+        AstTestFactory.fieldDeclaration2(
+            true, Keyword.VAR, [AstTestFactory.variableDeclaration("a")]));
+  }
+
+  void test_visitFieldDeclaration_withMetadata() {
+    FieldDeclaration declaration = AstTestFactory.fieldDeclaration2(
+        false, Keyword.VAR, [AstTestFactory.variableDeclaration("a")]);
+    declaration.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
+    _assertSource("@deprecated var a;", declaration);
+  }
+
+  void test_visitFieldFormalParameter_annotation() {
+    FieldFormalParameter parameter = AstTestFactory.fieldFormalParameter2('f');
+    parameter.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("A")));
+    _assertSource('@A this.f', parameter);
+  }
+
+  void test_visitFieldFormalParameter_functionTyped() {
+    _assertSource(
+        "A this.a(b)",
+        AstTestFactory.fieldFormalParameter(
+            null,
+            AstTestFactory.typeName4("A"),
+            "a",
+            AstTestFactory.formalParameterList(
+                [AstTestFactory.simpleFormalParameter3("b")])));
+  }
+
+  void test_visitFieldFormalParameter_functionTyped_typeParameters() {
+    _assertSource(
+        "A this.a<E, F>(b)",
+        new FieldFormalParameter(
+            null,
+            null,
+            null,
+            AstTestFactory.typeName4('A'),
+            TokenFactory.tokenFromKeyword(Keyword.THIS),
+            TokenFactory.tokenFromType(TokenType.PERIOD),
+            AstTestFactory.identifier3('a'),
+            AstTestFactory.typeParameterList(['E', 'F']),
+            AstTestFactory.formalParameterList(
+                [AstTestFactory.simpleFormalParameter3("b")])));
+  }
+
+  void test_visitFieldFormalParameter_keyword() {
+    _assertSource("var this.a",
+        AstTestFactory.fieldFormalParameter(Keyword.VAR, null, "a"));
+  }
+
+  void test_visitFieldFormalParameter_keywordAndType() {
+    _assertSource(
+        "final A this.a",
+        AstTestFactory.fieldFormalParameter(
+            Keyword.FINAL, AstTestFactory.typeName4("A"), "a"));
+  }
+
+  void test_visitFieldFormalParameter_type() {
+    _assertSource(
+        "A this.a",
+        AstTestFactory.fieldFormalParameter(
+            null, AstTestFactory.typeName4("A"), "a"));
+  }
+
+  void test_visitForEachStatement_declared() {
+    _assertSource(
+        "for (var a in b) {}",
+        AstTestFactory.forEachStatement(AstTestFactory.declaredIdentifier3("a"),
+            AstTestFactory.identifier3("b"), AstTestFactory.block()));
+  }
+
+  void test_visitForEachStatement_variable() {
+    _assertSource(
+        "for (a in b) {}",
+        new ForEachStatement.withReference(
+            null,
+            TokenFactory.tokenFromKeyword(Keyword.FOR),
+            TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+            AstTestFactory.identifier3("a"),
+            TokenFactory.tokenFromKeyword(Keyword.IN),
+            AstTestFactory.identifier3("b"),
+            TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+            AstTestFactory.block()));
+  }
+
+  void test_visitForEachStatement_variable_await() {
+    _assertSource(
+        "await for (a in b) {}",
+        new ForEachStatement.withReference(
+            TokenFactory.tokenFromString("await"),
+            TokenFactory.tokenFromKeyword(Keyword.FOR),
+            TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+            AstTestFactory.identifier3("a"),
+            TokenFactory.tokenFromKeyword(Keyword.IN),
+            AstTestFactory.identifier3("b"),
+            TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+            AstTestFactory.block()));
+  }
+
+  void test_visitFormalParameterList_empty() {
+    _assertSource("()", AstTestFactory.formalParameterList());
+  }
+
+  void test_visitFormalParameterList_n() {
+    _assertSource(
+        "({a : 0})",
+        AstTestFactory.formalParameterList([
+          AstTestFactory.namedFormalParameter(
+              AstTestFactory.simpleFormalParameter3("a"),
+              AstTestFactory.integer(0))
+        ]));
+  }
+
+  void test_visitFormalParameterList_nn() {
+    _assertSource(
+        "({a : 0, b : 1})",
+        AstTestFactory.formalParameterList([
+          AstTestFactory.namedFormalParameter(
+              AstTestFactory.simpleFormalParameter3("a"),
+              AstTestFactory.integer(0)),
+          AstTestFactory.namedFormalParameter(
+              AstTestFactory.simpleFormalParameter3("b"),
+              AstTestFactory.integer(1))
+        ]));
+  }
+
+  void test_visitFormalParameterList_p() {
+    _assertSource(
+        "([a = 0])",
+        AstTestFactory.formalParameterList([
+          AstTestFactory.positionalFormalParameter(
+              AstTestFactory.simpleFormalParameter3("a"),
+              AstTestFactory.integer(0))
+        ]));
+  }
+
+  void test_visitFormalParameterList_pp() {
+    _assertSource(
+        "([a = 0, b = 1])",
+        AstTestFactory.formalParameterList([
+          AstTestFactory.positionalFormalParameter(
+              AstTestFactory.simpleFormalParameter3("a"),
+              AstTestFactory.integer(0)),
+          AstTestFactory.positionalFormalParameter(
+              AstTestFactory.simpleFormalParameter3("b"),
+              AstTestFactory.integer(1))
+        ]));
+  }
+
+  void test_visitFormalParameterList_r() {
+    _assertSource(
+        "(a)",
+        AstTestFactory
+            .formalParameterList([AstTestFactory.simpleFormalParameter3("a")]));
+  }
+
+  void test_visitFormalParameterList_rn() {
+    _assertSource(
+        "(a, {b : 1})",
+        AstTestFactory.formalParameterList([
+          AstTestFactory.simpleFormalParameter3("a"),
+          AstTestFactory.namedFormalParameter(
+              AstTestFactory.simpleFormalParameter3("b"),
+              AstTestFactory.integer(1))
+        ]));
+  }
+
+  void test_visitFormalParameterList_rnn() {
+    _assertSource(
+        "(a, {b : 1, c : 2})",
+        AstTestFactory.formalParameterList([
+          AstTestFactory.simpleFormalParameter3("a"),
+          AstTestFactory.namedFormalParameter(
+              AstTestFactory.simpleFormalParameter3("b"),
+              AstTestFactory.integer(1)),
+          AstTestFactory.namedFormalParameter(
+              AstTestFactory.simpleFormalParameter3("c"),
+              AstTestFactory.integer(2))
+        ]));
+  }
+
+  void test_visitFormalParameterList_rp() {
+    _assertSource(
+        "(a, [b = 1])",
+        AstTestFactory.formalParameterList([
+          AstTestFactory.simpleFormalParameter3("a"),
+          AstTestFactory.positionalFormalParameter(
+              AstTestFactory.simpleFormalParameter3("b"),
+              AstTestFactory.integer(1))
+        ]));
+  }
+
+  void test_visitFormalParameterList_rpp() {
+    _assertSource(
+        "(a, [b = 1, c = 2])",
+        AstTestFactory.formalParameterList([
+          AstTestFactory.simpleFormalParameter3("a"),
+          AstTestFactory.positionalFormalParameter(
+              AstTestFactory.simpleFormalParameter3("b"),
+              AstTestFactory.integer(1)),
+          AstTestFactory.positionalFormalParameter(
+              AstTestFactory.simpleFormalParameter3("c"),
+              AstTestFactory.integer(2))
+        ]));
+  }
+
+  void test_visitFormalParameterList_rr() {
+    _assertSource(
+        "(a, b)",
+        AstTestFactory.formalParameterList([
+          AstTestFactory.simpleFormalParameter3("a"),
+          AstTestFactory.simpleFormalParameter3("b")
+        ]));
+  }
+
+  void test_visitFormalParameterList_rrn() {
+    _assertSource(
+        "(a, b, {c : 3})",
+        AstTestFactory.formalParameterList([
+          AstTestFactory.simpleFormalParameter3("a"),
+          AstTestFactory.simpleFormalParameter3("b"),
+          AstTestFactory.namedFormalParameter(
+              AstTestFactory.simpleFormalParameter3("c"),
+              AstTestFactory.integer(3))
+        ]));
+  }
+
+  void test_visitFormalParameterList_rrnn() {
+    _assertSource(
+        "(a, b, {c : 3, d : 4})",
+        AstTestFactory.formalParameterList([
+          AstTestFactory.simpleFormalParameter3("a"),
+          AstTestFactory.simpleFormalParameter3("b"),
+          AstTestFactory.namedFormalParameter(
+              AstTestFactory.simpleFormalParameter3("c"),
+              AstTestFactory.integer(3)),
+          AstTestFactory.namedFormalParameter(
+              AstTestFactory.simpleFormalParameter3("d"),
+              AstTestFactory.integer(4))
+        ]));
+  }
+
+  void test_visitFormalParameterList_rrp() {
+    _assertSource(
+        "(a, b, [c = 3])",
+        AstTestFactory.formalParameterList([
+          AstTestFactory.simpleFormalParameter3("a"),
+          AstTestFactory.simpleFormalParameter3("b"),
+          AstTestFactory.positionalFormalParameter(
+              AstTestFactory.simpleFormalParameter3("c"),
+              AstTestFactory.integer(3))
+        ]));
+  }
+
+  void test_visitFormalParameterList_rrpp() {
+    _assertSource(
+        "(a, b, [c = 3, d = 4])",
+        AstTestFactory.formalParameterList([
+          AstTestFactory.simpleFormalParameter3("a"),
+          AstTestFactory.simpleFormalParameter3("b"),
+          AstTestFactory.positionalFormalParameter(
+              AstTestFactory.simpleFormalParameter3("c"),
+              AstTestFactory.integer(3)),
+          AstTestFactory.positionalFormalParameter(
+              AstTestFactory.simpleFormalParameter3("d"),
+              AstTestFactory.integer(4))
+        ]));
+  }
+
+  void test_visitForStatement_c() {
+    _assertSource(
+        "for (; c;) {}",
+        AstTestFactory.forStatement(null, AstTestFactory.identifier3("c"), null,
+            AstTestFactory.block()));
+  }
+
+  void test_visitForStatement_cu() {
+    _assertSource(
+        "for (; c; u) {}",
+        AstTestFactory.forStatement(null, AstTestFactory.identifier3("c"),
+            [AstTestFactory.identifier3("u")], AstTestFactory.block()));
+  }
+
+  void test_visitForStatement_e() {
+    _assertSource(
+        "for (e;;) {}",
+        AstTestFactory.forStatement(AstTestFactory.identifier3("e"), null, null,
+            AstTestFactory.block()));
+  }
+
+  void test_visitForStatement_ec() {
+    _assertSource(
+        "for (e; c;) {}",
+        AstTestFactory.forStatement(AstTestFactory.identifier3("e"),
+            AstTestFactory.identifier3("c"), null, AstTestFactory.block()));
+  }
+
+  void test_visitForStatement_ecu() {
+    _assertSource(
+        "for (e; c; u) {}",
+        AstTestFactory.forStatement(
+            AstTestFactory.identifier3("e"),
+            AstTestFactory.identifier3("c"),
+            [AstTestFactory.identifier3("u")],
+            AstTestFactory.block()));
+  }
+
+  void test_visitForStatement_eu() {
+    _assertSource(
+        "for (e;; u) {}",
+        AstTestFactory.forStatement(AstTestFactory.identifier3("e"), null,
+            [AstTestFactory.identifier3("u")], AstTestFactory.block()));
+  }
+
+  void test_visitForStatement_i() {
+    _assertSource(
+        "for (var i;;) {}",
+        AstTestFactory.forStatement2(
+            AstTestFactory.variableDeclarationList2(
+                Keyword.VAR, [AstTestFactory.variableDeclaration("i")]),
+            null,
+            null,
+            AstTestFactory.block()));
+  }
+
+  void test_visitForStatement_ic() {
+    _assertSource(
+        "for (var i; c;) {}",
+        AstTestFactory.forStatement2(
+            AstTestFactory.variableDeclarationList2(
+                Keyword.VAR, [AstTestFactory.variableDeclaration("i")]),
+            AstTestFactory.identifier3("c"),
+            null,
+            AstTestFactory.block()));
+  }
+
+  void test_visitForStatement_icu() {
+    _assertSource(
+        "for (var i; c; u) {}",
+        AstTestFactory.forStatement2(
+            AstTestFactory.variableDeclarationList2(
+                Keyword.VAR, [AstTestFactory.variableDeclaration("i")]),
+            AstTestFactory.identifier3("c"),
+            [AstTestFactory.identifier3("u")],
+            AstTestFactory.block()));
+  }
+
+  void test_visitForStatement_iu() {
+    _assertSource(
+        "for (var i;; u) {}",
+        AstTestFactory.forStatement2(
+            AstTestFactory.variableDeclarationList2(
+                Keyword.VAR, [AstTestFactory.variableDeclaration("i")]),
+            null,
+            [AstTestFactory.identifier3("u")],
+            AstTestFactory.block()));
+  }
+
+  void test_visitForStatement_u() {
+    _assertSource(
+        "for (;; u) {}",
+        AstTestFactory.forStatement(null, null,
+            [AstTestFactory.identifier3("u")], AstTestFactory.block()));
+  }
+
+  void test_visitFunctionDeclaration_external() {
+    FunctionDeclaration functionDeclaration =
+        AstTestFactory.functionDeclaration(
+            null,
+            null,
+            "f",
+            AstTestFactory.functionExpression2(
+                AstTestFactory.formalParameterList(),
+                AstTestFactory.emptyFunctionBody()));
+    functionDeclaration.externalKeyword =
+        TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
+    _assertSource("external f();", functionDeclaration);
+  }
+
+  void test_visitFunctionDeclaration_getter() {
+    _assertSource(
+        "get f() {}",
+        AstTestFactory.functionDeclaration(
+            null, Keyword.GET, "f", AstTestFactory.functionExpression()));
+  }
+
+  void test_visitFunctionDeclaration_local_blockBody() {
+    FunctionDeclaration f = AstTestFactory.functionDeclaration(
+        null, null, "f", AstTestFactory.functionExpression());
+    FunctionDeclarationStatement fStatement =
+        new FunctionDeclarationStatement(f);
+    _assertSource(
+        "main() {f() {} 42;}",
+        AstTestFactory.functionDeclaration(
+            null,
+            null,
+            "main",
+            AstTestFactory.functionExpression2(
+                AstTestFactory.formalParameterList(),
+                AstTestFactory.blockFunctionBody2([
+                  fStatement,
+                  AstTestFactory.expressionStatement(AstTestFactory.integer(42))
+                ]))));
+  }
+
+  void test_visitFunctionDeclaration_local_expressionBody() {
+    FunctionDeclaration f = AstTestFactory.functionDeclaration(
+        null,
+        null,
+        "f",
+        AstTestFactory.functionExpression2(AstTestFactory.formalParameterList(),
+            AstTestFactory.expressionFunctionBody(AstTestFactory.integer(1))));
+    FunctionDeclarationStatement fStatement =
+        new FunctionDeclarationStatement(f);
+    _assertSource(
+        "main() {f() => 1; 2;}",
+        AstTestFactory.functionDeclaration(
+            null,
+            null,
+            "main",
+            AstTestFactory.functionExpression2(
+                AstTestFactory.formalParameterList(),
+                AstTestFactory.blockFunctionBody2([
+                  fStatement,
+                  AstTestFactory.expressionStatement(AstTestFactory.integer(2))
+                ]))));
+  }
+
+  void test_visitFunctionDeclaration_normal() {
+    _assertSource(
+        "f() {}",
+        AstTestFactory.functionDeclaration(
+            null, null, "f", AstTestFactory.functionExpression()));
+  }
+
+  void test_visitFunctionDeclaration_setter() {
+    _assertSource(
+        "set f() {}",
+        AstTestFactory.functionDeclaration(
+            null, Keyword.SET, "f", AstTestFactory.functionExpression()));
+  }
+
+  void test_visitFunctionDeclaration_typeParameters() {
+    _assertSource(
+        "f<E>() {}",
+        AstTestFactory.functionDeclaration(
+            null,
+            null,
+            "f",
+            AstTestFactory.functionExpression3(
+                AstTestFactory.typeParameterList(['E']),
+                AstTestFactory.formalParameterList(),
+                AstTestFactory.blockFunctionBody2())));
+  }
+
+  void test_visitFunctionDeclaration_withMetadata() {
+    FunctionDeclaration declaration = AstTestFactory.functionDeclaration(
+        null, null, "f", AstTestFactory.functionExpression());
+    declaration.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
+    _assertSource("@deprecated f() {}", declaration);
+  }
+
+  void test_visitFunctionDeclarationStatement() {
+    _assertSource(
+        "f() {}",
+        AstTestFactory.functionDeclarationStatement(
+            null, null, "f", AstTestFactory.functionExpression()));
+  }
+
+  void test_visitFunctionExpression() {
+    _assertSource("() {}", AstTestFactory.functionExpression());
+  }
+
+  void test_visitFunctionExpression_typeParameters() {
+    _assertSource(
+        "<E>() {}",
+        AstTestFactory.functionExpression3(
+            AstTestFactory.typeParameterList(['E']),
+            AstTestFactory.formalParameterList(),
+            AstTestFactory.blockFunctionBody2()));
+  }
+
+  void test_visitFunctionExpressionInvocation_minimal() {
+    _assertSource(
+        "f()",
+        AstTestFactory
+            .functionExpressionInvocation(AstTestFactory.identifier3("f")));
+  }
+
+  void test_visitFunctionExpressionInvocation_typeArguments() {
+    _assertSource(
+        "f<A>()",
+        AstTestFactory.functionExpressionInvocation2(
+            AstTestFactory.identifier3("f"),
+            AstTestFactory.typeArgumentList([AstTestFactory.typeName4('A')])));
+  }
+
+  void test_visitFunctionTypeAlias_generic() {
+    _assertSource(
+        "typedef A F<B>();",
+        AstTestFactory.typeAlias(
+            AstTestFactory.typeName4("A"),
+            "F",
+            AstTestFactory.typeParameterList(["B"]),
+            AstTestFactory.formalParameterList()));
+  }
+
+  void test_visitFunctionTypeAlias_nonGeneric() {
+    _assertSource(
+        "typedef A F();",
+        AstTestFactory.typeAlias(AstTestFactory.typeName4("A"), "F", null,
+            AstTestFactory.formalParameterList()));
+  }
+
+  void test_visitFunctionTypeAlias_withMetadata() {
+    FunctionTypeAlias declaration = AstTestFactory.typeAlias(
+        AstTestFactory.typeName4("A"),
+        "F",
+        null,
+        AstTestFactory.formalParameterList());
+    declaration.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
+    _assertSource("@deprecated typedef A F();", declaration);
+  }
+
+  void test_visitFunctionTypedFormalParameter_annotation() {
+    FunctionTypedFormalParameter parameter =
+        AstTestFactory.functionTypedFormalParameter(null, "f");
+    parameter.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("A")));
+    _assertSource('@A f()', parameter);
+  }
+
+  void test_visitFunctionTypedFormalParameter_noType() {
+    _assertSource(
+        "f()", AstTestFactory.functionTypedFormalParameter(null, "f"));
+  }
+
+  void test_visitFunctionTypedFormalParameter_type() {
+    _assertSource(
+        "T f()",
+        AstTestFactory.functionTypedFormalParameter(
+            AstTestFactory.typeName4("T"), "f"));
+  }
+
+  void test_visitFunctionTypedFormalParameter_typeParameters() {
+    _assertSource(
+        "T f<E>()",
+        new FunctionTypedFormalParameter(
+            null,
+            null,
+            AstTestFactory.typeName4("T"),
+            AstTestFactory.identifier3('f'),
+            AstTestFactory.typeParameterList(['E']),
+            AstTestFactory.formalParameterList([])));
+  }
+
+  void test_visitIfStatement_withElse() {
+    _assertSource(
+        "if (c) {} else {}",
+        AstTestFactory.ifStatement2(AstTestFactory.identifier3("c"),
+            AstTestFactory.block(), AstTestFactory.block()));
+  }
+
+  void test_visitIfStatement_withoutElse() {
+    _assertSource(
+        "if (c) {}",
+        AstTestFactory.ifStatement(
+            AstTestFactory.identifier3("c"), AstTestFactory.block()));
+  }
+
+  void test_visitImplementsClause_multiple() {
+    _assertSource(
+        "implements A, B",
+        AstTestFactory.implementsClause(
+            [AstTestFactory.typeName4("A"), AstTestFactory.typeName4("B")]));
+  }
+
+  void test_visitImplementsClause_single() {
+    _assertSource("implements A",
+        AstTestFactory.implementsClause([AstTestFactory.typeName4("A")]));
+  }
+
+  void test_visitImportDirective_combinator() {
+    _assertSource(
+        "import 'a.dart' show A;",
+        AstTestFactory.importDirective3("a.dart", null, [
+          AstTestFactory.showCombinator([AstTestFactory.identifier3("A")])
+        ]));
+  }
+
+  void test_visitImportDirective_combinators() {
+    _assertSource(
+        "import 'a.dart' show A hide B;",
+        AstTestFactory.importDirective3("a.dart", null, [
+          AstTestFactory.showCombinator([AstTestFactory.identifier3("A")]),
+          AstTestFactory.hideCombinator([AstTestFactory.identifier3("B")])
+        ]));
+  }
+
+  void test_visitImportDirective_deferred() {
+    _assertSource("import 'a.dart' deferred as p;",
+        AstTestFactory.importDirective2("a.dart", true, "p"));
+  }
+
+  void test_visitImportDirective_minimal() {
+    _assertSource(
+        "import 'a.dart';", AstTestFactory.importDirective3("a.dart", null));
+  }
+
+  void test_visitImportDirective_prefix() {
+    _assertSource("import 'a.dart' as p;",
+        AstTestFactory.importDirective3("a.dart", "p"));
+  }
+
+  void test_visitImportDirective_prefix_combinator() {
+    _assertSource(
+        "import 'a.dart' as p show A;",
+        AstTestFactory.importDirective3("a.dart", "p", [
+          AstTestFactory.showCombinator([AstTestFactory.identifier3("A")])
+        ]));
+  }
+
+  void test_visitImportDirective_prefix_combinators() {
+    _assertSource(
+        "import 'a.dart' as p show A hide B;",
+        AstTestFactory.importDirective3("a.dart", "p", [
+          AstTestFactory.showCombinator([AstTestFactory.identifier3("A")]),
+          AstTestFactory.hideCombinator([AstTestFactory.identifier3("B")])
+        ]));
+  }
+
+  void test_visitImportDirective_withMetadata() {
+    ImportDirective directive = AstTestFactory.importDirective3("a.dart", null);
+    directive.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
+    _assertSource("@deprecated import 'a.dart';", directive);
+  }
+
+  void test_visitImportHideCombinator_multiple() {
+    _assertSource(
+        "hide a, b",
+        AstTestFactory.hideCombinator([
+          AstTestFactory.identifier3("a"),
+          AstTestFactory.identifier3("b")
+        ]));
+  }
+
+  void test_visitImportHideCombinator_single() {
+    _assertSource("hide a",
+        AstTestFactory.hideCombinator([AstTestFactory.identifier3("a")]));
+  }
+
+  void test_visitImportShowCombinator_multiple() {
+    _assertSource(
+        "show a, b",
+        AstTestFactory.showCombinator([
+          AstTestFactory.identifier3("a"),
+          AstTestFactory.identifier3("b")
+        ]));
+  }
+
+  void test_visitImportShowCombinator_single() {
+    _assertSource("show a",
+        AstTestFactory.showCombinator([AstTestFactory.identifier3("a")]));
+  }
+
+  void test_visitIndexExpression() {
+    _assertSource(
+        "a[i]",
+        AstTestFactory.indexExpression(
+            AstTestFactory.identifier3("a"), AstTestFactory.identifier3("i")));
+  }
+
+  void test_visitInstanceCreationExpression_const() {
+    _assertSource(
+        "const C()",
+        AstTestFactory.instanceCreationExpression2(
+            Keyword.CONST, AstTestFactory.typeName4("C")));
+  }
+
+  void test_visitInstanceCreationExpression_named() {
+    _assertSource(
+        "new C.c()",
+        AstTestFactory.instanceCreationExpression3(
+            Keyword.NEW, AstTestFactory.typeName4("C"), "c"));
+  }
+
+  void test_visitInstanceCreationExpression_unnamed() {
+    _assertSource(
+        "new C()",
+        AstTestFactory.instanceCreationExpression2(
+            Keyword.NEW, AstTestFactory.typeName4("C")));
+  }
+
+  void test_visitIntegerLiteral() {
+    _assertSource("42", AstTestFactory.integer(42));
+  }
+
+  void test_visitInterpolationExpression_expression() {
+    _assertSource(
+        "\${a}",
+        AstTestFactory
+            .interpolationExpression(AstTestFactory.identifier3("a")));
+  }
+
+  void test_visitInterpolationExpression_identifier() {
+    _assertSource("\$a", AstTestFactory.interpolationExpression2("a"));
+  }
+
+  void test_visitInterpolationString() {
+    _assertSource("'x", AstTestFactory.interpolationString("'x", "x"));
+  }
+
+  void test_visitIsExpression_negated() {
+    _assertSource(
+        "a is! C",
+        AstTestFactory.isExpression(AstTestFactory.identifier3("a"), true,
+            AstTestFactory.typeName4("C")));
+  }
+
+  void test_visitIsExpression_normal() {
+    _assertSource(
+        "a is C",
+        AstTestFactory.isExpression(AstTestFactory.identifier3("a"), false,
+            AstTestFactory.typeName4("C")));
+  }
+
+  void test_visitLabel() {
+    _assertSource("a:", AstTestFactory.label2("a"));
+  }
+
+  void test_visitLabeledStatement_multiple() {
+    _assertSource(
+        "a: b: return;",
+        AstTestFactory.labeledStatement(
+            [AstTestFactory.label2("a"), AstTestFactory.label2("b")],
+            AstTestFactory.returnStatement()));
+  }
+
+  void test_visitLabeledStatement_single() {
+    _assertSource(
+        "a: return;",
+        AstTestFactory.labeledStatement(
+            [AstTestFactory.label2("a")], AstTestFactory.returnStatement()));
+  }
+
+  void test_visitLibraryDirective() {
+    _assertSource("library l;", AstTestFactory.libraryDirective2("l"));
+  }
+
+  void test_visitLibraryDirective_withMetadata() {
+    LibraryDirective directive = AstTestFactory.libraryDirective2("l");
+    directive.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
+    _assertSource("@deprecated library l;", directive);
+  }
+
+  void test_visitLibraryIdentifier_multiple() {
+    _assertSource(
+        "a.b.c",
+        AstTestFactory.libraryIdentifier([
+          AstTestFactory.identifier3("a"),
+          AstTestFactory.identifier3("b"),
+          AstTestFactory.identifier3("c")
+        ]));
+  }
+
+  void test_visitLibraryIdentifier_single() {
+    _assertSource("a",
+        AstTestFactory.libraryIdentifier([AstTestFactory.identifier3("a")]));
+  }
+
+  void test_visitListLiteral_const() {
+    _assertSource("const []", AstTestFactory.listLiteral2(Keyword.CONST, null));
+  }
+
+  void test_visitListLiteral_empty() {
+    _assertSource("[]", AstTestFactory.listLiteral());
+  }
+
+  void test_visitListLiteral_nonEmpty() {
+    _assertSource(
+        "[a, b, c]",
+        AstTestFactory.listLiteral([
+          AstTestFactory.identifier3("a"),
+          AstTestFactory.identifier3("b"),
+          AstTestFactory.identifier3("c")
+        ]));
+  }
+
+  void test_visitMapLiteral_const() {
+    _assertSource("const {}", AstTestFactory.mapLiteral(Keyword.CONST, null));
+  }
+
+  void test_visitMapLiteral_empty() {
+    _assertSource("{}", AstTestFactory.mapLiteral2());
+  }
+
+  void test_visitMapLiteral_nonEmpty() {
+    _assertSource(
+        "{'a' : a, 'b' : b, 'c' : c}",
+        AstTestFactory.mapLiteral2([
+          AstTestFactory.mapLiteralEntry("a", AstTestFactory.identifier3("a")),
+          AstTestFactory.mapLiteralEntry("b", AstTestFactory.identifier3("b")),
+          AstTestFactory.mapLiteralEntry("c", AstTestFactory.identifier3("c"))
+        ]));
+  }
+
+  void test_visitMapLiteralEntry() {
+    _assertSource("'a' : b",
+        AstTestFactory.mapLiteralEntry("a", AstTestFactory.identifier3("b")));
+  }
+
+  void test_visitMethodDeclaration_external() {
+    _assertSource(
+        "external m();",
+        AstTestFactory.methodDeclaration(
+            null,
+            null,
+            null,
+            null,
+            AstTestFactory.identifier3("m"),
+            AstTestFactory.formalParameterList()));
+  }
+
+  void test_visitMethodDeclaration_external_returnType() {
+    _assertSource(
+        "external T m();",
+        AstTestFactory.methodDeclaration(
+            null,
+            AstTestFactory.typeName4("T"),
+            null,
+            null,
+            AstTestFactory.identifier3("m"),
+            AstTestFactory.formalParameterList()));
+  }
+
+  void test_visitMethodDeclaration_getter() {
+    _assertSource(
+        "get m {}",
+        AstTestFactory.methodDeclaration2(
+            null,
+            null,
+            Keyword.GET,
+            null,
+            AstTestFactory.identifier3("m"),
+            null,
+            AstTestFactory.blockFunctionBody2()));
+  }
+
+  void test_visitMethodDeclaration_getter_returnType() {
+    _assertSource(
+        "T get m {}",
+        AstTestFactory.methodDeclaration2(
+            null,
+            AstTestFactory.typeName4("T"),
+            Keyword.GET,
+            null,
+            AstTestFactory.identifier3("m"),
+            null,
+            AstTestFactory.blockFunctionBody2()));
+  }
+
+  void test_visitMethodDeclaration_getter_seturnType() {
+    _assertSource(
+        "T set m(var v) {}",
+        AstTestFactory.methodDeclaration2(
+            null,
+            AstTestFactory.typeName4("T"),
+            Keyword.SET,
+            null,
+            AstTestFactory.identifier3("m"),
+            AstTestFactory.formalParameterList(
+                [AstTestFactory.simpleFormalParameter(Keyword.VAR, "v")]),
+            AstTestFactory.blockFunctionBody2()));
+  }
+
+  void test_visitMethodDeclaration_minimal() {
+    _assertSource(
+        "m() {}",
+        AstTestFactory.methodDeclaration2(
+            null,
+            null,
+            null,
+            null,
+            AstTestFactory.identifier3("m"),
+            AstTestFactory.formalParameterList(),
+            AstTestFactory.blockFunctionBody2()));
+  }
+
+  void test_visitMethodDeclaration_multipleParameters() {
+    _assertSource(
+        "m(var a, var b) {}",
+        AstTestFactory.methodDeclaration2(
+            null,
+            null,
+            null,
+            null,
+            AstTestFactory.identifier3("m"),
+            AstTestFactory.formalParameterList([
+              AstTestFactory.simpleFormalParameter(Keyword.VAR, "a"),
+              AstTestFactory.simpleFormalParameter(Keyword.VAR, "b")
+            ]),
+            AstTestFactory.blockFunctionBody2()));
+  }
+
+  void test_visitMethodDeclaration_operator() {
+    _assertSource(
+        "operator +() {}",
+        AstTestFactory.methodDeclaration2(
+            null,
+            null,
+            null,
+            Keyword.OPERATOR,
+            AstTestFactory.identifier3("+"),
+            AstTestFactory.formalParameterList(),
+            AstTestFactory.blockFunctionBody2()));
+  }
+
+  void test_visitMethodDeclaration_operator_returnType() {
+    _assertSource(
+        "T operator +() {}",
+        AstTestFactory.methodDeclaration2(
+            null,
+            AstTestFactory.typeName4("T"),
+            null,
+            Keyword.OPERATOR,
+            AstTestFactory.identifier3("+"),
+            AstTestFactory.formalParameterList(),
+            AstTestFactory.blockFunctionBody2()));
+  }
+
+  void test_visitMethodDeclaration_returnType() {
+    _assertSource(
+        "T m() {}",
+        AstTestFactory.methodDeclaration2(
+            null,
+            AstTestFactory.typeName4("T"),
+            null,
+            null,
+            AstTestFactory.identifier3("m"),
+            AstTestFactory.formalParameterList(),
+            AstTestFactory.blockFunctionBody2()));
+  }
+
+  void test_visitMethodDeclaration_setter() {
+    _assertSource(
+        "set m(var v) {}",
+        AstTestFactory.methodDeclaration2(
+            null,
+            null,
+            Keyword.SET,
+            null,
+            AstTestFactory.identifier3("m"),
+            AstTestFactory.formalParameterList(
+                [AstTestFactory.simpleFormalParameter(Keyword.VAR, "v")]),
+            AstTestFactory.blockFunctionBody2()));
+  }
+
+  void test_visitMethodDeclaration_static() {
+    _assertSource(
+        "static m() {}",
+        AstTestFactory.methodDeclaration2(
+            Keyword.STATIC,
+            null,
+            null,
+            null,
+            AstTestFactory.identifier3("m"),
+            AstTestFactory.formalParameterList(),
+            AstTestFactory.blockFunctionBody2()));
+  }
+
+  void test_visitMethodDeclaration_static_returnType() {
+    _assertSource(
+        "static T m() {}",
+        AstTestFactory.methodDeclaration2(
+            Keyword.STATIC,
+            AstTestFactory.typeName4("T"),
+            null,
+            null,
+            AstTestFactory.identifier3("m"),
+            AstTestFactory.formalParameterList(),
+            AstTestFactory.blockFunctionBody2()));
+  }
+
+  void test_visitMethodDeclaration_typeParameters() {
+    _assertSource(
+        "m<E>() {}",
+        AstTestFactory.methodDeclaration3(
+            null,
+            null,
+            null,
+            null,
+            AstTestFactory.identifier3("m"),
+            AstTestFactory.typeParameterList(['E']),
+            AstTestFactory.formalParameterList(),
+            AstTestFactory.blockFunctionBody2()));
+  }
+
+  void test_visitMethodDeclaration_withMetadata() {
+    MethodDeclaration declaration = AstTestFactory.methodDeclaration2(
+        null,
+        null,
+        null,
+        null,
+        AstTestFactory.identifier3("m"),
+        AstTestFactory.formalParameterList(),
+        AstTestFactory.blockFunctionBody2());
+    declaration.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
+    _assertSource("@deprecated m() {}", declaration);
+  }
+
+  void test_visitMethodInvocation_conditional() {
+    _assertSource(
+        "t?.m()",
+        AstTestFactory.methodInvocation(AstTestFactory.identifier3("t"), "m",
+            null, TokenType.QUESTION_PERIOD));
+  }
+
+  void test_visitMethodInvocation_noTarget() {
+    _assertSource("m()", AstTestFactory.methodInvocation2("m"));
+  }
+
+  void test_visitMethodInvocation_target() {
+    _assertSource("t.m()",
+        AstTestFactory.methodInvocation(AstTestFactory.identifier3("t"), "m"));
+  }
+
+  void test_visitMethodInvocation_typeArguments() {
+    _assertSource(
+        "m<A>()",
+        AstTestFactory.methodInvocation3(null, "m",
+            AstTestFactory.typeArgumentList([AstTestFactory.typeName4('A')])));
+  }
+
+  void test_visitNamedExpression() {
+    _assertSource("a: b",
+        AstTestFactory.namedExpression2("a", AstTestFactory.identifier3("b")));
+  }
+
+  void test_visitNamedFormalParameter() {
+    _assertSource(
+        "var a : 0",
+        AstTestFactory.namedFormalParameter(
+            AstTestFactory.simpleFormalParameter(Keyword.VAR, "a"),
+            AstTestFactory.integer(0)));
+  }
+
+  void test_visitNativeClause() {
+    _assertSource("native 'code'", AstTestFactory.nativeClause("code"));
+  }
+
+  void test_visitNativeFunctionBody() {
+    _assertSource("native 'str';", AstTestFactory.nativeFunctionBody("str"));
+  }
+
+  void test_visitNullLiteral() {
+    _assertSource("null", AstTestFactory.nullLiteral());
+  }
+
+  void test_visitParenthesizedExpression() {
+    _assertSource(
+        "(a)",
+        AstTestFactory
+            .parenthesizedExpression(AstTestFactory.identifier3("a")));
+  }
+
+  void test_visitPartDirective() {
+    _assertSource("part 'a.dart';", AstTestFactory.partDirective2("a.dart"));
+  }
+
+  void test_visitPartDirective_withMetadata() {
+    PartDirective directive = AstTestFactory.partDirective2("a.dart");
+    directive.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
+    _assertSource("@deprecated part 'a.dart';", directive);
+  }
+
+  void test_visitPartOfDirective() {
+    _assertSource(
+        "part of l;",
+        AstTestFactory
+            .partOfDirective(AstTestFactory.libraryIdentifier2(["l"])));
+  }
+
+  void test_visitPartOfDirective_withMetadata() {
+    PartOfDirective directive = AstTestFactory
+        .partOfDirective(AstTestFactory.libraryIdentifier2(["l"]));
+    directive.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
+    _assertSource("@deprecated part of l;", directive);
+  }
+
+  void test_visitPositionalFormalParameter() {
+    _assertSource(
+        "var a = 0",
+        AstTestFactory.positionalFormalParameter(
+            AstTestFactory.simpleFormalParameter(Keyword.VAR, "a"),
+            AstTestFactory.integer(0)));
+  }
+
+  void test_visitPostfixExpression() {
+    _assertSource(
+        "a++",
+        AstTestFactory.postfixExpression(
+            AstTestFactory.identifier3("a"), TokenType.PLUS_PLUS));
+  }
+
+  void test_visitPrefixedIdentifier() {
+    _assertSource("a.b", AstTestFactory.identifier5("a", "b"));
+  }
+
+  void test_visitPrefixExpression() {
+    _assertSource(
+        "-a",
+        AstTestFactory.prefixExpression(
+            TokenType.MINUS, AstTestFactory.identifier3("a")));
+  }
+
+  void test_visitPropertyAccess() {
+    _assertSource("a.b",
+        AstTestFactory.propertyAccess2(AstTestFactory.identifier3("a"), "b"));
+  }
+
+  void test_visitPropertyAccess_conditional() {
+    _assertSource(
+        "a?.b",
+        AstTestFactory.propertyAccess2(
+            AstTestFactory.identifier3("a"), "b", TokenType.QUESTION_PERIOD));
+  }
+
+  void test_visitRedirectingConstructorInvocation_named() {
+    _assertSource(
+        "this.c()", AstTestFactory.redirectingConstructorInvocation2("c"));
+  }
+
+  void test_visitRedirectingConstructorInvocation_unnamed() {
+    _assertSource("this()", AstTestFactory.redirectingConstructorInvocation());
+  }
+
+  void test_visitRethrowExpression() {
+    _assertSource("rethrow", AstTestFactory.rethrowExpression());
+  }
+
+  void test_visitReturnStatement_expression() {
+    _assertSource("return a;",
+        AstTestFactory.returnStatement2(AstTestFactory.identifier3("a")));
+  }
+
+  void test_visitReturnStatement_noExpression() {
+    _assertSource("return;", AstTestFactory.returnStatement());
+  }
+
+  void test_visitScriptTag() {
+    String scriptTag = "!#/bin/dart.exe";
+    _assertSource(scriptTag, AstTestFactory.scriptTag(scriptTag));
+  }
+
+  void test_visitSimpleFormalParameter_annotation() {
+    SimpleFormalParameter parameter =
+        AstTestFactory.simpleFormalParameter3('x');
+    parameter.metadata
+        .add(AstTestFactory.annotation(AstTestFactory.identifier3("A")));
+    _assertSource('@A x', parameter);
+  }
+
+  void test_visitSimpleFormalParameter_keyword() {
+    _assertSource(
+        "var a", AstTestFactory.simpleFormalParameter(Keyword.VAR, "a"));
+  }
+
+  void test_visitSimpleFormalParameter_keyword_type() {
+    _assertSource(
+        "final A a",
+        AstTestFactory.simpleFormalParameter2(
+            Keyword.FINAL, AstTestFactory.typeName4("A"), "a"));
+  }
+
+  void test_visitSimpleFormalParameter_type() {
+    _assertSource(
+        "A a",
+        AstTestFactory.simpleFormalParameter4(
+            AstTestFactory.typeName4("A"), "a"));
+  }
+
+  void test_visitSimpleIdentifier() {
+    _assertSource("a", AstTestFactory.identifier3("a"));
+  }
+
+  void test_visitSimpleStringLiteral() {
+    _assertSource("'a'", AstTestFactory.string2("a"));
+  }
+
+  void test_visitStringInterpolation() {
+    _assertSource(
+        "'a\${e}b'",
+        AstTestFactory.string([
+          AstTestFactory.interpolationString("'a", "a"),
+          AstTestFactory
+              .interpolationExpression(AstTestFactory.identifier3("e")),
+          AstTestFactory.interpolationString("b'", "b")
+        ]));
+  }
+
+  void test_visitSuperConstructorInvocation() {
+    _assertSource("super()", AstTestFactory.superConstructorInvocation());
+  }
+
+  void test_visitSuperConstructorInvocation_named() {
+    _assertSource("super.c()", AstTestFactory.superConstructorInvocation2("c"));
+  }
+
+  void test_visitSuperExpression() {
+    _assertSource("super", AstTestFactory.superExpression());
+  }
+
+  void test_visitSwitchCase_multipleLabels() {
+    _assertSource(
+        "l1: l2: case a: {}",
+        AstTestFactory.switchCase2(
+            [AstTestFactory.label2("l1"), AstTestFactory.label2("l2")],
+            AstTestFactory.identifier3("a"),
+            [AstTestFactory.block()]));
+  }
+
+  void test_visitSwitchCase_multipleStatements() {
+    _assertSource(
+        "case a: {} {}",
+        AstTestFactory.switchCase(AstTestFactory.identifier3("a"),
+            [AstTestFactory.block(), AstTestFactory.block()]));
+  }
+
+  void test_visitSwitchCase_noLabels() {
+    _assertSource(
+        "case a: {}",
+        AstTestFactory.switchCase(
+            AstTestFactory.identifier3("a"), [AstTestFactory.block()]));
+  }
+
+  void test_visitSwitchCase_singleLabel() {
+    _assertSource(
+        "l1: case a: {}",
+        AstTestFactory.switchCase2([AstTestFactory.label2("l1")],
+            AstTestFactory.identifier3("a"), [AstTestFactory.block()]));
+  }
+
+  void test_visitSwitchDefault_multipleLabels() {
+    _assertSource(
+        "l1: l2: default: {}",
+        AstTestFactory.switchDefault(
+            [AstTestFactory.label2("l1"), AstTestFactory.label2("l2")],
+            [AstTestFactory.block()]));
+  }
+
+  void test_visitSwitchDefault_multipleStatements() {
+    _assertSource(
+        "default: {} {}",
+        AstTestFactory
+            .switchDefault2([AstTestFactory.block(), AstTestFactory.block()]));
+  }
+
+  void test_visitSwitchDefault_noLabels() {
+    _assertSource(
+        "default: {}", AstTestFactory.switchDefault2([AstTestFactory.block()]));
+  }
+
+  void test_visitSwitchDefault_singleLabel() {
+    _assertSource(
+        "l1: default: {}",
+        AstTestFactory.switchDefault(
+            [AstTestFactory.label2("l1")], [AstTestFactory.block()]));
+  }
+
+  void test_visitSwitchStatement() {
+    _assertSource(
+        "switch (a) {case 'b': {} default: {}}",
+        AstTestFactory.switchStatement(AstTestFactory.identifier3("a"), [
+          AstTestFactory.switchCase(
+              AstTestFactory.string2("b"), [AstTestFactory.block()]),
+          AstTestFactory.switchDefault2([AstTestFactory.block()])
+        ]));
+  }
+
+  void test_visitSymbolLiteral_multiple() {
+    _assertSource("#a.b.c", AstTestFactory.symbolLiteral(["a", "b", "c"]));
+  }
+
+  void test_visitSymbolLiteral_single() {
+    _assertSource("#a", AstTestFactory.symbolLiteral(["a"]));
+  }
+
+  void test_visitThisExpression() {
+    _assertSource("this", AstTestFactory.thisExpression());
+  }
+
+  void test_visitThrowStatement() {
+    _assertSource("throw e",
+        AstTestFactory.throwExpression2(AstTestFactory.identifier3("e")));
+  }
+
+  void test_visitTopLevelVariableDeclaration_multiple() {
+    _assertSource(
+        "var a;",
+        AstTestFactory.topLevelVariableDeclaration2(
+            Keyword.VAR, [AstTestFactory.variableDeclaration("a")]));
+  }
+
+  void test_visitTopLevelVariableDeclaration_single() {
+    _assertSource(
+        "var a, b;",
+        AstTestFactory.topLevelVariableDeclaration2(Keyword.VAR, [
+          AstTestFactory.variableDeclaration("a"),
+          AstTestFactory.variableDeclaration("b")
+        ]));
+  }
+
+  void test_visitTryStatement_catch() {
+    _assertSource(
+        "try {} on E {}",
+        AstTestFactory.tryStatement2(AstTestFactory.block(),
+            [AstTestFactory.catchClause3(AstTestFactory.typeName4("E"))]));
+  }
+
+  void test_visitTryStatement_catches() {
+    _assertSource(
+        "try {} on E {} on F {}",
+        AstTestFactory.tryStatement2(AstTestFactory.block(), [
+          AstTestFactory.catchClause3(AstTestFactory.typeName4("E")),
+          AstTestFactory.catchClause3(AstTestFactory.typeName4("F"))
+        ]));
+  }
+
+  void test_visitTryStatement_catchFinally() {
+    _assertSource(
+        "try {} on E {} finally {}",
+        AstTestFactory.tryStatement3(
+            AstTestFactory.block(),
+            [AstTestFactory.catchClause3(AstTestFactory.typeName4("E"))],
+            AstTestFactory.block()));
+  }
+
+  void test_visitTryStatement_finally() {
+    _assertSource(
+        "try {} finally {}",
+        AstTestFactory.tryStatement(
+            AstTestFactory.block(), AstTestFactory.block()));
+  }
+
+  void test_visitTypeArgumentList_multiple() {
+    _assertSource(
+        "<E, F>",
+        AstTestFactory.typeArgumentList(
+            [AstTestFactory.typeName4("E"), AstTestFactory.typeName4("F")]));
+  }
+
+  void test_visitTypeArgumentList_single() {
+    _assertSource("<E>",
+        AstTestFactory.typeArgumentList([AstTestFactory.typeName4("E")]));
+  }
+
+  void test_visitTypeName_multipleArgs() {
+    _assertSource(
+        "C<D, E>",
+        AstTestFactory.typeName4("C",
+            [AstTestFactory.typeName4("D"), AstTestFactory.typeName4("E")]));
+  }
+
+  void test_visitTypeName_nestedArg() {
+    _assertSource(
+        "C<D<E>>",
+        AstTestFactory.typeName4("C", [
+          AstTestFactory.typeName4("D", [AstTestFactory.typeName4("E")])
+        ]));
+  }
+
+  void test_visitTypeName_noArgs() {
+    _assertSource("C", AstTestFactory.typeName4("C"));
+  }
+
+  void test_visitTypeName_singleArg() {
+    _assertSource(
+        "C<D>", AstTestFactory.typeName4("C", [AstTestFactory.typeName4("D")]));
+  }
+
+  void test_visitTypeParameter_withExtends() {
+    _assertSource("E extends C",
+        AstTestFactory.typeParameter2("E", AstTestFactory.typeName4("C")));
+  }
+
+  void test_visitTypeParameter_withMetadata() {
+    TypeParameter parameter = AstTestFactory.typeParameter("E");
+    parameter.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
+    _assertSource("@deprecated E", parameter);
+  }
+
+  void test_visitTypeParameter_withoutExtends() {
+    _assertSource("E", AstTestFactory.typeParameter("E"));
+  }
+
+  void test_visitTypeParameterList_multiple() {
+    _assertSource("<E, F>", AstTestFactory.typeParameterList(["E", "F"]));
+  }
+
+  void test_visitTypeParameterList_single() {
+    _assertSource("<E>", AstTestFactory.typeParameterList(["E"]));
+  }
+
+  void test_visitVariableDeclaration_initialized() {
+    _assertSource(
+        "a = b",
+        AstTestFactory.variableDeclaration2(
+            "a", AstTestFactory.identifier3("b")));
+  }
+
+  void test_visitVariableDeclaration_uninitialized() {
+    _assertSource("a", AstTestFactory.variableDeclaration("a"));
+  }
+
+  void test_visitVariableDeclaration_withMetadata() {
+    VariableDeclaration declaration = AstTestFactory.variableDeclaration("a");
+    declaration.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
+    _assertSource("@deprecated a", declaration);
+  }
+
+  void test_visitVariableDeclarationList_const_type() {
+    _assertSource(
+        "const C a, b",
+        AstTestFactory.variableDeclarationList(
+            Keyword.CONST, AstTestFactory.typeName4("C"), [
+          AstTestFactory.variableDeclaration("a"),
+          AstTestFactory.variableDeclaration("b")
+        ]));
+  }
+
+  void test_visitVariableDeclarationList_final_noType() {
+    _assertSource(
+        "final a, b",
+        AstTestFactory.variableDeclarationList2(Keyword.FINAL, [
+          AstTestFactory.variableDeclaration("a"),
+          AstTestFactory.variableDeclaration("b")
+        ]));
+  }
+
+  void test_visitVariableDeclarationList_final_withMetadata() {
+    VariableDeclarationList declarationList = AstTestFactory
+        .variableDeclarationList2(Keyword.FINAL, [
+      AstTestFactory.variableDeclaration("a"),
+      AstTestFactory.variableDeclaration("b")
+    ]);
+    declarationList.metadata.add(
+        AstTestFactory.annotation(AstTestFactory.identifier3("deprecated")));
+    _assertSource("@deprecated final a, b", declarationList);
+  }
+
+  void test_visitVariableDeclarationList_type() {
+    _assertSource(
+        "C a, b",
+        AstTestFactory.variableDeclarationList(
+            null, AstTestFactory.typeName4("C"), [
+          AstTestFactory.variableDeclaration("a"),
+          AstTestFactory.variableDeclaration("b")
+        ]));
+  }
+
+  void test_visitVariableDeclarationList_var() {
+    _assertSource(
+        "var a, b",
+        AstTestFactory.variableDeclarationList2(Keyword.VAR, [
+          AstTestFactory.variableDeclaration("a"),
+          AstTestFactory.variableDeclaration("b")
+        ]));
+  }
+
+  void test_visitVariableDeclarationStatement() {
+    _assertSource(
+        "C c;",
+        AstTestFactory.variableDeclarationStatement(
+            null,
+            AstTestFactory.typeName4("C"),
+            [AstTestFactory.variableDeclaration("c")]));
+  }
+
+  void test_visitWhileStatement() {
+    _assertSource(
+        "while (c) {}",
+        AstTestFactory.whileStatement(
+            AstTestFactory.identifier3("c"), AstTestFactory.block()));
+  }
+
+  void test_visitWithClause_multiple() {
+    _assertSource(
+        "with A, B, C",
+        AstTestFactory.withClause([
+          AstTestFactory.typeName4("A"),
+          AstTestFactory.typeName4("B"),
+          AstTestFactory.typeName4("C")
+        ]));
+  }
+
+  void test_visitWithClause_single() {
+    _assertSource(
+        "with A", AstTestFactory.withClause([AstTestFactory.typeName4("A")]));
+  }
+
+  void test_visitYieldStatement() {
+    _assertSource("yield e;",
+        AstTestFactory.yieldStatement(AstTestFactory.identifier3("e")));
+  }
+
+  void test_visitYieldStatement_each() {
+    _assertSource("yield* e;",
+        AstTestFactory.yieldEachStatement(AstTestFactory.identifier3("e")));
+  }
+
+  /**
+   * Assert that a `ToSourceVisitor` will produce the [expectedSource] when
+   * visiting the given [node].
    */
   void _assertSource(String expectedSource, AstNode node) {
     PrintStringWriter writer = new PrintStringWriter();
diff --git a/pkg/analyzer/test/src/dart/constant/evaluation_test.dart b/pkg/analyzer/test/src/dart/constant/evaluation_test.dart
index 9de8247..43dfdf7 100644
--- a/pkg/analyzer/test/src/dart/constant/evaluation_test.dart
+++ b/pkg/analyzer/test/src/dart/constant/evaluation_test.dart
@@ -17,22 +17,22 @@
 import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/source_io.dart';
-import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
 import 'package:analyzer/src/generated/testing/test_type_provider.dart';
 import 'package:analyzer/src/task/dart.dart';
 import 'package:path/path.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../../generated/resolver_test_case.dart';
 import '../../../generated/test_support.dart';
-import '../../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ConstantValueComputerTest);
-  defineReflectiveTests(ConstantVisitorTest);
-  defineReflectiveTests(StrongConstantValueComputerTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ConstantValueComputerTest);
+    defineReflectiveTests(ConstantVisitorTest);
+    defineReflectiveTests(StrongConstantValueComputerTest);
+  });
 }
 
 /**
@@ -1196,7 +1196,7 @@
   }
 
   void _assertProperDependencies(String sourceText,
-      [List<ErrorCode> expectedErrorCodes = ErrorCode.EMPTY_LIST]) {
+      [List<ErrorCode> expectedErrorCodes = const <ErrorCode>[]]) {
     Source source = addSource(sourceText);
     LibraryElement element = resolve2(source);
     CompilationUnit unit =
@@ -1407,10 +1407,10 @@
 @reflectiveTest
 class ConstantVisitorTest extends ResolverTestCase {
   void test_visitBinaryExpression_questionQuestion_notNull_notNull() {
-    Expression left = AstFactory.string2('a');
-    Expression right = AstFactory.string2('b');
-    Expression expression =
-        AstFactory.binaryExpression(left, TokenType.QUESTION_QUESTION, right);
+    Expression left = AstTestFactory.string2('a');
+    Expression right = AstTestFactory.string2('b');
+    Expression expression = AstTestFactory.binaryExpression(
+        left, TokenType.QUESTION_QUESTION, right);
 
     GatheringErrorListener errorListener = new GatheringErrorListener();
     ErrorReporter errorReporter =
@@ -1423,10 +1423,10 @@
   }
 
   void test_visitBinaryExpression_questionQuestion_null_notNull() {
-    Expression left = AstFactory.nullLiteral();
-    Expression right = AstFactory.string2('b');
-    Expression expression =
-        AstFactory.binaryExpression(left, TokenType.QUESTION_QUESTION, right);
+    Expression left = AstTestFactory.nullLiteral();
+    Expression right = AstTestFactory.string2('b');
+    Expression expression = AstTestFactory.binaryExpression(
+        left, TokenType.QUESTION_QUESTION, right);
 
     GatheringErrorListener errorListener = new GatheringErrorListener();
     ErrorReporter errorReporter =
@@ -1439,10 +1439,10 @@
   }
 
   void test_visitBinaryExpression_questionQuestion_null_null() {
-    Expression left = AstFactory.nullLiteral();
-    Expression right = AstFactory.nullLiteral();
-    Expression expression =
-        AstFactory.binaryExpression(left, TokenType.QUESTION_QUESTION, right);
+    Expression left = AstTestFactory.nullLiteral();
+    Expression right = AstTestFactory.nullLiteral();
+    Expression expression = AstTestFactory.binaryExpression(
+        left, TokenType.QUESTION_QUESTION, right);
 
     GatheringErrorListener errorListener = new GatheringErrorListener();
     ErrorReporter errorReporter =
@@ -1454,10 +1454,10 @@
   }
 
   void test_visitConditionalExpression_false() {
-    Expression thenExpression = AstFactory.integer(1);
-    Expression elseExpression = AstFactory.integer(0);
-    ConditionalExpression expression = AstFactory.conditionalExpression(
-        AstFactory.booleanLiteral(false), thenExpression, elseExpression);
+    Expression thenExpression = AstTestFactory.integer(1);
+    Expression elseExpression = AstTestFactory.integer(0);
+    ConditionalExpression expression = AstTestFactory.conditionalExpression(
+        AstTestFactory.booleanLiteral(false), thenExpression, elseExpression);
     GatheringErrorListener errorListener = new GatheringErrorListener();
     ErrorReporter errorReporter =
         new ErrorReporter(errorListener, _dummySource());
@@ -1466,10 +1466,10 @@
   }
 
   void test_visitConditionalExpression_nonBooleanCondition() {
-    Expression thenExpression = AstFactory.integer(1);
-    Expression elseExpression = AstFactory.integer(0);
-    NullLiteral conditionExpression = AstFactory.nullLiteral();
-    ConditionalExpression expression = AstFactory.conditionalExpression(
+    Expression thenExpression = AstTestFactory.integer(1);
+    Expression elseExpression = AstTestFactory.integer(0);
+    NullLiteral conditionExpression = AstTestFactory.nullLiteral();
+    ConditionalExpression expression = AstTestFactory.conditionalExpression(
         conditionExpression, thenExpression, elseExpression);
     GatheringErrorListener errorListener = new GatheringErrorListener();
     ErrorReporter errorReporter =
@@ -1481,10 +1481,10 @@
   }
 
   void test_visitConditionalExpression_nonConstantElse() {
-    Expression thenExpression = AstFactory.integer(1);
-    Expression elseExpression = AstFactory.identifier3("x");
-    ConditionalExpression expression = AstFactory.conditionalExpression(
-        AstFactory.booleanLiteral(true), thenExpression, elseExpression);
+    Expression thenExpression = AstTestFactory.integer(1);
+    Expression elseExpression = AstTestFactory.identifier3("x");
+    ConditionalExpression expression = AstTestFactory.conditionalExpression(
+        AstTestFactory.booleanLiteral(true), thenExpression, elseExpression);
     GatheringErrorListener errorListener = new GatheringErrorListener();
     ErrorReporter errorReporter =
         new ErrorReporter(errorListener, _dummySource());
@@ -1495,10 +1495,10 @@
   }
 
   void test_visitConditionalExpression_nonConstantThen() {
-    Expression thenExpression = AstFactory.identifier3("x");
-    Expression elseExpression = AstFactory.integer(0);
-    ConditionalExpression expression = AstFactory.conditionalExpression(
-        AstFactory.booleanLiteral(true), thenExpression, elseExpression);
+    Expression thenExpression = AstTestFactory.identifier3("x");
+    Expression elseExpression = AstTestFactory.integer(0);
+    ConditionalExpression expression = AstTestFactory.conditionalExpression(
+        AstTestFactory.booleanLiteral(true), thenExpression, elseExpression);
     GatheringErrorListener errorListener = new GatheringErrorListener();
     ErrorReporter errorReporter =
         new ErrorReporter(errorListener, _dummySource());
@@ -1509,10 +1509,10 @@
   }
 
   void test_visitConditionalExpression_true() {
-    Expression thenExpression = AstFactory.integer(1);
-    Expression elseExpression = AstFactory.integer(0);
-    ConditionalExpression expression = AstFactory.conditionalExpression(
-        AstFactory.booleanLiteral(true), thenExpression, elseExpression);
+    Expression thenExpression = AstTestFactory.integer(1);
+    Expression elseExpression = AstTestFactory.integer(0);
+    ConditionalExpression expression = AstTestFactory.conditionalExpression(
+        AstTestFactory.booleanLiteral(true), thenExpression, elseExpression);
     GatheringErrorListener errorListener = new GatheringErrorListener();
     ErrorReporter errorReporter =
         new ErrorReporter(errorListener, _dummySource());
diff --git a/pkg/analyzer/test/src/dart/constant/test_all.dart b/pkg/analyzer/test/src/dart/constant/test_all.dart
index a6eb5b6..6eea24d 100644
--- a/pkg/analyzer/test/src/dart/constant/test_all.dart
+++ b/pkg/analyzer/test/src/dart/constant/test_all.dart
@@ -4,19 +4,17 @@
 
 library analyzer.test.src.dart.constant.test_all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../../utils.dart';
 import 'evaluation_test.dart' as evaluation;
 import 'utilities_test.dart' as utilities;
 import 'value_test.dart' as value;
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('constant tests', () {
+  defineReflectiveSuite(() {
     evaluation.main();
     utilities.main();
     value.main();
-  });
+  }, name: 'constant');
 }
diff --git a/pkg/analyzer/test/src/dart/constant/utilities_test.dart b/pkg/analyzer/test/src/dart/constant/utilities_test.dart
index aa9bd5c..9920600 100644
--- a/pkg/analyzer/test/src/dart/constant/utilities_test.dart
+++ b/pkg/analyzer/test/src/dart/constant/utilities_test.dart
@@ -14,22 +14,22 @@
 import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/source_io.dart';
-import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
 import 'package:analyzer/src/generated/testing/element_factory.dart';
 import 'package:analyzer/src/generated/testing/test_type_provider.dart';
 import 'package:analyzer/src/generated/utilities_collection.dart';
 import 'package:analyzer/src/task/dart.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../../generated/engine_test.dart';
 import '../../../generated/test_support.dart';
-import '../../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ConstantFinderTest);
-  defineReflectiveTests(ReferenceFinderTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ConstantFinderTest);
+    defineReflectiveTests(ReferenceFinderTest);
+  });
 }
 
 @reflectiveTest
@@ -56,17 +56,17 @@
         compilationUnitElement;
     ElementAnnotationImpl elementAnnotation =
         new ElementAnnotationImpl(compilationUnitElement);
-    _node = elementAnnotation.annotationAst = AstFactory.annotation(
-        AstFactory.identifier3('x'))..elementAnnotation = elementAnnotation;
+    _node = elementAnnotation.annotationAst = AstTestFactory.annotation(
+        AstTestFactory.identifier3('x'))..elementAnnotation = elementAnnotation;
     expect(_findAnnotations(), contains(_node));
   }
 
   void test_visitAnnotation_enumConstant() {
     // Analyzer ignores annotations on enum constant declarations.
-    Annotation annotation = AstFactory.annotation2(
-        AstFactory.identifier3('A'), null, AstFactory.argumentList());
+    Annotation annotation = AstTestFactory.annotation2(
+        AstTestFactory.identifier3('A'), null, AstTestFactory.argumentList());
     _node = new EnumConstantDeclaration(
-        null, <Annotation>[annotation], AstFactory.identifier3('C'));
+        null, <Annotation>[annotation], AstTestFactory.identifier3('C'));
     expect(_findConstants(), isEmpty);
   }
 
@@ -81,18 +81,18 @@
         compilationUnitElement;
     ElementAnnotationImpl elementAnnotation =
         new ElementAnnotationImpl(compilationUnitElement);
-    _node = elementAnnotation.annotationAst = AstFactory.annotation2(
-        AstFactory.identifier3('A'), null, AstFactory.argumentList())
+    _node = elementAnnotation.annotationAst = AstTestFactory.annotation2(
+        AstTestFactory.identifier3('A'), null, AstTestFactory.argumentList())
       ..elementAnnotation = elementAnnotation;
     expect(_findAnnotations(), contains(_node));
   }
 
   void test_visitAnnotation_partOf() {
     // Analyzer ignores annotations on "part of" directives.
-    Annotation annotation = AstFactory.annotation2(
-        AstFactory.identifier3('A'), null, AstFactory.argumentList());
-    _node = AstFactory.partOfDirective2(
-        <Annotation>[annotation], AstFactory.libraryIdentifier2(<String>['L']));
+    Annotation annotation = AstTestFactory.annotation2(
+        AstTestFactory.identifier3('A'), null, AstTestFactory.argumentList());
+    _node = AstTestFactory.partOfDirective2(<Annotation>[annotation],
+        AstTestFactory.libraryIdentifier2(<String>['L']));
     expect(_findConstants(), isEmpty);
   }
 
@@ -193,14 +193,14 @@
   ConstructorElement _setupConstructorDeclaration(String name, bool isConst) {
     Keyword constKeyword = isConst ? Keyword.CONST : null;
     ConstructorDeclaration constructorDeclaration =
-        AstFactory.constructorDeclaration2(
+        AstTestFactory.constructorDeclaration2(
             constKeyword,
             null,
             null,
             name,
-            AstFactory.formalParameterList(),
+            AstTestFactory.formalParameterList(),
             null,
-            AstFactory.blockFunctionBody2());
+            AstTestFactory.blockFunctionBody2());
     ClassElement classElement = ElementFactory.classElement2(name);
     ConstructorElement element =
         ElementFactory.constructorElement(classElement, name, isConst);
@@ -215,8 +215,9 @@
       bool isStatic: false,
       bool hasConstConstructor: false}) {
     VariableDeclaration variableDeclaration = isInitialized
-        ? AstFactory.variableDeclaration2(fieldName, AstFactory.integer(0))
-        : AstFactory.variableDeclaration(fieldName);
+        ? AstTestFactory.variableDeclaration2(
+            fieldName, AstTestFactory.integer(0))
+        : AstTestFactory.variableDeclaration(fieldName);
     VariableElement fieldElement = ElementFactory.fieldElement(
         fieldName,
         isStatic,
@@ -224,10 +225,10 @@
         keyword == Keyword.CONST,
         _typeProvider.intType);
     variableDeclaration.name.staticElement = fieldElement;
-    FieldDeclaration fieldDeclaration = AstFactory.fieldDeclaration2(
+    FieldDeclaration fieldDeclaration = AstTestFactory.fieldDeclaration2(
         isStatic, keyword, <VariableDeclaration>[variableDeclaration]);
-    ClassDeclaration classDeclaration =
-        AstFactory.classDeclaration(null, className, null, null, null, null);
+    ClassDeclaration classDeclaration = AstTestFactory.classDeclaration(
+        null, className, null, null, null, null);
     classDeclaration.members.add(fieldDeclaration);
     _node = classDeclaration;
     ClassElementImpl classElement = ElementFactory.classElement2(className);
@@ -235,14 +236,14 @@
     classDeclaration.name.staticElement = classElement;
     if (hasConstConstructor) {
       ConstructorDeclaration constructorDeclaration =
-          AstFactory.constructorDeclaration2(
+          AstTestFactory.constructorDeclaration2(
               Keyword.CONST,
               null,
-              AstFactory.identifier3(className),
+              AstTestFactory.identifier3(className),
               null,
-              AstFactory.formalParameterList(),
+              AstTestFactory.formalParameterList(),
               null,
-              AstFactory.blockFunctionBody2());
+              AstTestFactory.blockFunctionBody2());
       classDeclaration.members.add(constructorDeclaration);
       ConstructorElement constructorElement =
           ElementFactory.constructorElement(classElement, '', true);
@@ -258,13 +259,13 @@
       String name, bool isConst, bool isInitialized,
       {isFinal: false}) {
     VariableDeclaration variableDeclaration = isInitialized
-        ? AstFactory.variableDeclaration2(name, AstFactory.integer(0))
-        : AstFactory.variableDeclaration(name);
+        ? AstTestFactory.variableDeclaration2(name, AstTestFactory.integer(0))
+        : AstTestFactory.variableDeclaration(name);
     SimpleIdentifier identifier = variableDeclaration.name;
     VariableElement element = ElementFactory.localVariableElement(identifier);
     identifier.staticElement = element;
     Keyword keyword = isConst ? Keyword.CONST : isFinal ? Keyword.FINAL : null;
-    AstFactory.variableDeclarationList2(keyword, [variableDeclaration]);
+    AstTestFactory.variableDeclarationList2(keyword, [variableDeclaration]);
     _node = variableDeclaration;
     return element;
   }
@@ -298,7 +299,7 @@
 
   void test_visitSuperConstructorInvocation_unresolved() {
     SuperConstructorInvocation superConstructorInvocation =
-        AstFactory.superConstructorInvocation();
+        AstTestFactory.superConstructorInvocation();
     _visitNode(superConstructorInvocation);
     _assertNoArcs();
   }
@@ -323,14 +324,14 @@
     List<ConstructorInitializer> initializers =
         new List<ConstructorInitializer>();
     ConstructorDeclaration constructorDeclaration =
-        AstFactory.constructorDeclaration(AstFactory.identifier3(name), null,
-            AstFactory.formalParameterList(), initializers);
+        AstTestFactory.constructorDeclaration(AstTestFactory.identifier3(name),
+            null, AstTestFactory.formalParameterList(), initializers);
     if (isConst) {
       constructorDeclaration.constKeyword = new KeywordToken(Keyword.CONST, 0);
     }
     ClassElementImpl classElement = ElementFactory.classElement2(name);
     SuperConstructorInvocation superConstructorInvocation =
-        AstFactory.superConstructorInvocation();
+        AstTestFactory.superConstructorInvocation();
     ConstructorElementImpl constructorElement =
         ElementFactory.constructorElement(classElement, name, isConst);
     _tail = constructorElement;
@@ -340,14 +341,14 @@
 
   SimpleIdentifier _makeTailVariable(String name, bool isConst) {
     VariableDeclaration variableDeclaration =
-        AstFactory.variableDeclaration(name);
+        AstTestFactory.variableDeclaration(name);
     ConstLocalVariableElementImpl variableElement =
         ElementFactory.constLocalVariableElement(name);
     _tail = variableElement;
-    variableElement.const3 = isConst;
-    AstFactory.variableDeclarationList2(
+    variableElement.isConst = isConst;
+    AstTestFactory.variableDeclarationList2(
         isConst ? Keyword.CONST : Keyword.VAR, [variableDeclaration]);
-    SimpleIdentifier identifier = AstFactory.identifier3(name);
+    SimpleIdentifier identifier = AstTestFactory.identifier3(name);
     identifier.staticElement = variableElement;
     return identifier;
   }
diff --git a/pkg/analyzer/test/src/dart/constant/value_test.dart b/pkg/analyzer/test/src/dart/constant/value_test.dart
index 1323714..7e79afa 100644
--- a/pkg/analyzer/test/src/dart/constant/value_test.dart
+++ b/pkg/analyzer/test/src/dart/constant/value_test.dart
@@ -7,15 +7,15 @@
 import 'package:analyzer/src/generated/constant.dart';
 import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/testing/test_type_provider.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../../generated/test_support.dart';
-import '../../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(DartObjectImplTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(DartObjectImplTest);
+  });
 }
 
 const Matcher isEvaluationException = const isInstanceOf<EvaluationException>();
diff --git a/pkg/analyzer/test/src/dart/element/element_test.dart b/pkg/analyzer/test/src/dart/element/element_test.dart
index a1f72b8..5c691e3 100644
--- a/pkg/analyzer/test/src/dart/element/element_test.dart
+++ b/pkg/analyzer/test/src/dart/element/element_test.dart
@@ -14,37 +14,37 @@
 import 'package:analyzer/src/generated/engine.dart'
     show AnalysisContext, AnalysisOptionsImpl;
 import 'package:analyzer/src/generated/source_io.dart';
-import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
 import 'package:analyzer/src/generated/testing/element_factory.dart';
 import 'package:analyzer/src/generated/testing/test_type_provider.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../../generated/analysis_context_factory.dart'
     show AnalysisContextHelper;
 import '../../../generated/resolver_test_case.dart';
 import '../../../generated/test_support.dart';
-import '../../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ElementAnnotationImplTest);
-  defineReflectiveTests(FieldElementImplTest);
-  defineReflectiveTests(FunctionTypeImplTest);
-  defineReflectiveTests(InterfaceTypeImplTest);
-  defineReflectiveTests(LocalVariableElementImplTest);
-  defineReflectiveTests(TypeParameterTypeImplTest);
-  defineReflectiveTests(VoidTypeImplTest);
-  defineReflectiveTests(ClassElementImplTest);
-  defineReflectiveTests(CompilationUnitElementImplTest);
-  defineReflectiveTests(ElementLocationImplTest);
-  defineReflectiveTests(ElementImplTest);
-  defineReflectiveTests(LibraryElementImplTest);
-  defineReflectiveTests(MethodElementImplTest);
-  defineReflectiveTests(MultiplyDefinedElementImplTest);
-  defineReflectiveTests(ParameterElementImplTest);
-  defineReflectiveTests(PropertyAccessorElementImplTest);
-  defineReflectiveTests(TopLevelVariableElementImplTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ElementAnnotationImplTest);
+    defineReflectiveTests(FieldElementImplTest);
+    defineReflectiveTests(FunctionTypeImplTest);
+    defineReflectiveTests(InterfaceTypeImplTest);
+    defineReflectiveTests(LocalVariableElementImplTest);
+    defineReflectiveTests(TypeParameterTypeImplTest);
+    defineReflectiveTests(VoidTypeImplTest);
+    defineReflectiveTests(ClassElementImplTest);
+    defineReflectiveTests(CompilationUnitElementImplTest);
+    defineReflectiveTests(ElementLocationImplTest);
+    defineReflectiveTests(ElementImplTest);
+    defineReflectiveTests(LibraryElementImplTest);
+    defineReflectiveTests(MethodElementImplTest);
+    defineReflectiveTests(MultiplyDefinedElementImplTest);
+    defineReflectiveTests(ParameterElementImplTest);
+    defineReflectiveTests(PropertyAccessorElementImplTest);
+    defineReflectiveTests(TopLevelVariableElementImplTest);
+  });
 }
 
 @reflectiveTest
@@ -282,7 +282,7 @@
         ElementFactory.getterElement("foo", false, null);
     classA.accessors = <PropertyAccessorElement>[getter];
     // "foo" is static
-    getter.static = true;
+    getter.isStatic = true;
     expect(classA.hasStaticMember, isTrue);
   }
 
@@ -291,7 +291,7 @@
     MethodElementImpl method = ElementFactory.methodElement("foo", null);
     classA.methods = <MethodElement>[method];
     // "foo" is static
-    method.static = true;
+    method.isStatic = true;
     expect(classA.hasStaticMember, isTrue);
   }
 
@@ -301,7 +301,7 @@
         ElementFactory.setterElement("foo", false, null);
     classA.accessors = <PropertyAccessorElement>[setter];
     // "foo" is static
-    setter.static = true;
+    setter.isStatic = true;
     expect(classA.hasStaticMember, isTrue);
   }
 
@@ -1329,7 +1329,7 @@
   void test_creation() {
     expect(
         new FunctionTypeImpl(
-            new FunctionElementImpl.forNode(AstFactory.identifier3("f"))),
+            new FunctionElementImpl.forNode(AstTestFactory.identifier3("f"))),
         isNotNull);
   }
 
@@ -1353,7 +1353,7 @@
 
   void test_getElement() {
     FunctionElementImpl typeElement =
-        new FunctionElementImpl.forNode(AstFactory.identifier3("f"));
+        new FunctionElementImpl.forNode(AstTestFactory.identifier3("f"));
     FunctionTypeImpl type = new FunctionTypeImpl(typeElement);
     expect(type.element, typeElement);
   }
@@ -1465,7 +1465,7 @@
   void test_getReturnType() {
     DartType expectedReturnType = VoidTypeImpl.instance;
     FunctionElementImpl functionElement =
-        new FunctionElementImpl.forNode(AstFactory.identifier3("f"));
+        new FunctionElementImpl.forNode(AstTestFactory.identifier3("f"));
     functionElement.returnType = expectedReturnType;
     FunctionTypeImpl type = new FunctionTypeImpl(functionElement);
     DartType returnType = type.returnType;
@@ -1474,14 +1474,14 @@
 
   void test_getTypeArguments() {
     FunctionTypeImpl type = new FunctionTypeImpl(
-        new FunctionElementImpl.forNode(AstFactory.identifier3("f")));
+        new FunctionElementImpl.forNode(AstTestFactory.identifier3("f")));
     List<DartType> types = type.typeArguments;
     expect(types, hasLength(0));
   }
 
   void test_hashCode_element() {
     FunctionTypeImpl type = new FunctionTypeImpl(
-        new FunctionElementImpl.forNode(AstFactory.identifier3("f")));
+        new FunctionElementImpl.forNode(AstTestFactory.identifier3("f")));
     type.hashCode;
   }
 
@@ -1841,15 +1841,15 @@
     InterfaceType boolType = provider.boolType;
     InterfaceType stringType = provider.stringType;
     TypeParameterElementImpl parameterB =
-        new TypeParameterElementImpl.forNode(AstFactory.identifier3("B"));
+        new TypeParameterElementImpl.forNode(AstTestFactory.identifier3("B"));
     parameterB.bound = boolType;
     TypeParameterTypeImpl typeB = new TypeParameterTypeImpl(parameterB);
     TypeParameterElementImpl parameterS =
-        new TypeParameterElementImpl.forNode(AstFactory.identifier3("S"));
+        new TypeParameterElementImpl.forNode(AstTestFactory.identifier3("S"));
     parameterS.bound = stringType;
     TypeParameterTypeImpl typeS = new TypeParameterTypeImpl(parameterS);
     FunctionElementImpl functionAliasElement =
-        new FunctionElementImpl.forNode(AstFactory.identifier3("func"));
+        new FunctionElementImpl.forNode(AstTestFactory.identifier3("func"));
     functionAliasElement.parameters = <ParameterElement>[
       ElementFactory.requiredParameter2("a", typeB),
       ElementFactory.positionalParameter2("b", typeS)
@@ -1859,7 +1859,7 @@
         new FunctionTypeImpl(functionAliasElement);
     functionAliasElement.type = functionAliasType;
     FunctionElementImpl functionElement =
-        new FunctionElementImpl.forNode(AstFactory.identifier3("f"));
+        new FunctionElementImpl.forNode(AstTestFactory.identifier3("f"));
     functionElement.parameters = <ParameterElement>[
       ElementFactory.requiredParameter2("c", boolType),
       ElementFactory.positionalParameter2("d", stringType)
@@ -1942,7 +1942,7 @@
     // the user (and hence can't participate in circularities).
     FunctionTypeAliasElementImpl f =
         ElementFactory.functionTypeAliasElement('f');
-    f.synthetic = true;
+    f.isSynthetic = true;
     FunctionTypeImpl type = f.type;
     expect(type.newPrune, isNull);
   }
@@ -2041,7 +2041,7 @@
     ClassElementImpl definingClass = ElementFactory.classElement2("C", ["E"]);
     TypeParameterType parameterType = definingClass.typeParameters[0].type;
     MethodElementImpl functionElement =
-        new MethodElementImpl.forNode(AstFactory.identifier3("m"));
+        new MethodElementImpl.forNode(AstTestFactory.identifier3("m"));
     String namedParameterName = "c";
     functionElement.parameters = <ParameterElement>[
       ElementFactory.requiredParameter2("a", parameterType),
@@ -2052,7 +2052,7 @@
     definingClass.methods = <MethodElement>[functionElement];
     FunctionTypeImpl functionType = new FunctionTypeImpl(functionElement);
     InterfaceTypeImpl argumentType = new InterfaceTypeImpl(
-        new ClassElementImpl.forNode(AstFactory.identifier3("D")));
+        new ClassElementImpl.forNode(AstTestFactory.identifier3("D")));
     FunctionType result = functionType
         .substitute2(<DartType>[argumentType], <DartType>[parameterType]);
     expect(result.returnType, argumentType);
@@ -2069,15 +2069,15 @@
 
   void test_substitute2_notEqual() {
     DartType returnType = new InterfaceTypeImpl(
-        new ClassElementImpl.forNode(AstFactory.identifier3("R")));
+        new ClassElementImpl.forNode(AstTestFactory.identifier3("R")));
     DartType normalParameterType = new InterfaceTypeImpl(
-        new ClassElementImpl.forNode(AstFactory.identifier3("A")));
+        new ClassElementImpl.forNode(AstTestFactory.identifier3("A")));
     DartType optionalParameterType = new InterfaceTypeImpl(
-        new ClassElementImpl.forNode(AstFactory.identifier3("B")));
+        new ClassElementImpl.forNode(AstTestFactory.identifier3("B")));
     DartType namedParameterType = new InterfaceTypeImpl(
-        new ClassElementImpl.forNode(AstFactory.identifier3("C")));
+        new ClassElementImpl.forNode(AstTestFactory.identifier3("C")));
     FunctionElementImpl functionElement =
-        new FunctionElementImpl.forNode(AstFactory.identifier3("f"));
+        new FunctionElementImpl.forNode(AstTestFactory.identifier3("f"));
     String namedParameterName = "c";
     functionElement.parameters = <ParameterElement>[
       ElementFactory.requiredParameter2("a", normalParameterType),
@@ -2087,9 +2087,9 @@
     functionElement.returnType = returnType;
     FunctionTypeImpl functionType = new FunctionTypeImpl(functionElement);
     InterfaceTypeImpl argumentType = new InterfaceTypeImpl(
-        new ClassElementImpl.forNode(AstFactory.identifier3("D")));
+        new ClassElementImpl.forNode(AstTestFactory.identifier3("D")));
     TypeParameterTypeImpl parameterType = new TypeParameterTypeImpl(
-        new TypeParameterElementImpl.forNode(AstFactory.identifier3("E")));
+        new TypeParameterElementImpl.forNode(AstTestFactory.identifier3("E")));
     FunctionType result = functionType
         .substitute2(<DartType>[argumentType], <DartType>[parameterType]);
     expect(result.returnType, returnType);
@@ -2251,7 +2251,7 @@
   void test_withTypeArguments() {
     ClassElementImpl enclosingClass = ElementFactory.classElement2("C", ["E"]);
     MethodElementImpl methodElement =
-        new MethodElementImpl.forNode(AstFactory.identifier3("m"));
+        new MethodElementImpl.forNode(AstTestFactory.identifier3("m"));
     enclosingClass.methods = <MethodElement>[methodElement];
     FunctionTypeImpl type = new FunctionTypeImpl(methodElement);
     DartType expectedType = enclosingClass.typeParameters[0].type;
@@ -3180,7 +3180,7 @@
     InterfaceType typeA = classA.type;
     ClassElementImpl classB = ElementFactory.classElement2("B");
     TypeParameterElementImpl parameterEA =
-        new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
+        new TypeParameterElementImpl.forNode(AstTestFactory.identifier3("E"));
     TypeParameterType parameterAEType = new TypeParameterTypeImpl(parameterEA);
     parameterEA.bound = typeA;
     parameterEA.type = parameterAEType;
@@ -3782,14 +3782,14 @@
     // implementation.
     ClassElementImpl classA = ElementFactory.classElement2("A");
     TypeParameterElementImpl parameterElement =
-        new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
+        new TypeParameterElementImpl.forNode(AstTestFactory.identifier3("E"));
     InterfaceTypeImpl type = new InterfaceTypeImpl(classA);
     TypeParameterTypeImpl parameter =
         new TypeParameterTypeImpl(parameterElement);
     type.typeArguments = <DartType>[parameter];
     InterfaceType argumentType = ElementFactory.classElement2("B").type;
     TypeParameterTypeImpl parameterType = new TypeParameterTypeImpl(
-        new TypeParameterElementImpl.forNode(AstFactory.identifier3("F")));
+        new TypeParameterElementImpl.forNode(AstTestFactory.identifier3("F")));
     InterfaceType result =
         type.substitute2(<DartType>[argumentType], <DartType>[parameterType]);
     expect(result.element, classA);
@@ -3804,7 +3804,7 @@
   void test_creation() {
     expect(
         new LibraryElementImpl.forNode(
-            createAnalysisContext(), AstFactory.libraryIdentifier2(["l"])),
+            createAnalysisContext(), AstTestFactory.libraryIdentifier2(["l"])),
         isNotNull);
   }
 
@@ -3815,9 +3815,9 @@
     LibraryElementImpl library3 = ElementFactory.library(context, "l3");
     LibraryElementImpl library4 = ElementFactory.library(context, "l4");
     PrefixElement prefixA =
-        new PrefixElementImpl.forNode(AstFactory.identifier3("a"));
+        new PrefixElementImpl.forNode(AstTestFactory.identifier3("a"));
     PrefixElement prefixB =
-        new PrefixElementImpl.forNode(AstFactory.identifier3("b"));
+        new PrefixElementImpl.forNode(AstTestFactory.identifier3("b"));
     List<ImportElementImpl> imports = [
       ElementFactory.importFor(library2, null),
       ElementFactory.importFor(library2, prefixB),
@@ -3836,9 +3836,9 @@
     AnalysisContext context = createAnalysisContext();
     LibraryElementImpl library = ElementFactory.library(context, "l1");
     PrefixElement prefixA =
-        new PrefixElementImpl.forNode(AstFactory.identifier3("a"));
+        new PrefixElementImpl.forNode(AstTestFactory.identifier3("a"));
     PrefixElement prefixB =
-        new PrefixElementImpl.forNode(AstFactory.identifier3("b"));
+        new PrefixElementImpl.forNode(AstTestFactory.identifier3("b"));
     List<ImportElementImpl> imports = [
       ElementFactory.importFor(ElementFactory.library(context, "l2"), null),
       ElementFactory.importFor(ElementFactory.library(context, "l3"), null),
@@ -3891,7 +3891,7 @@
   void test_setImports() {
     AnalysisContext context = createAnalysisContext();
     LibraryElementImpl library = new LibraryElementImpl.forNode(
-        context, AstFactory.libraryIdentifier2(["l1"]));
+        context, AstTestFactory.libraryIdentifier2(["l1"]));
     List<ImportElementImpl> expectedImports = [
       ElementFactory.importFor(ElementFactory.library(context, "l2"), null),
       ElementFactory.importFor(ElementFactory.library(context, "l3"), null)
@@ -4247,21 +4247,21 @@
 class TypeParameterTypeImplTest extends EngineTestCase {
   void test_creation() {
     expect(
-        new TypeParameterTypeImpl(
-            new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"))),
+        new TypeParameterTypeImpl(new TypeParameterElementImpl.forNode(
+            AstTestFactory.identifier3("E"))),
         isNotNull);
   }
 
   void test_getElement() {
     TypeParameterElementImpl element =
-        new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
+        new TypeParameterElementImpl.forNode(AstTestFactory.identifier3("E"));
     TypeParameterTypeImpl type = new TypeParameterTypeImpl(element);
     expect(type.element, element);
   }
 
   void test_isMoreSpecificThan_typeArguments_dynamic() {
     TypeParameterElementImpl element =
-        new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
+        new TypeParameterElementImpl.forNode(AstTestFactory.identifier3("E"));
     TypeParameterTypeImpl type = new TypeParameterTypeImpl(element);
     // E << dynamic
     expect(type.isMoreSpecificThan(DynamicTypeImpl.instance), isTrue);
@@ -4269,7 +4269,7 @@
 
   void test_isMoreSpecificThan_typeArguments_object() {
     TypeParameterElementImpl element =
-        new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
+        new TypeParameterElementImpl.forNode(AstTestFactory.identifier3("E"));
     TypeParameterTypeImpl type = new TypeParameterTypeImpl(element);
     // E << Object
     expect(type.isMoreSpecificThan(ElementFactory.object.type), isTrue);
@@ -4278,11 +4278,11 @@
   void test_isMoreSpecificThan_typeArguments_recursive() {
     ClassElementImpl classS = ElementFactory.classElement2("A");
     TypeParameterElementImpl typeParameterU =
-        new TypeParameterElementImpl.forNode(AstFactory.identifier3("U"));
+        new TypeParameterElementImpl.forNode(AstTestFactory.identifier3("U"));
     TypeParameterTypeImpl typeParameterTypeU =
         new TypeParameterTypeImpl(typeParameterU);
     TypeParameterElementImpl typeParameterT =
-        new TypeParameterElementImpl.forNode(AstFactory.identifier3("T"));
+        new TypeParameterElementImpl.forNode(AstTestFactory.identifier3("T"));
     TypeParameterTypeImpl typeParameterTypeT =
         new TypeParameterTypeImpl(typeParameterT);
     typeParameterT.bound = typeParameterTypeU;
@@ -4294,7 +4294,7 @@
 
   void test_isMoreSpecificThan_typeArguments_self() {
     TypeParameterElementImpl element =
-        new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
+        new TypeParameterElementImpl.forNode(AstTestFactory.identifier3("E"));
     TypeParameterTypeImpl type = new TypeParameterTypeImpl(element);
     // E << E
     expect(type.isMoreSpecificThan(type), isTrue);
@@ -4309,7 +4309,7 @@
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
     TypeParameterElementImpl typeParameterT =
-        new TypeParameterElementImpl.forNode(AstFactory.identifier3("T"));
+        new TypeParameterElementImpl.forNode(AstTestFactory.identifier3("T"));
     typeParameterT.bound = typeB;
     TypeParameterTypeImpl typeParameterTypeT =
         new TypeParameterTypeImpl(typeParameterT);
@@ -4321,12 +4321,12 @@
   void test_isMoreSpecificThan_typeArguments_transitivity_typeParameters() {
     ClassElementImpl classS = ElementFactory.classElement2("A");
     TypeParameterElementImpl typeParameterU =
-        new TypeParameterElementImpl.forNode(AstFactory.identifier3("U"));
+        new TypeParameterElementImpl.forNode(AstTestFactory.identifier3("U"));
     typeParameterU.bound = classS.type;
     TypeParameterTypeImpl typeParameterTypeU =
         new TypeParameterTypeImpl(typeParameterU);
     TypeParameterElementImpl typeParameterT =
-        new TypeParameterElementImpl.forNode(AstFactory.identifier3("T"));
+        new TypeParameterElementImpl.forNode(AstTestFactory.identifier3("T"));
     typeParameterT.bound = typeParameterTypeU;
     TypeParameterTypeImpl typeParameterTypeT =
         new TypeParameterTypeImpl(typeParameterT);
@@ -4338,7 +4338,7 @@
   void test_isMoreSpecificThan_typeArguments_upperBound() {
     ClassElementImpl classS = ElementFactory.classElement2("A");
     TypeParameterElementImpl typeParameterT =
-        new TypeParameterElementImpl.forNode(AstFactory.identifier3("T"));
+        new TypeParameterElementImpl.forNode(AstTestFactory.identifier3("T"));
     typeParameterT.bound = classS.type;
     TypeParameterTypeImpl typeParameterTypeT =
         new TypeParameterTypeImpl(typeParameterT);
@@ -4350,7 +4350,7 @@
   void test_resolveToBound_bound() {
     ClassElementImpl classS = ElementFactory.classElement2("A");
     TypeParameterElementImpl element =
-        new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
+        new TypeParameterElementImpl.forNode(AstTestFactory.identifier3("E"));
     element.bound = classS.type;
     TypeParameterTypeImpl type = new TypeParameterTypeImpl(element);
     expect(type.resolveToBound(null), same(classS.type));
@@ -4359,11 +4359,11 @@
   void test_resolveToBound_nestedBound() {
     ClassElementImpl classS = ElementFactory.classElement2("A");
     TypeParameterElementImpl elementE =
-        new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
+        new TypeParameterElementImpl.forNode(AstTestFactory.identifier3("E"));
     elementE.bound = classS.type;
     TypeParameterTypeImpl typeE = new TypeParameterTypeImpl(elementE);
     TypeParameterElementImpl elementF =
-        new TypeParameterElementImpl.forNode(AstFactory.identifier3("F"));
+        new TypeParameterElementImpl.forNode(AstTestFactory.identifier3("F"));
     elementF.bound = typeE;
     TypeParameterTypeImpl typeF = new TypeParameterTypeImpl(elementE);
     expect(typeF.resolveToBound(null), same(classS.type));
@@ -4371,7 +4371,7 @@
 
   void test_resolveToBound_unbound() {
     TypeParameterTypeImpl type = new TypeParameterTypeImpl(
-        new TypeParameterElementImpl.forNode(AstFactory.identifier3("E")));
+        new TypeParameterElementImpl.forNode(AstTestFactory.identifier3("E")));
     // Returns whatever type is passed to resolveToBound().
     expect(type.resolveToBound(VoidTypeImpl.instance),
         same(VoidTypeImpl.instance));
@@ -4379,10 +4379,10 @@
 
   void test_substitute_equal() {
     TypeParameterElementImpl element =
-        new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
+        new TypeParameterElementImpl.forNode(AstTestFactory.identifier3("E"));
     TypeParameterTypeImpl type = new TypeParameterTypeImpl(element);
     InterfaceTypeImpl argument = new InterfaceTypeImpl(
-        new ClassElementImpl.forNode(AstFactory.identifier3("A")));
+        new ClassElementImpl.forNode(AstTestFactory.identifier3("A")));
     TypeParameterTypeImpl parameter = new TypeParameterTypeImpl(element);
     expect(type.substitute2(<DartType>[argument], <DartType>[parameter]),
         same(argument));
@@ -4390,11 +4390,11 @@
 
   void test_substitute_notEqual() {
     TypeParameterTypeImpl type = new TypeParameterTypeImpl(
-        new TypeParameterElementImpl.forNode(AstFactory.identifier3("E")));
+        new TypeParameterElementImpl.forNode(AstTestFactory.identifier3("E")));
     InterfaceTypeImpl argument = new InterfaceTypeImpl(
-        new ClassElementImpl.forNode(AstFactory.identifier3("A")));
+        new ClassElementImpl.forNode(AstTestFactory.identifier3("A")));
     TypeParameterTypeImpl parameter = new TypeParameterTypeImpl(
-        new TypeParameterElementImpl.forNode(AstFactory.identifier3("F")));
+        new TypeParameterElementImpl.forNode(AstTestFactory.identifier3("F")));
     expect(type.substitute2(<DartType>[argument], <DartType>[parameter]),
         same(type));
   }
diff --git a/pkg/analyzer/test/src/dart/element/test_all.dart b/pkg/analyzer/test/src/dart/element/test_all.dart
index 1997466..2577db8 100644
--- a/pkg/analyzer/test/src/dart/element/test_all.dart
+++ b/pkg/analyzer/test/src/dart/element/test_all.dart
@@ -4,15 +4,13 @@
 
 library analyzer.test.src.dart.element.test_all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../../utils.dart';
 import 'element_test.dart' as element;
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('element tests', () {
+  defineReflectiveSuite(() {
     element.main();
-  });
+  }, name: 'element');
 }
diff --git a/pkg/analyzer/test/src/dart/sdk/patch_test.dart b/pkg/analyzer/test/src/dart/sdk/patch_test.dart
new file mode 100644
index 0000000..dc3a903
--- /dev/null
+++ b/pkg/analyzer/test/src/dart/sdk/patch_test.dart
@@ -0,0 +1,837 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/ast/token.dart';
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/file_system/memory_file_system.dart';
+import 'package:analyzer/src/dart/sdk/patch.dart';
+import 'package:analyzer/src/dart/sdk/sdk.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/sdk.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/util/fast_uri.dart';
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(SdkPatcherTest);
+  });
+}
+
+@reflectiveTest
+class SdkPatcherTest {
+  MemoryResourceProvider provider = new MemoryResourceProvider();
+  Folder sdkFolder;
+  FolderBasedDartSdk sdk;
+
+  SdkPatcher patcher = new SdkPatcher();
+  RecordingErrorListener listener = new RecordingErrorListener();
+
+  void setUp() {
+    sdkFolder = provider.getFolder(_p('/sdk'));
+  }
+
+  test_class_constructor_append_fail_notPrivate_named() {
+    expect(() {
+      _doTopLevelPatching(
+          r'''
+class C {}
+''',
+          r'''
+@patch
+class C {
+  C.named() {}
+}
+''');
+    }, throwsArgumentError);
+  }
+
+  test_class_constructor_append_fail_notPrivate_unnamed() {
+    expect(() {
+      _doTopLevelPatching(
+          r'''
+class C {}
+''',
+          r'''
+@patch
+class C {
+  C() {}
+}
+''');
+    }, throwsArgumentError);
+  }
+
+  test_class_constructor_append_named() {
+    CompilationUnit unit = _doTopLevelPatching(
+        r'''
+class C {
+}
+''',
+        r'''
+@patch
+class C {
+  C._named() {}
+}
+''');
+    _assertUnitCode(unit, 'class C {C._named() {}}');
+    ClassDeclaration clazz = unit.declarations[0];
+    ConstructorDeclaration constructor = clazz.members[0];
+    _assertPrevNextToken(clazz.leftBracket, constructor.beginToken);
+    _assertPrevNextToken(constructor.endToken, clazz.rightBracket);
+  }
+
+  test_class_constructor_append_unnamed() {
+    CompilationUnit unit = _doTopLevelPatching(
+        r'''
+class _C {
+}
+''',
+        r'''
+@patch
+class _C {
+  _C() {}
+}
+''');
+    _assertUnitCode(unit, 'class _C {_C() {}}');
+    ClassDeclaration clazz = unit.declarations[0];
+    ConstructorDeclaration constructor = clazz.members[0];
+    _assertPrevNextToken(clazz.leftBracket, constructor.beginToken);
+    _assertPrevNextToken(constructor.endToken, clazz.rightBracket);
+  }
+
+  test_class_constructor_patch() {
+    CompilationUnit unit = _doTopLevelPatching(
+        r'''
+class C {
+  external C.named();
+}
+''',
+        r'''
+@patch
+class C {
+  @patch
+  C.named() {
+    print(42);
+  }
+}
+''');
+    _assertUnitCode(unit, 'class C {C.named() {print(42);}}');
+    ClassDeclaration clazz = unit.declarations[0];
+    ConstructorDeclaration constructor = clazz.members[0];
+    expect(constructor.externalKeyword, isNull);
+    _assertPrevNextToken(
+        constructor.parameters.endToken, constructor.body.beginToken);
+    _assertPrevNextToken(constructor.endToken, clazz.rightBracket);
+  }
+
+  test_class_constructor_patch_fail_baseFactory_patchGenerative() {
+    expect(() {
+      _doTopLevelPatching(
+          r'''
+class C {
+  external factory C.named();
+}
+''',
+          r'''
+@patch
+class C {
+  @patch
+  C.named() {}
+}
+''');
+    }, throwsArgumentError);
+  }
+
+  test_class_constructor_patch_fail_baseGenerative_patchFactory() {
+    expect(() {
+      _doTopLevelPatching(
+          r'''
+class C {
+  external C.named();
+}
+''',
+          r'''
+@patch
+class C {
+  @patch
+  factory C.named() {}
+}
+''');
+    }, throwsArgumentError);
+  }
+
+  test_class_constructor_patch_fail_hasInitializers() {
+    expect(() {
+      _doTopLevelPatching(
+          r'''
+class C {
+  int f;
+  external C.named() : f = 1;
+}
+''',
+          r'''
+@patch
+class C {
+  @patch
+  C.named() : f = 2 {}
+}
+''');
+    }, throwsArgumentError);
+  }
+
+  test_class_constructor_patch_fail_noExternalKeyword() {
+    expect(() {
+      _doTopLevelPatching(
+          r'''
+class C {
+  C.named();
+}
+''',
+          r'''
+@patch
+class C {
+  @patch
+  C.named() {}
+}
+''');
+    }, throwsArgumentError);
+  }
+
+  test_class_constructor_patch_initializers() {
+    CompilationUnit unit = _doTopLevelPatching(
+        r'''
+class C {
+  int f;
+  external C.named();
+}
+''',
+        r'''
+@patch
+class C {
+  @patch
+  C.named() : f = 2 {
+    print(42);
+  }
+}
+''');
+    _assertUnitCode(unit, 'class C {int f; C.named() : f = 2 {print(42);}}');
+    ClassDeclaration clazz = unit.declarations[0];
+    ConstructorDeclaration constructor = clazz.members[1];
+    expect(constructor.externalKeyword, isNull);
+    _assertPrevNextToken(constructor.parameters.endToken,
+        constructor.initializers.beginToken.previous);
+    _assertPrevNextToken(constructor.endToken, clazz.rightBracket);
+  }
+
+  test_class_field_append() {
+    CompilationUnit unit = _doTopLevelPatching(
+        r'''
+class C {
+  void a() {}
+}
+''',
+        r'''
+@patch
+class C {
+  int _b = 42;
+}
+''');
+    _assertUnitCode(unit, 'class C {void a() {} int _b = 42;}');
+    ClassDeclaration clazz = unit.declarations[0];
+    MethodDeclaration a = clazz.members[0];
+    FieldDeclaration b = clazz.members[1];
+    _assertPrevNextToken(a.endToken, b.beginToken);
+    _assertPrevNextToken(b.endToken, clazz.rightBracket);
+  }
+
+  test_class_field_append_fail_moreThanOne() {
+    expect(() {
+      _doTopLevelPatching(
+          r'''
+class A {}
+''',
+          r'''
+@patch
+class A {
+  @patch
+  int _f1, _f2;
+}
+''');
+    }, throwsArgumentError);
+  }
+
+  test_class_field_append_fail_notPrivate() {
+    expect(() {
+      _doTopLevelPatching(
+          r'''
+class A {}
+''',
+          r'''
+@patch
+class A {
+  @patch
+  int b;
+}
+''');
+    }, throwsArgumentError);
+  }
+
+  test_class_field_append_publicInPrivateClass() {
+    CompilationUnit unit = _doTopLevelPatching(
+        r'''
+class _C {
+  void a() {}
+}
+''',
+        r'''
+@patch
+class _C {
+  int b = 42;
+}
+''');
+    _assertUnitCode(unit, 'class _C {void a() {} int b = 42;}');
+    ClassDeclaration clazz = unit.declarations[0];
+    MethodDeclaration a = clazz.members[0];
+    FieldDeclaration b = clazz.members[1];
+    _assertPrevNextToken(a.endToken, b.beginToken);
+    _assertPrevNextToken(b.endToken, clazz.rightBracket);
+  }
+
+  test_class_field_patch_fail() {
+    expect(() {
+      _doTopLevelPatching(
+          r'''
+class A {}
+''',
+          r'''
+@patch
+class A {
+  @patch
+  int _f;
+}
+''');
+    }, throwsArgumentError);
+  }
+
+  test_class_getter_append() {
+    CompilationUnit unit = _doTopLevelPatching(
+        r'''
+class C {
+  void a() {}
+}
+''',
+        r'''
+@patch
+class C {
+  int get _b => 2;
+}
+''');
+    _assertUnitCode(unit, 'class C {void a() {} int get _b => 2;}');
+  }
+
+  test_class_method_append() {
+    CompilationUnit unit = _doTopLevelPatching(
+        r'''
+class C {
+  void a() {}
+}
+''',
+        r'''
+@patch
+class C {
+  void _b() {}
+  void _c() {}
+}
+''');
+    _assertUnitCode(unit, 'class C {void a() {} void _b() {} void _c() {}}');
+    ClassDeclaration clazz = unit.declarations[0];
+    MethodDeclaration a = clazz.members[0];
+    MethodDeclaration b = clazz.members[1];
+    MethodDeclaration c = clazz.members[2];
+    _assertPrevNextToken(a.endToken, b.beginToken);
+    _assertPrevNextToken(b.endToken, c.beginToken);
+    _assertPrevNextToken(c.endToken, clazz.rightBracket);
+  }
+
+  test_class_method_fail_notPrivate() {
+    expect(() {
+      _doTopLevelPatching(
+          r'''
+class A {}
+''',
+          r'''
+@patch
+class A {
+  void m() {}
+}
+''');
+    }, throwsArgumentError);
+  }
+
+  test_class_method_patch() {
+    CompilationUnit unit = _doTopLevelPatching(
+        r'''
+class C {
+  external int m();
+}
+''',
+        r'''
+@patch
+class C {
+  @patch
+  int m() => 42;
+}
+''');
+    _assertUnitCode(unit, 'class C {int m() => 42;}');
+    ClassDeclaration clazz = unit.declarations[0];
+    MethodDeclaration m = clazz.members[0];
+    expect(m.externalKeyword, isNull);
+    _assertPrevNextToken(m.parameters.rightParenthesis, m.body.beginToken);
+    _assertPrevNextToken(m.body.endToken, clazz.rightBracket);
+  }
+
+  test_class_method_patch_fail_noExternalKeyword() {
+    expect(() {
+      _doTopLevelPatching(
+          r'''
+class C {
+  int m();
+}
+''',
+          r'''
+@patch
+class C {
+  @patch
+  int m() => 42;
+}
+''');
+    }, throwsArgumentError);
+  }
+
+  test_class_setter_append() {
+    CompilationUnit unit = _doTopLevelPatching(
+        r'''
+class C {
+  void a() {}
+}
+''',
+        r'''
+@patch
+class C {
+  void set _b(_) {}
+}
+''');
+    _assertUnitCode(unit, 'class C {void a() {} void set _b(_) {}}');
+  }
+
+  test_directive_fail_export() {
+    expect(() {
+      _doTopLevelPatching(
+          r'''
+import 'a.dart';
+''',
+          r'''
+export 'c.dart';
+''');
+    }, throwsArgumentError);
+  }
+
+  test_directive_import() {
+    CompilationUnit unit = _doTopLevelPatching(
+        r'''
+import 'a.dart';
+part 'b.dart';
+int bar() => 0;
+''',
+        r'''
+import 'c.dart';
+''');
+    _assertUnitCode(unit,
+        "import 'a.dart'; part 'b.dart'; import 'c.dart'; int bar() => 0;");
+  }
+
+  test_fail_noSuchLibrary() {
+    expect(() {
+      _setSdkLibraries('const LIBRARIES = const {};');
+      _createSdk();
+      File file = provider.newFile(_p('/sdk/lib/test/test.dart'), '');
+      Source source = file.createSource(FastUri.parse('dart:test'));
+      CompilationUnit unit = SdkPatcher.parse(source, true, listener);
+      patcher.patch(sdk, SdkLibraryImpl.VM_PLATFORM, listener, source, unit);
+    }, throwsArgumentError);
+  }
+
+  test_fail_patchFileDoesNotExist() {
+    expect(() {
+      _setSdkLibraries(r'''
+final Map<String, LibraryInfo> LIBRARIES = const <String, LibraryInfo> {
+  'test' : const LibraryInfo(
+    'test/test.dart',
+    patches: {VM_PLATFORM: ['does_not_exists.dart']}),
+};''');
+      _createSdk();
+      File file = provider.newFile(_p('/sdk/lib/test/test.dart'), '');
+      Source source = file.createSource(FastUri.parse('dart:test'));
+      CompilationUnit unit = SdkPatcher.parse(source, true, listener);
+      patcher.patch(sdk, SdkLibraryImpl.VM_PLATFORM, listener, source, unit);
+    }, throwsArgumentError);
+  }
+
+  test_internal_allowNewPublicNames() {
+    _setSdkLibraries(r'''
+final Map<String, LibraryInfo> LIBRARIES = const <String, LibraryInfo> {
+  '_internal' : const LibraryInfo(
+    'internal/internal.dart',
+    patches: {VM_PLATFORM: ['internal/internal_patch.dart']}),
+};''');
+    File file = provider.newFile(
+        _p('/sdk/lib/internal/internal.dart'),
+        r'''
+library dart._internal;
+class A {}
+class B {
+  B();
+}
+''');
+    provider.newFile(
+        _p('/sdk/lib/internal/internal_patch.dart'),
+        r'''
+@patch
+class B {
+  int newField;
+  B.newConstructor();
+  int newMethod() => 1;
+}
+class NewClass {}
+int newFunction() => 2;
+''');
+
+    _createSdk();
+
+    Source source = file.createSource(FastUri.parse('dart:_internal'));
+    CompilationUnit unit = SdkPatcher.parse(source, true, listener);
+    patcher.patch(sdk, SdkLibraryImpl.VM_PLATFORM, listener, source, unit);
+    _assertUnitCode(
+        unit,
+        'library dart._internal; class A {} '
+        'class B {B(); int newField; B.newConstructor(); int newMethod() => 1;} '
+        'class NewClass {} int newFunction() => 2;');
+  }
+
+  test_part() {
+    String baseLibCode = r'''
+library test;
+part 'test_part.dart';
+class A {}
+''';
+    String basePartCode = r'''
+part of test;
+class B {}
+''';
+    _setSdkLibraries(r'''
+final Map<String, LibraryInfo> LIBRARIES = const <String, LibraryInfo> {
+  'test' : const LibraryInfo(
+    'test/test.dart',
+    patches: {VM_PLATFORM: ['test/test_patch.dart']}),
+};''');
+    File fileLib = provider.newFile(_p('/sdk/lib/test/test.dart'), baseLibCode);
+    File filePart =
+        provider.newFile(_p('/sdk/lib/test/test_part.dart'), basePartCode);
+    provider.newFile(
+        _p('/sdk/lib/test/test_patch.dart'),
+        r'''
+import 'foo.dart';
+
+@patch
+class A {
+  int _a() => 1;
+}
+
+@patch
+class B {
+  int _b() => 1;
+}
+
+class _C {}
+''');
+
+    _createSdk();
+
+    {
+      Uri uri = FastUri.parse('dart:test');
+      Source source = fileLib.createSource(uri);
+      CompilationUnit unit = SdkPatcher.parse(source, true, listener);
+      patcher.patch(sdk, SdkLibraryImpl.VM_PLATFORM, listener, source, unit);
+      _assertUnitCode(
+          unit,
+          "library test; part 'test_part.dart'; import 'foo.dart'; "
+          "class A {int _a() => 1;} class _C {}");
+    }
+
+    {
+      Uri uri = FastUri.parse('dart:test/test_part.dart');
+      Source source = filePart.createSource(uri);
+      CompilationUnit unit = SdkPatcher.parse(source, true, listener);
+      patcher.patch(sdk, SdkLibraryImpl.VM_PLATFORM, listener, source, unit);
+      _assertUnitCode(unit, "part of test; class B {int _b() => 1;}");
+    }
+  }
+
+  test_topLevel_class_append() {
+    CompilationUnit unit = _doTopLevelPatching(
+        r'''
+class A {}
+''',
+        r'''
+class _B {
+  void mmm() {}
+}
+''');
+    _assertUnitCode(unit, 'class A {} class _B {void mmm() {}}');
+    ClassDeclaration a = unit.declarations[0];
+    ClassDeclaration b = unit.declarations[1];
+    _assertPrevNextToken(a.endToken, b.beginToken);
+  }
+
+  test_topLevel_class_fail_mixinApplication() {
+    expect(() {
+      _doTopLevelPatching(
+          r'''
+class A {}
+''',
+          r'''
+class _B {}
+class _C = Object with _B;
+''');
+    }, throwsArgumentError);
+  }
+
+  test_topLevel_class_fail_notPrivate() {
+    expect(() {
+      _doTopLevelPatching(
+          r'''
+class A {}
+''',
+          r'''
+class B {}
+''');
+    }, throwsArgumentError);
+  }
+
+  test_topLevel_fail_topLevelVariable() {
+    expect(() {
+      _doTopLevelPatching(
+          r'''
+int foo() => 0;
+''',
+          r'''
+int _bar;
+''');
+    }, throwsArgumentError);
+  }
+
+  test_topLevel_function_append() {
+    CompilationUnit unit = _doTopLevelPatching(
+        r'''
+int foo() => 0;
+''',
+        r'''
+int _bar1() => 1;
+int _bar2() => 2;
+''');
+    _assertUnitCode(
+        unit, 'int foo() => 0; int _bar1() => 1; int _bar2() => 2;');
+
+    FunctionDeclaration foo = unit.declarations[0];
+    FunctionDeclaration bar1 = unit.declarations[1];
+    FunctionDeclaration bar2 = unit.declarations[2];
+
+    _assertPrevNextToken(foo.endToken, bar1.beginToken);
+    _assertPrevNextToken(bar1.endToken, bar2.beginToken);
+  }
+
+  test_topLevel_function_fail_noExternalKeyword() {
+    expect(() {
+      _doTopLevelPatching(
+          r'''
+int foo();
+''',
+          r'''
+@patch
+int foo() => 1;
+''');
+    }, throwsArgumentError);
+  }
+
+  test_topLevel_function_fail_notPrivate() {
+    expect(() {
+      _doTopLevelPatching(
+          r'''
+int foo() => 1;
+''',
+          r'''
+int bar() => 2;
+''');
+    }, throwsArgumentError);
+  }
+
+  test_topLevel_functionTypeAlias_append() {
+    CompilationUnit unit = _doTopLevelPatching(
+        r'''
+int foo() => 0;
+''',
+        r'''
+typedef int _bar1();
+typedef int _bar2();
+''');
+    _assertUnitCode(
+        unit, 'int foo() => 0; typedef int _bar1(); typedef int _bar2();');
+
+    FunctionDeclaration foo = unit.declarations[0];
+    FunctionTypeAlias bar1 = unit.declarations[1];
+    FunctionTypeAlias bar2 = unit.declarations[2];
+
+    _assertPrevNextToken(foo.endToken, bar1.beginToken);
+    _assertPrevNextToken(bar1.endToken, bar2.beginToken);
+    expect(unit.endToken.type, TokenType.EOF);
+    expect(bar2.endToken.next, same(unit.endToken));
+  }
+
+  test_topLevel_functionTypeAlias_fail_hasAnnotation() {
+    expect(() {
+      _doTopLevelPatching(
+          r'''
+int foo() => 0;
+''',
+          r'''
+@patch
+typedef int _bar();
+''');
+    }, throwsArgumentError);
+  }
+
+  test_topLevel_functionTypeAlias_fail_notPrivate() {
+    expect(() {
+      _doTopLevelPatching(
+          r'''
+int foo() => 0;
+''',
+          r'''
+typedef int bar();
+''');
+    }, throwsArgumentError);
+  }
+
+  test_topLevel_patch_function() {
+    CompilationUnit unit = _doTopLevelPatching(
+        r'''
+external int foo();
+int bar() => 2;
+''',
+        r'''
+@patch
+int foo() => 1;
+''');
+    _assertUnitCode(unit, 'int foo() => 1; int bar() => 2;');
+
+    // Prepare functions.
+    FunctionDeclaration foo = unit.declarations[0];
+    FunctionDeclaration bar = unit.declarations[1];
+
+    // The "external" token is removed from the stream.
+    {
+      expect(foo.externalKeyword, isNull);
+      Token token = foo.beginToken;
+      expect(token.lexeme, 'int');
+      expect(token.previous.type, TokenType.EOF);
+    }
+
+    // The body tokens are included into the patched token stream.
+    {
+      FunctionExpression fooExpr = foo.functionExpression;
+      FunctionBody fooBody = fooExpr.body;
+      expect(fooBody.beginToken.previous, same(fooExpr.parameters.endToken));
+      expect(fooBody.endToken.next, same(bar.beginToken));
+    }
+  }
+
+  test_topLevel_patch_function_blockBody() {
+    CompilationUnit unit = _doTopLevelPatching(
+        r'''
+external int foo();
+''',
+        r'''
+@patch
+int foo() {int v = 1; return v + 2;}
+''');
+    _assertUnitCode(unit, 'int foo() {int v = 1; return v + 2;}');
+  }
+
+  test_topLevel_patch_getter() {
+    CompilationUnit unit = _doTopLevelPatching(
+        r'''
+external int get foo;
+int bar() => 2;
+''',
+        r'''
+@patch
+int get foo => 1;
+''');
+    _assertUnitCode(unit, 'int get foo => 1; int bar() => 2;');
+  }
+
+  test_topLevel_patch_setter() {
+    CompilationUnit unit = _doTopLevelPatching(
+        r'''
+external void set foo(int val);
+int bar() => 2;
+''',
+        r'''
+@patch
+void set foo(int val) {}
+''');
+    _assertUnitCode(unit, 'void set foo(int val) {} int bar() => 2;');
+  }
+
+  void _assertUnitCode(CompilationUnit unit, String expectedCode) {
+    expect(unit.toSource(), expectedCode);
+  }
+
+  void _createSdk() {
+    sdk = new FolderBasedDartSdk(provider, sdkFolder);
+    sdk.analysisOptions = new AnalysisOptionsImpl()..strongMode = true;
+  }
+
+  CompilationUnit _doTopLevelPatching(String baseCode, String patchCode) {
+    _setSdkLibraries(r'''
+final Map<String, LibraryInfo> LIBRARIES = const <String, LibraryInfo> {
+  'test' : const LibraryInfo(
+    'test/test.dart',
+    patches: {VM_PLATFORM: ['test/test_patch.dart']}),
+};''');
+    File file = provider.newFile(_p('/sdk/lib/test/test.dart'), baseCode);
+    provider.newFile(_p('/sdk/lib/test/test_patch.dart'), patchCode);
+
+    _createSdk();
+
+    Source source = file.createSource(FastUri.parse('dart:test'));
+    CompilationUnit unit = SdkPatcher.parse(source, true, listener);
+    patcher.patch(sdk, SdkLibraryImpl.VM_PLATFORM, listener, source, unit);
+    return unit;
+  }
+
+  String _p(String path) => provider.convertPath(path);
+
+  void _setSdkLibraries(String code) {
+    provider.newFile(
+        _p('/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart'), code);
+  }
+
+  static void _assertPrevNextToken(Token prev, Token next) {
+    expect(prev.next, same(next));
+    expect(next.previous, same(prev));
+  }
+}
diff --git a/pkg/analyzer/test/src/dart/sdk/sdk_test.dart b/pkg/analyzer/test/src/dart/sdk/sdk_test.dart
index 7444827..dbc0d01 100644
--- a/pkg/analyzer/test/src/dart/sdk/sdk_test.dart
+++ b/pkg/analyzer/test/src/dart/sdk/sdk_test.dart
@@ -13,20 +13,21 @@
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/summary/summarize_elements.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../../embedder_tests.dart';
 import '../../../generated/test_support.dart';
 import '../../../resource_utils.dart';
-import '../../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(EmbedderSdkTest);
-  defineReflectiveTests(FolderBasedDartSdkTest);
-  defineReflectiveTests(SdkExtensionFinderTest);
-  defineReflectiveTests(SDKLibrariesReaderTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(EmbedderSdkTest);
+    defineReflectiveTests(FolderBasedDartSdkTest);
+    defineReflectiveTests(SdkExtensionFinderTest);
+    defineReflectiveTests(SdkLibrariesReaderTest);
+    defineReflectiveTests(SdkLibraryImplTest);
+  });
 }
 
 @reflectiveTest
@@ -274,7 +275,8 @@
 
   FolderBasedDartSdk _createDartSdk() {
     resourceProvider = new MemoryResourceProvider();
-    Folder sdkDirectory = resourceProvider.getFolder('/sdk');
+    Folder sdkDirectory =
+        resourceProvider.getFolder(resourceProvider.convertPath('/sdk'));
     _createFile(sdkDirectory,
         ['lib', '_internal', 'sdk_library_metadata', 'lib', 'libraries.dart'],
         content: _librariesFileContent());
@@ -340,10 +342,10 @@
 
   void setUp() {
     resourceProvider = new MemoryResourceProvider();
-    resourceProvider.newFolder('/empty');
-    resourceProvider.newFolder('/tmp');
+    resourceProvider.newFolder(resourceProvider.convertPath('/empty'));
+    resourceProvider.newFolder(resourceProvider.convertPath('/tmp'));
     resourceProvider.newFile(
-        '/tmp/_sdkext',
+        resourceProvider.convertPath('/tmp/_sdkext'),
         r'''
 {
   "dart:fox": "slippy.dart",
@@ -356,7 +358,9 @@
 
   test_create_noSdkExtPackageMap() {
     var resolver = new SdkExtensionFinder({
-      'fox': <Folder>[resourceProvider.getResource('/empty')]
+      'fox': <Folder>[
+        resourceProvider.getResource(resourceProvider.convertPath('/empty'))
+      ]
     });
     expect(resolver.urlMappings.length, equals(0));
   }
@@ -368,21 +372,27 @@
 
   test_create_sdkExtPackageMap() {
     var resolver = new SdkExtensionFinder({
-      'fox': <Folder>[resourceProvider.getResource('/tmp')]
+      'fox': <Folder>[
+        resourceProvider.getResource(resourceProvider.convertPath('/tmp'))
+      ]
     });
     // We have four mappings.
     Map<String, String> urlMappings = resolver.urlMappings;
     expect(urlMappings.length, equals(4));
     // Check that they map to the correct paths.
-    expect(urlMappings['dart:fox'], equals("/tmp/slippy.dart"));
-    expect(urlMappings['dart:bear'], equals("/tmp/grizzly.dart"));
-    expect(urlMappings['dart:relative'], equals("/relative.dart"));
-    expect(urlMappings['dart:deep'], equals("/tmp/deep/directory/file.dart"));
+    expect(urlMappings['dart:fox'],
+        equals(resourceProvider.convertPath("/tmp/slippy.dart")));
+    expect(urlMappings['dart:bear'],
+        equals(resourceProvider.convertPath("/tmp/grizzly.dart")));
+    expect(urlMappings['dart:relative'],
+        equals(resourceProvider.convertPath("/relative.dart")));
+    expect(urlMappings['dart:deep'],
+        equals(resourceProvider.convertPath("/tmp/deep/directory/file.dart")));
   }
 }
 
 @reflectiveTest
-class SDKLibrariesReaderTest extends EngineTestCase {
+class SdkLibrariesReaderTest extends EngineTestCase {
   /**
    * The resource provider used by these tests.
    */
@@ -464,4 +474,148 @@
     expect(second.isImplementation, true);
     expect(second.isVmLibrary, false);
   }
+
+  void test_readFrom_patches() {
+    LibraryMap libraryMap = new SdkLibrariesReader(false).readFromFile(
+        resourceProvider.getFile('/libs.dart'),
+        r'''
+final Map<String, LibraryInfo> LIBRARIES = const <String, LibraryInfo> {
+  'foo' : const LibraryInfo(
+    'foo/foo.dart',
+    patches: {
+      DART2JS_PLATFORM | VM_PLATFORM: ['a', 'b'],
+      DART2JS_PLATFORM: ['c', 'd'],
+      VM_PLATFORM: ['e']}),
+};''');
+    expect(libraryMap, isNotNull);
+    expect(libraryMap.size(), 1);
+    SdkLibrary library = libraryMap.getLibrary('dart:foo');
+    expect(library, isNotNull);
+    expect(library.path, 'foo/foo.dart');
+    expect(library.shortName, 'dart:foo');
+    expect(library.getPatches(SdkLibraryImpl.DART2JS_PLATFORM),
+        unorderedEquals(['a', 'b', 'c', 'd']));
+    expect(library.getPatches(SdkLibraryImpl.VM_PLATFORM),
+        unorderedEquals(['a', 'b', 'e']));
+  }
+
+  void test_readFrom_patches_invalid_notList() {
+    expect(() {
+      new SdkLibrariesReader(false).readFromFile(
+          resourceProvider.getFile('/libs.dart'),
+          r'''
+final Map<String, LibraryInfo> LIBRARIES = const <String, LibraryInfo> {
+  'foo' : const LibraryInfo(
+    'foo/foo.dart',
+    patches: {
+      VM_PLATFORM: 'X'}),
+};''');
+    }, throwsArgumentError);
+  }
+
+  void test_readFrom_patches_invalid_notString_inList() {
+    expect(() {
+      new SdkLibrariesReader(false).readFromFile(
+          resourceProvider.getFile('/libs.dart'),
+          r'''
+final Map<String, LibraryInfo> LIBRARIES = const <String, LibraryInfo> {
+  'foo' : const LibraryInfo(
+    'foo/foo.dart',
+    patches: {
+      VM_PLATFORM: [42]}),
+};''');
+    }, throwsArgumentError);
+  }
+
+  void test_readFrom_patches_invalid_path_hasDotDot() {
+    _assertPatchPathIsInvalid('foo/../bar.dart');
+    _assertPatchPathIsInvalid('../foo/bar.dart');
+    _assertPatchPathIsInvalid('foo/bar..dart');
+  }
+
+  void test_readFrom_patches_invalid_path_isAbsolute() {
+    _assertPatchPathIsInvalid('/foo.dart');
+    _assertPatchPathIsInvalid('/foo/bar.dart');
+  }
+
+  void test_readFrom_patches_invalid_path_notPosix() {
+    _assertPatchPathIsInvalid(r'foo\bar.dart');
+  }
+
+  void test_readFrom_patches_invalid_platformCombinator() {
+    expect(() {
+      new SdkLibrariesReader(false).readFromFile(
+          resourceProvider.getFile('/libs.dart'),
+          r'''
+final Map<String, LibraryInfo> LIBRARIES = const <String, LibraryInfo> {
+  'foo' : const LibraryInfo(
+    'foo/foo.dart',
+    patches: {
+      DART2JS_PLATFORM + VM_PLATFORM: ['X']}),
+};''');
+    }, throwsArgumentError);
+  }
+
+  void test_readFrom_patches_invalid_unknownPlatform() {
+    expect(() {
+      new SdkLibrariesReader(false).readFromFile(
+          resourceProvider.getFile('/libs.dart'),
+          r'''
+final Map<String, LibraryInfo> LIBRARIES = const <String, LibraryInfo> {
+  'foo' : const LibraryInfo(
+    'foo/foo.dart',
+    patches: {
+      MY_UNKNOWN_PLATFORM: ['foo/bar_patch.dart']}),
+};''');
+    }, throwsArgumentError);
+  }
+
+  void test_readFrom_patches_no() {
+    LibraryMap libraryMap = new SdkLibrariesReader(false).readFromFile(
+        resourceProvider.getFile('/libs.dart'),
+        r'''
+final Map<String, LibraryInfo> LIBRARIES = const <String, LibraryInfo> {
+  'my' : const LibraryInfo('my/my.dart')
+};''');
+    expect(libraryMap, isNotNull);
+    expect(libraryMap.size(), 1);
+    SdkLibrary library = libraryMap.getLibrary('dart:my');
+    expect(library, isNotNull);
+    expect(library.path, 'my/my.dart');
+    expect(library.shortName, 'dart:my');
+    expect(library.getPatches(SdkLibraryImpl.VM_PLATFORM), isEmpty);
+    expect(library.getPatches(SdkLibraryImpl.DART2JS_PLATFORM), isEmpty);
+  }
+
+  void _assertPatchPathIsInvalid(String patchPath) {
+    expect(() {
+      new SdkLibrariesReader(false).readFromFile(
+          resourceProvider.getFile('/libs.dart'),
+          '''
+final Map<String, LibraryInfo> LIBRARIES = const <String, LibraryInfo> {
+  'foo' : const LibraryInfo(
+    'foo/foo.dart',
+    patches: {
+      VM_PLATFORM: [r'$patchPath']}),
+};''');
+    }, throwsArgumentError);
+  }
+}
+
+@reflectiveTest
+class SdkLibraryImplTest extends EngineTestCase {
+  void test_patches() {
+    SdkLibraryImpl library = new SdkLibraryImpl('dart:foo');
+    // Set patches.
+    library.setPatchPaths(
+        SdkLibraryImpl.DART2JS_PLATFORM | SdkLibraryImpl.VM_PLATFORM,
+        ['a', 'b']);
+    library.setPatchPaths(SdkLibraryImpl.DART2JS_PLATFORM, ['c', 'd']);
+    library.setPatchPaths(SdkLibraryImpl.VM_PLATFORM, ['e']);
+    // Get patches.
+    expect(library.getPatches(SdkLibraryImpl.DART2JS_PLATFORM),
+        unorderedEquals(['a', 'b', 'c', 'd']));
+    expect(library.getPatches(SdkLibraryImpl.VM_PLATFORM),
+        unorderedEquals(['a', 'b', 'e']));
+  }
 }
diff --git a/pkg/analyzer/test/src/dart/sdk/test_all.dart b/pkg/analyzer/test/src/dart/sdk/test_all.dart
index 8052c9e..cb044fd 100644
--- a/pkg/analyzer/test/src/dart/sdk/test_all.dart
+++ b/pkg/analyzer/test/src/dart/sdk/test_all.dart
@@ -4,15 +4,15 @@
 
 library analyzer.test.src.dart.sdk.test_all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../../utils.dart';
+import 'patch_test.dart' as patch_test;
 import 'sdk_test.dart' as sdk;
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('sdk tests', () {
+  defineReflectiveSuite(() {
+    patch_test.main();
     sdk.main();
-  });
+  }, name: 'sdk');
 }
diff --git a/pkg/analyzer/test/src/dart/test_all.dart b/pkg/analyzer/test/src/dart/test_all.dart
index 26e34d3..78ac68f 100644
--- a/pkg/analyzer/test/src/dart/test_all.dart
+++ b/pkg/analyzer/test/src/dart/test_all.dart
@@ -4,9 +4,9 @@
 
 library analyzer.test.src.dart.test_all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
+import 'analysis/test_all.dart' as analysis;
 import 'ast/test_all.dart' as ast;
 import 'constant/test_all.dart' as constant;
 import 'element/test_all.dart' as element;
@@ -14,11 +14,11 @@
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('dart tests', () {
+  defineReflectiveSuite(() {
+    analysis.main();
     ast.main();
     constant.main();
     element.main();
     sdk.main();
-  });
+  }, name: 'dart');
 }
diff --git a/pkg/analyzer/test/src/plugin/plugin_config_test.dart b/pkg/analyzer/test/src/plugin/plugin_config_test.dart
index 2c9fa04..84ec8c8 100644
--- a/pkg/analyzer/test/src/plugin/plugin_config_test.dart
+++ b/pkg/analyzer/test/src/plugin/plugin_config_test.dart
@@ -6,7 +6,7 @@
 
 import 'package:analyzer/source/analysis_options_provider.dart';
 import 'package:analyzer/src/plugin/plugin_configuration.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 import 'package:yaml/yaml.dart';
 
 main() {
@@ -16,7 +16,7 @@
         const optionsSrc = '''
 analyzer:
   plugins:
-    my_plugin1: ^0.1.0 #shorthand 
+    my_plugin1: ^0.1.0 #shorthand
     my_plugin2:
       version: ^0.2.0
     my_plugin3:
@@ -42,7 +42,7 @@
         const optionsSrc = '''
 analyzer:
   plugins:
-    # my_plugin1: ^0.1.0 #shorthand 
+    # my_plugin1: ^0.1.0 #shorthand
 ''';
         var config = parseConfig(optionsSrc);
         // Commented out plugins shouldn't cause a parse failure.
@@ -53,7 +53,7 @@
         const manifestSrc = '''
 class_name: AnalyzerPlugin
 library_uri: myplugin/analyzer_plugin.dart
-contributes_to: analyzer  
+contributes_to: analyzer
 ''';
         var manifest = parsePluginManifestString(manifestSrc);
         var plugin = manifest.plugin;
@@ -66,9 +66,9 @@
         const manifestSrc = '''
 class_name: AnalyzerPlugin
 library_uri: myplugin/analyzer_plugin.dart
-contributes_to: 
+contributes_to:
   - analyzer
-  - analysis_server  
+  - analysis_server
 ''';
         var manifest = parsePluginManifestString(manifestSrc);
         var plugin = manifest.plugin;
diff --git a/pkg/analyzer/test/src/source/source_resource_test.dart b/pkg/analyzer/test/src/source/source_resource_test.dart
index 8079c17..29474a0 100644
--- a/pkg/analyzer/test/src/source/source_resource_test.dart
+++ b/pkg/analyzer/test/src/source/source_resource_test.dart
@@ -12,15 +12,15 @@
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/utilities_dart.dart';
 import 'package:analyzer/src/source/source_resource.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../context/mock_sdk.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(FileSourceTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(FileSourceTest);
+  });
 }
 
 @reflectiveTest
@@ -93,7 +93,7 @@
   void test_getEncoding() {
     SourceFactory factory =
         new SourceFactory([new ResourceUriResolver(resourceProvider)]);
-    String fullPath = "/does/not/exist.dart";
+    String fullPath = resourceProvider.convertPath("/does/not/exist.dart");
     File file = resourceProvider.getFile(fullPath);
     FileSource source = new FileSource(file);
     expect(factory.fromEncoding(source.encoding), source);
diff --git a/pkg/analyzer/test/src/source/test_all.dart b/pkg/analyzer/test/src/source/test_all.dart
index fea6306..5b7a464 100644
--- a/pkg/analyzer/test/src/source/test_all.dart
+++ b/pkg/analyzer/test/src/source/test_all.dart
@@ -4,15 +4,13 @@
 
 library analyzer.test.src.source.test_all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
 import 'source_resource_test.dart' as source_resource_test;
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('context tests', () {
+  defineReflectiveSuite(() {
     source_resource_test.main();
-  });
+  }, name: 'source');
 }
diff --git a/pkg/analyzer/test/src/summary/api_signature_test.dart b/pkg/analyzer/test/src/summary/api_signature_test.dart
index a8c3459..eb8700b 100644
--- a/pkg/analyzer/test/src/summary/api_signature_test.dart
+++ b/pkg/analyzer/test/src/summary/api_signature_test.dart
@@ -8,12 +8,13 @@
 import 'package:analyzer/src/summary/format.dart';
 import 'package:convert/convert.dart';
 import 'package:crypto/crypto.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 main() {
-  groupSep = ' | ';
-  defineReflectiveTests(ApiSignatureTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ApiSignatureTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/src/summary/bazel_summary_test.dart b/pkg/analyzer/test/src/summary/bazel_summary_test.dart
index afa2265..a020a32 100644
--- a/pkg/analyzer/test/src/summary/bazel_summary_test.dart
+++ b/pkg/analyzer/test/src/summary/bazel_summary_test.dart
@@ -4,8 +4,10 @@
 
 import 'package:analyzer/dart/ast/ast.dart';
 import 'package:analyzer/dart/ast/token.dart';
+import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer/error/listener.dart';
 import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/src/context/cache.dart';
 import 'package:analyzer/src/dart/scanner/reader.dart';
 import 'package:analyzer/src/dart/scanner/scanner.dart';
 import 'package:analyzer/src/generated/engine.dart';
@@ -13,99 +15,496 @@
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/summary/bazel_summary.dart';
 import 'package:analyzer/src/summary/format.dart';
+import 'package:analyzer/src/summary/idl.dart';
 import 'package:analyzer/src/summary/summarize_ast.dart';
 import 'package:analyzer/src/summary/summarize_elements.dart';
 import 'package:analyzer/src/util/fast_uri.dart';
+import 'package:analyzer/task/dart.dart';
 import 'package:path/path.dart' as pathos;
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../context/abstract_context.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(SummaryProviderTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(BazelResultProviderTest);
+    defineReflectiveTests(SummaryProviderTest);
+  });
 }
 
-const OUT_ROOT = '$SRC_ROOT/bazel-bin';
-const SRC_ROOT = '/company/src/user/project/root';
+@reflectiveTest
+class BazelResultProviderTest extends _BaseTest {
+  BazelResultProvider provider;
+
+  @override
+  void setUp() {
+    super.setUp();
+    provider = new BazelResultProvider(new SummaryProvider(
+        resourceProvider,
+        '_.temp',
+        _getOutputFolder,
+        resourceProvider
+            .getFolder(resourceProvider.convertPath('/tmp/dart/bazel/linked')),
+        context));
+  }
+
+  test_failure_inconsistent_directDependency() {
+    _setComponentFile('aaa', 'a.dart', 'class A {}');
+    _setComponentFile(
+        'bbb',
+        'b.dart',
+        r'''
+import 'package:components.aaa/a.dart';
+class B extends A {}
+''');
+    _writeUnlinkedBundle('components.aaa');
+    _writeUnlinkedBundle('components.bbb');
+    _setComponentFile('aaa', 'a.dart', 'class A2 {}');
+    // The 'aaa' unlinked bundle in inconsistent, so 'bbb' linking fails.
+    Source source = _resolveUri('package:components.bbb/b.dart');
+    CacheEntry entry = context.getCacheEntry(source);
+    expect(provider.compute(entry, LIBRARY_ELEMENT), isFalse);
+  }
+
+  test_failure_missingDirectDependency() {
+    _setComponentFile('aaa', 'a.dart', 'class A {}');
+    _setComponentFile(
+        'bbb',
+        'b.dart',
+        r'''
+import 'package:components.aaa/a.dart';
+class B extends A {}
+''');
+    _writeUnlinkedBundle('components.bbb');
+    // We cannot find 'aaa' bundle, so 'bbb' linking fails.
+    Source source = _resolveUri('package:components.bbb/b.dart');
+    CacheEntry entry = context.getCacheEntry(source);
+    expect(provider.compute(entry, LIBRARY_ELEMENT), isFalse);
+  }
+
+  test_success_withoutDependencies() {
+    _setComponentFile('aaa', 'a.dart', 'class A {}');
+    _writeUnlinkedBundle('components.aaa');
+    // Resynthesize 'aaa' library.
+    Source source = _resolveUri('package:components.aaa/a.dart');
+    LibraryElement library = _resynthesizeLibrary(source);
+    List<ClassElement> types = library.definingCompilationUnit.types;
+    expect(types, hasLength(1));
+    expect(types.single.name, 'A');
+  }
+
+  test_withDependency_import() {
+    _setComponentFile('aaa', 'a.dart', 'class A {}');
+    _setComponentFile(
+        'bbb',
+        'b.dart',
+        r'''
+import 'package:components.aaa/a.dart';
+class B extends A {}
+''');
+    _writeUnlinkedBundle('components.aaa');
+    _writeUnlinkedBundle('components.bbb');
+    // Prepare sources.
+    Source sourceA = _resolveUri('package:components.aaa/a.dart');
+    Source sourceB = _resolveUri('package:components.bbb/b.dart');
+    // Resynthesize 'bbb' library.
+    LibraryElement libraryB = _resynthesizeLibrary(sourceB);
+    List<ClassElement> types = libraryB.definingCompilationUnit.types;
+    expect(types, hasLength(1));
+    ClassElement typeB = types.single;
+    expect(typeB.name, 'B');
+    expect(typeB.supertype.name, 'A');
+    // The LibraryElement for 'aaa' is not created at all.
+    expect(context.getResult(sourceA, LIBRARY_ELEMENT), isNull);
+    // But we can resynthesize it, and it's the same as from 'bbb'.
+    expect(provider.compute(context.getCacheEntry(sourceA), LIBRARY_ELEMENT),
+        isTrue);
+    LibraryElement libraryA = context.getResult(sourceA, LIBRARY_ELEMENT);
+    expect(libraryA, isNotNull);
+    expect(typeB.supertype.element.library, same(libraryA));
+  }
+
+  LibraryElement _resynthesizeLibrary(Source source) {
+    CacheEntry entry = context.getCacheEntry(source);
+    expect(provider.compute(entry, LIBRARY_ELEMENT), isTrue);
+    return context.getResult(source, LIBRARY_ELEMENT);
+  }
+}
 
 @reflectiveTest
-class SummaryProviderTest extends AbstractContextTest {
+class SummaryProviderTest extends _BaseTest {
   SummaryProvider manager;
 
   @override
   void setUp() {
     super.setUp();
-    // Include a 'package' URI resolver.
-    sourceFactory = new SourceFactory(<UriResolver>[
-      sdkResolver,
-      resourceResolver,
-      new _TestPackageResolver(resourceProvider)
-    ], null, resourceProvider);
-    context.sourceFactory = sourceFactory;
-    // Create a new SummaryProvider instance.
-    manager = new SummaryProvider(resourceProvider, _getOutputPath, context);
+    _createManager();
   }
 
-  test_getPackageForUri() {
-    String pathA = '$SRC_ROOT/components/aaa/lib';
-    resourceProvider.newFile(
-        '$pathA/a1.dart',
+  test_getLinkedPackages_cached() {
+    _setComponentFile('aaa', 'a.dart', 'class A {}');
+    _setComponentFile(
+        'bbb',
+        'b.dart',
         r'''
-class A1 {}
+import 'package:components.aaa/a.dart';
+class B extends A {}
 ''');
-    resourceProvider.newFile(
-        '$pathA/a2.dart',
+    _writeUnlinkedBundle('components.aaa');
+    _writeUnlinkedBundle('components.bbb');
+    Source source = _resolveUri('package:components.bbb/b.dart');
+
+    // Session 1.
+    // Create linked bundles and store them in files.
+    {
+      List<Package> packages = manager.getLinkedPackages(source);
+      expect(packages, hasLength(2));
+    }
+
+    // Session 2.
+    // Recreate manager (with disabled linking) and ask again.
+    {
+      _createManager(allowLinking: false);
+      List<Package> packages = manager.getLinkedPackages(source);
+      expect(packages, hasLength(2));
+    }
+  }
+
+  test_getLinkedPackages_cached_declaredVariables_export() {
+    _testImpl_getLinkedPackages_cached_declaredVariables('export');
+  }
+
+  test_getLinkedPackages_cached_declaredVariables_import() {
+    _testImpl_getLinkedPackages_cached_declaredVariables('import');
+  }
+
+  test_getLinkedPackages_null_inconsistent_directDependency() {
+    _setComponentFile('aaa', 'a.dart', 'class A {}');
+    _setComponentFile(
+        'bbb',
+        'b.dart',
         r'''
-class A2 {}
+import 'package:components.aaa/a.dart';
+class B extends A {}
 ''');
     _writeUnlinkedBundle('components.aaa');
+    _writeUnlinkedBundle('components.bbb');
+    _setComponentFile('aaa', 'a.dart', 'class A2 {}');
+    // The 'aaa' unlinked bundle in inconsistent, so 'bbb' linking fails.
+    Source source = _resolveUri('package:components.bbb/b.dart');
+    List<Package> packages = manager.getLinkedPackages(source);
+    expect(packages, isNull);
+  }
+
+  test_getLinkedPackages_null_missingBundle() {
+    _setComponentFile('aaa', 'a.dart', 'class A {}');
+    // We don't write 'aaa', so we cannot get its package.
+    // Ask the package for the URI.
+    Source source = _resolveUri('package:components.aaa/a.dart');
+    List<Package> packages = manager.getLinkedPackages(source);
+    expect(packages, isNull);
+  }
+
+  test_getLinkedPackages_null_missingDirectDependency() {
+    _setComponentFile('aaa', 'a.dart', 'class A {}');
+    _setComponentFile(
+        'bbb',
+        'b.dart',
+        r'''
+import 'package:components.aaa/a.dart';
+class B extends A {}
+''');
+    _writeUnlinkedBundle('components.bbb');
+    // We cannot find 'aaa' bundle, so 'bbb' linking fails.
+    Source source = _resolveUri('package:components.bbb/b.dart');
+    List<Package> packages = manager.getLinkedPackages(source);
+    expect(packages, isNull);
+  }
+
+  test_getLinkedPackages_null_missingIndirectDependency() {
+    _setComponentFile('aaa', 'a.dart', 'class A {}');
+    _setComponentFile(
+        'bbb',
+        'b.dart',
+        r'''
+import 'package:components.aaa/a.dart';
+class B extends A {}
+''');
+    _setComponentFile(
+        'ccc',
+        'c.dart',
+        r'''
+import 'package:components.bbb/b.dart';
+class C extends B {}
+''');
+    _writeUnlinkedBundle('components.bbb');
+    _writeUnlinkedBundle('components.ccc');
+    // We cannot find 'aaa' bundle, so 'ccc' linking fails.
+    Source source = _resolveUri('package:components.ccc/c.dart');
+    List<Package> packages = manager.getLinkedPackages(source);
+    expect(packages, isNull);
+  }
+
+  test_getLinkedPackages_withDependency_export() {
+    _setComponentFile('aaa', 'a.dart', 'class A {}');
+    _setComponentFile(
+        'bbb',
+        'b.dart',
+        r'''
+export 'package:components.aaa/a.dart';
+''');
+    _writeUnlinkedBundle('components.aaa');
+    _writeUnlinkedBundle('components.bbb');
+    Source source = _resolveUri('package:components.bbb/b.dart');
+    List<Package> packages = manager.getLinkedPackages(source);
+    expect(packages, hasLength(2));
+  }
+
+  test_getLinkedPackages_withDependency_import() {
+    _setComponentFile('aaa', 'a.dart', 'class A {}');
+    _setComponentFile(
+        'bbb',
+        'b.dart',
+        r'''
+import 'package:components.aaa/a.dart';
+class B extends A {}
+''');
+    _writeUnlinkedBundle('components.aaa');
+    _writeUnlinkedBundle('components.bbb');
+    Source source = _resolveUri('package:components.bbb/b.dart');
+    List<Package> packages = manager.getLinkedPackages(source);
+    expect(packages, hasLength(2));
+  }
+
+  test_getLinkedPackages_withDependency_import_cycle() {
+    _setComponentFile(
+        'aaa',
+        'a.dart',
+        r'''
+import 'package:components.bbb/b.dart';
+class A {}
+class A2 extends B {}
+''');
+    _setComponentFile(
+        'bbb',
+        'b.dart',
+        r'''
+import 'package:components.aaa/a.dart';
+class B extends A {}
+class B2 extends A2 {}
+''');
+    _writeUnlinkedBundle('components.aaa');
+    _writeUnlinkedBundle('components.bbb');
+    Source source = _resolveUri('package:components.bbb/b.dart');
+    List<Package> packages = manager.getLinkedPackages(source);
+    expect(packages, hasLength(2));
+  }
+
+  test_getLinkedPackages_withDependency_import_indirect() {
+    _setComponentFile('aaa', 'a.dart', 'class A {}');
+    _setComponentFile(
+        'bbb',
+        'b.dart',
+        r'''
+import 'package:components.aaa/a.dart';
+class B extends A {}
+''');
+    _setComponentFile(
+        'ccc',
+        'c.dart',
+        r'''
+import 'package:components.bbb/b.dart';
+class C extends B {}
+''');
+    _writeUnlinkedBundle('components.aaa');
+    _writeUnlinkedBundle('components.bbb');
+    _writeUnlinkedBundle('components.ccc');
+    Source source = _resolveUri('package:components.ccc/c.dart');
+    List<Package> packages = manager.getLinkedPackages(source);
+    expect(packages, hasLength(3));
+  }
+
+  test_getLinkedPackages_withoutDependencies() {
+    _setComponentFile('aaa', 'a.dart', 'class A {}');
+    _writeUnlinkedBundle('components.aaa');
+    // Ask the package for the URI.
+    Source source = _resolveUri('package:components.aaa/a.dart');
+    List<Package> packages = manager.getLinkedPackages(source);
+    expect(packages, hasLength(1));
+  }
+
+  test_getUnlinkedForUri() {
+    _setComponentFile('aaa', 'a1.dart', 'class A1 {}');
+    _setComponentFile('aaa', 'a2.dart', 'class A2 {}');
+    _writeUnlinkedBundle('components.aaa');
     // Ask the package for the URI.
     Source source1 = _resolveUri('package:components.aaa/a1.dart');
     Source source2 = _resolveUri('package:components.aaa/a2.dart');
-    Package package = manager.getPackageForUri(source1.uri);
+    Package package = manager.getUnlinkedForUri(source1.uri);
     expect(package, isNotNull);
     // The same instance is returned to another URI in the same package.
-    expect(manager.getPackageForUri(source2.uri), same(package));
+    expect(manager.getUnlinkedForUri(source2.uri), same(package));
   }
 
-  test_getPackageForUri_inconsistent() {
-    String pathA = '$SRC_ROOT/components/aaa/lib';
-    File fileA1 = resourceProvider.newFile(
-        '$pathA/a1.dart',
-        r'''
-class A1 {}
-''');
-    resourceProvider.newFile(
-        '$pathA/a2.dart',
-        r'''
-class A2 {}
-''');
+  test_getUnlinkedForUri_inconsistent_fileContent() {
+    File file1 = _setComponentFile('aaa', 'a1.dart', 'class A1 {}');
+    _setComponentFile('aaa', 'a2.dart', 'class A2 {}');
     _writeUnlinkedBundle('components.aaa');
-    // Update one of the files file, so the bundle is not consistent.
-    fileA1.writeAsStringSync('// different');
+    // Update one of the files, so the bundle is not consistent.
+    file1.writeAsStringSync('\nclass A1 {}');
     Source source1 = _resolveUri('package:components.aaa/a1.dart');
     Source source2 = _resolveUri('package:components.aaa/a2.dart');
-    expect(manager.getPackageForUri(source1.uri), isNull);
-    expect(manager.getPackageForUri(source2.uri), isNull);
+    expect(manager.getUnlinkedForUri(source1.uri), isNull);
+    expect(manager.getUnlinkedForUri(source2.uri), isNull);
+  }
+
+  test_getUnlinkedForUri_inconsistent_majorVersion() {
+    _setComponentFile('aaa', 'a.dart', 'class A {}');
+    _writeUnlinkedBundle('components.aaa');
+    Source source = _resolveUri('package:components.aaa/a.dart');
+
+    // Create manager with a different major version.
+    // The unlinked bundle cannot be used.
+    _createManager(majorVersion: 12345);
+    Package package = manager.getUnlinkedForUri(source.uri);
+    expect(package, isNull);
+  }
+
+  void _createManager(
+      {bool allowLinking: true,
+      int majorVersion: PackageBundleAssembler.currentMajorVersion}) {
+    manager = new SummaryProvider(resourceProvider, '_.temp', _getOutputFolder,
+        resourceProvider.getFolder('/tmp/dart/bazel/linked'), context,
+        allowLinking: allowLinking, majorVersion: majorVersion);
+  }
+
+  void _testImpl_getLinkedPackages_cached_declaredVariables(
+      String importOrExport) {
+    _setComponentFile(
+        'aaa',
+        'user.dart',
+        '''
+    $importOrExport 'foo.dart'
+      if (dart.library.io) 'foo_io.dart'
+      if (dart.library.html) 'foo_html.dart';
+    ''');
+    _setComponentFile('aaa', 'foo.dart', 'class B {}');
+    _setComponentFile('aaa', 'foo_io.dart', 'class B {}');
+    _setComponentFile('aaa', 'foo_dart.dart', 'class B {}');
+    _writeUnlinkedBundle('components.aaa');
+    Source source = _resolveUri('package:components.aaa/user.dart');
+
+    void _assertDependencyInUser(PackageBundle bundle, String shortName) {
+      for (var i = 0; i < bundle.linkedLibraryUris.length; i++) {
+        if (bundle.linkedLibraryUris[i].endsWith('user.dart')) {
+          LinkedLibrary library = bundle.linkedLibraries[i];
+          expect(library.dependencies.map((d) => d.uri),
+              unorderedEquals(['', 'dart:core', shortName]));
+          return;
+        }
+      }
+      fail('Not found user.dart in $bundle');
+    }
+
+    // Session 1.
+    // Create linked bundles and store them in files.
+    {
+      List<Package> packages = manager.getLinkedPackages(source);
+      expect(packages, hasLength(1));
+      _assertDependencyInUser(packages.single.linked, 'foo.dart');
+    }
+
+    // Session 2.
+    // Recreate manager and don't allow it to perform new linking.
+    // Set a declared variable, which is not used in the package.
+    // We still can get the cached linked bundle.
+    {
+      context.declaredVariables.define('not.used.variable', 'baz');
+      _createManager(allowLinking: false);
+      List<Package> packages = manager.getLinkedPackages(source);
+      expect(packages, hasLength(1));
+      _assertDependencyInUser(packages.single.linked, 'foo.dart');
+    }
+
+    // Session 3.
+    // Recreate manager and don't allow it to perform new linking.
+    // Set the value of a referenced declared variable.
+    // So, we cannot use the previously cached linked bundle.
+    {
+      context.declaredVariables.define('dart.library.io', 'does-not-matter');
+      _createManager(allowLinking: false);
+      List<Package> packages = manager.getLinkedPackages(source);
+      expect(packages, isEmpty);
+    }
+
+    // Session 4.
+    // Enable new linking, and configure to use 'foo_html.dart'.
+    {
+      context.declaredVariables.define('dart.library.html', 'true');
+      _createManager(allowLinking: true);
+      List<Package> packages = manager.getLinkedPackages(source);
+      expect(packages, hasLength(1));
+      _assertDependencyInUser(packages.single.linked, 'foo_html.dart');
+    }
+  }
+}
+
+class _BaseTest extends AbstractContextTest {
+  String sourceRoot;
+  String outRoot;
+
+  @override
+  void setUp() {
+    super.setUp();
+    // Include a 'package' URI resolver.
+    sourceRoot = resourceProvider.convertPath('/company/src/user/project/root');
+    outRoot = resourceProvider.pathContext.join(sourceRoot, 'bazel-bin');
+    sourceFactory = new SourceFactory(<UriResolver>[
+      sdkResolver,
+      resourceResolver,
+      new _TestPackageResolver(resourceProvider, sourceRoot)
+    ], null, resourceProvider);
+    context.sourceFactory = sourceFactory;
+  }
+
+  Folder _getOutputFolder(Uri absoluteUri) {
+    var pathContext = resourceProvider.pathContext;
+    if (absoluteUri.scheme == 'package') {
+      List<String> segments = absoluteUri.pathSegments;
+      if (segments.isNotEmpty) {
+        String packageName = segments.first;
+        String path = pathContext.join(
+            outRoot, packageName.replaceAll('.', pathContext.separator));
+        return resourceProvider.getFolder(path);
+      }
+    }
+    return null;
   }
 
   Source _resolveUri(String uri) {
     return context.sourceFactory.resolveUri(null, uri);
   }
 
+  File _setComponentFile(String componentName, String fileName, String code) {
+    String path = resourceProvider.pathContext
+        .join(sourceRoot, 'components', componentName, 'lib', fileName);
+    return resourceProvider.newFile(path, code);
+  }
+
   void _writeUnlinkedBundle(String packageName) {
-    String packagePath = packageName.replaceAll('.', '/');
-    var unlinkedBundle = _computeUnlinkedBundle(
+    var pathContext = resourceProvider.pathContext;
+    String packagePath = packageName.replaceAll('.', pathContext.separator);
+    PackageBundleBuilder unlinkedBundle = _computeUnlinkedBundle(
         resourceProvider,
         packageName,
-        resourceProvider.getFolder(SRC_ROOT + '/' + packagePath + '/lib'),
+        resourceProvider
+            .getFolder(pathContext.join(sourceRoot, packagePath, 'lib')),
         true);
     String shortName = packageName.substring(packageName.lastIndexOf('.') + 1);
     resourceProvider.newFileWithBytes(
-        '$OUT_ROOT/$packagePath/$shortName.full.ds', unlinkedBundle.toBuffer());
+        pathContext.join(outRoot, packagePath, shortName) + '.full.ds',
+        unlinkedBundle.toBuffer());
   }
 
   static PackageBundleBuilder _computeUnlinkedBundle(ResourceProvider provider,
@@ -160,17 +559,6 @@
     return assembler.assemble();
   }
 
-  static String _getOutputPath(ResourceProvider provider, Uri uri) {
-    if (uri.scheme == 'package') {
-      List<String> segments = uri.pathSegments;
-      if (segments.isNotEmpty) {
-        String packageName = segments.first;
-        return OUT_ROOT + '/' + packageName.replaceAll('.', '/');
-      }
-    }
-    return null;
-  }
-
   /**
    * Parse the given [source] into AST.
    */
@@ -192,8 +580,9 @@
 
 class _TestPackageResolver implements UriResolver {
   final ResourceProvider resourceProvider;
+  final String sourceRoot;
 
-  _TestPackageResolver(this.resourceProvider);
+  _TestPackageResolver(this.resourceProvider, this.sourceRoot);
 
   @override
   Source resolveAbsolute(Uri uri, [Uri actualUri]) {
@@ -203,7 +592,7 @@
         pathos.Context pathContext = resourceProvider.pathContext;
         String packageName = segments.first;
         String folderPath = pathContext.join(
-            SRC_ROOT, packageName.replaceAll('.', pathContext.separator));
+            sourceRoot, packageName.replaceAll('.', pathContext.separator));
         String path = pathContext.join(
             folderPath, 'lib', pathContext.joinAll(segments.skip(1)));
         return resourceProvider.getFile(path).createSource(uri);
diff --git a/pkg/analyzer/test/src/summary/flat_buffers_test.dart b/pkg/analyzer/test/src/summary/flat_buffers_test.dart
index 112f2bb..2498fca 100644
--- a/pkg/analyzer/test/src/summary/flat_buffers_test.dart
+++ b/pkg/analyzer/test/src/summary/flat_buffers_test.dart
@@ -7,12 +7,13 @@
 import 'dart:typed_data';
 
 import 'package:analyzer/src/summary/flat_buffers.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 main() {
-  groupSep = ' | ';
-  defineReflectiveTests(BuilderTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(BuilderTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/src/summary/in_summary_source_test.dart b/pkg/analyzer/test/src/summary/in_summary_source_test.dart
index b48669d..473d7e2 100644
--- a/pkg/analyzer/test/src/summary/in_summary_source_test.dart
+++ b/pkg/analyzer/test/src/summary/in_summary_source_test.dart
@@ -9,34 +9,17 @@
 import 'package:analyzer/src/summary/format.dart';
 import 'package:analyzer/src/summary/idl.dart';
 import 'package:analyzer/src/summary/package_bundle_reader.dart';
-import 'package:path/path.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 main() {
-  groupSep = ' | ';
-  defineReflectiveTests(InSummarySourceTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(InSummarySourceTest);
+  });
 }
 
 @reflectiveTest
 class InSummarySourceTest extends ReflectiveTest {
-  test_fallbackPath() {
-    String fooFallbackPath = absolute('path', 'to', 'foo.dart');
-    var sourceFactory = new SourceFactory([
-      new InSummaryUriResolver(
-          PhysicalResourceProvider.INSTANCE,
-          new MockSummaryDataStore.fake({
-            'package:foo/foo.dart': 'foo.sum',
-          }, uriToFallbackModePath: {
-            'package:foo/foo.dart': fooFallbackPath
-          }))
-    ]);
-
-    InSummarySource source = sourceFactory.forUri('package:foo/foo.dart');
-    expect(source, isNotNull);
-    expect(source.fullName, fooFallbackPath);
-  }
-
   test_InSummarySource() {
     var sourceFactory = new SourceFactory([
       new InSummaryUriResolver(
@@ -69,14 +52,12 @@
 
   MockSummaryDataStore(this.linkedMap, this.unlinkedMap, this.uriToSummaryPath);
 
-  factory MockSummaryDataStore.fake(Map<String, String> uriToSummary,
-      {Map<String, String> uriToFallbackModePath: const {}}) {
+  factory MockSummaryDataStore.fake(Map<String, String> uriToSummary) {
     // Create fake unlinked map.
     // We don't populate the values as it is not needed for the test.
     var unlinkedMap = new Map<String, UnlinkedUnit>.fromIterable(
         uriToSummary.keys,
-        value: (uri) => new UnlinkedUnitBuilder(
-            fallbackModePath: uriToFallbackModePath[uri]));
+        value: (uri) => new UnlinkedUnitBuilder());
     return new MockSummaryDataStore(null, unlinkedMap, uriToSummary);
   }
 
diff --git a/pkg/analyzer/test/src/summary/linker_test.dart b/pkg/analyzer/test/src/summary/linker_test.dart
index b6fdf2c..cd70c5d 100644
--- a/pkg/analyzer/test/src/summary/linker_test.dart
+++ b/pkg/analyzer/test/src/summary/linker_test.dart
@@ -7,14 +7,15 @@
 import 'package:analyzer/src/summary/format.dart';
 import 'package:analyzer/src/summary/idl.dart';
 import 'package:analyzer/src/summary/link.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import 'summarize_ast_test.dart';
 
 main() {
-  groupSep = ' | ';
-  defineReflectiveTests(LinkerUnitTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(LinkerUnitTest);
+  });
 }
 
 @reflectiveTest
@@ -237,6 +238,33 @@
     expect(classC.unnamedConstructor.isCycleFree, false);
   }
 
+  void test_covariance() {
+    // Note: due to dartbug.com/27393, the keyword "checked" is identified by
+    // its presence in a library called "meta".  If that bug is fixed, this test
+    // may need to be changed.
+    createLinker('''
+library meta;
+const checked = null;
+class A<T> {
+  void f(@checked T t) {}
+}
+class B<T> extends A<T> {
+  void f(T t) {}
+}
+''');
+    testLibrary.libraryCycleForLink.ensureLinked();
+    ClassElementForLink classA = testLibrary.getContainedName('A');
+    MethodElementForLink methodAF = classA.getContainedName('f');
+    ParameterElementForLink parameterAFT = methodAF.parameters[0];
+    expect(parameterAFT.isCovariant, isTrue);
+    expect(parameterAFT.inheritsCovariant, isFalse);
+    ClassElementForLink classB = testLibrary.getContainedName('B');
+    MethodElementForLink methodBF = classB.getContainedName('f');
+    ParameterElementForLink parameterBFT = methodBF.parameters[0];
+    expect(parameterAFT.isCovariant, isTrue);
+    expect(parameterBFT.inheritsCovariant, isTrue);
+  }
+
   void test_createPackageBundle_withPackageUri() {
     PackageBundle bundle = createPackageBundle(
         '''
@@ -251,8 +279,9 @@
     UnlinkedExecutable cf = bundle.unlinkedUnits[0].classes[1].executables[0];
     UnlinkedParam cfi = cf.parameters[0];
     expect(cfi.inferredTypeSlot, isNot(0));
-    EntityRef typeRef =
-        bundle.linkedLibraries[0].units[0].types[cfi.inferredTypeSlot];
+    EntityRef typeRef = _lookupInferredType(
+        bundle.linkedLibraries[0].units[0], cfi.inferredTypeSlot);
+    expect(typeRef, isNotNull);
     expect(bundle.unlinkedUnits[0].references[typeRef.reference].name, 'int');
   }
 
@@ -322,6 +351,20 @@
         '(D) → E');
   }
 
+  void test_inferredType_instanceField_conditional_genericFunctions() {
+    createLinker('''
+class C {
+  final f = true ? <T>(T t) => 0 : <T>(T t) => 1;
+}
+''');
+    LibraryElementForLink library = linker.getLibrary(linkerInputs.testDartUri);
+    library.libraryCycleForLink.ensureLinked();
+    ClassElementForLink_Class cls = library.getContainedName('C');
+    expect(cls.fields, hasLength(1));
+    var field = cls.fields[0];
+    expect(field.type.toString(), '(<bottom>) → dynamic');
+  }
+
   void test_inferredType_instanceField_dynamic() {
     createLinker('''
 var x;
@@ -916,4 +959,16 @@
   VariableElementForLink _getVariable(ReferenceableElementForLink element) {
     return (element as PropertyAccessorElementForLink_Variable).variable;
   }
+
+  /**
+   * Finds the first inferred type stored in [unit] whose slot matches [slot].
+   */
+  EntityRef _lookupInferredType(LinkedUnit unit, int slot) {
+    for (EntityRef ref in unit.types) {
+      if (ref.slot == slot) {
+        return ref;
+      }
+    }
+    return null;
+  }
 }
diff --git a/pkg/analyzer/test/src/summary/name_filter_test.dart b/pkg/analyzer/test/src/summary/name_filter_test.dart
index ff2d294..ef66cc5 100644
--- a/pkg/analyzer/test/src/summary/name_filter_test.dart
+++ b/pkg/analyzer/test/src/summary/name_filter_test.dart
@@ -5,12 +5,13 @@
 import 'package:analyzer/src/dart/element/element.dart';
 import 'package:analyzer/src/summary/format.dart';
 import 'package:analyzer/src/summary/name_filter.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 main() {
-  groupSep = ' | ';
-  defineReflectiveTests(NameFilterTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(NameFilterTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/src/summary/package_bundle_reader_test.dart b/pkg/analyzer/test/src/summary/package_bundle_reader_test.dart
index 663147f..7b6fab2 100644
--- a/pkg/analyzer/test/src/summary/package_bundle_reader_test.dart
+++ b/pkg/analyzer/test/src/summary/package_bundle_reader_test.dart
@@ -11,14 +11,15 @@
 import 'package:analyzer/src/util/fast_uri.dart';
 import 'package:analyzer/task/dart.dart';
 import 'package:analyzer/task/general.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:typed_mock/typed_mock.dart';
-import 'package:unittest/unittest.dart';
 
 main() {
-  groupSep = ' | ';
-  defineReflectiveTests(ResynthesizerResultProviderTest);
-  defineReflectiveTests(SummaryDataStoreTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ResynthesizerResultProviderTest);
+    defineReflectiveTests(SummaryDataStoreTest);
+  });
 }
 
 UnlinkedPublicNamespace _namespaceWithParts(List<String> parts) {
diff --git a/pkg/analyzer/test/src/summary/prelinker_test.dart b/pkg/analyzer/test/src/summary/prelinker_test.dart
index 89e0059..1fcc9bc 100644
--- a/pkg/analyzer/test/src/summary/prelinker_test.dart
+++ b/pkg/analyzer/test/src/summary/prelinker_test.dart
@@ -8,14 +8,14 @@
 import 'package:analyzer/src/summary/idl.dart';
 import 'package:analyzer/src/summary/prelink.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import 'summarize_ast_test.dart';
 import 'summary_common.dart';
 
 main() {
-  groupSep = ' | ';
-  defineReflectiveTests(PrelinkerTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(PrelinkerTest);
+  });
 }
 
 /**
@@ -26,9 +26,6 @@
 @reflectiveTest
 class PrelinkerTest extends LinkedSummarizeAstTest {
   @override
-  bool get expectAbsoluteUrisInDependencies => false;
-
-  @override
   bool get skipFullyLinkedData => true;
 
   @override
diff --git a/pkg/analyzer/test/src/summary/pub_summary_test.dart b/pkg/analyzer/test/src/summary/pub_summary_test.dart
index 62804a3..0724cef 100644
--- a/pkg/analyzer/test/src/summary/pub_summary_test.dart
+++ b/pkg/analyzer/test/src/summary/pub_summary_test.dart
@@ -11,24 +11,41 @@
 import 'package:analyzer/src/summary/summarize_elements.dart';
 import 'package:analyzer/src/util/fast_uri.dart';
 import 'package:path/path.dart' as pathos;
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart' hide ERROR;
 
-import '../../utils.dart';
 import '../context/abstract_context.dart';
 import '../context/mock_sdk.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(PubSummaryManagerTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(PubSummaryManagerTest);
+  });
 }
 
 @reflectiveTest
 class PubSummaryManagerTest extends AbstractContextTest {
+  /**
+   * The path to the root of the pubcache directory used in these tests. The
+   * path has not been converted to the current platform, and is therefore only
+   * appropriate for composing paths that will later be converted.
+   */
   static const String CACHE = '/home/.pub-cache/hosted/pub.dartlang.org';
 
   PubSummaryManager manager;
 
+  Folder getFolder(String path) =>
+      resourceProvider.getFolder(resourceProvider.convertPath(path));
+
+  File newFile(String path, String content) {
+    //, [int stamp]) {
+    return resourceProvider.newFile(
+        resourceProvider.convertPath(path), content);
+  }
+
+  Folder newFolder(String path) =>
+      resourceProvider.newFolder(resourceProvider.convertPath(path));
+
   void setUp() {
     super.setUp();
     _createManager();
@@ -36,20 +53,20 @@
 
   test_computeUnlinkedForFolder() async {
     // Create package files.
-    resourceProvider.newFile(
+    newFile(
         '/flutter/aaa/lib/a.dart',
         '''
 class A {}
 ''');
-    resourceProvider.newFile(
+    newFile(
         '/flutter/bbb/lib/b.dart',
         '''
 class B {}
 ''');
 
     // Configure packages resolution.
-    Folder libFolderA = resourceProvider.newFolder('/flutter/aaa/lib');
-    Folder libFolderB = resourceProvider.newFolder('/flutter/bbb/lib');
+    Folder libFolderA = newFolder('/flutter/aaa/lib');
+    Folder libFolderB = newFolder('/flutter/bbb/lib');
     context.sourceFactory = new SourceFactory(<UriResolver>[
       sdkResolver,
       resourceResolver,
@@ -72,32 +89,32 @@
   test_getLinkedBundles_cached() async {
     String pathA1 = '$CACHE/aaa-1.0.0';
     String pathA2 = '$CACHE/aaa-2.0.0';
-    resourceProvider.newFile(
+    newFile(
         '$pathA1/lib/a.dart',
         '''
 class A {}
 int a;
 ''');
-    resourceProvider.newFile(
+    newFile(
         '$pathA2/lib/a.dart',
         '''
 class A2 {}
 int a;
 ''');
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/bbb/lib/b.dart',
         '''
 import 'package:aaa/a.dart';
 A b;
 ''');
-    Folder folderA1 = resourceProvider.getFolder(pathA1);
-    Folder folderA2 = resourceProvider.getFolder(pathA2);
-    Folder folderB = resourceProvider.getFolder('$CACHE/bbb');
+    Folder folderA1 = getFolder(pathA1);
+    Folder folderA2 = getFolder(pathA2);
+    Folder folderB = getFolder('$CACHE/bbb');
 
     // Configure packages resolution.
-    Folder libFolderA1 = resourceProvider.newFolder('$pathA1/lib');
-    Folder libFolderA2 = resourceProvider.newFolder('$pathA2/lib');
-    Folder libFolderB = resourceProvider.newFolder('$CACHE/bbb/lib');
+    Folder libFolderA1 = newFolder('$pathA1/lib');
+    Folder libFolderA2 = newFolder('$pathA2/lib');
+    Folder libFolderB = newFolder('$CACHE/bbb/lib');
     context.sourceFactory = new SourceFactory(<UriResolver>[
       sdkResolver,
       resourceResolver,
@@ -184,24 +201,24 @@
 
   test_getLinkedBundles_cached_differentSdk() async {
     String pathA = '$CACHE/aaa';
-    resourceProvider.newFile(
+    newFile(
         '$pathA/lib/a.dart',
         '''
 class A {}
 int a;
 ''');
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/bbb/lib/b.dart',
         '''
 import 'package:aaa/a.dart';
 A b;
 ''');
-    Folder folderA = resourceProvider.getFolder(pathA);
-    Folder folderB = resourceProvider.getFolder('$CACHE/bbb');
+    Folder folderA = getFolder(pathA);
+    Folder folderB = getFolder('$CACHE/bbb');
 
     // Configure packages resolution.
-    Folder libFolderA = resourceProvider.newFolder('$pathA/lib');
-    Folder libFolderB = resourceProvider.newFolder('$CACHE/bbb/lib');
+    Folder libFolderA = newFolder('$pathA/lib');
+    Folder libFolderB = newFolder('$CACHE/bbb/lib');
     context.sourceFactory = new SourceFactory(<UriResolver>[
       sdkResolver,
       resourceResolver,
@@ -237,7 +254,7 @@
     // Use DartSdk with a different API signature.
     // Different linked bundles should be created.
     {
-      MockSdk sdk = new MockSdk();
+      MockSdk sdk = new MockSdk(resourceProvider: resourceProvider);
       sdk.updateUriFile('dart:math', (String content) {
         return content + '  class NewMathClass {}';
       });
@@ -270,14 +287,14 @@
 
   test_getLinkedBundles_cached_inconsistent_majorVersion() async {
     String pathA = '$CACHE/aaa';
-    resourceProvider.newFile(
+    newFile(
         '$pathA/lib/a.dart',
         '''
 class A {}
 int a;
 ''');
     // Configure packages resolution.
-    Folder libFolderA = resourceProvider.newFolder('$pathA/lib');
+    Folder libFolderA = newFolder('$pathA/lib');
     context.sourceFactory = new SourceFactory(<UriResolver>[
       sdkResolver,
       resourceResolver,
@@ -310,7 +327,7 @@
   }
 
   test_getLinkedBundles_hasCycle() async {
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/aaa/lib/a.dart',
         '''
 import 'package:bbb/b.dart';
@@ -318,14 +335,14 @@
 int a1;
 B a2;
 ''');
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/bbb/lib/b.dart',
         '''
 import 'package:ccc/c.dart';
 class B {}
 C b;
 ''');
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/ccc/lib/c.dart',
         '''
 import 'package:aaa/a.dart';
@@ -334,7 +351,7 @@
 A c1;
 D c2;
 ''');
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/ddd/lib/d.dart',
         '''
 class D {}
@@ -342,10 +359,10 @@
 ''');
 
     // Configure packages resolution.
-    Folder libFolderA = resourceProvider.newFolder('$CACHE/aaa/lib');
-    Folder libFolderB = resourceProvider.newFolder('$CACHE/bbb/lib');
-    Folder libFolderC = resourceProvider.newFolder('$CACHE/ccc/lib');
-    Folder libFolderD = resourceProvider.newFolder('$CACHE/ddd/lib');
+    Folder libFolderA = newFolder('$CACHE/aaa/lib');
+    Folder libFolderB = newFolder('$CACHE/bbb/lib');
+    Folder libFolderC = newFolder('$CACHE/ccc/lib');
+    Folder libFolderD = newFolder('$CACHE/ddd/lib');
     context.sourceFactory = new SourceFactory(<UriResolver>[
       sdkResolver,
       resourceResolver,
@@ -407,21 +424,21 @@
   }
 
   test_getLinkedBundles_missingBundle_listed() async {
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/aaa/lib/a.dart',
         '''
 import 'package:bbb/b.dart';
 B a;
 ''');
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/bbb/lib/b.dart',
         '''
 class B {}
 ''');
 
     // Configure packages resolution.
-    Folder libFolderA = resourceProvider.newFolder('$CACHE/aaa/lib');
-    Folder libFolderB = resourceProvider.newFolder('$CACHE/bbb/lib');
+    Folder libFolderA = newFolder('$CACHE/aaa/lib');
+    Folder libFolderB = newFolder('$CACHE/bbb/lib');
     context.sourceFactory = new SourceFactory(<UriResolver>[
       sdkResolver,
       resourceResolver,
@@ -443,26 +460,26 @@
   }
 
   test_getLinkedBundles_missingBundle_listed_chained() async {
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/aaa/lib/a.dart',
         '''
 import 'package:bbb/b.dart';
 ''');
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/bbb/lib/b.dart',
         '''
 import 'package:ccc/c.dart';
 ''');
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/ccc/lib/c.dart',
         '''
 class C {}
 ''');
 
     // Configure packages resolution.
-    Folder libFolderA = resourceProvider.newFolder('$CACHE/aaa/lib');
-    Folder libFolderB = resourceProvider.newFolder('$CACHE/bbb/lib');
-    Folder libFolderC = resourceProvider.newFolder('$CACHE/ccc/lib');
+    Folder libFolderA = newFolder('$CACHE/aaa/lib');
+    Folder libFolderB = newFolder('$CACHE/bbb/lib');
+    Folder libFolderC = newFolder('$CACHE/ccc/lib');
     context.sourceFactory = new SourceFactory(<UriResolver>[
       sdkResolver,
       resourceResolver,
@@ -485,27 +502,27 @@
   }
 
   test_getLinkedBundles_missingBundle_listed_partial() async {
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/aaa/lib/a.dart',
         '''
 int a;
 ''');
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/bbb/lib/b.dart',
         '''
 import 'package:ccc/c.dart';
 C b;
 ''');
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/ccc/lib/c.dart',
         '''
 class C {}
 ''');
 
     // Configure packages resolution.
-    Folder libFolderA = resourceProvider.newFolder('$CACHE/aaa/lib');
-    Folder libFolderB = resourceProvider.newFolder('$CACHE/bbb/lib');
-    Folder libFolderC = resourceProvider.newFolder('$CACHE/ccc/lib');
+    Folder libFolderA = newFolder('$CACHE/aaa/lib');
+    Folder libFolderB = newFolder('$CACHE/bbb/lib');
+    Folder libFolderC = newFolder('$CACHE/ccc/lib');
     context.sourceFactory = new SourceFactory(<UriResolver>[
       sdkResolver,
       resourceResolver,
@@ -536,12 +553,12 @@
   }
 
   test_getLinkedBundles_missingBundle_notListed() async {
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/aaa/lib/a.dart',
         '''
 int a;
 ''');
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/bbb/lib/b.dart',
         '''
 import 'package:ccc/c.dart';
@@ -550,8 +567,8 @@
 ''');
 
     // Configure packages resolution.
-    Folder libFolderA = resourceProvider.newFolder('$CACHE/aaa/lib');
-    Folder libFolderB = resourceProvider.newFolder('$CACHE/bbb/lib');
+    Folder libFolderA = newFolder('$CACHE/aaa/lib');
+    Folder libFolderB = newFolder('$CACHE/bbb/lib');
     context.sourceFactory = new SourceFactory(<UriResolver>[
       sdkResolver,
       resourceResolver,
@@ -592,14 +609,14 @@
   }
 
   test_getLinkedBundles_missingLibrary() async {
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/aaa/lib/a.dart',
         '''
 import 'package:bbb/b2.dart';
 int a1;
 B2 a2;
 ''');
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/bbb/lib/b.dart',
         '''
 class B {}
@@ -607,8 +624,8 @@
 ''');
 
     // Configure packages resolution.
-    Folder libFolderA = resourceProvider.newFolder('$CACHE/aaa/lib');
-    Folder libFolderB = resourceProvider.newFolder('$CACHE/bbb/lib');
+    Folder libFolderA = newFolder('$CACHE/aaa/lib');
+    Folder libFolderB = newFolder('$CACHE/bbb/lib');
     context.sourceFactory = new SourceFactory(<UriResolver>[
       sdkResolver,
       resourceResolver,
@@ -648,13 +665,13 @@
   }
 
   test_getLinkedBundles_missingLibrary_hasCycle() async {
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/aaa/lib/a.dart',
         '''
 import 'package:bbb/b.dart';
 B a;
 ''');
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/bbb/lib/b.dart',
         '''
 import 'package:aaa/a.dart';
@@ -663,7 +680,7 @@
 int b1;
 C2 b2;
 ''');
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/ccc/lib/c.dart',
         '''
 class C {}
@@ -671,9 +688,9 @@
 ''');
 
     // Configure packages resolution.
-    Folder libFolderA = resourceProvider.newFolder('$CACHE/aaa/lib');
-    Folder libFolderB = resourceProvider.newFolder('$CACHE/bbb/lib');
-    Folder libFolderC = resourceProvider.newFolder('$CACHE/ccc/lib');
+    Folder libFolderA = newFolder('$CACHE/aaa/lib');
+    Folder libFolderB = newFolder('$CACHE/bbb/lib');
+    Folder libFolderC = newFolder('$CACHE/ccc/lib');
     context.sourceFactory = new SourceFactory(<UriResolver>[
       sdkResolver,
       resourceResolver,
@@ -725,13 +742,13 @@
   }
 
   test_getLinkedBundles_noCycle() async {
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/aaa/lib/a.dart',
         '''
 class A {}
 int a;
 ''');
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/bbb/lib/b.dart',
         '''
 import 'package:aaa/a.dart';
@@ -739,8 +756,8 @@
 ''');
 
     // Configure packages resolution.
-    Folder libFolderA = resourceProvider.newFolder('$CACHE/aaa/lib');
-    Folder libFolderB = resourceProvider.newFolder('$CACHE/bbb/lib');
+    Folder libFolderA = newFolder('$CACHE/aaa/lib');
+    Folder libFolderB = newFolder('$CACHE/bbb/lib');
     context.sourceFactory = new SourceFactory(<UriResolver>[
       sdkResolver,
       resourceResolver,
@@ -776,20 +793,20 @@
   }
 
   test_getLinkedBundles_noCycle_relativeUri() async {
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/aaa/lib/a.dart',
         '''
 import 'src/a2.dart';
 A a;
 ''');
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/aaa/lib/src/a2.dart',
         '''
 class A {}
 ''');
 
     // Configure packages resolution.
-    Folder libFolderA = resourceProvider.newFolder('$CACHE/aaa/lib');
+    Folder libFolderA = newFolder('$CACHE/aaa/lib');
     context.sourceFactory = new SourceFactory(<UriResolver>[
       sdkResolver,
       resourceResolver,
@@ -816,27 +833,27 @@
   }
 
   test_getLinkedBundles_noCycle_withExport() async {
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/aaa/lib/a.dart',
         '''
 import 'package:bbb/b.dart';
 C a;
 ''');
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/bbb/lib/b.dart',
         '''
 export 'package:ccc/c.dart';
 ''');
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/ccc/lib/c.dart',
         '''
 class C {}
 ''');
 
     // Configure packages resolution.
-    Folder libFolderA = resourceProvider.newFolder('$CACHE/aaa/lib');
-    Folder libFolderB = resourceProvider.newFolder('$CACHE/bbb/lib');
-    Folder libFolderC = resourceProvider.newFolder('$CACHE/ccc/lib');
+    Folder libFolderA = newFolder('$CACHE/aaa/lib');
+    Folder libFolderB = newFolder('$CACHE/bbb/lib');
+    Folder libFolderC = newFolder('$CACHE/ccc/lib');
     context.sourceFactory = new SourceFactory(<UriResolver>[
       sdkResolver,
       resourceResolver,
@@ -865,7 +882,7 @@
   }
 
   test_getLinkedBundles_wrongScheme() async {
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/aaa/lib/a.dart',
         '''
 import 'xxx:yyy/zzz.dart';
@@ -874,7 +891,7 @@
 ''');
 
     // Configure packages resolution.
-    Folder libFolderA = resourceProvider.newFolder('$CACHE/aaa/lib');
+    Folder libFolderA = newFolder('$CACHE/aaa/lib');
     context.sourceFactory = new SourceFactory(<UriResolver>[
       sdkResolver,
       resourceResolver,
@@ -907,25 +924,25 @@
 
   test_getUnlinkedBundles() async {
     // Create package files.
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/aaa/lib/a.dart',
         '''
 class A {}
 ''');
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/aaa/lib/src/a2.dart',
         '''
 class A2 {}
 ''');
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/bbb/lib/b.dart',
         '''
 class B {}
 ''');
 
     // Configure packages resolution.
-    Folder libFolderA = resourceProvider.newFolder('$CACHE/aaa/lib');
-    Folder libFolderB = resourceProvider.newFolder('$CACHE/bbb/lib');
+    Folder libFolderA = newFolder('$CACHE/aaa/lib');
+    Folder libFolderB = newFolder('$CACHE/bbb/lib');
     context.sourceFactory = new SourceFactory(<UriResolver>[
       sdkResolver,
       resourceResolver,
@@ -975,14 +992,14 @@
 
   test_getUnlinkedBundles_inconsistent_majorVersion() async {
     // Create package files.
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/aaa/lib/a.dart',
         '''
 class A {}
 ''');
 
     // Configure packages resolution.
-    Folder libFolder = resourceProvider.newFolder('$CACHE/aaa/lib');
+    Folder libFolder = newFolder('$CACHE/aaa/lib');
     context.sourceFactory = new SourceFactory(<UriResolver>[
       sdkResolver,
       resourceResolver,
@@ -1026,20 +1043,20 @@
   test_getUnlinkedBundles_notPubCache_dontCreate() async {
     String aaaPath = '/Users/user/projects/aaa';
     // Create package files.
-    resourceProvider.newFile(
+    newFile(
         '$aaaPath/lib/a.dart',
         '''
 class A {}
 ''');
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/bbb/lib/b.dart',
         '''
 class B {}
 ''');
 
     // Configure packages resolution.
-    Folder libFolderA = resourceProvider.getFolder('$aaaPath/lib');
-    Folder libFolderB = resourceProvider.newFolder('$CACHE/bbb/lib');
+    Folder libFolderA = getFolder('$aaaPath/lib');
+    Folder libFolderB = newFolder('$CACHE/bbb/lib');
     context.sourceFactory = new SourceFactory(<UriResolver>[
       sdkResolver,
       resourceResolver,
@@ -1080,7 +1097,7 @@
     String aaaPath = '/Users/user/projects/aaa';
     // Create package files.
     {
-      File file = resourceProvider.newFile(
+      File file = newFile(
           '$aaaPath/lib/a.dart',
           '''
 class A {}
@@ -1090,18 +1107,19 @@
             file.createSource(FastUri.parse('package:aaa/a.dart')),
             new UnlinkedUnitBuilder());
       resourceProvider.newFileWithBytes(
-          '$aaaPath/${PubSummaryManager.UNLINKED_SPEC_NAME}',
+          resourceProvider
+              .convertPath('$aaaPath/${PubSummaryManager.UNLINKED_SPEC_NAME}'),
           assembler.assemble().toBuffer());
     }
-    resourceProvider.newFile(
+    newFile(
         '$CACHE/bbb/lib/b.dart',
         '''
 class B {}
 ''');
 
     // Configure packages resolution.
-    Folder libFolderA = resourceProvider.getFolder('$aaaPath/lib');
-    Folder libFolderB = resourceProvider.newFolder('$CACHE/bbb/lib');
+    Folder libFolderA = getFolder('$aaaPath/lib');
+    Folder libFolderB = newFolder('$CACHE/bbb/lib');
     context.sourceFactory = new SourceFactory(<UriResolver>[
       sdkResolver,
       resourceResolver,
@@ -1150,14 +1168,14 @@
   test_getUnlinkedBundles_notPubCache_useExisting_inconsistent() async {
     String aaaPath = '/Users/user/projects/aaa';
     // Create package files.
-    resourceProvider.newFile(
+    newFile(
         '$aaaPath/lib/a.dart',
         '''
 class A {}
 ''');
 
     // Compute the bundles.
-    Folder libFolderA = resourceProvider.getFolder('$aaaPath/lib');
+    Folder libFolderA = getFolder('$aaaPath/lib');
     await new PubSummaryManager(resourceProvider, '_.temp')
         .computeUnlinkedForFolder('aaa', libFolderA);
 
@@ -1176,7 +1194,7 @@
     // Update a Dart file.
     // So, the cached bundle cannot be reused.
     resourceProvider.updateFile(
-        '$aaaPath/lib/a.dart',
+        resourceProvider.convertPath('$aaaPath/lib/a.dart'),
         '''
 class A2 {}
 ''');
@@ -1281,10 +1299,10 @@
   _testImpl_getLinkedBundles_cached_declaredVariables(
       String importOrExport) async {
     String pathA = '$CACHE/aaa/lib';
-    resourceProvider.newFile('$pathA/foo.dart', 'class A {}');
-    resourceProvider.newFile('$pathA/foo_io.dart', 'class A {}');
-    resourceProvider.newFile('$pathA/foo_html.dart', 'class A {}');
-    resourceProvider.newFile(
+    newFile('$pathA/foo.dart', 'class A {}');
+    newFile('$pathA/foo_io.dart', 'class A {}');
+    newFile('$pathA/foo_html.dart', 'class A {}');
+    newFile(
         '$pathA/user.dart',
         '''
 $importOrExport 'foo.dart'
@@ -1292,7 +1310,7 @@
   if (dart.library.html) 'foo_html.dart';
 ''');
     // Configure packages resolution.
-    Folder libFolderA = resourceProvider.newFolder(pathA);
+    Folder libFolderA = newFolder(pathA);
     context.sourceFactory = new SourceFactory(<UriResolver>[
       sdkResolver,
       resourceResolver,
diff --git a/pkg/analyzer/test/src/summary/resynthesize_ast_test.dart b/pkg/analyzer/test/src/summary/resynthesize_ast_test.dart
index d547b6b..29e30d3 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_ast_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_ast_test.dart
@@ -6,6 +6,7 @@
 
 import 'package:analyzer/dart/ast/ast.dart';
 import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer/error/error.dart';
 import 'package:analyzer/src/dart/element/element.dart';
 import 'package:analyzer/src/generated/engine.dart'
     show AnalysisContext, AnalysisOptionsImpl;
@@ -21,8 +22,8 @@
     show PackageBundleAssembler;
 import 'package:analyzer/task/dart.dart' show PARSED_UNIT;
 import 'package:analyzer/task/general.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../context/abstract_context.dart';
 import '../task/strong/inferred_type_test.dart';
@@ -30,10 +31,11 @@
 import 'summary_common.dart';
 
 main() {
-  groupSep = ' | ';
-  defineReflectiveTests(ResynthesizeAstSpecTest);
-  defineReflectiveTests(ResynthesizeAstStrongTest);
-  defineReflectiveTests(AstInferredTypeTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ResynthesizeAstSpecTest);
+    defineReflectiveTests(ResynthesizeAstStrongTest);
+    defineReflectiveTests(AstInferredTypeTest);
+  });
 }
 
 @reflectiveTest
@@ -70,9 +72,8 @@
   DartSdk createDartSdk() => AbstractContextTest.SHARED_STRONG_MOCK_SDK;
 
   @override
-  AnalysisOptionsImpl createOptions() => new AnalysisOptionsImpl()
-    ..enableGenericMethods = true
-    ..strongMode = true;
+  AnalysisOptionsImpl createOptions() =>
+      new AnalysisOptionsImpl()..strongMode = true;
 
   @override
   @failingTest
@@ -618,6 +619,14 @@
   @override
   @failingTest
   void
+      test_unsafeBlockClosureInference_functionCall_explicitDynamicParam_viaExpr2_comment() {
+    super
+        .test_unsafeBlockClosureInference_functionCall_explicitDynamicParam_viaExpr2_comment();
+  }
+
+  @override
+  @failingTest
+  void
       test_unsafeBlockClosureInference_functionCall_explicitTypeParam_viaExpr2() {
     super
         .test_unsafeBlockClosureInference_functionCall_explicitTypeParam_viaExpr2();
@@ -625,6 +634,14 @@
 
   @override
   @failingTest
+  void
+      test_unsafeBlockClosureInference_functionCall_explicitTypeParam_viaExpr2_comment() {
+    super
+        .test_unsafeBlockClosureInference_functionCall_explicitTypeParam_viaExpr2_comment();
+  }
+
+  @override
+  @failingTest
   void test_unsafeBlockClosureInference_functionCall_implicitTypeParam() {
     super.test_unsafeBlockClosureInference_functionCall_implicitTypeParam();
   }
@@ -632,6 +649,14 @@
   @override
   @failingTest
   void
+      test_unsafeBlockClosureInference_functionCall_implicitTypeParam_comment() {
+    super
+        .test_unsafeBlockClosureInference_functionCall_implicitTypeParam_comment();
+  }
+
+  @override
+  @failingTest
+  void
       test_unsafeBlockClosureInference_functionCall_implicitTypeParam_viaExpr() {
     super
         .test_unsafeBlockClosureInference_functionCall_implicitTypeParam_viaExpr();
@@ -639,6 +664,14 @@
 
   @override
   @failingTest
+  void
+      test_unsafeBlockClosureInference_functionCall_implicitTypeParam_viaExpr_comment() {
+    super
+        .test_unsafeBlockClosureInference_functionCall_implicitTypeParam_viaExpr_comment();
+  }
+
+  @override
+  @failingTest
   void test_unsafeBlockClosureInference_functionCall_noTypeParam_viaExpr() {
     super.test_unsafeBlockClosureInference_functionCall_noTypeParam_viaExpr();
   }
@@ -661,6 +694,13 @@
     super.test_unsafeBlockClosureInference_methodCall_implicitTypeParam();
   }
 
+  @override
+  @failingTest
+  void test_unsafeBlockClosureInference_methodCall_implicitTypeParam_comment() {
+    super
+        .test_unsafeBlockClosureInference_methodCall_implicitTypeParam_comment();
+  }
+
   LibraryElementImpl _checkSource(
       SummaryResynthesizer resynthesizer, Source source) {
     LibraryElementImpl resynthesized =
@@ -881,6 +921,12 @@
     Source source = addTestSource(text);
     LibraryElementImpl resynthesized = _encodeDecodeLibraryElement(source);
     LibraryElementImpl original = context.computeLibraryElement(source);
+    if (!allowErrors) {
+      List<AnalysisError> errors = context.computeErrors(source);
+      if (errors.where((e) => e.message.startsWith('unused')).isNotEmpty) {
+        fail('Analysis errors: $errors');
+      }
+    }
     checkLibraryElements(original, resynthesized);
     return resynthesized;
   }
diff --git a/pkg/analyzer/test/src/summary/resynthesize_common.dart b/pkg/analyzer/test/src/summary/resynthesize_common.dart
index 88b8985..ddff695 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_common.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_common.dart
@@ -19,11 +19,11 @@
 import 'package:analyzer/src/generated/resolver.dart' show Namespace;
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/source.dart';
-import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
 import 'package:analyzer/src/summary/idl.dart';
 import 'package:analyzer/src/summary/resynthesize.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../generated/test_support.dart';
 import '../abstract_single_unit.dart';
@@ -410,7 +410,9 @@
         PrefixedIdentifier oTarget = o.target;
         checkElidablePrefix(oTarget.prefix);
         compareConstAsts(
-            r, AstFactory.identifier(oTarget.identifier, o.propertyName), desc);
+            r,
+            AstTestFactory.identifier(oTarget.identifier, o.propertyName),
+            desc);
       } else if (o is PrefixedIdentifier && r is PrefixedIdentifier) {
         compareConstAsts(r.prefix, o.prefix, desc);
         compareConstAsts(r.identifier, o.identifier, desc);
@@ -542,18 +544,7 @@
         }
         compareConstAstLists(
             r.arguments?.arguments, o.arguments?.arguments, desc);
-        Element expectedElement = o.element;
-        if (oName is PrefixedIdentifier &&
-            o.constructorName != null &&
-            o.element != null) {
-          // Due to dartbug.com/25706, [o.element] incorrectly points to the
-          // class rather than the named constructor.  Hack around this.
-          // TODO(paulberry): when dartbug.com/25706 is fixed, remove this.
-          expectedElement = (expectedElement as ClassElement)
-              .getNamedConstructor(o.constructorName.name);
-          expect(expectedElement, isNotNull, reason: desc);
-        }
-        compareElements(r.element, expectedElement, desc);
+        compareElements(r.element, o.element, desc);
         // elementAnnotation should be null; it is only used in the full AST.
         expect(o.elementAnnotation, isNull);
         expect(r.elementAnnotation, isNull);
@@ -928,6 +919,7 @@
     }
     expect(resynthesized.defaultValueCode, original.defaultValueCode,
         reason: desc);
+    expect(resynthesized.isCovariant, original.isCovariant, reason: desc);
     ParameterElementImpl resynthesizedActual =
         getActualElement(resynthesized, desc);
     ParameterElementImpl originalActual = getActualElement(original, desc);
@@ -1126,8 +1118,7 @@
   /**
    * Determine the analysis options that should be used for this test.
    */
-  AnalysisOptionsImpl createOptions() =>
-      new AnalysisOptionsImpl()..enableGenericMethods = true;
+  AnalysisOptionsImpl createOptions() => new AnalysisOptionsImpl();
 
   ElementImpl getActualElement(Element element, String desc) {
     if (element == null) {
@@ -1269,6 +1260,8 @@
     } else if (modifier == Modifier.STATIC) {
       if (element is ExecutableElement) {
         return element.isStatic;
+      } else if (element is FieldElement) {
+        return element.isStatic;
       }
       return false;
     } else if (modifier == Modifier.SYNTHETIC) {
@@ -1645,6 +1638,14 @@
 ''');
   }
 
+  test_closure_in_variable_declaration_in_part() {
+    addSource('/a.dart', 'part of lib; final f = (int i) => i.toDouble();');
+    checkLibrary('''
+library lib;
+part "a.dart";
+''');
+  }
+
   test_const_invalid_field_const() {
     variablesWithNotConstInitializers.add('f');
     checkLibrary(
@@ -2303,6 +2304,12 @@
 ''');
   }
 
+  test_const_topLevel_ifNull() {
+    checkLibrary(r'''
+const vIfNull = 1 ?? 2.0;
+''');
+  }
+
   test_const_topLevel_literal() {
     checkLibrary(r'''
 const vNull = null;
@@ -2590,6 +2597,27 @@
 ''');
   }
 
+  test_constructor_redirected_factory_named_unresolved_class() {
+    checkLibrary(
+        '''
+class C<E> {
+  factory C() = D.named<E>;
+}
+''',
+        allowErrors: true);
+  }
+
+  test_constructor_redirected_factory_named_unresolved_constructor() {
+    checkLibrary(
+        '''
+class D {}
+class C<E> {
+  factory C() = D.named<E>;
+}
+''',
+        allowErrors: true);
+  }
+
   test_constructor_redirected_factory_unnamed() {
     checkLibrary('''
 class C {
@@ -2686,6 +2714,16 @@
 ''');
   }
 
+  test_constructor_redirected_factory_unnamed_unresolved() {
+    checkLibrary(
+        '''
+class C<E> {
+  factory C() = D<E>;
+}
+''',
+        allowErrors: true);
+  }
+
   test_constructor_redirected_thisInvocation_named() {
     checkLibrary('''
 class C {
@@ -2748,6 +2786,35 @@
 ''');
   }
 
+  void test_covariant_parameter() {
+    // Note: due to dartbug.com/27393, the keyword "checked" is identified by
+    // its presence in a library called "meta".  If that bug is fixed, this test
+    // my need to be changed.
+    checkLibrary(r'''
+library meta;
+const checked = null;
+class A<T> {
+  void f(@checked T t) {}
+}
+''');
+  }
+
+  void test_covariant_parameter_inherited() {
+    // Note: due to dartbug.com/27393, the keyword "checked" is identified by
+    // its presence in a library called "meta".  If that bug is fixed, this test
+    // my need to be changed.
+    checkLibrary(r'''
+library meta;
+const checked = null;
+class A<T> {
+  void f(@checked T t) {}
+}
+class B<T> extends A<T> {
+  void f(T t) {}
+}
+''');
+  }
+
   test_defaultValue_refersToGenericClass_constructor() {
     checkLibrary('''
 class B<T> {
@@ -3171,12 +3238,12 @@
   }
 
   test_function_type_parameter() {
-    prepareAnalysisContext(createOptions()..enableGenericMethods = true);
+    prepareAnalysisContext(createOptions());
     checkLibrary('T f<T, U>(U u) => null;');
   }
 
   test_function_type_parameter_with_function_typed_parameter() {
-    prepareAnalysisContext(createOptions()..enableGenericMethods = true);
+    prepareAnalysisContext(createOptions());
     checkLibrary('void f<T, U>(T x(U u)) {}');
   }
 
@@ -3185,7 +3252,7 @@
   }
 
   test_generic_gClass_gMethodStatic() {
-    prepareAnalysisContext(createOptions()..enableGenericMethods = true);
+    prepareAnalysisContext(createOptions());
     checkLibrary('''
 class C<T, U> {
   static void m<V, W>(V v, W w) {
@@ -3373,6 +3440,18 @@
     expect(resynthesized.imports[1].importedLibrary.isDartCore, true);
   }
 
+  test_import_short_absolute() {
+    if (resourceProvider.pathContext.separator == '\\') {
+      // This test fails on Windows due to
+      // https://github.com/dart-lang/path/issues/18
+      // TODO(paulberry): reenable once that bug is addressed.
+      return;
+    }
+    testFile = '/my/project/bin/test.dart';
+    addLibrarySource('/a.dart', 'class C {}');
+    checkLibrary('import "/a.dart"; C c;');
+  }
+
   test_import_show() {
     addLibrary('dart:async');
     checkLibrary('''
@@ -3538,6 +3617,32 @@
         ' abstract class D { void set f(int g(String s)); }');
   }
 
+  void test_inferredType_definedInSdkLibraryPart() {
+    addSource(
+        '/a.dart',
+        r'''
+import 'dart:async';
+class A {
+  m(Stream p) {}
+}
+''');
+    LibraryElement library = checkLibrary(r'''
+import 'a.dart';
+class B extends A {
+  m(p) {}
+}
+  ''');
+    ClassElement b = library.definingCompilationUnit.types[0];
+    ParameterElement p = b.methods[0].parameters[0];
+    // This test should verify that we correctly record inferred types,
+    // when the type is defined in a part of an SDK library. So, test that
+    // the type is actually in a part.
+    Element streamElement = p.type.element;
+    if (streamElement is ClassElement) {
+      expect(streamElement.source, isNot(streamElement.library.source));
+    }
+  }
+
   void test_inferredType_usesSyntheticFunctionType_functionTypedParam() {
     checkLibrary('''
 int f(int x(String y)) => null;
@@ -3546,10 +3651,53 @@
 ''');
   }
 
+  test_inheritance_errors() {
+    checkLibrary('''
+abstract class A {
+  int m();
+}
+
+abstract class B {
+  String m();
+}
+
+abstract class C implements A, B {}
+
+abstract class D extends C {
+  var f;
+}
+''');
+  }
+
   test_initializer_executable_with_return_type_from_closure() {
     checkLibrary('var v = () => 0;');
   }
 
+  test_initializer_executable_with_return_type_from_closure_await_dynamic() {
+    checkLibrary('var v = (f) async => await f;');
+  }
+
+  test_initializer_executable_with_return_type_from_closure_await_future3_int() {
+    checkLibrary(r'''
+import 'dart:async';
+var v = (Future<Future<Future<int>>> f) async => await f;
+''');
+  }
+
+  test_initializer_executable_with_return_type_from_closure_await_future_int() {
+    checkLibrary(r'''
+import 'dart:async';
+var v = (Future<int> f) async => await f;
+''');
+  }
+
+  test_initializer_executable_with_return_type_from_closure_await_future_noArg() {
+    checkLibrary(r'''
+import 'dart:async';
+var v = (Future f) async => await f;
+''');
+  }
+
   test_initializer_executable_with_return_type_from_closure_field() {
     checkLibrary('''
 class C {
@@ -4006,17 +4154,17 @@
   }
 
   test_method_type_parameter() {
-    prepareAnalysisContext(createOptions()..enableGenericMethods = true);
+    prepareAnalysisContext(createOptions());
     checkLibrary('class C { T f<T, U>(U u) => null; }');
   }
 
   test_method_type_parameter_in_generic_class() {
-    prepareAnalysisContext(createOptions()..enableGenericMethods = true);
+    prepareAnalysisContext(createOptions());
     checkLibrary('class C<T, U> { V f<V, W>(T t, U u, W w) => null; }');
   }
 
   test_method_type_parameter_with_function_typed_parameter() {
-    prepareAnalysisContext(createOptions()..enableGenericMethods = true);
+    prepareAnalysisContext(createOptions());
     checkLibrary('class C { void f<T, U>(T x(U u)) {} }');
   }
 
@@ -4469,48 +4617,51 @@
   }
 
   test_unresolved_annotation_namedConstructorCall_noClass() {
-    checkLibrary('@foo.bar() class C {}');
+    checkLibrary('@foo.bar() class C {}', allowErrors: true);
   }
 
   test_unresolved_annotation_namedConstructorCall_noConstructor() {
-    checkLibrary('@String.foo() class C {}');
+    checkLibrary('@String.foo() class C {}', allowErrors: true);
   }
 
   test_unresolved_annotation_prefixedIdentifier_badPrefix() {
-    checkLibrary('@foo.bar class C {}');
+    checkLibrary('@foo.bar class C {}', allowErrors: true);
   }
 
   test_unresolved_annotation_prefixedIdentifier_noDeclaration() {
-    checkLibrary('import "dart:async" as foo; @foo.bar class C {}');
+    checkLibrary('import "dart:async" as foo; @foo.bar class C {}',
+        allowErrors: true);
   }
 
   test_unresolved_annotation_prefixedNamedConstructorCall_badPrefix() {
-    checkLibrary('@foo.bar.baz() class C {}');
+    checkLibrary('@foo.bar.baz() class C {}', allowErrors: true);
   }
 
   test_unresolved_annotation_prefixedNamedConstructorCall_noClass() {
-    checkLibrary('import "dart:async" as foo; @foo.bar.baz() class C {}');
+    checkLibrary('import "dart:async" as foo; @foo.bar.baz() class C {}',
+        allowErrors: true);
   }
 
-  @failingTest // See dartbug.com/25706
   test_unresolved_annotation_prefixedNamedConstructorCall_noConstructor() {
-    checkLibrary('import "dart:async" as foo; @foo.Future.bar() class C {}');
+    checkLibrary('import "dart:async" as foo; @foo.Future.bar() class C {}',
+        allowErrors: true);
   }
 
   test_unresolved_annotation_prefixedUnnamedConstructorCall_badPrefix() {
-    checkLibrary('@foo.bar() class C {}');
+    checkLibrary('@foo.bar() class C {}', allowErrors: true);
   }
 
   test_unresolved_annotation_prefixedUnnamedConstructorCall_noClass() {
-    checkLibrary('import "dart:async" as foo; @foo.bar() class C {}');
+    checkLibrary('import "dart:async" as foo; @foo.bar() class C {}',
+        allowErrors: true);
   }
 
   test_unresolved_annotation_simpleIdentifier() {
-    checkLibrary('@foo class C {}');
+    checkLibrary('@foo class C {}', allowErrors: true);
   }
 
   test_unresolved_annotation_unnamedConstructorCall_noClass() {
-    checkLibrary('@foo() class C {}');
+    checkLibrary('@foo() class C {}', allowErrors: true);
   }
 
   test_unresolved_export() {
diff --git a/pkg/analyzer/test/src/summary/summarize_ast_strong_test.dart b/pkg/analyzer/test/src/summary/summarize_ast_strong_test.dart
index 95e0ff8..05563d2 100644
--- a/pkg/analyzer/test/src/summary/summarize_ast_strong_test.dart
+++ b/pkg/analyzer/test/src/summary/summarize_ast_strong_test.dart
@@ -5,13 +5,13 @@
 library analyzer.test.src.summary.summarize_ast_strong_test;
 
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import 'summarize_ast_test.dart';
 
 main() {
-  groupSep = ' | ';
-  defineReflectiveTests(LinkedSummarizeAstStrongTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(LinkedSummarizeAstStrongTest);
+  });
 }
 
 /**
diff --git a/pkg/analyzer/test/src/summary/summarize_ast_test.dart b/pkg/analyzer/test/src/summary/summarize_ast_test.dart
index b17b6da..e0083e0 100644
--- a/pkg/analyzer/test/src/summary/summarize_ast_test.dart
+++ b/pkg/analyzer/test/src/summary/summarize_ast_test.dart
@@ -18,14 +18,15 @@
 import 'package:analyzer/src/summary/package_bundle_reader.dart';
 import 'package:analyzer/src/summary/summarize_ast.dart';
 import 'package:analyzer/src/summary/summarize_elements.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import 'summary_common.dart';
 
 main() {
-  groupSep = ' | ';
-  defineReflectiveTests(LinkedSummarizeAstSpecTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(LinkedSummarizeAstSpecTest);
+  });
 }
 
 @reflectiveTest
@@ -134,9 +135,6 @@
   LinkerInputs linkerInputs;
 
   @override
-  bool get expectAbsoluteUrisInDependencies => false;
-
-  @override
   bool get skipFullyLinkedData => false;
 
   @override
@@ -317,7 +315,6 @@
         new Scanner(null, reader, AnalysisErrorListener.NULL_LISTENER);
     Token token = scanner.tokenize();
     Parser parser = new Parser(null, AnalysisErrorListener.NULL_LISTENER);
-    parser.parseGenericMethods = true;
     CompilationUnit unit = parser.parseCompilationUnit(token);
     unit.lineInfo = new LineInfo(scanner.lineStarts);
     return unit;
diff --git a/pkg/analyzer/test/src/summary/summary_common.dart b/pkg/analyzer/test/src/summary/summary_common.dart
index 7d90d0a..fd93301 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -17,7 +17,7 @@
 import 'package:analyzer/src/summary/public_namespace_computer.dart'
     as public_namespace;
 import 'package:path/path.dart' show posix;
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import '../context/mock_sdk.dart';
 
@@ -74,7 +74,6 @@
   Scanner scanner =
       new Scanner(source, reader, AnalysisErrorListener.NULL_LISTENER);
   Parser parser = new Parser(source, AnalysisErrorListener.NULL_LISTENER);
-  parser.parseGenericMethods = true;
   CompilationUnit unit = parser.parseCompilationUnit(scanner.tokenize());
   UnlinkedPublicNamespace namespace = new UnlinkedPublicNamespace.fromBuffer(
       public_namespace.computePublicNamespace(unit).toBuffer());
@@ -141,13 +140,6 @@
   LinkedUnit get definingUnit => linked.units[0];
 
   /**
-   * `true` if the linked portion of the summary is expected to contain
-   * absolute URIs.  This happens because the element model doesn't (yet) store
-   * enough information to recover relative URIs, TODO(paulberry): fix this.
-   */
-  bool get expectAbsoluteUrisInDependencies;
-
-  /**
    * Get access to the linked summary that results from serializing and
    * then deserializing the library under test.
    */
@@ -186,10 +178,10 @@
    * Check that [annotations] contains a single entry which is a reference to
    * a top level variable called `a` in the current library.
    */
-  void checkAnnotationA(List<UnlinkedConst> annotations) {
+  void checkAnnotationA(List<UnlinkedExpr> annotations) {
     expect(annotations, hasLength(1));
     _assertUnlinkedConst(annotations[0], operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'a',
           expectedKind: ReferenceKind.topLevelPropertyAccessor)
@@ -217,12 +209,7 @@
    */
   void checkDependency(int dependency, String absoluteUri, String relativeUri) {
     expect(dependency, new isInstanceOf<int>());
-    if (expectAbsoluteUrisInDependencies) {
-      // The element model doesn't (yet) store enough information to recover
-      // relative URIs, so we have to use the absolute URI.
-      // TODO(paulberry): fix this.
-      expect(linked.dependencies[dependency].uri, absoluteUri);
-    } else if (dependency >= linked.numPrelinkedDependencies) {
+    if (dependency >= linked.numPrelinkedDependencies) {
       // Fully-linked dependencies are always absolute URIs.
       expect(linked.dependencies[dependency].uri, absoluteUri);
     } else {
@@ -231,17 +218,11 @@
   }
 
   /**
-   * Verify that the given [dependency] lists the given [absoluteUris] or
+   * Verify that the given [dependency] lists the given
    * [relativeUris] as its parts.
    */
-  void checkDependencyParts(LinkedDependency dependency,
-      List<String> absoluteUris, List<String> relativeUris) {
-    if (expectAbsoluteUrisInDependencies) {
-      // The element model doesn't (yet) store enough information to recover
-      // relative URIs, so we have to use the absolute URI.
-      // TODO(paulberry): fix this.
-      relativeUris = absoluteUris;
-    }
+  void checkDependencyParts(
+      LinkedDependency dependency, List<String> relativeUris) {
     expect(dependency.parts, relativeUris);
   }
 
@@ -295,20 +276,13 @@
 
   /**
    * Verify that the dependency table contains an entry for a file reachable
-   * via the given [absoluteUri] and [relativeUri].  If [fullyLinked] is
+   * via the given [relativeUri].  If [fullyLinked] is
    * `true`, then the dependency should be a fully-linked dependency; otherwise
    * it should be a prelinked dependency.
    *
    * The index of the [LinkedDependency] is returned.
    */
-  int checkHasDependency(String absoluteUri, String relativeUri,
-      {bool fullyLinked: false}) {
-    if (expectAbsoluteUrisInDependencies) {
-      // The element model doesn't (yet) store enough information to recover
-      // relative URIs, so we have to use the absolute URI.
-      // TODO(paulberry): fix this.
-      relativeUri = absoluteUri;
-    }
+  int checkHasDependency(String relativeUri, {bool fullyLinked: false}) {
     List<String> found = <String>[];
     for (int i = 0; i < linked.dependencies.length; i++) {
       LinkedDependency dep = linked.dependencies[i];
@@ -359,15 +333,9 @@
 
   /**
    * Verify that the dependency table *does not* contain any entries for a file
-   * reachable via the given [absoluteUri] and [relativeUri].
+   * reachable via the given [relativeUri].
    */
-  void checkLacksDependency(String absoluteUri, String relativeUri) {
-    if (expectAbsoluteUrisInDependencies) {
-      // The element model doesn't (yet) store enough information to recover
-      // relative URIs, so we have to use the absolute URI.
-      // TODO(paulberry): fix this.
-      relativeUri = absoluteUri;
-    }
+  void checkLacksDependency(String relativeUri) {
     for (LinkedDependency dep in linked.dependencies) {
       if (dep.uri == relativeUri) {
         fail('Unexpected dependency found: $relativeUri');
@@ -620,6 +588,37 @@
     checkTypeRef(typeRef, null, null, 'void');
   }
 
+  fail_invalid_prefix_dynamic() {
+//    if (checkAstDerivedData) {
+//      // TODO(paulberry): get this to work properly.
+//      return;
+//    }
+    var t = serializeTypeText('dynamic.T', allowErrors: true);
+    checkUnresolvedTypeRef(t, 'dynamic', 'T');
+  }
+
+  fail_invalid_prefix_type_parameter() {
+//    if (checkAstDerivedData) {
+//      // TODO(paulberry): get this to work properly.
+//      return;
+//    }
+    checkUnresolvedTypeRef(
+        serializeClassText('class C<T> { T.U x; }', allowErrors: true)
+            .fields[0]
+            .type,
+        'T',
+        'U');
+  }
+
+  fail_invalid_prefix_void() {
+//    if (checkAstDerivedData) {
+//      // TODO(paulberry): get this to work properly.
+//      return;
+//    }
+    checkUnresolvedTypeRef(
+        serializeTypeText('void.T', allowErrors: true), 'void', 'T');
+  }
+
   /**
    * Find the class with the given [className] in the summary, and return its
    * [UnlinkedClass] data structure.  If [unit] is not given, the class is
@@ -829,6 +828,129 @@
     return findVariable(variableName, failIfAbsent: true);
   }
 
+  test_apiSignature() {
+    List<int> signature1;
+    List<int> signature2;
+    List<int> signature3;
+    {
+      serializeLibraryText('class A {}');
+      signature1 = unlinkedUnits[0].apiSignature;
+    }
+    {
+      serializeLibraryText('class A { }');
+      signature2 = unlinkedUnits[0].apiSignature;
+    }
+    {
+      serializeLibraryText('class B {}');
+      signature3 = unlinkedUnits[0].apiSignature;
+    }
+    expect(signature2, signature1);
+    expect(signature3, isNot(signature1));
+  }
+
+  test_apiSignature_excludeBody_constructor() {
+    List<int> signature1;
+    List<int> signature2;
+    List<int> signature3;
+    {
+      serializeLibraryText(r'''
+class A {
+  A() {
+  }
+}
+''');
+      signature1 = unlinkedUnits[0].apiSignature;
+    }
+    {
+      serializeLibraryText(r'''
+class A {
+  A() {
+    int v1;
+    f() {
+      double v2;
+    }
+  }
+}
+''');
+      signature2 = unlinkedUnits[0].apiSignature;
+    }
+    {
+      serializeLibraryText(r'''
+class A {
+  A(int p) {
+  }
+}
+''');
+    }
+    expect(signature2, signature1);
+    expect(signature3, isNot(signature1));
+  }
+
+  test_apiSignature_excludeBody_method() {
+    List<int> signature1;
+    List<int> signature2;
+    List<int> signature3;
+    {
+      serializeLibraryText(r'''
+class A {
+  m() {
+  }
+}
+''');
+      signature1 = unlinkedUnits[0].apiSignature;
+    }
+    {
+      serializeLibraryText(r'''
+class A {
+  m() {
+    int v1;
+    f() {
+      double v2;
+    }
+  }
+}
+''');
+      signature2 = unlinkedUnits[0].apiSignature;
+    }
+    {
+      serializeLibraryText(r'''
+class A {
+  m(p) {
+  }
+}
+''');
+    }
+    expect(signature2, signature1);
+    expect(signature3, isNot(signature1));
+  }
+
+  test_apiSignature_excludeBody_topLevelFunction() {
+    List<int> signature1;
+    List<int> signature2;
+    List<int> signature3;
+    {
+      serializeLibraryText('main() {}');
+      signature1 = unlinkedUnits[0].apiSignature;
+    }
+    {
+      serializeLibraryText(r'''
+main() {
+  int v1 = 1;
+  f() {
+    int v2 = 2;
+  }
+}
+''');
+      signature2 = unlinkedUnits[0].apiSignature;
+    }
+    {
+      serializeLibraryText('main(p) {}');
+      signature3 = unlinkedUnits[0].apiSignature;
+    }
+    expect(signature2, signature1);
+    expect(signature3, isNot(signature1));
+  }
+
   test_bottom_reference_shared() {
     if (skipFullyLinkedData) {
       return;
@@ -1333,21 +1455,22 @@
   }
 
   test_closure_executable_with_bottom_return_type() {
-    UnlinkedExecutable executable =
-        serializeExecutableText('f() { print((() => null)()); }');
-    expect(executable.localFunctions, hasLength(1));
-    expect(executable.localFunctions[0].returnType, isNull);
+    UnlinkedVariable variable = serializeVariableText('var v = (() => null);');
+    UnlinkedExecutable closure;
+    {
+      UnlinkedExecutable executable = variable.initializer;
+      expect(executable.localFunctions, hasLength(1));
+      expect(executable.localFunctions[0].returnType, isNull);
+      closure = executable.localFunctions[0];
+    }
     if (strongMode) {
       // Strong mode infers a type for the closure of `() => dynamic`, so the
       // inferred return type slot should be empty.
-      expect(
-          getTypeRefForSlot(
-              executable.localFunctions[0].inferredReturnTypeSlot),
-          isNull);
+      expect(getTypeRefForSlot(closure.inferredReturnTypeSlot), isNull);
     } else {
       // Spec mode infers a type for the closure of `() => Bottom`.
-      checkInferredTypeSlot(executable.localFunctions[0].inferredReturnTypeSlot,
-          null, null, '*bottom*',
+      checkInferredTypeSlot(
+          closure.inferredReturnTypeSlot, null, null, '*bottom*',
           onlyInStrongMode: false);
     }
   }
@@ -1356,14 +1479,18 @@
     addNamedSource('/a.dart', 'class C { D d; } class D {}');
     // The closure has type `() => D`; `D` is defined in a library that is
     // imported.
-    UnlinkedExecutable executable = serializeExecutableText(
-        'import "a.dart"; f() { print((() => new C().d)()); }');
+    UnlinkedExecutable executable = serializeVariableText(r'''
+import "a.dart";
+var v = (() {
+  print((() => new C().d)());
+});
+''').initializer.localFunctions[0];
     expect(executable.localFunctions, hasLength(1));
     expect(executable.localFunctions[0].returnType, isNull);
     checkInferredTypeSlot(executable.localFunctions[0].inferredReturnTypeSlot,
         absUri('/a.dart'), 'a.dart', 'D',
         onlyInStrongMode: false);
-    checkHasDependency(absUri('/a.dart'), 'a.dart', fullyLinked: false);
+    checkHasDependency('a.dart', fullyLinked: false);
   }
 
   test_closure_executable_with_return_type_from_closure() {
@@ -1400,24 +1527,28 @@
     addNamedSource('/b.dart', 'class D {}');
     // The closure has type `() => D`; `D` is defined in a library that is not
     // imported.
-    UnlinkedExecutable executable = serializeExecutableText(
-        'import "a.dart"; f() { print((() => new C().d)()); }');
+    UnlinkedExecutable executable = serializeVariableText(r'''
+import "a.dart";
+var v = (() {
+  print((() => new C().d)());
+});
+''').initializer.localFunctions[0];
     expect(executable.localFunctions, hasLength(1));
     expect(executable.localFunctions[0].returnType, isNull);
     checkInferredTypeSlot(executable.localFunctions[0].inferredReturnTypeSlot,
         absUri('/b.dart'), 'b.dart', 'D',
         onlyInStrongMode: false);
     if (!skipFullyLinkedData) {
-      checkHasDependency(absUri('/b.dart'), 'b.dart', fullyLinked: true);
+      checkHasDependency('b.dart', fullyLinked: true);
     }
   }
 
   test_constExpr_binary_add() {
     UnlinkedVariable variable = serializeVariableText('const v = 1 + 2;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.add
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.add
     ], ints: [
       1,
       2
@@ -1428,18 +1559,18 @@
     UnlinkedVariable variable =
         serializeVariableText('const v = true && false;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushTrue,
-      UnlinkedConstOperation.pushFalse,
-      UnlinkedConstOperation.and
+      UnlinkedExprOperation.pushTrue,
+      UnlinkedExprOperation.pushFalse,
+      UnlinkedExprOperation.and
     ]);
   }
 
   test_constExpr_binary_bitAnd() {
     UnlinkedVariable variable = serializeVariableText('const v = 1 & 2;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.bitAnd
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.bitAnd
     ], ints: [
       1,
       2
@@ -1449,9 +1580,9 @@
   test_constExpr_binary_bitOr() {
     UnlinkedVariable variable = serializeVariableText('const v = 1 | 2;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.bitOr
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.bitOr
     ], ints: [
       1,
       2
@@ -1461,9 +1592,9 @@
   test_constExpr_binary_bitShiftLeft() {
     UnlinkedVariable variable = serializeVariableText('const v = 1 << 2;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.bitShiftLeft
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.bitShiftLeft
     ], ints: [
       1,
       2
@@ -1473,9 +1604,9 @@
   test_constExpr_binary_bitShiftRight() {
     UnlinkedVariable variable = serializeVariableText('const v = 1 >> 2;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.bitShiftRight
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.bitShiftRight
     ], ints: [
       1,
       2
@@ -1485,9 +1616,9 @@
   test_constExpr_binary_bitXor() {
     UnlinkedVariable variable = serializeVariableText('const v = 1 ^ 2;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.bitXor
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.bitXor
     ], ints: [
       1,
       2
@@ -1497,9 +1628,9 @@
   test_constExpr_binary_divide() {
     UnlinkedVariable variable = serializeVariableText('const v = 1 / 2;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.divide
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.divide
     ], ints: [
       1,
       2
@@ -1509,9 +1640,9 @@
   test_constExpr_binary_equal() {
     UnlinkedVariable variable = serializeVariableText('const v = 1 == 2;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.equal
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.equal
     ], ints: [
       1,
       2
@@ -1521,9 +1652,9 @@
   test_constExpr_binary_equal_not() {
     UnlinkedVariable variable = serializeVariableText('const v = 1 != 2;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.notEqual
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.notEqual
     ], ints: [
       1,
       2
@@ -1533,9 +1664,9 @@
   test_constExpr_binary_floorDivide() {
     UnlinkedVariable variable = serializeVariableText('const v = 1 ~/ 2;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.floorDivide
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.floorDivide
     ], ints: [
       1,
       2
@@ -1545,9 +1676,9 @@
   test_constExpr_binary_greater() {
     UnlinkedVariable variable = serializeVariableText('const v = 1 > 2;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.greater
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.greater
     ], ints: [
       1,
       2
@@ -1557,9 +1688,9 @@
   test_constExpr_binary_greaterEqual() {
     UnlinkedVariable variable = serializeVariableText('const v = 1 >= 2;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.greaterEqual
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.greaterEqual
     ], ints: [
       1,
       2
@@ -1569,9 +1700,9 @@
   test_constExpr_binary_less() {
     UnlinkedVariable variable = serializeVariableText('const v = 1 < 2;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.less
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.less
     ], ints: [
       1,
       2
@@ -1581,9 +1712,9 @@
   test_constExpr_binary_lessEqual() {
     UnlinkedVariable variable = serializeVariableText('const v = 1 <= 2;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.lessEqual
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.lessEqual
     ], ints: [
       1,
       2
@@ -1593,9 +1724,9 @@
   test_constExpr_binary_modulo() {
     UnlinkedVariable variable = serializeVariableText('const v = 1 % 2;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.modulo
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.modulo
     ], ints: [
       1,
       2
@@ -1605,9 +1736,9 @@
   test_constExpr_binary_multiply() {
     UnlinkedVariable variable = serializeVariableText('const v = 1 * 2;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.multiply
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.multiply
     ], ints: [
       1,
       2
@@ -1618,18 +1749,30 @@
     UnlinkedVariable variable =
         serializeVariableText('const v = false || true;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushFalse,
-      UnlinkedConstOperation.pushTrue,
-      UnlinkedConstOperation.or
+      UnlinkedExprOperation.pushFalse,
+      UnlinkedExprOperation.pushTrue,
+      UnlinkedExprOperation.or
+    ]);
+  }
+
+  test_constExpr_binary_qq() {
+    UnlinkedVariable variable = serializeVariableText('const v = 1 ?? 2;');
+    _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.ifNull
+    ], ints: [
+      1,
+      2
     ]);
   }
 
   test_constExpr_binary_subtract() {
     UnlinkedVariable variable = serializeVariableText('const v = 1 - 2;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.subtract
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.subtract
     ], ints: [
       1,
       2
@@ -1651,7 +1794,7 @@
     UnlinkedClass cls = serializeClassText(text, allowErrors: true);
     _assertUnlinkedConst(cls.executables[0].constantInitializers[0].expression,
         operators: [
-          UnlinkedConstOperation.pushReference
+          UnlinkedExprOperation.pushReference
         ],
         referenceValidators: [
           (EntityRef r) => checkTypeRef(r, null, null, 'T',
@@ -1667,10 +1810,10 @@
     UnlinkedVariable variable =
         serializeVariableText('const v = true ? 1 : 2;', allowErrors: true);
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushTrue,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.conditional
+      UnlinkedExprOperation.pushTrue,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.conditional
     ], ints: [
       1,
       2
@@ -1686,7 +1829,7 @@
 }
 ''');
     _assertUnlinkedConst(cls.executables[0].constantInitializers[0].expression,
-        operators: [UnlinkedConstOperation.pushParameter], strings: ['a']);
+        operators: [UnlinkedExprOperation.pushParameter], strings: ['a']);
   }
 
   test_constExpr_constructorParam_shadows_typeParam() {
@@ -1697,7 +1840,27 @@
 }
 ''');
     _assertUnlinkedConst(cls.executables[0].constantInitializers[0].expression,
-        operators: [UnlinkedConstOperation.pushParameter], strings: ['T']);
+        operators: [UnlinkedExprOperation.pushParameter], strings: ['T']);
+  }
+
+  test_constExpr_functionExpression() {
+    if (skipNonConstInitializers) {
+      return;
+    }
+    UnlinkedVariable variable = serializeVariableText('''
+import 'dart:async';
+const v = (f) async => await f;
+''');
+    _assertUnlinkedConst(variable.initializer.localFunctions[0].bodyExpr,
+        isValidConst: false,
+        operators: [
+          UnlinkedExprOperation.pushParameter,
+          UnlinkedExprOperation.await
+        ],
+        strings: [
+          'f'
+        ],
+        ints: []);
   }
 
   test_constExpr_functionExpression_asArgument() {
@@ -1711,9 +1874,9 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.pushLocalFunctionReference,
-          UnlinkedConstOperation.invokeMethodRef
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.pushLocalFunctionReference,
+          UnlinkedExprOperation.invokeMethodRef
         ],
         ints: [
           5,
@@ -1740,10 +1903,10 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.pushLocalFunctionReference,
-          UnlinkedConstOperation.pushLocalFunctionReference,
-          UnlinkedConstOperation.invokeMethodRef
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.pushLocalFunctionReference,
+          UnlinkedExprOperation.pushLocalFunctionReference,
+          UnlinkedExprOperation.invokeMethodRef
         ],
         ints: [
           5,
@@ -1774,11 +1937,11 @@
     expect(executable.localFunctions, hasLength(2));
     _assertUnlinkedConst(executable.constantInitializers[0].expression,
         isValidConst: false,
-        operators: [UnlinkedConstOperation.pushLocalFunctionReference],
+        operators: [UnlinkedExprOperation.pushLocalFunctionReference],
         ints: [0, 0]);
     _assertUnlinkedConst(executable.constantInitializers[1].expression,
         isValidConst: false,
-        operators: [UnlinkedConstOperation.pushLocalFunctionReference],
+        operators: [UnlinkedExprOperation.pushLocalFunctionReference],
         ints: [0, 1]);
   }
 
@@ -1790,7 +1953,7 @@
 const v = const C<int, String>.named();
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -1822,7 +1985,7 @@
 const v = const C<int, String>.named();
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -1856,7 +2019,7 @@
 const v = const p.C<int, String>.named();
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -1886,7 +2049,7 @@
 const v = const C<int, String>();
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -1915,7 +2078,7 @@
 const v = const C<int, String>();
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -1944,7 +2107,7 @@
 const v = const p.C<int, String>();
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -1971,7 +2134,7 @@
 const v = const C.named();
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -1997,7 +2160,7 @@
 const v = const C.named();
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -2024,7 +2187,7 @@
 const v = const p.C.named();
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -2051,14 +2214,14 @@
     // Doubles: ^pointer
     // Strings: ^pointer 'e' 'g' 'f' ''
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushDouble,
-      UnlinkedConstOperation.pushString,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushString,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushDouble,
+      UnlinkedExprOperation.pushString,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushString,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       11,
       22,
@@ -2093,7 +2256,7 @@
 const v = const C();
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -2116,7 +2279,7 @@
 const v = const p.C();
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -2137,7 +2300,7 @@
 ''',
         allowErrors: true);
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -2157,7 +2320,7 @@
 ''',
         allowErrors: true);
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -2184,7 +2347,7 @@
 ''',
         allowErrors: true);
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -2208,7 +2371,7 @@
 ''',
         allowErrors: true);
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -2229,7 +2392,7 @@
 ''',
         allowErrors: true);
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -2243,9 +2406,9 @@
     UnlinkedVariable variable =
         serializeVariableText('const v = identical(42, null);');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushNull,
-      UnlinkedConstOperation.invokeMethodRef
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushNull,
+      UnlinkedExprOperation.invokeMethodRef
     ], ints: [
       42,
       0,
@@ -2267,7 +2430,7 @@
 const int v = C.length;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'length',
               expectedKind: ReferenceKind.propertyAccessor,
@@ -2290,7 +2453,7 @@
 const int v = p.C.length;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'length',
               expectedKind: ReferenceKind.propertyAccessor,
@@ -2308,7 +2471,7 @@
 const int v = a.length;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'length',
               expectedKind: ReferenceKind.unresolved,
@@ -2328,7 +2491,7 @@
 const int v = C.F.length;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'length',
               expectedKind: ReferenceKind.unresolved,
@@ -2351,7 +2514,7 @@
 const int v = a.length;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'length',
               expectedKind: ReferenceKind.unresolved,
@@ -2375,7 +2538,7 @@
 const int v = p.a.length;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'length',
               expectedKind: ReferenceKind.unresolved,
@@ -2393,10 +2556,10 @@
     UnlinkedVariable variable =
         serializeVariableText('const v = ("abc" + "edf").length;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushString,
-      UnlinkedConstOperation.pushString,
-      UnlinkedConstOperation.add,
-      UnlinkedConstOperation.extractProperty
+      UnlinkedExprOperation.pushString,
+      UnlinkedExprOperation.pushString,
+      UnlinkedExprOperation.add,
+      UnlinkedExprOperation.extractProperty
     ], strings: [
       'abc',
       'edf',
@@ -2408,8 +2571,8 @@
     UnlinkedVariable variable =
         serializeVariableText('const v = ("abc").length;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushString,
-      UnlinkedConstOperation.extractProperty
+      UnlinkedExprOperation.pushString,
+      UnlinkedExprOperation.extractProperty
     ], strings: [
       'abc',
       'length'
@@ -2420,8 +2583,8 @@
     UnlinkedVariable variable =
         serializeVariableText('const v = "abc".length;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushString,
-      UnlinkedConstOperation.extractProperty
+      UnlinkedExprOperation.pushString,
+      UnlinkedExprOperation.extractProperty
     ], strings: [
       'abc',
       'length'
@@ -2431,17 +2594,17 @@
   test_constExpr_makeSymbol() {
     UnlinkedVariable variable = serializeVariableText('const v = #a.bb.ccc;');
     _assertUnlinkedConst(variable.initializer.bodyExpr,
-        operators: [UnlinkedConstOperation.makeSymbol], strings: ['a.bb.ccc']);
+        operators: [UnlinkedExprOperation.makeSymbol], strings: ['a.bb.ccc']);
   }
 
   test_constExpr_makeTypedList() {
     UnlinkedVariable variable =
         serializeVariableText('const v = const <int>[11, 22, 33];');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.makeTypedList
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.makeTypedList
     ], ints: [
       11,
       22,
@@ -2457,10 +2620,10 @@
     UnlinkedVariable variable =
         serializeVariableText('const v = const <dynamic>[11, 22, 33];');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.makeTypedList
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.makeTypedList
     ], ints: [
       11,
       22,
@@ -2475,13 +2638,13 @@
     UnlinkedVariable variable = serializeVariableText(
         'const v = const <int, String>{11: "aaa", 22: "bbb", 33: "ccc"};');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushString,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushString,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushString,
-      UnlinkedConstOperation.makeTypedMap
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushString,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushString,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushString,
+      UnlinkedExprOperation.makeTypedMap
     ], ints: [
       11,
       22,
@@ -2503,13 +2666,13 @@
     UnlinkedVariable variable = serializeVariableText(
         'const v = const <dynamic, dynamic>{11: "aaa", 22: "bbb", 33: "ccc"};');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushString,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushString,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushString,
-      UnlinkedConstOperation.makeTypedMap
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushString,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushString,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushString,
+      UnlinkedExprOperation.makeTypedMap
     ], ints: [
       11,
       22,
@@ -2529,10 +2692,10 @@
     UnlinkedVariable variable =
         serializeVariableText('const v = const [11, 22, 33];');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.makeUntypedList
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.makeUntypedList
     ], ints: [
       11,
       22,
@@ -2545,13 +2708,13 @@
     UnlinkedVariable variable = serializeVariableText(
         'const v = const {11: "aaa", 22: "bbb", 33: "ccc"};');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushString,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushString,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushString,
-      UnlinkedConstOperation.makeUntypedMap
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushString,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushString,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushString,
+      UnlinkedExprOperation.makeUntypedMap
     ], ints: [
       11,
       22,
@@ -2567,11 +2730,11 @@
   test_constExpr_parenthesized() {
     UnlinkedVariable variable = serializeVariableText('const v = (1 + 2) * 3;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.add,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.multiply,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.add,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.multiply,
     ], ints: [
       1,
       2,
@@ -2582,8 +2745,8 @@
   test_constExpr_prefix_complement() {
     UnlinkedVariable variable = serializeVariableText('const v = ~2;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.complement
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.complement
     ], ints: [
       2
     ]);
@@ -2592,8 +2755,8 @@
   test_constExpr_prefix_negate() {
     UnlinkedVariable variable = serializeVariableText('const v = -(2);');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.negate
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.negate
     ], ints: [
       2
     ]);
@@ -2601,34 +2764,32 @@
 
   test_constExpr_prefix_not() {
     UnlinkedVariable variable = serializeVariableText('const v = !true;');
-    _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushTrue,
-      UnlinkedConstOperation.not
-    ]);
+    _assertUnlinkedConst(variable.initializer.bodyExpr,
+        operators: [UnlinkedExprOperation.pushTrue, UnlinkedExprOperation.not]);
   }
 
   test_constExpr_pushDouble() {
     UnlinkedVariable variable = serializeVariableText('const v = 123.4567;');
     _assertUnlinkedConst(variable.initializer.bodyExpr,
-        operators: [UnlinkedConstOperation.pushDouble], doubles: [123.4567]);
+        operators: [UnlinkedExprOperation.pushDouble], doubles: [123.4567]);
   }
 
   test_constExpr_pushFalse() {
     UnlinkedVariable variable = serializeVariableText('const v = false;');
     _assertUnlinkedConst(variable.initializer.bodyExpr,
-        operators: [UnlinkedConstOperation.pushFalse]);
+        operators: [UnlinkedExprOperation.pushFalse]);
   }
 
   test_constExpr_pushInt() {
     UnlinkedVariable variable = serializeVariableText('const v = 1;');
     _assertUnlinkedConst(variable.initializer.bodyExpr,
-        operators: [UnlinkedConstOperation.pushInt], ints: [1]);
+        operators: [UnlinkedExprOperation.pushInt], ints: [1]);
   }
 
   test_constExpr_pushInt_max() {
     UnlinkedVariable variable = serializeVariableText('const v = 0xFFFFFFFF;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
+      UnlinkedExprOperation.pushInt,
     ], ints: [
       0xFFFFFFFF
     ]);
@@ -2637,8 +2798,8 @@
   test_constExpr_pushInt_negative() {
     UnlinkedVariable variable = serializeVariableText('const v = -5;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.negate
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.negate
     ], ints: [
       5
     ]);
@@ -2648,14 +2809,14 @@
     UnlinkedVariable variable =
         serializeVariableText('const v = 0xA123456789ABCDEF012345678;');
     _assertUnlinkedConst(variable.initializer.bodyExpr,
-        operators: [UnlinkedConstOperation.pushLongInt],
+        operators: [UnlinkedExprOperation.pushLongInt],
         ints: [4, 0xA, 0x12345678, 0x9ABCDEF0, 0x12345678]);
   }
 
   test_constExpr_pushLongInt_min2() {
     UnlinkedVariable variable = serializeVariableText('const v = 0x100000000;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushLongInt
+      UnlinkedExprOperation.pushLongInt
     ], ints: [
       2,
       1,
@@ -2667,7 +2828,7 @@
     UnlinkedVariable variable =
         serializeVariableText('const v = 0x10000000000000000;');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushLongInt
+      UnlinkedExprOperation.pushLongInt
     ], ints: [
       3,
       1,
@@ -2679,7 +2840,7 @@
   test_constExpr_pushNull() {
     UnlinkedVariable variable = serializeVariableText('const v = null;');
     _assertUnlinkedConst(variable.initializer.bodyExpr,
-        operators: [UnlinkedConstOperation.pushNull]);
+        operators: [UnlinkedExprOperation.pushNull]);
   }
 
   test_constExpr_pushReference_class() {
@@ -2688,7 +2849,7 @@
 const v = C;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'C',
           expectedKind: ReferenceKind.classOrEnum)
@@ -2701,7 +2862,7 @@
 const v = C;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'C',
           expectedKind: ReferenceKind.classOrEnum)
@@ -2714,7 +2875,7 @@
 const v = C.V1;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'V1',
               expectedKind: ReferenceKind.propertyAccessor,
@@ -2735,7 +2896,7 @@
 const v = C.V1;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'V1',
               expectedKind: ReferenceKind.propertyAccessor,
@@ -2752,7 +2913,7 @@
 const v = C.values;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'values',
               expectedKind: ReferenceKind.propertyAccessor,
@@ -2773,7 +2934,7 @@
 const v = C.values;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'values',
               expectedKind: ReferenceKind.propertyAccessor,
@@ -2792,7 +2953,7 @@
 const v = C.F;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'F',
               expectedKind: ReferenceKind.propertyAccessor,
@@ -2815,7 +2976,7 @@
 const v = C.F;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'F',
               expectedKind: ReferenceKind.propertyAccessor,
@@ -2839,7 +3000,7 @@
 const v = p.C.F;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'F',
               expectedKind: ReferenceKind.propertyAccessor,
@@ -2859,7 +3020,7 @@
 }
 ''').fields[0];
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'b',
               expectedKind: ReferenceKind.propertyAccessor,
@@ -2877,7 +3038,7 @@
 const v = C.x;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'x',
               expectedKind: ReferenceKind.propertyAccessor,
@@ -2900,7 +3061,7 @@
 const v = C.x;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'x',
               expectedKind: ReferenceKind.propertyAccessor,
@@ -2924,7 +3085,7 @@
 const v = p.C.x;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'x',
               expectedKind: ReferenceKind.propertyAccessor,
@@ -2944,7 +3105,7 @@
 const v = C.m;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'm',
               expectedKind: ReferenceKind.method,
@@ -2967,7 +3128,7 @@
 const v = C.m;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'm',
               expectedKind: ReferenceKind.method,
@@ -2991,7 +3152,7 @@
 const v = p.C.m;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'm',
               expectedKind: ReferenceKind.method,
@@ -3011,7 +3172,7 @@
 }
 ''').fields[0];
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'm',
               expectedKind: ReferenceKind.method,
@@ -3027,7 +3188,7 @@
 const v = f;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'f',
           expectedKind: ReferenceKind.topLevelFunction)
@@ -3045,7 +3206,7 @@
 const v = f;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'a.dart', 'f',
           expectedKind: ReferenceKind.topLevelFunction)
@@ -3063,7 +3224,7 @@
 const v = p.f;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'a.dart', 'f',
               expectedKind: ReferenceKind.topLevelFunction,
@@ -3079,7 +3240,7 @@
 const v = x;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'x',
           expectedKind: ReferenceKind.topLevelPropertyAccessor)
@@ -3093,7 +3254,7 @@
 const v = x;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'a.dart', 'x',
           expectedKind: ReferenceKind.topLevelPropertyAccessor)
@@ -3107,7 +3268,7 @@
 const v = p.x;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'a.dart', 'x',
           expectedKind: ReferenceKind.topLevelPropertyAccessor,
@@ -3121,7 +3282,7 @@
 const v = a;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'a',
           expectedKind: ReferenceKind.topLevelPropertyAccessor)
@@ -3135,7 +3296,7 @@
 const v = a;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'a.dart', 'a',
           expectedKind: ReferenceKind.topLevelPropertyAccessor)
@@ -3149,7 +3310,7 @@
 const v = p.a;
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) {
         return checkTypeRef(r, absUri('/a.dart'), 'a.dart', 'a',
@@ -3168,7 +3329,7 @@
     UnlinkedVariable variable =
         serializeClassText(text, allowErrors: true).fields[0];
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) {
         return checkParamTypeRef(r, 1);
@@ -3183,7 +3344,7 @@
 ''',
         allowErrors: true);
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'foo',
           expectedKind: ReferenceKind.unresolved)
@@ -3198,7 +3359,7 @@
 ''',
         allowErrors: true);
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'foo',
               expectedKind: ReferenceKind.unresolved,
@@ -3221,7 +3382,7 @@
 ''',
         allowErrors: true);
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'foo',
               expectedKind: ReferenceKind.unresolved,
@@ -3237,20 +3398,20 @@
     UnlinkedVariable variable =
         serializeVariableText('const v = "aaa" "b" "ccc";');
     _assertUnlinkedConst(variable.initializer.bodyExpr,
-        operators: [UnlinkedConstOperation.pushString], strings: ['aaabccc']);
+        operators: [UnlinkedExprOperation.pushString], strings: ['aaabccc']);
   }
 
   test_constExpr_pushString_adjacent_interpolation() {
     UnlinkedVariable variable =
         serializeVariableText(r'const v = "aaa" "bb ${42} bbb" "cccc";');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushString,
-      UnlinkedConstOperation.pushString,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushString,
-      UnlinkedConstOperation.concatenate,
-      UnlinkedConstOperation.pushString,
-      UnlinkedConstOperation.concatenate,
+      UnlinkedExprOperation.pushString,
+      UnlinkedExprOperation.pushString,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushString,
+      UnlinkedExprOperation.concatenate,
+      UnlinkedExprOperation.pushString,
+      UnlinkedExprOperation.concatenate,
     ], ints: [
       42,
       3,
@@ -3267,10 +3428,10 @@
     UnlinkedVariable variable =
         serializeVariableText(r'const v = "aaa ${42} bbb";');
     _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushString,
-      UnlinkedConstOperation.pushInt,
-      UnlinkedConstOperation.pushString,
-      UnlinkedConstOperation.concatenate
+      UnlinkedExprOperation.pushString,
+      UnlinkedExprOperation.pushInt,
+      UnlinkedExprOperation.pushString,
+      UnlinkedExprOperation.concatenate
     ], ints: [
       42,
       3
@@ -3283,13 +3444,13 @@
   test_constExpr_pushString_simple() {
     UnlinkedVariable variable = serializeVariableText('const v = "abc";');
     _assertUnlinkedConst(variable.initializer.bodyExpr,
-        operators: [UnlinkedConstOperation.pushString], strings: ['abc']);
+        operators: [UnlinkedExprOperation.pushString], strings: ['abc']);
   }
 
   test_constExpr_pushTrue() {
     UnlinkedVariable variable = serializeVariableText('const v = true;');
     _assertUnlinkedConst(variable.initializer.bodyExpr,
-        operators: [UnlinkedConstOperation.pushTrue]);
+        operators: [UnlinkedExprOperation.pushTrue]);
   }
 
   test_constructor() {
@@ -3381,7 +3542,7 @@
     expect(initializer.kind, UnlinkedConstructorInitializerKind.field);
     expect(initializer.name, 'x');
     _assertUnlinkedConst(initializer.expression,
-        operators: [UnlinkedConstOperation.pushInt], ints: [42]);
+        operators: [UnlinkedExprOperation.pushInt], ints: [42]);
     expect(initializer.arguments, isEmpty);
   }
 
@@ -3399,7 +3560,7 @@
     expect(initializer.kind, UnlinkedConstructorInitializerKind.field);
     expect(initializer.name, 'x');
     _assertUnlinkedConst(initializer.expression,
-        operators: [UnlinkedConstOperation.pushParameter], strings: ['p']);
+        operators: [UnlinkedExprOperation.pushParameter], strings: ['p']);
     expect(initializer.arguments, isEmpty);
   }
 
@@ -3433,7 +3594,7 @@
     expect(initializer.expression, isNull);
     expect(initializer.arguments, hasLength(1));
     _assertUnlinkedConst(initializer.arguments[0],
-        operators: [UnlinkedConstOperation.pushInt], ints: [42]);
+        operators: [UnlinkedExprOperation.pushInt], ints: [42]);
   }
 
   test_constructor_initializers_superInvocation_namedExpression() {
@@ -3455,11 +3616,11 @@
     expect(initializer.expression, isNull);
     expect(initializer.arguments, hasLength(3));
     _assertUnlinkedConst(initializer.arguments[0],
-        operators: [UnlinkedConstOperation.pushInt], ints: [1]);
+        operators: [UnlinkedExprOperation.pushInt], ints: [1]);
     _assertUnlinkedConst(initializer.arguments[1],
-        operators: [UnlinkedConstOperation.pushInt], ints: [2]);
+        operators: [UnlinkedExprOperation.pushInt], ints: [2]);
     _assertUnlinkedConst(initializer.arguments[2],
-        operators: [UnlinkedConstOperation.pushInt], ints: [3]);
+        operators: [UnlinkedExprOperation.pushInt], ints: [3]);
     expect(initializer.argumentNames, ['b', 'c']);
   }
 
@@ -3482,7 +3643,7 @@
     expect(initializer.expression, isNull);
     expect(initializer.arguments, hasLength(1));
     _assertUnlinkedConst(initializer.arguments[0],
-        operators: [UnlinkedConstOperation.pushInt], ints: [42]);
+        operators: [UnlinkedExprOperation.pushInt], ints: [42]);
   }
 
   test_constructor_initializers_thisInvocation_named() {
@@ -3501,9 +3662,9 @@
     expect(initializer.expression, isNull);
     expect(initializer.arguments, hasLength(2));
     _assertUnlinkedConst(initializer.arguments[0],
-        operators: [UnlinkedConstOperation.pushInt], ints: [1]);
+        operators: [UnlinkedExprOperation.pushInt], ints: [1]);
     _assertUnlinkedConst(initializer.arguments[1],
-        operators: [UnlinkedConstOperation.pushString], strings: ['bbb']);
+        operators: [UnlinkedExprOperation.pushString], strings: ['bbb']);
   }
 
   test_constructor_initializers_thisInvocation_namedExpression() {
@@ -3522,11 +3683,11 @@
     expect(initializer.expression, isNull);
     expect(initializer.arguments, hasLength(3));
     _assertUnlinkedConst(initializer.arguments[0],
-        operators: [UnlinkedConstOperation.pushInt], ints: [1]);
+        operators: [UnlinkedExprOperation.pushInt], ints: [1]);
     _assertUnlinkedConst(initializer.arguments[1],
-        operators: [UnlinkedConstOperation.pushInt], ints: [2]);
+        operators: [UnlinkedExprOperation.pushInt], ints: [2]);
     _assertUnlinkedConst(initializer.arguments[2],
-        operators: [UnlinkedConstOperation.pushInt], ints: [3]);
+        operators: [UnlinkedExprOperation.pushInt], ints: [3]);
     expect(initializer.argumentNames, ['b', 'c']);
   }
 
@@ -3546,9 +3707,9 @@
     expect(initializer.expression, isNull);
     expect(initializer.arguments, hasLength(2));
     _assertUnlinkedConst(initializer.arguments[0],
-        operators: [UnlinkedConstOperation.pushInt], ints: [1]);
+        operators: [UnlinkedExprOperation.pushInt], ints: [1]);
     _assertUnlinkedConst(initializer.arguments[1],
-        operators: [UnlinkedConstOperation.pushString], strings: ['bbb']);
+        operators: [UnlinkedExprOperation.pushString], strings: ['bbb']);
   }
 
   test_constructor_initializing_formal() {
@@ -3633,7 +3794,7 @@
     expect(param.kind, UnlinkedParamKind.positional);
     expect(param.defaultValueCode, 'foo');
     _assertUnlinkedConst(param.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'foo',
           expectedKind: ReferenceKind.topLevelFunction)
@@ -3678,7 +3839,7 @@
     expect(parameter.defaultValueCode, '42');
     _assertCodeRange(parameter.codeRange, 13, 10);
     _assertUnlinkedConst(parameter.initializer.bodyExpr,
-        operators: [UnlinkedConstOperation.pushInt], ints: [42]);
+        operators: [UnlinkedExprOperation.pushInt], ints: [42]);
   }
 
   test_constructor_initializing_formal_non_function_typed() {
@@ -3710,7 +3871,7 @@
     expect(parameter.defaultValueCode, '42');
     _assertCodeRange(parameter.codeRange, 13, 11);
     _assertUnlinkedConst(parameter.initializer.bodyExpr,
-        operators: [UnlinkedConstOperation.pushInt], ints: [42]);
+        operators: [UnlinkedExprOperation.pushInt], ints: [42]);
   }
 
   test_constructor_initializing_formal_required() {
@@ -3742,7 +3903,7 @@
     expect(param.kind, UnlinkedParamKind.positional);
     expect(param.defaultValueCode, '42');
     _assertUnlinkedConst(param.initializer.bodyExpr,
-        operators: [UnlinkedConstOperation.pushInt], ints: [42]);
+        operators: [UnlinkedExprOperation.pushInt], ints: [42]);
   }
 
   test_constructor_named() {
@@ -4699,7 +4860,7 @@
     // re-export any names defined in b.dart, because a change to b.dart might
     // cause it to start exporting a name that the main test library *does*
     // use.
-    checkHasDependency(absUri('/b.dart'), 'b.dart');
+    checkHasDependency('b.dart');
   }
 
   test_dependencies_export_unused() {
@@ -4709,17 +4870,17 @@
     // re-export any names defined in a.dart, because a change to a.dart might
     // cause it to start exporting a name that the main test library *will*
     // re-export.
-    checkHasDependency(absUri('/a.dart'), 'a.dart');
+    checkHasDependency('a.dart');
   }
 
   test_dependencies_import_to_export() {
     addNamedSource('/a.dart', 'library a; export "b.dart"; class A {}');
     addNamedSource('/b.dart', 'library b;');
     serializeLibraryText('import "a.dart"; A a;');
-    checkHasDependency(absUri('/a.dart'), 'a.dart');
+    checkHasDependency('a.dart');
     // The main test library depends on b.dart, because names defined in
     // b.dart are exported by a.dart.
-    checkHasDependency(absUri('/b.dart'), 'b.dart');
+    checkHasDependency('b.dart');
   }
 
   test_dependencies_import_to_export_in_subdirs_absolute_export() {
@@ -4727,40 +4888,40 @@
         'library a; export "${absUri('/a/b/b.dart')}"; class A {}');
     addNamedSource('/a/b/b.dart', 'library b;');
     serializeLibraryText('import "a/a.dart"; A a;');
-    checkHasDependency(absUri('/a/a.dart'), 'a/a.dart');
+    checkHasDependency('a/a.dart');
     // The main test library depends on b.dart, because names defined in
     // b.dart are exported by a.dart.
-    checkHasDependency(absUri('/a/b/b.dart'), absUri('/a/b/b.dart'));
+    checkHasDependency(absUri('/a/b/b.dart'));
   }
 
   test_dependencies_import_to_export_in_subdirs_absolute_import() {
     addNamedSource('/a/a.dart', 'library a; export "b/b.dart"; class A {}');
     addNamedSource('/a/b/b.dart', 'library b;');
     serializeLibraryText('import "${absUri('/a/a.dart')}"; A a;');
-    checkHasDependency(absUri('/a/a.dart'), absUri('/a/a.dart'));
+    checkHasDependency(absUri('/a/a.dart'));
     // The main test library depends on b.dart, because names defined in
     // b.dart are exported by a.dart.
-    checkHasDependency(absUri('/a/b/b.dart'), absUri('/a/b/b.dart'));
+    checkHasDependency(absUri('/a/b/b.dart'));
   }
 
   test_dependencies_import_to_export_in_subdirs_relative() {
     addNamedSource('/a/a.dart', 'library a; export "b/b.dart"; class A {}');
     addNamedSource('/a/b/b.dart', 'library b;');
     serializeLibraryText('import "a/a.dart"; A a;');
-    checkHasDependency(absUri('/a/a.dart'), 'a/a.dart');
+    checkHasDependency('a/a.dart');
     // The main test library depends on b.dart, because names defined in
     // b.dart are exported by a.dart.
-    checkHasDependency(absUri('/a/b/b.dart'), 'a/b/b.dart');
+    checkHasDependency('a/b/b.dart');
   }
 
   test_dependencies_import_to_export_loop() {
     addNamedSource('/a.dart', 'library a; export "b.dart"; class A {}');
     addNamedSource('/b.dart', 'library b; export "a.dart";');
     serializeLibraryText('import "a.dart"; A a;');
-    checkHasDependency(absUri('/a.dart'), 'a.dart');
+    checkHasDependency('a.dart');
     // Serialization should have been able to walk the transitive export
     // dependencies to b.dart without going into an infinite loop.
-    checkHasDependency(absUri('/b.dart'), 'b.dart');
+    checkHasDependency('b.dart');
   }
 
   test_dependencies_import_to_export_transitive_closure() {
@@ -4768,10 +4929,10 @@
     addNamedSource('/b.dart', 'library b; export "c.dart";');
     addNamedSource('/c.dart', 'library c;');
     serializeLibraryText('import "a.dart"; A a;');
-    checkHasDependency(absUri('/a.dart'), 'a.dart');
+    checkHasDependency('a.dart');
     // The main test library depends on c.dart, because names defined in
     // c.dart are exported by b.dart and then re-exported by a.dart.
-    checkHasDependency(absUri('/c.dart'), 'c.dart');
+    checkHasDependency('c.dart');
   }
 
   test_dependencies_import_to_export_unused() {
@@ -4781,7 +4942,7 @@
     // The main test library depends on b.dart, even though it doesn't use any
     // names defined in b.dart, because a change to b.dart might cause it to
     // start exporting a name that the main test library *does* use.
-    checkHasDependency(absUri('/b.dart'), 'b.dart');
+    checkHasDependency('b.dart');
   }
 
   test_dependencies_import_transitive_closure() {
@@ -4789,10 +4950,10 @@
         '/a.dart', 'library a; import "b.dart"; class A extends B {}');
     addNamedSource('/b.dart', 'library b; class B {}');
     serializeLibraryText('import "a.dart"; A a;');
-    checkHasDependency(absUri('/a.dart'), 'a.dart');
+    checkHasDependency('a.dart');
     // The main test library doesn't depend on b.dart, because no change to
     // b.dart can possibly affect the serialized element model for it.
-    checkLacksDependency(absUri('/b.dart'), 'b.dart');
+    checkLacksDependency('b.dart');
   }
 
   test_dependencies_import_unused() {
@@ -4801,7 +4962,7 @@
     // The main test library depends on a.dart, even though it doesn't use any
     // names defined in a.dart, because a change to a.dart might cause it to
     // start exporting a name that the main test library *does* use.
-    checkHasDependency(absUri('/a.dart'), 'a.dart');
+    checkHasDependency('a.dart');
   }
 
   test_dependencies_parts() {
@@ -4810,9 +4971,8 @@
     addNamedSource('/b.dart', 'part of a;');
     addNamedSource('/c.dart', 'part of a;');
     serializeLibraryText('import "a.dart"; A a;');
-    int dep = checkHasDependency(absUri('/a.dart'), 'a.dart');
-    checkDependencyParts(linked.dependencies[dep],
-        [absUri('/b.dart'), absUri('/c.dart')], ['b.dart', 'c.dart']);
+    int dep = checkHasDependency('a.dart');
+    checkDependencyParts(linked.dependencies[dep], ['b.dart', 'c.dart']);
   }
 
   test_dependencies_parts_relative_to_importing_library() {
@@ -4822,11 +4982,9 @@
     addNamedSource('/a/c/e/f.dart', 'part of d;');
     addNamedSource('/a/c/g/h.dart', 'part of d;');
     serializeLibraryText('import "a/b.dart"; D d;');
-    int dep = checkHasDependency(absUri('/a/c/d.dart'), 'a/c/d.dart');
+    int dep = checkHasDependency('a/c/d.dart');
     checkDependencyParts(
-        linked.dependencies[dep],
-        [absUri('/a/c/e/f.dart'), absUri('/a/c/g/h.dart')],
-        ['a/c/e/f.dart', 'a/c/g/h.dart']);
+        linked.dependencies[dep], ['a/c/e/f.dart', 'a/c/g/h.dart']);
   }
 
   test_elements_in_part() {
@@ -5029,24 +5187,16 @@
 
   test_executable_localFunctions() {
     String code = r'''
-f() { // 1
+f() {
   f1() {}
-  { // 2
+  {
     f2() {}
-  } // 3
-} // 4
+  }
+}
 ''';
     UnlinkedExecutable executable = serializeExecutableText(code);
     List<UnlinkedExecutable> functions = executable.localFunctions;
-    expect(functions, hasLength(2));
-    {
-      UnlinkedExecutable f1 = functions.singleWhere((v) => v.name == 'f1');
-      _assertExecutableVisible(code, f1, '{ // 1', '} // 4');
-    }
-    {
-      UnlinkedExecutable f2 = functions.singleWhere((v) => v.name == 'f2');
-      _assertExecutableVisible(code, f2, '{ // 2', '} // 3');
-    }
+    expect(functions, isEmpty);
   }
 
   test_executable_localLabels_inMethod() {
@@ -5061,19 +5211,7 @@
     UnlinkedExecutable executable =
         findExecutable('m', executables: serializeClassText(code).executables);
     List<UnlinkedLabel> labels = executable.localLabels;
-    expect(labels, hasLength(2));
-    {
-      UnlinkedLabel aaa = labels.singleWhere((l) => l.name == 'aaa');
-      expect(aaa, isNotNull);
-      expect(aaa.isOnSwitchMember, isFalse);
-      expect(aaa.isOnSwitchStatement, isFalse);
-    }
-    {
-      UnlinkedLabel bbb = labels.singleWhere((l) => l.name == 'bbb');
-      expect(bbb, isNotNull);
-      expect(bbb.isOnSwitchMember, isFalse);
-      expect(bbb.isOnSwitchStatement, isFalse);
-    }
+    expect(labels, isEmpty);
   }
 
   test_executable_localLabels_inTopLevelFunction() {
@@ -5090,31 +5228,7 @@
 ''';
     UnlinkedExecutable executable = serializeExecutableText(code);
     List<UnlinkedLabel> labels = executable.localLabels;
-    expect(labels, hasLength(4));
-    {
-      UnlinkedLabel aaa = labels.singleWhere((l) => l.name == 'aaa');
-      expect(aaa, isNotNull);
-      expect(aaa.isOnSwitchMember, isFalse);
-      expect(aaa.isOnSwitchStatement, isFalse);
-    }
-    {
-      UnlinkedLabel bbb = labels.singleWhere((l) => l.name == 'bbb');
-      expect(bbb, isNotNull);
-      expect(bbb.isOnSwitchMember, isFalse);
-      expect(bbb.isOnSwitchStatement, isTrue);
-    }
-    {
-      UnlinkedLabel ccc = labels.singleWhere((l) => l.name == 'ccc');
-      expect(ccc, isNotNull);
-      expect(ccc.isOnSwitchMember, isTrue);
-      expect(ccc.isOnSwitchStatement, isFalse);
-    }
-    {
-      UnlinkedLabel ccc = labels.singleWhere((l) => l.name == 'ddd');
-      expect(ccc, isNotNull);
-      expect(ccc.isOnSwitchMember, isTrue);
-      expect(ccc.isOnSwitchStatement, isFalse);
-    }
+    expect(labels, isEmpty);
   }
 
   test_executable_localLabels_inTopLevelGetter() {
@@ -5127,19 +5241,7 @@
     UnlinkedExecutable executable =
         serializeExecutableText(code, executableName: 'g');
     List<UnlinkedLabel> labels = executable.localLabels;
-    expect(labels, hasLength(2));
-    {
-      UnlinkedLabel aaa = labels.singleWhere((l) => l.name == 'aaa');
-      expect(aaa, isNotNull);
-      expect(aaa.isOnSwitchMember, isFalse);
-      expect(aaa.isOnSwitchStatement, isFalse);
-    }
-    {
-      UnlinkedLabel bbb = labels.singleWhere((l) => l.name == 'bbb');
-      expect(bbb, isNotNull);
-      expect(bbb.isOnSwitchMember, isFalse);
-      expect(bbb.isOnSwitchStatement, isFalse);
-    }
+    expect(labels, isEmpty);
   }
 
   test_executable_localLabels_namedExpressionLabel() {
@@ -5156,16 +5258,19 @@
 
   test_executable_localVariables_catch() {
     String code = r'''
-f() { // 1
-  try {
-    throw 42;
-  } on int catch (e, st) { // 2
-    print(e);
-    print(st);
-  } // 3
-} // 4
+var v = (
+  () { // 1
+    try {
+      throw 42;
+    } on int catch (e, st) { // 2
+      print(e);
+      print(st);
+    } // 3
+  } // 4
+);
 ''';
-    UnlinkedExecutable executable = serializeExecutableText(code);
+    UnlinkedExecutable executable =
+        serializeVariableText(code).initializer.localFunctions[0];
     List<UnlinkedVariable> variables = executable.localVariables;
     expect(variables, hasLength(2));
     {
@@ -5202,13 +5307,18 @@
 
   test_executable_localVariables_forEachLoop() {
     String code = r'''
-f() { // 1
-  for (int i in <int>[]) { // 2
-    print(i);
-  } // 3
-} // 4
+var v = (() {
+  f() { // 1
+    for (int i in <int>[]) { // 2
+      print(i);
+    } // 3
+  } // 4
+});
 ''';
-    UnlinkedExecutable executable = serializeExecutableText(code);
+    UnlinkedExecutable executable = serializeVariableText(code)
+        .initializer
+        .localFunctions[0]
+        .localFunctions[0];
     List<UnlinkedVariable> variables = executable.localVariables;
     expect(variables, hasLength(1));
     {
@@ -5220,14 +5330,19 @@
 
   test_executable_localVariables_forEachLoop_outside() {
     String code = r'''
-f() { // 1
-  int i;
-  for (i in <int>[]) {
-    print(i);
-  }
-} // 4
+var v = (() {
+  f() { // 1
+    int i;
+    for (i in <int>[]) {
+      print(i);
+    }
+  } // 4
+});
 ''';
-    UnlinkedExecutable executable = serializeExecutableText(code);
+    UnlinkedExecutable executable = serializeVariableText(code)
+        .initializer
+        .localFunctions[0]
+        .localFunctions[0];
     List<UnlinkedVariable> variables = executable.localVariables;
     expect(variables, hasLength(1));
     {
@@ -5239,13 +5354,18 @@
 
   test_executable_localVariables_forLoop() {
     String code = r'''
-f() { // 1
-  for (int i = 0, j = 0; i < 10; i++, j++) { // 2
-    print(i);
-  } // 3
-} // 4
+var v = (() {
+  f() { // 1
+    for (int i = 0, j = 0; i < 10; i++, j++) { // 2
+      print(i);
+    } // 3
+  } // 4
+});
 ''';
-    UnlinkedExecutable executable = serializeExecutableText(code);
+    UnlinkedExecutable executable = serializeVariableText(code)
+        .initializer
+        .localFunctions[0]
+        .localFunctions[0];
     List<UnlinkedVariable> variables = executable.localVariables;
     expect(variables, hasLength(2));
     {
@@ -5262,11 +5382,16 @@
 
   test_executable_localVariables_forLoop_noVariables() {
     String code = r'''
-f() {
-  for (; true;) {}
-}
+var v = (() {
+  f() {
+    for (; true;) {}
+  }
+});
 ''';
-    UnlinkedExecutable executable = serializeExecutableText(code);
+    UnlinkedExecutable executable = serializeVariableText(code)
+        .initializer
+        .localFunctions[0]
+        .localFunctions[0];
     List<UnlinkedVariable> variables = executable.localVariables;
     expect(variables, isEmpty);
   }
@@ -5274,37 +5399,37 @@
   test_executable_localVariables_inConstructor() {
     String code = r'''
 class C {
-  C() { // 1
+  C() {
     int v;
-  } // 2
+  }
 }
 ''';
     UnlinkedExecutable executable =
         findExecutable('', executables: serializeClassText(code).executables);
     List<UnlinkedVariable> variables = executable.localVariables;
-    expect(variables, hasLength(1));
-    {
-      UnlinkedVariable v = variables.singleWhere((v) => v.name == 'v');
-      _assertVariableVisible(code, v, '{ // 1', '} // 2');
-      checkTypeRef(v.type, 'dart:core', 'dart:core', 'int');
-    }
+    expect(variables, isEmpty);
   }
 
   test_executable_localVariables_inLocalFunctions() {
     String code = r'''
-f() {
-  f1() { // 1
-    int v1 = 1;
-  } // 2
-  f2() { // 3
-    int v1 = 1;
-    f3() { // 4
-      int v2 = 1;
-    } // 5
-  } // 6
-} // 7
+var v = (() {
+  f() {
+    f1() { // 1
+      int v1 = 1;
+    } // 2
+    f2() { // 3
+      int v1 = 1;
+      f3() { // 4
+        int v2 = 1;
+      } // 5
+    } // 6
+  } // 7
+});
 ''';
-    UnlinkedExecutable executable = serializeExecutableText(code);
+    UnlinkedExecutable executable = serializeVariableText(code)
+        .initializer
+        .localFunctions[0]
+        .localFunctions[0];
     List<UnlinkedExecutable> functions = executable.localFunctions;
     expect(functions, hasLength(2));
     // f - f1
@@ -5345,57 +5470,31 @@
   test_executable_localVariables_inMethod() {
     String code = r'''
 class C {
-  m() { // 1
+  m() {
     int v;
     f() {}
-  } // 2
+  }
 }
 ''';
     UnlinkedExecutable executable =
         findExecutable('m', executables: serializeClassText(code).executables);
-    {
-      List<UnlinkedExecutable> functions = executable.localFunctions;
-      expect(functions, hasLength(1));
-      UnlinkedExecutable f = functions.singleWhere((v) => v.name == 'f');
-      _assertExecutableVisible(code, f, '{ // 1', '} // 2');
-    }
-    {
-      List<UnlinkedVariable> variables = executable.localVariables;
-      expect(variables, hasLength(1));
-      UnlinkedVariable v = variables.singleWhere((v) => v.name == 'v');
-      _assertVariableVisible(code, v, '{ // 1', '} // 2');
-      checkTypeRef(v.type, 'dart:core', 'dart:core', 'int');
-    }
+    expect(executable.localFunctions, isEmpty);
+    expect(executable.localVariables, isEmpty);
   }
 
   test_executable_localVariables_inTopLevelFunction() {
     String code = r'''
-f() { // 1
+f() {
   int v1 = 1;
-  { // 2
+  {
     int v2 = 2;
-  } // 3
+  }
   var v3 = 3;
-} // 4
+}
 ''';
     UnlinkedExecutable executable = serializeExecutableText(code);
     List<UnlinkedVariable> variables = executable.localVariables;
-    expect(variables, hasLength(3));
-    {
-      UnlinkedVariable v1 = variables.singleWhere((v) => v.name == 'v1');
-      _assertVariableVisible(code, v1, '{ // 1', '} // 4');
-      checkTypeRef(v1.type, 'dart:core', 'dart:core', 'int');
-    }
-    {
-      UnlinkedVariable v2 = variables.singleWhere((v) => v.name == 'v2');
-      _assertVariableVisible(code, v2, '{ // 2', '} // 3');
-      checkTypeRef(v2.type, 'dart:core', 'dart:core', 'int');
-    }
-    {
-      UnlinkedVariable v3 = variables.singleWhere((v) => v.name == 'v3');
-      _assertVariableVisible(code, v3, '{ // 1', '} // 4');
-      expect(v3.type, isNull);
-    }
+    expect(variables, isEmpty);
   }
 
   test_executable_localVariables_inTopLevelGetter() {
@@ -5407,19 +5506,8 @@
 ''';
     UnlinkedExecutable executable =
         serializeExecutableText(code, executableName: 'g');
-    {
-      List<UnlinkedExecutable> functions = executable.localFunctions;
-      expect(functions, hasLength(1));
-      UnlinkedExecutable f = functions.singleWhere((v) => v.name == 'f');
-      _assertExecutableVisible(code, f, '{ // 1', '} // 2');
-    }
-    {
-      List<UnlinkedVariable> variables = executable.localVariables;
-      expect(variables, hasLength(1));
-      UnlinkedVariable v = variables.singleWhere((v) => v.name == 'v');
-      _assertVariableVisible(code, v, '{ // 1', '} // 2');
-      checkTypeRef(v.type, 'dart:core', 'dart:core', 'int');
-    }
+    expect(executable.localFunctions, isEmpty);
+    expect(executable.localVariables, isEmpty);
   }
 
   test_executable_member_function() {
@@ -5725,7 +5813,7 @@
     expect(param.initializer, isNotNull);
     expect(param.defaultValueCode, 'foo');
     _assertUnlinkedConst(param.initializer.bodyExpr, operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'foo',
           expectedKind: ReferenceKind.topLevelFunction)
@@ -5748,7 +5836,7 @@
     expect(param.defaultValueCode, '42');
     _assertCodeRange(param.codeRange, 3, 5);
     _assertUnlinkedConst(param.initializer.bodyExpr,
-        operators: [UnlinkedConstOperation.pushInt], ints: [42]);
+        operators: [UnlinkedExprOperation.pushInt], ints: [42]);
   }
 
   test_executable_param_kind_positional() {
@@ -5767,7 +5855,7 @@
     expect(param.defaultValueCode, '42');
     _assertCodeRange(param.codeRange, 3, 6);
     _assertUnlinkedConst(param.initializer.bodyExpr,
-        operators: [UnlinkedConstOperation.pushInt], ints: [42]);
+        operators: [UnlinkedExprOperation.pushInt], ints: [42]);
   }
 
   test_executable_param_kind_required() {
@@ -5802,6 +5890,41 @@
     expect(executable.parameters, isEmpty);
   }
 
+  test_executable_param_of_constructor_no_covariance() {
+    UnlinkedExecutable executable =
+        serializeClassText('class C { C(x); }').executables[0];
+    expect(executable.parameters[0].inheritsCovariantSlot, 0);
+  }
+
+  test_executable_param_of_method_covariance() {
+    UnlinkedExecutable executable =
+        serializeClassText('class C { m(x) {} }').executables[0];
+    expect(executable.parameters[0].inheritsCovariantSlot, isNot(0));
+  }
+
+  test_executable_param_of_param_no_covariance() {
+    UnlinkedExecutable executable =
+        serializeClassText('class C { m(f(x)) {} }').executables[0];
+    expect(executable.parameters[0].parameters[0].inheritsCovariantSlot, 0);
+  }
+
+  test_executable_param_of_setter_covariance() {
+    UnlinkedExecutable executable =
+        serializeClassText('class C { void set s(x) {} }').executables[0];
+    expect(executable.parameters[0].inheritsCovariantSlot, isNot(0));
+  }
+
+  test_executable_param_of_static_method_no_covariance() {
+    UnlinkedExecutable executable =
+        serializeClassText('class C { static m(x) {} }').executables[0];
+    expect(executable.parameters[0].inheritsCovariantSlot, 0);
+  }
+
+  test_executable_param_of_top_level_function_no_covariance() {
+    UnlinkedExecutable executable = serializeExecutableText('f(x) {}');
+    expect(executable.parameters[0].inheritsCovariantSlot, 0);
+  }
+
   test_executable_param_order() {
     UnlinkedExecutable executable = serializeExecutableText('f(x, y) {}');
     expect(executable.parameters, hasLength(2));
@@ -6296,10 +6419,10 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.pushReference,
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.assignToIndex,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.pushReference,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.assignToIndex,
         ],
         assignmentOperators: [
           (UnlinkedExprAssignOperator.assign)
@@ -6342,19 +6465,19 @@
         isValidConst: false,
         operators: [
           // 5
-          UnlinkedConstOperation.pushInt,
+          UnlinkedExprOperation.pushInt,
           // a.b[1]
-          UnlinkedConstOperation.pushReference,
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.extractIndex,
+          UnlinkedExprOperation.pushReference,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.extractIndex,
           // c[2]
-          UnlinkedConstOperation.extractProperty,
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.extractIndex,
+          UnlinkedExprOperation.extractProperty,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.extractIndex,
           // f[3] = 5
-          UnlinkedConstOperation.extractProperty,
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.assignToIndex,
+          UnlinkedExprOperation.extractProperty,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.assignToIndex,
         ],
         assignmentOperators: [
           (UnlinkedExprAssignOperator.assign)
@@ -6390,10 +6513,10 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.pushReference,
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.assignToIndex,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.pushReference,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.assignToIndex,
         ],
         assignmentOperators: [
           (UnlinkedExprAssignOperator.assign)
@@ -6422,9 +6545,9 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.invokeConstructor,
-          UnlinkedConstOperation.assignToProperty,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.invokeConstructor,
+          UnlinkedExprOperation.assignToProperty,
         ],
         assignmentOperators: [
           (UnlinkedExprAssignOperator.assign)
@@ -6456,8 +6579,8 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.assignToRef,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.assignToRef,
         ],
         assignmentOperators: [
           (UnlinkedExprAssignOperator.assign)
@@ -6495,8 +6618,8 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.assignToRef,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.assignToRef,
         ],
         assignmentOperators: [
           (UnlinkedExprAssignOperator.assign)
@@ -6548,8 +6671,8 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.assignToRef,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.assignToRef,
         ],
         assignmentOperators: [
           (UnlinkedExprAssignOperator.assign)
@@ -6580,8 +6703,8 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.assignToRef,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.assignToRef,
         ],
         assignmentOperators: [
           (UnlinkedExprAssignOperator.assign)
@@ -6612,8 +6735,8 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.assignToRef,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.assignToRef,
         ],
         assignmentOperators: [
           (UnlinkedExprAssignOperator.assign)
@@ -6645,14 +6768,14 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushReference,
+          UnlinkedExprOperation.pushReference,
           //   ..[1] = 2
-          UnlinkedConstOperation.cascadeSectionBegin,
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.assignToIndex,
+          UnlinkedExprOperation.cascadeSectionBegin,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.assignToIndex,
           // c
-          UnlinkedConstOperation.cascadeSectionEnd,
+          UnlinkedExprOperation.cascadeSectionEnd,
         ],
         assignmentOperators: [
           UnlinkedExprAssignOperator.assign,
@@ -6687,19 +6810,19 @@
         isValidConst: false,
         operators: [
           // new C()
-          UnlinkedConstOperation.invokeConstructor,
+          UnlinkedExprOperation.invokeConstructor,
           //   ..f1 = 1
-          UnlinkedConstOperation.cascadeSectionBegin,
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.assignToProperty,
+          UnlinkedExprOperation.cascadeSectionBegin,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.assignToProperty,
           // C
-          UnlinkedConstOperation.cascadeSectionEnd,
+          UnlinkedExprOperation.cascadeSectionEnd,
           //   ..f2 += 2
-          UnlinkedConstOperation.cascadeSectionBegin,
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.assignToProperty,
+          UnlinkedExprOperation.cascadeSectionBegin,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.assignToProperty,
           // C
-          UnlinkedConstOperation.cascadeSectionEnd,
+          UnlinkedExprOperation.cascadeSectionEnd,
         ],
         assignmentOperators: [
           UnlinkedExprAssignOperator.assign,
@@ -6742,29 +6865,29 @@
         isValidConst: false,
         operators: [
           // new A()
-          UnlinkedConstOperation.invokeConstructor,
+          UnlinkedExprOperation.invokeConstructor,
           // ..fa1 = 1
-          UnlinkedConstOperation.cascadeSectionBegin,
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.assignToProperty,
-          UnlinkedConstOperation.cascadeSectionEnd,
+          UnlinkedExprOperation.cascadeSectionBegin,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.assignToProperty,
+          UnlinkedExprOperation.cascadeSectionEnd,
           // ..b
-          UnlinkedConstOperation.cascadeSectionBegin,
+          UnlinkedExprOperation.cascadeSectionBegin,
           //   new B()
-          UnlinkedConstOperation.invokeConstructor,
+          UnlinkedExprOperation.invokeConstructor,
           //   ..fb = 2
-          UnlinkedConstOperation.cascadeSectionBegin,
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.assignToProperty,
-          UnlinkedConstOperation.cascadeSectionEnd,
+          UnlinkedExprOperation.cascadeSectionBegin,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.assignToProperty,
+          UnlinkedExprOperation.cascadeSectionEnd,
           // ..b = <pop value>
-          UnlinkedConstOperation.assignToProperty,
-          UnlinkedConstOperation.cascadeSectionEnd,
+          UnlinkedExprOperation.assignToProperty,
+          UnlinkedExprOperation.cascadeSectionEnd,
           // ..fa2 = 3
-          UnlinkedConstOperation.cascadeSectionBegin,
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.assignToProperty,
-          UnlinkedConstOperation.cascadeSectionEnd,
+          UnlinkedExprOperation.cascadeSectionBegin,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.assignToProperty,
+          UnlinkedExprOperation.cascadeSectionEnd,
         ],
         assignmentOperators: [
           UnlinkedExprAssignOperator.assign,
@@ -6810,21 +6933,21 @@
         isValidConst: false,
         operators: [
           // a
-          UnlinkedConstOperation.pushReference,
+          UnlinkedExprOperation.pushReference,
           //   ..m(5)
-          UnlinkedConstOperation.cascadeSectionBegin,
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.invokeMethod,
+          UnlinkedExprOperation.cascadeSectionBegin,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.invokeMethod,
           //   ..abs()
-          UnlinkedConstOperation.invokeMethod,
+          UnlinkedExprOperation.invokeMethod,
           // a
-          UnlinkedConstOperation.cascadeSectionEnd,
+          UnlinkedExprOperation.cascadeSectionEnd,
           //   ..m(6)
-          UnlinkedConstOperation.cascadeSectionBegin,
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.invokeMethod,
+          UnlinkedExprOperation.cascadeSectionBegin,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.invokeMethod,
           // a
-          UnlinkedConstOperation.cascadeSectionEnd,
+          UnlinkedExprOperation.cascadeSectionEnd,
         ],
         ints: [
           5, 0, 1, 0, // m(5)
@@ -6855,10 +6978,10 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.invokeConstructor,
-          UnlinkedConstOperation.extractProperty,
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.extractIndex,
+          UnlinkedExprOperation.invokeConstructor,
+          UnlinkedExprOperation.extractProperty,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.extractIndex,
         ],
         ints: [
           0,
@@ -6887,8 +7010,8 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.invokeConstructor,
-          UnlinkedConstOperation.extractProperty,
+          UnlinkedExprOperation.invokeConstructor,
+          UnlinkedExprOperation.extractProperty,
         ],
         ints: [
           0,
@@ -6914,9 +7037,9 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.pushLocalFunctionReference,
-          UnlinkedConstOperation.invokeMethodRef
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.pushLocalFunctionReference,
+          UnlinkedExprOperation.invokeMethodRef
         ],
         ints: [
           5,
@@ -6943,10 +7066,10 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.pushLocalFunctionReference,
-          UnlinkedConstOperation.pushLocalFunctionReference,
-          UnlinkedConstOperation.invokeMethodRef
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.pushLocalFunctionReference,
+          UnlinkedExprOperation.pushLocalFunctionReference,
+          UnlinkedExprOperation.invokeMethodRef
         ],
         ints: [
           5,
@@ -6973,7 +7096,7 @@
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
-        operators: [UnlinkedConstOperation.pushLocalFunctionReference],
+        operators: [UnlinkedExprOperation.pushLocalFunctionReference],
         ints: [0, 0]);
   }
 
@@ -6986,7 +7109,7 @@
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
-        operators: [UnlinkedConstOperation.pushLocalFunctionReference],
+        operators: [UnlinkedExprOperation.pushLocalFunctionReference],
         ints: [0, 0]);
   }
 
@@ -6998,7 +7121,7 @@
 final v = ((a, b) {return 42;})(1, 2);
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr,
-        isValidConst: false, operators: [UnlinkedConstOperation.pushNull]);
+        isValidConst: false, operators: [UnlinkedExprOperation.pushNull]);
   }
 
   test_expr_functionExpressionInvocation_withExpressionBody() {
@@ -7009,7 +7132,7 @@
 final v = ((a, b) => 42)(1, 2);
 ''');
     _assertUnlinkedConst(variable.initializer.bodyExpr,
-        isValidConst: false, operators: [UnlinkedConstOperation.pushNull]);
+        isValidConst: false, operators: [UnlinkedExprOperation.pushNull]);
   }
 
   test_expr_inClosure() {
@@ -7018,7 +7141,7 @@
     }
     UnlinkedVariable variable = serializeVariableText('var v = () => 1;');
     _assertUnlinkedConst(variable.initializer.localFunctions[0].bodyExpr,
-        operators: [UnlinkedConstOperation.pushInt], ints: [1]);
+        operators: [UnlinkedExprOperation.pushInt], ints: [1]);
   }
 
   test_expr_inClosure_noTypeInferenceNeeded() {
@@ -7036,7 +7159,7 @@
         serializeVariableText('var v = (x) => (y) => x;');
     _assertUnlinkedConst(
         variable.initializer.localFunctions[0].localFunctions[0].bodyExpr,
-        operators: [UnlinkedConstOperation.pushParameter],
+        operators: [UnlinkedExprOperation.pushParameter],
         strings: ['x']);
   }
 
@@ -7046,7 +7169,7 @@
     }
     UnlinkedVariable variable = serializeVariableText('var v = (x) => x;');
     _assertUnlinkedConst(variable.initializer.localFunctions[0].bodyExpr,
-        operators: [UnlinkedConstOperation.pushParameter], strings: ['x']);
+        operators: [UnlinkedExprOperation.pushParameter], strings: ['x']);
   }
 
   test_expr_inClosure_refersToParam_methodCall() {
@@ -7057,8 +7180,8 @@
     _assertUnlinkedConst(variable.initializer.localFunctions[0].bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushParameter,
-          UnlinkedConstOperation.invokeMethod
+          UnlinkedExprOperation.pushParameter,
+          UnlinkedExprOperation.invokeMethod
         ],
         strings: [
           'x',
@@ -7080,9 +7203,9 @@
     _assertUnlinkedConst(variable.initializer.localFunctions[0].bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushParameter,
-          UnlinkedConstOperation.extractProperty,
-          UnlinkedConstOperation.invokeMethod
+          UnlinkedExprOperation.pushParameter,
+          UnlinkedExprOperation.extractProperty,
+          UnlinkedExprOperation.invokeMethod
         ],
         strings: [
           'x',
@@ -7105,10 +7228,10 @@
     _assertUnlinkedConst(variable.initializer.localFunctions[0].bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushParameter,
-          UnlinkedConstOperation.pushLocalFunctionReference,
-          UnlinkedConstOperation.pushReference,
-          UnlinkedConstOperation.conditional,
+          UnlinkedExprOperation.pushParameter,
+          UnlinkedExprOperation.pushLocalFunctionReference,
+          UnlinkedExprOperation.pushReference,
+          UnlinkedExprOperation.conditional,
         ],
         strings: [
           'b'
@@ -7130,8 +7253,8 @@
     UnlinkedVariable variable = serializeVariableText('var v = (x) => x.y;');
     _assertUnlinkedConst(variable.initializer.localFunctions[0].bodyExpr,
         operators: [
-          UnlinkedConstOperation.pushParameter,
-          UnlinkedConstOperation.extractProperty
+          UnlinkedExprOperation.pushParameter,
+          UnlinkedExprOperation.extractProperty
         ],
         strings: [
           'x',
@@ -7148,9 +7271,9 @@
     _assertUnlinkedConst(variable.initializer.localFunctions[0].bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushNull,
-          UnlinkedConstOperation.pushParameter,
-          UnlinkedConstOperation.assignToProperty
+          UnlinkedExprOperation.pushNull,
+          UnlinkedExprOperation.pushParameter,
+          UnlinkedExprOperation.assignToProperty
         ],
         strings: [
           'x',
@@ -7168,9 +7291,9 @@
     UnlinkedVariable variable = serializeVariableText('var v = (x) => x.y.z;');
     _assertUnlinkedConst(variable.initializer.localFunctions[0].bodyExpr,
         operators: [
-          UnlinkedConstOperation.pushParameter,
-          UnlinkedConstOperation.extractProperty,
-          UnlinkedConstOperation.extractProperty
+          UnlinkedExprOperation.pushParameter,
+          UnlinkedExprOperation.extractProperty,
+          UnlinkedExprOperation.extractProperty
         ],
         strings: [
           'x',
@@ -7188,10 +7311,10 @@
     _assertUnlinkedConst(variable.initializer.localFunctions[0].bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushNull,
-          UnlinkedConstOperation.pushParameter,
-          UnlinkedConstOperation.extractProperty,
-          UnlinkedConstOperation.assignToProperty
+          UnlinkedExprOperation.pushNull,
+          UnlinkedExprOperation.pushParameter,
+          UnlinkedExprOperation.extractProperty,
+          UnlinkedExprOperation.assignToProperty
         ],
         strings: [
           'x',
@@ -7216,11 +7339,11 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.invokeConstructor,
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.invokeMethod,
+          UnlinkedExprOperation.invokeConstructor,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.invokeMethod,
         ],
         ints: [
           0,
@@ -7256,8 +7379,8 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.invokeConstructor,
-          UnlinkedConstOperation.invokeMethod
+          UnlinkedExprOperation.invokeConstructor,
+          UnlinkedExprOperation.invokeMethod
         ],
         ints: [
           0,
@@ -7296,9 +7419,9 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.invokeMethodRef,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.invokeMethodRef,
         ],
         ints: [
           10,
@@ -7338,7 +7461,7 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.invokeMethodRef,
+          UnlinkedExprOperation.invokeMethodRef,
         ],
         ints: [
           0,
@@ -7369,8 +7492,8 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushReference,
-          UnlinkedConstOperation.invokeMethodRef
+          UnlinkedExprOperation.pushReference,
+          UnlinkedExprOperation.invokeMethodRef
         ],
         ints: [
           0,
@@ -7396,7 +7519,7 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.invokeMethodRef
+          UnlinkedExprOperation.invokeMethodRef
         ],
         ints: [
           0,
@@ -7422,10 +7545,10 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.add,
-          UnlinkedConstOperation.throwException,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.add,
+          UnlinkedExprOperation.throwException,
         ],
         ints: [
           1,
@@ -7443,8 +7566,8 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.typeCast,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.typeCast,
         ],
         ints: [
           42
@@ -7465,8 +7588,8 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.typeCheck,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.typeCheck,
         ],
         ints: [
           42
@@ -7497,7 +7620,7 @@
         serializeClassText('class C { static const int i = 0; }').fields[0];
     expect(variable.isConst, isTrue);
     _assertUnlinkedConst(variable.initializer.bodyExpr,
-        operators: [UnlinkedConstOperation.pushInt], ints: [0]);
+        operators: [UnlinkedExprOperation.pushInt], ints: [0]);
   }
 
   test_field_documented() {
@@ -7518,7 +7641,7 @@
         serializeClassText('class C { final int i = 0; }').fields[0];
     expect(variable.isFinal, isTrue);
     _assertUnlinkedConst(variable.initializer.bodyExpr,
-        operators: [UnlinkedConstOperation.pushInt], ints: [0]);
+        operators: [UnlinkedExprOperation.pushInt], ints: [0]);
   }
 
   test_field_final_notConstExpr() {
@@ -7531,9 +7654,9 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.invokeMethodRef,
-          UnlinkedConstOperation.add,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.invokeMethodRef,
+          UnlinkedExprOperation.add,
         ],
         ints: [
           1,
@@ -7558,7 +7681,7 @@
 }''').fields[0];
     expect(variable.isFinal, isTrue);
     _assertUnlinkedConst(variable.initializer.bodyExpr,
-        operators: [UnlinkedConstOperation.makeTypedList],
+        operators: [UnlinkedExprOperation.makeTypedList],
         ints: [0],
         referenceValidators: [(EntityRef r) => checkParamTypeRef(r, 1)]);
   }
@@ -7713,25 +7836,6 @@
     expect(f.inferredReturnTypeSlot, 0);
   }
 
-  test_generic_gClass_gMethodStatic() {
-    UnlinkedClass cls = serializeClassText('''
-class C<T, U> {
-  static void m<V, W>(V v, W w) {
-    void f<X, Y>(V v, W w, X x, Y y) {
-    }
-  }
-}
-''');
-    UnlinkedExecutable m = cls.executables[0];
-    UnlinkedExecutable f = m.localFunctions[0];
-    checkParamTypeRef(m.parameters[0].type, 2);
-    checkParamTypeRef(m.parameters[1].type, 1);
-    checkParamTypeRef(f.parameters[0].type, 4);
-    checkParamTypeRef(f.parameters[1].type, 3);
-    checkParamTypeRef(f.parameters[2].type, 2);
-    checkParamTypeRef(f.parameters[3].type, 1);
-  }
-
   test_generic_method_in_generic_class() {
     UnlinkedClass cls = serializeClassText(
         'class C<T, U> { void m<V, W>(T t, U u, V v, W w) {} }');
@@ -7792,10 +7896,8 @@
     // The dependency on b.dart is implicit, so it should be placed at the end
     // of the dependency list, after a.dart, even though the code that refers
     // to b.dart comes before the code that refers to a.dart.
-    int aDep =
-        checkHasDependency(absUri('/a.dart'), 'a.dart', fullyLinked: false);
-    int bDep =
-        checkHasDependency(absUri('/b.dart'), 'b.dart', fullyLinked: true);
+    int aDep = checkHasDependency('a.dart', fullyLinked: false);
+    int bDep = checkHasDependency('b.dart', fullyLinked: true);
     expect(aDep, lessThan(bDep));
   }
 
@@ -8379,7 +8481,7 @@
     checkInferredTypeSlot(variable.initializer.inferredReturnTypeSlot,
         absUri('/a.dart'), 'a.dart', 'D',
         onlyInStrongMode: false);
-    checkHasDependency(absUri('/a.dart'), 'a.dart', fullyLinked: false);
+    checkHasDependency('a.dart', fullyLinked: false);
   }
 
   test_initializer_executable_with_return_type_from_closure() {
@@ -8490,41 +8592,10 @@
         absUri('/b.dart'), 'b.dart', 'D',
         onlyInStrongMode: false);
     if (!skipFullyLinkedData) {
-      checkHasDependency(absUri('/b.dart'), 'b.dart', fullyLinked: true);
+      checkHasDependency('b.dart', fullyLinked: true);
     }
   }
 
-  fail_invalid_prefix_dynamic() {
-//    if (checkAstDerivedData) {
-//      // TODO(paulberry): get this to work properly.
-//      return;
-//    }
-    var t = serializeTypeText('dynamic.T', allowErrors: true);
-    checkUnresolvedTypeRef(t, 'dynamic', 'T');
-  }
-
-  fail_invalid_prefix_type_parameter() {
-//    if (checkAstDerivedData) {
-//      // TODO(paulberry): get this to work properly.
-//      return;
-//    }
-    checkUnresolvedTypeRef(
-        serializeClassText('class C<T> { T.U x; }', allowErrors: true)
-            .fields[0]
-            .type,
-        'T',
-        'U');
-  }
-
-  fail_invalid_prefix_void() {
-//    if (checkAstDerivedData) {
-//      // TODO(paulberry): get this to work properly.
-//      return;
-//    }
-    checkUnresolvedTypeRef(
-        serializeTypeText('void.T', allowErrors: true), 'void', 'T');
-  }
-
   test_library_documented() {
     String text = '''
 // Extra comment so doc comment offset != 0
@@ -8644,7 +8715,7 @@
         'class A { const A.named(); } @A.named() class C {}');
     expect(cls.annotations, hasLength(1));
     _assertUnlinkedConst(cls.annotations[0], operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -8663,7 +8734,7 @@
         'import "foo.dart" as foo; @foo.A.named() class C {}');
     expect(cls.annotations, hasLength(1));
     _assertUnlinkedConst(cls.annotations[0], operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -8685,7 +8756,7 @@
         allowErrors: true);
     expect(cls.annotations, hasLength(1));
     _assertUnlinkedConst(cls.annotations[0], operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -8706,7 +8777,7 @@
         allowErrors: true);
     expect(cls.annotations, hasLength(1));
     _assertUnlinkedConst(cls.annotations[0], operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -8726,7 +8797,7 @@
         serializeClassText('@A.named() class C {}', allowErrors: true);
     expect(cls.annotations, hasLength(1));
     _assertUnlinkedConst(cls.annotations[0], operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -8744,7 +8815,7 @@
         allowErrors: true);
     expect(cls.annotations, hasLength(1));
     _assertUnlinkedConst(cls.annotations[0], operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -8762,7 +8833,7 @@
         serializeClassText('class A { const A(); } @A() class C {}');
     expect(cls.annotations, hasLength(1));
     _assertUnlinkedConst(cls.annotations[0], operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -8778,7 +8849,7 @@
         serializeClassText('import "foo.dart" as foo; @foo.A() class C {}');
     expect(cls.annotations, hasLength(1));
     _assertUnlinkedConst(cls.annotations[0], operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -8795,7 +8866,7 @@
         allowErrors: true);
     expect(cls.annotations, hasLength(1));
     _assertUnlinkedConst(cls.annotations[0], operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -8810,7 +8881,7 @@
         serializeClassText('@A() class C {}', allowErrors: true);
     expect(cls.annotations, hasLength(1));
     _assertUnlinkedConst(cls.annotations[0], operators: [
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       0
@@ -8825,8 +8896,8 @@
         serializeClassText('class A { const A(x); } @A(null) class C {}');
     expect(cls.annotations, hasLength(1));
     _assertUnlinkedConst(cls.annotations[0], operators: [
-      UnlinkedConstOperation.pushNull,
-      UnlinkedConstOperation.invokeConstructor,
+      UnlinkedExprOperation.pushNull,
+      UnlinkedExprOperation.invokeConstructor,
     ], ints: [
       0,
       1
@@ -8952,16 +9023,16 @@
   test_metadata_multiple_annotations() {
     UnlinkedClass cls =
         serializeClassText('const a = null, b = null; @a @b class C {}');
-    List<UnlinkedConst> annotations = cls.annotations;
+    List<UnlinkedExpr> annotations = cls.annotations;
     expect(annotations, hasLength(2));
     _assertUnlinkedConst(annotations[0], operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'a',
           expectedKind: ReferenceKind.topLevelPropertyAccessor)
     ]);
     _assertUnlinkedConst(annotations[1], operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'b',
           expectedKind: ReferenceKind.topLevelPropertyAccessor)
@@ -8980,7 +9051,7 @@
         serializeClassText('import "a.dart" as a; @a.b class C {}');
     expect(cls.annotations, hasLength(1));
     _assertUnlinkedConst(cls.annotations[0], operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'a.dart', 'b',
           expectedKind: ReferenceKind.topLevelPropertyAccessor,
@@ -8995,7 +9066,7 @@
         allowErrors: true);
     expect(cls.annotations, hasLength(1));
     _assertUnlinkedConst(cls.annotations[0], operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'b',
           expectedKind: ReferenceKind.unresolved, expectedPrefix: 'a')
@@ -9050,7 +9121,7 @@
     UnlinkedClass cls = serializeClassText('@a class C {}', allowErrors: true);
     expect(cls.annotations, hasLength(1));
     _assertUnlinkedConst(cls.annotations[0], operators: [
-      UnlinkedConstOperation.pushReference
+      UnlinkedExprOperation.pushReference
     ], referenceValidators: [
       (EntityRef r) => checkTypeRef(r, null, null, 'a',
           expectedKind: ReferenceKind.unresolved)
@@ -9126,20 +9197,22 @@
   }
 
   test_nested_generic_functions() {
-    UnlinkedExecutable executable = serializeExecutableText('''
-void f<T, U>() {
-  void g<V, W>() {
-    void h<X, Y>() {
-      T t;
-      U u;
-      V v;
-      W w;
-      X x;
-      Y y;
+    UnlinkedExecutable executable = serializeVariableText('''
+var v = (() {
+  void f<T, U>() {
+    void g<V, W>() {
+      void h<X, Y>() {
+        T t;
+        U u;
+        V v;
+        W w;
+        X x;
+        Y y;
+      }
     }
   }
-}
-''');
+});
+''').initializer.localFunctions[0].localFunctions[0];
     expect(executable.typeParameters, hasLength(2));
     expect(executable.localFunctions[0].typeParameters, hasLength(2));
     expect(executable.localFunctions[0].localFunctions[0].typeParameters,
@@ -9154,34 +9227,6 @@
     checkParamTypeRef(findVariable('y', variables: localVariables).type, 1);
   }
 
-  test_nested_generic_functions_in_generic_class() {
-    UnlinkedClass cls = serializeClassText('''
-class C<T, U> {
-  void g<V, W>() {
-    void h<X, Y>() {
-      T t;
-      U u;
-      V v;
-      W w;
-      X x;
-      Y y;
-    }
-  }
-}
-''');
-    expect(cls.typeParameters, hasLength(2));
-    expect(cls.executables[0].typeParameters, hasLength(2));
-    expect(cls.executables[0].localFunctions[0].typeParameters, hasLength(2));
-    List<UnlinkedVariable> localVariables =
-        cls.executables[0].localFunctions[0].localVariables;
-    checkParamTypeRef(findVariable('t', variables: localVariables).type, 6);
-    checkParamTypeRef(findVariable('u', variables: localVariables).type, 5);
-    checkParamTypeRef(findVariable('v', variables: localVariables).type, 4);
-    checkParamTypeRef(findVariable('w', variables: localVariables).type, 3);
-    checkParamTypeRef(findVariable('x', variables: localVariables).type, 2);
-    checkParamTypeRef(findVariable('y', variables: localVariables).type, 1);
-  }
-
   test_parameter_visibleRange_abstractMethod() {
     UnlinkedExecutable m = findExecutable('m',
         executables:
@@ -9192,12 +9237,15 @@
 
   test_parameter_visibleRange_function_blockBody() {
     String text = r'''
-f(x) { // 1
-  f2(y) { // 2
-  } // 3
-} // 4
+var v = (() {
+  f(x) { // 1
+    f2(y) { // 2
+    } // 3
+  } // 4
+});
 ''';
-    UnlinkedExecutable f = serializeExecutableText(text);
+    var closure = serializeVariableText(text).initializer.localFunctions[0];
+    UnlinkedExecutable f = closure.localFunctions[0];
     UnlinkedExecutable f2 = f.localFunctions[0];
     _assertParameterVisible(text, f.parameters[0], '{ // 1', '} // 4');
     _assertParameterVisible(text, f2.parameters[0], '{ // 2', '} // 3');
@@ -9243,6 +9291,13 @@
     expect(unlinkedUnits[0].parts[0].uriEnd, text.indexOf('; // <-part'));
   }
 
+  test_part_isPartOf() {
+    addNamedSource('/a.dart', 'part of foo; class C {}');
+    serializeLibraryText('library foo; part "a.dart";');
+    expect(unlinkedUnits[0].isPartOf, isFalse);
+    expect(unlinkedUnits[1].isPartOf, isTrue);
+  }
+
   test_parts_defining_compilation_unit() {
     serializeLibraryText('');
     expect(linked.units, hasLength(1));
@@ -10211,12 +10266,12 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.add,
-          UnlinkedConstOperation.assignToRef,
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.add,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.add,
+          UnlinkedExprOperation.assignToRef,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.add,
         ],
         assignmentOperators: [
           expectedAssignOperator
@@ -10278,9 +10333,9 @@
     _assertUnlinkedConst(variable.initializer.bodyExpr,
         isValidConst: false,
         operators: [
-          UnlinkedConstOperation.assignToRef,
-          UnlinkedConstOperation.pushInt,
-          UnlinkedConstOperation.add,
+          UnlinkedExprOperation.assignToRef,
+          UnlinkedExprOperation.pushInt,
+          UnlinkedExprOperation.add,
         ],
         assignmentOperators: [
           expectedAssignmentOperator
@@ -10298,9 +10353,9 @@
   /**
    * TODO(scheglov) rename "Const" to "Expr" everywhere
    */
-  void _assertUnlinkedConst(UnlinkedConst constExpr,
+  void _assertUnlinkedConst(UnlinkedExpr constExpr,
       {bool isValidConst: true,
-      List<UnlinkedConstOperation> operators: const <UnlinkedConstOperation>[],
+      List<UnlinkedExprOperation> operators: const <UnlinkedExprOperation>[],
       List<UnlinkedExprAssignOperator> assignmentOperators:
           const <UnlinkedExprAssignOperator>[],
       List<int> ints: const <int>[],
diff --git a/pkg/analyzer/test/src/summary/test_all.dart b/pkg/analyzer/test/src/summary/test_all.dart
index 2c9966b..dd63f2f 100644
--- a/pkg/analyzer/test/src/summary/test_all.dart
+++ b/pkg/analyzer/test/src/summary/test_all.dart
@@ -4,9 +4,8 @@
 
 library test.src.serialization.test_all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
 import 'api_signature_test.dart' as api_signature_test;
 import 'bazel_summary_test.dart' as bazel_summary_test;
 import 'flat_buffers_test.dart' as flat_buffers_test;
@@ -22,8 +21,7 @@
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('summary tests', () {
+  defineReflectiveSuite(() {
     api_signature_test.main();
     bazel_summary_test.main();
     flat_buffers_test.main();
@@ -36,5 +34,5 @@
     resynthesize_ast_test.main();
     summarize_ast_strong_test.main();
     summarize_ast_test.main();
-  });
+  }, name: 'summary');
 }
diff --git a/pkg/analyzer/test/src/task/dart_test.dart b/pkg/analyzer/test/src/task/dart_test.dart
index 403467e..4041961 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -26,8 +26,8 @@
 import 'package:analyzer/task/dart.dart';
 import 'package:analyzer/task/general.dart';
 import 'package:analyzer/task/model.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../generated/resolver_test_case.dart';
 import '../../generated/test_support.dart';
@@ -35,46 +35,47 @@
 import '../context/abstract_context.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(BuildCompilationUnitElementTaskTest);
-  defineReflectiveTests(BuildDirectiveElementsTaskTest);
-  defineReflectiveTests(BuildEnumMemberElementsTaskTest);
-  defineReflectiveTests(BuildExportNamespaceTaskTest);
-  defineReflectiveTests(BuildLibraryElementTaskTest);
-  defineReflectiveTests(BuildPublicNamespaceTaskTest);
-  defineReflectiveTests(BuildSourceExportClosureTaskTest);
-  defineReflectiveTests(BuildTypeProviderTaskTest);
-  defineReflectiveTests(ComputeConstantDependenciesTaskTest);
-  defineReflectiveTests(ComputeConstantValueTaskTest);
-  defineReflectiveTests(ComputeInferableStaticVariableDependenciesTaskTest);
-  defineReflectiveTests(ComputeLibraryCycleTaskTest);
-  defineReflectiveTests(ContainingLibrariesTaskTest);
-  defineReflectiveTests(DartErrorsTaskTest);
-  defineReflectiveTests(EvaluateUnitConstantsTaskTest);
-  defineReflectiveTests(GatherUsedImportedElementsTaskTest);
-  defineReflectiveTests(GatherUsedLocalElementsTaskTest);
-  defineReflectiveTests(GenerateHintsTaskTest);
-  defineReflectiveTests(GenerateLintsTaskTest);
-  defineReflectiveTests(InferInstanceMembersInUnitTaskTest);
-  defineReflectiveTests(InferStaticVariableTypesInUnitTaskTest);
-  defineReflectiveTests(InferStaticVariableTypeTaskTest);
-  defineReflectiveTests(LibraryErrorsReadyTaskTest);
-  defineReflectiveTests(LibraryUnitErrorsTaskTest);
-  defineReflectiveTests(ParseDartTaskTest);
-  defineReflectiveTests(PartiallyResolveUnitReferencesTaskTest);
-  defineReflectiveTests(ReferencedNamesBuilderTest);
-  defineReflectiveTests(ResolveDirectiveElementsTaskTest);
-  defineReflectiveTests(ResolveInstanceFieldsInUnitTaskTest);
-  defineReflectiveTests(ResolveLibraryTaskTest);
-  defineReflectiveTests(ResolveLibraryTypeNamesTaskTest);
-  defineReflectiveTests(ResolveTopLevelUnitTypeBoundsTaskTest);
-  defineReflectiveTests(ResolveUnitTaskTest);
-  defineReflectiveTests(ResolveUnitTypeNamesTaskTest);
-  defineReflectiveTests(ResolveVariableReferencesTaskTest);
-  defineReflectiveTests(ScanDartTaskTest);
-  defineReflectiveTests(StrongModeInferenceTest);
-  defineReflectiveTests(StrongModeVerifyUnitTaskTest);
-  defineReflectiveTests(VerifyUnitTaskTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(BuildCompilationUnitElementTaskTest);
+    defineReflectiveTests(BuildDirectiveElementsTaskTest);
+    defineReflectiveTests(BuildEnumMemberElementsTaskTest);
+    defineReflectiveTests(BuildExportNamespaceTaskTest);
+    defineReflectiveTests(BuildLibraryElementTaskTest);
+    defineReflectiveTests(BuildPublicNamespaceTaskTest);
+    defineReflectiveTests(BuildSourceExportClosureTaskTest);
+    defineReflectiveTests(BuildTypeProviderTaskTest);
+    defineReflectiveTests(ComputeConstantDependenciesTaskTest);
+    defineReflectiveTests(ComputeConstantValueTaskTest);
+    defineReflectiveTests(ComputeInferableStaticVariableDependenciesTaskTest);
+    defineReflectiveTests(ComputeLibraryCycleTaskTest);
+    defineReflectiveTests(ContainingLibrariesTaskTest);
+    defineReflectiveTests(DartErrorsTaskTest);
+    defineReflectiveTests(EvaluateUnitConstantsTaskTest);
+    defineReflectiveTests(GatherUsedImportedElementsTaskTest);
+    defineReflectiveTests(GatherUsedLocalElementsTaskTest);
+    defineReflectiveTests(GenerateHintsTaskTest);
+    defineReflectiveTests(GenerateLintsTaskTest);
+    defineReflectiveTests(InferInstanceMembersInUnitTaskTest);
+    defineReflectiveTests(InferStaticVariableTypesInUnitTaskTest);
+    defineReflectiveTests(InferStaticVariableTypeTaskTest);
+    defineReflectiveTests(LibraryErrorsReadyTaskTest);
+    defineReflectiveTests(LibraryUnitErrorsTaskTest);
+    defineReflectiveTests(ParseDartTaskTest);
+    defineReflectiveTests(PartiallyResolveUnitReferencesTaskTest);
+    defineReflectiveTests(ReferencedNamesBuilderTest);
+    defineReflectiveTests(ResolveDirectiveElementsTaskTest);
+    defineReflectiveTests(ResolveInstanceFieldsInUnitTaskTest);
+    defineReflectiveTests(ResolveLibraryTaskTest);
+    defineReflectiveTests(ResolveLibraryTypeNamesTaskTest);
+    defineReflectiveTests(ResolveTopLevelUnitTypeBoundsTaskTest);
+    defineReflectiveTests(ResolveUnitTaskTest);
+    defineReflectiveTests(ResolveUnitTypeNamesTaskTest);
+    defineReflectiveTests(ResolveVariableReferencesTaskTest);
+    defineReflectiveTests(ScanDartTaskTest);
+    defineReflectiveTests(StrongModeInferenceTest);
+    defineReflectiveTests(StrongModeVerifyUnitTaskTest);
+    defineReflectiveTests(VerifyUnitTaskTest);
+  });
 }
 
 isInstanceOf isBuildCompilationUnitElementTask =
@@ -796,6 +797,7 @@
   LibraryElement libraryElement;
 
   test_perform() {
+    enableUriInPartOf();
     _performBuildTask({
       '/lib.dart': '''
 library lib;
@@ -806,7 +808,7 @@
 part of lib;
 ''',
       '/part2.dart': '''
-part of lib;
+part of 'lib.dart';
 '''
     });
     expect(outputs, hasLength(3));
@@ -926,10 +928,13 @@
   }
 
   test_perform_invalidUri_part() {
+    String invalidUri = resourceProvider.pathContext.separator == '/'
+        ? '//////////'
+        : '\\\\\\\\\\\\';
     _performBuildTask({
       '/lib.dart': '''
 library lib;
-part '//////////';
+part '$invalidUri';
 '''
     });
     expect(libraryElement.parts, isEmpty);
@@ -3375,7 +3380,9 @@
 
   void _performParseTask(String content) {
     if (content == null) {
-      source = resourceProvider.getFile('/test.dart').createSource();
+      source = resourceProvider
+          .getFile(resourceProvider.convertPath('/test.dart'))
+          .createSource();
     } else {
       source = newSource('/test.dart', content);
     }
@@ -3538,9 +3545,7 @@
 class ReferencedNamesBuilderTest extends _AbstractDartTaskTest {
   void setUp() {
     super.setUp();
-    context.analysisOptions = new AnalysisOptionsImpl()
-      ..enableGenericMethods = true
-      ..strongMode = true;
+    context.analysisOptions = new AnalysisOptionsImpl()..strongMode = true;
   }
 
   test_class_constructor() {
@@ -5370,7 +5375,7 @@
 
     var errors = errorListener.errors;
     expect(errors.length, 1);
-    expect(errors[0].errorCode.name, "STRONG_MODE_STATIC_TYPE_ERROR");
+    expect(errors[0].errorCode.name, "STRONG_MODE_INVALID_CAST_NEW_EXPR");
   }
 }
 
@@ -5644,6 +5649,16 @@
     context.analysisOptions = options;
   }
 
+  /**
+   * Enable the use of URIs in part-of directives in the current analysis
+   * context.
+   */
+  void enableUriInPartOf() {
+    AnalysisOptionsImpl options = context.analysisOptions;
+    options.enableUriInPartOf = true;
+    context.analysisOptions = options;
+  }
+
   void setUp() {
     super.setUp();
     emptySource = newSource('/test.dart');
diff --git a/pkg/analyzer/test/src/task/dart_work_manager_test.dart b/pkg/analyzer/test/src/task/dart_work_manager_test.dart
index 12388d0..feb7238 100644
--- a/pkg/analyzer/test/src/task/dart_work_manager_test.dart
+++ b/pkg/analyzer/test/src/task/dart_work_manager_test.dart
@@ -12,27 +12,29 @@
 import 'package:analyzer/src/generated/engine.dart'
     show
         AnalysisErrorInfoImpl,
+        AnalysisOptions,
+        AnalysisOptionsImpl,
         CacheState,
         ChangeNoticeImpl,
         InternalAnalysisContext;
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/source.dart';
-import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
 import 'package:analyzer/src/task/dart.dart';
 import 'package:analyzer/src/task/dart_work_manager.dart';
 import 'package:analyzer/task/dart.dart';
 import 'package:analyzer/task/general.dart';
 import 'package:analyzer/task/model.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:typed_mock/typed_mock.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../generated/test_support.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(DartWorkManagerTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(DartWorkManagerTest);
+  });
 }
 
 @reflectiveTest
@@ -529,7 +531,7 @@
   void test_onAnalysisOptionsChanged() {
     when(context.exists(anyObject)).thenReturn(true);
     // set cache values
-    entry1.setValue(PARSED_UNIT, AstFactory.compilationUnit(), []);
+    entry1.setValue(PARSED_UNIT, AstTestFactory.compilationUnit(), []);
     entry1.setValue(IMPORTED_LIBRARIES, <Source>[], []);
     entry1.setValue(EXPLICITLY_IMPORTED_LIBRARIES, <Source>[], []);
     entry1.setValue(EXPORTED_LIBRARIES, <Source>[], []);
@@ -573,7 +575,7 @@
   void test_onSourceFactoryChanged() {
     when(context.exists(anyObject)).thenReturn(true);
     // set cache values
-    entry1.setValue(PARSED_UNIT, AstFactory.compilationUnit(), []);
+    entry1.setValue(PARSED_UNIT, AstTestFactory.compilationUnit(), []);
     entry1.setValue(IMPORTED_LIBRARIES, <Source>[], []);
     entry1.setValue(EXPLICITLY_IMPORTED_LIBRARIES, <Source>[], []);
     entry1.setValue(EXPORTED_LIBRARIES, <Source>[], []);
@@ -617,7 +619,7 @@
         .setValue(VERIFY_ERRORS, <AnalysisError>[error2], []);
     // RESOLVED_UNIT is ready, set errors
     manager.resultsComputed(
-        unitTarget, {RESOLVED_UNIT: AstFactory.compilationUnit()});
+        unitTarget, {RESOLVED_UNIT: AstTestFactory.compilationUnit()});
     // all of the errors are included
     ChangeNoticeImpl notice = context.getNotice(source1);
     expect(notice.errors, unorderedEquals([error1, error2]));
@@ -637,8 +639,8 @@
     entry1.setValue(SCAN_ERRORS, <AnalysisError>[error1], []);
     entry1.setValue(PARSE_ERRORS, <AnalysisError>[error2], []);
     // PARSED_UNIT is ready, set errors
-    manager
-        .resultsComputed(source1, {PARSED_UNIT: AstFactory.compilationUnit()});
+    manager.resultsComputed(
+        source1, {PARSED_UNIT: AstTestFactory.compilationUnit()});
     // all of the errors are included
     ChangeNoticeImpl notice = context.getNotice(source1);
     expect(notice.errors, unorderedEquals([error1, error2]));
@@ -722,7 +724,7 @@
     when(context.getErrors(source1))
         .thenReturn(new AnalysisErrorInfoImpl([], lineInfo));
     entry1.setValue(LINE_INFO, lineInfo, []);
-    CompilationUnit unit = AstFactory.compilationUnit();
+    CompilationUnit unit = AstTestFactory.compilationUnit();
     manager.resultsComputed(source1, {PARSED_UNIT: unit});
     ChangeNoticeImpl notice = context.getNotice(source1);
     expect(notice.parsedDartUnit, unit);
@@ -736,7 +738,7 @@
     when(context.getErrors(source2))
         .thenReturn(new AnalysisErrorInfoImpl([], lineInfo));
     entry2.setValue(LINE_INFO, lineInfo, []);
-    CompilationUnit unit = AstFactory.compilationUnit();
+    CompilationUnit unit = AstTestFactory.compilationUnit();
     manager.resultsComputed(
         new LibrarySpecificUnit(source1, source2), {RESOLVED_UNIT: unit});
     ChangeNoticeImpl notice = context.getNotice(source2);
@@ -827,6 +829,9 @@
   Map<Source, ChangeNoticeImpl> _pendingNotices = <Source, ChangeNoticeImpl>{};
 
   @override
+  final AnalysisOptions analysisOptions = new AnalysisOptionsImpl();
+
+  @override
   final ReentrantSynchronousStream<InvalidatedResult> onResultInvalidated =
       new ReentrantSynchronousStream<InvalidatedResult>();
 
diff --git a/pkg/analyzer/test/src/task/driver_test.dart b/pkg/analyzer/test/src/task/driver_test.dart
index 35ff657..99be5d5 100644
--- a/pkg/analyzer/test/src/task/driver_test.dart
+++ b/pkg/analyzer/test/src/task/driver_test.dart
@@ -11,20 +11,20 @@
 import 'package:analyzer/src/task/inputs.dart';
 import 'package:analyzer/src/task/manager.dart';
 import 'package:analyzer/task/model.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:typed_mock/typed_mock.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../generated/test_support.dart';
-import '../../utils.dart';
 import 'test_support.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AnalysisDriverTest);
-  defineReflectiveTests(CycleAwareDependencyWalkerTest);
-  defineReflectiveTests(WorkItemTest);
-  defineReflectiveTests(WorkOrderTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisDriverTest);
+    defineReflectiveTests(CycleAwareDependencyWalkerTest);
+    defineReflectiveTests(WorkItemTest);
+    defineReflectiveTests(WorkOrderTest);
+  });
 }
 
 class AbstractDriverTest {
diff --git a/pkg/analyzer/test/src/task/general_test.dart b/pkg/analyzer/test/src/task/general_test.dart
index fc1f789..819a3af 100644
--- a/pkg/analyzer/test/src/task/general_test.dart
+++ b/pkg/analyzer/test/src/task/general_test.dart
@@ -9,16 +9,16 @@
 import 'package:analyzer/src/task/general.dart';
 import 'package:analyzer/task/general.dart';
 import 'package:analyzer/task/model.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:typed_mock/typed_mock.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../generated/test_support.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(GetContentTaskTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(GetContentTaskTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/src/task/html_test.dart b/pkg/analyzer/test/src/task/html_test.dart
index 78fee27..c2e652b 100644
--- a/pkg/analyzer/test/src/task/html_test.dart
+++ b/pkg/analyzer/test/src/task/html_test.dart
@@ -10,17 +10,17 @@
 import 'package:analyzer/task/html.dart';
 import 'package:analyzer/task/model.dart';
 import 'package:html/dom.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../context/abstract_context.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(DartScriptsTaskTest);
-  defineReflectiveTests(HtmlErrorsTaskTest);
-  defineReflectiveTests(ParseHtmlTaskTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(DartScriptsTaskTest);
+    defineReflectiveTests(HtmlErrorsTaskTest);
+    defineReflectiveTests(ParseHtmlTaskTest);
+  });
 }
 
 isInstanceOf isDartScriptsTask = new isInstanceOf<DartScriptsTask>();
diff --git a/pkg/analyzer/test/src/task/html_work_manager_test.dart b/pkg/analyzer/test/src/task/html_work_manager_test.dart
index 55698a0..f4e9e70 100644
--- a/pkg/analyzer/test/src/task/html_work_manager_test.dart
+++ b/pkg/analyzer/test/src/task/html_work_manager_test.dart
@@ -7,6 +7,7 @@
 import 'package:analyzer/error/error.dart' show AnalysisError;
 import 'package:analyzer/exception/exception.dart';
 import 'package:analyzer/src/context/cache.dart';
+import 'package:analyzer/src/context/context.dart';
 import 'package:analyzer/src/error/codes.dart' show HtmlErrorCode;
 import 'package:analyzer/src/generated/engine.dart'
     show
@@ -23,16 +24,17 @@
 import 'package:analyzer/task/general.dart';
 import 'package:analyzer/task/html.dart';
 import 'package:analyzer/task/model.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:typed_mock/typed_mock.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../generated/test_support.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(HtmlWorkManagerTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(HtmlWorkManagerTest);
+    defineReflectiveTests(HtmlWorkManagerIntegrationTest);
+  });
 }
 
 @reflectiveTest
@@ -303,6 +305,53 @@
   }
 }
 
+@reflectiveTest
+class HtmlWorkManagerIntegrationTest {
+  InternalAnalysisContext context = new AnalysisContextImpl();
+  HtmlWorkManager manager;
+
+  Source source1 = new TestSource('1.html');
+  Source source2 = new TestSource('2.html');
+  CacheEntry entry1;
+  CacheEntry entry2;
+
+  void expect_sourceQueue(List<Source> sources) {
+    expect(manager.sourceQueue, unorderedEquals(sources));
+  }
+
+  void setUp() {
+    manager = new HtmlWorkManager(context);
+    entry1 = context.getCacheEntry(source1);
+    entry2 = context.getCacheEntry(source2);
+  }
+
+  void test_onResultInvalidated_scheduleInvalidatedLibrariesAfterSetSourceFactory() {
+    // Change the source factory, changing the analysis cache from when
+    // the work manager was constructed. This used to create a failure
+    // case for test_onResultInvalidated_scheduleInvalidLibraries so its
+    // tested here.
+    context.sourceFactory = new _SourceFactoryMock();
+
+    // now just do the same checks as
+    // test_onResultInvalidated_scheduleInvalidLibraries
+
+    // set HTML_ERRORS for source1 and source2
+    entry1.setValue(HTML_ERRORS, [], []);
+    entry2.setValue(HTML_ERRORS, [], []);
+    // invalidate HTML_ERRORS for source1, schedule it
+    entry1.setState(HTML_ERRORS, CacheState.INVALID);
+    expect_sourceQueue([source1]);
+    // invalidate HTML_ERRORS for source2, schedule it
+    entry2.setState(HTML_ERRORS, CacheState.INVALID);
+    expect_sourceQueue([source1, source2]);
+  }
+
+}
+
+class _SourceFactoryMock extends TypedMock
+    implements SourceFactory {
+}
+
 class _InternalAnalysisContextMock extends TypedMock
     implements InternalAnalysisContext {
   @override
@@ -311,6 +360,12 @@
   @override
   AnalysisCache analysisCache;
 
+  // The production version is a stream that carries messages from the cache
+  // since the cache changes. Here, we can just pass the inner stream because
+  // it doesn't change.
+  @override
+  get onResultInvalidated => analysisCache.onResultInvalidated;
+
   Map<Source, ChangeNoticeImpl> _pendingNotices = <Source, ChangeNoticeImpl>{};
 
   _InternalAnalysisContextMock() {
diff --git a/pkg/analyzer/test/src/task/incremental_element_builder_test.dart b/pkg/analyzer/test/src/task/incremental_element_builder_test.dart
index b5765eb..05c7a76 100644
--- a/pkg/analyzer/test/src/task/incremental_element_builder_test.dart
+++ b/pkg/analyzer/test/src/task/incremental_element_builder_test.dart
@@ -14,15 +14,15 @@
 import 'package:analyzer/src/task/dart.dart';
 import 'package:analyzer/src/task/incremental_element_builder.dart';
 import 'package:analyzer/task/dart.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../context/abstract_context.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(IncrementalCompilationUnitElementBuilderTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(IncrementalCompilationUnitElementBuilderTest);
+  });
 }
 
 @reflectiveTest
@@ -97,7 +97,7 @@
     expect(newConstructorElement.name, 'a');
     // classElement.constructors
     ClassElement classElement = helper.element;
-    expect(classElement.constructors, unorderedEquals([newConstructorElement]));
+    expect(classElement.constructors, [newConstructorElement]);
     // verify delta
     expect(helper.delta.hasUnnamedConstructorChange, isTrue);
     expect(helper.delta.addedConstructors,
@@ -231,7 +231,7 @@
     expect(elementB.name, 'b');
     // classElement.constructors
     ClassElement classElement = helper.element;
-    expect(classElement.constructors, unorderedEquals([elementA, elementB]));
+    expect(classElement.constructors, [elementA, elementB]);
     // verify delta
     expect(helper.delta.addedConstructors, unorderedEquals([elementB]));
     expect(helper.delta.removedConstructors, unorderedEquals([]));
@@ -267,7 +267,7 @@
     expect(elementB.name, 'b');
     // classElement.constructors
     ClassElement classElement = helper.element;
-    expect(classElement.constructors, unorderedEquals([elementB]));
+    expect(classElement.constructors, [elementB]);
     // verify delta
     expect(helper.delta.addedConstructors, unorderedEquals([]));
     expect(helper.delta.removedConstructors, unorderedEquals([oldElementA]));
@@ -307,7 +307,7 @@
     expect(elementA.name, 'a');
     // classElement.constructors
     ClassElement classElement = helper.element;
-    expect(classElement.constructors, unorderedEquals([elementB, elementA]));
+    expect(classElement.constructors, [elementB, elementA]);
     // verify delta
     expect(helper.delta.addedConstructors, isEmpty);
     expect(helper.delta.removedConstructors, isEmpty);
@@ -463,12 +463,17 @@
     // nodes
     FieldDeclaration nodeA = helper.newMembers[0];
     FieldDeclaration newNodeB = helper.newMembers[1];
+    List<VariableDeclaration> fieldsA = nodeA.fields.variables;
     List<VariableDeclaration> newFieldsB = newNodeB.fields.variables;
     expect(nodeA, same(helper.oldMembers[0]));
     expect(newFieldsB, hasLength(1));
     // elements
+    FieldElement fieldElementA = fieldsA[0].name.staticElement;
     FieldElement newFieldElementB = newFieldsB[0].name.staticElement;
     expect(newFieldElementB.name, 'bbb');
+    // members
+    ClassElement classElement = helper.element;
+    expect(classElement.fields, [fieldElementA, newFieldElementB]);
     // verify delta
     expect(helper.delta.hasAnnotationChanges, isFalse);
     expect(helper.delta.addedConstructors, isEmpty);
@@ -541,17 +546,13 @@
     FieldElement newFieldElement = newFieldNode.name.staticElement;
     PropertyAccessorElement getterElement = getterNode.element;
     expect(newFieldElement.name, '_foo');
-    expect(
-        helper.element.fields,
-        unorderedMatches(
-            [same(newFieldElement), same(getterElement.variable)]));
-    expect(
-        helper.element.accessors,
-        unorderedMatches([
-          same(newFieldElement.getter),
-          same(newFieldElement.setter),
-          same(getterElement)
-        ]));
+    expect(helper.element.fields,
+        [same(newFieldElement), same(getterElement.variable)]);
+    expect(helper.element.accessors, [
+      same(newFieldElement.getter),
+      same(newFieldElement.setter),
+      same(getterElement)
+    ]);
     // verify delta
     expect(helper.delta.addedConstructors, isEmpty);
     expect(helper.delta.removedConstructors, isEmpty);
@@ -589,6 +590,7 @@
     expect(elementA.name, 'aaa');
     expect(newElementB, isNotNull);
     expect(newElementB.name, 'bbb');
+    expect(helper.element.accessors, [elementA, newElementB]);
     // verify delta
     expect(helper.delta.addedConstructors, isEmpty);
     expect(helper.delta.removedConstructors, isEmpty);
@@ -657,6 +659,7 @@
     expect(elementA.name, 'aaa');
     expect(newElementB, isNotNull);
     expect(newElementB.name, 'bbb');
+    expect(helper.element.methods, [elementA, newElementB]);
     // verify delta
     expect(helper.delta.addedConstructors, isEmpty);
     expect(helper.delta.removedConstructors, isEmpty);
@@ -698,6 +701,7 @@
     expect(newElementA.parameters, hasLength(1));
     expect(elementB, isNotNull);
     expect(elementB.name, 'bbb');
+    expect(helper.element.methods, [newElementA, elementB]);
     // verify delta
     expect(helper.delta.addedConstructors, isEmpty);
     expect(helper.delta.removedConstructors, isEmpty);
@@ -707,6 +711,43 @@
     expect(helper.delta.removedMethods, unorderedEquals([oldElementA]));
   }
 
+  test_classDelta_method_async_addStar() {
+    var helper = new _ClassDeltaHelper('A');
+    _buildOldUnit(r'''
+class A {
+  Stream test() async {}
+}
+''');
+    helper.initOld(oldUnit);
+    _buildNewUnit(r'''
+class A {
+  Stream test() async* {}
+}
+''');
+    helper.initNew(newUnit, unitDelta);
+    // nodes
+    ClassMember oldNodeA = helper.oldMembers[0];
+    ClassMember newNodeA = helper.newMembers[0];
+    expect(newNodeA, isNot(same(oldNodeA)));
+    // elements
+    MethodElement oldElement = oldNodeA.element;
+    MethodElement newElement = newNodeA.element;
+    expect(newElement, isNotNull);
+    expect(newElement.name, 'test');
+    expect(oldElement.isAsynchronous, isTrue);
+    expect(oldElement.isGenerator, isFalse);
+    expect(newElement.isAsynchronous, isTrue);
+    expect(newElement.isGenerator, isTrue);
+    expect(helper.element.methods, [newElement]);
+    // verify delta
+    expect(helper.delta.addedConstructors, isEmpty);
+    expect(helper.delta.removedConstructors, isEmpty);
+    expect(helper.delta.addedAccessors, isEmpty);
+    expect(helper.delta.removedAccessors, isEmpty);
+    expect(helper.delta.addedMethods, unorderedEquals([newElement]));
+    expect(helper.delta.removedMethods, unorderedEquals([oldElement]));
+  }
+
   test_classDelta_method_changeName() {
     var helper = new _ClassDeltaHelper('A');
     _buildOldUnit(r'''
@@ -750,6 +791,7 @@
     expect(newElementA.name, 'aaa2');
     expect(elementB, isNotNull);
     expect(elementB.name, 'bbb');
+    expect(helper.element.methods, [newElementA, elementB]);
     // verify delta
     expect(helper.delta.addedConstructors, isEmpty);
     expect(helper.delta.removedConstructors, isEmpty);
@@ -824,6 +866,7 @@
     expect(newElementA.parameters, hasLength(0));
     expect(elementB, isNotNull);
     expect(elementB.name, 'bbb');
+    expect(helper.element.methods, [newElementA, elementB]);
     // verify delta
     expect(helper.delta.addedConstructors, isEmpty);
     expect(helper.delta.removedConstructors, isEmpty);
@@ -833,6 +876,48 @@
     expect(helper.delta.removedMethods, unorderedEquals([oldElementA]));
   }
 
+  test_classDelta_newOrder() {
+    var helper = new _ClassDeltaHelper('A');
+    _buildOldUnit(r'''
+class A {
+  bbb() {}
+}
+''');
+    helper.initOld(oldUnit);
+    _buildNewUnit(r'''
+class A {
+  aaa() {}
+  bbb() {}
+  ccc() {}
+}
+''');
+    helper.initNew(newUnit, unitDelta);
+    // nodes
+    ClassMember newNodeA = helper.newMembers[0];
+    ClassMember nodeB = helper.oldMembers[0];
+    ClassMember newNodeC = helper.newMembers[2];
+    expect(nodeB, same(helper.oldMembers[0]));
+    // elements
+    MethodElement newElementA = newNodeA.element;
+    MethodElement elementB = nodeB.element;
+    MethodElement newElementC = newNodeC.element;
+    expect(newElementA, isNotNull);
+    expect(newElementA.name, 'aaa');
+    expect(elementB, isNotNull);
+    expect(elementB.name, 'bbb');
+    expect(newElementC, isNotNull);
+    expect(newElementC.name, 'ccc');
+    expect(helper.element.methods, [newElementA, elementB, newElementC]);
+    // verify delta
+    expect(helper.delta.addedConstructors, isEmpty);
+    expect(helper.delta.removedConstructors, isEmpty);
+    expect(helper.delta.addedAccessors, isEmpty);
+    expect(helper.delta.removedAccessors, isEmpty);
+    expect(
+        helper.delta.addedMethods, unorderedEquals([newElementA, newElementC]));
+    expect(helper.delta.removedMethods, isEmpty);
+  }
+
   test_classDelta_null_abstractKeyword_add() {
     _verifyNoClassDeltaForTheLast(
         r'''
@@ -1027,6 +1112,7 @@
     expect(elementA.name, 'aaa=');
     expect(newElementB, isNotNull);
     expect(newElementB.name, 'bbb=');
+    expect(helper.element.accessors, [elementA, newElementB]);
     // verify delta
     expect(helper.delta.addedConstructors, isEmpty);
     expect(helper.delta.removedConstructors, isEmpty);
@@ -1374,9 +1460,9 @@
     expect(elementA.name, 'a');
     expect(elementB.name, 'b');
     // unit.types
-    expect(unitElement.topLevelVariables,
-        unorderedEquals([elementA.variable, elementB.variable]));
-    expect(unitElement.accessors, unorderedEquals([elementA, elementB]));
+    expect(
+        unitElement.topLevelVariables, [elementA.variable, elementB.variable]);
+    expect(unitElement.accessors, [elementA, elementB]);
   }
 
   test_unitMembers_class_add() {
@@ -1401,7 +1487,7 @@
     expect(elementA.name, 'A');
     expect(elementB.name, 'B');
     // unit.types
-    expect(unitElement.types, unorderedEquals([elementA, elementB]));
+    expect(unitElement.types, [elementA, elementB]);
     // verify delta
     expect(unitDelta.addedDeclarations, unorderedEquals([elementB]));
     expect(unitDelta.removedDeclarations, unorderedEquals([]));
@@ -1512,7 +1598,7 @@
     expect(elementA.name, 'A');
     expect(elementB.name, 'B');
     // unit.types
-    expect(unitElement.types, unorderedEquals([elementA]));
+    expect(unitElement.types, [elementA]);
     // verify delta
     expect(unitDelta.addedDeclarations, unorderedEquals([]));
     expect(unitDelta.removedDeclarations, unorderedEquals([elementB]));
@@ -1593,7 +1679,7 @@
     expect(elementB.accessors.map((a) => a.name),
         unorderedEquals(['index', 'values', 'B1', 'B2']));
     // unit.types
-    expect(unitElement.enums, unorderedEquals([elementA, elementB]));
+    expect(unitElement.enums, [elementA, elementB]);
     // verify delta
     expect(unitDelta.addedDeclarations, unorderedEquals([elementB]));
     expect(unitDelta.removedDeclarations, unorderedEquals([]));
@@ -1621,7 +1707,7 @@
     expect(elementA.name, 'a');
     expect(elementB.name, 'b');
     // unit.types
-    expect(unitElement.functions, unorderedEquals([elementA, elementB]));
+    expect(unitElement.functions, [elementA, elementB]);
     // verify delta
     expect(unitDelta.addedDeclarations, unorderedEquals([elementB]));
     expect(unitDelta.removedDeclarations, unorderedEquals([]));
@@ -1649,13 +1735,50 @@
     expect(elementA.name, 'A');
     expect(elementB.name, 'B');
     // unit.types
-    expect(
-        unitElement.functionTypeAliases, unorderedEquals([elementA, elementB]));
+    expect(unitElement.functionTypeAliases, [elementA, elementB]);
     // verify delta
     expect(unitDelta.addedDeclarations, unorderedEquals([elementB]));
     expect(unitDelta.removedDeclarations, unorderedEquals([]));
   }
 
+  test_unitMembers_newOrder() {
+    _buildOldUnit(r'''
+int b;
+''');
+    List<CompilationUnitMember> oldNodes = oldUnit.declarations.toList();
+    _buildNewUnit(r'''
+int a;
+int b;
+int c;
+''');
+    List<CompilationUnitMember> newNodes = newUnit.declarations;
+    // nodes
+    TopLevelVariableDeclaration node1 = newNodes[0];
+    TopLevelVariableDeclaration node2 = newNodes[1];
+    TopLevelVariableDeclaration node3 = newNodes[2];
+    expect(node2, same(oldNodes[0]));
+    // elements
+    TopLevelVariableElement elementA = node1.variables.variables[0].element;
+    TopLevelVariableElement elementB = node2.variables.variables[0].element;
+    TopLevelVariableElement elementC = node3.variables.variables[0].element;
+    expect(elementA, isNotNull);
+    expect(elementB, isNotNull);
+    expect(elementC, isNotNull);
+    expect(elementA.name, 'a');
+    expect(elementB.name, 'b');
+    expect(elementC.name, 'c');
+    // unit.types
+    expect(unitElement.topLevelVariables, [elementA, elementB, elementC]);
+    expect(unitElement.accessors, [
+      elementA.getter,
+      elementA.setter,
+      elementB.getter,
+      elementB.setter,
+      elementC.getter,
+      elementC.setter,
+    ]);
+  }
+
   test_unitMembers_topLevelVariable() {
     _buildOldUnit(r'''
 bool a = 1, b = 2;
@@ -1733,19 +1856,17 @@
     expect(elementD.name, 'd');
     // unit.types
     expect(unitElement.topLevelVariables,
-        unorderedEquals([elementA, elementB, elementC, elementD]));
-    expect(
-        unitElement.accessors,
-        unorderedEquals([
-          elementA.getter,
-          elementA.setter,
-          elementB.getter,
-          elementB.setter,
-          elementC.getter,
-          elementC.setter,
-          elementD.getter,
-          elementD.setter
-        ]));
+        [elementA, elementB, elementC, elementD]);
+    expect(unitElement.accessors, [
+      elementA.getter,
+      elementA.setter,
+      elementB.getter,
+      elementB.setter,
+      elementC.getter,
+      elementC.setter,
+      elementD.getter,
+      elementD.setter
+    ]);
   }
 
   test_unitMembers_topLevelVariable_final() {
diff --git a/pkg/analyzer/test/src/task/inputs_test.dart b/pkg/analyzer/test/src/task/inputs_test.dart
index 33bcbee..e2bd0fa 100644
--- a/pkg/analyzer/test/src/task/inputs_test.dart
+++ b/pkg/analyzer/test/src/task/inputs_test.dart
@@ -7,26 +7,26 @@
 import 'package:analyzer/src/task/inputs.dart';
 import 'package:analyzer/src/task/model.dart';
 import 'package:analyzer/task/model.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../generated/test_support.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ConstantTaskInputBuilderTest);
-  defineReflectiveTests(ConstantTaskInputTest);
-  defineReflectiveTests(ListTaskInputImplTest);
-  defineReflectiveTests(ListToListTaskInputTest);
-  defineReflectiveTests(ListToListTaskInputBuilderTest);
-  defineReflectiveTests(ListToMapTaskInputBuilderTest);
-  defineReflectiveTests(ListToMapTaskInputTest);
-  defineReflectiveTests(ObjectToListTaskInputBuilderTest);
-  defineReflectiveTests(ObjectToListTaskInputTest);
-  defineReflectiveTests(SimpleTaskInputTest);
-  defineReflectiveTests(SimpleTaskInputBuilderTest);
-  defineReflectiveTests(TopLevelTaskInputBuilderTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ConstantTaskInputBuilderTest);
+    defineReflectiveTests(ConstantTaskInputTest);
+    defineReflectiveTests(ListTaskInputImplTest);
+    defineReflectiveTests(ListToListTaskInputTest);
+    defineReflectiveTests(ListToListTaskInputBuilderTest);
+    defineReflectiveTests(ListToMapTaskInputBuilderTest);
+    defineReflectiveTests(ListToMapTaskInputTest);
+    defineReflectiveTests(ObjectToListTaskInputBuilderTest);
+    defineReflectiveTests(ObjectToListTaskInputTest);
+    defineReflectiveTests(SimpleTaskInputTest);
+    defineReflectiveTests(SimpleTaskInputBuilderTest);
+    defineReflectiveTests(TopLevelTaskInputBuilderTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/src/task/manager_test.dart b/pkg/analyzer/test/src/task/manager_test.dart
index cc35b85..3a406b0 100644
--- a/pkg/analyzer/test/src/task/manager_test.dart
+++ b/pkg/analyzer/test/src/task/manager_test.dart
@@ -7,15 +7,15 @@
 import 'package:analyzer/exception/exception.dart';
 import 'package:analyzer/src/task/manager.dart';
 import 'package:analyzer/task/model.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../generated/test_support.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(TaskManagerTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(TaskManagerTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/src/task/model_test.dart b/pkg/analyzer/test/src/task/model_test.dart
index edc8f28..e698152 100644
--- a/pkg/analyzer/test/src/task/model_test.dart
+++ b/pkg/analyzer/test/src/task/model_test.dart
@@ -4,23 +4,23 @@
 
 library analyzer.test.src.task.model_test;
 
-import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/exception/exception.dart';
+import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/task/model.dart';
 import 'package:analyzer/task/model.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../generated/test_support.dart';
-import '../../utils.dart';
 import 'test_support.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AnalysisTaskTest);
-  defineReflectiveTests(ResultDescriptorImplTest);
-  defineReflectiveTests(SimpleResultCachingPolicyTest);
-  defineReflectiveTests(TaskDescriptorImplTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisTaskTest);
+    defineReflectiveTests(ResultDescriptorImplTest);
+    defineReflectiveTests(SimpleResultCachingPolicyTest);
+    defineReflectiveTests(TaskDescriptorImplTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/src/task/options_test.dart b/pkg/analyzer/test/src/task/options_test.dart
index 8e50dc0..b8f717a 100644
--- a/pkg/analyzer/test/src/task/options_test.dart
+++ b/pkg/analyzer/test/src/task/options_test.dart
@@ -7,28 +7,25 @@
 import 'package:analyzer/analyzer.dart';
 import 'package:analyzer/source/analysis_options_provider.dart';
 import 'package:analyzer/source/error_processor.dart';
-import 'package:analyzer/src/context/context.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source.dart';
-import 'package:analyzer/src/task/options.dart'
-    show CONFIGURED_ERROR_PROCESSORS;
 import 'package:analyzer/src/task/options.dart';
 import 'package:analyzer/task/general.dart';
 import 'package:analyzer/task/model.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 import 'package:yaml/yaml.dart';
 
 import '../../generated/test_support.dart';
-import '../../utils.dart';
 import '../context/abstract_context.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ContextConfigurationTest);
-  defineReflectiveTests(GenerateNewOptionsErrorsTaskTest);
-  defineReflectiveTests(GenerateOldOptionsErrorsTaskTest);
-  defineReflectiveTests(OptionsFileValidatorTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ContextConfigurationTest);
+    defineReflectiveTests(GenerateNewOptionsErrorsTaskTest);
+    defineReflectiveTests(GenerateOldOptionsErrorsTaskTest);
+    defineReflectiveTests(OptionsFileValidatorTest);
+  });
 }
 
 isInstanceOf isGenerateOptionsErrorsTask =
@@ -54,14 +51,14 @@
     expect(analysisOptions.strongMode, false);
   }
 
-  test_configure_enableGenericMethods() {
-    expect(analysisOptions.enableGenericMethods, false);
+  test_configure_enableLazyAssignmentOperators() {
+    expect(analysisOptions.enableStrictCallChecks, false);
     configureContext('''
 analyzer:
   language:
-    enableGenericMethods: true
+    enableStrictCallChecks: true
 ''');
-    expect(analysisOptions.enableGenericMethods, true);
+    expect(analysisOptions.enableStrictCallChecks, true);
   }
 
   test_configure_enableStrictCallChecks() {
@@ -90,8 +87,7 @@
     unused_local_variable: error
 ''');
 
-    List<ErrorProcessor> processors =
-        context.getConfigurationData(CONFIGURED_ERROR_PROCESSORS);
+    List<ErrorProcessor> processors = context.analysisOptions.errorProcessors;
     expect(processors, hasLength(2));
 
     var unused_local = new AnalysisError(
@@ -122,7 +118,7 @@
     - 'test/**'
 ''');
 
-    List<String> excludes = context.getConfigurationData(CONTEXT_EXCLUDES);
+    List<String> excludes = context.analysisOptions.excludePatterns;
     expect(excludes, unorderedEquals(['foo/bar.dart', 'test/**']));
   }
 
@@ -226,6 +222,79 @@
     expect(errors[0].errorCode, AnalysisOptionsErrorCode.PARSE_ERROR);
   }
 
+  test_perform_include() {
+    newSource('/other_options.yaml', '');
+    String code = r'''
+include: other_options.yaml
+''';
+    AnalysisTarget target = newSource(optionsFilePath, code);
+    computeResult(target, ANALYSIS_OPTIONS_ERRORS);
+    expect(task, isGenerateOptionsErrorsTask);
+    List<AnalysisError> errors =
+        outputs[ANALYSIS_OPTIONS_ERRORS] as List<AnalysisError>;
+    expect(errors, hasLength(0));
+  }
+
+  test_perform_include_bad_value() {
+    newSource(
+        '/other_options.yaml',
+        '''
+analyzer:
+  errors:
+    unused_local_variable: ftw
+''');
+    String code = r'''
+include: other_options.yaml
+''';
+    AnalysisTarget target = newSource(optionsFilePath, code);
+    computeResult(target, ANALYSIS_OPTIONS_ERRORS);
+    expect(task, isGenerateOptionsErrorsTask);
+    List<AnalysisError> errors =
+        outputs[ANALYSIS_OPTIONS_ERRORS] as List<AnalysisError>;
+    expect(errors, hasLength(1));
+    AnalysisError error = errors[0];
+    expect(error.errorCode, AnalysisOptionsWarningCode.INCLUDED_FILE_WARNING);
+    expect(error.source, target.source);
+    expect(error.offset, 10);
+    expect(error.length, 18);
+    expect(error.message, contains('other_options.yaml(47..49)'));
+  }
+
+  test_perform_include_bad_yaml() {
+    newSource('/other_options.yaml', ':');
+    String code = r'''
+include: other_options.yaml
+''';
+    AnalysisTarget target = newSource(optionsFilePath, code);
+    computeResult(target, ANALYSIS_OPTIONS_ERRORS);
+    expect(task, isGenerateOptionsErrorsTask);
+    List<AnalysisError> errors =
+        outputs[ANALYSIS_OPTIONS_ERRORS] as List<AnalysisError>;
+    expect(errors, hasLength(1));
+    AnalysisError error = errors[0];
+    expect(error.errorCode, AnalysisOptionsErrorCode.INCLUDED_FILE_PARSE_ERROR);
+    expect(error.source, target.source);
+    expect(error.offset, 10);
+    expect(error.length, 18);
+    expect(error.message, contains('other_options.yaml(0..0)'));
+  }
+
+  test_perform_include_missing() {
+    String code = r'''
+include: other_options.yaml
+''';
+    AnalysisTarget target = newSource(optionsFilePath, code);
+    computeResult(target, ANALYSIS_OPTIONS_ERRORS);
+    expect(task, isGenerateOptionsErrorsTask);
+    List<AnalysisError> errors =
+        outputs[ANALYSIS_OPTIONS_ERRORS] as List<AnalysisError>;
+    expect(errors, hasLength(1));
+    AnalysisError error = errors[0];
+    expect(error.errorCode, AnalysisOptionsWarningCode.INCLUDE_FILE_NOT_FOUND);
+    expect(error.offset, 10);
+    expect(error.length, 18);
+  }
+
   test_perform_OK() {
     String code = r'''
 analyzer:
@@ -254,10 +323,6 @@
     expect(errors, hasLength(1));
     expect(errors[0].errorCode,
         AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUES);
-    expect(
-        errors[0].message,
-        "The option 'not_supported' is not supported by analyzer, supported "
-        "values are 'errors', 'exclude', 'language', 'plugins' and 'strong-mode'");
   }
 }
 
diff --git a/pkg/analyzer/test/src/task/options_work_manager_test.dart b/pkg/analyzer/test/src/task/options_work_manager_test.dart
index d52286b..5c8712e 100644
--- a/pkg/analyzer/test/src/task/options_work_manager_test.dart
+++ b/pkg/analyzer/test/src/task/options_work_manager_test.dart
@@ -22,17 +22,17 @@
 import 'package:analyzer/task/dart.dart';
 import 'package:analyzer/task/general.dart';
 import 'package:analyzer/task/model.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:typed_mock/typed_mock.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../generated/test_support.dart';
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(OptionsWorkManagerNewFileTest);
-  defineReflectiveTests(OptionsWorkManagerOldFileTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(OptionsWorkManagerNewFileTest);
+    defineReflectiveTests(OptionsWorkManagerOldFileTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/src/task/strong/checker_test.dart b/pkg/analyzer/test/src/task/strong/checker_test.dart
index 9013f21..6c22865 100644
--- a/pkg/analyzer/test/src/task/strong/checker_test.dart
+++ b/pkg/analyzer/test/src/task/strong/checker_test.dart
@@ -9,12 +9,34 @@
 import 'strong_test_helper.dart';
 
 void main() {
-  initStrongModeTests();
-  defineReflectiveTests(CheckerTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(CheckerTest);
+  });
+}
+
+void _addMetaLibrary() {
+  addFile(
+      r'''
+library meta;
+class _Checked { const _Checked(); }
+const Object checked = const _Checked();
+
+class _Virtual { const _Virtual(); }
+const Object virtual = const _Virtual();
+    ''',
+      name: '/meta.dart');
 }
 
 @reflectiveTest
 class CheckerTest {
+  void setUp() {
+    doSetUp();
+  }
+
+  void tearDown() {
+    doTearDown();
+  }
+
   void test_awaitForInCastsStreamElementToVariable() {
     checkFile('''
 import 'dart:async';
@@ -239,6 +261,20 @@
 ''');
   }
 
+  void test_compoundAssignment_returnsDynamic() {
+    checkFile(r'''
+class Foo {
+  operator +(other) => null;
+}
+
+main() {
+  var foo = new Foo();
+  foo = /*info:DYNAMIC_CAST*/foo + 1;
+  /*info:DYNAMIC_CAST*/foo += 1;
+}
+    ''');
+  }
+
   void test_compoundAssignments() {
     checkFile('''
 class A {
@@ -380,20 +416,6 @@
     ''');
   }
 
-  void test_compoundAssignment_returnsDynamic() {
-    checkFile(r'''
-class Foo {
-  operator +(other) => null;
-}
-
-main() {
-  var foo = new Foo();
-  foo = /*info:DYNAMIC_CAST*/foo + 1;
-  /*info:DYNAMIC_CAST*/foo += 1;
-}
-    ''');
-  }
-
   void test_constructorInvalid() {
     // Regression test for https://github.com/dart-lang/sdk/issues/26695
     checkFile('''
@@ -701,7 +723,7 @@
 
 void main() {
   Cat c = /*info:ASSIGNMENT_CAST*/new Animal.cat();
-  c = /*error:STATIC_TYPE_ERROR*/new Animal();
+  c = /*error:INVALID_CAST_NEW_EXPR*/new Animal();
 }''');
   }
 
@@ -966,7 +988,7 @@
 
 baz1() async* { yield* /*info:DYNAMIC_CAST*/x; }
 Stream baz2() async* { yield* /*info:DYNAMIC_CAST*/x; }
-Stream<int> baz3() async* { yield* /*warning:DOWN_CAST_COMPOSITE*/x; }
+Stream<int> baz3() async* { yield* /*info:DYNAMIC_CAST*/x; }
 Stream<int> baz4() async* { yield* new Stream<int>(); }
 Stream<int> baz5() async* { yield* /*info:INFERRED_TYPE_ALLOCATION*/new Stream(); }
 ''');
@@ -983,7 +1005,7 @@
 
 baz1() sync* { yield* /*info:DYNAMIC_CAST*/x; }
 Iterable baz2() sync* { yield* /*info:DYNAMIC_CAST*/x; }
-Iterable<int> baz3() sync* { yield* /*warning:DOWN_CAST_COMPOSITE*/x; }
+Iterable<int> baz3() sync* { yield* /*info:DYNAMIC_CAST*/x; }
 Iterable<int> baz4() sync* { yield* bar3(); }
 Iterable<int> baz5() sync* { yield* /*info:INFERRED_TYPE_ALLOCATION*/new List(); }
 ''');
@@ -1020,23 +1042,23 @@
   }
   {
     Left f;
-    f = /*error:STATIC_TYPE_ERROR*/top;
+    f = /*error:INVALID_CAST_FUNCTION*/top;
     f = left;
     f = /*error:INVALID_ASSIGNMENT*/right;
     f = bot;
   }
   {
     Right f;
-    f = /*error:STATIC_TYPE_ERROR*/top;
+    f = /*error:INVALID_CAST_FUNCTION*/top;
     f = /*error:INVALID_ASSIGNMENT*/left;
     f = right;
     f = bot;
   }
   {
     Bot f;
-    f = /*error:STATIC_TYPE_ERROR*/top;
-    f = /*error:STATIC_TYPE_ERROR*/left;
-    f = /*error:STATIC_TYPE_ERROR*/right;
+    f = /*error:INVALID_CAST_FUNCTION*/top;
+    f = /*error:INVALID_CAST_FUNCTION*/left;
+    f = /*error:INVALID_CAST_FUNCTION*/right;
     f = bot;
   }
 }
@@ -1204,14 +1226,14 @@
     f = topA;
     f = /*error:INVALID_ASSIGNMENT*/topTop;
     f = aa;
-    f = /*error:STATIC_TYPE_ERROR*/aTop; // known function
+    f = /*error:INVALID_CAST_FUNCTION*/aTop; // known function
     f = /*warning:DOWN_CAST_COMPOSITE*/botA;
     f = /*warning:DOWN_CAST_COMPOSITE*/botTop;
     apply/*<AA>*/(
         topA,
         /*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/topTop,
         aa,
-        /*error:STATIC_TYPE_ERROR*/aTop, // known function
+        /*error:INVALID_CAST_FUNCTION*/aTop, // known function
         /*warning:DOWN_CAST_COMPOSITE*/botA,
         /*warning:DOWN_CAST_COMPOSITE*/botTop
                   );
@@ -1219,7 +1241,7 @@
         (dynamic x) => new A(),
         /*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/(dynamic x) => (x as Object),
         (A x) => x,
-        /*error:STATIC_TYPE_ERROR*/(A x) => (/*info:UNNECESSARY_CAST*/x as Object), // known function
+        /*error:INVALID_CAST_FUNCTION_EXPR*/(A x) => (/*info:UNNECESSARY_CAST*/x as Object), // known function
         /*warning:DOWN_CAST_COMPOSITE*/botA,
         /*warning:DOWN_CAST_COMPOSITE*/botTop
                   );
@@ -1229,14 +1251,14 @@
     f = topA;
     f = topTop;
     f = /*error:INVALID_ASSIGNMENT*/aa;
-    f = /*error:STATIC_TYPE_ERROR*/aTop; // known function
+    f = /*error:INVALID_CAST_FUNCTION*/aTop; // known function
     f = /*error:INVALID_ASSIGNMENT*/botA;
     f = /*warning:DOWN_CAST_COMPOSITE*/botTop;
     apply/*<TopTop>*/(
         topA,
         topTop,
         /*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/aa,
-        /*error:STATIC_TYPE_ERROR*/aTop, // known function
+        /*error:INVALID_CAST_FUNCTION*/aTop, // known function
         /*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/botA,
         /*warning:DOWN_CAST_COMPOSITE*/botTop
                       );
@@ -1244,7 +1266,7 @@
         (dynamic x) => new A(),
         (dynamic x) => (x as Object),
         /*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/(A x) => x,
-        /*error:STATIC_TYPE_ERROR*/(A x) => (/*info:UNNECESSARY_CAST*/x as Object), // known function
+        /*error:INVALID_CAST_FUNCTION_EXPR*/(A x) => (/*info:UNNECESSARY_CAST*/x as Object), // known function
         /*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/botA,
         /*warning:DOWN_CAST_COMPOSITE*/botTop
                       );
@@ -1252,24 +1274,24 @@
   {
     TopA f;
     f = topA;
-    f = /*error:STATIC_TYPE_ERROR*/topTop; // known function
-    f = /*error:STATIC_TYPE_ERROR*/aa; // known function
-    f = /*error:STATIC_TYPE_ERROR*/aTop; // known function
+    f = /*error:INVALID_CAST_FUNCTION*/topTop; // known function
+    f = /*error:INVALID_CAST_FUNCTION*/aa; // known function
+    f = /*error:INVALID_CAST_FUNCTION*/aTop; // known function
     f = /*warning:DOWN_CAST_COMPOSITE*/botA;
     f = /*warning:DOWN_CAST_COMPOSITE*/botTop;
     apply/*<TopA>*/(
         topA,
-        /*error:STATIC_TYPE_ERROR*/topTop, // known function
-        /*error:STATIC_TYPE_ERROR*/aa, // known function
-        /*error:STATIC_TYPE_ERROR*/aTop, // known function
+        /*error:INVALID_CAST_FUNCTION*/topTop, // known function
+        /*error:INVALID_CAST_FUNCTION*/aa, // known function
+        /*error:INVALID_CAST_FUNCTION*/aTop, // known function
         /*warning:DOWN_CAST_COMPOSITE*/botA,
         /*warning:DOWN_CAST_COMPOSITE*/botTop
                     );
     apply/*<TopA>*/(
         (dynamic x) => new A(),
-        /*error:STATIC_TYPE_ERROR*/(dynamic x) => (x as Object), // known function
-        /*error:STATIC_TYPE_ERROR*/(A x) => x, // known function
-        /*error:STATIC_TYPE_ERROR*/(A x) => (/*info:UNNECESSARY_CAST*/x as Object), // known function
+        /*error:INVALID_CAST_FUNCTION_EXPR*/(dynamic x) => (x as Object), // known function
+        /*error:INVALID_CAST_FUNCTION_EXPR*/(A x) => x, // known function
+        /*error:INVALID_CAST_FUNCTION_EXPR*/(A x) => (/*info:UNNECESSARY_CAST*/x as Object), // known function
         /*warning:DOWN_CAST_COMPOSITE*/botA,
         /*warning:DOWN_CAST_COMPOSITE*/botTop
                     );
@@ -1278,7 +1300,7 @@
 ''');
   }
 
-  void test_functionTypingAndSubtyping_dynamicFunctions_clasuresAreNotFuzzy() {
+  void test_functionTypingAndSubtyping_dynamicFunctions_closuresAreNotFuzzy() {
     // Regression test for
     // https://github.com/dart-lang/sdk/issues/26118
     // https://github.com/dart-lang/sdk/issues/26156
@@ -1357,23 +1379,23 @@
   }
   {
     Function2<B, B> f; // left
-    f = /*error:STATIC_TYPE_ERROR*/top;
+    f = /*error:INVALID_CAST_FUNCTION*/top;
     f = left;
     f = /*error:INVALID_ASSIGNMENT*/right;
     f = bot;
   }
   {
     Function2<A, A> f; // right
-    f = /*error:STATIC_TYPE_ERROR*/top;
+    f = /*error:INVALID_CAST_FUNCTION*/top;
     f = /*error:INVALID_ASSIGNMENT*/left;
     f = right;
     f = bot;
   }
   {
     Function2<A, B> f;
-    f = /*error:STATIC_TYPE_ERROR*/top;
-    f = /*error:STATIC_TYPE_ERROR*/left;
-    f = /*error:STATIC_TYPE_ERROR*/right;
+    f = /*error:INVALID_CAST_FUNCTION*/top;
+    f = /*error:INVALID_CAST_FUNCTION*/left;
+    f = /*error:INVALID_CAST_FUNCTION*/right;
     f = bot;
   }
 }
@@ -1444,14 +1466,14 @@
   }
   {
     Function2<AToB, AToB> f; // Left
-    f = /*error:STATIC_TYPE_ERROR*/top;
+    f = /*error:INVALID_CAST_FUNCTION*/top;
     f = left;
     f = /*error:INVALID_ASSIGNMENT*/right;
     f = bot;
   }
   {
     Function2<BToA, BToA> f; // Right
-    f = /*error:STATIC_TYPE_ERROR*/top;
+    f = /*error:INVALID_CAST_FUNCTION*/top;
     f = /*error:INVALID_ASSIGNMENT*/left;
     f = right;
     f = bot;
@@ -1459,9 +1481,9 @@
   {
     Function2<BToA, AToB> f; // Bot
     f = bot;
-    f = /*error:STATIC_TYPE_ERROR*/left;
-    f = /*error:STATIC_TYPE_ERROR*/top;
-    f = /*error:STATIC_TYPE_ERROR*/right;
+    f = /*error:INVALID_CAST_FUNCTION*/left;
+    f = /*error:INVALID_CAST_FUNCTION*/top;
+    f = /*error:INVALID_CAST_FUNCTION*/right;
   }
 }
 ''');
@@ -1493,14 +1515,14 @@
   }
   {
     Function2<AToB, AToB> f; // Left
-    f = /*error:STATIC_TYPE_ERROR*/top;
+    f = /*error:INVALID_CAST_FUNCTION*/top;
     f = left;
     f = /*error:INVALID_ASSIGNMENT*/right;
     f = bot;
   }
   {
     Function2<BToA, BToA> f; // Right
-    f = /*error:STATIC_TYPE_ERROR*/top;
+    f = /*error:INVALID_CAST_FUNCTION*/top;
     f = /*error:INVALID_ASSIGNMENT*/left;
     f = right;
     f = bot;
@@ -1508,9 +1530,9 @@
   {
     Function2<BToA, AToB> f; // Bot
     f = bot;
-    f = /*error:STATIC_TYPE_ERROR*/left;
-    f = /*error:STATIC_TYPE_ERROR*/top;
-    f = /*error:STATIC_TYPE_ERROR*/right;
+    f = /*error:INVALID_CAST_FUNCTION*/left;
+    f = /*error:INVALID_CAST_FUNCTION*/top;
+    f = /*error:INVALID_CAST_FUNCTION*/right;
   }
 }
 ''');
@@ -1542,14 +1564,14 @@
   }
   {
     Function2<AToB, AToB> f; // Left
-    f = /*error:STATIC_TYPE_ERROR*/top;
+    f = /*error:INVALID_CAST_FUNCTION*/top;
     f = left;
     f = /*error:INVALID_ASSIGNMENT*/right;
     f = bot;
   }
   {
     Function2<BToA, BToA> f; // Right
-    f = /*error:STATIC_TYPE_ERROR*/top;
+    f = /*error:INVALID_CAST_FUNCTION*/top;
     f = /*error:INVALID_ASSIGNMENT*/left;
     f = right;
     f = bot;
@@ -1557,9 +1579,9 @@
   {
     Function2<BToA, AToB> f; // Bot
     f = bot;
-    f = /*error:STATIC_TYPE_ERROR*/left;
-    f = /*error:STATIC_TYPE_ERROR*/top;
-    f = /*error:STATIC_TYPE_ERROR*/right;
+    f = /*error:INVALID_CAST_FUNCTION*/left;
+    f = /*error:INVALID_CAST_FUNCTION*/top;
+    f = /*error:INVALID_CAST_FUNCTION*/right;
   }
 }
 ''');
@@ -1915,23 +1937,23 @@
   }
   {
     Function2<B, B> f;
-    f = /*error:STATIC_TYPE_ERROR*/C.top;
+    f = /*error:INVALID_CAST_METHOD*/C.top;
     f = C.left;
     f = /*error:INVALID_ASSIGNMENT*/C.right;
     f = C.bot;
   }
   {
     Function2<A, A> f;
-    f = /*error:STATIC_TYPE_ERROR*/C.top;
+    f = /*error:INVALID_CAST_METHOD*/C.top;
     f = /*error:INVALID_ASSIGNMENT*/C.left;
     f = C.right;
     f = C.bot;
   }
   {
     Function2<A, B> f;
-    f = /*error:STATIC_TYPE_ERROR*/C.top;
-    f = /*error:STATIC_TYPE_ERROR*/C.left;
-    f = /*error:STATIC_TYPE_ERROR*/C.right;
+    f = /*error:INVALID_CAST_METHOD*/C.top;
+    f = /*error:INVALID_CAST_METHOD*/C.left;
+    f = /*error:INVALID_CAST_METHOD*/C.right;
     f = C.bot;
   }
 }
@@ -1962,7 +1984,7 @@
 
     var local2 = g;
     local = local2;
-    local2 = /*error:STATIC_TYPE_ERROR*/f;
+    local2 = /*error:INVALID_CAST_FUNCTION*/f;
     local2 = /*warning:DOWN_CAST_COMPOSITE*/local;
 
     // Non-generic function cannot subtype a generic one.
@@ -2729,7 +2751,7 @@
 typedef T Returns<T>();
 
 // regression test for https://github.com/dart-lang/sdk/issues/26094
-class A <S extends  Returns<S>, T extends Returns<T>> {
+class A <S extends Returns<S>, T extends Returns<T>> {
   int test(bool b) {
     S s;
     T t;
@@ -3175,6 +3197,19 @@
     check(implicitCasts: false);
   }
 
+  void test_overrideNarrowsType_legalWithChecked() {
+    // Regression test for https://github.com/dart-lang/sdk/issues/25232
+    _addMetaLibrary();
+    checkFile(r'''
+import 'meta.dart';
+abstract class A { void test(A arg) { } }
+abstract class B extends A { void test(@checked B arg) { } }
+abstract class X implements A { }
+class C extends B with X { }
+class D extends B implements A { }
+    ''');
+  }
+
   void test_overrideNarrowsType_noDuplicateError() {
     // Regression test for https://github.com/dart-lang/sdk/issues/25232
     _addMetaLibrary();
@@ -3193,19 +3228,6 @@
     ''');
   }
 
-  void test_overrideNarrowsType_legalWithChecked() {
-    // Regression test for https://github.com/dart-lang/sdk/issues/25232
-    _addMetaLibrary();
-    checkFile(r'''
-import 'meta.dart';
-abstract class A { void test(A arg) { } }
-abstract class B extends A { void test(@checked B arg) { } }
-abstract class X implements A { }
-class C extends B with X { }
-class D extends B implements A { }
-    ''');
-  }
-
   void test_privateOverride() {
     addFile(
         '''
@@ -3699,7 +3721,9 @@
   }
 
   void test_typePromotionFromTypeParameter() {
-    // Regression test for https://github.com/dart-lang/sdk/issues/26965
+    // Regression test for:
+    // https://github.com/dart-lang/sdk/issues/26965
+    // https://github.com/dart-lang/sdk/issues/27040
     checkFile(r'''
 void f/*<T>*/(/*=T*/ object) {
   if (object is String) print(object.substring(1));
@@ -3712,15 +3736,48 @@
 class SubClonable<T> extends Clonable<T> {
   T m(T t) => t;
 }
+void takesSubClonable/*<A>*/(SubClonable/*<A>*/ t) {}
+
 void h/*<T extends Clonable<T>>*/(/*=T*/ object) {
   if (/*info:NON_GROUND_TYPE_CHECK_INFO*/object is SubClonable/*<T>*/) {
-    // Note we need to cast back to T, because promotion lost that type info.
-    print(object.m(object as dynamic/*=T*/));
+    print(object.m(object));
+
+    SubClonable/*<T>*/ s = object;
+    takesSubClonable/*<T>*/(object);
+    h(object);
   }
 }
 ''');
   }
 
+  void test_typePromotionFromTypeParameterAndInference() {
+    // Regression test for:
+    // https://github.com/dart-lang/sdk/issues/27040
+    checkFile(r'''
+void f/*<T extends num>*/(T x, T y) {
+  var z = x;
+  var f = () => x;
+  f = () => y;
+  if (x is int) {
+    /*info:DYNAMIC_INVOKE*/z./*error:UNDEFINED_GETTER*/isEven;
+    var q = x;
+    q = /*warning:DOWN_CAST_COMPOSITE*/z;
+    /*info:DYNAMIC_INVOKE*/f()./*error:UNDEFINED_GETTER*/isEven;
+
+    // This does not capture the type `T extends int`. Instead the return type
+    // is `T extends num`. What happens is we substitute {T/T} on the function
+    // type, and the way it is implemented, this leads back to `T extends num`.
+    // See https://github.com/dart-lang/sdk/issues/27725
+    var g = () => x;
+    g = f;
+    /*info:DYNAMIC_INVOKE*/g()./*error:UNDEFINED_GETTER*/isEven;
+    q = /*warning:DOWN_CAST_COMPOSITE*/g();
+    int r = x;
+  }
+}
+    ''');
+  }
+
   void test_typeSubtyping_assigningClass() {
     checkFile('''
 class A {}
@@ -3945,14 +4002,3 @@
 ''');
   }
 }
-
-void _addMetaLibrary() {
-  addFile(r'''
-library meta;
-class _Checked { const _Checked(); }
-const Object checked = const _Checked();
-
-class _Virtual { const _Virtual(); }
-const Object virtual = const _Virtual();
-    ''', name: '/meta.dart');
-}
diff --git a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
index 5a0bc4d..7979880 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -8,14 +8,15 @@
 library analyzer.test.src.task.strong.inferred_type_test;
 
 import 'package:analyzer/dart/element/element.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import 'strong_test_helper.dart' as helper;
 
 void main() {
-  helper.initStrongModeTests();
-  defineReflectiveTests(InferredTypeTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(InferredTypeTest);
+  });
 }
 
 abstract class InferredTypeMixin {
@@ -1066,6 +1067,28 @@
     checkFile('''
 void main () {
   {
+    T f<T>(T x) => null;
+    var v1 = f;
+    v1 = /*info:INFERRED_TYPE_CLOSURE*/<S>(x) => x;
+  }
+  {
+    List<T> f<T>(T x) => null;
+    var v2 = f;
+    v2 = /*info:INFERRED_TYPE_CLOSURE*/<S>(x) => /*info:INFERRED_TYPE_LITERAL*/[x];
+    Iterable<int> r = v2(42);
+    Iterable<String> s = v2('hello');
+    Iterable<List<int>> t = v2(<int>[]);
+    Iterable<num> u = v2(42);
+    Iterable<num> v = v2<num>(42);
+  }
+}
+''');
+  }
+
+  void test_downwardsInferenceOnFunctionOfTUsingTheT_comment() {
+    checkFile('''
+void main () {
+  {
     /*=T*/ f/*<T>*/(/*=T*/ x) => null;
     var v1 = f;
     v1 = /*info:INFERRED_TYPE_CLOSURE*//*<S>*/(x) => x;
@@ -1149,6 +1172,53 @@
     checkFile('''
 void main () {
   {
+    String f<S>(int x) => null;
+    var v = f;
+    v = /*info:INFERRED_TYPE_CLOSURE*/<T>(int x) => null;
+    v = <T>(int x) => "hello";
+    v = /*error:INVALID_ASSIGNMENT*/<T>(String x) => "hello";
+    v = /*error:INVALID_ASSIGNMENT*/<T>(int x) => 3;
+    v = /*info:INFERRED_TYPE_CLOSURE*/<T>(int x) {return /*error:RETURN_OF_INVALID_TYPE*/3;};
+  }
+  {
+    String f<S>(int x) => null;
+    var v = f;
+    v = /*info:INFERRED_TYPE_CLOSURE, info:INFERRED_TYPE_CLOSURE*/<T>(x) => null;
+    v = /*info:INFERRED_TYPE_CLOSURE*/<T>(x) => "hello";
+    v = /*info:INFERRED_TYPE_CLOSURE, error:INVALID_ASSIGNMENT*/<T>(x) => 3;
+    v = /*info:INFERRED_TYPE_CLOSURE, info:INFERRED_TYPE_CLOSURE*/<T>(x) {return /*error:RETURN_OF_INVALID_TYPE*/3;};
+    v = /*info:INFERRED_TYPE_CLOSURE, info:INFERRED_TYPE_CLOSURE*/<T>(x) {return /*error:RETURN_OF_INVALID_TYPE*/x;};
+  }
+  {
+    List<String> f<S>(int x) => null;
+    var v = f;
+    v = /*info:INFERRED_TYPE_CLOSURE*/<T>(int x) => null;
+    v = <T>(int x) => /*info:INFERRED_TYPE_LITERAL*/["hello"];
+    v = /*error:INVALID_ASSIGNMENT*/<T>(String x) => /*info:INFERRED_TYPE_LITERAL*/["hello"];
+    v = <T>(int x) => /*info:INFERRED_TYPE_LITERAL,error:COULD_NOT_INFER*/[/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/3];
+    v = /*info:INFERRED_TYPE_CLOSURE*/<T>(int x) {return /*info:INFERRED_TYPE_LITERAL,error:COULD_NOT_INFER*/[/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/3];};
+  }
+  {
+    int int2int<S>(int x) => null;
+    String int2String<T>(int x) => null;
+    String string2String<T>(String x) => null;
+    var x = int2int;
+    x = /*info:INFERRED_TYPE_CLOSURE*/<T>(x) => x;
+    x = /*info:INFERRED_TYPE_CLOSURE*/<T>(x) => x+1;
+    var y = int2String;
+    y = /*info:INFERRED_TYPE_CLOSURE, error:INVALID_ASSIGNMENT*/<T>(x) => x;
+    y = /*info:INFERRED_TYPE_CLOSURE, info:INFERRED_TYPE_CLOSURE*/<T>(x) => /*info:DYNAMIC_INVOKE, info:DYNAMIC_CAST*/x.substring(3);
+    var z = string2String;
+    z = /*info:INFERRED_TYPE_CLOSURE*/<T>(x) => x.substring(3);
+  }
+}
+''');
+  }
+
+  void test_downwardsInferenceOnGenericFunctionExpressions_comment() {
+    checkFile('''
+void main () {
+  {
     String f/*<S>*/(int x) => null;
     var v = f;
     v = /*info:INFERRED_TYPE_CLOSURE*//*<T>*/(int x) => null;
@@ -1231,8 +1301,8 @@
     A<int, String> a1 = /*info:INFERRED_TYPE_ALLOCATION*/new A.named(3, "hello");
     A<int, String> a2 = new A<int, String>(3, "hello");
     A<int, String> a3 = new A<int, String>.named(3, "hello");
-    A<int, String> a4 = /*error:STATIC_TYPE_ERROR*/new A<int, dynamic>(3, "hello");
-    A<int, String> a5 = /*error:STATIC_TYPE_ERROR*/new A<dynamic, dynamic>.named(3, "hello");
+    A<int, String> a4 = /*error:INVALID_CAST_NEW_EXPR*/new A<int, dynamic>(3, "hello");
+    A<int, String> a5 = /*error:INVALID_CAST_NEW_EXPR*/new A<dynamic, dynamic>.named(3, "hello");
   }
   {
     A<int, String> a0 = /*info:INFERRED_TYPE_ALLOCATION*/new /*error:COULD_NOT_INFER,error:COULD_NOT_INFER*/A(
@@ -1327,10 +1397,10 @@
     List<dynamic> l3 = /*info:INFERRED_TYPE_LITERAL*/["hello", 3];
   }
   {
-    List<int> l0 = /*error:STATIC_TYPE_ERROR*/<num>[];
-    List<int> l1 = /*error:STATIC_TYPE_ERROR*/<num>[3];
-    List<int> l2 = /*error:STATIC_TYPE_ERROR*/<num>[/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/"hello"];
-    List<int> l3 = /*error:STATIC_TYPE_ERROR*/<num>[/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/"hello", 3];
+    List<int> l0 = /*error:INVALID_CAST_LITERAL_LIST*/<num>[];
+    List<int> l1 = /*error:INVALID_CAST_LITERAL_LIST*/<num>[3];
+    List<int> l2 = /*error:INVALID_CAST_LITERAL_LIST*/<num>[/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/"hello"];
+    List<int> l3 = /*error:INVALID_CAST_LITERAL_LIST*/<num>[/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/"hello", 3];
   }
   {
     Iterable<int> i0 = /*info:INFERRED_TYPE_LITERAL*/[];
@@ -1464,9 +1534,9 @@
     };
   }
   {
-    Map<int, String> l0 = /*error:STATIC_TYPE_ERROR*/<num, dynamic>{};
-    Map<int, String> l1 = /*error:STATIC_TYPE_ERROR*/<num, dynamic>{3: "hello"};
-    Map<int, String> l3 = /*error:STATIC_TYPE_ERROR*/<num, dynamic>{3: 3};
+    Map<int, String> l0 = /*error:INVALID_CAST_LITERAL_MAP*/<num, dynamic>{};
+    Map<int, String> l1 = /*error:INVALID_CAST_LITERAL_MAP*/<num, dynamic>{3: "hello"};
+    Map<int, String> l3 = /*error:INVALID_CAST_LITERAL_MAP*/<num, dynamic>{3: 3};
   }
   {
     const Map<int, String> l0 = /*info:INFERRED_TYPE_LITERAL*/const {};
@@ -1536,6 +1606,46 @@
   MyFuture() {}
   MyFuture.value(T x) {}
   dynamic noSuchMethod(invocation);
+  MyFuture<S> then<S>(dynamic f(T x), {Function onError}) => null;
+}
+
+void main() {
+  $declared f;
+  $downwards<int> t1 = f.then((_) async => await new $upwards<int>.value(3));
+  $downwards<int> t2 = f.then(/*info:INFERRED_TYPE_CLOSURE*/(_) async {
+     return await new $upwards<int>.value(3);});
+  $downwards<int> t3 = f.then((_) async => 3);
+  $downwards<int> t4 = f.then(/*info:INFERRED_TYPE_CLOSURE*/(_) async {
+    return 3;});
+  $downwards<int> t5 = f.then((_) => new $upwards<int>.value(3));
+  $downwards<int> t6 = f.then(/*info:INFERRED_TYPE_CLOSURE*/(_) {return new $upwards<int>.value(3);});
+  $downwards<int> t7 = f.then((_) async => new $upwards<int>.value(3));
+  $downwards<int> t8 = f.then(/*info:INFERRED_TYPE_CLOSURE*/(_) async {
+    return new $upwards<int>.value(3);});
+}
+''';
+
+    checkFile(
+        build(declared: "MyFuture", downwards: "Future", upwards: "Future"));
+    checkFile(
+        build(declared: "MyFuture", downwards: "Future", upwards: "MyFuture"));
+    checkFile(
+        build(declared: "MyFuture", downwards: "MyFuture", upwards: "Future"));
+    checkFile(build(
+        declared: "MyFuture", downwards: "MyFuture", upwards: "MyFuture"));
+    checkFile(
+        build(declared: "Future", downwards: "Future", upwards: "MyFuture"));
+    checkFile(
+        build(declared: "Future", downwards: "Future", upwards: "Future"));
+  }
+
+  void test_futureThen_comment() {
+    String build({String declared, String downwards, String upwards}) => '''
+import 'dart:async';
+class MyFuture<T> implements Future<T> {
+  MyFuture() {}
+  MyFuture.value(T x) {}
+  dynamic noSuchMethod(invocation);
   MyFuture/*<S>*/ then/*<S>*/(dynamic f(T x), {Function onError}) => null;
 }
 
@@ -1576,6 +1686,42 @@
   MyFuture() {}
   MyFuture.value(T x) {}
   dynamic noSuchMethod(invocation);
+  MyFuture<S> then<S>(dynamic f(T x), {Function onError}) => null;
+}
+
+void main() {
+  $declared<bool> f;
+  $downwards<int> t1 = f.then(/*info:INFERRED_TYPE_CLOSURE*/
+      (x) async => x ? 2 : await new $upwards<int>.value(3));
+  $downwards<int> t2 = f.then(/*info:INFERRED_TYPE_CLOSURE,info:INFERRED_TYPE_CLOSURE*/(x) async { // TODO(leafp): Why the duplicate here?
+    return await x ? 2 : new $upwards<int>.value(3);});
+  $downwards<int> t5 = f.then(/*info:INFERRED_TYPE_CLOSURE*/
+      (x) => x ? 2 : new $upwards<int>.value(3));
+  $downwards<int> t6 = f.then(/*info:INFERRED_TYPE_CLOSURE*/
+      (x) {return x ? 2 : new $upwards<int>.value(3);});
+}
+''';
+    checkFile(
+        build(declared: "MyFuture", downwards: "Future", upwards: "Future"));
+    checkFile(
+        build(declared: "MyFuture", downwards: "Future", upwards: "MyFuture"));
+    checkFile(
+        build(declared: "MyFuture", downwards: "MyFuture", upwards: "Future"));
+    checkFile(build(
+        declared: "MyFuture", downwards: "MyFuture", upwards: "MyFuture"));
+    checkFile(
+        build(declared: "Future", downwards: "Future", upwards: "MyFuture"));
+    checkFile(
+        build(declared: "Future", downwards: "Future", upwards: "Future"));
+  }
+
+  void test_futureThen_conditional_comment() {
+    String build({String declared, String downwards, String upwards}) => '''
+import 'dart:async';
+class MyFuture<T> implements Future<T> {
+  MyFuture() {}
+  MyFuture.value(T x) {}
+  dynamic noSuchMethod(invocation);
   MyFuture/*<S>*/ then/*<S>*/(dynamic f(T x), {Function onError}) => null;
 }
 
@@ -1624,6 +1770,17 @@
 import "dart:async";
 main() {
   Future<int> f;
+  var x = f.then<Future<List<int>>>(/*info:INFERRED_TYPE_CLOSURE*/(x) => /*info:INFERRED_TYPE_LITERAL*/[]);
+  Future<List<int>> y = x;
+}
+    ''');
+  }
+
+  void test_futureThen_explicitFuture_comment() {
+    checkFile(r'''
+import "dart:async";
+main() {
+  Future<int> f;
   var x = f.then/*<Future<List<int>>>*/(/*info:INFERRED_TYPE_CLOSURE*/(x) => /*info:INFERRED_TYPE_LITERAL*/[]);
   Future<List<int>> y = x;
 }
@@ -1638,6 +1795,36 @@
   MyFuture() {}
   MyFuture.value(T x) {}
   dynamic noSuchMethod(invocation);
+  MyFuture<S> then<S>(dynamic f(T x), {Function onError}) => null;
+}
+
+void main() {
+  var f = foo().then((_) => 2.3);
+  $downwards<int> f2 = /*error:INVALID_ASSIGNMENT*/f;
+
+  // The unnecessary cast is to illustrate that we inferred <double> for
+  // the generic type args, even though we had a return type context.
+  $downwards<num> f3 = /*info:UNNECESSARY_CAST*/foo().then(
+      (_) => 2.3) as $upwards<double>;
+}
+$declared foo() => new $declared<int>.value(1);
+    ''';
+    checkFile(
+        build(declared: "MyFuture", downwards: "Future", upwards: "Future"));
+    checkFile(build(
+        declared: "MyFuture", downwards: "MyFuture", upwards: "MyFuture"));
+    checkFile(
+        build(declared: "Future", downwards: "Future", upwards: "Future"));
+  }
+
+  void test_futureThen_upwards_comment() {
+    // Regression test for https://github.com/dart-lang/sdk/issues/27088.
+    String build({String declared, String downwards, String upwards}) => '''
+import 'dart:async';
+class MyFuture<T> implements Future<T> {
+  MyFuture() {}
+  MyFuture.value(T x) {}
+  dynamic noSuchMethod(invocation);
   MyFuture/*<S>*/ then/*<S>*/(dynamic f(T x), {Function onError}) => null;
 }
 
@@ -1681,6 +1868,29 @@
   MyFuture() {}
   MyFuture.value(T x) {}
   dynamic noSuchMethod(invocation);
+  MyFuture<S> then<S>(dynamic f(T x), {Function onError}) => null;
+}
+
+$downwards<int> g1(bool x) async {
+  return x ? 42 : /*info:INFERRED_TYPE_ALLOCATION*/new $upwards.value(42); }
+$downwards<int> g2(bool x) async =>
+  x ? 42 : /*info:INFERRED_TYPE_ALLOCATION*/new $upwards.value(42);
+$downwards<int> g3(bool x) async {
+  var y = x ? 42 : /*info:INFERRED_TYPE_ALLOCATION*/new $upwards.value(42);
+  return y;
+}
+    ''';
+    checkFile(build(downwards: "Future", upwards: "Future"));
+    checkFile(build(downwards: "Future", upwards: "MyFuture"));
+  }
+
+  void test_futureUnion_asyncConditional_comment() {
+    String build({String declared, String downwards, String upwards}) => '''
+import 'dart:async';
+class MyFuture<T> implements Future<T> {
+  MyFuture() {}
+  MyFuture.value(T x) {}
+  dynamic noSuchMethod(invocation);
   MyFuture/*<S>*/ then/*<S>*/(dynamic f(T x), {Function onError}) => null;
 }
 
@@ -1710,6 +1920,48 @@
   MyFuture() {}
   MyFuture.value([T x]) {}
   dynamic noSuchMethod(invocation);
+  MyFuture<S> then<S>(dynamic f(T x), {Function onError}) => null;
+}
+
+$declared f;
+// Instantiates Future<int>
+$downwards<int> t1 = f.then((_) =>
+   ${allocInfo}new /*error:COULD_NOT_INFER*/$upwards.value(
+     /*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/'hi'));
+
+// Instantiates List<int>
+$downwards<List<int>> t2 = f.then((_) => /*info:INFERRED_TYPE_LITERAL*/[3]);
+$downwards<List<int>> g2() async { return /*info:INFERRED_TYPE_LITERAL*/[3]; }
+$downwards<List<int>> g3() async {
+  return /*info:INFERRED_TYPE_ALLOCATION*/new $upwards.value(
+      /*info:INFERRED_TYPE_LITERAL*/[3]); }
+''';
+    }
+
+    ;
+    checkFile(
+        build(declared: "MyFuture", downwards: "Future", upwards: "Future"));
+    checkFile(
+        build(declared: "MyFuture", downwards: "Future", upwards: "MyFuture"));
+    checkFile(
+        build(declared: "Future", downwards: "Future", upwards: "Future"));
+    checkFile(
+        build(declared: "Future", downwards: "Future", upwards: "MyFuture"));
+  }
+
+  void test_futureUnion_downwards_comment() {
+    String build({String declared, String downwards, String upwards}) {
+      // TODO(leafp): The use of matchTypes in visitInstanceCreationExpression
+      // in the resolver visitor isn't powerful enough to catch this for the
+      // subclass.  See the TODO there.
+      var allocInfo =
+          (upwards == "Future") ? "/*info:INFERRED_TYPE_ALLOCATION*/" : "";
+      return '''
+import 'dart:async';
+class MyFuture<T> implements Future<T> {
+  MyFuture() {}
+  MyFuture.value([T x]) {}
+  dynamic noSuchMethod(invocation);
   MyFuture/*<S>*/ then/*<S>*/(dynamic f(T x), {Function onError}) => null;
 }
 
@@ -1739,7 +1991,7 @@
         build(declared: "Future", downwards: "Future", upwards: "MyFuture"));
   }
 
-  void test_futureUnion_downwardsGenericMethods() {
+  void test_futureUnion_downwardsGenericMethodWithFutureReturn() {
     // Regression test for https://github.com/dart-lang/sdk/issues/27134
     //
     // We need to take a future union into account for both directions of
@@ -1757,6 +2009,34 @@
     ''');
   }
 
+  void test_futureUnion_downwardsGenericMethodWithGenericReturn() {
+    // Regression test for https://github.com/dart-lang/sdk/issues/27284
+    checkFile(r'''
+import 'dart:async';
+
+T id<T>(T x) => x;
+
+main() async {
+  Future<String> f;
+  String s = await id(f);
+}
+    ''');
+  }
+
+  void test_futureUnion_downwardsGenericMethodWithGenericReturn_comment() {
+    // Regression test for https://github.com/dart-lang/sdk/issues/27284
+    checkFile(r'''
+import 'dart:async';
+
+/*=T*/ id/*<T>*/(/*=T*/ x) => x;
+
+main() async {
+  Future<String> f;
+  String s = await id(f);
+}
+    ''');
+  }
+
   void test_futureUnion_upwardsGenericMethods() {
     // Regression test for https://github.com/dart-lang/sdk/issues/27151
     checkFile(r'''
@@ -1783,6 +2063,20 @@
 typedef void ToValue<T>(T value);
 
 main() {
+  ToValue<T> f<T>(T x) => null;
+  var x = f<int>(42);
+  var y = f(42);
+  ToValue<int> takesInt = x;
+  takesInt = y;
+}
+    ''');
+  }
+
+  void test_genericFunctions_returnTypedef_comment() {
+    checkFile(r'''
+typedef void ToValue<T>(T value);
+
+main() {
   ToValue/*<T>*/ f/*<T>*/(dynamic /*=T*/ x) => null;
   var x = f/*<int>*/(42);
   var y = f(42);
@@ -1794,6 +2088,16 @@
 
   void test_genericMethods_basicDownwardInference() {
     checkFile(r'''
+T f<S, T>(S s) => null;
+main() {
+  String x = f(42);
+  String y = (f)(42);
+}
+''');
+  }
+
+  void test_genericMethods_basicDownwardInference_comment() {
+    checkFile(r'''
 /*=T*/ f/*<S, T>*/(/*=S*/ s) => null;
 main() {
   String x = f(42);
@@ -1806,6 +2110,28 @@
     // Regression test for https://github.com/dart-lang/sdk/issues/25740.
     checkFile(r'''
 class Foo<T extends Pattern> {
+  U method<U extends T>(U u) => u;
+}
+main() {
+  String s;
+  var a = new Foo().method<String>("str");
+  s = a;
+  new Foo();
+
+  var b = new Foo<String>().method("str");
+  s = b;
+  var c = new Foo().method("str");
+  s = c;
+
+  new Foo<String>()./*error:COULD_NOT_INFER*/method(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/42);
+}
+''');
+  }
+
+  void test_genericMethods_correctlyRecognizeGenericUpperBound_comment() {
+    // Regression test for https://github.com/dart-lang/sdk/issues/25740.
+    checkFile(r'''
+class Foo<T extends Pattern> {
   /*=U*/ method/*<U extends T>*/(/*=U*/ u) => u;
 }
 main() {
@@ -1862,13 +2188,28 @@
   void test_genericMethods_doNotInferInvalidOverrideOfGenericMethod() {
     checkFile('''
 class C {
+T m<T>(T x) => x;
+}
+class D extends C {
+/*error:INVALID_METHOD_OVERRIDE*/m(x) => x;
+}
+main() {
+  int y = /*info:DYNAMIC_CAST*/new D()./*error:WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD*/m<int>(42);
+  print(y);
+}
+''');
+  }
+
+  void test_genericMethods_doNotInferInvalidOverrideOfGenericMethod_comment() {
+    checkFile('''
+class C {
 /*=T*/ m/*<T>*/(/*=T*/ x) => x;
 }
 class D extends C {
 /*error:INVALID_METHOD_OVERRIDE*/m(x) => x;
 }
 main() {
-  int y = /*info:DYNAMIC_CAST*/new D()./*error:WRONG_NUMBER_OF_TYPE_ARGUMENTS*/m/*<int>*/(42);
+  int y = /*info:DYNAMIC_CAST*/new D()./*error:WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD*/m/*<int>*/(42);
   print(y);
 }
 ''');
@@ -1876,6 +2217,16 @@
 
   void test_genericMethods_downwardsInferenceAffectsArguments() {
     checkFile(r'''
+T f<T>(List<T> s) => null;
+main() {
+  String x = f(/*info:INFERRED_TYPE_LITERAL*/['hi']);
+  String y = f(/*info:INFERRED_TYPE_LITERAL,error:COULD_NOT_INFER*/[/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/42]);
+}
+''');
+  }
+
+  void test_genericMethods_downwardsInferenceAffectsArguments_comment() {
+    checkFile(r'''
 /*=T*/ f/*<T>*/(List/*<T>*/ s) => null;
 main() {
   String x = f(/*info:INFERRED_TYPE_LITERAL*/['hi']);
@@ -1912,6 +2263,24 @@
   dynamic g(int x) => x;
 }
 class D extends C {
+  T m<T>(T x) => x;
+  T g<T>(T x) => x;
+}
+main() {
+  int y = /*info:DYNAMIC_CAST*/(/*info:UNNECESSARY_CAST*/new D() as C).m(42);
+  print(y);
+}
+  ''');
+  }
+
+  void test_genericMethods_handleOverrideOfNonGenericWithGeneric_comment() {
+    // Regression test for crash when adding genericity
+    checkFile('''
+class C {
+  m(x) => x;
+  dynamic g(int x) => x;
+}
+class D extends C {
   /*=T*/ m/*<T>*/(/*=T*/ x) => x;
   /*=T*/ g/*<T>*/(/*=T*/ x) => x;
 }
@@ -1934,10 +2303,10 @@
   void test_genericMethods_inferGenericFunctionParameterType() {
     var mainUnit = checkFile('''
 class C<T> extends D<T> {
-  f/*<U>*/(x) {}
+  f<U>(x) {}
 }
 class D<T> {
-  F/*<U>*/ f/*<U>*/(/*=U*/ u) => null;
+  F<U> f<U>(U u) => null;
 }
 typedef void F<V>(V v);
 ''');
@@ -1948,6 +2317,20 @@
   void test_genericMethods_inferGenericFunctionParameterType2() {
     var mainUnit = checkFile('''
 class C<T> extends D<T> {
+  f<U>(g) => null;
+}
+abstract class D<T> {
+  void f<U>(G<U> g);
+}
+typedef List<V> G<V>();
+''');
+    var f = mainUnit.getType('C').methods[0];
+    expect(f.type.toString(), '<U>(() → List<U>) → void');
+  }
+
+  void test_genericMethods_inferGenericFunctionParameterType2_comment() {
+    var mainUnit = checkFile('''
+class C<T> extends D<T> {
   f/*<U>*/(g) => null;
 }
 abstract class D<T> {
@@ -1959,9 +2342,37 @@
     expect(f.type.toString(), '<U>(() → List<U>) → void');
   }
 
+  void test_genericMethods_inferGenericFunctionParameterType_comment() {
+    var mainUnit = checkFile('''
+class C<T> extends D<T> {
+  f/*<U>*/(x) {}
+}
+class D<T> {
+  F/*<U>*/ f/*<U>*/(/*=U*/ u) => null;
+}
+typedef void F<V>(V v);
+''');
+    var f = mainUnit.getType('C').methods[0];
+    expect(f.type.toString(), '<U>(U) → (U) → void');
+  }
+
   void test_genericMethods_inferGenericFunctionReturnType() {
     var mainUnit = checkFile('''
 class C<T> extends D<T> {
+  f<U>(x) {}
+}
+class D<T> {
+  F<U> f<U>(U u) => null;
+}
+typedef V F<V>();
+''');
+    var f = mainUnit.getType('C').methods[0];
+    expect(f.type.toString(), '<U>(U) → () → U');
+  }
+
+  void test_genericMethods_inferGenericFunctionReturnType_comment() {
+    var mainUnit = checkFile('''
+class C<T> extends D<T> {
   f/*<U>*/(x) {}
 }
 class D<T> {
@@ -1979,6 +2390,96 @@
 import 'dart:math' show min;
 
 class C {
+T m<T extends num>(T x, T y) => null;
+}
+
+main() {
+takeIII(math.max);
+takeDDD(math.max);
+takeNNN(math.max);
+takeIDN(math.max);
+takeDIN(math.max);
+takeIIN(math.max);
+takeDDN(math.max);
+takeIIO(math.max);
+takeDDO(math.max);
+
+takeOOI(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/math.max);
+takeIDI(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/math.max);
+takeDID(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/math.max);
+takeOON(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/math.max);
+takeOOO(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/math.max);
+
+// Also test SimpleIdentifier
+takeIII(min);
+takeDDD(min);
+takeNNN(min);
+takeIDN(min);
+takeDIN(min);
+takeIIN(min);
+takeDDN(min);
+takeIIO(min);
+takeDDO(min);
+
+takeOOI(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/min);
+takeIDI(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/min);
+takeDID(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/min);
+takeOON(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/min);
+takeOOO(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/min);
+
+// Also PropertyAccess
+takeIII(new C().m);
+takeDDD(new C().m);
+takeNNN(new C().m);
+takeIDN(new C().m);
+takeDIN(new C().m);
+takeIIN(new C().m);
+takeDDN(new C().m);
+takeIIO(new C().m);
+takeDDO(new C().m);
+
+// Note: this is a warning because a downcast of a method tear-off could work
+// (derived method can be a subtype):
+//
+//     class D extends C {
+//       S m<S extends num>(Object x, Object y);
+//     }
+//
+// That's legal because we're loosening parameter types.
+//
+takeOON(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/new C().m);
+takeOOO(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/new C().m);
+
+// Note: this is a warning because a downcast of a method tear-off could work
+// in "normal" Dart, due to bivariance.
+takeOOI(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/new C().m);
+takeIDI(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/new C().m);
+takeDID(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/new C().m);
+}
+
+void takeIII(int fn(int a, int b)) {}
+void takeDDD(double fn(double a, double b)) {}
+void takeIDI(int fn(double a, int b)) {}
+void takeDID(double fn(int a, double b)) {}
+void takeIDN(num fn(double a, int b)) {}
+void takeDIN(num fn(int a, double b)) {}
+void takeIIN(num fn(int a, int b)) {}
+void takeDDN(num fn(double a, double b)) {}
+void takeNNN(num fn(num a, num b)) {}
+void takeOON(num fn(Object a, Object b)) {}
+void takeOOO(num fn(Object a, Object b)) {}
+void takeOOI(int fn(Object a, Object b)) {}
+void takeIIO(Object fn(int a, int b)) {}
+void takeDDO(Object fn(double a, double b)) {}
+''');
+  }
+
+  void test_genericMethods_inferGenericInstantiation_comment() {
+    checkFile('''
+import 'dart:math' as math;
+import 'dart:math' show min;
+
+class C {
 /*=T*/ m/*<T extends num>*/(/*=T*/ x, /*=T*/ y) => null;
 }
 
@@ -2067,6 +2568,22 @@
     // Regression test for https://github.com/dart-lang/sdk/issues/25668
     checkFile('''
 class C {
+  T m<T>(T x) => x;
+}
+class D extends C {
+  m<S>(x) => x;
+}
+main() {
+  int y = new D().m<int>(42);
+  print(y);
+}
+  ''');
+  }
+
+  void test_genericMethods_inferGenericMethodType_comment() {
+    // Regression test for https://github.com/dart-lang/sdk/issues/25668
+    checkFile('''
+class C {
   /*=T*/ m/*<T>*/(/*=T*/ x) => x;
 }
 class D extends C {
@@ -2113,6 +2630,19 @@
 typedef Iterable<num> F(int x);
 typedef List<int> G(double x);
 
+T generic<T>(a(T _), b(T _)) => null;
+
+var v = generic((F f) => null, (G g) => null);
+''');
+    var v = mainUnit.topLevelVariables[0];
+    expect(v.type.toString(), '(num) → List<int>');
+  }
+
+  void test_genericMethods_usesGreatestLowerBound_comment() {
+    var mainUnit = checkFile(r'''
+typedef Iterable<num> F(int x);
+typedef List<int> G(double x);
+
 /*=T*/ generic/*<T>*/(a(/*=T*/ _), b(/*=T*/ _)) => null;
 
 var v = generic((F f) => null, (G g) => null);
@@ -2697,6 +3227,16 @@
   void test_inferGenericMethodType_named() {
     var unit = checkFile('''
 class C {
+  T m<T>(int a, {String b, T c}) => null;
+}
+var y = new C().m(1, b: 'bbb', c: 2.0);
+  ''');
+    expect(unit.topLevelVariables[0].type.toString(), 'double');
+  }
+
+  void test_inferGenericMethodType_named_comment() {
+    var unit = checkFile('''
+class C {
   /*=T*/ m/*<T>*/(int a, {String b, /*=T*/ c}) => null;
 }
 var y = new C().m(1, b: 'bbb', c: 2.0);
@@ -2707,7 +3247,7 @@
   void test_inferGenericMethodType_positional() {
     var unit = checkFile('''
 class C {
-  /*=T*/ m/*<T>*/(int a, [/*=T*/ b]) => null;
+  T m<T>(int a, [T b]) => null;
 }
 var y = new C().m(1, 2.0);
   ''');
@@ -2717,6 +3257,16 @@
   void test_inferGenericMethodType_positional2() {
     var unit = checkFile('''
 class C {
+  T m<T>(int a, [String b, T c]) => null;
+}
+var y = new C().m(1, 'bbb', 2.0);
+  ''');
+    expect(unit.topLevelVariables[0].type.toString(), 'double');
+  }
+
+  void test_inferGenericMethodType_positional2_comment() {
+    var unit = checkFile('''
+class C {
   /*=T*/ m/*<T>*/(int a, [String b, /*=T*/ c]) => null;
 }
 var y = new C().m(1, 'bbb', 2.0);
@@ -2724,9 +3274,29 @@
     expect(unit.topLevelVariables[0].type.toString(), 'double');
   }
 
+  void test_inferGenericMethodType_positional_comment() {
+    var unit = checkFile('''
+class C {
+  /*=T*/ m/*<T>*/(int a, [/*=T*/ b]) => null;
+}
+var y = new C().m(1, 2.0);
+  ''');
+    expect(unit.topLevelVariables[0].type.toString(), 'double');
+  }
+
   void test_inferGenericMethodType_required() {
     var unit = checkFile('''
 class C {
+  T m<T>(T x) => x;
+}
+var y = new C().m(42);
+  ''');
+    expect(unit.topLevelVariables[0].type.toString(), 'int');
+  }
+
+  void test_inferGenericMethodType_required_comment() {
+    var unit = checkFile('''
+class C {
   /*=T*/ m/*<T>*/(/*=T*/ x) => x;
 }
 var y = new C().m(42);
@@ -3943,6 +4513,18 @@
   void test_methodCall_withTypeArguments_instanceMethod() {
     var mainUnit = checkFile('''
 class C {
+  D<T> f<T>() => null;
+}
+class D<T> {}
+var f = new C().f<int>();
+''');
+    var v = mainUnit.topLevelVariables[0];
+    expect(v.type.toString(), 'D<int>');
+  }
+
+  void test_methodCall_withTypeArguments_instanceMethod_comment() {
+    var mainUnit = checkFile('''
+class C {
   D/*<T>*/ f/*<T>*/() => null;
 }
 class D<T> {}
@@ -3955,6 +4537,21 @@
   void test_methodCall_withTypeArguments_instanceMethod_identifierSequence() {
     var mainUnit = checkFile('''
 class C {
+  D<T> f<T>() => null;
+}
+class D<T> {}
+C c;
+var f = c.f<int>();
+''');
+    var v = mainUnit.topLevelVariables[1];
+    expect(v.name, 'f');
+    expect(v.type.toString(), 'D<int>');
+  }
+
+  void
+      test_methodCall_withTypeArguments_instanceMethod_identifierSequence_comment() {
+    var mainUnit = checkFile('''
+class C {
   D/*<T>*/ f/*<T>*/() => null;
 }
 class D<T> {}
@@ -3969,6 +4566,18 @@
   void test_methodCall_withTypeArguments_staticMethod() {
     var mainUnit = checkFile('''
 class C {
+  static D<T> f<T>() => null;
+}
+class D<T> {}
+var f = C.f<int>();
+''');
+    var v = mainUnit.topLevelVariables[0];
+    expect(v.type.toString(), 'D<int>');
+  }
+
+  void test_methodCall_withTypeArguments_staticMethod_comment() {
+    var mainUnit = checkFile('''
+class C {
   static D/*<T>*/ f/*<T>*/() => null;
 }
 class D<T> {}
@@ -3980,6 +4589,16 @@
 
   void test_methodCall_withTypeArguments_topLevelFunction() {
     var mainUnit = checkFile('''
+D<T> f<T>() => null;
+class D<T> {}
+var g = f<int>();
+''');
+    var v = mainUnit.topLevelVariables[0];
+    expect(v.type.toString(), 'D<int>');
+  }
+
+  void test_methodCall_withTypeArguments_topLevelFunction_comment() {
+    var mainUnit = checkFile('''
 D/*<T>*/ f/*<T>*/() => null;
 class D<T> {}
 var g = f/*<int>*/();
@@ -4366,6 +4985,17 @@
 
   void test_unsafeBlockClosureInference_functionCall_explicitDynamicParam() {
     var mainUnit = checkFile('''
+List<T> f<T>(T g()) => <T>[g()];
+var v = f<dynamic>(/*info:INFERRED_TYPE_CLOSURE*/() { return 1; });
+''');
+    var v = mainUnit.topLevelVariables[0];
+    expect(v.name, 'v');
+    expect(v.type.toString(), 'List<dynamic>');
+  }
+
+  void
+      test_unsafeBlockClosureInference_functionCall_explicitDynamicParam_comment() {
+    var mainUnit = checkFile('''
 dynamic /*=List<T>*/ f/*<T>*/(dynamic/*=T*/ g()) => <T>[g()];
 var v = f/*<dynamic>*/(/*info:INFERRED_TYPE_CLOSURE*/() { return 1; });
 ''');
@@ -4380,6 +5010,20 @@
     // Note: (f/*<dynamic>*/) is nort properly resulting in an instantiated
     // function type due to dartbug.com/25824.
     var mainUnit = checkFile('''
+List<T> f<T>(T g()) => <T>[g()];
+var v = (f<dynamic>)(/*info:INFERRED_TYPE_CLOSURE*/() { return 1; });
+''');
+    var v = mainUnit.topLevelVariables[0];
+    expect(v.name, 'v');
+    expect(v.type.toString(), 'List<dynamic>');
+  }
+
+  @failingTest
+  void
+      test_unsafeBlockClosureInference_functionCall_explicitDynamicParam_viaExpr1_comment() {
+    // Note: (f/*<dynamic>*/) is nort properly resulting in an instantiated
+    // function type due to dartbug.com/25824.
+    var mainUnit = checkFile('''
 dynamic /*=List<T>*/ f/*<T>*/(dynamic/*=T*/ g()) => <T>[g()];
 var v = (f/*<dynamic>*/)(/*info:INFERRED_TYPE_CLOSURE*/() { return 1; });
 ''');
@@ -4391,6 +5035,17 @@
   void
       test_unsafeBlockClosureInference_functionCall_explicitDynamicParam_viaExpr2() {
     var mainUnit = checkFile('''
+List<T> f<T>(T g()) => <T>[g()];
+var v = (f)<dynamic>(/*info:INFERRED_TYPE_CLOSURE*/() { return 1; });
+''');
+    var v = mainUnit.topLevelVariables[0];
+    expect(v.name, 'v');
+    expect(v.type.toString(), 'List<dynamic>');
+  }
+
+  void
+      test_unsafeBlockClosureInference_functionCall_explicitDynamicParam_viaExpr2_comment() {
+    var mainUnit = checkFile('''
 dynamic /*=List<T>*/ f/*<T>*/(dynamic/*=T*/ g()) => <T>[g()];
 var v = (f)/*<dynamic>*/(/*info:INFERRED_TYPE_CLOSURE*/() { return 1; });
 ''');
@@ -4401,6 +5056,17 @@
 
   void test_unsafeBlockClosureInference_functionCall_explicitTypeParam() {
     var mainUnit = checkFile('''
+List<T> f<T>(T g()) => <T>[g()];
+var v = f<int>(/*info:INFERRED_TYPE_CLOSURE*/() { return 1; });
+''');
+    var v = mainUnit.topLevelVariables[0];
+    expect(v.name, 'v');
+    expect(v.type.toString(), 'List<int>');
+  }
+
+  void
+      test_unsafeBlockClosureInference_functionCall_explicitTypeParam_comment() {
+    var mainUnit = checkFile('''
 dynamic /*=List<T>*/ f/*<T>*/(dynamic/*=T*/ g()) => <T>[g()];
 var v = f/*<int>*/(/*info:INFERRED_TYPE_CLOSURE*/() { return 1; });
 ''');
@@ -4415,6 +5081,20 @@
     // TODO(paulberry): for some reason (f/*<int>) is nort properly resulting
     // in an instantiated function type.
     var mainUnit = checkFile('''
+List<T> f<T>(T g()) => <T>[g()];
+var v = (f/int>)(/*info:INFERRED_TYPE_CLOSURE*/() { return 1; });
+''');
+    var v = mainUnit.topLevelVariables[0];
+    expect(v.name, 'v');
+    expect(v.type.toString(), 'List<int>');
+  }
+
+  @failingTest
+  void
+      test_unsafeBlockClosureInference_functionCall_explicitTypeParam_viaExpr1_comment() {
+    // TODO(paulberry): for some reason (f/*<int>) is nort properly resulting
+    // in an instantiated function type.
+    var mainUnit = checkFile('''
 dynamic /*=List<T>*/ f/*<T>*/(dynamic/*=T*/ g()) => <T>[g()];
 var v = (f/*<int>*/)(/*info:INFERRED_TYPE_CLOSURE*/() { return 1; });
 ''');
@@ -4426,6 +5106,17 @@
   void
       test_unsafeBlockClosureInference_functionCall_explicitTypeParam_viaExpr2() {
     var mainUnit = checkFile('''
+List<T> f<T>(T g()) => <T>[g()];
+var v = (f)<int>(/*info:INFERRED_TYPE_CLOSURE*/() { return 1; });
+''');
+    var v = mainUnit.topLevelVariables[0];
+    expect(v.name, 'v');
+    expect(v.type.toString(), 'List<int>');
+  }
+
+  void
+      test_unsafeBlockClosureInference_functionCall_explicitTypeParam_viaExpr2_comment() {
+    var mainUnit = checkFile('''
 dynamic /*=List<T>*/ f/*<T>*/(dynamic/*=T*/ g()) => <T>[g()];
 var v = (f)/*<int>*/(/*info:INFERRED_TYPE_CLOSURE*/() { return 1; });
 ''');
@@ -4436,6 +5127,20 @@
 
   void test_unsafeBlockClosureInference_functionCall_implicitTypeParam() {
     var mainUnit = checkFile('''
+List<T> f<T>(T g()) => <T>[g()];
+var v = f(
+  /*info:INFERRED_TYPE_CLOSURE,warning:UNSAFE_BLOCK_CLOSURE_INFERENCE*/() {
+    return 1;
+  });
+''');
+    var v = mainUnit.topLevelVariables[0];
+    expect(v.name, 'v');
+    expect(v.type.toString(), 'List<int>');
+  }
+
+  void
+      test_unsafeBlockClosureInference_functionCall_implicitTypeParam_comment() {
+    var mainUnit = checkFile('''
 dynamic /*=List<T>*/ f/*<T>*/(dynamic/*=T*/ g()) => <T>[g()];
 var v = f(
   /*info:INFERRED_TYPE_CLOSURE,warning:UNSAFE_BLOCK_CLOSURE_INFERENCE*/() {
@@ -4450,6 +5155,20 @@
   void
       test_unsafeBlockClosureInference_functionCall_implicitTypeParam_viaExpr() {
     var mainUnit = checkFile('''
+List<T> f<T>(T g()) => <T>[g()];
+var v = (f)(
+  /*info:INFERRED_TYPE_CLOSURE,warning:UNSAFE_BLOCK_CLOSURE_INFERENCE*/() {
+    return 1;
+  });
+''');
+    var v = mainUnit.topLevelVariables[0];
+    expect(v.name, 'v');
+    expect(v.type.toString(), 'List<int>');
+  }
+
+  void
+      test_unsafeBlockClosureInference_functionCall_implicitTypeParam_viaExpr_comment() {
+    var mainUnit = checkFile('''
 dynamic /*=List<T>*/ f/*<T>*/(dynamic/*=T*/ g()) => <T>[g()];
 var v = (f)(
   /*info:INFERRED_TYPE_CLOSURE,warning:UNSAFE_BLOCK_CLOSURE_INFERENCE*/() {
@@ -4546,6 +5265,19 @@
   void test_unsafeBlockClosureInference_methodCall_explicitDynamicParam() {
     var mainUnit = checkFile('''
 class C {
+  List<T> f<T>(T g()) => <T>[g()];
+}
+var v = new C().f<dynamic>(/*info:INFERRED_TYPE_CLOSURE*/() { return 1; });
+''');
+    var v = mainUnit.topLevelVariables[0];
+    expect(v.name, 'v');
+    expect(v.type.toString(), 'List<dynamic>');
+  }
+
+  void
+      test_unsafeBlockClosureInference_methodCall_explicitDynamicParam_comment() {
+    var mainUnit = checkFile('''
+class C {
   dynamic /*=List<T>*/ f/*<T>*/(dynamic/*=T*/ g()) => <T>[g()];
 }
 var v = new C().f/*<dynamic>*/(/*info:INFERRED_TYPE_CLOSURE*/() { return 1; });
@@ -4558,6 +5290,18 @@
   void test_unsafeBlockClosureInference_methodCall_explicitTypeParam() {
     var mainUnit = checkFile('''
 class C {
+  List<T> f<T>(T g()) => <T>[g()];
+}
+var v = new C().f<int>(/*info:INFERRED_TYPE_CLOSURE*/() { return 1; });
+''');
+    var v = mainUnit.topLevelVariables[0];
+    expect(v.name, 'v');
+    expect(v.type.toString(), 'List<int>');
+  }
+
+  void test_unsafeBlockClosureInference_methodCall_explicitTypeParam_comment() {
+    var mainUnit = checkFile('''
+class C {
   dynamic /*=List<T>*/ f/*<T>*/(dynamic/*=T*/ g()) => <T>[g()];
 }
 var v = new C().f/*<int>*/(/*info:INFERRED_TYPE_CLOSURE*/() { return 1; });
@@ -4570,6 +5314,21 @@
   void test_unsafeBlockClosureInference_methodCall_implicitTypeParam() {
     var mainUnit = checkFile('''
 class C {
+  List<T> f<T>(T g()) => <T>[g()];
+}
+var v = new C().f(
+  /*info:INFERRED_TYPE_CLOSURE,warning:UNSAFE_BLOCK_CLOSURE_INFERENCE*/() {
+    return 1;
+  });
+''');
+    var v = mainUnit.topLevelVariables[0];
+    expect(v.name, 'v');
+    expect(v.type.toString(), 'List<int>');
+  }
+
+  void test_unsafeBlockClosureInference_methodCall_implicitTypeParam_comment() {
+    var mainUnit = checkFile('''
+class C {
   dynamic /*=List<T>*/ f/*<T>*/(dynamic/*=T*/ g()) => <T>[g()];
 }
 var v = new C().f(
@@ -4593,6 +5352,68 @@
     expect(v.name, 'v');
     expect(v.type.toString(), 'double');
   }
+
+  void test_voidReturnTypeSubtypesDynamic() {
+    var unit = checkFile(r'''
+T run<T>(T f()) {
+  print("running");
+  var t = f();
+  print("done running");
+  return t;
+}
+
+
+void printRunning() { print("running"); }
+var x = run<dynamic>(printRunning);
+var y = run(printRunning);
+
+main() {
+  void printRunning() { print("running"); }
+  var x = run<dynamic>(printRunning);
+  var y = run(printRunning);
+  x = 123;
+  x = 'hi';
+  y = 123;
+  y = 'hi';
+}
+    ''');
+
+    var x = unit.topLevelVariables[0];
+    var y = unit.topLevelVariables[1];
+    expect(x.type.toString(), 'dynamic');
+    expect(y.type.toString(), 'dynamic');
+  }
+
+  void test_voidReturnTypeSubtypesDynamic_comment() {
+    var unit = checkFile(r'''
+/*=T*/ run/*<T>*/(/*=T*/ f()) {
+  print("running");
+  var t = f();
+  print("done running");
+  return t;
+}
+
+
+void printRunning() { print("running"); }
+var x = run/*<dynamic>*/(printRunning);
+var y = run(printRunning);
+
+main() {
+  void printRunning() { print("running"); }
+  var x = run/*<dynamic>*/(printRunning);
+  var y = run(printRunning);
+  x = 123;
+  x = 'hi';
+  y = 123;
+  y = 'hi';
+}
+    ''');
+
+    var x = unit.topLevelVariables[0];
+    var y = unit.topLevelVariables[1];
+    expect(x.type.toString(), 'dynamic');
+    expect(y.type.toString(), 'dynamic');
+  }
 }
 
 @reflectiveTest
@@ -4630,4 +5451,12 @@
   CompilationUnitElement checkFile(String content) {
     return helper.checkFile(content).element;
   }
+
+  void setUp() {
+    helper.doSetUp();
+  }
+
+  void tearDown() {
+    helper.doTearDown();
+  }
 }
diff --git a/pkg/analyzer/test/src/task/strong/non_null_checker_test.dart b/pkg/analyzer/test/src/task/strong/non_null_checker_test.dart
index d130a54..82aef195 100644
--- a/pkg/analyzer/test/src/task/strong/non_null_checker_test.dart
+++ b/pkg/analyzer/test/src/task/strong/non_null_checker_test.dart
@@ -14,8 +14,9 @@
 import '../strong/strong_test_helper.dart';
 
 void main() {
-  initStrongModeTests();
-  defineReflectiveTests(NonNullCheckerTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(NonNullCheckerTest);
+  });
 }
 
 String _withError(String file, String error) {
@@ -73,6 +74,14 @@
 }
 ''';
 
+  void setUp() {
+    doSetUp();
+  }
+
+  void tearDown() {
+    doTearDown();
+  }
+
   void test_assign_null_to_nonnullable() {
     addFile('''
 int x = 0;
@@ -85,27 +94,6 @@
     check(nonnullableTypes: <String>['dart:core,int']);
   }
 
-  void test_forLoop() {
-    checkFile('''
-class MyList {
-  int length;
-  MyList() {
-    length = 6;
-  }
-  String operator [](int i) {
-    return <String>["Dart", "Java", "JS", "C", "C++", "C#"][i];
-  }
-}
-
-main() {
-  var languages = new MyList();
-  for (int i = 0; i < languages.length; ++i) {
-    print(languages[i]);
-  }
-}
-''');
-  }
-
   void test_compoundAssignment() {
     addFile('''
 void main() {
@@ -130,98 +118,25 @@
     check(nonnullableTypes: <String>['dart:core,int']);
   }
 
-  void test_initialize_nonnullable_with_null() {
-    addFile('int x = /*error:INVALID_ASSIGNMENT*/null;');
-    check(nonnullableTypes: <String>['dart:core,int']);
+  void test_forLoop() {
+    checkFile('''
+class MyList {
+  int length;
+  MyList() {
+    length = 6;
   }
-
-  void test_initialize_nonnullable_with_valid_value() {
-    addFile('int x = 0;');
-    check(nonnullableTypes: <String>['dart:core,int']);
+  String operator [](int i) {
+    return <String>["Dart", "Java", "JS", "C", "C++", "C#"][i];
   }
+}
 
-  void test_nonnullable_fields() {
-    addFile(defaultNnbdExample);
-    // `null` can be passed as an argument to `Point` in default mode.
-    addFile(_withError(defaultNnbdExampleMod1, "error:INVALID_ASSIGNMENT"));
-    // A nullable expression can be passed as an argument to `Point` in default
-    // mode.
-    addFile(_withError(defaultNnbdExampleMod2, "error:INVALID_ASSIGNMENT"));
-    check(nonnullableTypes: <String>['dart:core,int']);
+main() {
+  var languages = new MyList();
+  for (int i = 0; i < languages.length; ++i) {
+    print(languages[i]);
   }
-
-  void test_nullable_fields() {
-    addFile(defaultNnbdExample);
-    // `null` can be passed as an argument to `Point` in default mode.
-    addFile(defaultNnbdExampleMod1);
-    // A nullable expression can be passed as an argument to `Point` in default
-    // mode.
-    addFile(defaultNnbdExampleMod2);
-    check();
-  }
-
-  // Default example from NNBD document.
-  void test_nullableTypes() {
-    // By default x can be set to null.
-    checkFile('int x = null;');
-  }
-
-  void test_prefer_final_to_non_nullable_error() {
-    addFile('main() { final int /*error:FINAL_NOT_INITIALIZED*/x; }');
-    addFile('final int /*error:FINAL_NOT_INITIALIZED*/x;');
-    addFile('''
-void foo() {}
-
-class A {
-  final int x;
-
-  /*warning:FINAL_NOT_INITIALIZED_CONSTRUCTOR_1*/A();
 }
 ''');
-    check(nonnullableTypes: <String>['dart:core,int']);
-  }
-
-  void test_uninitialized_nonnullable_field_declaration() {
-    addFile('''
-void foo() {}
-
-class A {
-  // Ideally, we should allow x to be init in the constructor, but that requires
-  // too much complication in the checker, so for now we throw a static error at
-  // the declaration site.
-  int /*error:NON_NULLABLE_FIELD_NOT_INITIALIZED*/x;
-
-  A();
-}
-''');
-    check(nonnullableTypes: <String>['dart:core,int']);
-  }
-
-  void test_uninitialized_nonnullable_local_variable() {
-    // Ideally, we will do flow analysis and throw an error only if a variable
-    // is used before it has been initialized.
-    addFile('main() { int /*error:NON_NULLABLE_FIELD_NOT_INITIALIZED*/x; }');
-    check(nonnullableTypes: <String>['dart:core,int']);
-  }
-
-  void test_uninitialized_nonnullable_top_level_variable_declaration() {
-    // If `int`s are non-nullable, then this code should throw an error.
-    addFile('int /*error:NON_NULLABLE_FIELD_NOT_INITIALIZED*/x;');
-    check(nonnullableTypes: <String>['dart:core,int']);
-  }
-
-  void test_method_call() {
-    addFile('''
-int s(int x) {
-  return x + 1;
-}
-
-void main() {
-  s(10);
-  s(/*error:INVALID_ASSIGNMENT*/null);
-}
-''');
-    check(nonnullableTypes: <String>['dart:core,int']);
   }
 
   void test_generics() {
@@ -259,6 +174,16 @@
     check(nonnullableTypes: <String>['dart:core,int']);
   }
 
+  void test_initialize_nonnullable_with_null() {
+    addFile('int x = /*error:INVALID_ASSIGNMENT*/null;');
+    check(nonnullableTypes: <String>['dart:core,int']);
+  }
+
+  void test_initialize_nonnullable_with_valid_value() {
+    addFile('int x = 0;');
+    check(nonnullableTypes: <String>['dart:core,int']);
+  }
+
   void test_map() {
     addFile('''
 class Pair<K, V> {
@@ -312,4 +237,88 @@
 ''');
     check(nonnullableTypes: <String>['dart:core,int']);
   }
+
+  // Default example from NNBD document.
+  void test_method_call() {
+    addFile('''
+int s(int x) {
+  return x + 1;
+}
+
+void main() {
+  s(10);
+  s(/*error:INVALID_ASSIGNMENT*/null);
+}
+''');
+    check(nonnullableTypes: <String>['dart:core,int']);
+  }
+
+  void test_nonnullable_fields() {
+    addFile(defaultNnbdExample);
+    // `null` can be passed as an argument to `Point` in default mode.
+    addFile(_withError(defaultNnbdExampleMod1, "error:INVALID_ASSIGNMENT"));
+    // A nullable expression can be passed as an argument to `Point` in default
+    // mode.
+    addFile(_withError(defaultNnbdExampleMod2, "error:INVALID_ASSIGNMENT"));
+    check(nonnullableTypes: <String>['dart:core,int']);
+  }
+
+  void test_nullable_fields() {
+    addFile(defaultNnbdExample);
+    // `null` can be passed as an argument to `Point` in default mode.
+    addFile(defaultNnbdExampleMod1);
+    // A nullable expression can be passed as an argument to `Point` in default
+    // mode.
+    addFile(defaultNnbdExampleMod2);
+    check();
+  }
+
+  void test_nullableTypes() {
+    // By default x can be set to null.
+    checkFile('int x = null;');
+  }
+
+  void test_prefer_final_to_non_nullable_error() {
+    addFile('main() { final int /*error:FINAL_NOT_INITIALIZED*/x; }');
+    addFile('final int /*error:FINAL_NOT_INITIALIZED*/x;');
+    addFile('''
+void foo() {}
+
+class A {
+  final int x;
+
+  /*warning:FINAL_NOT_INITIALIZED_CONSTRUCTOR_1*/A();
+}
+''');
+    check(nonnullableTypes: <String>['dart:core,int']);
+  }
+
+  void test_uninitialized_nonnullable_field_declaration() {
+    addFile('''
+void foo() {}
+
+class A {
+  // Ideally, we should allow x to be init in the constructor, but that requires
+  // too much complication in the checker, so for now we throw a static error at
+  // the declaration site.
+  int /*error:NON_NULLABLE_FIELD_NOT_INITIALIZED*/x;
+
+  A();
+}
+''');
+    check(nonnullableTypes: <String>['dart:core,int']);
+  }
+
+  void test_uninitialized_nonnullable_local_variable() {
+    // Ideally, we will do flow analysis and throw an error only if a variable
+    // is used before it has been initialized.
+    addFile('main() { int /*error:NON_NULLABLE_FIELD_NOT_INITIALIZED*/x; }');
+    check(nonnullableTypes: <String>['dart:core,int']);
+  }
+
+  void test_uninitialized_nonnullable_top_level_variable_declaration() {
+    // If `int`s are non-nullable, then this code should throw an error.
+    addFile('int /*error:NON_NULLABLE_FIELD_NOT_INITIALIZED*/x;');
+    check(nonnullableTypes: <String>['dart:core,int']);
+  }
 }
diff --git a/pkg/analyzer/test/src/task/strong/strong_test_helper.dart b/pkg/analyzer/test/src/task/strong/strong_test_helper.dart
index dd03301..2b8314d 100644
--- a/pkg/analyzer/test/src/task/strong/strong_test_helper.dart
+++ b/pkg/analyzer/test/src/task/strong/strong_test_helper.dart
@@ -19,7 +19,7 @@
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:source_span/source_span.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import '../../context/mock_sdk.dart';
 
@@ -46,7 +46,7 @@
 /// For a single file, you may also use [checkFile].
 void addFile(String content, {String name: '/main.dart'}) {
   name = name.replaceFirst('^package:', '/packages/');
-  files.newFile(name, content);
+  files.newFile(files.convertPath(name), content);
 }
 
 /// Run the checker on a program, staring from '/main.dart', and verifies that
@@ -62,8 +62,8 @@
     List<String> nonnullableTypes: AnalysisOptionsImpl.NONNULLABLE_TYPES}) {
   _checkCalled = true;
 
-  expect(files.getFile('/main.dart').exists, true,
-      reason: '`/main.dart` is missing');
+  File mainFile = files.getFile(files.convertPath('/main.dart'));
+  expect(mainFile.exists, true, reason: '`/main.dart` is missing');
 
   var uriResolver = new _TestUriResolver(files);
   // Enable task model strong mode
@@ -74,13 +74,13 @@
   options.implicitCasts = implicitCasts;
   options.implicitDynamic = implicitDynamic;
   options.nonnullableTypes = nonnullableTypes;
-  var mockSdk = new MockSdk();
+  var mockSdk = new MockSdk(resourceProvider: files);
   (mockSdk.context.analysisOptions as AnalysisOptionsImpl).strongMode = true;
   context.sourceFactory =
       new SourceFactory([new DartUriResolver(mockSdk), uriResolver]);
 
   // Run the checker on /main.dart.
-  Source mainSource = uriResolver.resolveAbsolute(new Uri.file('/main.dart'));
+  Source mainSource = uriResolver.resolveAbsolute(mainFile.toUri());
   var initialLibrary = context.resolveCompilationUnit2(mainSource, mainSource);
 
   var collector = new _ErrorCollector(context);
@@ -123,18 +123,16 @@
   return check();
 }
 
-void initStrongModeTests() {
-  setUp(() {
-    AnalysisEngine.instance.processRequiredPlugins();
-    files = new MemoryResourceProvider();
-    _checkCalled = false;
-  });
+void doSetUp() {
+  AnalysisEngine.instance.processRequiredPlugins();
+  files = new MemoryResourceProvider();
+  _checkCalled = false;
+}
 
-  tearDown(() {
-    // This is a sanity check, in case only addFile is called.
-    expect(_checkCalled, true, reason: 'must call check() method in test case');
-    files = null;
-  });
+void doTearDown() {
+  // This is a sanity check, in case only addFile is called.
+  expect(_checkCalled, true, reason: 'must call check() method in test case');
+  files = null;
 }
 
 SourceSpanWithContext _createSpanHelper(
@@ -402,7 +400,8 @@
   @override
   Source resolveAbsolute(Uri uri, [Uri actualUri]) {
     if (uri.scheme == 'package') {
-      return (provider.getResource('/packages/' + uri.path) as File)
+      return (provider.getResource(
+              provider.convertPath('/packages/' + uri.path)) as File)
           .createSource(uri);
     }
     return super.resolveAbsolute(uri, actualUri);
diff --git a/pkg/analyzer/test/src/task/strong/test_all.dart b/pkg/analyzer/test/src/task/strong/test_all.dart
index 698e2ae..7b65843 100644
--- a/pkg/analyzer/test/src/task/strong/test_all.dart
+++ b/pkg/analyzer/test/src/task/strong/test_all.dart
@@ -4,17 +4,15 @@
 
 library analyzer.test.src.task.strong.test_all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../../utils.dart';
 import 'checker_test.dart' as checker_test;
 import 'inferred_type_test.dart' as inferred_type_test;
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('strong tests', () {
+  defineReflectiveSuite(() {
     checker_test.main();
     inferred_type_test.main();
-  });
+  }, name: 'strong');
 }
diff --git a/pkg/analyzer/test/src/task/strong_mode_test.dart b/pkg/analyzer/test/src/task/strong_mode_test.dart
index 0ede013..fa2877c 100644
--- a/pkg/analyzer/test/src/task/strong_mode_test.dart
+++ b/pkg/analyzer/test/src/task/strong_mode_test.dart
@@ -10,17 +10,17 @@
 import 'package:analyzer/src/dart/resolver/inheritance_manager.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/task/strong_mode.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
-import '../../utils.dart';
 import '../context/abstract_context.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(InstanceMemberInferrerTest);
-  defineReflectiveTests(SetFieldTypeTest);
-  defineReflectiveTests(VariableGathererTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(InstanceMemberInferrerTest);
+    defineReflectiveTests(SetFieldTypeTest);
+    defineReflectiveTests(VariableGathererTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/src/task/test_all.dart b/pkg/analyzer/test/src/task/test_all.dart
index 22108ff..f34c36c 100644
--- a/pkg/analyzer/test/src/task/test_all.dart
+++ b/pkg/analyzer/test/src/task/test_all.dart
@@ -4,9 +4,8 @@
 
 library analyzer.test.src.task.test_all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
 import 'dart_test.dart' as dart_test;
 import 'dart_work_manager_test.dart' as dart_work_manager_test;
 import 'driver_test.dart' as driver_test;
@@ -26,8 +25,7 @@
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('task tests', () {
+  defineReflectiveSuite(() {
     dart_test.main();
     dart_work_manager_test.main();
     driver_test.main();
@@ -43,5 +41,5 @@
     strong_mode_test_all.main();
     strong_mode_test.main();
     yaml_test.main();
-  });
+  }, name: 'task');
 }
diff --git a/pkg/analyzer/test/src/task/yaml_test.dart b/pkg/analyzer/test/src/task/yaml_test.dart
index 34e5dc7..4601360 100644
--- a/pkg/analyzer/test/src/task/yaml_test.dart
+++ b/pkg/analyzer/test/src/task/yaml_test.dart
@@ -8,16 +8,16 @@
 import 'package:analyzer/src/task/yaml.dart';
 import 'package:analyzer/task/general.dart';
 import 'package:analyzer/task/yaml.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 import 'package:yaml/yaml.dart';
 
-import '../../utils.dart';
 import '../context/abstract_context.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(ParseYamlTaskTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ParseYamlTaskTest);
+  });
 }
 
 isInstanceOf isParseYamlTask = new isInstanceOf<ParseYamlTask>();
diff --git a/pkg/analyzer/test/src/test_all.dart b/pkg/analyzer/test/src/test_all.dart
index 94cbace..8f727da 100644
--- a/pkg/analyzer/test/src/test_all.dart
+++ b/pkg/analyzer/test/src/test_all.dart
@@ -4,9 +4,9 @@
 
 library analyzer.test.src.test_all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../utils.dart';
+import 'command_line/test_all.dart' as command_line;
 import 'context/test_all.dart' as context;
 import 'dart/test_all.dart' as dart;
 import 'plugin/plugin_config_test.dart' as plugin;
@@ -17,8 +17,8 @@
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('src tests', () {
+  defineReflectiveSuite(() {
+    command_line.main();
     context.main();
     dart.main();
     plugin.main();
@@ -26,5 +26,5 @@
     summary.main();
     task.main();
     util.main();
-  });
+  }, name: 'src');
 }
diff --git a/pkg/analyzer/test/src/util/absolute_path_test.dart b/pkg/analyzer/test/src/util/absolute_path_test.dart
index f8be96b..42c8449 100644
--- a/pkg/analyzer/test/src/util/absolute_path_test.dart
+++ b/pkg/analyzer/test/src/util/absolute_path_test.dart
@@ -5,15 +5,14 @@
 library analyzer.test.src.util.absolute_path_test;
 
 import 'package:analyzer/src/util/absolute_path.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
-
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AbsolutePathContextPosixTest);
-  defineReflectiveTests(AbsolutePathContextWindowsTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AbsolutePathContextPosixTest);
+    defineReflectiveTests(AbsolutePathContextWindowsTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/src/util/asserts_test.dart b/pkg/analyzer/test/src/util/asserts_test.dart
index 3d8ade7..fdea26a 100644
--- a/pkg/analyzer/test/src/util/asserts_test.dart
+++ b/pkg/analyzer/test/src/util/asserts_test.dart
@@ -5,14 +5,13 @@
 library analyzer.test.src.util.asserts_test;
 
 import 'package:analyzer/src/util/asserts.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
-
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(AnalysisTaskTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AnalysisTaskTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/src/util/fast_uri_test.dart b/pkg/analyzer/test/src/util/fast_uri_test.dart
index a076c96..f04dcb4 100644
--- a/pkg/analyzer/test/src/util/fast_uri_test.dart
+++ b/pkg/analyzer/test/src/util/fast_uri_test.dart
@@ -5,14 +5,13 @@
 library analyzer.test.src.util.fast_uri_test;
 
 import 'package:analyzer/src/util/fast_uri.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
-
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(_FastUriTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(_FastUriTest);
+  });
 }
 
 @reflectiveTest
@@ -118,6 +117,17 @@
     _compareUris(uri3, Uri.parse('package:analyzer/aaa/bbbb/dd/eeee.dart'));
   }
 
+  void test_resolveUri_short_absolute() {
+    // Check the case where the URI being resolved is a "short absolute" uri
+    // (starts with a "/" but doesn't start with "file://").  Such URIs are not
+    // actually valid URIs but we still want to handle them in a way that's
+    // consistent with the behavior of Uri.
+    String containing = 'file:///foo/bar';
+    String relative = '/a.dart';
+    String expectedResult = Uri.parse(containing).resolve(relative).toString();
+    _checkResolveUri(containing, relative, expectedResult);
+  }
+
   void _checkResolveUri(String srcText, String relText, String targetText) {
     Uri src = FastUri.parse(srcText);
     Uri rel = FastUri.parse(relText);
diff --git a/pkg/analyzer/test/src/util/glob_test.dart b/pkg/analyzer/test/src/util/glob_test.dart
index c4c037e..8fffbf7 100644
--- a/pkg/analyzer/test/src/util/glob_test.dart
+++ b/pkg/analyzer/test/src/util/glob_test.dart
@@ -5,15 +5,14 @@
 library analyzer.test.src.util.glob_test;
 
 import 'package:analyzer/src/util/glob.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
-
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(GlobPosixTest);
-  defineReflectiveTests(GlobWindowsTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(GlobPosixTest);
+    defineReflectiveTests(GlobWindowsTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/src/util/lru_map_test.dart b/pkg/analyzer/test/src/util/lru_map_test.dart
index 5d7f86a..369906a 100644
--- a/pkg/analyzer/test/src/util/lru_map_test.dart
+++ b/pkg/analyzer/test/src/util/lru_map_test.dart
@@ -5,14 +5,13 @@
 library analyzer.test.src.util.lru_map_test;
 
 import 'package:analyzer/src/util/lru_map.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
-
-import '../../utils.dart';
 
 main() {
-  initializeTestEnvironment();
-  defineReflectiveTests(_LRUCacheTest);
+  defineReflectiveSuite(() {
+    defineReflectiveTests(_LRUCacheTest);
+  });
 }
 
 @reflectiveTest
diff --git a/pkg/analyzer/test/src/util/test_all.dart b/pkg/analyzer/test/src/util/test_all.dart
index 6091c5b..c41d8c8 100644
--- a/pkg/analyzer/test/src/util/test_all.dart
+++ b/pkg/analyzer/test/src/util/test_all.dart
@@ -4,9 +4,8 @@
 
 library analyzer.test.src.util.test_all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../utils.dart';
 import 'absolute_path_test.dart' as absolute_path_test;
 import 'asserts_test.dart' as asserts_test;
 import 'fast_uri_test.dart' as fast_uri_test;
@@ -16,13 +15,12 @@
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('util tests', () {
+  defineReflectiveSuite(() {
     absolute_path_test.main();
     asserts_test.main();
     fast_uri_test.main();
     glob_test.main();
     lru_map_test.main();
     yaml_test.main();
-  });
+  }, name: 'util');
 }
diff --git a/pkg/analyzer/test/src/util/yaml_test.dart b/pkg/analyzer/test/src/util/yaml_test.dart
index feb812b..4e109ac 100644
--- a/pkg/analyzer/test/src/util/yaml_test.dart
+++ b/pkg/analyzer/test/src/util/yaml_test.dart
@@ -5,13 +5,9 @@
 library analyzer.src.test.util.yaml_test;
 
 import 'package:analyzer/src/util/yaml.dart';
-import 'package:unittest/unittest.dart';
-
-import '../../utils.dart';
+import 'package:test/test.dart';
 
 main() {
-  initializeTestEnvironment();
-
   group('yaml', () {
     group('merge', () {
       test('map', () {
diff --git a/pkg/analyzer/test/stress/for_git_repository.dart b/pkg/analyzer/test/stress/for_git_repository.dart
index 858d7f3..2310581 100644
--- a/pkg/analyzer/test/stress/for_git_repository.dart
+++ b/pkg/analyzer/test/stress/for_git_repository.dart
@@ -27,7 +27,7 @@
 import 'package:analyzer/task/general.dart';
 import 'package:analyzer/task/model.dart';
 import 'package:path/path.dart' as path;
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 main() {
   new StressTest().run();
@@ -244,12 +244,13 @@
     pathContext = resourceProvider.pathContext;
     fs.Folder sdkDirectory =
         FolderBasedDartSdk.defaultSdkDirectory(resourceProvider);
-    sdkManager = new DartSdkManager(sdkDirectory.path, false,
-        (_) => new FolderBasedDartSdk(resourceProvider, sdkDirectory));
+    sdkManager = new DartSdkManager(sdkDirectory.path, false);
     contentCache = new ContentCache();
-    ContextBuilder builder =
-        new ContextBuilder(resourceProvider, sdkManager, contentCache);
-    builder.defaultOptions = new AnalysisOptionsImpl();
+    ContextBuilderOptions builderOptions = new ContextBuilderOptions();
+    builderOptions.defaultOptions = new AnalysisOptionsImpl();
+    ContextBuilder builder = new ContextBuilder(
+        resourceProvider, sdkManager, contentCache,
+        options: builderOptions);
     expectedContext = builder.buildContext(folderPath);
     actualContext = builder.buildContext(folderPath);
     expectedContext.analysisOptions =
diff --git a/pkg/analyzer/test/test_all.dart b/pkg/analyzer/test/test_all.dart
index 1d598fb..d9cdf90 100644
--- a/pkg/analyzer/test/test_all.dart
+++ b/pkg/analyzer/test/test_all.dart
@@ -4,7 +4,7 @@
 
 library analyzer.test.test_all;
 
-import 'package:unittest/unittest.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
 
 import 'cancelable_future_test.dart' as cancelable_future_test;
 import 'context/test_all.dart' as context;
@@ -14,12 +14,10 @@
 import 'parse_compilation_unit_test.dart' as parse_compilation_unit;
 import 'source/test_all.dart' as source;
 import 'src/test_all.dart' as src;
-import 'utils.dart';
 
 /// Utility for manually running all tests.
 main() {
-  initializeTestEnvironment();
-  group('analysis engine', () {
+  defineReflectiveSuite(() {
     cancelable_future_test.main();
     context.main();
     file_system.main();
@@ -28,5 +26,5 @@
     parse_compilation_unit.main();
     source.main();
     src.main();
-  });
+  }, name: 'analyzer');
 }
diff --git a/pkg/analyzer/test/utils.dart b/pkg/analyzer/test/utils.dart
index 863b0ee..be7e64d 100644
--- a/pkg/analyzer/test/utils.dart
+++ b/pkg/analyzer/test/utils.dart
@@ -7,15 +7,8 @@
 import 'package:analyzer/dart/ast/ast.dart';
 import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer/dart/element/type.dart';
-import 'package:analyzer/src/generated/java_io.dart';
 import 'package:analyzer/src/generated/resolver.dart' show TypeProvider;
-import 'package:path/path.dart' as path;
-import 'package:unittest/unittest.dart';
-
-void initializeTestEnvironment([path.Context context]) {
-  groupSep = ' | ';
-  JavaFile.pathContext = context ?? path.posix;
-}
+import 'package:test/test.dart';
 
 /**
  * The type of an assertion which asserts properties of [T]s.
diff --git a/pkg/analyzer/tool/task_dependency_graph/generate.dart b/pkg/analyzer/tool/task_dependency_graph/generate.dart
index 9761e90..26745f6 100644
--- a/pkg/analyzer/tool/task_dependency_graph/generate.dart
+++ b/pkg/analyzer/tool/task_dependency_graph/generate.dart
@@ -154,17 +154,19 @@
     DartSdk sdk = new FolderBasedDartSdk(resourceProvider,
         FolderBasedDartSdk.defaultSdkDirectory(resourceProvider));
     context = AnalysisEngine.instance.createAnalysisContext();
-    ContextBuilder builder = new ContextBuilder(resourceProvider, null, null);
+    ContextBuilderOptions builderOptions = new ContextBuilderOptions();
     if (Platform.packageRoot != null) {
-      builder.defaultPackagesDirectoryPath =
-        Uri.parse(Platform.packageRoot).toFilePath();
+      builderOptions.defaultPackagesDirectoryPath =
+          Uri.parse(Platform.packageRoot).toFilePath();
     } else if (Platform.packageConfig != null) {
-      builder.defaultPackageFilePath =
-        Uri.parse(Platform.packageConfig).toFilePath();
+      builderOptions.defaultPackageFilePath =
+          Uri.parse(Platform.packageConfig).toFilePath();
     } else {
       // Let the context builder use the default algorithm for package
       // resolution.
     }
+    ContextBuilder builder = new ContextBuilder(resourceProvider, null, null,
+        options: builderOptions);
     List<UriResolver> uriResolvers = [
       new DartUriResolver(sdk),
       new PackageMapUriResolver(resourceProvider,
diff --git a/pkg/analyzer_cli/BUILD.gn b/pkg/analyzer_cli/BUILD.gn
new file mode 100644
index 0000000..69993f0
--- /dev/null
+++ b/pkg/analyzer_cli/BUILD.gn
@@ -0,0 +1,23 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for 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("//build/dart/dart_package.gni")
+
+dart_package("analyzer_cli") {
+  package_name = "analyzer_cli"
+
+  source_dir = "lib"
+
+  deps = [
+    "//dart/pkg/analyzer",
+    "//third_party/dart-pkg/pub/args",
+    "//third_party/dart-pkg/pub/bazel_worker",
+    "//third_party/dart-pkg/pub/cli_util",
+    "//third_party/dart-pkg/pub/linter",
+    "//third_party/dart-pkg/pub/package_config",
+    "//third_party/dart-pkg/pub/plugin",
+    "//third_party/dart-pkg/pub/protobuf",
+    "//third_party/dart-pkg/pub/yaml",
+  ]
+}
diff --git a/pkg/analyzer_cli/lib/src/driver.dart b/pkg/analyzer_cli/lib/src/driver.dart
index ec779a7..16ec22d 100644
--- a/pkg/analyzer_cli/lib/src/driver.dart
+++ b/pkg/analyzer_cli/lib/src/driver.dart
@@ -280,10 +280,6 @@
     if (options.disableHints != _previousOptions.disableHints) {
       return false;
     }
-    if (options.enableInitializingFormalAccess !=
-        _previousOptions.enableInitializingFormalAccess) {
-      return false;
-    }
     if (options.enableStrictCallChecks !=
         _previousOptions.enableStrictCallChecks) {
       return false;
@@ -311,6 +307,9 @@
         options.buildSummaryInputs, _previousOptions.buildSummaryInputs)) {
       return false;
     }
+    if (options.disableCacheFlushing != _previousOptions.disableCacheFlushing) {
+      return false;
+    }
     return true;
   }
 
@@ -370,8 +369,10 @@
     UriResolver packageUriResolver;
 
     if (options.packageRootPath != null) {
-      ContextBuilder builder = new ContextBuilder(resourceProvider, null, null);
-      builder.defaultPackagesDirectoryPath = options.packageRootPath;
+      ContextBuilderOptions builderOptions = new ContextBuilderOptions();
+      builderOptions.defaultPackagesDirectoryPath = options.packageRootPath;
+      ContextBuilder builder = new ContextBuilder(resourceProvider, null, null,
+          options: builderOptions);
       packageUriResolver = new PackageMapUriResolver(resourceProvider,
           builder.convertPackagesToMap(builder.createPackageMap('')));
     } else if (options.packageConfigPath == null) {
@@ -410,6 +411,7 @@
     } else {
       // The embedder uri resolver has mappings, use it instead of the default
       // Dart SDK uri resolver.
+      embedderSdk.analysisOptions = _context.analysisOptions;
       resolvers.add(new DartUriResolver(embedderSdk));
     }
 
@@ -663,9 +665,8 @@
       CommandLineOptions options) {
     AnalysisOptionsImpl contextOptions = new AnalysisOptionsImpl();
     contextOptions.trackCacheDependencies = false;
+    contextOptions.disableCacheFlushing = options.disableCacheFlushing;
     contextOptions.hint = !options.disableHints;
-    contextOptions.enableInitializingFormalAccess =
-        options.enableInitializingFormalAccess;
     contextOptions.enableStrictCallChecks = options.enableStrictCallChecks;
     contextOptions.enableSuperMixins = options.enableSuperMixins;
     contextOptions.generateImplicitErrors = options.showPackageWarnings;
diff --git a/pkg/analyzer_cli/lib/src/options.dart b/pkg/analyzer_cli/lib/src/options.dart
index c64eddc..abb3623 100644
--- a/pkg/analyzer_cli/lib/src/options.dart
+++ b/pkg/analyzer_cli/lib/src/options.dart
@@ -74,16 +74,17 @@
   /// A table mapping the names of defined variables to their values.
   final Map<String, String> definedVariables;
 
+  /// Whether to disable cache flushing.  This option can improve analysis
+  /// speed at the expense of memory usage.  It may also be useful for working
+  /// around bugs.
+  final bool disableCacheFlushing;
+
   /// Whether to report hints
   final bool disableHints;
 
   /// Whether to display version information
   final bool displayVersion;
 
-  /// A flag indicating whether access to field formal parameters should be
-  /// allowed in a constructor's initializer list.
-  final bool enableInitializingFormalAccess;
-
   /// Whether to enable null-aware operators (DEP 9).
   final bool enableNullAwareOperators;
 
@@ -171,9 +172,9 @@
         dartSdkSummaryPath = args['dart-sdk-summary'],
         definedVariables = definedVariables,
         analysisOptionsFile = args['options'],
+        disableCacheFlushing = args['disable-cache-flushing'],
         disableHints = args['no-hints'],
         displayVersion = args['version'],
-        enableInitializingFormalAccess = args['initializing-formal-access'],
         enableNullAwareOperators = args['enable-null-aware-operators'],
         enableStrictCallChecks = args['enable-strict-call-checks'],
         enableSuperMixins = args['supermixin'],
@@ -314,6 +315,7 @@
           help: 'Do not show hint results.',
           defaultsTo: false,
           negatable: false)
+      ..addFlag('disable-cache-flushing', defaultsTo: false, hide: true)
       ..addFlag('ignore-unrecognized-flags',
           help: 'Ignore unrecognized command line flags.',
           defaultsTo: false,
diff --git a/pkg/analyzer_cli/pubspec.yaml b/pkg/analyzer_cli/pubspec.yaml
index a19fecb..2c0108f 100644
--- a/pkg/analyzer_cli/pubspec.yaml
+++ b/pkg/analyzer_cli/pubspec.yaml
@@ -16,6 +16,6 @@
   protobuf: ^0.5.0
   yaml: ^2.1.2
 dev_dependencies:
-  test_reflective_loader: '>=0.0.3 <0.1.0'
+  test_reflective_loader: ^0.1.0
   typed_mock: '>=0.0.4 <1.0.0'
-  unittest: '>=0.9.0 <0.12.0'
+  test: ^0.12.0
diff --git a/pkg/analyzer_cli/test/boot_loader_test.dart b/pkg/analyzer_cli/test/boot_loader_test.dart
index d24d961..30223fb 100644
--- a/pkg/analyzer_cli/test/boot_loader_test.dart
+++ b/pkg/analyzer_cli/test/boot_loader_test.dart
@@ -11,7 +11,7 @@
 import 'package:analyzer_cli/src/driver.dart';
 import 'package:analyzer_cli/src/options.dart';
 import 'package:path/path.dart' as path;
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import 'utils.dart';
 
@@ -43,8 +43,6 @@
 
   tearDown(() => _tearDown());
 
-  initializeTestEnvironment();
-
   group('Bootloader', () {
     group('plugin processing', () {
       test('bad format', () {
diff --git a/pkg/analyzer_cli/test/build_mode_test.dart b/pkg/analyzer_cli/test/build_mode_test.dart
index 5e16d95..22f20a9 100644
--- a/pkg/analyzer_cli/test/build_mode_test.dart
+++ b/pkg/analyzer_cli/test/build_mode_test.dart
@@ -11,8 +11,8 @@
 import 'package:bazel_worker/bazel_worker.dart';
 import 'package:bazel_worker/testing.dart';
 import 'package:protobuf/protobuf.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 main() {
   defineReflectiveTests(WorkerLoopTest);
diff --git a/pkg/analyzer_cli/test/driver_test.dart b/pkg/analyzer_cli/test/driver_test.dart
index cacbc28..222d96d 100644
--- a/pkg/analyzer_cli/test/driver_test.dart
+++ b/pkg/analyzer_cli/test/driver_test.dart
@@ -14,12 +14,11 @@
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/services/lint.dart';
-import 'package:analyzer/src/task/options.dart';
 import 'package:analyzer_cli/src/driver.dart';
 import 'package:analyzer_cli/src/options.dart';
 import 'package:path/path.dart' as path;
 import 'package:plugin/plugin.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 import 'package:yaml/src/yaml_node.dart';
 
 import 'utils.dart';
@@ -52,8 +51,6 @@
 
   tearDown(() => _tearDown());
 
-  initializeTestEnvironment();
-
   group('Driver', () {
     group('options', () {
       test('custom processor', () {
@@ -300,7 +297,7 @@
                 ErrorSeverity.WARNING);
             // Should not be made fatal by `--fatal-warnings`.
             expect(outSink.toString(),
-                contains("[warning] The function 'baz' is not defined"));
+                contains("[warning] The function 'baz' isn't defined"));
             expect(
                 outSink.toString(), contains("1 error and 1 warning found."));
           });
@@ -429,7 +426,7 @@
 Driver driver;
 
 List<ErrorProcessor> get processors =>
-    driver.context.getConfigurationData(CONFIGURED_ERROR_PROCESSORS);
+    driver.context.analysisOptions.errorProcessors;
 
 /// Convert a file specification from a relative path to an absolute path.
 /// Handles the case where the file specification is of the form "$uri|$path".
diff --git a/pkg/analyzer_cli/test/embedder_test.dart b/pkg/analyzer_cli/test/embedder_test.dart
index 93bbaf5..c1c544c 100644
--- a/pkg/analyzer_cli/test/embedder_test.dart
+++ b/pkg/analyzer_cli/test/embedder_test.dart
@@ -8,13 +8,11 @@
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer_cli/src/driver.dart' show Driver, errorSink, outSink;
 import 'package:path/path.dart' as path;
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import 'utils.dart';
 
 main() {
-  initializeTestEnvironment();
-
   group('_embedder.yaml', () {
     StringSink savedOutSink, savedErrorSink;
     int savedExitCode;
diff --git a/pkg/analyzer_cli/test/error_test.dart b/pkg/analyzer_cli/test/error_test.dart
index ad80133..f71a212 100644
--- a/pkg/analyzer_cli/test/error_test.dart
+++ b/pkg/analyzer_cli/test/error_test.dart
@@ -2,10 +2,9 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-
 library analyzer_cli.test.error;
 
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import 'utils.dart';
 
@@ -20,35 +19,47 @@
     });
 
     test("an error on the first line", () {
-      expect(errorsForFile('void foo;\n'), equals(
-          "Error in test.dart: Variables cannot have a type of 'void'\n"));
+      expect(
+          errorsForFile('void foo;\n'),
+          equals(
+              "Error in test.dart: Variables can't have a type of 'void'.\n"));
     });
 
     test("an error on the last line", () {
-      expect(errorsForFile('\nvoid foo;'), equals(
-          "Error in test.dart: Variables cannot have a type of 'void'\n"));
+      expect(
+          errorsForFile('\nvoid foo;'),
+          equals(
+              "Error in test.dart: Variables can't have a type of 'void'.\n"));
     });
 
     test("an error in the middle", () {
-      expect(errorsForFile('\nvoid foo;\n'), equals(
-          "Error in test.dart: Variables cannot have a type of 'void'\n"));
+      expect(
+          errorsForFile('\nvoid foo;\n'),
+          equals(
+              "Error in test.dart: Variables can't have a type of 'void'.\n"));
     });
 
     var veryLongString = new List.filled(107, ' ').join('');
 
     test("an error at the end of a very long line", () {
-      expect(errorsForFile('$veryLongString     void foo;'), equals(
-          "Error in test.dart: Variables cannot have a type of 'void'\n"));
+      expect(
+          errorsForFile('$veryLongString     void foo;'),
+          equals(
+              "Error in test.dart: Variables can't have a type of 'void'.\n"));
     });
 
     test("an error at the beginning of a very long line", () {
-      expect(errorsForFile('void foo;     $veryLongString'), equals(
-          "Error in test.dart: Variables cannot have a type of 'void'\n"));
+      expect(
+          errorsForFile('void foo;     $veryLongString'),
+          equals(
+              "Error in test.dart: Variables can't have a type of 'void'.\n"));
     });
 
     test("an error in the middle of a very long line", () {
-      expect(errorsForFile('$veryLongString void foo;$veryLongString'), equals(
-          "Error in test.dart: Variables cannot have a type of 'void'\n"));
+      expect(
+          errorsForFile('$veryLongString void foo;$veryLongString'),
+          equals(
+              "Error in test.dart: Variables can't have a type of 'void'.\n"));
     });
   });
 }
diff --git a/pkg/analyzer_cli/test/options_test.dart b/pkg/analyzer_cli/test/options_test.dart
index b74edc1..f30a6e4 100644
--- a/pkg/analyzer_cli/test/options_test.dart
+++ b/pkg/analyzer_cli/test/options_test.dart
@@ -9,8 +9,8 @@
 import 'package:analyzer_cli/src/driver.dart';
 import 'package:analyzer_cli/src/options.dart';
 import 'package:args/args.dart';
+import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 main() {
   group('CommandLineOptions', () {
@@ -27,6 +27,7 @@
         expect(options.buildSummaryOutputSemantic, isNull);
         expect(options.buildSuppressExitCode, isFalse);
         expect(options.dartSdkPath, isNotNull);
+        expect(options.disableCacheFlushing, isFalse);
         expect(options.disableHints, isFalse);
         expect(options.lints, isFalse);
         expect(options.displayVersion, isFalse);
@@ -60,6 +61,12 @@
         expect(options.definedVariables['bar'], isNull);
       });
 
+      test('disable cache flushing', () {
+        CommandLineOptions options = CommandLineOptions
+            .parse(['--dart-sdk', '.', '--disable-cache-flushing', 'foo.dart']);
+        expect(options.disableCacheFlushing, isTrue);
+      });
+
       test('enable strict call checks', () {
         CommandLineOptions options = CommandLineOptions.parse(
             ['--dart-sdk', '.', '--enable-strict-call-checks', 'foo.dart']);
diff --git a/pkg/analyzer_cli/test/package_prefix_test.dart b/pkg/analyzer_cli/test/package_prefix_test.dart
index 22d71e1..1a3f9b0 100644
--- a/pkg/analyzer_cli/test/package_prefix_test.dart
+++ b/pkg/analyzer_cli/test/package_prefix_test.dart
@@ -3,7 +3,7 @@
 import 'package:analyzer_cli/src/driver.dart' show Driver, outSink, errorSink;
 import 'package:analyzer_cli/src/options.dart' show ExitHandler, exitHandler;
 import 'package:path/path.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import 'utils.dart' show testDirectory;
 
diff --git a/pkg/analyzer_cli/test/perf_report_test.dart b/pkg/analyzer_cli/test/perf_report_test.dart
index 19d91a1..313328d 100644
--- a/pkg/analyzer_cli/test/perf_report_test.dart
+++ b/pkg/analyzer_cli/test/perf_report_test.dart
@@ -9,7 +9,7 @@
 import 'package:analyzer_cli/src/error_formatter.dart' show AnalysisStats;
 import 'package:analyzer_cli/src/options.dart';
 import 'package:analyzer_cli/src/perf_report.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 main() {
   test('makePerfReport', () {
diff --git a/pkg/analyzer_cli/test/plugin_manager_test.dart b/pkg/analyzer_cli/test/plugin_manager_test.dart
index 16280b2..e257300 100644
--- a/pkg/analyzer_cli/test/plugin_manager_test.dart
+++ b/pkg/analyzer_cli/test/plugin_manager_test.dart
@@ -6,7 +6,7 @@
 
 import 'package:analyzer/src/plugin/plugin_configuration.dart';
 import 'package:analyzer_cli/src/plugin/plugin_manager.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 main() {
   group('plugin manager tests', () {
diff --git a/pkg/analyzer_cli/test/reporter_test.dart b/pkg/analyzer_cli/test/reporter_test.dart
index 3a0853b..7e9070f 100644
--- a/pkg/analyzer_cli/test/reporter_test.dart
+++ b/pkg/analyzer_cli/test/reporter_test.dart
@@ -6,8 +6,8 @@
 
 import 'package:analyzer/analyzer.dart';
 import 'package:analyzer_cli/src/error_formatter.dart';
+import 'package:test/test.dart' hide ErrorFormatter;
 import 'package:typed_mock/typed_mock.dart';
-import 'package:unittest/unittest.dart' hide ErrorFormatter;
 
 import 'mocks.dart';
 
diff --git a/pkg/analyzer_cli/test/sdk_ext_test.dart b/pkg/analyzer_cli/test/sdk_ext_test.dart
index 3eb5c62..535897c 100644
--- a/pkg/analyzer_cli/test/sdk_ext_test.dart
+++ b/pkg/analyzer_cli/test/sdk_ext_test.dart
@@ -12,7 +12,7 @@
 import 'package:analyzer_cli/src/driver.dart' show Driver, errorSink, outSink;
 import 'package:analyzer_cli/src/options.dart';
 import 'package:path/path.dart' as path;
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import 'utils.dart';
 
diff --git a/pkg/analyzer_cli/test/strong_mode_test.dart b/pkg/analyzer_cli/test/strong_mode_test.dart
index 7060fa8..29644f9 100644
--- a/pkg/analyzer_cli/test/strong_mode_test.dart
+++ b/pkg/analyzer_cli/test/strong_mode_test.dart
@@ -8,7 +8,7 @@
 
 import 'package:analyzer_cli/src/driver.dart' show Driver, errorSink, outSink;
 import 'package:path/path.dart' as path;
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import 'driver_test.dart';
 import 'utils.dart';
diff --git a/pkg/analyzer_cli/test/super_mixin_test.dart b/pkg/analyzer_cli/test/super_mixin_test.dart
index d2b7afe..f890289 100644
--- a/pkg/analyzer_cli/test/super_mixin_test.dart
+++ b/pkg/analyzer_cli/test/super_mixin_test.dart
@@ -8,7 +8,7 @@
 
 import 'package:analyzer_cli/src/driver.dart' show Driver, errorSink, outSink;
 import 'package:path/path.dart' as path;
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 
 import 'utils.dart';
 
@@ -45,11 +45,11 @@
       expect(
           stdout,
           contains(
-              "[error] The class 'C' cannot be used as a mixin because it extends a class other than Object"));
+              "[error] The class 'C' can't be used as a mixin because it extends a class other than Object"));
       expect(
           stdout,
           contains(
-              "[error] The class 'C' cannot be used as a mixin because it references 'super'"));
+              "[error] The class 'C' can't be used as a mixin because it references 'super'"));
       expect(stdout, contains('2 errors found.'));
       expect(errorSink.toString(), '');
     });
diff --git a/pkg/analyzer_cli/test/utils.dart b/pkg/analyzer_cli/test/utils.dart
index 8e28b93..85fa759 100644
--- a/pkg/analyzer_cli/test/utils.dart
+++ b/pkg/analyzer_cli/test/utils.dart
@@ -9,10 +9,8 @@
 
 import 'package:analyzer/analyzer.dart';
 import 'package:path/path.dart' as pathos;
-import 'package:unittest/unittest.dart';
 
-/// Gets the test directory in a way that works with
-/// package:test and package:unittest.
+/// Gets the test directory in a way that works with package:test
 /// See <https://github.com/dart-lang/test/issues/110> for more info.
 final String testDirectory = pathos.dirname(
     pathos.fromUri((reflectClass(_TestUtils).owner as LibraryMirror).uri));
@@ -41,11 +39,6 @@
   });
 }
 
-/// Test env setup (copied from `analyzer/test/utils.dart`).
-void initializeTestEnvironment() {
-  groupSep = ' | ';
-}
-
 /// Creates a temporary directory and passes its path to [fn]. Once [fn]
 /// completes, the temporary directory and all its contents will be deleted.
 ///
diff --git a/pkg/analyzer_cli/tool/perf.dart b/pkg/analyzer_cli/tool/perf.dart
index 3c97e23..40a747a 100644
--- a/pkg/analyzer_cli/tool/perf.dart
+++ b/pkg/analyzer_cli/tool/perf.dart
@@ -5,6 +5,7 @@
 /// An entrypoint used to run portions of analyzer and measure its performance.
 library analyzer_cli.tool.perf;
 
+import 'dart:async';
 import 'dart:io' show exit;
 
 import 'package:analyzer/dart/ast/ast.dart';
@@ -23,33 +24,36 @@
 import 'package:analyzer/src/generated/source_io.dart';
 import 'package:package_config/discovery.dart';
 
-/// Cummulative total number of chars scanned.
+/// Cumulative total number of chars scanned.
 int scanTotalChars = 0;
 
-/// Cummulative time spent scanning.
+/// Cumulative time spent scanning.
 Stopwatch scanTimer = new Stopwatch();
 
 /// Factory to load and resolve app, packages, and sdk sources.
 SourceFactory sources;
 
-main(args) {
+main(List<String> args) async {
   // TODO(sigmund): provide sdk folder as well.
-  if (args.length < 3) {
-    print('usage: perf.dart <bench-id> <package-root> <entry.dart>');
+  if (args.length < 2) {
+    print('usage: perf.dart <bench-id> <entry.dart>');
     exit(1);
   }
   var totalTimer = new Stopwatch()..start();
 
   var bench = args[0];
-  var packageRoot = Uri.base.resolve(args[1]);
-  var entryUri = Uri.base.resolve(args[2]);
+  var entryUri = Uri.base.resolve(args[1]);
 
-  setup(packageRoot);
+  await setup(entryUri);
+
   if (bench == 'scan') {
-    scanReachableFiles(entryUri);
+    Set<Source> files = scanReachableFiles(entryUri);
+    // TODO(sigmund): consider replacing the warmup with instrumented snapshots.
+    for (int i = 0; i < 10; i++) scanFiles(files);
   } else if (bench == 'parse') {
     Set<Source> files = scanReachableFiles(entryUri);
-    parseFiles(files);
+    // TODO(sigmund): consider replacing the warmup with instrumented snapshots.
+    for (int i = 0; i < 10; i++) parseFiles(files);
   } else {
     print('unsupported bench-id: $bench. Please specify "scan" or "parse"');
     // TODO(sigmund): implement the remaining benchmarks.
@@ -62,10 +66,10 @@
 
 /// Sets up analyzer to be able to load and resolve app, packages, and sdk
 /// sources.
-void setup(Uri packageRoot) {
+Future setup(Uri entryUri) async {
   var provider = PhysicalResourceProvider.INSTANCE;
   var packageMap = new ContextBuilder(provider, null, null)
-      .convertPackagesToMap(getPackagesDirectory(packageRoot));
+      .convertPackagesToMap(await findPackages(entryUri));
   sources = new SourceFactory([
     new ResourceUriResolver(provider),
     new PackageMapUriResolver(provider, packageMap),
@@ -80,16 +84,25 @@
   var files = new Set<Source>();
   var loadTimer = new Stopwatch()..start();
   collectSources(sources.forUri2(entryUri), files);
-  collectSources(sources.forUri("dart:async"), files);
-  collectSources(sources.forUri("dart:collection"), files);
-  collectSources(sources.forUri("dart:convert"), files);
-  collectSources(sources.forUri("dart:core"), files);
-  collectSources(sources.forUri("dart:developer"), files);
-  collectSources(sources.forUri("dart:_internal"), files);
-  collectSources(sources.forUri("dart:isolate"), files);
-  collectSources(sources.forUri("dart:math"), files);
-  collectSources(sources.forUri("dart:mirrors"), files);
-  collectSources(sources.forUri("dart:typed_data"), files);
+
+  var libs = [
+    "dart:async",
+    "dart:collection",
+    "dart:convert",
+    "dart:core",
+    "dart:developer",
+    "dart:_internal",
+    "dart:isolate",
+    "dart:math",
+    "dart:mirrors",
+    "dart:typed_data",
+    "dart:io"
+  ];
+
+  for (var lib in libs) {
+    collectSources(sources.forUri(lib), files);
+  }
+
   loadTimer.stop();
 
   print('input size: ${scanTotalChars} chars');
@@ -99,6 +112,24 @@
   return files;
 }
 
+/// Scans every file in [files] and reports the time spent doing so.
+void scanFiles(Set<Source> files) {
+  // The code below will record again how many chars are scanned and how long it
+  // takes to scan them, even though we already did so in [scanReachableFiles].
+  // Recording and reporting this twice is unnecessary, but we do so for now to
+  // validate that the results are consistent.
+  scanTimer = new Stopwatch();
+  var old = scanTotalChars;
+  scanTotalChars = 0;
+  for (var source in files) {
+    tokenize(source);
+  }
+
+  // Report size and scanning time again. See discussion above.
+  if (old != scanTotalChars) print('input size changed? ${old} chars');
+  report("scan", scanTimer.elapsedMicroseconds);
+}
+
 /// Parses every file in [files] and reports the time spent doing so.
 void parseFiles(Set<Source> files) {
   // The code below will record again how many chars are scanned and how long it
@@ -156,7 +187,7 @@
   // TODO(sigmund): is there a way to scan from a random-access-file without
   // first converting to String?
   var scanner = new Scanner(source, new CharSequenceReader(contents),
-      AnalysisErrorListener.NULL_LISTENER);
+      AnalysisErrorListener.NULL_LISTENER)..preserveComments = false;
   var token = scanner.tokenize();
   scanTimer.stop();
   return token;
diff --git a/pkg/compiler/lib/src/closure.dart b/pkg/compiler/lib/src/closure.dart
index f44b2d2..f9885ba 100644
--- a/pkg/compiler/lib/src/closure.dart
+++ b/pkg/compiler/lib/src/closure.dart
@@ -19,36 +19,66 @@
 import 'resolution/tree_elements.dart' show TreeElements;
 import 'tokens/token.dart' show Token;
 import 'tree/tree.dart';
-import 'universe/universe.dart' show CodegenUniverse;
 import 'util/util.dart';
 
 class ClosureTask extends CompilerTask {
-  Map<Node, ClosureClassMap> closureMappingCache;
+  Map<Element, ClosureClassMap> _closureMappingCache =
+      <Element, ClosureClassMap>{};
   Compiler compiler;
   ClosureTask(Compiler compiler)
-      : closureMappingCache = new Map<Node, ClosureClassMap>(),
-        compiler = compiler,
+      : compiler = compiler,
         super(compiler.measurer);
 
   String get name => "Closure Simplifier";
 
   DiagnosticReporter get reporter => compiler.reporter;
 
+  /// Returns the [ClosureClassMap] computed for [resolvedAst].
+  ClosureClassMap getClosureToClassMapping(ResolvedAst resolvedAst) {
+    return measure(() {
+      Element element = resolvedAst.element;
+      if (element.isGenerativeConstructorBody) {
+        ConstructorBodyElement constructorBody = element;
+        element = constructorBody.constructor;
+      }
+      ClosureClassMap closureClassMap = _closureMappingCache[element];
+      assert(invariant(resolvedAst.element, closureClassMap != null,
+          message: "No ClosureClassMap computed for ${element}."));
+      return closureClassMap;
+    });
+  }
+
+  /// Create [ClosureClassMap]s for all live members.
+  void createClosureClasses() {
+    compiler.enqueuer.resolution.processedElements
+        .forEach((AstElement element) {
+      ResolvedAst resolvedAst = element.resolvedAst;
+      if (element.isAbstract) return;
+      if (element.isField &&
+          !element.isInstanceMember &&
+          resolvedAst.body == null) {
+        // Skip top-level/static fields without an initializer.
+        return;
+      }
+      computeClosureToClassMapping(resolvedAst);
+    });
+  }
+
   ClosureClassMap computeClosureToClassMapping(ResolvedAst resolvedAst) {
     return measure(() {
       Element element = resolvedAst.element;
+      ClosureClassMap cached = _closureMappingCache[element];
+      if (cached != null) return cached;
       if (resolvedAst.kind != ResolvedAstKind.PARSED) {
-        return new ClosureClassMap(null, null, null, new ThisLocal(element));
+        return _closureMappingCache[element] =
+            new ClosureClassMap(null, null, null, new ThisLocal(element));
       }
       return reporter.withCurrentElement(element.implementation, () {
         Node node = resolvedAst.node;
         TreeElements elements = resolvedAst.elements;
 
-        ClosureClassMap cached = closureMappingCache[node];
-        if (cached != null) return cached;
-
         ClosureTranslator translator =
-            new ClosureTranslator(compiler, elements, closureMappingCache);
+            new ClosureTranslator(compiler, elements, _closureMappingCache);
 
         // The translator will store the computed closure-mappings inside the
         // cache. One for given node and one for each nested closure.
@@ -57,7 +87,8 @@
         } else if (element.isSynthesized) {
           reporter.internalError(
               element, "Unexpected synthesized element: $element");
-          return new ClosureClassMap(null, null, null, new ThisLocal(element));
+          _closureMappingCache[element] =
+              new ClosureClassMap(null, null, null, new ThisLocal(element));
         } else {
           assert(invariant(element, element.isField,
               message: "Expected $element to be a field."));
@@ -69,26 +100,17 @@
             assert(invariant(element, element.isInstanceMember,
                 message: "Expected $element (${element
                     .runtimeType}) to be an instance field."));
-            closureMappingCache[node] =
+            _closureMappingCache[element] =
                 new ClosureClassMap(null, null, null, new ThisLocal(element));
           }
         }
-        assert(closureMappingCache[node] != null);
-        return closureMappingCache[node];
+        assert(invariant(element, _closureMappingCache[element] != null,
+            message: "No ClosureClassMap computed for ${element}."));
+        return _closureMappingCache[element];
       });
     });
   }
 
-  ClosureClassMap getMappingForNestedFunction(FunctionExpression node) {
-    return measure(() {
-      ClosureClassMap nestedClosureData = closureMappingCache[node];
-      if (nestedClosureData == null) {
-        reporter.internalError(node, "No closure cache.");
-      }
-      return nestedClosureData;
-    });
-  }
-
   void forgetElement(var closure) {
     ClosureClassElement cls;
     if (closure is ClosureFieldElement) {
@@ -99,7 +121,7 @@
       throw new SpannableAssertionFailure(
           closure, 'Not a closure: $closure (${closure.runtimeType}).');
     }
-    compiler.enqueuer.codegen.forgetElement(cls);
+    compiler.enqueuer.codegen.forgetElement(cls, compiler);
   }
 }
 
@@ -526,7 +548,7 @@
   int boxedFieldCounter = 0;
   bool inTryStatement = false;
 
-  final Map<Node, ClosureClassMap> closureMappingCache;
+  final Map<Element, ClosureClassMap> closureMappingCache;
 
   // Map of captured variables. Initially they will map to `null`. If
   // a variable needs to be boxed then the scope declaring the variable
@@ -535,7 +557,7 @@
       new Map<Local, BoxFieldElement>();
 
   // List of encountered closures.
-  List<Expression> closures = <Expression>[];
+  List<LocalFunctionElement> closures = <LocalFunctionElement>[];
 
   // The local variables that have been declared in the current scope.
   List<LocalVariableElement> scopeVariables;
@@ -630,7 +652,7 @@
   // free variables to the boxed value. It also adds the field-elements to the
   // class representing the closure.
   void updateClosures() {
-    for (Expression closure in closures) {
+    for (LocalFunctionElement closure in closures) {
       // The captured variables that need to be stored in a field of the closure
       // class.
       Set<Local> fieldCaptures = new Set<Local>();
@@ -1074,7 +1096,7 @@
     executableContext = element;
     if (insideClosure) {
       closure = element;
-      closures.add(node);
+      closures.add(closure);
       closureData = globalizeClosure(node, closure);
     } else {
       outermostElement = element;
@@ -1084,7 +1106,10 @@
       }
       closureData = new ClosureClassMap(null, null, null, thisElement);
     }
-    closureMappingCache[node] = closureData;
+    closureMappingCache[element.declaration] = closureData;
+    if (closureData.callElement != null) {
+      closureMappingCache[closureData.callElement] = closureData;
+    }
 
     inNewScope(node, () {
       DartType type = element.type;
diff --git a/pkg/compiler/lib/src/commandline_options.dart b/pkg/compiler/lib/src/commandline_options.dart
index 94a751c..81248d9 100644
--- a/pkg/compiler/lib/src/commandline_options.dart
+++ b/pkg/compiler/lib/src/commandline_options.dart
@@ -51,11 +51,17 @@
 
   static const String conditionalDirectives = '--conditional-directives';
 
-  // Experimental flags.
-
-  // Considerations about this feature (esp. locations where generalizations
-  // or changes are required for full support of generic methods) are marked
-  // with 'GENERIC_METHODS'. The approach taken is to parse generic methods,
+  // The syntax-only level of support for generic methods is included in the
+  // 1.50 milestone for Dart. It is not experimental, but also not permanent:
+  // a full implementation is expected in the future. Hence, the
+  // 'GENERIC_METHODS' comments which were added when this feature was
+  // experimental have been preserved, such that it will be easy to find the
+  // relevant locations to update when generic methods are implemented fully.
+  //
+  // The option is still accepted, but it has no effect: The feature is enabled
+  // by default and it cannot be disabled.
+  //
+  // The approach taken in the implementation is to parse generic methods,
   // introduce AST nodes for them, generate corresponding types (such that
   // front end treatment is consistent with the code that programmers wrote),
   // but considering all method type variables to have bound `dynamic` no
@@ -63,9 +69,17 @@
   // is unchecked), and then replacing method type variables by a `DynamicType`
   // (such that the backend does not need to take method type arguments into
   // account).
+  //
+  // The feature has an informal specification which is available at
+  // https://gist.github.com/eernstg/4353d7b4f669745bed3a5423e04a453c.
   static const String genericMethodSyntax = '--generic-method-syntax';
-  static const String resolveOnly = '--resolve-only';
+
+  // Initializing-formal access is enabled by default and cannot be disabled.
+  // For backward compatibility the option is still accepted, but it is ignored.
   static const String initializingFormalAccess = '--initializing-formal-access';
+
+  // Experimental flags.
+  static const String resolveOnly = '--resolve-only';
 }
 
 class Option {
diff --git a/pkg/compiler/lib/src/common/backend_api.dart b/pkg/compiler/lib/src/common/backend_api.dart
index b93ddee..089058c 100644
--- a/pkg/compiler/lib/src/common/backend_api.dart
+++ b/pkg/compiler/lib/src/common/backend_api.dart
@@ -17,7 +17,7 @@
 import '../constants/values.dart' show ConstantValue;
 import '../dart_types.dart' show DartType, InterfaceType;
 import '../elements/elements.dart'
-    show ClassElement, Element, FunctionElement, LibraryElement;
+    show ClassElement, Element, FunctionElement, MethodElement, LibraryElement;
 import '../enqueue.dart' show Enqueuer, EnqueueTask, ResolutionEnqueuer;
 import '../io/code_output.dart' show CodeBuffer;
 import '../io/source_information.dart' show SourceInformationStrategy;
@@ -33,7 +33,6 @@
 import '../universe/world_impact.dart'
     show ImpactStrategy, WorldImpact, WorldImpactBuilder;
 import 'codegen.dart' show CodegenWorkItem;
-import 'registry.dart' show Registry;
 import 'tasks.dart' show CompilerTask;
 
 abstract class Backend extends Target {
@@ -83,20 +82,21 @@
 
   void initializeHelperClasses() {}
 
-  void enqueueHelpers(ResolutionEnqueuer world, Registry registry);
+  /// Compute the [WorldImpact] for backend helper methods.
+  WorldImpact computeHelpersImpact();
 
   /// Creates an [Enqueuer] for code generation specific to this backend.
-  Enqueuer createCodegenEnqueuer(Compiler compiler);
+  Enqueuer createCodegenEnqueuer(CompilerTask task, Compiler compiler);
 
   WorldImpact codegen(CodegenWorkItem work);
 
   // The backend determines the native resolution enqueuer, with a no-op
   // default, so tools like dart2dart can ignore the native classes.
-  native.NativeEnqueuer nativeResolutionEnqueuer(world) {
+  native.NativeEnqueuer nativeResolutionEnqueuer() {
     return new native.NativeEnqueuer();
   }
 
-  native.NativeEnqueuer nativeCodegenEnqueuer(world) {
+  native.NativeEnqueuer nativeCodegenEnqueuer() {
     return new native.NativeEnqueuer();
   }
 
@@ -117,71 +117,78 @@
 
   /// Enable deferred loading. Returns `true` if the backend supports deferred
   /// loading.
-  bool enableDeferredLoadingIfSupported(Spannable node, Registry registry);
+  bool enableDeferredLoadingIfSupported(Spannable node);
+
+  /// Returns the [WorldImpact] of enabling deferred loading.
+  WorldImpact computeDeferredLoadingImpact() => const WorldImpact();
 
   /// Called during codegen when [constant] has been used.
   void computeImpactForCompileTimeConstant(ConstantValue constant,
       WorldImpactBuilder impactBuilder, bool isForResolution) {}
 
-  /// Called to notify to the backend that a class is being instantiated.
-  // TODO(johnniwinther): Remove this. It's only called once for each [cls] and
-  // only with [Compiler.globalDependencies] as [registry].
-  void registerInstantiatedClass(
-      ClassElement cls, Enqueuer enqueuer, Registry registry) {}
+  /// Called to notify to the backend that a class is being instantiated. Any
+  /// backend specific [WorldImpact] of this is returned.
+  WorldImpact registerInstantiatedClass(ClassElement cls,
+          {bool forResolution}) =>
+      const WorldImpact();
 
   /// Called to notify to the backend that a class is implemented by an
-  /// instantiated class.
-  void registerImplementedClass(
-      ClassElement cls, Enqueuer enqueuer, Registry registry) {}
+  /// instantiated class. Any backend specific [WorldImpact] of this is
+  /// returned.
+  WorldImpact registerImplementedClass(ClassElement cls,
+          {bool forResolution}) =>
+      const WorldImpact();
 
   /// Called to instruct to the backend register [type] as instantiated on
   /// [enqueuer].
-  void registerInstantiatedType(
-      InterfaceType type, Enqueuer enqueuer, Registry registry,
-      {bool mirrorUsage: false}) {
-    registry.registerDependency(type.element);
-    enqueuer.registerInstantiatedType(type, mirrorUsage: mirrorUsage);
-  }
+  void registerInstantiatedType(InterfaceType type) {}
 
   /// Register a runtime type variable bound tests between [typeArgument] and
   /// [bound].
   void registerTypeVariableBoundsSubtypeCheck(
       DartType typeArgument, DartType bound) {}
 
-  /**
-   * Call this to register that an instantiated generic class has a call
-   * method.
-   */
-  void registerCallMethodWithFreeTypeVariables(
-      Element callMethod, Enqueuer enqueuer, Registry registry) {}
+  /// Called to register that an instantiated generic class has a call method.
+  /// Any backend specific [WorldImpact] of this is returned.
+  ///
+  /// Note: The [callMethod] is registered even thought it doesn't reference
+  /// the type variables.
+  WorldImpact registerCallMethodWithFreeTypeVariables(Element callMethod,
+          {bool forResolution}) =>
+      const WorldImpact();
 
   /// Called to instruct the backend to register that a closure exists for a
-  /// function on an instantiated generic class.
-  void registerClosureWithFreeTypeVariables(
-      Element closure, Enqueuer enqueuer, Registry registry) {}
+  /// function on an instantiated generic class. Any backend specific
+  /// [WorldImpact] of this is returned.
+  WorldImpact registerClosureWithFreeTypeVariables(Element closure,
+          {bool forResolution}) =>
+      const WorldImpact();
 
-  /// Call this to register that a member has been closurized.
-  void registerBoundClosure(Enqueuer enqueuer) {}
+  /// Called to register that a member has been closurized. Any backend specific
+  /// [WorldImpact] of this is returned.
+  WorldImpact registerBoundClosure() => const WorldImpact();
 
-  /// Call this to register that a static function has been closurized.
-  void registerGetOfStaticFunction(Enqueuer enqueuer) {}
+  /// Called to register that a static function has been closurized. Any backend
+  /// specific [WorldImpact] of this is returned.
+  WorldImpact registerGetOfStaticFunction() => const WorldImpact();
 
-  /**
-   * Call this to register that the [:runtimeType:] property has been accessed.
-   */
-  void registerRuntimeType(Enqueuer enqueuer, Registry registry) {}
+  /// Called to register that the `runtimeType` property has been accessed. Any
+  /// backend specific [WorldImpact] of this is returned.
+  WorldImpact registerRuntimeType() => const WorldImpact();
 
-  /// Call this to register a `noSuchMethod` implementation.
+  /// Called to register a `noSuchMethod` implementation.
   void registerNoSuchMethod(FunctionElement noSuchMethodElement) {}
 
-  /// Call this method to enable support for `noSuchMethod`.
-  void enableNoSuchMethod(Enqueuer enqueuer) {}
+  /// Called to enable support for `noSuchMethod`. Any backend specific
+  /// [WorldImpact] of this is returned.
+  WorldImpact enableNoSuchMethod() => const WorldImpact();
 
   /// Returns whether or not `noSuchMethod` support has been enabled.
   bool get enabledNoSuchMethod => false;
 
-  /// Call this method to enable support for isolates.
-  void enableIsolateSupport(Enqueuer enqueuer) {}
+  /// Called to enable support for isolates. Any backend specific [WorldImpact]
+  /// of this is returned.
+  WorldImpact enableIsolateSupport({bool forResolution});
 
   void registerConstSymbol(String name) {}
 
@@ -213,7 +220,10 @@
     return false;
   }
 
-  void registerStaticUse(Element element, Enqueuer enqueuer) {}
+  /// Called to register that [element] is statically known to be used. Any
+  /// backend specific [WorldImpact] of this is returned.
+  WorldImpact registerStaticUse(Element element, {bool forResolution}) =>
+      const WorldImpact();
 
   /// This method is called immediately after the [LibraryElement] [library] has
   /// been created.
@@ -320,10 +330,10 @@
 
   void forgetElement(Element element) {}
 
-  void registerMainHasArguments(Enqueuer enqueuer) {}
-
-  void registerAsyncMarker(
-      FunctionElement element, Enqueuer enqueuer, Registry registry) {}
+  /// Computes the [WorldImpact] of calling [mainMethod] as the entry point.
+  WorldImpact computeMainImpact(MethodElement mainMethod,
+          {bool forResolution}) =>
+      const WorldImpact();
 
   /// Returns the location of the patch-file associated with [libraryName]
   /// resolved from [plaformConfigUri].
@@ -368,7 +378,8 @@
 class ImpactTransformer {
   /// Transform the [ResolutionImpact] into a [WorldImpact] adding the
   /// backend dependencies for features used in [worldImpact].
-  WorldImpact transformResolutionImpact(ResolutionImpact worldImpact) {
+  WorldImpact transformResolutionImpact(
+      ResolutionEnqueuer enqueuer, ResolutionImpact worldImpact) {
     return worldImpact;
   }
 
diff --git a/pkg/compiler/lib/src/common/codegen.dart b/pkg/compiler/lib/src/common/codegen.dart
index 5214585..748f222 100644
--- a/pkg/compiler/lib/src/common/codegen.dart
+++ b/pkg/compiler/lib/src/common/codegen.dart
@@ -5,7 +5,7 @@
 library dart2js.common.codegen;
 
 import '../common.dart';
-import '../compiler.dart' show Compiler;
+import '../common/backend_api.dart' show Backend;
 import '../constants/values.dart' show ConstantValue;
 import '../dart_types.dart' show DartType, InterfaceType;
 import '../elements/elements.dart'
@@ -21,7 +21,6 @@
 import '../universe/world_impact.dart'
     show WorldImpact, WorldImpactBuilderImpl, WorldImpactVisitor;
 import '../util/util.dart' show Pair, Setlet;
-import 'registry.dart' show Registry;
 import 'work.dart' show WorkItem;
 
 class CodegenImpact extends WorldImpact {
@@ -146,20 +145,23 @@
 
 // TODO(johnniwinther): Split this class into interface and implementation.
 // TODO(johnniwinther): Move this implementation to the JS backend.
-class CodegenRegistry extends Registry {
-  final Compiler compiler;
+class CodegenRegistry {
   final Element currentElement;
   final _CodegenImpact worldImpact;
 
-  CodegenRegistry(Compiler compiler, AstElement currentElement)
-      : this.compiler = compiler,
-        this.currentElement = currentElement,
+  CodegenRegistry(AstElement currentElement)
+      : this.currentElement = currentElement,
         this.worldImpact = new _CodegenImpact();
 
   bool get isForResolution => false;
 
   String toString() => 'CodegenRegistry for $currentElement';
 
+  /// Add the uses in [impact] to the impact of this registry.
+  void addImpact(WorldImpact impact) {
+    worldImpact.addImpact(impact);
+  }
+
   @deprecated
   void registerInstantiatedClass(ClassElement element) {
     registerInstantiation(element.rawType);
@@ -219,8 +221,9 @@
 class CodegenWorkItem extends WorkItem {
   CodegenRegistry registry;
   final ResolvedAst resolvedAst;
+  final Backend backend;
 
-  factory CodegenWorkItem(Compiler compiler, AstElement element) {
+  factory CodegenWorkItem(Backend backend, AstElement element) {
     // If this assertion fails, the resolution callbacks of the backend may be
     // missing call of form registry.registerXXX. Alternatively, the code
     // generation could spuriously be adding dependencies on things we know we
@@ -228,18 +231,16 @@
     assert(invariant(element, element.hasResolvedAst,
         message: "$element has no resolved ast."));
     ResolvedAst resolvedAst = element.resolvedAst;
-    return new CodegenWorkItem.internal(resolvedAst);
+    return new CodegenWorkItem.internal(resolvedAst, backend);
   }
 
-  CodegenWorkItem.internal(ResolvedAst resolvedAst)
+  CodegenWorkItem.internal(ResolvedAst resolvedAst, this.backend)
       : this.resolvedAst = resolvedAst,
         super(resolvedAst.element);
 
-  WorldImpact run(Compiler compiler, Enqueuer world) {
-    if (world.isProcessed(element)) return const WorldImpact();
-
-    registry = new CodegenRegistry(compiler, element);
-    return compiler.codegen(this, world);
+  WorldImpact run() {
+    registry = new CodegenRegistry(element);
+    return backend.codegen(this);
   }
 
   String toString() => 'CodegenWorkItem(${resolvedAst.element})';
diff --git a/pkg/compiler/lib/src/common/names.dart b/pkg/compiler/lib/src/common/names.dart
index 2fa535b..06ef360 100644
--- a/pkg/compiler/lib/src/common/names.dart
+++ b/pkg/compiler/lib/src/common/names.dart
@@ -152,6 +152,10 @@
   /// The URI for 'dart:async'.
   static final Uri dart_async = new Uri(scheme: 'dart', path: 'async');
 
+  /// The URI for 'dart:collection'.
+  static final Uri dart_collection =
+      new Uri(scheme: 'dart', path: 'collection');
+
   /// The URI for 'dart:core'.
   static final Uri dart_core = new Uri(scheme: 'dart', path: 'core');
 
@@ -167,4 +171,13 @@
   /// The URI for 'dart:_native_typed_data'.
   static final Uri dart__native_typed_data =
       new Uri(scheme: 'dart', path: '_native_typed_data');
+
+  /// The URI for 'dart:svg'.
+  static final Uri dart_svg = new Uri(scheme: 'dart', path: 'svg');
+
+  /// The URI for 'dart:web_audio'.
+  static final Uri dart_web_audio = new Uri(scheme: 'dart', path: 'web_audio');
+
+  /// The URI for 'dart:web_gl'.
+  static final Uri dart_web_gl = new Uri(scheme: 'dart', path: 'web_gl');
 }
diff --git a/pkg/compiler/lib/src/common/registry.dart b/pkg/compiler/lib/src/common/registry.dart
deleted file mode 100644
index 08d6081..0000000
--- a/pkg/compiler/lib/src/common/registry.dart
+++ /dev/null
@@ -1,13 +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 dart2js.common.registry;
-
-import '../elements/elements.dart' show Element;
-
-// TODO(johnniwinther): Remove this.
-/// Interface for registration of element dependencies.
-abstract class Registry {
-  void registerDependency(Element element) {}
-}
diff --git a/pkg/compiler/lib/src/common/resolution.dart b/pkg/compiler/lib/src/common/resolution.dart
index 538692a..2adfe26 100644
--- a/pkg/compiler/lib/src/common/resolution.dart
+++ b/pkg/compiler/lib/src/common/resolution.dart
@@ -28,7 +28,7 @@
 import '../enqueue.dart' show ResolutionEnqueuer;
 import '../id_generator.dart';
 import '../mirrors_used.dart';
-import '../options.dart' show CompilerOptions, ParserOptions;
+import '../options.dart' show CompilerOptions;
 import '../parser/element_listener.dart' show ScannerOptions;
 import '../parser/parser_task.dart';
 import '../patch_parser.dart';
@@ -41,18 +41,24 @@
 import 'work.dart' show WorkItem;
 
 /// [WorkItem] used exclusively by the [ResolutionEnqueuer].
-class ResolutionWorkItem extends WorkItem {
+abstract class ResolutionWorkItem implements WorkItem {
+  factory ResolutionWorkItem(Resolution resolution, AstElement element) =
+      _ResolutionWorkItem;
+}
+
+class _ResolutionWorkItem extends WorkItem implements ResolutionWorkItem {
   bool _isAnalyzed = false;
+  final Resolution resolution;
 
-  ResolutionWorkItem(AstElement element) : super(element);
+  _ResolutionWorkItem(this.resolution, AstElement element) : super(element);
 
-  WorldImpact run(Compiler compiler, ResolutionEnqueuer world) {
-    WorldImpact impact = compiler.analyze(this, world);
+  WorldImpact run() {
+    assert(invariant(element, !_isAnalyzed,
+        message: 'Element ${element} has already been analyzed'));
+    WorldImpact impact = resolution.computeWorldImpact(element);
     _isAnalyzed = true;
     return impact;
   }
-
-  bool get isAnalyzed => _isAnalyzed;
 }
 
 class ResolutionImpact extends WorldImpact {
@@ -158,6 +164,9 @@
   /// Resolve [element] if it has not already been resolved.
   void ensureResolved(Element element);
 
+  /// Ensure the resolution of all members of [element].
+  void ensureClassMembers(ClassElement element);
+
   /// Registers that [element] has a compile time error.
   ///
   /// The error itself is given in [message].
@@ -207,15 +216,10 @@
 
 /// A container of commonly used dependencies for tasks that involve parsing.
 abstract class ParsingContext {
-  factory ParsingContext(
-      DiagnosticReporter reporter,
-      ParserOptions parserOptions,
-      ParserTask parser,
-      PatchParserTask patchParser,
-      Backend backend) = _ParsingContext;
+  factory ParsingContext(DiagnosticReporter reporter, ParserTask parser,
+      PatchParserTask patchParser, Backend backend) = _ParsingContext;
 
   DiagnosticReporter get reporter;
-  ParserOptions get parserOptions;
   ParserTask get parser;
   PatchParserTask get patchParser;
 
@@ -233,13 +237,11 @@
 
 class _ParsingContext implements ParsingContext {
   final DiagnosticReporter reporter;
-  final ParserOptions parserOptions;
   final ParserTask parser;
   final PatchParserTask patchParser;
   final Backend backend;
 
-  _ParsingContext(this.reporter, this.parserOptions, this.parser,
-      this.patchParser, this.backend);
+  _ParsingContext(this.reporter, this.parser, this.patchParser, this.backend);
 
   @override
   measure(f()) => parser.measure(f);
diff --git a/pkg/compiler/lib/src/common/work.dart b/pkg/compiler/lib/src/common/work.dart
index c44c4251..c36a2a5 100644
--- a/pkg/compiler/lib/src/common/work.dart
+++ b/pkg/compiler/lib/src/common/work.dart
@@ -18,5 +18,5 @@
     assert(invariant(element, element.isDeclaration));
   }
 
-  WorldImpact run(Compiler compiler, Enqueuer world);
+  WorldImpact run();
 }
diff --git a/pkg/compiler/lib/src/compile_time_constants.dart b/pkg/compiler/lib/src/compile_time_constants.dart
index a8f3a89..a1d62a2 100644
--- a/pkg/compiler/lib/src/compile_time_constants.dart
+++ b/pkg/compiler/lib/src/compile_time_constants.dart
@@ -1241,13 +1241,10 @@
       if (parameter.isInitializingFormal) {
         InitializingFormalElement initializingFormal = parameter;
         updateFieldValue(node, initializingFormal.fieldElement, argument);
-        if (compiler.options.enableInitializingFormalAccess) {
-          definitions[parameter] = argument;
-        }
       } else {
         potentiallyCheckType(parameter, argument);
-        definitions[parameter] = argument;
       }
+      definitions[parameter] = argument;
     });
   }
 
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index 789cbe4..db282a3 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -13,7 +13,6 @@
 import 'common/codegen.dart' show CodegenWorkItem;
 import 'common/names.dart' show Selectors;
 import 'common/names.dart' show Identifiers, Uris;
-import 'common/registry.dart' show Registry;
 import 'common/resolution.dart'
     show
         ParsingContext,
@@ -36,8 +35,7 @@
 import 'dump_info.dart' show DumpInfoTask;
 import 'elements/elements.dart';
 import 'elements/modelx.dart' show ErroneousElementX;
-import 'enqueue.dart'
-    show Enqueuer, EnqueueTask, ResolutionEnqueuer, QueueFilter;
+import 'enqueue.dart' show Enqueuer, EnqueueTask, ResolutionEnqueuer;
 import 'environment.dart';
 import 'id_generator.dart';
 import 'io/source_information.dart' show SourceInformation;
@@ -57,9 +55,7 @@
 import 'parser/diet_parser_task.dart' show DietParserTask;
 import 'parser/parser_task.dart' show ParserTask;
 import 'patch_parser.dart' show PatchParserTask;
-import 'resolution/registry.dart' show ResolutionRegistry;
 import 'resolution/resolution.dart' show ResolverTask;
-import 'resolution/tree_elements.dart' show TreeElementMapping;
 import 'resolved_uri_translator.dart';
 import 'scanner/scanner_task.dart' show ScannerTask;
 import 'script.dart' show Script;
@@ -71,11 +67,16 @@
 import 'tree/tree.dart' show Node, TypeAnnotation;
 import 'typechecker.dart' show TypeCheckerTask;
 import 'types/types.dart' show GlobalTypeInferenceTask;
-import 'types/masks.dart' show CommonMasks;
 import 'universe/selector.dart' show Selector;
-import 'universe/universe.dart' show ResolutionUniverse, CodegenUniverse;
-import 'universe/use.dart' show StaticUse;
-import 'universe/world_impact.dart' show ImpactStrategy, WorldImpact;
+import 'universe/world_builder.dart'
+    show ResolutionWorldBuilder, CodegenWorldBuilder;
+import 'universe/use.dart' show StaticUse, TypeUse;
+import 'universe/world_impact.dart'
+    show
+        ImpactStrategy,
+        WorldImpact,
+        WorldImpactBuilder,
+        WorldImpactBuilderImpl;
 import 'util/util.dart' show Link, Setlet;
 import 'world.dart' show ClosedWorld, ClosedWorldRefiner, OpenWorld, WorldImpl;
 
@@ -88,11 +89,11 @@
   Measurer get measurer;
 
   final IdGenerator idGenerator = new IdGenerator();
-  WorldImpl _world;
+  WorldImpl get _world => resolverWorld.openWorld;
   Types types;
   _CompilerCoreTypes _coreTypes;
   CompilerDiagnosticReporter _reporter;
-  _CompilerResolution _resolution;
+  CompilerResolution _resolution;
   ParsingContext _parsingContext;
 
   final CacheStrategy cacheStrategy;
@@ -113,16 +114,6 @@
    */
   GlobalDependencyRegistry globalDependencies;
 
-  /**
-   * Dependencies that are only included due to mirrors.
-   *
-   * We should get rid of this and ensure that all dependencies are
-   * associated with a particular element.
-   */
-  // TODO(johnniwinther): This should not be a [ResolutionRegistry].
-  final Registry mirrorDependencies =
-      new ResolutionRegistry(null, new TreeElementMapping(null));
-
   /// Options provided from command-line arguments.
   final CompilerOptions options;
 
@@ -148,7 +139,6 @@
   CommonElements get commonElements => _coreTypes;
   CoreClasses get coreClasses => _coreTypes;
   CoreTypes get coreTypes => _coreTypes;
-  CommonMasks get commonMasks => globalInference.masks;
   Resolution get resolution => _resolution;
   ParsingContext get parsingContext => _parsingContext;
 
@@ -190,13 +180,8 @@
   MirrorUsageAnalyzerTask mirrorUsageAnalyzerTask;
   DumpInfoTask dumpInfoTask;
 
-  /// A customizable filter that is applied to enqueued work items.
-  QueueFilter enqueuerFilter = new QueueFilter();
-
-  bool enabledRuntimeType = false;
-  bool enabledFunctionApply = false;
-  bool enabledInvokeOn = false;
-  bool hasIsolateSupport = false;
+  bool get hasFunctionApplySupport => resolverWorld.hasFunctionApplySupport;
+  bool get hasIsolateSupport => resolverWorld.hasIsolateSupport;
 
   bool get hasCrashed => _reporter.hasCrashed;
 
@@ -225,13 +210,12 @@
         this.userOutputProvider = outputProvider == null
             ? const NullCompilerOutput()
             : outputProvider {
-    _world = new WorldImpl(this);
     if (makeReporter != null) {
       _reporter = makeReporter(this, options);
     } else {
       _reporter = new CompilerDiagnosticReporter(this, options);
     }
-    _resolution = new _CompilerResolution(this);
+    _resolution = createResolution();
     // TODO(johnniwinther): Initialize core types in [initializeCoreClasses] and
     // make its field final.
     _coreTypes = new _CompilerCoreTypes(_resolution, reporter);
@@ -249,14 +233,9 @@
     if (makeBackend != null) {
       backend = makeBackend(this);
     } else {
-      js_backend.JavaScriptBackend jsBackend = new js_backend.JavaScriptBackend(
-          this,
-          generateSourceMap: options.generateSourceMap,
-          useStartupEmitter: options.useStartupEmitter,
-          useNewSourceInfo: options.useNewSourceInfo,
-          useKernel: options.useKernel);
-      backend = jsBackend;
+      backend = createBackend();
     }
+    enqueuer = backend.makeEnqueuer();
 
     if (options.dumpInfo && options.useStartupEmitter) {
       throw new ArgumentError(
@@ -264,8 +243,7 @@
     }
 
     tasks = [
-      dietParser =
-          new DietParserTask(options, idGenerator, backend, reporter, measurer),
+      dietParser = new DietParserTask(idGenerator, backend, reporter, measurer),
       scanner = createScannerTask(),
       serialization = new SerializationTask(this),
       libraryLoader = new LibraryLoaderTask(
@@ -279,8 +257,8 @@
           environment,
           reporter,
           measurer),
-      parser = new ParserTask(this, options),
-      patchParser = new PatchParserTask(this, options),
+      parser = new ParserTask(this),
+      patchParser = new PatchParserTask(this),
       resolver = createResolverTask(),
       closureToClassMapper = new closureMapping.ClosureTask(this),
       checker = new TypeCheckerTask(this),
@@ -288,7 +266,9 @@
       constants = backend.constantCompilerTask,
       deferredLoadTask = new DeferredLoadTask(this),
       mirrorUsageAnalyzerTask = new MirrorUsageAnalyzerTask(this),
-      enqueuer = backend.makeEnqueuer(),
+      // [enqueuer] is created earlier because it contains the resolution world
+      // objects needed by other tasks.
+      enqueuer,
       dumpInfoTask = new DumpInfoTask(this),
       selfTask = new GenericTask('self', measurer),
     ];
@@ -297,7 +277,7 @@
     }
 
     _parsingContext =
-        new ParsingContext(reporter, options, parser, patchParser, backend);
+        new ParsingContext(reporter, parser, patchParser, backend);
 
     tasks.addAll(backend.tasks);
   }
@@ -316,6 +296,17 @@
     return _world;
   }
 
+  /// Creates the backend.
+  ///
+  /// Override this to mock the backend for testing.
+  Backend createBackend() {
+    return new js_backend.JavaScriptBackend(this,
+        generateSourceMap: options.generateSourceMap,
+        useStartupEmitter: options.useStartupEmitter,
+        useNewSourceInfo: options.useNewSourceInfo,
+        useKernel: options.useKernel);
+  }
+
   /// Creates the scanner task.
   ///
   /// Override this to mock the scanner for testing.
@@ -323,6 +314,11 @@
       new ScannerTask(dietParser, reporter, measurer,
           preserveComments: options.preserveComments, commentMap: commentMap);
 
+  /// Creates the resolution object.
+  ///
+  /// Override this to mock resolution for testing.
+  Resolution createResolution() => new CompilerResolution(this);
+
   /// Creates the resolver task.
   ///
   /// Override this to mock the resolver for testing.
@@ -333,8 +329,8 @@
 
   // TODO(johnniwinther): Rename these appropriately when unification of worlds/
   // universes is complete.
-  ResolutionUniverse get resolverWorld => enqueuer.resolution.universe;
-  CodegenUniverse get codegenWorld => enqueuer.codegen.universe;
+  ResolutionWorldBuilder get resolverWorld => enqueuer.resolution.universe;
+  CodegenWorldBuilder get codegenWorld => enqueuer.codegen.universe;
 
   bool get analyzeAll => options.analyzeAll || compileAll;
 
@@ -559,9 +555,10 @@
     });
   }
 
-  void computeMain() {
-    if (mainApp == null) return;
+  WorldImpact computeMain() {
+    if (mainApp == null) return const WorldImpact();
 
+    WorldImpactBuilderImpl impactBuilder = new WorldImpactBuilderImpl();
     Element main = mainApp.findExported(Identifiers.main);
     ErroneousElement errorElement = null;
     if (main == null) {
@@ -602,7 +599,7 @@
               parameter);
           mainFunction = backend.helperForMainArity();
           // Don't warn about main not being used:
-          enqueuer.resolution.registerStaticUse(new StaticUse.foreignUse(main));
+          impactBuilder.registerStaticUse(new StaticUse.foreignUse(main));
         });
       }
     }
@@ -619,6 +616,7 @@
       reporter.reportWarningMessage(errorElement, errorElement.messageKind,
           errorElement.messageArguments);
     }
+    return impactBuilder;
   }
 
   /// Analyze all members of the library in [libraryUri].
@@ -636,8 +634,8 @@
         .loadLibrary(libraryUri, skipFileWithPartOfTag: true)
         .then((LibraryElement library) {
       if (library == null) return null;
-      fullyEnqueueLibrary(library, enqueuer.resolution);
-      emptyQueue(enqueuer.resolution);
+      enqueuer.resolution.applyImpact(computeImpactForLibrary(library));
+      emptyQueue(enqueuer.resolution, onProgress: showResolutionProgress);
       enqueuer.resolution.logSummary(reporter.log);
       return library;
     });
@@ -646,7 +644,7 @@
   /// Performs the compilation when all libraries have been loaded.
   void compileLoadedLibraries() =>
       selfTask.measureSubtask("Compiler.compileLoadedLibraries", () {
-        computeMain();
+        WorldImpact mainImpact = computeMain();
 
         mirrorUsageAnalyzerTask.analyzeUsage(mainApp);
 
@@ -661,35 +659,45 @@
             supportSerialization: serialization.supportSerialization);
 
         phase = PHASE_RESOLVING;
+        enqueuer.resolution.applyImpact(mainImpact);
         if (options.resolveOnly) {
           libraryLoader.libraries.where((LibraryElement library) {
             return !serialization.isDeserialized(library);
           }).forEach((LibraryElement library) {
             reporter.log('Enqueuing ${library.canonicalUri}');
-            fullyEnqueueLibrary(library, enqueuer.resolution);
+            enqueuer.resolution.applyImpact(computeImpactForLibrary(library));
           });
         } else if (analyzeAll) {
           libraryLoader.libraries.forEach((LibraryElement library) {
             reporter.log('Enqueuing ${library.canonicalUri}');
-            fullyEnqueueLibrary(library, enqueuer.resolution);
+            enqueuer.resolution.applyImpact(computeImpactForLibrary(library));
           });
         } else if (options.analyzeMain) {
           if (mainApp != null) {
-            fullyEnqueueLibrary(mainApp, enqueuer.resolution);
+            enqueuer.resolution.applyImpact(computeImpactForLibrary(mainApp));
           }
           if (librariesToAnalyzeWhenRun != null) {
             for (Uri libraryUri in librariesToAnalyzeWhenRun) {
-              fullyEnqueueLibrary(
-                  libraryLoader.lookupLibrary(libraryUri), enqueuer.resolution);
+              enqueuer.resolution.applyImpact(computeImpactForLibrary(
+                  libraryLoader.lookupLibrary(libraryUri)));
             }
           }
         }
+        if (deferredLoadTask.isProgramSplit) {
+          enqueuer.resolution
+              .applyImpact(backend.computeDeferredLoadingImpact());
+        }
         // Elements required by enqueueHelpers are global dependencies
         // that are not pulled in by a particular element.
-        backend.enqueueHelpers(enqueuer.resolution, globalDependencies);
+        enqueuer.resolution.applyImpact(backend.computeHelpersImpact());
         resolveLibraryMetadata();
         reporter.log('Resolving...');
-        processQueue(enqueuer.resolution, mainFunction);
+        if (mainFunction != null && !mainFunction.isMalformed) {
+          mainFunction.computeType(resolution);
+        }
+
+        processQueue(enqueuer.resolution, mainFunction,
+            onProgress: showResolutionProgress);
         enqueuer.resolution.logSummary(reporter.log);
 
         _reporter.reportSuppressedMessagesSummary();
@@ -723,14 +731,8 @@
           return;
         }
         assert(mainFunction != null);
-        phase = PHASE_DONE_RESOLVING;
 
-        openWorld.closeWorld();
-        // Compute whole-program-knowledge that the backend needs. (This might
-        // require the information computed in [world.populate].)
-        backend.onResolutionComplete();
-
-        deferredLoadTask.onResolutionComplete(mainFunction);
+        closeResolution();
 
         reporter.log('Inferring types...');
         globalInference.runGlobalTypeInference(mainFunction);
@@ -741,17 +743,19 @@
 
         reporter.log('Compiling...');
         phase = PHASE_COMPILING;
+
         backend.onCodegenStart();
-        // TODO(johnniwinther): Move these to [CodegenEnqueuer].
         if (hasIsolateSupport) {
-          backend.enableIsolateSupport(enqueuer.codegen);
+          enqueuer.codegen
+              .applyImpact(backend.enableIsolateSupport(forResolution: false));
         }
         if (compileAll) {
           libraryLoader.libraries.forEach((LibraryElement library) {
-            fullyEnqueueLibrary(library, enqueuer.codegen);
+            enqueuer.codegen.applyImpact(computeImpactForLibrary(library));
           });
         }
-        processQueue(enqueuer.codegen, mainFunction);
+        processQueue(enqueuer.codegen, mainFunction,
+            onProgress: showCodegenProgress);
         enqueuer.codegen.logSummary(reporter.log);
 
         int programSize = backend.assembleProgram();
@@ -766,19 +770,50 @@
         checkQueues();
       });
 
-  void fullyEnqueueLibrary(LibraryElement library, Enqueuer world) {
-    void enqueueAll(Element element) {
-      fullyEnqueueTopLevelElement(element, world);
+  /// Perform the steps needed to fully end the resolution phase.
+  void closeResolution() {
+    phase = PHASE_DONE_RESOLVING;
+
+    openWorld.closeWorld(reporter);
+    // Compute whole-program-knowledge that the backend needs. (This might
+    // require the information computed in [world.closeWorld].)
+    backend.onResolutionComplete();
+
+    deferredLoadTask.onResolutionComplete(mainFunction);
+
+    // TODO(johnniwinther): Move this after rti computation but before
+    // reflection members computation, and (re-)close the world afterwards.
+    closureToClassMapper.createClosureClasses();
+  }
+
+  /// Compute the [WorldImpact] for accessing all elements in [library].
+  WorldImpact computeImpactForLibrary(LibraryElement library) {
+    WorldImpactBuilderImpl impactBuilder = new WorldImpactBuilderImpl();
+
+    void registerStaticUse(Element element) {
+      impactBuilder.registerStaticUse(new StaticUse.directUse(element));
     }
 
-    library.implementation.forEachLocalMember(enqueueAll);
+    void registerElement(Element element) {
+      if (element.isClass) {
+        ClassElement cls = element;
+        cls.ensureResolved(resolution);
+        cls.forEachLocalMember(registerStaticUse);
+        impactBuilder.registerTypeUse(new TypeUse.instantiation(cls.rawType));
+      } else {
+        registerStaticUse(element);
+      }
+    }
+
+    library.implementation.forEachLocalMember(registerElement);
+
     library.imports.forEach((ImportElement import) {
       if (import.isDeferred) {
         // `import.prefix` and `loadLibrary` may be `null` when the deferred
         // import has compile-time errors.
         GetterElement loadLibrary = import.prefix?.loadLibrary;
         if (loadLibrary != null) {
-          world.addToWorkList(loadLibrary);
+          registerStaticUse(loadLibrary);
         }
       }
       if (serialization.supportSerialization) {
@@ -799,17 +834,7 @@
         }
       });
     }
-  }
-
-  void fullyEnqueueTopLevelElement(Element element, Enqueuer world) {
-    if (element.isClass) {
-      ClassElement cls = element;
-      cls.ensureResolved(resolution);
-      cls.forEachLocalMember(enqueuer.resolution.addToWorkList);
-      backend.registerInstantiatedType(cls.rawType, world, globalDependencies);
-    } else {
-      world.addToWorkList(element);
-    }
+    return impactBuilder;
   }
 
   // Resolves metadata on library elements.  This is necessary in order to
@@ -826,59 +851,49 @@
   }
 
   /**
-   * Empty the [world] queue.
+   * Empty the [enqueuer] queue.
    */
-  void emptyQueue(Enqueuer world) =>
-      selfTask.measureSubtask("Compiler.emptyQueue", () {
-        world.forEach((WorkItem work) {
-          reporter.withCurrentElement(
-              work.element,
-              () => selfTask.measureSubtask("world.applyImpact", () {
-                    world.applyImpact(
-                        work.element,
-                        selfTask.measureSubtask(
-                            "work.run", () => work.run(this, world)));
-                  }));
-        });
-      });
-
-  void processQueue(Enqueuer world, Element main) =>
-      selfTask.measureSubtask("Compiler.processQueue", () {
-        world.nativeEnqueuer.processNativeClasses(libraryLoader.libraries);
-        if (main != null && !main.isMalformed) {
-          FunctionElement mainMethod = main;
-          mainMethod.computeType(resolution);
-          if (mainMethod.functionSignature.parameterCount != 0) {
-            // The first argument could be a list of strings.
-            backend.backendClasses.listImplementation
-                .ensureResolved(resolution);
-            backend.registerInstantiatedType(
-                backend.backendClasses.listImplementation.rawType,
-                world,
-                globalDependencies);
-            backend.backendClasses.stringImplementation
-                .ensureResolved(resolution);
-            backend.registerInstantiatedType(
-                backend.backendClasses.stringImplementation.rawType,
-                world,
-                globalDependencies);
-
-            backend.registerMainHasArguments(world);
-          }
-          world.addToWorkList(main);
+  void emptyQueue(Enqueuer enqueuer, {void onProgress()}) {
+    selfTask.measureSubtask("Compiler.emptyQueue", () {
+      enqueuer.forEach((WorkItem work) {
+        if (onProgress != null) {
+          onProgress();
         }
-        if (options.verbose) {
-          progress.reset();
-        }
-        emptyQueue(world);
-        world.queueIsClosed = true;
-        // Notify the impact strategy impacts are no longer needed for this
-        // enqueuer.
-        impactStrategy.onImpactUsed(world.impactUse);
-        backend.onQueueClosed();
-        assert(
-            compilationFailed || world.checkNoEnqueuedInvokedInstanceMethods());
+        reporter.withCurrentElement(
+            work.element,
+            () => selfTask.measureSubtask("world.applyImpact", () {
+                  enqueuer.applyImpact(
+                      selfTask.measureSubtask("work.run", () => work.run()),
+                      impactSource: work.element);
+                }));
       });
+    });
+  }
+
+  void processQueue(Enqueuer enqueuer, MethodElement mainMethod,
+      {void onProgress()}) {
+    selfTask.measureSubtask("Compiler.processQueue", () {
+      enqueuer.open(impactStrategy);
+      enqueuer.applyImpact(enqueuer.nativeEnqueuer
+          .processNativeClasses(libraryLoader.libraries));
+      if (mainMethod != null && !mainMethod.isMalformed) {
+        enqueuer.applyImpact(backend.computeMainImpact(mainMethod,
+            forResolution: enqueuer.isResolutionQueue));
+      }
+      if (options.verbose) {
+        progress.reset();
+      }
+      emptyQueue(enqueuer, onProgress: onProgress);
+      enqueuer.queueIsClosed = true;
+      enqueuer.close();
+      // Notify the impact strategy impacts are no longer needed for this
+      // enqueuer.
+      impactStrategy.onImpactUsed(enqueuer.impactUse);
+      backend.onQueueClosed();
+      assert(compilationFailed ||
+          enqueuer.checkNoEnqueuedInvokedInstanceMethods());
+    });
+  }
 
   /**
    * Perform various checks of the queues. This includes checking that
@@ -919,49 +934,18 @@
     }
   }
 
-  WorldImpact analyzeElement(Element element) =>
-      selfTask.measureSubtask("Compiler.analyzeElement", () {
-        assert(invariant(
-            element,
-            element.impliesType ||
-                element.isField ||
-                element.isFunction ||
-                element.isConstructor ||
-                element.isGetter ||
-                element.isSetter,
-            message: 'Unexpected element kind: ${element.kind}'));
-        assert(invariant(element, element is AnalyzableElement,
-            message: 'Element $element is not analyzable.'));
-        assert(invariant(element, element.isDeclaration));
-        return resolution.computeWorldImpact(element);
-      });
+  void showResolutionProgress() {
+    if (shouldPrintProgress) {
+      // TODO(ahe): Add structured diagnostics to the compiler API and
+      // use it to separate this from the --verbose option.
+      assert(phase == PHASE_RESOLVING);
+      reporter.log('Resolved ${enqueuer.resolution.processedElements.length} '
+          'elements.');
+      progress.reset();
+    }
+  }
 
-  WorldImpact analyze(ResolutionWorkItem work, ResolutionEnqueuer world) =>
-      selfTask.measureSubtask("Compiler.analyze", () {
-        assert(invariant(work.element, identical(world, enqueuer.resolution)));
-        assert(invariant(work.element, !work.isAnalyzed,
-            message: 'Element ${work.element} has already been analyzed'));
-        if (shouldPrintProgress) {
-          // TODO(ahe): Add structured diagnostics to the compiler API and
-          // use it to separate this from the --verbose option.
-          if (phase == PHASE_RESOLVING) {
-            reporter
-                .log('Resolved ${enqueuer.resolution.processedElements.length} '
-                    'elements.');
-            progress.reset();
-          }
-        }
-        AstElement element = work.element;
-        if (world.hasBeenProcessed(element)) {
-          return const WorldImpact();
-        }
-        WorldImpact worldImpact = analyzeElement(element);
-        world.registerProcessedElement(element);
-        return worldImpact;
-      });
-
-  WorldImpact codegen(CodegenWorkItem work, Enqueuer world) {
-    assert(invariant(work.element, identical(world, enqueuer.codegen)));
+  void showCodegenProgress() {
     if (shouldPrintProgress) {
       // TODO(ahe): Add structured diagnostics to the compiler API and
       // use it to separate this from the --verbose option.
@@ -969,7 +953,6 @@
           'Compiled ${enqueuer.codegen.processedEntities.length} methods.');
       progress.reset();
     }
-    return backend.codegen(work);
   }
 
   void reportDiagnostic(DiagnosticMessage message,
@@ -1945,109 +1928,116 @@
 }
 
 // TODO(johnniwinther): Move [ResolverTask] here.
-class _CompilerResolution implements Resolution {
-  final Compiler compiler;
+class CompilerResolution implements Resolution {
+  final Compiler _compiler;
   final Map<Element, ResolutionImpact> _resolutionImpactCache =
       <Element, ResolutionImpact>{};
   final Map<Element, WorldImpact> _worldImpactCache = <Element, WorldImpact>{};
   bool retainCachesForTesting = false;
 
-  _CompilerResolution(this.compiler);
+  CompilerResolution(this._compiler);
 
   @override
-  DiagnosticReporter get reporter => compiler.reporter;
+  DiagnosticReporter get reporter => _compiler.reporter;
 
   @override
-  ParsingContext get parsingContext => compiler.parsingContext;
+  ParsingContext get parsingContext => _compiler.parsingContext;
 
   @override
-  CoreClasses get coreClasses => compiler.coreClasses;
+  CoreClasses get coreClasses => _compiler.coreClasses;
 
   @override
-  CoreTypes get coreTypes => compiler.coreTypes;
+  CoreTypes get coreTypes => _compiler.coreTypes;
 
   @override
-  CommonElements get commonElements => compiler.commonElements;
+  CommonElements get commonElements => _compiler.commonElements;
 
   @override
-  Types get types => compiler.types;
+  Types get types => _compiler.types;
 
   @override
-  Target get target => compiler.backend;
+  Target get target => _compiler.backend;
 
   @override
-  ResolverTask get resolver => compiler.resolver;
+  ResolverTask get resolver => _compiler.resolver;
 
   @override
-  ResolutionEnqueuer get enqueuer => compiler.enqueuer.resolution;
+  ResolutionEnqueuer get enqueuer => _compiler.enqueuer.resolution;
 
   @override
-  CompilerOptions get options => compiler.options;
+  CompilerOptions get options => _compiler.options;
 
   @override
-  IdGenerator get idGenerator => compiler.idGenerator;
+  IdGenerator get idGenerator => _compiler.idGenerator;
 
   @override
-  ConstantEnvironment get constants => compiler.constants;
+  ConstantEnvironment get constants => _compiler.constants;
 
   @override
   MirrorUsageAnalyzerTask get mirrorUsageAnalyzerTask =>
-      compiler.mirrorUsageAnalyzerTask;
+      _compiler.mirrorUsageAnalyzerTask;
 
   @override
-  LibraryElement get coreLibrary => compiler._coreTypes.coreLibrary;
+  LibraryElement get coreLibrary => _compiler._coreTypes.coreLibrary;
 
   @override
   bool get wasProxyConstantComputedTestingOnly => _proxyConstant != null;
 
   @override
   void registerClass(ClassElement cls) {
-    compiler.openWorld.registerClass(cls);
+    _compiler.openWorld.registerClass(cls);
   }
 
   @override
   void resolveClass(ClassElement cls) {
-    compiler.resolver.resolveClass(cls);
+    _compiler.resolver.resolveClass(cls);
   }
 
   @override
   void resolveTypedef(TypedefElement typdef) {
-    compiler.resolver.resolve(typdef);
+    _compiler.resolver.resolve(typdef);
   }
 
   @override
   void resolveMetadataAnnotation(MetadataAnnotation metadataAnnotation) {
-    compiler.resolver.resolveMetadataAnnotation(metadataAnnotation);
+    _compiler.resolver.resolveMetadataAnnotation(metadataAnnotation);
   }
 
   @override
   FunctionSignature resolveSignature(FunctionElement function) {
-    return compiler.resolver.resolveSignature(function);
+    return _compiler.resolver.resolveSignature(function);
   }
 
   @override
   DartType resolveTypeAnnotation(Element element, TypeAnnotation node) {
-    return compiler.resolver.resolveTypeAnnotation(element, node);
+    return _compiler.resolver.resolveTypeAnnotation(element, node);
   }
 
   @override
   void ensureResolved(Element element) {
-    if (compiler.serialization.isDeserialized(element)) {
+    if (_compiler.serialization.isDeserialized(element)) {
       return;
     }
     computeWorldImpact(element);
   }
 
   @override
+  void ensureClassMembers(ClassElement element) {
+    if (!_compiler.serialization.isDeserialized(element)) {
+      _compiler.resolver.checkClass(element);
+    }
+  }
+
+  @override
   void registerCompileTimeError(Element element, DiagnosticMessage message) =>
-      compiler.registerCompileTimeError(element, message);
+      _compiler.registerCompileTimeError(element, message);
 
   @override
   bool hasResolvedAst(ExecutableElement element) {
     assert(invariant(element, element.isDeclaration,
         message: "Element $element must be the declaration."));
-    if (compiler.serialization.isDeserialized(element)) {
-      return compiler.serialization.hasResolvedAst(element);
+    if (_compiler.serialization.isDeserialized(element)) {
+      return _compiler.serialization.hasResolvedAst(element);
     }
     return hasBeenResolved(element.memberContext.declaration) &&
         element.hasResolvedAst;
@@ -2059,8 +2049,8 @@
         message: "Element $element must be the declaration."));
     assert(invariant(element, hasResolvedAst(element),
         message: "ResolvedAst not available for $element."));
-    if (compiler.serialization.isDeserialized(element)) {
-      return compiler.serialization.getResolvedAst(element);
+    if (_compiler.serialization.isDeserialized(element)) {
+      return _compiler.serialization.getResolvedAst(element);
     }
     return element.resolvedAst;
   }
@@ -2075,8 +2065,8 @@
   bool hasResolutionImpact(Element element) {
     assert(invariant(element, element.isDeclaration,
         message: "Element $element must be the declaration."));
-    if (compiler.serialization.isDeserialized(element)) {
-      return compiler.serialization.hasResolutionImpact(element);
+    if (_compiler.serialization.isDeserialized(element)) {
+      return _compiler.serialization.hasResolutionImpact(element);
     }
     return _resolutionImpactCache.containsKey(element);
   }
@@ -2086,8 +2076,8 @@
     assert(invariant(element, element.isDeclaration,
         message: "Element $element must be the declaration."));
     ResolutionImpact resolutionImpact;
-    if (compiler.serialization.isDeserialized(element)) {
-      resolutionImpact = compiler.serialization.getResolutionImpact(element);
+    if (_compiler.serialization.isDeserialized(element)) {
+      resolutionImpact = _compiler.serialization.getResolutionImpact(element);
     } else {
       resolutionImpact = _resolutionImpactCache[element];
     }
@@ -2108,38 +2098,53 @@
 
   @override
   WorldImpact computeWorldImpact(Element element) {
-    assert(invariant(element, element.isDeclaration,
-        message: "Element $element must be the declaration."));
-    return _worldImpactCache.putIfAbsent(element, () {
-      assert(compiler.parser != null);
-      Node tree = compiler.parser.parse(element);
-      assert(invariant(element, !element.isSynthesized || tree == null));
-      ResolutionImpact resolutionImpact = compiler.resolver.resolve(element);
+    return _compiler.selfTask.measureSubtask("Resolution.computeWorldImpact",
+        () {
+      assert(invariant(
+          element,
+          element.impliesType ||
+              element.isField ||
+              element.isFunction ||
+              element.isConstructor ||
+              element.isGetter ||
+              element.isSetter,
+          message: 'Unexpected element kind: ${element.kind}'));
+      assert(invariant(element, element is AnalyzableElement,
+          message: 'Element $element is not analyzable.'));
+      assert(invariant(element, element.isDeclaration,
+          message: "Element $element must be the declaration."));
+      return _worldImpactCache.putIfAbsent(element, () {
+        assert(_compiler.parser != null);
+        Node tree = _compiler.parser.parse(element);
+        assert(invariant(element, !element.isSynthesized || tree == null));
+        ResolutionImpact resolutionImpact = _compiler.resolver.resolve(element);
 
-      if (compiler.serialization.supportSerialization ||
-          retainCachesForTesting) {
-        // [ResolutionImpact] is currently only used by serialization. The
-        // enqueuer uses the [WorldImpact] which is always cached.
-        // TODO(johnniwinther): Align these use cases better; maybe only
-        // cache [ResolutionImpact] and let the enqueuer transform it into
-        // a [WorldImpact].
-        _resolutionImpactCache[element] = resolutionImpact;
-      }
-      if (tree != null && !compiler.options.analyzeSignaturesOnly) {
-        // TODO(het): don't do this if suppressWarnings is on, currently we have
-        // to do it because the typechecker also sets types
-        // Only analyze nodes with a corresponding [TreeElements].
-        compiler.checker.check(element);
-      }
-      return transformResolutionImpact(element, resolutionImpact);
+        if (_compiler.serialization.supportSerialization ||
+            retainCachesForTesting) {
+          // [ResolutionImpact] is currently only used by serialization. The
+          // enqueuer uses the [WorldImpact] which is always cached.
+          // TODO(johnniwinther): Align these use cases better; maybe only
+          // cache [ResolutionImpact] and let the enqueuer transform it into
+          // a [WorldImpact].
+          _resolutionImpactCache[element] = resolutionImpact;
+        }
+        if (tree != null && !_compiler.options.analyzeSignaturesOnly) {
+          // TODO(het): don't do this if suppressWarnings is on, currently we
+          // have to do it because the typechecker also sets types
+          // Only analyze nodes with a corresponding [TreeElements].
+          _compiler.checker.check(element);
+        }
+        return transformResolutionImpact(element, resolutionImpact);
+      });
     });
   }
 
   @override
   WorldImpact transformResolutionImpact(
       Element element, ResolutionImpact resolutionImpact) {
-    WorldImpact worldImpact = compiler.backend.impactTransformer
-        .transformResolutionImpact(resolutionImpact);
+    WorldImpact worldImpact = _compiler.backend.impactTransformer
+        .transformResolutionImpact(
+            _compiler.enqueuer.resolution, resolutionImpact);
     _worldImpactCache[element] = worldImpact;
     return worldImpact;
   }
@@ -2149,7 +2154,7 @@
     assert(invariant(element, element.isDeclaration,
         message: "Element $element must be the declaration."));
     if (retainCachesForTesting) return;
-    if (compiler.serialization.isDeserialized(element)) return;
+    if (_compiler.serialization.isDeserialized(element)) return;
     assert(invariant(element, _worldImpactCache[element] != null,
         message: "WorldImpact not computed for $element."));
     _worldImpactCache[element] = const WorldImpact();
@@ -2172,10 +2177,10 @@
 
   @override
   ResolutionWorkItem createWorkItem(Element element) {
-    if (compiler.serialization.isDeserialized(element)) {
-      return compiler.serialization.createResolutionWorkItem(element);
+    if (_compiler.serialization.isDeserialized(element)) {
+      return _compiler.serialization.createResolutionWorkItem(element);
     } else {
-      return new ResolutionWorkItem(element);
+      return new ResolutionWorkItem(this, element);
     }
   }
 
@@ -2200,7 +2205,7 @@
   }
 }
 
-class GlobalDependencyRegistry extends Registry {
+class GlobalDependencyRegistry {
   Setlet<Element> _otherDependencies;
 
   GlobalDependencyRegistry();
diff --git a/pkg/compiler/lib/src/constant_system_dart.dart b/pkg/compiler/lib/src/constant_system_dart.dart
index 0f9a0d6..e1d468d 100644
--- a/pkg/compiler/lib/src/constant_system_dart.dart
+++ b/pkg/compiler/lib/src/constant_system_dart.dart
@@ -348,20 +348,13 @@
   apply(left, right) => left ?? right;
 }
 
-abstract class CodeUnitAtOperation implements BinaryOperation {
-  final String name = 'charCodeAt';
+class CodeUnitAtOperation implements BinaryOperation {
+  String get name => 'charCodeAt';
   const CodeUnitAtOperation();
+  ConstantValue fold(ConstantValue left, ConstantValue right) => null;
   apply(left, right) => left.codeUnitAt(right);
 }
 
-class CodeUnitAtConstantOperation extends CodeUnitAtOperation {
-  const CodeUnitAtConstantOperation();
-  ConstantValue fold(ConstantValue left, ConstantValue right) {
-    // 'a'.codeUnitAt(0) is not a constant expression.
-    return null;
-  }
-}
-
 class CodeUnitAtRuntimeOperation extends CodeUnitAtOperation {
   const CodeUnitAtRuntimeOperation();
   IntConstantValue fold(ConstantValue left, ConstantValue right) {
@@ -379,6 +372,14 @@
   }
 }
 
+class UnfoldedUnaryOperation implements UnaryOperation {
+  final String name;
+  const UnfoldedUnaryOperation(this.name);
+  ConstantValue fold(ConstantValue constant) {
+    return null;
+  }
+}
+
 /**
  * A constant system implementing the Dart semantics. This system relies on
  * the underlying runtime-system. That is, if dart2js is run in an environment
@@ -409,7 +410,8 @@
   final shiftRight = const ShiftRightOperation();
   final subtract = const SubtractOperation();
   final truncatingDivide = const TruncatingDivideOperation();
-  final codeUnitAt = const CodeUnitAtConstantOperation();
+  final codeUnitAt = const CodeUnitAtOperation();
+  final round = const UnfoldedUnaryOperation('round');
 
   const DartConstantSystem();
 
diff --git a/pkg/compiler/lib/src/constants/constant_system.dart b/pkg/compiler/lib/src/constants/constant_system.dart
index 1a0da6a..edccf03 100644
--- a/pkg/compiler/lib/src/constants/constant_system.dart
+++ b/pkg/compiler/lib/src/constants/constant_system.dart
@@ -54,6 +54,7 @@
   BinaryOperation get truncatingDivide;
 
   BinaryOperation get codeUnitAt;
+  UnaryOperation get round;
 
   const ConstantSystem();
 
diff --git a/pkg/compiler/lib/src/dart2js.dart b/pkg/compiler/lib/src/dart2js.dart
index 9ee75e9..cb39e78 100644
--- a/pkg/compiler/lib/src/dart2js.dart
+++ b/pkg/compiler/lib/src/dart2js.dart
@@ -138,6 +138,8 @@
 
   void passThrough(String argument) => options.add(argument);
 
+  void ignoreOption(String argument) {}
+
   if (BUILD_ID != null) {
     passThrough("--build-id=$BUILD_ID");
   }
@@ -332,8 +334,8 @@
     new OptionHandler('--out=.+|-o.*', setOutput, multipleArguments: true),
     new OptionHandler(Flags.allowMockCompilation, passThrough),
     new OptionHandler(Flags.fastStartup, passThrough),
-    new OptionHandler(Flags.genericMethodSyntax, passThrough),
-    new OptionHandler(Flags.initializingFormalAccess, passThrough),
+    new OptionHandler(Flags.genericMethodSyntax, ignoreOption),
+    new OptionHandler(Flags.initializingFormalAccess, ignoreOption),
     new OptionHandler('${Flags.minify}|-m', implyCompilation),
     new OptionHandler(Flags.preserveUris, passThrough),
     new OptionHandler('--force-strip=.*', setStrip),
@@ -395,6 +397,7 @@
     }),
     new OptionHandler(Flags.allowNativeExtensions, setAllowNativeExtensions),
     new OptionHandler(Flags.generateCodeWithCompileTimeErrors, passThrough),
+    new OptionHandler(Flags.useNewSourceInfo, passThrough),
     new OptionHandler(Flags.testMode, passThrough),
 
     // The following three options must come last.
diff --git a/pkg/compiler/lib/src/dart2js_profile_many.dart b/pkg/compiler/lib/src/dart2js_profile_many.dart
deleted file mode 100644
index 8288a9a..0000000
--- a/pkg/compiler/lib/src/dart2js_profile_many.dart
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library dart2js.profile_many;
-
-import 'dart:async';
-
-import 'dart2js.dart' as cmdline;
-
-const String USAGE = """
-Usage: dart2js_profile_many.dart [OPTIONS] [FILES]
-
-Invokes dart2js separately for each file using the given options.
-This is for profiling multiple compilations in the Dart Observatory.
-""";
-
-printUsage() {
-  print(USAGE);
-}
-
-void main(List<String> args) {
-  List options = [];
-  List files = [];
-
-  for (String arg in args) {
-    if (arg.startsWith('-')) {
-      options.add(arg);
-    } else {
-      files.add(arg);
-    }
-  }
-
-  if (files.length == 0) {
-    printUsage();
-    return;
-  }
-
-  cmdline.exitFunc = (code) {
-    throw "Exit with code $code";
-  };
-
-  Future.forEach(files, (String file) {
-    List subargs = [];
-    subargs.addAll(options);
-    subargs.add(file);
-    return cmdline.compilerMain(subargs).catchError((e) {});
-  }).then((_) {
-    print("Done");
-  });
-}
diff --git a/pkg/compiler/lib/src/dart2js_stress.dart b/pkg/compiler/lib/src/dart2js_stress.dart
deleted file mode 100644
index 804c577..0000000
--- a/pkg/compiler/lib/src/dart2js_stress.dart
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library dart2js.stress;
-
-import "dart2js.dart" as dart2js;
-
-const ITERATIONS_FLAG_PREFIX = "--iterations=";
-void main(List<String> args) {
-  Stopwatch sw = new Stopwatch();
-  int count = 0;
-  int maxCount = null;
-  if (args.isNotEmpty && args[0].startsWith(ITERATIONS_FLAG_PREFIX)) {
-    maxCount = int.parse(args[0].substring(ITERATIONS_FLAG_PREFIX.length));
-    args = args.sublist(1);
-  }
-  if (maxCount == null) {
-    print("Running indefinitely.\n"
-        "Use '$ITERATIONS_FLAG_PREFIX<count>' to set a repetition count"
-        " (as first flag).");
-  }
-  args = ["--suppress-warnings", "--suppress-hints"]..addAll(args);
-  void iterate() {
-    count++;
-    sw.reset();
-    sw.start();
-    dart2js.internalMain(args).then((_) {
-      print("$count: ${sw.elapsedMilliseconds}ms");
-    }).then((_) {
-      if (maxCount == null || count < maxCount) {
-        iterate();
-      }
-    });
-  }
-
-  iterate();
-}
diff --git a/pkg/compiler/lib/src/deferred_load.dart b/pkg/compiler/lib/src/deferred_load.dart
index b4e586a..d2c8ddb 100644
--- a/pkg/compiler/lib/src/deferred_load.dart
+++ b/pkg/compiler/lib/src/deferred_load.dart
@@ -35,7 +35,7 @@
 import 'resolution/resolution.dart' show AnalyzableElementX;
 import 'resolution/tree_elements.dart' show TreeElements;
 import 'tree/tree.dart' as ast;
-import 'universe/use.dart' show StaticUse, TypeUse, TypeUseKind;
+import 'universe/use.dart' show StaticUse, StaticUseKind, TypeUse, TypeUseKind;
 import 'universe/world_impact.dart'
     show ImpactUseCase, WorldImpact, WorldImpactVisitorImpl;
 import 'util/setlet.dart' show Setlet;
@@ -330,6 +330,13 @@
             worldImpact,
             new WorldImpactVisitorImpl(visitStaticUse: (StaticUse staticUse) {
               elements.add(staticUse.element);
+              switch (staticUse.kind) {
+                case StaticUseKind.CONSTRUCTOR_INVOKE:
+                case StaticUseKind.CONST_CONSTRUCTOR_INVOKE:
+                  collectTypeDependencies(staticUse.type);
+                  break;
+                default:
+              }
             }, visitTypeUse: (TypeUse typeUse) {
               DartType type = typeUse.type;
               switch (typeUse.kind) {
@@ -339,6 +346,8 @@
                   }
                   break;
                 case TypeUseKind.INSTANTIATION:
+                case TypeUseKind.MIRROR_INSTANTIATION:
+                case TypeUseKind.NATIVE_INSTANTIATION:
                 case TypeUseKind.IS_CHECK:
                 case TypeUseKind.AS_CAST:
                 case TypeUseKind.CATCH_TYPE:
@@ -834,8 +843,8 @@
       });
     }
     if (isProgramSplit) {
-      isProgramSplit = compiler.backend.enableDeferredLoadingIfSupported(
-          lastDeferred, compiler.globalDependencies);
+      isProgramSplit =
+          compiler.backend.enableDeferredLoadingIfSupported(lastDeferred);
     }
   }
 
diff --git a/pkg/compiler/lib/src/diagnostics/messages.dart b/pkg/compiler/lib/src/diagnostics/messages.dart
index e1715744..a65c6ef 100644
--- a/pkg/compiler/lib/src/diagnostics/messages.dart
+++ b/pkg/compiler/lib/src/diagnostics/messages.dart
@@ -326,7 +326,6 @@
   MULTI_INHERITANCE,
   NAMED_ARGUMENT_NOT_FOUND,
   NAMED_FUNCTION_EXPRESSION,
-  NAMED_PARAMETER_WITH_EQUALS,
   NATIVE_NOT_SUPPORTED,
   NO_BREAK_TARGET,
   NO_CATCH_NOR_FINALLY,
@@ -431,6 +430,7 @@
   TYPE_VARIABLE_IN_CONSTANT,
   TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
   TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED,
+  TYPE_VARIABLE_FROM_METHOD_CONSIDERED_DYNAMIC,
   TYPEDEF_FORMAL_WITH_DEFAULT,
   UNARY_OPERATOR_BAD_ARITY,
   UNBOUND_LABEL,
@@ -463,6 +463,9 @@
   VOID_EXPRESSION,
   VOID_NOT_ALLOWED,
   VOID_VARIABLE,
+  WRONG_ARGUMENT_FOR_JS,
+  WRONG_ARGUMENT_FOR_JS_FIRST,
+  WRONG_ARGUMENT_FOR_JS_SECOND,
   WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT,
   WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT,
   YIELDING_MODIFIER_ON_ARROW_BODY,
@@ -1218,7 +1221,6 @@
       MessageKind.TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED: const MessageTemplate(
           MessageKind.TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED,
           "Method type variables do not have a runtime value.",
-          options: const ["--generic-method-syntax"],
           howToFix: "Try using the upper bound of the type variable, "
               "or refactor the code to avoid needing this runtime value.",
           examples: const [
@@ -1233,7 +1235,16 @@
 bool f<T>(Object o) => o is T;
 
 main() => f<int>(42);
-""",
+"""
+          ]),
+
+      MessageKind.TYPE_VARIABLE_FROM_METHOD_CONSIDERED_DYNAMIC:
+      const MessageTemplate(
+          MessageKind.TYPE_VARIABLE_FROM_METHOD_CONSIDERED_DYNAMIC,
+          "Method type variables are treated as `dynamic` in `as` expressions.",
+          howToFix: "Try using the upper bound of the type variable, or check "
+              "that the blind success of the test does not introduce bugs.",
+          examples: const [
             """
 // Method type variables are not reified, so they cannot be tested dynamically.
 bool f<T>(Object o) => o as T;
@@ -1372,19 +1383,6 @@
 }"""
           ]),
 
-      MessageKind.NAMED_PARAMETER_WITH_EQUALS: const MessageTemplate(
-          MessageKind.NAMED_PARAMETER_WITH_EQUALS,
-          "Named optional parameters can't use '=' to specify a default "
-          "value.",
-          howToFix: "Try replacing '=' with ':'.",
-          examples: const [
-            """
-main() {
-  foo({a = 1}) => print(a);
-  foo(a: 2);
-}"""
-          ]),
-
       MessageKind.POSITIONAL_PARAMETER_WITH_EQUALS: const MessageTemplate(
           MessageKind.POSITIONAL_PARAMETER_WITH_EQUALS,
           "Positional optional parameters can't use ':' to specify a "
@@ -2698,6 +2696,18 @@
               "Use an immediately called JavaScript function to capture the"
               " the placeholder values as JavaScript function parameters."),
 
+      MessageKind.WRONG_ARGUMENT_FOR_JS: const MessageTemplate(
+          MessageKind.WRONG_ARGUMENT_FOR_JS,
+          "JS expression must take two or more arguments."),
+
+      MessageKind.WRONG_ARGUMENT_FOR_JS_FIRST: const MessageTemplate(
+          MessageKind.WRONG_ARGUMENT_FOR_JS_FIRST,
+          "JS expression must take two or more arguments."),
+
+      MessageKind.WRONG_ARGUMENT_FOR_JS_SECOND: const MessageTemplate(
+          MessageKind.WRONG_ARGUMENT_FOR_JS_SECOND,
+          "JS second argument must be a string literal."),
+
       MessageKind.WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT:
           const MessageTemplate(
               MessageKind.WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT,
diff --git a/pkg/compiler/lib/src/dump_info.dart b/pkg/compiler/lib/src/dump_info.dart
index de65277..db6a13a 100644
--- a/pkg/compiler/lib/src/dump_info.dart
+++ b/pkg/compiler/lib/src/dump_info.dart
@@ -9,6 +9,7 @@
 
 import 'package:dart2js_info/info.dart';
 
+import 'closure.dart';
 import 'common/tasks.dart' show CompilerTask;
 import 'common.dart';
 import 'compiler.dart' show Compiler;
@@ -20,7 +21,7 @@
 import 'js_backend/js_backend.dart' show JavaScriptBackend;
 import 'js_emitter/full_emitter/emitter.dart' as full show Emitter;
 import 'types/types.dart' show TypeMask;
-import 'universe/universe.dart' show ReceiverConstraint;
+import 'universe/world_builder.dart' show ReceiverConstraint;
 import 'universe/world_impact.dart'
     show ImpactUseCase, WorldImpact, WorldImpactVisitorImpl;
 
@@ -114,8 +115,10 @@
     return info;
   }
 
+  _resultOf(e) => compiler.globalInference.results.resultOf(e);
+
   FieldInfo visitFieldElement(FieldElement element, _) {
-    TypeMask inferredType = compiler.globalInference.results.typeOf(element);
+    TypeMask inferredType = _resultOf(element).type;
     // If a field has an empty inferred type it is never used.
     if (inferredType == null || inferredType.isEmpty) return null;
 
@@ -130,7 +133,6 @@
         coverageId: '${element.hashCode}',
         type: '${element.type}',
         inferredType: '$inferredType',
-        size: size,
         code: code,
         outputUnit: _unitInfoForElement(element),
         isConst: element.isConst);
@@ -143,19 +145,9 @@
       }
     }
 
-    List<FunctionInfo> nestedClosures = <FunctionInfo>[];
-    for (Element closure in element.nestedClosures) {
-      Info child = this.process(closure);
-      if (child != null) {
-        ClassInfo parent = this.process(closure.enclosingElement);
-        if (parent != null) {
-          child.name = "${parent.name}.${child.name}";
-        }
-        nestedClosures.add(child);
-        size += child.size;
-      }
-    }
-    info.closures = nestedClosures;
+    int closureSize = _addClosureInfo(info, element);
+    info.size = size + closureSize;
+
     result.fields.add(info);
     return info;
   }
@@ -174,29 +166,14 @@
       if (info is FieldInfo) {
         classInfo.fields.add(info);
         info.parent = classInfo;
+        for (ClosureInfo closureInfo in info.closures) {
+          size += closureInfo.size;
+        }
       } else {
         assert(info is FunctionInfo);
         classInfo.functions.add(info);
         info.parent = classInfo;
-      }
-
-      // Closures are placed in the library namespace, but we want to attribute
-      // them to a function, and by extension, this class.  Process and add the
-      // sizes here.
-      if (member is MemberElement) {
-        for (Element closure in member.nestedClosures) {
-          FunctionInfo closureInfo = this.process(closure);
-          if (closureInfo == null) continue;
-
-          // TODO(sigmund): remove this legacy update on the name, represent the
-          // information explicitly in the info format.
-          // Look for the parent element of this closure might be the enclosing
-          // class or an enclosing function.
-          Element parent = closure.enclosingElement;
-          ClassInfo parentInfo = this.process(parent);
-          if (parentInfo != null) {
-            closureInfo.name = "${parentInfo.name}.${closureInfo.name}";
-          }
+        for (ClosureInfo closureInfo in (info as FunctionInfo).closures) {
           size += closureInfo.size;
         }
       }
@@ -215,6 +192,26 @@
     return classInfo;
   }
 
+  ClosureInfo visitClosureClassElement(ClosureClassElement element, _) {
+    ClosureInfo closureInfo = new ClosureInfo(
+        name: element.name,
+        outputUnit: _unitInfoForElement(element),
+        size: compiler.dumpInfoTask.sizeOf(element));
+    _elementToInfo[element] = closureInfo;
+
+    ClosureClassMap closureMap = compiler.closureToClassMapper
+        .getClosureToClassMapping(element.methodElement.resolvedAst);
+    assert(closureMap != null && closureMap.closureClassElement == element);
+
+    FunctionInfo functionInfo = this.process(closureMap.callElement);
+    if (functionInfo == null) return null;
+    closureInfo.function = functionInfo;
+    functionInfo.parent = closureInfo;
+
+    result.closures.add(closureInfo);
+    return closureInfo;
+  }
+
   FunctionInfo visitFunctionElement(FunctionElement element, _) {
     int size = compiler.dumpInfoTask.sizeOf(element);
     // TODO(sigmund): consider adding a small info to represent unreachable
@@ -254,10 +251,8 @@
     if (element.hasFunctionSignature) {
       FunctionSignature signature = element.functionSignature;
       signature.forEachParameter((parameter) {
-        parameters.add(new ParameterInfo(
-            parameter.name,
-            '${compiler.globalInference.results.typeOf(parameter)}',
-            '${parameter.node.type}'));
+        parameters.add(new ParameterInfo(parameter.name,
+            '${_resultOf(parameter).type}', '${parameter.node.type}'));
       });
     }
 
@@ -268,8 +263,7 @@
         compiler.closedWorld.allFunctions.contains(element)) {
       returnType = '${element.type.returnType}';
     }
-    String inferredReturnType =
-        '${compiler.globalInference.results.returnTypeOf(element)}';
+    String inferredReturnType = '${_resultOf(element).returnType}';
     String sideEffects =
         '${compiler.closedWorld.getSideEffectsOfElement(element)}';
 
@@ -283,7 +277,6 @@
         // available while we are doing codegen.
         coverageId: '${element.hashCode}',
         modifiers: modifiers,
-        size: size,
         returnType: returnType,
         inferredReturnType: inferredReturnType,
         parameters: parameters,
@@ -294,27 +287,42 @@
         outputUnit: _unitInfoForElement(element));
     _elementToInfo[element] = info;
 
-    List<FunctionInfo> nestedClosures = <FunctionInfo>[];
     if (element is MemberElement) {
-      MemberElement member = element as MemberElement;
-      for (Element closure in member.nestedClosures) {
-        Info child = this.process(closure);
-        if (child != null) {
-          BasicInfo parent = this.process(closure.enclosingElement);
-          if (parent != null) {
-            child.name = "${parent.name}.${child.name}";
-          }
-          nestedClosures.add(child);
-          child.parent = parent;
-          size += child.size;
-        }
-      }
+      int closureSize = _addClosureInfo(info, element as MemberElement);
+      size += closureSize;
+    } else {
+      info.closures = <ClosureInfo>[];
     }
-    info.closures = nestedClosures;
+
+    info.size = size;
+
     result.functions.add(info);
     return info;
   }
 
+  /// Adds closure information to [info], using all nested closures in [member].
+  ///
+  /// Returns the total size of the nested closures, to add to the info size.
+  int _addClosureInfo(Info info, MemberElement member) {
+    assert(info is FunctionInfo || info is FieldInfo);
+    int size = 0;
+    List<ClosureInfo> nestedClosures = <ClosureInfo>[];
+    for (Element function in member.nestedClosures) {
+      assert(function is SynthesizedCallMethodElementX);
+      SynthesizedCallMethodElementX callMethod = function;
+      ClosureInfo closure = this.process(callMethod.closureClass);
+      if (closure != null) {
+        closure.parent = info;
+        nestedClosures.add(closure);
+        size += closure.size;
+      }
+    }
+    if (info is FunctionInfo) info.closures = nestedClosures;
+    if (info is FieldInfo) info.closures = nestedClosures;
+
+    return size;
+  }
+
   OutputUnitInfo _infoFromOutputUnit(OutputUnit outputUnit) {
     return _outputToInfo.putIfAbsent(outputUnit, () {
       // Dump-info currently only works with the full emitter. If another
@@ -412,7 +420,9 @@
 
   final Map<Element, Set<Element>> _dependencies = {};
   void registerDependency(Element source, Element target) {
-    _dependencies.putIfAbsent(source, () => new Set()).add(target);
+    if (compiler.options.dumpInfo) {
+      _dependencies.putIfAbsent(source, () => new Set()).add(target);
+    }
   }
 
   void registerImpact(Element element, WorldImpact impact) {
@@ -580,8 +590,9 @@
             compiler.options.hasBuildId ? compiler.options.buildId : null,
         compilationMoment: new DateTime.now(),
         compilationDuration: compiler.measurer.wallClock.elapsed,
-        toJsonDuration: stopwatch.elapsedMilliseconds,
-        dumpInfoDuration: this.timing,
+        toJsonDuration:
+            new Duration(milliseconds: stopwatch.elapsedMilliseconds),
+        dumpInfoDuration: new Duration(milliseconds: this.timing),
         noSuchMethodEnabled: compiler.backend.enabledNoSuchMethod,
         minified: compiler.options.enableMinification);
 
diff --git a/pkg/compiler/lib/src/elements/common.dart b/pkg/compiler/lib/src/elements/common.dart
index 3e430d2..6ab5de2 100644
--- a/pkg/compiler/lib/src/elements/common.dart
+++ b/pkg/compiler/lib/src/elements/common.dart
@@ -215,20 +215,22 @@
    * When called on the implementation element both members declared in the
    * origin and the patch class are returned.
    */
-  Element lookupByName(Name memberName) {
-    return internalLookupByName(memberName, isSuperLookup: false);
+  Element lookupByName(Name memberName, {ClassElement stopAt}) {
+    return internalLookupByName(memberName,
+        isSuperLookup: false, stopAtSuperclass: stopAt);
   }
 
   Element lookupSuperByName(Name memberName) {
     return internalLookupByName(memberName, isSuperLookup: true);
   }
 
-  Element internalLookupByName(Name memberName, {bool isSuperLookup}) {
+  Element internalLookupByName(Name memberName,
+      {bool isSuperLookup, ClassElement stopAtSuperclass}) {
     String name = memberName.text;
     bool isPrivate = memberName.isPrivate;
     LibraryElement library = memberName.library;
     for (ClassElement current = isSuperLookup ? superclass : this;
-        current != null;
+        current != null && current != stopAtSuperclass;
         current = current.superclass) {
       Element member = current.lookupLocalMember(name);
       if (member == null && current.isPatched) {
diff --git a/pkg/compiler/lib/src/elements/elements.dart b/pkg/compiler/lib/src/elements/elements.dart
index 29e2396..178ba03 100644
--- a/pkg/compiler/lib/src/elements/elements.dart
+++ b/pkg/compiler/lib/src/elements/elements.dart
@@ -20,6 +20,7 @@
 import '../tree/tree.dart';
 import '../util/characters.dart' show $_;
 import '../util/util.dart';
+import 'entities.dart';
 import 'visitor.dart' show ElementVisitor;
 
 part 'names.dart';
@@ -236,7 +237,7 @@
 
   /// `true` if this element is the body of a generative constructor.
   ///
-  /// This is a synthetic element kind used only be the JavaScript backend.
+  /// This is a synthetic element kind used only by the JavaScript backend.
   bool get isGenerativeConstructorBody;
 
   /// `true` if this element is a factory constructor,
@@ -1047,7 +1048,8 @@
 ///
 /// A [MemberElement] is the outermost executable element for any executable
 /// context.
-abstract class MemberElement extends Element implements ExecutableElement {
+abstract class MemberElement extends Element
+    implements ExecutableElement, MemberEntity {
   /// The local functions defined within this member.
   List<FunctionElement> get nestedClosures;
 
@@ -1087,6 +1089,8 @@
 /// factories and constructors it is not itself a [Local] but instead
 /// a non-element [Local] is created through a specialized class.
 // TODO(johnniwinther): Should [Local] have `isAssignable` or `type`?
+// TODO(johnniwinther): Move this to 'entities.dart' when it does not refer
+// to [ExecutableElement].
 abstract class Local extends Entity {
   /// The context in which this local is defined.
   ExecutableElement get executableContext;
@@ -1100,7 +1104,8 @@
     implements LocalElement {}
 
 /// A top-level, static or instance field.
-abstract class FieldElement extends VariableElement implements MemberElement {}
+abstract class FieldElement extends VariableElement
+    implements MemberElement, FieldEntity {}
 
 /// A parameter-like element of a function signature.
 ///
@@ -1291,15 +1296,15 @@
 }
 
 /// A top level, static or instance function.
-abstract class MethodElement extends FunctionElement implements MemberElement {}
+abstract class MethodElement extends FunctionElement
+    implements MemberElement, FunctionEntity {}
 
 /// A local function or closure (anonymous local function).
 abstract class LocalFunctionElement extends FunctionElement
     implements LocalElement {}
 
 /// A constructor.
-abstract class ConstructorElement extends FunctionElement
-    implements MemberElement {
+abstract class ConstructorElement extends MethodElement {
   /// Returns `true` if [effectiveTarget] has been computed for this
   /// constructor.
   bool get hasEffectiveTarget;
@@ -1470,7 +1475,7 @@
 }
 
 abstract class ClassElement extends TypeDeclarationElement
-    implements ScopeContainerElement {
+    implements ScopeContainerElement, ClassEntity {
   /// The length of the longest inheritance path from [:Object:].
   int get hierarchyDepth;
 
@@ -1555,7 +1560,13 @@
   void reverseBackendMembers();
 
   Element lookupMember(String memberName);
-  Element lookupByName(Name memberName);
+
+  /// Looks up a class instance member declared or inherited in this class
+  /// using [memberName] to match the (private) name and getter/setter property.
+  ///
+  /// This method recursively visits superclasses until the member is found or
+  /// [stopAt] is reached.
+  Element lookupByName(Name memberName, {ClassElement stopAt});
   Element lookupSuperByName(Name memberName);
 
   Element lookupLocalMember(String memberName);
diff --git a/pkg/compiler/lib/src/elements/entities.dart b/pkg/compiler/lib/src/elements/entities.dart
new file mode 100644
index 0000000..7c03e03
--- /dev/null
+++ b/pkg/compiler/lib/src/elements/entities.dart
@@ -0,0 +1,42 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 entities;
+
+import 'elements.dart' show Entity;
+
+/// Stripped down super interface for class like entities.
+///
+/// Currently only [ClassElement] but later also kernel based Dart classes
+/// and/or Dart-in-JS classes.
+abstract class ClassEntity extends Entity {
+  bool get isClosure;
+  void forEachInstanceField(f(ClassEntity cls, FieldEntity field),
+      {bool includeSuperAndInjectedMembers: false});
+}
+
+/// Stripped down super interface for member like entities, that is,
+/// constructors, methods, fields etc.
+///
+/// Currently only [MemberElement] but later also kernel based Dart members
+/// and/or Dart-in-JS properties.
+abstract class MemberEntity extends Entity {
+  bool get isField;
+  bool get isFunction;
+  bool get isGetter;
+  bool get isAssignable;
+  ClassEntity get enclosingClass;
+}
+
+/// Stripped down super interface for field like entities.
+///
+/// Currently only [FieldElement] but later also kernel based Dart fields
+/// and/or Dart-in-JS field-like properties.
+abstract class FieldEntity extends MemberEntity {}
+
+/// Stripped down super interface for function like entities.
+///
+/// Currently only [FieldElement] but later also kernel based Dart constructors
+/// and methods and/or Dart-in-JS function-like properties.
+abstract class FunctionEntity extends MemberEntity {}
diff --git a/pkg/compiler/lib/src/elements/modelx.dart b/pkg/compiler/lib/src/elements/modelx.dart
index 691e6d7..b479367 100644
--- a/pkg/compiler/lib/src/elements/modelx.dart
+++ b/pkg/compiler/lib/src/elements/modelx.dart
@@ -312,6 +312,9 @@
   bool get isRedirectingGenerative => false;
 
   @override
+  bool isRedirectingGenerativeInternal;
+
+  @override
   void set isRedirectingGenerative(_) {
     throw new UnsupportedError("isRedirectingGenerative");
   }
@@ -2222,7 +2225,7 @@
 abstract class ConstructorElementX extends FunctionElementX
     with ConstantConstructorMixin, ConstructorElementCommon
     implements ConstructorElement {
-  bool isRedirectingGenerative = false;
+  bool isRedirectingGenerativeInternal = false;
 
   ConstructorElementX(
       String name, ElementKind kind, Modifiers modifiers, Element enclosing)
@@ -2233,6 +2236,11 @@
 
   ConstructorElementX get patch => super.patch;
 
+  bool get isRedirectingGenerative {
+    if (isPatched) return patch.isRedirectingGenerative;
+    return isRedirectingGenerativeInternal;
+  }
+
   bool get isRedirectingFactory => immediateRedirectionTarget != null;
 
   // TODO(johnniwinther): This should also return true for cyclic redirecting
diff --git a/pkg/compiler/lib/src/enqueue.dart b/pkg/compiler/lib/src/enqueue.dart
index c29912a..cdd46e9 100644
--- a/pkg/compiler/lib/src/enqueue.dart
+++ b/pkg/compiler/lib/src/enqueue.dart
@@ -6,13 +6,16 @@
 
 import 'dart:collection' show Queue;
 
+import 'cache_strategy.dart';
+import 'common/backend_api.dart' show Backend;
 import 'common/names.dart' show Identifiers;
-import 'common/resolution.dart' show Resolution;
-import 'common/resolution.dart' show ResolutionWorkItem;
+import 'common/resolution.dart' show Resolution, ResolutionWorkItem;
 import 'common/tasks.dart' show CompilerTask;
 import 'common/work.dart' show WorkItem;
 import 'common.dart';
-import 'compiler.dart' show Compiler;
+import 'compiler.dart' show Compiler, GlobalDependencyRegistry;
+import 'core_types.dart' show CommonElements;
+import 'options.dart';
 import 'dart_types.dart' show DartType, InterfaceType;
 import 'elements/elements.dart'
     show
@@ -21,66 +24,74 @@
         ClassElement,
         ConstructorElement,
         Element,
-        Elements,
         Entity,
         FunctionElement,
         LibraryElement,
-        Member,
-        Name,
-        TypedElement,
-        TypedefElement;
+        LocalFunctionElement,
+        TypedElement;
 import 'native/native.dart' as native;
 import 'types/types.dart' show TypeMaskStrategy;
 import 'universe/selector.dart' show Selector;
-import 'universe/universe.dart';
+import 'universe/world_builder.dart';
 import 'universe/use.dart'
     show DynamicUse, StaticUse, StaticUseKind, TypeUse, TypeUseKind;
 import 'universe/world_impact.dart'
-    show ImpactUseCase, WorldImpact, WorldImpactVisitor;
+    show ImpactStrategy, ImpactUseCase, WorldImpact, WorldImpactVisitor;
 import 'util/util.dart' show Setlet;
+import 'world.dart' show OpenWorld;
 
 class EnqueueTask extends CompilerTask {
-  final ResolutionEnqueuer resolution;
-  final Enqueuer codegen;
+  ResolutionEnqueuer _resolution;
+  Enqueuer _codegen;
   final Compiler compiler;
 
   String get name => 'Enqueue';
 
   EnqueueTask(Compiler compiler)
-      : compiler = compiler,
-        resolution = new ResolutionEnqueuer(
-            compiler,
-            compiler.options.analyzeOnly && compiler.options.analyzeMain
-                ? const EnqueuerStrategy()
-                : const TreeShakingEnqueuerStrategy()),
-        codegen = compiler.backend.createCodegenEnqueuer(compiler),
+      : this.compiler = compiler,
         super(compiler.measurer) {
-    codegen.task = this;
-    resolution.task = this;
-
-    codegen.nativeEnqueuer = compiler.backend.nativeCodegenEnqueuer(codegen);
-    resolution.nativeEnqueuer =
-        compiler.backend.nativeResolutionEnqueuer(resolution);
+    _resolution = new ResolutionEnqueuer(
+        this,
+        compiler.options,
+        compiler.resolution,
+        compiler.options.analyzeOnly && compiler.options.analyzeMain
+            ? const DirectEnqueuerStrategy()
+            : const TreeShakingEnqueuerStrategy(),
+        compiler.globalDependencies,
+        compiler.backend,
+        compiler.coreClasses,
+        compiler.cacheStrategy);
+    _codegen = compiler.backend.createCodegenEnqueuer(this, compiler);
   }
 
+  ResolutionEnqueuer get resolution => _resolution;
+  Enqueuer get codegen => _codegen;
+
   void forgetElement(Element element) {
-    resolution.forgetElement(element);
-    codegen.forgetElement(element);
+    resolution.forgetElement(element, compiler);
+    codegen.forgetElement(element, compiler);
   }
 }
 
 abstract class Enqueuer {
-  EnqueueTask task;
-  Universe get universe;
-  native.NativeEnqueuer nativeEnqueuer; // Set by EnqueueTask
-  void forgetElement(Element element);
-  void processInstantiatedClassMembers(ClassElement cls);
-  void processInstantiatedClassMember(ClassElement cls, Element member);
-  void handleUnseenSelectorInternal(DynamicUse dynamicUse);
-  void registerStaticUse(StaticUse staticUse);
-  void registerStaticUseInternal(StaticUse staticUse);
-  void registerDynamicUse(DynamicUse dynamicUse);
-  void registerTypeUse(TypeUse typeUse);
+  WorldBuilder get universe;
+  native.NativeEnqueuer get nativeEnqueuer;
+  void forgetElement(Element element, Compiler compiler);
+
+  // TODO(johnniwinther): Initialize [_impactStrategy] to `null`.
+  ImpactStrategy _impactStrategy = const ImpactStrategy();
+
+  ImpactStrategy get impactStrategy => _impactStrategy;
+
+  void open(ImpactStrategy impactStrategy) {
+    _impactStrategy = impactStrategy;
+  }
+
+  void close() {
+    // TODO(johnniwinther): Set [_impactStrategy] to `null` and [queueIsClosed]
+    // to `true` here.
+    _impactStrategy = const ImpactStrategy();
+  }
 
   /// Returns [:true:] if this enqueuer is the resolution enqueuer.
   bool get isResolutionQueue;
@@ -91,26 +102,12 @@
 
   ImpactUseCase get impactUse;
 
-  /**
-   * Documentation wanted -- johnniwinther
-   *
-   * Invariant: [element] must be a declaration element.
-   */
-  void addToWorkList(Element element);
-
-  void enableIsolateSupport();
-
-  /// Enqueue the static fields that have been marked as used by reflective
-  /// usage through `MirrorsUsed`.
-  void enqueueReflectiveStaticFields(Iterable<Element> elements);
-
-  /// Enqueue all elements that are matched by the mirrors used
-  /// annotation or, in lack thereof, all elements.
-  void enqueueReflectiveElements(Iterable<ClassElement> recents);
-
-  void registerInstantiatedType(InterfaceType type, {bool mirrorUsage: false});
   void forEach(void f(WorkItem work));
-  void applyImpact(Element element, WorldImpact worldImpact);
+
+  /// Apply the [worldImpact] to this enqueuer. If the [impactSource] is
+  /// provided the impact strategy will remove it from the element impact cache,
+  /// if it is no longer needed.
+  void applyImpact(WorldImpact worldImpact, {Element impactSource});
   bool checkNoEnqueuedInvokedInstanceMethods();
   void logSummary(log(message));
 
@@ -118,12 +115,33 @@
   bool isProcessed(Element member);
 
   Iterable<Entity> get processedEntities;
+
+  Iterable<ClassElement> get processedClasses;
+}
+
+abstract class EnqueuerImpl extends Enqueuer {
+  CompilerTask get task;
+  void processInstantiatedClassMembers(ClassElement cls);
+  void processInstantiatedClassMember(ClassElement cls, Element member);
+  void registerStaticUse(StaticUse staticUse);
+  void registerStaticUseInternal(StaticUse staticUse);
+  void registerTypeUse(TypeUse typeUse);
+  void registerTypeUseInternal(TypeUse typeUse);
+  void registerDynamicUse(DynamicUse dynamicUse);
+  void handleUnseenSelectorInternal(DynamicUse dynamicUse);
 }
 
 /// [Enqueuer] which is specific to resolution.
-class ResolutionEnqueuer extends Enqueuer {
+class ResolutionEnqueuer extends EnqueuerImpl {
+  final CompilerTask task;
   final String name;
-  final Compiler compiler; // TODO(ahe): Remove this dependency.
+  final Resolution resolution;
+  final CompilerOptions options;
+  final Backend backend;
+  final GlobalDependencyRegistry globalDependencies;
+  final CommonElements commonElements;
+  final native.NativeEnqueuer nativeEnqueuer;
+
   final EnqueuerStrategy strategy;
   final Map<String, Set<Element>> instanceMembersByName =
       new Map<String, Set<Element>>();
@@ -131,38 +149,40 @@
       new Map<String, Set<Element>>();
   final Set<ClassElement> _processedClasses = new Set<ClassElement>();
   Set<ClassElement> recentClasses = new Setlet<ClassElement>();
-  final ResolutionUniverseImpl _universe =
-      new ResolutionUniverseImpl(const TypeMaskStrategy());
-
-  static final TRACE_MIRROR_ENQUEUING =
-      const bool.fromEnvironment("TRACE_MIRROR_ENQUEUING");
+  final ResolutionWorldBuilderImpl _universe;
 
   bool queueIsClosed = false;
 
-  bool hasEnqueuedReflectiveElements = false;
-  bool hasEnqueuedReflectiveStaticFields = false;
-
   WorldImpactVisitor impactVisitor;
 
-  ResolutionEnqueuer(Compiler compiler, this.strategy)
-      : this.name = 'resolution enqueuer',
-        this.compiler = compiler,
+  ResolutionEnqueuer(
+      this.task,
+      this.options,
+      this.resolution,
+      this.strategy,
+      this.globalDependencies,
+      Backend backend,
+      CommonElements commonElements,
+      CacheStrategy cacheStrategy,
+      [this.name = 'resolution enqueuer'])
+      : this.backend = backend,
+        this.commonElements = commonElements,
+        this.nativeEnqueuer = backend.nativeResolutionEnqueuer(),
         processedElements = new Set<AstElement>(),
         queue = new Queue<ResolutionWorkItem>(),
-        deferredQueue = new Queue<_DeferredAction>() {
-    impactVisitor = new _EnqueuerImpactVisitor(this);
+        deferredQueue = new Queue<_DeferredAction>(),
+        _universe = new ResolutionWorldBuilderImpl(
+            backend, commonElements, cacheStrategy, const TypeMaskStrategy()) {
+    impactVisitor = new EnqueuerImplImpactVisitor(this);
   }
 
-  // TODO(johnniwinther): Move this to [ResolutionEnqueuer].
-  Resolution get resolution => compiler.resolution;
+  ResolutionWorldBuilder get universe => _universe;
 
-  ResolutionUniverse get universe => _universe;
+  OpenWorld get openWorld => universe.openWorld;
 
   bool get queueIsEmpty => queue.isEmpty;
 
-  QueueFilter get filter => compiler.enqueuerFilter;
-
-  DiagnosticReporter get reporter => compiler.reporter;
+  DiagnosticReporter get reporter => resolution.reporter;
 
   bool isClassProcessed(ClassElement cls) => _processedClasses.contains(cls);
 
@@ -175,31 +195,43 @@
    */
   void addToWorkList(Element element) {
     assert(invariant(element, element.isDeclaration));
-    if (internalAddToWorkList(element) && compiler.options.dumpInfo) {
-      // TODO(sigmund): add other missing dependencies (internals, selectors
-      // enqueued after allocations), also enable only for the codegen enqueuer.
-      compiler.dumpInfoTask
-          .registerDependency(compiler.currentElement, element);
-    }
+    internalAddToWorkList(element);
   }
 
-  /// Apply the [worldImpact] of processing [element] to this enqueuer.
-  void applyImpact(Element element, WorldImpact worldImpact) {
-    compiler.impactStrategy
-        .visitImpact(element, worldImpact, impactVisitor, impactUse);
+  void applyImpact(WorldImpact worldImpact, {Element impactSource}) {
+    if (worldImpact.isEmpty) return;
+    impactStrategy.visitImpact(
+        impactSource, worldImpact, impactVisitor, impactUse);
   }
 
-  void registerInstantiatedType(InterfaceType type, {bool mirrorUsage: false}) {
+  void registerInstantiatedType(InterfaceType type) {
+    _registerInstantiatedType(type, globalDependency: true);
+  }
+
+  void _registerInstantiatedType(InterfaceType type,
+      {ConstructorElement constructor,
+      bool mirrorUsage: false,
+      bool nativeUsage: false,
+      bool globalDependency: false,
+      bool isRedirection: false}) {
     task.measure(() {
       ClassElement cls = type.element;
       cls.ensureResolved(resolution);
-      bool isNative = compiler.backend.isNative(cls);
+      bool isNative = backend.isNative(cls);
       _universe.registerTypeInstantiation(type,
+          constructor: constructor,
           isNative: isNative,
-          byMirrors: mirrorUsage, onImplemented: (ClassElement cls) {
-        compiler.backend
-            .registerImplementedClass(cls, this, compiler.globalDependencies);
+          byMirrors: mirrorUsage,
+          isRedirection: isRedirection, onImplemented: (ClassElement cls) {
+        applyImpact(backend.registerImplementedClass(cls, forResolution: true));
       });
+      if (globalDependency && !mirrorUsage) {
+        globalDependencies.registerDependency(type.element);
+      }
+      if (nativeUsage) {
+        nativeEnqueuer.onInstantiatedType(type);
+      }
+      backend.registerInstantiatedType(type);
       // TODO(johnniwinther): Share this reasoning with [Universe].
       if (!cls.isAbstract || isNative || mirrorUsage) {
         processInstantiatedClass(cls);
@@ -208,7 +240,7 @@
   }
 
   bool checkNoEnqueuedInvokedInstanceMethods() {
-    return filter.checkNoEnqueuedInvokedInstanceMethods(this);
+    return strategy.checkEnqueuerConsistency(this);
   }
 
   void processInstantiatedClassMembers(ClassElement cls) {
@@ -229,14 +261,14 @@
       // its metadata parsed and analyzed.
       // Note: this assumes that there are no non-native fields on native
       // classes, which may not be the case when a native class is subclassed.
-      if (compiler.backend.isNative(cls)) {
-        compiler.openWorld.registerUsedElement(member);
-        if (_universe.hasInvokedGetter(member, compiler.openWorld) ||
-            _universe.hasInvocation(member, compiler.openWorld)) {
+      if (backend.isNative(cls)) {
+        openWorld.registerUsedElement(member);
+        if (_universe.hasInvokedGetter(member, openWorld) ||
+            _universe.hasInvocation(member, openWorld)) {
           addToWorkList(member);
           return;
         }
-        if (_universe.hasInvokedSetter(member, compiler.openWorld)) {
+        if (_universe.hasInvokedSetter(member, openWorld)) {
           addToWorkList(member);
           return;
         }
@@ -256,11 +288,11 @@
         registerNoSuchMethod(function);
       }
       if (function.name == Identifiers.call && !cls.typeVariables.isEmpty) {
-        registerCallMethodWithFreeTypeVariables(function);
+        _registerCallMethodWithFreeTypeVariables(function);
       }
       // If there is a property access with the same name as a method we
       // need to emit the method.
-      if (_universe.hasInvokedGetter(function, compiler.openWorld)) {
+      if (_universe.hasInvokedGetter(function, openWorld)) {
         registerClosurizedMember(function);
         addToWorkList(function);
         return;
@@ -270,27 +302,27 @@
       instanceFunctionsByName
           .putIfAbsent(memberName, () => new Set<Element>())
           .add(member);
-      if (_universe.hasInvocation(function, compiler.openWorld)) {
+      if (_universe.hasInvocation(function, openWorld)) {
         addToWorkList(function);
         return;
       }
     } else if (member.isGetter) {
       FunctionElement getter = member;
       getter.computeType(resolution);
-      if (_universe.hasInvokedGetter(getter, compiler.openWorld)) {
+      if (_universe.hasInvokedGetter(getter, openWorld)) {
         addToWorkList(getter);
         return;
       }
       // We don't know what selectors the returned closure accepts. If
       // the set contains any selector we have to assume that it matches.
-      if (_universe.hasInvocation(getter, compiler.openWorld)) {
+      if (_universe.hasInvocation(getter, openWorld)) {
         addToWorkList(getter);
         return;
       }
     } else if (member.isSetter) {
       FunctionElement setter = member;
       setter.computeType(resolution);
-      if (_universe.hasInvokedSetter(setter, compiler.openWorld)) {
+      if (_universe.hasInvokedSetter(setter, openWorld)) {
         addToWorkList(setter);
         return;
       }
@@ -317,14 +349,12 @@
         recentClasses.add(superclass);
         superclass.ensureResolved(resolution);
         superclass.implementation.forEachMember(processInstantiatedClassMember);
-        if (!compiler.serialization.isDeserialized(superclass)) {
-          compiler.resolver.checkClass(superclass);
-        }
+        resolution.ensureClassMembers(superclass);
         // We only tell the backend once that [superclass] was instantiated, so
         // any additional dependencies must be treated as global
         // dependencies.
-        compiler.backend.registerInstantiatedClass(
-            superclass, this, compiler.globalDependencies);
+        applyImpact(
+            backend.registerInstantiatedClass(superclass, forResolution: true));
       }
 
       ClassElement superclass = cls;
@@ -343,172 +373,6 @@
     });
   }
 
-  void logEnqueueReflectiveAction(action, [msg = ""]) {
-    if (TRACE_MIRROR_ENQUEUING) {
-      print("MIRROR_ENQUEUE (R): $action $msg");
-    }
-  }
-
-  /// Enqeue the constructor [ctor] if it is required for reflection.
-  ///
-  /// [enclosingWasIncluded] provides a hint whether the enclosing element was
-  /// needed for reflection.
-  void enqueueReflectiveConstructor(
-      ConstructorElement ctor, bool enclosingWasIncluded) {
-    if (shouldIncludeElementDueToMirrors(ctor,
-        includedEnclosing: enclosingWasIncluded)) {
-      logEnqueueReflectiveAction(ctor);
-      ClassElement cls = ctor.declaration.enclosingClass;
-      compiler.backend.registerInstantiatedType(
-          cls.rawType, this, compiler.mirrorDependencies,
-          mirrorUsage: true);
-      registerStaticUse(new StaticUse.foreignUse(ctor.declaration));
-    }
-  }
-
-  /// Enqeue the member [element] if it is required for reflection.
-  ///
-  /// [enclosingWasIncluded] provides a hint whether the enclosing element was
-  /// needed for reflection.
-  void enqueueReflectiveMember(Element element, bool enclosingWasIncluded) {
-    if (shouldIncludeElementDueToMirrors(element,
-        includedEnclosing: enclosingWasIncluded)) {
-      logEnqueueReflectiveAction(element);
-      if (element.isTypedef) {
-        TypedefElement typedef = element;
-        typedef.ensureResolved(resolution);
-      } else if (Elements.isStaticOrTopLevel(element)) {
-        registerStaticUse(new StaticUse.foreignUse(element.declaration));
-      } else if (element.isInstanceMember) {
-        // We need to enqueue all members matching this one in subclasses, as
-        // well.
-        // TODO(herhut): Use TypedSelector.subtype for enqueueing
-        DynamicUse dynamicUse =
-            new DynamicUse(new Selector.fromElement(element), null);
-        registerDynamicUse(dynamicUse);
-        if (element.isField) {
-          DynamicUse dynamicUse = new DynamicUse(
-              new Selector.setter(
-                  new Name(element.name, element.library, isSetter: true)),
-              null);
-          registerDynamicUse(dynamicUse);
-        }
-      }
-    }
-  }
-
-  /// Enqeue the member [element] if it is required for reflection.
-  ///
-  /// [enclosingWasIncluded] provides a hint whether the enclosing element was
-  /// needed for reflection.
-  void enqueueReflectiveElementsInClass(ClassElement cls,
-      Iterable<ClassElement> recents, bool enclosingWasIncluded) {
-    if (cls.library.isInternalLibrary || cls.isInjected) return;
-    bool includeClass = shouldIncludeElementDueToMirrors(cls,
-        includedEnclosing: enclosingWasIncluded);
-    if (includeClass) {
-      logEnqueueReflectiveAction(cls, "register");
-      ClassElement decl = cls.declaration;
-      decl.ensureResolved(resolution);
-      compiler.backend.registerInstantiatedType(
-          decl.rawType, this, compiler.mirrorDependencies,
-          mirrorUsage: true);
-    }
-    // If the class is never instantiated, we know nothing of it can possibly
-    // be reflected upon.
-    // TODO(herhut): Add a warning if a mirrors annotation cannot hit.
-    if (recents.contains(cls.declaration)) {
-      logEnqueueReflectiveAction(cls, "members");
-      cls.constructors.forEach((Element element) {
-        enqueueReflectiveConstructor(element, includeClass);
-      });
-      cls.forEachClassMember((Member member) {
-        enqueueReflectiveMember(member.element, includeClass);
-      });
-    }
-  }
-
-  /// Enqeue special classes that might not be visible by normal means or that
-  /// would not normally be enqueued:
-  ///
-  /// [Closure] is treated specially as it is the superclass of all closures.
-  /// Although it is in an internal library, we mark it as reflectable. Note
-  /// that none of its methods are reflectable, unless reflectable by
-  /// inheritance.
-  void enqueueReflectiveSpecialClasses() {
-    Iterable<ClassElement> classes =
-        compiler.backend.classesRequiredForReflection;
-    for (ClassElement cls in classes) {
-      if (compiler.backend.referencedFromMirrorSystem(cls)) {
-        logEnqueueReflectiveAction(cls);
-        cls.ensureResolved(resolution);
-        compiler.backend.registerInstantiatedType(
-            cls.rawType, this, compiler.mirrorDependencies,
-            mirrorUsage: true);
-      }
-    }
-  }
-
-  /// Enqeue all local members of the library [lib] if they are required for
-  /// reflection.
-  void enqueueReflectiveElementsInLibrary(
-      LibraryElement lib, Iterable<ClassElement> recents) {
-    bool includeLibrary =
-        shouldIncludeElementDueToMirrors(lib, includedEnclosing: false);
-    lib.forEachLocalMember((Element member) {
-      if (member.isInjected) return;
-      if (member.isClass) {
-        enqueueReflectiveElementsInClass(member, recents, includeLibrary);
-      } else {
-        enqueueReflectiveMember(member, includeLibrary);
-      }
-    });
-  }
-
-  /// Enqueue all elements that are matched by the mirrors used
-  /// annotation or, in lack thereof, all elements.
-  void enqueueReflectiveElements(Iterable<ClassElement> recents) {
-    if (!hasEnqueuedReflectiveElements) {
-      logEnqueueReflectiveAction("!START enqueueAll");
-      // First round of enqueuing, visit everything that is visible to
-      // also pick up static top levels, etc.
-      // Also, during the first round, consider all classes that have been seen
-      // as recently seen, as we do not know how many rounds of resolution might
-      // have run before tree shaking is disabled and thus everything is
-      // enqueued.
-      recents = _processedClasses.toSet();
-      reporter.log('Enqueuing everything');
-      for (LibraryElement lib in compiler.libraryLoader.libraries) {
-        enqueueReflectiveElementsInLibrary(lib, recents);
-      }
-      enqueueReflectiveSpecialClasses();
-      hasEnqueuedReflectiveElements = true;
-      hasEnqueuedReflectiveStaticFields = true;
-      logEnqueueReflectiveAction("!DONE enqueueAll");
-    } else if (recents.isNotEmpty) {
-      // Keep looking at new classes until fixpoint is reached.
-      logEnqueueReflectiveAction("!START enqueueRecents");
-      recents.forEach((ClassElement cls) {
-        enqueueReflectiveElementsInClass(
-            cls,
-            recents,
-            shouldIncludeElementDueToMirrors(cls.library,
-                includedEnclosing: false));
-      });
-      logEnqueueReflectiveAction("!DONE enqueueRecents");
-    }
-  }
-
-  /// Enqueue the static fields that have been marked as used by reflective
-  /// usage through `MirrorsUsed`.
-  void enqueueReflectiveStaticFields(Iterable<Element> elements) {
-    if (hasEnqueuedReflectiveStaticFields) return;
-    hasEnqueuedReflectiveStaticFields = true;
-    for (Element element in elements) {
-      enqueueReflectiveMember(element, true);
-    }
-  }
-
   void processSet(
       Map<String, Set<Element>> map, String memberName, bool f(Element e)) {
     Set<Element> members = map[memberName];
@@ -540,7 +404,7 @@
     Selector selector = dynamicUse.selector;
     String methodName = selector.name;
     processInstanceMembers(methodName, (Element member) {
-      if (dynamicUse.appliesUnnamed(member, compiler.openWorld)) {
+      if (dynamicUse.appliesUnnamed(member, openWorld)) {
         if (member.isFunction && selector.isGetter) {
           registerClosurizedMember(member);
         }
@@ -551,7 +415,7 @@
     });
     if (selector.isGetter) {
       processInstanceFunctions(methodName, (Element member) {
-        if (dynamicUse.appliesUnnamed(member, compiler.openWorld)) {
+        if (dynamicUse.appliesUnnamed(member, openWorld)) {
           registerClosurizedMember(member);
           return true;
         }
@@ -574,11 +438,11 @@
     assert(invariant(element, element.isDeclaration,
         message: "Element ${element} is not the declaration."));
     _universe.registerStaticUse(staticUse);
-    compiler.backend.registerStaticUse(element, this);
+    applyImpact(backend.registerStaticUse(element, forResolution: true));
     bool addElement = true;
     switch (staticUse.kind) {
       case StaticUseKind.STATIC_TEAR_OFF:
-        compiler.backend.registerGetOfStaticFunction(this);
+        applyImpact(backend.registerGetOfStaticFunction());
         break;
       case StaticUseKind.FIELD_GET:
       case StaticUseKind.FIELD_SET:
@@ -587,11 +451,31 @@
         // [FIELD_SET] contains [BoxFieldElement]s which we cannot enqueue.
         // Also [CLOSURE] contains [LocalFunctionElement] which we cannot
         // enqueue.
+        LocalFunctionElement closure = staticUse.element;
+        if (closure.type.containsTypeVariables) {
+          universe.closuresWithFreeTypeVariables.add(closure);
+        }
         addElement = false;
         break;
       case StaticUseKind.SUPER_FIELD_SET:
       case StaticUseKind.SUPER_TEAR_OFF:
       case StaticUseKind.GENERAL:
+      case StaticUseKind.DIRECT_USE:
+        break;
+      case StaticUseKind.CONSTRUCTOR_INVOKE:
+      case StaticUseKind.CONST_CONSTRUCTOR_INVOKE:
+        _registerInstantiatedType(staticUse.type,
+            constructor: staticUse.element, globalDependency: false);
+        break;
+      case StaticUseKind.REDIRECTION:
+        _registerInstantiatedType(staticUse.type,
+            constructor: staticUse.element,
+            globalDependency: false,
+            isRedirection: true);
+        break;
+      case StaticUseKind.DIRECT_INVOKE:
+        invariant(
+            element, 'Direct static use is not supported for resolution.');
         break;
     }
     if (addElement) {
@@ -600,19 +484,30 @@
   }
 
   void registerTypeUse(TypeUse typeUse) {
+    strategy.processTypeUse(this, typeUse);
+  }
+
+  void registerTypeUseInternal(TypeUse typeUse) {
     DartType type = typeUse.type;
     switch (typeUse.kind) {
       case TypeUseKind.INSTANTIATION:
-        registerInstantiatedType(type);
+        _registerInstantiatedType(type, globalDependency: false);
         break;
-      case TypeUseKind.INSTANTIATION:
+      case TypeUseKind.MIRROR_INSTANTIATION:
+        _registerInstantiatedType(type,
+            mirrorUsage: true, globalDependency: false);
+        break;
+      case TypeUseKind.NATIVE_INSTANTIATION:
+        _registerInstantiatedType(type,
+            nativeUsage: true, globalDependency: true);
+        break;
       case TypeUseKind.IS_CHECK:
       case TypeUseKind.AS_CAST:
       case TypeUseKind.CATCH_TYPE:
         _registerIsCheck(type);
         break;
       case TypeUseKind.CHECKED_MODE_CHECK:
-        if (compiler.options.enableTypeAssertions) {
+        if (options.enableTypeAssertions) {
           _registerIsCheck(type);
         }
         break;
@@ -622,27 +517,27 @@
   }
 
   void _registerIsCheck(DartType type) {
-    type = _universe.registerIsCheck(type, compiler);
+    type = _universe.registerIsCheck(type, resolution);
     // Even in checked mode, type annotations for return type and argument
     // types do not imply type checks, so there should never be a check
     // against the type variable of a typedef.
     assert(!type.isTypeVariable || !type.element.enclosingElement.isTypedef);
   }
 
-  void registerCallMethodWithFreeTypeVariables(Element element) {
-    compiler.backend.registerCallMethodWithFreeTypeVariables(
-        element, this, compiler.globalDependencies);
+  void _registerCallMethodWithFreeTypeVariables(Element element) {
+    applyImpact(backend.registerCallMethodWithFreeTypeVariables(element,
+        forResolution: true));
     _universe.callMethodsWithFreeTypeVariables.add(element);
   }
 
   void registerClosurizedMember(TypedElement element) {
     assert(element.isInstanceMember);
     if (element.computeType(resolution).containsTypeVariables) {
-      compiler.backend.registerClosureWithFreeTypeVariables(
-          element, this, compiler.globalDependencies);
+      applyImpact(backend.registerClosureWithFreeTypeVariables(element,
+          forResolution: true));
       _universe.closuresWithFreeTypeVariables.add(element);
     }
-    compiler.backend.registerBoundClosure(this);
+    applyImpact(backend.registerBoundClosure());
     _universe.closurizedMembers.add(element);
   }
 
@@ -650,7 +545,11 @@
     do {
       while (queue.isNotEmpty) {
         // TODO(johnniwinther): Find an optimal process order.
-        filter.processWorkItem(f, queue.removeLast());
+        WorkItem work = queue.removeLast();
+        if (!isProcessed(work.element)) {
+          strategy.processWorkItem(f, work);
+          registerProcessedElement(work.element);
+        }
       }
       List recents = recentClasses.toList(growable: false);
       recentClasses.clear();
@@ -693,21 +592,7 @@
   /// Registers [element] as processed by the resolution enqueuer.
   void registerProcessedElement(AstElement element) {
     processedElements.add(element);
-    compiler.backend.onElementResolved(element);
-  }
-
-  /**
-   * Decides whether an element should be included to satisfy requirements
-   * of the mirror system.
-   *
-   * During resolution, we have to resort to matching elements against the
-   * [MirrorsUsed] pattern, as we do not have a complete picture of the world,
-   * yet.
-   */
-  bool shouldIncludeElementDueToMirrors(Element element,
-      {bool includedEnclosing}) {
-    return includedEnclosing ||
-        compiler.backend.requiredByMirrorSystem(element);
+    backend.onElementResolved(element);
   }
 
   /**
@@ -726,16 +611,16 @@
           element, "Resolution work list is closed. Trying to add $element.");
     }
 
-    compiler.openWorld.registerUsedElement(element);
+    openWorld.registerUsedElement(element);
 
-    ResolutionWorkItem workItem = compiler.resolution.createWorkItem(element);
+    ResolutionWorkItem workItem = resolution.createWorkItem(element);
     queue.add(workItem);
 
     // Enable isolate support if we start using something from the isolate
     // library, or timers for the async library.  We exclude constant fields,
     // which are ending here because their initializing expression is compiled.
     LibraryElement library = element.library;
-    if (!compiler.hasIsolateSupport && (!element.isField || !element.isConst)) {
+    if (!universe.hasIsolateSupport && (!element.isField || !element.isConst)) {
       String uri = library.canonicalUri.toString();
       if (uri == 'dart:isolate') {
         enableIsolateSupport();
@@ -754,23 +639,23 @@
       // We have to enable runtime type before hitting the codegen, so
       // that constructors know whether they need to generate code for
       // runtime type.
-      compiler.enabledRuntimeType = true;
+      _universe.hasRuntimeTypeSupport = true;
       // TODO(ahe): Record precise dependency here.
-      compiler.backend.registerRuntimeType(this, compiler.globalDependencies);
-    } else if (compiler.commonElements.isFunctionApplyMethod(element)) {
-      compiler.enabledFunctionApply = true;
+      applyImpact(backend.registerRuntimeType());
+    } else if (commonElements.isFunctionApplyMethod(element)) {
+      _universe.hasFunctionApplySupport = true;
     }
 
     return true;
   }
 
   void registerNoSuchMethod(Element element) {
-    compiler.backend.registerNoSuchMethod(element);
+    backend.registerNoSuchMethod(element);
   }
 
   void enableIsolateSupport() {
-    compiler.hasIsolateSupport = true;
-    compiler.backend.enableIsolateSupport(this);
+    _universe.hasIsolateSupport = true;
+    applyImpact(backend.enableIsolateSupport(forResolution: true));
   }
 
   /**
@@ -800,7 +685,7 @@
   bool onQueueEmpty(Iterable<ClassElement> recentClasses) {
     _emptyDeferredQueue();
 
-    return compiler.backend.onQueueEmpty(this, recentClasses);
+    return backend.onQueueEmpty(this, recentClasses);
   }
 
   void emptyDeferredQueueForTesting() => _emptyDeferredQueue();
@@ -812,7 +697,7 @@
     }
   }
 
-  void forgetElement(Element element) {
+  void forgetElement(Element element, Compiler compiler) {
     _universe.forgetElement(element, compiler);
     _processedClasses.remove(element);
     instanceMembersByName[element.name]?.remove(element);
@@ -821,11 +706,32 @@
   }
 }
 
-/// Parameterizes filtering of which work items are enqueued.
-class QueueFilter {
-  bool checkNoEnqueuedInvokedInstanceMethods(Enqueuer enqueuer) {
+void removeFromSet(Map<String, Set<Element>> map, Element element) {
+  Set<Element> set = map[element.name];
+  if (set == null) return;
+  set.remove(element);
+}
+
+/// Strategy used by the enqueuer to populate the world.
+class EnqueuerStrategy {
+  const EnqueuerStrategy();
+
+  /// Process a class instantiated in live code.
+  void processInstantiatedClass(EnqueuerImpl enqueuer, ClassElement cls) {}
+
+  /// Process a static use of and element in live code.
+  void processStaticUse(EnqueuerImpl enqueuer, StaticUse staticUse) {}
+
+  /// Process a type use in live code.
+  void processTypeUse(EnqueuerImpl enqueuer, TypeUse typeUse) {}
+
+  /// Process a dynamic use for a call site in live code.
+  void processDynamicUse(EnqueuerImpl enqueuer, DynamicUse dynamicUse) {}
+
+  /// Check enqueuer consistency after the queue has been closed.
+  bool checkEnqueuerConsistency(EnqueuerImpl enqueuer) {
     enqueuer.task.measure(() {
-      // Run through the classes and see if we need to compile methods.
+      // Run through the classes and see if we need to enqueue more methods.
       for (ClassElement classElement
           in enqueuer.universe.directlyInstantiatedClasses) {
         for (ClassElement currentClass = classElement;
@@ -838,55 +744,51 @@
     return true;
   }
 
+  /// Process [work] using [f].
   void processWorkItem(void f(WorkItem work), WorkItem work) {
     f(work);
   }
 }
 
-void removeFromSet(Map<String, Set<Element>> map, Element element) {
-  Set<Element> set = map[element.name];
-  if (set == null) return;
-  set.remove(element);
+/// Strategy that only enqueues directly used elements.
+class DirectEnqueuerStrategy extends EnqueuerStrategy {
+  const DirectEnqueuerStrategy();
+  void processStaticUse(EnqueuerImpl enqueuer, StaticUse staticUse) {
+    if (staticUse.kind == StaticUseKind.DIRECT_USE) {
+      enqueuer.registerStaticUseInternal(staticUse);
+    }
+  }
 }
 
-/// Strategy used by the enqueuer to populate the world.
-// TODO(johnniwinther): Merge this interface with [QueueFilter].
-class EnqueuerStrategy {
-  const EnqueuerStrategy();
-
-  /// Process a class instantiated in live code.
-  void processInstantiatedClass(Enqueuer enqueuer, ClassElement cls) {}
-
-  /// Process a static use of and element in live code.
-  void processStaticUse(Enqueuer enqueuer, StaticUse staticUse) {}
-
-  /// Process a dynamic use for a call site in live code.
-  void processDynamicUse(Enqueuer enqueuer, DynamicUse dynamicUse) {}
-}
-
-class TreeShakingEnqueuerStrategy implements EnqueuerStrategy {
+/// Strategy used for tree-shaking.
+class TreeShakingEnqueuerStrategy extends EnqueuerStrategy {
   const TreeShakingEnqueuerStrategy();
 
   @override
-  void processInstantiatedClass(Enqueuer enqueuer, ClassElement cls) {
+  void processInstantiatedClass(EnqueuerImpl enqueuer, ClassElement cls) {
     cls.implementation.forEachMember(enqueuer.processInstantiatedClassMember);
   }
 
   @override
-  void processStaticUse(Enqueuer enqueuer, StaticUse staticUse) {
+  void processStaticUse(EnqueuerImpl enqueuer, StaticUse staticUse) {
     enqueuer.registerStaticUseInternal(staticUse);
   }
 
   @override
-  void processDynamicUse(Enqueuer enqueuer, DynamicUse dynamicUse) {
+  void processTypeUse(EnqueuerImpl enqueuer, TypeUse typeUse) {
+    enqueuer.registerTypeUseInternal(typeUse);
+  }
+
+  @override
+  void processDynamicUse(EnqueuerImpl enqueuer, DynamicUse dynamicUse) {
     enqueuer.handleUnseenSelectorInternal(dynamicUse);
   }
 }
 
-class _EnqueuerImpactVisitor implements WorldImpactVisitor {
-  final Enqueuer enqueuer;
+class EnqueuerImplImpactVisitor implements WorldImpactVisitor {
+  final EnqueuerImpl enqueuer;
 
-  _EnqueuerImpactVisitor(this.enqueuer);
+  EnqueuerImplImpactVisitor(this.enqueuer);
 
   @override
   void visitDynamicUse(DynamicUse dynamicUse) {
diff --git a/pkg/compiler/lib/src/helpers/debug_collection.dart b/pkg/compiler/lib/src/helpers/debug_collection.dart
index 751b8c8..b20bf0c 100644
--- a/pkg/compiler/lib/src/helpers/debug_collection.dart
+++ b/pkg/compiler/lib/src/helpers/debug_collection.dart
@@ -261,7 +261,7 @@
 
   Set<E> union(Set<E> other) => set.union(other);
 
-  Set<E> difference(Set<E> other) => set.difference(other);
+  Set<E> difference(Set<Object> other) => set.difference(other);
 
   void clear() => set.clear();
 
diff --git a/pkg/compiler/lib/src/helpers/expensive_set.dart b/pkg/compiler/lib/src/helpers/expensive_set.dart
index 2b34cfb..d4c6493 100644
--- a/pkg/compiler/lib/src/helpers/expensive_set.dart
+++ b/pkg/compiler/lib/src/helpers/expensive_set.dart
@@ -101,7 +101,7 @@
     return _newSet()..addAll(this)..addAll(other);
   }
 
-  Set<E> difference(Set<E> other) {
+  Set<E> difference(Set<Object> other) {
     Set<E> result = _newSet();
     for (E element in this) {
       if (!other.contains(element)) result.add(element);
diff --git a/pkg/compiler/lib/src/inferrer/closure_tracer.dart b/pkg/compiler/lib/src/inferrer/closure_tracer.dart
index bb406ca..a757a7b 100644
--- a/pkg/compiler/lib/src/inferrer/closure_tracer.dart
+++ b/pkg/compiler/lib/src/inferrer/closure_tracer.dart
@@ -6,6 +6,7 @@
 
 import '../common/names.dart' show Names;
 import '../elements/elements.dart';
+import '../js_backend/backend_helpers.dart';
 import '../types/types.dart' show TypeMask;
 import '../universe/selector.dart' show Selector;
 import 'debug.dart' as debug;
@@ -71,7 +72,7 @@
     Element called = info.calledElement;
     if (compiler.backend.isForeign(called)) {
       String name = called.name;
-      if (name == 'JS' || name == 'DART_CLOSURE_TO_JS') {
+      if (name == BackendHelpers.JS || name == 'DART_CLOSURE_TO_JS') {
         bailout('Used in JS ${info.call}');
       }
     }
diff --git a/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart b/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart
index bff02bd..7b913b0 100644
--- a/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart
+++ b/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart
@@ -763,9 +763,22 @@
 
   T visitAssert(Assert node) {
     // Avoid pollution from assert statement unless enabled.
-    if (compiler.options.enableUserAssertions) {
-      super.visitAssert(node);
+    if (!compiler.options.enableUserAssertions) {
+      return null;
     }
+    List<Send> tests = <Send>[];
+    bool simpleCondition = handleCondition(node.condition, tests);
+    LocalsHandler<T> saved = locals;
+    locals = new LocalsHandler<T>.from(locals, node);
+    updateIsChecks(tests, usePositive: true);
+
+    LocalsHandler<T> thenLocals = locals;
+    locals = new LocalsHandler<T>.from(saved, node);
+    if (simpleCondition) updateIsChecks(tests, usePositive: false);
+    visit(node.message);
+    locals.seenReturnOrThrow = true;
+    saved.mergeDiamondFlow(thenLocals, locals);
+    locals = saved;
     return null;
   }
 
@@ -958,13 +971,6 @@
     }
   }
 
-  T _superType;
-  T get superType {
-    if (_superType != null) return _superType;
-    return _superType =
-        types.nonNullExact(outermostElement.enclosingClass.superclass);
-  }
-
   @override
   T visitThisGet(Identifier node, _) {
     return thisType;
@@ -974,7 +980,7 @@
     if (node.isThis()) {
       return thisType;
     } else if (node.isSuper()) {
-      return superType;
+      return internalError(node, 'Unexpected expression $node.');
     } else {
       Element element = elements[node];
       if (Elements.isLocal(element)) {
diff --git a/pkg/compiler/lib/src/inferrer/list_tracer.dart b/pkg/compiler/lib/src/inferrer/list_tracer.dart
index d0985e0..575a8c9 100644
--- a/pkg/compiler/lib/src/inferrer/list_tracer.dart
+++ b/pkg/compiler/lib/src/inferrer/list_tracer.dart
@@ -5,6 +5,7 @@
 library compiler.src.inferrer.list_tracer;
 
 import '../elements/elements.dart';
+import '../js_backend/backend_helpers.dart';
 import '../universe/selector.dart' show Selector;
 import '../util/util.dart' show Setlet;
 import 'node_tracer.dart';
@@ -164,7 +165,8 @@
   visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info) {
     super.visitStaticCallSiteTypeInformation(info);
     Element called = info.calledElement;
-    if (compiler.backend.isForeign(called) && called.name == 'JS') {
+    if (compiler.backend.isForeign(called) &&
+        called.name == BackendHelpers.JS) {
       bailout('Used in JS ${info.call}');
     }
   }
diff --git a/pkg/compiler/lib/src/inferrer/map_tracer.dart b/pkg/compiler/lib/src/inferrer/map_tracer.dart
index 22a9f0f..0abb2ca 100644
--- a/pkg/compiler/lib/src/inferrer/map_tracer.dart
+++ b/pkg/compiler/lib/src/inferrer/map_tracer.dart
@@ -5,6 +5,7 @@
 library compiler.src.inferrer.map_tracer;
 
 import '../elements/elements.dart';
+import '../js_backend/backend_helpers.dart';
 import '../universe/selector.dart' show Selector;
 import 'node_tracer.dart';
 import 'type_graph_nodes.dart';
@@ -66,7 +67,8 @@
   visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info) {
     super.visitStaticCallSiteTypeInformation(info);
     Element called = info.calledElement;
-    if (compiler.backend.isForeign(called) && called.name == 'JS') {
+    if (compiler.backend.isForeign(called) &&
+        called.name == BackendHelpers.JS) {
       bailout('Used in JS ${info.call}');
     }
   }
diff --git a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
index 85e5dbd..f6cdace 100644
--- a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
+++ b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
@@ -6,18 +6,19 @@
 
 import '../closure.dart' show ClosureClassMap;
 import '../common.dart';
-import '../common/names.dart' show Selectors;
+import '../common/names.dart' show Identifiers, Selectors;
 import '../compiler.dart' show Compiler;
 import '../constants/values.dart' show ConstantValue, IntConstantValue;
 import '../core_types.dart' show CoreClasses, CoreTypes;
 import '../dart_types.dart' show DartType;
 import '../elements/elements.dart';
+import '../js_backend/backend_helpers.dart';
 import '../js_backend/js_backend.dart' as js;
 import '../native/native.dart' as native;
 import '../resolution/operators.dart' as op;
 import '../resolution/tree_elements.dart' show TreeElements;
 import '../tree/tree.dart' as ast;
-import '../types/types.dart' show TypeMask;
+import '../types/types.dart' show TypeMask, GlobalTypeInferenceElementData;
 import '../universe/call_structure.dart' show CallStructure;
 import '../universe/selector.dart' show Selector;
 import '../universe/side_effects.dart' show SideEffects;
@@ -38,6 +39,11 @@
   final Map<ast.Node, T> concreteTypes = new Map<ast.Node, T>();
   final Set<Element> generativeConstructorsExposingThis = new Set<Element>();
 
+  /// Data computed internally within elements, like the type-mask of a send a
+  /// list allocation, or a for-in loop.
+  final Map<Element, GlobalTypeInferenceElementData> inTreeData =
+      new Map<Element, GlobalTypeInferenceElementData>();
+
   InferrerEngine(Compiler compiler, this.types)
       : this.compiler = compiler,
         this.closedWorld = compiler.closedWorld;
@@ -180,6 +186,9 @@
     }
   }
 
+  GlobalTypeInferenceElementData _dataOf(AstElement element) => inTreeData
+      .putIfAbsent(element, () => new GlobalTypeInferenceElementData());
+
   /**
    * Update [sideEffects] with the side effects of [callee] being
    * called with [selector].
@@ -260,27 +269,27 @@
   void updateSelectorInTree(
       AstElement owner, Spannable node, Selector selector, TypeMask mask) {
     ast.Node astNode = node;
-    TreeElements elements = owner.resolvedAst.elements;
+    GlobalTypeInferenceElementData data = _dataOf(owner);
     if (astNode.asSendSet() != null) {
       if (selector.isSetter || selector.isIndexSet) {
-        elements.setTypeMask(node, mask);
+        data.setTypeMask(node, mask);
       } else if (selector.isGetter || selector.isIndex) {
-        elements.setGetterTypeMaskInComplexSendSet(node, mask);
+        data.setGetterTypeMaskInComplexSendSet(node, mask);
       } else {
         assert(selector.isOperator);
-        elements.setOperatorTypeMaskInComplexSendSet(node, mask);
+        data.setOperatorTypeMaskInComplexSendSet(node, mask);
       }
     } else if (astNode.asSend() != null) {
-      elements.setTypeMask(node, mask);
+      data.setTypeMask(node, mask);
     } else {
       assert(astNode.asForIn() != null);
       if (selector == Selectors.iterator) {
-        elements.setIteratorTypeMask(node, mask);
+        data.setIteratorTypeMask(node, mask);
       } else if (selector == Selectors.current) {
-        elements.setCurrentTypeMask(node, mask);
+        data.setCurrentTypeMask(node, mask);
       } else {
         assert(selector == Selectors.moveNext);
-        elements.setMoveNextTypeMask(node, mask);
+        data.setMoveNextTypeMask(node, mask);
       }
     }
   }
@@ -323,6 +332,7 @@
   final Element outermostElement;
   final InferrerEngine<T, TypeSystem<T>> inferrer;
   final Setlet<Entity> capturedVariables = new Setlet<Entity>();
+  final GlobalTypeInferenceElementData inTreeData;
 
   SimpleTypeInferrerVisitor.internal(
       AstElement analyzedElement,
@@ -333,7 +343,8 @@
       locals)
       : super(analyzedElement, resolvedAst, inferrer, inferrer.types, compiler,
             locals),
-        this.inferrer = inferrer {
+        this.inferrer = inferrer,
+        this.inTreeData = inferrer._dataOf(analyzedElement) {
     assert(outermostElement != null);
   }
 
@@ -374,7 +385,7 @@
     // each update, and reading them yields the type that was found in a
     // previous analysis of [outermostElement].
     ClosureClassMap closureData =
-        compiler.closureToClassMapper.computeClosureToClassMapping(resolvedAst);
+        compiler.closureToClassMapper.getClosureToClassMapping(resolvedAst);
     closureData.forEachCapturedVariable((variable, field) {
       locals.setCaptured(variable, field);
     });
@@ -481,9 +492,7 @@
         });
       }
       if (analyzedElement.isGenerativeConstructor && cls.isAbstract) {
-        if (compiler.closedWorld.isDirectlyInstantiated(cls)) {
-          returnType = types.nonNullExact(cls);
-        } else if (compiler.closedWorld.isIndirectlyInstantiated(cls)) {
+        if (compiler.closedWorld.isInstantiated(cls)) {
           returnType = types.nonNullSubclass(cls);
         } else {
           // TODO(johnniwinther): Avoid analyzing [analyzedElement] in this
@@ -558,8 +567,8 @@
     // Record the types of captured non-boxed variables. Types of
     // these variables may already be there, because of an analysis of
     // a previous closure.
-    ClosureClassMap nestedClosureData =
-        compiler.closureToClassMapper.getMappingForNestedFunction(node);
+    ClosureClassMap nestedClosureData = compiler.closureToClassMapper
+        .getClosureToClassMapping(element.resolvedAst);
     nestedClosureData.forEachCapturedVariable((variable, field) {
       if (!nestedClosureData.isVariableBoxed(variable)) {
         if (variable == nestedClosureData.thisLocal) {
@@ -694,10 +703,10 @@
     }
 
     Selector getterSelector = elements.getGetterSelectorInComplexSendSet(node);
-    TypeMask getterMask = elements.getGetterTypeMaskInComplexSendSet(node);
-    TypeMask operatorMask = elements.getOperatorTypeMaskInComplexSendSet(node);
+    TypeMask getterMask = inTreeData.typeOfGetter(node);
+    TypeMask operatorMask = inTreeData.typeOfOperator(node);
     Selector setterSelector = elements.getSelector(node);
-    TypeMask setterMask = elements.getTypeMask(node);
+    TypeMask setterMask = inTreeData.typeOfSend(node);
 
     String op = node.assignmentOperator.source;
     bool isIncrementOrDecrement = op == '++' || op == '--';
@@ -807,12 +816,13 @@
   T handleCompoundIndexSet(
       ast.SendSet node, T receiverType, T indexType, T rhsType) {
     Selector getterSelector = elements.getGetterSelectorInComplexSendSet(node);
-    TypeMask getterMask = elements.getGetterTypeMaskInComplexSendSet(node);
+
+    TypeMask getterMask = inTreeData.typeOfGetter(node);
     Selector operatorSelector =
         elements.getOperatorSelectorInComplexSendSet(node);
-    TypeMask operatorMask = elements.getOperatorTypeMaskInComplexSendSet(node);
+    TypeMask operatorMask = inTreeData.typeOfOperator(node);
     Selector setterSelector = elements.getSelector(node);
-    TypeMask setterMask = elements.getTypeMask(node);
+    TypeMask setterMask = inTreeData.typeOfSend(node);
 
     T getterType = handleDynamicSend(node, getterSelector, getterMask,
         receiverType, new ArgumentsTypes<T>([indexType], null));
@@ -878,23 +888,66 @@
   T visitSuperIndexPrefix(ast.Send node, MethodElement getter,
       MethodElement setter, ast.Node index, op.IncDecOperator operator, _) {
     T indexType = visit(index);
-    return handleCompoundPrefixPostfix(node, superType, indexType);
+    return handleSuperIndexPrefixPostfix(node, getter, setter, indexType);
   }
 
   @override
   T visitSuperIndexPostfix(ast.Send node, MethodElement getter,
       MethodElement setter, ast.Node index, op.IncDecOperator operator, _) {
     T indexType = visit(index);
-    return handleCompoundPrefixPostfix(node, superType, indexType);
+    return handleSuperIndexPrefixPostfix(node, getter, setter, indexType);
+  }
+
+  /// Handle compound prefix/postfix operations, like `super[0]++`.
+  T handleSuperIndexPrefixPostfix(
+      ast.Send node, Element getter, Element setter, T indexType) {
+    return _handleSuperCompoundIndexSet(
+        node, getter, setter, indexType, types.uint31Type);
   }
 
   /// Handle compound super index set, like `super[42] =+ 2`.
-  T handleSuperCompoundIndexSet(
-      ast.SendSet node, ast.Node index, ast.Node rhs) {
-    T receiverType = superType;
+  T handleSuperCompoundIndexSet(ast.SendSet node, Element getter,
+      Element setter, ast.Node index, ast.Node rhs) {
     T indexType = visit(index);
     T rhsType = visit(rhs);
-    return handleCompoundIndexSet(node, receiverType, indexType, rhsType);
+    return _handleSuperCompoundIndexSet(
+        node, getter, setter, indexType, rhsType);
+  }
+
+  T _handleSuperCompoundIndexSet(ast.SendSet node, Element getter,
+      Element setter, T indexType, T rhsType) {
+    Selector getterSelector = elements.getGetterSelectorInComplexSendSet(node);
+
+    TypeMask getterMask = inTreeData.typeOfGetter(node);
+    Selector setterSelector = elements.getSelector(node);
+    TypeMask setterMask = inTreeData.typeOfSend(node);
+
+    T getterType = handleSuperSend(node, getterSelector, getterMask, getter,
+        new ArgumentsTypes<T>([indexType], null));
+
+    T returnType;
+    if (node.isIfNullAssignment) {
+      returnType = types.allocateDiamondPhi(getterType, rhsType);
+    } else {
+      Selector operatorSelector =
+          elements.getOperatorSelectorInComplexSendSet(node);
+      TypeMask operatorMask = inTreeData.typeOfOperator(node);
+      returnType = handleDynamicSend(node, operatorSelector, operatorMask,
+          getterType, new ArgumentsTypes<T>([rhsType], null));
+    }
+    handleSuperSend(node, setterSelector, setterMask, setter,
+        new ArgumentsTypes<T>([indexType, returnType], null));
+
+    return node.isPostfix ? getterType : returnType;
+  }
+
+  T handleSuperSend(ast.Node node, Selector selector, TypeMask mask,
+      Element element, ArgumentsTypes arguments) {
+    if (element.isMalformed) {
+      return handleSuperNoSuchMethod(node, selector, mask, arguments);
+    } else {
+      return handleStaticSend(node, selector, mask, element, arguments);
+    }
   }
 
   @override
@@ -906,25 +959,25 @@
       op.AssignmentOperator operator,
       ast.Node rhs,
       _) {
-    return handleSuperCompoundIndexSet(node, index, rhs);
+    return handleSuperCompoundIndexSet(node, getter, setter, index, rhs);
   }
 
   @override
   T visitSuperIndexSetIfNull(ast.SendSet node, MethodElement getter,
       MethodElement setter, ast.Node index, ast.Node rhs, _) {
-    return handleSuperCompoundIndexSet(node, index, rhs);
+    return handleSuperCompoundIndexSet(node, getter, setter, index, rhs);
   }
 
   @override
   T visitUnresolvedSuperCompoundIndexSet(ast.Send node, Element element,
       ast.Node index, op.AssignmentOperator operator, ast.Node rhs, _) {
-    return handleSuperCompoundIndexSet(node, index, rhs);
+    return handleSuperCompoundIndexSet(node, element, element, index, rhs);
   }
 
   @override
   T visitUnresolvedSuperIndexSetIfNull(
       ast.Send node, Element element, ast.Node index, ast.Node rhs, _) {
-    return handleSuperCompoundIndexSet(node, index, rhs);
+    return handleSuperCompoundIndexSet(node, element, element, index, rhs);
   }
 
   @override
@@ -936,13 +989,13 @@
       op.AssignmentOperator operator,
       ast.Node rhs,
       _) {
-    return handleSuperCompoundIndexSet(node, index, rhs);
+    return handleSuperCompoundIndexSet(node, element, setter, index, rhs);
   }
 
   @override
   T visitUnresolvedSuperGetterIndexSetIfNull(ast.SendSet node, Element element,
       MethodElement setter, ast.Node index, ast.Node rhs, _) {
-    return handleSuperCompoundIndexSet(node, index, rhs);
+    return handleSuperCompoundIndexSet(node, element, setter, index, rhs);
   }
 
   @override
@@ -954,27 +1007,27 @@
       op.AssignmentOperator operator,
       ast.Node rhs,
       _) {
-    return handleSuperCompoundIndexSet(node, index, rhs);
+    return handleSuperCompoundIndexSet(node, getter, element, index, rhs);
   }
 
   @override
   T visitUnresolvedSuperSetterIndexSetIfNull(ast.SendSet node,
       MethodElement getter, Element element, ast.Node index, ast.Node rhs, _) {
-    return handleSuperCompoundIndexSet(node, index, rhs);
+    return handleSuperCompoundIndexSet(node, getter, element, index, rhs);
   }
 
   @override
   T visitUnresolvedSuperIndexPrefix(ast.Send node, Element element,
       ast.Node index, op.IncDecOperator operator, _) {
     T indexType = visit(index);
-    return handleCompoundPrefixPostfix(node, superType, indexType);
+    return handleSuperIndexPrefixPostfix(node, element, element, indexType);
   }
 
   @override
   T visitUnresolvedSuperGetterIndexPrefix(ast.SendSet node, Element element,
       MethodElement setter, ast.Node index, op.IncDecOperator operator, _) {
     T indexType = visit(index);
-    return handleCompoundPrefixPostfix(node, superType, indexType);
+    return handleSuperIndexPrefixPostfix(node, element, setter, indexType);
   }
 
   @override
@@ -986,21 +1039,21 @@
       op.IncDecOperator operator,
       _) {
     T indexType = visit(index);
-    return handleCompoundPrefixPostfix(node, superType, indexType);
+    return handleSuperIndexPrefixPostfix(node, getter, element, indexType);
   }
 
   @override
   T visitUnresolvedSuperIndexPostfix(ast.Send node, Element element,
       ast.Node index, op.IncDecOperator operator, _) {
     T indexType = visit(index);
-    return handleCompoundPrefixPostfix(node, superType, indexType);
+    return handleSuperIndexPrefixPostfix(node, element, element, indexType);
   }
 
   @override
   T visitUnresolvedSuperGetterIndexPostfix(ast.SendSet node, Element element,
       MethodElement setter, ast.Node index, op.IncDecOperator operator, _) {
     T indexType = visit(index);
-    return handleCompoundPrefixPostfix(node, superType, indexType);
+    return handleSuperIndexPrefixPostfix(node, element, setter, indexType);
   }
 
   @override
@@ -1012,13 +1065,247 @@
       op.IncDecOperator operator,
       _) {
     T indexType = visit(index);
-    return handleCompoundPrefixPostfix(node, superType, indexType);
+    return handleSuperIndexPrefixPostfix(node, getter, element, indexType);
+  }
+
+  @override
+  T visitSuperFieldCompound(ast.Send node, FieldElement field,
+      op.AssignmentOperator operator, ast.Node rhs, _) {
+    return handleSuperCompound(node, field, field, rhs);
+  }
+
+  @override
+  T visitSuperFieldSetterCompound(ast.Send node, FieldElement field,
+      FunctionElement setter, op.AssignmentOperator operator, ast.Node rhs, _) {
+    return handleSuperCompound(node, field, setter, rhs);
+  }
+
+  @override
+  T visitSuperGetterFieldCompound(ast.Send node, FunctionElement getter,
+      FieldElement field, op.AssignmentOperator operator, ast.Node rhs, _) {
+    return handleSuperCompound(node, getter, field, rhs);
+  }
+
+  @override
+  T visitSuperGetterSetterCompound(ast.Send node, FunctionElement getter,
+      FunctionElement setter, op.AssignmentOperator operator, ast.Node rhs, _) {
+    return handleSuperCompound(node, getter, setter, rhs);
+  }
+
+  @override
+  T visitSuperMethodSetterCompound(ast.Send node, FunctionElement method,
+      FunctionElement setter, op.AssignmentOperator operator, ast.Node rhs, _) {
+    return handleSuperCompound(node, method, setter, rhs);
+  }
+
+  @override
+  T visitUnresolvedSuperCompound(ast.Send node, Element element,
+      op.AssignmentOperator operator, ast.Node rhs, _) {
+    return handleSuperCompound(node, element, element, rhs);
+  }
+
+  @override
+  T visitUnresolvedSuperGetterCompound(ast.Send node, Element getter,
+      SetterElement setter, op.AssignmentOperator operator, ast.Node rhs, _) {
+    return handleSuperCompound(node, getter, setter, rhs);
+  }
+
+  @override
+  T visitUnresolvedSuperSetterCompound(ast.Send node, GetterElement getter,
+      Element setter, op.AssignmentOperator operator, ast.Node rhs, _) {
+    return handleSuperCompound(node, getter, setter, rhs);
+  }
+
+  @override
+  T visitSuperFieldFieldSetIfNull(ast.Send node, FieldElement readField,
+      FieldElement writtenField, ast.Node rhs, _) {
+    return handleSuperCompound(node, readField, writtenField, rhs);
+  }
+
+  @override
+  T visitSuperFieldSetIfNull(
+      ast.Send node, FieldElement field, ast.Node rhs, _) {
+    return handleSuperCompound(node, field, field, rhs);
+  }
+
+  @override
+  T visitSuperFieldSetterSetIfNull(ast.Send node, FieldElement field,
+      FunctionElement setter, ast.Node rhs, _) {
+    return handleSuperCompound(node, field, setter, rhs);
+  }
+
+  @override
+  T visitSuperGetterFieldSetIfNull(ast.Send node, FunctionElement getter,
+      FieldElement field, ast.Node rhs, _) {
+    return handleSuperCompound(node, getter, field, rhs);
+  }
+
+  @override
+  T visitSuperGetterSetterSetIfNull(ast.Send node, FunctionElement getter,
+      FunctionElement setter, ast.Node rhs, _) {
+    return handleSuperCompound(node, getter, setter, rhs);
+  }
+
+  @override
+  T visitSuperMethodSetIfNull(
+      ast.Send node, FunctionElement method, ast.Node rhs, _) {
+    return handleSuperCompound(node, method, null, rhs);
+  }
+
+  @override
+  T visitSuperMethodSetterSetIfNull(ast.Send node, FunctionElement method,
+      FunctionElement setter, ast.Node rhs, _) {
+    return handleSuperCompound(node, method, setter, rhs);
+  }
+
+  T handleSuperCompound(
+      ast.SendSet node, Element getter, Element setter, ast.Node rhs) {
+    T rhsType = visit(rhs);
+    return _handleSuperCompound(node, getter, setter, rhsType);
+  }
+
+  @override
+  T visitSuperFieldFieldPostfix(ast.SendSet node, FieldElement readField,
+      FieldElement writtenField, op.IncDecOperator operator, _) {
+    return handleSuperPrefixPostfix(node, readField, writtenField);
+  }
+
+  @override
+  T visitSuperFieldFieldPrefix(ast.SendSet node, FieldElement readField,
+      FieldElement writtenField, op.IncDecOperator operator, _) {
+    return handleSuperPrefixPostfix(node, readField, writtenField);
+  }
+
+  @override
+  T visitSuperFieldPostfix(
+      ast.SendSet node, FieldElement field, op.IncDecOperator operator, _) {
+    return handleSuperPrefixPostfix(node, field, field);
+  }
+
+  @override
+  T visitSuperFieldPrefix(
+      ast.SendSet node, FieldElement field, op.IncDecOperator operator, _) {
+    return handleSuperPrefixPostfix(node, field, field);
+  }
+
+  @override
+  T visitSuperFieldSetterPostfix(ast.SendSet node, FieldElement field,
+      FunctionElement setter, op.IncDecOperator operator, _) {
+    return handleSuperPrefixPostfix(node, field, setter);
+  }
+
+  @override
+  T visitSuperFieldSetterPrefix(ast.SendSet node, FieldElement field,
+      FunctionElement setter, op.IncDecOperator operator, _) {
+    return handleSuperPrefixPostfix(node, field, setter);
+  }
+
+  @override
+  T visitSuperGetterFieldPostfix(ast.SendSet node, FunctionElement getter,
+      FieldElement field, op.IncDecOperator operator, _) {
+    return handleSuperPrefixPostfix(node, getter, field);
+  }
+
+  @override
+  T visitSuperGetterFieldPrefix(ast.SendSet node, FunctionElement getter,
+      FieldElement field, op.IncDecOperator operator, _) {
+    return handleSuperPrefixPostfix(node, getter, field);
+  }
+
+  @override
+  T visitSuperGetterSetterPostfix(ast.SendSet node, FunctionElement getter,
+      FunctionElement setter, op.IncDecOperator operator, _) {
+    return handleSuperPrefixPostfix(node, getter, setter);
+  }
+
+  @override
+  T visitSuperGetterSetterPrefix(ast.SendSet node, FunctionElement getter,
+      FunctionElement setter, op.IncDecOperator operator, _) {
+    return handleSuperPrefixPostfix(node, getter, setter);
+  }
+
+  @override
+  T visitSuperMethodSetterPostfix(ast.SendSet node, FunctionElement method,
+      FunctionElement setter, op.IncDecOperator operator, _) {
+    return handleSuperPrefixPostfix(node, method, setter);
+  }
+
+  @override
+  T visitSuperMethodSetterPrefix(ast.SendSet node, FunctionElement method,
+      FunctionElement setter, op.IncDecOperator operator, _) {
+    return handleSuperPrefixPostfix(node, method, setter);
+  }
+
+  @override
+  T visitUnresolvedSuperPrefix(
+      ast.SendSet node, Element element, op.IncDecOperator operator, _) {
+    return handleSuperPrefixPostfix(node, element, element);
+  }
+
+  @override
+  T visitUnresolvedSuperPostfix(
+      ast.SendSet node, Element element, op.IncDecOperator operator, _) {
+    return handleSuperPrefixPostfix(node, element, element);
+  }
+
+  @override
+  T visitUnresolvedSuperGetterPrefix(ast.SendSet node, Element getter,
+      SetterElement setter, op.IncDecOperator operator, _) {
+    return handleSuperPrefixPostfix(node, getter, setter);
+  }
+
+  @override
+  T visitUnresolvedSuperGetterPostfix(ast.SendSet node, Element getter,
+      SetterElement setter, op.IncDecOperator operator, _) {
+    return handleSuperPrefixPostfix(node, getter, setter);
+  }
+
+  @override
+  T visitUnresolvedSuperSetterPrefix(ast.SendSet node, GetterElement getter,
+      Element setter, op.IncDecOperator operator, _) {
+    return handleSuperPrefixPostfix(node, getter, setter);
+  }
+
+  @override
+  T visitUnresolvedSuperSetterPostfix(ast.SendSet node, GetterElement getter,
+      Element setter, op.IncDecOperator operator, _) {
+    return handleSuperPrefixPostfix(node, getter, setter);
+  }
+
+  T handleSuperPrefixPostfix(ast.SendSet node, Element getter, Element setter) {
+    return _handleSuperCompound(node, getter, setter, types.uint31Type);
+  }
+
+  T _handleSuperCompound(
+      ast.SendSet node, Element getter, Element setter, T rhsType) {
+    Selector getterSelector = elements.getGetterSelectorInComplexSendSet(node);
+    TypeMask getterMask = inTreeData.typeOfGetter(node);
+    Selector setterSelector = elements.getSelector(node);
+    TypeMask setterMask = inTreeData.typeOfSend(node);
+
+    T getterType =
+        handleSuperSend(node, getterSelector, getterMask, getter, null);
+
+    T returnType;
+    if (node.isIfNullAssignment) {
+      returnType = types.allocateDiamondPhi(getterType, rhsType);
+    } else {
+      Selector operatorSelector =
+          elements.getOperatorSelectorInComplexSendSet(node);
+      TypeMask operatorMask = inTreeData.typeOfOperator(node);
+      returnType = handleDynamicSend(node, operatorSelector, operatorMask,
+          getterType, new ArgumentsTypes<T>([rhsType], null));
+    }
+    handleSuperSend(node, setterSelector, setterMask, setter,
+        new ArgumentsTypes<T>([returnType], null));
+
+    return node.isPostfix ? getterType : returnType;
   }
 
   /// Handle index set, like `foo[0] = 42`.
   T handleIndexSet(ast.SendSet node, T receiverType, T indexType, T rhsType) {
     Selector setterSelector = elements.getSelector(node);
-    TypeMask setterMask = elements.getTypeMask(node);
+    TypeMask setterMask = inTreeData.typeOfSend(node);
     handleDynamicSend(node, setterSelector, setterMask, receiverType,
         new ArgumentsTypes<T>([indexType, rhsType], null));
     return rhsType;
@@ -1034,23 +1321,27 @@
   }
 
   /// Handle super index set, like `super[42] = true`.
-  T handleSuperIndexSet(ast.SendSet node, ast.Node index, ast.Node rhs) {
-    T receiverType = superType;
+  T handleSuperIndexSet(
+      ast.SendSet node, Element element, ast.Node index, ast.Node rhs) {
     T indexType = visit(index);
     T rhsType = visit(rhs);
-    return handleIndexSet(node, receiverType, indexType, rhsType);
+    Selector setterSelector = elements.getSelector(node);
+    TypeMask setterMask = inTreeData.typeOfSend(node);
+    handleStaticSend(node, setterSelector, setterMask, element,
+        new ArgumentsTypes<T>([indexType, rhsType], null));
+    return rhsType;
   }
 
   @override
   T visitSuperIndexSet(ast.SendSet node, FunctionElement function,
       ast.Node index, ast.Node rhs, _) {
-    return handleSuperIndexSet(node, index, rhs);
+    return handleSuperIndexSet(node, function, index, rhs);
   }
 
   @override
   T visitUnresolvedSuperIndexSet(
       ast.SendSet node, Element element, ast.Node index, ast.Node rhs, _) {
-    return handleSuperIndexSet(node, index, rhs);
+    return handleSuperIndexSet(node, element, index, rhs);
   }
 
   T handlePlainAssignment(
@@ -1111,13 +1402,25 @@
     ArgumentsTypes arguments =
         node.isPropertyAccess ? null : analyzeArguments(node.arguments);
     Selector selector = elements.getSelector(node);
-    TypeMask mask = elements.getTypeMask(node);
+    TypeMask mask = inTreeData.typeOfSend(node);
     // TODO(herhut): We could do better here if we knew what we
     // are calling does not expose this.
+    // TODO(johnniwinther): Do we still need this when calling directly?
     isThisExposed = true;
+    return handleSuperNoSuchMethod(node, selector, mask, arguments);
+  }
+
+  T handleSuperNoSuchMethod(ast.Send node, Selector selector, TypeMask mask,
+      ArgumentsTypes arguments) {
     // Ensure we create a node, to make explicit the call to the
     // `noSuchMethod` handler.
-    return handleDynamicSend(node, selector, mask, superType, arguments);
+    ClassElement cls = outermostElement.enclosingClass.declaration;
+    MethodElement element = cls.lookupSuperMember(Identifiers.noSuchMethod_);
+    if (!Selectors.noSuchMethod_.signatureApplies(element)) {
+      element = compiler.coreClasses.objectClass
+          .lookupMember(Identifiers.noSuchMethod_);
+    }
+    return handleStaticSend(node, selector, mask, element, arguments);
   }
 
   /// Handle a .call invocation on the values retrieved from the super
@@ -1126,7 +1429,7 @@
       ast.Send node, Element element, ast.NodeList arguments) {
     ArgumentsTypes argumentTypes = analyzeArguments(arguments.nodes);
     Selector selector = elements.getSelector(node);
-    TypeMask mask = elements.getTypeMask(node);
+    TypeMask mask = inTreeData.typeOfSend(node);
     // TODO(herhut): We could do better here if we knew what we
     // are calling does not expose this.
     isThisExposed = true;
@@ -1148,7 +1451,7 @@
     // are calling does not expose this.
     isThisExposed = true;
     Selector selector = elements.getSelector(node);
-    TypeMask mask = elements.getTypeMask(node);
+    TypeMask mask = inTreeData.typeOfSend(node);
     return handleStaticSend(node, selector, mask, method, arguments);
   }
 
@@ -1158,10 +1461,33 @@
     // are calling does not expose this.
     isThisExposed = true;
     Selector selector = elements.getSelector(node);
-    TypeMask mask = elements.getTypeMask(node);
+    TypeMask mask = inTreeData.typeOfSend(node);
     return handleStaticSend(node, selector, mask, element, null);
   }
 
+  /// Handle update to a super field or setter [element].
+  T handleSuperSet(ast.Send node, Element element, ast.Node rhs) {
+    T rhsType = visit(rhs);
+    // TODO(herhut): We could do better here if we knew what we
+    // are calling does not expose this.
+    isThisExposed = true;
+    Selector selector = elements.getSelector(node);
+    TypeMask mask = inTreeData.typeOfSend(node);
+    handleStaticSend(
+        node, selector, mask, element, new ArgumentsTypes<T>([rhsType], null));
+    return rhsType;
+  }
+
+  @override
+  T visitSuperFieldSet(ast.Send node, FieldElement method, ast.Node rhs, _) {
+    return handleSuperSet(node, method, rhs);
+  }
+
+  @override
+  T visitSuperSetterSet(ast.Send node, SetterElement field, ast.Node rhs, _) {
+    return handleSuperSet(node, field, rhs);
+  }
+
   @override
   T visitUnresolvedSuperIndex(
       ast.Send node, Element element, ast.Node index, _) {
@@ -1196,6 +1522,17 @@
   }
 
   @override
+  T visitSuperMethodSet(ast.Send node, MethodElement method, ast.Node rhs, _) {
+    return handleErroneousSuperSend(node);
+  }
+
+  @override
+  T visitFinalSuperFieldSet(
+      ast.Send node, FieldElement method, ast.Node rhs, _) {
+    return handleErroneousSuperSend(node);
+  }
+
+  @override
   T visitUnresolvedSuperSet(ast.Send node, Element element, ast.Node rhs, _) {
     return handleErroneousSuperSend(node);
   }
@@ -1348,13 +1685,13 @@
       return handleForeignSend(node, target);
     }
     Selector selector = elements.getSelector(node);
-    TypeMask mask = elements.getTypeMask(node);
+    CallStructure callStructure = selector.callStructure;
+    TypeMask mask = inTreeData.typeOfSend(node);
     // In erroneous code the number of arguments in the selector might not
     // match the function element.
     // TODO(polux): return nonNullEmpty and check it doesn't break anything
-    if (!selector.applies(target) ||
-        (mask != null &&
-            !mask.canHit(target, selector, compiler.closedWorld))) {
+    if (target.isMalformed ||
+        !callStructure.signatureApplies(target.functionSignature)) {
       return types.dynamicType;
     }
 
@@ -1407,7 +1744,7 @@
   T handleStaticFieldOrGetterInvoke(ast.Send node, Element element) {
     ArgumentsTypes arguments = analyzeArguments(node.arguments);
     Selector selector = elements.getSelector(node);
-    TypeMask mask = elements.getTypeMask(node);
+    TypeMask mask = inTreeData.typeOfSend(node);
     handleStaticSend(node, selector, mask, element, arguments);
     return inferrer.registerCalledClosure(
         node,
@@ -1427,7 +1764,7 @@
     }
     ArgumentsTypes arguments = analyzeArguments(node.arguments);
     Selector selector = elements.getSelector(node);
-    TypeMask mask = elements.getTypeMask(node);
+    TypeMask mask = inTreeData.typeOfSend(node);
     return handleStaticSend(node, selector, mask, function, arguments);
   }
 
@@ -1511,10 +1848,12 @@
   T handleForeignSend(ast.Send node, Element element) {
     ArgumentsTypes arguments = analyzeArguments(node.arguments);
     Selector selector = elements.getSelector(node);
-    TypeMask mask = elements.getTypeMask(node);
+    TypeMask mask = inTreeData.typeOfSend(node);
     String name = element.name;
     handleStaticSend(node, selector, mask, element, arguments);
-    if (name == 'JS' || name == 'JS_EMBEDDED_GLOBAL' || name == 'JS_BUILTIN') {
+    if (name == BackendHelpers.JS ||
+        name == BackendHelpers.JS_EMBEDDED_GLOBAL ||
+        name == BackendHelpers.JS_BUILTIN) {
       native.NativeBehavior nativeBehavior = elements.getNativeData(node);
       sideEffects.add(nativeBehavior.sideEffects);
       return inferrer.typeOfNativeBehavior(nativeBehavior);
@@ -1554,21 +1893,21 @@
   /// Read a static or top level field.
   T handleStaticFieldGet(ast.Send node, FieldElement field) {
     Selector selector = elements.getSelector(node);
-    TypeMask mask = elements.getTypeMask(node);
+    TypeMask mask = inTreeData.typeOfSend(node);
     return handleStaticSend(node, selector, mask, field, null);
   }
 
   /// Invoke a static or top level getter.
   T handleStaticGetterGet(ast.Send node, MethodElement getter) {
     Selector selector = elements.getSelector(node);
-    TypeMask mask = elements.getTypeMask(node);
+    TypeMask mask = inTreeData.typeOfSend(node);
     return handleStaticSend(node, selector, mask, getter, null);
   }
 
   /// Closurize a static or top level function.
   T handleStaticFunctionGet(ast.Send node, MethodElement function) {
     Selector selector = elements.getSelector(node);
-    TypeMask mask = elements.getTypeMask(node);
+    TypeMask mask = inTreeData.typeOfSend(node);
     return handleStaticSend(node, selector, mask, function, null);
   }
 
@@ -1652,7 +1991,7 @@
   T handleCallInvoke(ast.Send node, T closure) {
     ArgumentsTypes arguments = analyzeArguments(node.arguments);
     Selector selector = elements.getSelector(node);
-    TypeMask mask = elements.getTypeMask(node);
+    TypeMask mask = inTreeData.typeOfSend(node);
     return inferrer.registerCalledClosure(node, selector, mask, closure,
         outermostElement, arguments, sideEffects, inLoop);
   }
@@ -1686,7 +2025,7 @@
       ast.NodeList arguments, CallStructure callStructure, _) {
     ArgumentsTypes argumentTypes = analyzeArguments(node.arguments);
     Selector selector = elements.getSelector(node);
-    TypeMask mask = elements.getTypeMask(node);
+    TypeMask mask = inTreeData.typeOfSend(node);
     // This only works for function statements. We need a
     // more sophisticated type system with function types to support
     // more.
@@ -1772,7 +2111,7 @@
     }
 
     Selector selector = elements.getSelector(node);
-    TypeMask mask = elements.getTypeMask(node);
+    TypeMask mask = inTreeData.typeOfSend(node);
     if (!isThisExposed && isCallOnThis) {
       checkIfExposesThis(selector, types.newTypedSelector(receiverType, mask));
     }
@@ -1867,7 +2206,7 @@
     ast.Node identifier = node.declaredIdentifier;
     Element element = elements.getForInVariable(node);
     Selector selector = elements.getSelector(identifier);
-    TypeMask mask = elements.getTypeMask(identifier);
+    TypeMask mask = inTreeData.typeOfSend(identifier);
 
     T receiverType;
     if (element != null && element.isInstanceMember) {
@@ -1887,9 +2226,9 @@
     T expressionType = visit(node.expression);
 
     Selector currentSelector = Selectors.current;
-    TypeMask currentMask = elements.getCurrentTypeMask(node);
+    TypeMask currentMask = inTreeData.typeOfIteratorCurrent(node);
     Selector moveNextSelector = Selectors.moveNext;
-    TypeMask moveNextMask = elements.getMoveNextTypeMask(node);
+    TypeMask moveNextMask = inTreeData.typeOfIteratorMoveNext(node);
 
     js.JavaScriptBackend backend = compiler.backend;
     Element ctor = backend.helpers.streamIteratorConstructor;
@@ -1905,11 +2244,11 @@
   T visitSyncForIn(ast.SyncForIn node) {
     T expressionType = visit(node.expression);
     Selector iteratorSelector = Selectors.iterator;
-    TypeMask iteratorMask = elements.getIteratorTypeMask(node);
+    TypeMask iteratorMask = inTreeData.typeOfIterator(node);
     Selector currentSelector = Selectors.current;
-    TypeMask currentMask = elements.getCurrentTypeMask(node);
+    TypeMask currentMask = inTreeData.typeOfIteratorCurrent(node);
     Selector moveNextSelector = Selectors.moveNext;
-    TypeMask moveNextMask = elements.getMoveNextTypeMask(node);
+    TypeMask moveNextMask = inTreeData.typeOfIteratorMoveNext(node);
 
     T iteratorType = handleDynamicSend(node, iteratorSelector, iteratorMask,
         expressionType, new ArgumentsTypes<T>.empty());
diff --git a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
index ddca262..7e3bbd6 100644
--- a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
+++ b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
@@ -12,6 +12,7 @@
 import '../constants/values.dart';
 import '../dart_types.dart' show DartType, FunctionType, TypeKind;
 import '../elements/elements.dart';
+import '../js_backend/backend.dart';
 import '../tree/dartstring.dart' show DartString;
 import '../tree/tree.dart' as ast show Node, LiteralBool, Send;
 import '../types/masks.dart'
@@ -521,13 +522,13 @@
       return mask;
     }
     if (element.isField) {
-      return _narrowType(compiler, mask, element.type);
+      return _narrowType(compiler.closedWorld, mask, element.type);
     }
     assert(
         element.isFunction || element.isGetter || element.isFactoryConstructor);
 
     FunctionType type = element.type;
-    return _narrowType(compiler, mask, type.returnType);
+    return _narrowType(compiler.closedWorld, mask, type.returnType);
   }
 
   TypeMask computeType(TypeGraphInferrerEngine inferrer) {
@@ -668,7 +669,7 @@
     // ignore type annotations to ensure that the checks are actually inserted
     // into the function body and retained until runtime.
     assert(!compiler.options.enableTypeAssertions);
-    return _narrowType(compiler, mask, element.type);
+    return _narrowType(compiler.closedWorld, mask, element.type);
   }
 
   TypeMask computeType(TypeGraphInferrerEngine inferrer) {
@@ -970,9 +971,10 @@
     inferrer.updateSelectorInTree(caller, call, selector, typeMask);
 
     Compiler compiler = inferrer.compiler;
+    JavaScriptBackend backend = compiler.backend;
     TypeMask maskToUse =
         compiler.closedWorld.extendMaskIfReachesAll(selector, typeMask);
-    bool canReachAll = compiler.enabledInvokeOn && (maskToUse != typeMask);
+    bool canReachAll = backend.hasInvokeOnSupport && (maskToUse != typeMask);
 
     // If this call could potentially reach all methods that satisfy
     // the untyped selector (through noSuchMethod's `Invocation`
@@ -1724,24 +1726,24 @@
   T visitAwaitTypeInformation(AwaitTypeInformation info);
 }
 
-TypeMask _narrowType(Compiler compiler, TypeMask type, DartType annotation,
+TypeMask _narrowType(
+    ClosedWorld closedWorld, TypeMask type, DartType annotation,
     {bool isNullable: true}) {
   if (annotation.treatAsDynamic) return type;
   if (annotation.isObject) return type;
   TypeMask otherType;
   if (annotation.isTypedef || annotation.isFunctionType) {
-    otherType = compiler.commonMasks.functionType;
+    otherType = closedWorld.commonMasks.functionType;
   } else if (annotation.isTypeVariable) {
     // TODO(ngeoffray): Narrow to bound.
     return type;
   } else if (annotation.isVoid) {
-    otherType = compiler.commonMasks.nullType;
+    otherType = closedWorld.commonMasks.nullType;
   } else {
     assert(annotation.isInterfaceType);
-    otherType =
-        new TypeMask.nonNullSubtype(annotation.element, compiler.closedWorld);
+    otherType = new TypeMask.nonNullSubtype(annotation.element, closedWorld);
   }
   if (isNullable) otherType = otherType.nullable();
   if (type == null) return otherType;
-  return type.intersection(otherType, compiler.closedWorld);
+  return type.intersection(otherType, closedWorld);
 }
diff --git a/pkg/compiler/lib/src/io/position_information.dart b/pkg/compiler/lib/src/io/position_information.dart
index b4a764f..cfb6657 100644
--- a/pkg/compiler/lib/src/io/position_information.dart
+++ b/pkg/compiler/lib/src/io/position_information.dart
@@ -522,7 +522,7 @@
   void onStep(js.Node node, Offset offset, StepKind kind) {
     SourceInformation sourceInformation = computeSourceInformation(node);
     if (sourceInformation == null) return;
-    int codeLocation = offset.subexpressionOffset;
+    int codeLocation = offset.value;
     if (codeLocation == null) return;
 
     void registerPosition(SourcePositionKind sourcePositionKind) {
@@ -676,6 +676,8 @@
   Offset(
       this.statementOffset, this.leftToRightOffset, this.subexpressionOffset);
 
+  int get value => subexpressionOffset;
+
   String toString() {
     return 'Offset[statementOffset=$statementOffset,'
         'leftToRightOffset=$leftToRightOffset,'
diff --git a/pkg/compiler/lib/src/js/rewrite_async.dart b/pkg/compiler/lib/src/js/rewrite_async.dart
index 5d37861..bc05656 100644
--- a/pkg/compiler/lib/src/js/rewrite_async.dart
+++ b/pkg/compiler/lib/src/js/rewrite_async.dart
@@ -5,13 +5,14 @@
 library rewrite_async;
 
 import 'dart:collection';
-import "dart:math" show max;
+import 'dart:math' show max;
 
 import 'package:js_runtime/shared/async_await_error_codes.dart' as error_codes;
 
 import '../common.dart';
+import '../io/source_information.dart' show SourceInformation;
 import '../util/util.dart' show Pair;
-import "js.dart" as js;
+import 'js.dart' as js;
 
 /// Rewrites a [js.Fun] with async/sync*/async* functions and await and yield
 /// (with dart-like semantics) to an equivalent function without these.
@@ -519,7 +520,8 @@
   js.Fun finishFunction(
       List<js.Parameter> parameters,
       js.Statement rewrittenBody,
-      js.VariableDeclarationList variableDeclarations);
+      js.VariableDeclarationList variableDeclarations,
+      SourceInformation sourceInformation);
 
   Iterable<js.VariableInitialization> variableInitializations();
 
@@ -705,7 +707,8 @@
     js.VariableDeclarationList variableDeclarations =
         new js.VariableDeclarationList(variables);
 
-    return finishFunction(node.params, rewrittenBody, variableDeclarations);
+    return finishFunction(node.params, rewrittenBody, variableDeclarations,
+        node.sourceInformation);
   }
 
   @override
@@ -851,7 +854,8 @@
     bool storeTarget = node.arguments.any(shouldTransform);
     return withCallTargetExpression(node.target, (target) {
       return withExpressions(node.arguments, (List<js.Expression> arguments) {
-        return new js.Call(target, arguments);
+        return new js.Call(target, arguments)
+            .withSourceInformation(node.sourceInformation);
       });
     }, store: storeTarget);
   }
@@ -1405,7 +1409,8 @@
   @override
   void visitThrow(js.Throw node) {
     withExpression(node.expression, (js.Expression expression) {
-      addStatement(new js.Throw(expression));
+      addStatement(new js.Throw(expression)
+          .withSourceInformation(node.sourceInformation));
     }, store: false);
   }
 
@@ -1712,14 +1717,13 @@
       addStatement(new js.Comment("implicit return"));
     }
     addStatement(js.js.statement(
-        "return #runtimeHelper(#returnValue, #successCode, #completer);",
-        {
-          "runtimeHelper": asyncHelper,
-          "successCode": js.number(error_codes.SUCCESS),
-          "returnValue":
-              analysis.hasExplicitReturns ? returnValue : new js.LiteralNull(),
-          "completer": completer
-        }));
+        "return #runtimeHelper(#returnValue, #successCode, #completer);", {
+      "runtimeHelper": asyncHelper,
+      "successCode": js.number(error_codes.SUCCESS),
+      "returnValue":
+          analysis.hasExplicitReturns ? returnValue : new js.LiteralNull(),
+      "completer": completer
+    }));
   }
 
   @override
@@ -1759,7 +1763,8 @@
   js.Fun finishFunction(
       List<js.Parameter> parameters,
       js.Statement rewrittenBody,
-      js.VariableDeclarationList variableDeclarations) {
+      js.VariableDeclarationList variableDeclarations,
+      SourceInformation sourceInformation) {
     return js.js(
         """
         function (#parameters) {
@@ -1787,7 +1792,7 @@
           "asyncHelper": asyncHelper,
           "completer": completer,
           "wrapBody": wrapBody,
-        });
+        }).withSourceInformation(sourceInformation);
   }
 }
 
@@ -1838,7 +1843,8 @@
   js.Fun finishFunction(
       List<js.Parameter> parameters,
       js.Statement rewrittenBody,
-      js.VariableDeclarationList variableDeclarations) {
+      js.VariableDeclarationList variableDeclarations,
+      SourceInformation sourceInformation) {
     // Each iterator invocation on the iterable should work on its own copy of
     // the parameters.
     // TODO(sigurdm): We only need to do this copying for parameters that are
@@ -1891,7 +1897,7 @@
           "handler": handler,
           "currentError": currentErrorName,
           "ERROR": js.number(error_codes.ERROR),
-        });
+        }).withSourceInformation(sourceInformation);
   }
 
   void addErrorExit() {
@@ -2030,7 +2036,8 @@
   js.Fun finishFunction(
       List<js.Parameter> parameters,
       js.Statement rewrittenBody,
-      js.VariableDeclarationList variableDeclarations) {
+      js.VariableDeclarationList variableDeclarations,
+      SourceInformation sourceInformation) {
     return js.js(
         """
         function (#parameters) {
@@ -2074,7 +2081,7 @@
           "streamOfController": streamOfController,
           "controller": controllerName,
           "wrapBody": wrapBody,
-        });
+        }).withSourceInformation(sourceInformation);
   }
 
   @override
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index 0899d1b..c4d156b 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -19,7 +19,6 @@
         NativeRegistry;
 import '../common/codegen.dart' show CodegenImpact, CodegenWorkItem;
 import '../common/names.dart' show Identifiers, Selectors, Uris;
-import '../common/registry.dart' show Registry;
 import '../common/resolution.dart' show Frontend, Resolution, ResolutionImpact;
 import '../common/tasks.dart' show CompilerTask;
 import '../compiler.dart' show Compiler;
@@ -50,7 +49,7 @@
 import '../universe/call_structure.dart' show CallStructure;
 import '../universe/feature.dart';
 import '../universe/selector.dart' show Selector;
-import '../universe/universe.dart';
+import '../universe/world_builder.dart';
 import '../universe/use.dart'
     show DynamicUse, StaticUse, StaticUseKind, TypeUse, TypeUseKind;
 import '../universe/world_impact.dart'
@@ -60,6 +59,7 @@
         TransformedWorldImpact,
         WorldImpact,
         WorldImpactBuilder,
+        WorldImpactBuilderImpl,
         WorldImpactVisitor,
         StagedWorldImpactBuilder;
 import '../util/util.dart';
@@ -72,8 +72,9 @@
 import 'custom_elements_analysis.dart';
 import 'enqueuer.dart';
 import 'js_interop_analysis.dart' show JsInteropAnalysis;
-import 'kernel_task.dart';
+import '../kernel/task.dart';
 import 'lookup_map_analysis.dart' show LookupMapAnalysis;
+import 'mirrors_analysis.dart';
 import 'namer.dart';
 import 'native_data.dart' show NativeData;
 import 'no_such_method_registry.dart';
@@ -334,20 +335,20 @@
   static const String TRACE_METHOD = const String.fromEnvironment('traceCalls');
   static const bool TRACE_CALLS =
       TRACE_METHOD == 'post' || TRACE_METHOD == 'console';
-  Element traceHelper;
 
-  TypeMask get stringType => compiler.commonMasks.stringType;
-  TypeMask get doubleType => compiler.commonMasks.doubleType;
-  TypeMask get intType => compiler.commonMasks.intType;
-  TypeMask get uint32Type => compiler.commonMasks.uint32Type;
-  TypeMask get uint31Type => compiler.commonMasks.uint31Type;
-  TypeMask get positiveIntType => compiler.commonMasks.positiveIntType;
-  TypeMask get numType => compiler.commonMasks.numType;
-  TypeMask get boolType => compiler.commonMasks.boolType;
-  TypeMask get dynamicType => compiler.commonMasks.dynamicType;
-  TypeMask get nullType => compiler.commonMasks.nullType;
+  TypeMask get stringType => compiler.closedWorld.commonMasks.stringType;
+  TypeMask get doubleType => compiler.closedWorld.commonMasks.doubleType;
+  TypeMask get intType => compiler.closedWorld.commonMasks.intType;
+  TypeMask get uint32Type => compiler.closedWorld.commonMasks.uint32Type;
+  TypeMask get uint31Type => compiler.closedWorld.commonMasks.uint31Type;
+  TypeMask get positiveIntType =>
+      compiler.closedWorld.commonMasks.positiveIntType;
+  TypeMask get numType => compiler.closedWorld.commonMasks.numType;
+  TypeMask get boolType => compiler.closedWorld.commonMasks.boolType;
+  TypeMask get dynamicType => compiler.closedWorld.commonMasks.dynamicType;
+  TypeMask get nullType => compiler.closedWorld.commonMasks.nullType;
   TypeMask get emptyType => const TypeMask.nonNullEmpty();
-  TypeMask get nonNullType => compiler.commonMasks.nonNullType;
+  TypeMask get nonNullType => compiler.closedWorld.commonMasks.nonNullType;
 
   TypeMask _indexablePrimitiveTypeCache;
   TypeMask get indexablePrimitiveType {
@@ -476,6 +477,7 @@
     List<CompilerTask> result = functionCompiler.tasks;
     result.add(emitter);
     result.add(patchResolverTask);
+    result.add(kernelTask);
     return result;
   }
 
@@ -517,6 +519,9 @@
   /// True when we enqueue the loadLibrary code.
   bool isLoadLibraryFunctionResolved = false;
 
+  /// `true` if access to [BackendHelpers.invokeOnMethod] is supported.
+  bool hasInvokeOnSupport = false;
+
   /// List of constants from metadata.  If metadata must be preserved,
   /// these constants must be registered.
   final List<Dependency> metadataConstants = <Dependency>[];
@@ -571,6 +576,9 @@
   /// Support for classifying `noSuchMethod` implementations.
   NoSuchMethodRegistry noSuchMethodRegistry;
 
+  /// Resolution and codegen support for computing reflectable elements.
+  MirrorsAnalysis mirrorsAnalysis;
+
   /// Builds kernel representation for the program.
   KernelTask kernelTask;
 
@@ -627,9 +635,10 @@
     customElementsAnalysis = new CustomElementsAnalysis(this);
     lookupMapAnalysis = new LookupMapAnalysis(this, reporter);
     jsInteropAnalysis = new JsInteropAnalysis(this);
+    mirrorsAnalysis = new MirrorsAnalysis(this, compiler.resolution);
 
     noSuchMethodRegistry = new NoSuchMethodRegistry(this);
-    kernelTask = new KernelTask(this);
+    kernelTask = new KernelTask(compiler);
     constantCompilerTask = new JavaScriptConstantTask(compiler);
     impactTransformer = new JavaScriptImpactTransformer(this);
     patchResolverTask = new PatchResolverTask(compiler);
@@ -853,7 +862,7 @@
           .handleMethodAnnotations(element);
       if (isNative(element)) {
         native.NativeBehavior behavior =
-            native.NativeBehavior.ofMethod(element, compiler);
+            native.NativeBehavior.ofMethodElement(element, compiler);
         nativeData.setNativeMethodBehavior(element, behavior);
         registry.registerNativeData(behavior);
       }
@@ -862,9 +871,9 @@
           .handleFieldAnnotations(element);
       if (isNative(element)) {
         native.NativeBehavior fieldLoadBehavior =
-            native.NativeBehavior.ofFieldLoad(element, compiler);
-        native.NativeBehavior fieldStoreBehavior =
-            native.NativeBehavior.ofFieldStore(element, compiler);
+            native.NativeBehavior.ofFieldElementLoad(element, compiler);
+        native.NativeBehavior fieldStoreBehavior = native.NativeBehavior
+            .ofFieldElementStore(element, compiler.resolution);
         nativeData.setNativeFieldLoadBehavior(element, fieldLoadBehavior);
         nativeData.setNativeFieldStoreBehavior(element, fieldStoreBehavior);
 
@@ -1026,9 +1035,9 @@
     });
   }
 
-  void addInterceptorsForNativeClassMembers(
-      ClassElement cls, Enqueuer enqueuer) {
-    if (enqueuer.isResolutionQueue) {
+  void addInterceptorsForNativeClassMembers(ClassElement cls,
+      {bool forResolution}) {
+    if (forResolution) {
       cls.ensureResolved(resolution);
       cls.forEachMember((ClassElement classElement, Element member) {
         if (member.name == Identifiers.call) {
@@ -1052,20 +1061,22 @@
     }
   }
 
-  void addInterceptors(ClassElement cls, Enqueuer enqueuer, Registry registry) {
-    if (enqueuer.isResolutionQueue) {
+  void addInterceptors(ClassElement cls, WorldImpactBuilder impactBuilder,
+      {bool forResolution}) {
+    if (forResolution) {
+      if (_interceptedClasses.add(cls)) {
+        cls.ensureResolved(resolution);
+        cls.forEachMember((ClassElement classElement, Element member) {
+          // All methods on [Object] are shadowed by [Interceptor].
+          if (classElement == coreClasses.objectClass) return;
+          Set<Element> set = interceptedElements.putIfAbsent(
+              member.name, () => new Set<Element>());
+          set.add(member);
+        }, includeSuperAndInjectedMembers: true);
+      }
       _interceptedClasses.add(helpers.jsInterceptorClass);
-      _interceptedClasses.add(cls);
-      cls.ensureResolved(resolution);
-      cls.forEachMember((ClassElement classElement, Element member) {
-        // All methods on [Object] are shadowed by [Interceptor].
-        if (classElement == coreClasses.objectClass) return;
-        Set<Element> set = interceptedElements.putIfAbsent(
-            member.name, () => new Set<Element>());
-        set.add(member);
-      }, includeSuperAndInjectedMembers: true);
     }
-    enqueueClass(enqueuer, cls, registry);
+    impactTransformer.registerBackendInstantiation(impactBuilder, cls);
   }
 
   Set<ClassElement> get interceptedClasses {
@@ -1158,196 +1169,168 @@
     }
   }
 
-  void registerInstantiatedClass(
-      ClassElement cls, Enqueuer enqueuer, Registry registry) {
-    _processClass(cls, enqueuer, registry);
+  WorldImpact registerInstantiatedClass(ClassElement cls,
+      {bool forResolution}) {
+    return _processClass(cls, forResolution: forResolution);
   }
 
-  void registerImplementedClass(
-      ClassElement cls, Enqueuer enqueuer, Registry registry) {
-    _processClass(cls, enqueuer, registry);
+  WorldImpact registerImplementedClass(ClassElement cls, {bool forResolution}) {
+    return _processClass(cls, forResolution: forResolution);
   }
 
-  void _processClass(ClassElement cls, Enqueuer enqueuer, Registry registry) {
+  WorldImpact _processClass(ClassElement cls, {bool forResolution}) {
+    WorldImpactBuilderImpl impactBuilder = new WorldImpactBuilderImpl();
     if (!cls.typeVariables.isEmpty) {
-      typeVariableHandler.registerClassWithTypeVariables(
-          cls, enqueuer, registry);
+      typeVariableHandler.registerClassWithTypeVariables(cls,
+          forResolution: forResolution);
     }
 
     // Register any helper that will be needed by the backend.
-    if (enqueuer.isResolutionQueue) {
+    if (forResolution) {
       if (cls == coreClasses.intClass ||
           cls == coreClasses.doubleClass ||
           cls == coreClasses.numClass) {
-        // The backend will try to optimize number operations and use the
-        // `iae` helper directly.
-        enqueue(enqueuer, helpers.throwIllegalArgumentException, registry);
+        impactTransformer.registerBackendImpact(
+            impactBuilder, impacts.numClasses);
       } else if (cls == coreClasses.listClass ||
           cls == coreClasses.stringClass) {
-        // The backend will try to optimize array and string access and use the
-        // `ioore` and `iae` helpers directly.
-        enqueue(enqueuer, helpers.throwIndexOutOfRangeException, registry);
-        enqueue(enqueuer, helpers.throwIllegalArgumentException, registry);
+        impactTransformer.registerBackendImpact(
+            impactBuilder, impacts.listOrStringClasses);
       } else if (cls == coreClasses.functionClass) {
-        enqueueClass(enqueuer, helpers.closureClass, registry);
+        impactTransformer.registerBackendImpact(
+            impactBuilder, impacts.functionClass);
       } else if (cls == coreClasses.mapClass) {
-        // The backend will use a literal list to initialize the entries
-        // of the map.
-        enqueueClass(enqueuer, coreClasses.listClass, registry);
-        enqueueClass(enqueuer, helpers.mapLiteralClass, registry);
+        impactTransformer.registerBackendImpact(
+            impactBuilder, impacts.mapClass);
         // For map literals, the dependency between the implementation class
         // and [Map] is not visible, so we have to add it manually.
         rti.registerRtiDependency(helpers.mapLiteralClass, cls);
       } else if (cls == helpers.boundClosureClass) {
-        // TODO(johnniwinther): Is this a noop?
-        enqueueClass(enqueuer, helpers.boundClosureClass, registry);
+        impactTransformer.registerBackendImpact(
+            impactBuilder, impacts.boundClosureClass);
       } else if (isNativeOrExtendsNative(cls)) {
-        enqueue(enqueuer, helpers.getNativeInterceptorMethod, registry);
-        enqueueClass(
-            enqueuer, helpers.jsInterceptorClass, compiler.globalDependencies);
-        enqueueClass(enqueuer, helpers.jsJavaScriptObjectClass, registry);
-        enqueueClass(enqueuer, helpers.jsPlainJavaScriptObjectClass, registry);
-        enqueueClass(enqueuer, helpers.jsJavaScriptFunctionClass, registry);
+        impactTransformer.registerBackendImpact(
+            impactBuilder, impacts.nativeOrExtendsClass);
       } else if (cls == helpers.mapLiteralClass) {
-        // For map literals, the dependency between the implementation class
-        // and [Map] is not visible, so we have to add it manually.
-        Element getFactory(String name, int arity) {
-          // The constructor is on the patch class, but dart2js unit tests don't
-          // have a patch class.
-          ClassElement implementation = cls.implementation;
-          ConstructorElement ctor = implementation.lookupConstructor(name);
-          if (ctor == null ||
-              (Name.isPrivateName(name) &&
-                  ctor.library != helpers.mapLiteralClass.library)) {
-            reporter.internalError(
-                helpers.mapLiteralClass,
-                "Map literal class ${helpers.mapLiteralClass} missing "
-                "'$name' constructor"
-                "  ${helpers.mapLiteralClass.constructors}");
-          }
-          return ctor;
-        }
-
-        Element getMember(String name) {
-          // The constructor is on the patch class, but dart2js unit tests don't
-          // have a patch class.
-          ClassElement implementation = cls.implementation;
-          Element element = implementation.lookupLocalMember(name);
-          if (element == null || !element.isFunction || !element.isStatic) {
-            reporter.internalError(
-                helpers.mapLiteralClass,
-                "Map literal class ${helpers.mapLiteralClass} missing "
-                "'$name' static member function");
-          }
-          return element;
-        }
-
-        helpers.mapLiteralConstructor = getFactory('_literal', 1);
-        helpers.mapLiteralConstructorEmpty = getFactory('_empty', 0);
-        enqueueInResolution(helpers.mapLiteralConstructor, registry);
-        enqueueInResolution(helpers.mapLiteralConstructorEmpty, registry);
-
-        helpers.mapLiteralUntypedMaker = getMember('_makeLiteral');
-        helpers.mapLiteralUntypedEmptyMaker = getMember('_makeEmpty');
-        enqueueInResolution(helpers.mapLiteralUntypedMaker, registry);
-        enqueueInResolution(helpers.mapLiteralUntypedEmptyMaker, registry);
+        impactTransformer.registerBackendImpact(
+            impactBuilder, impacts.mapLiteralClass);
       }
     }
     if (cls == helpers.closureClass) {
-      enqueue(enqueuer, helpers.closureFromTearOff, registry);
+      impactTransformer.registerBackendImpact(
+          impactBuilder, impacts.closureClass);
     }
     if (cls == coreClasses.stringClass || cls == helpers.jsStringClass) {
-      addInterceptors(helpers.jsStringClass, enqueuer, registry);
+      addInterceptors(helpers.jsStringClass, impactBuilder,
+          forResolution: forResolution);
     } else if (cls == coreClasses.listClass ||
         cls == helpers.jsArrayClass ||
         cls == helpers.jsFixedArrayClass ||
         cls == helpers.jsExtendableArrayClass ||
         cls == helpers.jsUnmodifiableArrayClass) {
-      addInterceptors(helpers.jsArrayClass, enqueuer, registry);
-      addInterceptors(helpers.jsMutableArrayClass, enqueuer, registry);
-      addInterceptors(helpers.jsFixedArrayClass, enqueuer, registry);
-      addInterceptors(helpers.jsExtendableArrayClass, enqueuer, registry);
-      addInterceptors(helpers.jsUnmodifiableArrayClass, enqueuer, registry);
-      // Literal lists can be translated into calls to these functions:
-      enqueueInResolution(helpers.jsArrayTypedConstructor, registry);
-      enqueueInResolution(helpers.setRuntimeTypeInfo, registry);
-      enqueueInResolution(helpers.getTypeArgumentByIndex, registry);
+      addInterceptors(helpers.jsArrayClass, impactBuilder,
+          forResolution: forResolution);
+      addInterceptors(helpers.jsMutableArrayClass, impactBuilder,
+          forResolution: forResolution);
+      addInterceptors(helpers.jsFixedArrayClass, impactBuilder,
+          forResolution: forResolution);
+      addInterceptors(helpers.jsExtendableArrayClass, impactBuilder,
+          forResolution: forResolution);
+      addInterceptors(helpers.jsUnmodifiableArrayClass, impactBuilder,
+          forResolution: forResolution);
+      if (forResolution) {
+        impactTransformer.registerBackendImpact(
+            impactBuilder, impacts.listClasses);
+      }
     } else if (cls == coreClasses.intClass || cls == helpers.jsIntClass) {
-      addInterceptors(helpers.jsIntClass, enqueuer, registry);
-      addInterceptors(helpers.jsPositiveIntClass, enqueuer, registry);
-      addInterceptors(helpers.jsUInt32Class, enqueuer, registry);
-      addInterceptors(helpers.jsUInt31Class, enqueuer, registry);
-      addInterceptors(helpers.jsNumberClass, enqueuer, registry);
+      addInterceptors(helpers.jsIntClass, impactBuilder,
+          forResolution: forResolution);
+      addInterceptors(helpers.jsPositiveIntClass, impactBuilder,
+          forResolution: forResolution);
+      addInterceptors(helpers.jsUInt32Class, impactBuilder,
+          forResolution: forResolution);
+      addInterceptors(helpers.jsUInt31Class, impactBuilder,
+          forResolution: forResolution);
+      addInterceptors(helpers.jsNumberClass, impactBuilder,
+          forResolution: forResolution);
     } else if (cls == coreClasses.doubleClass || cls == helpers.jsDoubleClass) {
-      addInterceptors(helpers.jsDoubleClass, enqueuer, registry);
-      addInterceptors(helpers.jsNumberClass, enqueuer, registry);
+      addInterceptors(helpers.jsDoubleClass, impactBuilder,
+          forResolution: forResolution);
+      addInterceptors(helpers.jsNumberClass, impactBuilder,
+          forResolution: forResolution);
     } else if (cls == coreClasses.boolClass || cls == helpers.jsBoolClass) {
-      addInterceptors(helpers.jsBoolClass, enqueuer, registry);
+      addInterceptors(helpers.jsBoolClass, impactBuilder,
+          forResolution: forResolution);
     } else if (cls == coreClasses.nullClass || cls == helpers.jsNullClass) {
-      addInterceptors(helpers.jsNullClass, enqueuer, registry);
+      addInterceptors(helpers.jsNullClass, impactBuilder,
+          forResolution: forResolution);
     } else if (cls == coreClasses.numClass || cls == helpers.jsNumberClass) {
-      addInterceptors(helpers.jsIntClass, enqueuer, registry);
-      addInterceptors(helpers.jsPositiveIntClass, enqueuer, registry);
-      addInterceptors(helpers.jsUInt32Class, enqueuer, registry);
-      addInterceptors(helpers.jsUInt31Class, enqueuer, registry);
-      addInterceptors(helpers.jsDoubleClass, enqueuer, registry);
-      addInterceptors(helpers.jsNumberClass, enqueuer, registry);
+      addInterceptors(helpers.jsIntClass, impactBuilder,
+          forResolution: forResolution);
+      addInterceptors(helpers.jsPositiveIntClass, impactBuilder,
+          forResolution: forResolution);
+      addInterceptors(helpers.jsUInt32Class, impactBuilder,
+          forResolution: forResolution);
+      addInterceptors(helpers.jsUInt31Class, impactBuilder,
+          forResolution: forResolution);
+      addInterceptors(helpers.jsDoubleClass, impactBuilder,
+          forResolution: forResolution);
+      addInterceptors(helpers.jsNumberClass, impactBuilder,
+          forResolution: forResolution);
     } else if (cls == helpers.jsJavaScriptObjectClass) {
-      addInterceptors(helpers.jsJavaScriptObjectClass, enqueuer, registry);
+      addInterceptors(helpers.jsJavaScriptObjectClass, impactBuilder,
+          forResolution: forResolution);
     } else if (cls == helpers.jsPlainJavaScriptObjectClass) {
-      addInterceptors(helpers.jsPlainJavaScriptObjectClass, enqueuer, registry);
+      addInterceptors(helpers.jsPlainJavaScriptObjectClass, impactBuilder,
+          forResolution: forResolution);
     } else if (cls == helpers.jsUnknownJavaScriptObjectClass) {
-      addInterceptors(
-          helpers.jsUnknownJavaScriptObjectClass, enqueuer, registry);
+      addInterceptors(helpers.jsUnknownJavaScriptObjectClass, impactBuilder,
+          forResolution: forResolution);
     } else if (cls == helpers.jsJavaScriptFunctionClass) {
-      addInterceptors(helpers.jsJavaScriptFunctionClass, enqueuer, registry);
+      addInterceptors(helpers.jsJavaScriptFunctionClass, impactBuilder,
+          forResolution: forResolution);
     } else if (isNativeOrExtendsNative(cls)) {
-      addInterceptorsForNativeClassMembers(cls, enqueuer);
+      addInterceptorsForNativeClassMembers(cls, forResolution: forResolution);
     } else if (cls == helpers.jsIndexingBehaviorInterface) {
-      // These two helpers are used by the emitter and the codegen.
-      // Because we cannot enqueue elements at the time of emission,
-      // we make sure they are always generated.
-      enqueue(enqueuer, helpers.isJsIndexable, registry);
+      impactTransformer.registerBackendImpact(
+          impactBuilder, impacts.jsIndexingBehavior);
     }
 
-    customElementsAnalysis.registerInstantiatedClass(cls, enqueuer);
-    if (!enqueuer.isResolutionQueue) {
+    customElementsAnalysis.registerInstantiatedClass(cls,
+        forResolution: forResolution);
+    if (!forResolution) {
       lookupMapAnalysis.registerInstantiatedClass(cls);
     }
+
+    return impactBuilder;
   }
 
-  void registerInstantiatedType(
-      InterfaceType type, Enqueuer enqueuer, Registry registry,
-      {bool mirrorUsage: false}) {
+  void registerInstantiatedType(InterfaceType type) {
     lookupMapAnalysis.registerInstantiatedType(type);
-    super.registerInstantiatedType(type, enqueuer, registry,
-        mirrorUsage: mirrorUsage);
   }
 
-  void enqueueHelpers(ResolutionEnqueuer world, Registry registry) {
+  @override
+  WorldImpact computeHelpersImpact() {
     assert(helpers.interceptorsLibrary != null);
+    WorldImpactBuilderImpl impactBuilder = new WorldImpactBuilderImpl();
     // TODO(ngeoffray): Not enqueuing those two classes currently make
     // the compiler potentially crash. However, any reasonable program
     // will instantiate those two classes.
-    addInterceptors(helpers.jsBoolClass, world, registry);
-    addInterceptors(helpers.jsNullClass, world, registry);
+    addInterceptors(helpers.jsBoolClass, impactBuilder, forResolution: true);
+    addInterceptors(helpers.jsNullClass, impactBuilder, forResolution: true);
     if (compiler.options.enableTypeAssertions) {
-      // Unconditionally register the helper that checks if the
-      // expression in an if/while/for is a boolean.
-      // TODO(ngeoffray): Should we have the resolver register those instead?
-      Element e = helpers.boolConversionCheck;
-      if (e != null) enqueue(world, e, registry);
+      impactTransformer.registerBackendImpact(
+          impactBuilder, impacts.enableTypeAssertions);
     }
 
     if (TRACE_CALLS) {
-      traceHelper = TRACE_METHOD == 'console'
-          ? helpers.consoleTraceHelper
-          : helpers.postTraceHelper;
-      assert(traceHelper != null);
-      enqueueInResolution(traceHelper, registry);
+      impactTransformer.registerBackendImpact(
+          impactBuilder, impacts.traceHelper);
     }
-    enqueueInResolution(helpers.assertUnreachableMethod, registry);
-    registerCheckedModeHelpers(registry);
+    impactTransformer.registerBackendImpact(
+        impactBuilder, impacts.assertUnreachable);
+    _registerCheckedModeHelpers(impactBuilder);
+    return impactBuilder;
   }
 
   onResolutionComplete() {
@@ -1362,53 +1345,36 @@
     noSuchMethodRegistry.onTypeInferenceComplete();
   }
 
-  void registerGetRuntimeTypeArgument(Registry registry) {
-    enqueueImpact(
-        compiler.enqueuer.resolution, impacts.getRuntimeTypeArgument, registry);
-  }
-
-  void registerCallMethodWithFreeTypeVariables(
-      Element callMethod, Enqueuer enqueuer, Registry registry) {
-    if (enqueuer.isResolutionQueue || methodNeedsRti(callMethod)) {
-      registerComputeSignature(enqueuer, registry);
+  WorldImpact registerCallMethodWithFreeTypeVariables(Element callMethod,
+      {bool forResolution}) {
+    if (forResolution || methodNeedsRti(callMethod)) {
+      return _registerComputeSignature();
     }
+    return const WorldImpact();
   }
 
-  void registerClosureWithFreeTypeVariables(
-      Element closure, Enqueuer enqueuer, Registry registry) {
-    if (enqueuer.isResolutionQueue || methodNeedsRti(closure)) {
-      registerComputeSignature(enqueuer, registry);
+  WorldImpact registerClosureWithFreeTypeVariables(Element closure,
+      {bool forResolution}) {
+    if (forResolution || methodNeedsRti(closure)) {
+      return _registerComputeSignature();
     }
+    return const WorldImpact();
   }
 
-  void registerBoundClosure(Enqueuer enqueuer) {
-    helpers.boundClosureClass.ensureResolved(resolution);
-    registerInstantiatedType(
-        helpers.boundClosureClass.rawType,
-        enqueuer,
-        // Precise dependency is not important here.
-        compiler.globalDependencies);
+  WorldImpact registerBoundClosure() {
+    return impactTransformer.createImpactFor(impacts.memberClosure);
   }
 
-  void registerGetOfStaticFunction(Enqueuer enqueuer) {
-    helpers.closureClass.ensureResolved(resolution);
-    registerInstantiatedType(
-        helpers.closureClass.rawType, enqueuer, compiler.globalDependencies);
+  WorldImpact registerGetOfStaticFunction() {
+    return impactTransformer.createImpactFor(impacts.staticClosure);
   }
 
-  void registerComputeSignature(Enqueuer enqueuer, Registry registry) {
-    // Calls to [:computeSignature:] are generated by the emitter and we
-    // therefore need to enqueue the used elements in the codegen enqueuer as
-    // well as in the resolution enqueuer.
-    enqueueImpact(enqueuer, impacts.computeSignature, registry);
+  WorldImpact _registerComputeSignature() {
+    return impactTransformer.createImpactFor(impacts.computeSignature);
   }
 
-  void registerRuntimeType(Enqueuer enqueuer, Registry registry) {
-    registerComputeSignature(enqueuer, registry);
-    enqueueInResolution(helpers.setRuntimeTypeInfo, registry);
-    registerGetRuntimeTypeArgument(registry);
-    enqueueInResolution(helpers.getRuntimeTypeInfo, registry);
-    enqueueClass(enqueuer, coreClasses.listClass, registry);
+  WorldImpact registerRuntimeType() {
+    return impactTransformer.createImpactFor(impacts.runtimeTypeSupport);
   }
 
   void registerTypeVariableBoundsSubtypeCheck(
@@ -1416,11 +1382,8 @@
     rti.registerTypeVariableBoundsSubtypeCheck(typeArgument, bound);
   }
 
-  void registerCheckDeferredIsLoaded(Registry registry) {
-    enqueueInResolution(helpers.checkDeferredIsLoaded, registry);
-    // Also register the types of the arguments passed to this method.
-    enqueueClass(
-        compiler.enqueuer.resolution, coreClasses.stringClass, registry);
+  WorldImpact computeDeferredLoadingImpact() {
+    return impactTransformer.createImpactFor(impacts.deferredLoading);
   }
 
   void registerNoSuchMethod(FunctionElement noSuchMethod) {
@@ -1432,13 +1395,13 @@
       CallStructure callStructure, ForeignResolver resolver) {
     native.NativeResolutionEnqueuer nativeEnqueuer =
         compiler.enqueuer.resolution.nativeEnqueuer;
-    if (element.name == 'JS') {
+    if (element.name == BackendHelpers.JS) {
       return nativeEnqueuer.resolveJsCall(node, resolver);
-    } else if (element.name == 'JS_EMBEDDED_GLOBAL') {
+    } else if (element.name == BackendHelpers.JS_EMBEDDED_GLOBAL) {
       return nativeEnqueuer.resolveJsEmbeddedGlobalCall(node, resolver);
-    } else if (element.name == 'JS_BUILTIN') {
+    } else if (element.name == BackendHelpers.JS_BUILTIN) {
       return nativeEnqueuer.resolveJsBuiltinCall(node, resolver);
-    } else if (element.name == 'JS_INTERCEPTOR_CONSTANT') {
+    } else if (element.name == BackendHelpers.JS_INTERCEPTOR_CONSTANT) {
       // The type constant that is an argument to JS_INTERCEPTOR_CONSTANT names
       // a class that will be instantiated outside the program by attaching a
       // native class dispatch record referencing the interceptor.
@@ -1461,12 +1424,12 @@
     return null;
   }
 
-  void enableNoSuchMethod(Enqueuer world) {
-    enqueue(world, helpers.createInvocationMirror, compiler.globalDependencies);
-    world.registerDynamicUse(new DynamicUse(Selectors.noSuchMethod_, null));
+  WorldImpact enableNoSuchMethod() {
+    return impactTransformer.createImpactFor(impacts.noSuchMethodSupport);
   }
 
-  void enableIsolateSupport(Enqueuer enqueuer) {
+  WorldImpact enableIsolateSupport({bool forResolution}) {
+    WorldImpactBuilderImpl impactBuilder = new WorldImpactBuilderImpl();
     // TODO(floitsch): We should also ensure that the class IsolateMessage is
     // instantiated. Currently, just enabling isolate support works.
     if (compiler.mainFunction != null) {
@@ -1477,32 +1440,26 @@
       // The JavaScript backend of [Isolate.spawnUri] uses the same internal
       // implementation as [Isolate.spawn], and fails if it cannot look main up
       // by name.
-      enqueuer.registerStaticUse(
+      impactBuilder.registerStaticUse(
           new StaticUse.staticTearOff(compiler.mainFunction));
     }
-    if (enqueuer.isResolutionQueue) {
-      void enqueue(Element element) {
-        enqueuer.addToWorkList(element);
-        compiler.globalDependencies.registerDependency(element);
-        helpersUsed.add(element.declaration);
-      }
-
-      enqueue(helpers.startRootIsolate);
-      enqueue(helpers.currentIsolate);
-      enqueue(helpers.callInIsolate);
-    } else {
-      enqueuer.addToWorkList(helpers.startRootIsolate);
+    impactTransformer.registerBackendImpact(
+        impactBuilder, impacts.isolateSupport);
+    if (forResolution) {
+      impactTransformer.registerBackendImpact(
+          impactBuilder, impacts.isolateSupportForResolution);
     }
+    return impactBuilder;
   }
 
   bool classNeedsRti(ClassElement cls) {
-    if (compiler.enabledRuntimeType) return true;
+    if (compiler.resolverWorld.hasRuntimeTypeSupport) return true;
     return rti.classesNeedingRti.contains(cls.declaration);
   }
 
   bool classNeedsRtiField(ClassElement cls) {
     if (cls.rawType.typeArguments.isEmpty) return false;
-    if (compiler.enabledRuntimeType) return true;
+    if (compiler.resolverWorld.hasRuntimeTypeSupport) return true;
     return rti.classesNeedingRti.contains(cls.declaration);
   }
 
@@ -1519,77 +1476,14 @@
 
   bool methodNeedsRti(FunctionElement function) {
     return rti.methodsNeedingRti.contains(function) ||
-        compiler.enabledRuntimeType;
-  }
-
-  /// Enqueue [e] in [enqueuer].
-  ///
-  /// This method calls [registerBackendUse].
-  void enqueue(Enqueuer enqueuer, Element e, Registry registry) {
-    if (e == null) return;
-    registerBackendUse(e);
-    enqueuer.addToWorkList(e);
-    registry.registerDependency(e);
-  }
-
-  /// Enqueue [e] in the resolution enqueuer.
-  ///
-  /// This method calls [registerBackendUse].
-  void enqueueInResolution(Element e, Registry registry) {
-    if (e == null) return;
-    ResolutionEnqueuer enqueuer = compiler.enqueuer.resolution;
-    enqueue(enqueuer, e, registry);
-  }
-
-  /// Register instantiation of [cls] in [enqueuer].
-  ///
-  /// This method calls [registerBackendUse].
-  void enqueueClass(Enqueuer enqueuer, ClassElement cls, Registry registry) {
-    if (cls == null) return;
-    registerBackendUse(cls);
-    helpersUsed.add(cls.declaration);
-    if (cls.declaration != cls.implementation) {
-      helpersUsed.add(cls.implementation);
-    }
-    cls.ensureResolved(resolution);
-    registerInstantiatedType(cls.rawType, enqueuer, registry);
-  }
-
-  /// Register instantiation of [type] in [enqueuer].
-  ///
-  /// This method calls [registerBackendUse].
-  void enqueueType(Enqueuer enqueuer, InterfaceType type, Registry registry) {
-    if (type == null) return;
-    ClassElement cls = type.element;
-    registerBackendUse(cls);
-    helpersUsed.add(cls.declaration);
-    if (cls.declaration != cls.implementation) {
-      helpersUsed.add(cls.implementation);
-    }
-    cls.ensureResolved(resolution);
-    registerInstantiatedType(type, enqueuer, registry);
-  }
-
-  void enqueueImpact(
-      Enqueuer enqueuer, BackendImpact impact, Registry registry) {
-    for (Element staticUse in impact.staticUses) {
-      enqueue(enqueuer, staticUse, registry);
-    }
-    for (InterfaceType type in impact.instantiatedTypes) {
-      enqueueType(enqueuer, type, registry);
-    }
-    for (ClassElement cls in impact.instantiatedClasses) {
-      enqueueClass(enqueuer, cls, registry);
-    }
-    for (BackendImpact otherImpact in impact.otherImpacts) {
-      enqueueImpact(enqueuer, otherImpact, registry);
-    }
+        compiler.resolverWorld.hasRuntimeTypeSupport;
   }
 
   CodegenEnqueuer get codegenEnqueuer => compiler.enqueuer.codegen;
 
-  CodegenEnqueuer createCodegenEnqueuer(Compiler compiler) {
-    return new CodegenEnqueuer(compiler, const TreeShakingEnqueuerStrategy());
+  CodegenEnqueuer createCodegenEnqueuer(CompilerTask task, Compiler compiler) {
+    return new CodegenEnqueuer(
+        task, compiler, const TreeShakingEnqueuerStrategy());
   }
 
   WorldImpact codegen(CodegenWorkItem work) {
@@ -1646,7 +1540,7 @@
         // go through the builder (below) to generate the lazy initializer for
         // the static variable.
         // We also need to register the use of the cyclic-error helper.
-        compiler.enqueuer.codegen.registerStaticUse(new StaticUse.staticInvoke(
+        work.registry.worldImpact.registerStaticUse(new StaticUse.staticInvoke(
             helpers.cyclicThrowHelper, CallStructure.ONE_ARG));
       }
     }
@@ -1663,12 +1557,12 @@
     return worldImpact;
   }
 
-  native.NativeEnqueuer nativeResolutionEnqueuer(Enqueuer world) {
-    return new native.NativeResolutionEnqueuer(world, compiler);
+  native.NativeEnqueuer nativeResolutionEnqueuer() {
+    return new native.NativeResolutionEnqueuer(compiler);
   }
 
-  native.NativeEnqueuer nativeCodegenEnqueuer(Enqueuer world) {
-    return new native.NativeCodegenEnqueuer(world, compiler, emitter);
+  native.NativeEnqueuer nativeCodegenEnqueuer() {
+    return new native.NativeCodegenEnqueuer(compiler, emitter);
   }
 
   ClassElement defaultSuperclass(ClassElement element) {
@@ -1868,12 +1762,15 @@
     }
   }
 
-  void registerCheckedModeHelpers(Registry registry) {
+  void _registerCheckedModeHelpers(WorldImpactBuilder impactBuilder) {
     // We register all the helpers in the resolution queue.
     // TODO(13155): Find a way to register fewer helpers.
+    List<Element> staticUses = <Element>[];
     for (CheckedModeHelper helper in checkedModeHelpers) {
-      enqueueInResolution(helper.getStaticUse(compiler).element, registry);
+      staticUses.add(helper.getStaticUse(compiler).element);
     }
+    impactTransformer.registerBackendImpact(
+        impactBuilder, new BackendImpact(globalUses: staticUses));
   }
 
   /**
@@ -1904,7 +1801,8 @@
     return compiler.closedWorld.hasOnlySubclasses(classElement);
   }
 
-  void registerStaticUse(Element element, Enqueuer enqueuer) {
+  WorldImpact registerStaticUse(Element element, {bool forResolution}) {
+    WorldImpactBuilderImpl worldImpact = new WorldImpactBuilderImpl();
     if (element == helpers.disableTreeShakingMarker) {
       isTreeShakingDisabled = true;
     } else if (element == helpers.preserveNamesMarker) {
@@ -1921,13 +1819,17 @@
       // TODO(sigurdm): Create a function registerLoadLibraryAccess.
       if (!isLoadLibraryFunctionResolved) {
         isLoadLibraryFunctionResolved = true;
-        enqueueInResolution(
-            helpers.loadLibraryWrapper, compiler.globalDependencies);
+        if (forResolution) {
+          impactTransformer.registerBackendImpact(
+              worldImpact, impacts.loadLibrary);
+        }
       }
     } else if (element == helpers.requiresPreambleMarker) {
       requiresPreamble = true;
     }
-    customElementsAnalysis.registerStaticUse(element, enqueuer);
+    customElementsAnalysis.registerStaticUse(element,
+        forResolution: forResolution);
+    return worldImpact;
   }
 
   /// Called when [:const Symbol(name):] is seen.
@@ -1938,9 +1840,6 @@
     }
   }
 
-  /// Called when [:new Symbol(...):] is seen.
-  void registerNewSymbol(Registry registry) {}
-
   /// Should [element] (a getter) that would normally not be generated due to
   /// treeshaking be retained for reflection?
   bool shouldRetainGetter(Element element) {
@@ -2164,9 +2063,15 @@
         });
         // 3) all members, including fields via getter/setters (if resolved)
         cls.forEachClassMember((Member member) {
-          if (resolution.hasBeenProcessed(member.element)) {
+          MemberElement element = member.element;
+          if (resolution.hasBeenProcessed(element)) {
             memberNames.add(member.name);
-            reflectableMembers.add(member.element);
+            reflectableMembers.add(element);
+            element.nestedClosures
+                .forEach((SynthesizedCallMethodElementX callFunction) {
+              reflectableMembers.add(callFunction);
+              reflectableMembers.add(callFunction.closureClass);
+            });
           }
         });
         // 4) all overriding members of subclasses/subtypes (should be resolved)
@@ -2351,9 +2256,12 @@
     //
     // Return early if any elements are added to avoid counting the elements as
     // due to mirrors.
-    customElementsAnalysis.onQueueEmpty(enqueuer);
-    lookupMapAnalysis.onQueueEmpty(enqueuer);
-    typeVariableHandler.onQueueEmpty(enqueuer);
+    enqueuer.applyImpact(customElementsAnalysis.flush(
+        forResolution: enqueuer.isResolutionQueue));
+    enqueuer.applyImpact(
+        lookupMapAnalysis.flush(forResolution: enqueuer.isResolutionQueue));
+    enqueuer.applyImpact(
+        typeVariableHandler.flush(forResolution: enqueuer.isResolutionQueue));
 
     if (!enqueuer.queueIsEmpty) return false;
 
@@ -2361,20 +2269,20 @@
     if (!enabledNoSuchMethod &&
         (noSuchMethodRegistry.hasThrowingNoSuchMethod ||
             noSuchMethodRegistry.hasComplexNoSuchMethod)) {
-      enableNoSuchMethod(enqueuer);
+      enqueuer.applyImpact(enableNoSuchMethod());
       enabledNoSuchMethod = true;
     }
 
-    if (compiler.options.useKernel) {
+    if (compiler.options.useKernel && compiler.mainApp != null) {
       kernelTask.buildKernelIr();
     }
 
     if (compiler.options.hasIncrementalSupport) {
       // Always enable tear-off closures during incremental compilation.
-      Element e = helpers.closureFromTearOff;
-      if (e != null && !enqueuer.isProcessed(e)) {
-        registerBackendUse(e);
-        enqueuer.addToWorkList(e);
+      Element element = helpers.closureFromTearOff;
+      if (element != null && !enqueuer.isProcessed(element)) {
+        enqueuer.applyImpact(
+            impactTransformer.createImpactFor(impacts.closureClass));
       }
     }
 
@@ -2383,12 +2291,18 @@
     }
 
     if (isTreeShakingDisabled) {
-      enqueuer.enqueueReflectiveElements(recentClasses);
+      enqueuer.applyImpact(mirrorsAnalysis.computeImpactForReflectiveElements(
+          recentClasses,
+          enqueuer.processedClasses,
+          compiler.libraryLoader.libraries,
+          forResolution: enqueuer.isResolutionQueue));
     } else if (!targetsUsed.isEmpty && enqueuer.isResolutionQueue) {
       // Add all static elements (not classes) that have been requested for
       // reflection. If there is no mirror-usage these are probably not
       // necessary, but the backend relies on them being resolved.
-      enqueuer.enqueueReflectiveStaticFields(_findStaticFieldTargets());
+      enqueuer.applyImpact(mirrorsAnalysis
+          .computeImpactForReflectiveStaticFields(_findStaticFieldTargets(),
+              forResolution: enqueuer.isResolutionQueue));
     }
 
     if (mustPreserveNames) reporter.log('Preserving names.');
@@ -2424,7 +2338,7 @@
         }
         metadataConstants.clear();
       }
-      enqueuer.applyImpact(null, impactBuilder.flush());
+      enqueuer.applyImpact(impactBuilder.flush());
     }
     return true;
   }
@@ -2479,9 +2393,11 @@
       return;
     }
 
-    if ((element.isFunction || element.isConstructor) &&
-        annotations.noInline(element)) {
-      inlineCache.markAsNonInlinable(element);
+    Element implementation = element.implementation;
+    if (element.isFunction || element.isConstructor) {
+      if (annotations.noInline(implementation)) {
+        inlineCache.markAsNonInlinable(implementation);
+      }
     }
 
     LibraryElement library = element.library;
@@ -2547,7 +2463,7 @@
           "@NoSideEffects() should always be combined with @NoInline.");
     }
     if (element == helpers.invokeOnMethod) {
-      compiler.enabledInvokeOn = true;
+      hasInvokeOnSupport = true;
     }
   }
 
@@ -2570,12 +2486,24 @@
     aliasedSuperMembers.remove(element);
   }
 
-  void registerMainHasArguments(Enqueuer enqueuer) {
-    // If the main method takes arguments, this compilation could be the target
-    // of Isolate.spawnUri. Strictly speaking, that can happen also if main
-    // takes no arguments, but in this case the spawned isolate can't
-    // communicate with the spawning isolate.
-    enqueuer.enableIsolateSupport();
+  @override
+  WorldImpact computeMainImpact(MethodElement mainMethod,
+      {bool forResolution}) {
+    WorldImpactBuilderImpl mainImpact = new WorldImpactBuilderImpl();
+    if (mainMethod.parameters.isNotEmpty) {
+      impactTransformer.registerBackendImpact(
+          mainImpact, impacts.mainWithArguments);
+      mainImpact.registerStaticUse(
+          new StaticUse.staticInvoke(mainMethod, CallStructure.TWO_ARGS));
+      // If the main method takes arguments, this compilation could be the
+      // target of Isolate.spawnUri. Strictly speaking, that can happen also if
+      // main takes no arguments, but in this case the spawned isolate can't
+      // communicate with the spawning isolate.
+      mainImpact.addImpact(enableIsolateSupport(forResolution: forResolution));
+    }
+    mainImpact.registerStaticUse(
+        new StaticUse.staticInvoke(mainMethod, CallStructure.NO_ARGS));
+    return mainImpact;
   }
 
   /// Returns the filename for the output-unit named [name].
@@ -2593,10 +2521,7 @@
   }
 
   @override
-  bool enableDeferredLoadingIfSupported(Spannable node, Registry registry) {
-    registerCheckDeferredIsLoaded(registry);
-    return true;
-  }
+  bool enableDeferredLoadingIfSupported(Spannable node) => true;
 
   @override
   bool enableCodegenWithErrorsIfSupported(Spannable node) => true;
@@ -2778,13 +2703,9 @@
 
   BackendImpacts get impacts => backend.impacts;
 
-  // TODO(johnniwinther): Avoid this dependency.
-  ResolutionEnqueuer get resolutionEnqueuer {
-    return backend.compiler.enqueuer.resolution;
-  }
-
   @override
-  WorldImpact transformResolutionImpact(ResolutionImpact worldImpact) {
+  WorldImpact transformResolutionImpact(
+      ResolutionEnqueuer enqueuer, ResolutionImpact worldImpact) {
     TransformedWorldImpact transformed =
         new TransformedWorldImpact(worldImpact);
     for (Feature feature in worldImpact.features) {
@@ -2871,6 +2792,8 @@
       DartType type = typeUse.type;
       switch (typeUse.kind) {
         case TypeUseKind.INSTANTIATION:
+        case TypeUseKind.MIRROR_INSTANTIATION:
+        case TypeUseKind.NATIVE_INSTANTIATION:
           registerRequiredType(type);
           break;
         case TypeUseKind.IS_CHECK:
@@ -2946,14 +2869,19 @@
     }
 
     for (StaticUse staticUse in worldImpact.staticUses) {
-      if (staticUse.kind == StaticUseKind.CLOSURE) {
-        registerBackendImpact(transformed, impacts.closure);
-        LocalFunctionElement closure = staticUse.element;
-        if (closure.type.containsTypeVariables) {
-          resolutionEnqueuer.universe.closuresWithFreeTypeVariables
-              .add(closure);
-          registerBackendImpact(transformed, impacts.computeSignature);
-        }
+      switch (staticUse.kind) {
+        case StaticUseKind.CLOSURE:
+          registerBackendImpact(transformed, impacts.closure);
+          LocalFunctionElement closure = staticUse.element;
+          if (closure.type.containsTypeVariables) {
+            registerBackendImpact(transformed, impacts.computeSignature);
+          }
+          break;
+        case StaticUseKind.CONST_CONSTRUCTOR_INVOKE:
+        case StaticUseKind.CONSTRUCTOR_INVOKE:
+          registerRequiredType(staticUse.type);
+          break;
+        default:
       }
     }
 
@@ -2981,21 +2909,51 @@
     }
 
     for (native.NativeBehavior behavior in worldImpact.nativeData) {
-      resolutionEnqueuer.nativeEnqueuer
-          .registerNativeBehavior(behavior, worldImpact);
+      enqueuer.nativeEnqueuer
+          .registerNativeBehavior(transformed, behavior, worldImpact);
     }
 
     return transformed;
   }
 
+  WorldImpact createImpactFor(BackendImpact impact) {
+    WorldImpactBuilderImpl impactBuilder = new WorldImpactBuilderImpl();
+    registerBackendImpact(impactBuilder, impact);
+    return impactBuilder;
+  }
+
+  void registerBackendStaticUse(
+      WorldImpactBuilder worldImpact, MethodElement element,
+      {bool isGlobal: false}) {
+    backend.registerBackendUse(element);
+    worldImpact.registerStaticUse(
+        // TODO(johnniwinther): Store the correct use in impacts.
+        new StaticUse.foreignUse(element));
+    if (isGlobal) {
+      backend.compiler.globalDependencies.registerDependency(element);
+    }
+  }
+
+  void registerBackendInstantiation(
+      WorldImpactBuilder worldImpact, ClassElement cls,
+      {bool isGlobal: false}) {
+    cls.ensureResolved(backend.resolution);
+    backend.registerBackendUse(cls);
+    worldImpact.registerTypeUse(new TypeUse.instantiation(cls.rawType));
+    if (isGlobal) {
+      backend.compiler.globalDependencies.registerDependency(cls);
+    }
+  }
+
   void registerBackendImpact(
-      TransformedWorldImpact worldImpact, BackendImpact backendImpact) {
+      WorldImpactBuilder worldImpact, BackendImpact backendImpact) {
     for (Element staticUse in backendImpact.staticUses) {
       assert(staticUse != null);
-      backend.registerBackendUse(staticUse);
-      worldImpact.registerStaticUse(
-          // TODO(johnniwinther): Store the correct use in impacts.
-          new StaticUse.foreignUse(staticUse));
+      registerBackendStaticUse(worldImpact, staticUse);
+    }
+    for (Element staticUse in backendImpact.globalUses) {
+      assert(staticUse != null);
+      registerBackendStaticUse(worldImpact, staticUse, isGlobal: true);
     }
     for (Selector selector in backendImpact.dynamicUses) {
       assert(selector != null);
@@ -3006,9 +2964,10 @@
       worldImpact.registerTypeUse(new TypeUse.instantiation(instantiatedType));
     }
     for (ClassElement cls in backendImpact.instantiatedClasses) {
-      cls.ensureResolved(backend.resolution);
-      backend.registerBackendUse(cls);
-      worldImpact.registerTypeUse(new TypeUse.instantiation(cls.rawType));
+      registerBackendInstantiation(worldImpact, cls);
+    }
+    for (ClassElement cls in backendImpact.globalClasses) {
+      registerBackendInstantiation(worldImpact, cls, isGlobal: true);
     }
     for (BackendImpact otherImpact in backendImpact.otherImpacts) {
       registerBackendImpact(worldImpact, otherImpact);
@@ -3082,8 +3041,8 @@
     // need to register checked mode helpers.
     if (inCheckedMode) {
       // All helpers are added to resolution queue in enqueueHelpers. These
-      // calls to enqueueInResolution serve as assertions that the helper was
-      // in fact added.
+      // calls to [enqueue] with the resolution enqueuer serve as assertions
+      // that the helper was in fact added.
       // TODO(13155): Find a way to enqueue helpers lazily.
       CheckedModeHelper helper =
           backend.getCheckedModeHelper(type, typeCast: false);
@@ -3139,11 +3098,18 @@
     }
 
     for (StaticUse staticUse in impact.staticUses) {
-      if (staticUse.kind == StaticUseKind.CLOSURE) {
-        LocalFunctionElement closure = staticUse.element;
-        if (backend.methodNeedsRti(closure)) {
-          registerBackendImpact(transformed, impacts.computeSignature);
-        }
+      switch (staticUse.kind) {
+        case StaticUseKind.CLOSURE:
+          LocalFunctionElement closure = staticUse.element;
+          if (backend.methodNeedsRti(closure)) {
+            registerBackendImpact(transformed, impacts.computeSignature);
+          }
+          break;
+        case StaticUseKind.CONST_CONSTRUCTOR_INVOKE:
+        case StaticUseKind.CONSTRUCTOR_INVOKE:
+          backend.lookupMapAnalysis.registerInstantiatedType(staticUse.type);
+          break;
+        default:
       }
     }
 
diff --git a/pkg/compiler/lib/src/js_backend/backend_helpers.dart b/pkg/compiler/lib/src/js_backend/backend_helpers.dart
index dc5bb12..e50c744 100644
--- a/pkg/compiler/lib/src/js_backend/backend_helpers.dart
+++ b/pkg/compiler/lib/src/js_backend/backend_helpers.dart
@@ -16,9 +16,12 @@
         ConstructorElement,
         Element,
         EnumClassElement,
+        FieldElement,
         FunctionElement,
         LibraryElement,
+        MemberElement,
         MethodElement,
+        Name,
         PublicName;
 import '../library_loader.dart' show LoadedLibraries;
 import '../universe/call_structure.dart' show CallStructure;
@@ -44,6 +47,11 @@
   static const String INVOKE_ON = '_getCachedInvocation';
   static const String START_ROOT_ISOLATE = 'startRootIsolate';
 
+  static const String JS = 'JS';
+  static const String JS_BUILTIN = 'JS_BUILTIN';
+  static const String JS_EMBEDDED_GLOBAL = 'JS_EMBEDDED_GLOBAL';
+  static const String JS_INTERCEPTOR_CONSTANT = 'JS_INTERCEPTOR_CONSTANT';
+
   final Compiler compiler;
 
   Element cachedCheckConcurrentModificationError;
@@ -100,11 +108,11 @@
   ClassElement jsUInt32Class;
   ClassElement jsUInt31Class;
 
-  Element jsIndexableLength;
+  MemberElement jsIndexableLength;
   Element jsArrayTypedConstructor;
-  Element jsArrayRemoveLast;
-  Element jsArrayAdd;
-  Element jsStringSplit;
+  MethodElement jsArrayRemoveLast;
+  MethodElement jsArrayAdd;
+  MethodElement jsStringSplit;
   Element jsStringToString;
   Element jsStringOperatorAdd;
   Element objectEquals;
@@ -113,10 +121,6 @@
   ClassElement mapLiteralClass;
   ClassElement constMapLiteralClass;
   ClassElement typeVariableClass;
-  ConstructorElement mapLiteralConstructor;
-  ConstructorElement mapLiteralConstructorEmpty;
-  Element mapLiteralUntypedMaker;
-  Element mapLiteralUntypedEmptyMaker;
 
   ClassElement noSideEffectsClass;
   ClassElement noThrowsClass;
@@ -366,10 +370,14 @@
     }
 
     jsIndexableClass.ensureResolved(resolution);
-    jsIndexableLength = compiler.lookupElementIn(jsIndexableClass, 'length');
-    if (jsIndexableLength != null && jsIndexableLength.isAbstractField) {
-      AbstractFieldElement element = jsIndexableLength;
+    Element jsIndexableLengthElement =
+        compiler.lookupElementIn(jsIndexableClass, 'length');
+    if (jsIndexableLengthElement != null &&
+        jsIndexableLengthElement.isAbstractField) {
+      AbstractFieldElement element = jsIndexableLengthElement;
       jsIndexableLength = element.getter;
+    } else {
+      jsIndexableLength = jsIndexableLengthElement;
     }
 
     jsArrayClass.ensureResolved(resolution);
@@ -385,6 +393,73 @@
     objectEquals = compiler.lookupElementIn(coreClasses.objectClass, '==');
   }
 
+  ConstructorElement _mapLiteralConstructor;
+  ConstructorElement _mapLiteralConstructorEmpty;
+  Element _mapLiteralUntypedMaker;
+  Element _mapLiteralUntypedEmptyMaker;
+
+  ConstructorElement get mapLiteralConstructor {
+    _ensureMapLiteralHelpers();
+    return _mapLiteralConstructor;
+  }
+
+  ConstructorElement get mapLiteralConstructorEmpty {
+    _ensureMapLiteralHelpers();
+    return _mapLiteralConstructorEmpty;
+  }
+
+  Element get mapLiteralUntypedMaker {
+    _ensureMapLiteralHelpers();
+    return _mapLiteralUntypedMaker;
+  }
+
+  Element get mapLiteralUntypedEmptyMaker {
+    _ensureMapLiteralHelpers();
+    return _mapLiteralUntypedEmptyMaker;
+  }
+
+  void _ensureMapLiteralHelpers() {
+    if (_mapLiteralConstructor != null) return;
+
+    // For map literals, the dependency between the implementation class
+    // and [Map] is not visible, so we have to add it manually.
+    Element getFactory(String name, int arity) {
+      // The constructor is on the patch class, but dart2js unit tests don't
+      // have a patch class.
+      ClassElement implementation = mapLiteralClass.implementation;
+      ConstructorElement ctor = implementation.lookupConstructor(name);
+      if (ctor == null ||
+          (Name.isPrivateName(name) &&
+              ctor.library != mapLiteralClass.library)) {
+        reporter.internalError(
+            mapLiteralClass,
+            "Map literal class ${mapLiteralClass} missing "
+            "'$name' constructor"
+            "  ${mapLiteralClass.constructors}");
+      }
+      return ctor;
+    }
+
+    Element getMember(String name) {
+      // The constructor is on the patch class, but dart2js unit tests don't
+      // have a patch class.
+      ClassElement implementation = mapLiteralClass.implementation;
+      Element element = implementation.lookupLocalMember(name);
+      if (element == null || !element.isFunction || !element.isStatic) {
+        reporter.internalError(
+            mapLiteralClass,
+            "Map literal class ${mapLiteralClass} missing "
+            "'$name' static member function");
+      }
+      return element;
+    }
+
+    _mapLiteralConstructor = getFactory('_literal', 1);
+    _mapLiteralConstructorEmpty = getFactory('_empty', 0);
+    _mapLiteralUntypedMaker = getMember('_makeLiteral');
+    _mapLiteralUntypedEmptyMaker = getMember('_makeEmpty');
+  }
+
   Element get badMain {
     return findHelper('badMain');
   }
@@ -397,7 +472,7 @@
     return findHelper('mainHasTooManyParameters');
   }
 
-  Element get loadLibraryWrapper {
+  MethodElement get loadLibraryWrapper {
     return findHelper("_loadLibraryWrapper");
   }
 
@@ -405,11 +480,19 @@
     return findHelper('boolConversionCheck');
   }
 
-  Element get consoleTraceHelper {
+  MethodElement _traceHelper;
+
+  MethodElement get traceHelper {
+    return _traceHelper ??= JavaScriptBackend.TRACE_METHOD == 'console'
+        ? _consoleTraceHelper
+        : _postTraceHelper;
+  }
+
+  MethodElement get _consoleTraceHelper {
     return findHelper('consoleTraceHelper');
   }
 
-  Element get postTraceHelper {
+  MethodElement get _postTraceHelper {
     return findHelper('postTraceHelper');
   }
 
@@ -457,6 +540,15 @@
     return findHelper('throwConcurrentModificationError');
   }
 
+  Element get checkInt => _checkInt ??= findHelper('checkInt');
+  Element _checkInt;
+
+  Element get checkNum => _checkNum ??= findHelper('checkNum');
+  Element _checkNum;
+
+  Element get checkString => _checkString ??= findHelper('checkString');
+  Element _checkString;
+
   Element get stringInterpolationHelper {
     return findHelper('S');
   }
diff --git a/pkg/compiler/lib/src/js_backend/backend_impact.dart b/pkg/compiler/lib/src/js_backend/backend_impact.dart
index 7726ed0..b5b9e72 100644
--- a/pkg/compiler/lib/src/js_backend/backend_impact.dart
+++ b/pkg/compiler/lib/src/js_backend/backend_impact.dart
@@ -24,17 +24,21 @@
 /// A set of JavaScript backend dependencies.
 class BackendImpact {
   final List<Element> staticUses;
+  final List<Element> globalUses;
   final List<Selector> dynamicUses;
   final List<InterfaceType> instantiatedTypes;
   final List<ClassElement> instantiatedClasses;
+  final List<ClassElement> globalClasses;
   final List<BackendImpact> otherImpacts;
   final EnumSet<BackendFeature> _features;
 
   const BackendImpact(
       {this.staticUses: const <Element>[],
+      this.globalUses: const <Element>[],
       this.dynamicUses: const <Selector>[],
       this.instantiatedTypes: const <InterfaceType>[],
       this.instantiatedClasses: const <ClassElement>[],
+      this.globalClasses: const <ClassElement>[],
       this.otherImpacts: const <BackendImpact>[],
       EnumSet<BackendFeature> features: const EnumSet<BackendFeature>.fixed(0)})
       : this._features = features;
@@ -58,160 +62,131 @@
   BackendImpact _getRuntimeTypeArgument;
 
   BackendImpact get getRuntimeTypeArgument {
-    if (_getRuntimeTypeArgument == null) {
-      _getRuntimeTypeArgument = new BackendImpact(staticUses: [
-        helpers.getRuntimeTypeArgument,
-        helpers.getTypeArgumentByIndex,
-      ]);
-    }
-    return _getRuntimeTypeArgument;
+    return _getRuntimeTypeArgument ??= new BackendImpact(globalUses: [
+      helpers.getRuntimeTypeArgument,
+      helpers.getTypeArgumentByIndex,
+    ]);
   }
 
   BackendImpact _computeSignature;
 
   BackendImpact get computeSignature {
-    if (_computeSignature == null) {
-      _computeSignature = new BackendImpact(staticUses: [
-        helpers.setRuntimeTypeInfo,
-        helpers.getRuntimeTypeInfo,
-        helpers.computeSignature,
-        helpers.getRuntimeTypeArguments
-      ], otherImpacts: [
-        listValues
-      ]);
-    }
-    return _computeSignature;
+    return _computeSignature ??= new BackendImpact(globalUses: [
+      helpers.setRuntimeTypeInfo,
+      helpers.getRuntimeTypeInfo,
+      helpers.computeSignature,
+      helpers.getRuntimeTypeArguments
+    ], otherImpacts: [
+      listValues
+    ]);
+  }
+
+  BackendImpact _mainWithArguments;
+
+  BackendImpact get mainWithArguments {
+    return _mainWithArguments ??= new BackendImpact(
+        instantiatedClasses: [helpers.jsArrayClass, helpers.jsStringClass]);
   }
 
   BackendImpact _asyncBody;
 
   BackendImpact get asyncBody {
-    if (_asyncBody == null) {
-      _asyncBody = new BackendImpact(staticUses: [
-        helpers.asyncHelper,
-        helpers.syncCompleterConstructor,
-        helpers.streamIteratorConstructor,
-        helpers.wrapBody
-      ]);
-    }
-    return _asyncBody;
+    return _asyncBody ??= new BackendImpact(staticUses: [
+      helpers.asyncHelper,
+      helpers.syncCompleterConstructor,
+      helpers.streamIteratorConstructor,
+      helpers.wrapBody
+    ]);
   }
 
   BackendImpact _syncStarBody;
 
   BackendImpact get syncStarBody {
-    if (_syncStarBody == null) {
-      _syncStarBody = new BackendImpact(staticUses: [
-        helpers.syncStarIterableConstructor,
-        helpers.endOfIteration,
-        helpers.yieldStar,
-        helpers.syncStarUncaughtError
-      ], instantiatedClasses: [
-        helpers.syncStarIterable
-      ]);
-    }
-    return _syncStarBody;
+    return _syncStarBody ??= new BackendImpact(staticUses: [
+      helpers.syncStarIterableConstructor,
+      helpers.endOfIteration,
+      helpers.yieldStar,
+      helpers.syncStarUncaughtError
+    ], instantiatedClasses: [
+      helpers.syncStarIterable
+    ]);
   }
 
   BackendImpact _asyncStarBody;
 
   BackendImpact get asyncStarBody {
-    if (_asyncStarBody == null) {
-      _asyncStarBody = new BackendImpact(staticUses: [
-        helpers.asyncStarHelper,
-        helpers.streamOfController,
-        helpers.yieldSingle,
-        helpers.yieldStar,
-        helpers.asyncStarControllerConstructor,
-        helpers.streamIteratorConstructor,
-        helpers.wrapBody
-      ], instantiatedClasses: [
-        helpers.asyncStarController
-      ]);
-    }
-    return _asyncStarBody;
+    return _asyncStarBody ??= new BackendImpact(staticUses: [
+      helpers.asyncStarHelper,
+      helpers.streamOfController,
+      helpers.yieldSingle,
+      helpers.yieldStar,
+      helpers.asyncStarControllerConstructor,
+      helpers.streamIteratorConstructor,
+      helpers.wrapBody
+    ], instantiatedClasses: [
+      helpers.asyncStarController
+    ]);
   }
 
   BackendImpact _typeVariableBoundCheck;
 
   BackendImpact get typeVariableBoundCheck {
-    if (_typeVariableBoundCheck == null) {
-      _typeVariableBoundCheck = new BackendImpact(
-          staticUses: [helpers.throwTypeError, helpers.assertIsSubtype]);
-    }
-    return _typeVariableBoundCheck;
+    return _typeVariableBoundCheck ??= new BackendImpact(
+        staticUses: [helpers.throwTypeError, helpers.assertIsSubtype]);
   }
 
   BackendImpact _abstractClassInstantiation;
 
   BackendImpact get abstractClassInstantiation {
-    if (_abstractClassInstantiation == null) {
-      _abstractClassInstantiation = new BackendImpact(
-          staticUses: [helpers.throwAbstractClassInstantiationError],
-          otherImpacts: [_needsString('Needed to encode the message.')]);
-    }
-    return _abstractClassInstantiation;
+    return _abstractClassInstantiation ??= new BackendImpact(
+        staticUses: [helpers.throwAbstractClassInstantiationError],
+        otherImpacts: [_needsString('Needed to encode the message.')]);
   }
 
   BackendImpact _fallThroughError;
 
   BackendImpact get fallThroughError {
-    if (_fallThroughError == null) {
-      _fallThroughError =
-          new BackendImpact(staticUses: [helpers.fallThroughError]);
-    }
-    return _fallThroughError;
+    return _fallThroughError ??=
+        new BackendImpact(staticUses: [helpers.fallThroughError]);
   }
 
   BackendImpact _asCheck;
 
   BackendImpact get asCheck {
-    if (_asCheck == null) {
-      _asCheck = new BackendImpact(staticUses: [helpers.throwRuntimeError]);
-    }
-    return _asCheck;
+    return _asCheck ??=
+        new BackendImpact(staticUses: [helpers.throwRuntimeError]);
   }
 
   BackendImpact _throwNoSuchMethod;
 
   BackendImpact get throwNoSuchMethod {
-    if (_throwNoSuchMethod == null) {
-      _throwNoSuchMethod = new BackendImpact(staticUses: [
-        helpers.throwNoSuchMethod
-      ], otherImpacts: [
-        // Also register the types of the arguments passed to this method.
-        _needsList(
-            'Needed to encode the arguments for throw NoSuchMethodError.'),
-        _needsString('Needed to encode the name for throw NoSuchMethodError.')
-      ]);
-    }
-    return _throwNoSuchMethod;
+    return _throwNoSuchMethod ??= new BackendImpact(staticUses: [
+      helpers.throwNoSuchMethod
+    ], otherImpacts: [
+      // Also register the types of the arguments passed to this method.
+      _needsList('Needed to encode the arguments for throw NoSuchMethodError.'),
+      _needsString('Needed to encode the name for throw NoSuchMethodError.')
+    ]);
   }
 
   BackendImpact _stringValues;
 
   BackendImpact get stringValues {
-    if (_stringValues == null) {
-      _stringValues =
-          new BackendImpact(instantiatedClasses: [helpers.jsStringClass]);
-    }
-    return _stringValues;
+    return _stringValues ??=
+        new BackendImpact(instantiatedClasses: [helpers.jsStringClass]);
   }
 
   BackendImpact _numValues;
 
   BackendImpact get numValues {
-    if (_numValues == null) {
-      _numValues = new BackendImpact(instantiatedClasses: [
-        helpers.jsIntClass,
-        helpers.jsPositiveIntClass,
-        helpers.jsUInt32Class,
-        helpers.jsUInt31Class,
-        helpers.jsNumberClass,
-        helpers.jsDoubleClass
-      ]);
-    }
-    return _numValues;
+    return _numValues ??= new BackendImpact(instantiatedClasses: [
+      helpers.jsIntClass,
+      helpers.jsPositiveIntClass,
+      helpers.jsUInt32Class,
+      helpers.jsUInt31Class,
+      helpers.jsNumberClass,
+      helpers.jsDoubleClass
+    ]);
   }
 
   BackendImpact get intValues => numValues;
@@ -221,67 +196,51 @@
   BackendImpact _boolValues;
 
   BackendImpact get boolValues {
-    if (_boolValues == null) {
-      _boolValues =
-          new BackendImpact(instantiatedClasses: [helpers.jsBoolClass]);
-    }
-    return _boolValues;
+    return _boolValues ??=
+        new BackendImpact(instantiatedClasses: [helpers.jsBoolClass]);
   }
 
   BackendImpact _nullValue;
 
   BackendImpact get nullValue {
-    if (_nullValue == null) {
-      _nullValue =
-          new BackendImpact(instantiatedClasses: [helpers.jsNullClass]);
-    }
-    return _nullValue;
+    return _nullValue ??=
+        new BackendImpact(instantiatedClasses: [helpers.jsNullClass]);
   }
 
   BackendImpact _listValues;
 
   BackendImpact get listValues {
-    if (_listValues == null) {
-      _listValues = new BackendImpact(instantiatedClasses: [
-        helpers.jsArrayClass,
-        helpers.jsMutableArrayClass,
-        helpers.jsFixedArrayClass,
-        helpers.jsExtendableArrayClass,
-        helpers.jsUnmodifiableArrayClass
-      ]);
-    }
-    return _listValues;
+    return _listValues ??= new BackendImpact(globalClasses: [
+      helpers.jsArrayClass,
+      helpers.jsMutableArrayClass,
+      helpers.jsFixedArrayClass,
+      helpers.jsExtendableArrayClass,
+      helpers.jsUnmodifiableArrayClass
+    ]);
   }
 
   BackendImpact _throwRuntimeError;
 
   BackendImpact get throwRuntimeError {
-    if (_throwRuntimeError == null) {
-      _throwRuntimeError = new BackendImpact(staticUses: [
-        helpers.throwRuntimeError
-      ], otherImpacts: [
-        // Also register the types of the arguments passed to this method.
-        stringValues
-      ]);
-    }
-    return _throwRuntimeError;
+    return _throwRuntimeError ??= new BackendImpact(staticUses: [
+      helpers.throwRuntimeError
+    ], otherImpacts: [
+      // Also register the types of the arguments passed to this method.
+      stringValues
+    ]);
   }
 
   BackendImpact _superNoSuchMethod;
 
   BackendImpact get superNoSuchMethod {
-    if (_superNoSuchMethod == null) {
-      _superNoSuchMethod = new BackendImpact(staticUses: [
-        helpers.createInvocationMirror,
-        helpers.objectNoSuchMethod
-      ], otherImpacts: [
-        _needsInt(
-            'Needed to encode the invocation kind of super.noSuchMethod.'),
-        _needsList('Needed to encode the arguments of super.noSuchMethod.'),
-        _needsString('Needed to encode the name of super.noSuchMethod.')
-      ]);
-    }
-    return _superNoSuchMethod;
+    return _superNoSuchMethod ??= new BackendImpact(staticUses: [
+      helpers.createInvocationMirror,
+      helpers.objectNoSuchMethod
+    ], otherImpacts: [
+      _needsInt('Needed to encode the invocation kind of super.noSuchMethod.'),
+      _needsList('Needed to encode the arguments of super.noSuchMethod.'),
+      _needsString('Needed to encode the name of super.noSuchMethod.')
+    ]);
   }
 
   BackendImpact _constantMapLiteral;
@@ -305,22 +264,16 @@
   BackendImpact _symbolConstructor;
 
   BackendImpact get symbolConstructor {
-    if (_symbolConstructor == null) {
-      _symbolConstructor =
-          new BackendImpact(staticUses: [helpers.symbolValidatedConstructor]);
-    }
-    return _symbolConstructor;
+    return _symbolConstructor ??=
+        new BackendImpact(staticUses: [helpers.symbolValidatedConstructor]);
   }
 
   BackendImpact _constSymbol;
 
   BackendImpact get constSymbol {
-    if (_constSymbol == null) {
-      _constSymbol = new BackendImpact(
-          instantiatedClasses: [commonElements.symbolClass],
-          staticUses: [commonElements.symbolConstructor.declaration]);
-    }
-    return _constSymbol;
+    return _constSymbol ??= new BackendImpact(
+        instantiatedClasses: [commonElements.symbolClass],
+        staticUses: [commonElements.symbolConstructor.declaration]);
   }
 
   /// Helper for registering that `int` is needed.
@@ -344,52 +297,37 @@
   BackendImpact _assertWithoutMessage;
 
   BackendImpact get assertWithoutMessage {
-    if (_assertWithoutMessage == null) {
-      _assertWithoutMessage =
-          new BackendImpact(staticUses: [helpers.assertHelper]);
-    }
-    return _assertWithoutMessage;
+    return _assertWithoutMessage ??=
+        new BackendImpact(staticUses: [helpers.assertHelper]);
   }
 
   BackendImpact _assertWithMessage;
 
   BackendImpact get assertWithMessage {
-    if (_assertWithMessage == null) {
-      _assertWithMessage = new BackendImpact(
-          staticUses: [helpers.assertTest, helpers.assertThrow]);
-    }
-    return _assertWithMessage;
+    return _assertWithMessage ??= new BackendImpact(
+        staticUses: [helpers.assertTest, helpers.assertThrow]);
   }
 
   BackendImpact _asyncForIn;
 
   BackendImpact get asyncForIn {
-    if (_asyncForIn == null) {
-      _asyncForIn =
-          new BackendImpact(staticUses: [helpers.streamIteratorConstructor]);
-    }
-    return _asyncForIn;
+    return _asyncForIn ??=
+        new BackendImpact(staticUses: [helpers.streamIteratorConstructor]);
   }
 
   BackendImpact _stringInterpolation;
 
   BackendImpact get stringInterpolation {
-    if (_stringInterpolation == null) {
-      _stringInterpolation = new BackendImpact(
-          dynamicUses: [Selectors.toString_],
-          staticUses: [helpers.stringInterpolationHelper],
-          otherImpacts: [_needsString('Strings are created.')]);
-    }
-    return _stringInterpolation;
+    return _stringInterpolation ??= new BackendImpact(
+        dynamicUses: [Selectors.toString_],
+        staticUses: [helpers.stringInterpolationHelper],
+        otherImpacts: [_needsString('Strings are created.')]);
   }
 
   BackendImpact _stringJuxtaposition;
 
   BackendImpact get stringJuxtaposition {
-    if (_stringJuxtaposition == null) {
-      _stringJuxtaposition = _needsString('String.concat is used.');
-    }
-    return _stringJuxtaposition;
+    return _stringJuxtaposition ??= _needsString('String.concat is used.');
   }
 
   BackendImpact get nullLiteral => nullValue;
@@ -405,231 +343,368 @@
   BackendImpact _catchStatement;
 
   BackendImpact get catchStatement {
-    if (_catchStatement == null) {
-      _catchStatement = new BackendImpact(staticUses: [
-        helpers.exceptionUnwrapper
-      ], instantiatedClasses: [
-        helpers.jsPlainJavaScriptObjectClass,
-        helpers.jsUnknownJavaScriptObjectClass
-      ]);
-    }
-    return _catchStatement;
+    return _catchStatement ??= new BackendImpact(staticUses: [
+      helpers.exceptionUnwrapper
+    ], instantiatedClasses: [
+      helpers.jsPlainJavaScriptObjectClass,
+      helpers.jsUnknownJavaScriptObjectClass
+    ]);
   }
 
   BackendImpact _throwExpression;
 
   BackendImpact get throwExpression {
-    if (_throwExpression == null) {
-      _throwExpression = new BackendImpact(
-          // We don't know ahead of time whether we will need the throw in a
-          // statement context or an expression context, so we register both
-          // here, even though we may not need the throwExpression helper.
-          staticUses: [
-            helpers.wrapExceptionHelper,
-            helpers.throwExpressionHelper
-          ]);
-    }
-    return _throwExpression;
+    return _throwExpression ??= new BackendImpact(
+        // We don't know ahead of time whether we will need the throw in a
+        // statement context or an expression context, so we register both
+        // here, even though we may not need the throwExpression helper.
+        staticUses: [
+          helpers.wrapExceptionHelper,
+          helpers.throwExpressionHelper
+        ]);
   }
 
   BackendImpact _lazyField;
 
   BackendImpact get lazyField {
-    if (_lazyField == null) {
-      _lazyField = new BackendImpact(staticUses: [helpers.cyclicThrowHelper]);
-    }
-    return _lazyField;
+    return _lazyField ??=
+        new BackendImpact(staticUses: [helpers.cyclicThrowHelper]);
   }
 
   BackendImpact _typeLiteral;
 
   BackendImpact get typeLiteral {
-    if (_typeLiteral == null) {
-      _typeLiteral = new BackendImpact(
-          instantiatedClasses: [backend.backendClasses.typeImplementation],
-          staticUses: [helpers.createRuntimeType]);
-    }
-    return _typeLiteral;
+    return _typeLiteral ??= new BackendImpact(
+        instantiatedClasses: [backend.backendClasses.typeImplementation],
+        staticUses: [helpers.createRuntimeType]);
   }
 
   BackendImpact _stackTraceInCatch;
 
   BackendImpact get stackTraceInCatch {
-    if (_stackTraceInCatch == null) {
-      _stackTraceInCatch = new BackendImpact(
-          instantiatedClasses: [helpers.stackTraceClass],
-          staticUses: [helpers.traceFromException]);
-    }
-    return _stackTraceInCatch;
+    return _stackTraceInCatch ??= new BackendImpact(
+        instantiatedClasses: [helpers.stackTraceClass],
+        staticUses: [helpers.traceFromException]);
   }
 
   BackendImpact _syncForIn;
 
   BackendImpact get syncForIn {
-    if (_syncForIn == null) {
-      _syncForIn = new BackendImpact(
-          // The SSA builder recognizes certain for-in loops and can generate
-          // calls to throwConcurrentModificationError.
-          staticUses: [helpers.checkConcurrentModificationError]);
-    }
-    return _syncForIn;
+    return _syncForIn ??= new BackendImpact(
+        // The SSA builder recognizes certain for-in loops and can generate
+        // calls to throwConcurrentModificationError.
+        staticUses: [helpers.checkConcurrentModificationError]);
   }
 
   BackendImpact _typeVariableExpression;
 
   BackendImpact get typeVariableExpression {
-    if (_typeVariableExpression == null) {
-      _typeVariableExpression = new BackendImpact(staticUses: [
-        helpers.setRuntimeTypeInfo,
-        helpers.getRuntimeTypeInfo,
-        helpers.runtimeTypeToString,
-        helpers.createRuntimeType
-      ], otherImpacts: [
-        listValues,
-        getRuntimeTypeArgument,
-        _needsInt('Needed for accessing a type variable literal on this.')
-      ]);
-    }
-    return _typeVariableExpression;
+    return _typeVariableExpression ??= new BackendImpact(staticUses: [
+      helpers.setRuntimeTypeInfo,
+      helpers.getRuntimeTypeInfo,
+      helpers.runtimeTypeToString,
+      helpers.createRuntimeType
+    ], otherImpacts: [
+      listValues,
+      getRuntimeTypeArgument,
+      _needsInt('Needed for accessing a type variable literal on this.')
+    ]);
   }
 
   BackendImpact _typeCheck;
 
   BackendImpact get typeCheck {
-    if (_typeCheck == null) {
-      _typeCheck = new BackendImpact(otherImpacts: [boolValues]);
-    }
-    return _typeCheck;
+    return _typeCheck ??= new BackendImpact(otherImpacts: [boolValues]);
   }
 
   BackendImpact _checkedModeTypeCheck;
 
   BackendImpact get checkedModeTypeCheck {
-    if (_checkedModeTypeCheck == null) {
-      _checkedModeTypeCheck =
-          new BackendImpact(staticUses: [helpers.throwRuntimeError]);
-    }
-    return _checkedModeTypeCheck;
+    return _checkedModeTypeCheck ??=
+        new BackendImpact(staticUses: [helpers.throwRuntimeError]);
   }
 
   BackendImpact _malformedTypeCheck;
 
   BackendImpact get malformedTypeCheck {
-    if (_malformedTypeCheck == null) {
-      _malformedTypeCheck =
-          new BackendImpact(staticUses: [helpers.throwTypeError]);
-    }
-    return _malformedTypeCheck;
+    return _malformedTypeCheck ??=
+        new BackendImpact(staticUses: [helpers.throwTypeError]);
   }
 
   BackendImpact _genericTypeCheck;
 
   BackendImpact get genericTypeCheck {
-    if (_genericTypeCheck == null) {
-      _genericTypeCheck = new BackendImpact(staticUses: [
-        helpers.checkSubtype,
-        // TODO(johnniwinther): Investigate why this is needed.
-        helpers.setRuntimeTypeInfo,
-        helpers.getRuntimeTypeInfo
-      ], otherImpacts: [
-        listValues,
-        getRuntimeTypeArgument
-      ]);
-    }
-    return _genericTypeCheck;
+    return _genericTypeCheck ??= new BackendImpact(staticUses: [
+      helpers.checkSubtype,
+      // TODO(johnniwinther): Investigate why this is needed.
+      helpers.setRuntimeTypeInfo,
+      helpers.getRuntimeTypeInfo
+    ], otherImpacts: [
+      listValues,
+      getRuntimeTypeArgument
+    ]);
   }
 
   BackendImpact _genericIsCheck;
 
   BackendImpact get genericIsCheck {
-    if (_genericIsCheck == null) {
-      _genericIsCheck = new BackendImpact(otherImpacts: [intValues]);
-    }
-    return _genericIsCheck;
+    return _genericIsCheck ??= new BackendImpact(otherImpacts: [intValues]);
   }
 
   BackendImpact _genericCheckedModeTypeCheck;
 
   BackendImpact get genericCheckedModeTypeCheck {
-    if (_genericCheckedModeTypeCheck == null) {
-      _genericCheckedModeTypeCheck =
-          new BackendImpact(staticUses: [helpers.assertSubtype]);
-    }
-    return _genericCheckedModeTypeCheck;
+    return _genericCheckedModeTypeCheck ??=
+        new BackendImpact(staticUses: [helpers.assertSubtype]);
   }
 
   BackendImpact _typeVariableTypeCheck;
 
   BackendImpact get typeVariableTypeCheck {
-    if (_typeVariableTypeCheck == null) {
-      _typeVariableTypeCheck =
-          new BackendImpact(staticUses: [helpers.checkSubtypeOfRuntimeType]);
-    }
-    return _typeVariableTypeCheck;
+    return _typeVariableTypeCheck ??=
+        new BackendImpact(staticUses: [helpers.checkSubtypeOfRuntimeType]);
   }
 
   BackendImpact _typeVariableCheckedModeTypeCheck;
 
   BackendImpact get typeVariableCheckedModeTypeCheck {
-    if (_typeVariableCheckedModeTypeCheck == null) {
-      _typeVariableCheckedModeTypeCheck =
-          new BackendImpact(staticUses: [helpers.assertSubtypeOfRuntimeType]);
-    }
-    return _typeVariableCheckedModeTypeCheck;
+    return _typeVariableCheckedModeTypeCheck ??=
+        new BackendImpact(staticUses: [helpers.assertSubtypeOfRuntimeType]);
   }
 
   BackendImpact _functionTypeCheck;
 
   BackendImpact get functionTypeCheck {
-    if (_functionTypeCheck == null) {
-      _functionTypeCheck =
-          new BackendImpact(staticUses: [helpers.functionTypeTestMetaHelper]);
-    }
-    return _functionTypeCheck;
+    return _functionTypeCheck ??=
+        new BackendImpact(staticUses: [helpers.functionTypeTestMetaHelper]);
   }
 
   BackendImpact _nativeTypeCheck;
 
   BackendImpact get nativeTypeCheck {
-    if (_nativeTypeCheck == null) {
-      _nativeTypeCheck = new BackendImpact(staticUses: [
-        // We will neeed to add the "$is" and "$as" properties on the
-        // JavaScript object prototype, so we make sure
-        // [:defineProperty:] is compiled.
-        helpers.defineProperty
-      ]);
-    }
-    return _nativeTypeCheck;
+    return _nativeTypeCheck ??= new BackendImpact(staticUses: [
+      // We will neeed to add the "$is" and "$as" properties on the
+      // JavaScript object prototype, so we make sure
+      // [:defineProperty:] is compiled.
+      helpers.defineProperty
+    ]);
   }
 
   BackendImpact _closure;
 
   BackendImpact get closure {
-    if (_closure == null) {
-      _closure = new BackendImpact(
-          instantiatedClasses: [commonElements.functionClass]);
-    }
-    return _closure;
+    return _closure ??=
+        new BackendImpact(instantiatedClasses: [commonElements.functionClass]);
   }
 
   BackendImpact _interceptorUse;
 
   BackendImpact get interceptorUse {
-    if (_interceptorUse == null) {
-      _interceptorUse = new BackendImpact(
-          staticUses: [
-            helpers.getNativeInterceptorMethod
-          ],
-          instantiatedClasses: [
-            helpers.jsJavaScriptObjectClass,
-            helpers.jsPlainJavaScriptObjectClass,
-            helpers.jsJavaScriptFunctionClass
-          ],
-          features: new EnumSet<BackendFeature>.fromValues([
-            BackendFeature.needToInitializeDispatchProperty,
-            BackendFeature.needToInitializeIsolateAffinityTag
-          ], fixed: true));
-    }
-    return _interceptorUse;
+    return _interceptorUse ??= new BackendImpact(
+        staticUses: [
+          helpers.getNativeInterceptorMethod
+        ],
+        instantiatedClasses: [
+          helpers.jsJavaScriptObjectClass,
+          helpers.jsPlainJavaScriptObjectClass,
+          helpers.jsJavaScriptFunctionClass
+        ],
+        features: new EnumSet<BackendFeature>.fromValues([
+          BackendFeature.needToInitializeDispatchProperty,
+          BackendFeature.needToInitializeIsolateAffinityTag
+        ], fixed: true));
+  }
+
+  BackendImpact _numClasses;
+
+  BackendImpact get numClasses {
+    return _numClasses ??= new BackendImpact(
+        // The backend will try to optimize number operations and use the
+        // `iae` helper directly.
+        globalUses: [helpers.throwIllegalArgumentException]);
+  }
+
+  BackendImpact _listOrStringClasses;
+
+  BackendImpact get listOrStringClasses {
+    return _listOrStringClasses ??= new BackendImpact(
+        // The backend will try to optimize array and string access and use the
+        // `ioore` and `iae` helpers directly.
+        globalUses: [
+          helpers.throwIndexOutOfRangeException,
+          helpers.throwIllegalArgumentException
+        ]);
+  }
+
+  BackendImpact _functionClass;
+
+  BackendImpact get functionClass {
+    return _functionClass ??=
+        new BackendImpact(globalClasses: [helpers.closureClass]);
+  }
+
+  BackendImpact _mapClass;
+
+  BackendImpact get mapClass {
+    return _mapClass ??= new BackendImpact(
+        // The backend will use a literal list to initialize the entries
+        // of the map.
+        globalClasses: [
+          helpers.coreClasses.listClass,
+          helpers.mapLiteralClass
+        ]);
+  }
+
+  BackendImpact _boundClosureClass;
+
+  BackendImpact get boundClosureClass {
+    return _boundClosureClass ??=
+        new BackendImpact(globalClasses: [helpers.boundClosureClass]);
+  }
+
+  BackendImpact _nativeOrExtendsClass;
+
+  BackendImpact get nativeOrExtendsClass {
+    return _nativeOrExtendsClass ??= new BackendImpact(globalUses: [
+      helpers.getNativeInterceptorMethod
+    ], globalClasses: [
+      helpers.jsInterceptorClass,
+      helpers.jsJavaScriptObjectClass,
+      helpers.jsPlainJavaScriptObjectClass,
+      helpers.jsJavaScriptFunctionClass
+    ]);
+  }
+
+  BackendImpact _mapLiteralClass;
+
+  BackendImpact get mapLiteralClass {
+    return _mapLiteralClass ??= new BackendImpact(globalUses: [
+      helpers.mapLiteralConstructor,
+      helpers.mapLiteralConstructorEmpty,
+      helpers.mapLiteralUntypedMaker,
+      helpers.mapLiteralUntypedEmptyMaker
+    ]);
+  }
+
+  BackendImpact _closureClass;
+
+  BackendImpact get closureClass {
+    return _closureClass ??=
+        new BackendImpact(globalUses: [helpers.closureFromTearOff]);
+  }
+
+  BackendImpact _listClasses;
+
+  BackendImpact get listClasses {
+    return _listClasses ??= new BackendImpact(
+        // Literal lists can be translated into calls to these functions:
+        globalUses: [
+          helpers.jsArrayTypedConstructor,
+          helpers.setRuntimeTypeInfo,
+          helpers.getTypeArgumentByIndex
+        ]);
+  }
+
+  BackendImpact _jsIndexingBehavior;
+
+  BackendImpact get jsIndexingBehavior {
+    return _jsIndexingBehavior ??= new BackendImpact(
+        // These two helpers are used by the emitter and the codegen.
+        // Because we cannot enqueue elements at the time of emission,
+        // we make sure they are always generated.
+        globalUses: [helpers.isJsIndexable]);
+  }
+
+  BackendImpact _enableTypeAssertions;
+
+  BackendImpact get enableTypeAssertions {
+    return _enableTypeAssertions ??= new BackendImpact(
+        // Register the helper that checks if the expression in an if/while/for
+        // is a boolean.
+        // TODO(johnniwinther): Should this be registered through a [Feature]
+        // instead?
+        globalUses: [helpers.boolConversionCheck]);
+  }
+
+  BackendImpact _traceHelper;
+
+  BackendImpact get traceHelper {
+    return _traceHelper ??=
+        new BackendImpact(globalUses: [helpers.traceHelper]);
+  }
+
+  BackendImpact _assertUnreachable;
+
+  BackendImpact get assertUnreachable {
+    return _assertUnreachable ??=
+        new BackendImpact(globalUses: [helpers.assertUnreachableMethod]);
+  }
+
+  BackendImpact _runtimeTypeSupport;
+
+  BackendImpact get runtimeTypeSupport {
+    return _runtimeTypeSupport ??= new BackendImpact(
+        globalClasses: [helpers.coreClasses.listClass],
+        globalUses: [helpers.setRuntimeTypeInfo, helpers.getRuntimeTypeInfo],
+        otherImpacts: [getRuntimeTypeArgument, computeSignature]);
+  }
+
+  BackendImpact _deferredLoading;
+
+  BackendImpact get deferredLoading {
+    return _deferredLoading ??=
+        new BackendImpact(globalUses: [helpers.checkDeferredIsLoaded],
+            // Also register the types of the arguments passed to this method.
+            globalClasses: [helpers.coreClasses.stringClass]);
+  }
+
+  BackendImpact _noSuchMethodSupport;
+
+  BackendImpact get noSuchMethodSupport {
+    return _noSuchMethodSupport ??= new BackendImpact(
+        staticUses: [helpers.createInvocationMirror],
+        dynamicUses: [Selectors.noSuchMethod_]);
+  }
+
+  BackendImpact _isolateSupport;
+
+  /// Backend impact for isolate support.
+  BackendImpact get isolateSupport {
+    return _isolateSupport ??=
+        new BackendImpact(globalUses: [helpers.startRootIsolate]);
+  }
+
+  BackendImpact _isolateSupportForResolution;
+
+  /// Additional backend impact for isolate support in resolution.
+  BackendImpact get isolateSupportForResolution {
+    return _isolateSupportForResolution ??= new BackendImpact(
+        globalUses: [helpers.currentIsolate, helpers.callInIsolate]);
+  }
+
+  BackendImpact _loadLibrary;
+
+  /// Backend impact for accessing a `loadLibrary` function on a deferred
+  /// prefix.
+  BackendImpact get loadLibrary {
+    return _loadLibrary ??=
+        new BackendImpact(globalUses: [helpers.loadLibraryWrapper]);
+  }
+
+  BackendImpact _memberClosure;
+
+  /// Backend impact for performing member closurization.
+  BackendImpact get memberClosure {
+    return _memberClosure ??=
+        new BackendImpact(globalClasses: [helpers.boundClosureClass]);
+  }
+
+  BackendImpact _staticClosure;
+
+  /// Backend impact for performing closurization of a top-level or static
+  /// function.
+  BackendImpact get staticClosure {
+    return _staticClosure ??=
+        new BackendImpact(globalClasses: [helpers.closureClass]);
   }
 }
diff --git a/pkg/compiler/lib/src/js_backend/constant_system_javascript.dart b/pkg/compiler/lib/src/js_backend/constant_system_javascript.dart
index 7f86482..08174df 100644
--- a/pkg/compiler/lib/src/js_backend/constant_system_javascript.dart
+++ b/pkg/compiler/lib/src/js_backend/constant_system_javascript.dart
@@ -165,12 +165,50 @@
   apply(left, right) => identical(left, right);
 }
 
+class JavaScriptRoundOperation implements UnaryOperation {
+  const JavaScriptRoundOperation();
+  String get name => DART_CONSTANT_SYSTEM.round.name;
+  ConstantValue fold(ConstantValue constant) {
+    // Be careful to round() only values that do not throw on either the host or
+    // target platform.
+    ConstantValue tryToRound(num value) {
+      // Due to differences between browsers, only 'round' easy cases. Avoid
+      // cases where nudging the value up or down changes the answer.
+      // 13 digits is safely within the ~15 digit precision of doubles.
+      const severalULP = 0.0000000000001;
+      // Use 'roundToDouble()' to avoid exceptions on rounding the nudged value.
+      double rounded = value.roundToDouble();
+      double rounded1 = (value * (1.0 + severalULP)).roundToDouble();
+      double rounded2 = (value * (1.0 - severalULP)).roundToDouble();
+      if (rounded != rounded1 || rounded != rounded2) return null;
+      return JAVA_SCRIPT_CONSTANT_SYSTEM
+          .convertToJavaScriptConstant(new IntConstantValue(value.round()));
+    }
+
+    if (constant.isInt) {
+      IntConstantValue intConstant = constant;
+      int value = intConstant.primitiveValue;
+      if (value >= -double.MAX_FINITE && value <= double.MAX_FINITE) {
+        return tryToRound(value);
+      }
+    }
+    if (constant.isDouble) {
+      DoubleConstantValue doubleConstant = constant;
+      double value = doubleConstant.primitiveValue;
+      // NaN and infinities will throw.
+      if (value.isNaN) return null;
+      if (value.isInfinite) return null;
+      return tryToRound(value);
+    }
+    return null;
+  }
+}
+
 /**
  * Constant system following the semantics for Dart code that has been
  * compiled to JavaScript.
  */
 class JavaScriptConstantSystem extends ConstantSystem {
-  final int BITS31 = 0x8FFFFFFF;
   final int BITS32 = 0xFFFFFFFF;
 
   final add = const JavaScriptAddOperation();
@@ -203,6 +241,7 @@
   final truncatingDivide = const JavaScriptBinaryArithmeticOperation(
       const TruncatingDivideOperation());
   final codeUnitAt = const CodeUnitAtRuntimeOperation();
+  final round = const JavaScriptRoundOperation();
 
   const JavaScriptConstantSystem();
 
diff --git a/pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart b/pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart
index 807bcb9..d87ffa3 100644
--- a/pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart
+++ b/pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart
@@ -71,10 +71,11 @@
     codegenJoin.allClassesSelected = true;
   }
 
-  CustomElementsAnalysisJoin joinFor(Enqueuer enqueuer) =>
-      enqueuer.isResolutionQueue ? resolutionJoin : codegenJoin;
+  CustomElementsAnalysisJoin joinFor({bool forResolution}) =>
+      forResolution ? resolutionJoin : codegenJoin;
 
-  void registerInstantiatedClass(ClassElement classElement, Enqueuer enqueuer) {
+  void registerInstantiatedClass(ClassElement classElement,
+      {bool forResolution}) {
     classElement.ensureResolved(compiler.resolution);
     if (!backend.isNativeOrExtendsNative(classElement)) return;
     if (classElement.isMixinApplication) return;
@@ -82,7 +83,7 @@
     // JsInterop classes are opaque interfaces without a concrete
     // implementation.
     if (backend.isJsInterop(classElement)) return;
-    joinFor(enqueuer).instantiatedClasses.add(classElement);
+    joinFor(forResolution: forResolution).instantiatedClasses.add(classElement);
   }
 
   void registerTypeLiteral(DartType type) {
@@ -104,19 +105,20 @@
     codegenJoin.selectedClasses.add(element);
   }
 
-  void registerStaticUse(Element element, Enqueuer enqueuer) {
+  void registerStaticUse(Element element, {bool forResolution}) {
     assert(element != null);
     if (!fetchedTableAccessorMethod) {
       fetchedTableAccessorMethod = true;
       tableAccessorMethod = backend.helpers.findIndexForNativeSubclassType;
     }
     if (element == tableAccessorMethod) {
-      joinFor(enqueuer).demanded = true;
+      joinFor(forResolution: forResolution).demanded = true;
     }
   }
 
-  void onQueueEmpty(Enqueuer enqueuer) {
-    joinFor(enqueuer).flush(enqueuer);
+  /// Computes the [WorldImpact] of the classes registered since last flush.
+  WorldImpact flush({bool forResolution}) {
+    return joinFor(forResolution: forResolution).flush();
   }
 
   bool get needsTable => codegenJoin.demanded;
@@ -152,8 +154,8 @@
 
   CustomElementsAnalysisJoin(this.backend);
 
-  void flush(Enqueuer enqueuer) {
-    if (!demanded) return;
+  WorldImpact flush() {
+    if (!demanded) return const WorldImpact();
     var newActiveClasses = new Set<ClassElement>();
     for (ClassElement classElement in instantiatedClasses) {
       bool isNative = backend.isNative(classElement);
@@ -168,7 +170,8 @@
         Iterable<ConstructorElement> escapingConstructors =
             computeEscapingConstructors(classElement);
         for (ConstructorElement constructor in escapingConstructors) {
-          enqueuer.registerStaticUse(new StaticUse.foreignUse(constructor));
+          impactBuilder
+              .registerStaticUse(new StaticUse.foreignUse(constructor));
         }
         escapingConstructors
             .forEach(compiler.globalDependencies.registerDependency);
@@ -182,7 +185,7 @@
     }
     activeClasses.addAll(newActiveClasses);
     instantiatedClasses.removeAll(newActiveClasses);
-    enqueuer.applyImpact(null, impactBuilder.flush());
+    return impactBuilder.flush();
   }
 
   TypeConstantValue makeTypeConstant(ClassElement element) {
diff --git a/pkg/compiler/lib/src/js_backend/enqueuer.dart b/pkg/compiler/lib/src/js_backend/enqueuer.dart
index e4b3027..c0b028c 100644
--- a/pkg/compiler/lib/src/js_backend/enqueuer.dart
+++ b/pkg/compiler/lib/src/js_backend/enqueuer.dart
@@ -8,8 +8,8 @@
 
 import '../common/backend_api.dart' show Backend;
 import '../common/codegen.dart' show CodegenWorkItem;
-import '../common/registry.dart' show Registry;
 import '../common/names.dart' show Identifiers;
+import '../common/tasks.dart' show CompilerTask;
 import '../common/work.dart' show WorkItem;
 import '../common.dart';
 import '../compiler.dart' show Compiler;
@@ -17,7 +17,6 @@
 import '../elements/elements.dart'
     show
         ClassElement,
-        ConstructorElement,
         Element,
         Elements,
         Entity,
@@ -25,6 +24,7 @@
         LibraryElement,
         Member,
         MemberElement,
+        MethodElement,
         Name,
         TypedElement,
         TypedefElement;
@@ -34,16 +34,16 @@
 import '../options.dart';
 import '../types/types.dart' show TypeMaskStrategy;
 import '../universe/selector.dart' show Selector;
-import '../universe/universe.dart';
+import '../universe/world_builder.dart';
 import '../universe/use.dart'
     show DynamicUse, StaticUse, StaticUseKind, TypeUse, TypeUseKind;
 import '../universe/world_impact.dart'
-    show ImpactUseCase, WorldImpact, WorldImpactVisitor;
+    show ImpactUseCase, ImpactStrategy, WorldImpact, WorldImpactVisitor;
 import '../util/util.dart' show Setlet;
 import '../world.dart';
 
 /// [Enqueuer] which is specific to code generation.
-class CodegenEnqueuer implements Enqueuer {
+class CodegenEnqueuer extends EnqueuerImpl {
   final String name;
   @deprecated
   final Compiler _compiler; // TODO(ahe): Remove this dependency.
@@ -54,40 +54,31 @@
       new Map<String, Set<Element>>();
   final Set<ClassElement> _processedClasses = new Set<ClassElement>();
   Set<ClassElement> recentClasses = new Setlet<ClassElement>();
-  final CodegenUniverseImpl _universe =
-      new CodegenUniverseImpl(const TypeMaskStrategy());
-
-  static final TRACE_MIRROR_ENQUEUING =
-      const bool.fromEnvironment("TRACE_MIRROR_ENQUEUING");
+  final CodegenWorldBuilderImpl _universe =
+      new CodegenWorldBuilderImpl(const TypeMaskStrategy());
 
   bool queueIsClosed = false;
-  EnqueueTask task;
-  native.NativeEnqueuer nativeEnqueuer; // Set by EnqueueTask
-
-  bool hasEnqueuedReflectiveElements = false;
-  bool hasEnqueuedReflectiveStaticFields = false;
+  final CompilerTask task;
+  final native.NativeEnqueuer nativeEnqueuer;
 
   WorldImpactVisitor impactVisitor;
 
-  CodegenEnqueuer(Compiler compiler, this.strategy)
+  CodegenEnqueuer(this.task, Compiler compiler, this.strategy)
       : queue = new Queue<CodegenWorkItem>(),
         newlyEnqueuedElements = compiler.cacheStrategy.newSet(),
         newlySeenSelectors = compiler.cacheStrategy.newSet(),
+        nativeEnqueuer = compiler.backend.nativeCodegenEnqueuer(),
         this.name = 'codegen enqueuer',
         this._compiler = compiler {
-    impactVisitor = new _EnqueuerImpactVisitor(this);
+    impactVisitor = new EnqueuerImplImpactVisitor(this);
   }
 
-  CodegenUniverse get universe => _universe;
+  CodegenWorldBuilder get universe => _universe;
 
   Backend get backend => _compiler.backend;
 
   CompilerOptions get options => _compiler.options;
 
-  Registry get globalDependencies => _compiler.globalDependencies;
-
-  Registry get mirrorDependencies => _compiler.mirrorDependencies;
-
   ClosedWorld get _world => _compiler.closedWorld;
 
   bool get queueIsEmpty => queue.isEmpty;
@@ -95,8 +86,6 @@
   /// Returns [:true:] if this enqueuer is the resolution enqueuer.
   bool get isResolutionQueue => false;
 
-  QueueFilter get filter => _compiler.enqueuerFilter;
-
   DiagnosticReporter get reporter => _compiler.reporter;
 
   /**
@@ -125,30 +114,38 @@
       throw new SpannableAssertionFailure(
           element, "Codegen work list is closed. Trying to add $element");
     }
-    queue.add(new CodegenWorkItem(_compiler, element));
-    if (options.dumpInfo) {
-      // TODO(sigmund): add other missing dependencies (internals, selectors
-      // enqueued after allocations), also enable only for the codegen enqueuer.
-      _compiler.dumpInfoTask
-          .registerDependency(_compiler.currentElement, element);
-    }
+    queue.add(new CodegenWorkItem(backend, element));
+    // TODO(sigmund): add other missing dependencies (internals, selectors
+    // enqueued after allocations).
+    _compiler.dumpInfoTask
+        .registerDependency(_compiler.currentElement, element);
   }
 
-  /// Apply the [worldImpact] of processing [element] to this enqueuer.
-  void applyImpact(Element element, WorldImpact worldImpact) {
-    _compiler.impactStrategy
-        .visitImpact(element, worldImpact, impactVisitor, impactUse);
+  void applyImpact(WorldImpact worldImpact, {Element impactSource}) {
+    if (worldImpact.isEmpty) return;
+    impactStrategy.visitImpact(
+        impactSource, worldImpact, impactVisitor, impactUse);
   }
 
-  void registerInstantiatedType(InterfaceType type, {bool mirrorUsage: false}) {
+  void registerInstantiatedType(InterfaceType type) {
+    _registerInstantiatedType(type);
+  }
+
+  void _registerInstantiatedType(InterfaceType type,
+      {bool mirrorUsage: false, bool nativeUsage: false}) {
     task.measure(() {
       ClassElement cls = type.element;
       bool isNative = backend.isNative(cls);
       _universe.registerTypeInstantiation(type,
           isNative: isNative,
           byMirrors: mirrorUsage, onImplemented: (ClassElement cls) {
-        backend.registerImplementedClass(cls, this, globalDependencies);
+        applyImpact(
+            backend.registerImplementedClass(cls, forResolution: false));
       });
+      if (nativeUsage) {
+        nativeEnqueuer.onInstantiatedType(type);
+      }
+      backend.registerInstantiatedType(type);
       // TODO(johnniwinther): Share this reasoning with [Universe].
       if (!cls.isAbstract || isNative || mirrorUsage) {
         processInstantiatedClass(cls);
@@ -157,7 +154,7 @@
   }
 
   bool checkNoEnqueuedInvokedInstanceMethods() {
-    return filter.checkNoEnqueuedInvokedInstanceMethods(this);
+    return strategy.checkEnqueuerConsistency(this);
   }
 
   void processInstantiatedClassMembers(ClassElement cls) {
@@ -211,11 +208,7 @@
         addToWorkList(function);
         return;
       }
-      // Store the member in [instanceFunctionsByName] to catch
-      // getters on the function.
-      instanceFunctionsByName
-          .putIfAbsent(memberName, () => new Set<Element>())
-          .add(member);
+      _registerInstanceMethod(function);
       if (_universe.hasInvocation(function, _world)) {
         addToWorkList(function);
         return;
@@ -247,6 +240,14 @@
         .add(member);
   }
 
+  // Store the member in [instanceFunctionsByName] to catch
+  // getters on the function.
+  void _registerInstanceMethod(MethodElement element) {
+    instanceFunctionsByName
+        .putIfAbsent(element.name, () => new Set<Element>())
+        .add(element);
+  }
+
   void enableIsolateSupport() {}
 
   void processInstantiatedClass(ClassElement cls) {
@@ -270,7 +271,8 @@
         // We only tell the backend once that [superclass] was instantiated, so
         // any additional dependencies must be treated as global
         // dependencies.
-        backend.registerInstantiatedClass(superclass, this, globalDependencies);
+        applyImpact(backend.registerInstantiatedClass(superclass,
+            forResolution: false));
       }
 
       ClassElement superclass = cls;
@@ -289,165 +291,6 @@
     });
   }
 
-  void logEnqueueReflectiveAction(action, [msg = ""]) {
-    if (TRACE_MIRROR_ENQUEUING) {
-      print("MIRROR_ENQUEUE (C): $action $msg");
-    }
-  }
-
-  /// Enqeue the constructor [ctor] if it is required for reflection.
-  ///
-  /// [enclosingWasIncluded] provides a hint whether the enclosing element was
-  /// needed for reflection.
-  void enqueueReflectiveConstructor(
-      ConstructorElement ctor, bool enclosingWasIncluded) {
-    if (shouldIncludeElementDueToMirrors(ctor,
-        includedEnclosing: enclosingWasIncluded)) {
-      logEnqueueReflectiveAction(ctor);
-      ClassElement cls = ctor.declaration.enclosingClass;
-      backend.registerInstantiatedType(cls.rawType, this, mirrorDependencies,
-          mirrorUsage: true);
-      registerStaticUse(new StaticUse.foreignUse(ctor.declaration));
-    }
-  }
-
-  /// Enqeue the member [element] if it is required for reflection.
-  ///
-  /// [enclosingWasIncluded] provides a hint whether the enclosing element was
-  /// needed for reflection.
-  void enqueueReflectiveMember(Element element, bool enclosingWasIncluded) {
-    if (shouldIncludeElementDueToMirrors(element,
-        includedEnclosing: enclosingWasIncluded)) {
-      logEnqueueReflectiveAction(element);
-      if (element.isTypedef) {
-        // Do nothing.
-      } else if (Elements.isStaticOrTopLevel(element)) {
-        registerStaticUse(new StaticUse.foreignUse(element.declaration));
-      } else if (element.isInstanceMember) {
-        // We need to enqueue all members matching this one in subclasses, as
-        // well.
-        // TODO(herhut): Use TypedSelector.subtype for enqueueing
-        DynamicUse dynamicUse =
-            new DynamicUse(new Selector.fromElement(element), null);
-        registerDynamicUse(dynamicUse);
-        if (element.isField) {
-          DynamicUse dynamicUse = new DynamicUse(
-              new Selector.setter(
-                  new Name(element.name, element.library, isSetter: true)),
-              null);
-          registerDynamicUse(dynamicUse);
-        }
-      }
-    }
-  }
-
-  /// Enqeue the member [element] if it is required for reflection.
-  ///
-  /// [enclosingWasIncluded] provides a hint whether the enclosing element was
-  /// needed for reflection.
-  void enqueueReflectiveElementsInClass(ClassElement cls,
-      Iterable<ClassElement> recents, bool enclosingWasIncluded) {
-    if (cls.library.isInternalLibrary || cls.isInjected) return;
-    bool includeClass = shouldIncludeElementDueToMirrors(cls,
-        includedEnclosing: enclosingWasIncluded);
-    if (includeClass) {
-      logEnqueueReflectiveAction(cls, "register");
-      ClassElement decl = cls.declaration;
-      backend.registerInstantiatedType(decl.rawType, this, mirrorDependencies,
-          mirrorUsage: true);
-    }
-    // If the class is never instantiated, we know nothing of it can possibly
-    // be reflected upon.
-    // TODO(herhut): Add a warning if a mirrors annotation cannot hit.
-    if (recents.contains(cls.declaration)) {
-      logEnqueueReflectiveAction(cls, "members");
-      cls.constructors.forEach((Element element) {
-        enqueueReflectiveConstructor(element, includeClass);
-      });
-      cls.forEachClassMember((Member member) {
-        enqueueReflectiveMember(member.element, includeClass);
-      });
-    }
-  }
-
-  /// Enqeue special classes that might not be visible by normal means or that
-  /// would not normally be enqueued:
-  ///
-  /// [Closure] is treated specially as it is the superclass of all closures.
-  /// Although it is in an internal library, we mark it as reflectable. Note
-  /// that none of its methods are reflectable, unless reflectable by
-  /// inheritance.
-  void enqueueReflectiveSpecialClasses() {
-    Iterable<ClassElement> classes = backend.classesRequiredForReflection;
-    for (ClassElement cls in classes) {
-      if (backend.referencedFromMirrorSystem(cls)) {
-        logEnqueueReflectiveAction(cls);
-        backend.registerInstantiatedType(cls.rawType, this, mirrorDependencies,
-            mirrorUsage: true);
-      }
-    }
-  }
-
-  /// Enqeue all local members of the library [lib] if they are required for
-  /// reflection.
-  void enqueueReflectiveElementsInLibrary(
-      LibraryElement lib, Iterable<ClassElement> recents) {
-    bool includeLibrary =
-        shouldIncludeElementDueToMirrors(lib, includedEnclosing: false);
-    lib.forEachLocalMember((Element member) {
-      if (member.isInjected) return;
-      if (member.isClass) {
-        enqueueReflectiveElementsInClass(member, recents, includeLibrary);
-      } else {
-        enqueueReflectiveMember(member, includeLibrary);
-      }
-    });
-  }
-
-  /// Enqueue all elements that are matched by the mirrors used
-  /// annotation or, in lack thereof, all elements.
-  void enqueueReflectiveElements(Iterable<ClassElement> recents) {
-    if (!hasEnqueuedReflectiveElements) {
-      logEnqueueReflectiveAction("!START enqueueAll");
-      // First round of enqueuing, visit everything that is visible to
-      // also pick up static top levels, etc.
-      // Also, during the first round, consider all classes that have been seen
-      // as recently seen, as we do not know how many rounds of resolution might
-      // have run before tree shaking is disabled and thus everything is
-      // enqueued.
-      recents = _processedClasses.toSet();
-      reporter.log('Enqueuing everything');
-      for (LibraryElement lib in _compiler.libraryLoader.libraries) {
-        enqueueReflectiveElementsInLibrary(lib, recents);
-      }
-      enqueueReflectiveSpecialClasses();
-      hasEnqueuedReflectiveElements = true;
-      hasEnqueuedReflectiveStaticFields = true;
-      logEnqueueReflectiveAction("!DONE enqueueAll");
-    } else if (recents.isNotEmpty) {
-      // Keep looking at new classes until fixpoint is reached.
-      logEnqueueReflectiveAction("!START enqueueRecents");
-      recents.forEach((ClassElement cls) {
-        enqueueReflectiveElementsInClass(
-            cls,
-            recents,
-            shouldIncludeElementDueToMirrors(cls.library,
-                includedEnclosing: false));
-      });
-      logEnqueueReflectiveAction("!DONE enqueueRecents");
-    }
-  }
-
-  /// Enqueue the static fields that have been marked as used by reflective
-  /// usage through `MirrorsUsed`.
-  void enqueueReflectiveStaticFields(Iterable<Element> elements) {
-    if (hasEnqueuedReflectiveStaticFields) return;
-    hasEnqueuedReflectiveStaticFields = true;
-    for (Element element in elements) {
-      enqueueReflectiveMember(element, true);
-    }
-  }
-
   void processSet(
       Map<String, Set<Element>> map, String memberName, bool f(Element e)) {
     Set<Element> members = map[memberName];
@@ -513,11 +356,11 @@
     assert(invariant(element, element.isDeclaration,
         message: "Element ${element} is not the declaration."));
     _universe.registerStaticUse(staticUse);
-    backend.registerStaticUse(element, this);
+    applyImpact(backend.registerStaticUse(element, forResolution: false));
     bool addElement = true;
     switch (staticUse.kind) {
       case StaticUseKind.STATIC_TEAR_OFF:
-        backend.registerGetOfStaticFunction(this);
+        applyImpact(backend.registerGetOfStaticFunction());
         break;
       case StaticUseKind.FIELD_GET:
       case StaticUseKind.FIELD_SET:
@@ -531,6 +374,15 @@
       case StaticUseKind.SUPER_FIELD_SET:
       case StaticUseKind.SUPER_TEAR_OFF:
       case StaticUseKind.GENERAL:
+      case StaticUseKind.DIRECT_USE:
+        break;
+      case StaticUseKind.CONSTRUCTOR_INVOKE:
+      case StaticUseKind.CONST_CONSTRUCTOR_INVOKE:
+      case StaticUseKind.REDIRECTION:
+        registerTypeUseInternal(new TypeUse.instantiation(staticUse.type));
+        break;
+      case StaticUseKind.DIRECT_INVOKE:
+        _registerInstanceMethod(staticUse.element);
         break;
     }
     if (addElement) {
@@ -539,12 +391,21 @@
   }
 
   void registerTypeUse(TypeUse typeUse) {
+    strategy.processTypeUse(this, typeUse);
+  }
+
+  void registerTypeUseInternal(TypeUse typeUse) {
     DartType type = typeUse.type;
     switch (typeUse.kind) {
       case TypeUseKind.INSTANTIATION:
-        registerInstantiatedType(type);
+        _registerInstantiatedType(type);
         break;
-      case TypeUseKind.INSTANTIATION:
+      case TypeUseKind.MIRROR_INSTANTIATION:
+        _registerInstantiatedType(type, mirrorUsage: true);
+        break;
+      case TypeUseKind.NATIVE_INSTANTIATION:
+        _registerInstantiatedType(type, nativeUsage: true);
+        break;
       case TypeUseKind.IS_CHECK:
       case TypeUseKind.AS_CAST:
       case TypeUseKind.CATCH_TYPE:
@@ -561,7 +422,7 @@
   }
 
   void _registerIsCheck(DartType type) {
-    type = _universe.registerIsCheck(type, _compiler);
+    type = _universe.registerIsCheck(type, _compiler.resolution);
     // Even in checked mode, type annotations for return type and argument
     // types do not imply type checks, so there should never be a check
     // against the type variable of a typedef.
@@ -569,24 +430,29 @@
   }
 
   void registerCallMethodWithFreeTypeVariables(Element element) {
-    backend.registerCallMethodWithFreeTypeVariables(
-        element, this, globalDependencies);
+    applyImpact(backend.registerCallMethodWithFreeTypeVariables(element,
+        forResolution: false));
   }
 
   void registerClosurizedMember(TypedElement element) {
     assert(element.isInstanceMember);
     if (element.type.containsTypeVariables) {
-      backend.registerClosureWithFreeTypeVariables(
-          element, this, globalDependencies);
+      applyImpact(backend.registerClosureWithFreeTypeVariables(element,
+          forResolution: false));
     }
-    backend.registerBoundClosure(this);
+    applyImpact(backend.registerBoundClosure());
   }
 
   void forEach(void f(WorkItem work)) {
     do {
       while (queue.isNotEmpty) {
         // TODO(johnniwinther): Find an optimal process order.
-        filter.processWorkItem(f, queue.removeLast());
+        WorkItem work = queue.removeLast();
+        if (!isProcessed(work.element)) {
+          strategy.processWorkItem(f, work);
+          // TODO(johnniwinther): Register the processed element here. This
+          // is currently a side-effect of calling `work.run`.
+        }
       }
       List recents = recentClasses.toList(growable: false);
       recentClasses.clear();
@@ -635,21 +501,9 @@
   bool isProcessed(Element member) =>
       member.isAbstract || generatedCode.containsKey(member);
 
-  /**
-   * Decides whether an element should be included to satisfy requirements
-   * of the mirror system.
-   *
-   * For code generation, we rely on the precomputed set of elements that takes
-   * subtyping constraints into account.
-   */
-  bool shouldIncludeElementDueToMirrors(Element element,
-      {bool includedEnclosing}) {
-    return backend.isAccessibleByReflection(element);
-  }
-
   void registerNoSuchMethod(Element element) {
     if (!enabledNoSuchMethod && backend.enabledNoSuchMethod) {
-      backend.enableNoSuchMethod(this);
+      applyImpact(backend.enableNoSuchMethod());
       enabledNoSuchMethod = true;
     }
   }
@@ -658,7 +512,7 @@
     log('Compiled ${generatedCode.length} methods.');
   }
 
-  void forgetElement(Element element) {
+  void forgetElement(Element element, Compiler compiler) {
     _forgetElement(element);
     generatedCode.remove(element);
     if (element is MemberElement) {
@@ -679,6 +533,9 @@
 
   @override
   Iterable<Entity> get processedEntities => generatedCode.keys;
+
+  @override
+  Iterable<ClassElement> get processedClasses => _processedClasses;
 }
 
 void removeFromSet(Map<String, Set<Element>> map, Element element) {
@@ -686,24 +543,3 @@
   if (set == null) return;
   set.remove(element);
 }
-
-class _EnqueuerImpactVisitor implements WorldImpactVisitor {
-  final CodegenEnqueuer enqueuer;
-
-  _EnqueuerImpactVisitor(this.enqueuer);
-
-  @override
-  void visitDynamicUse(DynamicUse dynamicUse) {
-    enqueuer.registerDynamicUse(dynamicUse);
-  }
-
-  @override
-  void visitStaticUse(StaticUse staticUse) {
-    enqueuer.registerStaticUse(staticUse);
-  }
-
-  @override
-  void visitTypeUse(TypeUse typeUse) {
-    enqueuer.registerTypeUse(typeUse);
-  }
-}
diff --git a/pkg/compiler/lib/src/js_backend/js_interop_analysis.dart b/pkg/compiler/lib/src/js_backend/js_interop_analysis.dart
index 380d196..3b75b49 100644
--- a/pkg/compiler/lib/src/js_backend/js_interop_analysis.dart
+++ b/pkg/compiler/lib/src/js_backend/js_interop_analysis.dart
@@ -22,7 +22,7 @@
 import '../js/js.dart' as jsAst;
 import '../js/js.dart' show js;
 import '../universe/selector.dart' show Selector;
-import '../universe/universe.dart' show SelectorConstraints;
+import '../universe/world_builder.dart' show SelectorConstraints;
 import 'backend_helpers.dart' show BackendHelpers;
 import 'js_backend.dart' show JavaScriptBackend;
 
diff --git a/pkg/compiler/lib/src/js_backend/kernel_task.dart b/pkg/compiler/lib/src/js_backend/kernel_task.dart
deleted file mode 100644
index ea32143..0000000
--- a/pkg/compiler/lib/src/js_backend/kernel_task.dart
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
-// for 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 '../compiler.dart';
-import '../kernel/kernel.dart';
-import 'package:kernel/ast.dart' as ir;
-
-import 'backend.dart';
-
-/// Visits the compiler main function and builds the kernel representation.
-///
-/// This creates a mapping from kernel nodes to AST nodes to be used later.
-class KernelTask {
-  final Compiler _compiler;
-  final Kernel kernel;
-
-  KernelTask(JavaScriptBackend backend)
-      : this._compiler = backend.compiler,
-        this.kernel = new Kernel(backend.compiler);
-
-  ir.Program program;
-
-  /// Builds the kernel IR for the main function.
-  ///
-  /// May enqueue more elements to the resolution queue.
-  void buildKernelIr() {
-    program =
-        new ir.Program(kernel.libraryDependencies(_compiler.options.entryPoint))
-          ..mainMethod = kernel.functionToIr(_compiler.mainFunction);
-  }
-}
diff --git a/pkg/compiler/lib/src/js_backend/lookup_map_analysis.dart b/pkg/compiler/lib/src/js_backend/lookup_map_analysis.dart
index d729e56..4a51239 100644
--- a/pkg/compiler/lib/src/js_backend/lookup_map_analysis.dart
+++ b/pkg/compiler/lib/src/js_backend/lookup_map_analysis.dart
@@ -8,7 +8,6 @@
 import 'package:pub_semver/pub_semver.dart';
 
 import '../common.dart';
-import '../common/registry.dart' show Registry;
 import '../compiler.dart' show Compiler;
 import '../constants/values.dart'
     show
@@ -22,7 +21,7 @@
 import '../dart_types.dart' show InterfaceType;
 import '../elements/elements.dart'
     show ClassElement, FieldElement, LibraryElement, VariableElement;
-import '../enqueue.dart';
+import '../universe/use.dart' show StaticUse;
 import '../universe/world_impact.dart'
     show WorldImpact, StagedWorldImpactBuilder;
 import 'js_backend.dart' show JavaScriptBackend;
@@ -121,16 +120,23 @@
   /// entry with that key.
   final _pending = <ConstantValue, List<_LookupMapInfo>>{};
 
-  final StagedWorldImpactBuilder impactBuilder = new StagedWorldImpactBuilder();
+  final StagedWorldImpactBuilder impactBuilderForResolution =
+      new StagedWorldImpactBuilder();
+  final StagedWorldImpactBuilder impactBuilderForCodegen =
+      new StagedWorldImpactBuilder();
 
   /// Whether the backend is currently processing the codegen queue.
   bool _inCodegen = false;
 
   LookupMapAnalysis(this.backend, this.reporter);
 
-  void onQueueEmpty(Enqueuer enqueuer) {
-    if (enqueuer.isResolutionQueue) return;
-    enqueuer.applyImpact(null, impactBuilder.flush());
+  /// Compute the [WorldImpact] for the constants registered since last flush.
+  WorldImpact flush({bool forResolution}) {
+    if (forResolution) {
+      return impactBuilderForResolution.flush();
+    } else {
+      return impactBuilderForCodegen.flush();
+    }
   }
 
   /// Whether this analysis and optimization is enabled.
@@ -151,8 +157,8 @@
       reporter.reportInfo(
           library, MessageKind.UNRECOGNIZED_VERSION_OF_LOOKUP_MAP);
     } else {
-      backend.compiler.enqueuer.resolution
-          .addToWorkList(lookupMapVersionVariable);
+      impactBuilderForResolution.registerStaticUse(
+          new StaticUse.foreignUse(lookupMapVersionVariable));
     }
   }
 
@@ -277,7 +283,8 @@
         // type_lookup_map/generic_type_test
         // TODO(sigmund): can we get rid of this?
         backend.computeImpactForInstantiatedConstantType(
-            backend.backendClasses.typeImplementation.rawType, impactBuilder);
+            backend.backendClasses.typeImplementation.rawType,
+            impactBuilderForCodegen);
         _addGenerics(arg);
       }
     }
@@ -418,7 +425,7 @@
     ConstantValue constant = unusedEntries.remove(key);
     usedEntries[key] = constant;
     analysis.backend.computeImpactForCompileTimeConstant(
-        constant, analysis.impactBuilder, false);
+        constant, analysis.impactBuilderForCodegen, false);
   }
 
   /// Restores [original] to contain all of the entries marked as possibly used.
diff --git a/pkg/compiler/lib/src/js_backend/mirrors_analysis.dart b/pkg/compiler/lib/src/js_backend/mirrors_analysis.dart
new file mode 100644
index 0000000..c66c8f1
--- /dev/null
+++ b/pkg/compiler/lib/src/js_backend/mirrors_analysis.dart
@@ -0,0 +1,252 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library dart2js.mirrors_handler;
+
+import '../common.dart';
+import '../common/resolution.dart';
+import '../diagnostics/diagnostic_listener.dart';
+import '../elements/elements.dart';
+import '../universe/selector.dart';
+import '../universe/use.dart';
+import '../universe/world_impact.dart';
+import 'backend.dart';
+
+class MirrorsAnalysis {
+  final MirrorsHandler resolutionHandler;
+  final MirrorsHandler codegenHandler;
+
+  MirrorsAnalysis(JavaScriptBackend backend, Resolution resolution)
+      : resolutionHandler = new MirrorsHandler(backend, resolution),
+        codegenHandler = new MirrorsHandler(backend, resolution);
+
+  /// Compute the impact for elements that are matched by the mirrors used
+  /// annotation or, in lack thereof, all elements.
+  WorldImpact computeImpactForReflectiveElements(
+      Iterable<ClassElement> recents,
+      Iterable<ClassElement> processedClasses,
+      Iterable<LibraryElement> loadedLibraries,
+      {bool forResolution}) {
+    MirrorsHandler handler = forResolution ? resolutionHandler : codegenHandler;
+    handler.enqueueReflectiveElements(
+        recents, processedClasses, loadedLibraries);
+    return handler.flush();
+  }
+
+  /// Compute the impact for the static fields that have been marked as used by
+  /// reflective usage through `MirrorsUsed`.
+  WorldImpact computeImpactForReflectiveStaticFields(Iterable<Element> elements,
+      {bool forResolution}) {
+    MirrorsHandler handler = forResolution ? resolutionHandler : codegenHandler;
+    handler.enqueueReflectiveStaticFields(elements);
+    return handler.flush();
+  }
+}
+
+class MirrorsHandler {
+  static final TRACE_MIRROR_ENQUEUING =
+      const bool.fromEnvironment("TRACE_MIRROR_ENQUEUING");
+
+  final JavaScriptBackend _backend;
+  final Resolution _resolution;
+
+  bool hasEnqueuedReflectiveElements = false;
+  bool hasEnqueuedReflectiveStaticFields = false;
+
+  StagedWorldImpactBuilder impactBuilder = new StagedWorldImpactBuilder();
+
+  MirrorsHandler(this._backend, this._resolution);
+
+  DiagnosticReporter get _reporter => _resolution.reporter;
+
+  WorldImpact flush() => impactBuilder.flush();
+
+  void _logEnqueueReflectiveAction(action, [msg = ""]) {
+    if (TRACE_MIRROR_ENQUEUING) {
+      print("MIRROR_ENQUEUE (R): $action $msg");
+    }
+  }
+
+  /**
+   * Decides whether an element should be included to satisfy requirements
+   * of the mirror system.
+   *
+   * During resolution, we have to resort to matching elements against the
+   * [MirrorsUsed] pattern, as we do not have a complete picture of the world,
+   * yet.
+   */
+  bool _shouldIncludeElementDueToMirrors(Element element,
+      {bool includedEnclosing}) {
+    return includedEnclosing || _backend.requiredByMirrorSystem(element);
+  }
+
+  /// Enqeue the constructor [ctor] if it is required for reflection.
+  ///
+  /// [enclosingWasIncluded] provides a hint whether the enclosing element was
+  /// needed for reflection.
+  void _enqueueReflectiveConstructor(ConstructorElement constructor,
+      {bool enclosingWasIncluded}) {
+    if (_shouldIncludeElementDueToMirrors(constructor,
+        includedEnclosing: enclosingWasIncluded)) {
+      _logEnqueueReflectiveAction(constructor);
+      ClassElement cls = constructor.declaration.enclosingClass;
+      impactBuilder
+          .registerTypeUse(new TypeUse.mirrorInstantiation(cls.rawType));
+      impactBuilder
+          .registerStaticUse(new StaticUse.foreignUse(constructor.declaration));
+    }
+  }
+
+  /// Enqeue the member [element] if it is required for reflection.
+  ///
+  /// [enclosingWasIncluded] provides a hint whether the enclosing element was
+  /// needed for reflection.
+  void _enqueueReflectiveMember(Element element, bool enclosingWasIncluded) {
+    if (_shouldIncludeElementDueToMirrors(element,
+        includedEnclosing: enclosingWasIncluded)) {
+      _logEnqueueReflectiveAction(element);
+      if (element.isTypedef) {
+        TypedefElement typedef = element;
+        typedef.ensureResolved(_resolution);
+      } else if (Elements.isStaticOrTopLevel(element)) {
+        impactBuilder
+            .registerStaticUse(new StaticUse.foreignUse(element.declaration));
+      } else if (element.isInstanceMember) {
+        // We need to enqueue all members matching this one in subclasses, as
+        // well.
+        // TODO(herhut): Use TypedSelector.subtype for enqueueing
+        DynamicUse dynamicUse =
+            new DynamicUse(new Selector.fromElement(element), null);
+        impactBuilder.registerDynamicUse(dynamicUse);
+        if (element.isField) {
+          DynamicUse dynamicUse = new DynamicUse(
+              new Selector.setter(
+                  new Name(element.name, element.library, isSetter: true)),
+              null);
+          impactBuilder.registerDynamicUse(dynamicUse);
+        }
+      }
+    }
+  }
+
+  /// Enqeue the member [element] if it is required for reflection.
+  ///
+  /// [enclosingWasIncluded] provides a hint whether the enclosing element was
+  /// needed for reflection.
+  void _enqueueReflectiveElementsInClass(
+      ClassElement cls, Iterable<ClassElement> recents,
+      {bool enclosingWasIncluded}) {
+    if (cls.library.isInternalLibrary || cls.isInjected) return;
+    bool includeClass = _shouldIncludeElementDueToMirrors(cls,
+        includedEnclosing: enclosingWasIncluded);
+    if (includeClass) {
+      _logEnqueueReflectiveAction(cls, "register");
+      ClassElement declaration = cls.declaration;
+      declaration.ensureResolved(_resolution);
+      impactBuilder.registerTypeUse(
+          new TypeUse.mirrorInstantiation(declaration.rawType));
+    }
+    // If the class is never instantiated, we know nothing of it can possibly
+    // be reflected upon.
+    // TODO(herhut): Add a warning if a mirrors annotation cannot hit.
+    if (recents.contains(cls.declaration)) {
+      _logEnqueueReflectiveAction(cls, "members");
+      cls.constructors.forEach((Element element) {
+        _enqueueReflectiveConstructor(element,
+            enclosingWasIncluded: includeClass);
+      });
+      cls.forEachClassMember((Member member) {
+        _enqueueReflectiveMember(member.element, includeClass);
+      });
+    }
+  }
+
+  /// Enqeue special classes that might not be visible by normal means or that
+  /// would not normally be enqueued:
+  ///
+  /// [Closure] is treated specially as it is the superclass of all closures.
+  /// Although it is in an internal library, we mark it as reflectable. Note
+  /// that none of its methods are reflectable, unless reflectable by
+  /// inheritance.
+  void _enqueueReflectiveSpecialClasses() {
+    Iterable<ClassElement> classes = _backend.classesRequiredForReflection;
+    for (ClassElement cls in classes) {
+      if (_backend.referencedFromMirrorSystem(cls)) {
+        _logEnqueueReflectiveAction(cls);
+        cls.ensureResolved(_resolution);
+        impactBuilder
+            .registerTypeUse(new TypeUse.mirrorInstantiation(cls.rawType));
+      }
+    }
+  }
+
+  /// Enqeue all local members of the library [lib] if they are required for
+  /// reflection.
+  void _enqueueReflectiveElementsInLibrary(
+      LibraryElement lib, Iterable<ClassElement> recents) {
+    bool includeLibrary =
+        _shouldIncludeElementDueToMirrors(lib, includedEnclosing: false);
+    lib.forEachLocalMember((Element member) {
+      if (member.isInjected) return;
+      if (member.isClass) {
+        ClassElement cls = member;
+        cls.ensureResolved(_resolution);
+        do {
+          _enqueueReflectiveElementsInClass(cls, recents,
+              enclosingWasIncluded: includeLibrary);
+          cls = cls.superclass;
+        } while (cls != null && cls.isUnnamedMixinApplication);
+      } else {
+        _enqueueReflectiveMember(member, includeLibrary);
+      }
+    });
+  }
+
+  /// Enqueue all elements that are matched by the mirrors used
+  /// annotation or, in lack thereof, all elements.
+  // TODO(johnniwinther): Compute [WorldImpact] instead of enqueuing directly.
+  void enqueueReflectiveElements(
+      Iterable<ClassElement> recents,
+      Iterable<ClassElement> processedClasses,
+      Iterable<LibraryElement> loadedLibraries) {
+    if (!hasEnqueuedReflectiveElements) {
+      _logEnqueueReflectiveAction("!START enqueueAll");
+      // First round of enqueuing, visit everything that is visible to
+      // also pick up static top levels, etc.
+      // Also, during the first round, consider all classes that have been seen
+      // as recently seen, as we do not know how many rounds of resolution might
+      // have run before tree shaking is disabled and thus everything is
+      // enqueued.
+      recents = processedClasses.toSet();
+      _reporter.log('Enqueuing everything');
+      for (LibraryElement lib in loadedLibraries) {
+        _enqueueReflectiveElementsInLibrary(lib, recents);
+      }
+      _enqueueReflectiveSpecialClasses();
+      hasEnqueuedReflectiveElements = true;
+      hasEnqueuedReflectiveStaticFields = true;
+      _logEnqueueReflectiveAction("!DONE enqueueAll");
+    } else if (recents.isNotEmpty) {
+      // Keep looking at new classes until fixpoint is reached.
+      _logEnqueueReflectiveAction("!START enqueueRecents");
+      recents.forEach((ClassElement cls) {
+        _enqueueReflectiveElementsInClass(cls, recents,
+            enclosingWasIncluded: _shouldIncludeElementDueToMirrors(cls.library,
+                includedEnclosing: false));
+      });
+      _logEnqueueReflectiveAction("!DONE enqueueRecents");
+    }
+  }
+
+  /// Enqueue the static fields that have been marked as used by reflective
+  /// usage through `MirrorsUsed`.
+  // TODO(johnniwinther): Compute [WorldImpact] instead of enqueuing directly.
+  void enqueueReflectiveStaticFields(Iterable<Element> elements) {
+    if (hasEnqueuedReflectiveStaticFields) return;
+    hasEnqueuedReflectiveStaticFields = true;
+    for (Element element in elements) {
+      _enqueueReflectiveMember(element, true);
+    }
+  }
+}
diff --git a/pkg/compiler/lib/src/js_backend/namer.dart b/pkg/compiler/lib/src/js_backend/namer.dart
index 8043861..e0511a3 100644
--- a/pkg/compiler/lib/src/js_backend/namer.dart
+++ b/pkg/compiler/lib/src/js_backend/namer.dart
@@ -17,6 +17,7 @@
 import '../dart_types.dart';
 import '../diagnostics/invariant.dart' show DEBUG_MODE;
 import '../elements/elements.dart';
+import '../elements/entities.dart';
 import '../js/js.dart' as jsAst;
 import '../js/js.dart' show js;
 import '../tree/tree.dart';
@@ -667,7 +668,7 @@
   }
 
   /// Annotated name for [method] encoding arity and named parameters.
-  jsAst.Name instanceMethodName(FunctionElement method) {
+  jsAst.Name instanceMethodName(MethodElement method) {
     if (method.isGenerativeConstructorBody) {
       return constructorBodyName(method);
     }
@@ -1250,7 +1251,7 @@
     return disambiguated;
   }
 
-  String suffixForGetInterceptor(Iterable<ClassElement> classes) {
+  String suffixForGetInterceptor(Iterable<ClassEntity> classes) {
     String abbreviate(ClassElement cls) {
       if (cls == coreClasses.objectClass) return "o";
       if (cls == helpers.jsStringClass) return "s";
@@ -1279,7 +1280,7 @@
   }
 
   /// Property name used for `getInterceptor` or one of its specializations.
-  jsAst.Name nameForGetInterceptor(Iterable<ClassElement> classes) {
+  jsAst.Name nameForGetInterceptor(Iterable<ClassEntity> classes) {
     FunctionElement getInterceptor = helpers.getInterceptorMethod;
     if (classes.contains(helpers.jsInterceptorClass)) {
       // If the base Interceptor class is in the set of intercepted classes, we
diff --git a/pkg/compiler/lib/src/js_backend/no_such_method_registry.dart b/pkg/compiler/lib/src/js_backend/no_such_method_registry.dart
index 1b88780..9956a18 100644
--- a/pkg/compiler/lib/src/js_backend/no_such_method_registry.dart
+++ b/pkg/compiler/lib/src/js_backend/no_such_method_registry.dart
@@ -124,7 +124,7 @@
   }
 
   _subcategorizeOther(FunctionElement element) {
-    if (_compiler.globalInference.results.throwsAlways(element)) {
+    if (_compiler.globalInference.results.resultOf(element).throwsAlways) {
       complexNoReturnImpls.add(element);
     } else {
       complexReturningImpls.add(element);
diff --git a/pkg/compiler/lib/src/js_backend/runtime_types.dart b/pkg/compiler/lib/src/js_backend/runtime_types.dart
index f465f76..23740b3 100644
--- a/pkg/compiler/lib/src/js_backend/runtime_types.dart
+++ b/pkg/compiler/lib/src/js_backend/runtime_types.dart
@@ -46,7 +46,7 @@
   ///
   /// This function must be called after all is-checks have been registered.
   void addImplicitChecks(
-      Universe universe, Iterable<ClassElement> classesUsingChecks);
+      WorldBuilder universe, Iterable<ClassElement> classesUsingChecks);
 
   /// Return all classes that are referenced in the type of the function, i.e.,
   /// in the return type or the argument types.
@@ -170,7 +170,7 @@
    */
   @override
   void addImplicitChecks(
-      Universe universe, Iterable<ClassElement> classesUsingChecks) {
+      WorldBuilder universe, Iterable<ClassElement> classesUsingChecks) {
     // If there are no classes that use their variables in checks, there is
     // nothing to do.
     if (classesUsingChecks.isEmpty) return;
@@ -181,7 +181,7 @@
         InterfaceType interface = type;
         do {
           for (DartType argument in interface.typeArguments) {
-            universe.registerIsCheck(argument, compiler);
+            universe.registerIsCheck(argument, compiler.resolution);
           }
           interface = interface.element.supertype;
         } while (interface != null && !instantiatedTypes.contains(interface));
@@ -204,7 +204,7 @@
             InterfaceType instance = current.asInstanceOf(cls);
             if (instance == null) break;
             for (DartType argument in instance.typeArguments) {
-              universe.registerIsCheck(argument, compiler);
+              universe.registerIsCheck(argument, compiler.resolution);
             }
             current = current.element.supertype;
           } while (current != null && !instantiatedTypes.contains(current));
@@ -364,7 +364,8 @@
         computeChecks(allInstantiatedArguments, checkedArguments);
   }
 
-  Set<DartType> computeInstantiatedTypesAndClosures(CodegenUniverse universe) {
+  Set<DartType> computeInstantiatedTypesAndClosures(
+      CodegenWorldBuilder universe) {
     Set<DartType> instantiatedTypes =
         new Set<DartType>.from(universe.instantiatedTypes);
     for (DartType instantiatedType in universe.instantiatedTypes) {
diff --git a/pkg/compiler/lib/src/js_backend/type_variable_handler.dart b/pkg/compiler/lib/src/js_backend/type_variable_handler.dart
index d7c3281..a32a3b5 100644
--- a/pkg/compiler/lib/src/js_backend/type_variable_handler.dart
+++ b/pkg/compiler/lib/src/js_backend/type_variable_handler.dart
@@ -3,7 +3,6 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import '../common.dart';
-import '../common/registry.dart' show Registry;
 import '../compiler.dart' show Compiler;
 import '../constants/expressions.dart';
 import '../constants/values.dart';
@@ -45,9 +44,13 @@
   Map<TypeVariableElement, jsAst.Expression> _typeVariableConstants =
       new Map<TypeVariableElement, jsAst.Expression>();
 
+  /// Impact builder used for the resolution world computation.
+  final StagedWorldImpactBuilder impactBuilderForResolution =
+      new StagedWorldImpactBuilder();
+
   /// Impact builder used for the codegen world computation.
-  // TODO(johnniwinther): Add impact builder for resolution.
-  final StagedWorldImpactBuilder impactBuilder = new StagedWorldImpactBuilder();
+  final StagedWorldImpactBuilder impactBuilderForCodegen =
+      new StagedWorldImpactBuilder();
 
   TypeVariableHandler(this._compiler);
 
@@ -57,19 +60,21 @@
   JavaScriptBackend get _backend => _compiler.backend;
   DiagnosticReporter get reporter => _compiler.reporter;
 
-  void onQueueEmpty(Enqueuer enqueuer) {
-    if (enqueuer.isResolutionQueue) return;
-
-    enqueuer.applyImpact(null, impactBuilder.flush());
+  /// Compute the [WorldImpact] for the type variables registered since last
+  /// flush.
+  WorldImpact flush({bool forResolution}) {
+    if (forResolution) {
+      return impactBuilderForResolution.flush();
+    } else {
+      return impactBuilderForCodegen.flush();
+    }
   }
 
-  void registerClassWithTypeVariables(
-      ClassElement cls, Enqueuer enqueuer, Registry registry) {
-    if (enqueuer.isResolutionQueue) {
+  void registerClassWithTypeVariables(ClassElement cls, {bool forResolution}) {
+    if (forResolution) {
       // On first encounter, we have to ensure that the support classes get
       // resolved.
       if (!_seenClassesWithTypeVariables) {
-        _backend.enqueueClass(enqueuer, _typeVariableClass, registry);
         _typeVariableClass.ensureResolved(_compiler.resolution);
         Link constructors = _typeVariableClass.constructors;
         if (constructors.isEmpty && constructors.tail.isEmpty) {
@@ -77,12 +82,12 @@
               "Class '$_typeVariableClass' should only have one constructor");
         }
         _typeVariableConstructor = _typeVariableClass.constructors.head;
-        _backend.enqueueInResolution(_typeVariableConstructor, registry);
-        _backend.registerInstantiatedType(
-            _typeVariableClass.rawType, enqueuer, registry);
-        enqueuer.registerStaticUse(new StaticUse.staticInvoke(
-            _backend.registerBackendUse(_backend.helpers.createRuntimeType),
-            CallStructure.ONE_ARG));
+        _backend.impactTransformer.registerBackendStaticUse(
+            impactBuilderForResolution, _typeVariableConstructor);
+        _backend.impactTransformer.registerBackendInstantiation(
+            impactBuilderForResolution, _typeVariableClass);
+        _backend.impactTransformer.registerBackendStaticUse(
+            impactBuilderForResolution, _backend.helpers.createRuntimeType);
         _seenClassesWithTypeVariables = true;
       }
     } else {
@@ -119,7 +124,8 @@
 
       _backend.constants.evaluate(constant);
       ConstantValue value = _backend.constants.getConstantValue(constant);
-      _backend.computeImpactForCompileTimeConstant(value, impactBuilder, false);
+      _backend.computeImpactForCompileTimeConstant(
+          value, impactBuilderForCodegen, false);
       _backend.addCompileTimeConstantForEmission(value);
       constants
           .add(_reifyTypeVariableConstant(value, currentTypeVariable.element));
diff --git a/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart b/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart
index da0aff8..eabb905 100644
--- a/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart
+++ b/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart
@@ -60,7 +60,7 @@
   String get patchVersion => emitter.patchVersion;
 
   /// Returns the closure expression of a static function.
-  jsAst.Expression isolateStaticClosureAccess(FunctionElement element) {
+  jsAst.Expression isolateStaticClosureAccess(MethodElement element) {
     return emitter.isolateStaticClosureAccess(element);
   }
 
@@ -87,7 +87,7 @@
   /// Returns the JS function representing the given function.
   ///
   /// The function must be invoked and can not be used as closure.
-  jsAst.Expression staticFunctionAccess(FunctionElement e) {
+  jsAst.Expression staticFunctionAccess(MethodElement e) {
     return emitter.staticFunctionAccess(e);
   }
 
diff --git a/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart
index 06f8203..a5e7b4c 100644
--- a/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart
@@ -1152,7 +1152,7 @@
         .add(new jsAst.FunctionDeclaration(constructorName, constructorAst));
 
     String fieldNamesProperty = FIELD_NAMES_PROPERTY_NAME;
-    bool hasIsolateSupport = compiler.hasIsolateSupport;
+    bool hasIsolateSupport = compiler.resolverWorld.hasIsolateSupport;
     jsAst.Node fieldNamesArray;
     if (hasIsolateSupport) {
       fieldNamesArray =
diff --git a/pkg/compiler/lib/src/js_emitter/full_emitter/interceptor_emitter.dart b/pkg/compiler/lib/src/js_emitter/full_emitter/interceptor_emitter.dart
index 51f06f8..0da9ca3 100644
--- a/pkg/compiler/lib/src/js_emitter/full_emitter/interceptor_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/full_emitter/interceptor_emitter.dart
@@ -76,7 +76,7 @@
     // We could also generate the list of intercepted names at
     // runtime, by running through the subclasses of Interceptor
     // (which can easily be identified).
-    if (!compiler.enabledInvokeOn) return null;
+    if (!backend.hasInvokeOnSupport) return null;
 
     Iterable<jsAst.Name> invocationNames = interceptorInvocationNames.toList()
       ..sort();
diff --git a/pkg/compiler/lib/src/js_emitter/full_emitter/setup_program_builder.dart b/pkg/compiler/lib/src/js_emitter/full_emitter/setup_program_builder.dart
index 56b1e29..feaee8e 100644
--- a/pkg/compiler/lib/src/js_emitter/full_emitter/setup_program_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/full_emitter/setup_program_builder.dart
@@ -103,7 +103,7 @@
     'staticsPropertyNameString': js.quoteName(namer.staticsPropertyName),
     'typeInformation': typeInformationAccess,
     'globalFunctions': globalFunctionsAccess,
-    'enabledInvokeOn': compiler.enabledInvokeOn,
+    'enabledInvokeOn': backend.hasInvokeOnSupport,
     'interceptedNames': interceptedNamesAccess,
     'interceptedNamesSet': emitter.generateInterceptedNamesSet(),
     'notInCspMode': !compiler.options.useContentSecurityPolicy,
@@ -138,7 +138,7 @@
         js.quoteName(namer.runtimeTypeName(compiler.coreClasses.objectClass)),
     'needsStructuredMemberInfo': emitter.needsStructuredMemberInfo,
     'usesMangledNames': compiler.commonElements.mirrorsLibrary != null ||
-        compiler.enabledFunctionApply,
+        compiler.hasFunctionApplySupport,
     'tearOffCode': buildTearOffCode(backend),
     'nativeInfoHandler': nativeInfoHandler,
     'operatorIsPrefix': js.string(namer.operatorIsPrefix),
diff --git a/pkg/compiler/lib/src/js_emitter/headers.dart b/pkg/compiler/lib/src/js_emitter/headers.dart
index 905cb04..ad9e783 100644
--- a/pkg/compiler/lib/src/js_emitter/headers.dart
+++ b/pkg/compiler/lib/src/js_emitter/headers.dart
@@ -32,4 +32,8 @@
 //    is loaded. It should load and eval the javascript of `uri`, and call
 //    successCallback. If it fails to do so, it should call errorCallback with
 //    an error.
+//
+// defaultPackagesBase:
+//    Override the location where `package:` uris are resolved from. By default
+//    they are resolved under "packages/" from the current window location.
 """;
diff --git a/pkg/compiler/lib/src/js_emitter/js_emitter.dart b/pkg/compiler/lib/src/js_emitter/js_emitter.dart
index c1543de..e902ab5 100644
--- a/pkg/compiler/lib/src/js_emitter/js_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/js_emitter.dart
@@ -56,7 +56,7 @@
         TypeVariableHandler;
 import '../universe/call_structure.dart' show CallStructure;
 import '../universe/selector.dart' show Selector;
-import '../universe/universe.dart' show SelectorConstraints;
+import '../universe/world_builder.dart' show SelectorConstraints;
 import '../util/util.dart' show Setlet;
 import 'full_emitter/emitter.dart' as full_js_emitter;
 import 'lazy_emitter/emitter.dart' as lazy_js_emitter;
diff --git a/pkg/compiler/lib/src/js_emitter/main_call_stub_generator.dart b/pkg/compiler/lib/src/js_emitter/main_call_stub_generator.dart
index b38e403..55824e8 100644
--- a/pkg/compiler/lib/src/js_emitter/main_call_stub_generator.dart
+++ b/pkg/compiler/lib/src/js_emitter/main_call_stub_generator.dart
@@ -28,7 +28,7 @@
   jsAst.Statement generateInvokeMain() {
     Element main = compiler.mainFunction;
     jsAst.Expression mainCallClosure = null;
-    if (compiler.hasIsolateSupport) {
+    if (compiler.resolverWorld.hasIsolateSupport) {
       Element isolateMain =
           helpers.isolateHelperLibrary.find(BackendHelpers.START_ROOT_ISOLATE);
       mainCallClosure = _buildIsolateSetupClosure(main, isolateMain);
diff --git a/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart b/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart
index b977ffe..3fac271 100644
--- a/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart
@@ -32,7 +32,8 @@
 import '../../js_backend/js_backend.dart'
     show Namer, JavaScriptBackend, JavaScriptConstantCompiler, StringBackedName;
 import '../../universe/selector.dart' show Selector;
-import '../../universe/universe.dart' show CodegenUniverse, SelectorConstraints;
+import '../../universe/world_builder.dart'
+    show CodegenWorldBuilder, SelectorConstraints;
 import '../js_emitter.dart'
     show
         ClassStubGenerator,
@@ -79,7 +80,7 @@
 
   JavaScriptBackend get backend => _compiler.backend;
   BackendHelpers get helpers => backend.helpers;
-  CodegenUniverse get universe => _compiler.codegenWorld;
+  CodegenWorldBuilder get universe => _compiler.codegenWorld;
 
   /// Mapping from [ClassElement] to constructed [Class]. We need this to
   /// update the superclass in the [Class].
@@ -168,8 +169,8 @@
 
     List<Holder> holders = _registry.holders.toList(growable: false);
 
-    bool needsNativeSupport = _compiler.enqueuer.codegen.nativeEnqueuer
-        .hasInstantiatedNativeClasses;
+    bool needsNativeSupport =
+        _compiler.enqueuer.codegen.nativeEnqueuer.hasInstantiatedNativeClasses;
 
     assert(!needsNativeSupport || nativeClasses.isNotEmpty);
 
@@ -674,7 +675,7 @@
   }
 
   bool _methodCanBeApplied(FunctionElement method) {
-    return _compiler.enabledFunctionApply &&
+    return _compiler.hasFunctionApplySupport &&
         _compiler.closedWorld.getMightBePassedToApply(method);
   }
 
diff --git a/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart b/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart
index 77663d3..7cffc44 100644
--- a/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart
+++ b/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart
@@ -78,14 +78,16 @@
         FunctionElement method, FunctionType type) {
       assert(method.isImplementation);
       jsAst.Expression thisAccess = new jsAst.This();
-      ClosureClassMap closureData = compiler
-          .closureToClassMapper.closureMappingCache[method.resolvedAst.node];
-      if (closureData != null) {
-        ClosureFieldElement thisLocal =
-            closureData.freeVariableMap[closureData.thisLocal];
-        if (thisLocal != null) {
-          jsAst.Name thisName = namer.instanceFieldPropertyName(thisLocal);
-          thisAccess = js('this.#', thisName);
+      if (!method.isAbstract) {
+        ClosureClassMap closureData = compiler.closureToClassMapper
+            .getClosureToClassMapping(method.resolvedAst);
+        if (closureData != null) {
+          ClosureFieldElement thisLocal =
+              closureData.freeVariableMap[closureData.thisLocal];
+          if (thisLocal != null) {
+            jsAst.Name thisName = namer.instanceFieldPropertyName(thisLocal);
+            thisAccess = js('this.#', thisName);
+          }
         }
       }
 
diff --git a/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart b/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
index 222b1c6..57e10a2 100644
--- a/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
@@ -345,6 +345,9 @@
 // Native-support uses setOrUpdateInterceptorsByTag and setOrUpdateLeafTags.
 #nativeSupport;
 
+// Sets up the js-interop support.
+#jsInteropSupport;
+
 // Invokes main (making sure that it records the 'current-script' value).
 #invokeMain;
 })()
@@ -497,6 +500,9 @@
       'nativeSupport': program.needsNativeSupport
           ? emitNativeSupport(fragment)
           : new js.EmptyStatement(),
+      'jsInteropSupport': backend.jsInteropAnalysis.enabledJsInterop
+          ? backend.jsInteropAnalysis.buildJsInteropBootstrap()
+          : new js.EmptyStatement(),
       'invokeMain': fragment.invokeMain,
     });
   }
@@ -1327,7 +1333,7 @@
 
     Map<String, js.Expression> interceptorsByTag = <String, js.Expression>{};
     Map<String, js.Expression> leafTags = <String, js.Expression>{};
-    js.Statement subclassAssignment = new js.EmptyStatement();
+    List<js.Statement> subclassAssignments = <js.Statement>[];
 
     for (Library library in fragment.libraries) {
       for (Class cls in library.classes) {
@@ -1344,15 +1350,15 @@
           }
           if (cls.nativeExtensions != null) {
             List<Class> subclasses = cls.nativeExtensions;
-            js.Expression value = js.string(cls.nativeNonLeafTags[0]);
+            js.Expression base = js.string(cls.nativeNonLeafTags[0]);
+
             for (Class subclass in subclasses) {
-              value = js.js('#.# = #', [
+              subclassAssignments.add(js.js.statement('#.# = #;', [
                 classReference(subclass),
                 NATIVE_SUPERCLASS_TAG_NAME,
-                js.string(cls.nativeNonLeafTags[0])
-              ]);
+                base
+              ]));
             }
-            subclassAssignment = new js.ExpressionStatement(value);
           }
         }
       }
@@ -1361,7 +1367,7 @@
         js.objectLiteral(interceptorsByTag)));
     statements.add(
         js.js.statement("setOrUpdateLeafTags(#);", js.objectLiteral(leafTags)));
-    statements.add(subclassAssignment);
+    statements.addAll(subclassAssignments);
 
     return new js.Block(statements);
   }
diff --git a/pkg/compiler/lib/src/kernel/constant_visitor.dart b/pkg/compiler/lib/src/kernel/constant_visitor.dart
new file mode 100644
index 0000000..0d1e1a6
--- /dev/null
+++ b/pkg/compiler/lib/src/kernel/constant_visitor.dart
@@ -0,0 +1,155 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE.md file.
+
+import 'package:kernel/ast.dart' as ir;
+
+import '../constants/expressions.dart';
+import 'kernel.dart';
+
+/// Visitor that converts a [ConstantExpression] into a kernel constant
+/// expression.
+class ConstantVisitor extends ConstantExpressionVisitor<ir.Node, Kernel> {
+  const ConstantVisitor();
+
+  @override
+  ir.Node visitNamed(NamedArgumentReference exp, Kernel kernel) {
+    throw new UnsupportedError(
+        '${exp.toStructuredText()} is not a valid constant.');
+  }
+
+  @override
+  ir.Node visitPositional(PositionalArgumentReference exp, Kernel kernel) {
+    throw new UnsupportedError(
+        '${exp.toStructuredText()} is not a valid constant.');
+  }
+
+  @override
+  ir.Node visitDeferred(DeferredConstantExpression exp, Kernel kernel) {
+    throw new UnimplementedError('${exp.toStructuredText()} is not supported.');
+  }
+
+  @override
+  ir.Node visitStringFromEnvironment(
+      StringFromEnvironmentConstantExpression exp, Kernel kernel) {
+    throw new UnimplementedError('${exp.toStructuredText()} is not supported.');
+  }
+
+  @override
+  ir.Node visitIntFromEnvironment(
+      IntFromEnvironmentConstantExpression exp, Kernel kernel) {
+    throw new UnimplementedError('${exp.toStructuredText()} is not supported.');
+  }
+
+  @override
+  ir.Node visitBoolFromEnvironment(
+      BoolFromEnvironmentConstantExpression exp, Kernel kernel) {
+    throw new UnimplementedError('${exp.toStructuredText()} is not supported.');
+  }
+
+  @override
+  ir.Node visitConditional(ConditionalConstantExpression exp, Kernel kernel) {
+    throw new UnimplementedError('${exp.toStructuredText()} is not supported.');
+  }
+
+  @override
+  ir.Node visitStringLength(StringLengthConstantExpression exp, Kernel kernel) {
+    throw new UnimplementedError('${exp.toStructuredText()} is not supported.');
+  }
+
+  @override
+  ir.Node visitUnary(UnaryConstantExpression exp, Kernel kernel) {
+    throw new UnimplementedError('${exp.toStructuredText()} is not supported.');
+  }
+
+  @override
+  ir.Node visitIdentical(IdenticalConstantExpression exp, Kernel kernel) {
+    throw new UnimplementedError('${exp.toStructuredText()} is not supported.');
+  }
+
+  @override
+  ir.Node visitBinary(BinaryConstantExpression exp, Kernel kernel) {
+    throw new UnimplementedError('${exp.toStructuredText()} is not supported.');
+  }
+
+  @override
+  ir.Node visitFunction(FunctionConstantExpression exp, Kernel kernel) {
+    throw new UnimplementedError('${exp.toStructuredText()} is not supported.');
+  }
+
+  @override
+  ir.Node visitVariable(VariableConstantExpression exp, Kernel kernel) {
+    return new ir.StaticGet(kernel.fieldToIr(exp.element));
+  }
+
+  @override
+  ir.Node visitType(TypeConstantExpression exp, Kernel kernel) {
+    throw new UnimplementedError('${exp.toStructuredText()} is not supported.');
+  }
+
+  @override
+  ir.Node visitSymbol(SymbolConstantExpression exp, Kernel kernel) {
+    throw new UnimplementedError('${exp.toStructuredText()} is not supported.');
+  }
+
+  @override
+  ir.Node visitConcatenate(ConcatenateConstantExpression exp, Kernel kernel) {
+    throw new UnimplementedError('${exp.toStructuredText()} is not supported.');
+  }
+
+  @override
+  ir.Node visitConstructed(ConstructedConstantExpression exp, Kernel kernel) {
+    List<ir.Expression> positional = <ir.Expression>[];
+    List<ir.NamedExpression> named = <ir.NamedExpression>[];
+    int positionalCount = exp.callStructure.positionalArgumentCount;
+    for (int index = 0; index < positionalCount; index++) {
+      ir.Expression argument = visit(exp.arguments[index], kernel);
+      if (index < exp.callStructure.positionalArgumentCount) {
+        positional.add(argument);
+      } else {
+        named.add(new ir.NamedExpression(
+            exp.callStructure.namedArguments[index - positionalCount],
+            argument));
+      }
+    }
+    ir.Arguments arguments = new ir.Arguments(positional, named: named);
+    return new ir.ConstructorInvocation(
+        kernel.functionToIr(exp.target), arguments,
+        isConst: true);
+  }
+
+  @override
+  ir.Node visitMap(MapConstantExpression exp, Kernel kernel) {
+    throw new UnimplementedError('${exp.toStructuredText()} is not supported.');
+  }
+
+  @override
+  ir.Node visitList(ListConstantExpression exp, Kernel kernel) {
+    throw new UnimplementedError('${exp.toStructuredText()} is not supported.');
+  }
+
+  @override
+  ir.Node visitNull(NullConstantExpression exp, Kernel kernel) {
+    return new ir.NullLiteral();
+  }
+
+  @override
+  ir.Node visitString(StringConstantExpression exp, Kernel kernel) {
+    return new ir.StringLiteral(exp.primitiveValue);
+  }
+
+  @override
+  ir.Node visitDouble(DoubleConstantExpression exp, Kernel kernel) {
+    return new ir.DoubleLiteral(exp.primitiveValue);
+  }
+
+  @override
+  ir.Node visitInt(IntConstantExpression exp, Kernel kernel) {
+    return new ir.IntLiteral(exp.primitiveValue);
+  }
+
+  @override
+  ir.Node visitBool(BoolConstantExpression exp, Kernel kernel) {
+    return new ir.BoolLiteral(exp.primitiveValue);
+  }
+}
diff --git a/pkg/compiler/lib/src/kernel/fall_through_visitor.dart b/pkg/compiler/lib/src/kernel/fall_through_visitor.dart
deleted file mode 100644
index cd74708..0000000
--- a/pkg/compiler/lib/src/kernel/fall_through_visitor.dart
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE.md file.
-
-import 'package:kernel/ast.dart'
-    show
-        AssertStatement,
-        Block,
-        BreakStatement,
-        Catch,
-        ContinueSwitchStatement,
-        DoStatement,
-        EmptyStatement,
-        ExpressionStatement,
-        ForInStatement,
-        ForStatement,
-        FunctionDeclaration,
-        IfStatement,
-        InvalidStatement,
-        LabeledStatement,
-        ReturnStatement,
-        Statement,
-        StatementVisitor,
-        SwitchStatement,
-        Throw,
-        TryCatch,
-        TryFinally,
-        VariableDeclaration,
-        WhileStatement,
-        YieldStatement;
-
-/// Returns true if [node] would let execution reach the next node (aka
-/// fall-through in switch cases).
-bool fallsThrough(Statement node) => node.accept(const FallThroughVisitor());
-
-/// Visitor implementing [computeFallThrough].
-class FallThroughVisitor implements StatementVisitor<bool> {
-  const FallThroughVisitor();
-
-  bool defaultStatement(Statement node) => throw "Not implemented.";
-
-  bool visitInvalidStatement(InvalidStatement node) => false;
-
-  bool visitExpressionStatement(ExpressionStatement node) {
-    return node.expression is! Throw;
-  }
-
-  bool visitBlock(Block node) {
-    for (Statement statement in node.statements) {
-      if (!statement.accept(this)) return false;
-    }
-    return true;
-  }
-
-  bool visitEmptyStatement(EmptyStatement node) => true;
-
-  bool visitAssertStatement(AssertStatement node) => true;
-
-  bool visitLabeledStatement(LabeledStatement node) => true;
-
-  bool visitBreakStatement(BreakStatement node) => false;
-
-  bool visitWhileStatement(WhileStatement node) => true;
-
-  bool visitDoStatement(DoStatement node) => node.body.accept(this);
-
-  bool visitForStatement(ForStatement node) => true;
-
-  bool visitForInStatement(ForInStatement node) => true;
-
-  bool visitSwitchStatement(SwitchStatement node) => true;
-
-  bool visitContinueSwitchStatement(ContinueSwitchStatement node) => false;
-
-  bool visitIfStatement(IfStatement node) {
-    if (node.then == null || node.otherwise == null) return true;
-    return node.then.accept(this) || node.otherwise.accept(this);
-  }
-
-  bool visitReturnStatement(ReturnStatement node) => false;
-
-  bool visitTryCatch(TryCatch node) {
-    if (node.body.accept(this)) return true;
-    for (Catch catchNode in node.catches) {
-      if (catchNode.body.accept(this)) return true;
-    }
-    return false;
-  }
-
-  bool visitTryFinally(TryFinally node) {
-    return node.body.accept(this) && node.finalizer.accept(this);
-  }
-
-  bool visitYieldStatement(YieldStatement node) => true;
-
-  bool visitVariableDeclaration(VariableDeclaration node) => true;
-
-  bool visitFunctionDeclaration(FunctionDeclaration node) => true;
-}
diff --git a/pkg/compiler/lib/src/kernel/kernel.dart b/pkg/compiler/lib/src/kernel/kernel.dart
index 2fe3c70..1210501 100644
--- a/pkg/compiler/lib/src/kernel/kernel.dart
+++ b/pkg/compiler/lib/src/kernel/kernel.dart
@@ -6,8 +6,10 @@
 import 'dart:collection' show Queue;
 
 import 'package:kernel/ast.dart' as ir;
-import 'package:kernel/checks.dart' show CheckParentPointers;
+import 'package:kernel/verifier.dart' show CheckParentPointers;
 
+import '../common.dart';
+import '../common/names.dart';
 import '../compiler.dart' show Compiler;
 import '../constants/expressions.dart' show TypeConstantExpression;
 import '../dart_types.dart'
@@ -25,10 +27,12 @@
         ImportElement,
         LibraryElement,
         LocalFunctionElement,
+        MetadataAnnotation,
         MixinApplicationElement,
         TypeVariableElement;
 import '../elements/modelx.dart' show ErroneousFieldElementX;
 import '../tree/tree.dart' show FunctionExpression, Node;
+import 'constant_visitor.dart';
 import 'kernel_visitor.dart' show IrFunction, KernelVisitor;
 
 typedef void WorkAction();
@@ -69,6 +73,7 @@
 
   final Map<ir.Node, Element> nodeToElement = <ir.Node, Element>{};
   final Map<ir.Node, Node> nodeToAst = <ir.Node, Node>{};
+  final Map<ir.Node, Node> nodeToAstOperator = <ir.Node, Node>{};
 
   /// FIFO queue of work that needs to be completed before the returned AST
   /// nodes are correct.
@@ -188,7 +193,11 @@
           fields: null);
       addWork(cls, () {
         if (cls.supertype != null) {
-          classNode.supertype = interfaceTypeToIr(cls.supertype);
+          classNode.supertype = supertypeToIr(cls.supertype);
+        }
+        if (cls.isMixinApplication) {
+          MixinApplicationElement mixinApplication = cls;
+          classNode.mixedInType = supertypeToIr(mixinApplication.mixinType);
         }
         classNode.parent = libraryToIr(cls.library);
         if (cls.isUnnamedMixinApplication) {
@@ -199,9 +208,13 @@
           if (member.enclosingClass.declaration != cls) {
             // TODO(het): figure out why impact_test triggers this
             //internalError(cls, "`$member` isn't mine.");
-          } else if (member.isFunction ||
-              member.isAccessor ||
-              member.isConstructor) {
+          } else if (member.isConstructor) {
+            ConstructorElement constructor = member;
+            ir.Member memberNode = functionToIr(member);
+            if (!constructor.isRedirectingFactory) {
+              classNode.addMember(memberNode);
+            }
+          } else if (member.isFunction || member.isAccessor) {
             classNode.addMember(functionToIr(member));
           } else if (member.isField) {
             classNode.addMember(fieldToIr(member));
@@ -210,15 +223,57 @@
           }
         });
         classNode.typeParameters.addAll(typeVariablesToIr(cls.typeVariables));
-        for (ir.InterfaceType interface
-            in typesToIr(cls.interfaces.reverse().toList())) {
-          classNode.implementedTypes.add(interface);
+        for (ir.Supertype supertype
+            in supertypesToIr(cls.interfaces.reverse().toList())) {
+          if (supertype != classNode.mixedInType) {
+            classNode.implementedTypes.add(supertype);
+          }
+        }
+        addWork(cls, () {
+          addDefaultInstanceFieldInitializers(classNode);
+        });
+      });
+      addWork(cls.declaration, () {
+        for (MetadataAnnotation metadata in cls.declaration.metadata) {
+          classNode.addAnnotation(
+              const ConstantVisitor().visit(metadata.constant, this));
         }
       });
       return classNode;
     });
   }
 
+  /// Adds initializers to instance fields that are have no initializer and are
+  /// not initialized by all constructors in the class.
+  ///
+  /// This is more or less copied directly from `ast_from_analyzer.dart` in
+  /// dartk.
+  void addDefaultInstanceFieldInitializers(ir.Class node) {
+    List<ir.Field> uninitializedFields = new List<ir.Field>();
+    for (ir.Field field in node.fields) {
+      if (field.initializer != null || field.isStatic) continue;
+      uninitializedFields.add(field);
+    }
+    if (uninitializedFields.isEmpty) return;
+    constructorLoop:
+    for (ir.Constructor constructor in node.constructors) {
+      Set<ir.Field> remainingFields = uninitializedFields.toSet();
+      for (ir.Initializer initializer in constructor.initializers) {
+        if (initializer is ir.FieldInitializer) {
+          remainingFields.remove(initializer.field);
+        } else if (initializer is ir.RedirectingInitializer) {
+          // The target constructor will be checked in another iteration.
+          continue constructorLoop;
+        }
+      }
+      for (ir.Field field in remainingFields) {
+        if (field.initializer == null) {
+          field.initializer = new ir.NullLiteral()..parent = field;
+        }
+      }
+    }
+  }
+
   bool hasHierarchyProblem(ClassElement cls) => cls.hasIncompleteHierarchy;
 
   ir.InterfaceType interfaceTypeToIr(InterfaceType type) {
@@ -230,6 +285,15 @@
     }
   }
 
+  ir.Supertype supertypeToIr(InterfaceType type) {
+    ir.Class cls = classToIr(type.element);
+    if (type.typeArguments.isEmpty) {
+      return cls.asRawSupertype;
+    } else {
+      return new ir.Supertype(cls, typesToIr(type.typeArguments));
+    }
+  }
+
   // TODO(ahe): Remove this method when dart2js support generic type arguments.
   List<ir.TypeParameter> typeParametersNotImplemented() {
     return const <ir.TypeParameter>[];
@@ -241,11 +305,10 @@
     List<ir.DartType> positionalParameters =
         new List<ir.DartType>.from(typesToIr(type.parameterTypes))
           ..addAll(typesToIr(type.optionalParameterTypes));
-    Map<String, ir.DartType> namedParameters = <String, ir.DartType>{};
-    for (int i = 0; i < type.namedParameters.length; i++) {
-      namedParameters[type.namedParameters[i]] =
-          typeToIr(type.namedParameterTypes[i]);
-    }
+    List<ir.NamedType> namedParameters = new List<ir.NamedType>.generate(
+        type.namedParameters.length,
+        (i) => new ir.NamedType(
+            type.namedParameters[i], typeToIr(type.namedParameterTypes[i])));
     ir.DartType returnType = typeToIr(type.returnType);
 
     return new ir.FunctionType(positionalParameters, returnType,
@@ -266,6 +329,14 @@
     return result;
   }
 
+  List<ir.Supertype> supertypesToIr(List<DartType> types) {
+    List<ir.Supertype> result = new List<ir.Supertype>(types.length);
+    for (int i = 0; i < types.length; i++) {
+      result[i] = supertypeToIr(types[i]);
+    }
+    return result;
+  }
+
   ir.DartType typeToIr(DartType type) {
     switch (type.kind) {
       case TypeKind.FUNCTION:
@@ -338,7 +409,7 @@
     }
     function = function.declaration;
     return functions.putIfAbsent(function, () {
-      compiler.analyzeElement(function);
+      compiler.resolution.ensureResolved(function);
       compiler.enqueuer.resolution.emptyDeferredQueueForTesting();
       function = function.implementation;
       ir.Member member;
@@ -389,6 +460,12 @@
           return true;
         });
       });
+      addWork(function.declaration, () {
+        for (MetadataAnnotation metadata in function.declaration.metadata) {
+          member.addAnnotation(
+              const ConstantVisitor().visit(metadata.constant, this));
+        }
+      });
       return member;
     });
   }
@@ -430,7 +507,7 @@
     }
     field = field.declaration;
     return fields.putIfAbsent(field, () {
-      compiler.analyzeElement(field);
+      compiler.resolution.ensureResolved(field);
       compiler.enqueuer.resolution.emptyDeferredQueueForTesting();
       field = field.implementation;
       ir.DartType type =
@@ -443,11 +520,21 @@
           isConst: field.isConst);
       addWork(field, () {
         setParent(fieldNode, field);
-        if (!field.isMalformed && field.initializer != null) {
-          KernelVisitor visitor =
-              new KernelVisitor(field, field.treeElements, this);
-          fieldNode.initializer = visitor.buildInitializer()
-            ..parent = fieldNode;
+        if (!field.isMalformed) {
+          if (field.initializer != null) {
+            KernelVisitor visitor =
+                new KernelVisitor(field, field.treeElements, this);
+            fieldNode.initializer = visitor.buildInitializer()
+              ..parent = fieldNode;
+          } else if (!field.isInstanceMember) {
+            fieldNode.initializer = new ir.NullLiteral()..parent = fieldNode;
+          }
+        }
+      });
+      addWork(field.declaration, () {
+        for (MetadataAnnotation metadata in field.declaration.metadata) {
+          fieldNode.addAnnotation(
+              const ConstantVisitor().visit(metadata.constant, this));
         }
       });
       return fieldNode;
@@ -591,10 +678,26 @@
     return false;
   }
 
+  ir.Constructor getDartCoreConstructor(
+      String className, String constructorName) {
+    LibraryElement library =
+        compiler.libraryLoader.lookupLibrary(Uris.dart_core);
+    ClassElement cls = library.implementation.localLookup(className);
+    assert(invariant(CURRENT_ELEMENT_SPANNABLE, cls != null,
+        message: 'dart:core class $className not found.'));
+    ConstructorElement constructor = cls.lookupConstructor(constructorName);
+    assert(invariant(CURRENT_ELEMENT_SPANNABLE, constructor != null,
+        message: "Constructor '$constructorName' not found "
+            "in class '$className'."));
+    return functionToIr(constructor);
+  }
+
   ir.Procedure getDartCoreMethod(String name) {
     LibraryElement library =
-        compiler.libraryLoader.lookupLibrary(Uri.parse("dart:core"));
+        compiler.libraryLoader.lookupLibrary(Uris.dart_core);
     Element function = library.implementation.localLookup(name);
+    assert(invariant(CURRENT_ELEMENT_SPANNABLE, function != null,
+        message: "dart:core method '$name' not found."));
     return functionToIr(function);
   }
 
@@ -646,8 +749,8 @@
     return getDartCoreMethod('_genericNoSuchMethod');
   }
 
-  ir.Procedure getFallThroughErrorBuilder() {
-    return getDartCoreMethod('_fallThroughError');
+  ir.Constructor getFallThroughErrorConstructor() {
+    return getDartCoreConstructor('FallThroughError', '');
   }
 }
 
diff --git a/pkg/compiler/lib/src/kernel/kernel_debug.dart b/pkg/compiler/lib/src/kernel/kernel_debug.dart
index 725e2d1..261aa09 100644
--- a/pkg/compiler/lib/src/kernel/kernel_debug.dart
+++ b/pkg/compiler/lib/src/kernel/kernel_debug.dart
@@ -6,7 +6,7 @@
 
 library kernel.debug;
 
-import 'package:kernel/kernel.dart';
+import 'package:kernel/ast.dart';
 import 'package:kernel/visitor.dart';
 
 import '../util/util.dart' show Indentation, Tagging;
@@ -43,9 +43,14 @@
   }
 
   @override
+  void visitStaticGet(StaticGet node) {
+    openAndCloseNode(node, '${node.runtimeType}', {'target': '${node.target}'});
+  }
+
+  @override
   void visitVariableDeclaration(VariableDeclaration node) {
     openNode(node, '${node.runtimeType}', {
-      'name': '${node.name}',
+      'name': '${node.name ?? '--unnamed--'}',
       'isFinal': '${node.isFinal}',
       'isConst': '${node.isConst}'
     });
diff --git a/pkg/compiler/lib/src/kernel/kernel_visitor.dart b/pkg/compiler/lib/src/kernel/kernel_visitor.dart
index ef34ee9..664388d 100644
--- a/pkg/compiler/lib/src/kernel/kernel_visitor.dart
+++ b/pkg/compiler/lib/src/kernel/kernel_visitor.dart
@@ -22,6 +22,7 @@
 import 'package:kernel/transformations/flags.dart';
 
 import '../common.dart';
+import '../common/names.dart';
 import '../constants/expressions.dart'
     show
         BoolFromEnvironmentConstantExpression,
@@ -145,7 +146,6 @@
 import '../universe/selector.dart' show Selector;
 import '../util/util.dart' show Link;
 import 'error.dart' show KernelError;
-import 'fall_through_visitor.dart' show fallsThrough;
 import 'kernel.dart' show ConstructorTarget, Kernel;
 import 'unavailable.dart' show UnavailableVisitor;
 import 'unresolved.dart' show UnresolvedVisitor;
@@ -710,7 +710,8 @@
     return new ir.ConditionalExpression(
         visitForValue(node.condition),
         visitWithCurrentContext(node.thenExpression),
-        visitWithCurrentContext(node.elseExpression));
+        visitWithCurrentContext(node.elseExpression),
+        null);
   }
 
   @override
@@ -995,6 +996,15 @@
     return new ir.SwitchCase(expressions, null, isDefault: node.isDefaultCase);
   }
 
+  /// Returns true if [node] would let execution reach the next node (aka
+  /// fall-through in switch cases).
+  bool fallsThrough(ir.Statement node) {
+    return !(node is ir.BreakStatement ||
+        node is ir.ReturnStatement ||
+        node is ir.ContinueSwitchStatement ||
+        (node is ir.ExpressionStatement && node.expression is ir.Throw));
+  }
+
   @override
   ir.Statement visitSwitchStatement(SwitchStatement node) {
     ir.Expression expression = visitForValue(node.expression);
@@ -1026,18 +1036,18 @@
           hasVariableDeclaration = true;
         }
       }
-      if (!isLastCase &&
-          (statements.isEmpty || fallsThrough(statements.last))) {
-        statements.add(new ir.ExpressionStatement(new ir.Throw(
-            new ir.StaticInvocation(kernel.getFallThroughErrorBuilder(),
-                new ir.Arguments.empty()))));
+      if (statements.isEmpty || fallsThrough(statements.last)) {
+        if (isLastCase) {
+          statements.add(new ir.BreakStatement(
+              getBreakTarget(elements.getTargetDefinition(node))));
+        } else {
+          statements.add(new ir.ExpressionStatement(new ir.Throw(
+              new ir.ConstructorInvocation(
+                  kernel.getFallThroughErrorConstructor(),
+                  new ir.Arguments.empty()))));
+        }
       }
-      ir.Statement body;
-      if (!hasVariableDeclaration && statements.length == 1) {
-        body = statements.single;
-      } else {
-        body = new ir.Block(statements);
-      }
+      ir.Statement body = new ir.Block(statements);
       irCase.body = body;
       body.parent = irCase;
     }
@@ -1149,13 +1159,8 @@
 
   ir.Expression buildConstructorInvoke(NewExpression node, {bool isConst}) {
     ConstructorElement constructor = elements[node.send];
-    ConstructorTarget target;
-    if (isConst) {
-      target =
-          kernel.computeEffectiveTarget(constructor, elements.getType(node));
-    } else {
-      target = new ConstructorTarget(constructor, elements.getType(node));
-    }
+    ConstructorTarget target =
+        kernel.computeEffectiveTarget(constructor, elements.getType(node));
     NodeList arguments = node.send.argumentsNode;
     if (kernel.isSyntheticError(target.element)) {
       return new ir.MethodInvocation(new ir.InvalidExpression(),
@@ -1225,6 +1230,7 @@
   @override
   ir.Expression visitCompoundIndexSet(SendSet node, Node receiver, Node index,
       AssignmentOperator operator, Node rhs, _) {
+    // TODO(sra): Find binary operator.
     return buildIndexAccessor(receiver, index).buildCompoundAssignment(
         kernel.irName(operator.selectorName, currentElement),
         visitForValue(rhs),
@@ -1284,7 +1290,8 @@
         receiver == null ? new ir.ThisExpression() : visitForValue(receiver);
     ir.Expression compound = buildCompound(
         PropertyAccessor.make(receiverNode, nameToIrName(name), null, null),
-        rhs);
+        rhs,
+        node);
     if (compound is ir.VariableSet) {
       associateNode(compound.value, node);
     } else {
@@ -1308,7 +1315,7 @@
     Accessor accessor = (receiver == null)
         ? new ThisPropertyAccessor(irName, null, null)
         : PropertyAccessor.make(visitForValue(receiver), irName, null, null);
-    return accessor.buildNullAwareAssignment(visitForValue(rhs),
+    return accessor.buildNullAwareAssignment(visitForValue(rhs), null,
         voidContext: isVoidContext);
   }
 
@@ -1500,7 +1507,7 @@
 
   Accessor buildNullAwarePropertyAccessor(Node receiver, Name name) {
     return new NullAwarePropertyAccessor(
-        visitForValue(receiver), nameToIrName(name), null, null);
+        visitForValue(receiver), nameToIrName(name), null, null, null);
   }
 
   @override
@@ -1520,7 +1527,8 @@
             buildIsNull(new ir.VariableGet(receiver)),
             new ir.NullLiteral(),
             buildInvokeSelector(new ir.VariableGet(receiver), selector,
-                buildArguments(arguments))));
+                buildArguments(arguments)),
+            null));
   }
 
   @override
@@ -1534,7 +1542,7 @@
   ir.Expression visitIfNotNullDynamicPropertySetIfNull(
       Send node, Node receiver, Name name, Node rhs, _) {
     return buildNullAwarePropertyAccessor(receiver, name)
-        .buildNullAwareAssignment(visitForValue(rhs),
+        .buildNullAwareAssignment(visitForValue(rhs), null,
             voidContext: isVoidContext);
   }
 
@@ -1545,8 +1553,12 @@
   }
 
   @override
-  ir.LogicalExpression visitIfNull(Send node, Node left, Node right, _) {
-    return buildLogicalExpression(left, node.selector, right);
+  ir.Expression visitIfNull(Send node, Node left, Node right, _) {
+    var leftValue = new ir.VariableDeclaration.forValue(visitForValue(left));
+    return new ir.Let(
+        leftValue,
+        new ir.ConditionalExpression(buildIsNull(new ir.VariableGet(leftValue)),
+            visitForValue(right), new ir.VariableGet(leftValue), null));
   }
 
   @override
@@ -1710,19 +1722,32 @@
     return buildLocalGet(element);
   }
 
-  ir.Expression buildCompound(Accessor accessor, CompoundRhs rhs) {
+  ir.Expression buildCompound(
+      Accessor accessor, CompoundRhs rhs, SendSet node) {
     ir.Name name = kernel.irName(rhs.operator.selectorName, currentElement);
+    ir.Expression result;
     switch (rhs.kind) {
       case CompoundKind.POSTFIX:
-        return accessor.buildPostfixIncrement(name, voidContext: isVoidContext);
+        result =
+            accessor.buildPostfixIncrement(name, voidContext: isVoidContext);
+        break;
 
       case CompoundKind.PREFIX:
-        return accessor.buildPrefixIncrement(name, voidContext: isVoidContext);
+        result =
+            accessor.buildPrefixIncrement(name, voidContext: isVoidContext);
+        break;
 
       case CompoundKind.ASSIGNMENT:
-        return accessor.buildCompoundAssignment(name, visitForValue(rhs.rhs),
+        result = accessor.buildCompoundAssignment(name, visitForValue(rhs.rhs),
             voidContext: isVoidContext);
+        break;
     }
+    assert(accessor.builtBinary != null);
+    kernel.nodeToAstOperator[accessor.builtBinary] = node;
+    if (accessor.builtGetter != null) {
+      kernel.nodeToAst[accessor.builtGetter] = node;
+    }
+    return result;
   }
 
   @override
@@ -1730,7 +1755,7 @@
       SendSet node, LocalElement local, CompoundRhs rhs, _,
       {bool isSetterValid}) {
     ir.Expression compound =
-        buildCompound(new VariableAccessor(getLocal(local)), rhs);
+        buildCompound(new VariableAccessor(getLocal(local)), rhs, node);
     if (compound is ir.VariableSet) {
       associateNode(compound.value, node);
     } else {
@@ -1833,7 +1858,7 @@
       SendSet node, LocalElement local, Node rhs, _,
       {bool isSetterValid}) {
     return new VariableAccessor(getLocal(local)).buildNullAwareAssignment(
-        visitForValue(rhs),
+        visitForValue(rhs), null,
         voidContext: isVoidContext);
   }
 
@@ -1921,7 +1946,7 @@
 
   @override
   ir.Expression handleStaticFieldGet(Send node, FieldElement field, _) {
-    return buildStaticGet(field);
+    return associateNode(buildStaticGet(field), node);
   }
 
   @override
@@ -1950,7 +1975,7 @@
       setter = null;
     }
     return buildStaticAccessor(getter, setter).buildNullAwareAssignment(
-        visitForValue(rhs),
+        visitForValue(rhs), null,
         voidContext: isVoidContext);
   }
 
@@ -2042,13 +2067,23 @@
     } else if (function.isConstructor) {
       // TODO(johnniwinther): Clean this up pending kernel issue #28.
       ConstructorElement constructor = function;
-      if (constructor.isDefaultConstructor) {
+      if (bodyNode == null || bodyNode.asEmptyStatement() != null) {
         body = new ir.EmptyStatement();
-      } else if (bodyNode != null && bodyNode.asEmptyStatement() == null) {
+      } else {
         body = buildStatementInBlock(bodyNode);
       }
     } else if (bodyNode != null) {
-      body = buildStatementInBlock(bodyNode);
+      Return returnStatement = bodyNode.asReturn();
+      if ((function.isSetter || function.name == Names.INDEX_SET_NAME.text) &&
+          returnStatement != null) {
+        // Avoid encoding the implicit return of setters with arrow body:
+        //    set setter(value) => this.value = value;
+        //    operator []=(index, value) => this[index] = value;
+        body = new ir.ExpressionStatement(
+            visitForEffect(returnStatement.expression));
+      } else {
+        body = buildStatementInBlock(bodyNode);
+      }
     }
     return associateElement(
         new ir.FunctionNode(body,
@@ -2118,7 +2153,8 @@
       NodeList arguments,
       CallStructure callStructure,
       _) {
-    return buildStaticInvoke(function, arguments, isConst: false);
+    return associateNode(
+        buildStaticInvoke(function, arguments, isConst: false), node);
   }
 
   @override
@@ -2214,6 +2250,7 @@
       AssignmentOperator operator,
       Node rhs,
       _) {
+    // TODO(sra): Find binary operator.
     return buildSuperIndexAccessor(index, getter, setter)
         .buildCompoundAssignment(
             kernel.irName(operator.selectorName, currentElement),
@@ -2265,7 +2302,7 @@
     if (setterKind == CompoundSetter.INVALID) {
       setter = null;
     }
-    return buildCompound(buildSuperPropertyAccessor(getter, setter), rhs);
+    return buildCompound(buildSuperPropertyAccessor(getter, setter), rhs, node);
   }
 
   @override
@@ -2280,13 +2317,14 @@
     if (setterKind == CompoundSetter.INVALID) {
       setter = null;
     }
-    return buildCompound(buildStaticAccessor(getter, setter), rhs);
+    return buildCompound(buildStaticAccessor(getter, setter), rhs, node);
   }
 
   @override
   ir.Expression handleTypeLiteralConstantCompounds(
       SendSet node, ConstantExpression constant, CompoundRhs rhs, _) {
-    return buildCompound(new ReadOnlyAccessor(buildTypeLiteral(constant)), rhs);
+    return buildCompound(
+        new ReadOnlyAccessor(buildTypeLiteral(constant)), rhs, node);
   }
 
   ir.TypeLiteral buildTypeVariable(TypeVariableElement element) {
@@ -2296,7 +2334,8 @@
   @override
   ir.Expression handleTypeVariableTypeLiteralCompounds(
       SendSet node, TypeVariableElement element, CompoundRhs rhs, _) {
-    return buildCompound(new ReadOnlyAccessor(buildTypeVariable(element)), rhs);
+    return buildCompound(
+        new ReadOnlyAccessor(buildTypeVariable(element)), rhs, node);
   }
 
   @override
@@ -2380,7 +2419,7 @@
       setter = null;
     }
     return buildSuperPropertyAccessor(getter, setter).buildNullAwareAssignment(
-        visitForValue(rhs),
+        visitForValue(rhs), null,
         voidContext: isVoidContext);
   }
 
@@ -2609,7 +2648,7 @@
   ir.Expression visitTypeVariableTypeLiteralSetIfNull(
       Send node, TypeVariableElement element, Node rhs, _) {
     return new ReadOnlyAccessor(buildTypeVariable(element))
-        .buildNullAwareAssignment(visitForValue(rhs),
+        .buildNullAwareAssignment(visitForValue(rhs), null,
             voidContext: isVoidContext);
   }
 
@@ -2675,7 +2714,7 @@
   ir.Expression visitIndexSetIfNull(
       SendSet node, Node receiver, Node index, Node rhs, _) {
     return buildIndexAccessor(receiver, index).buildNullAwareAssignment(
-        visitForValue(rhs),
+        visitForValue(rhs), null,
         voidContext: isVoidContext);
   }
 
@@ -2683,7 +2722,7 @@
   ir.Expression visitSuperIndexSetIfNull(SendSet node, MethodElement getter,
       MethodElement setter, Node index, Node rhs, _) {
     return buildSuperIndexAccessor(index, getter, setter)
-        .buildNullAwareAssignment(visitForValue(rhs),
+        .buildNullAwareAssignment(visitForValue(rhs), null,
             voidContext: isVoidContext);
   }
 
@@ -2743,7 +2782,7 @@
       FieldElement field = currentElement;
       return field.isMalformed
           ? new ir.InvalidExpression()
-          : visitForValue(field.initializer);
+          : associateNode(visitForValue(field.initializer), field.initializer);
     });
   }
 }
diff --git a/pkg/compiler/lib/src/kernel/task.dart b/pkg/compiler/lib/src/kernel/task.dart
new file mode 100644
index 0000000..59cf0b4
--- /dev/null
+++ b/pkg/compiler/lib/src/kernel/task.dart
@@ -0,0 +1,44 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 '../common/names.dart';
+import '../common/tasks.dart' show CompilerTask;
+import '../compiler.dart';
+import '../elements/elements.dart';
+import 'kernel.dart';
+import 'package:kernel/ast.dart' as ir;
+
+/// Visits the compiler main function and builds the kernel representation.
+///
+/// This creates a mapping from kernel nodes to AST nodes to be used later.
+class KernelTask extends CompilerTask {
+  get name => "kernel";
+
+  final Compiler _compiler;
+  final Kernel kernel;
+
+  KernelTask(Compiler compiler)
+      : this._compiler = compiler,
+        this.kernel = new Kernel(compiler),
+        super(compiler.measurer);
+
+  ir.Program program;
+
+  /// Builds the kernel IR for the main function.
+  ///
+  /// May enqueue more elements to the resolution queue.
+  void buildKernelIr() => measure(() {
+    program = buildProgram(_compiler.mainApp);
+  });
+
+  /// Builds the kernel IR program for the main function exported from
+  /// [library].
+  ///
+  /// May enqueue more elements to the resolution queue.
+  ir.Program buildProgram(LibraryElement library) {
+    return new ir.Program(kernel.libraryDependencies(library.canonicalUri))
+      ..mainMethod =
+          kernel.functionToIr(library.findExported(Identifiers.main));
+  }
+}
diff --git a/pkg/compiler/lib/src/kernel/unresolved.dart b/pkg/compiler/lib/src/kernel/unresolved.dart
index c1e332d..04632b7 100644
--- a/pkg/compiler/lib/src/kernel/unresolved.dart
+++ b/pkg/compiler/lib/src/kernel/unresolved.dart
@@ -272,7 +272,7 @@
       Send node, MethodElement getter, Element element, Node rhs, _) {
     var accessor = new ClassStaticAccessor(
         this, getter.name, possiblyErroneousFunctionToIr(getter), null);
-    return accessor.buildNullAwareAssignment(visitForValue(rhs),
+    return accessor.buildNullAwareAssignment(visitForValue(rhs), null,
         voidContext: isVoidContext);
   }
 
@@ -457,7 +457,7 @@
   ir.Expression visitUnresolvedSuperSetterSetIfNull(
       Send node, MethodElement getter, Element element, Node rhs, _) {
     return buildUnresolvedSuperPropertyAccessor('${node.selector}', getter)
-        .buildNullAwareAssignment(visitForValue(rhs));
+        .buildNullAwareAssignment(visitForValue(rhs), null);
   }
 
   ir.Expression visitUnresolvedSuperUnary(
@@ -533,26 +533,26 @@
       Send node, MethodElement getter, Element element, Node rhs, _) {
     var accessor = new TopLevelStaticAccessor(
         this, getter.name, possiblyErroneousFunctionToIr(getter), null);
-    return accessor.buildNullAwareAssignment(visitForValue(rhs),
+    return accessor.buildNullAwareAssignment(visitForValue(rhs), null,
         voidContext: isVoidContext);
   }
 
   ir.Expression visitUnresolvedSuperGetterIndexSetIfNull(Send node,
       Element element, MethodElement setter, Node index, Node rhs, _) {
     return buildUnresolvedSuperIndexAccessor(index, element)
-        .buildNullAwareAssignment(visitForValue(rhs));
+        .buildNullAwareAssignment(visitForValue(rhs), null);
   }
 
   ir.Expression visitUnresolvedSuperSetterIndexSetIfNull(Send node,
       MethodElement getter, Element element, Node index, Node rhs, _) {
     return buildUnresolvedSuperIndexAccessor(index, element)
-        .buildNullAwareAssignment(visitForValue(rhs));
+        .buildNullAwareAssignment(visitForValue(rhs), null);
   }
 
   ir.Expression visitUnresolvedSuperIndexSetIfNull(
       Send node, Element element, Node index, Node rhs, _) {
     return buildUnresolvedSuperIndexAccessor(index, element)
-        .buildNullAwareAssignment(visitForValue(rhs));
+        .buildNullAwareAssignment(visitForValue(rhs), null);
   }
 
   ir.Expression visitUnresolvedSuperSet(
diff --git a/pkg/compiler/lib/src/native/behavior.dart b/pkg/compiler/lib/src/native/behavior.dart
index 57ef61a..e34145a 100644
--- a/pkg/compiler/lib/src/native/behavior.dart
+++ b/pkg/compiler/lib/src/native/behavior.dart
@@ -6,6 +6,7 @@
 import '../common/backend_api.dart' show ForeignResolver;
 import '../common/resolution.dart' show ParsingContext, Resolution;
 import '../compiler.dart' show Compiler;
+import '../constants/expressions.dart';
 import '../constants/values.dart';
 import '../core_types.dart' show CoreTypes;
 import '../dart_types.dart';
@@ -18,6 +19,8 @@
 import 'enqueue.dart';
 import 'js.dart';
 
+typedef dynamic /*DartType|SpecialType*/ TypeLookup(String typeString);
+
 /// This class is a temporary work-around until we get a more powerful DartType.
 class SpecialType {
   final String name;
@@ -28,6 +31,8 @@
 
   int get hashCode => name.hashCode;
 
+  String toString() => name;
+
   static SpecialType fromName(String name) {
     if (name == '=Object') {
       return JsObject;
@@ -263,7 +268,7 @@
       void setThrows(NativeThrowBehavior throwKind),
       void setIsAllocation(bool isAllocation),
       void setUseGvn(bool useGvn),
-      dynamic resolveType(String typeString),
+      TypeLookup lookupType,
       List typesReturned,
       List typesInstantiated,
       objectType,
@@ -306,7 +311,7 @@
         return;
       }
       for (final typeString in typesString.split('|')) {
-        onType(resolveType(typeString.trim()));
+        onType(_parseType(typeString.trim(), spannable, reporter, lookupType));
       }
     }
 
@@ -486,8 +491,51 @@
     return sideEffects;
   }
 
-  static NativeBehavior ofJsCall(Send jsCall, DiagnosticReporter reporter,
+  /// Returns a [TypeLookup] that uses [resolver] to perform lookup and [node]
+  /// as position for errors.
+  static TypeLookup _typeLookup(Node node, ForeignResolver resolver) {
+    return (String name) => resolver.resolveTypeFromString(node, name);
+  }
+
+  /// Compute the [NativeBehavior] for a [Send] node calling the 'JS' function.
+  static NativeBehavior ofJsCallSend(Send jsCall, DiagnosticReporter reporter,
       ParsingContext parsing, CoreTypes coreTypes, ForeignResolver resolver) {
+    var argNodes = jsCall.arguments;
+    if (argNodes.isEmpty || argNodes.tail.isEmpty) {
+      reporter.reportErrorMessage(jsCall, MessageKind.WRONG_ARGUMENT_FOR_JS);
+      return new NativeBehavior();
+    }
+
+    var specArgument = argNodes.head;
+    if (specArgument is! StringNode || specArgument.isInterpolation) {
+      reporter.reportErrorMessage(
+          specArgument, MessageKind.WRONG_ARGUMENT_FOR_JS_FIRST);
+      return new NativeBehavior();
+    }
+
+    var codeArgument = argNodes.tail.head;
+    if (codeArgument is! StringNode || codeArgument.isInterpolation) {
+      reporter.reportErrorMessage(
+          codeArgument, MessageKind.WRONG_ARGUMENT_FOR_JS_SECOND);
+      return new NativeBehavior();
+    }
+
+    String specString = specArgument.dartString.slowToString();
+    String codeString = codeArgument.dartString.slowToString();
+
+    return ofJsCall(specString, codeString, _typeLookup(specArgument, resolver),
+        specArgument, reporter, coreTypes);
+  }
+
+  /// Compute the [NativeBehavior] for a call to the 'JS' function with the
+  /// given [specString] and [codeString] (first and second arguments).
+  static NativeBehavior ofJsCall(
+      String specString,
+      String codeString,
+      TypeLookup lookupType,
+      Spannable spannable,
+      DiagnosticReporter reporter,
+      CoreTypes coreTypes) {
     // The first argument of a JS-call is a string encoding various attributes
     // of the code.
     //
@@ -496,40 +544,9 @@
 
     NativeBehavior behavior = new NativeBehavior();
 
-    var argNodes = jsCall.arguments;
-    if (argNodes.isEmpty || argNodes.tail.isEmpty) {
-      reporter.reportErrorMessage(jsCall, MessageKind.GENERIC,
-          {'text': "JS expression takes two or more arguments."});
-      return behavior;
-    }
-
-    var specArgument = argNodes.head;
-    if (specArgument is! StringNode || specArgument.isInterpolation) {
-      reporter.reportErrorMessage(specArgument, MessageKind.GENERIC,
-          {'text': "JS first argument must be a string literal."});
-      return behavior;
-    }
-
-    var codeArgument = argNodes.tail.head;
-    if (codeArgument is! StringNode || codeArgument.isInterpolation) {
-      reporter.reportErrorMessage(codeArgument, MessageKind.GENERIC,
-          {'text': "JS second argument must be a string literal."});
-      return behavior;
-    }
-
-    behavior.codeTemplateText = codeArgument.dartString.slowToString();
+    behavior.codeTemplateText = codeString;
     behavior.codeTemplate = js.js.parseForeignJS(behavior.codeTemplateText);
 
-    String specString = specArgument.dartString.slowToString();
-
-    dynamic resolveType(String typeString) {
-      return _parseType(
-          typeString,
-          parsing,
-          (name) => resolver.resolveTypeFromString(specArgument, name),
-          specArgument);
-    }
-
     bool sideEffectsAreEncodedInSpecString = false;
 
     void setSideEffects(SideEffects newEffects) {
@@ -551,12 +568,12 @@
       behavior.useGvn = useGvn;
     }
 
-    processSpecString(reporter, specArgument, specString,
+    processSpecString(reporter, spannable, specString,
         setSideEffects: setSideEffects,
         setThrows: setThrows,
         setIsAllocation: setIsAllocation,
         setUseGvn: setUseGvn,
-        resolveType: resolveType,
+        lookupType: lookupType,
         typesReturned: behavior.typesReturned,
         typesInstantiated: behavior.typesInstantiated,
         objectType: coreTypes.objectType,
@@ -576,40 +593,51 @@
 
   static void _fillNativeBehaviorOfBuiltinOrEmbeddedGlobal(
       NativeBehavior behavior,
-      Send jsBuiltinOrEmbeddedGlobalCall,
+      Spannable spannable,
+      String specString,
+      TypeLookup lookupType,
       DiagnosticReporter reporter,
-      ParsingContext parsing,
       CoreTypes coreTypes,
-      ForeignResolver resolver,
-      {bool isBuiltin,
-      List<String> validTags}) {
+      {List<String> validTags}) {
+    void setSideEffects(SideEffects newEffects) {
+      behavior.sideEffects.setTo(newEffects);
+    }
+
+    processSpecString(reporter, spannable, specString,
+        validTags: validTags,
+        lookupType: lookupType,
+        setSideEffects: setSideEffects,
+        typesReturned: behavior.typesReturned,
+        typesInstantiated: behavior.typesInstantiated,
+        objectType: coreTypes.objectType,
+        nullType: coreTypes.nullType);
+  }
+
+  static NativeBehavior ofJsBuiltinCallSend(
+      Send jsBuiltinCall,
+      DiagnosticReporter reporter,
+      CoreTypes coreTypes,
+      ForeignResolver resolver) {
+    NativeBehavior behavior = new NativeBehavior();
+    behavior.sideEffects.setTo(new SideEffects());
+
     // The first argument of a JS-embedded global call is a string encoding
     // the type of the code.
     //
     //  'Type1|Type2'.  A union type.
     //  '=Object'.      A JavaScript Object, no subtype.
 
-    String builtinOrGlobal = isBuiltin ? "builtin" : "embedded global";
-
-    Link<Node> argNodes = jsBuiltinOrEmbeddedGlobalCall.arguments;
+    Link<Node> argNodes = jsBuiltinCall.arguments;
     if (argNodes.isEmpty) {
-      reporter.internalError(jsBuiltinOrEmbeddedGlobalCall,
-          "JS $builtinOrGlobal expression has no type.");
+      reporter.internalError(
+          jsBuiltinCall, "JS builtin expression has no type.");
     }
 
     // We don't check the given name. That needs to be done at a later point.
     // This is, because we want to allow non-literals (like references to
     // enums) as names.
     if (argNodes.tail.isEmpty) {
-      reporter.internalError(jsBuiltinOrEmbeddedGlobalCall,
-          'JS $builtinOrGlobal is missing name.');
-    }
-
-    if (!isBuiltin) {
-      if (!argNodes.tail.tail.isEmpty) {
-        reporter.internalError(argNodes.tail.tail.head,
-            'JS embedded global has more than 2 arguments');
-      }
+      reporter.internalError(jsBuiltinCall, "JS builtin is missing name.");
     }
 
     LiteralString specLiteral = argNodes.head.asLiteralString();
@@ -621,48 +649,26 @@
 
     String specString = specLiteral.dartString.slowToString();
 
-    dynamic resolveType(String typeString) {
-      return _parseType(
-          typeString,
-          parsing,
-          (name) => resolver.resolveTypeFromString(specLiteral, name),
-          jsBuiltinOrEmbeddedGlobalCall);
-    }
-
-    void setSideEffects(SideEffects newEffects) {
-      behavior.sideEffects.setTo(newEffects);
-    }
-
-    processSpecString(reporter, jsBuiltinOrEmbeddedGlobalCall, specString,
-        validTags: validTags,
-        resolveType: resolveType,
-        setSideEffects: setSideEffects,
-        typesReturned: behavior.typesReturned,
-        typesInstantiated: behavior.typesInstantiated,
-        objectType: coreTypes.objectType,
-        nullType: coreTypes.nullType);
+    return ofJsBuiltinCall(specString, _typeLookup(jsBuiltinCall, resolver),
+        jsBuiltinCall, reporter, coreTypes);
   }
 
   static NativeBehavior ofJsBuiltinCall(
-      Send jsBuiltinCall,
+      String specString,
+      TypeLookup lookupType,
+      Spannable spannable,
       DiagnosticReporter reporter,
-      ParsingContext parsing,
-      CoreTypes coreTypes,
-      ForeignResolver resolver) {
+      CoreTypes coreTypes) {
     NativeBehavior behavior = new NativeBehavior();
     behavior.sideEffects.setTo(new SideEffects());
-
     _fillNativeBehaviorOfBuiltinOrEmbeddedGlobal(
-        behavior, jsBuiltinCall, reporter, parsing, coreTypes, resolver,
-        isBuiltin: true);
-
+        behavior, spannable, specString, lookupType, reporter, coreTypes);
     return behavior;
   }
 
-  static NativeBehavior ofJsEmbeddedGlobalCall(
+  static NativeBehavior ofJsEmbeddedGlobalCallSend(
       Send jsEmbeddedGlobalCall,
       DiagnosticReporter reporter,
-      ParsingContext parsing,
       CoreTypes coreTypes,
       ForeignResolver resolver) {
     NativeBehavior behavior = new NativeBehavior();
@@ -672,79 +678,74 @@
     behavior.sideEffects.setTo(new SideEffects.empty());
     behavior.throwBehavior = NativeThrowBehavior.NEVER;
 
+    // The first argument of a JS-embedded global call is a string encoding
+    // the type of the code.
+    //
+    //  'Type1|Type2'.  A union type.
+    //  '=Object'.      A JavaScript Object, no subtype.
+
+    Link<Node> argNodes = jsEmbeddedGlobalCall.arguments;
+    if (argNodes.isEmpty) {
+      reporter.internalError(
+          jsEmbeddedGlobalCall, "JS embedded global expression has no type.");
+    }
+
+    // We don't check the given name. That needs to be done at a later point.
+    // This is, because we want to allow non-literals (like references to
+    // enums) as names.
+    if (argNodes.tail.isEmpty) {
+      reporter.internalError(
+          jsEmbeddedGlobalCall, "JS embedded global is missing name.");
+    }
+
+    if (!argNodes.tail.tail.isEmpty) {
+      reporter.internalError(argNodes.tail.tail.head,
+          'JS embedded global has more than 2 arguments');
+    }
+
+    LiteralString specLiteral = argNodes.head.asLiteralString();
+    if (specLiteral == null) {
+      // TODO(sra): We could accept a type identifier? e.g. JS(bool, '1<2').  It
+      // is not very satisfactory because it does not work for void, dynamic.
+      reporter.internalError(argNodes.head, "Unexpected first argument.");
+    }
+
+    String specString = specLiteral.dartString.slowToString();
+
+    return ofJsEmbeddedGlobalCall(
+        specString,
+        _typeLookup(jsEmbeddedGlobalCall, resolver),
+        jsEmbeddedGlobalCall,
+        reporter,
+        coreTypes);
+  }
+
+  static NativeBehavior ofJsEmbeddedGlobalCall(
+      String specString,
+      TypeLookup lookupType,
+      Spannable spannable,
+      DiagnosticReporter reporter,
+      CoreTypes coreTypes) {
+    NativeBehavior behavior = new NativeBehavior();
+    // TODO(sra): Allow the use site to override these defaults.
+    // Embedded globals are usually pre-computed data structures or JavaScript
+    // functions that never change.
+    behavior.sideEffects.setTo(new SideEffects.empty());
+    behavior.throwBehavior = NativeThrowBehavior.NEVER;
     _fillNativeBehaviorOfBuiltinOrEmbeddedGlobal(
-        behavior, jsEmbeddedGlobalCall, reporter, parsing, coreTypes, resolver,
-        isBuiltin: false, validTags: const ['returns', 'creates']);
-
+        behavior, spannable, specString, lookupType, reporter, coreTypes,
+        validTags: ['returns', 'creates']);
     return behavior;
   }
 
-  static NativeBehavior ofMethod(FunctionElement method, Compiler compiler) {
-    FunctionType type = method.computeType(compiler.resolution);
-    var behavior = new NativeBehavior();
-    var returnType = type.returnType;
-    bool isInterop = compiler.backend.isJsInterop(method);
-    // Note: For dart:html and other internal libraries we maintain, we can
-    // trust the return type and use it to limit what we enqueue. We have to
-    // be more conservative about JS interop types and assume they can return
-    // anything (unless the user provides the experimental flag to trust the
-    // type of js-interop APIs). We do restrict the allocation effects and say
-    // that interop calls create only interop types (which may be unsound if
-    // an interop call returns a DOM type and declares a dynamic return type,
-    // but otherwise we would include a lot of code by default).
-    // TODO(sigmund,sra): consider doing something better for numeric types.
-    behavior.typesReturned.add(
-        !isInterop || compiler.options.trustJSInteropTypeAnnotations
-            ? returnType
-            : const DynamicType());
-    if (!type.returnType.isVoid) {
-      // Declared types are nullable.
-      behavior.typesReturned.add(compiler.coreTypes.nullType);
+  static NativeBehavior ofMethodElement(
+      FunctionElement element, Compiler compiler) {
+    FunctionType type = element.computeType(compiler.resolution);
+    List<ConstantExpression> metadata = <ConstantExpression>[];
+    for (MetadataAnnotation annotation in element.implementation.metadata) {
+      annotation.ensureResolved(compiler.resolution);
+      metadata.add(annotation.constant);
     }
-    behavior._capture(type, compiler.resolution,
-        isInterop: isInterop, compiler: compiler);
-
-    for (DartType type in type.optionalParameterTypes) {
-      behavior._escape(type, compiler.resolution);
-    }
-    for (DartType type in type.namedParameterTypes) {
-      behavior._escape(type, compiler.resolution);
-    }
-
-    behavior._overrideWithAnnotations(method, compiler);
-    return behavior;
-  }
-
-  static NativeBehavior ofFieldLoad(MemberElement field, Compiler compiler) {
-    Resolution resolution = compiler.resolution;
-    DartType type = field.computeType(resolution);
-    var behavior = new NativeBehavior();
-    bool isInterop = compiler.backend.isJsInterop(field);
-    // TODO(sigmund,sra): consider doing something better for numeric types.
-    behavior.typesReturned.add(
-        !isInterop || compiler.options.trustJSInteropTypeAnnotations
-            ? type
-            : const DynamicType());
-    // Declared types are nullable.
-    behavior.typesReturned.add(resolution.coreTypes.nullType);
-    behavior._capture(type, resolution,
-        isInterop: isInterop, compiler: compiler);
-    behavior._overrideWithAnnotations(field, compiler);
-    return behavior;
-  }
-
-  static NativeBehavior ofFieldStore(MemberElement field, Compiler compiler) {
-    Resolution resolution = compiler.resolution;
-    DartType type = field.computeType(resolution);
-    var behavior = new NativeBehavior();
-    behavior._escape(type, resolution);
-    // We don't override the default behaviour - the annotations apply to
-    // loading the field.
-    return behavior;
-  }
-
-  void _overrideWithAnnotations(Element element, Compiler compiler) {
-    if (element.implementation.metadata.isEmpty) return;
 
     DartType lookup(String name) {
       Element e = element.buildScope().lookup(name);
@@ -755,11 +756,123 @@
       return cls.thisType;
     }
 
+    return ofMethod(element, type, metadata, lookup, compiler,
+        isJsInterop: compiler.backend.isJsInterop(element));
+  }
+
+  static NativeBehavior ofMethod(
+      Spannable spannable,
+      FunctionType type,
+      List<ConstantExpression> metadata,
+      TypeLookup lookupType,
+      Compiler compiler,
+      {bool isJsInterop}) {
+    var behavior = new NativeBehavior();
+    var returnType = type.returnType;
+    // Note: For dart:html and other internal libraries we maintain, we can
+    // trust the return type and use it to limit what we enqueue. We have to
+    // be more conservative about JS interop types and assume they can return
+    // anything (unless the user provides the experimental flag to trust the
+    // type of js-interop APIs). We do restrict the allocation effects and say
+    // that interop calls create only interop types (which may be unsound if
+    // an interop call returns a DOM type and declares a dynamic return type,
+    // but otherwise we would include a lot of code by default).
+    // TODO(sigmund,sra): consider doing something better for numeric types.
+    behavior.typesReturned.add(
+        !isJsInterop || compiler.options.trustJSInteropTypeAnnotations
+            ? returnType
+            : const DynamicType());
+    if (!type.returnType.isVoid) {
+      // Declared types are nullable.
+      behavior.typesReturned.add(compiler.coreTypes.nullType);
+    }
+    behavior._capture(type, compiler.resolution,
+        isInterop: isJsInterop, compiler: compiler);
+
+    for (DartType type in type.optionalParameterTypes) {
+      behavior._escape(type, compiler.resolution);
+    }
+    for (DartType type in type.namedParameterTypes) {
+      behavior._escape(type, compiler.resolution);
+    }
+
+    behavior._overrideWithAnnotations(
+        spannable, metadata, lookupType, compiler);
+    return behavior;
+  }
+
+  static NativeBehavior ofFieldElementLoad(
+      MemberElement element, Compiler compiler) {
+    Resolution resolution = compiler.resolution;
+    DartType type = element.computeType(resolution);
+    List<ConstantExpression> metadata = <ConstantExpression>[];
+    for (MetadataAnnotation annotation in element.implementation.metadata) {
+      annotation.ensureResolved(compiler.resolution);
+      metadata.add(annotation.constant);
+    }
+
+    DartType lookup(String name) {
+      Element e = element.buildScope().lookup(name);
+      if (e == null) return null;
+      if (e is! ClassElement) return null;
+      ClassElement cls = e;
+      cls.ensureResolved(compiler.resolution);
+      return cls.thisType;
+    }
+
+    return ofFieldLoad(element, type, metadata, lookup, compiler,
+        isJsInterop: compiler.backend.isJsInterop(element));
+  }
+
+  static NativeBehavior ofFieldLoad(
+      Spannable spannable,
+      DartType type,
+      List<ConstantExpression> metadata,
+      TypeLookup lookupType,
+      Compiler compiler,
+      {bool isJsInterop}) {
+    Resolution resolution = compiler.resolution;
+    var behavior = new NativeBehavior();
+    // TODO(sigmund,sra): consider doing something better for numeric types.
+    behavior.typesReturned.add(
+        !isJsInterop || compiler.options.trustJSInteropTypeAnnotations
+            ? type
+            : const DynamicType());
+    // Declared types are nullable.
+    behavior.typesReturned.add(resolution.coreTypes.nullType);
+    behavior._capture(type, resolution,
+        isInterop: isJsInterop, compiler: compiler);
+    behavior._overrideWithAnnotations(
+        spannable, metadata, lookupType, compiler);
+    return behavior;
+  }
+
+  static NativeBehavior ofFieldElementStore(
+      MemberElement field, Resolution resolution) {
+    DartType type = field.computeType(resolution);
+    return ofFieldStore(type, resolution);
+  }
+
+  static NativeBehavior ofFieldStore(DartType type, Resolution resolution) {
+    var behavior = new NativeBehavior();
+    behavior._escape(type, resolution);
+    // We don't override the default behaviour - the annotations apply to
+    // loading the field.
+    return behavior;
+  }
+
+  void _overrideWithAnnotations(
+      Spannable spannable,
+      Iterable<ConstantExpression> metadata,
+      TypeLookup lookupType,
+      Compiler compiler) {
+    if (metadata.isEmpty) return;
+
     NativeEnqueuer enqueuer = compiler.enqueuer.resolution.nativeEnqueuer;
-    var creates =
-        _collect(element, compiler, enqueuer.annotationCreatesClass, lookup);
-    var returns =
-        _collect(element, compiler, enqueuer.annotationReturnsClass, lookup);
+    var creates = _collect(spannable, metadata, compiler,
+        enqueuer.annotationCreatesClass, lookupType);
+    var returns = _collect(spannable, metadata, compiler,
+        enqueuer.annotationReturnsClass, lookupType);
 
     if (creates != null) {
       typesInstantiated
@@ -778,14 +891,12 @@
    * [annotationClass].
    * Returns `null` if no constraints.
    */
-  static _collect(Element element, Compiler compiler, Element annotationClass,
-      lookup(str)) {
+  static _collect(Spannable spannable, Iterable<ConstantExpression> metadata,
+      Compiler compiler, Element annotationClass, TypeLookup lookupType) {
     DiagnosticReporter reporter = compiler.reporter;
     var types = null;
-    for (MetadataAnnotation annotation in element.implementation.metadata) {
-      annotation.ensureResolved(compiler.resolution);
-      ConstantValue value =
-          compiler.constants.getConstantValue(annotation.constant);
+    for (ConstantExpression constant in metadata) {
+      ConstantValue value = compiler.constants.getConstantValue(constant);
       if (!value.isConstructedObject) continue;
       ConstructedConstantValue constructedObject = value;
       if (constructedObject.type.element != annotationClass) continue;
@@ -793,14 +904,13 @@
       Iterable<ConstantValue> fields = constructedObject.fields.values;
       // TODO(sra): Better validation of the constant.
       if (fields.length != 1 || !fields.single.isString) {
-        reporter.internalError(
-            annotation, 'Annotations needs one string: ${annotation.node}');
+        reporter.internalError(spannable,
+            'Annotations needs one string: ${constant.toStructuredText()}');
       }
       StringConstantValue specStringConstant = fields.single;
       String specString = specStringConstant.toDartString().slowToString();
       for (final typeString in specString.split('|')) {
-        var type =
-            _parseType(typeString, compiler.parsingContext, lookup, annotation);
+        var type = _parseType(typeString, spannable, reporter, lookupType);
         if (types == null) types = [];
         types.add(type);
       }
@@ -874,34 +984,28 @@
     }
   }
 
-  static dynamic _parseType(String typeString, ParsingContext parsing,
-      lookup(name), locationNodeOrElement) {
-    DiagnosticReporter reporter = parsing.reporter;
+  static dynamic /*DartType|SpecialType*/ _parseType(String typeString,
+      Spannable spannable, DiagnosticReporter reporter, TypeLookup lookupType) {
     if (typeString == '=Object') return SpecialType.JsObject;
     if (typeString == 'dynamic') {
       return const DynamicType();
     }
-    var type = lookup(typeString);
+    var type = lookupType(typeString);
     if (type != null) return type;
 
     int index = typeString.indexOf('<');
     if (index < 1) {
-      reporter.reportErrorMessage(_errorNode(locationNodeOrElement, parsing),
-          MessageKind.GENERIC, {'text': "Type '$typeString' not found."});
+      reporter.reportErrorMessage(spannable, MessageKind.GENERIC,
+          {'text': "Type '$typeString' not found."});
       return const DynamicType();
     }
-    type = lookup(typeString.substring(0, index));
+    type = lookupType(typeString.substring(0, index));
     if (type != null) {
       // TODO(sra): Parse type parameters.
       return type;
     }
-    reporter.reportErrorMessage(_errorNode(locationNodeOrElement, parsing),
-        MessageKind.GENERIC, {'text': "Type '$typeString' not found."});
+    reporter.reportErrorMessage(spannable, MessageKind.GENERIC,
+        {'text': "Type '$typeString' not found."});
     return const DynamicType();
   }
-
-  static _errorNode(locationNodeOrElement, ParsingContext parsing) {
-    if (locationNodeOrElement is Node) return locationNodeOrElement;
-    return locationNodeOrElement.parseNode(parsing);
-  }
 }
diff --git a/pkg/compiler/lib/src/native/enqueue.dart b/pkg/compiler/lib/src/native/enqueue.dart
index 8e2d48b..300a650 100644
--- a/pkg/compiler/lib/src/native/enqueue.dart
+++ b/pkg/compiler/lib/src/native/enqueue.dart
@@ -6,7 +6,6 @@
 
 import '../common.dart';
 import '../common/backend_api.dart' show ForeignResolver;
-import '../common/registry.dart' show Registry;
 import '../common/resolution.dart' show Resolution;
 import '../compiler.dart' show Compiler;
 import '../constants/values.dart';
@@ -14,25 +13,32 @@
 import '../dart_types.dart';
 import '../elements/elements.dart';
 import '../elements/modelx.dart' show FunctionElementX;
-import '../enqueue.dart' show Enqueuer;
 import '../js_backend/backend_helpers.dart' show BackendHelpers;
 import '../js_backend/js_backend.dart';
 import '../js_emitter/js_emitter.dart' show CodeEmitterTask, NativeEmitter;
 import '../tokens/token.dart' show BeginGroupToken, Token;
 import '../tokens/token_constants.dart' as Tokens show EOF_TOKEN;
 import '../tree/tree.dart';
+import '../universe/use.dart' show StaticUse, TypeUse;
+import '../universe/world_impact.dart'
+    show WorldImpact, WorldImpactBuilder, WorldImpactBuilderImpl;
 import 'behavior.dart';
 
 /**
  * This could be an abstract class but we use it as a stub for the dart_backend.
  */
 class NativeEnqueuer {
+  /// Called when a [type] has been instantiated natively.
+  void onInstantiatedType(InterfaceType type) {}
+
   /// Initial entry point to native enqueuer.
-  void processNativeClasses(Iterable<LibraryElement> libraries) {}
+  WorldImpact processNativeClasses(Iterable<LibraryElement> libraries) =>
+      const WorldImpact();
 
   /// Registers the [nativeBehavior]. Adds the liveness of its instantiated
   /// types to the world.
-  void registerNativeBehavior(NativeBehavior nativeBehavior, cause) {}
+  void registerNativeBehavior(
+      WorldImpactBuilder impactBuilder, NativeBehavior nativeBehavior, cause) {}
 
   // TODO(johnniwinther): Move [handleFieldAnnotations] and
   // [handleMethodAnnotations] to [JavaScriptBackend] or [NativeData].
@@ -61,37 +67,19 @@
 abstract class NativeEnqueuerBase implements NativeEnqueuer {
   static final RegExp _identifier = new RegExp(r'^[a-zA-Z_$][a-zA-Z0-9_$]*$');
 
-  /**
-   * The set of all native classes.  Each native class is in [nativeClasses] and
-   * exactly one of [unusedClasses], [pendingClasses] and [registeredClasses].
-   */
-  final Set<ClassElement> nativeClasses = new Set<ClassElement>();
+  /// The set of all native classes.  Each native class is in [nativeClasses]
+  /// and exactly one of [unusedClasses] and [registeredClasses].
+  final Set<ClassElement> _nativeClasses = new Set<ClassElement>();
 
-  final Set<ClassElement> registeredClasses = new Set<ClassElement>();
-  final Set<ClassElement> pendingClasses = new Set<ClassElement>();
-  final Set<ClassElement> unusedClasses = new Set<ClassElement>();
+  final Set<ClassElement> _registeredClasses = new Set<ClassElement>();
+  final Set<ClassElement> _unusedClasses = new Set<ClassElement>();
 
   final Set<LibraryElement> processedLibraries;
 
-  bool get hasInstantiatedNativeClasses => !registeredClasses.isEmpty;
+  bool get hasInstantiatedNativeClasses => !_registeredClasses.isEmpty;
 
   final Set<ClassElement> nativeClassesAndSubclasses = new Set<ClassElement>();
 
-  final Map<ClassElement, Set<ClassElement>> nonNativeSubclasses =
-      new Map<ClassElement, Set<ClassElement>>();
-
-  /**
-   * Records matched constraints ([SpecialType] or [DartType]).  Once a type
-   * constraint has been matched, there is no need to match it again.
-   */
-  final Set matchedTypeConstraints = new Set();
-
-  /// Pending actions.  Classes in [pendingClasses] have action thunks in
-  /// [queue] to register the class.
-  final queue = new Queue();
-  bool flushing = false;
-
-  final Enqueuer world;
   final Compiler compiler;
   final bool enableLiveTypeAnalysis;
 
@@ -100,7 +88,7 @@
   ClassElement _annotationJsNameClass;
 
   /// Subclasses of [NativeEnqueuerBase] are constructed by the backend.
-  NativeEnqueuerBase(this.world, Compiler compiler, this.enableLiveTypeAnalysis)
+  NativeEnqueuerBase(Compiler compiler, this.enableLiveTypeAnalysis)
       : this.compiler = compiler,
         processedLibraries = compiler.cacheStrategy.newSet();
 
@@ -111,7 +99,20 @@
   DiagnosticReporter get reporter => compiler.reporter;
   CoreTypes get coreTypes => compiler.coreTypes;
 
-  void processNativeClasses(Iterable<LibraryElement> libraries) {
+  void onInstantiatedType(InterfaceType type) {
+    if (_unusedClasses.remove(type.element)) {
+      _registeredClasses.add(type.element);
+    }
+  }
+
+  WorldImpact processNativeClasses(Iterable<LibraryElement> libraries) {
+    WorldImpactBuilderImpl impactBuilder = new WorldImpactBuilderImpl();
+    _processNativeClasses(impactBuilder, libraries);
+    return impactBuilder;
+  }
+
+  void _processNativeClasses(
+      WorldImpactBuilder impactBuilder, Iterable<LibraryElement> libraries) {
     if (compiler.options.hasIncrementalSupport) {
       // Since [Set.add] returns bool if an element was added, this restricts
       // [libraries] to ones that haven't already been processed. This saves
@@ -124,8 +125,7 @@
     }
     processSubclassesOfNativeClasses(libraries);
     if (!enableLiveTypeAnalysis) {
-      nativeClasses.forEach((c) => enqueueClass(c, 'forced'));
-      flushQueue();
+      _registerTypeUses(impactBuilder, _nativeClasses, 'forced');
     }
   }
 
@@ -139,8 +139,8 @@
   }
 
   void processNativeClass(ClassElement classElement) {
-    nativeClasses.add(classElement);
-    unusedClasses.add(classElement);
+    _nativeClasses.add(classElement);
+    _unusedClasses.add(classElement);
     // Resolve class to ensure the class has valid inheritance info.
     classElement.ensureResolved(resolution);
   }
@@ -183,11 +183,6 @@
       ClassElement nativeSuperclass = nativeSuperclassOf(element);
       if (nativeSuperclass != null) {
         nativeClassesAndSubclasses.add(element);
-        if (!backend.isNative(element)) {
-          nonNativeSubclasses
-              .putIfAbsent(nativeSuperclass, () => new Set<ClassElement>())
-              .add(element);
-        }
         Set<ClassElement> potentialSubclasses = potentialExtends[element.name];
         if (potentialSubclasses != null) {
           potentialSubclasses.forEach(walkPotentialSubclasses);
@@ -195,10 +190,10 @@
       }
     }
 
-    nativeClasses.forEach(walkPotentialSubclasses);
+    _nativeClasses.forEach(walkPotentialSubclasses);
 
-    nativeClasses.addAll(nativeClassesAndSubclasses);
-    unusedClasses.addAll(nativeClassesAndSubclasses);
+    _nativeClasses.addAll(nativeClassesAndSubclasses);
+    _unusedClasses.addAll(nativeClassesAndSubclasses);
   }
 
   /**
@@ -333,40 +328,19 @@
     return name;
   }
 
-  enqueueClass(ClassElement classElement, cause) {
-    assert(unusedClasses.contains(classElement));
-    unusedClasses.remove(classElement);
-    pendingClasses.add(classElement);
-    queue.add(() {
-      processClass(classElement, cause);
-    });
-  }
-
-  void flushQueue() {
-    if (flushing) return;
-    flushing = true;
-    while (!queue.isEmpty) {
-      (queue.removeFirst())();
-    }
-    flushing = false;
-  }
-
-  processClass(ClassElement classElement, cause) {
-    // TODO(ahe): Fix this assertion to work in incremental compilation.
-    assert(compiler.options.hasIncrementalSupport ||
-        !registeredClasses.contains(classElement));
-
-    bool firstTime = registeredClasses.isEmpty;
-    pendingClasses.remove(classElement);
-    registeredClasses.add(classElement);
-
-    // TODO(ahe): Is this really a global dependency?
-    classElement.ensureResolved(resolution);
-    compiler.backend.registerInstantiatedType(
-        classElement.rawType, world, compiler.globalDependencies);
-
-    if (firstTime) {
-      queue.add(onFirstNativeClass);
+  /// Register [classes] as natively instantiated in [impactBuilder].
+  void _registerTypeUses(
+      WorldImpactBuilder impactBuilder, Set<ClassElement> classes, cause) {
+    for (ClassElement cls in classes) {
+      if (!_unusedClasses.contains(cls)) {
+        // No need to add [classElement] to [impactBuilder]: it has already been
+        // instantiated and we don't track origins of native instantiations
+        // precisely.
+        continue;
+      }
+      cls.ensureResolved(resolution);
+      impactBuilder
+          .registerTypeUse(new TypeUse.nativeInstantiation(cls.rawType));
     }
   }
 
@@ -449,43 +423,43 @@
     });
   }
 
-  void registerNativeBehavior(NativeBehavior nativeBehavior, cause) {
-    processNativeBehavior(nativeBehavior, cause);
-    flushQueue();
+  void registerNativeBehavior(
+      WorldImpactBuilder impactBuilder, NativeBehavior nativeBehavior, cause) {
+    _processNativeBehavior(impactBuilder, nativeBehavior, cause);
   }
 
-  processNativeBehavior(NativeBehavior behavior, cause) {
-    // TODO(ahe): Is this really a global dependency?
-    Registry registry = compiler.globalDependencies;
-    bool allUsedBefore = unusedClasses.isEmpty;
+  void _processNativeBehavior(
+      WorldImpactBuilder impactBuilder, NativeBehavior behavior, cause) {
+    void registerInstantiation(InterfaceType type) {
+      impactBuilder.registerTypeUse(new TypeUse.nativeInstantiation(type));
+    }
+
+    int unusedBefore = _unusedClasses.length;
+    Set<ClassElement> matchingClasses = new Set<ClassElement>();
     for (var type in behavior.typesInstantiated) {
-      if (matchedTypeConstraints.contains(type)) continue;
-      matchedTypeConstraints.add(type);
       if (type is SpecialType) {
         if (type == SpecialType.JsObject) {
-          backend.registerInstantiatedType(
-              compiler.coreTypes.objectType, world, registry);
+          registerInstantiation(compiler.coreTypes.objectType);
         }
         continue;
       }
       if (type is InterfaceType) {
         if (type == coreTypes.intType) {
-          backend.registerInstantiatedType(type, world, registry);
+          registerInstantiation(type);
         } else if (type == coreTypes.doubleType) {
-          backend.registerInstantiatedType(type, world, registry);
+          registerInstantiation(type);
         } else if (type == coreTypes.numType) {
-          backend.registerInstantiatedType(
-              coreTypes.doubleType, world, registry);
-          backend.registerInstantiatedType(coreTypes.intType, world, registry);
+          registerInstantiation(coreTypes.doubleType);
+          registerInstantiation(coreTypes.intType);
         } else if (type == coreTypes.stringType) {
-          backend.registerInstantiatedType(type, world, registry);
+          registerInstantiation(type);
         } else if (type == coreTypes.nullType) {
-          backend.registerInstantiatedType(type, world, registry);
+          registerInstantiation(type);
         } else if (type == coreTypes.boolType) {
-          backend.registerInstantiatedType(type, world, registry);
+          registerInstantiation(type);
         } else if (compiler.types.isSubtype(
             type, backend.backendClasses.listImplementation.rawType)) {
-          backend.registerInstantiatedType(type, world, registry);
+          registerInstantiation(type);
         }
         // TODO(johnniwinther): Improve spec string precision to handle type
         // arguments and implements relations that preserve generics. Currently
@@ -494,60 +468,66 @@
         // any native subclasses of generic classes.
         // TODO(johnniwinther,sra): Find and replace uses of `List` with the
         // actual implementation classes such as `JSArray` et al.
-        enqueueUnusedClassesMatching((ClassElement nativeClass) {
+        matchingClasses
+            .addAll(_findUnusedClassesMatching((ClassElement nativeClass) {
           InterfaceType nativeType = nativeClass.thisType;
           InterfaceType specType = type.element.thisType;
           return compiler.types.isSubtype(nativeType, specType);
-        }, cause, 'subtypeof($type)');
+        }));
       } else if (type.isDynamic) {
-        enqueueUnusedClassesMatching((_) => true, cause, 'subtypeof($type)');
+        matchingClasses.addAll(_unusedClasses);
       } else {
         assert(type is VoidType);
       }
     }
+    if (matchingClasses.isNotEmpty && _registeredClasses.isEmpty) {
+      matchingClasses.addAll(_onFirstNativeClass(impactBuilder));
+    }
+    _registerTypeUses(impactBuilder, matchingClasses, cause);
 
     // Give an info so that library developers can compile with -v to find why
     // all the native classes are included.
-    if (unusedClasses.isEmpty && !allUsedBefore) {
+    if (unusedBefore == matchingClasses.length) {
       reporter.log('All native types marked as used due to $cause.');
     }
   }
 
-  enqueueUnusedClassesMatching(bool predicate(classElement), cause,
-      [String reason]) {
-    Iterable matches = unusedClasses.where(predicate);
-    matches.toList().forEach((c) => enqueueClass(c, cause));
+  Iterable<ClassElement> _findUnusedClassesMatching(
+      bool predicate(classElement)) {
+    return _unusedClasses.where(predicate);
   }
 
-  onFirstNativeClass() {
-    staticUse(name) {
-      backend.enqueue(
-          world, helpers.findHelper(name), compiler.globalDependencies);
+  Iterable<ClassElement> _onFirstNativeClass(WorldImpactBuilder impactBuilder) {
+    void staticUse(name) {
+      Element element = helpers.findHelper(name);
+      impactBuilder.registerStaticUse(new StaticUse.foreignUse(element));
+      backend.registerBackendUse(element);
+      compiler.globalDependencies.registerDependency(element);
     }
 
     staticUse('defineProperty');
     staticUse('toStringForNativeObject');
     staticUse('hashCodeForNativeObject');
     staticUse('convertDartClosureToJS');
-    addNativeExceptions();
+    return _findNativeExceptions();
   }
 
-  addNativeExceptions() {
-    enqueueUnusedClassesMatching((classElement) {
+  Iterable<ClassElement> _findNativeExceptions() {
+    return _findUnusedClassesMatching((classElement) {
       // TODO(sra): Annotate exception classes in dart:html.
       String name = classElement.name;
       if (name.contains('Exception')) return true;
       if (name.contains('Error')) return true;
       return false;
-    }, 'native exception');
+    });
   }
 }
 
 class NativeResolutionEnqueuer extends NativeEnqueuerBase {
   Map<String, ClassElement> tagOwner = new Map<String, ClassElement>();
 
-  NativeResolutionEnqueuer(Enqueuer world, Compiler compiler)
-      : super(world, compiler, compiler.options.enableNativeLiveTypeAnalysis);
+  NativeResolutionEnqueuer(Compiler compiler)
+      : super(compiler, compiler.options.enableNativeLiveTypeAnalysis);
 
   void processNativeClass(ClassElement classElement) {
     super.processNativeClass(classElement);
@@ -570,8 +550,8 @@
   }
 
   void logSummary(log(message)) {
-    log('Resolved ${registeredClasses.length} native elements used, '
-        '${unusedClasses.length} native elements dead.');
+    log('Resolved ${_registeredClasses.length} native elements used, '
+        '${_unusedClasses.length} native elements dead.');
   }
 
   /**
@@ -584,7 +564,7 @@
    *
    */
   NativeBehavior resolveJsCall(Send node, ForeignResolver resolver) {
-    return NativeBehavior.ofJsCall(
+    return NativeBehavior.ofJsCallSend(
         node, reporter, compiler.parsingContext, compiler.coreTypes, resolver);
   }
 
@@ -599,8 +579,8 @@
    */
   NativeBehavior resolveJsEmbeddedGlobalCall(
       Send node, ForeignResolver resolver) {
-    return NativeBehavior.ofJsEmbeddedGlobalCall(
-        node, reporter, compiler.parsingContext, compiler.coreTypes, resolver);
+    return NativeBehavior.ofJsEmbeddedGlobalCallSend(
+        node, reporter, compiler.coreTypes, resolver);
   }
 
   /**
@@ -613,8 +593,8 @@
    *
    */
   NativeBehavior resolveJsBuiltinCall(Send node, ForeignResolver resolver) {
-    return NativeBehavior.ofJsBuiltinCall(
-        node, reporter, compiler.parsingContext, compiler.coreTypes, resolver);
+    return NativeBehavior.ofJsBuiltinCallSend(
+        node, reporter, compiler.coreTypes, resolver);
   }
 }
 
@@ -623,37 +603,46 @@
 
   final Set<ClassElement> doneAddSubtypes = new Set<ClassElement>();
 
-  NativeCodegenEnqueuer(Enqueuer world, Compiler compiler, this.emitter)
-      : super(world, compiler, compiler.options.enableNativeLiveTypeAnalysis);
+  NativeCodegenEnqueuer(Compiler compiler, this.emitter)
+      : super(compiler, compiler.options.enableNativeLiveTypeAnalysis);
 
-  void processNativeClasses(Iterable<LibraryElement> libraries) {
-    super.processNativeClasses(libraries);
+  void _processNativeClasses(
+      WorldImpactBuilder impactBuilder, Iterable<LibraryElement> libraries) {
+    super._processNativeClasses(impactBuilder, libraries);
 
     // HACK HACK - add all the resolved classes.
     NativeEnqueuerBase enqueuer = compiler.enqueuer.resolution.nativeEnqueuer;
-    for (final classElement in enqueuer.registeredClasses) {
-      if (unusedClasses.contains(classElement)) {
-        enqueueClass(classElement, 'was resolved');
+    Set<ClassElement> matchingClasses = new Set<ClassElement>();
+    for (final classElement in enqueuer._registeredClasses) {
+      if (_unusedClasses.contains(classElement)) {
+        matchingClasses.add(classElement);
       }
     }
-    flushQueue();
+    if (matchingClasses.isNotEmpty && _registeredClasses.isEmpty) {
+      matchingClasses.addAll(_onFirstNativeClass(impactBuilder));
+    }
+    _registerTypeUses(impactBuilder, matchingClasses, 'was resolved');
   }
 
-  processClass(ClassElement classElement, cause) {
-    super.processClass(classElement, cause);
-    // Add the information that this class is a subtype of its supertypes.  The
-    // code emitter and the ssa builder use that information.
-    addSubtypes(classElement, emitter.nativeEmitter);
+  void _registerTypeUses(
+      WorldImpactBuilder impactBuilder, Set<ClassElement> classes, cause) {
+    super._registerTypeUses(impactBuilder, classes, cause);
+
+    for (ClassElement classElement in classes) {
+      // Add the information that this class is a subtype of its supertypes. The
+      // code emitter and the ssa builder use that information.
+      _addSubtypes(classElement, emitter.nativeEmitter);
+    }
   }
 
-  void addSubtypes(ClassElement cls, NativeEmitter emitter) {
+  void _addSubtypes(ClassElement cls, NativeEmitter emitter) {
     if (!backend.isNative(cls)) return;
     if (doneAddSubtypes.contains(cls)) return;
     doneAddSubtypes.add(cls);
 
     // Walk the superclass chain since classes on the superclass chain might not
     // be instantiated (abstract or simply unused).
-    addSubtypes(cls.superclass, emitter);
+    _addSubtypes(cls.superclass, emitter);
 
     for (DartType type in cls.allSupertypes) {
       List<Element> subtypes =
@@ -676,7 +665,7 @@
   }
 
   void logSummary(log(message)) {
-    log('Compiled ${registeredClasses.length} native classes, '
-        '${unusedClasses.length} native classes omitted.');
+    log('Compiled ${_registeredClasses.length} native classes, '
+        '${_unusedClasses.length} native classes omitted.');
   }
 }
diff --git a/pkg/compiler/lib/src/options.dart b/pkg/compiler/lib/src/options.dart
index 0b54370..70594dc 100644
--- a/pkg/compiler/lib/src/options.dart
+++ b/pkg/compiler/lib/src/options.dart
@@ -7,18 +7,6 @@
 import '../compiler.dart' show PackagesDiscoveryProvider;
 import 'commandline_options.dart' show Flags;
 
-/// Options used for parsing.
-///
-/// Use this to conditionally support certain constructs, e.g.,
-/// experimental ones.
-abstract class ParserOptions {
-  const ParserOptions();
-
-  /// Support parsing of generic method declarations, and invocations of
-  /// methods where type arguments are passed.
-  bool get enableGenericMethodSyntax;
-}
-
 /// Options used for controlling diagnostic messages.
 abstract class DiagnosticOptions {
   const DiagnosticOptions();
@@ -48,7 +36,7 @@
 /// Object for passing options to the compiler. Superclasses are used to select
 /// subsets of these options, enabling each part of the compiler to depend on
 /// as few as possible.
-class CompilerOptions implements DiagnosticOptions, ParserOptions {
+class CompilerOptions implements DiagnosticOptions {
   /// The entry point of the application that is being compiled.
   final Uri entryPoint;
 
@@ -145,14 +133,6 @@
   /// reason for why an assertion fails. (experimental)
   final bool enableAssertMessage;
 
-  /// Support parsing of generic method declarations, and invocations of
-  /// methods where type arguments are passed.
-  final bool enableGenericMethodSyntax;
-
-  /// Support access to initializing formal constructor arguments, e.g., the
-  /// use of `x` to initialize `y` in `C(this.x) : y = x`.
-  final bool enableInitializingFormalAccess;
-
   /// Whether the user specified a flag to allow the use of dart:mirrors. This
   /// silences a warning produced by the compiler.
   final bool enableExperimentalMirrors;
@@ -197,10 +177,10 @@
   /// The location of the serialized data from resolution.
   final Uri resolutionOutput;
 
-  // If `true`, sources are resolved and serialized.
+  /// If `true`, sources are resolved and serialized.
   final bool resolveOnly;
 
-  // If `true`, sources are only available from serialized data.
+  /// If `true`, sources are only available from serialized data.
   final bool compileOnly;
 
   /// URI where the compiler should generate the output source map file.
@@ -288,10 +268,6 @@
         disableTypeInference: _hasOption(options, Flags.disableTypeInference),
         dumpInfo: _hasOption(options, Flags.dumpInfo),
         enableAssertMessage: _hasOption(options, Flags.enableAssertMessage),
-        enableGenericMethodSyntax:
-            _hasOption(options, Flags.genericMethodSyntax),
-        enableInitializingFormalAccess:
-            _hasOption(options, Flags.initializingFormalAccess),
         enableExperimentalMirrors:
             _hasOption(options, Flags.enableExperimentalMirrors),
         enableMinification: _hasOption(options, Flags.minify),
@@ -358,8 +334,6 @@
       bool disableTypeInference: false,
       bool dumpInfo: false,
       bool enableAssertMessage: false,
-      bool enableGenericMethodSyntax: false,
-      bool enableInitializingFormalAccess: false,
       bool enableExperimentalMirrors: false,
       bool enableMinification: false,
       bool enableNativeLiveTypeAnalysis: true,
@@ -430,8 +404,6 @@
         disableTypeInference: disableTypeInference,
         dumpInfo: dumpInfo,
         enableAssertMessage: enableAssertMessage,
-        enableGenericMethodSyntax: enableGenericMethodSyntax,
-        enableInitializingFormalAccess: enableInitializingFormalAccess,
         enableExperimentalMirrors: enableExperimentalMirrors,
         enableMinification: enableMinification,
         enableNativeLiveTypeAnalysis: enableNativeLiveTypeAnalysis,
@@ -481,8 +453,6 @@
       this.disableTypeInference: false,
       this.dumpInfo: false,
       this.enableAssertMessage: false,
-      this.enableGenericMethodSyntax: false,
-      this.enableInitializingFormalAccess: false,
       this.enableExperimentalMirrors: false,
       this.enableMinification: false,
       this.enableNativeLiveTypeAnalysis: false,
@@ -539,8 +509,6 @@
       disableTypeInference,
       dumpInfo,
       enableAssertMessage,
-      enableGenericMethodSyntax,
-      enableInitializingFormalAccess,
       enableExperimentalMirrors,
       enableMinification,
       enableNativeLiveTypeAnalysis,
@@ -598,10 +566,6 @@
             disableTypeInference ?? options.disableTypeInference,
         dumpInfo: dumpInfo ?? options.dumpInfo,
         enableAssertMessage: enableAssertMessage ?? options.enableAssertMessage,
-        enableGenericMethodSyntax:
-            enableGenericMethodSyntax ?? options.enableGenericMethodSyntax,
-        enableInitializingFormalAccess: enableInitializingFormalAccess ??
-            options.enableInitializingFormalAccess,
         enableExperimentalMirrors:
             enableExperimentalMirrors ?? options.enableExperimentalMirrors,
         enableMinification: enableMinification ?? options.enableMinification,
diff --git a/pkg/compiler/lib/src/ordered_typeset.dart b/pkg/compiler/lib/src/ordered_typeset.dart
index e3cffb5..4e37362 100644
--- a/pkg/compiler/lib/src/ordered_typeset.dart
+++ b/pkg/compiler/lib/src/ordered_typeset.dart
@@ -94,7 +94,9 @@
       Link<DartType> pointer = _levels[level];
       Link<DartType> end =
           level > 0 ? _levels[level - 1] : const Link<DartType>();
-      while (!identical(pointer, end)) {
+      // TODO(het): checking `isNotEmpty` should be unnecessary, remove when
+      // constants are properly canonicalized
+      while (pointer.isNotEmpty && !identical(pointer, end)) {
         f(pointer.head);
         pointer = pointer.tail;
       }
@@ -107,7 +109,9 @@
       Link<DartType> pointer = _levels[level];
       Link<DartType> end =
           level > 0 ? _levels[level - 1] : const Link<DartType>();
-      while (!identical(pointer, end)) {
+      // TODO(het): checking `isNotEmpty` should be unnecessary, remove when
+      // constants are properly canonicalized
+      while (pointer.isNotEmpty && !identical(pointer, end)) {
         if (cls == pointer.head.element) {
           return pointer.head;
         }
diff --git a/pkg/compiler/lib/src/parser/class_element_parser.dart b/pkg/compiler/lib/src/parser/class_element_parser.dart
index 3d3cd27..851873a 100644
--- a/pkg/compiler/lib/src/parser/class_element_parser.dart
+++ b/pkg/compiler/lib/src/parser/class_element_parser.dart
@@ -4,14 +4,12 @@
 
 library dart2js.parser.classes;
 
-import '../options.dart' show ParserOptions;
 import '../tokens/token.dart' show Token;
 import 'listener.dart' show Listener;
 import 'partial_parser.dart' show PartialParser;
 
 class ClassElementParser extends PartialParser {
-  ClassElementParser(Listener listener, ParserOptions options)
-      : super(listener, options);
+  ClassElementParser(Listener listener): super(listener);
 
   Token parseClassBody(Token token) => fullParseClassBody(token);
 }
diff --git a/pkg/compiler/lib/src/parser/diet_parser_task.dart b/pkg/compiler/lib/src/parser/diet_parser_task.dart
index 002bba0..e975a83 100644
--- a/pkg/compiler/lib/src/parser/diet_parser_task.dart
+++ b/pkg/compiler/lib/src/parser/diet_parser_task.dart
@@ -9,20 +9,18 @@
 import '../common/tasks.dart' show CompilerTask, Measurer;
 import '../elements/elements.dart' show CompilationUnitElement;
 import '../id_generator.dart';
-import '../options.dart' show ParserOptions;
 import '../tokens/token.dart' show Token;
 import 'element_listener.dart' show ElementListener, ScannerOptions;
 import 'listener.dart' show ParserError;
 import 'partial_parser.dart' show PartialParser;
 
 class DietParserTask extends CompilerTask {
-  final ParserOptions _parserOptions;
   final IdGenerator _idGenerator;
   final Backend _backend;
   final DiagnosticReporter _reporter;
 
-  DietParserTask(this._parserOptions, this._idGenerator, this._backend,
-      this._reporter, Measurer measurer)
+  DietParserTask(this._idGenerator, this._backend, this._reporter,
+      Measurer measurer)
       : super(measurer);
 
   final String name = 'Diet Parser';
@@ -33,7 +31,7 @@
           canUseNative: _backend.canLibraryUseNative(compilationUnit.library));
       ElementListener listener = new ElementListener(
           scannerOptions, _reporter, compilationUnit, _idGenerator);
-      PartialParser parser = new PartialParser(listener, _parserOptions);
+      PartialParser parser = new PartialParser(listener);
       try {
         parser.parseUnit(tokens);
       } on ParserError catch (_) {
diff --git a/pkg/compiler/lib/src/parser/element_listener.dart b/pkg/compiler/lib/src/parser/element_listener.dart
index e5904f0..75cd0e9 100644
--- a/pkg/compiler/lib/src/parser/element_listener.dart
+++ b/pkg/compiler/lib/src/parser/element_listener.dart
@@ -731,19 +731,7 @@
     beginMember(token);
   }
 
-  void endFields(fieldCount, start, token) {
-    memberErrors = memberErrors.tail;
-  }
-
-  void endMethod(getOrSet, start, token) {
-    memberErrors = memberErrors.tail;
-  }
-
-  void beginFactoryMethod(Token token) {
-    memberErrors = memberErrors.prepend(false);
-  }
-
-  void endFactoryMethod(Token beginToken, Token endToken) {
+  void endMember() {
     memberErrors = memberErrors.tail;
   }
 
diff --git a/pkg/compiler/lib/src/parser/listener.dart b/pkg/compiler/lib/src/parser/listener.dart
index 3115343..b33bd84 100644
--- a/pkg/compiler/lib/src/parser/listener.dart
+++ b/pkg/compiler/lib/src/parser/listener.dart
@@ -212,6 +212,8 @@
 
   void beginMember(Token token) {}
 
+  void endMember() {}
+
   void endMethod(Token getOrSet, Token beginToken, Token endToken) {}
 
   void beginMetadataStar(Token token) {}
diff --git a/pkg/compiler/lib/src/parser/member_listener.dart b/pkg/compiler/lib/src/parser/member_listener.dart
index c21f493..17ecce0 100644
--- a/pkg/compiler/lib/src/parser/member_listener.dart
+++ b/pkg/compiler/lib/src/parser/member_listener.dart
@@ -147,11 +147,7 @@
   }
 
   void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) {
-    popNode(); // Discard arguments.
-    if (periodBeforeName != null) {
-      popNode(); // Discard name.
-    }
-    popNode(); // Discard node (Send or Identifier).
+    super.endMetadata(beginToken, periodBeforeName, endToken);
     pushMetadata(new PartialMetadataAnnotation(beginToken, endToken));
   }
 }
diff --git a/pkg/compiler/lib/src/parser/node_listener.dart b/pkg/compiler/lib/src/parser/node_listener.dart
index feaa44c..f3e343c 100644
--- a/pkg/compiler/lib/src/parser/node_listener.dart
+++ b/pkg/compiler/lib/src/parser/node_listener.dart
@@ -27,6 +27,53 @@
     pushNode(tag);
   }
 
+  void endLibraryName(Token libraryKeyword, Token semicolon) {
+    Expression name = popNode();
+    pushNode(new LibraryName(libraryKeyword, name,
+          // TODO(sigmund): Import AST nodes have pointers to MetadataAnnotation
+          // (element) instead of Metatada (node).
+          null));
+  }
+
+  void endImport(Token importKeyword, Token deferredKeyword, Token asKeyword,
+      Token semicolon) {
+    NodeList combinators = popNode();
+    Identifier prefix = asKeyword != null ? popNode() : null;
+    NodeList conditionalUris = popNode();
+    StringNode uri = popLiteralString();
+    pushNode(new Import(importKeyword, uri, conditionalUris, prefix,
+          combinators,
+          // TODO(sigmund): Import AST nodes have pointers to MetadataAnnotation
+          // (element) instead of Metatada (node).
+          null, isDeferred: deferredKeyword != null));
+  }
+
+  void endExport(Token exportKeyword, Token semicolon) {
+    NodeList combinators = popNode();
+    NodeList conditionalUris = popNode();
+    StringNode uri = popLiteralString();
+    pushNode(new Export(exportKeyword, uri, conditionalUris, combinators,
+          // TODO(sigmund): Import AST nodes have pointers to MetadataAnnotation
+          // (element) instead of Metatada (node).
+          null));
+  }
+
+  void endPart(Token partKeyword, Token semicolon) {
+    StringNode uri = popLiteralString();
+    pushNode(new Part(partKeyword, uri,
+          // TODO(sigmund): Import AST nodes have pointers to MetadataAnnotation
+          // (element) instead of Metatada (node).
+          null));
+  }
+
+  void endPartOf(Token partKeyword, Token semicolon) {
+    Expression name = popNode(); // name
+    pushNode(new PartOf(partKeyword, name,
+          // TODO(sigmund): Import AST nodes have pointers to MetadataAnnotation
+          // (element) instead of Metatada (node).
+          null));
+  }
+
   void endClassDeclaration(int interfacesCount, Token beginToken,
       Token extendsKeyword, Token implementsKeyword, Token endToken) {
     NodeList body = popNode();
@@ -40,6 +87,15 @@
         interfaces, beginToken, extendsKeyword, body, endToken));
   }
 
+  void endTopLevelDeclaration(Token token) {
+    // TODO(sigmund): consider moving metadata into each declaration
+    // element instead.
+    Node node = popNode(); // top-level declaration
+    popNode(); // Discard metadata
+    pushNode(node);
+    super.endTopLevelDeclaration(token);
+  }
+
   void endCompilationUnit(int count, Token token) {
     pushNode(makeNodeList(count, null, null, '\n'));
   }
@@ -82,15 +138,15 @@
   }
 
   void endTopLevelMethod(Token beginToken, Token getOrSet, Token endToken) {
-    popNode(); // body
-    popNode(); // formalParameters
-    popNode(); // typeVariables
+    Statement body = popNode();
+    AsyncModifier asyncModifier = popNode();
+    NodeList formals = popNode();
+    NodeList typeVariables = popNode();
     Identifier name = popNode();
-    popNode(); // type
+    TypeAnnotation type = popNode();
     Modifiers modifiers = popNode();
-    PartialFunctionElement element = new PartialFunctionElement(name.source,
-        beginToken, getOrSet, endToken, modifiers, compilationUnitElement);
-    pushElement(element);
+    pushNode(new FunctionExpression(name, typeVariables, formals, body, type,
+        modifiers, null, getOrSet, asyncModifier));
   }
 
   void endFormalParameter(Token thisKeyword) {
@@ -481,6 +537,15 @@
     pushNode(null);
   }
 
+  void endMember() {
+    // TODO(sigmund): consider moving metadata into each declaration
+    // element instead.
+    Node node = popNode(); // member
+    popNode(); // Discard metadata
+    pushNode(node);
+    super.endMember();
+  }
+
   void endFields(int count, Token beginToken, Token endToken) {
     NodeList variables = makeNodeList(count, null, endToken, ",");
     TypeAnnotation type = popNode();
@@ -693,13 +758,10 @@
   }
 
   void endMetadataStar(int count, bool forParameter) {
-    // TODO(johnniwinther): Handle metadata for all node kinds.
-    if (forParameter) {
-      if (0 == count) {
-        pushNode(null);
-      } else {
-        pushNode(makeNodeList(count, null, null, ' '));
-      }
+    if (0 == count) {
+      pushNode(null);
+    } else {
+      pushNode(makeNodeList(count, null, null, ' '));
     }
   }
 
diff --git a/pkg/compiler/lib/src/parser/parser.dart b/pkg/compiler/lib/src/parser/parser.dart
index f9998ca..e39ce38 100644
--- a/pkg/compiler/lib/src/parser/parser.dart
+++ b/pkg/compiler/lib/src/parser/parser.dart
@@ -5,7 +5,6 @@
 library dart2js.parser;
 
 import '../common.dart';
-import '../options.dart' show ParserOptions;
 import '../tokens/keyword.dart' show Keyword;
 import '../tokens/precedence.dart' show PrecedenceInfo;
 import '../tokens/precedence_constants.dart'
@@ -96,23 +95,16 @@
  */
 class Parser {
   final Listener listener;
-  final ParserOptions parserOptions;
   bool mayParseFunctionExpressions = true;
   bool asyncAwaitKeywordsEnabled;
 
-  final bool enableGenericMethodSyntax;
-
-  Parser(this.listener, ParserOptions parserOptions,
-      {this.asyncAwaitKeywordsEnabled: false})
-      : parserOptions = parserOptions,
-        enableGenericMethodSyntax = parserOptions.enableGenericMethodSyntax;
+  Parser(this.listener, {this.asyncAwaitKeywordsEnabled: false});
 
   Token parseUnit(Token token) {
     listener.beginCompilationUnit(token);
     int count = 0;
     while (!identical(token.kind, EOF_TOKEN)) {
       token = parseTopLevelDeclaration(token);
-      listener.endTopLevelDeclaration(token);
       count++;
     }
     listener.endCompilationUnit(count, token);
@@ -120,6 +112,12 @@
   }
 
   Token parseTopLevelDeclaration(Token token) {
+    token = _parseTopLevelDeclaration(token);
+    listener.endTopLevelDeclaration(token);
+    return token;
+  }
+
+  Token _parseTopLevelDeclaration(Token token) {
     token = parseMetadataStar(token);
     final String value = token.stringValue;
     if ((identical(value, 'abstract') && optional('class', token.next)) ||
@@ -461,7 +459,7 @@
       listener.handleNoTypeVariables(token);
       token = parseFormalParameters(token);
       listener.handleFunctionTypedFormalParameter(token);
-    } else if (enableGenericMethodSyntax && optional('<', token)) {
+    } else if (optional('<', token)) {
       token = parseTypeVariablesOpt(token);
       token = parseFormalParameters(token);
       listener.handleFunctionTypedFormalParameter(token);
@@ -475,8 +473,6 @@
       if (type.isRequired) {
         listener.reportError(
             equal, MessageKind.REQUIRED_PARAMETER_WITH_DEFAULT);
-      } else if (type.isNamed && identical('=', value)) {
-        listener.reportError(equal, MessageKind.NAMED_PARAMETER_WITH_EQUALS);
       } else if (type.isPositional && identical(':', value)) {
         listener.reportError(
             equal, MessageKind.POSITIONAL_PARAMETER_WITH_EQUALS);
@@ -581,7 +577,7 @@
   /// Returns token after match if [token] matches identifier ('.' identifier)?,
   /// and otherwise returns null. Does not produce listener events.
   Token tryParseQualified(Token token) {
-    if (!identical(token.kind, IDENTIFIER_TOKEN)) return null;
+    if (!isValidTypeReference(token)) return null;
     token = token.next;
     if (!identical(token.kind, PERIOD_TOKEN)) return token;
     token = token.next;
@@ -780,8 +776,7 @@
     listener.beginTypeVariable(token);
     token = parseIdentifier(token);
     Token extendsOrSuper = null;
-    if (optional('extends', token) ||
-        (enableGenericMethodSyntax && optional('super', token))) {
+    if (optional('extends', token) || optional('super', token)) {
       extendsOrSuper = token;
       token = parseType(token.next);
     } else {
@@ -1096,7 +1091,7 @@
     }
     Token token = parseIdentifier(name);
 
-    if (enableGenericMethodSyntax && getOrSet == null) {
+    if (getOrSet == null) {
       token = parseTypeVariablesOpt(token);
     } else {
       listener.handleNoTypeVariables(token);
@@ -1357,11 +1352,14 @@
 
   Token parseMember(Token token) {
     token = parseMetadataStar(token);
-    if (isFactoryDeclaration(token)) {
-      return parseFactoryMethod(token);
-    }
     Token start = token;
     listener.beginMember(token);
+    if (isFactoryDeclaration(token)) {
+      token = parseFactoryMethod(token);
+      listener.endMember();
+      assert (token != null);
+      return token;
+    }
 
     Link<Token> identifiers = findMemberName(token);
     if (identifiers.isEmpty) {
@@ -1406,7 +1404,7 @@
           (identical(value, '.')) ||
           (identical(value, '{')) ||
           (identical(value, '=>')) ||
-          (enableGenericMethodSyntax && identical(value, '<'))) {
+          (identical(value, '<'))) {
         isField = false;
         break;
       } else if (identical(value, ';')) {
@@ -1427,15 +1425,18 @@
         if (identical(token.kind, EOF_TOKEN)) {
           // TODO(ahe): This is a hack, see parseTopLevelMember.
           listener.endFields(1, start, token);
+          listener.endMember();
           return token;
         }
       }
     }
 
     var modifiers = identifiers.reverse();
-    return isField
+    token = isField
         ? parseFields(start, modifiers, type, getOrSet, name, false)
         : parseMethod(start, modifiers, type, getOrSet, name);
+    listener.endMember();
+    return token;
   }
 
   Token parseMethod(Token start, Link<Token> modifiers, Token type,
@@ -1498,7 +1499,7 @@
     }
 
     token = parseQualifiedRestOpt(token);
-    if (enableGenericMethodSyntax && getOrSet == null) {
+    if (getOrSet == null) {
       token = parseTypeVariablesOpt(token);
     } else {
       listener.handleNoTypeVariables(token);
@@ -1589,7 +1590,7 @@
     }
     token = parseQualifiedRestOpt(token);
     listener.endFunctionName(token);
-    if (enableGenericMethodSyntax && getOrSet == null) {
+    if (getOrSet == null) {
       token = parseTypeVariablesOpt(token);
     } else {
       listener.handleNoTypeVariables(token);
@@ -1634,11 +1635,7 @@
     listener.beginFunctionName(token);
     token = parseIdentifier(token);
     listener.endFunctionName(token);
-    if (enableGenericMethodSyntax) {
-      token = parseTypeVariablesOpt(token);
-    } else {
-      listener.handleNoTypeVariables(token);
-    }
+    token = parseTypeVariablesOpt(token);
     token = parseFormalParameters(token);
     listener.handleNoInitializers();
     bool previousAsyncAwaitKeywordsEnabled = asyncAwaitKeywordsEnabled;
@@ -1870,8 +1867,7 @@
           // by '{', '=>', 'async', or 'sync'.
           return parseFunctionDeclaration(token);
         }
-      } else if (enableGenericMethodSyntax &&
-          identical(afterIdKind, LT_TOKEN)) {
+      } else if (identical(afterIdKind, LT_TOKEN)) {
         // We are looking at "type identifier '<'".
         BeginGroupToken beginAngle = afterId;
         Token endAngle = beginAngle.endGroup;
@@ -1906,7 +1902,7 @@
             identical(afterParens, 'sync')) {
           return parseFunctionDeclaration(token);
         }
-      } else if (enableGenericMethodSyntax && optional('<', token.next)) {
+      } else if (optional('<', token.next)) {
         BeginGroupToken beginAngle = token.next;
         Token endAngle = beginAngle.endGroup;
         if (endAngle != null &&
@@ -2351,8 +2347,7 @@
   Token parseLiteralListOrMapOrFunction(Token token, Token constKeyword) {
     assert(optional('<', token));
     BeginGroupToken begin = token;
-    if (enableGenericMethodSyntax &&
-        constKeyword == null &&
+    if (constKeyword == null &&
         begin.endGroup != null &&
         identical(begin.endGroup.next.kind, OPEN_PAREN_TOKEN)) {
       token = parseTypeVariablesOpt(token);
@@ -2395,7 +2390,7 @@
   }
 
   bool isFunctionDeclaration(Token token) {
-    if (enableGenericMethodSyntax && optional('<', token)) {
+    if (optional('<', token)) {
       BeginGroupToken begin = token;
       if (begin.endGroup == null) return false;
       token = begin.endGroup.next;
@@ -2544,7 +2539,7 @@
   Token parseSend(Token token) {
     listener.beginSend(token);
     token = parseIdentifier(token);
-    if (enableGenericMethodSyntax && isValidMethodTypeArguments(token)) {
+    if (isValidMethodTypeArguments(token)) {
       token = parseTypeArgumentsOpt(token);
     } else {
       listener.handleNoTypeArguments(token);
diff --git a/pkg/compiler/lib/src/parser/parser_task.dart b/pkg/compiler/lib/src/parser/parser_task.dart
index 07734b9..e6e8bfe 100644
--- a/pkg/compiler/lib/src/parser/parser_task.dart
+++ b/pkg/compiler/lib/src/parser/parser_task.dart
@@ -8,7 +8,6 @@
 import '../common/tasks.dart' show CompilerTask;
 import '../compiler.dart' show Compiler;
 import '../elements/modelx.dart' show ElementX;
-import '../options.dart' show ParserOptions;
 import '../tokens/token.dart' show Token;
 import '../tree/tree.dart' show Node;
 import 'element_listener.dart' show ScannerOptions;
@@ -17,12 +16,9 @@
 import 'parser.dart' show Parser;
 
 class ParserTask extends CompilerTask {
-  final ParserOptions parserOptions;
   final Compiler compiler;
 
-  ParserTask(Compiler compiler, this.parserOptions)
-      : compiler = compiler,
-        super(compiler.measurer);
+  ParserTask(Compiler compiler): compiler = compiler, super(compiler.measurer);
 
   String get name => 'Parser';
 
@@ -34,7 +30,7 @@
     return measure(() {
       NodeListener listener =
           new NodeListener(const ScannerOptions(), compiler.reporter, null);
-      Parser parser = new Parser(listener, parserOptions);
+      Parser parser = new Parser(listener);
       try {
         parser.parseUnit(token);
       } on ParserError catch (_) {
diff --git a/pkg/compiler/lib/src/parser/partial_elements.dart b/pkg/compiler/lib/src/parser/partial_elements.dart
index 87cb2f1..1f37ff3 100644
--- a/pkg/compiler/lib/src/parser/partial_elements.dart
+++ b/pkg/compiler/lib/src/parser/partial_elements.dart
@@ -374,7 +374,7 @@
       parsing.measure(() {
         MemberListener listener = new MemberListener(
             parsing.getScannerOptionsFor(this), reporter, this);
-        Parser parser = new ClassElementParser(listener, parsing.parserOptions);
+        Parser parser = new ClassElementParser(listener);
         try {
           Token token = parser.parseTopLevelDeclaration(beginToken);
           assert(identical(token, endToken.next));
@@ -440,7 +440,7 @@
         if (partial.hasParseError) {
           listener.suppressParseErrors = true;
         }
-        doParse(new Parser(listener, parsing.parserOptions));
+        doParse(new Parser(listener));
       } on ParserError catch (e) {
         partial.hasParseError = true;
         return new ErrorNode(element.position, e.reason);
diff --git a/pkg/compiler/lib/src/parser/partial_parser.dart b/pkg/compiler/lib/src/parser/partial_parser.dart
index 0868265..c5d9d62 100644
--- a/pkg/compiler/lib/src/parser/partial_parser.dart
+++ b/pkg/compiler/lib/src/parser/partial_parser.dart
@@ -5,7 +5,6 @@
 library dart2js.parser.partial;
 
 import '../common.dart';
-import '../options.dart' show ParserOptions;
 import '../tokens/token.dart' show BeginGroupToken, ErrorToken, Token;
 import '../tokens/token_constants.dart' as Tokens show EOF_TOKEN;
 import '../util/characters.dart' as Characters show $CLOSE_CURLY_BRACKET;
@@ -13,8 +12,7 @@
 import 'parser.dart' show Parser;
 
 class PartialParser extends Parser {
-  PartialParser(Listener listener, ParserOptions options)
-      : super(listener, options);
+  PartialParser(Listener listener): super(listener);
 
   Token parseClassBody(Token token) => skipClassBody(token);
 
@@ -26,6 +24,7 @@
     // This method is overridden for two reasons:
     // 1. Avoid generating events for arguments.
     // 2. Avoid calling skip expression for each argument (which doesn't work).
+    listener.handleNoArguments(token);
     if (optional('(', token)) {
       BeginGroupToken begin = token;
       return begin.endGroup.next;
diff --git a/pkg/compiler/lib/src/patch_parser.dart b/pkg/compiler/lib/src/patch_parser.dart
index 4e6ea8c..da76073 100644
--- a/pkg/compiler/lib/src/patch_parser.dart
+++ b/pkg/compiler/lib/src/patch_parser.dart
@@ -133,7 +133,6 @@
 import 'id_generator.dart';
 import 'js_backend/js_backend.dart' show JavaScriptBackend;
 import 'library_loader.dart' show LibraryLoader;
-import 'options.dart' show ParserOptions;
 import 'parser/element_listener.dart' show ElementListener;
 import 'parser/listener.dart' show Listener, ParserError;
 import 'parser/member_listener.dart' show MemberListener;
@@ -146,13 +145,11 @@
 
 class PatchParserTask extends CompilerTask {
   final String name = "Patching Parser";
-  final ParserOptions parserOptions;
   final Compiler compiler;
   DiagnosticReporter get reporter => compiler.reporter;
 
-  PatchParserTask(Compiler compiler, this.parserOptions)
-      : compiler = compiler,
-        super(compiler.measurer);
+  PatchParserTask(Compiler compiler)
+      : compiler = compiler, super(compiler.measurer);
 
   /**
    * Scans a library patch file, applies the method patches and
@@ -184,7 +181,7 @@
       Listener patchListener = new PatchElementListener(
           compiler, compilationUnit, compiler.idGenerator);
       try {
-        new PartialParser(patchListener, parserOptions).parseUnit(tokens);
+        new PartialParser(patchListener).parseUnit(tokens);
       } on ParserError catch (e) {
         // No need to recover from a parser error in platform libraries, user
         // will never see this if the libraries are tested correctly.
@@ -201,7 +198,7 @@
 
     measure(() => reporter.withCurrentElement(cls, () {
           MemberListener listener = new PatchMemberListener(compiler, cls);
-          Parser parser = new PatchClassElementParser(listener, parserOptions);
+          Parser parser = new PatchClassElementParser(listener);
           try {
             Token token = parser.parseTopLevelDeclaration(cls.beginToken);
             assert(identical(token, cls.endToken.next));
@@ -251,8 +248,7 @@
  * declarations.
  */
 class PatchClassElementParser extends PartialParser {
-  PatchClassElementParser(Listener listener, ParserOptions options)
-      : super(listener, options);
+  PatchClassElementParser(Listener listener): super(listener);
 
   Token parseClassBody(Token token) => fullParseClassBody(token);
 }
diff --git a/pkg/compiler/lib/src/resolution/constructors.dart b/pkg/compiler/lib/src/resolution/constructors.dart
index 1ccf768..ae51c80 100644
--- a/pkg/compiler/lib/src/resolution/constructors.dart
+++ b/pkg/compiler/lib/src/resolution/constructors.dart
@@ -222,8 +222,8 @@
           functionNode, calledConstructor, callStructure, className,
           isImplicitSuperCall: true);
       if (!result.isError) {
-        registry.registerStaticUse(
-            new StaticUse.constructorInvoke(calledConstructor, callStructure));
+        registry.registerStaticUse(new StaticUse.superConstructorInvoke(
+            calledConstructor, callStructure));
       }
 
       if (isConst && isValidAsConstant) {
@@ -294,8 +294,7 @@
    * Resolve all initializers of this constructor. In the case of a redirecting
    * constructor, the resolved constructor's function element is returned.
    */
-  ConstructorElement resolveInitializers(
-      {bool enableInitializingFormalAccess: false}) {
+  ConstructorElement resolveInitializers() {
     Map<dynamic /*String|int*/, ConstantExpression> defaultValues =
         <dynamic /*String|int*/, ConstantExpression>{};
     ConstructedConstantExpression constructorInvocation;
@@ -303,12 +302,10 @@
     // that we can ensure that fields are initialized only once.
     FunctionSignature functionParameters = constructor.functionSignature;
     Scope oldScope = visitor.scope;
-    if (enableInitializingFormalAccess) {
-      // In order to get the correct detection of name clashes between all
-      // parameters (regular ones and initializing formals) we must extend
-      // the parameter scope rather than adding a new nested scope.
-      visitor.scope = new ExtensionScope(visitor.scope);
-    }
+    // In order to get the correct detection of name clashes between all
+    // parameters (regular ones and initializing formals) we must extend
+    // the parameter scope rather than adding a new nested scope.
+    visitor.scope = new ExtensionScope(visitor.scope);
     Link<Node> parameterNodes = (functionNode.parameters == null)
         ? const Link<Node>()
         : functionNode.parameters.nodes;
@@ -345,11 +342,12 @@
         Node parameterNode = variableDefinitions.definitions.nodes.head;
         InitializingFormalElementX initializingFormal = element;
         FieldElement field = initializingFormal.fieldElement;
-        checkForDuplicateInitializers(field, element.initializer);
-        if (enableInitializingFormalAccess) {
-          visitor.defineLocalVariable(parameterNode, initializingFormal);
-          visitor.addToScope(initializingFormal);
+        if (!field.isMalformed) {
+          registry.registerStaticUse(new StaticUse.fieldInit(field));
         }
+        checkForDuplicateInitializers(field, element.initializer);
+        visitor.defineLocalVariable(parameterNode, initializingFormal);
+        visitor.addToScope(initializingFormal);
         if (isConst) {
           if (element.isNamed) {
             fieldInitializers[field] = new NamedArgumentReference(element.name);
@@ -408,7 +406,7 @@
             reporter.reportErrorMessage(
                 call, MessageKind.REDIRECTING_CONSTRUCTOR_HAS_INITIALIZER);
           } else {
-            constructor.isRedirectingGenerative = true;
+            constructor.isRedirectingGenerativeInternal = true;
           }
           // Check that there are no field initializing parameters.
           FunctionSignature signature = constructor.functionSignature;
diff --git a/pkg/compiler/lib/src/resolution/enum_creator.dart b/pkg/compiler/lib/src/resolution/enum_creator.dart
index 0dd861a..2d07373 100644
--- a/pkg/compiler/lib/src/resolution/enum_creator.dart
+++ b/pkg/compiler/lib/src/resolution/enum_creator.dart
@@ -244,7 +244,7 @@
         requiredParameters: [indexFormal],
         requiredParameterCount: 1,
         type: new FunctionType(
-            constructor, const VoidType(), <DartType>[intType]));
+            constructor, const DynamicType(), <DartType>[intType]));
     constructor.functionSignature = constructorSignature;
     enumClass.addMember(constructor, reporter);
 
diff --git a/pkg/compiler/lib/src/resolution/members.dart b/pkg/compiler/lib/src/resolution/members.dart
index 390b161..f566e40 100644
--- a/pkg/compiler/lib/src/resolution/members.dart
+++ b/pkg/compiler/lib/src/resolution/members.dart
@@ -85,6 +85,7 @@
   /// in static contexts, factory methods, and field initializers).
   bool inInstanceContext;
   bool inCheckContext;
+  bool inCatchParameters = false;
   bool inCatchBlock;
   ConstantState constantState;
 
@@ -456,14 +457,9 @@
             resolver.constantCompiler.compileConstant(parameter);
       });
     });
-    if (!functionSignature.returnType.isDynamic) {
-      registry.registerTypeUse(
-          new TypeUse.checkedModeCheck(functionSignature.returnType));
-    }
+    registry.registerCheckedModeCheck(functionSignature.returnType);
     functionSignature.forEachParameter((ParameterElement element) {
-      if (!element.type.isDynamic) {
-        registry.registerTypeUse(new TypeUse.checkedModeCheck(element.type));
-      }
+      registry.registerCheckedModeCheck(element.type);
     });
   }
 
@@ -1117,12 +1113,12 @@
     if (notTypeNode != null) {
       // `e is! T`.
       Node typeNode = notTypeNode.receiver;
-      type = resolveTypeAnnotation(typeNode);
+      type = resolveTypeAnnotation(typeNode, registerCheckedModeCheck: false);
       sendStructure = new IsNotStructure(type);
     } else {
       // `e is T`.
       Node typeNode = node.arguments.head;
-      type = resolveTypeAnnotation(typeNode);
+      type = resolveTypeAnnotation(typeNode, registerCheckedModeCheck: false);
       sendStructure = new IsStructure(type);
     }
 
@@ -1144,13 +1140,14 @@
     visitExpression(expression);
 
     Node typeNode = node.arguments.head;
-    DartType type = resolveTypeAnnotation(typeNode);
+    DartType type =
+        resolveTypeAnnotation(typeNode, registerCheckedModeCheck: false);
 
-    // GENERIC_METHODS: Method type variables are not reified so we must warn
-    // about the error which will occur at runtime.
+    // GENERIC_METHODS: Method type variables are not reified, so we must inform
+    // the developer about the potentially bug-inducing semantics.
     if (type is MethodTypeVariableType) {
-      reporter.reportWarningMessage(
-          node, MessageKind.TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED);
+      reporter.reportHintMessage(
+          node, MessageKind.TYPE_VARIABLE_FROM_METHOD_CONSIDERED_DYNAMIC);
     }
 
     registry.registerTypeUse(new TypeUse.asCast(type));
@@ -1313,6 +1310,8 @@
     Node right = node.arguments.head;
     visitExpression(left);
     visitExpression(right);
+    registry.registerConstantLiteral(new NullConstantExpression());
+    registry.registerDynamicUse(new DynamicUse(Selectors.equals, null));
     registry.registerSendStructure(node, const IfNullStructure());
     return const NoneResult();
   }
@@ -2354,6 +2353,8 @@
     if (result.kind == ResultKind.PREFIX) {
       return handlePrefixSend(node, name, result);
     } else if (node.isConditional) {
+      registry.registerConstantLiteral(new NullConstantExpression());
+      registry.registerDynamicUse(new DynamicUse(Selectors.equals, null));
       return handleDynamicAccessSemantics(
           node, name, new DynamicAccess.ifNotNullProperty(name));
     } else {
@@ -2387,6 +2388,8 @@
     if (result.kind == ResultKind.PREFIX) {
       return handlePrefixSendSet(node, name, result);
     } else if (node.isConditional) {
+      registry.registerConstantLiteral(new NullConstantExpression());
+      registry.registerDynamicUse(new DynamicUse(Selectors.equals, null));
       return handleDynamicUpdateSemantics(
           node, name, null, new DynamicAccess.ifNotNullProperty(name));
     } else {
@@ -2570,8 +2573,7 @@
       } else {
         semantics = new StaticAccess.parameter(element);
       }
-    } else if (element.isInitializingFormal &&
-        options.enableInitializingFormalAccess) {
+    } else if (element.isInitializingFormal) {
       error = reportAndCreateErroneousElement(node.selector, name.text,
           MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER, {'name': name});
       semantics = new StaticAccess.finalParameter(element);
@@ -3444,12 +3446,13 @@
         registry.setSelector(node, setterSelector);
         registry.setOperatorSelectorInComplexSendSet(node, operatorSelector);
 
-        registry.registerDynamicUse(new DynamicUse(operatorSelector, null));
-
         SendStructure sendStructure;
         if (operator.kind == AssignmentOperatorKind.IF_NULL) {
+          registry.registerConstantLiteral(new NullConstantExpression());
+          registry.registerDynamicUse(new DynamicUse(Selectors.equals, null));
           sendStructure = new SetIfNullStructure(semantics);
         } else {
+          registry.registerDynamicUse(new DynamicUse(operatorSelector, null));
           sendStructure = new CompoundStructure(semantics, operator);
         }
         registry.registerSendStructure(node, sendStructure);
@@ -3665,6 +3668,9 @@
       // TODO(johnniwinther): Handle this (potentially) erroneous case.
       isValidAsConstant = false;
     }
+    if (type.typeArguments.any((DartType type) => !type.isDynamic)) {
+      registry.registerFeature(Feature.TYPE_VARIABLE_BOUNDS_CHECK);
+    }
 
     redirectionTarget.computeType(resolution);
     FunctionSignature targetSignature = redirectionTarget.functionSignature;
@@ -3676,13 +3682,10 @@
       isValidAsConstant = false;
     }
 
-    registry.registerStaticUse(
-        new StaticUse.constructorRedirect(redirectionTarget));
-    // TODO(johnniwinther): Register the effective target type as part of the
-    // static use instead.
-    registry.registerTypeUse(new TypeUse.instantiation(redirectionTarget
-        .enclosingClass.thisType
-        .subst(type.typeArguments, targetClass.typeVariables)));
+    registry.registerStaticUse(new StaticUse.constructorRedirect(
+        redirectionTarget,
+        redirectionTarget.enclosingClass.thisType
+            .subst(type.typeArguments, targetClass.typeVariables)));
     if (resolution.commonElements.isSymbolConstructor(enclosingElement)) {
       registry.registerFeature(Feature.SYMBOL_CONSTRUCTOR);
     }
@@ -3882,11 +3885,17 @@
     if (!isInvalid) {
       // [constructor] might be the implementation element
       // and only declaration elements may be registered.
-      registry.registerStaticUse(new StaticUse.constructorInvoke(
-          constructor.declaration, callStructure));
       // TODO(johniwinther): Avoid registration of `type` in face of redirecting
       // factory constructors.
-      registry.registerTypeUse(new TypeUse.instantiation(type));
+      registry.registerStaticUse(node.isConst
+          ? new StaticUse.constConstructorInvoke(
+              constructor.declaration, callStructure, type)
+          : new StaticUse.typedConstructorInvoke(
+              constructor.declaration, callStructure, type));
+      InterfaceType interfaceType = type;
+      if (interfaceType.typeArguments.any((DartType type) => !type.isDynamic)) {
+        registry.registerFeature(Feature.TYPE_VARIABLE_BOUNDS_CHECK);
+      }
     }
 
     ResolutionResult resolutionResult = const NoneResult();
@@ -4069,8 +4078,8 @@
     DartType type = typeResolver.resolveTypeAnnotation(this, node,
         malformedIsError: malformedIsError,
         deferredIsMalformed: deferredIsMalformed);
-    if (registerCheckedModeCheck && !type.isDynamic) {
-      registry.registerTypeUse(new TypeUse.checkedModeCheck(type));
+    if (registerCheckedModeCheck) {
+      registry.registerCheckedModeCheck(type);
     }
     return type;
   }
@@ -4594,6 +4603,16 @@
         reporter.reportErrorMessage(
             switchCase, MessageKind.INVALID_CASE_DEFAULT);
       }
+      if (cases.isNotEmpty && switchCase.statements.isNotEmpty) {
+        Node last = switchCase.statements.last;
+        if (last.asReturn() == null &&
+            last.asBreakStatement() == null &&
+            last.asContinueStatement() == null &&
+            (last.asExpressionStatement() == null ||
+                last.asExpressionStatement().expression.asThrow() == null)) {
+          registry.registerFeature(Feature.FALL_THROUGH_ERROR);
+        }
+      }
     }
 
     addDeferredAction(enclosingElement, () {
@@ -4615,7 +4634,6 @@
     });
     // TODO(15575): We should warn if we can detect a fall through
     // error.
-    registry.registerFeature(Feature.FALL_THROUGH_ERROR);
     return const NoneResult();
   }
 
@@ -4684,6 +4702,7 @@
               nodeList, MessageKind.OPTIONAL_PARAMETER_IN_CATCH);
         } else {
           VariableDefinitions declaration = link.head;
+
           for (Node modifier in declaration.modifiers.nodes) {
             reporter.reportErrorMessage(
                 modifier, MessageKind.PARAMETER_WITH_MODIFIER_IN_CATCH);
@@ -4698,15 +4717,17 @@
     }
 
     Scope blockScope = new BlockScope(scope);
-    TypeResult exceptionTypeResult = visitIn(node.type, blockScope);
+    inCatchParameters = true;
     visitIn(node.formals, blockScope);
+    inCatchParameters = false;
     var oldInCatchBlock = inCatchBlock;
     inCatchBlock = true;
     visitIn(node.block, blockScope);
     inCatchBlock = oldInCatchBlock;
 
-    if (exceptionTypeResult != null) {
-      DartType exceptionType = exceptionTypeResult.type;
+    if (node.type != null) {
+      DartType exceptionType =
+          resolveTypeAnnotation(node.type, registerCheckedModeCheck: false);
       if (exceptionDefinition != null) {
         Node exceptionVariable = exceptionDefinition.definitions.nodes.head;
         VariableElementX exceptionElement =
diff --git a/pkg/compiler/lib/src/resolution/registry.dart b/pkg/compiler/lib/src/resolution/registry.dart
index da2c129..3784bd9 100644
--- a/pkg/compiler/lib/src/resolution/registry.dart
+++ b/pkg/compiler/lib/src/resolution/registry.dart
@@ -7,7 +7,6 @@
 import '../common.dart';
 import '../common/backend_api.dart'
     show Backend, ForeignResolver, NativeRegistry;
-import '../common/registry.dart' show Registry;
 import '../common/resolution.dart' show ResolutionImpact, Target;
 import '../constants/expressions.dart';
 import '../dart_types.dart';
@@ -37,6 +36,9 @@
 
   ResolutionWorldImpactBuilder(this.name);
 
+  @override
+  bool get isEmpty => false;
+
   void registerMapLiteral(MapLiteralUse mapLiteralUse) {
     assert(mapLiteralUse != null);
     if (_mapLiterals == null) {
@@ -154,7 +156,7 @@
 /// related information in a [TreeElements] mapping and registers calls with
 /// [Backend], [World] and [Enqueuer].
 // TODO(johnniwinther): Split this into an interface and implementation class.
-class ResolutionRegistry extends Registry {
+class ResolutionRegistry {
   final Target target;
   final TreeElementMapping mapping;
   final ResolutionWorldImpactBuilder impactBuilder;
@@ -331,6 +333,13 @@
     impactBuilder.registerTypeUse(typeUse);
   }
 
+  /// Register checked mode check of [type] if it isn't `dynamic`.
+  void registerCheckedModeCheck(DartType type) {
+    if (!type.isDynamic) {
+      impactBuilder.registerTypeUse(new TypeUse.checkedModeCheck(type));
+    }
+  }
+
   void registerSuperUse(SourceSpan span) {
     mapping.addSuperUse(span);
   }
diff --git a/pkg/compiler/lib/src/resolution/resolution.dart b/pkg/compiler/lib/src/resolution/resolution.dart
index 13f248c..d5334f1 100644
--- a/pkg/compiler/lib/src/resolution/resolution.dart
+++ b/pkg/compiler/lib/src/resolution/resolution.dart
@@ -247,9 +247,7 @@
         // resolution in case there is an implicit super constructor call.
         InitializerResolver resolver =
             new InitializerResolver(visitor, element, tree);
-        FunctionElement redirection = resolver.resolveInitializers(
-            enableInitializingFormalAccess:
-                options.enableInitializingFormalAccess);
+        FunctionElement redirection = resolver.resolveInitializers();
         if (redirection != null) {
           resolveRedirectingConstructor(resolver, tree, element, redirection);
         }
@@ -315,11 +313,22 @@
           // Ensure the signature of the synthesized element is
           // resolved. This is the only place where the resolver is
           // seeing this element.
-          element.computeType(resolution);
+          FunctionType type = element.computeType(resolution);
           if (!target.isMalformed) {
             registry.registerStaticUse(new StaticUse.superConstructorInvoke(
-                target, CallStructure.NO_ARGS));
+                // TODO(johnniwinther): Provide the right call structure for
+                // forwarding constructors.
+                target,
+                CallStructure.NO_ARGS));
           }
+          // TODO(johnniwinther): Remove this substitution when synthesized
+          // constructors handle type variables correctly.
+          type = type.substByContext(
+              constructor.enclosingClass.asInstanceOf(target.enclosingClass));
+          type.parameterTypes.forEach(registry.registerCheckedModeCheck);
+          type.optionalParameterTypes
+              .forEach(registry.registerCheckedModeCheck);
+          type.namedParameterTypes.forEach(registry.registerCheckedModeCheck);
           return registry.impactBuilder;
         } else {
           assert(element.isDeferredLoaderGetter || element.isMalformed);
@@ -382,6 +391,8 @@
         // happens for enum fields where the type is known but is not in the
         // synthesized AST.
         element.variables.type = const DynamicType();
+      } else {
+        registry.registerCheckedModeCheck(element.variables.type);
       }
 
       Expression initializer = element.initializer;
@@ -412,7 +423,8 @@
           }
         });
         if (initializer != null) {
-          if (!element.modifiers.isConst) {
+          if (!element.modifiers.isConst &&
+              initializer.asLiteralNull() == null) {
             // TODO(johnniwinther): Determine the const-ness eagerly to avoid
             // unnecessary registrations.
             registry.registerFeature(Feature.LAZY_FIELD);
@@ -430,16 +442,18 @@
   }
 
   DartType resolveTypeAnnotation(Element element, TypeAnnotation annotation) {
-    DartType type = resolveReturnType(element, annotation);
+    DartType type = _resolveReturnType(element, annotation);
     if (type.isVoid) {
       reporter.reportErrorMessage(annotation, MessageKind.VOID_NOT_ALLOWED);
     }
     return type;
   }
 
-  DartType resolveReturnType(Element element, TypeAnnotation annotation) {
+  DartType _resolveReturnType(Element element, TypeAnnotation annotation) {
     if (annotation == null) return const DynamicType();
     DartType result = visitorFor(element).resolveTypeAnnotation(annotation);
+    assert(invariant(annotation, result != null,
+        message: "No type computed for $annotation."));
     if (result == null) {
       // TODO(karklose): warning.
       return const DynamicType();
diff --git a/pkg/compiler/lib/src/resolution/signatures.dart b/pkg/compiler/lib/src/resolution/signatures.dart
index eff4988..31673c2 100644
--- a/pkg/compiler/lib/src/resolution/signatures.dart
+++ b/pkg/compiler/lib/src/resolution/signatures.dart
@@ -370,7 +370,7 @@
       returnType = element.enclosingClass.thisType;
       // Because there is no type annotation for the return type of
       // this element, we explicitly add one.
-      registry.registerTypeUse(new TypeUse.checkedModeCheck(returnType));
+      registry.registerCheckedModeCheck(returnType);
     } else {
       AsyncMarker asyncMarker = AsyncMarker.SYNC;
       if (isFunctionExpression) {
diff --git a/pkg/compiler/lib/src/resolution/tree_elements.dart b/pkg/compiler/lib/src/resolution/tree_elements.dart
index bae0857..fd0080f 100644
--- a/pkg/compiler/lib/src/resolution/tree_elements.dart
+++ b/pkg/compiler/lib/src/resolution/tree_elements.dart
@@ -10,7 +10,6 @@
 import '../diagnostics/source_span.dart';
 import '../elements/elements.dart';
 import '../tree/tree.dart';
-import '../types/types.dart' show TypeMask;
 import '../universe/selector.dart' show Selector;
 import '../util/util.dart';
 import 'secret_tree_element.dart' show getTreeElement, setTreeElement;
@@ -36,21 +35,9 @@
   Selector getGetterSelectorInComplexSendSet(SendSet node);
   Selector getOperatorSelectorInComplexSendSet(SendSet node);
   DartType getType(Node node);
-  TypeMask getTypeMask(Node node);
-  TypeMask getGetterTypeMaskInComplexSendSet(SendSet node);
-  TypeMask getOperatorTypeMaskInComplexSendSet(SendSet node);
-  void setTypeMask(Node node, TypeMask mask);
-  void setGetterTypeMaskInComplexSendSet(SendSet node, TypeMask mask);
-  void setOperatorTypeMaskInComplexSendSet(SendSet node, TypeMask mask);
 
   /// Returns the for-in loop variable for [node].
   Element getForInVariable(ForIn node);
-  TypeMask getIteratorTypeMask(ForIn node);
-  TypeMask getMoveNextTypeMask(ForIn node);
-  TypeMask getCurrentTypeMask(ForIn node);
-  void setIteratorTypeMask(ForIn node, TypeMask mask);
-  void setMoveNextTypeMask(ForIn node, TypeMask mask);
-  void setCurrentTypeMask(ForIn node, TypeMask mask);
   void setConstant(Node node, ConstantExpression constant);
   ConstantExpression getConstant(Node node);
 
@@ -107,7 +94,6 @@
 class TreeElementMapping extends TreeElements {
   final AnalyzableElement analyzedElement;
   Map<Spannable, Selector> _selectors;
-  Map<Spannable, TypeMask> _typeMasks;
   Map<Node, DartType> _types;
 
   Map<Node, DartType> _typesCache;
@@ -442,79 +428,6 @@
     return _targetLabels != null ? _targetLabels[node] : null;
   }
 
-  TypeMask _getTypeMask(Spannable node) {
-    return _typeMasks != null ? _typeMasks[node] : null;
-  }
-
-  void _setTypeMask(Spannable node, TypeMask mask) {
-    if (_typeMasks == null) {
-      _typeMasks = new Maplet<Spannable, TypeMask>();
-    }
-    _typeMasks[node] = mask;
-  }
-
-  @override
-  void setTypeMask(Node node, TypeMask mask) {
-    _setTypeMask(node, mask);
-  }
-
-  @override
-  TypeMask getTypeMask(Node node) => _getTypeMask(node);
-
-  @override
-  void setGetterTypeMaskInComplexSendSet(SendSet node, TypeMask mask) {
-    _setTypeMask(node.selector, mask);
-  }
-
-  @override
-  TypeMask getGetterTypeMaskInComplexSendSet(SendSet node) {
-    return _getTypeMask(node.selector);
-  }
-
-  @override
-  void setOperatorTypeMaskInComplexSendSet(SendSet node, TypeMask mask) {
-    _setTypeMask(node.assignmentOperator, mask);
-  }
-
-  @override
-  TypeMask getOperatorTypeMaskInComplexSendSet(SendSet node) {
-    return _getTypeMask(node.assignmentOperator);
-  }
-
-  // The following methods set selectors on the "for in" node. Since
-  // we're using three selectors, we need to use children of the node,
-  // and we arbitrarily choose which ones.
-
-  @override
-  void setIteratorTypeMask(ForIn node, TypeMask mask) {
-    _setTypeMask(node, mask);
-  }
-
-  @override
-  TypeMask getIteratorTypeMask(ForIn node) {
-    return _getTypeMask(node);
-  }
-
-  @override
-  void setMoveNextTypeMask(ForIn node, TypeMask mask) {
-    _setTypeMask(node.forToken, mask);
-  }
-
-  @override
-  TypeMask getMoveNextTypeMask(ForIn node) {
-    return _getTypeMask(node.forToken);
-  }
-
-  @override
-  void setCurrentTypeMask(ForIn node, TypeMask mask) {
-    _setTypeMask(node.inToken, mask);
-  }
-
-  @override
-  TypeMask getCurrentTypeMask(ForIn node) {
-    return _getTypeMask(node.inToken);
-  }
-
   void registerNativeData(Node node, dynamic nativeData) {
     if (_nativeData == null) {
       _nativeData = <Node, dynamic>{};
diff --git a/pkg/compiler/lib/src/resolution/type_resolver.dart b/pkg/compiler/lib/src/resolution/type_resolver.dart
index 274911d..bc9f2e5 100644
--- a/pkg/compiler/lib/src/resolution/type_resolver.dart
+++ b/pkg/compiler/lib/src/resolution/type_resolver.dart
@@ -222,7 +222,6 @@
             node, "Unexpected element kind ${element.kind}.");
       }
       if (addTypeVariableBoundsCheck) {
-        registry.registerFeature(Feature.TYPE_VARIABLE_BOUNDS_CHECK);
         visitor.addDeferredAction(visitor.enclosingElement,
             () => checkTypeVariableBounds(node, type));
       }
diff --git a/pkg/compiler/lib/src/resolution/variables.dart b/pkg/compiler/lib/src/resolution/variables.dart
index fa7dd75..d6490e0 100644
--- a/pkg/compiler/lib/src/resolution/variables.dart
+++ b/pkg/compiler/lib/src/resolution/variables.dart
@@ -42,8 +42,10 @@
   }
 
   Identifier visitIdentifier(Identifier node) {
-    // The variable is initialized to null.
-    registry.registerFeature(Feature.LOCAL_WITHOUT_INITIALIZER);
+    if (!resolver.inCatchParameters) {
+      // The variable is initialized to null.
+      registry.registerFeature(Feature.LOCAL_WITHOUT_INITIALIZER);
+    }
     if (definitions.modifiers.isConst) {
       if (resolver.inLoopVariable) {
         reporter.reportErrorMessage(node, MessageKind.CONST_LOOP_VARIABLE);
diff --git a/pkg/compiler/lib/src/serialization/equivalence.dart b/pkg/compiler/lib/src/serialization/equivalence.dart
index 9db38fd..c9f03f2 100644
--- a/pkg/compiler/lib/src/serialization/equivalence.dart
+++ b/pkg/compiler/lib/src/serialization/equivalence.dart
@@ -990,7 +990,9 @@
       strategy.testSets(impact1, impact2, 'staticUses', impact1.staticUses,
           impact2.staticUses, areStaticUsesEquivalent) &&
       strategy.testSets(impact1, impact2, 'typeUses', impact1.typeUses,
-          impact2.typeUses, areTypeUsesEquivalent);
+          impact2.typeUses, areTypeUsesEquivalent) &&
+      strategy.testSets(impact1, impact2, 'nativeData', impact1.nativeData,
+          impact2.nativeData, testNativeBehavior);
 }
 
 /// Tests the equivalence of [resolvedAst1] and [resolvedAst2] using [strategy].
diff --git a/pkg/compiler/lib/src/serialization/impact_serialization.dart b/pkg/compiler/lib/src/serialization/impact_serialization.dart
index e8ee514..90c1570 100644
--- a/pkg/compiler/lib/src/serialization/impact_serialization.dart
+++ b/pkg/compiler/lib/src/serialization/impact_serialization.dart
@@ -78,6 +78,9 @@
     object.setEnum(Key.KIND, staticUse.kind);
     serializeElementReference(
         element, Key.ELEMENT, Key.NAME, object, staticUse.element);
+    if (staticUse.type != null) {
+      object.setType(Key.TYPE, staticUse.type);
+    }
   }
 
   @override
@@ -113,6 +116,9 @@
       this.nativeData: const <dynamic>[]})
       : this._features = features;
 
+  @override
+  bool get isEmpty => false;
+
   Iterable<Feature> get features {
     return _features != null
         ? _features.iterable(Feature.values)
@@ -131,7 +137,8 @@
       StaticUseKind kind = object.getEnum(Key.KIND, StaticUseKind.values);
       Element usedElement =
           deserializeElementReference(element, Key.ELEMENT, Key.NAME, object);
-      staticUses.add(new StaticUse.internal(usedElement, kind));
+      DartType type = object.getType(Key.TYPE, isOptional: true);
+      staticUses.add(new StaticUse.internal(usedElement, kind, type));
     }
 
     ListDecoder dynamicUseDecoder = objectDecoder.getList(Key.DYNAMIC_USES);
diff --git a/pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart b/pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart
index c3ef366..c839c95 100644
--- a/pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart
+++ b/pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart
@@ -400,7 +400,7 @@
               parsing.getScannerOptionsFor(element), reporter, null);
           listener.memberErrors = listener.memberErrors.prepend(false);
           try {
-            Parser parser = new Parser(listener, parsing.parserOptions);
+            Parser parser = new Parser(listener);
             parse(parser);
           } on ParserError catch (e) {
             reporter.internalError(element, '$e');
diff --git a/pkg/compiler/lib/src/serialization/system.dart b/pkg/compiler/lib/src/serialization/system.dart
index 8d241ce..9e6da49 100644
--- a/pkg/compiler/lib/src/serialization/system.dart
+++ b/pkg/compiler/lib/src/serialization/system.dart
@@ -9,6 +9,7 @@
 import '../common.dart';
 import '../common/resolution.dart';
 import '../compiler.dart';
+import '../dart_types.dart';
 import '../elements/elements.dart';
 import '../scanner/scanner.dart';
 import '../script.dart';
@@ -156,20 +157,36 @@
   ResolutionImpact getResolutionImpact(Element element) {
     if (element.isConstructor &&
         element.enclosingClass.isUnnamedMixinApplication) {
-      ClassElement superclass = element.enclosingClass.superclass;
+      ConstructorElement constructor = element;
+      ClassElement superclass = constructor.enclosingClass.superclass;
       ConstructorElement superclassConstructor =
-          superclass.lookupConstructor(element.name);
+          superclass.lookupConstructor(constructor.name);
       assert(invariant(element, superclassConstructor != null,
-          message: "Superclass constructor '${element.name}' called from "
+          message: "Superclass constructor '${constructor.name}' called from "
               "${element} not found in ${superclass}."));
       // TODO(johnniwinther): Compute callStructure. Currently not used.
       CallStructure callStructure;
-      return _resolutionImpactDeserializer.registerResolutionImpact(element,
+      return _resolutionImpactDeserializer.registerResolutionImpact(constructor,
           () {
+        List<TypeUse> typeUses = <TypeUse>[];
+        void addCheckedModeCheck(DartType type) {
+          if (!type.isDynamic) {
+            typeUses.add(new TypeUse.checkedModeCheck(type));
+          }
+        }
+
+        FunctionType type = constructor.type;
+        // TODO(johnniwinther): Remove this substitution when synthesized
+        // constructors handle type variables correctly.
+        type = type.substByContext(constructor.enclosingClass
+            .asInstanceOf(constructor.enclosingClass));
+        type.parameterTypes.forEach(addCheckedModeCheck);
+        type.optionalParameterTypes.forEach(addCheckedModeCheck);
+        type.namedParameterTypes.forEach(addCheckedModeCheck);
         return new DeserializedResolutionImpact(staticUses: <StaticUse>[
           new StaticUse.superConstructorInvoke(
               superclassConstructor, callStructure)
-        ]);
+        ], typeUses: typeUses);
       });
     }
     return _resolutionImpactDeserializer.getResolutionImpact(element);
diff --git a/pkg/compiler/lib/src/serialization/task.dart b/pkg/compiler/lib/src/serialization/task.dart
index 5bfae8b..acad224 100644
--- a/pkg/compiler/lib/src/serialization/task.dart
+++ b/pkg/compiler/lib/src/serialization/task.dart
@@ -138,17 +138,11 @@
 class DeserializedResolutionWorkItem implements ResolutionWorkItem {
   final Element element;
   final WorldImpact worldImpact;
-  bool _isAnalyzed = false;
 
   DeserializedResolutionWorkItem(this.element, this.worldImpact);
 
   @override
-  bool get isAnalyzed => _isAnalyzed;
-
-  @override
-  WorldImpact run(Compiler compiler, ResolutionEnqueuer world) {
-    _isAnalyzed = true;
-    world.registerProcessedElement(element);
+  WorldImpact run() {
     return worldImpact;
   }
 }
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index fd89518..2fee721 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -20,6 +20,7 @@
 import '../diagnostics/messages.dart' show Message, MessageTemplate;
 import '../dump_info.dart' show InfoReporter;
 import '../elements/elements.dart';
+import '../elements/entities.dart';
 import '../elements/modelx.dart' show ConstructorBodyElementX;
 import '../io/source_information.dart';
 import '../js/js.dart' as js;
@@ -35,7 +36,7 @@
 import '../universe/call_structure.dart' show CallStructure;
 import '../universe/selector.dart' show Selector;
 import '../universe/side_effects.dart' show SideEffects;
-import '../universe/use.dart' show DynamicUse, StaticUse, TypeUse;
+import '../universe/use.dart' show DynamicUse, StaticUse;
 import '../util/util.dart';
 import '../world.dart' show ClosedWorld;
 
@@ -46,6 +47,7 @@
 import 'nodes.dart';
 import 'optimize.dart';
 import 'ssa_branch_builder.dart';
+import 'type_builder.dart';
 import 'types.dart';
 
 class SsaBuilderTask extends CompilerTask {
@@ -141,7 +143,16 @@
   // used only for codegen, but currently we want to experiment using it for
   // code-analysis too.
   final CodegenRegistry registry;
+
+  /// All results from the global type-inference analysis.
   final GlobalTypeInferenceResults inferenceResults;
+
+  /// Results from the global type-inference analysis corresponding to the
+  /// current element being visited.
+  ///
+  /// Invariant: this property is updated together with [resolvedAst].
+  GlobalTypeInferenceElementResult elementInferenceResults;
+
   final JavaScriptBackend backend;
   final ConstantSystem constantSystem;
   final RuntimeTypes rti;
@@ -178,6 +189,9 @@
   /// Handles the building of loops.
   LoopHandler<ast.Node> loopHandler;
 
+  /// Handles type check building.
+  TypeBuilder typeBuilder;
+
   // TODO(sigmund): make most args optional
   SsaBuilder(
       this.target,
@@ -193,6 +207,8 @@
         this.inferenceResults = backend.compiler.globalInference.results {
     assert(target.isImplementation);
     compiler = backend.compiler;
+    elementInferenceResults = _resultOf(target);
+    assert(elementInferenceResults != null);
     graph.element = target;
     sourceElementStack.add(target);
     sourceInformationBuilder =
@@ -201,6 +217,7 @@
         sourceInformationBuilder.buildVariableDeclaration();
     localsHandler = new LocalsHandler(this, target, null, compiler);
     loopHandler = new SsaLoopHandler(this);
+    typeBuilder = new TypeBuilder(this);
   }
 
   BackendHelpers get helpers => backend.helpers;
@@ -211,6 +228,8 @@
 
   CoreClasses get coreClasses => compiler.coreClasses;
 
+  Element get targetElement => target;
+
   /// Reference to resolved elements in [target]'s AST.
   TreeElements get elements => resolvedAst.elements;
 
@@ -232,11 +251,19 @@
   /// The returned element is a declaration element.
   // TODO(johnniwinther): Check that all usages of sourceElement agree on
   // implementation/declaration distinction.
+  @override
   Element get sourceElement => sourceElementStack.last;
 
-  bool get _checkOrTrustTypes =>
-      compiler.options.enableTypeAssertions ||
-      compiler.options.trustTypeAnnotations;
+  /// Helper to retrieve global inference results for [element] with special
+  /// care for `ConstructorBodyElement`s which don't exist at the time the
+  /// global analysis run.
+  ///
+  /// Note: this helper is used selectively. When we know that we are in a
+  /// context were we don't expect to see a constructor body element, we
+  /// directly fetch the data from the global inference results.
+  GlobalTypeInferenceElementResult _resultOf(AstElement element) =>
+      inferenceResults.resultOf(
+          element is ConstructorBodyElementX ? element.constructor : element);
 
   /// Build the graph for [target].
   HGraph build() {
@@ -271,6 +298,13 @@
     add(attachPosition(instruction, node));
   }
 
+  HTypeConversion buildFunctionTypeConversion(
+      HInstruction original, DartType type, int kind) {
+    HInstruction reifiedType = buildFunctionType(type);
+    return new HTypeConversion.viaMethodOnType(
+        type, kind, original.instructionType, reifiedType, original);
+  }
+
   /**
    * Returns a complete argument list for a call of [function].
    */
@@ -286,8 +320,7 @@
     // For static calls, [providedArguments] is complete, default arguments
     // have been included if necessary, see [makeStaticArgumentList].
     if (!isInstanceMember ||
-        currentNode == null // In erroneous code, currentNode can be null.
-        ||
+        currentNode == null || // In erroneous code, currentNode can be null.
         providedArgumentsKnownToBeComplete(currentNode) ||
         function.isGenerativeConstructorBody ||
         selector.isGetter) {
@@ -374,10 +407,8 @@
   bool tryInlineMethod(Element element, Selector selector, TypeMask mask,
       List<HInstruction> providedArguments, ast.Node currentNode,
       {InterfaceType instanceType}) {
-    // TODO(johnniwinther): Register this on the [registry]. Currently the
-    // [CodegenRegistry] calls the enqueuer, but [element] should _not_ be
-    // enqueued.
-    backend.registerStaticUse(element, compiler.enqueuer.codegen);
+    registry
+        .addImpact(backend.registerStaticUse(element, forResolution: false));
 
     if (backend.isJsInterop(element) && !element.isFactoryConstructor) {
       // We only inline factory JavaScript interop constructors.
@@ -436,7 +467,7 @@
       // A generative constructor body is not seen by global analysis,
       // so we should not query for its type.
       if (!element.isGenerativeConstructorBody) {
-        if (inferenceResults.throwsAlways(element)) {
+        if (inferenceResults.resultOf(element).throwsAlways) {
           isReachable = false;
           return false;
         }
@@ -568,12 +599,10 @@
     return inliningStack.isEmpty || inliningStack.last.allFunctionsCalledOnce;
   }
 
-  bool isFunctionCalledOnce(Element element) {
-    if (element is ConstructorBodyElement) {
-      // ConstructorBodyElements are not in the type inference graph.
-      return false;
-    }
-    return inferenceResults.isCalledOnce(element);
+  bool isFunctionCalledOnce(element) {
+    // ConstructorBodyElements are not in the type inference graph.
+    if (element is ConstructorBodyElement) return false;
+    return inferenceResults.resultOf(element).isCalledOnce;
   }
 
   bool isCalledOnce(Element element) {
@@ -612,7 +641,7 @@
     return graph.addConstant(constantValue, compiler);
   }
 
-  Element get currentNonClosureClass {
+  ClassElement get currentNonClosureClass {
     ClassElement cls = sourceElement.enclosingClass;
     if (cls != null && cls.isClosure) {
       var closureClass = cls;
@@ -677,14 +706,19 @@
     // null check.
     if (name == '==') {
       if (!backend.operatorEqHandlesNullArgument(functionElement)) {
-        handleIf(function, visitCondition: () {
-          HParameterValue parameter = parameters.values.first;
-          push(new HIdentity(parameter, graph.addConstantNull(compiler), null,
-              backend.boolType));
-        }, visitThen: () {
-          closeAndGotoExit(new HReturn(graph.addConstantBool(false, compiler),
-              sourceInformationBuilder.buildImplicitReturn(functionElement)));
-        },
+        handleIf(
+            node: function,
+            visitCondition: () {
+              HParameterValue parameter = parameters.values.first;
+              push(new HIdentity(parameter, graph.addConstantNull(compiler),
+                  null, backend.boolType));
+            },
+            visitThen: () {
+              closeAndGotoExit(new HReturn(
+                  graph.addConstantBool(false, compiler),
+                  sourceInformationBuilder
+                      .buildImplicitReturn(functionElement)));
+            },
             visitElse: null,
             sourceInformation: sourceInformationBuilder.buildIf(function.body));
       }
@@ -714,7 +748,7 @@
         isStatement: true));
   }
 
-  HGraph buildCheckedSetter(VariableElement field) {
+  HGraph buildCheckedSetter(FieldElement field) {
     ResolvedAst resolvedAst = field.resolvedAst;
     openFunction(field, resolvedAst.node);
     HInstruction thisInstruction = localsHandler.readThis();
@@ -725,7 +759,8 @@
     // If the method is intercepted, we want the actual receiver
     // to be the first parameter.
     graph.entry.addBefore(graph.entry.last, parameter);
-    HInstruction value = potentiallyCheckOrTrustType(parameter, field.type);
+    HInstruction value =
+        typeBuilder.potentiallyCheckOrTrustType(parameter, field.type);
     add(new HFieldSet(field, thisInstruction, value));
     return closeFunction();
   }
@@ -741,10 +776,21 @@
     openFunction(variable, node);
     visit(initializer);
     HInstruction value = pop();
-    value = potentiallyCheckOrTrustType(value, variable.type);
-    ast.SendSet sendSet = node.definitions.nodes.head;
-    closeAndGotoExit(new HReturn(value,
-        sourceInformationBuilder.buildReturn(sendSet.assignmentOperator)));
+    value = typeBuilder.potentiallyCheckOrTrustType(value, variable.type);
+    // In the case of multiple declarations (and some definitions) on the same
+    // line, the source pointer needs to point to the right initialized
+    // variable. So find the specific initialized variable we are referring to.
+    ast.Node sourceInfoNode = initializer;
+    for (var definition in node.definitions) {
+      if (definition is ast.SendSet &&
+          definition.selector.asIdentifier().source == variable.name) {
+        sourceInfoNode = definition.assignmentOperator;
+        break;
+      }
+    }
+
+    closeAndGotoExit(new HReturn(
+        value, sourceInformationBuilder.buildReturn(sourceInfoNode)));
     return closeFunction();
   }
 
@@ -811,7 +857,7 @@
     assert(resolvedAst != null);
     localsHandler = new LocalsHandler(this, function, instanceType, compiler);
     localsHandler.closureData =
-        compiler.closureToClassMapper.computeClosureToClassMapping(resolvedAst);
+        compiler.closureToClassMapper.getClosureToClassMapping(resolvedAst);
     returnLocal = new SyntheticLocal("result", function);
     localsHandler.updateLocal(returnLocal, graph.addConstantNull(compiler));
 
@@ -852,6 +898,7 @@
     returnLocal = state.oldReturnLocal;
     inTryStatement = state.inTryStatement;
     resolvedAst = state.oldResolvedAst;
+    elementInferenceResults = state.oldElementInferenceResults;
     returnType = state.oldReturnType;
     assert(stack.isEmpty);
     stack = state.oldStack;
@@ -861,7 +908,8 @@
    * Run this builder on the body of the [function] to be inlined.
    */
   void visitInlinedFunction(ResolvedAst resolvedAst) {
-    potentiallyCheckInlinedParameterTypes(resolvedAst.element.implementation);
+    typeBuilder.potentiallyCheckInlinedParameterTypes(
+        resolvedAst.element.implementation);
 
     if (resolvedAst.element.isGenerativeConstructor) {
       buildFactory(resolvedAst);
@@ -894,20 +942,6 @@
   }
 
   /**
-   * In checked mode, generate type tests for the parameters of the inlined
-   * function.
-   */
-  void potentiallyCheckInlinedParameterTypes(FunctionElement function) {
-    if (!_checkOrTrustTypes) return;
-
-    FunctionSignature signature = function.functionSignature;
-    signature.orderedForEachParameter((ParameterElement parameter) {
-      HInstruction argument = localsHandler.readLocal(parameter);
-      potentiallyCheckOrTrustType(argument, parameter.type);
-    });
-  }
-
-  /**
    * Documentation wanted -- johnniwinther
    *
    * Invariant: [constructors] must contain only implementation elements.
@@ -942,7 +976,7 @@
             TypeVariableType typeVariable = variables.current;
             localsHandler.updateLocal(
                 localsHandler.getTypeVariableAsLocal(typeVariable),
-                analyzeTypeArgument(argument));
+                typeBuilder.analyzeTypeArgument(argument, sourceElement));
           });
         } else {
           // If the supertype is a raw type, we need to set to null the
@@ -984,9 +1018,11 @@
       // Build the initializers in the context of the new constructor.
       ResolvedAst oldResolvedAst = resolvedAst;
       resolvedAst = callee.resolvedAst;
+      final oldElementInferenceResults = elementInferenceResults;
+      elementInferenceResults = inferenceResults.resultOf(callee);
       ClosureClassMap oldClosureData = localsHandler.closureData;
-      ClosureClassMap newClosureData = compiler.closureToClassMapper
-          .computeClosureToClassMapping(resolvedAst);
+      ClosureClassMap newClosureData =
+          compiler.closureToClassMapper.getClosureToClassMapping(resolvedAst);
       localsHandler.closureData = newClosureData;
       if (resolvedAst.kind == ResolvedAstKind.PARSED) {
         localsHandler.enterScope(resolvedAst.node, callee);
@@ -994,6 +1030,7 @@
       buildInitializers(callee, constructorResolvedAsts, fieldValues);
       localsHandler.closureData = oldClosureData;
       resolvedAst = oldResolvedAst;
+      elementInferenceResults = oldElementInferenceResults;
     });
   }
 
@@ -1156,12 +1193,14 @@
           ast.Node right = initializer;
           ResolvedAst savedResolvedAst = resolvedAst;
           resolvedAst = fieldResolvedAst;
+          final oldElementInferenceResults = elementInferenceResults;
+          elementInferenceResults = inferenceResults.resultOf(member);
           // In case the field initializer uses closures, run the
           // closure to class mapper.
-          compiler.closureToClassMapper
-              .computeClosureToClassMapping(resolvedAst);
+          compiler.closureToClassMapper.getClosureToClassMapping(resolvedAst);
           inlinedFrom(fieldResolvedAst, () => right.accept(this));
           resolvedAst = savedResolvedAst;
+          elementInferenceResults = oldElementInferenceResults;
           fieldValues[member] = pop();
         }
       });
@@ -1226,10 +1265,10 @@
 
     // Call the JavaScript constructor with the fields as argument.
     List<HInstruction> constructorArguments = <HInstruction>[];
-    List<Element> fields = <Element>[];
+    List<FieldEntity> fields = <FieldEntity>[];
 
     classElement.forEachInstanceField(
-        (ClassElement enclosingClass, VariableElement member) {
+        (ClassElement enclosingClass, FieldElement member) {
       HInstruction value = fieldValues[member];
       if (value == null) {
         // Uninitialized native fields are pre-initialized by the native
@@ -1239,7 +1278,8 @@
       } else {
         fields.add(member);
         DartType type = localsHandler.substInContext(member.type);
-        constructorArguments.add(potentiallyCheckOrTrustType(value, type));
+        constructorArguments
+            .add(typeBuilder.potentiallyCheckOrTrustType(value, type));
       }
     }, includeSuperAndInjectedMembers: true);
 
@@ -1317,8 +1357,8 @@
       }
       bodyCallInputs.add(newObject);
       ast.Node node = constructorResolvedAst.node;
-      ClosureClassMap parameterClosureData =
-          compiler.closureToClassMapper.getMappingForNestedFunction(node);
+      ClosureClassMap parameterClosureData = compiler.closureToClassMapper
+          .getClosureToClassMapping(constructorResolvedAst);
 
       FunctionSignature functionSignature = body.functionSignature;
       // Provide the parameters to the generative constructor body.
@@ -1437,8 +1477,8 @@
           //       new A("foo");  // invalid in checked mode.
           //
           // Only the final target is allowed to check for the argument types.
-          newParameter =
-              potentiallyCheckOrTrustType(newParameter, parameterElement.type);
+          newParameter = typeBuilder.potentiallyCheckOrTrustType(
+              newParameter, parameterElement.type);
         }
         localsHandler.directLocals[parameterElement] = newParameter;
       });
@@ -1455,131 +1495,36 @@
 
   insertTraceCall(Element element) {
     if (JavaScriptBackend.TRACE_METHOD == 'console') {
-      if (element == backend.traceHelper) return;
+      if (element == backend.helpers.traceHelper) return;
       n(e) => e == null ? '' : e.name;
       String name = "${n(element.library)}:${n(element.enclosingClass)}."
           "${n(element)}";
       HConstant nameConstant = addConstantString(name);
-      add(new HInvokeStatic(backend.traceHelper, <HInstruction>[nameConstant],
-          backend.dynamicType));
+      add(new HInvokeStatic(backend.helpers.traceHelper,
+          <HInstruction>[nameConstant], backend.dynamicType));
     }
   }
 
   insertCoverageCall(Element element) {
     if (JavaScriptBackend.TRACE_METHOD == 'post') {
-      if (element == backend.traceHelper) return;
+      if (element == backend.helpers.traceHelper) return;
       // TODO(sigmund): create a better uuid for elements.
       HConstant idConstant = graph.addConstantInt(element.hashCode, compiler);
       HConstant nameConstant = addConstantString(element.name);
-      add(new HInvokeStatic(backend.traceHelper,
+      add(new HInvokeStatic(backend.helpers.traceHelper,
           <HInstruction>[idConstant, nameConstant], backend.dynamicType));
     }
   }
 
-  /// Check that [type] is valid in the context of `localsHandler.contextClass`.
-  /// This should only be called in assertions.
-  bool assertTypeInContext(DartType type, [Spannable spannable]) {
-    return invariant(spannable == null ? CURRENT_ELEMENT_SPANNABLE : spannable,
-        () {
-      ClassElement contextClass = Types.getClassContext(type);
-      return contextClass == null || contextClass == localsHandler.contextClass;
-    },
-        message: "Type '$type' is not valid context of "
-            "${localsHandler.contextClass}.");
-  }
-
-  /// Build a [HTypeConversion] for converting [original] to type [type].
-  ///
-  /// Invariant: [type] must be valid in the context.
-  /// See [LocalsHandler.substInContext].
-  HInstruction buildTypeConversion(
-      HInstruction original, DartType type, int kind) {
-    if (type == null) return original;
-    // GENERIC_METHODS: The following statement was added for parsing and
-    // ignoring method type variables; must be generalized for full support of
-    // generic methods.
-    type = type.dynamifyMethodTypeVariableType;
-    type = type.unaliased;
-    assert(assertTypeInContext(type, original));
-    if (type.isInterfaceType && !type.treatAsRaw) {
-      TypeMask subtype =
-          new TypeMask.subtype(type.element, compiler.closedWorld);
-      HInstruction representations = buildTypeArgumentRepresentations(type);
-      add(representations);
-      return new HTypeConversion.withTypeRepresentation(
-          type, kind, subtype, original, representations);
-    } else if (type.isTypeVariable) {
-      TypeMask subtype = original.instructionType;
-      HInstruction typeVariable = addTypeVariableReference(type);
-      return new HTypeConversion.withTypeRepresentation(
-          type, kind, subtype, original, typeVariable);
-    } else if (type.isFunctionType) {
-      String name =
-          kind == HTypeConversion.CAST_TYPE_CHECK ? '_asCheck' : '_assertCheck';
-
-      List<HInstruction> arguments = <HInstruction>[
-        buildFunctionType(type),
-        original
-      ];
-      pushInvokeDynamic(
-          null,
-          new Selector.call(
-              new Name(name, helpers.jsHelperLibrary), CallStructure.ONE_ARG),
-          null,
-          arguments);
-
-      return new HTypeConversion(type, kind, original.instructionType, pop());
-    } else {
-      return original.convertType(compiler, type, kind);
-    }
-  }
-
-  HInstruction _trustType(HInstruction original, DartType type) {
-    assert(compiler.options.trustTypeAnnotations);
-    assert(type != null);
-    type = localsHandler.substInContext(type);
-    type = type.unaliased;
-    if (type.isDynamic) return original;
-    if (!type.isInterfaceType) return original;
-    if (type.isObject) return original;
-    // The type element is either a class or the void element.
-    Element element = type.element;
-    TypeMask mask = new TypeMask.subtype(element, compiler.closedWorld);
-    return new HTypeKnown.pinned(mask, original);
-  }
-
-  HInstruction _checkType(HInstruction original, DartType type, int kind) {
-    assert(compiler.options.enableTypeAssertions);
-    assert(type != null);
-    type = localsHandler.substInContext(type);
-    HInstruction other = buildTypeConversion(original, type, kind);
-    registry?.registerTypeUse(new TypeUse.isCheck(type));
-    return other;
-  }
-
-  HInstruction potentiallyCheckOrTrustType(HInstruction original, DartType type,
-      {int kind: HTypeConversion.CHECKED_MODE_CHECK}) {
-    if (type == null) return original;
-    HInstruction checkedOrTrusted = original;
-    if (compiler.options.trustTypeAnnotations) {
-      checkedOrTrusted = _trustType(original, type);
-    } else if (compiler.options.enableTypeAssertions) {
-      checkedOrTrusted = _checkType(original, type, kind);
-    }
-    if (checkedOrTrusted == original) return original;
-    add(checkedOrTrusted);
-    return checkedOrTrusted;
-  }
-
   void assertIsSubtype(
       ast.Node node, DartType subtype, DartType supertype, String message) {
-    HInstruction subtypeInstruction =
-        analyzeTypeArgument(localsHandler.substInContext(subtype));
-    HInstruction supertypeInstruction =
-        analyzeTypeArgument(localsHandler.substInContext(supertype));
+    HInstruction subtypeInstruction = typeBuilder.analyzeTypeArgument(
+        localsHandler.substInContext(subtype), sourceElement);
+    HInstruction supertypeInstruction = typeBuilder.analyzeTypeArgument(
+        localsHandler.substInContext(supertype), sourceElement);
     HInstruction messageInstruction =
         graph.addConstantString(new ast.DartString.literal(message), compiler);
-    Element element = helpers.assertIsSubtype;
+    MethodElement element = helpers.assertIsSubtype;
     var inputs = <HInstruction>[
       subtypeInstruction,
       supertypeInstruction,
@@ -1602,11 +1547,15 @@
     push(attachPosition(instruction, node));
   }
 
+  /// Pops the most recent instruction from the stack and 'boolifies' it.
+  ///
+  /// Boolification is checking if the value is '=== true'.
   @override
   HInstruction popBoolified() {
     HInstruction value = pop();
-    if (_checkOrTrustTypes) {
-      return potentiallyCheckOrTrustType(value, compiler.coreTypes.boolType,
+    if (typeBuilder.checkOrTrustTypes) {
+      return typeBuilder.potentiallyCheckOrTrustType(
+          value, compiler.coreTypes.boolType,
           kind: HTypeConversion.BOOLEAN_CONVERSION_CHECK);
     }
     HInstruction result = new HBoolify(value, backend.boolType);
@@ -1659,7 +1608,7 @@
       pop();
     }
 
-    handleIf(node, visitCondition: buildCondition, visitThen: fail);
+    handleIf(node: node, visitCondition: buildCondition, visitThen: fail);
   }
 
   visitBlock(ast.Block node) {
@@ -1901,8 +1850,9 @@
   }
 
   visitFunctionExpression(ast.FunctionExpression node) {
-    ClosureClassMap nestedClosureData =
-        compiler.closureToClassMapper.getMappingForNestedFunction(node);
+    LocalFunctionElement methodElement = elements[node];
+    ClosureClassMap nestedClosureData = compiler.closureToClassMapper
+        .getClosureToClassMapping(methodElement.resolvedAst);
     assert(nestedClosureData != null);
     assert(nestedClosureData.closureClassElement != null);
     ClosureClassElement closureClassElement =
@@ -1926,7 +1876,6 @@
     push(new HCreate(closureClassElement, capturedVariables, type)
       ..sourceInformation = sourceInformationBuilder.buildCreate(node));
 
-    Element methodElement = nestedClosureData.closureElement;
     registry?.registerInstantiatedClosure(methodElement);
   }
 
@@ -1954,24 +1903,14 @@
 
   visitIf(ast.If node) {
     assert(isReachable);
-    handleIf(node,
+    handleIf(
+        node: node,
         visitCondition: () => visit(node.condition),
         visitThen: () => visit(node.thenPart),
         visitElse: node.elsePart != null ? () => visit(node.elsePart) : null,
         sourceInformation: sourceInformationBuilder.buildIf(node));
   }
 
-  void handleIf(ast.Node diagnosticNode,
-      {void visitCondition(),
-      void visitThen(),
-      void visitElse(),
-      SourceInformation sourceInformation}) {
-    SsaBranchBuilder branchBuilder =
-        new SsaBranchBuilder(this, compiler, diagnosticNode);
-    branchBuilder.handleIf(visitCondition, visitThen, visitElse,
-        sourceInformation: sourceInformation);
-  }
-
   @override
   void visitIfNull(ast.Send node, ast.Node left, ast.Node right, _) {
     SsaBranchBuilder brancher = new SsaBranchBuilder(this, compiler, node);
@@ -2059,7 +1998,7 @@
     }
 
     pushInvokeDynamic(node, elements.getSelector(node),
-        inferenceResults.typeOfSend(node, elements), [operand],
+        elementInferenceResults.typeOfSend(node), [operand],
         sourceInformation: sourceInformationBuilder.buildGeneric(node));
   }
 
@@ -2090,7 +2029,7 @@
         visitAndPop(left),
         visitAndPop(right),
         elements.getSelector(node),
-        inferenceResults.typeOfSend(node, elements),
+        elementInferenceResults.typeOfSend(node),
         node,
         sourceInformation:
             sourceInformationBuilder.buildGeneric(node.selector));
@@ -2224,8 +2163,8 @@
       } else {
         // TODO(5346): Try to avoid the need for calling [declaration] before
         // creating an [HStatic].
-        HInstruction instruction = new HStatic(field.declaration,
-            TypeMaskFactory.inferredTypeForElement(field, compiler))
+        HInstruction instruction = new HStatic(
+            field, TypeMaskFactory.inferredTypeForElement(field, compiler))
           ..sourceInformation = sourceInformation;
         push(instruction);
       }
@@ -2253,16 +2192,17 @@
   void generateDynamicGet(ast.Send node) {
     HInstruction receiver = generateInstanceSendReceiver(node);
     generateInstanceGetterWithCompiledReceiver(node, elements.getSelector(node),
-        inferenceResults.typeOfSend(node, elements), receiver);
+        elementInferenceResults.typeOfSend(node), receiver);
   }
 
-  /// Generate a closurization of the static or top level [function].
-  void generateStaticFunctionGet(ast.Send node, MethodElement function) {
+  /// Generate a closurization of the static or top level [method].
+  void generateStaticFunctionGet(ast.Send node, MethodElement method) {
+    assert(method.isDeclaration);
     // TODO(5346): Try to avoid the need for calling [declaration] before
     // creating an [HStatic].
     SourceInformation sourceInformation =
         sourceInformationBuilder.buildGet(node);
-    push(new HStatic(function.declaration, backend.nonNullType)
+    push(new HStatic(method, backend.nonNullType)
       ..sourceInformation = sourceInformation);
   }
 
@@ -2302,7 +2242,7 @@
           generateInstanceGetterWithCompiledReceiver(
               node,
               elements.getSelector(node),
-              inferenceResults.typeOfSend(node, elements),
+              elementInferenceResults.typeOfSend(node),
               expression);
         });
   }
@@ -2367,7 +2307,7 @@
     if (selector == null) {
       assert(send != null);
       selector = elements.getSelector(send);
-      mask ??= inferenceResults.typeOfSend(send, elements);
+      mask ??= elementInferenceResults.typeOfSend(send);
     }
     if (location == null) {
       assert(send != null);
@@ -2405,9 +2345,9 @@
         pushInvokeStatic(location, element, <HInstruction>[value]);
         pop();
       } else {
-        VariableElement field = element;
-        value = potentiallyCheckOrTrustType(value, field.type);
-        addWithPosition(new HStaticStore(element, value), location);
+        FieldElement field = element;
+        value = typeBuilder.potentiallyCheckOrTrustType(value, field.type);
+        addWithPosition(new HStaticStore(field, value), location);
       }
       stack.add(value);
     } else if (Elements.isError(element)) {
@@ -2423,7 +2363,7 @@
         value.sourceElement = local;
       }
       HInstruction checkedOrTrusted =
-          potentiallyCheckOrTrustType(value, local.type);
+          typeBuilder.potentiallyCheckOrTrustType(value, local.type);
       if (!identical(checkedOrTrusted, value)) {
         pop();
         stack.add(checkedOrTrusted);
@@ -2445,40 +2385,22 @@
     return new HLiteralList(inputs, backend.extendableArrayType);
   }
 
-  HInstruction buildTypeArgumentRepresentations(DartType type) {
-    assert(!type.isTypeVariable);
-    // Compute the representation of the type arguments, including access
-    // to the runtime type information for type variables as instructions.
-    assert(type.element.isClass);
-    InterfaceType interface = type;
-    List<HInstruction> inputs = <HInstruction>[];
-    for (DartType argument in interface.typeArguments) {
-      inputs.add(analyzeTypeArgument(argument));
-    }
-    HInstruction representation = new HTypeInfoExpression(
-        TypeInfoExpressionKind.INSTANCE,
-        interface.element.thisType,
-        inputs,
-        backend.dynamicType);
-    return representation;
-  }
-
   @override
   void visitAs(ast.Send node, ast.Node expression, DartType type, _) {
     HInstruction expressionInstruction = visitAndPop(expression);
     if (type.isMalformed) {
-      String message;
       if (type is MalformedType) {
         ErroneousElement element = type.element;
-        message = element.message;
+        generateTypeError(node, element.message);
       } else {
         assert(type is MethodTypeVariableType);
-        message = "Method type variables are not reified.";
+        stack.add(expressionInstruction);
       }
-      generateTypeError(node, message);
     } else {
-      HInstruction converted = buildTypeConversion(expressionInstruction,
-          localsHandler.substInContext(type), HTypeConversion.CAST_TYPE_CHECK);
+      HInstruction converted = typeBuilder.buildTypeConversion(
+          expressionInstruction,
+          localsHandler.substInContext(type),
+          HTypeConversion.CAST_TYPE_CHECK);
       if (converted != expressionInstruction) add(converted);
       stack.add(converted);
     }
@@ -2524,7 +2446,8 @@
           arguments);
       return new HIs.compound(type, expression, pop(), backend.boolType);
     } else if (type.isTypeVariable) {
-      HInstruction runtimeType = addTypeVariableReference(type);
+      HInstruction runtimeType =
+          typeBuilder.addTypeVariableReference(type, sourceElement);
       Element helper = helpers.checkSubtypeOfRuntimeType;
       List<HInstruction> inputs = <HInstruction>[expression, runtimeType];
       pushInvokeStatic(null, helper, inputs, typeMask: backend.boolType);
@@ -2533,7 +2456,8 @@
     } else if (RuntimeTypes.hasTypeArguments(type)) {
       ClassElement element = type.element;
       Element helper = helpers.checkSubtype;
-      HInstruction representations = buildTypeArgumentRepresentations(type);
+      HInstruction representations =
+          typeBuilder.buildTypeArgumentRepresentations(type, sourceElement);
       add(representations);
       js.Name operator = backend.namer.operatorIs(element);
       HInstruction isFieldName = addConstantStringFromName(operator);
@@ -2561,11 +2485,6 @@
     }
   }
 
-  HInstruction buildFunctionType(FunctionType type) {
-    type.accept(new TypeBuilder(compiler.closedWorld), this);
-    return pop();
-  }
-
   void addDynamicSendArgumentsToList(ast.Send node, List<HInstruction> list) {
     CallStructure callStructure = elements.getSelector(node).callStructure;
     if (callStructure.namedArgumentCount == 0) {
@@ -2640,7 +2559,7 @@
 
   void _generateDynamicSend(ast.Send node, HInstruction receiver) {
     Selector selector = elements.getSelector(node);
-    TypeMask mask = inferenceResults.typeOfSend(node, elements);
+    TypeMask mask = elementInferenceResults.typeOfSend(node);
     SourceInformation sourceInformation =
         sourceInformationBuilder.buildCall(node, node.selector);
 
@@ -3067,7 +2986,7 @@
 
   void handleForeignSend(ast.Send node, FunctionElement element) {
     String name = element.name;
-    if (name == 'JS') {
+    if (name == BackendHelpers.JS) {
       handleForeignJs(node);
     } else if (name == 'JS_CURRENT_ISOLATE_CONTEXT') {
       handleForeignJsCurrentIsolateContext(node);
@@ -3083,15 +3002,15 @@
       handleForeignJsGetStaticState(node);
     } else if (name == 'JS_GET_NAME') {
       handleForeignJsGetName(node);
-    } else if (name == 'JS_EMBEDDED_GLOBAL') {
+    } else if (name == BackendHelpers.JS_EMBEDDED_GLOBAL) {
       handleForeignJsEmbeddedGlobal(node);
-    } else if (name == 'JS_BUILTIN') {
+    } else if (name == BackendHelpers.JS_BUILTIN) {
       handleForeignJsBuiltin(node);
     } else if (name == 'JS_GET_FLAG') {
       handleForeignJsGetFlag(node);
     } else if (name == 'JS_EFFECT') {
       stack.add(graph.addConstantNull(compiler));
-    } else if (name == 'JS_INTERCEPTOR_CONSTANT') {
+    } else if (name == BackendHelpers.JS_INTERCEPTOR_CONSTANT) {
       handleJsInterceptorConstant(node);
     } else if (name == 'JS_STRING_CONCAT') {
       handleJsStringConcat(node);
@@ -3104,7 +3023,7 @@
       SourceInformation sourceInformation) {
     // Until now we only handle these as getters.
     invariant(node, deferredLoader.isDeferredLoaderGetter);
-    Element loadFunction = helpers.loadLibraryWrapper;
+    FunctionEntity loadFunction = helpers.loadLibraryWrapper;
     PrefixElement prefixElement = deferredLoader.enclosingElement;
     String loadId =
         compiler.deferredLoadTask.getImportDeferName(node, prefixElement);
@@ -3124,7 +3043,7 @@
     if (!Selectors.noSuchMethod_.signatureApplies(element)) {
       element = coreClasses.objectClass.lookupMember(Identifiers.noSuchMethod_);
     }
-    if (compiler.enabledInvokeOn && !element.enclosingClass.isObject) {
+    if (backend.hasInvokeOnSupport && !element.enclosingClass.isObject) {
       // Register the call as dynamic if [noSuchMethod] on the super
       // class is _not_ the default implementation from [Object], in
       // case the [noSuchMethod] implementation calls
@@ -3173,16 +3092,16 @@
   }
 
   /// Generate a call to a super method or constructor.
-  void generateSuperInvoke(ast.Send node, FunctionElement function,
+  void generateSuperInvoke(ast.Send node, MethodElement method,
       SourceInformation sourceInformation) {
     // TODO(5347): Try to avoid the need for calling [implementation] before
     // calling [makeStaticArgumentList].
     Selector selector = elements.getSelector(node);
-    assert(invariant(node, selector.applies(function.implementation),
-        message: "$selector does not apply to ${function.implementation}"));
+    assert(invariant(node, selector.applies(method.implementation),
+        message: "$selector does not apply to ${method.implementation}"));
     List<HInstruction> inputs = makeStaticArgumentList(
-        selector.callStructure, node.arguments, function.implementation);
-    push(buildInvokeSuper(selector, function, inputs, sourceInformation));
+        selector.callStructure, node.arguments, method.implementation);
+    push(buildInvokeSuper(selector, method, inputs, sourceInformation));
   }
 
   /// Access the value from the super [element].
@@ -3352,113 +3271,6 @@
     });
   }
 
-  /**
-   * Generate code to extract the type argument from the object.
-   */
-  HInstruction readTypeVariable(TypeVariableType variable,
-      {SourceInformation sourceInformation}) {
-    assert(sourceElement.isInstanceMember);
-    assert(variable is! MethodTypeVariableType);
-    HInstruction target = localsHandler.readThis();
-    push(new HTypeInfoReadVariable(variable, target, backend.dynamicType)
-      ..sourceInformation = sourceInformation);
-    return pop();
-  }
-
-  // TODO(karlklose): this is needed to avoid a bug where the resolved type is
-  // not stored on a type annotation in the closure translator. Remove when
-  // fixed.
-  bool hasDirectLocal(Local local) {
-    return !localsHandler.isAccessedDirectly(local) ||
-        localsHandler.directLocals[local] != null;
-  }
-
-  /**
-   * Helper to create an instruction that gets the value of a type variable.
-   */
-  HInstruction addTypeVariableReference(TypeVariableType type,
-      {SourceInformation sourceInformation}) {
-    assert(assertTypeInContext(type));
-    if (type is MethodTypeVariableType) {
-      return graph.addConstantNull(compiler);
-    }
-    Element member = sourceElement;
-    bool isClosure = member.enclosingElement.isClosure;
-    if (isClosure) {
-      ClosureClassElement closureClass = member.enclosingElement;
-      member = closureClass.methodElement;
-      member = member.outermostEnclosingMemberOrTopLevel;
-    }
-    bool isInConstructorContext =
-        member.isConstructor || member.isGenerativeConstructorBody;
-    Local typeVariableLocal = localsHandler.getTypeVariableAsLocal(type);
-    if (isClosure) {
-      if (member.isFactoryConstructor ||
-          (isInConstructorContext && hasDirectLocal(typeVariableLocal))) {
-        // The type variable is used from a closure in a factory constructor.
-        // The value of the type argument is stored as a local on the closure
-        // itself.
-        return localsHandler.readLocal(typeVariableLocal,
-            sourceInformation: sourceInformation);
-      } else if (member.isFunction ||
-          member.isGetter ||
-          member.isSetter ||
-          isInConstructorContext) {
-        // The type variable is stored on the "enclosing object" and needs to be
-        // accessed using the this-reference in the closure.
-        return readTypeVariable(type, sourceInformation: sourceInformation);
-      } else {
-        assert(member.isField);
-        // The type variable is stored in a parameter of the method.
-        return localsHandler.readLocal(typeVariableLocal);
-      }
-    } else if (isInConstructorContext ||
-        // When [member] is a field, we can be either
-        // generating a checked setter or inlining its
-        // initializer in a constructor. An initializer is
-        // never built standalone, so in that case [target] is not
-        // the [member] itself.
-        (member.isField && member != target)) {
-      // The type variable is stored in a parameter of the method.
-      return localsHandler.readLocal(typeVariableLocal,
-          sourceInformation: sourceInformation);
-    } else if (member.isInstanceMember) {
-      // The type variable is stored on the object.
-      return readTypeVariable(type, sourceInformation: sourceInformation);
-    } else {
-      reporter.internalError(
-          type.element, 'Unexpected type variable in static context.');
-      return null;
-    }
-  }
-
-  HInstruction analyzeTypeArgument(DartType argument,
-      {SourceInformation sourceInformation}) {
-    assert(assertTypeInContext(argument));
-    argument = argument.unaliased;
-    if (argument.treatAsDynamic) {
-      // Represent [dynamic] as [null].
-      return graph.addConstantNull(compiler);
-    }
-
-    if (argument.isTypeVariable) {
-      return addTypeVariableReference(argument,
-          sourceInformation: sourceInformation);
-    }
-
-    List<HInstruction> inputs = <HInstruction>[];
-    argument.forEachTypeVariable((variable) {
-      if (variable is! MethodTypeVariableType) {
-        inputs.add(analyzeTypeArgument(variable));
-      }
-    });
-    HInstruction result = new HTypeInfoExpression(
-        TypeInfoExpressionKind.COMPLETE, argument, inputs, backend.dynamicType)
-      ..sourceInformation = sourceInformation;
-    add(result);
-    return result;
-  }
-
   HInstruction handleListConstructor(
       InterfaceType type, ast.Node currentNode, HInstruction newObject) {
     if (!backend.classNeedsRti(type.element) || type.treatAsRaw) {
@@ -3467,27 +3279,11 @@
     List<HInstruction> inputs = <HInstruction>[];
     type = localsHandler.substInContext(type);
     type.typeArguments.forEach((DartType argument) {
-      inputs.add(analyzeTypeArgument(argument));
+      inputs.add(typeBuilder.analyzeTypeArgument(argument, sourceElement));
     });
     // TODO(15489): Register at codegen.
     registry?.registerInstantiation(type);
-    return callSetRuntimeTypeInfoWithTypeArguments(
-        type.element, inputs, newObject);
-  }
-
-  HInstruction callSetRuntimeTypeInfoWithTypeArguments(ClassElement element,
-      List<HInstruction> rtiInputs, HInstruction newObject) {
-    if (!backend.classNeedsRti(element)) {
-      return newObject;
-    }
-
-    HInstruction typeInfo = new HTypeInfoExpression(
-        TypeInfoExpressionKind.INSTANCE,
-        element.thisType,
-        rtiInputs,
-        backend.dynamicType);
-    add(typeInfo);
-    return callSetRuntimeTypeInfo(typeInfo, newObject);
+    return callSetRuntimeTypeInfoWithTypeArguments(type, inputs, newObject);
   }
 
   HInstruction callSetRuntimeTypeInfo(
@@ -3644,12 +3440,8 @@
     TypeMask elementType = computeType(constructor);
     if (isFixedListConstructorCall) {
       if (!inputs[0].isNumber(compiler)) {
-        HTypeConversion conversion = new HTypeConversion(
-            null,
-            HTypeConversion.ARGUMENT_TYPE_CHECK,
-            backend.numType,
-            inputs[0],
-            null);
+        HTypeConversion conversion = new HTypeConversion(null,
+            HTypeConversion.ARGUMENT_TYPE_CHECK, backend.numType, inputs[0]);
         add(conversion);
         inputs[0] = conversion;
       }
@@ -3687,7 +3479,7 @@
           sourceInformationBuilder.buildNew(send);
       potentiallyAddTypeArguments(inputs, cls, expectedType);
       addInlinedInstantiation(expectedType);
-      pushInvokeStatic(node, constructor, inputs,
+      pushInvokeStatic(node, constructor.declaration, inputs,
           typeMask: elementType,
           instanceType: expectedType,
           sourceInformation: sourceInformation);
@@ -3715,7 +3507,8 @@
 
     // Finally, if we called a redirecting factory constructor, check the type.
     if (isRedirected) {
-      HInstruction checked = potentiallyCheckOrTrustType(newInstance, type);
+      HInstruction checked =
+          typeBuilder.potentiallyCheckOrTrustType(newInstance, type);
       if (checked != newInstance) {
         pop();
         stack.add(checked);
@@ -3729,8 +3522,8 @@
     if (!backend.classNeedsRti(cls)) return;
     assert(cls.typeVariables.length == expectedType.typeArguments.length);
     expectedType.typeArguments.forEach((DartType argument) {
-      inputs.add(
-          analyzeTypeArgument(argument, sourceInformation: sourceInformation));
+      inputs.add(typeBuilder.analyzeTypeArgument(argument, sourceElement,
+          sourceInformation: sourceInformation));
     });
   }
 
@@ -3743,7 +3536,7 @@
         new Map<DartType, Set<DartType>>();
     bool definitelyFails = false;
 
-    addTypeVariableBoundCheck(GenericType instance, DartType typeArgument,
+    void addTypeVariableBoundCheck(GenericType instance, DartType typeArgument,
         TypeVariableType typeVariable, DartType bound) {
       if (definitelyFails) return;
 
@@ -4002,7 +3795,7 @@
       generateTypeError(node, "Method type variables are not reified");
     } else {
       DartType type = localsHandler.substInContext(typeVariable);
-      HInstruction value = analyzeTypeArgument(type,
+      HInstruction value = typeBuilder.analyzeTypeArgument(type, sourceElement,
           sourceInformation: sourceInformationBuilder.buildGet(node));
       pushInvokeStatic(node, helpers.runtimeTypeToString, [value],
           typeMask: backend.stringType);
@@ -4337,10 +4130,11 @@
   }
 
   void pushInvokeStatic(
-      ast.Node location, Element element, List<HInstruction> arguments,
+      ast.Node location, MethodElement element, List<HInstruction> arguments,
       {TypeMask typeMask,
       InterfaceType instanceType,
       SourceInformation sourceInformation}) {
+    assert(element.isDeclaration);
     // TODO(johnniwinther): Use [sourceInformation] instead of [location].
     if (tryInlineMethod(element, null, null, arguments, location,
         instanceType: instanceType)) {
@@ -4359,7 +4153,7 @@
           invokeJsInteropFunction(element, arguments, sourceInformation);
     } else {
       // creating an [HInvokeStatic].
-      instruction = new HInvokeStatic(element.declaration, arguments, typeMask,
+      instruction = new HInvokeStatic(element, arguments, typeMask,
           targetCanThrow: targetCanThrow)
         ..sourceInformation = sourceInformation;
       if (currentInlinedInstantiations.isNotEmpty) {
@@ -4377,7 +4171,7 @@
   }
 
   HInstruction buildInvokeSuper(
-      Selector selector, Element element, List<HInstruction> arguments,
+      Selector selector, MemberElement element, List<HInstruction> arguments,
       [SourceInformation sourceInformation]) {
     HInstruction receiver = localsHandler.readThis();
     // TODO(5346): Try to avoid the need for calling [declaration] before
@@ -4419,7 +4213,7 @@
         receiver,
         rhs,
         elements.getOperatorSelectorInComplexSendSet(node),
-        inferenceResults.typeOfOperator(node, elements),
+        elementInferenceResults.typeOfOperator(node),
         node,
         sourceInformation:
             sourceInformationBuilder.buildGeneric(node.assignmentOperator));
@@ -4782,7 +4576,7 @@
       }
 
       pushInvokeDynamic(node, elements.getGetterSelectorInComplexSendSet(node),
-          inferenceResults.typeOfGetter(node, elements), [receiver, index]);
+          elementInferenceResults.typeOfGetter(node), [receiver, index]);
       HInstruction getterInstruction = pop();
       if (node.isIfNullAssignment) {
         // Compile x[i] ??= e as:
@@ -4797,7 +4591,7 @@
           pushInvokeDynamic(
               node,
               elements.getSelector(node),
-              inferenceResults.typeOfSend(node, elements),
+              elementInferenceResults.typeOfSend(node),
               [receiver, index, value]);
           pop();
           stack.add(value);
@@ -4805,11 +4599,8 @@
       } else {
         handleComplexOperatorSend(node, getterInstruction, arguments);
         HInstruction value = pop();
-        pushInvokeDynamic(
-            node,
-            elements.getSelector(node),
-            inferenceResults.typeOfSend(node, elements),
-            [receiver, index, value]);
+        pushInvokeDynamic(node, elements.getSelector(node),
+            elementInferenceResults.typeOfSend(node), [receiver, index, value]);
         pop();
         if (node.isPostfix) {
           stack.add(getterInstruction);
@@ -5013,7 +4804,7 @@
         generateInstanceGetterWithCompiledReceiver(
             node,
             elements.getGetterSelectorInComplexSendSet(node),
-            inferenceResults.typeOfGetter(node, elements),
+            elementInferenceResults.typeOfGetter(node),
             receiver);
         HInstruction getterInstruction = pop();
         if (node.isIfNullAssignment) {
@@ -5330,10 +5121,10 @@
           redirectingConstructor.computeEffectiveTargetType(cls.thisType);
       targetType = localsHandler.substInContext(targetType);
       targetType.typeArguments.forEach((DartType argument) {
-        inputs.add(analyzeTypeArgument(argument));
+        inputs.add(typeBuilder.analyzeTypeArgument(argument, sourceElement));
       });
     }
-    pushInvokeStatic(node, targetConstructor, inputs);
+    pushInvokeStatic(node, targetConstructor.declaration, inputs);
     HInstruction value = pop();
     emitReturn(value, node);
   }
@@ -5380,7 +5171,7 @@
           return;
         }
       } else {
-        value = potentiallyCheckOrTrustType(value, returnType);
+        value = typeBuilder.potentiallyCheckOrTrustType(value, returnType);
       }
     }
 
@@ -5442,12 +5233,11 @@
     }
     List<HInstruction> arguments = <HInstruction>[];
     for (DartType argument in type.typeArguments) {
-      arguments.add(analyzeTypeArgument(argument));
+      arguments.add(typeBuilder.analyzeTypeArgument(argument, sourceElement));
     }
     // TODO(15489): Register at codegen.
     registry?.registerInstantiation(type);
-    return callSetRuntimeTypeInfoWithTypeArguments(
-        type.element, arguments, object);
+    return callSetRuntimeTypeInfoWithTypeArguments(type, arguments, object);
   }
 
   visitLiteralList(ast.LiteralList node) {
@@ -5476,8 +5266,8 @@
   }
 
   _inferredTypeOfNewList(ast.Node node) =>
-      inferenceResults.typeOfNewList(sourceElement, node) ??
-      compiler.commonMasks.dynamicType;
+      _resultOf(sourceElement).typeOfNewList(node) ??
+      compiler.closedWorld.commonMasks.dynamicType;
 
   visitConditional(ast.Conditional node) {
     SsaBranchBuilder brancher = new SsaBranchBuilder(this, compiler, node);
@@ -5572,7 +5362,7 @@
 
     HInstruction buildCondition() {
       Selector selector = Selectors.moveNext;
-      TypeMask mask = inferenceResults.typeOfIteratorMoveNext(node, elements);
+      TypeMask mask = elementInferenceResults.typeOfIteratorMoveNext(node);
       pushInvokeDynamic(node, selector, mask, [streamIterator]);
       HInstruction future = pop();
       push(new HAwait(
@@ -5584,8 +5374,7 @@
 
     void buildBody() {
       Selector call = Selectors.current;
-      TypeMask callMask =
-          inferenceResults.typeOfIteratorCurrent(node, elements);
+      TypeMask callMask = elementInferenceResults.typeOfIteratorCurrent(node);
       pushInvokeDynamic(node, call, callMask, [streamIterator]);
 
       ast.Node identifier = node.declaredIdentifier;
@@ -5594,7 +5383,7 @@
       HInstruction value = pop();
       if (identifier.asSend() != null &&
           Elements.isInstanceSend(identifier, elements)) {
-        TypeMask mask = inferenceResults.typeOfSend(identifier, elements);
+        TypeMask mask = elementInferenceResults.typeOfSend(identifier);
         HInstruction receiver = generateInstanceSendReceiver(identifier);
         assert(receiver != null);
         generateInstanceSetterWithCompiledReceiver(null, receiver, value,
@@ -5633,7 +5422,7 @@
     // method is inlined.  We would require full scalar replacement in that
     // case.
 
-    TypeMask mask = inferenceResults.typeOfIterator(node, elements);
+    TypeMask mask = elementInferenceResults.typeOfIterator(node);
 
     ClosedWorld closedWorld = compiler.closedWorld;
     if (mask != null &&
@@ -5658,7 +5447,7 @@
 
     void buildInitializer() {
       Selector selector = Selectors.iterator;
-      TypeMask mask = inferenceResults.typeOfIterator(node, elements);
+      TypeMask mask = elementInferenceResults.typeOfIterator(node);
       visit(node.expression);
       HInstruction receiver = pop();
       pushInvokeDynamic(node, selector, mask, [receiver]);
@@ -5667,14 +5456,14 @@
 
     HInstruction buildCondition() {
       Selector selector = Selectors.moveNext;
-      TypeMask mask = inferenceResults.typeOfIteratorMoveNext(node, elements);
+      TypeMask mask = elementInferenceResults.typeOfIteratorMoveNext(node);
       pushInvokeDynamic(node, selector, mask, [iterator]);
       return popBoolified();
     }
 
     void buildBody() {
       Selector call = Selectors.current;
-      TypeMask mask = inferenceResults.typeOfIteratorCurrent(node, elements);
+      TypeMask mask = elementInferenceResults.typeOfIteratorCurrent(node);
       pushInvokeDynamic(node, call, mask, [iterator]);
       buildAssignLoopVariable(node, pop());
       visit(node.body);
@@ -5691,7 +5480,7 @@
 
     if (identifier.asSend() != null &&
         Elements.isInstanceSend(identifier, elements)) {
-      TypeMask mask = inferenceResults.typeOfSend(identifier, elements);
+      TypeMask mask = elementInferenceResults.typeOfSend(identifier);
       HInstruction receiver = generateInstanceSendReceiver(identifier);
       assert(receiver != null);
       generateInstanceSetterWithCompiledReceiver(null, receiver, value,
@@ -5722,7 +5511,7 @@
     HInstruction originalLength = null; // Set for growable lists.
 
     HInstruction buildGetLength() {
-      Element lengthElement = helpers.jsIndexableLength;
+      MemberElement lengthElement = helpers.jsIndexableLength;
       HFieldGet result = new HFieldGet(
           lengthElement, array, backend.positiveIntType,
           isAssignable: !isFixed);
@@ -5891,7 +5680,8 @@
     if (backend.classNeedsRti(cls)) {
       List<HInstruction> typeInputs = <HInstruction>[];
       expectedType.typeArguments.forEach((DartType argument) {
-        typeInputs.add(analyzeTypeArgument(argument));
+        typeInputs
+            .add(typeBuilder.analyzeTypeArgument(argument, sourceElement));
       });
 
       // We lift this common call pattern into a helper function to save space
@@ -6160,7 +5950,8 @@
             nativeBehavior: native.NativeBehavior.PURE));
       }
 
-      handleIf(node,
+      handleIf(
+          node: node,
           visitCondition: buildCondition,
           visitThen: buildLoop,
           visitElse: () => {});
@@ -6199,7 +5990,6 @@
 
     List<HStatementInformation> statements = <HStatementInformation>[];
     bool hasDefault = false;
-    Element getFallThroughErrorElement = helpers.fallThroughError;
     HasNextIterator<ast.Node> caseIterator =
         new HasNextIterator<ast.Node>(switchCases.iterator);
     while (caseIterator.hasNext) {
@@ -6222,8 +6012,8 @@
       localsHandler = new LocalsHandler.from(savedLocals);
       buildSwitchCase(switchCase);
       if (!isAborted()) {
-        if (caseIterator.hasNext) {
-          pushInvokeStatic(switchCase, getFallThroughErrorElement, []);
+        if (caseIterator.hasNext && isReachable) {
+          pushInvokeStatic(switchCase, helpers.fallThroughError, []);
           HInstruction error = pop();
           closeAndGotoExit(new HThrow(error, error.sourceInformation));
         } else if (!isDefaultCase(switchCase)) {
@@ -6502,16 +6292,24 @@
               isRethrow: true));
         } else {
           ast.CatchBlock newBlock = link.head;
-          handleIf(node, visitCondition: () {
-            pushCondition(newBlock);
-          }, visitThen: visitThen, visitElse: visitElse);
+          handleIf(
+              node: node,
+              visitCondition: () {
+                pushCondition(newBlock);
+              },
+              visitThen: visitThen,
+              visitElse: visitElse);
         }
       }
 
       ast.CatchBlock firstBlock = link.head;
-      handleIf(node, visitCondition: () {
-        pushCondition(firstBlock);
-      }, visitThen: visitThen, visitElse: visitElse);
+      handleIf(
+          node: node,
+          visitCondition: () {
+            pushCondition(firstBlock);
+          },
+          visitThen: visitThen,
+          visitElse: visitElse);
       if (!isAborted()) endCatchBlock = close(new HGoto());
 
       rethrowableException = oldRethrowableException;
@@ -6622,8 +6420,10 @@
         stack,
         localsHandler,
         inTryStatement,
-        allInlinedFunctionsCalledOnce && isFunctionCalledOnce(function));
+        isCalledOnce(function),
+        elementInferenceResults);
     resolvedAst = functionResolvedAst;
+    elementInferenceResults = _resultOf(function);
     inliningStack.add(state);
 
     // Setting up the state of the (AST) builder is performed even when the
@@ -6944,6 +6744,7 @@
   final LocalsHandler oldLocalsHandler;
   final bool inTryStatement;
   final bool allFunctionsCalledOnce;
+  final GlobalTypeInferenceElementResult oldElementInferenceResults;
 
   AstInliningState(
       FunctionElement function,
@@ -6953,97 +6754,7 @@
       this.oldStack,
       this.oldLocalsHandler,
       this.inTryStatement,
-      this.allFunctionsCalledOnce)
+      this.allFunctionsCalledOnce,
+      this.oldElementInferenceResults)
       : super(function);
 }
-
-class TypeBuilder implements DartTypeVisitor<dynamic, SsaBuilder> {
-  final ClosedWorld closedWorld;
-
-  TypeBuilder(this.closedWorld);
-
-  void visit(DartType type, SsaBuilder builder) => type.accept(this, builder);
-
-  void visitVoidType(VoidType type, SsaBuilder builder) {
-    ClassElement cls = builder.backend.helpers.VoidRuntimeType;
-    builder.push(new HVoidType(type, new TypeMask.exact(cls, closedWorld)));
-  }
-
-  void visitTypeVariableType(TypeVariableType type, SsaBuilder builder) {
-    ClassElement cls = builder.backend.helpers.RuntimeType;
-    TypeMask instructionType = new TypeMask.subclass(cls, closedWorld);
-    if (!builder.sourceElement.enclosingElement.isClosure &&
-        builder.sourceElement.isInstanceMember) {
-      HInstruction receiver = builder.localsHandler.readThis();
-      builder.push(new HReadTypeVariable(type, receiver, instructionType));
-    } else {
-      builder.push(new HReadTypeVariable.noReceiver(
-          type, builder.addTypeVariableReference(type), instructionType));
-    }
-  }
-
-  void visitFunctionType(FunctionType type, SsaBuilder builder) {
-    type.returnType.accept(this, builder);
-    HInstruction returnType = builder.pop();
-    List<HInstruction> inputs = <HInstruction>[returnType];
-
-    for (DartType parameter in type.parameterTypes) {
-      parameter.accept(this, builder);
-      inputs.add(builder.pop());
-    }
-
-    for (DartType parameter in type.optionalParameterTypes) {
-      parameter.accept(this, builder);
-      inputs.add(builder.pop());
-    }
-
-    List<DartType> namedParameterTypes = type.namedParameterTypes;
-    List<String> names = type.namedParameters;
-    for (int index = 0; index < names.length; index++) {
-      ast.DartString dartString = new ast.DartString.literal(names[index]);
-      inputs.add(builder.graph.addConstantString(dartString, builder.compiler));
-      namedParameterTypes[index].accept(this, builder);
-      inputs.add(builder.pop());
-    }
-
-    ClassElement cls = builder.backend.helpers.RuntimeFunctionType;
-    builder.push(
-        new HFunctionType(inputs, type, new TypeMask.exact(cls, closedWorld)));
-  }
-
-  void visitMalformedType(MalformedType type, SsaBuilder builder) {
-    visitDynamicType(const DynamicType(), builder);
-  }
-
-  void visitStatementType(StatementType type, SsaBuilder builder) {
-    throw 'not implemented visitStatementType($type)';
-  }
-
-  void visitInterfaceType(InterfaceType type, SsaBuilder builder) {
-    List<HInstruction> inputs = <HInstruction>[];
-    for (DartType typeArgument in type.typeArguments) {
-      typeArgument.accept(this, builder);
-      inputs.add(builder.pop());
-    }
-    ClassElement cls;
-    if (type.typeArguments.isEmpty) {
-      cls = builder.backend.helpers.RuntimeTypePlain;
-    } else {
-      cls = builder.backend.helpers.RuntimeTypeGeneric;
-    }
-    builder.push(
-        new HInterfaceType(inputs, type, new TypeMask.exact(cls, closedWorld)));
-  }
-
-  void visitTypedefType(TypedefType type, SsaBuilder builder) {
-    DartType unaliased = type.unaliased;
-    if (unaliased is TypedefType) throw 'unable to unalias $type';
-    unaliased.accept(this, builder);
-  }
-
-  void visitDynamicType(DynamicType type, SsaBuilder builder) {
-    JavaScriptBackend backend = builder.compiler.backend;
-    ClassElement cls = backend.helpers.DynamicRuntimeType;
-    builder.push(new HDynamicType(type, new TypeMask.exact(cls, closedWorld)));
-  }
-}
diff --git a/pkg/compiler/lib/src/ssa/builder_kernel.dart b/pkg/compiler/lib/src/ssa/builder_kernel.dart
index a309e39..c05772e 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -9,15 +9,27 @@
 import '../common/names.dart';
 import '../common/tasks.dart' show CompilerTask;
 import '../compiler.dart';
+import '../constants/values.dart'
+    show
+        ConstantValue,
+        InterceptorConstantValue,
+        StringConstantValue,
+        TypeConstantValue;
 import '../dart_types.dart';
 import '../elements/elements.dart';
 import '../io/source_information.dart';
+import '../js/js.dart' as js;
 import '../js_backend/backend.dart' show JavaScriptBackend;
 import '../kernel/kernel.dart';
+import '../native/native.dart' as native;
 import '../resolution/tree_elements.dart';
 import '../tree/dartstring.dart';
+import '../tree/nodes.dart' show FunctionExpression, Node;
 import '../types/masks.dart';
+import '../universe/call_structure.dart' show CallStructure;
 import '../universe/selector.dart';
+import '../universe/use.dart' show StaticUse, TypeUse;
+import '../universe/side_effects.dart' show SideEffects;
 import 'graph_builder.dart';
 import 'kernel_ast_adapter.dart';
 import 'kernel_string_builder.dart';
@@ -25,6 +37,8 @@
 import 'loop_handler.dart';
 import 'nodes.dart';
 import 'ssa_branch_builder.dart';
+import 'type_builder.dart';
+import 'types.dart' show TypeMaskFactory;
 
 class SsaKernelBuilderTask extends CompilerTask {
   final JavaScriptBackend backend;
@@ -53,6 +67,14 @@
   final ResolvedAst resolvedAst;
   final CodegenRegistry registry;
 
+  /// A stack of [DartType]s that have been seen during inlining of factory
+  /// constructors.  These types are preserved in [HInvokeStatic]s and
+  /// [HCreate]s inside the inline code and registered during code generation
+  /// for these nodes.
+  // TODO(karlklose): consider removing this and keeping the (substituted) types
+  // of the type variables in an environment (like the [LocalsHandler]).
+  final List<DartType> currentImplicitInstantiations = <DartType>[];
+
   @override
   JavaScriptBackend get backend => compiler.backend;
 
@@ -62,6 +84,10 @@
   SourceInformationBuilder sourceInformationBuilder;
   KernelAstAdapter astAdapter;
   LoopHandler<ir.Node> loopHandler;
+  TypeBuilder typeBuilder;
+
+  final Map<ir.VariableDeclaration, HInstruction> letBindings =
+      <ir.VariableDeclaration, HInstruction>{};
 
   KernelSsaBuilder(
       this.targetElement,
@@ -72,6 +98,7 @@
       Kernel kernel) {
     this.compiler = compiler;
     this.loopHandler = new KernelLoopHandler(this);
+    typeBuilder = new TypeBuilder(this);
     graph.element = targetElement;
     // TODO(het): Should sourceInformationBuilder be in GraphBuilder?
     this.sourceInformationBuilder =
@@ -108,29 +135,203 @@
 
   void buildField(ir.Field field) {
     openFunction();
-    field.initializer.accept(this);
+    if (field.initializer != null) {
+      field.initializer.accept(this);
+    } else {
+      stack.add(graph.addConstantNull(compiler));
+    }
     HInstruction value = pop();
     closeAndGotoExit(new HReturn(value, null));
     closeFunction();
   }
 
+  /// Pops the most recent instruction from the stack and 'boolifies' it.
+  ///
+  /// Boolification is checking if the value is '=== true'.
   @override
   HInstruction popBoolified() {
     HInstruction value = pop();
-    // TODO(het): add boolean conversion type check
+    if (typeBuilder.checkOrTrustTypes) {
+      return typeBuilder.potentiallyCheckOrTrustType(
+          value, compiler.coreTypes.boolType,
+          kind: HTypeConversion.BOOLEAN_CONVERSION_CHECK);
+    }
     HInstruction result = new HBoolify(value, backend.boolType);
     add(result);
     return result;
   }
 
+  /// Builds generative constructors.
+  ///
+  /// Generative constructors are built in two stages.
+  ///
+  /// First, the field values for every instance field for every class in the
+  /// class hierarchy are collected. Then, create a function body that sets
+  /// all of the instance fields to the collected values and call the
+  /// constructor bodies for all constructors in the hierarchy.
   void buildConstructor(ir.Constructor constructor) {
-    // TODO(het): Actually handle this correctly
-    HBasicBlock block = graph.addNewBlock();
-    open(graph.entry);
-    close(new HGoto()).addSuccessor(block);
-    open(block);
-    closeAndGotoExit(new HGoto());
-    graph.finalize();
+    openFunction();
+
+    // Collect field values for the current class.
+    // TODO(het): Does kernel always put field initializers in the constructor
+    //            initializer list? If so then this is unnecessary...
+    Map<ir.Field, HInstruction> fieldValues =
+        _collectFieldValues(constructor.enclosingClass);
+
+    _buildInitializers(constructor, fieldValues);
+
+    final constructorArguments = <HInstruction>[];
+    astAdapter.getClass(constructor.enclosingClass).forEachInstanceField(
+        (ClassElement enclosingClass, FieldElement member) {
+      var value = fieldValues[astAdapter.getFieldFromElement(member)];
+      constructorArguments.add(value);
+    }, includeSuperAndInjectedMembers: true);
+
+    // TODO(het): If the class needs runtime type information, add it as a
+    // constructor argument.
+    HInstruction create = new HCreate(
+        astAdapter.getClass(constructor.enclosingClass),
+        constructorArguments,
+        new TypeMask.nonNullExact(
+            astAdapter.getClass(constructor.enclosingClass),
+            compiler.closedWorld),
+        instantiatedTypes: <DartType>[
+          astAdapter.getClass(constructor.enclosingClass).thisType
+        ],
+        hasRtiInput: false);
+
+    add(create);
+
+    // Generate calls to the constructor bodies.
+
+    closeAndGotoExit(new HReturn(create, null));
+    closeFunction();
+  }
+
+  /// Maps the fields of a class to their SSA values.
+  Map<ir.Field, HInstruction> _collectFieldValues(ir.Class clazz) {
+    final fieldValues = <ir.Field, HInstruction>{};
+
+    for (var field in clazz.fields) {
+      if (field.initializer == null) {
+        fieldValues[field] = graph.addConstantNull(compiler);
+      } else {
+        field.initializer.accept(this);
+        fieldValues[field] = pop();
+      }
+    }
+
+    return fieldValues;
+  }
+
+  /// Collects field initializers all the way up the inheritance chain.
+  void _buildInitializers(
+      ir.Constructor constructor, Map<ir.Field, HInstruction> fieldValues) {
+    var foundSuperCall = false;
+    for (var initializer in constructor.initializers) {
+      if (initializer is ir.SuperInitializer) {
+        foundSuperCall = true;
+        var superConstructor = initializer.target;
+        var arguments = _normalizeAndBuildArguments(
+            superConstructor.function, initializer.arguments);
+        _buildInlinedSuperInitializers(
+            superConstructor, arguments, fieldValues);
+      } else if (initializer is ir.FieldInitializer) {
+        initializer.value.accept(this);
+        fieldValues[initializer.field] = pop();
+      }
+    }
+
+    // TODO(het): does kernel always set the super initializer at the end?
+    // If there was no super-call initializer, then call the default constructor
+    // in the superclass.
+    if (!foundSuperCall) {
+      if (constructor.enclosingClass != astAdapter.objectClass) {
+        var superclass = constructor.enclosingClass.superclass;
+        var defaultConstructor = superclass.constructors
+            .firstWhere((c) => c.name == '', orElse: () => null);
+        if (defaultConstructor == null) {
+          compiler.reporter.internalError(
+              NO_LOCATION_SPANNABLE, 'Could not find default constructor.');
+        }
+        _buildInlinedSuperInitializers(
+            defaultConstructor, <HInstruction>[], fieldValues);
+      }
+    }
+  }
+
+  List<HInstruction> _normalizeAndBuildArguments(
+      ir.FunctionNode function, ir.Arguments arguments) {
+    var signature = astAdapter.getFunctionSignature(function);
+    var builtArguments = <HInstruction>[];
+    var positionalIndex = 0;
+    signature.forEachRequiredParameter((_) {
+      arguments.positional[positionalIndex++].accept(this);
+      builtArguments.add(pop());
+    });
+    if (!signature.optionalParametersAreNamed) {
+      signature.forEachOptionalParameter((ParameterElement element) {
+        if (positionalIndex < arguments.positional.length) {
+          arguments.positional[positionalIndex++].accept(this);
+          builtArguments.add(pop());
+        } else {
+          var constantValue =
+              backend.constants.getConstantValue(element.constant);
+          assert(invariant(element, constantValue != null,
+              message: 'No constant computed for $element'));
+          builtArguments.add(graph.addConstant(constantValue, compiler));
+        }
+      });
+    } else {
+      signature.orderedOptionalParameters.forEach((ParameterElement element) {
+        var correspondingNamed = arguments.named.firstWhere(
+            (named) => named.name == element.name,
+            orElse: () => null);
+        if (correspondingNamed != null) {
+          correspondingNamed.value.accept(this);
+          builtArguments.add(pop());
+        } else {
+          var constantValue =
+              backend.constants.getConstantValue(element.constant);
+          assert(invariant(element, constantValue != null,
+              message: 'No constant computed for $element'));
+          builtArguments.add(graph.addConstant(constantValue, compiler));
+        }
+      });
+    }
+
+    return builtArguments;
+  }
+
+  /// Inlines the given super [constructor]'s initializers by collecting it's
+  /// field values and building its constructor initializers. We visit super
+  /// constructors all the way up to the [Object] constructor.
+  void _buildInlinedSuperInitializers(ir.Constructor constructor,
+      List<HInstruction> arguments, Map<ir.Field, HInstruction> fieldValues) {
+    // TODO(het): Handle RTI if class needs it
+    fieldValues.addAll(_collectFieldValues(constructor.enclosingClass));
+
+    var signature = astAdapter.getFunctionSignature(constructor.function);
+    var index = 0;
+    signature.orderedForEachParameter((ParameterElement parameter) {
+      HInstruction argument = arguments[index++];
+      // Because we are inlining the initializer, we must update
+      // what was given as parameter. This will be used in case
+      // there is a parameter check expression in the initializer.
+      parameters[parameter] = argument;
+      localsHandler.updateLocal(parameter, argument);
+    });
+
+    // TODO(het): set the locals handler state as if we were inlining the
+    // constructor.
+    _buildInitializers(constructor, fieldValues);
+  }
+
+  HTypeConversion buildFunctionTypeConversion(
+      HInstruction original, DartType type, int kind) {
+    HInstruction reifiedType = buildFunctionType(type);
+    return new HTypeConversion.viaMethodOnType(
+        type, kind, original.instructionType, reifiedType, original);
   }
 
   /// Builds a SSA graph for [procedure].
@@ -140,10 +341,27 @@
     closeFunction();
   }
 
+  void addImplicitInstantiation(DartType type) {
+    if (type != null) {
+      currentImplicitInstantiations.add(type);
+    }
+  }
+
+  void removeImplicitInstantiation(DartType type) {
+    if (type != null) {
+      currentImplicitInstantiations.removeLast();
+    }
+  }
+
   void openFunction() {
     HBasicBlock block = graph.addNewBlock();
     open(graph.entry);
-    localsHandler.startFunction(targetElement, resolvedAst.node);
+
+    Node function;
+    if (resolvedAst.kind == ResolvedAstKind.PARSED) {
+      function = resolvedAst.node;
+    }
+    localsHandler.startFunction(targetElement, function);
     close(new HGoto()).addSuccessor(block);
 
     open(block);
@@ -154,12 +372,25 @@
     graph.finalize();
   }
 
+  /// Pushes a boolean checking [expression] against null.
+  pushCheckNull(HInstruction expression) {
+    push(new HIdentity(
+        expression, graph.addConstantNull(compiler), null, backend.boolType));
+  }
+
   @override
   void defaultExpression(ir.Expression expression) {
     // TODO(het): This is only to get tests working
     stack.add(graph.addConstantNull(compiler));
   }
 
+  /// Returns the current source element.
+  ///
+  /// The returned element is a declaration element.
+  // TODO(efortuna): Update this when we implement inlining.
+  @override
+  Element get sourceElement => astAdapter.getElement(target);
+
   @override
   void visitBlock(ir.Block block) {
     assert(!isAborted());
@@ -193,9 +424,10 @@
     if (returnStatement.expression == null) {
       value = graph.addConstantNull(compiler);
     } else {
+      assert(target is ir.Procedure);
       returnStatement.expression.accept(this);
-      value = pop();
-      // TODO(het): Check or trust the type of value
+      value = typeBuilder.potentiallyCheckOrTrustType(pop(),
+          astAdapter.getFunctionReturnType((target as ir.Procedure).function));
     }
     // TODO(het): Add source information
     // TODO(het): Set a return value instead of closing the function when we
@@ -397,6 +629,26 @@
         forInStatement, buildInitializer, buildCondition, () {}, buildBody);
   }
 
+  HInstruction callSetRuntimeTypeInfo(
+      HInstruction typeInfo, HInstruction newObject) {
+    // Set the runtime type information on the object.
+    ir.Procedure typeInfoSetterFn = astAdapter.setRuntimeTypeInfo;
+    // TODO(efortuna): Insert source information in this static invocation.
+    _pushStaticInvocation(typeInfoSetterFn, <HInstruction>[newObject, typeInfo],
+        backend.dynamicType);
+
+    // The new object will now be referenced through the
+    // `setRuntimeTypeInfo` call. We therefore set the type of that
+    // instruction to be of the object's type.
+    assert(invariant(CURRENT_ELEMENT_SPANNABLE,
+        stack.last is HInvokeStatic || stack.last == newObject,
+        message: "Unexpected `stack.last`: Found ${stack.last}, "
+            "expected ${newObject} or an HInvokeStatic. "
+            "State: typeInfo=$typeInfo, stack=$stack."));
+    stack.last.instructionType = newObject.instructionType;
+    return pop();
+  }
+
   @override
   void visitWhileStatement(ir.WhileStatement whileStatement) {
     assert(isReachable);
@@ -412,11 +664,73 @@
 
   @override
   void visitIfStatement(ir.IfStatement ifStatement) {
-    SsaBranchBuilder brancher = new SsaBranchBuilder(this, compiler);
-    brancher.handleIf(
-        () => ifStatement.condition.accept(this),
-        () => ifStatement.then.accept(this),
-        () => ifStatement.otherwise?.accept(this));
+    handleIf(
+        visitCondition: () => ifStatement.condition.accept(this),
+        visitThen: () => ifStatement.then.accept(this),
+        visitElse: () => ifStatement.otherwise?.accept(this));
+  }
+
+  @override
+  void visitAsExpression(ir.AsExpression asExpression) {
+    asExpression.operand.accept(this);
+    HInstruction expressionInstruction = pop();
+    DartType type = astAdapter.getDartType(asExpression.type);
+    if (type.isMalformed) {
+      if (type is MalformedType) {
+        ErroneousElement element = type.element;
+        generateTypeError(asExpression, element.message);
+      } else {
+        assert(type is MethodTypeVariableType);
+        stack.add(expressionInstruction);
+      }
+    } else {
+      HInstruction converted = typeBuilder.buildTypeConversion(
+          expressionInstruction,
+          localsHandler.substInContext(type),
+          HTypeConversion.CAST_TYPE_CHECK);
+      if (converted != expressionInstruction) {
+        add(converted);
+      }
+      stack.add(converted);
+    }
+  }
+
+  void generateError(ir.Node node, String message, TypeMask typeMask) {
+    HInstruction errorMessage =
+        graph.addConstantString(new DartString.literal(message), compiler);
+    _pushStaticInvocation(node, [errorMessage], typeMask);
+  }
+
+  void generateTypeError(ir.Node node, String message) {
+    generateError(node, message, astAdapter.throwTypeErrorType);
+  }
+
+  @override
+  void visitAssertStatement(ir.AssertStatement assertStatement) {
+    if (!compiler.options.enableUserAssertions) return;
+    if (assertStatement.message == null) {
+      assertStatement.condition.accept(this);
+      _pushStaticInvocation(astAdapter.assertHelper, <HInstruction>[pop()],
+          astAdapter.assertHelperReturnType);
+      pop();
+      return;
+    }
+
+    // if (assertTest(condition)) assertThrow(message);
+    void buildCondition() {
+      assertStatement.condition.accept(this);
+      _pushStaticInvocation(astAdapter.assertTest, <HInstruction>[pop()],
+          astAdapter.assertTestReturnType);
+    }
+
+    void fail() {
+      assertStatement.message.accept(this);
+      _pushStaticInvocation(astAdapter.assertThrow, <HInstruction>[pop()],
+          astAdapter.assertThrowReturnType);
+      pop();
+    }
+
+    handleIf(visitCondition: buildCondition, visitThen: fail);
   }
 
   @override
@@ -469,6 +783,23 @@
     stack.add(graph.addConstantNull(compiler));
   }
 
+  /// Set the runtime type information if necessary.
+  HInstruction setListRuntimeTypeInfoIfNeeded(
+      HInstruction object, ir.ListLiteral listLiteral) {
+    InterfaceType type = localsHandler
+        .substInContext(elements.getType(astAdapter.getNode(listLiteral)));
+    if (!backend.classNeedsRti(type.element) || type.treatAsRaw) {
+      return object;
+    }
+    List<HInstruction> arguments = <HInstruction>[];
+    for (DartType argument in type.typeArguments) {
+      arguments.add(typeBuilder.analyzeTypeArgument(argument, sourceElement));
+    }
+    // TODO(15489): Register at codegen.
+    registry?.registerInstantiation(type);
+    return callSetRuntimeTypeInfoWithTypeArguments(type, arguments, object);
+  }
+
   @override
   void visitListLiteral(ir.ListLiteral listLiteral) {
     HInstruction listInstruction;
@@ -483,7 +814,8 @@
       }
       listInstruction = new HLiteralList(elements, backend.extendableArrayType);
       add(listInstruction);
-      // TODO(het): set runtime type info
+      listInstruction =
+          setListRuntimeTypeInfoIfNeeded(listInstruction, listLiteral);
     }
 
     TypeMask type = astAdapter.typeOfNewList(targetElement, listLiteral);
@@ -522,8 +854,52 @@
       inputs.add(argList);
     }
 
-    // TODO(het): Add type information
-    _pushStaticInvocation(constructor, inputs, backend.dynamicType);
+    assert(constructor.kind == ir.ProcedureKind.Factory);
+
+    InterfaceType type = localsHandler
+        .substInContext(elements.getType(astAdapter.getNode(mapLiteral)));
+
+    ir.Class cls = constructor.enclosingClass;
+
+    if (backend.classNeedsRti(astAdapter.getElement(cls))) {
+      List<HInstruction> typeInputs = <HInstruction>[];
+      type.typeArguments.forEach((DartType argument) {
+        typeInputs
+            .add(typeBuilder.analyzeTypeArgument(argument, sourceElement));
+      });
+
+      // We lift this common call pattern into a helper function to save space
+      // in the output.
+      if (typeInputs.every((HInstruction input) => input.isNull())) {
+        if (constructorArgs.isEmpty) {
+          constructor = astAdapter.mapLiteralUntypedEmptyMaker;
+        } else {
+          constructor = astAdapter.mapLiteralUntypedMaker;
+        }
+      } else {
+        inputs.addAll(typeInputs);
+      }
+    }
+
+    // If runtime type information is needed and the map literal has no type
+    // parameters, 'constructor' is a static function that forwards the call to
+    // the factory constructor without type parameters.
+    assert(constructor.kind == ir.ProcedureKind.Factory);
+
+    // The instruction type will always be a subtype of the mapLiteralClass, but
+    // type inference might discover a more specific type, or find nothing (in
+    // dart2js unit tests).
+    TypeMask mapType = new TypeMask.nonNullSubtype(
+        astAdapter.getElement(astAdapter.mapLiteralClass),
+        compiler.closedWorld);
+    TypeMask returnTypeMask = TypeMaskFactory.inferredReturnTypeForElement(
+        astAdapter.getElement(constructor), compiler);
+    TypeMask instructionType =
+        mapType.intersection(returnTypeMask, compiler.closedWorld);
+
+    addImplicitInstantiation(type);
+    _pushStaticInvocation(constructor, inputs, instructionType);
+    removeImplicitInstantiation(type);
   }
 
   @override
@@ -535,16 +911,38 @@
   }
 
   @override
+  void visitTypeLiteral(ir.TypeLiteral typeLiteral) {
+    ir.DartType type = typeLiteral.type;
+    if (type is ir.InterfaceType) {
+      ConstantValue constant = astAdapter.getConstantForType(type);
+      stack.add(graph.addConstant(constant, compiler));
+      return;
+    }
+    if (type is ir.TypeParameterType) {
+      // TODO(27394): Load type parameter from current 'this' object.
+      defaultExpression(typeLiteral);
+      return;
+    }
+    // TODO(27394): 'dynamic' and function types observed. Where are they from?
+    defaultExpression(typeLiteral);
+    return;
+  }
+
+  @override
   void visitStaticGet(ir.StaticGet staticGet) {
-    var staticTarget = staticGet.target;
+    ir.Member staticTarget = staticGet.target;
     if (staticTarget is ir.Procedure &&
         staticTarget.kind == ir.ProcedureKind.Getter) {
       // Invoke the getter
       _pushStaticInvocation(staticTarget, const <HInstruction>[],
           astAdapter.returnTypeOf(staticTarget));
+    } else if (staticTarget is ir.Field && staticTarget.isConst) {
+      assert(staticTarget.initializer != null);
+      stack.add(graph.addConstant(
+          astAdapter.getConstantFor(staticTarget.initializer), compiler));
     } else {
-      Element element = astAdapter.getElement(staticTarget).declaration;
-      push(new HStatic(element, astAdapter.inferredTypeOf(staticTarget)));
+      push(new HStatic(astAdapter.getMember(staticTarget),
+          astAdapter.inferredTypeOf(staticTarget)));
     }
   }
 
@@ -560,8 +958,10 @@
           astAdapter.returnTypeOf(staticTarget));
       pop();
     } else {
-      // TODO(het): check or trust type
-      add(new HStaticStore(astAdapter.getElement(staticTarget), value));
+      add(new HStaticStore(
+          astAdapter.getMember(staticTarget),
+          typeBuilder.potentiallyCheckOrTrustType(
+              value, astAdapter.getDartType(staticTarget.setterType))));
     }
     stack.add(value);
   }
@@ -577,11 +977,32 @@
 
   @override
   void visitVariableGet(ir.VariableGet variableGet) {
+    ir.VariableDeclaration variable = variableGet.variable;
+    HInstruction letBinding = letBindings[variable];
+    if (letBinding != null) {
+      stack.add(letBinding);
+      return;
+    }
+
     Local local = astAdapter.getLocal(variableGet.variable);
     stack.add(localsHandler.readLocal(local));
   }
 
   @override
+  void visitPropertySet(ir.PropertySet propertySet) {
+    propertySet.receiver.accept(this);
+    HInstruction receiver = pop();
+    propertySet.value.accept(this);
+    HInstruction value = pop();
+
+    _pushDynamicInvocation(propertySet, astAdapter.typeOfSet(propertySet),
+        <HInstruction>[receiver, value]);
+
+    pop();
+    stack.add(value);
+  }
+
+  @override
   void visitVariableSet(ir.VariableSet variableSet) {
     variableSet.value.accept(this);
     HInstruction value = pop();
@@ -616,8 +1037,20 @@
     }
 
     stack.add(value);
-    // TODO(het): check or trust type
-    localsHandler.updateLocal(local, value);
+    localsHandler.updateLocal(
+        local,
+        typeBuilder.potentiallyCheckOrTrustType(
+            value, astAdapter.getDartType(variable.type)));
+  }
+
+  @override
+  void visitLet(ir.Let let) {
+    ir.VariableDeclaration variable = let.variable;
+    variable.initializer.accept(this);
+    HInstruction initializedValue = pop();
+    // TODO(sra): Apply inferred type information.
+    letBindings[variable] = initializedValue;
+    let.body.accept(this);
   }
 
   // TODO(het): Also extract type arguments
@@ -640,6 +1073,10 @@
   @override
   void visitStaticInvocation(ir.StaticInvocation invocation) {
     ir.Procedure target = invocation.target;
+    if (astAdapter.isInForeignLibrary(target)) {
+      handleInvokeStaticForeign(invocation, target);
+      return;
+    }
     TypeMask typeMask = astAdapter.returnTypeOf(target);
 
     List<HInstruction> arguments = _visitArguments(invocation.arguments);
@@ -647,11 +1084,421 @@
     _pushStaticInvocation(target, arguments, typeMask);
   }
 
+  void handleInvokeStaticForeign(
+      ir.StaticInvocation invocation, ir.Procedure target) {
+    String name = target.name.name;
+    if (name == 'JS') {
+      handleForeignJs(invocation);
+    } else if (name == 'JS_CURRENT_ISOLATE_CONTEXT') {
+      handleForeignJsCurrentIsolateContext(invocation);
+    } else if (name == 'JS_CALL_IN_ISOLATE') {
+      handleForeignJsCallInIsolate(invocation);
+    } else if (name == 'DART_CLOSURE_TO_JS') {
+      handleForeignDartClosureToJs(invocation, 'DART_CLOSURE_TO_JS');
+    } else if (name == 'RAW_DART_FUNCTION_REF') {
+      handleForeignRawFunctionRef(invocation, 'RAW_DART_FUNCTION_REF');
+    } else if (name == 'JS_SET_STATIC_STATE') {
+      handleForeignJsSetStaticState(invocation);
+    } else if (name == 'JS_GET_STATIC_STATE') {
+      handleForeignJsGetStaticState(invocation);
+    } else if (name == 'JS_GET_NAME') {
+      handleForeignJsGetName(invocation);
+    } else if (name == 'JS_EMBEDDED_GLOBAL') {
+      handleForeignJsEmbeddedGlobal(invocation);
+    } else if (name == 'JS_BUILTIN') {
+      handleForeignJsBuiltin(invocation);
+    } else if (name == 'JS_GET_FLAG') {
+      handleForeignJsGetFlag(invocation);
+    } else if (name == 'JS_EFFECT') {
+      stack.add(graph.addConstantNull(compiler));
+    } else if (name == 'JS_INTERCEPTOR_CONSTANT') {
+      handleJsInterceptorConstant(invocation);
+    } else if (name == 'JS_STRING_CONCAT') {
+      handleJsStringConcat(invocation);
+    } else {
+      compiler.reporter.internalError(
+          astAdapter.getNode(invocation), "Unknown foreign: ${name}");
+    }
+  }
+
+  bool _unexpectedForeignArguments(
+      ir.StaticInvocation invocation, int minPositional,
+      [int maxPositional]) {
+    String pluralizeArguments(int count) {
+      if (count == 0) return 'no arguments';
+      if (count == 1) return 'one argument';
+      if (count == 2) return 'two arguments';
+      return '$count arguments';
+    }
+
+    String name() => invocation.target.name.name;
+
+    ir.Arguments arguments = invocation.arguments;
+    bool bad = false;
+    if (arguments.types.isNotEmpty) {
+      compiler.reporter.reportErrorMessage(
+          astAdapter.getNode(invocation),
+          MessageKind.GENERIC,
+          {'text': "Error: '${name()}' does not take type arguments."});
+      bad = true;
+    }
+    if (arguments.positional.length < minPositional) {
+      String phrase = pluralizeArguments(minPositional);
+      if (maxPositional != minPositional) phrase = 'at least $phrase';
+      compiler.reporter.reportErrorMessage(
+          astAdapter.getNode(invocation),
+          MessageKind.GENERIC,
+          {'text': "Error: Too few arguments. '${name()}' takes $phrase."});
+      bad = true;
+    }
+    if (maxPositional != null && arguments.positional.length > maxPositional) {
+      String phrase = pluralizeArguments(maxPositional);
+      if (maxPositional != minPositional) phrase = 'at most $phrase';
+      compiler.reporter.reportErrorMessage(
+          astAdapter.getNode(invocation),
+          MessageKind.GENERIC,
+          {'text': "Error: Too many arguments. '${name()}' takes $phrase."});
+      bad = true;
+    }
+    if (arguments.named.isNotEmpty) {
+      compiler.reporter.reportErrorMessage(
+          astAdapter.getNode(invocation),
+          MessageKind.GENERIC,
+          {'text': "Error: '${name()}' does not take named arguments."});
+      bad = true;
+    }
+    return bad;
+  }
+
+  /// Returns the value of the string argument. The argument must evaluate to a
+  /// constant.  If there is an error, the error is reported and `null` is
+  /// returned.
+  String _foreignConstantStringArgument(
+      ir.StaticInvocation invocation, int position, String methodName,
+      [String adjective = '']) {
+    ir.Expression argument = invocation.arguments.positional[position];
+    argument.accept(this);
+    HInstruction instruction = pop();
+
+    if (!instruction.isConstantString()) {
+      compiler.reporter.reportErrorMessage(
+          astAdapter.getNode(argument), MessageKind.GENERIC, {
+        'text': "Error: Expected String constant as ${adjective}argument "
+            "to '$methodName'."
+      });
+      return null;
+    }
+
+    HConstant hConstant = instruction;
+    StringConstantValue stringConstant = hConstant.constant;
+    return stringConstant.primitiveValue.slowToString();
+  }
+
+  // TODO(sra): Remove when handleInvokeStaticForeign fully implemented.
+  void unhandledForeign(ir.StaticInvocation invocation) {
+    ir.Procedure target = invocation.target;
+    TypeMask typeMask = astAdapter.returnTypeOf(target);
+    List<HInstruction> arguments = _visitArguments(invocation.arguments);
+    _pushStaticInvocation(target, arguments, typeMask);
+  }
+
+  void handleForeignJsCurrentIsolateContext(ir.StaticInvocation invocation) {
+    if (_unexpectedForeignArguments(invocation, 0, 0)) {
+      stack.add(graph.addConstantNull(compiler)); // Result expected on stack.
+      return;
+    }
+
+    if (!compiler.hasIsolateSupport) {
+      // If the isolate library is not used, we just generate code
+      // to fetch the static state.
+      String name = backend.namer.staticStateHolder;
+      push(new HForeignCode(
+          js.js.parseForeignJS(name), backend.dynamicType, <HInstruction>[],
+          nativeBehavior: native.NativeBehavior.DEPENDS_OTHER));
+    } else {
+      // Call a helper method from the isolate library. The isolate library uses
+      // its own isolate structure that encapsulates the isolate structure used
+      // for binding to methods.
+      ir.Procedure target = astAdapter.currentIsolate;
+      if (target == null) {
+        compiler.reporter.internalError(astAdapter.getNode(invocation),
+            'Isolate library and compiler mismatch.');
+      }
+      _pushStaticInvocation(target, <HInstruction>[], backend.dynamicType);
+    }
+  }
+
+  void handleForeignJsCallInIsolate(ir.StaticInvocation invocation) {
+    unhandledForeign(invocation);
+  }
+
+  void handleForeignDartClosureToJs(
+      ir.StaticInvocation invocation, String name) {
+    // TODO(sra): Do we need to wrap the closure in something that saves the
+    // current isolate?
+    handleForeignRawFunctionRef(invocation, name);
+  }
+
+  void handleForeignRawFunctionRef(
+      ir.StaticInvocation invocation, String name) {
+    if (_unexpectedForeignArguments(invocation, 1, 1)) {
+      stack.add(graph.addConstantNull(compiler)); // Result expected on stack.
+      return;
+    }
+
+    ir.Expression closure = invocation.arguments.positional.single;
+    String problem = 'requires a static method or top-level method';
+    if (closure is ir.StaticGet) {
+      ir.Member staticTarget = closure.target;
+      if (staticTarget is ir.Procedure) {
+        if (staticTarget.kind == ir.ProcedureKind.Method) {
+          ir.FunctionNode function = staticTarget.function;
+          if (function != null &&
+              function.requiredParameterCount ==
+                  function.positionalParameters.length &&
+              function.namedParameters.isEmpty) {
+            registry?.registerStaticUse(
+                new StaticUse.foreignUse(astAdapter.getMember(staticTarget)));
+            push(new HForeignCode(
+                js.js.expressionTemplateYielding(backend.emitter
+                    .staticFunctionAccess(astAdapter.getMember(staticTarget))),
+                backend.dynamicType,
+                <HInstruction>[],
+                nativeBehavior: native.NativeBehavior.PURE));
+            return;
+          }
+          problem = 'does not handle a closure with optional parameters';
+        }
+      }
+    }
+
+    compiler.reporter.reportErrorMessage(astAdapter.getNode(invocation),
+        MessageKind.GENERIC, {'text': "'$name' $problem."});
+    stack.add(graph.addConstantNull(compiler)); // Result expected on stack.
+    return;
+  }
+
+  void handleForeignJsSetStaticState(ir.StaticInvocation invocation) {
+    if (_unexpectedForeignArguments(invocation, 0, 0)) {
+      stack.add(graph.addConstantNull(compiler)); // Result expected on stack.
+      return;
+    }
+    _visitArguments(invocation.arguments);
+    String isolateName = backend.namer.staticStateHolder;
+    SideEffects sideEffects = new SideEffects.empty();
+    sideEffects.setAllSideEffects();
+    push(new HForeignCode(js.js.parseForeignJS("$isolateName = #"),
+        backend.dynamicType, <HInstruction>[pop()],
+        nativeBehavior: native.NativeBehavior.CHANGES_OTHER,
+        effects: sideEffects));
+  }
+
+  void handleForeignJsGetStaticState(ir.StaticInvocation invocation) {
+    if (_unexpectedForeignArguments(invocation, 0, 0)) {
+      stack.add(graph.addConstantNull(compiler)); // Result expected on stack.
+      return;
+    }
+
+    push(new HForeignCode(js.js.parseForeignJS(backend.namer.staticStateHolder),
+        backend.dynamicType, <HInstruction>[],
+        nativeBehavior: native.NativeBehavior.DEPENDS_OTHER));
+  }
+
+  void handleForeignJsGetName(ir.StaticInvocation invocation) {
+    if (_unexpectedForeignArguments(invocation, 1, 1)) {
+      stack.add(graph.addConstantNull(compiler)); // Result expected on stack.
+      return;
+    }
+
+    ir.Node argument = invocation.arguments.positional.first;
+    argument.accept(this);
+    HInstruction instruction = pop();
+
+    if (instruction is HConstant) {
+      js.Name name =
+          astAdapter.getNameForJsGetName(argument, instruction.constant);
+      stack.add(graph.addConstantStringFromName(name, compiler));
+      return;
+    }
+
+    compiler.reporter.reportErrorMessage(
+        astAdapter.getNode(argument),
+        MessageKind.GENERIC,
+        {'text': 'Error: Expected a JsGetName enum value.'});
+    stack.add(graph.addConstantNull(compiler)); // Result expected on stack.
+  }
+
+  void handleForeignJsEmbeddedGlobal(ir.StaticInvocation invocation) {
+    if (_unexpectedForeignArguments(invocation, 2, 2)) {
+      stack.add(graph.addConstantNull(compiler)); // Result expected on stack.
+      return;
+    }
+    String globalName = _foreignConstantStringArgument(
+        invocation, 1, 'JS_EMBEDDED_GLOBAL', 'second ');
+    js.Template expr = js.js.expressionTemplateYielding(
+        backend.emitter.generateEmbeddedGlobalAccess(globalName));
+
+    native.NativeBehavior nativeBehavior =
+        astAdapter.getNativeBehavior(invocation);
+    assert(invariant(astAdapter.getNode(invocation), nativeBehavior != null,
+        message: "No NativeBehavior for $invocation"));
+
+    TypeMask ssaType = astAdapter.typeFromNativeBehavior(nativeBehavior);
+    push(new HForeignCode(expr, ssaType, const <HInstruction>[],
+        nativeBehavior: nativeBehavior));
+  }
+
+  void handleForeignJsBuiltin(ir.StaticInvocation invocation) {
+    if (_unexpectedForeignArguments(invocation, 2)) {
+      stack.add(graph.addConstantNull(compiler)); // Result expected on stack.
+      return;
+    }
+
+    List<ir.Expression> arguments = invocation.arguments.positional;
+    ir.Expression nameArgument = arguments[1];
+
+    nameArgument.accept(this);
+    HInstruction instruction = pop();
+
+    js.Template template;
+    if (instruction is HConstant) {
+      template = astAdapter.getJsBuiltinTemplate(instruction.constant);
+    }
+    if (template == null) {
+      compiler.reporter.reportErrorMessage(
+          astAdapter.getNode(nameArgument),
+          MessageKind.GENERIC,
+          {'text': 'Error: Expected a JsBuiltin enum value.'});
+      stack.add(graph.addConstantNull(compiler)); // Result expected on stack.
+      return;
+    }
+
+    List<HInstruction> inputs = <HInstruction>[];
+    for (ir.Expression argument in arguments.skip(2)) {
+      argument.accept(this);
+      inputs.add(pop());
+    }
+
+    native.NativeBehavior nativeBehavior =
+        astAdapter.getNativeBehavior(invocation);
+    assert(invariant(astAdapter.getNode(invocation), nativeBehavior != null,
+        message: "No NativeBehavior for $invocation"));
+
+    TypeMask ssaType = astAdapter.typeFromNativeBehavior(nativeBehavior);
+    push(new HForeignCode(template, ssaType, inputs,
+        nativeBehavior: nativeBehavior));
+  }
+
+  void handleForeignJsGetFlag(ir.StaticInvocation invocation) {
+    if (_unexpectedForeignArguments(invocation, 1, 1)) {
+      stack.add(
+          graph.addConstantBool(false, compiler)); // Result expected on stack.
+      return;
+    }
+    String name = _foreignConstantStringArgument(invocation, 0, 'JS_GET_FLAG');
+    bool value = false;
+    switch (name) {
+      case 'MUST_RETAIN_METADATA':
+        value = backend.mustRetainMetadata;
+        break;
+      case 'USE_CONTENT_SECURITY_POLICY':
+        value = compiler.options.useContentSecurityPolicy;
+        break;
+      default:
+        compiler.reporter.reportErrorMessage(
+            astAdapter.getNode(invocation),
+            MessageKind.GENERIC,
+            {'text': 'Error: Unknown internal flag "$name".'});
+    }
+    stack.add(graph.addConstantBool(value, compiler));
+  }
+
+  void handleJsInterceptorConstant(ir.StaticInvocation invocation) {
+    // Single argument must be a TypeConstant which is converted into a
+    // InterceptorConstant.
+    if (_unexpectedForeignArguments(invocation, 1, 1)) {
+      stack.add(graph.addConstantNull(compiler)); // Result expected on stack.
+      return;
+    }
+    ir.Expression argument = invocation.arguments.positional.single;
+    argument.accept(this);
+    HInstruction argumentInstruction = pop();
+    if (argumentInstruction is HConstant) {
+      ConstantValue argumentConstant = argumentInstruction.constant;
+      if (argumentConstant is TypeConstantValue) {
+        // TODO(sra): Check that type is a subclass of [Interceptor].
+        ConstantValue constant =
+            new InterceptorConstantValue(argumentConstant.representedType);
+        HInstruction instruction = graph.addConstant(constant, compiler);
+        stack.add(instruction);
+        return;
+      }
+    }
+
+    compiler.reporter.reportErrorMessage(astAdapter.getNode(invocation),
+        MessageKind.WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT);
+    stack.add(graph.addConstantNull(compiler));
+  }
+
+  void handleForeignJs(ir.StaticInvocation invocation) {
+    if (_unexpectedForeignArguments(invocation, 2)) {
+      stack.add(graph.addConstantNull(compiler)); // Result expected on stack.
+      return;
+    }
+
+    native.NativeBehavior nativeBehavior =
+        astAdapter.getNativeBehavior(invocation);
+    assert(invariant(astAdapter.getNode(invocation), nativeBehavior != null,
+        message: "No NativeBehavior for $invocation"));
+
+    List<HInstruction> inputs = <HInstruction>[];
+    for (ir.Expression argument in invocation.arguments.positional.skip(2)) {
+      argument.accept(this);
+      inputs.add(pop());
+    }
+
+    if (nativeBehavior.codeTemplate.positionalArgumentCount != inputs.length) {
+      compiler.reporter.reportErrorMessage(
+          astAdapter.getNode(invocation), MessageKind.GENERIC, {
+        'text': 'Mismatch between number of placeholders'
+            ' and number of arguments.'
+      });
+      stack.add(graph.addConstantNull(compiler)); // Result expected on stack.
+      return;
+    }
+
+    if (native.HasCapturedPlaceholders.check(nativeBehavior.codeTemplate.ast)) {
+      compiler.reporter.reportErrorMessage(
+          astAdapter.getNode(invocation), MessageKind.JS_PLACEHOLDER_CAPTURE);
+    }
+
+    TypeMask ssaType = astAdapter.typeFromNativeBehavior(nativeBehavior);
+
+    SourceInformation sourceInformation = null;
+    push(new HForeignCode(nativeBehavior.codeTemplate, ssaType, inputs,
+        isStatement: !nativeBehavior.codeTemplate.isExpression,
+        effects: nativeBehavior.sideEffects,
+        nativeBehavior: nativeBehavior)..sourceInformation = sourceInformation);
+  }
+
+  void handleJsStringConcat(ir.StaticInvocation invocation) {
+    if (_unexpectedForeignArguments(invocation, 2, 2)) {
+      stack.add(graph.addConstantNull(compiler)); // Result expected on stack.
+      return;
+    }
+    List<HInstruction> inputs = _visitArguments(invocation.arguments);
+    push(new HStringConcat(inputs[0], inputs[1], backend.stringType));
+  }
+
   void _pushStaticInvocation(
       ir.Node target, List<HInstruction> arguments, TypeMask typeMask) {
-    HInstruction instruction = new HInvokeStatic(
-        astAdapter.getElement(target).declaration, arguments, typeMask,
+    HInvokeStatic instruction = new HInvokeStatic(
+        astAdapter.getMember(target), arguments, typeMask,
         targetCanThrow: astAdapter.getCanThrow(target));
+    if (currentImplicitInstantiations.isNotEmpty) {
+      instruction.instantiatedTypes =
+          new List<DartType>.from(currentImplicitInstantiations);
+    }
     instruction.sideEffects = astAdapter.getSideEffects(target);
 
     push(instruction);
@@ -686,6 +1533,9 @@
   // TODO(het): Decide when to inline
   @override
   void visitMethodInvocation(ir.MethodInvocation invocation) {
+    // Handle `x == null` specially. When these come from null-aware operators,
+    // there is no mapping in the astAdapter.
+    if (_handleEqualsNull(invocation)) return;
     invocation.receiver.accept(this);
     HInstruction receiver = pop();
 
@@ -696,6 +1546,27 @@
           ..addAll(_visitArguments(invocation.arguments)));
   }
 
+  bool _handleEqualsNull(ir.MethodInvocation invocation) {
+    if (invocation.name.name == '==') {
+      ir.Arguments arguments = invocation.arguments;
+      if (arguments.types.isEmpty &&
+          arguments.positional.length == 1 &&
+          arguments.named.isEmpty) {
+        bool finish(ir.Expression comparand) {
+          comparand.accept(this);
+          pushCheckNull(pop());
+          return true;
+        }
+
+        ir.Expression receiver = invocation.receiver;
+        ir.Expression argument = arguments.positional.first;
+        if (argument is ir.NullLiteral) return finish(receiver);
+        if (receiver is ir.NullLiteral) return finish(argument);
+      }
+    }
+    return false;
+  }
+
   HInterceptor _interceptorFor(HInstruction intercepted) {
     HInterceptor interceptor =
         new HInterceptor(intercepted, backend.nonNullType);
@@ -726,8 +1597,8 @@
     inputs.addAll(arguments);
 
     HInstruction instruction = new HInvokeSuper(
-        astAdapter.getElement(invocation.interfaceTarget),
-        astAdapter.getElement(surroundingClass),
+        astAdapter.getMethod(invocation.interfaceTarget),
+        astAdapter.getClass(surroundingClass),
         selector,
         inputs,
         astAdapter.returnTypeOf(invocation.interfaceTarget),
diff --git a/pkg/compiler/lib/src/ssa/codegen.dart b/pkg/compiler/lib/src/ssa/codegen.dart
index e677afd..cd9d7c0 100644
--- a/pkg/compiler/lib/src/ssa/codegen.dart
+++ b/pkg/compiler/lib/src/ssa/codegen.dart
@@ -2,6 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+import 'dart:math' as math;
 import '../common.dart';
 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem;
 import '../common/tasks.dart' show CompilerTask;
@@ -11,6 +12,7 @@
 import '../core_types.dart' show CoreClasses;
 import '../dart_types.dart';
 import '../elements/elements.dart';
+import '../elements/entities.dart';
 import '../io/source_information.dart';
 import '../js/js.dart' as js;
 import '../js_backend/backend_helpers.dart' show BackendHelpers;
@@ -209,8 +211,59 @@
     return false;
   }
 
+  // Returns the number of bits occupied by the value computed by [instruction].
+  // Returns `32` if the value is negative or does not fit in a smaller number
+  // of bits.
+  int bitWidth(HInstruction instruction) {
+    const int MAX = 32;
+    int constant(HInstruction insn) {
+      if (insn is HConstant && insn.isConstantInteger()) {
+        IntConstantValue constant = insn.constant;
+        return constant.primitiveValue;
+      }
+      return null;
+    }
+
+    if (instruction.isConstantInteger()) {
+      int value = constant(instruction);
+      if (value < 0) return MAX;
+      if (value > ((1 << 31) - 1)) return MAX;
+      return value.bitLength;
+    }
+    if (instruction is HBitAnd) {
+      return math.min(bitWidth(instruction.left), bitWidth(instruction.right));
+    }
+    if (instruction is HBitOr || instruction is HBitXor) {
+      HBinaryBitOp bitOp = instruction;
+      int leftWidth = bitWidth(bitOp.left);
+      if (leftWidth == MAX) return MAX;
+      return math.max(leftWidth, bitWidth(bitOp.right));
+    }
+    if (instruction is HShiftLeft) {
+      int shiftCount = constant(instruction.right);
+      if (shiftCount == null || shiftCount < 0 || shiftCount > 31) return MAX;
+      int leftWidth = bitWidth(instruction.left);
+      int width = leftWidth + shiftCount;
+      return math.min(width, MAX);
+    }
+    if (instruction is HShiftRight) {
+      int shiftCount = constant(instruction.right);
+      if (shiftCount == null || shiftCount < 0 || shiftCount > 31) return MAX;
+      int leftWidth = bitWidth(instruction.left);
+      if (leftWidth >= MAX) return MAX;
+      return math.max(leftWidth - shiftCount, 0);
+    }
+    if (instruction is HAdd) {
+      return math.min(
+          1 + math.max(bitWidth(instruction.left), bitWidth(instruction.right)),
+          MAX);
+    }
+    return MAX;
+  }
+
   bool requiresUintConversion(instruction) {
     if (instruction.isUInt31(compiler)) return false;
+    if (bitWidth(instruction) <= 31) return false;
     // If the result of a bit-operation is only used by other bit
     // operations, we do not have to convert to an unsigned integer.
     return hasNonBitOpUser(instruction, new Set<HPhi>());
@@ -1582,7 +1635,7 @@
     js.Expression object = pop();
     String methodName;
     List<js.Expression> arguments = visitArguments(node.inputs);
-    Element target = node.element;
+    MemberElement target = node.element;
 
     // TODO(herhut): The namer should return the appropriate backendname here.
     if (target != null && !node.isInterceptedCall) {
@@ -1676,12 +1729,11 @@
 
   void registerMethodInvoke(HInvokeDynamic node) {
     Selector selector = node.selector;
-    TypeMask mask = getOptimizedSelectorFor(node, selector, node.mask);
 
     // If we don't know what we're calling or if we are calling a getter,
     // we need to register that fact that we may be calling a closure
     // with the same arguments.
-    Element target = node.element;
+    MemberElement target = node.element;
     if (target == null || target.isGetter) {
       // TODO(kasperl): If we have a typed selector for the call, we
       // may know something about the types of closures that need
@@ -1689,19 +1741,49 @@
       Selector call = new Selector.callClosureFrom(selector);
       registry.registerDynamicUse(new DynamicUse(call, null));
     }
-    registry.registerDynamicUse(new DynamicUse(selector, mask));
+    if (target != null) {
+      // This is a dynamic invocation which we have found to have a single
+      // target but for some reason haven't inlined. We are _still_ accessing
+      // the target dynamically but we don't need to enqueue more than target
+      // for this to work.
+      assert(invariant(node, selector.applies(target),
+          message: '$selector does not apply to $target'));
+      registry.registerStaticUse(
+          new StaticUse.directInvoke(target, selector.callStructure));
+    } else {
+      TypeMask mask = getOptimizedSelectorFor(node, selector, node.mask);
+      registry.registerDynamicUse(new DynamicUse(selector, mask));
+    }
   }
 
   void registerSetter(HInvokeDynamic node) {
-    Selector selector = node.selector;
-    TypeMask mask = getOptimizedSelectorFor(node, selector, node.mask);
-    registry.registerDynamicUse(new DynamicUse(selector, mask));
+    if (node.element != null) {
+      // This is a dynamic update which we have found to have a single
+      // target but for some reason haven't inlined. We are _still_ accessing
+      // the target dynamically but we don't need to enqueue more than target
+      // for this to work.
+      registry.registerStaticUse(new StaticUse.directSet(node.element));
+    } else {
+      Selector selector = node.selector;
+      TypeMask mask = getOptimizedSelectorFor(node, selector, node.mask);
+      registry.registerDynamicUse(new DynamicUse(selector, mask));
+    }
   }
 
   void registerGetter(HInvokeDynamic node) {
-    Selector selector = node.selector;
-    TypeMask mask = getOptimizedSelectorFor(node, selector, node.mask);
-    registry.registerDynamicUse(new DynamicUse(selector, mask));
+    if (node.element != null &&
+        (node.element.isGetter || node.element.isField)) {
+      // This is a dynamic read which we have found to have a single target but
+      // for some reason haven't inlined. We are _still_ accessing the target
+      // dynamically but we don't need to enqueue more than target for this to
+      // work. The test above excludes non-getter functions since the element
+      // represents two targets - a tearoff getter and the torn-off method.
+      registry.registerStaticUse(new StaticUse.directGet(node.element));
+    } else {
+      Selector selector = node.selector;
+      TypeMask mask = getOptimizedSelectorFor(node, selector, node.mask);
+      registry.registerDynamicUse(new DynamicUse(selector, mask));
+    }
   }
 
   visitInvokeDynamicSetter(HInvokeDynamicSetter node) {
@@ -1733,7 +1815,7 @@
   }
 
   visitInvokeStatic(HInvokeStatic node) {
-    Element element = node.element;
+    MemberElement element = node.element;
     List<DartType> instantiatedTypes = node.instantiatedTypes;
 
     if (instantiatedTypes != null && !instantiatedTypes.isEmpty) {
@@ -1780,7 +1862,7 @@
   }
 
   visitInvokeSuper(HInvokeSuper node) {
-    Element superElement = node.element;
+    MemberElement superElement = node.element;
     ClassElement superClass = superElement.enclosingClass;
     if (superElement.isField) {
       js.Name fieldName = backend.namer.instanceFieldPropertyName(superElement);
@@ -1838,7 +1920,7 @@
 
   visitFieldGet(HFieldGet node) {
     use(node.receiver);
-    Element element = node.element;
+    MemberElement element = node.element;
     if (node.isNullCheck) {
       // We access a JavaScript member we know all objects besides
       // null and undefined have: V8 does not like accessing a member
@@ -1860,7 +1942,7 @@
   }
 
   visitFieldSet(HFieldSet node) {
-    Element element = node.element;
+    MemberElement element = node.element;
     registry.registerStaticUse(new StaticUse.fieldSet(element));
     js.Name name = backend.namer.instanceFieldPropertyName(element);
     use(node.receiver);
@@ -1871,7 +1953,7 @@
   }
 
   visitReadModifyWrite(HReadModifyWrite node) {
-    Element element = node.element;
+    FieldElement element = node.element;
     registry.registerStaticUse(new StaticUse.fieldGet(element));
     registry.registerStaticUse(new StaticUse.fieldSet(element));
     js.Name name = backend.namer.instanceFieldPropertyName(element);
@@ -1903,7 +1985,8 @@
   void registerForeignTypes(HForeign node) {
     native.NativeBehavior nativeBehavior = node.nativeBehavior;
     if (nativeBehavior == null) return;
-    nativeEnqueuer.registerNativeBehavior(nativeBehavior, node);
+    nativeEnqueuer.registerNativeBehavior(
+        registry.worldImpact, nativeBehavior, node);
   }
 
   visitForeignCode(HForeignCode node) {
@@ -2250,7 +2333,7 @@
   }
 
   void visitStatic(HStatic node) {
-    Element element = node.element;
+    MemberEntity element = node.element;
     assert(element.isFunction || element.isField);
     if (element.isFunction) {
       push(backend.emitter
@@ -2266,7 +2349,7 @@
   }
 
   void visitLazyStatic(HLazyStatic node) {
-    Element element = node.element;
+    FieldEntity element = node.element;
     registry.registerStaticUse(new StaticUse.staticInit(element));
     js.Expression lazyGetter =
         backend.emitter.isolateLazyInitializerAccess(element);
@@ -2794,8 +2877,22 @@
 
     if (helper == null) {
       assert(type.isFunctionType);
-      use(node.inputs[0]);
+      assert(node.usesMethodOnType);
+
+      String name = node.isCastTypeCheck ? '_asCheck' : '_assertCheck';
+      HInstruction reifiedType = node.inputs[0];
+      HInstruction checkedInput = node.inputs[1];
+      use(reifiedType);
+      js.Expression receiver = pop();
+      use(checkedInput);
+      Selector selector = new Selector.call(
+          new Name(name, helpers.jsHelperLibrary), CallStructure.ONE_ARG);
+      registry.registerDynamicUse(
+          new DynamicUse(selector, reifiedType.instructionType));
+      js.Name methodLiteral = backend.namer.invocationName(selector);
+      push(js.js('#.#(#)', [receiver, methodLiteral, pop()]));
     } else {
+      assert(!node.usesMethodOnType);
       push(helper.generateCall(this, node));
     }
   }
diff --git a/pkg/compiler/lib/src/ssa/codegen_helpers.dart b/pkg/compiler/lib/src/ssa/codegen_helpers.dart
index 43515f8..34d156b 100644
--- a/pkg/compiler/lib/src/ssa/codegen_helpers.dart
+++ b/pkg/compiler/lib/src/ssa/codegen_helpers.dart
@@ -419,7 +419,7 @@
   }
 
   void visitInvokeSuper(HInvokeSuper instruction) {
-    Element superMethod = instruction.element;
+    MemberElement superMethod = instruction.element;
     Selector selector = instruction.selector;
     // If aliased super members cannot be used, we will generate code like
     //
@@ -440,11 +440,18 @@
 
   void visitIs(HIs instruction) {
     // In the general case the input might be used multple multiple times, so it
-    // must not be set generate at use site.  If the code will generate
-    // 'instanceof' then we can generate at use site.
+    // must not be set generate at use site.
+
+    // If the code will generate 'instanceof' then we can generate at use site.
     if (instruction.useInstanceOf) {
       analyzeInputs(instruction, 0);
     }
+
+    // Compound and variable checks use a separate instruction to compute the
+    // result.
+    if (instruction.isCompoundCheck || instruction.isVariableCheck) {
+      analyzeInputs(instruction, 0);
+    }
   }
 
   // A bounds check method must not have its first input generated at use site,
diff --git a/pkg/compiler/lib/src/ssa/graph_builder.dart b/pkg/compiler/lib/src/ssa/graph_builder.dart
index a6ef442..e5dce33 100644
--- a/pkg/compiler/lib/src/ssa/graph_builder.dart
+++ b/pkg/compiler/lib/src/ssa/graph_builder.dart
@@ -2,14 +2,25 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+import '../closure.dart';
+import '../common.dart';
+import '../common/codegen.dart' show CodegenRegistry;
 import '../compiler.dart';
+import '../dart_types.dart';
 import '../elements/elements.dart';
+import '../io/source_information.dart';
 import '../js_backend/js_backend.dart';
 import '../resolution/tree_elements.dart';
+import '../tree/tree.dart' as ast;
 import '../types/types.dart';
+import '../universe/call_structure.dart' show CallStructure;
+import '../universe/use.dart' show TypeUse;
+import '../world.dart' show ClosedWorld;
 import 'jump_handler.dart';
 import 'locals_handler.dart';
 import 'nodes.dart';
+import 'ssa_branch_builder.dart';
+import 'type_builder.dart';
 
 /// Base class for objects that build up an SSA graph.
 ///
@@ -29,6 +40,8 @@
   /// The tree elements for the element being built into an SSA graph.
   TreeElements get elements;
 
+  CodegenRegistry get registry;
+
   /// Used to track the locals while building the graph.
   LocalsHandler localsHandler;
 
@@ -159,6 +172,17 @@
     return result;
   }
 
+  void handleIf(
+      {ast.Node node,
+      void visitCondition(),
+      void visitThen(),
+      void visitElse(),
+      SourceInformation sourceInformation}) {
+    SsaBranchBuilder branchBuilder = new SsaBranchBuilder(this, compiler, node);
+    branchBuilder.handleIf(visitCondition, visitThen, visitElse,
+        sourceInformation: sourceInformation);
+  }
+
   HSubGraphBlockInformation wrapStatementGraph(SubGraph statements) {
     if (statements == null) return null;
     return new HSubGraphBlockInformation(statements);
@@ -168,4 +192,143 @@
     if (expression == null) return null;
     return new HSubExpressionBlockInformation(expression);
   }
+
+  HInstruction buildFunctionType(FunctionType type) {
+    type.accept(
+        new ReifiedTypeRepresentationBuilder(compiler.closedWorld), this);
+    return pop();
+  }
+
+  HInstruction buildFunctionTypeConversion(
+      HInstruction original, DartType type, int kind);
+
+  /// Returns the current source element.
+  ///
+  /// The returned element is a declaration element.
+  Element get sourceElement;
+
+  // TODO(karlklose): this is needed to avoid a bug where the resolved type is
+  // not stored on a type annotation in the closure translator. Remove when
+  // fixed.
+  bool hasDirectLocal(Local local) {
+    return !localsHandler.isAccessedDirectly(local) ||
+        localsHandler.directLocals[local] != null;
+  }
+
+  HInstruction callSetRuntimeTypeInfoWithTypeArguments(
+      DartType type, List<HInstruction> rtiInputs, HInstruction newObject) {
+    if (!backend.classNeedsRti(type.element)) {
+      return newObject;
+    }
+
+    HInstruction typeInfo = new HTypeInfoExpression(
+        TypeInfoExpressionKind.INSTANCE,
+        (type.element as ClassElement).thisType,
+        rtiInputs,
+        backend.dynamicType);
+    add(typeInfo);
+    return callSetRuntimeTypeInfo(typeInfo, newObject);
+  }
+
+  HInstruction callSetRuntimeTypeInfo(
+      HInstruction typeInfo, HInstruction newObject);
+
+  /// The element for which this SSA builder is being used.
+  Element get targetElement;
+  TypeBuilder get typeBuilder;
+}
+
+class ReifiedTypeRepresentationBuilder
+    implements DartTypeVisitor<dynamic, GraphBuilder> {
+  final ClosedWorld closedWorld;
+
+  ReifiedTypeRepresentationBuilder(this.closedWorld);
+
+  void visit(DartType type, GraphBuilder builder) => type.accept(this, builder);
+
+  void visitVoidType(VoidType type, GraphBuilder builder) {
+    ClassElement cls = builder.backend.helpers.VoidRuntimeType;
+    builder.push(new HVoidType(type, new TypeMask.exact(cls, closedWorld)));
+  }
+
+  void visitTypeVariableType(TypeVariableType type, GraphBuilder builder) {
+    ClassElement cls = builder.backend.helpers.RuntimeType;
+    TypeMask instructionType = new TypeMask.subclass(cls, closedWorld);
+    if (!builder.sourceElement.enclosingElement.isClosure &&
+        builder.sourceElement.isInstanceMember) {
+      HInstruction receiver = builder.localsHandler.readThis();
+      builder.push(new HReadTypeVariable(type, receiver, instructionType));
+    } else {
+      builder.push(new HReadTypeVariable.noReceiver(
+          type,
+          builder.typeBuilder
+              .addTypeVariableReference(type, builder.sourceElement),
+          instructionType));
+    }
+  }
+
+  void visitFunctionType(FunctionType type, GraphBuilder builder) {
+    type.returnType.accept(this, builder);
+    HInstruction returnType = builder.pop();
+    List<HInstruction> inputs = <HInstruction>[returnType];
+
+    for (DartType parameter in type.parameterTypes) {
+      parameter.accept(this, builder);
+      inputs.add(builder.pop());
+    }
+
+    for (DartType parameter in type.optionalParameterTypes) {
+      parameter.accept(this, builder);
+      inputs.add(builder.pop());
+    }
+
+    List<DartType> namedParameterTypes = type.namedParameterTypes;
+    List<String> names = type.namedParameters;
+    for (int index = 0; index < names.length; index++) {
+      ast.DartString dartString = new ast.DartString.literal(names[index]);
+      inputs.add(builder.graph.addConstantString(dartString, builder.compiler));
+      namedParameterTypes[index].accept(this, builder);
+      inputs.add(builder.pop());
+    }
+
+    ClassElement cls = builder.backend.helpers.RuntimeFunctionType;
+    builder.push(
+        new HFunctionType(inputs, type, new TypeMask.exact(cls, closedWorld)));
+  }
+
+  void visitMalformedType(MalformedType type, GraphBuilder builder) {
+    visitDynamicType(const DynamicType(), builder);
+  }
+
+  void visitStatementType(StatementType type, GraphBuilder builder) {
+    throw 'not implemented visitStatementType($type)';
+  }
+
+  void visitInterfaceType(InterfaceType type, GraphBuilder builder) {
+    List<HInstruction> inputs = <HInstruction>[];
+    for (DartType typeArgument in type.typeArguments) {
+      typeArgument.accept(this, builder);
+      inputs.add(builder.pop());
+    }
+    ClassElement cls;
+    if (type.typeArguments.isEmpty) {
+      cls = builder.backend.helpers.RuntimeTypePlain;
+    } else {
+      cls = builder.backend.helpers.RuntimeTypeGeneric;
+    }
+    builder.push(
+        new HInterfaceType(inputs, type, new TypeMask.exact(cls, closedWorld)));
+  }
+
+  void visitTypedefType(TypedefType type, GraphBuilder builder) {
+    DartType unaliased = type.unaliased;
+    if (unaliased is TypedefType) throw 'unable to unalias $type';
+    unaliased.accept(this, builder);
+  }
+
+  void visitDynamicType(DynamicType type, GraphBuilder builder) {
+    JavaScriptBackend backend = builder.compiler.backend;
+    ClassElement cls = backend.helpers.DynamicRuntimeType;
+    builder.push(new HDynamicType(type, new TypeMask.exact(cls, closedWorld)));
+  }
 }
diff --git a/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart b/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart
index 463c31c..63e3a26 100644
--- a/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart
+++ b/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart
@@ -34,55 +34,46 @@
     return null;
   }
 
+  void clearAllSideEffects(HInstruction instruction) {
+    instruction.sideEffects.clearAllSideEffects();
+    instruction.sideEffects.clearAllDependencies();
+    instruction.setUseGvn();
+  }
+
   Operation operation(ConstantSystem constantSystem) => null;
 
   static InvokeDynamicSpecializer lookupSpecializer(Selector selector) {
-    if (selector.isIndex) {
-      return const IndexSpecializer();
-    } else if (selector.isIndexSet) {
-      return const IndexAssignSpecializer();
-    } else if (selector.isOperator) {
-      if (selector.name == 'unary-') {
-        return const UnaryNegateSpecializer();
-      } else if (selector.name == '~') {
-        return const BitNotSpecializer();
-      } else if (selector.name == '+') {
-        return const AddSpecializer();
-      } else if (selector.name == '-') {
-        return const SubtractSpecializer();
-      } else if (selector.name == '*') {
-        return const MultiplySpecializer();
-      } else if (selector.name == '/') {
-        return const DivideSpecializer();
-      } else if (selector.name == '~/') {
-        return const TruncatingDivideSpecializer();
-      } else if (selector.name == '%') {
-        return const ModuloSpecializer();
-      } else if (selector.name == '>>') {
-        return const ShiftRightSpecializer();
-      } else if (selector.name == '<<') {
-        return const ShiftLeftSpecializer();
-      } else if (selector.name == '&') {
-        return const BitAndSpecializer();
-      } else if (selector.name == '|') {
-        return const BitOrSpecializer();
-      } else if (selector.name == '^') {
-        return const BitXorSpecializer();
-      } else if (selector.name == '==') {
-        return const EqualsSpecializer();
-      } else if (selector.name == '<') {
-        return const LessSpecializer();
-      } else if (selector.name == '<=') {
-        return const LessEqualSpecializer();
-      } else if (selector.name == '>') {
-        return const GreaterSpecializer();
-      } else if (selector.name == '>=') {
-        return const GreaterEqualSpecializer();
-      }
-    } else if (selector.isCall) {
-      if (selector.argumentCount == 1 && selector.namedArguments.length == 0) {
-        if (selector.name == 'codeUnitAt') {
-          return const CodeUnitAtSpecializer();
+    if (selector.isIndex) return const IndexSpecializer();
+    if (selector.isIndexSet) return const IndexAssignSpecializer();
+    String name = selector.name;
+    if (selector.isOperator) {
+      if (name == 'unary-') return const UnaryNegateSpecializer();
+      if (name == '~') return const BitNotSpecializer();
+      if (name == '+') return const AddSpecializer();
+      if (name == '-') return const SubtractSpecializer();
+      if (name == '*') return const MultiplySpecializer();
+      if (name == '/') return const DivideSpecializer();
+      if (name == '~/') return const TruncatingDivideSpecializer();
+      if (name == '%') return const ModuloSpecializer();
+      if (name == '>>') return const ShiftRightSpecializer();
+      if (name == '<<') return const ShiftLeftSpecializer();
+      if (name == '&') return const BitAndSpecializer();
+      if (name == '|') return const BitOrSpecializer();
+      if (name == '^') return const BitXorSpecializer();
+      if (name == '==') return const EqualsSpecializer();
+      if (name == '<') return const LessSpecializer();
+      if (name == '<=') return const LessEqualSpecializer();
+      if (name == '>') return const GreaterSpecializer();
+      if (name == '>=') return const GreaterEqualSpecializer();
+      return const InvokeDynamicSpecializer();
+    }
+    if (selector.isCall) {
+      if (selector.namedArguments.length == 0) {
+        int argumentCount = selector.argumentCount;
+        if (argumentCount == 0) {
+          if (name == 'round') return const RoundSpecializer();
+        } else if (argumentCount == 1) {
+          if (name == 'codeUnitAt') return const CodeUnitAtSpecializer();
         }
       }
     }
@@ -219,12 +210,6 @@
     return null;
   }
 
-  void clearAllSideEffects(HInstruction instruction) {
-    instruction.sideEffects.clearAllSideEffects();
-    instruction.sideEffects.clearAllDependencies();
-    instruction.setUseGvn();
-  }
-
   bool inputsArePositiveIntegers(HInstruction instruction, Compiler compiler) {
     HInstruction left = instruction.inputs[1];
     HInstruction right = instruction.inputs[2];
@@ -756,6 +741,32 @@
       HInvokeDynamic instruction, Compiler compiler) {
     // TODO(sra): Implement a builtin HCodeUnitAt instruction and the same index
     // bounds checking optimizations as for HIndex.
+    HInstruction receiver = instruction.getDartReceiver(compiler);
+    if (receiver.isStringOrNull(compiler)) {
+      // Even if there is no builtin equivalent instruction, we know
+      // String.codeUnitAt does not have any side effect (other than throwing),
+      // and that it can be GVN'ed.
+      clearAllSideEffects(instruction);
+    }
+    return null;
+  }
+}
+
+class RoundSpecializer extends InvokeDynamicSpecializer {
+  const RoundSpecializer();
+
+  UnaryOperation operation(ConstantSystem constantSystem) {
+    return constantSystem.round;
+  }
+
+  HInstruction tryConvertToBuiltin(
+      HInvokeDynamic instruction, Compiler compiler) {
+    HInstruction receiver = instruction.getDartReceiver(compiler);
+    if (receiver.isNumberOrNull(compiler)) {
+      // Even if there is no builtin equivalent instruction, we know the
+      // instruction does not have any side effect, and that it can be GVN'ed.
+      clearAllSideEffects(instruction);
+    }
     return null;
   }
 }
diff --git a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
index 86aee00..07c515c 100644
--- a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
+++ b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
@@ -2,16 +2,22 @@
 // for 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:js_runtime/shared/embedded_names.dart';
 import 'package:kernel/ast.dart' as ir;
 
+import '../constants/expressions.dart';
 import '../common.dart';
 import '../common/names.dart';
 import '../compiler.dart';
 import '../constants/values.dart';
 import '../dart_types.dart';
 import '../elements/elements.dart';
+import '../js/js.dart' as js;
+import '../js_backend/backend_helpers.dart';
 import '../js_backend/js_backend.dart';
 import '../kernel/kernel.dart';
+import '../kernel/kernel_debug.dart';
+import '../native/native.dart' as native;
 import '../resolution/tree_elements.dart';
 import '../tree/tree.dart' as ast;
 import '../types/masks.dart';
@@ -59,8 +65,11 @@
 
   Compiler get _compiler => _backend.compiler;
   TreeElements get elements => _resolvedAst.elements;
-  GlobalTypeInferenceResults get _inferenceResults =>
-      _compiler.globalInference.results;
+  DiagnosticReporter get reporter => _compiler.reporter;
+  Element get _target => _resolvedAst.element;
+
+  GlobalTypeInferenceElementResult _resultOf(Element e) =>
+      _compiler.globalInference.results.resultOf(e);
 
   ConstantValue getConstantForSymbol(ir.SymbolLiteral node) {
     ast.Node astNode = getNode(node);
@@ -71,15 +80,24 @@
     return constantValue;
   }
 
+  // TODO(johnniwinther): Use the more precise functions below.
   Element getElement(ir.Node node) {
     Element result = _nodeToElement[node];
-    assert(result != null);
+    assert(invariant(CURRENT_ELEMENT_SPANNABLE, result != null,
+        message: "No element found for $node."));
     return result;
   }
 
+  MemberElement getMember(ir.Node node) => getElement(node).declaration;
+
+  MethodElement getMethod(ir.Node node) => getElement(node).declaration;
+
+  ClassElement getClass(ir.Node node) => getElement(node).declaration;
+
   ast.Node getNode(ir.Node node) {
     ast.Node result = _nodeToAst[node];
-    assert(result != null);
+    assert(invariant(CURRENT_ELEMENT_SPANNABLE, result != null,
+        message: "No node found for $node"));
     return result;
   }
 
@@ -112,13 +130,22 @@
     return new CallStructure(argumentCount, namedArguments);
   }
 
+  FunctionSignature getFunctionSignature(ir.FunctionNode function) {
+    return getElement(function).asFunctionElement().functionSignature;
+  }
+
   Name getName(ir.Name name) {
     return new Name(
         name.name, name.isPrivate ? getElement(name.library) : null);
   }
 
+  ir.Field getFieldFromElement(FieldElement field) {
+    return kernel.fields[field];
+  }
+
   Selector getSelector(ir.Expression node) {
     if (node is ir.PropertyGet) return getGetterSelector(node);
+    if (node is ir.PropertySet) return getSetterSelector(node);
     if (node is ir.InvocationExpression) return getInvocationSelector(node);
     _compiler.reporter.internalError(getNode(node),
         "Can only get the selector for a property get or an invocation.");
@@ -149,36 +176,49 @@
     return new Selector.getter(name);
   }
 
+  Selector getSetterSelector(ir.PropertySet setter) {
+    ir.Name irName = setter.name;
+    Name name = new Name(
+        irName.name, irName.isPrivate ? getElement(irName.library) : null);
+    return new Selector.setter(name);
+  }
+
   TypeMask typeOfInvocation(ir.Expression send) {
-    return _inferenceResults.typeOfSend(getNode(send), elements);
+    ast.Node operatorNode = kernel.nodeToAstOperator[send];
+    if (operatorNode != null) {
+      return _resultOf(_target).typeOfOperator(operatorNode);
+    }
+    return _resultOf(_target).typeOfSend(getNode(send));
   }
 
   TypeMask typeOfGet(ir.PropertyGet getter) {
-    return _inferenceResults.typeOfSend(getNode(getter), elements);
+    return _resultOf(_target).typeOfSend(getNode(getter));
+  }
+
+  TypeMask typeOfSet(ir.PropertySet setter) {
+    return _compiler.closedWorld.commonMasks.dynamicType;
   }
 
   TypeMask typeOfSend(ir.Expression send) {
     assert(send is ir.InvocationExpression || send is ir.PropertyGet);
-    return _inferenceResults.typeOfSend(getNode(send), elements);
+    return _resultOf(_target).typeOfSend(getNode(send));
   }
 
   TypeMask typeOfNewList(Element owner, ir.ListLiteral listLiteral) {
-    return _inferenceResults.typeOfNewList(owner, getNode(listLiteral)) ??
-        _compiler.commonMasks.dynamicType;
+    return _resultOf(owner).typeOfNewList(getNode(listLiteral)) ??
+        _compiler.closedWorld.commonMasks.dynamicType;
   }
 
   TypeMask typeOfIterator(ir.ForInStatement forInStatement) {
-    return _inferenceResults.typeOfIterator(getNode(forInStatement), elements);
+    return _resultOf(_target).typeOfIterator(getNode(forInStatement));
   }
 
   TypeMask typeOfIteratorCurrent(ir.ForInStatement forInStatement) {
-    return _inferenceResults.typeOfIteratorCurrent(
-        getNode(forInStatement), elements);
+    return _resultOf(_target).typeOfIteratorCurrent(getNode(forInStatement));
   }
 
   TypeMask typeOfIteratorMoveNext(ir.ForInStatement forInStatement) {
-    return _inferenceResults.typeOfIteratorMoveNext(
-        getNode(forInStatement), elements);
+    return _resultOf(_target).typeOfIteratorMoveNext(getNode(forInStatement));
   }
 
   bool isJsIndexableIterator(ir.ForInStatement forInStatement) {
@@ -220,6 +260,10 @@
     return TypeMaskFactory.inferredTypeForSelector(selector, mask, _compiler);
   }
 
+  TypeMask typeFromNativeBehavior(native.NativeBehavior nativeBehavior) {
+    return TypeMaskFactory.fromNativeBehavior(nativeBehavior, _compiler);
+  }
+
   ConstantValue getConstantFor(ir.Node node) {
     ConstantValue constantValue =
         _backend.constants.getConstantValueForNode(getNode(node), elements);
@@ -228,6 +272,11 @@
     return constantValue;
   }
 
+  ConstantValue getConstantForType(ir.DartType irType) {
+    DartType type = getDartType(irType);
+    return _backend.constantSystem.createType(_compiler, type.asRaw());
+  }
+
   bool isIntercepted(ir.Node node) {
     Selector selector = getSelector(node);
     return _backend.isInterceptedSelector(selector);
@@ -237,16 +286,27 @@
     return _backend.isInterceptedSelector(selector);
   }
 
+  LibraryElement get jsHelperLibrary => _backend.helpers.jsHelperLibrary;
+
   JumpTarget getTargetDefinition(ir.Node node) =>
       elements.getTargetDefinition(getNode(node));
 
+  ir.Class get mapLiteralClass =>
+      kernel.classes[_backend.helpers.mapLiteralClass];
+
   ir.Procedure get mapLiteralConstructor =>
       kernel.functions[_backend.helpers.mapLiteralConstructor];
 
   ir.Procedure get mapLiteralConstructorEmpty =>
       kernel.functions[_backend.helpers.mapLiteralConstructorEmpty];
 
-  Element get jsIndexableLength => _backend.helpers.jsIndexableLength;
+  ir.Procedure get mapLiteralUntypedEmptyMaker =>
+      kernel.functions[_backend.helpers.mapLiteralUntypedEmptyMaker];
+
+  ir.Procedure get mapLiteralUntypedMaker =>
+      kernel.functions[_backend.helpers.mapLiteralUntypedMaker];
+
+  MemberElement get jsIndexableLength => _backend.helpers.jsIndexableLength;
 
   ir.Procedure get checkConcurrentModificationError =>
       kernel.functions[_backend.helpers.checkConcurrentModificationError];
@@ -255,6 +315,70 @@
       TypeMaskFactory.inferredReturnTypeForElement(
           _backend.helpers.checkConcurrentModificationError, _compiler);
 
+  ir.Procedure get assertHelper =>
+      kernel.functions[_backend.helpers.assertHelper];
+
+  TypeMask get throwTypeErrorType => TypeMaskFactory
+      .inferredReturnTypeForElement(_backend.helpers.throwTypeError, _compiler);
+
+  TypeMask get assertHelperReturnType => TypeMaskFactory
+      .inferredReturnTypeForElement(_backend.helpers.assertHelper, _compiler);
+
+  ir.Procedure get assertTest => kernel.functions[_backend.helpers.assertTest];
+
+  TypeMask get assertTestReturnType => TypeMaskFactory
+      .inferredReturnTypeForElement(_backend.helpers.assertTest, _compiler);
+
+  ir.Procedure get assertThrow =>
+      kernel.functions[_backend.helpers.assertThrow];
+
+  ir.Procedure get setRuntimeTypeInfo =>
+      kernel.functions[_backend.helpers.setRuntimeTypeInfo];
+
+  TypeMask get assertThrowReturnType => TypeMaskFactory
+      .inferredReturnTypeForElement(_backend.helpers.assertThrow, _compiler);
+
+  ir.Class get objectClass => kernel.classes[_compiler.coreClasses.objectClass];
+
+  ir.Procedure get currentIsolate =>
+      kernel.functions[_backend.helpers.currentIsolate];
+
+  bool isInForeignLibrary(ir.Member member) =>
+      _backend.isForeign(getElement(member));
+
+  native.NativeBehavior getNativeBehavior(ir.Node node) {
+    return elements.getNativeData(getNode(node));
+  }
+
+  js.Name getNameForJsGetName(ir.Node argument, ConstantValue constant) {
+    int index = _extractEnumIndexFromConstantValue(
+        constant, _backend.helpers.jsGetNameEnum);
+    if (index == null) return null;
+    return _backend.namer
+        .getNameForJsGetName(getNode(argument), JsGetName.values[index]);
+  }
+
+  js.Template getJsBuiltinTemplate(ConstantValue constant) {
+    int index = _extractEnumIndexFromConstantValue(
+        constant, _backend.helpers.jsBuiltinEnum);
+    if (index == null) return null;
+    return _backend.emitter.builtinTemplateFor(JsBuiltin.values[index]);
+  }
+
+  int _extractEnumIndexFromConstantValue(
+      ConstantValue constant, Element classElement) {
+    if (constant is ConstructedConstantValue) {
+      if (constant.type.element == classElement) {
+        assert(constant.fields.length == 1);
+        ConstantValue indexConstant = constant.fields.values.single;
+        if (indexConstant is IntConstantValue) {
+          return indexConstant.primitiveValue;
+        }
+      }
+    }
+    return null;
+  }
+
   DartType getDartType(ir.DartType type) {
     return type.accept(_typeConverter);
   }
@@ -262,8 +386,255 @@
   List<DartType> getDartTypes(List<ir.DartType> types) {
     return types.map(getDartType).toList();
   }
+
+  DartType getFunctionReturnType(ir.FunctionNode node) {
+    return getDartType(node.returnType);
+  }
+
+  /// Computes the function type corresponding the signature of [node].
+  FunctionType getFunctionType(ir.FunctionNode node) {
+    DartType returnType = getFunctionReturnType(node);
+    List<DartType> parameterTypes = <DartType>[];
+    List<DartType> optionalParameterTypes = <DartType>[];
+    for (ir.VariableDeclaration variable in node.positionalParameters) {
+      if (parameterTypes.length == node.requiredParameterCount) {
+        optionalParameterTypes.add(getDartType(variable.type));
+      } else {
+        parameterTypes.add(getDartType(variable.type));
+      }
+    }
+    List<String> namedParameters = <String>[];
+    List<DartType> namedParameterTypes = <DartType>[];
+    List<ir.VariableDeclaration> sortedNamedParameters =
+        node.namedParameters.toList()..sort((a, b) => a.name.compareTo(b.name));
+    for (ir.VariableDeclaration variable in sortedNamedParameters) {
+      namedParameters.add(variable.name);
+      namedParameterTypes.add(getDartType(variable.type));
+    }
+    return new FunctionType.synthesized(returnType, parameterTypes,
+        optionalParameterTypes, namedParameters, namedParameterTypes);
+  }
+
+  /// Converts [annotations] into a list of [ConstantExpression]s.
+  List<ConstantExpression> getMetadata(List<ir.Expression> annotations) {
+    List<ConstantExpression> metadata = <ConstantExpression>[];
+    annotations.forEach((ir.Expression node) {
+      ConstantExpression constant = node.accept(new Constantifier(this));
+      if (constant == null) {
+        throw new UnsupportedError(
+            'No constant for ${DebugPrinter.prettyPrint(node)}');
+      }
+      metadata.add(constant);
+    });
+    return metadata;
+  }
+
+  /// Compute the kind of foreign helper function called by [node], if any.
+  ForeignKind getForeignKind(ir.StaticInvocation node) {
+    if (isForeignLibrary(node.target.enclosingLibrary)) {
+      switch (node.target.name.name) {
+        case BackendHelpers.JS:
+          return ForeignKind.JS;
+        case BackendHelpers.JS_BUILTIN:
+          return ForeignKind.JS_BUILTIN;
+        case BackendHelpers.JS_EMBEDDED_GLOBAL:
+          return ForeignKind.JS_EMBEDDED_GLOBAL;
+        case BackendHelpers.JS_INTERCEPTOR_CONSTANT:
+          return ForeignKind.JS_INTERCEPTOR_CONSTANT;
+      }
+    }
+    return ForeignKind.NONE;
+  }
+
+  /// Return `true` if [node] is the `dart:_foreign_helper` library.
+  bool isForeignLibrary(ir.Library node) {
+    return node.importUri == BackendHelpers.DART_FOREIGN_HELPER;
+  }
+
+  /// Looks up [typeName] for use in the spec-string of a `JS` called.
+  // TODO(johnniwinther): Use this in [native.NativeBehavior] instead of calling the
+  // `ForeignResolver`.
+  // TODO(johnniwinther): Cache the result to avoid redundant lookups?
+  native.TypeLookup _typeLookup({bool resolveAsRaw: true}) {
+    return (String typeName) {
+      DartType findIn(Uri uri) {
+        LibraryElement library = _compiler.libraryLoader.lookupLibrary(uri);
+        if (library != null) {
+          Element element = library.find(typeName);
+          if (element != null && element.isClass) {
+            ClassElement cls = element;
+            // TODO(johnniwinther): Align semantics.
+            return resolveAsRaw ? cls.rawType : cls.thisType;
+          }
+        }
+        return null;
+      }
+
+      DartType type = findIn(Uris.dart_core);
+      type ??= findIn(BackendHelpers.DART_JS_HELPER);
+      type ??= findIn(BackendHelpers.DART_INTERCEPTORS);
+      type ??= findIn(BackendHelpers.DART_ISOLATE_HELPER);
+      type ??= findIn(Uris.dart_collection);
+      type ??= findIn(Uris.dart_html);
+      type ??= findIn(Uris.dart_svg);
+      type ??= findIn(Uris.dart_web_audio);
+      type ??= findIn(Uris.dart_web_gl);
+      return type;
+    };
+  }
+
+  String _getStringArgument(ir.StaticInvocation node, int index) {
+    return node.arguments.positional[index].accept(new Stringifier());
+  }
+
+  /// Computes the [native.NativeBehavior] for a call to the [JS] function.
+  // TODO(johnniwinther): Cache this for later use.
+  native.NativeBehavior getNativeBehaviorForJsCall(ir.StaticInvocation node) {
+    if (node.arguments.positional.length < 2 ||
+        node.arguments.named.isNotEmpty) {
+      reporter.reportErrorMessage(
+          CURRENT_ELEMENT_SPANNABLE, MessageKind.WRONG_ARGUMENT_FOR_JS);
+      return new native.NativeBehavior();
+    }
+    String specString = _getStringArgument(node, 0);
+    if (specString == null) {
+      reporter.reportErrorMessage(
+          CURRENT_ELEMENT_SPANNABLE, MessageKind.WRONG_ARGUMENT_FOR_JS_FIRST);
+      return new native.NativeBehavior();
+    }
+
+    String codeString = _getStringArgument(node, 1);
+    if (codeString == null) {
+      reporter.reportErrorMessage(
+          CURRENT_ELEMENT_SPANNABLE, MessageKind.WRONG_ARGUMENT_FOR_JS_SECOND);
+      return new native.NativeBehavior();
+    }
+
+    return native.NativeBehavior.ofJsCall(
+        specString,
+        codeString,
+        _typeLookup(resolveAsRaw: true),
+        CURRENT_ELEMENT_SPANNABLE,
+        reporter,
+        _compiler.coreTypes);
+  }
+
+  /// Computes the [native.NativeBehavior] for a call to the [JS_BUILTIN] function.
+  // TODO(johnniwinther): Cache this for later use.
+  native.NativeBehavior getNativeBehaviorForJsBuiltinCall(
+      ir.StaticInvocation node) {
+    if (node.arguments.positional.length < 1) {
+      reporter.internalError(
+          CURRENT_ELEMENT_SPANNABLE, "JS builtin expression has no type.");
+      return new native.NativeBehavior();
+    }
+    if (node.arguments.positional.length < 2) {
+      reporter.internalError(
+          CURRENT_ELEMENT_SPANNABLE, "JS builtin is missing name.");
+      return new native.NativeBehavior();
+    }
+    String specString = _getStringArgument(node, 0);
+    if (specString == null) {
+      reporter.internalError(
+          CURRENT_ELEMENT_SPANNABLE, "Unexpected first argument.");
+      return new native.NativeBehavior();
+    }
+    return native.NativeBehavior.ofJsBuiltinCall(
+        specString,
+        _typeLookup(resolveAsRaw: true),
+        CURRENT_ELEMENT_SPANNABLE,
+        reporter,
+        _compiler.coreTypes);
+  }
+
+  /// Computes the [native.NativeBehavior] for a call to the [JS_EMBEDDED_GLOBAL]
+  /// function.
+  // TODO(johnniwinther): Cache this for later use.
+  native.NativeBehavior getNativeBehaviorForJsEmbeddedGlobalCall(
+      ir.StaticInvocation node) {
+    if (node.arguments.positional.length < 1) {
+      reporter.internalError(CURRENT_ELEMENT_SPANNABLE,
+          "JS embedded global expression has no type.");
+      return new native.NativeBehavior();
+    }
+    if (node.arguments.positional.length < 2) {
+      reporter.internalError(
+          CURRENT_ELEMENT_SPANNABLE, "JS embedded global is missing name.");
+      return new native.NativeBehavior();
+    }
+    if (node.arguments.positional.length > 2 ||
+        node.arguments.named.isNotEmpty) {
+      reporter.internalError(CURRENT_ELEMENT_SPANNABLE,
+          "JS embedded global has more than 2 arguments.");
+      return new native.NativeBehavior();
+    }
+    String specString = _getStringArgument(node, 0);
+    if (specString == null) {
+      reporter.internalError(
+          CURRENT_ELEMENT_SPANNABLE, "Unexpected first argument.");
+      return new native.NativeBehavior();
+    }
+    return native.NativeBehavior.ofJsEmbeddedGlobalCall(
+        specString,
+        _typeLookup(resolveAsRaw: true),
+        CURRENT_ELEMENT_SPANNABLE,
+        reporter,
+        _compiler.coreTypes);
+  }
+
+  /// Returns `true` is [node] has a `@Native(...)` annotation.
+  // TODO(johnniwinther): Cache this for later use.
+  bool isNative(ir.Class node) {
+    for (ir.Expression annotation in node.annotations) {
+      if (annotation is ir.ConstructorInvocation) {
+        ConstructorElement target = getElement(annotation.target).declaration;
+        if (target.enclosingClass ==
+            _compiler.commonElements.nativeAnnotationClass) {
+          return true;
+        }
+      }
+    }
+    return false;
+  }
+
+  /// Computes the native behavior for reading the native [field].
+  // TODO(johnniwinther): Cache this for later use.
+  native.NativeBehavior getNativeBehaviorForFieldLoad(ir.Field field) {
+    DartType type = getDartType(field.type);
+    List<ConstantExpression> metadata = getMetadata(field.annotations);
+    return native.NativeBehavior.ofFieldLoad(CURRENT_ELEMENT_SPANNABLE, type,
+        metadata, _typeLookup(resolveAsRaw: false), _compiler,
+        isJsInterop: false);
+  }
+
+  /// Computes the native behavior for writing to the native [field].
+  // TODO(johnniwinther): Cache this for later use.
+  native.NativeBehavior getNativeBehaviorForFieldStore(ir.Field field) {
+    DartType type = getDartType(field.type);
+    return native.NativeBehavior.ofFieldStore(type, _compiler.resolution);
+  }
+
+  /// Computes the native behavior for calling [procedure].
+  // TODO(johnniwinther): Cache this for later use.
+  native.NativeBehavior getNativeBehaviorForMethod(ir.Procedure procedure) {
+    DartType type = getFunctionType(procedure.function);
+    List<ConstantExpression> metadata = getMetadata(procedure.annotations);
+    return native.NativeBehavior.ofMethod(CURRENT_ELEMENT_SPANNABLE, type,
+        metadata, _typeLookup(resolveAsRaw: false), _compiler,
+        isJsInterop: false);
+  }
 }
 
+/// Kinds of foreign functions.
+enum ForeignKind {
+  JS,
+  JS_BUILTIN,
+  JS_EMBEDDED_GLOBAL,
+  JS_INTERCEPTOR_CONSTANT,
+  NONE,
+}
+
+/// Visitor that converts kernel dart types into [DartType].
 class DartTypeConverter extends ir.DartTypeVisitor<DartType> {
   final KernelAstAdapter astAdapter;
 
@@ -278,7 +649,19 @@
 
   @override
   DartType visitTypeParameterType(ir.TypeParameterType node) {
-    return new TypeVariableType(astAdapter.getElement(node.parameter));
+    if (node.parameter.parent is ir.Class) {
+      ir.Class cls = node.parameter.parent;
+      int index = cls.typeParameters.indexOf(node.parameter);
+      ClassElement classElement = astAdapter.getElement(cls);
+      return classElement.typeVariables[index];
+    } else if (node.parameter.parent is ir.FunctionNode) {
+      ir.FunctionNode func = node.parameter.parent;
+      int index = func.typeParameters.indexOf(node.parameter);
+      ConstructorElement constructorElement = astAdapter.getElement(func);
+      ClassElement classElement = constructorElement.enclosingClass;
+      return classElement.typeVariables[index];
+    }
+    throw new UnsupportedError('Unsupported type parameter type node $node.');
   }
 
   @override
@@ -291,8 +674,8 @@
         visitTypes(node.positionalParameters
             .skip(node.requiredParameterCount)
             .toList()),
-        node.namedParameters.keys.toList(),
-        visitTypes(node.namedParameters.values.toList()));
+        node.namedParameters.map((n) => n.name).toList(),
+        node.namedParameters.map((n) => visitType(n.type)).toList());
   }
 
   @override
@@ -316,3 +699,75 @@
     throw new UnimplementedError("Invalid types not currently supported");
   }
 }
+
+/// Visitor that converts string literals and concatenations of string literals
+/// into the string value.
+class Stringifier extends ir.ExpressionVisitor<String> {
+  @override
+  String visitStringLiteral(ir.StringLiteral node) => node.value;
+
+  @override
+  String visitStringConcatenation(ir.StringConcatenation node) {
+    StringBuffer sb = new StringBuffer();
+    for (ir.Expression expression in node.expressions) {
+      String value = expression.accept(this);
+      if (value == null) return null;
+      sb.write(value);
+    }
+    return sb.toString();
+  }
+}
+
+/// Visitor that converts a kernel constant expression into a
+/// [ConstantExpression].
+class Constantifier extends ir.ExpressionVisitor<ConstantExpression> {
+  final KernelAstAdapter astAdapter;
+
+  Constantifier(this.astAdapter);
+
+  @override
+  ConstantExpression visitConstructorInvocation(ir.ConstructorInvocation node) {
+    ConstructorElement constructor =
+        astAdapter.getElement(node.target).declaration;
+    List<DartType> typeArguments = <DartType>[];
+    for (ir.DartType type in node.arguments.types) {
+      typeArguments.add(astAdapter.getDartType(type));
+    }
+    List<ConstantExpression> arguments = <ConstantExpression>[];
+    List<String> argumentNames = <String>[];
+    for (ir.Expression argument in node.arguments.positional) {
+      ConstantExpression constant = argument.accept(this);
+      if (constant == null) return null;
+      arguments.add(constant);
+    }
+    for (ir.NamedExpression argument in node.arguments.named) {
+      argumentNames.add(argument.name);
+      ConstantExpression constant = argument.value.accept(this);
+      if (constant == null) return null;
+      arguments.add(constant);
+    }
+    return new ConstructedConstantExpression(
+        constructor.enclosingClass.thisType.createInstantiation(typeArguments),
+        constructor,
+        new CallStructure(
+            node.arguments.positional.length + argumentNames.length,
+            argumentNames),
+        arguments);
+  }
+
+  @override
+  ConstantExpression visitStaticGet(ir.StaticGet node) {
+    Element element = astAdapter.getMember(node.target);
+    if (element.isField) {
+      return new VariableConstantExpression(element);
+    }
+    astAdapter.reporter.internalError(
+        CURRENT_ELEMENT_SPANNABLE, "Unexpected constant target: $element.");
+    return null;
+  }
+
+  @override
+  ConstantExpression visitStringLiteral(ir.StringLiteral node) {
+    return new StringConstantExpression(node.value);
+  }
+}
diff --git a/pkg/compiler/lib/src/ssa/kernel_impact.dart b/pkg/compiler/lib/src/ssa/kernel_impact.dart
index a2f9279..155c10e 100644
--- a/pkg/compiler/lib/src/ssa/kernel_impact.dart
+++ b/pkg/compiler/lib/src/ssa/kernel_impact.dart
@@ -15,6 +15,7 @@
 import '../kernel/kernel_debug.dart';
 import '../kernel/kernel_visitor.dart';
 import '../resolution/registry.dart' show ResolutionWorldImpactBuilder;
+import '../universe/call_structure.dart';
 import '../universe/feature.dart';
 import '../universe/selector.dart';
 import '../universe/use.dart';
@@ -24,27 +25,40 @@
 
 /// Computes the [ResolutionImpact] for [resolvedAst] through kernel.
 ResolutionImpact build(Compiler compiler, ResolvedAst resolvedAst) {
-  AstElement element = resolvedAst.element.implementation;
-  JavaScriptBackend backend = compiler.backend;
-  Kernel kernel = backend.kernelTask.kernel;
-  KernelImpactBuilder builder =
-      new KernelImpactBuilder(resolvedAst, compiler, kernel);
-  if (element.isFunction) {
-    ir.Procedure function = kernel.functions[element];
-    if (function == null) {
-      print("FOUND NULL FUNCTION: $element");
+  AstElement element = resolvedAst.element;
+  return compiler.reporter.withCurrentElement(element.implementation, () {
+    JavaScriptBackend backend = compiler.backend;
+    Kernel kernel = backend.kernelTask.kernel;
+    KernelImpactBuilder builder =
+        new KernelImpactBuilder(resolvedAst, compiler, kernel);
+    if (element.isFunction ||
+        element.isGetter ||
+        element.isSetter ||
+        element.isFactoryConstructor) {
+      ir.Procedure function = kernel.functions[element];
+      if (function == null) {
+        throw "FOUND NULL FUNCTION: $element";
+      } else {
+        return builder.buildProcedure(function);
+      }
+    } else if (element.isGenerativeConstructor) {
+      ir.Constructor constructor = kernel.functions[element];
+      if (constructor == null) {
+        throw "FOUND NULL CONSTRUCTOR: $element";
+      } else {
+        return builder.buildConstructor(constructor);
+      }
+    } else if (element.isField) {
+      ir.Field field = kernel.fields[element];
+      if (field == null) {
+        throw "FOUND NULL FIELD: $element";
+      } else {
+        return builder.buildField(field);
+      }
     } else {
-      return builder.buildProcedure(function);
+      throw new UnsupportedError("Unsupported element: $element");
     }
-  } else {
-    ir.Field field = kernel.fields[element];
-    if (field == null) {
-      print("FOUND NULL FUNCTION: $element");
-    } else {
-      return builder.buildField(field);
-    }
-  }
-  return null;
+  });
 }
 
 class KernelImpactBuilder extends ir.Visitor {
@@ -72,33 +86,72 @@
     return type;
   }
 
-  /// Add a checked-mode type use of return type and parameters of [node].
-  void checkFunctionTypes(ir.FunctionNode node) {
-    checkType(node.returnType);
-    node.positionalParameters.forEach((v) => checkType(v.type));
-    node.namedParameters.forEach((v) => checkType(v.type));
+  /// Add checked-mode type use for the parameter type and constant for the
+  /// default value of [parameter].
+  void handleParameter(ir.VariableDeclaration parameter) {
+    checkType(parameter.type);
+    visitNode(parameter.initializer);
+  }
+
+  /// Add checked-mode type use for parameter and return types, and add
+  /// constants for default values.
+  void handleSignature(ir.FunctionNode node, {bool checkReturnType: true}) {
+    if (checkReturnType) {
+      checkType(node.returnType);
+    }
+    node.positionalParameters.forEach(handleParameter);
+    node.namedParameters.forEach(handleParameter);
   }
 
   ResolutionImpact buildField(ir.Field field) {
     checkType(field.type);
     if (field.initializer != null) {
       visitNode(field.initializer);
-    } else {
-      impactBuilder.registerFeature(Feature.FIELD_WITHOUT_INITIALIZER);
+      if (!field.isInstanceMember &&
+          !field.isConst &&
+          field.initializer is! ir.NullLiteral) {
+        impactBuilder.registerFeature(Feature.LAZY_FIELD);
+      }
+    }
+    if (field.isInstanceMember && astAdapter.isNative(field.enclosingClass)) {
+      impactBuilder
+          .registerNativeData(astAdapter.getNativeBehaviorForFieldLoad(field));
+      impactBuilder
+          .registerNativeData(astAdapter.getNativeBehaviorForFieldStore(field));
     }
     return impactBuilder;
   }
 
+  ResolutionImpact buildConstructor(ir.Constructor constructor) {
+    handleSignature(constructor.function, checkReturnType: false);
+    visitNodes(constructor.initializers);
+    visitNode(constructor.function.body);
+    return impactBuilder;
+  }
+
   ResolutionImpact buildProcedure(ir.Procedure procedure) {
-    if (procedure.kind == ir.ProcedureKind.Method ||
-        procedure.kind == ir.ProcedureKind.Operator) {
-      checkFunctionTypes(procedure.function);
-      visitNode(procedure.function.body);
-    } else {
-      compiler.reporter.internalError(
-          resolvedAst.element,
-          "Unable to compute resolution impact for this kind of Kernel "
-          "procedure: ${procedure.kind}");
+    handleSignature(procedure.function);
+    visitNode(procedure.function.body);
+    switch (procedure.function.asyncMarker) {
+      case ir.AsyncMarker.Sync:
+        break;
+      case ir.AsyncMarker.SyncStar:
+        impactBuilder.registerFeature(Feature.SYNC_STAR);
+        break;
+      case ir.AsyncMarker.Async:
+        impactBuilder.registerFeature(Feature.ASYNC);
+        break;
+      case ir.AsyncMarker.AsyncStar:
+        impactBuilder.registerFeature(Feature.ASYNC_STAR);
+        break;
+      case ir.AsyncMarker.SyncYielding:
+        compiler.reporter.internalError(resolvedAst.element,
+            "Unexpected async marker: ${procedure.function.asyncMarker}");
+    }
+    if (procedure.isExternal &&
+        !astAdapter.isForeignLibrary(procedure.enclosingLibrary)) {
+      impactBuilder
+          .registerNativeData(astAdapter.getNativeBehaviorForMethod(procedure));
     }
     return impactBuilder;
   }
@@ -196,12 +249,39 @@
   }
 
   @override
-  void visitStaticInvocation(ir.StaticInvocation invocation) {
-    _visitArguments(invocation.arguments);
-    Element target = astAdapter.getElement(invocation.target).declaration;
+  void visitConstructorInvocation(ir.ConstructorInvocation node) {
+    handleNew(node, node.target, isConst: node.isConst);
+  }
+
+  void handleNew(ir.InvocationExpression node, ir.Member target,
+      {bool isConst: false}) {
+    _visitArguments(node.arguments);
+    Element element = astAdapter.getElement(target).declaration;
+    ClassElement cls = astAdapter.getElement(target.enclosingClass);
+    List<DartType> typeArguments =
+        astAdapter.getDartTypes(node.arguments.types);
+    InterfaceType type = new InterfaceType(cls, typeArguments);
+    CallStructure callStructure = astAdapter.getCallStructure(node.arguments);
+    impactBuilder.registerStaticUse(isConst
+        ? new StaticUse.constConstructorInvoke(element, callStructure, type)
+        : new StaticUse.typedConstructorInvoke(element, callStructure, type));
+    if (typeArguments.any((DartType type) => !type.isDynamic)) {
+      impactBuilder.registerFeature(Feature.TYPE_VARIABLE_BOUNDS_CHECK);
+    }
+  }
+
+  @override
+  void visitSuperInitializer(ir.SuperInitializer node) {
+    Element target = astAdapter.getElement(node.target).declaration;
+    _visitArguments(node.arguments);
+    impactBuilder.registerStaticUse(new StaticUse.superConstructorInvoke(
+        target, astAdapter.getCallStructure(node.arguments)));
+  }
+
+  @override
+  void visitStaticInvocation(ir.StaticInvocation node) {
+    Element target = astAdapter.getElement(node.target).declaration;
     if (target.isFactoryConstructor) {
-      impactBuilder.registerStaticUse(new StaticUse.constructorInvoke(
-          target, astAdapter.getCallStructure(invocation.arguments)));
       // TODO(johnniwinther): We should not mark the type as instantiated but
       // rather follow the type arguments directly.
       //
@@ -224,18 +304,39 @@
       // to B. Currently, we only do this soundly if we register A<int> and
       // A<String> as instantiated. We should instead register that A.T is
       // instantiated as int and String.
-      ClassElement cls =
-          astAdapter.getElement(invocation.target.enclosingClass);
-      List<DartType> typeArguments =
-          astAdapter.getDartTypes(invocation.arguments.types);
-      impactBuilder.registerTypeUse(
-          new TypeUse.instantiation(new InterfaceType(cls, typeArguments)));
-      if (typeArguments.any((DartType type) => !type.isDynamic)) {
-        impactBuilder.registerFeature(Feature.TYPE_VARIABLE_BOUNDS_CHECK);
-      }
+      handleNew(node, node.target, isConst: node.isConst);
     } else {
+      _visitArguments(node.arguments);
       impactBuilder.registerStaticUse(new StaticUse.staticInvoke(
-          target, astAdapter.getCallStructure(invocation.arguments)));
+          target, astAdapter.getCallStructure(node.arguments)));
+    }
+    switch (astAdapter.getForeignKind(node)) {
+      case ForeignKind.JS:
+        impactBuilder
+            .registerNativeData(astAdapter.getNativeBehaviorForJsCall(node));
+        break;
+      case ForeignKind.JS_BUILTIN:
+        impactBuilder.registerNativeData(
+            astAdapter.getNativeBehaviorForJsBuiltinCall(node));
+        break;
+      case ForeignKind.JS_EMBEDDED_GLOBAL:
+        impactBuilder.registerNativeData(
+            astAdapter.getNativeBehaviorForJsEmbeddedGlobalCall(node));
+        break;
+      case ForeignKind.JS_INTERCEPTOR_CONSTANT:
+        if (node.arguments.positional.length != 1 ||
+            node.arguments.named.isNotEmpty) {
+          astAdapter.reporter.reportErrorMessage(CURRENT_ELEMENT_SPANNABLE,
+              MessageKind.WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT);
+        }
+        ir.Node argument = node.arguments.positional.first;
+        if (argument is ir.TypeLiteral && argument.type is ir.InterfaceType) {
+          impactBuilder.registerTypeUse(
+              new TypeUse.instantiation(astAdapter.getDartType(argument.type)));
+        }
+        break;
+      case ForeignKind.NONE:
+        break;
     }
   }
 
@@ -251,6 +352,71 @@
   }
 
   @override
+  void visitStaticSet(ir.StaticSet node) {
+    visitNode(node.value);
+    Element element = astAdapter.getElement(node.target).declaration;
+    impactBuilder.registerStaticUse(new StaticUse.staticSet(element));
+  }
+
+  void handleSuperInvocation(ir.Node target, ir.Node arguments) {
+    Element element = astAdapter.getElement(target).declaration;
+    _visitArguments(arguments);
+    impactBuilder.registerStaticUse(new StaticUse.superInvoke(
+        element, astAdapter.getCallStructure(arguments)));
+  }
+
+  @override
+  void visitDirectMethodInvocation(ir.DirectMethodInvocation node) {
+    handleSuperInvocation(node.target, node.arguments);
+  }
+
+  @override
+  void visitSuperMethodInvocation(ir.SuperMethodInvocation node) {
+    // TODO(johnniwinther): Should we support this or always use the
+    // [MixinFullResolution] transformer?
+    handleSuperInvocation(node.interfaceTarget, node.arguments);
+  }
+
+  void handleSuperGet(ir.Member target) {
+    Element element = astAdapter.getElement(target).declaration;
+    if (target is ir.Procedure && target.kind == ir.ProcedureKind.Method) {
+      impactBuilder.registerStaticUse(new StaticUse.superTearOff(element));
+    } else {
+      impactBuilder.registerStaticUse(new StaticUse.superGet(element));
+    }
+  }
+
+  @override
+  void visitDirectGet(ir.StaticGet node) {
+    handleSuperGet(node.target);
+  }
+
+  @override
+  void visitSuperPropertyGet(ir.SuperPropertyGet node) {
+    handleSuperGet(node.interfaceTarget);
+  }
+
+  void handleSuperSet(ir.Node target, ir.Node value) {
+    visitNode(value);
+    Element element = astAdapter.getElement(target).declaration;
+    if (target is ir.Field) {
+      impactBuilder.registerStaticUse(new StaticUse.superFieldSet(element));
+    } else {
+      impactBuilder.registerStaticUse(new StaticUse.superSetterSet(element));
+    }
+  }
+
+  @override
+  void visitDirectPropertySet(ir.DirectPropertySet node) {
+    handleSuperSet(node.target, node.value);
+  }
+
+  @override
+  void visitSuperPropertySet(ir.SuperPropertySet node) {
+    handleSuperSet(node.interfaceTarget, node.value);
+  }
+
+  @override
   void visitMethodInvocation(ir.MethodInvocation invocation) {
     var receiver = invocation.receiver;
     if (receiver is ir.VariableGet &&
@@ -299,7 +465,7 @@
   void visitFunctionDeclaration(ir.FunctionDeclaration node) {
     impactBuilder
         .registerStaticUse(new StaticUse.closure(astAdapter.getElement(node)));
-    checkFunctionTypes(node.function);
+    handleSignature(node.function);
     visitNode(node.function.body);
   }
 
@@ -307,7 +473,7 @@
   void visitFunctionExpression(ir.FunctionExpression node) {
     impactBuilder
         .registerStaticUse(new StaticUse.closure(astAdapter.getElement(node)));
-    checkFunctionTypes(node.function);
+    handleSignature(node.function);
     visitNode(node.function.body);
   }
 
@@ -321,6 +487,88 @@
     }
   }
 
+  @override
+  void visitIsExpression(ir.IsExpression node) {
+    impactBuilder.registerTypeUse(
+        new TypeUse.isCheck(astAdapter.getDartType(node.type)));
+    visitNode(node.operand);
+  }
+
+  @override
+  void visitAsExpression(ir.AsExpression node) {
+    impactBuilder
+        .registerTypeUse(new TypeUse.asCast(astAdapter.getDartType(node.type)));
+    visitNode(node.operand);
+  }
+
+  @override
+  void visitThrow(ir.Throw node) {
+    impactBuilder.registerFeature(Feature.THROW_EXPRESSION);
+    visitNode(node.expression);
+  }
+
+  @override
+  void visitForInStatement(ir.ForInStatement node) {
+    visitNode(node.variable);
+    visitNode(node.iterable);
+    visitNode(node.body);
+    if (node.isAsync) {
+      impactBuilder.registerFeature(Feature.ASYNC_FOR_IN);
+    } else {
+      impactBuilder.registerFeature(Feature.SYNC_FOR_IN);
+      impactBuilder
+          .registerDynamicUse(new DynamicUse(Selectors.iterator, null));
+    }
+    impactBuilder.registerDynamicUse(new DynamicUse(Selectors.current, null));
+    impactBuilder.registerDynamicUse(new DynamicUse(Selectors.moveNext, null));
+  }
+
+  @override
+  void visitTryCatch(ir.TryCatch node) {
+    visitNode(node.body);
+    visitNodes(node.catches);
+  }
+
+  @override
+  void visitCatch(ir.Catch node) {
+    impactBuilder.registerFeature(Feature.CATCH_STATEMENT);
+    if (node.stackTrace != null) {
+      impactBuilder.registerFeature(Feature.STACK_TRACE_IN_CATCH);
+    }
+    if (node.guard is! ir.DynamicType) {
+      impactBuilder.registerTypeUse(
+          new TypeUse.catchType(astAdapter.getDartType(node.guard)));
+    }
+    visitNode(node.body);
+  }
+
+  @override
+  void visitTryFinally(ir.TryFinally node) {
+    visitNode(node.body);
+    visitNode(node.finalizer);
+  }
+
+  @override
+  void visitTypeLiteral(ir.TypeLiteral node) {
+    impactBuilder.registerTypeUse(
+        new TypeUse.typeLiteral(astAdapter.getDartType(node.type)));
+  }
+
+  @override
+  void visitFieldInitializer(ir.FieldInitializer node) {
+    impactBuilder.registerStaticUse(
+        new StaticUse.fieldInit(astAdapter.getElement(node.field)));
+    visitNode(node.value);
+  }
+
+  @override
+  void visitRedirectingInitializer(ir.RedirectingInitializer node) {
+    _visitArguments(node.arguments);
+    Element target = astAdapter.getElement(node.target).declaration;
+    impactBuilder.registerStaticUse(new StaticUse.superConstructorInvoke(
+        target, astAdapter.getCallStructure(node.arguments)));
+  }
+
   // TODO(johnniwinther): Make this throw and visit child nodes explicitly
   // instead to ensure that we don't visit unwanted parts of the ir.
   @override
diff --git a/pkg/compiler/lib/src/ssa/kernel_string_builder.dart b/pkg/compiler/lib/src/ssa/kernel_string_builder.dart
index 21da2e4..38a3f63 100644
--- a/pkg/compiler/lib/src/ssa/kernel_string_builder.dart
+++ b/pkg/compiler/lib/src/ssa/kernel_string_builder.dart
@@ -43,9 +43,10 @@
       return;
     }
 
-    // TODO(het): If toString method is guaranteed to return a string, then call
-    // it directly instead of stringify. Or, better yet, do this later in the
-    // optimization phase.
+    // TODO(efortuna): If we decide to do inlining before finishing constructing
+    // the control flow graph, we'd want to do the optimization of
+    // calling toString here if the type is provably a string rather than in the
+    // optimization phase (which is where we currently do it).
 
     append(stringify(expression));
   }
diff --git a/pkg/compiler/lib/src/ssa/locals_handler.dart b/pkg/compiler/lib/src/ssa/locals_handler.dart
index dc2babe..0eca03a 100644
--- a/pkg/compiler/lib/src/ssa/locals_handler.dart
+++ b/pkg/compiler/lib/src/ssa/locals_handler.dart
@@ -186,7 +186,7 @@
   void startFunction(AstElement element, ast.Node node) {
     assert(invariant(element, element.isImplementation));
     closureData = _compiler.closureToClassMapper
-        .computeClosureToClassMapping(element.resolvedAst);
+        .getClosureToClassMapping(element.resolvedAst);
 
     if (element is FunctionElement) {
       FunctionElement functionElement = element;
diff --git a/pkg/compiler/lib/src/ssa/nodes.dart b/pkg/compiler/lib/src/ssa/nodes.dart
index ddeaf26..712ff29 100644
--- a/pkg/compiler/lib/src/ssa/nodes.dart
+++ b/pkg/compiler/lib/src/ssa/nodes.dart
@@ -8,7 +8,9 @@
 import '../constants/constant_system.dart';
 import '../constants/values.dart';
 import '../dart_types.dart';
-import '../elements/elements.dart';
+import '../elements/elements.dart'
+    show Entity, JumpTarget, LabelDefinition, Local;
+import '../elements/entities.dart';
 import '../io/source_information.dart';
 import '../js/js.dart' as js;
 import '../js_backend/backend_helpers.dart' show BackendHelpers;
@@ -154,7 +156,8 @@
 }
 
 class HGraph {
-  Element element; // Used for debug printing.
+  // TODO(johnniwinther): Maybe this should be [MemberLike].
+  Entity element; // Used for debug printing.
   HBasicBlock entry;
   HBasicBlock exit;
   HThis thisInstruction;
@@ -224,9 +227,9 @@
     return result;
   }
 
-  HConstant addDeferredConstant(ConstantValue constant, PrefixElement prefix,
+  HConstant addDeferredConstant(ConstantValue constant, Entity prefix,
       SourceInformation sourceInformation, Compiler compiler) {
-    // TODO(sigurdm,johnniwinter): These deferred constants should be created
+    // TODO(sigurdm,johnniwinther): These deferred constants should be created
     // by the constant evaluator.
     ConstantValue wrapper = new DeferredConstantValue(constant, prefix);
     compiler.deferredLoadTask.registerConstantDeferredUse(wrapper, prefix);
@@ -873,6 +876,8 @@
   static const int TYPE_INFO_READ_VARIABLE_TYPECODE = 39;
   static const int TYPE_INFO_EXPRESSION_TYPECODE = 40;
 
+  static const int FOREIGN_CODE_TYPECODE = 41;
+
   HInstruction(this.inputs, this.instructionType)
       : id = idCounter++,
         usedBy = <HInstruction>[] {
@@ -926,20 +931,20 @@
 
   /// Returns `true` if [typeMask] contains [cls].
   static bool containsType(
-      TypeMask typeMask, ClassElement cls, ClosedWorld closedWorld) {
+      TypeMask typeMask, ClassEntity cls, ClosedWorld closedWorld) {
     return closedWorld.isInstantiated(cls) &&
         typeMask.contains(cls, closedWorld);
   }
 
   /// Returns `true` if [typeMask] contains only [cls].
   static bool containsOnlyType(
-      TypeMask typeMask, ClassElement cls, ClosedWorld closedWorld) {
+      TypeMask typeMask, ClassEntity cls, ClosedWorld closedWorld) {
     return closedWorld.isInstantiated(cls) && typeMask.containsOnly(cls);
   }
 
   /// Returns `true` if [typeMask] is an instance of [cls].
   static bool isInstanceOf(
-      TypeMask typeMask, ClassElement cls, ClosedWorld closedWorld) {
+      TypeMask typeMask, ClassEntity cls, ClosedWorld closedWorld) {
     return closedWorld.isImplemented(cls) &&
         typeMask.satisfies(cls, closedWorld);
   }
@@ -1365,23 +1370,23 @@
     // Only the builder knows how to create [HTypeConversion]
     // instructions with generics. It has the generic type context
     // available.
-    assert(type.kind != TypeKind.TYPE_VARIABLE);
+    assert(!type.isTypeVariable);
     assert(type.treatAsRaw || type.isFunctionType);
     if (type.isDynamic) return this;
     if (type.isObject) return this;
-    // The type element is either a class or the void element.
-    Element element = type.element;
     JavaScriptBackend backend = compiler.backend;
-    if (type.kind != TypeKind.INTERFACE) {
+    if (type.isVoid || type.isFunctionType || type.isMalformed) {
       return new HTypeConversion(type, kind, backend.dynamicType, this);
-    } else if (kind == HTypeConversion.BOOLEAN_CONVERSION_CHECK) {
+    }
+    assert(type.isInterfaceType);
+    if (kind == HTypeConversion.BOOLEAN_CONVERSION_CHECK) {
       // Boolean conversion checks work on non-nullable booleans.
       return new HTypeConversion(type, kind, backend.boolType, this);
     } else if (kind == HTypeConversion.CHECKED_MODE_CHECK && !type.treatAsRaw) {
       throw 'creating compound check to $type (this = ${this})';
     } else {
-      TypeMask subtype =
-          new TypeMask.subtype(element.declaration, compiler.closedWorld);
+      Entity cls = type.element;
+      TypeMask subtype = new TypeMask.subtype(cls, compiler.closedWorld);
       return new HTypeConversion(type, kind, subtype, this);
     }
   }
@@ -1505,7 +1510,7 @@
 
 // Allocates and initializes an instance.
 class HCreate extends HInstruction {
-  final ClassElement element;
+  final ClassEntity element;
 
   /// Does this instruction have reified type information as the last input?
   final bool hasRtiInput;
@@ -1560,7 +1565,7 @@
   final InvokeDynamicSpecializer specializer;
   Selector selector;
   TypeMask mask;
-  Element element;
+  MemberEntity element;
 
   HInvokeDynamic(Selector selector, this.mask, this.element,
       List<HInstruction> inputs, TypeMask type,
@@ -1613,22 +1618,27 @@
 }
 
 abstract class HInvokeDynamicField extends HInvokeDynamic {
-  HInvokeDynamicField(Selector selector, TypeMask mask, Element element,
+  HInvokeDynamicField(Selector selector, TypeMask mask, MemberEntity element,
       List<HInstruction> inputs, TypeMask type)
       : super(selector, mask, element, inputs, type);
   toString() => 'invoke dynamic field: selector=$selector, mask=$mask';
 }
 
 class HInvokeDynamicGetter extends HInvokeDynamicField {
-  HInvokeDynamicGetter(Selector selector, TypeMask mask, Element element,
+  HInvokeDynamicGetter(Selector selector, TypeMask mask, MemberEntity element,
       List<HInstruction> inputs, TypeMask type)
       : super(selector, mask, element, inputs, type);
   toString() => 'invoke dynamic getter: selector=$selector, mask=$mask';
   accept(HVisitor visitor) => visitor.visitInvokeDynamicGetter(this);
+
+  bool get isTearOff => element != null && element.isFunction;
+
+  // There might be an interceptor input, so `inputs.last` is the dart receiver.
+  bool canThrow() => isTearOff ? inputs.last.canBeNull() : super.canThrow();
 }
 
 class HInvokeDynamicSetter extends HInvokeDynamicField {
-  HInvokeDynamicSetter(Selector selector, TypeMask mask, Element element,
+  HInvokeDynamicSetter(Selector selector, TypeMask mask, MemberEntity element,
       List<HInstruction> inputs, TypeMask type)
       : super(selector, mask, element, inputs, type);
   toString() => 'invoke dynamic setter: selector=$selector, mask=$mask';
@@ -1636,7 +1646,7 @@
 }
 
 class HInvokeStatic extends HInvoke {
-  final Element element;
+  final MemberEntity element;
 
   final bool targetCanThrow;
 
@@ -1660,11 +1670,11 @@
 
 class HInvokeSuper extends HInvokeStatic {
   /** The class where the call to super is being done. */
-  final ClassElement caller;
+  final ClassEntity caller;
   final bool isSetter;
   final Selector selector;
 
-  HInvokeSuper(Element element, this.caller, this.selector, inputs, type,
+  HInvokeSuper(MemberEntity element, this.caller, this.selector, inputs, type,
       SourceInformation sourceInformation,
       {this.isSetter})
       : super(element, inputs, type) {
@@ -1704,11 +1714,12 @@
 }
 
 abstract class HFieldAccess extends HInstruction {
-  final Element element;
+  // TODO(johnniwinther): This should be a [FieldLike] but JSIndexable.length is
+  // encoded using a [HFieldGet].
+  final MemberEntity element;
 
-  HFieldAccess(Element element, List<HInstruction> inputs, TypeMask type)
-      : this.element = element,
-        super(inputs, type);
+  HFieldAccess(this.element, List<HInstruction> inputs, TypeMask type)
+      : super(inputs, type);
 
   HInstruction get receiver => inputs[0];
 }
@@ -1716,7 +1727,7 @@
 class HFieldGet extends HFieldAccess {
   final bool isAssignable;
 
-  HFieldGet(Element element, HInstruction receiver, TypeMask type,
+  HFieldGet(MemberEntity element, HInstruction receiver, TypeMask type,
       {bool isAssignable})
       : this.isAssignable =
             (isAssignable != null) ? isAssignable : element.isAssignable,
@@ -1757,7 +1768,7 @@
 }
 
 class HFieldSet extends HFieldAccess {
-  HFieldSet(Element element, HInstruction receiver, HInstruction value)
+  HFieldSet(MemberEntity element, HInstruction receiver, HInstruction value)
       : super(element, <HInstruction>[receiver, value],
             const TypeMask.nonNullEmpty()) {
     sideEffects.clearAllSideEffects();
@@ -1785,11 +1796,11 @@
   static const ASSIGN_OP = 0;
   static const PRE_OP = 1;
   static const POST_OP = 2;
-  final Element element;
+  final FieldEntity element;
   final String jsOp;
   final int opKind;
 
-  HReadModifyWrite._(Element this.element, this.jsOp, this.opKind,
+  HReadModifyWrite._(this.element, this.jsOp, this.opKind,
       List<HInstruction> inputs, TypeMask type)
       : super(inputs, type) {
     sideEffects.clearAllSideEffects();
@@ -1798,17 +1809,17 @@
     sideEffects.setDependsOnInstancePropertyStore();
   }
 
-  HReadModifyWrite.assignOp(Element element, String jsOp, HInstruction receiver,
-      HInstruction operand, TypeMask type)
+  HReadModifyWrite.assignOp(FieldEntity element, String jsOp,
+      HInstruction receiver, HInstruction operand, TypeMask type)
       : this._(
             element, jsOp, ASSIGN_OP, <HInstruction>[receiver, operand], type);
 
   HReadModifyWrite.preOp(
-      Element element, String jsOp, HInstruction receiver, TypeMask type)
+      FieldEntity element, String jsOp, HInstruction receiver, TypeMask type)
       : this._(element, jsOp, PRE_OP, <HInstruction>[receiver], type);
 
   HReadModifyWrite.postOp(
-      Element element, String jsOp, HInstruction receiver, TypeMask type)
+      FieldEntity element, String jsOp, HInstruction receiver, TypeMask type)
       : this._(element, jsOp, POST_OP, <HInstruction>[receiver], type);
 
   HInstruction get receiver => inputs[0];
@@ -1901,6 +1912,9 @@
     assert(this.throwBehavior != null);
 
     if (effects != null) sideEffects.add(effects);
+    if (nativeBehavior != null && nativeBehavior.useGvn) {
+      setUseGvn();
+    }
   }
 
   HForeignCode.statement(js.Template codeTemplate, List<HInstruction> inputs,
@@ -1913,15 +1927,28 @@
   accept(HVisitor visitor) => visitor.visitForeignCode(this);
 
   bool isJsStatement() => isStatement;
-  bool canThrow() =>
-      canBeNull() ? throwBehavior.canThrow : throwBehavior.onNonNull.canThrow;
+  bool canThrow() {
+    if (inputs.length > 0) {
+      return inputs.first.canBeNull()
+          ? throwBehavior.canThrow
+          : throwBehavior.onNonNull.canThrow;
+    }
+    return throwBehavior.canThrow;
+  }
 
   bool onlyThrowsNSM() => throwBehavior.isOnlyNullNSMGuard;
 
   bool get isAllocation =>
       nativeBehavior != null && nativeBehavior.isAllocation && !canBeNull();
 
-  String toString() => 'HForeignCode("${codeTemplate.source}",$inputs)';
+  int typeCode() => HInstruction.FOREIGN_CODE_TYPECODE;
+  bool typeEquals(other) => other is HForeignCode;
+  bool dataEquals(HForeignCode other) {
+    return codeTemplate.source != null &&
+        codeTemplate.source == other.codeTemplate.source;
+  }
+
+  String toString() => 'HForeignCode("${codeTemplate.source}")';
 }
 
 abstract class HInvokeBinary extends HInstruction {
@@ -2481,10 +2508,9 @@
 }
 
 class HStatic extends HInstruction {
-  final Element element;
+  final MemberEntity element;
   HStatic(this.element, type) : super(<HInstruction>[], type) {
     assert(element != null);
-    assert(invariant(this, element.isDeclaration));
     sideEffects.clearAllSideEffects();
     sideEffects.clearAllDependencies();
     if (element.isAssignable) {
@@ -2505,7 +2531,7 @@
 class HInterceptor extends HInstruction {
   // This field should originally be null to allow GVN'ing all
   // [HInterceptor] on the same input.
-  Set<ClassElement> interceptedClasses;
+  Set<ClassEntity> interceptedClasses;
 
   // inputs[0] is initially the only input, the receiver.
 
@@ -2556,7 +2582,7 @@
  * constant as the first input.
  */
 class HOneShotInterceptor extends HInvokeDynamic {
-  Set<ClassElement> interceptedClasses;
+  Set<ClassEntity> interceptedClasses;
   HOneShotInterceptor(Selector selector, TypeMask mask,
       List<HInstruction> inputs, TypeMask type, this.interceptedClasses)
       : super(selector, mask, null, inputs, type, true) {
@@ -2571,7 +2597,7 @@
 
 /** An [HLazyStatic] is a static that is initialized lazily at first read. */
 class HLazyStatic extends HInstruction {
-  final Element element;
+  final FieldEntity element;
   HLazyStatic(this.element, type) : super(<HInstruction>[], type) {
     // TODO(4931): The first access has side-effects, but we afterwards we
     // should be able to GVN.
@@ -2589,7 +2615,7 @@
 }
 
 class HStaticStore extends HInstruction {
-  Element element;
+  MemberEntity element;
   HStaticStore(this.element, HInstruction value)
       : super(<HInstruction>[value], const TypeMask.nonNullEmpty()) {
     sideEffects.clearAllSideEffects();
@@ -2775,23 +2801,29 @@
 }
 
 class HTypeConversion extends HCheck {
-  final DartType typeExpression;
-  final int kind;
-  final Selector receiverTypeCheckSelector;
-  final bool contextIsTypeArguments;
-  TypeMask checkedType; // Not final because we refine it.
-
+  // Values for [kind].
   static const int CHECKED_MODE_CHECK = 0;
   static const int ARGUMENT_TYPE_CHECK = 1;
   static const int CAST_TYPE_CHECK = 2;
   static const int BOOLEAN_CONVERSION_CHECK = 3;
   static const int RECEIVER_TYPE_CHECK = 4;
 
+  final DartType typeExpression;
+  final int kind;
+  // [receiverTypeCheckSelector] is the selector used for a receiver type check
+  // on open-coded operators, e.g. the not-null check on `x` in `x + 1` would be
+  // compiled to the following, for which we need the selector `$add`.
+  //
+  //     if (typeof x != "number") x.$add();
+  //
+  final Selector receiverTypeCheckSelector;
+
+  TypeMask checkedType; // Not final because we refine it.
+
   HTypeConversion(
       this.typeExpression, this.kind, TypeMask type, HInstruction input,
-      [this.receiverTypeCheckSelector])
-      : contextIsTypeArguments = false,
-        checkedType = type,
+      {this.receiverTypeCheckSelector})
+      : checkedType = type,
         super(<HInstruction>[input], type) {
     assert(!isReceiverTypeCheck || receiverTypeCheckSelector != null);
     assert(typeExpression == null || typeExpression.kind != TypeKind.TYPEDEF);
@@ -2800,21 +2832,21 @@
 
   HTypeConversion.withTypeRepresentation(this.typeExpression, this.kind,
       TypeMask type, HInstruction input, HInstruction typeRepresentation)
-      : contextIsTypeArguments = false,
-        checkedType = type,
+      : checkedType = type,
         super(<HInstruction>[input, typeRepresentation], type),
         receiverTypeCheckSelector = null {
     assert(typeExpression.kind != TypeKind.TYPEDEF);
     sourceElement = input.sourceElement;
   }
 
-  HTypeConversion.withContext(this.typeExpression, this.kind, TypeMask type,
-      HInstruction input, HInstruction context,
-      {bool this.contextIsTypeArguments})
-      : super(<HInstruction>[input, context], type),
-        checkedType = type,
+  HTypeConversion.viaMethodOnType(this.typeExpression, this.kind, TypeMask type,
+      HInstruction reifiedType, HInstruction input)
+      : checkedType = type,
+        super(<HInstruction>[reifiedType, input], type),
         receiverTypeCheckSelector = null {
-    assert(typeExpression.kind != TypeKind.TYPEDEF);
+    // This form is currently used only for function types.
+    assert(typeExpression.isFunctionType);
+    assert(kind == CHECKED_MODE_CHECK || kind == CAST_TYPE_CHECK);
     sourceElement = input.sourceElement;
   }
 
@@ -2824,11 +2856,11 @@
 
   HInstruction get typeRepresentation => inputs[1];
 
-  bool get hasContext {
-    return typeExpression.isFunctionType && inputs.length > 1;
-  }
+  bool get usesMethodOnType =>
+      typeExpression != null && typeExpression.isFunctionType;
 
-  HInstruction get context => inputs[1];
+  HInstruction get checkedInput =>
+      usesMethodOnType ? inputs[1] : super.checkedInput;
 
   HInstruction convertType(Compiler compiler, DartType type, int kind) {
     if (typeExpression == type) {
diff --git a/pkg/compiler/lib/src/ssa/optimize.dart b/pkg/compiler/lib/src/ssa/optimize.dart
index 9aa2d98..de90a81 100644
--- a/pkg/compiler/lib/src/ssa/optimize.dart
+++ b/pkg/compiler/lib/src/ssa/optimize.dart
@@ -332,7 +332,7 @@
         ListConstantValue constant = constantInput.constant;
         return graph.addConstantInt(constant.length, compiler);
       }
-      Element element = helpers.jsIndexableLength;
+      MemberElement element = helpers.jsIndexableLength;
       bool isFixed = isFixedLength(actualReceiver.instructionType, compiler);
       TypeMask actualType = node.instructionType;
       ClosedWorld closedWorld = compiler.closedWorld;
@@ -383,7 +383,7 @@
     }
 
     if (selector.isCall || selector.isOperator) {
-      Element target;
+      MethodElement target;
       if (input.isExtendableArray(compiler)) {
         if (applies(helpers.jsArrayRemoveLast)) {
           target = helpers.jsArrayRemoveLast;
@@ -449,11 +449,11 @@
     // TODO(ngeoffray): Also fold if it's a getter or variable.
     if (element != null &&
         element.isFunction
-        // If we found out that the only target is a [:noSuchMethod:],
-        // we just ignore it.
+        // If we found out that the only target is an implicitly called
+        // [:noSuchMethod:] we just ignore it.
         &&
-        element.name == node.selector.name) {
-      FunctionElement method = element;
+        node.selector.applies(element)) {
+      MethodElement method = element;
 
       if (backend.isNative(method)) {
         HInstruction folded = tryInlineNativeMethod(node, method);
@@ -464,7 +464,7 @@
         FunctionSignature parameters = method.functionSignature;
         if (parameters.optionalParameterCount == 0 ||
             parameters.parameterCount == node.selector.argumentCount) {
-          node.element = element;
+          node.element = method;
         }
       }
       return node;
@@ -477,11 +477,11 @@
     if (element != null &&
         element.isField &&
         element.name == node.selector.name) {
-      if (!backend.isNative(element) && !node.isCallOnInterceptor(compiler)) {
+      FieldElement field = element;
+      if (!backend.isNative(field) && !node.isCallOnInterceptor(compiler)) {
         HInstruction receiver = node.getDartReceiver(compiler);
-        TypeMask type =
-            TypeMaskFactory.inferredTypeForElement(element, compiler);
-        HInstruction load = new HFieldGet(element, receiver, type);
+        TypeMask type = TypeMaskFactory.inferredTypeForElement(field, compiler);
+        HInstruction load = new HFieldGet(field, receiver, type);
         node.block.addBefore(node, load);
         Selector callSelector = new Selector.callClosureFrom(node.selector);
         List<HInstruction> inputs = <HInstruction>[load]
@@ -498,7 +498,7 @@
   }
 
   HInstruction tryInlineNativeMethod(
-      HInvokeDynamicMethod node, FunctionElement method) {
+      HInvokeDynamicMethod node, MethodElement 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.
@@ -800,11 +800,25 @@
         // throw a type error at runtime.
         return node;
       }
-      if (!type.treatAsRaw || type.isTypeVariable) {
+      if (type.isTypeVariable) {
+        return node;
+      }
+      if (!type.treatAsRaw) {
+        HInstruction input = node.checkedInput;
+        // `null` always passes type conversion.
+        if (input.isNull()) return input;
+        // TODO(sra): We can statically check [input] if it is a constructor.
+        // TODO(sra): We can statically check [input] if it is load from a field
+        // of the same ground type, or load from a field of a parameterized type
+        // with the same receiver.
         return node;
       }
       if (type.isFunctionType) {
+        HInstruction input = node.checkedInput;
+        // `null` always passes type conversion.
+        if (input.isNull()) return input;
         // TODO(johnniwinther): Optimize function type conversions.
+        // TODO(sra): We can statically check [input] if it is a closure getter.
         return node;
       }
     }
@@ -825,7 +839,7 @@
 
   HInstruction removeCheck(HCheck node) => node.checkedInput;
 
-  VariableElement findConcreteFieldForDynamicAccess(
+  FieldElement findConcreteFieldForDynamicAccess(
       HInstruction receiver, Selector selector) {
     TypeMask receiverType = receiver.instructionType;
     return compiler.closedWorld.locateSingleField(selector, receiverType);
@@ -900,12 +914,27 @@
       if (folded != node) return folded;
     }
     HInstruction receiver = node.getDartReceiver(compiler);
-    Element field = findConcreteFieldForDynamicAccess(receiver, node.selector);
-    if (field == null) return node;
-    return directFieldGet(receiver, field);
+    FieldElement field =
+        findConcreteFieldForDynamicAccess(receiver, node.selector);
+    if (field != null) return directFieldGet(receiver, field);
+
+    if (node.element == null) {
+      MemberElement element = compiler.closedWorld
+          .locateSingleElement(node.selector, receiver.instructionType);
+      if (element != null && element.name == node.selector.name) {
+        node.element = element;
+        if (element.isFunction) {
+          // A property extraction getter, aka a tear-off.
+          node.sideEffects.clearAllDependencies();
+          node.sideEffects.clearAllSideEffects();
+          node.setUseGvn(); // We don't care about identity of tear-offs.
+        }
+      }
+    }
+    return node;
   }
 
-  HInstruction directFieldGet(HInstruction receiver, Element field) {
+  HInstruction directFieldGet(HInstruction receiver, FieldElement field) {
     bool isAssignable = !compiler.closedWorld.fieldNeverChanges(field);
 
     TypeMask type;
@@ -926,18 +955,21 @@
     }
 
     HInstruction receiver = node.getDartReceiver(compiler);
-    VariableElement field =
+    FieldElement field =
         findConcreteFieldForDynamicAccess(receiver, node.selector);
     if (field == null || !field.isAssignable) return node;
-    // Use [:node.inputs.last:] in case the call follows the
-    // interceptor calling convention, but is not a call on an
-    // interceptor.
+    // Use `node.inputs.last` in case the call follows the interceptor calling
+    // convention, but is not a call on an interceptor.
     HInstruction value = node.inputs.last;
     if (compiler.options.enableTypeAssertions) {
       DartType type = field.type;
-      if (!type.treatAsRaw || type.isTypeVariable) {
+      if (!type.treatAsRaw ||
+          type.isTypeVariable ||
+          type.unaliased.isFunctionType) {
         // We cannot generate the correct type representation here, so don't
         // inline this access.
+        // TODO(sra): If the input is such that we don't need a type check, we
+        // can skip the test an generate the HFieldSet.
         return node;
       }
       HInstruction other =
@@ -952,7 +984,9 @@
 
   HInstruction visitInvokeStatic(HInvokeStatic node) {
     propagateConstantValueToUses(node);
-    if (node.element == backend.helpers.checkConcurrentModificationError) {
+    MemberElement element = node.element;
+
+    if (element == backend.helpers.checkConcurrentModificationError) {
       if (node.inputs.length == 2) {
         HInstruction firstArgument = node.inputs[0];
         if (firstArgument is HConstant) {
@@ -960,6 +994,21 @@
           if (constant.constant.isTrue) return constant;
         }
       }
+    } else if (element == backend.helpers.checkInt) {
+      if (node.inputs.length == 1) {
+        HInstruction argument = node.inputs[0];
+        if (argument.isInteger(compiler)) return argument;
+      }
+    } else if (element == backend.helpers.checkNum) {
+      if (node.inputs.length == 1) {
+        HInstruction argument = node.inputs[0];
+        if (argument.isNumber(compiler)) return argument;
+      }
+    } else if (element == backend.helpers.checkString) {
+      if (node.inputs.length == 1) {
+        HInstruction argument = node.inputs[0];
+        if (argument.isString(compiler)) return argument;
+      }
     }
     return node;
   }
@@ -1048,10 +1097,11 @@
       // be a class extending `Interceptor` then it can be called directly.
       if (new TypeMask.nonNullSubclass(helpers.jsInterceptorClass, closedWorld)
           .isDisjoint(input.instructionType, closedWorld)) {
+        var inputs = <HInstruction>[input, input]; // [interceptor, receiver].
         HInstruction result = new HInvokeDynamicMethod(
             selector,
             input.instructionType, // receiver mask.
-            <HInstruction>[input, input], // [interceptor, receiver].
+            inputs,
             toStringType)..sourceInformation = node.sourceInformation;
         return result;
       }
@@ -1306,7 +1356,7 @@
   }
 
   void visitInvokeDynamicMethod(HInvokeDynamicMethod node) {
-    Element element = node.element;
+    MemberElement element = node.element;
     if (node.isInterceptedCall) return;
     if (element != helpers.jsArrayRemoveLast) return;
     if (boundsChecked.contains(node)) return;
@@ -2078,29 +2128,22 @@
       return;
     }
 
-    List<HInstruction> ifUsers = <HInstruction>[];
-    List<HInstruction> notIfUsers = <HInstruction>[];
+    List<HBasicBlock> trueTargets = <HBasicBlock>[];
+    List<HBasicBlock> falseTargets = <HBasicBlock>[];
 
-    collectIfUsers(instruction, ifUsers, notIfUsers);
+    collectTargets(instruction, trueTargets, falseTargets);
 
-    if (ifUsers.isEmpty && notIfUsers.isEmpty) return;
+    if (trueTargets.isEmpty && falseTargets.isEmpty) return;
 
     TypeMask convertedType =
         new TypeMask.nonNullSubtype(element, compiler.closedWorld);
     HInstruction input = instruction.expression;
 
-    for (HIf ifUser in ifUsers) {
-      insertTypePropagationForDominatedUsers(
-          ifUser.thenBlock, input, convertedType);
-      // TODO(ngeoffray): Also change uses for the else block on a type
-      // that knows it is not of a specific type.
+    for (HBasicBlock block in trueTargets) {
+      insertTypePropagationForDominatedUsers(block, input, convertedType);
     }
-    for (HIf ifUser in notIfUsers) {
-      insertTypePropagationForDominatedUsers(
-          ifUser.elseBlock, input, convertedType);
-      // TODO(ngeoffray): Also change uses for the then block on a type
-      // that knows it is not of a specific type.
-    }
+    // TODO(sra): Also strengthen uses for when the condition is known
+    // false. Avoid strengthening to `null`.
   }
 
   void visitIdentity(HIdentity instruction) {
@@ -2119,34 +2162,50 @@
 
     if (!input.instructionType.isNullable) return;
 
-    List<HInstruction> ifUsers = <HInstruction>[];
-    List<HInstruction> notIfUsers = <HInstruction>[];
+    List<HBasicBlock> trueTargets = <HBasicBlock>[];
+    List<HBasicBlock> falseTargets = <HBasicBlock>[];
 
-    collectIfUsers(instruction, ifUsers, notIfUsers);
+    collectTargets(instruction, trueTargets, falseTargets);
 
-    if (ifUsers.isEmpty && notIfUsers.isEmpty) return;
+    if (trueTargets.isEmpty && falseTargets.isEmpty) return;
 
     TypeMask nonNullType = input.instructionType.nonNullable();
 
-    for (HIf ifUser in ifUsers) {
-      insertTypePropagationForDominatedUsers(
-          ifUser.elseBlock, input, nonNullType);
-      // Uses in thenBlock are `null`, but probably not common.
+    for (HBasicBlock block in falseTargets) {
+      insertTypePropagationForDominatedUsers(block, input, nonNullType);
     }
-    for (HIf ifUser in notIfUsers) {
-      insertTypePropagationForDominatedUsers(
-          ifUser.thenBlock, input, nonNullType);
-      // Uses in elseBlock are `null`, but probably not common.
-    }
+    // We don't strengthen the known-true references. It doesn't happen often
+    // and we don't want "if (x==null) return x;" to convert between JavaScript
+    // 'null' and 'undefined'.
   }
 
-  collectIfUsers(HInstruction instruction, List<HInstruction> ifUsers,
-      List<HInstruction> notIfUsers) {
+  collectTargets(HInstruction instruction, List<HBasicBlock> trueTargets,
+      List<HBasicBlock> falseTargets) {
     for (HInstruction user in instruction.usedBy) {
       if (user is HIf) {
-        ifUsers.add(user);
+        trueTargets?.add(user.thenBlock);
+        falseTargets?.add(user.elseBlock);
       } else if (user is HNot) {
-        collectIfUsers(user, notIfUsers, ifUsers);
+        collectTargets(user, falseTargets, trueTargets);
+      } else if (user is HPhi) {
+        List<HInstruction> inputs = user.inputs;
+        if (inputs.length == 2) {
+          assert(inputs.contains(instruction));
+          HInstruction other = inputs[(inputs[0] == instruction) ? 1 : 0];
+          if (other.isConstantTrue()) {
+            // The condition flows to a HPhi(true, user), which means that a
+            // downstream HIf has true-branch control flow that does not depend
+            // on the original instruction, so stop collecting [trueTargets].
+            collectTargets(user, null, falseTargets);
+          } else if (other.isConstantFalse()) {
+            // Ditto for false.
+            collectTargets(user, trueTargets, null);
+          }
+        }
+      } else if (user is HBoolify) {
+        // We collect targets for strictly boolean operations so HBoolify cannot
+        // change the result.
+        collectTargets(user, trueTargets, falseTargets);
       }
     }
   }
@@ -2218,7 +2277,7 @@
 
   void visitFieldGet(HFieldGet instruction) {
     if (instruction.isNullCheck) return;
-    Element element = instruction.element;
+    MemberElement element = instruction.element;
     HInstruction receiver = instruction.getDartReceiver(compiler).nonCheck();
     HInstruction existing = memorySet.lookupFieldValue(element, receiver);
     if (existing != null) {
@@ -2239,7 +2298,7 @@
     memorySet.registerAllocation(instruction);
     if (shouldTrackInitialValues(instruction)) {
       int argumentIndex = 0;
-      instruction.element.forEachInstanceField((_, Element member) {
+      instruction.element.forEachInstanceField((_, FieldElement member) {
         if (compiler.elementHasCompileTimeError(member)) return;
         memorySet.registerFieldValue(
             member, instruction, instruction.inputs[argumentIndex++]);
@@ -2296,10 +2355,11 @@
   }
 
   void visitLazyStatic(HLazyStatic instruction) {
-    handleStaticLoad(instruction.element, instruction);
+    FieldElement field = instruction.element;
+    handleStaticLoad(field, instruction);
   }
 
-  void handleStaticLoad(Element element, HInstruction instruction) {
+  void handleStaticLoad(MemberElement element, HInstruction instruction) {
     HInstruction existing = memorySet.lookupFieldValue(element, null);
     if (existing != null) {
       instruction.block.rewriteWithBetterUser(instruction, existing);
@@ -2446,7 +2506,7 @@
    * may be affected by this update.
    */
   void registerFieldValueUpdate(
-      Element element, HInstruction receiver, HInstruction value) {
+      MemberElement element, HInstruction receiver, HInstruction value) {
     assert(receiver == null || receiver == receiver.nonCheck());
     if (backend.isNative(element)) {
       return; // TODO(14955): Remove this restriction?
@@ -2466,7 +2526,7 @@
    * Registers that `receiver.element` is now [value].
    */
   void registerFieldValue(
-      Element element, HInstruction receiver, HInstruction value) {
+      MemberElement element, HInstruction receiver, HInstruction value) {
     assert(receiver == null || receiver == receiver.nonCheck());
     if (backend.isNative(element)) {
       return; // TODO(14955): Remove this restriction?
@@ -2604,7 +2664,33 @@
   MemorySet intersectionFor(
       MemorySet other, HBasicBlock block, int predecessorIndex) {
     MemorySet result = new MemorySet(compiler);
-    if (other == null) return result;
+    if (other == null) {
+      // This is the first visit to a loop header ([other] is `null` because we
+      // have not visited the back edge). Copy the nonEscapingReceivers that are
+      // guaranteed to survive the loop because they are not escaped before
+      // method exit.
+      // TODO(sra): We should do a proper dataflow to find the maximal
+      // nonEscapingReceivers (a variant of Available-Expressions), which must
+      // converge before we edit the program in [findCommonInstruction].
+      for (HInstruction instruction in nonEscapingReceivers) {
+        bool isNonEscapingUse(HInstruction use) {
+          if (use is HReturn) return true; // Escapes, but so does control.
+          if (use is HFieldGet) return true;
+          if (use is HFieldSet &&
+              use.receiver.nonCheck() == instruction &&
+              use.value.nonCheck() != instruction) {
+            return true;
+          }
+          if (use is HTypeInfoReadVariable) return true;
+          return false;
+        }
+
+        if (instruction.usedBy.every(isNonEscapingUse)) {
+          result.nonEscapingReceivers.add(instruction);
+        }
+      }
+      return result;
+    }
 
     fieldValues.forEach((element, values) {
       var otherValues = other.fieldValues[element];
diff --git a/pkg/compiler/lib/src/ssa/ssa_tracer.dart b/pkg/compiler/lib/src/ssa/ssa_tracer.dart
index 1768db1..6c1d543 100644
--- a/pkg/compiler/lib/src/ssa/ssa_tracer.dart
+++ b/pkg/compiler/lib/src/ssa/ssa_tracer.dart
@@ -334,9 +334,11 @@
     return handleGenericInvoke("InvokeConstructorBody", target, invoke.inputs);
   }
 
-  String visitForeignCode(HForeignCode foreign) {
-    return handleGenericInvoke(
-        "ForeignCode", "${foreign.codeTemplate.ast}", foreign.inputs);
+  String visitForeignCode(HForeignCode node) {
+    var template = node.codeTemplate;
+    String code = '${template.ast}';
+    var inputs = node.inputs.map(temporaryId).join(', ');
+    return "ForeignCode: $code ($inputs)";
   }
 
   String visitLess(HLess node) => handleInvokeBinary(node, 'Less');
@@ -482,11 +484,19 @@
   }
 
   String visitTypeConversion(HTypeConversion node) {
-    assert(node.inputs.length <= 2);
-    String otherInput =
-        (node.inputs.length == 2) ? temporaryId(node.inputs[1]) : '';
-    return "TypeConversion: ${temporaryId(node.checkedInput)} to "
-        "${node.instructionType} $otherInput";
+    String checkedInput = temporaryId(node.checkedInput);
+    String rest;
+    if (node.usesMethodOnType) {
+      assert(node.inputs.length == 2);
+      assert(identical(node.checkedInput, node.inputs.last));
+      rest = " ${temporaryId(node.inputs.first)}";
+    } else if (node.inputs.length == 2) {
+      rest = " ${temporaryId(node.inputs.last)}";
+    } else {
+      assert(node.inputs.length == 1);
+      rest = "";
+    }
+    return "TypeConversion: $checkedInput to ${node.instructionType}$rest";
   }
 
   String visitTypeKnown(HTypeKnown node) {
@@ -504,23 +514,29 @@
   }
 
   String visitTypeInfoReadRaw(HTypeInfoReadRaw node) {
-    return "TypeInfoReadRaw";
+    var inputs = node.inputs.map(temporaryId).join(', ');
+    return "TypeInfoReadRaw: $inputs";
   }
 
   String visitTypeInfoReadVariable(HTypeInfoReadVariable node) {
-    return "TypeInfoReadVariable ${node.variable}";
+    return "TypeInfoReadVariable: "
+        "${temporaryId(node.inputs.single)}.${node.variable}";
   }
 
   String visitTypeInfoExpression(HTypeInfoExpression node) {
-    return "TypeInfoExpression ${node.kindAsString} ${node.dartType}";
+    var inputs = node.inputs.map(temporaryId).join(', ');
+    return "TypeInfoExpression: ${node.kindAsString} ${node.dartType}"
+        " ($inputs)";
   }
 
   String visitReadTypeVariable(HReadTypeVariable node) {
-    return "ReadTypeVariable: ${node.dartType} ${node.hasReceiver}";
+    var inputs = node.inputs.map(temporaryId).join(', ');
+    return "ReadTypeVariable: ${node.dartType} ${node.hasReceiver} $inputs";
   }
 
   String visitFunctionType(HFunctionType node) {
-    return "FunctionType: ${node.dartType}";
+    var inputs = node.inputs.map(temporaryId).join(', ');
+    return "FunctionType: ${node.dartType} $inputs";
   }
 
   String visitVoidType(HVoidType node) {
diff --git a/pkg/compiler/lib/src/ssa/type_builder.dart b/pkg/compiler/lib/src/ssa/type_builder.dart
new file mode 100644
index 0000000..605678b
--- /dev/null
+++ b/pkg/compiler/lib/src/ssa/type_builder.dart
@@ -0,0 +1,252 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 'graph_builder.dart';
+import 'nodes.dart';
+import '../closure.dart';
+import '../common.dart';
+import '../dart_types.dart';
+import '../types/types.dart';
+import '../elements/elements.dart';
+import '../io/source_information.dart';
+import '../universe/selector.dart' show Selector;
+import '../universe/use.dart' show TypeUse;
+
+/// Functions to insert type checking, coercion, and instruction insertion
+/// depending on the environment for dart code.
+class TypeBuilder {
+  final GraphBuilder builder;
+  TypeBuilder(this.builder);
+
+  /// Create an instruction to simply trust the provided type.
+  HInstruction _trustType(HInstruction original, DartType type) {
+    assert(builder.compiler.options.trustTypeAnnotations);
+    assert(type != null);
+    type = builder.localsHandler.substInContext(type);
+    type = type.unaliased;
+    if (type.isDynamic) return original;
+    if (!type.isInterfaceType) return original;
+    if (type.isObject) return original;
+    // The type element is either a class or the void element.
+    Element element = type.element;
+    TypeMask mask = new TypeMask.subtype(element, builder.compiler.closedWorld);
+    return new HTypeKnown.pinned(mask, original);
+  }
+
+  /// Produces code that checks the runtime type is actually the type specified
+  /// by attempting a type conversion.
+  HInstruction _checkType(HInstruction original, DartType type, int kind) {
+    assert(builder.compiler.options.enableTypeAssertions);
+    assert(type != null);
+    type = builder.localsHandler.substInContext(type);
+    HInstruction other = buildTypeConversion(original, type, kind);
+    // TODO(johnniwinther): This operation on `registry` may be inconsistent.
+    // If it is needed then it seems likely that similar invocations of
+    // `buildTypeConversion` in `SsaBuilder.visitAs` should also be followed by
+    // a similar operation on `registry`; otherwise, this one might not be
+    // needed.
+    builder.registry?.registerTypeUse(new TypeUse.isCheck(type));
+    return other;
+  }
+
+  /// Depending on the context and the mode, wrap the given type in an
+  /// instruction that checks the type is what we expect or automatically
+  /// trusts the written type.
+  HInstruction potentiallyCheckOrTrustType(HInstruction original, DartType type,
+      {int kind: HTypeConversion.CHECKED_MODE_CHECK}) {
+    if (type == null) return original;
+    HInstruction checkedOrTrusted = original;
+    if (builder.compiler.options.trustTypeAnnotations) {
+      checkedOrTrusted = _trustType(original, type);
+    } else if (builder.compiler.options.enableTypeAssertions) {
+      checkedOrTrusted = _checkType(original, type, kind);
+    }
+    if (checkedOrTrusted == original) return original;
+    builder.add(checkedOrTrusted);
+    return checkedOrTrusted;
+  }
+
+  /// Helper to create an instruction that gets the value of a type variable.
+  HInstruction addTypeVariableReference(TypeVariableType type, Element member,
+      {SourceInformation sourceInformation}) {
+    assert(assertTypeInContext(type));
+    if (type is MethodTypeVariableType) {
+      return builder.graph.addConstantNull(builder.compiler);
+    }
+    bool isClosure = member.enclosingElement.isClosure;
+    if (isClosure) {
+      ClosureClassElement closureClass = member.enclosingElement;
+      member = closureClass.methodElement;
+      member = member.outermostEnclosingMemberOrTopLevel;
+    }
+    bool isInConstructorContext =
+        member.isConstructor || member.isGenerativeConstructorBody;
+    Local typeVariableLocal =
+        builder.localsHandler.getTypeVariableAsLocal(type);
+    if (isClosure) {
+      if (member.isFactoryConstructor ||
+          (isInConstructorContext &&
+              builder.hasDirectLocal(typeVariableLocal))) {
+        // The type variable is used from a closure in a factory constructor.
+        // The value of the type argument is stored as a local on the closure
+        // itself.
+        return builder.localsHandler
+            .readLocal(typeVariableLocal, sourceInformation: sourceInformation);
+      } else if (member.isFunction ||
+          member.isGetter ||
+          member.isSetter ||
+          isInConstructorContext) {
+        // The type variable is stored on the "enclosing object" and needs to be
+        // accessed using the this-reference in the closure.
+        return readTypeVariable(type, member,
+            sourceInformation: sourceInformation);
+      } else {
+        assert(member.isField);
+        // The type variable is stored in a parameter of the method.
+        return builder.localsHandler.readLocal(typeVariableLocal);
+      }
+    } else if (isInConstructorContext ||
+        // When [member] is a field, we can be either
+        // generating a checked setter or inlining its
+        // initializer in a constructor. An initializer is
+        // never built standalone, so in that case [target] is not
+        // the [member] itself.
+        (member.isField && member != builder.targetElement)) {
+      // The type variable is stored in a parameter of the method.
+      return builder.localsHandler
+          .readLocal(typeVariableLocal, sourceInformation: sourceInformation);
+    } else if (member.isInstanceMember) {
+      // The type variable is stored on the object.
+      return readTypeVariable(type, member,
+          sourceInformation: sourceInformation);
+    } else {
+      builder.compiler.reporter.internalError(
+          type.element, 'Unexpected type variable in static context.');
+      return null;
+    }
+  }
+
+  /// Generate code to extract the type argument from the object.
+  HInstruction readTypeVariable(TypeVariableType variable, Element member,
+      {SourceInformation sourceInformation}) {
+    assert(member.isInstanceMember);
+    assert(variable is! MethodTypeVariableType);
+    HInstruction target = builder.localsHandler.readThis();
+    builder.push(
+        new HTypeInfoReadVariable(variable, target, builder.backend.dynamicType)
+          ..sourceInformation = sourceInformation);
+    return builder.pop();
+  }
+
+  HInstruction buildTypeArgumentRepresentations(
+      DartType type, Element sourceElement) {
+    assert(!type.isTypeVariable);
+    // Compute the representation of the type arguments, including access
+    // to the runtime type information for type variables as instructions.
+    assert(type.element.isClass);
+    InterfaceType interface = type;
+    List<HInstruction> inputs = <HInstruction>[];
+    for (DartType argument in interface.typeArguments) {
+      inputs.add(analyzeTypeArgument(argument, sourceElement));
+    }
+    HInstruction representation = new HTypeInfoExpression(
+        TypeInfoExpressionKind.INSTANCE,
+        interface.element.thisType,
+        inputs,
+        builder.backend.dynamicType);
+    return representation;
+  }
+
+  /// Check that [type] is valid in the context of `localsHandler.contextClass`.
+  /// This should only be called in assertions.
+  bool assertTypeInContext(DartType type, [Spannable spannable]) {
+    return invariant(spannable == null ? CURRENT_ELEMENT_SPANNABLE : spannable,
+        () {
+      ClassElement contextClass = Types.getClassContext(type);
+      return contextClass == null ||
+          contextClass == builder.localsHandler.contextClass;
+    },
+        message: "Type '$type' is not valid context of "
+            "${builder.localsHandler.contextClass}.");
+  }
+
+  HInstruction analyzeTypeArgument(DartType argument, Element sourceElement,
+      {SourceInformation sourceInformation}) {
+    assert(assertTypeInContext(argument));
+    argument = argument.unaliased;
+    if (argument.treatAsDynamic) {
+      // Represent [dynamic] as [null].
+      return builder.graph.addConstantNull(builder.compiler);
+    }
+
+    if (argument.isTypeVariable) {
+      return addTypeVariableReference(argument, sourceElement,
+          sourceInformation: sourceInformation);
+    }
+
+    List<HInstruction> inputs = <HInstruction>[];
+    argument.forEachTypeVariable((variable) {
+      if (variable is! MethodTypeVariableType) {
+        inputs.add(analyzeTypeArgument(variable, sourceElement));
+      }
+    });
+    HInstruction result = new HTypeInfoExpression(
+        TypeInfoExpressionKind.COMPLETE,
+        argument,
+        inputs,
+        builder.backend.dynamicType)..sourceInformation = sourceInformation;
+    builder.add(result);
+    return result;
+  }
+
+  /// In checked mode, generate type tests for the parameters of the inlined
+  /// function.
+  void potentiallyCheckInlinedParameterTypes(FunctionElement function) {
+    if (!checkOrTrustTypes) return;
+
+    FunctionSignature signature = function.functionSignature;
+    signature.orderedForEachParameter((ParameterElement parameter) {
+      HInstruction argument = builder.localsHandler.readLocal(parameter);
+      potentiallyCheckOrTrustType(argument, parameter.type);
+    });
+  }
+
+  bool get checkOrTrustTypes =>
+      builder.compiler.options.enableTypeAssertions ||
+      builder.compiler.options.trustTypeAnnotations;
+
+  /// Build a [HTypeConversion] for converting [original] to type [type].
+  ///
+  /// Invariant: [type] must be valid in the context.
+  /// See [LocalsHandler.substInContext].
+  HInstruction buildTypeConversion(
+      HInstruction original, DartType type, int kind) {
+    if (type == null) return original;
+    // GENERIC_METHODS: The following statement was added for parsing and
+    // ignoring method type variables; must be generalized for full support of
+    // generic methods.
+    type = type.dynamifyMethodTypeVariableType;
+    type = type.unaliased;
+    assert(assertTypeInContext(type, original));
+    if (type.isInterfaceType && !type.treatAsRaw) {
+      TypeMask subtype =
+          new TypeMask.subtype(type.element, builder.compiler.closedWorld);
+      HInstruction representations =
+          buildTypeArgumentRepresentations(type, builder.sourceElement);
+      builder.add(representations);
+      return new HTypeConversion.withTypeRepresentation(
+          type, kind, subtype, original, representations);
+    } else if (type.isTypeVariable) {
+      TypeMask subtype = original.instructionType;
+      HInstruction typeVariable =
+          addTypeVariableReference(type, builder.sourceElement);
+      return new HTypeConversion.withTypeRepresentation(
+          type, kind, subtype, original, typeVariable);
+    } else if (type.isFunctionType) {
+      return builder.buildFunctionTypeConversion(original, type, kind);
+    } else {
+      return original.convertType(builder.compiler, type, kind);
+    }
+  }
+}
diff --git a/pkg/compiler/lib/src/ssa/types.dart b/pkg/compiler/lib/src/ssa/types.dart
index 18ed76c..f145aff 100644
--- a/pkg/compiler/lib/src/ssa/types.dart
+++ b/pkg/compiler/lib/src/ssa/types.dart
@@ -14,46 +14,46 @@
 class TypeMaskFactory {
   static TypeMask inferredReturnTypeForElement(
       Element element, Compiler compiler) {
-    return compiler.globalInference.results.returnTypeOf(element) ??
-        compiler.commonMasks.dynamicType;
+    return compiler.globalInference.results.resultOf(element).returnType ??
+        compiler.closedWorld.commonMasks.dynamicType;
   }
 
   static TypeMask inferredTypeForElement(Element element, Compiler compiler) {
-    return compiler.globalInference.results.typeOf(element) ??
-        compiler.commonMasks.dynamicType;
+    return compiler.globalInference.results.resultOf(element).type ??
+        compiler.closedWorld.commonMasks.dynamicType;
   }
 
   static TypeMask inferredTypeForSelector(
       Selector selector, TypeMask mask, Compiler compiler) {
     return compiler.globalInference.results.typeOfSelector(selector, mask) ??
-        compiler.commonMasks.dynamicType;
+        compiler.closedWorld.commonMasks.dynamicType;
   }
 
   static TypeMask fromNativeBehavior(
       native.NativeBehavior nativeBehavior, Compiler compiler) {
+    ClosedWorld closedWorld = compiler.closedWorld;
+    CommonMasks commonMasks = closedWorld.commonMasks;
     var typesReturned = nativeBehavior.typesReturned;
-    if (typesReturned.isEmpty) return compiler.commonMasks.dynamicType;
+    if (typesReturned.isEmpty) return commonMasks.dynamicType;
 
-    ClosedWorld world = compiler.closedWorld;
-    CommonMasks commonMasks = compiler.commonMasks;
-    CoreClasses coreClasses = compiler.coreClasses;
+    CoreClasses coreClasses = closedWorld.coreClasses;
 
     // [type] is either an instance of [DartType] or special objects
     // like [native.SpecialType.JsObject].
     TypeMask fromNativeType(dynamic type) {
       if (type == native.SpecialType.JsObject) {
-        return new TypeMask.nonNullExact(coreClasses.objectClass, world);
+        return new TypeMask.nonNullExact(coreClasses.objectClass, closedWorld);
       }
 
       if (type.isVoid) return commonMasks.nullType;
       if (type.element == coreClasses.nullClass) return commonMasks.nullType;
       if (type.treatAsDynamic) return commonMasks.dynamicType;
-      return new TypeMask.nonNullSubtype(type.element, world);
+      return new TypeMask.nonNullSubtype(type.element, closedWorld);
     }
 
     TypeMask result = typesReturned
         .map(fromNativeType)
-        .reduce((t1, t2) => t1.union(t2, compiler.closedWorld));
+        .reduce((t1, t2) => t1.union(t2, closedWorld));
     assert(!result.isEmpty);
     return result;
   }
diff --git a/pkg/compiler/lib/src/ssa/types_propagation.dart b/pkg/compiler/lib/src/ssa/types_propagation.dart
index 46beb9e..63da628 100644
--- a/pkg/compiler/lib/src/ssa/types_propagation.dart
+++ b/pkg/compiler/lib/src/ssa/types_propagation.dart
@@ -233,9 +233,9 @@
     Selector selector = (kind == HTypeConversion.RECEIVER_TYPE_CHECK)
         ? instruction.selector
         : null;
-    HTypeConversion converted =
-        new HTypeConversion(null, kind, type, input, selector)
-          ..sourceInformation = instruction.sourceInformation;
+    HTypeConversion converted = new HTypeConversion(null, kind, type, input,
+        receiverTypeCheckSelector: selector)
+      ..sourceInformation = instruction.sourceInformation;
     instruction.block.addBefore(instruction, converted);
     input.replaceAllUsersDominatedBy(instruction, converted);
   }
@@ -271,7 +271,7 @@
       Iterable<Element> targets = compiler.closedWorld.allFunctions
           .filter(instruction.selector, instruction.mask);
       if (targets.length == 1) {
-        Element target = targets.first;
+        MemberElement target = targets.first;
         ClassElement cls = target.enclosingClass;
         TypeMask type =
             new TypeMask.nonNullSubclass(cls.declaration, closedWorld);
diff --git a/pkg/compiler/lib/src/tree/nodes.dart b/pkg/compiler/lib/src/tree/nodes.dart
index 1885e0d..ff36cfe 100644
--- a/pkg/compiler/lib/src/tree/nodes.dart
+++ b/pkg/compiler/lib/src/tree/nodes.dart
@@ -594,7 +594,7 @@
   final Node selector;
   final NodeList argumentsNode;
 
-  /// Whether this is a conditinal send of the form `a?.b`.
+  /// Whether this is a conditional send of the form `a?.b`.
   final bool isConditional;
 
   Link<Node> get arguments => argumentsNode.nodes;
diff --git a/pkg/compiler/lib/src/typechecker.dart b/pkg/compiler/lib/src/typechecker.dart
index 3cf8a56..74831e1 100644
--- a/pkg/compiler/lib/src/typechecker.dart
+++ b/pkg/compiler/lib/src/typechecker.dart
@@ -686,11 +686,7 @@
           message: 'Missing element for identifier'));
       assert(invariant(
           node,
-          element.isVariable ||
-              element.isRegularParameter ||
-              element.isField ||
-              (element.isInitializingFormal &&
-                  compiler.options.enableInitializingFormalAccess),
+          element.isVariable || element.isParameter || element.isField,
           message: 'Unexpected context element ${element}'));
       return element.computeType(resolution);
     }
@@ -775,10 +771,7 @@
       return access;
     }
     if (receiverElement != null &&
-        (receiverElement.isVariable ||
-            receiverElement.isRegularParameter ||
-            (receiverElement.isInitializingFormal &&
-                compiler.options.enableInitializingFormalAccess))) {
+        (receiverElement.isVariable || receiverElement.isParameter)) {
       Link<TypePromotion> typePromotions = typePromotionsMap[receiverElement];
       if (typePromotions != null) {
         while (!typePromotions.isEmpty) {
@@ -1095,10 +1088,7 @@
   }
 
   ElementAccess createPromotedAccess(Element element) {
-    if (element.isVariable ||
-        element.isRegularParameter ||
-        (element.isInitializingFormal &&
-            compiler.options.enableInitializingFormalAccess)) {
+    if (element.isVariable || element.isParameter) {
       TypePromotion typePromotion = getKnownTypePromotion(element);
       if (typePromotion != null) {
         return new PromotedAccess(element, typePromotion.type);
@@ -1215,11 +1205,7 @@
           }
         }
 
-        if (variable != null &&
-            (variable.isVariable ||
-                variable.isRegularParameter ||
-                (variable.isInitializingFormal &&
-                    compiler.options.enableInitializingFormalAccess))) {
+        if (variable != null && (variable.isVariable || variable.isParameter)) {
           DartType knownType = getKnownType(variable);
           if (!knownType.isDynamic) {
             DartType shownType = elements.getType(node.arguments.head);
diff --git a/pkg/compiler/lib/src/types/constants.dart b/pkg/compiler/lib/src/types/constants.dart
index 8c3f6b7..60dbd90 100644
--- a/pkg/compiler/lib/src/types/constants.dart
+++ b/pkg/compiler/lib/src/types/constants.dart
@@ -22,7 +22,7 @@
   TypeMask visitConstructed(
       ConstructedConstantValue constant, Compiler compiler) {
     if (compiler.backend.isInterceptorClass(constant.type.element)) {
-      return compiler.commonMasks.nonNullType;
+      return compiler.closedWorld.commonMasks.nonNullType;
     }
     return new TypeMask.nonNullExact(
         constant.type.element, compiler.closedWorld);
@@ -38,13 +38,13 @@
     // We have to recognize double constants that are 'is int'.
     if (compiler.backend.constantSystem.isInt(constant)) {
       if (constant.isMinusZero) {
-        return compiler.commonMasks.uint31Type;
+        return compiler.closedWorld.commonMasks.uint31Type;
       } else {
         assert(constant.isPositiveInfinity || constant.isNegativeInfinity);
-        return compiler.commonMasks.intType;
+        return compiler.closedWorld.commonMasks.intType;
       }
     }
-    return compiler.commonMasks.doubleType;
+    return compiler.closedWorld.commonMasks.doubleType;
   }
 
   @override
@@ -55,9 +55,9 @@
       case SyntheticConstantKind.EMPTY_VALUE:
         return constant.payload;
       case SyntheticConstantKind.TYPEVARIABLE_REFERENCE:
-        return compiler.commonMasks.intType;
+        return compiler.closedWorld.commonMasks.intType;
       case SyntheticConstantKind.NAME:
-        return compiler.commonMasks.stringType;
+        return compiler.closedWorld.commonMasks.stringType;
       default:
         DiagnosticReporter reporter = compiler.reporter;
         reporter.internalError(
@@ -68,55 +68,56 @@
 
   @override
   TypeMask visitBool(BoolConstantValue constant, Compiler compiler) {
-    return compiler.commonMasks.boolType;
+    return compiler.closedWorld.commonMasks.boolType;
   }
 
   @override
   TypeMask visitFunction(FunctionConstantValue constant, Compiler compiler) {
-    return compiler.commonMasks.functionType;
+    return compiler.closedWorld.commonMasks.functionType;
   }
 
   @override
   TypeMask visitInt(IntConstantValue constant, Compiler compiler) {
-    if (constant.isUInt31()) return compiler.commonMasks.uint31Type;
-    if (constant.isUInt32()) return compiler.commonMasks.uint32Type;
-    if (constant.isPositive()) return compiler.commonMasks.positiveIntType;
-    return compiler.commonMasks.intType;
+    if (constant.isUInt31()) return compiler.closedWorld.commonMasks.uint31Type;
+    if (constant.isUInt32()) return compiler.closedWorld.commonMasks.uint32Type;
+    if (constant.isPositive())
+      return compiler.closedWorld.commonMasks.positiveIntType;
+    return compiler.closedWorld.commonMasks.intType;
   }
 
   @override
   TypeMask visitInterceptor(
       InterceptorConstantValue constant, Compiler compiler) {
-    return compiler.commonMasks.nonNullType;
+    return compiler.closedWorld.commonMasks.nonNullType;
   }
 
   @override
   TypeMask visitList(ListConstantValue constant, Compiler compiler) {
-    return compiler.commonMasks.constListType;
+    return compiler.closedWorld.commonMasks.constListType;
   }
 
   @override
   TypeMask visitMap(MapConstantValue constant, Compiler compiler) {
-    return compiler.commonMasks.constMapType;
+    return compiler.closedWorld.commonMasks.constMapType;
   }
 
   @override
   TypeMask visitNull(NullConstantValue constant, Compiler compiler) {
-    return compiler.commonMasks.nullType;
+    return compiler.closedWorld.commonMasks.nullType;
   }
 
   @override
   TypeMask visitNonConstant(NonConstantValue constant, Compiler compiler) {
-    return compiler.commonMasks.nullType;
+    return compiler.closedWorld.commonMasks.nullType;
   }
 
   @override
   TypeMask visitString(StringConstantValue constant, Compiler compiler) {
-    return compiler.commonMasks.stringType;
+    return compiler.closedWorld.commonMasks.stringType;
   }
 
   @override
   TypeMask visitType(TypeConstantValue constant, Compiler compiler) {
-    return compiler.commonMasks.typeType;
+    return compiler.closedWorld.commonMasks.typeType;
   }
 }
diff --git a/pkg/compiler/lib/src/types/flat_type_mask.dart b/pkg/compiler/lib/src/types/flat_type_mask.dart
index 5a3ef8e..b93b1e6 100644
--- a/pkg/compiler/lib/src/types/flat_type_mask.dart
+++ b/pkg/compiler/lib/src/types/flat_type_mask.dart
@@ -14,17 +14,15 @@
   static const int SUBCLASS = 2;
   static const int SUBTYPE = 3;
 
-  final ClassElement base;
+  final Entity base;
   final int flags;
 
-  FlatTypeMask(ClassElement base, int kind, bool isNullable)
+  FlatTypeMask(Entity base, int kind, bool isNullable)
       : this.internal(base, (kind << 1) | (isNullable ? 1 : 0));
 
-  FlatTypeMask.exact(ClassElement base) : this.internal(base, (EXACT << 1) | 1);
-  FlatTypeMask.subclass(ClassElement base)
-      : this.internal(base, (SUBCLASS << 1) | 1);
-  FlatTypeMask.subtype(ClassElement base)
-      : this.internal(base, (SUBTYPE << 1) | 1);
+  FlatTypeMask.exact(Entity base) : this.internal(base, (EXACT << 1) | 1);
+  FlatTypeMask.subclass(Entity base) : this.internal(base, (SUBCLASS << 1) | 1);
+  FlatTypeMask.subtype(Entity base) : this.internal(base, (SUBTYPE << 1) | 1);
 
   const FlatTypeMask.nonNullEmpty()
       : base = null,
@@ -33,23 +31,22 @@
       : base = null,
         flags = 1;
 
-  FlatTypeMask.nonNullExact(ClassElement base)
-      : this.internal(base, EXACT << 1);
-  FlatTypeMask.nonNullSubclass(ClassElement base)
+  FlatTypeMask.nonNullExact(Entity base) : this.internal(base, EXACT << 1);
+  FlatTypeMask.nonNullSubclass(Entity base)
       : this.internal(base, SUBCLASS << 1);
-  FlatTypeMask.nonNullSubtype(ClassElement base)
-      : this.internal(base, SUBTYPE << 1);
+  FlatTypeMask.nonNullSubtype(Entity base) : this.internal(base, SUBTYPE << 1);
+
+  bool _validateBase(ClassElement element) => element.isDeclaration;
 
   FlatTypeMask.internal(this.base, this.flags) {
-    assert(base == null || base.isDeclaration);
+    assert(base == null || _validateBase(base));
   }
 
   /**
    * Ensures that the generated mask is normalized, i.e., a call to
    * [TypeMask.assertIsNormalized] with the factory's result returns `true`.
    */
-  factory FlatTypeMask.normalized(
-      ClassElement base, int flags, ClosedWorld world) {
+  factory FlatTypeMask.normalized(Entity base, int flags, ClosedWorld world) {
     if ((flags >> 1) == EMPTY || ((flags >> 1) == EXACT)) {
       return new FlatTypeMask.internal(base, flags);
     }
@@ -61,14 +58,8 @@
     if (((flags >> 1) == SUBCLASS) && !world.hasAnyStrictSubclass(base)) {
       flags = (flags & 0x1) | (EXACT << 1);
     }
-    Map<ClassElement, TypeMask> cachedMasks =
-        world.canonicalizedTypeMasks[flags];
-    if (cachedMasks == null) {
-      world.canonicalizedTypeMasks[flags] =
-          cachedMasks = <ClassElement, TypeMask>{};
-    }
-    return cachedMasks.putIfAbsent(
-        base, () => new FlatTypeMask.internal(base, flags));
+    return world.getCachedMask(
+        base, flags, () => new FlatTypeMask.internal(base, flags));
   }
 
   bool get isEmpty => isEmptyOrNull && !isNullable;
@@ -98,23 +89,23 @@
     return isNullable ? new FlatTypeMask.internal(base, flags & ~1) : this;
   }
 
-  bool contains(ClassElement type, ClosedWorld closedWorld) {
-    assert(type.isDeclaration);
+  bool contains(Entity other, ClosedWorld closedWorld) {
+    assert(_validateBase(other));
     if (isEmptyOrNull) {
       return false;
-    } else if (identical(base, type)) {
+    } else if (identical(base, other)) {
       return true;
     } else if (isExact) {
       return false;
     } else if (isSubclass) {
-      return closedWorld.isSubclassOf(type, base);
+      return closedWorld.isSubclassOf(other, base);
     } else {
       assert(isSubtype);
-      return closedWorld.isSubtypeOf(type, base);
+      return closedWorld.isSubtypeOf(other, base);
     }
   }
 
-  bool isSingleImplementationOf(ClassElement cls, ClosedWorld closedWorld) {
+  bool isSingleImplementationOf(Entity cls, ClosedWorld closedWorld) {
     // Special case basic types so that, for example, JSString is the
     // single implementation of String.
     // The general optimization is to realize there is only one class that
@@ -154,7 +145,7 @@
     if (other is! FlatTypeMask) return other.containsMask(this, closedWorld);
     // The other must be flat, so compare base and flags.
     FlatTypeMask flatOther = other;
-    ClassElement otherBase = flatOther.base;
+    Entity otherBase = flatOther.base;
     // If other is exact, it only contains its base.
     // TODO(herhut): Get rid of isSingleImplementationOf.
     if (flatOther.isExact) {
@@ -214,23 +205,21 @@
         base == backendClasses.stringImplementation;
   }
 
-  bool containsOnly(ClassElement cls) {
-    assert(cls.isDeclaration);
+  bool containsOnly(Entity cls) {
+    assert(_validateBase(cls));
     return base == cls;
   }
 
-  bool satisfies(ClassElement cls, ClosedWorld closedWorld) {
-    assert(cls.isDeclaration);
+  bool satisfies(Entity cls, ClosedWorld closedWorld) {
+    assert(_validateBase(cls));
     if (isEmptyOrNull) return false;
     if (closedWorld.isSubtypeOf(base, cls)) return true;
     return false;
   }
 
-  /**
-   * Returns the [ClassElement] if this type represents a single class,
-   * otherwise returns `null`.  This method is conservative.
-   */
-  ClassElement singleClass(ClosedWorld closedWorld) {
+  /// Returns the [Entity] if this type represents a single class, otherwise
+  /// returns `null`.  This method is conservative.
+  Entity singleClass(ClosedWorld closedWorld) {
     if (isEmptyOrNull) return null;
     if (isNullable) return null; // It is Null and some other class.
     if (isExact) {
@@ -479,6 +468,7 @@
     if (isSubclass && other.isSubclass) return intersectionEmpty(other);
     assert(isSubtype || other.isSubtype);
     int kind = (isSubclass || other.isSubclass) ? SUBCLASS : SUBTYPE;
+    // TODO(johnniwinther): Move this computation to [ClosedWorld].
     // Compute the set of classes that are contained in both type masks.
     Set<ClassElement> common = commonContainedClasses(this, other, closedWorld);
     if (common == null || common.isEmpty) return intersectionEmpty(other);
@@ -504,7 +494,7 @@
     // result will only be nullable if both masks are nullable. We have
     // to normalize here, as we generate types based on new base classes.
     int combined = (kind << 1) | (flags & other.flags & 1);
-    Iterable<TypeMask> masks = candidates.map((ClassElement cls) {
+    Iterable<TypeMask> masks = candidates.map((Entity cls) {
       return new FlatTypeMask.normalized(cls, combined, closedWorld);
     });
     return UnionTypeMask.unionOf(masks, closedWorld);
@@ -517,27 +507,6 @@
   }
 
   /**
-   * Returns whether [element] will be the one used at runtime when being
-   * invoked on an instance of [cls]. [selector] is used to ensure library
-   * privacy is taken into account.
-   */
-  static bool hasElementIn(
-      ClassElement cls, Selector selector, Element element) {
-    // Use [:implementation:] of [element]
-    // because our function set only stores declarations.
-    Element result = findMatchIn(cls, selector);
-    return result == null
-        ? false
-        : result.implementation == element.implementation;
-  }
-
-  static Element findMatchIn(ClassElement cls, Selector selector) {
-    // Use the [:implementation] of [cls] in case the found [element]
-    // is in the patch class.
-    return cls.implementation.lookupByName(selector.memberName);
-  }
-
-  /**
    * Returns whether [element] is a potential target when being
    * invoked on this type mask. [selector] is used to ensure library
    * privacy is taken into account.
@@ -547,7 +516,8 @@
     assert(element.name == selector.name);
     if (isEmpty) return false;
     if (isNull) {
-      return hasElementIn(backendClasses.nullImplementation, selector, element);
+      return closedWorld.hasElementIn(
+          backendClasses.nullImplementation, selector, element);
     }
 
     // TODO(kasperl): Can't we just avoid creating typed selectors
@@ -563,14 +533,14 @@
     if (other == backendClasses.nullImplementation) {
       return isNullable;
     } else if (isExact) {
-      return hasElementIn(self, selector, element);
+      return closedWorld.hasElementIn(self, selector, element);
     } else if (isSubclass) {
-      return hasElementIn(self, selector, element) ||
+      return closedWorld.hasElementIn(self, selector, element) ||
           other.isSubclassOf(self) ||
           closedWorld.hasAnySubclassThatMixes(self, other);
     } else {
       assert(isSubtype);
-      bool result = hasElementIn(self, selector, element) ||
+      bool result = closedWorld.hasElementIn(self, selector, element) ||
           other.implementsInterface(self) ||
           closedWorld.hasAnySubclassThatImplements(other, base) ||
           closedWorld.hasAnySubclassOfMixinUseThatImplements(other, base);
@@ -579,122 +549,40 @@
       // can be hit from any of the mixin applications.
       Iterable<ClassElement> mixinUses = closedWorld.mixinUsesOf(self);
       return mixinUses.any((mixinApplication) =>
-          hasElementIn(mixinApplication, selector, element) ||
+          closedWorld.hasElementIn(mixinApplication, selector, element) ||
           other.isSubclassOf(mixinApplication) ||
           closedWorld.hasAnySubclassThatMixes(mixinApplication, other));
     }
   }
 
-  /**
-   * Returns whether a [selector] call on an instance of [cls]
-   * will hit a method at runtime, and not go through [noSuchMethod].
-   */
-  static bool hasConcreteMatch(
-      ClassElement cls, Selector selector, ClosedWorld world) {
-    assert(invariant(cls, world.isInstantiated(cls),
-        message: '$cls has not been instantiated.'));
-    Element element = findMatchIn(cls, selector);
-    if (element == null) return false;
-
-    if (element.isAbstract) {
-      ClassElement enclosingClass = element.enclosingClass;
-      return hasConcreteMatch(enclosingClass.superclass, selector, world);
-    }
-    return selector.appliesUntyped(element);
-  }
-
   bool needsNoSuchMethodHandling(Selector selector, ClosedWorld closedWorld) {
     // A call on an empty type mask is either dead code, or a call on
     // `null`.
     if (isEmptyOrNull) return false;
     // A call on an exact mask for an abstract class is dead code.
-    if (isExact && base.isAbstract) return false;
-    // If the receiver is guaranteed to have a member that
-    // matches what we're looking for, there's no need to
-    // introduce a noSuchMethod handler. It will never be called.
-    //
-    // As an example, consider this class hierarchy:
-    //
-    //                   A    <-- noSuchMethod
-    //                  / \
-    //                 C   B  <-- foo
-    //
-    // If we know we're calling foo on an object of type B we
-    // don't have to worry about the noSuchMethod method in A
-    // because objects of type B implement foo. On the other hand,
-    // if we end up calling foo on something of type C we have to
-    // add a handler for it.
+    // TODO(johnniwinther): A type mask cannot be abstract. Remove the need
+    // for this noise (currently used for super-calls in inference and mirror
+    // usage).
+    if (isExact && closedWorld.isAbstract(base)) return false;
 
-    // If the holders of all user-defined noSuchMethod
-    // implementations that might be applicable to the receiver
-    // type have a matching member for the current name and
-    // selector, we avoid introducing a noSuchMethod handler.
-    //
-    // As an example, consider this class hierarchy:
-    //
-    //                       A    <-- foo
-    //                      / \
-    //   noSuchMethod -->  B   C  <-- bar
-    //                     |   |
-    //                     C   D  <-- noSuchMethod
-    //
-    // When calling foo on an object of type A, we know that the
-    // implementations of noSuchMethod are in the classes B and D
-    // that also (indirectly) implement foo, so we do not need a
-    // handler for it.
-    //
-    // If we're calling bar on an object of type D, we don't need
-    // the handler either because all objects of type D implement
-    // bar through inheritance.
-    //
-    // If we're calling bar on an object of type A we do need the
-    // handler because we may have to call B.noSuchMethod since B
-    // does not implement bar.
-
-    /// Returns `true` if [cls] is an instantiated class that does not have
-    /// a concrete method matching [selector].
-    bool needsNoSuchMethod(ClassElement cls) {
-      // We can skip uninstantiated subclasses.
-      // TODO(johnniwinther): Put filtering into the (Class)World.
-      if (!closedWorld.isInstantiated(cls)) {
-        return false;
-      }
-      // We can just skip abstract classes because we know no
-      // instance of them will be created at runtime, and
-      // therefore there is no instance that will require
-      // [noSuchMethod] handling.
-      return !cls.isAbstract && !hasConcreteMatch(cls, selector, closedWorld);
-    }
-
-    bool baseNeedsNoSuchMethod = needsNoSuchMethod(base);
-    if (isExact || baseNeedsNoSuchMethod) {
-      return baseNeedsNoSuchMethod;
-    }
-
-    Iterable<ClassElement> subclassesToCheck;
-    if (isSubtype) {
-      subclassesToCheck = closedWorld.strictSubtypesOf(base);
-    } else {
-      assert(isSubclass);
-      subclassesToCheck = closedWorld.strictSubclassesOf(base);
-    }
-
-    return subclassesToCheck != null &&
-        subclassesToCheck.any(needsNoSuchMethod);
+    return closedWorld.needsNoSuchMethod(
+        base,
+        selector,
+        isExact
+            ? ClassQuery.EXACT
+            : (isSubclass ? ClassQuery.SUBCLASS : ClassQuery.SUBTYPE));
   }
 
-  Element locateSingleElement(Selector selector, Compiler compiler) {
+  Element locateSingleElement(Selector selector, ClosedWorld closedWorld) {
     if (isEmptyOrNull) return null;
-    Iterable<Element> targets =
-        compiler.closedWorld.allFunctions.filter(selector, this);
+    Iterable<Element> targets = closedWorld.allFunctions.filter(selector, this);
     if (targets.length != 1) return null;
     Element result = targets.first;
-    ClassElement enclosing = result.enclosingClass;
+    ClassElement enclosing = result.enclosingClass.declaration;
     // We only return the found element if it is guaranteed to be implemented on
     // all classes in the receiver type [this]. It could be found only in a
     // subclass or in an inheritance-wise unrelated class in case of subtype
     // selectors.
-    ClosedWorld closedWorld = compiler.closedWorld;
     if (isSubtype) {
       // if (closedWorld.isUsedAsMixin(enclosing)) {
       if (closedWorld.everySubtypeIsSubclassOfOrMixinUseOf(base, enclosing)) {
@@ -703,7 +591,7 @@
       //}
       return null;
     } else {
-      if (base.isSubclassOf(enclosing)) return result;
+      if (closedWorld.isSubclassOf(base, enclosing)) return result;
       if (closedWorld.isSubclassOfMixinUseOf(base, enclosing)) return result;
     }
     return null;
diff --git a/pkg/compiler/lib/src/types/forwarding_type_mask.dart b/pkg/compiler/lib/src/types/forwarding_type_mask.dart
index cdf4f16..775fee0 100644
--- a/pkg/compiler/lib/src/types/forwarding_type_mask.dart
+++ b/pkg/compiler/lib/src/types/forwarding_type_mask.dart
@@ -54,23 +54,23 @@
     return forwardTo.containsOnlyString(closedWorld);
   }
 
-  bool containsOnly(ClassElement element) {
-    return forwardTo.containsOnly(element);
+  bool containsOnly(Entity cls) {
+    return forwardTo.containsOnly(cls);
   }
 
-  bool satisfies(ClassElement cls, ClosedWorld closedWorld) {
+  bool satisfies(Entity cls, ClosedWorld closedWorld) {
     return forwardTo.satisfies(cls, closedWorld);
   }
 
-  bool contains(ClassElement type, ClosedWorld closedWorld) {
-    return forwardTo.contains(type, closedWorld);
+  bool contains(Entity cls, ClosedWorld closedWorld) {
+    return forwardTo.contains(cls, closedWorld);
   }
 
   bool containsAll(ClosedWorld closedWorld) {
     return forwardTo.containsAll(closedWorld);
   }
 
-  ClassElement singleClass(ClosedWorld closedWorld) {
+  Entity singleClass(ClosedWorld closedWorld) {
     return forwardTo.singleClass(closedWorld);
   }
 
@@ -101,8 +101,8 @@
     return forwardTo.canHit(element, selector, closedWorld);
   }
 
-  Element locateSingleElement(Selector selector, Compiler compiler) {
-    return forwardTo.locateSingleElement(selector, compiler);
+  Element locateSingleElement(Selector selector, ClosedWorld closedWorld) {
+    return forwardTo.locateSingleElement(selector, closedWorld);
   }
 
   bool equalsDisregardNull(other) {
diff --git a/pkg/compiler/lib/src/types/masks.dart b/pkg/compiler/lib/src/types/masks.dart
index 9f59ad5..5cbc4c0 100644
--- a/pkg/compiler/lib/src/types/masks.dart
+++ b/pkg/compiler/lib/src/types/masks.dart
@@ -12,13 +12,13 @@
 import '../inferrer/type_graph_inferrer.dart' show TypeGraphInferrer;
 import '../tree/tree.dart';
 import '../universe/selector.dart' show Selector;
-import '../universe/universe.dart'
+import '../universe/world_builder.dart'
     show
         ReceiverConstraint,
         UniverseSelectorConstraints,
         SelectorConstraintsStrategy;
 import '../util/util.dart';
-import '../world.dart' show ClosedWorld;
+import '../world.dart' show ClassQuery, ClosedWorld;
 import 'abstract_value_domain.dart' show AbstractValue;
 
 part 'container_type_mask.dart';
@@ -33,11 +33,9 @@
 class CommonMasks {
   // TODO(sigmund): once we split out the backend common elements, depend
   // directly on those instead.
-  final Compiler compiler;
+  final ClosedWorld closedWorld;
 
-  CommonMasks(this.compiler);
-
-  ClosedWorld get closedWorld => compiler.closedWorld;
+  CommonMasks(this.closedWorld);
 
   BackendClasses get backendClasses => closedWorld.backendClasses;
 
diff --git a/pkg/compiler/lib/src/types/type_mask.dart b/pkg/compiler/lib/src/types/type_mask.dart
index cd92ed9..c91fac6 100644
--- a/pkg/compiler/lib/src/types/type_mask.dart
+++ b/pkg/compiler/lib/src/types/type_mask.dart
@@ -77,30 +77,30 @@
  */
 abstract class TypeMask implements ReceiverConstraint, AbstractValue {
   factory TypeMask(
-      ClassElement base, int kind, bool isNullable, ClosedWorld closedWorld) {
+      Entity base, int kind, bool isNullable, ClosedWorld closedWorld) {
     return new FlatTypeMask.normalized(
         base, (kind << 1) | (isNullable ? 1 : 0), closedWorld);
   }
 
   const factory TypeMask.empty() = FlatTypeMask.empty;
 
-  factory TypeMask.exact(ClassElement base, ClosedWorld closedWorld) {
+  factory TypeMask.exact(Entity base, ClosedWorld closedWorld) {
     assert(invariant(base, closedWorld.isInstantiated(base),
         message: () => "Cannot create exact type mask for uninstantiated "
             "class $base.\n${closedWorld.dump(base)}"));
     return new FlatTypeMask.exact(base);
   }
 
-  factory TypeMask.exactOrEmpty(ClassElement base, ClosedWorld closedWorld) {
+  factory TypeMask.exactOrEmpty(Entity base, ClosedWorld closedWorld) {
     if (closedWorld.isInstantiated(base)) return new FlatTypeMask.exact(base);
     return const TypeMask.empty();
   }
 
-  factory TypeMask.subclass(ClassElement base, ClosedWorld closedWorld) {
+  factory TypeMask.subclass(Entity base, ClosedWorld closedWorld) {
     assert(invariant(base, closedWorld.isInstantiated(base),
         message: () => "Cannot create subclass type mask for uninstantiated "
             "class $base.\n${closedWorld.dump(base)}"));
-    ClassElement topmost = closedWorld.getLubOfInstantiatedSubclasses(base);
+    Entity topmost = closedWorld.getLubOfInstantiatedSubclasses(base);
     if (topmost == null) {
       return new TypeMask.empty();
     } else if (closedWorld.hasAnyStrictSubclass(topmost)) {
@@ -110,8 +110,8 @@
     }
   }
 
-  factory TypeMask.subtype(ClassElement base, ClosedWorld closedWorld) {
-    ClassElement topmost = closedWorld.getLubOfInstantiatedSubtypes(base);
+  factory TypeMask.subtype(Entity base, ClosedWorld closedWorld) {
+    Entity topmost = closedWorld.getLubOfInstantiatedSubtypes(base);
     if (topmost == null) {
       return new TypeMask.empty();
     }
@@ -127,26 +127,25 @@
 
   const factory TypeMask.nonNullEmpty() = FlatTypeMask.nonNullEmpty;
 
-  factory TypeMask.nonNullExact(ClassElement base, ClosedWorld closedWorld) {
+  factory TypeMask.nonNullExact(Entity base, ClosedWorld closedWorld) {
     assert(invariant(base, closedWorld.isInstantiated(base),
         message: () => "Cannot create exact type mask for uninstantiated "
             "class $base.\n${closedWorld.dump(base)}"));
     return new FlatTypeMask.nonNullExact(base);
   }
 
-  factory TypeMask.nonNullExactOrEmpty(
-      ClassElement base, ClosedWorld closedWorld) {
+  factory TypeMask.nonNullExactOrEmpty(Entity base, ClosedWorld closedWorld) {
     if (closedWorld.isInstantiated(base)) {
       return new FlatTypeMask.nonNullExact(base);
     }
     return const TypeMask.nonNullEmpty();
   }
 
-  factory TypeMask.nonNullSubclass(ClassElement base, ClosedWorld closedWorld) {
+  factory TypeMask.nonNullSubclass(Entity base, ClosedWorld closedWorld) {
     assert(invariant(base, closedWorld.isInstantiated(base),
         message: () => "Cannot create subclass type mask for uninstantiated "
             "class $base.\n${closedWorld.dump(base)}"));
-    ClassElement topmost = closedWorld.getLubOfInstantiatedSubclasses(base);
+    Entity topmost = closedWorld.getLubOfInstantiatedSubclasses(base);
     if (topmost == null) {
       return new TypeMask.nonNullEmpty();
     } else if (closedWorld.hasAnyStrictSubclass(topmost)) {
@@ -156,8 +155,8 @@
     }
   }
 
-  factory TypeMask.nonNullSubtype(ClassElement base, ClosedWorld closedWorld) {
-    ClassElement topmost = closedWorld.getLubOfInstantiatedSubtypes(base);
+  factory TypeMask.nonNullSubtype(Entity base, ClosedWorld closedWorld) {
+    Entity topmost = closedWorld.getLubOfInstantiatedSubtypes(base);
     if (topmost == null) {
       return new TypeMask.nonNullEmpty();
     }
@@ -287,7 +286,7 @@
   bool containsOnlyNum(ClosedWorld closedWorld);
   bool containsOnlyBool(ClosedWorld closedWorld);
   bool containsOnlyString(ClosedWorld closedWorld);
-  bool containsOnly(ClassElement element);
+  bool containsOnly(Entity cls);
 
   /**
    * Compares two [TypeMask] objects for structural equality.
@@ -316,23 +315,21 @@
   /**
    * Returns whether this type mask is an instance of [cls].
    */
-  bool satisfies(ClassElement cls, ClosedWorld closedWorld);
+  bool satisfies(Entity cls, ClosedWorld closedWorld);
 
   /**
-   * Returns whether or not this type mask contains the given type.
+   * Returns whether or not this type mask contains the given class [cls].
    */
-  bool contains(ClassElement type, ClosedWorld closedWorld);
+  bool contains(Entity cls, ClosedWorld closedWorld);
 
   /**
    * Returns whether or not this type mask contains all types.
    */
   bool containsAll(ClosedWorld closedWorld);
 
-  /**
-   * Returns the [ClassElement] if this type represents a single class,
-   * otherwise returns `null`.  This method is conservative.
-   */
-  ClassElement singleClass(ClosedWorld closedWorld);
+  /// Returns the [Entity] if this type represents a single class, otherwise
+  /// returns `null`.  This method is conservative.
+  Entity singleClass(ClosedWorld closedWorld);
 
   /**
    * Returns a type mask representing the union of [this] and [other].
@@ -359,5 +356,5 @@
    * on this mask. Returns null if there is none.
    */
   // TODO(johnniwinther): Move this method to [World].
-  Element locateSingleElement(Selector selector, Compiler compiler);
+  Element locateSingleElement(Selector selector, ClosedWorld closedWorld);
 }
diff --git a/pkg/compiler/lib/src/types/types.dart b/pkg/compiler/lib/src/types/types.dart
index ad890dc..d2831c0 100644
--- a/pkg/compiler/lib/src/types/types.dart
+++ b/pkg/compiler/lib/src/types/types.dart
@@ -4,17 +4,165 @@
 
 library types;
 
+import '../closure.dart' show SynthesizedCallMethodElementX;
+import '../common.dart' show invariant;
 import '../common/tasks.dart' show CompilerTask;
 import '../compiler.dart' show Compiler;
 import '../elements/elements.dart';
-import '../inferrer/type_graph_inferrer.dart' show TypeGraphInferrer;
+import '../inferrer/type_graph_inferrer.dart'
+    show TypeGraphInferrer, TypeInformationSystem;
 import '../tree/tree.dart';
-import '../resolution/tree_elements.dart';
 import '../universe/selector.dart' show Selector;
+import '../util/util.dart' show Maplet;
 
 import 'masks.dart';
 export 'masks.dart';
 
+/// Results about a single element (e.g. a method, parameter, or field)
+/// produced by the global type-inference algorithm.
+///
+/// All queries in this class may contain results that assume whole-program
+/// closed-world semantics. Any [TypeMask] for an element or node that we return
+/// was inferred to be a "guaranteed type", that means, it is a type that we
+/// can prove to be correct for all executions of the program.  A trivial
+/// implementation would return false on all boolean properties (giving no
+/// guarantees) and the `subclass of Object or null` type mask for the type
+/// based queries (the runtime value could be anything).
+abstract class GlobalTypeInferenceElementResult {
+  /// Whether the method element associated with this result always throws.
+  bool get throwsAlways;
+
+  /// Whether the element associated with this result is only called once in one
+  /// location in the entire program.
+  bool get isCalledOnce;
+
+  /// The inferred type when this result belongs to a parameter or field
+  /// element, null otherwise.
+  TypeMask get type;
+
+  /// The inferred return type when this result belongs to a function element.
+  TypeMask get returnType;
+
+  /// Returns the type of a list allocation [node] (which can be a list
+  /// literal or a list new expression).
+  TypeMask typeOfNewList(Node node);
+
+  /// Returns the type of a send [node].
+  TypeMask typeOfSend(Node node);
+
+  /// Returns the type of the operator of a complex send-set [node], for
+  /// example, the type of `+` in `a += b`.
+  TypeMask typeOfGetter(SendSet node);
+
+  /// Returns the type of the getter in a complex send-set [node], for example,
+  /// the type of the `a.f` getter in `a.f += b`.
+  TypeMask typeOfOperator(SendSet node);
+
+  /// Returns the type of the iterator in a [loop].
+  TypeMask typeOfIterator(ForIn node);
+
+  /// Returns the type of the `moveNext` call of an iterator in a [loop].
+  TypeMask typeOfIteratorMoveNext(ForIn node);
+
+  /// Returns the type of the `current` getter of an iterator in a [loop].
+  TypeMask typeOfIteratorCurrent(ForIn node);
+}
+
+class GlobalTypeInferenceElementResultImpl
+    implements GlobalTypeInferenceElementResult {
+  // TODO(sigmund): delete, store data directly here.
+  final Element _owner;
+
+  // TODO(sigmund): split - stop using _data after inference is done.
+  final GlobalTypeInferenceElementData _data;
+
+  // TODO(sigmund): store relevant data & drop reference to inference engine.
+  final TypesInferrer _inferrer;
+  final bool _isJsInterop;
+  final TypeMask _dynamic;
+
+  GlobalTypeInferenceElementResultImpl(this._owner, this._data, this._inferrer,
+      this._isJsInterop, this._dynamic);
+
+  bool get isCalledOnce => _inferrer.isCalledOnce(_owner);
+
+  TypeMask get returnType =>
+      _isJsInterop ? _dynamic : _inferrer.getReturnTypeOfElement(_owner);
+
+  TypeMask get type =>
+      _isJsInterop ? _dynamic : _inferrer.getTypeOfElement(_owner);
+
+  bool get throwsAlways {
+    TypeMask mask = this.returnType;
+    // Always throws if the return type was inferred to be non-null empty.
+    return mask != null && mask.isEmpty;
+  }
+
+  TypeMask typeOfNewList(Node node) =>
+      _inferrer.getTypeForNewList(_owner, node);
+
+  TypeMask typeOfSend(Node node) => _data?.typeOfSend(node);
+  TypeMask typeOfGetter(SendSet node) => _data?.typeOfGetter(node);
+  TypeMask typeOfOperator(SendSet node) => _data?.typeOfOperator(node);
+  TypeMask typeOfIterator(ForIn node) => _data?.typeOfIterator(node);
+  TypeMask typeOfIteratorMoveNext(ForIn node) =>
+      _data?.typeOfIteratorMoveNext(node);
+  TypeMask typeOfIteratorCurrent(ForIn node) =>
+      _data?.typeOfIteratorCurrent(node);
+}
+
+/// Internal data used during type-inference to store intermediate results about
+/// a single element.
+class GlobalTypeInferenceElementData {
+  Map<Object, TypeMask> _typeMasks;
+
+  TypeMask _get(Object node) => _typeMasks != null ? _typeMasks[node] : null;
+  void _set(Object node, TypeMask mask) {
+    _typeMasks ??= new Maplet<Object, TypeMask>();
+    _typeMasks[node] = mask;
+  }
+
+  TypeMask typeOfSend(Node node) => _get(node);
+  TypeMask typeOfGetter(SendSet node) => _get(node.selector);
+  TypeMask typeOfOperator(SendSet node) => _get(node.assignmentOperator);
+
+  void setTypeMask(Node node, TypeMask mask) {
+    _set(node, mask);
+  }
+
+  void setGetterTypeMaskInComplexSendSet(SendSet node, TypeMask mask) {
+    _set(node.selector, mask);
+  }
+
+  void setOperatorTypeMaskInComplexSendSet(SendSet node, TypeMask mask) {
+    _set(node.assignmentOperator, mask);
+  }
+
+  // TODO(sigmund): clean up. We store data about 3 selectors for "for in"
+  // nodes: the iterator, move-next, and current element. Because our map keys
+  // are nodes, we need to fabricate different keys to keep these selectors
+  // separate. The current implementation does this by using
+  // children of the for-in node (these children were picked arbitrarily).
+
+  TypeMask typeOfIterator(ForIn node) => _get(node);
+
+  TypeMask typeOfIteratorMoveNext(ForIn node) => _get(node.forToken);
+
+  TypeMask typeOfIteratorCurrent(ForIn node) => _get(node.inToken);
+
+  void setIteratorTypeMask(ForIn node, TypeMask mask) {
+    _set(node, mask);
+  }
+
+  void setMoveNextTypeMask(ForIn node, TypeMask mask) {
+    _set(node.forToken, mask);
+  }
+
+  void setCurrentTypeMask(ForIn node, TypeMask mask) {
+    _set(node.inToken, mask);
+  }
+}
+
 /// API to interact with the global type-inference engine.
 abstract class TypesInferrer {
   void analyzeMain(Element element);
@@ -35,91 +183,48 @@
 /// can prove to be correct for all executions of the program.
 class GlobalTypeInferenceResults {
   // TODO(sigmund): store relevant data & drop reference to inference engine.
-  final TypesInferrer _inferrer;
+  final TypeGraphInferrer _inferrer;
   final Compiler compiler;
   final TypeMask dynamicType;
+  final Map<Element, GlobalTypeInferenceElementResult> _elementResults = {};
 
-  GlobalTypeInferenceResults(this._inferrer, this.compiler, CommonMasks masks)
+  // TODO(sigmund,johnniwinther): compute result objects eagerly and make it an
+  // error to query for results that don't exist.
+  GlobalTypeInferenceElementResult resultOf(AstElement element) {
+    assert(invariant(element, !element.isGenerativeConstructorBody,
+        message: "unexpected input: ConstructorBodyElements are created"
+            " after global type inference, no data is avaiable for them."));
+
+    // TODO(sigmund): store closure data directly in the closure element and
+    // not in the context of the enclosing method?
+    var key = (element is SynthesizedCallMethodElementX)
+        ? element.memberContext
+        : element;
+    return _elementResults.putIfAbsent(
+        element,
+        () => new GlobalTypeInferenceElementResultImpl(
+            element,
+            _inferrer.inferrer.inTreeData[key],
+            _inferrer,
+            compiler.backend.isJsInterop(element),
+            dynamicType));
+  }
+
+  GlobalTypeInferenceResults(this._inferrer, this.compiler, CommonMasks masks,
+      TypeInformationSystem types)
       : dynamicType = masks.dynamicType;
 
-  /// Returns the type of a parameter or field [element], if any.
-  TypeMask typeOf(Element element) {
-    // TODO(24489): trust some JsInterop types.
-    if (compiler.backend.isJsInterop(element)) return dynamicType;
-    return _inferrer.getTypeOfElement(element);
-  }
-
-  /// Returns the return type of a method or function [element].
-  TypeMask returnTypeOf(Element element) {
-    // TODO(24489): trust some JsInterop types.
-    if (compiler.backend.isJsInterop(element)) return dynamicType;
-    return _inferrer.getReturnTypeOfElement(element);
-  }
-
   /// Returns the type of a [selector] when applied to a receiver with the given
   /// type [mask].
   TypeMask typeOfSelector(Selector selector, TypeMask mask) =>
       _inferrer.getTypeOfSelector(selector, mask);
 
-  /// Returns whether the method [element] always throws.
-  bool throwsAlways(Element element) {
-    // We know the element always throws if the return type was inferred to be
-    // non-null empty.
-    TypeMask returnType = returnTypeOf(element);
-    return returnType != null && returnType.isEmpty;
-  }
-
-  /// Returns whether [element] is only called once in the entire program.
-  bool isCalledOnce(Element element) => _inferrer.isCalledOnce(element);
-
-  // TODO(sigmund): introduce a new class [ElementInferenceResult] that can be
-  // used to collect any information that is specific about the body within a
-  // single element (basically everything below this line). We could consider
-  // moving some of the functions above too, for example:
-  //    results.throwsAlways(element)
-  // could become:
-  //    results[element].alwaysThrows;
-  //
-
-  /// Returns the type of a list allocation [node] occuring within [owner].
-  ///
-  /// [node] can be a list literal or a list new expression.
-  TypeMask typeOfNewList(Element owner, Node node) =>
-      _inferrer.getTypeForNewList(owner, node);
-
   /// Returns whether a fixed-length constructor call goes through a growable
   /// check.
+  // TODO(sigmund): move into the result of the element containing such
+  // constructor call.
   bool isFixedArrayCheckedForGrowable(Node ctorCall) =>
       _inferrer.isFixedArrayCheckedForGrowable(ctorCall);
-
-  /// Returns the type of a send [node].
-  TypeMask typeOfSend(
-          Node node,
-          // TODO(sigmund): move inference data out of TreeElements
-          TreeElements elements) =>
-      elements.getTypeMask(node);
-
-  /// Returns the type of the operator of a complex send-set [node], for
-  /// example, the type of `+` in `a += b`.
-  TypeMask typeOfOperator(Send node, TreeElements elements) =>
-      elements.getOperatorTypeMaskInComplexSendSet(node);
-
-  /// Returns the type of the getter in a complex send-set [node], for example,
-  /// the type of the `a.f` getter in `a.f += b`.
-  TypeMask typeOfGetter(node, elements) =>
-      elements.getGetterTypeMaskInComplexSendSet(node);
-
-  /// Returns the type of the iterator in a [loop].
-  TypeMask typeOfIterator(ForIn loop, elements) =>
-      elements.getIteratorTypeMask(loop);
-
-  /// Returns the type of the `moveNext` call of an iterator in a [loop].
-  TypeMask typeOfIteratorMoveNext(ForIn loop, elements) =>
-      elements.getMoveNextTypeMask(loop);
-
-  /// Returns the type of the `current` getter of an iterator in a [loop].
-  TypeMask typeOfIteratorCurrent(ForIn node, elements) =>
-      elements.getCurrentTypeMask(node);
 }
 
 /// Global analysis that infers concrete types.
@@ -128,23 +233,26 @@
   final String name = 'Type inference';
 
   final Compiler compiler;
-  TypesInferrer typesInferrer;
-  CommonMasks masks;
+
+  /// The [TypeGraphInferrer] used by the global type inference. This should by
+  /// accessed from outside this class for testing only.
+  TypeGraphInferrer typesInferrerInternal;
+
   GlobalTypeInferenceResults results;
 
   GlobalTypeInferenceTask(Compiler compiler)
-      : masks = new CommonMasks(compiler),
-        compiler = compiler,
-        super(compiler.measurer) {
-    typesInferrer = new TypeGraphInferrer(compiler, masks);
-  }
+      : compiler = compiler,
+        super(compiler.measurer);
 
   /// Runs the global type-inference algorithm once.
   void runGlobalTypeInference(Element mainElement) {
     measure(() {
-      typesInferrer.analyzeMain(mainElement);
-      typesInferrer.clear();
-      results = new GlobalTypeInferenceResults(typesInferrer, compiler, masks);
+      CommonMasks masks = compiler.closedWorld.commonMasks;
+      typesInferrerInternal ??= new TypeGraphInferrer(compiler, masks);
+      typesInferrerInternal.analyzeMain(mainElement);
+      typesInferrerInternal.clear();
+      results = new GlobalTypeInferenceResults(typesInferrerInternal, compiler,
+          masks, typesInferrerInternal.inferrer.types);
     });
   }
 }
diff --git a/pkg/compiler/lib/src/types/union_type_mask.dart b/pkg/compiler/lib/src/types/union_type_mask.dart
index 8e4aa39..eada935 100644
--- a/pkg/compiler/lib/src/types/union_type_mask.dart
+++ b/pkg/compiler/lib/src/types/union_type_mask.dart
@@ -88,24 +88,25 @@
   }
 
   static TypeMask flatten(List<FlatTypeMask> masks, ClosedWorld closedWorld) {
+    // TODO(johnniwinther): Move this computation to [ClosedWorld] and use the
+    // class set structures.
     assert(masks.length > 1);
     // If either type mask is a subtype type mask, we cannot use a
     // subclass type mask to represent their union.
     bool useSubclass = masks.every((e) => !e.isSubtype);
     bool isNullable = masks.any((e) => e.isNullable);
 
-    List<ClassElement> masksBases = masks.map((mask) => mask.base).toList();
-    Iterable<ClassElement> candidates =
-        closedWorld.commonSupertypesOf(masksBases);
+    List masksBases = masks.map((mask) => mask.base).toList();
+    Iterable<Entity> candidates = closedWorld.commonSupertypesOf(masksBases);
 
     // Compute the best candidate and its kind.
-    ClassElement bestElement;
+    Entity bestElement;
     int bestKind;
     int bestSize;
-    for (ClassElement candidate in candidates) {
+    for (Entity candidate in candidates) {
       bool isInstantiatedStrictSubclass(cls) =>
           cls != candidate &&
-          closedWorld.isDirectlyInstantiated(cls) &&
+          closedWorld.isExplicitlyInstantiated(cls) &&
           closedWorld.isSubclassOf(cls, candidate);
 
       int size;
@@ -231,14 +232,14 @@
     // Check we cover the base class.
     if (!contains(flat.base, closedWorld)) return false;
     // Check for other members.
-    Iterable<ClassElement> members;
+    Iterable<Entity> members;
     if (flat.isSubclass) {
       members = closedWorld.strictSubclassesOf(flat.base);
     } else {
       assert(flat.isSubtype);
       members = closedWorld.strictSubtypesOf(flat.base);
     }
-    return members.every((ClassElement cls) => this.contains(cls, closedWorld));
+    return members.every((Entity cls) => this.contains(cls, closedWorld));
   }
 
   bool isInMask(TypeMask other, ClosedWorld closedWorld) {
@@ -306,23 +307,23 @@
     return disjointMasks.every((mask) => mask.containsOnlyString(closedWorld));
   }
 
-  bool containsOnly(ClassElement element) {
+  bool containsOnly(Entity element) {
     return disjointMasks.every((mask) => mask.containsOnly(element));
   }
 
-  bool satisfies(ClassElement cls, ClosedWorld closedWorld) {
+  bool satisfies(Entity cls, ClosedWorld closedWorld) {
     return disjointMasks.every((mask) => mask.satisfies(cls, closedWorld));
   }
 
-  bool contains(ClassElement type, ClosedWorld closedWorld) {
-    return disjointMasks.any((e) => e.contains(type, closedWorld));
+  bool contains(Entity cls, ClosedWorld closedWorld) {
+    return disjointMasks.any((e) => e.contains(cls, closedWorld));
   }
 
   bool containsAll(ClosedWorld closedWorld) {
     return disjointMasks.any((mask) => mask.containsAll(closedWorld));
   }
 
-  ClassElement singleClass(ClosedWorld closedWorld) => null;
+  Entity singleClass(ClosedWorld closedWorld) => null;
 
   bool needsNoSuchMethodHandling(Selector selector, ClosedWorld closedWorld) {
     return disjointMasks
@@ -333,10 +334,10 @@
     return disjointMasks.any((e) => e.canHit(element, selector, closedWorld));
   }
 
-  Element locateSingleElement(Selector selector, Compiler compiler) {
+  Element locateSingleElement(Selector selector, ClosedWorld closedWorld) {
     Element candidate;
     for (FlatTypeMask mask in disjointMasks) {
-      Element current = mask.locateSingleElement(selector, compiler);
+      Element current = mask.locateSingleElement(selector, closedWorld);
       if (current == null) {
         return null;
       } else if (candidate == null) {
diff --git a/pkg/compiler/lib/src/universe/class_set.dart b/pkg/compiler/lib/src/universe/class_set.dart
index 2dd892e..39f507a 100644
--- a/pkg/compiler/lib/src/universe/class_set.dart
+++ b/pkg/compiler/lib/src/universe/class_set.dart
@@ -6,6 +6,7 @@
 
 import 'dart:collection' show IterableBase;
 
+import '../common.dart';
 import '../elements/elements.dart' show ClassElement;
 import '../util/enumset.dart' show EnumSet;
 import '../util/util.dart' show Link;
@@ -15,6 +16,7 @@
   UNINSTANTIATED,
   DIRECTLY_INSTANTIATED,
   INDIRECTLY_INSTANTIATED,
+  ABSTRACTLY_INSTANTIATED,
 }
 
 /// Node for [cls] in a tree forming the subclass relation of [ClassElement]s.
@@ -49,16 +51,18 @@
   static final EnumSet<Instantiation> INSTANTIATED =
       new EnumSet<Instantiation>.fromValues(const <Instantiation>[
     Instantiation.DIRECTLY_INSTANTIATED,
-    Instantiation.INDIRECTLY_INSTANTIATED
+    Instantiation.INDIRECTLY_INSTANTIATED,
+    Instantiation.ABSTRACTLY_INSTANTIATED,
   ], fixed: true);
 
-  /// Enum set for selecting directly instantiated classes in
+  /// Enum set for selecting directly and abstractly instantiated classes in
   /// [ClassHierarchyNode.subclassesByMask],
   /// [ClassHierarchyNode.subclassesByMask] and [ClassSet.subtypesByMask].
-  static final EnumSet<Instantiation> DIRECTLY_INSTANTIATED =
-      new EnumSet<Instantiation>.fromValues(
-          const <Instantiation>[Instantiation.DIRECTLY_INSTANTIATED],
-          fixed: true);
+  static final EnumSet<Instantiation> EXPLICITLY_INSTANTIATED =
+      new EnumSet<Instantiation>.fromValues(const <Instantiation>[
+    Instantiation.DIRECTLY_INSTANTIATED,
+    Instantiation.ABSTRACTLY_INSTANTIATED
+  ], fixed: true);
 
   /// Enum set for selecting all classes in
   /// [ClassHierarchyNode.subclassesByMask],
@@ -72,7 +76,8 @@
   static EnumSet<Instantiation> createMask(
       {bool includeDirectlyInstantiated: true,
       bool includeIndirectlyInstantiated: true,
-      bool includeUninstantiated: true}) {
+      bool includeUninstantiated: true,
+      bool includeAbstractlyInstantiated: true}) {
     EnumSet<Instantiation> mask = new EnumSet<Instantiation>();
     if (includeDirectlyInstantiated) {
       mask.add(Instantiation.DIRECTLY_INSTANTIATED);
@@ -83,6 +88,9 @@
     if (includeUninstantiated) {
       mask.add(Instantiation.UNINSTANTIATED);
     }
+    if (includeAbstractlyInstantiated) {
+      mask.add(Instantiation.ABSTRACTLY_INSTANTIATED);
+    }
     return mask;
   }
 
@@ -106,23 +114,54 @@
 
   void set isDirectlyInstantiated(bool value) {
     if (value != isDirectlyInstantiated) {
-      ClassHierarchyNode parent = parentNode;
-      if (value) {
-        _mask.remove(Instantiation.UNINSTANTIATED);
-        _mask.add(Instantiation.DIRECTLY_INSTANTIATED);
-        while (parent != null) {
-          parent._updateInstantiatedSubclassCount(1);
-          parent = parent.parentNode;
-        }
-      } else {
-        _mask.remove(Instantiation.DIRECTLY_INSTANTIATED);
-        if (_mask.isEmpty) {
-          _mask.add(Instantiation.UNINSTANTIATED);
-        }
-        while (parent != null) {
-          parent._updateInstantiatedSubclassCount(-1);
-          parent = parent.parentNode;
-        }
+      _updateParentInstantiatedSubclassCount(
+          Instantiation.DIRECTLY_INSTANTIATED,
+          add: value);
+    }
+  }
+
+  /// `true` if [cls] has been abstractly instantiated. This means that at
+  /// runtime instances of [cls] or unknown subclasses of [cls] are assumed to
+  /// exist.
+  ///
+  /// This is used to mark native and/or reflectable classes as instantiated.
+  /// For native classes we do not know the exact class that instantiates [cls]
+  /// so [cls] here represents the root of the subclasses. For reflectable
+  /// classes we need event abstract classes to be 'live' even though they
+  /// cannot themselves be instantiated.
+  bool get isAbstractlyInstantiated =>
+      _mask.contains(Instantiation.ABSTRACTLY_INSTANTIATED);
+
+  void set isAbstractlyInstantiated(bool value) {
+    if (value != isAbstractlyInstantiated) {
+      _updateParentInstantiatedSubclassCount(
+          Instantiation.ABSTRACTLY_INSTANTIATED,
+          add: value);
+    }
+  }
+
+  /// `true` if [cls] is either directly or abstractly instantiated.
+  bool get isExplicitlyInstantiated =>
+      isDirectlyInstantiated || isAbstractlyInstantiated;
+
+  void _updateParentInstantiatedSubclassCount(Instantiation instantiation,
+      {bool add}) {
+    ClassHierarchyNode parent = parentNode;
+    if (add) {
+      _mask.remove(Instantiation.UNINSTANTIATED);
+      _mask.add(instantiation);
+      while (parent != null) {
+        parent._updateInstantiatedSubclassCount(1);
+        parent = parent.parentNode;
+      }
+    } else {
+      _mask.remove(instantiation);
+      if (_mask.isEmpty) {
+        _mask.add(Instantiation.UNINSTANTIATED);
+      }
+      while (parent != null) {
+        parent._updateInstantiatedSubclassCount(-1);
+        parent = parent.parentNode;
       }
     }
   }
@@ -188,8 +227,9 @@
     return false;
   }
 
-  /// `true` if [cls] has been directly or indirectly instantiated.
-  bool get isInstantiated => isDirectlyInstantiated || isIndirectlyInstantiated;
+  /// `true` if [cls] has been directly, indirectly, or abstractly instantiated.
+  bool get isInstantiated =>
+      isExplicitlyInstantiated || isIndirectlyInstantiated;
 
   /// Returns an [Iterable] of the subclasses of [cls] possibly including [cls].
   ///
@@ -270,9 +310,12 @@
   }
 
   ClassElement _computeLeastUpperInstantiatedSubclass() {
-    if (isDirectlyInstantiated) {
+    if (isExplicitlyInstantiated) {
       return cls;
     }
+    if (!isInstantiated) {
+      return null;
+    }
     ClassHierarchyNode subclass;
     for (Link<ClassHierarchyNode> link = _directSubclasses;
         !link.isEmpty;
@@ -311,6 +354,9 @@
     if (isIndirectlyInstantiated) {
       sb.write(' indirectly');
     }
+    if (isAbstractlyInstantiated) {
+      sb.write(' abstractly');
+    }
     sb.write(' [');
     if (_directSubclasses.isEmpty) {
       sb.write(']');
@@ -439,7 +485,7 @@
     int count = node.instantiatedSubclassCount;
     if (_subtypes != null) {
       for (ClassHierarchyNode subtypeNode in _subtypes) {
-        if (subtypeNode.isDirectlyInstantiated) {
+        if (subtypeNode.isExplicitlyInstantiated) {
           count++;
         }
         count += subtypeNode.instantiatedSubclassCount;
@@ -461,6 +507,10 @@
     return true;
   }
 
+  Iterable<ClassHierarchyNode> get subtypeNodes {
+    return _subtypes ?? const <ClassHierarchyNode>[];
+  }
+
   /// Returns an [Iterable] of the subclasses of [cls] possibly including [cls].
   ///
   /// Subclasses are included if their instantiation properties intersect with
@@ -643,7 +693,7 @@
   }
 
   ClassElement _computeLeastUpperInstantiatedSubtype() {
-    if (node.isDirectlyInstantiated) {
+    if (node.isExplicitlyInstantiated) {
       return cls;
     }
     if (_subtypes == null) {
diff --git a/pkg/compiler/lib/src/universe/function_set.dart b/pkg/compiler/lib/src/universe/function_set.dart
index c05c7f9..0fb0018 100644
--- a/pkg/compiler/lib/src/universe/function_set.dart
+++ b/pkg/compiler/lib/src/universe/function_set.dart
@@ -11,17 +11,15 @@
 import '../util/util.dart' show Hashing, Setlet;
 import '../world.dart' show ClosedWorld;
 import 'selector.dart' show Selector;
-import 'universe.dart' show ReceiverConstraint;
+import 'world_builder.dart' show ReceiverConstraint;
 
 // TODO(kasperl): This actually holds getters and setters just fine
 // too and stricly they aren't functions. Maybe this needs a better
 // name -- something like ElementSet seems a bit too generic.
 class FunctionSet {
-  final Compiler compiler;
+  final ClosedWorld closedWorld;
   final Map<String, FunctionSetNode> nodes = new Map<String, FunctionSetNode>();
-  FunctionSet(this.compiler);
-
-  ClosedWorld get closedWorld => compiler.closedWorld;
+  FunctionSet(this.closedWorld);
 
   FunctionSetNode newNode(String name) => new FunctionSetNode(name);
 
@@ -51,8 +49,10 @@
     return (node != null) ? node.contains(element) : false;
   }
 
-  /// Returns an object that allows iterating over all the functions
-  /// that may be invoked with the given [selector].
+  /// Returns all the functions that may be invoked with the [selector] on a
+  /// receiver with the given [constraint]. The returned elements may include
+  /// noSuchMethod handlers that are potential targets indirectly through the
+  /// noSuchMethod mechanism.
   Iterable<Element> filter(Selector selector, ReceiverConstraint constraint) {
     return query(selector, constraint).functions;
   }
diff --git a/pkg/compiler/lib/src/universe/selector.dart b/pkg/compiler/lib/src/universe/selector.dart
index 39937fb..bc959c1 100644
--- a/pkg/compiler/lib/src/universe/selector.dart
+++ b/pkg/compiler/lib/src/universe/selector.dart
@@ -218,12 +218,12 @@
   }
 
   bool appliesUnnamed(Element element) {
-    assert(sameNameHack(element));
+    assert(name == element.name);
     return appliesUntyped(element);
   }
 
   bool appliesUntyped(Element element) {
-    assert(sameNameHack(element));
+    assert(name == element.name);
     if (Elements.isUnresolved(element)) return false;
     if (memberName.isPrivate && memberName.library != element.library) {
       // TODO(johnniwinther): Maybe this should be
@@ -247,13 +247,8 @@
     return callStructure.signatureApplies(function.functionSignature);
   }
 
-  bool sameNameHack(Element element) {
-    // TODO(ngeoffray): Remove workaround checks.
-    return element.isConstructor || name == element.name;
-  }
-
   bool applies(Element element) {
-    if (!sameNameHack(element)) return false;
+    if (name != element.name) return false;
     return appliesUnnamed(element);
   }
 
diff --git a/pkg/compiler/lib/src/universe/universe.dart b/pkg/compiler/lib/src/universe/universe.dart
deleted file mode 100644
index 03fc3c1..0000000
--- a/pkg/compiler/lib/src/universe/universe.dart
+++ /dev/null
@@ -1,665 +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 universe;
-
-import 'dart:collection';
-
-import '../common.dart';
-import '../compiler.dart' show Compiler;
-import '../dart_types.dart';
-import '../elements/elements.dart';
-import '../util/util.dart';
-import '../world.dart' show World, ClosedWorld, OpenWorld;
-import 'selector.dart' show Selector;
-import 'use.dart' show DynamicUse, DynamicUseKind, StaticUse, StaticUseKind;
-
-/// The known constraint on receiver for a dynamic call site.
-///
-/// This can for instance be used to constrain this dynamic call to `foo` to
-/// 'receivers of the exact instance `Bar`':
-///
-///     class Bar {
-///        void foo() {}
-///     }
-///     main() => new Bar().foo();
-///
-abstract class ReceiverConstraint {
-  /// Returns whether [element] is a potential target when being
-  /// invoked on a receiver with this constraint. [selector] is used to ensure
-  /// library privacy is taken into account.
-  bool canHit(Element element, Selector selector, World world);
-
-  /// Returns whether this [TypeMask] applied to [selector] can hit a
-  /// [noSuchMethod].
-  bool needsNoSuchMethodHandling(Selector selector, World world);
-}
-
-/// The combined constraints on receivers all the dynamic call sites of the same
-/// selector.
-///
-/// For instance for these calls
-///
-///     class A {
-///        foo(a, b) {}
-///     }
-///     class B {
-///        foo(a, b) {}
-///     }
-///     class C {
-///        foo(a, b) {}
-///     }
-///     new A().foo(a, b);
-///     new B().foo(0, 42);
-///
-/// the selector constraints for dynamic calls to 'foo' with two positional
-/// arguments could be 'receiver of exact instance `A` or `B`'.
-abstract class SelectorConstraints {
-  /// Returns `true` if [selector] applies to [element] under these constraints
-  /// given the closed [world].
-  ///
-  /// Consider for instance in this world:
-  ///
-  ///     class A {
-  ///        foo(a, b) {}
-  ///     }
-  ///     class B {
-  ///        foo(a, b) {}
-  ///     }
-  ///     new A().foo(a, b);
-  ///
-  /// Ideally the selector constraints for calls `foo` with two positional
-  /// arguments apply to `A.foo` but `B.foo`.
-  bool applies(Element element, Selector selector, World world);
-
-  /// Returns `true` if at least one of the receivers matching these constraints
-  /// in the closed [world] have no implementation matching [selector].
-  ///
-  /// For instance for this code snippet
-  ///
-  ///     class A {}
-  ///     class B { foo() {} }
-  ///     m(b) => (b ? new A() : new B()).foo();
-  ///
-  /// the potential receiver `new A()` has no implementation of `foo` and thus
-  /// needs to handle the call through its `noSuchMethod` handler.
-  bool needsNoSuchMethodHandling(Selector selector, World world);
-}
-
-/// A mutable [SelectorConstraints] used in [Universe].
-abstract class UniverseSelectorConstraints extends SelectorConstraints {
-  /// Adds [constraint] to these selector constraints. Return `true` if the set
-  /// of potential receivers expanded due to the new constraint.
-  bool addReceiverConstraint(ReceiverConstraint constraint);
-}
-
-/// Strategy for computing the constraints on potential receivers of dynamic
-/// call sites.
-abstract class SelectorConstraintsStrategy {
-  /// Create a [UniverseSelectorConstraints] to represent the global receiver
-  /// constraints for dynamic call sites with [selector].
-  UniverseSelectorConstraints createSelectorConstraints(Selector selector);
-}
-
-/// The [Universe] is an auxiliary class used in the process of computing the
-/// [ClosedWorld]. The concepts here and in [ClosedWorld] are very similar -- in
-/// the same way that the "universe expands" you can think of this as a mutable
-/// world that is expanding as we visit and discover parts of the program.
-// TODO(sigmund): rename to "growing/expanding/mutable world"?
-// TODO(johnniwinther): Move common implementation to a [UniverseBase] when
-// universes and worlds have been unified.
-abstract class Universe {
-  /// All directly instantiated classes, that is, classes with a generative
-  /// constructor that has been called directly and not only through a
-  /// super-call.
-  // TODO(johnniwinther): Improve semantic precision.
-  Iterable<ClassElement> get directlyInstantiatedClasses;
-
-  /// All types that are checked either through is, as or checked mode checks.
-  Iterable<DartType> get isChecks;
-
-  /// Registers that [type] is checked in this universe. The unaliased type is
-  /// returned.
-  DartType registerIsCheck(DartType type, Compiler compiler);
-
-  /// All directly instantiated types, that is, the types of the directly
-  /// instantiated classes.
-  // TODO(johnniwinther): Improve semantic precision.
-  Iterable<DartType> get instantiatedTypes;
-
-  /// Returns `true` if [member] is invoked as a setter.
-  bool hasInvokedSetter(Element member, World world);
-}
-
-abstract class ResolutionUniverse implements Universe {
-  /// Set of (live) local functions (closures) whose signatures reference type
-  /// variables.
-  ///
-  /// A live function is one whose enclosing member function has been enqueued.
-  Set<Element> get closuresWithFreeTypeVariables;
-
-  /// Set of (live) `call` methods whose signatures reference type variables.
-  ///
-  /// A live `call` method is one whose enclosing class has been instantiated.
-  Iterable<Element> get callMethodsWithFreeTypeVariables;
-
-  /// Set of all closures in the program. Used by the mirror tracking system
-  /// to find all live closure instances.
-  Iterable<LocalFunctionElement> get allClosures;
-
-  /// Set of methods in instantiated classes that are potentially closurized.
-  Iterable<Element> get closurizedMembers;
-
-  /// Returns `true` if [cls] is considered to be implemented by an
-  /// instantiated class, either directly, through subclasses or through
-  /// subtypes. The latter case only contains spurious information from
-  /// instantiations through factory constructors and mixins.
-  bool isImplemented(ClassElement cls);
-
-  /// Set of all fields that are statically known to be written to.
-  Iterable<Element> get fieldSetters;
-}
-
-class ResolutionUniverseImpl implements ResolutionUniverse {
-  /// The set of all directly instantiated classes, that is, classes with a
-  /// generative constructor that has been called directly and not only through
-  /// a super-call.
-  ///
-  /// Invariant: Elements are declaration elements.
-  // TODO(johnniwinther): [_directlyInstantiatedClasses] and
-  // [_instantiatedTypes] sets should be merged.
-  final Set<ClassElement> _directlyInstantiatedClasses =
-      new Set<ClassElement>();
-
-  /// The set of all directly instantiated types, that is, the types of the
-  /// directly instantiated classes.
-  ///
-  /// See [_directlyInstantiatedClasses].
-  final Set<DartType> _instantiatedTypes = new Set<DartType>();
-
-  /// Classes implemented by directly instantiated classes.
-  final Set<ClassElement> _implementedClasses = new Set<ClassElement>();
-
-  /// The set of all referenced static fields.
-  ///
-  /// Invariant: Elements are declaration elements.
-  final Set<FieldElement> allReferencedStaticFields = new Set<FieldElement>();
-
-  /**
-   * Documentation wanted -- johnniwinther
-   *
-   * Invariant: Elements are declaration elements.
-   */
-  final Set<FunctionElement> methodsNeedingSuperGetter =
-      new Set<FunctionElement>();
-  final Map<String, Map<Selector, SelectorConstraints>> _invokedNames =
-      <String, Map<Selector, SelectorConstraints>>{};
-  final Map<String, Map<Selector, SelectorConstraints>> _invokedGetters =
-      <String, Map<Selector, SelectorConstraints>>{};
-  final Map<String, Map<Selector, SelectorConstraints>> _invokedSetters =
-      <String, Map<Selector, SelectorConstraints>>{};
-
-  /// Fields set.
-  final Set<Element> fieldSetters = new Set<Element>();
-  final Set<DartType> isChecks = new Set<DartType>();
-
-  /**
-   * Set of (live) [:call:] methods whose signatures reference type variables.
-   *
-   * A live [:call:] method is one whose enclosing class has been instantiated.
-   */
-  final Set<Element> callMethodsWithFreeTypeVariables = new Set<Element>();
-
-  /**
-   * Set of (live) local functions (closures) whose signatures reference type
-   * variables.
-   *
-   * A live function is one whose enclosing member function has been enqueued.
-   */
-  final Set<Element> closuresWithFreeTypeVariables = new Set<Element>();
-
-  /**
-   * Set of all closures in the program. Used by the mirror tracking system
-   * to find all live closure instances.
-   */
-  final Set<LocalFunctionElement> allClosures = new Set<LocalFunctionElement>();
-
-  /**
-   * Set of methods in instantiated classes that are potentially
-   * closurized.
-   */
-  final Set<Element> closurizedMembers = new Set<Element>();
-
-  final SelectorConstraintsStrategy selectorConstraintsStrategy;
-
-  ResolutionUniverseImpl(this.selectorConstraintsStrategy);
-
-  /// All directly instantiated classes, that is, classes with a generative
-  /// constructor that has been called directly and not only through a
-  /// super-call.
-  // TODO(johnniwinther): Improve semantic precision.
-  Iterable<ClassElement> get directlyInstantiatedClasses {
-    return _directlyInstantiatedClasses;
-  }
-
-  /// All directly instantiated types, that is, the types of the directly
-  /// instantiated classes.
-  ///
-  /// See [directlyInstantiatedClasses].
-  // TODO(johnniwinther): Improve semantic precision.
-  Iterable<DartType> get instantiatedTypes => _instantiatedTypes;
-
-  /// Returns `true` if [cls] is considered to be implemented by an
-  /// instantiated class, either directly, through subclasses or through
-  /// subtypes. The latter case only contains spurious information from
-  /// instantiations through factory constructors and mixins.
-  // TODO(johnniwinther): Improve semantic precision.
-  bool isImplemented(ClassElement cls) {
-    return _implementedClasses.contains(cls.declaration);
-  }
-
-  /// Register [type] as (directly) instantiated.
-  ///
-  /// If [byMirrors] is `true`, the instantiation is through mirrors.
-  // TODO(johnniwinther): Fully enforce the separation between exact, through
-  // subclass and through subtype instantiated types/classes.
-  // TODO(johnniwinther): Support unknown type arguments for generic types.
-  void registerTypeInstantiation(InterfaceType type,
-      {bool byMirrors: false,
-      bool isNative: false,
-      void onImplemented(ClassElement cls)}) {
-    _instantiatedTypes.add(type);
-    ClassElement cls = type.element;
-    if (!cls.isAbstract
-        // We can't use the closed-world assumption with native abstract
-        // classes; a native abstract class may have non-abstract subclasses
-        // not declared to the program.  Instances of these classes are
-        // indistinguishable from the abstract class.
-        ||
-        isNative
-        // Likewise, if this registration comes from the mirror system,
-        // all bets are off.
-        // TODO(herhut): Track classes required by mirrors seperately.
-        ||
-        byMirrors) {
-      _directlyInstantiatedClasses.add(cls);
-    }
-
-    // TODO(johnniwinther): Replace this by separate more specific mappings that
-    // include the type arguments.
-    if (_implementedClasses.add(cls)) {
-      onImplemented(cls);
-      cls.allSupertypes.forEach((InterfaceType supertype) {
-        if (_implementedClasses.add(supertype.element)) {
-          onImplemented(supertype.element);
-        }
-      });
-    }
-  }
-
-  bool _hasMatchingSelector(Map<Selector, SelectorConstraints> selectors,
-      Element member, OpenWorld world) {
-    if (selectors == null) return false;
-    for (Selector selector in selectors.keys) {
-      if (selector.appliesUnnamed(member)) {
-        SelectorConstraints masks = selectors[selector];
-        if (masks.applies(member, selector, world)) {
-          return true;
-        }
-      }
-    }
-    return false;
-  }
-
-  bool hasInvocation(Element member, OpenWorld world) {
-    return _hasMatchingSelector(_invokedNames[member.name], member, world);
-  }
-
-  bool hasInvokedGetter(Element member, OpenWorld world) {
-    return _hasMatchingSelector(_invokedGetters[member.name], member, world) ||
-        member.isFunction && methodsNeedingSuperGetter.contains(member);
-  }
-
-  bool hasInvokedSetter(Element member, OpenWorld world) {
-    return _hasMatchingSelector(_invokedSetters[member.name], member, world);
-  }
-
-  bool registerDynamicUse(DynamicUse dynamicUse) {
-    switch (dynamicUse.kind) {
-      case DynamicUseKind.INVOKE:
-        return _registerNewSelector(dynamicUse, _invokedNames);
-      case DynamicUseKind.GET:
-        return _registerNewSelector(dynamicUse, _invokedGetters);
-      case DynamicUseKind.SET:
-        return _registerNewSelector(dynamicUse, _invokedSetters);
-    }
-  }
-
-  bool _registerNewSelector(DynamicUse dynamicUse,
-      Map<String, Map<Selector, SelectorConstraints>> selectorMap) {
-    Selector selector = dynamicUse.selector;
-    String name = selector.name;
-    ReceiverConstraint mask = dynamicUse.mask;
-    Map<Selector, SelectorConstraints> selectors = selectorMap.putIfAbsent(
-        name, () => new Maplet<Selector, SelectorConstraints>());
-    UniverseSelectorConstraints constraints =
-        selectors.putIfAbsent(selector, () {
-      return selectorConstraintsStrategy.createSelectorConstraints(selector);
-    });
-    return constraints.addReceiverConstraint(mask);
-  }
-
-  DartType registerIsCheck(DartType type, Compiler compiler) {
-    type.computeUnaliased(compiler.resolution);
-    type = type.unaliased;
-    // Even in checked mode, type annotations for return type and argument
-    // types do not imply type checks, so there should never be a check
-    // against the type variable of a typedef.
-    isChecks.add(type);
-    return type;
-  }
-
-  void registerStaticUse(StaticUse staticUse) {
-    Element element = staticUse.element;
-    if (Elements.isStaticOrTopLevel(element) && element.isField) {
-      allReferencedStaticFields.add(element);
-    }
-    switch (staticUse.kind) {
-      case StaticUseKind.SUPER_FIELD_SET:
-      case StaticUseKind.FIELD_SET:
-        fieldSetters.add(element);
-        break;
-      case StaticUseKind.SUPER_TEAR_OFF:
-        methodsNeedingSuperGetter.add(element);
-        break;
-      case StaticUseKind.GENERAL:
-      case StaticUseKind.STATIC_TEAR_OFF:
-      case StaticUseKind.FIELD_GET:
-        break;
-      case StaticUseKind.CLOSURE:
-        allClosures.add(element);
-        break;
-    }
-  }
-
-  void forgetElement(Element element, Compiler compiler) {
-    allClosures.remove(element);
-    slowDirectlyNestedClosures(element).forEach(compiler.forgetElement);
-    closurizedMembers.remove(element);
-    fieldSetters.remove(element);
-    _directlyInstantiatedClasses.remove(element);
-    if (element is ClassElement) {
-      assert(invariant(element, element.thisType.isRaw,
-          message: 'Generic classes not supported (${element.thisType}).'));
-      _instantiatedTypes..remove(element.rawType)..remove(element.thisType);
-    }
-  }
-
-  // TODO(ahe): Replace this method with something that is O(1), for example,
-  // by using a map.
-  List<LocalFunctionElement> slowDirectlyNestedClosures(Element element) {
-    // Return new list to guard against concurrent modifications.
-    return new List<LocalFunctionElement>.from(
-        allClosures.where((LocalFunctionElement closure) {
-      return closure.executableContext == element;
-    }));
-  }
-}
-
-/// Universe specific to codegen.
-///
-/// This adds additional access to liveness of selectors and elements.
-abstract class CodegenUniverse implements Universe {
-  void forEachInvokedName(
-      f(String name, Map<Selector, SelectorConstraints> selectors));
-
-  void forEachInvokedGetter(
-      f(String name, Map<Selector, SelectorConstraints> selectors));
-
-  void forEachInvokedSetter(
-      f(String name, Map<Selector, SelectorConstraints> selectors));
-
-  bool hasInvokedGetter(Element member, ClosedWorld world);
-
-  Map<Selector, SelectorConstraints> invocationsByName(String name);
-
-  Map<Selector, SelectorConstraints> getterInvocationsByName(String name);
-
-  Map<Selector, SelectorConstraints> setterInvocationsByName(String name);
-
-  Iterable<FunctionElement> get staticFunctionsNeedingGetter;
-  Iterable<FunctionElement> get methodsNeedingSuperGetter;
-
-  /// The set of all referenced static fields.
-  ///
-  /// Invariant: Elements are declaration elements.
-  Iterable<FieldElement> get allReferencedStaticFields;
-}
-
-class CodegenUniverseImpl implements CodegenUniverse {
-  /// The set of all directly instantiated classes, that is, classes with a
-  /// generative constructor that has been called directly and not only through
-  /// a super-call.
-  ///
-  /// Invariant: Elements are declaration elements.
-  // TODO(johnniwinther): [_directlyInstantiatedClasses] and
-  // [_instantiatedTypes] sets should be merged.
-  final Set<ClassElement> _directlyInstantiatedClasses =
-      new Set<ClassElement>();
-
-  /// The set of all directly instantiated types, that is, the types of the
-  /// directly instantiated classes.
-  ///
-  /// See [_directlyInstantiatedClasses].
-  final Set<DartType> _instantiatedTypes = new Set<DartType>();
-
-  /// Classes implemented by directly instantiated classes.
-  final Set<ClassElement> _implementedClasses = new Set<ClassElement>();
-
-  /// The set of all referenced static fields.
-  ///
-  /// Invariant: Elements are declaration elements.
-  final Set<FieldElement> allReferencedStaticFields = new Set<FieldElement>();
-
-  /**
-   * Documentation wanted -- johnniwinther
-   *
-   * Invariant: Elements are declaration elements.
-   */
-  final Set<FunctionElement> staticFunctionsNeedingGetter =
-      new Set<FunctionElement>();
-  final Set<FunctionElement> methodsNeedingSuperGetter =
-      new Set<FunctionElement>();
-  final Map<String, Map<Selector, SelectorConstraints>> _invokedNames =
-      <String, Map<Selector, SelectorConstraints>>{};
-  final Map<String, Map<Selector, SelectorConstraints>> _invokedGetters =
-      <String, Map<Selector, SelectorConstraints>>{};
-  final Map<String, Map<Selector, SelectorConstraints>> _invokedSetters =
-      <String, Map<Selector, SelectorConstraints>>{};
-
-  final Set<DartType> isChecks = new Set<DartType>();
-
-  final SelectorConstraintsStrategy selectorConstraintsStrategy;
-
-  CodegenUniverseImpl(this.selectorConstraintsStrategy);
-
-  /// All directly instantiated classes, that is, classes with a generative
-  /// constructor that has been called directly and not only through a
-  /// super-call.
-  // TODO(johnniwinther): Improve semantic precision.
-  Iterable<ClassElement> get directlyInstantiatedClasses {
-    return _directlyInstantiatedClasses;
-  }
-
-  /// All directly instantiated types, that is, the types of the directly
-  /// instantiated classes.
-  ///
-  /// See [directlyInstantiatedClasses].
-  // TODO(johnniwinther): Improve semantic precision.
-  Iterable<DartType> get instantiatedTypes => _instantiatedTypes;
-
-  /// Register [type] as (directly) instantiated.
-  ///
-  /// If [byMirrors] is `true`, the instantiation is through mirrors.
-  // TODO(johnniwinther): Fully enforce the separation between exact, through
-  // subclass and through subtype instantiated types/classes.
-  // TODO(johnniwinther): Support unknown type arguments for generic types.
-  void registerTypeInstantiation(InterfaceType type,
-      {bool byMirrors: false,
-      bool isNative: false,
-      void onImplemented(ClassElement cls)}) {
-    _instantiatedTypes.add(type);
-    ClassElement cls = type.element;
-    if (!cls.isAbstract
-        // We can't use the closed-world assumption with native abstract
-        // classes; a native abstract class may have non-abstract subclasses
-        // not declared to the program.  Instances of these classes are
-        // indistinguishable from the abstract class.
-        ||
-        isNative
-        // Likewise, if this registration comes from the mirror system,
-        // all bets are off.
-        // TODO(herhut): Track classes required by mirrors seperately.
-        ||
-        byMirrors) {
-      _directlyInstantiatedClasses.add(cls);
-    }
-
-    // TODO(johnniwinther): Replace this by separate more specific mappings that
-    // include the type arguments.
-    if (_implementedClasses.add(cls)) {
-      onImplemented(cls);
-      cls.allSupertypes.forEach((InterfaceType supertype) {
-        if (_implementedClasses.add(supertype.element)) {
-          onImplemented(supertype.element);
-        }
-      });
-    }
-  }
-
-  bool _hasMatchingSelector(Map<Selector, SelectorConstraints> selectors,
-      Element member, ClosedWorld world) {
-    if (selectors == null) return false;
-    for (Selector selector in selectors.keys) {
-      if (selector.appliesUnnamed(member)) {
-        SelectorConstraints masks = selectors[selector];
-        if (masks.applies(member, selector, world)) {
-          return true;
-        }
-      }
-    }
-    return false;
-  }
-
-  bool hasInvocation(Element member, ClosedWorld world) {
-    return _hasMatchingSelector(_invokedNames[member.name], member, world);
-  }
-
-  bool hasInvokedGetter(Element member, ClosedWorld world) {
-    return _hasMatchingSelector(_invokedGetters[member.name], member, world) ||
-        member.isFunction && methodsNeedingSuperGetter.contains(member);
-  }
-
-  bool hasInvokedSetter(Element member, ClosedWorld world) {
-    return _hasMatchingSelector(_invokedSetters[member.name], member, world);
-  }
-
-  bool registerDynamicUse(DynamicUse dynamicUse) {
-    switch (dynamicUse.kind) {
-      case DynamicUseKind.INVOKE:
-        return _registerNewSelector(dynamicUse, _invokedNames);
-      case DynamicUseKind.GET:
-        return _registerNewSelector(dynamicUse, _invokedGetters);
-      case DynamicUseKind.SET:
-        return _registerNewSelector(dynamicUse, _invokedSetters);
-    }
-  }
-
-  bool _registerNewSelector(DynamicUse dynamicUse,
-      Map<String, Map<Selector, SelectorConstraints>> selectorMap) {
-    Selector selector = dynamicUse.selector;
-    String name = selector.name;
-    ReceiverConstraint mask = dynamicUse.mask;
-    Map<Selector, SelectorConstraints> selectors = selectorMap.putIfAbsent(
-        name, () => new Maplet<Selector, SelectorConstraints>());
-    UniverseSelectorConstraints constraints =
-        selectors.putIfAbsent(selector, () {
-      return selectorConstraintsStrategy.createSelectorConstraints(selector);
-    });
-    return constraints.addReceiverConstraint(mask);
-  }
-
-  Map<Selector, SelectorConstraints> _asUnmodifiable(
-      Map<Selector, SelectorConstraints> map) {
-    if (map == null) return null;
-    return new UnmodifiableMapView(map);
-  }
-
-  Map<Selector, SelectorConstraints> invocationsByName(String name) {
-    return _asUnmodifiable(_invokedNames[name]);
-  }
-
-  Map<Selector, SelectorConstraints> getterInvocationsByName(String name) {
-    return _asUnmodifiable(_invokedGetters[name]);
-  }
-
-  Map<Selector, SelectorConstraints> setterInvocationsByName(String name) {
-    return _asUnmodifiable(_invokedSetters[name]);
-  }
-
-  void forEachInvokedName(
-      f(String name, Map<Selector, SelectorConstraints> selectors)) {
-    _invokedNames.forEach(f);
-  }
-
-  void forEachInvokedGetter(
-      f(String name, Map<Selector, SelectorConstraints> selectors)) {
-    _invokedGetters.forEach(f);
-  }
-
-  void forEachInvokedSetter(
-      f(String name, Map<Selector, SelectorConstraints> selectors)) {
-    _invokedSetters.forEach(f);
-  }
-
-  DartType registerIsCheck(DartType type, Compiler compiler) {
-    type.computeUnaliased(compiler.resolution);
-    type = type.unaliased;
-    // Even in checked mode, type annotations for return type and argument
-    // types do not imply type checks, so there should never be a check
-    // against the type variable of a typedef.
-    isChecks.add(type);
-    return type;
-  }
-
-  void registerStaticUse(StaticUse staticUse) {
-    Element element = staticUse.element;
-    if (Elements.isStaticOrTopLevel(element) && element.isField) {
-      allReferencedStaticFields.add(element);
-    }
-    switch (staticUse.kind) {
-      case StaticUseKind.STATIC_TEAR_OFF:
-        staticFunctionsNeedingGetter.add(element);
-        break;
-      case StaticUseKind.SUPER_TEAR_OFF:
-        methodsNeedingSuperGetter.add(element);
-        break;
-      case StaticUseKind.SUPER_FIELD_SET:
-      case StaticUseKind.FIELD_SET:
-      case StaticUseKind.GENERAL:
-      case StaticUseKind.CLOSURE:
-      case StaticUseKind.FIELD_GET:
-        break;
-    }
-  }
-
-  void forgetElement(Element element, Compiler compiler) {
-    _directlyInstantiatedClasses.remove(element);
-    if (element is ClassElement) {
-      assert(invariant(element, element.thisType.isRaw,
-          message: 'Generic classes not supported (${element.thisType}).'));
-      _instantiatedTypes..remove(element.rawType)..remove(element.thisType);
-    }
-  }
-}
diff --git a/pkg/compiler/lib/src/universe/use.dart b/pkg/compiler/lib/src/universe/use.dart
index 543e2bd..f399509 100644
--- a/pkg/compiler/lib/src/universe/use.dart
+++ b/pkg/compiler/lib/src/universe/use.dart
@@ -24,7 +24,7 @@
 import '../world.dart' show World;
 import 'call_structure.dart' show CallStructure;
 import 'selector.dart' show Selector;
-import 'universe.dart' show ReceiverConstraint;
+import 'world_builder.dart' show ReceiverConstraint;
 
 enum DynamicUseKind { INVOKE, GET, SET, }
 
@@ -71,6 +71,11 @@
   FIELD_GET,
   FIELD_SET,
   CLOSURE,
+  CONSTRUCTOR_INVOKE,
+  CONST_CONSTRUCTOR_INVOKE,
+  REDIRECTION,
+  DIRECT_INVOKE,
+  DIRECT_USE,
 }
 
 /// Statically known use of an [Element].
@@ -80,11 +85,14 @@
   final Element element;
   final StaticUseKind kind;
   final int hashCode;
+  final DartType type;
 
-  StaticUse.internal(Element element, StaticUseKind kind)
+  StaticUse.internal(Element element, StaticUseKind kind,
+      [DartType type = null])
       : this.element = element,
         this.kind = kind,
-        this.hashCode = Hashing.objectHash(element, Hashing.objectHash(kind)) {
+        this.type = type,
+        this.hashCode = Hashing.objectsHash(element, kind, type) {
     assert(invariant(element, element.isDeclaration,
         message: "Static use element $element must be "
             "the declaration element."));
@@ -202,6 +210,35 @@
     return new StaticUse.internal(element, StaticUseKind.GENERAL);
   }
 
+  /// Direct invocation of a method [element] with the given [callStructure].
+  factory StaticUse.directInvoke(
+      MethodElement element, CallStructure callStructure) {
+    // TODO(johnniwinther): Use the [callStructure].
+    assert(invariant(element, element.isInstanceMember,
+        message: "Direct invoke element $element must be an instance member."));
+    assert(invariant(element, element.isFunction,
+        message: "Direct invoke element $element must be a method."));
+    return new StaticUse.internal(element, StaticUseKind.DIRECT_INVOKE);
+  }
+
+  /// Direct read access of a field or getter [element].
+  factory StaticUse.directGet(MemberElement element) {
+    assert(invariant(element, element.isInstanceMember,
+        message: "Direct get element $element must be an instance member."));
+    assert(invariant(element, element.isField || element.isGetter,
+        message: "Direct get element $element must be a field or a getter."));
+    return new StaticUse.internal(element, StaticUseKind.GENERAL);
+  }
+
+  /// Direct write access of a field [element].
+  factory StaticUse.directSet(FieldElement element) {
+    assert(invariant(element, element.isInstanceMember,
+        message: "Direct set element $element must be an instance member."));
+    assert(invariant(element, element.isField,
+        message: "Direct set element $element must be a field."));
+    return new StaticUse.internal(element, StaticUseKind.GENERAL);
+  }
+
   /// Constructor invocation of [element] with the given [callStructure].
   factory StaticUse.constructorInvoke(
       ConstructorElement element, CallStructure callStructure) {
@@ -209,9 +246,34 @@
     return new StaticUse.internal(element, StaticUseKind.GENERAL);
   }
 
-  /// Constructor redirection to [element].
-  factory StaticUse.constructorRedirect(ConstructorElement element) {
-    return new StaticUse.internal(element, StaticUseKind.GENERAL);
+  /// Constructor invocation of [element] with the given [callStructure] on
+  /// [type].
+  factory StaticUse.typedConstructorInvoke(
+      ConstructorElement element, CallStructure callStructure, DartType type) {
+    assert(invariant(element, type != null,
+        message: "No type provided for constructor invocation."));
+    // TODO(johnniwinther): Use the [callStructure].
+    return new StaticUse.internal(
+        element, StaticUseKind.CONSTRUCTOR_INVOKE, type);
+  }
+
+  /// Constant constructor invocation of [element] with the given
+  /// [callStructure] on [type].
+  factory StaticUse.constConstructorInvoke(
+      ConstructorElement element, CallStructure callStructure, DartType type) {
+    assert(invariant(element, type != null,
+        message: "No type provided for constructor invocation."));
+    // TODO(johnniwinther): Use the [callStructure].
+    return new StaticUse.internal(
+        element, StaticUseKind.CONST_CONSTRUCTOR_INVOKE, type);
+  }
+
+  /// Constructor redirection to [element] on [type].
+  factory StaticUse.constructorRedirect(
+      ConstructorElement element, InterfaceType type) {
+    assert(invariant(element, type != null,
+        message: "No type provided for constructor invocation."));
+    return new StaticUse.internal(element, StaticUseKind.REDIRECTION, type);
   }
 
   /// Initialization of an instance field [element].
@@ -250,13 +312,18 @@
     return new StaticUse.internal(element, StaticUseKind.GENERAL);
   }
 
+  /// Direct use of [element] as done with `--analyze-all` and `--analyze-main`.
+  factory StaticUse.directUse(Element element) {
+    return new StaticUse.internal(element, StaticUseKind.DIRECT_USE);
+  }
+
   bool operator ==(other) {
     if (identical(this, other)) return true;
     if (other is! StaticUse) return false;
-    return element == other.element && kind == other.kind;
+    return element == other.element && kind == other.kind && type == other.type;
   }
 
-  String toString() => 'StaticUse($element,$kind)';
+  String toString() => 'StaticUse($element,$kind,$type)';
 }
 
 enum TypeUseKind {
@@ -266,6 +333,8 @@
   CATCH_TYPE,
   TYPE_LITERAL,
   INSTANTIATION,
+  MIRROR_INSTANTIATION,
+  NATIVE_INSTANTIATION,
 }
 
 /// Use of a [DartType].
@@ -309,6 +378,16 @@
     return new TypeUse.internal(type, TypeUseKind.INSTANTIATION);
   }
 
+  /// [type] used in an instantiation through mirrors.
+  factory TypeUse.mirrorInstantiation(InterfaceType type) {
+    return new TypeUse.internal(type, TypeUseKind.MIRROR_INSTANTIATION);
+  }
+
+  /// [type] used in a native instantiation.
+  factory TypeUse.nativeInstantiation(InterfaceType type) {
+    return new TypeUse.internal(type, TypeUseKind.NATIVE_INSTANTIATION);
+  }
+
   bool operator ==(other) {
     if (identical(this, other)) return true;
     if (other is! TypeUse) return false;
diff --git a/pkg/compiler/lib/src/universe/world_builder.dart b/pkg/compiler/lib/src/universe/world_builder.dart
new file mode 100644
index 0000000..49deb8e
--- /dev/null
+++ b/pkg/compiler/lib/src/universe/world_builder.dart
@@ -0,0 +1,934 @@
+// Copyright (c) 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 universe;
+
+import 'dart:collection';
+
+import '../cache_strategy.dart';
+import '../common.dart';
+import '../common/backend_api.dart' show Backend;
+import '../common/resolution.dart' show Resolution;
+import '../compiler.dart' show Compiler;
+import '../core_types.dart' show CoreClasses;
+import '../dart_types.dart';
+import '../elements/elements.dart';
+import '../universe/class_set.dart' show Instantiation;
+import '../util/util.dart';
+import '../world.dart' show World, ClosedWorld, OpenWorld, WorldImpl;
+import 'selector.dart' show Selector;
+import 'use.dart' show DynamicUse, DynamicUseKind, StaticUse, StaticUseKind;
+
+/// The known constraint on receiver for a dynamic call site.
+///
+/// This can for instance be used to constrain this dynamic call to `foo` to
+/// 'receivers of the exact instance `Bar`':
+///
+///     class Bar {
+///        void foo() {}
+///     }
+///     main() => new Bar().foo();
+///
+abstract class ReceiverConstraint {
+  /// Returns whether [element] is a potential target when being
+  /// invoked on a receiver with this constraint. [selector] is used to ensure
+  /// library privacy is taken into account.
+  bool canHit(Element element, Selector selector, World world);
+
+  /// Returns whether this [TypeMask] applied to [selector] can hit a
+  /// [noSuchMethod].
+  bool needsNoSuchMethodHandling(Selector selector, World world);
+}
+
+/// The combined constraints on receivers all the dynamic call sites of the same
+/// selector.
+///
+/// For instance for these calls
+///
+///     class A {
+///        foo(a, b) {}
+///     }
+///     class B {
+///        foo(a, b) {}
+///     }
+///     class C {
+///        foo(a, b) {}
+///     }
+///     new A().foo(a, b);
+///     new B().foo(0, 42);
+///
+/// the selector constraints for dynamic calls to 'foo' with two positional
+/// arguments could be 'receiver of exact instance `A` or `B`'.
+abstract class SelectorConstraints {
+  /// Returns `true` if [selector] applies to [element] under these constraints
+  /// given the closed [world].
+  ///
+  /// Consider for instance in this world:
+  ///
+  ///     class A {
+  ///        foo(a, b) {}
+  ///     }
+  ///     class B {
+  ///        foo(a, b) {}
+  ///     }
+  ///     new A().foo(a, b);
+  ///
+  /// Ideally the selector constraints for calls `foo` with two positional
+  /// arguments apply to `A.foo` but `B.foo`.
+  bool applies(Element element, Selector selector, World world);
+
+  /// Returns `true` if at least one of the receivers matching these constraints
+  /// in the closed [world] have no implementation matching [selector].
+  ///
+  /// For instance for this code snippet
+  ///
+  ///     class A {}
+  ///     class B { foo() {} }
+  ///     m(b) => (b ? new A() : new B()).foo();
+  ///
+  /// the potential receiver `new A()` has no implementation of `foo` and thus
+  /// needs to handle the call through its `noSuchMethod` handler.
+  bool needsNoSuchMethodHandling(Selector selector, World world);
+}
+
+/// A mutable [SelectorConstraints] used in [WorldBuilder].
+abstract class UniverseSelectorConstraints extends SelectorConstraints {
+  /// Adds [constraint] to these selector constraints. Return `true` if the set
+  /// of potential receivers expanded due to the new constraint.
+  bool addReceiverConstraint(ReceiverConstraint constraint);
+}
+
+/// Strategy for computing the constraints on potential receivers of dynamic
+/// call sites.
+abstract class SelectorConstraintsStrategy {
+  /// Create a [UniverseSelectorConstraints] to represent the global receiver
+  /// constraints for dynamic call sites with [selector].
+  UniverseSelectorConstraints createSelectorConstraints(Selector selector);
+}
+
+/// The [WorldBuilder] is an auxiliary class used in the process of computing
+/// the [ClosedWorld].
+// TODO(johnniwinther): Move common implementation to a [WorldBuilderBase] when
+// universes and worlds have been unified.
+abstract class WorldBuilder {
+  /// All directly instantiated classes, that is, classes with a generative
+  /// constructor that has been called directly and not only through a
+  /// super-call.
+  // TODO(johnniwinther): Improve semantic precision.
+  Iterable<ClassElement> get directlyInstantiatedClasses;
+
+  /// All types that are checked either through is, as or checked mode checks.
+  Iterable<DartType> get isChecks;
+
+  /// Registers that [type] is checked in this universe. The unaliased type is
+  /// returned.
+  DartType registerIsCheck(DartType type, Resolution resolution);
+
+  /// All directly instantiated types, that is, the types of the directly
+  /// instantiated classes.
+  // TODO(johnniwinther): Improve semantic precision.
+  Iterable<DartType> get instantiatedTypes;
+
+  /// Returns `true` if [member] is invoked as a setter.
+  bool hasInvokedSetter(Element member, World world);
+}
+
+abstract class ResolutionWorldBuilder implements WorldBuilder {
+  /// Set of (live) local functions (closures) whose signatures reference type
+  /// variables.
+  ///
+  /// A live function is one whose enclosing member function has been enqueued.
+  Set<Element> get closuresWithFreeTypeVariables;
+
+  /// Set of (live) `call` methods whose signatures reference type variables.
+  ///
+  /// A live `call` method is one whose enclosing class has been instantiated.
+  Iterable<Element> get callMethodsWithFreeTypeVariables;
+
+  /// Set of all closures in the program. Used by the mirror tracking system
+  /// to find all live closure instances.
+  Iterable<LocalFunctionElement> get allClosures;
+
+  /// Set of methods in instantiated classes that are potentially closurized.
+  Iterable<Element> get closurizedMembers;
+
+  /// Returns `true` if [cls] is considered to be implemented by an
+  /// instantiated class, either directly, through subclasses or through
+  /// subtypes. The latter case only contains spurious information from
+  /// instantiations through factory constructors and mixins.
+  bool isImplemented(ClassElement cls);
+
+  /// Set of all fields that are statically known to be written to.
+  Iterable<Element> get fieldSetters;
+
+  /// Call [f] for all classes with instantiated types. This includes the
+  /// directly and abstractly instantiated classes but also classes whose type
+  /// arguments are used in live factory constructors.
+  void forEachInstantiatedClass(f(ClassElement cls, InstantiationInfo info));
+
+  /// `true` of `Object.runtimeType` is supported.
+  bool get hasRuntimeTypeSupport;
+
+  /// `true` of use of the `dart:isolate` library is supported.
+  bool get hasIsolateSupport;
+
+  /// `true` of `Function.apply` is supported.
+  bool get hasFunctionApplySupport;
+
+  /// The [OpenWorld] being created by this world builder.
+  // TODO(johnniwinther): Merge this with [ResolutionWorldBuilder].
+  OpenWorld get openWorld;
+}
+
+/// The type and kind of an instantiation registered through
+/// `ResolutionWorldBuilder.registerTypeInstantiation`.
+class Instance {
+  final InterfaceType type;
+  final Instantiation kind;
+  final bool isRedirection;
+
+  Instance(this.type, this.kind, {this.isRedirection: false});
+
+  int get hashCode {
+    return Hashing.objectHash(
+        type, Hashing.objectHash(kind, Hashing.objectHash(isRedirection)));
+  }
+
+  bool operator ==(other) {
+    if (identical(this, other)) return true;
+    if (other is! Instance) return false;
+    return type == other.type &&
+        kind == other.kind &&
+        isRedirection == other.isRedirection;
+  }
+
+  String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.write(type);
+    if (kind == Instantiation.DIRECTLY_INSTANTIATED) {
+      sb.write(' directly');
+    } else if (kind == Instantiation.ABSTRACTLY_INSTANTIATED) {
+      sb.write(' abstractly');
+    } else if (kind == Instantiation.UNINSTANTIATED) {
+      sb.write(' none');
+    }
+    if (isRedirection) {
+      sb.write(' redirect');
+    }
+    return sb.toString();
+  }
+}
+
+/// Information about instantiations of a class.
+class InstantiationInfo {
+  /// A map from constructor of the class to their instantiated types.
+  ///
+  /// For instance
+  ///
+  ///    import 'dart:html';
+  ///
+  ///    abstract class AbstractClass<S> {
+  ///      factory AbstractClass.a() = Class<S>.a;
+  ///      factory AbstractClass.b() => new Class<S>.b();
+  ///    }
+  ///    class Class<T> implements AbstractClass<T> {
+  ///      Class.a();
+  ///      Class.b();
+  ///      factory Class.c() = Class.b<T>;
+  ///    }
+  ///
+  ///
+  ///    main() {
+  ///      new Class.a();
+  ///      new Class<int>.a();
+  ///      new Class<String>.b();
+  ///      new Class<num>.c();
+  ///      new AbstractClass<double>.a();
+  ///      new AbstractClass<bool>.b();
+  ///      new DivElement(); // native instantiation
+  ///    }
+  ///
+  /// will generate the mappings
+  ///
+  ///    AbstractClass: {
+  ///      AbstractClass.a: {
+  ///        AbstractClass<double> none, // from `new AbstractClass<double>.a()`
+  ///      },
+  ///      AbstractClass.b: {
+  ///        AbstractClass<bool> none, // from `new AbstractClass<bool>.b()`
+  ///      },
+  ///    },
+  ///    Class: {
+  ///      Class.a: {
+  ///        Class directly, // from `new Class.a()`
+  ///        Class<int> directly, // from `new Class<int>.a()`
+  ///        Class<S> directly redirect, // from `factory AbstractClass.a`
+  ///      },
+  ///      Class.b: {
+  ///        Class<String> directly, // from `new Class<String>.b()`
+  ///        Class<T> directly redirect, // from `factory Class.c`
+  ///        Class<S> directly, // from `factory AbstractClass.b`
+  ///      },
+  ///      Class.c: {
+  ///        Class<num> directly, // from `new Class<num>.c()`
+  ///      },
+  ///    },
+  ///    DivElement: {
+  ///      DivElement: {
+  ///        DivElement abstractly, // from `new DivElement()`
+  ///      },
+  ///    }
+  ///
+  /// If the constructor is unknown, for instance for native or mirror usage,
+  /// `null` is used as key.
+  Map<ConstructorElement, Set<Instance>> instantiationMap;
+
+  /// Register [type] as the instantiation [kind] using [constructor].
+  void addInstantiation(
+      ConstructorElement constructor, InterfaceType type, Instantiation kind,
+      {bool isRedirection: false}) {
+    instantiationMap ??= <ConstructorElement, Set<Instance>>{};
+    instantiationMap
+        .putIfAbsent(constructor, () => new Set<Instance>())
+        .add(new Instance(type, kind, isRedirection: isRedirection));
+    switch (kind) {
+      case Instantiation.DIRECTLY_INSTANTIATED:
+        isDirectlyInstantiated = true;
+        break;
+      case Instantiation.ABSTRACTLY_INSTANTIATED:
+        isAbstractlyInstantiated = true;
+        break;
+      case Instantiation.UNINSTANTIATED:
+        break;
+      default:
+        throw new StateError("Instantiation $kind is not allowed.");
+    }
+  }
+
+  /// `true` if the class is either directly or abstractly instantiated.
+  bool get hasInstantiation =>
+      isDirectlyInstantiated || isAbstractlyInstantiated;
+
+  /// `true` if the class is directly instantiated.
+  bool isDirectlyInstantiated = false;
+
+  /// `true` if the class is abstractly instantiated.
+  bool isAbstractlyInstantiated = false;
+
+  String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.write('InstantiationInfo[');
+    if (instantiationMap != null) {
+      bool needsComma = false;
+      instantiationMap
+          .forEach((ConstructorElement constructor, Set<Instance> set) {
+        if (needsComma) {
+          sb.write(', ');
+        }
+        if (constructor != null) {
+          sb.write(constructor);
+        } else {
+          sb.write('<unknown>');
+        }
+        sb.write(': ');
+        sb.write(set);
+        needsComma = true;
+      });
+    }
+    sb.write(']');
+    return sb.toString();
+  }
+}
+
+class ResolutionWorldBuilderImpl implements ResolutionWorldBuilder {
+  /// Instantiation information for all classes with instantiated types.
+  ///
+  /// Invariant: Elements are declaration elements.
+  final Map<ClassElement, InstantiationInfo> _instantiationInfo =
+      <ClassElement, InstantiationInfo>{};
+
+  /// Classes implemented by directly instantiated classes.
+  final Set<ClassElement> _implementedClasses = new Set<ClassElement>();
+
+  /// The set of all referenced static fields.
+  ///
+  /// Invariant: Elements are declaration elements.
+  final Set<FieldElement> allReferencedStaticFields = new Set<FieldElement>();
+
+  /**
+   * Documentation wanted -- johnniwinther
+   *
+   * Invariant: Elements are declaration elements.
+   */
+  final Set<FunctionElement> methodsNeedingSuperGetter =
+      new Set<FunctionElement>();
+  final Map<String, Map<Selector, SelectorConstraints>> _invokedNames =
+      <String, Map<Selector, SelectorConstraints>>{};
+  final Map<String, Map<Selector, SelectorConstraints>> _invokedGetters =
+      <String, Map<Selector, SelectorConstraints>>{};
+  final Map<String, Map<Selector, SelectorConstraints>> _invokedSetters =
+      <String, Map<Selector, SelectorConstraints>>{};
+
+  /// Fields set.
+  final Set<Element> fieldSetters = new Set<Element>();
+  final Set<DartType> isChecks = new Set<DartType>();
+
+  /**
+   * Set of (live) [:call:] methods whose signatures reference type variables.
+   *
+   * A live [:call:] method is one whose enclosing class has been instantiated.
+   */
+  final Set<Element> callMethodsWithFreeTypeVariables = new Set<Element>();
+
+  /**
+   * Set of (live) local functions (closures) whose signatures reference type
+   * variables.
+   *
+   * A live function is one whose enclosing member function has been enqueued.
+   */
+  final Set<Element> closuresWithFreeTypeVariables = new Set<Element>();
+
+  /**
+   * Set of all closures in the program. Used by the mirror tracking system
+   * to find all live closure instances.
+   */
+  final Set<LocalFunctionElement> allClosures = new Set<LocalFunctionElement>();
+
+  /**
+   * Set of methods in instantiated classes that are potentially
+   * closurized.
+   */
+  final Set<Element> closurizedMembers = new Set<Element>();
+
+  final SelectorConstraintsStrategy selectorConstraintsStrategy;
+
+  bool hasRuntimeTypeSupport = false;
+  bool hasIsolateSupport = false;
+  bool hasFunctionApplySupport = false;
+
+  /// Used for testing the new more precise computation of instantiated types
+  /// and classes.
+  bool useInstantiationMap = false;
+
+  OpenWorld _openWorld;
+
+  ResolutionWorldBuilderImpl(Backend backend, CoreClasses coreClasses,
+      CacheStrategy cacheStrategy, this.selectorConstraintsStrategy) {
+    _openWorld = new WorldImpl(this, backend, coreClasses, cacheStrategy);
+  }
+
+  OpenWorld get openWorld => _openWorld;
+
+  /// All directly instantiated classes, that is, classes with a generative
+  /// constructor that has been called directly and not only through a
+  /// super-call.
+  // TODO(johnniwinther): Improve semantic precision.
+  Iterable<ClassElement> get directlyInstantiatedClasses {
+    Set<ClassElement> classes = new Set<ClassElement>();
+    getInstantiationMap().forEach((ClassElement cls, InstantiationInfo info) {
+      if (info.hasInstantiation) {
+        classes.add(cls);
+      }
+    });
+    return classes;
+  }
+
+  /// All directly instantiated types, that is, the types of the directly
+  /// instantiated classes.
+  ///
+  /// See [directlyInstantiatedClasses].
+  // TODO(johnniwinther): Improve semantic precision.
+  Iterable<DartType> get instantiatedTypes {
+    Set<InterfaceType> types = new Set<InterfaceType>();
+    getInstantiationMap().forEach((_, InstantiationInfo info) {
+      if (info.instantiationMap != null) {
+        for (Set<Instance> instances in info.instantiationMap.values) {
+          for (Instance instance in instances) {
+            types.add(instance.type);
+          }
+        }
+      }
+    });
+    return types;
+  }
+
+  /// Returns `true` if [cls] is considered to be implemented by an
+  /// instantiated class, either directly, through subclasses or through
+  /// subtypes. The latter case only contains spurious information from
+  /// instantiations through factory constructors and mixins.
+  // TODO(johnniwinther): Improve semantic precision.
+  bool isImplemented(ClassElement cls) {
+    return _implementedClasses.contains(cls.declaration);
+  }
+
+  /// Register [type] as (directly) instantiated.
+  ///
+  /// If [byMirrors] is `true`, the instantiation is through mirrors.
+  // TODO(johnniwinther): Fully enforce the separation between exact, through
+  // subclass and through subtype instantiated types/classes.
+  // TODO(johnniwinther): Support unknown type arguments for generic types.
+  void registerTypeInstantiation(InterfaceType type,
+      {ConstructorElement constructor,
+      bool byMirrors: false,
+      bool isNative: false,
+      bool isRedirection: false,
+      void onImplemented(ClassElement cls)}) {
+    ClassElement cls = type.element;
+    InstantiationInfo info =
+        _instantiationInfo.putIfAbsent(cls, () => new InstantiationInfo());
+    Instantiation kind = Instantiation.UNINSTANTIATED;
+    if (!cls.isAbstract
+        // We can't use the closed-world assumption with native abstract
+        // classes; a native abstract class may have non-abstract subclasses
+        // not declared to the program.  Instances of these classes are
+        // indistinguishable from the abstract class.
+        ||
+        isNative
+        // Likewise, if this registration comes from the mirror system,
+        // all bets are off.
+        // TODO(herhut): Track classes required by mirrors seperately.
+        ||
+        byMirrors) {
+      if (isNative || byMirrors) {
+        kind = Instantiation.ABSTRACTLY_INSTANTIATED;
+      } else {
+        kind = Instantiation.DIRECTLY_INSTANTIATED;
+      }
+    }
+    info.addInstantiation(constructor, type, kind,
+        isRedirection: isRedirection);
+
+    // TODO(johnniwinther): Use [_instantiationInfo] to compute this information
+    // instead.
+    if (_implementedClasses.add(cls)) {
+      onImplemented(cls);
+      cls.allSupertypes.forEach((InterfaceType supertype) {
+        if (_implementedClasses.add(supertype.element)) {
+          onImplemented(supertype.element);
+        }
+      });
+    }
+  }
+
+  @override
+  void forEachInstantiatedClass(f(ClassElement cls, InstantiationInfo info)) {
+    getInstantiationMap().forEach(f);
+  }
+
+  bool _hasMatchingSelector(Map<Selector, SelectorConstraints> selectors,
+      Element member, OpenWorld world) {
+    if (selectors == null) return false;
+    for (Selector selector in selectors.keys) {
+      if (selector.appliesUnnamed(member)) {
+        SelectorConstraints masks = selectors[selector];
+        if (masks.applies(member, selector, world)) {
+          return true;
+        }
+      }
+    }
+    return false;
+  }
+
+  /// Returns the instantiation map used for computing the closed world.
+  ///
+  /// If [useInstantiationMap] is `true`, redirections are removed and
+  /// redirecting factories are converted to their effective target and type.
+  Map<ClassElement, InstantiationInfo> getInstantiationMap() {
+    if (!useInstantiationMap) return _instantiationInfo;
+
+    Map<ClassElement, InstantiationInfo> instantiationMap =
+        <ClassElement, InstantiationInfo>{};
+
+    InstantiationInfo infoFor(ClassElement cls) {
+      return instantiationMap.putIfAbsent(cls, () => new InstantiationInfo());
+    }
+
+    _instantiationInfo.forEach((cls, info) {
+      if (info.instantiationMap != null) {
+        info.instantiationMap
+            .forEach((ConstructorElement constructor, Set<Instance> set) {
+          for (Instance instance in set) {
+            if (instance.isRedirection) {
+              continue;
+            }
+            if (constructor == null || !constructor.isRedirectingFactory) {
+              infoFor(cls)
+                  .addInstantiation(constructor, instance.type, instance.kind);
+            } else {
+              ConstructorElement target = constructor.effectiveTarget;
+              InterfaceType targetType =
+                  constructor.computeEffectiveTargetType(instance.type);
+              Instantiation kind = Instantiation.DIRECTLY_INSTANTIATED;
+              if (target.enclosingClass.isAbstract) {
+                // If target is a factory constructor on an abstract class.
+                kind = Instantiation.UNINSTANTIATED;
+              }
+              infoFor(targetType.element)
+                  .addInstantiation(target, targetType, kind);
+            }
+          }
+        });
+      }
+    });
+    return instantiationMap;
+  }
+
+  bool hasInvocation(Element member, OpenWorld world) {
+    return _hasMatchingSelector(_invokedNames[member.name], member, world);
+  }
+
+  bool hasInvokedGetter(Element member, OpenWorld world) {
+    return _hasMatchingSelector(_invokedGetters[member.name], member, world) ||
+        member.isFunction && methodsNeedingSuperGetter.contains(member);
+  }
+
+  bool hasInvokedSetter(Element member, OpenWorld world) {
+    return _hasMatchingSelector(_invokedSetters[member.name], member, world);
+  }
+
+  bool registerDynamicUse(DynamicUse dynamicUse) {
+    switch (dynamicUse.kind) {
+      case DynamicUseKind.INVOKE:
+        return _registerNewSelector(dynamicUse, _invokedNames);
+      case DynamicUseKind.GET:
+        return _registerNewSelector(dynamicUse, _invokedGetters);
+      case DynamicUseKind.SET:
+        return _registerNewSelector(dynamicUse, _invokedSetters);
+    }
+  }
+
+  bool _registerNewSelector(DynamicUse dynamicUse,
+      Map<String, Map<Selector, SelectorConstraints>> selectorMap) {
+    Selector selector = dynamicUse.selector;
+    String name = selector.name;
+    ReceiverConstraint mask = dynamicUse.mask;
+    Map<Selector, SelectorConstraints> selectors = selectorMap.putIfAbsent(
+        name, () => new Maplet<Selector, SelectorConstraints>());
+    UniverseSelectorConstraints constraints =
+        selectors.putIfAbsent(selector, () {
+      return selectorConstraintsStrategy.createSelectorConstraints(selector);
+    });
+    return constraints.addReceiverConstraint(mask);
+  }
+
+  DartType registerIsCheck(DartType type, Resolution resolution) {
+    type.computeUnaliased(resolution);
+    type = type.unaliased;
+    // Even in checked mode, type annotations for return type and argument
+    // types do not imply type checks, so there should never be a check
+    // against the type variable of a typedef.
+    isChecks.add(type);
+    return type;
+  }
+
+  void registerStaticUse(StaticUse staticUse) {
+    Element element = staticUse.element;
+    if (Elements.isStaticOrTopLevel(element) && element.isField) {
+      allReferencedStaticFields.add(element);
+    }
+    switch (staticUse.kind) {
+      case StaticUseKind.SUPER_FIELD_SET:
+      case StaticUseKind.FIELD_SET:
+        fieldSetters.add(element);
+        break;
+      case StaticUseKind.SUPER_TEAR_OFF:
+        methodsNeedingSuperGetter.add(element);
+        break;
+      case StaticUseKind.GENERAL:
+      case StaticUseKind.DIRECT_USE:
+      case StaticUseKind.STATIC_TEAR_OFF:
+      case StaticUseKind.FIELD_GET:
+      case StaticUseKind.CONSTRUCTOR_INVOKE:
+      case StaticUseKind.CONST_CONSTRUCTOR_INVOKE:
+      case StaticUseKind.REDIRECTION:
+        break;
+      case StaticUseKind.CLOSURE:
+        allClosures.add(element);
+        break;
+      case StaticUseKind.DIRECT_INVOKE:
+        invariant(
+            element, 'Direct static use is not supported for resolution.');
+        break;
+    }
+  }
+
+  void forgetElement(Element element, Compiler compiler) {
+    allClosures.remove(element);
+    slowDirectlyNestedClosures(element).forEach(compiler.forgetElement);
+    closurizedMembers.remove(element);
+    fieldSetters.remove(element);
+    _instantiationInfo.remove(element);
+  }
+
+  // TODO(ahe): Replace this method with something that is O(1), for example,
+  // by using a map.
+  List<LocalFunctionElement> slowDirectlyNestedClosures(Element element) {
+    // Return new list to guard against concurrent modifications.
+    return new List<LocalFunctionElement>.from(
+        allClosures.where((LocalFunctionElement closure) {
+      return closure.executableContext == element;
+    }));
+  }
+}
+
+/// World builder specific to codegen.
+///
+/// This adds additional access to liveness of selectors and elements.
+abstract class CodegenWorldBuilder implements WorldBuilder {
+  void forEachInvokedName(
+      f(String name, Map<Selector, SelectorConstraints> selectors));
+
+  void forEachInvokedGetter(
+      f(String name, Map<Selector, SelectorConstraints> selectors));
+
+  void forEachInvokedSetter(
+      f(String name, Map<Selector, SelectorConstraints> selectors));
+
+  bool hasInvokedGetter(Element member, ClosedWorld world);
+
+  Map<Selector, SelectorConstraints> invocationsByName(String name);
+
+  Map<Selector, SelectorConstraints> getterInvocationsByName(String name);
+
+  Map<Selector, SelectorConstraints> setterInvocationsByName(String name);
+
+  Iterable<FunctionElement> get staticFunctionsNeedingGetter;
+  Iterable<FunctionElement> get methodsNeedingSuperGetter;
+
+  /// The set of all referenced static fields.
+  ///
+  /// Invariant: Elements are declaration elements.
+  Iterable<FieldElement> get allReferencedStaticFields;
+}
+
+class CodegenWorldBuilderImpl implements CodegenWorldBuilder {
+  /// The set of all directly instantiated classes, that is, classes with a
+  /// generative constructor that has been called directly and not only through
+  /// a super-call.
+  ///
+  /// Invariant: Elements are declaration elements.
+  // TODO(johnniwinther): [_directlyInstantiatedClasses] and
+  // [_instantiatedTypes] sets should be merged.
+  final Set<ClassElement> _directlyInstantiatedClasses =
+      new Set<ClassElement>();
+
+  /// The set of all directly instantiated types, that is, the types of the
+  /// directly instantiated classes.
+  ///
+  /// See [_directlyInstantiatedClasses].
+  final Set<DartType> _instantiatedTypes = new Set<DartType>();
+
+  /// Classes implemented by directly instantiated classes.
+  final Set<ClassElement> _implementedClasses = new Set<ClassElement>();
+
+  /// The set of all referenced static fields.
+  ///
+  /// Invariant: Elements are declaration elements.
+  final Set<FieldElement> allReferencedStaticFields = new Set<FieldElement>();
+
+  /**
+   * Documentation wanted -- johnniwinther
+   *
+   * Invariant: Elements are declaration elements.
+   */
+  final Set<FunctionElement> staticFunctionsNeedingGetter =
+      new Set<FunctionElement>();
+  final Set<FunctionElement> methodsNeedingSuperGetter =
+      new Set<FunctionElement>();
+  final Map<String, Map<Selector, SelectorConstraints>> _invokedNames =
+      <String, Map<Selector, SelectorConstraints>>{};
+  final Map<String, Map<Selector, SelectorConstraints>> _invokedGetters =
+      <String, Map<Selector, SelectorConstraints>>{};
+  final Map<String, Map<Selector, SelectorConstraints>> _invokedSetters =
+      <String, Map<Selector, SelectorConstraints>>{};
+
+  final Set<DartType> isChecks = new Set<DartType>();
+
+  final SelectorConstraintsStrategy selectorConstraintsStrategy;
+
+  CodegenWorldBuilderImpl(this.selectorConstraintsStrategy);
+
+  /// All directly instantiated classes, that is, classes with a generative
+  /// constructor that has been called directly and not only through a
+  /// super-call.
+  // TODO(johnniwinther): Improve semantic precision.
+  Iterable<ClassElement> get directlyInstantiatedClasses {
+    return _directlyInstantiatedClasses;
+  }
+
+  /// All directly instantiated types, that is, the types of the directly
+  /// instantiated classes.
+  ///
+  /// See [directlyInstantiatedClasses].
+  // TODO(johnniwinther): Improve semantic precision.
+  Iterable<DartType> get instantiatedTypes => _instantiatedTypes;
+
+  /// Register [type] as (directly) instantiated.
+  ///
+  /// If [byMirrors] is `true`, the instantiation is through mirrors.
+  // TODO(johnniwinther): Fully enforce the separation between exact, through
+  // subclass and through subtype instantiated types/classes.
+  // TODO(johnniwinther): Support unknown type arguments for generic types.
+  void registerTypeInstantiation(InterfaceType type,
+      {bool byMirrors: false,
+      bool isNative: false,
+      void onImplemented(ClassElement cls)}) {
+    _instantiatedTypes.add(type);
+    ClassElement cls = type.element;
+    if (!cls.isAbstract
+        // We can't use the closed-world assumption with native abstract
+        // classes; a native abstract class may have non-abstract subclasses
+        // not declared to the program.  Instances of these classes are
+        // indistinguishable from the abstract class.
+        ||
+        isNative
+        // Likewise, if this registration comes from the mirror system,
+        // all bets are off.
+        // TODO(herhut): Track classes required by mirrors separately.
+        ||
+        byMirrors) {
+      _directlyInstantiatedClasses.add(cls);
+    }
+
+    // TODO(johnniwinther): Replace this by separate more specific mappings that
+    // include the type arguments.
+    if (_implementedClasses.add(cls)) {
+      onImplemented(cls);
+      cls.allSupertypes.forEach((InterfaceType supertype) {
+        if (_implementedClasses.add(supertype.element)) {
+          onImplemented(supertype.element);
+        }
+      });
+    }
+  }
+
+  bool _hasMatchingSelector(Map<Selector, SelectorConstraints> selectors,
+      Element member, ClosedWorld world) {
+    if (selectors == null) return false;
+    for (Selector selector in selectors.keys) {
+      if (selector.appliesUnnamed(member)) {
+        SelectorConstraints masks = selectors[selector];
+        if (masks.applies(member, selector, world)) {
+          return true;
+        }
+      }
+    }
+    return false;
+  }
+
+  bool hasInvocation(Element member, ClosedWorld world) {
+    return _hasMatchingSelector(_invokedNames[member.name], member, world);
+  }
+
+  bool hasInvokedGetter(Element member, ClosedWorld world) {
+    return _hasMatchingSelector(_invokedGetters[member.name], member, world) ||
+        member.isFunction && methodsNeedingSuperGetter.contains(member);
+  }
+
+  bool hasInvokedSetter(Element member, ClosedWorld world) {
+    return _hasMatchingSelector(_invokedSetters[member.name], member, world);
+  }
+
+  bool registerDynamicUse(DynamicUse dynamicUse) {
+    switch (dynamicUse.kind) {
+      case DynamicUseKind.INVOKE:
+        return _registerNewSelector(dynamicUse, _invokedNames);
+      case DynamicUseKind.GET:
+        return _registerNewSelector(dynamicUse, _invokedGetters);
+      case DynamicUseKind.SET:
+        return _registerNewSelector(dynamicUse, _invokedSetters);
+    }
+  }
+
+  bool _registerNewSelector(DynamicUse dynamicUse,
+      Map<String, Map<Selector, SelectorConstraints>> selectorMap) {
+    Selector selector = dynamicUse.selector;
+    String name = selector.name;
+    ReceiverConstraint mask = dynamicUse.mask;
+    Map<Selector, SelectorConstraints> selectors = selectorMap.putIfAbsent(
+        name, () => new Maplet<Selector, SelectorConstraints>());
+    UniverseSelectorConstraints constraints =
+        selectors.putIfAbsent(selector, () {
+      return selectorConstraintsStrategy.createSelectorConstraints(selector);
+    });
+    return constraints.addReceiverConstraint(mask);
+  }
+
+  Map<Selector, SelectorConstraints> _asUnmodifiable(
+      Map<Selector, SelectorConstraints> map) {
+    if (map == null) return null;
+    return new UnmodifiableMapView(map);
+  }
+
+  Map<Selector, SelectorConstraints> invocationsByName(String name) {
+    return _asUnmodifiable(_invokedNames[name]);
+  }
+
+  Map<Selector, SelectorConstraints> getterInvocationsByName(String name) {
+    return _asUnmodifiable(_invokedGetters[name]);
+  }
+
+  Map<Selector, SelectorConstraints> setterInvocationsByName(String name) {
+    return _asUnmodifiable(_invokedSetters[name]);
+  }
+
+  void forEachInvokedName(
+      f(String name, Map<Selector, SelectorConstraints> selectors)) {
+    _invokedNames.forEach(f);
+  }
+
+  void forEachInvokedGetter(
+      f(String name, Map<Selector, SelectorConstraints> selectors)) {
+    _invokedGetters.forEach(f);
+  }
+
+  void forEachInvokedSetter(
+      f(String name, Map<Selector, SelectorConstraints> selectors)) {
+    _invokedSetters.forEach(f);
+  }
+
+  DartType registerIsCheck(DartType type, Resolution resolution) {
+    type = type.unaliased;
+    // Even in checked mode, type annotations for return type and argument
+    // types do not imply type checks, so there should never be a check
+    // against the type variable of a typedef.
+    isChecks.add(type);
+    return type;
+  }
+
+  void registerStaticUse(StaticUse staticUse) {
+    Element element = staticUse.element;
+    if (Elements.isStaticOrTopLevel(element) && element.isField) {
+      allReferencedStaticFields.add(element);
+    }
+    switch (staticUse.kind) {
+      case StaticUseKind.STATIC_TEAR_OFF:
+        staticFunctionsNeedingGetter.add(element);
+        break;
+      case StaticUseKind.SUPER_TEAR_OFF:
+        methodsNeedingSuperGetter.add(element);
+        break;
+      case StaticUseKind.SUPER_FIELD_SET:
+      case StaticUseKind.FIELD_SET:
+      case StaticUseKind.GENERAL:
+      case StaticUseKind.DIRECT_USE:
+      case StaticUseKind.CLOSURE:
+      case StaticUseKind.FIELD_GET:
+      case StaticUseKind.CONSTRUCTOR_INVOKE:
+      case StaticUseKind.CONST_CONSTRUCTOR_INVOKE:
+      case StaticUseKind.REDIRECTION:
+      case StaticUseKind.DIRECT_INVOKE:
+        break;
+    }
+  }
+
+  void forgetElement(Element element, Compiler compiler) {
+    _directlyInstantiatedClasses.remove(element);
+    if (element is ClassElement) {
+      assert(invariant(element, element.thisType.isRaw,
+          message: 'Generic classes not supported (${element.thisType}).'));
+      _instantiatedTypes..remove(element.rawType)..remove(element.thisType);
+    }
+  }
+}
diff --git a/pkg/compiler/lib/src/universe/world_impact.dart b/pkg/compiler/lib/src/universe/world_impact.dart
index 9012057..2a1afb8 100644
--- a/pkg/compiler/lib/src/universe/world_impact.dart
+++ b/pkg/compiler/lib/src/universe/world_impact.dart
@@ -33,6 +33,8 @@
 
   Iterable<TypeUse> get typeUses => const <TypeUse>[];
 
+  bool get isEmpty => true;
+
   void apply(WorldImpactVisitor visitor) {
     staticUses.forEach(visitor.visitStaticUse);
     dynamicUses.forEach(visitor.visitDynamicUse);
@@ -74,6 +76,18 @@
   Set<StaticUse> _staticUses;
   Set<TypeUse> _typeUses;
 
+  @override
+  bool get isEmpty =>
+      _dynamicUses == null && _staticUses == null && _typeUses == null;
+
+  /// Copy uses in [impact] to this impact builder.
+  void addImpact(WorldImpact impact) {
+    if (impact.isEmpty) return;
+    impact.dynamicUses.forEach(registerDynamicUse);
+    impact.staticUses.forEach(registerStaticUse);
+    impact.typeUses.forEach(registerTypeUse);
+  }
+
   void registerDynamicUse(DynamicUse dynamicUse) {
     assert(dynamicUse != null);
     if (_dynamicUses == null) {
@@ -174,6 +188,14 @@
   TransformedWorldImpact(this.worldImpact);
 
   @override
+  bool get isEmpty {
+    return worldImpact.isEmpty &&
+        _staticUses == null &&
+        _typeUses == null &&
+        _dynamicUses == null;
+  }
+
+  @override
   Iterable<DynamicUse> get dynamicUses {
     return _dynamicUses != null ? _dynamicUses : worldImpact.dynamicUses;
   }
diff --git a/pkg/compiler/lib/src/util/emptyset.dart b/pkg/compiler/lib/src/util/emptyset.dart
index da9942c..26474da 100644
--- a/pkg/compiler/lib/src/util/emptyset.dart
+++ b/pkg/compiler/lib/src/util/emptyset.dart
@@ -32,7 +32,7 @@
 
   Set<E> union(Set<E> other) => new Set.from(other);
   Set<E> intersection(Set<E> other) => this;
-  Set<E> difference(Set<E> other) => this;
+  Set<E> difference(Set<Object> other) => this;
   Set<E> toSet() => new Set();
 }
 
diff --git a/pkg/compiler/lib/src/util/setlet.dart b/pkg/compiler/lib/src/util/setlet.dart
index cd654c1..c9d3fe5 100644
--- a/pkg/compiler/lib/src/util/setlet.dart
+++ b/pkg/compiler/lib/src/util/setlet.dart
@@ -250,7 +250,7 @@
   Setlet<E> intersection(Set<E> other) =>
       new Setlet<E>.from(this.where((e) => other.contains(e)));
 
-  Setlet<E> difference(Set<E> other) =>
+  Setlet<E> difference(Set<Object> other) =>
       new Setlet<E>.from(this.where((e) => !other.contains(e)));
 
   Setlet<E> toSet() {
diff --git a/pkg/compiler/lib/src/util/util.dart b/pkg/compiler/lib/src/util/util.dart
index 397bd6c..dbcc7d3 100644
--- a/pkg/compiler/lib/src/util/util.dart
+++ b/pkg/compiler/lib/src/util/util.dart
@@ -42,6 +42,14 @@
     return mixHashCodeBits(existing, object.hashCode);
   }
 
+  /// Mix the bits of `.hashCode` all non-null objects.
+  static int objectsHash(Object obj1, [Object obj2, Object obj3]) {
+    int hash = 0;
+    if (obj3 != null) hash = objectHash(obj3, hash);
+    if (obj2 != null) hash = objectHash(obj2, hash);
+    return objectHash(obj1, hash);
+  }
+
   /// Mix the bits of the element hash codes of [list] with [existing].
   static int listHash(List list, [int existing = 0]) {
     int h = existing;
diff --git a/pkg/compiler/lib/src/world.dart b/pkg/compiler/lib/src/world.dart
index 40e73a5..c406d07 100644
--- a/pkg/compiler/lib/src/world.dart
+++ b/pkg/compiler/lib/src/world.dart
@@ -4,10 +4,10 @@
 
 library dart2js.world;
 
+import 'cache_strategy.dart';
 import 'closure.dart' show SynthesizedCallMethodElementX;
 import 'common/backend_api.dart' show BackendClasses;
 import 'common.dart';
-import 'compiler.dart' show Compiler;
 import 'core_types.dart' show CoreClasses;
 import 'dart_types.dart';
 import 'elements/elements.dart'
@@ -17,7 +17,7 @@
         FunctionElement,
         MixinApplicationElement,
         TypedefElement,
-        VariableElement;
+        FieldElement;
 import 'js_backend/backend.dart' show JavaScriptBackend;
 import 'ordered_typeset.dart';
 import 'types/masks.dart' show CommonMasks, FlatTypeMask, TypeMask;
@@ -25,6 +25,8 @@
 import 'universe/function_set.dart' show FunctionSet;
 import 'universe/selector.dart' show Selector;
 import 'universe/side_effects.dart' show SideEffects;
+import 'universe/world_builder.dart'
+    show InstantiationInfo, ResolutionWorldBuilder;
 import 'util/util.dart' show Link;
 
 /// Common superinterface for [OpenWorld] and [ClosedWorld].
@@ -45,16 +47,39 @@
   /// Access to core classes used in the Dart language.
   CoreClasses get coreClasses;
 
+  CommonMasks get commonMasks;
+
   /// Returns `true` if [cls] is either directly or indirectly instantiated.
   bool isInstantiated(ClassElement cls);
 
-  /// Returns `true` if [cls] is directly instantiated.
+  /// Returns `true` if [cls] is directly instantiated. This means that at
+  /// runtime instances of exactly [cls] are assumed to exist.
   bool isDirectlyInstantiated(ClassElement cls);
 
+  /// Returns `true` if [cls] is abstractly instantiated. This means that at
+  /// runtime instances of [cls] or unknown subclasses of [cls] are assumed to
+  /// exist.
+  ///
+  /// This is used to mark native and/or reflectable classes as instantiated.
+  /// For native classes we do not know the exact class that instantiates [cls]
+  /// so [cls] here represents the root of the subclasses. For reflectable
+  /// classes we need event abstract classes to be 'live' even though they
+  /// cannot themselves be instantiated.
+  bool isAbstractlyInstantiated(ClassElement cls);
+
+  /// Returns `true` if [cls] is either directly or abstractly instantiated.
+  ///
+  /// See [isDirectlyInstantiated] and [isAbstractlyInstantiated].
+  bool isExplicitlyInstantiated(ClassElement cls);
+
   /// Returns `true` if [cls] is indirectly instantiated, that is through a
   /// subclass.
   bool isIndirectlyInstantiated(ClassElement cls);
 
+  /// Returns `true` if [cls] is abstract and thus can only be instantiated
+  /// through subclasses.
+  bool isAbstract(ClassElement cls);
+
   /// Returns `true` if [cls] is implemented by an instantiated class.
   bool isImplemented(ClassElement cls);
 
@@ -156,6 +181,52 @@
   /// Returns `true` if any subclass of [superclass] implements [type].
   bool hasAnySubclassThatImplements(ClassElement superclass, ClassElement type);
 
+  /// Returns `true` if a call of [selector] on [cls] and/or subclasses/subtypes
+  /// need noSuchMethod handling.
+  ///
+  /// If the receiver is guaranteed to have a member that matches what we're
+  /// looking for, there's no need to introduce a noSuchMethod handler. It will
+  /// never be called.
+  ///
+  /// As an example, consider this class hierarchy:
+  ///
+  ///                   A    <-- noSuchMethod
+  ///                  / \
+  ///                 C   B  <-- foo
+  ///
+  /// If we know we're calling foo on an object of type B we don't have to worry
+  /// about the noSuchMethod method in A because objects of type B implement
+  /// foo. On the other hand, if we end up calling foo on something of type C we
+  /// have to add a handler for it.
+  ///
+  /// If the holders of all user-defined noSuchMethod implementations that might
+  /// be applicable to the receiver type have a matching member for the current
+  /// name and selector, we avoid introducing a noSuchMethod handler.
+  ///
+  /// As an example, consider this class hierarchy:
+  ///
+  ///                        A    <-- foo
+  ///                       / \
+  ///    noSuchMethod -->  B   C  <-- bar
+  ///                      |   |
+  ///                      C   D  <-- noSuchMethod
+  ///
+  /// When calling foo on an object of type A, we know that the implementations
+  /// of noSuchMethod are in the classes B and D that also (indirectly)
+  /// implement foo, so we do not need a handler for it.
+  ///
+  /// If we're calling bar on an object of type D, we don't need the handler
+  /// either because all objects of type D implement bar through inheritance.
+  ///
+  /// If we're calling bar on an object of type A we do need the handler because
+  /// we may have to call B.noSuchMethod since B does not implement bar.
+  bool needsNoSuchMethod(ClassElement cls, Selector selector, ClassQuery query);
+
+  /// Returns whether [element] will be the one used at runtime when being
+  /// invoked on an instance of [cls]. [selector] is used to ensure library
+  /// privacy is taken into account.
+  bool hasElementIn(ClassElement cls, Selector selector, Element element);
+
   /// Returns [ClassHierarchyNode] for [cls] used to model the class hierarchies
   /// of known classes.
   ///
@@ -170,9 +241,10 @@
   /// methods defined in [ClosedWorld].
   ClassSet getClassSet(ClassElement cls);
 
-  // TODO(johnniwinther): Find a better strategy for caching these.
-  @deprecated
-  List<Map<ClassElement, TypeMask>> get canonicalizedTypeMasks;
+  /// Return the cached mask for [base] with the given flags, or
+  /// calls [createMask] to create the mask and cache it.
+  // TODO(johnniwinther): Find a better strategy for caching these?
+  TypeMask getCachedMask(ClassElement base, int flags, TypeMask createMask());
 
   /// Returns the [FunctionSet] containing all live functions in the closed
   /// world.
@@ -195,7 +267,7 @@
   /// Returns the single field that matches a call to [selector] on a
   /// receiver of type [mask]. If multiple targets exist or the single target
   /// is not a field, `null` is returned.
-  VariableElement locateSingleField(Selector selector, TypeMask mask);
+  FieldElement locateSingleField(Selector selector, TypeMask mask);
 
   /// Returns the side effects of executing [element].
   SideEffects getSideEffectsOfElement(Element element);
@@ -265,7 +337,7 @@
   void registerUsedElement(Element element);
   void registerTypedef(TypedefElement typedef);
 
-  ClosedWorld closeWorld();
+  ClosedWorld closeWorld(DiagnosticReporter reporter);
 
   /// Returns an iterable over all mixin applications that mixin [cls].
   Iterable<MixinApplicationElement> allMixinUsesOf(ClassElement cls);
@@ -274,9 +346,15 @@
 class WorldImpl implements ClosedWorld, ClosedWorldRefiner, OpenWorld {
   bool _closed = false;
 
+  TypeMask getCachedMask(ClassElement base, int flags, TypeMask createMask()) {
+    Map<ClassElement, TypeMask> cachedMasks =
+        _canonicalizedTypeMasks[flags] ??= <ClassElement, TypeMask>{};
+    return cachedMasks.putIfAbsent(base, createMask);
+  }
+
   /// Cache of [FlatTypeMask]s grouped by the 8 possible values of the
   /// `FlatTypeMask.flags` property.
-  List<Map<ClassElement, TypeMask>> canonicalizedTypeMasks =
+  final List<Map<ClassElement, TypeMask>> _canonicalizedTypeMasks =
       new List<Map<ClassElement, TypeMask>>.filled(8, null);
 
   bool checkInvariants(ClassElement cls, {bool mustBeInstantiated: true}) {
@@ -336,16 +414,33 @@
   }
 
   @override
+  bool isAbstractlyInstantiated(ClassElement cls) {
+    assert(isClosed);
+    ClassHierarchyNode node = _classHierarchyNodes[cls.declaration];
+    return node != null && node.isAbstractlyInstantiated;
+  }
+
+  @override
+  bool isExplicitlyInstantiated(ClassElement cls) {
+    assert(isClosed);
+    ClassHierarchyNode node = _classHierarchyNodes[cls.declaration];
+    return node != null && node.isExplicitlyInstantiated;
+  }
+
+  @override
   bool isIndirectlyInstantiated(ClassElement cls) {
     assert(isClosed);
     ClassHierarchyNode node = _classHierarchyNodes[cls.declaration];
     return node != null && node.isIndirectlyInstantiated;
   }
 
+  @override
+  bool isAbstract(ClassElement cls) => cls.isAbstract;
+
   /// Returns `true` if [cls] is implemented by an instantiated class.
   bool isImplemented(ClassElement cls) {
     assert(isClosed);
-    return _compiler.resolverWorld.isImplemented(cls);
+    return resolverWorld.isImplemented(cls);
   }
 
   /// Returns an iterable over the directly instantiated classes that extend
@@ -354,7 +449,8 @@
     assert(isClosed);
     ClassHierarchyNode hierarchy = _classHierarchyNodes[cls.declaration];
     if (hierarchy == null) return const <ClassElement>[];
-    return hierarchy.subclassesByMask(ClassHierarchyNode.DIRECTLY_INSTANTIATED);
+    return hierarchy
+        .subclassesByMask(ClassHierarchyNode.EXPLICITLY_INSTANTIATED);
   }
 
   /// Returns an iterable over the directly instantiated classes that extend
@@ -363,7 +459,8 @@
     assert(isClosed);
     ClassHierarchyNode subclasses = _classHierarchyNodes[cls.declaration];
     if (subclasses == null) return const <ClassElement>[];
-    return subclasses.subclassesByMask(ClassHierarchyNode.DIRECTLY_INSTANTIATED,
+    return subclasses.subclassesByMask(
+        ClassHierarchyNode.EXPLICITLY_INSTANTIATED,
         strict: true);
   }
 
@@ -383,7 +480,7 @@
     assert(isClosed);
     ClassHierarchyNode subclasses = _classHierarchyNodes[cls.declaration];
     if (subclasses == null) return;
-    subclasses.forEachSubclass(f, ClassHierarchyNode.DIRECTLY_INSTANTIATED,
+    subclasses.forEachSubclass(f, ClassHierarchyNode.EXPLICITLY_INSTANTIATED,
         strict: true);
   }
 
@@ -394,7 +491,7 @@
     ClassHierarchyNode subclasses = _classHierarchyNodes[cls.declaration];
     if (subclasses == null) return false;
     return subclasses.anySubclass(
-        predicate, ClassHierarchyNode.DIRECTLY_INSTANTIATED,
+        predicate, ClassHierarchyNode.EXPLICITLY_INSTANTIATED,
         strict: true);
   }
 
@@ -406,7 +503,8 @@
     if (classSet == null) {
       return const <ClassElement>[];
     } else {
-      return classSet.subtypesByMask(ClassHierarchyNode.DIRECTLY_INSTANTIATED);
+      return classSet
+          .subtypesByMask(ClassHierarchyNode.EXPLICITLY_INSTANTIATED);
     }
   }
 
@@ -418,7 +516,7 @@
     if (classSet == null) {
       return const <ClassElement>[];
     } else {
-      return classSet.subtypesByMask(ClassHierarchyNode.DIRECTLY_INSTANTIATED,
+      return classSet.subtypesByMask(ClassHierarchyNode.EXPLICITLY_INSTANTIATED,
           strict: true);
     }
   }
@@ -439,7 +537,7 @@
     assert(isClosed);
     ClassSet classSet = _classSets[cls.declaration];
     if (classSet == null) return;
-    classSet.forEachSubtype(f, ClassHierarchyNode.DIRECTLY_INSTANTIATED,
+    classSet.forEachSubtype(f, ClassHierarchyNode.EXPLICITLY_INSTANTIATED,
         strict: true);
   }
 
@@ -450,7 +548,7 @@
     ClassSet classSet = _classSets[cls.declaration];
     if (classSet == null) return false;
     return classSet.anySubtype(
-        predicate, ClassHierarchyNode.DIRECTLY_INSTANTIATED,
+        predicate, ClassHierarchyNode.EXPLICITLY_INSTANTIATED,
         strict: true);
   }
 
@@ -622,14 +720,14 @@
   /// Returns `true` if [cls] or any superclass mixes in [mixin].
   bool isSubclassOfMixinUseOf(ClassElement cls, ClassElement mixin) {
     assert(isClosed);
+    assert(cls.isDeclaration);
+    assert(mixin.isDeclaration);
     if (isUsedAsMixin(mixin)) {
-      ClassElement current = cls.declaration;
-      mixin = mixin.declaration;
+      ClassElement current = cls;
       while (current != null) {
-        current = current.declaration;
         if (current.isMixinApplication) {
           MixinApplicationElement application = current;
-          if (application.mixin.declaration == mixin) return true;
+          if (application.mixin == mixin) return true;
         }
         current = current.superclass;
       }
@@ -641,8 +739,8 @@
   /// of a mixin application of [y].
   bool everySubtypeIsSubclassOfOrMixinUseOf(ClassElement x, ClassElement y) {
     assert(isClosed);
-    x = x.declaration;
-    y = y.declaration;
+    assert(x.isDeclaration);
+    assert(y.isDeclaration);
     Map<ClassElement, bool> secondMap =
         _subtypeCoveredByCache[x] ??= <ClassElement, bool>{};
     return secondMap[y] ??= subtypesOf(x).every((ClassElement cls) =>
@@ -658,11 +756,92 @@
     return subclasses.contains(type);
   }
 
-  final Compiler _compiler;
+  @override
+  bool hasElementIn(ClassElement cls, Selector selector, Element element) {
+    // Use [:implementation:] of [element]
+    // because our function set only stores declarations.
+    Element result = findMatchIn(cls, selector);
+    return result == null
+        ? false
+        : result.implementation == element.implementation;
+  }
+
+  Element findMatchIn(ClassElement cls, Selector selector,
+      {ClassElement stopAtSuperclass}) {
+    // Use the [:implementation] of [cls] in case the found [element]
+    // is in the patch class.
+    var result = cls.implementation
+        .lookupByName(selector.memberName, stopAt: stopAtSuperclass);
+    return result;
+  }
+
+  /// Returns whether a [selector] call on an instance of [cls]
+  /// will hit a method at runtime, and not go through [noSuchMethod].
+  bool hasConcreteMatch(ClassElement cls, Selector selector,
+      {ClassElement stopAtSuperclass}) {
+    assert(invariant(cls, isInstantiated(cls),
+        message: '$cls has not been instantiated.'));
+    Element element = findMatchIn(cls, selector);
+    if (element == null) return false;
+
+    if (element.isAbstract) {
+      ClassElement enclosingClass = element.enclosingClass;
+      return hasConcreteMatch(enclosingClass.superclass, selector);
+    }
+    return selector.appliesUntyped(element);
+  }
+
+  @override
+  bool needsNoSuchMethod(
+      ClassElement base, Selector selector, ClassQuery query) {
+    /// Returns `true` if subclasses in the [rootNode] tree needs noSuchMethod
+    /// handling.
+    bool subclassesNeedNoSuchMethod(ClassHierarchyNode rootNode) {
+      if (!rootNode.isInstantiated) {
+        // No subclass needs noSuchMethod handling since they are all
+        // uninstantiated.
+        return false;
+      }
+      ClassElement rootClass = rootNode.cls;
+      if (hasConcreteMatch(rootClass, selector)) {
+        // The root subclass has a concrete implementation so no subclass needs
+        // noSuchMethod handling.
+        return false;
+      } else if (rootNode.isExplicitlyInstantiated) {
+        // The root class need noSuchMethod handling.
+        return true;
+      }
+      IterationStep result = rootNode.forEachSubclass((ClassElement subclass) {
+        if (hasConcreteMatch(subclass, selector, stopAtSuperclass: rootClass)) {
+          // Found a match - skip all subclasses.
+          return IterationStep.SKIP_SUBCLASSES;
+        } else {
+          // Stop fast - we found a need for noSuchMethod handling.
+          return IterationStep.STOP;
+        }
+      }, ClassHierarchyNode.EXPLICITLY_INSTANTIATED, strict: true);
+      // We stopped fast so we need noSuchMethod handling.
+      return result == IterationStep.STOP;
+    }
+
+    ClassSet classSet = getClassSet(base);
+    ClassHierarchyNode node = classSet.node;
+    if (query == ClassQuery.EXACT) {
+      return node.isDirectlyInstantiated && !hasConcreteMatch(base, selector);
+    } else if (query == ClassQuery.SUBCLASS) {
+      return subclassesNeedNoSuchMethod(node);
+    } else {
+      if (subclassesNeedNoSuchMethod(node)) return true;
+      for (ClassHierarchyNode subtypeNode in classSet.subtypeNodes) {
+        if (subclassesNeedNoSuchMethod(subtypeNode)) return true;
+      }
+      return false;
+    }
+  }
+
+  final JavaScriptBackend _backend;
   BackendClasses get backendClasses => _backend.backendClasses;
-  JavaScriptBackend get _backend => _compiler.backend;
-  CommonMasks get commonMasks => _compiler.commonMasks;
-  final FunctionSet allFunctions;
+  FunctionSet _allFunctions;
   final Set<Element> functionsCalledInLoop = new Set<Element>();
   final Map<Element, SideEffects> sideEffects = new Map<Element, SideEffects>();
 
@@ -693,20 +872,33 @@
 
   final Set<Element> alreadyPopulated;
 
+  CommonMasks _commonMasks;
+
+  final CoreClasses coreClasses;
+
+  final CacheStrategy cacheStrategy;
+
+  final ResolutionWorldBuilder resolverWorld;
+
   bool get isClosed => _closed;
 
   Set<ClassElement> typesImplementedBySubclassesOf(ClassElement cls) {
     return _typesImplementedBySubclasses[cls.declaration];
   }
 
-  WorldImpl(Compiler compiler)
-      : allFunctions = new FunctionSet(compiler),
-        this._compiler = compiler,
-        alreadyPopulated = compiler.cacheStrategy.newSet();
+  WorldImpl(this.resolverWorld, this._backend, this.coreClasses,
+      CacheStrategy cacheStrategy)
+      : this.cacheStrategy = cacheStrategy,
+        alreadyPopulated = cacheStrategy.newSet() {
+    _allFunctions = new FunctionSet(this);
+  }
 
-  CoreClasses get coreClasses => _compiler.coreClasses;
+  FunctionSet get allFunctions => _allFunctions;
 
-  DiagnosticReporter get reporter => _compiler.reporter;
+  CommonMasks get commonMasks {
+    assert(isClosed);
+    return _commonMasks;
+  }
 
   /// Called to add [cls] to the set of known classes.
   ///
@@ -800,21 +992,26 @@
   }
 
   void _updateClassHierarchyNodeForClass(ClassElement cls,
-      {bool directlyInstantiated: false}) {
-    ClassHierarchyNode node = getClassHierarchyNode(cls);
+      {bool directlyInstantiated: false, bool abstractlyInstantiated: false}) {
+    ClassHierarchyNode node = _ensureClassHierarchyNode(cls);
     _updateSuperClassHierarchyNodeForClass(node);
     if (directlyInstantiated) {
       node.isDirectlyInstantiated = true;
     }
+    if (abstractlyInstantiated) {
+      node.isAbstractlyInstantiated = true;
+    }
   }
 
-  ClosedWorld closeWorld() {
+  ClosedWorld closeWorld(DiagnosticReporter reporter) {
     /// Updates the `isDirectlyInstantiated` and `isIndirectlyInstantiated`
     /// properties of the [ClassHierarchyNode] for [cls].
 
-    void addSubtypes(ClassElement cls) {
-      if (_compiler.options.hasIncrementalSupport &&
-          !alreadyPopulated.add(cls)) {
+    void addSubtypes(ClassElement cls, InstantiationInfo info) {
+      if (!info.hasInstantiation) {
+        return;
+      }
+      if (cacheStrategy.hasIncrementalSupport && !alreadyPopulated.add(cls)) {
         return;
       }
       assert(cls.isDeclaration);
@@ -822,7 +1019,9 @@
         reporter.internalError(cls, 'Class "${cls.name}" is not resolved.');
       }
 
-      _updateClassHierarchyNodeForClass(cls, directlyInstantiated: true);
+      _updateClassHierarchyNodeForClass(cls,
+          directlyInstantiated: info.isDirectlyInstantiated,
+          abstractlyInstantiated: info.isAbstractlyInstantiated);
 
       // Walk through the superclasses, and record the types
       // implemented by that type on the superclasses.
@@ -842,9 +1041,10 @@
     // classes: if the superclass of these classes require RTI, then
     // they also need RTI, so that a constructor passes the type
     // variables to the super constructor.
-    _compiler.resolverWorld.directlyInstantiatedClasses.forEach(addSubtypes);
+    resolverWorld.forEachInstantiatedClass(addSubtypes);
 
     _closed = true;
+    _commonMasks = new CommonMasks(this);
     return this;
   }
 
@@ -881,20 +1081,22 @@
     }
   }
 
-  VariableElement locateSingleField(Selector selector, TypeMask mask) {
+  FieldElement locateSingleField(Selector selector, TypeMask mask) {
     Element result = locateSingleElement(selector, mask);
     return (result != null && result.isField) ? result : null;
   }
 
   Element locateSingleElement(Selector selector, TypeMask mask) {
+    assert(isClosed);
     mask ??= commonMasks.dynamicType;
-    return mask.locateSingleElement(selector, _compiler);
+    return mask.locateSingleElement(selector, this);
   }
 
   TypeMask extendMaskIfReachesAll(Selector selector, TypeMask mask) {
+    assert(isClosed);
     bool canReachAll = true;
     if (mask != null) {
-      canReachAll = _compiler.enabledInvokeOn &&
+      canReachAll = _backend.hasInvokeOnSupport &&
           mask.needsNoSuchMethodHandling(selector, this);
     }
     return canReachAll ? commonMasks.dynamicType : mask;
@@ -922,8 +1124,8 @@
       return true;
     }
     if (element.isInstanceMember) {
-      return !_compiler.resolverWorld.hasInvokedSetter(element, this) &&
-          !_compiler.resolverWorld.fieldSetters.contains(element);
+      return !resolverWorld.hasInvokedSetter(element, this) &&
+          !resolverWorld.fieldSetters.contains(element);
     }
     return false;
   }
@@ -1011,3 +1213,16 @@
     return getMightBePassedToApply(element);
   }
 }
+
+/// Enum values defining subset of classes included in queries.
+enum ClassQuery {
+  /// Only the class itself is included.
+  EXACT,
+
+  /// The class and all subclasses (transitively) are included.
+  SUBCLASS,
+
+  /// The class and all classes that implement or subclass it (transitively)
+  /// are included.
+  SUBTYPE,
+}
diff --git a/pkg/compiler/pubspec.yaml b/pkg/compiler/pubspec.yaml
index a3e6070..07f759a 100644
--- a/pkg/compiler/pubspec.yaml
+++ b/pkg/compiler/pubspec.yaml
@@ -12,10 +12,10 @@
   js_runtime:
     path: ../../sdk/lib/_internal/js_runtime
   kernel:
-    path: ../../third_party/pkg/kernel
+    path: ../../pkg/kernel
   sdk_library_metadata:
     path: ../../sdk/lib/_internal/sdk_library_metadata
-  dart2js_info: ^0.2.4
+  dart2js_info: ^0.3.0
   lookup_map:
     path: ../lookup_map
 
diff --git a/pkg/compiler/tool/dart2js_profile_many.dart b/pkg/compiler/tool/dart2js_profile_many.dart
new file mode 100644
index 0000000..fed5e21
--- /dev/null
+++ b/pkg/compiler/tool/dart2js_profile_many.dart
@@ -0,0 +1,51 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library dart2js.profile_many;
+
+import 'dart:async';
+
+import 'package:compiler/src/dart2js.dart' as cmdline;
+
+const String USAGE = """
+Usage: dart2js_profile_many.dart [OPTIONS] [FILES]
+
+Invokes dart2js separately for each file using the given options.
+This is for profiling multiple compilations in the Dart Observatory.
+""";
+
+printUsage() {
+  print(USAGE);
+}
+
+void main(List<String> args) {
+  List options = [];
+  List files = [];
+
+  for (String arg in args) {
+    if (arg.startsWith('-')) {
+      options.add(arg);
+    } else {
+      files.add(arg);
+    }
+  }
+
+  if (files.length == 0) {
+    printUsage();
+    return;
+  }
+
+  cmdline.exitFunc = (code) {
+    throw "Exit with code $code";
+  };
+
+  Future.forEach(files, (String file) {
+    List subargs = [];
+    subargs.addAll(options);
+    subargs.add(file);
+    return cmdline.compilerMain(subargs).catchError((e) {});
+  }).then((_) {
+    print("Done");
+  });
+}
diff --git a/pkg/compiler/tool/dart2js_stress.dart b/pkg/compiler/tool/dart2js_stress.dart
new file mode 100644
index 0000000..d699e2b
--- /dev/null
+++ b/pkg/compiler/tool/dart2js_stress.dart
@@ -0,0 +1,41 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library dart2js.stress;
+
+import 'package:compiler/src/dart2js.dart' as dart2js;
+import 'dart:io' show Platform;
+
+const ITERATIONS_FLAG_PREFIX = "--iterations=";
+void main(List<String> args) {
+  Stopwatch sw = new Stopwatch();
+  int count = 0;
+  int maxCount = null;
+  if (args.isNotEmpty && args[0].startsWith(ITERATIONS_FLAG_PREFIX)) {
+    maxCount = int.parse(args[0].substring(ITERATIONS_FLAG_PREFIX.length));
+    args = args.sublist(1);
+  }
+  if (maxCount == null) {
+    print("Running indefinitely.\n"
+        "Use '$ITERATIONS_FLAG_PREFIX<count>' to set a repetition count"
+        " (as first flag).");
+  }
+  args = ["--suppress-warnings", "--suppress-hints", "--library-root="
+      "${Platform.script.resolve('../../../sdk').toFilePath()}"]
+           ..addAll(args);
+  void iterate() {
+    count++;
+    sw.reset();
+    sw.start();
+    dart2js.internalMain(args).then((_) {
+      print("$count: ${sw.elapsedMilliseconds}ms");
+    }).then((_) {
+      if (maxCount == null || count < maxCount) {
+        iterate();
+      }
+    });
+  }
+
+  iterate();
+}
diff --git a/pkg/compiler/tool/perf.dart b/pkg/compiler/tool/perf.dart
new file mode 100644
index 0000000..4725014
--- /dev/null
+++ b/pkg/compiler/tool/perf.dart
@@ -0,0 +1,402 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// An entrypoint used to run portions of dart2js and measure its performance.
+library compiler.tool.perf;
+
+import 'dart:async';
+import 'dart:io';
+
+import 'package:compiler/compiler_new.dart';
+import 'package:compiler/src/apiimpl.dart';
+import 'package:compiler/src/compiler.dart';
+import 'package:compiler/src/elements/elements.dart';
+import 'package:compiler/src/common.dart';
+import 'package:compiler/src/diagnostics/diagnostic_listener.dart';
+import 'package:compiler/src/diagnostics/messages.dart'
+    show Message, MessageTemplate;
+import 'package:compiler/src/io/source_file.dart';
+import 'package:compiler/src/options.dart';
+import 'package:compiler/src/parser/element_listener.dart' show ScannerOptions;
+import 'package:compiler/src/parser/listener.dart';
+import 'package:compiler/src/parser/node_listener.dart' show NodeListener;
+import 'package:compiler/src/parser/parser.dart' show Parser;
+import 'package:compiler/src/parser/partial_parser.dart';
+import 'package:compiler/src/platform_configuration.dart' as platform;
+import 'package:compiler/src/scanner/scanner.dart';
+import 'package:compiler/src/source_file_provider.dart';
+import 'package:compiler/src/tokens/token.dart' show Token;
+import 'package:compiler/src/universe/world_impact.dart' show WorldImpact;
+import 'package:package_config/discovery.dart' show findPackages;
+import 'package:package_config/packages.dart' show Packages;
+import 'package:package_config/src/util.dart' show checkValidPackageUri;
+
+/// Cumulative total number of chars scanned.
+int scanTotalChars = 0;
+
+/// Cumulative time spent scanning.
+Stopwatch scanTimer = new Stopwatch();
+
+/// Helper class used to load source files using dart2js's internal APIs.
+_Loader loader;
+
+main(List<String> args) async {
+  // TODO(sigmund): provide sdk folder as well.
+  if (args.length < 2) {
+    print('usage: perf.dart <bench-id> <entry.dart>');
+    exit(1);
+  }
+  var totalTimer = new Stopwatch()..start();
+
+  var bench = args[0];
+  var entryUri = Uri.base.resolve(args[1]);
+
+  await setup(entryUri);
+
+  var handlers = {
+    'scan': () async {
+      Set<SourceFile> files = await scanReachableFiles(entryUri);
+      // TODO(sigmund): replace the warmup with instrumented snapshots.
+      for (int i = 0; i < 10; i++) scanFiles(files);
+    },
+    'parse': () async {
+      Set<SourceFile> files = await scanReachableFiles(entryUri);
+      // TODO(sigmund): replace the warmup with instrumented snapshots.
+      for (int i = 0; i < 10; i++) parseFiles(files);
+    },
+    'kernel_gen_e2e': () async {
+      // TODO(sigmund): remove. This is used to compute the input size, we
+      // should extract input size from frontend instead.
+      await scanReachableFiles(entryUri);
+      // TODO(sigmund): replace this warmup. Note that for very large programs,
+      // the GC pressure on the VM seems to make this worse with time (maybe we
+      // are leaking memory?). That's why we run it twice and not 10 times.
+      for (int i = 0; i < 2; i++) await generateKernel(entryUri);
+    },
+  };
+
+  var handler = handlers[bench];
+  if (handler == null) {
+    // TODO(sigmund): implement the remaining benchmarks.
+    print('unsupported bench-id: $bench. Please specify one of the following: '
+        '${handler.keys.join(", ")}');
+    exit(1);
+  }
+  await handler();
+  totalTimer.stop();
+  report("total", totalTimer.elapsedMicroseconds);
+}
+
+Future setup(Uri entryUri) async {
+  var inputProvider = new CompilerSourceFileProvider();
+  var sdkLibraries = await platform.load(_platformConfigUri, inputProvider);
+  var packages = await findPackages(entryUri);
+  loader = new _Loader(inputProvider, sdkLibraries, packages);
+}
+
+/// Load and scans all files we need to process: files reachable from the
+/// entrypoint and all core libraries automatically included by the VM.
+Future<Set<SourceFile>> scanReachableFiles(Uri entryUri) async {
+  var files = new Set<SourceFile>();
+  var loadTimer = new Stopwatch()..start();
+  var entrypoints = [
+    entryUri,
+    Uri.parse("dart:async"),
+    Uri.parse("dart:collection"),
+    Uri.parse("dart:convert"),
+    Uri.parse("dart:core"),
+    Uri.parse("dart:developer"),
+    Uri.parse("dart:_internal"),
+    Uri.parse("dart:io"),
+    Uri.parse("dart:isolate"),
+    Uri.parse("dart:math"),
+    Uri.parse("dart:mirrors"),
+    Uri.parse("dart:typed_data"),
+  ];
+  for (var entry in entrypoints) {
+    await collectSources(await loader.loadFile(entry), files);
+  }
+  loadTimer.stop();
+
+  print('input size: ${scanTotalChars} chars');
+  var loadTime = loadTimer.elapsedMicroseconds - scanTimer.elapsedMicroseconds;
+  report("load", loadTime);
+  report("scan", scanTimer.elapsedMicroseconds);
+  return files;
+}
+
+/// Scans every file in [files] and reports the time spent doing so.
+void scanFiles(Set<SourceFile> files) {
+  // The code below will record again how many chars are scanned and how long it
+  // takes to scan them, even though we already did so in [scanReachableFiles].
+  // Recording and reporting this twice is unnecessary, but we do so for now to
+  // validate that the results are consistent.
+  scanTimer = new Stopwatch();
+  var old = scanTotalChars;
+  scanTotalChars = 0;
+  for (var source in files) {
+    tokenize(source);
+  }
+
+  // Report size and scanning time again. See discussion above.
+  if (old != scanTotalChars) print('input size changed? ${old} chars');
+  report("scan", scanTimer.elapsedMicroseconds);
+}
+
+/// Parses every file in [files] and reports the time spent doing so.
+void parseFiles(Set<SourceFile> files) {
+  // The code below will record again how many chars are scanned and how long it
+  // takes to scan them, even though we already did so in [scanReachableFiles].
+  // Recording and reporting this twice is unnecessary, but we do so for now to
+  // validate that the results are consistent.
+  scanTimer = new Stopwatch();
+  var old = scanTotalChars;
+  scanTotalChars = 0;
+  var parseTimer = new Stopwatch()..start();
+  for (var source in files) {
+    parseFull(source);
+  }
+  parseTimer.stop();
+
+  // Report size and scanning time again. See discussion above.
+  if (old != scanTotalChars) print('input size changed? ${old} chars');
+  report("scan", scanTimer.elapsedMicroseconds);
+
+  report(
+      "parse", parseTimer.elapsedMicroseconds - scanTimer.elapsedMicroseconds);
+}
+
+/// Add to [files] all sources reachable from [start].
+Future collectSources(SourceFile start, Set<SourceFile> files) async {
+  if (!files.add(start)) return;
+  for (var directive in parseDirectives(start)) {
+    var next = await loader.loadFile(start.uri.resolve(directive));
+    await collectSources(next, files);
+  }
+}
+
+/// Uses the diet-parser to parse only directives in [source], returns the
+/// URIs seen in import/export/part directives in the file.
+Set<String> parseDirectives(SourceFile source) {
+  var tokens = tokenize(source);
+  var listener = new DirectiveListener();
+  new PartialParser(listener).parseUnit(tokens);
+  return listener.targets;
+}
+
+/// Parse the full body of [source].
+parseFull(SourceFile source) {
+  var tokens = tokenize(source);
+  NodeListener listener = new NodeListener(
+      const ScannerOptions(canUseNative: true), new FakeReporter(), null);
+  Parser parser = new Parser(listener);
+  parser.parseUnit(tokens);
+  return listener.popNode();
+}
+
+/// Scan [source] and return the first token produced by the scanner.
+Token tokenize(SourceFile source) {
+  scanTimer.start();
+  scanTotalChars += source.length;
+  var token = new Scanner(source).tokenize();
+  scanTimer.stop();
+  return token;
+}
+
+/// Report that metric [name] took [time] micro-seconds to process
+/// [scanTotalChars] characters.
+void report(String name, int time) {
+  var sb = new StringBuffer();
+  sb.write('$name: $time us, ${time ~/ 1000} ms');
+  sb.write(', ${scanTotalChars * 1000 ~/ time} chars/ms');
+  print('$sb');
+}
+
+/// Listener that parses out just the uri in imports, exports, and part
+/// directives.
+class DirectiveListener extends Listener {
+  Set<String> targets = new Set<String>();
+
+  bool inDirective = false;
+  void enterDirective() {
+    inDirective = true;
+  }
+
+  void exitDirective() {
+    inDirective = false;
+  }
+
+  void beginImport(Token importKeyword) => enterDirective();
+  void beginExport(Token token) => enterDirective();
+  void beginPart(Token token) => enterDirective();
+
+  void beginLiteralString(Token token) {
+    if (inDirective) {
+      var quotedString = token.value;
+      targets.add(quotedString.substring(1, quotedString.length - 1));
+    }
+  }
+
+  void endExport(Token exportKeyword, Token semicolon) => exitDirective();
+  void endImport(Token importKeyword, Token deferredKeyword, Token asKeyword,
+          Token semicolon) =>
+      exitDirective();
+  void endPart(Token partKeyword, Token semicolon) => exitDirective();
+}
+
+Uri _libraryRoot = Platform.script.resolve('../../../sdk/');
+Uri _platformConfigUri = _libraryRoot.resolve("lib/dart_server.platform");
+
+class FakeReporter extends DiagnosticReporter {
+  final hasReportedError = false;
+  final options = new FakeReporterOptions();
+
+  withCurrentElement(e, f) => f();
+  log(m) => print(m);
+  internalError(_, m) => print(m);
+  spanFromSpannable(_) => null;
+
+  void reportError(DiagnosticMessage message,
+      [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]) {
+    print('error: ${message.message}');
+  }
+
+  void reportWarning(DiagnosticMessage message,
+      [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]) {
+    print('warning: ${message.message}');
+  }
+
+  void reportHint(DiagnosticMessage message,
+      [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]) {
+    print('hint: ${message.message}');
+  }
+
+  void reportInfo(_, __, [Map arguments = const {}]) {}
+
+  DiagnosticMessage createMessage(_, MessageKind kind,
+      [Map arguments = const {}]) {
+    MessageTemplate template = MessageTemplate.TEMPLATES[kind];
+    Message message = template.message(arguments, false);
+    return new DiagnosticMessage(null, null, message);
+  }
+}
+
+class FakeReporterOptions {
+  bool get suppressHints => false;
+  bool get hidePackageWarnings => false;
+}
+
+class _Loader {
+  CompilerInput inputProvider;
+
+  /// Maps dart-URIs to a known location in the sdk.
+  Map<String, Uri> sdkLibraries;
+  Map<Uri, SourceFile> _cache = {};
+  Packages packages;
+
+  _Loader(this.inputProvider, this.sdkLibraries, this.packages);
+
+  Future<SourceFile> loadFile(Uri uri) async {
+    if (!uri.isAbsolute) throw 'Relative uri $uri provided to readScript.';
+    Uri resourceUri = _translateUri(uri);
+    if (resourceUri == null || resourceUri.scheme == 'dart-ext') {
+      throw '$uri not resolved or unsupported.';
+    }
+    var file = _cache[resourceUri];
+    if (file != null) return _cache[resourceUri];
+    return _cache[resourceUri] = await _readFile(resourceUri);
+  }
+
+  Future<SourceFile> _readFile(Uri uri) async {
+    var data = await inputProvider.readFromUri(uri);
+    if (data is List<int>) return new Utf8BytesSourceFile(uri, data);
+    if (data is String) return new StringSourceFile.fromUri(uri, data);
+    // TODO(sigmund): properly handle errors, just report, return null, wrap
+    // above and continue...
+    throw "Expected a 'String' or a 'List<int>' from the input "
+        "provider, but got: ${data.runtimeType}.";
+  }
+
+  Uri _translateUri(Uri uri) {
+    if (uri.scheme == 'dart') return sdkLibraries[uri.path];
+    if (uri.scheme == 'package') return _translatePackageUri(uri);
+    return uri;
+  }
+
+  Uri _translatePackageUri(Uri uri) {
+    checkValidPackageUri(uri);
+    return packages.resolve(uri, notFound: (_) {
+      print('$uri not found');
+    });
+  }
+}
+
+generateKernel(Uri entryUri) async {
+  var timer = new Stopwatch()..start();
+  var options = new CompilerOptions(
+      entryPoint: entryUri,
+      libraryRoot: _libraryRoot,
+      packagesDiscoveryProvider: findPackages,
+      platformConfigUri: _platformConfigUri,
+      useKernel: true,
+      verbose: false); // set to true to debug internal timings
+  var inputProvider = new CompilerSourceFileProvider();
+  var diagnosticHandler = new FormattingDiagnosticHandler(inputProvider)
+    ..verbose = options.verbose;
+  var compiler = new MyCompiler(inputProvider, diagnosticHandler, options);
+  await compiler.run(entryUri);
+  timer.stop();
+  report("kernel_gen_e2e", timer.elapsedMicroseconds);
+}
+
+// We subclass compiler to skip phases and stop after creating kernel.
+class MyCompiler extends CompilerImpl {
+  MyCompiler(CompilerInput provider, CompilerDiagnostics handler,
+      CompilerOptions options)
+      : super(provider, null, handler, options) {}
+
+  /// Performs the compilation when all libraries have been loaded.
+  void compileLoadedLibraries() =>
+      selfTask.measureSubtask("KernelCompiler.compileLoadedLibraries", () {
+        WorldImpact mainImpact = computeMain();
+        mirrorUsageAnalyzerTask.analyzeUsage(mainApp);
+
+        deferredLoadTask.beforeResolution(this);
+        impactStrategy = backend.createImpactStrategy(
+            supportDeferredLoad: deferredLoadTask.isProgramSplit,
+            supportDumpInfo: options.dumpInfo,
+            supportSerialization: serialization.supportSerialization);
+
+        phase = Compiler.PHASE_RESOLVING;
+        enqueuer.resolution.applyImpact(mainImpact);
+        // Note: we enqueue everything in the program so we measure generating
+        // kernel for the entire code, not just what's reachable from main.
+        libraryLoader.libraries.forEach((LibraryElement library) {
+          enqueuer.resolution.applyImpact(computeImpactForLibrary(library));
+        });
+
+        if (deferredLoadTask.isProgramSplit) {
+          enqueuer.resolution.applyImpact(
+              backend.computeDeferredLoadingImpact());
+        }
+        enqueuer.resolution.applyImpact(backend.computeHelpersImpact());
+        resolveLibraryMetadata();
+        reporter.log('Resolving...');
+        processQueue(enqueuer.resolution, mainFunction);
+        enqueuer.resolution.logSummary(reporter.log);
+
+        (reporter as CompilerDiagnosticReporter)
+            .reportSuppressedMessagesSummary();
+
+        if (compilationFailed) {
+          // TODO(sigmund): more diagnostics?
+          print("compilation failed!");
+          exit(1);
+        }
+
+        closeResolution();
+        var program = (backend as dynamic).kernelTask.program;
+        print('total libraries: ${program.libraries.length}');
+      });
+}
diff --git a/pkg/compiler/tool/perf_test.dart b/pkg/compiler/tool/perf_test.dart
new file mode 100644
index 0000000..20b6478
--- /dev/null
+++ b/pkg/compiler/tool/perf_test.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// The only purpose of this file is to enable analyzer tests on `perf.dart`,
+/// the code here just has a dummy import to the rest of the code.
+library compiler.tool.perf_test;
+
+import 'perf.dart' as m;
+
+main() => print('done ${m.scanTotalChars}');
diff --git a/pkg/dart2js_incremental/lib/caching_compiler.dart b/pkg/dart2js_incremental/lib/caching_compiler.dart
index 5582bab..8bf1c64 100644
--- a/pkg/dart2js_incremental/lib/caching_compiler.dart
+++ b/pkg/dart2js_incremental/lib/caching_compiler.dart
@@ -35,17 +35,19 @@
     environment = {};
   }
   CompilerImpl compiler = cachedCompiler;
+  JavaScriptBackend backend = compiler?.backend;
   if (compiler == null ||
       compiler.libraryRoot != libraryRoot ||
       !compiler.options.hasIncrementalSupport ||
       compiler.hasCrashed ||
-      compiler.enqueuer.resolution.hasEnqueuedReflectiveElements ||
+      backend.mirrorsAnalysis.resolutionHandler.hasEnqueuedReflectiveElements ||
       compiler.deferredLoadTask.isProgramSplit) {
     if (compiler != null && compiler.options.hasIncrementalSupport) {
       print('***FLUSH***');
       if (compiler.hasCrashed) {
         print('Unable to reuse compiler due to crash.');
-      } else if (compiler.enqueuer.resolution.hasEnqueuedReflectiveElements) {
+      } else if (backend.mirrorsAnalysis.resolutionHandler
+                     .hasEnqueuedReflectiveElements) {
         print('Unable to reuse compiler due to dart:mirrors.');
       } else if (compiler.deferredLoadTask.isProgramSplit) {
         print('Unable to reuse compiler due to deferred loading.');
@@ -64,7 +66,7 @@
             packageConfig: packageConfig,
             options: options,
             environment: environment));
-    JavaScriptBackend backend = compiler.backend;
+    backend = compiler.backend;
 
     full.Emitter emitter = backend.emitter.emitter;
 
@@ -82,9 +84,8 @@
       return compiler.libraryLoader.loadLibrary(core).then((_) {
         // Likewise, always be prepared for runtimeType support.
         // TODO(johnniwinther): Add global switch to force RTI.
-        compiler.enabledRuntimeType = true;
-        backend.registerRuntimeType(
-            compiler.enqueuer.resolution, compiler.globalDependencies);
+        compiler.resolverWorld.hasRuntimeTypeSupport = true;
+        compiler.enqueuer.resolution.applyImpact(backend.registerRuntimeType());
         return compiler;
       });
     });
diff --git a/pkg/dev_compiler/CHANGELOG.md b/pkg/dev_compiler/CHANGELOG.md
index 9633a3d..e7da8f1 100644
--- a/pkg/dev_compiler/CHANGELOG.md
+++ b/pkg/dev_compiler/CHANGELOG.md
@@ -4,6 +4,7 @@
 - add support for AMD modules and make it the default.
 - precompile the SDK in AMD, CommonJS, and ES6 flavors.
 - legacy module format is deprecated.
+- remove --package-paths option
 
 ## 0.1.24
 - workaround breaking change on requestAnimationFrame
diff --git a/pkg/dev_compiler/README.md b/pkg/dev_compiler/README.md
index 7bb6066..7d3a3dd 100644
--- a/pkg/dev_compiler/README.md
+++ b/pkg/dev_compiler/README.md
@@ -1,8 +1,8 @@
 dev_compiler
 ============
 
-[![Build Status](https://travis-ci.org/dart-lang/dev_compiler.svg?branch=master)](https://travis-ci.org/dart-lang/dev_compiler)
-[![Coverage Status](https://coveralls.io/repos/dart-lang/dev_compiler/badge.svg?branch=master)](https://coveralls.io/r/dart-lang/dev_compiler)
+[![Build Status](https://travis-ci.org/dart-lang/sdk.svg?branch=master)](https://travis-ci.org/dart-lang/sdk)
+[![Coverage Status](https://coveralls.io/repos/dart-lang/sdk/badge.svg?branch=master)](https://coveralls.io/r/dart-lang/sdk)
 
 The Dart Dev Compiler (DDC) is an **experimental** development tool and transpiler.  It is at a very early stage today.  Its aims include the following:
 
@@ -11,7 +11,7 @@
 
 DDC attempts to map to idiomatic EcmaScript 6 (ES6) as cleanly as possible.  To do this while cohering to Dart semantics, DDC relies heavily on static type information, static checking, and runtime assertions.
 
-DDC is intended to support a very [large subset](https://github.com/dart-lang/dev_compiler/blob/master/STRONG_MODE.md) of Dart.  If a program does not statically check, DDC will not result in valid generated code.  Our goal is that a program execution (of a valid program) that runs without triggering runtime assertions should run the same on other Dart platforms under checked mode or production mode.
+DDC is intended to support a very [large subset](https://github.com/dart-lang/sdk/blob/master/pkg/dev_compiler/STRONG_MODE.md) of Dart.  If a program does not statically check, DDC will not result in valid generated code.  Our goal is that a program execution (of a valid program) that runs without triggering runtime assertions should run the same on other Dart platforms under checked mode or production mode.
 
 DDC does support untyped Dart code, but it will typically result in less readable and less efficient ES6 output.
 
@@ -28,4 +28,4 @@
 
 We are targeting the subset of ES6 supported in Chrome.
 
-To try out DDC and/or give feedback, please read our [usage](https://github.com/dart-lang/dev_compiler/blob/master/USAGE.md) page.
+To try out DDC and/or give feedback, please read our [usage](https://github.com/dart-lang/sdk/blob/master/pkg/dev_compiler/USAGE.md) page.
diff --git a/pkg/dev_compiler/USAGE.md b/pkg/dev_compiler/USAGE.md
index 77c2a69..9a3de65 100644
--- a/pkg/dev_compiler/USAGE.md
+++ b/pkg/dev_compiler/USAGE.md
@@ -73,7 +73,7 @@
 
 ## Feedback
 
-Please file issues in our [GitHub issue tracker](https://github.com/dart-lang/dev_compiler/issues).
+Please file issues in our [GitHub issue tracker](https://github.com/dart-lang/sdk/issues).
 
 You can also view or join our [mailing list](https://groups.google.com/a/dartlang.org/forum/#!forum/dev-compiler).
 
diff --git a/pkg/dev_compiler/codereview.settings b/pkg/dev_compiler/codereview.settings
index 1c7f5d4..491e3d8 100644
--- a/pkg/dev_compiler/codereview.settings
+++ b/pkg/dev_compiler/codereview.settings
@@ -1,3 +1,3 @@
 CODE_REVIEW_SERVER: https://codereview.chromium.org
-VIEW_VC: https://github.com/dart-lang/dev_compiler/commit/
+VIEW_VC: https://github.com/dart-lang/sdk/commit/
 CC_LIST: dev-compiler+reviews@dartlang.org
diff --git a/pkg/dev_compiler/karma.conf.js b/pkg/dev_compiler/karma.conf.js
index 3fbe32e..e904106 100644
--- a/pkg/dev_compiler/karma.conf.js
+++ b/pkg/dev_compiler/karma.conf.js
@@ -19,6 +19,7 @@
       {pattern: 'gen/codegen_output/corelib/**/*.js', included: false},
       {pattern: 'gen/codegen_output/lib/**/*.js', included: false},
       {pattern: 'test/browser/*.js', included: false},
+      {pattern: 'node_modules/is_js/*.js', included: false},      
       'test-main.js',
     ],
 
@@ -62,12 +63,12 @@
     // start these browsers
     // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
     customLaunchers: {
-      chrome_travis: {
+      ChromeTravis: {
         base: 'Chrome',
         flags: [ '--no-sandbox' ]
       },
 
-      chrome_canary_travis: {
+      ChromeCanaryTravis: {
         base: 'ChromeCanary',
         flags: [ '--no-sandbox' ]
       },
@@ -81,7 +82,7 @@
   };
 
   if (process.env.TRAVIS) {
-    configuration.browsers = ['chrome_canary_travis'];
+    configuration.browsers = ['ChromeTravis'];
     configuration.autoWatch = false;
     // Enable this for more logging on Travis.  It is too much for Travis to
     // automatically display, but still results in a downloadable raw log.
diff --git a/pkg/dev_compiler/lib/js/amd/dart_sdk.js b/pkg/dev_compiler/lib/js/amd/dart_sdk.js
index e4a67c2..abb592c 100644
--- a/pkg/dev_compiler/lib/js/amd/dart_sdk.js
+++ b/pkg/dev_compiler/lib/js/amd/dart_sdk.js
@@ -17,6 +17,7 @@
   const collection = Object.create(null);
   const convert = Object.create(null);
   const core = Object.create(null);
+  const developer = Object.create(null);
   const isolate = Object.create(null);
   const js = Object.create(null);
   const js_util = Object.create(null);
@@ -48,12 +49,14 @@
   let ListOfNameValuePair = () => (ListOfNameValuePair = dart.constFn(core.List$(_debugger.NameValuePair)))();
   let JSArrayOfString = () => (JSArrayOfString = dart.constFn(_interceptors.JSArray$(core.String)))();
   let JSArrayOfJsonMLFormatter = () => (JSArrayOfJsonMLFormatter = dart.constFn(_interceptors.JSArray$(_debugger.JsonMLFormatter)))();
+  let JSIndexable = () => (JSIndexable = dart.constFn(_interceptors.JSIndexable$()))();
   let JSArray = () => (JSArray = dart.constFn(_interceptors.JSArray$()))();
   let JSMutableArray = () => (JSMutableArray = dart.constFn(_interceptors.JSMutableArray$()))();
   let JSFixedArray = () => (JSFixedArray = dart.constFn(_interceptors.JSFixedArray$()))();
   let JSExtendableArray = () => (JSExtendableArray = dart.constFn(_interceptors.JSExtendableArray$()))();
   let JSUnmodifiableArray = () => (JSUnmodifiableArray = dart.constFn(_interceptors.JSUnmodifiableArray$()))();
   let ArrayIterator = () => (ArrayIterator = dart.constFn(_interceptors.ArrayIterator$()))();
+  let JSIndexableOfString = () => (JSIndexableOfString = dart.constFn(_interceptors.JSIndexable$(core.String)))();
   let MatchToString = () => (MatchToString = dart.constFn(dart.functionType(core.String, [core.Match])))();
   let StringToString = () => (StringToString = dart.constFn(dart.functionType(core.String, [core.String])))();
   let ComparableOfnum = () => (ComparableOfnum = dart.constFn(core.Comparable$(core.num)))();
@@ -142,6 +145,7 @@
   let ListOfClassMirror = () => (ListOfClassMirror = dart.constFn(core.List$(mirrors.ClassMirror)))();
   let ListOfTypeVariableMirror = () => (ListOfTypeVariableMirror = dart.constFn(core.List$(mirrors.TypeVariableMirror)))();
   let MapOfSymbol$MethodMirror = () => (MapOfSymbol$MethodMirror = dart.constFn(core.Map$(core.Symbol, mirrors.MethodMirror)))();
+  let JSArrayOfType = () => (JSArrayOfType = dart.constFn(_interceptors.JSArray$(core.Type)))();
   let ListOfParameterMirror = () => (ListOfParameterMirror = dart.constFn(core.List$(mirrors.ParameterMirror)))();
   let ListOfFloat32x4 = () => (ListOfFloat32x4 = dart.constFn(core.List$(typed_data.Float32x4)))();
   let ListOfInt32x4 = () => (ListOfInt32x4 = dart.constFn(core.List$(typed_data.Int32x4)))();
@@ -373,6 +377,12 @@
   let MapOfString$String = () => (MapOfString$String = dart.constFn(core.Map$(core.String, core.String)))();
   let IterableOfString = () => (IterableOfString = dart.constFn(core.Iterable$(core.String)))();
   let MapOfString$dynamic = () => (MapOfString$dynamic = dart.constFn(core.Map$(core.String, dart.dynamic)))();
+  let MapOfString$ServiceExtensionHandler = () => (MapOfString$ServiceExtensionHandler = dart.constFn(core.Map$(core.String, developer.ServiceExtensionHandler)))();
+  let MapOfString$Metric = () => (MapOfString$Metric = dart.constFn(core.Map$(core.String, developer.Metric)))();
+  let ListOf_SyncBlock = () => (ListOf_SyncBlock = dart.constFn(core.List$(developer._SyncBlock)))();
+  let JSArrayOf_AsyncBlock = () => (JSArrayOf_AsyncBlock = dart.constFn(_interceptors.JSArray$(developer._AsyncBlock)))();
+  let ListOf_AsyncBlock = () => (ListOf_AsyncBlock = dart.constFn(core.List$(developer._AsyncBlock)))();
+  let CompleterOfUri = () => (CompleterOfUri = dart.constFn(async.Completer$(core.Uri)))();
   let FutureOfIsolate = () => (FutureOfIsolate = dart.constFn(async.Future$(isolate.Isolate)))();
   let JsArray = () => (JsArray = dart.constFn(js.JsArray$()))();
   let ExpandoOfFunction = () => (ExpandoOfFunction = dart.constFn(core.Expando$(core.Function)))();
@@ -532,9 +542,9 @@
   let ListOfTransform = () => (ListOfTransform = dart.constFn(core.List$(svg$.Transform)))();
   let CompleterOfAudioBuffer = () => (CompleterOfAudioBuffer = dart.constFn(async.Completer$(web_audio.AudioBuffer)))();
   let EventStreamProviderOfAudioProcessingEvent = () => (EventStreamProviderOfAudioProcessingEvent = dart.constFn(html$.EventStreamProvider$(web_audio.AudioProcessingEvent)))();
+  let dynamicTodynamic$ = () => (dynamicTodynamic$ = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic])))();
   let StringAndStringToint = () => (StringAndStringToint = dart.constFn(dart.definiteFunctionType(core.int, [core.String, core.String])))();
   let VoidTo_MethodStats = () => (VoidTo_MethodStats = dart.constFn(dart.definiteFunctionType(dart._MethodStats, [])))();
-  let dynamicTodynamic$ = () => (dynamicTodynamic$ = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic])))();
   let dynamicToString = () => (dynamicToString = dart.constFn(dart.definiteFunctionType(core.String, [dart.dynamic])))();
   let dynamicToListOfString = () => (dynamicToListOfString = dart.constFn(dart.definiteFunctionType(ListOfString(), [dart.dynamic])))();
   let dynamicToList = () => (dynamicToList = dart.constFn(dart.definiteFunctionType(core.List, [dart.dynamic])))();
@@ -613,10 +623,12 @@
   let TypeToTypeMirror = () => (TypeToTypeMirror = dart.constFn(dart.definiteFunctionType(mirrors.TypeMirror, [core.Type])))();
   let dynamicAndListTodynamic = () => (dynamicAndListTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic, core.List])))();
   let dynamicAndStringAndListTodynamic = () => (dynamicAndStringAndListTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic, core.String, core.List])))();
-  let dynamicToMap = () => (dynamicToMap = dart.constFn(dart.definiteFunctionType(core.Map, [dart.dynamic])))();
+  let SymbolTodynamic = () => (SymbolTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [core.Symbol])))();
+  let dynamicToSymbol = () => (dynamicToSymbol = dart.constFn(dart.definiteFunctionType(core.Symbol, [dart.dynamic])))();
+  let dynamicToMapOfSymbol$dynamic = () => (dynamicToMapOfSymbol$dynamic = dart.constFn(dart.definiteFunctionType(MapOfSymbol$dynamic(), [dart.dynamic])))();
   let TypeAndInvocationTodynamic = () => (TypeAndInvocationTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [core.Type, core.Invocation])))();
   let SymbolAnddynamicTovoid = () => (SymbolAnddynamicTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.Symbol, dart.dynamic])))();
-  let StringAnddynamicTovoid = () => (StringAnddynamicTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String, dart.dynamic])))();
+  let MapOfSymbol$dynamicTodynamic = () => (MapOfSymbol$dynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [MapOfSymbol$dynamic()])))();
   let dynamicToTypeMirror = () => (dynamicToTypeMirror = dart.constFn(dart.definiteFunctionType(mirrors.TypeMirror, [dart.dynamic])))();
   let dynamicAnddynamicAnddynamicTovoid = () => (dynamicAnddynamicAnddynamicTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [dart.dynamic, dart.dynamic, dart.dynamic])))();
   let ListToList = () => (ListToList = dart.constFn(dart.definiteFunctionType(core.List, [core.List])))();
@@ -674,9 +686,24 @@
   let ObjectToint = () => (ObjectToint = dart.constFn(dart.definiteFunctionType(core.int, [core.Object])))();
   let ObjectTovoid = () => (ObjectTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.Object])))();
   let StringAndStringTovoid$ = () => (StringAndStringTovoid$ = dart.constFn(dart.definiteFunctionType(dart.void, [core.String, core.String])))();
+  let StringAnddynamicTovoid = () => (StringAnddynamicTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String, dart.dynamic])))();
   let MapOfString$StringAndStringToMapOfString$String = () => (MapOfString$StringAndStringToMapOfString$String = dart.constFn(dart.definiteFunctionType(MapOfString$String(), [MapOfString$String(), core.String])))();
   let intAndintAndintTovoid = () => (intAndintAndintTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.int, core.int, core.int])))();
   let String__Tovoid = () => (String__Tovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String], [dart.dynamic])))();
+  let __Tobool = () => (__Tobool = dart.constFn(dart.definiteFunctionType(core.bool, [], {when: core.bool, message: core.String})))();
+  let String__Tovoid$ = () => (String__Tovoid$ = dart.constFn(dart.definiteFunctionType(dart.void, [core.String], {time: core.DateTime, sequenceNumber: core.int, level: core.int, name: core.String, zone: async.Zone, error: core.Object, stackTrace: core.StackTrace})))();
+  let StringAndServiceExtensionHandlerTovoid = () => (StringAndServiceExtensionHandlerTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String, developer.ServiceExtensionHandler])))();
+  let StringAndMapTovoid = () => (StringAndMapTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String, core.Map])))();
+  let StringToServiceExtensionHandler = () => (StringToServiceExtensionHandler = dart.constFn(dart.definiteFunctionType(developer.ServiceExtensionHandler, [core.String])))();
+  let StringAndServiceExtensionHandlerTodynamic = () => (StringAndServiceExtensionHandlerTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [core.String, developer.ServiceExtensionHandler])))();
+  let VoidToUserTag = () => (VoidToUserTag = dart.constFn(dart.definiteFunctionType(developer.UserTag, [])))();
+  let MapToString = () => (MapToString = dart.constFn(dart.definiteFunctionType(core.String, [core.Map])))();
+  let intAndintAndString__Tovoid = () => (intAndintAndString__Tovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.int, core.int, core.String, core.String, core.String, core.String])))();
+  let intAndintAndString__Tovoid$ = () => (intAndintAndString__Tovoid$ = dart.constFn(dart.definiteFunctionType(dart.void, [core.int, core.int, core.String, core.String, core.String])))();
+  let intAndStringAndString__Tovoid = () => (intAndStringAndString__Tovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.int, core.String, core.String, core.String])))();
+  let UriTovoid = () => (UriTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.Uri])))();
+  let SendPortTovoid = () => (SendPortTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [isolate.SendPort])))();
+  let SendPortAndboolTovoid = () => (SendPortAndboolTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [isolate.SendPort, core.bool])))();
   let ListToIsolate = () => (ListToIsolate = dart.constFn(dart.definiteFunctionType(isolate.Isolate, [core.List])))();
   let dynamicTo_DartObject = () => (dynamicTo_DartObject = dart.constFn(dart.definiteFunctionType(js._DartObject, [dart.dynamic])))();
   let dynamicToJsObject = () => (dynamicToJsObject = dart.constFn(dart.definiteFunctionType(js.JsObject, [dart.dynamic])))();
@@ -745,6 +772,7 @@
   let NodeAndNodeTovoid = () => (NodeAndNodeTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [html$.Node, html$.Node])))();
   let dynamicToImageData = () => (dynamicToImageData = dart.constFn(dart.definiteFunctionType(html$.ImageData, [dart.dynamic])))();
   let ImageDataTodynamic = () => (ImageDataTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [html$.ImageData])))();
+  let dynamicToMap = () => (dynamicToMap = dart.constFn(dart.definiteFunctionType(core.Map, [dart.dynamic])))();
   let Map__Todynamic = () => (Map__Todynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [core.Map], [dynamicTovoid()])))();
   let ListOfStringToList = () => (ListOfStringToList = dart.constFn(dart.definiteFunctionType(core.List, [ListOfString()])))();
   let dynamicToDateTime = () => (dynamicToDateTime = dart.constFn(dart.definiteFunctionType(core.DateTime, [dart.dynamic])))();
@@ -776,10 +804,10 @@
     return Mixin;
   };
   dart.getMixins = function(clazz) {
-    return clazz[dart._mixins];
+    return Object.hasOwnProperty.call(clazz, dart._mixins) ? clazz[dart._mixins] : null;
   };
   dart.getImplements = function(clazz) {
-    return clazz[dart.implements];
+    return Object.hasOwnProperty.call(clazz, dart.implements) ? clazz[dart.implements] : null;
   };
   dart.flattenFutures = function(builder) {
     function flatten(T) {
@@ -793,43 +821,48 @@
     }
     return flatten;
   };
-  dart.generic = function(typeConstructor) {
-    let length = typeConstructor.length;
-    if (length < 1) {
-      dart.throwInternalError('must have at least one generic type argument');
-    }
-    let resultMap = new Map();
-    function makeGenericType(...args) {
-      if (args.length != length && args.length != 0) {
-        dart.throwInternalError('requires ' + length + ' or 0 type arguments');
+  dart.generic = function(typeConstructor, setBaseClass) {
+    if (setBaseClass === void 0) setBaseClass = null;
+    return (() => {
+      let length = typeConstructor.length;
+      if (length < 1) {
+        dart.throwInternalError('must have at least one generic type argument');
       }
-      while (args.length < length)
-        args.push(dart.dynamic);
-      let value = resultMap;
-      for (let i = 0; i < length; i++) {
-        let arg = args[i];
-        if (arg == null) {
-          dart.throwInternalError('type arguments should not be null: ' + typeConstructor);
+      let resultMap = new Map();
+      function makeGenericType(...args) {
+        if (args.length != length && args.length != 0) {
+          dart.throwInternalError('requires ' + length + ' or 0 type arguments');
         }
-        let map = value;
-        value = map.get(arg);
-        if (value === void 0) {
-          if (i + 1 == length) {
-            value = typeConstructor.apply(null, args);
-            if (value) {
-              value[dart._typeArguments] = args;
-              value[dart._originalDeclaration] = makeGenericType;
-            }
-          } else {
-            value = new Map();
+        while (args.length < length)
+          args.push(dart.dynamic);
+        let value = resultMap;
+        for (let i = 0; i < length; i++) {
+          let arg = args[i];
+          if (arg == null) {
+            dart.throwInternalError('type arguments should not be null: ' + typeConstructor);
           }
-          map.set(arg, value);
+          let map = value;
+          value = map.get(arg);
+          if (value === void 0) {
+            if (i + 1 == length) {
+              value = typeConstructor.apply(null, args);
+              if (value) {
+                value[dart._typeArguments] = args;
+                value[dart._originalDeclaration] = makeGenericType;
+              }
+              map.set(arg, value);
+              if (setBaseClass) setBaseClass(value);
+            } else {
+              value = new Map();
+              map.set(arg, value);
+            }
+          }
         }
+        return value;
       }
-      return value;
-    }
-    makeGenericType[dart._genericTypeCtor] = typeConstructor;
-    return makeGenericType;
+      makeGenericType[dart._genericTypeCtor] = typeConstructor;
+      return makeGenericType;
+    })();
   };
   dart.getGenericClass = function(type) {
     return dart.safeGetOwnProperty(type, dart._originalDeclaration);
@@ -1032,7 +1065,6 @@
     let proto = type.prototype;
     for (let name of methodNames) {
       let method = dart.getOwnPropertyDescriptor(proto, name);
-      if (!method) continue;
       dart.defineProperty(proto, dart.getExtensionSymbol(name), method);
     }
     let originalSigFn = dart.getOwnPropertyDescriptor(type, dart._methodSig).get;
@@ -1056,8 +1088,10 @@
     derived.__proto__ = base;
   };
   dart.setExtensionBaseClass = function(derived, base) {
-    derived.prototype[dart._extensionType] = derived;
-    derived.prototype.__proto__ = base.prototype;
+    if (base) {
+      derived.prototype[dart._extensionType] = derived;
+      derived.prototype.__proto__ = base.prototype;
+    }
   };
   dart.callableClass = function(callableCtor, classExpr) {
     callableCtor.prototype = classExpr.prototype;
@@ -1069,6 +1103,15 @@
     ctor.prototype = clazz.prototype;
     dart.defineProperty(clazz, name, {value: ctor, configurable: true});
   };
+  dart.defineEnumValues = function(enumClass, names) {
+    let values = [];
+    for (var i = 0; i < names.length; i++) {
+      let value = dart.const(new enumClass(i));
+      values.push(value);
+      Object.defineProperty(enumClass, names[i], {value: value, configurable: true});
+    }
+    enumClass.values = dart.constList(values, enumClass);
+  };
   dart.fn = function(closure, t) {
     if (t == null) {
       t = dart.definiteFunctionType(dart.dynamic, Array(closure.length).fill(dart.dynamic), void 0);
@@ -1128,6 +1171,23 @@
     }
     return type[dart._typeObject] = new dart.WrappedType(type);
   };
+  dart.lazyJSType = function(getJSTypeCallback, name) {
+    let key = getJSTypeCallback.toString();
+    if (dart._lazyJSTypes.has(key)) {
+      return dart._lazyJSTypes.get(key);
+    }
+    let ret = new dart.LazyJSType(getJSTypeCallback, name);
+    dart._lazyJSTypes.set(key, ret);
+    return ret;
+  };
+  dart.lazyAnonymousJSType = function(name) {
+    if (dart._lazyJSTypes.has(name)) {
+      return dart._lazyJSTypes.get(name);
+    }
+    let ret = new dart.LazyJSType(null, name);
+    dart._lazyJSTypes.set(name, ret);
+    return ret;
+  };
   const _wrappedType = Symbol('_wrappedType');
   dart.unwrapType = function(obj) {
     return dart.dload(obj, _wrappedType);
@@ -1150,6 +1210,42 @@
   dart.tagLazy = function(value, compute) {
     dart.defineLazyProperty(value, dart._runtimeType, {get: compute});
   };
+  dart._warn = function(arg) {
+    console.warn(arg);
+  };
+  const _jsTypeCallback = Symbol('_jsTypeCallback');
+  const _rawJSType = Symbol('_rawJSType');
+  const _dartName = Symbol('_dartName');
+  dart._isInstanceOfLazyJSType = function(o, t) {
+    if (t[_jsTypeCallback] != null) {
+      if (t[_rawJSType] == null) {
+        let expected = t[_dartName];
+        let actual = dart.typeName(dart.getReifiedType(o));
+        dart._warn(dart.str`Cannot find native JavaScript type (${expected}) ` + dart.str`to type check ${actual}`);
+        return true;
+      }
+      return dart.is(o, t[_rawJSType]);
+    }
+    if (o == null) return false;
+    return dart._isJSObject(o);
+  };
+  dart._asInstanceOfLazyJSType = function(o, t) {
+    if (t[_jsTypeCallback] != null) {
+      if (t[_rawJSType] == null) {
+        let expected = t[_dartName];
+        let actual = dart.typeName(dart.getReifiedType(o));
+        dart._warn(dart.str`Cannot find native JavaScript type (${expected}) ` + dart.str`to type check ${actual}`);
+        return o;
+      }
+      return dart.as(o, t[_rawJSType]);
+    }
+    if (o == null) return null;
+    if (!dart.test(dart._isJSObject(o))) dart._throwCastError(o, t, true);
+    return o;
+  };
+  dart._isJSObject = function(o) {
+    return !dart.getReifiedType(o)[dart._runtimeType];
+  };
   dart._initialize2 = function() {
     dart.TypeRep.prototype.is = function is_T(object) {
       return dart.is(object, this);
@@ -1169,6 +1265,15 @@
     dart.Dynamic.prototype._check = function check_Dynamic(object) {
       return object;
     };
+    dart.LazyJSType.prototype.is = function is_T(object) {
+      return dart._isInstanceOfLazyJSType(object, this);
+    };
+    dart.LazyJSType.prototype.as = function as_T(object) {
+      return dart._asInstanceOfLazyJSType(object, this);
+    };
+    dart.LazyJSType.prototype._check = function check_T(object) {
+      return dart._asInstanceOfLazyJSType(object, this);
+    };
   };
   dart._functionType = function(definite, returnType, args, extra) {
     if (args === void 0 && extra === void 0) {
@@ -1231,6 +1336,11 @@
   dart.isFunctionType = function(type) {
     return type instanceof dart.AbstractFunctionType || type === core.Function;
   };
+  dart.isLazyJSSubtype = function(t1, t2, covariant) {
+    if (dart.equals(t1, t2)) return true;
+    if (t1[_jsTypeCallback] == null || t2[_jsTypeCallback] == null) return true;
+    return dart.isClassSubType(t1[_rawJSType], t2[_rawJSType], covariant);
+  };
   dart.isFunctionSubtype = function(ft1, ft2, covariant) {
     if (ft2 === core.Function) {
       return true;
@@ -1326,6 +1436,9 @@
     if (dart.isFunctionType(t1) && dart.isFunctionType(t2)) {
       return dart.isFunctionSubtype(t1, t2, covariant);
     }
+    if (t1 instanceof dart.LazyJSType && t2 instanceof dart.LazyJSType) {
+      return dart.isLazyJSSubtype(t1, t2, covariant);
+    }
     return false;
   };
   dart.isClassSubType = function(t1, t2, covariant) {
@@ -1401,24 +1514,31 @@
     return true;
   };
   dart.throwCastError = function(object, actual, type) {
+    debugger;
     dart.throw(new _js_helper.CastErrorImplementation(object, dart.typeName(actual), dart.typeName(type)));
   };
   dart.throwTypeError = function(object, actual, type) {
+    debugger;
     dart.throw(new _js_helper.TypeErrorImplementation(object, dart.typeName(actual), dart.typeName(type)));
   };
   dart.throwStrongModeCastError = function(object, actual, type) {
+    debugger;
     dart.throw(new _js_helper.StrongModeCastError(object, dart.typeName(actual), dart.typeName(type)));
   };
   dart.throwStrongModeTypeError = function(object, actual, type) {
+    debugger;
     dart.throw(new _js_helper.StrongModeTypeError(object, dart.typeName(actual), dart.typeName(type)));
   };
   dart.throwUnimplementedError = function(message) {
+    debugger;
     dart.throw(new core.UnimplementedError(message));
   };
   dart.throwAssertionError = function() {
+    debugger;
     dart.throw(new core.AssertionError());
   };
   dart.throwNullValueError = function() {
+    debugger;
     dart.throw(new core.NoSuchMethodError(null, new core.Symbol('<Unexpected Null Value>'), null, null, null));
   };
   dart.syncStar = function(gen, E, ...args) {
@@ -1557,12 +1677,49 @@
   dart.dgcall = function(f, typeArgs, ...args) {
     return dart._checkAndCall(f, dart._getRuntimeType(f), void 0, typeArgs, args, 'call');
   };
+  dart._dhelperRepl = function(object, field, callback) {
+    let rawField = field;
+    if (typeof field == 'symbol') {
+      if (field in object) return callback(field);
+      field = field.toString();
+      field = field.substring('Symbol('.length, field.length - 1);
+    } else if (field.charAt(0) != '_') {
+      return callback(field);
+    }
+    if (field in object) return callback(field);
+    let proto = object;
+    while (proto !== null) {
+      let symbols = Object.getOwnPropertySymbols(proto);
+      let target = 'Symbol(' + field + ')';
+      for (let s = 0; s < symbols.length; s++) {
+        let sym = symbols[s];
+        if (target == sym.toString()) return callback(sym);
+      }
+      proto = proto.__proto__;
+    }
+    return callback(rawField);
+  };
+  dart.dloadRepl = function(obj, field) {
+    return dart._dhelperRepl(obj, field, dart.fn(resolvedField => dart.dload(obj, resolvedField), dynamicTodynamic$()));
+  };
+  dart.dputRepl = function(obj, field, value) {
+    return dart._dhelperRepl(obj, field, dart.fn(resolvedField => dart.dput(obj, resolvedField, value), dynamicTodynamic$()));
+  };
+  dart._callMethodRepl = function(obj, method, typeArgs, args) {
+    return dart._dhelperRepl(obj, method, dart.fn(resolvedField => dart._callMethod(obj, resolvedField, typeArgs, args, method), dynamicTodynamic$()));
+  };
+  dart.dsendRepl = function(obj, method, ...args) {
+    return dart._callMethodRepl(obj, method, null, args);
+  };
+  dart.dgsendRepl = function(obj, typeArgs, method, ...args) {
+    return dart._callMethodRepl(obj, method, typeArgs, args);
+  };
   dart.getDynamicStats = function() {
     let ret = JSArrayOfListOfObject().of([]);
     let keys = dart._callMethodStats[dartx.keys][dartx.toList]();
-    keys[dartx.sort](dart.fn((a, b) => dart._callMethodStats[dartx.get](b).count[dartx.compareTo](dart._callMethodStats[dartx.get](a).count), StringAndStringToint()));
+    keys[dartx.sort](dart.fn((a, b) => dart._callMethodStats[dartx._get](b).count[dartx.compareTo](dart._callMethodStats[dartx._get](a).count), StringAndStringToint()));
     for (let key of keys) {
-      let stats = dart._callMethodStats[dartx.get](key);
+      let stats = dart._callMethodStats[dartx._get](key);
       ret[dartx.add](JSArrayOfObject().of([stats.typeName, stats.frame, stats.count]));
     }
     return ret;
@@ -1577,7 +1734,7 @@
     let stack = stackStr[dartx.split]('\n    at ');
     let src = '';
     for (let i = 2; i < dart.notNull(stack[dartx.length]); ++i) {
-      let frame = stack[dartx.get](i);
+      let frame = stack[dartx._get](i);
       if (!dart.test(frame[dartx.contains]('dart_sdk.js'))) {
         src = frame;
         break;
@@ -1603,10 +1760,10 @@
     return dart._callMethod(obj, method, typeArgs, args, method);
   };
   dart.dindex = function(obj, index) {
-    return dart._callMethod(obj, 'get', null, [index], '[]');
+    return dart._callMethod(obj, '_get', null, [index], '[]');
   };
   dart.dsetindex = function(obj, index, value) {
-    return dart._callMethod(obj, 'set', null, [index, value], '[]=');
+    return dart._callMethod(obj, '_set', null, [index, value], '[]=');
   };
   dart._ignoreMemo = function(f) {
     let memo = new Map();
@@ -1729,11 +1886,11 @@
         for (let i = 0, end = values.length - 1; i < end; i += 2) {
           let key = values[i];
           let value = values[i + 1];
-          map.set(key, value);
+          map._set(key, value);
         }
       } else if (typeof values === 'object') {
         for (let key of dart.getOwnPropertyNames(values)) {
-          map.set(key, values[key]);
+          map._set(key, values[key]);
         }
       }
       return map;
@@ -1871,7 +2028,8 @@
     if (result != null) return dart.wrapType(result);
     let extension = dart.getExtensionType(obj);
     if (extension != null) {
-      return obj[dartx.runtimeType];
+      result = obj[dartx.runtimeType];
+      return result != null ? result : dart.wrapType(extension);
     }
     if (typeof obj == "function") {
       return dart.wrapType(dart.getReifiedType(obj));
@@ -1895,6 +2053,9 @@
     }
     return name;
   };
+  dart.loadLibrary = function() {
+    return async.Future.value();
+  };
   dart.defineProperty = function(obj, name, desc) {
     return Object.defineProperty(obj, name, desc);
   };
@@ -1908,9 +2069,11 @@
     return Object.getOwnPropertySymbols(obj);
   };
   dart.throwStrongModeError = function(message) {
+    debugger;
     throw new _js_helper.StrongModeErrorImplementation(message);
   };
   dart.throwInternalError = function(message) {
+    debugger;
     throw Error(message);
   };
   dart.getOwnNamesAndSymbols = function(obj) {
@@ -1997,6 +2160,12 @@
   dart.dartx = dartx;
   dart._runtimeType = Symbol("_runtimeType");
   dart.isNamedConstructor = Symbol("isNamedConstructor");
+  dart.defineLazy(dart, {
+    get _lazyJSTypes() {
+      return new Map();
+    },
+    set _lazyJSTypes(_) {}
+  });
   dart.metadata = Symbol("metadata");
   dart._typeObject = Symbol("typeObject");
   core.Object = class Object {
@@ -2067,6 +2236,27 @@
       return 'dynamic';
     }
   };
+  dart.LazyJSType = class LazyJSType extends core.Object {
+    new(jsTypeCallback, dartName) {
+      this[_jsTypeCallback] = jsTypeCallback;
+      this[_dartName] = dartName;
+    }
+    get [_rawJSType]() {
+      return this[_jsTypeCallback]();
+    }
+    toString() {
+      return core.String._check(this[_jsTypeCallback] != null ? dart.typeName(this[_rawJSType]) : this[_dartName]);
+    }
+  };
+  dart.LazyJSType[dart.implements] = () => [core.Type];
+  dart.setSignature(dart.LazyJSType, {
+    constructors: () => ({new: dart.definiteFunctionType(dart.LazyJSType, [dart.dynamic, dart.dynamic])}),
+    fields: () => ({
+      [_jsTypeCallback]: dart.dynamic,
+      [_dartName]: dart.dynamic
+    }),
+    getters: () => ({[_rawJSType]: dart.definiteFunctionType(dart.dynamic, [])})
+  });
   dart.dynamic = new dart.Dynamic();
   dart._initialize = dart._initialize2();
   dart.Void = class Void extends dart.TypeRep {
@@ -3073,7 +3263,7 @@
         if (genericTypeConstructor != null) {
           this.recordGenericParameters(core.String._check(name), genericTypeConstructor);
         } else {
-          nonGenericProperties.set(core.String._check(name), value);
+          nonGenericProperties._set(core.String._check(name), value);
         }
       }, dynamicAnddynamicTodynamic$()));
       nonGenericProperties.forEach(dart.fn((name, value) => {
@@ -3086,13 +3276,13 @@
       return children.toList();
     }
     recordGenericParameters(name, genericTypeConstructor) {
-      this.genericParameters.set(name, genericTypeConstructor.toString()[dartx.split](' =>')[dartx.first][dartx.replaceAll](core.RegExp.new('[(|)]'), ''));
+      this.genericParameters._set(name, genericTypeConstructor.toString()[dartx.split](' =>')[dartx.first][dartx.replaceAll](core.RegExp.new('[(|)]'), ''));
     }
     classChild(name, child) {
       let typeName = _debugger.getTypeName(core.Type._check(child));
       let parameterName = dart.str`${name}\$`;
       if (dart.test(this.genericParameters.keys[dartx.contains](parameterName))) {
-        typeName = dart.str`${typeName}<${this.genericParameters.get(parameterName)}>`;
+        typeName = dart.str`${typeName}<${this.genericParameters._get(parameterName)}>`;
         _debugger.JSNative.setProperty(child, 'genericTypeName', typeName);
       }
       return new _debugger.NameValuePair({name: typeName, value: child});
@@ -3555,8 +3745,12 @@
     constructors: () => ({new: dart.definiteFunctionType(_interceptors.JSBool, [])})
   });
   dart.registerExtension(dart.global.Boolean, _interceptors.JSBool);
-  _interceptors.JSIndexable = class JSIndexable extends core.Object {};
-  _interceptors.JSMutableIndexable = class JSMutableIndexable extends _interceptors.JSIndexable {};
+  _interceptors.JSIndexable$ = dart.generic(E => {
+    class JSIndexable extends core.Object {}
+    dart.addTypeTests(JSIndexable);
+    return JSIndexable;
+  });
+  _interceptors.JSIndexable = JSIndexable();
   _interceptors.JSObject = class JSObject extends core.Object {};
   _interceptors.JavaScriptObject = class JavaScriptObject extends _interceptors.Interceptor {
     new() {
@@ -3619,6 +3813,7 @@
     let SetOfE = () => (SetOfE = dart.constFn(core.Set$(E)))();
     let ArrayIteratorOfE = () => (ArrayIteratorOfE = dart.constFn(_interceptors.ArrayIterator$(E)))();
     let ListMapViewOfE = () => (ListMapViewOfE = dart.constFn(_internal.ListMapView$(E)))();
+    let JSIndexableOfE = () => (JSIndexableOfE = dart.constFn(_interceptors.JSIndexable$(E)))();
     let ETobool = () => (ETobool = dart.constFn(dart.functionType(core.bool, [E])))();
     let ETovoid = () => (ETovoid = dart.constFn(dart.functionType(dart.void, [E])))();
     let EAndEToint = () => (EAndEToint = dart.constFn(dart.functionType(core.int, [E, E])))();
@@ -3677,8 +3872,8 @@
       'hashCode',
       'length',
       'length',
-      'get',
-      'set',
+      '_get',
+      '_set',
       'asMap'
     ]);
     class JSArray extends core.Object {
@@ -3755,7 +3950,7 @@
         this[dartx.checkMutable]('setAll');
         core.RangeError.checkValueInInterval(index, 0, this[dartx.length], "index");
         for (let element of iterable) {
-          this[dartx.set]((() => {
+          this[dartx._set]((() => {
             let x = index;
             index = dart.notNull(x) + 1;
             return x;
@@ -3770,7 +3965,7 @@
       [dartx.remove](element) {
         this[dartx.checkGrowable]('remove');
         for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-          if (dart.equals(this[dartx.get](i), element)) {
+          if (dart.equals(this[dartx._get](i), element)) {
             this.splice(i, 1);
             return true;
           }
@@ -3798,7 +3993,7 @@
         if (retained[dartx.length] == end) return;
         this[dartx.length] = retained[dartx.length];
         for (let i = 0; i < dart.notNull(retained[dartx.length]); i++) {
-          this[dartx.set](i, E._check(retained[dartx.get](i)));
+          this[dartx._set](i, E._check(retained[dartx._get](i)));
         }
       }
       [dartx.where](f) {
@@ -3839,7 +4034,7 @@
         if (separator === void 0) separator = "";
         let list = core.List.new(this[dartx.length]);
         for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-          list[dartx.set](i, dart.str`${this[dartx.get](i)}`);
+          list[dartx._set](i, dart.str`${this[dartx._get](i)}`);
         }
         return list.join(separator);
       }
@@ -3859,7 +4054,7 @@
         EAndEToE()._check(combine);
         let length = this[dartx.length];
         if (length == 0) dart.throw(_internal.IterableElementError.noElement());
-        let value = this[dartx.get](0);
+        let value = this[dartx._get](0);
         for (let i = 1; i < dart.notNull(length); i++) {
           let element = this[i];
           value = combine(value, element);
@@ -3926,7 +4121,7 @@
         dart.throw(_internal.IterableElementError.noElement());
       }
       [dartx.elementAt](index) {
-        return this[dartx.get](index);
+        return this[dartx._get](index);
       }
       [dartx.sublist](start, end) {
         if (end === void 0) end = null;
@@ -3951,15 +4146,15 @@
         return new (SubListIterableOfE())(this, start, end);
       }
       get [dartx.first]() {
-        if (dart.notNull(this[dartx.length]) > 0) return this[dartx.get](0);
+        if (dart.notNull(this[dartx.length]) > 0) return this[dartx._get](0);
         dart.throw(_internal.IterableElementError.noElement());
       }
       get [dartx.last]() {
-        if (dart.notNull(this[dartx.length]) > 0) return this[dartx.get](dart.notNull(this[dartx.length]) - 1);
+        if (dart.notNull(this[dartx.length]) > 0) return this[dartx._get](dart.notNull(this[dartx.length]) - 1);
         dart.throw(_internal.IterableElementError.noElement());
       }
       get [dartx.single]() {
-        if (this[dartx.length] == 1) return this[dartx.get](0);
+        if (this[dartx.length] == 1) return this[dartx._get](0);
         if (this[dartx.length] == 0) dart.throw(_internal.IterableElementError.noElement());
         dart.throw(_internal.IterableElementError.tooMany());
       }
@@ -3991,12 +4186,12 @@
         }
         if (dart.notNull(otherStart) < dart.notNull(start)) {
           for (let i = length - 1; i >= 0; i--) {
-            let element = otherList[dartx.get](dart.notNull(otherStart) + i);
+            let element = otherList[dartx._get](dart.notNull(otherStart) + i);
             this[dart.notNull(start) + i] = element;
           }
         } else {
           for (let i = 0; i < length; i++) {
-            let element = otherList[dartx.get](dart.notNull(otherStart) + i);
+            let element = otherList[dartx._get](dart.notNull(otherStart) + i);
             this[dart.notNull(start) + i] = element;
           }
         }
@@ -4075,9 +4270,9 @@
         while (dart.notNull(length) > 1) {
           let pos = random.nextInt(length);
           length = dart.notNull(length) - 1;
-          let tmp = this[dartx.get](length);
-          this[dartx.set](length, this[dartx.get](pos));
-          this[dartx.set](pos, tmp);
+          let tmp = this[dartx._get](length);
+          this[dartx._set](length, this[dartx._get](pos));
+          this[dartx._set](pos, tmp);
         }
       }
       [dartx.indexOf](element, start) {
@@ -4089,7 +4284,7 @@
           start = 0;
         }
         for (let i = start; dart.notNull(i) < dart.notNull(this[dartx.length]); i = dart.notNull(i) + 1) {
-          if (dart.equals(this[dartx.get](i), element)) {
+          if (dart.equals(this[dartx._get](i), element)) {
             return i;
           }
         }
@@ -4108,7 +4303,7 @@
           }
         }
         for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) {
-          if (dart.equals(this[dartx.get](i), element)) {
+          if (dart.equals(this[dartx._get](i), element)) {
             return i;
           }
         }
@@ -4116,7 +4311,7 @@
       }
       [dartx.contains](other) {
         for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-          if (dart.equals(this[dartx.get](i), other)) return true;
+          if (dart.equals(this[dartx._get](i), other)) return true;
         }
         return false;
       }
@@ -4157,12 +4352,12 @@
         }
         this.length = newLength;
       }
-      [dartx.get](index) {
+      [dartx._get](index) {
         if (!(typeof index == 'number')) dart.throw(_js_helper.diagnoseIndexError(this, index));
         if (dart.notNull(index) >= dart.notNull(this[dartx.length]) || dart.notNull(index) < 0) dart.throw(_js_helper.diagnoseIndexError(this, index));
         return this[index];
       }
-      [dartx.set](index, value) {
+      [dartx._set](index, value) {
         E._check(value);
         this[dartx.checkMutable]('indexed set');
         if (!(typeof index == 'number')) dart.throw(_js_helper.diagnoseIndexError(this, index));
@@ -4176,7 +4371,7 @@
     }
     dart.setExtensionBaseClass(JSArray, dart.global.Array);
     dart.addTypeTests(JSArray);
-    JSArray[dart.implements] = () => [ListOfE(), _interceptors.JSIndexable];
+    JSArray[dart.implements] = () => [ListOfE(), JSIndexableOfE()];
     dart.setSignature(JSArray, {
       constructors: () => ({
         new: dart.definiteFunctionType(_interceptors.JSArray$(E), []),
@@ -4241,8 +4436,8 @@
         [dartx.contains]: dart.definiteFunctionType(core.bool, [core.Object]),
         [dartx.toList]: dart.definiteFunctionType(core.List$(E), [], {growable: core.bool}),
         [dartx.toSet]: dart.definiteFunctionType(core.Set$(E), []),
-        [dartx.get]: dart.definiteFunctionType(E, [core.int]),
-        [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, E]),
+        [dartx._get]: dart.definiteFunctionType(E, [core.int]),
+        [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, E]),
         [dartx.asMap]: dart.definiteFunctionType(core.Map$(core.int, E), [])
       }),
       statics: () => ({
@@ -4261,7 +4456,6 @@
         super.new();
       }
     }
-    JSMutableArray[dart.implements] = () => [_interceptors.JSMutableIndexable];
     return JSMutableArray;
   });
   _interceptors.JSMutableArray = JSMutableArray();
@@ -4318,7 +4512,7 @@
           this[_current] = null;
           return false;
         }
-        this[_current] = this[_iterable][dartx.get](this[_index]);
+        this[_current] = this[_iterable][dartx._get](this[_index]);
         this[_index] = dart.notNull(this[_index]) + 1;
         return true;
       }
@@ -4370,7 +4564,7 @@
     'toRadixString',
     'toString',
     'hashCode',
-    'unary-',
+    '_negate',
     '+',
     '-',
     '/',
@@ -4567,7 +4761,7 @@
     get [dartx.hashCode]() {
       return this & 0x1FFFFFFF;
     }
-    [dartx['unary-']]() {
+    [dartx._negate]() {
       return -this;
     }
     [dartx['+']](other) {
@@ -4865,7 +5059,7 @@
       [dartx.toStringAsExponential]: dart.definiteFunctionType(core.String, [], [core.int]),
       [dartx.toStringAsPrecision]: dart.definiteFunctionType(core.String, [core.int]),
       [dartx.toRadixString]: dart.definiteFunctionType(core.String, [core.int]),
-      [dartx['unary-']]: dart.definiteFunctionType(_interceptors.JSNumber, []),
+      [dartx._negate]: dart.definiteFunctionType(_interceptors.JSNumber, []),
       [dartx['+']]: dart.definiteFunctionType(_interceptors.JSNumber, [core.num]),
       [dartx['-']]: dart.definiteFunctionType(_interceptors.JSNumber, [core.num]),
       [dartx['/']]: dart.definiteFunctionType(core.double, [core.num]),
@@ -4948,7 +5142,7 @@
     'hashCode',
     'runtimeType',
     'length',
-    'get'
+    '_get'
   ]);
   _interceptors.JSString = class JSString extends _interceptors.Interceptor {
     new() {
@@ -5331,13 +5525,13 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (!(typeof index == 'number')) dart.throw(_js_helper.diagnoseIndexError(this, index));
       if (dart.notNull(index) >= dart.notNull(this[dartx.length]) || dart.notNull(index) < 0) dart.throw(_js_helper.diagnoseIndexError(this, index));
       return this[index];
     }
   };
-  _interceptors.JSString[dart.implements] = () => [core.String, _interceptors.JSIndexable];
+  _interceptors.JSString[dart.implements] = () => [core.String, JSIndexableOfString()];
   dart.setSignature(_interceptors.JSString, {
     constructors: () => ({new: dart.definiteFunctionType(_interceptors.JSString, [])}),
     getters: () => ({
@@ -5375,7 +5569,7 @@
       [dartx.lastIndexOf]: dart.definiteFunctionType(core.int, [core.Pattern], [core.int]),
       [dartx.contains]: dart.definiteFunctionType(core.bool, [core.Pattern], [core.int]),
       [dartx.compareTo]: dart.definiteFunctionType(core.int, [core.String]),
-      [dartx.get]: dart.definiteFunctionType(core.String, [core.int])
+      [dartx._get]: dart.definiteFunctionType(core.String, [core.int])
     }),
     statics: () => ({
       _isWhitespace: dart.definiteFunctionType(core.bool, [core.int]),
@@ -5451,6 +5645,7 @@
   });
   _internal.POWERS_OF_TEN = dart.constList([1.0, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, 10000000.0, 100000000.0, 1000000000.0, 10000000000.0, 100000000000.0, 1000000000000.0, 10000000000000.0, 100000000000000.0, 1000000000000000.0, 10000000000000000.0, 100000000000000000.0, 1000000000000000000.0, 10000000000000000000.0, 100000000000000000000.0, 1e+21, 1e+22], core.double);
   const _string = Symbol('_string');
+  const _filter = Symbol('_filter');
   collection.ListMixin$ = dart.generic(E => {
     let ListIteratorOfE = () => (ListIteratorOfE = dart.constFn(_internal.ListIterator$(E)))();
     let VoidToE = () => (VoidToE = dart.constFn(dart.functionType(E, [])))();
@@ -5462,6 +5657,7 @@
     let ListOfE = () => (ListOfE = dart.constFn(core.List$(E)))();
     let SetOfE = () => (SetOfE = dart.constFn(core.Set$(E)))();
     let IterableOfE = () => (IterableOfE = dart.constFn(core.Iterable$(E)))();
+    let JSArrayOfE = () => (JSArrayOfE = dart.constFn(_interceptors.JSArray$(E)))();
     let ListMapViewOfE = () => (ListMapViewOfE = dart.constFn(_internal.ListMapView$(E)))();
     let ReversedListIterableOfE = () => (ReversedListIterableOfE = dart.constFn(_internal.ReversedListIterable$(E)))();
     let ETovoid = () => (ETovoid = dart.constFn(dart.functionType(dart.void, [E])))();
@@ -5527,12 +5723,12 @@
         return new dart.JsIterator(this[dartx.iterator]);
       }
       elementAt(index) {
-        return this[dartx.get](index);
+        return this[dartx._get](index);
       }
       forEach(action) {
         let length = this[dartx.length];
         for (let i = 0; i < dart.notNull(length); i++) {
-          action(this[dartx.get](i));
+          action(this[dartx._get](i));
           if (length != this[dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this));
           }
@@ -5546,21 +5742,21 @@
       }
       get first() {
         if (this[dartx.length] == 0) dart.throw(_internal.IterableElementError.noElement());
-        return this[dartx.get](0);
+        return this[dartx._get](0);
       }
       get last() {
         if (this[dartx.length] == 0) dart.throw(_internal.IterableElementError.noElement());
-        return this[dartx.get](dart.notNull(this[dartx.length]) - 1);
+        return this[dartx._get](dart.notNull(this[dartx.length]) - 1);
       }
       get single() {
         if (this[dartx.length] == 0) dart.throw(_internal.IterableElementError.noElement());
         if (dart.notNull(this[dartx.length]) > 1) dart.throw(_internal.IterableElementError.tooMany());
-        return this[dartx.get](0);
+        return this[dartx._get](0);
       }
       contains(element) {
         let length = this[dartx.length];
         for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-          if (dart.equals(this[dartx.get](i), element)) return true;
+          if (dart.equals(this[dartx._get](i), element)) return true;
           if (length != this[dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this));
           }
@@ -5570,7 +5766,7 @@
       every(test) {
         let length = this[dartx.length];
         for (let i = 0; i < dart.notNull(length); i++) {
-          if (!dart.test(test(this[dartx.get](i)))) return false;
+          if (!dart.test(test(this[dartx._get](i)))) return false;
           if (length != this[dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this));
           }
@@ -5580,7 +5776,7 @@
       any(test) {
         let length = this[dartx.length];
         for (let i = 0; i < dart.notNull(length); i++) {
-          if (dart.test(test(this[dartx.get](i)))) return true;
+          if (dart.test(test(this[dartx._get](i)))) return true;
           if (length != this[dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this));
           }
@@ -5592,7 +5788,7 @@
         VoidToE()._check(orElse);
         let length = this[dartx.length];
         for (let i = 0; i < dart.notNull(length); i++) {
-          let element = this[dartx.get](i);
+          let element = this[dartx._get](i);
           if (dart.test(test(element))) return element;
           if (length != this[dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this));
@@ -5606,7 +5802,7 @@
         VoidToE()._check(orElse);
         let length = this[dartx.length];
         for (let i = dart.notNull(length) - 1; i >= 0; i--) {
-          let element = this[dartx.get](i);
+          let element = this[dartx._get](i);
           if (dart.test(test(element))) return element;
           if (length != this[dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this));
@@ -5620,7 +5816,7 @@
         let match = null;
         let matchFound = false;
         for (let i = 0; i < dart.notNull(length); i++) {
-          let element = this[dartx.get](i);
+          let element = this[dartx._get](i);
           if (dart.test(test(element))) {
             if (matchFound) {
               dart.throw(_internal.IterableElementError.tooMany());
@@ -5659,9 +5855,9 @@
         EAndEToE()._check(combine);
         let length = this[dartx.length];
         if (length == 0) dart.throw(_internal.IterableElementError.noElement());
-        let value = this[dartx.get](0);
+        let value = this[dartx._get](0);
         for (let i = 1; i < dart.notNull(length); i++) {
-          value = combine(value, this[dartx.get](i));
+          value = combine(value, this[dartx._get](i));
           if (length != this[dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this));
           }
@@ -5673,7 +5869,7 @@
           let value = initialValue;
           let length = this[dartx.length];
           for (let i = 0; i < dart.notNull(length); i++) {
-            value = combine(value, this[dartx.get](i));
+            value = combine(value, this[dartx._get](i));
             if (length != this[dartx.length]) {
               dart.throw(new core.ConcurrentModificationError(this));
             }
@@ -5703,20 +5899,20 @@
           result = ListOfE().new(this[dartx.length]);
         }
         for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-          result[dartx.set](i, this[dartx.get](i));
+          result[dartx._set](i, this[dartx._get](i));
         }
         return result;
       }
       toSet() {
         let result = SetOfE().new();
         for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-          result.add(this[dartx.get](i));
+          result.add(this[dartx._get](i));
         }
         return result;
       }
       add(element) {
         E._check(element);
-        this[dartx.set]((() => {
+        this[dartx._set]((() => {
           let x = this[dartx.length];
           this[dartx.length] = dart.notNull(x) + 1;
           return x;
@@ -5728,13 +5924,13 @@
         for (let element of iterable) {
           dart.assert(this[dartx.length] == i || dart.test(dart.throw(new core.ConcurrentModificationError(this))));
           this[dartx.length] = dart.notNull(i) + 1;
-          this[dartx.set](i, element);
+          this[dartx._set](i, element);
           i = dart.notNull(i) + 1;
         }
       }
       remove(element) {
         for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-          if (dart.equals(this[dartx.get](i), element)) {
+          if (dart.equals(this[dartx._get](i), element)) {
             this[dartx.setRange](i, dart.notNull(this[dartx.length]) - 1, this, i + 1);
             this[dartx.length] = dart.notNull(this[dartx.length]) - 1;
             return true;
@@ -5743,16 +5939,17 @@
         return false;
       }
       removeWhere(test) {
-        collection.ListMixin._filter(this, test, false);
+        this[_filter](test, false);
       }
       retainWhere(test) {
-        collection.ListMixin._filter(this, test, true);
+        this[_filter](test, true);
       }
-      static _filter(source, test, retainMatching) {
-        let retained = [];
+      [_filter](test, retainMatching) {
+        let source = this;
+        let retained = JSArrayOfE().of([]);
         let length = source[dartx.length];
         for (let i = 0; i < dart.notNull(length); i++) {
-          let element = source[dartx.get](i);
+          let element = source[dartx._get](i);
           if (dart.dcall(test, element) == retainMatching) {
             retained[dartx.add](element);
           }
@@ -5772,7 +5969,7 @@
         if (this[dartx.length] == 0) {
           dart.throw(_internal.IterableElementError.noElement());
         }
-        let result = this[dartx.get](dart.notNull(this[dartx.length]) - 1);
+        let result = this[dartx._get](dart.notNull(this[dartx.length]) - 1);
         this[dartx.length] = dart.notNull(this[dartx.length]) - 1;
         return result;
       }
@@ -5791,9 +5988,9 @@
         while (dart.notNull(length) > 1) {
           let pos = random.nextInt(length);
           length = dart.notNull(length) - 1;
-          let tmp = this[dartx.get](length);
-          this[dartx.set](length, this[dartx.get](pos));
-          this[dartx.set](pos, tmp);
+          let tmp = this[dartx._get](length);
+          this[dartx._set](length, this[dartx._get](pos));
+          this[dartx._set](pos, tmp);
         }
       }
       asMap() {
@@ -5808,7 +6005,7 @@
         let result = ListOfE().new();
         result[dartx.length] = length;
         for (let i = 0; i < length; i++) {
-          result[dartx.set](i, this[dartx.get](dart.notNull(start) + i));
+          result[dartx._set](i, this[dartx._get](dart.notNull(start) + i));
         }
         return result;
       }
@@ -5827,7 +6024,7 @@
         E._check(fill);
         core.RangeError.checkValidRange(start, end, this[dartx.length]);
         for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-          this[dartx.set](i, fill);
+          this[dartx._set](i, fill);
         }
       }
       setRange(start, end, iterable, skipCount) {
@@ -5851,11 +6048,11 @@
         }
         if (dart.notNull(otherStart) < dart.notNull(start)) {
           for (let i = length - 1; i >= 0; i--) {
-            this[dartx.set](dart.notNull(start) + i, otherList[dartx.get](dart.notNull(otherStart) + i));
+            this[dartx._set](dart.notNull(start) + i, otherList[dartx._get](dart.notNull(otherStart) + i));
           }
         } else {
           for (let i = 0; i < length; i++) {
-            this[dartx.set](dart.notNull(start) + i, otherList[dartx.get](dart.notNull(otherStart) + i));
+            this[dartx._set](dart.notNull(start) + i, otherList[dartx._get](dart.notNull(otherStart) + i));
           }
         }
       }
@@ -5894,7 +6091,7 @@
           startIndex = 0;
         }
         for (let i = startIndex; dart.notNull(i) < dart.notNull(this[dartx.length]); i = dart.notNull(i) + 1) {
-          if (dart.equals(this[dartx.get](i), element)) {
+          if (dart.equals(this[dartx._get](i), element)) {
             return i;
           }
         }
@@ -5913,7 +6110,7 @@
           }
         }
         for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) {
-          if (dart.equals(this[dartx.get](i), element)) {
+          if (dart.equals(this[dartx._get](i), element)) {
             return i;
           }
         }
@@ -5929,10 +6126,10 @@
         if (!(typeof index == 'number')) dart.throw(new core.ArgumentError(index));
         this[dartx.length] = dart.notNull(this[dartx.length]) + 1;
         this[dartx.setRange](dart.notNull(index) + 1, this[dartx.length], this, index);
-        this[dartx.set](index, element);
+        this[dartx._set](index, element);
       }
       removeAt(index) {
-        let result = this[dartx.get](index);
+        let result = this[dartx._get](index);
         this[dartx.setRange](index, dart.notNull(this[dartx.length]) - 1, this, dart.notNull(index) + 1);
         this[dartx.length] = dart.notNull(this[dartx.length]) - 1;
         return result;
@@ -5958,7 +6155,7 @@
           this[dartx.setRange](index, dart.notNull(index) + dart.notNull(iterable[dartx.length]), iterable);
         } else {
           for (let element of iterable) {
-            this[dartx.set]((() => {
+            this[dartx._set]((() => {
               let x = index;
               index = dart.notNull(x) + 1;
               return x;
@@ -6011,6 +6208,7 @@
         remove: dart.definiteFunctionType(core.bool, [core.Object]),
         removeWhere: dart.definiteFunctionType(dart.void, [ETobool()]),
         retainWhere: dart.definiteFunctionType(dart.void, [ETobool()]),
+        [_filter]: dart.definiteFunctionType(dart.void, [dynamicTobool(), core.bool]),
         clear: dart.definiteFunctionType(dart.void, []),
         removeLast: dart.definiteFunctionType(E, []),
         sort: dart.definiteFunctionType(dart.void, [], [EAndEToint()]),
@@ -6028,9 +6226,7 @@
         removeAt: dart.definiteFunctionType(E, [core.int]),
         insertAll: dart.definiteFunctionType(dart.void, [core.int, IterableOfE()]),
         setAll: dart.definiteFunctionType(dart.void, [core.int, IterableOfE()])
-      }),
-      statics: () => ({_filter: dart.definiteFunctionType(dart.void, [core.List, dynamicTobool(), core.bool])}),
-      names: ['_filter']
+      })
     });
     dart.defineExtensionMembers(ListMixin, [
       'elementAt',
@@ -6107,7 +6303,7 @@
     let ETobool = () => (ETobool = dart.constFn(dart.functionType(core.bool, [E])))();
     let ComparatorOfE = () => (ComparatorOfE = dart.constFn(core.Comparator$(E)))();
     class UnmodifiableListMixin extends core.Object {
-      set(index, value) {
+      _set(index, value) {
         E._check(value);
         dart.throw(new core.UnsupportedError("Cannot modify an unmodifiable list"));
         return value;
@@ -6184,7 +6380,7 @@
     dart.setSignature(UnmodifiableListMixin, {
       setters: () => ({length: dart.definiteFunctionType(dart.void, [core.int])}),
       methods: () => ({
-        set: dart.definiteFunctionType(dart.void, [core.int, E]),
+        _set: dart.definiteFunctionType(dart.void, [core.int, E]),
         setAll: dart.definiteFunctionType(dart.void, [core.int, IterableOfE()]),
         add: dart.definiteFunctionType(dart.void, [E]),
         insert: dart.definiteFunctionType(dart.void, [core.int, E]),
@@ -6205,7 +6401,7 @@
       })
     });
     dart.defineExtensionMembers(UnmodifiableListMixin, [
-      'set',
+      '_set',
       'setAll',
       'add',
       'insert',
@@ -6274,7 +6470,7 @@
     set length(value) {
       super.length = value;
     }
-    get(i) {
+    _get(i) {
       return this[_string][dartx.codeUnitAt](i);
     }
     static stringOf(u) {
@@ -6286,11 +6482,11 @@
     constructors: () => ({new: dart.definiteFunctionType(_internal.CodeUnits, [core.String])}),
     fields: () => ({[_string]: core.String}),
     getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
-    methods: () => ({get: dart.definiteFunctionType(core.int, [core.int])}),
+    methods: () => ({_get: dart.definiteFunctionType(core.int, [core.int])}),
     statics: () => ({stringOf: dart.definiteFunctionType(core.String, [_internal.CodeUnits])}),
     names: ['stringOf']
   });
-  dart.defineExtensionMembers(_internal.CodeUnits, ['get', 'length']);
+  dart.defineExtensionMembers(_internal.CodeUnits, ['_get', 'length']);
   _internal.EfficientLength = class EfficientLength extends core.Object {};
   core.Iterable$ = dart.generic(E => {
     let EmptyIterableOfE = () => (EmptyIterableOfE = dart.constFn(_internal.EmptyIterable$(E)))();
@@ -6809,7 +7005,7 @@
           result = ListOfE().new(this.length);
         }
         for (let i = 0; i < dart.notNull(this.length); i++) {
-          result[dartx.set](i, this.elementAt(i));
+          result[dartx._set](i, this.elementAt(i));
         }
         return result;
       }
@@ -6957,7 +7153,7 @@
           return _;
         })() : ListOfE().new(length);
         for (let i = 0; i < length; i++) {
-          result[dartx.set](i, this[_iterable$][dartx.elementAt](dart.notNull(start) + i));
+          result[dartx._set](i, this[_iterable$][dartx.elementAt](dart.notNull(start) + i));
           if (dart.notNull(this[_iterable$][dartx.length]) < dart.notNull(end)) dart.throw(new core.ConcurrentModificationError(this));
         }
         return result;
@@ -8007,8 +8203,8 @@
       new(values) {
         this[_values] = values;
       }
-      get(key) {
-        return dart.test(this.containsKey(key)) ? this[_values][dartx.get](core.int._check(key)) : null;
+      _get(key) {
+        return dart.test(this.containsKey(key)) ? this[_values][dartx._get](core.int._check(key)) : null;
       }
       get length() {
         return this[_values][dartx.length];
@@ -8034,13 +8230,13 @@
       forEach(f) {
         let length = this[_values][dartx.length];
         for (let i = 0; i < dart.notNull(length); i++) {
-          f(i, this[_values][dartx.get](i));
+          f(i, this[_values][dartx._get](i));
           if (length != this[_values][dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this[_values]));
           }
         }
       }
-      set(key, value) {
+      _set(key, value) {
         E._check(value);
         dart.throw(new core.UnsupportedError("Cannot modify an unmodifiable map"));
         return value;
@@ -8076,11 +8272,11 @@
         isNotEmpty: dart.definiteFunctionType(core.bool, [])
       }),
       methods: () => ({
-        get: dart.definiteFunctionType(E, [core.Object]),
+        _get: dart.definiteFunctionType(E, [core.Object]),
         containsValue: dart.definiteFunctionType(core.bool, [core.Object]),
         containsKey: dart.definiteFunctionType(core.bool, [core.Object]),
         forEach: dart.definiteFunctionType(dart.void, [intAndETovoid()]),
-        set: dart.definiteFunctionType(dart.void, [core.int, E]),
+        _set: dart.definiteFunctionType(dart.void, [core.int, E]),
         putIfAbsent: dart.definiteFunctionType(E, [core.int, VoidToE()]),
         remove: dart.definiteFunctionType(E, [core.Object]),
         clear: dart.definiteFunctionType(dart.void, []),
@@ -8088,11 +8284,11 @@
       })
     });
     dart.defineExtensionMembers(ListMapView, [
-      'get',
+      '_get',
       'containsValue',
       'containsKey',
       'forEach',
-      'set',
+      '_set',
       'putIfAbsent',
       'remove',
       'clear',
@@ -8189,11 +8385,11 @@
     static copy(src, srcStart, dst, dstStart, count) {
       if (dart.notNull(srcStart) < dart.notNull(dstStart)) {
         for (let i = dart.notNull(srcStart) + dart.notNull(count) - 1, j = dart.notNull(dstStart) + dart.notNull(count) - 1; i >= dart.notNull(srcStart); i--, j--) {
-          dst[dartx.set](j, src[dartx.get](i));
+          dst[dartx._set](j, src[dartx._get](i));
         }
       } else {
         for (let i = srcStart, j = dstStart; dart.notNull(i) < dart.notNull(srcStart) + dart.notNull(count); i = dart.notNull(i) + 1, j = dart.notNull(j) + 1) {
-          dst[dartx.set](j, src[dartx.get](i));
+          dst[dartx._set](j, src[dartx._get](i));
         }
       }
     }
@@ -8203,7 +8399,7 @@
       let length = a[dartx.length];
       if (!dart.equals(length, dart.dload(b, 'length'))) return false;
       for (let i = 0; i < dart.notNull(length); i++) {
-        if (!core.identical(a[dartx.get](i), dart.dindex(b, i))) return false;
+        if (!core.identical(a[dartx._get](i), dart.dindex(b, i))) return false;
       }
       return true;
     }
@@ -8215,7 +8411,7 @@
         startIndex = 0;
       }
       for (let i = startIndex; dart.notNull(i) < dart.notNull(endIndex); i = dart.notNull(i) + 1) {
-        if (dart.equals(a[dartx.get](i), element)) {
+        if (dart.equals(a[dartx._get](i), element)) {
           return i;
         }
       }
@@ -8229,7 +8425,7 @@
         startIndex = dart.notNull(a[dartx.length]) - 1;
       }
       for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) {
-        if (dart.equals(a[dartx.get](i), element)) {
+        if (dart.equals(a[dartx._get](i), element)) {
           return i;
         }
       }
@@ -8289,13 +8485,13 @@
     static _insertionSort(E) {
       return (a, left, right, compare) => {
         for (let i = dart.notNull(left) + 1; i <= dart.notNull(right); i++) {
-          let el = a[dartx.get](i);
+          let el = a[dartx._get](i);
           let j = i;
-          while (j > dart.notNull(left) && dart.notNull(compare(a[dartx.get](j - 1), el)) > 0) {
-            a[dartx.set](j, a[dartx.get](j - 1));
+          while (j > dart.notNull(left) && dart.notNull(compare(a[dartx._get](j - 1), el)) > 0) {
+            a[dartx._set](j, a[dartx._get](j - 1));
             j--;
           }
-          a[dartx.set](j, el);
+          a[dartx._set](j, el);
         }
       };
     }
@@ -8308,11 +8504,11 @@
         let index3 = ((dart.notNull(left) + dart.notNull(right)) / 2)[dartx.truncate]();
         let index2 = index3 - sixth;
         let index4 = index3 + sixth;
-        let el1 = a[dartx.get](index1);
-        let el2 = a[dartx.get](index2);
-        let el3 = a[dartx.get](index3);
-        let el4 = a[dartx.get](index4);
-        let el5 = a[dartx.get](index5);
+        let el1 = a[dartx._get](index1);
+        let el2 = a[dartx._get](index2);
+        let el3 = a[dartx._get](index3);
+        let el4 = a[dartx._get](index4);
+        let el5 = a[dartx._get](index5);
         if (dart.notNull(compare(el1, el2)) > 0) {
           let t = el1;
           el1 = el2;
@@ -8360,40 +8556,40 @@
         }
         let pivot1 = el2;
         let pivot2 = el4;
-        a[dartx.set](index1, el1);
-        a[dartx.set](index3, el3);
-        a[dartx.set](index5, el5);
-        a[dartx.set](index2, a[dartx.get](left));
-        a[dartx.set](index4, a[dartx.get](right));
+        a[dartx._set](index1, el1);
+        a[dartx._set](index3, el3);
+        a[dartx._set](index5, el5);
+        a[dartx._set](index2, a[dartx._get](left));
+        a[dartx._set](index4, a[dartx._get](right));
         let less = dart.notNull(left) + 1;
         let great = dart.notNull(right) - 1;
         let pivots_are_equal = compare(pivot1, pivot2) == 0;
         if (pivots_are_equal) {
           let pivot = pivot1;
           for (let k = less; k <= great; k++) {
-            let ak = a[dartx.get](k);
+            let ak = a[dartx._get](k);
             let comp = compare(ak, pivot);
             if (comp == 0) continue;
             if (dart.notNull(comp) < 0) {
               if (k != less) {
-                a[dartx.set](k, a[dartx.get](less));
-                a[dartx.set](less, ak);
+                a[dartx._set](k, a[dartx._get](less));
+                a[dartx._set](less, ak);
               }
               less++;
             } else {
               while (true) {
-                comp = compare(a[dartx.get](great), pivot);
+                comp = compare(a[dartx._get](great), pivot);
                 if (dart.notNull(comp) > 0) {
                   great--;
                   continue;
                 } else if (dart.notNull(comp) < 0) {
-                  a[dartx.set](k, a[dartx.get](less));
-                  a[dartx.set](less++, a[dartx.get](great));
-                  a[dartx.set](great--, ak);
+                  a[dartx._set](k, a[dartx._get](less));
+                  a[dartx._set](less++, a[dartx._get](great));
+                  a[dartx._set](great--, ak);
                   break;
                 } else {
-                  a[dartx.set](k, a[dartx.get](great));
-                  a[dartx.set](great--, ak);
+                  a[dartx._set](k, a[dartx._get](great));
+                  a[dartx._set](great--, ak);
                   break;
                 }
               }
@@ -8401,32 +8597,32 @@
           }
         } else {
           for (let k = less; k <= great; k++) {
-            let ak = a[dartx.get](k);
+            let ak = a[dartx._get](k);
             let comp_pivot1 = compare(ak, pivot1);
             if (dart.notNull(comp_pivot1) < 0) {
               if (k != less) {
-                a[dartx.set](k, a[dartx.get](less));
-                a[dartx.set](less, ak);
+                a[dartx._set](k, a[dartx._get](less));
+                a[dartx._set](less, ak);
               }
               less++;
             } else {
               let comp_pivot2 = compare(ak, pivot2);
               if (dart.notNull(comp_pivot2) > 0) {
                 while (true) {
-                  let comp = compare(a[dartx.get](great), pivot2);
+                  let comp = compare(a[dartx._get](great), pivot2);
                   if (dart.notNull(comp) > 0) {
                     great--;
                     if (great < k) break;
                     continue;
                   } else {
-                    comp = compare(a[dartx.get](great), pivot1);
+                    comp = compare(a[dartx._get](great), pivot1);
                     if (dart.notNull(comp) < 0) {
-                      a[dartx.set](k, a[dartx.get](less));
-                      a[dartx.set](less++, a[dartx.get](great));
-                      a[dartx.set](great--, ak);
+                      a[dartx._set](k, a[dartx._get](less));
+                      a[dartx._set](less++, a[dartx._get](great));
+                      a[dartx._set](great--, ak);
                     } else {
-                      a[dartx.set](k, a[dartx.get](great));
-                      a[dartx.set](great--, ak);
+                      a[dartx._set](k, a[dartx._get](great));
+                      a[dartx._set](great--, ak);
                     }
                     break;
                   }
@@ -8435,49 +8631,49 @@
             }
           }
         }
-        a[dartx.set](left, a[dartx.get](less - 1));
-        a[dartx.set](less - 1, pivot1);
-        a[dartx.set](right, a[dartx.get](great + 1));
-        a[dartx.set](great + 1, pivot2);
+        a[dartx._set](left, a[dartx._get](less - 1));
+        a[dartx._set](less - 1, pivot1);
+        a[dartx._set](right, a[dartx._get](great + 1));
+        a[dartx._set](great + 1, pivot2);
         _internal.Sort._doSort(E)(a, left, less - 2, compare);
         _internal.Sort._doSort(E)(a, great + 2, right, compare);
         if (pivots_are_equal) {
           return;
         }
         if (less < index1 && great > index5) {
-          while (compare(a[dartx.get](less), pivot1) == 0) {
+          while (compare(a[dartx._get](less), pivot1) == 0) {
             less++;
           }
-          while (compare(a[dartx.get](great), pivot2) == 0) {
+          while (compare(a[dartx._get](great), pivot2) == 0) {
             great--;
           }
           for (let k = less; k <= great; k++) {
-            let ak = a[dartx.get](k);
+            let ak = a[dartx._get](k);
             let comp_pivot1 = compare(ak, pivot1);
             if (comp_pivot1 == 0) {
               if (k != less) {
-                a[dartx.set](k, a[dartx.get](less));
-                a[dartx.set](less, ak);
+                a[dartx._set](k, a[dartx._get](less));
+                a[dartx._set](less, ak);
               }
               less++;
             } else {
               let comp_pivot2 = compare(ak, pivot2);
               if (comp_pivot2 == 0) {
                 while (true) {
-                  let comp = compare(a[dartx.get](great), pivot2);
+                  let comp = compare(a[dartx._get](great), pivot2);
                   if (comp == 0) {
                     great--;
                     if (great < k) break;
                     continue;
                   } else {
-                    comp = compare(a[dartx.get](great), pivot1);
+                    comp = compare(a[dartx._get](great), pivot1);
                     if (dart.notNull(comp) < 0) {
-                      a[dartx.set](k, a[dartx.get](less));
-                      a[dartx.set](less++, a[dartx.get](great));
-                      a[dartx.set](great--, ak);
+                      a[dartx._set](k, a[dartx._get](less));
+                      a[dartx._set](less++, a[dartx._get](great));
+                      a[dartx._set](great--, ak);
                     } else {
-                      a[dartx.set](k, a[dartx.get](great));
-                      a[dartx.set](great--, ak);
+                      a[dartx._set](k, a[dartx._get](great));
+                      a[dartx._set](great--, ak);
                     }
                     break;
                   }
@@ -8505,18 +8701,26 @@
   });
   _internal.Sort._INSERTION_SORT_THRESHOLD = 32;
   const _name = Symbol('_name');
+  const _nativeSymbol = Symbol('_nativeSymbol');
   _internal.Symbol = class Symbol extends core.Object {
     new(name) {
       this[_name] = name;
+      this[_nativeSymbol] = null;
+    }
+    es6(name, nativeSymbol) {
+      this[_name] = name;
+      this[_nativeSymbol] = nativeSymbol;
     }
     unvalidated(name) {
       this[_name] = name;
+      this[_nativeSymbol] = null;
     }
     validated(name) {
       this[_name] = _internal.Symbol.validatePublicSymbol(name);
+      this[_nativeSymbol] = null;
     }
     ['=='](other) {
-      return _internal.Symbol.is(other) && this[_name] == other[_name];
+      return _internal.Symbol.is(other) && this[_name] == other[_name] && dart.equals(this[_nativeSymbol], other[_nativeSymbol]);
     }
     get hashCode() {
       let hash = this._hashCode;
@@ -8532,6 +8736,9 @@
     static getName(symbol) {
       return symbol[_name];
     }
+    static getNativeSymbol(symbol) {
+      return symbol[_nativeSymbol];
+    }
     static validatePublicSymbol(name) {
       if (dart.test(name[dartx.isEmpty]) || dart.test(_internal.Symbol.publicSymbolPattern.hasMatch(name))) return name;
       if (dart.test(name[dartx.startsWith]('_'))) {
@@ -8543,16 +8750,21 @@
       return dart.test(name[dartx.isEmpty]) || dart.test(_internal.Symbol.symbolPattern.hasMatch(name));
     }
   };
+  dart.defineNamedConstructor(_internal.Symbol, 'es6');
   dart.defineNamedConstructor(_internal.Symbol, 'unvalidated');
   dart.defineNamedConstructor(_internal.Symbol, 'validated');
   _internal.Symbol[dart.implements] = () => [core.Symbol];
   dart.setSignature(_internal.Symbol, {
     constructors: () => ({
       new: dart.definiteFunctionType(_internal.Symbol, [core.String]),
+      es6: dart.definiteFunctionType(_internal.Symbol, [core.String, dart.dynamic]),
       unvalidated: dart.definiteFunctionType(_internal.Symbol, [core.String]),
       validated: dart.definiteFunctionType(_internal.Symbol, [core.String])
     }),
-    fields: () => ({[_name]: core.String}),
+    fields: () => ({
+      [_name]: core.String,
+      [_nativeSymbol]: dart.dynamic
+    }),
     methods: () => ({'==': dart.definiteFunctionType(core.bool, [core.Object])}),
     sfields: () => ({
       reservedWordRE: core.String,
@@ -8564,10 +8776,11 @@
     }),
     statics: () => ({
       getName: dart.definiteFunctionType(core.String, [_internal.Symbol]),
+      getNativeSymbol: dart.definiteFunctionType(dart.dynamic, [_internal.Symbol]),
       validatePublicSymbol: dart.definiteFunctionType(core.String, [core.String]),
       isValidSymbol: dart.definiteFunctionType(core.bool, [core.String])
     }),
-    names: ['getName', 'validatePublicSymbol', 'isValidSymbol']
+    names: ['getName', 'getNativeSymbol', 'validatePublicSymbol', 'isValidSymbol']
   });
   _internal.Symbol.reservedWordRE = '(?:assert|break|c(?:a(?:se|tch)|lass|on(?:st|tinue))|d(?:efault|o)|' + 'e(?:lse|num|xtends)|f(?:alse|inal(?:ly)?|or)|i[fns]|n(?:ew|ull)|' + 'ret(?:hrow|urn)|s(?:uper|witch)|t(?:h(?:is|row)|r(?:ue|y))|' + 'v(?:ar|oid)|w(?:hile|ith))';
   _internal.Symbol.operatorRE = '(?:[\\-+*/%&|^]|\\[\\]=?|==|~/?|<[<=]?|>[>=]?|unary-)';
@@ -8852,8 +9065,8 @@
         return;
       }
       let message = core.List.new(2);
-      message[dartx.set](0, dart.toString(error));
-      message[dartx.set](1, stackTrace == null ? null : dart.toString(stackTrace));
+      message[dartx._set](0, dart.toString(error));
+      message[dartx._set](1, stackTrace == null ? null : dart.toString(stackTrace));
       for (let port of this.errorPorts)
         port.send(message);
     }
@@ -8941,13 +9154,13 @@
       }
     }
     lookup(portId) {
-      return this.ports[dartx.get](portId);
+      return this.ports[dartx._get](portId);
     }
     [_addRegistration](portId, port) {
       if (dart.test(this.ports[dartx.containsKey](portId))) {
         dart.throw(core.Exception.new("Registry: ports must be registered only once."));
       }
-      this.ports[dartx.set](portId, port);
+      this.ports[dartx._set](portId, port);
     }
     register(portId, port) {
       this[_addRegistration](portId, port);
@@ -8959,7 +9172,7 @@
     }
     [_updateGlobalState]() {
       if (dart.notNull(this.ports[dartx.length]) - dart.notNull(this.weakPorts.length) > 0 || dart.test(this.isPaused) || !dart.test(this.initialized)) {
-        _isolate_helper._globalState.isolates[dartx.set](this.id, this);
+        _isolate_helper._globalState.isolates[dartx._set](this.id, this);
       } else {
         this.kill();
       }
@@ -9244,7 +9457,7 @@
         }
         case 'close':
         {
-          _isolate_helper._globalState.managers[dartx.remove](_isolate_helper.IsolateNatives.workerIds.get(sender));
+          _isolate_helper._globalState.managers[dartx.remove](_isolate_helper.IsolateNatives.workerIds._get(sender));
           sender.terminate();
           _isolate_helper._globalState.topEventLoop.run();
           break;
@@ -9407,8 +9620,8 @@
       let o = _isolate_helper._globalState;
       let workerId = o.nextManagerId;
       o.nextManagerId = dart.notNull(workerId) + 1;
-      _isolate_helper.IsolateNatives.workerIds.set(worker, workerId);
-      _isolate_helper._globalState.managers[dartx.set](workerId, worker);
+      _isolate_helper.IsolateNatives.workerIds._set(worker, workerId);
+      _isolate_helper._globalState.managers[dartx._set](workerId, worker);
       worker.postMessage(_isolate_helper._serializeMessage(dart.map({command: 'start', id: workerId, replyTo: _isolate_helper._serializeMessage(replyPort), args: args, msg: _isolate_helper._serializeMessage(message), isSpawnUri: isSpawnUri, startPaused: startPaused, functionName: functionName}, core.String, core.Object)));
     }
     static workerOnError(event, uri, onError) {
@@ -9491,7 +9704,7 @@
       super.new(isolateId);
     }
     send(message) {
-      let isolate = _isolate_helper._globalState.isolates[dartx.get](this[_isolateId]);
+      let isolate = _isolate_helper._globalState.isolates[dartx._get](this[_isolateId]);
       if (isolate == null) return;
       if (dart.test(this[_receivePort][_isClosed])) return;
       let msg = _isolate_helper._clone(message);
@@ -9531,7 +9744,7 @@
       if (dart.test(_isolate_helper._globalState.isWorker)) {
         _isolate_helper._globalState.mainManager.postMessage(workerMessage);
       } else {
-        let manager = _isolate_helper._globalState.managers[dartx.get](this[_workerId]);
+        let manager = _isolate_helper._globalState.managers[dartx._get](this[_workerId]);
         if (manager != null) {
           manager.postMessage(workerMessage);
         }
@@ -10569,10 +10782,10 @@
     }
     serialize(x) {
       if (dart.test(this.isPrimitive(x))) return this.serializePrimitive(x);
-      let serializationId = this.serializedObjectIds[dartx.get](x);
+      let serializationId = this.serializedObjectIds[dartx._get](x);
       if (serializationId != null) return this.makeRef(serializationId);
       serializationId = this.serializedObjectIds[dartx.length];
-      this.serializedObjectIds[dartx.set](x, serializationId);
+      this.serializedObjectIds[dartx._set](x, serializationId);
       if (_native_typed_data.NativeByteBuffer.is(x)) return this.serializeByteBuffer(x);
       if (_native_typed_data.NativeTypedData.is(x)) return this.serializeTypedData(x);
       if (_interceptors.JSIndexable.is(x)) return this.serializeJSIndexable(x);
@@ -10621,13 +10834,13 @@
       let serialized = [];
       serialized[dartx.length] = x[dartx.length];
       for (let i = 0; i < dart.notNull(x[dartx.length]); i++) {
-        serialized[dartx.set](i, this.serialize(x[dartx.get](i)));
+        serialized[dartx._set](i, this.serialize(x[dartx._get](i)));
       }
       return serialized;
     }
     serializeArrayInPlace(x) {
       for (let i = 0; i < dart.notNull(x[dartx.length]); i++) {
-        x[dartx.set](i, this.serialize(x[dartx.get](i)));
+        x[dartx._set](i, this.serialize(x[dartx._get](i)));
       }
       return x;
     }
@@ -10643,7 +10856,7 @@
       let values = [];
       values[dartx.length] = keys[dartx.length];
       for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-        values[dartx.set](i, this.serialize(x[keys[dartx.get](i)]));
+        values[dartx._set](i, this.serialize(x[keys[dartx._get](i)]));
       }
       return JSArrayOfObject().of(['js-object', keys, values]);
     }
@@ -10782,7 +10995,7 @@
     deserializeRef(x) {
       dart.assert(dart.equals(dart.dindex(x, 0), 'ref'));
       let serializationId = core.int._check(dart.dindex(x, 1));
-      return this.deserializedObjects[dartx.get](serializationId);
+      return this.deserializedObjects[dartx._get](serializationId);
     }
     deserializeByteBuffer(x) {
       dart.assert(dart.equals(dart.dindex(x, 0), 'buffer'));
@@ -10798,7 +11011,7 @@
     }
     deserializeArrayInPlace(x) {
       for (let i = 0; i < dart.notNull(x[dartx.length]); i++) {
-        x[dartx.set](i, this.deserialize(x[dartx.get](i)));
+        x[dartx._set](i, this.deserialize(x[dartx._get](i)));
       }
       return x;
     }
@@ -10827,14 +11040,14 @@
       return _interceptors.JSArray.markFixed(this.deserializeArrayInPlace(_interceptors.JSArray._check(result)));
     }
     deserializeMap(x) {
-      dart.assert(dart.equals(x.get(0), 'map'));
-      let keys = core.List._check(x.get(1));
-      let values = core.List._check(x.get(2));
+      dart.assert(dart.equals(x._get(0), 'map'));
+      let keys = core.List._check(x._get(1));
+      let values = core.List._check(x._get(2));
       let result = dart.map();
       this.deserializedObjects[dartx.add](result);
       keys = keys[dartx.map](dart.dynamic)(dart.bind(this, 'deserialize'))[dartx.toList]();
       for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-        result[dartx.set](keys[dartx.get](i), this.deserialize(values[dartx.get](i)));
+        result[dartx._set](keys[dartx._get](i), this.deserialize(values[dartx._get](i)));
       }
       return result;
     }
@@ -10845,7 +11058,7 @@
       let receivePortId = core.int._check(dart.dindex(x, 3));
       let result = null;
       if (managerId == _isolate_helper._globalState.currentManagerId) {
-        let isolate = _isolate_helper._globalState.isolates[dartx.get](isolateId);
+        let isolate = _isolate_helper._globalState.isolates[dartx._get](isolateId);
         if (isolate == null) return null;
         let receivePort = isolate.lookup(receivePortId);
         if (receivePort == null) return null;
@@ -10869,7 +11082,7 @@
       let o = {};
       this.deserializedObjects[dartx.add](o);
       for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-        o[keys[dartx.get](i)] = this.deserialize(values[dartx.get](i));
+        o[keys[dartx._get](i)] = this.deserialize(values[dartx._get](i));
       }
       return o;
     }
@@ -10993,12 +11206,12 @@
       if (match == null) {
         return _js_helper.Primitives._parseIntError(source, handleError);
       }
-      let decimalMatch = match[dartx.get](decimalIndex);
+      let decimalMatch = match[dartx._get](decimalIndex);
       if (radix == null) {
         if (decimalMatch != null) {
           return parseInt(source, 10);
         }
-        if (match[dartx.get](hexIndex) != null) {
+        if (match[dartx._get](hexIndex) != null) {
           return parseInt(source, 16);
         }
         return _js_helper.Primitives._parseIntError(source, handleError);
@@ -11019,7 +11232,7 @@
         } else {
           maxCharCode = 97 - 10 - 1 + dart.notNull(radix);
         }
-        dart.assert(typeof match[dartx.get](digitsIndex) == 'string');
+        dart.assert(typeof match[dartx._get](digitsIndex) == 'string');
         let digitsPart = match[digitsIndex];
         for (let i = 0; i < dart.notNull(digitsPart[dartx.length]); i++) {
           let characterCode = (dart.notNull(digitsPart[dartx.codeUnitAt](i)) | 32) >>> 0;
@@ -11157,11 +11370,11 @@
     static getTimeZoneName(receiver) {
       let d = _js_helper.Primitives.lazyAsJsDate(receiver);
       let match = /\((.*)\)/.exec(d.toString());
-      if (match != null) return core.String._check(match[dartx.get](1));
+      if (match != null) return core.String._check(match[dartx._get](1));
       match = /^[A-Z,a-z]{3}\s[A-Z,a-z]{3}\s\d+\s\d{2}:\d{2}:\d{2}\s([A-Z]{3,5})\s\d{4}$/.exec(d.toString());
-      if (match != null) return core.String._check(match[dartx.get](1));
+      if (match != null) return core.String._check(match[dartx._get](1));
       match = /(?:GMT|UTC)[+-]\d{4}/.exec(d.toString());
-      if (match != null) return core.String._check(match[dartx.get](0));
+      if (match != null) return core.String._check(match[dartx._get](0));
       return "";
     }
     static getTimeZoneOffsetInMinutes(receiver) {
@@ -11513,7 +11726,7 @@
     while (index < dart.notNull(length)) {
       let key = _js_helper.getIndex(keyValuePairs, index++);
       let value = _js_helper.getIndex(keyValuePairs, index++);
-      result[dartx.set](key, value);
+      result[dartx._set](key, value);
     }
     return result;
   };
@@ -11557,7 +11770,7 @@
     constructors: () => ({new: dart.definiteFunctionType(_js_helper.JSName, [core.String])}),
     fields: () => ({name: core.String})
   });
-  _js_helper.JavaScriptIndexingBehavior = class JavaScriptIndexingBehavior extends _interceptors.JSMutableIndexable {};
+  _js_helper.JavaScriptIndexingBehavior = class JavaScriptIndexingBehavior extends core.Object {};
   _js_helper.TypeErrorImplementation = class TypeErrorImplementation extends core.Error {
     new(value, actualType, expectedType) {
       this.message = dart.str`Type '${actualType}' is not a subtype ` + dart.str`of type '${expectedType}'`;
@@ -11917,7 +12130,7 @@
         return new (LinkedHashMapKeyIterableOfK())(this);
       }
       get values() {
-        return MappedIterableOfK$V().new(this.keys, dart.fn(each => this.get(each), KToV()));
+        return MappedIterableOfK$V().new(this.keys, dart.fn(each => this._get(each), KToV()));
       }
       containsKey(key) {
         if (dart.test(_js_helper.JsLinkedHashMap._isStringKey(key))) {
@@ -11939,15 +12152,15 @@
         return dart.notNull(this.internalFindBucketIndex(bucket, key)) >= 0;
       }
       containsValue(value) {
-        return this.keys[dartx.any](dart.fn(each => dart.equals(this.get(each), value), KTobool()));
+        return this.keys[dartx.any](dart.fn(each => dart.equals(this._get(each), value), KTobool()));
       }
       addAll(other) {
         MapOfK$V()._check(other);
         other[dartx.forEach](dart.fn((key, value) => {
-          this.set(key, value);
+          this._set(key, value);
         }, KAndVTovoid$()));
       }
-      get(key) {
+      _get(key) {
         if (dart.test(_js_helper.JsLinkedHashMap._isStringKey(key))) {
           let strings = this[_strings];
           if (strings == null) return null;
@@ -11971,7 +12184,7 @@
         let cell = bucket[index];
         return cell.hashMapCellValue;
       }
-      set(key, value) {
+      _set(key, value) {
         K._check(key);
         V._check(value);
         if (dart.test(_js_helper.JsLinkedHashMap._isStringKey(key))) {
@@ -12011,9 +12224,9 @@
       putIfAbsent(key, ifAbsent) {
         K._check(key);
         VoidToV()._check(ifAbsent);
-        if (dart.test(this.containsKey(key))) return this.get(key);
+        if (dart.test(this.containsKey(key))) return this._get(key);
         let value = ifAbsent();
-        this.set(key, value);
+        this._set(key, value);
         return value;
       }
       remove(key) {
@@ -12186,9 +12399,9 @@
         internalContainsKey: dart.definiteFunctionType(core.bool, [core.Object]),
         containsValue: dart.definiteFunctionType(core.bool, [core.Object]),
         addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
-        get: dart.definiteFunctionType(V, [core.Object]),
+        _get: dart.definiteFunctionType(V, [core.Object]),
         internalGet: dart.definiteFunctionType(V, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         internalSet: dart.definiteFunctionType(dart.void, [K, V]),
         putIfAbsent: dart.definiteFunctionType(V, [K, VoidToV()]),
         remove: dart.definiteFunctionType(V, [core.Object]),
@@ -12220,8 +12433,8 @@
       'containsKey',
       'containsValue',
       'addAll',
-      'get',
-      'set',
+      '_get',
+      '_set',
       'putIfAbsent',
       'remove',
       'clear',
@@ -12508,7 +12721,7 @@
       regexp.lastIndex = start;
       let match = regexp.exec(string);
       if (match == null) return null;
-      if (match[dartx.get](dart.notNull(match[dartx.length]) - 1) != null) return null;
+      if (match[dartx._get](dart.notNull(match[dartx.length]) - 1) != null) return null;
       match[dartx.length] = dart.notNull(match[dartx.length]) - 1;
       return new _js_helper._MatchImplementation(this, ListOfString()._check(match));
     }
@@ -12571,12 +12784,12 @@
       return this[_match].index;
     }
     get end() {
-      return dart.notNull(this.start) + dart.notNull(this[_match][dartx.get](0)[dartx.length]);
+      return dart.notNull(this.start) + dart.notNull(this[_match][dartx._get](0)[dartx.length]);
     }
     group(index) {
-      return this[_match][dartx.get](index);
+      return this[_match][dartx._get](index);
     }
-    get(index) {
+    _get(index) {
       return this.group(index);
     }
     get groupCount() {
@@ -12605,7 +12818,7 @@
     }),
     methods: () => ({
       group: dart.definiteFunctionType(core.String, [core.int]),
-      get: dart.definiteFunctionType(core.String, [core.int]),
+      _get: dart.definiteFunctionType(core.String, [core.int]),
       groups: dart.definiteFunctionType(core.List$(core.String), [ListOfint()])
     })
   });
@@ -12707,7 +12920,7 @@
     get end() {
       return dart.notNull(this.start) + dart.notNull(this.pattern[dartx.length]);
     }
-    get(g) {
+    _get(g) {
       return this.group(g);
     }
     get groupCount() {
@@ -12740,7 +12953,7 @@
       groupCount: dart.definiteFunctionType(core.int, [])
     }),
     methods: () => ({
-      get: dart.definiteFunctionType(core.String, [core.int]),
+      _get: dart.definiteFunctionType(core.String, [core.int]),
       group: dart.definiteFunctionType(core.String, [core.int]),
       groups: dart.definiteFunctionType(core.List$(core.String), [ListOfint()])
     })
@@ -12863,7 +13076,7 @@
           let length = receiver[dartx.length];
           result.write(replacement);
           for (let i = 0; i < dart.notNull(length); i++) {
-            result.write(receiver[dartx.get](i));
+            result.write(receiver[dartx._get](i));
             result.write(replacement);
           }
           return result.toString();
@@ -12883,7 +13096,7 @@
   };
   dart.lazyFn(_js_helper.stringReplaceAllUnchecked, () => StringAndPatternAndStringToString());
   _js_helper._matchString = function(match) {
-    return match.get(0);
+    return match._get(0);
   };
   dart.lazyFn(_js_helper._matchString, () => MatchToString$());
   _js_helper._stringIdentity = function(string) {
@@ -12926,7 +13139,7 @@
           continue;
         }
       }
-      buffer.write(onNonMatch(receiver[dartx.get](i)));
+      buffer.write(onNonMatch(receiver[dartx._get](i)));
       i++;
     }
     buffer.write(onMatch(new _js_helper.StringMatch(i, receiver, "")));
@@ -13078,65 +13291,109 @@
     return _js_mirrors._dart.definiteFunctionType(type, []);
   };
   dart.fn(_js_mirrors._defaultConstructorType, dynamicTodynamic$());
+  _js_mirrors._getMixins = function(type) {
+    return _js_mirrors._dart.getMixins(type, []);
+  };
+  dart.fn(_js_mirrors._getMixins, dynamicTodynamic$());
   _js_mirrors._Lazy$ = dart.generic(T => {
     const _Lazy = dart.typedef('_Lazy', () => dart.functionType(T, []));
     return _Lazy;
   });
   _js_mirrors._Lazy = _Lazy();
+  _js_mirrors._getESSymbol = function(symbol) {
+    return _internal.Symbol.getNativeSymbol(_internal.Symbol.as(symbol));
+  };
+  dart.lazyFn(_js_mirrors._getESSymbol, () => SymbolTodynamic());
+  _js_mirrors._getMember = function(symbol) {
+    let privateSymbol = _js_mirrors._getESSymbol(symbol);
+    if (privateSymbol != null) {
+      return privateSymbol;
+    }
+    return _js_mirrors.getName(symbol);
+  };
+  dart.lazyFn(_js_mirrors._getMember, () => SymbolTodynamic());
+  _js_mirrors._getNameForESSymbol = function(member) {
+    dart.assert(typeof member == "symbol");
+    let str = dart.toString(member);
+    dart.assert(dart.test(str[dartx.startsWith]('Symbol(')) && dart.test(str[dartx.endsWith](')')));
+    return str[dartx.substring](7, dart.notNull(str[dartx.length]) - 1);
+  };
+  dart.lazyFn(_js_mirrors._getNameForESSymbol, () => dynamicToString());
+  _js_mirrors._getSymbolForESSymbol = function(member) {
+    let name = _js_mirrors._getNameForESSymbol(member);
+    return new _internal.Symbol.es6(name, member);
+  };
+  dart.lazyFn(_js_mirrors._getSymbolForESSymbol, () => dynamicToSymbol());
+  _js_mirrors._getSymbolForMember = function(member) {
+    if (typeof member == 'string') {
+      return core.Symbol.new(member);
+    } else {
+      let name = _js_mirrors._getNameForESSymbol(member);
+      return new _internal.Symbol.es6(name, member);
+    }
+  };
+  dart.lazyFn(_js_mirrors._getSymbolForMember, () => dynamicToSymbol());
+  _js_mirrors._toDartMap = function(data) {
+    if (data == null) return dart.map({}, core.Symbol, dart.dynamic);
+    let map = MapOfSymbol$dynamic().new();
+    let publicMembers = Object.getOwnPropertyNames(data);
+    for (let member of core.Iterable._check(publicMembers)) {
+      let symbol = core.Symbol.new(core.String._check(member));
+      map[dartx._set](symbol, data[member]);
+    }
+    let privateMembers = Object.getOwnPropertySymbols(data);
+    for (let member of core.Iterable._check(privateMembers)) {
+      let symbol = _js_mirrors._getSymbolForESSymbol(member);
+      map[dartx._set](symbol, data[member]);
+    }
+    return map;
+  };
+  dart.lazyFn(_js_mirrors._toDartMap, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getConstructors = function(obj) {
     let sig = _js_mirrors._dart.getConstructorSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getConstructors, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getConstructors, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getFields = function(obj) {
     let sig = _js_mirrors._dart.getFieldSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getFields, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getFields, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getMethods = function(obj) {
     let sig = _js_mirrors._dart.getMethodSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getMethods, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getMethods, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getGetters = function(obj) {
     let sig = _js_mirrors._dart.getGetterSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getGetters, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getGetters, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getSetters = function(obj) {
     let sig = _js_mirrors._dart.getSetterSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getSetters, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getSetters, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getStaticFields = function(obj) {
     let sig = _js_mirrors._dart.getStaticFieldSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getStaticFields, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getStaticFields, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getStatics = function(obj) {
     let sig = _js_mirrors._dart.getStaticSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getStatics, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getStatics, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getStaticGetters = function(obj) {
     let sig = _js_mirrors._dart.getStaticGetterSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getStaticGetters, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getStaticGetters, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getStaticSetters = function(obj) {
     let sig = _js_mirrors._dart.getStaticSetterSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getStaticSetters, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getStaticSetters, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._unwrap = function(obj) {
     return _js_mirrors._dart.unwrapType(obj);
   };
@@ -13145,10 +13402,22 @@
     return _js_mirrors._dart.wrapType(obj);
   };
   dart.fn(_js_mirrors._wrap, dynamicTodynamic$());
+  _js_mirrors._runtimeType = function(obj) {
+    return _js_mirrors._wrap(_js_mirrors._dart.getReifiedType(obj));
+  };
+  dart.fn(_js_mirrors._runtimeType, dynamicTodynamic$());
   _js_mirrors._unimplemented = function(t, i) {
-    dart.throw(new core.UnimplementedError(dart.str`${t}.${i.memberName} unimplemented`));
+    dart.throw(new core.UnimplementedError(dart.str`${t}.${_js_mirrors.getName(i.memberName)} unimplemented`));
   };
   dart.fn(_js_mirrors._unimplemented, TypeAndInvocationTodynamic());
+  _js_mirrors._toJsMap = function(map) {
+    let obj = {};
+    map[dartx.forEach](dart.fn((key, value) => {
+      obj[_js_mirrors.getName(key)] = value;
+    }, SymbolAnddynamicTovoid()));
+    return obj;
+  };
+  dart.lazyFn(_js_mirrors._toJsMap, () => MapOfSymbol$dynamicTodynamic());
   _js_mirrors.JsMirror = class JsMirror extends core.Object {
     noSuchMethod(i) {
       _js_mirrors._unimplemented(this.runtimeType, i);
@@ -13242,14 +13511,14 @@
     }
   };
   _js_mirrors.JsObjectMirror[dart.implements] = () => [mirrors.ObjectMirror];
-  const _toJsMap = Symbol('_toJsMap');
+  const _getAccessor = Symbol('_getAccessor');
   _js_mirrors.JsInstanceMirror = class JsInstanceMirror extends _js_mirrors.JsObjectMirror {
     get hasReflectee() {
       return true;
     }
     get type() {
       if (this.reflectee == null) return mirrors.reflectClass(dart.wrapType(core.Null));
-      return mirrors.ClassMirror._check(_js_mirrors.reflectType(core.Type._check(dart.runtimeType(this.reflectee))));
+      return mirrors.ClassMirror._check(_js_mirrors.reflectType(core.Type._check(_js_mirrors._runtimeType(this.reflectee))));
     }
     _(reflectee) {
       this.reflectee = reflectee;
@@ -13260,32 +13529,33 @@
     get hashCode() {
       return (dart.notNull(core.identityHashCode(this.reflectee)) ^ 909522486) >>> 0;
     }
+    [_getAccessor](reflectee, symbol, args, namedArgs) {
+      if (args === void 0) args = null;
+      if (namedArgs === void 0) namedArgs = null;
+      return _js_mirrors._getMember(symbol);
+    }
     getField(symbol) {
-      let name = _js_mirrors.getName(symbol);
-      let field = _js_mirrors._dload(this.reflectee, name);
+      let name = this[_getAccessor](this.reflectee, symbol);
+      let field = _js_mirrors._dload(this.reflectee, core.String._check(name));
       return _js_mirrors.reflect(field);
     }
     setField(symbol, value) {
-      let name = _js_mirrors.getName(symbol);
-      _js_mirrors._dput(this.reflectee, name, value);
+      let name = this[_getAccessor](this.reflectee, symbol);
+      _js_mirrors._dput(this.reflectee, core.String._check(name), value);
       return _js_mirrors.reflect(value);
     }
     invoke(symbol, args, namedArgs) {
       if (namedArgs === void 0) namedArgs = null;
-      let name = _js_mirrors.getName(symbol);
+      let name = this[_getAccessor](this.reflectee, symbol, args, namedArgs);
       if (namedArgs != null) {
         args = core.List.from(args);
-        args[dartx.add](this[_toJsMap](namedArgs));
+        args[dartx.add](_js_mirrors._toJsMap(namedArgs));
       }
-      let result = _js_mirrors._dsend(this.reflectee, name, args);
+      let result = _js_mirrors._dsend(this.reflectee, core.String._check(name), args);
       return _js_mirrors.reflect(result);
     }
-    [_toJsMap](map) {
-      let obj = {};
-      map[dartx.forEach](dart.fn((key, value) => {
-        obj[_js_mirrors.getName(key)] = value;
-      }, SymbolAnddynamicTovoid()));
-      return obj;
+    toString() {
+      return dart.str`InstanceMirror on '${this.reflectee}'`;
     }
     delegate(...args) {
       return this.noSuchMethod(new dart.InvocationImpl('delegate', args, {isMethod: true}));
@@ -13302,10 +13572,10 @@
     }),
     methods: () => ({
       '==': dart.definiteFunctionType(core.bool, [core.Object]),
+      [_getAccessor]: dart.definiteFunctionType(dart.dynamic, [dart.dynamic, core.Symbol], [core.List, MapOfSymbol$dynamic()]),
       getField: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol]),
       setField: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.Object]),
-      invoke: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.List], [MapOfSymbol$dynamic()]),
-      [_toJsMap]: dart.definiteFunctionType(dart.dynamic, [MapOfSymbol$dynamic()])
+      invoke: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.List], [MapOfSymbol$dynamic()])
     })
   });
   _js_mirrors.JsClosureMirror = class JsClosureMirror extends _js_mirrors.JsInstanceMirror {
@@ -13316,7 +13586,7 @@
       if (namedArgs === void 0) namedArgs = null;
       if (namedArgs != null) {
         args = core.List.from(args);
-        args[dartx.add](this[_toJsMap](namedArgs));
+        args[dartx.add](_js_mirrors._toJsMap(namedArgs));
       }
       let result = _js_mirrors._dcall(this.reflectee, args);
       return _js_mirrors.reflect(result);
@@ -13339,12 +13609,14 @@
   let const$0;
   const _declarations = Symbol('_declarations');
   const _raw = Symbol('_raw');
+  const _mixin = Symbol('_mixin');
   const _typeArguments = Symbol('_typeArguments');
   let const$1;
   _js_mirrors.JsClassMirror = class JsClassMirror extends _js_mirrors.JsMirror {
     get metadata() {
       if (this[_metadata$] == null) {
-        let fn = _js_mirrors._unwrap(this[_cls])[dart.metadata];
+        let unwrapped = _js_mirrors._unwrap(this[_cls]);
+        let fn = Object.hasOwnProperty.call(unwrapped, dart.metadata) ? unwrapped[dart.metadata] : null;
         this[_metadata$] = fn == null ? const$0 || (const$0 = dart.constList([], mirrors.InstanceMirror)) : ListOfInstanceMirror().unmodifiable(core.Iterable._check(dart.dsend(dart.dcall(fn), 'map', dart.fn(i => _js_mirrors.reflect(i), dynamicToInstanceMirror()))));
       }
       return this[_metadata$];
@@ -13354,67 +13626,66 @@
         this[_declarations] = MapOfSymbol$DeclarationMirror().new();
         let unwrapped = _js_mirrors._unwrap(this[_cls]);
         let constructors = _js_mirrors._getConstructors(unwrapped);
-        constructors[dartx.forEach](dart.fn((name, ft) => {
-          let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._constructor(this, name, ft));
-        }, StringAnddynamicTovoid()));
+        constructors[dartx.forEach](dart.fn((symbol, ft) => {
+          let name = _js_mirrors.getName(symbol);
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._constructor(this, symbol, ft));
+        }, SymbolAnddynamicTovoid()));
         if (dart.test(constructors[dartx.isEmpty])) {
           let name = 'new';
           let ft = _js_mirrors._defaultConstructorType(_js_mirrors._unwrap(this[_cls]));
           let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._constructor(this, name, ft));
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._constructor(this, symbol, ft));
         }
         let fields = _js_mirrors._getFields(unwrapped);
-        fields[dartx.forEach](dart.fn((name, t) => {
-          let symbol = core.Symbol.new(name);
+        fields[dartx.forEach](dart.fn((symbol, t) => {
           let metadata = [];
           if (core.List.is(t)) {
             metadata = core.List._check(dart.dsend(dart.dsend(t, 'skip', 1), 'toList'));
             t = dart.dindex(t, 0);
           }
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsVariableMirror._(name, core.Type._check(_js_mirrors._wrap(t)), metadata));
-        }, StringAnddynamicTovoid()));
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsVariableMirror._(symbol, core.Type._check(_js_mirrors._wrap(t)), metadata));
+        }, SymbolAnddynamicTovoid()));
         let methods = _js_mirrors._getMethods(unwrapped);
-        methods[dartx.forEach](dart.fn((name, ft) => {
-          let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, name, ft));
-        }, StringAnddynamicTovoid()));
+        methods[dartx.forEach](dart.fn((symbol, ft) => {
+          let name = _js_mirrors.getName(symbol);
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, symbol, ft));
+        }, SymbolAnddynamicTovoid()));
         let getters = _js_mirrors._getGetters(unwrapped);
-        getters[dartx.forEach](dart.fn((name, ft) => {
-          let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, name, ft));
-        }, StringAnddynamicTovoid()));
+        getters[dartx.forEach](dart.fn((symbol, ft) => {
+          let name = _js_mirrors.getName(symbol);
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, symbol, ft));
+        }, SymbolAnddynamicTovoid()));
         let setters = _js_mirrors._getSetters(unwrapped);
-        setters[dartx.forEach](dart.fn((name, ft) => {
-          name = dart.notNull(name) + '=';
-          let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, name, ft));
-        }, StringAnddynamicTovoid()));
+        setters[dartx.forEach](dart.fn((symbol, ft) => {
+          let name = dart.notNull(_js_mirrors.getName(symbol)) + '=';
+          symbol = new _internal.Symbol.es6(name, _js_mirrors._getESSymbol(symbol));
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, symbol, ft));
+        }, SymbolAnddynamicTovoid()));
         let staticFields = _js_mirrors._getStaticFields(unwrapped);
-        staticFields[dartx.forEach](dart.fn((name, t) => {
-          let symbol = core.Symbol.new(name);
+        staticFields[dartx.forEach](dart.fn((symbol, t) => {
+          let name = _js_mirrors.getName(symbol);
           let metadata = [];
           if (core.List.is(t)) {
             metadata = core.List._check(dart.dsend(dart.dsend(t, 'skip', 1), 'toList'));
             t = dart.dindex(t, 0);
           }
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsVariableMirror._(name, core.Type._check(_js_mirrors._wrap(t)), metadata));
-        }, StringAnddynamicTovoid()));
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsVariableMirror._(symbol, core.Type._check(_js_mirrors._wrap(t)), metadata));
+        }, SymbolAnddynamicTovoid()));
         let statics = _js_mirrors._getStatics(unwrapped);
-        statics[dartx.forEach](dart.fn((name, ft) => {
-          let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, name, ft));
-        }, StringAnddynamicTovoid()));
+        statics[dartx.forEach](dart.fn((symbol, ft) => {
+          let name = _js_mirrors.getName(symbol);
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, symbol, ft));
+        }, SymbolAnddynamicTovoid()));
         let staticGetters = _js_mirrors._getStaticGetters(unwrapped);
-        staticGetters[dartx.forEach](dart.fn((name, ft) => {
-          let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, name, ft));
-        }, StringAnddynamicTovoid()));
+        staticGetters[dartx.forEach](dart.fn((symbol, ft) => {
+          let name = _js_mirrors.getName(symbol);
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, symbol, ft));
+        }, SymbolAnddynamicTovoid()));
         let staticSetters = _js_mirrors._getStaticSetters(unwrapped);
-        staticSetters[dartx.forEach](dart.fn((name, ft) => {
-          let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, name, ft));
-        }, StringAnddynamicTovoid()));
+        staticSetters[dartx.forEach](dart.fn((symbol, ft) => {
+          let name = _js_mirrors.getName(symbol);
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, symbol, ft));
+        }, SymbolAnddynamicTovoid()));
         this[_declarations] = MapOfSymbol$DeclarationMirror().unmodifiable(this[_declarations]);
       }
       return this[_declarations];
@@ -13423,7 +13694,7 @@
       this[_cls] = cls;
       this[_raw] = _js_mirrors._getGenericClass(_js_mirrors._unwrap(cls));
       this.simpleName = core.Symbol.new(_js_mirrors._unwrap(cls).name);
-      this.mixin = null;
+      this[_mixin] = null;
       this[_typeArguments] = null;
       this[_metadata$] = null;
       this[_declarations] = null;
@@ -13441,6 +13712,25 @@
       let instance = name == 'new' || name == '' ? new (_js_mirrors._unwrap(this[_cls]))(...args) : new (_js_mirrors._unwrap(this[_cls]))[name](...args);
       return _js_mirrors.reflect(instance);
     }
+    getField(symbol) {
+      let name = _js_mirrors.getName(symbol);
+      return _js_mirrors.reflect(_js_mirrors._unwrap(this[_cls])[name]);
+    }
+    setField(symbol, value) {
+      let name = _js_mirrors.getName(symbol);
+      _js_mirrors._unwrap(this[_cls])[name] = value;
+      return _js_mirrors.reflect(value);
+    }
+    invoke(symbol, args, namedArgs) {
+      if (namedArgs === void 0) namedArgs = null;
+      let name = _js_mirrors.getName(symbol);
+      if (namedArgs != null) {
+        args = core.List.from(args);
+        args[dartx.add](_js_mirrors._toJsMap(namedArgs));
+      }
+      let result = _js_mirrors._unwrap(this[_cls])[name](...args);
+      return _js_mirrors.reflect(result);
+    }
     get superinterfaces() {
       let interfaceThunk = _js_mirrors._unwrap(this[_cls])[dart.implements];
       if (interfaceThunk == null) {
@@ -13475,6 +13765,24 @@
         return mirrors.ClassMirror._check(_js_mirrors.reflectType(core.Type._check(_js_mirrors._wrap(_js_mirrors._unwrap(this[_cls]).__proto__))));
       }
     }
+    get mixin() {
+      if (this[_mixin] != null) {
+        return this[_mixin];
+      }
+      let mixins = _js_mirrors._getMixins(_js_mirrors._unwrap(this[_cls]));
+      if (mixins == null || dart.test(dart.dload(mixins, 'isEmpty'))) {
+        this[_mixin] = this;
+        return this[_mixin];
+      }
+      if (dart.test(dart.dsend(dart.dload(mixins, 'length'), '>', 1))) {
+        dart.throw(new core.UnsupportedError("ClassMirror.mixin not yet supported for " + dart.str`classes (${this[_cls]}) with multiple mixins`));
+      }
+      this[_mixin] = mirrors.ClassMirror._check(_js_mirrors.reflectType(core.Type._check(_js_mirrors._wrap(dart.dindex(mixins, 0)))));
+      return this[_mixin];
+    }
+    toString() {
+      return dart.str`ClassMirror on '${this[_cls]}'`;
+    }
     get qualifiedName() {
       return core.Symbol._check(this.noSuchMethod(new dart.InvocationImpl('qualifiedName', [], {isGetter: true})));
     }
@@ -13499,15 +13807,6 @@
     get typeVariables() {
       return ListOfTypeVariableMirror()._check(this.noSuchMethod(new dart.InvocationImpl('typeVariables', [], {isGetter: true})));
     }
-    invoke(...args) {
-      return mirrors.InstanceMirror._check(this.noSuchMethod(new dart.InvocationImpl('invoke', args, {isMethod: true})));
-    }
-    getField(...args) {
-      return mirrors.InstanceMirror._check(this.noSuchMethod(new dart.InvocationImpl('getField', args, {isMethod: true})));
-    }
-    setField(...args) {
-      return mirrors.InstanceMirror._check(this.noSuchMethod(new dart.InvocationImpl('setField', args, {isMethod: true})));
-    }
     isSubclassOf(...args) {
       return core.bool._check(this.noSuchMethod(new dart.InvocationImpl('isSubclassOf', args, {isMethod: true})));
     }
@@ -13529,7 +13828,7 @@
       [_cls]: core.Type,
       simpleName: core.Symbol,
       [_raw]: dart.dynamic,
-      mixin: mirrors.ClassMirror,
+      [_mixin]: mirrors.ClassMirror,
       [_typeArguments]: ListOfTypeMirror(),
       [_metadata$]: ListOfInstanceMirror(),
       [_declarations]: MapOfSymbol$DeclarationMirror()
@@ -13543,22 +13842,33 @@
       isOriginalDeclaration: dart.definiteFunctionType(core.bool, []),
       typeArguments: dart.definiteFunctionType(core.List$(mirrors.TypeMirror), []),
       originalDeclaration: dart.definiteFunctionType(mirrors.TypeMirror, []),
-      superclass: dart.definiteFunctionType(mirrors.ClassMirror, [])
+      superclass: dart.definiteFunctionType(mirrors.ClassMirror, []),
+      mixin: dart.definiteFunctionType(mirrors.ClassMirror, [])
     }),
-    methods: () => ({newInstance: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.List], [MapOfSymbol$dynamic()])})
+    methods: () => ({
+      newInstance: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.List], [MapOfSymbol$dynamic()]),
+      getField: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol]),
+      setField: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.Object]),
+      invoke: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.List], [MapOfSymbol$dynamic()])
+    })
   });
+  const _symbol = Symbol('_symbol');
   const _name$ = Symbol('_name');
   _js_mirrors.JsVariableMirror = class JsVariableMirror extends _js_mirrors.JsMirror {
     get simpleName() {
-      return core.Symbol.new(this[_name$]);
+      return this[_symbol];
     }
-    _(name, t, annotations) {
-      this[_name$] = name;
+    _(symbol, t, annotations) {
+      this[_symbol] = symbol;
+      this[_name$] = _js_mirrors.getName(symbol);
       this.type = _js_mirrors.reflectType(t);
       this.metadata = ListOfInstanceMirror().unmodifiable(annotations[dartx.map](mirrors.InstanceMirror)(dart.fn(a => _js_mirrors.reflect(a), dynamicToInstanceMirror())));
       this.isStatic = false;
       this.isFinal = false;
     }
+    toString() {
+      return dart.str`VariableMirror on '${this[_name$]}'`;
+    }
     get qualifiedName() {
       return core.Symbol._check(this.noSuchMethod(new dart.InvocationImpl('qualifiedName', [], {isGetter: true})));
     }
@@ -13581,8 +13891,9 @@
   dart.defineNamedConstructor(_js_mirrors.JsVariableMirror, '_');
   _js_mirrors.JsVariableMirror[dart.implements] = () => [mirrors.VariableMirror];
   dart.setSignature(_js_mirrors.JsVariableMirror, {
-    constructors: () => ({_: dart.definiteFunctionType(_js_mirrors.JsVariableMirror, [core.String, core.Type, core.List])}),
+    constructors: () => ({_: dart.definiteFunctionType(_js_mirrors.JsVariableMirror, [core.Symbol, core.Type, core.List])}),
     fields: () => ({
+      [_symbol]: core.Symbol,
       [_name$]: core.String,
       type: mirrors.TypeMirror,
       metadata: ListOfInstanceMirror(),
@@ -13592,8 +13903,11 @@
     getters: () => ({simpleName: dart.definiteFunctionType(core.Symbol, [])})
   });
   _js_mirrors.JsParameterMirror = class JsParameterMirror extends _js_mirrors.JsVariableMirror {
-    _(name, t, annotations) {
-      super._(name, t, annotations);
+    _(member, t, annotations) {
+      super._(member, t, annotations);
+    }
+    toString() {
+      return dart.str`ParameterMirror on '${this[_name$]}'`;
     }
     get qualifiedName() {
       return core.Symbol._check(this.noSuchMethod(new dart.InvocationImpl('qualifiedName', [], {isGetter: true})));
@@ -13629,7 +13943,7 @@
   dart.defineNamedConstructor(_js_mirrors.JsParameterMirror, '_');
   _js_mirrors.JsParameterMirror[dart.implements] = () => [mirrors.ParameterMirror];
   dart.setSignature(_js_mirrors.JsParameterMirror, {
-    constructors: () => ({_: dart.definiteFunctionType(_js_mirrors.JsParameterMirror, [core.String, core.Type, core.List])})
+    constructors: () => ({_: dart.definiteFunctionType(_js_mirrors.JsParameterMirror, [core.Symbol, core.Type, core.List])})
   });
   const _params = Symbol('_params');
   const _createParameterMirrorList = Symbol('_createParameterMirrorList');
@@ -13644,10 +13958,11 @@
       return this[_name$][dartx.startsWith]('_');
     }
     get simpleName() {
-      return core.Symbol.new(this[_name$]);
+      return this[_symbol];
     }
-    _constructor(cls, name, ftype) {
-      this[_name$] = name;
+    _constructor(cls, symbol, ftype) {
+      this[_symbol] = symbol;
+      this[_name$] = _js_mirrors.getName(symbol);
       this.isConstructor = true;
       this.isStatic = false;
       this[_params] = null;
@@ -13655,8 +13970,9 @@
       this.isFinal = false;
       this[_createParameterMirrorList](ftype);
     }
-    _instanceMethod(cls, name, ftype) {
-      this[_name$] = name;
+    _instanceMethod(cls, symbol, ftype) {
+      this[_symbol] = symbol;
+      this[_name$] = _js_mirrors.getName(symbol);
       this.isConstructor = false;
       this.isStatic = false;
       this[_params] = null;
@@ -13664,8 +13980,9 @@
       this.isFinal = false;
       this[_createParameterMirrorList](ftype);
     }
-    _staticMethod(cls, name, ftype) {
-      this[_name$] = name;
+    _staticMethod(cls, symbol, ftype) {
+      this[_symbol] = symbol;
+      this[_name$] = _js_mirrors.getName(symbol);
       this.isConstructor = false;
       this.isStatic = true;
       this[_params] = null;
@@ -13674,7 +13991,7 @@
       this[_createParameterMirrorList](ftype);
     }
     get constructorName() {
-      return dart.test(this.isConstructor) ? core.Symbol.new(this[_name$]) : null;
+      return dart.test(this.isConstructor) ? this[_symbol] : null;
     }
     get parameters() {
       return this[_params];
@@ -13688,29 +14005,35 @@
         this[_metadata$] = const$3 || (const$3 = dart.constList([], mirrors.InstanceMirror));
         return;
       }
-      if (core.List.is(ftype)) {
+      if (!core.Function.is(ftype) && core.List.is(ftype)) {
         this[_metadata$] = ListOfInstanceMirror().unmodifiable(core.Iterable._check(dart.dsend(dart.dsend(ftype, 'skip', 1), 'map', dart.fn(a => _js_mirrors.reflect(a), dynamicToInstanceMirror()))));
         ftype = dart.dindex(ftype, 0);
       } else {
         this[_metadata$] = const$4 || (const$4 = dart.constList([], mirrors.InstanceMirror));
       }
+      if (typeof ftype == "function") {
+        ftype = ftype.apply(null, JSArrayOfType().of([dart.dynamic, dart.dynamic, dart.dynamic]));
+      }
       let args = core.List._check(dart.dload(ftype, 'args'));
       let opts = core.List._check(dart.dload(ftype, 'optionals'));
       let params = ListOfParameterMirror().new(dart.notNull(args[dartx.length]) + dart.notNull(opts[dartx.length]));
       for (let i = 0; i < dart.notNull(args[dartx.length]); ++i) {
-        let type = args[dartx.get](i);
+        let type = args[dartx._get](i);
         let metadata = dart.dindex(dart.dload(ftype, 'metadata'), i);
-        let param = new _js_mirrors.JsParameterMirror._('', core.Type._check(_js_mirrors._wrap(type)), core.List._check(metadata));
-        params[dartx.set](i, param);
+        let param = new _js_mirrors.JsParameterMirror._(core.Symbol.new(''), core.Type._check(_js_mirrors._wrap(type)), core.List._check(metadata));
+        params[dartx._set](i, param);
       }
       for (let i = 0; i < dart.notNull(opts[dartx.length]); ++i) {
-        let type = opts[dartx.get](i);
+        let type = opts[dartx._get](i);
         let metadata = dart.dindex(dart.dload(ftype, 'metadata'), dart.notNull(args[dartx.length]) + i);
-        let param = new _js_mirrors.JsParameterMirror._('', core.Type._check(_js_mirrors._wrap(type)), core.List._check(metadata));
-        params[dartx.set](i + dart.notNull(args[dartx.length]), param);
+        let param = new _js_mirrors.JsParameterMirror._(core.Symbol.new(''), core.Type._check(_js_mirrors._wrap(type)), core.List._check(metadata));
+        params[dartx._set](i + dart.notNull(args[dartx.length]), param);
       }
       this[_params] = ListOfParameterMirror().unmodifiable(params);
     }
+    toString() {
+      return dart.str`MethodMirror on '${this[_name$]}'`;
+    }
     get qualifiedName() {
       return core.Symbol._check(this.noSuchMethod(new dart.InvocationImpl('qualifiedName', [], {isGetter: true})));
     }
@@ -13763,11 +14086,12 @@
   _js_mirrors.JsMethodMirror[dart.implements] = () => [mirrors.MethodMirror];
   dart.setSignature(_js_mirrors.JsMethodMirror, {
     constructors: () => ({
-      _constructor: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.String, dart.dynamic]),
-      _instanceMethod: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.String, dart.dynamic]),
-      _staticMethod: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.String, dart.dynamic])
+      _constructor: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.Symbol, dart.dynamic]),
+      _instanceMethod: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.Symbol, dart.dynamic]),
+      _staticMethod: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.Symbol, dart.dynamic])
     }),
     fields: () => ({
+      [_symbol]: core.Symbol,
       [_name$]: core.String,
       [_params]: ListOfParameterMirror(),
       [_metadata$]: ListOfInstanceMirror(),
@@ -14538,11 +14862,11 @@
     _slowFromList(list) {
       this[_storage] = _native_typed_data.NativeFloat32List.new(dart.notNull(list[dartx.length]) * 4);
       for (let i = 0; i < dart.notNull(list[dartx.length]); i++) {
-        let e = list[dartx.get](i);
-        this[_storage][dartx.set](i * 4 + 0, e.x);
-        this[_storage][dartx.set](i * 4 + 1, e.y);
-        this[_storage][dartx.set](i * 4 + 2, e.z);
-        this[_storage][dartx.set](i * 4 + 3, e.w);
+        let e = list[dartx._get](i);
+        this[_storage][dartx._set](i * 4 + 0, e.x);
+        this[_storage][dartx._set](i * 4 + 1, e.y);
+        this[_storage][dartx._set](i * 4 + 2, e.z);
+        this[_storage][dartx._set](i * 4 + 3, e.w);
       }
     }
     get runtimeType() {
@@ -14573,20 +14897,20 @@
     set length(value) {
       super.length = value;
     }
-    get(index) {
+    _get(index) {
       _native_typed_data._checkValidIndex(index, this, this.length);
-      let _x = this[_storage][dartx.get](dart.notNull(index) * 4 + 0);
-      let _y = this[_storage][dartx.get](dart.notNull(index) * 4 + 1);
-      let _z = this[_storage][dartx.get](dart.notNull(index) * 4 + 2);
-      let _w = this[_storage][dartx.get](dart.notNull(index) * 4 + 3);
+      let _x = this[_storage][dartx._get](dart.notNull(index) * 4 + 0);
+      let _y = this[_storage][dartx._get](dart.notNull(index) * 4 + 1);
+      let _z = this[_storage][dartx._get](dart.notNull(index) * 4 + 2);
+      let _w = this[_storage][dartx._get](dart.notNull(index) * 4 + 3);
       return new _native_typed_data.NativeFloat32x4._truncated(_x, _y, _z, _w);
     }
-    set(index, value) {
+    _set(index, value) {
       _native_typed_data._checkValidIndex(index, this, this.length);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 0, value.x);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 1, value.y);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 2, value.z);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 3, value.w);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 0, value.x);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 1, value.y);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 2, value.z);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 3, value.w);
       return value;
     }
     sublist(start, end) {
@@ -14614,14 +14938,14 @@
       length: dart.definiteFunctionType(core.int, [])
     }),
     methods: () => ({
-      get: dart.definiteFunctionType(typed_data.Float32x4, [core.int]),
-      set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Float32x4]),
+      _get: dart.definiteFunctionType(typed_data.Float32x4, [core.int]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Float32x4]),
       sublist: dart.definiteFunctionType(core.List$(typed_data.Float32x4), [core.int], [core.int])
     })
   });
   dart.defineExtensionMembers(_native_typed_data.NativeFloat32x4List, [
-    'get',
-    'set',
+    '_get',
+    '_set',
     'sublist',
     'buffer',
     'lengthInBytes',
@@ -15171,11 +15495,11 @@
     _slowFromList(list) {
       this[_storage] = _native_typed_data.NativeInt32List.new(dart.notNull(list[dartx.length]) * 4);
       for (let i = 0; i < dart.notNull(list[dartx.length]); i++) {
-        let e = list[dartx.get](i);
-        this[_storage][dartx.set](i * 4 + 0, e.x);
-        this[_storage][dartx.set](i * 4 + 1, e.y);
-        this[_storage][dartx.set](i * 4 + 2, e.z);
-        this[_storage][dartx.set](i * 4 + 3, e.w);
+        let e = list[dartx._get](i);
+        this[_storage][dartx._set](i * 4 + 0, e.x);
+        this[_storage][dartx._set](i * 4 + 1, e.y);
+        this[_storage][dartx._set](i * 4 + 2, e.z);
+        this[_storage][dartx._set](i * 4 + 3, e.w);
       }
     }
     get runtimeType() {
@@ -15206,20 +15530,20 @@
     set length(value) {
       super.length = value;
     }
-    get(index) {
+    _get(index) {
       _native_typed_data._checkValidIndex(index, this, this.length);
-      let _x = this[_storage][dartx.get](dart.notNull(index) * 4 + 0);
-      let _y = this[_storage][dartx.get](dart.notNull(index) * 4 + 1);
-      let _z = this[_storage][dartx.get](dart.notNull(index) * 4 + 2);
-      let _w = this[_storage][dartx.get](dart.notNull(index) * 4 + 3);
+      let _x = this[_storage][dartx._get](dart.notNull(index) * 4 + 0);
+      let _y = this[_storage][dartx._get](dart.notNull(index) * 4 + 1);
+      let _z = this[_storage][dartx._get](dart.notNull(index) * 4 + 2);
+      let _w = this[_storage][dartx._get](dart.notNull(index) * 4 + 3);
       return new _native_typed_data.NativeInt32x4._truncated(_x, _y, _z, _w);
     }
-    set(index, value) {
+    _set(index, value) {
       _native_typed_data._checkValidIndex(index, this, this.length);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 0, value.x);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 1, value.y);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 2, value.z);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 3, value.w);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 0, value.x);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 1, value.y);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 2, value.z);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 3, value.w);
       return value;
     }
     sublist(start, end) {
@@ -15247,14 +15571,14 @@
       length: dart.definiteFunctionType(core.int, [])
     }),
     methods: () => ({
-      get: dart.definiteFunctionType(typed_data.Int32x4, [core.int]),
-      set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Int32x4]),
+      _get: dart.definiteFunctionType(typed_data.Int32x4, [core.int]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Int32x4]),
       sublist: dart.definiteFunctionType(core.List$(typed_data.Int32x4), [core.int], [core.int])
     })
   });
   dart.defineExtensionMembers(_native_typed_data.NativeInt32x4List, [
-    'get',
-    'set',
+    '_get',
+    '_set',
     'sublist',
     'buffer',
     'lengthInBytes',
@@ -15294,9 +15618,9 @@
     _slowFromList(list) {
       this[_storage] = _native_typed_data.NativeFloat64List.new(dart.notNull(list[dartx.length]) * 2);
       for (let i = 0; i < dart.notNull(list[dartx.length]); i++) {
-        let e = list[dartx.get](i);
-        this[_storage][dartx.set](i * 2 + 0, e.x);
-        this[_storage][dartx.set](i * 2 + 1, e.y);
+        let e = list[dartx._get](i);
+        this[_storage][dartx._set](i * 2 + 0, e.x);
+        this[_storage][dartx._set](i * 2 + 1, e.y);
       }
     }
     static fromList(list) {
@@ -15327,16 +15651,16 @@
     set length(value) {
       super.length = value;
     }
-    get(index) {
+    _get(index) {
       _native_typed_data._checkValidIndex(index, this, this.length);
-      let _x = this[_storage][dartx.get](dart.notNull(index) * 2 + 0);
-      let _y = this[_storage][dartx.get](dart.notNull(index) * 2 + 1);
+      let _x = this[_storage][dartx._get](dart.notNull(index) * 2 + 0);
+      let _y = this[_storage][dartx._get](dart.notNull(index) * 2 + 1);
       return typed_data.Float64x2.new(_x, _y);
     }
-    set(index, value) {
+    _set(index, value) {
       _native_typed_data._checkValidIndex(index, this, this.length);
-      this[_storage][dartx.set](dart.notNull(index) * 2 + 0, value.x);
-      this[_storage][dartx.set](dart.notNull(index) * 2 + 1, value.y);
+      this[_storage][dartx._set](dart.notNull(index) * 2 + 0, value.x);
+      this[_storage][dartx._set](dart.notNull(index) * 2 + 1, value.y);
       return value;
     }
     sublist(start, end) {
@@ -15364,14 +15688,14 @@
       length: dart.definiteFunctionType(core.int, [])
     }),
     methods: () => ({
-      get: dart.definiteFunctionType(typed_data.Float64x2, [core.int]),
-      set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Float64x2]),
+      _get: dart.definiteFunctionType(typed_data.Float64x2, [core.int]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Float64x2]),
       sublist: dart.definiteFunctionType(core.List$(typed_data.Float64x2), [core.int], [core.int])
     })
   });
   dart.defineExtensionMembers(_native_typed_data.NativeFloat64x2List, [
-    'get',
-    'set',
+    '_get',
+    '_set',
     'sublist',
     'buffer',
     'lengthInBytes',
@@ -15448,7 +15772,7 @@
     if (_interceptors.JSIndexable.is(list)) return list;
     let result = core.List.new(list[dartx.length]);
     for (let i = 0; i < dart.notNull(list[dartx.length]); i++) {
-      result[dartx.set](i, list[dartx.get](i));
+      result[dartx._set](i, list[dartx._get](i));
     }
     return result;
   };
@@ -15507,113 +15831,113 @@
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_getFloat32](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_getFloat32](byteOffset, littleEndian) {
-      return this.getFloat32(byteOffset, littleEndian);
+    [_getFloat32](...args) {
+      return this.getFloat32.apply(this, args);
     }
     [dartx.getFloat64](byteOffset, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_getFloat64](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_getFloat64](byteOffset, littleEndian) {
-      return this.getFloat64(byteOffset, littleEndian);
+    [_getFloat64](...args) {
+      return this.getFloat64.apply(this, args);
     }
     [dartx.getInt16](byteOffset, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_getInt16](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_getInt16](byteOffset, littleEndian) {
-      return this.getInt16(byteOffset, littleEndian);
+    [_getInt16](...args) {
+      return this.getInt16.apply(this, args);
     }
     [dartx.getInt32](byteOffset, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_getInt32](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_getInt32](byteOffset, littleEndian) {
-      return this.getInt32(byteOffset, littleEndian);
+    [_getInt32](...args) {
+      return this.getInt32.apply(this, args);
     }
     [dartx.getInt64](byteOffset, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       dart.throw(new core.UnsupportedError('Int64 accessor not supported by dart2js.'));
     }
-    [dartx.getInt8](byteOffset) {
-      return this.getInt8(byteOffset);
+    [dartx.getInt8](...args) {
+      return this.getInt8.apply(this, args);
     }
     [dartx.getUint16](byteOffset, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_getUint16](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_getUint16](byteOffset, littleEndian) {
-      return this.getUint16(byteOffset, littleEndian);
+    [_getUint16](...args) {
+      return this.getUint16.apply(this, args);
     }
     [dartx.getUint32](byteOffset, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_getUint32](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_getUint32](byteOffset, littleEndian) {
-      return this.getUint32(byteOffset, littleEndian);
+    [_getUint32](...args) {
+      return this.getUint32.apply(this, args);
     }
     [dartx.getUint64](byteOffset, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       dart.throw(new core.UnsupportedError('Uint64 accessor not supported by dart2js.'));
     }
-    [dartx.getUint8](byteOffset) {
-      return this.getUint8(byteOffset);
+    [dartx.getUint8](...args) {
+      return this.getUint8.apply(this, args);
     }
     [dartx.setFloat32](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_setFloat32](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_setFloat32](byteOffset, value, littleEndian) {
-      return this.setFloat32(byteOffset, value, littleEndian);
+    [_setFloat32](...args) {
+      return this.setFloat32.apply(this, args);
     }
     [dartx.setFloat64](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_setFloat64](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_setFloat64](byteOffset, value, littleEndian) {
-      return this.setFloat64(byteOffset, value, littleEndian);
+    [_setFloat64](...args) {
+      return this.setFloat64.apply(this, args);
     }
     [dartx.setInt16](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_setInt16](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_setInt16](byteOffset, value, littleEndian) {
-      return this.setInt16(byteOffset, value, littleEndian);
+    [_setInt16](...args) {
+      return this.setInt16.apply(this, args);
     }
     [dartx.setInt32](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_setInt32](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_setInt32](byteOffset, value, littleEndian) {
-      return this.setInt32(byteOffset, value, littleEndian);
+    [_setInt32](...args) {
+      return this.setInt32.apply(this, args);
     }
     [dartx.setInt64](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       dart.throw(new core.UnsupportedError('Int64 accessor not supported by dart2js.'));
     }
-    [dartx.setInt8](byteOffset, value) {
-      return this.setInt8(byteOffset, value);
+    [dartx.setInt8](...args) {
+      return this.setInt8.apply(this, args);
     }
     [dartx.setUint16](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_setUint16](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_setUint16](byteOffset, value, littleEndian) {
-      return this.setUint16(byteOffset, value, littleEndian);
+    [_setUint16](...args) {
+      return this.setUint16.apply(this, args);
     }
     [dartx.setUint32](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_setUint32](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_setUint32](byteOffset, value, littleEndian) {
-      return this.setUint32(byteOffset, value, littleEndian);
+    [_setUint32](...args) {
+      return this.setUint32.apply(this, args);
     }
     [dartx.setUint64](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       dart.throw(new core.UnsupportedError('Uint64 accessor not supported by dart2js.'));
     }
-    [dartx.setUint8](byteOffset, value) {
-      return this.setUint8(byteOffset, value);
+    [dartx.setUint8](...args) {
+      return this.setUint8.apply(this, args);
     }
     static _create1(arg) {
       return new DataView(new ArrayBuffer(arg));
@@ -15698,8 +16022,8 @@
   });
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'setRange'
   ]);
   _native_typed_data.NativeTypedArrayOfDouble = class NativeTypedArrayOfDouble extends dart.mixin(_native_typed_data.NativeTypedArray, collection.ListMixin$(core.double), _internal.FixedLengthListMixin$(core.double)) {
@@ -15709,11 +16033,11 @@
     set length(value) {
       super.length = value;
     }
-    get(index) {
+    _get(index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
-    set(index, value) {
+    _set(index, value) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       this[index] = value;
       return value;
@@ -15730,15 +16054,15 @@
   dart.setSignature(_native_typed_data.NativeTypedArrayOfDouble, {
     getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
     methods: () => ({
-      get: dart.definiteFunctionType(core.double, [core.int]),
-      set: dart.definiteFunctionType(dart.void, [core.int, core.num]),
+      _get: dart.definiteFunctionType(core.double, [core.int]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, core.num]),
       setRange: dart.definiteFunctionType(dart.void, [core.int, core.int, IterableOfdouble()], [core.int])
     })
   });
-  dart.defineExtensionMembers(_native_typed_data.NativeTypedArrayOfDouble, ['get', 'set', 'setRange', 'length']);
+  dart.defineExtensionMembers(_native_typed_data.NativeTypedArrayOfDouble, ['_get', '_set', 'setRange', 'length']);
   dart.defineExtensionNames([
     'length',
-    'set',
+    '_set',
     'setRange'
   ]);
   _native_typed_data.NativeTypedArrayOfInt = class NativeTypedArrayOfInt extends dart.mixin(_native_typed_data.NativeTypedArray, collection.ListMixin$(core.int), _internal.FixedLengthListMixin$(core.int)) {
@@ -15748,7 +16072,7 @@
     set length(value) {
       super.length = value;
     }
-    set(index, value) {
+    _set(index, value) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       this[index] = value;
       return value;
@@ -15766,11 +16090,11 @@
   dart.setSignature(_native_typed_data.NativeTypedArrayOfInt, {
     getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
     methods: () => ({
-      set: dart.definiteFunctionType(dart.void, [core.int, core.int]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, core.int]),
       setRange: dart.definiteFunctionType(dart.void, [core.int, core.int, IterableOfint()], [core.int])
     })
   });
-  dart.defineExtensionMembers(_native_typed_data.NativeTypedArrayOfInt, ['set', 'setRange', 'length']);
+  dart.defineExtensionMembers(_native_typed_data.NativeTypedArrayOfInt, ['_set', 'setRange', 'length']);
   dart.defineExtensionNames([
     'runtimeType',
     'sublist'
@@ -15873,7 +16197,7 @@
   dart.registerExtension(dart.global.Float64Array, _native_typed_data.NativeFloat64List);
   dart.defineExtensionNames([
     'runtimeType',
-    'get',
+    '_get',
     'sublist'
   ]);
   _native_typed_data.NativeInt16List = class NativeInt16List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -15890,7 +16214,7 @@
     get [dartx.runtimeType]() {
       return dart.wrapType(typed_data.Int16List);
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
@@ -15918,7 +16242,7 @@
       view: dart.definiteFunctionType(_native_typed_data.NativeInt16List, [_native_typed_data.NativeByteBuffer, core.int, core.int])
     }),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+      [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
       [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
     }),
     statics: () => ({
@@ -15931,7 +16255,7 @@
   dart.registerExtension(dart.global.Int16Array, _native_typed_data.NativeInt16List);
   dart.defineExtensionNames([
     'runtimeType',
-    'get',
+    '_get',
     'sublist'
   ]);
   _native_typed_data.NativeInt32List = class NativeInt32List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -15948,7 +16272,7 @@
     get [dartx.runtimeType]() {
       return dart.wrapType(typed_data.Int32List);
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
@@ -15976,7 +16300,7 @@
       view: dart.definiteFunctionType(_native_typed_data.NativeInt32List, [typed_data.ByteBuffer, core.int, core.int])
     }),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+      [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
       [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
     }),
     statics: () => ({
@@ -15989,7 +16313,7 @@
   dart.registerExtension(dart.global.Int32Array, _native_typed_data.NativeInt32List);
   dart.defineExtensionNames([
     'runtimeType',
-    'get',
+    '_get',
     'sublist'
   ]);
   _native_typed_data.NativeInt8List = class NativeInt8List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -16006,7 +16330,7 @@
     get [dartx.runtimeType]() {
       return dart.wrapType(typed_data.Int8List);
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
@@ -16034,7 +16358,7 @@
       view: dart.definiteFunctionType(_native_typed_data.NativeInt8List, [typed_data.ByteBuffer, core.int, core.int])
     }),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+      [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
       [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
     }),
     statics: () => ({
@@ -16047,7 +16371,7 @@
   dart.registerExtension(dart.global.Int8Array, _native_typed_data.NativeInt8List);
   dart.defineExtensionNames([
     'runtimeType',
-    'get',
+    '_get',
     'sublist'
   ]);
   _native_typed_data.NativeUint16List = class NativeUint16List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -16064,7 +16388,7 @@
     get [dartx.runtimeType]() {
       return dart.wrapType(typed_data.Uint16List);
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
@@ -16092,7 +16416,7 @@
       view: dart.definiteFunctionType(_native_typed_data.NativeUint16List, [typed_data.ByteBuffer, core.int, core.int])
     }),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+      [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
       [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
     }),
     statics: () => ({
@@ -16105,7 +16429,7 @@
   dart.registerExtension(dart.global.Uint16Array, _native_typed_data.NativeUint16List);
   dart.defineExtensionNames([
     'runtimeType',
-    'get',
+    '_get',
     'sublist'
   ]);
   _native_typed_data.NativeUint32List = class NativeUint32List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -16122,7 +16446,7 @@
     get [dartx.runtimeType]() {
       return dart.wrapType(typed_data.Uint32List);
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
@@ -16150,7 +16474,7 @@
       view: dart.definiteFunctionType(_native_typed_data.NativeUint32List, [typed_data.ByteBuffer, core.int, core.int])
     }),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+      [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
       [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
     }),
     statics: () => ({
@@ -16164,7 +16488,7 @@
   dart.defineExtensionNames([
     'runtimeType',
     'length',
-    'get',
+    '_get',
     'sublist'
   ]);
   _native_typed_data.NativeUint8ClampedList = class NativeUint8ClampedList extends _native_typed_data.NativeTypedArrayOfInt {
@@ -16187,7 +16511,7 @@
     set [dartx.length](value) {
       super[dartx.length] = value;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
@@ -16215,7 +16539,7 @@
       view: dart.definiteFunctionType(_native_typed_data.NativeUint8ClampedList, [typed_data.ByteBuffer, core.int, core.int])
     }),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+      [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
       [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
     }),
     statics: () => ({
@@ -16226,10 +16550,11 @@
     names: ['_create1', '_create2', '_create3']
   });
   dart.registerExtension(dart.global.Uint8ClampedArray, _native_typed_data.NativeUint8ClampedList);
+  dart.registerExtension(dart.global.CanvasPixelArray, _native_typed_data.NativeUint8ClampedList);
   dart.defineExtensionNames([
     'runtimeType',
     'length',
-    'get',
+    '_get',
     'sublist'
   ]);
   _native_typed_data.NativeUint8List = class NativeUint8List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -16252,7 +16577,7 @@
     set [dartx.length](value) {
       super[dartx.length] = value;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
@@ -16280,7 +16605,7 @@
       view: dart.definiteFunctionType(_native_typed_data.NativeUint8List, [typed_data.ByteBuffer, core.int, core.int])
     }),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+      [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
       [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
     }),
     statics: () => ({
@@ -16293,8 +16618,8 @@
   dart.registerExtension(dart.global.Uint8Array, _native_typed_data.NativeUint8List);
   _native_typed_data.NativeFloat32x4 = class NativeFloat32x4 extends core.Object {
     static _truncate(x) {
-      _native_typed_data.NativeFloat32x4._list[dartx.set](0, core.num._check(x));
-      return _native_typed_data.NativeFloat32x4._list[dartx.get](0);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](0, core.num._check(x));
+      return _native_typed_data.NativeFloat32x4._list[dartx._get](0);
     }
     new(x, y, z, w) {
       this.x = core.double._check(_native_typed_data.NativeFloat32x4._truncate(x));
@@ -16313,11 +16638,11 @@
       NativeFloat32x4.prototype._truncated.call(this, 0.0, 0.0, 0.0, 0.0);
     }
     static fromInt32x4Bits(i) {
-      _native_typed_data.NativeFloat32x4._uint32view[dartx.set](0, i.x);
-      _native_typed_data.NativeFloat32x4._uint32view[dartx.set](1, i.y);
-      _native_typed_data.NativeFloat32x4._uint32view[dartx.set](2, i.z);
-      _native_typed_data.NativeFloat32x4._uint32view[dartx.set](3, i.w);
-      return new _native_typed_data.NativeFloat32x4._truncated(_native_typed_data.NativeFloat32x4._list[dartx.get](0), _native_typed_data.NativeFloat32x4._list[dartx.get](1), _native_typed_data.NativeFloat32x4._list[dartx.get](2), _native_typed_data.NativeFloat32x4._list[dartx.get](3));
+      _native_typed_data.NativeFloat32x4._uint32view[dartx._set](0, i.x);
+      _native_typed_data.NativeFloat32x4._uint32view[dartx._set](1, i.y);
+      _native_typed_data.NativeFloat32x4._uint32view[dartx._set](2, i.z);
+      _native_typed_data.NativeFloat32x4._uint32view[dartx._set](3, i.w);
+      return new _native_typed_data.NativeFloat32x4._truncated(_native_typed_data.NativeFloat32x4._list[dartx._get](0), _native_typed_data.NativeFloat32x4._list[dartx._get](1), _native_typed_data.NativeFloat32x4._list[dartx._get](2), _native_typed_data.NativeFloat32x4._list[dartx._get](3));
     }
     fromFloat64x2(v) {
       NativeFloat32x4.prototype._truncated.call(this, core.double._check(_native_typed_data.NativeFloat32x4._truncate(v.x)), core.double._check(_native_typed_data.NativeFloat32x4._truncate(v.y)), 0.0, 0.0);
@@ -16344,7 +16669,7 @@
       let _w = dart.notNull(this.w) + dart.notNull(other.w);
       return new _native_typed_data.NativeFloat32x4._doubles(_x, _y, _z, _w);
     }
-    ['unary-']() {
+    _negate() {
       return new _native_typed_data.NativeFloat32x4._truncated(-dart.notNull(this.x), -dart.notNull(this.y), -dart.notNull(this.z), -dart.notNull(this.w));
     }
     ['-'](other) {
@@ -16450,46 +16775,46 @@
     get signMask() {
       let view = _native_typed_data.NativeFloat32x4._uint32view;
       let mx = null, my = null, mz = null, mw = null;
-      _native_typed_data.NativeFloat32x4._list[dartx.set](0, this.x);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](1, this.y);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](2, this.z);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](3, this.w);
-      mx = (dart.notNull(view[dartx.get](0)) & 2147483648) >>> 31;
-      my = (dart.notNull(view[dartx.get](1)) & 2147483648) >>> 30;
-      mz = (dart.notNull(view[dartx.get](2)) & 2147483648) >>> 29;
-      mw = (dart.notNull(view[dartx.get](3)) & 2147483648) >>> 28;
+      _native_typed_data.NativeFloat32x4._list[dartx._set](0, this.x);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](1, this.y);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](2, this.z);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](3, this.w);
+      mx = (dart.notNull(view[dartx._get](0)) & 2147483648) >>> 31;
+      my = (dart.notNull(view[dartx._get](1)) & 2147483648) >>> 30;
+      mz = (dart.notNull(view[dartx._get](2)) & 2147483648) >>> 29;
+      mw = (dart.notNull(view[dartx._get](3)) & 2147483648) >>> 28;
       return core.int._check(dart.dsend(dart.dsend(dart.dsend(mx, '|', my), '|', mz), '|', mw));
     }
     shuffle(mask) {
       if (dart.notNull(mask) < 0 || dart.notNull(mask) > 255) {
         dart.throw(new core.RangeError.range(mask, 0, 255, "mask"));
       }
-      _native_typed_data.NativeFloat32x4._list[dartx.set](0, this.x);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](1, this.y);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](2, this.z);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](3, this.w);
-      let _x = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) & 3);
-      let _y = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 2 & 3);
-      let _z = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 4 & 3);
-      let _w = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 6 & 3);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](0, this.x);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](1, this.y);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](2, this.z);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](3, this.w);
+      let _x = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) & 3);
+      let _y = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 2 & 3);
+      let _z = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 4 & 3);
+      let _w = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 6 & 3);
       return new _native_typed_data.NativeFloat32x4._truncated(_x, _y, _z, _w);
     }
     shuffleMix(other, mask) {
       if (dart.notNull(mask) < 0 || dart.notNull(mask) > 255) {
         dart.throw(new core.RangeError.range(mask, 0, 255, "mask"));
       }
-      _native_typed_data.NativeFloat32x4._list[dartx.set](0, this.x);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](1, this.y);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](2, this.z);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](3, this.w);
-      let _x = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) & 3);
-      let _y = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 2 & 3);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](0, other.x);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](1, other.y);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](2, other.z);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](3, other.w);
-      let _z = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 4 & 3);
-      let _w = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 6 & 3);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](0, this.x);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](1, this.y);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](2, this.z);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](3, this.w);
+      let _x = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) & 3);
+      let _y = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 2 & 3);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](0, other.x);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](1, other.y);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](2, other.z);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](3, other.w);
+      let _z = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 4 & 3);
+      let _w = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 6 & 3);
       return new _native_typed_data.NativeFloat32x4._truncated(_x, _y, _z, _w);
     }
     withX(newX) {
@@ -16565,7 +16890,7 @@
     getters: () => ({signMask: dart.definiteFunctionType(core.int, [])}),
     methods: () => ({
       '+': dart.definiteFunctionType(typed_data.Float32x4, [typed_data.Float32x4]),
-      'unary-': dart.definiteFunctionType(typed_data.Float32x4, []),
+      _negate: dart.definiteFunctionType(typed_data.Float32x4, []),
       '-': dart.definiteFunctionType(typed_data.Float32x4, [typed_data.Float32x4]),
       '*': dart.definiteFunctionType(typed_data.Float32x4, [typed_data.Float32x4]),
       '/': dart.definiteFunctionType(typed_data.Float32x4, [typed_data.Float32x4]),
@@ -16607,8 +16932,8 @@
   });
   _native_typed_data.NativeInt32x4 = class NativeInt32x4 extends core.Object {
     static _truncate(x) {
-      _native_typed_data.NativeInt32x4._list[dartx.set](0, core.int._check(x));
-      return _native_typed_data.NativeInt32x4._list[dartx.get](0);
+      _native_typed_data.NativeInt32x4._list[dartx._set](0, core.int._check(x));
+      return _native_typed_data.NativeInt32x4._list[dartx._get](0);
     }
     new(x, y, z, w) {
       this.x = core.int._check(_native_typed_data.NativeInt32x4._truncate(x));
@@ -16628,12 +16953,12 @@
     }
     static fromFloat32x4Bits(f) {
       let floatList = _native_typed_data.NativeFloat32x4._list;
-      floatList[dartx.set](0, f.x);
-      floatList[dartx.set](1, f.y);
-      floatList[dartx.set](2, f.z);
-      floatList[dartx.set](3, f.w);
+      floatList[dartx._set](0, f.x);
+      floatList[dartx._set](1, f.y);
+      floatList[dartx._set](2, f.z);
+      floatList[dartx._set](3, f.w);
       let view = _native_typed_data.NativeInt32List._check(floatList[dartx.buffer][dartx.asInt32List]());
-      return new _native_typed_data.NativeInt32x4._truncated(view[dartx.get](0), view[dartx.get](1), view[dartx.get](2), view[dartx.get](3));
+      return new _native_typed_data.NativeInt32x4._truncated(view[dartx._get](0), view[dartx._get](1), view[dartx._get](2), view[dartx._get](3));
     }
     _truncated(x, y, z, w) {
       this.x = x;
@@ -16659,7 +16984,7 @@
     ['-'](other) {
       return new _native_typed_data.NativeInt32x4._truncated(this.x - other.x | 0, this.y - other.y | 0, this.z - other.z | 0, this.w - other.w | 0);
     }
-    ['unary-']() {
+    _negate() {
       return new _native_typed_data.NativeInt32x4._truncated(-this.x | 0, -this.y | 0, -this.z | 0, -this.w | 0);
     }
     get signMask() {
@@ -16673,32 +16998,32 @@
       if (dart.notNull(mask) < 0 || dart.notNull(mask) > 255) {
         dart.throw(new core.RangeError.range(mask, 0, 255, "mask"));
       }
-      _native_typed_data.NativeInt32x4._list[dartx.set](0, this.x);
-      _native_typed_data.NativeInt32x4._list[dartx.set](1, this.y);
-      _native_typed_data.NativeInt32x4._list[dartx.set](2, this.z);
-      _native_typed_data.NativeInt32x4._list[dartx.set](3, this.w);
-      let _x = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) & 3);
-      let _y = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 2 & 3);
-      let _z = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 4 & 3);
-      let _w = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 6 & 3);
+      _native_typed_data.NativeInt32x4._list[dartx._set](0, this.x);
+      _native_typed_data.NativeInt32x4._list[dartx._set](1, this.y);
+      _native_typed_data.NativeInt32x4._list[dartx._set](2, this.z);
+      _native_typed_data.NativeInt32x4._list[dartx._set](3, this.w);
+      let _x = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) & 3);
+      let _y = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 2 & 3);
+      let _z = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 4 & 3);
+      let _w = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 6 & 3);
       return new _native_typed_data.NativeInt32x4._truncated(_x, _y, _z, _w);
     }
     shuffleMix(other, mask) {
       if (dart.notNull(mask) < 0 || dart.notNull(mask) > 255) {
         dart.throw(new core.RangeError.range(mask, 0, 255, "mask"));
       }
-      _native_typed_data.NativeInt32x4._list[dartx.set](0, this.x);
-      _native_typed_data.NativeInt32x4._list[dartx.set](1, this.y);
-      _native_typed_data.NativeInt32x4._list[dartx.set](2, this.z);
-      _native_typed_data.NativeInt32x4._list[dartx.set](3, this.w);
-      let _x = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) & 3);
-      let _y = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 2 & 3);
-      _native_typed_data.NativeInt32x4._list[dartx.set](0, other.x);
-      _native_typed_data.NativeInt32x4._list[dartx.set](1, other.y);
-      _native_typed_data.NativeInt32x4._list[dartx.set](2, other.z);
-      _native_typed_data.NativeInt32x4._list[dartx.set](3, other.w);
-      let _z = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 4 & 3);
-      let _w = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 6 & 3);
+      _native_typed_data.NativeInt32x4._list[dartx._set](0, this.x);
+      _native_typed_data.NativeInt32x4._list[dartx._set](1, this.y);
+      _native_typed_data.NativeInt32x4._list[dartx._set](2, this.z);
+      _native_typed_data.NativeInt32x4._list[dartx._set](3, this.w);
+      let _x = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) & 3);
+      let _y = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 2 & 3);
+      _native_typed_data.NativeInt32x4._list[dartx._set](0, other.x);
+      _native_typed_data.NativeInt32x4._list[dartx._set](1, other.y);
+      _native_typed_data.NativeInt32x4._list[dartx._set](2, other.z);
+      _native_typed_data.NativeInt32x4._list[dartx._set](3, other.w);
+      let _z = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 4 & 3);
+      let _w = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 6 & 3);
       return new _native_typed_data.NativeInt32x4._truncated(_x, _y, _z, _w);
     }
     withX(x) {
@@ -16748,31 +17073,31 @@
     select(trueValue, falseValue) {
       let floatList = _native_typed_data.NativeFloat32x4._list;
       let intView = _native_typed_data.NativeFloat32x4._uint32view;
-      floatList[dartx.set](0, trueValue.x);
-      floatList[dartx.set](1, trueValue.y);
-      floatList[dartx.set](2, trueValue.z);
-      floatList[dartx.set](3, trueValue.w);
-      let stx = intView[dartx.get](0);
-      let sty = intView[dartx.get](1);
-      let stz = intView[dartx.get](2);
-      let stw = intView[dartx.get](3);
-      floatList[dartx.set](0, falseValue.x);
-      floatList[dartx.set](1, falseValue.y);
-      floatList[dartx.set](2, falseValue.z);
-      floatList[dartx.set](3, falseValue.w);
-      let sfx = intView[dartx.get](0);
-      let sfy = intView[dartx.get](1);
-      let sfz = intView[dartx.get](2);
-      let sfw = intView[dartx.get](3);
+      floatList[dartx._set](0, trueValue.x);
+      floatList[dartx._set](1, trueValue.y);
+      floatList[dartx._set](2, trueValue.z);
+      floatList[dartx._set](3, trueValue.w);
+      let stx = intView[dartx._get](0);
+      let sty = intView[dartx._get](1);
+      let stz = intView[dartx._get](2);
+      let stw = intView[dartx._get](3);
+      floatList[dartx._set](0, falseValue.x);
+      floatList[dartx._set](1, falseValue.y);
+      floatList[dartx._set](2, falseValue.z);
+      floatList[dartx._set](3, falseValue.w);
+      let sfx = intView[dartx._get](0);
+      let sfy = intView[dartx._get](1);
+      let sfz = intView[dartx._get](2);
+      let sfw = intView[dartx._get](3);
       let _x = (dart.notNull(this.x) & dart.notNull(stx) | ~dart.notNull(this.x) & dart.notNull(sfx)) >>> 0;
       let _y = (dart.notNull(this.y) & dart.notNull(sty) | ~dart.notNull(this.y) & dart.notNull(sfy)) >>> 0;
       let _z = (dart.notNull(this.z) & dart.notNull(stz) | ~dart.notNull(this.z) & dart.notNull(sfz)) >>> 0;
       let _w = (dart.notNull(this.w) & dart.notNull(stw) | ~dart.notNull(this.w) & dart.notNull(sfw)) >>> 0;
-      intView[dartx.set](0, _x);
-      intView[dartx.set](1, _y);
-      intView[dartx.set](2, _z);
-      intView[dartx.set](3, _w);
-      return new _native_typed_data.NativeFloat32x4._truncated(floatList[dartx.get](0), floatList[dartx.get](1), floatList[dartx.get](2), floatList[dartx.get](3));
+      intView[dartx._set](0, _x);
+      intView[dartx._set](1, _y);
+      intView[dartx._set](2, _z);
+      intView[dartx._set](3, _w);
+      return new _native_typed_data.NativeFloat32x4._truncated(floatList[dartx._get](0), floatList[dartx._get](1), floatList[dartx._get](2), floatList[dartx._get](3));
     }
   };
   dart.defineNamedConstructor(_native_typed_data.NativeInt32x4, 'bool');
@@ -16804,7 +17129,7 @@
       '^': dart.definiteFunctionType(typed_data.Int32x4, [typed_data.Int32x4]),
       '+': dart.definiteFunctionType(typed_data.Int32x4, [typed_data.Int32x4]),
       '-': dart.definiteFunctionType(typed_data.Int32x4, [typed_data.Int32x4]),
-      'unary-': dart.definiteFunctionType(typed_data.Int32x4, []),
+      _negate: dart.definiteFunctionType(typed_data.Int32x4, []),
       shuffle: dart.definiteFunctionType(typed_data.Int32x4, [core.int]),
       shuffleMix: dart.definiteFunctionType(typed_data.Int32x4, [typed_data.Int32x4, core.int]),
       withX: dart.definiteFunctionType(typed_data.Int32x4, [core.int]),
@@ -16852,7 +17177,7 @@
     ['+'](other) {
       return new _native_typed_data.NativeFloat64x2._doubles(dart.notNull(this.x) + dart.notNull(other.x), dart.notNull(this.y) + dart.notNull(other.y));
     }
-    ['unary-']() {
+    _negate() {
       return new _native_typed_data.NativeFloat64x2._doubles(-dart.notNull(this.x), -dart.notNull(this.y));
     }
     ['-'](other) {
@@ -16885,10 +17210,10 @@
     }
     get signMask() {
       let view = _native_typed_data.NativeFloat64x2._uint32View;
-      _native_typed_data.NativeFloat64x2._list[dartx.set](0, this.x);
-      _native_typed_data.NativeFloat64x2._list[dartx.set](1, this.y);
-      let mx = (dart.notNull(view[dartx.get](1)) & 2147483648) >>> 31;
-      let my = (dart.notNull(view[dartx.get](3)) & 2147483648) >>> 31;
+      _native_typed_data.NativeFloat64x2._list[dartx._set](0, this.x);
+      _native_typed_data.NativeFloat64x2._list[dartx._set](1, this.y);
+      let mx = (dart.notNull(view[dartx._get](1)) & 2147483648) >>> 31;
+      let my = (dart.notNull(view[dartx._get](3)) & 2147483648) >>> 31;
       return (mx | my << 1) >>> 0;
     }
     withX(x) {
@@ -16929,7 +17254,7 @@
     getters: () => ({signMask: dart.definiteFunctionType(core.int, [])}),
     methods: () => ({
       '+': dart.definiteFunctionType(typed_data.Float64x2, [typed_data.Float64x2]),
-      'unary-': dart.definiteFunctionType(typed_data.Float64x2, []),
+      _negate: dart.definiteFunctionType(typed_data.Float64x2, []),
       '-': dart.definiteFunctionType(typed_data.Float64x2, [typed_data.Float64x2]),
       '*': dart.definiteFunctionType(typed_data.Float64x2, [typed_data.Float64x2]),
       '/': dart.definiteFunctionType(typed_data.Float64x2, [typed_data.Float64x2]),
@@ -18296,7 +18621,7 @@
             future.then(dart.dynamic)(dart.fn(value => {
               remaining--;
               if (values != null) {
-                values[dartx.set](pos, value);
+                values[dartx._set](pos, value);
                 if (remaining == 0) {
                   result[_completeWithValue](values);
                 }
@@ -22321,13 +22646,13 @@
         }
       };
     }
-    get(key) {
-      let result = this[_map$][dartx.get](key);
+    _get(key) {
+      let result = this[_map$][dartx._get](key);
       if (result != null || dart.test(this[_map$][dartx.containsKey](key))) return result;
       if (this.parent != null) {
-        let value = this.parent.get(key);
+        let value = this.parent._get(key);
         if (value != null) {
-          this[_map$][dartx.set](key, value);
+          this[_map$][dartx._set](key, value);
         }
         return value;
       }
@@ -22475,7 +22800,7 @@
       bindCallback: dart.definiteFunctionType(R => [async.ZoneCallback$(R), [dart.functionType(R, [])], {runGuarded: core.bool}]),
       bindUnaryCallback: dart.definiteFunctionType((R, T) => [async.ZoneUnaryCallback$(R, T), [dart.functionType(R, [T])], {runGuarded: core.bool}]),
       bindBinaryCallback: dart.definiteFunctionType((R, T1, T2) => [async.ZoneBinaryCallback$(R, T1, T2), [dart.functionType(R, [T1, T2])], {runGuarded: core.bool}]),
-      get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
+      _get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
       handleUncaughtError: dart.definiteFunctionType(R => [R, [dart.dynamic, core.StackTrace]]),
       fork: dart.definiteFunctionType(async.Zone, [], {specification: async.ZoneSpecification, zoneValues: core.Map}),
       run: dart.definiteFunctionType(R => [R, [dart.functionType(R, [])]]),
@@ -22757,7 +23082,7 @@
         }
       };
     }
-    get(key) {
+    _get(key) {
       return null;
     }
     handleUncaughtError(R) {
@@ -22847,7 +23172,7 @@
       bindCallback: dart.definiteFunctionType(R => [async.ZoneCallback$(R), [dart.functionType(R, [])], {runGuarded: core.bool}]),
       bindUnaryCallback: dart.definiteFunctionType((R, T) => [async.ZoneUnaryCallback$(R, T), [dart.functionType(R, [T])], {runGuarded: core.bool}]),
       bindBinaryCallback: dart.definiteFunctionType((R, T1, T2) => [async.ZoneBinaryCallback$(R, T1, T2), [dart.functionType(R, [T1, T2])], {runGuarded: core.bool}]),
-      get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
+      _get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
       handleUncaughtError: dart.definiteFunctionType(R => [R, [dart.dynamic, core.StackTrace]]),
       fork: dart.definiteFunctionType(async.Zone, [], {specification: async.ZoneSpecification, zoneValues: core.Map}),
       run: dart.definiteFunctionType(R => [R, [dart.functionType(R, [])]]),
@@ -22961,7 +23286,7 @@
         return new (_HashMapKeyIterableOfK())(this);
       }
       get values() {
-        return MappedIterableOfK$V().new(this.keys, dart.fn(each => this.get(each), KToV()));
+        return MappedIterableOfK$V().new(this.keys, dart.fn(each => this._get(each), KToV()));
       }
       containsKey(key) {
         if (dart.test(collection._HashMap._isStringKey(key))) {
@@ -22981,15 +23306,15 @@
         return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0;
       }
       containsValue(value) {
-        return this[_computeKeys]()[dartx.any](dart.fn(each => dart.equals(this.get(each), value), KTobool()));
+        return this[_computeKeys]()[dartx.any](dart.fn(each => dart.equals(this._get(each), value), KTobool()));
       }
       addAll(other) {
         MapOfK$V()._check(other);
         other[dartx.forEach](dart.fn((key, value) => {
-          this.set(key, value);
+          this._set(key, value);
         }, KAndVTovoid$()));
       }
-      get(key) {
+      _get(key) {
         if (dart.test(collection._HashMap._isStringKey(key))) {
           let strings = this[_strings$];
           return V._check(strings == null ? null : collection._HashMap._getTableEntry(strings, key));
@@ -23007,7 +23332,7 @@
         let index = this[_findBucketIndex](bucket, key);
         return V._check(dart.notNull(index) < 0 ? null : bucket[dart.notNull(index) + 1]);
       }
-      set(key, value) {
+      _set(key, value) {
         K._check(key);
         V._check(value);
         if (dart.test(collection._HashMap._isStringKey(key))) {
@@ -23048,9 +23373,9 @@
       putIfAbsent(key, ifAbsent) {
         K._check(key);
         VoidToV()._check(ifAbsent);
-        if (dart.test(this.containsKey(key))) return this.get(key);
+        if (dart.test(this.containsKey(key))) return this._get(key);
         let value = ifAbsent();
-        this.set(key, value);
+        this._set(key, value);
         return value;
       }
       remove(key) {
@@ -23082,7 +23407,7 @@
         let keys = this[_computeKeys]();
         for (let i = 0, length = keys[dartx.length]; i < dart.notNull(length); i++) {
           let key = keys[i];
-          action(K._check(key), this.get(key));
+          action(K._check(key), this._get(key));
           if (keys !== this[_keys]) {
             dart.throw(new core.ConcurrentModificationError(this));
           }
@@ -23220,9 +23545,9 @@
         [_containsKey]: dart.definiteFunctionType(core.bool, [core.Object]),
         containsValue: dart.definiteFunctionType(core.bool, [core.Object]),
         addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
-        get: dart.definiteFunctionType(V, [core.Object]),
+        _get: dart.definiteFunctionType(V, [core.Object]),
         [_get]: dart.definiteFunctionType(V, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         [_set]: dart.definiteFunctionType(dart.void, [K, V]),
         putIfAbsent: dart.definiteFunctionType(V, [K, VoidToV()]),
         remove: dart.definiteFunctionType(V, [core.Object]),
@@ -23251,8 +23576,8 @@
       'containsKey',
       'containsValue',
       'addAll',
-      'get',
-      'set',
+      '_get',
+      '_set',
       'putIfAbsent',
       'remove',
       'clear',
@@ -23299,11 +23624,11 @@
         this[_validKey] = validKey != null ? validKey : dart.fn(v => K.is(v), ObjectTobool());
         super.new();
       }
-      get(key) {
+      _get(key) {
         if (!dart.test(this[_validKey](key))) return null;
         return super[_get](key);
       }
-      set(key, value) {
+      _set(key, value) {
         K._check(key);
         V._check(value);
         super[_set](key, value);
@@ -23340,12 +23665,12 @@
         [_validKey]: _PredicateOfObject()
       }),
       methods: () => ({
-        get: dart.definiteFunctionType(V, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _get: dart.definiteFunctionType(V, [core.Object]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         remove: dart.definiteFunctionType(V, [core.Object])
       })
     });
-    dart.defineExtensionMembers(_CustomHashMap, ['get', 'set', 'containsKey', 'remove']);
+    dart.defineExtensionMembers(_CustomHashMap, ['_get', '_set', 'containsKey', 'remove']);
     return _CustomHashMap;
   });
   collection._CustomHashMap = _CustomHashMap();
@@ -23522,13 +23847,13 @@
       addAll(other) {
         MapOfK$V()._check(other);
         other[dartx.forEach](dart.fn((key, value) => {
-          this.set(key, value);
+          this._set(key, value);
         }, KAndVTovoid$()));
       }
-      get(key) {
+      _get(key) {
         return this[_map$0].get(key);
       }
-      set(key, value) {
+      _set(key, value) {
         K._check(key);
         V._check(value);
         this[_map$0].set(key, value);
@@ -23538,13 +23863,13 @@
       putIfAbsent(key, ifAbsent) {
         K._check(key);
         VoidToV()._check(ifAbsent);
-        if (dart.test(this.containsKey(key))) return this.get(key);
+        if (dart.test(this.containsKey(key))) return this._get(key);
         let value = ifAbsent();
-        this.set(key, value);
+        this._set(key, value);
         return value;
       }
       remove(key) {
-        let value = this.get(key);
+        let value = this._get(key);
         this[_map$0].delete(key);
         this[_modified$]();
         return value;
@@ -23589,8 +23914,8 @@
       }),
       methods: () => ({
         addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
-        get: dart.definiteFunctionType(V, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _get: dart.definiteFunctionType(V, [core.Object]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         putIfAbsent: dart.definiteFunctionType(V, [K, VoidToV()]),
         remove: dart.definiteFunctionType(V, [core.Object]),
         forEach: dart.definiteFunctionType(dart.void, [KAndVTovoid()]),
@@ -23601,8 +23926,8 @@
       'containsKey',
       'containsValue',
       'addAll',
-      'get',
-      'set',
+      '_get',
+      '_set',
       'putIfAbsent',
       'remove',
       'clear',
@@ -23748,11 +24073,11 @@
         this[_validKey] = validKey != null ? validKey : dart.fn(v => K.is(v), ObjectTobool());
         super.new();
       }
-      get(key) {
+      _get(key) {
         if (!dart.test(this[_validKey](key))) return null;
         return super.internalGet(key);
       }
-      set(key, value) {
+      _set(key, value) {
         K._check(key);
         V._check(value);
         super.internalSet(key, value);
@@ -23787,12 +24112,12 @@
         [_validKey]: _PredicateOfObject()
       }),
       methods: () => ({
-        get: dart.definiteFunctionType(V, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _get: dart.definiteFunctionType(V, [core.Object]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         remove: dart.definiteFunctionType(V, [core.Object])
       })
     });
-    dart.defineExtensionMembers(_LinkedCustomHashMap, ['get', 'set', 'containsKey', 'remove']);
+    dart.defineExtensionMembers(_LinkedCustomHashMap, ['_get', '_set', 'containsKey', 'remove']);
     return _LinkedCustomHashMap;
   });
   collection._LinkedCustomHashMap = _LinkedCustomHashMap();
@@ -23893,7 +24218,7 @@
         })() : ListOfE().new(this.length);
         let i = 0;
         for (let element of this)
-          result[dartx.set](i++, element);
+          result[dartx._set](i++, element);
         return result;
       }
       map(T) {
@@ -24229,7 +24554,7 @@
         let bucket = this[_getBucket$](rest, object);
         let index = this[_findBucketIndex](bucket, object);
         if (dart.notNull(index) < 0) return null;
-        return bucket[dartx.get](index);
+        return bucket[dartx._get](index);
       }
       add(element) {
         E._check(element);
@@ -24655,7 +24980,7 @@
         let bucket = this[_getBucket$](rest, object);
         let index = this[_findBucketIndex](bucket, object);
         if (dart.notNull(index) < 0) return null;
-        return bucket[dartx.get](index)[_element];
+        return bucket[dartx._get](index)[_element];
       }
       forEach(action) {
         let cell = this[_first$];
@@ -25087,7 +25412,7 @@
       set length(value) {
         super.length = value;
       }
-      get(index) {
+      _get(index) {
         return this[_source$0][dartx.elementAt](index);
       }
     }
@@ -25095,9 +25420,9 @@
       constructors: () => ({new: dart.definiteFunctionType(collection.UnmodifiableListView$(E), [IterableOfE()])}),
       fields: () => ({[_source$0]: IterableOfE()}),
       getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
-      methods: () => ({get: dart.definiteFunctionType(E, [core.int])})
+      methods: () => ({_get: dart.definiteFunctionType(E, [core.int])})
     });
-    dart.defineExtensionMembers(UnmodifiableListView, ['get', 'length']);
+    dart.defineExtensionMembers(UnmodifiableListView, ['_get', 'length']);
     return UnmodifiableListView;
   });
   collection.UnmodifiableListView = UnmodifiableListView();
@@ -25166,7 +25491,7 @@
       static from(other) {
         let result = HashMapOfK$V().new();
         other[dartx.forEach](dart.fn((k, v) => {
-          result.set(K.as(k), V.as(v));
+          result._set(K.as(k), V.as(v));
         }, dynamicAnddynamicTovoid$()));
         return result;
       }
@@ -25536,7 +25861,7 @@
   });
   collection._isToStringVisiting = function(o) {
     for (let i = 0; i < dart.notNull(collection._toStringVisiting[dartx.length]); i++) {
-      if (core.identical(o, collection._toStringVisiting[dartx.get](i))) return true;
+      if (core.identical(o, collection._toStringVisiting[dartx._get](i))) return true;
     }
     return false;
   };
@@ -25718,7 +26043,7 @@
       static from(other) {
         let result = LinkedHashMapOfK$V().new();
         other[dartx.forEach](dart.fn((k, v) => {
-          result.set(K.as(k), V.as(v));
+          result._set(K.as(k), V.as(v));
         }, dynamicAnddynamicTovoid$()));
         return result;
       }
@@ -26085,18 +26410,18 @@
     class MapMixin extends core.Object {
       forEach(action) {
         for (let key of this.keys) {
-          action(key, this.get(key));
+          action(key, this._get(key));
         }
       }
       addAll(other) {
         MapOfK$V()._check(other);
         for (let key of other[dartx.keys]) {
-          this.set(key, other[dartx.get](key));
+          this._set(key, other[dartx._get](key));
         }
       }
       containsValue(value) {
         for (let key of this.keys) {
-          if (dart.equals(this.get(key), value)) return true;
+          if (dart.equals(this._get(key), value)) return true;
         }
         return false;
       }
@@ -26104,9 +26429,9 @@
         K._check(key);
         VoidToV()._check(ifAbsent);
         if (dart.test(this.containsKey(key))) {
-          return this.get(key);
+          return this._get(key);
         }
-        return this.set(key, ifAbsent());
+        return this._set(key, ifAbsent());
       }
       containsKey(key) {
         return this.keys[dartx.contains](key);
@@ -26167,7 +26492,7 @@
     let MapOfK$V = () => (MapOfK$V = dart.constFn(core.Map$(K, V)))();
     let VoidToV = () => (VoidToV = dart.constFn(dart.functionType(V, [])))();
     class _UnmodifiableMapMixin extends core.Object {
-      set(key, value) {
+      _set(key, value) {
         K._check(key);
         V._check(value);
         dart.throw(new core.UnsupportedError("Cannot modify unmodifiable map"));
@@ -26193,7 +26518,7 @@
     _UnmodifiableMapMixin[dart.implements] = () => [MapOfK$V()];
     dart.setSignature(_UnmodifiableMapMixin, {
       methods: () => ({
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
         clear: dart.definiteFunctionType(dart.void, []),
         remove: dart.definiteFunctionType(V, [core.Object]),
@@ -26201,7 +26526,7 @@
       })
     });
     dart.defineExtensionMembers(_UnmodifiableMapMixin, [
-      'set',
+      '_set',
       'addAll',
       'clear',
       'remove',
@@ -26237,13 +26562,13 @@
         return this[_map$0][dartx.isNotEmpty];
       }
       get first() {
-        return this[_map$0][dartx.get](this[_map$0][dartx.keys][dartx.first]);
+        return this[_map$0][dartx._get](this[_map$0][dartx.keys][dartx.first]);
       }
       get single() {
-        return this[_map$0][dartx.get](this[_map$0][dartx.keys][dartx.single]);
+        return this[_map$0][dartx._get](this[_map$0][dartx.keys][dartx.single]);
       }
       get last() {
-        return this[_map$0][dartx.get](this[_map$0][dartx.keys][dartx.last]);
+        return this[_map$0][dartx._get](this[_map$0][dartx.keys][dartx.last]);
       }
       get iterator() {
         return new (_MapBaseValueIteratorOfK$V())(this[_map$0]);
@@ -26284,7 +26609,7 @@
       }
       moveNext() {
         if (dart.test(this[_keys].moveNext())) {
-          this[_current$2] = this[_map$0][dartx.get](this[_keys].current);
+          this[_current$2] = this[_map$0][dartx._get](this[_keys].current);
           return true;
         }
         this[_current$2] = null;
@@ -26317,13 +26642,13 @@
       new(map) {
         this[_map$0] = map;
       }
-      get(key) {
-        return this[_map$0][dartx.get](key);
+      _get(key) {
+        return this[_map$0][dartx._get](key);
       }
-      set(key, value) {
+      _set(key, value) {
         K._check(key);
         V._check(value);
-        this[_map$0][dartx.set](key, value);
+        this[_map$0][dartx._set](key, value);
         return value;
       }
       addAll(other) {
@@ -26382,8 +26707,8 @@
         values: dart.definiteFunctionType(core.Iterable$(V), [])
       }),
       methods: () => ({
-        get: dart.definiteFunctionType(V, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _get: dart.definiteFunctionType(V, [core.Object]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
         clear: dart.definiteFunctionType(dart.void, []),
         putIfAbsent: dart.definiteFunctionType(V, [K, VoidToV()]),
@@ -26394,8 +26719,8 @@
       })
     });
     dart.defineExtensionMembers(MapView, [
-      'get',
-      'set',
+      '_get',
+      '_set',
       'addAll',
       'clear',
       'putIfAbsent',
@@ -26440,10 +26765,10 @@
     }
     static putIfAbsent(map, key, ifAbsent) {
       if (dart.test(map[dartx.containsKey](key))) {
-        return map[dartx.get](key);
+        return map[dartx._get](key);
       }
       let v = ifAbsent();
-      map[dartx.set](key, v);
+      map[dartx._set](key, v);
       return v;
     }
     static clear(map) {
@@ -26453,11 +26778,11 @@
     }
     static forEach(map, f) {
       for (let k of map[dartx.keys]) {
-        dart.dcall(f, k, map[dartx.get](k));
+        dart.dcall(f, k, map[dartx._get](k));
       }
     }
     static getValues(map) {
-      return map[dartx.keys][dartx.map](dart.dynamic)(dart.fn(key => map[dartx.get](key), dynamicTodynamic$()));
+      return map[dartx.keys][dartx.map](dart.dynamic)(dart.fn(key => map[dartx._get](key), dynamicTodynamic$()));
     }
     static length(map) {
       return map[dartx.keys][dartx.length];
@@ -26500,7 +26825,7 @@
       if (key == null) key = collection.Maps._id;
       if (value == null) value = collection.Maps._id;
       for (let element of iterable) {
-        map[dartx.set](dart.dcall(key, element), dart.dcall(value, element));
+        map[dartx._set](dart.dcall(key, element), dart.dcall(value, element));
       }
     }
     static _fillMapWithIterables(map, keys, values) {
@@ -26509,7 +26834,7 @@
       let hasNextKey = keyIterator.moveNext();
       let hasNextValue = valueIterator.moveNext();
       while (dart.test(hasNextKey) && dart.test(hasNextValue)) {
-        map[dartx.set](keyIterator.current, valueIterator.current);
+        map[dartx._set](keyIterator.current, valueIterator.current);
         hasNextKey = keyIterator.moveNext();
         hasNextValue = valueIterator.moveNext();
       }
@@ -26640,7 +26965,6 @@
         return this[_nextLink];
       }
     }
-    dart.setBaseClass(_UserDoubleLinkedQueueEntry, collection._DoubleLink$(_UserDoubleLinkedQueueEntry));
     _UserDoubleLinkedQueueEntry[dart.implements] = () => [DoubleLinkedQueueEntryOfE()];
     dart.setSignature(_UserDoubleLinkedQueueEntry, {
       constructors: () => ({new: dart.definiteFunctionType(collection._UserDoubleLinkedQueueEntry$(E), [E])}),
@@ -26654,6 +26978,8 @@
       })
     });
     return _UserDoubleLinkedQueueEntry;
+  }, _UserDoubleLinkedQueueEntry => {
+    dart.setBaseClass(_UserDoubleLinkedQueueEntry, collection._DoubleLink$(_UserDoubleLinkedQueueEntry));
   });
   collection._UserDoubleLinkedQueueEntry = _UserDoubleLinkedQueueEntry();
   const _queue = Symbol('_queue');
@@ -26683,7 +27009,6 @@
         return this[_previousLink][_asNonSentinelEntry]();
       }
     }
-    dart.setBaseClass(_DoubleLinkedQueueEntry, collection._DoubleLink$(_DoubleLinkedQueueEntry));
     dart.setSignature(_DoubleLinkedQueueEntry, {
       constructors: () => ({new: dart.definiteFunctionType(collection._DoubleLinkedQueueEntry$(E), [DoubleLinkedQueueOfE()])}),
       fields: () => ({[_queue]: DoubleLinkedQueueOfE()}),
@@ -26695,6 +27020,8 @@
       })
     });
     return _DoubleLinkedQueueEntry;
+  }, _DoubleLinkedQueueEntry => {
+    dart.setBaseClass(_DoubleLinkedQueueEntry, collection._DoubleLink$(_DoubleLinkedQueueEntry));
   });
   collection._DoubleLinkedQueueEntry = _DoubleLinkedQueueEntry();
   const _elementCount = Symbol('_elementCount');
@@ -26783,7 +27110,6 @@
   });
   collection._DoubleLinkedQueueSentinel = _DoubleLinkedQueueSentinel();
   const _sentinel = Symbol('_sentinel');
-  const _filter = Symbol('_filter');
   collection.DoubleLinkedQueue$ = dart.generic(E => {
     let _DoubleLinkedQueueSentinelOfE = () => (_DoubleLinkedQueueSentinelOfE = dart.constFn(collection._DoubleLinkedQueueSentinel$(E)))();
     let DoubleLinkedQueueOfE = () => (DoubleLinkedQueueOfE = dart.constFn(collection.DoubleLinkedQueue$(E)))();
@@ -27048,7 +27374,7 @@
           let queue = new (ListQueueOfE())(dart.notNull(length) + 1);
           dart.assert(dart.notNull(queue[_table][dartx.length]) > dart.notNull(length));
           for (let i = 0; i < dart.notNull(length); i++) {
-            queue[_table][dartx.set](i, E.as(elements[dartx.get](i)));
+            queue[_table][dartx._set](i, E.as(elements[dartx._get](i)));
           }
           queue[_tail] = length;
           return queue;
@@ -27070,7 +27396,7 @@
       forEach(action) {
         let modificationCount = this[_modificationCount];
         for (let i = this[_head]; i != this[_tail]; i = (dart.notNull(i) + 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0) {
-          action(this[_table][dartx.get](i));
+          action(this[_table][dartx._get](i));
           this[_checkModification](modificationCount);
         }
       }
@@ -27082,20 +27408,20 @@
       }
       get first() {
         if (this[_head] == this[_tail]) dart.throw(_internal.IterableElementError.noElement());
-        return this[_table][dartx.get](this[_head]);
+        return this[_table][dartx._get](this[_head]);
       }
       get last() {
         if (this[_head] == this[_tail]) dart.throw(_internal.IterableElementError.noElement());
-        return this[_table][dartx.get]((dart.notNull(this[_tail]) - 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0);
+        return this[_table][dartx._get]((dart.notNull(this[_tail]) - 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0);
       }
       get single() {
         if (this[_head] == this[_tail]) dart.throw(_internal.IterableElementError.noElement());
         if (dart.notNull(this.length) > 1) dart.throw(_internal.IterableElementError.tooMany());
-        return this[_table][dartx.get](this[_head]);
+        return this[_table][dartx._get](this[_head]);
       }
       elementAt(index) {
         core.RangeError.checkValidIndex(index, this);
-        return this[_table][dartx.get]((dart.notNull(this[_head]) + dart.notNull(index) & dart.notNull(this[_table][dartx.length]) - 1) >>> 0);
+        return this[_table][dartx._get]((dart.notNull(this[_head]) + dart.notNull(index) & dart.notNull(this[_table][dartx.length]) - 1) >>> 0);
       }
       toList(opts) {
         let growable = opts && 'growable' in opts ? opts.growable : true;
@@ -27143,7 +27469,7 @@
       }
       remove(value) {
         for (let i = this[_head]; i != this[_tail]; i = (dart.notNull(i) + 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0) {
-          let element = this[_table][dartx.get](i);
+          let element = this[_table][dartx._get](i);
           if (dart.equals(element, value)) {
             this[_remove](i);
             this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
@@ -27156,7 +27482,7 @@
         let modificationCount = this[_modificationCount];
         let i = this[_head];
         while (i != this[_tail]) {
-          let element = this[_table][dartx.get](i);
+          let element = this[_table][dartx._get](i);
           let remove = core.identical(removeMatching, test(element));
           this[_checkModification](modificationCount);
           if (remove) {
@@ -27176,7 +27502,7 @@
       clear() {
         if (this[_head] != this[_tail]) {
           for (let i = this[_head]; i != this[_tail]; i = (dart.notNull(i) + 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0) {
-            this[_table][dartx.set](i, null);
+            this[_table][dartx._set](i, null);
           }
           this[_head] = this[_tail] = 0;
           this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
@@ -27192,15 +27518,15 @@
       addFirst(value) {
         E._check(value);
         this[_head] = (dart.notNull(this[_head]) - 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0;
-        this[_table][dartx.set](this[_head], value);
+        this[_table][dartx._set](this[_head], value);
         if (this[_head] == this[_tail]) this[_grow]();
         this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
       }
       removeFirst() {
         if (this[_head] == this[_tail]) dart.throw(_internal.IterableElementError.noElement());
         this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
-        let result = this[_table][dartx.get](this[_head]);
-        this[_table][dartx.set](this[_head], null);
+        let result = this[_table][dartx._get](this[_head]);
+        this[_table][dartx._set](this[_head], null);
         this[_head] = (dart.notNull(this[_head]) + 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0;
         return result;
       }
@@ -27208,8 +27534,8 @@
         if (this[_head] == this[_tail]) dart.throw(_internal.IterableElementError.noElement());
         this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
         this[_tail] = (dart.notNull(this[_tail]) - 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0;
-        let result = this[_table][dartx.get](this[_tail]);
-        this[_table][dartx.set](this[_tail], null);
+        let result = this[_table][dartx._get](this[_tail]);
+        this[_table][dartx._set](this[_tail], null);
         return result;
       }
       static _isPowerOf2(number) {
@@ -27231,7 +27557,7 @@
       }
       [_add$0](element) {
         E._check(element);
-        this[_table][dartx.set](this[_tail], element);
+        this[_table][dartx._set](this[_tail], element);
         this[_tail] = (dart.notNull(this[_tail]) + 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0;
         if (this[_head] == this[_tail]) this[_grow]();
         this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
@@ -27244,10 +27570,10 @@
           let i = offset;
           while (i != this[_head]) {
             let prevOffset = (dart.notNull(i) - 1 & mask) >>> 0;
-            this[_table][dartx.set](i, this[_table][dartx.get](prevOffset));
+            this[_table][dartx._set](i, this[_table][dartx._get](prevOffset));
             i = prevOffset;
           }
-          this[_table][dartx.set](this[_head], null);
+          this[_table][dartx._set](this[_head], null);
           this[_head] = (dart.notNull(this[_head]) + 1 & mask) >>> 0;
           return (dart.notNull(offset) + 1 & mask) >>> 0;
         } else {
@@ -27255,10 +27581,10 @@
           let i = offset;
           while (i != this[_tail]) {
             let nextOffset = (dart.notNull(i) + 1 & mask) >>> 0;
-            this[_table][dartx.set](i, this[_table][dartx.get](nextOffset));
+            this[_table][dartx._set](i, this[_table][dartx._get](nextOffset));
             i = nextOffset;
           }
-          this[_table][dartx.set](this[_tail], null);
+          this[_table][dartx._set](this[_tail], null);
           return offset;
         }
       }
@@ -27380,7 +27706,7 @@
           this[_current$2] = null;
           return false;
         }
-        this[_current$2] = this[_queue][_table][dartx.get](this[_position]);
+        this[_current$2] = this[_queue][_table][dartx._get](this[_position]);
         this[_position] = (dart.notNull(this[_position]) + 1 & dart.notNull(this[_queue][_table][dartx.length]) - 1) >>> 0;
         return true;
       }
@@ -27655,7 +27981,7 @@
         if (isValidKey === void 0) isValidKey = null;
         let result = new (SplayTreeMapOfK$V())(compare, isValidKey);
         other[dartx.forEach](dart.fn((k, v) => {
-          result.set(K.as(k), V.as(v));
+          result._set(K.as(k), V.as(v));
         }, dynamicAnddynamicTovoid$()));
         return result;
       }
@@ -27687,7 +28013,7 @@
         this[_validKey] = null;
         super.new();
       }
-      get(key) {
+      _get(key) {
         if (!dart.test(dart.dcall(this[_validKey], key))) return null;
         if (this[_root] != null) {
           let comp = this[_splay](K.as(key));
@@ -27703,7 +28029,7 @@
         if (mapRoot != null) return mapRoot.value;
         return null;
       }
-      set(key, value) {
+      _set(key, value) {
         (() => {
           K._check(key);
           V._check(value);
@@ -27741,7 +28067,7 @@
       addAll(other) {
         MapOfK$V()._check(other);
         other[dartx.forEach](dart.fn((key, value) => {
-          this.set(key, value);
+          this._set(key, value);
         }, KAndVTovoid$()));
       }
       get isEmpty() {
@@ -27852,9 +28178,9 @@
       }),
       methods: () => ({
         [_compare]: dart.definiteFunctionType(core.int, [K, K]),
-        get: dart.definiteFunctionType(V, [core.Object]),
+        _get: dart.definiteFunctionType(V, [core.Object]),
         remove: dart.definiteFunctionType(V, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         putIfAbsent: dart.definiteFunctionType(V, [K, VoidToV()]),
         addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
         forEach: dart.definiteFunctionType(dart.void, [KAndVTovoid()]),
@@ -27868,9 +28194,9 @@
       })
     });
     dart.defineExtensionMembers(SplayTreeMap, [
-      'get',
+      '_get',
       'remove',
-      'set',
+      '_set',
       'putIfAbsent',
       'addAll',
       'forEach',
@@ -28290,14 +28616,12 @@
       }),
       getters: () => ({
         iterator: dart.definiteFunctionType(core.Iterator$(E), []),
-        length: dart.definiteFunctionType(core.int, []),
         first: dart.definiteFunctionType(E, []),
         last: dart.definiteFunctionType(E, []),
         single: dart.definiteFunctionType(E, [])
       }),
       methods: () => ({
         [_compare]: dart.definiteFunctionType(core.int, [E, E]),
-        contains: dart.definiteFunctionType(core.bool, [core.Object]),
         add: dart.definiteFunctionType(core.bool, [E]),
         remove: dart.definiteFunctionType(core.bool, [core.Object]),
         addAll: dart.definiteFunctionType(dart.void, [IterableOfE()]),
@@ -28345,7 +28669,7 @@
       let processed = map[_processed];
       let keys = map[_computeKeys$]();
       for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-        let key = keys[dartx.get](i);
+        let key = keys[dartx._get](i);
         let revived = dart.dcall(reviver, key, walk(e[key]));
         processed[key] = revived;
       }
@@ -28382,9 +28706,9 @@
       this[_original] = original;
       this[_data] = null;
     }
-    get(key) {
+    _get(key) {
       if (dart.test(this[_isUpgraded])) {
-        return this[_upgradedMap][dartx.get](key);
+        return this[_upgradedMap][dartx._get](key);
       } else if (!(typeof key == 'string')) {
         return null;
       } else {
@@ -28408,11 +28732,11 @@
     }
     get values() {
       if (dart.test(this[_isUpgraded])) return this[_upgradedMap][dartx.values];
-      return MappedIterableOfString$dynamic().new(this[_computeKeys$](), dart.fn(each => this.get(each), dynamicTodynamic$()));
+      return MappedIterableOfString$dynamic().new(this[_computeKeys$](), dart.fn(each => this._get(each), dynamicTodynamic$()));
     }
-    set(key, value) {
+    _set(key, value) {
       if (dart.test(this[_isUpgraded])) {
-        this[_upgradedMap][dartx.set](key, value);
+        this[_upgradedMap][dartx._set](key, value);
       } else if (dart.test(this.containsKey(key))) {
         let processed = this[_processed];
         convert._JsonMap._setProperty(processed, core.String._check(key), value);
@@ -28421,21 +28745,21 @@
           convert._JsonMap._setProperty(original, core.String._check(key), null);
         }
       } else {
-        this[_upgrade]()[dartx.set](key, value);
+        this[_upgrade]()[dartx._set](key, value);
       }
       return value;
     }
     addAll(other) {
       other[dartx.forEach](dart.fn((key, value) => {
-        this.set(key, value);
+        this._set(key, value);
       }, dynamicAnddynamicTovoid$()));
     }
     containsValue(value) {
       if (dart.test(this[_isUpgraded])) return this[_upgradedMap][dartx.containsValue](value);
       let keys = this[_computeKeys$]();
       for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-        let key = keys[dartx.get](i);
-        if (dart.equals(this.get(key), value)) return true;
+        let key = keys[dartx._get](i);
+        if (dart.equals(this._get(key), value)) return true;
       }
       return false;
     }
@@ -28445,9 +28769,9 @@
       return convert._JsonMap._hasProperty(this[_original], core.String._check(key));
     }
     putIfAbsent(key, ifAbsent) {
-      if (dart.test(this.containsKey(key))) return this.get(key);
+      if (dart.test(this.containsKey(key))) return this._get(key);
       let value = ifAbsent();
-      this.set(key, value);
+      this._set(key, value);
       return value;
     }
     remove(key) {
@@ -28469,7 +28793,7 @@
       if (dart.test(this[_isUpgraded])) return this[_upgradedMap][dartx.forEach](f);
       let keys = this[_computeKeys$]();
       for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-        let key = keys[dartx.get](i);
+        let key = keys[dartx._get](i);
         let value = convert._JsonMap._getProperty(this[_processed], key);
         if (dart.test(convert._JsonMap._isUnprocessed(value))) {
           value = convert._convertJsonToDartLazy(convert._JsonMap._getProperty(this[_original], key));
@@ -28504,8 +28828,8 @@
       let result = dart.map();
       let keys = this[_computeKeys$]();
       for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-        let key = keys[dartx.get](i);
-        result[dartx.set](key, this.get(key));
+        let key = keys[dartx._get](i);
+        result[dartx._set](key, this._get(key));
       }
       if (dart.test(keys[dartx.isEmpty])) {
         keys[dartx.add](null);
@@ -28559,8 +28883,8 @@
       [_upgradedMap]: dart.definiteFunctionType(core.Map, [])
     }),
     methods: () => ({
-      get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
-      set: dart.definiteFunctionType(dart.void, [dart.dynamic, dart.dynamic]),
+      _get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
+      _set: dart.definiteFunctionType(dart.void, [dart.dynamic, dart.dynamic]),
       addAll: dart.definiteFunctionType(dart.void, [core.Map]),
       containsValue: dart.definiteFunctionType(core.bool, [core.Object]),
       containsKey: dart.definiteFunctionType(core.bool, [core.Object]),
@@ -28583,8 +28907,8 @@
     names: ['_hasProperty', '_getProperty', '_setProperty', '_getPropertyNames', '_isUnprocessed', '_newJavaScriptObject']
   });
   dart.defineExtensionMembers(convert._JsonMap, [
-    'get',
-    'set',
+    '_get',
+    '_set',
     'addAll',
     'containsValue',
     'containsKey',
@@ -28608,7 +28932,7 @@
       return this[_parent].length;
     }
     elementAt(index) {
-      return core.String._check(dart.test(this[_parent][_isUpgraded]) ? this[_parent].keys[dartx.elementAt](index) : this[_parent][_computeKeys$]()[dartx.get](index));
+      return core.String._check(dart.test(this[_parent][_isUpgraded]) ? this[_parent].keys[dartx.elementAt](index) : this[_parent][_computeKeys$]()[dartx._get](index));
     }
     get iterator() {
       return dart.test(this[_parent][_isUpgraded]) ? this[_parent].keys[dartx.iterator] : this[_parent][_computeKeys$]()[dartx.iterator];
@@ -28711,9 +29035,7 @@
   let const$28;
   let const$29;
   convert.Codec$ = dart.generic((S, T) => {
-    let _FusedCodecOfS$T$dynamic = () => (_FusedCodecOfS$T$dynamic = dart.constFn(convert._FusedCodec$(S, T, dart.dynamic)))();
     let _InvertedCodecOfT$S = () => (_InvertedCodecOfT$S = dart.constFn(convert._InvertedCodec$(T, S)))();
-    let CodecOfT$dynamic = () => (CodecOfT$dynamic = dart.constFn(convert.Codec$(T, dart.dynamic)))();
     class Codec extends core.Object {
       new() {
       }
@@ -28725,9 +29047,11 @@
         T._check(encoded);
         return this.decoder.convert(encoded);
       }
-      fuse(other) {
-        CodecOfT$dynamic()._check(other);
-        return new (_FusedCodecOfS$T$dynamic())(this, other);
+      fuse(R) {
+        return other => {
+          convert.Codec$(T, R)._check(other);
+          return new (convert._FusedCodec$(S, T, R))(this, other);
+        };
       }
       get inverted() {
         return new (_InvertedCodecOfT$S())(this);
@@ -28740,7 +29064,7 @@
       methods: () => ({
         encode: dart.definiteFunctionType(T, [S]),
         decode: dart.definiteFunctionType(S, [T]),
-        fuse: dart.definiteFunctionType(convert.Codec$(S, dart.dynamic), [CodecOfT$dynamic()])
+        fuse: dart.definiteFunctionType(R => [convert.Codec$(S, R), [convert.Codec$(T, R)]])
       })
     });
     return Codec;
@@ -28852,7 +29176,7 @@
         let result = ListOfE().new(length);
         if (length != 0 && fill != null) {
           for (let i = 0; i < dart.notNull(result[dartx.length]); i++) {
-            result[dartx.set](i, fill);
+            result[dartx._set](i, fill);
           }
         }
         return result;
@@ -28876,7 +29200,7 @@
           result = ListOfE().new(length);
         }
         for (let i = 0; i < dart.notNull(length); i++) {
-          result[dartx.set](i, generator(i));
+          result[dartx._set](i, generator(i));
         }
         return result;
       }
@@ -28915,7 +29239,7 @@
     static getByName(name) {
       if (name == null) return null;
       name = name[dartx.toLowerCase]();
-      return convert.Encoding._nameToEncoding[dartx.get](name);
+      return convert.Encoding._nameToEncoding[dartx._get](name);
     }
   };
   dart.addSimpleTypeTests(convert.Encoding);
@@ -29026,7 +29350,7 @@
         if ((dart.notNull(codeUnit) & ~dart.notNull(this[_subsetMask])) != 0) {
           dart.throw(new core.ArgumentError("String contains invalid characters."));
         }
-        result[dartx.set](i, codeUnit);
+        result[dartx._set](i, codeUnit);
       }
       return result;
     }
@@ -29105,7 +29429,7 @@
       core.RangeError.checkValidRange(start, end, byteCount);
       if (end == null) end = byteCount;
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        let byte = bytes[dartx.get](i);
+        let byte = bytes[dartx._get](i);
         if ((dart.notNull(byte) & ~dart.notNull(this[_subsetMask])) != 0) {
           if (!dart.test(this[_allowInvalid])) {
             dart.throw(new core.FormatException(dart.str`Invalid value in input: ${byte}`));
@@ -29118,7 +29442,7 @@
     [_convertInvalid](bytes, start, end) {
       let buffer = new core.StringBuffer();
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        let value = bytes[dartx.get](i);
+        let value = bytes[dartx._get](i);
         if ((dart.notNull(value) & ~dart.notNull(this[_subsetMask])) != 0) value = 65533;
         buffer.writeCharCode(value);
       }
@@ -29234,7 +29558,7 @@
     addSlice(source, start, end, isLast) {
       core.RangeError.checkValidRange(start, end, source[dartx.length]);
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        if ((dart.notNull(source[dartx.get](i)) & ~convert._ASCII_MASK) != 0) {
+        if ((dart.notNull(source[dartx._get](i)) & ~convert._ASCII_MASK) != 0) {
           if (dart.notNull(i) > dart.notNull(start)) this[_utf8Sink].addSlice(source, start, i, false);
           this[_utf8Sink].add(const$30 || (const$30 = dart.constList([239, 191, 189], core.int)));
           start = dart.notNull(i) + 1;
@@ -29265,7 +29589,7 @@
     }
     add(source) {
       for (let i = 0; i < dart.notNull(source[dartx.length]); i++) {
-        if ((dart.notNull(source[dartx.get](i)) & ~convert._ASCII_MASK) != 0) {
+        if ((dart.notNull(source[dartx._get](i)) & ~convert._ASCII_MASK) != 0) {
           dart.throw(new core.FormatException("Source contains non-ASCII bytes."));
         }
       }
@@ -29406,27 +29730,27 @@
       let expectedChars = 3 - dart.notNull(convert._Base64Encoder._stateCount(state));
       let byteOr = 0;
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        let byte = bytes[dartx.get](i);
+        let byte = bytes[dartx._get](i);
         byteOr = (dart.notNull(byteOr) | dart.notNull(byte)) >>> 0;
         bits = (dart.notNull(bits) << 8 | dart.notNull(byte)) & 16777215;
         expectedChars--;
         if (expectedChars == 0) {
-          output[dartx.set]((() => {
+          output[dartx._set]((() => {
             let x = outputIndex;
             outputIndex = dart.notNull(x) + 1;
             return x;
           })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 18 & convert._Base64Encoder._sixBitMask));
-          output[dartx.set]((() => {
+          output[dartx._set]((() => {
             let x = outputIndex;
             outputIndex = dart.notNull(x) + 1;
             return x;
           })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 12 & convert._Base64Encoder._sixBitMask));
-          output[dartx.set]((() => {
+          output[dartx._set]((() => {
             let x = outputIndex;
             outputIndex = dart.notNull(x) + 1;
             return x;
           })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 6 & convert._Base64Encoder._sixBitMask));
-          output[dartx.set]((() => {
+          output[dartx._set]((() => {
             let x = outputIndex;
             outputIndex = dart.notNull(x) + 1;
             return x;
@@ -29444,53 +29768,53 @@
       }
       let i = start;
       while (dart.notNull(i) < dart.notNull(end)) {
-        let byte = bytes[dartx.get](i);
+        let byte = bytes[dartx._get](i);
         if (dart.notNull(byte) < 0 || dart.notNull(byte) > 255) break;
         i = dart.notNull(i) + 1;
       }
-      dart.throw(new core.ArgumentError.value(bytes, dart.str`Not a byte value at index ${i}: 0x${bytes[dartx.get](i)[dartx.toRadixString](16)}`));
+      dart.throw(new core.ArgumentError.value(bytes, dart.str`Not a byte value at index ${i}: 0x${bytes[dartx._get](i)[dartx.toRadixString](16)}`));
     }
     static writeFinalChunk(alphabet, output, outputIndex, count, bits) {
       dart.assert(dart.notNull(count) > 0);
       if (count == 1) {
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 2 & convert._Base64Encoder._sixBitMask));
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) << 4 & convert._Base64Encoder._sixBitMask));
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), convert._paddingChar);
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), convert._paddingChar);
       } else {
         dart.assert(count == 2);
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 10 & convert._Base64Encoder._sixBitMask));
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 4 & convert._Base64Encoder._sixBitMask));
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) << 2 & convert._Base64Encoder._sixBitMask));
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
@@ -29702,23 +30026,23 @@
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
         let char = input[dartx.codeUnitAt](i);
         charOr = (dart.notNull(charOr) | dart.notNull(char)) >>> 0;
-        let code = convert._Base64Decoder._inverseAlphabet[dartx.get]((dart.notNull(char) & asciiMask) >>> 0);
+        let code = convert._Base64Decoder._inverseAlphabet[dartx._get]((dart.notNull(char) & asciiMask) >>> 0);
         if (dart.notNull(code) >= 0) {
           bits = (bits[dartx['<<']](bitsPerCharacter) | dart.notNull(code)) & 16777215;
           count = dart.notNull(count) + 1 & 3;
           if (count == 0) {
             dart.assert(dart.notNull(outIndex) + 3 <= dart.notNull(output[dartx.length]));
-            output[dartx.set]((() => {
+            output[dartx._set]((() => {
               let x = outIndex;
               outIndex = dart.notNull(x) + 1;
               return x;
             })(), (bits[dartx['>>']](16) & eightBitMask) >>> 0);
-            output[dartx.set]((() => {
+            output[dartx._set]((() => {
               let x = outIndex;
               outIndex = dart.notNull(x) + 1;
               return x;
             })(), (bits[dartx['>>']](8) & eightBitMask) >>> 0);
-            output[dartx.set]((() => {
+            output[dartx._set]((() => {
               let x = outIndex;
               outIndex = dart.notNull(x) + 1;
               return x;
@@ -29732,12 +30056,12 @@
             if ((dart.notNull(bits) & 3) != 0) {
               dart.throw(new core.FormatException("Invalid encoding before padding", input, i));
             }
-            output[dartx.set]((() => {
+            output[dartx._set]((() => {
               let x = outIndex;
               outIndex = dart.notNull(x) + 1;
               return x;
             })(), bits[dartx['>>']](10));
-            output[dartx.set]((() => {
+            output[dartx._set]((() => {
               let x = outIndex;
               outIndex = dart.notNull(x) + 1;
               return x;
@@ -29746,7 +30070,7 @@
             if ((dart.notNull(bits) & 15) != 0) {
               dart.throw(new core.FormatException("Invalid encoding before padding", input, i));
             }
-            output[dartx.set]((() => {
+            output[dartx._set]((() => {
               let x = outIndex;
               outIndex = dart.notNull(x) + 1;
               return x;
@@ -30298,7 +30622,7 @@
     [_convert](text, start, end) {
       let result = null;
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        let ch = text[dartx.get](i);
+        let ch = text[dartx._get](i);
         let replacement = null;
         switch (ch) {
           case '&':
@@ -30570,14 +30894,14 @@
       }
       dart.fn(addChunk, Uint8ListAndintAndintTovoid$());
       convert._JsonUtf8Stringifier.stringify(object, this[_indent], this[_toEncodable], this[_bufferSize], addChunk);
-      if (bytes[dartx.length] == 1) return bytes[dartx.get](0);
+      if (bytes[dartx.length] == 1) return bytes[dartx._get](0);
       let length = 0;
       for (let i = 0; i < dart.notNull(bytes[dartx.length]); i++) {
-        length = dart.notNull(length) + dart.notNull(bytes[dartx.get](i)[dartx.length]);
+        length = dart.notNull(length) + dart.notNull(bytes[dartx._get](i)[dartx.length]);
       }
       let result = typed_data.Uint8List.new(length);
       for (let i = 0, offset = 0; i < dart.notNull(bytes[dartx.length]); i++) {
-        let byteList = bytes[dartx.get](i);
+        let byteList = bytes[dartx._get](i);
         let end = offset + dart.notNull(byteList[dartx.length]);
         result[dartx.setRange](offset, end, byteList);
         offset = end;
@@ -30814,7 +31138,7 @@
     }
     [_checkCycle](object) {
       for (let i = 0; i < dart.notNull(this[_seen][dartx.length]); i++) {
-        if (core.identical(object, this[_seen][dartx.get](i))) {
+        if (core.identical(object, this[_seen][dartx._get](i))) {
           dart.throw(new convert.JsonCyclicError(object));
         }
       }
@@ -30875,10 +31199,10 @@
     writeList(list) {
       this.writeString('[');
       if (dart.notNull(list[dartx.length]) > 0) {
-        this.writeObject(list[dartx.get](0));
+        this.writeObject(list[dartx._get](0));
         for (let i = 1; i < dart.notNull(list[dartx.length]); i++) {
           this.writeString(',');
-          this.writeObject(list[dartx.get](i));
+          this.writeObject(list[dartx._get](i));
         }
       }
       this.writeString(']');
@@ -30895,8 +31219,8 @@
         if (!(typeof key == 'string')) {
           allStringKeys = false;
         }
-        keyValueList[dartx.set](i++, key);
-        keyValueList[dartx.set](i++, value);
+        keyValueList[dartx._set](i++, key);
+        keyValueList[dartx._set](i++, value);
       }, dynamicAnddynamicTovoid$()));
       if (!allStringKeys) return false;
       this.writeString('{');
@@ -30904,9 +31228,9 @@
       for (let i = 0; i < dart.notNull(keyValueList[dartx.length]); i = i + 2) {
         this.writeString(separator);
         separator = ',"';
-        this.writeStringContent(core.String._check(keyValueList[dartx.get](i)));
+        this.writeStringContent(core.String._check(keyValueList[dartx._get](i)));
         this.writeString('":');
-        this.writeObject(keyValueList[dartx.get](i + 1));
+        this.writeObject(keyValueList[dartx._get](i + 1));
       }
       this.writeString('}');
       return true;
@@ -30972,11 +31296,11 @@
         this.writeString('[\n');
         this[_indentLevel] = dart.notNull(this[_indentLevel]) + 1;
         this.writeIndentation(this[_indentLevel]);
-        this.writeObject(list[dartx.get](0));
+        this.writeObject(list[dartx._get](0));
         for (let i = 1; i < dart.notNull(list[dartx.length]); i++) {
           this.writeString(',\n');
           this.writeIndentation(this[_indentLevel]);
-          this.writeObject(list[dartx.get](i));
+          this.writeObject(list[dartx._get](i));
         }
         this.writeString('\n');
         this[_indentLevel] = dart.notNull(this[_indentLevel]) - 1;
@@ -30996,8 +31320,8 @@
         if (!(typeof key == 'string')) {
           allStringKeys = false;
         }
-        keyValueList[dartx.set](i++, key);
-        keyValueList[dartx.set](i++, value);
+        keyValueList[dartx._set](i++, key);
+        keyValueList[dartx._set](i++, value);
       }, dynamicAnddynamicTovoid$()));
       if (!allStringKeys) return false;
       this.writeString('{\n');
@@ -31008,9 +31332,9 @@
         separator = ",\n";
         this.writeIndentation(this[_indentLevel]);
         this.writeString('"');
-        this.writeStringContent(core.String._check(keyValueList[dartx.get](i)));
+        this.writeStringContent(core.String._check(keyValueList[dartx._get](i)));
         this.writeString('": ');
-        this.writeObject(keyValueList[dartx.get](i + 1));
+        this.writeObject(keyValueList[dartx._get](i + 1));
       }
       this.writeString('\n');
       this[_indentLevel] = dart.notNull(this[_indentLevel]) - 1;
@@ -31182,7 +31506,7 @@
         this.buffer = typed_data.Uint8List.new(this.bufferSize);
         this.index = 0;
       }
-      this.buffer[dartx.set]((() => {
+      this.buffer[dartx._set]((() => {
         let x = this.index;
         this.index = dart.notNull(x) + 1;
         return x;
@@ -31220,7 +31544,7 @@
       let indent = this.indent;
       let indentLength = indent[dartx.length];
       if (indentLength == 1) {
-        let char = indent[dartx.get](0);
+        let char = indent[dartx._get](0);
         while (dart.notNull(count) > 0) {
           this.writeByte(char);
           count = dart.notNull(count) - 1;
@@ -31235,7 +31559,7 @@
           this.index = end;
         } else {
           for (let i = 0; i < dart.notNull(indentLength); i++) {
-            this.writeByte(indent[dartx.get](i));
+            this.writeByte(indent[dartx._get](i));
           }
         }
       }
@@ -31344,7 +31668,7 @@
     static _checkValidLatin1(source, start, end) {
       let mask = 0;
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        mask = (dart.notNull(mask) | dart.notNull(source[dartx.get](i))) >>> 0;
+        mask = (dart.notNull(mask) | dart.notNull(source[dartx._get](i))) >>> 0;
       }
       if (dart.notNull(mask) >= 0 && dart.notNull(mask) <= convert._LATIN1_MASK) {
         return;
@@ -31353,7 +31677,7 @@
     }
     static _reportInvalidLatin1(source, start, end) {
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        let char = source[dartx.get](i);
+        let char = source[dartx._get](i);
         if (dart.notNull(char) < 0 || dart.notNull(char) > convert._LATIN1_MASK) {
           dart.throw(new core.FormatException("Source contains non-Latin-1 characters.", source, i));
         }
@@ -31383,7 +31707,7 @@
     addSlice(source, start, end, isLast) {
       core.RangeError.checkValidRange(start, end, source[dartx.length]);
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        let char = source[dartx.get](i);
+        let char = source[dartx._get](i);
         if (dart.notNull(char) > convert._LATIN1_MASK || dart.notNull(char) < 0) {
           if (dart.notNull(i) > dart.notNull(start)) this[_addSliceToSink](source, start, i, false);
           this[_addSliceToSink](const$49 || (const$49 = dart.constList([65533], core.int)), 0, 1, false);
@@ -31923,39 +32247,39 @@
         let rune = convert._combineSurrogatePair(leadingSurrogate, nextCodeUnit);
         dart.assert(dart.notNull(rune) > convert._THREE_BYTE_LIMIT);
         dart.assert(dart.notNull(rune) <= convert._FOUR_BYTE_LIMIT);
-        this[_buffer][dartx.set]((() => {
+        this[_buffer][dartx._set]((() => {
           let x = this[_bufferIndex];
           this[_bufferIndex] = dart.notNull(x) + 1;
           return x;
         })(), (240 | rune[dartx['>>']](18)) >>> 0);
-        this[_buffer][dartx.set]((() => {
+        this[_buffer][dartx._set]((() => {
           let x = this[_bufferIndex];
           this[_bufferIndex] = dart.notNull(x) + 1;
           return x;
         })(), 128 | dart.notNull(rune) >> 12 & 63);
-        this[_buffer][dartx.set]((() => {
+        this[_buffer][dartx._set]((() => {
           let x = this[_bufferIndex];
           this[_bufferIndex] = dart.notNull(x) + 1;
           return x;
         })(), 128 | dart.notNull(rune) >> 6 & 63);
-        this[_buffer][dartx.set]((() => {
+        this[_buffer][dartx._set]((() => {
           let x = this[_bufferIndex];
           this[_bufferIndex] = dart.notNull(x) + 1;
           return x;
         })(), 128 | dart.notNull(rune) & 63);
         return true;
       } else {
-        this[_buffer][dartx.set]((() => {
+        this[_buffer][dartx._set]((() => {
           let x = this[_bufferIndex];
           this[_bufferIndex] = dart.notNull(x) + 1;
           return x;
         })(), (224 | leadingSurrogate[dartx['>>']](12)) >>> 0);
-        this[_buffer][dartx.set]((() => {
+        this[_buffer][dartx._set]((() => {
           let x = this[_bufferIndex];
           this[_bufferIndex] = dart.notNull(x) + 1;
           return x;
         })(), 128 | dart.notNull(leadingSurrogate) >> 6 & 63);
-        this[_buffer][dartx.set]((() => {
+        this[_buffer][dartx._set]((() => {
           let x = this[_bufferIndex];
           this[_bufferIndex] = dart.notNull(x) + 1;
           return x;
@@ -31972,7 +32296,7 @@
         let codeUnit = str[dartx.codeUnitAt](stringIndex);
         if (dart.notNull(codeUnit) <= convert._ONE_BYTE_LIMIT) {
           if (dart.notNull(this[_bufferIndex]) >= dart.notNull(this[_buffer][dartx.length])) break;
-          this[_buffer][dartx.set]((() => {
+          this[_buffer][dartx._set]((() => {
             let x = this[_bufferIndex];
             this[_bufferIndex] = dart.notNull(x) + 1;
             return x;
@@ -31988,12 +32312,12 @@
           let rune = codeUnit;
           if (dart.notNull(rune) <= convert._TWO_BYTE_LIMIT) {
             if (dart.notNull(this[_bufferIndex]) + 1 >= dart.notNull(this[_buffer][dartx.length])) break;
-            this[_buffer][dartx.set]((() => {
+            this[_buffer][dartx._set]((() => {
               let x = this[_bufferIndex];
               this[_bufferIndex] = dart.notNull(x) + 1;
               return x;
             })(), (192 | rune[dartx['>>']](6)) >>> 0);
-            this[_buffer][dartx.set]((() => {
+            this[_buffer][dartx._set]((() => {
               let x = this[_bufferIndex];
               this[_bufferIndex] = dart.notNull(x) + 1;
               return x;
@@ -32001,17 +32325,17 @@
           } else {
             dart.assert(dart.notNull(rune) <= convert._THREE_BYTE_LIMIT);
             if (dart.notNull(this[_bufferIndex]) + 2 >= dart.notNull(this[_buffer][dartx.length])) break;
-            this[_buffer][dartx.set]((() => {
+            this[_buffer][dartx._set]((() => {
               let x = this[_bufferIndex];
               this[_bufferIndex] = dart.notNull(x) + 1;
               return x;
             })(), (224 | rune[dartx['>>']](12)) >>> 0);
-            this[_buffer][dartx.set]((() => {
+            this[_buffer][dartx._set]((() => {
               let x = this[_bufferIndex];
               this[_bufferIndex] = dart.notNull(x) + 1;
               return x;
             })(), 128 | dart.notNull(rune) >> 6 & 63);
-            this[_buffer][dartx.set]((() => {
+            this[_buffer][dartx._set]((() => {
               let x = this[_bufferIndex];
               this[_bufferIndex] = dart.notNull(x) + 1;
               return x;
@@ -32238,7 +32562,7 @@
                 if (i == endIndex) {
                   break loop;
                 }
-                let unit = codeUnits[dartx.get](i);
+                let unit = codeUnits[dartx._get](i);
                 if ((dart.notNull(unit) & 192) != 128) {
                   expectedUnits = 0;
                   if (!dart.test(this[_allowMalformed])) {
@@ -32253,7 +32577,7 @@
                   i = dart.notNull(i) + 1;
                 }
               } while (dart.notNull(expectedUnits) > 0);
-              if (dart.notNull(value) <= dart.notNull(convert._Utf8Decoder._LIMITS[dartx.get](dart.notNull(extraUnits) - 1))) {
+              if (dart.notNull(value) <= dart.notNull(convert._Utf8Decoder._LIMITS[dartx._get](dart.notNull(extraUnits) - 1))) {
                 if (!dart.test(this[_allowMalformed])) {
                   dart.throw(new core.FormatException(dart.str`Overlong encoding of 0x${value[dartx.toRadixString](16)}`));
                 }
@@ -32279,7 +32603,7 @@
               i = dart.notNull(i) + dart.notNull(oneBytes);
               if (i == endIndex) break;
             }
-            let unit = codeUnits[dartx.get]((() => {
+            let unit = codeUnits[dartx._get]((() => {
               let x = i;
               i = dart.notNull(x) + 1;
               return x;
@@ -32475,23 +32799,23 @@
           return result;
         }
         dart.fn(parseMilliAndMicroseconds, StringToint$());
-        let years = core.int.parse(match.get(1));
-        let month = core.int.parse(match.get(2));
-        let day = core.int.parse(match.get(3));
-        let hour = parseIntOrZero(match.get(4));
-        let minute = parseIntOrZero(match.get(5));
-        let second = parseIntOrZero(match.get(6));
+        let years = core.int.parse(match._get(1));
+        let month = core.int.parse(match._get(2));
+        let day = core.int.parse(match._get(3));
+        let hour = parseIntOrZero(match._get(4));
+        let minute = parseIntOrZero(match._get(5));
+        let second = parseIntOrZero(match._get(6));
         let addOneMillisecond = false;
-        let milliAndMicroseconds = parseMilliAndMicroseconds(match.get(7));
+        let milliAndMicroseconds = parseMilliAndMicroseconds(match._get(7));
         let millisecond = (dart.notNull(milliAndMicroseconds) / core.Duration.MICROSECONDS_PER_MILLISECOND)[dartx.truncate]();
         let microsecond = dart.asInt(milliAndMicroseconds[dartx.remainder](core.Duration.MICROSECONDS_PER_MILLISECOND));
         let isUtc = false;
-        if (match.get(8) != null) {
+        if (match._get(8) != null) {
           isUtc = true;
-          if (match.get(9) != null) {
-            let sign = match.get(9) == '-' ? -1 : 1;
-            let hourDifference = core.int.parse(match.get(10));
-            let minuteDifference = parseIntOrZero(match.get(11));
+          if (match._get(9) != null) {
+            let sign = match._get(9) == '-' ? -1 : 1;
+            let hourDifference = core.int.parse(match._get(10));
+            let minuteDifference = parseIntOrZero(match._get(11));
             minuteDifference = dart.notNull(minuteDifference) + 60 * dart.notNull(hourDifference);
             minute = dart.notNull(minute) - sign * dart.notNull(minuteDifference);
           }
@@ -32861,7 +33185,7 @@
       }
       dart.fn(twoDigits, intToString());
       if (dart.notNull(this.inMicroseconds) < 0) {
-        return dart.str`-${this['unary-']()}`;
+        return dart.str`-${this._negate()}`;
       }
       let twoDigitMinutes = twoDigits(dart.asInt(this.inMinutes[dartx.remainder](core.Duration.MINUTES_PER_HOUR)));
       let twoDigitSeconds = twoDigits(dart.asInt(this.inSeconds[dartx.remainder](core.Duration.SECONDS_PER_MINUTE)));
@@ -32874,7 +33198,7 @@
     abs() {
       return new core.Duration._microseconds(this[_duration][dartx.abs]());
     }
-    ['unary-']() {
+    _negate() {
       return new core.Duration._microseconds(-dart.notNull(this[_duration]));
     }
   };
@@ -32906,7 +33230,7 @@
       '>=': dart.definiteFunctionType(core.bool, [core.Duration]),
       compareTo: dart.definiteFunctionType(core.int, [core.Duration]),
       abs: dart.definiteFunctionType(core.Duration, []),
-      'unary-': dart.definiteFunctionType(core.Duration, [])
+      _negate: dart.definiteFunctionType(core.Duration, [])
     }),
     sfields: () => ({
       MICROSECONDS_PER_MILLISECOND: core.int,
@@ -33236,7 +33560,7 @@
           if (i > 0) {
             sb.write(", ");
           }
-          sb.write(core.Error.safeToString(this[_arguments][dartx.get](i)));
+          sb.write(core.Error.safeToString(this[_arguments][dartx._get](i)));
         }
       }
       if (this[_namedArguments] != null) {
@@ -33259,7 +33583,7 @@
           if (i > 0) {
             sb.write(", ");
           }
-          sb.write(this[_existingArgumentNames][dartx.get](i));
+          sb.write(this[_existingArgumentNames][dartx._get](i));
         }
         let formalParameters = sb.toString();
         return "NoSuchMethodError: incorrect number of arguments passed to " + dart.str`method named '${this[_memberName]}'\n` + dart.str`Receiver: ${core.Error.safeToString(this[_receiver$])}\n` + dart.str`Tried calling: ${this[_memberName]}(${actualParameters})\n` + dart.str`Found: ${this[_memberName]}(${formalParameters})`;
@@ -33517,11 +33841,11 @@
       toString() {
         return dart.str`Expando:${this.name}`;
       }
-      get(object) {
+      _get(object) {
         let values = _js_helper.Primitives.getProperty(object, core.Expando._EXPANDO_PROPERTY_NAME);
         return T._check(values == null ? null : _js_helper.Primitives.getProperty(values, this[_getKey]()));
       }
-      set(object, value) {
+      _set(object, value) {
         T._check(value);
         let values = _js_helper.Primitives.getProperty(object, core.Expando._EXPANDO_PROPERTY_NAME);
         if (values == null) {
@@ -33549,8 +33873,8 @@
       constructors: () => ({new: dart.definiteFunctionType(core.Expando$(T), [], [core.String])}),
       fields: () => ({name: core.String}),
       methods: () => ({
-        get: dart.definiteFunctionType(T, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [core.Object, T]),
+        _get: dart.definiteFunctionType(T, [core.Object]),
+        _set: dart.definiteFunctionType(dart.void, [core.Object, T]),
         [_getKey]: dart.definiteFunctionType(core.String, [])
       }),
       sfields: () => ({
@@ -33573,7 +33897,7 @@
     static _toMangledNames(namedArguments) {
       let result = dart.map({}, core.String, dart.dynamic);
       namedArguments[dartx.forEach](dart.fn((symbol, value) => {
-        result[dartx.set](core._symbolToString(symbol), value);
+        result[dartx._set](core._symbolToString(symbol), value);
       }, SymbolAnddynamicTovoid()));
       return result;
     }
@@ -34051,7 +34375,7 @@
     }
     get currentAsString() {
       if (this[_position$] == this[_nextPosition]) return null;
-      if (dart.notNull(this[_position$]) + 1 == this[_nextPosition]) return this.string[dartx.get](this[_position$]);
+      if (dart.notNull(this[_position$]) + 1 == this[_nextPosition]) return this.string[dartx._get](this[_position$]);
       return this.string[dartx.substring](this[_position$], this[_nextPosition]);
     }
     moveNext() {
@@ -34739,7 +35063,7 @@
       if (this[_queryParameterLists] == null) {
         let queryParameterLists = core.Uri._splitQueryStringAll(this.query);
         for (let key of queryParameterLists[dartx.keys]) {
-          queryParameterLists[dartx.set](key, ListOfString().unmodifiable(core.Iterable._check(queryParameterLists[dartx.get](key))));
+          queryParameterLists[dartx._set](key, ListOfString().unmodifiable(core.Iterable._check(queryParameterLists[dartx._get](key))));
         }
         this[_queryParameterLists] = MapOfString$ListOfString().unmodifiable(queryParameterLists);
       }
@@ -34775,7 +35099,7 @@
       return core.Uri._normalizeRegName(host, start, end);
     }
     static _isRegNameChar(char) {
-      return dart.notNull(char) < 127 && (dart.notNull(core.Uri._regNameTable[dartx.get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0;
+      return dart.notNull(char) < 127 && (dart.notNull(core.Uri._regNameTable[dartx._get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0;
     }
     static _normalizeRegName(host, start, end) {
       let buffer = null;
@@ -34970,9 +35294,9 @@
       let codeUnits = null;
       if (dart.notNull(char) < 128) {
         codeUnits = ListOfint().new(3);
-        codeUnits[dartx.set](0, core.Uri._PERCENT);
-        codeUnits[dartx.set](1, core.Uri._hexDigits[dartx.codeUnitAt](char[dartx['>>']](4)));
-        codeUnits[dartx.set](2, core.Uri._hexDigits[dartx.codeUnitAt](dart.notNull(char) & 15));
+        codeUnits[dartx._set](0, core.Uri._PERCENT);
+        codeUnits[dartx._set](1, core.Uri._hexDigits[dartx.codeUnitAt](char[dartx['>>']](4)));
+        codeUnits[dartx._set](2, core.Uri._hexDigits[dartx.codeUnitAt](dart.notNull(char) & 15));
       } else {
         let flag = 192;
         let encodedBytes = 2;
@@ -34988,9 +35312,9 @@
         let index = 0;
         while (--encodedBytes >= 0) {
           let byte = (char[dartx['>>']](6 * encodedBytes) & 63 | flag) >>> 0;
-          codeUnits[dartx.set](index, core.Uri._PERCENT);
-          codeUnits[dartx.set](index + 1, core.Uri._hexDigits[dartx.codeUnitAt](byte[dartx['>>']](4)));
-          codeUnits[dartx.set](index + 2, core.Uri._hexDigits[dartx.codeUnitAt](byte & 15));
+          codeUnits[dartx._set](index, core.Uri._PERCENT);
+          codeUnits[dartx._set](index + 1, core.Uri._hexDigits[dartx.codeUnitAt](byte[dartx['>>']](4)));
+          codeUnits[dartx._set](index + 2, core.Uri._hexDigits[dartx.codeUnitAt](byte & 15));
           index = index + 3;
           flag = 128;
         }
@@ -35003,7 +35327,7 @@
       let index = start;
       while (dart.notNull(index) < dart.notNull(end)) {
         let char = component[dartx.codeUnitAt](index);
-        if (dart.notNull(char) < 127 && (dart.notNull(charTable[dartx.get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0) {
+        if (dart.notNull(char) < 127 && (dart.notNull(charTable[dartx._get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0) {
           index = dart.notNull(index) + 1;
         } else {
           let replacement = null;
@@ -35051,10 +35375,10 @@
       return dart.toString(buffer);
     }
     static _isSchemeCharacter(ch) {
-      return dart.notNull(ch) < 128 && (dart.notNull(core.Uri._schemeTable[dartx.get](ch[dartx['>>']](4))) & 1 << (dart.notNull(ch) & 15)) != 0;
+      return dart.notNull(ch) < 128 && (dart.notNull(core.Uri._schemeTable[dartx._get](ch[dartx['>>']](4))) & 1 << (dart.notNull(ch) & 15)) != 0;
     }
     static _isGeneralDelimiter(ch) {
-      return dart.notNull(ch) <= core.Uri._RIGHT_BRACKET && (dart.notNull(core.Uri._genDelimitersTable[dartx.get](ch[dartx['>>']](4))) & 1 << (dart.notNull(ch) & 15)) != 0;
+      return dart.notNull(ch) <= core.Uri._RIGHT_BRACKET && (dart.notNull(core.Uri._genDelimitersTable[dartx._get](ch[dartx['>>']](4))) & 1 << (dart.notNull(ch) & 15)) != 0;
     }
     get isAbsolute() {
       return this.scheme != "" && this.fragment == "";
@@ -35131,7 +35455,7 @@
           output[dartx.add](segment);
         }
       }
-      if (dart.test(output[dartx.isEmpty]) || output[dartx.length] == 1 && dart.test(output[dartx.get](0)[dartx.isEmpty])) {
+      if (dart.test(output[dartx.isEmpty]) || output[dartx.length] == 1 && dart.test(output[dartx._get](0)[dartx.isEmpty])) {
         return "./";
       }
       if (appendSlash || output[dartx.last] == '..') output[dartx.add]("");
@@ -35261,8 +35585,8 @@
     [_toWindowsFilePath]() {
       let hasDriveLetter = false;
       let segments = this.pathSegments;
-      if (dart.notNull(segments[dartx.length]) > 0 && segments[dartx.get](0)[dartx.length] == 2 && segments[dartx.get](0)[dartx.codeUnitAt](1) == core.Uri._COLON) {
-        core.Uri._checkWindowsDriveLetter(segments[dartx.get](0)[dartx.codeUnitAt](0), false);
+      if (dart.notNull(segments[dartx.length]) > 0 && segments[dartx._get](0)[dartx.length] == 2 && segments[dartx._get](0)[dartx.codeUnitAt](1) == core.Uri._COLON) {
+        core.Uri._checkWindowsDriveLetter(segments[dartx._get](0)[dartx.codeUnitAt](0), false);
         core.Uri._checkWindowsPathReservedCharacters(segments, false, 1);
         hasDriveLetter = true;
       } else {
@@ -35359,12 +35683,12 @@
         let index = element[dartx.indexOf]("=");
         if (index == -1) {
           if (element != "") {
-            map[dartx.set](core.Uri.decodeQueryComponent(element, {encoding: encoding}), "");
+            map[dartx._set](core.Uri.decodeQueryComponent(element, {encoding: encoding}), "");
           }
         } else if (index != 0) {
           let key = element[dartx.substring](0, index);
           let value = element[dartx.substring](dart.notNull(index) + 1);
-          map[dartx.set](core.Uri.decodeQueryComponent(key, {encoding: encoding}), core.Uri.decodeQueryComponent(value, {encoding: encoding}));
+          map[dartx._set](core.Uri.decodeQueryComponent(key, {encoding: encoding}), core.Uri.decodeQueryComponent(value, {encoding: encoding}));
         }
         return map;
       }, MapOfString$StringAndStringToMapOfString$String()));
@@ -35482,8 +35806,8 @@
         } catch (e) {
           try {
             let last = core.Uri.parseIPv4Address(host[dartx.substring](partStart, end));
-            parts[dartx.add]((dart.notNull(last[dartx.get](0)) << 8 | dart.notNull(last[dartx.get](1))) >>> 0);
-            parts[dartx.add]((dart.notNull(last[dartx.get](2)) << 8 | dart.notNull(last[dartx.get](3))) >>> 0);
+            parts[dartx.add]((dart.notNull(last[dartx._get](0)) << 8 | dart.notNull(last[dartx._get](1))) >>> 0);
+            parts[dartx.add]((dart.notNull(last[dartx._get](2)) << 8 | dart.notNull(last[dartx._get](3))) >>> 0);
           } catch (e) {
             error('invalid end of IPv6 address.', partStart);
           }
@@ -35500,17 +35824,17 @@
       }
       let bytes = typed_data.Uint8List.new(16);
       for (let i = 0, index = 0; i < dart.notNull(parts[dartx.length]); i++) {
-        let value = parts[dartx.get](i);
+        let value = parts[dartx._get](i);
         if (value == -1) {
           let wildCardLength = 9 - dart.notNull(parts[dartx.length]);
           for (let j = 0; j < wildCardLength; j++) {
-            bytes[dartx.set](index, 0);
-            bytes[dartx.set](index + 1, 0);
+            bytes[dartx._set](index, 0);
+            bytes[dartx._set](index + 1, 0);
             index = index + 2;
           }
         } else {
-          bytes[dartx.set](index, value[dartx['>>']](8));
-          bytes[dartx.set](index + 1, dart.notNull(value) & 255);
+          bytes[dartx._set](index, value[dartx['>>']](8));
+          bytes[dartx._set](index + 1, dart.notNull(value) & 255);
           index = index + 2;
         }
       }
@@ -35523,16 +35847,16 @@
       let result = new core.StringBuffer();
       let bytes = encoding.encode(text);
       for (let i = 0; i < dart.notNull(bytes[dartx.length]); i++) {
-        let byte = bytes[dartx.get](i);
-        if (dart.notNull(byte) < 128 && (dart.notNull(canonicalTable[dartx.get](byte[dartx['>>']](4))) & 1 << (dart.notNull(byte) & 15)) != 0) {
+        let byte = bytes[dartx._get](i);
+        if (dart.notNull(byte) < 128 && (dart.notNull(canonicalTable[dartx._get](byte[dartx['>>']](4))) & 1 << (dart.notNull(byte) & 15)) != 0) {
           result.writeCharCode(byte);
         } else if (dart.test(spaceToPlus) && byte == core.Uri._SPACE) {
           result.write('+');
         } else {
           let hexDigits = '0123456789ABCDEF';
           result.write('%');
-          result.write(hexDigits[dartx.get](dart.notNull(byte) >> 4 & 15));
-          result.write(hexDigits[dartx.get](dart.notNull(byte) & 15));
+          result.write(hexDigits[dartx._get](dart.notNull(byte) >> 4 & 15));
+          result.write(hexDigits[dartx._get](dart.notNull(byte) & 15));
         }
       }
       return result.toString();
@@ -35601,7 +35925,7 @@
       return core.Uri._LOWER_CASE_A <= lowerCase && lowerCase <= core.Uri._LOWER_CASE_Z;
     }
     static _isUnreservedChar(char) {
-      return dart.notNull(char) < 127 && (dart.notNull(core.Uri._unreservedTable[dartx.get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0;
+      return dart.notNull(char) < 127 && (dart.notNull(core.Uri._unreservedTable[dartx._get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0;
     }
   };
   dart.defineNamedConstructor(core.Uri, '_internal');
@@ -35819,7 +36143,7 @@
       let indices = JSArrayOfint().of([core.UriData._noScheme]);
       let charsetName = null;
       let encodingName = null;
-      if (parameters != null) charsetName = parameters[dartx.get]("charset");
+      if (parameters != null) charsetName = parameters[dartx._get]("charset");
       if (encoding == null) {
         if (charsetName != null) {
           encoding = convert.Encoding.getByName(charsetName);
@@ -35834,7 +36158,7 @@
       if (dart.test(base64)) {
         buffer.write(';base64,');
         indices[dartx.add](dart.notNull(buffer.length) - 1);
-        buffer.write(encoding.fuse(convert.BASE64).encode(content));
+        buffer.write(encoding.fuse(core.String)(convert.BASE64).encode(content));
       } else {
         buffer.write(',');
         core.UriData._uriEncodeBytes(core.UriData._uricTable, encoding.encode(content), buffer);
@@ -35935,7 +36259,7 @@
       if (this[_uriCache] != null) return this[_uriCache];
       let path = this[_text];
       let query = null;
-      let colonIndex = this[_separatorIndices][dartx.get](0);
+      let colonIndex = this[_separatorIndices][dartx._get](0);
       let queryIndex = this[_text][dartx.indexOf]('?', dart.notNull(colonIndex) + 1);
       let end = null;
       if (dart.notNull(queryIndex) >= 0) {
@@ -35947,8 +36271,8 @@
       return this[_uriCache];
     }
     get mimeType() {
-      let start = dart.notNull(this[_separatorIndices][dartx.get](0)) + 1;
-      let end = this[_separatorIndices][dartx.get](1);
+      let start = dart.notNull(this[_separatorIndices][dartx._get](0)) + 1;
+      let end = this[_separatorIndices][dartx._get](1);
       if (start == end) return "text/plain";
       return core.Uri._uriDecode(this[_text], start, end, convert.UTF8, false);
     }
@@ -35959,10 +36283,10 @@
         parameterEnd = parameterEnd - 1;
       }
       for (let i = parameterStart; i < parameterEnd; i = i + 2) {
-        let keyStart = dart.notNull(this[_separatorIndices][dartx.get](i)) + 1;
-        let keyEnd = this[_separatorIndices][dartx.get](i + 1);
+        let keyStart = dart.notNull(this[_separatorIndices][dartx._get](i)) + 1;
+        let keyEnd = this[_separatorIndices][dartx._get](i + 1);
         if (keyEnd == keyStart + 7 && dart.test(this[_text][dartx.startsWith]("charset", keyStart))) {
-          return core.Uri._uriDecode(this[_text], dart.notNull(keyEnd) + 1, this[_separatorIndices][dartx.get](i + 2), convert.UTF8, false);
+          return core.Uri._uriDecode(this[_text], dart.notNull(keyEnd) + 1, this[_separatorIndices][dartx._get](i + 2), convert.UTF8, false);
         }
       }
       return "US-ASCII";
@@ -35997,14 +36321,14 @@
       for (let i = start; i < dart.notNull(text[dartx.length]); i++) {
         let codeUnit = text[dartx.codeUnitAt](i);
         if (codeUnit != percent) {
-          result[dartx.set](index++, codeUnit);
+          result[dartx._set](index++, codeUnit);
         } else {
           if (i + 2 < dart.notNull(text[dartx.length])) {
             let digit1 = core.Uri._parseHexDigit(text[dartx.codeUnitAt](i + 1));
             let digit2 = core.Uri._parseHexDigit(text[dartx.codeUnitAt](i + 2));
             if (dart.notNull(digit1) >= 0 && dart.notNull(digit2) >= 0) {
               let byte = dart.notNull(digit1) * 16 + dart.notNull(digit2);
-              result[dartx.set](index++, byte);
+              result[dartx._set](index++, byte);
               i = i + 2;
               continue;
             }
@@ -36035,12 +36359,12 @@
     get parameters() {
       let result = dart.map({}, core.String, core.String);
       for (let i = 3; i < dart.notNull(this[_separatorIndices][dartx.length]); i = i + 2) {
-        let start = dart.notNull(this[_separatorIndices][dartx.get](i - 2)) + 1;
-        let equals = this[_separatorIndices][dartx.get](i - 1);
-        let end = this[_separatorIndices][dartx.get](i);
+        let start = dart.notNull(this[_separatorIndices][dartx._get](i - 2)) + 1;
+        let equals = this[_separatorIndices][dartx._get](i - 1);
+        let end = this[_separatorIndices][dartx._get](i);
         let key = core.Uri._uriDecode(this[_text], start, equals, convert.UTF8, false);
         let value = core.Uri._uriDecode(this[_text], dart.notNull(equals) + 1, end, convert.UTF8, false);
-        result[dartx.set](key, value);
+        result[dartx._set](key, value);
       }
       return result;
     }
@@ -36097,9 +36421,9 @@
     static _uriEncodeBytes(canonicalTable, bytes, buffer) {
       let byteOr = 0;
       for (let i = 0; i < dart.notNull(bytes[dartx.length]); i++) {
-        let byte = bytes[dartx.get](i);
+        let byte = bytes[dartx._get](i);
         byteOr = (dart.notNull(byteOr) | dart.notNull(byte)) >>> 0;
-        if (dart.notNull(byte) < 128 && (dart.notNull(canonicalTable[dartx.get](byte[dartx['>>']](4))) & 1 << (dart.notNull(byte) & 15)) != 0) {
+        if (dart.notNull(byte) < 128 && (dart.notNull(canonicalTable[dartx._get](byte[dartx['>>']](4))) & 1 << (dart.notNull(byte) & 15)) != 0) {
           buffer.writeCharCode(byte);
         } else {
           buffer.writeCharCode(core.Uri._PERCENT);
@@ -36109,7 +36433,7 @@
       }
       if ((dart.notNull(byteOr) & ~255) != 0) {
         for (let i = 0; i < dart.notNull(bytes[dartx.length]); i++) {
-          let byte = bytes[dartx.get](i);
+          let byte = bytes[dartx._get](i);
           if (dart.notNull(byte) < 0 || dart.notNull(byte) > 255) {
             dart.throw(new core.ArgumentError.value(byte, "non-byte value"));
           }
@@ -36117,7 +36441,7 @@
       }
     }
     toString() {
-      return this[_separatorIndices][dartx.get](0) == core.UriData._noScheme ? dart.str`data:${this[_text]}` : this[_text];
+      return this[_separatorIndices][dartx._get](0) == core.UriData._noScheme ? dart.str`data:${this[_text]}` : this[_text];
     }
   };
   dart.defineNamedConstructor(core.UriData, '_');
@@ -36162,6 +36486,741 @@
   core.UriData._noScheme = -1;
   core.UriData._tokenCharTable = dart.constList([0, 0, 27858, 1023, 65534, 51199, 65535, 32767], core.int);
   core.UriData._uricTable = core.Uri._queryCharTable;
+  developer.debugger = function(opts) {
+    let when = opts && 'when' in opts ? opts.when : true;
+    let message = opts && 'message' in opts ? opts.message : null;
+    if (dart.test(when)) {
+      debugger;
+    }
+    return when;
+  };
+  dart.fn(developer.debugger, __Tobool());
+  developer.inspect = function(object) {
+    return object;
+  };
+  dart.fn(developer.inspect, ObjectToObject());
+  developer.log = function(message, opts) {
+    let time = opts && 'time' in opts ? opts.time : null;
+    let sequenceNumber = opts && 'sequenceNumber' in opts ? opts.sequenceNumber : null;
+    let level = opts && 'level' in opts ? opts.level : 0;
+    let name = opts && 'name' in opts ? opts.name : '';
+    let zone = opts && 'zone' in opts ? opts.zone : null;
+    let error = opts && 'error' in opts ? opts.error : null;
+    let stackTrace = opts && 'stackTrace' in opts ? opts.stackTrace : null;
+  };
+  dart.fn(developer.log, String__Tovoid$());
+  dart.defineLazy(developer, {
+    get _extensions() {
+      return MapOfString$ServiceExtensionHandler().new();
+    }
+  });
+  developer._clockValue = 0;
+  const _result = Symbol('_result');
+  const _errorCode = Symbol('_errorCode');
+  const _errorDetail = Symbol('_errorDetail');
+  const _isError = Symbol('_isError');
+  const _toString = Symbol('_toString');
+  developer.ServiceExtensionResponse = class ServiceExtensionResponse extends core.Object {
+    result(result) {
+      this[_result] = result;
+      this[_errorCode] = null;
+      this[_errorDetail] = null;
+      if (!(typeof this[_result] == 'string')) {
+        dart.throw(new core.ArgumentError.value(this[_result], "result", "Must be a String"));
+      }
+    }
+    error(errorCode, errorDetail) {
+      this[_result] = null;
+      this[_errorCode] = errorCode;
+      this[_errorDetail] = errorDetail;
+      developer.ServiceExtensionResponse._validateErrorCode(this[_errorCode]);
+      if (!(typeof this[_errorDetail] == 'string')) {
+        dart.throw(new core.ArgumentError.value(this[_errorDetail], "errorDetail", "Must be a String"));
+      }
+    }
+    static _errorCodeMessage(errorCode) {
+      developer.ServiceExtensionResponse._validateErrorCode(errorCode);
+      if (errorCode == developer.ServiceExtensionResponse.kInvalidParams) {
+        return "Invalid params";
+      }
+      return "Server error";
+    }
+    static _validateErrorCode(errorCode) {
+      if (!(typeof errorCode == 'number')) {
+        dart.throw(new core.ArgumentError.value(errorCode, "errorCode", "Must be an int"));
+      }
+      if (errorCode == developer.ServiceExtensionResponse.invalidParams) {
+        return;
+      }
+      if (dart.notNull(errorCode) >= developer.ServiceExtensionResponse.extensionErrorMin && dart.notNull(errorCode) <= developer.ServiceExtensionResponse.extensionErrorMax) {
+        return;
+      }
+      dart.throw(new core.ArgumentError.value(errorCode, "errorCode", "Out of range"));
+    }
+    [_isError]() {
+      return this[_errorCode] != null && this[_errorDetail] != null;
+    }
+    [_toString]() {
+      if (this[_result] != null) {
+        return this[_result];
+      } else {
+        dart.assert(this[_errorCode] != null);
+        dart.assert(this[_errorDetail] != null);
+        return convert.JSON.encode(dart.map({code: this[_errorCode], message: developer.ServiceExtensionResponse._errorCodeMessage(this[_errorCode]), data: dart.map({details: this[_errorDetail]}, core.String, core.String)}, core.String, core.Object));
+      }
+    }
+  };
+  dart.defineNamedConstructor(developer.ServiceExtensionResponse, 'result');
+  dart.defineNamedConstructor(developer.ServiceExtensionResponse, 'error');
+  dart.setSignature(developer.ServiceExtensionResponse, {
+    constructors: () => ({
+      result: dart.definiteFunctionType(developer.ServiceExtensionResponse, [core.String]),
+      error: dart.definiteFunctionType(developer.ServiceExtensionResponse, [core.int, core.String])
+    }),
+    fields: () => ({
+      [_result]: core.String,
+      [_errorCode]: core.int,
+      [_errorDetail]: core.String
+    }),
+    methods: () => ({
+      [_isError]: dart.definiteFunctionType(core.bool, []),
+      [_toString]: dart.definiteFunctionType(core.String, [])
+    }),
+    sfields: () => ({
+      kInvalidParams: core.int,
+      kExtensionError: core.int,
+      kExtensionErrorMax: core.int,
+      kExtensionErrorMin: core.int,
+      invalidParams: core.int,
+      extensionError: core.int,
+      extensionErrorMax: core.int,
+      extensionErrorMin: core.int
+    }),
+    statics: () => ({
+      _errorCodeMessage: dart.definiteFunctionType(core.String, [core.int]),
+      _validateErrorCode: dart.definiteFunctionType(dart.dynamic, [core.int])
+    }),
+    names: ['_errorCodeMessage', '_validateErrorCode']
+  });
+  developer.ServiceExtensionResponse.invalidParams = -32602;
+  developer.ServiceExtensionResponse.extensionError = -32000;
+  developer.ServiceExtensionResponse.extensionErrorMax = -32000;
+  developer.ServiceExtensionResponse.extensionErrorMin = -32016;
+  dart.defineLazy(developer.ServiceExtensionResponse, {
+    get kInvalidParams() {
+      return developer.ServiceExtensionResponse.invalidParams;
+    },
+    get kExtensionError() {
+      return developer.ServiceExtensionResponse.extensionError;
+    },
+    get kExtensionErrorMax() {
+      return developer.ServiceExtensionResponse.extensionErrorMax;
+    },
+    get kExtensionErrorMin() {
+      return developer.ServiceExtensionResponse.extensionErrorMin;
+    }
+  });
+  developer.ServiceExtensionHandler = dart.typedef('ServiceExtensionHandler', () => dart.functionType(async.Future$(developer.ServiceExtensionResponse), [core.String, MapOfString$String()]));
+  developer.registerExtension = function(method, handler) {
+    if (!(typeof method == 'string')) {
+      dart.throw(new core.ArgumentError.value(method, 'method', 'Must be a String'));
+    }
+    if (!dart.test(method[dartx.startsWith]('ext.'))) {
+      dart.throw(new core.ArgumentError.value(method, 'method', 'Must begin with ext.'));
+    }
+    if (developer._lookupExtension(method) != null) {
+      dart.throw(new core.ArgumentError(dart.str`Extension already registered: ${method}`));
+    }
+    if (!developer.ServiceExtensionHandler.is(handler)) {
+      dart.throw(new core.ArgumentError.value(handler, 'handler', 'Must be a ServiceExtensionHandler'));
+    }
+    developer._registerExtension(method, handler);
+  };
+  dart.fn(developer.registerExtension, StringAndServiceExtensionHandlerTovoid());
+  developer.postEvent = function(eventKind, eventData) {
+    if (!(typeof eventKind == 'string')) {
+      dart.throw(new core.ArgumentError.value(eventKind, 'eventKind', 'Must be a String'));
+    }
+    if (!core.Map.is(eventData)) {
+      dart.throw(new core.ArgumentError.value(eventData, 'eventData', 'Must be a Map'));
+    }
+    let eventDataAsString = convert.JSON.encode(eventData);
+    developer._postEvent(eventKind, eventDataAsString);
+  };
+  dart.fn(developer.postEvent, StringAndMapTovoid());
+  developer._postEvent = function(eventKind, eventData) {
+  };
+  dart.fn(developer._postEvent, StringAndStringTodynamic());
+  developer._lookupExtension = function(method) {
+    return developer._extensions[dartx._get](method);
+  };
+  dart.fn(developer._lookupExtension, StringToServiceExtensionHandler());
+  developer._registerExtension = function(method, handler) {
+    developer._extensions[dartx._set](method, handler);
+  };
+  dart.fn(developer._registerExtension, StringAndServiceExtensionHandlerTodynamic());
+  developer.UserTag = class UserTag extends core.Object {
+    static new(label) {
+      return developer._FakeUserTag.new(label);
+    }
+    static get defaultTag() {
+      return developer._FakeUserTag._defaultTag;
+    }
+  };
+  dart.setSignature(developer.UserTag, {
+    constructors: () => ({new: dart.definiteFunctionType(developer.UserTag, [core.String])}),
+    sfields: () => ({MAX_USER_TAGS: core.int}),
+    sgetters: () => ({defaultTag: dart.definiteFunctionType(developer.UserTag, [])})
+  });
+  developer.UserTag.MAX_USER_TAGS = 64;
+  developer._FakeUserTag = class _FakeUserTag extends core.Object {
+    real(label) {
+      this.label = label;
+    }
+    static new(label) {
+      let existingTag = developer._FakeUserTag._instances[dartx._get](label);
+      if (existingTag != null) {
+        return developer._FakeUserTag._check(existingTag);
+      }
+      if (developer._FakeUserTag._instances[dartx.length] == developer.UserTag.MAX_USER_TAGS) {
+        dart.throw(new core.UnsupportedError(dart.str`UserTag instance limit (${developer.UserTag.MAX_USER_TAGS}) reached.`));
+      }
+      let instance = new developer._FakeUserTag.real(label);
+      developer._FakeUserTag._instances[dartx._set](label, instance);
+      return instance;
+    }
+    makeCurrent() {
+      let old = developer._currentTag;
+      developer._currentTag = this;
+      return old;
+    }
+  };
+  dart.defineNamedConstructor(developer._FakeUserTag, 'real');
+  developer._FakeUserTag[dart.implements] = () => [developer.UserTag];
+  dart.setSignature(developer._FakeUserTag, {
+    constructors: () => ({
+      real: dart.definiteFunctionType(developer._FakeUserTag, [core.String]),
+      new: dart.definiteFunctionType(developer._FakeUserTag, [core.String])
+    }),
+    fields: () => ({label: core.String}),
+    methods: () => ({makeCurrent: dart.definiteFunctionType(developer.UserTag, [])}),
+    sfields: () => ({
+      _instances: core.Map,
+      _defaultTag: developer.UserTag
+    })
+  });
+  dart.defineLazy(developer._FakeUserTag, {
+    get _instances() {
+      return dart.map();
+    },
+    set _instances(_) {},
+    get _defaultTag() {
+      return developer._FakeUserTag.new('Default');
+    }
+  });
+  dart.defineLazy(developer, {
+    get _currentTag() {
+      return developer._FakeUserTag._defaultTag;
+    },
+    set _currentTag(_) {}
+  });
+  developer.getCurrentTag = function() {
+    return developer._currentTag;
+  };
+  dart.fn(developer.getCurrentTag, VoidToUserTag());
+  developer.Metric = class Metric extends core.Object {
+    new(name, description) {
+      this.name = name;
+      this.description = description;
+      if (this.name == 'vm' || dart.test(this.name[dartx.contains]('/'))) {
+        dart.throw(new core.ArgumentError('Invalid Metric name.'));
+      }
+    }
+  };
+  dart.setSignature(developer.Metric, {
+    constructors: () => ({new: dart.definiteFunctionType(developer.Metric, [core.String, core.String])}),
+    fields: () => ({
+      name: core.String,
+      description: core.String
+    })
+  });
+  const _value$0 = Symbol('_value');
+  const _toJSON = Symbol('_toJSON');
+  developer.Gauge = class Gauge extends developer.Metric {
+    get value() {
+      return this[_value$0];
+    }
+    set value(v) {
+      if (dart.notNull(v) < dart.notNull(this.min)) {
+        v = this.min;
+      } else if (dart.notNull(v) > dart.notNull(this.max)) {
+        v = this.max;
+      }
+      this[_value$0] = v;
+    }
+    new(name, description, min, max) {
+      this.min = min;
+      this.max = max;
+      this[_value$0] = null;
+      super.new(name, description);
+      if (!(typeof this.min == 'number')) {
+        dart.throw(new core.ArgumentError('min must be a double'));
+      }
+      if (!(typeof this.max == 'number')) {
+        dart.throw(new core.ArgumentError('max must be a double'));
+      }
+      if (!(dart.notNull(this.min) < dart.notNull(this.max))) {
+        dart.throw(new core.ArgumentError('min must be less than max'));
+      }
+      this[_value$0] = this.min;
+    }
+    [_toJSON]() {
+      let map = dart.map({type: 'Gauge', id: dart.str`metrics/${this.name}`, name: this.name, description: this.description, value: this.value, min: this.min, max: this.max}, core.String, core.Object);
+      return map;
+    }
+  };
+  dart.setSignature(developer.Gauge, {
+    constructors: () => ({new: dart.definiteFunctionType(developer.Gauge, [core.String, core.String, core.double, core.double])}),
+    fields: () => ({
+      min: core.double,
+      max: core.double,
+      [_value$0]: core.double
+    }),
+    getters: () => ({value: dart.definiteFunctionType(core.double, [])}),
+    setters: () => ({value: dart.definiteFunctionType(dart.void, [core.double])}),
+    methods: () => ({[_toJSON]: dart.definiteFunctionType(core.Map, [])})
+  });
+  developer.Counter = class Counter extends developer.Metric {
+    new(name, description) {
+      this[_value$0] = 0.0;
+      super.new(name, description);
+    }
+    get value() {
+      return this[_value$0];
+    }
+    set value(v) {
+      this[_value$0] = v;
+    }
+    [_toJSON]() {
+      let map = dart.map({type: 'Counter', id: dart.str`metrics/${this.name}`, name: this.name, description: this.description, value: this.value}, core.String, core.Object);
+      return map;
+    }
+  };
+  dart.setSignature(developer.Counter, {
+    constructors: () => ({new: dart.definiteFunctionType(developer.Counter, [core.String, core.String])}),
+    fields: () => ({[_value$0]: core.double}),
+    getters: () => ({value: dart.definiteFunctionType(core.double, [])}),
+    setters: () => ({value: dart.definiteFunctionType(dart.void, [core.double])}),
+    methods: () => ({[_toJSON]: dart.definiteFunctionType(core.Map, [])})
+  });
+  developer.Metrics = class Metrics extends core.Object {
+    static register(metric) {
+      if (!developer.Metric.is(metric)) {
+        dart.throw(new core.ArgumentError('metric must be a Metric'));
+      }
+      if (developer.Metrics._metrics[dartx._get](metric.name) != null) {
+        dart.throw(new core.ArgumentError('Registered metrics have unique names'));
+      }
+      developer.Metrics._metrics[dartx._set](metric.name, metric);
+    }
+    static deregister(metric) {
+      if (!developer.Metric.is(metric)) {
+        dart.throw(new core.ArgumentError('metric must be a Metric'));
+      }
+      developer.Metrics._metrics[dartx.remove](metric.name);
+    }
+    static _printMetric(id) {
+      let metric = developer.Metrics._metrics[dartx._get](id);
+      if (metric == null) {
+        return null;
+      }
+      return convert.JSON.encode(metric[_toJSON]());
+    }
+    static _printMetrics() {
+      let metrics = [];
+      for (let metric of developer.Metrics._metrics[dartx.values]) {
+        metrics[dartx.add](metric[_toJSON]());
+      }
+      let map = dart.map({type: 'MetricList', metrics: metrics}, core.String, core.Object);
+      return convert.JSON.encode(map);
+    }
+  };
+  dart.setSignature(developer.Metrics, {
+    sfields: () => ({_metrics: MapOfString$Metric()}),
+    statics: () => ({
+      register: dart.definiteFunctionType(dart.void, [developer.Metric]),
+      deregister: dart.definiteFunctionType(dart.void, [developer.Metric]),
+      _printMetric: dart.definiteFunctionType(core.String, [core.String]),
+      _printMetrics: dart.definiteFunctionType(core.String, [])
+    }),
+    names: ['register', 'deregister', '_printMetric', '_printMetrics']
+  });
+  dart.defineLazy(developer.Metrics, {
+    get _metrics() {
+      return MapOfString$Metric().new();
+    }
+  });
+  developer._isProduct = false;
+  developer.TimelineSyncFunction = dart.typedef('TimelineSyncFunction', () => dart.functionType(dart.dynamic, []));
+  developer.TimelineAsyncFunction = dart.typedef('TimelineAsyncFunction', () => dart.functionType(async.Future, []));
+  const _appendArguments = Symbol('_appendArguments');
+  developer.Timeline = class Timeline extends core.Object {
+    static startSync(name, opts) {
+      let arguments$ = opts && 'arguments' in opts ? opts.arguments : null;
+      if (developer._isProduct) {
+        return;
+      }
+      if (!(typeof name == 'string')) {
+        dart.throw(new core.ArgumentError.value(name, 'name', 'Must be a String'));
+      }
+      if (!dart.test(developer._isDartStreamEnabled())) {
+        developer.Timeline._stack[dartx.add](null);
+        return;
+      }
+      let block = new developer._SyncBlock._(name, developer._getTraceClock(), developer._getThreadCpuClock());
+      if (core.Map.is(arguments$)) {
+        block[_appendArguments](arguments$);
+      }
+      developer.Timeline._stack[dartx.add](block);
+    }
+    static finishSync() {
+      if (developer._isProduct) {
+        return;
+      }
+      if (developer.Timeline._stack[dartx.length] == 0) {
+        dart.throw(new core.StateError('Uneven calls to startSync and finishSync'));
+      }
+      let block = developer.Timeline._stack[dartx.removeLast]();
+      if (block == null) {
+        return;
+      }
+      block.finish();
+    }
+    static instantSync(name, opts) {
+      let arguments$ = opts && 'arguments' in opts ? opts.arguments : null;
+      if (developer._isProduct) {
+        return;
+      }
+      if (!(typeof name == 'string')) {
+        dart.throw(new core.ArgumentError.value(name, 'name', 'Must be a String'));
+      }
+      if (!dart.test(developer._isDartStreamEnabled())) {
+        return;
+      }
+      let instantArguments = null;
+      if (core.Map.is(arguments$)) {
+        instantArguments = core.Map.from(arguments$);
+      }
+      developer._reportInstantEvent(developer._getTraceClock(), 'Dart', name, developer._argumentsAsJson(instantArguments));
+    }
+    static timeSync(name, func, opts) {
+      let arguments$ = opts && 'arguments' in opts ? opts.arguments : null;
+      developer.Timeline.startSync(name, {arguments: arguments$});
+      try {
+        return func();
+      } finally {
+        developer.Timeline.finishSync();
+      }
+    }
+    static get now() {
+      return developer._getTraceClock();
+    }
+  };
+  dart.setSignature(developer.Timeline, {
+    sfields: () => ({
+      _stack: ListOf_SyncBlock(),
+      _isolateId: core.int,
+      _isolateIdString: core.String
+    }),
+    sgetters: () => ({now: dart.definiteFunctionType(core.int, [])}),
+    statics: () => ({
+      startSync: dart.definiteFunctionType(dart.void, [core.String], {arguments: core.Map}),
+      finishSync: dart.definiteFunctionType(dart.void, []),
+      instantSync: dart.definiteFunctionType(dart.void, [core.String], {arguments: core.Map}),
+      timeSync: dart.definiteFunctionType(dart.dynamic, [core.String, developer.TimelineSyncFunction], {arguments: core.Map})
+    }),
+    names: ['startSync', 'finishSync', 'instantSync', 'timeSync']
+  });
+  dart.defineLazy(developer.Timeline, {
+    get _stack() {
+      return ListOf_SyncBlock().new();
+    },
+    get _isolateId() {
+      return developer._getIsolateNum();
+    },
+    get _isolateIdString() {
+      return dart.toString(developer.Timeline._isolateId);
+    }
+  });
+  const _stack = Symbol('_stack');
+  const _taskId = Symbol('_taskId');
+  const _start$1 = Symbol('_start');
+  const _finish = Symbol('_finish');
+  developer.TimelineTask = class TimelineTask extends core.Object {
+    new() {
+      this[_stack] = JSArrayOf_AsyncBlock().of([]);
+      this[_taskId] = developer._getNextAsyncId();
+    }
+    withTaskId(taskId) {
+      this[_stack] = JSArrayOf_AsyncBlock().of([]);
+      this[_taskId] = taskId;
+      if (!(typeof taskId == 'number')) {
+        dart.throw(new core.ArgumentError.value(taskId, 'taskId', 'Must be an int'));
+      }
+    }
+    start(name, opts) {
+      let arguments$ = opts && 'arguments' in opts ? opts.arguments : null;
+      if (developer._isProduct) {
+        return;
+      }
+      if (!(typeof name == 'string')) {
+        dart.throw(new core.ArgumentError.value(name, 'name', 'Must be a String'));
+      }
+      let block = new developer._AsyncBlock._(name, this[_taskId]);
+      if (core.Map.is(arguments$)) {
+        block[_appendArguments](arguments$);
+      }
+      this[_stack][dartx.add](block);
+      block[_start$1]();
+    }
+    instant(name, opts) {
+      let arguments$ = opts && 'arguments' in opts ? opts.arguments : null;
+      if (developer._isProduct) {
+        return;
+      }
+      if (!(typeof name == 'string')) {
+        dart.throw(new core.ArgumentError.value(name, 'name', 'Must be a String'));
+      }
+      let instantArguments = null;
+      if (core.Map.is(arguments$)) {
+        instantArguments = core.Map.from(arguments$);
+      }
+      developer._reportTaskEvent(developer._getTraceClock(), this[_taskId], 'n', 'Dart', name, developer._argumentsAsJson(instantArguments));
+    }
+    finish() {
+      if (developer._isProduct) {
+        return;
+      }
+      if (this[_stack][dartx.length] == 0) {
+        dart.throw(new core.StateError('Uneven calls to start and finish'));
+      }
+      let block = this[_stack][dartx.removeLast]();
+      block[_finish]();
+    }
+    pass() {
+      if (dart.notNull(this[_stack][dartx.length]) > 0) {
+        dart.throw(new core.StateError('You cannot pass a TimelineTask without finishing all started ' + 'operations'));
+      }
+      let r = this[_taskId];
+      return r;
+    }
+  };
+  dart.defineNamedConstructor(developer.TimelineTask, 'withTaskId');
+  dart.setSignature(developer.TimelineTask, {
+    constructors: () => ({
+      new: dart.definiteFunctionType(developer.TimelineTask, []),
+      withTaskId: dart.definiteFunctionType(developer.TimelineTask, [core.int])
+    }),
+    fields: () => ({
+      [_taskId]: core.int,
+      [_stack]: ListOf_AsyncBlock()
+    }),
+    methods: () => ({
+      start: dart.definiteFunctionType(dart.void, [core.String], {arguments: core.Map}),
+      instant: dart.definiteFunctionType(dart.void, [core.String], {arguments: core.Map}),
+      finish: dart.definiteFunctionType(dart.void, []),
+      pass: dart.definiteFunctionType(core.int, [])
+    })
+  });
+  const _arguments$ = Symbol('_arguments');
+  developer._AsyncBlock = class _AsyncBlock extends core.Object {
+    _(name, taskId) {
+      this.name = name;
+      this[_taskId] = taskId;
+      this.category = 'Dart';
+      this[_arguments$] = null;
+    }
+    [_start$1]() {
+      developer._reportTaskEvent(developer._getTraceClock(), this[_taskId], 'b', this.category, this.name, developer._argumentsAsJson(this[_arguments$]));
+    }
+    [_finish]() {
+      developer._reportTaskEvent(developer._getTraceClock(), this[_taskId], 'e', this.category, this.name, developer._argumentsAsJson(null));
+    }
+    [_appendArguments](arguments$) {
+      if (this[_arguments$] == null) {
+        this[_arguments$] = dart.map();
+      }
+      this[_arguments$][dartx.addAll](arguments$);
+    }
+  };
+  dart.defineNamedConstructor(developer._AsyncBlock, '_');
+  dart.setSignature(developer._AsyncBlock, {
+    constructors: () => ({_: dart.definiteFunctionType(developer._AsyncBlock, [core.String, core.int])}),
+    fields: () => ({
+      category: core.String,
+      name: core.String,
+      [_taskId]: core.int,
+      [_arguments$]: core.Map
+    }),
+    methods: () => ({
+      [_start$1]: dart.definiteFunctionType(dart.void, []),
+      [_finish]: dart.definiteFunctionType(dart.void, []),
+      [_appendArguments]: dart.definiteFunctionType(dart.void, [core.Map])
+    })
+  });
+  const _startCpu = Symbol('_startCpu');
+  developer._SyncBlock = class _SyncBlock extends core.Object {
+    _(name, start, startCpu) {
+      this.name = name;
+      this[_start$1] = start;
+      this[_startCpu] = startCpu;
+      this.category = 'Dart';
+      this[_arguments$] = null;
+    }
+    finish() {
+      developer._reportCompleteEvent(this[_start$1], this[_startCpu], this.category, this.name, developer._argumentsAsJson(this[_arguments$]));
+    }
+    [_appendArguments](arguments$) {
+      if (arguments$ == null) {
+        return;
+      }
+      if (this[_arguments$] == null) {
+        this[_arguments$] = dart.map();
+      }
+      this[_arguments$][dartx.addAll](arguments$);
+    }
+  };
+  dart.defineNamedConstructor(developer._SyncBlock, '_');
+  dart.setSignature(developer._SyncBlock, {
+    constructors: () => ({_: dart.definiteFunctionType(developer._SyncBlock, [core.String, core.int, core.int])}),
+    fields: () => ({
+      category: core.String,
+      name: core.String,
+      [_arguments$]: core.Map,
+      [_start$1]: core.int,
+      [_startCpu]: core.int
+    }),
+    methods: () => ({
+      finish: dart.definiteFunctionType(dart.void, []),
+      [_appendArguments]: dart.definiteFunctionType(dart.void, [core.Map])
+    })
+  });
+  developer._fastPathArguments = null;
+  developer._argumentsAsJson = function(arguments$) {
+    if (arguments$ == null || arguments$[dartx.length] == 0) {
+      if (developer._fastPathArguments == null) {
+        developer._fastPathArguments = dart.str`{"isolateNumber":"${developer.Timeline._isolateId}"}`;
+      }
+      return developer._fastPathArguments;
+    }
+    arguments$[dartx._set]('isolateNumber', developer.Timeline._isolateIdString);
+    return convert.JSON.encode(arguments$);
+  };
+  dart.fn(developer._argumentsAsJson, MapToString());
+  developer._isDartStreamEnabled = function() {
+    return false;
+  };
+  dart.fn(developer._isDartStreamEnabled, VoidTobool());
+  developer._getNextAsyncId = function() {
+    return 0;
+  };
+  dart.fn(developer._getNextAsyncId, VoidToint());
+  developer._getTraceClock = function() {
+    let x = developer._clockValue;
+    developer._clockValue = dart.notNull(x) + 1;
+    return x;
+  };
+  dart.fn(developer._getTraceClock, VoidToint());
+  developer._getThreadCpuClock = function() {
+    return -1;
+  };
+  dart.fn(developer._getThreadCpuClock, VoidToint());
+  developer._getIsolateNum = function() {
+    return 0;
+  };
+  dart.fn(developer._getIsolateNum, VoidToint());
+  developer._reportTaskEvent = function(start, taskId, phase, category, name, argumentsAsJson) {
+  };
+  dart.fn(developer._reportTaskEvent, intAndintAndString__Tovoid());
+  developer._reportCompleteEvent = function(start, startCpu, category, name, argumentsAsJson) {
+  };
+  dart.fn(developer._reportCompleteEvent, intAndintAndString__Tovoid$());
+  developer._reportInstantEvent = function(start, category, name, argumentsAsJson) {
+  };
+  dart.fn(developer._reportInstantEvent, intAndStringAndString__Tovoid());
+  developer.ServiceProtocolInfo = class ServiceProtocolInfo extends core.Object {
+    new(serverUri) {
+      this.majorVersion = developer._getServiceMajorVersion();
+      this.minorVersion = developer._getServiceMinorVersion();
+      this.serverUri = serverUri;
+    }
+    toString() {
+      if (this.serverUri != null) {
+        return dart.str`Dart VM Service Protocol v${this.majorVersion}.${this.minorVersion} ` + dart.str`listening on ${this.serverUri}`;
+      } else {
+        return dart.str`Dart VM Service Protocol v${this.majorVersion}.${this.minorVersion}`;
+      }
+    }
+  };
+  dart.setSignature(developer.ServiceProtocolInfo, {
+    constructors: () => ({new: dart.definiteFunctionType(developer.ServiceProtocolInfo, [core.Uri])}),
+    fields: () => ({
+      majorVersion: core.int,
+      minorVersion: core.int,
+      serverUri: core.Uri
+    })
+  });
+  developer.Service = class Service extends core.Object {
+    static getInfo() {
+      return dart.async(function*() {
+        let receivePort = isolate.RawReceivePort.new();
+        let uriCompleter = CompleterOfUri().new();
+        receivePort.handler = dart.fn(uri => uriCompleter.complete(uri), UriTovoid());
+        developer._getServerInfo(receivePort.sendPort);
+        let uri = (yield uriCompleter.future);
+        receivePort.close();
+        return new developer.ServiceProtocolInfo(uri);
+      }, developer.ServiceProtocolInfo);
+    }
+    static controlWebServer(opts) {
+      return dart.async(function*(opts) {
+        let enable = opts && 'enable' in opts ? opts.enable : false;
+        if (!(typeof enable == 'boolean')) {
+          dart.throw(new core.ArgumentError.value(enable, 'enable', 'Must be a bool'));
+        }
+        let receivePort = isolate.RawReceivePort.new();
+        let uriCompleter = CompleterOfUri().new();
+        receivePort.handler = dart.fn(uri => uriCompleter.complete(uri), UriTovoid());
+        developer._webServerControl(receivePort.sendPort, enable);
+        let uri = (yield uriCompleter.future);
+        receivePort.close();
+        return new developer.ServiceProtocolInfo(uri);
+      }, developer.ServiceProtocolInfo, opts);
+    }
+  };
+  dart.setSignature(developer.Service, {
+    statics: () => ({
+      getInfo: dart.definiteFunctionType(async.Future$(developer.ServiceProtocolInfo), []),
+      controlWebServer: dart.definiteFunctionType(async.Future$(developer.ServiceProtocolInfo), [], {enable: core.bool})
+    }),
+    names: ['getInfo', 'controlWebServer']
+  });
+  developer._getServerInfo = function(sp) {
+    sp.send(null);
+  };
+  dart.lazyFn(developer._getServerInfo, () => SendPortTovoid());
+  developer._webServerControl = function(sp, enable) {
+    sp.send(null);
+  };
+  dart.lazyFn(developer._webServerControl, () => SendPortAndboolTovoid());
+  developer._getServiceMajorVersion = function() {
+    return 0;
+  };
+  dart.fn(developer._getServiceMajorVersion, VoidToint());
+  developer._getServiceMinorVersion = function() {
+    return 0;
+  };
+  dart.fn(developer._getServiceMinorVersion, VoidToint());
   isolate.IsolateSpawnException = class IsolateSpawnException extends core.Object {
     new(message) {
       this.message = message;
@@ -36190,7 +37249,7 @@
     static spawn(entryPoint, message, opts) {
       let paused = opts && 'paused' in opts ? opts.paused : false;
       try {
-        return _isolate_helper.IsolateNatives.spawnFunction(entryPoint, message, paused).then(isolate.Isolate)(dart.fn(msg => new isolate.Isolate(isolate.SendPort._check(msg[dartx.get](1)), {pauseCapability: isolate.Capability._check(msg[dartx.get](2)), terminateCapability: isolate.Capability._check(msg[dartx.get](3))}), ListToIsolate()));
+        return _isolate_helper.IsolateNatives.spawnFunction(entryPoint, message, paused).then(isolate.Isolate)(dart.fn(msg => new isolate.Isolate(isolate.SendPort._check(msg[dartx._get](1)), {pauseCapability: isolate.Capability._check(msg[dartx._get](2)), terminateCapability: isolate.Capability._check(msg[dartx._get](3))}), ListToIsolate()));
       } catch (e) {
         let st = dart.stackTrace(e);
         return FutureOfIsolate().error(e, st);
@@ -36204,14 +37263,14 @@
       try {
         if (core.List.is(args)) {
           for (let i = 0; i < dart.notNull(args[dartx.length]); i++) {
-            if (!(typeof args[dartx.get](i) == 'string')) {
+            if (!(typeof args[dartx._get](i) == 'string')) {
               dart.throw(new core.ArgumentError(dart.str`Args must be a list of Strings ${args}`));
             }
           }
         } else if (args != null) {
           dart.throw(new core.ArgumentError(dart.str`Args must be a list of Strings ${args}`));
         }
-        return _isolate_helper.IsolateNatives.spawnUri(uri, args, message, paused).then(isolate.Isolate)(dart.fn(msg => new isolate.Isolate(isolate.SendPort._check(msg[dartx.get](1)), {pauseCapability: isolate.Capability._check(msg[dartx.get](2)), terminateCapability: isolate.Capability._check(msg[dartx.get](3))}), ListToIsolate()));
+        return _isolate_helper.IsolateNatives.spawnUri(uri, args, message, paused).then(isolate.Isolate)(dart.fn(msg => new isolate.Isolate(isolate.SendPort._check(msg[dartx._get](1)), {pauseCapability: isolate.Capability._check(msg[dartx._get](2)), terminateCapability: isolate.Capability._check(msg[dartx._get](3))}), ListToIsolate()));
       } catch (e) {
         let st = dart.stackTrace(e);
         return FutureOfIsolate().error(e, st);
@@ -36226,34 +37285,34 @@
     }
     [_pause](resumeCapability) {
       let message = core.List.new(3);
-      message[dartx.set](0, "pause");
-      message[dartx.set](1, this.pauseCapability);
-      message[dartx.set](2, resumeCapability);
+      message[dartx._set](0, "pause");
+      message[dartx._set](1, this.pauseCapability);
+      message[dartx._set](2, resumeCapability);
       this.controlPort.send(message);
     }
     resume(resumeCapability) {
       let message = core.List.new(2);
-      message[dartx.set](0, "resume");
-      message[dartx.set](1, resumeCapability);
+      message[dartx._set](0, "resume");
+      message[dartx._set](1, resumeCapability);
       this.controlPort.send(message);
     }
     addOnExitListener(responsePort) {
       let message = core.List.new(2);
-      message[dartx.set](0, "add-ondone");
-      message[dartx.set](1, responsePort);
+      message[dartx._set](0, "add-ondone");
+      message[dartx._set](1, responsePort);
       this.controlPort.send(message);
     }
     removeOnExitListener(responsePort) {
       let message = core.List.new(2);
-      message[dartx.set](0, "remove-ondone");
-      message[dartx.set](1, responsePort);
+      message[dartx._set](0, "remove-ondone");
+      message[dartx._set](1, responsePort);
       this.controlPort.send(message);
     }
     setErrorsFatal(errorsAreFatal) {
       let message = core.List.new(3);
-      message[dartx.set](0, "set-errors-fatal");
-      message[dartx.set](1, this.terminateCapability);
-      message[dartx.set](2, errorsAreFatal);
+      message[dartx._set](0, "set-errors-fatal");
+      message[dartx._set](1, this.terminateCapability);
+      message[dartx._set](2, errorsAreFatal);
       this.controlPort.send(message);
     }
     kill(priority) {
@@ -36263,21 +37322,21 @@
     ping(responsePort, pingType) {
       if (pingType === void 0) pingType = isolate.Isolate.IMMEDIATE;
       let message = core.List.new(3);
-      message[dartx.set](0, "ping");
-      message[dartx.set](1, responsePort);
-      message[dartx.set](2, pingType);
+      message[dartx._set](0, "ping");
+      message[dartx._set](1, responsePort);
+      message[dartx._set](2, pingType);
       this.controlPort.send(message);
     }
     addErrorListener(port) {
       let message = core.List.new(2);
-      message[dartx.set](0, "getErrors");
-      message[dartx.set](1, port);
+      message[dartx._set](0, "getErrors");
+      message[dartx._set](1, port);
       this.controlPort.send(message);
     }
     removeErrorListener(port) {
       let message = core.List.new(2);
-      message[dartx.set](0, "stopErrors");
-      message[dartx.set](1, port);
+      message[dartx._set](0, "stopErrors");
+      message[dartx._set](1, port);
       this.controlPort.send(message);
     }
     get errors() {
@@ -36468,18 +37527,18 @@
       let _convertedObjects = collection.HashMap.identity();
       function _convert(o) {
         if (dart.test(_convertedObjects.containsKey(o))) {
-          return _convertedObjects.get(o);
+          return _convertedObjects._get(o);
         }
         if (core.Map.is(o)) {
           let convertedMap = {};
-          _convertedObjects.set(o, convertedMap);
+          _convertedObjects._set(o, convertedMap);
           for (let key of o[dartx.keys]) {
-            convertedMap[key] = _convert(o[dartx.get](key));
+            convertedMap[key] = _convert(o[dartx._get](key));
           }
           return convertedMap;
         } else if (core.Iterable.is(o)) {
           let convertedList = [];
-          _convertedObjects.set(o, convertedList);
+          _convertedObjects._set(o, convertedList);
           convertedList[dartx.addAll](o[dartx.map](dart.dynamic)(_convert));
           return convertedList;
         } else {
@@ -36489,13 +37548,13 @@
       dart.fn(_convert, dynamicTodynamic$());
       return _convert(data);
     }
-    get(property) {
+    _get(property) {
       if (!(typeof property == 'string') && !(typeof property == 'number')) {
         dart.throw(new core.ArgumentError("property is not a String or num"));
       }
       return js._convertToDart(this[_jsObject][property]);
     }
-    set(property, value) {
+    _set(property, value) {
       if (!(typeof property == 'string') && !(typeof property == 'number')) {
         dart.throw(new core.ArgumentError("property is not a String or num"));
       }
@@ -36554,8 +37613,8 @@
     }),
     fields: () => ({[_jsObject]: dart.dynamic}),
     methods: () => ({
-      get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
-      set: dart.definiteFunctionType(dart.dynamic, [core.Object, dart.dynamic]),
+      _get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
+      _set: dart.definiteFunctionType(dart.dynamic, [core.Object, dart.dynamic]),
       hasProperty: dart.definiteFunctionType(core.bool, [dart.dynamic]),
       deleteProperty: dart.definiteFunctionType(dart.void, [dart.dynamic]),
       instanceof: dart.definiteFunctionType(core.bool, [js.JsFunction]),
@@ -36629,18 +37688,18 @@
           dart.throw(new core.RangeError.range(end, start, length));
         }
       }
-      get(index) {
+      _get(index) {
         if (typeof index == 'number' && index == index[dartx.toInt]()) {
           this[_checkIndex](dart.asInt(index));
         }
-        return E.as(super.get(index));
+        return E.as(super._get(index));
       }
-      set(index, value) {
+      _set(index, value) {
         E._check(value);
         if (typeof index == 'number' && index == index[dartx.toInt]()) {
           this[_checkIndex](dart.asInt(index));
         }
-        super.set(index, value);
+        super._set(index, value);
         return value;
       }
       get length() {
@@ -36651,7 +37710,7 @@
         dart.throw(new core.StateError('Bad JsArray length'));
       }
       set length(length) {
-        super.set('length', length);
+        super._set('length', length);
       }
       add(value) {
         E._check(value);
@@ -36709,8 +37768,8 @@
       methods: () => ({
         [_checkIndex]: dart.definiteFunctionType(dart.dynamic, [core.int]),
         [_checkInsertIndex]: dart.definiteFunctionType(dart.dynamic, [core.int]),
-        get: dart.definiteFunctionType(E, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [core.Object, E]),
+        _get: dart.definiteFunctionType(E, [core.Object]),
+        _set: dart.definiteFunctionType(dart.void, [core.Object, E]),
         add: dart.definiteFunctionType(dart.void, [E]),
         addAll: dart.definiteFunctionType(dart.void, [IterableOfE()]),
         insert: dart.definiteFunctionType(dart.void, [core.int, E]),
@@ -36723,8 +37782,8 @@
       names: ['_checkRange']
     });
     dart.defineExtensionMembers(JsArray, [
-      'get',
-      'set',
+      '_get',
+      '_set',
       'add',
       'addAll',
       'insert',
@@ -36772,7 +37831,7 @@
       let args = Array.prototype.map.call(arguments, js._convertToDart);
       return js._convertToJS(f(...args));
     };
-    dart.dsetindex(js._dartProxies, wrapper, f);
+    js._dartProxies.set(wrapper, f);
     return wrapper;
   };
   dart.fn(js._wrapDartFunction, dynamicTodynamic$());
@@ -36831,7 +37890,7 @@
     set _interopCaptureThisExpando(_) {}
   });
   js.allowInteropCaptureThis = function(f) {
-    let ret = js._interopCaptureThisExpando.get(f);
+    let ret = js._interopCaptureThisExpando._get(f);
     if (ret == null) {
       ret = function() {
         let args = [this];
@@ -36840,7 +37899,7 @@
         }
         return f(...args);
       };
-      js._interopCaptureThisExpando.set(f, ret);
+      js._interopCaptureThisExpando._set(f, ret);
     }
     return ret;
   };
@@ -36856,18 +37915,18 @@
     let _convertedObjects = collection.HashMap.identity();
     function _convert(o) {
       if (dart.test(_convertedObjects.containsKey(o))) {
-        return _convertedObjects.get(o);
+        return _convertedObjects._get(o);
       }
       if (core.Map.is(o)) {
         let convertedMap = {};
-        _convertedObjects.set(o, convertedMap);
+        _convertedObjects._set(o, convertedMap);
         for (let key of o[dartx.keys]) {
-          convertedMap[key] = _convert(o[dartx.get](key));
+          convertedMap[key] = _convert(o[dartx._get](key));
         }
         return convertedMap;
       } else if (core.Iterable.is(o)) {
         let convertedList = [];
-        _convertedObjects.set(o, convertedList);
+        _convertedObjects._set(o, convertedList);
         convertedList[dartx.addAll](o[dartx.map](dart.dynamic)(_convert));
         return convertedList;
       } else {
@@ -36958,40 +38017,13 @@
   math.SQRT2 = 1.4142135623730951;
   math.min = function(T) {
     return (a, b) => {
-      if (!(typeof a == 'number')) dart.throw(new core.ArgumentError(a));
-      if (!(typeof b == 'number')) dart.throw(new core.ArgumentError(b));
-      if (dart.notNull(a) > dart.notNull(b)) return b;
-      if (dart.notNull(a) < dart.notNull(b)) return a;
-      if (typeof b == 'number') {
-        if (typeof a == 'number') {
-          if (a == 0.0) {
-            return (dart.notNull(a) + dart.notNull(b)) * dart.notNull(a) * dart.notNull(b);
-          }
-        }
-        if (a == 0 && dart.test(b[dartx.isNegative]) || dart.test(b[dartx.isNaN])) return b;
-        return a;
-      }
-      return a;
+      return Math.min(_js_helper.checkNum(a), _js_helper.checkNum(b));
     };
   };
   dart.fn(math.min, TAndTToT());
   math.max = function(T) {
     return (a, b) => {
-      if (!(typeof a == 'number')) dart.throw(new core.ArgumentError(a));
-      if (!(typeof b == 'number')) dart.throw(new core.ArgumentError(b));
-      if (dart.notNull(a) > dart.notNull(b)) return a;
-      if (dart.notNull(a) < dart.notNull(b)) return b;
-      if (typeof b == 'number') {
-        if (typeof a == 'number') {
-          if (a == 0.0) {
-            return dart.notNull(a) + dart.notNull(b);
-          }
-        }
-        if (dart.test(b[dartx.isNaN])) return b;
-        return a;
-      }
-      if (b == 0 && dart.test(a[dartx.isNegative])) return b;
-      return a;
+      return Math.max(_js_helper.checkNum(a), _js_helper.checkNum(b));
     };
   };
   dart.fn(math.max, TAndTToT$());
@@ -37408,7 +38440,8 @@
       }
       ['=='](other) {
         if (!RectangleOfnum().is(other)) return false;
-        return dart.equals(this[dartx.left], dart.dload(other, 'left')) && dart.equals(this[dartx.top], dart.dload(other, 'top')) && dart.equals(this[dartx.right], dart.dload(other, 'right')) && dart.equals(this[dartx.bottom], dart.dload(other, 'bottom'));
+        let otherRect = RectangleOfnum().as(other);
+        return this[dartx.left] == otherRect[dartx.left] && this[dartx.top] == otherRect[dartx.top] && this[dartx.right] == otherRect[dartx.right] && this[dartx.bottom] == otherRect[dartx.bottom];
       }
       get hashCode() {
         return math._JenkinsSmiHash.hash4(dart.hashCode(this[dartx.left]), dart.hashCode(this[dartx.top]), dart.hashCode(this[dartx.right]), dart.hashCode(this[dartx.bottom]));
@@ -37504,11 +38537,35 @@
       'height'
     ]);
     class Rectangle extends math._RectangleBase$(T) {
+      get left() {
+        return this[left$];
+      }
+      set left(value) {
+        super.left = value;
+      }
+      get top() {
+        return this[top$];
+      }
+      set top(value) {
+        super.top = value;
+      }
+      get width() {
+        return this[width$];
+      }
+      set width(value) {
+        super.width = value;
+      }
+      get height() {
+        return this[height$];
+      }
+      set height(value) {
+        super.height = value;
+      }
       new(left, top, width, height) {
-        this[dartx.left] = left;
-        this[dartx.top] = top;
-        this[dartx.width] = dart.notNull(width) < 0 ? -dart.notNull(width) * 0 : width;
-        this[dartx.height] = dart.notNull(height) < 0 ? -dart.notNull(height) * 0 : height;
+        this[left$] = left;
+        this[top$] = top;
+        this[width$] = dart.notNull(width) < 0 ? -dart.notNull(width) * 0 : width;
+        this[height$] = dart.notNull(height) < 0 ? -dart.notNull(height) * 0 : height;
         super.new();
       }
       static fromPoints(a, b) {
@@ -37519,6 +38576,10 @@
         return new (RectangleOfT())(left, top, width, height);
       }
     }
+    const left$ = Symbol(Rectangle.name + "." + 'left'.toString());
+    const top$ = Symbol(Rectangle.name + "." + 'top'.toString());
+    const width$ = Symbol(Rectangle.name + "." + 'width'.toString());
+    const height$ = Symbol(Rectangle.name + "." + 'height'.toString());
     dart.setSignature(Rectangle, {
       constructors: () => ({
         new: dart.definiteFunctionType(math.Rectangle$(T), [T, T, T, T]),
@@ -37542,9 +38603,21 @@
     let RectangleOfT = () => (RectangleOfT = dart.constFn(math.Rectangle$(T)))();
     let PointOfT = () => (PointOfT = dart.constFn(math.Point$(T)))();
     class MutableRectangle extends math._RectangleBase$(T) {
+      get left() {
+        return this[left$];
+      }
+      set left(value) {
+        this[left$] = value;
+      }
+      get top() {
+        return this[top$];
+      }
+      set top(value) {
+        this[top$] = value;
+      }
       new(left, top, width, height) {
-        this.left = left;
-        this.top = top;
+        this[left$] = left;
+        this[top$] = top;
         this[_width] = dart.notNull(width) < 0 ? math._clampToZero(T)(width) : width;
         this[_height] = dart.notNull(height) < 0 ? math._clampToZero(T)(height) : height;
         super.new();
@@ -37573,6 +38646,8 @@
         this[_height] = height;
       }
     }
+    const left$ = Symbol(MutableRectangle.name + "." + 'left'.toString());
+    const top$ = Symbol(MutableRectangle.name + "." + 'top'.toString());
     MutableRectangle[dart.implements] = () => [RectangleOfT()];
     dart.setSignature(MutableRectangle, {
       constructors: () => ({
@@ -38151,7 +39226,7 @@
       if (dart.test(html_common.isJavaScriptDate(object))) return true;
       if (core.List.is(object)) {
         for (let i = 0; i < dart.notNull(object[dartx.length]); i++) {
-          if (dart.test(containsDate(object[dartx.get](i)))) return true;
+          if (dart.test(containsDate(object[dartx._get](i)))) return true;
         }
       }
       return false;
@@ -38230,21 +39305,21 @@
     get [dartx.source]() {
       return this.source;
     }
-    [dartx.advance](count) {
-      return this.advance(count);
+    [dartx.advance](...args) {
+      return this.advance.apply(this, args);
     }
-    [dartx.continuePrimaryKey](key, primaryKey) {
-      return this.continuePrimaryKey(key, primaryKey);
+    [dartx.continuePrimaryKey](...args) {
+      return this.continuePrimaryKey.apply(this, args);
     }
-    [_delete]() {
-      return this.delete();
+    [_delete](...args) {
+      return this.delete.apply(this, args);
     }
     [_update](value) {
       let value_1 = html_common.convertDartToNative_SerializedScriptValue(value);
       return this[_update_1](value_1);
     }
-    [_update_1](value) {
-      return this.update(value);
+    [_update_1](...args) {
+      return this.update.apply(this, args);
     }
   };
   dart.setSignature(indexed_db.Cursor, {
@@ -38322,14 +39397,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [_addEventListener](type, listener, capture) {
-      return this.addEventListener(type, listener, capture);
+    [_addEventListener](...args) {
+      return this.addEventListener.apply(this, args);
     }
-    [dartx.dispatchEvent](event) {
-      return this.dispatchEvent(event);
+    [dartx.dispatchEvent](...args) {
+      return this.dispatchEvent.apply(this, args);
     }
-    [_removeEventListener](type, listener, capture) {
-      return this.removeEventListener(type, listener, capture);
+    [_removeEventListener](...args) {
+      return this.removeEventListener.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.EventTarget, '_created');
@@ -38370,10 +39445,10 @@
       let autoIncrement = opts && 'autoIncrement' in opts ? opts.autoIncrement : null;
       let options = dart.map();
       if (keyPath != null) {
-        options[dartx.set]('keyPath', keyPath);
+        options[dartx._set]('keyPath', keyPath);
       }
       if (autoIncrement != null) {
-        options[dartx.set]('autoIncrement', autoIncrement);
+        options[dartx._set]('autoIncrement', autoIncrement);
       }
       return this[_createObjectStore](name, options);
     }
@@ -38402,8 +39477,8 @@
       }
       return this[_transaction](storeNames, mode);
     }
-    [_transaction](stores, mode) {
-      return this.transaction(stores, mode);
+    [_transaction](...args) {
+      return this.transaction.apply(this, args);
     }
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
@@ -38417,8 +39492,8 @@
     get [dartx.version]() {
       return this.version;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
     [_createObjectStore](name, options) {
       if (options === void 0) options = null;
@@ -38428,14 +39503,14 @@
       }
       return this[_createObjectStore_2](name);
     }
-    [_createObjectStore_1](name, options) {
-      return this.createObjectStore(name, options);
+    [_createObjectStore_1](...args) {
+      return this.createObjectStore.apply(this, args);
     }
-    [_createObjectStore_2](name) {
-      return this.createObjectStore(name);
+    [_createObjectStore_2](...args) {
+      return this.createObjectStore.apply(this, args);
     }
-    [dartx.deleteObjectStore](name) {
-      return this.deleteObjectStore(name);
+    [dartx.deleteObjectStore](...args) {
+      return this.deleteObjectStore.apply(this, args);
     }
     get [dartx.onAbort]() {
       return indexed_db.Database.abortEvent.forTarget(this);
@@ -38574,17 +39649,17 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.cmp](first, second) {
-      return this.cmp(first, second);
+    [dartx.cmp](...args) {
+      return this.cmp.apply(this, args);
     }
-    [_deleteDatabase](name) {
-      return this.deleteDatabase(name);
+    [_deleteDatabase](...args) {
+      return this.deleteDatabase.apply(this, args);
     }
-    [_open](name, version) {
-      return this.open(name, version);
+    [_open](...args) {
+      return this.open.apply(this, args);
     }
-    [_webkitGetDatabaseNames]() {
-      return this.webkitGetDatabaseNames();
+    [_webkitGetDatabaseNames](...args) {
+      return this.webkitGetDatabaseNames.apply(this, args);
     }
   };
   dart.setSignature(indexed_db.IdbFactory, {
@@ -38727,26 +39802,26 @@
     get [dartx.unique]() {
       return this.unique;
     }
-    [_count$0](key) {
-      return this.count(key);
+    [_count$0](...args) {
+      return this.count.apply(this, args);
     }
-    [_get$](key) {
-      return this.get(key);
+    [_get$](...args) {
+      return this.get.apply(this, args);
     }
-    [dartx.getAll](range, maxCount) {
-      return this.getAll(range, maxCount);
+    [dartx.getAll](...args) {
+      return this.getAll.apply(this, args);
     }
-    [dartx.getAllKeys](range, maxCount) {
-      return this.getAllKeys(range, maxCount);
+    [dartx.getAllKeys](...args) {
+      return this.getAllKeys.apply(this, args);
     }
-    [_getKey$](key) {
-      return this.getKey(key);
+    [_getKey$](...args) {
+      return this.getKey.apply(this, args);
     }
-    [_openCursor](range, direction) {
-      return this.openCursor(range, direction);
+    [_openCursor](...args) {
+      return this.openCursor.apply(this, args);
     }
-    [_openKeyCursor](range, direction) {
-      return this.openKeyCursor(range, direction);
+    [_openKeyCursor](...args) {
+      return this.openKeyCursor.apply(this, args);
     }
   };
   dart.setSignature(indexed_db.Index, {
@@ -38965,10 +40040,10 @@
       let multiEntry = opts && 'multiEntry' in opts ? opts.multiEntry : null;
       let options = dart.map();
       if (unique != null) {
-        options[dartx.set]('unique', unique);
+        options[dartx._set]('unique', unique);
       }
       if (multiEntry != null) {
-        options[dartx.set]('multiEntry', multiEntry);
+        options[dartx._set]('multiEntry', multiEntry);
       }
       return this[_createIndex](name, keyPath, options);
     }
@@ -39000,17 +40075,17 @@
       let value_1 = html_common.convertDartToNative_SerializedScriptValue(value);
       return this[_add_2](value_1);
     }
-    [_add_1](value, key) {
-      return this.add(value, key);
+    [_add_1](...args) {
+      return this.add.apply(this, args);
     }
-    [_add_2](value) {
-      return this.add(value);
+    [_add_2](...args) {
+      return this.add.apply(this, args);
     }
-    [_clear$0]() {
-      return this.clear();
+    [_clear$0](...args) {
+      return this.clear.apply(this, args);
     }
-    [_count$0](key) {
-      return this.count(key);
+    [_count$0](...args) {
+      return this.count.apply(this, args);
     }
     [_createIndex](name, keyPath, options) {
       if (options === void 0) options = null;
@@ -39020,35 +40095,35 @@
       }
       return this[_createIndex_2](name, keyPath);
     }
-    [_createIndex_1](name, keyPath, options) {
-      return this.createIndex(name, keyPath, options);
+    [_createIndex_1](...args) {
+      return this.createIndex.apply(this, args);
     }
-    [_createIndex_2](name, keyPath) {
-      return this.createIndex(name, keyPath);
+    [_createIndex_2](...args) {
+      return this.createIndex.apply(this, args);
     }
-    [_delete](key) {
-      return this.delete(key);
+    [_delete](...args) {
+      return this.delete.apply(this, args);
     }
-    [dartx.deleteIndex](name) {
-      return this.deleteIndex(name);
+    [dartx.deleteIndex](...args) {
+      return this.deleteIndex.apply(this, args);
     }
-    [_get$](key) {
-      return this.get(key);
+    [_get$](...args) {
+      return this.get.apply(this, args);
     }
-    [dartx.getAll](range, maxCount) {
-      return this.getAll(range, maxCount);
+    [dartx.getAll](...args) {
+      return this.getAll.apply(this, args);
     }
-    [dartx.getAllKeys](range, maxCount) {
-      return this.getAllKeys(range, maxCount);
+    [dartx.getAllKeys](...args) {
+      return this.getAllKeys.apply(this, args);
     }
-    [dartx.index](name) {
-      return this.index(name);
+    [dartx.index](...args) {
+      return this.index.apply(this, args);
     }
-    [_openCursor](range, direction) {
-      return this.openCursor(range, direction);
+    [_openCursor](...args) {
+      return this.openCursor.apply(this, args);
     }
-    [dartx.openKeyCursor](range, direction) {
-      return this.openKeyCursor(range, direction);
+    [dartx.openKeyCursor](...args) {
+      return this.openKeyCursor.apply(this, args);
     }
     [_put](value, key) {
       if (key === void 0) key = null;
@@ -39060,11 +40135,11 @@
       let value_1 = html_common.convertDartToNative_SerializedScriptValue(value);
       return this[_put_2](value_1);
     }
-    [_put_1](value, key) {
-      return this.put(value, key);
+    [_put_1](...args) {
+      return this.put.apply(this, args);
     }
-    [_put_2](value) {
-      return this.put(value);
+    [_put_2](...args) {
+      return this.put.apply(this, args);
     }
     static _cursorStreamFromResult(T) {
       return (request, autoAdvance) => {
@@ -39235,6 +40310,7 @@
     }
   });
   dart.registerExtension(dart.global.IDBOpenDBRequest, indexed_db.OpenDBRequest);
+  dart.registerExtension(dart.global.IDBVersionChangeRequest, indexed_db.OpenDBRequest);
   dart.defineExtensionNames([
     'completed',
     'abort',
@@ -39278,11 +40354,11 @@
     get [dartx.objectStoreNames]() {
       return this.objectStoreNames;
     }
-    [dartx.abort]() {
-      return this.abort();
+    [dartx.abort](...args) {
+      return this.abort.apply(this, args);
     }
-    [dartx.objectStore](name) {
-      return this.objectStore(name);
+    [dartx.objectStore](...args) {
+      return this.objectStore.apply(this, args);
     }
     get [dartx.onAbort]() {
       return indexed_db.Transaction.abortEvent.forTarget(this);
@@ -39429,17 +40505,17 @@
     get [dartx.type]() {
       return this.type;
     }
-    [_initEvent](type, bubbles, cancelable) {
-      return this.initEvent(type, bubbles, cancelable);
+    [_initEvent](...args) {
+      return this.initEvent.apply(this, args);
     }
-    [dartx.preventDefault]() {
-      return this.preventDefault();
+    [dartx.preventDefault](...args) {
+      return this.preventDefault.apply(this, args);
     }
-    [dartx.stopImmediatePropagation]() {
-      return this.stopImmediatePropagation();
+    [dartx.stopImmediatePropagation](...args) {
+      return this.stopImmediatePropagation.apply(this, args);
     }
-    [dartx.stopPropagation]() {
-      return this.stopPropagation();
+    [dartx.stopPropagation](...args) {
+      return this.stopPropagation.apply(this, args);
     }
   };
   dart.setSignature(html$.Event, {
@@ -39486,6 +40562,7 @@
   html$.Event.BUBBLING_PHASE = 3;
   html$.Event.CAPTURING_PHASE = 1;
   dart.registerExtension(dart.global.Event, html$.Event);
+  dart.registerExtension(dart.global.InputEvent, html$.Event);
   dart.defineExtensionNames([
     'dataLoss',
     'dataLossMessage',
@@ -39739,26 +40816,26 @@
     set [dartx.text](value) {
       this.textContent = value;
     }
-    [dartx.append](node) {
-      return this.appendChild(node);
+    [dartx.append](...args) {
+      return this.appendChild.apply(this, args);
     }
-    [dartx.clone](deep) {
-      return this.cloneNode(deep);
+    [dartx.clone](...args) {
+      return this.cloneNode.apply(this, args);
     }
-    [dartx.contains](other) {
-      return this.contains(other);
+    [dartx.contains](...args) {
+      return this.contains.apply(this, args);
     }
-    [dartx.hasChildNodes]() {
-      return this.hasChildNodes();
+    [dartx.hasChildNodes](...args) {
+      return this.hasChildNodes.apply(this, args);
     }
-    [dartx.insertBefore](node, child) {
-      return this.insertBefore(node, child);
+    [dartx.insertBefore](...args) {
+      return this.insertBefore.apply(this, args);
     }
-    [_removeChild](child) {
-      return this.removeChild(child);
+    [_removeChild](...args) {
+      return this.removeChild.apply(this, args);
     }
-    [_replaceChild](node, child) {
-      return this.replaceChild(node, child);
+    [_replaceChild](...args) {
+      return this.replaceChild.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.Node, '_created');
@@ -40145,7 +41222,7 @@
       let attributes = this[dartx.attributes];
       attributes[dartx.clear]();
       for (let key of value[dartx.keys]) {
-        attributes[dartx.set](key, value[dartx.get](key));
+        attributes[dartx._set](key, value[dartx._get](key));
       }
     }
     get [dartx.children]() {
@@ -40185,7 +41262,7 @@
       let data = this[dartx.dataset];
       data[dartx.clear]();
       for (let key of value[dartx.keys]) {
-        data[dartx.set](key, value[dartx.get](key));
+        data[dartx._set](key, value[dartx._get](key));
       }
     }
     [dartx.getNamespacedAttributes](namespace) {
@@ -40238,8 +41315,8 @@
       let convertedTiming = core.Map.is(timing) ? html_common.convertDartToNative_Dictionary(timing) : timing;
       return convertedTiming == null ? this[_animate](convertedFrames) : this[_animate](convertedFrames, convertedTiming);
     }
-    [_animate](effect, timing) {
-      return this.animate(effect, timing);
+    [_animate](...args) {
+      return this.animate.apply(this, args);
     }
     [dartx.attributeChanged](name, oldValue, newValue) {}
     get [_xtag]() {
@@ -40299,8 +41376,8 @@
         this[_insertAdjacentNode](where, html$.Text.new(text));
       }
     }
-    [_insertAdjacentText](where, text) {
-      return this.insertAdjacentText(where, text);
+    [_insertAdjacentText](...args) {
+      return this.insertAdjacentText.apply(this, args);
     }
     [dartx.insertAdjacentHtml](where, html, opts) {
       let validator = opts && 'validator' in opts ? opts.validator : null;
@@ -40311,8 +41388,8 @@
         this[_insertAdjacentNode](where, this[dartx.createFragment](html, {validator: validator, treeSanitizer: treeSanitizer}));
       }
     }
-    [_insertAdjacentHtml](where, text) {
-      return this.insertAdjacentHTML(where, text);
+    [_insertAdjacentHtml](...args) {
+      return this.insertAdjacentHTML.apply(this, args);
     }
     [dartx.insertAdjacentElement](where, element) {
       if (!!this.insertAdjacentElement) {
@@ -40322,8 +41399,8 @@
       }
       return element;
     }
-    [_insertAdjacentElement](where, element) {
-      return this.insertAdjacentElement(where, element);
+    [_insertAdjacentElement](...args) {
+      return this.insertAdjacentElement.apply(this, args);
     }
     [_insertAdjacentNode](where, node) {
       switch (where[dartx.toLowerCase]()) {
@@ -40334,7 +41411,7 @@
         }
         case 'afterbegin':
         {
-          let first = dart.notNull(this[dartx.nodes][dartx.length]) > 0 ? this[dartx.nodes][dartx.get](0) : null;
+          let first = dart.notNull(this[dartx.nodes][dartx.length]) > 0 ? this[dartx.nodes][dartx._get](0) : null;
           this[dartx.insertBefore](node, first);
           break;
         }
@@ -40637,14 +41714,14 @@
     set [dartx.dropzone](value) {
       this.webkitdropzone = value;
     }
-    [dartx.blur]() {
-      return this.blur();
+    [dartx.blur](...args) {
+      return this.blur.apply(this, args);
     }
-    [dartx.click]() {
-      return this.click();
+    [dartx.click](...args) {
+      return this.click.apply(this, args);
     }
-    [dartx.focus]() {
-      return this.focus();
+    [dartx.focus](...args) {
+      return this.focus.apply(this, args);
     }
     get [_attributes$]() {
       return this.attributes;
@@ -40709,50 +41786,50 @@
     get [dartx.tagName]() {
       return this.tagName;
     }
-    [dartx.closest](selectors) {
-      return this.closest(selectors);
+    [dartx.closest](...args) {
+      return this.closest.apply(this, args);
     }
-    [dartx.getAnimations]() {
-      return this.getAnimations();
+    [dartx.getAnimations](...args) {
+      return this.getAnimations.apply(this, args);
     }
-    [dartx.getAttribute](name) {
-      return this.getAttribute(name);
+    [dartx.getAttribute](...args) {
+      return this.getAttribute.apply(this, args);
     }
-    [dartx.getAttributeNS](namespaceURI, localName) {
-      return this.getAttributeNS(namespaceURI, localName);
+    [dartx.getAttributeNS](...args) {
+      return this.getAttributeNS.apply(this, args);
     }
-    [dartx.getBoundingClientRect]() {
-      return this.getBoundingClientRect();
+    [dartx.getBoundingClientRect](...args) {
+      return this.getBoundingClientRect.apply(this, args);
     }
-    [dartx.getClientRects]() {
-      return this.getClientRects();
+    [dartx.getClientRects](...args) {
+      return this.getClientRects.apply(this, args);
     }
-    [dartx.getDestinationInsertionPoints]() {
-      return this.getDestinationInsertionPoints();
+    [dartx.getDestinationInsertionPoints](...args) {
+      return this.getDestinationInsertionPoints.apply(this, args);
     }
-    [dartx.getElementsByClassName](classNames) {
-      return this.getElementsByClassName(classNames);
+    [dartx.getElementsByClassName](...args) {
+      return this.getElementsByClassName.apply(this, args);
     }
-    [_getElementsByTagName](localName) {
-      return this.getElementsByTagName(localName);
+    [_getElementsByTagName](...args) {
+      return this.getElementsByTagName.apply(this, args);
     }
-    [_hasAttribute](name) {
-      return this.hasAttribute(name);
+    [_hasAttribute](...args) {
+      return this.hasAttribute.apply(this, args);
     }
-    [_hasAttributeNS](namespaceURI, localName) {
-      return this.hasAttributeNS(namespaceURI, localName);
+    [_hasAttributeNS](...args) {
+      return this.hasAttributeNS.apply(this, args);
     }
-    [_removeAttribute](name) {
-      return this.removeAttribute(name);
+    [_removeAttribute](...args) {
+      return this.removeAttribute.apply(this, args);
     }
-    [_removeAttributeNS](namespaceURI, localName) {
-      return this.removeAttributeNS(namespaceURI, localName);
+    [_removeAttributeNS](...args) {
+      return this.removeAttributeNS.apply(this, args);
     }
-    [dartx.requestFullscreen]() {
-      return this.requestFullscreen();
+    [dartx.requestFullscreen](...args) {
+      return this.requestFullscreen.apply(this, args);
     }
-    [dartx.requestPointerLock]() {
-      return this.requestPointerLock();
+    [dartx.requestPointerLock](...args) {
+      return this.requestPointerLock.apply(this, args);
     }
     [dartx.scroll](options_OR_x, y) {
       if (options_OR_x === void 0) options_OR_x = null;
@@ -40772,14 +41849,14 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_scroll_1]() {
-      return this.scroll();
+    [_scroll_1](...args) {
+      return this.scroll.apply(this, args);
     }
-    [_scroll_2](options) {
-      return this.scroll(options);
+    [_scroll_2](...args) {
+      return this.scroll.apply(this, args);
     }
-    [_scroll_3](x, y) {
-      return this.scroll(x, y);
+    [_scroll_3](...args) {
+      return this.scroll.apply(this, args);
     }
     [dartx.scrollBy](options_OR_x, y) {
       if (options_OR_x === void 0) options_OR_x = null;
@@ -40799,20 +41876,20 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_scrollBy_1]() {
-      return this.scrollBy();
+    [_scrollBy_1](...args) {
+      return this.scrollBy.apply(this, args);
     }
-    [_scrollBy_2](options) {
-      return this.scrollBy(options);
+    [_scrollBy_2](...args) {
+      return this.scrollBy.apply(this, args);
     }
-    [_scrollBy_3](x, y) {
-      return this.scrollBy(x, y);
+    [_scrollBy_3](...args) {
+      return this.scrollBy.apply(this, args);
     }
-    [_scrollIntoView](alignWithTop) {
-      return this.scrollIntoView(alignWithTop);
+    [_scrollIntoView](...args) {
+      return this.scrollIntoView.apply(this, args);
     }
-    [_scrollIntoViewIfNeeded](centerIfNeeded) {
-      return this.scrollIntoViewIfNeeded(centerIfNeeded);
+    [_scrollIntoViewIfNeeded](...args) {
+      return this.scrollIntoViewIfNeeded.apply(this, args);
     }
     [dartx.scrollTo](options_OR_x, y) {
       if (options_OR_x === void 0) options_OR_x = null;
@@ -40832,26 +41909,26 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_scrollTo_1]() {
-      return this.scrollTo();
+    [_scrollTo_1](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [_scrollTo_2](options) {
-      return this.scrollTo(options);
+    [_scrollTo_2](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [_scrollTo_3](x, y) {
-      return this.scrollTo(x, y);
+    [_scrollTo_3](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [dartx.setAttribute](name, value) {
-      return this.setAttribute(name, value);
+    [dartx.setAttribute](...args) {
+      return this.setAttribute.apply(this, args);
     }
-    [dartx.setAttributeNS](namespaceURI, name, value) {
-      return this.setAttributeNS(namespaceURI, name, value);
+    [dartx.setAttributeNS](...args) {
+      return this.setAttributeNS.apply(this, args);
     }
-    [dartx.after](nodes) {
-      return this.after(nodes);
+    [dartx.after](...args) {
+      return this.after.apply(this, args);
     }
-    [dartx.before](nodes) {
-      return this.before(nodes);
+    [dartx.before](...args) {
+      return this.before.apply(this, args);
     }
     get [dartx.nextElementSibling]() {
       return this.nextElementSibling;
@@ -40871,11 +41948,11 @@
     get [_lastElementChild]() {
       return this.lastElementChild;
     }
-    [dartx.querySelector](selectors) {
-      return this.querySelector(selectors);
+    [dartx.querySelector](...args) {
+      return this.querySelector.apply(this, args);
     }
-    [_querySelectorAll](selectors) {
-      return this.querySelectorAll(selectors);
+    [_querySelectorAll](...args) {
+      return this.querySelectorAll.apply(this, args);
     }
     get [dartx.onAbort]() {
       return html$.Element.abortEvent.forElement(this);
@@ -41931,20 +43008,20 @@
     set [dartx.startTime](value) {
       this.startTime = value;
     }
-    [dartx.cancel]() {
-      return this.cancel();
+    [dartx.cancel](...args) {
+      return this.cancel.apply(this, args);
     }
-    [dartx.finish]() {
-      return this.finish();
+    [dartx.finish](...args) {
+      return this.finish.apply(this, args);
     }
-    [dartx.pause]() {
-      return this.pause();
+    [dartx.pause](...args) {
+      return this.pause.apply(this, args);
     }
-    [dartx.play]() {
-      return this.play();
+    [dartx.play](...args) {
+      return this.play.apply(this, args);
     }
-    [dartx.reverse]() {
-      return this.reverse();
+    [dartx.reverse](...args) {
+      return this.reverse.apply(this, args);
     }
   };
   dart.setSignature(html$.Animation, {
@@ -42195,11 +43272,11 @@
     set [dartx.playbackRate](value) {
       this.playbackRate = value;
     }
-    [dartx.getAnimations]() {
-      return this.getAnimations();
+    [dartx.getAnimations](...args) {
+      return this.getAnimations.apply(this, args);
     }
-    [dartx.play](source) {
-      return this.play(source);
+    [dartx.play](...args) {
+      return this.play.apply(this, args);
     }
   };
   dart.setSignature(html$.AnimationTimeline, {
@@ -42261,14 +43338,14 @@
     get [dartx.status]() {
       return this.status;
     }
-    [dartx.abort]() {
-      return this.abort();
+    [dartx.abort](...args) {
+      return this.abort.apply(this, args);
     }
-    [dartx.swapCache]() {
-      return this.swapCache();
+    [dartx.swapCache](...args) {
+      return this.swapCache.apply(this, args);
     }
-    [dartx.update]() {
-      return this.update();
+    [dartx.update](...args) {
+      return this.update.apply(this, args);
     }
     get [dartx.onCached]() {
       return html$.ApplicationCache.cachedEvent.forTarget(this);
@@ -42364,6 +43441,8 @@
     }
   });
   dart.registerExtension(dart.global.ApplicationCache, html$.ApplicationCache);
+  dart.registerExtension(dart.global.DOMApplicationCache, html$.ApplicationCache);
+  dart.registerExtension(dart.global.OfflineResourceList, html$.ApplicationCache);
   dart.defineExtensionNames([
     'message',
     'reason',
@@ -42813,35 +43892,35 @@
     get [dartx.videoDecodedByteCount]() {
       return this.webkitVideoDecodedByteCount;
     }
-    [dartx.addTextTrack](kind, label, language) {
-      return this.addTextTrack(kind, label, language);
+    [dartx.addTextTrack](...args) {
+      return this.addTextTrack.apply(this, args);
     }
-    [dartx.canPlayType](type, keySystem) {
-      return this.canPlayType(type, keySystem);
+    [dartx.canPlayType](...args) {
+      return this.canPlayType.apply(this, args);
     }
-    [dartx.load]() {
-      return this.load();
+    [dartx.load](...args) {
+      return this.load.apply(this, args);
     }
-    [dartx.pause]() {
-      return this.pause();
+    [dartx.pause](...args) {
+      return this.pause.apply(this, args);
     }
-    [dartx.play]() {
-      return this.play();
+    [dartx.play](...args) {
+      return this.play.apply(this, args);
     }
-    [dartx.setMediaKeys](mediaKeys) {
-      return this.setMediaKeys(mediaKeys);
+    [dartx.setMediaKeys](...args) {
+      return this.setMediaKeys.apply(this, args);
     }
-    [dartx.setSinkId](sinkId) {
-      return this.setSinkId(sinkId);
+    [dartx.setSinkId](...args) {
+      return this.setSinkId.apply(this, args);
     }
-    [dartx.addKey](keySystem, key, initData, sessionId) {
-      return this.webkitAddKey(keySystem, key, initData, sessionId);
+    [dartx.addKey](...args) {
+      return this.webkitAddKey.apply(this, args);
     }
-    [dartx.cancelKeyRequest](keySystem, sessionId) {
-      return this.webkitCancelKeyRequest(keySystem, sessionId);
+    [dartx.cancelKeyRequest](...args) {
+      return this.webkitCancelKeyRequest.apply(this, args);
     }
-    [dartx.generateKeyRequest](keySystem, initData) {
-      return this.webkitGenerateKeyRequest(keySystem, initData);
+    [dartx.generateKeyRequest](...args) {
+      return this.webkitGenerateKeyRequest.apply(this, args);
     }
     get [dartx.onKeyAdded]() {
       return html$.MediaElement.keyAddedEvent.forElement(this);
@@ -43045,11 +44124,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [__getter__](index) {
-      return this.__getter__(index);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.getTrackById](id) {
-      return this.getTrackById(id);
+    [dartx.getTrackById](...args) {
+      return this.getTrackById.apply(this, args);
     }
     get [dartx.onChange]() {
       return html$.AudioTrackList.changeEvent.forTarget(this);
@@ -43249,8 +44328,8 @@
     get [dartx.userChoice]() {
       return this.userChoice;
     }
-    [dartx.prompt]() {
-      return this.prompt();
+    [dartx.prompt](...args) {
+      return this.prompt.apply(this, args);
     }
   };
   dart.setSignature(html$.BeforeInstallPromptEvent, {
@@ -43305,11 +44384,11 @@
     get [dartx.type]() {
       return this.type;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.slice](start, end, contentType) {
-      return this.slice(start, end, contentType);
+    [dartx.slice](...args) {
+      return this.slice.apply(this, args);
     }
     static new(blobParts, type, endings) {
       if (type === void 0) type = null;
@@ -43369,8 +44448,8 @@
       let options_1 = html_common.convertDartToNative_Dictionary(options);
       return this[_requestDevice_1](options_1);
     }
-    [_requestDevice_1](options) {
-      return this.requestDevice(options);
+    [_requestDevice_1](...args) {
+      return this.requestDevice.apply(this, args);
     }
   };
   dart.setSignature(html$.Bluetooth, {
@@ -43420,8 +44499,8 @@
     get [dartx.vendorIDSource]() {
       return this.vendorIDSource;
     }
-    [dartx.connectGatt]() {
-      return this.connectGATT();
+    [dartx.connectGatt](...args) {
+      return this.connectGATT.apply(this, args);
     }
   };
   dart.setSignature(html$.BluetoothDevice, {
@@ -43451,11 +44530,11 @@
     get [dartx.uuid]() {
       return this.uuid;
     }
-    [dartx.readValue]() {
-      return this.readValue();
+    [dartx.readValue](...args) {
+      return this.readValue.apply(this, args);
     }
-    [dartx.writeValue](value) {
-      return this.writeValue(value);
+    [dartx.writeValue](...args) {
+      return this.writeValue.apply(this, args);
     }
   };
   dart.setSignature(html$.BluetoothGattCharacteristic, {
@@ -43478,8 +44557,8 @@
     get [dartx.connected]() {
       return this.connected;
     }
-    [dartx.getPrimaryService](service) {
-      return this.getPrimaryService(service);
+    [dartx.getPrimaryService](...args) {
+      return this.getPrimaryService.apply(this, args);
     }
   };
   dart.setSignature(html$.BluetoothGattRemoteServer, {
@@ -43503,8 +44582,8 @@
     get [dartx.uuid]() {
       return this.uuid;
     }
-    [dartx.getCharacteristic](characteristic) {
-      return this.getCharacteristic(characteristic);
+    [dartx.getCharacteristic](...args) {
+      return this.getCharacteristic.apply(this, args);
     }
   };
   dart.setSignature(html$.BluetoothGattService, {
@@ -43546,17 +44625,17 @@
     get [dartx.bodyUsed]() {
       return this.bodyUsed;
     }
-    [dartx.arrayBuffer]() {
-      return this.arrayBuffer();
+    [dartx.arrayBuffer](...args) {
+      return this.arrayBuffer.apply(this, args);
     }
-    [dartx.blob]() {
-      return this.blob();
+    [dartx.blob](...args) {
+      return this.blob.apply(this, args);
     }
-    [dartx.json]() {
-      return this.json();
+    [dartx.json](...args) {
+      return this.json.apply(this, args);
     }
-    [dartx.text]() {
-      return this.text();
+    [dartx.text](...args) {
+      return this.text.apply(this, args);
     }
   };
   dart.setSignature(html$.Body, {
@@ -43830,14 +44909,14 @@
     get [dartx.willValidate]() {
       return this.willValidate;
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.ButtonElement, 'created');
@@ -43898,26 +44977,26 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.appendData](data) {
-      return this.appendData(data);
+    [dartx.appendData](...args) {
+      return this.appendData.apply(this, args);
     }
-    [dartx.deleteData](offset, count) {
-      return this.deleteData(offset, count);
+    [dartx.deleteData](...args) {
+      return this.deleteData.apply(this, args);
     }
-    [dartx.insertData](offset, data) {
-      return this.insertData(offset, data);
+    [dartx.insertData](...args) {
+      return this.insertData.apply(this, args);
     }
-    [dartx.replaceData](offset, count, data) {
-      return this.replaceData(offset, count, data);
+    [dartx.replaceData](...args) {
+      return this.replaceData.apply(this, args);
     }
-    [dartx.substringData](offset, count) {
-      return this.substringData(offset, count);
+    [dartx.substringData](...args) {
+      return this.substringData.apply(this, args);
     }
-    [dartx.after](nodes) {
-      return this.after(nodes);
+    [dartx.after](...args) {
+      return this.after.apply(this, args);
     }
-    [dartx.before](nodes) {
-      return this.before(nodes);
+    [dartx.before](...args) {
+      return this.before.apply(this, args);
     }
     get [dartx.nextElementSibling]() {
       return this.nextElementSibling;
@@ -43961,11 +45040,11 @@
     get [dartx.wholeText]() {
       return this.wholeText;
     }
-    [dartx.getDestinationInsertionPoints]() {
-      return this.getDestinationInsertionPoints();
+    [dartx.getDestinationInsertionPoints](...args) {
+      return this.getDestinationInsertionPoints.apply(this, args);
     }
-    [dartx.splitText](offset) {
-      return this.splitText(offset);
+    [dartx.splitText](...args) {
+      return this.splitText.apply(this, args);
     }
   };
   dart.setSignature(html$.Text, {
@@ -44002,14 +45081,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.delete](cacheName) {
-      return this.delete(cacheName);
+    [dartx.delete](...args) {
+      return this.delete.apply(this, args);
     }
-    [dartx.has](cacheName) {
-      return this.has(cacheName);
+    [dartx.has](...args) {
+      return this.has.apply(this, args);
     }
-    [dartx.keys]() {
-      return this.keys();
+    [dartx.keys](...args) {
+      return this.keys.apply(this, args);
     }
     [dartx.match](request, options) {
       if (options === void 0) options = null;
@@ -44019,14 +45098,14 @@
       }
       return this[_match_2](request);
     }
-    [_match_1](request, options) {
-      return this.match(request, options);
+    [_match_1](...args) {
+      return this.match.apply(this, args);
     }
-    [_match_2](request) {
-      return this.match(request);
+    [_match_2](...args) {
+      return this.match.apply(this, args);
     }
-    [dartx.open](cacheName) {
-      return this.open(cacheName);
+    [dartx.open](...args) {
+      return this.open.apply(this, args);
     }
   };
   dart.setSignature(html$.CacheStorage, {
@@ -44092,14 +45171,14 @@
       }
       return this[_getContext_2](contextId);
     }
-    [_getContext_1](contextId, attributes) {
-      return this.getContext(contextId, attributes);
+    [_getContext_1](...args) {
+      return this.getContext.apply(this, args);
     }
-    [_getContext_2](contextId) {
-      return this.getContext(contextId);
+    [_getContext_2](...args) {
+      return this.getContext.apply(this, args);
     }
-    [_toDataUrl](type, arguments_OR_quality) {
-      return this.toDataURL(type, arguments_OR_quality);
+    [_toDataUrl](...args) {
+      return this.toDataURL.apply(this, args);
     }
     get [dartx.onWebGlContextLost]() {
       return html$.CanvasElement.webGlContextLostEvent.forElement(this);
@@ -44176,8 +45255,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.addColorStop](offset, color) {
-      return this.addColorStop(offset, color);
+    [dartx.addColorStop](...args) {
+      return this.addColorStop.apply(this, args);
     }
   };
   dart.setSignature(html$.CanvasGradient, {
@@ -44192,8 +45271,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.setTransform](transform) {
-      return this.setTransform(transform);
+    [dartx.setTransform](...args) {
+      return this.setTransform.apply(this, args);
     }
   };
   dart.setSignature(html$.CanvasPattern, {
@@ -44422,23 +45501,23 @@
       this[_addHitRegion_2]();
       return;
     }
-    [_addHitRegion_1](options) {
-      return this.addHitRegion(options);
+    [_addHitRegion_1](...args) {
+      return this.addHitRegion.apply(this, args);
     }
-    [_addHitRegion_2]() {
-      return this.addHitRegion();
+    [_addHitRegion_2](...args) {
+      return this.addHitRegion.apply(this, args);
     }
-    [dartx.beginPath]() {
-      return this.beginPath();
+    [dartx.beginPath](...args) {
+      return this.beginPath.apply(this, args);
     }
-    [dartx.clearHitRegions]() {
-      return this.clearHitRegions();
+    [dartx.clearHitRegions](...args) {
+      return this.clearHitRegions.apply(this, args);
     }
-    [dartx.clearRect](x, y, width, height) {
-      return this.clearRect(x, y, width, height);
+    [dartx.clearRect](...args) {
+      return this.clearRect.apply(this, args);
     }
-    [dartx.clip](path_OR_winding, winding) {
-      return this.clip(path_OR_winding, winding);
+    [dartx.clip](...args) {
+      return this.clip.apply(this, args);
     }
     [dartx.createImageData](imagedata_OR_sw, sh) {
       if (sh === void 0) sh = null;
@@ -44451,53 +45530,53 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_createImageData_1](imagedata) {
-      return this.createImageData(imagedata);
+    [_createImageData_1](...args) {
+      return this.createImageData.apply(this, args);
     }
-    [_createImageData_2](sw, sh) {
-      return this.createImageData(sw, sh);
+    [_createImageData_2](...args) {
+      return this.createImageData.apply(this, args);
     }
-    [dartx.createLinearGradient](x0, y0, x1, y1) {
-      return this.createLinearGradient(x0, y0, x1, y1);
+    [dartx.createLinearGradient](...args) {
+      return this.createLinearGradient.apply(this, args);
     }
-    [dartx.createPattern](image, repetitionType) {
-      return this.createPattern(image, repetitionType);
+    [dartx.createPattern](...args) {
+      return this.createPattern.apply(this, args);
     }
-    [dartx.createRadialGradient](x0, y0, r0, x1, y1, r1) {
-      return this.createRadialGradient(x0, y0, r0, x1, y1, r1);
+    [dartx.createRadialGradient](...args) {
+      return this.createRadialGradient.apply(this, args);
     }
-    [dartx.drawFocusIfNeeded](element_OR_path, element) {
-      return this.drawFocusIfNeeded(element_OR_path, element);
+    [dartx.drawFocusIfNeeded](...args) {
+      return this.drawFocusIfNeeded.apply(this, args);
     }
-    [dartx.fillRect](x, y, width, height) {
-      return this.fillRect(x, y, width, height);
+    [dartx.fillRect](...args) {
+      return this.fillRect.apply(this, args);
     }
     [dartx.getContextAttributes]() {
       return html_common.convertNativeToDart_Dictionary(this[_getContextAttributes_1]());
     }
-    [_getContextAttributes_1]() {
-      return this.getContextAttributes();
+    [_getContextAttributes_1](...args) {
+      return this.getContextAttributes.apply(this, args);
     }
     [dartx.getImageData](sx, sy, sw, sh) {
       return html_common.convertNativeToDart_ImageData(this[_getImageData_1](sx, sy, sw, sh));
     }
-    [_getImageData_1](sx, sy, sw, sh) {
-      return this.getImageData(sx, sy, sw, sh);
+    [_getImageData_1](...args) {
+      return this.getImageData.apply(this, args);
     }
-    [_getLineDash]() {
-      return this.getLineDash();
+    [_getLineDash](...args) {
+      return this.getLineDash.apply(this, args);
     }
-    [dartx.isContextLost]() {
-      return this.isContextLost();
+    [dartx.isContextLost](...args) {
+      return this.isContextLost.apply(this, args);
     }
-    [dartx.isPointInPath](path_OR_x, x_OR_y, winding_OR_y, winding) {
-      return this.isPointInPath(path_OR_x, x_OR_y, winding_OR_y, winding);
+    [dartx.isPointInPath](...args) {
+      return this.isPointInPath.apply(this, args);
     }
-    [dartx.isPointInStroke](path_OR_x, x_OR_y, y) {
-      return this.isPointInStroke(path_OR_x, x_OR_y, y);
+    [dartx.isPointInStroke](...args) {
+      return this.isPointInStroke.apply(this, args);
     }
-    [dartx.measureText](text) {
-      return this.measureText(text);
+    [dartx.measureText](...args) {
+      return this.measureText.apply(this, args);
     }
     [dartx.putImageData](imagedata, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight) {
       if (dirtyX === void 0) dirtyX = null;
@@ -44516,77 +45595,77 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_putImageData_1](imagedata, dx, dy) {
-      return this.putImageData(imagedata, dx, dy);
+    [_putImageData_1](...args) {
+      return this.putImageData.apply(this, args);
     }
-    [_putImageData_2](imagedata, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight) {
-      return this.putImageData(imagedata, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight);
+    [_putImageData_2](...args) {
+      return this.putImageData.apply(this, args);
     }
-    [dartx.removeHitRegion](id) {
-      return this.removeHitRegion(id);
+    [dartx.removeHitRegion](...args) {
+      return this.removeHitRegion.apply(this, args);
     }
-    [dartx.resetTransform]() {
-      return this.resetTransform();
+    [dartx.resetTransform](...args) {
+      return this.resetTransform.apply(this, args);
     }
-    [dartx.restore]() {
-      return this.restore();
+    [dartx.restore](...args) {
+      return this.restore.apply(this, args);
     }
-    [dartx.rotate](angle) {
-      return this.rotate(angle);
+    [dartx.rotate](...args) {
+      return this.rotate.apply(this, args);
     }
-    [dartx.save]() {
-      return this.save();
+    [dartx.save](...args) {
+      return this.save.apply(this, args);
     }
-    [dartx.scale](x, y) {
-      return this.scale(x, y);
+    [dartx.scale](...args) {
+      return this.scale.apply(this, args);
     }
-    [dartx.scrollPathIntoView](path) {
-      return this.scrollPathIntoView(path);
+    [dartx.scrollPathIntoView](...args) {
+      return this.scrollPathIntoView.apply(this, args);
     }
-    [dartx.setTransform](a, b, c, d, e, f) {
-      return this.setTransform(a, b, c, d, e, f);
+    [dartx.setTransform](...args) {
+      return this.setTransform.apply(this, args);
     }
-    [dartx.stroke](path) {
-      return this.stroke(path);
+    [dartx.stroke](...args) {
+      return this.stroke.apply(this, args);
     }
-    [dartx.strokeRect](x, y, width, height) {
-      return this.strokeRect(x, y, width, height);
+    [dartx.strokeRect](...args) {
+      return this.strokeRect.apply(this, args);
     }
-    [dartx.strokeText](text, x, y, maxWidth) {
-      return this.strokeText(text, x, y, maxWidth);
+    [dartx.strokeText](...args) {
+      return this.strokeText.apply(this, args);
     }
-    [dartx.transform](a, b, c, d, e, f) {
-      return this.transform(a, b, c, d, e, f);
+    [dartx.transform](...args) {
+      return this.transform.apply(this, args);
     }
-    [dartx.translate](x, y) {
-      return this.translate(x, y);
+    [dartx.translate](...args) {
+      return this.translate.apply(this, args);
     }
-    [_arc](x, y, radius, startAngle, endAngle, anticlockwise) {
-      return this.arc(x, y, radius, startAngle, endAngle, anticlockwise);
+    [_arc](...args) {
+      return this.arc.apply(this, args);
     }
-    [dartx.arcTo](x1, y1, x2, y2, radius) {
-      return this.arcTo(x1, y1, x2, y2, radius);
+    [dartx.arcTo](...args) {
+      return this.arcTo.apply(this, args);
     }
-    [dartx.bezierCurveTo](cp1x, cp1y, cp2x, cp2y, x, y) {
-      return this.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
+    [dartx.bezierCurveTo](...args) {
+      return this.bezierCurveTo.apply(this, args);
     }
-    [dartx.closePath]() {
-      return this.closePath();
+    [dartx.closePath](...args) {
+      return this.closePath.apply(this, args);
     }
-    [dartx.ellipse](x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
-      return this.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
+    [dartx.ellipse](...args) {
+      return this.ellipse.apply(this, args);
     }
-    [dartx.lineTo](x, y) {
-      return this.lineTo(x, y);
+    [dartx.lineTo](...args) {
+      return this.lineTo.apply(this, args);
     }
-    [dartx.moveTo](x, y) {
-      return this.moveTo(x, y);
+    [dartx.moveTo](...args) {
+      return this.moveTo.apply(this, args);
     }
-    [dartx.quadraticCurveTo](cpx, cpy, x, y) {
-      return this.quadraticCurveTo(cpx, cpy, x, y);
+    [dartx.quadraticCurveTo](...args) {
+      return this.quadraticCurveTo.apply(this, args);
     }
-    [dartx.rect](x, y, width, height) {
-      return this.rect(x, y, width, height);
+    [dartx.rect](...args) {
+      return this.rect.apply(this, args);
     }
     [dartx.createImageDataFromImageData](imagedata) {
       return this.createImageData(imagedata);
@@ -44622,14 +45701,14 @@
         this[dartx.drawImageScaledFromSource](source, sourceRect[dartx.left], sourceRect[dartx.top], sourceRect[dartx.width], sourceRect[dartx.height], destRect[dartx.left], destRect[dartx.top], destRect[dartx.width], destRect[dartx.height]);
       }
     }
-    [dartx.drawImage](source, destX, destY) {
-      return this.drawImage(source, destX, destY);
+    [dartx.drawImage](...args) {
+      return this.drawImage.apply(this, args);
     }
-    [dartx.drawImageScaled](source, destX, destY, destWidth, destHeight) {
-      return this.drawImage(source, destX, destY, destWidth, destHeight);
+    [dartx.drawImageScaled](...args) {
+      return this.drawImage.apply(this, args);
     }
-    [dartx.drawImageScaledFromSource](source, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight) {
-      return this.drawImage(source, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight);
+    [dartx.drawImageScaledFromSource](...args) {
+      return this.drawImage.apply(this, args);
     }
     get [dartx.lineDashOffset]() {
       return this.lineDashOffset || this.webkitLineDashOffset;
@@ -44876,11 +45955,11 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
   };
   dart.setSignature(html$.Client, {
@@ -44908,8 +45987,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.claim]() {
-      return this.claim();
+    [dartx.claim](...args) {
+      return this.claim.apply(this, args);
     }
     [dartx.matchAll](options) {
       if (options === void 0) options = null;
@@ -44919,14 +45998,14 @@
       }
       return this[_matchAll_2]();
     }
-    [_matchAll_1](options) {
-      return this.matchAll(options);
+    [_matchAll_1](...args) {
+      return this.matchAll.apply(this, args);
     }
-    [_matchAll_2]() {
-      return this.matchAll();
+    [_matchAll_2](...args) {
+      return this.matchAll.apply(this, args);
     }
-    [dartx.openWindow](url) {
-      return this.openWindow(url);
+    [dartx.openWindow](...args) {
+      return this.openWindow.apply(this, args);
     }
   };
   dart.setSignature(html$.Clients, {
@@ -45084,8 +46163,8 @@
     get [_which]() {
       return this.which;
     }
-    [_initUIEvent](type, bubbles, cancelable, view, detail) {
-      return this.initUIEvent(type, bubbles, cancelable, view, detail);
+    [_initUIEvent](...args) {
+      return this.initUIEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.UIEvent, {
@@ -45148,8 +46227,8 @@
     get [dartx.data]() {
       return this.data;
     }
-    [_initCompositionEvent](type, bubbles, cancelable, view, data) {
-      return this.initCompositionEvent(type, bubbles, cancelable, view, data);
+    [_initCompositionEvent](...args) {
+      return this.initCompositionEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.CompositionEvent, {
@@ -45208,11 +46287,11 @@
     set [dartx.transform](value) {
       this.transform = value;
     }
-    [dartx.disconnect]() {
-      return this.disconnect();
+    [dartx.disconnect](...args) {
+      return this.disconnect.apply(this, args);
     }
-    [dartx.supports](attribute) {
-      return this.supports(attribute);
+    [dartx.supports](...args) {
+      return this.supports.apply(this, args);
     }
   };
   dart.setSignature(html$.CompositorProxy, {
@@ -45261,14 +46340,14 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [dartx.terminate]() {
-      return this.terminate();
+    [dartx.terminate](...args) {
+      return this.terminate.apply(this, args);
     }
     get [dartx.onError]() {
       return html$.CompositorWorker.errorEvent.forTarget(this);
@@ -45367,8 +46446,8 @@
     get [dartx.self]() {
       return this.self;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
     [dartx.fetch](input, init) {
       if (init === void 0) init = null;
@@ -45378,17 +46457,17 @@
       }
       return this[_fetch_2](input);
     }
-    [_fetch_1](input, init) {
-      return this.fetch(input, init);
+    [_fetch_1](...args) {
+      return this.fetch.apply(this, args);
     }
-    [_fetch_2](input) {
-      return this.fetch(input);
+    [_fetch_2](...args) {
+      return this.fetch.apply(this, args);
     }
-    [dartx.importScripts](urls) {
-      return this.importScripts(urls);
+    [dartx.importScripts](...args) {
+      return this.importScripts.apply(this, args);
     }
-    [_webkitRequestFileSystem](type, size, successCallback, errorCallback) {
-      return this.webkitRequestFileSystem(type, size, successCallback, errorCallback);
+    [_webkitRequestFileSystem](...args) {
+      return this.webkitRequestFileSystem.apply(this, args);
     }
     [dartx.webkitRequestFileSystem](type, size) {
       let completer = CompleterOfFileSystem().new();
@@ -45399,14 +46478,14 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [dartx.requestFileSystemSync](type, size) {
-      return this.webkitRequestFileSystemSync(type, size);
+    [dartx.requestFileSystemSync](...args) {
+      return this.webkitRequestFileSystemSync.apply(this, args);
     }
-    [dartx.resolveLocalFileSystemSyncUrl](url) {
-      return this.webkitResolveLocalFileSystemSyncURL(url);
+    [dartx.resolveLocalFileSystemSyncUrl](...args) {
+      return this.webkitResolveLocalFileSystemSyncURL.apply(this, args);
     }
-    [_webkitResolveLocalFileSystemUrl](url, successCallback, errorCallback) {
-      return this.webkitResolveLocalFileSystemURL(url, successCallback, errorCallback);
+    [_webkitResolveLocalFileSystemUrl](...args) {
+      return this.webkitResolveLocalFileSystemURL.apply(this, args);
     }
     [dartx.webkitResolveLocalFileSystemUrl](url) {
       let completer = CompleterOfEntry().new();
@@ -45417,29 +46496,29 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [dartx.atob](atob) {
-      return this.atob(atob);
+    [dartx.atob](...args) {
+      return this.atob.apply(this, args);
     }
-    [dartx.btoa](btoa) {
-      return this.btoa(btoa);
+    [dartx.btoa](...args) {
+      return this.btoa.apply(this, args);
     }
-    [_setInterval_String](handler, timeout, arguments$) {
-      return this.setInterval(handler, timeout, arguments$);
+    [_setInterval_String](...args) {
+      return this.setInterval.apply(this, args);
     }
-    [_setTimeout_String](handler, timeout, arguments$) {
-      return this.setTimeout(handler, timeout, arguments$);
+    [_setTimeout_String](...args) {
+      return this.setTimeout.apply(this, args);
     }
-    [_clearInterval](handle) {
-      return this.clearInterval(handle);
+    [_clearInterval](...args) {
+      return this.clearInterval.apply(this, args);
     }
-    [_clearTimeout](handle) {
-      return this.clearTimeout(handle);
+    [_clearTimeout](...args) {
+      return this.clearTimeout.apply(this, args);
     }
-    [_setInterval](handler, timeout) {
-      return this.setInterval(handler, timeout);
+    [_setInterval](...args) {
+      return this.setInterval.apply(this, args);
     }
-    [_setTimeout](handler, timeout) {
-      return this.setTimeout(handler, timeout);
+    [_setTimeout](...args) {
+      return this.setTimeout.apply(this, args);
     }
     get [dartx.onError]() {
       return html$.WorkerGlobalScope.errorEvent.forTarget(this);
@@ -45504,8 +46583,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.cancelAnimationFrame](handle) {
-      return this.cancelAnimationFrame(handle);
+    [dartx.cancelAnimationFrame](...args) {
+      return this.cancelAnimationFrame.apply(this, args);
     }
     [dartx.postMessage](message, transfer) {
       if (transfer === void 0) transfer = null;
@@ -45518,14 +46597,14 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [dartx.requestAnimationFrame](callback) {
-      return this.requestAnimationFrame(callback);
+    [dartx.requestAnimationFrame](...args) {
+      return this.requestAnimationFrame.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.CompositorWorkerGlobalScope.messageEvent.forTarget(this);
@@ -45675,14 +46754,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.assertCondition](condition, arg) {
-      return this.assert(condition, arg);
+    [dartx.assertCondition](...args) {
+      return this.assert.apply(this, args);
     }
-    [dartx.timeline](title) {
-      return this.timeline(title);
+    [dartx.timeline](...args) {
+      return this.timeline.apply(this, args);
     }
-    [dartx.timelineEnd](title) {
-      return this.timelineEnd(title);
+    [dartx.timelineEnd](...args) {
+      return this.timelineEnd.apply(this, args);
     }
   };
   dart.setSignature(html$.ConsoleBase, {
@@ -45718,8 +46797,8 @@
     set [dartx.select](value) {
       this.select = value;
     }
-    [dartx.getDistributedNodes]() {
-      return this.getDistributedNodes();
+    [dartx.getDistributedNodes](...args) {
+      return this.getDistributedNodes.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.ContentElement, 'created');
@@ -45826,8 +46905,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.notifySignedIn](credential) {
-      return this.notifySignedIn(credential);
+    [dartx.notifySignedIn](...args) {
+      return this.notifySignedIn.apply(this, args);
     }
     [dartx.request](options) {
       if (options === void 0) options = null;
@@ -45837,14 +46916,14 @@
       }
       return this[_request_2]();
     }
-    [_request_1](options) {
-      return this.request(options);
+    [_request_1](...args) {
+      return this.request.apply(this, args);
     }
-    [_request_2]() {
-      return this.request();
+    [_request_2](...args) {
+      return this.request.apply(this, args);
     }
-    [dartx.requireUserMediation]() {
-      return this.requireUserMediation();
+    [dartx.requireUserMediation](...args) {
+      return this.requireUserMediation.apply(this, args);
     }
   };
   dart.setSignature(html$.CredentialsContainer, {
@@ -45869,8 +46948,8 @@
     get [dartx.client]() {
       return this.client;
     }
-    [dartx.acceptConnection](shouldAccept) {
-      return this.acceptConnection(shouldAccept);
+    [dartx.acceptConnection](...args) {
+      return this.acceptConnection.apply(this, args);
     }
   };
   dart.setSignature(html$.CrossOriginConnectEvent, {
@@ -45905,11 +46984,11 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
   };
   dart.setSignature(html$.CrossOriginServiceWorkerClient, {
@@ -45943,8 +47022,8 @@
     get [dartx.subtle]() {
       return this.subtle;
     }
-    [_getRandomValues](array) {
-      return this.getRandomValues(array);
+    [_getRandomValues](...args) {
+      return this.getRandomValues.apply(this, args);
     }
   };
   dart.setSignature(html$.Crypto, {
@@ -46113,11 +47192,11 @@
     get [dartx.cssRules]() {
       return this.cssRules;
     }
-    [dartx.deleteRule](index) {
-      return this.deleteRule(index);
+    [dartx.deleteRule](...args) {
+      return this.deleteRule.apply(this, args);
     }
-    [dartx.insertRule](rule, index) {
-      return this.insertRule(rule, index);
+    [dartx.insertRule](...args) {
+      return this.insertRule.apply(this, args);
     }
   };
   dart.setSignature(html$.CssGroupingRule, {
@@ -46183,6 +47262,8 @@
     })
   });
   dart.registerExtension(dart.global.CSSKeyframeRule, html$.CssKeyframeRule);
+  dart.registerExtension(dart.global.MozCSSKeyframeRule, html$.CssKeyframeRule);
+  dart.registerExtension(dart.global.WebKitCSSKeyframeRule, html$.CssKeyframeRule);
   dart.defineExtensionNames([
     'appendRule',
     'deleteRule',
@@ -46203,17 +47284,17 @@
     set [dartx.name](value) {
       this.name = value;
     }
-    [__getter__](index) {
-      return this.__getter__(index);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.appendRule](rule) {
-      return this.appendRule(rule);
+    [dartx.appendRule](...args) {
+      return this.appendRule.apply(this, args);
     }
-    [dartx.deleteRule](select) {
-      return this.deleteRule(select);
+    [dartx.deleteRule](...args) {
+      return this.deleteRule.apply(this, args);
     }
-    [dartx.findRule](select) {
-      return this.findRule(select);
+    [dartx.findRule](...args) {
+      return this.findRule.apply(this, args);
     }
   };
   dart.setSignature(html$.CssKeyframesRule, {
@@ -46230,6 +47311,8 @@
     })
   });
   dart.registerExtension(dart.global.CSSKeyframesRule, html$.CssKeyframesRule);
+  dart.registerExtension(dart.global.MozCSSKeyframesRule, html$.CssKeyframesRule);
+  dart.registerExtension(dart.global.WebKitCSSKeyframesRule, html$.CssKeyframesRule);
   dart.defineExtensionNames([
     'media'
   ]);
@@ -50749,17 +51832,17 @@
     get [dartx.parentRule]() {
       return this.parentRule;
     }
-    [dartx.getPropertyPriority](property) {
-      return this.getPropertyPriority(property);
+    [dartx.getPropertyPriority](...args) {
+      return this.getPropertyPriority.apply(this, args);
     }
-    [_getPropertyValue](property) {
-      return this.getPropertyValue(property);
+    [_getPropertyValue](...args) {
+      return this.getPropertyValue.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.removeProperty](property) {
-      return this.removeProperty(property);
+    [dartx.removeProperty](...args) {
+      return this.removeProperty.apply(this, args);
     }
     get [dartx.background]() {
       return this[_background];
@@ -51971,6 +53054,8 @@
     }
   });
   dart.registerExtension(dart.global.CSSStyleDeclaration, html$.CssStyleDeclaration);
+  dart.registerExtension(dart.global.MSStyleCSSProperties, html$.CssStyleDeclaration);
+  dart.registerExtension(dart.global.CSS2Properties, html$.CssStyleDeclaration);
   const _elementIterable = Symbol('_elementIterable');
   const _elementCssStyleDeclarationSetIterable = Symbol('_elementCssStyleDeclarationSetIterable');
   const _setAll = Symbol('_setAll');
@@ -52739,17 +53824,17 @@
     get [dartx.rules]() {
       return this.rules;
     }
-    [dartx.addRule](selector, style, index) {
-      return this.addRule(selector, style, index);
+    [dartx.addRule](...args) {
+      return this.addRule.apply(this, args);
     }
-    [dartx.deleteRule](index) {
-      return this.deleteRule(index);
+    [dartx.deleteRule](...args) {
+      return this.deleteRule.apply(this, args);
     }
-    [dartx.insertRule](rule, index) {
-      return this.insertRule(rule, index);
+    [dartx.insertRule](...args) {
+      return this.insertRule.apply(this, args);
     }
-    [dartx.removeRule](index) {
-      return this.removeRule(index);
+    [dartx.removeRule](...args) {
+      return this.removeRule.apply(this, args);
     }
   };
   dart.setSignature(html$.CssStyleSheet, {
@@ -52783,11 +53868,11 @@
     get [dartx.cssRules]() {
       return this.cssRules;
     }
-    [dartx.deleteRule](index) {
-      return this.deleteRule(index);
+    [dartx.deleteRule](...args) {
+      return this.deleteRule.apply(this, args);
     }
-    [dartx.insertRule](rule, index) {
-      return this.insertRule(rule, index);
+    [dartx.insertRule](...args) {
+      return this.insertRule.apply(this, args);
     }
   };
   dart.setSignature(html$.CssSupportsRule, {
@@ -52877,8 +53962,8 @@
     get [_get__detail]() {
       return this.detail;
     }
-    [_initCustomEvent](type, bubbles, cancelable, detail) {
-      return this.initCustomEvent(type, bubbles, cancelable, detail);
+    [_initCustomEvent](...args) {
+      return this.initCustomEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.CustomEvent, {
@@ -52990,17 +54075,17 @@
     get [dartx.types]() {
       return this.types;
     }
-    [dartx.clearData](format) {
-      return this.clearData(format);
+    [dartx.clearData](...args) {
+      return this.clearData.apply(this, args);
     }
-    [dartx.getData](format) {
-      return this.getData(format);
+    [dartx.getData](...args) {
+      return this.getData.apply(this, args);
     }
-    [dartx.setData](format, data) {
-      return this.setData(format, data);
+    [dartx.setData](...args) {
+      return this.setData.apply(this, args);
     }
-    [dartx.setDragImage](image, x, y) {
-      return this.setDragImage(image, x, y);
+    [dartx.setDragImage](...args) {
+      return this.setDragImage.apply(this, args);
     }
   };
   dart.setSignature(html$.DataTransfer, {
@@ -53038,11 +54123,11 @@
     get [dartx.type]() {
       return this.type;
     }
-    [dartx.getAsFile]() {
-      return this.getAsFile();
+    [dartx.getAsFile](...args) {
+      return this.getAsFile.apply(this, args);
     }
-    [_getAsString](callback) {
-      return this.getAsString(callback);
+    [_getAsString](...args) {
+      return this.getAsString.apply(this, args);
     }
     [dartx.getAsString]() {
       let completer = CompleterOfString().new();
@@ -53051,8 +54136,8 @@
       }, StringTovoid$()));
       return completer.future;
     }
-    [dartx.getAsEntry]() {
-      return this.webkitGetAsEntry();
+    [dartx.getAsEntry](...args) {
+      return this.webkitGetAsEntry.apply(this, args);
     }
   };
   dart.setSignature(html$.DataTransferItem, {
@@ -53076,7 +54161,7 @@
     'clear',
     'item',
     'remove',
-    'get',
+    '_get',
     'length'
   ]);
   html$.DataTransferItemList = class DataTransferItemList extends _interceptors.Interceptor {
@@ -53086,25 +54171,25 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.add](data_OR_file, type) {
-      return this.add(data_OR_file, type);
+    [dartx.add](...args) {
+      return this.add.apply(this, args);
     }
-    [dartx.addData](data, type) {
-      return this.add(data, type);
+    [dartx.addData](...args) {
+      return this.add.apply(this, args);
     }
-    [dartx.addFile](file) {
-      return this.add(file);
+    [dartx.addFile](...args) {
+      return this.add.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.remove](index) {
-      return this.remove(index);
+    [dartx.remove](...args) {
+      return this.remove.apply(this, args);
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       return this[index];
     }
   };
@@ -53118,7 +54203,7 @@
       [dartx.clear]: dart.definiteFunctionType(dart.void, []),
       [dartx.item]: dart.definiteFunctionType(html$.DataTransferItem, [core.int]),
       [dartx.remove]: dart.definiteFunctionType(dart.void, [core.int]),
-      [dartx.get]: dart.definiteFunctionType(html$.DataTransferItem, [core.int])
+      [dartx._get]: dart.definiteFunctionType(html$.DataTransferItem, [core.int])
     })
   });
   dart.registerExtension(dart.global.DataTransferItemList, html$.DataTransferItemList);
@@ -53142,11 +54227,11 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.DedicatedWorkerGlobalScope.messageEvent.forTarget(this);
@@ -53214,11 +54299,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.queryUsageAndQuota](storageType, usageCallback, errorCallback) {
-      return this.queryUsageAndQuota(storageType, usageCallback, errorCallback);
+    [dartx.queryUsageAndQuota](...args) {
+      return this.queryUsageAndQuota.apply(this, args);
     }
-    [dartx.requestQuota](storageType, newQuotaInBytes, quotaCallback, errorCallback) {
-      return this.requestQuota(storageType, newQuotaInBytes, quotaCallback, errorCallback);
+    [dartx.requestQuota](...args) {
+      return this.requestQuota.apply(this, args);
     }
   };
   dart.setSignature(html$.DeprecatedStorageInfo, {
@@ -53243,11 +54328,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.queryUsageAndQuota](usageCallback, errorCallback) {
-      return this.queryUsageAndQuota(usageCallback, errorCallback);
+    [dartx.queryUsageAndQuota](...args) {
+      return this.queryUsageAndQuota.apply(this, args);
     }
-    [dartx.requestQuota](newQuotaInBytes, quotaCallback, errorCallback) {
-      return this.requestQuota(newQuotaInBytes, quotaCallback, errorCallback);
+    [dartx.requestQuota](...args) {
+      return this.requestQuota.apply(this, args);
     }
   };
   dart.setSignature(html$.DeprecatedStorageQuota, {
@@ -53382,8 +54467,8 @@
     get [dartx.rotationRate]() {
       return this.rotationRate;
     }
-    [dartx.initDeviceMotionEvent](type, bubbles, cancelable, acceleration, accelerationIncludingGravity, rotationRate, interval) {
-      return this.initDeviceMotionEvent(type, bubbles, cancelable, acceleration, accelerationIncludingGravity, rotationRate, interval);
+    [dartx.initDeviceMotionEvent](...args) {
+      return this.initDeviceMotionEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.DeviceMotionEvent, {
@@ -53431,8 +54516,8 @@
     get [dartx.gamma]() {
       return this.gamma;
     }
-    [_initDeviceOrientationEvent](type, bubbles, cancelable, alpha, beta, gamma, absolute) {
-      return this.initDeviceOrientationEvent(type, bubbles, cancelable, alpha, beta, gamma, absolute);
+    [_initDeviceOrientationEvent](...args) {
+      return this.initDeviceOrientationEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.DeviceOrientationEvent, {
@@ -53505,14 +54590,14 @@
     set [dartx.returnValue](value) {
       this.returnValue = value;
     }
-    [dartx.close](returnValue) {
-      return this.close(returnValue);
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.show]() {
-      return this.show();
+    [dartx.show](...args) {
+      return this.show.apply(this, args);
     }
-    [dartx.showModal]() {
-      return this.showModal();
+    [dartx.showModal](...args) {
+      return this.showModal.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.DialogElement, 'created');
@@ -53582,8 +54667,8 @@
     get [dartx.name]() {
       return this.name;
     }
-    [_copyTo](parent, opts) {
-      return this.copyTo(parent, opts);
+    [_copyTo](...args) {
+      return this.copyTo.apply(this, args);
     }
     [dartx.copyTo](parent, opts) {
       let name = opts && 'name' in opts ? opts.name : null;
@@ -53595,8 +54680,8 @@
         }, FileErrorTovoid())});
       return completer.future;
     }
-    [_getMetadata](successCallback, errorCallback) {
-      return this.getMetadata(successCallback, errorCallback);
+    [_getMetadata](...args) {
+      return this.getMetadata.apply(this, args);
     }
     [dartx.getMetadata]() {
       let completer = CompleterOfMetadata().new();
@@ -53607,8 +54692,8 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [_getParent](successCallback, errorCallback) {
-      return this.getParent(successCallback, errorCallback);
+    [_getParent](...args) {
+      return this.getParent.apply(this, args);
     }
     [dartx.getParent]() {
       let completer = CompleterOfEntry().new();
@@ -53619,8 +54704,8 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [_moveTo](parent, opts) {
-      return this.moveTo(parent, opts);
+    [_moveTo](...args) {
+      return this.moveTo.apply(this, args);
     }
     [dartx.moveTo](parent, opts) {
       let name = opts && 'name' in opts ? opts.name : null;
@@ -53632,8 +54717,8 @@
         }, FileErrorTovoid())});
       return completer.future;
     }
-    [_remove$](successCallback, errorCallback) {
-      return this.remove(successCallback, errorCallback);
+    [_remove$](...args) {
+      return this.remove.apply(this, args);
     }
     [dartx.remove]() {
       let completer = async.Completer.new();
@@ -53644,8 +54729,8 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [dartx.toUrl]() {
-      return this.toURL();
+    [dartx.toUrl](...args) {
+      return this.toURL.apply(this, args);
     }
   };
   dart.setSignature(html$.Entry, {
@@ -53698,8 +54783,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.createReader]() {
-      return this.createReader();
+    [dartx.createReader](...args) {
+      return this.createReader.apply(this, args);
     }
     [__getDirectory](path, opts) {
       let options = opts && 'options' in opts ? opts.options : null;
@@ -53723,17 +54808,17 @@
       this[__getDirectory_4](path);
       return;
     }
-    [__getDirectory_1](path, options, successCallback, errorCallback) {
-      return this.getDirectory(path, options, successCallback, errorCallback);
+    [__getDirectory_1](...args) {
+      return this.getDirectory.apply(this, args);
     }
-    [__getDirectory_2](path, options, successCallback) {
-      return this.getDirectory(path, options, successCallback);
+    [__getDirectory_2](...args) {
+      return this.getDirectory.apply(this, args);
     }
-    [__getDirectory_3](path, options) {
-      return this.getDirectory(path, options);
+    [__getDirectory_3](...args) {
+      return this.getDirectory.apply(this, args);
     }
-    [__getDirectory_4](path) {
-      return this.getDirectory(path);
+    [__getDirectory_4](...args) {
+      return this.getDirectory.apply(this, args);
     }
     [_getDirectory](path, opts) {
       let options = opts && 'options' in opts ? opts.options : null;
@@ -53767,17 +54852,17 @@
       this[__getFile_4](path);
       return;
     }
-    [__getFile_1](path, options, successCallback, errorCallback) {
-      return this.getFile(path, options, successCallback, errorCallback);
+    [__getFile_1](...args) {
+      return this.getFile.apply(this, args);
     }
-    [__getFile_2](path, options, successCallback) {
-      return this.getFile(path, options, successCallback);
+    [__getFile_2](...args) {
+      return this.getFile.apply(this, args);
     }
-    [__getFile_3](path, options) {
-      return this.getFile(path, options);
+    [__getFile_3](...args) {
+      return this.getFile.apply(this, args);
     }
-    [__getFile_4](path) {
-      return this.getFile(path);
+    [__getFile_4](...args) {
+      return this.getFile.apply(this, args);
     }
     [_getFile](path, opts) {
       let options = opts && 'options' in opts ? opts.options : null;
@@ -53789,8 +54874,8 @@
         }, FileErrorTovoid())});
       return completer.future;
     }
-    [_removeRecursively](successCallback, errorCallback) {
-      return this.removeRecursively(successCallback, errorCallback);
+    [_removeRecursively](...args) {
+      return this.removeRecursively.apply(this, args);
     }
     [dartx.removeRecursively]() {
       let completer = async.Completer.new();
@@ -53835,8 +54920,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [_readEntries](successCallback, errorCallback) {
-      return this.readEntries(successCallback, errorCallback);
+    [_readEntries](...args) {
+      return this.readEntries.apply(this, args);
     }
     [dartx.readEntries]() {
       let completer = CompleterOfListOfEntry().new();
@@ -54133,93 +55218,93 @@
     get [_webkitVisibilityState]() {
       return this.webkitVisibilityState;
     }
-    [dartx.adoptNode](node) {
-      return this.adoptNode(node);
+    [dartx.adoptNode](...args) {
+      return this.adoptNode.apply(this, args);
     }
-    [_caretRangeFromPoint](x, y) {
-      return this.caretRangeFromPoint(x, y);
+    [_caretRangeFromPoint](...args) {
+      return this.caretRangeFromPoint.apply(this, args);
     }
-    [dartx.createDocumentFragment]() {
-      return this.createDocumentFragment();
+    [dartx.createDocumentFragment](...args) {
+      return this.createDocumentFragment.apply(this, args);
     }
-    [_createElement](localName_OR_tagName, typeExtension) {
-      return this.createElement(localName_OR_tagName, typeExtension);
+    [_createElement](...args) {
+      return this.createElement.apply(this, args);
     }
-    [_createElementNS](namespaceURI, qualifiedName, typeExtension) {
-      return this.createElementNS(namespaceURI, qualifiedName, typeExtension);
+    [_createElementNS](...args) {
+      return this.createElementNS.apply(this, args);
     }
-    [_createEvent](eventType) {
-      return this.createEvent(eventType);
+    [_createEvent](...args) {
+      return this.createEvent.apply(this, args);
     }
-    [dartx.createRange]() {
-      return this.createRange();
+    [dartx.createRange](...args) {
+      return this.createRange.apply(this, args);
     }
-    [_createTextNode](data) {
-      return this.createTextNode(data);
+    [_createTextNode](...args) {
+      return this.createTextNode.apply(this, args);
     }
     [_createTouch](window, target, identifier, pageX, pageY, screenX, screenY, radiusX, radiusY, rotationAngle, force) {
       let target_1 = html$._convertDartToNative_EventTarget(target);
       return this[_createTouch_1](window, target_1, identifier, pageX, pageY, screenX, screenY, radiusX, radiusY, rotationAngle, force);
     }
-    [_createTouch_1](window, target, identifier, pageX, pageY, screenX, screenY, radiusX, radiusY, rotationAngle, force) {
-      return this.createTouch(window, target, identifier, pageX, pageY, screenX, screenY, radiusX, radiusY, rotationAngle, force);
+    [_createTouch_1](...args) {
+      return this.createTouch.apply(this, args);
     }
-    [_createTouchList](touches) {
-      return this.createTouchList(touches);
+    [_createTouchList](...args) {
+      return this.createTouchList.apply(this, args);
     }
-    [_elementFromPoint](x, y) {
-      return this.elementFromPoint(x, y);
+    [_elementFromPoint](...args) {
+      return this.elementFromPoint.apply(this, args);
     }
-    [dartx.elementsFromPoint](x, y) {
-      return this.elementsFromPoint(x, y);
+    [dartx.elementsFromPoint](...args) {
+      return this.elementsFromPoint.apply(this, args);
     }
-    [dartx.execCommand](commandId, showUI, value) {
-      return this.execCommand(commandId, showUI, value);
+    [dartx.execCommand](...args) {
+      return this.execCommand.apply(this, args);
     }
-    [dartx.exitFullscreen]() {
-      return this.exitFullscreen();
+    [dartx.exitFullscreen](...args) {
+      return this.exitFullscreen.apply(this, args);
     }
-    [dartx.exitPointerLock]() {
-      return this.exitPointerLock();
+    [dartx.exitPointerLock](...args) {
+      return this.exitPointerLock.apply(this, args);
     }
-    [_getCssCanvasContext](contextId, name, width, height) {
-      return this.getCSSCanvasContext(contextId, name, width, height);
+    [_getCssCanvasContext](...args) {
+      return this.getCSSCanvasContext.apply(this, args);
     }
-    [dartx.getElementsByClassName](classNames) {
-      return this.getElementsByClassName(classNames);
+    [dartx.getElementsByClassName](...args) {
+      return this.getElementsByClassName.apply(this, args);
     }
-    [dartx.getElementsByName](elementName) {
-      return this.getElementsByName(elementName);
+    [dartx.getElementsByName](...args) {
+      return this.getElementsByName.apply(this, args);
     }
-    [dartx.getElementsByTagName](localName) {
-      return this.getElementsByTagName(localName);
+    [dartx.getElementsByTagName](...args) {
+      return this.getElementsByTagName.apply(this, args);
     }
-    [dartx.importNode](node, deep) {
-      return this.importNode(node, deep);
+    [dartx.importNode](...args) {
+      return this.importNode.apply(this, args);
     }
-    [dartx.queryCommandEnabled](commandId) {
-      return this.queryCommandEnabled(commandId);
+    [dartx.queryCommandEnabled](...args) {
+      return this.queryCommandEnabled.apply(this, args);
     }
-    [dartx.queryCommandIndeterm](commandId) {
-      return this.queryCommandIndeterm(commandId);
+    [dartx.queryCommandIndeterm](...args) {
+      return this.queryCommandIndeterm.apply(this, args);
     }
-    [dartx.queryCommandState](commandId) {
-      return this.queryCommandState(commandId);
+    [dartx.queryCommandState](...args) {
+      return this.queryCommandState.apply(this, args);
     }
-    [dartx.queryCommandSupported](commandId) {
-      return this.queryCommandSupported(commandId);
+    [dartx.queryCommandSupported](...args) {
+      return this.queryCommandSupported.apply(this, args);
     }
-    [dartx.queryCommandValue](commandId) {
-      return this.queryCommandValue(commandId);
+    [dartx.queryCommandValue](...args) {
+      return this.queryCommandValue.apply(this, args);
     }
-    [dartx.transformDocumentToTreeView](noStyleMessage) {
-      return this.transformDocumentToTreeView(noStyleMessage);
+    [dartx.transformDocumentToTreeView](...args) {
+      return this.transformDocumentToTreeView.apply(this, args);
     }
-    [_webkitExitFullscreen]() {
-      return this.webkitExitFullscreen();
+    [_webkitExitFullscreen](...args) {
+      return this.webkitExitFullscreen.apply(this, args);
     }
-    [dartx.getElementById](elementId) {
-      return this.getElementById(elementId);
+    [dartx.getElementById](...args) {
+      return this.getElementById.apply(this, args);
     }
     get [_childElementCount]() {
       return this.childElementCount;
@@ -54233,11 +55318,11 @@
     get [_lastElementChild]() {
       return this.lastElementChild;
     }
-    [dartx.querySelector](selectors) {
-      return this.querySelector(selectors);
+    [dartx.querySelector](...args) {
+      return this.querySelector.apply(this, args);
     }
-    [_querySelectorAll](selectors) {
-      return this.querySelectorAll(selectors);
+    [_querySelectorAll](...args) {
+      return this.querySelectorAll.apply(this, args);
     }
     get [dartx.onAbort]() {
       return html$.Element.abortEvent.forTarget(this);
@@ -54772,8 +55857,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getElementById](elementId) {
-      return this.getElementById(elementId);
+    [dartx.getElementById](...args) {
+      return this.getElementById.apply(this, args);
     }
     get [_childElementCount]() {
       return this.childElementCount;
@@ -54784,11 +55869,11 @@
     get [_lastElementChild]() {
       return this.lastElementChild;
     }
-    [dartx.querySelector](selectors) {
-      return this.querySelector(selectors);
+    [dartx.querySelector](...args) {
+      return this.querySelector.apply(this, args);
     }
-    [_querySelectorAll](selectors) {
-      return this.querySelectorAll(selectors);
+    [_querySelectorAll](...args) {
+      return this.querySelectorAll.apply(this, args);
     }
   };
   html$.DocumentFragment[dart.implements] = () => [html$.NonElementParentNode, html$.ParentNode];
@@ -54953,17 +56038,17 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.createDocument](namespaceURI, qualifiedName, doctype) {
-      return this.createDocument(namespaceURI, qualifiedName, doctype);
+    [dartx.createDocument](...args) {
+      return this.createDocument.apply(this, args);
     }
-    [dartx.createDocumentType](qualifiedName, publicId, systemId) {
-      return this.createDocumentType(qualifiedName, publicId, systemId);
+    [dartx.createDocumentType](...args) {
+      return this.createDocumentType.apply(this, args);
     }
-    [dartx.createHtmlDocument](title) {
-      return this.createHTMLDocument(title);
+    [dartx.createHtmlDocument](...args) {
+      return this.createHTMLDocument.apply(this, args);
     }
-    [dartx.hasFeature]() {
-      return this.hasFeature();
+    [dartx.hasFeature](...args) {
+      return this.hasFeature.apply(this, args);
     }
   };
   dart.setSignature(html$.DomImplementation, {
@@ -54983,8 +56068,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.next](value) {
-      return this.next(value);
+    [dartx.next](...args) {
+      return this.next.apply(this, args);
     }
   };
   dart.setSignature(html$.DomIterator, {
@@ -55101,26 +56186,26 @@
     get [dartx.m44]() {
       return this.m44;
     }
-    [dartx.multiply](other) {
-      return this.multiply(other);
+    [dartx.multiply](...args) {
+      return this.multiply.apply(this, args);
     }
-    [dartx.scale](scale, originX, originY) {
-      return this.scale(scale, originX, originY);
+    [dartx.scale](...args) {
+      return this.scale.apply(this, args);
     }
-    [dartx.scale3d](scale, originX, originY, originZ) {
-      return this.scale3d(scale, originX, originY, originZ);
+    [dartx.scale3d](...args) {
+      return this.scale3d.apply(this, args);
     }
-    [dartx.scaleNonUniform](scaleX, scaleY, scaleZn, originX, originY, originZ) {
-      return this.scaleNonUniform(scaleX, scaleY, scaleZn, originX, originY, originZ);
+    [dartx.scaleNonUniform](...args) {
+      return this.scaleNonUniform.apply(this, args);
     }
-    [dartx.toFloat32Array]() {
-      return this.toFloat32Array();
+    [dartx.toFloat32Array](...args) {
+      return this.toFloat32Array.apply(this, args);
     }
-    [dartx.toFloat64Array]() {
-      return this.toFloat64Array();
+    [dartx.toFloat64Array](...args) {
+      return this.toFloat64Array.apply(this, args);
     }
-    [dartx.translate](tx, ty, tz) {
-      return this.translate(tx, ty, tz);
+    [dartx.translate](...args) {
+      return this.translate.apply(this, args);
     }
   };
   dart.setSignature(html$.DomMatrixReadOnly, {
@@ -55366,23 +56451,23 @@
     set [dartx.m44](value) {
       this.m44 = value;
     }
-    [dartx.multiplySelf](other) {
-      return this.multiplySelf(other);
+    [dartx.multiplySelf](...args) {
+      return this.multiplySelf.apply(this, args);
     }
-    [dartx.preMultiplySelf](other) {
-      return this.preMultiplySelf(other);
+    [dartx.preMultiplySelf](...args) {
+      return this.preMultiplySelf.apply(this, args);
     }
-    [dartx.scale3dSelf](scale, originX, originY, originZ) {
-      return this.scale3dSelf(scale, originX, originY, originZ);
+    [dartx.scale3dSelf](...args) {
+      return this.scale3dSelf.apply(this, args);
     }
-    [dartx.scaleNonUniformSelf](scaleX, scaleY, scaleZ, originX, originY, originZ) {
-      return this.scaleNonUniformSelf(scaleX, scaleY, scaleZ, originX, originY, originZ);
+    [dartx.scaleNonUniformSelf](...args) {
+      return this.scaleNonUniformSelf.apply(this, args);
     }
-    [dartx.scaleSelf](scale, originX, originY) {
-      return this.scaleSelf(scale, originX, originY);
+    [dartx.scaleSelf](...args) {
+      return this.scaleSelf.apply(this, args);
     }
-    [dartx.translateSelf](tx, ty, tz) {
-      return this.translateSelf(tx, ty, tz);
+    [dartx.translateSelf](...args) {
+      return this.translateSelf.apply(this, args);
     }
   };
   dart.setSignature(html$.DomMatrix, {
@@ -55442,8 +56527,8 @@
     static _create_1() {
       return new DOMParser();
     }
-    [dartx.parseFromString](str, type) {
-      return this.parseFromString(str, type);
+    [dartx.parseFromString](...args) {
+      return this.parseFromString.apply(this, args);
     }
   };
   dart.setSignature(html$.DomParser, {
@@ -55762,20 +56847,20 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.add](tokens) {
-      return this.add(tokens);
+    [dartx.add](...args) {
+      return this.add.apply(this, args);
     }
-    [dartx.contains](token) {
-      return this.contains(token);
+    [dartx.contains](...args) {
+      return this.contains.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.remove](tokens) {
-      return this.remove(tokens);
+    [dartx.remove](...args) {
+      return this.remove.apply(this, args);
     }
-    [dartx.toggle](token, force) {
-      return this.toggle(token, force);
+    [dartx.toggle](...args) {
+      return this.toggle.apply(this, args);
     }
   };
   dart.setSignature(html$.DomTokenList, {
@@ -55949,8 +57034,8 @@
   html$.ImmutableListMixin = ImmutableListMixin();
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -55965,11 +57050,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.item](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -55998,13 +57083,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__getter__](index) {
-      return this.__getter__(index);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$.DomStringList[dart.implements] = () => [ListOfString()];
@@ -56018,8 +57103,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.String, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, core.String]),
+      [dartx._get]: dart.definiteFunctionType(core.String, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, core.String]),
       [dartx.elementAt]: dart.definiteFunctionType(core.String, [core.int]),
       [__getter__]: dart.definiteFunctionType(core.String, [core.int]),
       [dartx.item]: dart.definiteFunctionType(core.String, [core.int])
@@ -56060,11 +57145,11 @@
     get length() {
       return this[_childElements][dartx.length];
     }
-    get(index) {
-      return html$.Element._check(this[_childElements][dartx.get](index));
+    _get(index) {
+      return html$.Element._check(this[_childElements][dartx._get](index));
     }
-    set(index, value) {
-      this[_element$][_replaceChild](value, this[_childElements][dartx.get](index));
+    _set(index, value) {
+      this[_element$][_replaceChild](value, this[_childElements][dartx._get](index));
       return value;
     }
     set length(newLength) {
@@ -56137,7 +57222,7 @@
       if (index == this.length) {
         this[_element$][dartx.append](element);
       } else {
-        this[_element$][dartx.insertBefore](element, this.get(index));
+        this[_element$][dartx.insertBefore](element, this._get(index));
       }
     }
     setAll(index, iterable) {
@@ -56147,7 +57232,7 @@
       this[_element$][_clearChildren]();
     }
     removeAt(index) {
-      let result = this.get(index);
+      let result = this._get(index);
       if (result != null) {
         this[_element$][_removeChild](result);
       }
@@ -56197,8 +57282,8 @@
     }),
     setters: () => ({length: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      get: dart.definiteFunctionType(html$.Element, [core.int]),
-      set: dart.definiteFunctionType(dart.void, [core.int, html$.Element]),
+      _get: dart.definiteFunctionType(html$.Element, [core.int]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, html$.Element]),
       add: dart.definiteFunctionType(html$.Element, [html$.Element]),
       addAll: dart.definiteFunctionType(dart.void, [IterableOfElement()]),
       sort: dart.definiteFunctionType(dart.void, [], [ElementAndElementToint()]),
@@ -56216,8 +57301,8 @@
   });
   dart.defineExtensionMembers(html$._ChildrenElementList, [
     'contains',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'add',
     'addAll',
     'sort',
@@ -56259,10 +57344,10 @@
       get length() {
         return this[_nodeList][dartx.length];
       }
-      get(index) {
-        return html$._downcast(html$.Node, E)(this[_nodeList][dartx.get](index));
+      _get(index) {
+        return html$._downcast(html$.Node, E)(this[_nodeList][dartx._get](index));
       }
-      set(index, value) {
+      _set(index, value) {
         E._check(value);
         dart.throw(new core.UnsupportedError('Cannot modify list'));
         return value;
@@ -56611,14 +57696,14 @@
         classes: dart.definiteFunctionType(dart.void, [IterableOfString()])
       }),
       methods: () => ({
-        get: dart.definiteFunctionType(E, [core.int]),
-        set: dart.definiteFunctionType(dart.void, [core.int, E]),
+        _get: dart.definiteFunctionType(E, [core.int]),
+        _set: dart.definiteFunctionType(dart.void, [core.int, E]),
         sort: dart.definiteFunctionType(dart.void, [], [ComparatorOfE()])
       })
     });
     dart.defineExtensionMembers(_FrozenElementList, [
-      'get',
-      'set',
+      '_get',
+      '_set',
       'sort',
       'shuffle',
       'length',
@@ -56642,19 +57727,19 @@
     statics: () => ({createElement_tag: dart.definiteFunctionType(dart.dynamic, [core.String, core.String])}),
     names: ['createElement_tag']
   });
-  const _value$0 = Symbol('_value');
+  const _value$1 = Symbol('_value');
   html$.ScrollAlignment = class ScrollAlignment extends core.Object {
     _internal(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
     }
     toString() {
-      return dart.str`ScrollAlignment.${this[_value$0]}`;
+      return dart.str`ScrollAlignment.${this[_value$1]}`;
     }
   };
   dart.defineNamedConstructor(html$.ScrollAlignment, '_internal');
   dart.setSignature(html$.ScrollAlignment, {
     constructors: () => ({_internal: dart.definiteFunctionType(html$.ScrollAlignment, [dart.dynamic])}),
-    fields: () => ({[_value$0]: dart.dynamic}),
+    fields: () => ({[_value$1]: dart.dynamic}),
     sfields: () => ({
       TOP: html$.ScrollAlignment,
       CENTER: html$.ScrollAlignment,
@@ -56728,11 +57813,11 @@
     set [dartx.width](value) {
       this.width = value;
     }
-    [__getter__](index_OR_name) {
-      return this.__getter__(index_OR_name);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [__setter__](index_OR_name, value) {
-      return this.__setter__(index_OR_name, value);
+    [__setter__](...args) {
+      return this.__setter__.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.EmbedElement, 'created');
@@ -56860,8 +57945,8 @@
     get [dartx.withCredentials]() {
       return this.withCredentials;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
     get [dartx.onError]() {
       return html$.EventSource.errorEvent.forTarget(this);
@@ -56924,23 +58009,23 @@
     new(ptr) {
       this[_ptr] = ptr;
     }
-    get(type) {
+    _get(type) {
       return new (_EventStreamOfEvent())(this[_ptr], type, false);
     }
   };
   dart.setSignature(html$.Events, {
     constructors: () => ({new: dart.definiteFunctionType(html$.Events, [html$.EventTarget])}),
     fields: () => ({[_ptr]: html$.EventTarget}),
-    methods: () => ({get: dart.definiteFunctionType(async.Stream, [core.String])})
+    methods: () => ({_get: dart.definiteFunctionType(async.Stream, [core.String])})
   });
   html$.ElementEvents = class ElementEvents extends html$.Events {
     new(ptr) {
       super.new(ptr);
     }
-    get(type) {
+    _get(type) {
       if (dart.test(html$.ElementEvents.webkitEvents[dartx.keys][dartx.contains](type[dartx.toLowerCase]()))) {
         if (dart.test(html_common.Device.isWebKit)) {
-          return new (_ElementEventStreamImplOfEvent())(this[_ptr], html$.ElementEvents.webkitEvents[dartx.get](type[dartx.toLowerCase]()), false);
+          return new (_ElementEventStreamImplOfEvent())(this[_ptr], html$.ElementEvents.webkitEvents[dartx._get](type[dartx.toLowerCase]()), false);
         }
       }
       return new (_ElementEventStreamImplOfEvent())(this[_ptr], type, false);
@@ -56976,8 +58061,8 @@
     static _create_2(type) {
       return new ExtendableEvent(type);
     }
-    [dartx.waitUntil](value) {
-      return this.waitUntil(value);
+    [dartx.waitUntil](...args) {
+      return this.waitUntil.apply(this, args);
     }
   };
   dart.setSignature(html$.ExtendableEvent, {
@@ -57057,8 +58142,8 @@
     get [dartx.request]() {
       return this.request;
     }
-    [dartx.respondWith](value) {
-      return this.respondWith(value);
+    [dartx.respondWith](...args) {
+      return this.respondWith.apply(this, args);
     }
   };
   dart.setSignature(html$.FetchEvent, {
@@ -57139,14 +58224,14 @@
     get [dartx.willValidate]() {
       return this.willValidate;
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.FieldSetElement, 'created');
@@ -57244,8 +58329,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [_createWriter](successCallback, errorCallback) {
-      return this.createWriter(successCallback, errorCallback);
+    [_createWriter](...args) {
+      return this.createWriter.apply(this, args);
     }
     [dartx.createWriter]() {
       let completer = CompleterOfFileWriter().new();
@@ -57256,8 +58341,8 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [_file](successCallback, errorCallback) {
-      return this.file(successCallback, errorCallback);
+    [_file](...args) {
+      return this.file.apply(this, args);
     }
     [dartx.file]() {
       let completer = CompleterOfFile().new();
@@ -57323,8 +58408,8 @@
   dart.registerExtension(dart.global.FileError, html$.FileError);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -57339,11 +58424,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -57372,10 +58457,10 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$.FileList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfFile()];
@@ -57389,8 +58474,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.File, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.File]),
+      [dartx._get]: dart.definiteFunctionType(html$.File, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.File]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.File, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.File, [core.int])
     })
@@ -57434,17 +58519,17 @@
     get [dartx.readyState]() {
       return this.readyState;
     }
-    [dartx.abort]() {
-      return this.abort();
+    [dartx.abort](...args) {
+      return this.abort.apply(this, args);
     }
-    [dartx.readAsArrayBuffer](blob) {
-      return this.readAsArrayBuffer(blob);
+    [dartx.readAsArrayBuffer](...args) {
+      return this.readAsArrayBuffer.apply(this, args);
     }
-    [dartx.readAsDataUrl](blob) {
-      return this.readAsDataURL(blob);
+    [dartx.readAsDataUrl](...args) {
+      return this.readAsDataURL.apply(this, args);
     }
-    [dartx.readAsText](blob, label) {
-      return this.readAsText(blob, label);
+    [dartx.readAsText](...args) {
+      return this.readAsText.apply(this, args);
     }
     get [dartx.onAbort]() {
       return html$.FileReader.abortEvent.forTarget(this);
@@ -57603,17 +58688,17 @@
     get [dartx.readyState]() {
       return this.readyState;
     }
-    [dartx.abort]() {
-      return this.abort();
+    [dartx.abort](...args) {
+      return this.abort.apply(this, args);
     }
-    [dartx.seek](position) {
-      return this.seek(position);
+    [dartx.seek](...args) {
+      return this.seek.apply(this, args);
     }
-    [dartx.truncate](size) {
-      return this.truncate(size);
+    [dartx.truncate](...args) {
+      return this.truncate.apply(this, args);
     }
-    [dartx.write](data) {
-      return this.write(data);
+    [dartx.write](...args) {
+      return this.write.apply(this, args);
     }
     get [dartx.onAbort]() {
       return html$.FileWriter.abortEvent.forTarget(this);
@@ -57814,8 +58899,8 @@
     set [dartx.weight](value) {
       this.weight = value;
     }
-    [dartx.load]() {
-      return this.load();
+    [dartx.load](...args) {
+      return this.load.apply(this, args);
     }
   };
   dart.setSignature(html$.FontFace, {
@@ -57862,23 +58947,23 @@
     get [dartx.status]() {
       return this.status;
     }
-    [dartx.add](fontFace) {
-      return this.add(fontFace);
+    [dartx.add](...args) {
+      return this.add.apply(this, args);
     }
-    [dartx.check](font, text) {
-      return this.check(font, text);
+    [dartx.check](...args) {
+      return this.check.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.delete](fontFace) {
-      return this.delete(fontFace);
+    [dartx.delete](...args) {
+      return this.delete.apply(this, args);
     }
-    [dartx.forEach](callback, thisArg) {
-      return this.forEach(callback, thisArg);
+    [dartx.forEach](...args) {
+      return this.forEach.apply(this, args);
     }
-    [dartx.has](fontFace) {
-      return this.has(fontFace);
+    [dartx.has](...args) {
+      return this.has.apply(this, args);
     }
   };
   dart.setSignature(html$.FontFaceSet, {
@@ -57943,26 +59028,26 @@
     static get supported() {
       return !!window.FormData;
     }
-    [dartx.append](name, value) {
-      return this.append(name, value);
+    [dartx.append](...args) {
+      return this.append.apply(this, args);
     }
-    [dartx.appendBlob](name, value, filename) {
-      return this.append(name, value, filename);
+    [dartx.appendBlob](...args) {
+      return this.append.apply(this, args);
     }
-    [dartx.delete](name) {
-      return this.delete(name);
+    [dartx.delete](...args) {
+      return this.delete.apply(this, args);
     }
-    [dartx.get](name) {
-      return this.get(name);
+    [dartx.get](...args) {
+      return this.get.apply(this, args);
     }
-    [dartx.getAll](name) {
-      return this.getAll(name);
+    [dartx.getAll](...args) {
+      return this.getAll.apply(this, args);
     }
-    [dartx.has](name) {
-      return this.has(name);
+    [dartx.has](...args) {
+      return this.has.apply(this, args);
     }
-    [dartx.set](name, value, filename) {
-      return this.set(name, value, filename);
+    [dartx.set](...args) {
+      return this.set.apply(this, args);
     }
   };
   dart.setSignature(html$.FormData, {
@@ -58083,31 +59168,31 @@
     set [dartx.target](value) {
       this.target = value;
     }
-    [__getter__](name) {
-      return this.__getter__(name);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
     [dartx.requestAutocomplete](details) {
       let details_1 = html_common.convertDartToNative_Dictionary(details);
       this[_requestAutocomplete_1](details_1);
       return;
     }
-    [_requestAutocomplete_1](details) {
-      return this.requestAutocomplete(details);
+    [_requestAutocomplete_1](...args) {
+      return this.requestAutocomplete.apply(this, args);
     }
-    [dartx.reset]() {
-      return this.reset();
+    [dartx.reset](...args) {
+      return this.reset.apply(this, args);
     }
-    [dartx.submit]() {
-      return this.submit();
+    [dartx.submit](...args) {
+      return this.submit.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.FormElement, 'created');
@@ -58260,14 +59345,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getRegisteredRegions]() {
-      return this.getRegisteredRegions();
+    [dartx.getRegisteredRegions](...args) {
+      return this.getRegisteredRegions.apply(this, args);
     }
-    [dartx.registerRegion](region) {
-      return this.registerRegion(region);
+    [dartx.registerRegion](...args) {
+      return this.registerRegion.apply(this, args);
     }
-    [dartx.unregisterRegion](regionId) {
-      return this.unregisterRegion(regionId);
+    [dartx.unregisterRegion](...args) {
+      return this.unregisterRegion.apply(this, args);
     }
   };
   dart.setSignature(html$.Geofencing, {
@@ -58323,13 +59408,13 @@
       let maximumAge = opts && 'maximumAge' in opts ? opts.maximumAge : null;
       let options = dart.map();
       if (enableHighAccuracy != null) {
-        options[dartx.set]('enableHighAccuracy', enableHighAccuracy);
+        options[dartx._set]('enableHighAccuracy', enableHighAccuracy);
       }
       if (timeout != null) {
-        options[dartx.set]('timeout', timeout.inMilliseconds);
+        options[dartx._set]('timeout', timeout.inMilliseconds);
       }
       if (maximumAge != null) {
-        options[dartx.set]('maximumAge', maximumAge.inMilliseconds);
+        options[dartx._set]('maximumAge', maximumAge.inMilliseconds);
       }
       let completer = CompleterOfGeoposition().new();
       try {
@@ -58351,13 +59436,13 @@
       let maximumAge = opts && 'maximumAge' in opts ? opts.maximumAge : null;
       let options = dart.map();
       if (enableHighAccuracy != null) {
-        options[dartx.set]('enableHighAccuracy', enableHighAccuracy);
+        options[dartx._set]('enableHighAccuracy', enableHighAccuracy);
       }
       if (timeout != null) {
-        options[dartx.set]('timeout', timeout.inMilliseconds);
+        options[dartx._set]('timeout', timeout.inMilliseconds);
       }
       if (maximumAge != null) {
-        options[dartx.set]('maximumAge', maximumAge.inMilliseconds);
+        options[dartx._set]('maximumAge', maximumAge.inMilliseconds);
       }
       let watchId = null;
       let controller = null;
@@ -58387,8 +59472,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [_clearWatch](watchID) {
-      return this.clearWatch(watchID);
+    [_clearWatch](...args) {
+      return this.clearWatch.apply(this, args);
     }
     [_getCurrentPosition](successCallback, errorCallback, options) {
       if (errorCallback === void 0) errorCallback = null;
@@ -58405,14 +59490,14 @@
       this[_getCurrentPosition_3](successCallback);
       return;
     }
-    [_getCurrentPosition_1](successCallback, errorCallback, options) {
-      return this.getCurrentPosition(successCallback, errorCallback, options);
+    [_getCurrentPosition_1](...args) {
+      return this.getCurrentPosition.apply(this, args);
     }
-    [_getCurrentPosition_2](successCallback, errorCallback) {
-      return this.getCurrentPosition(successCallback, errorCallback);
+    [_getCurrentPosition_2](...args) {
+      return this.getCurrentPosition.apply(this, args);
     }
-    [_getCurrentPosition_3](successCallback) {
-      return this.getCurrentPosition(successCallback);
+    [_getCurrentPosition_3](...args) {
+      return this.getCurrentPosition.apply(this, args);
     }
     [_watchPosition](successCallback, errorCallback, options) {
       if (errorCallback === void 0) errorCallback = null;
@@ -58426,14 +59511,14 @@
       }
       return this[_watchPosition_3](successCallback);
     }
-    [_watchPosition_1](successCallback, errorCallback, options) {
-      return this.watchPosition(successCallback, errorCallback, options);
+    [_watchPosition_1](...args) {
+      return this.watchPosition.apply(this, args);
     }
-    [_watchPosition_2](successCallback, errorCallback) {
-      return this.watchPosition(successCallback, errorCallback);
+    [_watchPosition_2](...args) {
+      return this.watchPosition.apply(this, args);
     }
-    [_watchPosition_3](successCallback) {
-      return this.watchPosition(successCallback);
+    [_watchPosition_3](...args) {
+      return this.watchPosition.apply(this, args);
     }
   };
   dart.setSignature(html$.Geolocation, {
@@ -59104,8 +60189,8 @@
     get [dartx.oldUrl]() {
       return this.oldURL;
     }
-    [_initHashChangeEvent](type, canBubble, cancelable, oldURL, newURL) {
-      return this.initHashChangeEvent(type, canBubble, cancelable, oldURL, newURL);
+    [_initHashChangeEvent](...args) {
+      return this.initHashChangeEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.HashChangeEvent, {
@@ -59272,14 +60357,14 @@
     get [_get_state]() {
       return this.state;
     }
-    [dartx.back]() {
-      return this.back();
+    [dartx.back](...args) {
+      return this.back.apply(this, args);
     }
-    [dartx.forward]() {
-      return this.forward();
+    [dartx.forward](...args) {
+      return this.forward.apply(this, args);
     }
-    [dartx.go](delta) {
-      return this.go(delta);
+    [dartx.go](...args) {
+      return this.go.apply(this, args);
     }
     [dartx.pushState](data, title, url, options) {
       if (options === void 0) options = null;
@@ -59293,11 +60378,11 @@
       this[_pushState_2](data_1, title, url);
       return;
     }
-    [_pushState_1](data, title, url, options) {
-      return this.pushState(data, title, url, options);
+    [_pushState_1](...args) {
+      return this.pushState.apply(this, args);
     }
-    [_pushState_2](data, title, url) {
-      return this.pushState(data, title, url);
+    [_pushState_2](...args) {
+      return this.pushState.apply(this, args);
     }
     [dartx.replaceState](data, title, url, options) {
       if (options === void 0) options = null;
@@ -59311,11 +60396,11 @@
       this[_replaceState_2](data_1, title, url);
       return;
     }
-    [_replaceState_1](data, title, url, options) {
-      return this.replaceState(data, title, url, options);
+    [_replaceState_1](...args) {
+      return this.replaceState.apply(this, args);
     }
-    [_replaceState_2](data, title, url) {
-      return this.replaceState(data, title, url);
+    [_replaceState_2](...args) {
+      return this.replaceState.apply(this, args);
     }
   };
   html$.History[dart.implements] = () => [html$.HistoryBase];
@@ -59380,11 +60465,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getEyeParameters](whichEye) {
-      return this.getEyeParameters(whichEye);
+    [dartx.getEyeParameters](...args) {
+      return this.getEyeParameters.apply(this, args);
     }
-    [dartx.setFieldOfView](leftFov, rightFov) {
-      return this.setFieldOfView(leftFov, rightFov);
+    [dartx.setFieldOfView](...args) {
+      return this.setFieldOfView.apply(this, args);
     }
   };
   dart.setSignature(html$.HmdvrDevice, {
@@ -59397,8 +60482,8 @@
   dart.registerExtension(dart.global.HMDVRDevice, html$.HmdvrDevice);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -59414,11 +60499,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -59447,13 +60532,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.namedItem](name) {
-      return this.namedItem(name);
+    [dartx.namedItem](...args) {
+      return this.namedItem.apply(this, args);
     }
   };
   html$.HtmlCollection[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfNode()];
@@ -59467,8 +60552,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.Node, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
+      [dartx._get]: dart.definiteFunctionType(html$.Node, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.Node, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.Node, [core.int]),
       [dartx.namedItem]: dart.definiteFunctionType(core.Object, [core.String])
@@ -59619,11 +60704,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.namedItem](name) {
-      return this.namedItem(name);
+    [dartx.namedItem](...args) {
+      return this.namedItem.apply(this, args);
     }
   };
   dart.setSignature(html$.HtmlFormControlsCollection, {
@@ -59655,8 +60740,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [_item](index) {
-      return this.item(index);
+    [_item](...args) {
+      return this.item.apply(this, args);
     }
   };
   dart.setSignature(html$.HtmlOptionsCollection, {
@@ -59902,15 +60987,15 @@
         let key = header[dartx.substring](0, splitIdx)[dartx.toLowerCase]();
         let value = header[dartx.substring](dart.notNull(splitIdx) + 2);
         if (dart.test(headers[dartx.containsKey](key))) {
-          headers[dartx.set](key, dart.str`${headers[dartx.get](key)}, ${value}`);
+          headers[dartx._set](key, dart.str`${headers[dartx._get](key)}, ${value}`);
         } else {
-          headers[dartx.set](key, value);
+          headers[dartx._set](key, value);
         }
       }
       return headers;
     }
-    [dartx.open](method, url, opts) {
-      return this.open(method, url, opts);
+    [dartx.open](...args) {
+      return this.open.apply(this, args);
     }
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
@@ -59966,23 +61051,23 @@
     set [dartx.withCredentials](value) {
       this.withCredentials = value;
     }
-    [dartx.abort]() {
-      return this.abort();
+    [dartx.abort](...args) {
+      return this.abort.apply(this, args);
     }
-    [dartx.getAllResponseHeaders]() {
-      return this.getAllResponseHeaders();
+    [dartx.getAllResponseHeaders](...args) {
+      return this.getAllResponseHeaders.apply(this, args);
     }
-    [dartx.getResponseHeader](name) {
-      return this.getResponseHeader(name);
+    [dartx.getResponseHeader](...args) {
+      return this.getResponseHeader.apply(this, args);
     }
-    [dartx.overrideMimeType](mime) {
-      return this.overrideMimeType(mime);
+    [dartx.overrideMimeType](...args) {
+      return this.overrideMimeType.apply(this, args);
     }
-    [dartx.send](body_OR_data) {
-      return this.send(body_OR_data);
+    [dartx.send](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.setRequestHeader](name, value) {
-      return this.setRequestHeader(name, value);
+    [dartx.setRequestHeader](...args) {
+      return this.setRequestHeader.apply(this, args);
     }
     get [dartx.onReadyStateChange]() {
       return html$.HttpRequest.readyStateChangeEvent.forTarget(this);
@@ -60384,8 +61469,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.inspect](objectId, hints) {
-      return this.inspect(objectId, hints);
+    [dartx.inspect](...args) {
+      return this.inspect.apply(this, args);
     }
   };
   dart.setSignature(html$.InjectedScriptHost, {
@@ -60848,29 +61933,29 @@
     get [dartx.willValidate]() {
       return this.willValidate;
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.select]() {
-      return this.select();
+    [dartx.select](...args) {
+      return this.select.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
-    [dartx.setRangeText](replacement, opts) {
-      return this.setRangeText(replacement, opts);
+    [dartx.setRangeText](...args) {
+      return this.setRangeText.apply(this, args);
     }
-    [dartx.setSelectionRange](start, end, direction) {
-      return this.setSelectionRange(start, end, direction);
+    [dartx.setSelectionRange](...args) {
+      return this.setSelectionRange.apply(this, args);
     }
-    [dartx.stepDown](n) {
-      return this.stepDown(n);
+    [dartx.stepDown](...args) {
+      return this.stepDown.apply(this, args);
     }
-    [dartx.stepUp](n) {
-      return this.stepUp(n);
+    [dartx.stepUp](...args) {
+      return this.stepUp.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.InputElement, 'created');
@@ -60960,14 +62045,56 @@
   ]);
   html$.InputElementBase = class InputElementBase extends core.Object {
     new() {
-      this[dartx.autofocus] = null;
-      this[dartx.disabled] = null;
-      this[dartx.incremental] = null;
-      this[dartx.indeterminate] = null;
-      this[dartx.name] = null;
-      this[dartx.value] = null;
+      this[autofocus] = null;
+      this[disabled] = null;
+      this[incremental] = null;
+      this[indeterminate] = null;
+      this[name] = null;
+      this[value$] = null;
+    }
+    get autofocus() {
+      return this[autofocus];
+    }
+    set autofocus(value) {
+      this[autofocus] = value;
+    }
+    get disabled() {
+      return this[disabled];
+    }
+    set disabled(value) {
+      this[disabled] = value;
+    }
+    get incremental() {
+      return this[incremental];
+    }
+    set incremental(value) {
+      this[incremental] = value;
+    }
+    get indeterminate() {
+      return this[indeterminate];
+    }
+    set indeterminate(value) {
+      this[indeterminate] = value;
+    }
+    get name() {
+      return this[name];
+    }
+    set name(value) {
+      this[name] = value;
+    }
+    get value() {
+      return this[value$];
+    }
+    set value(value) {
+      this[value$] = value;
     }
   };
+  const autofocus = Symbol(html$.InputElementBase.name + "." + 'autofocus'.toString());
+  const disabled = Symbol(html$.InputElementBase.name + "." + 'disabled'.toString());
+  const incremental = Symbol(html$.InputElementBase.name + "." + 'incremental'.toString());
+  const indeterminate = Symbol(html$.InputElementBase.name + "." + 'indeterminate'.toString());
+  const name = Symbol(html$.InputElementBase.name + "." + 'name'.toString());
+  const value$ = Symbol(html$.InputElementBase.name + "." + 'value'.toString());
   html$.InputElementBase[dart.implements] = () => [html$.Element];
   dart.setSignature(html$.InputElementBase, {
     fields: () => ({
@@ -61016,18 +62143,88 @@
   ]);
   html$.TextInputElementBase = class TextInputElementBase extends core.Object {
     new() {
-      this[dartx.autocomplete] = null;
-      this[dartx.maxLength] = null;
-      this[dartx.pattern] = null;
-      this[dartx.placeholder] = null;
-      this[dartx.readOnly] = null;
-      this[dartx.required] = null;
-      this[dartx.size] = null;
-      this[dartx.selectionDirection] = null;
-      this[dartx.selectionEnd] = null;
-      this[dartx.selectionStart] = null;
+      this[autocomplete] = null;
+      this[maxLength] = null;
+      this[pattern] = null;
+      this[placeholder] = null;
+      this[readOnly] = null;
+      this[required] = null;
+      this[size] = null;
+      this[selectionDirection] = null;
+      this[selectionEnd] = null;
+      this[selectionStart] = null;
+    }
+    get autocomplete() {
+      return this[autocomplete];
+    }
+    set autocomplete(value) {
+      this[autocomplete] = value;
+    }
+    get maxLength() {
+      return this[maxLength];
+    }
+    set maxLength(value) {
+      this[maxLength] = value;
+    }
+    get pattern() {
+      return this[pattern];
+    }
+    set pattern(value) {
+      this[pattern] = value;
+    }
+    get placeholder() {
+      return this[placeholder];
+    }
+    set placeholder(value) {
+      this[placeholder] = value;
+    }
+    get readOnly() {
+      return this[readOnly];
+    }
+    set readOnly(value) {
+      this[readOnly] = value;
+    }
+    get required() {
+      return this[required];
+    }
+    set required(value) {
+      this[required] = value;
+    }
+    get size() {
+      return this[size];
+    }
+    set size(value) {
+      this[size] = value;
+    }
+    get selectionDirection() {
+      return this[selectionDirection];
+    }
+    set selectionDirection(value) {
+      this[selectionDirection] = value;
+    }
+    get selectionEnd() {
+      return this[selectionEnd];
+    }
+    set selectionEnd(value) {
+      this[selectionEnd] = value;
+    }
+    get selectionStart() {
+      return this[selectionStart];
+    }
+    set selectionStart(value) {
+      this[selectionStart] = value;
     }
   };
+  const autocomplete = Symbol(html$.TextInputElementBase.name + "." + 'autocomplete'.toString());
+  const maxLength = Symbol(html$.TextInputElementBase.name + "." + 'maxLength'.toString());
+  const pattern = Symbol(html$.TextInputElementBase.name + "." + 'pattern'.toString());
+  const placeholder = Symbol(html$.TextInputElementBase.name + "." + 'placeholder'.toString());
+  const readOnly = Symbol(html$.TextInputElementBase.name + "." + 'readOnly'.toString());
+  const required = Symbol(html$.TextInputElementBase.name + "." + 'required'.toString());
+  const size = Symbol(html$.TextInputElementBase.name + "." + 'size'.toString());
+  const selectionDirection = Symbol(html$.TextInputElementBase.name + "." + 'selectionDirection'.toString());
+  const selectionEnd = Symbol(html$.TextInputElementBase.name + "." + 'selectionEnd'.toString());
+  const selectionStart = Symbol(html$.TextInputElementBase.name + "." + 'selectionStart'.toString());
   html$.TextInputElementBase[dart.implements] = () => [html$.InputElementBase];
   dart.setSignature(html$.TextInputElementBase, {
     fields: () => ({
@@ -61072,10 +62269,17 @@
     static new() {
       return html$.InputElement.new({type: 'search'});
     }
+    get dirName() {
+      return this[dirName];
+    }
+    set dirName(value) {
+      this[dirName] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'search'})[dartx.type] == 'search';
     }
   };
+  const dirName = Symbol(html$.SearchInputElement.name + "." + 'dirName'.toString());
   html$.SearchInputElement[dart.implements] = () => [html$.TextInputElementBase];
   dart.setSignature(html$.SearchInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.SearchInputElement, [])}),
@@ -61090,7 +62294,14 @@
     static new() {
       return html$.InputElement.new({type: 'text'});
     }
+    get dirName() {
+      return this[dirName$];
+    }
+    set dirName(value) {
+      this[dirName$] = value;
+    }
   };
+  const dirName$ = Symbol(html$.TextInputElement.name + "." + 'dirName'.toString());
   html$.TextInputElement[dart.implements] = () => [html$.TextInputElementBase];
   dart.setSignature(html$.TextInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.TextInputElement, [])}),
@@ -61138,10 +62349,73 @@
     static new() {
       return html$.InputElement.new({type: 'email'});
     }
+    get autocomplete() {
+      return this[autocomplete$];
+    }
+    set autocomplete(value) {
+      this[autocomplete$] = value;
+    }
+    get autofocus() {
+      return this[autofocus$];
+    }
+    set autofocus(value) {
+      this[autofocus$] = value;
+    }
+    get maxLength() {
+      return this[maxLength$];
+    }
+    set maxLength(value) {
+      this[maxLength$] = value;
+    }
+    get multiple() {
+      return this[multiple];
+    }
+    set multiple(value) {
+      this[multiple] = value;
+    }
+    get pattern() {
+      return this[pattern$];
+    }
+    set pattern(value) {
+      this[pattern$] = value;
+    }
+    get placeholder() {
+      return this[placeholder$];
+    }
+    set placeholder(value) {
+      this[placeholder$] = value;
+    }
+    get readOnly() {
+      return this[readOnly$];
+    }
+    set readOnly(value) {
+      this[readOnly$] = value;
+    }
+    get required() {
+      return this[required$];
+    }
+    set required(value) {
+      this[required$] = value;
+    }
+    get size() {
+      return this[size$];
+    }
+    set size(value) {
+      this[size$] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'email'})[dartx.type] == 'email';
     }
   };
+  const autocomplete$ = Symbol(html$.EmailInputElement.name + "." + 'autocomplete'.toString());
+  const autofocus$ = Symbol(html$.EmailInputElement.name + "." + 'autofocus'.toString());
+  const maxLength$ = Symbol(html$.EmailInputElement.name + "." + 'maxLength'.toString());
+  const multiple = Symbol(html$.EmailInputElement.name + "." + 'multiple'.toString());
+  const pattern$ = Symbol(html$.EmailInputElement.name + "." + 'pattern'.toString());
+  const placeholder$ = Symbol(html$.EmailInputElement.name + "." + 'placeholder'.toString());
+  const readOnly$ = Symbol(html$.EmailInputElement.name + "." + 'readOnly'.toString());
+  const required$ = Symbol(html$.EmailInputElement.name + "." + 'required'.toString());
+  const size$ = Symbol(html$.EmailInputElement.name + "." + 'size'.toString());
   html$.EmailInputElement[dart.implements] = () => [html$.TextInputElementBase];
   dart.setSignature(html$.EmailInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.EmailInputElement, [])}),
@@ -61195,12 +62469,40 @@
   ]);
   html$.RangeInputElementBase = class RangeInputElementBase extends core.Object {
     new() {
-      this[dartx.max] = null;
-      this[dartx.min] = null;
-      this[dartx.step] = null;
-      this[dartx.valueAsNumber] = null;
+      this[max] = null;
+      this[min] = null;
+      this[step] = null;
+      this[valueAsNumber] = null;
+    }
+    get max() {
+      return this[max];
+    }
+    set max(value) {
+      this[max] = value;
+    }
+    get min() {
+      return this[min];
+    }
+    set min(value) {
+      this[min] = value;
+    }
+    get step() {
+      return this[step];
+    }
+    set step(value) {
+      this[step] = value;
+    }
+    get valueAsNumber() {
+      return this[valueAsNumber];
+    }
+    set valueAsNumber(value) {
+      this[valueAsNumber] = value;
     }
   };
+  const max = Symbol(html$.RangeInputElementBase.name + "." + 'max'.toString());
+  const min = Symbol(html$.RangeInputElementBase.name + "." + 'min'.toString());
+  const step = Symbol(html$.RangeInputElementBase.name + "." + 'step'.toString());
+  const valueAsNumber = Symbol(html$.RangeInputElementBase.name + "." + 'valueAsNumber'.toString());
   html$.RangeInputElementBase[dart.implements] = () => [html$.InputElementBase];
   dart.setSignature(html$.RangeInputElementBase, {
     fields: () => ({
@@ -61229,10 +62531,31 @@
     static new() {
       return html$.InputElement.new({type: 'date'});
     }
+    get valueAsDate() {
+      return this[valueAsDate];
+    }
+    set valueAsDate(value) {
+      this[valueAsDate] = value;
+    }
+    get readOnly() {
+      return this[readOnly$0];
+    }
+    set readOnly(value) {
+      this[readOnly$0] = value;
+    }
+    get required() {
+      return this[required$0];
+    }
+    set required(value) {
+      this[required$0] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'date'})[dartx.type] == 'date';
     }
   };
+  const valueAsDate = Symbol(html$.DateInputElement.name + "." + 'valueAsDate'.toString());
+  const readOnly$0 = Symbol(html$.DateInputElement.name + "." + 'readOnly'.toString());
+  const required$0 = Symbol(html$.DateInputElement.name + "." + 'required'.toString());
   html$.DateInputElement[dart.implements] = () => [html$.RangeInputElementBase];
   dart.setSignature(html$.DateInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.DateInputElement, [])}),
@@ -61260,10 +62583,31 @@
     static new() {
       return html$.InputElement.new({type: 'month'});
     }
+    get valueAsDate() {
+      return this[valueAsDate$];
+    }
+    set valueAsDate(value) {
+      this[valueAsDate$] = value;
+    }
+    get readOnly() {
+      return this[readOnly$1];
+    }
+    set readOnly(value) {
+      this[readOnly$1] = value;
+    }
+    get required() {
+      return this[required$1];
+    }
+    set required(value) {
+      this[required$1] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'month'})[dartx.type] == 'month';
     }
   };
+  const valueAsDate$ = Symbol(html$.MonthInputElement.name + "." + 'valueAsDate'.toString());
+  const readOnly$1 = Symbol(html$.MonthInputElement.name + "." + 'readOnly'.toString());
+  const required$1 = Symbol(html$.MonthInputElement.name + "." + 'required'.toString());
   html$.MonthInputElement[dart.implements] = () => [html$.RangeInputElementBase];
   dart.setSignature(html$.MonthInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.MonthInputElement, [])}),
@@ -61291,10 +62635,31 @@
     static new() {
       return html$.InputElement.new({type: 'week'});
     }
+    get valueAsDate() {
+      return this[valueAsDate$0];
+    }
+    set valueAsDate(value) {
+      this[valueAsDate$0] = value;
+    }
+    get readOnly() {
+      return this[readOnly$2];
+    }
+    set readOnly(value) {
+      this[readOnly$2] = value;
+    }
+    get required() {
+      return this[required$2];
+    }
+    set required(value) {
+      this[required$2] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'week'})[dartx.type] == 'week';
     }
   };
+  const valueAsDate$0 = Symbol(html$.WeekInputElement.name + "." + 'valueAsDate'.toString());
+  const readOnly$2 = Symbol(html$.WeekInputElement.name + "." + 'readOnly'.toString());
+  const required$2 = Symbol(html$.WeekInputElement.name + "." + 'required'.toString());
   html$.WeekInputElement[dart.implements] = () => [html$.RangeInputElementBase];
   dart.setSignature(html$.WeekInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.WeekInputElement, [])}),
@@ -61322,10 +62687,31 @@
     static new() {
       return html$.InputElement.new({type: 'time'});
     }
+    get valueAsDate() {
+      return this[valueAsDate$1];
+    }
+    set valueAsDate(value) {
+      this[valueAsDate$1] = value;
+    }
+    get readOnly() {
+      return this[readOnly$3];
+    }
+    set readOnly(value) {
+      this[readOnly$3] = value;
+    }
+    get required() {
+      return this[required$3];
+    }
+    set required(value) {
+      this[required$3] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'time'})[dartx.type] == 'time';
     }
   };
+  const valueAsDate$1 = Symbol(html$.TimeInputElement.name + "." + 'valueAsDate'.toString());
+  const readOnly$3 = Symbol(html$.TimeInputElement.name + "." + 'readOnly'.toString());
+  const required$3 = Symbol(html$.TimeInputElement.name + "." + 'required'.toString());
   html$.TimeInputElement[dart.implements] = () => [html$.RangeInputElementBase];
   dart.setSignature(html$.TimeInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.TimeInputElement, [])}),
@@ -61352,10 +62738,24 @@
     static new() {
       return html$.InputElement.new({type: 'datetime-local'});
     }
+    get readOnly() {
+      return this[readOnly$4];
+    }
+    set readOnly(value) {
+      this[readOnly$4] = value;
+    }
+    get required() {
+      return this[required$4];
+    }
+    set required(value) {
+      this[required$4] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'datetime-local'})[dartx.type] == 'datetime-local';
     }
   };
+  const readOnly$4 = Symbol(html$.LocalDateTimeInputElement.name + "." + 'readOnly'.toString());
+  const required$4 = Symbol(html$.LocalDateTimeInputElement.name + "." + 'required'.toString());
   html$.LocalDateTimeInputElement[dart.implements] = () => [html$.RangeInputElementBase];
   dart.setSignature(html$.LocalDateTimeInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.LocalDateTimeInputElement, [])}),
@@ -61375,10 +62775,31 @@
     static new() {
       return html$.InputElement.new({type: 'number'});
     }
+    get placeholder() {
+      return this[placeholder$0];
+    }
+    set placeholder(value) {
+      this[placeholder$0] = value;
+    }
+    get readOnly() {
+      return this[readOnly$5];
+    }
+    set readOnly(value) {
+      this[readOnly$5] = value;
+    }
+    get required() {
+      return this[required$5];
+    }
+    set required(value) {
+      this[required$5] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'number'})[dartx.type] == 'number';
     }
   };
+  const placeholder$0 = Symbol(html$.NumberInputElement.name + "." + 'placeholder'.toString());
+  const readOnly$5 = Symbol(html$.NumberInputElement.name + "." + 'readOnly'.toString());
+  const required$5 = Symbol(html$.NumberInputElement.name + "." + 'required'.toString());
   html$.NumberInputElement[dart.implements] = () => [html$.RangeInputElementBase];
   dart.setSignature(html$.NumberInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.NumberInputElement, [])}),
@@ -61418,7 +62839,21 @@
     static new() {
       return html$.InputElement.new({type: 'checkbox'});
     }
+    get checked() {
+      return this[checked];
+    }
+    set checked(value) {
+      this[checked] = value;
+    }
+    get required() {
+      return this[required$6];
+    }
+    set required(value) {
+      this[required$6] = value;
+    }
   };
+  const checked = Symbol(html$.CheckboxInputElement.name + "." + 'checked'.toString());
+  const required$6 = Symbol(html$.CheckboxInputElement.name + "." + 'required'.toString());
   html$.CheckboxInputElement[dart.implements] = () => [html$.InputElementBase];
   dart.setSignature(html$.CheckboxInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.CheckboxInputElement, [])}),
@@ -61436,7 +62871,21 @@
     static new() {
       return html$.InputElement.new({type: 'radio'});
     }
+    get checked() {
+      return this[checked$];
+    }
+    set checked(value) {
+      this[checked$] = value;
+    }
+    get required() {
+      return this[required$7];
+    }
+    set required(value) {
+      this[required$7] = value;
+    }
   };
+  const checked$ = Symbol(html$.RadioButtonInputElement.name + "." + 'checked'.toString());
+  const required$7 = Symbol(html$.RadioButtonInputElement.name + "." + 'required'.toString());
   html$.RadioButtonInputElement[dart.implements] = () => [html$.InputElementBase];
   dart.setSignature(html$.RadioButtonInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.RadioButtonInputElement, [])}),
@@ -61456,7 +62905,35 @@
     static new() {
       return html$.InputElement.new({type: 'file'});
     }
+    get accept() {
+      return this[accept];
+    }
+    set accept(value) {
+      this[accept] = value;
+    }
+    get multiple() {
+      return this[multiple$];
+    }
+    set multiple(value) {
+      this[multiple$] = value;
+    }
+    get required() {
+      return this[required$8];
+    }
+    set required(value) {
+      this[required$8] = value;
+    }
+    get files() {
+      return this[files];
+    }
+    set files(value) {
+      this[files] = value;
+    }
   };
+  const accept = Symbol(html$.FileUploadInputElement.name + "." + 'accept'.toString());
+  const multiple$ = Symbol(html$.FileUploadInputElement.name + "." + 'multiple'.toString());
+  const required$8 = Symbol(html$.FileUploadInputElement.name + "." + 'required'.toString());
+  const files = Symbol(html$.FileUploadInputElement.name + "." + 'files'.toString());
   html$.FileUploadInputElement[dart.implements] = () => [html$.InputElementBase];
   dart.setSignature(html$.FileUploadInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.FileUploadInputElement, [])}),
@@ -61488,7 +62965,42 @@
     static new() {
       return html$.InputElement.new({type: 'submit'});
     }
+    get formAction() {
+      return this[formAction];
+    }
+    set formAction(value) {
+      this[formAction] = value;
+    }
+    get formEnctype() {
+      return this[formEnctype];
+    }
+    set formEnctype(value) {
+      this[formEnctype] = value;
+    }
+    get formMethod() {
+      return this[formMethod];
+    }
+    set formMethod(value) {
+      this[formMethod] = value;
+    }
+    get formNoValidate() {
+      return this[formNoValidate];
+    }
+    set formNoValidate(value) {
+      this[formNoValidate] = value;
+    }
+    get formTarget() {
+      return this[formTarget];
+    }
+    set formTarget(value) {
+      this[formTarget] = value;
+    }
   };
+  const formAction = Symbol(html$.SubmitButtonInputElement.name + "." + 'formAction'.toString());
+  const formEnctype = Symbol(html$.SubmitButtonInputElement.name + "." + 'formEnctype'.toString());
+  const formMethod = Symbol(html$.SubmitButtonInputElement.name + "." + 'formMethod'.toString());
+  const formNoValidate = Symbol(html$.SubmitButtonInputElement.name + "." + 'formNoValidate'.toString());
+  const formTarget = Symbol(html$.SubmitButtonInputElement.name + "." + 'formTarget'.toString());
   html$.SubmitButtonInputElement[dart.implements] = () => [html$.InputElementBase];
   dart.setSignature(html$.SubmitButtonInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.SubmitButtonInputElement, [])}),
@@ -61527,7 +63039,70 @@
     static new() {
       return html$.InputElement.new({type: 'image'});
     }
+    get alt() {
+      return this[alt];
+    }
+    set alt(value) {
+      this[alt] = value;
+    }
+    get formAction() {
+      return this[formAction$];
+    }
+    set formAction(value) {
+      this[formAction$] = value;
+    }
+    get formEnctype() {
+      return this[formEnctype$];
+    }
+    set formEnctype(value) {
+      this[formEnctype$] = value;
+    }
+    get formMethod() {
+      return this[formMethod$];
+    }
+    set formMethod(value) {
+      this[formMethod$] = value;
+    }
+    get formNoValidate() {
+      return this[formNoValidate$];
+    }
+    set formNoValidate(value) {
+      this[formNoValidate$] = value;
+    }
+    get formTarget() {
+      return this[formTarget$];
+    }
+    set formTarget(value) {
+      this[formTarget$] = value;
+    }
+    get height() {
+      return this[height];
+    }
+    set height(value) {
+      this[height] = value;
+    }
+    get src() {
+      return this[src];
+    }
+    set src(value) {
+      this[src] = value;
+    }
+    get width() {
+      return this[width];
+    }
+    set width(value) {
+      this[width] = value;
+    }
   };
+  const alt = Symbol(html$.ImageButtonInputElement.name + "." + 'alt'.toString());
+  const formAction$ = Symbol(html$.ImageButtonInputElement.name + "." + 'formAction'.toString());
+  const formEnctype$ = Symbol(html$.ImageButtonInputElement.name + "." + 'formEnctype'.toString());
+  const formMethod$ = Symbol(html$.ImageButtonInputElement.name + "." + 'formMethod'.toString());
+  const formNoValidate$ = Symbol(html$.ImageButtonInputElement.name + "." + 'formNoValidate'.toString());
+  const formTarget$ = Symbol(html$.ImageButtonInputElement.name + "." + 'formTarget'.toString());
+  const height = Symbol(html$.ImageButtonInputElement.name + "." + 'height'.toString());
+  const src = Symbol(html$.ImageButtonInputElement.name + "." + 'src'.toString());
+  const width = Symbol(html$.ImageButtonInputElement.name + "." + 'width'.toString());
   html$.ImageButtonInputElement[dart.implements] = () => [html$.InputElementBase];
   dart.setSignature(html$.ImageButtonInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.ImageButtonInputElement, [])}),
@@ -61675,8 +63250,8 @@
     get [dartx.shiftKey]() {
       return this.shiftKey;
     }
-    [dartx.getModifierState](keyArg) {
-      return this.getModifierState(keyArg);
+    [dartx.getModifierState](...args) {
+      return this.getModifierState.apply(this, args);
     }
   };
   dart.setSignature(html$.KeyboardEvent, {
@@ -61851,14 +63426,14 @@
     get [dartx.willValidate]() {
       return this.willValidate;
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.KeygenElement, 'created');
@@ -62183,14 +63758,14 @@
     set [dartx.search](value) {
       this.search = value;
     }
-    [dartx.assign](url) {
-      return this.assign(url);
+    [dartx.assign](...args) {
+      return this.assign.apply(this, args);
     }
-    [dartx.reload]() {
-      return this.reload();
+    [dartx.reload](...args) {
+      return this.reload.apply(this, args);
     }
-    [dartx.replace](url) {
-      return this.replace(url);
+    [dartx.replace](...args) {
+      return this.replace.apply(this, args);
     }
     get [dartx.origin]() {
       if ("origin" in this) {
@@ -62337,14 +63912,14 @@
     set [dartx.volume](value) {
       this.volume = value;
     }
-    [dartx.pause]() {
-      return this.pause();
+    [dartx.pause](...args) {
+      return this.pause.apply(this, args);
     }
-    [dartx.play]() {
-      return this.play();
+    [dartx.play](...args) {
+      return this.play.apply(this, args);
     }
-    [dartx.unpause]() {
-      return this.unpause();
+    [dartx.unpause](...args) {
+      return this.unpause.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaController, {
@@ -62416,15 +63991,15 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.enumerateDevices]() {
-      return this.enumerateDevices();
+    [dartx.enumerateDevices](...args) {
+      return this.enumerateDevices.apply(this, args);
     }
     [dartx.getUserMedia](options) {
       let options_1 = html_common.convertDartToNative_Dictionary(options);
       return this[_getUserMedia_1](options_1);
     }
-    [_getUserMedia_1](options) {
-      return this.getUserMedia(options);
+    [_getUserMedia_1](...args) {
+      return this.getUserMedia.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaDevices, {
@@ -62686,20 +64261,20 @@
     get [dartx.sessionId]() {
       return this.sessionId;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.generateRequest](initDataType, initData) {
-      return this.generateRequest(initDataType, initData);
+    [dartx.generateRequest](...args) {
+      return this.generateRequest.apply(this, args);
     }
-    [dartx.load](sessionId) {
-      return this.load(sessionId);
+    [dartx.load](...args) {
+      return this.load.apply(this, args);
     }
-    [dartx.remove]() {
-      return this.remove();
+    [dartx.remove](...args) {
+      return this.remove.apply(this, args);
     }
-    [_update$](response) {
-      return this.update(response);
+    [_update$](...args) {
+      return this.update.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaKeySession, {
@@ -62748,14 +64323,14 @@
     get [dartx.keySystem]() {
       return this.keySystem;
     }
-    [dartx.createMediaKeys]() {
-      return this.createMediaKeys();
+    [dartx.createMediaKeys](...args) {
+      return this.createMediaKeys.apply(this, args);
     }
     [dartx.getConfiguration]() {
       return html_common.convertNativeToDart_Dictionary(this[_getConfiguration_1]());
     }
-    [_getConfiguration_1]() {
-      return this.getConfiguration();
+    [_getConfiguration_1](...args) {
+      return this.getConfiguration.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaKeySystemAccess, {
@@ -62776,11 +64351,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [_createSession](sessionType) {
-      return this.createSession(sessionType);
+    [_createSession](...args) {
+      return this.createSession.apply(this, args);
     }
-    [dartx.setServerCertificate](serverCertificate) {
-      return this.setServerCertificate(serverCertificate);
+    [dartx.setServerCertificate](...args) {
+      return this.setServerCertificate.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaKeys, {
@@ -62811,14 +64386,14 @@
     set [dartx.mediaText](value) {
       this.mediaText = value;
     }
-    [dartx.appendMedium](medium) {
-      return this.appendMedium(medium);
+    [dartx.appendMedium](...args) {
+      return this.appendMedium.apply(this, args);
     }
-    [dartx.deleteMedium](medium) {
-      return this.deleteMedium(medium);
+    [dartx.deleteMedium](...args) {
+      return this.deleteMedium.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaList, {
@@ -62851,11 +64426,11 @@
     get [dartx.media]() {
       return this.media;
     }
-    [dartx.addListener](listener) {
-      return this.addListener(listener);
+    [dartx.addListener](...args) {
+      return this.addListener.apply(this, args);
     }
-    [dartx.removeListener](listener) {
-      return this.removeListener(listener);
+    [dartx.removeListener](...args) {
+      return this.removeListener.apply(this, args);
     }
     get [dartx.onChange]() {
       return html$.MediaQueryList.changeEvent.forTarget(this);
@@ -62939,11 +64514,11 @@
     static _create_1() {
       return new MediaSession();
     }
-    [dartx.activate]() {
-      return this.activate();
+    [dartx.activate](...args) {
+      return this.activate.apply(this, args);
     }
-    [dartx.deactivate]() {
-      return this.deactivate();
+    [dartx.deactivate](...args) {
+      return this.deactivate.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaSession, {
@@ -62996,14 +64571,14 @@
     get [dartx.sourceBuffers]() {
       return this.sourceBuffers;
     }
-    [dartx.addSourceBuffer](type) {
-      return this.addSourceBuffer(type);
+    [dartx.addSourceBuffer](...args) {
+      return this.addSourceBuffer.apply(this, args);
     }
-    [dartx.endOfStream](error) {
-      return this.endOfStream(error);
+    [dartx.endOfStream](...args) {
+      return this.endOfStream.apply(this, args);
     }
-    [dartx.removeSourceBuffer](buffer) {
-      return this.removeSourceBuffer(buffer);
+    [dartx.removeSourceBuffer](...args) {
+      return this.removeSourceBuffer.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaSource, {
@@ -63085,29 +64660,29 @@
     get [dartx.label]() {
       return this.label;
     }
-    [dartx.addTrack](track) {
-      return this.addTrack(track);
+    [dartx.addTrack](...args) {
+      return this.addTrack.apply(this, args);
     }
-    [dartx.clone]() {
-      return this.clone();
+    [dartx.clone](...args) {
+      return this.clone.apply(this, args);
     }
-    [dartx.getAudioTracks]() {
-      return this.getAudioTracks();
+    [dartx.getAudioTracks](...args) {
+      return this.getAudioTracks.apply(this, args);
     }
-    [dartx.getTrackById](trackId) {
-      return this.getTrackById(trackId);
+    [dartx.getTrackById](...args) {
+      return this.getTrackById.apply(this, args);
     }
-    [dartx.getTracks]() {
-      return this.getTracks();
+    [dartx.getTracks](...args) {
+      return this.getTracks.apply(this, args);
     }
-    [dartx.getVideoTracks]() {
-      return this.getVideoTracks();
+    [dartx.getVideoTracks](...args) {
+      return this.getVideoTracks.apply(this, args);
     }
-    [dartx.removeTrack](track) {
-      return this.removeTrack(track);
+    [dartx.removeTrack](...args) {
+      return this.removeTrack.apply(this, args);
     }
-    [dartx.stop]() {
-      return this.stop();
+    [dartx.stop](...args) {
+      return this.stop.apply(this, args);
     }
     get [dartx.onAddTrack]() {
       return html$.MediaStream.addTrackEvent.forTarget(this);
@@ -63253,8 +64828,8 @@
     get [dartx.readyState]() {
       return this.readyState;
     }
-    [dartx.clone]() {
-      return this.clone();
+    [dartx.clone](...args) {
+      return this.clone.apply(this, args);
     }
     static getSources() {
       let completer = CompleterOfListOfSourceInfo().new();
@@ -63263,8 +64838,8 @@
       }, ListOfSourceInfoTovoid()));
       return completer.future;
     }
-    [dartx.stop]() {
-      return this.stop();
+    [dartx.stop](...args) {
+      return this.stop.apply(this, args);
     }
     get [dartx.onEnded]() {
       return html$.MediaStreamTrack.endedEvent.forTarget(this);
@@ -63575,8 +65150,8 @@
     get [_get_source]() {
       return this.source;
     }
-    [_initMessageEvent](typeArg, canBubbleArg, cancelableArg, dataArg, originArg, lastEventIdArg, sourceArg, portsArg) {
-      return this.initMessageEvent(typeArg, canBubbleArg, cancelableArg, dataArg, originArg, lastEventIdArg, sourceArg, portsArg);
+    [_initMessageEvent](...args) {
+      return this.initMessageEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.MessageEvent, {
@@ -63612,8 +65187,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
     [dartx.postMessage](message, transfer) {
       if (transfer === void 0) transfer = null;
@@ -63626,14 +65201,14 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [dartx.start]() {
-      return this.start();
+    [dartx.start](...args) {
+      return this.start.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.MessagePort.messageEvent.forTarget(this);
@@ -63927,11 +65502,11 @@
     get [dartx.version]() {
       return this.version;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.open]() {
-      return this.open();
+    [dartx.open](...args) {
+      return this.open.apply(this, args);
     }
   };
   dart.setSignature(html$.MidiPort, {
@@ -64041,8 +65616,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.send](data, timestamp) {
-      return this.send(data, timestamp);
+    [dartx.send](...args) {
+      return this.send.apply(this, args);
     }
   };
   dart.setSignature(html$.MidiOutput, {
@@ -64101,8 +65676,8 @@
   dart.registerExtension(dart.global.MimeType, html$.MimeType);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -64118,11 +65693,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -64151,13 +65726,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.namedItem](name) {
-      return this.namedItem(name);
+    [dartx.namedItem](...args) {
+      return this.namedItem.apply(this, args);
     }
   };
   html$.MimeTypeArray[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfMimeType()];
@@ -64171,8 +65746,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.MimeType, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.MimeType]),
+      [dartx._get]: dart.definiteFunctionType(html$.MimeType, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.MimeType]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.MimeType, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.MimeType, [core.int]),
       [dartx.namedItem]: dart.definiteFunctionType(html$.MimeType, [core.String])
@@ -64364,8 +65939,8 @@
       this[_initMouseEvent_1](type, bubbles, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget_1);
       return;
     }
-    [_initMouseEvent_1](type, bubbles, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget) {
-      return this.initMouseEvent(type, bubbles, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget);
+    [_initMouseEvent_1](...args) {
+      return this.initMouseEvent.apply(this, args);
     }
     get [dartx.client]() {
       return new (PointOfnum())(this[_clientX], this[_clientY]);
@@ -64447,6 +66022,7 @@
     names: ['_create_1', '_create_2']
   });
   dart.registerExtension(dart.global.MouseEvent, html$.MouseEvent);
+  dart.registerExtension(dart.global.DragEvent, html$.MouseEvent);
   html$.MutationCallback = dart.typedef('MutationCallback', () => dart.functionType(dart.void, [ListOfMutationRecord(), html$.MutationObserver]));
   const _observe_1 = Symbol('_observe_1');
   const _observe = Symbol('_observe');
@@ -64457,19 +66033,19 @@
     'observe'
   ]);
   html$.MutationObserver = class MutationObserver extends _interceptors.Interceptor {
-    [dartx.disconnect]() {
-      return this.disconnect();
+    [dartx.disconnect](...args) {
+      return this.disconnect.apply(this, args);
     }
     [_observe](target, options) {
       let options_1 = html_common.convertDartToNative_Dictionary(options);
       this[_observe_1](target, options_1);
       return;
     }
-    [_observe_1](target, options) {
-      return this.observe(target, options);
+    [_observe_1](...args) {
+      return this.observe.apply(this, args);
     }
-    [dartx.takeRecords]() {
-      return this.takeRecords();
+    [dartx.takeRecords](...args) {
+      return this.takeRecords.apply(this, args);
     }
     static get supported() {
       return !!(window.MutationObserver || window.WebKitMutationObserver);
@@ -64507,8 +66083,8 @@
     static _fixupList(list) {
       return list;
     }
-    [_call](target, options) {
-      return this.observe(target, options);
+    [_call](...args) {
+      return this.observe.apply(this, args);
     }
     static new(callback) {
       0;
@@ -64536,6 +66112,7 @@
   });
   html$.MutationObserver._boolKeys = dart.const(dart.map({childList: true, attributes: true, characterData: true, subtree: true, attributeOldValue: true, characterDataOldValue: true}, core.String, core.bool));
   dart.registerExtension(dart.global.MutationObserver, html$.MutationObserver);
+  dart.registerExtension(dart.global.WebKitMutationObserver, html$.MutationObserver);
   dart.defineExtensionNames([
     'addedNodes',
     'attributeName',
@@ -64661,8 +66238,8 @@
         this.getUserMedia = this.getUserMedia || this.webkitGetUserMedia || this.mozGetUserMedia || this.msGetUserMedia;
       }
     }
-    [_getUserMedia](options, success, error) {
-      return this.getUserMedia(options, success, error);
+    [_getUserMedia](...args) {
+      return this.getUserMedia.apply(this, args);
     }
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
@@ -64721,17 +66298,17 @@
     get [dartx.temporaryStorage]() {
       return this.webkitTemporaryStorage;
     }
-    [dartx.getBattery]() {
-      return this.getBattery();
+    [dartx.getBattery](...args) {
+      return this.getBattery.apply(this, args);
     }
-    [dartx.getGamepads]() {
-      return this.getGamepads();
+    [dartx.getGamepads](...args) {
+      return this.getGamepads.apply(this, args);
     }
-    [dartx.getVRDevices]() {
-      return this.getVRDevices();
+    [dartx.getVRDevices](...args) {
+      return this.getVRDevices.apply(this, args);
     }
-    [dartx.registerProtocolHandler](scheme, url, title) {
-      return this.registerProtocolHandler(scheme, url, title);
+    [dartx.registerProtocolHandler](...args) {
+      return this.registerProtocolHandler.apply(this, args);
     }
     [dartx.requestMidiAccess](options) {
       if (options === void 0) options = null;
@@ -64741,17 +66318,17 @@
       }
       return this[_requestMidiAccess_2]();
     }
-    [_requestMidiAccess_1](options) {
-      return this.requestMIDIAccess(options);
+    [_requestMidiAccess_1](...args) {
+      return this.requestMIDIAccess.apply(this, args);
     }
-    [_requestMidiAccess_2]() {
-      return this.requestMIDIAccess();
+    [_requestMidiAccess_2](...args) {
+      return this.requestMIDIAccess.apply(this, args);
     }
-    [dartx.requestMediaKeySystemAccess](keySystem, supportedConfigurations) {
-      return this.requestMediaKeySystemAccess(keySystem, supportedConfigurations);
+    [dartx.requestMediaKeySystemAccess](...args) {
+      return this.requestMediaKeySystemAccess.apply(this, args);
     }
-    [dartx.sendBeacon](url, data) {
-      return this.sendBeacon(url, data);
+    [dartx.sendBeacon](...args) {
+      return this.sendBeacon.apply(this, args);
     }
     get [dartx.hardwareConcurrency]() {
       return this.hardwareConcurrency;
@@ -64786,8 +66363,8 @@
     get [dartx.cookieEnabled]() {
       return this.cookieEnabled;
     }
-    [dartx.getStorageUpdates]() {
-      return this.getStorageUpdates();
+    [dartx.getStorageUpdates](...args) {
+      return this.getStorageUpdates.apply(this, args);
     }
   };
   html$.Navigator[dart.implements] = () => [html$.NavigatorStorageUtils, html$.NavigatorCpu, html$.NavigatorLanguage, html$.NavigatorOnLine, html$.NavigatorID];
@@ -64849,7 +66426,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get hardwareConcurrency() {
+      return this[hardwareConcurrency];
+    }
+    set hardwareConcurrency(value) {
+      super.hardwareConcurrency = value;
+    }
   };
+  const hardwareConcurrency = Symbol(html$.NavigatorCpu.name + "." + 'hardwareConcurrency'.toString());
   dart.setSignature(html$.NavigatorCpu, {
     constructors: () => ({_: dart.definiteFunctionType(html$.NavigatorCpu, [])}),
     fields: () => ({hardwareConcurrency: core.int})
@@ -64868,7 +66452,56 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get appCodeName() {
+      return this[appCodeName];
+    }
+    set appCodeName(value) {
+      super.appCodeName = value;
+    }
+    get appName() {
+      return this[appName];
+    }
+    set appName(value) {
+      super.appName = value;
+    }
+    get appVersion() {
+      return this[appVersion];
+    }
+    set appVersion(value) {
+      super.appVersion = value;
+    }
+    get dartEnabled() {
+      return this[dartEnabled];
+    }
+    set dartEnabled(value) {
+      super.dartEnabled = value;
+    }
+    get platform() {
+      return this[platform];
+    }
+    set platform(value) {
+      super.platform = value;
+    }
+    get product() {
+      return this[product];
+    }
+    set product(value) {
+      super.product = value;
+    }
+    get userAgent() {
+      return this[userAgent];
+    }
+    set userAgent(value) {
+      super.userAgent = value;
+    }
   };
+  const appCodeName = Symbol(html$.NavigatorID.name + "." + 'appCodeName'.toString());
+  const appName = Symbol(html$.NavigatorID.name + "." + 'appName'.toString());
+  const appVersion = Symbol(html$.NavigatorID.name + "." + 'appVersion'.toString());
+  const dartEnabled = Symbol(html$.NavigatorID.name + "." + 'dartEnabled'.toString());
+  const platform = Symbol(html$.NavigatorID.name + "." + 'platform'.toString());
+  const product = Symbol(html$.NavigatorID.name + "." + 'product'.toString());
+  const userAgent = Symbol(html$.NavigatorID.name + "." + 'userAgent'.toString());
   dart.setSignature(html$.NavigatorID, {
     constructors: () => ({_: dart.definiteFunctionType(html$.NavigatorID, [])}),
     fields: () => ({
@@ -64898,7 +66531,21 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get language() {
+      return this[language];
+    }
+    set language(value) {
+      super.language = value;
+    }
+    get languages() {
+      return this[languages];
+    }
+    set languages(value) {
+      super.languages = value;
+    }
   };
+  const language = Symbol(html$.NavigatorLanguage.name + "." + 'language'.toString());
+  const languages = Symbol(html$.NavigatorLanguage.name + "." + 'languages'.toString());
   dart.setSignature(html$.NavigatorLanguage, {
     constructors: () => ({_: dart.definiteFunctionType(html$.NavigatorLanguage, [])}),
     fields: () => ({
@@ -64914,7 +66561,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get onLine() {
+      return this[onLine];
+    }
+    set onLine(value) {
+      super.onLine = value;
+    }
   };
+  const onLine = Symbol(html$.NavigatorOnLine.name + "." + 'onLine'.toString());
   dart.setSignature(html$.NavigatorOnLine, {
     constructors: () => ({_: dart.definiteFunctionType(html$.NavigatorOnLine, [])}),
     fields: () => ({onLine: core.bool})
@@ -64931,8 +66585,8 @@
     get [dartx.cookieEnabled]() {
       return this.cookieEnabled;
     }
-    [dartx.getStorageUpdates]() {
-      return this.getStorageUpdates();
+    [dartx.getStorageUpdates](...args) {
+      return this.getStorageUpdates.apply(this, args);
     }
   };
   dart.setSignature(html$.NavigatorStorageUtils, {
@@ -65031,14 +66685,14 @@
       if (index == this.length) {
         this[_this][dartx.append](node);
       } else {
-        this[_this][dartx.insertBefore](node, this.get(index));
+        this[_this][dartx.insertBefore](node, this._get(index));
       }
     }
     insertAll(index, iterable) {
       if (index == this.length) {
         this.addAll(iterable);
       } else {
-        let item = this.get(index);
+        let item = this._get(index);
         this[_this][dartx.insertAllBefore](iterable, item);
       }
     }
@@ -65053,7 +66707,7 @@
       return result;
     }
     removeAt(index) {
-      let result = this.get(index);
+      let result = this._get(index);
       if (result != null) {
         this[_this][_removeChild](result);
       }
@@ -65085,8 +66739,8 @@
     clear() {
       this[_this][_clearChildren]();
     }
-    set(index, value) {
-      this[_this][_replaceChild](value, this.get(index));
+    _set(index, value) {
+      this[_this][_replaceChild](value, this._get(index));
       return value;
     }
     get iterator() {
@@ -65114,8 +66768,8 @@
     set length(value) {
       dart.throw(new core.UnsupportedError("Cannot set length on immutable List."));
     }
-    get(index) {
-      return this[_this][dartx.childNodes][dartx.get](index);
+    _get(index) {
+      return this[_this][dartx.childNodes][dartx._get](index);
     }
     get rawList() {
       return this[_this][dartx.childNodes];
@@ -65146,11 +66800,11 @@
       [_filter$]: dart.definiteFunctionType(dart.void, [NodeTobool(), core.bool]),
       removeWhere: dart.definiteFunctionType(dart.void, [NodeTobool()]),
       retainWhere: dart.definiteFunctionType(dart.void, [NodeTobool()]),
-      set: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
       sort: dart.definiteFunctionType(dart.void, [], [ComparatorOfNode()]),
       setRange: dart.definiteFunctionType(dart.void, [core.int, core.int, IterableOfNode()], [core.int]),
       fillRange: dart.definiteFunctionType(dart.void, [core.int, core.int], [html$.Node]),
-      get: dart.definiteFunctionType(html$.Node, [core.int])
+      _get: dart.definiteFunctionType(html$.Node, [core.int])
     })
   });
   dart.defineExtensionMembers(html$._ChildNodeListLazy, [
@@ -65165,12 +66819,12 @@
     'removeWhere',
     'retainWhere',
     'clear',
-    'set',
+    '_set',
     'sort',
     'shuffle',
     'setRange',
     'fillRange',
-    'get',
+    '_get',
     'first',
     'last',
     'single',
@@ -65239,14 +66893,14 @@
     get [dartx.whatToShow]() {
       return this.whatToShow;
     }
-    [dartx.detach]() {
-      return this.detach();
+    [dartx.detach](...args) {
+      return this.detach.apply(this, args);
     }
-    [dartx.nextNode]() {
-      return this.nextNode();
+    [dartx.nextNode](...args) {
+      return this.nextNode.apply(this, args);
     }
-    [dartx.previousNode]() {
-      return this.previousNode();
+    [dartx.previousNode](...args) {
+      return this.previousNode.apply(this, args);
     }
   };
   dart.setSignature(html$.NodeIterator, {
@@ -65269,8 +66923,8 @@
   dart.registerExtension(dart.global.NodeIterator, html$.NodeIterator);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -65284,11 +66938,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -65317,10 +66971,10 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [_item](index) {
-      return this.item(index);
+    [_item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$.NodeList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfNode()];
@@ -65334,13 +66988,14 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.Node, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
+      [dartx._get]: dart.definiteFunctionType(html$.Node, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.Node, [core.int]),
       [_item]: dart.definiteFunctionType(html$.Node, [core.int])
     })
   });
   dart.registerExtension(dart.global.NodeList, html$.NodeList);
+  dart.registerExtension(dart.global.RadioNodeList, html$.NodeList);
   dart.defineExtensionNames([
     'nextElementSibling',
     'previousElementSibling'
@@ -65371,8 +67026,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getElementById](elementId) {
-      return this.getElementById(elementId);
+    [dartx.getElementById](...args) {
+      return this.getElementById.apply(this, args);
     }
   };
   dart.setSignature(html$.NonElementParentNode, {
@@ -65405,11 +67060,11 @@
       let tag = opts && 'tag' in opts ? opts.tag : null;
       let icon = opts && 'icon' in opts ? opts.icon : null;
       let parsedOptions = dart.map();
-      if (dir != null) parsedOptions[dartx.set]('dir', dir);
-      if (body != null) parsedOptions[dartx.set]('body', body);
-      if (lang != null) parsedOptions[dartx.set]('lang', lang);
-      if (tag != null) parsedOptions[dartx.set]('tag', tag);
-      if (icon != null) parsedOptions[dartx.set]('icon', icon);
+      if (dir != null) parsedOptions[dartx._set]('dir', dir);
+      if (body != null) parsedOptions[dartx._set]('body', body);
+      if (lang != null) parsedOptions[dartx._set]('lang', lang);
+      if (tag != null) parsedOptions[dartx._set]('tag', tag);
+      if (icon != null) parsedOptions[dartx._set]('icon', icon);
       return html$.Notification._factoryNotification(title, parsedOptions);
     }
     static _() {
@@ -65462,8 +67117,8 @@
     get [dartx.vibrate]() {
       return this.vibrate;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
     static requestPermission() {
       let completer = CompleterOfString().new();
@@ -65716,20 +67371,20 @@
     get [dartx.willValidate]() {
       return this.willValidate;
     }
-    [__getter__](index_OR_name) {
-      return this.__getter__(index_OR_name);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [__setter__](index_OR_name, value) {
-      return this.__setter__(index_OR_name, value);
+    [__setter__](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.ObjectElement, 'created');
@@ -66003,14 +67658,14 @@
     get [dartx.willValidate]() {
       return this.willValidate;
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.OutputElement, 'created');
@@ -66244,35 +67899,35 @@
     static _create_3(path_OR_text) {
       return new Path2D(path_OR_text);
     }
-    [dartx.addPath](path, transform) {
-      return this.addPath(path, transform);
+    [dartx.addPath](...args) {
+      return this.addPath.apply(this, args);
     }
-    [dartx.arc](x, y, radius, startAngle, endAngle, anticlockwise) {
-      return this.arc(x, y, radius, startAngle, endAngle, anticlockwise);
+    [dartx.arc](...args) {
+      return this.arc.apply(this, args);
     }
-    [dartx.arcTo](x1, y1, x2, y2, radius) {
-      return this.arcTo(x1, y1, x2, y2, radius);
+    [dartx.arcTo](...args) {
+      return this.arcTo.apply(this, args);
     }
-    [dartx.bezierCurveTo](cp1x, cp1y, cp2x, cp2y, x, y) {
-      return this.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
+    [dartx.bezierCurveTo](...args) {
+      return this.bezierCurveTo.apply(this, args);
     }
-    [dartx.closePath]() {
-      return this.closePath();
+    [dartx.closePath](...args) {
+      return this.closePath.apply(this, args);
     }
-    [dartx.ellipse](x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
-      return this.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
+    [dartx.ellipse](...args) {
+      return this.ellipse.apply(this, args);
     }
-    [dartx.lineTo](x, y) {
-      return this.lineTo(x, y);
+    [dartx.lineTo](...args) {
+      return this.lineTo.apply(this, args);
     }
-    [dartx.moveTo](x, y) {
-      return this.moveTo(x, y);
+    [dartx.moveTo](...args) {
+      return this.moveTo.apply(this, args);
     }
-    [dartx.quadraticCurveTo](cpx, cpy, x, y) {
-      return this.quadraticCurveTo(cpx, cpy, x, y);
+    [dartx.quadraticCurveTo](...args) {
+      return this.quadraticCurveTo.apply(this, args);
     }
-    [dartx.rect](x, y, width, height) {
-      return this.rect(x, y, width, height);
+    [dartx.rect](...args) {
+      return this.rect.apply(this, args);
     }
   };
   html$.Path2D[dart.implements] = () => [html$._CanvasPathMethods];
@@ -66335,41 +67990,41 @@
     get [dartx.timing]() {
       return this.timing;
     }
-    [dartx.clearFrameTimings]() {
-      return this.clearFrameTimings();
+    [dartx.clearFrameTimings](...args) {
+      return this.clearFrameTimings.apply(this, args);
     }
-    [dartx.clearMarks](markName) {
-      return this.clearMarks(markName);
+    [dartx.clearMarks](...args) {
+      return this.clearMarks.apply(this, args);
     }
-    [dartx.clearMeasures](measureName) {
-      return this.clearMeasures(measureName);
+    [dartx.clearMeasures](...args) {
+      return this.clearMeasures.apply(this, args);
     }
-    [dartx.getEntries]() {
-      return this.getEntries();
+    [dartx.getEntries](...args) {
+      return this.getEntries.apply(this, args);
     }
-    [dartx.getEntriesByName](name, entryType) {
-      return this.getEntriesByName(name, entryType);
+    [dartx.getEntriesByName](...args) {
+      return this.getEntriesByName.apply(this, args);
     }
-    [dartx.getEntriesByType](entryType) {
-      return this.getEntriesByType(entryType);
+    [dartx.getEntriesByType](...args) {
+      return this.getEntriesByType.apply(this, args);
     }
-    [dartx.mark](markName) {
-      return this.mark(markName);
+    [dartx.mark](...args) {
+      return this.mark.apply(this, args);
     }
-    [dartx.measure](measureName, startMark, endMark) {
-      return this.measure(measureName, startMark, endMark);
+    [dartx.measure](...args) {
+      return this.measure.apply(this, args);
     }
-    [dartx.now]() {
-      return this.now();
+    [dartx.now](...args) {
+      return this.now.apply(this, args);
     }
-    [dartx.setFrameTimingBufferSize](maxSize) {
-      return this.setFrameTimingBufferSize(maxSize);
+    [dartx.setFrameTimingBufferSize](...args) {
+      return this.setFrameTimingBufferSize.apply(this, args);
     }
-    [dartx.clearResourceTimings]() {
-      return this.webkitClearResourceTimings();
+    [dartx.clearResourceTimings](...args) {
+      return this.webkitClearResourceTimings.apply(this, args);
     }
-    [dartx.setResourceTimingBufferSize](maxSize) {
-      return this.webkitSetResourceTimingBufferSize(maxSize);
+    [dartx.setResourceTimingBufferSize](...args) {
+      return this.webkitSetResourceTimingBufferSize.apply(this, args);
     }
     get [dartx.onResourceTimingBufferFull]() {
       return html$.Performance.resourceTimingBufferFullEvent.forTarget(this);
@@ -66762,14 +68417,14 @@
     get [dartx.minPossiblePeriod]() {
       return this.minPossiblePeriod;
     }
-    [dartx.getRegistration](tag) {
-      return this.getRegistration(tag);
+    [dartx.getRegistration](...args) {
+      return this.getRegistration.apply(this, args);
     }
-    [dartx.getRegistrations]() {
-      return this.getRegistrations();
+    [dartx.getRegistrations](...args) {
+      return this.getRegistrations.apply(this, args);
     }
-    [dartx.permissionState]() {
-      return this.permissionState();
+    [dartx.permissionState](...args) {
+      return this.permissionState.apply(this, args);
     }
     [dartx.register](options) {
       if (options === void 0) options = null;
@@ -66779,11 +68434,11 @@
       }
       return this[_register_2]();
     }
-    [_register_1](options) {
-      return this.register(options);
+    [_register_1](...args) {
+      return this.register.apply(this, args);
     }
-    [_register_2]() {
-      return this.register();
+    [_register_2](...args) {
+      return this.register.apply(this, args);
     }
   };
   dart.setSignature(html$.PeriodicSyncManager, {
@@ -66822,8 +68477,8 @@
     get [dartx.tag]() {
       return this.tag;
     }
-    [dartx.unregister]() {
-      return this.unregister();
+    [dartx.unregister](...args) {
+      return this.unregister.apply(this, args);
     }
   };
   dart.setSignature(html$.PeriodicSyncRegistration, {
@@ -66878,8 +68533,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.query](permission) {
-      return this.query(permission);
+    [dartx.query](...args) {
+      return this.query.apply(this, args);
     }
   };
   dart.setSignature(html$.Permissions, {
@@ -66927,11 +68582,11 @@
     get [dartx.name]() {
       return this.name;
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.namedItem](name) {
-      return this.namedItem(name);
+    [dartx.namedItem](...args) {
+      return this.namedItem.apply(this, args);
     }
   };
   dart.setSignature(html$.Plugin, {
@@ -66950,8 +68605,8 @@
   dart.registerExtension(dart.global.Plugin, html$.Plugin);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -66968,11 +68623,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -67001,16 +68656,16 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.namedItem](name) {
-      return this.namedItem(name);
+    [dartx.namedItem](...args) {
+      return this.namedItem.apply(this, args);
     }
-    [dartx.refresh](reload) {
-      return this.refresh(reload);
+    [dartx.refresh](...args) {
+      return this.refresh.apply(this, args);
     }
   };
   html$.PluginArray[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfPlugin()];
@@ -67024,8 +68679,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.Plugin, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.Plugin]),
+      [dartx._get]: dart.definiteFunctionType(html$.Plugin, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.Plugin]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.Plugin, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.Plugin, [core.int]),
       [dartx.namedItem]: dart.definiteFunctionType(html$.Plugin, [core.String]),
@@ -67059,8 +68714,8 @@
     set [dartx.message](value) {
       this.message = value;
     }
-    [dartx.createdCallback]() {
-      return this.createdCallback();
+    [dartx.createdCallback](...args) {
+      return this.createdCallback.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.PluginPlaceholderElement, 'created');
@@ -67235,14 +68890,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getImmediateState]() {
-      return this.getImmediateState();
+    [dartx.getImmediateState](...args) {
+      return this.getImmediateState.apply(this, args);
     }
-    [dartx.getState]() {
-      return this.getState();
+    [dartx.getState](...args) {
+      return this.getState.apply(this, args);
     }
-    [dartx.resetSensor]() {
-      return this.resetSensor();
+    [dartx.resetSensor](...args) {
+      return this.resetSensor.apply(this, args);
     }
   };
   dart.setSignature(html$.PositionSensorVRDevice, {
@@ -67287,14 +68942,14 @@
     get [dartx.session]() {
       return this.session;
     }
-    [dartx.getAvailability](url) {
-      return this.getAvailability(url);
+    [dartx.getAvailability](...args) {
+      return this.getAvailability.apply(this, args);
     }
-    [dartx.joinSession](url, presentationId) {
-      return this.joinSession(url, presentationId);
+    [dartx.joinSession](...args) {
+      return this.joinSession.apply(this, args);
     }
-    [dartx.startSession](url) {
-      return this.startSession(url);
+    [dartx.startSession](...args) {
+      return this.startSession.apply(this, args);
     }
   };
   dart.setSignature(html$.Presentation, {
@@ -67358,11 +69013,11 @@
     get [dartx.state]() {
       return this.state;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.send](data_OR_message) {
-      return this.send(data_OR_message);
+    [dartx.send](...args) {
+      return this.send.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.PresentationSession.messageEvent.forTarget(this);
@@ -67615,8 +69270,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getSubscription]() {
-      return this.getSubscription();
+    [dartx.getSubscription](...args) {
+      return this.getSubscription.apply(this, args);
     }
     [dartx.permissionState](options) {
       if (options === void 0) options = null;
@@ -67626,11 +69281,11 @@
       }
       return this[_permissionState_2]();
     }
-    [_permissionState_1](options) {
-      return this.permissionState(options);
+    [_permissionState_1](...args) {
+      return this.permissionState.apply(this, args);
     }
-    [_permissionState_2]() {
-      return this.permissionState();
+    [_permissionState_2](...args) {
+      return this.permissionState.apply(this, args);
     }
     [dartx.subscribe](options) {
       if (options === void 0) options = null;
@@ -67640,11 +69295,11 @@
       }
       return this[_subscribe_2]();
     }
-    [_subscribe_1](options) {
-      return this.subscribe(options);
+    [_subscribe_1](...args) {
+      return this.subscribe.apply(this, args);
     }
-    [_subscribe_2]() {
-      return this.subscribe();
+    [_subscribe_2](...args) {
+      return this.subscribe.apply(this, args);
     }
   };
   dart.setSignature(html$.PushManager, {
@@ -67676,17 +69331,17 @@
     static _create_1(message) {
       return new PushMessageData(message);
     }
-    [dartx.arrayBuffer]() {
-      return this.arrayBuffer();
+    [dartx.arrayBuffer](...args) {
+      return this.arrayBuffer.apply(this, args);
     }
-    [dartx.blob]() {
-      return this.blob();
+    [dartx.blob](...args) {
+      return this.blob.apply(this, args);
     }
-    [dartx.json]() {
-      return this.json();
+    [dartx.json](...args) {
+      return this.json.apply(this, args);
     }
-    [dartx.text]() {
-      return this.text();
+    [dartx.text](...args) {
+      return this.text.apply(this, args);
     }
   };
   dart.setSignature(html$.PushMessageData, {
@@ -67715,8 +69370,8 @@
     get [dartx.endpoint]() {
       return this.endpoint;
     }
-    [dartx.unsubscribe]() {
-      return this.unsubscribe();
+    [dartx.unsubscribe](...args) {
+      return this.unsubscribe.apply(this, args);
     }
   };
   dart.setSignature(html$.PushSubscription, {
@@ -67818,74 +69473,74 @@
     get [dartx.startOffset]() {
       return this.startOffset;
     }
-    [dartx.cloneContents]() {
-      return this.cloneContents();
+    [dartx.cloneContents](...args) {
+      return this.cloneContents.apply(this, args);
     }
-    [dartx.cloneRange]() {
-      return this.cloneRange();
+    [dartx.cloneRange](...args) {
+      return this.cloneRange.apply(this, args);
     }
-    [dartx.collapse](toStart) {
-      return this.collapse(toStart);
+    [dartx.collapse](...args) {
+      return this.collapse.apply(this, args);
     }
-    [dartx.compareBoundaryPoints](how, sourceRange) {
-      return this.compareBoundaryPoints(how, sourceRange);
+    [dartx.compareBoundaryPoints](...args) {
+      return this.compareBoundaryPoints.apply(this, args);
     }
-    [dartx.comparePoint](node, offset) {
-      return this.comparePoint(node, offset);
+    [dartx.comparePoint](...args) {
+      return this.comparePoint.apply(this, args);
     }
-    [dartx.createContextualFragment](fragment) {
-      return this.createContextualFragment(fragment);
+    [dartx.createContextualFragment](...args) {
+      return this.createContextualFragment.apply(this, args);
     }
-    [dartx.deleteContents]() {
-      return this.deleteContents();
+    [dartx.deleteContents](...args) {
+      return this.deleteContents.apply(this, args);
     }
-    [dartx.detach]() {
-      return this.detach();
+    [dartx.detach](...args) {
+      return this.detach.apply(this, args);
     }
-    [dartx.expand](unit) {
-      return this.expand(unit);
+    [dartx.expand](...args) {
+      return this.expand.apply(this, args);
     }
-    [dartx.extractContents]() {
-      return this.extractContents();
+    [dartx.extractContents](...args) {
+      return this.extractContents.apply(this, args);
     }
-    [dartx.getBoundingClientRect]() {
-      return this.getBoundingClientRect();
+    [dartx.getBoundingClientRect](...args) {
+      return this.getBoundingClientRect.apply(this, args);
     }
-    [dartx.getClientRects]() {
-      return this.getClientRects();
+    [dartx.getClientRects](...args) {
+      return this.getClientRects.apply(this, args);
     }
-    [dartx.insertNode](node) {
-      return this.insertNode(node);
+    [dartx.insertNode](...args) {
+      return this.insertNode.apply(this, args);
     }
-    [dartx.isPointInRange](node, offset) {
-      return this.isPointInRange(node, offset);
+    [dartx.isPointInRange](...args) {
+      return this.isPointInRange.apply(this, args);
     }
-    [dartx.selectNode](node) {
-      return this.selectNode(node);
+    [dartx.selectNode](...args) {
+      return this.selectNode.apply(this, args);
     }
-    [dartx.selectNodeContents](node) {
-      return this.selectNodeContents(node);
+    [dartx.selectNodeContents](...args) {
+      return this.selectNodeContents.apply(this, args);
     }
-    [dartx.setEnd](node, offset) {
-      return this.setEnd(node, offset);
+    [dartx.setEnd](...args) {
+      return this.setEnd.apply(this, args);
     }
-    [dartx.setEndAfter](node) {
-      return this.setEndAfter(node);
+    [dartx.setEndAfter](...args) {
+      return this.setEndAfter.apply(this, args);
     }
-    [dartx.setEndBefore](node) {
-      return this.setEndBefore(node);
+    [dartx.setEndBefore](...args) {
+      return this.setEndBefore.apply(this, args);
     }
-    [dartx.setStart](node, offset) {
-      return this.setStart(node, offset);
+    [dartx.setStart](...args) {
+      return this.setStart.apply(this, args);
     }
-    [dartx.setStartAfter](node) {
-      return this.setStartAfter(node);
+    [dartx.setStartAfter](...args) {
+      return this.setStartAfter.apply(this, args);
     }
-    [dartx.setStartBefore](node) {
-      return this.setStartBefore(node);
+    [dartx.setStartBefore](...args) {
+      return this.setStartBefore.apply(this, args);
     }
-    [dartx.surroundContents](newParent) {
-      return this.surroundContents(newParent);
+    [dartx.surroundContents](...args) {
+      return this.surroundContents.apply(this, args);
     }
     static get supportsCreateContextualFragment() {
       return "createContextualFragment" in window.Range.prototype;
@@ -67951,11 +69606,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.cancel](reason) {
-      return this.cancel(reason);
+    [dartx.cancel](...args) {
+      return this.cancel.apply(this, args);
     }
-    [dartx.getReader]() {
-      return this.getReader();
+    [dartx.getReader](...args) {
+      return this.getReader.apply(this, args);
     }
   };
   dart.setSignature(html$.ReadableByteStream, {
@@ -67979,14 +69634,14 @@
     get [dartx.closed]() {
       return this.closed;
     }
-    [dartx.cancel](reason) {
-      return this.cancel(reason);
+    [dartx.cancel](...args) {
+      return this.cancel.apply(this, args);
     }
-    [dartx.read]() {
-      return this.read();
+    [dartx.read](...args) {
+      return this.read.apply(this, args);
     }
-    [dartx.releaseLock]() {
-      return this.releaseLock();
+    [dartx.releaseLock](...args) {
+      return this.releaseLock.apply(this, args);
     }
   };
   dart.setSignature(html$.ReadableByteStreamReader, {
@@ -68007,11 +69662,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.cancel](reason) {
-      return this.cancel(reason);
+    [dartx.cancel](...args) {
+      return this.cancel.apply(this, args);
     }
-    [dartx.getReader]() {
-      return this.getReader();
+    [dartx.getReader](...args) {
+      return this.getReader.apply(this, args);
     }
   };
   dart.setSignature(html$.ReadableStream, {
@@ -68035,14 +69690,14 @@
     get [dartx.closed]() {
       return this.closed;
     }
-    [dartx.cancel](reason) {
-      return this.cancel(reason);
+    [dartx.cancel](...args) {
+      return this.cancel.apply(this, args);
     }
-    [dartx.read]() {
-      return this.read();
+    [dartx.read](...args) {
+      return this.read.apply(this, args);
     }
-    [dartx.releaseLock]() {
-      return this.releaseLock();
+    [dartx.releaseLock](...args) {
+      return this.releaseLock.apply(this, args);
     }
   };
   dart.setSignature(html$.ReadableStreamReader, {
@@ -68177,23 +69832,23 @@
     get [dartx.reliable]() {
       return this.reliable;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.send](data) {
-      return this.send(data);
+    [dartx.send](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendBlob](data) {
-      return this.send(data);
+    [dartx.sendBlob](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendByteBuffer](data) {
-      return this.send(data);
+    [dartx.sendByteBuffer](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendString](data) {
-      return this.send(data);
+    [dartx.sendString](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendTypedData](data) {
-      return this.send(data);
+    [dartx.sendTypedData](...args) {
+      return this.send.apply(this, args);
     }
     get [dartx.onClose]() {
       return html$.RtcDataChannel.closeEvent.forTarget(this);
@@ -68259,6 +69914,7 @@
     }
   });
   dart.registerExtension(dart.global.RTCDataChannel, html$.RtcDataChannel);
+  dart.registerExtension(dart.global.DataChannel, html$.RtcDataChannel);
   dart.defineExtensionNames([
     'channel'
   ]);
@@ -68303,8 +69959,8 @@
     get [dartx.track]() {
       return this.track;
     }
-    [dartx.insertDtmf](tones, duration, interToneGap) {
-      return this.insertDTMF(tones, duration, interToneGap);
+    [dartx.insertDtmf](...args) {
+      return this.insertDTMF.apply(this, args);
     }
     get [dartx.onToneChange]() {
       return html$.RtcDtmfSender.toneChangeEvent.forTarget(this);
@@ -68401,6 +70057,7 @@
     })
   });
   dart.registerExtension(dart.global.RTCIceCandidate, html$.RtcIceCandidate);
+  dart.registerExtension(dart.global.mozRTCIceCandidate, html$.RtcIceCandidate);
   dart.defineExtensionNames([
     'candidate'
   ]);
@@ -68417,6 +70074,7 @@
     fields: () => ({[dartx.candidate]: html$.RtcIceCandidate})
   });
   dart.registerExtension(dart.global.RTCIceCandidateEvent, html$.RtcIceCandidateEvent);
+  dart.registerExtension(dart.global.RTCPeerConnectionIceEvent, html$.RtcIceCandidateEvent);
   const _createOffer = Symbol('_createOffer');
   const _createAnswer = Symbol('_createAnswer');
   const _getStats = Symbol('_getStats');
@@ -68527,8 +70185,8 @@
     get [dartx.signalingState]() {
       return this.signalingState;
     }
-    [dartx.addIceCandidate](candidate, successCallback, failureCallback) {
-      return this.addIceCandidate(candidate, successCallback, failureCallback);
+    [dartx.addIceCandidate](...args) {
+      return this.addIceCandidate.apply(this, args);
     }
     [dartx.addStream](stream, mediaConstraints) {
       if (mediaConstraints === void 0) mediaConstraints = null;
@@ -68540,14 +70198,14 @@
       this[_addStream_2](stream);
       return;
     }
-    [_addStream_1](stream, mediaConstraints) {
-      return this.addStream(stream, mediaConstraints);
+    [_addStream_1](...args) {
+      return this.addStream.apply(this, args);
     }
-    [_addStream_2](stream) {
-      return this.addStream(stream);
+    [_addStream_2](...args) {
+      return this.addStream.apply(this, args);
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
     [_createAnswer](successCallback, failureCallback, mediaConstraints) {
       if (failureCallback === void 0) failureCallback = null;
@@ -68560,14 +70218,14 @@
       this[_createAnswer_2](successCallback, failureCallback);
       return;
     }
-    [_createAnswer_1](successCallback, failureCallback, mediaConstraints) {
-      return this.createAnswer(successCallback, failureCallback, mediaConstraints);
+    [_createAnswer_1](...args) {
+      return this.createAnswer.apply(this, args);
     }
-    [_createAnswer_2](successCallback, failureCallback) {
-      return this.createAnswer(successCallback, failureCallback);
+    [_createAnswer_2](...args) {
+      return this.createAnswer.apply(this, args);
     }
-    [dartx.createDtmfSender](track) {
-      return this.createDTMFSender(track);
+    [dartx.createDtmfSender](...args) {
+      return this.createDTMFSender.apply(this, args);
     }
     [dartx.createDataChannel](label, options) {
       if (options === void 0) options = null;
@@ -68577,11 +70235,11 @@
       }
       return this[_createDataChannel_2](label);
     }
-    [_createDataChannel_1](label, options) {
-      return this.createDataChannel(label, options);
+    [_createDataChannel_1](...args) {
+      return this.createDataChannel.apply(this, args);
     }
-    [_createDataChannel_2](label) {
-      return this.createDataChannel(label);
+    [_createDataChannel_2](...args) {
+      return this.createDataChannel.apply(this, args);
     }
     [_createOffer](successCallback, failureCallback, rtcOfferOptions) {
       if (failureCallback === void 0) failureCallback = null;
@@ -68594,29 +70252,29 @@
       this[_createOffer_2](successCallback, failureCallback);
       return;
     }
-    [_createOffer_1](successCallback, failureCallback, rtcOfferOptions) {
-      return this.createOffer(successCallback, failureCallback, rtcOfferOptions);
+    [_createOffer_1](...args) {
+      return this.createOffer.apply(this, args);
     }
-    [_createOffer_2](successCallback, failureCallback) {
-      return this.createOffer(successCallback, failureCallback);
+    [_createOffer_2](...args) {
+      return this.createOffer.apply(this, args);
     }
-    [dartx.getLocalStreams]() {
-      return this.getLocalStreams();
+    [dartx.getLocalStreams](...args) {
+      return this.getLocalStreams.apply(this, args);
     }
-    [dartx.getRemoteStreams]() {
-      return this.getRemoteStreams();
+    [dartx.getRemoteStreams](...args) {
+      return this.getRemoteStreams.apply(this, args);
     }
-    [_getStats](successCallback, selector) {
-      return this.getStats(successCallback, selector);
+    [_getStats](...args) {
+      return this.getStats.apply(this, args);
     }
-    [dartx.getStreamById](streamId) {
-      return this.getStreamById(streamId);
+    [dartx.getStreamById](...args) {
+      return this.getStreamById.apply(this, args);
     }
-    [dartx.removeStream](stream) {
-      return this.removeStream(stream);
+    [dartx.removeStream](...args) {
+      return this.removeStream.apply(this, args);
     }
-    [_setLocalDescription](description, successCallback, failureCallback) {
-      return this.setLocalDescription(description, successCallback, failureCallback);
+    [_setLocalDescription](...args) {
+      return this.setLocalDescription.apply(this, args);
     }
     [dartx.setLocalDescription](description) {
       let completer = async.Completer.new();
@@ -68627,8 +70285,8 @@
       }, StringTovoid$()));
       return completer.future;
     }
-    [_setRemoteDescription](description, successCallback, failureCallback) {
-      return this.setRemoteDescription(description, successCallback, failureCallback);
+    [_setRemoteDescription](...args) {
+      return this.setRemoteDescription.apply(this, args);
     }
     [dartx.setRemoteDescription](description) {
       let completer = async.Completer.new();
@@ -68656,14 +70314,14 @@
       this[_updateIce_3]();
       return;
     }
-    [_updateIce_1](configuration, mediaConstraints) {
-      return this.updateIce(configuration, mediaConstraints);
+    [_updateIce_1](...args) {
+      return this.updateIce.apply(this, args);
     }
-    [_updateIce_2](configuration) {
-      return this.updateIce(configuration);
+    [_updateIce_2](...args) {
+      return this.updateIce.apply(this, args);
     }
-    [_updateIce_3]() {
-      return this.updateIce();
+    [_updateIce_3](...args) {
+      return this.updateIce.apply(this, args);
     }
     get [dartx.onAddStream]() {
       return html$.RtcPeerConnection.addStreamEvent.forTarget(this);
@@ -68776,6 +70434,7 @@
     }
   });
   dart.registerExtension(dart.global.RTCPeerConnection, html$.RtcPeerConnection);
+  dart.registerExtension(dart.global.mozRTCPeerConnection, html$.RtcPeerConnection);
   dart.defineExtensionNames([
     'sdp',
     'type'
@@ -68812,6 +70471,7 @@
     })
   });
   dart.registerExtension(dart.global.RTCSessionDescription, html$.RtcSessionDescription);
+  dart.registerExtension(dart.global.mozRTCSessionDescription, html$.RtcSessionDescription);
   const _get_timestamp = Symbol('_get_timestamp');
   dart.defineExtensionNames([
     'timestamp',
@@ -68836,11 +70496,11 @@
     get [dartx.type]() {
       return this.type;
     }
-    [dartx.names]() {
-      return this.names();
+    [dartx.names](...args) {
+      return this.names.apply(this, args);
     }
-    [dartx.stat](name) {
-      return this.stat(name);
+    [dartx.stat](...args) {
+      return this.stat.apply(this, args);
     }
   };
   dart.setSignature(html$.RtcStatsReport, {
@@ -68865,11 +70525,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.namedItem](name) {
-      return this.namedItem(name);
+    [dartx.namedItem](...args) {
+      return this.namedItem.apply(this, args);
     }
-    [dartx.result]() {
-      return this.result();
+    [dartx.result](...args) {
+      return this.result.apply(this, args);
     }
   };
   dart.setSignature(html$.RtcStatsResponse, {
@@ -68960,11 +70620,11 @@
     get [dartx.type]() {
       return this.type;
     }
-    [dartx.lock](orientation) {
-      return this.lock(orientation);
+    [dartx.lock](...args) {
+      return this.lock.apply(this, args);
     }
-    [dartx.unlock]() {
-      return this.unlock();
+    [dartx.unlock](...args) {
+      return this.unlock.apply(this, args);
     }
     get [dartx.onChange]() {
       return html$.ScreenOrientation.changeEvent.forTarget(this);
@@ -69194,8 +70854,8 @@
     get [dartx.velocityY]() {
       return this.velocityY;
     }
-    [dartx.consumeDelta](x, y) {
-      return this.consumeDelta(x, y);
+    [dartx.consumeDelta](...args) {
+      return this.consumeDelta.apply(this, args);
     }
   };
   dart.setSignature(html$.ScrollState, {
@@ -69437,26 +71097,26 @@
     get [dartx.willValidate]() {
       return this.willValidate;
     }
-    [__setter__](index, option) {
-      return this.__setter__(index, option);
+    [__setter__](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.add](element, before) {
-      return this.add(element, before);
+    [dartx.add](...args) {
+      return this.add.apply(this, args);
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.namedItem](name) {
-      return this.namedItem(name);
+    [dartx.namedItem](...args) {
+      return this.namedItem.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
     get [dartx.options]() {
       let options = ListOfOptionElement().from(this[dartx.querySelectorAll](html$.Element)('option'));
@@ -69467,7 +71127,7 @@
         let options = this[dartx.options][dartx.where](dart.fn(o => o[dartx.selected], OptionElementTobool()))[dartx.toList]();
         return new (UnmodifiableListViewOfOptionElement())(options);
       } else {
-        return JSArrayOfOptionElement().of([this[dartx.options][dartx.get](this[dartx.selectedIndex])]);
+        return JSArrayOfOptionElement().of([this[dartx.options][dartx._get](this[dartx.selectedIndex])]);
       }
     }
   };
@@ -69574,47 +71234,47 @@
     get [dartx.type]() {
       return this.type;
     }
-    [dartx.addRange](range) {
-      return this.addRange(range);
+    [dartx.addRange](...args) {
+      return this.addRange.apply(this, args);
     }
-    [dartx.collapse](node, offset) {
-      return this.collapse(node, offset);
+    [dartx.collapse](...args) {
+      return this.collapse.apply(this, args);
     }
-    [dartx.collapseToEnd]() {
-      return this.collapseToEnd();
+    [dartx.collapseToEnd](...args) {
+      return this.collapseToEnd.apply(this, args);
     }
-    [dartx.collapseToStart]() {
-      return this.collapseToStart();
+    [dartx.collapseToStart](...args) {
+      return this.collapseToStart.apply(this, args);
     }
-    [dartx.containsNode](node, allowPartialContainment) {
-      return this.containsNode(node, allowPartialContainment);
+    [dartx.containsNode](...args) {
+      return this.containsNode.apply(this, args);
     }
-    [dartx.deleteFromDocument]() {
-      return this.deleteFromDocument();
+    [dartx.deleteFromDocument](...args) {
+      return this.deleteFromDocument.apply(this, args);
     }
-    [dartx.empty]() {
-      return this.empty();
+    [dartx.empty](...args) {
+      return this.empty.apply(this, args);
     }
-    [dartx.extend](node, offset) {
-      return this.extend(node, offset);
+    [dartx.extend](...args) {
+      return this.extend.apply(this, args);
     }
-    [dartx.getRangeAt](index) {
-      return this.getRangeAt(index);
+    [dartx.getRangeAt](...args) {
+      return this.getRangeAt.apply(this, args);
     }
-    [dartx.modify](alter, direction, granularity) {
-      return this.modify(alter, direction, granularity);
+    [dartx.modify](...args) {
+      return this.modify.apply(this, args);
     }
-    [dartx.removeAllRanges]() {
-      return this.removeAllRanges();
+    [dartx.removeAllRanges](...args) {
+      return this.removeAllRanges.apply(this, args);
     }
-    [dartx.selectAllChildren](node) {
-      return this.selectAllChildren(node);
+    [dartx.selectAllChildren](...args) {
+      return this.selectAllChildren.apply(this, args);
     }
-    [dartx.setBaseAndExtent](baseNode, baseOffset, extentNode, extentOffset) {
-      return this.setBaseAndExtent(baseNode, baseOffset, extentNode, extentOffset);
+    [dartx.setBaseAndExtent](...args) {
+      return this.setBaseAndExtent.apply(this, args);
     }
-    [dartx.setPosition](node, offset) {
-      return this.setPosition(node, offset);
+    [dartx.setPosition](...args) {
+      return this.setPosition.apply(this, args);
     }
   };
   dart.setSignature(html$.Selection, {
@@ -69670,8 +71330,8 @@
     get [dartx.targetUrl]() {
       return this.targetURL;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
     [dartx.postMessage](message, transfer) {
       if (transfer === void 0) transfer = null;
@@ -69684,11 +71344,11 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
   };
   dart.setSignature(html$.ServicePort, {
@@ -69726,18 +71386,18 @@
       }
       return this[_connect_2](url);
     }
-    [_connect_1](url, options) {
-      return this.connect(url, options);
+    [_connect_1](...args) {
+      return this.connect.apply(this, args);
     }
-    [_connect_2](url) {
-      return this.connect(url);
+    [_connect_2](...args) {
+      return this.connect.apply(this, args);
     }
     [dartx.match](options) {
       let options_1 = html_common.convertDartToNative_Dictionary(options);
       return this[_match_1](options_1);
     }
-    [_match_1](options) {
-      return this.match(options);
+    [_match_1](...args) {
+      return this.match.apply(this, args);
     }
     [dartx.matchAll](options) {
       if (options === void 0) options = null;
@@ -69747,11 +71407,11 @@
       }
       return this[_matchAll_2]();
     }
-    [_matchAll_1](options) {
-      return this.matchAll(options);
+    [_matchAll_1](...args) {
+      return this.matchAll.apply(this, args);
     }
-    [_matchAll_2]() {
-      return this.matchAll();
+    [_matchAll_2](...args) {
+      return this.matchAll.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.ServicePortCollection.messageEvent.forTarget(this);
@@ -69807,8 +71467,8 @@
     get [dartx.targetUrl]() {
       return this.targetURL;
     }
-    [dartx.respondWith](response) {
-      return this.respondWith(response);
+    [dartx.respondWith](...args) {
+      return this.respondWith.apply(this, args);
     }
   };
   dart.setSignature(html$.ServicePortConnectEvent, {
@@ -69846,11 +71506,11 @@
     get [dartx.ready]() {
       return this.ready;
     }
-    [dartx.getRegistration](documentURL) {
-      return this.getRegistration(documentURL);
+    [dartx.getRegistration](...args) {
+      return this.getRegistration.apply(this, args);
     }
-    [dartx.getRegistrations]() {
-      return this.getRegistrations();
+    [dartx.getRegistrations](...args) {
+      return this.getRegistrations.apply(this, args);
     }
     [dartx.register](url, options) {
       if (options === void 0) options = null;
@@ -69860,11 +71520,11 @@
       }
       return this[_register_2](url);
     }
-    [_register_1](url, options) {
-      return this.register(url, options);
+    [_register_1](...args) {
+      return this.register.apply(this, args);
     }
-    [_register_2](url) {
-      return this.register(url);
+    [_register_2](...args) {
+      return this.register.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.ServiceWorkerContainer.messageEvent.forTarget(this);
@@ -69912,8 +71572,8 @@
     get [dartx.registration]() {
       return this.registration;
     }
-    [dartx.skipWaiting]() {
-      return this.skipWaiting();
+    [dartx.skipWaiting](...args) {
+      return this.skipWaiting.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.ServiceWorkerGlobalScope.messageEvent.forTarget(this);
@@ -70054,11 +71714,11 @@
       }
       return this[_getNotifications_2]();
     }
-    [_getNotifications_1](filter) {
-      return this.getNotifications(filter);
+    [_getNotifications_1](...args) {
+      return this.getNotifications.apply(this, args);
     }
-    [_getNotifications_2]() {
-      return this.getNotifications();
+    [_getNotifications_2](...args) {
+      return this.getNotifications.apply(this, args);
     }
     [dartx.showNotification](title, options) {
       if (options === void 0) options = null;
@@ -70068,17 +71728,17 @@
       }
       return this[_showNotification_2](title);
     }
-    [_showNotification_1](title, options) {
-      return this.showNotification(title, options);
+    [_showNotification_1](...args) {
+      return this.showNotification.apply(this, args);
     }
-    [_showNotification_2](title) {
-      return this.showNotification(title);
+    [_showNotification_2](...args) {
+      return this.showNotification.apply(this, args);
     }
-    [dartx.unregister]() {
-      return this.unregister();
+    [dartx.unregister](...args) {
+      return this.unregister.apply(this, args);
     }
-    [dartx.update]() {
-      return this.update();
+    [dartx.update](...args) {
+      return this.update.apply(this, args);
     }
   };
   dart.setSignature(html$.ServiceWorkerRegistration, {
@@ -70121,8 +71781,8 @@
     static get supported() {
       return html$.Element.isTagSupported('shadow');
     }
-    [dartx.getDistributedNodes]() {
-      return this.getDistributedNodes();
+    [dartx.getDistributedNodes](...args) {
+      return this.getDistributedNodes.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.ShadowElement, 'created');
@@ -70177,17 +71837,17 @@
     get [dartx.styleSheets]() {
       return this.styleSheets;
     }
-    [dartx.clone](deep) {
-      return this.cloneNode(deep);
+    [dartx.clone](...args) {
+      return this.cloneNode.apply(this, args);
     }
-    [dartx.elementFromPoint](x, y) {
-      return this.elementFromPoint(x, y);
+    [dartx.elementFromPoint](...args) {
+      return this.elementFromPoint.apply(this, args);
     }
-    [dartx.elementsFromPoint](x, y) {
-      return this.elementsFromPoint(x, y);
+    [dartx.elementsFromPoint](...args) {
+      return this.elementsFromPoint.apply(this, args);
     }
-    [dartx.getSelection]() {
-      return this.getSelection();
+    [dartx.getSelection](...args) {
+      return this.getSelection.apply(this, args);
     }
     static get supported() {
       return !!(Element.prototype.createShadowRoot || Element.prototype.webkitCreateShadowRoot);
@@ -70397,20 +72057,20 @@
     get [dartx.updating]() {
       return this.updating;
     }
-    [dartx.abort]() {
-      return this.abort();
+    [dartx.abort](...args) {
+      return this.abort.apply(this, args);
     }
-    [dartx.appendBuffer](data) {
-      return this.appendBuffer(data);
+    [dartx.appendBuffer](...args) {
+      return this.appendBuffer.apply(this, args);
     }
-    [dartx.appendStream](stream, maxSize) {
-      return this.appendStream(stream, maxSize);
+    [dartx.appendStream](...args) {
+      return this.appendStream.apply(this, args);
     }
-    [dartx.appendTypedData](data) {
-      return this.appendBuffer(data);
+    [dartx.appendTypedData](...args) {
+      return this.appendBuffer.apply(this, args);
     }
-    [dartx.remove](start, end) {
-      return this.remove(start, end);
+    [dartx.remove](...args) {
+      return this.remove.apply(this, args);
     }
   };
   dart.setSignature(html$.SourceBuffer, {
@@ -70435,8 +72095,8 @@
   dart.registerExtension(dart.global.SourceBuffer, html$.SourceBuffer);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -70451,11 +72111,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -70484,10 +72144,10 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$.SourceBufferList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfSourceBuffer()];
@@ -70501,8 +72161,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.SourceBuffer, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.SourceBuffer]),
+      [dartx._get]: dart.definiteFunctionType(html$.SourceBuffer, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.SourceBuffer]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.SourceBuffer, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.SourceBuffer, [core.int])
     })
@@ -70672,8 +72332,8 @@
   dart.registerExtension(dart.global.SpeechGrammar, html$.SpeechGrammar);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -70696,11 +72356,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -70729,16 +72389,16 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.addFromString](string, weight) {
-      return this.addFromString(string, weight);
+    [dartx.addFromString](...args) {
+      return this.addFromString.apply(this, args);
     }
-    [dartx.addFromUri](src, weight) {
-      return this.addFromUri(src, weight);
+    [dartx.addFromUri](...args) {
+      return this.addFromUri.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$.SpeechGrammarList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfSpeechGrammar()];
@@ -70755,8 +72415,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.SpeechGrammar, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.SpeechGrammar]),
+      [dartx._get]: dart.definiteFunctionType(html$.SpeechGrammar, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.SpeechGrammar]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.SpeechGrammar, [core.int]),
       [dartx.addFromString]: dart.definiteFunctionType(dart.void, [core.String], [core.num]),
       [dartx.addFromUri]: dart.definiteFunctionType(dart.void, [core.String], [core.num]),
@@ -70838,14 +72498,14 @@
     set [dartx.serviceUri](value) {
       this.serviceURI = value;
     }
-    [dartx.abort]() {
-      return this.abort();
+    [dartx.abort](...args) {
+      return this.abort.apply(this, args);
     }
-    [dartx.start]() {
-      return this.start();
+    [dartx.start](...args) {
+      return this.start.apply(this, args);
     }
-    [dartx.stop]() {
-      return this.stop();
+    [dartx.stop](...args) {
+      return this.stop.apply(this, args);
     }
     get [dartx.onAudioEnd]() {
       return html$.SpeechRecognition.audioEndEvent.forTarget(this);
@@ -71105,8 +72765,8 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   dart.setSignature(html$.SpeechRecognitionResult, {
@@ -71141,20 +72801,20 @@
     get [dartx.speaking]() {
       return this.speaking;
     }
-    [dartx.cancel]() {
-      return this.cancel();
+    [dartx.cancel](...args) {
+      return this.cancel.apply(this, args);
     }
-    [dartx.getVoices]() {
-      return this.getVoices();
+    [dartx.getVoices](...args) {
+      return this.getVoices.apply(this, args);
     }
-    [dartx.pause]() {
-      return this.pause();
+    [dartx.pause](...args) {
+      return this.pause.apply(this, args);
     }
-    [dartx.resume]() {
-      return this.resume();
+    [dartx.resume](...args) {
+      return this.resume.apply(this, args);
     }
-    [dartx.speak](utterance) {
-      return this.speak(utterance);
+    [dartx.speak](...args) {
+      return this.speak.apply(this, args);
     }
   };
   dart.setSignature(html$.SpeechSynthesis, {
@@ -71419,8 +73079,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.add](name, port) {
-      return this.add(name, port);
+    [dartx.add](...args) {
+      return this.add.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.StashedPortCollection.messageEvent.forTarget(this);
@@ -71448,8 +73108,8 @@
     'addAll',
     'containsValue',
     'containsKey',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'putIfAbsent',
     'remove',
     'clear',
@@ -71463,7 +73123,7 @@
   html$.Storage = class Storage extends _interceptors.Interceptor {
     [dartx.addAll](other) {
       other[dartx.forEach](dart.fn((k, v) => {
-        this[dartx.set](k, v);
+        this[dartx._set](k, v);
       }, StringAndStringTovoid$()));
     }
     [dartx.containsValue](value) {
@@ -71472,19 +73132,19 @@
     [dartx.containsKey](key) {
       return this[_getItem](core.String._check(key)) != null;
     }
-    [dartx.get](key) {
+    [dartx._get](key) {
       return this[_getItem](core.String._check(key));
     }
-    [dartx.set](key, value) {
+    [dartx._set](key, value) {
       this[_setItem](key, value);
       return value;
     }
     [dartx.putIfAbsent](key, ifAbsent) {
-      if (!dart.test(this[dartx.containsKey](key))) this[dartx.set](key, ifAbsent());
-      return this[dartx.get](key);
+      if (!dart.test(this[dartx.containsKey](key))) this[dartx._set](key, ifAbsent());
+      return this[dartx._get](key);
     }
     [dartx.remove](key) {
-      let value = this[dartx.get](key);
+      let value = this[dartx._get](key);
       this[_removeItem](core.String._check(key));
       return value;
     }
@@ -71495,7 +73155,7 @@
       for (let i = 0; true; i++) {
         let key = this[_key](i);
         if (key == null) return;
-        f(key, this[dartx.get](key));
+        f(key, this[dartx._get](key));
       }
     }
     get [dartx.keys]() {
@@ -71523,29 +73183,29 @@
     get [_length$2]() {
       return this.length;
     }
-    [__delete__](index_OR_name) {
-      return this.__delete__(index_OR_name);
+    [__delete__](...args) {
+      return this.__delete__.apply(this, args);
     }
-    [__getter__](index_OR_name) {
-      return this.__getter__(index_OR_name);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [__setter__](index_OR_name, value) {
-      return this.__setter__(index_OR_name, value);
+    [__setter__](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [_clear$1]() {
-      return this.clear();
+    [_clear$1](...args) {
+      return this.clear.apply(this, args);
     }
-    [_getItem](key) {
-      return this.getItem(key);
+    [_getItem](...args) {
+      return this.getItem.apply(this, args);
     }
-    [_key](index) {
-      return this.key(index);
+    [_key](...args) {
+      return this.key.apply(this, args);
     }
-    [_removeItem](key) {
-      return this.removeItem(key);
+    [_removeItem](...args) {
+      return this.removeItem.apply(this, args);
     }
-    [_setItem](key, data) {
-      return this.setItem(key, data);
+    [_setItem](...args) {
+      return this.setItem.apply(this, args);
     }
   };
   html$.Storage[dart.implements] = () => [MapOfString$String()];
@@ -71563,8 +73223,8 @@
       [dartx.addAll]: dart.definiteFunctionType(dart.void, [MapOfString$String()]),
       [dartx.containsValue]: dart.definiteFunctionType(core.bool, [core.Object]),
       [dartx.containsKey]: dart.definiteFunctionType(core.bool, [core.Object]),
-      [dartx.get]: dart.definiteFunctionType(core.String, [core.Object]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.String, core.String]),
+      [dartx._get]: dart.definiteFunctionType(core.String, [core.Object]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.String, core.String]),
       [dartx.putIfAbsent]: dart.definiteFunctionType(core.String, [core.String, VoidToString()]),
       [dartx.remove]: dart.definiteFunctionType(core.String, [core.Object]),
       [dartx.clear]: dart.definiteFunctionType(dart.void, []),
@@ -71631,8 +73291,8 @@
     get [dartx.url]() {
       return this.url;
     }
-    [_initStorageEvent](typeArg, canBubbleArg, cancelableArg, keyArg, oldValueArg, newValueArg, urlArg, storageAreaArg) {
-      return this.initStorageEvent(typeArg, canBubbleArg, cancelableArg, keyArg, oldValueArg, newValueArg, urlArg, storageAreaArg);
+    [_initStorageEvent](...args) {
+      return this.initStorageEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.StorageEvent, {
@@ -71690,11 +73350,11 @@
     get [dartx.supportedTypes]() {
       return this.supportedTypes;
     }
-    [dartx.queryInfo](type) {
-      return this.queryInfo(type);
+    [dartx.queryInfo](...args) {
+      return this.queryInfo.apply(this, args);
     }
-    [dartx.requestPersistentQuota](newQuota) {
-      return this.requestPersistentQuota(newQuota);
+    [dartx.requestPersistentQuota](...args) {
+      return this.requestPersistentQuota.apply(this, args);
     }
   };
   dart.setSignature(html$.StorageQuota, {
@@ -71777,8 +73437,8 @@
     get [dartx.type]() {
       return this.type;
     }
-    [dartx.matchMedium](mediaquery) {
-      return this.matchMedium(mediaquery);
+    [dartx.matchMedium](...args) {
+      return this.matchMedium.apply(this, args);
     }
   };
   dart.setSignature(html$.StyleMedia, {
@@ -71825,14 +73485,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getRegistration](tag) {
-      return this.getRegistration(tag);
+    [dartx.getRegistration](...args) {
+      return this.getRegistration.apply(this, args);
     }
-    [dartx.getRegistrations]() {
-      return this.getRegistrations();
+    [dartx.getRegistrations](...args) {
+      return this.getRegistrations.apply(this, args);
     }
-    [dartx.permissionState]() {
-      return this.permissionState();
+    [dartx.permissionState](...args) {
+      return this.permissionState.apply(this, args);
     }
     [dartx.register](options) {
       if (options === void 0) options = null;
@@ -71842,11 +73502,11 @@
       }
       return this[_register_2]();
     }
-    [_register_1](options) {
-      return this.register(options);
+    [_register_1](...args) {
+      return this.register.apply(this, args);
     }
-    [_register_2]() {
-      return this.register();
+    [_register_2](...args) {
+      return this.register.apply(this, args);
     }
   };
   dart.setSignature(html$.SyncManager, {
@@ -71872,8 +73532,8 @@
     get [dartx.tag]() {
       return this.tag;
     }
-    [dartx.unregister]() {
-      return this.unregister();
+    [dartx.unregister](...args) {
+      return this.unregister.apply(this, args);
     }
   };
   dart.setSignature(html$.SyncRegistration, {
@@ -71959,6 +73619,8 @@
     })
   });
   dart.registerExtension(dart.global.HTMLTableCellElement, html$.TableCellElement);
+  dart.registerExtension(dart.global.HTMLTableDataCellElement, html$.TableCellElement);
+  dart.registerExtension(dart.global.HTMLTableHeaderCellElement, html$.TableCellElement);
   dart.defineExtensionNames([
     'span'
   ]);
@@ -72049,8 +73711,8 @@
       this[dartx.children][dartx.add](tbody);
       return html$.TableSectionElement._check(tbody);
     }
-    [_nativeCreateTBody]() {
-      return this.createTBody();
+    [_nativeCreateTBody](...args) {
+      return this.createTBody.apply(this, args);
     }
     [dartx.createFragment](html, opts) {
       let validator = opts && 'validator' in opts ? opts.validator : null;
@@ -72102,29 +73764,29 @@
     set [dartx.tHead](value) {
       this.tHead = value;
     }
-    [_createCaption]() {
-      return this.createCaption();
+    [_createCaption](...args) {
+      return this.createCaption.apply(this, args);
     }
-    [_createTFoot]() {
-      return this.createTFoot();
+    [_createTFoot](...args) {
+      return this.createTFoot.apply(this, args);
     }
-    [_createTHead]() {
-      return this.createTHead();
+    [_createTHead](...args) {
+      return this.createTHead.apply(this, args);
     }
-    [dartx.deleteCaption]() {
-      return this.deleteCaption();
+    [dartx.deleteCaption](...args) {
+      return this.deleteCaption.apply(this, args);
     }
-    [dartx.deleteRow](index) {
-      return this.deleteRow(index);
+    [dartx.deleteRow](...args) {
+      return this.deleteRow.apply(this, args);
     }
-    [dartx.deleteTFoot]() {
-      return this.deleteTFoot();
+    [dartx.deleteTFoot](...args) {
+      return this.deleteTFoot.apply(this, args);
     }
-    [dartx.deleteTHead]() {
-      return this.deleteTHead();
+    [dartx.deleteTHead](...args) {
+      return this.deleteTHead.apply(this, args);
     }
-    [_insertRow](index) {
-      return this.insertRow(index);
+    [_insertRow](...args) {
+      return this.insertRow.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.TableElement, 'created');
@@ -72219,11 +73881,11 @@
     get [dartx.sectionRowIndex]() {
       return this.sectionRowIndex;
     }
-    [dartx.deleteCell](index) {
-      return this.deleteCell(index);
+    [dartx.deleteCell](...args) {
+      return this.deleteCell.apply(this, args);
     }
-    [_insertCell](index) {
-      return this.insertCell(index);
+    [_insertCell](...args) {
+      return this.insertCell.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.TableRowElement, 'created');
@@ -72285,11 +73947,11 @@
     get [_rows]() {
       return this.rows;
     }
-    [dartx.deleteRow](index) {
-      return this.deleteRow(index);
+    [dartx.deleteRow](...args) {
+      return this.deleteRow.apply(this, args);
     }
-    [_insertRow](index) {
-      return this.insertRow(index);
+    [_insertRow](...args) {
+      return this.insertRow.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.TableSectionElement, 'created');
@@ -72553,23 +74215,23 @@
     set [dartx.wrap](value) {
       this.wrap = value;
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.select]() {
-      return this.select();
+    [dartx.select](...args) {
+      return this.select.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
-    [dartx.setRangeText](replacement, opts) {
-      return this.setRangeText(replacement, opts);
+    [dartx.setRangeText](...args) {
+      return this.setRangeText.apply(this, args);
     }
-    [dartx.setSelectionRange](start, end, direction) {
-      return this.setSelectionRange(start, end, direction);
+    [dartx.setSelectionRange](...args) {
+      return this.setSelectionRange.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.TextAreaElement, 'created');
@@ -72640,8 +74302,8 @@
     get [dartx.data]() {
       return this.data;
     }
-    [_initTextEvent](typeArg, canBubbleArg, cancelableArg, viewArg, dataArg) {
-      return this.initTextEvent(typeArg, canBubbleArg, cancelableArg, viewArg, dataArg);
+    [_initTextEvent](...args) {
+      return this.initTextEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.TextEvent, {
@@ -72772,17 +74434,17 @@
     get [dartx.regions]() {
       return this.regions;
     }
-    [dartx.addCue](cue) {
-      return this.addCue(cue);
+    [dartx.addCue](...args) {
+      return this.addCue.apply(this, args);
     }
-    [dartx.addRegion](region) {
-      return this.addRegion(region);
+    [dartx.addRegion](...args) {
+      return this.addRegion.apply(this, args);
     }
-    [dartx.removeCue](cue) {
-      return this.removeCue(cue);
+    [dartx.removeCue](...args) {
+      return this.removeCue.apply(this, args);
     }
-    [dartx.removeRegion](region) {
-      return this.removeRegion(region);
+    [dartx.removeRegion](...args) {
+      return this.removeRegion.apply(this, args);
     }
     get [dartx.onCueChange]() {
       return html$.TextTrack.cueChangeEvent.forTarget(this);
@@ -72891,8 +74553,8 @@
   dart.registerExtension(dart.global.TextTrackCue, html$.TextTrackCue);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -72908,11 +74570,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -72941,13 +74603,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.getCueById](id) {
-      return this.getCueById(id);
+    [dartx.getCueById](...args) {
+      return this.getCueById.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$.TextTrackCueList[dart.implements] = () => [ListOfTextTrackCue(), _js_helper.JavaScriptIndexingBehavior];
@@ -72961,8 +74623,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.TextTrackCue, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.TextTrackCue]),
+      [dartx._get]: dart.definiteFunctionType(html$.TextTrackCue, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.TextTrackCue]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.TextTrackCue, [core.int]),
       [dartx.getCueById]: dart.definiteFunctionType(html$.TextTrackCue, [core.String]),
       [dartx.item]: dart.definiteFunctionType(html$.TextTrackCue, [core.int])
@@ -72971,8 +74633,8 @@
   dart.registerExtension(dart.global.TextTrackCueList, html$.TextTrackCueList);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -72990,11 +74652,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -73023,13 +74685,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.getTrackById](id) {
-      return this.getTrackById(id);
+    [dartx.getTrackById](...args) {
+      return this.getTrackById.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
     get [dartx.onAddTrack]() {
       return html$.TextTrackList.addTrackEvent.forTarget(this);
@@ -73051,8 +74713,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.TextTrack, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.TextTrack]),
+      [dartx._get]: dart.definiteFunctionType(html$.TextTrack, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.TextTrack]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.TextTrack, [core.int]),
       [dartx.getTrackById]: dart.definiteFunctionType(html$.TextTrack, [core.String]),
       [dartx.item]: dart.definiteFunctionType(html$.TextTrack, [core.int])
@@ -73083,11 +74745,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.end](index) {
-      return this.end(index);
+    [dartx.end](...args) {
+      return this.end.apply(this, args);
     }
-    [dartx.start](index) {
-      return this.start(index);
+    [dartx.start](...args) {
+      return this.start.apply(this, args);
     }
   };
   dart.setSignature(html$.TimeRanges, {
@@ -73310,8 +74972,8 @@
     get [dartx.touches]() {
       return this.touches;
     }
-    [_initTouchEvent](touches, targetTouches, changedTouches, type, view, unused1, unused2, unused3, unused4, ctrlKey, altKey, shiftKey, metaKey) {
-      return this.initTouchEvent(touches, targetTouches, changedTouches, type, view, unused1, unused2, unused3, unused4, ctrlKey, altKey, shiftKey, metaKey);
+    [_initTouchEvent](...args) {
+      return this.initTouchEvent.apply(this, args);
     }
     static get supported() {
       return html_common.Device.isEventTypeSupported('TouchEvent');
@@ -73337,8 +74999,8 @@
   dart.registerExtension(dart.global.TouchEvent, html$.TouchEvent);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -73359,11 +75021,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -73392,10 +75054,10 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$.TouchList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfTouch()];
@@ -73412,8 +75074,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.Touch, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.Touch]),
+      [dartx._get]: dart.definiteFunctionType(html$.Touch, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.Touch]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.Touch, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.Touch, [core.int])
     }),
@@ -73505,8 +75167,8 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   dart.setSignature(html$.TrackDefaultList, {
@@ -73706,6 +75368,7 @@
     names: ['_create_1', '_create_2']
   });
   dart.registerExtension(dart.global.TransitionEvent, html$.TransitionEvent);
+  dart.registerExtension(dart.global.WebKitTransitionEvent, html$.TransitionEvent);
   dart.defineExtensionNames([
     'firstChild',
     'lastChild',
@@ -73741,26 +75404,26 @@
     get [dartx.whatToShow]() {
       return this.whatToShow;
     }
-    [dartx.firstChild]() {
-      return this.firstChild();
+    [dartx.firstChild](...args) {
+      return this.firstChild.apply(this, args);
     }
-    [dartx.lastChild]() {
-      return this.lastChild();
+    [dartx.lastChild](...args) {
+      return this.lastChild.apply(this, args);
     }
-    [dartx.nextNode]() {
-      return this.nextNode();
+    [dartx.nextNode](...args) {
+      return this.nextNode.apply(this, args);
     }
-    [dartx.nextSibling]() {
-      return this.nextSibling();
+    [dartx.nextSibling](...args) {
+      return this.nextSibling.apply(this, args);
     }
-    [dartx.parentNode]() {
-      return this.parentNode();
+    [dartx.parentNode](...args) {
+      return this.parentNode.apply(this, args);
     }
-    [dartx.previousNode]() {
-      return this.previousNode();
+    [dartx.previousNode](...args) {
+      return this.previousNode.apply(this, args);
     }
-    [dartx.previousSibling]() {
-      return this.previousSibling();
+    [dartx.previousSibling](...args) {
+      return this.previousSibling.apply(this, args);
     }
   };
   dart.setSignature(html$.TreeWalker, {
@@ -73964,7 +75627,84 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get hash() {
+      return this[hash];
+    }
+    set hash(value) {
+      this[hash] = value;
+    }
+    get host() {
+      return this[host];
+    }
+    set host(value) {
+      this[host] = value;
+    }
+    get hostname() {
+      return this[hostname];
+    }
+    set hostname(value) {
+      this[hostname] = value;
+    }
+    get href() {
+      return this[href];
+    }
+    set href(value) {
+      this[href] = value;
+    }
+    get origin() {
+      return this[origin];
+    }
+    set origin(value) {
+      super.origin = value;
+    }
+    get password() {
+      return this[password];
+    }
+    set password(value) {
+      this[password] = value;
+    }
+    get pathname() {
+      return this[pathname];
+    }
+    set pathname(value) {
+      this[pathname] = value;
+    }
+    get port() {
+      return this[port];
+    }
+    set port(value) {
+      this[port] = value;
+    }
+    get protocol() {
+      return this[protocol];
+    }
+    set protocol(value) {
+      this[protocol] = value;
+    }
+    get search() {
+      return this[search];
+    }
+    set search(value) {
+      this[search] = value;
+    }
+    get username() {
+      return this[username];
+    }
+    set username(value) {
+      this[username] = value;
+    }
   };
+  const hash = Symbol(html$.UrlUtils.name + "." + 'hash'.toString());
+  const host = Symbol(html$.UrlUtils.name + "." + 'host'.toString());
+  const hostname = Symbol(html$.UrlUtils.name + "." + 'hostname'.toString());
+  const href = Symbol(html$.UrlUtils.name + "." + 'href'.toString());
+  const origin = Symbol(html$.UrlUtils.name + "." + 'origin'.toString());
+  const password = Symbol(html$.UrlUtils.name + "." + 'password'.toString());
+  const pathname = Symbol(html$.UrlUtils.name + "." + 'pathname'.toString());
+  const port = Symbol(html$.UrlUtils.name + "." + 'port'.toString());
+  const protocol = Symbol(html$.UrlUtils.name + "." + 'protocol'.toString());
+  const search = Symbol(html$.UrlUtils.name + "." + 'search'.toString());
+  const username = Symbol(html$.UrlUtils.name + "." + 'username'.toString());
   dart.setSignature(html$.UrlUtils, {
     constructors: () => ({_: dart.definiteFunctionType(html$.UrlUtils, [])}),
     fields: () => ({
@@ -74019,7 +75759,70 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get hash() {
+      return this[hash$];
+    }
+    set hash(value) {
+      super.hash = value;
+    }
+    get host() {
+      return this[host$];
+    }
+    set host(value) {
+      super.host = value;
+    }
+    get hostname() {
+      return this[hostname$];
+    }
+    set hostname(value) {
+      super.hostname = value;
+    }
+    get href() {
+      return this[href$];
+    }
+    set href(value) {
+      super.href = value;
+    }
+    get origin() {
+      return this[origin$];
+    }
+    set origin(value) {
+      super.origin = value;
+    }
+    get pathname() {
+      return this[pathname$];
+    }
+    set pathname(value) {
+      super.pathname = value;
+    }
+    get port() {
+      return this[port$];
+    }
+    set port(value) {
+      super.port = value;
+    }
+    get protocol() {
+      return this[protocol$];
+    }
+    set protocol(value) {
+      super.protocol = value;
+    }
+    get search() {
+      return this[search$];
+    }
+    set search(value) {
+      super.search = value;
+    }
   };
+  const hash$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'hash'.toString());
+  const host$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'host'.toString());
+  const hostname$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'hostname'.toString());
+  const href$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'href'.toString());
+  const origin$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'origin'.toString());
+  const pathname$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'pathname'.toString());
+  const port$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'port'.toString());
+  const protocol$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'protocol'.toString());
+  const search$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'search'.toString());
   dart.setSignature(html$.UrlUtilsReadOnly, {
     constructors: () => ({_: dart.definiteFunctionType(html$.UrlUtilsReadOnly, [])}),
     fields: () => ({
@@ -74330,14 +76133,14 @@
     set [dartx.width](value) {
       this.width = value;
     }
-    [dartx.getVideoPlaybackQuality]() {
-      return this.getVideoPlaybackQuality();
+    [dartx.getVideoPlaybackQuality](...args) {
+      return this.getVideoPlaybackQuality.apply(this, args);
     }
-    [dartx.enterFullscreen]() {
-      return this.webkitEnterFullscreen();
+    [dartx.enterFullscreen](...args) {
+      return this.webkitEnterFullscreen.apply(this, args);
     }
-    [dartx.exitFullscreen]() {
-      return this.webkitExitFullscreen();
+    [dartx.exitFullscreen](...args) {
+      return this.webkitExitFullscreen.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.VideoElement, 'created');
@@ -74454,11 +76257,11 @@
     get [dartx.selectedIndex]() {
       return this.selectedIndex;
     }
-    [__getter__](index) {
-      return this.__getter__(index);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.getTrackById](id) {
-      return this.getTrackById(id);
+    [dartx.getTrackById](...args) {
+      return this.getTrackById.apply(this, args);
     }
     get [dartx.onChange]() {
       return html$.VideoTrackList.changeEvent.forTarget(this);
@@ -74553,8 +76356,8 @@
     set [dartx.vertical](value) {
       this.vertical = value;
     }
-    [dartx.getCueAsHtml]() {
-      return this.getCueAsHTML();
+    [dartx.getCueAsHtml](...args) {
+      return this.getCueAsHTML.apply(this, args);
     }
   };
   dart.setSignature(html$.VttCue, {
@@ -74682,11 +76485,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.getRegionById](id) {
-      return this.getRegionById(id);
+    [dartx.getRegionById](...args) {
+      return this.getRegionById.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   dart.setSignature(html$.VttRegionList, {
@@ -74757,23 +76560,23 @@
     get [dartx.url]() {
       return this.url;
     }
-    [dartx.close](code, reason) {
-      return this.close(code, reason);
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.send](data) {
-      return this.send(data);
+    [dartx.send](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendBlob](data) {
-      return this.send(data);
+    [dartx.sendBlob](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendByteBuffer](data) {
-      return this.send(data);
+    [dartx.sendByteBuffer](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendString](data) {
-      return this.send(data);
+    [dartx.sendString](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendTypedData](data) {
-      return this.send(data);
+    [dartx.sendTypedData](...args) {
+      return this.send.apply(this, args);
     }
     get [dartx.onClose]() {
       return html$.WebSocket.closeEvent.forTarget(this);
@@ -74944,14 +76747,14 @@
     get [_hasInitMouseScrollEvent]() {
       return !!this.initMouseScrollEvent;
     }
-    [_initMouseScrollEvent](type, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, axis) {
-      return this.initMouseScrollEvent(type, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, axis);
+    [_initMouseScrollEvent](...args) {
+      return this.initMouseScrollEvent.apply(this, args);
     }
     get [_hasInitWheelEvent]() {
       return !!this.initWheelEvent;
     }
-    [_initWheelEvent](eventType, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, button, relatedTarget, modifiersList, deltaX, deltaY, deltaZ, deltaMode) {
-      return this.initWheelEvent(eventType, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, button, relatedTarget, modifiersList, deltaX, deltaY, deltaZ, deltaMode);
+    [_initWheelEvent](...args) {
+      return this.initWheelEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.WheelEvent, {
@@ -75213,11 +77016,11 @@
       this[_ensureRequestAnimationFrame]();
       this[_cancelAnimationFrame](id);
     }
-    [_requestAnimationFrame](callback) {
-      return this.requestAnimationFrame(callback);
+    [_requestAnimationFrame](...args) {
+      return this.requestAnimationFrame.apply(this, args);
     }
-    [_cancelAnimationFrame](id) {
-      return this.cancelAnimationFrame(id);
+    [_cancelAnimationFrame](...args) {
+      return this.cancelAnimationFrame.apply(this, args);
     }
     [_ensureRequestAnimationFrame]() {
       if (!!(this.requestAnimationFrame && this.cancelAnimationFrame)) return;
@@ -75410,20 +77213,20 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [__getter___1](index) {
-      return this.__getter__(index);
+    [__getter___1](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [__getter___2](name) {
-      return this.__getter__(name);
+    [__getter___2](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.alert](message) {
-      return this.alert(message);
+    [dartx.alert](...args) {
+      return this.alert.apply(this, args);
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.confirm](message) {
-      return this.confirm(message);
+    [dartx.confirm](...args) {
+      return this.confirm.apply(this, args);
     }
     [dartx.fetch](input, init) {
       if (init === void 0) init = null;
@@ -75433,35 +77236,35 @@
       }
       return this[_fetch_2](input);
     }
-    [_fetch_1](input, init) {
-      return this.fetch(input, init);
+    [_fetch_1](...args) {
+      return this.fetch.apply(this, args);
     }
-    [_fetch_2](input) {
-      return this.fetch(input);
+    [_fetch_2](...args) {
+      return this.fetch.apply(this, args);
     }
-    [dartx.find](string, caseSensitive, backwards, wrap, wholeWord, searchInFrames, showDialog) {
-      return this.find(string, caseSensitive, backwards, wrap, wholeWord, searchInFrames, showDialog);
+    [dartx.find](...args) {
+      return this.find.apply(this, args);
     }
-    [_getComputedStyle](elt, pseudoElt) {
-      return this.getComputedStyle(elt, pseudoElt);
+    [_getComputedStyle](...args) {
+      return this.getComputedStyle.apply(this, args);
     }
-    [dartx.getMatchedCssRules](element, pseudoElement) {
-      return this.getMatchedCSSRules(element, pseudoElement);
+    [dartx.getMatchedCssRules](...args) {
+      return this.getMatchedCSSRules.apply(this, args);
     }
-    [dartx.getSelection]() {
-      return this.getSelection();
+    [dartx.getSelection](...args) {
+      return this.getSelection.apply(this, args);
     }
-    [dartx.matchMedia](query) {
-      return this.matchMedia(query);
+    [dartx.matchMedia](...args) {
+      return this.matchMedia.apply(this, args);
     }
-    [dartx.moveBy](x, y) {
-      return this.moveBy(x, y);
+    [dartx.moveBy](...args) {
+      return this.moveBy.apply(this, args);
     }
-    [_moveTo](x, y) {
-      return this.moveTo(x, y);
+    [_moveTo](...args) {
+      return this.moveTo.apply(this, args);
     }
-    [dartx.openDatabase](name, version, displayName, estimatedSize, creationCallback) {
-      return this.openDatabase(name, version, displayName, estimatedSize, creationCallback);
+    [dartx.openDatabase](...args) {
+      return this.openDatabase.apply(this, args);
     }
     [dartx.postMessage](message, targetOrigin, transfer) {
       if (transfer === void 0) transfer = null;
@@ -75474,20 +77277,20 @@
       this[_postMessage_2](message_1, targetOrigin);
       return;
     }
-    [_postMessage_1](message, targetOrigin, transfer) {
-      return this.postMessage(message, targetOrigin, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message, targetOrigin) {
-      return this.postMessage(message, targetOrigin);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [dartx.print]() {
-      return this.print();
+    [dartx.print](...args) {
+      return this.print.apply(this, args);
     }
-    [dartx.resizeBy](x, y) {
-      return this.resizeBy(x, y);
+    [dartx.resizeBy](...args) {
+      return this.resizeBy.apply(this, args);
     }
-    [dartx.resizeTo](x, y) {
-      return this.resizeTo(x, y);
+    [dartx.resizeTo](...args) {
+      return this.resizeTo.apply(this, args);
     }
     [dartx.scroll](options_OR_x, y, scrollOptions) {
       if (options_OR_x === void 0) options_OR_x = null;
@@ -75517,20 +77320,20 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_scroll_1]() {
-      return this.scroll();
+    [_scroll_1](...args) {
+      return this.scroll.apply(this, args);
     }
-    [_scroll_2](options) {
-      return this.scroll(options);
+    [_scroll_2](...args) {
+      return this.scroll.apply(this, args);
     }
-    [_scroll_3](x, y) {
-      return this.scroll(x, y);
+    [_scroll_3](...args) {
+      return this.scroll.apply(this, args);
     }
-    [_scroll_4](x, y) {
-      return this.scroll(x, y);
+    [_scroll_4](...args) {
+      return this.scroll.apply(this, args);
     }
-    [_scroll_5](x, y, scrollOptions) {
-      return this.scroll(x, y, scrollOptions);
+    [_scroll_5](...args) {
+      return this.scroll.apply(this, args);
     }
     [dartx.scrollBy](options_OR_x, y, scrollOptions) {
       if (options_OR_x === void 0) options_OR_x = null;
@@ -75560,20 +77363,20 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_scrollBy_1]() {
-      return this.scrollBy();
+    [_scrollBy_1](...args) {
+      return this.scrollBy.apply(this, args);
     }
-    [_scrollBy_2](options) {
-      return this.scrollBy(options);
+    [_scrollBy_2](...args) {
+      return this.scrollBy.apply(this, args);
     }
-    [_scrollBy_3](x, y) {
-      return this.scrollBy(x, y);
+    [_scrollBy_3](...args) {
+      return this.scrollBy.apply(this, args);
     }
-    [_scrollBy_4](x, y) {
-      return this.scrollBy(x, y);
+    [_scrollBy_4](...args) {
+      return this.scrollBy.apply(this, args);
     }
-    [_scrollBy_5](x, y, scrollOptions) {
-      return this.scrollBy(x, y, scrollOptions);
+    [_scrollBy_5](...args) {
+      return this.scrollBy.apply(this, args);
     }
     [dartx.scrollTo](options_OR_x, y, scrollOptions) {
       if (options_OR_x === void 0) options_OR_x = null;
@@ -75603,26 +77406,26 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_scrollTo_1]() {
-      return this.scrollTo();
+    [_scrollTo_1](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [_scrollTo_2](options) {
-      return this.scrollTo(options);
+    [_scrollTo_2](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [_scrollTo_3](x, y) {
-      return this.scrollTo(x, y);
+    [_scrollTo_3](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [_scrollTo_4](x, y) {
-      return this.scrollTo(x, y);
+    [_scrollTo_4](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [_scrollTo_5](x, y, scrollOptions) {
-      return this.scrollTo(x, y, scrollOptions);
+    [_scrollTo_5](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [dartx.stop]() {
-      return this.stop();
+    [dartx.stop](...args) {
+      return this.stop.apply(this, args);
     }
-    [__requestFileSystem](type, size, successCallback, errorCallback) {
-      return this.webkitRequestFileSystem(type, size, successCallback, errorCallback);
+    [__requestFileSystem](...args) {
+      return this.webkitRequestFileSystem.apply(this, args);
     }
     [_requestFileSystem](type, size) {
       let completer = CompleterOfFileSystem().new();
@@ -75633,8 +77436,8 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [_resolveLocalFileSystemUrl](url, successCallback, errorCallback) {
-      return this.webkitResolveLocalFileSystemURL(url, successCallback, errorCallback);
+    [_resolveLocalFileSystemUrl](...args) {
+      return this.webkitResolveLocalFileSystemURL.apply(this, args);
     }
     [dartx.resolveLocalFileSystemUrl](url) {
       let completer = CompleterOfEntry().new();
@@ -75645,29 +77448,29 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [dartx.atob](atob) {
-      return this.atob(atob);
+    [dartx.atob](...args) {
+      return this.atob.apply(this, args);
     }
-    [dartx.btoa](btoa) {
-      return this.btoa(btoa);
+    [dartx.btoa](...args) {
+      return this.btoa.apply(this, args);
     }
-    [_setInterval_String](handler, timeout, arguments$) {
-      return this.setInterval(handler, timeout, arguments$);
+    [_setInterval_String](...args) {
+      return this.setInterval.apply(this, args);
     }
-    [_setTimeout_String](handler, timeout, arguments$) {
-      return this.setTimeout(handler, timeout, arguments$);
+    [_setTimeout_String](...args) {
+      return this.setTimeout.apply(this, args);
     }
-    [_clearInterval](handle) {
-      return this.clearInterval(handle);
+    [_clearInterval](...args) {
+      return this.clearInterval.apply(this, args);
     }
-    [_clearTimeout](handle) {
-      return this.clearTimeout(handle);
+    [_clearTimeout](...args) {
+      return this.clearTimeout.apply(this, args);
     }
-    [_setInterval](handler, timeout) {
-      return this.setInterval(handler, timeout);
+    [_setInterval](...args) {
+      return this.setInterval.apply(this, args);
     }
-    [_setTimeout](handler, timeout) {
-      return this.setTimeout(handler, timeout);
+    [_setTimeout](...args) {
+      return this.setTimeout.apply(this, args);
     }
     get [dartx.onContentLoaded]() {
       return html$.Window.contentLoadedEvent.forTarget(this);
@@ -76204,6 +78007,7 @@
     }
   });
   dart.registerExtension(dart.global.Window, html$.Window);
+  dart.registerExtension(dart.global.DOMWindow, html$.Window);
   const _returnValue = Symbol('_returnValue');
   html$._WrappedEvent = class _WrappedEvent extends core.Object {
     new(wrapped) {
@@ -76380,8 +78184,8 @@
     get [dartx.visibilityState]() {
       return this.visibilityState;
     }
-    [dartx.focus]() {
-      return this.focus();
+    [dartx.focus](...args) {
+      return this.focus.apply(this, args);
     }
   };
   dart.setSignature(html$.WindowClient, {
@@ -76511,14 +78315,14 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [dartx.terminate]() {
-      return this.terminate();
+    [dartx.terminate](...args) {
+      return this.terminate.apply(this, args);
     }
     get [dartx.onError]() {
       return html$.Worker.errorEvent.forTarget(this);
@@ -76589,35 +78393,35 @@
     get [dartx.memory]() {
       return this.memory;
     }
-    [dartx.clearMarks](markName) {
-      return this.clearMarks(markName);
+    [dartx.clearMarks](...args) {
+      return this.clearMarks.apply(this, args);
     }
-    [dartx.clearMeasures](measureName) {
-      return this.clearMeasures(measureName);
+    [dartx.clearMeasures](...args) {
+      return this.clearMeasures.apply(this, args);
     }
-    [dartx.getEntries]() {
-      return this.getEntries();
+    [dartx.getEntries](...args) {
+      return this.getEntries.apply(this, args);
     }
-    [dartx.getEntriesByName](name, entryType) {
-      return this.getEntriesByName(name, entryType);
+    [dartx.getEntriesByName](...args) {
+      return this.getEntriesByName.apply(this, args);
     }
-    [dartx.getEntriesByType](entryType) {
-      return this.getEntriesByType(entryType);
+    [dartx.getEntriesByType](...args) {
+      return this.getEntriesByType.apply(this, args);
     }
-    [dartx.mark](markName) {
-      return this.mark(markName);
+    [dartx.mark](...args) {
+      return this.mark.apply(this, args);
     }
-    [dartx.measure](measureName, startMark, endMark) {
-      return this.measure(measureName, startMark, endMark);
+    [dartx.measure](...args) {
+      return this.measure.apply(this, args);
     }
-    [dartx.now]() {
-      return this.now();
+    [dartx.now](...args) {
+      return this.now.apply(this, args);
     }
-    [dartx.clearResourceTimings]() {
-      return this.webkitClearResourceTimings();
+    [dartx.clearResourceTimings](...args) {
+      return this.webkitClearResourceTimings.apply(this, args);
     }
-    [dartx.setResourceTimingBufferSize](maxSize) {
-      return this.webkitSetResourceTimingBufferSize(maxSize);
+    [dartx.setResourceTimingBufferSize](...args) {
+      return this.webkitSetResourceTimingBufferSize.apply(this, args);
     }
   };
   dart.setSignature(html$.WorkerPerformance, {
@@ -76652,14 +78456,14 @@
     static _create_1() {
       return new XPathEvaluator();
     }
-    [dartx.createExpression](expression, resolver) {
-      return this.createExpression(expression, resolver);
+    [dartx.createExpression](...args) {
+      return this.createExpression.apply(this, args);
     }
-    [dartx.createNSResolver](nodeResolver) {
-      return this.createNSResolver(nodeResolver);
+    [dartx.createNSResolver](...args) {
+      return this.createNSResolver.apply(this, args);
     }
-    [dartx.evaluate](expression, contextNode, resolver, type, inResult) {
-      return this.evaluate(expression, contextNode, resolver, type, inResult);
+    [dartx.evaluate](...args) {
+      return this.evaluate.apply(this, args);
     }
   };
   dart.setSignature(html$.XPathEvaluator, {
@@ -76683,8 +78487,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.evaluate](contextNode, type, inResult) {
-      return this.evaluate(contextNode, type, inResult);
+    [dartx.evaluate](...args) {
+      return this.evaluate.apply(this, args);
     }
   };
   dart.setSignature(html$.XPathExpression, {
@@ -76699,8 +78503,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.lookupNamespaceUri](prefix) {
-      return this.lookupNamespaceURI(prefix);
+    [dartx.lookupNamespaceUri](...args) {
+      return this.lookupNamespaceURI.apply(this, args);
     }
   };
   dart.setSignature(html$.XPathNSResolver, {
@@ -76744,11 +78548,11 @@
     get [dartx.stringValue]() {
       return this.stringValue;
     }
-    [dartx.iterateNext]() {
-      return this.iterateNext();
+    [dartx.iterateNext](...args) {
+      return this.iterateNext.apply(this, args);
     }
-    [dartx.snapshotItem](index) {
-      return this.snapshotItem(index);
+    [dartx.snapshotItem](...args) {
+      return this.snapshotItem.apply(this, args);
     }
   };
   dart.setSignature(html$.XPathResult, {
@@ -76812,8 +78616,8 @@
     static _create_1() {
       return new XMLSerializer();
     }
-    [dartx.serializeToString](root) {
-      return this.serializeToString(root);
+    [dartx.serializeToString](...args) {
+      return this.serializeToString.apply(this, args);
     }
   };
   dart.setSignature(html$.XmlSerializer, {
@@ -76849,29 +78653,29 @@
     static get supported() {
       return !!window.XSLTProcessor;
     }
-    [dartx.clearParameters]() {
-      return this.clearParameters();
+    [dartx.clearParameters](...args) {
+      return this.clearParameters.apply(this, args);
     }
-    [dartx.getParameter](namespaceURI, localName) {
-      return this.getParameter(namespaceURI, localName);
+    [dartx.getParameter](...args) {
+      return this.getParameter.apply(this, args);
     }
-    [dartx.importStylesheet](style) {
-      return this.importStylesheet(style);
+    [dartx.importStylesheet](...args) {
+      return this.importStylesheet.apply(this, args);
     }
-    [dartx.removeParameter](namespaceURI, localName) {
-      return this.removeParameter(namespaceURI, localName);
+    [dartx.removeParameter](...args) {
+      return this.removeParameter.apply(this, args);
     }
-    [dartx.reset]() {
-      return this.reset();
+    [dartx.reset](...args) {
+      return this.reset.apply(this, args);
     }
-    [dartx.setParameter](namespaceURI, localName, value) {
-      return this.setParameter(namespaceURI, localName, value);
+    [dartx.setParameter](...args) {
+      return this.setParameter.apply(this, args);
     }
-    [dartx.transformToDocument](source) {
-      return this.transformToDocument(source);
+    [dartx.transformToDocument](...args) {
+      return this.transformToDocument.apply(this, args);
     }
-    [dartx.transformToFragment](source, output) {
-      return this.transformToFragment(source, output);
+    [dartx.transformToFragment](...args) {
+      return this.transformToFragment.apply(this, args);
     }
   };
   dart.setSignature(html$.XsltProcessor, {
@@ -77085,8 +78889,8 @@
   });
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -77101,11 +78905,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.item](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -77134,13 +78938,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__getter__](index) {
-      return this.__getter__(index);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$._ClientRectList[dart.implements] = () => [ListOfRectangleOfnum()];
@@ -77154,18 +78958,19 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(math.Rectangle$(core.num), [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, RectangleOfnum()]),
+      [dartx._get]: dart.definiteFunctionType(math.Rectangle$(core.num), [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, RectangleOfnum()]),
       [dartx.elementAt]: dart.definiteFunctionType(math.Rectangle$(core.num), [core.int]),
       [__getter__]: dart.definiteFunctionType(math.Rectangle$(core.num), [core.int]),
       [dartx.item]: dart.definiteFunctionType(math.Rectangle$(core.num), [core.int])
     })
   });
   dart.registerExtension(dart.global.ClientRectList, html$._ClientRectList);
+  dart.registerExtension(dart.global.DOMRectList, html$._ClientRectList);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -77180,11 +78985,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -77213,10 +79018,10 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$._CssRuleList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfCssRule()];
@@ -77230,8 +79035,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.CssRule, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.CssRule]),
+      [dartx._get]: dart.definiteFunctionType(html$.CssRule, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.CssRule]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.CssRule, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.CssRule, [core.int])
     })
@@ -77417,8 +79222,8 @@
   dart.registerExtension(dart.global.FileWriterSync, html$._FileWriterSync);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -77433,11 +79238,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -77466,10 +79271,10 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$._GamepadList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfGamepad()];
@@ -77483,8 +79288,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.Gamepad, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.Gamepad]),
+      [dartx._get]: dart.definiteFunctionType(html$.Gamepad, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.Gamepad]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.Gamepad, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.Gamepad, [core.int])
     })
@@ -77494,8 +79299,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [_item](index) {
-      return this.item(index);
+    [_item](...args) {
+      return this.item.apply(this, args);
     }
   };
   dart.setSignature(html$._HTMLAllCollection, {
@@ -77602,8 +79407,8 @@
   dart.registerExtension(dart.global.HTMLMarqueeElement, html$._HTMLMarqueeElement);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -77624,11 +79429,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -77657,28 +79462,28 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.getNamedItem](name) {
-      return this.getNamedItem(name);
+    [dartx.getNamedItem](...args) {
+      return this.getNamedItem.apply(this, args);
     }
-    [dartx.getNamedItemNS](namespaceURI, localName) {
-      return this.getNamedItemNS(namespaceURI, localName);
+    [dartx.getNamedItemNS](...args) {
+      return this.getNamedItemNS.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.removeNamedItem](name) {
-      return this.removeNamedItem(name);
+    [dartx.removeNamedItem](...args) {
+      return this.removeNamedItem.apply(this, args);
     }
-    [dartx.removeNamedItemNS](namespaceURI, localName) {
-      return this.removeNamedItemNS(namespaceURI, localName);
+    [dartx.removeNamedItemNS](...args) {
+      return this.removeNamedItemNS.apply(this, args);
     }
-    [dartx.setNamedItem](attr) {
-      return this.setNamedItem(attr);
+    [dartx.setNamedItem](...args) {
+      return this.setNamedItem.apply(this, args);
     }
-    [dartx.setNamedItemNS](attr) {
-      return this.setNamedItemNS(attr);
+    [dartx.setNamedItemNS](...args) {
+      return this.setNamedItemNS.apply(this, args);
     }
   };
   html$._NamedNodeMap[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfNode()];
@@ -77692,8 +79497,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.Node, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
+      [dartx._get]: dart.definiteFunctionType(html$.Node, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.Node, [core.int]),
       [dartx.getNamedItem]: dart.definiteFunctionType(html$._Attr, [core.String]),
       [dartx.getNamedItemNS]: dart.definiteFunctionType(html$._Attr, [core.String, core.String]),
@@ -77705,6 +79510,7 @@
     })
   });
   dart.registerExtension(dart.global.NamedNodeMap, html$._NamedNodeMap);
+  dart.registerExtension(dart.global.MozNamedAttrMap, html$._NamedNodeMap);
   html$._PagePopupController = class _PagePopupController extends _interceptors.Interceptor {
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
@@ -77759,8 +79565,8 @@
     get [dartx.url]() {
       return this.url;
     }
-    [dartx.clone]() {
-      return this.clone();
+    [dartx.clone](...args) {
+      return this.clone.apply(this, args);
     }
   };
   dart.setSignature(html$._Request, {
@@ -77835,8 +79641,8 @@
   dart.registerExtension(dart.global.ServiceWorker, html$._ServiceWorker);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -77851,11 +79657,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -77884,10 +79690,10 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$._SpeechRecognitionResultList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfSpeechRecognitionResult()];
@@ -77901,8 +79707,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.SpeechRecognitionResult, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.SpeechRecognitionResult]),
+      [dartx._get]: dart.definiteFunctionType(html$.SpeechRecognitionResult, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.SpeechRecognitionResult]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.SpeechRecognitionResult, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.SpeechRecognitionResult, [core.int])
     })
@@ -77910,8 +79716,8 @@
   dart.registerExtension(dart.global.SpeechRecognitionResultList, html$._SpeechRecognitionResultList);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -77926,11 +79732,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -77959,13 +79765,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__getter__](name) {
-      return this.__getter__(name);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$._StyleSheetList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfStyleSheet()];
@@ -77979,8 +79785,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.StyleSheet, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.StyleSheet]),
+      [dartx._get]: dart.definiteFunctionType(html$.StyleSheet, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.StyleSheet]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.StyleSheet, [core.int]),
       [__getter__]: dart.definiteFunctionType(html$.CssStyleSheet, [core.String]),
       [dartx.item]: dart.definiteFunctionType(html$.StyleSheet, [core.int])
@@ -78070,7 +79876,7 @@
     }
     addAll(other) {
       other[dartx.forEach](dart.fn((k, v) => {
-        this.set(k, v);
+        this._set(k, v);
       }, StringAndStringTovoid$()));
     }
     containsValue(value) {
@@ -78083,9 +79889,9 @@
     }
     putIfAbsent(key, ifAbsent) {
       if (!dart.test(this[dartx.containsKey](key))) {
-        this.set(key, ifAbsent());
+        this._set(key, ifAbsent());
       }
-      return this.get(key);
+      return this._get(key);
     }
     clear() {
       for (let key of this.keys) {
@@ -78094,7 +79900,7 @@
     }
     forEach(f) {
       for (let key of this.keys) {
-        let value = this.get(key);
+        let value = this._get(key);
         f(key, value);
       }
     }
@@ -78102,7 +79908,7 @@
       let attributes = this[_element$][_attributes$];
       let keys = JSArrayOfString().of([]);
       for (let i = 0, len = attributes[dartx.length]; i < dart.notNull(len); i++) {
-        let attr = html$._Attr._check(attributes[dartx.get](i));
+        let attr = html$._Attr._check(attributes[dartx._get](i));
         if (dart.test(this[_matches](attr))) {
           keys[dartx.add](attr[dartx.name]);
         }
@@ -78113,7 +79919,7 @@
       let attributes = this[_element$][_attributes$];
       let values = JSArrayOfString().of([]);
       for (let i = 0, len = attributes[dartx.length]; i < dart.notNull(len); i++) {
-        let attr = html$._Attr._check(attributes[dartx.get](i));
+        let attr = html$._Attr._check(attributes[dartx._get](i));
         if (dart.test(this[_matches](attr))) {
           values[dartx.add](attr[dartx.value]);
         }
@@ -78163,10 +79969,10 @@
     containsKey(key) {
       return this[_element$][_hasAttribute](core.String._check(key));
     }
-    get(key) {
+    _get(key) {
       return this[_element$][dartx.getAttribute](core.String._check(key));
     }
-    set(key, value) {
+    _set(key, value) {
       this[_element$][dartx.setAttribute](key, value);
       return value;
     }
@@ -78187,16 +79993,16 @@
     getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
     methods: () => ({
       containsKey: dart.definiteFunctionType(core.bool, [core.Object]),
-      get: dart.definiteFunctionType(core.String, [core.Object]),
-      set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
+      _get: dart.definiteFunctionType(core.String, [core.Object]),
+      _set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
       remove: dart.definiteFunctionType(core.String, [core.Object]),
       [_matches]: dart.definiteFunctionType(core.bool, [html$.Node])
     })
   });
   dart.defineExtensionMembers(html$._ElementAttributeMap, [
     'containsKey',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'remove',
     'length'
   ]);
@@ -78209,15 +80015,15 @@
     containsKey(key) {
       return this[_element$][_hasAttributeNS](this[_namespace], core.String._check(key));
     }
-    get(key) {
+    _get(key) {
       return this[_element$][dartx.getAttributeNS](this[_namespace], core.String._check(key));
     }
-    set(key, value) {
+    _set(key, value) {
       this[_element$][dartx.setAttributeNS](this[_namespace], key, value);
       return value;
     }
     remove(key) {
-      let value = this.get(key);
+      let value = this._get(key);
       this[_element$][_removeAttributeNS](this[_namespace], core.String._check(key));
       return value;
     }
@@ -78234,16 +80040,16 @@
     getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
     methods: () => ({
       containsKey: dart.definiteFunctionType(core.bool, [core.Object]),
-      get: dart.definiteFunctionType(core.String, [core.Object]),
-      set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
+      _get: dart.definiteFunctionType(core.String, [core.Object]),
+      _set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
       remove: dart.definiteFunctionType(core.String, [core.Object]),
       [_matches]: dart.definiteFunctionType(core.bool, [html$.Node])
     })
   });
   dart.defineExtensionMembers(html$._NamespacedAttributeMap, [
     'containsKey',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'remove',
     'length'
   ]);
@@ -78257,7 +80063,7 @@
     }
     addAll(other) {
       other[dartx.forEach](dart.fn((k, v) => {
-        this.set(k, v);
+        this._set(k, v);
       }, StringAndStringTovoid$()));
     }
     containsValue(value) {
@@ -78266,11 +80072,11 @@
     containsKey(key) {
       return this[_attributes$][dartx.containsKey](this[_attr](core.String._check(key)));
     }
-    get(key) {
-      return this[_attributes$][dartx.get](this[_attr](core.String._check(key)));
+    _get(key) {
+      return this[_attributes$][dartx._get](this[_attr](core.String._check(key)));
     }
-    set(key, value) {
-      this[_attributes$][dartx.set](this[_attr](key), value);
+    _set(key, value) {
+      this[_attributes$][dartx._set](this[_attr](key), value);
       return value;
     }
     putIfAbsent(key, ifAbsent) {
@@ -78332,9 +80138,9 @@
       let segments = hyphenedName[dartx.split]('-');
       let start = dart.test(startUppercase) ? 0 : 1;
       for (let i = start; i < dart.notNull(segments[dartx.length]); i++) {
-        let segment = segments[dartx.get](i);
+        let segment = segments[dartx._get](i);
         if (dart.notNull(segment[dartx.length]) > 0) {
-          segments[dartx.set](i, dart.str`${segment[dartx.get](0)[dartx.toUpperCase]()}${segment[dartx.substring](1)}`);
+          segments[dartx._set](i, dart.str`${segment[dartx._get](0)[dartx.toUpperCase]()}${segment[dartx.substring](1)}`);
         }
       }
       return segments[dartx.join]('');
@@ -78342,8 +80148,8 @@
     [_toHyphenedName](word) {
       let sb = new core.StringBuffer();
       for (let i = 0; i < dart.notNull(word[dartx.length]); i++) {
-        let lower = word[dartx.get](i)[dartx.toLowerCase]();
-        if (word[dartx.get](i) != lower && i > 0) sb.write('-');
+        let lower = word[dartx._get](i)[dartx.toLowerCase]();
+        if (word[dartx._get](i) != lower && i > 0) sb.write('-');
         sb.write(lower);
       }
       return sb.toString();
@@ -78364,8 +80170,8 @@
       addAll: dart.definiteFunctionType(dart.void, [MapOfString$String()]),
       containsValue: dart.definiteFunctionType(core.bool, [core.Object]),
       containsKey: dart.definiteFunctionType(core.bool, [core.Object]),
-      get: dart.definiteFunctionType(core.String, [core.Object]),
-      set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
+      _get: dart.definiteFunctionType(core.String, [core.Object]),
+      _set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
       putIfAbsent: dart.definiteFunctionType(core.String, [core.String, VoidToString()]),
       remove: dart.definiteFunctionType(core.String, [core.Object]),
       clear: dart.definiteFunctionType(dart.void, []),
@@ -78381,8 +80187,8 @@
     'addAll',
     'containsValue',
     'containsKey',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'putIfAbsent',
     'remove',
     'clear',
@@ -79194,43 +81000,43 @@
   const _unit = Symbol('_unit');
   html$.Dimension = class Dimension extends core.Object {
     percent(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = '%';
     }
     px(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'px';
     }
     pc(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'pc';
     }
     pt(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'pt';
     }
     inch(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'in';
     }
     cm(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'cm';
     }
     mm(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'mm';
     }
     em(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'em';
     }
     ex(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'ex';
     }
     css(cssValue) {
-      this[_value$0] = null;
+      this[_value$1] = null;
       this[_unit] = null;
       if (cssValue == '') cssValue = '0px';
       if (dart.test(cssValue[dartx.endsWith]('%'))) {
@@ -79239,16 +81045,16 @@
         this[_unit] = cssValue[dartx.substring](dart.notNull(cssValue[dartx.length]) - 2);
       }
       if (dart.test(cssValue[dartx.contains]('.'))) {
-        this[_value$0] = core.double.parse(cssValue[dartx.substring](0, dart.notNull(cssValue[dartx.length]) - dart.notNull(this[_unit][dartx.length])));
+        this[_value$1] = core.double.parse(cssValue[dartx.substring](0, dart.notNull(cssValue[dartx.length]) - dart.notNull(this[_unit][dartx.length])));
       } else {
-        this[_value$0] = core.int.parse(cssValue[dartx.substring](0, dart.notNull(cssValue[dartx.length]) - dart.notNull(this[_unit][dartx.length])));
+        this[_value$1] = core.int.parse(cssValue[dartx.substring](0, dart.notNull(cssValue[dartx.length]) - dart.notNull(this[_unit][dartx.length])));
       }
     }
     toString() {
-      return dart.str`${this[_value$0]}${this[_unit]}`;
+      return dart.str`${this[_value$1]}${this[_unit]}`;
     }
     get value() {
-      return this[_value$0];
+      return this[_value$1];
     }
   };
   dart.defineNamedConstructor(html$.Dimension, 'percent');
@@ -79275,7 +81081,7 @@
       css: dart.definiteFunctionType(html$.Dimension, [core.String])
     }),
     fields: () => ({
-      [_value$0]: core.num,
+      [_value$1]: core.num,
       [_unit]: core.String
     }),
     getters: () => ({value: dart.definiteFunctionType(core.num, [])})
@@ -79928,7 +81734,7 @@
       add(stream) {
         StreamOfT()._check(stream);
         if (dart.test(this[_subscriptions][dartx.containsKey](stream))) return;
-        this[_subscriptions][dartx.set](stream, stream.listen(dart.bind(this[_controller$0], 'add'), {onError: dart.bind(this[_controller$0], 'addError'), onDone: dart.fn(() => this.remove(stream), VoidTovoid$())}));
+        this[_subscriptions][dartx._set](stream, stream.listen(dart.bind(this[_controller$0], 'add'), {onError: dart.bind(this[_controller$0], 'addError'), onDone: dart.fn(() => this.remove(stream), VoidTovoid$())}));
       }
       remove(stream) {
         StreamOfT()._check(stream);
@@ -80012,10 +81818,10 @@
       this.uriPolicy = uriPolicy != null ? uriPolicy : html$.UriPolicy.new();
       if (dart.test(html$._Html5NodeValidator._attributeValidators[dartx.isEmpty])) {
         for (let attr of html$._Html5NodeValidator._standardAttributes) {
-          html$._Html5NodeValidator._attributeValidators[dartx.set](attr, html$._Html5NodeValidator._standardAttributeValidator);
+          html$._Html5NodeValidator._attributeValidators[dartx._set](attr, html$._Html5NodeValidator._standardAttributeValidator);
         }
         for (let attr of html$._Html5NodeValidator._uriAttributes) {
-          html$._Html5NodeValidator._attributeValidators[dartx.set](attr, html$._Html5NodeValidator._uriAttributeValidator);
+          html$._Html5NodeValidator._attributeValidators[dartx._set](attr, html$._Html5NodeValidator._uriAttributeValidator);
         }
       }
     }
@@ -80024,9 +81830,9 @@
     }
     allowsAttribute(element, attributeName, value) {
       let tagName = html$.Element._safeTagName(element);
-      let validator = html$._Html5NodeValidator._attributeValidators[dartx.get](dart.str`${tagName}::${attributeName}`);
+      let validator = html$._Html5NodeValidator._attributeValidators[dartx._get](dart.str`${tagName}::${attributeName}`);
       if (validator == null) {
-        validator = html$._Html5NodeValidator._attributeValidators[dartx.get](dart.str`*::${attributeName}`);
+        validator = html$._Html5NodeValidator._attributeValidators[dartx._get](dart.str`*::${attributeName}`);
       }
       if (validator == null) {
         return false;
@@ -80857,7 +82663,7 @@
         if (prevEvent[_shadowCharCode] == event[dartx.charCode]) {
           return prevEvent.keyCode;
         }
-        if ((dart.test(event[dartx.shiftKey]) || dart.test(this[_capsLockOn])) && dart.notNull(event[dartx.charCode]) >= dart.notNull("A"[dartx.codeUnits][dartx.get](0)) && dart.notNull(event[dartx.charCode]) <= dart.notNull("Z"[dartx.codeUnits][dartx.get](0)) && dart.notNull(event[dartx.charCode]) + dart.notNull(html$._KeyboardEventHandler._ROMAN_ALPHABET_OFFSET) == prevEvent[_shadowCharCode]) {
+        if ((dart.test(event[dartx.shiftKey]) || dart.test(this[_capsLockOn])) && dart.notNull(event[dartx.charCode]) >= dart.notNull("A"[dartx.codeUnits][dartx._get](0)) && dart.notNull(event[dartx.charCode]) <= dart.notNull("Z"[dartx.codeUnits][dartx._get](0)) && dart.notNull(event[dartx.charCode]) + dart.notNull(html$._KeyboardEventHandler._ROMAN_ALPHABET_OFFSET) == prevEvent[_shadowCharCode]) {
           return prevEvent.keyCode;
         }
       }
@@ -81055,7 +82861,7 @@
       }
       e[_shadowKeyCode] = this[_determineKeyCodeForKeypress](e);
       if (e[_shadowKeyIdentifier] != null && dart.test(html$._KeyboardEventHandler._keyIdentifier[dartx.containsKey](e[_shadowKeyIdentifier]))) {
-        e[_shadowKeyCode] = html$._KeyboardEventHandler._keyIdentifier[dartx.get](e[_shadowKeyIdentifier]);
+        e[_shadowKeyCode] = html$._KeyboardEventHandler._keyIdentifier[dartx._get](e[_shadowKeyIdentifier]);
       }
       e[_shadowAltKey] = this[_keyDownList][dartx.any](dart.fn(element => element.altKey, KeyEventTobool()));
       this[_stream$].add(e);
@@ -81110,7 +82916,7 @@
   html$._KeyboardEventHandler._keyIdentifier = dart.const(dart.map({Up: html$.KeyCode.UP, Down: html$.KeyCode.DOWN, Left: html$.KeyCode.LEFT, Right: html$.KeyCode.RIGHT, Enter: html$.KeyCode.ENTER, F1: html$.KeyCode.F1, F2: html$.KeyCode.F2, F3: html$.KeyCode.F3, F4: html$.KeyCode.F4, F5: html$.KeyCode.F5, F6: html$.KeyCode.F6, F7: html$.KeyCode.F7, F8: html$.KeyCode.F8, F9: html$.KeyCode.F9, F10: html$.KeyCode.F10, F11: html$.KeyCode.F11, F12: html$.KeyCode.F12, 'U+007F': html$.KeyCode.DELETE, Home: html$.KeyCode.HOME, End: html$.KeyCode.END, PageUp: html$.KeyCode.PAGE_UP, PageDown: html$.KeyCode.PAGE_DOWN, Insert: html$.KeyCode.INSERT}, core.String, core.int));
   dart.defineLazy(html$._KeyboardEventHandler, {
     get _ROMAN_ALPHABET_OFFSET() {
-      return dart.notNull("a"[dartx.codeUnits][dartx.get](0)) - dart.notNull("A"[dartx.codeUnits][dartx.get](0));
+      return dart.notNull("a"[dartx.codeUnits][dartx._get](0)) - dart.notNull("A"[dartx.codeUnits][dartx._get](0));
     }
   });
   html$.KeyboardEventStream = class KeyboardEventStream extends core.Object {
@@ -81328,7 +83134,7 @@
     }
     allowsElement(element) {
       if (dart.test(this.allowTypeExtension)) {
-        let isAttr = element[dartx.attributes][dartx.get]('is');
+        let isAttr = element[dartx.attributes][dartx._get]('is');
         if (isAttr != null) {
           return dart.test(this.allowedElements.contains(isAttr[dartx.toUpperCase]())) && dart.test(this.allowedElements.contains(html$.Element._safeTagName(element)));
         }
@@ -81365,7 +83171,7 @@
       if (attributeName == 'template' && value == "") {
         return true;
       }
-      if (element[dartx.attributes][dartx.get]('template') == "") {
+      if (element[dartx.attributes][dartx._get]('template') == "") {
         return this[_templateAttrs].contains(attributeName);
       }
       return false;
@@ -81440,12 +83246,12 @@
       clear() {
         this[_list$][dartx.clear]();
       }
-      get(index) {
-        return html$._downcast(html$.Node, E)(this[_list$][dartx.get](index));
+      _get(index) {
+        return html$._downcast(html$.Node, E)(this[_list$][dartx._get](index));
       }
-      set(index, value) {
+      _set(index, value) {
         E._check(value);
-        this[_list$][dartx.set](index, value);
+        this[_list$][dartx._set](index, value);
         return value;
       }
       set length(newLength) {
@@ -81503,8 +83309,8 @@
       setters: () => ({length: dart.definiteFunctionType(dart.void, [core.int])}),
       methods: () => ({
         add: dart.definiteFunctionType(dart.void, [E]),
-        get: dart.definiteFunctionType(E, [core.int]),
-        set: dart.definiteFunctionType(dart.void, [core.int, E]),
+        _get: dart.definiteFunctionType(E, [core.int]),
+        _set: dart.definiteFunctionType(dart.void, [core.int, E]),
         sort: dart.definiteFunctionType(dart.void, [], [EAndEToint()]),
         insert: dart.definiteFunctionType(dart.void, [core.int, E]),
         removeAt: dart.definiteFunctionType(E, [core.int]),
@@ -81517,8 +83323,8 @@
       'add',
       'remove',
       'clear',
-      'get',
-      'set',
+      '_get',
+      '_set',
       'sort',
       'indexOf',
       'lastIndexOf',
@@ -81599,7 +83405,7 @@
       moveNext() {
         let nextPosition = dart.notNull(this[_position$0]) + 1;
         if (nextPosition < dart.notNull(this[_length$2])) {
-          this[_current$4] = this[_array][dartx.get](nextPosition);
+          this[_current$4] = this[_array][dartx._get](nextPosition);
           this[_position$0] = nextPosition;
           return true;
         }
@@ -81639,7 +83445,7 @@
       moveNext() {
         let nextPosition = dart.notNull(this[_position$0]) + 1;
         if (nextPosition < dart.notNull(this[_array][dartx.length])) {
-          this[_current$4] = this[_array][dartx.get](nextPosition);
+          this[_current$4] = this[_array][dartx._get](nextPosition);
           this[_position$0] = nextPosition;
           return true;
         }
@@ -82224,9 +84030,9 @@
       }
       let keys = attrs[dartx.keys][dartx.toList]();
       for (let i = dart.notNull(attrs[dartx.length]) - 1; i >= 0; --i) {
-        let name = keys[dartx.get](i);
-        if (!dart.test(this.validator.allowsAttribute(element, core.String._check(dart.dsend(name, 'toLowerCase')), core.String._check(attrs[dartx.get](name))))) {
-          html$.window[dartx.console].warn('Removing disallowed attribute ' + dart.str`<${tag} ${name}="${attrs[dartx.get](name)}">`);
+        let name = keys[dartx._get](i);
+        if (!dart.test(this.validator.allowsAttribute(element, core.String._check(dart.dsend(name, 'toLowerCase')), core.String._check(attrs[dartx._get](name))))) {
+          html$.window[dartx.console].warn('Removing disallowed attribute ' + dart.str`<${tag} ${name}="${attrs[dartx._get](name)}">`);
           attrs[dartx.remove](name);
         }
       }
@@ -82268,15 +84074,6 @@
       sanitizeNode: dart.definiteFunctionType(dart.void, [html$.Node, html$.Node])
     })
   });
-  html$.Point$ = math.Point$;
-  html$.Point = math.Point;
-  html$.Rectangle$ = math.Rectangle$;
-  html$.Rectangle = math.Rectangle;
-  html_common.SupportedBrowser = _metadata.SupportedBrowser;
-  html_common.Unstable = _metadata.Unstable;
-  html_common.DocsEditable = _metadata.DocsEditable;
-  html_common.Experimental = _metadata.Experimental;
-  html_common.DomName = _metadata.DomName;
   html_common.convertDartToNative_SerializedScriptValue = function(value) {
     return html_common.convertDartToNative_PrepareForStructuredClone(value);
   };
@@ -82293,17 +84090,17 @@
     findSlot(value) {
       let length = this.values[dartx.length];
       for (let i = 0; i < dart.notNull(length); i++) {
-        if (core.identical(this.values[dartx.get](i), value)) return i;
+        if (core.identical(this.values[dartx._get](i), value)) return i;
       }
       this.values[dartx.add](value);
       this.copies[dartx.add](null);
       return length;
     }
     readSlot(i) {
-      return this.copies[dartx.get](i);
+      return this.copies[dartx._get](i);
     }
     writeSlot(i, x) {
-      this.copies[dartx.set](i, x);
+      this.copies[dartx._set](i, x);
     }
     cleanupSlots() {}
     walk(e) {
@@ -82348,7 +84145,7 @@
       let copy = this.newJsList(length);
       this.writeSlot(slot, copy);
       for (; i < dart.notNull(length); i++) {
-        dart.dsetindex(copy, i, this.walk(e[dartx.get](i)));
+        dart.dsetindex(copy, i, this.walk(e[dartx._get](i)));
       }
       return copy;
     }
@@ -82382,17 +84179,17 @@
     findSlot(value) {
       let length = this.values[dartx.length];
       for (let i = 0; i < dart.notNull(length); i++) {
-        if (dart.test(this.identicalInJs(this.values[dartx.get](i), value))) return i;
+        if (dart.test(this.identicalInJs(this.values[dartx._get](i), value))) return i;
       }
       this.values[dartx.add](value);
       this.copies[dartx.add](null);
       return length;
     }
     readSlot(i) {
-      return this.copies[dartx.get](i);
+      return this.copies[dartx._get](i);
     }
     writeSlot(i, x) {
-      this.copies[dartx.set](i, x);
+      this.copies[dartx._set](i, x);
     }
     walk(e) {
       if (e == null) return e;
@@ -82525,7 +84322,7 @@
     let dict = dart.map();
     let keys = Object.getOwnPropertyNames(object);
     for (let key of core.Iterable._check(keys)) {
-      dict[dartx.set](key, object[key]);
+      dict[dartx._set](key, object[key]);
     }
     return dict;
   };
@@ -82761,8 +84558,8 @@
     forEach(f) {
       this[_filtered][dartx.forEach](f);
     }
-    set(index, value) {
-      this.get(index)[dartx.replaceWith](value);
+    _set(index, value) {
+      this._get(index)[dartx.replaceWith](value);
       return value;
     }
     set length(newLength) {
@@ -82835,7 +84632,7 @@
       }
     }
     removeAt(index) {
-      let result = this.get(index);
+      let result = this._get(index);
       result[dartx.remove]();
       return result;
     }
@@ -82851,7 +84648,7 @@
     get length() {
       return this[_iterable$0][dartx.length];
     }
-    get(index) {
+    _get(index) {
       return this[_iterable$0][dartx.elementAt](index);
     }
     get iterator() {
@@ -82880,7 +84677,7 @@
     setters: () => ({length: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
       forEach: dart.definiteFunctionType(dart.void, [ElementTovoid()]),
-      set: dart.definiteFunctionType(dart.void, [core.int, html$.Element]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, html$.Element]),
       add: dart.definiteFunctionType(dart.void, [html$.Element]),
       addAll: dart.definiteFunctionType(dart.void, [IterableOfElement()]),
       sort: dart.definiteFunctionType(dart.void, [], [ElementAndElementToint()]),
@@ -82891,12 +84688,12 @@
       insert: dart.definiteFunctionType(dart.void, [core.int, html$.Element]),
       insertAll: dart.definiteFunctionType(dart.void, [core.int, IterableOfElement()]),
       removeAt: dart.definiteFunctionType(html$.Element, [core.int]),
-      get: dart.definiteFunctionType(html$.Element, [core.int])
+      _get: dart.definiteFunctionType(html$.Element, [core.int])
     })
   });
   dart.defineExtensionMembers(html_common.FilteredElementList, [
     'forEach',
-    'set',
+    '_set',
     'add',
     'addAll',
     'contains',
@@ -82911,7 +84708,7 @@
     'insertAll',
     'removeAt',
     'remove',
-    'get',
+    '_get',
     'length',
     'reversed',
     'length',
@@ -82926,7 +84723,7 @@
         startIndex = 0;
       }
       for (let i = startIndex; dart.notNull(i) < dart.notNull(endIndex); i = dart.notNull(i) + 1) {
-        if (dart.equals(a[dartx.get](i), element)) {
+        if (dart.equals(a[dartx._get](i), element)) {
           return i;
         }
       }
@@ -82940,7 +84737,7 @@
         startIndex = dart.notNull(a[dartx.length]) - 1;
       }
       for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) {
-        if (dart.equals(a[dartx.get](i), element)) {
+        if (dart.equals(a[dartx._get](i), element)) {
           return i;
         }
       }
@@ -82951,7 +84748,7 @@
       if (dart.notNull(end) < dart.notNull(start)) dart.throw(new core.RangeError.value(end));
       if (dart.notNull(end) > dart.notNull(a[dartx.length])) dart.throw(new core.RangeError.value(end));
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        accumulator[dartx.add](a[dartx.get](i));
+        accumulator[dartx.add](a[dartx._get](i));
       }
       return accumulator;
     }
@@ -83157,11 +84954,11 @@
     get [dartx.viewportElement]() {
       return this.viewportElement;
     }
-    [dartx.blur]() {
-      return this.blur();
+    [dartx.blur](...args) {
+      return this.blur.apply(this, args);
     }
-    [dartx.focus]() {
-      return this.focus();
+    [dartx.focus](...args) {
+      return this.focus.apply(this, args);
     }
     get [dartx.onAbort]() {
       return svg$.SvgElement.abortEvent.forElement(this);
@@ -83590,17 +85387,17 @@
     get [dartx.transform]() {
       return this.transform;
     }
-    [dartx.getBBox]() {
-      return this.getBBox();
+    [dartx.getBBox](...args) {
+      return this.getBBox.apply(this, args);
     }
-    [dartx.getCtm]() {
-      return this.getCTM();
+    [dartx.getCtm](...args) {
+      return this.getCTM.apply(this, args);
     }
-    [dartx.getScreenCtm]() {
-      return this.getScreenCTM();
+    [dartx.getScreenCtm](...args) {
+      return this.getScreenCTM.apply(this, args);
     }
-    [dartx.getTransformToElement](element) {
-      return this.getTransformToElement(element);
+    [dartx.getTransformToElement](...args) {
+      return this.getTransformToElement.apply(this, args);
     }
     get [dartx.requiredExtensions]() {
       return this.requiredExtensions;
@@ -83611,8 +85408,8 @@
     get [dartx.systemLanguage]() {
       return this.systemLanguage;
     }
-    [dartx.hasExtension](extension) {
-      return this.hasExtension(extension);
+    [dartx.hasExtension](...args) {
+      return this.hasExtension.apply(this, args);
     }
   };
   dart.defineNamedConstructor(svg$.GraphicsElement, 'created');
@@ -83709,11 +85506,11 @@
     set [dartx.valueInSpecifiedUnits](value) {
       this.valueInSpecifiedUnits = value;
     }
-    [dartx.convertToSpecifiedUnits](unitType) {
-      return this.convertToSpecifiedUnits(unitType);
+    [dartx.convertToSpecifiedUnits](...args) {
+      return this.convertToSpecifiedUnits.apply(this, args);
     }
-    [dartx.newValueSpecifiedUnits](unitType, valueInSpecifiedUnits) {
-      return this.newValueSpecifiedUnits(unitType, valueInSpecifiedUnits);
+    [dartx.newValueSpecifiedUnits](...args) {
+      return this.newValueSpecifiedUnits.apply(this, args);
     }
   };
   dart.setSignature(svg$.Angle, {
@@ -83773,26 +85570,26 @@
     get [dartx.targetElement]() {
       return this.targetElement;
     }
-    [dartx.beginElement]() {
-      return this.beginElement();
+    [dartx.beginElement](...args) {
+      return this.beginElement.apply(this, args);
     }
-    [dartx.beginElementAt](offset) {
-      return this.beginElementAt(offset);
+    [dartx.beginElementAt](...args) {
+      return this.beginElementAt.apply(this, args);
     }
-    [dartx.endElement]() {
-      return this.endElement();
+    [dartx.endElement](...args) {
+      return this.endElement.apply(this, args);
     }
-    [dartx.endElementAt](offset) {
-      return this.endElementAt(offset);
+    [dartx.endElementAt](...args) {
+      return this.endElementAt.apply(this, args);
     }
-    [dartx.getCurrentTime]() {
-      return this.getCurrentTime();
+    [dartx.getCurrentTime](...args) {
+      return this.getCurrentTime.apply(this, args);
     }
-    [dartx.getSimpleDuration]() {
-      return this.getSimpleDuration();
+    [dartx.getSimpleDuration](...args) {
+      return this.getSimpleDuration.apply(this, args);
     }
-    [dartx.getStartTime]() {
-      return this.getStartTime();
+    [dartx.getStartTime](...args) {
+      return this.getStartTime.apply(this, args);
     }
     get [dartx.requiredExtensions]() {
       return this.requiredExtensions;
@@ -83803,8 +85600,8 @@
     get [dartx.systemLanguage]() {
       return this.systemLanguage;
     }
-    [dartx.hasExtension](extension) {
-      return this.hasExtension(extension);
+    [dartx.hasExtension](...args) {
+      return this.hasExtension.apply(this, args);
     }
   };
   dart.defineNamedConstructor(svg$.AnimationElement, 'created');
@@ -84207,11 +86004,11 @@
     created() {
       super.created();
     }
-    [dartx.isPointInFill](point) {
-      return this.isPointInFill(point);
+    [dartx.isPointInFill](...args) {
+      return this.isPointInFill.apply(this, args);
     }
-    [dartx.isPointInStroke](point) {
-      return this.isPointInStroke(point);
+    [dartx.isPointInStroke](...args) {
+      return this.isPointInStroke.apply(this, args);
     }
   };
   dart.defineNamedConstructor(svg$.GeometryElement, 'created');
@@ -85337,8 +87134,8 @@
     get [dartx.stdDeviationY]() {
       return this.stdDeviationY;
     }
-    [dartx.setStdDeviation](stdDeviationX, stdDeviationY) {
-      return this.setStdDeviation(stdDeviationX, stdDeviationY);
+    [dartx.setStdDeviation](...args) {
+      return this.setStdDeviation.apply(this, args);
     }
     get [dartx.height]() {
       return this.height;
@@ -86173,7 +87970,42 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get height() {
+      return this[height$];
+    }
+    set height(value) {
+      super.height = value;
+    }
+    get result() {
+      return this[result];
+    }
+    set result(value) {
+      super.result = value;
+    }
+    get width() {
+      return this[width$];
+    }
+    set width(value) {
+      super.width = value;
+    }
+    get x() {
+      return this[x];
+    }
+    set x(value) {
+      super.x = value;
+    }
+    get y() {
+      return this[y];
+    }
+    set y(value) {
+      super.y = value;
+    }
   };
+  const height$ = Symbol(svg$.FilterPrimitiveStandardAttributes.name + "." + 'height'.toString());
+  const result = Symbol(svg$.FilterPrimitiveStandardAttributes.name + "." + 'result'.toString());
+  const width$ = Symbol(svg$.FilterPrimitiveStandardAttributes.name + "." + 'width'.toString());
+  const x = Symbol(svg$.FilterPrimitiveStandardAttributes.name + "." + 'x'.toString());
+  const y = Symbol(svg$.FilterPrimitiveStandardAttributes.name + "." + 'y'.toString());
   dart.setSignature(svg$.FilterPrimitiveStandardAttributes, {
     constructors: () => ({_: dart.definiteFunctionType(svg$.FilterPrimitiveStandardAttributes, [])}),
     fields: () => ({
@@ -86199,7 +88031,21 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get preserveAspectRatio() {
+      return this[preserveAspectRatio];
+    }
+    set preserveAspectRatio(value) {
+      super.preserveAspectRatio = value;
+    }
+    get viewBox() {
+      return this[viewBox];
+    }
+    set viewBox(value) {
+      super.viewBox = value;
+    }
   };
+  const preserveAspectRatio = Symbol(svg$.FitToViewBox.name + "." + 'preserveAspectRatio'.toString());
+  const viewBox = Symbol(svg$.FitToViewBox.name + "." + 'viewBox'.toString());
   dart.setSignature(svg$.FitToViewBox, {
     constructors: () => ({_: dart.definiteFunctionType(svg$.FitToViewBox, [])}),
     fields: () => ({
@@ -86374,11 +88220,11 @@
     set [dartx.valueInSpecifiedUnits](value) {
       this.valueInSpecifiedUnits = value;
     }
-    [dartx.convertToSpecifiedUnits](unitType) {
-      return this.convertToSpecifiedUnits(unitType);
+    [dartx.convertToSpecifiedUnits](...args) {
+      return this.convertToSpecifiedUnits.apply(this, args);
     }
-    [dartx.newValueSpecifiedUnits](unitType, valueInSpecifiedUnits) {
-      return this.newValueSpecifiedUnits(unitType, valueInSpecifiedUnits);
+    [dartx.newValueSpecifiedUnits](...args) {
+      return this.newValueSpecifiedUnits.apply(this, args);
     }
   };
   dart.setSignature(svg$.Length, {
@@ -86422,8 +88268,8 @@
   const __setter__$ = Symbol('__setter__');
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -86448,11 +88294,11 @@
     get [dartx.numberOfItems]() {
       return this.numberOfItems;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.getItem](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -86481,31 +88327,31 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__setter__$](index, newItem) {
-      return this.__setter__(index, newItem);
+    [__setter__$](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.appendItem](newItem) {
-      return this.appendItem(newItem);
+    [dartx.appendItem](...args) {
+      return this.appendItem.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.getItem](index) {
-      return this.getItem(index);
+    [dartx.getItem](...args) {
+      return this.getItem.apply(this, args);
     }
-    [dartx.initialize](newItem) {
-      return this.initialize(newItem);
+    [dartx.initialize](...args) {
+      return this.initialize.apply(this, args);
     }
-    [dartx.insertItemBefore](newItem, index) {
-      return this.insertItemBefore(newItem, index);
+    [dartx.insertItemBefore](...args) {
+      return this.insertItemBefore.apply(this, args);
     }
-    [dartx.removeItem](index) {
-      return this.removeItem(index);
+    [dartx.removeItem](...args) {
+      return this.removeItem.apply(this, args);
     }
-    [dartx.replaceItem](newItem, index) {
-      return this.replaceItem(newItem, index);
+    [dartx.replaceItem](...args) {
+      return this.replaceItem.apply(this, args);
     }
   };
   svg$.LengthList[dart.implements] = () => [ListOfLength()];
@@ -86520,8 +88366,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(svg$.Length, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, svg$.Length]),
+      [dartx._get]: dart.definiteFunctionType(svg$.Length, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, svg$.Length]),
       [dartx.elementAt]: dart.definiteFunctionType(svg$.Length, [core.int]),
       [__setter__$]: dart.definiteFunctionType(dart.void, [core.int, svg$.Length]),
       [dartx.appendItem]: dart.definiteFunctionType(svg$.Length, [svg$.Length]),
@@ -86737,11 +88583,11 @@
     get [dartx.refY]() {
       return this.refY;
     }
-    [dartx.setOrientToAngle](angle) {
-      return this.setOrientToAngle(angle);
+    [dartx.setOrientToAngle](...args) {
+      return this.setOrientToAngle.apply(this, args);
     }
-    [dartx.setOrientToAuto]() {
-      return this.setOrientToAuto();
+    [dartx.setOrientToAuto](...args) {
+      return this.setOrientToAuto.apply(this, args);
     }
     get [dartx.preserveAspectRatio]() {
       return this.preserveAspectRatio;
@@ -86847,8 +88693,8 @@
     get [dartx.systemLanguage]() {
       return this.systemLanguage;
     }
-    [dartx.hasExtension](extension) {
-      return this.hasExtension(extension);
+    [dartx.hasExtension](...args) {
+      return this.hasExtension.apply(this, args);
     }
   };
   dart.defineNamedConstructor(svg$.MaskElement, 'created');
@@ -86932,38 +88778,38 @@
     set [dartx.f](value) {
       this.f = value;
     }
-    [dartx.flipX]() {
-      return this.flipX();
+    [dartx.flipX](...args) {
+      return this.flipX.apply(this, args);
     }
-    [dartx.flipY]() {
-      return this.flipY();
+    [dartx.flipY](...args) {
+      return this.flipY.apply(this, args);
     }
-    [dartx.inverse]() {
-      return this.inverse();
+    [dartx.inverse](...args) {
+      return this.inverse.apply(this, args);
     }
-    [dartx.multiply](secondMatrix) {
-      return this.multiply(secondMatrix);
+    [dartx.multiply](...args) {
+      return this.multiply.apply(this, args);
     }
-    [dartx.rotate](angle) {
-      return this.rotate(angle);
+    [dartx.rotate](...args) {
+      return this.rotate.apply(this, args);
     }
-    [dartx.rotateFromVector](x, y) {
-      return this.rotateFromVector(x, y);
+    [dartx.rotateFromVector](...args) {
+      return this.rotateFromVector.apply(this, args);
     }
-    [dartx.scale](scaleFactor) {
-      return this.scale(scaleFactor);
+    [dartx.scale](...args) {
+      return this.scale.apply(this, args);
     }
-    [dartx.scaleNonUniform](scaleFactorX, scaleFactorY) {
-      return this.scaleNonUniform(scaleFactorX, scaleFactorY);
+    [dartx.scaleNonUniform](...args) {
+      return this.scaleNonUniform.apply(this, args);
     }
-    [dartx.skewX](angle) {
-      return this.skewX(angle);
+    [dartx.skewX](...args) {
+      return this.skewX.apply(this, args);
     }
-    [dartx.skewY](angle) {
-      return this.skewY(angle);
+    [dartx.skewY](...args) {
+      return this.skewY.apply(this, args);
     }
-    [dartx.translate](x, y) {
-      return this.translate(x, y);
+    [dartx.translate](...args) {
+      return this.translate.apply(this, args);
     }
   };
   dart.setSignature(svg$.Matrix, {
@@ -87028,8 +88874,8 @@
   dart.registerExtension(dart.global.SVGNumber, svg$.Number);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -87054,11 +88900,11 @@
     get [dartx.numberOfItems]() {
       return this.numberOfItems;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.getItem](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -87087,31 +88933,31 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__setter__$](index, newItem) {
-      return this.__setter__(index, newItem);
+    [__setter__$](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.appendItem](newItem) {
-      return this.appendItem(newItem);
+    [dartx.appendItem](...args) {
+      return this.appendItem.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.getItem](index) {
-      return this.getItem(index);
+    [dartx.getItem](...args) {
+      return this.getItem.apply(this, args);
     }
-    [dartx.initialize](newItem) {
-      return this.initialize(newItem);
+    [dartx.initialize](...args) {
+      return this.initialize.apply(this, args);
     }
-    [dartx.insertItemBefore](newItem, index) {
-      return this.insertItemBefore(newItem, index);
+    [dartx.insertItemBefore](...args) {
+      return this.insertItemBefore.apply(this, args);
     }
-    [dartx.removeItem](index) {
-      return this.removeItem(index);
+    [dartx.removeItem](...args) {
+      return this.removeItem.apply(this, args);
     }
-    [dartx.replaceItem](newItem, index) {
-      return this.replaceItem(newItem, index);
+    [dartx.replaceItem](...args) {
+      return this.replaceItem.apply(this, args);
     }
   };
   svg$.NumberList[dart.implements] = () => [ListOfNumber()];
@@ -87126,8 +88972,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(svg$.Number, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, svg$.Number]),
+      [dartx._get]: dart.definiteFunctionType(svg$.Number, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, svg$.Number]),
       [dartx.elementAt]: dart.definiteFunctionType(svg$.Number, [core.int]),
       [__setter__$]: dart.definiteFunctionType(dart.void, [core.int, svg$.Number]),
       [dartx.appendItem]: dart.definiteFunctionType(svg$.Number, [svg$.Number]),
@@ -87198,71 +89044,71 @@
     get [dartx.pathSegList]() {
       return this.pathSegList;
     }
-    [dartx.createSvgPathSegArcAbs](x, y, r1, r2, angle, largeArcFlag, sweepFlag) {
-      return this.createSVGPathSegArcAbs(x, y, r1, r2, angle, largeArcFlag, sweepFlag);
+    [dartx.createSvgPathSegArcAbs](...args) {
+      return this.createSVGPathSegArcAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegArcRel](x, y, r1, r2, angle, largeArcFlag, sweepFlag) {
-      return this.createSVGPathSegArcRel(x, y, r1, r2, angle, largeArcFlag, sweepFlag);
+    [dartx.createSvgPathSegArcRel](...args) {
+      return this.createSVGPathSegArcRel.apply(this, args);
     }
-    [dartx.createSvgPathSegClosePath]() {
-      return this.createSVGPathSegClosePath();
+    [dartx.createSvgPathSegClosePath](...args) {
+      return this.createSVGPathSegClosePath.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoCubicAbs](x, y, x1, y1, x2, y2) {
-      return this.createSVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2);
+    [dartx.createSvgPathSegCurvetoCubicAbs](...args) {
+      return this.createSVGPathSegCurvetoCubicAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoCubicRel](x, y, x1, y1, x2, y2) {
-      return this.createSVGPathSegCurvetoCubicRel(x, y, x1, y1, x2, y2);
+    [dartx.createSvgPathSegCurvetoCubicRel](...args) {
+      return this.createSVGPathSegCurvetoCubicRel.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoCubicSmoothAbs](x, y, x2, y2) {
-      return this.createSVGPathSegCurvetoCubicSmoothAbs(x, y, x2, y2);
+    [dartx.createSvgPathSegCurvetoCubicSmoothAbs](...args) {
+      return this.createSVGPathSegCurvetoCubicSmoothAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoCubicSmoothRel](x, y, x2, y2) {
-      return this.createSVGPathSegCurvetoCubicSmoothRel(x, y, x2, y2);
+    [dartx.createSvgPathSegCurvetoCubicSmoothRel](...args) {
+      return this.createSVGPathSegCurvetoCubicSmoothRel.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoQuadraticAbs](x, y, x1, y1) {
-      return this.createSVGPathSegCurvetoQuadraticAbs(x, y, x1, y1);
+    [dartx.createSvgPathSegCurvetoQuadraticAbs](...args) {
+      return this.createSVGPathSegCurvetoQuadraticAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoQuadraticRel](x, y, x1, y1) {
-      return this.createSVGPathSegCurvetoQuadraticRel(x, y, x1, y1);
+    [dartx.createSvgPathSegCurvetoQuadraticRel](...args) {
+      return this.createSVGPathSegCurvetoQuadraticRel.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoQuadraticSmoothAbs](x, y) {
-      return this.createSVGPathSegCurvetoQuadraticSmoothAbs(x, y);
+    [dartx.createSvgPathSegCurvetoQuadraticSmoothAbs](...args) {
+      return this.createSVGPathSegCurvetoQuadraticSmoothAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoQuadraticSmoothRel](x, y) {
-      return this.createSVGPathSegCurvetoQuadraticSmoothRel(x, y);
+    [dartx.createSvgPathSegCurvetoQuadraticSmoothRel](...args) {
+      return this.createSVGPathSegCurvetoQuadraticSmoothRel.apply(this, args);
     }
-    [dartx.createSvgPathSegLinetoAbs](x, y) {
-      return this.createSVGPathSegLinetoAbs(x, y);
+    [dartx.createSvgPathSegLinetoAbs](...args) {
+      return this.createSVGPathSegLinetoAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegLinetoHorizontalAbs](x) {
-      return this.createSVGPathSegLinetoHorizontalAbs(x);
+    [dartx.createSvgPathSegLinetoHorizontalAbs](...args) {
+      return this.createSVGPathSegLinetoHorizontalAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegLinetoHorizontalRel](x) {
-      return this.createSVGPathSegLinetoHorizontalRel(x);
+    [dartx.createSvgPathSegLinetoHorizontalRel](...args) {
+      return this.createSVGPathSegLinetoHorizontalRel.apply(this, args);
     }
-    [dartx.createSvgPathSegLinetoRel](x, y) {
-      return this.createSVGPathSegLinetoRel(x, y);
+    [dartx.createSvgPathSegLinetoRel](...args) {
+      return this.createSVGPathSegLinetoRel.apply(this, args);
     }
-    [dartx.createSvgPathSegLinetoVerticalAbs](y) {
-      return this.createSVGPathSegLinetoVerticalAbs(y);
+    [dartx.createSvgPathSegLinetoVerticalAbs](...args) {
+      return this.createSVGPathSegLinetoVerticalAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegLinetoVerticalRel](y) {
-      return this.createSVGPathSegLinetoVerticalRel(y);
+    [dartx.createSvgPathSegLinetoVerticalRel](...args) {
+      return this.createSVGPathSegLinetoVerticalRel.apply(this, args);
     }
-    [dartx.createSvgPathSegMovetoAbs](x, y) {
-      return this.createSVGPathSegMovetoAbs(x, y);
+    [dartx.createSvgPathSegMovetoAbs](...args) {
+      return this.createSVGPathSegMovetoAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegMovetoRel](x, y) {
-      return this.createSVGPathSegMovetoRel(x, y);
+    [dartx.createSvgPathSegMovetoRel](...args) {
+      return this.createSVGPathSegMovetoRel.apply(this, args);
     }
-    [dartx.getPathSegAtLength](distance) {
-      return this.getPathSegAtLength(distance);
+    [dartx.getPathSegAtLength](...args) {
+      return this.getPathSegAtLength.apply(this, args);
     }
-    [dartx.getPointAtLength](distance) {
-      return this.getPointAtLength(distance);
+    [dartx.getPointAtLength](...args) {
+      return this.getPointAtLength.apply(this, args);
     }
-    [dartx.getTotalLength]() {
-      return this.getTotalLength();
+    [dartx.getTotalLength](...args) {
+      return this.getTotalLength.apply(this, args);
     }
   };
   dart.defineNamedConstructor(svg$.PathElement, 'created');
@@ -88013,8 +89859,8 @@
   dart.registerExtension(dart.global.SVGPathSegLinetoVerticalRel, svg$.PathSegLinetoVerticalRel);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -88039,11 +89885,11 @@
     get [dartx.numberOfItems]() {
       return this.numberOfItems;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.getItem](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -88072,31 +89918,31 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__setter__$](index, newItem) {
-      return this.__setter__(index, newItem);
+    [__setter__$](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.appendItem](newItem) {
-      return this.appendItem(newItem);
+    [dartx.appendItem](...args) {
+      return this.appendItem.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.getItem](index) {
-      return this.getItem(index);
+    [dartx.getItem](...args) {
+      return this.getItem.apply(this, args);
     }
-    [dartx.initialize](newItem) {
-      return this.initialize(newItem);
+    [dartx.initialize](...args) {
+      return this.initialize.apply(this, args);
     }
-    [dartx.insertItemBefore](newItem, index) {
-      return this.insertItemBefore(newItem, index);
+    [dartx.insertItemBefore](...args) {
+      return this.insertItemBefore.apply(this, args);
     }
-    [dartx.removeItem](index) {
-      return this.removeItem(index);
+    [dartx.removeItem](...args) {
+      return this.removeItem.apply(this, args);
     }
-    [dartx.replaceItem](newItem, index) {
-      return this.replaceItem(newItem, index);
+    [dartx.replaceItem](...args) {
+      return this.replaceItem.apply(this, args);
     }
   };
   svg$.PathSegList[dart.implements] = () => [ListOfPathSeg()];
@@ -88111,8 +89957,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(svg$.PathSeg, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, svg$.PathSeg]),
+      [dartx._get]: dart.definiteFunctionType(svg$.PathSeg, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, svg$.PathSeg]),
       [dartx.elementAt]: dart.definiteFunctionType(svg$.PathSeg, [core.int]),
       [__setter__$]: dart.definiteFunctionType(dart.void, [core.int, svg$.PathSeg]),
       [dartx.appendItem]: dart.definiteFunctionType(svg$.PathSeg, [svg$.PathSeg]),
@@ -88257,8 +90103,8 @@
     get [dartx.systemLanguage]() {
       return this.systemLanguage;
     }
-    [dartx.hasExtension](extension) {
-      return this.hasExtension(extension);
+    [dartx.hasExtension](...args) {
+      return this.hasExtension.apply(this, args);
     }
     get [dartx.href]() {
       return this.href;
@@ -88311,8 +90157,8 @@
     set [dartx.y](value) {
       this.y = value;
     }
-    [dartx.matrixTransform](matrix) {
-      return this.matrixTransform(matrix);
+    [dartx.matrixTransform](...args) {
+      return this.matrixTransform.apply(this, args);
     }
   };
   dart.setSignature(svg$.Point, {
@@ -88345,29 +90191,29 @@
     get [dartx.numberOfItems]() {
       return this.numberOfItems;
     }
-    [__setter__$](index, newItem) {
-      return this.__setter__(index, newItem);
+    [__setter__$](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.appendItem](newItem) {
-      return this.appendItem(newItem);
+    [dartx.appendItem](...args) {
+      return this.appendItem.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.getItem](index) {
-      return this.getItem(index);
+    [dartx.getItem](...args) {
+      return this.getItem.apply(this, args);
     }
-    [dartx.initialize](newItem) {
-      return this.initialize(newItem);
+    [dartx.initialize](...args) {
+      return this.initialize.apply(this, args);
     }
-    [dartx.insertItemBefore](newItem, index) {
-      return this.insertItemBefore(newItem, index);
+    [dartx.insertItemBefore](...args) {
+      return this.insertItemBefore.apply(this, args);
     }
-    [dartx.removeItem](index) {
-      return this.removeItem(index);
+    [dartx.removeItem](...args) {
+      return this.removeItem.apply(this, args);
     }
-    [dartx.replaceItem](newItem, index) {
-      return this.replaceItem(newItem, index);
+    [dartx.replaceItem](...args) {
+      return this.replaceItem.apply(this, args);
     }
   };
   dart.setSignature(svg$.PointList, {
@@ -88778,8 +90624,8 @@
   dart.registerExtension(dart.global.SVGStopElement, svg$.StopElement);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -88804,11 +90650,11 @@
     get [dartx.numberOfItems]() {
       return this.numberOfItems;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.getItem](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -88837,31 +90683,31 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__setter__$](index, newItem) {
-      return this.__setter__(index, newItem);
+    [__setter__$](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.appendItem](newItem) {
-      return this.appendItem(newItem);
+    [dartx.appendItem](...args) {
+      return this.appendItem.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.getItem](index) {
-      return this.getItem(index);
+    [dartx.getItem](...args) {
+      return this.getItem.apply(this, args);
     }
-    [dartx.initialize](newItem) {
-      return this.initialize(newItem);
+    [dartx.initialize](...args) {
+      return this.initialize.apply(this, args);
     }
-    [dartx.insertItemBefore](item, index) {
-      return this.insertItemBefore(item, index);
+    [dartx.insertItemBefore](...args) {
+      return this.insertItemBefore.apply(this, args);
     }
-    [dartx.removeItem](index) {
-      return this.removeItem(index);
+    [dartx.removeItem](...args) {
+      return this.removeItem.apply(this, args);
     }
-    [dartx.replaceItem](newItem, index) {
-      return this.replaceItem(newItem, index);
+    [dartx.replaceItem](...args) {
+      return this.replaceItem.apply(this, args);
     }
   };
   svg$.StringList[dart.implements] = () => [ListOfString()];
@@ -88876,8 +90722,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.String, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, core.String]),
+      [dartx._get]: dart.definiteFunctionType(core.String, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, core.String]),
       [dartx.elementAt]: dart.definiteFunctionType(core.String, [core.int]),
       [__setter__$]: dart.definiteFunctionType(dart.void, [core.int, core.String]),
       [dartx.appendItem]: dart.definiteFunctionType(core.String, [core.String]),
@@ -88952,7 +90798,7 @@
       this[_element$0] = element;
     }
     readClasses() {
-      let classname = this[_element$0][dartx.attributes][dartx.get]('class');
+      let classname = this[_element$0][dartx.attributes][dartx._get]('class');
       let s = LinkedHashSetOfString().new();
       if (classname == null) {
         return s;
@@ -88966,7 +90812,7 @@
       return s;
     }
     writeClasses(s) {
-      this[_element$0][dartx.attributes][dartx.set]('class', s.join(' '));
+      this[_element$0][dartx.attributes][dartx._set]('class', s.join(' '));
     }
   };
   dart.setSignature(svg$._AttributeClassSet, {
@@ -89021,7 +90867,7 @@
   svg$.SvgSvgElement = class SvgSvgElement extends svg$.GraphicsElement {
     static new() {
       let el = svg$.SvgElement.tag("svg");
-      el[dartx.attributes][dartx.set]('version', "1.1");
+      el[dartx.attributes][dartx._set]('version', "1.1");
       return svg$.SvgSvgElement._check(el);
     }
     static _() {
@@ -89088,74 +90934,74 @@
     get [dartx.y]() {
       return this.y;
     }
-    [dartx.animationsPaused]() {
-      return this.animationsPaused();
+    [dartx.animationsPaused](...args) {
+      return this.animationsPaused.apply(this, args);
     }
-    [dartx.checkEnclosure](element, rect) {
-      return this.checkEnclosure(element, rect);
+    [dartx.checkEnclosure](...args) {
+      return this.checkEnclosure.apply(this, args);
     }
-    [dartx.checkIntersection](element, rect) {
-      return this.checkIntersection(element, rect);
+    [dartx.checkIntersection](...args) {
+      return this.checkIntersection.apply(this, args);
     }
-    [dartx.createSvgAngle]() {
-      return this.createSVGAngle();
+    [dartx.createSvgAngle](...args) {
+      return this.createSVGAngle.apply(this, args);
     }
-    [dartx.createSvgLength]() {
-      return this.createSVGLength();
+    [dartx.createSvgLength](...args) {
+      return this.createSVGLength.apply(this, args);
     }
-    [dartx.createSvgMatrix]() {
-      return this.createSVGMatrix();
+    [dartx.createSvgMatrix](...args) {
+      return this.createSVGMatrix.apply(this, args);
     }
-    [dartx.createSvgNumber]() {
-      return this.createSVGNumber();
+    [dartx.createSvgNumber](...args) {
+      return this.createSVGNumber.apply(this, args);
     }
-    [dartx.createSvgPoint]() {
-      return this.createSVGPoint();
+    [dartx.createSvgPoint](...args) {
+      return this.createSVGPoint.apply(this, args);
     }
-    [dartx.createSvgRect]() {
-      return this.createSVGRect();
+    [dartx.createSvgRect](...args) {
+      return this.createSVGRect.apply(this, args);
     }
-    [dartx.createSvgTransform]() {
-      return this.createSVGTransform();
+    [dartx.createSvgTransform](...args) {
+      return this.createSVGTransform.apply(this, args);
     }
-    [dartx.createSvgTransformFromMatrix](matrix) {
-      return this.createSVGTransformFromMatrix(matrix);
+    [dartx.createSvgTransformFromMatrix](...args) {
+      return this.createSVGTransformFromMatrix.apply(this, args);
     }
-    [dartx.deselectAll]() {
-      return this.deselectAll();
+    [dartx.deselectAll](...args) {
+      return this.deselectAll.apply(this, args);
     }
-    [dartx.forceRedraw]() {
-      return this.forceRedraw();
+    [dartx.forceRedraw](...args) {
+      return this.forceRedraw.apply(this, args);
     }
-    [dartx.getCurrentTime]() {
-      return this.getCurrentTime();
+    [dartx.getCurrentTime](...args) {
+      return this.getCurrentTime.apply(this, args);
     }
-    [dartx.getElementById](elementId) {
-      return this.getElementById(elementId);
+    [dartx.getElementById](...args) {
+      return this.getElementById.apply(this, args);
     }
-    [dartx.getEnclosureList](rect, referenceElement) {
-      return this.getEnclosureList(rect, referenceElement);
+    [dartx.getEnclosureList](...args) {
+      return this.getEnclosureList.apply(this, args);
     }
-    [dartx.getIntersectionList](rect, referenceElement) {
-      return this.getIntersectionList(rect, referenceElement);
+    [dartx.getIntersectionList](...args) {
+      return this.getIntersectionList.apply(this, args);
     }
-    [dartx.pauseAnimations]() {
-      return this.pauseAnimations();
+    [dartx.pauseAnimations](...args) {
+      return this.pauseAnimations.apply(this, args);
     }
-    [dartx.setCurrentTime](seconds) {
-      return this.setCurrentTime(seconds);
+    [dartx.setCurrentTime](...args) {
+      return this.setCurrentTime.apply(this, args);
     }
-    [dartx.suspendRedraw](maxWaitMilliseconds) {
-      return this.suspendRedraw(maxWaitMilliseconds);
+    [dartx.suspendRedraw](...args) {
+      return this.suspendRedraw.apply(this, args);
     }
-    [dartx.unpauseAnimations]() {
-      return this.unpauseAnimations();
+    [dartx.unpauseAnimations](...args) {
+      return this.unpauseAnimations.apply(this, args);
     }
-    [dartx.unsuspendRedraw](suspendHandleId) {
-      return this.unsuspendRedraw(suspendHandleId);
+    [dartx.unsuspendRedraw](...args) {
+      return this.unsuspendRedraw.apply(this, args);
     }
-    [dartx.unsuspendRedrawAll]() {
-      return this.unsuspendRedrawAll();
+    [dartx.unsuspendRedrawAll](...args) {
+      return this.unsuspendRedrawAll.apply(this, args);
     }
     get [dartx.preserveAspectRatio]() {
       return this.preserveAspectRatio;
@@ -89308,32 +91154,32 @@
     get [dartx.textLength]() {
       return this.textLength;
     }
-    [dartx.getCharNumAtPosition](point) {
-      return this.getCharNumAtPosition(point);
+    [dartx.getCharNumAtPosition](...args) {
+      return this.getCharNumAtPosition.apply(this, args);
     }
-    [dartx.getComputedTextLength]() {
-      return this.getComputedTextLength();
+    [dartx.getComputedTextLength](...args) {
+      return this.getComputedTextLength.apply(this, args);
     }
-    [dartx.getEndPositionOfChar](charnum) {
-      return this.getEndPositionOfChar(charnum);
+    [dartx.getEndPositionOfChar](...args) {
+      return this.getEndPositionOfChar.apply(this, args);
     }
-    [dartx.getExtentOfChar](charnum) {
-      return this.getExtentOfChar(charnum);
+    [dartx.getExtentOfChar](...args) {
+      return this.getExtentOfChar.apply(this, args);
     }
-    [dartx.getNumberOfChars]() {
-      return this.getNumberOfChars();
+    [dartx.getNumberOfChars](...args) {
+      return this.getNumberOfChars.apply(this, args);
     }
-    [dartx.getRotationOfChar](charnum) {
-      return this.getRotationOfChar(charnum);
+    [dartx.getRotationOfChar](...args) {
+      return this.getRotationOfChar.apply(this, args);
     }
-    [dartx.getStartPositionOfChar](charnum) {
-      return this.getStartPositionOfChar(charnum);
+    [dartx.getStartPositionOfChar](...args) {
+      return this.getStartPositionOfChar.apply(this, args);
     }
-    [dartx.getSubStringLength](charnum, nchars) {
-      return this.getSubStringLength(charnum, nchars);
+    [dartx.getSubStringLength](...args) {
+      return this.getSubStringLength.apply(this, args);
     }
-    [dartx.selectSubString](charnum, nchars) {
-      return this.selectSubString(charnum, nchars);
+    [dartx.selectSubString](...args) {
+      return this.selectSubString.apply(this, args);
     }
   };
   dart.defineNamedConstructor(svg$.TextContentElement, 'created');
@@ -89446,7 +91292,28 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get requiredExtensions() {
+      return this[requiredExtensions];
+    }
+    set requiredExtensions(value) {
+      super.requiredExtensions = value;
+    }
+    get requiredFeatures() {
+      return this[requiredFeatures];
+    }
+    set requiredFeatures(value) {
+      super.requiredFeatures = value;
+    }
+    get systemLanguage() {
+      return this[systemLanguage];
+    }
+    set systemLanguage(value) {
+      super.systemLanguage = value;
+    }
   };
+  const requiredExtensions = Symbol(svg$.Tests.name + "." + 'requiredExtensions'.toString());
+  const requiredFeatures = Symbol(svg$.Tests.name + "." + 'requiredFeatures'.toString());
+  const systemLanguage = Symbol(svg$.Tests.name + "." + 'systemLanguage'.toString());
   dart.setSignature(svg$.Tests, {
     constructors: () => ({_: dart.definiteFunctionType(svg$.Tests, [])}),
     fields: () => ({
@@ -89579,23 +91446,23 @@
     get [dartx.type]() {
       return this.type;
     }
-    [dartx.setMatrix](matrix) {
-      return this.setMatrix(matrix);
+    [dartx.setMatrix](...args) {
+      return this.setMatrix.apply(this, args);
     }
-    [dartx.setRotate](angle, cx, cy) {
-      return this.setRotate(angle, cx, cy);
+    [dartx.setRotate](...args) {
+      return this.setRotate.apply(this, args);
     }
-    [dartx.setScale](sx, sy) {
-      return this.setScale(sx, sy);
+    [dartx.setScale](...args) {
+      return this.setScale.apply(this, args);
     }
-    [dartx.setSkewX](angle) {
-      return this.setSkewX(angle);
+    [dartx.setSkewX](...args) {
+      return this.setSkewX.apply(this, args);
     }
-    [dartx.setSkewY](angle) {
-      return this.setSkewY(angle);
+    [dartx.setSkewY](...args) {
+      return this.setSkewY.apply(this, args);
     }
-    [dartx.setTranslate](tx, ty) {
-      return this.setTranslate(tx, ty);
+    [dartx.setTranslate](...args) {
+      return this.setTranslate.apply(this, args);
     }
   };
   dart.setSignature(svg$.Transform, {
@@ -89633,8 +91500,8 @@
   dart.registerExtension(dart.global.SVGTransform, svg$.Transform);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -89661,11 +91528,11 @@
     get [dartx.numberOfItems]() {
       return this.numberOfItems;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.getItem](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -89694,37 +91561,37 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__setter__$](index, newItem) {
-      return this.__setter__(index, newItem);
+    [__setter__$](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.appendItem](newItem) {
-      return this.appendItem(newItem);
+    [dartx.appendItem](...args) {
+      return this.appendItem.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.consolidate]() {
-      return this.consolidate();
+    [dartx.consolidate](...args) {
+      return this.consolidate.apply(this, args);
     }
-    [dartx.createSvgTransformFromMatrix](matrix) {
-      return this.createSVGTransformFromMatrix(matrix);
+    [dartx.createSvgTransformFromMatrix](...args) {
+      return this.createSVGTransformFromMatrix.apply(this, args);
     }
-    [dartx.getItem](index) {
-      return this.getItem(index);
+    [dartx.getItem](...args) {
+      return this.getItem.apply(this, args);
     }
-    [dartx.initialize](newItem) {
-      return this.initialize(newItem);
+    [dartx.initialize](...args) {
+      return this.initialize.apply(this, args);
     }
-    [dartx.insertItemBefore](newItem, index) {
-      return this.insertItemBefore(newItem, index);
+    [dartx.insertItemBefore](...args) {
+      return this.insertItemBefore.apply(this, args);
     }
-    [dartx.removeItem](index) {
-      return this.removeItem(index);
+    [dartx.removeItem](...args) {
+      return this.removeItem.apply(this, args);
     }
-    [dartx.replaceItem](newItem, index) {
-      return this.replaceItem(newItem, index);
+    [dartx.replaceItem](...args) {
+      return this.replaceItem.apply(this, args);
     }
   };
   svg$.TransformList[dart.implements] = () => [ListOfTransform()];
@@ -89739,8 +91606,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(svg$.Transform, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, svg$.Transform]),
+      [dartx._get]: dart.definiteFunctionType(svg$.Transform, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, svg$.Transform]),
       [dartx.elementAt]: dart.definiteFunctionType(svg$.Transform, [core.int]),
       [__setter__$]: dart.definiteFunctionType(dart.void, [core.int, svg$.Transform]),
       [dartx.appendItem]: dart.definiteFunctionType(svg$.Transform, [svg$.Transform]),
@@ -89778,7 +91645,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get href() {
+      return this[href$0];
+    }
+    set href(value) {
+      super.href = value;
+    }
   };
+  const href$0 = Symbol(svg$.UriReference.name + "." + 'href'.toString());
   dart.setSignature(svg$.UriReference, {
     constructors: () => ({_: dart.definiteFunctionType(svg$.UriReference, [])}),
     fields: () => ({href: svg$.AnimatedString})
@@ -89960,7 +91834,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get zoomAndPan() {
+      return this[zoomAndPan];
+    }
+    set zoomAndPan(value) {
+      this[zoomAndPan] = value;
+    }
   };
+  const zoomAndPan = Symbol(svg$.ZoomAndPan.name + "." + 'zoomAndPan'.toString());
   dart.setSignature(svg$.ZoomAndPan, {
     constructors: () => ({_: dart.definiteFunctionType(svg$.ZoomAndPan, [])}),
     fields: () => ({zoomAndPan: core.int}),
@@ -90118,11 +91999,11 @@
     get [dartx.numberOfOutputs]() {
       return this.numberOfOutputs;
     }
-    [_connect](destination, output, input) {
-      return this.connect(destination, output, input);
+    [_connect](...args) {
+      return this.connect.apply(this, args);
     }
-    [dartx.disconnect](output) {
-      return this.disconnect(output);
+    [dartx.disconnect](...args) {
+      return this.disconnect.apply(this, args);
     }
     [dartx.connectNode](destination, output, input) {
       if (output === void 0) output = 0;
@@ -90194,17 +92075,17 @@
     set [dartx.smoothingTimeConstant](value) {
       this.smoothingTimeConstant = value;
     }
-    [dartx.getByteFrequencyData](array) {
-      return this.getByteFrequencyData(array);
+    [dartx.getByteFrequencyData](...args) {
+      return this.getByteFrequencyData.apply(this, args);
     }
-    [dartx.getByteTimeDomainData](array) {
-      return this.getByteTimeDomainData(array);
+    [dartx.getByteTimeDomainData](...args) {
+      return this.getByteTimeDomainData.apply(this, args);
     }
-    [dartx.getFloatFrequencyData](array) {
-      return this.getFloatFrequencyData(array);
+    [dartx.getFloatFrequencyData](...args) {
+      return this.getFloatFrequencyData.apply(this, args);
     }
-    [dartx.getFloatTimeDomainData](array) {
-      return this.getFloatTimeDomainData(array);
+    [dartx.getFloatTimeDomainData](...args) {
+      return this.getFloatTimeDomainData.apply(this, args);
     }
   };
   dart.setSignature(web_audio.AnalyserNode, {
@@ -90224,6 +92105,7 @@
     })
   });
   dart.registerExtension(dart.global.AnalyserNode, web_audio.AnalyserNode);
+  dart.registerExtension(dart.global.RealtimeAnalyserNode, web_audio.AnalyserNode);
   dart.defineExtensionNames([
     'getChannelData',
     'duration',
@@ -90247,8 +92129,8 @@
     get [dartx.sampleRate]() {
       return this.sampleRate;
     }
-    [dartx.getChannelData](channelIndex) {
-      return this.getChannelData(channelIndex);
+    [dartx.getChannelData](...args) {
+      return this.getChannelData.apply(this, args);
     }
   };
   dart.setSignature(web_audio.AudioBuffer, {
@@ -90410,59 +92292,59 @@
     get [dartx.sampleRate]() {
       return this.sampleRate;
     }
-    [dartx.createAnalyser]() {
-      return this.createAnalyser();
+    [dartx.createAnalyser](...args) {
+      return this.createAnalyser.apply(this, args);
     }
-    [dartx.createBiquadFilter]() {
-      return this.createBiquadFilter();
+    [dartx.createBiquadFilter](...args) {
+      return this.createBiquadFilter.apply(this, args);
     }
-    [dartx.createBuffer](numberOfChannels, numberOfFrames, sampleRate) {
-      return this.createBuffer(numberOfChannels, numberOfFrames, sampleRate);
+    [dartx.createBuffer](...args) {
+      return this.createBuffer.apply(this, args);
     }
-    [dartx.createBufferSource]() {
-      return this.createBufferSource();
+    [dartx.createBufferSource](...args) {
+      return this.createBufferSource.apply(this, args);
     }
-    [dartx.createChannelMerger](numberOfInputs) {
-      return this.createChannelMerger(numberOfInputs);
+    [dartx.createChannelMerger](...args) {
+      return this.createChannelMerger.apply(this, args);
     }
-    [dartx.createChannelSplitter](numberOfOutputs) {
-      return this.createChannelSplitter(numberOfOutputs);
+    [dartx.createChannelSplitter](...args) {
+      return this.createChannelSplitter.apply(this, args);
     }
-    [dartx.createConvolver]() {
-      return this.createConvolver();
+    [dartx.createConvolver](...args) {
+      return this.createConvolver.apply(this, args);
     }
-    [dartx.createDelay](maxDelayTime) {
-      return this.createDelay(maxDelayTime);
+    [dartx.createDelay](...args) {
+      return this.createDelay.apply(this, args);
     }
-    [dartx.createDynamicsCompressor]() {
-      return this.createDynamicsCompressor();
+    [dartx.createDynamicsCompressor](...args) {
+      return this.createDynamicsCompressor.apply(this, args);
     }
-    [dartx.createMediaElementSource](mediaElement) {
-      return this.createMediaElementSource(mediaElement);
+    [dartx.createMediaElementSource](...args) {
+      return this.createMediaElementSource.apply(this, args);
     }
-    [dartx.createMediaStreamDestination]() {
-      return this.createMediaStreamDestination();
+    [dartx.createMediaStreamDestination](...args) {
+      return this.createMediaStreamDestination.apply(this, args);
     }
-    [dartx.createMediaStreamSource](mediaStream) {
-      return this.createMediaStreamSource(mediaStream);
+    [dartx.createMediaStreamSource](...args) {
+      return this.createMediaStreamSource.apply(this, args);
     }
-    [dartx.createOscillator]() {
-      return this.createOscillator();
+    [dartx.createOscillator](...args) {
+      return this.createOscillator.apply(this, args);
     }
-    [dartx.createPanner]() {
-      return this.createPanner();
+    [dartx.createPanner](...args) {
+      return this.createPanner.apply(this, args);
     }
-    [dartx.createPeriodicWave](real, imag) {
-      return this.createPeriodicWave(real, imag);
+    [dartx.createPeriodicWave](...args) {
+      return this.createPeriodicWave.apply(this, args);
     }
-    [dartx.createWaveShaper]() {
-      return this.createWaveShaper();
+    [dartx.createWaveShaper](...args) {
+      return this.createWaveShaper.apply(this, args);
     }
-    [_decodeAudioData](audioData, successCallback, errorCallback) {
-      return this.decodeAudioData(audioData, successCallback, errorCallback);
+    [_decodeAudioData](...args) {
+      return this.decodeAudioData.apply(this, args);
     }
-    [dartx.startRendering]() {
-      return this.startRendering();
+    [dartx.startRendering](...args) {
+      return this.startRendering.apply(this, args);
     }
     get [dartx.onComplete]() {
       return web_audio.AudioContext.completeEvent.forTarget(this);
@@ -90543,6 +92425,7 @@
   });
   web_audio.AudioContext.completeEvent = dart.const(new (EventStreamProviderOfEvent())('complete'));
   dart.registerExtension(dart.global.AudioContext, web_audio.AudioContext);
+  dart.registerExtension(dart.global.webkitAudioContext, web_audio.AudioContext);
   dart.defineExtensionNames([
     'maxChannelCount'
   ]);
@@ -90582,14 +92465,14 @@
     set [dartx.speedOfSound](value) {
       this.speedOfSound = value;
     }
-    [dartx.setOrientation](x, y, z, xUp, yUp, zUp) {
-      return this.setOrientation(x, y, z, xUp, yUp, zUp);
+    [dartx.setOrientation](...args) {
+      return this.setOrientation.apply(this, args);
     }
-    [dartx.setPosition](x, y, z) {
-      return this.setPosition(x, y, z);
+    [dartx.setPosition](...args) {
+      return this.setPosition.apply(this, args);
     }
-    [dartx.setVelocity](x, y, z) {
-      return this.setVelocity(x, y, z);
+    [dartx.setVelocity](...args) {
+      return this.setVelocity.apply(this, args);
     }
   };
   dart.setSignature(web_audio.AudioListener, {
@@ -90628,23 +92511,23 @@
     set [dartx.value](value) {
       this.value = value;
     }
-    [dartx.cancelScheduledValues](startTime) {
-      return this.cancelScheduledValues(startTime);
+    [dartx.cancelScheduledValues](...args) {
+      return this.cancelScheduledValues.apply(this, args);
     }
-    [dartx.exponentialRampToValueAtTime](value, time) {
-      return this.exponentialRampToValueAtTime(value, time);
+    [dartx.exponentialRampToValueAtTime](...args) {
+      return this.exponentialRampToValueAtTime.apply(this, args);
     }
-    [dartx.linearRampToValueAtTime](value, time) {
-      return this.linearRampToValueAtTime(value, time);
+    [dartx.linearRampToValueAtTime](...args) {
+      return this.linearRampToValueAtTime.apply(this, args);
     }
-    [dartx.setTargetAtTime](target, time, timeConstant) {
-      return this.setTargetAtTime(target, time, timeConstant);
+    [dartx.setTargetAtTime](...args) {
+      return this.setTargetAtTime.apply(this, args);
     }
-    [dartx.setValueAtTime](value, time) {
-      return this.setValueAtTime(value, time);
+    [dartx.setValueAtTime](...args) {
+      return this.setValueAtTime.apply(this, args);
     }
-    [dartx.setValueCurveAtTime](values, time, duration) {
-      return this.setValueCurveAtTime(values, time, duration);
+    [dartx.setValueCurveAtTime](...args) {
+      return this.setValueCurveAtTime.apply(this, args);
     }
   };
   dart.setSignature(web_audio.AudioParam, {
@@ -90721,8 +92604,8 @@
     set [dartx.type](value) {
       this.type = value;
     }
-    [dartx.getFrequencyResponse](frequencyHz, magResponse, phaseResponse) {
-      return this.getFrequencyResponse(frequencyHz, magResponse, phaseResponse);
+    [dartx.getFrequencyResponse](...args) {
+      return this.getFrequencyResponse.apply(this, args);
     }
   };
   dart.setSignature(web_audio.BiquadFilterNode, {
@@ -90746,6 +92629,7 @@
     constructors: () => ({_: dart.definiteFunctionType(web_audio.ChannelMergerNode, [])})
   });
   dart.registerExtension(dart.global.ChannelMergerNode, web_audio.ChannelMergerNode);
+  dart.registerExtension(dart.global.AudioChannelMerger, web_audio.ChannelMergerNode);
   web_audio.ChannelSplitterNode = class ChannelSplitterNode extends web_audio.AudioNode {
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
@@ -90755,6 +92639,7 @@
     constructors: () => ({_: dart.definiteFunctionType(web_audio.ChannelSplitterNode, [])})
   });
   dart.registerExtension(dart.global.ChannelSplitterNode, web_audio.ChannelSplitterNode);
+  dart.registerExtension(dart.global.AudioChannelSplitter, web_audio.ChannelSplitterNode);
   dart.defineExtensionNames([
     'buffer',
     'normalize'
@@ -90859,6 +92744,7 @@
     fields: () => ({[dartx.gain]: web_audio.AudioParam})
   });
   dart.registerExtension(dart.global.GainNode, web_audio.GainNode);
+  dart.registerExtension(dart.global.AudioGainNode, web_audio.GainNode);
   dart.defineExtensionNames([
     'mediaElement'
   ]);
@@ -90970,20 +92856,20 @@
     set [dartx.type](value) {
       this.type = value;
     }
-    [dartx.noteOff](when) {
-      return this.noteOff(when);
+    [dartx.noteOff](...args) {
+      return this.noteOff.apply(this, args);
     }
-    [dartx.noteOn](when) {
-      return this.noteOn(when);
+    [dartx.noteOn](...args) {
+      return this.noteOn.apply(this, args);
     }
-    [dartx.setPeriodicWave](periodicWave) {
-      return this.setPeriodicWave(periodicWave);
+    [dartx.setPeriodicWave](...args) {
+      return this.setPeriodicWave.apply(this, args);
     }
-    [dartx.start](when) {
-      return this.start(when);
+    [dartx.start](...args) {
+      return this.start.apply(this, args);
     }
-    [dartx.stop](when) {
-      return this.stop(when);
+    [dartx.stop](...args) {
+      return this.stop.apply(this, args);
     }
     get [dartx.onEnded]() {
       return web_audio.OscillatorNode.endedEvent.forTarget(this);
@@ -91008,6 +92894,7 @@
   });
   web_audio.OscillatorNode.endedEvent = dart.const(new (EventStreamProviderOfEvent())('ended'));
   dart.registerExtension(dart.global.OscillatorNode, web_audio.OscillatorNode);
+  dart.registerExtension(dart.global.Oscillator, web_audio.OscillatorNode);
   dart.defineExtensionNames([
     'setOrientation',
     'setPosition',
@@ -91073,14 +92960,14 @@
     set [dartx.rolloffFactor](value) {
       this.rolloffFactor = value;
     }
-    [dartx.setOrientation](x, y, z) {
-      return this.setOrientation(x, y, z);
+    [dartx.setOrientation](...args) {
+      return this.setOrientation.apply(this, args);
     }
-    [dartx.setPosition](x, y, z) {
-      return this.setPosition(x, y, z);
+    [dartx.setPosition](...args) {
+      return this.setPosition.apply(this, args);
     }
-    [dartx.setVelocity](x, y, z) {
-      return this.setVelocity(x, y, z);
+    [dartx.setVelocity](...args) {
+      return this.setVelocity.apply(this, args);
     }
   };
   dart.setSignature(web_audio.PannerNode, {
@@ -91102,6 +92989,8 @@
     })
   });
   dart.registerExtension(dart.global.PannerNode, web_audio.PannerNode);
+  dart.registerExtension(dart.global.AudioPannerNode, web_audio.PannerNode);
+  dart.registerExtension(dart.global.webkitAudioPannerNode, web_audio.PannerNode);
   web_audio.PeriodicWave = class PeriodicWave extends _interceptors.Interceptor {
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
@@ -91123,8 +93012,8 @@
     get [dartx.bufferSize]() {
       return this.bufferSize;
     }
-    [dartx.setEventListener](eventListener) {
-      return this.setEventListener(eventListener);
+    [dartx.setEventListener](...args) {
+      return this.setEventListener.apply(this, args);
     }
     get [dartx.onAudioProcess]() {
       return web_audio.ScriptProcessorNode.audioProcessEvent.forTarget(this);
@@ -91139,6 +93028,7 @@
   });
   web_audio.ScriptProcessorNode.audioProcessEvent = dart.const(new (EventStreamProviderOfAudioProcessingEvent())('audioprocess'));
   dart.registerExtension(dart.global.ScriptProcessorNode, web_audio.ScriptProcessorNode);
+  dart.registerExtension(dart.global.JavaScriptAudioNode, web_audio.ScriptProcessorNode);
   dart.defineExtensionNames([
     'curve',
     'oversample'
@@ -91354,323 +93244,323 @@
     get [dartx.drawingBufferWidth]() {
       return this.drawingBufferWidth;
     }
-    [dartx.activeTexture](texture) {
-      return this.activeTexture(texture);
+    [dartx.activeTexture](...args) {
+      return this.activeTexture.apply(this, args);
     }
-    [dartx.attachShader](program, shader) {
-      return this.attachShader(program, shader);
+    [dartx.attachShader](...args) {
+      return this.attachShader.apply(this, args);
     }
-    [dartx.bindAttribLocation](program, index, name) {
-      return this.bindAttribLocation(program, index, name);
+    [dartx.bindAttribLocation](...args) {
+      return this.bindAttribLocation.apply(this, args);
     }
-    [dartx.bindBuffer](target, buffer) {
-      return this.bindBuffer(target, buffer);
+    [dartx.bindBuffer](...args) {
+      return this.bindBuffer.apply(this, args);
     }
-    [dartx.bindFramebuffer](target, framebuffer) {
-      return this.bindFramebuffer(target, framebuffer);
+    [dartx.bindFramebuffer](...args) {
+      return this.bindFramebuffer.apply(this, args);
     }
-    [dartx.bindRenderbuffer](target, renderbuffer) {
-      return this.bindRenderbuffer(target, renderbuffer);
+    [dartx.bindRenderbuffer](...args) {
+      return this.bindRenderbuffer.apply(this, args);
     }
-    [dartx.bindTexture](target, texture) {
-      return this.bindTexture(target, texture);
+    [dartx.bindTexture](...args) {
+      return this.bindTexture.apply(this, args);
     }
-    [dartx.blendColor](red, green, blue, alpha) {
-      return this.blendColor(red, green, blue, alpha);
+    [dartx.blendColor](...args) {
+      return this.blendColor.apply(this, args);
     }
-    [dartx.blendEquation](mode) {
-      return this.blendEquation(mode);
+    [dartx.blendEquation](...args) {
+      return this.blendEquation.apply(this, args);
     }
-    [dartx.blendEquationSeparate](modeRGB, modeAlpha) {
-      return this.blendEquationSeparate(modeRGB, modeAlpha);
+    [dartx.blendEquationSeparate](...args) {
+      return this.blendEquationSeparate.apply(this, args);
     }
-    [dartx.blendFunc](sfactor, dfactor) {
-      return this.blendFunc(sfactor, dfactor);
+    [dartx.blendFunc](...args) {
+      return this.blendFunc.apply(this, args);
     }
-    [dartx.blendFuncSeparate](srcRGB, dstRGB, srcAlpha, dstAlpha) {
-      return this.blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
+    [dartx.blendFuncSeparate](...args) {
+      return this.blendFuncSeparate.apply(this, args);
     }
-    [dartx.bufferByteData](target, data, usage) {
-      return this.bufferData(target, data, usage);
+    [dartx.bufferByteData](...args) {
+      return this.bufferData.apply(this, args);
     }
-    [dartx.bufferData](target, data_OR_size, usage) {
-      return this.bufferData(target, data_OR_size, usage);
+    [dartx.bufferData](...args) {
+      return this.bufferData.apply(this, args);
     }
-    [dartx.bufferDataTyped](target, data, usage) {
-      return this.bufferData(target, data, usage);
+    [dartx.bufferDataTyped](...args) {
+      return this.bufferData.apply(this, args);
     }
-    [dartx.bufferSubByteData](target, offset, data) {
-      return this.bufferSubData(target, offset, data);
+    [dartx.bufferSubByteData](...args) {
+      return this.bufferSubData.apply(this, args);
     }
-    [dartx.bufferSubData](target, offset, data) {
-      return this.bufferSubData(target, offset, data);
+    [dartx.bufferSubData](...args) {
+      return this.bufferSubData.apply(this, args);
     }
-    [dartx.bufferSubDataTyped](target, offset, data) {
-      return this.bufferSubData(target, offset, data);
+    [dartx.bufferSubDataTyped](...args) {
+      return this.bufferSubData.apply(this, args);
     }
-    [dartx.checkFramebufferStatus](target) {
-      return this.checkFramebufferStatus(target);
+    [dartx.checkFramebufferStatus](...args) {
+      return this.checkFramebufferStatus.apply(this, args);
     }
-    [dartx.clear](mask) {
-      return this.clear(mask);
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.clearColor](red, green, blue, alpha) {
-      return this.clearColor(red, green, blue, alpha);
+    [dartx.clearColor](...args) {
+      return this.clearColor.apply(this, args);
     }
-    [dartx.clearDepth](depth) {
-      return this.clearDepth(depth);
+    [dartx.clearDepth](...args) {
+      return this.clearDepth.apply(this, args);
     }
-    [dartx.clearStencil](s) {
-      return this.clearStencil(s);
+    [dartx.clearStencil](...args) {
+      return this.clearStencil.apply(this, args);
     }
-    [dartx.colorMask](red, green, blue, alpha) {
-      return this.colorMask(red, green, blue, alpha);
+    [dartx.colorMask](...args) {
+      return this.colorMask.apply(this, args);
     }
-    [dartx.compileShader](shader) {
-      return this.compileShader(shader);
+    [dartx.compileShader](...args) {
+      return this.compileShader.apply(this, args);
     }
-    [dartx.compressedTexImage2D](target, level, internalformat, width, height, border, data) {
-      return this.compressedTexImage2D(target, level, internalformat, width, height, border, data);
+    [dartx.compressedTexImage2D](...args) {
+      return this.compressedTexImage2D.apply(this, args);
     }
-    [dartx.compressedTexSubImage2D](target, level, xoffset, yoffset, width, height, format, data) {
-      return this.compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, data);
+    [dartx.compressedTexSubImage2D](...args) {
+      return this.compressedTexSubImage2D.apply(this, args);
     }
-    [dartx.copyTexImage2D](target, level, internalformat, x, y, width, height, border) {
-      return this.copyTexImage2D(target, level, internalformat, x, y, width, height, border);
+    [dartx.copyTexImage2D](...args) {
+      return this.copyTexImage2D.apply(this, args);
     }
-    [dartx.copyTexSubImage2D](target, level, xoffset, yoffset, x, y, width, height) {
-      return this.copyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
+    [dartx.copyTexSubImage2D](...args) {
+      return this.copyTexSubImage2D.apply(this, args);
     }
-    [dartx.createBuffer]() {
-      return this.createBuffer();
+    [dartx.createBuffer](...args) {
+      return this.createBuffer.apply(this, args);
     }
-    [dartx.createFramebuffer]() {
-      return this.createFramebuffer();
+    [dartx.createFramebuffer](...args) {
+      return this.createFramebuffer.apply(this, args);
     }
-    [dartx.createProgram]() {
-      return this.createProgram();
+    [dartx.createProgram](...args) {
+      return this.createProgram.apply(this, args);
     }
-    [dartx.createRenderbuffer]() {
-      return this.createRenderbuffer();
+    [dartx.createRenderbuffer](...args) {
+      return this.createRenderbuffer.apply(this, args);
     }
-    [dartx.createShader](type) {
-      return this.createShader(type);
+    [dartx.createShader](...args) {
+      return this.createShader.apply(this, args);
     }
-    [dartx.createTexture]() {
-      return this.createTexture();
+    [dartx.createTexture](...args) {
+      return this.createTexture.apply(this, args);
     }
-    [dartx.cullFace](mode) {
-      return this.cullFace(mode);
+    [dartx.cullFace](...args) {
+      return this.cullFace.apply(this, args);
     }
-    [dartx.deleteBuffer](buffer) {
-      return this.deleteBuffer(buffer);
+    [dartx.deleteBuffer](...args) {
+      return this.deleteBuffer.apply(this, args);
     }
-    [dartx.deleteFramebuffer](framebuffer) {
-      return this.deleteFramebuffer(framebuffer);
+    [dartx.deleteFramebuffer](...args) {
+      return this.deleteFramebuffer.apply(this, args);
     }
-    [dartx.deleteProgram](program) {
-      return this.deleteProgram(program);
+    [dartx.deleteProgram](...args) {
+      return this.deleteProgram.apply(this, args);
     }
-    [dartx.deleteRenderbuffer](renderbuffer) {
-      return this.deleteRenderbuffer(renderbuffer);
+    [dartx.deleteRenderbuffer](...args) {
+      return this.deleteRenderbuffer.apply(this, args);
     }
-    [dartx.deleteShader](shader) {
-      return this.deleteShader(shader);
+    [dartx.deleteShader](...args) {
+      return this.deleteShader.apply(this, args);
     }
-    [dartx.deleteTexture](texture) {
-      return this.deleteTexture(texture);
+    [dartx.deleteTexture](...args) {
+      return this.deleteTexture.apply(this, args);
     }
-    [dartx.depthFunc](func) {
-      return this.depthFunc(func);
+    [dartx.depthFunc](...args) {
+      return this.depthFunc.apply(this, args);
     }
-    [dartx.depthMask](flag) {
-      return this.depthMask(flag);
+    [dartx.depthMask](...args) {
+      return this.depthMask.apply(this, args);
     }
-    [dartx.depthRange](zNear, zFar) {
-      return this.depthRange(zNear, zFar);
+    [dartx.depthRange](...args) {
+      return this.depthRange.apply(this, args);
     }
-    [dartx.detachShader](program, shader) {
-      return this.detachShader(program, shader);
+    [dartx.detachShader](...args) {
+      return this.detachShader.apply(this, args);
     }
-    [dartx.disable](cap) {
-      return this.disable(cap);
+    [dartx.disable](...args) {
+      return this.disable.apply(this, args);
     }
-    [dartx.disableVertexAttribArray](index) {
-      return this.disableVertexAttribArray(index);
+    [dartx.disableVertexAttribArray](...args) {
+      return this.disableVertexAttribArray.apply(this, args);
     }
-    [dartx.drawArrays](mode, first, count) {
-      return this.drawArrays(mode, first, count);
+    [dartx.drawArrays](...args) {
+      return this.drawArrays.apply(this, args);
     }
-    [dartx.drawElements](mode, count, type, offset) {
-      return this.drawElements(mode, count, type, offset);
+    [dartx.drawElements](...args) {
+      return this.drawElements.apply(this, args);
     }
-    [dartx.enable](cap) {
-      return this.enable(cap);
+    [dartx.enable](...args) {
+      return this.enable.apply(this, args);
     }
-    [dartx.enableVertexAttribArray](index) {
-      return this.enableVertexAttribArray(index);
+    [dartx.enableVertexAttribArray](...args) {
+      return this.enableVertexAttribArray.apply(this, args);
     }
-    [dartx.finish]() {
-      return this.finish();
+    [dartx.finish](...args) {
+      return this.finish.apply(this, args);
     }
-    [dartx.flush]() {
-      return this.flush();
+    [dartx.flush](...args) {
+      return this.flush.apply(this, args);
     }
-    [dartx.framebufferRenderbuffer](target, attachment, renderbuffertarget, renderbuffer) {
-      return this.framebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
+    [dartx.framebufferRenderbuffer](...args) {
+      return this.framebufferRenderbuffer.apply(this, args);
     }
-    [dartx.framebufferTexture2D](target, attachment, textarget, texture, level) {
-      return this.framebufferTexture2D(target, attachment, textarget, texture, level);
+    [dartx.framebufferTexture2D](...args) {
+      return this.framebufferTexture2D.apply(this, args);
     }
-    [dartx.frontFace](mode) {
-      return this.frontFace(mode);
+    [dartx.frontFace](...args) {
+      return this.frontFace.apply(this, args);
     }
-    [dartx.generateMipmap](target) {
-      return this.generateMipmap(target);
+    [dartx.generateMipmap](...args) {
+      return this.generateMipmap.apply(this, args);
     }
-    [dartx.getActiveAttrib](program, index) {
-      return this.getActiveAttrib(program, index);
+    [dartx.getActiveAttrib](...args) {
+      return this.getActiveAttrib.apply(this, args);
     }
-    [dartx.getActiveUniform](program, index) {
-      return this.getActiveUniform(program, index);
+    [dartx.getActiveUniform](...args) {
+      return this.getActiveUniform.apply(this, args);
     }
-    [dartx.getAttachedShaders](program) {
-      return this.getAttachedShaders(program);
+    [dartx.getAttachedShaders](...args) {
+      return this.getAttachedShaders.apply(this, args);
     }
-    [dartx.getAttribLocation](program, name) {
-      return this.getAttribLocation(program, name);
+    [dartx.getAttribLocation](...args) {
+      return this.getAttribLocation.apply(this, args);
     }
-    [dartx.getBufferParameter](target, pname) {
-      return this.getBufferParameter(target, pname);
+    [dartx.getBufferParameter](...args) {
+      return this.getBufferParameter.apply(this, args);
     }
     [dartx.getContextAttributes]() {
       return web_gl.ContextAttributes._check(html_common.convertNativeToDart_ContextAttributes(this[_getContextAttributes_1$]()));
     }
-    [_getContextAttributes_1$]() {
-      return this.getContextAttributes();
+    [_getContextAttributes_1$](...args) {
+      return this.getContextAttributes.apply(this, args);
     }
-    [dartx.getError]() {
-      return this.getError();
+    [dartx.getError](...args) {
+      return this.getError.apply(this, args);
     }
-    [dartx.getExtension](name) {
-      return this.getExtension(name);
+    [dartx.getExtension](...args) {
+      return this.getExtension.apply(this, args);
     }
-    [dartx.getFramebufferAttachmentParameter](target, attachment, pname) {
-      return this.getFramebufferAttachmentParameter(target, attachment, pname);
+    [dartx.getFramebufferAttachmentParameter](...args) {
+      return this.getFramebufferAttachmentParameter.apply(this, args);
     }
-    [dartx.getParameter](pname) {
-      return this.getParameter(pname);
+    [dartx.getParameter](...args) {
+      return this.getParameter.apply(this, args);
     }
-    [dartx.getProgramInfoLog](program) {
-      return this.getProgramInfoLog(program);
+    [dartx.getProgramInfoLog](...args) {
+      return this.getProgramInfoLog.apply(this, args);
     }
-    [dartx.getProgramParameter](program, pname) {
-      return this.getProgramParameter(program, pname);
+    [dartx.getProgramParameter](...args) {
+      return this.getProgramParameter.apply(this, args);
     }
-    [dartx.getRenderbufferParameter](target, pname) {
-      return this.getRenderbufferParameter(target, pname);
+    [dartx.getRenderbufferParameter](...args) {
+      return this.getRenderbufferParameter.apply(this, args);
     }
-    [dartx.getShaderInfoLog](shader) {
-      return this.getShaderInfoLog(shader);
+    [dartx.getShaderInfoLog](...args) {
+      return this.getShaderInfoLog.apply(this, args);
     }
-    [dartx.getShaderParameter](shader, pname) {
-      return this.getShaderParameter(shader, pname);
+    [dartx.getShaderParameter](...args) {
+      return this.getShaderParameter.apply(this, args);
     }
-    [dartx.getShaderPrecisionFormat](shadertype, precisiontype) {
-      return this.getShaderPrecisionFormat(shadertype, precisiontype);
+    [dartx.getShaderPrecisionFormat](...args) {
+      return this.getShaderPrecisionFormat.apply(this, args);
     }
-    [dartx.getShaderSource](shader) {
-      return this.getShaderSource(shader);
+    [dartx.getShaderSource](...args) {
+      return this.getShaderSource.apply(this, args);
     }
-    [dartx.getSupportedExtensions]() {
-      return this.getSupportedExtensions();
+    [dartx.getSupportedExtensions](...args) {
+      return this.getSupportedExtensions.apply(this, args);
     }
-    [dartx.getTexParameter](target, pname) {
-      return this.getTexParameter(target, pname);
+    [dartx.getTexParameter](...args) {
+      return this.getTexParameter.apply(this, args);
     }
-    [dartx.getUniform](program, location) {
-      return this.getUniform(program, location);
+    [dartx.getUniform](...args) {
+      return this.getUniform.apply(this, args);
     }
-    [dartx.getUniformLocation](program, name) {
-      return this.getUniformLocation(program, name);
+    [dartx.getUniformLocation](...args) {
+      return this.getUniformLocation.apply(this, args);
     }
-    [dartx.getVertexAttrib](index, pname) {
-      return this.getVertexAttrib(index, pname);
+    [dartx.getVertexAttrib](...args) {
+      return this.getVertexAttrib.apply(this, args);
     }
-    [dartx.getVertexAttribOffset](index, pname) {
-      return this.getVertexAttribOffset(index, pname);
+    [dartx.getVertexAttribOffset](...args) {
+      return this.getVertexAttribOffset.apply(this, args);
     }
-    [dartx.hint](target, mode) {
-      return this.hint(target, mode);
+    [dartx.hint](...args) {
+      return this.hint.apply(this, args);
     }
-    [dartx.isBuffer](buffer) {
-      return this.isBuffer(buffer);
+    [dartx.isBuffer](...args) {
+      return this.isBuffer.apply(this, args);
     }
-    [dartx.isContextLost]() {
-      return this.isContextLost();
+    [dartx.isContextLost](...args) {
+      return this.isContextLost.apply(this, args);
     }
-    [dartx.isEnabled](cap) {
-      return this.isEnabled(cap);
+    [dartx.isEnabled](...args) {
+      return this.isEnabled.apply(this, args);
     }
-    [dartx.isFramebuffer](framebuffer) {
-      return this.isFramebuffer(framebuffer);
+    [dartx.isFramebuffer](...args) {
+      return this.isFramebuffer.apply(this, args);
     }
-    [dartx.isProgram](program) {
-      return this.isProgram(program);
+    [dartx.isProgram](...args) {
+      return this.isProgram.apply(this, args);
     }
-    [dartx.isRenderbuffer](renderbuffer) {
-      return this.isRenderbuffer(renderbuffer);
+    [dartx.isRenderbuffer](...args) {
+      return this.isRenderbuffer.apply(this, args);
     }
-    [dartx.isShader](shader) {
-      return this.isShader(shader);
+    [dartx.isShader](...args) {
+      return this.isShader.apply(this, args);
     }
-    [dartx.isTexture](texture) {
-      return this.isTexture(texture);
+    [dartx.isTexture](...args) {
+      return this.isTexture.apply(this, args);
     }
-    [dartx.lineWidth](width) {
-      return this.lineWidth(width);
+    [dartx.lineWidth](...args) {
+      return this.lineWidth.apply(this, args);
     }
-    [dartx.linkProgram](program) {
-      return this.linkProgram(program);
+    [dartx.linkProgram](...args) {
+      return this.linkProgram.apply(this, args);
     }
-    [dartx.pixelStorei](pname, param) {
-      return this.pixelStorei(pname, param);
+    [dartx.pixelStorei](...args) {
+      return this.pixelStorei.apply(this, args);
     }
-    [dartx.polygonOffset](factor, units) {
-      return this.polygonOffset(factor, units);
+    [dartx.polygonOffset](...args) {
+      return this.polygonOffset.apply(this, args);
     }
-    [dartx.readPixels](x, y, width, height, format, type, pixels) {
-      return this.readPixels(x, y, width, height, format, type, pixels);
+    [dartx.readPixels](...args) {
+      return this.readPixels.apply(this, args);
     }
-    [dartx.renderbufferStorage](target, internalformat, width, height) {
-      return this.renderbufferStorage(target, internalformat, width, height);
+    [dartx.renderbufferStorage](...args) {
+      return this.renderbufferStorage.apply(this, args);
     }
-    [dartx.sampleCoverage](value, invert) {
-      return this.sampleCoverage(value, invert);
+    [dartx.sampleCoverage](...args) {
+      return this.sampleCoverage.apply(this, args);
     }
-    [dartx.scissor](x, y, width, height) {
-      return this.scissor(x, y, width, height);
+    [dartx.scissor](...args) {
+      return this.scissor.apply(this, args);
     }
-    [dartx.shaderSource](shader, string) {
-      return this.shaderSource(shader, string);
+    [dartx.shaderSource](...args) {
+      return this.shaderSource.apply(this, args);
     }
-    [dartx.stencilFunc](func, ref, mask) {
-      return this.stencilFunc(func, ref, mask);
+    [dartx.stencilFunc](...args) {
+      return this.stencilFunc.apply(this, args);
     }
-    [dartx.stencilFuncSeparate](face, func, ref, mask) {
-      return this.stencilFuncSeparate(face, func, ref, mask);
+    [dartx.stencilFuncSeparate](...args) {
+      return this.stencilFuncSeparate.apply(this, args);
     }
-    [dartx.stencilMask](mask) {
-      return this.stencilMask(mask);
+    [dartx.stencilMask](...args) {
+      return this.stencilMask.apply(this, args);
     }
-    [dartx.stencilMaskSeparate](face, mask) {
-      return this.stencilMaskSeparate(face, mask);
+    [dartx.stencilMaskSeparate](...args) {
+      return this.stencilMaskSeparate.apply(this, args);
     }
-    [dartx.stencilOp](fail, zfail, zpass) {
-      return this.stencilOp(fail, zfail, zpass);
+    [dartx.stencilOp](...args) {
+      return this.stencilOp.apply(this, args);
     }
-    [dartx.stencilOpSeparate](face, fail, zfail, zpass) {
-      return this.stencilOpSeparate(face, fail, zfail, zpass);
+    [dartx.stencilOpSeparate](...args) {
+      return this.stencilOpSeparate.apply(this, args);
     }
     [dartx.texImage2D](target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video, format, type, pixels) {
       if (format === void 0) format = null;
@@ -91699,43 +93589,43 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_texImage2D_1](target, level, internalformat, width, height, border, format, type, pixels) {
-      return this.texImage2D(target, level, internalformat, width, height, border, format, type, pixels);
+    [_texImage2D_1](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [_texImage2D_2](target, level, internalformat, format, type, pixels) {
-      return this.texImage2D(target, level, internalformat, format, type, pixels);
+    [_texImage2D_2](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [_texImage2D_3](target, level, internalformat, format, type, image) {
-      return this.texImage2D(target, level, internalformat, format, type, image);
+    [_texImage2D_3](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [_texImage2D_4](target, level, internalformat, format, type, canvas) {
-      return this.texImage2D(target, level, internalformat, format, type, canvas);
+    [_texImage2D_4](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [_texImage2D_5](target, level, internalformat, format, type, video) {
-      return this.texImage2D(target, level, internalformat, format, type, video);
+    [_texImage2D_5](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [dartx.texImage2DCanvas](target, level, internalformat, format, type, canvas) {
-      return this.texImage2D(target, level, internalformat, format, type, canvas);
+    [dartx.texImage2DCanvas](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [dartx.texImage2DImage](target, level, internalformat, format, type, image) {
-      return this.texImage2D(target, level, internalformat, format, type, image);
+    [dartx.texImage2DImage](...args) {
+      return this.texImage2D.apply(this, args);
     }
     [dartx.texImage2DImageData](target, level, internalformat, format, type, pixels) {
       let pixels_1 = html_common.convertDartToNative_ImageData(pixels);
       this[_texImage2DImageData_1](target, level, internalformat, format, type, pixels_1);
       return;
     }
-    [_texImage2DImageData_1](target, level, internalformat, format, type, pixels) {
-      return this.texImage2D(target, level, internalformat, format, type, pixels);
+    [_texImage2DImageData_1](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [dartx.texImage2DVideo](target, level, internalformat, format, type, video) {
-      return this.texImage2D(target, level, internalformat, format, type, video);
+    [dartx.texImage2DVideo](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [dartx.texParameterf](target, pname, param) {
-      return this.texParameterf(target, pname, param);
+    [dartx.texParameterf](...args) {
+      return this.texParameterf.apply(this, args);
     }
-    [dartx.texParameteri](target, pname, param) {
-      return this.texParameteri(target, pname, param);
+    [dartx.texParameteri](...args) {
+      return this.texParameteri.apply(this, args);
     }
     [dartx.texSubImage2D](target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, type, pixels) {
       if (type === void 0) type = null;
@@ -91763,142 +93653,142 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_texSubImage2D_1](target, level, xoffset, yoffset, width, height, format, type, pixels) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
+    [_texSubImage2D_1](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [_texSubImage2D_2](target, level, xoffset, yoffset, format, type, pixels) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, pixels);
+    [_texSubImage2D_2](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [_texSubImage2D_3](target, level, xoffset, yoffset, format, type, image) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, image);
+    [_texSubImage2D_3](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [_texSubImage2D_4](target, level, xoffset, yoffset, format, type, canvas) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, canvas);
+    [_texSubImage2D_4](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [_texSubImage2D_5](target, level, xoffset, yoffset, format, type, video) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, video);
+    [_texSubImage2D_5](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [dartx.texSubImage2DCanvas](target, level, xoffset, yoffset, format, type, canvas) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, canvas);
+    [dartx.texSubImage2DCanvas](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [dartx.texSubImage2DImage](target, level, xoffset, yoffset, format, type, image) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, image);
+    [dartx.texSubImage2DImage](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
     [dartx.texSubImage2DImageData](target, level, xoffset, yoffset, format, type, pixels) {
       let pixels_1 = html_common.convertDartToNative_ImageData(pixels);
       this[_texSubImage2DImageData_1](target, level, xoffset, yoffset, format, type, pixels_1);
       return;
     }
-    [_texSubImage2DImageData_1](target, level, xoffset, yoffset, format, type, pixels) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, pixels);
+    [_texSubImage2DImageData_1](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [dartx.texSubImage2DVideo](target, level, xoffset, yoffset, format, type, video) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, video);
+    [dartx.texSubImage2DVideo](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [dartx.uniform1f](location, x) {
-      return this.uniform1f(location, x);
+    [dartx.uniform1f](...args) {
+      return this.uniform1f.apply(this, args);
     }
-    [dartx.uniform1fv](location, v) {
-      return this.uniform1fv(location, v);
+    [dartx.uniform1fv](...args) {
+      return this.uniform1fv.apply(this, args);
     }
-    [dartx.uniform1i](location, x) {
-      return this.uniform1i(location, x);
+    [dartx.uniform1i](...args) {
+      return this.uniform1i.apply(this, args);
     }
-    [dartx.uniform1iv](location, v) {
-      return this.uniform1iv(location, v);
+    [dartx.uniform1iv](...args) {
+      return this.uniform1iv.apply(this, args);
     }
-    [dartx.uniform2f](location, x, y) {
-      return this.uniform2f(location, x, y);
+    [dartx.uniform2f](...args) {
+      return this.uniform2f.apply(this, args);
     }
-    [dartx.uniform2fv](location, v) {
-      return this.uniform2fv(location, v);
+    [dartx.uniform2fv](...args) {
+      return this.uniform2fv.apply(this, args);
     }
-    [dartx.uniform2i](location, x, y) {
-      return this.uniform2i(location, x, y);
+    [dartx.uniform2i](...args) {
+      return this.uniform2i.apply(this, args);
     }
-    [dartx.uniform2iv](location, v) {
-      return this.uniform2iv(location, v);
+    [dartx.uniform2iv](...args) {
+      return this.uniform2iv.apply(this, args);
     }
-    [dartx.uniform3f](location, x, y, z) {
-      return this.uniform3f(location, x, y, z);
+    [dartx.uniform3f](...args) {
+      return this.uniform3f.apply(this, args);
     }
-    [dartx.uniform3fv](location, v) {
-      return this.uniform3fv(location, v);
+    [dartx.uniform3fv](...args) {
+      return this.uniform3fv.apply(this, args);
     }
-    [dartx.uniform3i](location, x, y, z) {
-      return this.uniform3i(location, x, y, z);
+    [dartx.uniform3i](...args) {
+      return this.uniform3i.apply(this, args);
     }
-    [dartx.uniform3iv](location, v) {
-      return this.uniform3iv(location, v);
+    [dartx.uniform3iv](...args) {
+      return this.uniform3iv.apply(this, args);
     }
-    [dartx.uniform4f](location, x, y, z, w) {
-      return this.uniform4f(location, x, y, z, w);
+    [dartx.uniform4f](...args) {
+      return this.uniform4f.apply(this, args);
     }
-    [dartx.uniform4fv](location, v) {
-      return this.uniform4fv(location, v);
+    [dartx.uniform4fv](...args) {
+      return this.uniform4fv.apply(this, args);
     }
-    [dartx.uniform4i](location, x, y, z, w) {
-      return this.uniform4i(location, x, y, z, w);
+    [dartx.uniform4i](...args) {
+      return this.uniform4i.apply(this, args);
     }
-    [dartx.uniform4iv](location, v) {
-      return this.uniform4iv(location, v);
+    [dartx.uniform4iv](...args) {
+      return this.uniform4iv.apply(this, args);
     }
-    [dartx.uniformMatrix2fv](location, transpose, array) {
-      return this.uniformMatrix2fv(location, transpose, array);
+    [dartx.uniformMatrix2fv](...args) {
+      return this.uniformMatrix2fv.apply(this, args);
     }
-    [dartx.uniformMatrix3fv](location, transpose, array) {
-      return this.uniformMatrix3fv(location, transpose, array);
+    [dartx.uniformMatrix3fv](...args) {
+      return this.uniformMatrix3fv.apply(this, args);
     }
-    [dartx.uniformMatrix4fv](location, transpose, array) {
-      return this.uniformMatrix4fv(location, transpose, array);
+    [dartx.uniformMatrix4fv](...args) {
+      return this.uniformMatrix4fv.apply(this, args);
     }
-    [dartx.useProgram](program) {
-      return this.useProgram(program);
+    [dartx.useProgram](...args) {
+      return this.useProgram.apply(this, args);
     }
-    [dartx.validateProgram](program) {
-      return this.validateProgram(program);
+    [dartx.validateProgram](...args) {
+      return this.validateProgram.apply(this, args);
     }
-    [dartx.vertexAttrib1f](indx, x) {
-      return this.vertexAttrib1f(indx, x);
+    [dartx.vertexAttrib1f](...args) {
+      return this.vertexAttrib1f.apply(this, args);
     }
-    [dartx.vertexAttrib1fv](indx, values) {
-      return this.vertexAttrib1fv(indx, values);
+    [dartx.vertexAttrib1fv](...args) {
+      return this.vertexAttrib1fv.apply(this, args);
     }
-    [dartx.vertexAttrib2f](indx, x, y) {
-      return this.vertexAttrib2f(indx, x, y);
+    [dartx.vertexAttrib2f](...args) {
+      return this.vertexAttrib2f.apply(this, args);
     }
-    [dartx.vertexAttrib2fv](indx, values) {
-      return this.vertexAttrib2fv(indx, values);
+    [dartx.vertexAttrib2fv](...args) {
+      return this.vertexAttrib2fv.apply(this, args);
     }
-    [dartx.vertexAttrib3f](indx, x, y, z) {
-      return this.vertexAttrib3f(indx, x, y, z);
+    [dartx.vertexAttrib3f](...args) {
+      return this.vertexAttrib3f.apply(this, args);
     }
-    [dartx.vertexAttrib3fv](indx, values) {
-      return this.vertexAttrib3fv(indx, values);
+    [dartx.vertexAttrib3fv](...args) {
+      return this.vertexAttrib3fv.apply(this, args);
     }
-    [dartx.vertexAttrib4f](indx, x, y, z, w) {
-      return this.vertexAttrib4f(indx, x, y, z, w);
+    [dartx.vertexAttrib4f](...args) {
+      return this.vertexAttrib4f.apply(this, args);
     }
-    [dartx.vertexAttrib4fv](indx, values) {
-      return this.vertexAttrib4fv(indx, values);
+    [dartx.vertexAttrib4fv](...args) {
+      return this.vertexAttrib4fv.apply(this, args);
     }
-    [dartx.vertexAttribPointer](indx, size, type, normalized, stride, offset) {
-      return this.vertexAttribPointer(indx, size, type, normalized, stride, offset);
+    [dartx.vertexAttribPointer](...args) {
+      return this.vertexAttribPointer.apply(this, args);
     }
-    [dartx.viewport](x, y, width, height) {
-      return this.viewport(x, y, width, height);
+    [dartx.viewport](...args) {
+      return this.viewport.apply(this, args);
     }
-    [dartx.texImage2DUntyped](targetTexture, levelOfDetail, internalFormat, format, type, data) {
-      return this.texImage2D(targetTexture, levelOfDetail, internalFormat, format, type, data);
+    [dartx.texImage2DUntyped](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [dartx.texImage2DTyped](targetTexture, levelOfDetail, internalFormat, width, height, border, format, type, data) {
-      return this.texImage2D(targetTexture, levelOfDetail, internalFormat, width, height, border, format, type, data);
+    [dartx.texImage2DTyped](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [dartx.texSubImage2DUntyped](targetTexture, levelOfDetail, xOffset, yOffset, format, type, data) {
-      return this.texSubImage2D(targetTexture, levelOfDetail, xOffset, yOffset, format, type, data);
+    [dartx.texSubImage2DUntyped](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [dartx.texSubImage2DTyped](targetTexture, levelOfDetail, xOffset, yOffset, width, height, border, format, type, data) {
-      return this.texSubImage2D(targetTexture, levelOfDetail, xOffset, yOffset, width, height, border, format, type, data);
+    [dartx.texSubImage2DTyped](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
   };
   web_gl.RenderingContext[dart.implements] = () => [html$.CanvasRenderingContext];
@@ -93019,14 +94909,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.drawArraysInstancedAngle](mode, first, count, primcount) {
-      return this.drawArraysInstancedANGLE(mode, first, count, primcount);
+    [dartx.drawArraysInstancedAngle](...args) {
+      return this.drawArraysInstancedANGLE.apply(this, args);
     }
-    [dartx.drawElementsInstancedAngle](mode, count, type, offset, primcount) {
-      return this.drawElementsInstancedANGLE(mode, count, type, offset, primcount);
+    [dartx.drawElementsInstancedAngle](...args) {
+      return this.drawElementsInstancedANGLE.apply(this, args);
     }
-    [dartx.vertexAttribDivisorAngle](index, divisor) {
-      return this.vertexAttribDivisorANGLE(index, divisor);
+    [dartx.vertexAttribDivisorAngle](...args) {
+      return this.vertexAttribDivisorANGLE.apply(this, args);
     }
   };
   dart.setSignature(web_gl.AngleInstancedArrays, {
@@ -93222,8 +95112,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getTranslatedShaderSource](shader) {
-      return this.getTranslatedShaderSource(shader);
+    [dartx.getTranslatedShaderSource](...args) {
+      return this.getTranslatedShaderSource.apply(this, args);
     }
   };
   dart.setSignature(web_gl.DebugShaders, {
@@ -93249,8 +95139,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.drawBuffersWebgl](buffers) {
-      return this.drawBuffersWEBGL(buffers);
+    [dartx.drawBuffersWebgl](...args) {
+      return this.drawBuffersWEBGL.apply(this, args);
     }
   };
   dart.setSignature(web_gl.DrawBuffers, {
@@ -93393,11 +95283,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.loseContext]() {
-      return this.loseContext();
+    [dartx.loseContext](...args) {
+      return this.loseContext.apply(this, args);
     }
-    [dartx.restoreContext]() {
-      return this.restoreContext();
+    [dartx.restoreContext](...args) {
+      return this.restoreContext.apply(this, args);
     }
   };
   dart.setSignature(web_gl.LoseContext, {
@@ -93408,6 +95298,7 @@
     })
   });
   dart.registerExtension(dart.global.WebGLLoseContext, web_gl.LoseContext);
+  dart.registerExtension(dart.global.WebGLExtensionLoseContext, web_gl.LoseContext);
   web_gl.OesElementIndexUint = class OesElementIndexUint extends _interceptors.Interceptor {
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
@@ -93465,17 +95356,17 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.bindVertexArray](arrayObject) {
-      return this.bindVertexArrayOES(arrayObject);
+    [dartx.bindVertexArray](...args) {
+      return this.bindVertexArrayOES.apply(this, args);
     }
-    [dartx.createVertexArray]() {
-      return this.createVertexArrayOES();
+    [dartx.createVertexArray](...args) {
+      return this.createVertexArrayOES.apply(this, args);
     }
-    [dartx.deleteVertexArray](arrayObject) {
-      return this.deleteVertexArrayOES(arrayObject);
+    [dartx.deleteVertexArray](...args) {
+      return this.deleteVertexArrayOES.apply(this, args);
     }
-    [dartx.isVertexArray](arrayObject) {
-      return this.isVertexArrayOES(arrayObject);
+    [dartx.isVertexArray](...args) {
+      return this.isVertexArrayOES.apply(this, args);
     }
   };
   dart.setSignature(web_gl.OesVertexArrayObject, {
@@ -93600,14 +95491,14 @@
     get [dartx.version]() {
       return this.version;
     }
-    [dartx.changeVersion](oldVersion, newVersion, callback, errorCallback, successCallback) {
-      return this.changeVersion(oldVersion, newVersion, callback, errorCallback, successCallback);
+    [dartx.changeVersion](...args) {
+      return this.changeVersion.apply(this, args);
     }
-    [dartx.readTransaction](callback, errorCallback, successCallback) {
-      return this.readTransaction(callback, errorCallback, successCallback);
+    [dartx.readTransaction](...args) {
+      return this.readTransaction.apply(this, args);
     }
-    [dartx.transaction](callback, errorCallback, successCallback) {
-      return this.transaction(callback, errorCallback, successCallback);
+    [dartx.transaction](...args) {
+      return this.transaction.apply(this, args);
     }
   };
   dart.setSignature(web_sql.SqlDatabase, {
@@ -93693,8 +95584,8 @@
   const _item_1 = Symbol('_item_1');
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -93709,11 +95600,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.item](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -93742,13 +95633,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
     [dartx.item](index) {
       return html_common.convertNativeToDart_Dictionary(this[_item_1](index));
     }
-    [_item_1](index) {
-      return this.item(index);
+    [_item_1](...args) {
+      return this.item.apply(this, args);
     }
   };
   web_sql.SqlResultSetRowList[dart.implements] = () => [ListOfMap()];
@@ -93762,8 +95653,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.Map, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, core.Map]),
+      [dartx._get]: dart.definiteFunctionType(core.Map, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, core.Map]),
       [dartx.elementAt]: dart.definiteFunctionType(core.Map, [core.int]),
       [dartx.item]: dart.definiteFunctionType(core.Map, [core.int]),
       [_item_1]: dart.definiteFunctionType(dart.dynamic, [dart.dynamic])
@@ -93777,8 +95668,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.executeSql](sqlStatement, arguments$, callback, errorCallback) {
-      return this.executeSql(sqlStatement, arguments$, callback, errorCallback);
+    [dartx.executeSql](...args) {
+      return this.executeSql.apply(this, args);
     }
   };
   dart.setSignature(web_sql.SqlTransaction, {
@@ -93805,6 +95696,7 @@
     collection: collection,
     convert: convert,
     core: core,
+    developer: developer,
     isolate: isolate,
     js: js,
     js_util: js_util,
diff --git a/pkg/dev_compiler/lib/js/common/dart_sdk.js b/pkg/dev_compiler/lib/js/common/dart_sdk.js
index 8b9f7f9..e025ec5 100644
--- a/pkg/dev_compiler/lib/js/common/dart_sdk.js
+++ b/pkg/dev_compiler/lib/js/common/dart_sdk.js
@@ -17,6 +17,7 @@
   const collection = Object.create(null);
   const convert = Object.create(null);
   const core = Object.create(null);
+  const developer = Object.create(null);
   const isolate = Object.create(null);
   const js = Object.create(null);
   const js_util = Object.create(null);
@@ -48,12 +49,14 @@
   let ListOfNameValuePair = () => (ListOfNameValuePair = dart.constFn(core.List$(_debugger.NameValuePair)))();
   let JSArrayOfString = () => (JSArrayOfString = dart.constFn(_interceptors.JSArray$(core.String)))();
   let JSArrayOfJsonMLFormatter = () => (JSArrayOfJsonMLFormatter = dart.constFn(_interceptors.JSArray$(_debugger.JsonMLFormatter)))();
+  let JSIndexable = () => (JSIndexable = dart.constFn(_interceptors.JSIndexable$()))();
   let JSArray = () => (JSArray = dart.constFn(_interceptors.JSArray$()))();
   let JSMutableArray = () => (JSMutableArray = dart.constFn(_interceptors.JSMutableArray$()))();
   let JSFixedArray = () => (JSFixedArray = dart.constFn(_interceptors.JSFixedArray$()))();
   let JSExtendableArray = () => (JSExtendableArray = dart.constFn(_interceptors.JSExtendableArray$()))();
   let JSUnmodifiableArray = () => (JSUnmodifiableArray = dart.constFn(_interceptors.JSUnmodifiableArray$()))();
   let ArrayIterator = () => (ArrayIterator = dart.constFn(_interceptors.ArrayIterator$()))();
+  let JSIndexableOfString = () => (JSIndexableOfString = dart.constFn(_interceptors.JSIndexable$(core.String)))();
   let MatchToString = () => (MatchToString = dart.constFn(dart.functionType(core.String, [core.Match])))();
   let StringToString = () => (StringToString = dart.constFn(dart.functionType(core.String, [core.String])))();
   let ComparableOfnum = () => (ComparableOfnum = dart.constFn(core.Comparable$(core.num)))();
@@ -142,6 +145,7 @@
   let ListOfClassMirror = () => (ListOfClassMirror = dart.constFn(core.List$(mirrors.ClassMirror)))();
   let ListOfTypeVariableMirror = () => (ListOfTypeVariableMirror = dart.constFn(core.List$(mirrors.TypeVariableMirror)))();
   let MapOfSymbol$MethodMirror = () => (MapOfSymbol$MethodMirror = dart.constFn(core.Map$(core.Symbol, mirrors.MethodMirror)))();
+  let JSArrayOfType = () => (JSArrayOfType = dart.constFn(_interceptors.JSArray$(core.Type)))();
   let ListOfParameterMirror = () => (ListOfParameterMirror = dart.constFn(core.List$(mirrors.ParameterMirror)))();
   let ListOfFloat32x4 = () => (ListOfFloat32x4 = dart.constFn(core.List$(typed_data.Float32x4)))();
   let ListOfInt32x4 = () => (ListOfInt32x4 = dart.constFn(core.List$(typed_data.Int32x4)))();
@@ -373,6 +377,12 @@
   let MapOfString$String = () => (MapOfString$String = dart.constFn(core.Map$(core.String, core.String)))();
   let IterableOfString = () => (IterableOfString = dart.constFn(core.Iterable$(core.String)))();
   let MapOfString$dynamic = () => (MapOfString$dynamic = dart.constFn(core.Map$(core.String, dart.dynamic)))();
+  let MapOfString$ServiceExtensionHandler = () => (MapOfString$ServiceExtensionHandler = dart.constFn(core.Map$(core.String, developer.ServiceExtensionHandler)))();
+  let MapOfString$Metric = () => (MapOfString$Metric = dart.constFn(core.Map$(core.String, developer.Metric)))();
+  let ListOf_SyncBlock = () => (ListOf_SyncBlock = dart.constFn(core.List$(developer._SyncBlock)))();
+  let JSArrayOf_AsyncBlock = () => (JSArrayOf_AsyncBlock = dart.constFn(_interceptors.JSArray$(developer._AsyncBlock)))();
+  let ListOf_AsyncBlock = () => (ListOf_AsyncBlock = dart.constFn(core.List$(developer._AsyncBlock)))();
+  let CompleterOfUri = () => (CompleterOfUri = dart.constFn(async.Completer$(core.Uri)))();
   let FutureOfIsolate = () => (FutureOfIsolate = dart.constFn(async.Future$(isolate.Isolate)))();
   let JsArray = () => (JsArray = dart.constFn(js.JsArray$()))();
   let ExpandoOfFunction = () => (ExpandoOfFunction = dart.constFn(core.Expando$(core.Function)))();
@@ -532,9 +542,9 @@
   let ListOfTransform = () => (ListOfTransform = dart.constFn(core.List$(svg$.Transform)))();
   let CompleterOfAudioBuffer = () => (CompleterOfAudioBuffer = dart.constFn(async.Completer$(web_audio.AudioBuffer)))();
   let EventStreamProviderOfAudioProcessingEvent = () => (EventStreamProviderOfAudioProcessingEvent = dart.constFn(html$.EventStreamProvider$(web_audio.AudioProcessingEvent)))();
+  let dynamicTodynamic$ = () => (dynamicTodynamic$ = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic])))();
   let StringAndStringToint = () => (StringAndStringToint = dart.constFn(dart.definiteFunctionType(core.int, [core.String, core.String])))();
   let VoidTo_MethodStats = () => (VoidTo_MethodStats = dart.constFn(dart.definiteFunctionType(dart._MethodStats, [])))();
-  let dynamicTodynamic$ = () => (dynamicTodynamic$ = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic])))();
   let dynamicToString = () => (dynamicToString = dart.constFn(dart.definiteFunctionType(core.String, [dart.dynamic])))();
   let dynamicToListOfString = () => (dynamicToListOfString = dart.constFn(dart.definiteFunctionType(ListOfString(), [dart.dynamic])))();
   let dynamicToList = () => (dynamicToList = dart.constFn(dart.definiteFunctionType(core.List, [dart.dynamic])))();
@@ -613,10 +623,12 @@
   let TypeToTypeMirror = () => (TypeToTypeMirror = dart.constFn(dart.definiteFunctionType(mirrors.TypeMirror, [core.Type])))();
   let dynamicAndListTodynamic = () => (dynamicAndListTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic, core.List])))();
   let dynamicAndStringAndListTodynamic = () => (dynamicAndStringAndListTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic, core.String, core.List])))();
-  let dynamicToMap = () => (dynamicToMap = dart.constFn(dart.definiteFunctionType(core.Map, [dart.dynamic])))();
+  let SymbolTodynamic = () => (SymbolTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [core.Symbol])))();
+  let dynamicToSymbol = () => (dynamicToSymbol = dart.constFn(dart.definiteFunctionType(core.Symbol, [dart.dynamic])))();
+  let dynamicToMapOfSymbol$dynamic = () => (dynamicToMapOfSymbol$dynamic = dart.constFn(dart.definiteFunctionType(MapOfSymbol$dynamic(), [dart.dynamic])))();
   let TypeAndInvocationTodynamic = () => (TypeAndInvocationTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [core.Type, core.Invocation])))();
   let SymbolAnddynamicTovoid = () => (SymbolAnddynamicTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.Symbol, dart.dynamic])))();
-  let StringAnddynamicTovoid = () => (StringAnddynamicTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String, dart.dynamic])))();
+  let MapOfSymbol$dynamicTodynamic = () => (MapOfSymbol$dynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [MapOfSymbol$dynamic()])))();
   let dynamicToTypeMirror = () => (dynamicToTypeMirror = dart.constFn(dart.definiteFunctionType(mirrors.TypeMirror, [dart.dynamic])))();
   let dynamicAnddynamicAnddynamicTovoid = () => (dynamicAnddynamicAnddynamicTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [dart.dynamic, dart.dynamic, dart.dynamic])))();
   let ListToList = () => (ListToList = dart.constFn(dart.definiteFunctionType(core.List, [core.List])))();
@@ -674,9 +686,24 @@
   let ObjectToint = () => (ObjectToint = dart.constFn(dart.definiteFunctionType(core.int, [core.Object])))();
   let ObjectTovoid = () => (ObjectTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.Object])))();
   let StringAndStringTovoid$ = () => (StringAndStringTovoid$ = dart.constFn(dart.definiteFunctionType(dart.void, [core.String, core.String])))();
+  let StringAnddynamicTovoid = () => (StringAnddynamicTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String, dart.dynamic])))();
   let MapOfString$StringAndStringToMapOfString$String = () => (MapOfString$StringAndStringToMapOfString$String = dart.constFn(dart.definiteFunctionType(MapOfString$String(), [MapOfString$String(), core.String])))();
   let intAndintAndintTovoid = () => (intAndintAndintTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.int, core.int, core.int])))();
   let String__Tovoid = () => (String__Tovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String], [dart.dynamic])))();
+  let __Tobool = () => (__Tobool = dart.constFn(dart.definiteFunctionType(core.bool, [], {when: core.bool, message: core.String})))();
+  let String__Tovoid$ = () => (String__Tovoid$ = dart.constFn(dart.definiteFunctionType(dart.void, [core.String], {time: core.DateTime, sequenceNumber: core.int, level: core.int, name: core.String, zone: async.Zone, error: core.Object, stackTrace: core.StackTrace})))();
+  let StringAndServiceExtensionHandlerTovoid = () => (StringAndServiceExtensionHandlerTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String, developer.ServiceExtensionHandler])))();
+  let StringAndMapTovoid = () => (StringAndMapTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String, core.Map])))();
+  let StringToServiceExtensionHandler = () => (StringToServiceExtensionHandler = dart.constFn(dart.definiteFunctionType(developer.ServiceExtensionHandler, [core.String])))();
+  let StringAndServiceExtensionHandlerTodynamic = () => (StringAndServiceExtensionHandlerTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [core.String, developer.ServiceExtensionHandler])))();
+  let VoidToUserTag = () => (VoidToUserTag = dart.constFn(dart.definiteFunctionType(developer.UserTag, [])))();
+  let MapToString = () => (MapToString = dart.constFn(dart.definiteFunctionType(core.String, [core.Map])))();
+  let intAndintAndString__Tovoid = () => (intAndintAndString__Tovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.int, core.int, core.String, core.String, core.String, core.String])))();
+  let intAndintAndString__Tovoid$ = () => (intAndintAndString__Tovoid$ = dart.constFn(dart.definiteFunctionType(dart.void, [core.int, core.int, core.String, core.String, core.String])))();
+  let intAndStringAndString__Tovoid = () => (intAndStringAndString__Tovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.int, core.String, core.String, core.String])))();
+  let UriTovoid = () => (UriTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.Uri])))();
+  let SendPortTovoid = () => (SendPortTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [isolate.SendPort])))();
+  let SendPortAndboolTovoid = () => (SendPortAndboolTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [isolate.SendPort, core.bool])))();
   let ListToIsolate = () => (ListToIsolate = dart.constFn(dart.definiteFunctionType(isolate.Isolate, [core.List])))();
   let dynamicTo_DartObject = () => (dynamicTo_DartObject = dart.constFn(dart.definiteFunctionType(js._DartObject, [dart.dynamic])))();
   let dynamicToJsObject = () => (dynamicToJsObject = dart.constFn(dart.definiteFunctionType(js.JsObject, [dart.dynamic])))();
@@ -745,6 +772,7 @@
   let NodeAndNodeTovoid = () => (NodeAndNodeTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [html$.Node, html$.Node])))();
   let dynamicToImageData = () => (dynamicToImageData = dart.constFn(dart.definiteFunctionType(html$.ImageData, [dart.dynamic])))();
   let ImageDataTodynamic = () => (ImageDataTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [html$.ImageData])))();
+  let dynamicToMap = () => (dynamicToMap = dart.constFn(dart.definiteFunctionType(core.Map, [dart.dynamic])))();
   let Map__Todynamic = () => (Map__Todynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [core.Map], [dynamicTovoid()])))();
   let ListOfStringToList = () => (ListOfStringToList = dart.constFn(dart.definiteFunctionType(core.List, [ListOfString()])))();
   let dynamicToDateTime = () => (dynamicToDateTime = dart.constFn(dart.definiteFunctionType(core.DateTime, [dart.dynamic])))();
@@ -776,10 +804,10 @@
     return Mixin;
   };
   dart.getMixins = function(clazz) {
-    return clazz[dart._mixins];
+    return Object.hasOwnProperty.call(clazz, dart._mixins) ? clazz[dart._mixins] : null;
   };
   dart.getImplements = function(clazz) {
-    return clazz[dart.implements];
+    return Object.hasOwnProperty.call(clazz, dart.implements) ? clazz[dart.implements] : null;
   };
   dart.flattenFutures = function(builder) {
     function flatten(T) {
@@ -793,43 +821,48 @@
     }
     return flatten;
   };
-  dart.generic = function(typeConstructor) {
-    let length = typeConstructor.length;
-    if (length < 1) {
-      dart.throwInternalError('must have at least one generic type argument');
-    }
-    let resultMap = new Map();
-    function makeGenericType(...args) {
-      if (args.length != length && args.length != 0) {
-        dart.throwInternalError('requires ' + length + ' or 0 type arguments');
+  dart.generic = function(typeConstructor, setBaseClass) {
+    if (setBaseClass === void 0) setBaseClass = null;
+    return (() => {
+      let length = typeConstructor.length;
+      if (length < 1) {
+        dart.throwInternalError('must have at least one generic type argument');
       }
-      while (args.length < length)
-        args.push(dart.dynamic);
-      let value = resultMap;
-      for (let i = 0; i < length; i++) {
-        let arg = args[i];
-        if (arg == null) {
-          dart.throwInternalError('type arguments should not be null: ' + typeConstructor);
+      let resultMap = new Map();
+      function makeGenericType(...args) {
+        if (args.length != length && args.length != 0) {
+          dart.throwInternalError('requires ' + length + ' or 0 type arguments');
         }
-        let map = value;
-        value = map.get(arg);
-        if (value === void 0) {
-          if (i + 1 == length) {
-            value = typeConstructor.apply(null, args);
-            if (value) {
-              value[dart._typeArguments] = args;
-              value[dart._originalDeclaration] = makeGenericType;
-            }
-          } else {
-            value = new Map();
+        while (args.length < length)
+          args.push(dart.dynamic);
+        let value = resultMap;
+        for (let i = 0; i < length; i++) {
+          let arg = args[i];
+          if (arg == null) {
+            dart.throwInternalError('type arguments should not be null: ' + typeConstructor);
           }
-          map.set(arg, value);
+          let map = value;
+          value = map.get(arg);
+          if (value === void 0) {
+            if (i + 1 == length) {
+              value = typeConstructor.apply(null, args);
+              if (value) {
+                value[dart._typeArguments] = args;
+                value[dart._originalDeclaration] = makeGenericType;
+              }
+              map.set(arg, value);
+              if (setBaseClass) setBaseClass(value);
+            } else {
+              value = new Map();
+              map.set(arg, value);
+            }
+          }
         }
+        return value;
       }
-      return value;
-    }
-    makeGenericType[dart._genericTypeCtor] = typeConstructor;
-    return makeGenericType;
+      makeGenericType[dart._genericTypeCtor] = typeConstructor;
+      return makeGenericType;
+    })();
   };
   dart.getGenericClass = function(type) {
     return dart.safeGetOwnProperty(type, dart._originalDeclaration);
@@ -1032,7 +1065,6 @@
     let proto = type.prototype;
     for (let name of methodNames) {
       let method = dart.getOwnPropertyDescriptor(proto, name);
-      if (!method) continue;
       dart.defineProperty(proto, dart.getExtensionSymbol(name), method);
     }
     let originalSigFn = dart.getOwnPropertyDescriptor(type, dart._methodSig).get;
@@ -1056,8 +1088,10 @@
     derived.__proto__ = base;
   };
   dart.setExtensionBaseClass = function(derived, base) {
-    derived.prototype[dart._extensionType] = derived;
-    derived.prototype.__proto__ = base.prototype;
+    if (base) {
+      derived.prototype[dart._extensionType] = derived;
+      derived.prototype.__proto__ = base.prototype;
+    }
   };
   dart.callableClass = function(callableCtor, classExpr) {
     callableCtor.prototype = classExpr.prototype;
@@ -1069,6 +1103,15 @@
     ctor.prototype = clazz.prototype;
     dart.defineProperty(clazz, name, {value: ctor, configurable: true});
   };
+  dart.defineEnumValues = function(enumClass, names) {
+    let values = [];
+    for (var i = 0; i < names.length; i++) {
+      let value = dart.const(new enumClass(i));
+      values.push(value);
+      Object.defineProperty(enumClass, names[i], {value: value, configurable: true});
+    }
+    enumClass.values = dart.constList(values, enumClass);
+  };
   dart.fn = function(closure, t) {
     if (t == null) {
       t = dart.definiteFunctionType(dart.dynamic, Array(closure.length).fill(dart.dynamic), void 0);
@@ -1128,6 +1171,23 @@
     }
     return type[dart._typeObject] = new dart.WrappedType(type);
   };
+  dart.lazyJSType = function(getJSTypeCallback, name) {
+    let key = getJSTypeCallback.toString();
+    if (dart._lazyJSTypes.has(key)) {
+      return dart._lazyJSTypes.get(key);
+    }
+    let ret = new dart.LazyJSType(getJSTypeCallback, name);
+    dart._lazyJSTypes.set(key, ret);
+    return ret;
+  };
+  dart.lazyAnonymousJSType = function(name) {
+    if (dart._lazyJSTypes.has(name)) {
+      return dart._lazyJSTypes.get(name);
+    }
+    let ret = new dart.LazyJSType(null, name);
+    dart._lazyJSTypes.set(name, ret);
+    return ret;
+  };
   const _wrappedType = Symbol('_wrappedType');
   dart.unwrapType = function(obj) {
     return dart.dload(obj, _wrappedType);
@@ -1150,6 +1210,42 @@
   dart.tagLazy = function(value, compute) {
     dart.defineLazyProperty(value, dart._runtimeType, {get: compute});
   };
+  dart._warn = function(arg) {
+    console.warn(arg);
+  };
+  const _jsTypeCallback = Symbol('_jsTypeCallback');
+  const _rawJSType = Symbol('_rawJSType');
+  const _dartName = Symbol('_dartName');
+  dart._isInstanceOfLazyJSType = function(o, t) {
+    if (t[_jsTypeCallback] != null) {
+      if (t[_rawJSType] == null) {
+        let expected = t[_dartName];
+        let actual = dart.typeName(dart.getReifiedType(o));
+        dart._warn(dart.str`Cannot find native JavaScript type (${expected}) ` + dart.str`to type check ${actual}`);
+        return true;
+      }
+      return dart.is(o, t[_rawJSType]);
+    }
+    if (o == null) return false;
+    return dart._isJSObject(o);
+  };
+  dart._asInstanceOfLazyJSType = function(o, t) {
+    if (t[_jsTypeCallback] != null) {
+      if (t[_rawJSType] == null) {
+        let expected = t[_dartName];
+        let actual = dart.typeName(dart.getReifiedType(o));
+        dart._warn(dart.str`Cannot find native JavaScript type (${expected}) ` + dart.str`to type check ${actual}`);
+        return o;
+      }
+      return dart.as(o, t[_rawJSType]);
+    }
+    if (o == null) return null;
+    if (!dart.test(dart._isJSObject(o))) dart._throwCastError(o, t, true);
+    return o;
+  };
+  dart._isJSObject = function(o) {
+    return !dart.getReifiedType(o)[dart._runtimeType];
+  };
   dart._initialize2 = function() {
     dart.TypeRep.prototype.is = function is_T(object) {
       return dart.is(object, this);
@@ -1169,6 +1265,15 @@
     dart.Dynamic.prototype._check = function check_Dynamic(object) {
       return object;
     };
+    dart.LazyJSType.prototype.is = function is_T(object) {
+      return dart._isInstanceOfLazyJSType(object, this);
+    };
+    dart.LazyJSType.prototype.as = function as_T(object) {
+      return dart._asInstanceOfLazyJSType(object, this);
+    };
+    dart.LazyJSType.prototype._check = function check_T(object) {
+      return dart._asInstanceOfLazyJSType(object, this);
+    };
   };
   dart._functionType = function(definite, returnType, args, extra) {
     if (args === void 0 && extra === void 0) {
@@ -1231,6 +1336,11 @@
   dart.isFunctionType = function(type) {
     return type instanceof dart.AbstractFunctionType || type === core.Function;
   };
+  dart.isLazyJSSubtype = function(t1, t2, covariant) {
+    if (dart.equals(t1, t2)) return true;
+    if (t1[_jsTypeCallback] == null || t2[_jsTypeCallback] == null) return true;
+    return dart.isClassSubType(t1[_rawJSType], t2[_rawJSType], covariant);
+  };
   dart.isFunctionSubtype = function(ft1, ft2, covariant) {
     if (ft2 === core.Function) {
       return true;
@@ -1326,6 +1436,9 @@
     if (dart.isFunctionType(t1) && dart.isFunctionType(t2)) {
       return dart.isFunctionSubtype(t1, t2, covariant);
     }
+    if (t1 instanceof dart.LazyJSType && t2 instanceof dart.LazyJSType) {
+      return dart.isLazyJSSubtype(t1, t2, covariant);
+    }
     return false;
   };
   dart.isClassSubType = function(t1, t2, covariant) {
@@ -1401,24 +1514,31 @@
     return true;
   };
   dart.throwCastError = function(object, actual, type) {
+    debugger;
     dart.throw(new _js_helper.CastErrorImplementation(object, dart.typeName(actual), dart.typeName(type)));
   };
   dart.throwTypeError = function(object, actual, type) {
+    debugger;
     dart.throw(new _js_helper.TypeErrorImplementation(object, dart.typeName(actual), dart.typeName(type)));
   };
   dart.throwStrongModeCastError = function(object, actual, type) {
+    debugger;
     dart.throw(new _js_helper.StrongModeCastError(object, dart.typeName(actual), dart.typeName(type)));
   };
   dart.throwStrongModeTypeError = function(object, actual, type) {
+    debugger;
     dart.throw(new _js_helper.StrongModeTypeError(object, dart.typeName(actual), dart.typeName(type)));
   };
   dart.throwUnimplementedError = function(message) {
+    debugger;
     dart.throw(new core.UnimplementedError(message));
   };
   dart.throwAssertionError = function() {
+    debugger;
     dart.throw(new core.AssertionError());
   };
   dart.throwNullValueError = function() {
+    debugger;
     dart.throw(new core.NoSuchMethodError(null, new core.Symbol('<Unexpected Null Value>'), null, null, null));
   };
   dart.syncStar = function(gen, E, ...args) {
@@ -1557,12 +1677,49 @@
   dart.dgcall = function(f, typeArgs, ...args) {
     return dart._checkAndCall(f, dart._getRuntimeType(f), void 0, typeArgs, args, 'call');
   };
+  dart._dhelperRepl = function(object, field, callback) {
+    let rawField = field;
+    if (typeof field == 'symbol') {
+      if (field in object) return callback(field);
+      field = field.toString();
+      field = field.substring('Symbol('.length, field.length - 1);
+    } else if (field.charAt(0) != '_') {
+      return callback(field);
+    }
+    if (field in object) return callback(field);
+    let proto = object;
+    while (proto !== null) {
+      let symbols = Object.getOwnPropertySymbols(proto);
+      let target = 'Symbol(' + field + ')';
+      for (let s = 0; s < symbols.length; s++) {
+        let sym = symbols[s];
+        if (target == sym.toString()) return callback(sym);
+      }
+      proto = proto.__proto__;
+    }
+    return callback(rawField);
+  };
+  dart.dloadRepl = function(obj, field) {
+    return dart._dhelperRepl(obj, field, dart.fn(resolvedField => dart.dload(obj, resolvedField), dynamicTodynamic$()));
+  };
+  dart.dputRepl = function(obj, field, value) {
+    return dart._dhelperRepl(obj, field, dart.fn(resolvedField => dart.dput(obj, resolvedField, value), dynamicTodynamic$()));
+  };
+  dart._callMethodRepl = function(obj, method, typeArgs, args) {
+    return dart._dhelperRepl(obj, method, dart.fn(resolvedField => dart._callMethod(obj, resolvedField, typeArgs, args, method), dynamicTodynamic$()));
+  };
+  dart.dsendRepl = function(obj, method, ...args) {
+    return dart._callMethodRepl(obj, method, null, args);
+  };
+  dart.dgsendRepl = function(obj, typeArgs, method, ...args) {
+    return dart._callMethodRepl(obj, method, typeArgs, args);
+  };
   dart.getDynamicStats = function() {
     let ret = JSArrayOfListOfObject().of([]);
     let keys = dart._callMethodStats[dartx.keys][dartx.toList]();
-    keys[dartx.sort](dart.fn((a, b) => dart._callMethodStats[dartx.get](b).count[dartx.compareTo](dart._callMethodStats[dartx.get](a).count), StringAndStringToint()));
+    keys[dartx.sort](dart.fn((a, b) => dart._callMethodStats[dartx._get](b).count[dartx.compareTo](dart._callMethodStats[dartx._get](a).count), StringAndStringToint()));
     for (let key of keys) {
-      let stats = dart._callMethodStats[dartx.get](key);
+      let stats = dart._callMethodStats[dartx._get](key);
       ret[dartx.add](JSArrayOfObject().of([stats.typeName, stats.frame, stats.count]));
     }
     return ret;
@@ -1577,7 +1734,7 @@
     let stack = stackStr[dartx.split]('\n    at ');
     let src = '';
     for (let i = 2; i < dart.notNull(stack[dartx.length]); ++i) {
-      let frame = stack[dartx.get](i);
+      let frame = stack[dartx._get](i);
       if (!dart.test(frame[dartx.contains]('dart_sdk.js'))) {
         src = frame;
         break;
@@ -1603,10 +1760,10 @@
     return dart._callMethod(obj, method, typeArgs, args, method);
   };
   dart.dindex = function(obj, index) {
-    return dart._callMethod(obj, 'get', null, [index], '[]');
+    return dart._callMethod(obj, '_get', null, [index], '[]');
   };
   dart.dsetindex = function(obj, index, value) {
-    return dart._callMethod(obj, 'set', null, [index, value], '[]=');
+    return dart._callMethod(obj, '_set', null, [index, value], '[]=');
   };
   dart._ignoreMemo = function(f) {
     let memo = new Map();
@@ -1729,11 +1886,11 @@
         for (let i = 0, end = values.length - 1; i < end; i += 2) {
           let key = values[i];
           let value = values[i + 1];
-          map.set(key, value);
+          map._set(key, value);
         }
       } else if (typeof values === 'object') {
         for (let key of dart.getOwnPropertyNames(values)) {
-          map.set(key, values[key]);
+          map._set(key, values[key]);
         }
       }
       return map;
@@ -1871,7 +2028,8 @@
     if (result != null) return dart.wrapType(result);
     let extension = dart.getExtensionType(obj);
     if (extension != null) {
-      return obj[dartx.runtimeType];
+      result = obj[dartx.runtimeType];
+      return result != null ? result : dart.wrapType(extension);
     }
     if (typeof obj == "function") {
       return dart.wrapType(dart.getReifiedType(obj));
@@ -1895,6 +2053,9 @@
     }
     return name;
   };
+  dart.loadLibrary = function() {
+    return async.Future.value();
+  };
   dart.defineProperty = function(obj, name, desc) {
     return Object.defineProperty(obj, name, desc);
   };
@@ -1908,9 +2069,11 @@
     return Object.getOwnPropertySymbols(obj);
   };
   dart.throwStrongModeError = function(message) {
+    debugger;
     throw new _js_helper.StrongModeErrorImplementation(message);
   };
   dart.throwInternalError = function(message) {
+    debugger;
     throw Error(message);
   };
   dart.getOwnNamesAndSymbols = function(obj) {
@@ -1997,6 +2160,12 @@
   dart.dartx = dartx;
   dart._runtimeType = Symbol("_runtimeType");
   dart.isNamedConstructor = Symbol("isNamedConstructor");
+  dart.defineLazy(dart, {
+    get _lazyJSTypes() {
+      return new Map();
+    },
+    set _lazyJSTypes(_) {}
+  });
   dart.metadata = Symbol("metadata");
   dart._typeObject = Symbol("typeObject");
   core.Object = class Object {
@@ -2067,6 +2236,27 @@
       return 'dynamic';
     }
   };
+  dart.LazyJSType = class LazyJSType extends core.Object {
+    new(jsTypeCallback, dartName) {
+      this[_jsTypeCallback] = jsTypeCallback;
+      this[_dartName] = dartName;
+    }
+    get [_rawJSType]() {
+      return this[_jsTypeCallback]();
+    }
+    toString() {
+      return core.String._check(this[_jsTypeCallback] != null ? dart.typeName(this[_rawJSType]) : this[_dartName]);
+    }
+  };
+  dart.LazyJSType[dart.implements] = () => [core.Type];
+  dart.setSignature(dart.LazyJSType, {
+    constructors: () => ({new: dart.definiteFunctionType(dart.LazyJSType, [dart.dynamic, dart.dynamic])}),
+    fields: () => ({
+      [_jsTypeCallback]: dart.dynamic,
+      [_dartName]: dart.dynamic
+    }),
+    getters: () => ({[_rawJSType]: dart.definiteFunctionType(dart.dynamic, [])})
+  });
   dart.dynamic = new dart.Dynamic();
   dart._initialize = dart._initialize2();
   dart.Void = class Void extends dart.TypeRep {
@@ -3073,7 +3263,7 @@
         if (genericTypeConstructor != null) {
           this.recordGenericParameters(core.String._check(name), genericTypeConstructor);
         } else {
-          nonGenericProperties.set(core.String._check(name), value);
+          nonGenericProperties._set(core.String._check(name), value);
         }
       }, dynamicAnddynamicTodynamic$()));
       nonGenericProperties.forEach(dart.fn((name, value) => {
@@ -3086,13 +3276,13 @@
       return children.toList();
     }
     recordGenericParameters(name, genericTypeConstructor) {
-      this.genericParameters.set(name, genericTypeConstructor.toString()[dartx.split](' =>')[dartx.first][dartx.replaceAll](core.RegExp.new('[(|)]'), ''));
+      this.genericParameters._set(name, genericTypeConstructor.toString()[dartx.split](' =>')[dartx.first][dartx.replaceAll](core.RegExp.new('[(|)]'), ''));
     }
     classChild(name, child) {
       let typeName = _debugger.getTypeName(core.Type._check(child));
       let parameterName = dart.str`${name}\$`;
       if (dart.test(this.genericParameters.keys[dartx.contains](parameterName))) {
-        typeName = dart.str`${typeName}<${this.genericParameters.get(parameterName)}>`;
+        typeName = dart.str`${typeName}<${this.genericParameters._get(parameterName)}>`;
         _debugger.JSNative.setProperty(child, 'genericTypeName', typeName);
       }
       return new _debugger.NameValuePair({name: typeName, value: child});
@@ -3555,8 +3745,12 @@
     constructors: () => ({new: dart.definiteFunctionType(_interceptors.JSBool, [])})
   });
   dart.registerExtension(dart.global.Boolean, _interceptors.JSBool);
-  _interceptors.JSIndexable = class JSIndexable extends core.Object {};
-  _interceptors.JSMutableIndexable = class JSMutableIndexable extends _interceptors.JSIndexable {};
+  _interceptors.JSIndexable$ = dart.generic(E => {
+    class JSIndexable extends core.Object {}
+    dart.addTypeTests(JSIndexable);
+    return JSIndexable;
+  });
+  _interceptors.JSIndexable = JSIndexable();
   _interceptors.JSObject = class JSObject extends core.Object {};
   _interceptors.JavaScriptObject = class JavaScriptObject extends _interceptors.Interceptor {
     new() {
@@ -3619,6 +3813,7 @@
     let SetOfE = () => (SetOfE = dart.constFn(core.Set$(E)))();
     let ArrayIteratorOfE = () => (ArrayIteratorOfE = dart.constFn(_interceptors.ArrayIterator$(E)))();
     let ListMapViewOfE = () => (ListMapViewOfE = dart.constFn(_internal.ListMapView$(E)))();
+    let JSIndexableOfE = () => (JSIndexableOfE = dart.constFn(_interceptors.JSIndexable$(E)))();
     let ETobool = () => (ETobool = dart.constFn(dart.functionType(core.bool, [E])))();
     let ETovoid = () => (ETovoid = dart.constFn(dart.functionType(dart.void, [E])))();
     let EAndEToint = () => (EAndEToint = dart.constFn(dart.functionType(core.int, [E, E])))();
@@ -3677,8 +3872,8 @@
       'hashCode',
       'length',
       'length',
-      'get',
-      'set',
+      '_get',
+      '_set',
       'asMap'
     ]);
     class JSArray extends core.Object {
@@ -3755,7 +3950,7 @@
         this[dartx.checkMutable]('setAll');
         core.RangeError.checkValueInInterval(index, 0, this[dartx.length], "index");
         for (let element of iterable) {
-          this[dartx.set]((() => {
+          this[dartx._set]((() => {
             let x = index;
             index = dart.notNull(x) + 1;
             return x;
@@ -3770,7 +3965,7 @@
       [dartx.remove](element) {
         this[dartx.checkGrowable]('remove');
         for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-          if (dart.equals(this[dartx.get](i), element)) {
+          if (dart.equals(this[dartx._get](i), element)) {
             this.splice(i, 1);
             return true;
           }
@@ -3798,7 +3993,7 @@
         if (retained[dartx.length] == end) return;
         this[dartx.length] = retained[dartx.length];
         for (let i = 0; i < dart.notNull(retained[dartx.length]); i++) {
-          this[dartx.set](i, E._check(retained[dartx.get](i)));
+          this[dartx._set](i, E._check(retained[dartx._get](i)));
         }
       }
       [dartx.where](f) {
@@ -3839,7 +4034,7 @@
         if (separator === void 0) separator = "";
         let list = core.List.new(this[dartx.length]);
         for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-          list[dartx.set](i, dart.str`${this[dartx.get](i)}`);
+          list[dartx._set](i, dart.str`${this[dartx._get](i)}`);
         }
         return list.join(separator);
       }
@@ -3859,7 +4054,7 @@
         EAndEToE()._check(combine);
         let length = this[dartx.length];
         if (length == 0) dart.throw(_internal.IterableElementError.noElement());
-        let value = this[dartx.get](0);
+        let value = this[dartx._get](0);
         for (let i = 1; i < dart.notNull(length); i++) {
           let element = this[i];
           value = combine(value, element);
@@ -3926,7 +4121,7 @@
         dart.throw(_internal.IterableElementError.noElement());
       }
       [dartx.elementAt](index) {
-        return this[dartx.get](index);
+        return this[dartx._get](index);
       }
       [dartx.sublist](start, end) {
         if (end === void 0) end = null;
@@ -3951,15 +4146,15 @@
         return new (SubListIterableOfE())(this, start, end);
       }
       get [dartx.first]() {
-        if (dart.notNull(this[dartx.length]) > 0) return this[dartx.get](0);
+        if (dart.notNull(this[dartx.length]) > 0) return this[dartx._get](0);
         dart.throw(_internal.IterableElementError.noElement());
       }
       get [dartx.last]() {
-        if (dart.notNull(this[dartx.length]) > 0) return this[dartx.get](dart.notNull(this[dartx.length]) - 1);
+        if (dart.notNull(this[dartx.length]) > 0) return this[dartx._get](dart.notNull(this[dartx.length]) - 1);
         dart.throw(_internal.IterableElementError.noElement());
       }
       get [dartx.single]() {
-        if (this[dartx.length] == 1) return this[dartx.get](0);
+        if (this[dartx.length] == 1) return this[dartx._get](0);
         if (this[dartx.length] == 0) dart.throw(_internal.IterableElementError.noElement());
         dart.throw(_internal.IterableElementError.tooMany());
       }
@@ -3991,12 +4186,12 @@
         }
         if (dart.notNull(otherStart) < dart.notNull(start)) {
           for (let i = length - 1; i >= 0; i--) {
-            let element = otherList[dartx.get](dart.notNull(otherStart) + i);
+            let element = otherList[dartx._get](dart.notNull(otherStart) + i);
             this[dart.notNull(start) + i] = element;
           }
         } else {
           for (let i = 0; i < length; i++) {
-            let element = otherList[dartx.get](dart.notNull(otherStart) + i);
+            let element = otherList[dartx._get](dart.notNull(otherStart) + i);
             this[dart.notNull(start) + i] = element;
           }
         }
@@ -4075,9 +4270,9 @@
         while (dart.notNull(length) > 1) {
           let pos = random.nextInt(length);
           length = dart.notNull(length) - 1;
-          let tmp = this[dartx.get](length);
-          this[dartx.set](length, this[dartx.get](pos));
-          this[dartx.set](pos, tmp);
+          let tmp = this[dartx._get](length);
+          this[dartx._set](length, this[dartx._get](pos));
+          this[dartx._set](pos, tmp);
         }
       }
       [dartx.indexOf](element, start) {
@@ -4089,7 +4284,7 @@
           start = 0;
         }
         for (let i = start; dart.notNull(i) < dart.notNull(this[dartx.length]); i = dart.notNull(i) + 1) {
-          if (dart.equals(this[dartx.get](i), element)) {
+          if (dart.equals(this[dartx._get](i), element)) {
             return i;
           }
         }
@@ -4108,7 +4303,7 @@
           }
         }
         for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) {
-          if (dart.equals(this[dartx.get](i), element)) {
+          if (dart.equals(this[dartx._get](i), element)) {
             return i;
           }
         }
@@ -4116,7 +4311,7 @@
       }
       [dartx.contains](other) {
         for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-          if (dart.equals(this[dartx.get](i), other)) return true;
+          if (dart.equals(this[dartx._get](i), other)) return true;
         }
         return false;
       }
@@ -4157,12 +4352,12 @@
         }
         this.length = newLength;
       }
-      [dartx.get](index) {
+      [dartx._get](index) {
         if (!(typeof index == 'number')) dart.throw(_js_helper.diagnoseIndexError(this, index));
         if (dart.notNull(index) >= dart.notNull(this[dartx.length]) || dart.notNull(index) < 0) dart.throw(_js_helper.diagnoseIndexError(this, index));
         return this[index];
       }
-      [dartx.set](index, value) {
+      [dartx._set](index, value) {
         E._check(value);
         this[dartx.checkMutable]('indexed set');
         if (!(typeof index == 'number')) dart.throw(_js_helper.diagnoseIndexError(this, index));
@@ -4176,7 +4371,7 @@
     }
     dart.setExtensionBaseClass(JSArray, dart.global.Array);
     dart.addTypeTests(JSArray);
-    JSArray[dart.implements] = () => [ListOfE(), _interceptors.JSIndexable];
+    JSArray[dart.implements] = () => [ListOfE(), JSIndexableOfE()];
     dart.setSignature(JSArray, {
       constructors: () => ({
         new: dart.definiteFunctionType(_interceptors.JSArray$(E), []),
@@ -4241,8 +4436,8 @@
         [dartx.contains]: dart.definiteFunctionType(core.bool, [core.Object]),
         [dartx.toList]: dart.definiteFunctionType(core.List$(E), [], {growable: core.bool}),
         [dartx.toSet]: dart.definiteFunctionType(core.Set$(E), []),
-        [dartx.get]: dart.definiteFunctionType(E, [core.int]),
-        [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, E]),
+        [dartx._get]: dart.definiteFunctionType(E, [core.int]),
+        [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, E]),
         [dartx.asMap]: dart.definiteFunctionType(core.Map$(core.int, E), [])
       }),
       statics: () => ({
@@ -4261,7 +4456,6 @@
         super.new();
       }
     }
-    JSMutableArray[dart.implements] = () => [_interceptors.JSMutableIndexable];
     return JSMutableArray;
   });
   _interceptors.JSMutableArray = JSMutableArray();
@@ -4318,7 +4512,7 @@
           this[_current] = null;
           return false;
         }
-        this[_current] = this[_iterable][dartx.get](this[_index]);
+        this[_current] = this[_iterable][dartx._get](this[_index]);
         this[_index] = dart.notNull(this[_index]) + 1;
         return true;
       }
@@ -4370,7 +4564,7 @@
     'toRadixString',
     'toString',
     'hashCode',
-    'unary-',
+    '_negate',
     '+',
     '-',
     '/',
@@ -4567,7 +4761,7 @@
     get [dartx.hashCode]() {
       return this & 0x1FFFFFFF;
     }
-    [dartx['unary-']]() {
+    [dartx._negate]() {
       return -this;
     }
     [dartx['+']](other) {
@@ -4865,7 +5059,7 @@
       [dartx.toStringAsExponential]: dart.definiteFunctionType(core.String, [], [core.int]),
       [dartx.toStringAsPrecision]: dart.definiteFunctionType(core.String, [core.int]),
       [dartx.toRadixString]: dart.definiteFunctionType(core.String, [core.int]),
-      [dartx['unary-']]: dart.definiteFunctionType(_interceptors.JSNumber, []),
+      [dartx._negate]: dart.definiteFunctionType(_interceptors.JSNumber, []),
       [dartx['+']]: dart.definiteFunctionType(_interceptors.JSNumber, [core.num]),
       [dartx['-']]: dart.definiteFunctionType(_interceptors.JSNumber, [core.num]),
       [dartx['/']]: dart.definiteFunctionType(core.double, [core.num]),
@@ -4948,7 +5142,7 @@
     'hashCode',
     'runtimeType',
     'length',
-    'get'
+    '_get'
   ]);
   _interceptors.JSString = class JSString extends _interceptors.Interceptor {
     new() {
@@ -5331,13 +5525,13 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (!(typeof index == 'number')) dart.throw(_js_helper.diagnoseIndexError(this, index));
       if (dart.notNull(index) >= dart.notNull(this[dartx.length]) || dart.notNull(index) < 0) dart.throw(_js_helper.diagnoseIndexError(this, index));
       return this[index];
     }
   };
-  _interceptors.JSString[dart.implements] = () => [core.String, _interceptors.JSIndexable];
+  _interceptors.JSString[dart.implements] = () => [core.String, JSIndexableOfString()];
   dart.setSignature(_interceptors.JSString, {
     constructors: () => ({new: dart.definiteFunctionType(_interceptors.JSString, [])}),
     getters: () => ({
@@ -5375,7 +5569,7 @@
       [dartx.lastIndexOf]: dart.definiteFunctionType(core.int, [core.Pattern], [core.int]),
       [dartx.contains]: dart.definiteFunctionType(core.bool, [core.Pattern], [core.int]),
       [dartx.compareTo]: dart.definiteFunctionType(core.int, [core.String]),
-      [dartx.get]: dart.definiteFunctionType(core.String, [core.int])
+      [dartx._get]: dart.definiteFunctionType(core.String, [core.int])
     }),
     statics: () => ({
       _isWhitespace: dart.definiteFunctionType(core.bool, [core.int]),
@@ -5451,6 +5645,7 @@
   });
   _internal.POWERS_OF_TEN = dart.constList([1.0, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, 10000000.0, 100000000.0, 1000000000.0, 10000000000.0, 100000000000.0, 1000000000000.0, 10000000000000.0, 100000000000000.0, 1000000000000000.0, 10000000000000000.0, 100000000000000000.0, 1000000000000000000.0, 10000000000000000000.0, 100000000000000000000.0, 1e+21, 1e+22], core.double);
   const _string = Symbol('_string');
+  const _filter = Symbol('_filter');
   collection.ListMixin$ = dart.generic(E => {
     let ListIteratorOfE = () => (ListIteratorOfE = dart.constFn(_internal.ListIterator$(E)))();
     let VoidToE = () => (VoidToE = dart.constFn(dart.functionType(E, [])))();
@@ -5462,6 +5657,7 @@
     let ListOfE = () => (ListOfE = dart.constFn(core.List$(E)))();
     let SetOfE = () => (SetOfE = dart.constFn(core.Set$(E)))();
     let IterableOfE = () => (IterableOfE = dart.constFn(core.Iterable$(E)))();
+    let JSArrayOfE = () => (JSArrayOfE = dart.constFn(_interceptors.JSArray$(E)))();
     let ListMapViewOfE = () => (ListMapViewOfE = dart.constFn(_internal.ListMapView$(E)))();
     let ReversedListIterableOfE = () => (ReversedListIterableOfE = dart.constFn(_internal.ReversedListIterable$(E)))();
     let ETovoid = () => (ETovoid = dart.constFn(dart.functionType(dart.void, [E])))();
@@ -5527,12 +5723,12 @@
         return new dart.JsIterator(this[dartx.iterator]);
       }
       elementAt(index) {
-        return this[dartx.get](index);
+        return this[dartx._get](index);
       }
       forEach(action) {
         let length = this[dartx.length];
         for (let i = 0; i < dart.notNull(length); i++) {
-          action(this[dartx.get](i));
+          action(this[dartx._get](i));
           if (length != this[dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this));
           }
@@ -5546,21 +5742,21 @@
       }
       get first() {
         if (this[dartx.length] == 0) dart.throw(_internal.IterableElementError.noElement());
-        return this[dartx.get](0);
+        return this[dartx._get](0);
       }
       get last() {
         if (this[dartx.length] == 0) dart.throw(_internal.IterableElementError.noElement());
-        return this[dartx.get](dart.notNull(this[dartx.length]) - 1);
+        return this[dartx._get](dart.notNull(this[dartx.length]) - 1);
       }
       get single() {
         if (this[dartx.length] == 0) dart.throw(_internal.IterableElementError.noElement());
         if (dart.notNull(this[dartx.length]) > 1) dart.throw(_internal.IterableElementError.tooMany());
-        return this[dartx.get](0);
+        return this[dartx._get](0);
       }
       contains(element) {
         let length = this[dartx.length];
         for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-          if (dart.equals(this[dartx.get](i), element)) return true;
+          if (dart.equals(this[dartx._get](i), element)) return true;
           if (length != this[dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this));
           }
@@ -5570,7 +5766,7 @@
       every(test) {
         let length = this[dartx.length];
         for (let i = 0; i < dart.notNull(length); i++) {
-          if (!dart.test(test(this[dartx.get](i)))) return false;
+          if (!dart.test(test(this[dartx._get](i)))) return false;
           if (length != this[dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this));
           }
@@ -5580,7 +5776,7 @@
       any(test) {
         let length = this[dartx.length];
         for (let i = 0; i < dart.notNull(length); i++) {
-          if (dart.test(test(this[dartx.get](i)))) return true;
+          if (dart.test(test(this[dartx._get](i)))) return true;
           if (length != this[dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this));
           }
@@ -5592,7 +5788,7 @@
         VoidToE()._check(orElse);
         let length = this[dartx.length];
         for (let i = 0; i < dart.notNull(length); i++) {
-          let element = this[dartx.get](i);
+          let element = this[dartx._get](i);
           if (dart.test(test(element))) return element;
           if (length != this[dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this));
@@ -5606,7 +5802,7 @@
         VoidToE()._check(orElse);
         let length = this[dartx.length];
         for (let i = dart.notNull(length) - 1; i >= 0; i--) {
-          let element = this[dartx.get](i);
+          let element = this[dartx._get](i);
           if (dart.test(test(element))) return element;
           if (length != this[dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this));
@@ -5620,7 +5816,7 @@
         let match = null;
         let matchFound = false;
         for (let i = 0; i < dart.notNull(length); i++) {
-          let element = this[dartx.get](i);
+          let element = this[dartx._get](i);
           if (dart.test(test(element))) {
             if (matchFound) {
               dart.throw(_internal.IterableElementError.tooMany());
@@ -5659,9 +5855,9 @@
         EAndEToE()._check(combine);
         let length = this[dartx.length];
         if (length == 0) dart.throw(_internal.IterableElementError.noElement());
-        let value = this[dartx.get](0);
+        let value = this[dartx._get](0);
         for (let i = 1; i < dart.notNull(length); i++) {
-          value = combine(value, this[dartx.get](i));
+          value = combine(value, this[dartx._get](i));
           if (length != this[dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this));
           }
@@ -5673,7 +5869,7 @@
           let value = initialValue;
           let length = this[dartx.length];
           for (let i = 0; i < dart.notNull(length); i++) {
-            value = combine(value, this[dartx.get](i));
+            value = combine(value, this[dartx._get](i));
             if (length != this[dartx.length]) {
               dart.throw(new core.ConcurrentModificationError(this));
             }
@@ -5703,20 +5899,20 @@
           result = ListOfE().new(this[dartx.length]);
         }
         for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-          result[dartx.set](i, this[dartx.get](i));
+          result[dartx._set](i, this[dartx._get](i));
         }
         return result;
       }
       toSet() {
         let result = SetOfE().new();
         for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-          result.add(this[dartx.get](i));
+          result.add(this[dartx._get](i));
         }
         return result;
       }
       add(element) {
         E._check(element);
-        this[dartx.set]((() => {
+        this[dartx._set]((() => {
           let x = this[dartx.length];
           this[dartx.length] = dart.notNull(x) + 1;
           return x;
@@ -5728,13 +5924,13 @@
         for (let element of iterable) {
           dart.assert(this[dartx.length] == i || dart.test(dart.throw(new core.ConcurrentModificationError(this))));
           this[dartx.length] = dart.notNull(i) + 1;
-          this[dartx.set](i, element);
+          this[dartx._set](i, element);
           i = dart.notNull(i) + 1;
         }
       }
       remove(element) {
         for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-          if (dart.equals(this[dartx.get](i), element)) {
+          if (dart.equals(this[dartx._get](i), element)) {
             this[dartx.setRange](i, dart.notNull(this[dartx.length]) - 1, this, i + 1);
             this[dartx.length] = dart.notNull(this[dartx.length]) - 1;
             return true;
@@ -5743,16 +5939,17 @@
         return false;
       }
       removeWhere(test) {
-        collection.ListMixin._filter(this, test, false);
+        this[_filter](test, false);
       }
       retainWhere(test) {
-        collection.ListMixin._filter(this, test, true);
+        this[_filter](test, true);
       }
-      static _filter(source, test, retainMatching) {
-        let retained = [];
+      [_filter](test, retainMatching) {
+        let source = this;
+        let retained = JSArrayOfE().of([]);
         let length = source[dartx.length];
         for (let i = 0; i < dart.notNull(length); i++) {
-          let element = source[dartx.get](i);
+          let element = source[dartx._get](i);
           if (dart.dcall(test, element) == retainMatching) {
             retained[dartx.add](element);
           }
@@ -5772,7 +5969,7 @@
         if (this[dartx.length] == 0) {
           dart.throw(_internal.IterableElementError.noElement());
         }
-        let result = this[dartx.get](dart.notNull(this[dartx.length]) - 1);
+        let result = this[dartx._get](dart.notNull(this[dartx.length]) - 1);
         this[dartx.length] = dart.notNull(this[dartx.length]) - 1;
         return result;
       }
@@ -5791,9 +5988,9 @@
         while (dart.notNull(length) > 1) {
           let pos = random.nextInt(length);
           length = dart.notNull(length) - 1;
-          let tmp = this[dartx.get](length);
-          this[dartx.set](length, this[dartx.get](pos));
-          this[dartx.set](pos, tmp);
+          let tmp = this[dartx._get](length);
+          this[dartx._set](length, this[dartx._get](pos));
+          this[dartx._set](pos, tmp);
         }
       }
       asMap() {
@@ -5808,7 +6005,7 @@
         let result = ListOfE().new();
         result[dartx.length] = length;
         for (let i = 0; i < length; i++) {
-          result[dartx.set](i, this[dartx.get](dart.notNull(start) + i));
+          result[dartx._set](i, this[dartx._get](dart.notNull(start) + i));
         }
         return result;
       }
@@ -5827,7 +6024,7 @@
         E._check(fill);
         core.RangeError.checkValidRange(start, end, this[dartx.length]);
         for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-          this[dartx.set](i, fill);
+          this[dartx._set](i, fill);
         }
       }
       setRange(start, end, iterable, skipCount) {
@@ -5851,11 +6048,11 @@
         }
         if (dart.notNull(otherStart) < dart.notNull(start)) {
           for (let i = length - 1; i >= 0; i--) {
-            this[dartx.set](dart.notNull(start) + i, otherList[dartx.get](dart.notNull(otherStart) + i));
+            this[dartx._set](dart.notNull(start) + i, otherList[dartx._get](dart.notNull(otherStart) + i));
           }
         } else {
           for (let i = 0; i < length; i++) {
-            this[dartx.set](dart.notNull(start) + i, otherList[dartx.get](dart.notNull(otherStart) + i));
+            this[dartx._set](dart.notNull(start) + i, otherList[dartx._get](dart.notNull(otherStart) + i));
           }
         }
       }
@@ -5894,7 +6091,7 @@
           startIndex = 0;
         }
         for (let i = startIndex; dart.notNull(i) < dart.notNull(this[dartx.length]); i = dart.notNull(i) + 1) {
-          if (dart.equals(this[dartx.get](i), element)) {
+          if (dart.equals(this[dartx._get](i), element)) {
             return i;
           }
         }
@@ -5913,7 +6110,7 @@
           }
         }
         for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) {
-          if (dart.equals(this[dartx.get](i), element)) {
+          if (dart.equals(this[dartx._get](i), element)) {
             return i;
           }
         }
@@ -5929,10 +6126,10 @@
         if (!(typeof index == 'number')) dart.throw(new core.ArgumentError(index));
         this[dartx.length] = dart.notNull(this[dartx.length]) + 1;
         this[dartx.setRange](dart.notNull(index) + 1, this[dartx.length], this, index);
-        this[dartx.set](index, element);
+        this[dartx._set](index, element);
       }
       removeAt(index) {
-        let result = this[dartx.get](index);
+        let result = this[dartx._get](index);
         this[dartx.setRange](index, dart.notNull(this[dartx.length]) - 1, this, dart.notNull(index) + 1);
         this[dartx.length] = dart.notNull(this[dartx.length]) - 1;
         return result;
@@ -5958,7 +6155,7 @@
           this[dartx.setRange](index, dart.notNull(index) + dart.notNull(iterable[dartx.length]), iterable);
         } else {
           for (let element of iterable) {
-            this[dartx.set]((() => {
+            this[dartx._set]((() => {
               let x = index;
               index = dart.notNull(x) + 1;
               return x;
@@ -6011,6 +6208,7 @@
         remove: dart.definiteFunctionType(core.bool, [core.Object]),
         removeWhere: dart.definiteFunctionType(dart.void, [ETobool()]),
         retainWhere: dart.definiteFunctionType(dart.void, [ETobool()]),
+        [_filter]: dart.definiteFunctionType(dart.void, [dynamicTobool(), core.bool]),
         clear: dart.definiteFunctionType(dart.void, []),
         removeLast: dart.definiteFunctionType(E, []),
         sort: dart.definiteFunctionType(dart.void, [], [EAndEToint()]),
@@ -6028,9 +6226,7 @@
         removeAt: dart.definiteFunctionType(E, [core.int]),
         insertAll: dart.definiteFunctionType(dart.void, [core.int, IterableOfE()]),
         setAll: dart.definiteFunctionType(dart.void, [core.int, IterableOfE()])
-      }),
-      statics: () => ({_filter: dart.definiteFunctionType(dart.void, [core.List, dynamicTobool(), core.bool])}),
-      names: ['_filter']
+      })
     });
     dart.defineExtensionMembers(ListMixin, [
       'elementAt',
@@ -6107,7 +6303,7 @@
     let ETobool = () => (ETobool = dart.constFn(dart.functionType(core.bool, [E])))();
     let ComparatorOfE = () => (ComparatorOfE = dart.constFn(core.Comparator$(E)))();
     class UnmodifiableListMixin extends core.Object {
-      set(index, value) {
+      _set(index, value) {
         E._check(value);
         dart.throw(new core.UnsupportedError("Cannot modify an unmodifiable list"));
         return value;
@@ -6184,7 +6380,7 @@
     dart.setSignature(UnmodifiableListMixin, {
       setters: () => ({length: dart.definiteFunctionType(dart.void, [core.int])}),
       methods: () => ({
-        set: dart.definiteFunctionType(dart.void, [core.int, E]),
+        _set: dart.definiteFunctionType(dart.void, [core.int, E]),
         setAll: dart.definiteFunctionType(dart.void, [core.int, IterableOfE()]),
         add: dart.definiteFunctionType(dart.void, [E]),
         insert: dart.definiteFunctionType(dart.void, [core.int, E]),
@@ -6205,7 +6401,7 @@
       })
     });
     dart.defineExtensionMembers(UnmodifiableListMixin, [
-      'set',
+      '_set',
       'setAll',
       'add',
       'insert',
@@ -6274,7 +6470,7 @@
     set length(value) {
       super.length = value;
     }
-    get(i) {
+    _get(i) {
       return this[_string][dartx.codeUnitAt](i);
     }
     static stringOf(u) {
@@ -6286,11 +6482,11 @@
     constructors: () => ({new: dart.definiteFunctionType(_internal.CodeUnits, [core.String])}),
     fields: () => ({[_string]: core.String}),
     getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
-    methods: () => ({get: dart.definiteFunctionType(core.int, [core.int])}),
+    methods: () => ({_get: dart.definiteFunctionType(core.int, [core.int])}),
     statics: () => ({stringOf: dart.definiteFunctionType(core.String, [_internal.CodeUnits])}),
     names: ['stringOf']
   });
-  dart.defineExtensionMembers(_internal.CodeUnits, ['get', 'length']);
+  dart.defineExtensionMembers(_internal.CodeUnits, ['_get', 'length']);
   _internal.EfficientLength = class EfficientLength extends core.Object {};
   core.Iterable$ = dart.generic(E => {
     let EmptyIterableOfE = () => (EmptyIterableOfE = dart.constFn(_internal.EmptyIterable$(E)))();
@@ -6809,7 +7005,7 @@
           result = ListOfE().new(this.length);
         }
         for (let i = 0; i < dart.notNull(this.length); i++) {
-          result[dartx.set](i, this.elementAt(i));
+          result[dartx._set](i, this.elementAt(i));
         }
         return result;
       }
@@ -6957,7 +7153,7 @@
           return _;
         })() : ListOfE().new(length);
         for (let i = 0; i < length; i++) {
-          result[dartx.set](i, this[_iterable$][dartx.elementAt](dart.notNull(start) + i));
+          result[dartx._set](i, this[_iterable$][dartx.elementAt](dart.notNull(start) + i));
           if (dart.notNull(this[_iterable$][dartx.length]) < dart.notNull(end)) dart.throw(new core.ConcurrentModificationError(this));
         }
         return result;
@@ -8007,8 +8203,8 @@
       new(values) {
         this[_values] = values;
       }
-      get(key) {
-        return dart.test(this.containsKey(key)) ? this[_values][dartx.get](core.int._check(key)) : null;
+      _get(key) {
+        return dart.test(this.containsKey(key)) ? this[_values][dartx._get](core.int._check(key)) : null;
       }
       get length() {
         return this[_values][dartx.length];
@@ -8034,13 +8230,13 @@
       forEach(f) {
         let length = this[_values][dartx.length];
         for (let i = 0; i < dart.notNull(length); i++) {
-          f(i, this[_values][dartx.get](i));
+          f(i, this[_values][dartx._get](i));
           if (length != this[_values][dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this[_values]));
           }
         }
       }
-      set(key, value) {
+      _set(key, value) {
         E._check(value);
         dart.throw(new core.UnsupportedError("Cannot modify an unmodifiable map"));
         return value;
@@ -8076,11 +8272,11 @@
         isNotEmpty: dart.definiteFunctionType(core.bool, [])
       }),
       methods: () => ({
-        get: dart.definiteFunctionType(E, [core.Object]),
+        _get: dart.definiteFunctionType(E, [core.Object]),
         containsValue: dart.definiteFunctionType(core.bool, [core.Object]),
         containsKey: dart.definiteFunctionType(core.bool, [core.Object]),
         forEach: dart.definiteFunctionType(dart.void, [intAndETovoid()]),
-        set: dart.definiteFunctionType(dart.void, [core.int, E]),
+        _set: dart.definiteFunctionType(dart.void, [core.int, E]),
         putIfAbsent: dart.definiteFunctionType(E, [core.int, VoidToE()]),
         remove: dart.definiteFunctionType(E, [core.Object]),
         clear: dart.definiteFunctionType(dart.void, []),
@@ -8088,11 +8284,11 @@
       })
     });
     dart.defineExtensionMembers(ListMapView, [
-      'get',
+      '_get',
       'containsValue',
       'containsKey',
       'forEach',
-      'set',
+      '_set',
       'putIfAbsent',
       'remove',
       'clear',
@@ -8189,11 +8385,11 @@
     static copy(src, srcStart, dst, dstStart, count) {
       if (dart.notNull(srcStart) < dart.notNull(dstStart)) {
         for (let i = dart.notNull(srcStart) + dart.notNull(count) - 1, j = dart.notNull(dstStart) + dart.notNull(count) - 1; i >= dart.notNull(srcStart); i--, j--) {
-          dst[dartx.set](j, src[dartx.get](i));
+          dst[dartx._set](j, src[dartx._get](i));
         }
       } else {
         for (let i = srcStart, j = dstStart; dart.notNull(i) < dart.notNull(srcStart) + dart.notNull(count); i = dart.notNull(i) + 1, j = dart.notNull(j) + 1) {
-          dst[dartx.set](j, src[dartx.get](i));
+          dst[dartx._set](j, src[dartx._get](i));
         }
       }
     }
@@ -8203,7 +8399,7 @@
       let length = a[dartx.length];
       if (!dart.equals(length, dart.dload(b, 'length'))) return false;
       for (let i = 0; i < dart.notNull(length); i++) {
-        if (!core.identical(a[dartx.get](i), dart.dindex(b, i))) return false;
+        if (!core.identical(a[dartx._get](i), dart.dindex(b, i))) return false;
       }
       return true;
     }
@@ -8215,7 +8411,7 @@
         startIndex = 0;
       }
       for (let i = startIndex; dart.notNull(i) < dart.notNull(endIndex); i = dart.notNull(i) + 1) {
-        if (dart.equals(a[dartx.get](i), element)) {
+        if (dart.equals(a[dartx._get](i), element)) {
           return i;
         }
       }
@@ -8229,7 +8425,7 @@
         startIndex = dart.notNull(a[dartx.length]) - 1;
       }
       for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) {
-        if (dart.equals(a[dartx.get](i), element)) {
+        if (dart.equals(a[dartx._get](i), element)) {
           return i;
         }
       }
@@ -8289,13 +8485,13 @@
     static _insertionSort(E) {
       return (a, left, right, compare) => {
         for (let i = dart.notNull(left) + 1; i <= dart.notNull(right); i++) {
-          let el = a[dartx.get](i);
+          let el = a[dartx._get](i);
           let j = i;
-          while (j > dart.notNull(left) && dart.notNull(compare(a[dartx.get](j - 1), el)) > 0) {
-            a[dartx.set](j, a[dartx.get](j - 1));
+          while (j > dart.notNull(left) && dart.notNull(compare(a[dartx._get](j - 1), el)) > 0) {
+            a[dartx._set](j, a[dartx._get](j - 1));
             j--;
           }
-          a[dartx.set](j, el);
+          a[dartx._set](j, el);
         }
       };
     }
@@ -8308,11 +8504,11 @@
         let index3 = ((dart.notNull(left) + dart.notNull(right)) / 2)[dartx.truncate]();
         let index2 = index3 - sixth;
         let index4 = index3 + sixth;
-        let el1 = a[dartx.get](index1);
-        let el2 = a[dartx.get](index2);
-        let el3 = a[dartx.get](index3);
-        let el4 = a[dartx.get](index4);
-        let el5 = a[dartx.get](index5);
+        let el1 = a[dartx._get](index1);
+        let el2 = a[dartx._get](index2);
+        let el3 = a[dartx._get](index3);
+        let el4 = a[dartx._get](index4);
+        let el5 = a[dartx._get](index5);
         if (dart.notNull(compare(el1, el2)) > 0) {
           let t = el1;
           el1 = el2;
@@ -8360,40 +8556,40 @@
         }
         let pivot1 = el2;
         let pivot2 = el4;
-        a[dartx.set](index1, el1);
-        a[dartx.set](index3, el3);
-        a[dartx.set](index5, el5);
-        a[dartx.set](index2, a[dartx.get](left));
-        a[dartx.set](index4, a[dartx.get](right));
+        a[dartx._set](index1, el1);
+        a[dartx._set](index3, el3);
+        a[dartx._set](index5, el5);
+        a[dartx._set](index2, a[dartx._get](left));
+        a[dartx._set](index4, a[dartx._get](right));
         let less = dart.notNull(left) + 1;
         let great = dart.notNull(right) - 1;
         let pivots_are_equal = compare(pivot1, pivot2) == 0;
         if (pivots_are_equal) {
           let pivot = pivot1;
           for (let k = less; k <= great; k++) {
-            let ak = a[dartx.get](k);
+            let ak = a[dartx._get](k);
             let comp = compare(ak, pivot);
             if (comp == 0) continue;
             if (dart.notNull(comp) < 0) {
               if (k != less) {
-                a[dartx.set](k, a[dartx.get](less));
-                a[dartx.set](less, ak);
+                a[dartx._set](k, a[dartx._get](less));
+                a[dartx._set](less, ak);
               }
               less++;
             } else {
               while (true) {
-                comp = compare(a[dartx.get](great), pivot);
+                comp = compare(a[dartx._get](great), pivot);
                 if (dart.notNull(comp) > 0) {
                   great--;
                   continue;
                 } else if (dart.notNull(comp) < 0) {
-                  a[dartx.set](k, a[dartx.get](less));
-                  a[dartx.set](less++, a[dartx.get](great));
-                  a[dartx.set](great--, ak);
+                  a[dartx._set](k, a[dartx._get](less));
+                  a[dartx._set](less++, a[dartx._get](great));
+                  a[dartx._set](great--, ak);
                   break;
                 } else {
-                  a[dartx.set](k, a[dartx.get](great));
-                  a[dartx.set](great--, ak);
+                  a[dartx._set](k, a[dartx._get](great));
+                  a[dartx._set](great--, ak);
                   break;
                 }
               }
@@ -8401,32 +8597,32 @@
           }
         } else {
           for (let k = less; k <= great; k++) {
-            let ak = a[dartx.get](k);
+            let ak = a[dartx._get](k);
             let comp_pivot1 = compare(ak, pivot1);
             if (dart.notNull(comp_pivot1) < 0) {
               if (k != less) {
-                a[dartx.set](k, a[dartx.get](less));
-                a[dartx.set](less, ak);
+                a[dartx._set](k, a[dartx._get](less));
+                a[dartx._set](less, ak);
               }
               less++;
             } else {
               let comp_pivot2 = compare(ak, pivot2);
               if (dart.notNull(comp_pivot2) > 0) {
                 while (true) {
-                  let comp = compare(a[dartx.get](great), pivot2);
+                  let comp = compare(a[dartx._get](great), pivot2);
                   if (dart.notNull(comp) > 0) {
                     great--;
                     if (great < k) break;
                     continue;
                   } else {
-                    comp = compare(a[dartx.get](great), pivot1);
+                    comp = compare(a[dartx._get](great), pivot1);
                     if (dart.notNull(comp) < 0) {
-                      a[dartx.set](k, a[dartx.get](less));
-                      a[dartx.set](less++, a[dartx.get](great));
-                      a[dartx.set](great--, ak);
+                      a[dartx._set](k, a[dartx._get](less));
+                      a[dartx._set](less++, a[dartx._get](great));
+                      a[dartx._set](great--, ak);
                     } else {
-                      a[dartx.set](k, a[dartx.get](great));
-                      a[dartx.set](great--, ak);
+                      a[dartx._set](k, a[dartx._get](great));
+                      a[dartx._set](great--, ak);
                     }
                     break;
                   }
@@ -8435,49 +8631,49 @@
             }
           }
         }
-        a[dartx.set](left, a[dartx.get](less - 1));
-        a[dartx.set](less - 1, pivot1);
-        a[dartx.set](right, a[dartx.get](great + 1));
-        a[dartx.set](great + 1, pivot2);
+        a[dartx._set](left, a[dartx._get](less - 1));
+        a[dartx._set](less - 1, pivot1);
+        a[dartx._set](right, a[dartx._get](great + 1));
+        a[dartx._set](great + 1, pivot2);
         _internal.Sort._doSort(E)(a, left, less - 2, compare);
         _internal.Sort._doSort(E)(a, great + 2, right, compare);
         if (pivots_are_equal) {
           return;
         }
         if (less < index1 && great > index5) {
-          while (compare(a[dartx.get](less), pivot1) == 0) {
+          while (compare(a[dartx._get](less), pivot1) == 0) {
             less++;
           }
-          while (compare(a[dartx.get](great), pivot2) == 0) {
+          while (compare(a[dartx._get](great), pivot2) == 0) {
             great--;
           }
           for (let k = less; k <= great; k++) {
-            let ak = a[dartx.get](k);
+            let ak = a[dartx._get](k);
             let comp_pivot1 = compare(ak, pivot1);
             if (comp_pivot1 == 0) {
               if (k != less) {
-                a[dartx.set](k, a[dartx.get](less));
-                a[dartx.set](less, ak);
+                a[dartx._set](k, a[dartx._get](less));
+                a[dartx._set](less, ak);
               }
               less++;
             } else {
               let comp_pivot2 = compare(ak, pivot2);
               if (comp_pivot2 == 0) {
                 while (true) {
-                  let comp = compare(a[dartx.get](great), pivot2);
+                  let comp = compare(a[dartx._get](great), pivot2);
                   if (comp == 0) {
                     great--;
                     if (great < k) break;
                     continue;
                   } else {
-                    comp = compare(a[dartx.get](great), pivot1);
+                    comp = compare(a[dartx._get](great), pivot1);
                     if (dart.notNull(comp) < 0) {
-                      a[dartx.set](k, a[dartx.get](less));
-                      a[dartx.set](less++, a[dartx.get](great));
-                      a[dartx.set](great--, ak);
+                      a[dartx._set](k, a[dartx._get](less));
+                      a[dartx._set](less++, a[dartx._get](great));
+                      a[dartx._set](great--, ak);
                     } else {
-                      a[dartx.set](k, a[dartx.get](great));
-                      a[dartx.set](great--, ak);
+                      a[dartx._set](k, a[dartx._get](great));
+                      a[dartx._set](great--, ak);
                     }
                     break;
                   }
@@ -8505,18 +8701,26 @@
   });
   _internal.Sort._INSERTION_SORT_THRESHOLD = 32;
   const _name = Symbol('_name');
+  const _nativeSymbol = Symbol('_nativeSymbol');
   _internal.Symbol = class Symbol extends core.Object {
     new(name) {
       this[_name] = name;
+      this[_nativeSymbol] = null;
+    }
+    es6(name, nativeSymbol) {
+      this[_name] = name;
+      this[_nativeSymbol] = nativeSymbol;
     }
     unvalidated(name) {
       this[_name] = name;
+      this[_nativeSymbol] = null;
     }
     validated(name) {
       this[_name] = _internal.Symbol.validatePublicSymbol(name);
+      this[_nativeSymbol] = null;
     }
     ['=='](other) {
-      return _internal.Symbol.is(other) && this[_name] == other[_name];
+      return _internal.Symbol.is(other) && this[_name] == other[_name] && dart.equals(this[_nativeSymbol], other[_nativeSymbol]);
     }
     get hashCode() {
       let hash = this._hashCode;
@@ -8532,6 +8736,9 @@
     static getName(symbol) {
       return symbol[_name];
     }
+    static getNativeSymbol(symbol) {
+      return symbol[_nativeSymbol];
+    }
     static validatePublicSymbol(name) {
       if (dart.test(name[dartx.isEmpty]) || dart.test(_internal.Symbol.publicSymbolPattern.hasMatch(name))) return name;
       if (dart.test(name[dartx.startsWith]('_'))) {
@@ -8543,16 +8750,21 @@
       return dart.test(name[dartx.isEmpty]) || dart.test(_internal.Symbol.symbolPattern.hasMatch(name));
     }
   };
+  dart.defineNamedConstructor(_internal.Symbol, 'es6');
   dart.defineNamedConstructor(_internal.Symbol, 'unvalidated');
   dart.defineNamedConstructor(_internal.Symbol, 'validated');
   _internal.Symbol[dart.implements] = () => [core.Symbol];
   dart.setSignature(_internal.Symbol, {
     constructors: () => ({
       new: dart.definiteFunctionType(_internal.Symbol, [core.String]),
+      es6: dart.definiteFunctionType(_internal.Symbol, [core.String, dart.dynamic]),
       unvalidated: dart.definiteFunctionType(_internal.Symbol, [core.String]),
       validated: dart.definiteFunctionType(_internal.Symbol, [core.String])
     }),
-    fields: () => ({[_name]: core.String}),
+    fields: () => ({
+      [_name]: core.String,
+      [_nativeSymbol]: dart.dynamic
+    }),
     methods: () => ({'==': dart.definiteFunctionType(core.bool, [core.Object])}),
     sfields: () => ({
       reservedWordRE: core.String,
@@ -8564,10 +8776,11 @@
     }),
     statics: () => ({
       getName: dart.definiteFunctionType(core.String, [_internal.Symbol]),
+      getNativeSymbol: dart.definiteFunctionType(dart.dynamic, [_internal.Symbol]),
       validatePublicSymbol: dart.definiteFunctionType(core.String, [core.String]),
       isValidSymbol: dart.definiteFunctionType(core.bool, [core.String])
     }),
-    names: ['getName', 'validatePublicSymbol', 'isValidSymbol']
+    names: ['getName', 'getNativeSymbol', 'validatePublicSymbol', 'isValidSymbol']
   });
   _internal.Symbol.reservedWordRE = '(?:assert|break|c(?:a(?:se|tch)|lass|on(?:st|tinue))|d(?:efault|o)|' + 'e(?:lse|num|xtends)|f(?:alse|inal(?:ly)?|or)|i[fns]|n(?:ew|ull)|' + 'ret(?:hrow|urn)|s(?:uper|witch)|t(?:h(?:is|row)|r(?:ue|y))|' + 'v(?:ar|oid)|w(?:hile|ith))';
   _internal.Symbol.operatorRE = '(?:[\\-+*/%&|^]|\\[\\]=?|==|~/?|<[<=]?|>[>=]?|unary-)';
@@ -8852,8 +9065,8 @@
         return;
       }
       let message = core.List.new(2);
-      message[dartx.set](0, dart.toString(error));
-      message[dartx.set](1, stackTrace == null ? null : dart.toString(stackTrace));
+      message[dartx._set](0, dart.toString(error));
+      message[dartx._set](1, stackTrace == null ? null : dart.toString(stackTrace));
       for (let port of this.errorPorts)
         port.send(message);
     }
@@ -8941,13 +9154,13 @@
       }
     }
     lookup(portId) {
-      return this.ports[dartx.get](portId);
+      return this.ports[dartx._get](portId);
     }
     [_addRegistration](portId, port) {
       if (dart.test(this.ports[dartx.containsKey](portId))) {
         dart.throw(core.Exception.new("Registry: ports must be registered only once."));
       }
-      this.ports[dartx.set](portId, port);
+      this.ports[dartx._set](portId, port);
     }
     register(portId, port) {
       this[_addRegistration](portId, port);
@@ -8959,7 +9172,7 @@
     }
     [_updateGlobalState]() {
       if (dart.notNull(this.ports[dartx.length]) - dart.notNull(this.weakPorts.length) > 0 || dart.test(this.isPaused) || !dart.test(this.initialized)) {
-        _isolate_helper._globalState.isolates[dartx.set](this.id, this);
+        _isolate_helper._globalState.isolates[dartx._set](this.id, this);
       } else {
         this.kill();
       }
@@ -9244,7 +9457,7 @@
         }
         case 'close':
         {
-          _isolate_helper._globalState.managers[dartx.remove](_isolate_helper.IsolateNatives.workerIds.get(sender));
+          _isolate_helper._globalState.managers[dartx.remove](_isolate_helper.IsolateNatives.workerIds._get(sender));
           sender.terminate();
           _isolate_helper._globalState.topEventLoop.run();
           break;
@@ -9407,8 +9620,8 @@
       let o = _isolate_helper._globalState;
       let workerId = o.nextManagerId;
       o.nextManagerId = dart.notNull(workerId) + 1;
-      _isolate_helper.IsolateNatives.workerIds.set(worker, workerId);
-      _isolate_helper._globalState.managers[dartx.set](workerId, worker);
+      _isolate_helper.IsolateNatives.workerIds._set(worker, workerId);
+      _isolate_helper._globalState.managers[dartx._set](workerId, worker);
       worker.postMessage(_isolate_helper._serializeMessage(dart.map({command: 'start', id: workerId, replyTo: _isolate_helper._serializeMessage(replyPort), args: args, msg: _isolate_helper._serializeMessage(message), isSpawnUri: isSpawnUri, startPaused: startPaused, functionName: functionName}, core.String, core.Object)));
     }
     static workerOnError(event, uri, onError) {
@@ -9491,7 +9704,7 @@
       super.new(isolateId);
     }
     send(message) {
-      let isolate = _isolate_helper._globalState.isolates[dartx.get](this[_isolateId]);
+      let isolate = _isolate_helper._globalState.isolates[dartx._get](this[_isolateId]);
       if (isolate == null) return;
       if (dart.test(this[_receivePort][_isClosed])) return;
       let msg = _isolate_helper._clone(message);
@@ -9531,7 +9744,7 @@
       if (dart.test(_isolate_helper._globalState.isWorker)) {
         _isolate_helper._globalState.mainManager.postMessage(workerMessage);
       } else {
-        let manager = _isolate_helper._globalState.managers[dartx.get](this[_workerId]);
+        let manager = _isolate_helper._globalState.managers[dartx._get](this[_workerId]);
         if (manager != null) {
           manager.postMessage(workerMessage);
         }
@@ -10569,10 +10782,10 @@
     }
     serialize(x) {
       if (dart.test(this.isPrimitive(x))) return this.serializePrimitive(x);
-      let serializationId = this.serializedObjectIds[dartx.get](x);
+      let serializationId = this.serializedObjectIds[dartx._get](x);
       if (serializationId != null) return this.makeRef(serializationId);
       serializationId = this.serializedObjectIds[dartx.length];
-      this.serializedObjectIds[dartx.set](x, serializationId);
+      this.serializedObjectIds[dartx._set](x, serializationId);
       if (_native_typed_data.NativeByteBuffer.is(x)) return this.serializeByteBuffer(x);
       if (_native_typed_data.NativeTypedData.is(x)) return this.serializeTypedData(x);
       if (_interceptors.JSIndexable.is(x)) return this.serializeJSIndexable(x);
@@ -10621,13 +10834,13 @@
       let serialized = [];
       serialized[dartx.length] = x[dartx.length];
       for (let i = 0; i < dart.notNull(x[dartx.length]); i++) {
-        serialized[dartx.set](i, this.serialize(x[dartx.get](i)));
+        serialized[dartx._set](i, this.serialize(x[dartx._get](i)));
       }
       return serialized;
     }
     serializeArrayInPlace(x) {
       for (let i = 0; i < dart.notNull(x[dartx.length]); i++) {
-        x[dartx.set](i, this.serialize(x[dartx.get](i)));
+        x[dartx._set](i, this.serialize(x[dartx._get](i)));
       }
       return x;
     }
@@ -10643,7 +10856,7 @@
       let values = [];
       values[dartx.length] = keys[dartx.length];
       for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-        values[dartx.set](i, this.serialize(x[keys[dartx.get](i)]));
+        values[dartx._set](i, this.serialize(x[keys[dartx._get](i)]));
       }
       return JSArrayOfObject().of(['js-object', keys, values]);
     }
@@ -10782,7 +10995,7 @@
     deserializeRef(x) {
       dart.assert(dart.equals(dart.dindex(x, 0), 'ref'));
       let serializationId = core.int._check(dart.dindex(x, 1));
-      return this.deserializedObjects[dartx.get](serializationId);
+      return this.deserializedObjects[dartx._get](serializationId);
     }
     deserializeByteBuffer(x) {
       dart.assert(dart.equals(dart.dindex(x, 0), 'buffer'));
@@ -10798,7 +11011,7 @@
     }
     deserializeArrayInPlace(x) {
       for (let i = 0; i < dart.notNull(x[dartx.length]); i++) {
-        x[dartx.set](i, this.deserialize(x[dartx.get](i)));
+        x[dartx._set](i, this.deserialize(x[dartx._get](i)));
       }
       return x;
     }
@@ -10827,14 +11040,14 @@
       return _interceptors.JSArray.markFixed(this.deserializeArrayInPlace(_interceptors.JSArray._check(result)));
     }
     deserializeMap(x) {
-      dart.assert(dart.equals(x.get(0), 'map'));
-      let keys = core.List._check(x.get(1));
-      let values = core.List._check(x.get(2));
+      dart.assert(dart.equals(x._get(0), 'map'));
+      let keys = core.List._check(x._get(1));
+      let values = core.List._check(x._get(2));
       let result = dart.map();
       this.deserializedObjects[dartx.add](result);
       keys = keys[dartx.map](dart.dynamic)(dart.bind(this, 'deserialize'))[dartx.toList]();
       for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-        result[dartx.set](keys[dartx.get](i), this.deserialize(values[dartx.get](i)));
+        result[dartx._set](keys[dartx._get](i), this.deserialize(values[dartx._get](i)));
       }
       return result;
     }
@@ -10845,7 +11058,7 @@
       let receivePortId = core.int._check(dart.dindex(x, 3));
       let result = null;
       if (managerId == _isolate_helper._globalState.currentManagerId) {
-        let isolate = _isolate_helper._globalState.isolates[dartx.get](isolateId);
+        let isolate = _isolate_helper._globalState.isolates[dartx._get](isolateId);
         if (isolate == null) return null;
         let receivePort = isolate.lookup(receivePortId);
         if (receivePort == null) return null;
@@ -10869,7 +11082,7 @@
       let o = {};
       this.deserializedObjects[dartx.add](o);
       for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-        o[keys[dartx.get](i)] = this.deserialize(values[dartx.get](i));
+        o[keys[dartx._get](i)] = this.deserialize(values[dartx._get](i));
       }
       return o;
     }
@@ -10993,12 +11206,12 @@
       if (match == null) {
         return _js_helper.Primitives._parseIntError(source, handleError);
       }
-      let decimalMatch = match[dartx.get](decimalIndex);
+      let decimalMatch = match[dartx._get](decimalIndex);
       if (radix == null) {
         if (decimalMatch != null) {
           return parseInt(source, 10);
         }
-        if (match[dartx.get](hexIndex) != null) {
+        if (match[dartx._get](hexIndex) != null) {
           return parseInt(source, 16);
         }
         return _js_helper.Primitives._parseIntError(source, handleError);
@@ -11019,7 +11232,7 @@
         } else {
           maxCharCode = 97 - 10 - 1 + dart.notNull(radix);
         }
-        dart.assert(typeof match[dartx.get](digitsIndex) == 'string');
+        dart.assert(typeof match[dartx._get](digitsIndex) == 'string');
         let digitsPart = match[digitsIndex];
         for (let i = 0; i < dart.notNull(digitsPart[dartx.length]); i++) {
           let characterCode = (dart.notNull(digitsPart[dartx.codeUnitAt](i)) | 32) >>> 0;
@@ -11157,11 +11370,11 @@
     static getTimeZoneName(receiver) {
       let d = _js_helper.Primitives.lazyAsJsDate(receiver);
       let match = /\((.*)\)/.exec(d.toString());
-      if (match != null) return core.String._check(match[dartx.get](1));
+      if (match != null) return core.String._check(match[dartx._get](1));
       match = /^[A-Z,a-z]{3}\s[A-Z,a-z]{3}\s\d+\s\d{2}:\d{2}:\d{2}\s([A-Z]{3,5})\s\d{4}$/.exec(d.toString());
-      if (match != null) return core.String._check(match[dartx.get](1));
+      if (match != null) return core.String._check(match[dartx._get](1));
       match = /(?:GMT|UTC)[+-]\d{4}/.exec(d.toString());
-      if (match != null) return core.String._check(match[dartx.get](0));
+      if (match != null) return core.String._check(match[dartx._get](0));
       return "";
     }
     static getTimeZoneOffsetInMinutes(receiver) {
@@ -11513,7 +11726,7 @@
     while (index < dart.notNull(length)) {
       let key = _js_helper.getIndex(keyValuePairs, index++);
       let value = _js_helper.getIndex(keyValuePairs, index++);
-      result[dartx.set](key, value);
+      result[dartx._set](key, value);
     }
     return result;
   };
@@ -11557,7 +11770,7 @@
     constructors: () => ({new: dart.definiteFunctionType(_js_helper.JSName, [core.String])}),
     fields: () => ({name: core.String})
   });
-  _js_helper.JavaScriptIndexingBehavior = class JavaScriptIndexingBehavior extends _interceptors.JSMutableIndexable {};
+  _js_helper.JavaScriptIndexingBehavior = class JavaScriptIndexingBehavior extends core.Object {};
   _js_helper.TypeErrorImplementation = class TypeErrorImplementation extends core.Error {
     new(value, actualType, expectedType) {
       this.message = dart.str`Type '${actualType}' is not a subtype ` + dart.str`of type '${expectedType}'`;
@@ -11917,7 +12130,7 @@
         return new (LinkedHashMapKeyIterableOfK())(this);
       }
       get values() {
-        return MappedIterableOfK$V().new(this.keys, dart.fn(each => this.get(each), KToV()));
+        return MappedIterableOfK$V().new(this.keys, dart.fn(each => this._get(each), KToV()));
       }
       containsKey(key) {
         if (dart.test(_js_helper.JsLinkedHashMap._isStringKey(key))) {
@@ -11939,15 +12152,15 @@
         return dart.notNull(this.internalFindBucketIndex(bucket, key)) >= 0;
       }
       containsValue(value) {
-        return this.keys[dartx.any](dart.fn(each => dart.equals(this.get(each), value), KTobool()));
+        return this.keys[dartx.any](dart.fn(each => dart.equals(this._get(each), value), KTobool()));
       }
       addAll(other) {
         MapOfK$V()._check(other);
         other[dartx.forEach](dart.fn((key, value) => {
-          this.set(key, value);
+          this._set(key, value);
         }, KAndVTovoid$()));
       }
-      get(key) {
+      _get(key) {
         if (dart.test(_js_helper.JsLinkedHashMap._isStringKey(key))) {
           let strings = this[_strings];
           if (strings == null) return null;
@@ -11971,7 +12184,7 @@
         let cell = bucket[index];
         return cell.hashMapCellValue;
       }
-      set(key, value) {
+      _set(key, value) {
         K._check(key);
         V._check(value);
         if (dart.test(_js_helper.JsLinkedHashMap._isStringKey(key))) {
@@ -12011,9 +12224,9 @@
       putIfAbsent(key, ifAbsent) {
         K._check(key);
         VoidToV()._check(ifAbsent);
-        if (dart.test(this.containsKey(key))) return this.get(key);
+        if (dart.test(this.containsKey(key))) return this._get(key);
         let value = ifAbsent();
-        this.set(key, value);
+        this._set(key, value);
         return value;
       }
       remove(key) {
@@ -12186,9 +12399,9 @@
         internalContainsKey: dart.definiteFunctionType(core.bool, [core.Object]),
         containsValue: dart.definiteFunctionType(core.bool, [core.Object]),
         addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
-        get: dart.definiteFunctionType(V, [core.Object]),
+        _get: dart.definiteFunctionType(V, [core.Object]),
         internalGet: dart.definiteFunctionType(V, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         internalSet: dart.definiteFunctionType(dart.void, [K, V]),
         putIfAbsent: dart.definiteFunctionType(V, [K, VoidToV()]),
         remove: dart.definiteFunctionType(V, [core.Object]),
@@ -12220,8 +12433,8 @@
       'containsKey',
       'containsValue',
       'addAll',
-      'get',
-      'set',
+      '_get',
+      '_set',
       'putIfAbsent',
       'remove',
       'clear',
@@ -12508,7 +12721,7 @@
       regexp.lastIndex = start;
       let match = regexp.exec(string);
       if (match == null) return null;
-      if (match[dartx.get](dart.notNull(match[dartx.length]) - 1) != null) return null;
+      if (match[dartx._get](dart.notNull(match[dartx.length]) - 1) != null) return null;
       match[dartx.length] = dart.notNull(match[dartx.length]) - 1;
       return new _js_helper._MatchImplementation(this, ListOfString()._check(match));
     }
@@ -12571,12 +12784,12 @@
       return this[_match].index;
     }
     get end() {
-      return dart.notNull(this.start) + dart.notNull(this[_match][dartx.get](0)[dartx.length]);
+      return dart.notNull(this.start) + dart.notNull(this[_match][dartx._get](0)[dartx.length]);
     }
     group(index) {
-      return this[_match][dartx.get](index);
+      return this[_match][dartx._get](index);
     }
-    get(index) {
+    _get(index) {
       return this.group(index);
     }
     get groupCount() {
@@ -12605,7 +12818,7 @@
     }),
     methods: () => ({
       group: dart.definiteFunctionType(core.String, [core.int]),
-      get: dart.definiteFunctionType(core.String, [core.int]),
+      _get: dart.definiteFunctionType(core.String, [core.int]),
       groups: dart.definiteFunctionType(core.List$(core.String), [ListOfint()])
     })
   });
@@ -12707,7 +12920,7 @@
     get end() {
       return dart.notNull(this.start) + dart.notNull(this.pattern[dartx.length]);
     }
-    get(g) {
+    _get(g) {
       return this.group(g);
     }
     get groupCount() {
@@ -12740,7 +12953,7 @@
       groupCount: dart.definiteFunctionType(core.int, [])
     }),
     methods: () => ({
-      get: dart.definiteFunctionType(core.String, [core.int]),
+      _get: dart.definiteFunctionType(core.String, [core.int]),
       group: dart.definiteFunctionType(core.String, [core.int]),
       groups: dart.definiteFunctionType(core.List$(core.String), [ListOfint()])
     })
@@ -12863,7 +13076,7 @@
           let length = receiver[dartx.length];
           result.write(replacement);
           for (let i = 0; i < dart.notNull(length); i++) {
-            result.write(receiver[dartx.get](i));
+            result.write(receiver[dartx._get](i));
             result.write(replacement);
           }
           return result.toString();
@@ -12883,7 +13096,7 @@
   };
   dart.lazyFn(_js_helper.stringReplaceAllUnchecked, () => StringAndPatternAndStringToString());
   _js_helper._matchString = function(match) {
-    return match.get(0);
+    return match._get(0);
   };
   dart.lazyFn(_js_helper._matchString, () => MatchToString$());
   _js_helper._stringIdentity = function(string) {
@@ -12926,7 +13139,7 @@
           continue;
         }
       }
-      buffer.write(onNonMatch(receiver[dartx.get](i)));
+      buffer.write(onNonMatch(receiver[dartx._get](i)));
       i++;
     }
     buffer.write(onMatch(new _js_helper.StringMatch(i, receiver, "")));
@@ -13078,65 +13291,109 @@
     return _js_mirrors._dart.definiteFunctionType(type, []);
   };
   dart.fn(_js_mirrors._defaultConstructorType, dynamicTodynamic$());
+  _js_mirrors._getMixins = function(type) {
+    return _js_mirrors._dart.getMixins(type, []);
+  };
+  dart.fn(_js_mirrors._getMixins, dynamicTodynamic$());
   _js_mirrors._Lazy$ = dart.generic(T => {
     const _Lazy = dart.typedef('_Lazy', () => dart.functionType(T, []));
     return _Lazy;
   });
   _js_mirrors._Lazy = _Lazy();
+  _js_mirrors._getESSymbol = function(symbol) {
+    return _internal.Symbol.getNativeSymbol(_internal.Symbol.as(symbol));
+  };
+  dart.lazyFn(_js_mirrors._getESSymbol, () => SymbolTodynamic());
+  _js_mirrors._getMember = function(symbol) {
+    let privateSymbol = _js_mirrors._getESSymbol(symbol);
+    if (privateSymbol != null) {
+      return privateSymbol;
+    }
+    return _js_mirrors.getName(symbol);
+  };
+  dart.lazyFn(_js_mirrors._getMember, () => SymbolTodynamic());
+  _js_mirrors._getNameForESSymbol = function(member) {
+    dart.assert(typeof member == "symbol");
+    let str = dart.toString(member);
+    dart.assert(dart.test(str[dartx.startsWith]('Symbol(')) && dart.test(str[dartx.endsWith](')')));
+    return str[dartx.substring](7, dart.notNull(str[dartx.length]) - 1);
+  };
+  dart.lazyFn(_js_mirrors._getNameForESSymbol, () => dynamicToString());
+  _js_mirrors._getSymbolForESSymbol = function(member) {
+    let name = _js_mirrors._getNameForESSymbol(member);
+    return new _internal.Symbol.es6(name, member);
+  };
+  dart.lazyFn(_js_mirrors._getSymbolForESSymbol, () => dynamicToSymbol());
+  _js_mirrors._getSymbolForMember = function(member) {
+    if (typeof member == 'string') {
+      return core.Symbol.new(member);
+    } else {
+      let name = _js_mirrors._getNameForESSymbol(member);
+      return new _internal.Symbol.es6(name, member);
+    }
+  };
+  dart.lazyFn(_js_mirrors._getSymbolForMember, () => dynamicToSymbol());
+  _js_mirrors._toDartMap = function(data) {
+    if (data == null) return dart.map({}, core.Symbol, dart.dynamic);
+    let map = MapOfSymbol$dynamic().new();
+    let publicMembers = Object.getOwnPropertyNames(data);
+    for (let member of core.Iterable._check(publicMembers)) {
+      let symbol = core.Symbol.new(core.String._check(member));
+      map[dartx._set](symbol, data[member]);
+    }
+    let privateMembers = Object.getOwnPropertySymbols(data);
+    for (let member of core.Iterable._check(privateMembers)) {
+      let symbol = _js_mirrors._getSymbolForESSymbol(member);
+      map[dartx._set](symbol, data[member]);
+    }
+    return map;
+  };
+  dart.lazyFn(_js_mirrors._toDartMap, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getConstructors = function(obj) {
     let sig = _js_mirrors._dart.getConstructorSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getConstructors, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getConstructors, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getFields = function(obj) {
     let sig = _js_mirrors._dart.getFieldSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getFields, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getFields, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getMethods = function(obj) {
     let sig = _js_mirrors._dart.getMethodSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getMethods, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getMethods, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getGetters = function(obj) {
     let sig = _js_mirrors._dart.getGetterSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getGetters, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getGetters, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getSetters = function(obj) {
     let sig = _js_mirrors._dart.getSetterSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getSetters, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getSetters, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getStaticFields = function(obj) {
     let sig = _js_mirrors._dart.getStaticFieldSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getStaticFields, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getStaticFields, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getStatics = function(obj) {
     let sig = _js_mirrors._dart.getStaticSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getStatics, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getStatics, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getStaticGetters = function(obj) {
     let sig = _js_mirrors._dart.getStaticGetterSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getStaticGetters, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getStaticGetters, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getStaticSetters = function(obj) {
     let sig = _js_mirrors._dart.getStaticSetterSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getStaticSetters, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getStaticSetters, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._unwrap = function(obj) {
     return _js_mirrors._dart.unwrapType(obj);
   };
@@ -13145,10 +13402,22 @@
     return _js_mirrors._dart.wrapType(obj);
   };
   dart.fn(_js_mirrors._wrap, dynamicTodynamic$());
+  _js_mirrors._runtimeType = function(obj) {
+    return _js_mirrors._wrap(_js_mirrors._dart.getReifiedType(obj));
+  };
+  dart.fn(_js_mirrors._runtimeType, dynamicTodynamic$());
   _js_mirrors._unimplemented = function(t, i) {
-    dart.throw(new core.UnimplementedError(dart.str`${t}.${i.memberName} unimplemented`));
+    dart.throw(new core.UnimplementedError(dart.str`${t}.${_js_mirrors.getName(i.memberName)} unimplemented`));
   };
   dart.fn(_js_mirrors._unimplemented, TypeAndInvocationTodynamic());
+  _js_mirrors._toJsMap = function(map) {
+    let obj = {};
+    map[dartx.forEach](dart.fn((key, value) => {
+      obj[_js_mirrors.getName(key)] = value;
+    }, SymbolAnddynamicTovoid()));
+    return obj;
+  };
+  dart.lazyFn(_js_mirrors._toJsMap, () => MapOfSymbol$dynamicTodynamic());
   _js_mirrors.JsMirror = class JsMirror extends core.Object {
     noSuchMethod(i) {
       _js_mirrors._unimplemented(this.runtimeType, i);
@@ -13242,14 +13511,14 @@
     }
   };
   _js_mirrors.JsObjectMirror[dart.implements] = () => [mirrors.ObjectMirror];
-  const _toJsMap = Symbol('_toJsMap');
+  const _getAccessor = Symbol('_getAccessor');
   _js_mirrors.JsInstanceMirror = class JsInstanceMirror extends _js_mirrors.JsObjectMirror {
     get hasReflectee() {
       return true;
     }
     get type() {
       if (this.reflectee == null) return mirrors.reflectClass(dart.wrapType(core.Null));
-      return mirrors.ClassMirror._check(_js_mirrors.reflectType(core.Type._check(dart.runtimeType(this.reflectee))));
+      return mirrors.ClassMirror._check(_js_mirrors.reflectType(core.Type._check(_js_mirrors._runtimeType(this.reflectee))));
     }
     _(reflectee) {
       this.reflectee = reflectee;
@@ -13260,32 +13529,33 @@
     get hashCode() {
       return (dart.notNull(core.identityHashCode(this.reflectee)) ^ 909522486) >>> 0;
     }
+    [_getAccessor](reflectee, symbol, args, namedArgs) {
+      if (args === void 0) args = null;
+      if (namedArgs === void 0) namedArgs = null;
+      return _js_mirrors._getMember(symbol);
+    }
     getField(symbol) {
-      let name = _js_mirrors.getName(symbol);
-      let field = _js_mirrors._dload(this.reflectee, name);
+      let name = this[_getAccessor](this.reflectee, symbol);
+      let field = _js_mirrors._dload(this.reflectee, core.String._check(name));
       return _js_mirrors.reflect(field);
     }
     setField(symbol, value) {
-      let name = _js_mirrors.getName(symbol);
-      _js_mirrors._dput(this.reflectee, name, value);
+      let name = this[_getAccessor](this.reflectee, symbol);
+      _js_mirrors._dput(this.reflectee, core.String._check(name), value);
       return _js_mirrors.reflect(value);
     }
     invoke(symbol, args, namedArgs) {
       if (namedArgs === void 0) namedArgs = null;
-      let name = _js_mirrors.getName(symbol);
+      let name = this[_getAccessor](this.reflectee, symbol, args, namedArgs);
       if (namedArgs != null) {
         args = core.List.from(args);
-        args[dartx.add](this[_toJsMap](namedArgs));
+        args[dartx.add](_js_mirrors._toJsMap(namedArgs));
       }
-      let result = _js_mirrors._dsend(this.reflectee, name, args);
+      let result = _js_mirrors._dsend(this.reflectee, core.String._check(name), args);
       return _js_mirrors.reflect(result);
     }
-    [_toJsMap](map) {
-      let obj = {};
-      map[dartx.forEach](dart.fn((key, value) => {
-        obj[_js_mirrors.getName(key)] = value;
-      }, SymbolAnddynamicTovoid()));
-      return obj;
+    toString() {
+      return dart.str`InstanceMirror on '${this.reflectee}'`;
     }
     delegate(...args) {
       return this.noSuchMethod(new dart.InvocationImpl('delegate', args, {isMethod: true}));
@@ -13302,10 +13572,10 @@
     }),
     methods: () => ({
       '==': dart.definiteFunctionType(core.bool, [core.Object]),
+      [_getAccessor]: dart.definiteFunctionType(dart.dynamic, [dart.dynamic, core.Symbol], [core.List, MapOfSymbol$dynamic()]),
       getField: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol]),
       setField: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.Object]),
-      invoke: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.List], [MapOfSymbol$dynamic()]),
-      [_toJsMap]: dart.definiteFunctionType(dart.dynamic, [MapOfSymbol$dynamic()])
+      invoke: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.List], [MapOfSymbol$dynamic()])
     })
   });
   _js_mirrors.JsClosureMirror = class JsClosureMirror extends _js_mirrors.JsInstanceMirror {
@@ -13316,7 +13586,7 @@
       if (namedArgs === void 0) namedArgs = null;
       if (namedArgs != null) {
         args = core.List.from(args);
-        args[dartx.add](this[_toJsMap](namedArgs));
+        args[dartx.add](_js_mirrors._toJsMap(namedArgs));
       }
       let result = _js_mirrors._dcall(this.reflectee, args);
       return _js_mirrors.reflect(result);
@@ -13339,12 +13609,14 @@
   let const$0;
   const _declarations = Symbol('_declarations');
   const _raw = Symbol('_raw');
+  const _mixin = Symbol('_mixin');
   const _typeArguments = Symbol('_typeArguments');
   let const$1;
   _js_mirrors.JsClassMirror = class JsClassMirror extends _js_mirrors.JsMirror {
     get metadata() {
       if (this[_metadata$] == null) {
-        let fn = _js_mirrors._unwrap(this[_cls])[dart.metadata];
+        let unwrapped = _js_mirrors._unwrap(this[_cls]);
+        let fn = Object.hasOwnProperty.call(unwrapped, dart.metadata) ? unwrapped[dart.metadata] : null;
         this[_metadata$] = fn == null ? const$0 || (const$0 = dart.constList([], mirrors.InstanceMirror)) : ListOfInstanceMirror().unmodifiable(core.Iterable._check(dart.dsend(dart.dcall(fn), 'map', dart.fn(i => _js_mirrors.reflect(i), dynamicToInstanceMirror()))));
       }
       return this[_metadata$];
@@ -13354,67 +13626,66 @@
         this[_declarations] = MapOfSymbol$DeclarationMirror().new();
         let unwrapped = _js_mirrors._unwrap(this[_cls]);
         let constructors = _js_mirrors._getConstructors(unwrapped);
-        constructors[dartx.forEach](dart.fn((name, ft) => {
-          let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._constructor(this, name, ft));
-        }, StringAnddynamicTovoid()));
+        constructors[dartx.forEach](dart.fn((symbol, ft) => {
+          let name = _js_mirrors.getName(symbol);
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._constructor(this, symbol, ft));
+        }, SymbolAnddynamicTovoid()));
         if (dart.test(constructors[dartx.isEmpty])) {
           let name = 'new';
           let ft = _js_mirrors._defaultConstructorType(_js_mirrors._unwrap(this[_cls]));
           let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._constructor(this, name, ft));
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._constructor(this, symbol, ft));
         }
         let fields = _js_mirrors._getFields(unwrapped);
-        fields[dartx.forEach](dart.fn((name, t) => {
-          let symbol = core.Symbol.new(name);
+        fields[dartx.forEach](dart.fn((symbol, t) => {
           let metadata = [];
           if (core.List.is(t)) {
             metadata = core.List._check(dart.dsend(dart.dsend(t, 'skip', 1), 'toList'));
             t = dart.dindex(t, 0);
           }
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsVariableMirror._(name, core.Type._check(_js_mirrors._wrap(t)), metadata));
-        }, StringAnddynamicTovoid()));
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsVariableMirror._(symbol, core.Type._check(_js_mirrors._wrap(t)), metadata));
+        }, SymbolAnddynamicTovoid()));
         let methods = _js_mirrors._getMethods(unwrapped);
-        methods[dartx.forEach](dart.fn((name, ft) => {
-          let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, name, ft));
-        }, StringAnddynamicTovoid()));
+        methods[dartx.forEach](dart.fn((symbol, ft) => {
+          let name = _js_mirrors.getName(symbol);
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, symbol, ft));
+        }, SymbolAnddynamicTovoid()));
         let getters = _js_mirrors._getGetters(unwrapped);
-        getters[dartx.forEach](dart.fn((name, ft) => {
-          let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, name, ft));
-        }, StringAnddynamicTovoid()));
+        getters[dartx.forEach](dart.fn((symbol, ft) => {
+          let name = _js_mirrors.getName(symbol);
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, symbol, ft));
+        }, SymbolAnddynamicTovoid()));
         let setters = _js_mirrors._getSetters(unwrapped);
-        setters[dartx.forEach](dart.fn((name, ft) => {
-          name = dart.notNull(name) + '=';
-          let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, name, ft));
-        }, StringAnddynamicTovoid()));
+        setters[dartx.forEach](dart.fn((symbol, ft) => {
+          let name = dart.notNull(_js_mirrors.getName(symbol)) + '=';
+          symbol = new _internal.Symbol.es6(name, _js_mirrors._getESSymbol(symbol));
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, symbol, ft));
+        }, SymbolAnddynamicTovoid()));
         let staticFields = _js_mirrors._getStaticFields(unwrapped);
-        staticFields[dartx.forEach](dart.fn((name, t) => {
-          let symbol = core.Symbol.new(name);
+        staticFields[dartx.forEach](dart.fn((symbol, t) => {
+          let name = _js_mirrors.getName(symbol);
           let metadata = [];
           if (core.List.is(t)) {
             metadata = core.List._check(dart.dsend(dart.dsend(t, 'skip', 1), 'toList'));
             t = dart.dindex(t, 0);
           }
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsVariableMirror._(name, core.Type._check(_js_mirrors._wrap(t)), metadata));
-        }, StringAnddynamicTovoid()));
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsVariableMirror._(symbol, core.Type._check(_js_mirrors._wrap(t)), metadata));
+        }, SymbolAnddynamicTovoid()));
         let statics = _js_mirrors._getStatics(unwrapped);
-        statics[dartx.forEach](dart.fn((name, ft) => {
-          let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, name, ft));
-        }, StringAnddynamicTovoid()));
+        statics[dartx.forEach](dart.fn((symbol, ft) => {
+          let name = _js_mirrors.getName(symbol);
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, symbol, ft));
+        }, SymbolAnddynamicTovoid()));
         let staticGetters = _js_mirrors._getStaticGetters(unwrapped);
-        staticGetters[dartx.forEach](dart.fn((name, ft) => {
-          let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, name, ft));
-        }, StringAnddynamicTovoid()));
+        staticGetters[dartx.forEach](dart.fn((symbol, ft) => {
+          let name = _js_mirrors.getName(symbol);
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, symbol, ft));
+        }, SymbolAnddynamicTovoid()));
         let staticSetters = _js_mirrors._getStaticSetters(unwrapped);
-        staticSetters[dartx.forEach](dart.fn((name, ft) => {
-          let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, name, ft));
-        }, StringAnddynamicTovoid()));
+        staticSetters[dartx.forEach](dart.fn((symbol, ft) => {
+          let name = _js_mirrors.getName(symbol);
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, symbol, ft));
+        }, SymbolAnddynamicTovoid()));
         this[_declarations] = MapOfSymbol$DeclarationMirror().unmodifiable(this[_declarations]);
       }
       return this[_declarations];
@@ -13423,7 +13694,7 @@
       this[_cls] = cls;
       this[_raw] = _js_mirrors._getGenericClass(_js_mirrors._unwrap(cls));
       this.simpleName = core.Symbol.new(_js_mirrors._unwrap(cls).name);
-      this.mixin = null;
+      this[_mixin] = null;
       this[_typeArguments] = null;
       this[_metadata$] = null;
       this[_declarations] = null;
@@ -13441,6 +13712,25 @@
       let instance = name == 'new' || name == '' ? new (_js_mirrors._unwrap(this[_cls]))(...args) : new (_js_mirrors._unwrap(this[_cls]))[name](...args);
       return _js_mirrors.reflect(instance);
     }
+    getField(symbol) {
+      let name = _js_mirrors.getName(symbol);
+      return _js_mirrors.reflect(_js_mirrors._unwrap(this[_cls])[name]);
+    }
+    setField(symbol, value) {
+      let name = _js_mirrors.getName(symbol);
+      _js_mirrors._unwrap(this[_cls])[name] = value;
+      return _js_mirrors.reflect(value);
+    }
+    invoke(symbol, args, namedArgs) {
+      if (namedArgs === void 0) namedArgs = null;
+      let name = _js_mirrors.getName(symbol);
+      if (namedArgs != null) {
+        args = core.List.from(args);
+        args[dartx.add](_js_mirrors._toJsMap(namedArgs));
+      }
+      let result = _js_mirrors._unwrap(this[_cls])[name](...args);
+      return _js_mirrors.reflect(result);
+    }
     get superinterfaces() {
       let interfaceThunk = _js_mirrors._unwrap(this[_cls])[dart.implements];
       if (interfaceThunk == null) {
@@ -13475,6 +13765,24 @@
         return mirrors.ClassMirror._check(_js_mirrors.reflectType(core.Type._check(_js_mirrors._wrap(_js_mirrors._unwrap(this[_cls]).__proto__))));
       }
     }
+    get mixin() {
+      if (this[_mixin] != null) {
+        return this[_mixin];
+      }
+      let mixins = _js_mirrors._getMixins(_js_mirrors._unwrap(this[_cls]));
+      if (mixins == null || dart.test(dart.dload(mixins, 'isEmpty'))) {
+        this[_mixin] = this;
+        return this[_mixin];
+      }
+      if (dart.test(dart.dsend(dart.dload(mixins, 'length'), '>', 1))) {
+        dart.throw(new core.UnsupportedError("ClassMirror.mixin not yet supported for " + dart.str`classes (${this[_cls]}) with multiple mixins`));
+      }
+      this[_mixin] = mirrors.ClassMirror._check(_js_mirrors.reflectType(core.Type._check(_js_mirrors._wrap(dart.dindex(mixins, 0)))));
+      return this[_mixin];
+    }
+    toString() {
+      return dart.str`ClassMirror on '${this[_cls]}'`;
+    }
     get qualifiedName() {
       return core.Symbol._check(this.noSuchMethod(new dart.InvocationImpl('qualifiedName', [], {isGetter: true})));
     }
@@ -13499,15 +13807,6 @@
     get typeVariables() {
       return ListOfTypeVariableMirror()._check(this.noSuchMethod(new dart.InvocationImpl('typeVariables', [], {isGetter: true})));
     }
-    invoke(...args) {
-      return mirrors.InstanceMirror._check(this.noSuchMethod(new dart.InvocationImpl('invoke', args, {isMethod: true})));
-    }
-    getField(...args) {
-      return mirrors.InstanceMirror._check(this.noSuchMethod(new dart.InvocationImpl('getField', args, {isMethod: true})));
-    }
-    setField(...args) {
-      return mirrors.InstanceMirror._check(this.noSuchMethod(new dart.InvocationImpl('setField', args, {isMethod: true})));
-    }
     isSubclassOf(...args) {
       return core.bool._check(this.noSuchMethod(new dart.InvocationImpl('isSubclassOf', args, {isMethod: true})));
     }
@@ -13529,7 +13828,7 @@
       [_cls]: core.Type,
       simpleName: core.Symbol,
       [_raw]: dart.dynamic,
-      mixin: mirrors.ClassMirror,
+      [_mixin]: mirrors.ClassMirror,
       [_typeArguments]: ListOfTypeMirror(),
       [_metadata$]: ListOfInstanceMirror(),
       [_declarations]: MapOfSymbol$DeclarationMirror()
@@ -13543,22 +13842,33 @@
       isOriginalDeclaration: dart.definiteFunctionType(core.bool, []),
       typeArguments: dart.definiteFunctionType(core.List$(mirrors.TypeMirror), []),
       originalDeclaration: dart.definiteFunctionType(mirrors.TypeMirror, []),
-      superclass: dart.definiteFunctionType(mirrors.ClassMirror, [])
+      superclass: dart.definiteFunctionType(mirrors.ClassMirror, []),
+      mixin: dart.definiteFunctionType(mirrors.ClassMirror, [])
     }),
-    methods: () => ({newInstance: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.List], [MapOfSymbol$dynamic()])})
+    methods: () => ({
+      newInstance: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.List], [MapOfSymbol$dynamic()]),
+      getField: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol]),
+      setField: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.Object]),
+      invoke: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.List], [MapOfSymbol$dynamic()])
+    })
   });
+  const _symbol = Symbol('_symbol');
   const _name$ = Symbol('_name');
   _js_mirrors.JsVariableMirror = class JsVariableMirror extends _js_mirrors.JsMirror {
     get simpleName() {
-      return core.Symbol.new(this[_name$]);
+      return this[_symbol];
     }
-    _(name, t, annotations) {
-      this[_name$] = name;
+    _(symbol, t, annotations) {
+      this[_symbol] = symbol;
+      this[_name$] = _js_mirrors.getName(symbol);
       this.type = _js_mirrors.reflectType(t);
       this.metadata = ListOfInstanceMirror().unmodifiable(annotations[dartx.map](mirrors.InstanceMirror)(dart.fn(a => _js_mirrors.reflect(a), dynamicToInstanceMirror())));
       this.isStatic = false;
       this.isFinal = false;
     }
+    toString() {
+      return dart.str`VariableMirror on '${this[_name$]}'`;
+    }
     get qualifiedName() {
       return core.Symbol._check(this.noSuchMethod(new dart.InvocationImpl('qualifiedName', [], {isGetter: true})));
     }
@@ -13581,8 +13891,9 @@
   dart.defineNamedConstructor(_js_mirrors.JsVariableMirror, '_');
   _js_mirrors.JsVariableMirror[dart.implements] = () => [mirrors.VariableMirror];
   dart.setSignature(_js_mirrors.JsVariableMirror, {
-    constructors: () => ({_: dart.definiteFunctionType(_js_mirrors.JsVariableMirror, [core.String, core.Type, core.List])}),
+    constructors: () => ({_: dart.definiteFunctionType(_js_mirrors.JsVariableMirror, [core.Symbol, core.Type, core.List])}),
     fields: () => ({
+      [_symbol]: core.Symbol,
       [_name$]: core.String,
       type: mirrors.TypeMirror,
       metadata: ListOfInstanceMirror(),
@@ -13592,8 +13903,11 @@
     getters: () => ({simpleName: dart.definiteFunctionType(core.Symbol, [])})
   });
   _js_mirrors.JsParameterMirror = class JsParameterMirror extends _js_mirrors.JsVariableMirror {
-    _(name, t, annotations) {
-      super._(name, t, annotations);
+    _(member, t, annotations) {
+      super._(member, t, annotations);
+    }
+    toString() {
+      return dart.str`ParameterMirror on '${this[_name$]}'`;
     }
     get qualifiedName() {
       return core.Symbol._check(this.noSuchMethod(new dart.InvocationImpl('qualifiedName', [], {isGetter: true})));
@@ -13629,7 +13943,7 @@
   dart.defineNamedConstructor(_js_mirrors.JsParameterMirror, '_');
   _js_mirrors.JsParameterMirror[dart.implements] = () => [mirrors.ParameterMirror];
   dart.setSignature(_js_mirrors.JsParameterMirror, {
-    constructors: () => ({_: dart.definiteFunctionType(_js_mirrors.JsParameterMirror, [core.String, core.Type, core.List])})
+    constructors: () => ({_: dart.definiteFunctionType(_js_mirrors.JsParameterMirror, [core.Symbol, core.Type, core.List])})
   });
   const _params = Symbol('_params');
   const _createParameterMirrorList = Symbol('_createParameterMirrorList');
@@ -13644,10 +13958,11 @@
       return this[_name$][dartx.startsWith]('_');
     }
     get simpleName() {
-      return core.Symbol.new(this[_name$]);
+      return this[_symbol];
     }
-    _constructor(cls, name, ftype) {
-      this[_name$] = name;
+    _constructor(cls, symbol, ftype) {
+      this[_symbol] = symbol;
+      this[_name$] = _js_mirrors.getName(symbol);
       this.isConstructor = true;
       this.isStatic = false;
       this[_params] = null;
@@ -13655,8 +13970,9 @@
       this.isFinal = false;
       this[_createParameterMirrorList](ftype);
     }
-    _instanceMethod(cls, name, ftype) {
-      this[_name$] = name;
+    _instanceMethod(cls, symbol, ftype) {
+      this[_symbol] = symbol;
+      this[_name$] = _js_mirrors.getName(symbol);
       this.isConstructor = false;
       this.isStatic = false;
       this[_params] = null;
@@ -13664,8 +13980,9 @@
       this.isFinal = false;
       this[_createParameterMirrorList](ftype);
     }
-    _staticMethod(cls, name, ftype) {
-      this[_name$] = name;
+    _staticMethod(cls, symbol, ftype) {
+      this[_symbol] = symbol;
+      this[_name$] = _js_mirrors.getName(symbol);
       this.isConstructor = false;
       this.isStatic = true;
       this[_params] = null;
@@ -13674,7 +13991,7 @@
       this[_createParameterMirrorList](ftype);
     }
     get constructorName() {
-      return dart.test(this.isConstructor) ? core.Symbol.new(this[_name$]) : null;
+      return dart.test(this.isConstructor) ? this[_symbol] : null;
     }
     get parameters() {
       return this[_params];
@@ -13688,29 +14005,35 @@
         this[_metadata$] = const$3 || (const$3 = dart.constList([], mirrors.InstanceMirror));
         return;
       }
-      if (core.List.is(ftype)) {
+      if (!core.Function.is(ftype) && core.List.is(ftype)) {
         this[_metadata$] = ListOfInstanceMirror().unmodifiable(core.Iterable._check(dart.dsend(dart.dsend(ftype, 'skip', 1), 'map', dart.fn(a => _js_mirrors.reflect(a), dynamicToInstanceMirror()))));
         ftype = dart.dindex(ftype, 0);
       } else {
         this[_metadata$] = const$4 || (const$4 = dart.constList([], mirrors.InstanceMirror));
       }
+      if (typeof ftype == "function") {
+        ftype = ftype.apply(null, JSArrayOfType().of([dart.dynamic, dart.dynamic, dart.dynamic]));
+      }
       let args = core.List._check(dart.dload(ftype, 'args'));
       let opts = core.List._check(dart.dload(ftype, 'optionals'));
       let params = ListOfParameterMirror().new(dart.notNull(args[dartx.length]) + dart.notNull(opts[dartx.length]));
       for (let i = 0; i < dart.notNull(args[dartx.length]); ++i) {
-        let type = args[dartx.get](i);
+        let type = args[dartx._get](i);
         let metadata = dart.dindex(dart.dload(ftype, 'metadata'), i);
-        let param = new _js_mirrors.JsParameterMirror._('', core.Type._check(_js_mirrors._wrap(type)), core.List._check(metadata));
-        params[dartx.set](i, param);
+        let param = new _js_mirrors.JsParameterMirror._(core.Symbol.new(''), core.Type._check(_js_mirrors._wrap(type)), core.List._check(metadata));
+        params[dartx._set](i, param);
       }
       for (let i = 0; i < dart.notNull(opts[dartx.length]); ++i) {
-        let type = opts[dartx.get](i);
+        let type = opts[dartx._get](i);
         let metadata = dart.dindex(dart.dload(ftype, 'metadata'), dart.notNull(args[dartx.length]) + i);
-        let param = new _js_mirrors.JsParameterMirror._('', core.Type._check(_js_mirrors._wrap(type)), core.List._check(metadata));
-        params[dartx.set](i + dart.notNull(args[dartx.length]), param);
+        let param = new _js_mirrors.JsParameterMirror._(core.Symbol.new(''), core.Type._check(_js_mirrors._wrap(type)), core.List._check(metadata));
+        params[dartx._set](i + dart.notNull(args[dartx.length]), param);
       }
       this[_params] = ListOfParameterMirror().unmodifiable(params);
     }
+    toString() {
+      return dart.str`MethodMirror on '${this[_name$]}'`;
+    }
     get qualifiedName() {
       return core.Symbol._check(this.noSuchMethod(new dart.InvocationImpl('qualifiedName', [], {isGetter: true})));
     }
@@ -13763,11 +14086,12 @@
   _js_mirrors.JsMethodMirror[dart.implements] = () => [mirrors.MethodMirror];
   dart.setSignature(_js_mirrors.JsMethodMirror, {
     constructors: () => ({
-      _constructor: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.String, dart.dynamic]),
-      _instanceMethod: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.String, dart.dynamic]),
-      _staticMethod: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.String, dart.dynamic])
+      _constructor: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.Symbol, dart.dynamic]),
+      _instanceMethod: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.Symbol, dart.dynamic]),
+      _staticMethod: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.Symbol, dart.dynamic])
     }),
     fields: () => ({
+      [_symbol]: core.Symbol,
       [_name$]: core.String,
       [_params]: ListOfParameterMirror(),
       [_metadata$]: ListOfInstanceMirror(),
@@ -14538,11 +14862,11 @@
     _slowFromList(list) {
       this[_storage] = _native_typed_data.NativeFloat32List.new(dart.notNull(list[dartx.length]) * 4);
       for (let i = 0; i < dart.notNull(list[dartx.length]); i++) {
-        let e = list[dartx.get](i);
-        this[_storage][dartx.set](i * 4 + 0, e.x);
-        this[_storage][dartx.set](i * 4 + 1, e.y);
-        this[_storage][dartx.set](i * 4 + 2, e.z);
-        this[_storage][dartx.set](i * 4 + 3, e.w);
+        let e = list[dartx._get](i);
+        this[_storage][dartx._set](i * 4 + 0, e.x);
+        this[_storage][dartx._set](i * 4 + 1, e.y);
+        this[_storage][dartx._set](i * 4 + 2, e.z);
+        this[_storage][dartx._set](i * 4 + 3, e.w);
       }
     }
     get runtimeType() {
@@ -14573,20 +14897,20 @@
     set length(value) {
       super.length = value;
     }
-    get(index) {
+    _get(index) {
       _native_typed_data._checkValidIndex(index, this, this.length);
-      let _x = this[_storage][dartx.get](dart.notNull(index) * 4 + 0);
-      let _y = this[_storage][dartx.get](dart.notNull(index) * 4 + 1);
-      let _z = this[_storage][dartx.get](dart.notNull(index) * 4 + 2);
-      let _w = this[_storage][dartx.get](dart.notNull(index) * 4 + 3);
+      let _x = this[_storage][dartx._get](dart.notNull(index) * 4 + 0);
+      let _y = this[_storage][dartx._get](dart.notNull(index) * 4 + 1);
+      let _z = this[_storage][dartx._get](dart.notNull(index) * 4 + 2);
+      let _w = this[_storage][dartx._get](dart.notNull(index) * 4 + 3);
       return new _native_typed_data.NativeFloat32x4._truncated(_x, _y, _z, _w);
     }
-    set(index, value) {
+    _set(index, value) {
       _native_typed_data._checkValidIndex(index, this, this.length);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 0, value.x);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 1, value.y);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 2, value.z);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 3, value.w);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 0, value.x);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 1, value.y);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 2, value.z);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 3, value.w);
       return value;
     }
     sublist(start, end) {
@@ -14614,14 +14938,14 @@
       length: dart.definiteFunctionType(core.int, [])
     }),
     methods: () => ({
-      get: dart.definiteFunctionType(typed_data.Float32x4, [core.int]),
-      set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Float32x4]),
+      _get: dart.definiteFunctionType(typed_data.Float32x4, [core.int]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Float32x4]),
       sublist: dart.definiteFunctionType(core.List$(typed_data.Float32x4), [core.int], [core.int])
     })
   });
   dart.defineExtensionMembers(_native_typed_data.NativeFloat32x4List, [
-    'get',
-    'set',
+    '_get',
+    '_set',
     'sublist',
     'buffer',
     'lengthInBytes',
@@ -15171,11 +15495,11 @@
     _slowFromList(list) {
       this[_storage] = _native_typed_data.NativeInt32List.new(dart.notNull(list[dartx.length]) * 4);
       for (let i = 0; i < dart.notNull(list[dartx.length]); i++) {
-        let e = list[dartx.get](i);
-        this[_storage][dartx.set](i * 4 + 0, e.x);
-        this[_storage][dartx.set](i * 4 + 1, e.y);
-        this[_storage][dartx.set](i * 4 + 2, e.z);
-        this[_storage][dartx.set](i * 4 + 3, e.w);
+        let e = list[dartx._get](i);
+        this[_storage][dartx._set](i * 4 + 0, e.x);
+        this[_storage][dartx._set](i * 4 + 1, e.y);
+        this[_storage][dartx._set](i * 4 + 2, e.z);
+        this[_storage][dartx._set](i * 4 + 3, e.w);
       }
     }
     get runtimeType() {
@@ -15206,20 +15530,20 @@
     set length(value) {
       super.length = value;
     }
-    get(index) {
+    _get(index) {
       _native_typed_data._checkValidIndex(index, this, this.length);
-      let _x = this[_storage][dartx.get](dart.notNull(index) * 4 + 0);
-      let _y = this[_storage][dartx.get](dart.notNull(index) * 4 + 1);
-      let _z = this[_storage][dartx.get](dart.notNull(index) * 4 + 2);
-      let _w = this[_storage][dartx.get](dart.notNull(index) * 4 + 3);
+      let _x = this[_storage][dartx._get](dart.notNull(index) * 4 + 0);
+      let _y = this[_storage][dartx._get](dart.notNull(index) * 4 + 1);
+      let _z = this[_storage][dartx._get](dart.notNull(index) * 4 + 2);
+      let _w = this[_storage][dartx._get](dart.notNull(index) * 4 + 3);
       return new _native_typed_data.NativeInt32x4._truncated(_x, _y, _z, _w);
     }
-    set(index, value) {
+    _set(index, value) {
       _native_typed_data._checkValidIndex(index, this, this.length);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 0, value.x);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 1, value.y);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 2, value.z);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 3, value.w);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 0, value.x);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 1, value.y);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 2, value.z);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 3, value.w);
       return value;
     }
     sublist(start, end) {
@@ -15247,14 +15571,14 @@
       length: dart.definiteFunctionType(core.int, [])
     }),
     methods: () => ({
-      get: dart.definiteFunctionType(typed_data.Int32x4, [core.int]),
-      set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Int32x4]),
+      _get: dart.definiteFunctionType(typed_data.Int32x4, [core.int]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Int32x4]),
       sublist: dart.definiteFunctionType(core.List$(typed_data.Int32x4), [core.int], [core.int])
     })
   });
   dart.defineExtensionMembers(_native_typed_data.NativeInt32x4List, [
-    'get',
-    'set',
+    '_get',
+    '_set',
     'sublist',
     'buffer',
     'lengthInBytes',
@@ -15294,9 +15618,9 @@
     _slowFromList(list) {
       this[_storage] = _native_typed_data.NativeFloat64List.new(dart.notNull(list[dartx.length]) * 2);
       for (let i = 0; i < dart.notNull(list[dartx.length]); i++) {
-        let e = list[dartx.get](i);
-        this[_storage][dartx.set](i * 2 + 0, e.x);
-        this[_storage][dartx.set](i * 2 + 1, e.y);
+        let e = list[dartx._get](i);
+        this[_storage][dartx._set](i * 2 + 0, e.x);
+        this[_storage][dartx._set](i * 2 + 1, e.y);
       }
     }
     static fromList(list) {
@@ -15327,16 +15651,16 @@
     set length(value) {
       super.length = value;
     }
-    get(index) {
+    _get(index) {
       _native_typed_data._checkValidIndex(index, this, this.length);
-      let _x = this[_storage][dartx.get](dart.notNull(index) * 2 + 0);
-      let _y = this[_storage][dartx.get](dart.notNull(index) * 2 + 1);
+      let _x = this[_storage][dartx._get](dart.notNull(index) * 2 + 0);
+      let _y = this[_storage][dartx._get](dart.notNull(index) * 2 + 1);
       return typed_data.Float64x2.new(_x, _y);
     }
-    set(index, value) {
+    _set(index, value) {
       _native_typed_data._checkValidIndex(index, this, this.length);
-      this[_storage][dartx.set](dart.notNull(index) * 2 + 0, value.x);
-      this[_storage][dartx.set](dart.notNull(index) * 2 + 1, value.y);
+      this[_storage][dartx._set](dart.notNull(index) * 2 + 0, value.x);
+      this[_storage][dartx._set](dart.notNull(index) * 2 + 1, value.y);
       return value;
     }
     sublist(start, end) {
@@ -15364,14 +15688,14 @@
       length: dart.definiteFunctionType(core.int, [])
     }),
     methods: () => ({
-      get: dart.definiteFunctionType(typed_data.Float64x2, [core.int]),
-      set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Float64x2]),
+      _get: dart.definiteFunctionType(typed_data.Float64x2, [core.int]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Float64x2]),
       sublist: dart.definiteFunctionType(core.List$(typed_data.Float64x2), [core.int], [core.int])
     })
   });
   dart.defineExtensionMembers(_native_typed_data.NativeFloat64x2List, [
-    'get',
-    'set',
+    '_get',
+    '_set',
     'sublist',
     'buffer',
     'lengthInBytes',
@@ -15448,7 +15772,7 @@
     if (_interceptors.JSIndexable.is(list)) return list;
     let result = core.List.new(list[dartx.length]);
     for (let i = 0; i < dart.notNull(list[dartx.length]); i++) {
-      result[dartx.set](i, list[dartx.get](i));
+      result[dartx._set](i, list[dartx._get](i));
     }
     return result;
   };
@@ -15507,113 +15831,113 @@
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_getFloat32](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_getFloat32](byteOffset, littleEndian) {
-      return this.getFloat32(byteOffset, littleEndian);
+    [_getFloat32](...args) {
+      return this.getFloat32.apply(this, args);
     }
     [dartx.getFloat64](byteOffset, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_getFloat64](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_getFloat64](byteOffset, littleEndian) {
-      return this.getFloat64(byteOffset, littleEndian);
+    [_getFloat64](...args) {
+      return this.getFloat64.apply(this, args);
     }
     [dartx.getInt16](byteOffset, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_getInt16](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_getInt16](byteOffset, littleEndian) {
-      return this.getInt16(byteOffset, littleEndian);
+    [_getInt16](...args) {
+      return this.getInt16.apply(this, args);
     }
     [dartx.getInt32](byteOffset, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_getInt32](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_getInt32](byteOffset, littleEndian) {
-      return this.getInt32(byteOffset, littleEndian);
+    [_getInt32](...args) {
+      return this.getInt32.apply(this, args);
     }
     [dartx.getInt64](byteOffset, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       dart.throw(new core.UnsupportedError('Int64 accessor not supported by dart2js.'));
     }
-    [dartx.getInt8](byteOffset) {
-      return this.getInt8(byteOffset);
+    [dartx.getInt8](...args) {
+      return this.getInt8.apply(this, args);
     }
     [dartx.getUint16](byteOffset, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_getUint16](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_getUint16](byteOffset, littleEndian) {
-      return this.getUint16(byteOffset, littleEndian);
+    [_getUint16](...args) {
+      return this.getUint16.apply(this, args);
     }
     [dartx.getUint32](byteOffset, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_getUint32](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_getUint32](byteOffset, littleEndian) {
-      return this.getUint32(byteOffset, littleEndian);
+    [_getUint32](...args) {
+      return this.getUint32.apply(this, args);
     }
     [dartx.getUint64](byteOffset, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       dart.throw(new core.UnsupportedError('Uint64 accessor not supported by dart2js.'));
     }
-    [dartx.getUint8](byteOffset) {
-      return this.getUint8(byteOffset);
+    [dartx.getUint8](...args) {
+      return this.getUint8.apply(this, args);
     }
     [dartx.setFloat32](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_setFloat32](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_setFloat32](byteOffset, value, littleEndian) {
-      return this.setFloat32(byteOffset, value, littleEndian);
+    [_setFloat32](...args) {
+      return this.setFloat32.apply(this, args);
     }
     [dartx.setFloat64](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_setFloat64](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_setFloat64](byteOffset, value, littleEndian) {
-      return this.setFloat64(byteOffset, value, littleEndian);
+    [_setFloat64](...args) {
+      return this.setFloat64.apply(this, args);
     }
     [dartx.setInt16](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_setInt16](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_setInt16](byteOffset, value, littleEndian) {
-      return this.setInt16(byteOffset, value, littleEndian);
+    [_setInt16](...args) {
+      return this.setInt16.apply(this, args);
     }
     [dartx.setInt32](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_setInt32](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_setInt32](byteOffset, value, littleEndian) {
-      return this.setInt32(byteOffset, value, littleEndian);
+    [_setInt32](...args) {
+      return this.setInt32.apply(this, args);
     }
     [dartx.setInt64](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       dart.throw(new core.UnsupportedError('Int64 accessor not supported by dart2js.'));
     }
-    [dartx.setInt8](byteOffset, value) {
-      return this.setInt8(byteOffset, value);
+    [dartx.setInt8](...args) {
+      return this.setInt8.apply(this, args);
     }
     [dartx.setUint16](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_setUint16](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_setUint16](byteOffset, value, littleEndian) {
-      return this.setUint16(byteOffset, value, littleEndian);
+    [_setUint16](...args) {
+      return this.setUint16.apply(this, args);
     }
     [dartx.setUint32](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_setUint32](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_setUint32](byteOffset, value, littleEndian) {
-      return this.setUint32(byteOffset, value, littleEndian);
+    [_setUint32](...args) {
+      return this.setUint32.apply(this, args);
     }
     [dartx.setUint64](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       dart.throw(new core.UnsupportedError('Uint64 accessor not supported by dart2js.'));
     }
-    [dartx.setUint8](byteOffset, value) {
-      return this.setUint8(byteOffset, value);
+    [dartx.setUint8](...args) {
+      return this.setUint8.apply(this, args);
     }
     static _create1(arg) {
       return new DataView(new ArrayBuffer(arg));
@@ -15698,8 +16022,8 @@
   });
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'setRange'
   ]);
   _native_typed_data.NativeTypedArrayOfDouble = class NativeTypedArrayOfDouble extends dart.mixin(_native_typed_data.NativeTypedArray, collection.ListMixin$(core.double), _internal.FixedLengthListMixin$(core.double)) {
@@ -15709,11 +16033,11 @@
     set length(value) {
       super.length = value;
     }
-    get(index) {
+    _get(index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
-    set(index, value) {
+    _set(index, value) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       this[index] = value;
       return value;
@@ -15730,15 +16054,15 @@
   dart.setSignature(_native_typed_data.NativeTypedArrayOfDouble, {
     getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
     methods: () => ({
-      get: dart.definiteFunctionType(core.double, [core.int]),
-      set: dart.definiteFunctionType(dart.void, [core.int, core.num]),
+      _get: dart.definiteFunctionType(core.double, [core.int]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, core.num]),
       setRange: dart.definiteFunctionType(dart.void, [core.int, core.int, IterableOfdouble()], [core.int])
     })
   });
-  dart.defineExtensionMembers(_native_typed_data.NativeTypedArrayOfDouble, ['get', 'set', 'setRange', 'length']);
+  dart.defineExtensionMembers(_native_typed_data.NativeTypedArrayOfDouble, ['_get', '_set', 'setRange', 'length']);
   dart.defineExtensionNames([
     'length',
-    'set',
+    '_set',
     'setRange'
   ]);
   _native_typed_data.NativeTypedArrayOfInt = class NativeTypedArrayOfInt extends dart.mixin(_native_typed_data.NativeTypedArray, collection.ListMixin$(core.int), _internal.FixedLengthListMixin$(core.int)) {
@@ -15748,7 +16072,7 @@
     set length(value) {
       super.length = value;
     }
-    set(index, value) {
+    _set(index, value) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       this[index] = value;
       return value;
@@ -15766,11 +16090,11 @@
   dart.setSignature(_native_typed_data.NativeTypedArrayOfInt, {
     getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
     methods: () => ({
-      set: dart.definiteFunctionType(dart.void, [core.int, core.int]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, core.int]),
       setRange: dart.definiteFunctionType(dart.void, [core.int, core.int, IterableOfint()], [core.int])
     })
   });
-  dart.defineExtensionMembers(_native_typed_data.NativeTypedArrayOfInt, ['set', 'setRange', 'length']);
+  dart.defineExtensionMembers(_native_typed_data.NativeTypedArrayOfInt, ['_set', 'setRange', 'length']);
   dart.defineExtensionNames([
     'runtimeType',
     'sublist'
@@ -15873,7 +16197,7 @@
   dart.registerExtension(dart.global.Float64Array, _native_typed_data.NativeFloat64List);
   dart.defineExtensionNames([
     'runtimeType',
-    'get',
+    '_get',
     'sublist'
   ]);
   _native_typed_data.NativeInt16List = class NativeInt16List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -15890,7 +16214,7 @@
     get [dartx.runtimeType]() {
       return dart.wrapType(typed_data.Int16List);
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
@@ -15918,7 +16242,7 @@
       view: dart.definiteFunctionType(_native_typed_data.NativeInt16List, [_native_typed_data.NativeByteBuffer, core.int, core.int])
     }),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+      [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
       [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
     }),
     statics: () => ({
@@ -15931,7 +16255,7 @@
   dart.registerExtension(dart.global.Int16Array, _native_typed_data.NativeInt16List);
   dart.defineExtensionNames([
     'runtimeType',
-    'get',
+    '_get',
     'sublist'
   ]);
   _native_typed_data.NativeInt32List = class NativeInt32List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -15948,7 +16272,7 @@
     get [dartx.runtimeType]() {
       return dart.wrapType(typed_data.Int32List);
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
@@ -15976,7 +16300,7 @@
       view: dart.definiteFunctionType(_native_typed_data.NativeInt32List, [typed_data.ByteBuffer, core.int, core.int])
     }),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+      [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
       [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
     }),
     statics: () => ({
@@ -15989,7 +16313,7 @@
   dart.registerExtension(dart.global.Int32Array, _native_typed_data.NativeInt32List);
   dart.defineExtensionNames([
     'runtimeType',
-    'get',
+    '_get',
     'sublist'
   ]);
   _native_typed_data.NativeInt8List = class NativeInt8List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -16006,7 +16330,7 @@
     get [dartx.runtimeType]() {
       return dart.wrapType(typed_data.Int8List);
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
@@ -16034,7 +16358,7 @@
       view: dart.definiteFunctionType(_native_typed_data.NativeInt8List, [typed_data.ByteBuffer, core.int, core.int])
     }),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+      [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
       [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
     }),
     statics: () => ({
@@ -16047,7 +16371,7 @@
   dart.registerExtension(dart.global.Int8Array, _native_typed_data.NativeInt8List);
   dart.defineExtensionNames([
     'runtimeType',
-    'get',
+    '_get',
     'sublist'
   ]);
   _native_typed_data.NativeUint16List = class NativeUint16List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -16064,7 +16388,7 @@
     get [dartx.runtimeType]() {
       return dart.wrapType(typed_data.Uint16List);
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
@@ -16092,7 +16416,7 @@
       view: dart.definiteFunctionType(_native_typed_data.NativeUint16List, [typed_data.ByteBuffer, core.int, core.int])
     }),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+      [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
       [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
     }),
     statics: () => ({
@@ -16105,7 +16429,7 @@
   dart.registerExtension(dart.global.Uint16Array, _native_typed_data.NativeUint16List);
   dart.defineExtensionNames([
     'runtimeType',
-    'get',
+    '_get',
     'sublist'
   ]);
   _native_typed_data.NativeUint32List = class NativeUint32List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -16122,7 +16446,7 @@
     get [dartx.runtimeType]() {
       return dart.wrapType(typed_data.Uint32List);
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
@@ -16150,7 +16474,7 @@
       view: dart.definiteFunctionType(_native_typed_data.NativeUint32List, [typed_data.ByteBuffer, core.int, core.int])
     }),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+      [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
       [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
     }),
     statics: () => ({
@@ -16164,7 +16488,7 @@
   dart.defineExtensionNames([
     'runtimeType',
     'length',
-    'get',
+    '_get',
     'sublist'
   ]);
   _native_typed_data.NativeUint8ClampedList = class NativeUint8ClampedList extends _native_typed_data.NativeTypedArrayOfInt {
@@ -16187,7 +16511,7 @@
     set [dartx.length](value) {
       super[dartx.length] = value;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
@@ -16215,7 +16539,7 @@
       view: dart.definiteFunctionType(_native_typed_data.NativeUint8ClampedList, [typed_data.ByteBuffer, core.int, core.int])
     }),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+      [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
       [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
     }),
     statics: () => ({
@@ -16226,10 +16550,11 @@
     names: ['_create1', '_create2', '_create3']
   });
   dart.registerExtension(dart.global.Uint8ClampedArray, _native_typed_data.NativeUint8ClampedList);
+  dart.registerExtension(dart.global.CanvasPixelArray, _native_typed_data.NativeUint8ClampedList);
   dart.defineExtensionNames([
     'runtimeType',
     'length',
-    'get',
+    '_get',
     'sublist'
   ]);
   _native_typed_data.NativeUint8List = class NativeUint8List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -16252,7 +16577,7 @@
     set [dartx.length](value) {
       super[dartx.length] = value;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
@@ -16280,7 +16605,7 @@
       view: dart.definiteFunctionType(_native_typed_data.NativeUint8List, [typed_data.ByteBuffer, core.int, core.int])
     }),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+      [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
       [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
     }),
     statics: () => ({
@@ -16293,8 +16618,8 @@
   dart.registerExtension(dart.global.Uint8Array, _native_typed_data.NativeUint8List);
   _native_typed_data.NativeFloat32x4 = class NativeFloat32x4 extends core.Object {
     static _truncate(x) {
-      _native_typed_data.NativeFloat32x4._list[dartx.set](0, core.num._check(x));
-      return _native_typed_data.NativeFloat32x4._list[dartx.get](0);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](0, core.num._check(x));
+      return _native_typed_data.NativeFloat32x4._list[dartx._get](0);
     }
     new(x, y, z, w) {
       this.x = core.double._check(_native_typed_data.NativeFloat32x4._truncate(x));
@@ -16313,11 +16638,11 @@
       NativeFloat32x4.prototype._truncated.call(this, 0.0, 0.0, 0.0, 0.0);
     }
     static fromInt32x4Bits(i) {
-      _native_typed_data.NativeFloat32x4._uint32view[dartx.set](0, i.x);
-      _native_typed_data.NativeFloat32x4._uint32view[dartx.set](1, i.y);
-      _native_typed_data.NativeFloat32x4._uint32view[dartx.set](2, i.z);
-      _native_typed_data.NativeFloat32x4._uint32view[dartx.set](3, i.w);
-      return new _native_typed_data.NativeFloat32x4._truncated(_native_typed_data.NativeFloat32x4._list[dartx.get](0), _native_typed_data.NativeFloat32x4._list[dartx.get](1), _native_typed_data.NativeFloat32x4._list[dartx.get](2), _native_typed_data.NativeFloat32x4._list[dartx.get](3));
+      _native_typed_data.NativeFloat32x4._uint32view[dartx._set](0, i.x);
+      _native_typed_data.NativeFloat32x4._uint32view[dartx._set](1, i.y);
+      _native_typed_data.NativeFloat32x4._uint32view[dartx._set](2, i.z);
+      _native_typed_data.NativeFloat32x4._uint32view[dartx._set](3, i.w);
+      return new _native_typed_data.NativeFloat32x4._truncated(_native_typed_data.NativeFloat32x4._list[dartx._get](0), _native_typed_data.NativeFloat32x4._list[dartx._get](1), _native_typed_data.NativeFloat32x4._list[dartx._get](2), _native_typed_data.NativeFloat32x4._list[dartx._get](3));
     }
     fromFloat64x2(v) {
       NativeFloat32x4.prototype._truncated.call(this, core.double._check(_native_typed_data.NativeFloat32x4._truncate(v.x)), core.double._check(_native_typed_data.NativeFloat32x4._truncate(v.y)), 0.0, 0.0);
@@ -16344,7 +16669,7 @@
       let _w = dart.notNull(this.w) + dart.notNull(other.w);
       return new _native_typed_data.NativeFloat32x4._doubles(_x, _y, _z, _w);
     }
-    ['unary-']() {
+    _negate() {
       return new _native_typed_data.NativeFloat32x4._truncated(-dart.notNull(this.x), -dart.notNull(this.y), -dart.notNull(this.z), -dart.notNull(this.w));
     }
     ['-'](other) {
@@ -16450,46 +16775,46 @@
     get signMask() {
       let view = _native_typed_data.NativeFloat32x4._uint32view;
       let mx = null, my = null, mz = null, mw = null;
-      _native_typed_data.NativeFloat32x4._list[dartx.set](0, this.x);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](1, this.y);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](2, this.z);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](3, this.w);
-      mx = (dart.notNull(view[dartx.get](0)) & 2147483648) >>> 31;
-      my = (dart.notNull(view[dartx.get](1)) & 2147483648) >>> 30;
-      mz = (dart.notNull(view[dartx.get](2)) & 2147483648) >>> 29;
-      mw = (dart.notNull(view[dartx.get](3)) & 2147483648) >>> 28;
+      _native_typed_data.NativeFloat32x4._list[dartx._set](0, this.x);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](1, this.y);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](2, this.z);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](3, this.w);
+      mx = (dart.notNull(view[dartx._get](0)) & 2147483648) >>> 31;
+      my = (dart.notNull(view[dartx._get](1)) & 2147483648) >>> 30;
+      mz = (dart.notNull(view[dartx._get](2)) & 2147483648) >>> 29;
+      mw = (dart.notNull(view[dartx._get](3)) & 2147483648) >>> 28;
       return core.int._check(dart.dsend(dart.dsend(dart.dsend(mx, '|', my), '|', mz), '|', mw));
     }
     shuffle(mask) {
       if (dart.notNull(mask) < 0 || dart.notNull(mask) > 255) {
         dart.throw(new core.RangeError.range(mask, 0, 255, "mask"));
       }
-      _native_typed_data.NativeFloat32x4._list[dartx.set](0, this.x);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](1, this.y);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](2, this.z);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](3, this.w);
-      let _x = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) & 3);
-      let _y = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 2 & 3);
-      let _z = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 4 & 3);
-      let _w = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 6 & 3);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](0, this.x);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](1, this.y);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](2, this.z);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](3, this.w);
+      let _x = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) & 3);
+      let _y = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 2 & 3);
+      let _z = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 4 & 3);
+      let _w = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 6 & 3);
       return new _native_typed_data.NativeFloat32x4._truncated(_x, _y, _z, _w);
     }
     shuffleMix(other, mask) {
       if (dart.notNull(mask) < 0 || dart.notNull(mask) > 255) {
         dart.throw(new core.RangeError.range(mask, 0, 255, "mask"));
       }
-      _native_typed_data.NativeFloat32x4._list[dartx.set](0, this.x);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](1, this.y);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](2, this.z);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](3, this.w);
-      let _x = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) & 3);
-      let _y = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 2 & 3);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](0, other.x);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](1, other.y);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](2, other.z);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](3, other.w);
-      let _z = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 4 & 3);
-      let _w = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 6 & 3);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](0, this.x);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](1, this.y);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](2, this.z);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](3, this.w);
+      let _x = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) & 3);
+      let _y = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 2 & 3);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](0, other.x);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](1, other.y);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](2, other.z);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](3, other.w);
+      let _z = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 4 & 3);
+      let _w = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 6 & 3);
       return new _native_typed_data.NativeFloat32x4._truncated(_x, _y, _z, _w);
     }
     withX(newX) {
@@ -16565,7 +16890,7 @@
     getters: () => ({signMask: dart.definiteFunctionType(core.int, [])}),
     methods: () => ({
       '+': dart.definiteFunctionType(typed_data.Float32x4, [typed_data.Float32x4]),
-      'unary-': dart.definiteFunctionType(typed_data.Float32x4, []),
+      _negate: dart.definiteFunctionType(typed_data.Float32x4, []),
       '-': dart.definiteFunctionType(typed_data.Float32x4, [typed_data.Float32x4]),
       '*': dart.definiteFunctionType(typed_data.Float32x4, [typed_data.Float32x4]),
       '/': dart.definiteFunctionType(typed_data.Float32x4, [typed_data.Float32x4]),
@@ -16607,8 +16932,8 @@
   });
   _native_typed_data.NativeInt32x4 = class NativeInt32x4 extends core.Object {
     static _truncate(x) {
-      _native_typed_data.NativeInt32x4._list[dartx.set](0, core.int._check(x));
-      return _native_typed_data.NativeInt32x4._list[dartx.get](0);
+      _native_typed_data.NativeInt32x4._list[dartx._set](0, core.int._check(x));
+      return _native_typed_data.NativeInt32x4._list[dartx._get](0);
     }
     new(x, y, z, w) {
       this.x = core.int._check(_native_typed_data.NativeInt32x4._truncate(x));
@@ -16628,12 +16953,12 @@
     }
     static fromFloat32x4Bits(f) {
       let floatList = _native_typed_data.NativeFloat32x4._list;
-      floatList[dartx.set](0, f.x);
-      floatList[dartx.set](1, f.y);
-      floatList[dartx.set](2, f.z);
-      floatList[dartx.set](3, f.w);
+      floatList[dartx._set](0, f.x);
+      floatList[dartx._set](1, f.y);
+      floatList[dartx._set](2, f.z);
+      floatList[dartx._set](3, f.w);
       let view = _native_typed_data.NativeInt32List._check(floatList[dartx.buffer][dartx.asInt32List]());
-      return new _native_typed_data.NativeInt32x4._truncated(view[dartx.get](0), view[dartx.get](1), view[dartx.get](2), view[dartx.get](3));
+      return new _native_typed_data.NativeInt32x4._truncated(view[dartx._get](0), view[dartx._get](1), view[dartx._get](2), view[dartx._get](3));
     }
     _truncated(x, y, z, w) {
       this.x = x;
@@ -16659,7 +16984,7 @@
     ['-'](other) {
       return new _native_typed_data.NativeInt32x4._truncated(this.x - other.x | 0, this.y - other.y | 0, this.z - other.z | 0, this.w - other.w | 0);
     }
-    ['unary-']() {
+    _negate() {
       return new _native_typed_data.NativeInt32x4._truncated(-this.x | 0, -this.y | 0, -this.z | 0, -this.w | 0);
     }
     get signMask() {
@@ -16673,32 +16998,32 @@
       if (dart.notNull(mask) < 0 || dart.notNull(mask) > 255) {
         dart.throw(new core.RangeError.range(mask, 0, 255, "mask"));
       }
-      _native_typed_data.NativeInt32x4._list[dartx.set](0, this.x);
-      _native_typed_data.NativeInt32x4._list[dartx.set](1, this.y);
-      _native_typed_data.NativeInt32x4._list[dartx.set](2, this.z);
-      _native_typed_data.NativeInt32x4._list[dartx.set](3, this.w);
-      let _x = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) & 3);
-      let _y = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 2 & 3);
-      let _z = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 4 & 3);
-      let _w = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 6 & 3);
+      _native_typed_data.NativeInt32x4._list[dartx._set](0, this.x);
+      _native_typed_data.NativeInt32x4._list[dartx._set](1, this.y);
+      _native_typed_data.NativeInt32x4._list[dartx._set](2, this.z);
+      _native_typed_data.NativeInt32x4._list[dartx._set](3, this.w);
+      let _x = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) & 3);
+      let _y = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 2 & 3);
+      let _z = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 4 & 3);
+      let _w = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 6 & 3);
       return new _native_typed_data.NativeInt32x4._truncated(_x, _y, _z, _w);
     }
     shuffleMix(other, mask) {
       if (dart.notNull(mask) < 0 || dart.notNull(mask) > 255) {
         dart.throw(new core.RangeError.range(mask, 0, 255, "mask"));
       }
-      _native_typed_data.NativeInt32x4._list[dartx.set](0, this.x);
-      _native_typed_data.NativeInt32x4._list[dartx.set](1, this.y);
-      _native_typed_data.NativeInt32x4._list[dartx.set](2, this.z);
-      _native_typed_data.NativeInt32x4._list[dartx.set](3, this.w);
-      let _x = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) & 3);
-      let _y = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 2 & 3);
-      _native_typed_data.NativeInt32x4._list[dartx.set](0, other.x);
-      _native_typed_data.NativeInt32x4._list[dartx.set](1, other.y);
-      _native_typed_data.NativeInt32x4._list[dartx.set](2, other.z);
-      _native_typed_data.NativeInt32x4._list[dartx.set](3, other.w);
-      let _z = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 4 & 3);
-      let _w = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 6 & 3);
+      _native_typed_data.NativeInt32x4._list[dartx._set](0, this.x);
+      _native_typed_data.NativeInt32x4._list[dartx._set](1, this.y);
+      _native_typed_data.NativeInt32x4._list[dartx._set](2, this.z);
+      _native_typed_data.NativeInt32x4._list[dartx._set](3, this.w);
+      let _x = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) & 3);
+      let _y = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 2 & 3);
+      _native_typed_data.NativeInt32x4._list[dartx._set](0, other.x);
+      _native_typed_data.NativeInt32x4._list[dartx._set](1, other.y);
+      _native_typed_data.NativeInt32x4._list[dartx._set](2, other.z);
+      _native_typed_data.NativeInt32x4._list[dartx._set](3, other.w);
+      let _z = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 4 & 3);
+      let _w = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 6 & 3);
       return new _native_typed_data.NativeInt32x4._truncated(_x, _y, _z, _w);
     }
     withX(x) {
@@ -16748,31 +17073,31 @@
     select(trueValue, falseValue) {
       let floatList = _native_typed_data.NativeFloat32x4._list;
       let intView = _native_typed_data.NativeFloat32x4._uint32view;
-      floatList[dartx.set](0, trueValue.x);
-      floatList[dartx.set](1, trueValue.y);
-      floatList[dartx.set](2, trueValue.z);
-      floatList[dartx.set](3, trueValue.w);
-      let stx = intView[dartx.get](0);
-      let sty = intView[dartx.get](1);
-      let stz = intView[dartx.get](2);
-      let stw = intView[dartx.get](3);
-      floatList[dartx.set](0, falseValue.x);
-      floatList[dartx.set](1, falseValue.y);
-      floatList[dartx.set](2, falseValue.z);
-      floatList[dartx.set](3, falseValue.w);
-      let sfx = intView[dartx.get](0);
-      let sfy = intView[dartx.get](1);
-      let sfz = intView[dartx.get](2);
-      let sfw = intView[dartx.get](3);
+      floatList[dartx._set](0, trueValue.x);
+      floatList[dartx._set](1, trueValue.y);
+      floatList[dartx._set](2, trueValue.z);
+      floatList[dartx._set](3, trueValue.w);
+      let stx = intView[dartx._get](0);
+      let sty = intView[dartx._get](1);
+      let stz = intView[dartx._get](2);
+      let stw = intView[dartx._get](3);
+      floatList[dartx._set](0, falseValue.x);
+      floatList[dartx._set](1, falseValue.y);
+      floatList[dartx._set](2, falseValue.z);
+      floatList[dartx._set](3, falseValue.w);
+      let sfx = intView[dartx._get](0);
+      let sfy = intView[dartx._get](1);
+      let sfz = intView[dartx._get](2);
+      let sfw = intView[dartx._get](3);
       let _x = (dart.notNull(this.x) & dart.notNull(stx) | ~dart.notNull(this.x) & dart.notNull(sfx)) >>> 0;
       let _y = (dart.notNull(this.y) & dart.notNull(sty) | ~dart.notNull(this.y) & dart.notNull(sfy)) >>> 0;
       let _z = (dart.notNull(this.z) & dart.notNull(stz) | ~dart.notNull(this.z) & dart.notNull(sfz)) >>> 0;
       let _w = (dart.notNull(this.w) & dart.notNull(stw) | ~dart.notNull(this.w) & dart.notNull(sfw)) >>> 0;
-      intView[dartx.set](0, _x);
-      intView[dartx.set](1, _y);
-      intView[dartx.set](2, _z);
-      intView[dartx.set](3, _w);
-      return new _native_typed_data.NativeFloat32x4._truncated(floatList[dartx.get](0), floatList[dartx.get](1), floatList[dartx.get](2), floatList[dartx.get](3));
+      intView[dartx._set](0, _x);
+      intView[dartx._set](1, _y);
+      intView[dartx._set](2, _z);
+      intView[dartx._set](3, _w);
+      return new _native_typed_data.NativeFloat32x4._truncated(floatList[dartx._get](0), floatList[dartx._get](1), floatList[dartx._get](2), floatList[dartx._get](3));
     }
   };
   dart.defineNamedConstructor(_native_typed_data.NativeInt32x4, 'bool');
@@ -16804,7 +17129,7 @@
       '^': dart.definiteFunctionType(typed_data.Int32x4, [typed_data.Int32x4]),
       '+': dart.definiteFunctionType(typed_data.Int32x4, [typed_data.Int32x4]),
       '-': dart.definiteFunctionType(typed_data.Int32x4, [typed_data.Int32x4]),
-      'unary-': dart.definiteFunctionType(typed_data.Int32x4, []),
+      _negate: dart.definiteFunctionType(typed_data.Int32x4, []),
       shuffle: dart.definiteFunctionType(typed_data.Int32x4, [core.int]),
       shuffleMix: dart.definiteFunctionType(typed_data.Int32x4, [typed_data.Int32x4, core.int]),
       withX: dart.definiteFunctionType(typed_data.Int32x4, [core.int]),
@@ -16852,7 +17177,7 @@
     ['+'](other) {
       return new _native_typed_data.NativeFloat64x2._doubles(dart.notNull(this.x) + dart.notNull(other.x), dart.notNull(this.y) + dart.notNull(other.y));
     }
-    ['unary-']() {
+    _negate() {
       return new _native_typed_data.NativeFloat64x2._doubles(-dart.notNull(this.x), -dart.notNull(this.y));
     }
     ['-'](other) {
@@ -16885,10 +17210,10 @@
     }
     get signMask() {
       let view = _native_typed_data.NativeFloat64x2._uint32View;
-      _native_typed_data.NativeFloat64x2._list[dartx.set](0, this.x);
-      _native_typed_data.NativeFloat64x2._list[dartx.set](1, this.y);
-      let mx = (dart.notNull(view[dartx.get](1)) & 2147483648) >>> 31;
-      let my = (dart.notNull(view[dartx.get](3)) & 2147483648) >>> 31;
+      _native_typed_data.NativeFloat64x2._list[dartx._set](0, this.x);
+      _native_typed_data.NativeFloat64x2._list[dartx._set](1, this.y);
+      let mx = (dart.notNull(view[dartx._get](1)) & 2147483648) >>> 31;
+      let my = (dart.notNull(view[dartx._get](3)) & 2147483648) >>> 31;
       return (mx | my << 1) >>> 0;
     }
     withX(x) {
@@ -16929,7 +17254,7 @@
     getters: () => ({signMask: dart.definiteFunctionType(core.int, [])}),
     methods: () => ({
       '+': dart.definiteFunctionType(typed_data.Float64x2, [typed_data.Float64x2]),
-      'unary-': dart.definiteFunctionType(typed_data.Float64x2, []),
+      _negate: dart.definiteFunctionType(typed_data.Float64x2, []),
       '-': dart.definiteFunctionType(typed_data.Float64x2, [typed_data.Float64x2]),
       '*': dart.definiteFunctionType(typed_data.Float64x2, [typed_data.Float64x2]),
       '/': dart.definiteFunctionType(typed_data.Float64x2, [typed_data.Float64x2]),
@@ -18296,7 +18621,7 @@
             future.then(dart.dynamic)(dart.fn(value => {
               remaining--;
               if (values != null) {
-                values[dartx.set](pos, value);
+                values[dartx._set](pos, value);
                 if (remaining == 0) {
                   result[_completeWithValue](values);
                 }
@@ -22321,13 +22646,13 @@
         }
       };
     }
-    get(key) {
-      let result = this[_map$][dartx.get](key);
+    _get(key) {
+      let result = this[_map$][dartx._get](key);
       if (result != null || dart.test(this[_map$][dartx.containsKey](key))) return result;
       if (this.parent != null) {
-        let value = this.parent.get(key);
+        let value = this.parent._get(key);
         if (value != null) {
-          this[_map$][dartx.set](key, value);
+          this[_map$][dartx._set](key, value);
         }
         return value;
       }
@@ -22475,7 +22800,7 @@
       bindCallback: dart.definiteFunctionType(R => [async.ZoneCallback$(R), [dart.functionType(R, [])], {runGuarded: core.bool}]),
       bindUnaryCallback: dart.definiteFunctionType((R, T) => [async.ZoneUnaryCallback$(R, T), [dart.functionType(R, [T])], {runGuarded: core.bool}]),
       bindBinaryCallback: dart.definiteFunctionType((R, T1, T2) => [async.ZoneBinaryCallback$(R, T1, T2), [dart.functionType(R, [T1, T2])], {runGuarded: core.bool}]),
-      get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
+      _get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
       handleUncaughtError: dart.definiteFunctionType(R => [R, [dart.dynamic, core.StackTrace]]),
       fork: dart.definiteFunctionType(async.Zone, [], {specification: async.ZoneSpecification, zoneValues: core.Map}),
       run: dart.definiteFunctionType(R => [R, [dart.functionType(R, [])]]),
@@ -22757,7 +23082,7 @@
         }
       };
     }
-    get(key) {
+    _get(key) {
       return null;
     }
     handleUncaughtError(R) {
@@ -22847,7 +23172,7 @@
       bindCallback: dart.definiteFunctionType(R => [async.ZoneCallback$(R), [dart.functionType(R, [])], {runGuarded: core.bool}]),
       bindUnaryCallback: dart.definiteFunctionType((R, T) => [async.ZoneUnaryCallback$(R, T), [dart.functionType(R, [T])], {runGuarded: core.bool}]),
       bindBinaryCallback: dart.definiteFunctionType((R, T1, T2) => [async.ZoneBinaryCallback$(R, T1, T2), [dart.functionType(R, [T1, T2])], {runGuarded: core.bool}]),
-      get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
+      _get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
       handleUncaughtError: dart.definiteFunctionType(R => [R, [dart.dynamic, core.StackTrace]]),
       fork: dart.definiteFunctionType(async.Zone, [], {specification: async.ZoneSpecification, zoneValues: core.Map}),
       run: dart.definiteFunctionType(R => [R, [dart.functionType(R, [])]]),
@@ -22961,7 +23286,7 @@
         return new (_HashMapKeyIterableOfK())(this);
       }
       get values() {
-        return MappedIterableOfK$V().new(this.keys, dart.fn(each => this.get(each), KToV()));
+        return MappedIterableOfK$V().new(this.keys, dart.fn(each => this._get(each), KToV()));
       }
       containsKey(key) {
         if (dart.test(collection._HashMap._isStringKey(key))) {
@@ -22981,15 +23306,15 @@
         return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0;
       }
       containsValue(value) {
-        return this[_computeKeys]()[dartx.any](dart.fn(each => dart.equals(this.get(each), value), KTobool()));
+        return this[_computeKeys]()[dartx.any](dart.fn(each => dart.equals(this._get(each), value), KTobool()));
       }
       addAll(other) {
         MapOfK$V()._check(other);
         other[dartx.forEach](dart.fn((key, value) => {
-          this.set(key, value);
+          this._set(key, value);
         }, KAndVTovoid$()));
       }
-      get(key) {
+      _get(key) {
         if (dart.test(collection._HashMap._isStringKey(key))) {
           let strings = this[_strings$];
           return V._check(strings == null ? null : collection._HashMap._getTableEntry(strings, key));
@@ -23007,7 +23332,7 @@
         let index = this[_findBucketIndex](bucket, key);
         return V._check(dart.notNull(index) < 0 ? null : bucket[dart.notNull(index) + 1]);
       }
-      set(key, value) {
+      _set(key, value) {
         K._check(key);
         V._check(value);
         if (dart.test(collection._HashMap._isStringKey(key))) {
@@ -23048,9 +23373,9 @@
       putIfAbsent(key, ifAbsent) {
         K._check(key);
         VoidToV()._check(ifAbsent);
-        if (dart.test(this.containsKey(key))) return this.get(key);
+        if (dart.test(this.containsKey(key))) return this._get(key);
         let value = ifAbsent();
-        this.set(key, value);
+        this._set(key, value);
         return value;
       }
       remove(key) {
@@ -23082,7 +23407,7 @@
         let keys = this[_computeKeys]();
         for (let i = 0, length = keys[dartx.length]; i < dart.notNull(length); i++) {
           let key = keys[i];
-          action(K._check(key), this.get(key));
+          action(K._check(key), this._get(key));
           if (keys !== this[_keys]) {
             dart.throw(new core.ConcurrentModificationError(this));
           }
@@ -23220,9 +23545,9 @@
         [_containsKey]: dart.definiteFunctionType(core.bool, [core.Object]),
         containsValue: dart.definiteFunctionType(core.bool, [core.Object]),
         addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
-        get: dart.definiteFunctionType(V, [core.Object]),
+        _get: dart.definiteFunctionType(V, [core.Object]),
         [_get]: dart.definiteFunctionType(V, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         [_set]: dart.definiteFunctionType(dart.void, [K, V]),
         putIfAbsent: dart.definiteFunctionType(V, [K, VoidToV()]),
         remove: dart.definiteFunctionType(V, [core.Object]),
@@ -23251,8 +23576,8 @@
       'containsKey',
       'containsValue',
       'addAll',
-      'get',
-      'set',
+      '_get',
+      '_set',
       'putIfAbsent',
       'remove',
       'clear',
@@ -23299,11 +23624,11 @@
         this[_validKey] = validKey != null ? validKey : dart.fn(v => K.is(v), ObjectTobool());
         super.new();
       }
-      get(key) {
+      _get(key) {
         if (!dart.test(this[_validKey](key))) return null;
         return super[_get](key);
       }
-      set(key, value) {
+      _set(key, value) {
         K._check(key);
         V._check(value);
         super[_set](key, value);
@@ -23340,12 +23665,12 @@
         [_validKey]: _PredicateOfObject()
       }),
       methods: () => ({
-        get: dart.definiteFunctionType(V, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _get: dart.definiteFunctionType(V, [core.Object]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         remove: dart.definiteFunctionType(V, [core.Object])
       })
     });
-    dart.defineExtensionMembers(_CustomHashMap, ['get', 'set', 'containsKey', 'remove']);
+    dart.defineExtensionMembers(_CustomHashMap, ['_get', '_set', 'containsKey', 'remove']);
     return _CustomHashMap;
   });
   collection._CustomHashMap = _CustomHashMap();
@@ -23522,13 +23847,13 @@
       addAll(other) {
         MapOfK$V()._check(other);
         other[dartx.forEach](dart.fn((key, value) => {
-          this.set(key, value);
+          this._set(key, value);
         }, KAndVTovoid$()));
       }
-      get(key) {
+      _get(key) {
         return this[_map$0].get(key);
       }
-      set(key, value) {
+      _set(key, value) {
         K._check(key);
         V._check(value);
         this[_map$0].set(key, value);
@@ -23538,13 +23863,13 @@
       putIfAbsent(key, ifAbsent) {
         K._check(key);
         VoidToV()._check(ifAbsent);
-        if (dart.test(this.containsKey(key))) return this.get(key);
+        if (dart.test(this.containsKey(key))) return this._get(key);
         let value = ifAbsent();
-        this.set(key, value);
+        this._set(key, value);
         return value;
       }
       remove(key) {
-        let value = this.get(key);
+        let value = this._get(key);
         this[_map$0].delete(key);
         this[_modified$]();
         return value;
@@ -23589,8 +23914,8 @@
       }),
       methods: () => ({
         addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
-        get: dart.definiteFunctionType(V, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _get: dart.definiteFunctionType(V, [core.Object]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         putIfAbsent: dart.definiteFunctionType(V, [K, VoidToV()]),
         remove: dart.definiteFunctionType(V, [core.Object]),
         forEach: dart.definiteFunctionType(dart.void, [KAndVTovoid()]),
@@ -23601,8 +23926,8 @@
       'containsKey',
       'containsValue',
       'addAll',
-      'get',
-      'set',
+      '_get',
+      '_set',
       'putIfAbsent',
       'remove',
       'clear',
@@ -23748,11 +24073,11 @@
         this[_validKey] = validKey != null ? validKey : dart.fn(v => K.is(v), ObjectTobool());
         super.new();
       }
-      get(key) {
+      _get(key) {
         if (!dart.test(this[_validKey](key))) return null;
         return super.internalGet(key);
       }
-      set(key, value) {
+      _set(key, value) {
         K._check(key);
         V._check(value);
         super.internalSet(key, value);
@@ -23787,12 +24112,12 @@
         [_validKey]: _PredicateOfObject()
       }),
       methods: () => ({
-        get: dart.definiteFunctionType(V, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _get: dart.definiteFunctionType(V, [core.Object]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         remove: dart.definiteFunctionType(V, [core.Object])
       })
     });
-    dart.defineExtensionMembers(_LinkedCustomHashMap, ['get', 'set', 'containsKey', 'remove']);
+    dart.defineExtensionMembers(_LinkedCustomHashMap, ['_get', '_set', 'containsKey', 'remove']);
     return _LinkedCustomHashMap;
   });
   collection._LinkedCustomHashMap = _LinkedCustomHashMap();
@@ -23893,7 +24218,7 @@
         })() : ListOfE().new(this.length);
         let i = 0;
         for (let element of this)
-          result[dartx.set](i++, element);
+          result[dartx._set](i++, element);
         return result;
       }
       map(T) {
@@ -24229,7 +24554,7 @@
         let bucket = this[_getBucket$](rest, object);
         let index = this[_findBucketIndex](bucket, object);
         if (dart.notNull(index) < 0) return null;
-        return bucket[dartx.get](index);
+        return bucket[dartx._get](index);
       }
       add(element) {
         E._check(element);
@@ -24655,7 +24980,7 @@
         let bucket = this[_getBucket$](rest, object);
         let index = this[_findBucketIndex](bucket, object);
         if (dart.notNull(index) < 0) return null;
-        return bucket[dartx.get](index)[_element];
+        return bucket[dartx._get](index)[_element];
       }
       forEach(action) {
         let cell = this[_first$];
@@ -25087,7 +25412,7 @@
       set length(value) {
         super.length = value;
       }
-      get(index) {
+      _get(index) {
         return this[_source$0][dartx.elementAt](index);
       }
     }
@@ -25095,9 +25420,9 @@
       constructors: () => ({new: dart.definiteFunctionType(collection.UnmodifiableListView$(E), [IterableOfE()])}),
       fields: () => ({[_source$0]: IterableOfE()}),
       getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
-      methods: () => ({get: dart.definiteFunctionType(E, [core.int])})
+      methods: () => ({_get: dart.definiteFunctionType(E, [core.int])})
     });
-    dart.defineExtensionMembers(UnmodifiableListView, ['get', 'length']);
+    dart.defineExtensionMembers(UnmodifiableListView, ['_get', 'length']);
     return UnmodifiableListView;
   });
   collection.UnmodifiableListView = UnmodifiableListView();
@@ -25166,7 +25491,7 @@
       static from(other) {
         let result = HashMapOfK$V().new();
         other[dartx.forEach](dart.fn((k, v) => {
-          result.set(K.as(k), V.as(v));
+          result._set(K.as(k), V.as(v));
         }, dynamicAnddynamicTovoid$()));
         return result;
       }
@@ -25536,7 +25861,7 @@
   });
   collection._isToStringVisiting = function(o) {
     for (let i = 0; i < dart.notNull(collection._toStringVisiting[dartx.length]); i++) {
-      if (core.identical(o, collection._toStringVisiting[dartx.get](i))) return true;
+      if (core.identical(o, collection._toStringVisiting[dartx._get](i))) return true;
     }
     return false;
   };
@@ -25718,7 +26043,7 @@
       static from(other) {
         let result = LinkedHashMapOfK$V().new();
         other[dartx.forEach](dart.fn((k, v) => {
-          result.set(K.as(k), V.as(v));
+          result._set(K.as(k), V.as(v));
         }, dynamicAnddynamicTovoid$()));
         return result;
       }
@@ -26085,18 +26410,18 @@
     class MapMixin extends core.Object {
       forEach(action) {
         for (let key of this.keys) {
-          action(key, this.get(key));
+          action(key, this._get(key));
         }
       }
       addAll(other) {
         MapOfK$V()._check(other);
         for (let key of other[dartx.keys]) {
-          this.set(key, other[dartx.get](key));
+          this._set(key, other[dartx._get](key));
         }
       }
       containsValue(value) {
         for (let key of this.keys) {
-          if (dart.equals(this.get(key), value)) return true;
+          if (dart.equals(this._get(key), value)) return true;
         }
         return false;
       }
@@ -26104,9 +26429,9 @@
         K._check(key);
         VoidToV()._check(ifAbsent);
         if (dart.test(this.containsKey(key))) {
-          return this.get(key);
+          return this._get(key);
         }
-        return this.set(key, ifAbsent());
+        return this._set(key, ifAbsent());
       }
       containsKey(key) {
         return this.keys[dartx.contains](key);
@@ -26167,7 +26492,7 @@
     let MapOfK$V = () => (MapOfK$V = dart.constFn(core.Map$(K, V)))();
     let VoidToV = () => (VoidToV = dart.constFn(dart.functionType(V, [])))();
     class _UnmodifiableMapMixin extends core.Object {
-      set(key, value) {
+      _set(key, value) {
         K._check(key);
         V._check(value);
         dart.throw(new core.UnsupportedError("Cannot modify unmodifiable map"));
@@ -26193,7 +26518,7 @@
     _UnmodifiableMapMixin[dart.implements] = () => [MapOfK$V()];
     dart.setSignature(_UnmodifiableMapMixin, {
       methods: () => ({
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
         clear: dart.definiteFunctionType(dart.void, []),
         remove: dart.definiteFunctionType(V, [core.Object]),
@@ -26201,7 +26526,7 @@
       })
     });
     dart.defineExtensionMembers(_UnmodifiableMapMixin, [
-      'set',
+      '_set',
       'addAll',
       'clear',
       'remove',
@@ -26237,13 +26562,13 @@
         return this[_map$0][dartx.isNotEmpty];
       }
       get first() {
-        return this[_map$0][dartx.get](this[_map$0][dartx.keys][dartx.first]);
+        return this[_map$0][dartx._get](this[_map$0][dartx.keys][dartx.first]);
       }
       get single() {
-        return this[_map$0][dartx.get](this[_map$0][dartx.keys][dartx.single]);
+        return this[_map$0][dartx._get](this[_map$0][dartx.keys][dartx.single]);
       }
       get last() {
-        return this[_map$0][dartx.get](this[_map$0][dartx.keys][dartx.last]);
+        return this[_map$0][dartx._get](this[_map$0][dartx.keys][dartx.last]);
       }
       get iterator() {
         return new (_MapBaseValueIteratorOfK$V())(this[_map$0]);
@@ -26284,7 +26609,7 @@
       }
       moveNext() {
         if (dart.test(this[_keys].moveNext())) {
-          this[_current$2] = this[_map$0][dartx.get](this[_keys].current);
+          this[_current$2] = this[_map$0][dartx._get](this[_keys].current);
           return true;
         }
         this[_current$2] = null;
@@ -26317,13 +26642,13 @@
       new(map) {
         this[_map$0] = map;
       }
-      get(key) {
-        return this[_map$0][dartx.get](key);
+      _get(key) {
+        return this[_map$0][dartx._get](key);
       }
-      set(key, value) {
+      _set(key, value) {
         K._check(key);
         V._check(value);
-        this[_map$0][dartx.set](key, value);
+        this[_map$0][dartx._set](key, value);
         return value;
       }
       addAll(other) {
@@ -26382,8 +26707,8 @@
         values: dart.definiteFunctionType(core.Iterable$(V), [])
       }),
       methods: () => ({
-        get: dart.definiteFunctionType(V, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _get: dart.definiteFunctionType(V, [core.Object]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
         clear: dart.definiteFunctionType(dart.void, []),
         putIfAbsent: dart.definiteFunctionType(V, [K, VoidToV()]),
@@ -26394,8 +26719,8 @@
       })
     });
     dart.defineExtensionMembers(MapView, [
-      'get',
-      'set',
+      '_get',
+      '_set',
       'addAll',
       'clear',
       'putIfAbsent',
@@ -26440,10 +26765,10 @@
     }
     static putIfAbsent(map, key, ifAbsent) {
       if (dart.test(map[dartx.containsKey](key))) {
-        return map[dartx.get](key);
+        return map[dartx._get](key);
       }
       let v = ifAbsent();
-      map[dartx.set](key, v);
+      map[dartx._set](key, v);
       return v;
     }
     static clear(map) {
@@ -26453,11 +26778,11 @@
     }
     static forEach(map, f) {
       for (let k of map[dartx.keys]) {
-        dart.dcall(f, k, map[dartx.get](k));
+        dart.dcall(f, k, map[dartx._get](k));
       }
     }
     static getValues(map) {
-      return map[dartx.keys][dartx.map](dart.dynamic)(dart.fn(key => map[dartx.get](key), dynamicTodynamic$()));
+      return map[dartx.keys][dartx.map](dart.dynamic)(dart.fn(key => map[dartx._get](key), dynamicTodynamic$()));
     }
     static length(map) {
       return map[dartx.keys][dartx.length];
@@ -26500,7 +26825,7 @@
       if (key == null) key = collection.Maps._id;
       if (value == null) value = collection.Maps._id;
       for (let element of iterable) {
-        map[dartx.set](dart.dcall(key, element), dart.dcall(value, element));
+        map[dartx._set](dart.dcall(key, element), dart.dcall(value, element));
       }
     }
     static _fillMapWithIterables(map, keys, values) {
@@ -26509,7 +26834,7 @@
       let hasNextKey = keyIterator.moveNext();
       let hasNextValue = valueIterator.moveNext();
       while (dart.test(hasNextKey) && dart.test(hasNextValue)) {
-        map[dartx.set](keyIterator.current, valueIterator.current);
+        map[dartx._set](keyIterator.current, valueIterator.current);
         hasNextKey = keyIterator.moveNext();
         hasNextValue = valueIterator.moveNext();
       }
@@ -26640,7 +26965,6 @@
         return this[_nextLink];
       }
     }
-    dart.setBaseClass(_UserDoubleLinkedQueueEntry, collection._DoubleLink$(_UserDoubleLinkedQueueEntry));
     _UserDoubleLinkedQueueEntry[dart.implements] = () => [DoubleLinkedQueueEntryOfE()];
     dart.setSignature(_UserDoubleLinkedQueueEntry, {
       constructors: () => ({new: dart.definiteFunctionType(collection._UserDoubleLinkedQueueEntry$(E), [E])}),
@@ -26654,6 +26978,8 @@
       })
     });
     return _UserDoubleLinkedQueueEntry;
+  }, _UserDoubleLinkedQueueEntry => {
+    dart.setBaseClass(_UserDoubleLinkedQueueEntry, collection._DoubleLink$(_UserDoubleLinkedQueueEntry));
   });
   collection._UserDoubleLinkedQueueEntry = _UserDoubleLinkedQueueEntry();
   const _queue = Symbol('_queue');
@@ -26683,7 +27009,6 @@
         return this[_previousLink][_asNonSentinelEntry]();
       }
     }
-    dart.setBaseClass(_DoubleLinkedQueueEntry, collection._DoubleLink$(_DoubleLinkedQueueEntry));
     dart.setSignature(_DoubleLinkedQueueEntry, {
       constructors: () => ({new: dart.definiteFunctionType(collection._DoubleLinkedQueueEntry$(E), [DoubleLinkedQueueOfE()])}),
       fields: () => ({[_queue]: DoubleLinkedQueueOfE()}),
@@ -26695,6 +27020,8 @@
       })
     });
     return _DoubleLinkedQueueEntry;
+  }, _DoubleLinkedQueueEntry => {
+    dart.setBaseClass(_DoubleLinkedQueueEntry, collection._DoubleLink$(_DoubleLinkedQueueEntry));
   });
   collection._DoubleLinkedQueueEntry = _DoubleLinkedQueueEntry();
   const _elementCount = Symbol('_elementCount');
@@ -26783,7 +27110,6 @@
   });
   collection._DoubleLinkedQueueSentinel = _DoubleLinkedQueueSentinel();
   const _sentinel = Symbol('_sentinel');
-  const _filter = Symbol('_filter');
   collection.DoubleLinkedQueue$ = dart.generic(E => {
     let _DoubleLinkedQueueSentinelOfE = () => (_DoubleLinkedQueueSentinelOfE = dart.constFn(collection._DoubleLinkedQueueSentinel$(E)))();
     let DoubleLinkedQueueOfE = () => (DoubleLinkedQueueOfE = dart.constFn(collection.DoubleLinkedQueue$(E)))();
@@ -27048,7 +27374,7 @@
           let queue = new (ListQueueOfE())(dart.notNull(length) + 1);
           dart.assert(dart.notNull(queue[_table][dartx.length]) > dart.notNull(length));
           for (let i = 0; i < dart.notNull(length); i++) {
-            queue[_table][dartx.set](i, E.as(elements[dartx.get](i)));
+            queue[_table][dartx._set](i, E.as(elements[dartx._get](i)));
           }
           queue[_tail] = length;
           return queue;
@@ -27070,7 +27396,7 @@
       forEach(action) {
         let modificationCount = this[_modificationCount];
         for (let i = this[_head]; i != this[_tail]; i = (dart.notNull(i) + 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0) {
-          action(this[_table][dartx.get](i));
+          action(this[_table][dartx._get](i));
           this[_checkModification](modificationCount);
         }
       }
@@ -27082,20 +27408,20 @@
       }
       get first() {
         if (this[_head] == this[_tail]) dart.throw(_internal.IterableElementError.noElement());
-        return this[_table][dartx.get](this[_head]);
+        return this[_table][dartx._get](this[_head]);
       }
       get last() {
         if (this[_head] == this[_tail]) dart.throw(_internal.IterableElementError.noElement());
-        return this[_table][dartx.get]((dart.notNull(this[_tail]) - 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0);
+        return this[_table][dartx._get]((dart.notNull(this[_tail]) - 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0);
       }
       get single() {
         if (this[_head] == this[_tail]) dart.throw(_internal.IterableElementError.noElement());
         if (dart.notNull(this.length) > 1) dart.throw(_internal.IterableElementError.tooMany());
-        return this[_table][dartx.get](this[_head]);
+        return this[_table][dartx._get](this[_head]);
       }
       elementAt(index) {
         core.RangeError.checkValidIndex(index, this);
-        return this[_table][dartx.get]((dart.notNull(this[_head]) + dart.notNull(index) & dart.notNull(this[_table][dartx.length]) - 1) >>> 0);
+        return this[_table][dartx._get]((dart.notNull(this[_head]) + dart.notNull(index) & dart.notNull(this[_table][dartx.length]) - 1) >>> 0);
       }
       toList(opts) {
         let growable = opts && 'growable' in opts ? opts.growable : true;
@@ -27143,7 +27469,7 @@
       }
       remove(value) {
         for (let i = this[_head]; i != this[_tail]; i = (dart.notNull(i) + 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0) {
-          let element = this[_table][dartx.get](i);
+          let element = this[_table][dartx._get](i);
           if (dart.equals(element, value)) {
             this[_remove](i);
             this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
@@ -27156,7 +27482,7 @@
         let modificationCount = this[_modificationCount];
         let i = this[_head];
         while (i != this[_tail]) {
-          let element = this[_table][dartx.get](i);
+          let element = this[_table][dartx._get](i);
           let remove = core.identical(removeMatching, test(element));
           this[_checkModification](modificationCount);
           if (remove) {
@@ -27176,7 +27502,7 @@
       clear() {
         if (this[_head] != this[_tail]) {
           for (let i = this[_head]; i != this[_tail]; i = (dart.notNull(i) + 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0) {
-            this[_table][dartx.set](i, null);
+            this[_table][dartx._set](i, null);
           }
           this[_head] = this[_tail] = 0;
           this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
@@ -27192,15 +27518,15 @@
       addFirst(value) {
         E._check(value);
         this[_head] = (dart.notNull(this[_head]) - 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0;
-        this[_table][dartx.set](this[_head], value);
+        this[_table][dartx._set](this[_head], value);
         if (this[_head] == this[_tail]) this[_grow]();
         this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
       }
       removeFirst() {
         if (this[_head] == this[_tail]) dart.throw(_internal.IterableElementError.noElement());
         this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
-        let result = this[_table][dartx.get](this[_head]);
-        this[_table][dartx.set](this[_head], null);
+        let result = this[_table][dartx._get](this[_head]);
+        this[_table][dartx._set](this[_head], null);
         this[_head] = (dart.notNull(this[_head]) + 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0;
         return result;
       }
@@ -27208,8 +27534,8 @@
         if (this[_head] == this[_tail]) dart.throw(_internal.IterableElementError.noElement());
         this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
         this[_tail] = (dart.notNull(this[_tail]) - 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0;
-        let result = this[_table][dartx.get](this[_tail]);
-        this[_table][dartx.set](this[_tail], null);
+        let result = this[_table][dartx._get](this[_tail]);
+        this[_table][dartx._set](this[_tail], null);
         return result;
       }
       static _isPowerOf2(number) {
@@ -27231,7 +27557,7 @@
       }
       [_add$0](element) {
         E._check(element);
-        this[_table][dartx.set](this[_tail], element);
+        this[_table][dartx._set](this[_tail], element);
         this[_tail] = (dart.notNull(this[_tail]) + 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0;
         if (this[_head] == this[_tail]) this[_grow]();
         this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
@@ -27244,10 +27570,10 @@
           let i = offset;
           while (i != this[_head]) {
             let prevOffset = (dart.notNull(i) - 1 & mask) >>> 0;
-            this[_table][dartx.set](i, this[_table][dartx.get](prevOffset));
+            this[_table][dartx._set](i, this[_table][dartx._get](prevOffset));
             i = prevOffset;
           }
-          this[_table][dartx.set](this[_head], null);
+          this[_table][dartx._set](this[_head], null);
           this[_head] = (dart.notNull(this[_head]) + 1 & mask) >>> 0;
           return (dart.notNull(offset) + 1 & mask) >>> 0;
         } else {
@@ -27255,10 +27581,10 @@
           let i = offset;
           while (i != this[_tail]) {
             let nextOffset = (dart.notNull(i) + 1 & mask) >>> 0;
-            this[_table][dartx.set](i, this[_table][dartx.get](nextOffset));
+            this[_table][dartx._set](i, this[_table][dartx._get](nextOffset));
             i = nextOffset;
           }
-          this[_table][dartx.set](this[_tail], null);
+          this[_table][dartx._set](this[_tail], null);
           return offset;
         }
       }
@@ -27380,7 +27706,7 @@
           this[_current$2] = null;
           return false;
         }
-        this[_current$2] = this[_queue][_table][dartx.get](this[_position]);
+        this[_current$2] = this[_queue][_table][dartx._get](this[_position]);
         this[_position] = (dart.notNull(this[_position]) + 1 & dart.notNull(this[_queue][_table][dartx.length]) - 1) >>> 0;
         return true;
       }
@@ -27655,7 +27981,7 @@
         if (isValidKey === void 0) isValidKey = null;
         let result = new (SplayTreeMapOfK$V())(compare, isValidKey);
         other[dartx.forEach](dart.fn((k, v) => {
-          result.set(K.as(k), V.as(v));
+          result._set(K.as(k), V.as(v));
         }, dynamicAnddynamicTovoid$()));
         return result;
       }
@@ -27687,7 +28013,7 @@
         this[_validKey] = null;
         super.new();
       }
-      get(key) {
+      _get(key) {
         if (!dart.test(dart.dcall(this[_validKey], key))) return null;
         if (this[_root] != null) {
           let comp = this[_splay](K.as(key));
@@ -27703,7 +28029,7 @@
         if (mapRoot != null) return mapRoot.value;
         return null;
       }
-      set(key, value) {
+      _set(key, value) {
         (() => {
           K._check(key);
           V._check(value);
@@ -27741,7 +28067,7 @@
       addAll(other) {
         MapOfK$V()._check(other);
         other[dartx.forEach](dart.fn((key, value) => {
-          this.set(key, value);
+          this._set(key, value);
         }, KAndVTovoid$()));
       }
       get isEmpty() {
@@ -27852,9 +28178,9 @@
       }),
       methods: () => ({
         [_compare]: dart.definiteFunctionType(core.int, [K, K]),
-        get: dart.definiteFunctionType(V, [core.Object]),
+        _get: dart.definiteFunctionType(V, [core.Object]),
         remove: dart.definiteFunctionType(V, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         putIfAbsent: dart.definiteFunctionType(V, [K, VoidToV()]),
         addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
         forEach: dart.definiteFunctionType(dart.void, [KAndVTovoid()]),
@@ -27868,9 +28194,9 @@
       })
     });
     dart.defineExtensionMembers(SplayTreeMap, [
-      'get',
+      '_get',
       'remove',
-      'set',
+      '_set',
       'putIfAbsent',
       'addAll',
       'forEach',
@@ -28290,14 +28616,12 @@
       }),
       getters: () => ({
         iterator: dart.definiteFunctionType(core.Iterator$(E), []),
-        length: dart.definiteFunctionType(core.int, []),
         first: dart.definiteFunctionType(E, []),
         last: dart.definiteFunctionType(E, []),
         single: dart.definiteFunctionType(E, [])
       }),
       methods: () => ({
         [_compare]: dart.definiteFunctionType(core.int, [E, E]),
-        contains: dart.definiteFunctionType(core.bool, [core.Object]),
         add: dart.definiteFunctionType(core.bool, [E]),
         remove: dart.definiteFunctionType(core.bool, [core.Object]),
         addAll: dart.definiteFunctionType(dart.void, [IterableOfE()]),
@@ -28345,7 +28669,7 @@
       let processed = map[_processed];
       let keys = map[_computeKeys$]();
       for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-        let key = keys[dartx.get](i);
+        let key = keys[dartx._get](i);
         let revived = dart.dcall(reviver, key, walk(e[key]));
         processed[key] = revived;
       }
@@ -28382,9 +28706,9 @@
       this[_original] = original;
       this[_data] = null;
     }
-    get(key) {
+    _get(key) {
       if (dart.test(this[_isUpgraded])) {
-        return this[_upgradedMap][dartx.get](key);
+        return this[_upgradedMap][dartx._get](key);
       } else if (!(typeof key == 'string')) {
         return null;
       } else {
@@ -28408,11 +28732,11 @@
     }
     get values() {
       if (dart.test(this[_isUpgraded])) return this[_upgradedMap][dartx.values];
-      return MappedIterableOfString$dynamic().new(this[_computeKeys$](), dart.fn(each => this.get(each), dynamicTodynamic$()));
+      return MappedIterableOfString$dynamic().new(this[_computeKeys$](), dart.fn(each => this._get(each), dynamicTodynamic$()));
     }
-    set(key, value) {
+    _set(key, value) {
       if (dart.test(this[_isUpgraded])) {
-        this[_upgradedMap][dartx.set](key, value);
+        this[_upgradedMap][dartx._set](key, value);
       } else if (dart.test(this.containsKey(key))) {
         let processed = this[_processed];
         convert._JsonMap._setProperty(processed, core.String._check(key), value);
@@ -28421,21 +28745,21 @@
           convert._JsonMap._setProperty(original, core.String._check(key), null);
         }
       } else {
-        this[_upgrade]()[dartx.set](key, value);
+        this[_upgrade]()[dartx._set](key, value);
       }
       return value;
     }
     addAll(other) {
       other[dartx.forEach](dart.fn((key, value) => {
-        this.set(key, value);
+        this._set(key, value);
       }, dynamicAnddynamicTovoid$()));
     }
     containsValue(value) {
       if (dart.test(this[_isUpgraded])) return this[_upgradedMap][dartx.containsValue](value);
       let keys = this[_computeKeys$]();
       for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-        let key = keys[dartx.get](i);
-        if (dart.equals(this.get(key), value)) return true;
+        let key = keys[dartx._get](i);
+        if (dart.equals(this._get(key), value)) return true;
       }
       return false;
     }
@@ -28445,9 +28769,9 @@
       return convert._JsonMap._hasProperty(this[_original], core.String._check(key));
     }
     putIfAbsent(key, ifAbsent) {
-      if (dart.test(this.containsKey(key))) return this.get(key);
+      if (dart.test(this.containsKey(key))) return this._get(key);
       let value = ifAbsent();
-      this.set(key, value);
+      this._set(key, value);
       return value;
     }
     remove(key) {
@@ -28469,7 +28793,7 @@
       if (dart.test(this[_isUpgraded])) return this[_upgradedMap][dartx.forEach](f);
       let keys = this[_computeKeys$]();
       for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-        let key = keys[dartx.get](i);
+        let key = keys[dartx._get](i);
         let value = convert._JsonMap._getProperty(this[_processed], key);
         if (dart.test(convert._JsonMap._isUnprocessed(value))) {
           value = convert._convertJsonToDartLazy(convert._JsonMap._getProperty(this[_original], key));
@@ -28504,8 +28828,8 @@
       let result = dart.map();
       let keys = this[_computeKeys$]();
       for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-        let key = keys[dartx.get](i);
-        result[dartx.set](key, this.get(key));
+        let key = keys[dartx._get](i);
+        result[dartx._set](key, this._get(key));
       }
       if (dart.test(keys[dartx.isEmpty])) {
         keys[dartx.add](null);
@@ -28559,8 +28883,8 @@
       [_upgradedMap]: dart.definiteFunctionType(core.Map, [])
     }),
     methods: () => ({
-      get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
-      set: dart.definiteFunctionType(dart.void, [dart.dynamic, dart.dynamic]),
+      _get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
+      _set: dart.definiteFunctionType(dart.void, [dart.dynamic, dart.dynamic]),
       addAll: dart.definiteFunctionType(dart.void, [core.Map]),
       containsValue: dart.definiteFunctionType(core.bool, [core.Object]),
       containsKey: dart.definiteFunctionType(core.bool, [core.Object]),
@@ -28583,8 +28907,8 @@
     names: ['_hasProperty', '_getProperty', '_setProperty', '_getPropertyNames', '_isUnprocessed', '_newJavaScriptObject']
   });
   dart.defineExtensionMembers(convert._JsonMap, [
-    'get',
-    'set',
+    '_get',
+    '_set',
     'addAll',
     'containsValue',
     'containsKey',
@@ -28608,7 +28932,7 @@
       return this[_parent].length;
     }
     elementAt(index) {
-      return core.String._check(dart.test(this[_parent][_isUpgraded]) ? this[_parent].keys[dartx.elementAt](index) : this[_parent][_computeKeys$]()[dartx.get](index));
+      return core.String._check(dart.test(this[_parent][_isUpgraded]) ? this[_parent].keys[dartx.elementAt](index) : this[_parent][_computeKeys$]()[dartx._get](index));
     }
     get iterator() {
       return dart.test(this[_parent][_isUpgraded]) ? this[_parent].keys[dartx.iterator] : this[_parent][_computeKeys$]()[dartx.iterator];
@@ -28711,9 +29035,7 @@
   let const$28;
   let const$29;
   convert.Codec$ = dart.generic((S, T) => {
-    let _FusedCodecOfS$T$dynamic = () => (_FusedCodecOfS$T$dynamic = dart.constFn(convert._FusedCodec$(S, T, dart.dynamic)))();
     let _InvertedCodecOfT$S = () => (_InvertedCodecOfT$S = dart.constFn(convert._InvertedCodec$(T, S)))();
-    let CodecOfT$dynamic = () => (CodecOfT$dynamic = dart.constFn(convert.Codec$(T, dart.dynamic)))();
     class Codec extends core.Object {
       new() {
       }
@@ -28725,9 +29047,11 @@
         T._check(encoded);
         return this.decoder.convert(encoded);
       }
-      fuse(other) {
-        CodecOfT$dynamic()._check(other);
-        return new (_FusedCodecOfS$T$dynamic())(this, other);
+      fuse(R) {
+        return other => {
+          convert.Codec$(T, R)._check(other);
+          return new (convert._FusedCodec$(S, T, R))(this, other);
+        };
       }
       get inverted() {
         return new (_InvertedCodecOfT$S())(this);
@@ -28740,7 +29064,7 @@
       methods: () => ({
         encode: dart.definiteFunctionType(T, [S]),
         decode: dart.definiteFunctionType(S, [T]),
-        fuse: dart.definiteFunctionType(convert.Codec$(S, dart.dynamic), [CodecOfT$dynamic()])
+        fuse: dart.definiteFunctionType(R => [convert.Codec$(S, R), [convert.Codec$(T, R)]])
       })
     });
     return Codec;
@@ -28852,7 +29176,7 @@
         let result = ListOfE().new(length);
         if (length != 0 && fill != null) {
           for (let i = 0; i < dart.notNull(result[dartx.length]); i++) {
-            result[dartx.set](i, fill);
+            result[dartx._set](i, fill);
           }
         }
         return result;
@@ -28876,7 +29200,7 @@
           result = ListOfE().new(length);
         }
         for (let i = 0; i < dart.notNull(length); i++) {
-          result[dartx.set](i, generator(i));
+          result[dartx._set](i, generator(i));
         }
         return result;
       }
@@ -28915,7 +29239,7 @@
     static getByName(name) {
       if (name == null) return null;
       name = name[dartx.toLowerCase]();
-      return convert.Encoding._nameToEncoding[dartx.get](name);
+      return convert.Encoding._nameToEncoding[dartx._get](name);
     }
   };
   dart.addSimpleTypeTests(convert.Encoding);
@@ -29026,7 +29350,7 @@
         if ((dart.notNull(codeUnit) & ~dart.notNull(this[_subsetMask])) != 0) {
           dart.throw(new core.ArgumentError("String contains invalid characters."));
         }
-        result[dartx.set](i, codeUnit);
+        result[dartx._set](i, codeUnit);
       }
       return result;
     }
@@ -29105,7 +29429,7 @@
       core.RangeError.checkValidRange(start, end, byteCount);
       if (end == null) end = byteCount;
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        let byte = bytes[dartx.get](i);
+        let byte = bytes[dartx._get](i);
         if ((dart.notNull(byte) & ~dart.notNull(this[_subsetMask])) != 0) {
           if (!dart.test(this[_allowInvalid])) {
             dart.throw(new core.FormatException(dart.str`Invalid value in input: ${byte}`));
@@ -29118,7 +29442,7 @@
     [_convertInvalid](bytes, start, end) {
       let buffer = new core.StringBuffer();
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        let value = bytes[dartx.get](i);
+        let value = bytes[dartx._get](i);
         if ((dart.notNull(value) & ~dart.notNull(this[_subsetMask])) != 0) value = 65533;
         buffer.writeCharCode(value);
       }
@@ -29234,7 +29558,7 @@
     addSlice(source, start, end, isLast) {
       core.RangeError.checkValidRange(start, end, source[dartx.length]);
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        if ((dart.notNull(source[dartx.get](i)) & ~convert._ASCII_MASK) != 0) {
+        if ((dart.notNull(source[dartx._get](i)) & ~convert._ASCII_MASK) != 0) {
           if (dart.notNull(i) > dart.notNull(start)) this[_utf8Sink].addSlice(source, start, i, false);
           this[_utf8Sink].add(const$30 || (const$30 = dart.constList([239, 191, 189], core.int)));
           start = dart.notNull(i) + 1;
@@ -29265,7 +29589,7 @@
     }
     add(source) {
       for (let i = 0; i < dart.notNull(source[dartx.length]); i++) {
-        if ((dart.notNull(source[dartx.get](i)) & ~convert._ASCII_MASK) != 0) {
+        if ((dart.notNull(source[dartx._get](i)) & ~convert._ASCII_MASK) != 0) {
           dart.throw(new core.FormatException("Source contains non-ASCII bytes."));
         }
       }
@@ -29406,27 +29730,27 @@
       let expectedChars = 3 - dart.notNull(convert._Base64Encoder._stateCount(state));
       let byteOr = 0;
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        let byte = bytes[dartx.get](i);
+        let byte = bytes[dartx._get](i);
         byteOr = (dart.notNull(byteOr) | dart.notNull(byte)) >>> 0;
         bits = (dart.notNull(bits) << 8 | dart.notNull(byte)) & 16777215;
         expectedChars--;
         if (expectedChars == 0) {
-          output[dartx.set]((() => {
+          output[dartx._set]((() => {
             let x = outputIndex;
             outputIndex = dart.notNull(x) + 1;
             return x;
           })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 18 & convert._Base64Encoder._sixBitMask));
-          output[dartx.set]((() => {
+          output[dartx._set]((() => {
             let x = outputIndex;
             outputIndex = dart.notNull(x) + 1;
             return x;
           })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 12 & convert._Base64Encoder._sixBitMask));
-          output[dartx.set]((() => {
+          output[dartx._set]((() => {
             let x = outputIndex;
             outputIndex = dart.notNull(x) + 1;
             return x;
           })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 6 & convert._Base64Encoder._sixBitMask));
-          output[dartx.set]((() => {
+          output[dartx._set]((() => {
             let x = outputIndex;
             outputIndex = dart.notNull(x) + 1;
             return x;
@@ -29444,53 +29768,53 @@
       }
       let i = start;
       while (dart.notNull(i) < dart.notNull(end)) {
-        let byte = bytes[dartx.get](i);
+        let byte = bytes[dartx._get](i);
         if (dart.notNull(byte) < 0 || dart.notNull(byte) > 255) break;
         i = dart.notNull(i) + 1;
       }
-      dart.throw(new core.ArgumentError.value(bytes, dart.str`Not a byte value at index ${i}: 0x${bytes[dartx.get](i)[dartx.toRadixString](16)}`));
+      dart.throw(new core.ArgumentError.value(bytes, dart.str`Not a byte value at index ${i}: 0x${bytes[dartx._get](i)[dartx.toRadixString](16)}`));
     }
     static writeFinalChunk(alphabet, output, outputIndex, count, bits) {
       dart.assert(dart.notNull(count) > 0);
       if (count == 1) {
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 2 & convert._Base64Encoder._sixBitMask));
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) << 4 & convert._Base64Encoder._sixBitMask));
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), convert._paddingChar);
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), convert._paddingChar);
       } else {
         dart.assert(count == 2);
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 10 & convert._Base64Encoder._sixBitMask));
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 4 & convert._Base64Encoder._sixBitMask));
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) << 2 & convert._Base64Encoder._sixBitMask));
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
@@ -29702,23 +30026,23 @@
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
         let char = input[dartx.codeUnitAt](i);
         charOr = (dart.notNull(charOr) | dart.notNull(char)) >>> 0;
-        let code = convert._Base64Decoder._inverseAlphabet[dartx.get]((dart.notNull(char) & asciiMask) >>> 0);
+        let code = convert._Base64Decoder._inverseAlphabet[dartx._get]((dart.notNull(char) & asciiMask) >>> 0);
         if (dart.notNull(code) >= 0) {
           bits = (bits[dartx['<<']](bitsPerCharacter) | dart.notNull(code)) & 16777215;
           count = dart.notNull(count) + 1 & 3;
           if (count == 0) {
             dart.assert(dart.notNull(outIndex) + 3 <= dart.notNull(output[dartx.length]));
-            output[dartx.set]((() => {
+            output[dartx._set]((() => {
               let x = outIndex;
               outIndex = dart.notNull(x) + 1;
               return x;
             })(), (bits[dartx['>>']](16) & eightBitMask) >>> 0);
-            output[dartx.set]((() => {
+            output[dartx._set]((() => {
               let x = outIndex;
               outIndex = dart.notNull(x) + 1;
               return x;
             })(), (bits[dartx['>>']](8) & eightBitMask) >>> 0);
-            output[dartx.set]((() => {
+            output[dartx._set]((() => {
               let x = outIndex;
               outIndex = dart.notNull(x) + 1;
               return x;
@@ -29732,12 +30056,12 @@
             if ((dart.notNull(bits) & 3) != 0) {
               dart.throw(new core.FormatException("Invalid encoding before padding", input, i));
             }
-            output[dartx.set]((() => {
+            output[dartx._set]((() => {
               let x = outIndex;
               outIndex = dart.notNull(x) + 1;
               return x;
             })(), bits[dartx['>>']](10));
-            output[dartx.set]((() => {
+            output[dartx._set]((() => {
               let x = outIndex;
               outIndex = dart.notNull(x) + 1;
               return x;
@@ -29746,7 +30070,7 @@
             if ((dart.notNull(bits) & 15) != 0) {
               dart.throw(new core.FormatException("Invalid encoding before padding", input, i));
             }
-            output[dartx.set]((() => {
+            output[dartx._set]((() => {
               let x = outIndex;
               outIndex = dart.notNull(x) + 1;
               return x;
@@ -30298,7 +30622,7 @@
     [_convert](text, start, end) {
       let result = null;
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        let ch = text[dartx.get](i);
+        let ch = text[dartx._get](i);
         let replacement = null;
         switch (ch) {
           case '&':
@@ -30570,14 +30894,14 @@
       }
       dart.fn(addChunk, Uint8ListAndintAndintTovoid$());
       convert._JsonUtf8Stringifier.stringify(object, this[_indent], this[_toEncodable], this[_bufferSize], addChunk);
-      if (bytes[dartx.length] == 1) return bytes[dartx.get](0);
+      if (bytes[dartx.length] == 1) return bytes[dartx._get](0);
       let length = 0;
       for (let i = 0; i < dart.notNull(bytes[dartx.length]); i++) {
-        length = dart.notNull(length) + dart.notNull(bytes[dartx.get](i)[dartx.length]);
+        length = dart.notNull(length) + dart.notNull(bytes[dartx._get](i)[dartx.length]);
       }
       let result = typed_data.Uint8List.new(length);
       for (let i = 0, offset = 0; i < dart.notNull(bytes[dartx.length]); i++) {
-        let byteList = bytes[dartx.get](i);
+        let byteList = bytes[dartx._get](i);
         let end = offset + dart.notNull(byteList[dartx.length]);
         result[dartx.setRange](offset, end, byteList);
         offset = end;
@@ -30814,7 +31138,7 @@
     }
     [_checkCycle](object) {
       for (let i = 0; i < dart.notNull(this[_seen][dartx.length]); i++) {
-        if (core.identical(object, this[_seen][dartx.get](i))) {
+        if (core.identical(object, this[_seen][dartx._get](i))) {
           dart.throw(new convert.JsonCyclicError(object));
         }
       }
@@ -30875,10 +31199,10 @@
     writeList(list) {
       this.writeString('[');
       if (dart.notNull(list[dartx.length]) > 0) {
-        this.writeObject(list[dartx.get](0));
+        this.writeObject(list[dartx._get](0));
         for (let i = 1; i < dart.notNull(list[dartx.length]); i++) {
           this.writeString(',');
-          this.writeObject(list[dartx.get](i));
+          this.writeObject(list[dartx._get](i));
         }
       }
       this.writeString(']');
@@ -30895,8 +31219,8 @@
         if (!(typeof key == 'string')) {
           allStringKeys = false;
         }
-        keyValueList[dartx.set](i++, key);
-        keyValueList[dartx.set](i++, value);
+        keyValueList[dartx._set](i++, key);
+        keyValueList[dartx._set](i++, value);
       }, dynamicAnddynamicTovoid$()));
       if (!allStringKeys) return false;
       this.writeString('{');
@@ -30904,9 +31228,9 @@
       for (let i = 0; i < dart.notNull(keyValueList[dartx.length]); i = i + 2) {
         this.writeString(separator);
         separator = ',"';
-        this.writeStringContent(core.String._check(keyValueList[dartx.get](i)));
+        this.writeStringContent(core.String._check(keyValueList[dartx._get](i)));
         this.writeString('":');
-        this.writeObject(keyValueList[dartx.get](i + 1));
+        this.writeObject(keyValueList[dartx._get](i + 1));
       }
       this.writeString('}');
       return true;
@@ -30972,11 +31296,11 @@
         this.writeString('[\n');
         this[_indentLevel] = dart.notNull(this[_indentLevel]) + 1;
         this.writeIndentation(this[_indentLevel]);
-        this.writeObject(list[dartx.get](0));
+        this.writeObject(list[dartx._get](0));
         for (let i = 1; i < dart.notNull(list[dartx.length]); i++) {
           this.writeString(',\n');
           this.writeIndentation(this[_indentLevel]);
-          this.writeObject(list[dartx.get](i));
+          this.writeObject(list[dartx._get](i));
         }
         this.writeString('\n');
         this[_indentLevel] = dart.notNull(this[_indentLevel]) - 1;
@@ -30996,8 +31320,8 @@
         if (!(typeof key == 'string')) {
           allStringKeys = false;
         }
-        keyValueList[dartx.set](i++, key);
-        keyValueList[dartx.set](i++, value);
+        keyValueList[dartx._set](i++, key);
+        keyValueList[dartx._set](i++, value);
       }, dynamicAnddynamicTovoid$()));
       if (!allStringKeys) return false;
       this.writeString('{\n');
@@ -31008,9 +31332,9 @@
         separator = ",\n";
         this.writeIndentation(this[_indentLevel]);
         this.writeString('"');
-        this.writeStringContent(core.String._check(keyValueList[dartx.get](i)));
+        this.writeStringContent(core.String._check(keyValueList[dartx._get](i)));
         this.writeString('": ');
-        this.writeObject(keyValueList[dartx.get](i + 1));
+        this.writeObject(keyValueList[dartx._get](i + 1));
       }
       this.writeString('\n');
       this[_indentLevel] = dart.notNull(this[_indentLevel]) - 1;
@@ -31182,7 +31506,7 @@
         this.buffer = typed_data.Uint8List.new(this.bufferSize);
         this.index = 0;
       }
-      this.buffer[dartx.set]((() => {
+      this.buffer[dartx._set]((() => {
         let x = this.index;
         this.index = dart.notNull(x) + 1;
         return x;
@@ -31220,7 +31544,7 @@
       let indent = this.indent;
       let indentLength = indent[dartx.length];
       if (indentLength == 1) {
-        let char = indent[dartx.get](0);
+        let char = indent[dartx._get](0);
         while (dart.notNull(count) > 0) {
           this.writeByte(char);
           count = dart.notNull(count) - 1;
@@ -31235,7 +31559,7 @@
           this.index = end;
         } else {
           for (let i = 0; i < dart.notNull(indentLength); i++) {
-            this.writeByte(indent[dartx.get](i));
+            this.writeByte(indent[dartx._get](i));
           }
         }
       }
@@ -31344,7 +31668,7 @@
     static _checkValidLatin1(source, start, end) {
       let mask = 0;
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        mask = (dart.notNull(mask) | dart.notNull(source[dartx.get](i))) >>> 0;
+        mask = (dart.notNull(mask) | dart.notNull(source[dartx._get](i))) >>> 0;
       }
       if (dart.notNull(mask) >= 0 && dart.notNull(mask) <= convert._LATIN1_MASK) {
         return;
@@ -31353,7 +31677,7 @@
     }
     static _reportInvalidLatin1(source, start, end) {
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        let char = source[dartx.get](i);
+        let char = source[dartx._get](i);
         if (dart.notNull(char) < 0 || dart.notNull(char) > convert._LATIN1_MASK) {
           dart.throw(new core.FormatException("Source contains non-Latin-1 characters.", source, i));
         }
@@ -31383,7 +31707,7 @@
     addSlice(source, start, end, isLast) {
       core.RangeError.checkValidRange(start, end, source[dartx.length]);
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        let char = source[dartx.get](i);
+        let char = source[dartx._get](i);
         if (dart.notNull(char) > convert._LATIN1_MASK || dart.notNull(char) < 0) {
           if (dart.notNull(i) > dart.notNull(start)) this[_addSliceToSink](source, start, i, false);
           this[_addSliceToSink](const$49 || (const$49 = dart.constList([65533], core.int)), 0, 1, false);
@@ -31923,39 +32247,39 @@
         let rune = convert._combineSurrogatePair(leadingSurrogate, nextCodeUnit);
         dart.assert(dart.notNull(rune) > convert._THREE_BYTE_LIMIT);
         dart.assert(dart.notNull(rune) <= convert._FOUR_BYTE_LIMIT);
-        this[_buffer][dartx.set]((() => {
+        this[_buffer][dartx._set]((() => {
           let x = this[_bufferIndex];
           this[_bufferIndex] = dart.notNull(x) + 1;
           return x;
         })(), (240 | rune[dartx['>>']](18)) >>> 0);
-        this[_buffer][dartx.set]((() => {
+        this[_buffer][dartx._set]((() => {
           let x = this[_bufferIndex];
           this[_bufferIndex] = dart.notNull(x) + 1;
           return x;
         })(), 128 | dart.notNull(rune) >> 12 & 63);
-        this[_buffer][dartx.set]((() => {
+        this[_buffer][dartx._set]((() => {
           let x = this[_bufferIndex];
           this[_bufferIndex] = dart.notNull(x) + 1;
           return x;
         })(), 128 | dart.notNull(rune) >> 6 & 63);
-        this[_buffer][dartx.set]((() => {
+        this[_buffer][dartx._set]((() => {
           let x = this[_bufferIndex];
           this[_bufferIndex] = dart.notNull(x) + 1;
           return x;
         })(), 128 | dart.notNull(rune) & 63);
         return true;
       } else {
-        this[_buffer][dartx.set]((() => {
+        this[_buffer][dartx._set]((() => {
           let x = this[_bufferIndex];
           this[_bufferIndex] = dart.notNull(x) + 1;
           return x;
         })(), (224 | leadingSurrogate[dartx['>>']](12)) >>> 0);
-        this[_buffer][dartx.set]((() => {
+        this[_buffer][dartx._set]((() => {
           let x = this[_bufferIndex];
           this[_bufferIndex] = dart.notNull(x) + 1;
           return x;
         })(), 128 | dart.notNull(leadingSurrogate) >> 6 & 63);
-        this[_buffer][dartx.set]((() => {
+        this[_buffer][dartx._set]((() => {
           let x = this[_bufferIndex];
           this[_bufferIndex] = dart.notNull(x) + 1;
           return x;
@@ -31972,7 +32296,7 @@
         let codeUnit = str[dartx.codeUnitAt](stringIndex);
         if (dart.notNull(codeUnit) <= convert._ONE_BYTE_LIMIT) {
           if (dart.notNull(this[_bufferIndex]) >= dart.notNull(this[_buffer][dartx.length])) break;
-          this[_buffer][dartx.set]((() => {
+          this[_buffer][dartx._set]((() => {
             let x = this[_bufferIndex];
             this[_bufferIndex] = dart.notNull(x) + 1;
             return x;
@@ -31988,12 +32312,12 @@
           let rune = codeUnit;
           if (dart.notNull(rune) <= convert._TWO_BYTE_LIMIT) {
             if (dart.notNull(this[_bufferIndex]) + 1 >= dart.notNull(this[_buffer][dartx.length])) break;
-            this[_buffer][dartx.set]((() => {
+            this[_buffer][dartx._set]((() => {
               let x = this[_bufferIndex];
               this[_bufferIndex] = dart.notNull(x) + 1;
               return x;
             })(), (192 | rune[dartx['>>']](6)) >>> 0);
-            this[_buffer][dartx.set]((() => {
+            this[_buffer][dartx._set]((() => {
               let x = this[_bufferIndex];
               this[_bufferIndex] = dart.notNull(x) + 1;
               return x;
@@ -32001,17 +32325,17 @@
           } else {
             dart.assert(dart.notNull(rune) <= convert._THREE_BYTE_LIMIT);
             if (dart.notNull(this[_bufferIndex]) + 2 >= dart.notNull(this[_buffer][dartx.length])) break;
-            this[_buffer][dartx.set]((() => {
+            this[_buffer][dartx._set]((() => {
               let x = this[_bufferIndex];
               this[_bufferIndex] = dart.notNull(x) + 1;
               return x;
             })(), (224 | rune[dartx['>>']](12)) >>> 0);
-            this[_buffer][dartx.set]((() => {
+            this[_buffer][dartx._set]((() => {
               let x = this[_bufferIndex];
               this[_bufferIndex] = dart.notNull(x) + 1;
               return x;
             })(), 128 | dart.notNull(rune) >> 6 & 63);
-            this[_buffer][dartx.set]((() => {
+            this[_buffer][dartx._set]((() => {
               let x = this[_bufferIndex];
               this[_bufferIndex] = dart.notNull(x) + 1;
               return x;
@@ -32238,7 +32562,7 @@
                 if (i == endIndex) {
                   break loop;
                 }
-                let unit = codeUnits[dartx.get](i);
+                let unit = codeUnits[dartx._get](i);
                 if ((dart.notNull(unit) & 192) != 128) {
                   expectedUnits = 0;
                   if (!dart.test(this[_allowMalformed])) {
@@ -32253,7 +32577,7 @@
                   i = dart.notNull(i) + 1;
                 }
               } while (dart.notNull(expectedUnits) > 0);
-              if (dart.notNull(value) <= dart.notNull(convert._Utf8Decoder._LIMITS[dartx.get](dart.notNull(extraUnits) - 1))) {
+              if (dart.notNull(value) <= dart.notNull(convert._Utf8Decoder._LIMITS[dartx._get](dart.notNull(extraUnits) - 1))) {
                 if (!dart.test(this[_allowMalformed])) {
                   dart.throw(new core.FormatException(dart.str`Overlong encoding of 0x${value[dartx.toRadixString](16)}`));
                 }
@@ -32279,7 +32603,7 @@
               i = dart.notNull(i) + dart.notNull(oneBytes);
               if (i == endIndex) break;
             }
-            let unit = codeUnits[dartx.get]((() => {
+            let unit = codeUnits[dartx._get]((() => {
               let x = i;
               i = dart.notNull(x) + 1;
               return x;
@@ -32475,23 +32799,23 @@
           return result;
         }
         dart.fn(parseMilliAndMicroseconds, StringToint$());
-        let years = core.int.parse(match.get(1));
-        let month = core.int.parse(match.get(2));
-        let day = core.int.parse(match.get(3));
-        let hour = parseIntOrZero(match.get(4));
-        let minute = parseIntOrZero(match.get(5));
-        let second = parseIntOrZero(match.get(6));
+        let years = core.int.parse(match._get(1));
+        let month = core.int.parse(match._get(2));
+        let day = core.int.parse(match._get(3));
+        let hour = parseIntOrZero(match._get(4));
+        let minute = parseIntOrZero(match._get(5));
+        let second = parseIntOrZero(match._get(6));
         let addOneMillisecond = false;
-        let milliAndMicroseconds = parseMilliAndMicroseconds(match.get(7));
+        let milliAndMicroseconds = parseMilliAndMicroseconds(match._get(7));
         let millisecond = (dart.notNull(milliAndMicroseconds) / core.Duration.MICROSECONDS_PER_MILLISECOND)[dartx.truncate]();
         let microsecond = dart.asInt(milliAndMicroseconds[dartx.remainder](core.Duration.MICROSECONDS_PER_MILLISECOND));
         let isUtc = false;
-        if (match.get(8) != null) {
+        if (match._get(8) != null) {
           isUtc = true;
-          if (match.get(9) != null) {
-            let sign = match.get(9) == '-' ? -1 : 1;
-            let hourDifference = core.int.parse(match.get(10));
-            let minuteDifference = parseIntOrZero(match.get(11));
+          if (match._get(9) != null) {
+            let sign = match._get(9) == '-' ? -1 : 1;
+            let hourDifference = core.int.parse(match._get(10));
+            let minuteDifference = parseIntOrZero(match._get(11));
             minuteDifference = dart.notNull(minuteDifference) + 60 * dart.notNull(hourDifference);
             minute = dart.notNull(minute) - sign * dart.notNull(minuteDifference);
           }
@@ -32861,7 +33185,7 @@
       }
       dart.fn(twoDigits, intToString());
       if (dart.notNull(this.inMicroseconds) < 0) {
-        return dart.str`-${this['unary-']()}`;
+        return dart.str`-${this._negate()}`;
       }
       let twoDigitMinutes = twoDigits(dart.asInt(this.inMinutes[dartx.remainder](core.Duration.MINUTES_PER_HOUR)));
       let twoDigitSeconds = twoDigits(dart.asInt(this.inSeconds[dartx.remainder](core.Duration.SECONDS_PER_MINUTE)));
@@ -32874,7 +33198,7 @@
     abs() {
       return new core.Duration._microseconds(this[_duration][dartx.abs]());
     }
-    ['unary-']() {
+    _negate() {
       return new core.Duration._microseconds(-dart.notNull(this[_duration]));
     }
   };
@@ -32906,7 +33230,7 @@
       '>=': dart.definiteFunctionType(core.bool, [core.Duration]),
       compareTo: dart.definiteFunctionType(core.int, [core.Duration]),
       abs: dart.definiteFunctionType(core.Duration, []),
-      'unary-': dart.definiteFunctionType(core.Duration, [])
+      _negate: dart.definiteFunctionType(core.Duration, [])
     }),
     sfields: () => ({
       MICROSECONDS_PER_MILLISECOND: core.int,
@@ -33236,7 +33560,7 @@
           if (i > 0) {
             sb.write(", ");
           }
-          sb.write(core.Error.safeToString(this[_arguments][dartx.get](i)));
+          sb.write(core.Error.safeToString(this[_arguments][dartx._get](i)));
         }
       }
       if (this[_namedArguments] != null) {
@@ -33259,7 +33583,7 @@
           if (i > 0) {
             sb.write(", ");
           }
-          sb.write(this[_existingArgumentNames][dartx.get](i));
+          sb.write(this[_existingArgumentNames][dartx._get](i));
         }
         let formalParameters = sb.toString();
         return "NoSuchMethodError: incorrect number of arguments passed to " + dart.str`method named '${this[_memberName]}'\n` + dart.str`Receiver: ${core.Error.safeToString(this[_receiver$])}\n` + dart.str`Tried calling: ${this[_memberName]}(${actualParameters})\n` + dart.str`Found: ${this[_memberName]}(${formalParameters})`;
@@ -33517,11 +33841,11 @@
       toString() {
         return dart.str`Expando:${this.name}`;
       }
-      get(object) {
+      _get(object) {
         let values = _js_helper.Primitives.getProperty(object, core.Expando._EXPANDO_PROPERTY_NAME);
         return T._check(values == null ? null : _js_helper.Primitives.getProperty(values, this[_getKey]()));
       }
-      set(object, value) {
+      _set(object, value) {
         T._check(value);
         let values = _js_helper.Primitives.getProperty(object, core.Expando._EXPANDO_PROPERTY_NAME);
         if (values == null) {
@@ -33549,8 +33873,8 @@
       constructors: () => ({new: dart.definiteFunctionType(core.Expando$(T), [], [core.String])}),
       fields: () => ({name: core.String}),
       methods: () => ({
-        get: dart.definiteFunctionType(T, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [core.Object, T]),
+        _get: dart.definiteFunctionType(T, [core.Object]),
+        _set: dart.definiteFunctionType(dart.void, [core.Object, T]),
         [_getKey]: dart.definiteFunctionType(core.String, [])
       }),
       sfields: () => ({
@@ -33573,7 +33897,7 @@
     static _toMangledNames(namedArguments) {
       let result = dart.map({}, core.String, dart.dynamic);
       namedArguments[dartx.forEach](dart.fn((symbol, value) => {
-        result[dartx.set](core._symbolToString(symbol), value);
+        result[dartx._set](core._symbolToString(symbol), value);
       }, SymbolAnddynamicTovoid()));
       return result;
     }
@@ -34051,7 +34375,7 @@
     }
     get currentAsString() {
       if (this[_position$] == this[_nextPosition]) return null;
-      if (dart.notNull(this[_position$]) + 1 == this[_nextPosition]) return this.string[dartx.get](this[_position$]);
+      if (dart.notNull(this[_position$]) + 1 == this[_nextPosition]) return this.string[dartx._get](this[_position$]);
       return this.string[dartx.substring](this[_position$], this[_nextPosition]);
     }
     moveNext() {
@@ -34739,7 +35063,7 @@
       if (this[_queryParameterLists] == null) {
         let queryParameterLists = core.Uri._splitQueryStringAll(this.query);
         for (let key of queryParameterLists[dartx.keys]) {
-          queryParameterLists[dartx.set](key, ListOfString().unmodifiable(core.Iterable._check(queryParameterLists[dartx.get](key))));
+          queryParameterLists[dartx._set](key, ListOfString().unmodifiable(core.Iterable._check(queryParameterLists[dartx._get](key))));
         }
         this[_queryParameterLists] = MapOfString$ListOfString().unmodifiable(queryParameterLists);
       }
@@ -34775,7 +35099,7 @@
       return core.Uri._normalizeRegName(host, start, end);
     }
     static _isRegNameChar(char) {
-      return dart.notNull(char) < 127 && (dart.notNull(core.Uri._regNameTable[dartx.get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0;
+      return dart.notNull(char) < 127 && (dart.notNull(core.Uri._regNameTable[dartx._get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0;
     }
     static _normalizeRegName(host, start, end) {
       let buffer = null;
@@ -34970,9 +35294,9 @@
       let codeUnits = null;
       if (dart.notNull(char) < 128) {
         codeUnits = ListOfint().new(3);
-        codeUnits[dartx.set](0, core.Uri._PERCENT);
-        codeUnits[dartx.set](1, core.Uri._hexDigits[dartx.codeUnitAt](char[dartx['>>']](4)));
-        codeUnits[dartx.set](2, core.Uri._hexDigits[dartx.codeUnitAt](dart.notNull(char) & 15));
+        codeUnits[dartx._set](0, core.Uri._PERCENT);
+        codeUnits[dartx._set](1, core.Uri._hexDigits[dartx.codeUnitAt](char[dartx['>>']](4)));
+        codeUnits[dartx._set](2, core.Uri._hexDigits[dartx.codeUnitAt](dart.notNull(char) & 15));
       } else {
         let flag = 192;
         let encodedBytes = 2;
@@ -34988,9 +35312,9 @@
         let index = 0;
         while (--encodedBytes >= 0) {
           let byte = (char[dartx['>>']](6 * encodedBytes) & 63 | flag) >>> 0;
-          codeUnits[dartx.set](index, core.Uri._PERCENT);
-          codeUnits[dartx.set](index + 1, core.Uri._hexDigits[dartx.codeUnitAt](byte[dartx['>>']](4)));
-          codeUnits[dartx.set](index + 2, core.Uri._hexDigits[dartx.codeUnitAt](byte & 15));
+          codeUnits[dartx._set](index, core.Uri._PERCENT);
+          codeUnits[dartx._set](index + 1, core.Uri._hexDigits[dartx.codeUnitAt](byte[dartx['>>']](4)));
+          codeUnits[dartx._set](index + 2, core.Uri._hexDigits[dartx.codeUnitAt](byte & 15));
           index = index + 3;
           flag = 128;
         }
@@ -35003,7 +35327,7 @@
       let index = start;
       while (dart.notNull(index) < dart.notNull(end)) {
         let char = component[dartx.codeUnitAt](index);
-        if (dart.notNull(char) < 127 && (dart.notNull(charTable[dartx.get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0) {
+        if (dart.notNull(char) < 127 && (dart.notNull(charTable[dartx._get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0) {
           index = dart.notNull(index) + 1;
         } else {
           let replacement = null;
@@ -35051,10 +35375,10 @@
       return dart.toString(buffer);
     }
     static _isSchemeCharacter(ch) {
-      return dart.notNull(ch) < 128 && (dart.notNull(core.Uri._schemeTable[dartx.get](ch[dartx['>>']](4))) & 1 << (dart.notNull(ch) & 15)) != 0;
+      return dart.notNull(ch) < 128 && (dart.notNull(core.Uri._schemeTable[dartx._get](ch[dartx['>>']](4))) & 1 << (dart.notNull(ch) & 15)) != 0;
     }
     static _isGeneralDelimiter(ch) {
-      return dart.notNull(ch) <= core.Uri._RIGHT_BRACKET && (dart.notNull(core.Uri._genDelimitersTable[dartx.get](ch[dartx['>>']](4))) & 1 << (dart.notNull(ch) & 15)) != 0;
+      return dart.notNull(ch) <= core.Uri._RIGHT_BRACKET && (dart.notNull(core.Uri._genDelimitersTable[dartx._get](ch[dartx['>>']](4))) & 1 << (dart.notNull(ch) & 15)) != 0;
     }
     get isAbsolute() {
       return this.scheme != "" && this.fragment == "";
@@ -35131,7 +35455,7 @@
           output[dartx.add](segment);
         }
       }
-      if (dart.test(output[dartx.isEmpty]) || output[dartx.length] == 1 && dart.test(output[dartx.get](0)[dartx.isEmpty])) {
+      if (dart.test(output[dartx.isEmpty]) || output[dartx.length] == 1 && dart.test(output[dartx._get](0)[dartx.isEmpty])) {
         return "./";
       }
       if (appendSlash || output[dartx.last] == '..') output[dartx.add]("");
@@ -35261,8 +35585,8 @@
     [_toWindowsFilePath]() {
       let hasDriveLetter = false;
       let segments = this.pathSegments;
-      if (dart.notNull(segments[dartx.length]) > 0 && segments[dartx.get](0)[dartx.length] == 2 && segments[dartx.get](0)[dartx.codeUnitAt](1) == core.Uri._COLON) {
-        core.Uri._checkWindowsDriveLetter(segments[dartx.get](0)[dartx.codeUnitAt](0), false);
+      if (dart.notNull(segments[dartx.length]) > 0 && segments[dartx._get](0)[dartx.length] == 2 && segments[dartx._get](0)[dartx.codeUnitAt](1) == core.Uri._COLON) {
+        core.Uri._checkWindowsDriveLetter(segments[dartx._get](0)[dartx.codeUnitAt](0), false);
         core.Uri._checkWindowsPathReservedCharacters(segments, false, 1);
         hasDriveLetter = true;
       } else {
@@ -35359,12 +35683,12 @@
         let index = element[dartx.indexOf]("=");
         if (index == -1) {
           if (element != "") {
-            map[dartx.set](core.Uri.decodeQueryComponent(element, {encoding: encoding}), "");
+            map[dartx._set](core.Uri.decodeQueryComponent(element, {encoding: encoding}), "");
           }
         } else if (index != 0) {
           let key = element[dartx.substring](0, index);
           let value = element[dartx.substring](dart.notNull(index) + 1);
-          map[dartx.set](core.Uri.decodeQueryComponent(key, {encoding: encoding}), core.Uri.decodeQueryComponent(value, {encoding: encoding}));
+          map[dartx._set](core.Uri.decodeQueryComponent(key, {encoding: encoding}), core.Uri.decodeQueryComponent(value, {encoding: encoding}));
         }
         return map;
       }, MapOfString$StringAndStringToMapOfString$String()));
@@ -35482,8 +35806,8 @@
         } catch (e) {
           try {
             let last = core.Uri.parseIPv4Address(host[dartx.substring](partStart, end));
-            parts[dartx.add]((dart.notNull(last[dartx.get](0)) << 8 | dart.notNull(last[dartx.get](1))) >>> 0);
-            parts[dartx.add]((dart.notNull(last[dartx.get](2)) << 8 | dart.notNull(last[dartx.get](3))) >>> 0);
+            parts[dartx.add]((dart.notNull(last[dartx._get](0)) << 8 | dart.notNull(last[dartx._get](1))) >>> 0);
+            parts[dartx.add]((dart.notNull(last[dartx._get](2)) << 8 | dart.notNull(last[dartx._get](3))) >>> 0);
           } catch (e) {
             error('invalid end of IPv6 address.', partStart);
           }
@@ -35500,17 +35824,17 @@
       }
       let bytes = typed_data.Uint8List.new(16);
       for (let i = 0, index = 0; i < dart.notNull(parts[dartx.length]); i++) {
-        let value = parts[dartx.get](i);
+        let value = parts[dartx._get](i);
         if (value == -1) {
           let wildCardLength = 9 - dart.notNull(parts[dartx.length]);
           for (let j = 0; j < wildCardLength; j++) {
-            bytes[dartx.set](index, 0);
-            bytes[dartx.set](index + 1, 0);
+            bytes[dartx._set](index, 0);
+            bytes[dartx._set](index + 1, 0);
             index = index + 2;
           }
         } else {
-          bytes[dartx.set](index, value[dartx['>>']](8));
-          bytes[dartx.set](index + 1, dart.notNull(value) & 255);
+          bytes[dartx._set](index, value[dartx['>>']](8));
+          bytes[dartx._set](index + 1, dart.notNull(value) & 255);
           index = index + 2;
         }
       }
@@ -35523,16 +35847,16 @@
       let result = new core.StringBuffer();
       let bytes = encoding.encode(text);
       for (let i = 0; i < dart.notNull(bytes[dartx.length]); i++) {
-        let byte = bytes[dartx.get](i);
-        if (dart.notNull(byte) < 128 && (dart.notNull(canonicalTable[dartx.get](byte[dartx['>>']](4))) & 1 << (dart.notNull(byte) & 15)) != 0) {
+        let byte = bytes[dartx._get](i);
+        if (dart.notNull(byte) < 128 && (dart.notNull(canonicalTable[dartx._get](byte[dartx['>>']](4))) & 1 << (dart.notNull(byte) & 15)) != 0) {
           result.writeCharCode(byte);
         } else if (dart.test(spaceToPlus) && byte == core.Uri._SPACE) {
           result.write('+');
         } else {
           let hexDigits = '0123456789ABCDEF';
           result.write('%');
-          result.write(hexDigits[dartx.get](dart.notNull(byte) >> 4 & 15));
-          result.write(hexDigits[dartx.get](dart.notNull(byte) & 15));
+          result.write(hexDigits[dartx._get](dart.notNull(byte) >> 4 & 15));
+          result.write(hexDigits[dartx._get](dart.notNull(byte) & 15));
         }
       }
       return result.toString();
@@ -35601,7 +35925,7 @@
       return core.Uri._LOWER_CASE_A <= lowerCase && lowerCase <= core.Uri._LOWER_CASE_Z;
     }
     static _isUnreservedChar(char) {
-      return dart.notNull(char) < 127 && (dart.notNull(core.Uri._unreservedTable[dartx.get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0;
+      return dart.notNull(char) < 127 && (dart.notNull(core.Uri._unreservedTable[dartx._get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0;
     }
   };
   dart.defineNamedConstructor(core.Uri, '_internal');
@@ -35819,7 +36143,7 @@
       let indices = JSArrayOfint().of([core.UriData._noScheme]);
       let charsetName = null;
       let encodingName = null;
-      if (parameters != null) charsetName = parameters[dartx.get]("charset");
+      if (parameters != null) charsetName = parameters[dartx._get]("charset");
       if (encoding == null) {
         if (charsetName != null) {
           encoding = convert.Encoding.getByName(charsetName);
@@ -35834,7 +36158,7 @@
       if (dart.test(base64)) {
         buffer.write(';base64,');
         indices[dartx.add](dart.notNull(buffer.length) - 1);
-        buffer.write(encoding.fuse(convert.BASE64).encode(content));
+        buffer.write(encoding.fuse(core.String)(convert.BASE64).encode(content));
       } else {
         buffer.write(',');
         core.UriData._uriEncodeBytes(core.UriData._uricTable, encoding.encode(content), buffer);
@@ -35935,7 +36259,7 @@
       if (this[_uriCache] != null) return this[_uriCache];
       let path = this[_text];
       let query = null;
-      let colonIndex = this[_separatorIndices][dartx.get](0);
+      let colonIndex = this[_separatorIndices][dartx._get](0);
       let queryIndex = this[_text][dartx.indexOf]('?', dart.notNull(colonIndex) + 1);
       let end = null;
       if (dart.notNull(queryIndex) >= 0) {
@@ -35947,8 +36271,8 @@
       return this[_uriCache];
     }
     get mimeType() {
-      let start = dart.notNull(this[_separatorIndices][dartx.get](0)) + 1;
-      let end = this[_separatorIndices][dartx.get](1);
+      let start = dart.notNull(this[_separatorIndices][dartx._get](0)) + 1;
+      let end = this[_separatorIndices][dartx._get](1);
       if (start == end) return "text/plain";
       return core.Uri._uriDecode(this[_text], start, end, convert.UTF8, false);
     }
@@ -35959,10 +36283,10 @@
         parameterEnd = parameterEnd - 1;
       }
       for (let i = parameterStart; i < parameterEnd; i = i + 2) {
-        let keyStart = dart.notNull(this[_separatorIndices][dartx.get](i)) + 1;
-        let keyEnd = this[_separatorIndices][dartx.get](i + 1);
+        let keyStart = dart.notNull(this[_separatorIndices][dartx._get](i)) + 1;
+        let keyEnd = this[_separatorIndices][dartx._get](i + 1);
         if (keyEnd == keyStart + 7 && dart.test(this[_text][dartx.startsWith]("charset", keyStart))) {
-          return core.Uri._uriDecode(this[_text], dart.notNull(keyEnd) + 1, this[_separatorIndices][dartx.get](i + 2), convert.UTF8, false);
+          return core.Uri._uriDecode(this[_text], dart.notNull(keyEnd) + 1, this[_separatorIndices][dartx._get](i + 2), convert.UTF8, false);
         }
       }
       return "US-ASCII";
@@ -35997,14 +36321,14 @@
       for (let i = start; i < dart.notNull(text[dartx.length]); i++) {
         let codeUnit = text[dartx.codeUnitAt](i);
         if (codeUnit != percent) {
-          result[dartx.set](index++, codeUnit);
+          result[dartx._set](index++, codeUnit);
         } else {
           if (i + 2 < dart.notNull(text[dartx.length])) {
             let digit1 = core.Uri._parseHexDigit(text[dartx.codeUnitAt](i + 1));
             let digit2 = core.Uri._parseHexDigit(text[dartx.codeUnitAt](i + 2));
             if (dart.notNull(digit1) >= 0 && dart.notNull(digit2) >= 0) {
               let byte = dart.notNull(digit1) * 16 + dart.notNull(digit2);
-              result[dartx.set](index++, byte);
+              result[dartx._set](index++, byte);
               i = i + 2;
               continue;
             }
@@ -36035,12 +36359,12 @@
     get parameters() {
       let result = dart.map({}, core.String, core.String);
       for (let i = 3; i < dart.notNull(this[_separatorIndices][dartx.length]); i = i + 2) {
-        let start = dart.notNull(this[_separatorIndices][dartx.get](i - 2)) + 1;
-        let equals = this[_separatorIndices][dartx.get](i - 1);
-        let end = this[_separatorIndices][dartx.get](i);
+        let start = dart.notNull(this[_separatorIndices][dartx._get](i - 2)) + 1;
+        let equals = this[_separatorIndices][dartx._get](i - 1);
+        let end = this[_separatorIndices][dartx._get](i);
         let key = core.Uri._uriDecode(this[_text], start, equals, convert.UTF8, false);
         let value = core.Uri._uriDecode(this[_text], dart.notNull(equals) + 1, end, convert.UTF8, false);
-        result[dartx.set](key, value);
+        result[dartx._set](key, value);
       }
       return result;
     }
@@ -36097,9 +36421,9 @@
     static _uriEncodeBytes(canonicalTable, bytes, buffer) {
       let byteOr = 0;
       for (let i = 0; i < dart.notNull(bytes[dartx.length]); i++) {
-        let byte = bytes[dartx.get](i);
+        let byte = bytes[dartx._get](i);
         byteOr = (dart.notNull(byteOr) | dart.notNull(byte)) >>> 0;
-        if (dart.notNull(byte) < 128 && (dart.notNull(canonicalTable[dartx.get](byte[dartx['>>']](4))) & 1 << (dart.notNull(byte) & 15)) != 0) {
+        if (dart.notNull(byte) < 128 && (dart.notNull(canonicalTable[dartx._get](byte[dartx['>>']](4))) & 1 << (dart.notNull(byte) & 15)) != 0) {
           buffer.writeCharCode(byte);
         } else {
           buffer.writeCharCode(core.Uri._PERCENT);
@@ -36109,7 +36433,7 @@
       }
       if ((dart.notNull(byteOr) & ~255) != 0) {
         for (let i = 0; i < dart.notNull(bytes[dartx.length]); i++) {
-          let byte = bytes[dartx.get](i);
+          let byte = bytes[dartx._get](i);
           if (dart.notNull(byte) < 0 || dart.notNull(byte) > 255) {
             dart.throw(new core.ArgumentError.value(byte, "non-byte value"));
           }
@@ -36117,7 +36441,7 @@
       }
     }
     toString() {
-      return this[_separatorIndices][dartx.get](0) == core.UriData._noScheme ? dart.str`data:${this[_text]}` : this[_text];
+      return this[_separatorIndices][dartx._get](0) == core.UriData._noScheme ? dart.str`data:${this[_text]}` : this[_text];
     }
   };
   dart.defineNamedConstructor(core.UriData, '_');
@@ -36162,6 +36486,741 @@
   core.UriData._noScheme = -1;
   core.UriData._tokenCharTable = dart.constList([0, 0, 27858, 1023, 65534, 51199, 65535, 32767], core.int);
   core.UriData._uricTable = core.Uri._queryCharTable;
+  developer.debugger = function(opts) {
+    let when = opts && 'when' in opts ? opts.when : true;
+    let message = opts && 'message' in opts ? opts.message : null;
+    if (dart.test(when)) {
+      debugger;
+    }
+    return when;
+  };
+  dart.fn(developer.debugger, __Tobool());
+  developer.inspect = function(object) {
+    return object;
+  };
+  dart.fn(developer.inspect, ObjectToObject());
+  developer.log = function(message, opts) {
+    let time = opts && 'time' in opts ? opts.time : null;
+    let sequenceNumber = opts && 'sequenceNumber' in opts ? opts.sequenceNumber : null;
+    let level = opts && 'level' in opts ? opts.level : 0;
+    let name = opts && 'name' in opts ? opts.name : '';
+    let zone = opts && 'zone' in opts ? opts.zone : null;
+    let error = opts && 'error' in opts ? opts.error : null;
+    let stackTrace = opts && 'stackTrace' in opts ? opts.stackTrace : null;
+  };
+  dart.fn(developer.log, String__Tovoid$());
+  dart.defineLazy(developer, {
+    get _extensions() {
+      return MapOfString$ServiceExtensionHandler().new();
+    }
+  });
+  developer._clockValue = 0;
+  const _result = Symbol('_result');
+  const _errorCode = Symbol('_errorCode');
+  const _errorDetail = Symbol('_errorDetail');
+  const _isError = Symbol('_isError');
+  const _toString = Symbol('_toString');
+  developer.ServiceExtensionResponse = class ServiceExtensionResponse extends core.Object {
+    result(result) {
+      this[_result] = result;
+      this[_errorCode] = null;
+      this[_errorDetail] = null;
+      if (!(typeof this[_result] == 'string')) {
+        dart.throw(new core.ArgumentError.value(this[_result], "result", "Must be a String"));
+      }
+    }
+    error(errorCode, errorDetail) {
+      this[_result] = null;
+      this[_errorCode] = errorCode;
+      this[_errorDetail] = errorDetail;
+      developer.ServiceExtensionResponse._validateErrorCode(this[_errorCode]);
+      if (!(typeof this[_errorDetail] == 'string')) {
+        dart.throw(new core.ArgumentError.value(this[_errorDetail], "errorDetail", "Must be a String"));
+      }
+    }
+    static _errorCodeMessage(errorCode) {
+      developer.ServiceExtensionResponse._validateErrorCode(errorCode);
+      if (errorCode == developer.ServiceExtensionResponse.kInvalidParams) {
+        return "Invalid params";
+      }
+      return "Server error";
+    }
+    static _validateErrorCode(errorCode) {
+      if (!(typeof errorCode == 'number')) {
+        dart.throw(new core.ArgumentError.value(errorCode, "errorCode", "Must be an int"));
+      }
+      if (errorCode == developer.ServiceExtensionResponse.invalidParams) {
+        return;
+      }
+      if (dart.notNull(errorCode) >= developer.ServiceExtensionResponse.extensionErrorMin && dart.notNull(errorCode) <= developer.ServiceExtensionResponse.extensionErrorMax) {
+        return;
+      }
+      dart.throw(new core.ArgumentError.value(errorCode, "errorCode", "Out of range"));
+    }
+    [_isError]() {
+      return this[_errorCode] != null && this[_errorDetail] != null;
+    }
+    [_toString]() {
+      if (this[_result] != null) {
+        return this[_result];
+      } else {
+        dart.assert(this[_errorCode] != null);
+        dart.assert(this[_errorDetail] != null);
+        return convert.JSON.encode(dart.map({code: this[_errorCode], message: developer.ServiceExtensionResponse._errorCodeMessage(this[_errorCode]), data: dart.map({details: this[_errorDetail]}, core.String, core.String)}, core.String, core.Object));
+      }
+    }
+  };
+  dart.defineNamedConstructor(developer.ServiceExtensionResponse, 'result');
+  dart.defineNamedConstructor(developer.ServiceExtensionResponse, 'error');
+  dart.setSignature(developer.ServiceExtensionResponse, {
+    constructors: () => ({
+      result: dart.definiteFunctionType(developer.ServiceExtensionResponse, [core.String]),
+      error: dart.definiteFunctionType(developer.ServiceExtensionResponse, [core.int, core.String])
+    }),
+    fields: () => ({
+      [_result]: core.String,
+      [_errorCode]: core.int,
+      [_errorDetail]: core.String
+    }),
+    methods: () => ({
+      [_isError]: dart.definiteFunctionType(core.bool, []),
+      [_toString]: dart.definiteFunctionType(core.String, [])
+    }),
+    sfields: () => ({
+      kInvalidParams: core.int,
+      kExtensionError: core.int,
+      kExtensionErrorMax: core.int,
+      kExtensionErrorMin: core.int,
+      invalidParams: core.int,
+      extensionError: core.int,
+      extensionErrorMax: core.int,
+      extensionErrorMin: core.int
+    }),
+    statics: () => ({
+      _errorCodeMessage: dart.definiteFunctionType(core.String, [core.int]),
+      _validateErrorCode: dart.definiteFunctionType(dart.dynamic, [core.int])
+    }),
+    names: ['_errorCodeMessage', '_validateErrorCode']
+  });
+  developer.ServiceExtensionResponse.invalidParams = -32602;
+  developer.ServiceExtensionResponse.extensionError = -32000;
+  developer.ServiceExtensionResponse.extensionErrorMax = -32000;
+  developer.ServiceExtensionResponse.extensionErrorMin = -32016;
+  dart.defineLazy(developer.ServiceExtensionResponse, {
+    get kInvalidParams() {
+      return developer.ServiceExtensionResponse.invalidParams;
+    },
+    get kExtensionError() {
+      return developer.ServiceExtensionResponse.extensionError;
+    },
+    get kExtensionErrorMax() {
+      return developer.ServiceExtensionResponse.extensionErrorMax;
+    },
+    get kExtensionErrorMin() {
+      return developer.ServiceExtensionResponse.extensionErrorMin;
+    }
+  });
+  developer.ServiceExtensionHandler = dart.typedef('ServiceExtensionHandler', () => dart.functionType(async.Future$(developer.ServiceExtensionResponse), [core.String, MapOfString$String()]));
+  developer.registerExtension = function(method, handler) {
+    if (!(typeof method == 'string')) {
+      dart.throw(new core.ArgumentError.value(method, 'method', 'Must be a String'));
+    }
+    if (!dart.test(method[dartx.startsWith]('ext.'))) {
+      dart.throw(new core.ArgumentError.value(method, 'method', 'Must begin with ext.'));
+    }
+    if (developer._lookupExtension(method) != null) {
+      dart.throw(new core.ArgumentError(dart.str`Extension already registered: ${method}`));
+    }
+    if (!developer.ServiceExtensionHandler.is(handler)) {
+      dart.throw(new core.ArgumentError.value(handler, 'handler', 'Must be a ServiceExtensionHandler'));
+    }
+    developer._registerExtension(method, handler);
+  };
+  dart.fn(developer.registerExtension, StringAndServiceExtensionHandlerTovoid());
+  developer.postEvent = function(eventKind, eventData) {
+    if (!(typeof eventKind == 'string')) {
+      dart.throw(new core.ArgumentError.value(eventKind, 'eventKind', 'Must be a String'));
+    }
+    if (!core.Map.is(eventData)) {
+      dart.throw(new core.ArgumentError.value(eventData, 'eventData', 'Must be a Map'));
+    }
+    let eventDataAsString = convert.JSON.encode(eventData);
+    developer._postEvent(eventKind, eventDataAsString);
+  };
+  dart.fn(developer.postEvent, StringAndMapTovoid());
+  developer._postEvent = function(eventKind, eventData) {
+  };
+  dart.fn(developer._postEvent, StringAndStringTodynamic());
+  developer._lookupExtension = function(method) {
+    return developer._extensions[dartx._get](method);
+  };
+  dart.fn(developer._lookupExtension, StringToServiceExtensionHandler());
+  developer._registerExtension = function(method, handler) {
+    developer._extensions[dartx._set](method, handler);
+  };
+  dart.fn(developer._registerExtension, StringAndServiceExtensionHandlerTodynamic());
+  developer.UserTag = class UserTag extends core.Object {
+    static new(label) {
+      return developer._FakeUserTag.new(label);
+    }
+    static get defaultTag() {
+      return developer._FakeUserTag._defaultTag;
+    }
+  };
+  dart.setSignature(developer.UserTag, {
+    constructors: () => ({new: dart.definiteFunctionType(developer.UserTag, [core.String])}),
+    sfields: () => ({MAX_USER_TAGS: core.int}),
+    sgetters: () => ({defaultTag: dart.definiteFunctionType(developer.UserTag, [])})
+  });
+  developer.UserTag.MAX_USER_TAGS = 64;
+  developer._FakeUserTag = class _FakeUserTag extends core.Object {
+    real(label) {
+      this.label = label;
+    }
+    static new(label) {
+      let existingTag = developer._FakeUserTag._instances[dartx._get](label);
+      if (existingTag != null) {
+        return developer._FakeUserTag._check(existingTag);
+      }
+      if (developer._FakeUserTag._instances[dartx.length] == developer.UserTag.MAX_USER_TAGS) {
+        dart.throw(new core.UnsupportedError(dart.str`UserTag instance limit (${developer.UserTag.MAX_USER_TAGS}) reached.`));
+      }
+      let instance = new developer._FakeUserTag.real(label);
+      developer._FakeUserTag._instances[dartx._set](label, instance);
+      return instance;
+    }
+    makeCurrent() {
+      let old = developer._currentTag;
+      developer._currentTag = this;
+      return old;
+    }
+  };
+  dart.defineNamedConstructor(developer._FakeUserTag, 'real');
+  developer._FakeUserTag[dart.implements] = () => [developer.UserTag];
+  dart.setSignature(developer._FakeUserTag, {
+    constructors: () => ({
+      real: dart.definiteFunctionType(developer._FakeUserTag, [core.String]),
+      new: dart.definiteFunctionType(developer._FakeUserTag, [core.String])
+    }),
+    fields: () => ({label: core.String}),
+    methods: () => ({makeCurrent: dart.definiteFunctionType(developer.UserTag, [])}),
+    sfields: () => ({
+      _instances: core.Map,
+      _defaultTag: developer.UserTag
+    })
+  });
+  dart.defineLazy(developer._FakeUserTag, {
+    get _instances() {
+      return dart.map();
+    },
+    set _instances(_) {},
+    get _defaultTag() {
+      return developer._FakeUserTag.new('Default');
+    }
+  });
+  dart.defineLazy(developer, {
+    get _currentTag() {
+      return developer._FakeUserTag._defaultTag;
+    },
+    set _currentTag(_) {}
+  });
+  developer.getCurrentTag = function() {
+    return developer._currentTag;
+  };
+  dart.fn(developer.getCurrentTag, VoidToUserTag());
+  developer.Metric = class Metric extends core.Object {
+    new(name, description) {
+      this.name = name;
+      this.description = description;
+      if (this.name == 'vm' || dart.test(this.name[dartx.contains]('/'))) {
+        dart.throw(new core.ArgumentError('Invalid Metric name.'));
+      }
+    }
+  };
+  dart.setSignature(developer.Metric, {
+    constructors: () => ({new: dart.definiteFunctionType(developer.Metric, [core.String, core.String])}),
+    fields: () => ({
+      name: core.String,
+      description: core.String
+    })
+  });
+  const _value$0 = Symbol('_value');
+  const _toJSON = Symbol('_toJSON');
+  developer.Gauge = class Gauge extends developer.Metric {
+    get value() {
+      return this[_value$0];
+    }
+    set value(v) {
+      if (dart.notNull(v) < dart.notNull(this.min)) {
+        v = this.min;
+      } else if (dart.notNull(v) > dart.notNull(this.max)) {
+        v = this.max;
+      }
+      this[_value$0] = v;
+    }
+    new(name, description, min, max) {
+      this.min = min;
+      this.max = max;
+      this[_value$0] = null;
+      super.new(name, description);
+      if (!(typeof this.min == 'number')) {
+        dart.throw(new core.ArgumentError('min must be a double'));
+      }
+      if (!(typeof this.max == 'number')) {
+        dart.throw(new core.ArgumentError('max must be a double'));
+      }
+      if (!(dart.notNull(this.min) < dart.notNull(this.max))) {
+        dart.throw(new core.ArgumentError('min must be less than max'));
+      }
+      this[_value$0] = this.min;
+    }
+    [_toJSON]() {
+      let map = dart.map({type: 'Gauge', id: dart.str`metrics/${this.name}`, name: this.name, description: this.description, value: this.value, min: this.min, max: this.max}, core.String, core.Object);
+      return map;
+    }
+  };
+  dart.setSignature(developer.Gauge, {
+    constructors: () => ({new: dart.definiteFunctionType(developer.Gauge, [core.String, core.String, core.double, core.double])}),
+    fields: () => ({
+      min: core.double,
+      max: core.double,
+      [_value$0]: core.double
+    }),
+    getters: () => ({value: dart.definiteFunctionType(core.double, [])}),
+    setters: () => ({value: dart.definiteFunctionType(dart.void, [core.double])}),
+    methods: () => ({[_toJSON]: dart.definiteFunctionType(core.Map, [])})
+  });
+  developer.Counter = class Counter extends developer.Metric {
+    new(name, description) {
+      this[_value$0] = 0.0;
+      super.new(name, description);
+    }
+    get value() {
+      return this[_value$0];
+    }
+    set value(v) {
+      this[_value$0] = v;
+    }
+    [_toJSON]() {
+      let map = dart.map({type: 'Counter', id: dart.str`metrics/${this.name}`, name: this.name, description: this.description, value: this.value}, core.String, core.Object);
+      return map;
+    }
+  };
+  dart.setSignature(developer.Counter, {
+    constructors: () => ({new: dart.definiteFunctionType(developer.Counter, [core.String, core.String])}),
+    fields: () => ({[_value$0]: core.double}),
+    getters: () => ({value: dart.definiteFunctionType(core.double, [])}),
+    setters: () => ({value: dart.definiteFunctionType(dart.void, [core.double])}),
+    methods: () => ({[_toJSON]: dart.definiteFunctionType(core.Map, [])})
+  });
+  developer.Metrics = class Metrics extends core.Object {
+    static register(metric) {
+      if (!developer.Metric.is(metric)) {
+        dart.throw(new core.ArgumentError('metric must be a Metric'));
+      }
+      if (developer.Metrics._metrics[dartx._get](metric.name) != null) {
+        dart.throw(new core.ArgumentError('Registered metrics have unique names'));
+      }
+      developer.Metrics._metrics[dartx._set](metric.name, metric);
+    }
+    static deregister(metric) {
+      if (!developer.Metric.is(metric)) {
+        dart.throw(new core.ArgumentError('metric must be a Metric'));
+      }
+      developer.Metrics._metrics[dartx.remove](metric.name);
+    }
+    static _printMetric(id) {
+      let metric = developer.Metrics._metrics[dartx._get](id);
+      if (metric == null) {
+        return null;
+      }
+      return convert.JSON.encode(metric[_toJSON]());
+    }
+    static _printMetrics() {
+      let metrics = [];
+      for (let metric of developer.Metrics._metrics[dartx.values]) {
+        metrics[dartx.add](metric[_toJSON]());
+      }
+      let map = dart.map({type: 'MetricList', metrics: metrics}, core.String, core.Object);
+      return convert.JSON.encode(map);
+    }
+  };
+  dart.setSignature(developer.Metrics, {
+    sfields: () => ({_metrics: MapOfString$Metric()}),
+    statics: () => ({
+      register: dart.definiteFunctionType(dart.void, [developer.Metric]),
+      deregister: dart.definiteFunctionType(dart.void, [developer.Metric]),
+      _printMetric: dart.definiteFunctionType(core.String, [core.String]),
+      _printMetrics: dart.definiteFunctionType(core.String, [])
+    }),
+    names: ['register', 'deregister', '_printMetric', '_printMetrics']
+  });
+  dart.defineLazy(developer.Metrics, {
+    get _metrics() {
+      return MapOfString$Metric().new();
+    }
+  });
+  developer._isProduct = false;
+  developer.TimelineSyncFunction = dart.typedef('TimelineSyncFunction', () => dart.functionType(dart.dynamic, []));
+  developer.TimelineAsyncFunction = dart.typedef('TimelineAsyncFunction', () => dart.functionType(async.Future, []));
+  const _appendArguments = Symbol('_appendArguments');
+  developer.Timeline = class Timeline extends core.Object {
+    static startSync(name, opts) {
+      let arguments$ = opts && 'arguments' in opts ? opts.arguments : null;
+      if (developer._isProduct) {
+        return;
+      }
+      if (!(typeof name == 'string')) {
+        dart.throw(new core.ArgumentError.value(name, 'name', 'Must be a String'));
+      }
+      if (!dart.test(developer._isDartStreamEnabled())) {
+        developer.Timeline._stack[dartx.add](null);
+        return;
+      }
+      let block = new developer._SyncBlock._(name, developer._getTraceClock(), developer._getThreadCpuClock());
+      if (core.Map.is(arguments$)) {
+        block[_appendArguments](arguments$);
+      }
+      developer.Timeline._stack[dartx.add](block);
+    }
+    static finishSync() {
+      if (developer._isProduct) {
+        return;
+      }
+      if (developer.Timeline._stack[dartx.length] == 0) {
+        dart.throw(new core.StateError('Uneven calls to startSync and finishSync'));
+      }
+      let block = developer.Timeline._stack[dartx.removeLast]();
+      if (block == null) {
+        return;
+      }
+      block.finish();
+    }
+    static instantSync(name, opts) {
+      let arguments$ = opts && 'arguments' in opts ? opts.arguments : null;
+      if (developer._isProduct) {
+        return;
+      }
+      if (!(typeof name == 'string')) {
+        dart.throw(new core.ArgumentError.value(name, 'name', 'Must be a String'));
+      }
+      if (!dart.test(developer._isDartStreamEnabled())) {
+        return;
+      }
+      let instantArguments = null;
+      if (core.Map.is(arguments$)) {
+        instantArguments = core.Map.from(arguments$);
+      }
+      developer._reportInstantEvent(developer._getTraceClock(), 'Dart', name, developer._argumentsAsJson(instantArguments));
+    }
+    static timeSync(name, func, opts) {
+      let arguments$ = opts && 'arguments' in opts ? opts.arguments : null;
+      developer.Timeline.startSync(name, {arguments: arguments$});
+      try {
+        return func();
+      } finally {
+        developer.Timeline.finishSync();
+      }
+    }
+    static get now() {
+      return developer._getTraceClock();
+    }
+  };
+  dart.setSignature(developer.Timeline, {
+    sfields: () => ({
+      _stack: ListOf_SyncBlock(),
+      _isolateId: core.int,
+      _isolateIdString: core.String
+    }),
+    sgetters: () => ({now: dart.definiteFunctionType(core.int, [])}),
+    statics: () => ({
+      startSync: dart.definiteFunctionType(dart.void, [core.String], {arguments: core.Map}),
+      finishSync: dart.definiteFunctionType(dart.void, []),
+      instantSync: dart.definiteFunctionType(dart.void, [core.String], {arguments: core.Map}),
+      timeSync: dart.definiteFunctionType(dart.dynamic, [core.String, developer.TimelineSyncFunction], {arguments: core.Map})
+    }),
+    names: ['startSync', 'finishSync', 'instantSync', 'timeSync']
+  });
+  dart.defineLazy(developer.Timeline, {
+    get _stack() {
+      return ListOf_SyncBlock().new();
+    },
+    get _isolateId() {
+      return developer._getIsolateNum();
+    },
+    get _isolateIdString() {
+      return dart.toString(developer.Timeline._isolateId);
+    }
+  });
+  const _stack = Symbol('_stack');
+  const _taskId = Symbol('_taskId');
+  const _start$1 = Symbol('_start');
+  const _finish = Symbol('_finish');
+  developer.TimelineTask = class TimelineTask extends core.Object {
+    new() {
+      this[_stack] = JSArrayOf_AsyncBlock().of([]);
+      this[_taskId] = developer._getNextAsyncId();
+    }
+    withTaskId(taskId) {
+      this[_stack] = JSArrayOf_AsyncBlock().of([]);
+      this[_taskId] = taskId;
+      if (!(typeof taskId == 'number')) {
+        dart.throw(new core.ArgumentError.value(taskId, 'taskId', 'Must be an int'));
+      }
+    }
+    start(name, opts) {
+      let arguments$ = opts && 'arguments' in opts ? opts.arguments : null;
+      if (developer._isProduct) {
+        return;
+      }
+      if (!(typeof name == 'string')) {
+        dart.throw(new core.ArgumentError.value(name, 'name', 'Must be a String'));
+      }
+      let block = new developer._AsyncBlock._(name, this[_taskId]);
+      if (core.Map.is(arguments$)) {
+        block[_appendArguments](arguments$);
+      }
+      this[_stack][dartx.add](block);
+      block[_start$1]();
+    }
+    instant(name, opts) {
+      let arguments$ = opts && 'arguments' in opts ? opts.arguments : null;
+      if (developer._isProduct) {
+        return;
+      }
+      if (!(typeof name == 'string')) {
+        dart.throw(new core.ArgumentError.value(name, 'name', 'Must be a String'));
+      }
+      let instantArguments = null;
+      if (core.Map.is(arguments$)) {
+        instantArguments = core.Map.from(arguments$);
+      }
+      developer._reportTaskEvent(developer._getTraceClock(), this[_taskId], 'n', 'Dart', name, developer._argumentsAsJson(instantArguments));
+    }
+    finish() {
+      if (developer._isProduct) {
+        return;
+      }
+      if (this[_stack][dartx.length] == 0) {
+        dart.throw(new core.StateError('Uneven calls to start and finish'));
+      }
+      let block = this[_stack][dartx.removeLast]();
+      block[_finish]();
+    }
+    pass() {
+      if (dart.notNull(this[_stack][dartx.length]) > 0) {
+        dart.throw(new core.StateError('You cannot pass a TimelineTask without finishing all started ' + 'operations'));
+      }
+      let r = this[_taskId];
+      return r;
+    }
+  };
+  dart.defineNamedConstructor(developer.TimelineTask, 'withTaskId');
+  dart.setSignature(developer.TimelineTask, {
+    constructors: () => ({
+      new: dart.definiteFunctionType(developer.TimelineTask, []),
+      withTaskId: dart.definiteFunctionType(developer.TimelineTask, [core.int])
+    }),
+    fields: () => ({
+      [_taskId]: core.int,
+      [_stack]: ListOf_AsyncBlock()
+    }),
+    methods: () => ({
+      start: dart.definiteFunctionType(dart.void, [core.String], {arguments: core.Map}),
+      instant: dart.definiteFunctionType(dart.void, [core.String], {arguments: core.Map}),
+      finish: dart.definiteFunctionType(dart.void, []),
+      pass: dart.definiteFunctionType(core.int, [])
+    })
+  });
+  const _arguments$ = Symbol('_arguments');
+  developer._AsyncBlock = class _AsyncBlock extends core.Object {
+    _(name, taskId) {
+      this.name = name;
+      this[_taskId] = taskId;
+      this.category = 'Dart';
+      this[_arguments$] = null;
+    }
+    [_start$1]() {
+      developer._reportTaskEvent(developer._getTraceClock(), this[_taskId], 'b', this.category, this.name, developer._argumentsAsJson(this[_arguments$]));
+    }
+    [_finish]() {
+      developer._reportTaskEvent(developer._getTraceClock(), this[_taskId], 'e', this.category, this.name, developer._argumentsAsJson(null));
+    }
+    [_appendArguments](arguments$) {
+      if (this[_arguments$] == null) {
+        this[_arguments$] = dart.map();
+      }
+      this[_arguments$][dartx.addAll](arguments$);
+    }
+  };
+  dart.defineNamedConstructor(developer._AsyncBlock, '_');
+  dart.setSignature(developer._AsyncBlock, {
+    constructors: () => ({_: dart.definiteFunctionType(developer._AsyncBlock, [core.String, core.int])}),
+    fields: () => ({
+      category: core.String,
+      name: core.String,
+      [_taskId]: core.int,
+      [_arguments$]: core.Map
+    }),
+    methods: () => ({
+      [_start$1]: dart.definiteFunctionType(dart.void, []),
+      [_finish]: dart.definiteFunctionType(dart.void, []),
+      [_appendArguments]: dart.definiteFunctionType(dart.void, [core.Map])
+    })
+  });
+  const _startCpu = Symbol('_startCpu');
+  developer._SyncBlock = class _SyncBlock extends core.Object {
+    _(name, start, startCpu) {
+      this.name = name;
+      this[_start$1] = start;
+      this[_startCpu] = startCpu;
+      this.category = 'Dart';
+      this[_arguments$] = null;
+    }
+    finish() {
+      developer._reportCompleteEvent(this[_start$1], this[_startCpu], this.category, this.name, developer._argumentsAsJson(this[_arguments$]));
+    }
+    [_appendArguments](arguments$) {
+      if (arguments$ == null) {
+        return;
+      }
+      if (this[_arguments$] == null) {
+        this[_arguments$] = dart.map();
+      }
+      this[_arguments$][dartx.addAll](arguments$);
+    }
+  };
+  dart.defineNamedConstructor(developer._SyncBlock, '_');
+  dart.setSignature(developer._SyncBlock, {
+    constructors: () => ({_: dart.definiteFunctionType(developer._SyncBlock, [core.String, core.int, core.int])}),
+    fields: () => ({
+      category: core.String,
+      name: core.String,
+      [_arguments$]: core.Map,
+      [_start$1]: core.int,
+      [_startCpu]: core.int
+    }),
+    methods: () => ({
+      finish: dart.definiteFunctionType(dart.void, []),
+      [_appendArguments]: dart.definiteFunctionType(dart.void, [core.Map])
+    })
+  });
+  developer._fastPathArguments = null;
+  developer._argumentsAsJson = function(arguments$) {
+    if (arguments$ == null || arguments$[dartx.length] == 0) {
+      if (developer._fastPathArguments == null) {
+        developer._fastPathArguments = dart.str`{"isolateNumber":"${developer.Timeline._isolateId}"}`;
+      }
+      return developer._fastPathArguments;
+    }
+    arguments$[dartx._set]('isolateNumber', developer.Timeline._isolateIdString);
+    return convert.JSON.encode(arguments$);
+  };
+  dart.fn(developer._argumentsAsJson, MapToString());
+  developer._isDartStreamEnabled = function() {
+    return false;
+  };
+  dart.fn(developer._isDartStreamEnabled, VoidTobool());
+  developer._getNextAsyncId = function() {
+    return 0;
+  };
+  dart.fn(developer._getNextAsyncId, VoidToint());
+  developer._getTraceClock = function() {
+    let x = developer._clockValue;
+    developer._clockValue = dart.notNull(x) + 1;
+    return x;
+  };
+  dart.fn(developer._getTraceClock, VoidToint());
+  developer._getThreadCpuClock = function() {
+    return -1;
+  };
+  dart.fn(developer._getThreadCpuClock, VoidToint());
+  developer._getIsolateNum = function() {
+    return 0;
+  };
+  dart.fn(developer._getIsolateNum, VoidToint());
+  developer._reportTaskEvent = function(start, taskId, phase, category, name, argumentsAsJson) {
+  };
+  dart.fn(developer._reportTaskEvent, intAndintAndString__Tovoid());
+  developer._reportCompleteEvent = function(start, startCpu, category, name, argumentsAsJson) {
+  };
+  dart.fn(developer._reportCompleteEvent, intAndintAndString__Tovoid$());
+  developer._reportInstantEvent = function(start, category, name, argumentsAsJson) {
+  };
+  dart.fn(developer._reportInstantEvent, intAndStringAndString__Tovoid());
+  developer.ServiceProtocolInfo = class ServiceProtocolInfo extends core.Object {
+    new(serverUri) {
+      this.majorVersion = developer._getServiceMajorVersion();
+      this.minorVersion = developer._getServiceMinorVersion();
+      this.serverUri = serverUri;
+    }
+    toString() {
+      if (this.serverUri != null) {
+        return dart.str`Dart VM Service Protocol v${this.majorVersion}.${this.minorVersion} ` + dart.str`listening on ${this.serverUri}`;
+      } else {
+        return dart.str`Dart VM Service Protocol v${this.majorVersion}.${this.minorVersion}`;
+      }
+    }
+  };
+  dart.setSignature(developer.ServiceProtocolInfo, {
+    constructors: () => ({new: dart.definiteFunctionType(developer.ServiceProtocolInfo, [core.Uri])}),
+    fields: () => ({
+      majorVersion: core.int,
+      minorVersion: core.int,
+      serverUri: core.Uri
+    })
+  });
+  developer.Service = class Service extends core.Object {
+    static getInfo() {
+      return dart.async(function*() {
+        let receivePort = isolate.RawReceivePort.new();
+        let uriCompleter = CompleterOfUri().new();
+        receivePort.handler = dart.fn(uri => uriCompleter.complete(uri), UriTovoid());
+        developer._getServerInfo(receivePort.sendPort);
+        let uri = (yield uriCompleter.future);
+        receivePort.close();
+        return new developer.ServiceProtocolInfo(uri);
+      }, developer.ServiceProtocolInfo);
+    }
+    static controlWebServer(opts) {
+      return dart.async(function*(opts) {
+        let enable = opts && 'enable' in opts ? opts.enable : false;
+        if (!(typeof enable == 'boolean')) {
+          dart.throw(new core.ArgumentError.value(enable, 'enable', 'Must be a bool'));
+        }
+        let receivePort = isolate.RawReceivePort.new();
+        let uriCompleter = CompleterOfUri().new();
+        receivePort.handler = dart.fn(uri => uriCompleter.complete(uri), UriTovoid());
+        developer._webServerControl(receivePort.sendPort, enable);
+        let uri = (yield uriCompleter.future);
+        receivePort.close();
+        return new developer.ServiceProtocolInfo(uri);
+      }, developer.ServiceProtocolInfo, opts);
+    }
+  };
+  dart.setSignature(developer.Service, {
+    statics: () => ({
+      getInfo: dart.definiteFunctionType(async.Future$(developer.ServiceProtocolInfo), []),
+      controlWebServer: dart.definiteFunctionType(async.Future$(developer.ServiceProtocolInfo), [], {enable: core.bool})
+    }),
+    names: ['getInfo', 'controlWebServer']
+  });
+  developer._getServerInfo = function(sp) {
+    sp.send(null);
+  };
+  dart.lazyFn(developer._getServerInfo, () => SendPortTovoid());
+  developer._webServerControl = function(sp, enable) {
+    sp.send(null);
+  };
+  dart.lazyFn(developer._webServerControl, () => SendPortAndboolTovoid());
+  developer._getServiceMajorVersion = function() {
+    return 0;
+  };
+  dart.fn(developer._getServiceMajorVersion, VoidToint());
+  developer._getServiceMinorVersion = function() {
+    return 0;
+  };
+  dart.fn(developer._getServiceMinorVersion, VoidToint());
   isolate.IsolateSpawnException = class IsolateSpawnException extends core.Object {
     new(message) {
       this.message = message;
@@ -36190,7 +37249,7 @@
     static spawn(entryPoint, message, opts) {
       let paused = opts && 'paused' in opts ? opts.paused : false;
       try {
-        return _isolate_helper.IsolateNatives.spawnFunction(entryPoint, message, paused).then(isolate.Isolate)(dart.fn(msg => new isolate.Isolate(isolate.SendPort._check(msg[dartx.get](1)), {pauseCapability: isolate.Capability._check(msg[dartx.get](2)), terminateCapability: isolate.Capability._check(msg[dartx.get](3))}), ListToIsolate()));
+        return _isolate_helper.IsolateNatives.spawnFunction(entryPoint, message, paused).then(isolate.Isolate)(dart.fn(msg => new isolate.Isolate(isolate.SendPort._check(msg[dartx._get](1)), {pauseCapability: isolate.Capability._check(msg[dartx._get](2)), terminateCapability: isolate.Capability._check(msg[dartx._get](3))}), ListToIsolate()));
       } catch (e) {
         let st = dart.stackTrace(e);
         return FutureOfIsolate().error(e, st);
@@ -36204,14 +37263,14 @@
       try {
         if (core.List.is(args)) {
           for (let i = 0; i < dart.notNull(args[dartx.length]); i++) {
-            if (!(typeof args[dartx.get](i) == 'string')) {
+            if (!(typeof args[dartx._get](i) == 'string')) {
               dart.throw(new core.ArgumentError(dart.str`Args must be a list of Strings ${args}`));
             }
           }
         } else if (args != null) {
           dart.throw(new core.ArgumentError(dart.str`Args must be a list of Strings ${args}`));
         }
-        return _isolate_helper.IsolateNatives.spawnUri(uri, args, message, paused).then(isolate.Isolate)(dart.fn(msg => new isolate.Isolate(isolate.SendPort._check(msg[dartx.get](1)), {pauseCapability: isolate.Capability._check(msg[dartx.get](2)), terminateCapability: isolate.Capability._check(msg[dartx.get](3))}), ListToIsolate()));
+        return _isolate_helper.IsolateNatives.spawnUri(uri, args, message, paused).then(isolate.Isolate)(dart.fn(msg => new isolate.Isolate(isolate.SendPort._check(msg[dartx._get](1)), {pauseCapability: isolate.Capability._check(msg[dartx._get](2)), terminateCapability: isolate.Capability._check(msg[dartx._get](3))}), ListToIsolate()));
       } catch (e) {
         let st = dart.stackTrace(e);
         return FutureOfIsolate().error(e, st);
@@ -36226,34 +37285,34 @@
     }
     [_pause](resumeCapability) {
       let message = core.List.new(3);
-      message[dartx.set](0, "pause");
-      message[dartx.set](1, this.pauseCapability);
-      message[dartx.set](2, resumeCapability);
+      message[dartx._set](0, "pause");
+      message[dartx._set](1, this.pauseCapability);
+      message[dartx._set](2, resumeCapability);
       this.controlPort.send(message);
     }
     resume(resumeCapability) {
       let message = core.List.new(2);
-      message[dartx.set](0, "resume");
-      message[dartx.set](1, resumeCapability);
+      message[dartx._set](0, "resume");
+      message[dartx._set](1, resumeCapability);
       this.controlPort.send(message);
     }
     addOnExitListener(responsePort) {
       let message = core.List.new(2);
-      message[dartx.set](0, "add-ondone");
-      message[dartx.set](1, responsePort);
+      message[dartx._set](0, "add-ondone");
+      message[dartx._set](1, responsePort);
       this.controlPort.send(message);
     }
     removeOnExitListener(responsePort) {
       let message = core.List.new(2);
-      message[dartx.set](0, "remove-ondone");
-      message[dartx.set](1, responsePort);
+      message[dartx._set](0, "remove-ondone");
+      message[dartx._set](1, responsePort);
       this.controlPort.send(message);
     }
     setErrorsFatal(errorsAreFatal) {
       let message = core.List.new(3);
-      message[dartx.set](0, "set-errors-fatal");
-      message[dartx.set](1, this.terminateCapability);
-      message[dartx.set](2, errorsAreFatal);
+      message[dartx._set](0, "set-errors-fatal");
+      message[dartx._set](1, this.terminateCapability);
+      message[dartx._set](2, errorsAreFatal);
       this.controlPort.send(message);
     }
     kill(priority) {
@@ -36263,21 +37322,21 @@
     ping(responsePort, pingType) {
       if (pingType === void 0) pingType = isolate.Isolate.IMMEDIATE;
       let message = core.List.new(3);
-      message[dartx.set](0, "ping");
-      message[dartx.set](1, responsePort);
-      message[dartx.set](2, pingType);
+      message[dartx._set](0, "ping");
+      message[dartx._set](1, responsePort);
+      message[dartx._set](2, pingType);
       this.controlPort.send(message);
     }
     addErrorListener(port) {
       let message = core.List.new(2);
-      message[dartx.set](0, "getErrors");
-      message[dartx.set](1, port);
+      message[dartx._set](0, "getErrors");
+      message[dartx._set](1, port);
       this.controlPort.send(message);
     }
     removeErrorListener(port) {
       let message = core.List.new(2);
-      message[dartx.set](0, "stopErrors");
-      message[dartx.set](1, port);
+      message[dartx._set](0, "stopErrors");
+      message[dartx._set](1, port);
       this.controlPort.send(message);
     }
     get errors() {
@@ -36468,18 +37527,18 @@
       let _convertedObjects = collection.HashMap.identity();
       function _convert(o) {
         if (dart.test(_convertedObjects.containsKey(o))) {
-          return _convertedObjects.get(o);
+          return _convertedObjects._get(o);
         }
         if (core.Map.is(o)) {
           let convertedMap = {};
-          _convertedObjects.set(o, convertedMap);
+          _convertedObjects._set(o, convertedMap);
           for (let key of o[dartx.keys]) {
-            convertedMap[key] = _convert(o[dartx.get](key));
+            convertedMap[key] = _convert(o[dartx._get](key));
           }
           return convertedMap;
         } else if (core.Iterable.is(o)) {
           let convertedList = [];
-          _convertedObjects.set(o, convertedList);
+          _convertedObjects._set(o, convertedList);
           convertedList[dartx.addAll](o[dartx.map](dart.dynamic)(_convert));
           return convertedList;
         } else {
@@ -36489,13 +37548,13 @@
       dart.fn(_convert, dynamicTodynamic$());
       return _convert(data);
     }
-    get(property) {
+    _get(property) {
       if (!(typeof property == 'string') && !(typeof property == 'number')) {
         dart.throw(new core.ArgumentError("property is not a String or num"));
       }
       return js._convertToDart(this[_jsObject][property]);
     }
-    set(property, value) {
+    _set(property, value) {
       if (!(typeof property == 'string') && !(typeof property == 'number')) {
         dart.throw(new core.ArgumentError("property is not a String or num"));
       }
@@ -36554,8 +37613,8 @@
     }),
     fields: () => ({[_jsObject]: dart.dynamic}),
     methods: () => ({
-      get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
-      set: dart.definiteFunctionType(dart.dynamic, [core.Object, dart.dynamic]),
+      _get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
+      _set: dart.definiteFunctionType(dart.dynamic, [core.Object, dart.dynamic]),
       hasProperty: dart.definiteFunctionType(core.bool, [dart.dynamic]),
       deleteProperty: dart.definiteFunctionType(dart.void, [dart.dynamic]),
       instanceof: dart.definiteFunctionType(core.bool, [js.JsFunction]),
@@ -36629,18 +37688,18 @@
           dart.throw(new core.RangeError.range(end, start, length));
         }
       }
-      get(index) {
+      _get(index) {
         if (typeof index == 'number' && index == index[dartx.toInt]()) {
           this[_checkIndex](dart.asInt(index));
         }
-        return E.as(super.get(index));
+        return E.as(super._get(index));
       }
-      set(index, value) {
+      _set(index, value) {
         E._check(value);
         if (typeof index == 'number' && index == index[dartx.toInt]()) {
           this[_checkIndex](dart.asInt(index));
         }
-        super.set(index, value);
+        super._set(index, value);
         return value;
       }
       get length() {
@@ -36651,7 +37710,7 @@
         dart.throw(new core.StateError('Bad JsArray length'));
       }
       set length(length) {
-        super.set('length', length);
+        super._set('length', length);
       }
       add(value) {
         E._check(value);
@@ -36709,8 +37768,8 @@
       methods: () => ({
         [_checkIndex]: dart.definiteFunctionType(dart.dynamic, [core.int]),
         [_checkInsertIndex]: dart.definiteFunctionType(dart.dynamic, [core.int]),
-        get: dart.definiteFunctionType(E, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [core.Object, E]),
+        _get: dart.definiteFunctionType(E, [core.Object]),
+        _set: dart.definiteFunctionType(dart.void, [core.Object, E]),
         add: dart.definiteFunctionType(dart.void, [E]),
         addAll: dart.definiteFunctionType(dart.void, [IterableOfE()]),
         insert: dart.definiteFunctionType(dart.void, [core.int, E]),
@@ -36723,8 +37782,8 @@
       names: ['_checkRange']
     });
     dart.defineExtensionMembers(JsArray, [
-      'get',
-      'set',
+      '_get',
+      '_set',
       'add',
       'addAll',
       'insert',
@@ -36772,7 +37831,7 @@
       let args = Array.prototype.map.call(arguments, js._convertToDart);
       return js._convertToJS(f(...args));
     };
-    dart.dsetindex(js._dartProxies, wrapper, f);
+    js._dartProxies.set(wrapper, f);
     return wrapper;
   };
   dart.fn(js._wrapDartFunction, dynamicTodynamic$());
@@ -36831,7 +37890,7 @@
     set _interopCaptureThisExpando(_) {}
   });
   js.allowInteropCaptureThis = function(f) {
-    let ret = js._interopCaptureThisExpando.get(f);
+    let ret = js._interopCaptureThisExpando._get(f);
     if (ret == null) {
       ret = function() {
         let args = [this];
@@ -36840,7 +37899,7 @@
         }
         return f(...args);
       };
-      js._interopCaptureThisExpando.set(f, ret);
+      js._interopCaptureThisExpando._set(f, ret);
     }
     return ret;
   };
@@ -36856,18 +37915,18 @@
     let _convertedObjects = collection.HashMap.identity();
     function _convert(o) {
       if (dart.test(_convertedObjects.containsKey(o))) {
-        return _convertedObjects.get(o);
+        return _convertedObjects._get(o);
       }
       if (core.Map.is(o)) {
         let convertedMap = {};
-        _convertedObjects.set(o, convertedMap);
+        _convertedObjects._set(o, convertedMap);
         for (let key of o[dartx.keys]) {
-          convertedMap[key] = _convert(o[dartx.get](key));
+          convertedMap[key] = _convert(o[dartx._get](key));
         }
         return convertedMap;
       } else if (core.Iterable.is(o)) {
         let convertedList = [];
-        _convertedObjects.set(o, convertedList);
+        _convertedObjects._set(o, convertedList);
         convertedList[dartx.addAll](o[dartx.map](dart.dynamic)(_convert));
         return convertedList;
       } else {
@@ -36958,40 +38017,13 @@
   math.SQRT2 = 1.4142135623730951;
   math.min = function(T) {
     return (a, b) => {
-      if (!(typeof a == 'number')) dart.throw(new core.ArgumentError(a));
-      if (!(typeof b == 'number')) dart.throw(new core.ArgumentError(b));
-      if (dart.notNull(a) > dart.notNull(b)) return b;
-      if (dart.notNull(a) < dart.notNull(b)) return a;
-      if (typeof b == 'number') {
-        if (typeof a == 'number') {
-          if (a == 0.0) {
-            return (dart.notNull(a) + dart.notNull(b)) * dart.notNull(a) * dart.notNull(b);
-          }
-        }
-        if (a == 0 && dart.test(b[dartx.isNegative]) || dart.test(b[dartx.isNaN])) return b;
-        return a;
-      }
-      return a;
+      return Math.min(_js_helper.checkNum(a), _js_helper.checkNum(b));
     };
   };
   dart.fn(math.min, TAndTToT());
   math.max = function(T) {
     return (a, b) => {
-      if (!(typeof a == 'number')) dart.throw(new core.ArgumentError(a));
-      if (!(typeof b == 'number')) dart.throw(new core.ArgumentError(b));
-      if (dart.notNull(a) > dart.notNull(b)) return a;
-      if (dart.notNull(a) < dart.notNull(b)) return b;
-      if (typeof b == 'number') {
-        if (typeof a == 'number') {
-          if (a == 0.0) {
-            return dart.notNull(a) + dart.notNull(b);
-          }
-        }
-        if (dart.test(b[dartx.isNaN])) return b;
-        return a;
-      }
-      if (b == 0 && dart.test(a[dartx.isNegative])) return b;
-      return a;
+      return Math.max(_js_helper.checkNum(a), _js_helper.checkNum(b));
     };
   };
   dart.fn(math.max, TAndTToT$());
@@ -37408,7 +38440,8 @@
       }
       ['=='](other) {
         if (!RectangleOfnum().is(other)) return false;
-        return dart.equals(this[dartx.left], dart.dload(other, 'left')) && dart.equals(this[dartx.top], dart.dload(other, 'top')) && dart.equals(this[dartx.right], dart.dload(other, 'right')) && dart.equals(this[dartx.bottom], dart.dload(other, 'bottom'));
+        let otherRect = RectangleOfnum().as(other);
+        return this[dartx.left] == otherRect[dartx.left] && this[dartx.top] == otherRect[dartx.top] && this[dartx.right] == otherRect[dartx.right] && this[dartx.bottom] == otherRect[dartx.bottom];
       }
       get hashCode() {
         return math._JenkinsSmiHash.hash4(dart.hashCode(this[dartx.left]), dart.hashCode(this[dartx.top]), dart.hashCode(this[dartx.right]), dart.hashCode(this[dartx.bottom]));
@@ -37504,11 +38537,35 @@
       'height'
     ]);
     class Rectangle extends math._RectangleBase$(T) {
+      get left() {
+        return this[left$];
+      }
+      set left(value) {
+        super.left = value;
+      }
+      get top() {
+        return this[top$];
+      }
+      set top(value) {
+        super.top = value;
+      }
+      get width() {
+        return this[width$];
+      }
+      set width(value) {
+        super.width = value;
+      }
+      get height() {
+        return this[height$];
+      }
+      set height(value) {
+        super.height = value;
+      }
       new(left, top, width, height) {
-        this[dartx.left] = left;
-        this[dartx.top] = top;
-        this[dartx.width] = dart.notNull(width) < 0 ? -dart.notNull(width) * 0 : width;
-        this[dartx.height] = dart.notNull(height) < 0 ? -dart.notNull(height) * 0 : height;
+        this[left$] = left;
+        this[top$] = top;
+        this[width$] = dart.notNull(width) < 0 ? -dart.notNull(width) * 0 : width;
+        this[height$] = dart.notNull(height) < 0 ? -dart.notNull(height) * 0 : height;
         super.new();
       }
       static fromPoints(a, b) {
@@ -37519,6 +38576,10 @@
         return new (RectangleOfT())(left, top, width, height);
       }
     }
+    const left$ = Symbol(Rectangle.name + "." + 'left'.toString());
+    const top$ = Symbol(Rectangle.name + "." + 'top'.toString());
+    const width$ = Symbol(Rectangle.name + "." + 'width'.toString());
+    const height$ = Symbol(Rectangle.name + "." + 'height'.toString());
     dart.setSignature(Rectangle, {
       constructors: () => ({
         new: dart.definiteFunctionType(math.Rectangle$(T), [T, T, T, T]),
@@ -37542,9 +38603,21 @@
     let RectangleOfT = () => (RectangleOfT = dart.constFn(math.Rectangle$(T)))();
     let PointOfT = () => (PointOfT = dart.constFn(math.Point$(T)))();
     class MutableRectangle extends math._RectangleBase$(T) {
+      get left() {
+        return this[left$];
+      }
+      set left(value) {
+        this[left$] = value;
+      }
+      get top() {
+        return this[top$];
+      }
+      set top(value) {
+        this[top$] = value;
+      }
       new(left, top, width, height) {
-        this.left = left;
-        this.top = top;
+        this[left$] = left;
+        this[top$] = top;
         this[_width] = dart.notNull(width) < 0 ? math._clampToZero(T)(width) : width;
         this[_height] = dart.notNull(height) < 0 ? math._clampToZero(T)(height) : height;
         super.new();
@@ -37573,6 +38646,8 @@
         this[_height] = height;
       }
     }
+    const left$ = Symbol(MutableRectangle.name + "." + 'left'.toString());
+    const top$ = Symbol(MutableRectangle.name + "." + 'top'.toString());
     MutableRectangle[dart.implements] = () => [RectangleOfT()];
     dart.setSignature(MutableRectangle, {
       constructors: () => ({
@@ -38151,7 +39226,7 @@
       if (dart.test(html_common.isJavaScriptDate(object))) return true;
       if (core.List.is(object)) {
         for (let i = 0; i < dart.notNull(object[dartx.length]); i++) {
-          if (dart.test(containsDate(object[dartx.get](i)))) return true;
+          if (dart.test(containsDate(object[dartx._get](i)))) return true;
         }
       }
       return false;
@@ -38230,21 +39305,21 @@
     get [dartx.source]() {
       return this.source;
     }
-    [dartx.advance](count) {
-      return this.advance(count);
+    [dartx.advance](...args) {
+      return this.advance.apply(this, args);
     }
-    [dartx.continuePrimaryKey](key, primaryKey) {
-      return this.continuePrimaryKey(key, primaryKey);
+    [dartx.continuePrimaryKey](...args) {
+      return this.continuePrimaryKey.apply(this, args);
     }
-    [_delete]() {
-      return this.delete();
+    [_delete](...args) {
+      return this.delete.apply(this, args);
     }
     [_update](value) {
       let value_1 = html_common.convertDartToNative_SerializedScriptValue(value);
       return this[_update_1](value_1);
     }
-    [_update_1](value) {
-      return this.update(value);
+    [_update_1](...args) {
+      return this.update.apply(this, args);
     }
   };
   dart.setSignature(indexed_db.Cursor, {
@@ -38322,14 +39397,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [_addEventListener](type, listener, capture) {
-      return this.addEventListener(type, listener, capture);
+    [_addEventListener](...args) {
+      return this.addEventListener.apply(this, args);
     }
-    [dartx.dispatchEvent](event) {
-      return this.dispatchEvent(event);
+    [dartx.dispatchEvent](...args) {
+      return this.dispatchEvent.apply(this, args);
     }
-    [_removeEventListener](type, listener, capture) {
-      return this.removeEventListener(type, listener, capture);
+    [_removeEventListener](...args) {
+      return this.removeEventListener.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.EventTarget, '_created');
@@ -38370,10 +39445,10 @@
       let autoIncrement = opts && 'autoIncrement' in opts ? opts.autoIncrement : null;
       let options = dart.map();
       if (keyPath != null) {
-        options[dartx.set]('keyPath', keyPath);
+        options[dartx._set]('keyPath', keyPath);
       }
       if (autoIncrement != null) {
-        options[dartx.set]('autoIncrement', autoIncrement);
+        options[dartx._set]('autoIncrement', autoIncrement);
       }
       return this[_createObjectStore](name, options);
     }
@@ -38402,8 +39477,8 @@
       }
       return this[_transaction](storeNames, mode);
     }
-    [_transaction](stores, mode) {
-      return this.transaction(stores, mode);
+    [_transaction](...args) {
+      return this.transaction.apply(this, args);
     }
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
@@ -38417,8 +39492,8 @@
     get [dartx.version]() {
       return this.version;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
     [_createObjectStore](name, options) {
       if (options === void 0) options = null;
@@ -38428,14 +39503,14 @@
       }
       return this[_createObjectStore_2](name);
     }
-    [_createObjectStore_1](name, options) {
-      return this.createObjectStore(name, options);
+    [_createObjectStore_1](...args) {
+      return this.createObjectStore.apply(this, args);
     }
-    [_createObjectStore_2](name) {
-      return this.createObjectStore(name);
+    [_createObjectStore_2](...args) {
+      return this.createObjectStore.apply(this, args);
     }
-    [dartx.deleteObjectStore](name) {
-      return this.deleteObjectStore(name);
+    [dartx.deleteObjectStore](...args) {
+      return this.deleteObjectStore.apply(this, args);
     }
     get [dartx.onAbort]() {
       return indexed_db.Database.abortEvent.forTarget(this);
@@ -38574,17 +39649,17 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.cmp](first, second) {
-      return this.cmp(first, second);
+    [dartx.cmp](...args) {
+      return this.cmp.apply(this, args);
     }
-    [_deleteDatabase](name) {
-      return this.deleteDatabase(name);
+    [_deleteDatabase](...args) {
+      return this.deleteDatabase.apply(this, args);
     }
-    [_open](name, version) {
-      return this.open(name, version);
+    [_open](...args) {
+      return this.open.apply(this, args);
     }
-    [_webkitGetDatabaseNames]() {
-      return this.webkitGetDatabaseNames();
+    [_webkitGetDatabaseNames](...args) {
+      return this.webkitGetDatabaseNames.apply(this, args);
     }
   };
   dart.setSignature(indexed_db.IdbFactory, {
@@ -38727,26 +39802,26 @@
     get [dartx.unique]() {
       return this.unique;
     }
-    [_count$0](key) {
-      return this.count(key);
+    [_count$0](...args) {
+      return this.count.apply(this, args);
     }
-    [_get$](key) {
-      return this.get(key);
+    [_get$](...args) {
+      return this.get.apply(this, args);
     }
-    [dartx.getAll](range, maxCount) {
-      return this.getAll(range, maxCount);
+    [dartx.getAll](...args) {
+      return this.getAll.apply(this, args);
     }
-    [dartx.getAllKeys](range, maxCount) {
-      return this.getAllKeys(range, maxCount);
+    [dartx.getAllKeys](...args) {
+      return this.getAllKeys.apply(this, args);
     }
-    [_getKey$](key) {
-      return this.getKey(key);
+    [_getKey$](...args) {
+      return this.getKey.apply(this, args);
     }
-    [_openCursor](range, direction) {
-      return this.openCursor(range, direction);
+    [_openCursor](...args) {
+      return this.openCursor.apply(this, args);
     }
-    [_openKeyCursor](range, direction) {
-      return this.openKeyCursor(range, direction);
+    [_openKeyCursor](...args) {
+      return this.openKeyCursor.apply(this, args);
     }
   };
   dart.setSignature(indexed_db.Index, {
@@ -38965,10 +40040,10 @@
       let multiEntry = opts && 'multiEntry' in opts ? opts.multiEntry : null;
       let options = dart.map();
       if (unique != null) {
-        options[dartx.set]('unique', unique);
+        options[dartx._set]('unique', unique);
       }
       if (multiEntry != null) {
-        options[dartx.set]('multiEntry', multiEntry);
+        options[dartx._set]('multiEntry', multiEntry);
       }
       return this[_createIndex](name, keyPath, options);
     }
@@ -39000,17 +40075,17 @@
       let value_1 = html_common.convertDartToNative_SerializedScriptValue(value);
       return this[_add_2](value_1);
     }
-    [_add_1](value, key) {
-      return this.add(value, key);
+    [_add_1](...args) {
+      return this.add.apply(this, args);
     }
-    [_add_2](value) {
-      return this.add(value);
+    [_add_2](...args) {
+      return this.add.apply(this, args);
     }
-    [_clear$0]() {
-      return this.clear();
+    [_clear$0](...args) {
+      return this.clear.apply(this, args);
     }
-    [_count$0](key) {
-      return this.count(key);
+    [_count$0](...args) {
+      return this.count.apply(this, args);
     }
     [_createIndex](name, keyPath, options) {
       if (options === void 0) options = null;
@@ -39020,35 +40095,35 @@
       }
       return this[_createIndex_2](name, keyPath);
     }
-    [_createIndex_1](name, keyPath, options) {
-      return this.createIndex(name, keyPath, options);
+    [_createIndex_1](...args) {
+      return this.createIndex.apply(this, args);
     }
-    [_createIndex_2](name, keyPath) {
-      return this.createIndex(name, keyPath);
+    [_createIndex_2](...args) {
+      return this.createIndex.apply(this, args);
     }
-    [_delete](key) {
-      return this.delete(key);
+    [_delete](...args) {
+      return this.delete.apply(this, args);
     }
-    [dartx.deleteIndex](name) {
-      return this.deleteIndex(name);
+    [dartx.deleteIndex](...args) {
+      return this.deleteIndex.apply(this, args);
     }
-    [_get$](key) {
-      return this.get(key);
+    [_get$](...args) {
+      return this.get.apply(this, args);
     }
-    [dartx.getAll](range, maxCount) {
-      return this.getAll(range, maxCount);
+    [dartx.getAll](...args) {
+      return this.getAll.apply(this, args);
     }
-    [dartx.getAllKeys](range, maxCount) {
-      return this.getAllKeys(range, maxCount);
+    [dartx.getAllKeys](...args) {
+      return this.getAllKeys.apply(this, args);
     }
-    [dartx.index](name) {
-      return this.index(name);
+    [dartx.index](...args) {
+      return this.index.apply(this, args);
     }
-    [_openCursor](range, direction) {
-      return this.openCursor(range, direction);
+    [_openCursor](...args) {
+      return this.openCursor.apply(this, args);
     }
-    [dartx.openKeyCursor](range, direction) {
-      return this.openKeyCursor(range, direction);
+    [dartx.openKeyCursor](...args) {
+      return this.openKeyCursor.apply(this, args);
     }
     [_put](value, key) {
       if (key === void 0) key = null;
@@ -39060,11 +40135,11 @@
       let value_1 = html_common.convertDartToNative_SerializedScriptValue(value);
       return this[_put_2](value_1);
     }
-    [_put_1](value, key) {
-      return this.put(value, key);
+    [_put_1](...args) {
+      return this.put.apply(this, args);
     }
-    [_put_2](value) {
-      return this.put(value);
+    [_put_2](...args) {
+      return this.put.apply(this, args);
     }
     static _cursorStreamFromResult(T) {
       return (request, autoAdvance) => {
@@ -39235,6 +40310,7 @@
     }
   });
   dart.registerExtension(dart.global.IDBOpenDBRequest, indexed_db.OpenDBRequest);
+  dart.registerExtension(dart.global.IDBVersionChangeRequest, indexed_db.OpenDBRequest);
   dart.defineExtensionNames([
     'completed',
     'abort',
@@ -39278,11 +40354,11 @@
     get [dartx.objectStoreNames]() {
       return this.objectStoreNames;
     }
-    [dartx.abort]() {
-      return this.abort();
+    [dartx.abort](...args) {
+      return this.abort.apply(this, args);
     }
-    [dartx.objectStore](name) {
-      return this.objectStore(name);
+    [dartx.objectStore](...args) {
+      return this.objectStore.apply(this, args);
     }
     get [dartx.onAbort]() {
       return indexed_db.Transaction.abortEvent.forTarget(this);
@@ -39429,17 +40505,17 @@
     get [dartx.type]() {
       return this.type;
     }
-    [_initEvent](type, bubbles, cancelable) {
-      return this.initEvent(type, bubbles, cancelable);
+    [_initEvent](...args) {
+      return this.initEvent.apply(this, args);
     }
-    [dartx.preventDefault]() {
-      return this.preventDefault();
+    [dartx.preventDefault](...args) {
+      return this.preventDefault.apply(this, args);
     }
-    [dartx.stopImmediatePropagation]() {
-      return this.stopImmediatePropagation();
+    [dartx.stopImmediatePropagation](...args) {
+      return this.stopImmediatePropagation.apply(this, args);
     }
-    [dartx.stopPropagation]() {
-      return this.stopPropagation();
+    [dartx.stopPropagation](...args) {
+      return this.stopPropagation.apply(this, args);
     }
   };
   dart.setSignature(html$.Event, {
@@ -39486,6 +40562,7 @@
   html$.Event.BUBBLING_PHASE = 3;
   html$.Event.CAPTURING_PHASE = 1;
   dart.registerExtension(dart.global.Event, html$.Event);
+  dart.registerExtension(dart.global.InputEvent, html$.Event);
   dart.defineExtensionNames([
     'dataLoss',
     'dataLossMessage',
@@ -39739,26 +40816,26 @@
     set [dartx.text](value) {
       this.textContent = value;
     }
-    [dartx.append](node) {
-      return this.appendChild(node);
+    [dartx.append](...args) {
+      return this.appendChild.apply(this, args);
     }
-    [dartx.clone](deep) {
-      return this.cloneNode(deep);
+    [dartx.clone](...args) {
+      return this.cloneNode.apply(this, args);
     }
-    [dartx.contains](other) {
-      return this.contains(other);
+    [dartx.contains](...args) {
+      return this.contains.apply(this, args);
     }
-    [dartx.hasChildNodes]() {
-      return this.hasChildNodes();
+    [dartx.hasChildNodes](...args) {
+      return this.hasChildNodes.apply(this, args);
     }
-    [dartx.insertBefore](node, child) {
-      return this.insertBefore(node, child);
+    [dartx.insertBefore](...args) {
+      return this.insertBefore.apply(this, args);
     }
-    [_removeChild](child) {
-      return this.removeChild(child);
+    [_removeChild](...args) {
+      return this.removeChild.apply(this, args);
     }
-    [_replaceChild](node, child) {
-      return this.replaceChild(node, child);
+    [_replaceChild](...args) {
+      return this.replaceChild.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.Node, '_created');
@@ -40145,7 +41222,7 @@
       let attributes = this[dartx.attributes];
       attributes[dartx.clear]();
       for (let key of value[dartx.keys]) {
-        attributes[dartx.set](key, value[dartx.get](key));
+        attributes[dartx._set](key, value[dartx._get](key));
       }
     }
     get [dartx.children]() {
@@ -40185,7 +41262,7 @@
       let data = this[dartx.dataset];
       data[dartx.clear]();
       for (let key of value[dartx.keys]) {
-        data[dartx.set](key, value[dartx.get](key));
+        data[dartx._set](key, value[dartx._get](key));
       }
     }
     [dartx.getNamespacedAttributes](namespace) {
@@ -40238,8 +41315,8 @@
       let convertedTiming = core.Map.is(timing) ? html_common.convertDartToNative_Dictionary(timing) : timing;
       return convertedTiming == null ? this[_animate](convertedFrames) : this[_animate](convertedFrames, convertedTiming);
     }
-    [_animate](effect, timing) {
-      return this.animate(effect, timing);
+    [_animate](...args) {
+      return this.animate.apply(this, args);
     }
     [dartx.attributeChanged](name, oldValue, newValue) {}
     get [_xtag]() {
@@ -40299,8 +41376,8 @@
         this[_insertAdjacentNode](where, html$.Text.new(text));
       }
     }
-    [_insertAdjacentText](where, text) {
-      return this.insertAdjacentText(where, text);
+    [_insertAdjacentText](...args) {
+      return this.insertAdjacentText.apply(this, args);
     }
     [dartx.insertAdjacentHtml](where, html, opts) {
       let validator = opts && 'validator' in opts ? opts.validator : null;
@@ -40311,8 +41388,8 @@
         this[_insertAdjacentNode](where, this[dartx.createFragment](html, {validator: validator, treeSanitizer: treeSanitizer}));
       }
     }
-    [_insertAdjacentHtml](where, text) {
-      return this.insertAdjacentHTML(where, text);
+    [_insertAdjacentHtml](...args) {
+      return this.insertAdjacentHTML.apply(this, args);
     }
     [dartx.insertAdjacentElement](where, element) {
       if (!!this.insertAdjacentElement) {
@@ -40322,8 +41399,8 @@
       }
       return element;
     }
-    [_insertAdjacentElement](where, element) {
-      return this.insertAdjacentElement(where, element);
+    [_insertAdjacentElement](...args) {
+      return this.insertAdjacentElement.apply(this, args);
     }
     [_insertAdjacentNode](where, node) {
       switch (where[dartx.toLowerCase]()) {
@@ -40334,7 +41411,7 @@
         }
         case 'afterbegin':
         {
-          let first = dart.notNull(this[dartx.nodes][dartx.length]) > 0 ? this[dartx.nodes][dartx.get](0) : null;
+          let first = dart.notNull(this[dartx.nodes][dartx.length]) > 0 ? this[dartx.nodes][dartx._get](0) : null;
           this[dartx.insertBefore](node, first);
           break;
         }
@@ -40637,14 +41714,14 @@
     set [dartx.dropzone](value) {
       this.webkitdropzone = value;
     }
-    [dartx.blur]() {
-      return this.blur();
+    [dartx.blur](...args) {
+      return this.blur.apply(this, args);
     }
-    [dartx.click]() {
-      return this.click();
+    [dartx.click](...args) {
+      return this.click.apply(this, args);
     }
-    [dartx.focus]() {
-      return this.focus();
+    [dartx.focus](...args) {
+      return this.focus.apply(this, args);
     }
     get [_attributes$]() {
       return this.attributes;
@@ -40709,50 +41786,50 @@
     get [dartx.tagName]() {
       return this.tagName;
     }
-    [dartx.closest](selectors) {
-      return this.closest(selectors);
+    [dartx.closest](...args) {
+      return this.closest.apply(this, args);
     }
-    [dartx.getAnimations]() {
-      return this.getAnimations();
+    [dartx.getAnimations](...args) {
+      return this.getAnimations.apply(this, args);
     }
-    [dartx.getAttribute](name) {
-      return this.getAttribute(name);
+    [dartx.getAttribute](...args) {
+      return this.getAttribute.apply(this, args);
     }
-    [dartx.getAttributeNS](namespaceURI, localName) {
-      return this.getAttributeNS(namespaceURI, localName);
+    [dartx.getAttributeNS](...args) {
+      return this.getAttributeNS.apply(this, args);
     }
-    [dartx.getBoundingClientRect]() {
-      return this.getBoundingClientRect();
+    [dartx.getBoundingClientRect](...args) {
+      return this.getBoundingClientRect.apply(this, args);
     }
-    [dartx.getClientRects]() {
-      return this.getClientRects();
+    [dartx.getClientRects](...args) {
+      return this.getClientRects.apply(this, args);
     }
-    [dartx.getDestinationInsertionPoints]() {
-      return this.getDestinationInsertionPoints();
+    [dartx.getDestinationInsertionPoints](...args) {
+      return this.getDestinationInsertionPoints.apply(this, args);
     }
-    [dartx.getElementsByClassName](classNames) {
-      return this.getElementsByClassName(classNames);
+    [dartx.getElementsByClassName](...args) {
+      return this.getElementsByClassName.apply(this, args);
     }
-    [_getElementsByTagName](localName) {
-      return this.getElementsByTagName(localName);
+    [_getElementsByTagName](...args) {
+      return this.getElementsByTagName.apply(this, args);
     }
-    [_hasAttribute](name) {
-      return this.hasAttribute(name);
+    [_hasAttribute](...args) {
+      return this.hasAttribute.apply(this, args);
     }
-    [_hasAttributeNS](namespaceURI, localName) {
-      return this.hasAttributeNS(namespaceURI, localName);
+    [_hasAttributeNS](...args) {
+      return this.hasAttributeNS.apply(this, args);
     }
-    [_removeAttribute](name) {
-      return this.removeAttribute(name);
+    [_removeAttribute](...args) {
+      return this.removeAttribute.apply(this, args);
     }
-    [_removeAttributeNS](namespaceURI, localName) {
-      return this.removeAttributeNS(namespaceURI, localName);
+    [_removeAttributeNS](...args) {
+      return this.removeAttributeNS.apply(this, args);
     }
-    [dartx.requestFullscreen]() {
-      return this.requestFullscreen();
+    [dartx.requestFullscreen](...args) {
+      return this.requestFullscreen.apply(this, args);
     }
-    [dartx.requestPointerLock]() {
-      return this.requestPointerLock();
+    [dartx.requestPointerLock](...args) {
+      return this.requestPointerLock.apply(this, args);
     }
     [dartx.scroll](options_OR_x, y) {
       if (options_OR_x === void 0) options_OR_x = null;
@@ -40772,14 +41849,14 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_scroll_1]() {
-      return this.scroll();
+    [_scroll_1](...args) {
+      return this.scroll.apply(this, args);
     }
-    [_scroll_2](options) {
-      return this.scroll(options);
+    [_scroll_2](...args) {
+      return this.scroll.apply(this, args);
     }
-    [_scroll_3](x, y) {
-      return this.scroll(x, y);
+    [_scroll_3](...args) {
+      return this.scroll.apply(this, args);
     }
     [dartx.scrollBy](options_OR_x, y) {
       if (options_OR_x === void 0) options_OR_x = null;
@@ -40799,20 +41876,20 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_scrollBy_1]() {
-      return this.scrollBy();
+    [_scrollBy_1](...args) {
+      return this.scrollBy.apply(this, args);
     }
-    [_scrollBy_2](options) {
-      return this.scrollBy(options);
+    [_scrollBy_2](...args) {
+      return this.scrollBy.apply(this, args);
     }
-    [_scrollBy_3](x, y) {
-      return this.scrollBy(x, y);
+    [_scrollBy_3](...args) {
+      return this.scrollBy.apply(this, args);
     }
-    [_scrollIntoView](alignWithTop) {
-      return this.scrollIntoView(alignWithTop);
+    [_scrollIntoView](...args) {
+      return this.scrollIntoView.apply(this, args);
     }
-    [_scrollIntoViewIfNeeded](centerIfNeeded) {
-      return this.scrollIntoViewIfNeeded(centerIfNeeded);
+    [_scrollIntoViewIfNeeded](...args) {
+      return this.scrollIntoViewIfNeeded.apply(this, args);
     }
     [dartx.scrollTo](options_OR_x, y) {
       if (options_OR_x === void 0) options_OR_x = null;
@@ -40832,26 +41909,26 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_scrollTo_1]() {
-      return this.scrollTo();
+    [_scrollTo_1](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [_scrollTo_2](options) {
-      return this.scrollTo(options);
+    [_scrollTo_2](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [_scrollTo_3](x, y) {
-      return this.scrollTo(x, y);
+    [_scrollTo_3](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [dartx.setAttribute](name, value) {
-      return this.setAttribute(name, value);
+    [dartx.setAttribute](...args) {
+      return this.setAttribute.apply(this, args);
     }
-    [dartx.setAttributeNS](namespaceURI, name, value) {
-      return this.setAttributeNS(namespaceURI, name, value);
+    [dartx.setAttributeNS](...args) {
+      return this.setAttributeNS.apply(this, args);
     }
-    [dartx.after](nodes) {
-      return this.after(nodes);
+    [dartx.after](...args) {
+      return this.after.apply(this, args);
     }
-    [dartx.before](nodes) {
-      return this.before(nodes);
+    [dartx.before](...args) {
+      return this.before.apply(this, args);
     }
     get [dartx.nextElementSibling]() {
       return this.nextElementSibling;
@@ -40871,11 +41948,11 @@
     get [_lastElementChild]() {
       return this.lastElementChild;
     }
-    [dartx.querySelector](selectors) {
-      return this.querySelector(selectors);
+    [dartx.querySelector](...args) {
+      return this.querySelector.apply(this, args);
     }
-    [_querySelectorAll](selectors) {
-      return this.querySelectorAll(selectors);
+    [_querySelectorAll](...args) {
+      return this.querySelectorAll.apply(this, args);
     }
     get [dartx.onAbort]() {
       return html$.Element.abortEvent.forElement(this);
@@ -41931,20 +43008,20 @@
     set [dartx.startTime](value) {
       this.startTime = value;
     }
-    [dartx.cancel]() {
-      return this.cancel();
+    [dartx.cancel](...args) {
+      return this.cancel.apply(this, args);
     }
-    [dartx.finish]() {
-      return this.finish();
+    [dartx.finish](...args) {
+      return this.finish.apply(this, args);
     }
-    [dartx.pause]() {
-      return this.pause();
+    [dartx.pause](...args) {
+      return this.pause.apply(this, args);
     }
-    [dartx.play]() {
-      return this.play();
+    [dartx.play](...args) {
+      return this.play.apply(this, args);
     }
-    [dartx.reverse]() {
-      return this.reverse();
+    [dartx.reverse](...args) {
+      return this.reverse.apply(this, args);
     }
   };
   dart.setSignature(html$.Animation, {
@@ -42195,11 +43272,11 @@
     set [dartx.playbackRate](value) {
       this.playbackRate = value;
     }
-    [dartx.getAnimations]() {
-      return this.getAnimations();
+    [dartx.getAnimations](...args) {
+      return this.getAnimations.apply(this, args);
     }
-    [dartx.play](source) {
-      return this.play(source);
+    [dartx.play](...args) {
+      return this.play.apply(this, args);
     }
   };
   dart.setSignature(html$.AnimationTimeline, {
@@ -42261,14 +43338,14 @@
     get [dartx.status]() {
       return this.status;
     }
-    [dartx.abort]() {
-      return this.abort();
+    [dartx.abort](...args) {
+      return this.abort.apply(this, args);
     }
-    [dartx.swapCache]() {
-      return this.swapCache();
+    [dartx.swapCache](...args) {
+      return this.swapCache.apply(this, args);
     }
-    [dartx.update]() {
-      return this.update();
+    [dartx.update](...args) {
+      return this.update.apply(this, args);
     }
     get [dartx.onCached]() {
       return html$.ApplicationCache.cachedEvent.forTarget(this);
@@ -42364,6 +43441,8 @@
     }
   });
   dart.registerExtension(dart.global.ApplicationCache, html$.ApplicationCache);
+  dart.registerExtension(dart.global.DOMApplicationCache, html$.ApplicationCache);
+  dart.registerExtension(dart.global.OfflineResourceList, html$.ApplicationCache);
   dart.defineExtensionNames([
     'message',
     'reason',
@@ -42813,35 +43892,35 @@
     get [dartx.videoDecodedByteCount]() {
       return this.webkitVideoDecodedByteCount;
     }
-    [dartx.addTextTrack](kind, label, language) {
-      return this.addTextTrack(kind, label, language);
+    [dartx.addTextTrack](...args) {
+      return this.addTextTrack.apply(this, args);
     }
-    [dartx.canPlayType](type, keySystem) {
-      return this.canPlayType(type, keySystem);
+    [dartx.canPlayType](...args) {
+      return this.canPlayType.apply(this, args);
     }
-    [dartx.load]() {
-      return this.load();
+    [dartx.load](...args) {
+      return this.load.apply(this, args);
     }
-    [dartx.pause]() {
-      return this.pause();
+    [dartx.pause](...args) {
+      return this.pause.apply(this, args);
     }
-    [dartx.play]() {
-      return this.play();
+    [dartx.play](...args) {
+      return this.play.apply(this, args);
     }
-    [dartx.setMediaKeys](mediaKeys) {
-      return this.setMediaKeys(mediaKeys);
+    [dartx.setMediaKeys](...args) {
+      return this.setMediaKeys.apply(this, args);
     }
-    [dartx.setSinkId](sinkId) {
-      return this.setSinkId(sinkId);
+    [dartx.setSinkId](...args) {
+      return this.setSinkId.apply(this, args);
     }
-    [dartx.addKey](keySystem, key, initData, sessionId) {
-      return this.webkitAddKey(keySystem, key, initData, sessionId);
+    [dartx.addKey](...args) {
+      return this.webkitAddKey.apply(this, args);
     }
-    [dartx.cancelKeyRequest](keySystem, sessionId) {
-      return this.webkitCancelKeyRequest(keySystem, sessionId);
+    [dartx.cancelKeyRequest](...args) {
+      return this.webkitCancelKeyRequest.apply(this, args);
     }
-    [dartx.generateKeyRequest](keySystem, initData) {
-      return this.webkitGenerateKeyRequest(keySystem, initData);
+    [dartx.generateKeyRequest](...args) {
+      return this.webkitGenerateKeyRequest.apply(this, args);
     }
     get [dartx.onKeyAdded]() {
       return html$.MediaElement.keyAddedEvent.forElement(this);
@@ -43045,11 +44124,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [__getter__](index) {
-      return this.__getter__(index);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.getTrackById](id) {
-      return this.getTrackById(id);
+    [dartx.getTrackById](...args) {
+      return this.getTrackById.apply(this, args);
     }
     get [dartx.onChange]() {
       return html$.AudioTrackList.changeEvent.forTarget(this);
@@ -43249,8 +44328,8 @@
     get [dartx.userChoice]() {
       return this.userChoice;
     }
-    [dartx.prompt]() {
-      return this.prompt();
+    [dartx.prompt](...args) {
+      return this.prompt.apply(this, args);
     }
   };
   dart.setSignature(html$.BeforeInstallPromptEvent, {
@@ -43305,11 +44384,11 @@
     get [dartx.type]() {
       return this.type;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.slice](start, end, contentType) {
-      return this.slice(start, end, contentType);
+    [dartx.slice](...args) {
+      return this.slice.apply(this, args);
     }
     static new(blobParts, type, endings) {
       if (type === void 0) type = null;
@@ -43369,8 +44448,8 @@
       let options_1 = html_common.convertDartToNative_Dictionary(options);
       return this[_requestDevice_1](options_1);
     }
-    [_requestDevice_1](options) {
-      return this.requestDevice(options);
+    [_requestDevice_1](...args) {
+      return this.requestDevice.apply(this, args);
     }
   };
   dart.setSignature(html$.Bluetooth, {
@@ -43420,8 +44499,8 @@
     get [dartx.vendorIDSource]() {
       return this.vendorIDSource;
     }
-    [dartx.connectGatt]() {
-      return this.connectGATT();
+    [dartx.connectGatt](...args) {
+      return this.connectGATT.apply(this, args);
     }
   };
   dart.setSignature(html$.BluetoothDevice, {
@@ -43451,11 +44530,11 @@
     get [dartx.uuid]() {
       return this.uuid;
     }
-    [dartx.readValue]() {
-      return this.readValue();
+    [dartx.readValue](...args) {
+      return this.readValue.apply(this, args);
     }
-    [dartx.writeValue](value) {
-      return this.writeValue(value);
+    [dartx.writeValue](...args) {
+      return this.writeValue.apply(this, args);
     }
   };
   dart.setSignature(html$.BluetoothGattCharacteristic, {
@@ -43478,8 +44557,8 @@
     get [dartx.connected]() {
       return this.connected;
     }
-    [dartx.getPrimaryService](service) {
-      return this.getPrimaryService(service);
+    [dartx.getPrimaryService](...args) {
+      return this.getPrimaryService.apply(this, args);
     }
   };
   dart.setSignature(html$.BluetoothGattRemoteServer, {
@@ -43503,8 +44582,8 @@
     get [dartx.uuid]() {
       return this.uuid;
     }
-    [dartx.getCharacteristic](characteristic) {
-      return this.getCharacteristic(characteristic);
+    [dartx.getCharacteristic](...args) {
+      return this.getCharacteristic.apply(this, args);
     }
   };
   dart.setSignature(html$.BluetoothGattService, {
@@ -43546,17 +44625,17 @@
     get [dartx.bodyUsed]() {
       return this.bodyUsed;
     }
-    [dartx.arrayBuffer]() {
-      return this.arrayBuffer();
+    [dartx.arrayBuffer](...args) {
+      return this.arrayBuffer.apply(this, args);
     }
-    [dartx.blob]() {
-      return this.blob();
+    [dartx.blob](...args) {
+      return this.blob.apply(this, args);
     }
-    [dartx.json]() {
-      return this.json();
+    [dartx.json](...args) {
+      return this.json.apply(this, args);
     }
-    [dartx.text]() {
-      return this.text();
+    [dartx.text](...args) {
+      return this.text.apply(this, args);
     }
   };
   dart.setSignature(html$.Body, {
@@ -43830,14 +44909,14 @@
     get [dartx.willValidate]() {
       return this.willValidate;
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.ButtonElement, 'created');
@@ -43898,26 +44977,26 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.appendData](data) {
-      return this.appendData(data);
+    [dartx.appendData](...args) {
+      return this.appendData.apply(this, args);
     }
-    [dartx.deleteData](offset, count) {
-      return this.deleteData(offset, count);
+    [dartx.deleteData](...args) {
+      return this.deleteData.apply(this, args);
     }
-    [dartx.insertData](offset, data) {
-      return this.insertData(offset, data);
+    [dartx.insertData](...args) {
+      return this.insertData.apply(this, args);
     }
-    [dartx.replaceData](offset, count, data) {
-      return this.replaceData(offset, count, data);
+    [dartx.replaceData](...args) {
+      return this.replaceData.apply(this, args);
     }
-    [dartx.substringData](offset, count) {
-      return this.substringData(offset, count);
+    [dartx.substringData](...args) {
+      return this.substringData.apply(this, args);
     }
-    [dartx.after](nodes) {
-      return this.after(nodes);
+    [dartx.after](...args) {
+      return this.after.apply(this, args);
     }
-    [dartx.before](nodes) {
-      return this.before(nodes);
+    [dartx.before](...args) {
+      return this.before.apply(this, args);
     }
     get [dartx.nextElementSibling]() {
       return this.nextElementSibling;
@@ -43961,11 +45040,11 @@
     get [dartx.wholeText]() {
       return this.wholeText;
     }
-    [dartx.getDestinationInsertionPoints]() {
-      return this.getDestinationInsertionPoints();
+    [dartx.getDestinationInsertionPoints](...args) {
+      return this.getDestinationInsertionPoints.apply(this, args);
     }
-    [dartx.splitText](offset) {
-      return this.splitText(offset);
+    [dartx.splitText](...args) {
+      return this.splitText.apply(this, args);
     }
   };
   dart.setSignature(html$.Text, {
@@ -44002,14 +45081,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.delete](cacheName) {
-      return this.delete(cacheName);
+    [dartx.delete](...args) {
+      return this.delete.apply(this, args);
     }
-    [dartx.has](cacheName) {
-      return this.has(cacheName);
+    [dartx.has](...args) {
+      return this.has.apply(this, args);
     }
-    [dartx.keys]() {
-      return this.keys();
+    [dartx.keys](...args) {
+      return this.keys.apply(this, args);
     }
     [dartx.match](request, options) {
       if (options === void 0) options = null;
@@ -44019,14 +45098,14 @@
       }
       return this[_match_2](request);
     }
-    [_match_1](request, options) {
-      return this.match(request, options);
+    [_match_1](...args) {
+      return this.match.apply(this, args);
     }
-    [_match_2](request) {
-      return this.match(request);
+    [_match_2](...args) {
+      return this.match.apply(this, args);
     }
-    [dartx.open](cacheName) {
-      return this.open(cacheName);
+    [dartx.open](...args) {
+      return this.open.apply(this, args);
     }
   };
   dart.setSignature(html$.CacheStorage, {
@@ -44092,14 +45171,14 @@
       }
       return this[_getContext_2](contextId);
     }
-    [_getContext_1](contextId, attributes) {
-      return this.getContext(contextId, attributes);
+    [_getContext_1](...args) {
+      return this.getContext.apply(this, args);
     }
-    [_getContext_2](contextId) {
-      return this.getContext(contextId);
+    [_getContext_2](...args) {
+      return this.getContext.apply(this, args);
     }
-    [_toDataUrl](type, arguments_OR_quality) {
-      return this.toDataURL(type, arguments_OR_quality);
+    [_toDataUrl](...args) {
+      return this.toDataURL.apply(this, args);
     }
     get [dartx.onWebGlContextLost]() {
       return html$.CanvasElement.webGlContextLostEvent.forElement(this);
@@ -44176,8 +45255,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.addColorStop](offset, color) {
-      return this.addColorStop(offset, color);
+    [dartx.addColorStop](...args) {
+      return this.addColorStop.apply(this, args);
     }
   };
   dart.setSignature(html$.CanvasGradient, {
@@ -44192,8 +45271,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.setTransform](transform) {
-      return this.setTransform(transform);
+    [dartx.setTransform](...args) {
+      return this.setTransform.apply(this, args);
     }
   };
   dart.setSignature(html$.CanvasPattern, {
@@ -44422,23 +45501,23 @@
       this[_addHitRegion_2]();
       return;
     }
-    [_addHitRegion_1](options) {
-      return this.addHitRegion(options);
+    [_addHitRegion_1](...args) {
+      return this.addHitRegion.apply(this, args);
     }
-    [_addHitRegion_2]() {
-      return this.addHitRegion();
+    [_addHitRegion_2](...args) {
+      return this.addHitRegion.apply(this, args);
     }
-    [dartx.beginPath]() {
-      return this.beginPath();
+    [dartx.beginPath](...args) {
+      return this.beginPath.apply(this, args);
     }
-    [dartx.clearHitRegions]() {
-      return this.clearHitRegions();
+    [dartx.clearHitRegions](...args) {
+      return this.clearHitRegions.apply(this, args);
     }
-    [dartx.clearRect](x, y, width, height) {
-      return this.clearRect(x, y, width, height);
+    [dartx.clearRect](...args) {
+      return this.clearRect.apply(this, args);
     }
-    [dartx.clip](path_OR_winding, winding) {
-      return this.clip(path_OR_winding, winding);
+    [dartx.clip](...args) {
+      return this.clip.apply(this, args);
     }
     [dartx.createImageData](imagedata_OR_sw, sh) {
       if (sh === void 0) sh = null;
@@ -44451,53 +45530,53 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_createImageData_1](imagedata) {
-      return this.createImageData(imagedata);
+    [_createImageData_1](...args) {
+      return this.createImageData.apply(this, args);
     }
-    [_createImageData_2](sw, sh) {
-      return this.createImageData(sw, sh);
+    [_createImageData_2](...args) {
+      return this.createImageData.apply(this, args);
     }
-    [dartx.createLinearGradient](x0, y0, x1, y1) {
-      return this.createLinearGradient(x0, y0, x1, y1);
+    [dartx.createLinearGradient](...args) {
+      return this.createLinearGradient.apply(this, args);
     }
-    [dartx.createPattern](image, repetitionType) {
-      return this.createPattern(image, repetitionType);
+    [dartx.createPattern](...args) {
+      return this.createPattern.apply(this, args);
     }
-    [dartx.createRadialGradient](x0, y0, r0, x1, y1, r1) {
-      return this.createRadialGradient(x0, y0, r0, x1, y1, r1);
+    [dartx.createRadialGradient](...args) {
+      return this.createRadialGradient.apply(this, args);
     }
-    [dartx.drawFocusIfNeeded](element_OR_path, element) {
-      return this.drawFocusIfNeeded(element_OR_path, element);
+    [dartx.drawFocusIfNeeded](...args) {
+      return this.drawFocusIfNeeded.apply(this, args);
     }
-    [dartx.fillRect](x, y, width, height) {
-      return this.fillRect(x, y, width, height);
+    [dartx.fillRect](...args) {
+      return this.fillRect.apply(this, args);
     }
     [dartx.getContextAttributes]() {
       return html_common.convertNativeToDart_Dictionary(this[_getContextAttributes_1]());
     }
-    [_getContextAttributes_1]() {
-      return this.getContextAttributes();
+    [_getContextAttributes_1](...args) {
+      return this.getContextAttributes.apply(this, args);
     }
     [dartx.getImageData](sx, sy, sw, sh) {
       return html_common.convertNativeToDart_ImageData(this[_getImageData_1](sx, sy, sw, sh));
     }
-    [_getImageData_1](sx, sy, sw, sh) {
-      return this.getImageData(sx, sy, sw, sh);
+    [_getImageData_1](...args) {
+      return this.getImageData.apply(this, args);
     }
-    [_getLineDash]() {
-      return this.getLineDash();
+    [_getLineDash](...args) {
+      return this.getLineDash.apply(this, args);
     }
-    [dartx.isContextLost]() {
-      return this.isContextLost();
+    [dartx.isContextLost](...args) {
+      return this.isContextLost.apply(this, args);
     }
-    [dartx.isPointInPath](path_OR_x, x_OR_y, winding_OR_y, winding) {
-      return this.isPointInPath(path_OR_x, x_OR_y, winding_OR_y, winding);
+    [dartx.isPointInPath](...args) {
+      return this.isPointInPath.apply(this, args);
     }
-    [dartx.isPointInStroke](path_OR_x, x_OR_y, y) {
-      return this.isPointInStroke(path_OR_x, x_OR_y, y);
+    [dartx.isPointInStroke](...args) {
+      return this.isPointInStroke.apply(this, args);
     }
-    [dartx.measureText](text) {
-      return this.measureText(text);
+    [dartx.measureText](...args) {
+      return this.measureText.apply(this, args);
     }
     [dartx.putImageData](imagedata, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight) {
       if (dirtyX === void 0) dirtyX = null;
@@ -44516,77 +45595,77 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_putImageData_1](imagedata, dx, dy) {
-      return this.putImageData(imagedata, dx, dy);
+    [_putImageData_1](...args) {
+      return this.putImageData.apply(this, args);
     }
-    [_putImageData_2](imagedata, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight) {
-      return this.putImageData(imagedata, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight);
+    [_putImageData_2](...args) {
+      return this.putImageData.apply(this, args);
     }
-    [dartx.removeHitRegion](id) {
-      return this.removeHitRegion(id);
+    [dartx.removeHitRegion](...args) {
+      return this.removeHitRegion.apply(this, args);
     }
-    [dartx.resetTransform]() {
-      return this.resetTransform();
+    [dartx.resetTransform](...args) {
+      return this.resetTransform.apply(this, args);
     }
-    [dartx.restore]() {
-      return this.restore();
+    [dartx.restore](...args) {
+      return this.restore.apply(this, args);
     }
-    [dartx.rotate](angle) {
-      return this.rotate(angle);
+    [dartx.rotate](...args) {
+      return this.rotate.apply(this, args);
     }
-    [dartx.save]() {
-      return this.save();
+    [dartx.save](...args) {
+      return this.save.apply(this, args);
     }
-    [dartx.scale](x, y) {
-      return this.scale(x, y);
+    [dartx.scale](...args) {
+      return this.scale.apply(this, args);
     }
-    [dartx.scrollPathIntoView](path) {
-      return this.scrollPathIntoView(path);
+    [dartx.scrollPathIntoView](...args) {
+      return this.scrollPathIntoView.apply(this, args);
     }
-    [dartx.setTransform](a, b, c, d, e, f) {
-      return this.setTransform(a, b, c, d, e, f);
+    [dartx.setTransform](...args) {
+      return this.setTransform.apply(this, args);
     }
-    [dartx.stroke](path) {
-      return this.stroke(path);
+    [dartx.stroke](...args) {
+      return this.stroke.apply(this, args);
     }
-    [dartx.strokeRect](x, y, width, height) {
-      return this.strokeRect(x, y, width, height);
+    [dartx.strokeRect](...args) {
+      return this.strokeRect.apply(this, args);
     }
-    [dartx.strokeText](text, x, y, maxWidth) {
-      return this.strokeText(text, x, y, maxWidth);
+    [dartx.strokeText](...args) {
+      return this.strokeText.apply(this, args);
     }
-    [dartx.transform](a, b, c, d, e, f) {
-      return this.transform(a, b, c, d, e, f);
+    [dartx.transform](...args) {
+      return this.transform.apply(this, args);
     }
-    [dartx.translate](x, y) {
-      return this.translate(x, y);
+    [dartx.translate](...args) {
+      return this.translate.apply(this, args);
     }
-    [_arc](x, y, radius, startAngle, endAngle, anticlockwise) {
-      return this.arc(x, y, radius, startAngle, endAngle, anticlockwise);
+    [_arc](...args) {
+      return this.arc.apply(this, args);
     }
-    [dartx.arcTo](x1, y1, x2, y2, radius) {
-      return this.arcTo(x1, y1, x2, y2, radius);
+    [dartx.arcTo](...args) {
+      return this.arcTo.apply(this, args);
     }
-    [dartx.bezierCurveTo](cp1x, cp1y, cp2x, cp2y, x, y) {
-      return this.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
+    [dartx.bezierCurveTo](...args) {
+      return this.bezierCurveTo.apply(this, args);
     }
-    [dartx.closePath]() {
-      return this.closePath();
+    [dartx.closePath](...args) {
+      return this.closePath.apply(this, args);
     }
-    [dartx.ellipse](x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
-      return this.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
+    [dartx.ellipse](...args) {
+      return this.ellipse.apply(this, args);
     }
-    [dartx.lineTo](x, y) {
-      return this.lineTo(x, y);
+    [dartx.lineTo](...args) {
+      return this.lineTo.apply(this, args);
     }
-    [dartx.moveTo](x, y) {
-      return this.moveTo(x, y);
+    [dartx.moveTo](...args) {
+      return this.moveTo.apply(this, args);
     }
-    [dartx.quadraticCurveTo](cpx, cpy, x, y) {
-      return this.quadraticCurveTo(cpx, cpy, x, y);
+    [dartx.quadraticCurveTo](...args) {
+      return this.quadraticCurveTo.apply(this, args);
     }
-    [dartx.rect](x, y, width, height) {
-      return this.rect(x, y, width, height);
+    [dartx.rect](...args) {
+      return this.rect.apply(this, args);
     }
     [dartx.createImageDataFromImageData](imagedata) {
       return this.createImageData(imagedata);
@@ -44622,14 +45701,14 @@
         this[dartx.drawImageScaledFromSource](source, sourceRect[dartx.left], sourceRect[dartx.top], sourceRect[dartx.width], sourceRect[dartx.height], destRect[dartx.left], destRect[dartx.top], destRect[dartx.width], destRect[dartx.height]);
       }
     }
-    [dartx.drawImage](source, destX, destY) {
-      return this.drawImage(source, destX, destY);
+    [dartx.drawImage](...args) {
+      return this.drawImage.apply(this, args);
     }
-    [dartx.drawImageScaled](source, destX, destY, destWidth, destHeight) {
-      return this.drawImage(source, destX, destY, destWidth, destHeight);
+    [dartx.drawImageScaled](...args) {
+      return this.drawImage.apply(this, args);
     }
-    [dartx.drawImageScaledFromSource](source, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight) {
-      return this.drawImage(source, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight);
+    [dartx.drawImageScaledFromSource](...args) {
+      return this.drawImage.apply(this, args);
     }
     get [dartx.lineDashOffset]() {
       return this.lineDashOffset || this.webkitLineDashOffset;
@@ -44876,11 +45955,11 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
   };
   dart.setSignature(html$.Client, {
@@ -44908,8 +45987,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.claim]() {
-      return this.claim();
+    [dartx.claim](...args) {
+      return this.claim.apply(this, args);
     }
     [dartx.matchAll](options) {
       if (options === void 0) options = null;
@@ -44919,14 +45998,14 @@
       }
       return this[_matchAll_2]();
     }
-    [_matchAll_1](options) {
-      return this.matchAll(options);
+    [_matchAll_1](...args) {
+      return this.matchAll.apply(this, args);
     }
-    [_matchAll_2]() {
-      return this.matchAll();
+    [_matchAll_2](...args) {
+      return this.matchAll.apply(this, args);
     }
-    [dartx.openWindow](url) {
-      return this.openWindow(url);
+    [dartx.openWindow](...args) {
+      return this.openWindow.apply(this, args);
     }
   };
   dart.setSignature(html$.Clients, {
@@ -45084,8 +46163,8 @@
     get [_which]() {
       return this.which;
     }
-    [_initUIEvent](type, bubbles, cancelable, view, detail) {
-      return this.initUIEvent(type, bubbles, cancelable, view, detail);
+    [_initUIEvent](...args) {
+      return this.initUIEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.UIEvent, {
@@ -45148,8 +46227,8 @@
     get [dartx.data]() {
       return this.data;
     }
-    [_initCompositionEvent](type, bubbles, cancelable, view, data) {
-      return this.initCompositionEvent(type, bubbles, cancelable, view, data);
+    [_initCompositionEvent](...args) {
+      return this.initCompositionEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.CompositionEvent, {
@@ -45208,11 +46287,11 @@
     set [dartx.transform](value) {
       this.transform = value;
     }
-    [dartx.disconnect]() {
-      return this.disconnect();
+    [dartx.disconnect](...args) {
+      return this.disconnect.apply(this, args);
     }
-    [dartx.supports](attribute) {
-      return this.supports(attribute);
+    [dartx.supports](...args) {
+      return this.supports.apply(this, args);
     }
   };
   dart.setSignature(html$.CompositorProxy, {
@@ -45261,14 +46340,14 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [dartx.terminate]() {
-      return this.terminate();
+    [dartx.terminate](...args) {
+      return this.terminate.apply(this, args);
     }
     get [dartx.onError]() {
       return html$.CompositorWorker.errorEvent.forTarget(this);
@@ -45367,8 +46446,8 @@
     get [dartx.self]() {
       return this.self;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
     [dartx.fetch](input, init) {
       if (init === void 0) init = null;
@@ -45378,17 +46457,17 @@
       }
       return this[_fetch_2](input);
     }
-    [_fetch_1](input, init) {
-      return this.fetch(input, init);
+    [_fetch_1](...args) {
+      return this.fetch.apply(this, args);
     }
-    [_fetch_2](input) {
-      return this.fetch(input);
+    [_fetch_2](...args) {
+      return this.fetch.apply(this, args);
     }
-    [dartx.importScripts](urls) {
-      return this.importScripts(urls);
+    [dartx.importScripts](...args) {
+      return this.importScripts.apply(this, args);
     }
-    [_webkitRequestFileSystem](type, size, successCallback, errorCallback) {
-      return this.webkitRequestFileSystem(type, size, successCallback, errorCallback);
+    [_webkitRequestFileSystem](...args) {
+      return this.webkitRequestFileSystem.apply(this, args);
     }
     [dartx.webkitRequestFileSystem](type, size) {
       let completer = CompleterOfFileSystem().new();
@@ -45399,14 +46478,14 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [dartx.requestFileSystemSync](type, size) {
-      return this.webkitRequestFileSystemSync(type, size);
+    [dartx.requestFileSystemSync](...args) {
+      return this.webkitRequestFileSystemSync.apply(this, args);
     }
-    [dartx.resolveLocalFileSystemSyncUrl](url) {
-      return this.webkitResolveLocalFileSystemSyncURL(url);
+    [dartx.resolveLocalFileSystemSyncUrl](...args) {
+      return this.webkitResolveLocalFileSystemSyncURL.apply(this, args);
     }
-    [_webkitResolveLocalFileSystemUrl](url, successCallback, errorCallback) {
-      return this.webkitResolveLocalFileSystemURL(url, successCallback, errorCallback);
+    [_webkitResolveLocalFileSystemUrl](...args) {
+      return this.webkitResolveLocalFileSystemURL.apply(this, args);
     }
     [dartx.webkitResolveLocalFileSystemUrl](url) {
       let completer = CompleterOfEntry().new();
@@ -45417,29 +46496,29 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [dartx.atob](atob) {
-      return this.atob(atob);
+    [dartx.atob](...args) {
+      return this.atob.apply(this, args);
     }
-    [dartx.btoa](btoa) {
-      return this.btoa(btoa);
+    [dartx.btoa](...args) {
+      return this.btoa.apply(this, args);
     }
-    [_setInterval_String](handler, timeout, arguments$) {
-      return this.setInterval(handler, timeout, arguments$);
+    [_setInterval_String](...args) {
+      return this.setInterval.apply(this, args);
     }
-    [_setTimeout_String](handler, timeout, arguments$) {
-      return this.setTimeout(handler, timeout, arguments$);
+    [_setTimeout_String](...args) {
+      return this.setTimeout.apply(this, args);
     }
-    [_clearInterval](handle) {
-      return this.clearInterval(handle);
+    [_clearInterval](...args) {
+      return this.clearInterval.apply(this, args);
     }
-    [_clearTimeout](handle) {
-      return this.clearTimeout(handle);
+    [_clearTimeout](...args) {
+      return this.clearTimeout.apply(this, args);
     }
-    [_setInterval](handler, timeout) {
-      return this.setInterval(handler, timeout);
+    [_setInterval](...args) {
+      return this.setInterval.apply(this, args);
     }
-    [_setTimeout](handler, timeout) {
-      return this.setTimeout(handler, timeout);
+    [_setTimeout](...args) {
+      return this.setTimeout.apply(this, args);
     }
     get [dartx.onError]() {
       return html$.WorkerGlobalScope.errorEvent.forTarget(this);
@@ -45504,8 +46583,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.cancelAnimationFrame](handle) {
-      return this.cancelAnimationFrame(handle);
+    [dartx.cancelAnimationFrame](...args) {
+      return this.cancelAnimationFrame.apply(this, args);
     }
     [dartx.postMessage](message, transfer) {
       if (transfer === void 0) transfer = null;
@@ -45518,14 +46597,14 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [dartx.requestAnimationFrame](callback) {
-      return this.requestAnimationFrame(callback);
+    [dartx.requestAnimationFrame](...args) {
+      return this.requestAnimationFrame.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.CompositorWorkerGlobalScope.messageEvent.forTarget(this);
@@ -45675,14 +46754,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.assertCondition](condition, arg) {
-      return this.assert(condition, arg);
+    [dartx.assertCondition](...args) {
+      return this.assert.apply(this, args);
     }
-    [dartx.timeline](title) {
-      return this.timeline(title);
+    [dartx.timeline](...args) {
+      return this.timeline.apply(this, args);
     }
-    [dartx.timelineEnd](title) {
-      return this.timelineEnd(title);
+    [dartx.timelineEnd](...args) {
+      return this.timelineEnd.apply(this, args);
     }
   };
   dart.setSignature(html$.ConsoleBase, {
@@ -45718,8 +46797,8 @@
     set [dartx.select](value) {
       this.select = value;
     }
-    [dartx.getDistributedNodes]() {
-      return this.getDistributedNodes();
+    [dartx.getDistributedNodes](...args) {
+      return this.getDistributedNodes.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.ContentElement, 'created');
@@ -45826,8 +46905,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.notifySignedIn](credential) {
-      return this.notifySignedIn(credential);
+    [dartx.notifySignedIn](...args) {
+      return this.notifySignedIn.apply(this, args);
     }
     [dartx.request](options) {
       if (options === void 0) options = null;
@@ -45837,14 +46916,14 @@
       }
       return this[_request_2]();
     }
-    [_request_1](options) {
-      return this.request(options);
+    [_request_1](...args) {
+      return this.request.apply(this, args);
     }
-    [_request_2]() {
-      return this.request();
+    [_request_2](...args) {
+      return this.request.apply(this, args);
     }
-    [dartx.requireUserMediation]() {
-      return this.requireUserMediation();
+    [dartx.requireUserMediation](...args) {
+      return this.requireUserMediation.apply(this, args);
     }
   };
   dart.setSignature(html$.CredentialsContainer, {
@@ -45869,8 +46948,8 @@
     get [dartx.client]() {
       return this.client;
     }
-    [dartx.acceptConnection](shouldAccept) {
-      return this.acceptConnection(shouldAccept);
+    [dartx.acceptConnection](...args) {
+      return this.acceptConnection.apply(this, args);
     }
   };
   dart.setSignature(html$.CrossOriginConnectEvent, {
@@ -45905,11 +46984,11 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
   };
   dart.setSignature(html$.CrossOriginServiceWorkerClient, {
@@ -45943,8 +47022,8 @@
     get [dartx.subtle]() {
       return this.subtle;
     }
-    [_getRandomValues](array) {
-      return this.getRandomValues(array);
+    [_getRandomValues](...args) {
+      return this.getRandomValues.apply(this, args);
     }
   };
   dart.setSignature(html$.Crypto, {
@@ -46113,11 +47192,11 @@
     get [dartx.cssRules]() {
       return this.cssRules;
     }
-    [dartx.deleteRule](index) {
-      return this.deleteRule(index);
+    [dartx.deleteRule](...args) {
+      return this.deleteRule.apply(this, args);
     }
-    [dartx.insertRule](rule, index) {
-      return this.insertRule(rule, index);
+    [dartx.insertRule](...args) {
+      return this.insertRule.apply(this, args);
     }
   };
   dart.setSignature(html$.CssGroupingRule, {
@@ -46183,6 +47262,8 @@
     })
   });
   dart.registerExtension(dart.global.CSSKeyframeRule, html$.CssKeyframeRule);
+  dart.registerExtension(dart.global.MozCSSKeyframeRule, html$.CssKeyframeRule);
+  dart.registerExtension(dart.global.WebKitCSSKeyframeRule, html$.CssKeyframeRule);
   dart.defineExtensionNames([
     'appendRule',
     'deleteRule',
@@ -46203,17 +47284,17 @@
     set [dartx.name](value) {
       this.name = value;
     }
-    [__getter__](index) {
-      return this.__getter__(index);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.appendRule](rule) {
-      return this.appendRule(rule);
+    [dartx.appendRule](...args) {
+      return this.appendRule.apply(this, args);
     }
-    [dartx.deleteRule](select) {
-      return this.deleteRule(select);
+    [dartx.deleteRule](...args) {
+      return this.deleteRule.apply(this, args);
     }
-    [dartx.findRule](select) {
-      return this.findRule(select);
+    [dartx.findRule](...args) {
+      return this.findRule.apply(this, args);
     }
   };
   dart.setSignature(html$.CssKeyframesRule, {
@@ -46230,6 +47311,8 @@
     })
   });
   dart.registerExtension(dart.global.CSSKeyframesRule, html$.CssKeyframesRule);
+  dart.registerExtension(dart.global.MozCSSKeyframesRule, html$.CssKeyframesRule);
+  dart.registerExtension(dart.global.WebKitCSSKeyframesRule, html$.CssKeyframesRule);
   dart.defineExtensionNames([
     'media'
   ]);
@@ -50749,17 +51832,17 @@
     get [dartx.parentRule]() {
       return this.parentRule;
     }
-    [dartx.getPropertyPriority](property) {
-      return this.getPropertyPriority(property);
+    [dartx.getPropertyPriority](...args) {
+      return this.getPropertyPriority.apply(this, args);
     }
-    [_getPropertyValue](property) {
-      return this.getPropertyValue(property);
+    [_getPropertyValue](...args) {
+      return this.getPropertyValue.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.removeProperty](property) {
-      return this.removeProperty(property);
+    [dartx.removeProperty](...args) {
+      return this.removeProperty.apply(this, args);
     }
     get [dartx.background]() {
       return this[_background];
@@ -51971,6 +53054,8 @@
     }
   });
   dart.registerExtension(dart.global.CSSStyleDeclaration, html$.CssStyleDeclaration);
+  dart.registerExtension(dart.global.MSStyleCSSProperties, html$.CssStyleDeclaration);
+  dart.registerExtension(dart.global.CSS2Properties, html$.CssStyleDeclaration);
   const _elementIterable = Symbol('_elementIterable');
   const _elementCssStyleDeclarationSetIterable = Symbol('_elementCssStyleDeclarationSetIterable');
   const _setAll = Symbol('_setAll');
@@ -52739,17 +53824,17 @@
     get [dartx.rules]() {
       return this.rules;
     }
-    [dartx.addRule](selector, style, index) {
-      return this.addRule(selector, style, index);
+    [dartx.addRule](...args) {
+      return this.addRule.apply(this, args);
     }
-    [dartx.deleteRule](index) {
-      return this.deleteRule(index);
+    [dartx.deleteRule](...args) {
+      return this.deleteRule.apply(this, args);
     }
-    [dartx.insertRule](rule, index) {
-      return this.insertRule(rule, index);
+    [dartx.insertRule](...args) {
+      return this.insertRule.apply(this, args);
     }
-    [dartx.removeRule](index) {
-      return this.removeRule(index);
+    [dartx.removeRule](...args) {
+      return this.removeRule.apply(this, args);
     }
   };
   dart.setSignature(html$.CssStyleSheet, {
@@ -52783,11 +53868,11 @@
     get [dartx.cssRules]() {
       return this.cssRules;
     }
-    [dartx.deleteRule](index) {
-      return this.deleteRule(index);
+    [dartx.deleteRule](...args) {
+      return this.deleteRule.apply(this, args);
     }
-    [dartx.insertRule](rule, index) {
-      return this.insertRule(rule, index);
+    [dartx.insertRule](...args) {
+      return this.insertRule.apply(this, args);
     }
   };
   dart.setSignature(html$.CssSupportsRule, {
@@ -52877,8 +53962,8 @@
     get [_get__detail]() {
       return this.detail;
     }
-    [_initCustomEvent](type, bubbles, cancelable, detail) {
-      return this.initCustomEvent(type, bubbles, cancelable, detail);
+    [_initCustomEvent](...args) {
+      return this.initCustomEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.CustomEvent, {
@@ -52990,17 +54075,17 @@
     get [dartx.types]() {
       return this.types;
     }
-    [dartx.clearData](format) {
-      return this.clearData(format);
+    [dartx.clearData](...args) {
+      return this.clearData.apply(this, args);
     }
-    [dartx.getData](format) {
-      return this.getData(format);
+    [dartx.getData](...args) {
+      return this.getData.apply(this, args);
     }
-    [dartx.setData](format, data) {
-      return this.setData(format, data);
+    [dartx.setData](...args) {
+      return this.setData.apply(this, args);
     }
-    [dartx.setDragImage](image, x, y) {
-      return this.setDragImage(image, x, y);
+    [dartx.setDragImage](...args) {
+      return this.setDragImage.apply(this, args);
     }
   };
   dart.setSignature(html$.DataTransfer, {
@@ -53038,11 +54123,11 @@
     get [dartx.type]() {
       return this.type;
     }
-    [dartx.getAsFile]() {
-      return this.getAsFile();
+    [dartx.getAsFile](...args) {
+      return this.getAsFile.apply(this, args);
     }
-    [_getAsString](callback) {
-      return this.getAsString(callback);
+    [_getAsString](...args) {
+      return this.getAsString.apply(this, args);
     }
     [dartx.getAsString]() {
       let completer = CompleterOfString().new();
@@ -53051,8 +54136,8 @@
       }, StringTovoid$()));
       return completer.future;
     }
-    [dartx.getAsEntry]() {
-      return this.webkitGetAsEntry();
+    [dartx.getAsEntry](...args) {
+      return this.webkitGetAsEntry.apply(this, args);
     }
   };
   dart.setSignature(html$.DataTransferItem, {
@@ -53076,7 +54161,7 @@
     'clear',
     'item',
     'remove',
-    'get',
+    '_get',
     'length'
   ]);
   html$.DataTransferItemList = class DataTransferItemList extends _interceptors.Interceptor {
@@ -53086,25 +54171,25 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.add](data_OR_file, type) {
-      return this.add(data_OR_file, type);
+    [dartx.add](...args) {
+      return this.add.apply(this, args);
     }
-    [dartx.addData](data, type) {
-      return this.add(data, type);
+    [dartx.addData](...args) {
+      return this.add.apply(this, args);
     }
-    [dartx.addFile](file) {
-      return this.add(file);
+    [dartx.addFile](...args) {
+      return this.add.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.remove](index) {
-      return this.remove(index);
+    [dartx.remove](...args) {
+      return this.remove.apply(this, args);
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       return this[index];
     }
   };
@@ -53118,7 +54203,7 @@
       [dartx.clear]: dart.definiteFunctionType(dart.void, []),
       [dartx.item]: dart.definiteFunctionType(html$.DataTransferItem, [core.int]),
       [dartx.remove]: dart.definiteFunctionType(dart.void, [core.int]),
-      [dartx.get]: dart.definiteFunctionType(html$.DataTransferItem, [core.int])
+      [dartx._get]: dart.definiteFunctionType(html$.DataTransferItem, [core.int])
     })
   });
   dart.registerExtension(dart.global.DataTransferItemList, html$.DataTransferItemList);
@@ -53142,11 +54227,11 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.DedicatedWorkerGlobalScope.messageEvent.forTarget(this);
@@ -53214,11 +54299,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.queryUsageAndQuota](storageType, usageCallback, errorCallback) {
-      return this.queryUsageAndQuota(storageType, usageCallback, errorCallback);
+    [dartx.queryUsageAndQuota](...args) {
+      return this.queryUsageAndQuota.apply(this, args);
     }
-    [dartx.requestQuota](storageType, newQuotaInBytes, quotaCallback, errorCallback) {
-      return this.requestQuota(storageType, newQuotaInBytes, quotaCallback, errorCallback);
+    [dartx.requestQuota](...args) {
+      return this.requestQuota.apply(this, args);
     }
   };
   dart.setSignature(html$.DeprecatedStorageInfo, {
@@ -53243,11 +54328,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.queryUsageAndQuota](usageCallback, errorCallback) {
-      return this.queryUsageAndQuota(usageCallback, errorCallback);
+    [dartx.queryUsageAndQuota](...args) {
+      return this.queryUsageAndQuota.apply(this, args);
     }
-    [dartx.requestQuota](newQuotaInBytes, quotaCallback, errorCallback) {
-      return this.requestQuota(newQuotaInBytes, quotaCallback, errorCallback);
+    [dartx.requestQuota](...args) {
+      return this.requestQuota.apply(this, args);
     }
   };
   dart.setSignature(html$.DeprecatedStorageQuota, {
@@ -53382,8 +54467,8 @@
     get [dartx.rotationRate]() {
       return this.rotationRate;
     }
-    [dartx.initDeviceMotionEvent](type, bubbles, cancelable, acceleration, accelerationIncludingGravity, rotationRate, interval) {
-      return this.initDeviceMotionEvent(type, bubbles, cancelable, acceleration, accelerationIncludingGravity, rotationRate, interval);
+    [dartx.initDeviceMotionEvent](...args) {
+      return this.initDeviceMotionEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.DeviceMotionEvent, {
@@ -53431,8 +54516,8 @@
     get [dartx.gamma]() {
       return this.gamma;
     }
-    [_initDeviceOrientationEvent](type, bubbles, cancelable, alpha, beta, gamma, absolute) {
-      return this.initDeviceOrientationEvent(type, bubbles, cancelable, alpha, beta, gamma, absolute);
+    [_initDeviceOrientationEvent](...args) {
+      return this.initDeviceOrientationEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.DeviceOrientationEvent, {
@@ -53505,14 +54590,14 @@
     set [dartx.returnValue](value) {
       this.returnValue = value;
     }
-    [dartx.close](returnValue) {
-      return this.close(returnValue);
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.show]() {
-      return this.show();
+    [dartx.show](...args) {
+      return this.show.apply(this, args);
     }
-    [dartx.showModal]() {
-      return this.showModal();
+    [dartx.showModal](...args) {
+      return this.showModal.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.DialogElement, 'created');
@@ -53582,8 +54667,8 @@
     get [dartx.name]() {
       return this.name;
     }
-    [_copyTo](parent, opts) {
-      return this.copyTo(parent, opts);
+    [_copyTo](...args) {
+      return this.copyTo.apply(this, args);
     }
     [dartx.copyTo](parent, opts) {
       let name = opts && 'name' in opts ? opts.name : null;
@@ -53595,8 +54680,8 @@
         }, FileErrorTovoid())});
       return completer.future;
     }
-    [_getMetadata](successCallback, errorCallback) {
-      return this.getMetadata(successCallback, errorCallback);
+    [_getMetadata](...args) {
+      return this.getMetadata.apply(this, args);
     }
     [dartx.getMetadata]() {
       let completer = CompleterOfMetadata().new();
@@ -53607,8 +54692,8 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [_getParent](successCallback, errorCallback) {
-      return this.getParent(successCallback, errorCallback);
+    [_getParent](...args) {
+      return this.getParent.apply(this, args);
     }
     [dartx.getParent]() {
       let completer = CompleterOfEntry().new();
@@ -53619,8 +54704,8 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [_moveTo](parent, opts) {
-      return this.moveTo(parent, opts);
+    [_moveTo](...args) {
+      return this.moveTo.apply(this, args);
     }
     [dartx.moveTo](parent, opts) {
       let name = opts && 'name' in opts ? opts.name : null;
@@ -53632,8 +54717,8 @@
         }, FileErrorTovoid())});
       return completer.future;
     }
-    [_remove$](successCallback, errorCallback) {
-      return this.remove(successCallback, errorCallback);
+    [_remove$](...args) {
+      return this.remove.apply(this, args);
     }
     [dartx.remove]() {
       let completer = async.Completer.new();
@@ -53644,8 +54729,8 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [dartx.toUrl]() {
-      return this.toURL();
+    [dartx.toUrl](...args) {
+      return this.toURL.apply(this, args);
     }
   };
   dart.setSignature(html$.Entry, {
@@ -53698,8 +54783,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.createReader]() {
-      return this.createReader();
+    [dartx.createReader](...args) {
+      return this.createReader.apply(this, args);
     }
     [__getDirectory](path, opts) {
       let options = opts && 'options' in opts ? opts.options : null;
@@ -53723,17 +54808,17 @@
       this[__getDirectory_4](path);
       return;
     }
-    [__getDirectory_1](path, options, successCallback, errorCallback) {
-      return this.getDirectory(path, options, successCallback, errorCallback);
+    [__getDirectory_1](...args) {
+      return this.getDirectory.apply(this, args);
     }
-    [__getDirectory_2](path, options, successCallback) {
-      return this.getDirectory(path, options, successCallback);
+    [__getDirectory_2](...args) {
+      return this.getDirectory.apply(this, args);
     }
-    [__getDirectory_3](path, options) {
-      return this.getDirectory(path, options);
+    [__getDirectory_3](...args) {
+      return this.getDirectory.apply(this, args);
     }
-    [__getDirectory_4](path) {
-      return this.getDirectory(path);
+    [__getDirectory_4](...args) {
+      return this.getDirectory.apply(this, args);
     }
     [_getDirectory](path, opts) {
       let options = opts && 'options' in opts ? opts.options : null;
@@ -53767,17 +54852,17 @@
       this[__getFile_4](path);
       return;
     }
-    [__getFile_1](path, options, successCallback, errorCallback) {
-      return this.getFile(path, options, successCallback, errorCallback);
+    [__getFile_1](...args) {
+      return this.getFile.apply(this, args);
     }
-    [__getFile_2](path, options, successCallback) {
-      return this.getFile(path, options, successCallback);
+    [__getFile_2](...args) {
+      return this.getFile.apply(this, args);
     }
-    [__getFile_3](path, options) {
-      return this.getFile(path, options);
+    [__getFile_3](...args) {
+      return this.getFile.apply(this, args);
     }
-    [__getFile_4](path) {
-      return this.getFile(path);
+    [__getFile_4](...args) {
+      return this.getFile.apply(this, args);
     }
     [_getFile](path, opts) {
       let options = opts && 'options' in opts ? opts.options : null;
@@ -53789,8 +54874,8 @@
         }, FileErrorTovoid())});
       return completer.future;
     }
-    [_removeRecursively](successCallback, errorCallback) {
-      return this.removeRecursively(successCallback, errorCallback);
+    [_removeRecursively](...args) {
+      return this.removeRecursively.apply(this, args);
     }
     [dartx.removeRecursively]() {
       let completer = async.Completer.new();
@@ -53835,8 +54920,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [_readEntries](successCallback, errorCallback) {
-      return this.readEntries(successCallback, errorCallback);
+    [_readEntries](...args) {
+      return this.readEntries.apply(this, args);
     }
     [dartx.readEntries]() {
       let completer = CompleterOfListOfEntry().new();
@@ -54133,93 +55218,93 @@
     get [_webkitVisibilityState]() {
       return this.webkitVisibilityState;
     }
-    [dartx.adoptNode](node) {
-      return this.adoptNode(node);
+    [dartx.adoptNode](...args) {
+      return this.adoptNode.apply(this, args);
     }
-    [_caretRangeFromPoint](x, y) {
-      return this.caretRangeFromPoint(x, y);
+    [_caretRangeFromPoint](...args) {
+      return this.caretRangeFromPoint.apply(this, args);
     }
-    [dartx.createDocumentFragment]() {
-      return this.createDocumentFragment();
+    [dartx.createDocumentFragment](...args) {
+      return this.createDocumentFragment.apply(this, args);
     }
-    [_createElement](localName_OR_tagName, typeExtension) {
-      return this.createElement(localName_OR_tagName, typeExtension);
+    [_createElement](...args) {
+      return this.createElement.apply(this, args);
     }
-    [_createElementNS](namespaceURI, qualifiedName, typeExtension) {
-      return this.createElementNS(namespaceURI, qualifiedName, typeExtension);
+    [_createElementNS](...args) {
+      return this.createElementNS.apply(this, args);
     }
-    [_createEvent](eventType) {
-      return this.createEvent(eventType);
+    [_createEvent](...args) {
+      return this.createEvent.apply(this, args);
     }
-    [dartx.createRange]() {
-      return this.createRange();
+    [dartx.createRange](...args) {
+      return this.createRange.apply(this, args);
     }
-    [_createTextNode](data) {
-      return this.createTextNode(data);
+    [_createTextNode](...args) {
+      return this.createTextNode.apply(this, args);
     }
     [_createTouch](window, target, identifier, pageX, pageY, screenX, screenY, radiusX, radiusY, rotationAngle, force) {
       let target_1 = html$._convertDartToNative_EventTarget(target);
       return this[_createTouch_1](window, target_1, identifier, pageX, pageY, screenX, screenY, radiusX, radiusY, rotationAngle, force);
     }
-    [_createTouch_1](window, target, identifier, pageX, pageY, screenX, screenY, radiusX, radiusY, rotationAngle, force) {
-      return this.createTouch(window, target, identifier, pageX, pageY, screenX, screenY, radiusX, radiusY, rotationAngle, force);
+    [_createTouch_1](...args) {
+      return this.createTouch.apply(this, args);
     }
-    [_createTouchList](touches) {
-      return this.createTouchList(touches);
+    [_createTouchList](...args) {
+      return this.createTouchList.apply(this, args);
     }
-    [_elementFromPoint](x, y) {
-      return this.elementFromPoint(x, y);
+    [_elementFromPoint](...args) {
+      return this.elementFromPoint.apply(this, args);
     }
-    [dartx.elementsFromPoint](x, y) {
-      return this.elementsFromPoint(x, y);
+    [dartx.elementsFromPoint](...args) {
+      return this.elementsFromPoint.apply(this, args);
     }
-    [dartx.execCommand](commandId, showUI, value) {
-      return this.execCommand(commandId, showUI, value);
+    [dartx.execCommand](...args) {
+      return this.execCommand.apply(this, args);
     }
-    [dartx.exitFullscreen]() {
-      return this.exitFullscreen();
+    [dartx.exitFullscreen](...args) {
+      return this.exitFullscreen.apply(this, args);
     }
-    [dartx.exitPointerLock]() {
-      return this.exitPointerLock();
+    [dartx.exitPointerLock](...args) {
+      return this.exitPointerLock.apply(this, args);
     }
-    [_getCssCanvasContext](contextId, name, width, height) {
-      return this.getCSSCanvasContext(contextId, name, width, height);
+    [_getCssCanvasContext](...args) {
+      return this.getCSSCanvasContext.apply(this, args);
     }
-    [dartx.getElementsByClassName](classNames) {
-      return this.getElementsByClassName(classNames);
+    [dartx.getElementsByClassName](...args) {
+      return this.getElementsByClassName.apply(this, args);
     }
-    [dartx.getElementsByName](elementName) {
-      return this.getElementsByName(elementName);
+    [dartx.getElementsByName](...args) {
+      return this.getElementsByName.apply(this, args);
     }
-    [dartx.getElementsByTagName](localName) {
-      return this.getElementsByTagName(localName);
+    [dartx.getElementsByTagName](...args) {
+      return this.getElementsByTagName.apply(this, args);
     }
-    [dartx.importNode](node, deep) {
-      return this.importNode(node, deep);
+    [dartx.importNode](...args) {
+      return this.importNode.apply(this, args);
     }
-    [dartx.queryCommandEnabled](commandId) {
-      return this.queryCommandEnabled(commandId);
+    [dartx.queryCommandEnabled](...args) {
+      return this.queryCommandEnabled.apply(this, args);
     }
-    [dartx.queryCommandIndeterm](commandId) {
-      return this.queryCommandIndeterm(commandId);
+    [dartx.queryCommandIndeterm](...args) {
+      return this.queryCommandIndeterm.apply(this, args);
     }
-    [dartx.queryCommandState](commandId) {
-      return this.queryCommandState(commandId);
+    [dartx.queryCommandState](...args) {
+      return this.queryCommandState.apply(this, args);
     }
-    [dartx.queryCommandSupported](commandId) {
-      return this.queryCommandSupported(commandId);
+    [dartx.queryCommandSupported](...args) {
+      return this.queryCommandSupported.apply(this, args);
     }
-    [dartx.queryCommandValue](commandId) {
-      return this.queryCommandValue(commandId);
+    [dartx.queryCommandValue](...args) {
+      return this.queryCommandValue.apply(this, args);
     }
-    [dartx.transformDocumentToTreeView](noStyleMessage) {
-      return this.transformDocumentToTreeView(noStyleMessage);
+    [dartx.transformDocumentToTreeView](...args) {
+      return this.transformDocumentToTreeView.apply(this, args);
     }
-    [_webkitExitFullscreen]() {
-      return this.webkitExitFullscreen();
+    [_webkitExitFullscreen](...args) {
+      return this.webkitExitFullscreen.apply(this, args);
     }
-    [dartx.getElementById](elementId) {
-      return this.getElementById(elementId);
+    [dartx.getElementById](...args) {
+      return this.getElementById.apply(this, args);
     }
     get [_childElementCount]() {
       return this.childElementCount;
@@ -54233,11 +55318,11 @@
     get [_lastElementChild]() {
       return this.lastElementChild;
     }
-    [dartx.querySelector](selectors) {
-      return this.querySelector(selectors);
+    [dartx.querySelector](...args) {
+      return this.querySelector.apply(this, args);
     }
-    [_querySelectorAll](selectors) {
-      return this.querySelectorAll(selectors);
+    [_querySelectorAll](...args) {
+      return this.querySelectorAll.apply(this, args);
     }
     get [dartx.onAbort]() {
       return html$.Element.abortEvent.forTarget(this);
@@ -54772,8 +55857,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getElementById](elementId) {
-      return this.getElementById(elementId);
+    [dartx.getElementById](...args) {
+      return this.getElementById.apply(this, args);
     }
     get [_childElementCount]() {
       return this.childElementCount;
@@ -54784,11 +55869,11 @@
     get [_lastElementChild]() {
       return this.lastElementChild;
     }
-    [dartx.querySelector](selectors) {
-      return this.querySelector(selectors);
+    [dartx.querySelector](...args) {
+      return this.querySelector.apply(this, args);
     }
-    [_querySelectorAll](selectors) {
-      return this.querySelectorAll(selectors);
+    [_querySelectorAll](...args) {
+      return this.querySelectorAll.apply(this, args);
     }
   };
   html$.DocumentFragment[dart.implements] = () => [html$.NonElementParentNode, html$.ParentNode];
@@ -54953,17 +56038,17 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.createDocument](namespaceURI, qualifiedName, doctype) {
-      return this.createDocument(namespaceURI, qualifiedName, doctype);
+    [dartx.createDocument](...args) {
+      return this.createDocument.apply(this, args);
     }
-    [dartx.createDocumentType](qualifiedName, publicId, systemId) {
-      return this.createDocumentType(qualifiedName, publicId, systemId);
+    [dartx.createDocumentType](...args) {
+      return this.createDocumentType.apply(this, args);
     }
-    [dartx.createHtmlDocument](title) {
-      return this.createHTMLDocument(title);
+    [dartx.createHtmlDocument](...args) {
+      return this.createHTMLDocument.apply(this, args);
     }
-    [dartx.hasFeature]() {
-      return this.hasFeature();
+    [dartx.hasFeature](...args) {
+      return this.hasFeature.apply(this, args);
     }
   };
   dart.setSignature(html$.DomImplementation, {
@@ -54983,8 +56068,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.next](value) {
-      return this.next(value);
+    [dartx.next](...args) {
+      return this.next.apply(this, args);
     }
   };
   dart.setSignature(html$.DomIterator, {
@@ -55101,26 +56186,26 @@
     get [dartx.m44]() {
       return this.m44;
     }
-    [dartx.multiply](other) {
-      return this.multiply(other);
+    [dartx.multiply](...args) {
+      return this.multiply.apply(this, args);
     }
-    [dartx.scale](scale, originX, originY) {
-      return this.scale(scale, originX, originY);
+    [dartx.scale](...args) {
+      return this.scale.apply(this, args);
     }
-    [dartx.scale3d](scale, originX, originY, originZ) {
-      return this.scale3d(scale, originX, originY, originZ);
+    [dartx.scale3d](...args) {
+      return this.scale3d.apply(this, args);
     }
-    [dartx.scaleNonUniform](scaleX, scaleY, scaleZn, originX, originY, originZ) {
-      return this.scaleNonUniform(scaleX, scaleY, scaleZn, originX, originY, originZ);
+    [dartx.scaleNonUniform](...args) {
+      return this.scaleNonUniform.apply(this, args);
     }
-    [dartx.toFloat32Array]() {
-      return this.toFloat32Array();
+    [dartx.toFloat32Array](...args) {
+      return this.toFloat32Array.apply(this, args);
     }
-    [dartx.toFloat64Array]() {
-      return this.toFloat64Array();
+    [dartx.toFloat64Array](...args) {
+      return this.toFloat64Array.apply(this, args);
     }
-    [dartx.translate](tx, ty, tz) {
-      return this.translate(tx, ty, tz);
+    [dartx.translate](...args) {
+      return this.translate.apply(this, args);
     }
   };
   dart.setSignature(html$.DomMatrixReadOnly, {
@@ -55366,23 +56451,23 @@
     set [dartx.m44](value) {
       this.m44 = value;
     }
-    [dartx.multiplySelf](other) {
-      return this.multiplySelf(other);
+    [dartx.multiplySelf](...args) {
+      return this.multiplySelf.apply(this, args);
     }
-    [dartx.preMultiplySelf](other) {
-      return this.preMultiplySelf(other);
+    [dartx.preMultiplySelf](...args) {
+      return this.preMultiplySelf.apply(this, args);
     }
-    [dartx.scale3dSelf](scale, originX, originY, originZ) {
-      return this.scale3dSelf(scale, originX, originY, originZ);
+    [dartx.scale3dSelf](...args) {
+      return this.scale3dSelf.apply(this, args);
     }
-    [dartx.scaleNonUniformSelf](scaleX, scaleY, scaleZ, originX, originY, originZ) {
-      return this.scaleNonUniformSelf(scaleX, scaleY, scaleZ, originX, originY, originZ);
+    [dartx.scaleNonUniformSelf](...args) {
+      return this.scaleNonUniformSelf.apply(this, args);
     }
-    [dartx.scaleSelf](scale, originX, originY) {
-      return this.scaleSelf(scale, originX, originY);
+    [dartx.scaleSelf](...args) {
+      return this.scaleSelf.apply(this, args);
     }
-    [dartx.translateSelf](tx, ty, tz) {
-      return this.translateSelf(tx, ty, tz);
+    [dartx.translateSelf](...args) {
+      return this.translateSelf.apply(this, args);
     }
   };
   dart.setSignature(html$.DomMatrix, {
@@ -55442,8 +56527,8 @@
     static _create_1() {
       return new DOMParser();
     }
-    [dartx.parseFromString](str, type) {
-      return this.parseFromString(str, type);
+    [dartx.parseFromString](...args) {
+      return this.parseFromString.apply(this, args);
     }
   };
   dart.setSignature(html$.DomParser, {
@@ -55762,20 +56847,20 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.add](tokens) {
-      return this.add(tokens);
+    [dartx.add](...args) {
+      return this.add.apply(this, args);
     }
-    [dartx.contains](token) {
-      return this.contains(token);
+    [dartx.contains](...args) {
+      return this.contains.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.remove](tokens) {
-      return this.remove(tokens);
+    [dartx.remove](...args) {
+      return this.remove.apply(this, args);
     }
-    [dartx.toggle](token, force) {
-      return this.toggle(token, force);
+    [dartx.toggle](...args) {
+      return this.toggle.apply(this, args);
     }
   };
   dart.setSignature(html$.DomTokenList, {
@@ -55949,8 +57034,8 @@
   html$.ImmutableListMixin = ImmutableListMixin();
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -55965,11 +57050,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.item](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -55998,13 +57083,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__getter__](index) {
-      return this.__getter__(index);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$.DomStringList[dart.implements] = () => [ListOfString()];
@@ -56018,8 +57103,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.String, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, core.String]),
+      [dartx._get]: dart.definiteFunctionType(core.String, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, core.String]),
       [dartx.elementAt]: dart.definiteFunctionType(core.String, [core.int]),
       [__getter__]: dart.definiteFunctionType(core.String, [core.int]),
       [dartx.item]: dart.definiteFunctionType(core.String, [core.int])
@@ -56060,11 +57145,11 @@
     get length() {
       return this[_childElements][dartx.length];
     }
-    get(index) {
-      return html$.Element._check(this[_childElements][dartx.get](index));
+    _get(index) {
+      return html$.Element._check(this[_childElements][dartx._get](index));
     }
-    set(index, value) {
-      this[_element$][_replaceChild](value, this[_childElements][dartx.get](index));
+    _set(index, value) {
+      this[_element$][_replaceChild](value, this[_childElements][dartx._get](index));
       return value;
     }
     set length(newLength) {
@@ -56137,7 +57222,7 @@
       if (index == this.length) {
         this[_element$][dartx.append](element);
       } else {
-        this[_element$][dartx.insertBefore](element, this.get(index));
+        this[_element$][dartx.insertBefore](element, this._get(index));
       }
     }
     setAll(index, iterable) {
@@ -56147,7 +57232,7 @@
       this[_element$][_clearChildren]();
     }
     removeAt(index) {
-      let result = this.get(index);
+      let result = this._get(index);
       if (result != null) {
         this[_element$][_removeChild](result);
       }
@@ -56197,8 +57282,8 @@
     }),
     setters: () => ({length: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      get: dart.definiteFunctionType(html$.Element, [core.int]),
-      set: dart.definiteFunctionType(dart.void, [core.int, html$.Element]),
+      _get: dart.definiteFunctionType(html$.Element, [core.int]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, html$.Element]),
       add: dart.definiteFunctionType(html$.Element, [html$.Element]),
       addAll: dart.definiteFunctionType(dart.void, [IterableOfElement()]),
       sort: dart.definiteFunctionType(dart.void, [], [ElementAndElementToint()]),
@@ -56216,8 +57301,8 @@
   });
   dart.defineExtensionMembers(html$._ChildrenElementList, [
     'contains',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'add',
     'addAll',
     'sort',
@@ -56259,10 +57344,10 @@
       get length() {
         return this[_nodeList][dartx.length];
       }
-      get(index) {
-        return html$._downcast(html$.Node, E)(this[_nodeList][dartx.get](index));
+      _get(index) {
+        return html$._downcast(html$.Node, E)(this[_nodeList][dartx._get](index));
       }
-      set(index, value) {
+      _set(index, value) {
         E._check(value);
         dart.throw(new core.UnsupportedError('Cannot modify list'));
         return value;
@@ -56611,14 +57696,14 @@
         classes: dart.definiteFunctionType(dart.void, [IterableOfString()])
       }),
       methods: () => ({
-        get: dart.definiteFunctionType(E, [core.int]),
-        set: dart.definiteFunctionType(dart.void, [core.int, E]),
+        _get: dart.definiteFunctionType(E, [core.int]),
+        _set: dart.definiteFunctionType(dart.void, [core.int, E]),
         sort: dart.definiteFunctionType(dart.void, [], [ComparatorOfE()])
       })
     });
     dart.defineExtensionMembers(_FrozenElementList, [
-      'get',
-      'set',
+      '_get',
+      '_set',
       'sort',
       'shuffle',
       'length',
@@ -56642,19 +57727,19 @@
     statics: () => ({createElement_tag: dart.definiteFunctionType(dart.dynamic, [core.String, core.String])}),
     names: ['createElement_tag']
   });
-  const _value$0 = Symbol('_value');
+  const _value$1 = Symbol('_value');
   html$.ScrollAlignment = class ScrollAlignment extends core.Object {
     _internal(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
     }
     toString() {
-      return dart.str`ScrollAlignment.${this[_value$0]}`;
+      return dart.str`ScrollAlignment.${this[_value$1]}`;
     }
   };
   dart.defineNamedConstructor(html$.ScrollAlignment, '_internal');
   dart.setSignature(html$.ScrollAlignment, {
     constructors: () => ({_internal: dart.definiteFunctionType(html$.ScrollAlignment, [dart.dynamic])}),
-    fields: () => ({[_value$0]: dart.dynamic}),
+    fields: () => ({[_value$1]: dart.dynamic}),
     sfields: () => ({
       TOP: html$.ScrollAlignment,
       CENTER: html$.ScrollAlignment,
@@ -56728,11 +57813,11 @@
     set [dartx.width](value) {
       this.width = value;
     }
-    [__getter__](index_OR_name) {
-      return this.__getter__(index_OR_name);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [__setter__](index_OR_name, value) {
-      return this.__setter__(index_OR_name, value);
+    [__setter__](...args) {
+      return this.__setter__.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.EmbedElement, 'created');
@@ -56860,8 +57945,8 @@
     get [dartx.withCredentials]() {
       return this.withCredentials;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
     get [dartx.onError]() {
       return html$.EventSource.errorEvent.forTarget(this);
@@ -56924,23 +58009,23 @@
     new(ptr) {
       this[_ptr] = ptr;
     }
-    get(type) {
+    _get(type) {
       return new (_EventStreamOfEvent())(this[_ptr], type, false);
     }
   };
   dart.setSignature(html$.Events, {
     constructors: () => ({new: dart.definiteFunctionType(html$.Events, [html$.EventTarget])}),
     fields: () => ({[_ptr]: html$.EventTarget}),
-    methods: () => ({get: dart.definiteFunctionType(async.Stream, [core.String])})
+    methods: () => ({_get: dart.definiteFunctionType(async.Stream, [core.String])})
   });
   html$.ElementEvents = class ElementEvents extends html$.Events {
     new(ptr) {
       super.new(ptr);
     }
-    get(type) {
+    _get(type) {
       if (dart.test(html$.ElementEvents.webkitEvents[dartx.keys][dartx.contains](type[dartx.toLowerCase]()))) {
         if (dart.test(html_common.Device.isWebKit)) {
-          return new (_ElementEventStreamImplOfEvent())(this[_ptr], html$.ElementEvents.webkitEvents[dartx.get](type[dartx.toLowerCase]()), false);
+          return new (_ElementEventStreamImplOfEvent())(this[_ptr], html$.ElementEvents.webkitEvents[dartx._get](type[dartx.toLowerCase]()), false);
         }
       }
       return new (_ElementEventStreamImplOfEvent())(this[_ptr], type, false);
@@ -56976,8 +58061,8 @@
     static _create_2(type) {
       return new ExtendableEvent(type);
     }
-    [dartx.waitUntil](value) {
-      return this.waitUntil(value);
+    [dartx.waitUntil](...args) {
+      return this.waitUntil.apply(this, args);
     }
   };
   dart.setSignature(html$.ExtendableEvent, {
@@ -57057,8 +58142,8 @@
     get [dartx.request]() {
       return this.request;
     }
-    [dartx.respondWith](value) {
-      return this.respondWith(value);
+    [dartx.respondWith](...args) {
+      return this.respondWith.apply(this, args);
     }
   };
   dart.setSignature(html$.FetchEvent, {
@@ -57139,14 +58224,14 @@
     get [dartx.willValidate]() {
       return this.willValidate;
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.FieldSetElement, 'created');
@@ -57244,8 +58329,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [_createWriter](successCallback, errorCallback) {
-      return this.createWriter(successCallback, errorCallback);
+    [_createWriter](...args) {
+      return this.createWriter.apply(this, args);
     }
     [dartx.createWriter]() {
       let completer = CompleterOfFileWriter().new();
@@ -57256,8 +58341,8 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [_file](successCallback, errorCallback) {
-      return this.file(successCallback, errorCallback);
+    [_file](...args) {
+      return this.file.apply(this, args);
     }
     [dartx.file]() {
       let completer = CompleterOfFile().new();
@@ -57323,8 +58408,8 @@
   dart.registerExtension(dart.global.FileError, html$.FileError);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -57339,11 +58424,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -57372,10 +58457,10 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$.FileList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfFile()];
@@ -57389,8 +58474,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.File, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.File]),
+      [dartx._get]: dart.definiteFunctionType(html$.File, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.File]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.File, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.File, [core.int])
     })
@@ -57434,17 +58519,17 @@
     get [dartx.readyState]() {
       return this.readyState;
     }
-    [dartx.abort]() {
-      return this.abort();
+    [dartx.abort](...args) {
+      return this.abort.apply(this, args);
     }
-    [dartx.readAsArrayBuffer](blob) {
-      return this.readAsArrayBuffer(blob);
+    [dartx.readAsArrayBuffer](...args) {
+      return this.readAsArrayBuffer.apply(this, args);
     }
-    [dartx.readAsDataUrl](blob) {
-      return this.readAsDataURL(blob);
+    [dartx.readAsDataUrl](...args) {
+      return this.readAsDataURL.apply(this, args);
     }
-    [dartx.readAsText](blob, label) {
-      return this.readAsText(blob, label);
+    [dartx.readAsText](...args) {
+      return this.readAsText.apply(this, args);
     }
     get [dartx.onAbort]() {
       return html$.FileReader.abortEvent.forTarget(this);
@@ -57603,17 +58688,17 @@
     get [dartx.readyState]() {
       return this.readyState;
     }
-    [dartx.abort]() {
-      return this.abort();
+    [dartx.abort](...args) {
+      return this.abort.apply(this, args);
     }
-    [dartx.seek](position) {
-      return this.seek(position);
+    [dartx.seek](...args) {
+      return this.seek.apply(this, args);
     }
-    [dartx.truncate](size) {
-      return this.truncate(size);
+    [dartx.truncate](...args) {
+      return this.truncate.apply(this, args);
     }
-    [dartx.write](data) {
-      return this.write(data);
+    [dartx.write](...args) {
+      return this.write.apply(this, args);
     }
     get [dartx.onAbort]() {
       return html$.FileWriter.abortEvent.forTarget(this);
@@ -57814,8 +58899,8 @@
     set [dartx.weight](value) {
       this.weight = value;
     }
-    [dartx.load]() {
-      return this.load();
+    [dartx.load](...args) {
+      return this.load.apply(this, args);
     }
   };
   dart.setSignature(html$.FontFace, {
@@ -57862,23 +58947,23 @@
     get [dartx.status]() {
       return this.status;
     }
-    [dartx.add](fontFace) {
-      return this.add(fontFace);
+    [dartx.add](...args) {
+      return this.add.apply(this, args);
     }
-    [dartx.check](font, text) {
-      return this.check(font, text);
+    [dartx.check](...args) {
+      return this.check.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.delete](fontFace) {
-      return this.delete(fontFace);
+    [dartx.delete](...args) {
+      return this.delete.apply(this, args);
     }
-    [dartx.forEach](callback, thisArg) {
-      return this.forEach(callback, thisArg);
+    [dartx.forEach](...args) {
+      return this.forEach.apply(this, args);
     }
-    [dartx.has](fontFace) {
-      return this.has(fontFace);
+    [dartx.has](...args) {
+      return this.has.apply(this, args);
     }
   };
   dart.setSignature(html$.FontFaceSet, {
@@ -57943,26 +59028,26 @@
     static get supported() {
       return !!window.FormData;
     }
-    [dartx.append](name, value) {
-      return this.append(name, value);
+    [dartx.append](...args) {
+      return this.append.apply(this, args);
     }
-    [dartx.appendBlob](name, value, filename) {
-      return this.append(name, value, filename);
+    [dartx.appendBlob](...args) {
+      return this.append.apply(this, args);
     }
-    [dartx.delete](name) {
-      return this.delete(name);
+    [dartx.delete](...args) {
+      return this.delete.apply(this, args);
     }
-    [dartx.get](name) {
-      return this.get(name);
+    [dartx.get](...args) {
+      return this.get.apply(this, args);
     }
-    [dartx.getAll](name) {
-      return this.getAll(name);
+    [dartx.getAll](...args) {
+      return this.getAll.apply(this, args);
     }
-    [dartx.has](name) {
-      return this.has(name);
+    [dartx.has](...args) {
+      return this.has.apply(this, args);
     }
-    [dartx.set](name, value, filename) {
-      return this.set(name, value, filename);
+    [dartx.set](...args) {
+      return this.set.apply(this, args);
     }
   };
   dart.setSignature(html$.FormData, {
@@ -58083,31 +59168,31 @@
     set [dartx.target](value) {
       this.target = value;
     }
-    [__getter__](name) {
-      return this.__getter__(name);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
     [dartx.requestAutocomplete](details) {
       let details_1 = html_common.convertDartToNative_Dictionary(details);
       this[_requestAutocomplete_1](details_1);
       return;
     }
-    [_requestAutocomplete_1](details) {
-      return this.requestAutocomplete(details);
+    [_requestAutocomplete_1](...args) {
+      return this.requestAutocomplete.apply(this, args);
     }
-    [dartx.reset]() {
-      return this.reset();
+    [dartx.reset](...args) {
+      return this.reset.apply(this, args);
     }
-    [dartx.submit]() {
-      return this.submit();
+    [dartx.submit](...args) {
+      return this.submit.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.FormElement, 'created');
@@ -58260,14 +59345,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getRegisteredRegions]() {
-      return this.getRegisteredRegions();
+    [dartx.getRegisteredRegions](...args) {
+      return this.getRegisteredRegions.apply(this, args);
     }
-    [dartx.registerRegion](region) {
-      return this.registerRegion(region);
+    [dartx.registerRegion](...args) {
+      return this.registerRegion.apply(this, args);
     }
-    [dartx.unregisterRegion](regionId) {
-      return this.unregisterRegion(regionId);
+    [dartx.unregisterRegion](...args) {
+      return this.unregisterRegion.apply(this, args);
     }
   };
   dart.setSignature(html$.Geofencing, {
@@ -58323,13 +59408,13 @@
       let maximumAge = opts && 'maximumAge' in opts ? opts.maximumAge : null;
       let options = dart.map();
       if (enableHighAccuracy != null) {
-        options[dartx.set]('enableHighAccuracy', enableHighAccuracy);
+        options[dartx._set]('enableHighAccuracy', enableHighAccuracy);
       }
       if (timeout != null) {
-        options[dartx.set]('timeout', timeout.inMilliseconds);
+        options[dartx._set]('timeout', timeout.inMilliseconds);
       }
       if (maximumAge != null) {
-        options[dartx.set]('maximumAge', maximumAge.inMilliseconds);
+        options[dartx._set]('maximumAge', maximumAge.inMilliseconds);
       }
       let completer = CompleterOfGeoposition().new();
       try {
@@ -58351,13 +59436,13 @@
       let maximumAge = opts && 'maximumAge' in opts ? opts.maximumAge : null;
       let options = dart.map();
       if (enableHighAccuracy != null) {
-        options[dartx.set]('enableHighAccuracy', enableHighAccuracy);
+        options[dartx._set]('enableHighAccuracy', enableHighAccuracy);
       }
       if (timeout != null) {
-        options[dartx.set]('timeout', timeout.inMilliseconds);
+        options[dartx._set]('timeout', timeout.inMilliseconds);
       }
       if (maximumAge != null) {
-        options[dartx.set]('maximumAge', maximumAge.inMilliseconds);
+        options[dartx._set]('maximumAge', maximumAge.inMilliseconds);
       }
       let watchId = null;
       let controller = null;
@@ -58387,8 +59472,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [_clearWatch](watchID) {
-      return this.clearWatch(watchID);
+    [_clearWatch](...args) {
+      return this.clearWatch.apply(this, args);
     }
     [_getCurrentPosition](successCallback, errorCallback, options) {
       if (errorCallback === void 0) errorCallback = null;
@@ -58405,14 +59490,14 @@
       this[_getCurrentPosition_3](successCallback);
       return;
     }
-    [_getCurrentPosition_1](successCallback, errorCallback, options) {
-      return this.getCurrentPosition(successCallback, errorCallback, options);
+    [_getCurrentPosition_1](...args) {
+      return this.getCurrentPosition.apply(this, args);
     }
-    [_getCurrentPosition_2](successCallback, errorCallback) {
-      return this.getCurrentPosition(successCallback, errorCallback);
+    [_getCurrentPosition_2](...args) {
+      return this.getCurrentPosition.apply(this, args);
     }
-    [_getCurrentPosition_3](successCallback) {
-      return this.getCurrentPosition(successCallback);
+    [_getCurrentPosition_3](...args) {
+      return this.getCurrentPosition.apply(this, args);
     }
     [_watchPosition](successCallback, errorCallback, options) {
       if (errorCallback === void 0) errorCallback = null;
@@ -58426,14 +59511,14 @@
       }
       return this[_watchPosition_3](successCallback);
     }
-    [_watchPosition_1](successCallback, errorCallback, options) {
-      return this.watchPosition(successCallback, errorCallback, options);
+    [_watchPosition_1](...args) {
+      return this.watchPosition.apply(this, args);
     }
-    [_watchPosition_2](successCallback, errorCallback) {
-      return this.watchPosition(successCallback, errorCallback);
+    [_watchPosition_2](...args) {
+      return this.watchPosition.apply(this, args);
     }
-    [_watchPosition_3](successCallback) {
-      return this.watchPosition(successCallback);
+    [_watchPosition_3](...args) {
+      return this.watchPosition.apply(this, args);
     }
   };
   dart.setSignature(html$.Geolocation, {
@@ -59104,8 +60189,8 @@
     get [dartx.oldUrl]() {
       return this.oldURL;
     }
-    [_initHashChangeEvent](type, canBubble, cancelable, oldURL, newURL) {
-      return this.initHashChangeEvent(type, canBubble, cancelable, oldURL, newURL);
+    [_initHashChangeEvent](...args) {
+      return this.initHashChangeEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.HashChangeEvent, {
@@ -59272,14 +60357,14 @@
     get [_get_state]() {
       return this.state;
     }
-    [dartx.back]() {
-      return this.back();
+    [dartx.back](...args) {
+      return this.back.apply(this, args);
     }
-    [dartx.forward]() {
-      return this.forward();
+    [dartx.forward](...args) {
+      return this.forward.apply(this, args);
     }
-    [dartx.go](delta) {
-      return this.go(delta);
+    [dartx.go](...args) {
+      return this.go.apply(this, args);
     }
     [dartx.pushState](data, title, url, options) {
       if (options === void 0) options = null;
@@ -59293,11 +60378,11 @@
       this[_pushState_2](data_1, title, url);
       return;
     }
-    [_pushState_1](data, title, url, options) {
-      return this.pushState(data, title, url, options);
+    [_pushState_1](...args) {
+      return this.pushState.apply(this, args);
     }
-    [_pushState_2](data, title, url) {
-      return this.pushState(data, title, url);
+    [_pushState_2](...args) {
+      return this.pushState.apply(this, args);
     }
     [dartx.replaceState](data, title, url, options) {
       if (options === void 0) options = null;
@@ -59311,11 +60396,11 @@
       this[_replaceState_2](data_1, title, url);
       return;
     }
-    [_replaceState_1](data, title, url, options) {
-      return this.replaceState(data, title, url, options);
+    [_replaceState_1](...args) {
+      return this.replaceState.apply(this, args);
     }
-    [_replaceState_2](data, title, url) {
-      return this.replaceState(data, title, url);
+    [_replaceState_2](...args) {
+      return this.replaceState.apply(this, args);
     }
   };
   html$.History[dart.implements] = () => [html$.HistoryBase];
@@ -59380,11 +60465,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getEyeParameters](whichEye) {
-      return this.getEyeParameters(whichEye);
+    [dartx.getEyeParameters](...args) {
+      return this.getEyeParameters.apply(this, args);
     }
-    [dartx.setFieldOfView](leftFov, rightFov) {
-      return this.setFieldOfView(leftFov, rightFov);
+    [dartx.setFieldOfView](...args) {
+      return this.setFieldOfView.apply(this, args);
     }
   };
   dart.setSignature(html$.HmdvrDevice, {
@@ -59397,8 +60482,8 @@
   dart.registerExtension(dart.global.HMDVRDevice, html$.HmdvrDevice);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -59414,11 +60499,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -59447,13 +60532,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.namedItem](name) {
-      return this.namedItem(name);
+    [dartx.namedItem](...args) {
+      return this.namedItem.apply(this, args);
     }
   };
   html$.HtmlCollection[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfNode()];
@@ -59467,8 +60552,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.Node, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
+      [dartx._get]: dart.definiteFunctionType(html$.Node, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.Node, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.Node, [core.int]),
       [dartx.namedItem]: dart.definiteFunctionType(core.Object, [core.String])
@@ -59619,11 +60704,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.namedItem](name) {
-      return this.namedItem(name);
+    [dartx.namedItem](...args) {
+      return this.namedItem.apply(this, args);
     }
   };
   dart.setSignature(html$.HtmlFormControlsCollection, {
@@ -59655,8 +60740,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [_item](index) {
-      return this.item(index);
+    [_item](...args) {
+      return this.item.apply(this, args);
     }
   };
   dart.setSignature(html$.HtmlOptionsCollection, {
@@ -59902,15 +60987,15 @@
         let key = header[dartx.substring](0, splitIdx)[dartx.toLowerCase]();
         let value = header[dartx.substring](dart.notNull(splitIdx) + 2);
         if (dart.test(headers[dartx.containsKey](key))) {
-          headers[dartx.set](key, dart.str`${headers[dartx.get](key)}, ${value}`);
+          headers[dartx._set](key, dart.str`${headers[dartx._get](key)}, ${value}`);
         } else {
-          headers[dartx.set](key, value);
+          headers[dartx._set](key, value);
         }
       }
       return headers;
     }
-    [dartx.open](method, url, opts) {
-      return this.open(method, url, opts);
+    [dartx.open](...args) {
+      return this.open.apply(this, args);
     }
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
@@ -59966,23 +61051,23 @@
     set [dartx.withCredentials](value) {
       this.withCredentials = value;
     }
-    [dartx.abort]() {
-      return this.abort();
+    [dartx.abort](...args) {
+      return this.abort.apply(this, args);
     }
-    [dartx.getAllResponseHeaders]() {
-      return this.getAllResponseHeaders();
+    [dartx.getAllResponseHeaders](...args) {
+      return this.getAllResponseHeaders.apply(this, args);
     }
-    [dartx.getResponseHeader](name) {
-      return this.getResponseHeader(name);
+    [dartx.getResponseHeader](...args) {
+      return this.getResponseHeader.apply(this, args);
     }
-    [dartx.overrideMimeType](mime) {
-      return this.overrideMimeType(mime);
+    [dartx.overrideMimeType](...args) {
+      return this.overrideMimeType.apply(this, args);
     }
-    [dartx.send](body_OR_data) {
-      return this.send(body_OR_data);
+    [dartx.send](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.setRequestHeader](name, value) {
-      return this.setRequestHeader(name, value);
+    [dartx.setRequestHeader](...args) {
+      return this.setRequestHeader.apply(this, args);
     }
     get [dartx.onReadyStateChange]() {
       return html$.HttpRequest.readyStateChangeEvent.forTarget(this);
@@ -60384,8 +61469,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.inspect](objectId, hints) {
-      return this.inspect(objectId, hints);
+    [dartx.inspect](...args) {
+      return this.inspect.apply(this, args);
     }
   };
   dart.setSignature(html$.InjectedScriptHost, {
@@ -60848,29 +61933,29 @@
     get [dartx.willValidate]() {
       return this.willValidate;
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.select]() {
-      return this.select();
+    [dartx.select](...args) {
+      return this.select.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
-    [dartx.setRangeText](replacement, opts) {
-      return this.setRangeText(replacement, opts);
+    [dartx.setRangeText](...args) {
+      return this.setRangeText.apply(this, args);
     }
-    [dartx.setSelectionRange](start, end, direction) {
-      return this.setSelectionRange(start, end, direction);
+    [dartx.setSelectionRange](...args) {
+      return this.setSelectionRange.apply(this, args);
     }
-    [dartx.stepDown](n) {
-      return this.stepDown(n);
+    [dartx.stepDown](...args) {
+      return this.stepDown.apply(this, args);
     }
-    [dartx.stepUp](n) {
-      return this.stepUp(n);
+    [dartx.stepUp](...args) {
+      return this.stepUp.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.InputElement, 'created');
@@ -60960,14 +62045,56 @@
   ]);
   html$.InputElementBase = class InputElementBase extends core.Object {
     new() {
-      this[dartx.autofocus] = null;
-      this[dartx.disabled] = null;
-      this[dartx.incremental] = null;
-      this[dartx.indeterminate] = null;
-      this[dartx.name] = null;
-      this[dartx.value] = null;
+      this[autofocus] = null;
+      this[disabled] = null;
+      this[incremental] = null;
+      this[indeterminate] = null;
+      this[name] = null;
+      this[value$] = null;
+    }
+    get autofocus() {
+      return this[autofocus];
+    }
+    set autofocus(value) {
+      this[autofocus] = value;
+    }
+    get disabled() {
+      return this[disabled];
+    }
+    set disabled(value) {
+      this[disabled] = value;
+    }
+    get incremental() {
+      return this[incremental];
+    }
+    set incremental(value) {
+      this[incremental] = value;
+    }
+    get indeterminate() {
+      return this[indeterminate];
+    }
+    set indeterminate(value) {
+      this[indeterminate] = value;
+    }
+    get name() {
+      return this[name];
+    }
+    set name(value) {
+      this[name] = value;
+    }
+    get value() {
+      return this[value$];
+    }
+    set value(value) {
+      this[value$] = value;
     }
   };
+  const autofocus = Symbol(html$.InputElementBase.name + "." + 'autofocus'.toString());
+  const disabled = Symbol(html$.InputElementBase.name + "." + 'disabled'.toString());
+  const incremental = Symbol(html$.InputElementBase.name + "." + 'incremental'.toString());
+  const indeterminate = Symbol(html$.InputElementBase.name + "." + 'indeterminate'.toString());
+  const name = Symbol(html$.InputElementBase.name + "." + 'name'.toString());
+  const value$ = Symbol(html$.InputElementBase.name + "." + 'value'.toString());
   html$.InputElementBase[dart.implements] = () => [html$.Element];
   dart.setSignature(html$.InputElementBase, {
     fields: () => ({
@@ -61016,18 +62143,88 @@
   ]);
   html$.TextInputElementBase = class TextInputElementBase extends core.Object {
     new() {
-      this[dartx.autocomplete] = null;
-      this[dartx.maxLength] = null;
-      this[dartx.pattern] = null;
-      this[dartx.placeholder] = null;
-      this[dartx.readOnly] = null;
-      this[dartx.required] = null;
-      this[dartx.size] = null;
-      this[dartx.selectionDirection] = null;
-      this[dartx.selectionEnd] = null;
-      this[dartx.selectionStart] = null;
+      this[autocomplete] = null;
+      this[maxLength] = null;
+      this[pattern] = null;
+      this[placeholder] = null;
+      this[readOnly] = null;
+      this[required] = null;
+      this[size] = null;
+      this[selectionDirection] = null;
+      this[selectionEnd] = null;
+      this[selectionStart] = null;
+    }
+    get autocomplete() {
+      return this[autocomplete];
+    }
+    set autocomplete(value) {
+      this[autocomplete] = value;
+    }
+    get maxLength() {
+      return this[maxLength];
+    }
+    set maxLength(value) {
+      this[maxLength] = value;
+    }
+    get pattern() {
+      return this[pattern];
+    }
+    set pattern(value) {
+      this[pattern] = value;
+    }
+    get placeholder() {
+      return this[placeholder];
+    }
+    set placeholder(value) {
+      this[placeholder] = value;
+    }
+    get readOnly() {
+      return this[readOnly];
+    }
+    set readOnly(value) {
+      this[readOnly] = value;
+    }
+    get required() {
+      return this[required];
+    }
+    set required(value) {
+      this[required] = value;
+    }
+    get size() {
+      return this[size];
+    }
+    set size(value) {
+      this[size] = value;
+    }
+    get selectionDirection() {
+      return this[selectionDirection];
+    }
+    set selectionDirection(value) {
+      this[selectionDirection] = value;
+    }
+    get selectionEnd() {
+      return this[selectionEnd];
+    }
+    set selectionEnd(value) {
+      this[selectionEnd] = value;
+    }
+    get selectionStart() {
+      return this[selectionStart];
+    }
+    set selectionStart(value) {
+      this[selectionStart] = value;
     }
   };
+  const autocomplete = Symbol(html$.TextInputElementBase.name + "." + 'autocomplete'.toString());
+  const maxLength = Symbol(html$.TextInputElementBase.name + "." + 'maxLength'.toString());
+  const pattern = Symbol(html$.TextInputElementBase.name + "." + 'pattern'.toString());
+  const placeholder = Symbol(html$.TextInputElementBase.name + "." + 'placeholder'.toString());
+  const readOnly = Symbol(html$.TextInputElementBase.name + "." + 'readOnly'.toString());
+  const required = Symbol(html$.TextInputElementBase.name + "." + 'required'.toString());
+  const size = Symbol(html$.TextInputElementBase.name + "." + 'size'.toString());
+  const selectionDirection = Symbol(html$.TextInputElementBase.name + "." + 'selectionDirection'.toString());
+  const selectionEnd = Symbol(html$.TextInputElementBase.name + "." + 'selectionEnd'.toString());
+  const selectionStart = Symbol(html$.TextInputElementBase.name + "." + 'selectionStart'.toString());
   html$.TextInputElementBase[dart.implements] = () => [html$.InputElementBase];
   dart.setSignature(html$.TextInputElementBase, {
     fields: () => ({
@@ -61072,10 +62269,17 @@
     static new() {
       return html$.InputElement.new({type: 'search'});
     }
+    get dirName() {
+      return this[dirName];
+    }
+    set dirName(value) {
+      this[dirName] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'search'})[dartx.type] == 'search';
     }
   };
+  const dirName = Symbol(html$.SearchInputElement.name + "." + 'dirName'.toString());
   html$.SearchInputElement[dart.implements] = () => [html$.TextInputElementBase];
   dart.setSignature(html$.SearchInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.SearchInputElement, [])}),
@@ -61090,7 +62294,14 @@
     static new() {
       return html$.InputElement.new({type: 'text'});
     }
+    get dirName() {
+      return this[dirName$];
+    }
+    set dirName(value) {
+      this[dirName$] = value;
+    }
   };
+  const dirName$ = Symbol(html$.TextInputElement.name + "." + 'dirName'.toString());
   html$.TextInputElement[dart.implements] = () => [html$.TextInputElementBase];
   dart.setSignature(html$.TextInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.TextInputElement, [])}),
@@ -61138,10 +62349,73 @@
     static new() {
       return html$.InputElement.new({type: 'email'});
     }
+    get autocomplete() {
+      return this[autocomplete$];
+    }
+    set autocomplete(value) {
+      this[autocomplete$] = value;
+    }
+    get autofocus() {
+      return this[autofocus$];
+    }
+    set autofocus(value) {
+      this[autofocus$] = value;
+    }
+    get maxLength() {
+      return this[maxLength$];
+    }
+    set maxLength(value) {
+      this[maxLength$] = value;
+    }
+    get multiple() {
+      return this[multiple];
+    }
+    set multiple(value) {
+      this[multiple] = value;
+    }
+    get pattern() {
+      return this[pattern$];
+    }
+    set pattern(value) {
+      this[pattern$] = value;
+    }
+    get placeholder() {
+      return this[placeholder$];
+    }
+    set placeholder(value) {
+      this[placeholder$] = value;
+    }
+    get readOnly() {
+      return this[readOnly$];
+    }
+    set readOnly(value) {
+      this[readOnly$] = value;
+    }
+    get required() {
+      return this[required$];
+    }
+    set required(value) {
+      this[required$] = value;
+    }
+    get size() {
+      return this[size$];
+    }
+    set size(value) {
+      this[size$] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'email'})[dartx.type] == 'email';
     }
   };
+  const autocomplete$ = Symbol(html$.EmailInputElement.name + "." + 'autocomplete'.toString());
+  const autofocus$ = Symbol(html$.EmailInputElement.name + "." + 'autofocus'.toString());
+  const maxLength$ = Symbol(html$.EmailInputElement.name + "." + 'maxLength'.toString());
+  const multiple = Symbol(html$.EmailInputElement.name + "." + 'multiple'.toString());
+  const pattern$ = Symbol(html$.EmailInputElement.name + "." + 'pattern'.toString());
+  const placeholder$ = Symbol(html$.EmailInputElement.name + "." + 'placeholder'.toString());
+  const readOnly$ = Symbol(html$.EmailInputElement.name + "." + 'readOnly'.toString());
+  const required$ = Symbol(html$.EmailInputElement.name + "." + 'required'.toString());
+  const size$ = Symbol(html$.EmailInputElement.name + "." + 'size'.toString());
   html$.EmailInputElement[dart.implements] = () => [html$.TextInputElementBase];
   dart.setSignature(html$.EmailInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.EmailInputElement, [])}),
@@ -61195,12 +62469,40 @@
   ]);
   html$.RangeInputElementBase = class RangeInputElementBase extends core.Object {
     new() {
-      this[dartx.max] = null;
-      this[dartx.min] = null;
-      this[dartx.step] = null;
-      this[dartx.valueAsNumber] = null;
+      this[max] = null;
+      this[min] = null;
+      this[step] = null;
+      this[valueAsNumber] = null;
+    }
+    get max() {
+      return this[max];
+    }
+    set max(value) {
+      this[max] = value;
+    }
+    get min() {
+      return this[min];
+    }
+    set min(value) {
+      this[min] = value;
+    }
+    get step() {
+      return this[step];
+    }
+    set step(value) {
+      this[step] = value;
+    }
+    get valueAsNumber() {
+      return this[valueAsNumber];
+    }
+    set valueAsNumber(value) {
+      this[valueAsNumber] = value;
     }
   };
+  const max = Symbol(html$.RangeInputElementBase.name + "." + 'max'.toString());
+  const min = Symbol(html$.RangeInputElementBase.name + "." + 'min'.toString());
+  const step = Symbol(html$.RangeInputElementBase.name + "." + 'step'.toString());
+  const valueAsNumber = Symbol(html$.RangeInputElementBase.name + "." + 'valueAsNumber'.toString());
   html$.RangeInputElementBase[dart.implements] = () => [html$.InputElementBase];
   dart.setSignature(html$.RangeInputElementBase, {
     fields: () => ({
@@ -61229,10 +62531,31 @@
     static new() {
       return html$.InputElement.new({type: 'date'});
     }
+    get valueAsDate() {
+      return this[valueAsDate];
+    }
+    set valueAsDate(value) {
+      this[valueAsDate] = value;
+    }
+    get readOnly() {
+      return this[readOnly$0];
+    }
+    set readOnly(value) {
+      this[readOnly$0] = value;
+    }
+    get required() {
+      return this[required$0];
+    }
+    set required(value) {
+      this[required$0] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'date'})[dartx.type] == 'date';
     }
   };
+  const valueAsDate = Symbol(html$.DateInputElement.name + "." + 'valueAsDate'.toString());
+  const readOnly$0 = Symbol(html$.DateInputElement.name + "." + 'readOnly'.toString());
+  const required$0 = Symbol(html$.DateInputElement.name + "." + 'required'.toString());
   html$.DateInputElement[dart.implements] = () => [html$.RangeInputElementBase];
   dart.setSignature(html$.DateInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.DateInputElement, [])}),
@@ -61260,10 +62583,31 @@
     static new() {
       return html$.InputElement.new({type: 'month'});
     }
+    get valueAsDate() {
+      return this[valueAsDate$];
+    }
+    set valueAsDate(value) {
+      this[valueAsDate$] = value;
+    }
+    get readOnly() {
+      return this[readOnly$1];
+    }
+    set readOnly(value) {
+      this[readOnly$1] = value;
+    }
+    get required() {
+      return this[required$1];
+    }
+    set required(value) {
+      this[required$1] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'month'})[dartx.type] == 'month';
     }
   };
+  const valueAsDate$ = Symbol(html$.MonthInputElement.name + "." + 'valueAsDate'.toString());
+  const readOnly$1 = Symbol(html$.MonthInputElement.name + "." + 'readOnly'.toString());
+  const required$1 = Symbol(html$.MonthInputElement.name + "." + 'required'.toString());
   html$.MonthInputElement[dart.implements] = () => [html$.RangeInputElementBase];
   dart.setSignature(html$.MonthInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.MonthInputElement, [])}),
@@ -61291,10 +62635,31 @@
     static new() {
       return html$.InputElement.new({type: 'week'});
     }
+    get valueAsDate() {
+      return this[valueAsDate$0];
+    }
+    set valueAsDate(value) {
+      this[valueAsDate$0] = value;
+    }
+    get readOnly() {
+      return this[readOnly$2];
+    }
+    set readOnly(value) {
+      this[readOnly$2] = value;
+    }
+    get required() {
+      return this[required$2];
+    }
+    set required(value) {
+      this[required$2] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'week'})[dartx.type] == 'week';
     }
   };
+  const valueAsDate$0 = Symbol(html$.WeekInputElement.name + "." + 'valueAsDate'.toString());
+  const readOnly$2 = Symbol(html$.WeekInputElement.name + "." + 'readOnly'.toString());
+  const required$2 = Symbol(html$.WeekInputElement.name + "." + 'required'.toString());
   html$.WeekInputElement[dart.implements] = () => [html$.RangeInputElementBase];
   dart.setSignature(html$.WeekInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.WeekInputElement, [])}),
@@ -61322,10 +62687,31 @@
     static new() {
       return html$.InputElement.new({type: 'time'});
     }
+    get valueAsDate() {
+      return this[valueAsDate$1];
+    }
+    set valueAsDate(value) {
+      this[valueAsDate$1] = value;
+    }
+    get readOnly() {
+      return this[readOnly$3];
+    }
+    set readOnly(value) {
+      this[readOnly$3] = value;
+    }
+    get required() {
+      return this[required$3];
+    }
+    set required(value) {
+      this[required$3] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'time'})[dartx.type] == 'time';
     }
   };
+  const valueAsDate$1 = Symbol(html$.TimeInputElement.name + "." + 'valueAsDate'.toString());
+  const readOnly$3 = Symbol(html$.TimeInputElement.name + "." + 'readOnly'.toString());
+  const required$3 = Symbol(html$.TimeInputElement.name + "." + 'required'.toString());
   html$.TimeInputElement[dart.implements] = () => [html$.RangeInputElementBase];
   dart.setSignature(html$.TimeInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.TimeInputElement, [])}),
@@ -61352,10 +62738,24 @@
     static new() {
       return html$.InputElement.new({type: 'datetime-local'});
     }
+    get readOnly() {
+      return this[readOnly$4];
+    }
+    set readOnly(value) {
+      this[readOnly$4] = value;
+    }
+    get required() {
+      return this[required$4];
+    }
+    set required(value) {
+      this[required$4] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'datetime-local'})[dartx.type] == 'datetime-local';
     }
   };
+  const readOnly$4 = Symbol(html$.LocalDateTimeInputElement.name + "." + 'readOnly'.toString());
+  const required$4 = Symbol(html$.LocalDateTimeInputElement.name + "." + 'required'.toString());
   html$.LocalDateTimeInputElement[dart.implements] = () => [html$.RangeInputElementBase];
   dart.setSignature(html$.LocalDateTimeInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.LocalDateTimeInputElement, [])}),
@@ -61375,10 +62775,31 @@
     static new() {
       return html$.InputElement.new({type: 'number'});
     }
+    get placeholder() {
+      return this[placeholder$0];
+    }
+    set placeholder(value) {
+      this[placeholder$0] = value;
+    }
+    get readOnly() {
+      return this[readOnly$5];
+    }
+    set readOnly(value) {
+      this[readOnly$5] = value;
+    }
+    get required() {
+      return this[required$5];
+    }
+    set required(value) {
+      this[required$5] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'number'})[dartx.type] == 'number';
     }
   };
+  const placeholder$0 = Symbol(html$.NumberInputElement.name + "." + 'placeholder'.toString());
+  const readOnly$5 = Symbol(html$.NumberInputElement.name + "." + 'readOnly'.toString());
+  const required$5 = Symbol(html$.NumberInputElement.name + "." + 'required'.toString());
   html$.NumberInputElement[dart.implements] = () => [html$.RangeInputElementBase];
   dart.setSignature(html$.NumberInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.NumberInputElement, [])}),
@@ -61418,7 +62839,21 @@
     static new() {
       return html$.InputElement.new({type: 'checkbox'});
     }
+    get checked() {
+      return this[checked];
+    }
+    set checked(value) {
+      this[checked] = value;
+    }
+    get required() {
+      return this[required$6];
+    }
+    set required(value) {
+      this[required$6] = value;
+    }
   };
+  const checked = Symbol(html$.CheckboxInputElement.name + "." + 'checked'.toString());
+  const required$6 = Symbol(html$.CheckboxInputElement.name + "." + 'required'.toString());
   html$.CheckboxInputElement[dart.implements] = () => [html$.InputElementBase];
   dart.setSignature(html$.CheckboxInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.CheckboxInputElement, [])}),
@@ -61436,7 +62871,21 @@
     static new() {
       return html$.InputElement.new({type: 'radio'});
     }
+    get checked() {
+      return this[checked$];
+    }
+    set checked(value) {
+      this[checked$] = value;
+    }
+    get required() {
+      return this[required$7];
+    }
+    set required(value) {
+      this[required$7] = value;
+    }
   };
+  const checked$ = Symbol(html$.RadioButtonInputElement.name + "." + 'checked'.toString());
+  const required$7 = Symbol(html$.RadioButtonInputElement.name + "." + 'required'.toString());
   html$.RadioButtonInputElement[dart.implements] = () => [html$.InputElementBase];
   dart.setSignature(html$.RadioButtonInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.RadioButtonInputElement, [])}),
@@ -61456,7 +62905,35 @@
     static new() {
       return html$.InputElement.new({type: 'file'});
     }
+    get accept() {
+      return this[accept];
+    }
+    set accept(value) {
+      this[accept] = value;
+    }
+    get multiple() {
+      return this[multiple$];
+    }
+    set multiple(value) {
+      this[multiple$] = value;
+    }
+    get required() {
+      return this[required$8];
+    }
+    set required(value) {
+      this[required$8] = value;
+    }
+    get files() {
+      return this[files];
+    }
+    set files(value) {
+      this[files] = value;
+    }
   };
+  const accept = Symbol(html$.FileUploadInputElement.name + "." + 'accept'.toString());
+  const multiple$ = Symbol(html$.FileUploadInputElement.name + "." + 'multiple'.toString());
+  const required$8 = Symbol(html$.FileUploadInputElement.name + "." + 'required'.toString());
+  const files = Symbol(html$.FileUploadInputElement.name + "." + 'files'.toString());
   html$.FileUploadInputElement[dart.implements] = () => [html$.InputElementBase];
   dart.setSignature(html$.FileUploadInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.FileUploadInputElement, [])}),
@@ -61488,7 +62965,42 @@
     static new() {
       return html$.InputElement.new({type: 'submit'});
     }
+    get formAction() {
+      return this[formAction];
+    }
+    set formAction(value) {
+      this[formAction] = value;
+    }
+    get formEnctype() {
+      return this[formEnctype];
+    }
+    set formEnctype(value) {
+      this[formEnctype] = value;
+    }
+    get formMethod() {
+      return this[formMethod];
+    }
+    set formMethod(value) {
+      this[formMethod] = value;
+    }
+    get formNoValidate() {
+      return this[formNoValidate];
+    }
+    set formNoValidate(value) {
+      this[formNoValidate] = value;
+    }
+    get formTarget() {
+      return this[formTarget];
+    }
+    set formTarget(value) {
+      this[formTarget] = value;
+    }
   };
+  const formAction = Symbol(html$.SubmitButtonInputElement.name + "." + 'formAction'.toString());
+  const formEnctype = Symbol(html$.SubmitButtonInputElement.name + "." + 'formEnctype'.toString());
+  const formMethod = Symbol(html$.SubmitButtonInputElement.name + "." + 'formMethod'.toString());
+  const formNoValidate = Symbol(html$.SubmitButtonInputElement.name + "." + 'formNoValidate'.toString());
+  const formTarget = Symbol(html$.SubmitButtonInputElement.name + "." + 'formTarget'.toString());
   html$.SubmitButtonInputElement[dart.implements] = () => [html$.InputElementBase];
   dart.setSignature(html$.SubmitButtonInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.SubmitButtonInputElement, [])}),
@@ -61527,7 +63039,70 @@
     static new() {
       return html$.InputElement.new({type: 'image'});
     }
+    get alt() {
+      return this[alt];
+    }
+    set alt(value) {
+      this[alt] = value;
+    }
+    get formAction() {
+      return this[formAction$];
+    }
+    set formAction(value) {
+      this[formAction$] = value;
+    }
+    get formEnctype() {
+      return this[formEnctype$];
+    }
+    set formEnctype(value) {
+      this[formEnctype$] = value;
+    }
+    get formMethod() {
+      return this[formMethod$];
+    }
+    set formMethod(value) {
+      this[formMethod$] = value;
+    }
+    get formNoValidate() {
+      return this[formNoValidate$];
+    }
+    set formNoValidate(value) {
+      this[formNoValidate$] = value;
+    }
+    get formTarget() {
+      return this[formTarget$];
+    }
+    set formTarget(value) {
+      this[formTarget$] = value;
+    }
+    get height() {
+      return this[height];
+    }
+    set height(value) {
+      this[height] = value;
+    }
+    get src() {
+      return this[src];
+    }
+    set src(value) {
+      this[src] = value;
+    }
+    get width() {
+      return this[width];
+    }
+    set width(value) {
+      this[width] = value;
+    }
   };
+  const alt = Symbol(html$.ImageButtonInputElement.name + "." + 'alt'.toString());
+  const formAction$ = Symbol(html$.ImageButtonInputElement.name + "." + 'formAction'.toString());
+  const formEnctype$ = Symbol(html$.ImageButtonInputElement.name + "." + 'formEnctype'.toString());
+  const formMethod$ = Symbol(html$.ImageButtonInputElement.name + "." + 'formMethod'.toString());
+  const formNoValidate$ = Symbol(html$.ImageButtonInputElement.name + "." + 'formNoValidate'.toString());
+  const formTarget$ = Symbol(html$.ImageButtonInputElement.name + "." + 'formTarget'.toString());
+  const height = Symbol(html$.ImageButtonInputElement.name + "." + 'height'.toString());
+  const src = Symbol(html$.ImageButtonInputElement.name + "." + 'src'.toString());
+  const width = Symbol(html$.ImageButtonInputElement.name + "." + 'width'.toString());
   html$.ImageButtonInputElement[dart.implements] = () => [html$.InputElementBase];
   dart.setSignature(html$.ImageButtonInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.ImageButtonInputElement, [])}),
@@ -61675,8 +63250,8 @@
     get [dartx.shiftKey]() {
       return this.shiftKey;
     }
-    [dartx.getModifierState](keyArg) {
-      return this.getModifierState(keyArg);
+    [dartx.getModifierState](...args) {
+      return this.getModifierState.apply(this, args);
     }
   };
   dart.setSignature(html$.KeyboardEvent, {
@@ -61851,14 +63426,14 @@
     get [dartx.willValidate]() {
       return this.willValidate;
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.KeygenElement, 'created');
@@ -62183,14 +63758,14 @@
     set [dartx.search](value) {
       this.search = value;
     }
-    [dartx.assign](url) {
-      return this.assign(url);
+    [dartx.assign](...args) {
+      return this.assign.apply(this, args);
     }
-    [dartx.reload]() {
-      return this.reload();
+    [dartx.reload](...args) {
+      return this.reload.apply(this, args);
     }
-    [dartx.replace](url) {
-      return this.replace(url);
+    [dartx.replace](...args) {
+      return this.replace.apply(this, args);
     }
     get [dartx.origin]() {
       if ("origin" in this) {
@@ -62337,14 +63912,14 @@
     set [dartx.volume](value) {
       this.volume = value;
     }
-    [dartx.pause]() {
-      return this.pause();
+    [dartx.pause](...args) {
+      return this.pause.apply(this, args);
     }
-    [dartx.play]() {
-      return this.play();
+    [dartx.play](...args) {
+      return this.play.apply(this, args);
     }
-    [dartx.unpause]() {
-      return this.unpause();
+    [dartx.unpause](...args) {
+      return this.unpause.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaController, {
@@ -62416,15 +63991,15 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.enumerateDevices]() {
-      return this.enumerateDevices();
+    [dartx.enumerateDevices](...args) {
+      return this.enumerateDevices.apply(this, args);
     }
     [dartx.getUserMedia](options) {
       let options_1 = html_common.convertDartToNative_Dictionary(options);
       return this[_getUserMedia_1](options_1);
     }
-    [_getUserMedia_1](options) {
-      return this.getUserMedia(options);
+    [_getUserMedia_1](...args) {
+      return this.getUserMedia.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaDevices, {
@@ -62686,20 +64261,20 @@
     get [dartx.sessionId]() {
       return this.sessionId;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.generateRequest](initDataType, initData) {
-      return this.generateRequest(initDataType, initData);
+    [dartx.generateRequest](...args) {
+      return this.generateRequest.apply(this, args);
     }
-    [dartx.load](sessionId) {
-      return this.load(sessionId);
+    [dartx.load](...args) {
+      return this.load.apply(this, args);
     }
-    [dartx.remove]() {
-      return this.remove();
+    [dartx.remove](...args) {
+      return this.remove.apply(this, args);
     }
-    [_update$](response) {
-      return this.update(response);
+    [_update$](...args) {
+      return this.update.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaKeySession, {
@@ -62748,14 +64323,14 @@
     get [dartx.keySystem]() {
       return this.keySystem;
     }
-    [dartx.createMediaKeys]() {
-      return this.createMediaKeys();
+    [dartx.createMediaKeys](...args) {
+      return this.createMediaKeys.apply(this, args);
     }
     [dartx.getConfiguration]() {
       return html_common.convertNativeToDart_Dictionary(this[_getConfiguration_1]());
     }
-    [_getConfiguration_1]() {
-      return this.getConfiguration();
+    [_getConfiguration_1](...args) {
+      return this.getConfiguration.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaKeySystemAccess, {
@@ -62776,11 +64351,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [_createSession](sessionType) {
-      return this.createSession(sessionType);
+    [_createSession](...args) {
+      return this.createSession.apply(this, args);
     }
-    [dartx.setServerCertificate](serverCertificate) {
-      return this.setServerCertificate(serverCertificate);
+    [dartx.setServerCertificate](...args) {
+      return this.setServerCertificate.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaKeys, {
@@ -62811,14 +64386,14 @@
     set [dartx.mediaText](value) {
       this.mediaText = value;
     }
-    [dartx.appendMedium](medium) {
-      return this.appendMedium(medium);
+    [dartx.appendMedium](...args) {
+      return this.appendMedium.apply(this, args);
     }
-    [dartx.deleteMedium](medium) {
-      return this.deleteMedium(medium);
+    [dartx.deleteMedium](...args) {
+      return this.deleteMedium.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaList, {
@@ -62851,11 +64426,11 @@
     get [dartx.media]() {
       return this.media;
     }
-    [dartx.addListener](listener) {
-      return this.addListener(listener);
+    [dartx.addListener](...args) {
+      return this.addListener.apply(this, args);
     }
-    [dartx.removeListener](listener) {
-      return this.removeListener(listener);
+    [dartx.removeListener](...args) {
+      return this.removeListener.apply(this, args);
     }
     get [dartx.onChange]() {
       return html$.MediaQueryList.changeEvent.forTarget(this);
@@ -62939,11 +64514,11 @@
     static _create_1() {
       return new MediaSession();
     }
-    [dartx.activate]() {
-      return this.activate();
+    [dartx.activate](...args) {
+      return this.activate.apply(this, args);
     }
-    [dartx.deactivate]() {
-      return this.deactivate();
+    [dartx.deactivate](...args) {
+      return this.deactivate.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaSession, {
@@ -62996,14 +64571,14 @@
     get [dartx.sourceBuffers]() {
       return this.sourceBuffers;
     }
-    [dartx.addSourceBuffer](type) {
-      return this.addSourceBuffer(type);
+    [dartx.addSourceBuffer](...args) {
+      return this.addSourceBuffer.apply(this, args);
     }
-    [dartx.endOfStream](error) {
-      return this.endOfStream(error);
+    [dartx.endOfStream](...args) {
+      return this.endOfStream.apply(this, args);
     }
-    [dartx.removeSourceBuffer](buffer) {
-      return this.removeSourceBuffer(buffer);
+    [dartx.removeSourceBuffer](...args) {
+      return this.removeSourceBuffer.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaSource, {
@@ -63085,29 +64660,29 @@
     get [dartx.label]() {
       return this.label;
     }
-    [dartx.addTrack](track) {
-      return this.addTrack(track);
+    [dartx.addTrack](...args) {
+      return this.addTrack.apply(this, args);
     }
-    [dartx.clone]() {
-      return this.clone();
+    [dartx.clone](...args) {
+      return this.clone.apply(this, args);
     }
-    [dartx.getAudioTracks]() {
-      return this.getAudioTracks();
+    [dartx.getAudioTracks](...args) {
+      return this.getAudioTracks.apply(this, args);
     }
-    [dartx.getTrackById](trackId) {
-      return this.getTrackById(trackId);
+    [dartx.getTrackById](...args) {
+      return this.getTrackById.apply(this, args);
     }
-    [dartx.getTracks]() {
-      return this.getTracks();
+    [dartx.getTracks](...args) {
+      return this.getTracks.apply(this, args);
     }
-    [dartx.getVideoTracks]() {
-      return this.getVideoTracks();
+    [dartx.getVideoTracks](...args) {
+      return this.getVideoTracks.apply(this, args);
     }
-    [dartx.removeTrack](track) {
-      return this.removeTrack(track);
+    [dartx.removeTrack](...args) {
+      return this.removeTrack.apply(this, args);
     }
-    [dartx.stop]() {
-      return this.stop();
+    [dartx.stop](...args) {
+      return this.stop.apply(this, args);
     }
     get [dartx.onAddTrack]() {
       return html$.MediaStream.addTrackEvent.forTarget(this);
@@ -63253,8 +64828,8 @@
     get [dartx.readyState]() {
       return this.readyState;
     }
-    [dartx.clone]() {
-      return this.clone();
+    [dartx.clone](...args) {
+      return this.clone.apply(this, args);
     }
     static getSources() {
       let completer = CompleterOfListOfSourceInfo().new();
@@ -63263,8 +64838,8 @@
       }, ListOfSourceInfoTovoid()));
       return completer.future;
     }
-    [dartx.stop]() {
-      return this.stop();
+    [dartx.stop](...args) {
+      return this.stop.apply(this, args);
     }
     get [dartx.onEnded]() {
       return html$.MediaStreamTrack.endedEvent.forTarget(this);
@@ -63575,8 +65150,8 @@
     get [_get_source]() {
       return this.source;
     }
-    [_initMessageEvent](typeArg, canBubbleArg, cancelableArg, dataArg, originArg, lastEventIdArg, sourceArg, portsArg) {
-      return this.initMessageEvent(typeArg, canBubbleArg, cancelableArg, dataArg, originArg, lastEventIdArg, sourceArg, portsArg);
+    [_initMessageEvent](...args) {
+      return this.initMessageEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.MessageEvent, {
@@ -63612,8 +65187,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
     [dartx.postMessage](message, transfer) {
       if (transfer === void 0) transfer = null;
@@ -63626,14 +65201,14 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [dartx.start]() {
-      return this.start();
+    [dartx.start](...args) {
+      return this.start.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.MessagePort.messageEvent.forTarget(this);
@@ -63927,11 +65502,11 @@
     get [dartx.version]() {
       return this.version;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.open]() {
-      return this.open();
+    [dartx.open](...args) {
+      return this.open.apply(this, args);
     }
   };
   dart.setSignature(html$.MidiPort, {
@@ -64041,8 +65616,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.send](data, timestamp) {
-      return this.send(data, timestamp);
+    [dartx.send](...args) {
+      return this.send.apply(this, args);
     }
   };
   dart.setSignature(html$.MidiOutput, {
@@ -64101,8 +65676,8 @@
   dart.registerExtension(dart.global.MimeType, html$.MimeType);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -64118,11 +65693,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -64151,13 +65726,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.namedItem](name) {
-      return this.namedItem(name);
+    [dartx.namedItem](...args) {
+      return this.namedItem.apply(this, args);
     }
   };
   html$.MimeTypeArray[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfMimeType()];
@@ -64171,8 +65746,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.MimeType, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.MimeType]),
+      [dartx._get]: dart.definiteFunctionType(html$.MimeType, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.MimeType]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.MimeType, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.MimeType, [core.int]),
       [dartx.namedItem]: dart.definiteFunctionType(html$.MimeType, [core.String])
@@ -64364,8 +65939,8 @@
       this[_initMouseEvent_1](type, bubbles, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget_1);
       return;
     }
-    [_initMouseEvent_1](type, bubbles, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget) {
-      return this.initMouseEvent(type, bubbles, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget);
+    [_initMouseEvent_1](...args) {
+      return this.initMouseEvent.apply(this, args);
     }
     get [dartx.client]() {
       return new (PointOfnum())(this[_clientX], this[_clientY]);
@@ -64447,6 +66022,7 @@
     names: ['_create_1', '_create_2']
   });
   dart.registerExtension(dart.global.MouseEvent, html$.MouseEvent);
+  dart.registerExtension(dart.global.DragEvent, html$.MouseEvent);
   html$.MutationCallback = dart.typedef('MutationCallback', () => dart.functionType(dart.void, [ListOfMutationRecord(), html$.MutationObserver]));
   const _observe_1 = Symbol('_observe_1');
   const _observe = Symbol('_observe');
@@ -64457,19 +66033,19 @@
     'observe'
   ]);
   html$.MutationObserver = class MutationObserver extends _interceptors.Interceptor {
-    [dartx.disconnect]() {
-      return this.disconnect();
+    [dartx.disconnect](...args) {
+      return this.disconnect.apply(this, args);
     }
     [_observe](target, options) {
       let options_1 = html_common.convertDartToNative_Dictionary(options);
       this[_observe_1](target, options_1);
       return;
     }
-    [_observe_1](target, options) {
-      return this.observe(target, options);
+    [_observe_1](...args) {
+      return this.observe.apply(this, args);
     }
-    [dartx.takeRecords]() {
-      return this.takeRecords();
+    [dartx.takeRecords](...args) {
+      return this.takeRecords.apply(this, args);
     }
     static get supported() {
       return !!(window.MutationObserver || window.WebKitMutationObserver);
@@ -64507,8 +66083,8 @@
     static _fixupList(list) {
       return list;
     }
-    [_call](target, options) {
-      return this.observe(target, options);
+    [_call](...args) {
+      return this.observe.apply(this, args);
     }
     static new(callback) {
       0;
@@ -64536,6 +66112,7 @@
   });
   html$.MutationObserver._boolKeys = dart.const(dart.map({childList: true, attributes: true, characterData: true, subtree: true, attributeOldValue: true, characterDataOldValue: true}, core.String, core.bool));
   dart.registerExtension(dart.global.MutationObserver, html$.MutationObserver);
+  dart.registerExtension(dart.global.WebKitMutationObserver, html$.MutationObserver);
   dart.defineExtensionNames([
     'addedNodes',
     'attributeName',
@@ -64661,8 +66238,8 @@
         this.getUserMedia = this.getUserMedia || this.webkitGetUserMedia || this.mozGetUserMedia || this.msGetUserMedia;
       }
     }
-    [_getUserMedia](options, success, error) {
-      return this.getUserMedia(options, success, error);
+    [_getUserMedia](...args) {
+      return this.getUserMedia.apply(this, args);
     }
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
@@ -64721,17 +66298,17 @@
     get [dartx.temporaryStorage]() {
       return this.webkitTemporaryStorage;
     }
-    [dartx.getBattery]() {
-      return this.getBattery();
+    [dartx.getBattery](...args) {
+      return this.getBattery.apply(this, args);
     }
-    [dartx.getGamepads]() {
-      return this.getGamepads();
+    [dartx.getGamepads](...args) {
+      return this.getGamepads.apply(this, args);
     }
-    [dartx.getVRDevices]() {
-      return this.getVRDevices();
+    [dartx.getVRDevices](...args) {
+      return this.getVRDevices.apply(this, args);
     }
-    [dartx.registerProtocolHandler](scheme, url, title) {
-      return this.registerProtocolHandler(scheme, url, title);
+    [dartx.registerProtocolHandler](...args) {
+      return this.registerProtocolHandler.apply(this, args);
     }
     [dartx.requestMidiAccess](options) {
       if (options === void 0) options = null;
@@ -64741,17 +66318,17 @@
       }
       return this[_requestMidiAccess_2]();
     }
-    [_requestMidiAccess_1](options) {
-      return this.requestMIDIAccess(options);
+    [_requestMidiAccess_1](...args) {
+      return this.requestMIDIAccess.apply(this, args);
     }
-    [_requestMidiAccess_2]() {
-      return this.requestMIDIAccess();
+    [_requestMidiAccess_2](...args) {
+      return this.requestMIDIAccess.apply(this, args);
     }
-    [dartx.requestMediaKeySystemAccess](keySystem, supportedConfigurations) {
-      return this.requestMediaKeySystemAccess(keySystem, supportedConfigurations);
+    [dartx.requestMediaKeySystemAccess](...args) {
+      return this.requestMediaKeySystemAccess.apply(this, args);
     }
-    [dartx.sendBeacon](url, data) {
-      return this.sendBeacon(url, data);
+    [dartx.sendBeacon](...args) {
+      return this.sendBeacon.apply(this, args);
     }
     get [dartx.hardwareConcurrency]() {
       return this.hardwareConcurrency;
@@ -64786,8 +66363,8 @@
     get [dartx.cookieEnabled]() {
       return this.cookieEnabled;
     }
-    [dartx.getStorageUpdates]() {
-      return this.getStorageUpdates();
+    [dartx.getStorageUpdates](...args) {
+      return this.getStorageUpdates.apply(this, args);
     }
   };
   html$.Navigator[dart.implements] = () => [html$.NavigatorStorageUtils, html$.NavigatorCpu, html$.NavigatorLanguage, html$.NavigatorOnLine, html$.NavigatorID];
@@ -64849,7 +66426,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get hardwareConcurrency() {
+      return this[hardwareConcurrency];
+    }
+    set hardwareConcurrency(value) {
+      super.hardwareConcurrency = value;
+    }
   };
+  const hardwareConcurrency = Symbol(html$.NavigatorCpu.name + "." + 'hardwareConcurrency'.toString());
   dart.setSignature(html$.NavigatorCpu, {
     constructors: () => ({_: dart.definiteFunctionType(html$.NavigatorCpu, [])}),
     fields: () => ({hardwareConcurrency: core.int})
@@ -64868,7 +66452,56 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get appCodeName() {
+      return this[appCodeName];
+    }
+    set appCodeName(value) {
+      super.appCodeName = value;
+    }
+    get appName() {
+      return this[appName];
+    }
+    set appName(value) {
+      super.appName = value;
+    }
+    get appVersion() {
+      return this[appVersion];
+    }
+    set appVersion(value) {
+      super.appVersion = value;
+    }
+    get dartEnabled() {
+      return this[dartEnabled];
+    }
+    set dartEnabled(value) {
+      super.dartEnabled = value;
+    }
+    get platform() {
+      return this[platform];
+    }
+    set platform(value) {
+      super.platform = value;
+    }
+    get product() {
+      return this[product];
+    }
+    set product(value) {
+      super.product = value;
+    }
+    get userAgent() {
+      return this[userAgent];
+    }
+    set userAgent(value) {
+      super.userAgent = value;
+    }
   };
+  const appCodeName = Symbol(html$.NavigatorID.name + "." + 'appCodeName'.toString());
+  const appName = Symbol(html$.NavigatorID.name + "." + 'appName'.toString());
+  const appVersion = Symbol(html$.NavigatorID.name + "." + 'appVersion'.toString());
+  const dartEnabled = Symbol(html$.NavigatorID.name + "." + 'dartEnabled'.toString());
+  const platform = Symbol(html$.NavigatorID.name + "." + 'platform'.toString());
+  const product = Symbol(html$.NavigatorID.name + "." + 'product'.toString());
+  const userAgent = Symbol(html$.NavigatorID.name + "." + 'userAgent'.toString());
   dart.setSignature(html$.NavigatorID, {
     constructors: () => ({_: dart.definiteFunctionType(html$.NavigatorID, [])}),
     fields: () => ({
@@ -64898,7 +66531,21 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get language() {
+      return this[language];
+    }
+    set language(value) {
+      super.language = value;
+    }
+    get languages() {
+      return this[languages];
+    }
+    set languages(value) {
+      super.languages = value;
+    }
   };
+  const language = Symbol(html$.NavigatorLanguage.name + "." + 'language'.toString());
+  const languages = Symbol(html$.NavigatorLanguage.name + "." + 'languages'.toString());
   dart.setSignature(html$.NavigatorLanguage, {
     constructors: () => ({_: dart.definiteFunctionType(html$.NavigatorLanguage, [])}),
     fields: () => ({
@@ -64914,7 +66561,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get onLine() {
+      return this[onLine];
+    }
+    set onLine(value) {
+      super.onLine = value;
+    }
   };
+  const onLine = Symbol(html$.NavigatorOnLine.name + "." + 'onLine'.toString());
   dart.setSignature(html$.NavigatorOnLine, {
     constructors: () => ({_: dart.definiteFunctionType(html$.NavigatorOnLine, [])}),
     fields: () => ({onLine: core.bool})
@@ -64931,8 +66585,8 @@
     get [dartx.cookieEnabled]() {
       return this.cookieEnabled;
     }
-    [dartx.getStorageUpdates]() {
-      return this.getStorageUpdates();
+    [dartx.getStorageUpdates](...args) {
+      return this.getStorageUpdates.apply(this, args);
     }
   };
   dart.setSignature(html$.NavigatorStorageUtils, {
@@ -65031,14 +66685,14 @@
       if (index == this.length) {
         this[_this][dartx.append](node);
       } else {
-        this[_this][dartx.insertBefore](node, this.get(index));
+        this[_this][dartx.insertBefore](node, this._get(index));
       }
     }
     insertAll(index, iterable) {
       if (index == this.length) {
         this.addAll(iterable);
       } else {
-        let item = this.get(index);
+        let item = this._get(index);
         this[_this][dartx.insertAllBefore](iterable, item);
       }
     }
@@ -65053,7 +66707,7 @@
       return result;
     }
     removeAt(index) {
-      let result = this.get(index);
+      let result = this._get(index);
       if (result != null) {
         this[_this][_removeChild](result);
       }
@@ -65085,8 +66739,8 @@
     clear() {
       this[_this][_clearChildren]();
     }
-    set(index, value) {
-      this[_this][_replaceChild](value, this.get(index));
+    _set(index, value) {
+      this[_this][_replaceChild](value, this._get(index));
       return value;
     }
     get iterator() {
@@ -65114,8 +66768,8 @@
     set length(value) {
       dart.throw(new core.UnsupportedError("Cannot set length on immutable List."));
     }
-    get(index) {
-      return this[_this][dartx.childNodes][dartx.get](index);
+    _get(index) {
+      return this[_this][dartx.childNodes][dartx._get](index);
     }
     get rawList() {
       return this[_this][dartx.childNodes];
@@ -65146,11 +66800,11 @@
       [_filter$]: dart.definiteFunctionType(dart.void, [NodeTobool(), core.bool]),
       removeWhere: dart.definiteFunctionType(dart.void, [NodeTobool()]),
       retainWhere: dart.definiteFunctionType(dart.void, [NodeTobool()]),
-      set: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
       sort: dart.definiteFunctionType(dart.void, [], [ComparatorOfNode()]),
       setRange: dart.definiteFunctionType(dart.void, [core.int, core.int, IterableOfNode()], [core.int]),
       fillRange: dart.definiteFunctionType(dart.void, [core.int, core.int], [html$.Node]),
-      get: dart.definiteFunctionType(html$.Node, [core.int])
+      _get: dart.definiteFunctionType(html$.Node, [core.int])
     })
   });
   dart.defineExtensionMembers(html$._ChildNodeListLazy, [
@@ -65165,12 +66819,12 @@
     'removeWhere',
     'retainWhere',
     'clear',
-    'set',
+    '_set',
     'sort',
     'shuffle',
     'setRange',
     'fillRange',
-    'get',
+    '_get',
     'first',
     'last',
     'single',
@@ -65239,14 +66893,14 @@
     get [dartx.whatToShow]() {
       return this.whatToShow;
     }
-    [dartx.detach]() {
-      return this.detach();
+    [dartx.detach](...args) {
+      return this.detach.apply(this, args);
     }
-    [dartx.nextNode]() {
-      return this.nextNode();
+    [dartx.nextNode](...args) {
+      return this.nextNode.apply(this, args);
     }
-    [dartx.previousNode]() {
-      return this.previousNode();
+    [dartx.previousNode](...args) {
+      return this.previousNode.apply(this, args);
     }
   };
   dart.setSignature(html$.NodeIterator, {
@@ -65269,8 +66923,8 @@
   dart.registerExtension(dart.global.NodeIterator, html$.NodeIterator);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -65284,11 +66938,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -65317,10 +66971,10 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [_item](index) {
-      return this.item(index);
+    [_item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$.NodeList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfNode()];
@@ -65334,13 +66988,14 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.Node, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
+      [dartx._get]: dart.definiteFunctionType(html$.Node, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.Node, [core.int]),
       [_item]: dart.definiteFunctionType(html$.Node, [core.int])
     })
   });
   dart.registerExtension(dart.global.NodeList, html$.NodeList);
+  dart.registerExtension(dart.global.RadioNodeList, html$.NodeList);
   dart.defineExtensionNames([
     'nextElementSibling',
     'previousElementSibling'
@@ -65371,8 +67026,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getElementById](elementId) {
-      return this.getElementById(elementId);
+    [dartx.getElementById](...args) {
+      return this.getElementById.apply(this, args);
     }
   };
   dart.setSignature(html$.NonElementParentNode, {
@@ -65405,11 +67060,11 @@
       let tag = opts && 'tag' in opts ? opts.tag : null;
       let icon = opts && 'icon' in opts ? opts.icon : null;
       let parsedOptions = dart.map();
-      if (dir != null) parsedOptions[dartx.set]('dir', dir);
-      if (body != null) parsedOptions[dartx.set]('body', body);
-      if (lang != null) parsedOptions[dartx.set]('lang', lang);
-      if (tag != null) parsedOptions[dartx.set]('tag', tag);
-      if (icon != null) parsedOptions[dartx.set]('icon', icon);
+      if (dir != null) parsedOptions[dartx._set]('dir', dir);
+      if (body != null) parsedOptions[dartx._set]('body', body);
+      if (lang != null) parsedOptions[dartx._set]('lang', lang);
+      if (tag != null) parsedOptions[dartx._set]('tag', tag);
+      if (icon != null) parsedOptions[dartx._set]('icon', icon);
       return html$.Notification._factoryNotification(title, parsedOptions);
     }
     static _() {
@@ -65462,8 +67117,8 @@
     get [dartx.vibrate]() {
       return this.vibrate;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
     static requestPermission() {
       let completer = CompleterOfString().new();
@@ -65716,20 +67371,20 @@
     get [dartx.willValidate]() {
       return this.willValidate;
     }
-    [__getter__](index_OR_name) {
-      return this.__getter__(index_OR_name);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [__setter__](index_OR_name, value) {
-      return this.__setter__(index_OR_name, value);
+    [__setter__](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.ObjectElement, 'created');
@@ -66003,14 +67658,14 @@
     get [dartx.willValidate]() {
       return this.willValidate;
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.OutputElement, 'created');
@@ -66244,35 +67899,35 @@
     static _create_3(path_OR_text) {
       return new Path2D(path_OR_text);
     }
-    [dartx.addPath](path, transform) {
-      return this.addPath(path, transform);
+    [dartx.addPath](...args) {
+      return this.addPath.apply(this, args);
     }
-    [dartx.arc](x, y, radius, startAngle, endAngle, anticlockwise) {
-      return this.arc(x, y, radius, startAngle, endAngle, anticlockwise);
+    [dartx.arc](...args) {
+      return this.arc.apply(this, args);
     }
-    [dartx.arcTo](x1, y1, x2, y2, radius) {
-      return this.arcTo(x1, y1, x2, y2, radius);
+    [dartx.arcTo](...args) {
+      return this.arcTo.apply(this, args);
     }
-    [dartx.bezierCurveTo](cp1x, cp1y, cp2x, cp2y, x, y) {
-      return this.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
+    [dartx.bezierCurveTo](...args) {
+      return this.bezierCurveTo.apply(this, args);
     }
-    [dartx.closePath]() {
-      return this.closePath();
+    [dartx.closePath](...args) {
+      return this.closePath.apply(this, args);
     }
-    [dartx.ellipse](x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
-      return this.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
+    [dartx.ellipse](...args) {
+      return this.ellipse.apply(this, args);
     }
-    [dartx.lineTo](x, y) {
-      return this.lineTo(x, y);
+    [dartx.lineTo](...args) {
+      return this.lineTo.apply(this, args);
     }
-    [dartx.moveTo](x, y) {
-      return this.moveTo(x, y);
+    [dartx.moveTo](...args) {
+      return this.moveTo.apply(this, args);
     }
-    [dartx.quadraticCurveTo](cpx, cpy, x, y) {
-      return this.quadraticCurveTo(cpx, cpy, x, y);
+    [dartx.quadraticCurveTo](...args) {
+      return this.quadraticCurveTo.apply(this, args);
     }
-    [dartx.rect](x, y, width, height) {
-      return this.rect(x, y, width, height);
+    [dartx.rect](...args) {
+      return this.rect.apply(this, args);
     }
   };
   html$.Path2D[dart.implements] = () => [html$._CanvasPathMethods];
@@ -66335,41 +67990,41 @@
     get [dartx.timing]() {
       return this.timing;
     }
-    [dartx.clearFrameTimings]() {
-      return this.clearFrameTimings();
+    [dartx.clearFrameTimings](...args) {
+      return this.clearFrameTimings.apply(this, args);
     }
-    [dartx.clearMarks](markName) {
-      return this.clearMarks(markName);
+    [dartx.clearMarks](...args) {
+      return this.clearMarks.apply(this, args);
     }
-    [dartx.clearMeasures](measureName) {
-      return this.clearMeasures(measureName);
+    [dartx.clearMeasures](...args) {
+      return this.clearMeasures.apply(this, args);
     }
-    [dartx.getEntries]() {
-      return this.getEntries();
+    [dartx.getEntries](...args) {
+      return this.getEntries.apply(this, args);
     }
-    [dartx.getEntriesByName](name, entryType) {
-      return this.getEntriesByName(name, entryType);
+    [dartx.getEntriesByName](...args) {
+      return this.getEntriesByName.apply(this, args);
     }
-    [dartx.getEntriesByType](entryType) {
-      return this.getEntriesByType(entryType);
+    [dartx.getEntriesByType](...args) {
+      return this.getEntriesByType.apply(this, args);
     }
-    [dartx.mark](markName) {
-      return this.mark(markName);
+    [dartx.mark](...args) {
+      return this.mark.apply(this, args);
     }
-    [dartx.measure](measureName, startMark, endMark) {
-      return this.measure(measureName, startMark, endMark);
+    [dartx.measure](...args) {
+      return this.measure.apply(this, args);
     }
-    [dartx.now]() {
-      return this.now();
+    [dartx.now](...args) {
+      return this.now.apply(this, args);
     }
-    [dartx.setFrameTimingBufferSize](maxSize) {
-      return this.setFrameTimingBufferSize(maxSize);
+    [dartx.setFrameTimingBufferSize](...args) {
+      return this.setFrameTimingBufferSize.apply(this, args);
     }
-    [dartx.clearResourceTimings]() {
-      return this.webkitClearResourceTimings();
+    [dartx.clearResourceTimings](...args) {
+      return this.webkitClearResourceTimings.apply(this, args);
     }
-    [dartx.setResourceTimingBufferSize](maxSize) {
-      return this.webkitSetResourceTimingBufferSize(maxSize);
+    [dartx.setResourceTimingBufferSize](...args) {
+      return this.webkitSetResourceTimingBufferSize.apply(this, args);
     }
     get [dartx.onResourceTimingBufferFull]() {
       return html$.Performance.resourceTimingBufferFullEvent.forTarget(this);
@@ -66762,14 +68417,14 @@
     get [dartx.minPossiblePeriod]() {
       return this.minPossiblePeriod;
     }
-    [dartx.getRegistration](tag) {
-      return this.getRegistration(tag);
+    [dartx.getRegistration](...args) {
+      return this.getRegistration.apply(this, args);
     }
-    [dartx.getRegistrations]() {
-      return this.getRegistrations();
+    [dartx.getRegistrations](...args) {
+      return this.getRegistrations.apply(this, args);
     }
-    [dartx.permissionState]() {
-      return this.permissionState();
+    [dartx.permissionState](...args) {
+      return this.permissionState.apply(this, args);
     }
     [dartx.register](options) {
       if (options === void 0) options = null;
@@ -66779,11 +68434,11 @@
       }
       return this[_register_2]();
     }
-    [_register_1](options) {
-      return this.register(options);
+    [_register_1](...args) {
+      return this.register.apply(this, args);
     }
-    [_register_2]() {
-      return this.register();
+    [_register_2](...args) {
+      return this.register.apply(this, args);
     }
   };
   dart.setSignature(html$.PeriodicSyncManager, {
@@ -66822,8 +68477,8 @@
     get [dartx.tag]() {
       return this.tag;
     }
-    [dartx.unregister]() {
-      return this.unregister();
+    [dartx.unregister](...args) {
+      return this.unregister.apply(this, args);
     }
   };
   dart.setSignature(html$.PeriodicSyncRegistration, {
@@ -66878,8 +68533,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.query](permission) {
-      return this.query(permission);
+    [dartx.query](...args) {
+      return this.query.apply(this, args);
     }
   };
   dart.setSignature(html$.Permissions, {
@@ -66927,11 +68582,11 @@
     get [dartx.name]() {
       return this.name;
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.namedItem](name) {
-      return this.namedItem(name);
+    [dartx.namedItem](...args) {
+      return this.namedItem.apply(this, args);
     }
   };
   dart.setSignature(html$.Plugin, {
@@ -66950,8 +68605,8 @@
   dart.registerExtension(dart.global.Plugin, html$.Plugin);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -66968,11 +68623,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -67001,16 +68656,16 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.namedItem](name) {
-      return this.namedItem(name);
+    [dartx.namedItem](...args) {
+      return this.namedItem.apply(this, args);
     }
-    [dartx.refresh](reload) {
-      return this.refresh(reload);
+    [dartx.refresh](...args) {
+      return this.refresh.apply(this, args);
     }
   };
   html$.PluginArray[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfPlugin()];
@@ -67024,8 +68679,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.Plugin, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.Plugin]),
+      [dartx._get]: dart.definiteFunctionType(html$.Plugin, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.Plugin]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.Plugin, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.Plugin, [core.int]),
       [dartx.namedItem]: dart.definiteFunctionType(html$.Plugin, [core.String]),
@@ -67059,8 +68714,8 @@
     set [dartx.message](value) {
       this.message = value;
     }
-    [dartx.createdCallback]() {
-      return this.createdCallback();
+    [dartx.createdCallback](...args) {
+      return this.createdCallback.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.PluginPlaceholderElement, 'created');
@@ -67235,14 +68890,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getImmediateState]() {
-      return this.getImmediateState();
+    [dartx.getImmediateState](...args) {
+      return this.getImmediateState.apply(this, args);
     }
-    [dartx.getState]() {
-      return this.getState();
+    [dartx.getState](...args) {
+      return this.getState.apply(this, args);
     }
-    [dartx.resetSensor]() {
-      return this.resetSensor();
+    [dartx.resetSensor](...args) {
+      return this.resetSensor.apply(this, args);
     }
   };
   dart.setSignature(html$.PositionSensorVRDevice, {
@@ -67287,14 +68942,14 @@
     get [dartx.session]() {
       return this.session;
     }
-    [dartx.getAvailability](url) {
-      return this.getAvailability(url);
+    [dartx.getAvailability](...args) {
+      return this.getAvailability.apply(this, args);
     }
-    [dartx.joinSession](url, presentationId) {
-      return this.joinSession(url, presentationId);
+    [dartx.joinSession](...args) {
+      return this.joinSession.apply(this, args);
     }
-    [dartx.startSession](url) {
-      return this.startSession(url);
+    [dartx.startSession](...args) {
+      return this.startSession.apply(this, args);
     }
   };
   dart.setSignature(html$.Presentation, {
@@ -67358,11 +69013,11 @@
     get [dartx.state]() {
       return this.state;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.send](data_OR_message) {
-      return this.send(data_OR_message);
+    [dartx.send](...args) {
+      return this.send.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.PresentationSession.messageEvent.forTarget(this);
@@ -67615,8 +69270,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getSubscription]() {
-      return this.getSubscription();
+    [dartx.getSubscription](...args) {
+      return this.getSubscription.apply(this, args);
     }
     [dartx.permissionState](options) {
       if (options === void 0) options = null;
@@ -67626,11 +69281,11 @@
       }
       return this[_permissionState_2]();
     }
-    [_permissionState_1](options) {
-      return this.permissionState(options);
+    [_permissionState_1](...args) {
+      return this.permissionState.apply(this, args);
     }
-    [_permissionState_2]() {
-      return this.permissionState();
+    [_permissionState_2](...args) {
+      return this.permissionState.apply(this, args);
     }
     [dartx.subscribe](options) {
       if (options === void 0) options = null;
@@ -67640,11 +69295,11 @@
       }
       return this[_subscribe_2]();
     }
-    [_subscribe_1](options) {
-      return this.subscribe(options);
+    [_subscribe_1](...args) {
+      return this.subscribe.apply(this, args);
     }
-    [_subscribe_2]() {
-      return this.subscribe();
+    [_subscribe_2](...args) {
+      return this.subscribe.apply(this, args);
     }
   };
   dart.setSignature(html$.PushManager, {
@@ -67676,17 +69331,17 @@
     static _create_1(message) {
       return new PushMessageData(message);
     }
-    [dartx.arrayBuffer]() {
-      return this.arrayBuffer();
+    [dartx.arrayBuffer](...args) {
+      return this.arrayBuffer.apply(this, args);
     }
-    [dartx.blob]() {
-      return this.blob();
+    [dartx.blob](...args) {
+      return this.blob.apply(this, args);
     }
-    [dartx.json]() {
-      return this.json();
+    [dartx.json](...args) {
+      return this.json.apply(this, args);
     }
-    [dartx.text]() {
-      return this.text();
+    [dartx.text](...args) {
+      return this.text.apply(this, args);
     }
   };
   dart.setSignature(html$.PushMessageData, {
@@ -67715,8 +69370,8 @@
     get [dartx.endpoint]() {
       return this.endpoint;
     }
-    [dartx.unsubscribe]() {
-      return this.unsubscribe();
+    [dartx.unsubscribe](...args) {
+      return this.unsubscribe.apply(this, args);
     }
   };
   dart.setSignature(html$.PushSubscription, {
@@ -67818,74 +69473,74 @@
     get [dartx.startOffset]() {
       return this.startOffset;
     }
-    [dartx.cloneContents]() {
-      return this.cloneContents();
+    [dartx.cloneContents](...args) {
+      return this.cloneContents.apply(this, args);
     }
-    [dartx.cloneRange]() {
-      return this.cloneRange();
+    [dartx.cloneRange](...args) {
+      return this.cloneRange.apply(this, args);
     }
-    [dartx.collapse](toStart) {
-      return this.collapse(toStart);
+    [dartx.collapse](...args) {
+      return this.collapse.apply(this, args);
     }
-    [dartx.compareBoundaryPoints](how, sourceRange) {
-      return this.compareBoundaryPoints(how, sourceRange);
+    [dartx.compareBoundaryPoints](...args) {
+      return this.compareBoundaryPoints.apply(this, args);
     }
-    [dartx.comparePoint](node, offset) {
-      return this.comparePoint(node, offset);
+    [dartx.comparePoint](...args) {
+      return this.comparePoint.apply(this, args);
     }
-    [dartx.createContextualFragment](fragment) {
-      return this.createContextualFragment(fragment);
+    [dartx.createContextualFragment](...args) {
+      return this.createContextualFragment.apply(this, args);
     }
-    [dartx.deleteContents]() {
-      return this.deleteContents();
+    [dartx.deleteContents](...args) {
+      return this.deleteContents.apply(this, args);
     }
-    [dartx.detach]() {
-      return this.detach();
+    [dartx.detach](...args) {
+      return this.detach.apply(this, args);
     }
-    [dartx.expand](unit) {
-      return this.expand(unit);
+    [dartx.expand](...args) {
+      return this.expand.apply(this, args);
     }
-    [dartx.extractContents]() {
-      return this.extractContents();
+    [dartx.extractContents](...args) {
+      return this.extractContents.apply(this, args);
     }
-    [dartx.getBoundingClientRect]() {
-      return this.getBoundingClientRect();
+    [dartx.getBoundingClientRect](...args) {
+      return this.getBoundingClientRect.apply(this, args);
     }
-    [dartx.getClientRects]() {
-      return this.getClientRects();
+    [dartx.getClientRects](...args) {
+      return this.getClientRects.apply(this, args);
     }
-    [dartx.insertNode](node) {
-      return this.insertNode(node);
+    [dartx.insertNode](...args) {
+      return this.insertNode.apply(this, args);
     }
-    [dartx.isPointInRange](node, offset) {
-      return this.isPointInRange(node, offset);
+    [dartx.isPointInRange](...args) {
+      return this.isPointInRange.apply(this, args);
     }
-    [dartx.selectNode](node) {
-      return this.selectNode(node);
+    [dartx.selectNode](...args) {
+      return this.selectNode.apply(this, args);
     }
-    [dartx.selectNodeContents](node) {
-      return this.selectNodeContents(node);
+    [dartx.selectNodeContents](...args) {
+      return this.selectNodeContents.apply(this, args);
     }
-    [dartx.setEnd](node, offset) {
-      return this.setEnd(node, offset);
+    [dartx.setEnd](...args) {
+      return this.setEnd.apply(this, args);
     }
-    [dartx.setEndAfter](node) {
-      return this.setEndAfter(node);
+    [dartx.setEndAfter](...args) {
+      return this.setEndAfter.apply(this, args);
     }
-    [dartx.setEndBefore](node) {
-      return this.setEndBefore(node);
+    [dartx.setEndBefore](...args) {
+      return this.setEndBefore.apply(this, args);
     }
-    [dartx.setStart](node, offset) {
-      return this.setStart(node, offset);
+    [dartx.setStart](...args) {
+      return this.setStart.apply(this, args);
     }
-    [dartx.setStartAfter](node) {
-      return this.setStartAfter(node);
+    [dartx.setStartAfter](...args) {
+      return this.setStartAfter.apply(this, args);
     }
-    [dartx.setStartBefore](node) {
-      return this.setStartBefore(node);
+    [dartx.setStartBefore](...args) {
+      return this.setStartBefore.apply(this, args);
     }
-    [dartx.surroundContents](newParent) {
-      return this.surroundContents(newParent);
+    [dartx.surroundContents](...args) {
+      return this.surroundContents.apply(this, args);
     }
     static get supportsCreateContextualFragment() {
       return "createContextualFragment" in window.Range.prototype;
@@ -67951,11 +69606,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.cancel](reason) {
-      return this.cancel(reason);
+    [dartx.cancel](...args) {
+      return this.cancel.apply(this, args);
     }
-    [dartx.getReader]() {
-      return this.getReader();
+    [dartx.getReader](...args) {
+      return this.getReader.apply(this, args);
     }
   };
   dart.setSignature(html$.ReadableByteStream, {
@@ -67979,14 +69634,14 @@
     get [dartx.closed]() {
       return this.closed;
     }
-    [dartx.cancel](reason) {
-      return this.cancel(reason);
+    [dartx.cancel](...args) {
+      return this.cancel.apply(this, args);
     }
-    [dartx.read]() {
-      return this.read();
+    [dartx.read](...args) {
+      return this.read.apply(this, args);
     }
-    [dartx.releaseLock]() {
-      return this.releaseLock();
+    [dartx.releaseLock](...args) {
+      return this.releaseLock.apply(this, args);
     }
   };
   dart.setSignature(html$.ReadableByteStreamReader, {
@@ -68007,11 +69662,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.cancel](reason) {
-      return this.cancel(reason);
+    [dartx.cancel](...args) {
+      return this.cancel.apply(this, args);
     }
-    [dartx.getReader]() {
-      return this.getReader();
+    [dartx.getReader](...args) {
+      return this.getReader.apply(this, args);
     }
   };
   dart.setSignature(html$.ReadableStream, {
@@ -68035,14 +69690,14 @@
     get [dartx.closed]() {
       return this.closed;
     }
-    [dartx.cancel](reason) {
-      return this.cancel(reason);
+    [dartx.cancel](...args) {
+      return this.cancel.apply(this, args);
     }
-    [dartx.read]() {
-      return this.read();
+    [dartx.read](...args) {
+      return this.read.apply(this, args);
     }
-    [dartx.releaseLock]() {
-      return this.releaseLock();
+    [dartx.releaseLock](...args) {
+      return this.releaseLock.apply(this, args);
     }
   };
   dart.setSignature(html$.ReadableStreamReader, {
@@ -68177,23 +69832,23 @@
     get [dartx.reliable]() {
       return this.reliable;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.send](data) {
-      return this.send(data);
+    [dartx.send](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendBlob](data) {
-      return this.send(data);
+    [dartx.sendBlob](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendByteBuffer](data) {
-      return this.send(data);
+    [dartx.sendByteBuffer](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendString](data) {
-      return this.send(data);
+    [dartx.sendString](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendTypedData](data) {
-      return this.send(data);
+    [dartx.sendTypedData](...args) {
+      return this.send.apply(this, args);
     }
     get [dartx.onClose]() {
       return html$.RtcDataChannel.closeEvent.forTarget(this);
@@ -68259,6 +69914,7 @@
     }
   });
   dart.registerExtension(dart.global.RTCDataChannel, html$.RtcDataChannel);
+  dart.registerExtension(dart.global.DataChannel, html$.RtcDataChannel);
   dart.defineExtensionNames([
     'channel'
   ]);
@@ -68303,8 +69959,8 @@
     get [dartx.track]() {
       return this.track;
     }
-    [dartx.insertDtmf](tones, duration, interToneGap) {
-      return this.insertDTMF(tones, duration, interToneGap);
+    [dartx.insertDtmf](...args) {
+      return this.insertDTMF.apply(this, args);
     }
     get [dartx.onToneChange]() {
       return html$.RtcDtmfSender.toneChangeEvent.forTarget(this);
@@ -68401,6 +70057,7 @@
     })
   });
   dart.registerExtension(dart.global.RTCIceCandidate, html$.RtcIceCandidate);
+  dart.registerExtension(dart.global.mozRTCIceCandidate, html$.RtcIceCandidate);
   dart.defineExtensionNames([
     'candidate'
   ]);
@@ -68417,6 +70074,7 @@
     fields: () => ({[dartx.candidate]: html$.RtcIceCandidate})
   });
   dart.registerExtension(dart.global.RTCIceCandidateEvent, html$.RtcIceCandidateEvent);
+  dart.registerExtension(dart.global.RTCPeerConnectionIceEvent, html$.RtcIceCandidateEvent);
   const _createOffer = Symbol('_createOffer');
   const _createAnswer = Symbol('_createAnswer');
   const _getStats = Symbol('_getStats');
@@ -68527,8 +70185,8 @@
     get [dartx.signalingState]() {
       return this.signalingState;
     }
-    [dartx.addIceCandidate](candidate, successCallback, failureCallback) {
-      return this.addIceCandidate(candidate, successCallback, failureCallback);
+    [dartx.addIceCandidate](...args) {
+      return this.addIceCandidate.apply(this, args);
     }
     [dartx.addStream](stream, mediaConstraints) {
       if (mediaConstraints === void 0) mediaConstraints = null;
@@ -68540,14 +70198,14 @@
       this[_addStream_2](stream);
       return;
     }
-    [_addStream_1](stream, mediaConstraints) {
-      return this.addStream(stream, mediaConstraints);
+    [_addStream_1](...args) {
+      return this.addStream.apply(this, args);
     }
-    [_addStream_2](stream) {
-      return this.addStream(stream);
+    [_addStream_2](...args) {
+      return this.addStream.apply(this, args);
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
     [_createAnswer](successCallback, failureCallback, mediaConstraints) {
       if (failureCallback === void 0) failureCallback = null;
@@ -68560,14 +70218,14 @@
       this[_createAnswer_2](successCallback, failureCallback);
       return;
     }
-    [_createAnswer_1](successCallback, failureCallback, mediaConstraints) {
-      return this.createAnswer(successCallback, failureCallback, mediaConstraints);
+    [_createAnswer_1](...args) {
+      return this.createAnswer.apply(this, args);
     }
-    [_createAnswer_2](successCallback, failureCallback) {
-      return this.createAnswer(successCallback, failureCallback);
+    [_createAnswer_2](...args) {
+      return this.createAnswer.apply(this, args);
     }
-    [dartx.createDtmfSender](track) {
-      return this.createDTMFSender(track);
+    [dartx.createDtmfSender](...args) {
+      return this.createDTMFSender.apply(this, args);
     }
     [dartx.createDataChannel](label, options) {
       if (options === void 0) options = null;
@@ -68577,11 +70235,11 @@
       }
       return this[_createDataChannel_2](label);
     }
-    [_createDataChannel_1](label, options) {
-      return this.createDataChannel(label, options);
+    [_createDataChannel_1](...args) {
+      return this.createDataChannel.apply(this, args);
     }
-    [_createDataChannel_2](label) {
-      return this.createDataChannel(label);
+    [_createDataChannel_2](...args) {
+      return this.createDataChannel.apply(this, args);
     }
     [_createOffer](successCallback, failureCallback, rtcOfferOptions) {
       if (failureCallback === void 0) failureCallback = null;
@@ -68594,29 +70252,29 @@
       this[_createOffer_2](successCallback, failureCallback);
       return;
     }
-    [_createOffer_1](successCallback, failureCallback, rtcOfferOptions) {
-      return this.createOffer(successCallback, failureCallback, rtcOfferOptions);
+    [_createOffer_1](...args) {
+      return this.createOffer.apply(this, args);
     }
-    [_createOffer_2](successCallback, failureCallback) {
-      return this.createOffer(successCallback, failureCallback);
+    [_createOffer_2](...args) {
+      return this.createOffer.apply(this, args);
     }
-    [dartx.getLocalStreams]() {
-      return this.getLocalStreams();
+    [dartx.getLocalStreams](...args) {
+      return this.getLocalStreams.apply(this, args);
     }
-    [dartx.getRemoteStreams]() {
-      return this.getRemoteStreams();
+    [dartx.getRemoteStreams](...args) {
+      return this.getRemoteStreams.apply(this, args);
     }
-    [_getStats](successCallback, selector) {
-      return this.getStats(successCallback, selector);
+    [_getStats](...args) {
+      return this.getStats.apply(this, args);
     }
-    [dartx.getStreamById](streamId) {
-      return this.getStreamById(streamId);
+    [dartx.getStreamById](...args) {
+      return this.getStreamById.apply(this, args);
     }
-    [dartx.removeStream](stream) {
-      return this.removeStream(stream);
+    [dartx.removeStream](...args) {
+      return this.removeStream.apply(this, args);
     }
-    [_setLocalDescription](description, successCallback, failureCallback) {
-      return this.setLocalDescription(description, successCallback, failureCallback);
+    [_setLocalDescription](...args) {
+      return this.setLocalDescription.apply(this, args);
     }
     [dartx.setLocalDescription](description) {
       let completer = async.Completer.new();
@@ -68627,8 +70285,8 @@
       }, StringTovoid$()));
       return completer.future;
     }
-    [_setRemoteDescription](description, successCallback, failureCallback) {
-      return this.setRemoteDescription(description, successCallback, failureCallback);
+    [_setRemoteDescription](...args) {
+      return this.setRemoteDescription.apply(this, args);
     }
     [dartx.setRemoteDescription](description) {
       let completer = async.Completer.new();
@@ -68656,14 +70314,14 @@
       this[_updateIce_3]();
       return;
     }
-    [_updateIce_1](configuration, mediaConstraints) {
-      return this.updateIce(configuration, mediaConstraints);
+    [_updateIce_1](...args) {
+      return this.updateIce.apply(this, args);
     }
-    [_updateIce_2](configuration) {
-      return this.updateIce(configuration);
+    [_updateIce_2](...args) {
+      return this.updateIce.apply(this, args);
     }
-    [_updateIce_3]() {
-      return this.updateIce();
+    [_updateIce_3](...args) {
+      return this.updateIce.apply(this, args);
     }
     get [dartx.onAddStream]() {
       return html$.RtcPeerConnection.addStreamEvent.forTarget(this);
@@ -68776,6 +70434,7 @@
     }
   });
   dart.registerExtension(dart.global.RTCPeerConnection, html$.RtcPeerConnection);
+  dart.registerExtension(dart.global.mozRTCPeerConnection, html$.RtcPeerConnection);
   dart.defineExtensionNames([
     'sdp',
     'type'
@@ -68812,6 +70471,7 @@
     })
   });
   dart.registerExtension(dart.global.RTCSessionDescription, html$.RtcSessionDescription);
+  dart.registerExtension(dart.global.mozRTCSessionDescription, html$.RtcSessionDescription);
   const _get_timestamp = Symbol('_get_timestamp');
   dart.defineExtensionNames([
     'timestamp',
@@ -68836,11 +70496,11 @@
     get [dartx.type]() {
       return this.type;
     }
-    [dartx.names]() {
-      return this.names();
+    [dartx.names](...args) {
+      return this.names.apply(this, args);
     }
-    [dartx.stat](name) {
-      return this.stat(name);
+    [dartx.stat](...args) {
+      return this.stat.apply(this, args);
     }
   };
   dart.setSignature(html$.RtcStatsReport, {
@@ -68865,11 +70525,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.namedItem](name) {
-      return this.namedItem(name);
+    [dartx.namedItem](...args) {
+      return this.namedItem.apply(this, args);
     }
-    [dartx.result]() {
-      return this.result();
+    [dartx.result](...args) {
+      return this.result.apply(this, args);
     }
   };
   dart.setSignature(html$.RtcStatsResponse, {
@@ -68960,11 +70620,11 @@
     get [dartx.type]() {
       return this.type;
     }
-    [dartx.lock](orientation) {
-      return this.lock(orientation);
+    [dartx.lock](...args) {
+      return this.lock.apply(this, args);
     }
-    [dartx.unlock]() {
-      return this.unlock();
+    [dartx.unlock](...args) {
+      return this.unlock.apply(this, args);
     }
     get [dartx.onChange]() {
       return html$.ScreenOrientation.changeEvent.forTarget(this);
@@ -69194,8 +70854,8 @@
     get [dartx.velocityY]() {
       return this.velocityY;
     }
-    [dartx.consumeDelta](x, y) {
-      return this.consumeDelta(x, y);
+    [dartx.consumeDelta](...args) {
+      return this.consumeDelta.apply(this, args);
     }
   };
   dart.setSignature(html$.ScrollState, {
@@ -69437,26 +71097,26 @@
     get [dartx.willValidate]() {
       return this.willValidate;
     }
-    [__setter__](index, option) {
-      return this.__setter__(index, option);
+    [__setter__](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.add](element, before) {
-      return this.add(element, before);
+    [dartx.add](...args) {
+      return this.add.apply(this, args);
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.namedItem](name) {
-      return this.namedItem(name);
+    [dartx.namedItem](...args) {
+      return this.namedItem.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
     get [dartx.options]() {
       let options = ListOfOptionElement().from(this[dartx.querySelectorAll](html$.Element)('option'));
@@ -69467,7 +71127,7 @@
         let options = this[dartx.options][dartx.where](dart.fn(o => o[dartx.selected], OptionElementTobool()))[dartx.toList]();
         return new (UnmodifiableListViewOfOptionElement())(options);
       } else {
-        return JSArrayOfOptionElement().of([this[dartx.options][dartx.get](this[dartx.selectedIndex])]);
+        return JSArrayOfOptionElement().of([this[dartx.options][dartx._get](this[dartx.selectedIndex])]);
       }
     }
   };
@@ -69574,47 +71234,47 @@
     get [dartx.type]() {
       return this.type;
     }
-    [dartx.addRange](range) {
-      return this.addRange(range);
+    [dartx.addRange](...args) {
+      return this.addRange.apply(this, args);
     }
-    [dartx.collapse](node, offset) {
-      return this.collapse(node, offset);
+    [dartx.collapse](...args) {
+      return this.collapse.apply(this, args);
     }
-    [dartx.collapseToEnd]() {
-      return this.collapseToEnd();
+    [dartx.collapseToEnd](...args) {
+      return this.collapseToEnd.apply(this, args);
     }
-    [dartx.collapseToStart]() {
-      return this.collapseToStart();
+    [dartx.collapseToStart](...args) {
+      return this.collapseToStart.apply(this, args);
     }
-    [dartx.containsNode](node, allowPartialContainment) {
-      return this.containsNode(node, allowPartialContainment);
+    [dartx.containsNode](...args) {
+      return this.containsNode.apply(this, args);
     }
-    [dartx.deleteFromDocument]() {
-      return this.deleteFromDocument();
+    [dartx.deleteFromDocument](...args) {
+      return this.deleteFromDocument.apply(this, args);
     }
-    [dartx.empty]() {
-      return this.empty();
+    [dartx.empty](...args) {
+      return this.empty.apply(this, args);
     }
-    [dartx.extend](node, offset) {
-      return this.extend(node, offset);
+    [dartx.extend](...args) {
+      return this.extend.apply(this, args);
     }
-    [dartx.getRangeAt](index) {
-      return this.getRangeAt(index);
+    [dartx.getRangeAt](...args) {
+      return this.getRangeAt.apply(this, args);
     }
-    [dartx.modify](alter, direction, granularity) {
-      return this.modify(alter, direction, granularity);
+    [dartx.modify](...args) {
+      return this.modify.apply(this, args);
     }
-    [dartx.removeAllRanges]() {
-      return this.removeAllRanges();
+    [dartx.removeAllRanges](...args) {
+      return this.removeAllRanges.apply(this, args);
     }
-    [dartx.selectAllChildren](node) {
-      return this.selectAllChildren(node);
+    [dartx.selectAllChildren](...args) {
+      return this.selectAllChildren.apply(this, args);
     }
-    [dartx.setBaseAndExtent](baseNode, baseOffset, extentNode, extentOffset) {
-      return this.setBaseAndExtent(baseNode, baseOffset, extentNode, extentOffset);
+    [dartx.setBaseAndExtent](...args) {
+      return this.setBaseAndExtent.apply(this, args);
     }
-    [dartx.setPosition](node, offset) {
-      return this.setPosition(node, offset);
+    [dartx.setPosition](...args) {
+      return this.setPosition.apply(this, args);
     }
   };
   dart.setSignature(html$.Selection, {
@@ -69670,8 +71330,8 @@
     get [dartx.targetUrl]() {
       return this.targetURL;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
     [dartx.postMessage](message, transfer) {
       if (transfer === void 0) transfer = null;
@@ -69684,11 +71344,11 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
   };
   dart.setSignature(html$.ServicePort, {
@@ -69726,18 +71386,18 @@
       }
       return this[_connect_2](url);
     }
-    [_connect_1](url, options) {
-      return this.connect(url, options);
+    [_connect_1](...args) {
+      return this.connect.apply(this, args);
     }
-    [_connect_2](url) {
-      return this.connect(url);
+    [_connect_2](...args) {
+      return this.connect.apply(this, args);
     }
     [dartx.match](options) {
       let options_1 = html_common.convertDartToNative_Dictionary(options);
       return this[_match_1](options_1);
     }
-    [_match_1](options) {
-      return this.match(options);
+    [_match_1](...args) {
+      return this.match.apply(this, args);
     }
     [dartx.matchAll](options) {
       if (options === void 0) options = null;
@@ -69747,11 +71407,11 @@
       }
       return this[_matchAll_2]();
     }
-    [_matchAll_1](options) {
-      return this.matchAll(options);
+    [_matchAll_1](...args) {
+      return this.matchAll.apply(this, args);
     }
-    [_matchAll_2]() {
-      return this.matchAll();
+    [_matchAll_2](...args) {
+      return this.matchAll.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.ServicePortCollection.messageEvent.forTarget(this);
@@ -69807,8 +71467,8 @@
     get [dartx.targetUrl]() {
       return this.targetURL;
     }
-    [dartx.respondWith](response) {
-      return this.respondWith(response);
+    [dartx.respondWith](...args) {
+      return this.respondWith.apply(this, args);
     }
   };
   dart.setSignature(html$.ServicePortConnectEvent, {
@@ -69846,11 +71506,11 @@
     get [dartx.ready]() {
       return this.ready;
     }
-    [dartx.getRegistration](documentURL) {
-      return this.getRegistration(documentURL);
+    [dartx.getRegistration](...args) {
+      return this.getRegistration.apply(this, args);
     }
-    [dartx.getRegistrations]() {
-      return this.getRegistrations();
+    [dartx.getRegistrations](...args) {
+      return this.getRegistrations.apply(this, args);
     }
     [dartx.register](url, options) {
       if (options === void 0) options = null;
@@ -69860,11 +71520,11 @@
       }
       return this[_register_2](url);
     }
-    [_register_1](url, options) {
-      return this.register(url, options);
+    [_register_1](...args) {
+      return this.register.apply(this, args);
     }
-    [_register_2](url) {
-      return this.register(url);
+    [_register_2](...args) {
+      return this.register.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.ServiceWorkerContainer.messageEvent.forTarget(this);
@@ -69912,8 +71572,8 @@
     get [dartx.registration]() {
       return this.registration;
     }
-    [dartx.skipWaiting]() {
-      return this.skipWaiting();
+    [dartx.skipWaiting](...args) {
+      return this.skipWaiting.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.ServiceWorkerGlobalScope.messageEvent.forTarget(this);
@@ -70054,11 +71714,11 @@
       }
       return this[_getNotifications_2]();
     }
-    [_getNotifications_1](filter) {
-      return this.getNotifications(filter);
+    [_getNotifications_1](...args) {
+      return this.getNotifications.apply(this, args);
     }
-    [_getNotifications_2]() {
-      return this.getNotifications();
+    [_getNotifications_2](...args) {
+      return this.getNotifications.apply(this, args);
     }
     [dartx.showNotification](title, options) {
       if (options === void 0) options = null;
@@ -70068,17 +71728,17 @@
       }
       return this[_showNotification_2](title);
     }
-    [_showNotification_1](title, options) {
-      return this.showNotification(title, options);
+    [_showNotification_1](...args) {
+      return this.showNotification.apply(this, args);
     }
-    [_showNotification_2](title) {
-      return this.showNotification(title);
+    [_showNotification_2](...args) {
+      return this.showNotification.apply(this, args);
     }
-    [dartx.unregister]() {
-      return this.unregister();
+    [dartx.unregister](...args) {
+      return this.unregister.apply(this, args);
     }
-    [dartx.update]() {
-      return this.update();
+    [dartx.update](...args) {
+      return this.update.apply(this, args);
     }
   };
   dart.setSignature(html$.ServiceWorkerRegistration, {
@@ -70121,8 +71781,8 @@
     static get supported() {
       return html$.Element.isTagSupported('shadow');
     }
-    [dartx.getDistributedNodes]() {
-      return this.getDistributedNodes();
+    [dartx.getDistributedNodes](...args) {
+      return this.getDistributedNodes.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.ShadowElement, 'created');
@@ -70177,17 +71837,17 @@
     get [dartx.styleSheets]() {
       return this.styleSheets;
     }
-    [dartx.clone](deep) {
-      return this.cloneNode(deep);
+    [dartx.clone](...args) {
+      return this.cloneNode.apply(this, args);
     }
-    [dartx.elementFromPoint](x, y) {
-      return this.elementFromPoint(x, y);
+    [dartx.elementFromPoint](...args) {
+      return this.elementFromPoint.apply(this, args);
     }
-    [dartx.elementsFromPoint](x, y) {
-      return this.elementsFromPoint(x, y);
+    [dartx.elementsFromPoint](...args) {
+      return this.elementsFromPoint.apply(this, args);
     }
-    [dartx.getSelection]() {
-      return this.getSelection();
+    [dartx.getSelection](...args) {
+      return this.getSelection.apply(this, args);
     }
     static get supported() {
       return !!(Element.prototype.createShadowRoot || Element.prototype.webkitCreateShadowRoot);
@@ -70397,20 +72057,20 @@
     get [dartx.updating]() {
       return this.updating;
     }
-    [dartx.abort]() {
-      return this.abort();
+    [dartx.abort](...args) {
+      return this.abort.apply(this, args);
     }
-    [dartx.appendBuffer](data) {
-      return this.appendBuffer(data);
+    [dartx.appendBuffer](...args) {
+      return this.appendBuffer.apply(this, args);
     }
-    [dartx.appendStream](stream, maxSize) {
-      return this.appendStream(stream, maxSize);
+    [dartx.appendStream](...args) {
+      return this.appendStream.apply(this, args);
     }
-    [dartx.appendTypedData](data) {
-      return this.appendBuffer(data);
+    [dartx.appendTypedData](...args) {
+      return this.appendBuffer.apply(this, args);
     }
-    [dartx.remove](start, end) {
-      return this.remove(start, end);
+    [dartx.remove](...args) {
+      return this.remove.apply(this, args);
     }
   };
   dart.setSignature(html$.SourceBuffer, {
@@ -70435,8 +72095,8 @@
   dart.registerExtension(dart.global.SourceBuffer, html$.SourceBuffer);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -70451,11 +72111,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -70484,10 +72144,10 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$.SourceBufferList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfSourceBuffer()];
@@ -70501,8 +72161,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.SourceBuffer, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.SourceBuffer]),
+      [dartx._get]: dart.definiteFunctionType(html$.SourceBuffer, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.SourceBuffer]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.SourceBuffer, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.SourceBuffer, [core.int])
     })
@@ -70672,8 +72332,8 @@
   dart.registerExtension(dart.global.SpeechGrammar, html$.SpeechGrammar);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -70696,11 +72356,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -70729,16 +72389,16 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.addFromString](string, weight) {
-      return this.addFromString(string, weight);
+    [dartx.addFromString](...args) {
+      return this.addFromString.apply(this, args);
     }
-    [dartx.addFromUri](src, weight) {
-      return this.addFromUri(src, weight);
+    [dartx.addFromUri](...args) {
+      return this.addFromUri.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$.SpeechGrammarList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfSpeechGrammar()];
@@ -70755,8 +72415,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.SpeechGrammar, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.SpeechGrammar]),
+      [dartx._get]: dart.definiteFunctionType(html$.SpeechGrammar, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.SpeechGrammar]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.SpeechGrammar, [core.int]),
       [dartx.addFromString]: dart.definiteFunctionType(dart.void, [core.String], [core.num]),
       [dartx.addFromUri]: dart.definiteFunctionType(dart.void, [core.String], [core.num]),
@@ -70838,14 +72498,14 @@
     set [dartx.serviceUri](value) {
       this.serviceURI = value;
     }
-    [dartx.abort]() {
-      return this.abort();
+    [dartx.abort](...args) {
+      return this.abort.apply(this, args);
     }
-    [dartx.start]() {
-      return this.start();
+    [dartx.start](...args) {
+      return this.start.apply(this, args);
     }
-    [dartx.stop]() {
-      return this.stop();
+    [dartx.stop](...args) {
+      return this.stop.apply(this, args);
     }
     get [dartx.onAudioEnd]() {
       return html$.SpeechRecognition.audioEndEvent.forTarget(this);
@@ -71105,8 +72765,8 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   dart.setSignature(html$.SpeechRecognitionResult, {
@@ -71141,20 +72801,20 @@
     get [dartx.speaking]() {
       return this.speaking;
     }
-    [dartx.cancel]() {
-      return this.cancel();
+    [dartx.cancel](...args) {
+      return this.cancel.apply(this, args);
     }
-    [dartx.getVoices]() {
-      return this.getVoices();
+    [dartx.getVoices](...args) {
+      return this.getVoices.apply(this, args);
     }
-    [dartx.pause]() {
-      return this.pause();
+    [dartx.pause](...args) {
+      return this.pause.apply(this, args);
     }
-    [dartx.resume]() {
-      return this.resume();
+    [dartx.resume](...args) {
+      return this.resume.apply(this, args);
     }
-    [dartx.speak](utterance) {
-      return this.speak(utterance);
+    [dartx.speak](...args) {
+      return this.speak.apply(this, args);
     }
   };
   dart.setSignature(html$.SpeechSynthesis, {
@@ -71419,8 +73079,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.add](name, port) {
-      return this.add(name, port);
+    [dartx.add](...args) {
+      return this.add.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.StashedPortCollection.messageEvent.forTarget(this);
@@ -71448,8 +73108,8 @@
     'addAll',
     'containsValue',
     'containsKey',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'putIfAbsent',
     'remove',
     'clear',
@@ -71463,7 +73123,7 @@
   html$.Storage = class Storage extends _interceptors.Interceptor {
     [dartx.addAll](other) {
       other[dartx.forEach](dart.fn((k, v) => {
-        this[dartx.set](k, v);
+        this[dartx._set](k, v);
       }, StringAndStringTovoid$()));
     }
     [dartx.containsValue](value) {
@@ -71472,19 +73132,19 @@
     [dartx.containsKey](key) {
       return this[_getItem](core.String._check(key)) != null;
     }
-    [dartx.get](key) {
+    [dartx._get](key) {
       return this[_getItem](core.String._check(key));
     }
-    [dartx.set](key, value) {
+    [dartx._set](key, value) {
       this[_setItem](key, value);
       return value;
     }
     [dartx.putIfAbsent](key, ifAbsent) {
-      if (!dart.test(this[dartx.containsKey](key))) this[dartx.set](key, ifAbsent());
-      return this[dartx.get](key);
+      if (!dart.test(this[dartx.containsKey](key))) this[dartx._set](key, ifAbsent());
+      return this[dartx._get](key);
     }
     [dartx.remove](key) {
-      let value = this[dartx.get](key);
+      let value = this[dartx._get](key);
       this[_removeItem](core.String._check(key));
       return value;
     }
@@ -71495,7 +73155,7 @@
       for (let i = 0; true; i++) {
         let key = this[_key](i);
         if (key == null) return;
-        f(key, this[dartx.get](key));
+        f(key, this[dartx._get](key));
       }
     }
     get [dartx.keys]() {
@@ -71523,29 +73183,29 @@
     get [_length$2]() {
       return this.length;
     }
-    [__delete__](index_OR_name) {
-      return this.__delete__(index_OR_name);
+    [__delete__](...args) {
+      return this.__delete__.apply(this, args);
     }
-    [__getter__](index_OR_name) {
-      return this.__getter__(index_OR_name);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [__setter__](index_OR_name, value) {
-      return this.__setter__(index_OR_name, value);
+    [__setter__](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [_clear$1]() {
-      return this.clear();
+    [_clear$1](...args) {
+      return this.clear.apply(this, args);
     }
-    [_getItem](key) {
-      return this.getItem(key);
+    [_getItem](...args) {
+      return this.getItem.apply(this, args);
     }
-    [_key](index) {
-      return this.key(index);
+    [_key](...args) {
+      return this.key.apply(this, args);
     }
-    [_removeItem](key) {
-      return this.removeItem(key);
+    [_removeItem](...args) {
+      return this.removeItem.apply(this, args);
     }
-    [_setItem](key, data) {
-      return this.setItem(key, data);
+    [_setItem](...args) {
+      return this.setItem.apply(this, args);
     }
   };
   html$.Storage[dart.implements] = () => [MapOfString$String()];
@@ -71563,8 +73223,8 @@
       [dartx.addAll]: dart.definiteFunctionType(dart.void, [MapOfString$String()]),
       [dartx.containsValue]: dart.definiteFunctionType(core.bool, [core.Object]),
       [dartx.containsKey]: dart.definiteFunctionType(core.bool, [core.Object]),
-      [dartx.get]: dart.definiteFunctionType(core.String, [core.Object]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.String, core.String]),
+      [dartx._get]: dart.definiteFunctionType(core.String, [core.Object]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.String, core.String]),
       [dartx.putIfAbsent]: dart.definiteFunctionType(core.String, [core.String, VoidToString()]),
       [dartx.remove]: dart.definiteFunctionType(core.String, [core.Object]),
       [dartx.clear]: dart.definiteFunctionType(dart.void, []),
@@ -71631,8 +73291,8 @@
     get [dartx.url]() {
       return this.url;
     }
-    [_initStorageEvent](typeArg, canBubbleArg, cancelableArg, keyArg, oldValueArg, newValueArg, urlArg, storageAreaArg) {
-      return this.initStorageEvent(typeArg, canBubbleArg, cancelableArg, keyArg, oldValueArg, newValueArg, urlArg, storageAreaArg);
+    [_initStorageEvent](...args) {
+      return this.initStorageEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.StorageEvent, {
@@ -71690,11 +73350,11 @@
     get [dartx.supportedTypes]() {
       return this.supportedTypes;
     }
-    [dartx.queryInfo](type) {
-      return this.queryInfo(type);
+    [dartx.queryInfo](...args) {
+      return this.queryInfo.apply(this, args);
     }
-    [dartx.requestPersistentQuota](newQuota) {
-      return this.requestPersistentQuota(newQuota);
+    [dartx.requestPersistentQuota](...args) {
+      return this.requestPersistentQuota.apply(this, args);
     }
   };
   dart.setSignature(html$.StorageQuota, {
@@ -71777,8 +73437,8 @@
     get [dartx.type]() {
       return this.type;
     }
-    [dartx.matchMedium](mediaquery) {
-      return this.matchMedium(mediaquery);
+    [dartx.matchMedium](...args) {
+      return this.matchMedium.apply(this, args);
     }
   };
   dart.setSignature(html$.StyleMedia, {
@@ -71825,14 +73485,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getRegistration](tag) {
-      return this.getRegistration(tag);
+    [dartx.getRegistration](...args) {
+      return this.getRegistration.apply(this, args);
     }
-    [dartx.getRegistrations]() {
-      return this.getRegistrations();
+    [dartx.getRegistrations](...args) {
+      return this.getRegistrations.apply(this, args);
     }
-    [dartx.permissionState]() {
-      return this.permissionState();
+    [dartx.permissionState](...args) {
+      return this.permissionState.apply(this, args);
     }
     [dartx.register](options) {
       if (options === void 0) options = null;
@@ -71842,11 +73502,11 @@
       }
       return this[_register_2]();
     }
-    [_register_1](options) {
-      return this.register(options);
+    [_register_1](...args) {
+      return this.register.apply(this, args);
     }
-    [_register_2]() {
-      return this.register();
+    [_register_2](...args) {
+      return this.register.apply(this, args);
     }
   };
   dart.setSignature(html$.SyncManager, {
@@ -71872,8 +73532,8 @@
     get [dartx.tag]() {
       return this.tag;
     }
-    [dartx.unregister]() {
-      return this.unregister();
+    [dartx.unregister](...args) {
+      return this.unregister.apply(this, args);
     }
   };
   dart.setSignature(html$.SyncRegistration, {
@@ -71959,6 +73619,8 @@
     })
   });
   dart.registerExtension(dart.global.HTMLTableCellElement, html$.TableCellElement);
+  dart.registerExtension(dart.global.HTMLTableDataCellElement, html$.TableCellElement);
+  dart.registerExtension(dart.global.HTMLTableHeaderCellElement, html$.TableCellElement);
   dart.defineExtensionNames([
     'span'
   ]);
@@ -72049,8 +73711,8 @@
       this[dartx.children][dartx.add](tbody);
       return html$.TableSectionElement._check(tbody);
     }
-    [_nativeCreateTBody]() {
-      return this.createTBody();
+    [_nativeCreateTBody](...args) {
+      return this.createTBody.apply(this, args);
     }
     [dartx.createFragment](html, opts) {
       let validator = opts && 'validator' in opts ? opts.validator : null;
@@ -72102,29 +73764,29 @@
     set [dartx.tHead](value) {
       this.tHead = value;
     }
-    [_createCaption]() {
-      return this.createCaption();
+    [_createCaption](...args) {
+      return this.createCaption.apply(this, args);
     }
-    [_createTFoot]() {
-      return this.createTFoot();
+    [_createTFoot](...args) {
+      return this.createTFoot.apply(this, args);
     }
-    [_createTHead]() {
-      return this.createTHead();
+    [_createTHead](...args) {
+      return this.createTHead.apply(this, args);
     }
-    [dartx.deleteCaption]() {
-      return this.deleteCaption();
+    [dartx.deleteCaption](...args) {
+      return this.deleteCaption.apply(this, args);
     }
-    [dartx.deleteRow](index) {
-      return this.deleteRow(index);
+    [dartx.deleteRow](...args) {
+      return this.deleteRow.apply(this, args);
     }
-    [dartx.deleteTFoot]() {
-      return this.deleteTFoot();
+    [dartx.deleteTFoot](...args) {
+      return this.deleteTFoot.apply(this, args);
     }
-    [dartx.deleteTHead]() {
-      return this.deleteTHead();
+    [dartx.deleteTHead](...args) {
+      return this.deleteTHead.apply(this, args);
     }
-    [_insertRow](index) {
-      return this.insertRow(index);
+    [_insertRow](...args) {
+      return this.insertRow.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.TableElement, 'created');
@@ -72219,11 +73881,11 @@
     get [dartx.sectionRowIndex]() {
       return this.sectionRowIndex;
     }
-    [dartx.deleteCell](index) {
-      return this.deleteCell(index);
+    [dartx.deleteCell](...args) {
+      return this.deleteCell.apply(this, args);
     }
-    [_insertCell](index) {
-      return this.insertCell(index);
+    [_insertCell](...args) {
+      return this.insertCell.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.TableRowElement, 'created');
@@ -72285,11 +73947,11 @@
     get [_rows]() {
       return this.rows;
     }
-    [dartx.deleteRow](index) {
-      return this.deleteRow(index);
+    [dartx.deleteRow](...args) {
+      return this.deleteRow.apply(this, args);
     }
-    [_insertRow](index) {
-      return this.insertRow(index);
+    [_insertRow](...args) {
+      return this.insertRow.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.TableSectionElement, 'created');
@@ -72553,23 +74215,23 @@
     set [dartx.wrap](value) {
       this.wrap = value;
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.select]() {
-      return this.select();
+    [dartx.select](...args) {
+      return this.select.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
-    [dartx.setRangeText](replacement, opts) {
-      return this.setRangeText(replacement, opts);
+    [dartx.setRangeText](...args) {
+      return this.setRangeText.apply(this, args);
     }
-    [dartx.setSelectionRange](start, end, direction) {
-      return this.setSelectionRange(start, end, direction);
+    [dartx.setSelectionRange](...args) {
+      return this.setSelectionRange.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.TextAreaElement, 'created');
@@ -72640,8 +74302,8 @@
     get [dartx.data]() {
       return this.data;
     }
-    [_initTextEvent](typeArg, canBubbleArg, cancelableArg, viewArg, dataArg) {
-      return this.initTextEvent(typeArg, canBubbleArg, cancelableArg, viewArg, dataArg);
+    [_initTextEvent](...args) {
+      return this.initTextEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.TextEvent, {
@@ -72772,17 +74434,17 @@
     get [dartx.regions]() {
       return this.regions;
     }
-    [dartx.addCue](cue) {
-      return this.addCue(cue);
+    [dartx.addCue](...args) {
+      return this.addCue.apply(this, args);
     }
-    [dartx.addRegion](region) {
-      return this.addRegion(region);
+    [dartx.addRegion](...args) {
+      return this.addRegion.apply(this, args);
     }
-    [dartx.removeCue](cue) {
-      return this.removeCue(cue);
+    [dartx.removeCue](...args) {
+      return this.removeCue.apply(this, args);
     }
-    [dartx.removeRegion](region) {
-      return this.removeRegion(region);
+    [dartx.removeRegion](...args) {
+      return this.removeRegion.apply(this, args);
     }
     get [dartx.onCueChange]() {
       return html$.TextTrack.cueChangeEvent.forTarget(this);
@@ -72891,8 +74553,8 @@
   dart.registerExtension(dart.global.TextTrackCue, html$.TextTrackCue);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -72908,11 +74570,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -72941,13 +74603,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.getCueById](id) {
-      return this.getCueById(id);
+    [dartx.getCueById](...args) {
+      return this.getCueById.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$.TextTrackCueList[dart.implements] = () => [ListOfTextTrackCue(), _js_helper.JavaScriptIndexingBehavior];
@@ -72961,8 +74623,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.TextTrackCue, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.TextTrackCue]),
+      [dartx._get]: dart.definiteFunctionType(html$.TextTrackCue, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.TextTrackCue]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.TextTrackCue, [core.int]),
       [dartx.getCueById]: dart.definiteFunctionType(html$.TextTrackCue, [core.String]),
       [dartx.item]: dart.definiteFunctionType(html$.TextTrackCue, [core.int])
@@ -72971,8 +74633,8 @@
   dart.registerExtension(dart.global.TextTrackCueList, html$.TextTrackCueList);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -72990,11 +74652,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -73023,13 +74685,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.getTrackById](id) {
-      return this.getTrackById(id);
+    [dartx.getTrackById](...args) {
+      return this.getTrackById.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
     get [dartx.onAddTrack]() {
       return html$.TextTrackList.addTrackEvent.forTarget(this);
@@ -73051,8 +74713,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.TextTrack, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.TextTrack]),
+      [dartx._get]: dart.definiteFunctionType(html$.TextTrack, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.TextTrack]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.TextTrack, [core.int]),
       [dartx.getTrackById]: dart.definiteFunctionType(html$.TextTrack, [core.String]),
       [dartx.item]: dart.definiteFunctionType(html$.TextTrack, [core.int])
@@ -73083,11 +74745,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.end](index) {
-      return this.end(index);
+    [dartx.end](...args) {
+      return this.end.apply(this, args);
     }
-    [dartx.start](index) {
-      return this.start(index);
+    [dartx.start](...args) {
+      return this.start.apply(this, args);
     }
   };
   dart.setSignature(html$.TimeRanges, {
@@ -73310,8 +74972,8 @@
     get [dartx.touches]() {
       return this.touches;
     }
-    [_initTouchEvent](touches, targetTouches, changedTouches, type, view, unused1, unused2, unused3, unused4, ctrlKey, altKey, shiftKey, metaKey) {
-      return this.initTouchEvent(touches, targetTouches, changedTouches, type, view, unused1, unused2, unused3, unused4, ctrlKey, altKey, shiftKey, metaKey);
+    [_initTouchEvent](...args) {
+      return this.initTouchEvent.apply(this, args);
     }
     static get supported() {
       return html_common.Device.isEventTypeSupported('TouchEvent');
@@ -73337,8 +74999,8 @@
   dart.registerExtension(dart.global.TouchEvent, html$.TouchEvent);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -73359,11 +75021,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -73392,10 +75054,10 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$.TouchList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfTouch()];
@@ -73412,8 +75074,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.Touch, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.Touch]),
+      [dartx._get]: dart.definiteFunctionType(html$.Touch, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.Touch]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.Touch, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.Touch, [core.int])
     }),
@@ -73505,8 +75167,8 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   dart.setSignature(html$.TrackDefaultList, {
@@ -73706,6 +75368,7 @@
     names: ['_create_1', '_create_2']
   });
   dart.registerExtension(dart.global.TransitionEvent, html$.TransitionEvent);
+  dart.registerExtension(dart.global.WebKitTransitionEvent, html$.TransitionEvent);
   dart.defineExtensionNames([
     'firstChild',
     'lastChild',
@@ -73741,26 +75404,26 @@
     get [dartx.whatToShow]() {
       return this.whatToShow;
     }
-    [dartx.firstChild]() {
-      return this.firstChild();
+    [dartx.firstChild](...args) {
+      return this.firstChild.apply(this, args);
     }
-    [dartx.lastChild]() {
-      return this.lastChild();
+    [dartx.lastChild](...args) {
+      return this.lastChild.apply(this, args);
     }
-    [dartx.nextNode]() {
-      return this.nextNode();
+    [dartx.nextNode](...args) {
+      return this.nextNode.apply(this, args);
     }
-    [dartx.nextSibling]() {
-      return this.nextSibling();
+    [dartx.nextSibling](...args) {
+      return this.nextSibling.apply(this, args);
     }
-    [dartx.parentNode]() {
-      return this.parentNode();
+    [dartx.parentNode](...args) {
+      return this.parentNode.apply(this, args);
     }
-    [dartx.previousNode]() {
-      return this.previousNode();
+    [dartx.previousNode](...args) {
+      return this.previousNode.apply(this, args);
     }
-    [dartx.previousSibling]() {
-      return this.previousSibling();
+    [dartx.previousSibling](...args) {
+      return this.previousSibling.apply(this, args);
     }
   };
   dart.setSignature(html$.TreeWalker, {
@@ -73964,7 +75627,84 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get hash() {
+      return this[hash];
+    }
+    set hash(value) {
+      this[hash] = value;
+    }
+    get host() {
+      return this[host];
+    }
+    set host(value) {
+      this[host] = value;
+    }
+    get hostname() {
+      return this[hostname];
+    }
+    set hostname(value) {
+      this[hostname] = value;
+    }
+    get href() {
+      return this[href];
+    }
+    set href(value) {
+      this[href] = value;
+    }
+    get origin() {
+      return this[origin];
+    }
+    set origin(value) {
+      super.origin = value;
+    }
+    get password() {
+      return this[password];
+    }
+    set password(value) {
+      this[password] = value;
+    }
+    get pathname() {
+      return this[pathname];
+    }
+    set pathname(value) {
+      this[pathname] = value;
+    }
+    get port() {
+      return this[port];
+    }
+    set port(value) {
+      this[port] = value;
+    }
+    get protocol() {
+      return this[protocol];
+    }
+    set protocol(value) {
+      this[protocol] = value;
+    }
+    get search() {
+      return this[search];
+    }
+    set search(value) {
+      this[search] = value;
+    }
+    get username() {
+      return this[username];
+    }
+    set username(value) {
+      this[username] = value;
+    }
   };
+  const hash = Symbol(html$.UrlUtils.name + "." + 'hash'.toString());
+  const host = Symbol(html$.UrlUtils.name + "." + 'host'.toString());
+  const hostname = Symbol(html$.UrlUtils.name + "." + 'hostname'.toString());
+  const href = Symbol(html$.UrlUtils.name + "." + 'href'.toString());
+  const origin = Symbol(html$.UrlUtils.name + "." + 'origin'.toString());
+  const password = Symbol(html$.UrlUtils.name + "." + 'password'.toString());
+  const pathname = Symbol(html$.UrlUtils.name + "." + 'pathname'.toString());
+  const port = Symbol(html$.UrlUtils.name + "." + 'port'.toString());
+  const protocol = Symbol(html$.UrlUtils.name + "." + 'protocol'.toString());
+  const search = Symbol(html$.UrlUtils.name + "." + 'search'.toString());
+  const username = Symbol(html$.UrlUtils.name + "." + 'username'.toString());
   dart.setSignature(html$.UrlUtils, {
     constructors: () => ({_: dart.definiteFunctionType(html$.UrlUtils, [])}),
     fields: () => ({
@@ -74019,7 +75759,70 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get hash() {
+      return this[hash$];
+    }
+    set hash(value) {
+      super.hash = value;
+    }
+    get host() {
+      return this[host$];
+    }
+    set host(value) {
+      super.host = value;
+    }
+    get hostname() {
+      return this[hostname$];
+    }
+    set hostname(value) {
+      super.hostname = value;
+    }
+    get href() {
+      return this[href$];
+    }
+    set href(value) {
+      super.href = value;
+    }
+    get origin() {
+      return this[origin$];
+    }
+    set origin(value) {
+      super.origin = value;
+    }
+    get pathname() {
+      return this[pathname$];
+    }
+    set pathname(value) {
+      super.pathname = value;
+    }
+    get port() {
+      return this[port$];
+    }
+    set port(value) {
+      super.port = value;
+    }
+    get protocol() {
+      return this[protocol$];
+    }
+    set protocol(value) {
+      super.protocol = value;
+    }
+    get search() {
+      return this[search$];
+    }
+    set search(value) {
+      super.search = value;
+    }
   };
+  const hash$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'hash'.toString());
+  const host$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'host'.toString());
+  const hostname$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'hostname'.toString());
+  const href$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'href'.toString());
+  const origin$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'origin'.toString());
+  const pathname$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'pathname'.toString());
+  const port$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'port'.toString());
+  const protocol$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'protocol'.toString());
+  const search$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'search'.toString());
   dart.setSignature(html$.UrlUtilsReadOnly, {
     constructors: () => ({_: dart.definiteFunctionType(html$.UrlUtilsReadOnly, [])}),
     fields: () => ({
@@ -74330,14 +76133,14 @@
     set [dartx.width](value) {
       this.width = value;
     }
-    [dartx.getVideoPlaybackQuality]() {
-      return this.getVideoPlaybackQuality();
+    [dartx.getVideoPlaybackQuality](...args) {
+      return this.getVideoPlaybackQuality.apply(this, args);
     }
-    [dartx.enterFullscreen]() {
-      return this.webkitEnterFullscreen();
+    [dartx.enterFullscreen](...args) {
+      return this.webkitEnterFullscreen.apply(this, args);
     }
-    [dartx.exitFullscreen]() {
-      return this.webkitExitFullscreen();
+    [dartx.exitFullscreen](...args) {
+      return this.webkitExitFullscreen.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.VideoElement, 'created');
@@ -74454,11 +76257,11 @@
     get [dartx.selectedIndex]() {
       return this.selectedIndex;
     }
-    [__getter__](index) {
-      return this.__getter__(index);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.getTrackById](id) {
-      return this.getTrackById(id);
+    [dartx.getTrackById](...args) {
+      return this.getTrackById.apply(this, args);
     }
     get [dartx.onChange]() {
       return html$.VideoTrackList.changeEvent.forTarget(this);
@@ -74553,8 +76356,8 @@
     set [dartx.vertical](value) {
       this.vertical = value;
     }
-    [dartx.getCueAsHtml]() {
-      return this.getCueAsHTML();
+    [dartx.getCueAsHtml](...args) {
+      return this.getCueAsHTML.apply(this, args);
     }
   };
   dart.setSignature(html$.VttCue, {
@@ -74682,11 +76485,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.getRegionById](id) {
-      return this.getRegionById(id);
+    [dartx.getRegionById](...args) {
+      return this.getRegionById.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   dart.setSignature(html$.VttRegionList, {
@@ -74757,23 +76560,23 @@
     get [dartx.url]() {
       return this.url;
     }
-    [dartx.close](code, reason) {
-      return this.close(code, reason);
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.send](data) {
-      return this.send(data);
+    [dartx.send](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendBlob](data) {
-      return this.send(data);
+    [dartx.sendBlob](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendByteBuffer](data) {
-      return this.send(data);
+    [dartx.sendByteBuffer](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendString](data) {
-      return this.send(data);
+    [dartx.sendString](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendTypedData](data) {
-      return this.send(data);
+    [dartx.sendTypedData](...args) {
+      return this.send.apply(this, args);
     }
     get [dartx.onClose]() {
       return html$.WebSocket.closeEvent.forTarget(this);
@@ -74944,14 +76747,14 @@
     get [_hasInitMouseScrollEvent]() {
       return !!this.initMouseScrollEvent;
     }
-    [_initMouseScrollEvent](type, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, axis) {
-      return this.initMouseScrollEvent(type, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, axis);
+    [_initMouseScrollEvent](...args) {
+      return this.initMouseScrollEvent.apply(this, args);
     }
     get [_hasInitWheelEvent]() {
       return !!this.initWheelEvent;
     }
-    [_initWheelEvent](eventType, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, button, relatedTarget, modifiersList, deltaX, deltaY, deltaZ, deltaMode) {
-      return this.initWheelEvent(eventType, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, button, relatedTarget, modifiersList, deltaX, deltaY, deltaZ, deltaMode);
+    [_initWheelEvent](...args) {
+      return this.initWheelEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.WheelEvent, {
@@ -75213,11 +77016,11 @@
       this[_ensureRequestAnimationFrame]();
       this[_cancelAnimationFrame](id);
     }
-    [_requestAnimationFrame](callback) {
-      return this.requestAnimationFrame(callback);
+    [_requestAnimationFrame](...args) {
+      return this.requestAnimationFrame.apply(this, args);
     }
-    [_cancelAnimationFrame](id) {
-      return this.cancelAnimationFrame(id);
+    [_cancelAnimationFrame](...args) {
+      return this.cancelAnimationFrame.apply(this, args);
     }
     [_ensureRequestAnimationFrame]() {
       if (!!(this.requestAnimationFrame && this.cancelAnimationFrame)) return;
@@ -75410,20 +77213,20 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [__getter___1](index) {
-      return this.__getter__(index);
+    [__getter___1](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [__getter___2](name) {
-      return this.__getter__(name);
+    [__getter___2](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.alert](message) {
-      return this.alert(message);
+    [dartx.alert](...args) {
+      return this.alert.apply(this, args);
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.confirm](message) {
-      return this.confirm(message);
+    [dartx.confirm](...args) {
+      return this.confirm.apply(this, args);
     }
     [dartx.fetch](input, init) {
       if (init === void 0) init = null;
@@ -75433,35 +77236,35 @@
       }
       return this[_fetch_2](input);
     }
-    [_fetch_1](input, init) {
-      return this.fetch(input, init);
+    [_fetch_1](...args) {
+      return this.fetch.apply(this, args);
     }
-    [_fetch_2](input) {
-      return this.fetch(input);
+    [_fetch_2](...args) {
+      return this.fetch.apply(this, args);
     }
-    [dartx.find](string, caseSensitive, backwards, wrap, wholeWord, searchInFrames, showDialog) {
-      return this.find(string, caseSensitive, backwards, wrap, wholeWord, searchInFrames, showDialog);
+    [dartx.find](...args) {
+      return this.find.apply(this, args);
     }
-    [_getComputedStyle](elt, pseudoElt) {
-      return this.getComputedStyle(elt, pseudoElt);
+    [_getComputedStyle](...args) {
+      return this.getComputedStyle.apply(this, args);
     }
-    [dartx.getMatchedCssRules](element, pseudoElement) {
-      return this.getMatchedCSSRules(element, pseudoElement);
+    [dartx.getMatchedCssRules](...args) {
+      return this.getMatchedCSSRules.apply(this, args);
     }
-    [dartx.getSelection]() {
-      return this.getSelection();
+    [dartx.getSelection](...args) {
+      return this.getSelection.apply(this, args);
     }
-    [dartx.matchMedia](query) {
-      return this.matchMedia(query);
+    [dartx.matchMedia](...args) {
+      return this.matchMedia.apply(this, args);
     }
-    [dartx.moveBy](x, y) {
-      return this.moveBy(x, y);
+    [dartx.moveBy](...args) {
+      return this.moveBy.apply(this, args);
     }
-    [_moveTo](x, y) {
-      return this.moveTo(x, y);
+    [_moveTo](...args) {
+      return this.moveTo.apply(this, args);
     }
-    [dartx.openDatabase](name, version, displayName, estimatedSize, creationCallback) {
-      return this.openDatabase(name, version, displayName, estimatedSize, creationCallback);
+    [dartx.openDatabase](...args) {
+      return this.openDatabase.apply(this, args);
     }
     [dartx.postMessage](message, targetOrigin, transfer) {
       if (transfer === void 0) transfer = null;
@@ -75474,20 +77277,20 @@
       this[_postMessage_2](message_1, targetOrigin);
       return;
     }
-    [_postMessage_1](message, targetOrigin, transfer) {
-      return this.postMessage(message, targetOrigin, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message, targetOrigin) {
-      return this.postMessage(message, targetOrigin);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [dartx.print]() {
-      return this.print();
+    [dartx.print](...args) {
+      return this.print.apply(this, args);
     }
-    [dartx.resizeBy](x, y) {
-      return this.resizeBy(x, y);
+    [dartx.resizeBy](...args) {
+      return this.resizeBy.apply(this, args);
     }
-    [dartx.resizeTo](x, y) {
-      return this.resizeTo(x, y);
+    [dartx.resizeTo](...args) {
+      return this.resizeTo.apply(this, args);
     }
     [dartx.scroll](options_OR_x, y, scrollOptions) {
       if (options_OR_x === void 0) options_OR_x = null;
@@ -75517,20 +77320,20 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_scroll_1]() {
-      return this.scroll();
+    [_scroll_1](...args) {
+      return this.scroll.apply(this, args);
     }
-    [_scroll_2](options) {
-      return this.scroll(options);
+    [_scroll_2](...args) {
+      return this.scroll.apply(this, args);
     }
-    [_scroll_3](x, y) {
-      return this.scroll(x, y);
+    [_scroll_3](...args) {
+      return this.scroll.apply(this, args);
     }
-    [_scroll_4](x, y) {
-      return this.scroll(x, y);
+    [_scroll_4](...args) {
+      return this.scroll.apply(this, args);
     }
-    [_scroll_5](x, y, scrollOptions) {
-      return this.scroll(x, y, scrollOptions);
+    [_scroll_5](...args) {
+      return this.scroll.apply(this, args);
     }
     [dartx.scrollBy](options_OR_x, y, scrollOptions) {
       if (options_OR_x === void 0) options_OR_x = null;
@@ -75560,20 +77363,20 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_scrollBy_1]() {
-      return this.scrollBy();
+    [_scrollBy_1](...args) {
+      return this.scrollBy.apply(this, args);
     }
-    [_scrollBy_2](options) {
-      return this.scrollBy(options);
+    [_scrollBy_2](...args) {
+      return this.scrollBy.apply(this, args);
     }
-    [_scrollBy_3](x, y) {
-      return this.scrollBy(x, y);
+    [_scrollBy_3](...args) {
+      return this.scrollBy.apply(this, args);
     }
-    [_scrollBy_4](x, y) {
-      return this.scrollBy(x, y);
+    [_scrollBy_4](...args) {
+      return this.scrollBy.apply(this, args);
     }
-    [_scrollBy_5](x, y, scrollOptions) {
-      return this.scrollBy(x, y, scrollOptions);
+    [_scrollBy_5](...args) {
+      return this.scrollBy.apply(this, args);
     }
     [dartx.scrollTo](options_OR_x, y, scrollOptions) {
       if (options_OR_x === void 0) options_OR_x = null;
@@ -75603,26 +77406,26 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_scrollTo_1]() {
-      return this.scrollTo();
+    [_scrollTo_1](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [_scrollTo_2](options) {
-      return this.scrollTo(options);
+    [_scrollTo_2](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [_scrollTo_3](x, y) {
-      return this.scrollTo(x, y);
+    [_scrollTo_3](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [_scrollTo_4](x, y) {
-      return this.scrollTo(x, y);
+    [_scrollTo_4](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [_scrollTo_5](x, y, scrollOptions) {
-      return this.scrollTo(x, y, scrollOptions);
+    [_scrollTo_5](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [dartx.stop]() {
-      return this.stop();
+    [dartx.stop](...args) {
+      return this.stop.apply(this, args);
     }
-    [__requestFileSystem](type, size, successCallback, errorCallback) {
-      return this.webkitRequestFileSystem(type, size, successCallback, errorCallback);
+    [__requestFileSystem](...args) {
+      return this.webkitRequestFileSystem.apply(this, args);
     }
     [_requestFileSystem](type, size) {
       let completer = CompleterOfFileSystem().new();
@@ -75633,8 +77436,8 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [_resolveLocalFileSystemUrl](url, successCallback, errorCallback) {
-      return this.webkitResolveLocalFileSystemURL(url, successCallback, errorCallback);
+    [_resolveLocalFileSystemUrl](...args) {
+      return this.webkitResolveLocalFileSystemURL.apply(this, args);
     }
     [dartx.resolveLocalFileSystemUrl](url) {
       let completer = CompleterOfEntry().new();
@@ -75645,29 +77448,29 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [dartx.atob](atob) {
-      return this.atob(atob);
+    [dartx.atob](...args) {
+      return this.atob.apply(this, args);
     }
-    [dartx.btoa](btoa) {
-      return this.btoa(btoa);
+    [dartx.btoa](...args) {
+      return this.btoa.apply(this, args);
     }
-    [_setInterval_String](handler, timeout, arguments$) {
-      return this.setInterval(handler, timeout, arguments$);
+    [_setInterval_String](...args) {
+      return this.setInterval.apply(this, args);
     }
-    [_setTimeout_String](handler, timeout, arguments$) {
-      return this.setTimeout(handler, timeout, arguments$);
+    [_setTimeout_String](...args) {
+      return this.setTimeout.apply(this, args);
     }
-    [_clearInterval](handle) {
-      return this.clearInterval(handle);
+    [_clearInterval](...args) {
+      return this.clearInterval.apply(this, args);
     }
-    [_clearTimeout](handle) {
-      return this.clearTimeout(handle);
+    [_clearTimeout](...args) {
+      return this.clearTimeout.apply(this, args);
     }
-    [_setInterval](handler, timeout) {
-      return this.setInterval(handler, timeout);
+    [_setInterval](...args) {
+      return this.setInterval.apply(this, args);
     }
-    [_setTimeout](handler, timeout) {
-      return this.setTimeout(handler, timeout);
+    [_setTimeout](...args) {
+      return this.setTimeout.apply(this, args);
     }
     get [dartx.onContentLoaded]() {
       return html$.Window.contentLoadedEvent.forTarget(this);
@@ -76204,6 +78007,7 @@
     }
   });
   dart.registerExtension(dart.global.Window, html$.Window);
+  dart.registerExtension(dart.global.DOMWindow, html$.Window);
   const _returnValue = Symbol('_returnValue');
   html$._WrappedEvent = class _WrappedEvent extends core.Object {
     new(wrapped) {
@@ -76380,8 +78184,8 @@
     get [dartx.visibilityState]() {
       return this.visibilityState;
     }
-    [dartx.focus]() {
-      return this.focus();
+    [dartx.focus](...args) {
+      return this.focus.apply(this, args);
     }
   };
   dart.setSignature(html$.WindowClient, {
@@ -76511,14 +78315,14 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [dartx.terminate]() {
-      return this.terminate();
+    [dartx.terminate](...args) {
+      return this.terminate.apply(this, args);
     }
     get [dartx.onError]() {
       return html$.Worker.errorEvent.forTarget(this);
@@ -76589,35 +78393,35 @@
     get [dartx.memory]() {
       return this.memory;
     }
-    [dartx.clearMarks](markName) {
-      return this.clearMarks(markName);
+    [dartx.clearMarks](...args) {
+      return this.clearMarks.apply(this, args);
     }
-    [dartx.clearMeasures](measureName) {
-      return this.clearMeasures(measureName);
+    [dartx.clearMeasures](...args) {
+      return this.clearMeasures.apply(this, args);
     }
-    [dartx.getEntries]() {
-      return this.getEntries();
+    [dartx.getEntries](...args) {
+      return this.getEntries.apply(this, args);
     }
-    [dartx.getEntriesByName](name, entryType) {
-      return this.getEntriesByName(name, entryType);
+    [dartx.getEntriesByName](...args) {
+      return this.getEntriesByName.apply(this, args);
     }
-    [dartx.getEntriesByType](entryType) {
-      return this.getEntriesByType(entryType);
+    [dartx.getEntriesByType](...args) {
+      return this.getEntriesByType.apply(this, args);
     }
-    [dartx.mark](markName) {
-      return this.mark(markName);
+    [dartx.mark](...args) {
+      return this.mark.apply(this, args);
     }
-    [dartx.measure](measureName, startMark, endMark) {
-      return this.measure(measureName, startMark, endMark);
+    [dartx.measure](...args) {
+      return this.measure.apply(this, args);
     }
-    [dartx.now]() {
-      return this.now();
+    [dartx.now](...args) {
+      return this.now.apply(this, args);
     }
-    [dartx.clearResourceTimings]() {
-      return this.webkitClearResourceTimings();
+    [dartx.clearResourceTimings](...args) {
+      return this.webkitClearResourceTimings.apply(this, args);
     }
-    [dartx.setResourceTimingBufferSize](maxSize) {
-      return this.webkitSetResourceTimingBufferSize(maxSize);
+    [dartx.setResourceTimingBufferSize](...args) {
+      return this.webkitSetResourceTimingBufferSize.apply(this, args);
     }
   };
   dart.setSignature(html$.WorkerPerformance, {
@@ -76652,14 +78456,14 @@
     static _create_1() {
       return new XPathEvaluator();
     }
-    [dartx.createExpression](expression, resolver) {
-      return this.createExpression(expression, resolver);
+    [dartx.createExpression](...args) {
+      return this.createExpression.apply(this, args);
     }
-    [dartx.createNSResolver](nodeResolver) {
-      return this.createNSResolver(nodeResolver);
+    [dartx.createNSResolver](...args) {
+      return this.createNSResolver.apply(this, args);
     }
-    [dartx.evaluate](expression, contextNode, resolver, type, inResult) {
-      return this.evaluate(expression, contextNode, resolver, type, inResult);
+    [dartx.evaluate](...args) {
+      return this.evaluate.apply(this, args);
     }
   };
   dart.setSignature(html$.XPathEvaluator, {
@@ -76683,8 +78487,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.evaluate](contextNode, type, inResult) {
-      return this.evaluate(contextNode, type, inResult);
+    [dartx.evaluate](...args) {
+      return this.evaluate.apply(this, args);
     }
   };
   dart.setSignature(html$.XPathExpression, {
@@ -76699,8 +78503,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.lookupNamespaceUri](prefix) {
-      return this.lookupNamespaceURI(prefix);
+    [dartx.lookupNamespaceUri](...args) {
+      return this.lookupNamespaceURI.apply(this, args);
     }
   };
   dart.setSignature(html$.XPathNSResolver, {
@@ -76744,11 +78548,11 @@
     get [dartx.stringValue]() {
       return this.stringValue;
     }
-    [dartx.iterateNext]() {
-      return this.iterateNext();
+    [dartx.iterateNext](...args) {
+      return this.iterateNext.apply(this, args);
     }
-    [dartx.snapshotItem](index) {
-      return this.snapshotItem(index);
+    [dartx.snapshotItem](...args) {
+      return this.snapshotItem.apply(this, args);
     }
   };
   dart.setSignature(html$.XPathResult, {
@@ -76812,8 +78616,8 @@
     static _create_1() {
       return new XMLSerializer();
     }
-    [dartx.serializeToString](root) {
-      return this.serializeToString(root);
+    [dartx.serializeToString](...args) {
+      return this.serializeToString.apply(this, args);
     }
   };
   dart.setSignature(html$.XmlSerializer, {
@@ -76849,29 +78653,29 @@
     static get supported() {
       return !!window.XSLTProcessor;
     }
-    [dartx.clearParameters]() {
-      return this.clearParameters();
+    [dartx.clearParameters](...args) {
+      return this.clearParameters.apply(this, args);
     }
-    [dartx.getParameter](namespaceURI, localName) {
-      return this.getParameter(namespaceURI, localName);
+    [dartx.getParameter](...args) {
+      return this.getParameter.apply(this, args);
     }
-    [dartx.importStylesheet](style) {
-      return this.importStylesheet(style);
+    [dartx.importStylesheet](...args) {
+      return this.importStylesheet.apply(this, args);
     }
-    [dartx.removeParameter](namespaceURI, localName) {
-      return this.removeParameter(namespaceURI, localName);
+    [dartx.removeParameter](...args) {
+      return this.removeParameter.apply(this, args);
     }
-    [dartx.reset]() {
-      return this.reset();
+    [dartx.reset](...args) {
+      return this.reset.apply(this, args);
     }
-    [dartx.setParameter](namespaceURI, localName, value) {
-      return this.setParameter(namespaceURI, localName, value);
+    [dartx.setParameter](...args) {
+      return this.setParameter.apply(this, args);
     }
-    [dartx.transformToDocument](source) {
-      return this.transformToDocument(source);
+    [dartx.transformToDocument](...args) {
+      return this.transformToDocument.apply(this, args);
     }
-    [dartx.transformToFragment](source, output) {
-      return this.transformToFragment(source, output);
+    [dartx.transformToFragment](...args) {
+      return this.transformToFragment.apply(this, args);
     }
   };
   dart.setSignature(html$.XsltProcessor, {
@@ -77085,8 +78889,8 @@
   });
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -77101,11 +78905,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.item](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -77134,13 +78938,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__getter__](index) {
-      return this.__getter__(index);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$._ClientRectList[dart.implements] = () => [ListOfRectangleOfnum()];
@@ -77154,18 +78958,19 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(math.Rectangle$(core.num), [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, RectangleOfnum()]),
+      [dartx._get]: dart.definiteFunctionType(math.Rectangle$(core.num), [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, RectangleOfnum()]),
       [dartx.elementAt]: dart.definiteFunctionType(math.Rectangle$(core.num), [core.int]),
       [__getter__]: dart.definiteFunctionType(math.Rectangle$(core.num), [core.int]),
       [dartx.item]: dart.definiteFunctionType(math.Rectangle$(core.num), [core.int])
     })
   });
   dart.registerExtension(dart.global.ClientRectList, html$._ClientRectList);
+  dart.registerExtension(dart.global.DOMRectList, html$._ClientRectList);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -77180,11 +78985,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -77213,10 +79018,10 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$._CssRuleList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfCssRule()];
@@ -77230,8 +79035,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.CssRule, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.CssRule]),
+      [dartx._get]: dart.definiteFunctionType(html$.CssRule, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.CssRule]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.CssRule, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.CssRule, [core.int])
     })
@@ -77417,8 +79222,8 @@
   dart.registerExtension(dart.global.FileWriterSync, html$._FileWriterSync);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -77433,11 +79238,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -77466,10 +79271,10 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$._GamepadList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfGamepad()];
@@ -77483,8 +79288,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.Gamepad, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.Gamepad]),
+      [dartx._get]: dart.definiteFunctionType(html$.Gamepad, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.Gamepad]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.Gamepad, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.Gamepad, [core.int])
     })
@@ -77494,8 +79299,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [_item](index) {
-      return this.item(index);
+    [_item](...args) {
+      return this.item.apply(this, args);
     }
   };
   dart.setSignature(html$._HTMLAllCollection, {
@@ -77602,8 +79407,8 @@
   dart.registerExtension(dart.global.HTMLMarqueeElement, html$._HTMLMarqueeElement);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -77624,11 +79429,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -77657,28 +79462,28 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.getNamedItem](name) {
-      return this.getNamedItem(name);
+    [dartx.getNamedItem](...args) {
+      return this.getNamedItem.apply(this, args);
     }
-    [dartx.getNamedItemNS](namespaceURI, localName) {
-      return this.getNamedItemNS(namespaceURI, localName);
+    [dartx.getNamedItemNS](...args) {
+      return this.getNamedItemNS.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.removeNamedItem](name) {
-      return this.removeNamedItem(name);
+    [dartx.removeNamedItem](...args) {
+      return this.removeNamedItem.apply(this, args);
     }
-    [dartx.removeNamedItemNS](namespaceURI, localName) {
-      return this.removeNamedItemNS(namespaceURI, localName);
+    [dartx.removeNamedItemNS](...args) {
+      return this.removeNamedItemNS.apply(this, args);
     }
-    [dartx.setNamedItem](attr) {
-      return this.setNamedItem(attr);
+    [dartx.setNamedItem](...args) {
+      return this.setNamedItem.apply(this, args);
     }
-    [dartx.setNamedItemNS](attr) {
-      return this.setNamedItemNS(attr);
+    [dartx.setNamedItemNS](...args) {
+      return this.setNamedItemNS.apply(this, args);
     }
   };
   html$._NamedNodeMap[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfNode()];
@@ -77692,8 +79497,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.Node, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
+      [dartx._get]: dart.definiteFunctionType(html$.Node, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.Node, [core.int]),
       [dartx.getNamedItem]: dart.definiteFunctionType(html$._Attr, [core.String]),
       [dartx.getNamedItemNS]: dart.definiteFunctionType(html$._Attr, [core.String, core.String]),
@@ -77705,6 +79510,7 @@
     })
   });
   dart.registerExtension(dart.global.NamedNodeMap, html$._NamedNodeMap);
+  dart.registerExtension(dart.global.MozNamedAttrMap, html$._NamedNodeMap);
   html$._PagePopupController = class _PagePopupController extends _interceptors.Interceptor {
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
@@ -77759,8 +79565,8 @@
     get [dartx.url]() {
       return this.url;
     }
-    [dartx.clone]() {
-      return this.clone();
+    [dartx.clone](...args) {
+      return this.clone.apply(this, args);
     }
   };
   dart.setSignature(html$._Request, {
@@ -77835,8 +79641,8 @@
   dart.registerExtension(dart.global.ServiceWorker, html$._ServiceWorker);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -77851,11 +79657,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -77884,10 +79690,10 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$._SpeechRecognitionResultList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfSpeechRecognitionResult()];
@@ -77901,8 +79707,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.SpeechRecognitionResult, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.SpeechRecognitionResult]),
+      [dartx._get]: dart.definiteFunctionType(html$.SpeechRecognitionResult, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.SpeechRecognitionResult]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.SpeechRecognitionResult, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.SpeechRecognitionResult, [core.int])
     })
@@ -77910,8 +79716,8 @@
   dart.registerExtension(dart.global.SpeechRecognitionResultList, html$._SpeechRecognitionResultList);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -77926,11 +79732,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -77959,13 +79765,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__getter__](name) {
-      return this.__getter__(name);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$._StyleSheetList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfStyleSheet()];
@@ -77979,8 +79785,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.StyleSheet, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.StyleSheet]),
+      [dartx._get]: dart.definiteFunctionType(html$.StyleSheet, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.StyleSheet]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.StyleSheet, [core.int]),
       [__getter__]: dart.definiteFunctionType(html$.CssStyleSheet, [core.String]),
       [dartx.item]: dart.definiteFunctionType(html$.StyleSheet, [core.int])
@@ -78070,7 +79876,7 @@
     }
     addAll(other) {
       other[dartx.forEach](dart.fn((k, v) => {
-        this.set(k, v);
+        this._set(k, v);
       }, StringAndStringTovoid$()));
     }
     containsValue(value) {
@@ -78083,9 +79889,9 @@
     }
     putIfAbsent(key, ifAbsent) {
       if (!dart.test(this[dartx.containsKey](key))) {
-        this.set(key, ifAbsent());
+        this._set(key, ifAbsent());
       }
-      return this.get(key);
+      return this._get(key);
     }
     clear() {
       for (let key of this.keys) {
@@ -78094,7 +79900,7 @@
     }
     forEach(f) {
       for (let key of this.keys) {
-        let value = this.get(key);
+        let value = this._get(key);
         f(key, value);
       }
     }
@@ -78102,7 +79908,7 @@
       let attributes = this[_element$][_attributes$];
       let keys = JSArrayOfString().of([]);
       for (let i = 0, len = attributes[dartx.length]; i < dart.notNull(len); i++) {
-        let attr = html$._Attr._check(attributes[dartx.get](i));
+        let attr = html$._Attr._check(attributes[dartx._get](i));
         if (dart.test(this[_matches](attr))) {
           keys[dartx.add](attr[dartx.name]);
         }
@@ -78113,7 +79919,7 @@
       let attributes = this[_element$][_attributes$];
       let values = JSArrayOfString().of([]);
       for (let i = 0, len = attributes[dartx.length]; i < dart.notNull(len); i++) {
-        let attr = html$._Attr._check(attributes[dartx.get](i));
+        let attr = html$._Attr._check(attributes[dartx._get](i));
         if (dart.test(this[_matches](attr))) {
           values[dartx.add](attr[dartx.value]);
         }
@@ -78163,10 +79969,10 @@
     containsKey(key) {
       return this[_element$][_hasAttribute](core.String._check(key));
     }
-    get(key) {
+    _get(key) {
       return this[_element$][dartx.getAttribute](core.String._check(key));
     }
-    set(key, value) {
+    _set(key, value) {
       this[_element$][dartx.setAttribute](key, value);
       return value;
     }
@@ -78187,16 +79993,16 @@
     getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
     methods: () => ({
       containsKey: dart.definiteFunctionType(core.bool, [core.Object]),
-      get: dart.definiteFunctionType(core.String, [core.Object]),
-      set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
+      _get: dart.definiteFunctionType(core.String, [core.Object]),
+      _set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
       remove: dart.definiteFunctionType(core.String, [core.Object]),
       [_matches]: dart.definiteFunctionType(core.bool, [html$.Node])
     })
   });
   dart.defineExtensionMembers(html$._ElementAttributeMap, [
     'containsKey',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'remove',
     'length'
   ]);
@@ -78209,15 +80015,15 @@
     containsKey(key) {
       return this[_element$][_hasAttributeNS](this[_namespace], core.String._check(key));
     }
-    get(key) {
+    _get(key) {
       return this[_element$][dartx.getAttributeNS](this[_namespace], core.String._check(key));
     }
-    set(key, value) {
+    _set(key, value) {
       this[_element$][dartx.setAttributeNS](this[_namespace], key, value);
       return value;
     }
     remove(key) {
-      let value = this.get(key);
+      let value = this._get(key);
       this[_element$][_removeAttributeNS](this[_namespace], core.String._check(key));
       return value;
     }
@@ -78234,16 +80040,16 @@
     getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
     methods: () => ({
       containsKey: dart.definiteFunctionType(core.bool, [core.Object]),
-      get: dart.definiteFunctionType(core.String, [core.Object]),
-      set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
+      _get: dart.definiteFunctionType(core.String, [core.Object]),
+      _set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
       remove: dart.definiteFunctionType(core.String, [core.Object]),
       [_matches]: dart.definiteFunctionType(core.bool, [html$.Node])
     })
   });
   dart.defineExtensionMembers(html$._NamespacedAttributeMap, [
     'containsKey',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'remove',
     'length'
   ]);
@@ -78257,7 +80063,7 @@
     }
     addAll(other) {
       other[dartx.forEach](dart.fn((k, v) => {
-        this.set(k, v);
+        this._set(k, v);
       }, StringAndStringTovoid$()));
     }
     containsValue(value) {
@@ -78266,11 +80072,11 @@
     containsKey(key) {
       return this[_attributes$][dartx.containsKey](this[_attr](core.String._check(key)));
     }
-    get(key) {
-      return this[_attributes$][dartx.get](this[_attr](core.String._check(key)));
+    _get(key) {
+      return this[_attributes$][dartx._get](this[_attr](core.String._check(key)));
     }
-    set(key, value) {
-      this[_attributes$][dartx.set](this[_attr](key), value);
+    _set(key, value) {
+      this[_attributes$][dartx._set](this[_attr](key), value);
       return value;
     }
     putIfAbsent(key, ifAbsent) {
@@ -78332,9 +80138,9 @@
       let segments = hyphenedName[dartx.split]('-');
       let start = dart.test(startUppercase) ? 0 : 1;
       for (let i = start; i < dart.notNull(segments[dartx.length]); i++) {
-        let segment = segments[dartx.get](i);
+        let segment = segments[dartx._get](i);
         if (dart.notNull(segment[dartx.length]) > 0) {
-          segments[dartx.set](i, dart.str`${segment[dartx.get](0)[dartx.toUpperCase]()}${segment[dartx.substring](1)}`);
+          segments[dartx._set](i, dart.str`${segment[dartx._get](0)[dartx.toUpperCase]()}${segment[dartx.substring](1)}`);
         }
       }
       return segments[dartx.join]('');
@@ -78342,8 +80148,8 @@
     [_toHyphenedName](word) {
       let sb = new core.StringBuffer();
       for (let i = 0; i < dart.notNull(word[dartx.length]); i++) {
-        let lower = word[dartx.get](i)[dartx.toLowerCase]();
-        if (word[dartx.get](i) != lower && i > 0) sb.write('-');
+        let lower = word[dartx._get](i)[dartx.toLowerCase]();
+        if (word[dartx._get](i) != lower && i > 0) sb.write('-');
         sb.write(lower);
       }
       return sb.toString();
@@ -78364,8 +80170,8 @@
       addAll: dart.definiteFunctionType(dart.void, [MapOfString$String()]),
       containsValue: dart.definiteFunctionType(core.bool, [core.Object]),
       containsKey: dart.definiteFunctionType(core.bool, [core.Object]),
-      get: dart.definiteFunctionType(core.String, [core.Object]),
-      set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
+      _get: dart.definiteFunctionType(core.String, [core.Object]),
+      _set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
       putIfAbsent: dart.definiteFunctionType(core.String, [core.String, VoidToString()]),
       remove: dart.definiteFunctionType(core.String, [core.Object]),
       clear: dart.definiteFunctionType(dart.void, []),
@@ -78381,8 +80187,8 @@
     'addAll',
     'containsValue',
     'containsKey',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'putIfAbsent',
     'remove',
     'clear',
@@ -79194,43 +81000,43 @@
   const _unit = Symbol('_unit');
   html$.Dimension = class Dimension extends core.Object {
     percent(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = '%';
     }
     px(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'px';
     }
     pc(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'pc';
     }
     pt(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'pt';
     }
     inch(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'in';
     }
     cm(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'cm';
     }
     mm(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'mm';
     }
     em(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'em';
     }
     ex(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'ex';
     }
     css(cssValue) {
-      this[_value$0] = null;
+      this[_value$1] = null;
       this[_unit] = null;
       if (cssValue == '') cssValue = '0px';
       if (dart.test(cssValue[dartx.endsWith]('%'))) {
@@ -79239,16 +81045,16 @@
         this[_unit] = cssValue[dartx.substring](dart.notNull(cssValue[dartx.length]) - 2);
       }
       if (dart.test(cssValue[dartx.contains]('.'))) {
-        this[_value$0] = core.double.parse(cssValue[dartx.substring](0, dart.notNull(cssValue[dartx.length]) - dart.notNull(this[_unit][dartx.length])));
+        this[_value$1] = core.double.parse(cssValue[dartx.substring](0, dart.notNull(cssValue[dartx.length]) - dart.notNull(this[_unit][dartx.length])));
       } else {
-        this[_value$0] = core.int.parse(cssValue[dartx.substring](0, dart.notNull(cssValue[dartx.length]) - dart.notNull(this[_unit][dartx.length])));
+        this[_value$1] = core.int.parse(cssValue[dartx.substring](0, dart.notNull(cssValue[dartx.length]) - dart.notNull(this[_unit][dartx.length])));
       }
     }
     toString() {
-      return dart.str`${this[_value$0]}${this[_unit]}`;
+      return dart.str`${this[_value$1]}${this[_unit]}`;
     }
     get value() {
-      return this[_value$0];
+      return this[_value$1];
     }
   };
   dart.defineNamedConstructor(html$.Dimension, 'percent');
@@ -79275,7 +81081,7 @@
       css: dart.definiteFunctionType(html$.Dimension, [core.String])
     }),
     fields: () => ({
-      [_value$0]: core.num,
+      [_value$1]: core.num,
       [_unit]: core.String
     }),
     getters: () => ({value: dart.definiteFunctionType(core.num, [])})
@@ -79928,7 +81734,7 @@
       add(stream) {
         StreamOfT()._check(stream);
         if (dart.test(this[_subscriptions][dartx.containsKey](stream))) return;
-        this[_subscriptions][dartx.set](stream, stream.listen(dart.bind(this[_controller$0], 'add'), {onError: dart.bind(this[_controller$0], 'addError'), onDone: dart.fn(() => this.remove(stream), VoidTovoid$())}));
+        this[_subscriptions][dartx._set](stream, stream.listen(dart.bind(this[_controller$0], 'add'), {onError: dart.bind(this[_controller$0], 'addError'), onDone: dart.fn(() => this.remove(stream), VoidTovoid$())}));
       }
       remove(stream) {
         StreamOfT()._check(stream);
@@ -80012,10 +81818,10 @@
       this.uriPolicy = uriPolicy != null ? uriPolicy : html$.UriPolicy.new();
       if (dart.test(html$._Html5NodeValidator._attributeValidators[dartx.isEmpty])) {
         for (let attr of html$._Html5NodeValidator._standardAttributes) {
-          html$._Html5NodeValidator._attributeValidators[dartx.set](attr, html$._Html5NodeValidator._standardAttributeValidator);
+          html$._Html5NodeValidator._attributeValidators[dartx._set](attr, html$._Html5NodeValidator._standardAttributeValidator);
         }
         for (let attr of html$._Html5NodeValidator._uriAttributes) {
-          html$._Html5NodeValidator._attributeValidators[dartx.set](attr, html$._Html5NodeValidator._uriAttributeValidator);
+          html$._Html5NodeValidator._attributeValidators[dartx._set](attr, html$._Html5NodeValidator._uriAttributeValidator);
         }
       }
     }
@@ -80024,9 +81830,9 @@
     }
     allowsAttribute(element, attributeName, value) {
       let tagName = html$.Element._safeTagName(element);
-      let validator = html$._Html5NodeValidator._attributeValidators[dartx.get](dart.str`${tagName}::${attributeName}`);
+      let validator = html$._Html5NodeValidator._attributeValidators[dartx._get](dart.str`${tagName}::${attributeName}`);
       if (validator == null) {
-        validator = html$._Html5NodeValidator._attributeValidators[dartx.get](dart.str`*::${attributeName}`);
+        validator = html$._Html5NodeValidator._attributeValidators[dartx._get](dart.str`*::${attributeName}`);
       }
       if (validator == null) {
         return false;
@@ -80857,7 +82663,7 @@
         if (prevEvent[_shadowCharCode] == event[dartx.charCode]) {
           return prevEvent.keyCode;
         }
-        if ((dart.test(event[dartx.shiftKey]) || dart.test(this[_capsLockOn])) && dart.notNull(event[dartx.charCode]) >= dart.notNull("A"[dartx.codeUnits][dartx.get](0)) && dart.notNull(event[dartx.charCode]) <= dart.notNull("Z"[dartx.codeUnits][dartx.get](0)) && dart.notNull(event[dartx.charCode]) + dart.notNull(html$._KeyboardEventHandler._ROMAN_ALPHABET_OFFSET) == prevEvent[_shadowCharCode]) {
+        if ((dart.test(event[dartx.shiftKey]) || dart.test(this[_capsLockOn])) && dart.notNull(event[dartx.charCode]) >= dart.notNull("A"[dartx.codeUnits][dartx._get](0)) && dart.notNull(event[dartx.charCode]) <= dart.notNull("Z"[dartx.codeUnits][dartx._get](0)) && dart.notNull(event[dartx.charCode]) + dart.notNull(html$._KeyboardEventHandler._ROMAN_ALPHABET_OFFSET) == prevEvent[_shadowCharCode]) {
           return prevEvent.keyCode;
         }
       }
@@ -81055,7 +82861,7 @@
       }
       e[_shadowKeyCode] = this[_determineKeyCodeForKeypress](e);
       if (e[_shadowKeyIdentifier] != null && dart.test(html$._KeyboardEventHandler._keyIdentifier[dartx.containsKey](e[_shadowKeyIdentifier]))) {
-        e[_shadowKeyCode] = html$._KeyboardEventHandler._keyIdentifier[dartx.get](e[_shadowKeyIdentifier]);
+        e[_shadowKeyCode] = html$._KeyboardEventHandler._keyIdentifier[dartx._get](e[_shadowKeyIdentifier]);
       }
       e[_shadowAltKey] = this[_keyDownList][dartx.any](dart.fn(element => element.altKey, KeyEventTobool()));
       this[_stream$].add(e);
@@ -81110,7 +82916,7 @@
   html$._KeyboardEventHandler._keyIdentifier = dart.const(dart.map({Up: html$.KeyCode.UP, Down: html$.KeyCode.DOWN, Left: html$.KeyCode.LEFT, Right: html$.KeyCode.RIGHT, Enter: html$.KeyCode.ENTER, F1: html$.KeyCode.F1, F2: html$.KeyCode.F2, F3: html$.KeyCode.F3, F4: html$.KeyCode.F4, F5: html$.KeyCode.F5, F6: html$.KeyCode.F6, F7: html$.KeyCode.F7, F8: html$.KeyCode.F8, F9: html$.KeyCode.F9, F10: html$.KeyCode.F10, F11: html$.KeyCode.F11, F12: html$.KeyCode.F12, 'U+007F': html$.KeyCode.DELETE, Home: html$.KeyCode.HOME, End: html$.KeyCode.END, PageUp: html$.KeyCode.PAGE_UP, PageDown: html$.KeyCode.PAGE_DOWN, Insert: html$.KeyCode.INSERT}, core.String, core.int));
   dart.defineLazy(html$._KeyboardEventHandler, {
     get _ROMAN_ALPHABET_OFFSET() {
-      return dart.notNull("a"[dartx.codeUnits][dartx.get](0)) - dart.notNull("A"[dartx.codeUnits][dartx.get](0));
+      return dart.notNull("a"[dartx.codeUnits][dartx._get](0)) - dart.notNull("A"[dartx.codeUnits][dartx._get](0));
     }
   });
   html$.KeyboardEventStream = class KeyboardEventStream extends core.Object {
@@ -81328,7 +83134,7 @@
     }
     allowsElement(element) {
       if (dart.test(this.allowTypeExtension)) {
-        let isAttr = element[dartx.attributes][dartx.get]('is');
+        let isAttr = element[dartx.attributes][dartx._get]('is');
         if (isAttr != null) {
           return dart.test(this.allowedElements.contains(isAttr[dartx.toUpperCase]())) && dart.test(this.allowedElements.contains(html$.Element._safeTagName(element)));
         }
@@ -81365,7 +83171,7 @@
       if (attributeName == 'template' && value == "") {
         return true;
       }
-      if (element[dartx.attributes][dartx.get]('template') == "") {
+      if (element[dartx.attributes][dartx._get]('template') == "") {
         return this[_templateAttrs].contains(attributeName);
       }
       return false;
@@ -81440,12 +83246,12 @@
       clear() {
         this[_list$][dartx.clear]();
       }
-      get(index) {
-        return html$._downcast(html$.Node, E)(this[_list$][dartx.get](index));
+      _get(index) {
+        return html$._downcast(html$.Node, E)(this[_list$][dartx._get](index));
       }
-      set(index, value) {
+      _set(index, value) {
         E._check(value);
-        this[_list$][dartx.set](index, value);
+        this[_list$][dartx._set](index, value);
         return value;
       }
       set length(newLength) {
@@ -81503,8 +83309,8 @@
       setters: () => ({length: dart.definiteFunctionType(dart.void, [core.int])}),
       methods: () => ({
         add: dart.definiteFunctionType(dart.void, [E]),
-        get: dart.definiteFunctionType(E, [core.int]),
-        set: dart.definiteFunctionType(dart.void, [core.int, E]),
+        _get: dart.definiteFunctionType(E, [core.int]),
+        _set: dart.definiteFunctionType(dart.void, [core.int, E]),
         sort: dart.definiteFunctionType(dart.void, [], [EAndEToint()]),
         insert: dart.definiteFunctionType(dart.void, [core.int, E]),
         removeAt: dart.definiteFunctionType(E, [core.int]),
@@ -81517,8 +83323,8 @@
       'add',
       'remove',
       'clear',
-      'get',
-      'set',
+      '_get',
+      '_set',
       'sort',
       'indexOf',
       'lastIndexOf',
@@ -81599,7 +83405,7 @@
       moveNext() {
         let nextPosition = dart.notNull(this[_position$0]) + 1;
         if (nextPosition < dart.notNull(this[_length$2])) {
-          this[_current$4] = this[_array][dartx.get](nextPosition);
+          this[_current$4] = this[_array][dartx._get](nextPosition);
           this[_position$0] = nextPosition;
           return true;
         }
@@ -81639,7 +83445,7 @@
       moveNext() {
         let nextPosition = dart.notNull(this[_position$0]) + 1;
         if (nextPosition < dart.notNull(this[_array][dartx.length])) {
-          this[_current$4] = this[_array][dartx.get](nextPosition);
+          this[_current$4] = this[_array][dartx._get](nextPosition);
           this[_position$0] = nextPosition;
           return true;
         }
@@ -82224,9 +84030,9 @@
       }
       let keys = attrs[dartx.keys][dartx.toList]();
       for (let i = dart.notNull(attrs[dartx.length]) - 1; i >= 0; --i) {
-        let name = keys[dartx.get](i);
-        if (!dart.test(this.validator.allowsAttribute(element, core.String._check(dart.dsend(name, 'toLowerCase')), core.String._check(attrs[dartx.get](name))))) {
-          html$.window[dartx.console].warn('Removing disallowed attribute ' + dart.str`<${tag} ${name}="${attrs[dartx.get](name)}">`);
+        let name = keys[dartx._get](i);
+        if (!dart.test(this.validator.allowsAttribute(element, core.String._check(dart.dsend(name, 'toLowerCase')), core.String._check(attrs[dartx._get](name))))) {
+          html$.window[dartx.console].warn('Removing disallowed attribute ' + dart.str`<${tag} ${name}="${attrs[dartx._get](name)}">`);
           attrs[dartx.remove](name);
         }
       }
@@ -82268,15 +84074,6 @@
       sanitizeNode: dart.definiteFunctionType(dart.void, [html$.Node, html$.Node])
     })
   });
-  html$.Point$ = math.Point$;
-  html$.Point = math.Point;
-  html$.Rectangle$ = math.Rectangle$;
-  html$.Rectangle = math.Rectangle;
-  html_common.SupportedBrowser = _metadata.SupportedBrowser;
-  html_common.Unstable = _metadata.Unstable;
-  html_common.DocsEditable = _metadata.DocsEditable;
-  html_common.Experimental = _metadata.Experimental;
-  html_common.DomName = _metadata.DomName;
   html_common.convertDartToNative_SerializedScriptValue = function(value) {
     return html_common.convertDartToNative_PrepareForStructuredClone(value);
   };
@@ -82293,17 +84090,17 @@
     findSlot(value) {
       let length = this.values[dartx.length];
       for (let i = 0; i < dart.notNull(length); i++) {
-        if (core.identical(this.values[dartx.get](i), value)) return i;
+        if (core.identical(this.values[dartx._get](i), value)) return i;
       }
       this.values[dartx.add](value);
       this.copies[dartx.add](null);
       return length;
     }
     readSlot(i) {
-      return this.copies[dartx.get](i);
+      return this.copies[dartx._get](i);
     }
     writeSlot(i, x) {
-      this.copies[dartx.set](i, x);
+      this.copies[dartx._set](i, x);
     }
     cleanupSlots() {}
     walk(e) {
@@ -82348,7 +84145,7 @@
       let copy = this.newJsList(length);
       this.writeSlot(slot, copy);
       for (; i < dart.notNull(length); i++) {
-        dart.dsetindex(copy, i, this.walk(e[dartx.get](i)));
+        dart.dsetindex(copy, i, this.walk(e[dartx._get](i)));
       }
       return copy;
     }
@@ -82382,17 +84179,17 @@
     findSlot(value) {
       let length = this.values[dartx.length];
       for (let i = 0; i < dart.notNull(length); i++) {
-        if (dart.test(this.identicalInJs(this.values[dartx.get](i), value))) return i;
+        if (dart.test(this.identicalInJs(this.values[dartx._get](i), value))) return i;
       }
       this.values[dartx.add](value);
       this.copies[dartx.add](null);
       return length;
     }
     readSlot(i) {
-      return this.copies[dartx.get](i);
+      return this.copies[dartx._get](i);
     }
     writeSlot(i, x) {
-      this.copies[dartx.set](i, x);
+      this.copies[dartx._set](i, x);
     }
     walk(e) {
       if (e == null) return e;
@@ -82525,7 +84322,7 @@
     let dict = dart.map();
     let keys = Object.getOwnPropertyNames(object);
     for (let key of core.Iterable._check(keys)) {
-      dict[dartx.set](key, object[key]);
+      dict[dartx._set](key, object[key]);
     }
     return dict;
   };
@@ -82761,8 +84558,8 @@
     forEach(f) {
       this[_filtered][dartx.forEach](f);
     }
-    set(index, value) {
-      this.get(index)[dartx.replaceWith](value);
+    _set(index, value) {
+      this._get(index)[dartx.replaceWith](value);
       return value;
     }
     set length(newLength) {
@@ -82835,7 +84632,7 @@
       }
     }
     removeAt(index) {
-      let result = this.get(index);
+      let result = this._get(index);
       result[dartx.remove]();
       return result;
     }
@@ -82851,7 +84648,7 @@
     get length() {
       return this[_iterable$0][dartx.length];
     }
-    get(index) {
+    _get(index) {
       return this[_iterable$0][dartx.elementAt](index);
     }
     get iterator() {
@@ -82880,7 +84677,7 @@
     setters: () => ({length: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
       forEach: dart.definiteFunctionType(dart.void, [ElementTovoid()]),
-      set: dart.definiteFunctionType(dart.void, [core.int, html$.Element]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, html$.Element]),
       add: dart.definiteFunctionType(dart.void, [html$.Element]),
       addAll: dart.definiteFunctionType(dart.void, [IterableOfElement()]),
       sort: dart.definiteFunctionType(dart.void, [], [ElementAndElementToint()]),
@@ -82891,12 +84688,12 @@
       insert: dart.definiteFunctionType(dart.void, [core.int, html$.Element]),
       insertAll: dart.definiteFunctionType(dart.void, [core.int, IterableOfElement()]),
       removeAt: dart.definiteFunctionType(html$.Element, [core.int]),
-      get: dart.definiteFunctionType(html$.Element, [core.int])
+      _get: dart.definiteFunctionType(html$.Element, [core.int])
     })
   });
   dart.defineExtensionMembers(html_common.FilteredElementList, [
     'forEach',
-    'set',
+    '_set',
     'add',
     'addAll',
     'contains',
@@ -82911,7 +84708,7 @@
     'insertAll',
     'removeAt',
     'remove',
-    'get',
+    '_get',
     'length',
     'reversed',
     'length',
@@ -82926,7 +84723,7 @@
         startIndex = 0;
       }
       for (let i = startIndex; dart.notNull(i) < dart.notNull(endIndex); i = dart.notNull(i) + 1) {
-        if (dart.equals(a[dartx.get](i), element)) {
+        if (dart.equals(a[dartx._get](i), element)) {
           return i;
         }
       }
@@ -82940,7 +84737,7 @@
         startIndex = dart.notNull(a[dartx.length]) - 1;
       }
       for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) {
-        if (dart.equals(a[dartx.get](i), element)) {
+        if (dart.equals(a[dartx._get](i), element)) {
           return i;
         }
       }
@@ -82951,7 +84748,7 @@
       if (dart.notNull(end) < dart.notNull(start)) dart.throw(new core.RangeError.value(end));
       if (dart.notNull(end) > dart.notNull(a[dartx.length])) dart.throw(new core.RangeError.value(end));
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        accumulator[dartx.add](a[dartx.get](i));
+        accumulator[dartx.add](a[dartx._get](i));
       }
       return accumulator;
     }
@@ -83157,11 +84954,11 @@
     get [dartx.viewportElement]() {
       return this.viewportElement;
     }
-    [dartx.blur]() {
-      return this.blur();
+    [dartx.blur](...args) {
+      return this.blur.apply(this, args);
     }
-    [dartx.focus]() {
-      return this.focus();
+    [dartx.focus](...args) {
+      return this.focus.apply(this, args);
     }
     get [dartx.onAbort]() {
       return svg$.SvgElement.abortEvent.forElement(this);
@@ -83590,17 +85387,17 @@
     get [dartx.transform]() {
       return this.transform;
     }
-    [dartx.getBBox]() {
-      return this.getBBox();
+    [dartx.getBBox](...args) {
+      return this.getBBox.apply(this, args);
     }
-    [dartx.getCtm]() {
-      return this.getCTM();
+    [dartx.getCtm](...args) {
+      return this.getCTM.apply(this, args);
     }
-    [dartx.getScreenCtm]() {
-      return this.getScreenCTM();
+    [dartx.getScreenCtm](...args) {
+      return this.getScreenCTM.apply(this, args);
     }
-    [dartx.getTransformToElement](element) {
-      return this.getTransformToElement(element);
+    [dartx.getTransformToElement](...args) {
+      return this.getTransformToElement.apply(this, args);
     }
     get [dartx.requiredExtensions]() {
       return this.requiredExtensions;
@@ -83611,8 +85408,8 @@
     get [dartx.systemLanguage]() {
       return this.systemLanguage;
     }
-    [dartx.hasExtension](extension) {
-      return this.hasExtension(extension);
+    [dartx.hasExtension](...args) {
+      return this.hasExtension.apply(this, args);
     }
   };
   dart.defineNamedConstructor(svg$.GraphicsElement, 'created');
@@ -83709,11 +85506,11 @@
     set [dartx.valueInSpecifiedUnits](value) {
       this.valueInSpecifiedUnits = value;
     }
-    [dartx.convertToSpecifiedUnits](unitType) {
-      return this.convertToSpecifiedUnits(unitType);
+    [dartx.convertToSpecifiedUnits](...args) {
+      return this.convertToSpecifiedUnits.apply(this, args);
     }
-    [dartx.newValueSpecifiedUnits](unitType, valueInSpecifiedUnits) {
-      return this.newValueSpecifiedUnits(unitType, valueInSpecifiedUnits);
+    [dartx.newValueSpecifiedUnits](...args) {
+      return this.newValueSpecifiedUnits.apply(this, args);
     }
   };
   dart.setSignature(svg$.Angle, {
@@ -83773,26 +85570,26 @@
     get [dartx.targetElement]() {
       return this.targetElement;
     }
-    [dartx.beginElement]() {
-      return this.beginElement();
+    [dartx.beginElement](...args) {
+      return this.beginElement.apply(this, args);
     }
-    [dartx.beginElementAt](offset) {
-      return this.beginElementAt(offset);
+    [dartx.beginElementAt](...args) {
+      return this.beginElementAt.apply(this, args);
     }
-    [dartx.endElement]() {
-      return this.endElement();
+    [dartx.endElement](...args) {
+      return this.endElement.apply(this, args);
     }
-    [dartx.endElementAt](offset) {
-      return this.endElementAt(offset);
+    [dartx.endElementAt](...args) {
+      return this.endElementAt.apply(this, args);
     }
-    [dartx.getCurrentTime]() {
-      return this.getCurrentTime();
+    [dartx.getCurrentTime](...args) {
+      return this.getCurrentTime.apply(this, args);
     }
-    [dartx.getSimpleDuration]() {
-      return this.getSimpleDuration();
+    [dartx.getSimpleDuration](...args) {
+      return this.getSimpleDuration.apply(this, args);
     }
-    [dartx.getStartTime]() {
-      return this.getStartTime();
+    [dartx.getStartTime](...args) {
+      return this.getStartTime.apply(this, args);
     }
     get [dartx.requiredExtensions]() {
       return this.requiredExtensions;
@@ -83803,8 +85600,8 @@
     get [dartx.systemLanguage]() {
       return this.systemLanguage;
     }
-    [dartx.hasExtension](extension) {
-      return this.hasExtension(extension);
+    [dartx.hasExtension](...args) {
+      return this.hasExtension.apply(this, args);
     }
   };
   dart.defineNamedConstructor(svg$.AnimationElement, 'created');
@@ -84207,11 +86004,11 @@
     created() {
       super.created();
     }
-    [dartx.isPointInFill](point) {
-      return this.isPointInFill(point);
+    [dartx.isPointInFill](...args) {
+      return this.isPointInFill.apply(this, args);
     }
-    [dartx.isPointInStroke](point) {
-      return this.isPointInStroke(point);
+    [dartx.isPointInStroke](...args) {
+      return this.isPointInStroke.apply(this, args);
     }
   };
   dart.defineNamedConstructor(svg$.GeometryElement, 'created');
@@ -85337,8 +87134,8 @@
     get [dartx.stdDeviationY]() {
       return this.stdDeviationY;
     }
-    [dartx.setStdDeviation](stdDeviationX, stdDeviationY) {
-      return this.setStdDeviation(stdDeviationX, stdDeviationY);
+    [dartx.setStdDeviation](...args) {
+      return this.setStdDeviation.apply(this, args);
     }
     get [dartx.height]() {
       return this.height;
@@ -86173,7 +87970,42 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get height() {
+      return this[height$];
+    }
+    set height(value) {
+      super.height = value;
+    }
+    get result() {
+      return this[result];
+    }
+    set result(value) {
+      super.result = value;
+    }
+    get width() {
+      return this[width$];
+    }
+    set width(value) {
+      super.width = value;
+    }
+    get x() {
+      return this[x];
+    }
+    set x(value) {
+      super.x = value;
+    }
+    get y() {
+      return this[y];
+    }
+    set y(value) {
+      super.y = value;
+    }
   };
+  const height$ = Symbol(svg$.FilterPrimitiveStandardAttributes.name + "." + 'height'.toString());
+  const result = Symbol(svg$.FilterPrimitiveStandardAttributes.name + "." + 'result'.toString());
+  const width$ = Symbol(svg$.FilterPrimitiveStandardAttributes.name + "." + 'width'.toString());
+  const x = Symbol(svg$.FilterPrimitiveStandardAttributes.name + "." + 'x'.toString());
+  const y = Symbol(svg$.FilterPrimitiveStandardAttributes.name + "." + 'y'.toString());
   dart.setSignature(svg$.FilterPrimitiveStandardAttributes, {
     constructors: () => ({_: dart.definiteFunctionType(svg$.FilterPrimitiveStandardAttributes, [])}),
     fields: () => ({
@@ -86199,7 +88031,21 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get preserveAspectRatio() {
+      return this[preserveAspectRatio];
+    }
+    set preserveAspectRatio(value) {
+      super.preserveAspectRatio = value;
+    }
+    get viewBox() {
+      return this[viewBox];
+    }
+    set viewBox(value) {
+      super.viewBox = value;
+    }
   };
+  const preserveAspectRatio = Symbol(svg$.FitToViewBox.name + "." + 'preserveAspectRatio'.toString());
+  const viewBox = Symbol(svg$.FitToViewBox.name + "." + 'viewBox'.toString());
   dart.setSignature(svg$.FitToViewBox, {
     constructors: () => ({_: dart.definiteFunctionType(svg$.FitToViewBox, [])}),
     fields: () => ({
@@ -86374,11 +88220,11 @@
     set [dartx.valueInSpecifiedUnits](value) {
       this.valueInSpecifiedUnits = value;
     }
-    [dartx.convertToSpecifiedUnits](unitType) {
-      return this.convertToSpecifiedUnits(unitType);
+    [dartx.convertToSpecifiedUnits](...args) {
+      return this.convertToSpecifiedUnits.apply(this, args);
     }
-    [dartx.newValueSpecifiedUnits](unitType, valueInSpecifiedUnits) {
-      return this.newValueSpecifiedUnits(unitType, valueInSpecifiedUnits);
+    [dartx.newValueSpecifiedUnits](...args) {
+      return this.newValueSpecifiedUnits.apply(this, args);
     }
   };
   dart.setSignature(svg$.Length, {
@@ -86422,8 +88268,8 @@
   const __setter__$ = Symbol('__setter__');
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -86448,11 +88294,11 @@
     get [dartx.numberOfItems]() {
       return this.numberOfItems;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.getItem](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -86481,31 +88327,31 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__setter__$](index, newItem) {
-      return this.__setter__(index, newItem);
+    [__setter__$](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.appendItem](newItem) {
-      return this.appendItem(newItem);
+    [dartx.appendItem](...args) {
+      return this.appendItem.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.getItem](index) {
-      return this.getItem(index);
+    [dartx.getItem](...args) {
+      return this.getItem.apply(this, args);
     }
-    [dartx.initialize](newItem) {
-      return this.initialize(newItem);
+    [dartx.initialize](...args) {
+      return this.initialize.apply(this, args);
     }
-    [dartx.insertItemBefore](newItem, index) {
-      return this.insertItemBefore(newItem, index);
+    [dartx.insertItemBefore](...args) {
+      return this.insertItemBefore.apply(this, args);
     }
-    [dartx.removeItem](index) {
-      return this.removeItem(index);
+    [dartx.removeItem](...args) {
+      return this.removeItem.apply(this, args);
     }
-    [dartx.replaceItem](newItem, index) {
-      return this.replaceItem(newItem, index);
+    [dartx.replaceItem](...args) {
+      return this.replaceItem.apply(this, args);
     }
   };
   svg$.LengthList[dart.implements] = () => [ListOfLength()];
@@ -86520,8 +88366,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(svg$.Length, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, svg$.Length]),
+      [dartx._get]: dart.definiteFunctionType(svg$.Length, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, svg$.Length]),
       [dartx.elementAt]: dart.definiteFunctionType(svg$.Length, [core.int]),
       [__setter__$]: dart.definiteFunctionType(dart.void, [core.int, svg$.Length]),
       [dartx.appendItem]: dart.definiteFunctionType(svg$.Length, [svg$.Length]),
@@ -86737,11 +88583,11 @@
     get [dartx.refY]() {
       return this.refY;
     }
-    [dartx.setOrientToAngle](angle) {
-      return this.setOrientToAngle(angle);
+    [dartx.setOrientToAngle](...args) {
+      return this.setOrientToAngle.apply(this, args);
     }
-    [dartx.setOrientToAuto]() {
-      return this.setOrientToAuto();
+    [dartx.setOrientToAuto](...args) {
+      return this.setOrientToAuto.apply(this, args);
     }
     get [dartx.preserveAspectRatio]() {
       return this.preserveAspectRatio;
@@ -86847,8 +88693,8 @@
     get [dartx.systemLanguage]() {
       return this.systemLanguage;
     }
-    [dartx.hasExtension](extension) {
-      return this.hasExtension(extension);
+    [dartx.hasExtension](...args) {
+      return this.hasExtension.apply(this, args);
     }
   };
   dart.defineNamedConstructor(svg$.MaskElement, 'created');
@@ -86932,38 +88778,38 @@
     set [dartx.f](value) {
       this.f = value;
     }
-    [dartx.flipX]() {
-      return this.flipX();
+    [dartx.flipX](...args) {
+      return this.flipX.apply(this, args);
     }
-    [dartx.flipY]() {
-      return this.flipY();
+    [dartx.flipY](...args) {
+      return this.flipY.apply(this, args);
     }
-    [dartx.inverse]() {
-      return this.inverse();
+    [dartx.inverse](...args) {
+      return this.inverse.apply(this, args);
     }
-    [dartx.multiply](secondMatrix) {
-      return this.multiply(secondMatrix);
+    [dartx.multiply](...args) {
+      return this.multiply.apply(this, args);
     }
-    [dartx.rotate](angle) {
-      return this.rotate(angle);
+    [dartx.rotate](...args) {
+      return this.rotate.apply(this, args);
     }
-    [dartx.rotateFromVector](x, y) {
-      return this.rotateFromVector(x, y);
+    [dartx.rotateFromVector](...args) {
+      return this.rotateFromVector.apply(this, args);
     }
-    [dartx.scale](scaleFactor) {
-      return this.scale(scaleFactor);
+    [dartx.scale](...args) {
+      return this.scale.apply(this, args);
     }
-    [dartx.scaleNonUniform](scaleFactorX, scaleFactorY) {
-      return this.scaleNonUniform(scaleFactorX, scaleFactorY);
+    [dartx.scaleNonUniform](...args) {
+      return this.scaleNonUniform.apply(this, args);
     }
-    [dartx.skewX](angle) {
-      return this.skewX(angle);
+    [dartx.skewX](...args) {
+      return this.skewX.apply(this, args);
     }
-    [dartx.skewY](angle) {
-      return this.skewY(angle);
+    [dartx.skewY](...args) {
+      return this.skewY.apply(this, args);
     }
-    [dartx.translate](x, y) {
-      return this.translate(x, y);
+    [dartx.translate](...args) {
+      return this.translate.apply(this, args);
     }
   };
   dart.setSignature(svg$.Matrix, {
@@ -87028,8 +88874,8 @@
   dart.registerExtension(dart.global.SVGNumber, svg$.Number);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -87054,11 +88900,11 @@
     get [dartx.numberOfItems]() {
       return this.numberOfItems;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.getItem](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -87087,31 +88933,31 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__setter__$](index, newItem) {
-      return this.__setter__(index, newItem);
+    [__setter__$](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.appendItem](newItem) {
-      return this.appendItem(newItem);
+    [dartx.appendItem](...args) {
+      return this.appendItem.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.getItem](index) {
-      return this.getItem(index);
+    [dartx.getItem](...args) {
+      return this.getItem.apply(this, args);
     }
-    [dartx.initialize](newItem) {
-      return this.initialize(newItem);
+    [dartx.initialize](...args) {
+      return this.initialize.apply(this, args);
     }
-    [dartx.insertItemBefore](newItem, index) {
-      return this.insertItemBefore(newItem, index);
+    [dartx.insertItemBefore](...args) {
+      return this.insertItemBefore.apply(this, args);
     }
-    [dartx.removeItem](index) {
-      return this.removeItem(index);
+    [dartx.removeItem](...args) {
+      return this.removeItem.apply(this, args);
     }
-    [dartx.replaceItem](newItem, index) {
-      return this.replaceItem(newItem, index);
+    [dartx.replaceItem](...args) {
+      return this.replaceItem.apply(this, args);
     }
   };
   svg$.NumberList[dart.implements] = () => [ListOfNumber()];
@@ -87126,8 +88972,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(svg$.Number, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, svg$.Number]),
+      [dartx._get]: dart.definiteFunctionType(svg$.Number, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, svg$.Number]),
       [dartx.elementAt]: dart.definiteFunctionType(svg$.Number, [core.int]),
       [__setter__$]: dart.definiteFunctionType(dart.void, [core.int, svg$.Number]),
       [dartx.appendItem]: dart.definiteFunctionType(svg$.Number, [svg$.Number]),
@@ -87198,71 +89044,71 @@
     get [dartx.pathSegList]() {
       return this.pathSegList;
     }
-    [dartx.createSvgPathSegArcAbs](x, y, r1, r2, angle, largeArcFlag, sweepFlag) {
-      return this.createSVGPathSegArcAbs(x, y, r1, r2, angle, largeArcFlag, sweepFlag);
+    [dartx.createSvgPathSegArcAbs](...args) {
+      return this.createSVGPathSegArcAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegArcRel](x, y, r1, r2, angle, largeArcFlag, sweepFlag) {
-      return this.createSVGPathSegArcRel(x, y, r1, r2, angle, largeArcFlag, sweepFlag);
+    [dartx.createSvgPathSegArcRel](...args) {
+      return this.createSVGPathSegArcRel.apply(this, args);
     }
-    [dartx.createSvgPathSegClosePath]() {
-      return this.createSVGPathSegClosePath();
+    [dartx.createSvgPathSegClosePath](...args) {
+      return this.createSVGPathSegClosePath.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoCubicAbs](x, y, x1, y1, x2, y2) {
-      return this.createSVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2);
+    [dartx.createSvgPathSegCurvetoCubicAbs](...args) {
+      return this.createSVGPathSegCurvetoCubicAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoCubicRel](x, y, x1, y1, x2, y2) {
-      return this.createSVGPathSegCurvetoCubicRel(x, y, x1, y1, x2, y2);
+    [dartx.createSvgPathSegCurvetoCubicRel](...args) {
+      return this.createSVGPathSegCurvetoCubicRel.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoCubicSmoothAbs](x, y, x2, y2) {
-      return this.createSVGPathSegCurvetoCubicSmoothAbs(x, y, x2, y2);
+    [dartx.createSvgPathSegCurvetoCubicSmoothAbs](...args) {
+      return this.createSVGPathSegCurvetoCubicSmoothAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoCubicSmoothRel](x, y, x2, y2) {
-      return this.createSVGPathSegCurvetoCubicSmoothRel(x, y, x2, y2);
+    [dartx.createSvgPathSegCurvetoCubicSmoothRel](...args) {
+      return this.createSVGPathSegCurvetoCubicSmoothRel.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoQuadraticAbs](x, y, x1, y1) {
-      return this.createSVGPathSegCurvetoQuadraticAbs(x, y, x1, y1);
+    [dartx.createSvgPathSegCurvetoQuadraticAbs](...args) {
+      return this.createSVGPathSegCurvetoQuadraticAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoQuadraticRel](x, y, x1, y1) {
-      return this.createSVGPathSegCurvetoQuadraticRel(x, y, x1, y1);
+    [dartx.createSvgPathSegCurvetoQuadraticRel](...args) {
+      return this.createSVGPathSegCurvetoQuadraticRel.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoQuadraticSmoothAbs](x, y) {
-      return this.createSVGPathSegCurvetoQuadraticSmoothAbs(x, y);
+    [dartx.createSvgPathSegCurvetoQuadraticSmoothAbs](...args) {
+      return this.createSVGPathSegCurvetoQuadraticSmoothAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoQuadraticSmoothRel](x, y) {
-      return this.createSVGPathSegCurvetoQuadraticSmoothRel(x, y);
+    [dartx.createSvgPathSegCurvetoQuadraticSmoothRel](...args) {
+      return this.createSVGPathSegCurvetoQuadraticSmoothRel.apply(this, args);
     }
-    [dartx.createSvgPathSegLinetoAbs](x, y) {
-      return this.createSVGPathSegLinetoAbs(x, y);
+    [dartx.createSvgPathSegLinetoAbs](...args) {
+      return this.createSVGPathSegLinetoAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegLinetoHorizontalAbs](x) {
-      return this.createSVGPathSegLinetoHorizontalAbs(x);
+    [dartx.createSvgPathSegLinetoHorizontalAbs](...args) {
+      return this.createSVGPathSegLinetoHorizontalAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegLinetoHorizontalRel](x) {
-      return this.createSVGPathSegLinetoHorizontalRel(x);
+    [dartx.createSvgPathSegLinetoHorizontalRel](...args) {
+      return this.createSVGPathSegLinetoHorizontalRel.apply(this, args);
     }
-    [dartx.createSvgPathSegLinetoRel](x, y) {
-      return this.createSVGPathSegLinetoRel(x, y);
+    [dartx.createSvgPathSegLinetoRel](...args) {
+      return this.createSVGPathSegLinetoRel.apply(this, args);
     }
-    [dartx.createSvgPathSegLinetoVerticalAbs](y) {
-      return this.createSVGPathSegLinetoVerticalAbs(y);
+    [dartx.createSvgPathSegLinetoVerticalAbs](...args) {
+      return this.createSVGPathSegLinetoVerticalAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegLinetoVerticalRel](y) {
-      return this.createSVGPathSegLinetoVerticalRel(y);
+    [dartx.createSvgPathSegLinetoVerticalRel](...args) {
+      return this.createSVGPathSegLinetoVerticalRel.apply(this, args);
     }
-    [dartx.createSvgPathSegMovetoAbs](x, y) {
-      return this.createSVGPathSegMovetoAbs(x, y);
+    [dartx.createSvgPathSegMovetoAbs](...args) {
+      return this.createSVGPathSegMovetoAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegMovetoRel](x, y) {
-      return this.createSVGPathSegMovetoRel(x, y);
+    [dartx.createSvgPathSegMovetoRel](...args) {
+      return this.createSVGPathSegMovetoRel.apply(this, args);
     }
-    [dartx.getPathSegAtLength](distance) {
-      return this.getPathSegAtLength(distance);
+    [dartx.getPathSegAtLength](...args) {
+      return this.getPathSegAtLength.apply(this, args);
     }
-    [dartx.getPointAtLength](distance) {
-      return this.getPointAtLength(distance);
+    [dartx.getPointAtLength](...args) {
+      return this.getPointAtLength.apply(this, args);
     }
-    [dartx.getTotalLength]() {
-      return this.getTotalLength();
+    [dartx.getTotalLength](...args) {
+      return this.getTotalLength.apply(this, args);
     }
   };
   dart.defineNamedConstructor(svg$.PathElement, 'created');
@@ -88013,8 +89859,8 @@
   dart.registerExtension(dart.global.SVGPathSegLinetoVerticalRel, svg$.PathSegLinetoVerticalRel);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -88039,11 +89885,11 @@
     get [dartx.numberOfItems]() {
       return this.numberOfItems;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.getItem](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -88072,31 +89918,31 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__setter__$](index, newItem) {
-      return this.__setter__(index, newItem);
+    [__setter__$](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.appendItem](newItem) {
-      return this.appendItem(newItem);
+    [dartx.appendItem](...args) {
+      return this.appendItem.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.getItem](index) {
-      return this.getItem(index);
+    [dartx.getItem](...args) {
+      return this.getItem.apply(this, args);
     }
-    [dartx.initialize](newItem) {
-      return this.initialize(newItem);
+    [dartx.initialize](...args) {
+      return this.initialize.apply(this, args);
     }
-    [dartx.insertItemBefore](newItem, index) {
-      return this.insertItemBefore(newItem, index);
+    [dartx.insertItemBefore](...args) {
+      return this.insertItemBefore.apply(this, args);
     }
-    [dartx.removeItem](index) {
-      return this.removeItem(index);
+    [dartx.removeItem](...args) {
+      return this.removeItem.apply(this, args);
     }
-    [dartx.replaceItem](newItem, index) {
-      return this.replaceItem(newItem, index);
+    [dartx.replaceItem](...args) {
+      return this.replaceItem.apply(this, args);
     }
   };
   svg$.PathSegList[dart.implements] = () => [ListOfPathSeg()];
@@ -88111,8 +89957,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(svg$.PathSeg, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, svg$.PathSeg]),
+      [dartx._get]: dart.definiteFunctionType(svg$.PathSeg, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, svg$.PathSeg]),
       [dartx.elementAt]: dart.definiteFunctionType(svg$.PathSeg, [core.int]),
       [__setter__$]: dart.definiteFunctionType(dart.void, [core.int, svg$.PathSeg]),
       [dartx.appendItem]: dart.definiteFunctionType(svg$.PathSeg, [svg$.PathSeg]),
@@ -88257,8 +90103,8 @@
     get [dartx.systemLanguage]() {
       return this.systemLanguage;
     }
-    [dartx.hasExtension](extension) {
-      return this.hasExtension(extension);
+    [dartx.hasExtension](...args) {
+      return this.hasExtension.apply(this, args);
     }
     get [dartx.href]() {
       return this.href;
@@ -88311,8 +90157,8 @@
     set [dartx.y](value) {
       this.y = value;
     }
-    [dartx.matrixTransform](matrix) {
-      return this.matrixTransform(matrix);
+    [dartx.matrixTransform](...args) {
+      return this.matrixTransform.apply(this, args);
     }
   };
   dart.setSignature(svg$.Point, {
@@ -88345,29 +90191,29 @@
     get [dartx.numberOfItems]() {
       return this.numberOfItems;
     }
-    [__setter__$](index, newItem) {
-      return this.__setter__(index, newItem);
+    [__setter__$](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.appendItem](newItem) {
-      return this.appendItem(newItem);
+    [dartx.appendItem](...args) {
+      return this.appendItem.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.getItem](index) {
-      return this.getItem(index);
+    [dartx.getItem](...args) {
+      return this.getItem.apply(this, args);
     }
-    [dartx.initialize](newItem) {
-      return this.initialize(newItem);
+    [dartx.initialize](...args) {
+      return this.initialize.apply(this, args);
     }
-    [dartx.insertItemBefore](newItem, index) {
-      return this.insertItemBefore(newItem, index);
+    [dartx.insertItemBefore](...args) {
+      return this.insertItemBefore.apply(this, args);
     }
-    [dartx.removeItem](index) {
-      return this.removeItem(index);
+    [dartx.removeItem](...args) {
+      return this.removeItem.apply(this, args);
     }
-    [dartx.replaceItem](newItem, index) {
-      return this.replaceItem(newItem, index);
+    [dartx.replaceItem](...args) {
+      return this.replaceItem.apply(this, args);
     }
   };
   dart.setSignature(svg$.PointList, {
@@ -88778,8 +90624,8 @@
   dart.registerExtension(dart.global.SVGStopElement, svg$.StopElement);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -88804,11 +90650,11 @@
     get [dartx.numberOfItems]() {
       return this.numberOfItems;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.getItem](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -88837,31 +90683,31 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__setter__$](index, newItem) {
-      return this.__setter__(index, newItem);
+    [__setter__$](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.appendItem](newItem) {
-      return this.appendItem(newItem);
+    [dartx.appendItem](...args) {
+      return this.appendItem.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.getItem](index) {
-      return this.getItem(index);
+    [dartx.getItem](...args) {
+      return this.getItem.apply(this, args);
     }
-    [dartx.initialize](newItem) {
-      return this.initialize(newItem);
+    [dartx.initialize](...args) {
+      return this.initialize.apply(this, args);
     }
-    [dartx.insertItemBefore](item, index) {
-      return this.insertItemBefore(item, index);
+    [dartx.insertItemBefore](...args) {
+      return this.insertItemBefore.apply(this, args);
     }
-    [dartx.removeItem](index) {
-      return this.removeItem(index);
+    [dartx.removeItem](...args) {
+      return this.removeItem.apply(this, args);
     }
-    [dartx.replaceItem](newItem, index) {
-      return this.replaceItem(newItem, index);
+    [dartx.replaceItem](...args) {
+      return this.replaceItem.apply(this, args);
     }
   };
   svg$.StringList[dart.implements] = () => [ListOfString()];
@@ -88876,8 +90722,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.String, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, core.String]),
+      [dartx._get]: dart.definiteFunctionType(core.String, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, core.String]),
       [dartx.elementAt]: dart.definiteFunctionType(core.String, [core.int]),
       [__setter__$]: dart.definiteFunctionType(dart.void, [core.int, core.String]),
       [dartx.appendItem]: dart.definiteFunctionType(core.String, [core.String]),
@@ -88952,7 +90798,7 @@
       this[_element$0] = element;
     }
     readClasses() {
-      let classname = this[_element$0][dartx.attributes][dartx.get]('class');
+      let classname = this[_element$0][dartx.attributes][dartx._get]('class');
       let s = LinkedHashSetOfString().new();
       if (classname == null) {
         return s;
@@ -88966,7 +90812,7 @@
       return s;
     }
     writeClasses(s) {
-      this[_element$0][dartx.attributes][dartx.set]('class', s.join(' '));
+      this[_element$0][dartx.attributes][dartx._set]('class', s.join(' '));
     }
   };
   dart.setSignature(svg$._AttributeClassSet, {
@@ -89021,7 +90867,7 @@
   svg$.SvgSvgElement = class SvgSvgElement extends svg$.GraphicsElement {
     static new() {
       let el = svg$.SvgElement.tag("svg");
-      el[dartx.attributes][dartx.set]('version', "1.1");
+      el[dartx.attributes][dartx._set]('version', "1.1");
       return svg$.SvgSvgElement._check(el);
     }
     static _() {
@@ -89088,74 +90934,74 @@
     get [dartx.y]() {
       return this.y;
     }
-    [dartx.animationsPaused]() {
-      return this.animationsPaused();
+    [dartx.animationsPaused](...args) {
+      return this.animationsPaused.apply(this, args);
     }
-    [dartx.checkEnclosure](element, rect) {
-      return this.checkEnclosure(element, rect);
+    [dartx.checkEnclosure](...args) {
+      return this.checkEnclosure.apply(this, args);
     }
-    [dartx.checkIntersection](element, rect) {
-      return this.checkIntersection(element, rect);
+    [dartx.checkIntersection](...args) {
+      return this.checkIntersection.apply(this, args);
     }
-    [dartx.createSvgAngle]() {
-      return this.createSVGAngle();
+    [dartx.createSvgAngle](...args) {
+      return this.createSVGAngle.apply(this, args);
     }
-    [dartx.createSvgLength]() {
-      return this.createSVGLength();
+    [dartx.createSvgLength](...args) {
+      return this.createSVGLength.apply(this, args);
     }
-    [dartx.createSvgMatrix]() {
-      return this.createSVGMatrix();
+    [dartx.createSvgMatrix](...args) {
+      return this.createSVGMatrix.apply(this, args);
     }
-    [dartx.createSvgNumber]() {
-      return this.createSVGNumber();
+    [dartx.createSvgNumber](...args) {
+      return this.createSVGNumber.apply(this, args);
     }
-    [dartx.createSvgPoint]() {
-      return this.createSVGPoint();
+    [dartx.createSvgPoint](...args) {
+      return this.createSVGPoint.apply(this, args);
     }
-    [dartx.createSvgRect]() {
-      return this.createSVGRect();
+    [dartx.createSvgRect](...args) {
+      return this.createSVGRect.apply(this, args);
     }
-    [dartx.createSvgTransform]() {
-      return this.createSVGTransform();
+    [dartx.createSvgTransform](...args) {
+      return this.createSVGTransform.apply(this, args);
     }
-    [dartx.createSvgTransformFromMatrix](matrix) {
-      return this.createSVGTransformFromMatrix(matrix);
+    [dartx.createSvgTransformFromMatrix](...args) {
+      return this.createSVGTransformFromMatrix.apply(this, args);
     }
-    [dartx.deselectAll]() {
-      return this.deselectAll();
+    [dartx.deselectAll](...args) {
+      return this.deselectAll.apply(this, args);
     }
-    [dartx.forceRedraw]() {
-      return this.forceRedraw();
+    [dartx.forceRedraw](...args) {
+      return this.forceRedraw.apply(this, args);
     }
-    [dartx.getCurrentTime]() {
-      return this.getCurrentTime();
+    [dartx.getCurrentTime](...args) {
+      return this.getCurrentTime.apply(this, args);
     }
-    [dartx.getElementById](elementId) {
-      return this.getElementById(elementId);
+    [dartx.getElementById](...args) {
+      return this.getElementById.apply(this, args);
     }
-    [dartx.getEnclosureList](rect, referenceElement) {
-      return this.getEnclosureList(rect, referenceElement);
+    [dartx.getEnclosureList](...args) {
+      return this.getEnclosureList.apply(this, args);
     }
-    [dartx.getIntersectionList](rect, referenceElement) {
-      return this.getIntersectionList(rect, referenceElement);
+    [dartx.getIntersectionList](...args) {
+      return this.getIntersectionList.apply(this, args);
     }
-    [dartx.pauseAnimations]() {
-      return this.pauseAnimations();
+    [dartx.pauseAnimations](...args) {
+      return this.pauseAnimations.apply(this, args);
     }
-    [dartx.setCurrentTime](seconds) {
-      return this.setCurrentTime(seconds);
+    [dartx.setCurrentTime](...args) {
+      return this.setCurrentTime.apply(this, args);
     }
-    [dartx.suspendRedraw](maxWaitMilliseconds) {
-      return this.suspendRedraw(maxWaitMilliseconds);
+    [dartx.suspendRedraw](...args) {
+      return this.suspendRedraw.apply(this, args);
     }
-    [dartx.unpauseAnimations]() {
-      return this.unpauseAnimations();
+    [dartx.unpauseAnimations](...args) {
+      return this.unpauseAnimations.apply(this, args);
     }
-    [dartx.unsuspendRedraw](suspendHandleId) {
-      return this.unsuspendRedraw(suspendHandleId);
+    [dartx.unsuspendRedraw](...args) {
+      return this.unsuspendRedraw.apply(this, args);
     }
-    [dartx.unsuspendRedrawAll]() {
-      return this.unsuspendRedrawAll();
+    [dartx.unsuspendRedrawAll](...args) {
+      return this.unsuspendRedrawAll.apply(this, args);
     }
     get [dartx.preserveAspectRatio]() {
       return this.preserveAspectRatio;
@@ -89308,32 +91154,32 @@
     get [dartx.textLength]() {
       return this.textLength;
     }
-    [dartx.getCharNumAtPosition](point) {
-      return this.getCharNumAtPosition(point);
+    [dartx.getCharNumAtPosition](...args) {
+      return this.getCharNumAtPosition.apply(this, args);
     }
-    [dartx.getComputedTextLength]() {
-      return this.getComputedTextLength();
+    [dartx.getComputedTextLength](...args) {
+      return this.getComputedTextLength.apply(this, args);
     }
-    [dartx.getEndPositionOfChar](charnum) {
-      return this.getEndPositionOfChar(charnum);
+    [dartx.getEndPositionOfChar](...args) {
+      return this.getEndPositionOfChar.apply(this, args);
     }
-    [dartx.getExtentOfChar](charnum) {
-      return this.getExtentOfChar(charnum);
+    [dartx.getExtentOfChar](...args) {
+      return this.getExtentOfChar.apply(this, args);
     }
-    [dartx.getNumberOfChars]() {
-      return this.getNumberOfChars();
+    [dartx.getNumberOfChars](...args) {
+      return this.getNumberOfChars.apply(this, args);
     }
-    [dartx.getRotationOfChar](charnum) {
-      return this.getRotationOfChar(charnum);
+    [dartx.getRotationOfChar](...args) {
+      return this.getRotationOfChar.apply(this, args);
     }
-    [dartx.getStartPositionOfChar](charnum) {
-      return this.getStartPositionOfChar(charnum);
+    [dartx.getStartPositionOfChar](...args) {
+      return this.getStartPositionOfChar.apply(this, args);
     }
-    [dartx.getSubStringLength](charnum, nchars) {
-      return this.getSubStringLength(charnum, nchars);
+    [dartx.getSubStringLength](...args) {
+      return this.getSubStringLength.apply(this, args);
     }
-    [dartx.selectSubString](charnum, nchars) {
-      return this.selectSubString(charnum, nchars);
+    [dartx.selectSubString](...args) {
+      return this.selectSubString.apply(this, args);
     }
   };
   dart.defineNamedConstructor(svg$.TextContentElement, 'created');
@@ -89446,7 +91292,28 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get requiredExtensions() {
+      return this[requiredExtensions];
+    }
+    set requiredExtensions(value) {
+      super.requiredExtensions = value;
+    }
+    get requiredFeatures() {
+      return this[requiredFeatures];
+    }
+    set requiredFeatures(value) {
+      super.requiredFeatures = value;
+    }
+    get systemLanguage() {
+      return this[systemLanguage];
+    }
+    set systemLanguage(value) {
+      super.systemLanguage = value;
+    }
   };
+  const requiredExtensions = Symbol(svg$.Tests.name + "." + 'requiredExtensions'.toString());
+  const requiredFeatures = Symbol(svg$.Tests.name + "." + 'requiredFeatures'.toString());
+  const systemLanguage = Symbol(svg$.Tests.name + "." + 'systemLanguage'.toString());
   dart.setSignature(svg$.Tests, {
     constructors: () => ({_: dart.definiteFunctionType(svg$.Tests, [])}),
     fields: () => ({
@@ -89579,23 +91446,23 @@
     get [dartx.type]() {
       return this.type;
     }
-    [dartx.setMatrix](matrix) {
-      return this.setMatrix(matrix);
+    [dartx.setMatrix](...args) {
+      return this.setMatrix.apply(this, args);
     }
-    [dartx.setRotate](angle, cx, cy) {
-      return this.setRotate(angle, cx, cy);
+    [dartx.setRotate](...args) {
+      return this.setRotate.apply(this, args);
     }
-    [dartx.setScale](sx, sy) {
-      return this.setScale(sx, sy);
+    [dartx.setScale](...args) {
+      return this.setScale.apply(this, args);
     }
-    [dartx.setSkewX](angle) {
-      return this.setSkewX(angle);
+    [dartx.setSkewX](...args) {
+      return this.setSkewX.apply(this, args);
     }
-    [dartx.setSkewY](angle) {
-      return this.setSkewY(angle);
+    [dartx.setSkewY](...args) {
+      return this.setSkewY.apply(this, args);
     }
-    [dartx.setTranslate](tx, ty) {
-      return this.setTranslate(tx, ty);
+    [dartx.setTranslate](...args) {
+      return this.setTranslate.apply(this, args);
     }
   };
   dart.setSignature(svg$.Transform, {
@@ -89633,8 +91500,8 @@
   dart.registerExtension(dart.global.SVGTransform, svg$.Transform);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -89661,11 +91528,11 @@
     get [dartx.numberOfItems]() {
       return this.numberOfItems;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.getItem](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -89694,37 +91561,37 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__setter__$](index, newItem) {
-      return this.__setter__(index, newItem);
+    [__setter__$](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.appendItem](newItem) {
-      return this.appendItem(newItem);
+    [dartx.appendItem](...args) {
+      return this.appendItem.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.consolidate]() {
-      return this.consolidate();
+    [dartx.consolidate](...args) {
+      return this.consolidate.apply(this, args);
     }
-    [dartx.createSvgTransformFromMatrix](matrix) {
-      return this.createSVGTransformFromMatrix(matrix);
+    [dartx.createSvgTransformFromMatrix](...args) {
+      return this.createSVGTransformFromMatrix.apply(this, args);
     }
-    [dartx.getItem](index) {
-      return this.getItem(index);
+    [dartx.getItem](...args) {
+      return this.getItem.apply(this, args);
     }
-    [dartx.initialize](newItem) {
-      return this.initialize(newItem);
+    [dartx.initialize](...args) {
+      return this.initialize.apply(this, args);
     }
-    [dartx.insertItemBefore](newItem, index) {
-      return this.insertItemBefore(newItem, index);
+    [dartx.insertItemBefore](...args) {
+      return this.insertItemBefore.apply(this, args);
     }
-    [dartx.removeItem](index) {
-      return this.removeItem(index);
+    [dartx.removeItem](...args) {
+      return this.removeItem.apply(this, args);
     }
-    [dartx.replaceItem](newItem, index) {
-      return this.replaceItem(newItem, index);
+    [dartx.replaceItem](...args) {
+      return this.replaceItem.apply(this, args);
     }
   };
   svg$.TransformList[dart.implements] = () => [ListOfTransform()];
@@ -89739,8 +91606,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(svg$.Transform, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, svg$.Transform]),
+      [dartx._get]: dart.definiteFunctionType(svg$.Transform, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, svg$.Transform]),
       [dartx.elementAt]: dart.definiteFunctionType(svg$.Transform, [core.int]),
       [__setter__$]: dart.definiteFunctionType(dart.void, [core.int, svg$.Transform]),
       [dartx.appendItem]: dart.definiteFunctionType(svg$.Transform, [svg$.Transform]),
@@ -89778,7 +91645,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get href() {
+      return this[href$0];
+    }
+    set href(value) {
+      super.href = value;
+    }
   };
+  const href$0 = Symbol(svg$.UriReference.name + "." + 'href'.toString());
   dart.setSignature(svg$.UriReference, {
     constructors: () => ({_: dart.definiteFunctionType(svg$.UriReference, [])}),
     fields: () => ({href: svg$.AnimatedString})
@@ -89960,7 +91834,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get zoomAndPan() {
+      return this[zoomAndPan];
+    }
+    set zoomAndPan(value) {
+      this[zoomAndPan] = value;
+    }
   };
+  const zoomAndPan = Symbol(svg$.ZoomAndPan.name + "." + 'zoomAndPan'.toString());
   dart.setSignature(svg$.ZoomAndPan, {
     constructors: () => ({_: dart.definiteFunctionType(svg$.ZoomAndPan, [])}),
     fields: () => ({zoomAndPan: core.int}),
@@ -90118,11 +91999,11 @@
     get [dartx.numberOfOutputs]() {
       return this.numberOfOutputs;
     }
-    [_connect](destination, output, input) {
-      return this.connect(destination, output, input);
+    [_connect](...args) {
+      return this.connect.apply(this, args);
     }
-    [dartx.disconnect](output) {
-      return this.disconnect(output);
+    [dartx.disconnect](...args) {
+      return this.disconnect.apply(this, args);
     }
     [dartx.connectNode](destination, output, input) {
       if (output === void 0) output = 0;
@@ -90194,17 +92075,17 @@
     set [dartx.smoothingTimeConstant](value) {
       this.smoothingTimeConstant = value;
     }
-    [dartx.getByteFrequencyData](array) {
-      return this.getByteFrequencyData(array);
+    [dartx.getByteFrequencyData](...args) {
+      return this.getByteFrequencyData.apply(this, args);
     }
-    [dartx.getByteTimeDomainData](array) {
-      return this.getByteTimeDomainData(array);
+    [dartx.getByteTimeDomainData](...args) {
+      return this.getByteTimeDomainData.apply(this, args);
     }
-    [dartx.getFloatFrequencyData](array) {
-      return this.getFloatFrequencyData(array);
+    [dartx.getFloatFrequencyData](...args) {
+      return this.getFloatFrequencyData.apply(this, args);
     }
-    [dartx.getFloatTimeDomainData](array) {
-      return this.getFloatTimeDomainData(array);
+    [dartx.getFloatTimeDomainData](...args) {
+      return this.getFloatTimeDomainData.apply(this, args);
     }
   };
   dart.setSignature(web_audio.AnalyserNode, {
@@ -90224,6 +92105,7 @@
     })
   });
   dart.registerExtension(dart.global.AnalyserNode, web_audio.AnalyserNode);
+  dart.registerExtension(dart.global.RealtimeAnalyserNode, web_audio.AnalyserNode);
   dart.defineExtensionNames([
     'getChannelData',
     'duration',
@@ -90247,8 +92129,8 @@
     get [dartx.sampleRate]() {
       return this.sampleRate;
     }
-    [dartx.getChannelData](channelIndex) {
-      return this.getChannelData(channelIndex);
+    [dartx.getChannelData](...args) {
+      return this.getChannelData.apply(this, args);
     }
   };
   dart.setSignature(web_audio.AudioBuffer, {
@@ -90410,59 +92292,59 @@
     get [dartx.sampleRate]() {
       return this.sampleRate;
     }
-    [dartx.createAnalyser]() {
-      return this.createAnalyser();
+    [dartx.createAnalyser](...args) {
+      return this.createAnalyser.apply(this, args);
     }
-    [dartx.createBiquadFilter]() {
-      return this.createBiquadFilter();
+    [dartx.createBiquadFilter](...args) {
+      return this.createBiquadFilter.apply(this, args);
     }
-    [dartx.createBuffer](numberOfChannels, numberOfFrames, sampleRate) {
-      return this.createBuffer(numberOfChannels, numberOfFrames, sampleRate);
+    [dartx.createBuffer](...args) {
+      return this.createBuffer.apply(this, args);
     }
-    [dartx.createBufferSource]() {
-      return this.createBufferSource();
+    [dartx.createBufferSource](...args) {
+      return this.createBufferSource.apply(this, args);
     }
-    [dartx.createChannelMerger](numberOfInputs) {
-      return this.createChannelMerger(numberOfInputs);
+    [dartx.createChannelMerger](...args) {
+      return this.createChannelMerger.apply(this, args);
     }
-    [dartx.createChannelSplitter](numberOfOutputs) {
-      return this.createChannelSplitter(numberOfOutputs);
+    [dartx.createChannelSplitter](...args) {
+      return this.createChannelSplitter.apply(this, args);
     }
-    [dartx.createConvolver]() {
-      return this.createConvolver();
+    [dartx.createConvolver](...args) {
+      return this.createConvolver.apply(this, args);
     }
-    [dartx.createDelay](maxDelayTime) {
-      return this.createDelay(maxDelayTime);
+    [dartx.createDelay](...args) {
+      return this.createDelay.apply(this, args);
     }
-    [dartx.createDynamicsCompressor]() {
-      return this.createDynamicsCompressor();
+    [dartx.createDynamicsCompressor](...args) {
+      return this.createDynamicsCompressor.apply(this, args);
     }
-    [dartx.createMediaElementSource](mediaElement) {
-      return this.createMediaElementSource(mediaElement);
+    [dartx.createMediaElementSource](...args) {
+      return this.createMediaElementSource.apply(this, args);
     }
-    [dartx.createMediaStreamDestination]() {
-      return this.createMediaStreamDestination();
+    [dartx.createMediaStreamDestination](...args) {
+      return this.createMediaStreamDestination.apply(this, args);
     }
-    [dartx.createMediaStreamSource](mediaStream) {
-      return this.createMediaStreamSource(mediaStream);
+    [dartx.createMediaStreamSource](...args) {
+      return this.createMediaStreamSource.apply(this, args);
     }
-    [dartx.createOscillator]() {
-      return this.createOscillator();
+    [dartx.createOscillator](...args) {
+      return this.createOscillator.apply(this, args);
     }
-    [dartx.createPanner]() {
-      return this.createPanner();
+    [dartx.createPanner](...args) {
+      return this.createPanner.apply(this, args);
     }
-    [dartx.createPeriodicWave](real, imag) {
-      return this.createPeriodicWave(real, imag);
+    [dartx.createPeriodicWave](...args) {
+      return this.createPeriodicWave.apply(this, args);
     }
-    [dartx.createWaveShaper]() {
-      return this.createWaveShaper();
+    [dartx.createWaveShaper](...args) {
+      return this.createWaveShaper.apply(this, args);
     }
-    [_decodeAudioData](audioData, successCallback, errorCallback) {
-      return this.decodeAudioData(audioData, successCallback, errorCallback);
+    [_decodeAudioData](...args) {
+      return this.decodeAudioData.apply(this, args);
     }
-    [dartx.startRendering]() {
-      return this.startRendering();
+    [dartx.startRendering](...args) {
+      return this.startRendering.apply(this, args);
     }
     get [dartx.onComplete]() {
       return web_audio.AudioContext.completeEvent.forTarget(this);
@@ -90543,6 +92425,7 @@
   });
   web_audio.AudioContext.completeEvent = dart.const(new (EventStreamProviderOfEvent())('complete'));
   dart.registerExtension(dart.global.AudioContext, web_audio.AudioContext);
+  dart.registerExtension(dart.global.webkitAudioContext, web_audio.AudioContext);
   dart.defineExtensionNames([
     'maxChannelCount'
   ]);
@@ -90582,14 +92465,14 @@
     set [dartx.speedOfSound](value) {
       this.speedOfSound = value;
     }
-    [dartx.setOrientation](x, y, z, xUp, yUp, zUp) {
-      return this.setOrientation(x, y, z, xUp, yUp, zUp);
+    [dartx.setOrientation](...args) {
+      return this.setOrientation.apply(this, args);
     }
-    [dartx.setPosition](x, y, z) {
-      return this.setPosition(x, y, z);
+    [dartx.setPosition](...args) {
+      return this.setPosition.apply(this, args);
     }
-    [dartx.setVelocity](x, y, z) {
-      return this.setVelocity(x, y, z);
+    [dartx.setVelocity](...args) {
+      return this.setVelocity.apply(this, args);
     }
   };
   dart.setSignature(web_audio.AudioListener, {
@@ -90628,23 +92511,23 @@
     set [dartx.value](value) {
       this.value = value;
     }
-    [dartx.cancelScheduledValues](startTime) {
-      return this.cancelScheduledValues(startTime);
+    [dartx.cancelScheduledValues](...args) {
+      return this.cancelScheduledValues.apply(this, args);
     }
-    [dartx.exponentialRampToValueAtTime](value, time) {
-      return this.exponentialRampToValueAtTime(value, time);
+    [dartx.exponentialRampToValueAtTime](...args) {
+      return this.exponentialRampToValueAtTime.apply(this, args);
     }
-    [dartx.linearRampToValueAtTime](value, time) {
-      return this.linearRampToValueAtTime(value, time);
+    [dartx.linearRampToValueAtTime](...args) {
+      return this.linearRampToValueAtTime.apply(this, args);
     }
-    [dartx.setTargetAtTime](target, time, timeConstant) {
-      return this.setTargetAtTime(target, time, timeConstant);
+    [dartx.setTargetAtTime](...args) {
+      return this.setTargetAtTime.apply(this, args);
     }
-    [dartx.setValueAtTime](value, time) {
-      return this.setValueAtTime(value, time);
+    [dartx.setValueAtTime](...args) {
+      return this.setValueAtTime.apply(this, args);
     }
-    [dartx.setValueCurveAtTime](values, time, duration) {
-      return this.setValueCurveAtTime(values, time, duration);
+    [dartx.setValueCurveAtTime](...args) {
+      return this.setValueCurveAtTime.apply(this, args);
     }
   };
   dart.setSignature(web_audio.AudioParam, {
@@ -90721,8 +92604,8 @@
     set [dartx.type](value) {
       this.type = value;
     }
-    [dartx.getFrequencyResponse](frequencyHz, magResponse, phaseResponse) {
-      return this.getFrequencyResponse(frequencyHz, magResponse, phaseResponse);
+    [dartx.getFrequencyResponse](...args) {
+      return this.getFrequencyResponse.apply(this, args);
     }
   };
   dart.setSignature(web_audio.BiquadFilterNode, {
@@ -90746,6 +92629,7 @@
     constructors: () => ({_: dart.definiteFunctionType(web_audio.ChannelMergerNode, [])})
   });
   dart.registerExtension(dart.global.ChannelMergerNode, web_audio.ChannelMergerNode);
+  dart.registerExtension(dart.global.AudioChannelMerger, web_audio.ChannelMergerNode);
   web_audio.ChannelSplitterNode = class ChannelSplitterNode extends web_audio.AudioNode {
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
@@ -90755,6 +92639,7 @@
     constructors: () => ({_: dart.definiteFunctionType(web_audio.ChannelSplitterNode, [])})
   });
   dart.registerExtension(dart.global.ChannelSplitterNode, web_audio.ChannelSplitterNode);
+  dart.registerExtension(dart.global.AudioChannelSplitter, web_audio.ChannelSplitterNode);
   dart.defineExtensionNames([
     'buffer',
     'normalize'
@@ -90859,6 +92744,7 @@
     fields: () => ({[dartx.gain]: web_audio.AudioParam})
   });
   dart.registerExtension(dart.global.GainNode, web_audio.GainNode);
+  dart.registerExtension(dart.global.AudioGainNode, web_audio.GainNode);
   dart.defineExtensionNames([
     'mediaElement'
   ]);
@@ -90970,20 +92856,20 @@
     set [dartx.type](value) {
       this.type = value;
     }
-    [dartx.noteOff](when) {
-      return this.noteOff(when);
+    [dartx.noteOff](...args) {
+      return this.noteOff.apply(this, args);
     }
-    [dartx.noteOn](when) {
-      return this.noteOn(when);
+    [dartx.noteOn](...args) {
+      return this.noteOn.apply(this, args);
     }
-    [dartx.setPeriodicWave](periodicWave) {
-      return this.setPeriodicWave(periodicWave);
+    [dartx.setPeriodicWave](...args) {
+      return this.setPeriodicWave.apply(this, args);
     }
-    [dartx.start](when) {
-      return this.start(when);
+    [dartx.start](...args) {
+      return this.start.apply(this, args);
     }
-    [dartx.stop](when) {
-      return this.stop(when);
+    [dartx.stop](...args) {
+      return this.stop.apply(this, args);
     }
     get [dartx.onEnded]() {
       return web_audio.OscillatorNode.endedEvent.forTarget(this);
@@ -91008,6 +92894,7 @@
   });
   web_audio.OscillatorNode.endedEvent = dart.const(new (EventStreamProviderOfEvent())('ended'));
   dart.registerExtension(dart.global.OscillatorNode, web_audio.OscillatorNode);
+  dart.registerExtension(dart.global.Oscillator, web_audio.OscillatorNode);
   dart.defineExtensionNames([
     'setOrientation',
     'setPosition',
@@ -91073,14 +92960,14 @@
     set [dartx.rolloffFactor](value) {
       this.rolloffFactor = value;
     }
-    [dartx.setOrientation](x, y, z) {
-      return this.setOrientation(x, y, z);
+    [dartx.setOrientation](...args) {
+      return this.setOrientation.apply(this, args);
     }
-    [dartx.setPosition](x, y, z) {
-      return this.setPosition(x, y, z);
+    [dartx.setPosition](...args) {
+      return this.setPosition.apply(this, args);
     }
-    [dartx.setVelocity](x, y, z) {
-      return this.setVelocity(x, y, z);
+    [dartx.setVelocity](...args) {
+      return this.setVelocity.apply(this, args);
     }
   };
   dart.setSignature(web_audio.PannerNode, {
@@ -91102,6 +92989,8 @@
     })
   });
   dart.registerExtension(dart.global.PannerNode, web_audio.PannerNode);
+  dart.registerExtension(dart.global.AudioPannerNode, web_audio.PannerNode);
+  dart.registerExtension(dart.global.webkitAudioPannerNode, web_audio.PannerNode);
   web_audio.PeriodicWave = class PeriodicWave extends _interceptors.Interceptor {
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
@@ -91123,8 +93012,8 @@
     get [dartx.bufferSize]() {
       return this.bufferSize;
     }
-    [dartx.setEventListener](eventListener) {
-      return this.setEventListener(eventListener);
+    [dartx.setEventListener](...args) {
+      return this.setEventListener.apply(this, args);
     }
     get [dartx.onAudioProcess]() {
       return web_audio.ScriptProcessorNode.audioProcessEvent.forTarget(this);
@@ -91139,6 +93028,7 @@
   });
   web_audio.ScriptProcessorNode.audioProcessEvent = dart.const(new (EventStreamProviderOfAudioProcessingEvent())('audioprocess'));
   dart.registerExtension(dart.global.ScriptProcessorNode, web_audio.ScriptProcessorNode);
+  dart.registerExtension(dart.global.JavaScriptAudioNode, web_audio.ScriptProcessorNode);
   dart.defineExtensionNames([
     'curve',
     'oversample'
@@ -91354,323 +93244,323 @@
     get [dartx.drawingBufferWidth]() {
       return this.drawingBufferWidth;
     }
-    [dartx.activeTexture](texture) {
-      return this.activeTexture(texture);
+    [dartx.activeTexture](...args) {
+      return this.activeTexture.apply(this, args);
     }
-    [dartx.attachShader](program, shader) {
-      return this.attachShader(program, shader);
+    [dartx.attachShader](...args) {
+      return this.attachShader.apply(this, args);
     }
-    [dartx.bindAttribLocation](program, index, name) {
-      return this.bindAttribLocation(program, index, name);
+    [dartx.bindAttribLocation](...args) {
+      return this.bindAttribLocation.apply(this, args);
     }
-    [dartx.bindBuffer](target, buffer) {
-      return this.bindBuffer(target, buffer);
+    [dartx.bindBuffer](...args) {
+      return this.bindBuffer.apply(this, args);
     }
-    [dartx.bindFramebuffer](target, framebuffer) {
-      return this.bindFramebuffer(target, framebuffer);
+    [dartx.bindFramebuffer](...args) {
+      return this.bindFramebuffer.apply(this, args);
     }
-    [dartx.bindRenderbuffer](target, renderbuffer) {
-      return this.bindRenderbuffer(target, renderbuffer);
+    [dartx.bindRenderbuffer](...args) {
+      return this.bindRenderbuffer.apply(this, args);
     }
-    [dartx.bindTexture](target, texture) {
-      return this.bindTexture(target, texture);
+    [dartx.bindTexture](...args) {
+      return this.bindTexture.apply(this, args);
     }
-    [dartx.blendColor](red, green, blue, alpha) {
-      return this.blendColor(red, green, blue, alpha);
+    [dartx.blendColor](...args) {
+      return this.blendColor.apply(this, args);
     }
-    [dartx.blendEquation](mode) {
-      return this.blendEquation(mode);
+    [dartx.blendEquation](...args) {
+      return this.blendEquation.apply(this, args);
     }
-    [dartx.blendEquationSeparate](modeRGB, modeAlpha) {
-      return this.blendEquationSeparate(modeRGB, modeAlpha);
+    [dartx.blendEquationSeparate](...args) {
+      return this.blendEquationSeparate.apply(this, args);
     }
-    [dartx.blendFunc](sfactor, dfactor) {
-      return this.blendFunc(sfactor, dfactor);
+    [dartx.blendFunc](...args) {
+      return this.blendFunc.apply(this, args);
     }
-    [dartx.blendFuncSeparate](srcRGB, dstRGB, srcAlpha, dstAlpha) {
-      return this.blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
+    [dartx.blendFuncSeparate](...args) {
+      return this.blendFuncSeparate.apply(this, args);
     }
-    [dartx.bufferByteData](target, data, usage) {
-      return this.bufferData(target, data, usage);
+    [dartx.bufferByteData](...args) {
+      return this.bufferData.apply(this, args);
     }
-    [dartx.bufferData](target, data_OR_size, usage) {
-      return this.bufferData(target, data_OR_size, usage);
+    [dartx.bufferData](...args) {
+      return this.bufferData.apply(this, args);
     }
-    [dartx.bufferDataTyped](target, data, usage) {
-      return this.bufferData(target, data, usage);
+    [dartx.bufferDataTyped](...args) {
+      return this.bufferData.apply(this, args);
     }
-    [dartx.bufferSubByteData](target, offset, data) {
-      return this.bufferSubData(target, offset, data);
+    [dartx.bufferSubByteData](...args) {
+      return this.bufferSubData.apply(this, args);
     }
-    [dartx.bufferSubData](target, offset, data) {
-      return this.bufferSubData(target, offset, data);
+    [dartx.bufferSubData](...args) {
+      return this.bufferSubData.apply(this, args);
     }
-    [dartx.bufferSubDataTyped](target, offset, data) {
-      return this.bufferSubData(target, offset, data);
+    [dartx.bufferSubDataTyped](...args) {
+      return this.bufferSubData.apply(this, args);
     }
-    [dartx.checkFramebufferStatus](target) {
-      return this.checkFramebufferStatus(target);
+    [dartx.checkFramebufferStatus](...args) {
+      return this.checkFramebufferStatus.apply(this, args);
     }
-    [dartx.clear](mask) {
-      return this.clear(mask);
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.clearColor](red, green, blue, alpha) {
-      return this.clearColor(red, green, blue, alpha);
+    [dartx.clearColor](...args) {
+      return this.clearColor.apply(this, args);
     }
-    [dartx.clearDepth](depth) {
-      return this.clearDepth(depth);
+    [dartx.clearDepth](...args) {
+      return this.clearDepth.apply(this, args);
     }
-    [dartx.clearStencil](s) {
-      return this.clearStencil(s);
+    [dartx.clearStencil](...args) {
+      return this.clearStencil.apply(this, args);
     }
-    [dartx.colorMask](red, green, blue, alpha) {
-      return this.colorMask(red, green, blue, alpha);
+    [dartx.colorMask](...args) {
+      return this.colorMask.apply(this, args);
     }
-    [dartx.compileShader](shader) {
-      return this.compileShader(shader);
+    [dartx.compileShader](...args) {
+      return this.compileShader.apply(this, args);
     }
-    [dartx.compressedTexImage2D](target, level, internalformat, width, height, border, data) {
-      return this.compressedTexImage2D(target, level, internalformat, width, height, border, data);
+    [dartx.compressedTexImage2D](...args) {
+      return this.compressedTexImage2D.apply(this, args);
     }
-    [dartx.compressedTexSubImage2D](target, level, xoffset, yoffset, width, height, format, data) {
-      return this.compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, data);
+    [dartx.compressedTexSubImage2D](...args) {
+      return this.compressedTexSubImage2D.apply(this, args);
     }
-    [dartx.copyTexImage2D](target, level, internalformat, x, y, width, height, border) {
-      return this.copyTexImage2D(target, level, internalformat, x, y, width, height, border);
+    [dartx.copyTexImage2D](...args) {
+      return this.copyTexImage2D.apply(this, args);
     }
-    [dartx.copyTexSubImage2D](target, level, xoffset, yoffset, x, y, width, height) {
-      return this.copyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
+    [dartx.copyTexSubImage2D](...args) {
+      return this.copyTexSubImage2D.apply(this, args);
     }
-    [dartx.createBuffer]() {
-      return this.createBuffer();
+    [dartx.createBuffer](...args) {
+      return this.createBuffer.apply(this, args);
     }
-    [dartx.createFramebuffer]() {
-      return this.createFramebuffer();
+    [dartx.createFramebuffer](...args) {
+      return this.createFramebuffer.apply(this, args);
     }
-    [dartx.createProgram]() {
-      return this.createProgram();
+    [dartx.createProgram](...args) {
+      return this.createProgram.apply(this, args);
     }
-    [dartx.createRenderbuffer]() {
-      return this.createRenderbuffer();
+    [dartx.createRenderbuffer](...args) {
+      return this.createRenderbuffer.apply(this, args);
     }
-    [dartx.createShader](type) {
-      return this.createShader(type);
+    [dartx.createShader](...args) {
+      return this.createShader.apply(this, args);
     }
-    [dartx.createTexture]() {
-      return this.createTexture();
+    [dartx.createTexture](...args) {
+      return this.createTexture.apply(this, args);
     }
-    [dartx.cullFace](mode) {
-      return this.cullFace(mode);
+    [dartx.cullFace](...args) {
+      return this.cullFace.apply(this, args);
     }
-    [dartx.deleteBuffer](buffer) {
-      return this.deleteBuffer(buffer);
+    [dartx.deleteBuffer](...args) {
+      return this.deleteBuffer.apply(this, args);
     }
-    [dartx.deleteFramebuffer](framebuffer) {
-      return this.deleteFramebuffer(framebuffer);
+    [dartx.deleteFramebuffer](...args) {
+      return this.deleteFramebuffer.apply(this, args);
     }
-    [dartx.deleteProgram](program) {
-      return this.deleteProgram(program);
+    [dartx.deleteProgram](...args) {
+      return this.deleteProgram.apply(this, args);
     }
-    [dartx.deleteRenderbuffer](renderbuffer) {
-      return this.deleteRenderbuffer(renderbuffer);
+    [dartx.deleteRenderbuffer](...args) {
+      return this.deleteRenderbuffer.apply(this, args);
     }
-    [dartx.deleteShader](shader) {
-      return this.deleteShader(shader);
+    [dartx.deleteShader](...args) {
+      return this.deleteShader.apply(this, args);
     }
-    [dartx.deleteTexture](texture) {
-      return this.deleteTexture(texture);
+    [dartx.deleteTexture](...args) {
+      return this.deleteTexture.apply(this, args);
     }
-    [dartx.depthFunc](func) {
-      return this.depthFunc(func);
+    [dartx.depthFunc](...args) {
+      return this.depthFunc.apply(this, args);
     }
-    [dartx.depthMask](flag) {
-      return this.depthMask(flag);
+    [dartx.depthMask](...args) {
+      return this.depthMask.apply(this, args);
     }
-    [dartx.depthRange](zNear, zFar) {
-      return this.depthRange(zNear, zFar);
+    [dartx.depthRange](...args) {
+      return this.depthRange.apply(this, args);
     }
-    [dartx.detachShader](program, shader) {
-      return this.detachShader(program, shader);
+    [dartx.detachShader](...args) {
+      return this.detachShader.apply(this, args);
     }
-    [dartx.disable](cap) {
-      return this.disable(cap);
+    [dartx.disable](...args) {
+      return this.disable.apply(this, args);
     }
-    [dartx.disableVertexAttribArray](index) {
-      return this.disableVertexAttribArray(index);
+    [dartx.disableVertexAttribArray](...args) {
+      return this.disableVertexAttribArray.apply(this, args);
     }
-    [dartx.drawArrays](mode, first, count) {
-      return this.drawArrays(mode, first, count);
+    [dartx.drawArrays](...args) {
+      return this.drawArrays.apply(this, args);
     }
-    [dartx.drawElements](mode, count, type, offset) {
-      return this.drawElements(mode, count, type, offset);
+    [dartx.drawElements](...args) {
+      return this.drawElements.apply(this, args);
     }
-    [dartx.enable](cap) {
-      return this.enable(cap);
+    [dartx.enable](...args) {
+      return this.enable.apply(this, args);
     }
-    [dartx.enableVertexAttribArray](index) {
-      return this.enableVertexAttribArray(index);
+    [dartx.enableVertexAttribArray](...args) {
+      return this.enableVertexAttribArray.apply(this, args);
     }
-    [dartx.finish]() {
-      return this.finish();
+    [dartx.finish](...args) {
+      return this.finish.apply(this, args);
     }
-    [dartx.flush]() {
-      return this.flush();
+    [dartx.flush](...args) {
+      return this.flush.apply(this, args);
     }
-    [dartx.framebufferRenderbuffer](target, attachment, renderbuffertarget, renderbuffer) {
-      return this.framebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
+    [dartx.framebufferRenderbuffer](...args) {
+      return this.framebufferRenderbuffer.apply(this, args);
     }
-    [dartx.framebufferTexture2D](target, attachment, textarget, texture, level) {
-      return this.framebufferTexture2D(target, attachment, textarget, texture, level);
+    [dartx.framebufferTexture2D](...args) {
+      return this.framebufferTexture2D.apply(this, args);
     }
-    [dartx.frontFace](mode) {
-      return this.frontFace(mode);
+    [dartx.frontFace](...args) {
+      return this.frontFace.apply(this, args);
     }
-    [dartx.generateMipmap](target) {
-      return this.generateMipmap(target);
+    [dartx.generateMipmap](...args) {
+      return this.generateMipmap.apply(this, args);
     }
-    [dartx.getActiveAttrib](program, index) {
-      return this.getActiveAttrib(program, index);
+    [dartx.getActiveAttrib](...args) {
+      return this.getActiveAttrib.apply(this, args);
     }
-    [dartx.getActiveUniform](program, index) {
-      return this.getActiveUniform(program, index);
+    [dartx.getActiveUniform](...args) {
+      return this.getActiveUniform.apply(this, args);
     }
-    [dartx.getAttachedShaders](program) {
-      return this.getAttachedShaders(program);
+    [dartx.getAttachedShaders](...args) {
+      return this.getAttachedShaders.apply(this, args);
     }
-    [dartx.getAttribLocation](program, name) {
-      return this.getAttribLocation(program, name);
+    [dartx.getAttribLocation](...args) {
+      return this.getAttribLocation.apply(this, args);
     }
-    [dartx.getBufferParameter](target, pname) {
-      return this.getBufferParameter(target, pname);
+    [dartx.getBufferParameter](...args) {
+      return this.getBufferParameter.apply(this, args);
     }
     [dartx.getContextAttributes]() {
       return web_gl.ContextAttributes._check(html_common.convertNativeToDart_ContextAttributes(this[_getContextAttributes_1$]()));
     }
-    [_getContextAttributes_1$]() {
-      return this.getContextAttributes();
+    [_getContextAttributes_1$](...args) {
+      return this.getContextAttributes.apply(this, args);
     }
-    [dartx.getError]() {
-      return this.getError();
+    [dartx.getError](...args) {
+      return this.getError.apply(this, args);
     }
-    [dartx.getExtension](name) {
-      return this.getExtension(name);
+    [dartx.getExtension](...args) {
+      return this.getExtension.apply(this, args);
     }
-    [dartx.getFramebufferAttachmentParameter](target, attachment, pname) {
-      return this.getFramebufferAttachmentParameter(target, attachment, pname);
+    [dartx.getFramebufferAttachmentParameter](...args) {
+      return this.getFramebufferAttachmentParameter.apply(this, args);
     }
-    [dartx.getParameter](pname) {
-      return this.getParameter(pname);
+    [dartx.getParameter](...args) {
+      return this.getParameter.apply(this, args);
     }
-    [dartx.getProgramInfoLog](program) {
-      return this.getProgramInfoLog(program);
+    [dartx.getProgramInfoLog](...args) {
+      return this.getProgramInfoLog.apply(this, args);
     }
-    [dartx.getProgramParameter](program, pname) {
-      return this.getProgramParameter(program, pname);
+    [dartx.getProgramParameter](...args) {
+      return this.getProgramParameter.apply(this, args);
     }
-    [dartx.getRenderbufferParameter](target, pname) {
-      return this.getRenderbufferParameter(target, pname);
+    [dartx.getRenderbufferParameter](...args) {
+      return this.getRenderbufferParameter.apply(this, args);
     }
-    [dartx.getShaderInfoLog](shader) {
-      return this.getShaderInfoLog(shader);
+    [dartx.getShaderInfoLog](...args) {
+      return this.getShaderInfoLog.apply(this, args);
     }
-    [dartx.getShaderParameter](shader, pname) {
-      return this.getShaderParameter(shader, pname);
+    [dartx.getShaderParameter](...args) {
+      return this.getShaderParameter.apply(this, args);
     }
-    [dartx.getShaderPrecisionFormat](shadertype, precisiontype) {
-      return this.getShaderPrecisionFormat(shadertype, precisiontype);
+    [dartx.getShaderPrecisionFormat](...args) {
+      return this.getShaderPrecisionFormat.apply(this, args);
     }
-    [dartx.getShaderSource](shader) {
-      return this.getShaderSource(shader);
+    [dartx.getShaderSource](...args) {
+      return this.getShaderSource.apply(this, args);
     }
-    [dartx.getSupportedExtensions]() {
-      return this.getSupportedExtensions();
+    [dartx.getSupportedExtensions](...args) {
+      return this.getSupportedExtensions.apply(this, args);
     }
-    [dartx.getTexParameter](target, pname) {
-      return this.getTexParameter(target, pname);
+    [dartx.getTexParameter](...args) {
+      return this.getTexParameter.apply(this, args);
     }
-    [dartx.getUniform](program, location) {
-      return this.getUniform(program, location);
+    [dartx.getUniform](...args) {
+      return this.getUniform.apply(this, args);
     }
-    [dartx.getUniformLocation](program, name) {
-      return this.getUniformLocation(program, name);
+    [dartx.getUniformLocation](...args) {
+      return this.getUniformLocation.apply(this, args);
     }
-    [dartx.getVertexAttrib](index, pname) {
-      return this.getVertexAttrib(index, pname);
+    [dartx.getVertexAttrib](...args) {
+      return this.getVertexAttrib.apply(this, args);
     }
-    [dartx.getVertexAttribOffset](index, pname) {
-      return this.getVertexAttribOffset(index, pname);
+    [dartx.getVertexAttribOffset](...args) {
+      return this.getVertexAttribOffset.apply(this, args);
     }
-    [dartx.hint](target, mode) {
-      return this.hint(target, mode);
+    [dartx.hint](...args) {
+      return this.hint.apply(this, args);
     }
-    [dartx.isBuffer](buffer) {
-      return this.isBuffer(buffer);
+    [dartx.isBuffer](...args) {
+      return this.isBuffer.apply(this, args);
     }
-    [dartx.isContextLost]() {
-      return this.isContextLost();
+    [dartx.isContextLost](...args) {
+      return this.isContextLost.apply(this, args);
     }
-    [dartx.isEnabled](cap) {
-      return this.isEnabled(cap);
+    [dartx.isEnabled](...args) {
+      return this.isEnabled.apply(this, args);
     }
-    [dartx.isFramebuffer](framebuffer) {
-      return this.isFramebuffer(framebuffer);
+    [dartx.isFramebuffer](...args) {
+      return this.isFramebuffer.apply(this, args);
     }
-    [dartx.isProgram](program) {
-      return this.isProgram(program);
+    [dartx.isProgram](...args) {
+      return this.isProgram.apply(this, args);
     }
-    [dartx.isRenderbuffer](renderbuffer) {
-      return this.isRenderbuffer(renderbuffer);
+    [dartx.isRenderbuffer](...args) {
+      return this.isRenderbuffer.apply(this, args);
     }
-    [dartx.isShader](shader) {
-      return this.isShader(shader);
+    [dartx.isShader](...args) {
+      return this.isShader.apply(this, args);
     }
-    [dartx.isTexture](texture) {
-      return this.isTexture(texture);
+    [dartx.isTexture](...args) {
+      return this.isTexture.apply(this, args);
     }
-    [dartx.lineWidth](width) {
-      return this.lineWidth(width);
+    [dartx.lineWidth](...args) {
+      return this.lineWidth.apply(this, args);
     }
-    [dartx.linkProgram](program) {
-      return this.linkProgram(program);
+    [dartx.linkProgram](...args) {
+      return this.linkProgram.apply(this, args);
     }
-    [dartx.pixelStorei](pname, param) {
-      return this.pixelStorei(pname, param);
+    [dartx.pixelStorei](...args) {
+      return this.pixelStorei.apply(this, args);
     }
-    [dartx.polygonOffset](factor, units) {
-      return this.polygonOffset(factor, units);
+    [dartx.polygonOffset](...args) {
+      return this.polygonOffset.apply(this, args);
     }
-    [dartx.readPixels](x, y, width, height, format, type, pixels) {
-      return this.readPixels(x, y, width, height, format, type, pixels);
+    [dartx.readPixels](...args) {
+      return this.readPixels.apply(this, args);
     }
-    [dartx.renderbufferStorage](target, internalformat, width, height) {
-      return this.renderbufferStorage(target, internalformat, width, height);
+    [dartx.renderbufferStorage](...args) {
+      return this.renderbufferStorage.apply(this, args);
     }
-    [dartx.sampleCoverage](value, invert) {
-      return this.sampleCoverage(value, invert);
+    [dartx.sampleCoverage](...args) {
+      return this.sampleCoverage.apply(this, args);
     }
-    [dartx.scissor](x, y, width, height) {
-      return this.scissor(x, y, width, height);
+    [dartx.scissor](...args) {
+      return this.scissor.apply(this, args);
     }
-    [dartx.shaderSource](shader, string) {
-      return this.shaderSource(shader, string);
+    [dartx.shaderSource](...args) {
+      return this.shaderSource.apply(this, args);
     }
-    [dartx.stencilFunc](func, ref, mask) {
-      return this.stencilFunc(func, ref, mask);
+    [dartx.stencilFunc](...args) {
+      return this.stencilFunc.apply(this, args);
     }
-    [dartx.stencilFuncSeparate](face, func, ref, mask) {
-      return this.stencilFuncSeparate(face, func, ref, mask);
+    [dartx.stencilFuncSeparate](...args) {
+      return this.stencilFuncSeparate.apply(this, args);
     }
-    [dartx.stencilMask](mask) {
-      return this.stencilMask(mask);
+    [dartx.stencilMask](...args) {
+      return this.stencilMask.apply(this, args);
     }
-    [dartx.stencilMaskSeparate](face, mask) {
-      return this.stencilMaskSeparate(face, mask);
+    [dartx.stencilMaskSeparate](...args) {
+      return this.stencilMaskSeparate.apply(this, args);
     }
-    [dartx.stencilOp](fail, zfail, zpass) {
-      return this.stencilOp(fail, zfail, zpass);
+    [dartx.stencilOp](...args) {
+      return this.stencilOp.apply(this, args);
     }
-    [dartx.stencilOpSeparate](face, fail, zfail, zpass) {
-      return this.stencilOpSeparate(face, fail, zfail, zpass);
+    [dartx.stencilOpSeparate](...args) {
+      return this.stencilOpSeparate.apply(this, args);
     }
     [dartx.texImage2D](target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video, format, type, pixels) {
       if (format === void 0) format = null;
@@ -91699,43 +93589,43 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_texImage2D_1](target, level, internalformat, width, height, border, format, type, pixels) {
-      return this.texImage2D(target, level, internalformat, width, height, border, format, type, pixels);
+    [_texImage2D_1](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [_texImage2D_2](target, level, internalformat, format, type, pixels) {
-      return this.texImage2D(target, level, internalformat, format, type, pixels);
+    [_texImage2D_2](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [_texImage2D_3](target, level, internalformat, format, type, image) {
-      return this.texImage2D(target, level, internalformat, format, type, image);
+    [_texImage2D_3](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [_texImage2D_4](target, level, internalformat, format, type, canvas) {
-      return this.texImage2D(target, level, internalformat, format, type, canvas);
+    [_texImage2D_4](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [_texImage2D_5](target, level, internalformat, format, type, video) {
-      return this.texImage2D(target, level, internalformat, format, type, video);
+    [_texImage2D_5](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [dartx.texImage2DCanvas](target, level, internalformat, format, type, canvas) {
-      return this.texImage2D(target, level, internalformat, format, type, canvas);
+    [dartx.texImage2DCanvas](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [dartx.texImage2DImage](target, level, internalformat, format, type, image) {
-      return this.texImage2D(target, level, internalformat, format, type, image);
+    [dartx.texImage2DImage](...args) {
+      return this.texImage2D.apply(this, args);
     }
     [dartx.texImage2DImageData](target, level, internalformat, format, type, pixels) {
       let pixels_1 = html_common.convertDartToNative_ImageData(pixels);
       this[_texImage2DImageData_1](target, level, internalformat, format, type, pixels_1);
       return;
     }
-    [_texImage2DImageData_1](target, level, internalformat, format, type, pixels) {
-      return this.texImage2D(target, level, internalformat, format, type, pixels);
+    [_texImage2DImageData_1](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [dartx.texImage2DVideo](target, level, internalformat, format, type, video) {
-      return this.texImage2D(target, level, internalformat, format, type, video);
+    [dartx.texImage2DVideo](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [dartx.texParameterf](target, pname, param) {
-      return this.texParameterf(target, pname, param);
+    [dartx.texParameterf](...args) {
+      return this.texParameterf.apply(this, args);
     }
-    [dartx.texParameteri](target, pname, param) {
-      return this.texParameteri(target, pname, param);
+    [dartx.texParameteri](...args) {
+      return this.texParameteri.apply(this, args);
     }
     [dartx.texSubImage2D](target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, type, pixels) {
       if (type === void 0) type = null;
@@ -91763,142 +93653,142 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_texSubImage2D_1](target, level, xoffset, yoffset, width, height, format, type, pixels) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
+    [_texSubImage2D_1](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [_texSubImage2D_2](target, level, xoffset, yoffset, format, type, pixels) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, pixels);
+    [_texSubImage2D_2](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [_texSubImage2D_3](target, level, xoffset, yoffset, format, type, image) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, image);
+    [_texSubImage2D_3](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [_texSubImage2D_4](target, level, xoffset, yoffset, format, type, canvas) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, canvas);
+    [_texSubImage2D_4](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [_texSubImage2D_5](target, level, xoffset, yoffset, format, type, video) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, video);
+    [_texSubImage2D_5](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [dartx.texSubImage2DCanvas](target, level, xoffset, yoffset, format, type, canvas) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, canvas);
+    [dartx.texSubImage2DCanvas](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [dartx.texSubImage2DImage](target, level, xoffset, yoffset, format, type, image) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, image);
+    [dartx.texSubImage2DImage](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
     [dartx.texSubImage2DImageData](target, level, xoffset, yoffset, format, type, pixels) {
       let pixels_1 = html_common.convertDartToNative_ImageData(pixels);
       this[_texSubImage2DImageData_1](target, level, xoffset, yoffset, format, type, pixels_1);
       return;
     }
-    [_texSubImage2DImageData_1](target, level, xoffset, yoffset, format, type, pixels) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, pixels);
+    [_texSubImage2DImageData_1](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [dartx.texSubImage2DVideo](target, level, xoffset, yoffset, format, type, video) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, video);
+    [dartx.texSubImage2DVideo](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [dartx.uniform1f](location, x) {
-      return this.uniform1f(location, x);
+    [dartx.uniform1f](...args) {
+      return this.uniform1f.apply(this, args);
     }
-    [dartx.uniform1fv](location, v) {
-      return this.uniform1fv(location, v);
+    [dartx.uniform1fv](...args) {
+      return this.uniform1fv.apply(this, args);
     }
-    [dartx.uniform1i](location, x) {
-      return this.uniform1i(location, x);
+    [dartx.uniform1i](...args) {
+      return this.uniform1i.apply(this, args);
     }
-    [dartx.uniform1iv](location, v) {
-      return this.uniform1iv(location, v);
+    [dartx.uniform1iv](...args) {
+      return this.uniform1iv.apply(this, args);
     }
-    [dartx.uniform2f](location, x, y) {
-      return this.uniform2f(location, x, y);
+    [dartx.uniform2f](...args) {
+      return this.uniform2f.apply(this, args);
     }
-    [dartx.uniform2fv](location, v) {
-      return this.uniform2fv(location, v);
+    [dartx.uniform2fv](...args) {
+      return this.uniform2fv.apply(this, args);
     }
-    [dartx.uniform2i](location, x, y) {
-      return this.uniform2i(location, x, y);
+    [dartx.uniform2i](...args) {
+      return this.uniform2i.apply(this, args);
     }
-    [dartx.uniform2iv](location, v) {
-      return this.uniform2iv(location, v);
+    [dartx.uniform2iv](...args) {
+      return this.uniform2iv.apply(this, args);
     }
-    [dartx.uniform3f](location, x, y, z) {
-      return this.uniform3f(location, x, y, z);
+    [dartx.uniform3f](...args) {
+      return this.uniform3f.apply(this, args);
     }
-    [dartx.uniform3fv](location, v) {
-      return this.uniform3fv(location, v);
+    [dartx.uniform3fv](...args) {
+      return this.uniform3fv.apply(this, args);
     }
-    [dartx.uniform3i](location, x, y, z) {
-      return this.uniform3i(location, x, y, z);
+    [dartx.uniform3i](...args) {
+      return this.uniform3i.apply(this, args);
     }
-    [dartx.uniform3iv](location, v) {
-      return this.uniform3iv(location, v);
+    [dartx.uniform3iv](...args) {
+      return this.uniform3iv.apply(this, args);
     }
-    [dartx.uniform4f](location, x, y, z, w) {
-      return this.uniform4f(location, x, y, z, w);
+    [dartx.uniform4f](...args) {
+      return this.uniform4f.apply(this, args);
     }
-    [dartx.uniform4fv](location, v) {
-      return this.uniform4fv(location, v);
+    [dartx.uniform4fv](...args) {
+      return this.uniform4fv.apply(this, args);
     }
-    [dartx.uniform4i](location, x, y, z, w) {
-      return this.uniform4i(location, x, y, z, w);
+    [dartx.uniform4i](...args) {
+      return this.uniform4i.apply(this, args);
     }
-    [dartx.uniform4iv](location, v) {
-      return this.uniform4iv(location, v);
+    [dartx.uniform4iv](...args) {
+      return this.uniform4iv.apply(this, args);
     }
-    [dartx.uniformMatrix2fv](location, transpose, array) {
-      return this.uniformMatrix2fv(location, transpose, array);
+    [dartx.uniformMatrix2fv](...args) {
+      return this.uniformMatrix2fv.apply(this, args);
     }
-    [dartx.uniformMatrix3fv](location, transpose, array) {
-      return this.uniformMatrix3fv(location, transpose, array);
+    [dartx.uniformMatrix3fv](...args) {
+      return this.uniformMatrix3fv.apply(this, args);
     }
-    [dartx.uniformMatrix4fv](location, transpose, array) {
-      return this.uniformMatrix4fv(location, transpose, array);
+    [dartx.uniformMatrix4fv](...args) {
+      return this.uniformMatrix4fv.apply(this, args);
     }
-    [dartx.useProgram](program) {
-      return this.useProgram(program);
+    [dartx.useProgram](...args) {
+      return this.useProgram.apply(this, args);
     }
-    [dartx.validateProgram](program) {
-      return this.validateProgram(program);
+    [dartx.validateProgram](...args) {
+      return this.validateProgram.apply(this, args);
     }
-    [dartx.vertexAttrib1f](indx, x) {
-      return this.vertexAttrib1f(indx, x);
+    [dartx.vertexAttrib1f](...args) {
+      return this.vertexAttrib1f.apply(this, args);
     }
-    [dartx.vertexAttrib1fv](indx, values) {
-      return this.vertexAttrib1fv(indx, values);
+    [dartx.vertexAttrib1fv](...args) {
+      return this.vertexAttrib1fv.apply(this, args);
     }
-    [dartx.vertexAttrib2f](indx, x, y) {
-      return this.vertexAttrib2f(indx, x, y);
+    [dartx.vertexAttrib2f](...args) {
+      return this.vertexAttrib2f.apply(this, args);
     }
-    [dartx.vertexAttrib2fv](indx, values) {
-      return this.vertexAttrib2fv(indx, values);
+    [dartx.vertexAttrib2fv](...args) {
+      return this.vertexAttrib2fv.apply(this, args);
     }
-    [dartx.vertexAttrib3f](indx, x, y, z) {
-      return this.vertexAttrib3f(indx, x, y, z);
+    [dartx.vertexAttrib3f](...args) {
+      return this.vertexAttrib3f.apply(this, args);
     }
-    [dartx.vertexAttrib3fv](indx, values) {
-      return this.vertexAttrib3fv(indx, values);
+    [dartx.vertexAttrib3fv](...args) {
+      return this.vertexAttrib3fv.apply(this, args);
     }
-    [dartx.vertexAttrib4f](indx, x, y, z, w) {
-      return this.vertexAttrib4f(indx, x, y, z, w);
+    [dartx.vertexAttrib4f](...args) {
+      return this.vertexAttrib4f.apply(this, args);
     }
-    [dartx.vertexAttrib4fv](indx, values) {
-      return this.vertexAttrib4fv(indx, values);
+    [dartx.vertexAttrib4fv](...args) {
+      return this.vertexAttrib4fv.apply(this, args);
     }
-    [dartx.vertexAttribPointer](indx, size, type, normalized, stride, offset) {
-      return this.vertexAttribPointer(indx, size, type, normalized, stride, offset);
+    [dartx.vertexAttribPointer](...args) {
+      return this.vertexAttribPointer.apply(this, args);
     }
-    [dartx.viewport](x, y, width, height) {
-      return this.viewport(x, y, width, height);
+    [dartx.viewport](...args) {
+      return this.viewport.apply(this, args);
     }
-    [dartx.texImage2DUntyped](targetTexture, levelOfDetail, internalFormat, format, type, data) {
-      return this.texImage2D(targetTexture, levelOfDetail, internalFormat, format, type, data);
+    [dartx.texImage2DUntyped](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [dartx.texImage2DTyped](targetTexture, levelOfDetail, internalFormat, width, height, border, format, type, data) {
-      return this.texImage2D(targetTexture, levelOfDetail, internalFormat, width, height, border, format, type, data);
+    [dartx.texImage2DTyped](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [dartx.texSubImage2DUntyped](targetTexture, levelOfDetail, xOffset, yOffset, format, type, data) {
-      return this.texSubImage2D(targetTexture, levelOfDetail, xOffset, yOffset, format, type, data);
+    [dartx.texSubImage2DUntyped](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [dartx.texSubImage2DTyped](targetTexture, levelOfDetail, xOffset, yOffset, width, height, border, format, type, data) {
-      return this.texSubImage2D(targetTexture, levelOfDetail, xOffset, yOffset, width, height, border, format, type, data);
+    [dartx.texSubImage2DTyped](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
   };
   web_gl.RenderingContext[dart.implements] = () => [html$.CanvasRenderingContext];
@@ -93019,14 +94909,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.drawArraysInstancedAngle](mode, first, count, primcount) {
-      return this.drawArraysInstancedANGLE(mode, first, count, primcount);
+    [dartx.drawArraysInstancedAngle](...args) {
+      return this.drawArraysInstancedANGLE.apply(this, args);
     }
-    [dartx.drawElementsInstancedAngle](mode, count, type, offset, primcount) {
-      return this.drawElementsInstancedANGLE(mode, count, type, offset, primcount);
+    [dartx.drawElementsInstancedAngle](...args) {
+      return this.drawElementsInstancedANGLE.apply(this, args);
     }
-    [dartx.vertexAttribDivisorAngle](index, divisor) {
-      return this.vertexAttribDivisorANGLE(index, divisor);
+    [dartx.vertexAttribDivisorAngle](...args) {
+      return this.vertexAttribDivisorANGLE.apply(this, args);
     }
   };
   dart.setSignature(web_gl.AngleInstancedArrays, {
@@ -93222,8 +95112,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getTranslatedShaderSource](shader) {
-      return this.getTranslatedShaderSource(shader);
+    [dartx.getTranslatedShaderSource](...args) {
+      return this.getTranslatedShaderSource.apply(this, args);
     }
   };
   dart.setSignature(web_gl.DebugShaders, {
@@ -93249,8 +95139,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.drawBuffersWebgl](buffers) {
-      return this.drawBuffersWEBGL(buffers);
+    [dartx.drawBuffersWebgl](...args) {
+      return this.drawBuffersWEBGL.apply(this, args);
     }
   };
   dart.setSignature(web_gl.DrawBuffers, {
@@ -93393,11 +95283,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.loseContext]() {
-      return this.loseContext();
+    [dartx.loseContext](...args) {
+      return this.loseContext.apply(this, args);
     }
-    [dartx.restoreContext]() {
-      return this.restoreContext();
+    [dartx.restoreContext](...args) {
+      return this.restoreContext.apply(this, args);
     }
   };
   dart.setSignature(web_gl.LoseContext, {
@@ -93408,6 +95298,7 @@
     })
   });
   dart.registerExtension(dart.global.WebGLLoseContext, web_gl.LoseContext);
+  dart.registerExtension(dart.global.WebGLExtensionLoseContext, web_gl.LoseContext);
   web_gl.OesElementIndexUint = class OesElementIndexUint extends _interceptors.Interceptor {
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
@@ -93465,17 +95356,17 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.bindVertexArray](arrayObject) {
-      return this.bindVertexArrayOES(arrayObject);
+    [dartx.bindVertexArray](...args) {
+      return this.bindVertexArrayOES.apply(this, args);
     }
-    [dartx.createVertexArray]() {
-      return this.createVertexArrayOES();
+    [dartx.createVertexArray](...args) {
+      return this.createVertexArrayOES.apply(this, args);
     }
-    [dartx.deleteVertexArray](arrayObject) {
-      return this.deleteVertexArrayOES(arrayObject);
+    [dartx.deleteVertexArray](...args) {
+      return this.deleteVertexArrayOES.apply(this, args);
     }
-    [dartx.isVertexArray](arrayObject) {
-      return this.isVertexArrayOES(arrayObject);
+    [dartx.isVertexArray](...args) {
+      return this.isVertexArrayOES.apply(this, args);
     }
   };
   dart.setSignature(web_gl.OesVertexArrayObject, {
@@ -93600,14 +95491,14 @@
     get [dartx.version]() {
       return this.version;
     }
-    [dartx.changeVersion](oldVersion, newVersion, callback, errorCallback, successCallback) {
-      return this.changeVersion(oldVersion, newVersion, callback, errorCallback, successCallback);
+    [dartx.changeVersion](...args) {
+      return this.changeVersion.apply(this, args);
     }
-    [dartx.readTransaction](callback, errorCallback, successCallback) {
-      return this.readTransaction(callback, errorCallback, successCallback);
+    [dartx.readTransaction](...args) {
+      return this.readTransaction.apply(this, args);
     }
-    [dartx.transaction](callback, errorCallback, successCallback) {
-      return this.transaction(callback, errorCallback, successCallback);
+    [dartx.transaction](...args) {
+      return this.transaction.apply(this, args);
     }
   };
   dart.setSignature(web_sql.SqlDatabase, {
@@ -93693,8 +95584,8 @@
   const _item_1 = Symbol('_item_1');
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -93709,11 +95600,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.item](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -93742,13 +95633,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
     [dartx.item](index) {
       return html_common.convertNativeToDart_Dictionary(this[_item_1](index));
     }
-    [_item_1](index) {
-      return this.item(index);
+    [_item_1](...args) {
+      return this.item.apply(this, args);
     }
   };
   web_sql.SqlResultSetRowList[dart.implements] = () => [ListOfMap()];
@@ -93762,8 +95653,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.Map, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, core.Map]),
+      [dartx._get]: dart.definiteFunctionType(core.Map, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, core.Map]),
       [dartx.elementAt]: dart.definiteFunctionType(core.Map, [core.int]),
       [dartx.item]: dart.definiteFunctionType(core.Map, [core.int]),
       [_item_1]: dart.definiteFunctionType(dart.dynamic, [dart.dynamic])
@@ -93777,8 +95668,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.executeSql](sqlStatement, arguments$, callback, errorCallback) {
-      return this.executeSql(sqlStatement, arguments$, callback, errorCallback);
+    [dartx.executeSql](...args) {
+      return this.executeSql.apply(this, args);
     }
   };
   dart.setSignature(web_sql.SqlTransaction, {
@@ -93804,6 +95695,7 @@
   exports.collection = collection;
   exports.convert = convert;
   exports.core = core;
+  exports.developer = developer;
   exports.isolate = isolate;
   exports.js = js;
   exports.js_util = js_util;
diff --git a/pkg/dev_compiler/lib/js/es6/dart_sdk.js b/pkg/dev_compiler/lib/js/es6/dart_sdk.js
index c99499b..658981b 100644
--- a/pkg/dev_compiler/lib/js/es6/dart_sdk.js
+++ b/pkg/dev_compiler/lib/js/es6/dart_sdk.js
@@ -15,6 +15,7 @@
 export const collection = Object.create(null);
 export const convert = Object.create(null);
 export const core = Object.create(null);
+export const developer = Object.create(null);
 export const isolate = Object.create(null);
 export const js = Object.create(null);
 export const js_util = Object.create(null);
@@ -46,12 +47,14 @@
 let ListOfNameValuePair = () => (ListOfNameValuePair = dart.constFn(core.List$(_debugger.NameValuePair)))();
 let JSArrayOfString = () => (JSArrayOfString = dart.constFn(_interceptors.JSArray$(core.String)))();
 let JSArrayOfJsonMLFormatter = () => (JSArrayOfJsonMLFormatter = dart.constFn(_interceptors.JSArray$(_debugger.JsonMLFormatter)))();
+let JSIndexable = () => (JSIndexable = dart.constFn(_interceptors.JSIndexable$()))();
 let JSArray = () => (JSArray = dart.constFn(_interceptors.JSArray$()))();
 let JSMutableArray = () => (JSMutableArray = dart.constFn(_interceptors.JSMutableArray$()))();
 let JSFixedArray = () => (JSFixedArray = dart.constFn(_interceptors.JSFixedArray$()))();
 let JSExtendableArray = () => (JSExtendableArray = dart.constFn(_interceptors.JSExtendableArray$()))();
 let JSUnmodifiableArray = () => (JSUnmodifiableArray = dart.constFn(_interceptors.JSUnmodifiableArray$()))();
 let ArrayIterator = () => (ArrayIterator = dart.constFn(_interceptors.ArrayIterator$()))();
+let JSIndexableOfString = () => (JSIndexableOfString = dart.constFn(_interceptors.JSIndexable$(core.String)))();
 let MatchToString = () => (MatchToString = dart.constFn(dart.functionType(core.String, [core.Match])))();
 let StringToString = () => (StringToString = dart.constFn(dart.functionType(core.String, [core.String])))();
 let ComparableOfnum = () => (ComparableOfnum = dart.constFn(core.Comparable$(core.num)))();
@@ -140,6 +143,7 @@
 let ListOfClassMirror = () => (ListOfClassMirror = dart.constFn(core.List$(mirrors.ClassMirror)))();
 let ListOfTypeVariableMirror = () => (ListOfTypeVariableMirror = dart.constFn(core.List$(mirrors.TypeVariableMirror)))();
 let MapOfSymbol$MethodMirror = () => (MapOfSymbol$MethodMirror = dart.constFn(core.Map$(core.Symbol, mirrors.MethodMirror)))();
+let JSArrayOfType = () => (JSArrayOfType = dart.constFn(_interceptors.JSArray$(core.Type)))();
 let ListOfParameterMirror = () => (ListOfParameterMirror = dart.constFn(core.List$(mirrors.ParameterMirror)))();
 let ListOfFloat32x4 = () => (ListOfFloat32x4 = dart.constFn(core.List$(typed_data.Float32x4)))();
 let ListOfInt32x4 = () => (ListOfInt32x4 = dart.constFn(core.List$(typed_data.Int32x4)))();
@@ -371,6 +375,12 @@
 let MapOfString$String = () => (MapOfString$String = dart.constFn(core.Map$(core.String, core.String)))();
 let IterableOfString = () => (IterableOfString = dart.constFn(core.Iterable$(core.String)))();
 let MapOfString$dynamic = () => (MapOfString$dynamic = dart.constFn(core.Map$(core.String, dart.dynamic)))();
+let MapOfString$ServiceExtensionHandler = () => (MapOfString$ServiceExtensionHandler = dart.constFn(core.Map$(core.String, developer.ServiceExtensionHandler)))();
+let MapOfString$Metric = () => (MapOfString$Metric = dart.constFn(core.Map$(core.String, developer.Metric)))();
+let ListOf_SyncBlock = () => (ListOf_SyncBlock = dart.constFn(core.List$(developer._SyncBlock)))();
+let JSArrayOf_AsyncBlock = () => (JSArrayOf_AsyncBlock = dart.constFn(_interceptors.JSArray$(developer._AsyncBlock)))();
+let ListOf_AsyncBlock = () => (ListOf_AsyncBlock = dart.constFn(core.List$(developer._AsyncBlock)))();
+let CompleterOfUri = () => (CompleterOfUri = dart.constFn(async.Completer$(core.Uri)))();
 let FutureOfIsolate = () => (FutureOfIsolate = dart.constFn(async.Future$(isolate.Isolate)))();
 let JsArray = () => (JsArray = dart.constFn(js.JsArray$()))();
 let ExpandoOfFunction = () => (ExpandoOfFunction = dart.constFn(core.Expando$(core.Function)))();
@@ -530,9 +540,9 @@
 let ListOfTransform = () => (ListOfTransform = dart.constFn(core.List$(svg.Transform)))();
 let CompleterOfAudioBuffer = () => (CompleterOfAudioBuffer = dart.constFn(async.Completer$(web_audio.AudioBuffer)))();
 let EventStreamProviderOfAudioProcessingEvent = () => (EventStreamProviderOfAudioProcessingEvent = dart.constFn(html.EventStreamProvider$(web_audio.AudioProcessingEvent)))();
+let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic])))();
 let StringAndStringToint = () => (StringAndStringToint = dart.constFn(dart.definiteFunctionType(core.int, [core.String, core.String])))();
 let VoidTo_MethodStats = () => (VoidTo_MethodStats = dart.constFn(dart.definiteFunctionType(dart._MethodStats, [])))();
-let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic])))();
 let dynamicToString = () => (dynamicToString = dart.constFn(dart.definiteFunctionType(core.String, [dart.dynamic])))();
 let dynamicToListOfString = () => (dynamicToListOfString = dart.constFn(dart.definiteFunctionType(ListOfString(), [dart.dynamic])))();
 let dynamicToList = () => (dynamicToList = dart.constFn(dart.definiteFunctionType(core.List, [dart.dynamic])))();
@@ -611,10 +621,12 @@
 let TypeToTypeMirror = () => (TypeToTypeMirror = dart.constFn(dart.definiteFunctionType(mirrors.TypeMirror, [core.Type])))();
 let dynamicAndListTodynamic = () => (dynamicAndListTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic, core.List])))();
 let dynamicAndStringAndListTodynamic = () => (dynamicAndStringAndListTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic, core.String, core.List])))();
-let dynamicToMap = () => (dynamicToMap = dart.constFn(dart.definiteFunctionType(core.Map, [dart.dynamic])))();
+let SymbolTodynamic = () => (SymbolTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [core.Symbol])))();
+let dynamicToSymbol = () => (dynamicToSymbol = dart.constFn(dart.definiteFunctionType(core.Symbol, [dart.dynamic])))();
+let dynamicToMapOfSymbol$dynamic = () => (dynamicToMapOfSymbol$dynamic = dart.constFn(dart.definiteFunctionType(MapOfSymbol$dynamic(), [dart.dynamic])))();
 let TypeAndInvocationTodynamic = () => (TypeAndInvocationTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [core.Type, core.Invocation])))();
 let SymbolAnddynamicTovoid = () => (SymbolAnddynamicTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.Symbol, dart.dynamic])))();
-let StringAnddynamicTovoid = () => (StringAnddynamicTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String, dart.dynamic])))();
+let MapOfSymbol$dynamicTodynamic = () => (MapOfSymbol$dynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [MapOfSymbol$dynamic()])))();
 let dynamicToTypeMirror = () => (dynamicToTypeMirror = dart.constFn(dart.definiteFunctionType(mirrors.TypeMirror, [dart.dynamic])))();
 let dynamicAnddynamicAnddynamicTovoid = () => (dynamicAnddynamicAnddynamicTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [dart.dynamic, dart.dynamic, dart.dynamic])))();
 let ListToList = () => (ListToList = dart.constFn(dart.definiteFunctionType(core.List, [core.List])))();
@@ -672,9 +684,24 @@
 let ObjectToint = () => (ObjectToint = dart.constFn(dart.definiteFunctionType(core.int, [core.Object])))();
 let ObjectTovoid = () => (ObjectTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.Object])))();
 let StringAndStringTovoid = () => (StringAndStringTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String, core.String])))();
+let StringAnddynamicTovoid = () => (StringAnddynamicTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String, dart.dynamic])))();
 let MapOfString$StringAndStringToMapOfString$String = () => (MapOfString$StringAndStringToMapOfString$String = dart.constFn(dart.definiteFunctionType(MapOfString$String(), [MapOfString$String(), core.String])))();
 let intAndintAndintTovoid = () => (intAndintAndintTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.int, core.int, core.int])))();
 let String__Tovoid = () => (String__Tovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String], [dart.dynamic])))();
+let __Tobool = () => (__Tobool = dart.constFn(dart.definiteFunctionType(core.bool, [], {when: core.bool, message: core.String})))();
+let String__Tovoid = () => (String__Tovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String], {time: core.DateTime, sequenceNumber: core.int, level: core.int, name: core.String, zone: async.Zone, error: core.Object, stackTrace: core.StackTrace})))();
+let StringAndServiceExtensionHandlerTovoid = () => (StringAndServiceExtensionHandlerTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String, developer.ServiceExtensionHandler])))();
+let StringAndMapTovoid = () => (StringAndMapTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String, core.Map])))();
+let StringToServiceExtensionHandler = () => (StringToServiceExtensionHandler = dart.constFn(dart.definiteFunctionType(developer.ServiceExtensionHandler, [core.String])))();
+let StringAndServiceExtensionHandlerTodynamic = () => (StringAndServiceExtensionHandlerTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [core.String, developer.ServiceExtensionHandler])))();
+let VoidToUserTag = () => (VoidToUserTag = dart.constFn(dart.definiteFunctionType(developer.UserTag, [])))();
+let MapToString = () => (MapToString = dart.constFn(dart.definiteFunctionType(core.String, [core.Map])))();
+let intAndintAndString__Tovoid = () => (intAndintAndString__Tovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.int, core.int, core.String, core.String, core.String, core.String])))();
+let intAndintAndString__Tovoid = () => (intAndintAndString__Tovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.int, core.int, core.String, core.String, core.String])))();
+let intAndStringAndString__Tovoid = () => (intAndStringAndString__Tovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.int, core.String, core.String, core.String])))();
+let UriTovoid = () => (UriTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.Uri])))();
+let SendPortTovoid = () => (SendPortTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [isolate.SendPort])))();
+let SendPortAndboolTovoid = () => (SendPortAndboolTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [isolate.SendPort, core.bool])))();
 let ListToIsolate = () => (ListToIsolate = dart.constFn(dart.definiteFunctionType(isolate.Isolate, [core.List])))();
 let dynamicTo_DartObject = () => (dynamicTo_DartObject = dart.constFn(dart.definiteFunctionType(js._DartObject, [dart.dynamic])))();
 let dynamicToJsObject = () => (dynamicToJsObject = dart.constFn(dart.definiteFunctionType(js.JsObject, [dart.dynamic])))();
@@ -743,6 +770,7 @@
 let NodeAndNodeTovoid = () => (NodeAndNodeTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [html.Node, html.Node])))();
 let dynamicToImageData = () => (dynamicToImageData = dart.constFn(dart.definiteFunctionType(html.ImageData, [dart.dynamic])))();
 let ImageDataTodynamic = () => (ImageDataTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [html.ImageData])))();
+let dynamicToMap = () => (dynamicToMap = dart.constFn(dart.definiteFunctionType(core.Map, [dart.dynamic])))();
 let Map__Todynamic = () => (Map__Todynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [core.Map], [dynamicTovoid()])))();
 let ListOfStringToList = () => (ListOfStringToList = dart.constFn(dart.definiteFunctionType(core.List, [ListOfString()])))();
 let dynamicToDateTime = () => (dynamicToDateTime = dart.constFn(dart.definiteFunctionType(core.DateTime, [dart.dynamic])))();
@@ -774,10 +802,10 @@
   return Mixin;
 };
 dart.getMixins = function(clazz) {
-  return clazz[dart._mixins];
+  return Object.hasOwnProperty.call(clazz, dart._mixins) ? clazz[dart._mixins] : null;
 };
 dart.getImplements = function(clazz) {
-  return clazz[dart.implements];
+  return Object.hasOwnProperty.call(clazz, dart.implements) ? clazz[dart.implements] : null;
 };
 dart.flattenFutures = function(builder) {
   function flatten(T) {
@@ -791,43 +819,48 @@
   }
   return flatten;
 };
-dart.generic = function(typeConstructor) {
-  let length = typeConstructor.length;
-  if (length < 1) {
-    dart.throwInternalError('must have at least one generic type argument');
-  }
-  let resultMap = new Map();
-  function makeGenericType(...args) {
-    if (args.length != length && args.length != 0) {
-      dart.throwInternalError('requires ' + length + ' or 0 type arguments');
+dart.generic = function(typeConstructor, setBaseClass) {
+  if (setBaseClass === void 0) setBaseClass = null;
+  return (() => {
+    let length = typeConstructor.length;
+    if (length < 1) {
+      dart.throwInternalError('must have at least one generic type argument');
     }
-    while (args.length < length)
-      args.push(dart.dynamic);
-    let value = resultMap;
-    for (let i = 0; i < length; i++) {
-      let arg = args[i];
-      if (arg == null) {
-        dart.throwInternalError('type arguments should not be null: ' + typeConstructor);
+    let resultMap = new Map();
+    function makeGenericType(...args) {
+      if (args.length != length && args.length != 0) {
+        dart.throwInternalError('requires ' + length + ' or 0 type arguments');
       }
-      let map = value;
-      value = map.get(arg);
-      if (value === void 0) {
-        if (i + 1 == length) {
-          value = typeConstructor.apply(null, args);
-          if (value) {
-            value[dart._typeArguments] = args;
-            value[dart._originalDeclaration] = makeGenericType;
-          }
-        } else {
-          value = new Map();
+      while (args.length < length)
+        args.push(dart.dynamic);
+      let value = resultMap;
+      for (let i = 0; i < length; i++) {
+        let arg = args[i];
+        if (arg == null) {
+          dart.throwInternalError('type arguments should not be null: ' + typeConstructor);
         }
-        map.set(arg, value);
+        let map = value;
+        value = map.get(arg);
+        if (value === void 0) {
+          if (i + 1 == length) {
+            value = typeConstructor.apply(null, args);
+            if (value) {
+              value[dart._typeArguments] = args;
+              value[dart._originalDeclaration] = makeGenericType;
+            }
+            map.set(arg, value);
+            if (setBaseClass) setBaseClass(value);
+          } else {
+            value = new Map();
+            map.set(arg, value);
+          }
+        }
       }
+      return value;
     }
-    return value;
-  }
-  makeGenericType[dart._genericTypeCtor] = typeConstructor;
-  return makeGenericType;
+    makeGenericType[dart._genericTypeCtor] = typeConstructor;
+    return makeGenericType;
+  })();
 };
 dart.getGenericClass = function(type) {
   return dart.safeGetOwnProperty(type, dart._originalDeclaration);
@@ -1030,7 +1063,6 @@
   let proto = type.prototype;
   for (let name of methodNames) {
     let method = dart.getOwnPropertyDescriptor(proto, name);
-    if (!method) continue;
     dart.defineProperty(proto, dart.getExtensionSymbol(name), method);
   }
   let originalSigFn = dart.getOwnPropertyDescriptor(type, dart._methodSig).get;
@@ -1054,8 +1086,10 @@
   derived.__proto__ = base;
 };
 dart.setExtensionBaseClass = function(derived, base) {
-  derived.prototype[dart._extensionType] = derived;
-  derived.prototype.__proto__ = base.prototype;
+  if (base) {
+    derived.prototype[dart._extensionType] = derived;
+    derived.prototype.__proto__ = base.prototype;
+  }
 };
 dart.callableClass = function(callableCtor, classExpr) {
   callableCtor.prototype = classExpr.prototype;
@@ -1067,6 +1101,15 @@
   ctor.prototype = clazz.prototype;
   dart.defineProperty(clazz, name, {value: ctor, configurable: true});
 };
+dart.defineEnumValues = function(enumClass, names) {
+  let values = [];
+  for (var i = 0; i < names.length; i++) {
+    let value = dart.const(new enumClass(i));
+    values.push(value);
+    Object.defineProperty(enumClass, names[i], {value: value, configurable: true});
+  }
+  enumClass.values = dart.constList(values, enumClass);
+};
 dart.fn = function(closure, t) {
   if (t == null) {
     t = dart.definiteFunctionType(dart.dynamic, Array(closure.length).fill(dart.dynamic), void 0);
@@ -1126,6 +1169,23 @@
   }
   return type[dart._typeObject] = new dart.WrappedType(type);
 };
+dart.lazyJSType = function(getJSTypeCallback, name) {
+  let key = getJSTypeCallback.toString();
+  if (dart._lazyJSTypes.has(key)) {
+    return dart._lazyJSTypes.get(key);
+  }
+  let ret = new dart.LazyJSType(getJSTypeCallback, name);
+  dart._lazyJSTypes.set(key, ret);
+  return ret;
+};
+dart.lazyAnonymousJSType = function(name) {
+  if (dart._lazyJSTypes.has(name)) {
+    return dart._lazyJSTypes.get(name);
+  }
+  let ret = new dart.LazyJSType(null, name);
+  dart._lazyJSTypes.set(name, ret);
+  return ret;
+};
 const _wrappedType = Symbol('_wrappedType');
 dart.unwrapType = function(obj) {
   return dart.dload(obj, _wrappedType);
@@ -1148,6 +1208,42 @@
 dart.tagLazy = function(value, compute) {
   dart.defineLazyProperty(value, dart._runtimeType, {get: compute});
 };
+dart._warn = function(arg) {
+  console.warn(arg);
+};
+const _jsTypeCallback = Symbol('_jsTypeCallback');
+const _rawJSType = Symbol('_rawJSType');
+const _dartName = Symbol('_dartName');
+dart._isInstanceOfLazyJSType = function(o, t) {
+  if (t[_jsTypeCallback] != null) {
+    if (t[_rawJSType] == null) {
+      let expected = t[_dartName];
+      let actual = dart.typeName(dart.getReifiedType(o));
+      dart._warn(dart.str`Cannot find native JavaScript type (${expected}) ` + dart.str`to type check ${actual}`);
+      return true;
+    }
+    return dart.is(o, t[_rawJSType]);
+  }
+  if (o == null) return false;
+  return dart._isJSObject(o);
+};
+dart._asInstanceOfLazyJSType = function(o, t) {
+  if (t[_jsTypeCallback] != null) {
+    if (t[_rawJSType] == null) {
+      let expected = t[_dartName];
+      let actual = dart.typeName(dart.getReifiedType(o));
+      dart._warn(dart.str`Cannot find native JavaScript type (${expected}) ` + dart.str`to type check ${actual}`);
+      return o;
+    }
+    return dart.as(o, t[_rawJSType]);
+  }
+  if (o == null) return null;
+  if (!dart.test(dart._isJSObject(o))) dart._throwCastError(o, t, true);
+  return o;
+};
+dart._isJSObject = function(o) {
+  return !dart.getReifiedType(o)[dart._runtimeType];
+};
 dart._initialize2 = function() {
   dart.TypeRep.prototype.is = function is_T(object) {
     return dart.is(object, this);
@@ -1167,6 +1263,15 @@
   dart.Dynamic.prototype._check = function check_Dynamic(object) {
     return object;
   };
+  dart.LazyJSType.prototype.is = function is_T(object) {
+    return dart._isInstanceOfLazyJSType(object, this);
+  };
+  dart.LazyJSType.prototype.as = function as_T(object) {
+    return dart._asInstanceOfLazyJSType(object, this);
+  };
+  dart.LazyJSType.prototype._check = function check_T(object) {
+    return dart._asInstanceOfLazyJSType(object, this);
+  };
 };
 dart._functionType = function(definite, returnType, args, extra) {
   if (args === void 0 && extra === void 0) {
@@ -1229,6 +1334,11 @@
 dart.isFunctionType = function(type) {
   return type instanceof dart.AbstractFunctionType || type === core.Function;
 };
+dart.isLazyJSSubtype = function(t1, t2, covariant) {
+  if (dart.equals(t1, t2)) return true;
+  if (t1[_jsTypeCallback] == null || t2[_jsTypeCallback] == null) return true;
+  return dart.isClassSubType(t1[_rawJSType], t2[_rawJSType], covariant);
+};
 dart.isFunctionSubtype = function(ft1, ft2, covariant) {
   if (ft2 === core.Function) {
     return true;
@@ -1324,6 +1434,9 @@
   if (dart.isFunctionType(t1) && dart.isFunctionType(t2)) {
     return dart.isFunctionSubtype(t1, t2, covariant);
   }
+  if (t1 instanceof dart.LazyJSType && t2 instanceof dart.LazyJSType) {
+    return dart.isLazyJSSubtype(t1, t2, covariant);
+  }
   return false;
 };
 dart.isClassSubType = function(t1, t2, covariant) {
@@ -1399,24 +1512,31 @@
   return true;
 };
 dart.throwCastError = function(object, actual, type) {
+  debugger;
   dart.throw(new _js_helper.CastErrorImplementation(object, dart.typeName(actual), dart.typeName(type)));
 };
 dart.throwTypeError = function(object, actual, type) {
+  debugger;
   dart.throw(new _js_helper.TypeErrorImplementation(object, dart.typeName(actual), dart.typeName(type)));
 };
 dart.throwStrongModeCastError = function(object, actual, type) {
+  debugger;
   dart.throw(new _js_helper.StrongModeCastError(object, dart.typeName(actual), dart.typeName(type)));
 };
 dart.throwStrongModeTypeError = function(object, actual, type) {
+  debugger;
   dart.throw(new _js_helper.StrongModeTypeError(object, dart.typeName(actual), dart.typeName(type)));
 };
 dart.throwUnimplementedError = function(message) {
+  debugger;
   dart.throw(new core.UnimplementedError(message));
 };
 dart.throwAssertionError = function() {
+  debugger;
   dart.throw(new core.AssertionError());
 };
 dart.throwNullValueError = function() {
+  debugger;
   dart.throw(new core.NoSuchMethodError(null, new core.Symbol('<Unexpected Null Value>'), null, null, null));
 };
 dart.syncStar = function(gen, E, ...args) {
@@ -1555,12 +1675,49 @@
 dart.dgcall = function(f, typeArgs, ...args) {
   return dart._checkAndCall(f, dart._getRuntimeType(f), void 0, typeArgs, args, 'call');
 };
+dart._dhelperRepl = function(object, field, callback) {
+  let rawField = field;
+  if (typeof field == 'symbol') {
+    if (field in object) return callback(field);
+    field = field.toString();
+    field = field.substring('Symbol('.length, field.length - 1);
+  } else if (field.charAt(0) != '_') {
+    return callback(field);
+  }
+  if (field in object) return callback(field);
+  let proto = object;
+  while (proto !== null) {
+    let symbols = Object.getOwnPropertySymbols(proto);
+    let target = 'Symbol(' + field + ')';
+    for (let s = 0; s < symbols.length; s++) {
+      let sym = symbols[s];
+      if (target == sym.toString()) return callback(sym);
+    }
+    proto = proto.__proto__;
+  }
+  return callback(rawField);
+};
+dart.dloadRepl = function(obj, field) {
+  return dart._dhelperRepl(obj, field, dart.fn(resolvedField => dart.dload(obj, resolvedField), dynamicTodynamic()));
+};
+dart.dputRepl = function(obj, field, value) {
+  return dart._dhelperRepl(obj, field, dart.fn(resolvedField => dart.dput(obj, resolvedField, value), dynamicTodynamic()));
+};
+dart._callMethodRepl = function(obj, method, typeArgs, args) {
+  return dart._dhelperRepl(obj, method, dart.fn(resolvedField => dart._callMethod(obj, resolvedField, typeArgs, args, method), dynamicTodynamic()));
+};
+dart.dsendRepl = function(obj, method, ...args) {
+  return dart._callMethodRepl(obj, method, null, args);
+};
+dart.dgsendRepl = function(obj, typeArgs, method, ...args) {
+  return dart._callMethodRepl(obj, method, typeArgs, args);
+};
 dart.getDynamicStats = function() {
   let ret = JSArrayOfListOfObject().of([]);
   let keys = dart._callMethodStats[dartx.keys][dartx.toList]();
-  keys[dartx.sort](dart.fn((a, b) => dart._callMethodStats[dartx.get](b).count[dartx.compareTo](dart._callMethodStats[dartx.get](a).count), StringAndStringToint()));
+  keys[dartx.sort](dart.fn((a, b) => dart._callMethodStats[dartx._get](b).count[dartx.compareTo](dart._callMethodStats[dartx._get](a).count), StringAndStringToint()));
   for (let key of keys) {
-    let stats = dart._callMethodStats[dartx.get](key);
+    let stats = dart._callMethodStats[dartx._get](key);
     ret[dartx.add](JSArrayOfObject().of([stats.typeName, stats.frame, stats.count]));
   }
   return ret;
@@ -1575,7 +1732,7 @@
   let stack = stackStr[dartx.split]('\n    at ');
   let src = '';
   for (let i = 2; i < dart.notNull(stack[dartx.length]); ++i) {
-    let frame = stack[dartx.get](i);
+    let frame = stack[dartx._get](i);
     if (!dart.test(frame[dartx.contains]('dart_sdk.js'))) {
       src = frame;
       break;
@@ -1601,10 +1758,10 @@
   return dart._callMethod(obj, method, typeArgs, args, method);
 };
 dart.dindex = function(obj, index) {
-  return dart._callMethod(obj, 'get', null, [index], '[]');
+  return dart._callMethod(obj, '_get', null, [index], '[]');
 };
 dart.dsetindex = function(obj, index, value) {
-  return dart._callMethod(obj, 'set', null, [index, value], '[]=');
+  return dart._callMethod(obj, '_set', null, [index, value], '[]=');
 };
 dart._ignoreMemo = function(f) {
   let memo = new Map();
@@ -1727,11 +1884,11 @@
       for (let i = 0, end = values.length - 1; i < end; i += 2) {
         let key = values[i];
         let value = values[i + 1];
-        map.set(key, value);
+        map._set(key, value);
       }
     } else if (typeof values === 'object') {
       for (let key of dart.getOwnPropertyNames(values)) {
-        map.set(key, values[key]);
+        map._set(key, values[key]);
       }
     }
     return map;
@@ -1869,7 +2026,8 @@
   if (result != null) return dart.wrapType(result);
   let extension = dart.getExtensionType(obj);
   if (extension != null) {
-    return obj[dartx.runtimeType];
+    result = obj[dartx.runtimeType];
+    return result != null ? result : dart.wrapType(extension);
   }
   if (typeof obj == "function") {
     return dart.wrapType(dart.getReifiedType(obj));
@@ -1893,6 +2051,9 @@
   }
   return name;
 };
+dart.loadLibrary = function() {
+  return async.Future.value();
+};
 dart.defineProperty = function(obj, name, desc) {
   return Object.defineProperty(obj, name, desc);
 };
@@ -1906,9 +2067,11 @@
   return Object.getOwnPropertySymbols(obj);
 };
 dart.throwStrongModeError = function(message) {
+  debugger;
   throw new _js_helper.StrongModeErrorImplementation(message);
 };
 dart.throwInternalError = function(message) {
+  debugger;
   throw Error(message);
 };
 dart.getOwnNamesAndSymbols = function(obj) {
@@ -1995,6 +2158,12 @@
 dart.dartx = dartx;
 dart._runtimeType = Symbol("_runtimeType");
 dart.isNamedConstructor = Symbol("isNamedConstructor");
+dart.defineLazy(dart, {
+  get _lazyJSTypes() {
+    return new Map();
+  },
+  set _lazyJSTypes(_) {}
+});
 dart.metadata = Symbol("metadata");
 dart._typeObject = Symbol("typeObject");
 core.Object = class Object {
@@ -2065,6 +2234,27 @@
     return 'dynamic';
   }
 };
+dart.LazyJSType = class LazyJSType extends core.Object {
+  new(jsTypeCallback, dartName) {
+    this[_jsTypeCallback] = jsTypeCallback;
+    this[_dartName] = dartName;
+  }
+  get [_rawJSType]() {
+    return this[_jsTypeCallback]();
+  }
+  toString() {
+    return core.String._check(this[_jsTypeCallback] != null ? dart.typeName(this[_rawJSType]) : this[_dartName]);
+  }
+};
+dart.LazyJSType[dart.implements] = () => [core.Type];
+dart.setSignature(dart.LazyJSType, {
+  constructors: () => ({new: dart.definiteFunctionType(dart.LazyJSType, [dart.dynamic, dart.dynamic])}),
+  fields: () => ({
+    [_jsTypeCallback]: dart.dynamic,
+    [_dartName]: dart.dynamic
+  }),
+  getters: () => ({[_rawJSType]: dart.definiteFunctionType(dart.dynamic, [])})
+});
 dart.dynamic = new dart.Dynamic();
 dart._initialize = dart._initialize2();
 dart.Void = class Void extends dart.TypeRep {
@@ -3071,7 +3261,7 @@
       if (genericTypeConstructor != null) {
         this.recordGenericParameters(core.String._check(name), genericTypeConstructor);
       } else {
-        nonGenericProperties.set(core.String._check(name), value);
+        nonGenericProperties._set(core.String._check(name), value);
       }
     }, dynamicAnddynamicTodynamic()));
     nonGenericProperties.forEach(dart.fn((name, value) => {
@@ -3084,13 +3274,13 @@
     return children.toList();
   }
   recordGenericParameters(name, genericTypeConstructor) {
-    this.genericParameters.set(name, genericTypeConstructor.toString()[dartx.split](' =>')[dartx.first][dartx.replaceAll](core.RegExp.new('[(|)]'), ''));
+    this.genericParameters._set(name, genericTypeConstructor.toString()[dartx.split](' =>')[dartx.first][dartx.replaceAll](core.RegExp.new('[(|)]'), ''));
   }
   classChild(name, child) {
     let typeName = _debugger.getTypeName(core.Type._check(child));
     let parameterName = dart.str`${name}\$`;
     if (dart.test(this.genericParameters.keys[dartx.contains](parameterName))) {
-      typeName = dart.str`${typeName}<${this.genericParameters.get(parameterName)}>`;
+      typeName = dart.str`${typeName}<${this.genericParameters._get(parameterName)}>`;
       _debugger.JSNative.setProperty(child, 'genericTypeName', typeName);
     }
     return new _debugger.NameValuePair({name: typeName, value: child});
@@ -3553,8 +3743,12 @@
   constructors: () => ({new: dart.definiteFunctionType(_interceptors.JSBool, [])})
 });
 dart.registerExtension(dart.global.Boolean, _interceptors.JSBool);
-_interceptors.JSIndexable = class JSIndexable extends core.Object {};
-_interceptors.JSMutableIndexable = class JSMutableIndexable extends _interceptors.JSIndexable {};
+_interceptors.JSIndexable$ = dart.generic(E => {
+  class JSIndexable extends core.Object {}
+  dart.addTypeTests(JSIndexable);
+  return JSIndexable;
+});
+_interceptors.JSIndexable = JSIndexable();
 _interceptors.JSObject = class JSObject extends core.Object {};
 _interceptors.JavaScriptObject = class JavaScriptObject extends _interceptors.Interceptor {
   new() {
@@ -3617,6 +3811,7 @@
   let SetOfE = () => (SetOfE = dart.constFn(core.Set$(E)))();
   let ArrayIteratorOfE = () => (ArrayIteratorOfE = dart.constFn(_interceptors.ArrayIterator$(E)))();
   let ListMapViewOfE = () => (ListMapViewOfE = dart.constFn(_internal.ListMapView$(E)))();
+  let JSIndexableOfE = () => (JSIndexableOfE = dart.constFn(_interceptors.JSIndexable$(E)))();
   let ETobool = () => (ETobool = dart.constFn(dart.functionType(core.bool, [E])))();
   let ETovoid = () => (ETovoid = dart.constFn(dart.functionType(dart.void, [E])))();
   let EAndEToint = () => (EAndEToint = dart.constFn(dart.functionType(core.int, [E, E])))();
@@ -3675,8 +3870,8 @@
     'hashCode',
     'length',
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'asMap'
   ]);
   class JSArray extends core.Object {
@@ -3753,7 +3948,7 @@
       this[dartx.checkMutable]('setAll');
       core.RangeError.checkValueInInterval(index, 0, this[dartx.length], "index");
       for (let element of iterable) {
-        this[dartx.set]((() => {
+        this[dartx._set]((() => {
           let x = index;
           index = dart.notNull(x) + 1;
           return x;
@@ -3768,7 +3963,7 @@
     [dartx.remove](element) {
       this[dartx.checkGrowable]('remove');
       for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-        if (dart.equals(this[dartx.get](i), element)) {
+        if (dart.equals(this[dartx._get](i), element)) {
           this.splice(i, 1);
           return true;
         }
@@ -3796,7 +3991,7 @@
       if (retained[dartx.length] == end) return;
       this[dartx.length] = retained[dartx.length];
       for (let i = 0; i < dart.notNull(retained[dartx.length]); i++) {
-        this[dartx.set](i, E._check(retained[dartx.get](i)));
+        this[dartx._set](i, E._check(retained[dartx._get](i)));
       }
     }
     [dartx.where](f) {
@@ -3837,7 +4032,7 @@
       if (separator === void 0) separator = "";
       let list = core.List.new(this[dartx.length]);
       for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-        list[dartx.set](i, dart.str`${this[dartx.get](i)}`);
+        list[dartx._set](i, dart.str`${this[dartx._get](i)}`);
       }
       return list.join(separator);
     }
@@ -3857,7 +4052,7 @@
       EAndEToE()._check(combine);
       let length = this[dartx.length];
       if (length == 0) dart.throw(_internal.IterableElementError.noElement());
-      let value = this[dartx.get](0);
+      let value = this[dartx._get](0);
       for (let i = 1; i < dart.notNull(length); i++) {
         let element = this[i];
         value = combine(value, element);
@@ -3924,7 +4119,7 @@
       dart.throw(_internal.IterableElementError.noElement());
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
     [dartx.sublist](start, end) {
       if (end === void 0) end = null;
@@ -3949,15 +4144,15 @@
       return new (SubListIterableOfE())(this, start, end);
     }
     get [dartx.first]() {
-      if (dart.notNull(this[dartx.length]) > 0) return this[dartx.get](0);
+      if (dart.notNull(this[dartx.length]) > 0) return this[dartx._get](0);
       dart.throw(_internal.IterableElementError.noElement());
     }
     get [dartx.last]() {
-      if (dart.notNull(this[dartx.length]) > 0) return this[dartx.get](dart.notNull(this[dartx.length]) - 1);
+      if (dart.notNull(this[dartx.length]) > 0) return this[dartx._get](dart.notNull(this[dartx.length]) - 1);
       dart.throw(_internal.IterableElementError.noElement());
     }
     get [dartx.single]() {
-      if (this[dartx.length] == 1) return this[dartx.get](0);
+      if (this[dartx.length] == 1) return this[dartx._get](0);
       if (this[dartx.length] == 0) dart.throw(_internal.IterableElementError.noElement());
       dart.throw(_internal.IterableElementError.tooMany());
     }
@@ -3989,12 +4184,12 @@
       }
       if (dart.notNull(otherStart) < dart.notNull(start)) {
         for (let i = length - 1; i >= 0; i--) {
-          let element = otherList[dartx.get](dart.notNull(otherStart) + i);
+          let element = otherList[dartx._get](dart.notNull(otherStart) + i);
           this[dart.notNull(start) + i] = element;
         }
       } else {
         for (let i = 0; i < length; i++) {
-          let element = otherList[dartx.get](dart.notNull(otherStart) + i);
+          let element = otherList[dartx._get](dart.notNull(otherStart) + i);
           this[dart.notNull(start) + i] = element;
         }
       }
@@ -4073,9 +4268,9 @@
       while (dart.notNull(length) > 1) {
         let pos = random.nextInt(length);
         length = dart.notNull(length) - 1;
-        let tmp = this[dartx.get](length);
-        this[dartx.set](length, this[dartx.get](pos));
-        this[dartx.set](pos, tmp);
+        let tmp = this[dartx._get](length);
+        this[dartx._set](length, this[dartx._get](pos));
+        this[dartx._set](pos, tmp);
       }
     }
     [dartx.indexOf](element, start) {
@@ -4087,7 +4282,7 @@
         start = 0;
       }
       for (let i = start; dart.notNull(i) < dart.notNull(this[dartx.length]); i = dart.notNull(i) + 1) {
-        if (dart.equals(this[dartx.get](i), element)) {
+        if (dart.equals(this[dartx._get](i), element)) {
           return i;
         }
       }
@@ -4106,7 +4301,7 @@
         }
       }
       for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) {
-        if (dart.equals(this[dartx.get](i), element)) {
+        if (dart.equals(this[dartx._get](i), element)) {
           return i;
         }
       }
@@ -4114,7 +4309,7 @@
     }
     [dartx.contains](other) {
       for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-        if (dart.equals(this[dartx.get](i), other)) return true;
+        if (dart.equals(this[dartx._get](i), other)) return true;
       }
       return false;
     }
@@ -4155,12 +4350,12 @@
       }
       this.length = newLength;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (!(typeof index == 'number')) dart.throw(_js_helper.diagnoseIndexError(this, index));
       if (dart.notNull(index) >= dart.notNull(this[dartx.length]) || dart.notNull(index) < 0) dart.throw(_js_helper.diagnoseIndexError(this, index));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       E._check(value);
       this[dartx.checkMutable]('indexed set');
       if (!(typeof index == 'number')) dart.throw(_js_helper.diagnoseIndexError(this, index));
@@ -4174,7 +4369,7 @@
   }
   dart.setExtensionBaseClass(JSArray, dart.global.Array);
   dart.addTypeTests(JSArray);
-  JSArray[dart.implements] = () => [ListOfE(), _interceptors.JSIndexable];
+  JSArray[dart.implements] = () => [ListOfE(), JSIndexableOfE()];
   dart.setSignature(JSArray, {
     constructors: () => ({
       new: dart.definiteFunctionType(_interceptors.JSArray$(E), []),
@@ -4239,8 +4434,8 @@
       [dartx.contains]: dart.definiteFunctionType(core.bool, [core.Object]),
       [dartx.toList]: dart.definiteFunctionType(core.List$(E), [], {growable: core.bool}),
       [dartx.toSet]: dart.definiteFunctionType(core.Set$(E), []),
-      [dartx.get]: dart.definiteFunctionType(E, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, E]),
+      [dartx._get]: dart.definiteFunctionType(E, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, E]),
       [dartx.asMap]: dart.definiteFunctionType(core.Map$(core.int, E), [])
     }),
     statics: () => ({
@@ -4259,7 +4454,6 @@
       super.new();
     }
   }
-  JSMutableArray[dart.implements] = () => [_interceptors.JSMutableIndexable];
   return JSMutableArray;
 });
 _interceptors.JSMutableArray = JSMutableArray();
@@ -4316,7 +4510,7 @@
         this[_current] = null;
         return false;
       }
-      this[_current] = this[_iterable][dartx.get](this[_index]);
+      this[_current] = this[_iterable][dartx._get](this[_index]);
       this[_index] = dart.notNull(this[_index]) + 1;
       return true;
     }
@@ -4368,7 +4562,7 @@
   'toRadixString',
   'toString',
   'hashCode',
-  'unary-',
+  '_negate',
   '+',
   '-',
   '/',
@@ -4565,7 +4759,7 @@
   get [dartx.hashCode]() {
     return this & 0x1FFFFFFF;
   }
-  [dartx['unary-']]() {
+  [dartx._negate]() {
     return -this;
   }
   [dartx['+']](other) {
@@ -4863,7 +5057,7 @@
     [dartx.toStringAsExponential]: dart.definiteFunctionType(core.String, [], [core.int]),
     [dartx.toStringAsPrecision]: dart.definiteFunctionType(core.String, [core.int]),
     [dartx.toRadixString]: dart.definiteFunctionType(core.String, [core.int]),
-    [dartx['unary-']]: dart.definiteFunctionType(_interceptors.JSNumber, []),
+    [dartx._negate]: dart.definiteFunctionType(_interceptors.JSNumber, []),
     [dartx['+']]: dart.definiteFunctionType(_interceptors.JSNumber, [core.num]),
     [dartx['-']]: dart.definiteFunctionType(_interceptors.JSNumber, [core.num]),
     [dartx['/']]: dart.definiteFunctionType(core.double, [core.num]),
@@ -4946,7 +5140,7 @@
   'hashCode',
   'runtimeType',
   'length',
-  'get'
+  '_get'
 ]);
 _interceptors.JSString = class JSString extends _interceptors.Interceptor {
   new() {
@@ -5329,13 +5523,13 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (!(typeof index == 'number')) dart.throw(_js_helper.diagnoseIndexError(this, index));
     if (dart.notNull(index) >= dart.notNull(this[dartx.length]) || dart.notNull(index) < 0) dart.throw(_js_helper.diagnoseIndexError(this, index));
     return this[index];
   }
 };
-_interceptors.JSString[dart.implements] = () => [core.String, _interceptors.JSIndexable];
+_interceptors.JSString[dart.implements] = () => [core.String, JSIndexableOfString()];
 dart.setSignature(_interceptors.JSString, {
   constructors: () => ({new: dart.definiteFunctionType(_interceptors.JSString, [])}),
   getters: () => ({
@@ -5373,7 +5567,7 @@
     [dartx.lastIndexOf]: dart.definiteFunctionType(core.int, [core.Pattern], [core.int]),
     [dartx.contains]: dart.definiteFunctionType(core.bool, [core.Pattern], [core.int]),
     [dartx.compareTo]: dart.definiteFunctionType(core.int, [core.String]),
-    [dartx.get]: dart.definiteFunctionType(core.String, [core.int])
+    [dartx._get]: dart.definiteFunctionType(core.String, [core.int])
   }),
   statics: () => ({
     _isWhitespace: dart.definiteFunctionType(core.bool, [core.int]),
@@ -5449,6 +5643,7 @@
 });
 _internal.POWERS_OF_TEN = dart.constList([1.0, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, 10000000.0, 100000000.0, 1000000000.0, 10000000000.0, 100000000000.0, 1000000000000.0, 10000000000000.0, 100000000000000.0, 1000000000000000.0, 10000000000000000.0, 100000000000000000.0, 1000000000000000000.0, 10000000000000000000.0, 100000000000000000000.0, 1e+21, 1e+22], core.double);
 const _string = Symbol('_string');
+const _filter = Symbol('_filter');
 collection.ListMixin$ = dart.generic(E => {
   let ListIteratorOfE = () => (ListIteratorOfE = dart.constFn(_internal.ListIterator$(E)))();
   let VoidToE = () => (VoidToE = dart.constFn(dart.functionType(E, [])))();
@@ -5460,6 +5655,7 @@
   let ListOfE = () => (ListOfE = dart.constFn(core.List$(E)))();
   let SetOfE = () => (SetOfE = dart.constFn(core.Set$(E)))();
   let IterableOfE = () => (IterableOfE = dart.constFn(core.Iterable$(E)))();
+  let JSArrayOfE = () => (JSArrayOfE = dart.constFn(_interceptors.JSArray$(E)))();
   let ListMapViewOfE = () => (ListMapViewOfE = dart.constFn(_internal.ListMapView$(E)))();
   let ReversedListIterableOfE = () => (ReversedListIterableOfE = dart.constFn(_internal.ReversedListIterable$(E)))();
   let ETovoid = () => (ETovoid = dart.constFn(dart.functionType(dart.void, [E])))();
@@ -5525,12 +5721,12 @@
       return new dart.JsIterator(this[dartx.iterator]);
     }
     elementAt(index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
     forEach(action) {
       let length = this[dartx.length];
       for (let i = 0; i < dart.notNull(length); i++) {
-        action(this[dartx.get](i));
+        action(this[dartx._get](i));
         if (length != this[dartx.length]) {
           dart.throw(new core.ConcurrentModificationError(this));
         }
@@ -5544,21 +5740,21 @@
     }
     get first() {
       if (this[dartx.length] == 0) dart.throw(_internal.IterableElementError.noElement());
-      return this[dartx.get](0);
+      return this[dartx._get](0);
     }
     get last() {
       if (this[dartx.length] == 0) dart.throw(_internal.IterableElementError.noElement());
-      return this[dartx.get](dart.notNull(this[dartx.length]) - 1);
+      return this[dartx._get](dart.notNull(this[dartx.length]) - 1);
     }
     get single() {
       if (this[dartx.length] == 0) dart.throw(_internal.IterableElementError.noElement());
       if (dart.notNull(this[dartx.length]) > 1) dart.throw(_internal.IterableElementError.tooMany());
-      return this[dartx.get](0);
+      return this[dartx._get](0);
     }
     contains(element) {
       let length = this[dartx.length];
       for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-        if (dart.equals(this[dartx.get](i), element)) return true;
+        if (dart.equals(this[dartx._get](i), element)) return true;
         if (length != this[dartx.length]) {
           dart.throw(new core.ConcurrentModificationError(this));
         }
@@ -5568,7 +5764,7 @@
     every(test) {
       let length = this[dartx.length];
       for (let i = 0; i < dart.notNull(length); i++) {
-        if (!dart.test(test(this[dartx.get](i)))) return false;
+        if (!dart.test(test(this[dartx._get](i)))) return false;
         if (length != this[dartx.length]) {
           dart.throw(new core.ConcurrentModificationError(this));
         }
@@ -5578,7 +5774,7 @@
     any(test) {
       let length = this[dartx.length];
       for (let i = 0; i < dart.notNull(length); i++) {
-        if (dart.test(test(this[dartx.get](i)))) return true;
+        if (dart.test(test(this[dartx._get](i)))) return true;
         if (length != this[dartx.length]) {
           dart.throw(new core.ConcurrentModificationError(this));
         }
@@ -5590,7 +5786,7 @@
       VoidToE()._check(orElse);
       let length = this[dartx.length];
       for (let i = 0; i < dart.notNull(length); i++) {
-        let element = this[dartx.get](i);
+        let element = this[dartx._get](i);
         if (dart.test(test(element))) return element;
         if (length != this[dartx.length]) {
           dart.throw(new core.ConcurrentModificationError(this));
@@ -5604,7 +5800,7 @@
       VoidToE()._check(orElse);
       let length = this[dartx.length];
       for (let i = dart.notNull(length) - 1; i >= 0; i--) {
-        let element = this[dartx.get](i);
+        let element = this[dartx._get](i);
         if (dart.test(test(element))) return element;
         if (length != this[dartx.length]) {
           dart.throw(new core.ConcurrentModificationError(this));
@@ -5618,7 +5814,7 @@
       let match = null;
       let matchFound = false;
       for (let i = 0; i < dart.notNull(length); i++) {
-        let element = this[dartx.get](i);
+        let element = this[dartx._get](i);
         if (dart.test(test(element))) {
           if (matchFound) {
             dart.throw(_internal.IterableElementError.tooMany());
@@ -5657,9 +5853,9 @@
       EAndEToE()._check(combine);
       let length = this[dartx.length];
       if (length == 0) dart.throw(_internal.IterableElementError.noElement());
-      let value = this[dartx.get](0);
+      let value = this[dartx._get](0);
       for (let i = 1; i < dart.notNull(length); i++) {
-        value = combine(value, this[dartx.get](i));
+        value = combine(value, this[dartx._get](i));
         if (length != this[dartx.length]) {
           dart.throw(new core.ConcurrentModificationError(this));
         }
@@ -5671,7 +5867,7 @@
         let value = initialValue;
         let length = this[dartx.length];
         for (let i = 0; i < dart.notNull(length); i++) {
-          value = combine(value, this[dartx.get](i));
+          value = combine(value, this[dartx._get](i));
           if (length != this[dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this));
           }
@@ -5701,20 +5897,20 @@
         result = ListOfE().new(this[dartx.length]);
       }
       for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-        result[dartx.set](i, this[dartx.get](i));
+        result[dartx._set](i, this[dartx._get](i));
       }
       return result;
     }
     toSet() {
       let result = SetOfE().new();
       for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-        result.add(this[dartx.get](i));
+        result.add(this[dartx._get](i));
       }
       return result;
     }
     add(element) {
       E._check(element);
-      this[dartx.set]((() => {
+      this[dartx._set]((() => {
         let x = this[dartx.length];
         this[dartx.length] = dart.notNull(x) + 1;
         return x;
@@ -5726,13 +5922,13 @@
       for (let element of iterable) {
         dart.assert(this[dartx.length] == i || dart.test(dart.throw(new core.ConcurrentModificationError(this))));
         this[dartx.length] = dart.notNull(i) + 1;
-        this[dartx.set](i, element);
+        this[dartx._set](i, element);
         i = dart.notNull(i) + 1;
       }
     }
     remove(element) {
       for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-        if (dart.equals(this[dartx.get](i), element)) {
+        if (dart.equals(this[dartx._get](i), element)) {
           this[dartx.setRange](i, dart.notNull(this[dartx.length]) - 1, this, i + 1);
           this[dartx.length] = dart.notNull(this[dartx.length]) - 1;
           return true;
@@ -5741,16 +5937,17 @@
       return false;
     }
     removeWhere(test) {
-      collection.ListMixin._filter(this, test, false);
+      this[_filter](test, false);
     }
     retainWhere(test) {
-      collection.ListMixin._filter(this, test, true);
+      this[_filter](test, true);
     }
-    static _filter(source, test, retainMatching) {
-      let retained = [];
+    [_filter](test, retainMatching) {
+      let source = this;
+      let retained = JSArrayOfE().of([]);
       let length = source[dartx.length];
       for (let i = 0; i < dart.notNull(length); i++) {
-        let element = source[dartx.get](i);
+        let element = source[dartx._get](i);
         if (dart.dcall(test, element) == retainMatching) {
           retained[dartx.add](element);
         }
@@ -5770,7 +5967,7 @@
       if (this[dartx.length] == 0) {
         dart.throw(_internal.IterableElementError.noElement());
       }
-      let result = this[dartx.get](dart.notNull(this[dartx.length]) - 1);
+      let result = this[dartx._get](dart.notNull(this[dartx.length]) - 1);
       this[dartx.length] = dart.notNull(this[dartx.length]) - 1;
       return result;
     }
@@ -5789,9 +5986,9 @@
       while (dart.notNull(length) > 1) {
         let pos = random.nextInt(length);
         length = dart.notNull(length) - 1;
-        let tmp = this[dartx.get](length);
-        this[dartx.set](length, this[dartx.get](pos));
-        this[dartx.set](pos, tmp);
+        let tmp = this[dartx._get](length);
+        this[dartx._set](length, this[dartx._get](pos));
+        this[dartx._set](pos, tmp);
       }
     }
     asMap() {
@@ -5806,7 +6003,7 @@
       let result = ListOfE().new();
       result[dartx.length] = length;
       for (let i = 0; i < length; i++) {
-        result[dartx.set](i, this[dartx.get](dart.notNull(start) + i));
+        result[dartx._set](i, this[dartx._get](dart.notNull(start) + i));
       }
       return result;
     }
@@ -5825,7 +6022,7 @@
       E._check(fill);
       core.RangeError.checkValidRange(start, end, this[dartx.length]);
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        this[dartx.set](i, fill);
+        this[dartx._set](i, fill);
       }
     }
     setRange(start, end, iterable, skipCount) {
@@ -5849,11 +6046,11 @@
       }
       if (dart.notNull(otherStart) < dart.notNull(start)) {
         for (let i = length - 1; i >= 0; i--) {
-          this[dartx.set](dart.notNull(start) + i, otherList[dartx.get](dart.notNull(otherStart) + i));
+          this[dartx._set](dart.notNull(start) + i, otherList[dartx._get](dart.notNull(otherStart) + i));
         }
       } else {
         for (let i = 0; i < length; i++) {
-          this[dartx.set](dart.notNull(start) + i, otherList[dartx.get](dart.notNull(otherStart) + i));
+          this[dartx._set](dart.notNull(start) + i, otherList[dartx._get](dart.notNull(otherStart) + i));
         }
       }
     }
@@ -5892,7 +6089,7 @@
         startIndex = 0;
       }
       for (let i = startIndex; dart.notNull(i) < dart.notNull(this[dartx.length]); i = dart.notNull(i) + 1) {
-        if (dart.equals(this[dartx.get](i), element)) {
+        if (dart.equals(this[dartx._get](i), element)) {
           return i;
         }
       }
@@ -5911,7 +6108,7 @@
         }
       }
       for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) {
-        if (dart.equals(this[dartx.get](i), element)) {
+        if (dart.equals(this[dartx._get](i), element)) {
           return i;
         }
       }
@@ -5927,10 +6124,10 @@
       if (!(typeof index == 'number')) dart.throw(new core.ArgumentError(index));
       this[dartx.length] = dart.notNull(this[dartx.length]) + 1;
       this[dartx.setRange](dart.notNull(index) + 1, this[dartx.length], this, index);
-      this[dartx.set](index, element);
+      this[dartx._set](index, element);
     }
     removeAt(index) {
-      let result = this[dartx.get](index);
+      let result = this[dartx._get](index);
       this[dartx.setRange](index, dart.notNull(this[dartx.length]) - 1, this, dart.notNull(index) + 1);
       this[dartx.length] = dart.notNull(this[dartx.length]) - 1;
       return result;
@@ -5956,7 +6153,7 @@
         this[dartx.setRange](index, dart.notNull(index) + dart.notNull(iterable[dartx.length]), iterable);
       } else {
         for (let element of iterable) {
-          this[dartx.set]((() => {
+          this[dartx._set]((() => {
             let x = index;
             index = dart.notNull(x) + 1;
             return x;
@@ -6009,6 +6206,7 @@
       remove: dart.definiteFunctionType(core.bool, [core.Object]),
       removeWhere: dart.definiteFunctionType(dart.void, [ETobool()]),
       retainWhere: dart.definiteFunctionType(dart.void, [ETobool()]),
+      [_filter]: dart.definiteFunctionType(dart.void, [dynamicTobool(), core.bool]),
       clear: dart.definiteFunctionType(dart.void, []),
       removeLast: dart.definiteFunctionType(E, []),
       sort: dart.definiteFunctionType(dart.void, [], [EAndEToint()]),
@@ -6026,9 +6224,7 @@
       removeAt: dart.definiteFunctionType(E, [core.int]),
       insertAll: dart.definiteFunctionType(dart.void, [core.int, IterableOfE()]),
       setAll: dart.definiteFunctionType(dart.void, [core.int, IterableOfE()])
-    }),
-    statics: () => ({_filter: dart.definiteFunctionType(dart.void, [core.List, dynamicTobool(), core.bool])}),
-    names: ['_filter']
+    })
   });
   dart.defineExtensionMembers(ListMixin, [
     'elementAt',
@@ -6105,7 +6301,7 @@
   let ETobool = () => (ETobool = dart.constFn(dart.functionType(core.bool, [E])))();
   let ComparatorOfE = () => (ComparatorOfE = dart.constFn(core.Comparator$(E)))();
   class UnmodifiableListMixin extends core.Object {
-    set(index, value) {
+    _set(index, value) {
       E._check(value);
       dart.throw(new core.UnsupportedError("Cannot modify an unmodifiable list"));
       return value;
@@ -6182,7 +6378,7 @@
   dart.setSignature(UnmodifiableListMixin, {
     setters: () => ({length: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      set: dart.definiteFunctionType(dart.void, [core.int, E]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, E]),
       setAll: dart.definiteFunctionType(dart.void, [core.int, IterableOfE()]),
       add: dart.definiteFunctionType(dart.void, [E]),
       insert: dart.definiteFunctionType(dart.void, [core.int, E]),
@@ -6203,7 +6399,7 @@
     })
   });
   dart.defineExtensionMembers(UnmodifiableListMixin, [
-    'set',
+    '_set',
     'setAll',
     'add',
     'insert',
@@ -6272,7 +6468,7 @@
   set length(value) {
     super.length = value;
   }
-  get(i) {
+  _get(i) {
     return this[_string][dartx.codeUnitAt](i);
   }
   static stringOf(u) {
@@ -6284,11 +6480,11 @@
   constructors: () => ({new: dart.definiteFunctionType(_internal.CodeUnits, [core.String])}),
   fields: () => ({[_string]: core.String}),
   getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
-  methods: () => ({get: dart.definiteFunctionType(core.int, [core.int])}),
+  methods: () => ({_get: dart.definiteFunctionType(core.int, [core.int])}),
   statics: () => ({stringOf: dart.definiteFunctionType(core.String, [_internal.CodeUnits])}),
   names: ['stringOf']
 });
-dart.defineExtensionMembers(_internal.CodeUnits, ['get', 'length']);
+dart.defineExtensionMembers(_internal.CodeUnits, ['_get', 'length']);
 _internal.EfficientLength = class EfficientLength extends core.Object {};
 core.Iterable$ = dart.generic(E => {
   let EmptyIterableOfE = () => (EmptyIterableOfE = dart.constFn(_internal.EmptyIterable$(E)))();
@@ -6807,7 +7003,7 @@
         result = ListOfE().new(this.length);
       }
       for (let i = 0; i < dart.notNull(this.length); i++) {
-        result[dartx.set](i, this.elementAt(i));
+        result[dartx._set](i, this.elementAt(i));
       }
       return result;
     }
@@ -6955,7 +7151,7 @@
         return _;
       })() : ListOfE().new(length);
       for (let i = 0; i < length; i++) {
-        result[dartx.set](i, this[_iterable][dartx.elementAt](dart.notNull(start) + i));
+        result[dartx._set](i, this[_iterable][dartx.elementAt](dart.notNull(start) + i));
         if (dart.notNull(this[_iterable][dartx.length]) < dart.notNull(end)) dart.throw(new core.ConcurrentModificationError(this));
       }
       return result;
@@ -8005,8 +8201,8 @@
     new(values) {
       this[_values] = values;
     }
-    get(key) {
-      return dart.test(this.containsKey(key)) ? this[_values][dartx.get](core.int._check(key)) : null;
+    _get(key) {
+      return dart.test(this.containsKey(key)) ? this[_values][dartx._get](core.int._check(key)) : null;
     }
     get length() {
       return this[_values][dartx.length];
@@ -8032,13 +8228,13 @@
     forEach(f) {
       let length = this[_values][dartx.length];
       for (let i = 0; i < dart.notNull(length); i++) {
-        f(i, this[_values][dartx.get](i));
+        f(i, this[_values][dartx._get](i));
         if (length != this[_values][dartx.length]) {
           dart.throw(new core.ConcurrentModificationError(this[_values]));
         }
       }
     }
-    set(key, value) {
+    _set(key, value) {
       E._check(value);
       dart.throw(new core.UnsupportedError("Cannot modify an unmodifiable map"));
       return value;
@@ -8074,11 +8270,11 @@
       isNotEmpty: dart.definiteFunctionType(core.bool, [])
     }),
     methods: () => ({
-      get: dart.definiteFunctionType(E, [core.Object]),
+      _get: dart.definiteFunctionType(E, [core.Object]),
       containsValue: dart.definiteFunctionType(core.bool, [core.Object]),
       containsKey: dart.definiteFunctionType(core.bool, [core.Object]),
       forEach: dart.definiteFunctionType(dart.void, [intAndETovoid()]),
-      set: dart.definiteFunctionType(dart.void, [core.int, E]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, E]),
       putIfAbsent: dart.definiteFunctionType(E, [core.int, VoidToE()]),
       remove: dart.definiteFunctionType(E, [core.Object]),
       clear: dart.definiteFunctionType(dart.void, []),
@@ -8086,11 +8282,11 @@
     })
   });
   dart.defineExtensionMembers(ListMapView, [
-    'get',
+    '_get',
     'containsValue',
     'containsKey',
     'forEach',
-    'set',
+    '_set',
     'putIfAbsent',
     'remove',
     'clear',
@@ -8187,11 +8383,11 @@
   static copy(src, srcStart, dst, dstStart, count) {
     if (dart.notNull(srcStart) < dart.notNull(dstStart)) {
       for (let i = dart.notNull(srcStart) + dart.notNull(count) - 1, j = dart.notNull(dstStart) + dart.notNull(count) - 1; i >= dart.notNull(srcStart); i--, j--) {
-        dst[dartx.set](j, src[dartx.get](i));
+        dst[dartx._set](j, src[dartx._get](i));
       }
     } else {
       for (let i = srcStart, j = dstStart; dart.notNull(i) < dart.notNull(srcStart) + dart.notNull(count); i = dart.notNull(i) + 1, j = dart.notNull(j) + 1) {
-        dst[dartx.set](j, src[dartx.get](i));
+        dst[dartx._set](j, src[dartx._get](i));
       }
     }
   }
@@ -8201,7 +8397,7 @@
     let length = a[dartx.length];
     if (!dart.equals(length, dart.dload(b, 'length'))) return false;
     for (let i = 0; i < dart.notNull(length); i++) {
-      if (!core.identical(a[dartx.get](i), dart.dindex(b, i))) return false;
+      if (!core.identical(a[dartx._get](i), dart.dindex(b, i))) return false;
     }
     return true;
   }
@@ -8213,7 +8409,7 @@
       startIndex = 0;
     }
     for (let i = startIndex; dart.notNull(i) < dart.notNull(endIndex); i = dart.notNull(i) + 1) {
-      if (dart.equals(a[dartx.get](i), element)) {
+      if (dart.equals(a[dartx._get](i), element)) {
         return i;
       }
     }
@@ -8227,7 +8423,7 @@
       startIndex = dart.notNull(a[dartx.length]) - 1;
     }
     for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) {
-      if (dart.equals(a[dartx.get](i), element)) {
+      if (dart.equals(a[dartx._get](i), element)) {
         return i;
       }
     }
@@ -8287,13 +8483,13 @@
   static _insertionSort(E) {
     return (a, left, right, compare) => {
       for (let i = dart.notNull(left) + 1; i <= dart.notNull(right); i++) {
-        let el = a[dartx.get](i);
+        let el = a[dartx._get](i);
         let j = i;
-        while (j > dart.notNull(left) && dart.notNull(compare(a[dartx.get](j - 1), el)) > 0) {
-          a[dartx.set](j, a[dartx.get](j - 1));
+        while (j > dart.notNull(left) && dart.notNull(compare(a[dartx._get](j - 1), el)) > 0) {
+          a[dartx._set](j, a[dartx._get](j - 1));
           j--;
         }
-        a[dartx.set](j, el);
+        a[dartx._set](j, el);
       }
     };
   }
@@ -8306,11 +8502,11 @@
       let index3 = ((dart.notNull(left) + dart.notNull(right)) / 2)[dartx.truncate]();
       let index2 = index3 - sixth;
       let index4 = index3 + sixth;
-      let el1 = a[dartx.get](index1);
-      let el2 = a[dartx.get](index2);
-      let el3 = a[dartx.get](index3);
-      let el4 = a[dartx.get](index4);
-      let el5 = a[dartx.get](index5);
+      let el1 = a[dartx._get](index1);
+      let el2 = a[dartx._get](index2);
+      let el3 = a[dartx._get](index3);
+      let el4 = a[dartx._get](index4);
+      let el5 = a[dartx._get](index5);
       if (dart.notNull(compare(el1, el2)) > 0) {
         let t = el1;
         el1 = el2;
@@ -8358,40 +8554,40 @@
       }
       let pivot1 = el2;
       let pivot2 = el4;
-      a[dartx.set](index1, el1);
-      a[dartx.set](index3, el3);
-      a[dartx.set](index5, el5);
-      a[dartx.set](index2, a[dartx.get](left));
-      a[dartx.set](index4, a[dartx.get](right));
+      a[dartx._set](index1, el1);
+      a[dartx._set](index3, el3);
+      a[dartx._set](index5, el5);
+      a[dartx._set](index2, a[dartx._get](left));
+      a[dartx._set](index4, a[dartx._get](right));
       let less = dart.notNull(left) + 1;
       let great = dart.notNull(right) - 1;
       let pivots_are_equal = compare(pivot1, pivot2) == 0;
       if (pivots_are_equal) {
         let pivot = pivot1;
         for (let k = less; k <= great; k++) {
-          let ak = a[dartx.get](k);
+          let ak = a[dartx._get](k);
           let comp = compare(ak, pivot);
           if (comp == 0) continue;
           if (dart.notNull(comp) < 0) {
             if (k != less) {
-              a[dartx.set](k, a[dartx.get](less));
-              a[dartx.set](less, ak);
+              a[dartx._set](k, a[dartx._get](less));
+              a[dartx._set](less, ak);
             }
             less++;
           } else {
             while (true) {
-              comp = compare(a[dartx.get](great), pivot);
+              comp = compare(a[dartx._get](great), pivot);
               if (dart.notNull(comp) > 0) {
                 great--;
                 continue;
               } else if (dart.notNull(comp) < 0) {
-                a[dartx.set](k, a[dartx.get](less));
-                a[dartx.set](less++, a[dartx.get](great));
-                a[dartx.set](great--, ak);
+                a[dartx._set](k, a[dartx._get](less));
+                a[dartx._set](less++, a[dartx._get](great));
+                a[dartx._set](great--, ak);
                 break;
               } else {
-                a[dartx.set](k, a[dartx.get](great));
-                a[dartx.set](great--, ak);
+                a[dartx._set](k, a[dartx._get](great));
+                a[dartx._set](great--, ak);
                 break;
               }
             }
@@ -8399,32 +8595,32 @@
         }
       } else {
         for (let k = less; k <= great; k++) {
-          let ak = a[dartx.get](k);
+          let ak = a[dartx._get](k);
           let comp_pivot1 = compare(ak, pivot1);
           if (dart.notNull(comp_pivot1) < 0) {
             if (k != less) {
-              a[dartx.set](k, a[dartx.get](less));
-              a[dartx.set](less, ak);
+              a[dartx._set](k, a[dartx._get](less));
+              a[dartx._set](less, ak);
             }
             less++;
           } else {
             let comp_pivot2 = compare(ak, pivot2);
             if (dart.notNull(comp_pivot2) > 0) {
               while (true) {
-                let comp = compare(a[dartx.get](great), pivot2);
+                let comp = compare(a[dartx._get](great), pivot2);
                 if (dart.notNull(comp) > 0) {
                   great--;
                   if (great < k) break;
                   continue;
                 } else {
-                  comp = compare(a[dartx.get](great), pivot1);
+                  comp = compare(a[dartx._get](great), pivot1);
                   if (dart.notNull(comp) < 0) {
-                    a[dartx.set](k, a[dartx.get](less));
-                    a[dartx.set](less++, a[dartx.get](great));
-                    a[dartx.set](great--, ak);
+                    a[dartx._set](k, a[dartx._get](less));
+                    a[dartx._set](less++, a[dartx._get](great));
+                    a[dartx._set](great--, ak);
                   } else {
-                    a[dartx.set](k, a[dartx.get](great));
-                    a[dartx.set](great--, ak);
+                    a[dartx._set](k, a[dartx._get](great));
+                    a[dartx._set](great--, ak);
                   }
                   break;
                 }
@@ -8433,49 +8629,49 @@
           }
         }
       }
-      a[dartx.set](left, a[dartx.get](less - 1));
-      a[dartx.set](less - 1, pivot1);
-      a[dartx.set](right, a[dartx.get](great + 1));
-      a[dartx.set](great + 1, pivot2);
+      a[dartx._set](left, a[dartx._get](less - 1));
+      a[dartx._set](less - 1, pivot1);
+      a[dartx._set](right, a[dartx._get](great + 1));
+      a[dartx._set](great + 1, pivot2);
       _internal.Sort._doSort(E)(a, left, less - 2, compare);
       _internal.Sort._doSort(E)(a, great + 2, right, compare);
       if (pivots_are_equal) {
         return;
       }
       if (less < index1 && great > index5) {
-        while (compare(a[dartx.get](less), pivot1) == 0) {
+        while (compare(a[dartx._get](less), pivot1) == 0) {
           less++;
         }
-        while (compare(a[dartx.get](great), pivot2) == 0) {
+        while (compare(a[dartx._get](great), pivot2) == 0) {
           great--;
         }
         for (let k = less; k <= great; k++) {
-          let ak = a[dartx.get](k);
+          let ak = a[dartx._get](k);
           let comp_pivot1 = compare(ak, pivot1);
           if (comp_pivot1 == 0) {
             if (k != less) {
-              a[dartx.set](k, a[dartx.get](less));
-              a[dartx.set](less, ak);
+              a[dartx._set](k, a[dartx._get](less));
+              a[dartx._set](less, ak);
             }
             less++;
           } else {
             let comp_pivot2 = compare(ak, pivot2);
             if (comp_pivot2 == 0) {
               while (true) {
-                let comp = compare(a[dartx.get](great), pivot2);
+                let comp = compare(a[dartx._get](great), pivot2);
                 if (comp == 0) {
                   great--;
                   if (great < k) break;
                   continue;
                 } else {
-                  comp = compare(a[dartx.get](great), pivot1);
+                  comp = compare(a[dartx._get](great), pivot1);
                   if (dart.notNull(comp) < 0) {
-                    a[dartx.set](k, a[dartx.get](less));
-                    a[dartx.set](less++, a[dartx.get](great));
-                    a[dartx.set](great--, ak);
+                    a[dartx._set](k, a[dartx._get](less));
+                    a[dartx._set](less++, a[dartx._get](great));
+                    a[dartx._set](great--, ak);
                   } else {
-                    a[dartx.set](k, a[dartx.get](great));
-                    a[dartx.set](great--, ak);
+                    a[dartx._set](k, a[dartx._get](great));
+                    a[dartx._set](great--, ak);
                   }
                   break;
                 }
@@ -8503,18 +8699,26 @@
 });
 _internal.Sort._INSERTION_SORT_THRESHOLD = 32;
 const _name = Symbol('_name');
+const _nativeSymbol = Symbol('_nativeSymbol');
 _internal.Symbol = class Symbol extends core.Object {
   new(name) {
     this[_name] = name;
+    this[_nativeSymbol] = null;
+  }
+  es6(name, nativeSymbol) {
+    this[_name] = name;
+    this[_nativeSymbol] = nativeSymbol;
   }
   unvalidated(name) {
     this[_name] = name;
+    this[_nativeSymbol] = null;
   }
   validated(name) {
     this[_name] = _internal.Symbol.validatePublicSymbol(name);
+    this[_nativeSymbol] = null;
   }
   ['=='](other) {
-    return _internal.Symbol.is(other) && this[_name] == other[_name];
+    return _internal.Symbol.is(other) && this[_name] == other[_name] && dart.equals(this[_nativeSymbol], other[_nativeSymbol]);
   }
   get hashCode() {
     let hash = this._hashCode;
@@ -8530,6 +8734,9 @@
   static getName(symbol) {
     return symbol[_name];
   }
+  static getNativeSymbol(symbol) {
+    return symbol[_nativeSymbol];
+  }
   static validatePublicSymbol(name) {
     if (dart.test(name[dartx.isEmpty]) || dart.test(_internal.Symbol.publicSymbolPattern.hasMatch(name))) return name;
     if (dart.test(name[dartx.startsWith]('_'))) {
@@ -8541,16 +8748,21 @@
     return dart.test(name[dartx.isEmpty]) || dart.test(_internal.Symbol.symbolPattern.hasMatch(name));
   }
 };
+dart.defineNamedConstructor(_internal.Symbol, 'es6');
 dart.defineNamedConstructor(_internal.Symbol, 'unvalidated');
 dart.defineNamedConstructor(_internal.Symbol, 'validated');
 _internal.Symbol[dart.implements] = () => [core.Symbol];
 dart.setSignature(_internal.Symbol, {
   constructors: () => ({
     new: dart.definiteFunctionType(_internal.Symbol, [core.String]),
+    es6: dart.definiteFunctionType(_internal.Symbol, [core.String, dart.dynamic]),
     unvalidated: dart.definiteFunctionType(_internal.Symbol, [core.String]),
     validated: dart.definiteFunctionType(_internal.Symbol, [core.String])
   }),
-  fields: () => ({[_name]: core.String}),
+  fields: () => ({
+    [_name]: core.String,
+    [_nativeSymbol]: dart.dynamic
+  }),
   methods: () => ({'==': dart.definiteFunctionType(core.bool, [core.Object])}),
   sfields: () => ({
     reservedWordRE: core.String,
@@ -8562,10 +8774,11 @@
   }),
   statics: () => ({
     getName: dart.definiteFunctionType(core.String, [_internal.Symbol]),
+    getNativeSymbol: dart.definiteFunctionType(dart.dynamic, [_internal.Symbol]),
     validatePublicSymbol: dart.definiteFunctionType(core.String, [core.String]),
     isValidSymbol: dart.definiteFunctionType(core.bool, [core.String])
   }),
-  names: ['getName', 'validatePublicSymbol', 'isValidSymbol']
+  names: ['getName', 'getNativeSymbol', 'validatePublicSymbol', 'isValidSymbol']
 });
 _internal.Symbol.reservedWordRE = '(?:assert|break|c(?:a(?:se|tch)|lass|on(?:st|tinue))|d(?:efault|o)|' + 'e(?:lse|num|xtends)|f(?:alse|inal(?:ly)?|or)|i[fns]|n(?:ew|ull)|' + 'ret(?:hrow|urn)|s(?:uper|witch)|t(?:h(?:is|row)|r(?:ue|y))|' + 'v(?:ar|oid)|w(?:hile|ith))';
 _internal.Symbol.operatorRE = '(?:[\\-+*/%&|^]|\\[\\]=?|==|~/?|<[<=]?|>[>=]?|unary-)';
@@ -8850,8 +9063,8 @@
       return;
     }
     let message = core.List.new(2);
-    message[dartx.set](0, dart.toString(error));
-    message[dartx.set](1, stackTrace == null ? null : dart.toString(stackTrace));
+    message[dartx._set](0, dart.toString(error));
+    message[dartx._set](1, stackTrace == null ? null : dart.toString(stackTrace));
     for (let port of this.errorPorts)
       port.send(message);
   }
@@ -8939,13 +9152,13 @@
     }
   }
   lookup(portId) {
-    return this.ports[dartx.get](portId);
+    return this.ports[dartx._get](portId);
   }
   [_addRegistration](portId, port) {
     if (dart.test(this.ports[dartx.containsKey](portId))) {
       dart.throw(core.Exception.new("Registry: ports must be registered only once."));
     }
-    this.ports[dartx.set](portId, port);
+    this.ports[dartx._set](portId, port);
   }
   register(portId, port) {
     this[_addRegistration](portId, port);
@@ -8957,7 +9170,7 @@
   }
   [_updateGlobalState]() {
     if (dart.notNull(this.ports[dartx.length]) - dart.notNull(this.weakPorts.length) > 0 || dart.test(this.isPaused) || !dart.test(this.initialized)) {
-      _isolate_helper._globalState.isolates[dartx.set](this.id, this);
+      _isolate_helper._globalState.isolates[dartx._set](this.id, this);
     } else {
       this.kill();
     }
@@ -9242,7 +9455,7 @@
       }
       case 'close':
       {
-        _isolate_helper._globalState.managers[dartx.remove](_isolate_helper.IsolateNatives.workerIds.get(sender));
+        _isolate_helper._globalState.managers[dartx.remove](_isolate_helper.IsolateNatives.workerIds._get(sender));
         sender.terminate();
         _isolate_helper._globalState.topEventLoop.run();
         break;
@@ -9405,8 +9618,8 @@
     let o = _isolate_helper._globalState;
     let workerId = o.nextManagerId;
     o.nextManagerId = dart.notNull(workerId) + 1;
-    _isolate_helper.IsolateNatives.workerIds.set(worker, workerId);
-    _isolate_helper._globalState.managers[dartx.set](workerId, worker);
+    _isolate_helper.IsolateNatives.workerIds._set(worker, workerId);
+    _isolate_helper._globalState.managers[dartx._set](workerId, worker);
     worker.postMessage(_isolate_helper._serializeMessage(dart.map({command: 'start', id: workerId, replyTo: _isolate_helper._serializeMessage(replyPort), args: args, msg: _isolate_helper._serializeMessage(message), isSpawnUri: isSpawnUri, startPaused: startPaused, functionName: functionName}, core.String, core.Object)));
   }
   static workerOnError(event, uri, onError) {
@@ -9489,7 +9702,7 @@
     super.new(isolateId);
   }
   send(message) {
-    let isolate = _isolate_helper._globalState.isolates[dartx.get](this[_isolateId]);
+    let isolate = _isolate_helper._globalState.isolates[dartx._get](this[_isolateId]);
     if (isolate == null) return;
     if (dart.test(this[_receivePort][_isClosed])) return;
     let msg = _isolate_helper._clone(message);
@@ -9529,7 +9742,7 @@
     if (dart.test(_isolate_helper._globalState.isWorker)) {
       _isolate_helper._globalState.mainManager.postMessage(workerMessage);
     } else {
-      let manager = _isolate_helper._globalState.managers[dartx.get](this[_workerId]);
+      let manager = _isolate_helper._globalState.managers[dartx._get](this[_workerId]);
       if (manager != null) {
         manager.postMessage(workerMessage);
       }
@@ -10567,10 +10780,10 @@
   }
   serialize(x) {
     if (dart.test(this.isPrimitive(x))) return this.serializePrimitive(x);
-    let serializationId = this.serializedObjectIds[dartx.get](x);
+    let serializationId = this.serializedObjectIds[dartx._get](x);
     if (serializationId != null) return this.makeRef(serializationId);
     serializationId = this.serializedObjectIds[dartx.length];
-    this.serializedObjectIds[dartx.set](x, serializationId);
+    this.serializedObjectIds[dartx._set](x, serializationId);
     if (_native_typed_data.NativeByteBuffer.is(x)) return this.serializeByteBuffer(x);
     if (_native_typed_data.NativeTypedData.is(x)) return this.serializeTypedData(x);
     if (_interceptors.JSIndexable.is(x)) return this.serializeJSIndexable(x);
@@ -10619,13 +10832,13 @@
     let serialized = [];
     serialized[dartx.length] = x[dartx.length];
     for (let i = 0; i < dart.notNull(x[dartx.length]); i++) {
-      serialized[dartx.set](i, this.serialize(x[dartx.get](i)));
+      serialized[dartx._set](i, this.serialize(x[dartx._get](i)));
     }
     return serialized;
   }
   serializeArrayInPlace(x) {
     for (let i = 0; i < dart.notNull(x[dartx.length]); i++) {
-      x[dartx.set](i, this.serialize(x[dartx.get](i)));
+      x[dartx._set](i, this.serialize(x[dartx._get](i)));
     }
     return x;
   }
@@ -10641,7 +10854,7 @@
     let values = [];
     values[dartx.length] = keys[dartx.length];
     for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-      values[dartx.set](i, this.serialize(x[keys[dartx.get](i)]));
+      values[dartx._set](i, this.serialize(x[keys[dartx._get](i)]));
     }
     return JSArrayOfObject().of(['js-object', keys, values]);
   }
@@ -10780,7 +10993,7 @@
   deserializeRef(x) {
     dart.assert(dart.equals(dart.dindex(x, 0), 'ref'));
     let serializationId = core.int._check(dart.dindex(x, 1));
-    return this.deserializedObjects[dartx.get](serializationId);
+    return this.deserializedObjects[dartx._get](serializationId);
   }
   deserializeByteBuffer(x) {
     dart.assert(dart.equals(dart.dindex(x, 0), 'buffer'));
@@ -10796,7 +11009,7 @@
   }
   deserializeArrayInPlace(x) {
     for (let i = 0; i < dart.notNull(x[dartx.length]); i++) {
-      x[dartx.set](i, this.deserialize(x[dartx.get](i)));
+      x[dartx._set](i, this.deserialize(x[dartx._get](i)));
     }
     return x;
   }
@@ -10825,14 +11038,14 @@
     return _interceptors.JSArray.markFixed(this.deserializeArrayInPlace(_interceptors.JSArray._check(result)));
   }
   deserializeMap(x) {
-    dart.assert(dart.equals(x.get(0), 'map'));
-    let keys = core.List._check(x.get(1));
-    let values = core.List._check(x.get(2));
+    dart.assert(dart.equals(x._get(0), 'map'));
+    let keys = core.List._check(x._get(1));
+    let values = core.List._check(x._get(2));
     let result = dart.map();
     this.deserializedObjects[dartx.add](result);
     keys = keys[dartx.map](dart.dynamic)(dart.bind(this, 'deserialize'))[dartx.toList]();
     for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-      result[dartx.set](keys[dartx.get](i), this.deserialize(values[dartx.get](i)));
+      result[dartx._set](keys[dartx._get](i), this.deserialize(values[dartx._get](i)));
     }
     return result;
   }
@@ -10843,7 +11056,7 @@
     let receivePortId = core.int._check(dart.dindex(x, 3));
     let result = null;
     if (managerId == _isolate_helper._globalState.currentManagerId) {
-      let isolate = _isolate_helper._globalState.isolates[dartx.get](isolateId);
+      let isolate = _isolate_helper._globalState.isolates[dartx._get](isolateId);
       if (isolate == null) return null;
       let receivePort = isolate.lookup(receivePortId);
       if (receivePort == null) return null;
@@ -10867,7 +11080,7 @@
     let o = {};
     this.deserializedObjects[dartx.add](o);
     for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-      o[keys[dartx.get](i)] = this.deserialize(values[dartx.get](i));
+      o[keys[dartx._get](i)] = this.deserialize(values[dartx._get](i));
     }
     return o;
   }
@@ -10991,12 +11204,12 @@
     if (match == null) {
       return _js_helper.Primitives._parseIntError(source, handleError);
     }
-    let decimalMatch = match[dartx.get](decimalIndex);
+    let decimalMatch = match[dartx._get](decimalIndex);
     if (radix == null) {
       if (decimalMatch != null) {
         return parseInt(source, 10);
       }
-      if (match[dartx.get](hexIndex) != null) {
+      if (match[dartx._get](hexIndex) != null) {
         return parseInt(source, 16);
       }
       return _js_helper.Primitives._parseIntError(source, handleError);
@@ -11017,7 +11230,7 @@
       } else {
         maxCharCode = 97 - 10 - 1 + dart.notNull(radix);
       }
-      dart.assert(typeof match[dartx.get](digitsIndex) == 'string');
+      dart.assert(typeof match[dartx._get](digitsIndex) == 'string');
       let digitsPart = match[digitsIndex];
       for (let i = 0; i < dart.notNull(digitsPart[dartx.length]); i++) {
         let characterCode = (dart.notNull(digitsPart[dartx.codeUnitAt](i)) | 32) >>> 0;
@@ -11155,11 +11368,11 @@
   static getTimeZoneName(receiver) {
     let d = _js_helper.Primitives.lazyAsJsDate(receiver);
     let match = /\((.*)\)/.exec(d.toString());
-    if (match != null) return core.String._check(match[dartx.get](1));
+    if (match != null) return core.String._check(match[dartx._get](1));
     match = /^[A-Z,a-z]{3}\s[A-Z,a-z]{3}\s\d+\s\d{2}:\d{2}:\d{2}\s([A-Z]{3,5})\s\d{4}$/.exec(d.toString());
-    if (match != null) return core.String._check(match[dartx.get](1));
+    if (match != null) return core.String._check(match[dartx._get](1));
     match = /(?:GMT|UTC)[+-]\d{4}/.exec(d.toString());
-    if (match != null) return core.String._check(match[dartx.get](0));
+    if (match != null) return core.String._check(match[dartx._get](0));
     return "";
   }
   static getTimeZoneOffsetInMinutes(receiver) {
@@ -11511,7 +11724,7 @@
   while (index < dart.notNull(length)) {
     let key = _js_helper.getIndex(keyValuePairs, index++);
     let value = _js_helper.getIndex(keyValuePairs, index++);
-    result[dartx.set](key, value);
+    result[dartx._set](key, value);
   }
   return result;
 };
@@ -11555,7 +11768,7 @@
   constructors: () => ({new: dart.definiteFunctionType(_js_helper.JSName, [core.String])}),
   fields: () => ({name: core.String})
 });
-_js_helper.JavaScriptIndexingBehavior = class JavaScriptIndexingBehavior extends _interceptors.JSMutableIndexable {};
+_js_helper.JavaScriptIndexingBehavior = class JavaScriptIndexingBehavior extends core.Object {};
 _js_helper.TypeErrorImplementation = class TypeErrorImplementation extends core.Error {
   new(value, actualType, expectedType) {
     this.message = dart.str`Type '${actualType}' is not a subtype ` + dart.str`of type '${expectedType}'`;
@@ -11915,7 +12128,7 @@
       return new (LinkedHashMapKeyIterableOfK())(this);
     }
     get values() {
-      return MappedIterableOfK$V().new(this.keys, dart.fn(each => this.get(each), KToV()));
+      return MappedIterableOfK$V().new(this.keys, dart.fn(each => this._get(each), KToV()));
     }
     containsKey(key) {
       if (dart.test(_js_helper.JsLinkedHashMap._isStringKey(key))) {
@@ -11937,15 +12150,15 @@
       return dart.notNull(this.internalFindBucketIndex(bucket, key)) >= 0;
     }
     containsValue(value) {
-      return this.keys[dartx.any](dart.fn(each => dart.equals(this.get(each), value), KTobool()));
+      return this.keys[dartx.any](dart.fn(each => dart.equals(this._get(each), value), KTobool()));
     }
     addAll(other) {
       MapOfK$V()._check(other);
       other[dartx.forEach](dart.fn((key, value) => {
-        this.set(key, value);
+        this._set(key, value);
       }, KAndVTovoid$()));
     }
-    get(key) {
+    _get(key) {
       if (dart.test(_js_helper.JsLinkedHashMap._isStringKey(key))) {
         let strings = this[_strings];
         if (strings == null) return null;
@@ -11969,7 +12182,7 @@
       let cell = bucket[index];
       return cell.hashMapCellValue;
     }
-    set(key, value) {
+    _set(key, value) {
       K._check(key);
       V._check(value);
       if (dart.test(_js_helper.JsLinkedHashMap._isStringKey(key))) {
@@ -12009,9 +12222,9 @@
     putIfAbsent(key, ifAbsent) {
       K._check(key);
       VoidToV()._check(ifAbsent);
-      if (dart.test(this.containsKey(key))) return this.get(key);
+      if (dart.test(this.containsKey(key))) return this._get(key);
       let value = ifAbsent();
-      this.set(key, value);
+      this._set(key, value);
       return value;
     }
     remove(key) {
@@ -12184,9 +12397,9 @@
       internalContainsKey: dart.definiteFunctionType(core.bool, [core.Object]),
       containsValue: dart.definiteFunctionType(core.bool, [core.Object]),
       addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
-      get: dart.definiteFunctionType(V, [core.Object]),
+      _get: dart.definiteFunctionType(V, [core.Object]),
       internalGet: dart.definiteFunctionType(V, [core.Object]),
-      set: dart.definiteFunctionType(dart.void, [K, V]),
+      _set: dart.definiteFunctionType(dart.void, [K, V]),
       internalSet: dart.definiteFunctionType(dart.void, [K, V]),
       putIfAbsent: dart.definiteFunctionType(V, [K, VoidToV()]),
       remove: dart.definiteFunctionType(V, [core.Object]),
@@ -12218,8 +12431,8 @@
     'containsKey',
     'containsValue',
     'addAll',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'putIfAbsent',
     'remove',
     'clear',
@@ -12506,7 +12719,7 @@
     regexp.lastIndex = start;
     let match = regexp.exec(string);
     if (match == null) return null;
-    if (match[dartx.get](dart.notNull(match[dartx.length]) - 1) != null) return null;
+    if (match[dartx._get](dart.notNull(match[dartx.length]) - 1) != null) return null;
     match[dartx.length] = dart.notNull(match[dartx.length]) - 1;
     return new _js_helper._MatchImplementation(this, ListOfString()._check(match));
   }
@@ -12569,12 +12782,12 @@
     return this[_match].index;
   }
   get end() {
-    return dart.notNull(this.start) + dart.notNull(this[_match][dartx.get](0)[dartx.length]);
+    return dart.notNull(this.start) + dart.notNull(this[_match][dartx._get](0)[dartx.length]);
   }
   group(index) {
-    return this[_match][dartx.get](index);
+    return this[_match][dartx._get](index);
   }
-  get(index) {
+  _get(index) {
     return this.group(index);
   }
   get groupCount() {
@@ -12603,7 +12816,7 @@
   }),
   methods: () => ({
     group: dart.definiteFunctionType(core.String, [core.int]),
-    get: dart.definiteFunctionType(core.String, [core.int]),
+    _get: dart.definiteFunctionType(core.String, [core.int]),
     groups: dart.definiteFunctionType(core.List$(core.String), [ListOfint()])
   })
 });
@@ -12705,7 +12918,7 @@
   get end() {
     return dart.notNull(this.start) + dart.notNull(this.pattern[dartx.length]);
   }
-  get(g) {
+  _get(g) {
     return this.group(g);
   }
   get groupCount() {
@@ -12738,7 +12951,7 @@
     groupCount: dart.definiteFunctionType(core.int, [])
   }),
   methods: () => ({
-    get: dart.definiteFunctionType(core.String, [core.int]),
+    _get: dart.definiteFunctionType(core.String, [core.int]),
     group: dart.definiteFunctionType(core.String, [core.int]),
     groups: dart.definiteFunctionType(core.List$(core.String), [ListOfint()])
   })
@@ -12861,7 +13074,7 @@
         let length = receiver[dartx.length];
         result.write(replacement);
         for (let i = 0; i < dart.notNull(length); i++) {
-          result.write(receiver[dartx.get](i));
+          result.write(receiver[dartx._get](i));
           result.write(replacement);
         }
         return result.toString();
@@ -12881,7 +13094,7 @@
 };
 dart.lazyFn(_js_helper.stringReplaceAllUnchecked, () => StringAndPatternAndStringToString());
 _js_helper._matchString = function(match) {
-  return match.get(0);
+  return match._get(0);
 };
 dart.lazyFn(_js_helper._matchString, () => MatchToString());
 _js_helper._stringIdentity = function(string) {
@@ -12924,7 +13137,7 @@
         continue;
       }
     }
-    buffer.write(onNonMatch(receiver[dartx.get](i)));
+    buffer.write(onNonMatch(receiver[dartx._get](i)));
     i++;
   }
   buffer.write(onMatch(new _js_helper.StringMatch(i, receiver, "")));
@@ -13076,65 +13289,109 @@
   return _js_mirrors._dart.definiteFunctionType(type, []);
 };
 dart.fn(_js_mirrors._defaultConstructorType, dynamicTodynamic());
+_js_mirrors._getMixins = function(type) {
+  return _js_mirrors._dart.getMixins(type, []);
+};
+dart.fn(_js_mirrors._getMixins, dynamicTodynamic());
 _js_mirrors._Lazy$ = dart.generic(T => {
   const _Lazy = dart.typedef('_Lazy', () => dart.functionType(T, []));
   return _Lazy;
 });
 _js_mirrors._Lazy = _Lazy();
+_js_mirrors._getESSymbol = function(symbol) {
+  return _internal.Symbol.getNativeSymbol(_internal.Symbol.as(symbol));
+};
+dart.lazyFn(_js_mirrors._getESSymbol, () => SymbolTodynamic());
+_js_mirrors._getMember = function(symbol) {
+  let privateSymbol = _js_mirrors._getESSymbol(symbol);
+  if (privateSymbol != null) {
+    return privateSymbol;
+  }
+  return _js_mirrors.getName(symbol);
+};
+dart.lazyFn(_js_mirrors._getMember, () => SymbolTodynamic());
+_js_mirrors._getNameForESSymbol = function(member) {
+  dart.assert(typeof member == "symbol");
+  let str = dart.toString(member);
+  dart.assert(dart.test(str[dartx.startsWith]('Symbol(')) && dart.test(str[dartx.endsWith](')')));
+  return str[dartx.substring](7, dart.notNull(str[dartx.length]) - 1);
+};
+dart.lazyFn(_js_mirrors._getNameForESSymbol, () => dynamicToString());
+_js_mirrors._getSymbolForESSymbol = function(member) {
+  let name = _js_mirrors._getNameForESSymbol(member);
+  return new _internal.Symbol.es6(name, member);
+};
+dart.lazyFn(_js_mirrors._getSymbolForESSymbol, () => dynamicToSymbol());
+_js_mirrors._getSymbolForMember = function(member) {
+  if (typeof member == 'string') {
+    return core.Symbol.new(member);
+  } else {
+    let name = _js_mirrors._getNameForESSymbol(member);
+    return new _internal.Symbol.es6(name, member);
+  }
+};
+dart.lazyFn(_js_mirrors._getSymbolForMember, () => dynamicToSymbol());
+_js_mirrors._toDartMap = function(data) {
+  if (data == null) return dart.map({}, core.Symbol, dart.dynamic);
+  let map = MapOfSymbol$dynamic().new();
+  let publicMembers = Object.getOwnPropertyNames(data);
+  for (let member of core.Iterable._check(publicMembers)) {
+    let symbol = core.Symbol.new(core.String._check(member));
+    map[dartx._set](symbol, data[member]);
+  }
+  let privateMembers = Object.getOwnPropertySymbols(data);
+  for (let member of core.Iterable._check(privateMembers)) {
+    let symbol = _js_mirrors._getSymbolForESSymbol(member);
+    map[dartx._set](symbol, data[member]);
+  }
+  return map;
+};
+dart.lazyFn(_js_mirrors._toDartMap, () => dynamicToMapOfSymbol$dynamic());
 _js_mirrors._getConstructors = function(obj) {
   let sig = _js_mirrors._dart.getConstructorSig(obj);
-  if (sig == null) return dart.map();
-  return _js_mirrors._dart.map(sig);
+  return _js_mirrors._toDartMap(sig);
 };
-dart.lazyFn(_js_mirrors._getConstructors, () => dynamicToMap());
+dart.lazyFn(_js_mirrors._getConstructors, () => dynamicToMapOfSymbol$dynamic());
 _js_mirrors._getFields = function(obj) {
   let sig = _js_mirrors._dart.getFieldSig(obj);
-  if (sig == null) return dart.map();
-  return _js_mirrors._dart.map(sig);
+  return _js_mirrors._toDartMap(sig);
 };
-dart.lazyFn(_js_mirrors._getFields, () => dynamicToMap());
+dart.lazyFn(_js_mirrors._getFields, () => dynamicToMapOfSymbol$dynamic());
 _js_mirrors._getMethods = function(obj) {
   let sig = _js_mirrors._dart.getMethodSig(obj);
-  if (sig == null) return dart.map();
-  return _js_mirrors._dart.map(sig);
+  return _js_mirrors._toDartMap(sig);
 };
-dart.lazyFn(_js_mirrors._getMethods, () => dynamicToMap());
+dart.lazyFn(_js_mirrors._getMethods, () => dynamicToMapOfSymbol$dynamic());
 _js_mirrors._getGetters = function(obj) {
   let sig = _js_mirrors._dart.getGetterSig(obj);
-  if (sig == null) return dart.map();
-  return _js_mirrors._dart.map(sig);
+  return _js_mirrors._toDartMap(sig);
 };
-dart.lazyFn(_js_mirrors._getGetters, () => dynamicToMap());
+dart.lazyFn(_js_mirrors._getGetters, () => dynamicToMapOfSymbol$dynamic());
 _js_mirrors._getSetters = function(obj) {
   let sig = _js_mirrors._dart.getSetterSig(obj);
-  if (sig == null) return dart.map();
-  return _js_mirrors._dart.map(sig);
+  return _js_mirrors._toDartMap(sig);
 };
-dart.lazyFn(_js_mirrors._getSetters, () => dynamicToMap());
+dart.lazyFn(_js_mirrors._getSetters, () => dynamicToMapOfSymbol$dynamic());
 _js_mirrors._getStaticFields = function(obj) {
   let sig = _js_mirrors._dart.getStaticFieldSig(obj);
-  if (sig == null) return dart.map();
-  return _js_mirrors._dart.map(sig);
+  return _js_mirrors._toDartMap(sig);
 };
-dart.lazyFn(_js_mirrors._getStaticFields, () => dynamicToMap());
+dart.lazyFn(_js_mirrors._getStaticFields, () => dynamicToMapOfSymbol$dynamic());
 _js_mirrors._getStatics = function(obj) {
   let sig = _js_mirrors._dart.getStaticSig(obj);
-  if (sig == null) return dart.map();
-  return _js_mirrors._dart.map(sig);
+  return _js_mirrors._toDartMap(sig);
 };
-dart.lazyFn(_js_mirrors._getStatics, () => dynamicToMap());
+dart.lazyFn(_js_mirrors._getStatics, () => dynamicToMapOfSymbol$dynamic());
 _js_mirrors._getStaticGetters = function(obj) {
   let sig = _js_mirrors._dart.getStaticGetterSig(obj);
-  if (sig == null) return dart.map();
-  return _js_mirrors._dart.map(sig);
+  return _js_mirrors._toDartMap(sig);
 };
-dart.lazyFn(_js_mirrors._getStaticGetters, () => dynamicToMap());
+dart.lazyFn(_js_mirrors._getStaticGetters, () => dynamicToMapOfSymbol$dynamic());
 _js_mirrors._getStaticSetters = function(obj) {
   let sig = _js_mirrors._dart.getStaticSetterSig(obj);
-  if (sig == null) return dart.map();
-  return _js_mirrors._dart.map(sig);
+  return _js_mirrors._toDartMap(sig);
 };
-dart.lazyFn(_js_mirrors._getStaticSetters, () => dynamicToMap());
+dart.lazyFn(_js_mirrors._getStaticSetters, () => dynamicToMapOfSymbol$dynamic());
 _js_mirrors._unwrap = function(obj) {
   return _js_mirrors._dart.unwrapType(obj);
 };
@@ -13143,10 +13400,22 @@
   return _js_mirrors._dart.wrapType(obj);
 };
 dart.fn(_js_mirrors._wrap, dynamicTodynamic());
+_js_mirrors._runtimeType = function(obj) {
+  return _js_mirrors._wrap(_js_mirrors._dart.getReifiedType(obj));
+};
+dart.fn(_js_mirrors._runtimeType, dynamicTodynamic());
 _js_mirrors._unimplemented = function(t, i) {
-  dart.throw(new core.UnimplementedError(dart.str`${t}.${i.memberName} unimplemented`));
+  dart.throw(new core.UnimplementedError(dart.str`${t}.${_js_mirrors.getName(i.memberName)} unimplemented`));
 };
 dart.fn(_js_mirrors._unimplemented, TypeAndInvocationTodynamic());
+_js_mirrors._toJsMap = function(map) {
+  let obj = {};
+  map[dartx.forEach](dart.fn((key, value) => {
+    obj[_js_mirrors.getName(key)] = value;
+  }, SymbolAnddynamicTovoid()));
+  return obj;
+};
+dart.lazyFn(_js_mirrors._toJsMap, () => MapOfSymbol$dynamicTodynamic());
 _js_mirrors.JsMirror = class JsMirror extends core.Object {
   noSuchMethod(i) {
     _js_mirrors._unimplemented(this.runtimeType, i);
@@ -13240,14 +13509,14 @@
   }
 };
 _js_mirrors.JsObjectMirror[dart.implements] = () => [mirrors.ObjectMirror];
-const _toJsMap = Symbol('_toJsMap');
+const _getAccessor = Symbol('_getAccessor');
 _js_mirrors.JsInstanceMirror = class JsInstanceMirror extends _js_mirrors.JsObjectMirror {
   get hasReflectee() {
     return true;
   }
   get type() {
     if (this.reflectee == null) return mirrors.reflectClass(dart.wrapType(core.Null));
-    return mirrors.ClassMirror._check(_js_mirrors.reflectType(core.Type._check(dart.runtimeType(this.reflectee))));
+    return mirrors.ClassMirror._check(_js_mirrors.reflectType(core.Type._check(_js_mirrors._runtimeType(this.reflectee))));
   }
   _(reflectee) {
     this.reflectee = reflectee;
@@ -13258,32 +13527,33 @@
   get hashCode() {
     return (dart.notNull(core.identityHashCode(this.reflectee)) ^ 909522486) >>> 0;
   }
+  [_getAccessor](reflectee, symbol, args, namedArgs) {
+    if (args === void 0) args = null;
+    if (namedArgs === void 0) namedArgs = null;
+    return _js_mirrors._getMember(symbol);
+  }
   getField(symbol) {
-    let name = _js_mirrors.getName(symbol);
-    let field = _js_mirrors._dload(this.reflectee, name);
+    let name = this[_getAccessor](this.reflectee, symbol);
+    let field = _js_mirrors._dload(this.reflectee, core.String._check(name));
     return _js_mirrors.reflect(field);
   }
   setField(symbol, value) {
-    let name = _js_mirrors.getName(symbol);
-    _js_mirrors._dput(this.reflectee, name, value);
+    let name = this[_getAccessor](this.reflectee, symbol);
+    _js_mirrors._dput(this.reflectee, core.String._check(name), value);
     return _js_mirrors.reflect(value);
   }
   invoke(symbol, args, namedArgs) {
     if (namedArgs === void 0) namedArgs = null;
-    let name = _js_mirrors.getName(symbol);
+    let name = this[_getAccessor](this.reflectee, symbol, args, namedArgs);
     if (namedArgs != null) {
       args = core.List.from(args);
-      args[dartx.add](this[_toJsMap](namedArgs));
+      args[dartx.add](_js_mirrors._toJsMap(namedArgs));
     }
-    let result = _js_mirrors._dsend(this.reflectee, name, args);
+    let result = _js_mirrors._dsend(this.reflectee, core.String._check(name), args);
     return _js_mirrors.reflect(result);
   }
-  [_toJsMap](map) {
-    let obj = {};
-    map[dartx.forEach](dart.fn((key, value) => {
-      obj[_js_mirrors.getName(key)] = value;
-    }, SymbolAnddynamicTovoid()));
-    return obj;
+  toString() {
+    return dart.str`InstanceMirror on '${this.reflectee}'`;
   }
   delegate(...args) {
     return this.noSuchMethod(new dart.InvocationImpl('delegate', args, {isMethod: true}));
@@ -13300,10 +13570,10 @@
   }),
   methods: () => ({
     '==': dart.definiteFunctionType(core.bool, [core.Object]),
+    [_getAccessor]: dart.definiteFunctionType(dart.dynamic, [dart.dynamic, core.Symbol], [core.List, MapOfSymbol$dynamic()]),
     getField: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol]),
     setField: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.Object]),
-    invoke: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.List], [MapOfSymbol$dynamic()]),
-    [_toJsMap]: dart.definiteFunctionType(dart.dynamic, [MapOfSymbol$dynamic()])
+    invoke: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.List], [MapOfSymbol$dynamic()])
   })
 });
 _js_mirrors.JsClosureMirror = class JsClosureMirror extends _js_mirrors.JsInstanceMirror {
@@ -13314,7 +13584,7 @@
     if (namedArgs === void 0) namedArgs = null;
     if (namedArgs != null) {
       args = core.List.from(args);
-      args[dartx.add](this[_toJsMap](namedArgs));
+      args[dartx.add](_js_mirrors._toJsMap(namedArgs));
     }
     let result = _js_mirrors._dcall(this.reflectee, args);
     return _js_mirrors.reflect(result);
@@ -13337,12 +13607,14 @@
 let const;
 const _declarations = Symbol('_declarations');
 const _raw = Symbol('_raw');
+const _mixin = Symbol('_mixin');
 const _typeArguments = Symbol('_typeArguments');
 let const;
 _js_mirrors.JsClassMirror = class JsClassMirror extends _js_mirrors.JsMirror {
   get metadata() {
     if (this[_metadata] == null) {
-      let fn = _js_mirrors._unwrap(this[_cls])[dart.metadata];
+      let unwrapped = _js_mirrors._unwrap(this[_cls]);
+      let fn = Object.hasOwnProperty.call(unwrapped, dart.metadata) ? unwrapped[dart.metadata] : null;
       this[_metadata] = fn == null ? const || (const = dart.constList([], mirrors.InstanceMirror)) : ListOfInstanceMirror().unmodifiable(core.Iterable._check(dart.dsend(dart.dcall(fn), 'map', dart.fn(i => _js_mirrors.reflect(i), dynamicToInstanceMirror()))));
     }
     return this[_metadata];
@@ -13352,67 +13624,66 @@
       this[_declarations] = MapOfSymbol$DeclarationMirror().new();
       let unwrapped = _js_mirrors._unwrap(this[_cls]);
       let constructors = _js_mirrors._getConstructors(unwrapped);
-      constructors[dartx.forEach](dart.fn((name, ft) => {
-        let symbol = core.Symbol.new(name);
-        this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._constructor(this, name, ft));
-      }, StringAnddynamicTovoid()));
+      constructors[dartx.forEach](dart.fn((symbol, ft) => {
+        let name = _js_mirrors.getName(symbol);
+        this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._constructor(this, symbol, ft));
+      }, SymbolAnddynamicTovoid()));
       if (dart.test(constructors[dartx.isEmpty])) {
         let name = 'new';
         let ft = _js_mirrors._defaultConstructorType(_js_mirrors._unwrap(this[_cls]));
         let symbol = core.Symbol.new(name);
-        this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._constructor(this, name, ft));
+        this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._constructor(this, symbol, ft));
       }
       let fields = _js_mirrors._getFields(unwrapped);
-      fields[dartx.forEach](dart.fn((name, t) => {
-        let symbol = core.Symbol.new(name);
+      fields[dartx.forEach](dart.fn((symbol, t) => {
         let metadata = [];
         if (core.List.is(t)) {
           metadata = core.List._check(dart.dsend(dart.dsend(t, 'skip', 1), 'toList'));
           t = dart.dindex(t, 0);
         }
-        this[_declarations][dartx.set](symbol, new _js_mirrors.JsVariableMirror._(name, core.Type._check(_js_mirrors._wrap(t)), metadata));
-      }, StringAnddynamicTovoid()));
+        this[_declarations][dartx._set](symbol, new _js_mirrors.JsVariableMirror._(symbol, core.Type._check(_js_mirrors._wrap(t)), metadata));
+      }, SymbolAnddynamicTovoid()));
       let methods = _js_mirrors._getMethods(unwrapped);
-      methods[dartx.forEach](dart.fn((name, ft) => {
-        let symbol = core.Symbol.new(name);
-        this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, name, ft));
-      }, StringAnddynamicTovoid()));
+      methods[dartx.forEach](dart.fn((symbol, ft) => {
+        let name = _js_mirrors.getName(symbol);
+        this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, symbol, ft));
+      }, SymbolAnddynamicTovoid()));
       let getters = _js_mirrors._getGetters(unwrapped);
-      getters[dartx.forEach](dart.fn((name, ft) => {
-        let symbol = core.Symbol.new(name);
-        this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, name, ft));
-      }, StringAnddynamicTovoid()));
+      getters[dartx.forEach](dart.fn((symbol, ft) => {
+        let name = _js_mirrors.getName(symbol);
+        this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, symbol, ft));
+      }, SymbolAnddynamicTovoid()));
       let setters = _js_mirrors._getSetters(unwrapped);
-      setters[dartx.forEach](dart.fn((name, ft) => {
-        name = dart.notNull(name) + '=';
-        let symbol = core.Symbol.new(name);
-        this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, name, ft));
-      }, StringAnddynamicTovoid()));
+      setters[dartx.forEach](dart.fn((symbol, ft) => {
+        let name = dart.notNull(_js_mirrors.getName(symbol)) + '=';
+        symbol = new _internal.Symbol.es6(name, _js_mirrors._getESSymbol(symbol));
+        this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, symbol, ft));
+      }, SymbolAnddynamicTovoid()));
       let staticFields = _js_mirrors._getStaticFields(unwrapped);
-      staticFields[dartx.forEach](dart.fn((name, t) => {
-        let symbol = core.Symbol.new(name);
+      staticFields[dartx.forEach](dart.fn((symbol, t) => {
+        let name = _js_mirrors.getName(symbol);
         let metadata = [];
         if (core.List.is(t)) {
           metadata = core.List._check(dart.dsend(dart.dsend(t, 'skip', 1), 'toList'));
           t = dart.dindex(t, 0);
         }
-        this[_declarations][dartx.set](symbol, new _js_mirrors.JsVariableMirror._(name, core.Type._check(_js_mirrors._wrap(t)), metadata));
-      }, StringAnddynamicTovoid()));
+        this[_declarations][dartx._set](symbol, new _js_mirrors.JsVariableMirror._(symbol, core.Type._check(_js_mirrors._wrap(t)), metadata));
+      }, SymbolAnddynamicTovoid()));
       let statics = _js_mirrors._getStatics(unwrapped);
-      statics[dartx.forEach](dart.fn((name, ft) => {
-        let symbol = core.Symbol.new(name);
-        this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, name, ft));
-      }, StringAnddynamicTovoid()));
+      statics[dartx.forEach](dart.fn((symbol, ft) => {
+        let name = _js_mirrors.getName(symbol);
+        this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, symbol, ft));
+      }, SymbolAnddynamicTovoid()));
       let staticGetters = _js_mirrors._getStaticGetters(unwrapped);
-      staticGetters[dartx.forEach](dart.fn((name, ft) => {
-        let symbol = core.Symbol.new(name);
-        this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, name, ft));
-      }, StringAnddynamicTovoid()));
+      staticGetters[dartx.forEach](dart.fn((symbol, ft) => {
+        let name = _js_mirrors.getName(symbol);
+        this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, symbol, ft));
+      }, SymbolAnddynamicTovoid()));
       let staticSetters = _js_mirrors._getStaticSetters(unwrapped);
-      staticSetters[dartx.forEach](dart.fn((name, ft) => {
-        let symbol = core.Symbol.new(name);
-        this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, name, ft));
-      }, StringAnddynamicTovoid()));
+      staticSetters[dartx.forEach](dart.fn((symbol, ft) => {
+        let name = _js_mirrors.getName(symbol);
+        this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, symbol, ft));
+      }, SymbolAnddynamicTovoid()));
       this[_declarations] = MapOfSymbol$DeclarationMirror().unmodifiable(this[_declarations]);
     }
     return this[_declarations];
@@ -13421,7 +13692,7 @@
     this[_cls] = cls;
     this[_raw] = _js_mirrors._getGenericClass(_js_mirrors._unwrap(cls));
     this.simpleName = core.Symbol.new(_js_mirrors._unwrap(cls).name);
-    this.mixin = null;
+    this[_mixin] = null;
     this[_typeArguments] = null;
     this[_metadata] = null;
     this[_declarations] = null;
@@ -13439,6 +13710,25 @@
     let instance = name == 'new' || name == '' ? new (_js_mirrors._unwrap(this[_cls]))(...args) : new (_js_mirrors._unwrap(this[_cls]))[name](...args);
     return _js_mirrors.reflect(instance);
   }
+  getField(symbol) {
+    let name = _js_mirrors.getName(symbol);
+    return _js_mirrors.reflect(_js_mirrors._unwrap(this[_cls])[name]);
+  }
+  setField(symbol, value) {
+    let name = _js_mirrors.getName(symbol);
+    _js_mirrors._unwrap(this[_cls])[name] = value;
+    return _js_mirrors.reflect(value);
+  }
+  invoke(symbol, args, namedArgs) {
+    if (namedArgs === void 0) namedArgs = null;
+    let name = _js_mirrors.getName(symbol);
+    if (namedArgs != null) {
+      args = core.List.from(args);
+      args[dartx.add](_js_mirrors._toJsMap(namedArgs));
+    }
+    let result = _js_mirrors._unwrap(this[_cls])[name](...args);
+    return _js_mirrors.reflect(result);
+  }
   get superinterfaces() {
     let interfaceThunk = _js_mirrors._unwrap(this[_cls])[dart.implements];
     if (interfaceThunk == null) {
@@ -13473,6 +13763,24 @@
       return mirrors.ClassMirror._check(_js_mirrors.reflectType(core.Type._check(_js_mirrors._wrap(_js_mirrors._unwrap(this[_cls]).__proto__))));
     }
   }
+  get mixin() {
+    if (this[_mixin] != null) {
+      return this[_mixin];
+    }
+    let mixins = _js_mirrors._getMixins(_js_mirrors._unwrap(this[_cls]));
+    if (mixins == null || dart.test(dart.dload(mixins, 'isEmpty'))) {
+      this[_mixin] = this;
+      return this[_mixin];
+    }
+    if (dart.test(dart.dsend(dart.dload(mixins, 'length'), '>', 1))) {
+      dart.throw(new core.UnsupportedError("ClassMirror.mixin not yet supported for " + dart.str`classes (${this[_cls]}) with multiple mixins`));
+    }
+    this[_mixin] = mirrors.ClassMirror._check(_js_mirrors.reflectType(core.Type._check(_js_mirrors._wrap(dart.dindex(mixins, 0)))));
+    return this[_mixin];
+  }
+  toString() {
+    return dart.str`ClassMirror on '${this[_cls]}'`;
+  }
   get qualifiedName() {
     return core.Symbol._check(this.noSuchMethod(new dart.InvocationImpl('qualifiedName', [], {isGetter: true})));
   }
@@ -13497,15 +13805,6 @@
   get typeVariables() {
     return ListOfTypeVariableMirror()._check(this.noSuchMethod(new dart.InvocationImpl('typeVariables', [], {isGetter: true})));
   }
-  invoke(...args) {
-    return mirrors.InstanceMirror._check(this.noSuchMethod(new dart.InvocationImpl('invoke', args, {isMethod: true})));
-  }
-  getField(...args) {
-    return mirrors.InstanceMirror._check(this.noSuchMethod(new dart.InvocationImpl('getField', args, {isMethod: true})));
-  }
-  setField(...args) {
-    return mirrors.InstanceMirror._check(this.noSuchMethod(new dart.InvocationImpl('setField', args, {isMethod: true})));
-  }
   isSubclassOf(...args) {
     return core.bool._check(this.noSuchMethod(new dart.InvocationImpl('isSubclassOf', args, {isMethod: true})));
   }
@@ -13527,7 +13826,7 @@
     [_cls]: core.Type,
     simpleName: core.Symbol,
     [_raw]: dart.dynamic,
-    mixin: mirrors.ClassMirror,
+    [_mixin]: mirrors.ClassMirror,
     [_typeArguments]: ListOfTypeMirror(),
     [_metadata]: ListOfInstanceMirror(),
     [_declarations]: MapOfSymbol$DeclarationMirror()
@@ -13541,22 +13840,33 @@
     isOriginalDeclaration: dart.definiteFunctionType(core.bool, []),
     typeArguments: dart.definiteFunctionType(core.List$(mirrors.TypeMirror), []),
     originalDeclaration: dart.definiteFunctionType(mirrors.TypeMirror, []),
-    superclass: dart.definiteFunctionType(mirrors.ClassMirror, [])
+    superclass: dart.definiteFunctionType(mirrors.ClassMirror, []),
+    mixin: dart.definiteFunctionType(mirrors.ClassMirror, [])
   }),
-  methods: () => ({newInstance: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.List], [MapOfSymbol$dynamic()])})
+  methods: () => ({
+    newInstance: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.List], [MapOfSymbol$dynamic()]),
+    getField: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol]),
+    setField: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.Object]),
+    invoke: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.List], [MapOfSymbol$dynamic()])
+  })
 });
+const _symbol = Symbol('_symbol');
 const _name = Symbol('_name');
 _js_mirrors.JsVariableMirror = class JsVariableMirror extends _js_mirrors.JsMirror {
   get simpleName() {
-    return core.Symbol.new(this[_name]);
+    return this[_symbol];
   }
-  _(name, t, annotations) {
-    this[_name] = name;
+  _(symbol, t, annotations) {
+    this[_symbol] = symbol;
+    this[_name] = _js_mirrors.getName(symbol);
     this.type = _js_mirrors.reflectType(t);
     this.metadata = ListOfInstanceMirror().unmodifiable(annotations[dartx.map](mirrors.InstanceMirror)(dart.fn(a => _js_mirrors.reflect(a), dynamicToInstanceMirror())));
     this.isStatic = false;
     this.isFinal = false;
   }
+  toString() {
+    return dart.str`VariableMirror on '${this[_name]}'`;
+  }
   get qualifiedName() {
     return core.Symbol._check(this.noSuchMethod(new dart.InvocationImpl('qualifiedName', [], {isGetter: true})));
   }
@@ -13579,8 +13889,9 @@
 dart.defineNamedConstructor(_js_mirrors.JsVariableMirror, '_');
 _js_mirrors.JsVariableMirror[dart.implements] = () => [mirrors.VariableMirror];
 dart.setSignature(_js_mirrors.JsVariableMirror, {
-  constructors: () => ({_: dart.definiteFunctionType(_js_mirrors.JsVariableMirror, [core.String, core.Type, core.List])}),
+  constructors: () => ({_: dart.definiteFunctionType(_js_mirrors.JsVariableMirror, [core.Symbol, core.Type, core.List])}),
   fields: () => ({
+    [_symbol]: core.Symbol,
     [_name]: core.String,
     type: mirrors.TypeMirror,
     metadata: ListOfInstanceMirror(),
@@ -13590,8 +13901,11 @@
   getters: () => ({simpleName: dart.definiteFunctionType(core.Symbol, [])})
 });
 _js_mirrors.JsParameterMirror = class JsParameterMirror extends _js_mirrors.JsVariableMirror {
-  _(name, t, annotations) {
-    super._(name, t, annotations);
+  _(member, t, annotations) {
+    super._(member, t, annotations);
+  }
+  toString() {
+    return dart.str`ParameterMirror on '${this[_name]}'`;
   }
   get qualifiedName() {
     return core.Symbol._check(this.noSuchMethod(new dart.InvocationImpl('qualifiedName', [], {isGetter: true})));
@@ -13627,7 +13941,7 @@
 dart.defineNamedConstructor(_js_mirrors.JsParameterMirror, '_');
 _js_mirrors.JsParameterMirror[dart.implements] = () => [mirrors.ParameterMirror];
 dart.setSignature(_js_mirrors.JsParameterMirror, {
-  constructors: () => ({_: dart.definiteFunctionType(_js_mirrors.JsParameterMirror, [core.String, core.Type, core.List])})
+  constructors: () => ({_: dart.definiteFunctionType(_js_mirrors.JsParameterMirror, [core.Symbol, core.Type, core.List])})
 });
 const _params = Symbol('_params');
 const _createParameterMirrorList = Symbol('_createParameterMirrorList');
@@ -13642,10 +13956,11 @@
     return this[_name][dartx.startsWith]('_');
   }
   get simpleName() {
-    return core.Symbol.new(this[_name]);
+    return this[_symbol];
   }
-  _constructor(cls, name, ftype) {
-    this[_name] = name;
+  _constructor(cls, symbol, ftype) {
+    this[_symbol] = symbol;
+    this[_name] = _js_mirrors.getName(symbol);
     this.isConstructor = true;
     this.isStatic = false;
     this[_params] = null;
@@ -13653,8 +13968,9 @@
     this.isFinal = false;
     this[_createParameterMirrorList](ftype);
   }
-  _instanceMethod(cls, name, ftype) {
-    this[_name] = name;
+  _instanceMethod(cls, symbol, ftype) {
+    this[_symbol] = symbol;
+    this[_name] = _js_mirrors.getName(symbol);
     this.isConstructor = false;
     this.isStatic = false;
     this[_params] = null;
@@ -13662,8 +13978,9 @@
     this.isFinal = false;
     this[_createParameterMirrorList](ftype);
   }
-  _staticMethod(cls, name, ftype) {
-    this[_name] = name;
+  _staticMethod(cls, symbol, ftype) {
+    this[_symbol] = symbol;
+    this[_name] = _js_mirrors.getName(symbol);
     this.isConstructor = false;
     this.isStatic = true;
     this[_params] = null;
@@ -13672,7 +13989,7 @@
     this[_createParameterMirrorList](ftype);
   }
   get constructorName() {
-    return dart.test(this.isConstructor) ? core.Symbol.new(this[_name]) : null;
+    return dart.test(this.isConstructor) ? this[_symbol] : null;
   }
   get parameters() {
     return this[_params];
@@ -13686,29 +14003,35 @@
       this[_metadata] = const || (const = dart.constList([], mirrors.InstanceMirror));
       return;
     }
-    if (core.List.is(ftype)) {
+    if (!core.Function.is(ftype) && core.List.is(ftype)) {
       this[_metadata] = ListOfInstanceMirror().unmodifiable(core.Iterable._check(dart.dsend(dart.dsend(ftype, 'skip', 1), 'map', dart.fn(a => _js_mirrors.reflect(a), dynamicToInstanceMirror()))));
       ftype = dart.dindex(ftype, 0);
     } else {
       this[_metadata] = const || (const = dart.constList([], mirrors.InstanceMirror));
     }
+    if (typeof ftype == "function") {
+      ftype = ftype.apply(null, JSArrayOfType().of([dart.dynamic, dart.dynamic, dart.dynamic]));
+    }
     let args = core.List._check(dart.dload(ftype, 'args'));
     let opts = core.List._check(dart.dload(ftype, 'optionals'));
     let params = ListOfParameterMirror().new(dart.notNull(args[dartx.length]) + dart.notNull(opts[dartx.length]));
     for (let i = 0; i < dart.notNull(args[dartx.length]); ++i) {
-      let type = args[dartx.get](i);
+      let type = args[dartx._get](i);
       let metadata = dart.dindex(dart.dload(ftype, 'metadata'), i);
-      let param = new _js_mirrors.JsParameterMirror._('', core.Type._check(_js_mirrors._wrap(type)), core.List._check(metadata));
-      params[dartx.set](i, param);
+      let param = new _js_mirrors.JsParameterMirror._(core.Symbol.new(''), core.Type._check(_js_mirrors._wrap(type)), core.List._check(metadata));
+      params[dartx._set](i, param);
     }
     for (let i = 0; i < dart.notNull(opts[dartx.length]); ++i) {
-      let type = opts[dartx.get](i);
+      let type = opts[dartx._get](i);
       let metadata = dart.dindex(dart.dload(ftype, 'metadata'), dart.notNull(args[dartx.length]) + i);
-      let param = new _js_mirrors.JsParameterMirror._('', core.Type._check(_js_mirrors._wrap(type)), core.List._check(metadata));
-      params[dartx.set](i + dart.notNull(args[dartx.length]), param);
+      let param = new _js_mirrors.JsParameterMirror._(core.Symbol.new(''), core.Type._check(_js_mirrors._wrap(type)), core.List._check(metadata));
+      params[dartx._set](i + dart.notNull(args[dartx.length]), param);
     }
     this[_params] = ListOfParameterMirror().unmodifiable(params);
   }
+  toString() {
+    return dart.str`MethodMirror on '${this[_name]}'`;
+  }
   get qualifiedName() {
     return core.Symbol._check(this.noSuchMethod(new dart.InvocationImpl('qualifiedName', [], {isGetter: true})));
   }
@@ -13761,11 +14084,12 @@
 _js_mirrors.JsMethodMirror[dart.implements] = () => [mirrors.MethodMirror];
 dart.setSignature(_js_mirrors.JsMethodMirror, {
   constructors: () => ({
-    _constructor: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.String, dart.dynamic]),
-    _instanceMethod: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.String, dart.dynamic]),
-    _staticMethod: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.String, dart.dynamic])
+    _constructor: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.Symbol, dart.dynamic]),
+    _instanceMethod: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.Symbol, dart.dynamic]),
+    _staticMethod: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.Symbol, dart.dynamic])
   }),
   fields: () => ({
+    [_symbol]: core.Symbol,
     [_name]: core.String,
     [_params]: ListOfParameterMirror(),
     [_metadata]: ListOfInstanceMirror(),
@@ -14536,11 +14860,11 @@
   _slowFromList(list) {
     this[_storage] = _native_typed_data.NativeFloat32List.new(dart.notNull(list[dartx.length]) * 4);
     for (let i = 0; i < dart.notNull(list[dartx.length]); i++) {
-      let e = list[dartx.get](i);
-      this[_storage][dartx.set](i * 4 + 0, e.x);
-      this[_storage][dartx.set](i * 4 + 1, e.y);
-      this[_storage][dartx.set](i * 4 + 2, e.z);
-      this[_storage][dartx.set](i * 4 + 3, e.w);
+      let e = list[dartx._get](i);
+      this[_storage][dartx._set](i * 4 + 0, e.x);
+      this[_storage][dartx._set](i * 4 + 1, e.y);
+      this[_storage][dartx._set](i * 4 + 2, e.z);
+      this[_storage][dartx._set](i * 4 + 3, e.w);
     }
   }
   get runtimeType() {
@@ -14571,20 +14895,20 @@
   set length(value) {
     super.length = value;
   }
-  get(index) {
+  _get(index) {
     _native_typed_data._checkValidIndex(index, this, this.length);
-    let _x = this[_storage][dartx.get](dart.notNull(index) * 4 + 0);
-    let _y = this[_storage][dartx.get](dart.notNull(index) * 4 + 1);
-    let _z = this[_storage][dartx.get](dart.notNull(index) * 4 + 2);
-    let _w = this[_storage][dartx.get](dart.notNull(index) * 4 + 3);
+    let _x = this[_storage][dartx._get](dart.notNull(index) * 4 + 0);
+    let _y = this[_storage][dartx._get](dart.notNull(index) * 4 + 1);
+    let _z = this[_storage][dartx._get](dart.notNull(index) * 4 + 2);
+    let _w = this[_storage][dartx._get](dart.notNull(index) * 4 + 3);
     return new _native_typed_data.NativeFloat32x4._truncated(_x, _y, _z, _w);
   }
-  set(index, value) {
+  _set(index, value) {
     _native_typed_data._checkValidIndex(index, this, this.length);
-    this[_storage][dartx.set](dart.notNull(index) * 4 + 0, value.x);
-    this[_storage][dartx.set](dart.notNull(index) * 4 + 1, value.y);
-    this[_storage][dartx.set](dart.notNull(index) * 4 + 2, value.z);
-    this[_storage][dartx.set](dart.notNull(index) * 4 + 3, value.w);
+    this[_storage][dartx._set](dart.notNull(index) * 4 + 0, value.x);
+    this[_storage][dartx._set](dart.notNull(index) * 4 + 1, value.y);
+    this[_storage][dartx._set](dart.notNull(index) * 4 + 2, value.z);
+    this[_storage][dartx._set](dart.notNull(index) * 4 + 3, value.w);
     return value;
   }
   sublist(start, end) {
@@ -14612,14 +14936,14 @@
     length: dart.definiteFunctionType(core.int, [])
   }),
   methods: () => ({
-    get: dart.definiteFunctionType(typed_data.Float32x4, [core.int]),
-    set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Float32x4]),
+    _get: dart.definiteFunctionType(typed_data.Float32x4, [core.int]),
+    _set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Float32x4]),
     sublist: dart.definiteFunctionType(core.List$(typed_data.Float32x4), [core.int], [core.int])
   })
 });
 dart.defineExtensionMembers(_native_typed_data.NativeFloat32x4List, [
-  'get',
-  'set',
+  '_get',
+  '_set',
   'sublist',
   'buffer',
   'lengthInBytes',
@@ -15169,11 +15493,11 @@
   _slowFromList(list) {
     this[_storage] = _native_typed_data.NativeInt32List.new(dart.notNull(list[dartx.length]) * 4);
     for (let i = 0; i < dart.notNull(list[dartx.length]); i++) {
-      let e = list[dartx.get](i);
-      this[_storage][dartx.set](i * 4 + 0, e.x);
-      this[_storage][dartx.set](i * 4 + 1, e.y);
-      this[_storage][dartx.set](i * 4 + 2, e.z);
-      this[_storage][dartx.set](i * 4 + 3, e.w);
+      let e = list[dartx._get](i);
+      this[_storage][dartx._set](i * 4 + 0, e.x);
+      this[_storage][dartx._set](i * 4 + 1, e.y);
+      this[_storage][dartx._set](i * 4 + 2, e.z);
+      this[_storage][dartx._set](i * 4 + 3, e.w);
     }
   }
   get runtimeType() {
@@ -15204,20 +15528,20 @@
   set length(value) {
     super.length = value;
   }
-  get(index) {
+  _get(index) {
     _native_typed_data._checkValidIndex(index, this, this.length);
-    let _x = this[_storage][dartx.get](dart.notNull(index) * 4 + 0);
-    let _y = this[_storage][dartx.get](dart.notNull(index) * 4 + 1);
-    let _z = this[_storage][dartx.get](dart.notNull(index) * 4 + 2);
-    let _w = this[_storage][dartx.get](dart.notNull(index) * 4 + 3);
+    let _x = this[_storage][dartx._get](dart.notNull(index) * 4 + 0);
+    let _y = this[_storage][dartx._get](dart.notNull(index) * 4 + 1);
+    let _z = this[_storage][dartx._get](dart.notNull(index) * 4 + 2);
+    let _w = this[_storage][dartx._get](dart.notNull(index) * 4 + 3);
     return new _native_typed_data.NativeInt32x4._truncated(_x, _y, _z, _w);
   }
-  set(index, value) {
+  _set(index, value) {
     _native_typed_data._checkValidIndex(index, this, this.length);
-    this[_storage][dartx.set](dart.notNull(index) * 4 + 0, value.x);
-    this[_storage][dartx.set](dart.notNull(index) * 4 + 1, value.y);
-    this[_storage][dartx.set](dart.notNull(index) * 4 + 2, value.z);
-    this[_storage][dartx.set](dart.notNull(index) * 4 + 3, value.w);
+    this[_storage][dartx._set](dart.notNull(index) * 4 + 0, value.x);
+    this[_storage][dartx._set](dart.notNull(index) * 4 + 1, value.y);
+    this[_storage][dartx._set](dart.notNull(index) * 4 + 2, value.z);
+    this[_storage][dartx._set](dart.notNull(index) * 4 + 3, value.w);
     return value;
   }
   sublist(start, end) {
@@ -15245,14 +15569,14 @@
     length: dart.definiteFunctionType(core.int, [])
   }),
   methods: () => ({
-    get: dart.definiteFunctionType(typed_data.Int32x4, [core.int]),
-    set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Int32x4]),
+    _get: dart.definiteFunctionType(typed_data.Int32x4, [core.int]),
+    _set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Int32x4]),
     sublist: dart.definiteFunctionType(core.List$(typed_data.Int32x4), [core.int], [core.int])
   })
 });
 dart.defineExtensionMembers(_native_typed_data.NativeInt32x4List, [
-  'get',
-  'set',
+  '_get',
+  '_set',
   'sublist',
   'buffer',
   'lengthInBytes',
@@ -15292,9 +15616,9 @@
   _slowFromList(list) {
     this[_storage] = _native_typed_data.NativeFloat64List.new(dart.notNull(list[dartx.length]) * 2);
     for (let i = 0; i < dart.notNull(list[dartx.length]); i++) {
-      let e = list[dartx.get](i);
-      this[_storage][dartx.set](i * 2 + 0, e.x);
-      this[_storage][dartx.set](i * 2 + 1, e.y);
+      let e = list[dartx._get](i);
+      this[_storage][dartx._set](i * 2 + 0, e.x);
+      this[_storage][dartx._set](i * 2 + 1, e.y);
     }
   }
   static fromList(list) {
@@ -15325,16 +15649,16 @@
   set length(value) {
     super.length = value;
   }
-  get(index) {
+  _get(index) {
     _native_typed_data._checkValidIndex(index, this, this.length);
-    let _x = this[_storage][dartx.get](dart.notNull(index) * 2 + 0);
-    let _y = this[_storage][dartx.get](dart.notNull(index) * 2 + 1);
+    let _x = this[_storage][dartx._get](dart.notNull(index) * 2 + 0);
+    let _y = this[_storage][dartx._get](dart.notNull(index) * 2 + 1);
     return typed_data.Float64x2.new(_x, _y);
   }
-  set(index, value) {
+  _set(index, value) {
     _native_typed_data._checkValidIndex(index, this, this.length);
-    this[_storage][dartx.set](dart.notNull(index) * 2 + 0, value.x);
-    this[_storage][dartx.set](dart.notNull(index) * 2 + 1, value.y);
+    this[_storage][dartx._set](dart.notNull(index) * 2 + 0, value.x);
+    this[_storage][dartx._set](dart.notNull(index) * 2 + 1, value.y);
     return value;
   }
   sublist(start, end) {
@@ -15362,14 +15686,14 @@
     length: dart.definiteFunctionType(core.int, [])
   }),
   methods: () => ({
-    get: dart.definiteFunctionType(typed_data.Float64x2, [core.int]),
-    set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Float64x2]),
+    _get: dart.definiteFunctionType(typed_data.Float64x2, [core.int]),
+    _set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Float64x2]),
     sublist: dart.definiteFunctionType(core.List$(typed_data.Float64x2), [core.int], [core.int])
   })
 });
 dart.defineExtensionMembers(_native_typed_data.NativeFloat64x2List, [
-  'get',
-  'set',
+  '_get',
+  '_set',
   'sublist',
   'buffer',
   'lengthInBytes',
@@ -15446,7 +15770,7 @@
   if (_interceptors.JSIndexable.is(list)) return list;
   let result = core.List.new(list[dartx.length]);
   for (let i = 0; i < dart.notNull(list[dartx.length]); i++) {
-    result[dartx.set](i, list[dartx.get](i));
+    result[dartx._set](i, list[dartx._get](i));
   }
   return result;
 };
@@ -15505,113 +15829,113 @@
     if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
     return this[_getFloat32](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
   }
-  [_getFloat32](byteOffset, littleEndian) {
-    return this.getFloat32(byteOffset, littleEndian);
+  [_getFloat32](...args) {
+    return this.getFloat32.apply(this, args);
   }
   [dartx.getFloat64](byteOffset, endian) {
     if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
     return this[_getFloat64](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
   }
-  [_getFloat64](byteOffset, littleEndian) {
-    return this.getFloat64(byteOffset, littleEndian);
+  [_getFloat64](...args) {
+    return this.getFloat64.apply(this, args);
   }
   [dartx.getInt16](byteOffset, endian) {
     if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
     return this[_getInt16](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
   }
-  [_getInt16](byteOffset, littleEndian) {
-    return this.getInt16(byteOffset, littleEndian);
+  [_getInt16](...args) {
+    return this.getInt16.apply(this, args);
   }
   [dartx.getInt32](byteOffset, endian) {
     if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
     return this[_getInt32](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
   }
-  [_getInt32](byteOffset, littleEndian) {
-    return this.getInt32(byteOffset, littleEndian);
+  [_getInt32](...args) {
+    return this.getInt32.apply(this, args);
   }
   [dartx.getInt64](byteOffset, endian) {
     if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
     dart.throw(new core.UnsupportedError('Int64 accessor not supported by dart2js.'));
   }
-  [dartx.getInt8](byteOffset) {
-    return this.getInt8(byteOffset);
+  [dartx.getInt8](...args) {
+    return this.getInt8.apply(this, args);
   }
   [dartx.getUint16](byteOffset, endian) {
     if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
     return this[_getUint16](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
   }
-  [_getUint16](byteOffset, littleEndian) {
-    return this.getUint16(byteOffset, littleEndian);
+  [_getUint16](...args) {
+    return this.getUint16.apply(this, args);
   }
   [dartx.getUint32](byteOffset, endian) {
     if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
     return this[_getUint32](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
   }
-  [_getUint32](byteOffset, littleEndian) {
-    return this.getUint32(byteOffset, littleEndian);
+  [_getUint32](...args) {
+    return this.getUint32.apply(this, args);
   }
   [dartx.getUint64](byteOffset, endian) {
     if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
     dart.throw(new core.UnsupportedError('Uint64 accessor not supported by dart2js.'));
   }
-  [dartx.getUint8](byteOffset) {
-    return this.getUint8(byteOffset);
+  [dartx.getUint8](...args) {
+    return this.getUint8.apply(this, args);
   }
   [dartx.setFloat32](byteOffset, value, endian) {
     if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
     return this[_setFloat32](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
   }
-  [_setFloat32](byteOffset, value, littleEndian) {
-    return this.setFloat32(byteOffset, value, littleEndian);
+  [_setFloat32](...args) {
+    return this.setFloat32.apply(this, args);
   }
   [dartx.setFloat64](byteOffset, value, endian) {
     if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
     return this[_setFloat64](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
   }
-  [_setFloat64](byteOffset, value, littleEndian) {
-    return this.setFloat64(byteOffset, value, littleEndian);
+  [_setFloat64](...args) {
+    return this.setFloat64.apply(this, args);
   }
   [dartx.setInt16](byteOffset, value, endian) {
     if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
     return this[_setInt16](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
   }
-  [_setInt16](byteOffset, value, littleEndian) {
-    return this.setInt16(byteOffset, value, littleEndian);
+  [_setInt16](...args) {
+    return this.setInt16.apply(this, args);
   }
   [dartx.setInt32](byteOffset, value, endian) {
     if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
     return this[_setInt32](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
   }
-  [_setInt32](byteOffset, value, littleEndian) {
-    return this.setInt32(byteOffset, value, littleEndian);
+  [_setInt32](...args) {
+    return this.setInt32.apply(this, args);
   }
   [dartx.setInt64](byteOffset, value, endian) {
     if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
     dart.throw(new core.UnsupportedError('Int64 accessor not supported by dart2js.'));
   }
-  [dartx.setInt8](byteOffset, value) {
-    return this.setInt8(byteOffset, value);
+  [dartx.setInt8](...args) {
+    return this.setInt8.apply(this, args);
   }
   [dartx.setUint16](byteOffset, value, endian) {
     if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
     return this[_setUint16](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
   }
-  [_setUint16](byteOffset, value, littleEndian) {
-    return this.setUint16(byteOffset, value, littleEndian);
+  [_setUint16](...args) {
+    return this.setUint16.apply(this, args);
   }
   [dartx.setUint32](byteOffset, value, endian) {
     if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
     return this[_setUint32](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
   }
-  [_setUint32](byteOffset, value, littleEndian) {
-    return this.setUint32(byteOffset, value, littleEndian);
+  [_setUint32](...args) {
+    return this.setUint32.apply(this, args);
   }
   [dartx.setUint64](byteOffset, value, endian) {
     if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
     dart.throw(new core.UnsupportedError('Uint64 accessor not supported by dart2js.'));
   }
-  [dartx.setUint8](byteOffset, value) {
-    return this.setUint8(byteOffset, value);
+  [dartx.setUint8](...args) {
+    return this.setUint8.apply(this, args);
   }
   static _create1(arg) {
     return new DataView(new ArrayBuffer(arg));
@@ -15696,8 +16020,8 @@
 });
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'setRange'
 ]);
 _native_typed_data.NativeTypedArrayOfDouble = class NativeTypedArrayOfDouble extends dart.mixin(_native_typed_data.NativeTypedArray, collection.ListMixin$(core.double), _internal.FixedLengthListMixin$(core.double)) {
@@ -15707,11 +16031,11 @@
   set length(value) {
     super.length = value;
   }
-  get(index) {
+  _get(index) {
     _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
     return this[index];
   }
-  set(index, value) {
+  _set(index, value) {
     _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
     this[index] = value;
     return value;
@@ -15728,15 +16052,15 @@
 dart.setSignature(_native_typed_data.NativeTypedArrayOfDouble, {
   getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
   methods: () => ({
-    get: dart.definiteFunctionType(core.double, [core.int]),
-    set: dart.definiteFunctionType(dart.void, [core.int, core.num]),
+    _get: dart.definiteFunctionType(core.double, [core.int]),
+    _set: dart.definiteFunctionType(dart.void, [core.int, core.num]),
     setRange: dart.definiteFunctionType(dart.void, [core.int, core.int, IterableOfdouble()], [core.int])
   })
 });
-dart.defineExtensionMembers(_native_typed_data.NativeTypedArrayOfDouble, ['get', 'set', 'setRange', 'length']);
+dart.defineExtensionMembers(_native_typed_data.NativeTypedArrayOfDouble, ['_get', '_set', 'setRange', 'length']);
 dart.defineExtensionNames([
   'length',
-  'set',
+  '_set',
   'setRange'
 ]);
 _native_typed_data.NativeTypedArrayOfInt = class NativeTypedArrayOfInt extends dart.mixin(_native_typed_data.NativeTypedArray, collection.ListMixin$(core.int), _internal.FixedLengthListMixin$(core.int)) {
@@ -15746,7 +16070,7 @@
   set length(value) {
     super.length = value;
   }
-  set(index, value) {
+  _set(index, value) {
     _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
     this[index] = value;
     return value;
@@ -15764,11 +16088,11 @@
 dart.setSignature(_native_typed_data.NativeTypedArrayOfInt, {
   getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
   methods: () => ({
-    set: dart.definiteFunctionType(dart.void, [core.int, core.int]),
+    _set: dart.definiteFunctionType(dart.void, [core.int, core.int]),
     setRange: dart.definiteFunctionType(dart.void, [core.int, core.int, IterableOfint()], [core.int])
   })
 });
-dart.defineExtensionMembers(_native_typed_data.NativeTypedArrayOfInt, ['set', 'setRange', 'length']);
+dart.defineExtensionMembers(_native_typed_data.NativeTypedArrayOfInt, ['_set', 'setRange', 'length']);
 dart.defineExtensionNames([
   'runtimeType',
   'sublist'
@@ -15871,7 +16195,7 @@
 dart.registerExtension(dart.global.Float64Array, _native_typed_data.NativeFloat64List);
 dart.defineExtensionNames([
   'runtimeType',
-  'get',
+  '_get',
   'sublist'
 ]);
 _native_typed_data.NativeInt16List = class NativeInt16List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -15888,7 +16212,7 @@
   get [dartx.runtimeType]() {
     return dart.wrapType(typed_data.Int16List);
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
     return this[index];
   }
@@ -15916,7 +16240,7 @@
     view: dart.definiteFunctionType(_native_typed_data.NativeInt16List, [_native_typed_data.NativeByteBuffer, core.int, core.int])
   }),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+    [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
     [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
   }),
   statics: () => ({
@@ -15929,7 +16253,7 @@
 dart.registerExtension(dart.global.Int16Array, _native_typed_data.NativeInt16List);
 dart.defineExtensionNames([
   'runtimeType',
-  'get',
+  '_get',
   'sublist'
 ]);
 _native_typed_data.NativeInt32List = class NativeInt32List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -15946,7 +16270,7 @@
   get [dartx.runtimeType]() {
     return dart.wrapType(typed_data.Int32List);
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
     return this[index];
   }
@@ -15974,7 +16298,7 @@
     view: dart.definiteFunctionType(_native_typed_data.NativeInt32List, [typed_data.ByteBuffer, core.int, core.int])
   }),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+    [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
     [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
   }),
   statics: () => ({
@@ -15987,7 +16311,7 @@
 dart.registerExtension(dart.global.Int32Array, _native_typed_data.NativeInt32List);
 dart.defineExtensionNames([
   'runtimeType',
-  'get',
+  '_get',
   'sublist'
 ]);
 _native_typed_data.NativeInt8List = class NativeInt8List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -16004,7 +16328,7 @@
   get [dartx.runtimeType]() {
     return dart.wrapType(typed_data.Int8List);
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
     return this[index];
   }
@@ -16032,7 +16356,7 @@
     view: dart.definiteFunctionType(_native_typed_data.NativeInt8List, [typed_data.ByteBuffer, core.int, core.int])
   }),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+    [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
     [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
   }),
   statics: () => ({
@@ -16045,7 +16369,7 @@
 dart.registerExtension(dart.global.Int8Array, _native_typed_data.NativeInt8List);
 dart.defineExtensionNames([
   'runtimeType',
-  'get',
+  '_get',
   'sublist'
 ]);
 _native_typed_data.NativeUint16List = class NativeUint16List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -16062,7 +16386,7 @@
   get [dartx.runtimeType]() {
     return dart.wrapType(typed_data.Uint16List);
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
     return this[index];
   }
@@ -16090,7 +16414,7 @@
     view: dart.definiteFunctionType(_native_typed_data.NativeUint16List, [typed_data.ByteBuffer, core.int, core.int])
   }),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+    [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
     [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
   }),
   statics: () => ({
@@ -16103,7 +16427,7 @@
 dart.registerExtension(dart.global.Uint16Array, _native_typed_data.NativeUint16List);
 dart.defineExtensionNames([
   'runtimeType',
-  'get',
+  '_get',
   'sublist'
 ]);
 _native_typed_data.NativeUint32List = class NativeUint32List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -16120,7 +16444,7 @@
   get [dartx.runtimeType]() {
     return dart.wrapType(typed_data.Uint32List);
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
     return this[index];
   }
@@ -16148,7 +16472,7 @@
     view: dart.definiteFunctionType(_native_typed_data.NativeUint32List, [typed_data.ByteBuffer, core.int, core.int])
   }),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+    [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
     [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
   }),
   statics: () => ({
@@ -16162,7 +16486,7 @@
 dart.defineExtensionNames([
   'runtimeType',
   'length',
-  'get',
+  '_get',
   'sublist'
 ]);
 _native_typed_data.NativeUint8ClampedList = class NativeUint8ClampedList extends _native_typed_data.NativeTypedArrayOfInt {
@@ -16185,7 +16509,7 @@
   set [dartx.length](value) {
     super[dartx.length] = value;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
     return this[index];
   }
@@ -16213,7 +16537,7 @@
     view: dart.definiteFunctionType(_native_typed_data.NativeUint8ClampedList, [typed_data.ByteBuffer, core.int, core.int])
   }),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+    [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
     [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
   }),
   statics: () => ({
@@ -16224,10 +16548,11 @@
   names: ['_create1', '_create2', '_create3']
 });
 dart.registerExtension(dart.global.Uint8ClampedArray, _native_typed_data.NativeUint8ClampedList);
+dart.registerExtension(dart.global.CanvasPixelArray, _native_typed_data.NativeUint8ClampedList);
 dart.defineExtensionNames([
   'runtimeType',
   'length',
-  'get',
+  '_get',
   'sublist'
 ]);
 _native_typed_data.NativeUint8List = class NativeUint8List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -16250,7 +16575,7 @@
   set [dartx.length](value) {
     super[dartx.length] = value;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
     return this[index];
   }
@@ -16278,7 +16603,7 @@
     view: dart.definiteFunctionType(_native_typed_data.NativeUint8List, [typed_data.ByteBuffer, core.int, core.int])
   }),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+    [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
     [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
   }),
   statics: () => ({
@@ -16291,8 +16616,8 @@
 dart.registerExtension(dart.global.Uint8Array, _native_typed_data.NativeUint8List);
 _native_typed_data.NativeFloat32x4 = class NativeFloat32x4 extends core.Object {
   static _truncate(x) {
-    _native_typed_data.NativeFloat32x4._list[dartx.set](0, core.num._check(x));
-    return _native_typed_data.NativeFloat32x4._list[dartx.get](0);
+    _native_typed_data.NativeFloat32x4._list[dartx._set](0, core.num._check(x));
+    return _native_typed_data.NativeFloat32x4._list[dartx._get](0);
   }
   new(x, y, z, w) {
     this.x = core.double._check(_native_typed_data.NativeFloat32x4._truncate(x));
@@ -16311,11 +16636,11 @@
     NativeFloat32x4.prototype._truncated.call(this, 0.0, 0.0, 0.0, 0.0);
   }
   static fromInt32x4Bits(i) {
-    _native_typed_data.NativeFloat32x4._uint32view[dartx.set](0, i.x);
-    _native_typed_data.NativeFloat32x4._uint32view[dartx.set](1, i.y);
-    _native_typed_data.NativeFloat32x4._uint32view[dartx.set](2, i.z);
-    _native_typed_data.NativeFloat32x4._uint32view[dartx.set](3, i.w);
-    return new _native_typed_data.NativeFloat32x4._truncated(_native_typed_data.NativeFloat32x4._list[dartx.get](0), _native_typed_data.NativeFloat32x4._list[dartx.get](1), _native_typed_data.NativeFloat32x4._list[dartx.get](2), _native_typed_data.NativeFloat32x4._list[dartx.get](3));
+    _native_typed_data.NativeFloat32x4._uint32view[dartx._set](0, i.x);
+    _native_typed_data.NativeFloat32x4._uint32view[dartx._set](1, i.y);
+    _native_typed_data.NativeFloat32x4._uint32view[dartx._set](2, i.z);
+    _native_typed_data.NativeFloat32x4._uint32view[dartx._set](3, i.w);
+    return new _native_typed_data.NativeFloat32x4._truncated(_native_typed_data.NativeFloat32x4._list[dartx._get](0), _native_typed_data.NativeFloat32x4._list[dartx._get](1), _native_typed_data.NativeFloat32x4._list[dartx._get](2), _native_typed_data.NativeFloat32x4._list[dartx._get](3));
   }
   fromFloat64x2(v) {
     NativeFloat32x4.prototype._truncated.call(this, core.double._check(_native_typed_data.NativeFloat32x4._truncate(v.x)), core.double._check(_native_typed_data.NativeFloat32x4._truncate(v.y)), 0.0, 0.0);
@@ -16342,7 +16667,7 @@
     let _w = dart.notNull(this.w) + dart.notNull(other.w);
     return new _native_typed_data.NativeFloat32x4._doubles(_x, _y, _z, _w);
   }
-  ['unary-']() {
+  _negate() {
     return new _native_typed_data.NativeFloat32x4._truncated(-dart.notNull(this.x), -dart.notNull(this.y), -dart.notNull(this.z), -dart.notNull(this.w));
   }
   ['-'](other) {
@@ -16448,46 +16773,46 @@
   get signMask() {
     let view = _native_typed_data.NativeFloat32x4._uint32view;
     let mx = null, my = null, mz = null, mw = null;
-    _native_typed_data.NativeFloat32x4._list[dartx.set](0, this.x);
-    _native_typed_data.NativeFloat32x4._list[dartx.set](1, this.y);
-    _native_typed_data.NativeFloat32x4._list[dartx.set](2, this.z);
-    _native_typed_data.NativeFloat32x4._list[dartx.set](3, this.w);
-    mx = (dart.notNull(view[dartx.get](0)) & 2147483648) >>> 31;
-    my = (dart.notNull(view[dartx.get](1)) & 2147483648) >>> 30;
-    mz = (dart.notNull(view[dartx.get](2)) & 2147483648) >>> 29;
-    mw = (dart.notNull(view[dartx.get](3)) & 2147483648) >>> 28;
+    _native_typed_data.NativeFloat32x4._list[dartx._set](0, this.x);
+    _native_typed_data.NativeFloat32x4._list[dartx._set](1, this.y);
+    _native_typed_data.NativeFloat32x4._list[dartx._set](2, this.z);
+    _native_typed_data.NativeFloat32x4._list[dartx._set](3, this.w);
+    mx = (dart.notNull(view[dartx._get](0)) & 2147483648) >>> 31;
+    my = (dart.notNull(view[dartx._get](1)) & 2147483648) >>> 30;
+    mz = (dart.notNull(view[dartx._get](2)) & 2147483648) >>> 29;
+    mw = (dart.notNull(view[dartx._get](3)) & 2147483648) >>> 28;
     return core.int._check(dart.dsend(dart.dsend(dart.dsend(mx, '|', my), '|', mz), '|', mw));
   }
   shuffle(mask) {
     if (dart.notNull(mask) < 0 || dart.notNull(mask) > 255) {
       dart.throw(new core.RangeError.range(mask, 0, 255, "mask"));
     }
-    _native_typed_data.NativeFloat32x4._list[dartx.set](0, this.x);
-    _native_typed_data.NativeFloat32x4._list[dartx.set](1, this.y);
-    _native_typed_data.NativeFloat32x4._list[dartx.set](2, this.z);
-    _native_typed_data.NativeFloat32x4._list[dartx.set](3, this.w);
-    let _x = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) & 3);
-    let _y = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 2 & 3);
-    let _z = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 4 & 3);
-    let _w = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 6 & 3);
+    _native_typed_data.NativeFloat32x4._list[dartx._set](0, this.x);
+    _native_typed_data.NativeFloat32x4._list[dartx._set](1, this.y);
+    _native_typed_data.NativeFloat32x4._list[dartx._set](2, this.z);
+    _native_typed_data.NativeFloat32x4._list[dartx._set](3, this.w);
+    let _x = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) & 3);
+    let _y = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 2 & 3);
+    let _z = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 4 & 3);
+    let _w = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 6 & 3);
     return new _native_typed_data.NativeFloat32x4._truncated(_x, _y, _z, _w);
   }
   shuffleMix(other, mask) {
     if (dart.notNull(mask) < 0 || dart.notNull(mask) > 255) {
       dart.throw(new core.RangeError.range(mask, 0, 255, "mask"));
     }
-    _native_typed_data.NativeFloat32x4._list[dartx.set](0, this.x);
-    _native_typed_data.NativeFloat32x4._list[dartx.set](1, this.y);
-    _native_typed_data.NativeFloat32x4._list[dartx.set](2, this.z);
-    _native_typed_data.NativeFloat32x4._list[dartx.set](3, this.w);
-    let _x = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) & 3);
-    let _y = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 2 & 3);
-    _native_typed_data.NativeFloat32x4._list[dartx.set](0, other.x);
-    _native_typed_data.NativeFloat32x4._list[dartx.set](1, other.y);
-    _native_typed_data.NativeFloat32x4._list[dartx.set](2, other.z);
-    _native_typed_data.NativeFloat32x4._list[dartx.set](3, other.w);
-    let _z = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 4 & 3);
-    let _w = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 6 & 3);
+    _native_typed_data.NativeFloat32x4._list[dartx._set](0, this.x);
+    _native_typed_data.NativeFloat32x4._list[dartx._set](1, this.y);
+    _native_typed_data.NativeFloat32x4._list[dartx._set](2, this.z);
+    _native_typed_data.NativeFloat32x4._list[dartx._set](3, this.w);
+    let _x = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) & 3);
+    let _y = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 2 & 3);
+    _native_typed_data.NativeFloat32x4._list[dartx._set](0, other.x);
+    _native_typed_data.NativeFloat32x4._list[dartx._set](1, other.y);
+    _native_typed_data.NativeFloat32x4._list[dartx._set](2, other.z);
+    _native_typed_data.NativeFloat32x4._list[dartx._set](3, other.w);
+    let _z = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 4 & 3);
+    let _w = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 6 & 3);
     return new _native_typed_data.NativeFloat32x4._truncated(_x, _y, _z, _w);
   }
   withX(newX) {
@@ -16563,7 +16888,7 @@
   getters: () => ({signMask: dart.definiteFunctionType(core.int, [])}),
   methods: () => ({
     '+': dart.definiteFunctionType(typed_data.Float32x4, [typed_data.Float32x4]),
-    'unary-': dart.definiteFunctionType(typed_data.Float32x4, []),
+    _negate: dart.definiteFunctionType(typed_data.Float32x4, []),
     '-': dart.definiteFunctionType(typed_data.Float32x4, [typed_data.Float32x4]),
     '*': dart.definiteFunctionType(typed_data.Float32x4, [typed_data.Float32x4]),
     '/': dart.definiteFunctionType(typed_data.Float32x4, [typed_data.Float32x4]),
@@ -16605,8 +16930,8 @@
 });
 _native_typed_data.NativeInt32x4 = class NativeInt32x4 extends core.Object {
   static _truncate(x) {
-    _native_typed_data.NativeInt32x4._list[dartx.set](0, core.int._check(x));
-    return _native_typed_data.NativeInt32x4._list[dartx.get](0);
+    _native_typed_data.NativeInt32x4._list[dartx._set](0, core.int._check(x));
+    return _native_typed_data.NativeInt32x4._list[dartx._get](0);
   }
   new(x, y, z, w) {
     this.x = core.int._check(_native_typed_data.NativeInt32x4._truncate(x));
@@ -16626,12 +16951,12 @@
   }
   static fromFloat32x4Bits(f) {
     let floatList = _native_typed_data.NativeFloat32x4._list;
-    floatList[dartx.set](0, f.x);
-    floatList[dartx.set](1, f.y);
-    floatList[dartx.set](2, f.z);
-    floatList[dartx.set](3, f.w);
+    floatList[dartx._set](0, f.x);
+    floatList[dartx._set](1, f.y);
+    floatList[dartx._set](2, f.z);
+    floatList[dartx._set](3, f.w);
     let view = _native_typed_data.NativeInt32List._check(floatList[dartx.buffer][dartx.asInt32List]());
-    return new _native_typed_data.NativeInt32x4._truncated(view[dartx.get](0), view[dartx.get](1), view[dartx.get](2), view[dartx.get](3));
+    return new _native_typed_data.NativeInt32x4._truncated(view[dartx._get](0), view[dartx._get](1), view[dartx._get](2), view[dartx._get](3));
   }
   _truncated(x, y, z, w) {
     this.x = x;
@@ -16657,7 +16982,7 @@
   ['-'](other) {
     return new _native_typed_data.NativeInt32x4._truncated(this.x - other.x | 0, this.y - other.y | 0, this.z - other.z | 0, this.w - other.w | 0);
   }
-  ['unary-']() {
+  _negate() {
     return new _native_typed_data.NativeInt32x4._truncated(-this.x | 0, -this.y | 0, -this.z | 0, -this.w | 0);
   }
   get signMask() {
@@ -16671,32 +16996,32 @@
     if (dart.notNull(mask) < 0 || dart.notNull(mask) > 255) {
       dart.throw(new core.RangeError.range(mask, 0, 255, "mask"));
     }
-    _native_typed_data.NativeInt32x4._list[dartx.set](0, this.x);
-    _native_typed_data.NativeInt32x4._list[dartx.set](1, this.y);
-    _native_typed_data.NativeInt32x4._list[dartx.set](2, this.z);
-    _native_typed_data.NativeInt32x4._list[dartx.set](3, this.w);
-    let _x = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) & 3);
-    let _y = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 2 & 3);
-    let _z = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 4 & 3);
-    let _w = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 6 & 3);
+    _native_typed_data.NativeInt32x4._list[dartx._set](0, this.x);
+    _native_typed_data.NativeInt32x4._list[dartx._set](1, this.y);
+    _native_typed_data.NativeInt32x4._list[dartx._set](2, this.z);
+    _native_typed_data.NativeInt32x4._list[dartx._set](3, this.w);
+    let _x = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) & 3);
+    let _y = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 2 & 3);
+    let _z = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 4 & 3);
+    let _w = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 6 & 3);
     return new _native_typed_data.NativeInt32x4._truncated(_x, _y, _z, _w);
   }
   shuffleMix(other, mask) {
     if (dart.notNull(mask) < 0 || dart.notNull(mask) > 255) {
       dart.throw(new core.RangeError.range(mask, 0, 255, "mask"));
     }
-    _native_typed_data.NativeInt32x4._list[dartx.set](0, this.x);
-    _native_typed_data.NativeInt32x4._list[dartx.set](1, this.y);
-    _native_typed_data.NativeInt32x4._list[dartx.set](2, this.z);
-    _native_typed_data.NativeInt32x4._list[dartx.set](3, this.w);
-    let _x = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) & 3);
-    let _y = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 2 & 3);
-    _native_typed_data.NativeInt32x4._list[dartx.set](0, other.x);
-    _native_typed_data.NativeInt32x4._list[dartx.set](1, other.y);
-    _native_typed_data.NativeInt32x4._list[dartx.set](2, other.z);
-    _native_typed_data.NativeInt32x4._list[dartx.set](3, other.w);
-    let _z = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 4 & 3);
-    let _w = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 6 & 3);
+    _native_typed_data.NativeInt32x4._list[dartx._set](0, this.x);
+    _native_typed_data.NativeInt32x4._list[dartx._set](1, this.y);
+    _native_typed_data.NativeInt32x4._list[dartx._set](2, this.z);
+    _native_typed_data.NativeInt32x4._list[dartx._set](3, this.w);
+    let _x = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) & 3);
+    let _y = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 2 & 3);
+    _native_typed_data.NativeInt32x4._list[dartx._set](0, other.x);
+    _native_typed_data.NativeInt32x4._list[dartx._set](1, other.y);
+    _native_typed_data.NativeInt32x4._list[dartx._set](2, other.z);
+    _native_typed_data.NativeInt32x4._list[dartx._set](3, other.w);
+    let _z = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 4 & 3);
+    let _w = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 6 & 3);
     return new _native_typed_data.NativeInt32x4._truncated(_x, _y, _z, _w);
   }
   withX(x) {
@@ -16746,31 +17071,31 @@
   select(trueValue, falseValue) {
     let floatList = _native_typed_data.NativeFloat32x4._list;
     let intView = _native_typed_data.NativeFloat32x4._uint32view;
-    floatList[dartx.set](0, trueValue.x);
-    floatList[dartx.set](1, trueValue.y);
-    floatList[dartx.set](2, trueValue.z);
-    floatList[dartx.set](3, trueValue.w);
-    let stx = intView[dartx.get](0);
-    let sty = intView[dartx.get](1);
-    let stz = intView[dartx.get](2);
-    let stw = intView[dartx.get](3);
-    floatList[dartx.set](0, falseValue.x);
-    floatList[dartx.set](1, falseValue.y);
-    floatList[dartx.set](2, falseValue.z);
-    floatList[dartx.set](3, falseValue.w);
-    let sfx = intView[dartx.get](0);
-    let sfy = intView[dartx.get](1);
-    let sfz = intView[dartx.get](2);
-    let sfw = intView[dartx.get](3);
+    floatList[dartx._set](0, trueValue.x);
+    floatList[dartx._set](1, trueValue.y);
+    floatList[dartx._set](2, trueValue.z);
+    floatList[dartx._set](3, trueValue.w);
+    let stx = intView[dartx._get](0);
+    let sty = intView[dartx._get](1);
+    let stz = intView[dartx._get](2);
+    let stw = intView[dartx._get](3);
+    floatList[dartx._set](0, falseValue.x);
+    floatList[dartx._set](1, falseValue.y);
+    floatList[dartx._set](2, falseValue.z);
+    floatList[dartx._set](3, falseValue.w);
+    let sfx = intView[dartx._get](0);
+    let sfy = intView[dartx._get](1);
+    let sfz = intView[dartx._get](2);
+    let sfw = intView[dartx._get](3);
     let _x = (dart.notNull(this.x) & dart.notNull(stx) | ~dart.notNull(this.x) & dart.notNull(sfx)) >>> 0;
     let _y = (dart.notNull(this.y) & dart.notNull(sty) | ~dart.notNull(this.y) & dart.notNull(sfy)) >>> 0;
     let _z = (dart.notNull(this.z) & dart.notNull(stz) | ~dart.notNull(this.z) & dart.notNull(sfz)) >>> 0;
     let _w = (dart.notNull(this.w) & dart.notNull(stw) | ~dart.notNull(this.w) & dart.notNull(sfw)) >>> 0;
-    intView[dartx.set](0, _x);
-    intView[dartx.set](1, _y);
-    intView[dartx.set](2, _z);
-    intView[dartx.set](3, _w);
-    return new _native_typed_data.NativeFloat32x4._truncated(floatList[dartx.get](0), floatList[dartx.get](1), floatList[dartx.get](2), floatList[dartx.get](3));
+    intView[dartx._set](0, _x);
+    intView[dartx._set](1, _y);
+    intView[dartx._set](2, _z);
+    intView[dartx._set](3, _w);
+    return new _native_typed_data.NativeFloat32x4._truncated(floatList[dartx._get](0), floatList[dartx._get](1), floatList[dartx._get](2), floatList[dartx._get](3));
   }
 };
 dart.defineNamedConstructor(_native_typed_data.NativeInt32x4, 'bool');
@@ -16802,7 +17127,7 @@
     '^': dart.definiteFunctionType(typed_data.Int32x4, [typed_data.Int32x4]),
     '+': dart.definiteFunctionType(typed_data.Int32x4, [typed_data.Int32x4]),
     '-': dart.definiteFunctionType(typed_data.Int32x4, [typed_data.Int32x4]),
-    'unary-': dart.definiteFunctionType(typed_data.Int32x4, []),
+    _negate: dart.definiteFunctionType(typed_data.Int32x4, []),
     shuffle: dart.definiteFunctionType(typed_data.Int32x4, [core.int]),
     shuffleMix: dart.definiteFunctionType(typed_data.Int32x4, [typed_data.Int32x4, core.int]),
     withX: dart.definiteFunctionType(typed_data.Int32x4, [core.int]),
@@ -16850,7 +17175,7 @@
   ['+'](other) {
     return new _native_typed_data.NativeFloat64x2._doubles(dart.notNull(this.x) + dart.notNull(other.x), dart.notNull(this.y) + dart.notNull(other.y));
   }
-  ['unary-']() {
+  _negate() {
     return new _native_typed_data.NativeFloat64x2._doubles(-dart.notNull(this.x), -dart.notNull(this.y));
   }
   ['-'](other) {
@@ -16883,10 +17208,10 @@
   }
   get signMask() {
     let view = _native_typed_data.NativeFloat64x2._uint32View;
-    _native_typed_data.NativeFloat64x2._list[dartx.set](0, this.x);
-    _native_typed_data.NativeFloat64x2._list[dartx.set](1, this.y);
-    let mx = (dart.notNull(view[dartx.get](1)) & 2147483648) >>> 31;
-    let my = (dart.notNull(view[dartx.get](3)) & 2147483648) >>> 31;
+    _native_typed_data.NativeFloat64x2._list[dartx._set](0, this.x);
+    _native_typed_data.NativeFloat64x2._list[dartx._set](1, this.y);
+    let mx = (dart.notNull(view[dartx._get](1)) & 2147483648) >>> 31;
+    let my = (dart.notNull(view[dartx._get](3)) & 2147483648) >>> 31;
     return (mx | my << 1) >>> 0;
   }
   withX(x) {
@@ -16927,7 +17252,7 @@
   getters: () => ({signMask: dart.definiteFunctionType(core.int, [])}),
   methods: () => ({
     '+': dart.definiteFunctionType(typed_data.Float64x2, [typed_data.Float64x2]),
-    'unary-': dart.definiteFunctionType(typed_data.Float64x2, []),
+    _negate: dart.definiteFunctionType(typed_data.Float64x2, []),
     '-': dart.definiteFunctionType(typed_data.Float64x2, [typed_data.Float64x2]),
     '*': dart.definiteFunctionType(typed_data.Float64x2, [typed_data.Float64x2]),
     '/': dart.definiteFunctionType(typed_data.Float64x2, [typed_data.Float64x2]),
@@ -18294,7 +18619,7 @@
           future.then(dart.dynamic)(dart.fn(value => {
             remaining--;
             if (values != null) {
-              values[dartx.set](pos, value);
+              values[dartx._set](pos, value);
               if (remaining == 0) {
                 result[_completeWithValue](values);
               }
@@ -22319,13 +22644,13 @@
       }
     };
   }
-  get(key) {
-    let result = this[_map][dartx.get](key);
+  _get(key) {
+    let result = this[_map][dartx._get](key);
     if (result != null || dart.test(this[_map][dartx.containsKey](key))) return result;
     if (this.parent != null) {
-      let value = this.parent.get(key);
+      let value = this.parent._get(key);
       if (value != null) {
-        this[_map][dartx.set](key, value);
+        this[_map][dartx._set](key, value);
       }
       return value;
     }
@@ -22473,7 +22798,7 @@
     bindCallback: dart.definiteFunctionType(R => [async.ZoneCallback$(R), [dart.functionType(R, [])], {runGuarded: core.bool}]),
     bindUnaryCallback: dart.definiteFunctionType((R, T) => [async.ZoneUnaryCallback$(R, T), [dart.functionType(R, [T])], {runGuarded: core.bool}]),
     bindBinaryCallback: dart.definiteFunctionType((R, T1, T2) => [async.ZoneBinaryCallback$(R, T1, T2), [dart.functionType(R, [T1, T2])], {runGuarded: core.bool}]),
-    get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
+    _get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
     handleUncaughtError: dart.definiteFunctionType(R => [R, [dart.dynamic, core.StackTrace]]),
     fork: dart.definiteFunctionType(async.Zone, [], {specification: async.ZoneSpecification, zoneValues: core.Map}),
     run: dart.definiteFunctionType(R => [R, [dart.functionType(R, [])]]),
@@ -22755,7 +23080,7 @@
       }
     };
   }
-  get(key) {
+  _get(key) {
     return null;
   }
   handleUncaughtError(R) {
@@ -22845,7 +23170,7 @@
     bindCallback: dart.definiteFunctionType(R => [async.ZoneCallback$(R), [dart.functionType(R, [])], {runGuarded: core.bool}]),
     bindUnaryCallback: dart.definiteFunctionType((R, T) => [async.ZoneUnaryCallback$(R, T), [dart.functionType(R, [T])], {runGuarded: core.bool}]),
     bindBinaryCallback: dart.definiteFunctionType((R, T1, T2) => [async.ZoneBinaryCallback$(R, T1, T2), [dart.functionType(R, [T1, T2])], {runGuarded: core.bool}]),
-    get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
+    _get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
     handleUncaughtError: dart.definiteFunctionType(R => [R, [dart.dynamic, core.StackTrace]]),
     fork: dart.definiteFunctionType(async.Zone, [], {specification: async.ZoneSpecification, zoneValues: core.Map}),
     run: dart.definiteFunctionType(R => [R, [dart.functionType(R, [])]]),
@@ -22959,7 +23284,7 @@
       return new (_HashMapKeyIterableOfK())(this);
     }
     get values() {
-      return MappedIterableOfK$V().new(this.keys, dart.fn(each => this.get(each), KToV()));
+      return MappedIterableOfK$V().new(this.keys, dart.fn(each => this._get(each), KToV()));
     }
     containsKey(key) {
       if (dart.test(collection._HashMap._isStringKey(key))) {
@@ -22979,15 +23304,15 @@
       return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0;
     }
     containsValue(value) {
-      return this[_computeKeys]()[dartx.any](dart.fn(each => dart.equals(this.get(each), value), KTobool()));
+      return this[_computeKeys]()[dartx.any](dart.fn(each => dart.equals(this._get(each), value), KTobool()));
     }
     addAll(other) {
       MapOfK$V()._check(other);
       other[dartx.forEach](dart.fn((key, value) => {
-        this.set(key, value);
+        this._set(key, value);
       }, KAndVTovoid$()));
     }
-    get(key) {
+    _get(key) {
       if (dart.test(collection._HashMap._isStringKey(key))) {
         let strings = this[_strings];
         return V._check(strings == null ? null : collection._HashMap._getTableEntry(strings, key));
@@ -23005,7 +23330,7 @@
       let index = this[_findBucketIndex](bucket, key);
       return V._check(dart.notNull(index) < 0 ? null : bucket[dart.notNull(index) + 1]);
     }
-    set(key, value) {
+    _set(key, value) {
       K._check(key);
       V._check(value);
       if (dart.test(collection._HashMap._isStringKey(key))) {
@@ -23046,9 +23371,9 @@
     putIfAbsent(key, ifAbsent) {
       K._check(key);
       VoidToV()._check(ifAbsent);
-      if (dart.test(this.containsKey(key))) return this.get(key);
+      if (dart.test(this.containsKey(key))) return this._get(key);
       let value = ifAbsent();
-      this.set(key, value);
+      this._set(key, value);
       return value;
     }
     remove(key) {
@@ -23080,7 +23405,7 @@
       let keys = this[_computeKeys]();
       for (let i = 0, length = keys[dartx.length]; i < dart.notNull(length); i++) {
         let key = keys[i];
-        action(K._check(key), this.get(key));
+        action(K._check(key), this._get(key));
         if (keys !== this[_keys]) {
           dart.throw(new core.ConcurrentModificationError(this));
         }
@@ -23218,9 +23543,9 @@
       [_containsKey]: dart.definiteFunctionType(core.bool, [core.Object]),
       containsValue: dart.definiteFunctionType(core.bool, [core.Object]),
       addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
-      get: dart.definiteFunctionType(V, [core.Object]),
+      _get: dart.definiteFunctionType(V, [core.Object]),
       [_get]: dart.definiteFunctionType(V, [core.Object]),
-      set: dart.definiteFunctionType(dart.void, [K, V]),
+      _set: dart.definiteFunctionType(dart.void, [K, V]),
       [_set]: dart.definiteFunctionType(dart.void, [K, V]),
       putIfAbsent: dart.definiteFunctionType(V, [K, VoidToV()]),
       remove: dart.definiteFunctionType(V, [core.Object]),
@@ -23249,8 +23574,8 @@
     'containsKey',
     'containsValue',
     'addAll',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'putIfAbsent',
     'remove',
     'clear',
@@ -23297,11 +23622,11 @@
       this[_validKey] = validKey != null ? validKey : dart.fn(v => K.is(v), ObjectTobool());
       super.new();
     }
-    get(key) {
+    _get(key) {
       if (!dart.test(this[_validKey](key))) return null;
       return super[_get](key);
     }
-    set(key, value) {
+    _set(key, value) {
       K._check(key);
       V._check(value);
       super[_set](key, value);
@@ -23338,12 +23663,12 @@
       [_validKey]: _PredicateOfObject()
     }),
     methods: () => ({
-      get: dart.definiteFunctionType(V, [core.Object]),
-      set: dart.definiteFunctionType(dart.void, [K, V]),
+      _get: dart.definiteFunctionType(V, [core.Object]),
+      _set: dart.definiteFunctionType(dart.void, [K, V]),
       remove: dart.definiteFunctionType(V, [core.Object])
     })
   });
-  dart.defineExtensionMembers(_CustomHashMap, ['get', 'set', 'containsKey', 'remove']);
+  dart.defineExtensionMembers(_CustomHashMap, ['_get', '_set', 'containsKey', 'remove']);
   return _CustomHashMap;
 });
 collection._CustomHashMap = _CustomHashMap();
@@ -23520,13 +23845,13 @@
     addAll(other) {
       MapOfK$V()._check(other);
       other[dartx.forEach](dart.fn((key, value) => {
-        this.set(key, value);
+        this._set(key, value);
       }, KAndVTovoid$()));
     }
-    get(key) {
+    _get(key) {
       return this[_map].get(key);
     }
-    set(key, value) {
+    _set(key, value) {
       K._check(key);
       V._check(value);
       this[_map].set(key, value);
@@ -23536,13 +23861,13 @@
     putIfAbsent(key, ifAbsent) {
       K._check(key);
       VoidToV()._check(ifAbsent);
-      if (dart.test(this.containsKey(key))) return this.get(key);
+      if (dart.test(this.containsKey(key))) return this._get(key);
       let value = ifAbsent();
-      this.set(key, value);
+      this._set(key, value);
       return value;
     }
     remove(key) {
-      let value = this.get(key);
+      let value = this._get(key);
       this[_map].delete(key);
       this[_modified]();
       return value;
@@ -23587,8 +23912,8 @@
     }),
     methods: () => ({
       addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
-      get: dart.definiteFunctionType(V, [core.Object]),
-      set: dart.definiteFunctionType(dart.void, [K, V]),
+      _get: dart.definiteFunctionType(V, [core.Object]),
+      _set: dart.definiteFunctionType(dart.void, [K, V]),
       putIfAbsent: dart.definiteFunctionType(V, [K, VoidToV()]),
       remove: dart.definiteFunctionType(V, [core.Object]),
       forEach: dart.definiteFunctionType(dart.void, [KAndVTovoid()]),
@@ -23599,8 +23924,8 @@
     'containsKey',
     'containsValue',
     'addAll',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'putIfAbsent',
     'remove',
     'clear',
@@ -23746,11 +24071,11 @@
       this[_validKey] = validKey != null ? validKey : dart.fn(v => K.is(v), ObjectTobool());
       super.new();
     }
-    get(key) {
+    _get(key) {
       if (!dart.test(this[_validKey](key))) return null;
       return super.internalGet(key);
     }
-    set(key, value) {
+    _set(key, value) {
       K._check(key);
       V._check(value);
       super.internalSet(key, value);
@@ -23785,12 +24110,12 @@
       [_validKey]: _PredicateOfObject()
     }),
     methods: () => ({
-      get: dart.definiteFunctionType(V, [core.Object]),
-      set: dart.definiteFunctionType(dart.void, [K, V]),
+      _get: dart.definiteFunctionType(V, [core.Object]),
+      _set: dart.definiteFunctionType(dart.void, [K, V]),
       remove: dart.definiteFunctionType(V, [core.Object])
     })
   });
-  dart.defineExtensionMembers(_LinkedCustomHashMap, ['get', 'set', 'containsKey', 'remove']);
+  dart.defineExtensionMembers(_LinkedCustomHashMap, ['_get', '_set', 'containsKey', 'remove']);
   return _LinkedCustomHashMap;
 });
 collection._LinkedCustomHashMap = _LinkedCustomHashMap();
@@ -23891,7 +24216,7 @@
       })() : ListOfE().new(this.length);
       let i = 0;
       for (let element of this)
-        result[dartx.set](i++, element);
+        result[dartx._set](i++, element);
       return result;
     }
     map(T) {
@@ -24227,7 +24552,7 @@
       let bucket = this[_getBucket](rest, object);
       let index = this[_findBucketIndex](bucket, object);
       if (dart.notNull(index) < 0) return null;
-      return bucket[dartx.get](index);
+      return bucket[dartx._get](index);
     }
     add(element) {
       E._check(element);
@@ -24653,7 +24978,7 @@
       let bucket = this[_getBucket](rest, object);
       let index = this[_findBucketIndex](bucket, object);
       if (dart.notNull(index) < 0) return null;
-      return bucket[dartx.get](index)[_element];
+      return bucket[dartx._get](index)[_element];
     }
     forEach(action) {
       let cell = this[_first];
@@ -25085,7 +25410,7 @@
     set length(value) {
       super.length = value;
     }
-    get(index) {
+    _get(index) {
       return this[_source][dartx.elementAt](index);
     }
   }
@@ -25093,9 +25418,9 @@
     constructors: () => ({new: dart.definiteFunctionType(collection.UnmodifiableListView$(E), [IterableOfE()])}),
     fields: () => ({[_source]: IterableOfE()}),
     getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
-    methods: () => ({get: dart.definiteFunctionType(E, [core.int])})
+    methods: () => ({_get: dart.definiteFunctionType(E, [core.int])})
   });
-  dart.defineExtensionMembers(UnmodifiableListView, ['get', 'length']);
+  dart.defineExtensionMembers(UnmodifiableListView, ['_get', 'length']);
   return UnmodifiableListView;
 });
 collection.UnmodifiableListView = UnmodifiableListView();
@@ -25164,7 +25489,7 @@
     static from(other) {
       let result = HashMapOfK$V().new();
       other[dartx.forEach](dart.fn((k, v) => {
-        result.set(K.as(k), V.as(v));
+        result._set(K.as(k), V.as(v));
       }, dynamicAnddynamicTovoid()));
       return result;
     }
@@ -25534,7 +25859,7 @@
 });
 collection._isToStringVisiting = function(o) {
   for (let i = 0; i < dart.notNull(collection._toStringVisiting[dartx.length]); i++) {
-    if (core.identical(o, collection._toStringVisiting[dartx.get](i))) return true;
+    if (core.identical(o, collection._toStringVisiting[dartx._get](i))) return true;
   }
   return false;
 };
@@ -25716,7 +26041,7 @@
     static from(other) {
       let result = LinkedHashMapOfK$V().new();
       other[dartx.forEach](dart.fn((k, v) => {
-        result.set(K.as(k), V.as(v));
+        result._set(K.as(k), V.as(v));
       }, dynamicAnddynamicTovoid()));
       return result;
     }
@@ -26083,18 +26408,18 @@
   class MapMixin extends core.Object {
     forEach(action) {
       for (let key of this.keys) {
-        action(key, this.get(key));
+        action(key, this._get(key));
       }
     }
     addAll(other) {
       MapOfK$V()._check(other);
       for (let key of other[dartx.keys]) {
-        this.set(key, other[dartx.get](key));
+        this._set(key, other[dartx._get](key));
       }
     }
     containsValue(value) {
       for (let key of this.keys) {
-        if (dart.equals(this.get(key), value)) return true;
+        if (dart.equals(this._get(key), value)) return true;
       }
       return false;
     }
@@ -26102,9 +26427,9 @@
       K._check(key);
       VoidToV()._check(ifAbsent);
       if (dart.test(this.containsKey(key))) {
-        return this.get(key);
+        return this._get(key);
       }
-      return this.set(key, ifAbsent());
+      return this._set(key, ifAbsent());
     }
     containsKey(key) {
       return this.keys[dartx.contains](key);
@@ -26165,7 +26490,7 @@
   let MapOfK$V = () => (MapOfK$V = dart.constFn(core.Map$(K, V)))();
   let VoidToV = () => (VoidToV = dart.constFn(dart.functionType(V, [])))();
   class _UnmodifiableMapMixin extends core.Object {
-    set(key, value) {
+    _set(key, value) {
       K._check(key);
       V._check(value);
       dart.throw(new core.UnsupportedError("Cannot modify unmodifiable map"));
@@ -26191,7 +26516,7 @@
   _UnmodifiableMapMixin[dart.implements] = () => [MapOfK$V()];
   dart.setSignature(_UnmodifiableMapMixin, {
     methods: () => ({
-      set: dart.definiteFunctionType(dart.void, [K, V]),
+      _set: dart.definiteFunctionType(dart.void, [K, V]),
       addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
       clear: dart.definiteFunctionType(dart.void, []),
       remove: dart.definiteFunctionType(V, [core.Object]),
@@ -26199,7 +26524,7 @@
     })
   });
   dart.defineExtensionMembers(_UnmodifiableMapMixin, [
-    'set',
+    '_set',
     'addAll',
     'clear',
     'remove',
@@ -26235,13 +26560,13 @@
       return this[_map][dartx.isNotEmpty];
     }
     get first() {
-      return this[_map][dartx.get](this[_map][dartx.keys][dartx.first]);
+      return this[_map][dartx._get](this[_map][dartx.keys][dartx.first]);
     }
     get single() {
-      return this[_map][dartx.get](this[_map][dartx.keys][dartx.single]);
+      return this[_map][dartx._get](this[_map][dartx.keys][dartx.single]);
     }
     get last() {
-      return this[_map][dartx.get](this[_map][dartx.keys][dartx.last]);
+      return this[_map][dartx._get](this[_map][dartx.keys][dartx.last]);
     }
     get iterator() {
       return new (_MapBaseValueIteratorOfK$V())(this[_map]);
@@ -26282,7 +26607,7 @@
     }
     moveNext() {
       if (dart.test(this[_keys].moveNext())) {
-        this[_current] = this[_map][dartx.get](this[_keys].current);
+        this[_current] = this[_map][dartx._get](this[_keys].current);
         return true;
       }
       this[_current] = null;
@@ -26315,13 +26640,13 @@
     new(map) {
       this[_map] = map;
     }
-    get(key) {
-      return this[_map][dartx.get](key);
+    _get(key) {
+      return this[_map][dartx._get](key);
     }
-    set(key, value) {
+    _set(key, value) {
       K._check(key);
       V._check(value);
-      this[_map][dartx.set](key, value);
+      this[_map][dartx._set](key, value);
       return value;
     }
     addAll(other) {
@@ -26380,8 +26705,8 @@
       values: dart.definiteFunctionType(core.Iterable$(V), [])
     }),
     methods: () => ({
-      get: dart.definiteFunctionType(V, [core.Object]),
-      set: dart.definiteFunctionType(dart.void, [K, V]),
+      _get: dart.definiteFunctionType(V, [core.Object]),
+      _set: dart.definiteFunctionType(dart.void, [K, V]),
       addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
       clear: dart.definiteFunctionType(dart.void, []),
       putIfAbsent: dart.definiteFunctionType(V, [K, VoidToV()]),
@@ -26392,8 +26717,8 @@
     })
   });
   dart.defineExtensionMembers(MapView, [
-    'get',
-    'set',
+    '_get',
+    '_set',
     'addAll',
     'clear',
     'putIfAbsent',
@@ -26438,10 +26763,10 @@
   }
   static putIfAbsent(map, key, ifAbsent) {
     if (dart.test(map[dartx.containsKey](key))) {
-      return map[dartx.get](key);
+      return map[dartx._get](key);
     }
     let v = ifAbsent();
-    map[dartx.set](key, v);
+    map[dartx._set](key, v);
     return v;
   }
   static clear(map) {
@@ -26451,11 +26776,11 @@
   }
   static forEach(map, f) {
     for (let k of map[dartx.keys]) {
-      dart.dcall(f, k, map[dartx.get](k));
+      dart.dcall(f, k, map[dartx._get](k));
     }
   }
   static getValues(map) {
-    return map[dartx.keys][dartx.map](dart.dynamic)(dart.fn(key => map[dartx.get](key), dynamicTodynamic()));
+    return map[dartx.keys][dartx.map](dart.dynamic)(dart.fn(key => map[dartx._get](key), dynamicTodynamic()));
   }
   static length(map) {
     return map[dartx.keys][dartx.length];
@@ -26498,7 +26823,7 @@
     if (key == null) key = collection.Maps._id;
     if (value == null) value = collection.Maps._id;
     for (let element of iterable) {
-      map[dartx.set](dart.dcall(key, element), dart.dcall(value, element));
+      map[dartx._set](dart.dcall(key, element), dart.dcall(value, element));
     }
   }
   static _fillMapWithIterables(map, keys, values) {
@@ -26507,7 +26832,7 @@
     let hasNextKey = keyIterator.moveNext();
     let hasNextValue = valueIterator.moveNext();
     while (dart.test(hasNextKey) && dart.test(hasNextValue)) {
-      map[dartx.set](keyIterator.current, valueIterator.current);
+      map[dartx._set](keyIterator.current, valueIterator.current);
       hasNextKey = keyIterator.moveNext();
       hasNextValue = valueIterator.moveNext();
     }
@@ -26638,7 +26963,6 @@
       return this[_nextLink];
     }
   }
-  dart.setBaseClass(_UserDoubleLinkedQueueEntry, collection._DoubleLink$(_UserDoubleLinkedQueueEntry));
   _UserDoubleLinkedQueueEntry[dart.implements] = () => [DoubleLinkedQueueEntryOfE()];
   dart.setSignature(_UserDoubleLinkedQueueEntry, {
     constructors: () => ({new: dart.definiteFunctionType(collection._UserDoubleLinkedQueueEntry$(E), [E])}),
@@ -26652,6 +26976,8 @@
     })
   });
   return _UserDoubleLinkedQueueEntry;
+}, _UserDoubleLinkedQueueEntry => {
+  dart.setBaseClass(_UserDoubleLinkedQueueEntry, collection._DoubleLink$(_UserDoubleLinkedQueueEntry));
 });
 collection._UserDoubleLinkedQueueEntry = _UserDoubleLinkedQueueEntry();
 const _queue = Symbol('_queue');
@@ -26681,7 +27007,6 @@
       return this[_previousLink][_asNonSentinelEntry]();
     }
   }
-  dart.setBaseClass(_DoubleLinkedQueueEntry, collection._DoubleLink$(_DoubleLinkedQueueEntry));
   dart.setSignature(_DoubleLinkedQueueEntry, {
     constructors: () => ({new: dart.definiteFunctionType(collection._DoubleLinkedQueueEntry$(E), [DoubleLinkedQueueOfE()])}),
     fields: () => ({[_queue]: DoubleLinkedQueueOfE()}),
@@ -26693,6 +27018,8 @@
     })
   });
   return _DoubleLinkedQueueEntry;
+}, _DoubleLinkedQueueEntry => {
+  dart.setBaseClass(_DoubleLinkedQueueEntry, collection._DoubleLink$(_DoubleLinkedQueueEntry));
 });
 collection._DoubleLinkedQueueEntry = _DoubleLinkedQueueEntry();
 const _elementCount = Symbol('_elementCount');
@@ -26781,7 +27108,6 @@
 });
 collection._DoubleLinkedQueueSentinel = _DoubleLinkedQueueSentinel();
 const _sentinel = Symbol('_sentinel');
-const _filter = Symbol('_filter');
 collection.DoubleLinkedQueue$ = dart.generic(E => {
   let _DoubleLinkedQueueSentinelOfE = () => (_DoubleLinkedQueueSentinelOfE = dart.constFn(collection._DoubleLinkedQueueSentinel$(E)))();
   let DoubleLinkedQueueOfE = () => (DoubleLinkedQueueOfE = dart.constFn(collection.DoubleLinkedQueue$(E)))();
@@ -27046,7 +27372,7 @@
         let queue = new (ListQueueOfE())(dart.notNull(length) + 1);
         dart.assert(dart.notNull(queue[_table][dartx.length]) > dart.notNull(length));
         for (let i = 0; i < dart.notNull(length); i++) {
-          queue[_table][dartx.set](i, E.as(elements[dartx.get](i)));
+          queue[_table][dartx._set](i, E.as(elements[dartx._get](i)));
         }
         queue[_tail] = length;
         return queue;
@@ -27068,7 +27394,7 @@
     forEach(action) {
       let modificationCount = this[_modificationCount];
       for (let i = this[_head]; i != this[_tail]; i = (dart.notNull(i) + 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0) {
-        action(this[_table][dartx.get](i));
+        action(this[_table][dartx._get](i));
         this[_checkModification](modificationCount);
       }
     }
@@ -27080,20 +27406,20 @@
     }
     get first() {
       if (this[_head] == this[_tail]) dart.throw(_internal.IterableElementError.noElement());
-      return this[_table][dartx.get](this[_head]);
+      return this[_table][dartx._get](this[_head]);
     }
     get last() {
       if (this[_head] == this[_tail]) dart.throw(_internal.IterableElementError.noElement());
-      return this[_table][dartx.get]((dart.notNull(this[_tail]) - 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0);
+      return this[_table][dartx._get]((dart.notNull(this[_tail]) - 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0);
     }
     get single() {
       if (this[_head] == this[_tail]) dart.throw(_internal.IterableElementError.noElement());
       if (dart.notNull(this.length) > 1) dart.throw(_internal.IterableElementError.tooMany());
-      return this[_table][dartx.get](this[_head]);
+      return this[_table][dartx._get](this[_head]);
     }
     elementAt(index) {
       core.RangeError.checkValidIndex(index, this);
-      return this[_table][dartx.get]((dart.notNull(this[_head]) + dart.notNull(index) & dart.notNull(this[_table][dartx.length]) - 1) >>> 0);
+      return this[_table][dartx._get]((dart.notNull(this[_head]) + dart.notNull(index) & dart.notNull(this[_table][dartx.length]) - 1) >>> 0);
     }
     toList(opts) {
       let growable = opts && 'growable' in opts ? opts.growable : true;
@@ -27141,7 +27467,7 @@
     }
     remove(value) {
       for (let i = this[_head]; i != this[_tail]; i = (dart.notNull(i) + 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0) {
-        let element = this[_table][dartx.get](i);
+        let element = this[_table][dartx._get](i);
         if (dart.equals(element, value)) {
           this[_remove](i);
           this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
@@ -27154,7 +27480,7 @@
       let modificationCount = this[_modificationCount];
       let i = this[_head];
       while (i != this[_tail]) {
-        let element = this[_table][dartx.get](i);
+        let element = this[_table][dartx._get](i);
         let remove = core.identical(removeMatching, test(element));
         this[_checkModification](modificationCount);
         if (remove) {
@@ -27174,7 +27500,7 @@
     clear() {
       if (this[_head] != this[_tail]) {
         for (let i = this[_head]; i != this[_tail]; i = (dart.notNull(i) + 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0) {
-          this[_table][dartx.set](i, null);
+          this[_table][dartx._set](i, null);
         }
         this[_head] = this[_tail] = 0;
         this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
@@ -27190,15 +27516,15 @@
     addFirst(value) {
       E._check(value);
       this[_head] = (dart.notNull(this[_head]) - 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0;
-      this[_table][dartx.set](this[_head], value);
+      this[_table][dartx._set](this[_head], value);
       if (this[_head] == this[_tail]) this[_grow]();
       this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
     }
     removeFirst() {
       if (this[_head] == this[_tail]) dart.throw(_internal.IterableElementError.noElement());
       this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
-      let result = this[_table][dartx.get](this[_head]);
-      this[_table][dartx.set](this[_head], null);
+      let result = this[_table][dartx._get](this[_head]);
+      this[_table][dartx._set](this[_head], null);
       this[_head] = (dart.notNull(this[_head]) + 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0;
       return result;
     }
@@ -27206,8 +27532,8 @@
       if (this[_head] == this[_tail]) dart.throw(_internal.IterableElementError.noElement());
       this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
       this[_tail] = (dart.notNull(this[_tail]) - 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0;
-      let result = this[_table][dartx.get](this[_tail]);
-      this[_table][dartx.set](this[_tail], null);
+      let result = this[_table][dartx._get](this[_tail]);
+      this[_table][dartx._set](this[_tail], null);
       return result;
     }
     static _isPowerOf2(number) {
@@ -27229,7 +27555,7 @@
     }
     [_add](element) {
       E._check(element);
-      this[_table][dartx.set](this[_tail], element);
+      this[_table][dartx._set](this[_tail], element);
       this[_tail] = (dart.notNull(this[_tail]) + 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0;
       if (this[_head] == this[_tail]) this[_grow]();
       this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
@@ -27242,10 +27568,10 @@
         let i = offset;
         while (i != this[_head]) {
           let prevOffset = (dart.notNull(i) - 1 & mask) >>> 0;
-          this[_table][dartx.set](i, this[_table][dartx.get](prevOffset));
+          this[_table][dartx._set](i, this[_table][dartx._get](prevOffset));
           i = prevOffset;
         }
-        this[_table][dartx.set](this[_head], null);
+        this[_table][dartx._set](this[_head], null);
         this[_head] = (dart.notNull(this[_head]) + 1 & mask) >>> 0;
         return (dart.notNull(offset) + 1 & mask) >>> 0;
       } else {
@@ -27253,10 +27579,10 @@
         let i = offset;
         while (i != this[_tail]) {
           let nextOffset = (dart.notNull(i) + 1 & mask) >>> 0;
-          this[_table][dartx.set](i, this[_table][dartx.get](nextOffset));
+          this[_table][dartx._set](i, this[_table][dartx._get](nextOffset));
           i = nextOffset;
         }
-        this[_table][dartx.set](this[_tail], null);
+        this[_table][dartx._set](this[_tail], null);
         return offset;
       }
     }
@@ -27378,7 +27704,7 @@
         this[_current] = null;
         return false;
       }
-      this[_current] = this[_queue][_table][dartx.get](this[_position]);
+      this[_current] = this[_queue][_table][dartx._get](this[_position]);
       this[_position] = (dart.notNull(this[_position]) + 1 & dart.notNull(this[_queue][_table][dartx.length]) - 1) >>> 0;
       return true;
     }
@@ -27653,7 +27979,7 @@
       if (isValidKey === void 0) isValidKey = null;
       let result = new (SplayTreeMapOfK$V())(compare, isValidKey);
       other[dartx.forEach](dart.fn((k, v) => {
-        result.set(K.as(k), V.as(v));
+        result._set(K.as(k), V.as(v));
       }, dynamicAnddynamicTovoid()));
       return result;
     }
@@ -27685,7 +28011,7 @@
       this[_validKey] = null;
       super.new();
     }
-    get(key) {
+    _get(key) {
       if (!dart.test(dart.dcall(this[_validKey], key))) return null;
       if (this[_root] != null) {
         let comp = this[_splay](K.as(key));
@@ -27701,7 +28027,7 @@
       if (mapRoot != null) return mapRoot.value;
       return null;
     }
-    set(key, value) {
+    _set(key, value) {
       (() => {
         K._check(key);
         V._check(value);
@@ -27739,7 +28065,7 @@
     addAll(other) {
       MapOfK$V()._check(other);
       other[dartx.forEach](dart.fn((key, value) => {
-        this.set(key, value);
+        this._set(key, value);
       }, KAndVTovoid$()));
     }
     get isEmpty() {
@@ -27850,9 +28176,9 @@
     }),
     methods: () => ({
       [_compare]: dart.definiteFunctionType(core.int, [K, K]),
-      get: dart.definiteFunctionType(V, [core.Object]),
+      _get: dart.definiteFunctionType(V, [core.Object]),
       remove: dart.definiteFunctionType(V, [core.Object]),
-      set: dart.definiteFunctionType(dart.void, [K, V]),
+      _set: dart.definiteFunctionType(dart.void, [K, V]),
       putIfAbsent: dart.definiteFunctionType(V, [K, VoidToV()]),
       addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
       forEach: dart.definiteFunctionType(dart.void, [KAndVTovoid()]),
@@ -27866,9 +28192,9 @@
     })
   });
   dart.defineExtensionMembers(SplayTreeMap, [
-    'get',
+    '_get',
     'remove',
-    'set',
+    '_set',
     'putIfAbsent',
     'addAll',
     'forEach',
@@ -28288,14 +28614,12 @@
     }),
     getters: () => ({
       iterator: dart.definiteFunctionType(core.Iterator$(E), []),
-      length: dart.definiteFunctionType(core.int, []),
       first: dart.definiteFunctionType(E, []),
       last: dart.definiteFunctionType(E, []),
       single: dart.definiteFunctionType(E, [])
     }),
     methods: () => ({
       [_compare]: dart.definiteFunctionType(core.int, [E, E]),
-      contains: dart.definiteFunctionType(core.bool, [core.Object]),
       add: dart.definiteFunctionType(core.bool, [E]),
       remove: dart.definiteFunctionType(core.bool, [core.Object]),
       addAll: dart.definiteFunctionType(dart.void, [IterableOfE()]),
@@ -28343,7 +28667,7 @@
     let processed = map[_processed];
     let keys = map[_computeKeys]();
     for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-      let key = keys[dartx.get](i);
+      let key = keys[dartx._get](i);
       let revived = dart.dcall(reviver, key, walk(e[key]));
       processed[key] = revived;
     }
@@ -28380,9 +28704,9 @@
     this[_original] = original;
     this[_data] = null;
   }
-  get(key) {
+  _get(key) {
     if (dart.test(this[_isUpgraded])) {
-      return this[_upgradedMap][dartx.get](key);
+      return this[_upgradedMap][dartx._get](key);
     } else if (!(typeof key == 'string')) {
       return null;
     } else {
@@ -28406,11 +28730,11 @@
   }
   get values() {
     if (dart.test(this[_isUpgraded])) return this[_upgradedMap][dartx.values];
-    return MappedIterableOfString$dynamic().new(this[_computeKeys](), dart.fn(each => this.get(each), dynamicTodynamic()));
+    return MappedIterableOfString$dynamic().new(this[_computeKeys](), dart.fn(each => this._get(each), dynamicTodynamic()));
   }
-  set(key, value) {
+  _set(key, value) {
     if (dart.test(this[_isUpgraded])) {
-      this[_upgradedMap][dartx.set](key, value);
+      this[_upgradedMap][dartx._set](key, value);
     } else if (dart.test(this.containsKey(key))) {
       let processed = this[_processed];
       convert._JsonMap._setProperty(processed, core.String._check(key), value);
@@ -28419,21 +28743,21 @@
         convert._JsonMap._setProperty(original, core.String._check(key), null);
       }
     } else {
-      this[_upgrade]()[dartx.set](key, value);
+      this[_upgrade]()[dartx._set](key, value);
     }
     return value;
   }
   addAll(other) {
     other[dartx.forEach](dart.fn((key, value) => {
-      this.set(key, value);
+      this._set(key, value);
     }, dynamicAnddynamicTovoid()));
   }
   containsValue(value) {
     if (dart.test(this[_isUpgraded])) return this[_upgradedMap][dartx.containsValue](value);
     let keys = this[_computeKeys]();
     for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-      let key = keys[dartx.get](i);
-      if (dart.equals(this.get(key), value)) return true;
+      let key = keys[dartx._get](i);
+      if (dart.equals(this._get(key), value)) return true;
     }
     return false;
   }
@@ -28443,9 +28767,9 @@
     return convert._JsonMap._hasProperty(this[_original], core.String._check(key));
   }
   putIfAbsent(key, ifAbsent) {
-    if (dart.test(this.containsKey(key))) return this.get(key);
+    if (dart.test(this.containsKey(key))) return this._get(key);
     let value = ifAbsent();
-    this.set(key, value);
+    this._set(key, value);
     return value;
   }
   remove(key) {
@@ -28467,7 +28791,7 @@
     if (dart.test(this[_isUpgraded])) return this[_upgradedMap][dartx.forEach](f);
     let keys = this[_computeKeys]();
     for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-      let key = keys[dartx.get](i);
+      let key = keys[dartx._get](i);
       let value = convert._JsonMap._getProperty(this[_processed], key);
       if (dart.test(convert._JsonMap._isUnprocessed(value))) {
         value = convert._convertJsonToDartLazy(convert._JsonMap._getProperty(this[_original], key));
@@ -28502,8 +28826,8 @@
     let result = dart.map();
     let keys = this[_computeKeys]();
     for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-      let key = keys[dartx.get](i);
-      result[dartx.set](key, this.get(key));
+      let key = keys[dartx._get](i);
+      result[dartx._set](key, this._get(key));
     }
     if (dart.test(keys[dartx.isEmpty])) {
       keys[dartx.add](null);
@@ -28557,8 +28881,8 @@
     [_upgradedMap]: dart.definiteFunctionType(core.Map, [])
   }),
   methods: () => ({
-    get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
-    set: dart.definiteFunctionType(dart.void, [dart.dynamic, dart.dynamic]),
+    _get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
+    _set: dart.definiteFunctionType(dart.void, [dart.dynamic, dart.dynamic]),
     addAll: dart.definiteFunctionType(dart.void, [core.Map]),
     containsValue: dart.definiteFunctionType(core.bool, [core.Object]),
     containsKey: dart.definiteFunctionType(core.bool, [core.Object]),
@@ -28581,8 +28905,8 @@
   names: ['_hasProperty', '_getProperty', '_setProperty', '_getPropertyNames', '_isUnprocessed', '_newJavaScriptObject']
 });
 dart.defineExtensionMembers(convert._JsonMap, [
-  'get',
-  'set',
+  '_get',
+  '_set',
   'addAll',
   'containsValue',
   'containsKey',
@@ -28606,7 +28930,7 @@
     return this[_parent].length;
   }
   elementAt(index) {
-    return core.String._check(dart.test(this[_parent][_isUpgraded]) ? this[_parent].keys[dartx.elementAt](index) : this[_parent][_computeKeys]()[dartx.get](index));
+    return core.String._check(dart.test(this[_parent][_isUpgraded]) ? this[_parent].keys[dartx.elementAt](index) : this[_parent][_computeKeys]()[dartx._get](index));
   }
   get iterator() {
     return dart.test(this[_parent][_isUpgraded]) ? this[_parent].keys[dartx.iterator] : this[_parent][_computeKeys]()[dartx.iterator];
@@ -28709,9 +29033,7 @@
 let const;
 let const;
 convert.Codec$ = dart.generic((S, T) => {
-  let _FusedCodecOfS$T$dynamic = () => (_FusedCodecOfS$T$dynamic = dart.constFn(convert._FusedCodec$(S, T, dart.dynamic)))();
   let _InvertedCodecOfT$S = () => (_InvertedCodecOfT$S = dart.constFn(convert._InvertedCodec$(T, S)))();
-  let CodecOfT$dynamic = () => (CodecOfT$dynamic = dart.constFn(convert.Codec$(T, dart.dynamic)))();
   class Codec extends core.Object {
     new() {
     }
@@ -28723,9 +29045,11 @@
       T._check(encoded);
       return this.decoder.convert(encoded);
     }
-    fuse(other) {
-      CodecOfT$dynamic()._check(other);
-      return new (_FusedCodecOfS$T$dynamic())(this, other);
+    fuse(R) {
+      return other => {
+        convert.Codec$(T, R)._check(other);
+        return new (convert._FusedCodec$(S, T, R))(this, other);
+      };
     }
     get inverted() {
       return new (_InvertedCodecOfT$S())(this);
@@ -28738,7 +29062,7 @@
     methods: () => ({
       encode: dart.definiteFunctionType(T, [S]),
       decode: dart.definiteFunctionType(S, [T]),
-      fuse: dart.definiteFunctionType(convert.Codec$(S, dart.dynamic), [CodecOfT$dynamic()])
+      fuse: dart.definiteFunctionType(R => [convert.Codec$(S, R), [convert.Codec$(T, R)]])
     })
   });
   return Codec;
@@ -28850,7 +29174,7 @@
       let result = ListOfE().new(length);
       if (length != 0 && fill != null) {
         for (let i = 0; i < dart.notNull(result[dartx.length]); i++) {
-          result[dartx.set](i, fill);
+          result[dartx._set](i, fill);
         }
       }
       return result;
@@ -28874,7 +29198,7 @@
         result = ListOfE().new(length);
       }
       for (let i = 0; i < dart.notNull(length); i++) {
-        result[dartx.set](i, generator(i));
+        result[dartx._set](i, generator(i));
       }
       return result;
     }
@@ -28913,7 +29237,7 @@
   static getByName(name) {
     if (name == null) return null;
     name = name[dartx.toLowerCase]();
-    return convert.Encoding._nameToEncoding[dartx.get](name);
+    return convert.Encoding._nameToEncoding[dartx._get](name);
   }
 };
 dart.addSimpleTypeTests(convert.Encoding);
@@ -29024,7 +29348,7 @@
       if ((dart.notNull(codeUnit) & ~dart.notNull(this[_subsetMask])) != 0) {
         dart.throw(new core.ArgumentError("String contains invalid characters."));
       }
-      result[dartx.set](i, codeUnit);
+      result[dartx._set](i, codeUnit);
     }
     return result;
   }
@@ -29103,7 +29427,7 @@
     core.RangeError.checkValidRange(start, end, byteCount);
     if (end == null) end = byteCount;
     for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-      let byte = bytes[dartx.get](i);
+      let byte = bytes[dartx._get](i);
       if ((dart.notNull(byte) & ~dart.notNull(this[_subsetMask])) != 0) {
         if (!dart.test(this[_allowInvalid])) {
           dart.throw(new core.FormatException(dart.str`Invalid value in input: ${byte}`));
@@ -29116,7 +29440,7 @@
   [_convertInvalid](bytes, start, end) {
     let buffer = new core.StringBuffer();
     for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-      let value = bytes[dartx.get](i);
+      let value = bytes[dartx._get](i);
       if ((dart.notNull(value) & ~dart.notNull(this[_subsetMask])) != 0) value = 65533;
       buffer.writeCharCode(value);
     }
@@ -29232,7 +29556,7 @@
   addSlice(source, start, end, isLast) {
     core.RangeError.checkValidRange(start, end, source[dartx.length]);
     for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-      if ((dart.notNull(source[dartx.get](i)) & ~convert._ASCII_MASK) != 0) {
+      if ((dart.notNull(source[dartx._get](i)) & ~convert._ASCII_MASK) != 0) {
         if (dart.notNull(i) > dart.notNull(start)) this[_utf8Sink].addSlice(source, start, i, false);
         this[_utf8Sink].add(const || (const = dart.constList([239, 191, 189], core.int)));
         start = dart.notNull(i) + 1;
@@ -29263,7 +29587,7 @@
   }
   add(source) {
     for (let i = 0; i < dart.notNull(source[dartx.length]); i++) {
-      if ((dart.notNull(source[dartx.get](i)) & ~convert._ASCII_MASK) != 0) {
+      if ((dart.notNull(source[dartx._get](i)) & ~convert._ASCII_MASK) != 0) {
         dart.throw(new core.FormatException("Source contains non-ASCII bytes."));
       }
     }
@@ -29404,27 +29728,27 @@
     let expectedChars = 3 - dart.notNull(convert._Base64Encoder._stateCount(state));
     let byteOr = 0;
     for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-      let byte = bytes[dartx.get](i);
+      let byte = bytes[dartx._get](i);
       byteOr = (dart.notNull(byteOr) | dart.notNull(byte)) >>> 0;
       bits = (dart.notNull(bits) << 8 | dart.notNull(byte)) & 16777215;
       expectedChars--;
       if (expectedChars == 0) {
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 18 & convert._Base64Encoder._sixBitMask));
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 12 & convert._Base64Encoder._sixBitMask));
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 6 & convert._Base64Encoder._sixBitMask));
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
@@ -29442,53 +29766,53 @@
     }
     let i = start;
     while (dart.notNull(i) < dart.notNull(end)) {
-      let byte = bytes[dartx.get](i);
+      let byte = bytes[dartx._get](i);
       if (dart.notNull(byte) < 0 || dart.notNull(byte) > 255) break;
       i = dart.notNull(i) + 1;
     }
-    dart.throw(new core.ArgumentError.value(bytes, dart.str`Not a byte value at index ${i}: 0x${bytes[dartx.get](i)[dartx.toRadixString](16)}`));
+    dart.throw(new core.ArgumentError.value(bytes, dart.str`Not a byte value at index ${i}: 0x${bytes[dartx._get](i)[dartx.toRadixString](16)}`));
   }
   static writeFinalChunk(alphabet, output, outputIndex, count, bits) {
     dart.assert(dart.notNull(count) > 0);
     if (count == 1) {
-      output[dartx.set]((() => {
+      output[dartx._set]((() => {
         let x = outputIndex;
         outputIndex = dart.notNull(x) + 1;
         return x;
       })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 2 & convert._Base64Encoder._sixBitMask));
-      output[dartx.set]((() => {
+      output[dartx._set]((() => {
         let x = outputIndex;
         outputIndex = dart.notNull(x) + 1;
         return x;
       })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) << 4 & convert._Base64Encoder._sixBitMask));
-      output[dartx.set]((() => {
+      output[dartx._set]((() => {
         let x = outputIndex;
         outputIndex = dart.notNull(x) + 1;
         return x;
       })(), convert._paddingChar);
-      output[dartx.set]((() => {
+      output[dartx._set]((() => {
         let x = outputIndex;
         outputIndex = dart.notNull(x) + 1;
         return x;
       })(), convert._paddingChar);
     } else {
       dart.assert(count == 2);
-      output[dartx.set]((() => {
+      output[dartx._set]((() => {
         let x = outputIndex;
         outputIndex = dart.notNull(x) + 1;
         return x;
       })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 10 & convert._Base64Encoder._sixBitMask));
-      output[dartx.set]((() => {
+      output[dartx._set]((() => {
         let x = outputIndex;
         outputIndex = dart.notNull(x) + 1;
         return x;
       })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 4 & convert._Base64Encoder._sixBitMask));
-      output[dartx.set]((() => {
+      output[dartx._set]((() => {
         let x = outputIndex;
         outputIndex = dart.notNull(x) + 1;
         return x;
       })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) << 2 & convert._Base64Encoder._sixBitMask));
-      output[dartx.set]((() => {
+      output[dartx._set]((() => {
         let x = outputIndex;
         outputIndex = dart.notNull(x) + 1;
         return x;
@@ -29700,23 +30024,23 @@
     for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
       let char = input[dartx.codeUnitAt](i);
       charOr = (dart.notNull(charOr) | dart.notNull(char)) >>> 0;
-      let code = convert._Base64Decoder._inverseAlphabet[dartx.get]((dart.notNull(char) & asciiMask) >>> 0);
+      let code = convert._Base64Decoder._inverseAlphabet[dartx._get]((dart.notNull(char) & asciiMask) >>> 0);
       if (dart.notNull(code) >= 0) {
         bits = (bits[dartx['<<']](bitsPerCharacter) | dart.notNull(code)) & 16777215;
         count = dart.notNull(count) + 1 & 3;
         if (count == 0) {
           dart.assert(dart.notNull(outIndex) + 3 <= dart.notNull(output[dartx.length]));
-          output[dartx.set]((() => {
+          output[dartx._set]((() => {
             let x = outIndex;
             outIndex = dart.notNull(x) + 1;
             return x;
           })(), (bits[dartx['>>']](16) & eightBitMask) >>> 0);
-          output[dartx.set]((() => {
+          output[dartx._set]((() => {
             let x = outIndex;
             outIndex = dart.notNull(x) + 1;
             return x;
           })(), (bits[dartx['>>']](8) & eightBitMask) >>> 0);
-          output[dartx.set]((() => {
+          output[dartx._set]((() => {
             let x = outIndex;
             outIndex = dart.notNull(x) + 1;
             return x;
@@ -29730,12 +30054,12 @@
           if ((dart.notNull(bits) & 3) != 0) {
             dart.throw(new core.FormatException("Invalid encoding before padding", input, i));
           }
-          output[dartx.set]((() => {
+          output[dartx._set]((() => {
             let x = outIndex;
             outIndex = dart.notNull(x) + 1;
             return x;
           })(), bits[dartx['>>']](10));
-          output[dartx.set]((() => {
+          output[dartx._set]((() => {
             let x = outIndex;
             outIndex = dart.notNull(x) + 1;
             return x;
@@ -29744,7 +30068,7 @@
           if ((dart.notNull(bits) & 15) != 0) {
             dart.throw(new core.FormatException("Invalid encoding before padding", input, i));
           }
-          output[dartx.set]((() => {
+          output[dartx._set]((() => {
             let x = outIndex;
             outIndex = dart.notNull(x) + 1;
             return x;
@@ -30296,7 +30620,7 @@
   [_convert](text, start, end) {
     let result = null;
     for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-      let ch = text[dartx.get](i);
+      let ch = text[dartx._get](i);
       let replacement = null;
       switch (ch) {
         case '&':
@@ -30568,14 +30892,14 @@
     }
     dart.fn(addChunk, Uint8ListAndintAndintTovoid());
     convert._JsonUtf8Stringifier.stringify(object, this[_indent], this[_toEncodable], this[_bufferSize], addChunk);
-    if (bytes[dartx.length] == 1) return bytes[dartx.get](0);
+    if (bytes[dartx.length] == 1) return bytes[dartx._get](0);
     let length = 0;
     for (let i = 0; i < dart.notNull(bytes[dartx.length]); i++) {
-      length = dart.notNull(length) + dart.notNull(bytes[dartx.get](i)[dartx.length]);
+      length = dart.notNull(length) + dart.notNull(bytes[dartx._get](i)[dartx.length]);
     }
     let result = typed_data.Uint8List.new(length);
     for (let i = 0, offset = 0; i < dart.notNull(bytes[dartx.length]); i++) {
-      let byteList = bytes[dartx.get](i);
+      let byteList = bytes[dartx._get](i);
       let end = offset + dart.notNull(byteList[dartx.length]);
       result[dartx.setRange](offset, end, byteList);
       offset = end;
@@ -30812,7 +31136,7 @@
   }
   [_checkCycle](object) {
     for (let i = 0; i < dart.notNull(this[_seen][dartx.length]); i++) {
-      if (core.identical(object, this[_seen][dartx.get](i))) {
+      if (core.identical(object, this[_seen][dartx._get](i))) {
         dart.throw(new convert.JsonCyclicError(object));
       }
     }
@@ -30873,10 +31197,10 @@
   writeList(list) {
     this.writeString('[');
     if (dart.notNull(list[dartx.length]) > 0) {
-      this.writeObject(list[dartx.get](0));
+      this.writeObject(list[dartx._get](0));
       for (let i = 1; i < dart.notNull(list[dartx.length]); i++) {
         this.writeString(',');
-        this.writeObject(list[dartx.get](i));
+        this.writeObject(list[dartx._get](i));
       }
     }
     this.writeString(']');
@@ -30893,8 +31217,8 @@
       if (!(typeof key == 'string')) {
         allStringKeys = false;
       }
-      keyValueList[dartx.set](i++, key);
-      keyValueList[dartx.set](i++, value);
+      keyValueList[dartx._set](i++, key);
+      keyValueList[dartx._set](i++, value);
     }, dynamicAnddynamicTovoid()));
     if (!allStringKeys) return false;
     this.writeString('{');
@@ -30902,9 +31226,9 @@
     for (let i = 0; i < dart.notNull(keyValueList[dartx.length]); i = i + 2) {
       this.writeString(separator);
       separator = ',"';
-      this.writeStringContent(core.String._check(keyValueList[dartx.get](i)));
+      this.writeStringContent(core.String._check(keyValueList[dartx._get](i)));
       this.writeString('":');
-      this.writeObject(keyValueList[dartx.get](i + 1));
+      this.writeObject(keyValueList[dartx._get](i + 1));
     }
     this.writeString('}');
     return true;
@@ -30970,11 +31294,11 @@
       this.writeString('[\n');
       this[_indentLevel] = dart.notNull(this[_indentLevel]) + 1;
       this.writeIndentation(this[_indentLevel]);
-      this.writeObject(list[dartx.get](0));
+      this.writeObject(list[dartx._get](0));
       for (let i = 1; i < dart.notNull(list[dartx.length]); i++) {
         this.writeString(',\n');
         this.writeIndentation(this[_indentLevel]);
-        this.writeObject(list[dartx.get](i));
+        this.writeObject(list[dartx._get](i));
       }
       this.writeString('\n');
       this[_indentLevel] = dart.notNull(this[_indentLevel]) - 1;
@@ -30994,8 +31318,8 @@
       if (!(typeof key == 'string')) {
         allStringKeys = false;
       }
-      keyValueList[dartx.set](i++, key);
-      keyValueList[dartx.set](i++, value);
+      keyValueList[dartx._set](i++, key);
+      keyValueList[dartx._set](i++, value);
     }, dynamicAnddynamicTovoid()));
     if (!allStringKeys) return false;
     this.writeString('{\n');
@@ -31006,9 +31330,9 @@
       separator = ",\n";
       this.writeIndentation(this[_indentLevel]);
       this.writeString('"');
-      this.writeStringContent(core.String._check(keyValueList[dartx.get](i)));
+      this.writeStringContent(core.String._check(keyValueList[dartx._get](i)));
       this.writeString('": ');
-      this.writeObject(keyValueList[dartx.get](i + 1));
+      this.writeObject(keyValueList[dartx._get](i + 1));
     }
     this.writeString('\n');
     this[_indentLevel] = dart.notNull(this[_indentLevel]) - 1;
@@ -31180,7 +31504,7 @@
       this.buffer = typed_data.Uint8List.new(this.bufferSize);
       this.index = 0;
     }
-    this.buffer[dartx.set]((() => {
+    this.buffer[dartx._set]((() => {
       let x = this.index;
       this.index = dart.notNull(x) + 1;
       return x;
@@ -31218,7 +31542,7 @@
     let indent = this.indent;
     let indentLength = indent[dartx.length];
     if (indentLength == 1) {
-      let char = indent[dartx.get](0);
+      let char = indent[dartx._get](0);
       while (dart.notNull(count) > 0) {
         this.writeByte(char);
         count = dart.notNull(count) - 1;
@@ -31233,7 +31557,7 @@
         this.index = end;
       } else {
         for (let i = 0; i < dart.notNull(indentLength); i++) {
-          this.writeByte(indent[dartx.get](i));
+          this.writeByte(indent[dartx._get](i));
         }
       }
     }
@@ -31342,7 +31666,7 @@
   static _checkValidLatin1(source, start, end) {
     let mask = 0;
     for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-      mask = (dart.notNull(mask) | dart.notNull(source[dartx.get](i))) >>> 0;
+      mask = (dart.notNull(mask) | dart.notNull(source[dartx._get](i))) >>> 0;
     }
     if (dart.notNull(mask) >= 0 && dart.notNull(mask) <= convert._LATIN1_MASK) {
       return;
@@ -31351,7 +31675,7 @@
   }
   static _reportInvalidLatin1(source, start, end) {
     for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-      let char = source[dartx.get](i);
+      let char = source[dartx._get](i);
       if (dart.notNull(char) < 0 || dart.notNull(char) > convert._LATIN1_MASK) {
         dart.throw(new core.FormatException("Source contains non-Latin-1 characters.", source, i));
       }
@@ -31381,7 +31705,7 @@
   addSlice(source, start, end, isLast) {
     core.RangeError.checkValidRange(start, end, source[dartx.length]);
     for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-      let char = source[dartx.get](i);
+      let char = source[dartx._get](i);
       if (dart.notNull(char) > convert._LATIN1_MASK || dart.notNull(char) < 0) {
         if (dart.notNull(i) > dart.notNull(start)) this[_addSliceToSink](source, start, i, false);
         this[_addSliceToSink](const || (const = dart.constList([65533], core.int)), 0, 1, false);
@@ -31921,39 +32245,39 @@
       let rune = convert._combineSurrogatePair(leadingSurrogate, nextCodeUnit);
       dart.assert(dart.notNull(rune) > convert._THREE_BYTE_LIMIT);
       dart.assert(dart.notNull(rune) <= convert._FOUR_BYTE_LIMIT);
-      this[_buffer][dartx.set]((() => {
+      this[_buffer][dartx._set]((() => {
         let x = this[_bufferIndex];
         this[_bufferIndex] = dart.notNull(x) + 1;
         return x;
       })(), (240 | rune[dartx['>>']](18)) >>> 0);
-      this[_buffer][dartx.set]((() => {
+      this[_buffer][dartx._set]((() => {
         let x = this[_bufferIndex];
         this[_bufferIndex] = dart.notNull(x) + 1;
         return x;
       })(), 128 | dart.notNull(rune) >> 12 & 63);
-      this[_buffer][dartx.set]((() => {
+      this[_buffer][dartx._set]((() => {
         let x = this[_bufferIndex];
         this[_bufferIndex] = dart.notNull(x) + 1;
         return x;
       })(), 128 | dart.notNull(rune) >> 6 & 63);
-      this[_buffer][dartx.set]((() => {
+      this[_buffer][dartx._set]((() => {
         let x = this[_bufferIndex];
         this[_bufferIndex] = dart.notNull(x) + 1;
         return x;
       })(), 128 | dart.notNull(rune) & 63);
       return true;
     } else {
-      this[_buffer][dartx.set]((() => {
+      this[_buffer][dartx._set]((() => {
         let x = this[_bufferIndex];
         this[_bufferIndex] = dart.notNull(x) + 1;
         return x;
       })(), (224 | leadingSurrogate[dartx['>>']](12)) >>> 0);
-      this[_buffer][dartx.set]((() => {
+      this[_buffer][dartx._set]((() => {
         let x = this[_bufferIndex];
         this[_bufferIndex] = dart.notNull(x) + 1;
         return x;
       })(), 128 | dart.notNull(leadingSurrogate) >> 6 & 63);
-      this[_buffer][dartx.set]((() => {
+      this[_buffer][dartx._set]((() => {
         let x = this[_bufferIndex];
         this[_bufferIndex] = dart.notNull(x) + 1;
         return x;
@@ -31970,7 +32294,7 @@
       let codeUnit = str[dartx.codeUnitAt](stringIndex);
       if (dart.notNull(codeUnit) <= convert._ONE_BYTE_LIMIT) {
         if (dart.notNull(this[_bufferIndex]) >= dart.notNull(this[_buffer][dartx.length])) break;
-        this[_buffer][dartx.set]((() => {
+        this[_buffer][dartx._set]((() => {
           let x = this[_bufferIndex];
           this[_bufferIndex] = dart.notNull(x) + 1;
           return x;
@@ -31986,12 +32310,12 @@
         let rune = codeUnit;
         if (dart.notNull(rune) <= convert._TWO_BYTE_LIMIT) {
           if (dart.notNull(this[_bufferIndex]) + 1 >= dart.notNull(this[_buffer][dartx.length])) break;
-          this[_buffer][dartx.set]((() => {
+          this[_buffer][dartx._set]((() => {
             let x = this[_bufferIndex];
             this[_bufferIndex] = dart.notNull(x) + 1;
             return x;
           })(), (192 | rune[dartx['>>']](6)) >>> 0);
-          this[_buffer][dartx.set]((() => {
+          this[_buffer][dartx._set]((() => {
             let x = this[_bufferIndex];
             this[_bufferIndex] = dart.notNull(x) + 1;
             return x;
@@ -31999,17 +32323,17 @@
         } else {
           dart.assert(dart.notNull(rune) <= convert._THREE_BYTE_LIMIT);
           if (dart.notNull(this[_bufferIndex]) + 2 >= dart.notNull(this[_buffer][dartx.length])) break;
-          this[_buffer][dartx.set]((() => {
+          this[_buffer][dartx._set]((() => {
             let x = this[_bufferIndex];
             this[_bufferIndex] = dart.notNull(x) + 1;
             return x;
           })(), (224 | rune[dartx['>>']](12)) >>> 0);
-          this[_buffer][dartx.set]((() => {
+          this[_buffer][dartx._set]((() => {
             let x = this[_bufferIndex];
             this[_bufferIndex] = dart.notNull(x) + 1;
             return x;
           })(), 128 | dart.notNull(rune) >> 6 & 63);
-          this[_buffer][dartx.set]((() => {
+          this[_buffer][dartx._set]((() => {
             let x = this[_bufferIndex];
             this[_bufferIndex] = dart.notNull(x) + 1;
             return x;
@@ -32236,7 +32560,7 @@
               if (i == endIndex) {
                 break loop;
               }
-              let unit = codeUnits[dartx.get](i);
+              let unit = codeUnits[dartx._get](i);
               if ((dart.notNull(unit) & 192) != 128) {
                 expectedUnits = 0;
                 if (!dart.test(this[_allowMalformed])) {
@@ -32251,7 +32575,7 @@
                 i = dart.notNull(i) + 1;
               }
             } while (dart.notNull(expectedUnits) > 0);
-            if (dart.notNull(value) <= dart.notNull(convert._Utf8Decoder._LIMITS[dartx.get](dart.notNull(extraUnits) - 1))) {
+            if (dart.notNull(value) <= dart.notNull(convert._Utf8Decoder._LIMITS[dartx._get](dart.notNull(extraUnits) - 1))) {
               if (!dart.test(this[_allowMalformed])) {
                 dart.throw(new core.FormatException(dart.str`Overlong encoding of 0x${value[dartx.toRadixString](16)}`));
               }
@@ -32277,7 +32601,7 @@
             i = dart.notNull(i) + dart.notNull(oneBytes);
             if (i == endIndex) break;
           }
-          let unit = codeUnits[dartx.get]((() => {
+          let unit = codeUnits[dartx._get]((() => {
             let x = i;
             i = dart.notNull(x) + 1;
             return x;
@@ -32473,23 +32797,23 @@
         return result;
       }
       dart.fn(parseMilliAndMicroseconds, StringToint());
-      let years = core.int.parse(match.get(1));
-      let month = core.int.parse(match.get(2));
-      let day = core.int.parse(match.get(3));
-      let hour = parseIntOrZero(match.get(4));
-      let minute = parseIntOrZero(match.get(5));
-      let second = parseIntOrZero(match.get(6));
+      let years = core.int.parse(match._get(1));
+      let month = core.int.parse(match._get(2));
+      let day = core.int.parse(match._get(3));
+      let hour = parseIntOrZero(match._get(4));
+      let minute = parseIntOrZero(match._get(5));
+      let second = parseIntOrZero(match._get(6));
       let addOneMillisecond = false;
-      let milliAndMicroseconds = parseMilliAndMicroseconds(match.get(7));
+      let milliAndMicroseconds = parseMilliAndMicroseconds(match._get(7));
       let millisecond = (dart.notNull(milliAndMicroseconds) / core.Duration.MICROSECONDS_PER_MILLISECOND)[dartx.truncate]();
       let microsecond = dart.asInt(milliAndMicroseconds[dartx.remainder](core.Duration.MICROSECONDS_PER_MILLISECOND));
       let isUtc = false;
-      if (match.get(8) != null) {
+      if (match._get(8) != null) {
         isUtc = true;
-        if (match.get(9) != null) {
-          let sign = match.get(9) == '-' ? -1 : 1;
-          let hourDifference = core.int.parse(match.get(10));
-          let minuteDifference = parseIntOrZero(match.get(11));
+        if (match._get(9) != null) {
+          let sign = match._get(9) == '-' ? -1 : 1;
+          let hourDifference = core.int.parse(match._get(10));
+          let minuteDifference = parseIntOrZero(match._get(11));
           minuteDifference = dart.notNull(minuteDifference) + 60 * dart.notNull(hourDifference);
           minute = dart.notNull(minute) - sign * dart.notNull(minuteDifference);
         }
@@ -32859,7 +33183,7 @@
     }
     dart.fn(twoDigits, intToString());
     if (dart.notNull(this.inMicroseconds) < 0) {
-      return dart.str`-${this['unary-']()}`;
+      return dart.str`-${this._negate()}`;
     }
     let twoDigitMinutes = twoDigits(dart.asInt(this.inMinutes[dartx.remainder](core.Duration.MINUTES_PER_HOUR)));
     let twoDigitSeconds = twoDigits(dart.asInt(this.inSeconds[dartx.remainder](core.Duration.SECONDS_PER_MINUTE)));
@@ -32872,7 +33196,7 @@
   abs() {
     return new core.Duration._microseconds(this[_duration][dartx.abs]());
   }
-  ['unary-']() {
+  _negate() {
     return new core.Duration._microseconds(-dart.notNull(this[_duration]));
   }
 };
@@ -32904,7 +33228,7 @@
     '>=': dart.definiteFunctionType(core.bool, [core.Duration]),
     compareTo: dart.definiteFunctionType(core.int, [core.Duration]),
     abs: dart.definiteFunctionType(core.Duration, []),
-    'unary-': dart.definiteFunctionType(core.Duration, [])
+    _negate: dart.definiteFunctionType(core.Duration, [])
   }),
   sfields: () => ({
     MICROSECONDS_PER_MILLISECOND: core.int,
@@ -33234,7 +33558,7 @@
         if (i > 0) {
           sb.write(", ");
         }
-        sb.write(core.Error.safeToString(this[_arguments][dartx.get](i)));
+        sb.write(core.Error.safeToString(this[_arguments][dartx._get](i)));
       }
     }
     if (this[_namedArguments] != null) {
@@ -33257,7 +33581,7 @@
         if (i > 0) {
           sb.write(", ");
         }
-        sb.write(this[_existingArgumentNames][dartx.get](i));
+        sb.write(this[_existingArgumentNames][dartx._get](i));
       }
       let formalParameters = sb.toString();
       return "NoSuchMethodError: incorrect number of arguments passed to " + dart.str`method named '${this[_memberName]}'\n` + dart.str`Receiver: ${core.Error.safeToString(this[_receiver])}\n` + dart.str`Tried calling: ${this[_memberName]}(${actualParameters})\n` + dart.str`Found: ${this[_memberName]}(${formalParameters})`;
@@ -33515,11 +33839,11 @@
     toString() {
       return dart.str`Expando:${this.name}`;
     }
-    get(object) {
+    _get(object) {
       let values = _js_helper.Primitives.getProperty(object, core.Expando._EXPANDO_PROPERTY_NAME);
       return T._check(values == null ? null : _js_helper.Primitives.getProperty(values, this[_getKey]()));
     }
-    set(object, value) {
+    _set(object, value) {
       T._check(value);
       let values = _js_helper.Primitives.getProperty(object, core.Expando._EXPANDO_PROPERTY_NAME);
       if (values == null) {
@@ -33547,8 +33871,8 @@
     constructors: () => ({new: dart.definiteFunctionType(core.Expando$(T), [], [core.String])}),
     fields: () => ({name: core.String}),
     methods: () => ({
-      get: dart.definiteFunctionType(T, [core.Object]),
-      set: dart.definiteFunctionType(dart.void, [core.Object, T]),
+      _get: dart.definiteFunctionType(T, [core.Object]),
+      _set: dart.definiteFunctionType(dart.void, [core.Object, T]),
       [_getKey]: dart.definiteFunctionType(core.String, [])
     }),
     sfields: () => ({
@@ -33571,7 +33895,7 @@
   static _toMangledNames(namedArguments) {
     let result = dart.map({}, core.String, dart.dynamic);
     namedArguments[dartx.forEach](dart.fn((symbol, value) => {
-      result[dartx.set](core._symbolToString(symbol), value);
+      result[dartx._set](core._symbolToString(symbol), value);
     }, SymbolAnddynamicTovoid()));
     return result;
   }
@@ -34049,7 +34373,7 @@
   }
   get currentAsString() {
     if (this[_position] == this[_nextPosition]) return null;
-    if (dart.notNull(this[_position]) + 1 == this[_nextPosition]) return this.string[dartx.get](this[_position]);
+    if (dart.notNull(this[_position]) + 1 == this[_nextPosition]) return this.string[dartx._get](this[_position]);
     return this.string[dartx.substring](this[_position], this[_nextPosition]);
   }
   moveNext() {
@@ -34737,7 +35061,7 @@
     if (this[_queryParameterLists] == null) {
       let queryParameterLists = core.Uri._splitQueryStringAll(this.query);
       for (let key of queryParameterLists[dartx.keys]) {
-        queryParameterLists[dartx.set](key, ListOfString().unmodifiable(core.Iterable._check(queryParameterLists[dartx.get](key))));
+        queryParameterLists[dartx._set](key, ListOfString().unmodifiable(core.Iterable._check(queryParameterLists[dartx._get](key))));
       }
       this[_queryParameterLists] = MapOfString$ListOfString().unmodifiable(queryParameterLists);
     }
@@ -34773,7 +35097,7 @@
     return core.Uri._normalizeRegName(host, start, end);
   }
   static _isRegNameChar(char) {
-    return dart.notNull(char) < 127 && (dart.notNull(core.Uri._regNameTable[dartx.get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0;
+    return dart.notNull(char) < 127 && (dart.notNull(core.Uri._regNameTable[dartx._get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0;
   }
   static _normalizeRegName(host, start, end) {
     let buffer = null;
@@ -34968,9 +35292,9 @@
     let codeUnits = null;
     if (dart.notNull(char) < 128) {
       codeUnits = ListOfint().new(3);
-      codeUnits[dartx.set](0, core.Uri._PERCENT);
-      codeUnits[dartx.set](1, core.Uri._hexDigits[dartx.codeUnitAt](char[dartx['>>']](4)));
-      codeUnits[dartx.set](2, core.Uri._hexDigits[dartx.codeUnitAt](dart.notNull(char) & 15));
+      codeUnits[dartx._set](0, core.Uri._PERCENT);
+      codeUnits[dartx._set](1, core.Uri._hexDigits[dartx.codeUnitAt](char[dartx['>>']](4)));
+      codeUnits[dartx._set](2, core.Uri._hexDigits[dartx.codeUnitAt](dart.notNull(char) & 15));
     } else {
       let flag = 192;
       let encodedBytes = 2;
@@ -34986,9 +35310,9 @@
       let index = 0;
       while (--encodedBytes >= 0) {
         let byte = (char[dartx['>>']](6 * encodedBytes) & 63 | flag) >>> 0;
-        codeUnits[dartx.set](index, core.Uri._PERCENT);
-        codeUnits[dartx.set](index + 1, core.Uri._hexDigits[dartx.codeUnitAt](byte[dartx['>>']](4)));
-        codeUnits[dartx.set](index + 2, core.Uri._hexDigits[dartx.codeUnitAt](byte & 15));
+        codeUnits[dartx._set](index, core.Uri._PERCENT);
+        codeUnits[dartx._set](index + 1, core.Uri._hexDigits[dartx.codeUnitAt](byte[dartx['>>']](4)));
+        codeUnits[dartx._set](index + 2, core.Uri._hexDigits[dartx.codeUnitAt](byte & 15));
         index = index + 3;
         flag = 128;
       }
@@ -35001,7 +35325,7 @@
     let index = start;
     while (dart.notNull(index) < dart.notNull(end)) {
       let char = component[dartx.codeUnitAt](index);
-      if (dart.notNull(char) < 127 && (dart.notNull(charTable[dartx.get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0) {
+      if (dart.notNull(char) < 127 && (dart.notNull(charTable[dartx._get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0) {
         index = dart.notNull(index) + 1;
       } else {
         let replacement = null;
@@ -35049,10 +35373,10 @@
     return dart.toString(buffer);
   }
   static _isSchemeCharacter(ch) {
-    return dart.notNull(ch) < 128 && (dart.notNull(core.Uri._schemeTable[dartx.get](ch[dartx['>>']](4))) & 1 << (dart.notNull(ch) & 15)) != 0;
+    return dart.notNull(ch) < 128 && (dart.notNull(core.Uri._schemeTable[dartx._get](ch[dartx['>>']](4))) & 1 << (dart.notNull(ch) & 15)) != 0;
   }
   static _isGeneralDelimiter(ch) {
-    return dart.notNull(ch) <= core.Uri._RIGHT_BRACKET && (dart.notNull(core.Uri._genDelimitersTable[dartx.get](ch[dartx['>>']](4))) & 1 << (dart.notNull(ch) & 15)) != 0;
+    return dart.notNull(ch) <= core.Uri._RIGHT_BRACKET && (dart.notNull(core.Uri._genDelimitersTable[dartx._get](ch[dartx['>>']](4))) & 1 << (dart.notNull(ch) & 15)) != 0;
   }
   get isAbsolute() {
     return this.scheme != "" && this.fragment == "";
@@ -35129,7 +35453,7 @@
         output[dartx.add](segment);
       }
     }
-    if (dart.test(output[dartx.isEmpty]) || output[dartx.length] == 1 && dart.test(output[dartx.get](0)[dartx.isEmpty])) {
+    if (dart.test(output[dartx.isEmpty]) || output[dartx.length] == 1 && dart.test(output[dartx._get](0)[dartx.isEmpty])) {
       return "./";
     }
     if (appendSlash || output[dartx.last] == '..') output[dartx.add]("");
@@ -35259,8 +35583,8 @@
   [_toWindowsFilePath]() {
     let hasDriveLetter = false;
     let segments = this.pathSegments;
-    if (dart.notNull(segments[dartx.length]) > 0 && segments[dartx.get](0)[dartx.length] == 2 && segments[dartx.get](0)[dartx.codeUnitAt](1) == core.Uri._COLON) {
-      core.Uri._checkWindowsDriveLetter(segments[dartx.get](0)[dartx.codeUnitAt](0), false);
+    if (dart.notNull(segments[dartx.length]) > 0 && segments[dartx._get](0)[dartx.length] == 2 && segments[dartx._get](0)[dartx.codeUnitAt](1) == core.Uri._COLON) {
+      core.Uri._checkWindowsDriveLetter(segments[dartx._get](0)[dartx.codeUnitAt](0), false);
       core.Uri._checkWindowsPathReservedCharacters(segments, false, 1);
       hasDriveLetter = true;
     } else {
@@ -35357,12 +35681,12 @@
       let index = element[dartx.indexOf]("=");
       if (index == -1) {
         if (element != "") {
-          map[dartx.set](core.Uri.decodeQueryComponent(element, {encoding: encoding}), "");
+          map[dartx._set](core.Uri.decodeQueryComponent(element, {encoding: encoding}), "");
         }
       } else if (index != 0) {
         let key = element[dartx.substring](0, index);
         let value = element[dartx.substring](dart.notNull(index) + 1);
-        map[dartx.set](core.Uri.decodeQueryComponent(key, {encoding: encoding}), core.Uri.decodeQueryComponent(value, {encoding: encoding}));
+        map[dartx._set](core.Uri.decodeQueryComponent(key, {encoding: encoding}), core.Uri.decodeQueryComponent(value, {encoding: encoding}));
       }
       return map;
     }, MapOfString$StringAndStringToMapOfString$String()));
@@ -35480,8 +35804,8 @@
       } catch (e) {
         try {
           let last = core.Uri.parseIPv4Address(host[dartx.substring](partStart, end));
-          parts[dartx.add]((dart.notNull(last[dartx.get](0)) << 8 | dart.notNull(last[dartx.get](1))) >>> 0);
-          parts[dartx.add]((dart.notNull(last[dartx.get](2)) << 8 | dart.notNull(last[dartx.get](3))) >>> 0);
+          parts[dartx.add]((dart.notNull(last[dartx._get](0)) << 8 | dart.notNull(last[dartx._get](1))) >>> 0);
+          parts[dartx.add]((dart.notNull(last[dartx._get](2)) << 8 | dart.notNull(last[dartx._get](3))) >>> 0);
         } catch (e) {
           error('invalid end of IPv6 address.', partStart);
         }
@@ -35498,17 +35822,17 @@
     }
     let bytes = typed_data.Uint8List.new(16);
     for (let i = 0, index = 0; i < dart.notNull(parts[dartx.length]); i++) {
-      let value = parts[dartx.get](i);
+      let value = parts[dartx._get](i);
       if (value == -1) {
         let wildCardLength = 9 - dart.notNull(parts[dartx.length]);
         for (let j = 0; j < wildCardLength; j++) {
-          bytes[dartx.set](index, 0);
-          bytes[dartx.set](index + 1, 0);
+          bytes[dartx._set](index, 0);
+          bytes[dartx._set](index + 1, 0);
           index = index + 2;
         }
       } else {
-        bytes[dartx.set](index, value[dartx['>>']](8));
-        bytes[dartx.set](index + 1, dart.notNull(value) & 255);
+        bytes[dartx._set](index, value[dartx['>>']](8));
+        bytes[dartx._set](index + 1, dart.notNull(value) & 255);
         index = index + 2;
       }
     }
@@ -35521,16 +35845,16 @@
     let result = new core.StringBuffer();
     let bytes = encoding.encode(text);
     for (let i = 0; i < dart.notNull(bytes[dartx.length]); i++) {
-      let byte = bytes[dartx.get](i);
-      if (dart.notNull(byte) < 128 && (dart.notNull(canonicalTable[dartx.get](byte[dartx['>>']](4))) & 1 << (dart.notNull(byte) & 15)) != 0) {
+      let byte = bytes[dartx._get](i);
+      if (dart.notNull(byte) < 128 && (dart.notNull(canonicalTable[dartx._get](byte[dartx['>>']](4))) & 1 << (dart.notNull(byte) & 15)) != 0) {
         result.writeCharCode(byte);
       } else if (dart.test(spaceToPlus) && byte == core.Uri._SPACE) {
         result.write('+');
       } else {
         let hexDigits = '0123456789ABCDEF';
         result.write('%');
-        result.write(hexDigits[dartx.get](dart.notNull(byte) >> 4 & 15));
-        result.write(hexDigits[dartx.get](dart.notNull(byte) & 15));
+        result.write(hexDigits[dartx._get](dart.notNull(byte) >> 4 & 15));
+        result.write(hexDigits[dartx._get](dart.notNull(byte) & 15));
       }
     }
     return result.toString();
@@ -35599,7 +35923,7 @@
     return core.Uri._LOWER_CASE_A <= lowerCase && lowerCase <= core.Uri._LOWER_CASE_Z;
   }
   static _isUnreservedChar(char) {
-    return dart.notNull(char) < 127 && (dart.notNull(core.Uri._unreservedTable[dartx.get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0;
+    return dart.notNull(char) < 127 && (dart.notNull(core.Uri._unreservedTable[dartx._get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0;
   }
 };
 dart.defineNamedConstructor(core.Uri, '_internal');
@@ -35817,7 +36141,7 @@
     let indices = JSArrayOfint().of([core.UriData._noScheme]);
     let charsetName = null;
     let encodingName = null;
-    if (parameters != null) charsetName = parameters[dartx.get]("charset");
+    if (parameters != null) charsetName = parameters[dartx._get]("charset");
     if (encoding == null) {
       if (charsetName != null) {
         encoding = convert.Encoding.getByName(charsetName);
@@ -35832,7 +36156,7 @@
     if (dart.test(base64)) {
       buffer.write(';base64,');
       indices[dartx.add](dart.notNull(buffer.length) - 1);
-      buffer.write(encoding.fuse(convert.BASE64).encode(content));
+      buffer.write(encoding.fuse(core.String)(convert.BASE64).encode(content));
     } else {
       buffer.write(',');
       core.UriData._uriEncodeBytes(core.UriData._uricTable, encoding.encode(content), buffer);
@@ -35933,7 +36257,7 @@
     if (this[_uriCache] != null) return this[_uriCache];
     let path = this[_text];
     let query = null;
-    let colonIndex = this[_separatorIndices][dartx.get](0);
+    let colonIndex = this[_separatorIndices][dartx._get](0);
     let queryIndex = this[_text][dartx.indexOf]('?', dart.notNull(colonIndex) + 1);
     let end = null;
     if (dart.notNull(queryIndex) >= 0) {
@@ -35945,8 +36269,8 @@
     return this[_uriCache];
   }
   get mimeType() {
-    let start = dart.notNull(this[_separatorIndices][dartx.get](0)) + 1;
-    let end = this[_separatorIndices][dartx.get](1);
+    let start = dart.notNull(this[_separatorIndices][dartx._get](0)) + 1;
+    let end = this[_separatorIndices][dartx._get](1);
     if (start == end) return "text/plain";
     return core.Uri._uriDecode(this[_text], start, end, convert.UTF8, false);
   }
@@ -35957,10 +36281,10 @@
       parameterEnd = parameterEnd - 1;
     }
     for (let i = parameterStart; i < parameterEnd; i = i + 2) {
-      let keyStart = dart.notNull(this[_separatorIndices][dartx.get](i)) + 1;
-      let keyEnd = this[_separatorIndices][dartx.get](i + 1);
+      let keyStart = dart.notNull(this[_separatorIndices][dartx._get](i)) + 1;
+      let keyEnd = this[_separatorIndices][dartx._get](i + 1);
       if (keyEnd == keyStart + 7 && dart.test(this[_text][dartx.startsWith]("charset", keyStart))) {
-        return core.Uri._uriDecode(this[_text], dart.notNull(keyEnd) + 1, this[_separatorIndices][dartx.get](i + 2), convert.UTF8, false);
+        return core.Uri._uriDecode(this[_text], dart.notNull(keyEnd) + 1, this[_separatorIndices][dartx._get](i + 2), convert.UTF8, false);
       }
     }
     return "US-ASCII";
@@ -35995,14 +36319,14 @@
     for (let i = start; i < dart.notNull(text[dartx.length]); i++) {
       let codeUnit = text[dartx.codeUnitAt](i);
       if (codeUnit != percent) {
-        result[dartx.set](index++, codeUnit);
+        result[dartx._set](index++, codeUnit);
       } else {
         if (i + 2 < dart.notNull(text[dartx.length])) {
           let digit1 = core.Uri._parseHexDigit(text[dartx.codeUnitAt](i + 1));
           let digit2 = core.Uri._parseHexDigit(text[dartx.codeUnitAt](i + 2));
           if (dart.notNull(digit1) >= 0 && dart.notNull(digit2) >= 0) {
             let byte = dart.notNull(digit1) * 16 + dart.notNull(digit2);
-            result[dartx.set](index++, byte);
+            result[dartx._set](index++, byte);
             i = i + 2;
             continue;
           }
@@ -36033,12 +36357,12 @@
   get parameters() {
     let result = dart.map({}, core.String, core.String);
     for (let i = 3; i < dart.notNull(this[_separatorIndices][dartx.length]); i = i + 2) {
-      let start = dart.notNull(this[_separatorIndices][dartx.get](i - 2)) + 1;
-      let equals = this[_separatorIndices][dartx.get](i - 1);
-      let end = this[_separatorIndices][dartx.get](i);
+      let start = dart.notNull(this[_separatorIndices][dartx._get](i - 2)) + 1;
+      let equals = this[_separatorIndices][dartx._get](i - 1);
+      let end = this[_separatorIndices][dartx._get](i);
       let key = core.Uri._uriDecode(this[_text], start, equals, convert.UTF8, false);
       let value = core.Uri._uriDecode(this[_text], dart.notNull(equals) + 1, end, convert.UTF8, false);
-      result[dartx.set](key, value);
+      result[dartx._set](key, value);
     }
     return result;
   }
@@ -36095,9 +36419,9 @@
   static _uriEncodeBytes(canonicalTable, bytes, buffer) {
     let byteOr = 0;
     for (let i = 0; i < dart.notNull(bytes[dartx.length]); i++) {
-      let byte = bytes[dartx.get](i);
+      let byte = bytes[dartx._get](i);
       byteOr = (dart.notNull(byteOr) | dart.notNull(byte)) >>> 0;
-      if (dart.notNull(byte) < 128 && (dart.notNull(canonicalTable[dartx.get](byte[dartx['>>']](4))) & 1 << (dart.notNull(byte) & 15)) != 0) {
+      if (dart.notNull(byte) < 128 && (dart.notNull(canonicalTable[dartx._get](byte[dartx['>>']](4))) & 1 << (dart.notNull(byte) & 15)) != 0) {
         buffer.writeCharCode(byte);
       } else {
         buffer.writeCharCode(core.Uri._PERCENT);
@@ -36107,7 +36431,7 @@
     }
     if ((dart.notNull(byteOr) & ~255) != 0) {
       for (let i = 0; i < dart.notNull(bytes[dartx.length]); i++) {
-        let byte = bytes[dartx.get](i);
+        let byte = bytes[dartx._get](i);
         if (dart.notNull(byte) < 0 || dart.notNull(byte) > 255) {
           dart.throw(new core.ArgumentError.value(byte, "non-byte value"));
         }
@@ -36115,7 +36439,7 @@
     }
   }
   toString() {
-    return this[_separatorIndices][dartx.get](0) == core.UriData._noScheme ? dart.str`data:${this[_text]}` : this[_text];
+    return this[_separatorIndices][dartx._get](0) == core.UriData._noScheme ? dart.str`data:${this[_text]}` : this[_text];
   }
 };
 dart.defineNamedConstructor(core.UriData, '_');
@@ -36160,6 +36484,741 @@
 core.UriData._noScheme = -1;
 core.UriData._tokenCharTable = dart.constList([0, 0, 27858, 1023, 65534, 51199, 65535, 32767], core.int);
 core.UriData._uricTable = core.Uri._queryCharTable;
+developer.debugger = function(opts) {
+  let when = opts && 'when' in opts ? opts.when : true;
+  let message = opts && 'message' in opts ? opts.message : null;
+  if (dart.test(when)) {
+    debugger;
+  }
+  return when;
+};
+dart.fn(developer.debugger, __Tobool());
+developer.inspect = function(object) {
+  return object;
+};
+dart.fn(developer.inspect, ObjectToObject());
+developer.log = function(message, opts) {
+  let time = opts && 'time' in opts ? opts.time : null;
+  let sequenceNumber = opts && 'sequenceNumber' in opts ? opts.sequenceNumber : null;
+  let level = opts && 'level' in opts ? opts.level : 0;
+  let name = opts && 'name' in opts ? opts.name : '';
+  let zone = opts && 'zone' in opts ? opts.zone : null;
+  let error = opts && 'error' in opts ? opts.error : null;
+  let stackTrace = opts && 'stackTrace' in opts ? opts.stackTrace : null;
+};
+dart.fn(developer.log, String__Tovoid());
+dart.defineLazy(developer, {
+  get _extensions() {
+    return MapOfString$ServiceExtensionHandler().new();
+  }
+});
+developer._clockValue = 0;
+const _result = Symbol('_result');
+const _errorCode = Symbol('_errorCode');
+const _errorDetail = Symbol('_errorDetail');
+const _isError = Symbol('_isError');
+const _toString = Symbol('_toString');
+developer.ServiceExtensionResponse = class ServiceExtensionResponse extends core.Object {
+  result(result) {
+    this[_result] = result;
+    this[_errorCode] = null;
+    this[_errorDetail] = null;
+    if (!(typeof this[_result] == 'string')) {
+      dart.throw(new core.ArgumentError.value(this[_result], "result", "Must be a String"));
+    }
+  }
+  error(errorCode, errorDetail) {
+    this[_result] = null;
+    this[_errorCode] = errorCode;
+    this[_errorDetail] = errorDetail;
+    developer.ServiceExtensionResponse._validateErrorCode(this[_errorCode]);
+    if (!(typeof this[_errorDetail] == 'string')) {
+      dart.throw(new core.ArgumentError.value(this[_errorDetail], "errorDetail", "Must be a String"));
+    }
+  }
+  static _errorCodeMessage(errorCode) {
+    developer.ServiceExtensionResponse._validateErrorCode(errorCode);
+    if (errorCode == developer.ServiceExtensionResponse.kInvalidParams) {
+      return "Invalid params";
+    }
+    return "Server error";
+  }
+  static _validateErrorCode(errorCode) {
+    if (!(typeof errorCode == 'number')) {
+      dart.throw(new core.ArgumentError.value(errorCode, "errorCode", "Must be an int"));
+    }
+    if (errorCode == developer.ServiceExtensionResponse.invalidParams) {
+      return;
+    }
+    if (dart.notNull(errorCode) >= developer.ServiceExtensionResponse.extensionErrorMin && dart.notNull(errorCode) <= developer.ServiceExtensionResponse.extensionErrorMax) {
+      return;
+    }
+    dart.throw(new core.ArgumentError.value(errorCode, "errorCode", "Out of range"));
+  }
+  [_isError]() {
+    return this[_errorCode] != null && this[_errorDetail] != null;
+  }
+  [_toString]() {
+    if (this[_result] != null) {
+      return this[_result];
+    } else {
+      dart.assert(this[_errorCode] != null);
+      dart.assert(this[_errorDetail] != null);
+      return convert.JSON.encode(dart.map({code: this[_errorCode], message: developer.ServiceExtensionResponse._errorCodeMessage(this[_errorCode]), data: dart.map({details: this[_errorDetail]}, core.String, core.String)}, core.String, core.Object));
+    }
+  }
+};
+dart.defineNamedConstructor(developer.ServiceExtensionResponse, 'result');
+dart.defineNamedConstructor(developer.ServiceExtensionResponse, 'error');
+dart.setSignature(developer.ServiceExtensionResponse, {
+  constructors: () => ({
+    result: dart.definiteFunctionType(developer.ServiceExtensionResponse, [core.String]),
+    error: dart.definiteFunctionType(developer.ServiceExtensionResponse, [core.int, core.String])
+  }),
+  fields: () => ({
+    [_result]: core.String,
+    [_errorCode]: core.int,
+    [_errorDetail]: core.String
+  }),
+  methods: () => ({
+    [_isError]: dart.definiteFunctionType(core.bool, []),
+    [_toString]: dart.definiteFunctionType(core.String, [])
+  }),
+  sfields: () => ({
+    kInvalidParams: core.int,
+    kExtensionError: core.int,
+    kExtensionErrorMax: core.int,
+    kExtensionErrorMin: core.int,
+    invalidParams: core.int,
+    extensionError: core.int,
+    extensionErrorMax: core.int,
+    extensionErrorMin: core.int
+  }),
+  statics: () => ({
+    _errorCodeMessage: dart.definiteFunctionType(core.String, [core.int]),
+    _validateErrorCode: dart.definiteFunctionType(dart.dynamic, [core.int])
+  }),
+  names: ['_errorCodeMessage', '_validateErrorCode']
+});
+developer.ServiceExtensionResponse.invalidParams = -32602;
+developer.ServiceExtensionResponse.extensionError = -32000;
+developer.ServiceExtensionResponse.extensionErrorMax = -32000;
+developer.ServiceExtensionResponse.extensionErrorMin = -32016;
+dart.defineLazy(developer.ServiceExtensionResponse, {
+  get kInvalidParams() {
+    return developer.ServiceExtensionResponse.invalidParams;
+  },
+  get kExtensionError() {
+    return developer.ServiceExtensionResponse.extensionError;
+  },
+  get kExtensionErrorMax() {
+    return developer.ServiceExtensionResponse.extensionErrorMax;
+  },
+  get kExtensionErrorMin() {
+    return developer.ServiceExtensionResponse.extensionErrorMin;
+  }
+});
+developer.ServiceExtensionHandler = dart.typedef('ServiceExtensionHandler', () => dart.functionType(async.Future$(developer.ServiceExtensionResponse), [core.String, MapOfString$String()]));
+developer.registerExtension = function(method, handler) {
+  if (!(typeof method == 'string')) {
+    dart.throw(new core.ArgumentError.value(method, 'method', 'Must be a String'));
+  }
+  if (!dart.test(method[dartx.startsWith]('ext.'))) {
+    dart.throw(new core.ArgumentError.value(method, 'method', 'Must begin with ext.'));
+  }
+  if (developer._lookupExtension(method) != null) {
+    dart.throw(new core.ArgumentError(dart.str`Extension already registered: ${method}`));
+  }
+  if (!developer.ServiceExtensionHandler.is(handler)) {
+    dart.throw(new core.ArgumentError.value(handler, 'handler', 'Must be a ServiceExtensionHandler'));
+  }
+  developer._registerExtension(method, handler);
+};
+dart.fn(developer.registerExtension, StringAndServiceExtensionHandlerTovoid());
+developer.postEvent = function(eventKind, eventData) {
+  if (!(typeof eventKind == 'string')) {
+    dart.throw(new core.ArgumentError.value(eventKind, 'eventKind', 'Must be a String'));
+  }
+  if (!core.Map.is(eventData)) {
+    dart.throw(new core.ArgumentError.value(eventData, 'eventData', 'Must be a Map'));
+  }
+  let eventDataAsString = convert.JSON.encode(eventData);
+  developer._postEvent(eventKind, eventDataAsString);
+};
+dart.fn(developer.postEvent, StringAndMapTovoid());
+developer._postEvent = function(eventKind, eventData) {
+};
+dart.fn(developer._postEvent, StringAndStringTodynamic());
+developer._lookupExtension = function(method) {
+  return developer._extensions[dartx._get](method);
+};
+dart.fn(developer._lookupExtension, StringToServiceExtensionHandler());
+developer._registerExtension = function(method, handler) {
+  developer._extensions[dartx._set](method, handler);
+};
+dart.fn(developer._registerExtension, StringAndServiceExtensionHandlerTodynamic());
+developer.UserTag = class UserTag extends core.Object {
+  static new(label) {
+    return developer._FakeUserTag.new(label);
+  }
+  static get defaultTag() {
+    return developer._FakeUserTag._defaultTag;
+  }
+};
+dart.setSignature(developer.UserTag, {
+  constructors: () => ({new: dart.definiteFunctionType(developer.UserTag, [core.String])}),
+  sfields: () => ({MAX_USER_TAGS: core.int}),
+  sgetters: () => ({defaultTag: dart.definiteFunctionType(developer.UserTag, [])})
+});
+developer.UserTag.MAX_USER_TAGS = 64;
+developer._FakeUserTag = class _FakeUserTag extends core.Object {
+  real(label) {
+    this.label = label;
+  }
+  static new(label) {
+    let existingTag = developer._FakeUserTag._instances[dartx._get](label);
+    if (existingTag != null) {
+      return developer._FakeUserTag._check(existingTag);
+    }
+    if (developer._FakeUserTag._instances[dartx.length] == developer.UserTag.MAX_USER_TAGS) {
+      dart.throw(new core.UnsupportedError(dart.str`UserTag instance limit (${developer.UserTag.MAX_USER_TAGS}) reached.`));
+    }
+    let instance = new developer._FakeUserTag.real(label);
+    developer._FakeUserTag._instances[dartx._set](label, instance);
+    return instance;
+  }
+  makeCurrent() {
+    let old = developer._currentTag;
+    developer._currentTag = this;
+    return old;
+  }
+};
+dart.defineNamedConstructor(developer._FakeUserTag, 'real');
+developer._FakeUserTag[dart.implements] = () => [developer.UserTag];
+dart.setSignature(developer._FakeUserTag, {
+  constructors: () => ({
+    real: dart.definiteFunctionType(developer._FakeUserTag, [core.String]),
+    new: dart.definiteFunctionType(developer._FakeUserTag, [core.String])
+  }),
+  fields: () => ({label: core.String}),
+  methods: () => ({makeCurrent: dart.definiteFunctionType(developer.UserTag, [])}),
+  sfields: () => ({
+    _instances: core.Map,
+    _defaultTag: developer.UserTag
+  })
+});
+dart.defineLazy(developer._FakeUserTag, {
+  get _instances() {
+    return dart.map();
+  },
+  set _instances(_) {},
+  get _defaultTag() {
+    return developer._FakeUserTag.new('Default');
+  }
+});
+dart.defineLazy(developer, {
+  get _currentTag() {
+    return developer._FakeUserTag._defaultTag;
+  },
+  set _currentTag(_) {}
+});
+developer.getCurrentTag = function() {
+  return developer._currentTag;
+};
+dart.fn(developer.getCurrentTag, VoidToUserTag());
+developer.Metric = class Metric extends core.Object {
+  new(name, description) {
+    this.name = name;
+    this.description = description;
+    if (this.name == 'vm' || dart.test(this.name[dartx.contains]('/'))) {
+      dart.throw(new core.ArgumentError('Invalid Metric name.'));
+    }
+  }
+};
+dart.setSignature(developer.Metric, {
+  constructors: () => ({new: dart.definiteFunctionType(developer.Metric, [core.String, core.String])}),
+  fields: () => ({
+    name: core.String,
+    description: core.String
+  })
+});
+const _value = Symbol('_value');
+const _toJSON = Symbol('_toJSON');
+developer.Gauge = class Gauge extends developer.Metric {
+  get value() {
+    return this[_value];
+  }
+  set value(v) {
+    if (dart.notNull(v) < dart.notNull(this.min)) {
+      v = this.min;
+    } else if (dart.notNull(v) > dart.notNull(this.max)) {
+      v = this.max;
+    }
+    this[_value] = v;
+  }
+  new(name, description, min, max) {
+    this.min = min;
+    this.max = max;
+    this[_value] = null;
+    super.new(name, description);
+    if (!(typeof this.min == 'number')) {
+      dart.throw(new core.ArgumentError('min must be a double'));
+    }
+    if (!(typeof this.max == 'number')) {
+      dart.throw(new core.ArgumentError('max must be a double'));
+    }
+    if (!(dart.notNull(this.min) < dart.notNull(this.max))) {
+      dart.throw(new core.ArgumentError('min must be less than max'));
+    }
+    this[_value] = this.min;
+  }
+  [_toJSON]() {
+    let map = dart.map({type: 'Gauge', id: dart.str`metrics/${this.name}`, name: this.name, description: this.description, value: this.value, min: this.min, max: this.max}, core.String, core.Object);
+    return map;
+  }
+};
+dart.setSignature(developer.Gauge, {
+  constructors: () => ({new: dart.definiteFunctionType(developer.Gauge, [core.String, core.String, core.double, core.double])}),
+  fields: () => ({
+    min: core.double,
+    max: core.double,
+    [_value]: core.double
+  }),
+  getters: () => ({value: dart.definiteFunctionType(core.double, [])}),
+  setters: () => ({value: dart.definiteFunctionType(dart.void, [core.double])}),
+  methods: () => ({[_toJSON]: dart.definiteFunctionType(core.Map, [])})
+});
+developer.Counter = class Counter extends developer.Metric {
+  new(name, description) {
+    this[_value] = 0.0;
+    super.new(name, description);
+  }
+  get value() {
+    return this[_value];
+  }
+  set value(v) {
+    this[_value] = v;
+  }
+  [_toJSON]() {
+    let map = dart.map({type: 'Counter', id: dart.str`metrics/${this.name}`, name: this.name, description: this.description, value: this.value}, core.String, core.Object);
+    return map;
+  }
+};
+dart.setSignature(developer.Counter, {
+  constructors: () => ({new: dart.definiteFunctionType(developer.Counter, [core.String, core.String])}),
+  fields: () => ({[_value]: core.double}),
+  getters: () => ({value: dart.definiteFunctionType(core.double, [])}),
+  setters: () => ({value: dart.definiteFunctionType(dart.void, [core.double])}),
+  methods: () => ({[_toJSON]: dart.definiteFunctionType(core.Map, [])})
+});
+developer.Metrics = class Metrics extends core.Object {
+  static register(metric) {
+    if (!developer.Metric.is(metric)) {
+      dart.throw(new core.ArgumentError('metric must be a Metric'));
+    }
+    if (developer.Metrics._metrics[dartx._get](metric.name) != null) {
+      dart.throw(new core.ArgumentError('Registered metrics have unique names'));
+    }
+    developer.Metrics._metrics[dartx._set](metric.name, metric);
+  }
+  static deregister(metric) {
+    if (!developer.Metric.is(metric)) {
+      dart.throw(new core.ArgumentError('metric must be a Metric'));
+    }
+    developer.Metrics._metrics[dartx.remove](metric.name);
+  }
+  static _printMetric(id) {
+    let metric = developer.Metrics._metrics[dartx._get](id);
+    if (metric == null) {
+      return null;
+    }
+    return convert.JSON.encode(metric[_toJSON]());
+  }
+  static _printMetrics() {
+    let metrics = [];
+    for (let metric of developer.Metrics._metrics[dartx.values]) {
+      metrics[dartx.add](metric[_toJSON]());
+    }
+    let map = dart.map({type: 'MetricList', metrics: metrics}, core.String, core.Object);
+    return convert.JSON.encode(map);
+  }
+};
+dart.setSignature(developer.Metrics, {
+  sfields: () => ({_metrics: MapOfString$Metric()}),
+  statics: () => ({
+    register: dart.definiteFunctionType(dart.void, [developer.Metric]),
+    deregister: dart.definiteFunctionType(dart.void, [developer.Metric]),
+    _printMetric: dart.definiteFunctionType(core.String, [core.String]),
+    _printMetrics: dart.definiteFunctionType(core.String, [])
+  }),
+  names: ['register', 'deregister', '_printMetric', '_printMetrics']
+});
+dart.defineLazy(developer.Metrics, {
+  get _metrics() {
+    return MapOfString$Metric().new();
+  }
+});
+developer._isProduct = false;
+developer.TimelineSyncFunction = dart.typedef('TimelineSyncFunction', () => dart.functionType(dart.dynamic, []));
+developer.TimelineAsyncFunction = dart.typedef('TimelineAsyncFunction', () => dart.functionType(async.Future, []));
+const _appendArguments = Symbol('_appendArguments');
+developer.Timeline = class Timeline extends core.Object {
+  static startSync(name, opts) {
+    let arguments$ = opts && 'arguments' in opts ? opts.arguments : null;
+    if (developer._isProduct) {
+      return;
+    }
+    if (!(typeof name == 'string')) {
+      dart.throw(new core.ArgumentError.value(name, 'name', 'Must be a String'));
+    }
+    if (!dart.test(developer._isDartStreamEnabled())) {
+      developer.Timeline._stack[dartx.add](null);
+      return;
+    }
+    let block = new developer._SyncBlock._(name, developer._getTraceClock(), developer._getThreadCpuClock());
+    if (core.Map.is(arguments$)) {
+      block[_appendArguments](arguments$);
+    }
+    developer.Timeline._stack[dartx.add](block);
+  }
+  static finishSync() {
+    if (developer._isProduct) {
+      return;
+    }
+    if (developer.Timeline._stack[dartx.length] == 0) {
+      dart.throw(new core.StateError('Uneven calls to startSync and finishSync'));
+    }
+    let block = developer.Timeline._stack[dartx.removeLast]();
+    if (block == null) {
+      return;
+    }
+    block.finish();
+  }
+  static instantSync(name, opts) {
+    let arguments$ = opts && 'arguments' in opts ? opts.arguments : null;
+    if (developer._isProduct) {
+      return;
+    }
+    if (!(typeof name == 'string')) {
+      dart.throw(new core.ArgumentError.value(name, 'name', 'Must be a String'));
+    }
+    if (!dart.test(developer._isDartStreamEnabled())) {
+      return;
+    }
+    let instantArguments = null;
+    if (core.Map.is(arguments$)) {
+      instantArguments = core.Map.from(arguments$);
+    }
+    developer._reportInstantEvent(developer._getTraceClock(), 'Dart', name, developer._argumentsAsJson(instantArguments));
+  }
+  static timeSync(name, func, opts) {
+    let arguments$ = opts && 'arguments' in opts ? opts.arguments : null;
+    developer.Timeline.startSync(name, {arguments: arguments$});
+    try {
+      return func();
+    } finally {
+      developer.Timeline.finishSync();
+    }
+  }
+  static get now() {
+    return developer._getTraceClock();
+  }
+};
+dart.setSignature(developer.Timeline, {
+  sfields: () => ({
+    _stack: ListOf_SyncBlock(),
+    _isolateId: core.int,
+    _isolateIdString: core.String
+  }),
+  sgetters: () => ({now: dart.definiteFunctionType(core.int, [])}),
+  statics: () => ({
+    startSync: dart.definiteFunctionType(dart.void, [core.String], {arguments: core.Map}),
+    finishSync: dart.definiteFunctionType(dart.void, []),
+    instantSync: dart.definiteFunctionType(dart.void, [core.String], {arguments: core.Map}),
+    timeSync: dart.definiteFunctionType(dart.dynamic, [core.String, developer.TimelineSyncFunction], {arguments: core.Map})
+  }),
+  names: ['startSync', 'finishSync', 'instantSync', 'timeSync']
+});
+dart.defineLazy(developer.Timeline, {
+  get _stack() {
+    return ListOf_SyncBlock().new();
+  },
+  get _isolateId() {
+    return developer._getIsolateNum();
+  },
+  get _isolateIdString() {
+    return dart.toString(developer.Timeline._isolateId);
+  }
+});
+const _stack = Symbol('_stack');
+const _taskId = Symbol('_taskId');
+const _start = Symbol('_start');
+const _finish = Symbol('_finish');
+developer.TimelineTask = class TimelineTask extends core.Object {
+  new() {
+    this[_stack] = JSArrayOf_AsyncBlock().of([]);
+    this[_taskId] = developer._getNextAsyncId();
+  }
+  withTaskId(taskId) {
+    this[_stack] = JSArrayOf_AsyncBlock().of([]);
+    this[_taskId] = taskId;
+    if (!(typeof taskId == 'number')) {
+      dart.throw(new core.ArgumentError.value(taskId, 'taskId', 'Must be an int'));
+    }
+  }
+  start(name, opts) {
+    let arguments$ = opts && 'arguments' in opts ? opts.arguments : null;
+    if (developer._isProduct) {
+      return;
+    }
+    if (!(typeof name == 'string')) {
+      dart.throw(new core.ArgumentError.value(name, 'name', 'Must be a String'));
+    }
+    let block = new developer._AsyncBlock._(name, this[_taskId]);
+    if (core.Map.is(arguments$)) {
+      block[_appendArguments](arguments$);
+    }
+    this[_stack][dartx.add](block);
+    block[_start]();
+  }
+  instant(name, opts) {
+    let arguments$ = opts && 'arguments' in opts ? opts.arguments : null;
+    if (developer._isProduct) {
+      return;
+    }
+    if (!(typeof name == 'string')) {
+      dart.throw(new core.ArgumentError.value(name, 'name', 'Must be a String'));
+    }
+    let instantArguments = null;
+    if (core.Map.is(arguments$)) {
+      instantArguments = core.Map.from(arguments$);
+    }
+    developer._reportTaskEvent(developer._getTraceClock(), this[_taskId], 'n', 'Dart', name, developer._argumentsAsJson(instantArguments));
+  }
+  finish() {
+    if (developer._isProduct) {
+      return;
+    }
+    if (this[_stack][dartx.length] == 0) {
+      dart.throw(new core.StateError('Uneven calls to start and finish'));
+    }
+    let block = this[_stack][dartx.removeLast]();
+    block[_finish]();
+  }
+  pass() {
+    if (dart.notNull(this[_stack][dartx.length]) > 0) {
+      dart.throw(new core.StateError('You cannot pass a TimelineTask without finishing all started ' + 'operations'));
+    }
+    let r = this[_taskId];
+    return r;
+  }
+};
+dart.defineNamedConstructor(developer.TimelineTask, 'withTaskId');
+dart.setSignature(developer.TimelineTask, {
+  constructors: () => ({
+    new: dart.definiteFunctionType(developer.TimelineTask, []),
+    withTaskId: dart.definiteFunctionType(developer.TimelineTask, [core.int])
+  }),
+  fields: () => ({
+    [_taskId]: core.int,
+    [_stack]: ListOf_AsyncBlock()
+  }),
+  methods: () => ({
+    start: dart.definiteFunctionType(dart.void, [core.String], {arguments: core.Map}),
+    instant: dart.definiteFunctionType(dart.void, [core.String], {arguments: core.Map}),
+    finish: dart.definiteFunctionType(dart.void, []),
+    pass: dart.definiteFunctionType(core.int, [])
+  })
+});
+const _arguments = Symbol('_arguments');
+developer._AsyncBlock = class _AsyncBlock extends core.Object {
+  _(name, taskId) {
+    this.name = name;
+    this[_taskId] = taskId;
+    this.category = 'Dart';
+    this[_arguments] = null;
+  }
+  [_start]() {
+    developer._reportTaskEvent(developer._getTraceClock(), this[_taskId], 'b', this.category, this.name, developer._argumentsAsJson(this[_arguments]));
+  }
+  [_finish]() {
+    developer._reportTaskEvent(developer._getTraceClock(), this[_taskId], 'e', this.category, this.name, developer._argumentsAsJson(null));
+  }
+  [_appendArguments](arguments$) {
+    if (this[_arguments] == null) {
+      this[_arguments] = dart.map();
+    }
+    this[_arguments][dartx.addAll](arguments$);
+  }
+};
+dart.defineNamedConstructor(developer._AsyncBlock, '_');
+dart.setSignature(developer._AsyncBlock, {
+  constructors: () => ({_: dart.definiteFunctionType(developer._AsyncBlock, [core.String, core.int])}),
+  fields: () => ({
+    category: core.String,
+    name: core.String,
+    [_taskId]: core.int,
+    [_arguments]: core.Map
+  }),
+  methods: () => ({
+    [_start]: dart.definiteFunctionType(dart.void, []),
+    [_finish]: dart.definiteFunctionType(dart.void, []),
+    [_appendArguments]: dart.definiteFunctionType(dart.void, [core.Map])
+  })
+});
+const _startCpu = Symbol('_startCpu');
+developer._SyncBlock = class _SyncBlock extends core.Object {
+  _(name, start, startCpu) {
+    this.name = name;
+    this[_start] = start;
+    this[_startCpu] = startCpu;
+    this.category = 'Dart';
+    this[_arguments] = null;
+  }
+  finish() {
+    developer._reportCompleteEvent(this[_start], this[_startCpu], this.category, this.name, developer._argumentsAsJson(this[_arguments]));
+  }
+  [_appendArguments](arguments$) {
+    if (arguments$ == null) {
+      return;
+    }
+    if (this[_arguments] == null) {
+      this[_arguments] = dart.map();
+    }
+    this[_arguments][dartx.addAll](arguments$);
+  }
+};
+dart.defineNamedConstructor(developer._SyncBlock, '_');
+dart.setSignature(developer._SyncBlock, {
+  constructors: () => ({_: dart.definiteFunctionType(developer._SyncBlock, [core.String, core.int, core.int])}),
+  fields: () => ({
+    category: core.String,
+    name: core.String,
+    [_arguments]: core.Map,
+    [_start]: core.int,
+    [_startCpu]: core.int
+  }),
+  methods: () => ({
+    finish: dart.definiteFunctionType(dart.void, []),
+    [_appendArguments]: dart.definiteFunctionType(dart.void, [core.Map])
+  })
+});
+developer._fastPathArguments = null;
+developer._argumentsAsJson = function(arguments$) {
+  if (arguments$ == null || arguments$[dartx.length] == 0) {
+    if (developer._fastPathArguments == null) {
+      developer._fastPathArguments = dart.str`{"isolateNumber":"${developer.Timeline._isolateId}"}`;
+    }
+    return developer._fastPathArguments;
+  }
+  arguments$[dartx._set]('isolateNumber', developer.Timeline._isolateIdString);
+  return convert.JSON.encode(arguments$);
+};
+dart.fn(developer._argumentsAsJson, MapToString());
+developer._isDartStreamEnabled = function() {
+  return false;
+};
+dart.fn(developer._isDartStreamEnabled, VoidTobool());
+developer._getNextAsyncId = function() {
+  return 0;
+};
+dart.fn(developer._getNextAsyncId, VoidToint());
+developer._getTraceClock = function() {
+  let x = developer._clockValue;
+  developer._clockValue = dart.notNull(x) + 1;
+  return x;
+};
+dart.fn(developer._getTraceClock, VoidToint());
+developer._getThreadCpuClock = function() {
+  return -1;
+};
+dart.fn(developer._getThreadCpuClock, VoidToint());
+developer._getIsolateNum = function() {
+  return 0;
+};
+dart.fn(developer._getIsolateNum, VoidToint());
+developer._reportTaskEvent = function(start, taskId, phase, category, name, argumentsAsJson) {
+};
+dart.fn(developer._reportTaskEvent, intAndintAndString__Tovoid());
+developer._reportCompleteEvent = function(start, startCpu, category, name, argumentsAsJson) {
+};
+dart.fn(developer._reportCompleteEvent, intAndintAndString__Tovoid());
+developer._reportInstantEvent = function(start, category, name, argumentsAsJson) {
+};
+dart.fn(developer._reportInstantEvent, intAndStringAndString__Tovoid());
+developer.ServiceProtocolInfo = class ServiceProtocolInfo extends core.Object {
+  new(serverUri) {
+    this.majorVersion = developer._getServiceMajorVersion();
+    this.minorVersion = developer._getServiceMinorVersion();
+    this.serverUri = serverUri;
+  }
+  toString() {
+    if (this.serverUri != null) {
+      return dart.str`Dart VM Service Protocol v${this.majorVersion}.${this.minorVersion} ` + dart.str`listening on ${this.serverUri}`;
+    } else {
+      return dart.str`Dart VM Service Protocol v${this.majorVersion}.${this.minorVersion}`;
+    }
+  }
+};
+dart.setSignature(developer.ServiceProtocolInfo, {
+  constructors: () => ({new: dart.definiteFunctionType(developer.ServiceProtocolInfo, [core.Uri])}),
+  fields: () => ({
+    majorVersion: core.int,
+    minorVersion: core.int,
+    serverUri: core.Uri
+  })
+});
+developer.Service = class Service extends core.Object {
+  static getInfo() {
+    return dart.async(function*() {
+      let receivePort = isolate.RawReceivePort.new();
+      let uriCompleter = CompleterOfUri().new();
+      receivePort.handler = dart.fn(uri => uriCompleter.complete(uri), UriTovoid());
+      developer._getServerInfo(receivePort.sendPort);
+      let uri = (yield uriCompleter.future);
+      receivePort.close();
+      return new developer.ServiceProtocolInfo(uri);
+    }, developer.ServiceProtocolInfo);
+  }
+  static controlWebServer(opts) {
+    return dart.async(function*(opts) {
+      let enable = opts && 'enable' in opts ? opts.enable : false;
+      if (!(typeof enable == 'boolean')) {
+        dart.throw(new core.ArgumentError.value(enable, 'enable', 'Must be a bool'));
+      }
+      let receivePort = isolate.RawReceivePort.new();
+      let uriCompleter = CompleterOfUri().new();
+      receivePort.handler = dart.fn(uri => uriCompleter.complete(uri), UriTovoid());
+      developer._webServerControl(receivePort.sendPort, enable);
+      let uri = (yield uriCompleter.future);
+      receivePort.close();
+      return new developer.ServiceProtocolInfo(uri);
+    }, developer.ServiceProtocolInfo, opts);
+  }
+};
+dart.setSignature(developer.Service, {
+  statics: () => ({
+    getInfo: dart.definiteFunctionType(async.Future$(developer.ServiceProtocolInfo), []),
+    controlWebServer: dart.definiteFunctionType(async.Future$(developer.ServiceProtocolInfo), [], {enable: core.bool})
+  }),
+  names: ['getInfo', 'controlWebServer']
+});
+developer._getServerInfo = function(sp) {
+  sp.send(null);
+};
+dart.lazyFn(developer._getServerInfo, () => SendPortTovoid());
+developer._webServerControl = function(sp, enable) {
+  sp.send(null);
+};
+dart.lazyFn(developer._webServerControl, () => SendPortAndboolTovoid());
+developer._getServiceMajorVersion = function() {
+  return 0;
+};
+dart.fn(developer._getServiceMajorVersion, VoidToint());
+developer._getServiceMinorVersion = function() {
+  return 0;
+};
+dart.fn(developer._getServiceMinorVersion, VoidToint());
 isolate.IsolateSpawnException = class IsolateSpawnException extends core.Object {
   new(message) {
     this.message = message;
@@ -36188,7 +37247,7 @@
   static spawn(entryPoint, message, opts) {
     let paused = opts && 'paused' in opts ? opts.paused : false;
     try {
-      return _isolate_helper.IsolateNatives.spawnFunction(entryPoint, message, paused).then(isolate.Isolate)(dart.fn(msg => new isolate.Isolate(isolate.SendPort._check(msg[dartx.get](1)), {pauseCapability: isolate.Capability._check(msg[dartx.get](2)), terminateCapability: isolate.Capability._check(msg[dartx.get](3))}), ListToIsolate()));
+      return _isolate_helper.IsolateNatives.spawnFunction(entryPoint, message, paused).then(isolate.Isolate)(dart.fn(msg => new isolate.Isolate(isolate.SendPort._check(msg[dartx._get](1)), {pauseCapability: isolate.Capability._check(msg[dartx._get](2)), terminateCapability: isolate.Capability._check(msg[dartx._get](3))}), ListToIsolate()));
     } catch (e) {
       let st = dart.stackTrace(e);
       return FutureOfIsolate().error(e, st);
@@ -36202,14 +37261,14 @@
     try {
       if (core.List.is(args)) {
         for (let i = 0; i < dart.notNull(args[dartx.length]); i++) {
-          if (!(typeof args[dartx.get](i) == 'string')) {
+          if (!(typeof args[dartx._get](i) == 'string')) {
             dart.throw(new core.ArgumentError(dart.str`Args must be a list of Strings ${args}`));
           }
         }
       } else if (args != null) {
         dart.throw(new core.ArgumentError(dart.str`Args must be a list of Strings ${args}`));
       }
-      return _isolate_helper.IsolateNatives.spawnUri(uri, args, message, paused).then(isolate.Isolate)(dart.fn(msg => new isolate.Isolate(isolate.SendPort._check(msg[dartx.get](1)), {pauseCapability: isolate.Capability._check(msg[dartx.get](2)), terminateCapability: isolate.Capability._check(msg[dartx.get](3))}), ListToIsolate()));
+      return _isolate_helper.IsolateNatives.spawnUri(uri, args, message, paused).then(isolate.Isolate)(dart.fn(msg => new isolate.Isolate(isolate.SendPort._check(msg[dartx._get](1)), {pauseCapability: isolate.Capability._check(msg[dartx._get](2)), terminateCapability: isolate.Capability._check(msg[dartx._get](3))}), ListToIsolate()));
     } catch (e) {
       let st = dart.stackTrace(e);
       return FutureOfIsolate().error(e, st);
@@ -36224,34 +37283,34 @@
   }
   [_pause](resumeCapability) {
     let message = core.List.new(3);
-    message[dartx.set](0, "pause");
-    message[dartx.set](1, this.pauseCapability);
-    message[dartx.set](2, resumeCapability);
+    message[dartx._set](0, "pause");
+    message[dartx._set](1, this.pauseCapability);
+    message[dartx._set](2, resumeCapability);
     this.controlPort.send(message);
   }
   resume(resumeCapability) {
     let message = core.List.new(2);
-    message[dartx.set](0, "resume");
-    message[dartx.set](1, resumeCapability);
+    message[dartx._set](0, "resume");
+    message[dartx._set](1, resumeCapability);
     this.controlPort.send(message);
   }
   addOnExitListener(responsePort) {
     let message = core.List.new(2);
-    message[dartx.set](0, "add-ondone");
-    message[dartx.set](1, responsePort);
+    message[dartx._set](0, "add-ondone");
+    message[dartx._set](1, responsePort);
     this.controlPort.send(message);
   }
   removeOnExitListener(responsePort) {
     let message = core.List.new(2);
-    message[dartx.set](0, "remove-ondone");
-    message[dartx.set](1, responsePort);
+    message[dartx._set](0, "remove-ondone");
+    message[dartx._set](1, responsePort);
     this.controlPort.send(message);
   }
   setErrorsFatal(errorsAreFatal) {
     let message = core.List.new(3);
-    message[dartx.set](0, "set-errors-fatal");
-    message[dartx.set](1, this.terminateCapability);
-    message[dartx.set](2, errorsAreFatal);
+    message[dartx._set](0, "set-errors-fatal");
+    message[dartx._set](1, this.terminateCapability);
+    message[dartx._set](2, errorsAreFatal);
     this.controlPort.send(message);
   }
   kill(priority) {
@@ -36261,21 +37320,21 @@
   ping(responsePort, pingType) {
     if (pingType === void 0) pingType = isolate.Isolate.IMMEDIATE;
     let message = core.List.new(3);
-    message[dartx.set](0, "ping");
-    message[dartx.set](1, responsePort);
-    message[dartx.set](2, pingType);
+    message[dartx._set](0, "ping");
+    message[dartx._set](1, responsePort);
+    message[dartx._set](2, pingType);
     this.controlPort.send(message);
   }
   addErrorListener(port) {
     let message = core.List.new(2);
-    message[dartx.set](0, "getErrors");
-    message[dartx.set](1, port);
+    message[dartx._set](0, "getErrors");
+    message[dartx._set](1, port);
     this.controlPort.send(message);
   }
   removeErrorListener(port) {
     let message = core.List.new(2);
-    message[dartx.set](0, "stopErrors");
-    message[dartx.set](1, port);
+    message[dartx._set](0, "stopErrors");
+    message[dartx._set](1, port);
     this.controlPort.send(message);
   }
   get errors() {
@@ -36466,18 +37525,18 @@
     let _convertedObjects = collection.HashMap.identity();
     function _convert(o) {
       if (dart.test(_convertedObjects.containsKey(o))) {
-        return _convertedObjects.get(o);
+        return _convertedObjects._get(o);
       }
       if (core.Map.is(o)) {
         let convertedMap = {};
-        _convertedObjects.set(o, convertedMap);
+        _convertedObjects._set(o, convertedMap);
         for (let key of o[dartx.keys]) {
-          convertedMap[key] = _convert(o[dartx.get](key));
+          convertedMap[key] = _convert(o[dartx._get](key));
         }
         return convertedMap;
       } else if (core.Iterable.is(o)) {
         let convertedList = [];
-        _convertedObjects.set(o, convertedList);
+        _convertedObjects._set(o, convertedList);
         convertedList[dartx.addAll](o[dartx.map](dart.dynamic)(_convert));
         return convertedList;
       } else {
@@ -36487,13 +37546,13 @@
     dart.fn(_convert, dynamicTodynamic());
     return _convert(data);
   }
-  get(property) {
+  _get(property) {
     if (!(typeof property == 'string') && !(typeof property == 'number')) {
       dart.throw(new core.ArgumentError("property is not a String or num"));
     }
     return js._convertToDart(this[_jsObject][property]);
   }
-  set(property, value) {
+  _set(property, value) {
     if (!(typeof property == 'string') && !(typeof property == 'number')) {
       dart.throw(new core.ArgumentError("property is not a String or num"));
     }
@@ -36552,8 +37611,8 @@
   }),
   fields: () => ({[_jsObject]: dart.dynamic}),
   methods: () => ({
-    get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
-    set: dart.definiteFunctionType(dart.dynamic, [core.Object, dart.dynamic]),
+    _get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
+    _set: dart.definiteFunctionType(dart.dynamic, [core.Object, dart.dynamic]),
     hasProperty: dart.definiteFunctionType(core.bool, [dart.dynamic]),
     deleteProperty: dart.definiteFunctionType(dart.void, [dart.dynamic]),
     instanceof: dart.definiteFunctionType(core.bool, [js.JsFunction]),
@@ -36627,18 +37686,18 @@
         dart.throw(new core.RangeError.range(end, start, length));
       }
     }
-    get(index) {
+    _get(index) {
       if (typeof index == 'number' && index == index[dartx.toInt]()) {
         this[_checkIndex](dart.asInt(index));
       }
-      return E.as(super.get(index));
+      return E.as(super._get(index));
     }
-    set(index, value) {
+    _set(index, value) {
       E._check(value);
       if (typeof index == 'number' && index == index[dartx.toInt]()) {
         this[_checkIndex](dart.asInt(index));
       }
-      super.set(index, value);
+      super._set(index, value);
       return value;
     }
     get length() {
@@ -36649,7 +37708,7 @@
       dart.throw(new core.StateError('Bad JsArray length'));
     }
     set length(length) {
-      super.set('length', length);
+      super._set('length', length);
     }
     add(value) {
       E._check(value);
@@ -36707,8 +37766,8 @@
     methods: () => ({
       [_checkIndex]: dart.definiteFunctionType(dart.dynamic, [core.int]),
       [_checkInsertIndex]: dart.definiteFunctionType(dart.dynamic, [core.int]),
-      get: dart.definiteFunctionType(E, [core.Object]),
-      set: dart.definiteFunctionType(dart.void, [core.Object, E]),
+      _get: dart.definiteFunctionType(E, [core.Object]),
+      _set: dart.definiteFunctionType(dart.void, [core.Object, E]),
       add: dart.definiteFunctionType(dart.void, [E]),
       addAll: dart.definiteFunctionType(dart.void, [IterableOfE()]),
       insert: dart.definiteFunctionType(dart.void, [core.int, E]),
@@ -36721,8 +37780,8 @@
     names: ['_checkRange']
   });
   dart.defineExtensionMembers(JsArray, [
-    'get',
-    'set',
+    '_get',
+    '_set',
     'add',
     'addAll',
     'insert',
@@ -36770,7 +37829,7 @@
     let args = Array.prototype.map.call(arguments, js._convertToDart);
     return js._convertToJS(f(...args));
   };
-  dart.dsetindex(js._dartProxies, wrapper, f);
+  js._dartProxies.set(wrapper, f);
   return wrapper;
 };
 dart.fn(js._wrapDartFunction, dynamicTodynamic());
@@ -36829,7 +37888,7 @@
   set _interopCaptureThisExpando(_) {}
 });
 js.allowInteropCaptureThis = function(f) {
-  let ret = js._interopCaptureThisExpando.get(f);
+  let ret = js._interopCaptureThisExpando._get(f);
   if (ret == null) {
     ret = function() {
       let args = [this];
@@ -36838,7 +37897,7 @@
       }
       return f(...args);
     };
-    js._interopCaptureThisExpando.set(f, ret);
+    js._interopCaptureThisExpando._set(f, ret);
   }
   return ret;
 };
@@ -36854,18 +37913,18 @@
   let _convertedObjects = collection.HashMap.identity();
   function _convert(o) {
     if (dart.test(_convertedObjects.containsKey(o))) {
-      return _convertedObjects.get(o);
+      return _convertedObjects._get(o);
     }
     if (core.Map.is(o)) {
       let convertedMap = {};
-      _convertedObjects.set(o, convertedMap);
+      _convertedObjects._set(o, convertedMap);
       for (let key of o[dartx.keys]) {
-        convertedMap[key] = _convert(o[dartx.get](key));
+        convertedMap[key] = _convert(o[dartx._get](key));
       }
       return convertedMap;
     } else if (core.Iterable.is(o)) {
       let convertedList = [];
-      _convertedObjects.set(o, convertedList);
+      _convertedObjects._set(o, convertedList);
       convertedList[dartx.addAll](o[dartx.map](dart.dynamic)(_convert));
       return convertedList;
     } else {
@@ -36956,40 +38015,13 @@
 math.SQRT2 = 1.4142135623730951;
 math.min = function(T) {
   return (a, b) => {
-    if (!(typeof a == 'number')) dart.throw(new core.ArgumentError(a));
-    if (!(typeof b == 'number')) dart.throw(new core.ArgumentError(b));
-    if (dart.notNull(a) > dart.notNull(b)) return b;
-    if (dart.notNull(a) < dart.notNull(b)) return a;
-    if (typeof b == 'number') {
-      if (typeof a == 'number') {
-        if (a == 0.0) {
-          return (dart.notNull(a) + dart.notNull(b)) * dart.notNull(a) * dart.notNull(b);
-        }
-      }
-      if (a == 0 && dart.test(b[dartx.isNegative]) || dart.test(b[dartx.isNaN])) return b;
-      return a;
-    }
-    return a;
+    return Math.min(_js_helper.checkNum(a), _js_helper.checkNum(b));
   };
 };
 dart.fn(math.min, TAndTToT());
 math.max = function(T) {
   return (a, b) => {
-    if (!(typeof a == 'number')) dart.throw(new core.ArgumentError(a));
-    if (!(typeof b == 'number')) dart.throw(new core.ArgumentError(b));
-    if (dart.notNull(a) > dart.notNull(b)) return a;
-    if (dart.notNull(a) < dart.notNull(b)) return b;
-    if (typeof b == 'number') {
-      if (typeof a == 'number') {
-        if (a == 0.0) {
-          return dart.notNull(a) + dart.notNull(b);
-        }
-      }
-      if (dart.test(b[dartx.isNaN])) return b;
-      return a;
-    }
-    if (b == 0 && dart.test(a[dartx.isNegative])) return b;
-    return a;
+    return Math.max(_js_helper.checkNum(a), _js_helper.checkNum(b));
   };
 };
 dart.fn(math.max, TAndTToT());
@@ -37406,7 +38438,8 @@
     }
     ['=='](other) {
       if (!RectangleOfnum().is(other)) return false;
-      return dart.equals(this[dartx.left], dart.dload(other, 'left')) && dart.equals(this[dartx.top], dart.dload(other, 'top')) && dart.equals(this[dartx.right], dart.dload(other, 'right')) && dart.equals(this[dartx.bottom], dart.dload(other, 'bottom'));
+      let otherRect = RectangleOfnum().as(other);
+      return this[dartx.left] == otherRect[dartx.left] && this[dartx.top] == otherRect[dartx.top] && this[dartx.right] == otherRect[dartx.right] && this[dartx.bottom] == otherRect[dartx.bottom];
     }
     get hashCode() {
       return math._JenkinsSmiHash.hash4(dart.hashCode(this[dartx.left]), dart.hashCode(this[dartx.top]), dart.hashCode(this[dartx.right]), dart.hashCode(this[dartx.bottom]));
@@ -37502,11 +38535,35 @@
     'height'
   ]);
   class Rectangle extends math._RectangleBase$(T) {
+    get left() {
+      return this[left$];
+    }
+    set left(value) {
+      super.left = value;
+    }
+    get top() {
+      return this[top$];
+    }
+    set top(value) {
+      super.top = value;
+    }
+    get width() {
+      return this[width$];
+    }
+    set width(value) {
+      super.width = value;
+    }
+    get height() {
+      return this[height$];
+    }
+    set height(value) {
+      super.height = value;
+    }
     new(left, top, width, height) {
-      this[dartx.left] = left;
-      this[dartx.top] = top;
-      this[dartx.width] = dart.notNull(width) < 0 ? -dart.notNull(width) * 0 : width;
-      this[dartx.height] = dart.notNull(height) < 0 ? -dart.notNull(height) * 0 : height;
+      this[left$] = left;
+      this[top$] = top;
+      this[width$] = dart.notNull(width) < 0 ? -dart.notNull(width) * 0 : width;
+      this[height$] = dart.notNull(height) < 0 ? -dart.notNull(height) * 0 : height;
       super.new();
     }
     static fromPoints(a, b) {
@@ -37517,6 +38574,10 @@
       return new (RectangleOfT())(left, top, width, height);
     }
   }
+  const left$ = Symbol(Rectangle.name + "." + 'left'.toString());
+  const top$ = Symbol(Rectangle.name + "." + 'top'.toString());
+  const width$ = Symbol(Rectangle.name + "." + 'width'.toString());
+  const height$ = Symbol(Rectangle.name + "." + 'height'.toString());
   dart.setSignature(Rectangle, {
     constructors: () => ({
       new: dart.definiteFunctionType(math.Rectangle$(T), [T, T, T, T]),
@@ -37540,9 +38601,21 @@
   let RectangleOfT = () => (RectangleOfT = dart.constFn(math.Rectangle$(T)))();
   let PointOfT = () => (PointOfT = dart.constFn(math.Point$(T)))();
   class MutableRectangle extends math._RectangleBase$(T) {
+    get left() {
+      return this[left$];
+    }
+    set left(value) {
+      this[left$] = value;
+    }
+    get top() {
+      return this[top$];
+    }
+    set top(value) {
+      this[top$] = value;
+    }
     new(left, top, width, height) {
-      this.left = left;
-      this.top = top;
+      this[left$] = left;
+      this[top$] = top;
       this[_width] = dart.notNull(width) < 0 ? math._clampToZero(T)(width) : width;
       this[_height] = dart.notNull(height) < 0 ? math._clampToZero(T)(height) : height;
       super.new();
@@ -37571,6 +38644,8 @@
       this[_height] = height;
     }
   }
+  const left$ = Symbol(MutableRectangle.name + "." + 'left'.toString());
+  const top$ = Symbol(MutableRectangle.name + "." + 'top'.toString());
   MutableRectangle[dart.implements] = () => [RectangleOfT()];
   dart.setSignature(MutableRectangle, {
     constructors: () => ({
@@ -38149,7 +39224,7 @@
     if (dart.test(html_common.isJavaScriptDate(object))) return true;
     if (core.List.is(object)) {
       for (let i = 0; i < dart.notNull(object[dartx.length]); i++) {
-        if (dart.test(containsDate(object[dartx.get](i)))) return true;
+        if (dart.test(containsDate(object[dartx._get](i)))) return true;
       }
     }
     return false;
@@ -38228,21 +39303,21 @@
   get [dartx.source]() {
     return this.source;
   }
-  [dartx.advance](count) {
-    return this.advance(count);
+  [dartx.advance](...args) {
+    return this.advance.apply(this, args);
   }
-  [dartx.continuePrimaryKey](key, primaryKey) {
-    return this.continuePrimaryKey(key, primaryKey);
+  [dartx.continuePrimaryKey](...args) {
+    return this.continuePrimaryKey.apply(this, args);
   }
-  [_delete]() {
-    return this.delete();
+  [_delete](...args) {
+    return this.delete.apply(this, args);
   }
   [_update](value) {
     let value_1 = html_common.convertDartToNative_SerializedScriptValue(value);
     return this[_update_1](value_1);
   }
-  [_update_1](value) {
-    return this.update(value);
+  [_update_1](...args) {
+    return this.update.apply(this, args);
   }
 };
 dart.setSignature(indexed_db.Cursor, {
@@ -38320,14 +39395,14 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [_addEventListener](type, listener, capture) {
-    return this.addEventListener(type, listener, capture);
+  [_addEventListener](...args) {
+    return this.addEventListener.apply(this, args);
   }
-  [dartx.dispatchEvent](event) {
-    return this.dispatchEvent(event);
+  [dartx.dispatchEvent](...args) {
+    return this.dispatchEvent.apply(this, args);
   }
-  [_removeEventListener](type, listener, capture) {
-    return this.removeEventListener(type, listener, capture);
+  [_removeEventListener](...args) {
+    return this.removeEventListener.apply(this, args);
   }
 };
 dart.defineNamedConstructor(html.EventTarget, '_created');
@@ -38368,10 +39443,10 @@
     let autoIncrement = opts && 'autoIncrement' in opts ? opts.autoIncrement : null;
     let options = dart.map();
     if (keyPath != null) {
-      options[dartx.set]('keyPath', keyPath);
+      options[dartx._set]('keyPath', keyPath);
     }
     if (autoIncrement != null) {
-      options[dartx.set]('autoIncrement', autoIncrement);
+      options[dartx._set]('autoIncrement', autoIncrement);
     }
     return this[_createObjectStore](name, options);
   }
@@ -38400,8 +39475,8 @@
     }
     return this[_transaction](storeNames, mode);
   }
-  [_transaction](stores, mode) {
-    return this.transaction(stores, mode);
+  [_transaction](...args) {
+    return this.transaction.apply(this, args);
   }
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
@@ -38415,8 +39490,8 @@
   get [dartx.version]() {
     return this.version;
   }
-  [dartx.close]() {
-    return this.close();
+  [dartx.close](...args) {
+    return this.close.apply(this, args);
   }
   [_createObjectStore](name, options) {
     if (options === void 0) options = null;
@@ -38426,14 +39501,14 @@
     }
     return this[_createObjectStore_2](name);
   }
-  [_createObjectStore_1](name, options) {
-    return this.createObjectStore(name, options);
+  [_createObjectStore_1](...args) {
+    return this.createObjectStore.apply(this, args);
   }
-  [_createObjectStore_2](name) {
-    return this.createObjectStore(name);
+  [_createObjectStore_2](...args) {
+    return this.createObjectStore.apply(this, args);
   }
-  [dartx.deleteObjectStore](name) {
-    return this.deleteObjectStore(name);
+  [dartx.deleteObjectStore](...args) {
+    return this.deleteObjectStore.apply(this, args);
   }
   get [dartx.onAbort]() {
     return indexed_db.Database.abortEvent.forTarget(this);
@@ -38572,17 +39647,17 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.cmp](first, second) {
-    return this.cmp(first, second);
+  [dartx.cmp](...args) {
+    return this.cmp.apply(this, args);
   }
-  [_deleteDatabase](name) {
-    return this.deleteDatabase(name);
+  [_deleteDatabase](...args) {
+    return this.deleteDatabase.apply(this, args);
   }
-  [_open](name, version) {
-    return this.open(name, version);
+  [_open](...args) {
+    return this.open.apply(this, args);
   }
-  [_webkitGetDatabaseNames]() {
-    return this.webkitGetDatabaseNames();
+  [_webkitGetDatabaseNames](...args) {
+    return this.webkitGetDatabaseNames.apply(this, args);
   }
 };
 dart.setSignature(indexed_db.IdbFactory, {
@@ -38725,26 +39800,26 @@
   get [dartx.unique]() {
     return this.unique;
   }
-  [_count](key) {
-    return this.count(key);
+  [_count](...args) {
+    return this.count.apply(this, args);
   }
-  [_get](key) {
-    return this.get(key);
+  [_get](...args) {
+    return this.get.apply(this, args);
   }
-  [dartx.getAll](range, maxCount) {
-    return this.getAll(range, maxCount);
+  [dartx.getAll](...args) {
+    return this.getAll.apply(this, args);
   }
-  [dartx.getAllKeys](range, maxCount) {
-    return this.getAllKeys(range, maxCount);
+  [dartx.getAllKeys](...args) {
+    return this.getAllKeys.apply(this, args);
   }
-  [_getKey](key) {
-    return this.getKey(key);
+  [_getKey](...args) {
+    return this.getKey.apply(this, args);
   }
-  [_openCursor](range, direction) {
-    return this.openCursor(range, direction);
+  [_openCursor](...args) {
+    return this.openCursor.apply(this, args);
   }
-  [_openKeyCursor](range, direction) {
-    return this.openKeyCursor(range, direction);
+  [_openKeyCursor](...args) {
+    return this.openKeyCursor.apply(this, args);
   }
 };
 dart.setSignature(indexed_db.Index, {
@@ -38963,10 +40038,10 @@
     let multiEntry = opts && 'multiEntry' in opts ? opts.multiEntry : null;
     let options = dart.map();
     if (unique != null) {
-      options[dartx.set]('unique', unique);
+      options[dartx._set]('unique', unique);
     }
     if (multiEntry != null) {
-      options[dartx.set]('multiEntry', multiEntry);
+      options[dartx._set]('multiEntry', multiEntry);
     }
     return this[_createIndex](name, keyPath, options);
   }
@@ -38998,17 +40073,17 @@
     let value_1 = html_common.convertDartToNative_SerializedScriptValue(value);
     return this[_add_2](value_1);
   }
-  [_add_1](value, key) {
-    return this.add(value, key);
+  [_add_1](...args) {
+    return this.add.apply(this, args);
   }
-  [_add_2](value) {
-    return this.add(value);
+  [_add_2](...args) {
+    return this.add.apply(this, args);
   }
-  [_clear]() {
-    return this.clear();
+  [_clear](...args) {
+    return this.clear.apply(this, args);
   }
-  [_count](key) {
-    return this.count(key);
+  [_count](...args) {
+    return this.count.apply(this, args);
   }
   [_createIndex](name, keyPath, options) {
     if (options === void 0) options = null;
@@ -39018,35 +40093,35 @@
     }
     return this[_createIndex_2](name, keyPath);
   }
-  [_createIndex_1](name, keyPath, options) {
-    return this.createIndex(name, keyPath, options);
+  [_createIndex_1](...args) {
+    return this.createIndex.apply(this, args);
   }
-  [_createIndex_2](name, keyPath) {
-    return this.createIndex(name, keyPath);
+  [_createIndex_2](...args) {
+    return this.createIndex.apply(this, args);
   }
-  [_delete](key) {
-    return this.delete(key);
+  [_delete](...args) {
+    return this.delete.apply(this, args);
   }
-  [dartx.deleteIndex](name) {
-    return this.deleteIndex(name);
+  [dartx.deleteIndex](...args) {
+    return this.deleteIndex.apply(this, args);
   }
-  [_get](key) {
-    return this.get(key);
+  [_get](...args) {
+    return this.get.apply(this, args);
   }
-  [dartx.getAll](range, maxCount) {
-    return this.getAll(range, maxCount);
+  [dartx.getAll](...args) {
+    return this.getAll.apply(this, args);
   }
-  [dartx.getAllKeys](range, maxCount) {
-    return this.getAllKeys(range, maxCount);
+  [dartx.getAllKeys](...args) {
+    return this.getAllKeys.apply(this, args);
   }
-  [dartx.index](name) {
-    return this.index(name);
+  [dartx.index](...args) {
+    return this.index.apply(this, args);
   }
-  [_openCursor](range, direction) {
-    return this.openCursor(range, direction);
+  [_openCursor](...args) {
+    return this.openCursor.apply(this, args);
   }
-  [dartx.openKeyCursor](range, direction) {
-    return this.openKeyCursor(range, direction);
+  [dartx.openKeyCursor](...args) {
+    return this.openKeyCursor.apply(this, args);
   }
   [_put](value, key) {
     if (key === void 0) key = null;
@@ -39058,11 +40133,11 @@
     let value_1 = html_common.convertDartToNative_SerializedScriptValue(value);
     return this[_put_2](value_1);
   }
-  [_put_1](value, key) {
-    return this.put(value, key);
+  [_put_1](...args) {
+    return this.put.apply(this, args);
   }
-  [_put_2](value) {
-    return this.put(value);
+  [_put_2](...args) {
+    return this.put.apply(this, args);
   }
   static _cursorStreamFromResult(T) {
     return (request, autoAdvance) => {
@@ -39233,6 +40308,7 @@
   }
 });
 dart.registerExtension(dart.global.IDBOpenDBRequest, indexed_db.OpenDBRequest);
+dart.registerExtension(dart.global.IDBVersionChangeRequest, indexed_db.OpenDBRequest);
 dart.defineExtensionNames([
   'completed',
   'abort',
@@ -39276,11 +40352,11 @@
   get [dartx.objectStoreNames]() {
     return this.objectStoreNames;
   }
-  [dartx.abort]() {
-    return this.abort();
+  [dartx.abort](...args) {
+    return this.abort.apply(this, args);
   }
-  [dartx.objectStore](name) {
-    return this.objectStore(name);
+  [dartx.objectStore](...args) {
+    return this.objectStore.apply(this, args);
   }
   get [dartx.onAbort]() {
     return indexed_db.Transaction.abortEvent.forTarget(this);
@@ -39427,17 +40503,17 @@
   get [dartx.type]() {
     return this.type;
   }
-  [_initEvent](type, bubbles, cancelable) {
-    return this.initEvent(type, bubbles, cancelable);
+  [_initEvent](...args) {
+    return this.initEvent.apply(this, args);
   }
-  [dartx.preventDefault]() {
-    return this.preventDefault();
+  [dartx.preventDefault](...args) {
+    return this.preventDefault.apply(this, args);
   }
-  [dartx.stopImmediatePropagation]() {
-    return this.stopImmediatePropagation();
+  [dartx.stopImmediatePropagation](...args) {
+    return this.stopImmediatePropagation.apply(this, args);
   }
-  [dartx.stopPropagation]() {
-    return this.stopPropagation();
+  [dartx.stopPropagation](...args) {
+    return this.stopPropagation.apply(this, args);
   }
 };
 dart.setSignature(html.Event, {
@@ -39484,6 +40560,7 @@
 html.Event.BUBBLING_PHASE = 3;
 html.Event.CAPTURING_PHASE = 1;
 dart.registerExtension(dart.global.Event, html.Event);
+dart.registerExtension(dart.global.InputEvent, html.Event);
 dart.defineExtensionNames([
   'dataLoss',
   'dataLossMessage',
@@ -39737,26 +40814,26 @@
   set [dartx.text](value) {
     this.textContent = value;
   }
-  [dartx.append](node) {
-    return this.appendChild(node);
+  [dartx.append](...args) {
+    return this.appendChild.apply(this, args);
   }
-  [dartx.clone](deep) {
-    return this.cloneNode(deep);
+  [dartx.clone](...args) {
+    return this.cloneNode.apply(this, args);
   }
-  [dartx.contains](other) {
-    return this.contains(other);
+  [dartx.contains](...args) {
+    return this.contains.apply(this, args);
   }
-  [dartx.hasChildNodes]() {
-    return this.hasChildNodes();
+  [dartx.hasChildNodes](...args) {
+    return this.hasChildNodes.apply(this, args);
   }
-  [dartx.insertBefore](node, child) {
-    return this.insertBefore(node, child);
+  [dartx.insertBefore](...args) {
+    return this.insertBefore.apply(this, args);
   }
-  [_removeChild](child) {
-    return this.removeChild(child);
+  [_removeChild](...args) {
+    return this.removeChild.apply(this, args);
   }
-  [_replaceChild](node, child) {
-    return this.replaceChild(node, child);
+  [_replaceChild](...args) {
+    return this.replaceChild.apply(this, args);
   }
 };
 dart.defineNamedConstructor(html.Node, '_created');
@@ -40143,7 +41220,7 @@
     let attributes = this[dartx.attributes];
     attributes[dartx.clear]();
     for (let key of value[dartx.keys]) {
-      attributes[dartx.set](key, value[dartx.get](key));
+      attributes[dartx._set](key, value[dartx._get](key));
     }
   }
   get [dartx.children]() {
@@ -40183,7 +41260,7 @@
     let data = this[dartx.dataset];
     data[dartx.clear]();
     for (let key of value[dartx.keys]) {
-      data[dartx.set](key, value[dartx.get](key));
+      data[dartx._set](key, value[dartx._get](key));
     }
   }
   [dartx.getNamespacedAttributes](namespace) {
@@ -40236,8 +41313,8 @@
     let convertedTiming = core.Map.is(timing) ? html_common.convertDartToNative_Dictionary(timing) : timing;
     return convertedTiming == null ? this[_animate](convertedFrames) : this[_animate](convertedFrames, convertedTiming);
   }
-  [_animate](effect, timing) {
-    return this.animate(effect, timing);
+  [_animate](...args) {
+    return this.animate.apply(this, args);
   }
   [dartx.attributeChanged](name, oldValue, newValue) {}
   get [_xtag]() {
@@ -40297,8 +41374,8 @@
       this[_insertAdjacentNode](where, html.Text.new(text));
     }
   }
-  [_insertAdjacentText](where, text) {
-    return this.insertAdjacentText(where, text);
+  [_insertAdjacentText](...args) {
+    return this.insertAdjacentText.apply(this, args);
   }
   [dartx.insertAdjacentHtml](where, html, opts) {
     let validator = opts && 'validator' in opts ? opts.validator : null;
@@ -40309,8 +41386,8 @@
       this[_insertAdjacentNode](where, this[dartx.createFragment](html, {validator: validator, treeSanitizer: treeSanitizer}));
     }
   }
-  [_insertAdjacentHtml](where, text) {
-    return this.insertAdjacentHTML(where, text);
+  [_insertAdjacentHtml](...args) {
+    return this.insertAdjacentHTML.apply(this, args);
   }
   [dartx.insertAdjacentElement](where, element) {
     if (!!this.insertAdjacentElement) {
@@ -40320,8 +41397,8 @@
     }
     return element;
   }
-  [_insertAdjacentElement](where, element) {
-    return this.insertAdjacentElement(where, element);
+  [_insertAdjacentElement](...args) {
+    return this.insertAdjacentElement.apply(this, args);
   }
   [_insertAdjacentNode](where, node) {
     switch (where[dartx.toLowerCase]()) {
@@ -40332,7 +41409,7 @@
       }
       case 'afterbegin':
       {
-        let first = dart.notNull(this[dartx.nodes][dartx.length]) > 0 ? this[dartx.nodes][dartx.get](0) : null;
+        let first = dart.notNull(this[dartx.nodes][dartx.length]) > 0 ? this[dartx.nodes][dartx._get](0) : null;
         this[dartx.insertBefore](node, first);
         break;
       }
@@ -40635,14 +41712,14 @@
   set [dartx.dropzone](value) {
     this.webkitdropzone = value;
   }
-  [dartx.blur]() {
-    return this.blur();
+  [dartx.blur](...args) {
+    return this.blur.apply(this, args);
   }
-  [dartx.click]() {
-    return this.click();
+  [dartx.click](...args) {
+    return this.click.apply(this, args);
   }
-  [dartx.focus]() {
-    return this.focus();
+  [dartx.focus](...args) {
+    return this.focus.apply(this, args);
   }
   get [_attributes]() {
     return this.attributes;
@@ -40707,50 +41784,50 @@
   get [dartx.tagName]() {
     return this.tagName;
   }
-  [dartx.closest](selectors) {
-    return this.closest(selectors);
+  [dartx.closest](...args) {
+    return this.closest.apply(this, args);
   }
-  [dartx.getAnimations]() {
-    return this.getAnimations();
+  [dartx.getAnimations](...args) {
+    return this.getAnimations.apply(this, args);
   }
-  [dartx.getAttribute](name) {
-    return this.getAttribute(name);
+  [dartx.getAttribute](...args) {
+    return this.getAttribute.apply(this, args);
   }
-  [dartx.getAttributeNS](namespaceURI, localName) {
-    return this.getAttributeNS(namespaceURI, localName);
+  [dartx.getAttributeNS](...args) {
+    return this.getAttributeNS.apply(this, args);
   }
-  [dartx.getBoundingClientRect]() {
-    return this.getBoundingClientRect();
+  [dartx.getBoundingClientRect](...args) {
+    return this.getBoundingClientRect.apply(this, args);
   }
-  [dartx.getClientRects]() {
-    return this.getClientRects();
+  [dartx.getClientRects](...args) {
+    return this.getClientRects.apply(this, args);
   }
-  [dartx.getDestinationInsertionPoints]() {
-    return this.getDestinationInsertionPoints();
+  [dartx.getDestinationInsertionPoints](...args) {
+    return this.getDestinationInsertionPoints.apply(this, args);
   }
-  [dartx.getElementsByClassName](classNames) {
-    return this.getElementsByClassName(classNames);
+  [dartx.getElementsByClassName](...args) {
+    return this.getElementsByClassName.apply(this, args);
   }
-  [_getElementsByTagName](localName) {
-    return this.getElementsByTagName(localName);
+  [_getElementsByTagName](...args) {
+    return this.getElementsByTagName.apply(this, args);
   }
-  [_hasAttribute](name) {
-    return this.hasAttribute(name);
+  [_hasAttribute](...args) {
+    return this.hasAttribute.apply(this, args);
   }
-  [_hasAttributeNS](namespaceURI, localName) {
-    return this.hasAttributeNS(namespaceURI, localName);
+  [_hasAttributeNS](...args) {
+    return this.hasAttributeNS.apply(this, args);
   }
-  [_removeAttribute](name) {
-    return this.removeAttribute(name);
+  [_removeAttribute](...args) {
+    return this.removeAttribute.apply(this, args);
   }
-  [_removeAttributeNS](namespaceURI, localName) {
-    return this.removeAttributeNS(namespaceURI, localName);
+  [_removeAttributeNS](...args) {
+    return this.removeAttributeNS.apply(this, args);
   }
-  [dartx.requestFullscreen]() {
-    return this.requestFullscreen();
+  [dartx.requestFullscreen](...args) {
+    return this.requestFullscreen.apply(this, args);
   }
-  [dartx.requestPointerLock]() {
-    return this.requestPointerLock();
+  [dartx.requestPointerLock](...args) {
+    return this.requestPointerLock.apply(this, args);
   }
   [dartx.scroll](options_OR_x, y) {
     if (options_OR_x === void 0) options_OR_x = null;
@@ -40770,14 +41847,14 @@
     }
     dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
   }
-  [_scroll_1]() {
-    return this.scroll();
+  [_scroll_1](...args) {
+    return this.scroll.apply(this, args);
   }
-  [_scroll_2](options) {
-    return this.scroll(options);
+  [_scroll_2](...args) {
+    return this.scroll.apply(this, args);
   }
-  [_scroll_3](x, y) {
-    return this.scroll(x, y);
+  [_scroll_3](...args) {
+    return this.scroll.apply(this, args);
   }
   [dartx.scrollBy](options_OR_x, y) {
     if (options_OR_x === void 0) options_OR_x = null;
@@ -40797,20 +41874,20 @@
     }
     dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
   }
-  [_scrollBy_1]() {
-    return this.scrollBy();
+  [_scrollBy_1](...args) {
+    return this.scrollBy.apply(this, args);
   }
-  [_scrollBy_2](options) {
-    return this.scrollBy(options);
+  [_scrollBy_2](...args) {
+    return this.scrollBy.apply(this, args);
   }
-  [_scrollBy_3](x, y) {
-    return this.scrollBy(x, y);
+  [_scrollBy_3](...args) {
+    return this.scrollBy.apply(this, args);
   }
-  [_scrollIntoView](alignWithTop) {
-    return this.scrollIntoView(alignWithTop);
+  [_scrollIntoView](...args) {
+    return this.scrollIntoView.apply(this, args);
   }
-  [_scrollIntoViewIfNeeded](centerIfNeeded) {
-    return this.scrollIntoViewIfNeeded(centerIfNeeded);
+  [_scrollIntoViewIfNeeded](...args) {
+    return this.scrollIntoViewIfNeeded.apply(this, args);
   }
   [dartx.scrollTo](options_OR_x, y) {
     if (options_OR_x === void 0) options_OR_x = null;
@@ -40830,26 +41907,26 @@
     }
     dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
   }
-  [_scrollTo_1]() {
-    return this.scrollTo();
+  [_scrollTo_1](...args) {
+    return this.scrollTo.apply(this, args);
   }
-  [_scrollTo_2](options) {
-    return this.scrollTo(options);
+  [_scrollTo_2](...args) {
+    return this.scrollTo.apply(this, args);
   }
-  [_scrollTo_3](x, y) {
-    return this.scrollTo(x, y);
+  [_scrollTo_3](...args) {
+    return this.scrollTo.apply(this, args);
   }
-  [dartx.setAttribute](name, value) {
-    return this.setAttribute(name, value);
+  [dartx.setAttribute](...args) {
+    return this.setAttribute.apply(this, args);
   }
-  [dartx.setAttributeNS](namespaceURI, name, value) {
-    return this.setAttributeNS(namespaceURI, name, value);
+  [dartx.setAttributeNS](...args) {
+    return this.setAttributeNS.apply(this, args);
   }
-  [dartx.after](nodes) {
-    return this.after(nodes);
+  [dartx.after](...args) {
+    return this.after.apply(this, args);
   }
-  [dartx.before](nodes) {
-    return this.before(nodes);
+  [dartx.before](...args) {
+    return this.before.apply(this, args);
   }
   get [dartx.nextElementSibling]() {
     return this.nextElementSibling;
@@ -40869,11 +41946,11 @@
   get [_lastElementChild]() {
     return this.lastElementChild;
   }
-  [dartx.querySelector](selectors) {
-    return this.querySelector(selectors);
+  [dartx.querySelector](...args) {
+    return this.querySelector.apply(this, args);
   }
-  [_querySelectorAll](selectors) {
-    return this.querySelectorAll(selectors);
+  [_querySelectorAll](...args) {
+    return this.querySelectorAll.apply(this, args);
   }
   get [dartx.onAbort]() {
     return html.Element.abortEvent.forElement(this);
@@ -41929,20 +43006,20 @@
   set [dartx.startTime](value) {
     this.startTime = value;
   }
-  [dartx.cancel]() {
-    return this.cancel();
+  [dartx.cancel](...args) {
+    return this.cancel.apply(this, args);
   }
-  [dartx.finish]() {
-    return this.finish();
+  [dartx.finish](...args) {
+    return this.finish.apply(this, args);
   }
-  [dartx.pause]() {
-    return this.pause();
+  [dartx.pause](...args) {
+    return this.pause.apply(this, args);
   }
-  [dartx.play]() {
-    return this.play();
+  [dartx.play](...args) {
+    return this.play.apply(this, args);
   }
-  [dartx.reverse]() {
-    return this.reverse();
+  [dartx.reverse](...args) {
+    return this.reverse.apply(this, args);
   }
 };
 dart.setSignature(html.Animation, {
@@ -42193,11 +43270,11 @@
   set [dartx.playbackRate](value) {
     this.playbackRate = value;
   }
-  [dartx.getAnimations]() {
-    return this.getAnimations();
+  [dartx.getAnimations](...args) {
+    return this.getAnimations.apply(this, args);
   }
-  [dartx.play](source) {
-    return this.play(source);
+  [dartx.play](...args) {
+    return this.play.apply(this, args);
   }
 };
 dart.setSignature(html.AnimationTimeline, {
@@ -42259,14 +43336,14 @@
   get [dartx.status]() {
     return this.status;
   }
-  [dartx.abort]() {
-    return this.abort();
+  [dartx.abort](...args) {
+    return this.abort.apply(this, args);
   }
-  [dartx.swapCache]() {
-    return this.swapCache();
+  [dartx.swapCache](...args) {
+    return this.swapCache.apply(this, args);
   }
-  [dartx.update]() {
-    return this.update();
+  [dartx.update](...args) {
+    return this.update.apply(this, args);
   }
   get [dartx.onCached]() {
     return html.ApplicationCache.cachedEvent.forTarget(this);
@@ -42362,6 +43439,8 @@
   }
 });
 dart.registerExtension(dart.global.ApplicationCache, html.ApplicationCache);
+dart.registerExtension(dart.global.DOMApplicationCache, html.ApplicationCache);
+dart.registerExtension(dart.global.OfflineResourceList, html.ApplicationCache);
 dart.defineExtensionNames([
   'message',
   'reason',
@@ -42811,35 +43890,35 @@
   get [dartx.videoDecodedByteCount]() {
     return this.webkitVideoDecodedByteCount;
   }
-  [dartx.addTextTrack](kind, label, language) {
-    return this.addTextTrack(kind, label, language);
+  [dartx.addTextTrack](...args) {
+    return this.addTextTrack.apply(this, args);
   }
-  [dartx.canPlayType](type, keySystem) {
-    return this.canPlayType(type, keySystem);
+  [dartx.canPlayType](...args) {
+    return this.canPlayType.apply(this, args);
   }
-  [dartx.load]() {
-    return this.load();
+  [dartx.load](...args) {
+    return this.load.apply(this, args);
   }
-  [dartx.pause]() {
-    return this.pause();
+  [dartx.pause](...args) {
+    return this.pause.apply(this, args);
   }
-  [dartx.play]() {
-    return this.play();
+  [dartx.play](...args) {
+    return this.play.apply(this, args);
   }
-  [dartx.setMediaKeys](mediaKeys) {
-    return this.setMediaKeys(mediaKeys);
+  [dartx.setMediaKeys](...args) {
+    return this.setMediaKeys.apply(this, args);
   }
-  [dartx.setSinkId](sinkId) {
-    return this.setSinkId(sinkId);
+  [dartx.setSinkId](...args) {
+    return this.setSinkId.apply(this, args);
   }
-  [dartx.addKey](keySystem, key, initData, sessionId) {
-    return this.webkitAddKey(keySystem, key, initData, sessionId);
+  [dartx.addKey](...args) {
+    return this.webkitAddKey.apply(this, args);
   }
-  [dartx.cancelKeyRequest](keySystem, sessionId) {
-    return this.webkitCancelKeyRequest(keySystem, sessionId);
+  [dartx.cancelKeyRequest](...args) {
+    return this.webkitCancelKeyRequest.apply(this, args);
   }
-  [dartx.generateKeyRequest](keySystem, initData) {
-    return this.webkitGenerateKeyRequest(keySystem, initData);
+  [dartx.generateKeyRequest](...args) {
+    return this.webkitGenerateKeyRequest.apply(this, args);
   }
   get [dartx.onKeyAdded]() {
     return html.MediaElement.keyAddedEvent.forElement(this);
@@ -43043,11 +44122,11 @@
   get [dartx.length]() {
     return this.length;
   }
-  [__getter__](index) {
-    return this.__getter__(index);
+  [__getter__](...args) {
+    return this.__getter__.apply(this, args);
   }
-  [dartx.getTrackById](id) {
-    return this.getTrackById(id);
+  [dartx.getTrackById](...args) {
+    return this.getTrackById.apply(this, args);
   }
   get [dartx.onChange]() {
     return html.AudioTrackList.changeEvent.forTarget(this);
@@ -43247,8 +44326,8 @@
   get [dartx.userChoice]() {
     return this.userChoice;
   }
-  [dartx.prompt]() {
-    return this.prompt();
+  [dartx.prompt](...args) {
+    return this.prompt.apply(this, args);
   }
 };
 dart.setSignature(html.BeforeInstallPromptEvent, {
@@ -43303,11 +44382,11 @@
   get [dartx.type]() {
     return this.type;
   }
-  [dartx.close]() {
-    return this.close();
+  [dartx.close](...args) {
+    return this.close.apply(this, args);
   }
-  [dartx.slice](start, end, contentType) {
-    return this.slice(start, end, contentType);
+  [dartx.slice](...args) {
+    return this.slice.apply(this, args);
   }
   static new(blobParts, type, endings) {
     if (type === void 0) type = null;
@@ -43367,8 +44446,8 @@
     let options_1 = html_common.convertDartToNative_Dictionary(options);
     return this[_requestDevice_1](options_1);
   }
-  [_requestDevice_1](options) {
-    return this.requestDevice(options);
+  [_requestDevice_1](...args) {
+    return this.requestDevice.apply(this, args);
   }
 };
 dart.setSignature(html.Bluetooth, {
@@ -43418,8 +44497,8 @@
   get [dartx.vendorIDSource]() {
     return this.vendorIDSource;
   }
-  [dartx.connectGatt]() {
-    return this.connectGATT();
+  [dartx.connectGatt](...args) {
+    return this.connectGATT.apply(this, args);
   }
 };
 dart.setSignature(html.BluetoothDevice, {
@@ -43449,11 +44528,11 @@
   get [dartx.uuid]() {
     return this.uuid;
   }
-  [dartx.readValue]() {
-    return this.readValue();
+  [dartx.readValue](...args) {
+    return this.readValue.apply(this, args);
   }
-  [dartx.writeValue](value) {
-    return this.writeValue(value);
+  [dartx.writeValue](...args) {
+    return this.writeValue.apply(this, args);
   }
 };
 dart.setSignature(html.BluetoothGattCharacteristic, {
@@ -43476,8 +44555,8 @@
   get [dartx.connected]() {
     return this.connected;
   }
-  [dartx.getPrimaryService](service) {
-    return this.getPrimaryService(service);
+  [dartx.getPrimaryService](...args) {
+    return this.getPrimaryService.apply(this, args);
   }
 };
 dart.setSignature(html.BluetoothGattRemoteServer, {
@@ -43501,8 +44580,8 @@
   get [dartx.uuid]() {
     return this.uuid;
   }
-  [dartx.getCharacteristic](characteristic) {
-    return this.getCharacteristic(characteristic);
+  [dartx.getCharacteristic](...args) {
+    return this.getCharacteristic.apply(this, args);
   }
 };
 dart.setSignature(html.BluetoothGattService, {
@@ -43544,17 +44623,17 @@
   get [dartx.bodyUsed]() {
     return this.bodyUsed;
   }
-  [dartx.arrayBuffer]() {
-    return this.arrayBuffer();
+  [dartx.arrayBuffer](...args) {
+    return this.arrayBuffer.apply(this, args);
   }
-  [dartx.blob]() {
-    return this.blob();
+  [dartx.blob](...args) {
+    return this.blob.apply(this, args);
   }
-  [dartx.json]() {
-    return this.json();
+  [dartx.json](...args) {
+    return this.json.apply(this, args);
   }
-  [dartx.text]() {
-    return this.text();
+  [dartx.text](...args) {
+    return this.text.apply(this, args);
   }
 };
 dart.setSignature(html.Body, {
@@ -43828,14 +44907,14 @@
   get [dartx.willValidate]() {
     return this.willValidate;
   }
-  [dartx.checkValidity]() {
-    return this.checkValidity();
+  [dartx.checkValidity](...args) {
+    return this.checkValidity.apply(this, args);
   }
-  [dartx.reportValidity]() {
-    return this.reportValidity();
+  [dartx.reportValidity](...args) {
+    return this.reportValidity.apply(this, args);
   }
-  [dartx.setCustomValidity](error) {
-    return this.setCustomValidity(error);
+  [dartx.setCustomValidity](...args) {
+    return this.setCustomValidity.apply(this, args);
   }
 };
 dart.defineNamedConstructor(html.ButtonElement, 'created');
@@ -43896,26 +44975,26 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.appendData](data) {
-    return this.appendData(data);
+  [dartx.appendData](...args) {
+    return this.appendData.apply(this, args);
   }
-  [dartx.deleteData](offset, count) {
-    return this.deleteData(offset, count);
+  [dartx.deleteData](...args) {
+    return this.deleteData.apply(this, args);
   }
-  [dartx.insertData](offset, data) {
-    return this.insertData(offset, data);
+  [dartx.insertData](...args) {
+    return this.insertData.apply(this, args);
   }
-  [dartx.replaceData](offset, count, data) {
-    return this.replaceData(offset, count, data);
+  [dartx.replaceData](...args) {
+    return this.replaceData.apply(this, args);
   }
-  [dartx.substringData](offset, count) {
-    return this.substringData(offset, count);
+  [dartx.substringData](...args) {
+    return this.substringData.apply(this, args);
   }
-  [dartx.after](nodes) {
-    return this.after(nodes);
+  [dartx.after](...args) {
+    return this.after.apply(this, args);
   }
-  [dartx.before](nodes) {
-    return this.before(nodes);
+  [dartx.before](...args) {
+    return this.before.apply(this, args);
   }
   get [dartx.nextElementSibling]() {
     return this.nextElementSibling;
@@ -43959,11 +45038,11 @@
   get [dartx.wholeText]() {
     return this.wholeText;
   }
-  [dartx.getDestinationInsertionPoints]() {
-    return this.getDestinationInsertionPoints();
+  [dartx.getDestinationInsertionPoints](...args) {
+    return this.getDestinationInsertionPoints.apply(this, args);
   }
-  [dartx.splitText](offset) {
-    return this.splitText(offset);
+  [dartx.splitText](...args) {
+    return this.splitText.apply(this, args);
   }
 };
 dart.setSignature(html.Text, {
@@ -44000,14 +45079,14 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.delete](cacheName) {
-    return this.delete(cacheName);
+  [dartx.delete](...args) {
+    return this.delete.apply(this, args);
   }
-  [dartx.has](cacheName) {
-    return this.has(cacheName);
+  [dartx.has](...args) {
+    return this.has.apply(this, args);
   }
-  [dartx.keys]() {
-    return this.keys();
+  [dartx.keys](...args) {
+    return this.keys.apply(this, args);
   }
   [dartx.match](request, options) {
     if (options === void 0) options = null;
@@ -44017,14 +45096,14 @@
     }
     return this[_match_2](request);
   }
-  [_match_1](request, options) {
-    return this.match(request, options);
+  [_match_1](...args) {
+    return this.match.apply(this, args);
   }
-  [_match_2](request) {
-    return this.match(request);
+  [_match_2](...args) {
+    return this.match.apply(this, args);
   }
-  [dartx.open](cacheName) {
-    return this.open(cacheName);
+  [dartx.open](...args) {
+    return this.open.apply(this, args);
   }
 };
 dart.setSignature(html.CacheStorage, {
@@ -44090,14 +45169,14 @@
     }
     return this[_getContext_2](contextId);
   }
-  [_getContext_1](contextId, attributes) {
-    return this.getContext(contextId, attributes);
+  [_getContext_1](...args) {
+    return this.getContext.apply(this, args);
   }
-  [_getContext_2](contextId) {
-    return this.getContext(contextId);
+  [_getContext_2](...args) {
+    return this.getContext.apply(this, args);
   }
-  [_toDataUrl](type, arguments_OR_quality) {
-    return this.toDataURL(type, arguments_OR_quality);
+  [_toDataUrl](...args) {
+    return this.toDataURL.apply(this, args);
   }
   get [dartx.onWebGlContextLost]() {
     return html.CanvasElement.webGlContextLostEvent.forElement(this);
@@ -44174,8 +45253,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.addColorStop](offset, color) {
-    return this.addColorStop(offset, color);
+  [dartx.addColorStop](...args) {
+    return this.addColorStop.apply(this, args);
   }
 };
 dart.setSignature(html.CanvasGradient, {
@@ -44190,8 +45269,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.setTransform](transform) {
-    return this.setTransform(transform);
+  [dartx.setTransform](...args) {
+    return this.setTransform.apply(this, args);
   }
 };
 dart.setSignature(html.CanvasPattern, {
@@ -44420,23 +45499,23 @@
     this[_addHitRegion_2]();
     return;
   }
-  [_addHitRegion_1](options) {
-    return this.addHitRegion(options);
+  [_addHitRegion_1](...args) {
+    return this.addHitRegion.apply(this, args);
   }
-  [_addHitRegion_2]() {
-    return this.addHitRegion();
+  [_addHitRegion_2](...args) {
+    return this.addHitRegion.apply(this, args);
   }
-  [dartx.beginPath]() {
-    return this.beginPath();
+  [dartx.beginPath](...args) {
+    return this.beginPath.apply(this, args);
   }
-  [dartx.clearHitRegions]() {
-    return this.clearHitRegions();
+  [dartx.clearHitRegions](...args) {
+    return this.clearHitRegions.apply(this, args);
   }
-  [dartx.clearRect](x, y, width, height) {
-    return this.clearRect(x, y, width, height);
+  [dartx.clearRect](...args) {
+    return this.clearRect.apply(this, args);
   }
-  [dartx.clip](path_OR_winding, winding) {
-    return this.clip(path_OR_winding, winding);
+  [dartx.clip](...args) {
+    return this.clip.apply(this, args);
   }
   [dartx.createImageData](imagedata_OR_sw, sh) {
     if (sh === void 0) sh = null;
@@ -44449,53 +45528,53 @@
     }
     dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
   }
-  [_createImageData_1](imagedata) {
-    return this.createImageData(imagedata);
+  [_createImageData_1](...args) {
+    return this.createImageData.apply(this, args);
   }
-  [_createImageData_2](sw, sh) {
-    return this.createImageData(sw, sh);
+  [_createImageData_2](...args) {
+    return this.createImageData.apply(this, args);
   }
-  [dartx.createLinearGradient](x0, y0, x1, y1) {
-    return this.createLinearGradient(x0, y0, x1, y1);
+  [dartx.createLinearGradient](...args) {
+    return this.createLinearGradient.apply(this, args);
   }
-  [dartx.createPattern](image, repetitionType) {
-    return this.createPattern(image, repetitionType);
+  [dartx.createPattern](...args) {
+    return this.createPattern.apply(this, args);
   }
-  [dartx.createRadialGradient](x0, y0, r0, x1, y1, r1) {
-    return this.createRadialGradient(x0, y0, r0, x1, y1, r1);
+  [dartx.createRadialGradient](...args) {
+    return this.createRadialGradient.apply(this, args);
   }
-  [dartx.drawFocusIfNeeded](element_OR_path, element) {
-    return this.drawFocusIfNeeded(element_OR_path, element);
+  [dartx.drawFocusIfNeeded](...args) {
+    return this.drawFocusIfNeeded.apply(this, args);
   }
-  [dartx.fillRect](x, y, width, height) {
-    return this.fillRect(x, y, width, height);
+  [dartx.fillRect](...args) {
+    return this.fillRect.apply(this, args);
   }
   [dartx.getContextAttributes]() {
     return html_common.convertNativeToDart_Dictionary(this[_getContextAttributes_1]());
   }
-  [_getContextAttributes_1]() {
-    return this.getContextAttributes();
+  [_getContextAttributes_1](...args) {
+    return this.getContextAttributes.apply(this, args);
   }
   [dartx.getImageData](sx, sy, sw, sh) {
     return html_common.convertNativeToDart_ImageData(this[_getImageData_1](sx, sy, sw, sh));
   }
-  [_getImageData_1](sx, sy, sw, sh) {
-    return this.getImageData(sx, sy, sw, sh);
+  [_getImageData_1](...args) {
+    return this.getImageData.apply(this, args);
   }
-  [_getLineDash]() {
-    return this.getLineDash();
+  [_getLineDash](...args) {
+    return this.getLineDash.apply(this, args);
   }
-  [dartx.isContextLost]() {
-    return this.isContextLost();
+  [dartx.isContextLost](...args) {
+    return this.isContextLost.apply(this, args);
   }
-  [dartx.isPointInPath](path_OR_x, x_OR_y, winding_OR_y, winding) {
-    return this.isPointInPath(path_OR_x, x_OR_y, winding_OR_y, winding);
+  [dartx.isPointInPath](...args) {
+    return this.isPointInPath.apply(this, args);
   }
-  [dartx.isPointInStroke](path_OR_x, x_OR_y, y) {
-    return this.isPointInStroke(path_OR_x, x_OR_y, y);
+  [dartx.isPointInStroke](...args) {
+    return this.isPointInStroke.apply(this, args);
   }
-  [dartx.measureText](text) {
-    return this.measureText(text);
+  [dartx.measureText](...args) {
+    return this.measureText.apply(this, args);
   }
   [dartx.putImageData](imagedata, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight) {
     if (dirtyX === void 0) dirtyX = null;
@@ -44514,77 +45593,77 @@
     }
     dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
   }
-  [_putImageData_1](imagedata, dx, dy) {
-    return this.putImageData(imagedata, dx, dy);
+  [_putImageData_1](...args) {
+    return this.putImageData.apply(this, args);
   }
-  [_putImageData_2](imagedata, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight) {
-    return this.putImageData(imagedata, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight);
+  [_putImageData_2](...args) {
+    return this.putImageData.apply(this, args);
   }
-  [dartx.removeHitRegion](id) {
-    return this.removeHitRegion(id);
+  [dartx.removeHitRegion](...args) {
+    return this.removeHitRegion.apply(this, args);
   }
-  [dartx.resetTransform]() {
-    return this.resetTransform();
+  [dartx.resetTransform](...args) {
+    return this.resetTransform.apply(this, args);
   }
-  [dartx.restore]() {
-    return this.restore();
+  [dartx.restore](...args) {
+    return this.restore.apply(this, args);
   }
-  [dartx.rotate](angle) {
-    return this.rotate(angle);
+  [dartx.rotate](...args) {
+    return this.rotate.apply(this, args);
   }
-  [dartx.save]() {
-    return this.save();
+  [dartx.save](...args) {
+    return this.save.apply(this, args);
   }
-  [dartx.scale](x, y) {
-    return this.scale(x, y);
+  [dartx.scale](...args) {
+    return this.scale.apply(this, args);
   }
-  [dartx.scrollPathIntoView](path) {
-    return this.scrollPathIntoView(path);
+  [dartx.scrollPathIntoView](...args) {
+    return this.scrollPathIntoView.apply(this, args);
   }
-  [dartx.setTransform](a, b, c, d, e, f) {
-    return this.setTransform(a, b, c, d, e, f);
+  [dartx.setTransform](...args) {
+    return this.setTransform.apply(this, args);
   }
-  [dartx.stroke](path) {
-    return this.stroke(path);
+  [dartx.stroke](...args) {
+    return this.stroke.apply(this, args);
   }
-  [dartx.strokeRect](x, y, width, height) {
-    return this.strokeRect(x, y, width, height);
+  [dartx.strokeRect](...args) {
+    return this.strokeRect.apply(this, args);
   }
-  [dartx.strokeText](text, x, y, maxWidth) {
-    return this.strokeText(text, x, y, maxWidth);
+  [dartx.strokeText](...args) {
+    return this.strokeText.apply(this, args);
   }
-  [dartx.transform](a, b, c, d, e, f) {
-    return this.transform(a, b, c, d, e, f);
+  [dartx.transform](...args) {
+    return this.transform.apply(this, args);
   }
-  [dartx.translate](x, y) {
-    return this.translate(x, y);
+  [dartx.translate](...args) {
+    return this.translate.apply(this, args);
   }
-  [_arc](x, y, radius, startAngle, endAngle, anticlockwise) {
-    return this.arc(x, y, radius, startAngle, endAngle, anticlockwise);
+  [_arc](...args) {
+    return this.arc.apply(this, args);
   }
-  [dartx.arcTo](x1, y1, x2, y2, radius) {
-    return this.arcTo(x1, y1, x2, y2, radius);
+  [dartx.arcTo](...args) {
+    return this.arcTo.apply(this, args);
   }
-  [dartx.bezierCurveTo](cp1x, cp1y, cp2x, cp2y, x, y) {
-    return this.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
+  [dartx.bezierCurveTo](...args) {
+    return this.bezierCurveTo.apply(this, args);
   }
-  [dartx.closePath]() {
-    return this.closePath();
+  [dartx.closePath](...args) {
+    return this.closePath.apply(this, args);
   }
-  [dartx.ellipse](x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
-    return this.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
+  [dartx.ellipse](...args) {
+    return this.ellipse.apply(this, args);
   }
-  [dartx.lineTo](x, y) {
-    return this.lineTo(x, y);
+  [dartx.lineTo](...args) {
+    return this.lineTo.apply(this, args);
   }
-  [dartx.moveTo](x, y) {
-    return this.moveTo(x, y);
+  [dartx.moveTo](...args) {
+    return this.moveTo.apply(this, args);
   }
-  [dartx.quadraticCurveTo](cpx, cpy, x, y) {
-    return this.quadraticCurveTo(cpx, cpy, x, y);
+  [dartx.quadraticCurveTo](...args) {
+    return this.quadraticCurveTo.apply(this, args);
   }
-  [dartx.rect](x, y, width, height) {
-    return this.rect(x, y, width, height);
+  [dartx.rect](...args) {
+    return this.rect.apply(this, args);
   }
   [dartx.createImageDataFromImageData](imagedata) {
     return this.createImageData(imagedata);
@@ -44620,14 +45699,14 @@
       this[dartx.drawImageScaledFromSource](source, sourceRect[dartx.left], sourceRect[dartx.top], sourceRect[dartx.width], sourceRect[dartx.height], destRect[dartx.left], destRect[dartx.top], destRect[dartx.width], destRect[dartx.height]);
     }
   }
-  [dartx.drawImage](source, destX, destY) {
-    return this.drawImage(source, destX, destY);
+  [dartx.drawImage](...args) {
+    return this.drawImage.apply(this, args);
   }
-  [dartx.drawImageScaled](source, destX, destY, destWidth, destHeight) {
-    return this.drawImage(source, destX, destY, destWidth, destHeight);
+  [dartx.drawImageScaled](...args) {
+    return this.drawImage.apply(this, args);
   }
-  [dartx.drawImageScaledFromSource](source, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight) {
-    return this.drawImage(source, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight);
+  [dartx.drawImageScaledFromSource](...args) {
+    return this.drawImage.apply(this, args);
   }
   get [dartx.lineDashOffset]() {
     return this.lineDashOffset || this.webkitLineDashOffset;
@@ -44874,11 +45953,11 @@
     this[_postMessage_2](message_1);
     return;
   }
-  [_postMessage_1](message, transfer) {
-    return this.postMessage(message, transfer);
+  [_postMessage_1](...args) {
+    return this.postMessage.apply(this, args);
   }
-  [_postMessage_2](message) {
-    return this.postMessage(message);
+  [_postMessage_2](...args) {
+    return this.postMessage.apply(this, args);
   }
 };
 dart.setSignature(html.Client, {
@@ -44906,8 +45985,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.claim]() {
-    return this.claim();
+  [dartx.claim](...args) {
+    return this.claim.apply(this, args);
   }
   [dartx.matchAll](options) {
     if (options === void 0) options = null;
@@ -44917,14 +45996,14 @@
     }
     return this[_matchAll_2]();
   }
-  [_matchAll_1](options) {
-    return this.matchAll(options);
+  [_matchAll_1](...args) {
+    return this.matchAll.apply(this, args);
   }
-  [_matchAll_2]() {
-    return this.matchAll();
+  [_matchAll_2](...args) {
+    return this.matchAll.apply(this, args);
   }
-  [dartx.openWindow](url) {
-    return this.openWindow(url);
+  [dartx.openWindow](...args) {
+    return this.openWindow.apply(this, args);
   }
 };
 dart.setSignature(html.Clients, {
@@ -45082,8 +46161,8 @@
   get [_which]() {
     return this.which;
   }
-  [_initUIEvent](type, bubbles, cancelable, view, detail) {
-    return this.initUIEvent(type, bubbles, cancelable, view, detail);
+  [_initUIEvent](...args) {
+    return this.initUIEvent.apply(this, args);
   }
 };
 dart.setSignature(html.UIEvent, {
@@ -45146,8 +46225,8 @@
   get [dartx.data]() {
     return this.data;
   }
-  [_initCompositionEvent](type, bubbles, cancelable, view, data) {
-    return this.initCompositionEvent(type, bubbles, cancelable, view, data);
+  [_initCompositionEvent](...args) {
+    return this.initCompositionEvent.apply(this, args);
   }
 };
 dart.setSignature(html.CompositionEvent, {
@@ -45206,11 +46285,11 @@
   set [dartx.transform](value) {
     this.transform = value;
   }
-  [dartx.disconnect]() {
-    return this.disconnect();
+  [dartx.disconnect](...args) {
+    return this.disconnect.apply(this, args);
   }
-  [dartx.supports](attribute) {
-    return this.supports(attribute);
+  [dartx.supports](...args) {
+    return this.supports.apply(this, args);
   }
 };
 dart.setSignature(html.CompositorProxy, {
@@ -45259,14 +46338,14 @@
     this[_postMessage_2](message_1);
     return;
   }
-  [_postMessage_1](message, transfer) {
-    return this.postMessage(message, transfer);
+  [_postMessage_1](...args) {
+    return this.postMessage.apply(this, args);
   }
-  [_postMessage_2](message) {
-    return this.postMessage(message);
+  [_postMessage_2](...args) {
+    return this.postMessage.apply(this, args);
   }
-  [dartx.terminate]() {
-    return this.terminate();
+  [dartx.terminate](...args) {
+    return this.terminate.apply(this, args);
   }
   get [dartx.onError]() {
     return html.CompositorWorker.errorEvent.forTarget(this);
@@ -45365,8 +46444,8 @@
   get [dartx.self]() {
     return this.self;
   }
-  [dartx.close]() {
-    return this.close();
+  [dartx.close](...args) {
+    return this.close.apply(this, args);
   }
   [dartx.fetch](input, init) {
     if (init === void 0) init = null;
@@ -45376,17 +46455,17 @@
     }
     return this[_fetch_2](input);
   }
-  [_fetch_1](input, init) {
-    return this.fetch(input, init);
+  [_fetch_1](...args) {
+    return this.fetch.apply(this, args);
   }
-  [_fetch_2](input) {
-    return this.fetch(input);
+  [_fetch_2](...args) {
+    return this.fetch.apply(this, args);
   }
-  [dartx.importScripts](urls) {
-    return this.importScripts(urls);
+  [dartx.importScripts](...args) {
+    return this.importScripts.apply(this, args);
   }
-  [_webkitRequestFileSystem](type, size, successCallback, errorCallback) {
-    return this.webkitRequestFileSystem(type, size, successCallback, errorCallback);
+  [_webkitRequestFileSystem](...args) {
+    return this.webkitRequestFileSystem.apply(this, args);
   }
   [dartx.webkitRequestFileSystem](type, size) {
     let completer = CompleterOfFileSystem().new();
@@ -45397,14 +46476,14 @@
     }, FileErrorTovoid()));
     return completer.future;
   }
-  [dartx.requestFileSystemSync](type, size) {
-    return this.webkitRequestFileSystemSync(type, size);
+  [dartx.requestFileSystemSync](...args) {
+    return this.webkitRequestFileSystemSync.apply(this, args);
   }
-  [dartx.resolveLocalFileSystemSyncUrl](url) {
-    return this.webkitResolveLocalFileSystemSyncURL(url);
+  [dartx.resolveLocalFileSystemSyncUrl](...args) {
+    return this.webkitResolveLocalFileSystemSyncURL.apply(this, args);
   }
-  [_webkitResolveLocalFileSystemUrl](url, successCallback, errorCallback) {
-    return this.webkitResolveLocalFileSystemURL(url, successCallback, errorCallback);
+  [_webkitResolveLocalFileSystemUrl](...args) {
+    return this.webkitResolveLocalFileSystemURL.apply(this, args);
   }
   [dartx.webkitResolveLocalFileSystemUrl](url) {
     let completer = CompleterOfEntry().new();
@@ -45415,29 +46494,29 @@
     }, FileErrorTovoid()));
     return completer.future;
   }
-  [dartx.atob](atob) {
-    return this.atob(atob);
+  [dartx.atob](...args) {
+    return this.atob.apply(this, args);
   }
-  [dartx.btoa](btoa) {
-    return this.btoa(btoa);
+  [dartx.btoa](...args) {
+    return this.btoa.apply(this, args);
   }
-  [_setInterval_String](handler, timeout, arguments$) {
-    return this.setInterval(handler, timeout, arguments$);
+  [_setInterval_String](...args) {
+    return this.setInterval.apply(this, args);
   }
-  [_setTimeout_String](handler, timeout, arguments$) {
-    return this.setTimeout(handler, timeout, arguments$);
+  [_setTimeout_String](...args) {
+    return this.setTimeout.apply(this, args);
   }
-  [_clearInterval](handle) {
-    return this.clearInterval(handle);
+  [_clearInterval](...args) {
+    return this.clearInterval.apply(this, args);
   }
-  [_clearTimeout](handle) {
-    return this.clearTimeout(handle);
+  [_clearTimeout](...args) {
+    return this.clearTimeout.apply(this, args);
   }
-  [_setInterval](handler, timeout) {
-    return this.setInterval(handler, timeout);
+  [_setInterval](...args) {
+    return this.setInterval.apply(this, args);
   }
-  [_setTimeout](handler, timeout) {
-    return this.setTimeout(handler, timeout);
+  [_setTimeout](...args) {
+    return this.setTimeout.apply(this, args);
   }
   get [dartx.onError]() {
     return html.WorkerGlobalScope.errorEvent.forTarget(this);
@@ -45502,8 +46581,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.cancelAnimationFrame](handle) {
-    return this.cancelAnimationFrame(handle);
+  [dartx.cancelAnimationFrame](...args) {
+    return this.cancelAnimationFrame.apply(this, args);
   }
   [dartx.postMessage](message, transfer) {
     if (transfer === void 0) transfer = null;
@@ -45516,14 +46595,14 @@
     this[_postMessage_2](message_1);
     return;
   }
-  [_postMessage_1](message, transfer) {
-    return this.postMessage(message, transfer);
+  [_postMessage_1](...args) {
+    return this.postMessage.apply(this, args);
   }
-  [_postMessage_2](message) {
-    return this.postMessage(message);
+  [_postMessage_2](...args) {
+    return this.postMessage.apply(this, args);
   }
-  [dartx.requestAnimationFrame](callback) {
-    return this.requestAnimationFrame(callback);
+  [dartx.requestAnimationFrame](...args) {
+    return this.requestAnimationFrame.apply(this, args);
   }
   get [dartx.onMessage]() {
     return html.CompositorWorkerGlobalScope.messageEvent.forTarget(this);
@@ -45673,14 +46752,14 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.assertCondition](condition, arg) {
-    return this.assert(condition, arg);
+  [dartx.assertCondition](...args) {
+    return this.assert.apply(this, args);
   }
-  [dartx.timeline](title) {
-    return this.timeline(title);
+  [dartx.timeline](...args) {
+    return this.timeline.apply(this, args);
   }
-  [dartx.timelineEnd](title) {
-    return this.timelineEnd(title);
+  [dartx.timelineEnd](...args) {
+    return this.timelineEnd.apply(this, args);
   }
 };
 dart.setSignature(html.ConsoleBase, {
@@ -45716,8 +46795,8 @@
   set [dartx.select](value) {
     this.select = value;
   }
-  [dartx.getDistributedNodes]() {
-    return this.getDistributedNodes();
+  [dartx.getDistributedNodes](...args) {
+    return this.getDistributedNodes.apply(this, args);
   }
 };
 dart.defineNamedConstructor(html.ContentElement, 'created');
@@ -45824,8 +46903,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.notifySignedIn](credential) {
-    return this.notifySignedIn(credential);
+  [dartx.notifySignedIn](...args) {
+    return this.notifySignedIn.apply(this, args);
   }
   [dartx.request](options) {
     if (options === void 0) options = null;
@@ -45835,14 +46914,14 @@
     }
     return this[_request_2]();
   }
-  [_request_1](options) {
-    return this.request(options);
+  [_request_1](...args) {
+    return this.request.apply(this, args);
   }
-  [_request_2]() {
-    return this.request();
+  [_request_2](...args) {
+    return this.request.apply(this, args);
   }
-  [dartx.requireUserMediation]() {
-    return this.requireUserMediation();
+  [dartx.requireUserMediation](...args) {
+    return this.requireUserMediation.apply(this, args);
   }
 };
 dart.setSignature(html.CredentialsContainer, {
@@ -45867,8 +46946,8 @@
   get [dartx.client]() {
     return this.client;
   }
-  [dartx.acceptConnection](shouldAccept) {
-    return this.acceptConnection(shouldAccept);
+  [dartx.acceptConnection](...args) {
+    return this.acceptConnection.apply(this, args);
   }
 };
 dart.setSignature(html.CrossOriginConnectEvent, {
@@ -45903,11 +46982,11 @@
     this[_postMessage_2](message_1);
     return;
   }
-  [_postMessage_1](message, transfer) {
-    return this.postMessage(message, transfer);
+  [_postMessage_1](...args) {
+    return this.postMessage.apply(this, args);
   }
-  [_postMessage_2](message) {
-    return this.postMessage(message);
+  [_postMessage_2](...args) {
+    return this.postMessage.apply(this, args);
   }
 };
 dart.setSignature(html.CrossOriginServiceWorkerClient, {
@@ -45941,8 +47020,8 @@
   get [dartx.subtle]() {
     return this.subtle;
   }
-  [_getRandomValues](array) {
-    return this.getRandomValues(array);
+  [_getRandomValues](...args) {
+    return this.getRandomValues.apply(this, args);
   }
 };
 dart.setSignature(html.Crypto, {
@@ -46111,11 +47190,11 @@
   get [dartx.cssRules]() {
     return this.cssRules;
   }
-  [dartx.deleteRule](index) {
-    return this.deleteRule(index);
+  [dartx.deleteRule](...args) {
+    return this.deleteRule.apply(this, args);
   }
-  [dartx.insertRule](rule, index) {
-    return this.insertRule(rule, index);
+  [dartx.insertRule](...args) {
+    return this.insertRule.apply(this, args);
   }
 };
 dart.setSignature(html.CssGroupingRule, {
@@ -46181,6 +47260,8 @@
   })
 });
 dart.registerExtension(dart.global.CSSKeyframeRule, html.CssKeyframeRule);
+dart.registerExtension(dart.global.MozCSSKeyframeRule, html.CssKeyframeRule);
+dart.registerExtension(dart.global.WebKitCSSKeyframeRule, html.CssKeyframeRule);
 dart.defineExtensionNames([
   'appendRule',
   'deleteRule',
@@ -46201,17 +47282,17 @@
   set [dartx.name](value) {
     this.name = value;
   }
-  [__getter__](index) {
-    return this.__getter__(index);
+  [__getter__](...args) {
+    return this.__getter__.apply(this, args);
   }
-  [dartx.appendRule](rule) {
-    return this.appendRule(rule);
+  [dartx.appendRule](...args) {
+    return this.appendRule.apply(this, args);
   }
-  [dartx.deleteRule](select) {
-    return this.deleteRule(select);
+  [dartx.deleteRule](...args) {
+    return this.deleteRule.apply(this, args);
   }
-  [dartx.findRule](select) {
-    return this.findRule(select);
+  [dartx.findRule](...args) {
+    return this.findRule.apply(this, args);
   }
 };
 dart.setSignature(html.CssKeyframesRule, {
@@ -46228,6 +47309,8 @@
   })
 });
 dart.registerExtension(dart.global.CSSKeyframesRule, html.CssKeyframesRule);
+dart.registerExtension(dart.global.MozCSSKeyframesRule, html.CssKeyframesRule);
+dart.registerExtension(dart.global.WebKitCSSKeyframesRule, html.CssKeyframesRule);
 dart.defineExtensionNames([
   'media'
 ]);
@@ -50747,17 +51830,17 @@
   get [dartx.parentRule]() {
     return this.parentRule;
   }
-  [dartx.getPropertyPriority](property) {
-    return this.getPropertyPriority(property);
+  [dartx.getPropertyPriority](...args) {
+    return this.getPropertyPriority.apply(this, args);
   }
-  [_getPropertyValue](property) {
-    return this.getPropertyValue(property);
+  [_getPropertyValue](...args) {
+    return this.getPropertyValue.apply(this, args);
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
-  [dartx.removeProperty](property) {
-    return this.removeProperty(property);
+  [dartx.removeProperty](...args) {
+    return this.removeProperty.apply(this, args);
   }
   get [dartx.background]() {
     return this[_background];
@@ -51969,6 +53052,8 @@
   }
 });
 dart.registerExtension(dart.global.CSSStyleDeclaration, html.CssStyleDeclaration);
+dart.registerExtension(dart.global.MSStyleCSSProperties, html.CssStyleDeclaration);
+dart.registerExtension(dart.global.CSS2Properties, html.CssStyleDeclaration);
 const _elementIterable = Symbol('_elementIterable');
 const _elementCssStyleDeclarationSetIterable = Symbol('_elementCssStyleDeclarationSetIterable');
 const _setAll = Symbol('_setAll');
@@ -52737,17 +53822,17 @@
   get [dartx.rules]() {
     return this.rules;
   }
-  [dartx.addRule](selector, style, index) {
-    return this.addRule(selector, style, index);
+  [dartx.addRule](...args) {
+    return this.addRule.apply(this, args);
   }
-  [dartx.deleteRule](index) {
-    return this.deleteRule(index);
+  [dartx.deleteRule](...args) {
+    return this.deleteRule.apply(this, args);
   }
-  [dartx.insertRule](rule, index) {
-    return this.insertRule(rule, index);
+  [dartx.insertRule](...args) {
+    return this.insertRule.apply(this, args);
   }
-  [dartx.removeRule](index) {
-    return this.removeRule(index);
+  [dartx.removeRule](...args) {
+    return this.removeRule.apply(this, args);
   }
 };
 dart.setSignature(html.CssStyleSheet, {
@@ -52781,11 +53866,11 @@
   get [dartx.cssRules]() {
     return this.cssRules;
   }
-  [dartx.deleteRule](index) {
-    return this.deleteRule(index);
+  [dartx.deleteRule](...args) {
+    return this.deleteRule.apply(this, args);
   }
-  [dartx.insertRule](rule, index) {
-    return this.insertRule(rule, index);
+  [dartx.insertRule](...args) {
+    return this.insertRule.apply(this, args);
   }
 };
 dart.setSignature(html.CssSupportsRule, {
@@ -52875,8 +53960,8 @@
   get [_get__detail]() {
     return this.detail;
   }
-  [_initCustomEvent](type, bubbles, cancelable, detail) {
-    return this.initCustomEvent(type, bubbles, cancelable, detail);
+  [_initCustomEvent](...args) {
+    return this.initCustomEvent.apply(this, args);
   }
 };
 dart.setSignature(html.CustomEvent, {
@@ -52988,17 +54073,17 @@
   get [dartx.types]() {
     return this.types;
   }
-  [dartx.clearData](format) {
-    return this.clearData(format);
+  [dartx.clearData](...args) {
+    return this.clearData.apply(this, args);
   }
-  [dartx.getData](format) {
-    return this.getData(format);
+  [dartx.getData](...args) {
+    return this.getData.apply(this, args);
   }
-  [dartx.setData](format, data) {
-    return this.setData(format, data);
+  [dartx.setData](...args) {
+    return this.setData.apply(this, args);
   }
-  [dartx.setDragImage](image, x, y) {
-    return this.setDragImage(image, x, y);
+  [dartx.setDragImage](...args) {
+    return this.setDragImage.apply(this, args);
   }
 };
 dart.setSignature(html.DataTransfer, {
@@ -53036,11 +54121,11 @@
   get [dartx.type]() {
     return this.type;
   }
-  [dartx.getAsFile]() {
-    return this.getAsFile();
+  [dartx.getAsFile](...args) {
+    return this.getAsFile.apply(this, args);
   }
-  [_getAsString](callback) {
-    return this.getAsString(callback);
+  [_getAsString](...args) {
+    return this.getAsString.apply(this, args);
   }
   [dartx.getAsString]() {
     let completer = CompleterOfString().new();
@@ -53049,8 +54134,8 @@
     }, StringTovoid()));
     return completer.future;
   }
-  [dartx.getAsEntry]() {
-    return this.webkitGetAsEntry();
+  [dartx.getAsEntry](...args) {
+    return this.webkitGetAsEntry.apply(this, args);
   }
 };
 dart.setSignature(html.DataTransferItem, {
@@ -53074,7 +54159,7 @@
   'clear',
   'item',
   'remove',
-  'get',
+  '_get',
   'length'
 ]);
 html.DataTransferItemList = class DataTransferItemList extends _interceptors.Interceptor {
@@ -53084,25 +54169,25 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.add](data_OR_file, type) {
-    return this.add(data_OR_file, type);
+  [dartx.add](...args) {
+    return this.add.apply(this, args);
   }
-  [dartx.addData](data, type) {
-    return this.add(data, type);
+  [dartx.addData](...args) {
+    return this.add.apply(this, args);
   }
-  [dartx.addFile](file) {
-    return this.add(file);
+  [dartx.addFile](...args) {
+    return this.add.apply(this, args);
   }
-  [dartx.clear]() {
-    return this.clear();
+  [dartx.clear](...args) {
+    return this.clear.apply(this, args);
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
-  [dartx.remove](index) {
-    return this.remove(index);
+  [dartx.remove](...args) {
+    return this.remove.apply(this, args);
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     return this[index];
   }
 };
@@ -53116,7 +54201,7 @@
     [dartx.clear]: dart.definiteFunctionType(dart.void, []),
     [dartx.item]: dart.definiteFunctionType(html.DataTransferItem, [core.int]),
     [dartx.remove]: dart.definiteFunctionType(dart.void, [core.int]),
-    [dartx.get]: dart.definiteFunctionType(html.DataTransferItem, [core.int])
+    [dartx._get]: dart.definiteFunctionType(html.DataTransferItem, [core.int])
   })
 });
 dart.registerExtension(dart.global.DataTransferItemList, html.DataTransferItemList);
@@ -53140,11 +54225,11 @@
     this[_postMessage_2](message_1);
     return;
   }
-  [_postMessage_1](message, transfer) {
-    return this.postMessage(message, transfer);
+  [_postMessage_1](...args) {
+    return this.postMessage.apply(this, args);
   }
-  [_postMessage_2](message) {
-    return this.postMessage(message);
+  [_postMessage_2](...args) {
+    return this.postMessage.apply(this, args);
   }
   get [dartx.onMessage]() {
     return html.DedicatedWorkerGlobalScope.messageEvent.forTarget(this);
@@ -53212,11 +54297,11 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.queryUsageAndQuota](storageType, usageCallback, errorCallback) {
-    return this.queryUsageAndQuota(storageType, usageCallback, errorCallback);
+  [dartx.queryUsageAndQuota](...args) {
+    return this.queryUsageAndQuota.apply(this, args);
   }
-  [dartx.requestQuota](storageType, newQuotaInBytes, quotaCallback, errorCallback) {
-    return this.requestQuota(storageType, newQuotaInBytes, quotaCallback, errorCallback);
+  [dartx.requestQuota](...args) {
+    return this.requestQuota.apply(this, args);
   }
 };
 dart.setSignature(html.DeprecatedStorageInfo, {
@@ -53241,11 +54326,11 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.queryUsageAndQuota](usageCallback, errorCallback) {
-    return this.queryUsageAndQuota(usageCallback, errorCallback);
+  [dartx.queryUsageAndQuota](...args) {
+    return this.queryUsageAndQuota.apply(this, args);
   }
-  [dartx.requestQuota](newQuotaInBytes, quotaCallback, errorCallback) {
-    return this.requestQuota(newQuotaInBytes, quotaCallback, errorCallback);
+  [dartx.requestQuota](...args) {
+    return this.requestQuota.apply(this, args);
   }
 };
 dart.setSignature(html.DeprecatedStorageQuota, {
@@ -53380,8 +54465,8 @@
   get [dartx.rotationRate]() {
     return this.rotationRate;
   }
-  [dartx.initDeviceMotionEvent](type, bubbles, cancelable, acceleration, accelerationIncludingGravity, rotationRate, interval) {
-    return this.initDeviceMotionEvent(type, bubbles, cancelable, acceleration, accelerationIncludingGravity, rotationRate, interval);
+  [dartx.initDeviceMotionEvent](...args) {
+    return this.initDeviceMotionEvent.apply(this, args);
   }
 };
 dart.setSignature(html.DeviceMotionEvent, {
@@ -53429,8 +54514,8 @@
   get [dartx.gamma]() {
     return this.gamma;
   }
-  [_initDeviceOrientationEvent](type, bubbles, cancelable, alpha, beta, gamma, absolute) {
-    return this.initDeviceOrientationEvent(type, bubbles, cancelable, alpha, beta, gamma, absolute);
+  [_initDeviceOrientationEvent](...args) {
+    return this.initDeviceOrientationEvent.apply(this, args);
   }
 };
 dart.setSignature(html.DeviceOrientationEvent, {
@@ -53503,14 +54588,14 @@
   set [dartx.returnValue](value) {
     this.returnValue = value;
   }
-  [dartx.close](returnValue) {
-    return this.close(returnValue);
+  [dartx.close](...args) {
+    return this.close.apply(this, args);
   }
-  [dartx.show]() {
-    return this.show();
+  [dartx.show](...args) {
+    return this.show.apply(this, args);
   }
-  [dartx.showModal]() {
-    return this.showModal();
+  [dartx.showModal](...args) {
+    return this.showModal.apply(this, args);
   }
 };
 dart.defineNamedConstructor(html.DialogElement, 'created');
@@ -53580,8 +54665,8 @@
   get [dartx.name]() {
     return this.name;
   }
-  [_copyTo](parent, opts) {
-    return this.copyTo(parent, opts);
+  [_copyTo](...args) {
+    return this.copyTo.apply(this, args);
   }
   [dartx.copyTo](parent, opts) {
     let name = opts && 'name' in opts ? opts.name : null;
@@ -53593,8 +54678,8 @@
       }, FileErrorTovoid())});
     return completer.future;
   }
-  [_getMetadata](successCallback, errorCallback) {
-    return this.getMetadata(successCallback, errorCallback);
+  [_getMetadata](...args) {
+    return this.getMetadata.apply(this, args);
   }
   [dartx.getMetadata]() {
     let completer = CompleterOfMetadata().new();
@@ -53605,8 +54690,8 @@
     }, FileErrorTovoid()));
     return completer.future;
   }
-  [_getParent](successCallback, errorCallback) {
-    return this.getParent(successCallback, errorCallback);
+  [_getParent](...args) {
+    return this.getParent.apply(this, args);
   }
   [dartx.getParent]() {
     let completer = CompleterOfEntry().new();
@@ -53617,8 +54702,8 @@
     }, FileErrorTovoid()));
     return completer.future;
   }
-  [_moveTo](parent, opts) {
-    return this.moveTo(parent, opts);
+  [_moveTo](...args) {
+    return this.moveTo.apply(this, args);
   }
   [dartx.moveTo](parent, opts) {
     let name = opts && 'name' in opts ? opts.name : null;
@@ -53630,8 +54715,8 @@
       }, FileErrorTovoid())});
     return completer.future;
   }
-  [_remove](successCallback, errorCallback) {
-    return this.remove(successCallback, errorCallback);
+  [_remove](...args) {
+    return this.remove.apply(this, args);
   }
   [dartx.remove]() {
     let completer = async.Completer.new();
@@ -53642,8 +54727,8 @@
     }, FileErrorTovoid()));
     return completer.future;
   }
-  [dartx.toUrl]() {
-    return this.toURL();
+  [dartx.toUrl](...args) {
+    return this.toURL.apply(this, args);
   }
 };
 dart.setSignature(html.Entry, {
@@ -53696,8 +54781,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.createReader]() {
-    return this.createReader();
+  [dartx.createReader](...args) {
+    return this.createReader.apply(this, args);
   }
   [__getDirectory](path, opts) {
     let options = opts && 'options' in opts ? opts.options : null;
@@ -53721,17 +54806,17 @@
     this[__getDirectory_4](path);
     return;
   }
-  [__getDirectory_1](path, options, successCallback, errorCallback) {
-    return this.getDirectory(path, options, successCallback, errorCallback);
+  [__getDirectory_1](...args) {
+    return this.getDirectory.apply(this, args);
   }
-  [__getDirectory_2](path, options, successCallback) {
-    return this.getDirectory(path, options, successCallback);
+  [__getDirectory_2](...args) {
+    return this.getDirectory.apply(this, args);
   }
-  [__getDirectory_3](path, options) {
-    return this.getDirectory(path, options);
+  [__getDirectory_3](...args) {
+    return this.getDirectory.apply(this, args);
   }
-  [__getDirectory_4](path) {
-    return this.getDirectory(path);
+  [__getDirectory_4](...args) {
+    return this.getDirectory.apply(this, args);
   }
   [_getDirectory](path, opts) {
     let options = opts && 'options' in opts ? opts.options : null;
@@ -53765,17 +54850,17 @@
     this[__getFile_4](path);
     return;
   }
-  [__getFile_1](path, options, successCallback, errorCallback) {
-    return this.getFile(path, options, successCallback, errorCallback);
+  [__getFile_1](...args) {
+    return this.getFile.apply(this, args);
   }
-  [__getFile_2](path, options, successCallback) {
-    return this.getFile(path, options, successCallback);
+  [__getFile_2](...args) {
+    return this.getFile.apply(this, args);
   }
-  [__getFile_3](path, options) {
-    return this.getFile(path, options);
+  [__getFile_3](...args) {
+    return this.getFile.apply(this, args);
   }
-  [__getFile_4](path) {
-    return this.getFile(path);
+  [__getFile_4](...args) {
+    return this.getFile.apply(this, args);
   }
   [_getFile](path, opts) {
     let options = opts && 'options' in opts ? opts.options : null;
@@ -53787,8 +54872,8 @@
       }, FileErrorTovoid())});
     return completer.future;
   }
-  [_removeRecursively](successCallback, errorCallback) {
-    return this.removeRecursively(successCallback, errorCallback);
+  [_removeRecursively](...args) {
+    return this.removeRecursively.apply(this, args);
   }
   [dartx.removeRecursively]() {
     let completer = async.Completer.new();
@@ -53833,8 +54918,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [_readEntries](successCallback, errorCallback) {
-    return this.readEntries(successCallback, errorCallback);
+  [_readEntries](...args) {
+    return this.readEntries.apply(this, args);
   }
   [dartx.readEntries]() {
     let completer = CompleterOfListOfEntry().new();
@@ -54131,93 +55216,93 @@
   get [_webkitVisibilityState]() {
     return this.webkitVisibilityState;
   }
-  [dartx.adoptNode](node) {
-    return this.adoptNode(node);
+  [dartx.adoptNode](...args) {
+    return this.adoptNode.apply(this, args);
   }
-  [_caretRangeFromPoint](x, y) {
-    return this.caretRangeFromPoint(x, y);
+  [_caretRangeFromPoint](...args) {
+    return this.caretRangeFromPoint.apply(this, args);
   }
-  [dartx.createDocumentFragment]() {
-    return this.createDocumentFragment();
+  [dartx.createDocumentFragment](...args) {
+    return this.createDocumentFragment.apply(this, args);
   }
-  [_createElement](localName_OR_tagName, typeExtension) {
-    return this.createElement(localName_OR_tagName, typeExtension);
+  [_createElement](...args) {
+    return this.createElement.apply(this, args);
   }
-  [_createElementNS](namespaceURI, qualifiedName, typeExtension) {
-    return this.createElementNS(namespaceURI, qualifiedName, typeExtension);
+  [_createElementNS](...args) {
+    return this.createElementNS.apply(this, args);
   }
-  [_createEvent](eventType) {
-    return this.createEvent(eventType);
+  [_createEvent](...args) {
+    return this.createEvent.apply(this, args);
   }
-  [dartx.createRange]() {
-    return this.createRange();
+  [dartx.createRange](...args) {
+    return this.createRange.apply(this, args);
   }
-  [_createTextNode](data) {
-    return this.createTextNode(data);
+  [_createTextNode](...args) {
+    return this.createTextNode.apply(this, args);
   }
   [_createTouch](window, target, identifier, pageX, pageY, screenX, screenY, radiusX, radiusY, rotationAngle, force) {
     let target_1 = html._convertDartToNative_EventTarget(target);
     return this[_createTouch_1](window, target_1, identifier, pageX, pageY, screenX, screenY, radiusX, radiusY, rotationAngle, force);
   }
-  [_createTouch_1](window, target, identifier, pageX, pageY, screenX, screenY, radiusX, radiusY, rotationAngle, force) {
-    return this.createTouch(window, target, identifier, pageX, pageY, screenX, screenY, radiusX, radiusY, rotationAngle, force);
+  [_createTouch_1](...args) {
+    return this.createTouch.apply(this, args);
   }
-  [_createTouchList](touches) {
-    return this.createTouchList(touches);
+  [_createTouchList](...args) {
+    return this.createTouchList.apply(this, args);
   }
-  [_elementFromPoint](x, y) {
-    return this.elementFromPoint(x, y);
+  [_elementFromPoint](...args) {
+    return this.elementFromPoint.apply(this, args);
   }
-  [dartx.elementsFromPoint](x, y) {
-    return this.elementsFromPoint(x, y);
+  [dartx.elementsFromPoint](...args) {
+    return this.elementsFromPoint.apply(this, args);
   }
-  [dartx.execCommand](commandId, showUI, value) {
-    return this.execCommand(commandId, showUI, value);
+  [dartx.execCommand](...args) {
+    return this.execCommand.apply(this, args);
   }
-  [dartx.exitFullscreen]() {
-    return this.exitFullscreen();
+  [dartx.exitFullscreen](...args) {
+    return this.exitFullscreen.apply(this, args);
   }
-  [dartx.exitPointerLock]() {
-    return this.exitPointerLock();
+  [dartx.exitPointerLock](...args) {
+    return this.exitPointerLock.apply(this, args);
   }
-  [_getCssCanvasContext](contextId, name, width, height) {
-    return this.getCSSCanvasContext(contextId, name, width, height);
+  [_getCssCanvasContext](...args) {
+    return this.getCSSCanvasContext.apply(this, args);
   }
-  [dartx.getElementsByClassName](classNames) {
-    return this.getElementsByClassName(classNames);
+  [dartx.getElementsByClassName](...args) {
+    return this.getElementsByClassName.apply(this, args);
   }
-  [dartx.getElementsByName](elementName) {
-    return this.getElementsByName(elementName);
+  [dartx.getElementsByName](...args) {
+    return this.getElementsByName.apply(this, args);
   }
-  [dartx.getElementsByTagName](localName) {
-    return this.getElementsByTagName(localName);
+  [dartx.getElementsByTagName](...args) {
+    return this.getElementsByTagName.apply(this, args);
   }
-  [dartx.importNode](node, deep) {
-    return this.importNode(node, deep);
+  [dartx.importNode](...args) {
+    return this.importNode.apply(this, args);
   }
-  [dartx.queryCommandEnabled](commandId) {
-    return this.queryCommandEnabled(commandId);
+  [dartx.queryCommandEnabled](...args) {
+    return this.queryCommandEnabled.apply(this, args);
   }
-  [dartx.queryCommandIndeterm](commandId) {
-    return this.queryCommandIndeterm(commandId);
+  [dartx.queryCommandIndeterm](...args) {
+    return this.queryCommandIndeterm.apply(this, args);
   }
-  [dartx.queryCommandState](commandId) {
-    return this.queryCommandState(commandId);
+  [dartx.queryCommandState](...args) {
+    return this.queryCommandState.apply(this, args);
   }
-  [dartx.queryCommandSupported](commandId) {
-    return this.queryCommandSupported(commandId);
+  [dartx.queryCommandSupported](...args) {
+    return this.queryCommandSupported.apply(this, args);
   }
-  [dartx.queryCommandValue](commandId) {
-    return this.queryCommandValue(commandId);
+  [dartx.queryCommandValue](...args) {
+    return this.queryCommandValue.apply(this, args);
   }
-  [dartx.transformDocumentToTreeView](noStyleMessage) {
-    return this.transformDocumentToTreeView(noStyleMessage);
+  [dartx.transformDocumentToTreeView](...args) {
+    return this.transformDocumentToTreeView.apply(this, args);
   }
-  [_webkitExitFullscreen]() {
-    return this.webkitExitFullscreen();
+  [_webkitExitFullscreen](...args) {
+    return this.webkitExitFullscreen.apply(this, args);
   }
-  [dartx.getElementById](elementId) {
-    return this.getElementById(elementId);
+  [dartx.getElementById](...args) {
+    return this.getElementById.apply(this, args);
   }
   get [_childElementCount]() {
     return this.childElementCount;
@@ -54231,11 +55316,11 @@
   get [_lastElementChild]() {
     return this.lastElementChild;
   }
-  [dartx.querySelector](selectors) {
-    return this.querySelector(selectors);
+  [dartx.querySelector](...args) {
+    return this.querySelector.apply(this, args);
   }
-  [_querySelectorAll](selectors) {
-    return this.querySelectorAll(selectors);
+  [_querySelectorAll](...args) {
+    return this.querySelectorAll.apply(this, args);
   }
   get [dartx.onAbort]() {
     return html.Element.abortEvent.forTarget(this);
@@ -54770,8 +55855,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.getElementById](elementId) {
-    return this.getElementById(elementId);
+  [dartx.getElementById](...args) {
+    return this.getElementById.apply(this, args);
   }
   get [_childElementCount]() {
     return this.childElementCount;
@@ -54782,11 +55867,11 @@
   get [_lastElementChild]() {
     return this.lastElementChild;
   }
-  [dartx.querySelector](selectors) {
-    return this.querySelector(selectors);
+  [dartx.querySelector](...args) {
+    return this.querySelector.apply(this, args);
   }
-  [_querySelectorAll](selectors) {
-    return this.querySelectorAll(selectors);
+  [_querySelectorAll](...args) {
+    return this.querySelectorAll.apply(this, args);
   }
 };
 html.DocumentFragment[dart.implements] = () => [html.NonElementParentNode, html.ParentNode];
@@ -54951,17 +56036,17 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.createDocument](namespaceURI, qualifiedName, doctype) {
-    return this.createDocument(namespaceURI, qualifiedName, doctype);
+  [dartx.createDocument](...args) {
+    return this.createDocument.apply(this, args);
   }
-  [dartx.createDocumentType](qualifiedName, publicId, systemId) {
-    return this.createDocumentType(qualifiedName, publicId, systemId);
+  [dartx.createDocumentType](...args) {
+    return this.createDocumentType.apply(this, args);
   }
-  [dartx.createHtmlDocument](title) {
-    return this.createHTMLDocument(title);
+  [dartx.createHtmlDocument](...args) {
+    return this.createHTMLDocument.apply(this, args);
   }
-  [dartx.hasFeature]() {
-    return this.hasFeature();
+  [dartx.hasFeature](...args) {
+    return this.hasFeature.apply(this, args);
   }
 };
 dart.setSignature(html.DomImplementation, {
@@ -54981,8 +56066,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.next](value) {
-    return this.next(value);
+  [dartx.next](...args) {
+    return this.next.apply(this, args);
   }
 };
 dart.setSignature(html.DomIterator, {
@@ -55099,26 +56184,26 @@
   get [dartx.m44]() {
     return this.m44;
   }
-  [dartx.multiply](other) {
-    return this.multiply(other);
+  [dartx.multiply](...args) {
+    return this.multiply.apply(this, args);
   }
-  [dartx.scale](scale, originX, originY) {
-    return this.scale(scale, originX, originY);
+  [dartx.scale](...args) {
+    return this.scale.apply(this, args);
   }
-  [dartx.scale3d](scale, originX, originY, originZ) {
-    return this.scale3d(scale, originX, originY, originZ);
+  [dartx.scale3d](...args) {
+    return this.scale3d.apply(this, args);
   }
-  [dartx.scaleNonUniform](scaleX, scaleY, scaleZn, originX, originY, originZ) {
-    return this.scaleNonUniform(scaleX, scaleY, scaleZn, originX, originY, originZ);
+  [dartx.scaleNonUniform](...args) {
+    return this.scaleNonUniform.apply(this, args);
   }
-  [dartx.toFloat32Array]() {
-    return this.toFloat32Array();
+  [dartx.toFloat32Array](...args) {
+    return this.toFloat32Array.apply(this, args);
   }
-  [dartx.toFloat64Array]() {
-    return this.toFloat64Array();
+  [dartx.toFloat64Array](...args) {
+    return this.toFloat64Array.apply(this, args);
   }
-  [dartx.translate](tx, ty, tz) {
-    return this.translate(tx, ty, tz);
+  [dartx.translate](...args) {
+    return this.translate.apply(this, args);
   }
 };
 dart.setSignature(html.DomMatrixReadOnly, {
@@ -55364,23 +56449,23 @@
   set [dartx.m44](value) {
     this.m44 = value;
   }
-  [dartx.multiplySelf](other) {
-    return this.multiplySelf(other);
+  [dartx.multiplySelf](...args) {
+    return this.multiplySelf.apply(this, args);
   }
-  [dartx.preMultiplySelf](other) {
-    return this.preMultiplySelf(other);
+  [dartx.preMultiplySelf](...args) {
+    return this.preMultiplySelf.apply(this, args);
   }
-  [dartx.scale3dSelf](scale, originX, originY, originZ) {
-    return this.scale3dSelf(scale, originX, originY, originZ);
+  [dartx.scale3dSelf](...args) {
+    return this.scale3dSelf.apply(this, args);
   }
-  [dartx.scaleNonUniformSelf](scaleX, scaleY, scaleZ, originX, originY, originZ) {
-    return this.scaleNonUniformSelf(scaleX, scaleY, scaleZ, originX, originY, originZ);
+  [dartx.scaleNonUniformSelf](...args) {
+    return this.scaleNonUniformSelf.apply(this, args);
   }
-  [dartx.scaleSelf](scale, originX, originY) {
-    return this.scaleSelf(scale, originX, originY);
+  [dartx.scaleSelf](...args) {
+    return this.scaleSelf.apply(this, args);
   }
-  [dartx.translateSelf](tx, ty, tz) {
-    return this.translateSelf(tx, ty, tz);
+  [dartx.translateSelf](...args) {
+    return this.translateSelf.apply(this, args);
   }
 };
 dart.setSignature(html.DomMatrix, {
@@ -55440,8 +56525,8 @@
   static _create_1() {
     return new DOMParser();
   }
-  [dartx.parseFromString](str, type) {
-    return this.parseFromString(str, type);
+  [dartx.parseFromString](...args) {
+    return this.parseFromString.apply(this, args);
   }
 };
 dart.setSignature(html.DomParser, {
@@ -55760,20 +56845,20 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.add](tokens) {
-    return this.add(tokens);
+  [dartx.add](...args) {
+    return this.add.apply(this, args);
   }
-  [dartx.contains](token) {
-    return this.contains(token);
+  [dartx.contains](...args) {
+    return this.contains.apply(this, args);
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
-  [dartx.remove](tokens) {
-    return this.remove(tokens);
+  [dartx.remove](...args) {
+    return this.remove.apply(this, args);
   }
-  [dartx.toggle](token, force) {
-    return this.toggle(token, force);
+  [dartx.toggle](...args) {
+    return this.toggle.apply(this, args);
   }
 };
 dart.setSignature(html.DomTokenList, {
@@ -55947,8 +57032,8 @@
 html.ImmutableListMixin = ImmutableListMixin();
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'length',
   'first',
   'last',
@@ -55963,11 +57048,11 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
     return this[dartx.item](index);
   }
-  [dartx.set](index, value) {
+  [dartx._set](index, value) {
     dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
     return value;
   }
@@ -55996,13 +57081,13 @@
     dart.throw(new core.StateError("More than one element"));
   }
   [dartx.elementAt](index) {
-    return this[dartx.get](index);
+    return this[dartx._get](index);
   }
-  [__getter__](index) {
-    return this.__getter__(index);
+  [__getter__](...args) {
+    return this.__getter__.apply(this, args);
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
 };
 html.DomStringList[dart.implements] = () => [ListOfString()];
@@ -56016,8 +57101,8 @@
   }),
   setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(core.String, [core.int]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, core.String]),
+    [dartx._get]: dart.definiteFunctionType(core.String, [core.int]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, core.String]),
     [dartx.elementAt]: dart.definiteFunctionType(core.String, [core.int]),
     [__getter__]: dart.definiteFunctionType(core.String, [core.int]),
     [dartx.item]: dart.definiteFunctionType(core.String, [core.int])
@@ -56058,11 +57143,11 @@
   get length() {
     return this[_childElements][dartx.length];
   }
-  get(index) {
-    return html.Element._check(this[_childElements][dartx.get](index));
+  _get(index) {
+    return html.Element._check(this[_childElements][dartx._get](index));
   }
-  set(index, value) {
-    this[_element][_replaceChild](value, this[_childElements][dartx.get](index));
+  _set(index, value) {
+    this[_element][_replaceChild](value, this[_childElements][dartx._get](index));
     return value;
   }
   set length(newLength) {
@@ -56135,7 +57220,7 @@
     if (index == this.length) {
       this[_element][dartx.append](element);
     } else {
-      this[_element][dartx.insertBefore](element, this.get(index));
+      this[_element][dartx.insertBefore](element, this._get(index));
     }
   }
   setAll(index, iterable) {
@@ -56145,7 +57230,7 @@
     this[_element][_clearChildren]();
   }
   removeAt(index) {
-    let result = this.get(index);
+    let result = this._get(index);
     if (result != null) {
       this[_element][_removeChild](result);
     }
@@ -56195,8 +57280,8 @@
   }),
   setters: () => ({length: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    get: dart.definiteFunctionType(html.Element, [core.int]),
-    set: dart.definiteFunctionType(dart.void, [core.int, html.Element]),
+    _get: dart.definiteFunctionType(html.Element, [core.int]),
+    _set: dart.definiteFunctionType(dart.void, [core.int, html.Element]),
     add: dart.definiteFunctionType(html.Element, [html.Element]),
     addAll: dart.definiteFunctionType(dart.void, [IterableOfElement()]),
     sort: dart.definiteFunctionType(dart.void, [], [ElementAndElementToint()]),
@@ -56214,8 +57299,8 @@
 });
 dart.defineExtensionMembers(html._ChildrenElementList, [
   'contains',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'add',
   'addAll',
   'sort',
@@ -56257,10 +57342,10 @@
     get length() {
       return this[_nodeList][dartx.length];
     }
-    get(index) {
-      return html._downcast(html.Node, E)(this[_nodeList][dartx.get](index));
+    _get(index) {
+      return html._downcast(html.Node, E)(this[_nodeList][dartx._get](index));
     }
-    set(index, value) {
+    _set(index, value) {
       E._check(value);
       dart.throw(new core.UnsupportedError('Cannot modify list'));
       return value;
@@ -56609,14 +57694,14 @@
       classes: dart.definiteFunctionType(dart.void, [IterableOfString()])
     }),
     methods: () => ({
-      get: dart.definiteFunctionType(E, [core.int]),
-      set: dart.definiteFunctionType(dart.void, [core.int, E]),
+      _get: dart.definiteFunctionType(E, [core.int]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, E]),
       sort: dart.definiteFunctionType(dart.void, [], [ComparatorOfE()])
     })
   });
   dart.defineExtensionMembers(_FrozenElementList, [
-    'get',
-    'set',
+    '_get',
+    '_set',
     'sort',
     'shuffle',
     'length',
@@ -56726,11 +57811,11 @@
   set [dartx.width](value) {
     this.width = value;
   }
-  [__getter__](index_OR_name) {
-    return this.__getter__(index_OR_name);
+  [__getter__](...args) {
+    return this.__getter__.apply(this, args);
   }
-  [__setter__](index_OR_name, value) {
-    return this.__setter__(index_OR_name, value);
+  [__setter__](...args) {
+    return this.__setter__.apply(this, args);
   }
 };
 dart.defineNamedConstructor(html.EmbedElement, 'created');
@@ -56858,8 +57943,8 @@
   get [dartx.withCredentials]() {
     return this.withCredentials;
   }
-  [dartx.close]() {
-    return this.close();
+  [dartx.close](...args) {
+    return this.close.apply(this, args);
   }
   get [dartx.onError]() {
     return html.EventSource.errorEvent.forTarget(this);
@@ -56922,23 +58007,23 @@
   new(ptr) {
     this[_ptr] = ptr;
   }
-  get(type) {
+  _get(type) {
     return new (_EventStreamOfEvent())(this[_ptr], type, false);
   }
 };
 dart.setSignature(html.Events, {
   constructors: () => ({new: dart.definiteFunctionType(html.Events, [html.EventTarget])}),
   fields: () => ({[_ptr]: html.EventTarget}),
-  methods: () => ({get: dart.definiteFunctionType(async.Stream, [core.String])})
+  methods: () => ({_get: dart.definiteFunctionType(async.Stream, [core.String])})
 });
 html.ElementEvents = class ElementEvents extends html.Events {
   new(ptr) {
     super.new(ptr);
   }
-  get(type) {
+  _get(type) {
     if (dart.test(html.ElementEvents.webkitEvents[dartx.keys][dartx.contains](type[dartx.toLowerCase]()))) {
       if (dart.test(html_common.Device.isWebKit)) {
-        return new (_ElementEventStreamImplOfEvent())(this[_ptr], html.ElementEvents.webkitEvents[dartx.get](type[dartx.toLowerCase]()), false);
+        return new (_ElementEventStreamImplOfEvent())(this[_ptr], html.ElementEvents.webkitEvents[dartx._get](type[dartx.toLowerCase]()), false);
       }
     }
     return new (_ElementEventStreamImplOfEvent())(this[_ptr], type, false);
@@ -56974,8 +58059,8 @@
   static _create_2(type) {
     return new ExtendableEvent(type);
   }
-  [dartx.waitUntil](value) {
-    return this.waitUntil(value);
+  [dartx.waitUntil](...args) {
+    return this.waitUntil.apply(this, args);
   }
 };
 dart.setSignature(html.ExtendableEvent, {
@@ -57055,8 +58140,8 @@
   get [dartx.request]() {
     return this.request;
   }
-  [dartx.respondWith](value) {
-    return this.respondWith(value);
+  [dartx.respondWith](...args) {
+    return this.respondWith.apply(this, args);
   }
 };
 dart.setSignature(html.FetchEvent, {
@@ -57137,14 +58222,14 @@
   get [dartx.willValidate]() {
     return this.willValidate;
   }
-  [dartx.checkValidity]() {
-    return this.checkValidity();
+  [dartx.checkValidity](...args) {
+    return this.checkValidity.apply(this, args);
   }
-  [dartx.reportValidity]() {
-    return this.reportValidity();
+  [dartx.reportValidity](...args) {
+    return this.reportValidity.apply(this, args);
   }
-  [dartx.setCustomValidity](error) {
-    return this.setCustomValidity(error);
+  [dartx.setCustomValidity](...args) {
+    return this.setCustomValidity.apply(this, args);
   }
 };
 dart.defineNamedConstructor(html.FieldSetElement, 'created');
@@ -57242,8 +58327,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [_createWriter](successCallback, errorCallback) {
-    return this.createWriter(successCallback, errorCallback);
+  [_createWriter](...args) {
+    return this.createWriter.apply(this, args);
   }
   [dartx.createWriter]() {
     let completer = CompleterOfFileWriter().new();
@@ -57254,8 +58339,8 @@
     }, FileErrorTovoid()));
     return completer.future;
   }
-  [_file](successCallback, errorCallback) {
-    return this.file(successCallback, errorCallback);
+  [_file](...args) {
+    return this.file.apply(this, args);
   }
   [dartx.file]() {
     let completer = CompleterOfFile().new();
@@ -57321,8 +58406,8 @@
 dart.registerExtension(dart.global.FileError, html.FileError);
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'length',
   'first',
   'last',
@@ -57337,11 +58422,11 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
     return this[index];
   }
-  [dartx.set](index, value) {
+  [dartx._set](index, value) {
     dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
     return value;
   }
@@ -57370,10 +58455,10 @@
     dart.throw(new core.StateError("More than one element"));
   }
   [dartx.elementAt](index) {
-    return this[dartx.get](index);
+    return this[dartx._get](index);
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
 };
 html.FileList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfFile()];
@@ -57387,8 +58472,8 @@
   }),
   setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(html.File, [core.int]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html.File]),
+    [dartx._get]: dart.definiteFunctionType(html.File, [core.int]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html.File]),
     [dartx.elementAt]: dart.definiteFunctionType(html.File, [core.int]),
     [dartx.item]: dart.definiteFunctionType(html.File, [core.int])
   })
@@ -57432,17 +58517,17 @@
   get [dartx.readyState]() {
     return this.readyState;
   }
-  [dartx.abort]() {
-    return this.abort();
+  [dartx.abort](...args) {
+    return this.abort.apply(this, args);
   }
-  [dartx.readAsArrayBuffer](blob) {
-    return this.readAsArrayBuffer(blob);
+  [dartx.readAsArrayBuffer](...args) {
+    return this.readAsArrayBuffer.apply(this, args);
   }
-  [dartx.readAsDataUrl](blob) {
-    return this.readAsDataURL(blob);
+  [dartx.readAsDataUrl](...args) {
+    return this.readAsDataURL.apply(this, args);
   }
-  [dartx.readAsText](blob, label) {
-    return this.readAsText(blob, label);
+  [dartx.readAsText](...args) {
+    return this.readAsText.apply(this, args);
   }
   get [dartx.onAbort]() {
     return html.FileReader.abortEvent.forTarget(this);
@@ -57601,17 +58686,17 @@
   get [dartx.readyState]() {
     return this.readyState;
   }
-  [dartx.abort]() {
-    return this.abort();
+  [dartx.abort](...args) {
+    return this.abort.apply(this, args);
   }
-  [dartx.seek](position) {
-    return this.seek(position);
+  [dartx.seek](...args) {
+    return this.seek.apply(this, args);
   }
-  [dartx.truncate](size) {
-    return this.truncate(size);
+  [dartx.truncate](...args) {
+    return this.truncate.apply(this, args);
   }
-  [dartx.write](data) {
-    return this.write(data);
+  [dartx.write](...args) {
+    return this.write.apply(this, args);
   }
   get [dartx.onAbort]() {
     return html.FileWriter.abortEvent.forTarget(this);
@@ -57812,8 +58897,8 @@
   set [dartx.weight](value) {
     this.weight = value;
   }
-  [dartx.load]() {
-    return this.load();
+  [dartx.load](...args) {
+    return this.load.apply(this, args);
   }
 };
 dart.setSignature(html.FontFace, {
@@ -57860,23 +58945,23 @@
   get [dartx.status]() {
     return this.status;
   }
-  [dartx.add](fontFace) {
-    return this.add(fontFace);
+  [dartx.add](...args) {
+    return this.add.apply(this, args);
   }
-  [dartx.check](font, text) {
-    return this.check(font, text);
+  [dartx.check](...args) {
+    return this.check.apply(this, args);
   }
-  [dartx.clear]() {
-    return this.clear();
+  [dartx.clear](...args) {
+    return this.clear.apply(this, args);
   }
-  [dartx.delete](fontFace) {
-    return this.delete(fontFace);
+  [dartx.delete](...args) {
+    return this.delete.apply(this, args);
   }
-  [dartx.forEach](callback, thisArg) {
-    return this.forEach(callback, thisArg);
+  [dartx.forEach](...args) {
+    return this.forEach.apply(this, args);
   }
-  [dartx.has](fontFace) {
-    return this.has(fontFace);
+  [dartx.has](...args) {
+    return this.has.apply(this, args);
   }
 };
 dart.setSignature(html.FontFaceSet, {
@@ -57941,26 +59026,26 @@
   static get supported() {
     return !!window.FormData;
   }
-  [dartx.append](name, value) {
-    return this.append(name, value);
+  [dartx.append](...args) {
+    return this.append.apply(this, args);
   }
-  [dartx.appendBlob](name, value, filename) {
-    return this.append(name, value, filename);
+  [dartx.appendBlob](...args) {
+    return this.append.apply(this, args);
   }
-  [dartx.delete](name) {
-    return this.delete(name);
+  [dartx.delete](...args) {
+    return this.delete.apply(this, args);
   }
-  [dartx.get](name) {
-    return this.get(name);
+  [dartx.get](...args) {
+    return this.get.apply(this, args);
   }
-  [dartx.getAll](name) {
-    return this.getAll(name);
+  [dartx.getAll](...args) {
+    return this.getAll.apply(this, args);
   }
-  [dartx.has](name) {
-    return this.has(name);
+  [dartx.has](...args) {
+    return this.has.apply(this, args);
   }
-  [dartx.set](name, value, filename) {
-    return this.set(name, value, filename);
+  [dartx.set](...args) {
+    return this.set.apply(this, args);
   }
 };
 dart.setSignature(html.FormData, {
@@ -58081,31 +59166,31 @@
   set [dartx.target](value) {
     this.target = value;
   }
-  [__getter__](name) {
-    return this.__getter__(name);
+  [__getter__](...args) {
+    return this.__getter__.apply(this, args);
   }
-  [dartx.checkValidity]() {
-    return this.checkValidity();
+  [dartx.checkValidity](...args) {
+    return this.checkValidity.apply(this, args);
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
-  [dartx.reportValidity]() {
-    return this.reportValidity();
+  [dartx.reportValidity](...args) {
+    return this.reportValidity.apply(this, args);
   }
   [dartx.requestAutocomplete](details) {
     let details_1 = html_common.convertDartToNative_Dictionary(details);
     this[_requestAutocomplete_1](details_1);
     return;
   }
-  [_requestAutocomplete_1](details) {
-    return this.requestAutocomplete(details);
+  [_requestAutocomplete_1](...args) {
+    return this.requestAutocomplete.apply(this, args);
   }
-  [dartx.reset]() {
-    return this.reset();
+  [dartx.reset](...args) {
+    return this.reset.apply(this, args);
   }
-  [dartx.submit]() {
-    return this.submit();
+  [dartx.submit](...args) {
+    return this.submit.apply(this, args);
   }
 };
 dart.defineNamedConstructor(html.FormElement, 'created');
@@ -58258,14 +59343,14 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.getRegisteredRegions]() {
-    return this.getRegisteredRegions();
+  [dartx.getRegisteredRegions](...args) {
+    return this.getRegisteredRegions.apply(this, args);
   }
-  [dartx.registerRegion](region) {
-    return this.registerRegion(region);
+  [dartx.registerRegion](...args) {
+    return this.registerRegion.apply(this, args);
   }
-  [dartx.unregisterRegion](regionId) {
-    return this.unregisterRegion(regionId);
+  [dartx.unregisterRegion](...args) {
+    return this.unregisterRegion.apply(this, args);
   }
 };
 dart.setSignature(html.Geofencing, {
@@ -58321,13 +59406,13 @@
     let maximumAge = opts && 'maximumAge' in opts ? opts.maximumAge : null;
     let options = dart.map();
     if (enableHighAccuracy != null) {
-      options[dartx.set]('enableHighAccuracy', enableHighAccuracy);
+      options[dartx._set]('enableHighAccuracy', enableHighAccuracy);
     }
     if (timeout != null) {
-      options[dartx.set]('timeout', timeout.inMilliseconds);
+      options[dartx._set]('timeout', timeout.inMilliseconds);
     }
     if (maximumAge != null) {
-      options[dartx.set]('maximumAge', maximumAge.inMilliseconds);
+      options[dartx._set]('maximumAge', maximumAge.inMilliseconds);
     }
     let completer = CompleterOfGeoposition().new();
     try {
@@ -58349,13 +59434,13 @@
     let maximumAge = opts && 'maximumAge' in opts ? opts.maximumAge : null;
     let options = dart.map();
     if (enableHighAccuracy != null) {
-      options[dartx.set]('enableHighAccuracy', enableHighAccuracy);
+      options[dartx._set]('enableHighAccuracy', enableHighAccuracy);
     }
     if (timeout != null) {
-      options[dartx.set]('timeout', timeout.inMilliseconds);
+      options[dartx._set]('timeout', timeout.inMilliseconds);
     }
     if (maximumAge != null) {
-      options[dartx.set]('maximumAge', maximumAge.inMilliseconds);
+      options[dartx._set]('maximumAge', maximumAge.inMilliseconds);
     }
     let watchId = null;
     let controller = null;
@@ -58385,8 +59470,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [_clearWatch](watchID) {
-    return this.clearWatch(watchID);
+  [_clearWatch](...args) {
+    return this.clearWatch.apply(this, args);
   }
   [_getCurrentPosition](successCallback, errorCallback, options) {
     if (errorCallback === void 0) errorCallback = null;
@@ -58403,14 +59488,14 @@
     this[_getCurrentPosition_3](successCallback);
     return;
   }
-  [_getCurrentPosition_1](successCallback, errorCallback, options) {
-    return this.getCurrentPosition(successCallback, errorCallback, options);
+  [_getCurrentPosition_1](...args) {
+    return this.getCurrentPosition.apply(this, args);
   }
-  [_getCurrentPosition_2](successCallback, errorCallback) {
-    return this.getCurrentPosition(successCallback, errorCallback);
+  [_getCurrentPosition_2](...args) {
+    return this.getCurrentPosition.apply(this, args);
   }
-  [_getCurrentPosition_3](successCallback) {
-    return this.getCurrentPosition(successCallback);
+  [_getCurrentPosition_3](...args) {
+    return this.getCurrentPosition.apply(this, args);
   }
   [_watchPosition](successCallback, errorCallback, options) {
     if (errorCallback === void 0) errorCallback = null;
@@ -58424,14 +59509,14 @@
     }
     return this[_watchPosition_3](successCallback);
   }
-  [_watchPosition_1](successCallback, errorCallback, options) {
-    return this.watchPosition(successCallback, errorCallback, options);
+  [_watchPosition_1](...args) {
+    return this.watchPosition.apply(this, args);
   }
-  [_watchPosition_2](successCallback, errorCallback) {
-    return this.watchPosition(successCallback, errorCallback);
+  [_watchPosition_2](...args) {
+    return this.watchPosition.apply(this, args);
   }
-  [_watchPosition_3](successCallback) {
-    return this.watchPosition(successCallback);
+  [_watchPosition_3](...args) {
+    return this.watchPosition.apply(this, args);
   }
 };
 dart.setSignature(html.Geolocation, {
@@ -59102,8 +60187,8 @@
   get [dartx.oldUrl]() {
     return this.oldURL;
   }
-  [_initHashChangeEvent](type, canBubble, cancelable, oldURL, newURL) {
-    return this.initHashChangeEvent(type, canBubble, cancelable, oldURL, newURL);
+  [_initHashChangeEvent](...args) {
+    return this.initHashChangeEvent.apply(this, args);
   }
 };
 dart.setSignature(html.HashChangeEvent, {
@@ -59270,14 +60355,14 @@
   get [_get_state]() {
     return this.state;
   }
-  [dartx.back]() {
-    return this.back();
+  [dartx.back](...args) {
+    return this.back.apply(this, args);
   }
-  [dartx.forward]() {
-    return this.forward();
+  [dartx.forward](...args) {
+    return this.forward.apply(this, args);
   }
-  [dartx.go](delta) {
-    return this.go(delta);
+  [dartx.go](...args) {
+    return this.go.apply(this, args);
   }
   [dartx.pushState](data, title, url, options) {
     if (options === void 0) options = null;
@@ -59291,11 +60376,11 @@
     this[_pushState_2](data_1, title, url);
     return;
   }
-  [_pushState_1](data, title, url, options) {
-    return this.pushState(data, title, url, options);
+  [_pushState_1](...args) {
+    return this.pushState.apply(this, args);
   }
-  [_pushState_2](data, title, url) {
-    return this.pushState(data, title, url);
+  [_pushState_2](...args) {
+    return this.pushState.apply(this, args);
   }
   [dartx.replaceState](data, title, url, options) {
     if (options === void 0) options = null;
@@ -59309,11 +60394,11 @@
     this[_replaceState_2](data_1, title, url);
     return;
   }
-  [_replaceState_1](data, title, url, options) {
-    return this.replaceState(data, title, url, options);
+  [_replaceState_1](...args) {
+    return this.replaceState.apply(this, args);
   }
-  [_replaceState_2](data, title, url) {
-    return this.replaceState(data, title, url);
+  [_replaceState_2](...args) {
+    return this.replaceState.apply(this, args);
   }
 };
 html.History[dart.implements] = () => [html.HistoryBase];
@@ -59378,11 +60463,11 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.getEyeParameters](whichEye) {
-    return this.getEyeParameters(whichEye);
+  [dartx.getEyeParameters](...args) {
+    return this.getEyeParameters.apply(this, args);
   }
-  [dartx.setFieldOfView](leftFov, rightFov) {
-    return this.setFieldOfView(leftFov, rightFov);
+  [dartx.setFieldOfView](...args) {
+    return this.setFieldOfView.apply(this, args);
   }
 };
 dart.setSignature(html.HmdvrDevice, {
@@ -59395,8 +60480,8 @@
 dart.registerExtension(dart.global.HMDVRDevice, html.HmdvrDevice);
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'length',
   'first',
   'last',
@@ -59412,11 +60497,11 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
     return this[index];
   }
-  [dartx.set](index, value) {
+  [dartx._set](index, value) {
     dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
     return value;
   }
@@ -59445,13 +60530,13 @@
     dart.throw(new core.StateError("More than one element"));
   }
   [dartx.elementAt](index) {
-    return this[dartx.get](index);
+    return this[dartx._get](index);
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
-  [dartx.namedItem](name) {
-    return this.namedItem(name);
+  [dartx.namedItem](...args) {
+    return this.namedItem.apply(this, args);
   }
 };
 html.HtmlCollection[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfNode()];
@@ -59465,8 +60550,8 @@
   }),
   setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(html.Node, [core.int]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html.Node]),
+    [dartx._get]: dart.definiteFunctionType(html.Node, [core.int]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html.Node]),
     [dartx.elementAt]: dart.definiteFunctionType(html.Node, [core.int]),
     [dartx.item]: dart.definiteFunctionType(html.Node, [core.int]),
     [dartx.namedItem]: dart.definiteFunctionType(core.Object, [core.String])
@@ -59617,11 +60702,11 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
-  [dartx.namedItem](name) {
-    return this.namedItem(name);
+  [dartx.namedItem](...args) {
+    return this.namedItem.apply(this, args);
   }
 };
 dart.setSignature(html.HtmlFormControlsCollection, {
@@ -59653,8 +60738,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [_item](index) {
-    return this.item(index);
+  [_item](...args) {
+    return this.item.apply(this, args);
   }
 };
 dart.setSignature(html.HtmlOptionsCollection, {
@@ -59900,15 +60985,15 @@
       let key = header[dartx.substring](0, splitIdx)[dartx.toLowerCase]();
       let value = header[dartx.substring](dart.notNull(splitIdx) + 2);
       if (dart.test(headers[dartx.containsKey](key))) {
-        headers[dartx.set](key, dart.str`${headers[dartx.get](key)}, ${value}`);
+        headers[dartx._set](key, dart.str`${headers[dartx._get](key)}, ${value}`);
       } else {
-        headers[dartx.set](key, value);
+        headers[dartx._set](key, value);
       }
     }
     return headers;
   }
-  [dartx.open](method, url, opts) {
-    return this.open(method, url, opts);
+  [dartx.open](...args) {
+    return this.open.apply(this, args);
   }
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
@@ -59964,23 +61049,23 @@
   set [dartx.withCredentials](value) {
     this.withCredentials = value;
   }
-  [dartx.abort]() {
-    return this.abort();
+  [dartx.abort](...args) {
+    return this.abort.apply(this, args);
   }
-  [dartx.getAllResponseHeaders]() {
-    return this.getAllResponseHeaders();
+  [dartx.getAllResponseHeaders](...args) {
+    return this.getAllResponseHeaders.apply(this, args);
   }
-  [dartx.getResponseHeader](name) {
-    return this.getResponseHeader(name);
+  [dartx.getResponseHeader](...args) {
+    return this.getResponseHeader.apply(this, args);
   }
-  [dartx.overrideMimeType](mime) {
-    return this.overrideMimeType(mime);
+  [dartx.overrideMimeType](...args) {
+    return this.overrideMimeType.apply(this, args);
   }
-  [dartx.send](body_OR_data) {
-    return this.send(body_OR_data);
+  [dartx.send](...args) {
+    return this.send.apply(this, args);
   }
-  [dartx.setRequestHeader](name, value) {
-    return this.setRequestHeader(name, value);
+  [dartx.setRequestHeader](...args) {
+    return this.setRequestHeader.apply(this, args);
   }
   get [dartx.onReadyStateChange]() {
     return html.HttpRequest.readyStateChangeEvent.forTarget(this);
@@ -60382,8 +61467,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.inspect](objectId, hints) {
-    return this.inspect(objectId, hints);
+  [dartx.inspect](...args) {
+    return this.inspect.apply(this, args);
   }
 };
 dart.setSignature(html.InjectedScriptHost, {
@@ -60846,29 +61931,29 @@
   get [dartx.willValidate]() {
     return this.willValidate;
   }
-  [dartx.checkValidity]() {
-    return this.checkValidity();
+  [dartx.checkValidity](...args) {
+    return this.checkValidity.apply(this, args);
   }
-  [dartx.reportValidity]() {
-    return this.reportValidity();
+  [dartx.reportValidity](...args) {
+    return this.reportValidity.apply(this, args);
   }
-  [dartx.select]() {
-    return this.select();
+  [dartx.select](...args) {
+    return this.select.apply(this, args);
   }
-  [dartx.setCustomValidity](error) {
-    return this.setCustomValidity(error);
+  [dartx.setCustomValidity](...args) {
+    return this.setCustomValidity.apply(this, args);
   }
-  [dartx.setRangeText](replacement, opts) {
-    return this.setRangeText(replacement, opts);
+  [dartx.setRangeText](...args) {
+    return this.setRangeText.apply(this, args);
   }
-  [dartx.setSelectionRange](start, end, direction) {
-    return this.setSelectionRange(start, end, direction);
+  [dartx.setSelectionRange](...args) {
+    return this.setSelectionRange.apply(this, args);
   }
-  [dartx.stepDown](n) {
-    return this.stepDown(n);
+  [dartx.stepDown](...args) {
+    return this.stepDown.apply(this, args);
   }
-  [dartx.stepUp](n) {
-    return this.stepUp(n);
+  [dartx.stepUp](...args) {
+    return this.stepUp.apply(this, args);
   }
 };
 dart.defineNamedConstructor(html.InputElement, 'created');
@@ -60958,14 +62043,56 @@
 ]);
 html.InputElementBase = class InputElementBase extends core.Object {
   new() {
-    this[dartx.autofocus] = null;
-    this[dartx.disabled] = null;
-    this[dartx.incremental] = null;
-    this[dartx.indeterminate] = null;
-    this[dartx.name] = null;
-    this[dartx.value] = null;
+    this[autofocus] = null;
+    this[disabled] = null;
+    this[incremental] = null;
+    this[indeterminate] = null;
+    this[name] = null;
+    this[value] = null;
+  }
+  get autofocus() {
+    return this[autofocus];
+  }
+  set autofocus(value) {
+    this[autofocus] = value;
+  }
+  get disabled() {
+    return this[disabled];
+  }
+  set disabled(value) {
+    this[disabled] = value;
+  }
+  get incremental() {
+    return this[incremental];
+  }
+  set incremental(value) {
+    this[incremental] = value;
+  }
+  get indeterminate() {
+    return this[indeterminate];
+  }
+  set indeterminate(value) {
+    this[indeterminate] = value;
+  }
+  get name() {
+    return this[name];
+  }
+  set name(value) {
+    this[name] = value;
+  }
+  get value() {
+    return this[value];
+  }
+  set value(value) {
+    this[value] = value;
   }
 };
+const autofocus = Symbol(html.InputElementBase.name + "." + 'autofocus'.toString());
+const disabled = Symbol(html.InputElementBase.name + "." + 'disabled'.toString());
+const incremental = Symbol(html.InputElementBase.name + "." + 'incremental'.toString());
+const indeterminate = Symbol(html.InputElementBase.name + "." + 'indeterminate'.toString());
+const name = Symbol(html.InputElementBase.name + "." + 'name'.toString());
+const value = Symbol(html.InputElementBase.name + "." + 'value'.toString());
 html.InputElementBase[dart.implements] = () => [html.Element];
 dart.setSignature(html.InputElementBase, {
   fields: () => ({
@@ -61014,18 +62141,88 @@
 ]);
 html.TextInputElementBase = class TextInputElementBase extends core.Object {
   new() {
-    this[dartx.autocomplete] = null;
-    this[dartx.maxLength] = null;
-    this[dartx.pattern] = null;
-    this[dartx.placeholder] = null;
-    this[dartx.readOnly] = null;
-    this[dartx.required] = null;
-    this[dartx.size] = null;
-    this[dartx.selectionDirection] = null;
-    this[dartx.selectionEnd] = null;
-    this[dartx.selectionStart] = null;
+    this[autocomplete] = null;
+    this[maxLength] = null;
+    this[pattern] = null;
+    this[placeholder] = null;
+    this[readOnly] = null;
+    this[required] = null;
+    this[size] = null;
+    this[selectionDirection] = null;
+    this[selectionEnd] = null;
+    this[selectionStart] = null;
+  }
+  get autocomplete() {
+    return this[autocomplete];
+  }
+  set autocomplete(value) {
+    this[autocomplete] = value;
+  }
+  get maxLength() {
+    return this[maxLength];
+  }
+  set maxLength(value) {
+    this[maxLength] = value;
+  }
+  get pattern() {
+    return this[pattern];
+  }
+  set pattern(value) {
+    this[pattern] = value;
+  }
+  get placeholder() {
+    return this[placeholder];
+  }
+  set placeholder(value) {
+    this[placeholder] = value;
+  }
+  get readOnly() {
+    return this[readOnly];
+  }
+  set readOnly(value) {
+    this[readOnly] = value;
+  }
+  get required() {
+    return this[required];
+  }
+  set required(value) {
+    this[required] = value;
+  }
+  get size() {
+    return this[size];
+  }
+  set size(value) {
+    this[size] = value;
+  }
+  get selectionDirection() {
+    return this[selectionDirection];
+  }
+  set selectionDirection(value) {
+    this[selectionDirection] = value;
+  }
+  get selectionEnd() {
+    return this[selectionEnd];
+  }
+  set selectionEnd(value) {
+    this[selectionEnd] = value;
+  }
+  get selectionStart() {
+    return this[selectionStart];
+  }
+  set selectionStart(value) {
+    this[selectionStart] = value;
   }
 };
+const autocomplete = Symbol(html.TextInputElementBase.name + "." + 'autocomplete'.toString());
+const maxLength = Symbol(html.TextInputElementBase.name + "." + 'maxLength'.toString());
+const pattern = Symbol(html.TextInputElementBase.name + "." + 'pattern'.toString());
+const placeholder = Symbol(html.TextInputElementBase.name + "." + 'placeholder'.toString());
+const readOnly = Symbol(html.TextInputElementBase.name + "." + 'readOnly'.toString());
+const required = Symbol(html.TextInputElementBase.name + "." + 'required'.toString());
+const size = Symbol(html.TextInputElementBase.name + "." + 'size'.toString());
+const selectionDirection = Symbol(html.TextInputElementBase.name + "." + 'selectionDirection'.toString());
+const selectionEnd = Symbol(html.TextInputElementBase.name + "." + 'selectionEnd'.toString());
+const selectionStart = Symbol(html.TextInputElementBase.name + "." + 'selectionStart'.toString());
 html.TextInputElementBase[dart.implements] = () => [html.InputElementBase];
 dart.setSignature(html.TextInputElementBase, {
   fields: () => ({
@@ -61070,10 +62267,17 @@
   static new() {
     return html.InputElement.new({type: 'search'});
   }
+  get dirName() {
+    return this[dirName];
+  }
+  set dirName(value) {
+    this[dirName] = value;
+  }
   static get supported() {
     return html.InputElement.new({type: 'search'})[dartx.type] == 'search';
   }
 };
+const dirName = Symbol(html.SearchInputElement.name + "." + 'dirName'.toString());
 html.SearchInputElement[dart.implements] = () => [html.TextInputElementBase];
 dart.setSignature(html.SearchInputElement, {
   constructors: () => ({new: dart.definiteFunctionType(html.SearchInputElement, [])}),
@@ -61088,7 +62292,14 @@
   static new() {
     return html.InputElement.new({type: 'text'});
   }
+  get dirName() {
+    return this[dirName];
+  }
+  set dirName(value) {
+    this[dirName] = value;
+  }
 };
+const dirName = Symbol(html.TextInputElement.name + "." + 'dirName'.toString());
 html.TextInputElement[dart.implements] = () => [html.TextInputElementBase];
 dart.setSignature(html.TextInputElement, {
   constructors: () => ({new: dart.definiteFunctionType(html.TextInputElement, [])}),
@@ -61136,10 +62347,73 @@
   static new() {
     return html.InputElement.new({type: 'email'});
   }
+  get autocomplete() {
+    return this[autocomplete];
+  }
+  set autocomplete(value) {
+    this[autocomplete] = value;
+  }
+  get autofocus() {
+    return this[autofocus];
+  }
+  set autofocus(value) {
+    this[autofocus] = value;
+  }
+  get maxLength() {
+    return this[maxLength];
+  }
+  set maxLength(value) {
+    this[maxLength] = value;
+  }
+  get multiple() {
+    return this[multiple];
+  }
+  set multiple(value) {
+    this[multiple] = value;
+  }
+  get pattern() {
+    return this[pattern];
+  }
+  set pattern(value) {
+    this[pattern] = value;
+  }
+  get placeholder() {
+    return this[placeholder];
+  }
+  set placeholder(value) {
+    this[placeholder] = value;
+  }
+  get readOnly() {
+    return this[readOnly];
+  }
+  set readOnly(value) {
+    this[readOnly] = value;
+  }
+  get required() {
+    return this[required];
+  }
+  set required(value) {
+    this[required] = value;
+  }
+  get size() {
+    return this[size];
+  }
+  set size(value) {
+    this[size] = value;
+  }
   static get supported() {
     return html.InputElement.new({type: 'email'})[dartx.type] == 'email';
   }
 };
+const autocomplete = Symbol(html.EmailInputElement.name + "." + 'autocomplete'.toString());
+const autofocus = Symbol(html.EmailInputElement.name + "." + 'autofocus'.toString());
+const maxLength = Symbol(html.EmailInputElement.name + "." + 'maxLength'.toString());
+const multiple = Symbol(html.EmailInputElement.name + "." + 'multiple'.toString());
+const pattern = Symbol(html.EmailInputElement.name + "." + 'pattern'.toString());
+const placeholder = Symbol(html.EmailInputElement.name + "." + 'placeholder'.toString());
+const readOnly = Symbol(html.EmailInputElement.name + "." + 'readOnly'.toString());
+const required = Symbol(html.EmailInputElement.name + "." + 'required'.toString());
+const size = Symbol(html.EmailInputElement.name + "." + 'size'.toString());
 html.EmailInputElement[dart.implements] = () => [html.TextInputElementBase];
 dart.setSignature(html.EmailInputElement, {
   constructors: () => ({new: dart.definiteFunctionType(html.EmailInputElement, [])}),
@@ -61193,12 +62467,40 @@
 ]);
 html.RangeInputElementBase = class RangeInputElementBase extends core.Object {
   new() {
-    this[dartx.max] = null;
-    this[dartx.min] = null;
-    this[dartx.step] = null;
-    this[dartx.valueAsNumber] = null;
+    this[max] = null;
+    this[min] = null;
+    this[step] = null;
+    this[valueAsNumber] = null;
+  }
+  get max() {
+    return this[max];
+  }
+  set max(value) {
+    this[max] = value;
+  }
+  get min() {
+    return this[min];
+  }
+  set min(value) {
+    this[min] = value;
+  }
+  get step() {
+    return this[step];
+  }
+  set step(value) {
+    this[step] = value;
+  }
+  get valueAsNumber() {
+    return this[valueAsNumber];
+  }
+  set valueAsNumber(value) {
+    this[valueAsNumber] = value;
   }
 };
+const max = Symbol(html.RangeInputElementBase.name + "." + 'max'.toString());
+const min = Symbol(html.RangeInputElementBase.name + "." + 'min'.toString());
+const step = Symbol(html.RangeInputElementBase.name + "." + 'step'.toString());
+const valueAsNumber = Symbol(html.RangeInputElementBase.name + "." + 'valueAsNumber'.toString());
 html.RangeInputElementBase[dart.implements] = () => [html.InputElementBase];
 dart.setSignature(html.RangeInputElementBase, {
   fields: () => ({
@@ -61227,10 +62529,31 @@
   static new() {
     return html.InputElement.new({type: 'date'});
   }
+  get valueAsDate() {
+    return this[valueAsDate];
+  }
+  set valueAsDate(value) {
+    this[valueAsDate] = value;
+  }
+  get readOnly() {
+    return this[readOnly];
+  }
+  set readOnly(value) {
+    this[readOnly] = value;
+  }
+  get required() {
+    return this[required];
+  }
+  set required(value) {
+    this[required] = value;
+  }
   static get supported() {
     return html.InputElement.new({type: 'date'})[dartx.type] == 'date';
   }
 };
+const valueAsDate = Symbol(html.DateInputElement.name + "." + 'valueAsDate'.toString());
+const readOnly = Symbol(html.DateInputElement.name + "." + 'readOnly'.toString());
+const required = Symbol(html.DateInputElement.name + "." + 'required'.toString());
 html.DateInputElement[dart.implements] = () => [html.RangeInputElementBase];
 dart.setSignature(html.DateInputElement, {
   constructors: () => ({new: dart.definiteFunctionType(html.DateInputElement, [])}),
@@ -61258,10 +62581,31 @@
   static new() {
     return html.InputElement.new({type: 'month'});
   }
+  get valueAsDate() {
+    return this[valueAsDate];
+  }
+  set valueAsDate(value) {
+    this[valueAsDate] = value;
+  }
+  get readOnly() {
+    return this[readOnly];
+  }
+  set readOnly(value) {
+    this[readOnly] = value;
+  }
+  get required() {
+    return this[required];
+  }
+  set required(value) {
+    this[required] = value;
+  }
   static get supported() {
     return html.InputElement.new({type: 'month'})[dartx.type] == 'month';
   }
 };
+const valueAsDate = Symbol(html.MonthInputElement.name + "." + 'valueAsDate'.toString());
+const readOnly = Symbol(html.MonthInputElement.name + "." + 'readOnly'.toString());
+const required = Symbol(html.MonthInputElement.name + "." + 'required'.toString());
 html.MonthInputElement[dart.implements] = () => [html.RangeInputElementBase];
 dart.setSignature(html.MonthInputElement, {
   constructors: () => ({new: dart.definiteFunctionType(html.MonthInputElement, [])}),
@@ -61289,10 +62633,31 @@
   static new() {
     return html.InputElement.new({type: 'week'});
   }
+  get valueAsDate() {
+    return this[valueAsDate];
+  }
+  set valueAsDate(value) {
+    this[valueAsDate] = value;
+  }
+  get readOnly() {
+    return this[readOnly];
+  }
+  set readOnly(value) {
+    this[readOnly] = value;
+  }
+  get required() {
+    return this[required];
+  }
+  set required(value) {
+    this[required] = value;
+  }
   static get supported() {
     return html.InputElement.new({type: 'week'})[dartx.type] == 'week';
   }
 };
+const valueAsDate = Symbol(html.WeekInputElement.name + "." + 'valueAsDate'.toString());
+const readOnly = Symbol(html.WeekInputElement.name + "." + 'readOnly'.toString());
+const required = Symbol(html.WeekInputElement.name + "." + 'required'.toString());
 html.WeekInputElement[dart.implements] = () => [html.RangeInputElementBase];
 dart.setSignature(html.WeekInputElement, {
   constructors: () => ({new: dart.definiteFunctionType(html.WeekInputElement, [])}),
@@ -61320,10 +62685,31 @@
   static new() {
     return html.InputElement.new({type: 'time'});
   }
+  get valueAsDate() {
+    return this[valueAsDate];
+  }
+  set valueAsDate(value) {
+    this[valueAsDate] = value;
+  }
+  get readOnly() {
+    return this[readOnly];
+  }
+  set readOnly(value) {
+    this[readOnly] = value;
+  }
+  get required() {
+    return this[required];
+  }
+  set required(value) {
+    this[required] = value;
+  }
   static get supported() {
     return html.InputElement.new({type: 'time'})[dartx.type] == 'time';
   }
 };
+const valueAsDate = Symbol(html.TimeInputElement.name + "." + 'valueAsDate'.toString());
+const readOnly = Symbol(html.TimeInputElement.name + "." + 'readOnly'.toString());
+const required = Symbol(html.TimeInputElement.name + "." + 'required'.toString());
 html.TimeInputElement[dart.implements] = () => [html.RangeInputElementBase];
 dart.setSignature(html.TimeInputElement, {
   constructors: () => ({new: dart.definiteFunctionType(html.TimeInputElement, [])}),
@@ -61350,10 +62736,24 @@
   static new() {
     return html.InputElement.new({type: 'datetime-local'});
   }
+  get readOnly() {
+    return this[readOnly];
+  }
+  set readOnly(value) {
+    this[readOnly] = value;
+  }
+  get required() {
+    return this[required];
+  }
+  set required(value) {
+    this[required] = value;
+  }
   static get supported() {
     return html.InputElement.new({type: 'datetime-local'})[dartx.type] == 'datetime-local';
   }
 };
+const readOnly = Symbol(html.LocalDateTimeInputElement.name + "." + 'readOnly'.toString());
+const required = Symbol(html.LocalDateTimeInputElement.name + "." + 'required'.toString());
 html.LocalDateTimeInputElement[dart.implements] = () => [html.RangeInputElementBase];
 dart.setSignature(html.LocalDateTimeInputElement, {
   constructors: () => ({new: dart.definiteFunctionType(html.LocalDateTimeInputElement, [])}),
@@ -61373,10 +62773,31 @@
   static new() {
     return html.InputElement.new({type: 'number'});
   }
+  get placeholder() {
+    return this[placeholder];
+  }
+  set placeholder(value) {
+    this[placeholder] = value;
+  }
+  get readOnly() {
+    return this[readOnly];
+  }
+  set readOnly(value) {
+    this[readOnly] = value;
+  }
+  get required() {
+    return this[required];
+  }
+  set required(value) {
+    this[required] = value;
+  }
   static get supported() {
     return html.InputElement.new({type: 'number'})[dartx.type] == 'number';
   }
 };
+const placeholder = Symbol(html.NumberInputElement.name + "." + 'placeholder'.toString());
+const readOnly = Symbol(html.NumberInputElement.name + "." + 'readOnly'.toString());
+const required = Symbol(html.NumberInputElement.name + "." + 'required'.toString());
 html.NumberInputElement[dart.implements] = () => [html.RangeInputElementBase];
 dart.setSignature(html.NumberInputElement, {
   constructors: () => ({new: dart.definiteFunctionType(html.NumberInputElement, [])}),
@@ -61416,7 +62837,21 @@
   static new() {
     return html.InputElement.new({type: 'checkbox'});
   }
+  get checked() {
+    return this[checked];
+  }
+  set checked(value) {
+    this[checked] = value;
+  }
+  get required() {
+    return this[required];
+  }
+  set required(value) {
+    this[required] = value;
+  }
 };
+const checked = Symbol(html.CheckboxInputElement.name + "." + 'checked'.toString());
+const required = Symbol(html.CheckboxInputElement.name + "." + 'required'.toString());
 html.CheckboxInputElement[dart.implements] = () => [html.InputElementBase];
 dart.setSignature(html.CheckboxInputElement, {
   constructors: () => ({new: dart.definiteFunctionType(html.CheckboxInputElement, [])}),
@@ -61434,7 +62869,21 @@
   static new() {
     return html.InputElement.new({type: 'radio'});
   }
+  get checked() {
+    return this[checked];
+  }
+  set checked(value) {
+    this[checked] = value;
+  }
+  get required() {
+    return this[required];
+  }
+  set required(value) {
+    this[required] = value;
+  }
 };
+const checked = Symbol(html.RadioButtonInputElement.name + "." + 'checked'.toString());
+const required = Symbol(html.RadioButtonInputElement.name + "." + 'required'.toString());
 html.RadioButtonInputElement[dart.implements] = () => [html.InputElementBase];
 dart.setSignature(html.RadioButtonInputElement, {
   constructors: () => ({new: dart.definiteFunctionType(html.RadioButtonInputElement, [])}),
@@ -61454,7 +62903,35 @@
   static new() {
     return html.InputElement.new({type: 'file'});
   }
+  get accept() {
+    return this[accept];
+  }
+  set accept(value) {
+    this[accept] = value;
+  }
+  get multiple() {
+    return this[multiple];
+  }
+  set multiple(value) {
+    this[multiple] = value;
+  }
+  get required() {
+    return this[required];
+  }
+  set required(value) {
+    this[required] = value;
+  }
+  get files() {
+    return this[files];
+  }
+  set files(value) {
+    this[files] = value;
+  }
 };
+const accept = Symbol(html.FileUploadInputElement.name + "." + 'accept'.toString());
+const multiple = Symbol(html.FileUploadInputElement.name + "." + 'multiple'.toString());
+const required = Symbol(html.FileUploadInputElement.name + "." + 'required'.toString());
+const files = Symbol(html.FileUploadInputElement.name + "." + 'files'.toString());
 html.FileUploadInputElement[dart.implements] = () => [html.InputElementBase];
 dart.setSignature(html.FileUploadInputElement, {
   constructors: () => ({new: dart.definiteFunctionType(html.FileUploadInputElement, [])}),
@@ -61486,7 +62963,42 @@
   static new() {
     return html.InputElement.new({type: 'submit'});
   }
+  get formAction() {
+    return this[formAction];
+  }
+  set formAction(value) {
+    this[formAction] = value;
+  }
+  get formEnctype() {
+    return this[formEnctype];
+  }
+  set formEnctype(value) {
+    this[formEnctype] = value;
+  }
+  get formMethod() {
+    return this[formMethod];
+  }
+  set formMethod(value) {
+    this[formMethod] = value;
+  }
+  get formNoValidate() {
+    return this[formNoValidate];
+  }
+  set formNoValidate(value) {
+    this[formNoValidate] = value;
+  }
+  get formTarget() {
+    return this[formTarget];
+  }
+  set formTarget(value) {
+    this[formTarget] = value;
+  }
 };
+const formAction = Symbol(html.SubmitButtonInputElement.name + "." + 'formAction'.toString());
+const formEnctype = Symbol(html.SubmitButtonInputElement.name + "." + 'formEnctype'.toString());
+const formMethod = Symbol(html.SubmitButtonInputElement.name + "." + 'formMethod'.toString());
+const formNoValidate = Symbol(html.SubmitButtonInputElement.name + "." + 'formNoValidate'.toString());
+const formTarget = Symbol(html.SubmitButtonInputElement.name + "." + 'formTarget'.toString());
 html.SubmitButtonInputElement[dart.implements] = () => [html.InputElementBase];
 dart.setSignature(html.SubmitButtonInputElement, {
   constructors: () => ({new: dart.definiteFunctionType(html.SubmitButtonInputElement, [])}),
@@ -61525,7 +63037,70 @@
   static new() {
     return html.InputElement.new({type: 'image'});
   }
+  get alt() {
+    return this[alt];
+  }
+  set alt(value) {
+    this[alt] = value;
+  }
+  get formAction() {
+    return this[formAction];
+  }
+  set formAction(value) {
+    this[formAction] = value;
+  }
+  get formEnctype() {
+    return this[formEnctype];
+  }
+  set formEnctype(value) {
+    this[formEnctype] = value;
+  }
+  get formMethod() {
+    return this[formMethod];
+  }
+  set formMethod(value) {
+    this[formMethod] = value;
+  }
+  get formNoValidate() {
+    return this[formNoValidate];
+  }
+  set formNoValidate(value) {
+    this[formNoValidate] = value;
+  }
+  get formTarget() {
+    return this[formTarget];
+  }
+  set formTarget(value) {
+    this[formTarget] = value;
+  }
+  get height() {
+    return this[height];
+  }
+  set height(value) {
+    this[height] = value;
+  }
+  get src() {
+    return this[src];
+  }
+  set src(value) {
+    this[src] = value;
+  }
+  get width() {
+    return this[width];
+  }
+  set width(value) {
+    this[width] = value;
+  }
 };
+const alt = Symbol(html.ImageButtonInputElement.name + "." + 'alt'.toString());
+const formAction = Symbol(html.ImageButtonInputElement.name + "." + 'formAction'.toString());
+const formEnctype = Symbol(html.ImageButtonInputElement.name + "." + 'formEnctype'.toString());
+const formMethod = Symbol(html.ImageButtonInputElement.name + "." + 'formMethod'.toString());
+const formNoValidate = Symbol(html.ImageButtonInputElement.name + "." + 'formNoValidate'.toString());
+const formTarget = Symbol(html.ImageButtonInputElement.name + "." + 'formTarget'.toString());
+const height = Symbol(html.ImageButtonInputElement.name + "." + 'height'.toString());
+const src = Symbol(html.ImageButtonInputElement.name + "." + 'src'.toString());
+const width = Symbol(html.ImageButtonInputElement.name + "." + 'width'.toString());
 html.ImageButtonInputElement[dart.implements] = () => [html.InputElementBase];
 dart.setSignature(html.ImageButtonInputElement, {
   constructors: () => ({new: dart.definiteFunctionType(html.ImageButtonInputElement, [])}),
@@ -61673,8 +63248,8 @@
   get [dartx.shiftKey]() {
     return this.shiftKey;
   }
-  [dartx.getModifierState](keyArg) {
-    return this.getModifierState(keyArg);
+  [dartx.getModifierState](...args) {
+    return this.getModifierState.apply(this, args);
   }
 };
 dart.setSignature(html.KeyboardEvent, {
@@ -61849,14 +63424,14 @@
   get [dartx.willValidate]() {
     return this.willValidate;
   }
-  [dartx.checkValidity]() {
-    return this.checkValidity();
+  [dartx.checkValidity](...args) {
+    return this.checkValidity.apply(this, args);
   }
-  [dartx.reportValidity]() {
-    return this.reportValidity();
+  [dartx.reportValidity](...args) {
+    return this.reportValidity.apply(this, args);
   }
-  [dartx.setCustomValidity](error) {
-    return this.setCustomValidity(error);
+  [dartx.setCustomValidity](...args) {
+    return this.setCustomValidity.apply(this, args);
   }
 };
 dart.defineNamedConstructor(html.KeygenElement, 'created');
@@ -62181,14 +63756,14 @@
   set [dartx.search](value) {
     this.search = value;
   }
-  [dartx.assign](url) {
-    return this.assign(url);
+  [dartx.assign](...args) {
+    return this.assign.apply(this, args);
   }
-  [dartx.reload]() {
-    return this.reload();
+  [dartx.reload](...args) {
+    return this.reload.apply(this, args);
   }
-  [dartx.replace](url) {
-    return this.replace(url);
+  [dartx.replace](...args) {
+    return this.replace.apply(this, args);
   }
   get [dartx.origin]() {
     if ("origin" in this) {
@@ -62335,14 +63910,14 @@
   set [dartx.volume](value) {
     this.volume = value;
   }
-  [dartx.pause]() {
-    return this.pause();
+  [dartx.pause](...args) {
+    return this.pause.apply(this, args);
   }
-  [dartx.play]() {
-    return this.play();
+  [dartx.play](...args) {
+    return this.play.apply(this, args);
   }
-  [dartx.unpause]() {
-    return this.unpause();
+  [dartx.unpause](...args) {
+    return this.unpause.apply(this, args);
   }
 };
 dart.setSignature(html.MediaController, {
@@ -62414,15 +63989,15 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.enumerateDevices]() {
-    return this.enumerateDevices();
+  [dartx.enumerateDevices](...args) {
+    return this.enumerateDevices.apply(this, args);
   }
   [dartx.getUserMedia](options) {
     let options_1 = html_common.convertDartToNative_Dictionary(options);
     return this[_getUserMedia_1](options_1);
   }
-  [_getUserMedia_1](options) {
-    return this.getUserMedia(options);
+  [_getUserMedia_1](...args) {
+    return this.getUserMedia.apply(this, args);
   }
 };
 dart.setSignature(html.MediaDevices, {
@@ -62684,20 +64259,20 @@
   get [dartx.sessionId]() {
     return this.sessionId;
   }
-  [dartx.close]() {
-    return this.close();
+  [dartx.close](...args) {
+    return this.close.apply(this, args);
   }
-  [dartx.generateRequest](initDataType, initData) {
-    return this.generateRequest(initDataType, initData);
+  [dartx.generateRequest](...args) {
+    return this.generateRequest.apply(this, args);
   }
-  [dartx.load](sessionId) {
-    return this.load(sessionId);
+  [dartx.load](...args) {
+    return this.load.apply(this, args);
   }
-  [dartx.remove]() {
-    return this.remove();
+  [dartx.remove](...args) {
+    return this.remove.apply(this, args);
   }
-  [_update](response) {
-    return this.update(response);
+  [_update](...args) {
+    return this.update.apply(this, args);
   }
 };
 dart.setSignature(html.MediaKeySession, {
@@ -62746,14 +64321,14 @@
   get [dartx.keySystem]() {
     return this.keySystem;
   }
-  [dartx.createMediaKeys]() {
-    return this.createMediaKeys();
+  [dartx.createMediaKeys](...args) {
+    return this.createMediaKeys.apply(this, args);
   }
   [dartx.getConfiguration]() {
     return html_common.convertNativeToDart_Dictionary(this[_getConfiguration_1]());
   }
-  [_getConfiguration_1]() {
-    return this.getConfiguration();
+  [_getConfiguration_1](...args) {
+    return this.getConfiguration.apply(this, args);
   }
 };
 dart.setSignature(html.MediaKeySystemAccess, {
@@ -62774,11 +64349,11 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [_createSession](sessionType) {
-    return this.createSession(sessionType);
+  [_createSession](...args) {
+    return this.createSession.apply(this, args);
   }
-  [dartx.setServerCertificate](serverCertificate) {
-    return this.setServerCertificate(serverCertificate);
+  [dartx.setServerCertificate](...args) {
+    return this.setServerCertificate.apply(this, args);
   }
 };
 dart.setSignature(html.MediaKeys, {
@@ -62809,14 +64384,14 @@
   set [dartx.mediaText](value) {
     this.mediaText = value;
   }
-  [dartx.appendMedium](medium) {
-    return this.appendMedium(medium);
+  [dartx.appendMedium](...args) {
+    return this.appendMedium.apply(this, args);
   }
-  [dartx.deleteMedium](medium) {
-    return this.deleteMedium(medium);
+  [dartx.deleteMedium](...args) {
+    return this.deleteMedium.apply(this, args);
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
 };
 dart.setSignature(html.MediaList, {
@@ -62849,11 +64424,11 @@
   get [dartx.media]() {
     return this.media;
   }
-  [dartx.addListener](listener) {
-    return this.addListener(listener);
+  [dartx.addListener](...args) {
+    return this.addListener.apply(this, args);
   }
-  [dartx.removeListener](listener) {
-    return this.removeListener(listener);
+  [dartx.removeListener](...args) {
+    return this.removeListener.apply(this, args);
   }
   get [dartx.onChange]() {
     return html.MediaQueryList.changeEvent.forTarget(this);
@@ -62937,11 +64512,11 @@
   static _create_1() {
     return new MediaSession();
   }
-  [dartx.activate]() {
-    return this.activate();
+  [dartx.activate](...args) {
+    return this.activate.apply(this, args);
   }
-  [dartx.deactivate]() {
-    return this.deactivate();
+  [dartx.deactivate](...args) {
+    return this.deactivate.apply(this, args);
   }
 };
 dart.setSignature(html.MediaSession, {
@@ -62994,14 +64569,14 @@
   get [dartx.sourceBuffers]() {
     return this.sourceBuffers;
   }
-  [dartx.addSourceBuffer](type) {
-    return this.addSourceBuffer(type);
+  [dartx.addSourceBuffer](...args) {
+    return this.addSourceBuffer.apply(this, args);
   }
-  [dartx.endOfStream](error) {
-    return this.endOfStream(error);
+  [dartx.endOfStream](...args) {
+    return this.endOfStream.apply(this, args);
   }
-  [dartx.removeSourceBuffer](buffer) {
-    return this.removeSourceBuffer(buffer);
+  [dartx.removeSourceBuffer](...args) {
+    return this.removeSourceBuffer.apply(this, args);
   }
 };
 dart.setSignature(html.MediaSource, {
@@ -63083,29 +64658,29 @@
   get [dartx.label]() {
     return this.label;
   }
-  [dartx.addTrack](track) {
-    return this.addTrack(track);
+  [dartx.addTrack](...args) {
+    return this.addTrack.apply(this, args);
   }
-  [dartx.clone]() {
-    return this.clone();
+  [dartx.clone](...args) {
+    return this.clone.apply(this, args);
   }
-  [dartx.getAudioTracks]() {
-    return this.getAudioTracks();
+  [dartx.getAudioTracks](...args) {
+    return this.getAudioTracks.apply(this, args);
   }
-  [dartx.getTrackById](trackId) {
-    return this.getTrackById(trackId);
+  [dartx.getTrackById](...args) {
+    return this.getTrackById.apply(this, args);
   }
-  [dartx.getTracks]() {
-    return this.getTracks();
+  [dartx.getTracks](...args) {
+    return this.getTracks.apply(this, args);
   }
-  [dartx.getVideoTracks]() {
-    return this.getVideoTracks();
+  [dartx.getVideoTracks](...args) {
+    return this.getVideoTracks.apply(this, args);
   }
-  [dartx.removeTrack](track) {
-    return this.removeTrack(track);
+  [dartx.removeTrack](...args) {
+    return this.removeTrack.apply(this, args);
   }
-  [dartx.stop]() {
-    return this.stop();
+  [dartx.stop](...args) {
+    return this.stop.apply(this, args);
   }
   get [dartx.onAddTrack]() {
     return html.MediaStream.addTrackEvent.forTarget(this);
@@ -63251,8 +64826,8 @@
   get [dartx.readyState]() {
     return this.readyState;
   }
-  [dartx.clone]() {
-    return this.clone();
+  [dartx.clone](...args) {
+    return this.clone.apply(this, args);
   }
   static getSources() {
     let completer = CompleterOfListOfSourceInfo().new();
@@ -63261,8 +64836,8 @@
     }, ListOfSourceInfoTovoid()));
     return completer.future;
   }
-  [dartx.stop]() {
-    return this.stop();
+  [dartx.stop](...args) {
+    return this.stop.apply(this, args);
   }
   get [dartx.onEnded]() {
     return html.MediaStreamTrack.endedEvent.forTarget(this);
@@ -63573,8 +65148,8 @@
   get [_get_source]() {
     return this.source;
   }
-  [_initMessageEvent](typeArg, canBubbleArg, cancelableArg, dataArg, originArg, lastEventIdArg, sourceArg, portsArg) {
-    return this.initMessageEvent(typeArg, canBubbleArg, cancelableArg, dataArg, originArg, lastEventIdArg, sourceArg, portsArg);
+  [_initMessageEvent](...args) {
+    return this.initMessageEvent.apply(this, args);
   }
 };
 dart.setSignature(html.MessageEvent, {
@@ -63610,8 +65185,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.close]() {
-    return this.close();
+  [dartx.close](...args) {
+    return this.close.apply(this, args);
   }
   [dartx.postMessage](message, transfer) {
     if (transfer === void 0) transfer = null;
@@ -63624,14 +65199,14 @@
     this[_postMessage_2](message_1);
     return;
   }
-  [_postMessage_1](message, transfer) {
-    return this.postMessage(message, transfer);
+  [_postMessage_1](...args) {
+    return this.postMessage.apply(this, args);
   }
-  [_postMessage_2](message) {
-    return this.postMessage(message);
+  [_postMessage_2](...args) {
+    return this.postMessage.apply(this, args);
   }
-  [dartx.start]() {
-    return this.start();
+  [dartx.start](...args) {
+    return this.start.apply(this, args);
   }
   get [dartx.onMessage]() {
     return html.MessagePort.messageEvent.forTarget(this);
@@ -63925,11 +65500,11 @@
   get [dartx.version]() {
     return this.version;
   }
-  [dartx.close]() {
-    return this.close();
+  [dartx.close](...args) {
+    return this.close.apply(this, args);
   }
-  [dartx.open]() {
-    return this.open();
+  [dartx.open](...args) {
+    return this.open.apply(this, args);
   }
 };
 dart.setSignature(html.MidiPort, {
@@ -64039,8 +65614,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.send](data, timestamp) {
-    return this.send(data, timestamp);
+  [dartx.send](...args) {
+    return this.send.apply(this, args);
   }
 };
 dart.setSignature(html.MidiOutput, {
@@ -64099,8 +65674,8 @@
 dart.registerExtension(dart.global.MimeType, html.MimeType);
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'length',
   'first',
   'last',
@@ -64116,11 +65691,11 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
     return this[index];
   }
-  [dartx.set](index, value) {
+  [dartx._set](index, value) {
     dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
     return value;
   }
@@ -64149,13 +65724,13 @@
     dart.throw(new core.StateError("More than one element"));
   }
   [dartx.elementAt](index) {
-    return this[dartx.get](index);
+    return this[dartx._get](index);
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
-  [dartx.namedItem](name) {
-    return this.namedItem(name);
+  [dartx.namedItem](...args) {
+    return this.namedItem.apply(this, args);
   }
 };
 html.MimeTypeArray[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfMimeType()];
@@ -64169,8 +65744,8 @@
   }),
   setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(html.MimeType, [core.int]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html.MimeType]),
+    [dartx._get]: dart.definiteFunctionType(html.MimeType, [core.int]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html.MimeType]),
     [dartx.elementAt]: dart.definiteFunctionType(html.MimeType, [core.int]),
     [dartx.item]: dart.definiteFunctionType(html.MimeType, [core.int]),
     [dartx.namedItem]: dart.definiteFunctionType(html.MimeType, [core.String])
@@ -64362,8 +65937,8 @@
     this[_initMouseEvent_1](type, bubbles, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget_1);
     return;
   }
-  [_initMouseEvent_1](type, bubbles, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget) {
-    return this.initMouseEvent(type, bubbles, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget);
+  [_initMouseEvent_1](...args) {
+    return this.initMouseEvent.apply(this, args);
   }
   get [dartx.client]() {
     return new (PointOfnum())(this[_clientX], this[_clientY]);
@@ -64445,6 +66020,7 @@
   names: ['_create_1', '_create_2']
 });
 dart.registerExtension(dart.global.MouseEvent, html.MouseEvent);
+dart.registerExtension(dart.global.DragEvent, html.MouseEvent);
 html.MutationCallback = dart.typedef('MutationCallback', () => dart.functionType(dart.void, [ListOfMutationRecord(), html.MutationObserver]));
 const _observe_1 = Symbol('_observe_1');
 const _observe = Symbol('_observe');
@@ -64455,19 +66031,19 @@
   'observe'
 ]);
 html.MutationObserver = class MutationObserver extends _interceptors.Interceptor {
-  [dartx.disconnect]() {
-    return this.disconnect();
+  [dartx.disconnect](...args) {
+    return this.disconnect.apply(this, args);
   }
   [_observe](target, options) {
     let options_1 = html_common.convertDartToNative_Dictionary(options);
     this[_observe_1](target, options_1);
     return;
   }
-  [_observe_1](target, options) {
-    return this.observe(target, options);
+  [_observe_1](...args) {
+    return this.observe.apply(this, args);
   }
-  [dartx.takeRecords]() {
-    return this.takeRecords();
+  [dartx.takeRecords](...args) {
+    return this.takeRecords.apply(this, args);
   }
   static get supported() {
     return !!(window.MutationObserver || window.WebKitMutationObserver);
@@ -64505,8 +66081,8 @@
   static _fixupList(list) {
     return list;
   }
-  [_call](target, options) {
-    return this.observe(target, options);
+  [_call](...args) {
+    return this.observe.apply(this, args);
   }
   static new(callback) {
     0;
@@ -64534,6 +66110,7 @@
 });
 html.MutationObserver._boolKeys = dart.const(dart.map({childList: true, attributes: true, characterData: true, subtree: true, attributeOldValue: true, characterDataOldValue: true}, core.String, core.bool));
 dart.registerExtension(dart.global.MutationObserver, html.MutationObserver);
+dart.registerExtension(dart.global.WebKitMutationObserver, html.MutationObserver);
 dart.defineExtensionNames([
   'addedNodes',
   'attributeName',
@@ -64659,8 +66236,8 @@
       this.getUserMedia = this.getUserMedia || this.webkitGetUserMedia || this.mozGetUserMedia || this.msGetUserMedia;
     }
   }
-  [_getUserMedia](options, success, error) {
-    return this.getUserMedia(options, success, error);
+  [_getUserMedia](...args) {
+    return this.getUserMedia.apply(this, args);
   }
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
@@ -64719,17 +66296,17 @@
   get [dartx.temporaryStorage]() {
     return this.webkitTemporaryStorage;
   }
-  [dartx.getBattery]() {
-    return this.getBattery();
+  [dartx.getBattery](...args) {
+    return this.getBattery.apply(this, args);
   }
-  [dartx.getGamepads]() {
-    return this.getGamepads();
+  [dartx.getGamepads](...args) {
+    return this.getGamepads.apply(this, args);
   }
-  [dartx.getVRDevices]() {
-    return this.getVRDevices();
+  [dartx.getVRDevices](...args) {
+    return this.getVRDevices.apply(this, args);
   }
-  [dartx.registerProtocolHandler](scheme, url, title) {
-    return this.registerProtocolHandler(scheme, url, title);
+  [dartx.registerProtocolHandler](...args) {
+    return this.registerProtocolHandler.apply(this, args);
   }
   [dartx.requestMidiAccess](options) {
     if (options === void 0) options = null;
@@ -64739,17 +66316,17 @@
     }
     return this[_requestMidiAccess_2]();
   }
-  [_requestMidiAccess_1](options) {
-    return this.requestMIDIAccess(options);
+  [_requestMidiAccess_1](...args) {
+    return this.requestMIDIAccess.apply(this, args);
   }
-  [_requestMidiAccess_2]() {
-    return this.requestMIDIAccess();
+  [_requestMidiAccess_2](...args) {
+    return this.requestMIDIAccess.apply(this, args);
   }
-  [dartx.requestMediaKeySystemAccess](keySystem, supportedConfigurations) {
-    return this.requestMediaKeySystemAccess(keySystem, supportedConfigurations);
+  [dartx.requestMediaKeySystemAccess](...args) {
+    return this.requestMediaKeySystemAccess.apply(this, args);
   }
-  [dartx.sendBeacon](url, data) {
-    return this.sendBeacon(url, data);
+  [dartx.sendBeacon](...args) {
+    return this.sendBeacon.apply(this, args);
   }
   get [dartx.hardwareConcurrency]() {
     return this.hardwareConcurrency;
@@ -64784,8 +66361,8 @@
   get [dartx.cookieEnabled]() {
     return this.cookieEnabled;
   }
-  [dartx.getStorageUpdates]() {
-    return this.getStorageUpdates();
+  [dartx.getStorageUpdates](...args) {
+    return this.getStorageUpdates.apply(this, args);
   }
 };
 html.Navigator[dart.implements] = () => [html.NavigatorStorageUtils, html.NavigatorCpu, html.NavigatorLanguage, html.NavigatorOnLine, html.NavigatorID];
@@ -64847,7 +66424,14 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
+  get hardwareConcurrency() {
+    return this[hardwareConcurrency];
+  }
+  set hardwareConcurrency(value) {
+    super.hardwareConcurrency = value;
+  }
 };
+const hardwareConcurrency = Symbol(html.NavigatorCpu.name + "." + 'hardwareConcurrency'.toString());
 dart.setSignature(html.NavigatorCpu, {
   constructors: () => ({_: dart.definiteFunctionType(html.NavigatorCpu, [])}),
   fields: () => ({hardwareConcurrency: core.int})
@@ -64866,7 +66450,56 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
+  get appCodeName() {
+    return this[appCodeName];
+  }
+  set appCodeName(value) {
+    super.appCodeName = value;
+  }
+  get appName() {
+    return this[appName];
+  }
+  set appName(value) {
+    super.appName = value;
+  }
+  get appVersion() {
+    return this[appVersion];
+  }
+  set appVersion(value) {
+    super.appVersion = value;
+  }
+  get dartEnabled() {
+    return this[dartEnabled];
+  }
+  set dartEnabled(value) {
+    super.dartEnabled = value;
+  }
+  get platform() {
+    return this[platform];
+  }
+  set platform(value) {
+    super.platform = value;
+  }
+  get product() {
+    return this[product];
+  }
+  set product(value) {
+    super.product = value;
+  }
+  get userAgent() {
+    return this[userAgent];
+  }
+  set userAgent(value) {
+    super.userAgent = value;
+  }
 };
+const appCodeName = Symbol(html.NavigatorID.name + "." + 'appCodeName'.toString());
+const appName = Symbol(html.NavigatorID.name + "." + 'appName'.toString());
+const appVersion = Symbol(html.NavigatorID.name + "." + 'appVersion'.toString());
+const dartEnabled = Symbol(html.NavigatorID.name + "." + 'dartEnabled'.toString());
+const platform = Symbol(html.NavigatorID.name + "." + 'platform'.toString());
+const product = Symbol(html.NavigatorID.name + "." + 'product'.toString());
+const userAgent = Symbol(html.NavigatorID.name + "." + 'userAgent'.toString());
 dart.setSignature(html.NavigatorID, {
   constructors: () => ({_: dart.definiteFunctionType(html.NavigatorID, [])}),
   fields: () => ({
@@ -64896,7 +66529,21 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
+  get language() {
+    return this[language];
+  }
+  set language(value) {
+    super.language = value;
+  }
+  get languages() {
+    return this[languages];
+  }
+  set languages(value) {
+    super.languages = value;
+  }
 };
+const language = Symbol(html.NavigatorLanguage.name + "." + 'language'.toString());
+const languages = Symbol(html.NavigatorLanguage.name + "." + 'languages'.toString());
 dart.setSignature(html.NavigatorLanguage, {
   constructors: () => ({_: dart.definiteFunctionType(html.NavigatorLanguage, [])}),
   fields: () => ({
@@ -64912,7 +66559,14 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
+  get onLine() {
+    return this[onLine];
+  }
+  set onLine(value) {
+    super.onLine = value;
+  }
 };
+const onLine = Symbol(html.NavigatorOnLine.name + "." + 'onLine'.toString());
 dart.setSignature(html.NavigatorOnLine, {
   constructors: () => ({_: dart.definiteFunctionType(html.NavigatorOnLine, [])}),
   fields: () => ({onLine: core.bool})
@@ -64929,8 +66583,8 @@
   get [dartx.cookieEnabled]() {
     return this.cookieEnabled;
   }
-  [dartx.getStorageUpdates]() {
-    return this.getStorageUpdates();
+  [dartx.getStorageUpdates](...args) {
+    return this.getStorageUpdates.apply(this, args);
   }
 };
 dart.setSignature(html.NavigatorStorageUtils, {
@@ -65029,14 +66683,14 @@
     if (index == this.length) {
       this[_this][dartx.append](node);
     } else {
-      this[_this][dartx.insertBefore](node, this.get(index));
+      this[_this][dartx.insertBefore](node, this._get(index));
     }
   }
   insertAll(index, iterable) {
     if (index == this.length) {
       this.addAll(iterable);
     } else {
-      let item = this.get(index);
+      let item = this._get(index);
       this[_this][dartx.insertAllBefore](iterable, item);
     }
   }
@@ -65051,7 +66705,7 @@
     return result;
   }
   removeAt(index) {
-    let result = this.get(index);
+    let result = this._get(index);
     if (result != null) {
       this[_this][_removeChild](result);
     }
@@ -65083,8 +66737,8 @@
   clear() {
     this[_this][_clearChildren]();
   }
-  set(index, value) {
-    this[_this][_replaceChild](value, this.get(index));
+  _set(index, value) {
+    this[_this][_replaceChild](value, this._get(index));
     return value;
   }
   get iterator() {
@@ -65112,8 +66766,8 @@
   set length(value) {
     dart.throw(new core.UnsupportedError("Cannot set length on immutable List."));
   }
-  get(index) {
-    return this[_this][dartx.childNodes][dartx.get](index);
+  _get(index) {
+    return this[_this][dartx.childNodes][dartx._get](index);
   }
   get rawList() {
     return this[_this][dartx.childNodes];
@@ -65144,11 +66798,11 @@
     [_filter]: dart.definiteFunctionType(dart.void, [NodeTobool(), core.bool]),
     removeWhere: dart.definiteFunctionType(dart.void, [NodeTobool()]),
     retainWhere: dart.definiteFunctionType(dart.void, [NodeTobool()]),
-    set: dart.definiteFunctionType(dart.void, [core.int, html.Node]),
+    _set: dart.definiteFunctionType(dart.void, [core.int, html.Node]),
     sort: dart.definiteFunctionType(dart.void, [], [ComparatorOfNode()]),
     setRange: dart.definiteFunctionType(dart.void, [core.int, core.int, IterableOfNode()], [core.int]),
     fillRange: dart.definiteFunctionType(dart.void, [core.int, core.int], [html.Node]),
-    get: dart.definiteFunctionType(html.Node, [core.int])
+    _get: dart.definiteFunctionType(html.Node, [core.int])
   })
 });
 dart.defineExtensionMembers(html._ChildNodeListLazy, [
@@ -65163,12 +66817,12 @@
   'removeWhere',
   'retainWhere',
   'clear',
-  'set',
+  '_set',
   'sort',
   'shuffle',
   'setRange',
   'fillRange',
-  'get',
+  '_get',
   'first',
   'last',
   'single',
@@ -65237,14 +66891,14 @@
   get [dartx.whatToShow]() {
     return this.whatToShow;
   }
-  [dartx.detach]() {
-    return this.detach();
+  [dartx.detach](...args) {
+    return this.detach.apply(this, args);
   }
-  [dartx.nextNode]() {
-    return this.nextNode();
+  [dartx.nextNode](...args) {
+    return this.nextNode.apply(this, args);
   }
-  [dartx.previousNode]() {
-    return this.previousNode();
+  [dartx.previousNode](...args) {
+    return this.previousNode.apply(this, args);
   }
 };
 dart.setSignature(html.NodeIterator, {
@@ -65267,8 +66921,8 @@
 dart.registerExtension(dart.global.NodeIterator, html.NodeIterator);
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'length',
   'first',
   'last',
@@ -65282,11 +66936,11 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
     return this[index];
   }
-  [dartx.set](index, value) {
+  [dartx._set](index, value) {
     dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
     return value;
   }
@@ -65315,10 +66969,10 @@
     dart.throw(new core.StateError("More than one element"));
   }
   [dartx.elementAt](index) {
-    return this[dartx.get](index);
+    return this[dartx._get](index);
   }
-  [_item](index) {
-    return this.item(index);
+  [_item](...args) {
+    return this.item.apply(this, args);
   }
 };
 html.NodeList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfNode()];
@@ -65332,13 +66986,14 @@
   }),
   setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(html.Node, [core.int]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html.Node]),
+    [dartx._get]: dart.definiteFunctionType(html.Node, [core.int]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html.Node]),
     [dartx.elementAt]: dart.definiteFunctionType(html.Node, [core.int]),
     [_item]: dart.definiteFunctionType(html.Node, [core.int])
   })
 });
 dart.registerExtension(dart.global.NodeList, html.NodeList);
+dart.registerExtension(dart.global.RadioNodeList, html.NodeList);
 dart.defineExtensionNames([
   'nextElementSibling',
   'previousElementSibling'
@@ -65369,8 +67024,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.getElementById](elementId) {
-    return this.getElementById(elementId);
+  [dartx.getElementById](...args) {
+    return this.getElementById.apply(this, args);
   }
 };
 dart.setSignature(html.NonElementParentNode, {
@@ -65403,11 +67058,11 @@
     let tag = opts && 'tag' in opts ? opts.tag : null;
     let icon = opts && 'icon' in opts ? opts.icon : null;
     let parsedOptions = dart.map();
-    if (dir != null) parsedOptions[dartx.set]('dir', dir);
-    if (body != null) parsedOptions[dartx.set]('body', body);
-    if (lang != null) parsedOptions[dartx.set]('lang', lang);
-    if (tag != null) parsedOptions[dartx.set]('tag', tag);
-    if (icon != null) parsedOptions[dartx.set]('icon', icon);
+    if (dir != null) parsedOptions[dartx._set]('dir', dir);
+    if (body != null) parsedOptions[dartx._set]('body', body);
+    if (lang != null) parsedOptions[dartx._set]('lang', lang);
+    if (tag != null) parsedOptions[dartx._set]('tag', tag);
+    if (icon != null) parsedOptions[dartx._set]('icon', icon);
     return html.Notification._factoryNotification(title, parsedOptions);
   }
   static _() {
@@ -65460,8 +67115,8 @@
   get [dartx.vibrate]() {
     return this.vibrate;
   }
-  [dartx.close]() {
-    return this.close();
+  [dartx.close](...args) {
+    return this.close.apply(this, args);
   }
   static requestPermission() {
     let completer = CompleterOfString().new();
@@ -65714,20 +67369,20 @@
   get [dartx.willValidate]() {
     return this.willValidate;
   }
-  [__getter__](index_OR_name) {
-    return this.__getter__(index_OR_name);
+  [__getter__](...args) {
+    return this.__getter__.apply(this, args);
   }
-  [__setter__](index_OR_name, value) {
-    return this.__setter__(index_OR_name, value);
+  [__setter__](...args) {
+    return this.__setter__.apply(this, args);
   }
-  [dartx.checkValidity]() {
-    return this.checkValidity();
+  [dartx.checkValidity](...args) {
+    return this.checkValidity.apply(this, args);
   }
-  [dartx.reportValidity]() {
-    return this.reportValidity();
+  [dartx.reportValidity](...args) {
+    return this.reportValidity.apply(this, args);
   }
-  [dartx.setCustomValidity](error) {
-    return this.setCustomValidity(error);
+  [dartx.setCustomValidity](...args) {
+    return this.setCustomValidity.apply(this, args);
   }
 };
 dart.defineNamedConstructor(html.ObjectElement, 'created');
@@ -66001,14 +67656,14 @@
   get [dartx.willValidate]() {
     return this.willValidate;
   }
-  [dartx.checkValidity]() {
-    return this.checkValidity();
+  [dartx.checkValidity](...args) {
+    return this.checkValidity.apply(this, args);
   }
-  [dartx.reportValidity]() {
-    return this.reportValidity();
+  [dartx.reportValidity](...args) {
+    return this.reportValidity.apply(this, args);
   }
-  [dartx.setCustomValidity](error) {
-    return this.setCustomValidity(error);
+  [dartx.setCustomValidity](...args) {
+    return this.setCustomValidity.apply(this, args);
   }
 };
 dart.defineNamedConstructor(html.OutputElement, 'created');
@@ -66242,35 +67897,35 @@
   static _create_3(path_OR_text) {
     return new Path2D(path_OR_text);
   }
-  [dartx.addPath](path, transform) {
-    return this.addPath(path, transform);
+  [dartx.addPath](...args) {
+    return this.addPath.apply(this, args);
   }
-  [dartx.arc](x, y, radius, startAngle, endAngle, anticlockwise) {
-    return this.arc(x, y, radius, startAngle, endAngle, anticlockwise);
+  [dartx.arc](...args) {
+    return this.arc.apply(this, args);
   }
-  [dartx.arcTo](x1, y1, x2, y2, radius) {
-    return this.arcTo(x1, y1, x2, y2, radius);
+  [dartx.arcTo](...args) {
+    return this.arcTo.apply(this, args);
   }
-  [dartx.bezierCurveTo](cp1x, cp1y, cp2x, cp2y, x, y) {
-    return this.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
+  [dartx.bezierCurveTo](...args) {
+    return this.bezierCurveTo.apply(this, args);
   }
-  [dartx.closePath]() {
-    return this.closePath();
+  [dartx.closePath](...args) {
+    return this.closePath.apply(this, args);
   }
-  [dartx.ellipse](x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
-    return this.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
+  [dartx.ellipse](...args) {
+    return this.ellipse.apply(this, args);
   }
-  [dartx.lineTo](x, y) {
-    return this.lineTo(x, y);
+  [dartx.lineTo](...args) {
+    return this.lineTo.apply(this, args);
   }
-  [dartx.moveTo](x, y) {
-    return this.moveTo(x, y);
+  [dartx.moveTo](...args) {
+    return this.moveTo.apply(this, args);
   }
-  [dartx.quadraticCurveTo](cpx, cpy, x, y) {
-    return this.quadraticCurveTo(cpx, cpy, x, y);
+  [dartx.quadraticCurveTo](...args) {
+    return this.quadraticCurveTo.apply(this, args);
   }
-  [dartx.rect](x, y, width, height) {
-    return this.rect(x, y, width, height);
+  [dartx.rect](...args) {
+    return this.rect.apply(this, args);
   }
 };
 html.Path2D[dart.implements] = () => [html._CanvasPathMethods];
@@ -66333,41 +67988,41 @@
   get [dartx.timing]() {
     return this.timing;
   }
-  [dartx.clearFrameTimings]() {
-    return this.clearFrameTimings();
+  [dartx.clearFrameTimings](...args) {
+    return this.clearFrameTimings.apply(this, args);
   }
-  [dartx.clearMarks](markName) {
-    return this.clearMarks(markName);
+  [dartx.clearMarks](...args) {
+    return this.clearMarks.apply(this, args);
   }
-  [dartx.clearMeasures](measureName) {
-    return this.clearMeasures(measureName);
+  [dartx.clearMeasures](...args) {
+    return this.clearMeasures.apply(this, args);
   }
-  [dartx.getEntries]() {
-    return this.getEntries();
+  [dartx.getEntries](...args) {
+    return this.getEntries.apply(this, args);
   }
-  [dartx.getEntriesByName](name, entryType) {
-    return this.getEntriesByName(name, entryType);
+  [dartx.getEntriesByName](...args) {
+    return this.getEntriesByName.apply(this, args);
   }
-  [dartx.getEntriesByType](entryType) {
-    return this.getEntriesByType(entryType);
+  [dartx.getEntriesByType](...args) {
+    return this.getEntriesByType.apply(this, args);
   }
-  [dartx.mark](markName) {
-    return this.mark(markName);
+  [dartx.mark](...args) {
+    return this.mark.apply(this, args);
   }
-  [dartx.measure](measureName, startMark, endMark) {
-    return this.measure(measureName, startMark, endMark);
+  [dartx.measure](...args) {
+    return this.measure.apply(this, args);
   }
-  [dartx.now]() {
-    return this.now();
+  [dartx.now](...args) {
+    return this.now.apply(this, args);
   }
-  [dartx.setFrameTimingBufferSize](maxSize) {
-    return this.setFrameTimingBufferSize(maxSize);
+  [dartx.setFrameTimingBufferSize](...args) {
+    return this.setFrameTimingBufferSize.apply(this, args);
   }
-  [dartx.clearResourceTimings]() {
-    return this.webkitClearResourceTimings();
+  [dartx.clearResourceTimings](...args) {
+    return this.webkitClearResourceTimings.apply(this, args);
   }
-  [dartx.setResourceTimingBufferSize](maxSize) {
-    return this.webkitSetResourceTimingBufferSize(maxSize);
+  [dartx.setResourceTimingBufferSize](...args) {
+    return this.webkitSetResourceTimingBufferSize.apply(this, args);
   }
   get [dartx.onResourceTimingBufferFull]() {
     return html.Performance.resourceTimingBufferFullEvent.forTarget(this);
@@ -66760,14 +68415,14 @@
   get [dartx.minPossiblePeriod]() {
     return this.minPossiblePeriod;
   }
-  [dartx.getRegistration](tag) {
-    return this.getRegistration(tag);
+  [dartx.getRegistration](...args) {
+    return this.getRegistration.apply(this, args);
   }
-  [dartx.getRegistrations]() {
-    return this.getRegistrations();
+  [dartx.getRegistrations](...args) {
+    return this.getRegistrations.apply(this, args);
   }
-  [dartx.permissionState]() {
-    return this.permissionState();
+  [dartx.permissionState](...args) {
+    return this.permissionState.apply(this, args);
   }
   [dartx.register](options) {
     if (options === void 0) options = null;
@@ -66777,11 +68432,11 @@
     }
     return this[_register_2]();
   }
-  [_register_1](options) {
-    return this.register(options);
+  [_register_1](...args) {
+    return this.register.apply(this, args);
   }
-  [_register_2]() {
-    return this.register();
+  [_register_2](...args) {
+    return this.register.apply(this, args);
   }
 };
 dart.setSignature(html.PeriodicSyncManager, {
@@ -66820,8 +68475,8 @@
   get [dartx.tag]() {
     return this.tag;
   }
-  [dartx.unregister]() {
-    return this.unregister();
+  [dartx.unregister](...args) {
+    return this.unregister.apply(this, args);
   }
 };
 dart.setSignature(html.PeriodicSyncRegistration, {
@@ -66876,8 +68531,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.query](permission) {
-    return this.query(permission);
+  [dartx.query](...args) {
+    return this.query.apply(this, args);
   }
 };
 dart.setSignature(html.Permissions, {
@@ -66925,11 +68580,11 @@
   get [dartx.name]() {
     return this.name;
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
-  [dartx.namedItem](name) {
-    return this.namedItem(name);
+  [dartx.namedItem](...args) {
+    return this.namedItem.apply(this, args);
   }
 };
 dart.setSignature(html.Plugin, {
@@ -66948,8 +68603,8 @@
 dart.registerExtension(dart.global.Plugin, html.Plugin);
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'length',
   'first',
   'last',
@@ -66966,11 +68621,11 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
     return this[index];
   }
-  [dartx.set](index, value) {
+  [dartx._set](index, value) {
     dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
     return value;
   }
@@ -66999,16 +68654,16 @@
     dart.throw(new core.StateError("More than one element"));
   }
   [dartx.elementAt](index) {
-    return this[dartx.get](index);
+    return this[dartx._get](index);
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
-  [dartx.namedItem](name) {
-    return this.namedItem(name);
+  [dartx.namedItem](...args) {
+    return this.namedItem.apply(this, args);
   }
-  [dartx.refresh](reload) {
-    return this.refresh(reload);
+  [dartx.refresh](...args) {
+    return this.refresh.apply(this, args);
   }
 };
 html.PluginArray[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfPlugin()];
@@ -67022,8 +68677,8 @@
   }),
   setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(html.Plugin, [core.int]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html.Plugin]),
+    [dartx._get]: dart.definiteFunctionType(html.Plugin, [core.int]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html.Plugin]),
     [dartx.elementAt]: dart.definiteFunctionType(html.Plugin, [core.int]),
     [dartx.item]: dart.definiteFunctionType(html.Plugin, [core.int]),
     [dartx.namedItem]: dart.definiteFunctionType(html.Plugin, [core.String]),
@@ -67057,8 +68712,8 @@
   set [dartx.message](value) {
     this.message = value;
   }
-  [dartx.createdCallback]() {
-    return this.createdCallback();
+  [dartx.createdCallback](...args) {
+    return this.createdCallback.apply(this, args);
   }
 };
 dart.defineNamedConstructor(html.PluginPlaceholderElement, 'created');
@@ -67233,14 +68888,14 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.getImmediateState]() {
-    return this.getImmediateState();
+  [dartx.getImmediateState](...args) {
+    return this.getImmediateState.apply(this, args);
   }
-  [dartx.getState]() {
-    return this.getState();
+  [dartx.getState](...args) {
+    return this.getState.apply(this, args);
   }
-  [dartx.resetSensor]() {
-    return this.resetSensor();
+  [dartx.resetSensor](...args) {
+    return this.resetSensor.apply(this, args);
   }
 };
 dart.setSignature(html.PositionSensorVRDevice, {
@@ -67285,14 +68940,14 @@
   get [dartx.session]() {
     return this.session;
   }
-  [dartx.getAvailability](url) {
-    return this.getAvailability(url);
+  [dartx.getAvailability](...args) {
+    return this.getAvailability.apply(this, args);
   }
-  [dartx.joinSession](url, presentationId) {
-    return this.joinSession(url, presentationId);
+  [dartx.joinSession](...args) {
+    return this.joinSession.apply(this, args);
   }
-  [dartx.startSession](url) {
-    return this.startSession(url);
+  [dartx.startSession](...args) {
+    return this.startSession.apply(this, args);
   }
 };
 dart.setSignature(html.Presentation, {
@@ -67356,11 +69011,11 @@
   get [dartx.state]() {
     return this.state;
   }
-  [dartx.close]() {
-    return this.close();
+  [dartx.close](...args) {
+    return this.close.apply(this, args);
   }
-  [dartx.send](data_OR_message) {
-    return this.send(data_OR_message);
+  [dartx.send](...args) {
+    return this.send.apply(this, args);
   }
   get [dartx.onMessage]() {
     return html.PresentationSession.messageEvent.forTarget(this);
@@ -67613,8 +69268,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.getSubscription]() {
-    return this.getSubscription();
+  [dartx.getSubscription](...args) {
+    return this.getSubscription.apply(this, args);
   }
   [dartx.permissionState](options) {
     if (options === void 0) options = null;
@@ -67624,11 +69279,11 @@
     }
     return this[_permissionState_2]();
   }
-  [_permissionState_1](options) {
-    return this.permissionState(options);
+  [_permissionState_1](...args) {
+    return this.permissionState.apply(this, args);
   }
-  [_permissionState_2]() {
-    return this.permissionState();
+  [_permissionState_2](...args) {
+    return this.permissionState.apply(this, args);
   }
   [dartx.subscribe](options) {
     if (options === void 0) options = null;
@@ -67638,11 +69293,11 @@
     }
     return this[_subscribe_2]();
   }
-  [_subscribe_1](options) {
-    return this.subscribe(options);
+  [_subscribe_1](...args) {
+    return this.subscribe.apply(this, args);
   }
-  [_subscribe_2]() {
-    return this.subscribe();
+  [_subscribe_2](...args) {
+    return this.subscribe.apply(this, args);
   }
 };
 dart.setSignature(html.PushManager, {
@@ -67674,17 +69329,17 @@
   static _create_1(message) {
     return new PushMessageData(message);
   }
-  [dartx.arrayBuffer]() {
-    return this.arrayBuffer();
+  [dartx.arrayBuffer](...args) {
+    return this.arrayBuffer.apply(this, args);
   }
-  [dartx.blob]() {
-    return this.blob();
+  [dartx.blob](...args) {
+    return this.blob.apply(this, args);
   }
-  [dartx.json]() {
-    return this.json();
+  [dartx.json](...args) {
+    return this.json.apply(this, args);
   }
-  [dartx.text]() {
-    return this.text();
+  [dartx.text](...args) {
+    return this.text.apply(this, args);
   }
 };
 dart.setSignature(html.PushMessageData, {
@@ -67713,8 +69368,8 @@
   get [dartx.endpoint]() {
     return this.endpoint;
   }
-  [dartx.unsubscribe]() {
-    return this.unsubscribe();
+  [dartx.unsubscribe](...args) {
+    return this.unsubscribe.apply(this, args);
   }
 };
 dart.setSignature(html.PushSubscription, {
@@ -67816,74 +69471,74 @@
   get [dartx.startOffset]() {
     return this.startOffset;
   }
-  [dartx.cloneContents]() {
-    return this.cloneContents();
+  [dartx.cloneContents](...args) {
+    return this.cloneContents.apply(this, args);
   }
-  [dartx.cloneRange]() {
-    return this.cloneRange();
+  [dartx.cloneRange](...args) {
+    return this.cloneRange.apply(this, args);
   }
-  [dartx.collapse](toStart) {
-    return this.collapse(toStart);
+  [dartx.collapse](...args) {
+    return this.collapse.apply(this, args);
   }
-  [dartx.compareBoundaryPoints](how, sourceRange) {
-    return this.compareBoundaryPoints(how, sourceRange);
+  [dartx.compareBoundaryPoints](...args) {
+    return this.compareBoundaryPoints.apply(this, args);
   }
-  [dartx.comparePoint](node, offset) {
-    return this.comparePoint(node, offset);
+  [dartx.comparePoint](...args) {
+    return this.comparePoint.apply(this, args);
   }
-  [dartx.createContextualFragment](fragment) {
-    return this.createContextualFragment(fragment);
+  [dartx.createContextualFragment](...args) {
+    return this.createContextualFragment.apply(this, args);
   }
-  [dartx.deleteContents]() {
-    return this.deleteContents();
+  [dartx.deleteContents](...args) {
+    return this.deleteContents.apply(this, args);
   }
-  [dartx.detach]() {
-    return this.detach();
+  [dartx.detach](...args) {
+    return this.detach.apply(this, args);
   }
-  [dartx.expand](unit) {
-    return this.expand(unit);
+  [dartx.expand](...args) {
+    return this.expand.apply(this, args);
   }
-  [dartx.extractContents]() {
-    return this.extractContents();
+  [dartx.extractContents](...args) {
+    return this.extractContents.apply(this, args);
   }
-  [dartx.getBoundingClientRect]() {
-    return this.getBoundingClientRect();
+  [dartx.getBoundingClientRect](...args) {
+    return this.getBoundingClientRect.apply(this, args);
   }
-  [dartx.getClientRects]() {
-    return this.getClientRects();
+  [dartx.getClientRects](...args) {
+    return this.getClientRects.apply(this, args);
   }
-  [dartx.insertNode](node) {
-    return this.insertNode(node);
+  [dartx.insertNode](...args) {
+    return this.insertNode.apply(this, args);
   }
-  [dartx.isPointInRange](node, offset) {
-    return this.isPointInRange(node, offset);
+  [dartx.isPointInRange](...args) {
+    return this.isPointInRange.apply(this, args);
   }
-  [dartx.selectNode](node) {
-    return this.selectNode(node);
+  [dartx.selectNode](...args) {
+    return this.selectNode.apply(this, args);
   }
-  [dartx.selectNodeContents](node) {
-    return this.selectNodeContents(node);
+  [dartx.selectNodeContents](...args) {
+    return this.selectNodeContents.apply(this, args);
   }
-  [dartx.setEnd](node, offset) {
-    return this.setEnd(node, offset);
+  [dartx.setEnd](...args) {
+    return this.setEnd.apply(this, args);
   }
-  [dartx.setEndAfter](node) {
-    return this.setEndAfter(node);
+  [dartx.setEndAfter](...args) {
+    return this.setEndAfter.apply(this, args);
   }
-  [dartx.setEndBefore](node) {
-    return this.setEndBefore(node);
+  [dartx.setEndBefore](...args) {
+    return this.setEndBefore.apply(this, args);
   }
-  [dartx.setStart](node, offset) {
-    return this.setStart(node, offset);
+  [dartx.setStart](...args) {
+    return this.setStart.apply(this, args);
   }
-  [dartx.setStartAfter](node) {
-    return this.setStartAfter(node);
+  [dartx.setStartAfter](...args) {
+    return this.setStartAfter.apply(this, args);
   }
-  [dartx.setStartBefore](node) {
-    return this.setStartBefore(node);
+  [dartx.setStartBefore](...args) {
+    return this.setStartBefore.apply(this, args);
   }
-  [dartx.surroundContents](newParent) {
-    return this.surroundContents(newParent);
+  [dartx.surroundContents](...args) {
+    return this.surroundContents.apply(this, args);
   }
   static get supportsCreateContextualFragment() {
     return "createContextualFragment" in window.Range.prototype;
@@ -67949,11 +69604,11 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.cancel](reason) {
-    return this.cancel(reason);
+  [dartx.cancel](...args) {
+    return this.cancel.apply(this, args);
   }
-  [dartx.getReader]() {
-    return this.getReader();
+  [dartx.getReader](...args) {
+    return this.getReader.apply(this, args);
   }
 };
 dart.setSignature(html.ReadableByteStream, {
@@ -67977,14 +69632,14 @@
   get [dartx.closed]() {
     return this.closed;
   }
-  [dartx.cancel](reason) {
-    return this.cancel(reason);
+  [dartx.cancel](...args) {
+    return this.cancel.apply(this, args);
   }
-  [dartx.read]() {
-    return this.read();
+  [dartx.read](...args) {
+    return this.read.apply(this, args);
   }
-  [dartx.releaseLock]() {
-    return this.releaseLock();
+  [dartx.releaseLock](...args) {
+    return this.releaseLock.apply(this, args);
   }
 };
 dart.setSignature(html.ReadableByteStreamReader, {
@@ -68005,11 +69660,11 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.cancel](reason) {
-    return this.cancel(reason);
+  [dartx.cancel](...args) {
+    return this.cancel.apply(this, args);
   }
-  [dartx.getReader]() {
-    return this.getReader();
+  [dartx.getReader](...args) {
+    return this.getReader.apply(this, args);
   }
 };
 dart.setSignature(html.ReadableStream, {
@@ -68033,14 +69688,14 @@
   get [dartx.closed]() {
     return this.closed;
   }
-  [dartx.cancel](reason) {
-    return this.cancel(reason);
+  [dartx.cancel](...args) {
+    return this.cancel.apply(this, args);
   }
-  [dartx.read]() {
-    return this.read();
+  [dartx.read](...args) {
+    return this.read.apply(this, args);
   }
-  [dartx.releaseLock]() {
-    return this.releaseLock();
+  [dartx.releaseLock](...args) {
+    return this.releaseLock.apply(this, args);
   }
 };
 dart.setSignature(html.ReadableStreamReader, {
@@ -68175,23 +69830,23 @@
   get [dartx.reliable]() {
     return this.reliable;
   }
-  [dartx.close]() {
-    return this.close();
+  [dartx.close](...args) {
+    return this.close.apply(this, args);
   }
-  [dartx.send](data) {
-    return this.send(data);
+  [dartx.send](...args) {
+    return this.send.apply(this, args);
   }
-  [dartx.sendBlob](data) {
-    return this.send(data);
+  [dartx.sendBlob](...args) {
+    return this.send.apply(this, args);
   }
-  [dartx.sendByteBuffer](data) {
-    return this.send(data);
+  [dartx.sendByteBuffer](...args) {
+    return this.send.apply(this, args);
   }
-  [dartx.sendString](data) {
-    return this.send(data);
+  [dartx.sendString](...args) {
+    return this.send.apply(this, args);
   }
-  [dartx.sendTypedData](data) {
-    return this.send(data);
+  [dartx.sendTypedData](...args) {
+    return this.send.apply(this, args);
   }
   get [dartx.onClose]() {
     return html.RtcDataChannel.closeEvent.forTarget(this);
@@ -68257,6 +69912,7 @@
   }
 });
 dart.registerExtension(dart.global.RTCDataChannel, html.RtcDataChannel);
+dart.registerExtension(dart.global.DataChannel, html.RtcDataChannel);
 dart.defineExtensionNames([
   'channel'
 ]);
@@ -68301,8 +69957,8 @@
   get [dartx.track]() {
     return this.track;
   }
-  [dartx.insertDtmf](tones, duration, interToneGap) {
-    return this.insertDTMF(tones, duration, interToneGap);
+  [dartx.insertDtmf](...args) {
+    return this.insertDTMF.apply(this, args);
   }
   get [dartx.onToneChange]() {
     return html.RtcDtmfSender.toneChangeEvent.forTarget(this);
@@ -68399,6 +70055,7 @@
   })
 });
 dart.registerExtension(dart.global.RTCIceCandidate, html.RtcIceCandidate);
+dart.registerExtension(dart.global.mozRTCIceCandidate, html.RtcIceCandidate);
 dart.defineExtensionNames([
   'candidate'
 ]);
@@ -68415,6 +70072,7 @@
   fields: () => ({[dartx.candidate]: html.RtcIceCandidate})
 });
 dart.registerExtension(dart.global.RTCIceCandidateEvent, html.RtcIceCandidateEvent);
+dart.registerExtension(dart.global.RTCPeerConnectionIceEvent, html.RtcIceCandidateEvent);
 const _createOffer = Symbol('_createOffer');
 const _createAnswer = Symbol('_createAnswer');
 const _getStats = Symbol('_getStats');
@@ -68525,8 +70183,8 @@
   get [dartx.signalingState]() {
     return this.signalingState;
   }
-  [dartx.addIceCandidate](candidate, successCallback, failureCallback) {
-    return this.addIceCandidate(candidate, successCallback, failureCallback);
+  [dartx.addIceCandidate](...args) {
+    return this.addIceCandidate.apply(this, args);
   }
   [dartx.addStream](stream, mediaConstraints) {
     if (mediaConstraints === void 0) mediaConstraints = null;
@@ -68538,14 +70196,14 @@
     this[_addStream_2](stream);
     return;
   }
-  [_addStream_1](stream, mediaConstraints) {
-    return this.addStream(stream, mediaConstraints);
+  [_addStream_1](...args) {
+    return this.addStream.apply(this, args);
   }
-  [_addStream_2](stream) {
-    return this.addStream(stream);
+  [_addStream_2](...args) {
+    return this.addStream.apply(this, args);
   }
-  [dartx.close]() {
-    return this.close();
+  [dartx.close](...args) {
+    return this.close.apply(this, args);
   }
   [_createAnswer](successCallback, failureCallback, mediaConstraints) {
     if (failureCallback === void 0) failureCallback = null;
@@ -68558,14 +70216,14 @@
     this[_createAnswer_2](successCallback, failureCallback);
     return;
   }
-  [_createAnswer_1](successCallback, failureCallback, mediaConstraints) {
-    return this.createAnswer(successCallback, failureCallback, mediaConstraints);
+  [_createAnswer_1](...args) {
+    return this.createAnswer.apply(this, args);
   }
-  [_createAnswer_2](successCallback, failureCallback) {
-    return this.createAnswer(successCallback, failureCallback);
+  [_createAnswer_2](...args) {
+    return this.createAnswer.apply(this, args);
   }
-  [dartx.createDtmfSender](track) {
-    return this.createDTMFSender(track);
+  [dartx.createDtmfSender](...args) {
+    return this.createDTMFSender.apply(this, args);
   }
   [dartx.createDataChannel](label, options) {
     if (options === void 0) options = null;
@@ -68575,11 +70233,11 @@
     }
     return this[_createDataChannel_2](label);
   }
-  [_createDataChannel_1](label, options) {
-    return this.createDataChannel(label, options);
+  [_createDataChannel_1](...args) {
+    return this.createDataChannel.apply(this, args);
   }
-  [_createDataChannel_2](label) {
-    return this.createDataChannel(label);
+  [_createDataChannel_2](...args) {
+    return this.createDataChannel.apply(this, args);
   }
   [_createOffer](successCallback, failureCallback, rtcOfferOptions) {
     if (failureCallback === void 0) failureCallback = null;
@@ -68592,29 +70250,29 @@
     this[_createOffer_2](successCallback, failureCallback);
     return;
   }
-  [_createOffer_1](successCallback, failureCallback, rtcOfferOptions) {
-    return this.createOffer(successCallback, failureCallback, rtcOfferOptions);
+  [_createOffer_1](...args) {
+    return this.createOffer.apply(this, args);
   }
-  [_createOffer_2](successCallback, failureCallback) {
-    return this.createOffer(successCallback, failureCallback);
+  [_createOffer_2](...args) {
+    return this.createOffer.apply(this, args);
   }
-  [dartx.getLocalStreams]() {
-    return this.getLocalStreams();
+  [dartx.getLocalStreams](...args) {
+    return this.getLocalStreams.apply(this, args);
   }
-  [dartx.getRemoteStreams]() {
-    return this.getRemoteStreams();
+  [dartx.getRemoteStreams](...args) {
+    return this.getRemoteStreams.apply(this, args);
   }
-  [_getStats](successCallback, selector) {
-    return this.getStats(successCallback, selector);
+  [_getStats](...args) {
+    return this.getStats.apply(this, args);
   }
-  [dartx.getStreamById](streamId) {
-    return this.getStreamById(streamId);
+  [dartx.getStreamById](...args) {
+    return this.getStreamById.apply(this, args);
   }
-  [dartx.removeStream](stream) {
-    return this.removeStream(stream);
+  [dartx.removeStream](...args) {
+    return this.removeStream.apply(this, args);
   }
-  [_setLocalDescription](description, successCallback, failureCallback) {
-    return this.setLocalDescription(description, successCallback, failureCallback);
+  [_setLocalDescription](...args) {
+    return this.setLocalDescription.apply(this, args);
   }
   [dartx.setLocalDescription](description) {
     let completer = async.Completer.new();
@@ -68625,8 +70283,8 @@
     }, StringTovoid()));
     return completer.future;
   }
-  [_setRemoteDescription](description, successCallback, failureCallback) {
-    return this.setRemoteDescription(description, successCallback, failureCallback);
+  [_setRemoteDescription](...args) {
+    return this.setRemoteDescription.apply(this, args);
   }
   [dartx.setRemoteDescription](description) {
     let completer = async.Completer.new();
@@ -68654,14 +70312,14 @@
     this[_updateIce_3]();
     return;
   }
-  [_updateIce_1](configuration, mediaConstraints) {
-    return this.updateIce(configuration, mediaConstraints);
+  [_updateIce_1](...args) {
+    return this.updateIce.apply(this, args);
   }
-  [_updateIce_2](configuration) {
-    return this.updateIce(configuration);
+  [_updateIce_2](...args) {
+    return this.updateIce.apply(this, args);
   }
-  [_updateIce_3]() {
-    return this.updateIce();
+  [_updateIce_3](...args) {
+    return this.updateIce.apply(this, args);
   }
   get [dartx.onAddStream]() {
     return html.RtcPeerConnection.addStreamEvent.forTarget(this);
@@ -68774,6 +70432,7 @@
   }
 });
 dart.registerExtension(dart.global.RTCPeerConnection, html.RtcPeerConnection);
+dart.registerExtension(dart.global.mozRTCPeerConnection, html.RtcPeerConnection);
 dart.defineExtensionNames([
   'sdp',
   'type'
@@ -68810,6 +70469,7 @@
   })
 });
 dart.registerExtension(dart.global.RTCSessionDescription, html.RtcSessionDescription);
+dart.registerExtension(dart.global.mozRTCSessionDescription, html.RtcSessionDescription);
 const _get_timestamp = Symbol('_get_timestamp');
 dart.defineExtensionNames([
   'timestamp',
@@ -68834,11 +70494,11 @@
   get [dartx.type]() {
     return this.type;
   }
-  [dartx.names]() {
-    return this.names();
+  [dartx.names](...args) {
+    return this.names.apply(this, args);
   }
-  [dartx.stat](name) {
-    return this.stat(name);
+  [dartx.stat](...args) {
+    return this.stat.apply(this, args);
   }
 };
 dart.setSignature(html.RtcStatsReport, {
@@ -68863,11 +70523,11 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.namedItem](name) {
-    return this.namedItem(name);
+  [dartx.namedItem](...args) {
+    return this.namedItem.apply(this, args);
   }
-  [dartx.result]() {
-    return this.result();
+  [dartx.result](...args) {
+    return this.result.apply(this, args);
   }
 };
 dart.setSignature(html.RtcStatsResponse, {
@@ -68958,11 +70618,11 @@
   get [dartx.type]() {
     return this.type;
   }
-  [dartx.lock](orientation) {
-    return this.lock(orientation);
+  [dartx.lock](...args) {
+    return this.lock.apply(this, args);
   }
-  [dartx.unlock]() {
-    return this.unlock();
+  [dartx.unlock](...args) {
+    return this.unlock.apply(this, args);
   }
   get [dartx.onChange]() {
     return html.ScreenOrientation.changeEvent.forTarget(this);
@@ -69192,8 +70852,8 @@
   get [dartx.velocityY]() {
     return this.velocityY;
   }
-  [dartx.consumeDelta](x, y) {
-    return this.consumeDelta(x, y);
+  [dartx.consumeDelta](...args) {
+    return this.consumeDelta.apply(this, args);
   }
 };
 dart.setSignature(html.ScrollState, {
@@ -69435,26 +71095,26 @@
   get [dartx.willValidate]() {
     return this.willValidate;
   }
-  [__setter__](index, option) {
-    return this.__setter__(index, option);
+  [__setter__](...args) {
+    return this.__setter__.apply(this, args);
   }
-  [dartx.add](element, before) {
-    return this.add(element, before);
+  [dartx.add](...args) {
+    return this.add.apply(this, args);
   }
-  [dartx.checkValidity]() {
-    return this.checkValidity();
+  [dartx.checkValidity](...args) {
+    return this.checkValidity.apply(this, args);
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
-  [dartx.namedItem](name) {
-    return this.namedItem(name);
+  [dartx.namedItem](...args) {
+    return this.namedItem.apply(this, args);
   }
-  [dartx.reportValidity]() {
-    return this.reportValidity();
+  [dartx.reportValidity](...args) {
+    return this.reportValidity.apply(this, args);
   }
-  [dartx.setCustomValidity](error) {
-    return this.setCustomValidity(error);
+  [dartx.setCustomValidity](...args) {
+    return this.setCustomValidity.apply(this, args);
   }
   get [dartx.options]() {
     let options = ListOfOptionElement().from(this[dartx.querySelectorAll](html.Element)('option'));
@@ -69465,7 +71125,7 @@
       let options = this[dartx.options][dartx.where](dart.fn(o => o[dartx.selected], OptionElementTobool()))[dartx.toList]();
       return new (UnmodifiableListViewOfOptionElement())(options);
     } else {
-      return JSArrayOfOptionElement().of([this[dartx.options][dartx.get](this[dartx.selectedIndex])]);
+      return JSArrayOfOptionElement().of([this[dartx.options][dartx._get](this[dartx.selectedIndex])]);
     }
   }
 };
@@ -69572,47 +71232,47 @@
   get [dartx.type]() {
     return this.type;
   }
-  [dartx.addRange](range) {
-    return this.addRange(range);
+  [dartx.addRange](...args) {
+    return this.addRange.apply(this, args);
   }
-  [dartx.collapse](node, offset) {
-    return this.collapse(node, offset);
+  [dartx.collapse](...args) {
+    return this.collapse.apply(this, args);
   }
-  [dartx.collapseToEnd]() {
-    return this.collapseToEnd();
+  [dartx.collapseToEnd](...args) {
+    return this.collapseToEnd.apply(this, args);
   }
-  [dartx.collapseToStart]() {
-    return this.collapseToStart();
+  [dartx.collapseToStart](...args) {
+    return this.collapseToStart.apply(this, args);
   }
-  [dartx.containsNode](node, allowPartialContainment) {
-    return this.containsNode(node, allowPartialContainment);
+  [dartx.containsNode](...args) {
+    return this.containsNode.apply(this, args);
   }
-  [dartx.deleteFromDocument]() {
-    return this.deleteFromDocument();
+  [dartx.deleteFromDocument](...args) {
+    return this.deleteFromDocument.apply(this, args);
   }
-  [dartx.empty]() {
-    return this.empty();
+  [dartx.empty](...args) {
+    return this.empty.apply(this, args);
   }
-  [dartx.extend](node, offset) {
-    return this.extend(node, offset);
+  [dartx.extend](...args) {
+    return this.extend.apply(this, args);
   }
-  [dartx.getRangeAt](index) {
-    return this.getRangeAt(index);
+  [dartx.getRangeAt](...args) {
+    return this.getRangeAt.apply(this, args);
   }
-  [dartx.modify](alter, direction, granularity) {
-    return this.modify(alter, direction, granularity);
+  [dartx.modify](...args) {
+    return this.modify.apply(this, args);
   }
-  [dartx.removeAllRanges]() {
-    return this.removeAllRanges();
+  [dartx.removeAllRanges](...args) {
+    return this.removeAllRanges.apply(this, args);
   }
-  [dartx.selectAllChildren](node) {
-    return this.selectAllChildren(node);
+  [dartx.selectAllChildren](...args) {
+    return this.selectAllChildren.apply(this, args);
   }
-  [dartx.setBaseAndExtent](baseNode, baseOffset, extentNode, extentOffset) {
-    return this.setBaseAndExtent(baseNode, baseOffset, extentNode, extentOffset);
+  [dartx.setBaseAndExtent](...args) {
+    return this.setBaseAndExtent.apply(this, args);
   }
-  [dartx.setPosition](node, offset) {
-    return this.setPosition(node, offset);
+  [dartx.setPosition](...args) {
+    return this.setPosition.apply(this, args);
   }
 };
 dart.setSignature(html.Selection, {
@@ -69668,8 +71328,8 @@
   get [dartx.targetUrl]() {
     return this.targetURL;
   }
-  [dartx.close]() {
-    return this.close();
+  [dartx.close](...args) {
+    return this.close.apply(this, args);
   }
   [dartx.postMessage](message, transfer) {
     if (transfer === void 0) transfer = null;
@@ -69682,11 +71342,11 @@
     this[_postMessage_2](message_1);
     return;
   }
-  [_postMessage_1](message, transfer) {
-    return this.postMessage(message, transfer);
+  [_postMessage_1](...args) {
+    return this.postMessage.apply(this, args);
   }
-  [_postMessage_2](message) {
-    return this.postMessage(message);
+  [_postMessage_2](...args) {
+    return this.postMessage.apply(this, args);
   }
 };
 dart.setSignature(html.ServicePort, {
@@ -69724,18 +71384,18 @@
     }
     return this[_connect_2](url);
   }
-  [_connect_1](url, options) {
-    return this.connect(url, options);
+  [_connect_1](...args) {
+    return this.connect.apply(this, args);
   }
-  [_connect_2](url) {
-    return this.connect(url);
+  [_connect_2](...args) {
+    return this.connect.apply(this, args);
   }
   [dartx.match](options) {
     let options_1 = html_common.convertDartToNative_Dictionary(options);
     return this[_match_1](options_1);
   }
-  [_match_1](options) {
-    return this.match(options);
+  [_match_1](...args) {
+    return this.match.apply(this, args);
   }
   [dartx.matchAll](options) {
     if (options === void 0) options = null;
@@ -69745,11 +71405,11 @@
     }
     return this[_matchAll_2]();
   }
-  [_matchAll_1](options) {
-    return this.matchAll(options);
+  [_matchAll_1](...args) {
+    return this.matchAll.apply(this, args);
   }
-  [_matchAll_2]() {
-    return this.matchAll();
+  [_matchAll_2](...args) {
+    return this.matchAll.apply(this, args);
   }
   get [dartx.onMessage]() {
     return html.ServicePortCollection.messageEvent.forTarget(this);
@@ -69805,8 +71465,8 @@
   get [dartx.targetUrl]() {
     return this.targetURL;
   }
-  [dartx.respondWith](response) {
-    return this.respondWith(response);
+  [dartx.respondWith](...args) {
+    return this.respondWith.apply(this, args);
   }
 };
 dart.setSignature(html.ServicePortConnectEvent, {
@@ -69844,11 +71504,11 @@
   get [dartx.ready]() {
     return this.ready;
   }
-  [dartx.getRegistration](documentURL) {
-    return this.getRegistration(documentURL);
+  [dartx.getRegistration](...args) {
+    return this.getRegistration.apply(this, args);
   }
-  [dartx.getRegistrations]() {
-    return this.getRegistrations();
+  [dartx.getRegistrations](...args) {
+    return this.getRegistrations.apply(this, args);
   }
   [dartx.register](url, options) {
     if (options === void 0) options = null;
@@ -69858,11 +71518,11 @@
     }
     return this[_register_2](url);
   }
-  [_register_1](url, options) {
-    return this.register(url, options);
+  [_register_1](...args) {
+    return this.register.apply(this, args);
   }
-  [_register_2](url) {
-    return this.register(url);
+  [_register_2](...args) {
+    return this.register.apply(this, args);
   }
   get [dartx.onMessage]() {
     return html.ServiceWorkerContainer.messageEvent.forTarget(this);
@@ -69910,8 +71570,8 @@
   get [dartx.registration]() {
     return this.registration;
   }
-  [dartx.skipWaiting]() {
-    return this.skipWaiting();
+  [dartx.skipWaiting](...args) {
+    return this.skipWaiting.apply(this, args);
   }
   get [dartx.onMessage]() {
     return html.ServiceWorkerGlobalScope.messageEvent.forTarget(this);
@@ -70052,11 +71712,11 @@
     }
     return this[_getNotifications_2]();
   }
-  [_getNotifications_1](filter) {
-    return this.getNotifications(filter);
+  [_getNotifications_1](...args) {
+    return this.getNotifications.apply(this, args);
   }
-  [_getNotifications_2]() {
-    return this.getNotifications();
+  [_getNotifications_2](...args) {
+    return this.getNotifications.apply(this, args);
   }
   [dartx.showNotification](title, options) {
     if (options === void 0) options = null;
@@ -70066,17 +71726,17 @@
     }
     return this[_showNotification_2](title);
   }
-  [_showNotification_1](title, options) {
-    return this.showNotification(title, options);
+  [_showNotification_1](...args) {
+    return this.showNotification.apply(this, args);
   }
-  [_showNotification_2](title) {
-    return this.showNotification(title);
+  [_showNotification_2](...args) {
+    return this.showNotification.apply(this, args);
   }
-  [dartx.unregister]() {
-    return this.unregister();
+  [dartx.unregister](...args) {
+    return this.unregister.apply(this, args);
   }
-  [dartx.update]() {
-    return this.update();
+  [dartx.update](...args) {
+    return this.update.apply(this, args);
   }
 };
 dart.setSignature(html.ServiceWorkerRegistration, {
@@ -70119,8 +71779,8 @@
   static get supported() {
     return html.Element.isTagSupported('shadow');
   }
-  [dartx.getDistributedNodes]() {
-    return this.getDistributedNodes();
+  [dartx.getDistributedNodes](...args) {
+    return this.getDistributedNodes.apply(this, args);
   }
 };
 dart.defineNamedConstructor(html.ShadowElement, 'created');
@@ -70175,17 +71835,17 @@
   get [dartx.styleSheets]() {
     return this.styleSheets;
   }
-  [dartx.clone](deep) {
-    return this.cloneNode(deep);
+  [dartx.clone](...args) {
+    return this.cloneNode.apply(this, args);
   }
-  [dartx.elementFromPoint](x, y) {
-    return this.elementFromPoint(x, y);
+  [dartx.elementFromPoint](...args) {
+    return this.elementFromPoint.apply(this, args);
   }
-  [dartx.elementsFromPoint](x, y) {
-    return this.elementsFromPoint(x, y);
+  [dartx.elementsFromPoint](...args) {
+    return this.elementsFromPoint.apply(this, args);
   }
-  [dartx.getSelection]() {
-    return this.getSelection();
+  [dartx.getSelection](...args) {
+    return this.getSelection.apply(this, args);
   }
   static get supported() {
     return !!(Element.prototype.createShadowRoot || Element.prototype.webkitCreateShadowRoot);
@@ -70395,20 +72055,20 @@
   get [dartx.updating]() {
     return this.updating;
   }
-  [dartx.abort]() {
-    return this.abort();
+  [dartx.abort](...args) {
+    return this.abort.apply(this, args);
   }
-  [dartx.appendBuffer](data) {
-    return this.appendBuffer(data);
+  [dartx.appendBuffer](...args) {
+    return this.appendBuffer.apply(this, args);
   }
-  [dartx.appendStream](stream, maxSize) {
-    return this.appendStream(stream, maxSize);
+  [dartx.appendStream](...args) {
+    return this.appendStream.apply(this, args);
   }
-  [dartx.appendTypedData](data) {
-    return this.appendBuffer(data);
+  [dartx.appendTypedData](...args) {
+    return this.appendBuffer.apply(this, args);
   }
-  [dartx.remove](start, end) {
-    return this.remove(start, end);
+  [dartx.remove](...args) {
+    return this.remove.apply(this, args);
   }
 };
 dart.setSignature(html.SourceBuffer, {
@@ -70433,8 +72093,8 @@
 dart.registerExtension(dart.global.SourceBuffer, html.SourceBuffer);
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'length',
   'first',
   'last',
@@ -70449,11 +72109,11 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
     return this[index];
   }
-  [dartx.set](index, value) {
+  [dartx._set](index, value) {
     dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
     return value;
   }
@@ -70482,10 +72142,10 @@
     dart.throw(new core.StateError("More than one element"));
   }
   [dartx.elementAt](index) {
-    return this[dartx.get](index);
+    return this[dartx._get](index);
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
 };
 html.SourceBufferList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfSourceBuffer()];
@@ -70499,8 +72159,8 @@
   }),
   setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(html.SourceBuffer, [core.int]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html.SourceBuffer]),
+    [dartx._get]: dart.definiteFunctionType(html.SourceBuffer, [core.int]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html.SourceBuffer]),
     [dartx.elementAt]: dart.definiteFunctionType(html.SourceBuffer, [core.int]),
     [dartx.item]: dart.definiteFunctionType(html.SourceBuffer, [core.int])
   })
@@ -70670,8 +72330,8 @@
 dart.registerExtension(dart.global.SpeechGrammar, html.SpeechGrammar);
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'length',
   'first',
   'last',
@@ -70694,11 +72354,11 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
     return this[index];
   }
-  [dartx.set](index, value) {
+  [dartx._set](index, value) {
     dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
     return value;
   }
@@ -70727,16 +72387,16 @@
     dart.throw(new core.StateError("More than one element"));
   }
   [dartx.elementAt](index) {
-    return this[dartx.get](index);
+    return this[dartx._get](index);
   }
-  [dartx.addFromString](string, weight) {
-    return this.addFromString(string, weight);
+  [dartx.addFromString](...args) {
+    return this.addFromString.apply(this, args);
   }
-  [dartx.addFromUri](src, weight) {
-    return this.addFromUri(src, weight);
+  [dartx.addFromUri](...args) {
+    return this.addFromUri.apply(this, args);
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
 };
 html.SpeechGrammarList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfSpeechGrammar()];
@@ -70753,8 +72413,8 @@
   }),
   setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(html.SpeechGrammar, [core.int]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html.SpeechGrammar]),
+    [dartx._get]: dart.definiteFunctionType(html.SpeechGrammar, [core.int]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html.SpeechGrammar]),
     [dartx.elementAt]: dart.definiteFunctionType(html.SpeechGrammar, [core.int]),
     [dartx.addFromString]: dart.definiteFunctionType(dart.void, [core.String], [core.num]),
     [dartx.addFromUri]: dart.definiteFunctionType(dart.void, [core.String], [core.num]),
@@ -70836,14 +72496,14 @@
   set [dartx.serviceUri](value) {
     this.serviceURI = value;
   }
-  [dartx.abort]() {
-    return this.abort();
+  [dartx.abort](...args) {
+    return this.abort.apply(this, args);
   }
-  [dartx.start]() {
-    return this.start();
+  [dartx.start](...args) {
+    return this.start.apply(this, args);
   }
-  [dartx.stop]() {
-    return this.stop();
+  [dartx.stop](...args) {
+    return this.stop.apply(this, args);
   }
   get [dartx.onAudioEnd]() {
     return html.SpeechRecognition.audioEndEvent.forTarget(this);
@@ -71103,8 +72763,8 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
 };
 dart.setSignature(html.SpeechRecognitionResult, {
@@ -71139,20 +72799,20 @@
   get [dartx.speaking]() {
     return this.speaking;
   }
-  [dartx.cancel]() {
-    return this.cancel();
+  [dartx.cancel](...args) {
+    return this.cancel.apply(this, args);
   }
-  [dartx.getVoices]() {
-    return this.getVoices();
+  [dartx.getVoices](...args) {
+    return this.getVoices.apply(this, args);
   }
-  [dartx.pause]() {
-    return this.pause();
+  [dartx.pause](...args) {
+    return this.pause.apply(this, args);
   }
-  [dartx.resume]() {
-    return this.resume();
+  [dartx.resume](...args) {
+    return this.resume.apply(this, args);
   }
-  [dartx.speak](utterance) {
-    return this.speak(utterance);
+  [dartx.speak](...args) {
+    return this.speak.apply(this, args);
   }
 };
 dart.setSignature(html.SpeechSynthesis, {
@@ -71417,8 +73077,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.add](name, port) {
-    return this.add(name, port);
+  [dartx.add](...args) {
+    return this.add.apply(this, args);
   }
   get [dartx.onMessage]() {
     return html.StashedPortCollection.messageEvent.forTarget(this);
@@ -71446,8 +73106,8 @@
   'addAll',
   'containsValue',
   'containsKey',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'putIfAbsent',
   'remove',
   'clear',
@@ -71461,7 +73121,7 @@
 html.Storage = class Storage extends _interceptors.Interceptor {
   [dartx.addAll](other) {
     other[dartx.forEach](dart.fn((k, v) => {
-      this[dartx.set](k, v);
+      this[dartx._set](k, v);
     }, StringAndStringTovoid()));
   }
   [dartx.containsValue](value) {
@@ -71470,19 +73130,19 @@
   [dartx.containsKey](key) {
     return this[_getItem](core.String._check(key)) != null;
   }
-  [dartx.get](key) {
+  [dartx._get](key) {
     return this[_getItem](core.String._check(key));
   }
-  [dartx.set](key, value) {
+  [dartx._set](key, value) {
     this[_setItem](key, value);
     return value;
   }
   [dartx.putIfAbsent](key, ifAbsent) {
-    if (!dart.test(this[dartx.containsKey](key))) this[dartx.set](key, ifAbsent());
-    return this[dartx.get](key);
+    if (!dart.test(this[dartx.containsKey](key))) this[dartx._set](key, ifAbsent());
+    return this[dartx._get](key);
   }
   [dartx.remove](key) {
-    let value = this[dartx.get](key);
+    let value = this[dartx._get](key);
     this[_removeItem](core.String._check(key));
     return value;
   }
@@ -71493,7 +73153,7 @@
     for (let i = 0; true; i++) {
       let key = this[_key](i);
       if (key == null) return;
-      f(key, this[dartx.get](key));
+      f(key, this[dartx._get](key));
     }
   }
   get [dartx.keys]() {
@@ -71521,29 +73181,29 @@
   get [_length]() {
     return this.length;
   }
-  [__delete__](index_OR_name) {
-    return this.__delete__(index_OR_name);
+  [__delete__](...args) {
+    return this.__delete__.apply(this, args);
   }
-  [__getter__](index_OR_name) {
-    return this.__getter__(index_OR_name);
+  [__getter__](...args) {
+    return this.__getter__.apply(this, args);
   }
-  [__setter__](index_OR_name, value) {
-    return this.__setter__(index_OR_name, value);
+  [__setter__](...args) {
+    return this.__setter__.apply(this, args);
   }
-  [_clear]() {
-    return this.clear();
+  [_clear](...args) {
+    return this.clear.apply(this, args);
   }
-  [_getItem](key) {
-    return this.getItem(key);
+  [_getItem](...args) {
+    return this.getItem.apply(this, args);
   }
-  [_key](index) {
-    return this.key(index);
+  [_key](...args) {
+    return this.key.apply(this, args);
   }
-  [_removeItem](key) {
-    return this.removeItem(key);
+  [_removeItem](...args) {
+    return this.removeItem.apply(this, args);
   }
-  [_setItem](key, data) {
-    return this.setItem(key, data);
+  [_setItem](...args) {
+    return this.setItem.apply(this, args);
   }
 };
 html.Storage[dart.implements] = () => [MapOfString$String()];
@@ -71561,8 +73221,8 @@
     [dartx.addAll]: dart.definiteFunctionType(dart.void, [MapOfString$String()]),
     [dartx.containsValue]: dart.definiteFunctionType(core.bool, [core.Object]),
     [dartx.containsKey]: dart.definiteFunctionType(core.bool, [core.Object]),
-    [dartx.get]: dart.definiteFunctionType(core.String, [core.Object]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.String, core.String]),
+    [dartx._get]: dart.definiteFunctionType(core.String, [core.Object]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.String, core.String]),
     [dartx.putIfAbsent]: dart.definiteFunctionType(core.String, [core.String, VoidToString()]),
     [dartx.remove]: dart.definiteFunctionType(core.String, [core.Object]),
     [dartx.clear]: dart.definiteFunctionType(dart.void, []),
@@ -71629,8 +73289,8 @@
   get [dartx.url]() {
     return this.url;
   }
-  [_initStorageEvent](typeArg, canBubbleArg, cancelableArg, keyArg, oldValueArg, newValueArg, urlArg, storageAreaArg) {
-    return this.initStorageEvent(typeArg, canBubbleArg, cancelableArg, keyArg, oldValueArg, newValueArg, urlArg, storageAreaArg);
+  [_initStorageEvent](...args) {
+    return this.initStorageEvent.apply(this, args);
   }
 };
 dart.setSignature(html.StorageEvent, {
@@ -71688,11 +73348,11 @@
   get [dartx.supportedTypes]() {
     return this.supportedTypes;
   }
-  [dartx.queryInfo](type) {
-    return this.queryInfo(type);
+  [dartx.queryInfo](...args) {
+    return this.queryInfo.apply(this, args);
   }
-  [dartx.requestPersistentQuota](newQuota) {
-    return this.requestPersistentQuota(newQuota);
+  [dartx.requestPersistentQuota](...args) {
+    return this.requestPersistentQuota.apply(this, args);
   }
 };
 dart.setSignature(html.StorageQuota, {
@@ -71775,8 +73435,8 @@
   get [dartx.type]() {
     return this.type;
   }
-  [dartx.matchMedium](mediaquery) {
-    return this.matchMedium(mediaquery);
+  [dartx.matchMedium](...args) {
+    return this.matchMedium.apply(this, args);
   }
 };
 dart.setSignature(html.StyleMedia, {
@@ -71823,14 +73483,14 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.getRegistration](tag) {
-    return this.getRegistration(tag);
+  [dartx.getRegistration](...args) {
+    return this.getRegistration.apply(this, args);
   }
-  [dartx.getRegistrations]() {
-    return this.getRegistrations();
+  [dartx.getRegistrations](...args) {
+    return this.getRegistrations.apply(this, args);
   }
-  [dartx.permissionState]() {
-    return this.permissionState();
+  [dartx.permissionState](...args) {
+    return this.permissionState.apply(this, args);
   }
   [dartx.register](options) {
     if (options === void 0) options = null;
@@ -71840,11 +73500,11 @@
     }
     return this[_register_2]();
   }
-  [_register_1](options) {
-    return this.register(options);
+  [_register_1](...args) {
+    return this.register.apply(this, args);
   }
-  [_register_2]() {
-    return this.register();
+  [_register_2](...args) {
+    return this.register.apply(this, args);
   }
 };
 dart.setSignature(html.SyncManager, {
@@ -71870,8 +73530,8 @@
   get [dartx.tag]() {
     return this.tag;
   }
-  [dartx.unregister]() {
-    return this.unregister();
+  [dartx.unregister](...args) {
+    return this.unregister.apply(this, args);
   }
 };
 dart.setSignature(html.SyncRegistration, {
@@ -71957,6 +73617,8 @@
   })
 });
 dart.registerExtension(dart.global.HTMLTableCellElement, html.TableCellElement);
+dart.registerExtension(dart.global.HTMLTableDataCellElement, html.TableCellElement);
+dart.registerExtension(dart.global.HTMLTableHeaderCellElement, html.TableCellElement);
 dart.defineExtensionNames([
   'span'
 ]);
@@ -72047,8 +73709,8 @@
     this[dartx.children][dartx.add](tbody);
     return html.TableSectionElement._check(tbody);
   }
-  [_nativeCreateTBody]() {
-    return this.createTBody();
+  [_nativeCreateTBody](...args) {
+    return this.createTBody.apply(this, args);
   }
   [dartx.createFragment](html, opts) {
     let validator = opts && 'validator' in opts ? opts.validator : null;
@@ -72100,29 +73762,29 @@
   set [dartx.tHead](value) {
     this.tHead = value;
   }
-  [_createCaption]() {
-    return this.createCaption();
+  [_createCaption](...args) {
+    return this.createCaption.apply(this, args);
   }
-  [_createTFoot]() {
-    return this.createTFoot();
+  [_createTFoot](...args) {
+    return this.createTFoot.apply(this, args);
   }
-  [_createTHead]() {
-    return this.createTHead();
+  [_createTHead](...args) {
+    return this.createTHead.apply(this, args);
   }
-  [dartx.deleteCaption]() {
-    return this.deleteCaption();
+  [dartx.deleteCaption](...args) {
+    return this.deleteCaption.apply(this, args);
   }
-  [dartx.deleteRow](index) {
-    return this.deleteRow(index);
+  [dartx.deleteRow](...args) {
+    return this.deleteRow.apply(this, args);
   }
-  [dartx.deleteTFoot]() {
-    return this.deleteTFoot();
+  [dartx.deleteTFoot](...args) {
+    return this.deleteTFoot.apply(this, args);
   }
-  [dartx.deleteTHead]() {
-    return this.deleteTHead();
+  [dartx.deleteTHead](...args) {
+    return this.deleteTHead.apply(this, args);
   }
-  [_insertRow](index) {
-    return this.insertRow(index);
+  [_insertRow](...args) {
+    return this.insertRow.apply(this, args);
   }
 };
 dart.defineNamedConstructor(html.TableElement, 'created');
@@ -72217,11 +73879,11 @@
   get [dartx.sectionRowIndex]() {
     return this.sectionRowIndex;
   }
-  [dartx.deleteCell](index) {
-    return this.deleteCell(index);
+  [dartx.deleteCell](...args) {
+    return this.deleteCell.apply(this, args);
   }
-  [_insertCell](index) {
-    return this.insertCell(index);
+  [_insertCell](...args) {
+    return this.insertCell.apply(this, args);
   }
 };
 dart.defineNamedConstructor(html.TableRowElement, 'created');
@@ -72283,11 +73945,11 @@
   get [_rows]() {
     return this.rows;
   }
-  [dartx.deleteRow](index) {
-    return this.deleteRow(index);
+  [dartx.deleteRow](...args) {
+    return this.deleteRow.apply(this, args);
   }
-  [_insertRow](index) {
-    return this.insertRow(index);
+  [_insertRow](...args) {
+    return this.insertRow.apply(this, args);
   }
 };
 dart.defineNamedConstructor(html.TableSectionElement, 'created');
@@ -72551,23 +74213,23 @@
   set [dartx.wrap](value) {
     this.wrap = value;
   }
-  [dartx.checkValidity]() {
-    return this.checkValidity();
+  [dartx.checkValidity](...args) {
+    return this.checkValidity.apply(this, args);
   }
-  [dartx.reportValidity]() {
-    return this.reportValidity();
+  [dartx.reportValidity](...args) {
+    return this.reportValidity.apply(this, args);
   }
-  [dartx.select]() {
-    return this.select();
+  [dartx.select](...args) {
+    return this.select.apply(this, args);
   }
-  [dartx.setCustomValidity](error) {
-    return this.setCustomValidity(error);
+  [dartx.setCustomValidity](...args) {
+    return this.setCustomValidity.apply(this, args);
   }
-  [dartx.setRangeText](replacement, opts) {
-    return this.setRangeText(replacement, opts);
+  [dartx.setRangeText](...args) {
+    return this.setRangeText.apply(this, args);
   }
-  [dartx.setSelectionRange](start, end, direction) {
-    return this.setSelectionRange(start, end, direction);
+  [dartx.setSelectionRange](...args) {
+    return this.setSelectionRange.apply(this, args);
   }
 };
 dart.defineNamedConstructor(html.TextAreaElement, 'created');
@@ -72638,8 +74300,8 @@
   get [dartx.data]() {
     return this.data;
   }
-  [_initTextEvent](typeArg, canBubbleArg, cancelableArg, viewArg, dataArg) {
-    return this.initTextEvent(typeArg, canBubbleArg, cancelableArg, viewArg, dataArg);
+  [_initTextEvent](...args) {
+    return this.initTextEvent.apply(this, args);
   }
 };
 dart.setSignature(html.TextEvent, {
@@ -72770,17 +74432,17 @@
   get [dartx.regions]() {
     return this.regions;
   }
-  [dartx.addCue](cue) {
-    return this.addCue(cue);
+  [dartx.addCue](...args) {
+    return this.addCue.apply(this, args);
   }
-  [dartx.addRegion](region) {
-    return this.addRegion(region);
+  [dartx.addRegion](...args) {
+    return this.addRegion.apply(this, args);
   }
-  [dartx.removeCue](cue) {
-    return this.removeCue(cue);
+  [dartx.removeCue](...args) {
+    return this.removeCue.apply(this, args);
   }
-  [dartx.removeRegion](region) {
-    return this.removeRegion(region);
+  [dartx.removeRegion](...args) {
+    return this.removeRegion.apply(this, args);
   }
   get [dartx.onCueChange]() {
     return html.TextTrack.cueChangeEvent.forTarget(this);
@@ -72889,8 +74551,8 @@
 dart.registerExtension(dart.global.TextTrackCue, html.TextTrackCue);
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'length',
   'first',
   'last',
@@ -72906,11 +74568,11 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
     return this[index];
   }
-  [dartx.set](index, value) {
+  [dartx._set](index, value) {
     dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
     return value;
   }
@@ -72939,13 +74601,13 @@
     dart.throw(new core.StateError("More than one element"));
   }
   [dartx.elementAt](index) {
-    return this[dartx.get](index);
+    return this[dartx._get](index);
   }
-  [dartx.getCueById](id) {
-    return this.getCueById(id);
+  [dartx.getCueById](...args) {
+    return this.getCueById.apply(this, args);
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
 };
 html.TextTrackCueList[dart.implements] = () => [ListOfTextTrackCue(), _js_helper.JavaScriptIndexingBehavior];
@@ -72959,8 +74621,8 @@
   }),
   setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(html.TextTrackCue, [core.int]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html.TextTrackCue]),
+    [dartx._get]: dart.definiteFunctionType(html.TextTrackCue, [core.int]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html.TextTrackCue]),
     [dartx.elementAt]: dart.definiteFunctionType(html.TextTrackCue, [core.int]),
     [dartx.getCueById]: dart.definiteFunctionType(html.TextTrackCue, [core.String]),
     [dartx.item]: dart.definiteFunctionType(html.TextTrackCue, [core.int])
@@ -72969,8 +74631,8 @@
 dart.registerExtension(dart.global.TextTrackCueList, html.TextTrackCueList);
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'length',
   'first',
   'last',
@@ -72988,11 +74650,11 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
     return this[index];
   }
-  [dartx.set](index, value) {
+  [dartx._set](index, value) {
     dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
     return value;
   }
@@ -73021,13 +74683,13 @@
     dart.throw(new core.StateError("More than one element"));
   }
   [dartx.elementAt](index) {
-    return this[dartx.get](index);
+    return this[dartx._get](index);
   }
-  [dartx.getTrackById](id) {
-    return this.getTrackById(id);
+  [dartx.getTrackById](...args) {
+    return this.getTrackById.apply(this, args);
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
   get [dartx.onAddTrack]() {
     return html.TextTrackList.addTrackEvent.forTarget(this);
@@ -73049,8 +74711,8 @@
   }),
   setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(html.TextTrack, [core.int]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html.TextTrack]),
+    [dartx._get]: dart.definiteFunctionType(html.TextTrack, [core.int]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html.TextTrack]),
     [dartx.elementAt]: dart.definiteFunctionType(html.TextTrack, [core.int]),
     [dartx.getTrackById]: dart.definiteFunctionType(html.TextTrack, [core.String]),
     [dartx.item]: dart.definiteFunctionType(html.TextTrack, [core.int])
@@ -73081,11 +74743,11 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.end](index) {
-    return this.end(index);
+  [dartx.end](...args) {
+    return this.end.apply(this, args);
   }
-  [dartx.start](index) {
-    return this.start(index);
+  [dartx.start](...args) {
+    return this.start.apply(this, args);
   }
 };
 dart.setSignature(html.TimeRanges, {
@@ -73308,8 +74970,8 @@
   get [dartx.touches]() {
     return this.touches;
   }
-  [_initTouchEvent](touches, targetTouches, changedTouches, type, view, unused1, unused2, unused3, unused4, ctrlKey, altKey, shiftKey, metaKey) {
-    return this.initTouchEvent(touches, targetTouches, changedTouches, type, view, unused1, unused2, unused3, unused4, ctrlKey, altKey, shiftKey, metaKey);
+  [_initTouchEvent](...args) {
+    return this.initTouchEvent.apply(this, args);
   }
   static get supported() {
     return html_common.Device.isEventTypeSupported('TouchEvent');
@@ -73335,8 +74997,8 @@
 dart.registerExtension(dart.global.TouchEvent, html.TouchEvent);
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'length',
   'first',
   'last',
@@ -73357,11 +75019,11 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
     return this[index];
   }
-  [dartx.set](index, value) {
+  [dartx._set](index, value) {
     dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
     return value;
   }
@@ -73390,10 +75052,10 @@
     dart.throw(new core.StateError("More than one element"));
   }
   [dartx.elementAt](index) {
-    return this[dartx.get](index);
+    return this[dartx._get](index);
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
 };
 html.TouchList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfTouch()];
@@ -73410,8 +75072,8 @@
   }),
   setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(html.Touch, [core.int]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html.Touch]),
+    [dartx._get]: dart.definiteFunctionType(html.Touch, [core.int]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html.Touch]),
     [dartx.elementAt]: dart.definiteFunctionType(html.Touch, [core.int]),
     [dartx.item]: dart.definiteFunctionType(html.Touch, [core.int])
   }),
@@ -73503,8 +75165,8 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
 };
 dart.setSignature(html.TrackDefaultList, {
@@ -73704,6 +75366,7 @@
   names: ['_create_1', '_create_2']
 });
 dart.registerExtension(dart.global.TransitionEvent, html.TransitionEvent);
+dart.registerExtension(dart.global.WebKitTransitionEvent, html.TransitionEvent);
 dart.defineExtensionNames([
   'firstChild',
   'lastChild',
@@ -73739,26 +75402,26 @@
   get [dartx.whatToShow]() {
     return this.whatToShow;
   }
-  [dartx.firstChild]() {
-    return this.firstChild();
+  [dartx.firstChild](...args) {
+    return this.firstChild.apply(this, args);
   }
-  [dartx.lastChild]() {
-    return this.lastChild();
+  [dartx.lastChild](...args) {
+    return this.lastChild.apply(this, args);
   }
-  [dartx.nextNode]() {
-    return this.nextNode();
+  [dartx.nextNode](...args) {
+    return this.nextNode.apply(this, args);
   }
-  [dartx.nextSibling]() {
-    return this.nextSibling();
+  [dartx.nextSibling](...args) {
+    return this.nextSibling.apply(this, args);
   }
-  [dartx.parentNode]() {
-    return this.parentNode();
+  [dartx.parentNode](...args) {
+    return this.parentNode.apply(this, args);
   }
-  [dartx.previousNode]() {
-    return this.previousNode();
+  [dartx.previousNode](...args) {
+    return this.previousNode.apply(this, args);
   }
-  [dartx.previousSibling]() {
-    return this.previousSibling();
+  [dartx.previousSibling](...args) {
+    return this.previousSibling.apply(this, args);
   }
 };
 dart.setSignature(html.TreeWalker, {
@@ -73962,7 +75625,84 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
+  get hash() {
+    return this[hash];
+  }
+  set hash(value) {
+    this[hash] = value;
+  }
+  get host() {
+    return this[host];
+  }
+  set host(value) {
+    this[host] = value;
+  }
+  get hostname() {
+    return this[hostname];
+  }
+  set hostname(value) {
+    this[hostname] = value;
+  }
+  get href() {
+    return this[href];
+  }
+  set href(value) {
+    this[href] = value;
+  }
+  get origin() {
+    return this[origin];
+  }
+  set origin(value) {
+    super.origin = value;
+  }
+  get password() {
+    return this[password];
+  }
+  set password(value) {
+    this[password] = value;
+  }
+  get pathname() {
+    return this[pathname];
+  }
+  set pathname(value) {
+    this[pathname] = value;
+  }
+  get port() {
+    return this[port];
+  }
+  set port(value) {
+    this[port] = value;
+  }
+  get protocol() {
+    return this[protocol];
+  }
+  set protocol(value) {
+    this[protocol] = value;
+  }
+  get search() {
+    return this[search];
+  }
+  set search(value) {
+    this[search] = value;
+  }
+  get username() {
+    return this[username];
+  }
+  set username(value) {
+    this[username] = value;
+  }
 };
+const hash = Symbol(html.UrlUtils.name + "." + 'hash'.toString());
+const host = Symbol(html.UrlUtils.name + "." + 'host'.toString());
+const hostname = Symbol(html.UrlUtils.name + "." + 'hostname'.toString());
+const href = Symbol(html.UrlUtils.name + "." + 'href'.toString());
+const origin = Symbol(html.UrlUtils.name + "." + 'origin'.toString());
+const password = Symbol(html.UrlUtils.name + "." + 'password'.toString());
+const pathname = Symbol(html.UrlUtils.name + "." + 'pathname'.toString());
+const port = Symbol(html.UrlUtils.name + "." + 'port'.toString());
+const protocol = Symbol(html.UrlUtils.name + "." + 'protocol'.toString());
+const search = Symbol(html.UrlUtils.name + "." + 'search'.toString());
+const username = Symbol(html.UrlUtils.name + "." + 'username'.toString());
 dart.setSignature(html.UrlUtils, {
   constructors: () => ({_: dart.definiteFunctionType(html.UrlUtils, [])}),
   fields: () => ({
@@ -74017,7 +75757,70 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
+  get hash() {
+    return this[hash];
+  }
+  set hash(value) {
+    super.hash = value;
+  }
+  get host() {
+    return this[host];
+  }
+  set host(value) {
+    super.host = value;
+  }
+  get hostname() {
+    return this[hostname];
+  }
+  set hostname(value) {
+    super.hostname = value;
+  }
+  get href() {
+    return this[href];
+  }
+  set href(value) {
+    super.href = value;
+  }
+  get origin() {
+    return this[origin];
+  }
+  set origin(value) {
+    super.origin = value;
+  }
+  get pathname() {
+    return this[pathname];
+  }
+  set pathname(value) {
+    super.pathname = value;
+  }
+  get port() {
+    return this[port];
+  }
+  set port(value) {
+    super.port = value;
+  }
+  get protocol() {
+    return this[protocol];
+  }
+  set protocol(value) {
+    super.protocol = value;
+  }
+  get search() {
+    return this[search];
+  }
+  set search(value) {
+    super.search = value;
+  }
 };
+const hash = Symbol(html.UrlUtilsReadOnly.name + "." + 'hash'.toString());
+const host = Symbol(html.UrlUtilsReadOnly.name + "." + 'host'.toString());
+const hostname = Symbol(html.UrlUtilsReadOnly.name + "." + 'hostname'.toString());
+const href = Symbol(html.UrlUtilsReadOnly.name + "." + 'href'.toString());
+const origin = Symbol(html.UrlUtilsReadOnly.name + "." + 'origin'.toString());
+const pathname = Symbol(html.UrlUtilsReadOnly.name + "." + 'pathname'.toString());
+const port = Symbol(html.UrlUtilsReadOnly.name + "." + 'port'.toString());
+const protocol = Symbol(html.UrlUtilsReadOnly.name + "." + 'protocol'.toString());
+const search = Symbol(html.UrlUtilsReadOnly.name + "." + 'search'.toString());
 dart.setSignature(html.UrlUtilsReadOnly, {
   constructors: () => ({_: dart.definiteFunctionType(html.UrlUtilsReadOnly, [])}),
   fields: () => ({
@@ -74328,14 +76131,14 @@
   set [dartx.width](value) {
     this.width = value;
   }
-  [dartx.getVideoPlaybackQuality]() {
-    return this.getVideoPlaybackQuality();
+  [dartx.getVideoPlaybackQuality](...args) {
+    return this.getVideoPlaybackQuality.apply(this, args);
   }
-  [dartx.enterFullscreen]() {
-    return this.webkitEnterFullscreen();
+  [dartx.enterFullscreen](...args) {
+    return this.webkitEnterFullscreen.apply(this, args);
   }
-  [dartx.exitFullscreen]() {
-    return this.webkitExitFullscreen();
+  [dartx.exitFullscreen](...args) {
+    return this.webkitExitFullscreen.apply(this, args);
   }
 };
 dart.defineNamedConstructor(html.VideoElement, 'created');
@@ -74452,11 +76255,11 @@
   get [dartx.selectedIndex]() {
     return this.selectedIndex;
   }
-  [__getter__](index) {
-    return this.__getter__(index);
+  [__getter__](...args) {
+    return this.__getter__.apply(this, args);
   }
-  [dartx.getTrackById](id) {
-    return this.getTrackById(id);
+  [dartx.getTrackById](...args) {
+    return this.getTrackById.apply(this, args);
   }
   get [dartx.onChange]() {
     return html.VideoTrackList.changeEvent.forTarget(this);
@@ -74551,8 +76354,8 @@
   set [dartx.vertical](value) {
     this.vertical = value;
   }
-  [dartx.getCueAsHtml]() {
-    return this.getCueAsHTML();
+  [dartx.getCueAsHtml](...args) {
+    return this.getCueAsHTML.apply(this, args);
   }
 };
 dart.setSignature(html.VttCue, {
@@ -74680,11 +76483,11 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.getRegionById](id) {
-    return this.getRegionById(id);
+  [dartx.getRegionById](...args) {
+    return this.getRegionById.apply(this, args);
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
 };
 dart.setSignature(html.VttRegionList, {
@@ -74755,23 +76558,23 @@
   get [dartx.url]() {
     return this.url;
   }
-  [dartx.close](code, reason) {
-    return this.close(code, reason);
+  [dartx.close](...args) {
+    return this.close.apply(this, args);
   }
-  [dartx.send](data) {
-    return this.send(data);
+  [dartx.send](...args) {
+    return this.send.apply(this, args);
   }
-  [dartx.sendBlob](data) {
-    return this.send(data);
+  [dartx.sendBlob](...args) {
+    return this.send.apply(this, args);
   }
-  [dartx.sendByteBuffer](data) {
-    return this.send(data);
+  [dartx.sendByteBuffer](...args) {
+    return this.send.apply(this, args);
   }
-  [dartx.sendString](data) {
-    return this.send(data);
+  [dartx.sendString](...args) {
+    return this.send.apply(this, args);
   }
-  [dartx.sendTypedData](data) {
-    return this.send(data);
+  [dartx.sendTypedData](...args) {
+    return this.send.apply(this, args);
   }
   get [dartx.onClose]() {
     return html.WebSocket.closeEvent.forTarget(this);
@@ -74942,14 +76745,14 @@
   get [_hasInitMouseScrollEvent]() {
     return !!this.initMouseScrollEvent;
   }
-  [_initMouseScrollEvent](type, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, axis) {
-    return this.initMouseScrollEvent(type, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, axis);
+  [_initMouseScrollEvent](...args) {
+    return this.initMouseScrollEvent.apply(this, args);
   }
   get [_hasInitWheelEvent]() {
     return !!this.initWheelEvent;
   }
-  [_initWheelEvent](eventType, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, button, relatedTarget, modifiersList, deltaX, deltaY, deltaZ, deltaMode) {
-    return this.initWheelEvent(eventType, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, button, relatedTarget, modifiersList, deltaX, deltaY, deltaZ, deltaMode);
+  [_initWheelEvent](...args) {
+    return this.initWheelEvent.apply(this, args);
   }
 };
 dart.setSignature(html.WheelEvent, {
@@ -75211,11 +77014,11 @@
     this[_ensureRequestAnimationFrame]();
     this[_cancelAnimationFrame](id);
   }
-  [_requestAnimationFrame](callback) {
-    return this.requestAnimationFrame(callback);
+  [_requestAnimationFrame](...args) {
+    return this.requestAnimationFrame.apply(this, args);
   }
-  [_cancelAnimationFrame](id) {
-    return this.cancelAnimationFrame(id);
+  [_cancelAnimationFrame](...args) {
+    return this.cancelAnimationFrame.apply(this, args);
   }
   [_ensureRequestAnimationFrame]() {
     if (!!(this.requestAnimationFrame && this.cancelAnimationFrame)) return;
@@ -75408,20 +77211,20 @@
     }
     dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
   }
-  [__getter___1](index) {
-    return this.__getter__(index);
+  [__getter___1](...args) {
+    return this.__getter__.apply(this, args);
   }
-  [__getter___2](name) {
-    return this.__getter__(name);
+  [__getter___2](...args) {
+    return this.__getter__.apply(this, args);
   }
-  [dartx.alert](message) {
-    return this.alert(message);
+  [dartx.alert](...args) {
+    return this.alert.apply(this, args);
   }
-  [dartx.close]() {
-    return this.close();
+  [dartx.close](...args) {
+    return this.close.apply(this, args);
   }
-  [dartx.confirm](message) {
-    return this.confirm(message);
+  [dartx.confirm](...args) {
+    return this.confirm.apply(this, args);
   }
   [dartx.fetch](input, init) {
     if (init === void 0) init = null;
@@ -75431,35 +77234,35 @@
     }
     return this[_fetch_2](input);
   }
-  [_fetch_1](input, init) {
-    return this.fetch(input, init);
+  [_fetch_1](...args) {
+    return this.fetch.apply(this, args);
   }
-  [_fetch_2](input) {
-    return this.fetch(input);
+  [_fetch_2](...args) {
+    return this.fetch.apply(this, args);
   }
-  [dartx.find](string, caseSensitive, backwards, wrap, wholeWord, searchInFrames, showDialog) {
-    return this.find(string, caseSensitive, backwards, wrap, wholeWord, searchInFrames, showDialog);
+  [dartx.find](...args) {
+    return this.find.apply(this, args);
   }
-  [_getComputedStyle](elt, pseudoElt) {
-    return this.getComputedStyle(elt, pseudoElt);
+  [_getComputedStyle](...args) {
+    return this.getComputedStyle.apply(this, args);
   }
-  [dartx.getMatchedCssRules](element, pseudoElement) {
-    return this.getMatchedCSSRules(element, pseudoElement);
+  [dartx.getMatchedCssRules](...args) {
+    return this.getMatchedCSSRules.apply(this, args);
   }
-  [dartx.getSelection]() {
-    return this.getSelection();
+  [dartx.getSelection](...args) {
+    return this.getSelection.apply(this, args);
   }
-  [dartx.matchMedia](query) {
-    return this.matchMedia(query);
+  [dartx.matchMedia](...args) {
+    return this.matchMedia.apply(this, args);
   }
-  [dartx.moveBy](x, y) {
-    return this.moveBy(x, y);
+  [dartx.moveBy](...args) {
+    return this.moveBy.apply(this, args);
   }
-  [_moveTo](x, y) {
-    return this.moveTo(x, y);
+  [_moveTo](...args) {
+    return this.moveTo.apply(this, args);
   }
-  [dartx.openDatabase](name, version, displayName, estimatedSize, creationCallback) {
-    return this.openDatabase(name, version, displayName, estimatedSize, creationCallback);
+  [dartx.openDatabase](...args) {
+    return this.openDatabase.apply(this, args);
   }
   [dartx.postMessage](message, targetOrigin, transfer) {
     if (transfer === void 0) transfer = null;
@@ -75472,20 +77275,20 @@
     this[_postMessage_2](message_1, targetOrigin);
     return;
   }
-  [_postMessage_1](message, targetOrigin, transfer) {
-    return this.postMessage(message, targetOrigin, transfer);
+  [_postMessage_1](...args) {
+    return this.postMessage.apply(this, args);
   }
-  [_postMessage_2](message, targetOrigin) {
-    return this.postMessage(message, targetOrigin);
+  [_postMessage_2](...args) {
+    return this.postMessage.apply(this, args);
   }
-  [dartx.print]() {
-    return this.print();
+  [dartx.print](...args) {
+    return this.print.apply(this, args);
   }
-  [dartx.resizeBy](x, y) {
-    return this.resizeBy(x, y);
+  [dartx.resizeBy](...args) {
+    return this.resizeBy.apply(this, args);
   }
-  [dartx.resizeTo](x, y) {
-    return this.resizeTo(x, y);
+  [dartx.resizeTo](...args) {
+    return this.resizeTo.apply(this, args);
   }
   [dartx.scroll](options_OR_x, y, scrollOptions) {
     if (options_OR_x === void 0) options_OR_x = null;
@@ -75515,20 +77318,20 @@
     }
     dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
   }
-  [_scroll_1]() {
-    return this.scroll();
+  [_scroll_1](...args) {
+    return this.scroll.apply(this, args);
   }
-  [_scroll_2](options) {
-    return this.scroll(options);
+  [_scroll_2](...args) {
+    return this.scroll.apply(this, args);
   }
-  [_scroll_3](x, y) {
-    return this.scroll(x, y);
+  [_scroll_3](...args) {
+    return this.scroll.apply(this, args);
   }
-  [_scroll_4](x, y) {
-    return this.scroll(x, y);
+  [_scroll_4](...args) {
+    return this.scroll.apply(this, args);
   }
-  [_scroll_5](x, y, scrollOptions) {
-    return this.scroll(x, y, scrollOptions);
+  [_scroll_5](...args) {
+    return this.scroll.apply(this, args);
   }
   [dartx.scrollBy](options_OR_x, y, scrollOptions) {
     if (options_OR_x === void 0) options_OR_x = null;
@@ -75558,20 +77361,20 @@
     }
     dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
   }
-  [_scrollBy_1]() {
-    return this.scrollBy();
+  [_scrollBy_1](...args) {
+    return this.scrollBy.apply(this, args);
   }
-  [_scrollBy_2](options) {
-    return this.scrollBy(options);
+  [_scrollBy_2](...args) {
+    return this.scrollBy.apply(this, args);
   }
-  [_scrollBy_3](x, y) {
-    return this.scrollBy(x, y);
+  [_scrollBy_3](...args) {
+    return this.scrollBy.apply(this, args);
   }
-  [_scrollBy_4](x, y) {
-    return this.scrollBy(x, y);
+  [_scrollBy_4](...args) {
+    return this.scrollBy.apply(this, args);
   }
-  [_scrollBy_5](x, y, scrollOptions) {
-    return this.scrollBy(x, y, scrollOptions);
+  [_scrollBy_5](...args) {
+    return this.scrollBy.apply(this, args);
   }
   [dartx.scrollTo](options_OR_x, y, scrollOptions) {
     if (options_OR_x === void 0) options_OR_x = null;
@@ -75601,26 +77404,26 @@
     }
     dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
   }
-  [_scrollTo_1]() {
-    return this.scrollTo();
+  [_scrollTo_1](...args) {
+    return this.scrollTo.apply(this, args);
   }
-  [_scrollTo_2](options) {
-    return this.scrollTo(options);
+  [_scrollTo_2](...args) {
+    return this.scrollTo.apply(this, args);
   }
-  [_scrollTo_3](x, y) {
-    return this.scrollTo(x, y);
+  [_scrollTo_3](...args) {
+    return this.scrollTo.apply(this, args);
   }
-  [_scrollTo_4](x, y) {
-    return this.scrollTo(x, y);
+  [_scrollTo_4](...args) {
+    return this.scrollTo.apply(this, args);
   }
-  [_scrollTo_5](x, y, scrollOptions) {
-    return this.scrollTo(x, y, scrollOptions);
+  [_scrollTo_5](...args) {
+    return this.scrollTo.apply(this, args);
   }
-  [dartx.stop]() {
-    return this.stop();
+  [dartx.stop](...args) {
+    return this.stop.apply(this, args);
   }
-  [__requestFileSystem](type, size, successCallback, errorCallback) {
-    return this.webkitRequestFileSystem(type, size, successCallback, errorCallback);
+  [__requestFileSystem](...args) {
+    return this.webkitRequestFileSystem.apply(this, args);
   }
   [_requestFileSystem](type, size) {
     let completer = CompleterOfFileSystem().new();
@@ -75631,8 +77434,8 @@
     }, FileErrorTovoid()));
     return completer.future;
   }
-  [_resolveLocalFileSystemUrl](url, successCallback, errorCallback) {
-    return this.webkitResolveLocalFileSystemURL(url, successCallback, errorCallback);
+  [_resolveLocalFileSystemUrl](...args) {
+    return this.webkitResolveLocalFileSystemURL.apply(this, args);
   }
   [dartx.resolveLocalFileSystemUrl](url) {
     let completer = CompleterOfEntry().new();
@@ -75643,29 +77446,29 @@
     }, FileErrorTovoid()));
     return completer.future;
   }
-  [dartx.atob](atob) {
-    return this.atob(atob);
+  [dartx.atob](...args) {
+    return this.atob.apply(this, args);
   }
-  [dartx.btoa](btoa) {
-    return this.btoa(btoa);
+  [dartx.btoa](...args) {
+    return this.btoa.apply(this, args);
   }
-  [_setInterval_String](handler, timeout, arguments$) {
-    return this.setInterval(handler, timeout, arguments$);
+  [_setInterval_String](...args) {
+    return this.setInterval.apply(this, args);
   }
-  [_setTimeout_String](handler, timeout, arguments$) {
-    return this.setTimeout(handler, timeout, arguments$);
+  [_setTimeout_String](...args) {
+    return this.setTimeout.apply(this, args);
   }
-  [_clearInterval](handle) {
-    return this.clearInterval(handle);
+  [_clearInterval](...args) {
+    return this.clearInterval.apply(this, args);
   }
-  [_clearTimeout](handle) {
-    return this.clearTimeout(handle);
+  [_clearTimeout](...args) {
+    return this.clearTimeout.apply(this, args);
   }
-  [_setInterval](handler, timeout) {
-    return this.setInterval(handler, timeout);
+  [_setInterval](...args) {
+    return this.setInterval.apply(this, args);
   }
-  [_setTimeout](handler, timeout) {
-    return this.setTimeout(handler, timeout);
+  [_setTimeout](...args) {
+    return this.setTimeout.apply(this, args);
   }
   get [dartx.onContentLoaded]() {
     return html.Window.contentLoadedEvent.forTarget(this);
@@ -76202,6 +78005,7 @@
   }
 });
 dart.registerExtension(dart.global.Window, html.Window);
+dart.registerExtension(dart.global.DOMWindow, html.Window);
 const _returnValue = Symbol('_returnValue');
 html._WrappedEvent = class _WrappedEvent extends core.Object {
   new(wrapped) {
@@ -76378,8 +78182,8 @@
   get [dartx.visibilityState]() {
     return this.visibilityState;
   }
-  [dartx.focus]() {
-    return this.focus();
+  [dartx.focus](...args) {
+    return this.focus.apply(this, args);
   }
 };
 dart.setSignature(html.WindowClient, {
@@ -76509,14 +78313,14 @@
     this[_postMessage_2](message_1);
     return;
   }
-  [_postMessage_1](message, transfer) {
-    return this.postMessage(message, transfer);
+  [_postMessage_1](...args) {
+    return this.postMessage.apply(this, args);
   }
-  [_postMessage_2](message) {
-    return this.postMessage(message);
+  [_postMessage_2](...args) {
+    return this.postMessage.apply(this, args);
   }
-  [dartx.terminate]() {
-    return this.terminate();
+  [dartx.terminate](...args) {
+    return this.terminate.apply(this, args);
   }
   get [dartx.onError]() {
     return html.Worker.errorEvent.forTarget(this);
@@ -76587,35 +78391,35 @@
   get [dartx.memory]() {
     return this.memory;
   }
-  [dartx.clearMarks](markName) {
-    return this.clearMarks(markName);
+  [dartx.clearMarks](...args) {
+    return this.clearMarks.apply(this, args);
   }
-  [dartx.clearMeasures](measureName) {
-    return this.clearMeasures(measureName);
+  [dartx.clearMeasures](...args) {
+    return this.clearMeasures.apply(this, args);
   }
-  [dartx.getEntries]() {
-    return this.getEntries();
+  [dartx.getEntries](...args) {
+    return this.getEntries.apply(this, args);
   }
-  [dartx.getEntriesByName](name, entryType) {
-    return this.getEntriesByName(name, entryType);
+  [dartx.getEntriesByName](...args) {
+    return this.getEntriesByName.apply(this, args);
   }
-  [dartx.getEntriesByType](entryType) {
-    return this.getEntriesByType(entryType);
+  [dartx.getEntriesByType](...args) {
+    return this.getEntriesByType.apply(this, args);
   }
-  [dartx.mark](markName) {
-    return this.mark(markName);
+  [dartx.mark](...args) {
+    return this.mark.apply(this, args);
   }
-  [dartx.measure](measureName, startMark, endMark) {
-    return this.measure(measureName, startMark, endMark);
+  [dartx.measure](...args) {
+    return this.measure.apply(this, args);
   }
-  [dartx.now]() {
-    return this.now();
+  [dartx.now](...args) {
+    return this.now.apply(this, args);
   }
-  [dartx.clearResourceTimings]() {
-    return this.webkitClearResourceTimings();
+  [dartx.clearResourceTimings](...args) {
+    return this.webkitClearResourceTimings.apply(this, args);
   }
-  [dartx.setResourceTimingBufferSize](maxSize) {
-    return this.webkitSetResourceTimingBufferSize(maxSize);
+  [dartx.setResourceTimingBufferSize](...args) {
+    return this.webkitSetResourceTimingBufferSize.apply(this, args);
   }
 };
 dart.setSignature(html.WorkerPerformance, {
@@ -76650,14 +78454,14 @@
   static _create_1() {
     return new XPathEvaluator();
   }
-  [dartx.createExpression](expression, resolver) {
-    return this.createExpression(expression, resolver);
+  [dartx.createExpression](...args) {
+    return this.createExpression.apply(this, args);
   }
-  [dartx.createNSResolver](nodeResolver) {
-    return this.createNSResolver(nodeResolver);
+  [dartx.createNSResolver](...args) {
+    return this.createNSResolver.apply(this, args);
   }
-  [dartx.evaluate](expression, contextNode, resolver, type, inResult) {
-    return this.evaluate(expression, contextNode, resolver, type, inResult);
+  [dartx.evaluate](...args) {
+    return this.evaluate.apply(this, args);
   }
 };
 dart.setSignature(html.XPathEvaluator, {
@@ -76681,8 +78485,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.evaluate](contextNode, type, inResult) {
-    return this.evaluate(contextNode, type, inResult);
+  [dartx.evaluate](...args) {
+    return this.evaluate.apply(this, args);
   }
 };
 dart.setSignature(html.XPathExpression, {
@@ -76697,8 +78501,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.lookupNamespaceUri](prefix) {
-    return this.lookupNamespaceURI(prefix);
+  [dartx.lookupNamespaceUri](...args) {
+    return this.lookupNamespaceURI.apply(this, args);
   }
 };
 dart.setSignature(html.XPathNSResolver, {
@@ -76742,11 +78546,11 @@
   get [dartx.stringValue]() {
     return this.stringValue;
   }
-  [dartx.iterateNext]() {
-    return this.iterateNext();
+  [dartx.iterateNext](...args) {
+    return this.iterateNext.apply(this, args);
   }
-  [dartx.snapshotItem](index) {
-    return this.snapshotItem(index);
+  [dartx.snapshotItem](...args) {
+    return this.snapshotItem.apply(this, args);
   }
 };
 dart.setSignature(html.XPathResult, {
@@ -76810,8 +78614,8 @@
   static _create_1() {
     return new XMLSerializer();
   }
-  [dartx.serializeToString](root) {
-    return this.serializeToString(root);
+  [dartx.serializeToString](...args) {
+    return this.serializeToString.apply(this, args);
   }
 };
 dart.setSignature(html.XmlSerializer, {
@@ -76847,29 +78651,29 @@
   static get supported() {
     return !!window.XSLTProcessor;
   }
-  [dartx.clearParameters]() {
-    return this.clearParameters();
+  [dartx.clearParameters](...args) {
+    return this.clearParameters.apply(this, args);
   }
-  [dartx.getParameter](namespaceURI, localName) {
-    return this.getParameter(namespaceURI, localName);
+  [dartx.getParameter](...args) {
+    return this.getParameter.apply(this, args);
   }
-  [dartx.importStylesheet](style) {
-    return this.importStylesheet(style);
+  [dartx.importStylesheet](...args) {
+    return this.importStylesheet.apply(this, args);
   }
-  [dartx.removeParameter](namespaceURI, localName) {
-    return this.removeParameter(namespaceURI, localName);
+  [dartx.removeParameter](...args) {
+    return this.removeParameter.apply(this, args);
   }
-  [dartx.reset]() {
-    return this.reset();
+  [dartx.reset](...args) {
+    return this.reset.apply(this, args);
   }
-  [dartx.setParameter](namespaceURI, localName, value) {
-    return this.setParameter(namespaceURI, localName, value);
+  [dartx.setParameter](...args) {
+    return this.setParameter.apply(this, args);
   }
-  [dartx.transformToDocument](source) {
-    return this.transformToDocument(source);
+  [dartx.transformToDocument](...args) {
+    return this.transformToDocument.apply(this, args);
   }
-  [dartx.transformToFragment](source, output) {
-    return this.transformToFragment(source, output);
+  [dartx.transformToFragment](...args) {
+    return this.transformToFragment.apply(this, args);
   }
 };
 dart.setSignature(html.XsltProcessor, {
@@ -77083,8 +78887,8 @@
 });
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'length',
   'first',
   'last',
@@ -77099,11 +78903,11 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
     return this[dartx.item](index);
   }
-  [dartx.set](index, value) {
+  [dartx._set](index, value) {
     dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
     return value;
   }
@@ -77132,13 +78936,13 @@
     dart.throw(new core.StateError("More than one element"));
   }
   [dartx.elementAt](index) {
-    return this[dartx.get](index);
+    return this[dartx._get](index);
   }
-  [__getter__](index) {
-    return this.__getter__(index);
+  [__getter__](...args) {
+    return this.__getter__.apply(this, args);
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
 };
 html._ClientRectList[dart.implements] = () => [ListOfRectangleOfnum()];
@@ -77152,18 +78956,19 @@
   }),
   setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(math.Rectangle$(core.num), [core.int]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, RectangleOfnum()]),
+    [dartx._get]: dart.definiteFunctionType(math.Rectangle$(core.num), [core.int]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, RectangleOfnum()]),
     [dartx.elementAt]: dart.definiteFunctionType(math.Rectangle$(core.num), [core.int]),
     [__getter__]: dart.definiteFunctionType(math.Rectangle$(core.num), [core.int]),
     [dartx.item]: dart.definiteFunctionType(math.Rectangle$(core.num), [core.int])
   })
 });
 dart.registerExtension(dart.global.ClientRectList, html._ClientRectList);
+dart.registerExtension(dart.global.DOMRectList, html._ClientRectList);
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'length',
   'first',
   'last',
@@ -77178,11 +78983,11 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
     return this[index];
   }
-  [dartx.set](index, value) {
+  [dartx._set](index, value) {
     dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
     return value;
   }
@@ -77211,10 +79016,10 @@
     dart.throw(new core.StateError("More than one element"));
   }
   [dartx.elementAt](index) {
-    return this[dartx.get](index);
+    return this[dartx._get](index);
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
 };
 html._CssRuleList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfCssRule()];
@@ -77228,8 +79033,8 @@
   }),
   setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(html.CssRule, [core.int]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html.CssRule]),
+    [dartx._get]: dart.definiteFunctionType(html.CssRule, [core.int]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html.CssRule]),
     [dartx.elementAt]: dart.definiteFunctionType(html.CssRule, [core.int]),
     [dartx.item]: dart.definiteFunctionType(html.CssRule, [core.int])
   })
@@ -77415,8 +79220,8 @@
 dart.registerExtension(dart.global.FileWriterSync, html._FileWriterSync);
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'length',
   'first',
   'last',
@@ -77431,11 +79236,11 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
     return this[index];
   }
-  [dartx.set](index, value) {
+  [dartx._set](index, value) {
     dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
     return value;
   }
@@ -77464,10 +79269,10 @@
     dart.throw(new core.StateError("More than one element"));
   }
   [dartx.elementAt](index) {
-    return this[dartx.get](index);
+    return this[dartx._get](index);
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
 };
 html._GamepadList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfGamepad()];
@@ -77481,8 +79286,8 @@
   }),
   setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(html.Gamepad, [core.int]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html.Gamepad]),
+    [dartx._get]: dart.definiteFunctionType(html.Gamepad, [core.int]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html.Gamepad]),
     [dartx.elementAt]: dart.definiteFunctionType(html.Gamepad, [core.int]),
     [dartx.item]: dart.definiteFunctionType(html.Gamepad, [core.int])
   })
@@ -77492,8 +79297,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [_item](index) {
-    return this.item(index);
+  [_item](...args) {
+    return this.item.apply(this, args);
   }
 };
 dart.setSignature(html._HTMLAllCollection, {
@@ -77600,8 +79405,8 @@
 dart.registerExtension(dart.global.HTMLMarqueeElement, html._HTMLMarqueeElement);
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'length',
   'first',
   'last',
@@ -77622,11 +79427,11 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
     return this[index];
   }
-  [dartx.set](index, value) {
+  [dartx._set](index, value) {
     dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
     return value;
   }
@@ -77655,28 +79460,28 @@
     dart.throw(new core.StateError("More than one element"));
   }
   [dartx.elementAt](index) {
-    return this[dartx.get](index);
+    return this[dartx._get](index);
   }
-  [dartx.getNamedItem](name) {
-    return this.getNamedItem(name);
+  [dartx.getNamedItem](...args) {
+    return this.getNamedItem.apply(this, args);
   }
-  [dartx.getNamedItemNS](namespaceURI, localName) {
-    return this.getNamedItemNS(namespaceURI, localName);
+  [dartx.getNamedItemNS](...args) {
+    return this.getNamedItemNS.apply(this, args);
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
-  [dartx.removeNamedItem](name) {
-    return this.removeNamedItem(name);
+  [dartx.removeNamedItem](...args) {
+    return this.removeNamedItem.apply(this, args);
   }
-  [dartx.removeNamedItemNS](namespaceURI, localName) {
-    return this.removeNamedItemNS(namespaceURI, localName);
+  [dartx.removeNamedItemNS](...args) {
+    return this.removeNamedItemNS.apply(this, args);
   }
-  [dartx.setNamedItem](attr) {
-    return this.setNamedItem(attr);
+  [dartx.setNamedItem](...args) {
+    return this.setNamedItem.apply(this, args);
   }
-  [dartx.setNamedItemNS](attr) {
-    return this.setNamedItemNS(attr);
+  [dartx.setNamedItemNS](...args) {
+    return this.setNamedItemNS.apply(this, args);
   }
 };
 html._NamedNodeMap[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfNode()];
@@ -77690,8 +79495,8 @@
   }),
   setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(html.Node, [core.int]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html.Node]),
+    [dartx._get]: dart.definiteFunctionType(html.Node, [core.int]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html.Node]),
     [dartx.elementAt]: dart.definiteFunctionType(html.Node, [core.int]),
     [dartx.getNamedItem]: dart.definiteFunctionType(html._Attr, [core.String]),
     [dartx.getNamedItemNS]: dart.definiteFunctionType(html._Attr, [core.String, core.String]),
@@ -77703,6 +79508,7 @@
   })
 });
 dart.registerExtension(dart.global.NamedNodeMap, html._NamedNodeMap);
+dart.registerExtension(dart.global.MozNamedAttrMap, html._NamedNodeMap);
 html._PagePopupController = class _PagePopupController extends _interceptors.Interceptor {
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
@@ -77757,8 +79563,8 @@
   get [dartx.url]() {
     return this.url;
   }
-  [dartx.clone]() {
-    return this.clone();
+  [dartx.clone](...args) {
+    return this.clone.apply(this, args);
   }
 };
 dart.setSignature(html._Request, {
@@ -77833,8 +79639,8 @@
 dart.registerExtension(dart.global.ServiceWorker, html._ServiceWorker);
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'length',
   'first',
   'last',
@@ -77849,11 +79655,11 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
     return this[index];
   }
-  [dartx.set](index, value) {
+  [dartx._set](index, value) {
     dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
     return value;
   }
@@ -77882,10 +79688,10 @@
     dart.throw(new core.StateError("More than one element"));
   }
   [dartx.elementAt](index) {
-    return this[dartx.get](index);
+    return this[dartx._get](index);
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
 };
 html._SpeechRecognitionResultList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfSpeechRecognitionResult()];
@@ -77899,8 +79705,8 @@
   }),
   setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(html.SpeechRecognitionResult, [core.int]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html.SpeechRecognitionResult]),
+    [dartx._get]: dart.definiteFunctionType(html.SpeechRecognitionResult, [core.int]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html.SpeechRecognitionResult]),
     [dartx.elementAt]: dart.definiteFunctionType(html.SpeechRecognitionResult, [core.int]),
     [dartx.item]: dart.definiteFunctionType(html.SpeechRecognitionResult, [core.int])
   })
@@ -77908,8 +79714,8 @@
 dart.registerExtension(dart.global.SpeechRecognitionResultList, html._SpeechRecognitionResultList);
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'length',
   'first',
   'last',
@@ -77924,11 +79730,11 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
     return this[index];
   }
-  [dartx.set](index, value) {
+  [dartx._set](index, value) {
     dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
     return value;
   }
@@ -77957,13 +79763,13 @@
     dart.throw(new core.StateError("More than one element"));
   }
   [dartx.elementAt](index) {
-    return this[dartx.get](index);
+    return this[dartx._get](index);
   }
-  [__getter__](name) {
-    return this.__getter__(name);
+  [__getter__](...args) {
+    return this.__getter__.apply(this, args);
   }
-  [dartx.item](index) {
-    return this.item(index);
+  [dartx.item](...args) {
+    return this.item.apply(this, args);
   }
 };
 html._StyleSheetList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfStyleSheet()];
@@ -77977,8 +79783,8 @@
   }),
   setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(html.StyleSheet, [core.int]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html.StyleSheet]),
+    [dartx._get]: dart.definiteFunctionType(html.StyleSheet, [core.int]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html.StyleSheet]),
     [dartx.elementAt]: dart.definiteFunctionType(html.StyleSheet, [core.int]),
     [__getter__]: dart.definiteFunctionType(html.CssStyleSheet, [core.String]),
     [dartx.item]: dart.definiteFunctionType(html.StyleSheet, [core.int])
@@ -78068,7 +79874,7 @@
   }
   addAll(other) {
     other[dartx.forEach](dart.fn((k, v) => {
-      this.set(k, v);
+      this._set(k, v);
     }, StringAndStringTovoid()));
   }
   containsValue(value) {
@@ -78081,9 +79887,9 @@
   }
   putIfAbsent(key, ifAbsent) {
     if (!dart.test(this[dartx.containsKey](key))) {
-      this.set(key, ifAbsent());
+      this._set(key, ifAbsent());
     }
-    return this.get(key);
+    return this._get(key);
   }
   clear() {
     for (let key of this.keys) {
@@ -78092,7 +79898,7 @@
   }
   forEach(f) {
     for (let key of this.keys) {
-      let value = this.get(key);
+      let value = this._get(key);
       f(key, value);
     }
   }
@@ -78100,7 +79906,7 @@
     let attributes = this[_element][_attributes];
     let keys = JSArrayOfString().of([]);
     for (let i = 0, len = attributes[dartx.length]; i < dart.notNull(len); i++) {
-      let attr = html._Attr._check(attributes[dartx.get](i));
+      let attr = html._Attr._check(attributes[dartx._get](i));
       if (dart.test(this[_matches](attr))) {
         keys[dartx.add](attr[dartx.name]);
       }
@@ -78111,7 +79917,7 @@
     let attributes = this[_element][_attributes];
     let values = JSArrayOfString().of([]);
     for (let i = 0, len = attributes[dartx.length]; i < dart.notNull(len); i++) {
-      let attr = html._Attr._check(attributes[dartx.get](i));
+      let attr = html._Attr._check(attributes[dartx._get](i));
       if (dart.test(this[_matches](attr))) {
         values[dartx.add](attr[dartx.value]);
       }
@@ -78161,10 +79967,10 @@
   containsKey(key) {
     return this[_element][_hasAttribute](core.String._check(key));
   }
-  get(key) {
+  _get(key) {
     return this[_element][dartx.getAttribute](core.String._check(key));
   }
-  set(key, value) {
+  _set(key, value) {
     this[_element][dartx.setAttribute](key, value);
     return value;
   }
@@ -78185,16 +79991,16 @@
   getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
   methods: () => ({
     containsKey: dart.definiteFunctionType(core.bool, [core.Object]),
-    get: dart.definiteFunctionType(core.String, [core.Object]),
-    set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
+    _get: dart.definiteFunctionType(core.String, [core.Object]),
+    _set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
     remove: dart.definiteFunctionType(core.String, [core.Object]),
     [_matches]: dart.definiteFunctionType(core.bool, [html.Node])
   })
 });
 dart.defineExtensionMembers(html._ElementAttributeMap, [
   'containsKey',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'remove',
   'length'
 ]);
@@ -78207,15 +80013,15 @@
   containsKey(key) {
     return this[_element][_hasAttributeNS](this[_namespace], core.String._check(key));
   }
-  get(key) {
+  _get(key) {
     return this[_element][dartx.getAttributeNS](this[_namespace], core.String._check(key));
   }
-  set(key, value) {
+  _set(key, value) {
     this[_element][dartx.setAttributeNS](this[_namespace], key, value);
     return value;
   }
   remove(key) {
-    let value = this.get(key);
+    let value = this._get(key);
     this[_element][_removeAttributeNS](this[_namespace], core.String._check(key));
     return value;
   }
@@ -78232,16 +80038,16 @@
   getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
   methods: () => ({
     containsKey: dart.definiteFunctionType(core.bool, [core.Object]),
-    get: dart.definiteFunctionType(core.String, [core.Object]),
-    set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
+    _get: dart.definiteFunctionType(core.String, [core.Object]),
+    _set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
     remove: dart.definiteFunctionType(core.String, [core.Object]),
     [_matches]: dart.definiteFunctionType(core.bool, [html.Node])
   })
 });
 dart.defineExtensionMembers(html._NamespacedAttributeMap, [
   'containsKey',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'remove',
   'length'
 ]);
@@ -78255,7 +80061,7 @@
   }
   addAll(other) {
     other[dartx.forEach](dart.fn((k, v) => {
-      this.set(k, v);
+      this._set(k, v);
     }, StringAndStringTovoid()));
   }
   containsValue(value) {
@@ -78264,11 +80070,11 @@
   containsKey(key) {
     return this[_attributes][dartx.containsKey](this[_attr](core.String._check(key)));
   }
-  get(key) {
-    return this[_attributes][dartx.get](this[_attr](core.String._check(key)));
+  _get(key) {
+    return this[_attributes][dartx._get](this[_attr](core.String._check(key)));
   }
-  set(key, value) {
-    this[_attributes][dartx.set](this[_attr](key), value);
+  _set(key, value) {
+    this[_attributes][dartx._set](this[_attr](key), value);
     return value;
   }
   putIfAbsent(key, ifAbsent) {
@@ -78330,9 +80136,9 @@
     let segments = hyphenedName[dartx.split]('-');
     let start = dart.test(startUppercase) ? 0 : 1;
     for (let i = start; i < dart.notNull(segments[dartx.length]); i++) {
-      let segment = segments[dartx.get](i);
+      let segment = segments[dartx._get](i);
       if (dart.notNull(segment[dartx.length]) > 0) {
-        segments[dartx.set](i, dart.str`${segment[dartx.get](0)[dartx.toUpperCase]()}${segment[dartx.substring](1)}`);
+        segments[dartx._set](i, dart.str`${segment[dartx._get](0)[dartx.toUpperCase]()}${segment[dartx.substring](1)}`);
       }
     }
     return segments[dartx.join]('');
@@ -78340,8 +80146,8 @@
   [_toHyphenedName](word) {
     let sb = new core.StringBuffer();
     for (let i = 0; i < dart.notNull(word[dartx.length]); i++) {
-      let lower = word[dartx.get](i)[dartx.toLowerCase]();
-      if (word[dartx.get](i) != lower && i > 0) sb.write('-');
+      let lower = word[dartx._get](i)[dartx.toLowerCase]();
+      if (word[dartx._get](i) != lower && i > 0) sb.write('-');
       sb.write(lower);
     }
     return sb.toString();
@@ -78362,8 +80168,8 @@
     addAll: dart.definiteFunctionType(dart.void, [MapOfString$String()]),
     containsValue: dart.definiteFunctionType(core.bool, [core.Object]),
     containsKey: dart.definiteFunctionType(core.bool, [core.Object]),
-    get: dart.definiteFunctionType(core.String, [core.Object]),
-    set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
+    _get: dart.definiteFunctionType(core.String, [core.Object]),
+    _set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
     putIfAbsent: dart.definiteFunctionType(core.String, [core.String, VoidToString()]),
     remove: dart.definiteFunctionType(core.String, [core.Object]),
     clear: dart.definiteFunctionType(dart.void, []),
@@ -78379,8 +80185,8 @@
   'addAll',
   'containsValue',
   'containsKey',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'putIfAbsent',
   'remove',
   'clear',
@@ -79926,7 +81732,7 @@
     add(stream) {
       StreamOfT()._check(stream);
       if (dart.test(this[_subscriptions][dartx.containsKey](stream))) return;
-      this[_subscriptions][dartx.set](stream, stream.listen(dart.bind(this[_controller], 'add'), {onError: dart.bind(this[_controller], 'addError'), onDone: dart.fn(() => this.remove(stream), VoidTovoid())}));
+      this[_subscriptions][dartx._set](stream, stream.listen(dart.bind(this[_controller], 'add'), {onError: dart.bind(this[_controller], 'addError'), onDone: dart.fn(() => this.remove(stream), VoidTovoid())}));
     }
     remove(stream) {
       StreamOfT()._check(stream);
@@ -80010,10 +81816,10 @@
     this.uriPolicy = uriPolicy != null ? uriPolicy : html.UriPolicy.new();
     if (dart.test(html._Html5NodeValidator._attributeValidators[dartx.isEmpty])) {
       for (let attr of html._Html5NodeValidator._standardAttributes) {
-        html._Html5NodeValidator._attributeValidators[dartx.set](attr, html._Html5NodeValidator._standardAttributeValidator);
+        html._Html5NodeValidator._attributeValidators[dartx._set](attr, html._Html5NodeValidator._standardAttributeValidator);
       }
       for (let attr of html._Html5NodeValidator._uriAttributes) {
-        html._Html5NodeValidator._attributeValidators[dartx.set](attr, html._Html5NodeValidator._uriAttributeValidator);
+        html._Html5NodeValidator._attributeValidators[dartx._set](attr, html._Html5NodeValidator._uriAttributeValidator);
       }
     }
   }
@@ -80022,9 +81828,9 @@
   }
   allowsAttribute(element, attributeName, value) {
     let tagName = html.Element._safeTagName(element);
-    let validator = html._Html5NodeValidator._attributeValidators[dartx.get](dart.str`${tagName}::${attributeName}`);
+    let validator = html._Html5NodeValidator._attributeValidators[dartx._get](dart.str`${tagName}::${attributeName}`);
     if (validator == null) {
-      validator = html._Html5NodeValidator._attributeValidators[dartx.get](dart.str`*::${attributeName}`);
+      validator = html._Html5NodeValidator._attributeValidators[dartx._get](dart.str`*::${attributeName}`);
     }
     if (validator == null) {
       return false;
@@ -80855,7 +82661,7 @@
       if (prevEvent[_shadowCharCode] == event[dartx.charCode]) {
         return prevEvent.keyCode;
       }
-      if ((dart.test(event[dartx.shiftKey]) || dart.test(this[_capsLockOn])) && dart.notNull(event[dartx.charCode]) >= dart.notNull("A"[dartx.codeUnits][dartx.get](0)) && dart.notNull(event[dartx.charCode]) <= dart.notNull("Z"[dartx.codeUnits][dartx.get](0)) && dart.notNull(event[dartx.charCode]) + dart.notNull(html._KeyboardEventHandler._ROMAN_ALPHABET_OFFSET) == prevEvent[_shadowCharCode]) {
+      if ((dart.test(event[dartx.shiftKey]) || dart.test(this[_capsLockOn])) && dart.notNull(event[dartx.charCode]) >= dart.notNull("A"[dartx.codeUnits][dartx._get](0)) && dart.notNull(event[dartx.charCode]) <= dart.notNull("Z"[dartx.codeUnits][dartx._get](0)) && dart.notNull(event[dartx.charCode]) + dart.notNull(html._KeyboardEventHandler._ROMAN_ALPHABET_OFFSET) == prevEvent[_shadowCharCode]) {
         return prevEvent.keyCode;
       }
     }
@@ -81053,7 +82859,7 @@
     }
     e[_shadowKeyCode] = this[_determineKeyCodeForKeypress](e);
     if (e[_shadowKeyIdentifier] != null && dart.test(html._KeyboardEventHandler._keyIdentifier[dartx.containsKey](e[_shadowKeyIdentifier]))) {
-      e[_shadowKeyCode] = html._KeyboardEventHandler._keyIdentifier[dartx.get](e[_shadowKeyIdentifier]);
+      e[_shadowKeyCode] = html._KeyboardEventHandler._keyIdentifier[dartx._get](e[_shadowKeyIdentifier]);
     }
     e[_shadowAltKey] = this[_keyDownList][dartx.any](dart.fn(element => element.altKey, KeyEventTobool()));
     this[_stream].add(e);
@@ -81108,7 +82914,7 @@
 html._KeyboardEventHandler._keyIdentifier = dart.const(dart.map({Up: html.KeyCode.UP, Down: html.KeyCode.DOWN, Left: html.KeyCode.LEFT, Right: html.KeyCode.RIGHT, Enter: html.KeyCode.ENTER, F1: html.KeyCode.F1, F2: html.KeyCode.F2, F3: html.KeyCode.F3, F4: html.KeyCode.F4, F5: html.KeyCode.F5, F6: html.KeyCode.F6, F7: html.KeyCode.F7, F8: html.KeyCode.F8, F9: html.KeyCode.F9, F10: html.KeyCode.F10, F11: html.KeyCode.F11, F12: html.KeyCode.F12, 'U+007F': html.KeyCode.DELETE, Home: html.KeyCode.HOME, End: html.KeyCode.END, PageUp: html.KeyCode.PAGE_UP, PageDown: html.KeyCode.PAGE_DOWN, Insert: html.KeyCode.INSERT}, core.String, core.int));
 dart.defineLazy(html._KeyboardEventHandler, {
   get _ROMAN_ALPHABET_OFFSET() {
-    return dart.notNull("a"[dartx.codeUnits][dartx.get](0)) - dart.notNull("A"[dartx.codeUnits][dartx.get](0));
+    return dart.notNull("a"[dartx.codeUnits][dartx._get](0)) - dart.notNull("A"[dartx.codeUnits][dartx._get](0));
   }
 });
 html.KeyboardEventStream = class KeyboardEventStream extends core.Object {
@@ -81326,7 +83132,7 @@
   }
   allowsElement(element) {
     if (dart.test(this.allowTypeExtension)) {
-      let isAttr = element[dartx.attributes][dartx.get]('is');
+      let isAttr = element[dartx.attributes][dartx._get]('is');
       if (isAttr != null) {
         return dart.test(this.allowedElements.contains(isAttr[dartx.toUpperCase]())) && dart.test(this.allowedElements.contains(html.Element._safeTagName(element)));
       }
@@ -81363,7 +83169,7 @@
     if (attributeName == 'template' && value == "") {
       return true;
     }
-    if (element[dartx.attributes][dartx.get]('template') == "") {
+    if (element[dartx.attributes][dartx._get]('template') == "") {
       return this[_templateAttrs].contains(attributeName);
     }
     return false;
@@ -81438,12 +83244,12 @@
     clear() {
       this[_list][dartx.clear]();
     }
-    get(index) {
-      return html._downcast(html.Node, E)(this[_list][dartx.get](index));
+    _get(index) {
+      return html._downcast(html.Node, E)(this[_list][dartx._get](index));
     }
-    set(index, value) {
+    _set(index, value) {
       E._check(value);
-      this[_list][dartx.set](index, value);
+      this[_list][dartx._set](index, value);
       return value;
     }
     set length(newLength) {
@@ -81501,8 +83307,8 @@
     setters: () => ({length: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
       add: dart.definiteFunctionType(dart.void, [E]),
-      get: dart.definiteFunctionType(E, [core.int]),
-      set: dart.definiteFunctionType(dart.void, [core.int, E]),
+      _get: dart.definiteFunctionType(E, [core.int]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, E]),
       sort: dart.definiteFunctionType(dart.void, [], [EAndEToint()]),
       insert: dart.definiteFunctionType(dart.void, [core.int, E]),
       removeAt: dart.definiteFunctionType(E, [core.int]),
@@ -81515,8 +83321,8 @@
     'add',
     'remove',
     'clear',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'sort',
     'indexOf',
     'lastIndexOf',
@@ -81597,7 +83403,7 @@
     moveNext() {
       let nextPosition = dart.notNull(this[_position]) + 1;
       if (nextPosition < dart.notNull(this[_length])) {
-        this[_current] = this[_array][dartx.get](nextPosition);
+        this[_current] = this[_array][dartx._get](nextPosition);
         this[_position] = nextPosition;
         return true;
       }
@@ -81637,7 +83443,7 @@
     moveNext() {
       let nextPosition = dart.notNull(this[_position]) + 1;
       if (nextPosition < dart.notNull(this[_array][dartx.length])) {
-        this[_current] = this[_array][dartx.get](nextPosition);
+        this[_current] = this[_array][dartx._get](nextPosition);
         this[_position] = nextPosition;
         return true;
       }
@@ -82222,9 +84028,9 @@
     }
     let keys = attrs[dartx.keys][dartx.toList]();
     for (let i = dart.notNull(attrs[dartx.length]) - 1; i >= 0; --i) {
-      let name = keys[dartx.get](i);
-      if (!dart.test(this.validator.allowsAttribute(element, core.String._check(dart.dsend(name, 'toLowerCase')), core.String._check(attrs[dartx.get](name))))) {
-        html.window[dartx.console].warn('Removing disallowed attribute ' + dart.str`<${tag} ${name}="${attrs[dartx.get](name)}">`);
+      let name = keys[dartx._get](i);
+      if (!dart.test(this.validator.allowsAttribute(element, core.String._check(dart.dsend(name, 'toLowerCase')), core.String._check(attrs[dartx._get](name))))) {
+        html.window[dartx.console].warn('Removing disallowed attribute ' + dart.str`<${tag} ${name}="${attrs[dartx._get](name)}">`);
         attrs[dartx.remove](name);
       }
     }
@@ -82266,15 +84072,6 @@
     sanitizeNode: dart.definiteFunctionType(dart.void, [html.Node, html.Node])
   })
 });
-html.Point$ = math.Point$;
-html.Point = math.Point;
-html.Rectangle$ = math.Rectangle$;
-html.Rectangle = math.Rectangle;
-html_common.SupportedBrowser = _metadata.SupportedBrowser;
-html_common.Unstable = _metadata.Unstable;
-html_common.DocsEditable = _metadata.DocsEditable;
-html_common.Experimental = _metadata.Experimental;
-html_common.DomName = _metadata.DomName;
 html_common.convertDartToNative_SerializedScriptValue = function(value) {
   return html_common.convertDartToNative_PrepareForStructuredClone(value);
 };
@@ -82291,17 +84088,17 @@
   findSlot(value) {
     let length = this.values[dartx.length];
     for (let i = 0; i < dart.notNull(length); i++) {
-      if (core.identical(this.values[dartx.get](i), value)) return i;
+      if (core.identical(this.values[dartx._get](i), value)) return i;
     }
     this.values[dartx.add](value);
     this.copies[dartx.add](null);
     return length;
   }
   readSlot(i) {
-    return this.copies[dartx.get](i);
+    return this.copies[dartx._get](i);
   }
   writeSlot(i, x) {
-    this.copies[dartx.set](i, x);
+    this.copies[dartx._set](i, x);
   }
   cleanupSlots() {}
   walk(e) {
@@ -82346,7 +84143,7 @@
     let copy = this.newJsList(length);
     this.writeSlot(slot, copy);
     for (; i < dart.notNull(length); i++) {
-      dart.dsetindex(copy, i, this.walk(e[dartx.get](i)));
+      dart.dsetindex(copy, i, this.walk(e[dartx._get](i)));
     }
     return copy;
   }
@@ -82380,17 +84177,17 @@
   findSlot(value) {
     let length = this.values[dartx.length];
     for (let i = 0; i < dart.notNull(length); i++) {
-      if (dart.test(this.identicalInJs(this.values[dartx.get](i), value))) return i;
+      if (dart.test(this.identicalInJs(this.values[dartx._get](i), value))) return i;
     }
     this.values[dartx.add](value);
     this.copies[dartx.add](null);
     return length;
   }
   readSlot(i) {
-    return this.copies[dartx.get](i);
+    return this.copies[dartx._get](i);
   }
   writeSlot(i, x) {
-    this.copies[dartx.set](i, x);
+    this.copies[dartx._set](i, x);
   }
   walk(e) {
     if (e == null) return e;
@@ -82523,7 +84320,7 @@
   let dict = dart.map();
   let keys = Object.getOwnPropertyNames(object);
   for (let key of core.Iterable._check(keys)) {
-    dict[dartx.set](key, object[key]);
+    dict[dartx._set](key, object[key]);
   }
   return dict;
 };
@@ -82759,8 +84556,8 @@
   forEach(f) {
     this[_filtered][dartx.forEach](f);
   }
-  set(index, value) {
-    this.get(index)[dartx.replaceWith](value);
+  _set(index, value) {
+    this._get(index)[dartx.replaceWith](value);
     return value;
   }
   set length(newLength) {
@@ -82833,7 +84630,7 @@
     }
   }
   removeAt(index) {
-    let result = this.get(index);
+    let result = this._get(index);
     result[dartx.remove]();
     return result;
   }
@@ -82849,7 +84646,7 @@
   get length() {
     return this[_iterable][dartx.length];
   }
-  get(index) {
+  _get(index) {
     return this[_iterable][dartx.elementAt](index);
   }
   get iterator() {
@@ -82878,7 +84675,7 @@
   setters: () => ({length: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
     forEach: dart.definiteFunctionType(dart.void, [ElementTovoid()]),
-    set: dart.definiteFunctionType(dart.void, [core.int, html.Element]),
+    _set: dart.definiteFunctionType(dart.void, [core.int, html.Element]),
     add: dart.definiteFunctionType(dart.void, [html.Element]),
     addAll: dart.definiteFunctionType(dart.void, [IterableOfElement()]),
     sort: dart.definiteFunctionType(dart.void, [], [ElementAndElementToint()]),
@@ -82889,12 +84686,12 @@
     insert: dart.definiteFunctionType(dart.void, [core.int, html.Element]),
     insertAll: dart.definiteFunctionType(dart.void, [core.int, IterableOfElement()]),
     removeAt: dart.definiteFunctionType(html.Element, [core.int]),
-    get: dart.definiteFunctionType(html.Element, [core.int])
+    _get: dart.definiteFunctionType(html.Element, [core.int])
   })
 });
 dart.defineExtensionMembers(html_common.FilteredElementList, [
   'forEach',
-  'set',
+  '_set',
   'add',
   'addAll',
   'contains',
@@ -82909,7 +84706,7 @@
   'insertAll',
   'removeAt',
   'remove',
-  'get',
+  '_get',
   'length',
   'reversed',
   'length',
@@ -82924,7 +84721,7 @@
       startIndex = 0;
     }
     for (let i = startIndex; dart.notNull(i) < dart.notNull(endIndex); i = dart.notNull(i) + 1) {
-      if (dart.equals(a[dartx.get](i), element)) {
+      if (dart.equals(a[dartx._get](i), element)) {
         return i;
       }
     }
@@ -82938,7 +84735,7 @@
       startIndex = dart.notNull(a[dartx.length]) - 1;
     }
     for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) {
-      if (dart.equals(a[dartx.get](i), element)) {
+      if (dart.equals(a[dartx._get](i), element)) {
         return i;
       }
     }
@@ -82949,7 +84746,7 @@
     if (dart.notNull(end) < dart.notNull(start)) dart.throw(new core.RangeError.value(end));
     if (dart.notNull(end) > dart.notNull(a[dartx.length])) dart.throw(new core.RangeError.value(end));
     for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-      accumulator[dartx.add](a[dartx.get](i));
+      accumulator[dartx.add](a[dartx._get](i));
     }
     return accumulator;
   }
@@ -83155,11 +84952,11 @@
   get [dartx.viewportElement]() {
     return this.viewportElement;
   }
-  [dartx.blur]() {
-    return this.blur();
+  [dartx.blur](...args) {
+    return this.blur.apply(this, args);
   }
-  [dartx.focus]() {
-    return this.focus();
+  [dartx.focus](...args) {
+    return this.focus.apply(this, args);
   }
   get [dartx.onAbort]() {
     return svg.SvgElement.abortEvent.forElement(this);
@@ -83588,17 +85385,17 @@
   get [dartx.transform]() {
     return this.transform;
   }
-  [dartx.getBBox]() {
-    return this.getBBox();
+  [dartx.getBBox](...args) {
+    return this.getBBox.apply(this, args);
   }
-  [dartx.getCtm]() {
-    return this.getCTM();
+  [dartx.getCtm](...args) {
+    return this.getCTM.apply(this, args);
   }
-  [dartx.getScreenCtm]() {
-    return this.getScreenCTM();
+  [dartx.getScreenCtm](...args) {
+    return this.getScreenCTM.apply(this, args);
   }
-  [dartx.getTransformToElement](element) {
-    return this.getTransformToElement(element);
+  [dartx.getTransformToElement](...args) {
+    return this.getTransformToElement.apply(this, args);
   }
   get [dartx.requiredExtensions]() {
     return this.requiredExtensions;
@@ -83609,8 +85406,8 @@
   get [dartx.systemLanguage]() {
     return this.systemLanguage;
   }
-  [dartx.hasExtension](extension) {
-    return this.hasExtension(extension);
+  [dartx.hasExtension](...args) {
+    return this.hasExtension.apply(this, args);
   }
 };
 dart.defineNamedConstructor(svg.GraphicsElement, 'created');
@@ -83707,11 +85504,11 @@
   set [dartx.valueInSpecifiedUnits](value) {
     this.valueInSpecifiedUnits = value;
   }
-  [dartx.convertToSpecifiedUnits](unitType) {
-    return this.convertToSpecifiedUnits(unitType);
+  [dartx.convertToSpecifiedUnits](...args) {
+    return this.convertToSpecifiedUnits.apply(this, args);
   }
-  [dartx.newValueSpecifiedUnits](unitType, valueInSpecifiedUnits) {
-    return this.newValueSpecifiedUnits(unitType, valueInSpecifiedUnits);
+  [dartx.newValueSpecifiedUnits](...args) {
+    return this.newValueSpecifiedUnits.apply(this, args);
   }
 };
 dart.setSignature(svg.Angle, {
@@ -83771,26 +85568,26 @@
   get [dartx.targetElement]() {
     return this.targetElement;
   }
-  [dartx.beginElement]() {
-    return this.beginElement();
+  [dartx.beginElement](...args) {
+    return this.beginElement.apply(this, args);
   }
-  [dartx.beginElementAt](offset) {
-    return this.beginElementAt(offset);
+  [dartx.beginElementAt](...args) {
+    return this.beginElementAt.apply(this, args);
   }
-  [dartx.endElement]() {
-    return this.endElement();
+  [dartx.endElement](...args) {
+    return this.endElement.apply(this, args);
   }
-  [dartx.endElementAt](offset) {
-    return this.endElementAt(offset);
+  [dartx.endElementAt](...args) {
+    return this.endElementAt.apply(this, args);
   }
-  [dartx.getCurrentTime]() {
-    return this.getCurrentTime();
+  [dartx.getCurrentTime](...args) {
+    return this.getCurrentTime.apply(this, args);
   }
-  [dartx.getSimpleDuration]() {
-    return this.getSimpleDuration();
+  [dartx.getSimpleDuration](...args) {
+    return this.getSimpleDuration.apply(this, args);
   }
-  [dartx.getStartTime]() {
-    return this.getStartTime();
+  [dartx.getStartTime](...args) {
+    return this.getStartTime.apply(this, args);
   }
   get [dartx.requiredExtensions]() {
     return this.requiredExtensions;
@@ -83801,8 +85598,8 @@
   get [dartx.systemLanguage]() {
     return this.systemLanguage;
   }
-  [dartx.hasExtension](extension) {
-    return this.hasExtension(extension);
+  [dartx.hasExtension](...args) {
+    return this.hasExtension.apply(this, args);
   }
 };
 dart.defineNamedConstructor(svg.AnimationElement, 'created');
@@ -84205,11 +86002,11 @@
   created() {
     super.created();
   }
-  [dartx.isPointInFill](point) {
-    return this.isPointInFill(point);
+  [dartx.isPointInFill](...args) {
+    return this.isPointInFill.apply(this, args);
   }
-  [dartx.isPointInStroke](point) {
-    return this.isPointInStroke(point);
+  [dartx.isPointInStroke](...args) {
+    return this.isPointInStroke.apply(this, args);
   }
 };
 dart.defineNamedConstructor(svg.GeometryElement, 'created');
@@ -85335,8 +87132,8 @@
   get [dartx.stdDeviationY]() {
     return this.stdDeviationY;
   }
-  [dartx.setStdDeviation](stdDeviationX, stdDeviationY) {
-    return this.setStdDeviation(stdDeviationX, stdDeviationY);
+  [dartx.setStdDeviation](...args) {
+    return this.setStdDeviation.apply(this, args);
   }
   get [dartx.height]() {
     return this.height;
@@ -86171,7 +87968,42 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
+  get height() {
+    return this[height];
+  }
+  set height(value) {
+    super.height = value;
+  }
+  get result() {
+    return this[result];
+  }
+  set result(value) {
+    super.result = value;
+  }
+  get width() {
+    return this[width];
+  }
+  set width(value) {
+    super.width = value;
+  }
+  get x() {
+    return this[x];
+  }
+  set x(value) {
+    super.x = value;
+  }
+  get y() {
+    return this[y];
+  }
+  set y(value) {
+    super.y = value;
+  }
 };
+const height = Symbol(svg.FilterPrimitiveStandardAttributes.name + "." + 'height'.toString());
+const result = Symbol(svg.FilterPrimitiveStandardAttributes.name + "." + 'result'.toString());
+const width = Symbol(svg.FilterPrimitiveStandardAttributes.name + "." + 'width'.toString());
+const x = Symbol(svg.FilterPrimitiveStandardAttributes.name + "." + 'x'.toString());
+const y = Symbol(svg.FilterPrimitiveStandardAttributes.name + "." + 'y'.toString());
 dart.setSignature(svg.FilterPrimitiveStandardAttributes, {
   constructors: () => ({_: dart.definiteFunctionType(svg.FilterPrimitiveStandardAttributes, [])}),
   fields: () => ({
@@ -86197,7 +88029,21 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
+  get preserveAspectRatio() {
+    return this[preserveAspectRatio];
+  }
+  set preserveAspectRatio(value) {
+    super.preserveAspectRatio = value;
+  }
+  get viewBox() {
+    return this[viewBox];
+  }
+  set viewBox(value) {
+    super.viewBox = value;
+  }
 };
+const preserveAspectRatio = Symbol(svg.FitToViewBox.name + "." + 'preserveAspectRatio'.toString());
+const viewBox = Symbol(svg.FitToViewBox.name + "." + 'viewBox'.toString());
 dart.setSignature(svg.FitToViewBox, {
   constructors: () => ({_: dart.definiteFunctionType(svg.FitToViewBox, [])}),
   fields: () => ({
@@ -86372,11 +88218,11 @@
   set [dartx.valueInSpecifiedUnits](value) {
     this.valueInSpecifiedUnits = value;
   }
-  [dartx.convertToSpecifiedUnits](unitType) {
-    return this.convertToSpecifiedUnits(unitType);
+  [dartx.convertToSpecifiedUnits](...args) {
+    return this.convertToSpecifiedUnits.apply(this, args);
   }
-  [dartx.newValueSpecifiedUnits](unitType, valueInSpecifiedUnits) {
-    return this.newValueSpecifiedUnits(unitType, valueInSpecifiedUnits);
+  [dartx.newValueSpecifiedUnits](...args) {
+    return this.newValueSpecifiedUnits.apply(this, args);
   }
 };
 dart.setSignature(svg.Length, {
@@ -86420,8 +88266,8 @@
 const __setter__ = Symbol('__setter__');
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'length',
   'first',
   'last',
@@ -86446,11 +88292,11 @@
   get [dartx.numberOfItems]() {
     return this.numberOfItems;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
     return this[dartx.getItem](index);
   }
-  [dartx.set](index, value) {
+  [dartx._set](index, value) {
     dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
     return value;
   }
@@ -86479,31 +88325,31 @@
     dart.throw(new core.StateError("More than one element"));
   }
   [dartx.elementAt](index) {
-    return this[dartx.get](index);
+    return this[dartx._get](index);
   }
-  [__setter__](index, newItem) {
-    return this.__setter__(index, newItem);
+  [__setter__](...args) {
+    return this.__setter__.apply(this, args);
   }
-  [dartx.appendItem](newItem) {
-    return this.appendItem(newItem);
+  [dartx.appendItem](...args) {
+    return this.appendItem.apply(this, args);
   }
-  [dartx.clear]() {
-    return this.clear();
+  [dartx.clear](...args) {
+    return this.clear.apply(this, args);
   }
-  [dartx.getItem](index) {
-    return this.getItem(index);
+  [dartx.getItem](...args) {
+    return this.getItem.apply(this, args);
   }
-  [dartx.initialize](newItem) {
-    return this.initialize(newItem);
+  [dartx.initialize](...args) {
+    return this.initialize.apply(this, args);
   }
-  [dartx.insertItemBefore](newItem, index) {
-    return this.insertItemBefore(newItem, index);
+  [dartx.insertItemBefore](...args) {
+    return this.insertItemBefore.apply(this, args);
   }
-  [dartx.removeItem](index) {
-    return this.removeItem(index);
+  [dartx.removeItem](...args) {
+    return this.removeItem.apply(this, args);
   }
-  [dartx.replaceItem](newItem, index) {
-    return this.replaceItem(newItem, index);
+  [dartx.replaceItem](...args) {
+    return this.replaceItem.apply(this, args);
   }
 };
 svg.LengthList[dart.implements] = () => [ListOfLength()];
@@ -86518,8 +88364,8 @@
   }),
   setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(svg.Length, [core.int]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, svg.Length]),
+    [dartx._get]: dart.definiteFunctionType(svg.Length, [core.int]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, svg.Length]),
     [dartx.elementAt]: dart.definiteFunctionType(svg.Length, [core.int]),
     [__setter__]: dart.definiteFunctionType(dart.void, [core.int, svg.Length]),
     [dartx.appendItem]: dart.definiteFunctionType(svg.Length, [svg.Length]),
@@ -86735,11 +88581,11 @@
   get [dartx.refY]() {
     return this.refY;
   }
-  [dartx.setOrientToAngle](angle) {
-    return this.setOrientToAngle(angle);
+  [dartx.setOrientToAngle](...args) {
+    return this.setOrientToAngle.apply(this, args);
   }
-  [dartx.setOrientToAuto]() {
-    return this.setOrientToAuto();
+  [dartx.setOrientToAuto](...args) {
+    return this.setOrientToAuto.apply(this, args);
   }
   get [dartx.preserveAspectRatio]() {
     return this.preserveAspectRatio;
@@ -86845,8 +88691,8 @@
   get [dartx.systemLanguage]() {
     return this.systemLanguage;
   }
-  [dartx.hasExtension](extension) {
-    return this.hasExtension(extension);
+  [dartx.hasExtension](...args) {
+    return this.hasExtension.apply(this, args);
   }
 };
 dart.defineNamedConstructor(svg.MaskElement, 'created');
@@ -86930,38 +88776,38 @@
   set [dartx.f](value) {
     this.f = value;
   }
-  [dartx.flipX]() {
-    return this.flipX();
+  [dartx.flipX](...args) {
+    return this.flipX.apply(this, args);
   }
-  [dartx.flipY]() {
-    return this.flipY();
+  [dartx.flipY](...args) {
+    return this.flipY.apply(this, args);
   }
-  [dartx.inverse]() {
-    return this.inverse();
+  [dartx.inverse](...args) {
+    return this.inverse.apply(this, args);
   }
-  [dartx.multiply](secondMatrix) {
-    return this.multiply(secondMatrix);
+  [dartx.multiply](...args) {
+    return this.multiply.apply(this, args);
   }
-  [dartx.rotate](angle) {
-    return this.rotate(angle);
+  [dartx.rotate](...args) {
+    return this.rotate.apply(this, args);
   }
-  [dartx.rotateFromVector](x, y) {
-    return this.rotateFromVector(x, y);
+  [dartx.rotateFromVector](...args) {
+    return this.rotateFromVector.apply(this, args);
   }
-  [dartx.scale](scaleFactor) {
-    return this.scale(scaleFactor);
+  [dartx.scale](...args) {
+    return this.scale.apply(this, args);
   }
-  [dartx.scaleNonUniform](scaleFactorX, scaleFactorY) {
-    return this.scaleNonUniform(scaleFactorX, scaleFactorY);
+  [dartx.scaleNonUniform](...args) {
+    return this.scaleNonUniform.apply(this, args);
   }
-  [dartx.skewX](angle) {
-    return this.skewX(angle);
+  [dartx.skewX](...args) {
+    return this.skewX.apply(this, args);
   }
-  [dartx.skewY](angle) {
-    return this.skewY(angle);
+  [dartx.skewY](...args) {
+    return this.skewY.apply(this, args);
   }
-  [dartx.translate](x, y) {
-    return this.translate(x, y);
+  [dartx.translate](...args) {
+    return this.translate.apply(this, args);
   }
 };
 dart.setSignature(svg.Matrix, {
@@ -87026,8 +88872,8 @@
 dart.registerExtension(dart.global.SVGNumber, svg.Number);
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'length',
   'first',
   'last',
@@ -87052,11 +88898,11 @@
   get [dartx.numberOfItems]() {
     return this.numberOfItems;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
     return this[dartx.getItem](index);
   }
-  [dartx.set](index, value) {
+  [dartx._set](index, value) {
     dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
     return value;
   }
@@ -87085,31 +88931,31 @@
     dart.throw(new core.StateError("More than one element"));
   }
   [dartx.elementAt](index) {
-    return this[dartx.get](index);
+    return this[dartx._get](index);
   }
-  [__setter__](index, newItem) {
-    return this.__setter__(index, newItem);
+  [__setter__](...args) {
+    return this.__setter__.apply(this, args);
   }
-  [dartx.appendItem](newItem) {
-    return this.appendItem(newItem);
+  [dartx.appendItem](...args) {
+    return this.appendItem.apply(this, args);
   }
-  [dartx.clear]() {
-    return this.clear();
+  [dartx.clear](...args) {
+    return this.clear.apply(this, args);
   }
-  [dartx.getItem](index) {
-    return this.getItem(index);
+  [dartx.getItem](...args) {
+    return this.getItem.apply(this, args);
   }
-  [dartx.initialize](newItem) {
-    return this.initialize(newItem);
+  [dartx.initialize](...args) {
+    return this.initialize.apply(this, args);
   }
-  [dartx.insertItemBefore](newItem, index) {
-    return this.insertItemBefore(newItem, index);
+  [dartx.insertItemBefore](...args) {
+    return this.insertItemBefore.apply(this, args);
   }
-  [dartx.removeItem](index) {
-    return this.removeItem(index);
+  [dartx.removeItem](...args) {
+    return this.removeItem.apply(this, args);
   }
-  [dartx.replaceItem](newItem, index) {
-    return this.replaceItem(newItem, index);
+  [dartx.replaceItem](...args) {
+    return this.replaceItem.apply(this, args);
   }
 };
 svg.NumberList[dart.implements] = () => [ListOfNumber()];
@@ -87124,8 +88970,8 @@
   }),
   setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(svg.Number, [core.int]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, svg.Number]),
+    [dartx._get]: dart.definiteFunctionType(svg.Number, [core.int]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, svg.Number]),
     [dartx.elementAt]: dart.definiteFunctionType(svg.Number, [core.int]),
     [__setter__]: dart.definiteFunctionType(dart.void, [core.int, svg.Number]),
     [dartx.appendItem]: dart.definiteFunctionType(svg.Number, [svg.Number]),
@@ -87196,71 +89042,71 @@
   get [dartx.pathSegList]() {
     return this.pathSegList;
   }
-  [dartx.createSvgPathSegArcAbs](x, y, r1, r2, angle, largeArcFlag, sweepFlag) {
-    return this.createSVGPathSegArcAbs(x, y, r1, r2, angle, largeArcFlag, sweepFlag);
+  [dartx.createSvgPathSegArcAbs](...args) {
+    return this.createSVGPathSegArcAbs.apply(this, args);
   }
-  [dartx.createSvgPathSegArcRel](x, y, r1, r2, angle, largeArcFlag, sweepFlag) {
-    return this.createSVGPathSegArcRel(x, y, r1, r2, angle, largeArcFlag, sweepFlag);
+  [dartx.createSvgPathSegArcRel](...args) {
+    return this.createSVGPathSegArcRel.apply(this, args);
   }
-  [dartx.createSvgPathSegClosePath]() {
-    return this.createSVGPathSegClosePath();
+  [dartx.createSvgPathSegClosePath](...args) {
+    return this.createSVGPathSegClosePath.apply(this, args);
   }
-  [dartx.createSvgPathSegCurvetoCubicAbs](x, y, x1, y1, x2, y2) {
-    return this.createSVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2);
+  [dartx.createSvgPathSegCurvetoCubicAbs](...args) {
+    return this.createSVGPathSegCurvetoCubicAbs.apply(this, args);
   }
-  [dartx.createSvgPathSegCurvetoCubicRel](x, y, x1, y1, x2, y2) {
-    return this.createSVGPathSegCurvetoCubicRel(x, y, x1, y1, x2, y2);
+  [dartx.createSvgPathSegCurvetoCubicRel](...args) {
+    return this.createSVGPathSegCurvetoCubicRel.apply(this, args);
   }
-  [dartx.createSvgPathSegCurvetoCubicSmoothAbs](x, y, x2, y2) {
-    return this.createSVGPathSegCurvetoCubicSmoothAbs(x, y, x2, y2);
+  [dartx.createSvgPathSegCurvetoCubicSmoothAbs](...args) {
+    return this.createSVGPathSegCurvetoCubicSmoothAbs.apply(this, args);
   }
-  [dartx.createSvgPathSegCurvetoCubicSmoothRel](x, y, x2, y2) {
-    return this.createSVGPathSegCurvetoCubicSmoothRel(x, y, x2, y2);
+  [dartx.createSvgPathSegCurvetoCubicSmoothRel](...args) {
+    return this.createSVGPathSegCurvetoCubicSmoothRel.apply(this, args);
   }
-  [dartx.createSvgPathSegCurvetoQuadraticAbs](x, y, x1, y1) {
-    return this.createSVGPathSegCurvetoQuadraticAbs(x, y, x1, y1);
+  [dartx.createSvgPathSegCurvetoQuadraticAbs](...args) {
+    return this.createSVGPathSegCurvetoQuadraticAbs.apply(this, args);
   }
-  [dartx.createSvgPathSegCurvetoQuadraticRel](x, y, x1, y1) {
-    return this.createSVGPathSegCurvetoQuadraticRel(x, y, x1, y1);
+  [dartx.createSvgPathSegCurvetoQuadraticRel](...args) {
+    return this.createSVGPathSegCurvetoQuadraticRel.apply(this, args);
   }
-  [dartx.createSvgPathSegCurvetoQuadraticSmoothAbs](x, y) {
-    return this.createSVGPathSegCurvetoQuadraticSmoothAbs(x, y);
+  [dartx.createSvgPathSegCurvetoQuadraticSmoothAbs](...args) {
+    return this.createSVGPathSegCurvetoQuadraticSmoothAbs.apply(this, args);
   }
-  [dartx.createSvgPathSegCurvetoQuadraticSmoothRel](x, y) {
-    return this.createSVGPathSegCurvetoQuadraticSmoothRel(x, y);
+  [dartx.createSvgPathSegCurvetoQuadraticSmoothRel](...args) {
+    return this.createSVGPathSegCurvetoQuadraticSmoothRel.apply(this, args);
   }
-  [dartx.createSvgPathSegLinetoAbs](x, y) {
-    return this.createSVGPathSegLinetoAbs(x, y);
+  [dartx.createSvgPathSegLinetoAbs](...args) {
+    return this.createSVGPathSegLinetoAbs.apply(this, args);
   }
-  [dartx.createSvgPathSegLinetoHorizontalAbs](x) {
-    return this.createSVGPathSegLinetoHorizontalAbs(x);
+  [dartx.createSvgPathSegLinetoHorizontalAbs](...args) {
+    return this.createSVGPathSegLinetoHorizontalAbs.apply(this, args);
   }
-  [dartx.createSvgPathSegLinetoHorizontalRel](x) {
-    return this.createSVGPathSegLinetoHorizontalRel(x);
+  [dartx.createSvgPathSegLinetoHorizontalRel](...args) {
+    return this.createSVGPathSegLinetoHorizontalRel.apply(this, args);
   }
-  [dartx.createSvgPathSegLinetoRel](x, y) {
-    return this.createSVGPathSegLinetoRel(x, y);
+  [dartx.createSvgPathSegLinetoRel](...args) {
+    return this.createSVGPathSegLinetoRel.apply(this, args);
   }
-  [dartx.createSvgPathSegLinetoVerticalAbs](y) {
-    return this.createSVGPathSegLinetoVerticalAbs(y);
+  [dartx.createSvgPathSegLinetoVerticalAbs](...args) {
+    return this.createSVGPathSegLinetoVerticalAbs.apply(this, args);
   }
-  [dartx.createSvgPathSegLinetoVerticalRel](y) {
-    return this.createSVGPathSegLinetoVerticalRel(y);
+  [dartx.createSvgPathSegLinetoVerticalRel](...args) {
+    return this.createSVGPathSegLinetoVerticalRel.apply(this, args);
   }
-  [dartx.createSvgPathSegMovetoAbs](x, y) {
-    return this.createSVGPathSegMovetoAbs(x, y);
+  [dartx.createSvgPathSegMovetoAbs](...args) {
+    return this.createSVGPathSegMovetoAbs.apply(this, args);
   }
-  [dartx.createSvgPathSegMovetoRel](x, y) {
-    return this.createSVGPathSegMovetoRel(x, y);
+  [dartx.createSvgPathSegMovetoRel](...args) {
+    return this.createSVGPathSegMovetoRel.apply(this, args);
   }
-  [dartx.getPathSegAtLength](distance) {
-    return this.getPathSegAtLength(distance);
+  [dartx.getPathSegAtLength](...args) {
+    return this.getPathSegAtLength.apply(this, args);
   }
-  [dartx.getPointAtLength](distance) {
-    return this.getPointAtLength(distance);
+  [dartx.getPointAtLength](...args) {
+    return this.getPointAtLength.apply(this, args);
   }
-  [dartx.getTotalLength]() {
-    return this.getTotalLength();
+  [dartx.getTotalLength](...args) {
+    return this.getTotalLength.apply(this, args);
   }
 };
 dart.defineNamedConstructor(svg.PathElement, 'created');
@@ -88011,8 +89857,8 @@
 dart.registerExtension(dart.global.SVGPathSegLinetoVerticalRel, svg.PathSegLinetoVerticalRel);
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'length',
   'first',
   'last',
@@ -88037,11 +89883,11 @@
   get [dartx.numberOfItems]() {
     return this.numberOfItems;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
     return this[dartx.getItem](index);
   }
-  [dartx.set](index, value) {
+  [dartx._set](index, value) {
     dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
     return value;
   }
@@ -88070,31 +89916,31 @@
     dart.throw(new core.StateError("More than one element"));
   }
   [dartx.elementAt](index) {
-    return this[dartx.get](index);
+    return this[dartx._get](index);
   }
-  [__setter__](index, newItem) {
-    return this.__setter__(index, newItem);
+  [__setter__](...args) {
+    return this.__setter__.apply(this, args);
   }
-  [dartx.appendItem](newItem) {
-    return this.appendItem(newItem);
+  [dartx.appendItem](...args) {
+    return this.appendItem.apply(this, args);
   }
-  [dartx.clear]() {
-    return this.clear();
+  [dartx.clear](...args) {
+    return this.clear.apply(this, args);
   }
-  [dartx.getItem](index) {
-    return this.getItem(index);
+  [dartx.getItem](...args) {
+    return this.getItem.apply(this, args);
   }
-  [dartx.initialize](newItem) {
-    return this.initialize(newItem);
+  [dartx.initialize](...args) {
+    return this.initialize.apply(this, args);
   }
-  [dartx.insertItemBefore](newItem, index) {
-    return this.insertItemBefore(newItem, index);
+  [dartx.insertItemBefore](...args) {
+    return this.insertItemBefore.apply(this, args);
   }
-  [dartx.removeItem](index) {
-    return this.removeItem(index);
+  [dartx.removeItem](...args) {
+    return this.removeItem.apply(this, args);
   }
-  [dartx.replaceItem](newItem, index) {
-    return this.replaceItem(newItem, index);
+  [dartx.replaceItem](...args) {
+    return this.replaceItem.apply(this, args);
   }
 };
 svg.PathSegList[dart.implements] = () => [ListOfPathSeg()];
@@ -88109,8 +89955,8 @@
   }),
   setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(svg.PathSeg, [core.int]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, svg.PathSeg]),
+    [dartx._get]: dart.definiteFunctionType(svg.PathSeg, [core.int]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, svg.PathSeg]),
     [dartx.elementAt]: dart.definiteFunctionType(svg.PathSeg, [core.int]),
     [__setter__]: dart.definiteFunctionType(dart.void, [core.int, svg.PathSeg]),
     [dartx.appendItem]: dart.definiteFunctionType(svg.PathSeg, [svg.PathSeg]),
@@ -88255,8 +90101,8 @@
   get [dartx.systemLanguage]() {
     return this.systemLanguage;
   }
-  [dartx.hasExtension](extension) {
-    return this.hasExtension(extension);
+  [dartx.hasExtension](...args) {
+    return this.hasExtension.apply(this, args);
   }
   get [dartx.href]() {
     return this.href;
@@ -88309,8 +90155,8 @@
   set [dartx.y](value) {
     this.y = value;
   }
-  [dartx.matrixTransform](matrix) {
-    return this.matrixTransform(matrix);
+  [dartx.matrixTransform](...args) {
+    return this.matrixTransform.apply(this, args);
   }
 };
 dart.setSignature(svg.Point, {
@@ -88343,29 +90189,29 @@
   get [dartx.numberOfItems]() {
     return this.numberOfItems;
   }
-  [__setter__](index, newItem) {
-    return this.__setter__(index, newItem);
+  [__setter__](...args) {
+    return this.__setter__.apply(this, args);
   }
-  [dartx.appendItem](newItem) {
-    return this.appendItem(newItem);
+  [dartx.appendItem](...args) {
+    return this.appendItem.apply(this, args);
   }
-  [dartx.clear]() {
-    return this.clear();
+  [dartx.clear](...args) {
+    return this.clear.apply(this, args);
   }
-  [dartx.getItem](index) {
-    return this.getItem(index);
+  [dartx.getItem](...args) {
+    return this.getItem.apply(this, args);
   }
-  [dartx.initialize](newItem) {
-    return this.initialize(newItem);
+  [dartx.initialize](...args) {
+    return this.initialize.apply(this, args);
   }
-  [dartx.insertItemBefore](newItem, index) {
-    return this.insertItemBefore(newItem, index);
+  [dartx.insertItemBefore](...args) {
+    return this.insertItemBefore.apply(this, args);
   }
-  [dartx.removeItem](index) {
-    return this.removeItem(index);
+  [dartx.removeItem](...args) {
+    return this.removeItem.apply(this, args);
   }
-  [dartx.replaceItem](newItem, index) {
-    return this.replaceItem(newItem, index);
+  [dartx.replaceItem](...args) {
+    return this.replaceItem.apply(this, args);
   }
 };
 dart.setSignature(svg.PointList, {
@@ -88776,8 +90622,8 @@
 dart.registerExtension(dart.global.SVGStopElement, svg.StopElement);
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'length',
   'first',
   'last',
@@ -88802,11 +90648,11 @@
   get [dartx.numberOfItems]() {
     return this.numberOfItems;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
     return this[dartx.getItem](index);
   }
-  [dartx.set](index, value) {
+  [dartx._set](index, value) {
     dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
     return value;
   }
@@ -88835,31 +90681,31 @@
     dart.throw(new core.StateError("More than one element"));
   }
   [dartx.elementAt](index) {
-    return this[dartx.get](index);
+    return this[dartx._get](index);
   }
-  [__setter__](index, newItem) {
-    return this.__setter__(index, newItem);
+  [__setter__](...args) {
+    return this.__setter__.apply(this, args);
   }
-  [dartx.appendItem](newItem) {
-    return this.appendItem(newItem);
+  [dartx.appendItem](...args) {
+    return this.appendItem.apply(this, args);
   }
-  [dartx.clear]() {
-    return this.clear();
+  [dartx.clear](...args) {
+    return this.clear.apply(this, args);
   }
-  [dartx.getItem](index) {
-    return this.getItem(index);
+  [dartx.getItem](...args) {
+    return this.getItem.apply(this, args);
   }
-  [dartx.initialize](newItem) {
-    return this.initialize(newItem);
+  [dartx.initialize](...args) {
+    return this.initialize.apply(this, args);
   }
-  [dartx.insertItemBefore](item, index) {
-    return this.insertItemBefore(item, index);
+  [dartx.insertItemBefore](...args) {
+    return this.insertItemBefore.apply(this, args);
   }
-  [dartx.removeItem](index) {
-    return this.removeItem(index);
+  [dartx.removeItem](...args) {
+    return this.removeItem.apply(this, args);
   }
-  [dartx.replaceItem](newItem, index) {
-    return this.replaceItem(newItem, index);
+  [dartx.replaceItem](...args) {
+    return this.replaceItem.apply(this, args);
   }
 };
 svg.StringList[dart.implements] = () => [ListOfString()];
@@ -88874,8 +90720,8 @@
   }),
   setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(core.String, [core.int]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, core.String]),
+    [dartx._get]: dart.definiteFunctionType(core.String, [core.int]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, core.String]),
     [dartx.elementAt]: dart.definiteFunctionType(core.String, [core.int]),
     [__setter__]: dart.definiteFunctionType(dart.void, [core.int, core.String]),
     [dartx.appendItem]: dart.definiteFunctionType(core.String, [core.String]),
@@ -88950,7 +90796,7 @@
     this[_element] = element;
   }
   readClasses() {
-    let classname = this[_element][dartx.attributes][dartx.get]('class');
+    let classname = this[_element][dartx.attributes][dartx._get]('class');
     let s = LinkedHashSetOfString().new();
     if (classname == null) {
       return s;
@@ -88964,7 +90810,7 @@
     return s;
   }
   writeClasses(s) {
-    this[_element][dartx.attributes][dartx.set]('class', s.join(' '));
+    this[_element][dartx.attributes][dartx._set]('class', s.join(' '));
   }
 };
 dart.setSignature(svg._AttributeClassSet, {
@@ -89019,7 +90865,7 @@
 svg.SvgSvgElement = class SvgSvgElement extends svg.GraphicsElement {
   static new() {
     let el = svg.SvgElement.tag("svg");
-    el[dartx.attributes][dartx.set]('version', "1.1");
+    el[dartx.attributes][dartx._set]('version', "1.1");
     return svg.SvgSvgElement._check(el);
   }
   static _() {
@@ -89086,74 +90932,74 @@
   get [dartx.y]() {
     return this.y;
   }
-  [dartx.animationsPaused]() {
-    return this.animationsPaused();
+  [dartx.animationsPaused](...args) {
+    return this.animationsPaused.apply(this, args);
   }
-  [dartx.checkEnclosure](element, rect) {
-    return this.checkEnclosure(element, rect);
+  [dartx.checkEnclosure](...args) {
+    return this.checkEnclosure.apply(this, args);
   }
-  [dartx.checkIntersection](element, rect) {
-    return this.checkIntersection(element, rect);
+  [dartx.checkIntersection](...args) {
+    return this.checkIntersection.apply(this, args);
   }
-  [dartx.createSvgAngle]() {
-    return this.createSVGAngle();
+  [dartx.createSvgAngle](...args) {
+    return this.createSVGAngle.apply(this, args);
   }
-  [dartx.createSvgLength]() {
-    return this.createSVGLength();
+  [dartx.createSvgLength](...args) {
+    return this.createSVGLength.apply(this, args);
   }
-  [dartx.createSvgMatrix]() {
-    return this.createSVGMatrix();
+  [dartx.createSvgMatrix](...args) {
+    return this.createSVGMatrix.apply(this, args);
   }
-  [dartx.createSvgNumber]() {
-    return this.createSVGNumber();
+  [dartx.createSvgNumber](...args) {
+    return this.createSVGNumber.apply(this, args);
   }
-  [dartx.createSvgPoint]() {
-    return this.createSVGPoint();
+  [dartx.createSvgPoint](...args) {
+    return this.createSVGPoint.apply(this, args);
   }
-  [dartx.createSvgRect]() {
-    return this.createSVGRect();
+  [dartx.createSvgRect](...args) {
+    return this.createSVGRect.apply(this, args);
   }
-  [dartx.createSvgTransform]() {
-    return this.createSVGTransform();
+  [dartx.createSvgTransform](...args) {
+    return this.createSVGTransform.apply(this, args);
   }
-  [dartx.createSvgTransformFromMatrix](matrix) {
-    return this.createSVGTransformFromMatrix(matrix);
+  [dartx.createSvgTransformFromMatrix](...args) {
+    return this.createSVGTransformFromMatrix.apply(this, args);
   }
-  [dartx.deselectAll]() {
-    return this.deselectAll();
+  [dartx.deselectAll](...args) {
+    return this.deselectAll.apply(this, args);
   }
-  [dartx.forceRedraw]() {
-    return this.forceRedraw();
+  [dartx.forceRedraw](...args) {
+    return this.forceRedraw.apply(this, args);
   }
-  [dartx.getCurrentTime]() {
-    return this.getCurrentTime();
+  [dartx.getCurrentTime](...args) {
+    return this.getCurrentTime.apply(this, args);
   }
-  [dartx.getElementById](elementId) {
-    return this.getElementById(elementId);
+  [dartx.getElementById](...args) {
+    return this.getElementById.apply(this, args);
   }
-  [dartx.getEnclosureList](rect, referenceElement) {
-    return this.getEnclosureList(rect, referenceElement);
+  [dartx.getEnclosureList](...args) {
+    return this.getEnclosureList.apply(this, args);
   }
-  [dartx.getIntersectionList](rect, referenceElement) {
-    return this.getIntersectionList(rect, referenceElement);
+  [dartx.getIntersectionList](...args) {
+    return this.getIntersectionList.apply(this, args);
   }
-  [dartx.pauseAnimations]() {
-    return this.pauseAnimations();
+  [dartx.pauseAnimations](...args) {
+    return this.pauseAnimations.apply(this, args);
   }
-  [dartx.setCurrentTime](seconds) {
-    return this.setCurrentTime(seconds);
+  [dartx.setCurrentTime](...args) {
+    return this.setCurrentTime.apply(this, args);
   }
-  [dartx.suspendRedraw](maxWaitMilliseconds) {
-    return this.suspendRedraw(maxWaitMilliseconds);
+  [dartx.suspendRedraw](...args) {
+    return this.suspendRedraw.apply(this, args);
   }
-  [dartx.unpauseAnimations]() {
-    return this.unpauseAnimations();
+  [dartx.unpauseAnimations](...args) {
+    return this.unpauseAnimations.apply(this, args);
   }
-  [dartx.unsuspendRedraw](suspendHandleId) {
-    return this.unsuspendRedraw(suspendHandleId);
+  [dartx.unsuspendRedraw](...args) {
+    return this.unsuspendRedraw.apply(this, args);
   }
-  [dartx.unsuspendRedrawAll]() {
-    return this.unsuspendRedrawAll();
+  [dartx.unsuspendRedrawAll](...args) {
+    return this.unsuspendRedrawAll.apply(this, args);
   }
   get [dartx.preserveAspectRatio]() {
     return this.preserveAspectRatio;
@@ -89306,32 +91152,32 @@
   get [dartx.textLength]() {
     return this.textLength;
   }
-  [dartx.getCharNumAtPosition](point) {
-    return this.getCharNumAtPosition(point);
+  [dartx.getCharNumAtPosition](...args) {
+    return this.getCharNumAtPosition.apply(this, args);
   }
-  [dartx.getComputedTextLength]() {
-    return this.getComputedTextLength();
+  [dartx.getComputedTextLength](...args) {
+    return this.getComputedTextLength.apply(this, args);
   }
-  [dartx.getEndPositionOfChar](charnum) {
-    return this.getEndPositionOfChar(charnum);
+  [dartx.getEndPositionOfChar](...args) {
+    return this.getEndPositionOfChar.apply(this, args);
   }
-  [dartx.getExtentOfChar](charnum) {
-    return this.getExtentOfChar(charnum);
+  [dartx.getExtentOfChar](...args) {
+    return this.getExtentOfChar.apply(this, args);
   }
-  [dartx.getNumberOfChars]() {
-    return this.getNumberOfChars();
+  [dartx.getNumberOfChars](...args) {
+    return this.getNumberOfChars.apply(this, args);
   }
-  [dartx.getRotationOfChar](charnum) {
-    return this.getRotationOfChar(charnum);
+  [dartx.getRotationOfChar](...args) {
+    return this.getRotationOfChar.apply(this, args);
   }
-  [dartx.getStartPositionOfChar](charnum) {
-    return this.getStartPositionOfChar(charnum);
+  [dartx.getStartPositionOfChar](...args) {
+    return this.getStartPositionOfChar.apply(this, args);
   }
-  [dartx.getSubStringLength](charnum, nchars) {
-    return this.getSubStringLength(charnum, nchars);
+  [dartx.getSubStringLength](...args) {
+    return this.getSubStringLength.apply(this, args);
   }
-  [dartx.selectSubString](charnum, nchars) {
-    return this.selectSubString(charnum, nchars);
+  [dartx.selectSubString](...args) {
+    return this.selectSubString.apply(this, args);
   }
 };
 dart.defineNamedConstructor(svg.TextContentElement, 'created');
@@ -89444,7 +91290,28 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
+  get requiredExtensions() {
+    return this[requiredExtensions];
+  }
+  set requiredExtensions(value) {
+    super.requiredExtensions = value;
+  }
+  get requiredFeatures() {
+    return this[requiredFeatures];
+  }
+  set requiredFeatures(value) {
+    super.requiredFeatures = value;
+  }
+  get systemLanguage() {
+    return this[systemLanguage];
+  }
+  set systemLanguage(value) {
+    super.systemLanguage = value;
+  }
 };
+const requiredExtensions = Symbol(svg.Tests.name + "." + 'requiredExtensions'.toString());
+const requiredFeatures = Symbol(svg.Tests.name + "." + 'requiredFeatures'.toString());
+const systemLanguage = Symbol(svg.Tests.name + "." + 'systemLanguage'.toString());
 dart.setSignature(svg.Tests, {
   constructors: () => ({_: dart.definiteFunctionType(svg.Tests, [])}),
   fields: () => ({
@@ -89577,23 +91444,23 @@
   get [dartx.type]() {
     return this.type;
   }
-  [dartx.setMatrix](matrix) {
-    return this.setMatrix(matrix);
+  [dartx.setMatrix](...args) {
+    return this.setMatrix.apply(this, args);
   }
-  [dartx.setRotate](angle, cx, cy) {
-    return this.setRotate(angle, cx, cy);
+  [dartx.setRotate](...args) {
+    return this.setRotate.apply(this, args);
   }
-  [dartx.setScale](sx, sy) {
-    return this.setScale(sx, sy);
+  [dartx.setScale](...args) {
+    return this.setScale.apply(this, args);
   }
-  [dartx.setSkewX](angle) {
-    return this.setSkewX(angle);
+  [dartx.setSkewX](...args) {
+    return this.setSkewX.apply(this, args);
   }
-  [dartx.setSkewY](angle) {
-    return this.setSkewY(angle);
+  [dartx.setSkewY](...args) {
+    return this.setSkewY.apply(this, args);
   }
-  [dartx.setTranslate](tx, ty) {
-    return this.setTranslate(tx, ty);
+  [dartx.setTranslate](...args) {
+    return this.setTranslate.apply(this, args);
   }
 };
 dart.setSignature(svg.Transform, {
@@ -89631,8 +91498,8 @@
 dart.registerExtension(dart.global.SVGTransform, svg.Transform);
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'length',
   'first',
   'last',
@@ -89659,11 +91526,11 @@
   get [dartx.numberOfItems]() {
     return this.numberOfItems;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
     return this[dartx.getItem](index);
   }
-  [dartx.set](index, value) {
+  [dartx._set](index, value) {
     dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
     return value;
   }
@@ -89692,37 +91559,37 @@
     dart.throw(new core.StateError("More than one element"));
   }
   [dartx.elementAt](index) {
-    return this[dartx.get](index);
+    return this[dartx._get](index);
   }
-  [__setter__](index, newItem) {
-    return this.__setter__(index, newItem);
+  [__setter__](...args) {
+    return this.__setter__.apply(this, args);
   }
-  [dartx.appendItem](newItem) {
-    return this.appendItem(newItem);
+  [dartx.appendItem](...args) {
+    return this.appendItem.apply(this, args);
   }
-  [dartx.clear]() {
-    return this.clear();
+  [dartx.clear](...args) {
+    return this.clear.apply(this, args);
   }
-  [dartx.consolidate]() {
-    return this.consolidate();
+  [dartx.consolidate](...args) {
+    return this.consolidate.apply(this, args);
   }
-  [dartx.createSvgTransformFromMatrix](matrix) {
-    return this.createSVGTransformFromMatrix(matrix);
+  [dartx.createSvgTransformFromMatrix](...args) {
+    return this.createSVGTransformFromMatrix.apply(this, args);
   }
-  [dartx.getItem](index) {
-    return this.getItem(index);
+  [dartx.getItem](...args) {
+    return this.getItem.apply(this, args);
   }
-  [dartx.initialize](newItem) {
-    return this.initialize(newItem);
+  [dartx.initialize](...args) {
+    return this.initialize.apply(this, args);
   }
-  [dartx.insertItemBefore](newItem, index) {
-    return this.insertItemBefore(newItem, index);
+  [dartx.insertItemBefore](...args) {
+    return this.insertItemBefore.apply(this, args);
   }
-  [dartx.removeItem](index) {
-    return this.removeItem(index);
+  [dartx.removeItem](...args) {
+    return this.removeItem.apply(this, args);
   }
-  [dartx.replaceItem](newItem, index) {
-    return this.replaceItem(newItem, index);
+  [dartx.replaceItem](...args) {
+    return this.replaceItem.apply(this, args);
   }
 };
 svg.TransformList[dart.implements] = () => [ListOfTransform()];
@@ -89737,8 +91604,8 @@
   }),
   setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(svg.Transform, [core.int]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, svg.Transform]),
+    [dartx._get]: dart.definiteFunctionType(svg.Transform, [core.int]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, svg.Transform]),
     [dartx.elementAt]: dart.definiteFunctionType(svg.Transform, [core.int]),
     [__setter__]: dart.definiteFunctionType(dart.void, [core.int, svg.Transform]),
     [dartx.appendItem]: dart.definiteFunctionType(svg.Transform, [svg.Transform]),
@@ -89776,7 +91643,14 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
+  get href() {
+    return this[href];
+  }
+  set href(value) {
+    super.href = value;
+  }
 };
+const href = Symbol(svg.UriReference.name + "." + 'href'.toString());
 dart.setSignature(svg.UriReference, {
   constructors: () => ({_: dart.definiteFunctionType(svg.UriReference, [])}),
   fields: () => ({href: svg.AnimatedString})
@@ -89958,7 +91832,14 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
+  get zoomAndPan() {
+    return this[zoomAndPan];
+  }
+  set zoomAndPan(value) {
+    this[zoomAndPan] = value;
+  }
 };
+const zoomAndPan = Symbol(svg.ZoomAndPan.name + "." + 'zoomAndPan'.toString());
 dart.setSignature(svg.ZoomAndPan, {
   constructors: () => ({_: dart.definiteFunctionType(svg.ZoomAndPan, [])}),
   fields: () => ({zoomAndPan: core.int}),
@@ -90116,11 +91997,11 @@
   get [dartx.numberOfOutputs]() {
     return this.numberOfOutputs;
   }
-  [_connect](destination, output, input) {
-    return this.connect(destination, output, input);
+  [_connect](...args) {
+    return this.connect.apply(this, args);
   }
-  [dartx.disconnect](output) {
-    return this.disconnect(output);
+  [dartx.disconnect](...args) {
+    return this.disconnect.apply(this, args);
   }
   [dartx.connectNode](destination, output, input) {
     if (output === void 0) output = 0;
@@ -90192,17 +92073,17 @@
   set [dartx.smoothingTimeConstant](value) {
     this.smoothingTimeConstant = value;
   }
-  [dartx.getByteFrequencyData](array) {
-    return this.getByteFrequencyData(array);
+  [dartx.getByteFrequencyData](...args) {
+    return this.getByteFrequencyData.apply(this, args);
   }
-  [dartx.getByteTimeDomainData](array) {
-    return this.getByteTimeDomainData(array);
+  [dartx.getByteTimeDomainData](...args) {
+    return this.getByteTimeDomainData.apply(this, args);
   }
-  [dartx.getFloatFrequencyData](array) {
-    return this.getFloatFrequencyData(array);
+  [dartx.getFloatFrequencyData](...args) {
+    return this.getFloatFrequencyData.apply(this, args);
   }
-  [dartx.getFloatTimeDomainData](array) {
-    return this.getFloatTimeDomainData(array);
+  [dartx.getFloatTimeDomainData](...args) {
+    return this.getFloatTimeDomainData.apply(this, args);
   }
 };
 dart.setSignature(web_audio.AnalyserNode, {
@@ -90222,6 +92103,7 @@
   })
 });
 dart.registerExtension(dart.global.AnalyserNode, web_audio.AnalyserNode);
+dart.registerExtension(dart.global.RealtimeAnalyserNode, web_audio.AnalyserNode);
 dart.defineExtensionNames([
   'getChannelData',
   'duration',
@@ -90245,8 +92127,8 @@
   get [dartx.sampleRate]() {
     return this.sampleRate;
   }
-  [dartx.getChannelData](channelIndex) {
-    return this.getChannelData(channelIndex);
+  [dartx.getChannelData](...args) {
+    return this.getChannelData.apply(this, args);
   }
 };
 dart.setSignature(web_audio.AudioBuffer, {
@@ -90408,59 +92290,59 @@
   get [dartx.sampleRate]() {
     return this.sampleRate;
   }
-  [dartx.createAnalyser]() {
-    return this.createAnalyser();
+  [dartx.createAnalyser](...args) {
+    return this.createAnalyser.apply(this, args);
   }
-  [dartx.createBiquadFilter]() {
-    return this.createBiquadFilter();
+  [dartx.createBiquadFilter](...args) {
+    return this.createBiquadFilter.apply(this, args);
   }
-  [dartx.createBuffer](numberOfChannels, numberOfFrames, sampleRate) {
-    return this.createBuffer(numberOfChannels, numberOfFrames, sampleRate);
+  [dartx.createBuffer](...args) {
+    return this.createBuffer.apply(this, args);
   }
-  [dartx.createBufferSource]() {
-    return this.createBufferSource();
+  [dartx.createBufferSource](...args) {
+    return this.createBufferSource.apply(this, args);
   }
-  [dartx.createChannelMerger](numberOfInputs) {
-    return this.createChannelMerger(numberOfInputs);
+  [dartx.createChannelMerger](...args) {
+    return this.createChannelMerger.apply(this, args);
   }
-  [dartx.createChannelSplitter](numberOfOutputs) {
-    return this.createChannelSplitter(numberOfOutputs);
+  [dartx.createChannelSplitter](...args) {
+    return this.createChannelSplitter.apply(this, args);
   }
-  [dartx.createConvolver]() {
-    return this.createConvolver();
+  [dartx.createConvolver](...args) {
+    return this.createConvolver.apply(this, args);
   }
-  [dartx.createDelay](maxDelayTime) {
-    return this.createDelay(maxDelayTime);
+  [dartx.createDelay](...args) {
+    return this.createDelay.apply(this, args);
   }
-  [dartx.createDynamicsCompressor]() {
-    return this.createDynamicsCompressor();
+  [dartx.createDynamicsCompressor](...args) {
+    return this.createDynamicsCompressor.apply(this, args);
   }
-  [dartx.createMediaElementSource](mediaElement) {
-    return this.createMediaElementSource(mediaElement);
+  [dartx.createMediaElementSource](...args) {
+    return this.createMediaElementSource.apply(this, args);
   }
-  [dartx.createMediaStreamDestination]() {
-    return this.createMediaStreamDestination();
+  [dartx.createMediaStreamDestination](...args) {
+    return this.createMediaStreamDestination.apply(this, args);
   }
-  [dartx.createMediaStreamSource](mediaStream) {
-    return this.createMediaStreamSource(mediaStream);
+  [dartx.createMediaStreamSource](...args) {
+    return this.createMediaStreamSource.apply(this, args);
   }
-  [dartx.createOscillator]() {
-    return this.createOscillator();
+  [dartx.createOscillator](...args) {
+    return this.createOscillator.apply(this, args);
   }
-  [dartx.createPanner]() {
-    return this.createPanner();
+  [dartx.createPanner](...args) {
+    return this.createPanner.apply(this, args);
   }
-  [dartx.createPeriodicWave](real, imag) {
-    return this.createPeriodicWave(real, imag);
+  [dartx.createPeriodicWave](...args) {
+    return this.createPeriodicWave.apply(this, args);
   }
-  [dartx.createWaveShaper]() {
-    return this.createWaveShaper();
+  [dartx.createWaveShaper](...args) {
+    return this.createWaveShaper.apply(this, args);
   }
-  [_decodeAudioData](audioData, successCallback, errorCallback) {
-    return this.decodeAudioData(audioData, successCallback, errorCallback);
+  [_decodeAudioData](...args) {
+    return this.decodeAudioData.apply(this, args);
   }
-  [dartx.startRendering]() {
-    return this.startRendering();
+  [dartx.startRendering](...args) {
+    return this.startRendering.apply(this, args);
   }
   get [dartx.onComplete]() {
     return web_audio.AudioContext.completeEvent.forTarget(this);
@@ -90541,6 +92423,7 @@
 });
 web_audio.AudioContext.completeEvent = dart.const(new (EventStreamProviderOfEvent())('complete'));
 dart.registerExtension(dart.global.AudioContext, web_audio.AudioContext);
+dart.registerExtension(dart.global.webkitAudioContext, web_audio.AudioContext);
 dart.defineExtensionNames([
   'maxChannelCount'
 ]);
@@ -90580,14 +92463,14 @@
   set [dartx.speedOfSound](value) {
     this.speedOfSound = value;
   }
-  [dartx.setOrientation](x, y, z, xUp, yUp, zUp) {
-    return this.setOrientation(x, y, z, xUp, yUp, zUp);
+  [dartx.setOrientation](...args) {
+    return this.setOrientation.apply(this, args);
   }
-  [dartx.setPosition](x, y, z) {
-    return this.setPosition(x, y, z);
+  [dartx.setPosition](...args) {
+    return this.setPosition.apply(this, args);
   }
-  [dartx.setVelocity](x, y, z) {
-    return this.setVelocity(x, y, z);
+  [dartx.setVelocity](...args) {
+    return this.setVelocity.apply(this, args);
   }
 };
 dart.setSignature(web_audio.AudioListener, {
@@ -90626,23 +92509,23 @@
   set [dartx.value](value) {
     this.value = value;
   }
-  [dartx.cancelScheduledValues](startTime) {
-    return this.cancelScheduledValues(startTime);
+  [dartx.cancelScheduledValues](...args) {
+    return this.cancelScheduledValues.apply(this, args);
   }
-  [dartx.exponentialRampToValueAtTime](value, time) {
-    return this.exponentialRampToValueAtTime(value, time);
+  [dartx.exponentialRampToValueAtTime](...args) {
+    return this.exponentialRampToValueAtTime.apply(this, args);
   }
-  [dartx.linearRampToValueAtTime](value, time) {
-    return this.linearRampToValueAtTime(value, time);
+  [dartx.linearRampToValueAtTime](...args) {
+    return this.linearRampToValueAtTime.apply(this, args);
   }
-  [dartx.setTargetAtTime](target, time, timeConstant) {
-    return this.setTargetAtTime(target, time, timeConstant);
+  [dartx.setTargetAtTime](...args) {
+    return this.setTargetAtTime.apply(this, args);
   }
-  [dartx.setValueAtTime](value, time) {
-    return this.setValueAtTime(value, time);
+  [dartx.setValueAtTime](...args) {
+    return this.setValueAtTime.apply(this, args);
   }
-  [dartx.setValueCurveAtTime](values, time, duration) {
-    return this.setValueCurveAtTime(values, time, duration);
+  [dartx.setValueCurveAtTime](...args) {
+    return this.setValueCurveAtTime.apply(this, args);
   }
 };
 dart.setSignature(web_audio.AudioParam, {
@@ -90719,8 +92602,8 @@
   set [dartx.type](value) {
     this.type = value;
   }
-  [dartx.getFrequencyResponse](frequencyHz, magResponse, phaseResponse) {
-    return this.getFrequencyResponse(frequencyHz, magResponse, phaseResponse);
+  [dartx.getFrequencyResponse](...args) {
+    return this.getFrequencyResponse.apply(this, args);
   }
 };
 dart.setSignature(web_audio.BiquadFilterNode, {
@@ -90744,6 +92627,7 @@
   constructors: () => ({_: dart.definiteFunctionType(web_audio.ChannelMergerNode, [])})
 });
 dart.registerExtension(dart.global.ChannelMergerNode, web_audio.ChannelMergerNode);
+dart.registerExtension(dart.global.AudioChannelMerger, web_audio.ChannelMergerNode);
 web_audio.ChannelSplitterNode = class ChannelSplitterNode extends web_audio.AudioNode {
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
@@ -90753,6 +92637,7 @@
   constructors: () => ({_: dart.definiteFunctionType(web_audio.ChannelSplitterNode, [])})
 });
 dart.registerExtension(dart.global.ChannelSplitterNode, web_audio.ChannelSplitterNode);
+dart.registerExtension(dart.global.AudioChannelSplitter, web_audio.ChannelSplitterNode);
 dart.defineExtensionNames([
   'buffer',
   'normalize'
@@ -90857,6 +92742,7 @@
   fields: () => ({[dartx.gain]: web_audio.AudioParam})
 });
 dart.registerExtension(dart.global.GainNode, web_audio.GainNode);
+dart.registerExtension(dart.global.AudioGainNode, web_audio.GainNode);
 dart.defineExtensionNames([
   'mediaElement'
 ]);
@@ -90968,20 +92854,20 @@
   set [dartx.type](value) {
     this.type = value;
   }
-  [dartx.noteOff](when) {
-    return this.noteOff(when);
+  [dartx.noteOff](...args) {
+    return this.noteOff.apply(this, args);
   }
-  [dartx.noteOn](when) {
-    return this.noteOn(when);
+  [dartx.noteOn](...args) {
+    return this.noteOn.apply(this, args);
   }
-  [dartx.setPeriodicWave](periodicWave) {
-    return this.setPeriodicWave(periodicWave);
+  [dartx.setPeriodicWave](...args) {
+    return this.setPeriodicWave.apply(this, args);
   }
-  [dartx.start](when) {
-    return this.start(when);
+  [dartx.start](...args) {
+    return this.start.apply(this, args);
   }
-  [dartx.stop](when) {
-    return this.stop(when);
+  [dartx.stop](...args) {
+    return this.stop.apply(this, args);
   }
   get [dartx.onEnded]() {
     return web_audio.OscillatorNode.endedEvent.forTarget(this);
@@ -91006,6 +92892,7 @@
 });
 web_audio.OscillatorNode.endedEvent = dart.const(new (EventStreamProviderOfEvent())('ended'));
 dart.registerExtension(dart.global.OscillatorNode, web_audio.OscillatorNode);
+dart.registerExtension(dart.global.Oscillator, web_audio.OscillatorNode);
 dart.defineExtensionNames([
   'setOrientation',
   'setPosition',
@@ -91071,14 +92958,14 @@
   set [dartx.rolloffFactor](value) {
     this.rolloffFactor = value;
   }
-  [dartx.setOrientation](x, y, z) {
-    return this.setOrientation(x, y, z);
+  [dartx.setOrientation](...args) {
+    return this.setOrientation.apply(this, args);
   }
-  [dartx.setPosition](x, y, z) {
-    return this.setPosition(x, y, z);
+  [dartx.setPosition](...args) {
+    return this.setPosition.apply(this, args);
   }
-  [dartx.setVelocity](x, y, z) {
-    return this.setVelocity(x, y, z);
+  [dartx.setVelocity](...args) {
+    return this.setVelocity.apply(this, args);
   }
 };
 dart.setSignature(web_audio.PannerNode, {
@@ -91100,6 +92987,8 @@
   })
 });
 dart.registerExtension(dart.global.PannerNode, web_audio.PannerNode);
+dart.registerExtension(dart.global.AudioPannerNode, web_audio.PannerNode);
+dart.registerExtension(dart.global.webkitAudioPannerNode, web_audio.PannerNode);
 web_audio.PeriodicWave = class PeriodicWave extends _interceptors.Interceptor {
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
@@ -91121,8 +93010,8 @@
   get [dartx.bufferSize]() {
     return this.bufferSize;
   }
-  [dartx.setEventListener](eventListener) {
-    return this.setEventListener(eventListener);
+  [dartx.setEventListener](...args) {
+    return this.setEventListener.apply(this, args);
   }
   get [dartx.onAudioProcess]() {
     return web_audio.ScriptProcessorNode.audioProcessEvent.forTarget(this);
@@ -91137,6 +93026,7 @@
 });
 web_audio.ScriptProcessorNode.audioProcessEvent = dart.const(new (EventStreamProviderOfAudioProcessingEvent())('audioprocess'));
 dart.registerExtension(dart.global.ScriptProcessorNode, web_audio.ScriptProcessorNode);
+dart.registerExtension(dart.global.JavaScriptAudioNode, web_audio.ScriptProcessorNode);
 dart.defineExtensionNames([
   'curve',
   'oversample'
@@ -91352,323 +93242,323 @@
   get [dartx.drawingBufferWidth]() {
     return this.drawingBufferWidth;
   }
-  [dartx.activeTexture](texture) {
-    return this.activeTexture(texture);
+  [dartx.activeTexture](...args) {
+    return this.activeTexture.apply(this, args);
   }
-  [dartx.attachShader](program, shader) {
-    return this.attachShader(program, shader);
+  [dartx.attachShader](...args) {
+    return this.attachShader.apply(this, args);
   }
-  [dartx.bindAttribLocation](program, index, name) {
-    return this.bindAttribLocation(program, index, name);
+  [dartx.bindAttribLocation](...args) {
+    return this.bindAttribLocation.apply(this, args);
   }
-  [dartx.bindBuffer](target, buffer) {
-    return this.bindBuffer(target, buffer);
+  [dartx.bindBuffer](...args) {
+    return this.bindBuffer.apply(this, args);
   }
-  [dartx.bindFramebuffer](target, framebuffer) {
-    return this.bindFramebuffer(target, framebuffer);
+  [dartx.bindFramebuffer](...args) {
+    return this.bindFramebuffer.apply(this, args);
   }
-  [dartx.bindRenderbuffer](target, renderbuffer) {
-    return this.bindRenderbuffer(target, renderbuffer);
+  [dartx.bindRenderbuffer](...args) {
+    return this.bindRenderbuffer.apply(this, args);
   }
-  [dartx.bindTexture](target, texture) {
-    return this.bindTexture(target, texture);
+  [dartx.bindTexture](...args) {
+    return this.bindTexture.apply(this, args);
   }
-  [dartx.blendColor](red, green, blue, alpha) {
-    return this.blendColor(red, green, blue, alpha);
+  [dartx.blendColor](...args) {
+    return this.blendColor.apply(this, args);
   }
-  [dartx.blendEquation](mode) {
-    return this.blendEquation(mode);
+  [dartx.blendEquation](...args) {
+    return this.blendEquation.apply(this, args);
   }
-  [dartx.blendEquationSeparate](modeRGB, modeAlpha) {
-    return this.blendEquationSeparate(modeRGB, modeAlpha);
+  [dartx.blendEquationSeparate](...args) {
+    return this.blendEquationSeparate.apply(this, args);
   }
-  [dartx.blendFunc](sfactor, dfactor) {
-    return this.blendFunc(sfactor, dfactor);
+  [dartx.blendFunc](...args) {
+    return this.blendFunc.apply(this, args);
   }
-  [dartx.blendFuncSeparate](srcRGB, dstRGB, srcAlpha, dstAlpha) {
-    return this.blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
+  [dartx.blendFuncSeparate](...args) {
+    return this.blendFuncSeparate.apply(this, args);
   }
-  [dartx.bufferByteData](target, data, usage) {
-    return this.bufferData(target, data, usage);
+  [dartx.bufferByteData](...args) {
+    return this.bufferData.apply(this, args);
   }
-  [dartx.bufferData](target, data_OR_size, usage) {
-    return this.bufferData(target, data_OR_size, usage);
+  [dartx.bufferData](...args) {
+    return this.bufferData.apply(this, args);
   }
-  [dartx.bufferDataTyped](target, data, usage) {
-    return this.bufferData(target, data, usage);
+  [dartx.bufferDataTyped](...args) {
+    return this.bufferData.apply(this, args);
   }
-  [dartx.bufferSubByteData](target, offset, data) {
-    return this.bufferSubData(target, offset, data);
+  [dartx.bufferSubByteData](...args) {
+    return this.bufferSubData.apply(this, args);
   }
-  [dartx.bufferSubData](target, offset, data) {
-    return this.bufferSubData(target, offset, data);
+  [dartx.bufferSubData](...args) {
+    return this.bufferSubData.apply(this, args);
   }
-  [dartx.bufferSubDataTyped](target, offset, data) {
-    return this.bufferSubData(target, offset, data);
+  [dartx.bufferSubDataTyped](...args) {
+    return this.bufferSubData.apply(this, args);
   }
-  [dartx.checkFramebufferStatus](target) {
-    return this.checkFramebufferStatus(target);
+  [dartx.checkFramebufferStatus](...args) {
+    return this.checkFramebufferStatus.apply(this, args);
   }
-  [dartx.clear](mask) {
-    return this.clear(mask);
+  [dartx.clear](...args) {
+    return this.clear.apply(this, args);
   }
-  [dartx.clearColor](red, green, blue, alpha) {
-    return this.clearColor(red, green, blue, alpha);
+  [dartx.clearColor](...args) {
+    return this.clearColor.apply(this, args);
   }
-  [dartx.clearDepth](depth) {
-    return this.clearDepth(depth);
+  [dartx.clearDepth](...args) {
+    return this.clearDepth.apply(this, args);
   }
-  [dartx.clearStencil](s) {
-    return this.clearStencil(s);
+  [dartx.clearStencil](...args) {
+    return this.clearStencil.apply(this, args);
   }
-  [dartx.colorMask](red, green, blue, alpha) {
-    return this.colorMask(red, green, blue, alpha);
+  [dartx.colorMask](...args) {
+    return this.colorMask.apply(this, args);
   }
-  [dartx.compileShader](shader) {
-    return this.compileShader(shader);
+  [dartx.compileShader](...args) {
+    return this.compileShader.apply(this, args);
   }
-  [dartx.compressedTexImage2D](target, level, internalformat, width, height, border, data) {
-    return this.compressedTexImage2D(target, level, internalformat, width, height, border, data);
+  [dartx.compressedTexImage2D](...args) {
+    return this.compressedTexImage2D.apply(this, args);
   }
-  [dartx.compressedTexSubImage2D](target, level, xoffset, yoffset, width, height, format, data) {
-    return this.compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, data);
+  [dartx.compressedTexSubImage2D](...args) {
+    return this.compressedTexSubImage2D.apply(this, args);
   }
-  [dartx.copyTexImage2D](target, level, internalformat, x, y, width, height, border) {
-    return this.copyTexImage2D(target, level, internalformat, x, y, width, height, border);
+  [dartx.copyTexImage2D](...args) {
+    return this.copyTexImage2D.apply(this, args);
   }
-  [dartx.copyTexSubImage2D](target, level, xoffset, yoffset, x, y, width, height) {
-    return this.copyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
+  [dartx.copyTexSubImage2D](...args) {
+    return this.copyTexSubImage2D.apply(this, args);
   }
-  [dartx.createBuffer]() {
-    return this.createBuffer();
+  [dartx.createBuffer](...args) {
+    return this.createBuffer.apply(this, args);
   }
-  [dartx.createFramebuffer]() {
-    return this.createFramebuffer();
+  [dartx.createFramebuffer](...args) {
+    return this.createFramebuffer.apply(this, args);
   }
-  [dartx.createProgram]() {
-    return this.createProgram();
+  [dartx.createProgram](...args) {
+    return this.createProgram.apply(this, args);
   }
-  [dartx.createRenderbuffer]() {
-    return this.createRenderbuffer();
+  [dartx.createRenderbuffer](...args) {
+    return this.createRenderbuffer.apply(this, args);
   }
-  [dartx.createShader](type) {
-    return this.createShader(type);
+  [dartx.createShader](...args) {
+    return this.createShader.apply(this, args);
   }
-  [dartx.createTexture]() {
-    return this.createTexture();
+  [dartx.createTexture](...args) {
+    return this.createTexture.apply(this, args);
   }
-  [dartx.cullFace](mode) {
-    return this.cullFace(mode);
+  [dartx.cullFace](...args) {
+    return this.cullFace.apply(this, args);
   }
-  [dartx.deleteBuffer](buffer) {
-    return this.deleteBuffer(buffer);
+  [dartx.deleteBuffer](...args) {
+    return this.deleteBuffer.apply(this, args);
   }
-  [dartx.deleteFramebuffer](framebuffer) {
-    return this.deleteFramebuffer(framebuffer);
+  [dartx.deleteFramebuffer](...args) {
+    return this.deleteFramebuffer.apply(this, args);
   }
-  [dartx.deleteProgram](program) {
-    return this.deleteProgram(program);
+  [dartx.deleteProgram](...args) {
+    return this.deleteProgram.apply(this, args);
   }
-  [dartx.deleteRenderbuffer](renderbuffer) {
-    return this.deleteRenderbuffer(renderbuffer);
+  [dartx.deleteRenderbuffer](...args) {
+    return this.deleteRenderbuffer.apply(this, args);
   }
-  [dartx.deleteShader](shader) {
-    return this.deleteShader(shader);
+  [dartx.deleteShader](...args) {
+    return this.deleteShader.apply(this, args);
   }
-  [dartx.deleteTexture](texture) {
-    return this.deleteTexture(texture);
+  [dartx.deleteTexture](...args) {
+    return this.deleteTexture.apply(this, args);
   }
-  [dartx.depthFunc](func) {
-    return this.depthFunc(func);
+  [dartx.depthFunc](...args) {
+    return this.depthFunc.apply(this, args);
   }
-  [dartx.depthMask](flag) {
-    return this.depthMask(flag);
+  [dartx.depthMask](...args) {
+    return this.depthMask.apply(this, args);
   }
-  [dartx.depthRange](zNear, zFar) {
-    return this.depthRange(zNear, zFar);
+  [dartx.depthRange](...args) {
+    return this.depthRange.apply(this, args);
   }
-  [dartx.detachShader](program, shader) {
-    return this.detachShader(program, shader);
+  [dartx.detachShader](...args) {
+    return this.detachShader.apply(this, args);
   }
-  [dartx.disable](cap) {
-    return this.disable(cap);
+  [dartx.disable](...args) {
+    return this.disable.apply(this, args);
   }
-  [dartx.disableVertexAttribArray](index) {
-    return this.disableVertexAttribArray(index);
+  [dartx.disableVertexAttribArray](...args) {
+    return this.disableVertexAttribArray.apply(this, args);
   }
-  [dartx.drawArrays](mode, first, count) {
-    return this.drawArrays(mode, first, count);
+  [dartx.drawArrays](...args) {
+    return this.drawArrays.apply(this, args);
   }
-  [dartx.drawElements](mode, count, type, offset) {
-    return this.drawElements(mode, count, type, offset);
+  [dartx.drawElements](...args) {
+    return this.drawElements.apply(this, args);
   }
-  [dartx.enable](cap) {
-    return this.enable(cap);
+  [dartx.enable](...args) {
+    return this.enable.apply(this, args);
   }
-  [dartx.enableVertexAttribArray](index) {
-    return this.enableVertexAttribArray(index);
+  [dartx.enableVertexAttribArray](...args) {
+    return this.enableVertexAttribArray.apply(this, args);
   }
-  [dartx.finish]() {
-    return this.finish();
+  [dartx.finish](...args) {
+    return this.finish.apply(this, args);
   }
-  [dartx.flush]() {
-    return this.flush();
+  [dartx.flush](...args) {
+    return this.flush.apply(this, args);
   }
-  [dartx.framebufferRenderbuffer](target, attachment, renderbuffertarget, renderbuffer) {
-    return this.framebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
+  [dartx.framebufferRenderbuffer](...args) {
+    return this.framebufferRenderbuffer.apply(this, args);
   }
-  [dartx.framebufferTexture2D](target, attachment, textarget, texture, level) {
-    return this.framebufferTexture2D(target, attachment, textarget, texture, level);
+  [dartx.framebufferTexture2D](...args) {
+    return this.framebufferTexture2D.apply(this, args);
   }
-  [dartx.frontFace](mode) {
-    return this.frontFace(mode);
+  [dartx.frontFace](...args) {
+    return this.frontFace.apply(this, args);
   }
-  [dartx.generateMipmap](target) {
-    return this.generateMipmap(target);
+  [dartx.generateMipmap](...args) {
+    return this.generateMipmap.apply(this, args);
   }
-  [dartx.getActiveAttrib](program, index) {
-    return this.getActiveAttrib(program, index);
+  [dartx.getActiveAttrib](...args) {
+    return this.getActiveAttrib.apply(this, args);
   }
-  [dartx.getActiveUniform](program, index) {
-    return this.getActiveUniform(program, index);
+  [dartx.getActiveUniform](...args) {
+    return this.getActiveUniform.apply(this, args);
   }
-  [dartx.getAttachedShaders](program) {
-    return this.getAttachedShaders(program);
+  [dartx.getAttachedShaders](...args) {
+    return this.getAttachedShaders.apply(this, args);
   }
-  [dartx.getAttribLocation](program, name) {
-    return this.getAttribLocation(program, name);
+  [dartx.getAttribLocation](...args) {
+    return this.getAttribLocation.apply(this, args);
   }
-  [dartx.getBufferParameter](target, pname) {
-    return this.getBufferParameter(target, pname);
+  [dartx.getBufferParameter](...args) {
+    return this.getBufferParameter.apply(this, args);
   }
   [dartx.getContextAttributes]() {
     return web_gl.ContextAttributes._check(html_common.convertNativeToDart_ContextAttributes(this[_getContextAttributes_1]()));
   }
-  [_getContextAttributes_1]() {
-    return this.getContextAttributes();
+  [_getContextAttributes_1](...args) {
+    return this.getContextAttributes.apply(this, args);
   }
-  [dartx.getError]() {
-    return this.getError();
+  [dartx.getError](...args) {
+    return this.getError.apply(this, args);
   }
-  [dartx.getExtension](name) {
-    return this.getExtension(name);
+  [dartx.getExtension](...args) {
+    return this.getExtension.apply(this, args);
   }
-  [dartx.getFramebufferAttachmentParameter](target, attachment, pname) {
-    return this.getFramebufferAttachmentParameter(target, attachment, pname);
+  [dartx.getFramebufferAttachmentParameter](...args) {
+    return this.getFramebufferAttachmentParameter.apply(this, args);
   }
-  [dartx.getParameter](pname) {
-    return this.getParameter(pname);
+  [dartx.getParameter](...args) {
+    return this.getParameter.apply(this, args);
   }
-  [dartx.getProgramInfoLog](program) {
-    return this.getProgramInfoLog(program);
+  [dartx.getProgramInfoLog](...args) {
+    return this.getProgramInfoLog.apply(this, args);
   }
-  [dartx.getProgramParameter](program, pname) {
-    return this.getProgramParameter(program, pname);
+  [dartx.getProgramParameter](...args) {
+    return this.getProgramParameter.apply(this, args);
   }
-  [dartx.getRenderbufferParameter](target, pname) {
-    return this.getRenderbufferParameter(target, pname);
+  [dartx.getRenderbufferParameter](...args) {
+    return this.getRenderbufferParameter.apply(this, args);
   }
-  [dartx.getShaderInfoLog](shader) {
-    return this.getShaderInfoLog(shader);
+  [dartx.getShaderInfoLog](...args) {
+    return this.getShaderInfoLog.apply(this, args);
   }
-  [dartx.getShaderParameter](shader, pname) {
-    return this.getShaderParameter(shader, pname);
+  [dartx.getShaderParameter](...args) {
+    return this.getShaderParameter.apply(this, args);
   }
-  [dartx.getShaderPrecisionFormat](shadertype, precisiontype) {
-    return this.getShaderPrecisionFormat(shadertype, precisiontype);
+  [dartx.getShaderPrecisionFormat](...args) {
+    return this.getShaderPrecisionFormat.apply(this, args);
   }
-  [dartx.getShaderSource](shader) {
-    return this.getShaderSource(shader);
+  [dartx.getShaderSource](...args) {
+    return this.getShaderSource.apply(this, args);
   }
-  [dartx.getSupportedExtensions]() {
-    return this.getSupportedExtensions();
+  [dartx.getSupportedExtensions](...args) {
+    return this.getSupportedExtensions.apply(this, args);
   }
-  [dartx.getTexParameter](target, pname) {
-    return this.getTexParameter(target, pname);
+  [dartx.getTexParameter](...args) {
+    return this.getTexParameter.apply(this, args);
   }
-  [dartx.getUniform](program, location) {
-    return this.getUniform(program, location);
+  [dartx.getUniform](...args) {
+    return this.getUniform.apply(this, args);
   }
-  [dartx.getUniformLocation](program, name) {
-    return this.getUniformLocation(program, name);
+  [dartx.getUniformLocation](...args) {
+    return this.getUniformLocation.apply(this, args);
   }
-  [dartx.getVertexAttrib](index, pname) {
-    return this.getVertexAttrib(index, pname);
+  [dartx.getVertexAttrib](...args) {
+    return this.getVertexAttrib.apply(this, args);
   }
-  [dartx.getVertexAttribOffset](index, pname) {
-    return this.getVertexAttribOffset(index, pname);
+  [dartx.getVertexAttribOffset](...args) {
+    return this.getVertexAttribOffset.apply(this, args);
   }
-  [dartx.hint](target, mode) {
-    return this.hint(target, mode);
+  [dartx.hint](...args) {
+    return this.hint.apply(this, args);
   }
-  [dartx.isBuffer](buffer) {
-    return this.isBuffer(buffer);
+  [dartx.isBuffer](...args) {
+    return this.isBuffer.apply(this, args);
   }
-  [dartx.isContextLost]() {
-    return this.isContextLost();
+  [dartx.isContextLost](...args) {
+    return this.isContextLost.apply(this, args);
   }
-  [dartx.isEnabled](cap) {
-    return this.isEnabled(cap);
+  [dartx.isEnabled](...args) {
+    return this.isEnabled.apply(this, args);
   }
-  [dartx.isFramebuffer](framebuffer) {
-    return this.isFramebuffer(framebuffer);
+  [dartx.isFramebuffer](...args) {
+    return this.isFramebuffer.apply(this, args);
   }
-  [dartx.isProgram](program) {
-    return this.isProgram(program);
+  [dartx.isProgram](...args) {
+    return this.isProgram.apply(this, args);
   }
-  [dartx.isRenderbuffer](renderbuffer) {
-    return this.isRenderbuffer(renderbuffer);
+  [dartx.isRenderbuffer](...args) {
+    return this.isRenderbuffer.apply(this, args);
   }
-  [dartx.isShader](shader) {
-    return this.isShader(shader);
+  [dartx.isShader](...args) {
+    return this.isShader.apply(this, args);
   }
-  [dartx.isTexture](texture) {
-    return this.isTexture(texture);
+  [dartx.isTexture](...args) {
+    return this.isTexture.apply(this, args);
   }
-  [dartx.lineWidth](width) {
-    return this.lineWidth(width);
+  [dartx.lineWidth](...args) {
+    return this.lineWidth.apply(this, args);
   }
-  [dartx.linkProgram](program) {
-    return this.linkProgram(program);
+  [dartx.linkProgram](...args) {
+    return this.linkProgram.apply(this, args);
   }
-  [dartx.pixelStorei](pname, param) {
-    return this.pixelStorei(pname, param);
+  [dartx.pixelStorei](...args) {
+    return this.pixelStorei.apply(this, args);
   }
-  [dartx.polygonOffset](factor, units) {
-    return this.polygonOffset(factor, units);
+  [dartx.polygonOffset](...args) {
+    return this.polygonOffset.apply(this, args);
   }
-  [dartx.readPixels](x, y, width, height, format, type, pixels) {
-    return this.readPixels(x, y, width, height, format, type, pixels);
+  [dartx.readPixels](...args) {
+    return this.readPixels.apply(this, args);
   }
-  [dartx.renderbufferStorage](target, internalformat, width, height) {
-    return this.renderbufferStorage(target, internalformat, width, height);
+  [dartx.renderbufferStorage](...args) {
+    return this.renderbufferStorage.apply(this, args);
   }
-  [dartx.sampleCoverage](value, invert) {
-    return this.sampleCoverage(value, invert);
+  [dartx.sampleCoverage](...args) {
+    return this.sampleCoverage.apply(this, args);
   }
-  [dartx.scissor](x, y, width, height) {
-    return this.scissor(x, y, width, height);
+  [dartx.scissor](...args) {
+    return this.scissor.apply(this, args);
   }
-  [dartx.shaderSource](shader, string) {
-    return this.shaderSource(shader, string);
+  [dartx.shaderSource](...args) {
+    return this.shaderSource.apply(this, args);
   }
-  [dartx.stencilFunc](func, ref, mask) {
-    return this.stencilFunc(func, ref, mask);
+  [dartx.stencilFunc](...args) {
+    return this.stencilFunc.apply(this, args);
   }
-  [dartx.stencilFuncSeparate](face, func, ref, mask) {
-    return this.stencilFuncSeparate(face, func, ref, mask);
+  [dartx.stencilFuncSeparate](...args) {
+    return this.stencilFuncSeparate.apply(this, args);
   }
-  [dartx.stencilMask](mask) {
-    return this.stencilMask(mask);
+  [dartx.stencilMask](...args) {
+    return this.stencilMask.apply(this, args);
   }
-  [dartx.stencilMaskSeparate](face, mask) {
-    return this.stencilMaskSeparate(face, mask);
+  [dartx.stencilMaskSeparate](...args) {
+    return this.stencilMaskSeparate.apply(this, args);
   }
-  [dartx.stencilOp](fail, zfail, zpass) {
-    return this.stencilOp(fail, zfail, zpass);
+  [dartx.stencilOp](...args) {
+    return this.stencilOp.apply(this, args);
   }
-  [dartx.stencilOpSeparate](face, fail, zfail, zpass) {
-    return this.stencilOpSeparate(face, fail, zfail, zpass);
+  [dartx.stencilOpSeparate](...args) {
+    return this.stencilOpSeparate.apply(this, args);
   }
   [dartx.texImage2D](target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video, format, type, pixels) {
     if (format === void 0) format = null;
@@ -91697,43 +93587,43 @@
     }
     dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
   }
-  [_texImage2D_1](target, level, internalformat, width, height, border, format, type, pixels) {
-    return this.texImage2D(target, level, internalformat, width, height, border, format, type, pixels);
+  [_texImage2D_1](...args) {
+    return this.texImage2D.apply(this, args);
   }
-  [_texImage2D_2](target, level, internalformat, format, type, pixels) {
-    return this.texImage2D(target, level, internalformat, format, type, pixels);
+  [_texImage2D_2](...args) {
+    return this.texImage2D.apply(this, args);
   }
-  [_texImage2D_3](target, level, internalformat, format, type, image) {
-    return this.texImage2D(target, level, internalformat, format, type, image);
+  [_texImage2D_3](...args) {
+    return this.texImage2D.apply(this, args);
   }
-  [_texImage2D_4](target, level, internalformat, format, type, canvas) {
-    return this.texImage2D(target, level, internalformat, format, type, canvas);
+  [_texImage2D_4](...args) {
+    return this.texImage2D.apply(this, args);
   }
-  [_texImage2D_5](target, level, internalformat, format, type, video) {
-    return this.texImage2D(target, level, internalformat, format, type, video);
+  [_texImage2D_5](...args) {
+    return this.texImage2D.apply(this, args);
   }
-  [dartx.texImage2DCanvas](target, level, internalformat, format, type, canvas) {
-    return this.texImage2D(target, level, internalformat, format, type, canvas);
+  [dartx.texImage2DCanvas](...args) {
+    return this.texImage2D.apply(this, args);
   }
-  [dartx.texImage2DImage](target, level, internalformat, format, type, image) {
-    return this.texImage2D(target, level, internalformat, format, type, image);
+  [dartx.texImage2DImage](...args) {
+    return this.texImage2D.apply(this, args);
   }
   [dartx.texImage2DImageData](target, level, internalformat, format, type, pixels) {
     let pixels_1 = html_common.convertDartToNative_ImageData(pixels);
     this[_texImage2DImageData_1](target, level, internalformat, format, type, pixels_1);
     return;
   }
-  [_texImage2DImageData_1](target, level, internalformat, format, type, pixels) {
-    return this.texImage2D(target, level, internalformat, format, type, pixels);
+  [_texImage2DImageData_1](...args) {
+    return this.texImage2D.apply(this, args);
   }
-  [dartx.texImage2DVideo](target, level, internalformat, format, type, video) {
-    return this.texImage2D(target, level, internalformat, format, type, video);
+  [dartx.texImage2DVideo](...args) {
+    return this.texImage2D.apply(this, args);
   }
-  [dartx.texParameterf](target, pname, param) {
-    return this.texParameterf(target, pname, param);
+  [dartx.texParameterf](...args) {
+    return this.texParameterf.apply(this, args);
   }
-  [dartx.texParameteri](target, pname, param) {
-    return this.texParameteri(target, pname, param);
+  [dartx.texParameteri](...args) {
+    return this.texParameteri.apply(this, args);
   }
   [dartx.texSubImage2D](target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, type, pixels) {
     if (type === void 0) type = null;
@@ -91761,142 +93651,142 @@
     }
     dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
   }
-  [_texSubImage2D_1](target, level, xoffset, yoffset, width, height, format, type, pixels) {
-    return this.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
+  [_texSubImage2D_1](...args) {
+    return this.texSubImage2D.apply(this, args);
   }
-  [_texSubImage2D_2](target, level, xoffset, yoffset, format, type, pixels) {
-    return this.texSubImage2D(target, level, xoffset, yoffset, format, type, pixels);
+  [_texSubImage2D_2](...args) {
+    return this.texSubImage2D.apply(this, args);
   }
-  [_texSubImage2D_3](target, level, xoffset, yoffset, format, type, image) {
-    return this.texSubImage2D(target, level, xoffset, yoffset, format, type, image);
+  [_texSubImage2D_3](...args) {
+    return this.texSubImage2D.apply(this, args);
   }
-  [_texSubImage2D_4](target, level, xoffset, yoffset, format, type, canvas) {
-    return this.texSubImage2D(target, level, xoffset, yoffset, format, type, canvas);
+  [_texSubImage2D_4](...args) {
+    return this.texSubImage2D.apply(this, args);
   }
-  [_texSubImage2D_5](target, level, xoffset, yoffset, format, type, video) {
-    return this.texSubImage2D(target, level, xoffset, yoffset, format, type, video);
+  [_texSubImage2D_5](...args) {
+    return this.texSubImage2D.apply(this, args);
   }
-  [dartx.texSubImage2DCanvas](target, level, xoffset, yoffset, format, type, canvas) {
-    return this.texSubImage2D(target, level, xoffset, yoffset, format, type, canvas);
+  [dartx.texSubImage2DCanvas](...args) {
+    return this.texSubImage2D.apply(this, args);
   }
-  [dartx.texSubImage2DImage](target, level, xoffset, yoffset, format, type, image) {
-    return this.texSubImage2D(target, level, xoffset, yoffset, format, type, image);
+  [dartx.texSubImage2DImage](...args) {
+    return this.texSubImage2D.apply(this, args);
   }
   [dartx.texSubImage2DImageData](target, level, xoffset, yoffset, format, type, pixels) {
     let pixels_1 = html_common.convertDartToNative_ImageData(pixels);
     this[_texSubImage2DImageData_1](target, level, xoffset, yoffset, format, type, pixels_1);
     return;
   }
-  [_texSubImage2DImageData_1](target, level, xoffset, yoffset, format, type, pixels) {
-    return this.texSubImage2D(target, level, xoffset, yoffset, format, type, pixels);
+  [_texSubImage2DImageData_1](...args) {
+    return this.texSubImage2D.apply(this, args);
   }
-  [dartx.texSubImage2DVideo](target, level, xoffset, yoffset, format, type, video) {
-    return this.texSubImage2D(target, level, xoffset, yoffset, format, type, video);
+  [dartx.texSubImage2DVideo](...args) {
+    return this.texSubImage2D.apply(this, args);
   }
-  [dartx.uniform1f](location, x) {
-    return this.uniform1f(location, x);
+  [dartx.uniform1f](...args) {
+    return this.uniform1f.apply(this, args);
   }
-  [dartx.uniform1fv](location, v) {
-    return this.uniform1fv(location, v);
+  [dartx.uniform1fv](...args) {
+    return this.uniform1fv.apply(this, args);
   }
-  [dartx.uniform1i](location, x) {
-    return this.uniform1i(location, x);
+  [dartx.uniform1i](...args) {
+    return this.uniform1i.apply(this, args);
   }
-  [dartx.uniform1iv](location, v) {
-    return this.uniform1iv(location, v);
+  [dartx.uniform1iv](...args) {
+    return this.uniform1iv.apply(this, args);
   }
-  [dartx.uniform2f](location, x, y) {
-    return this.uniform2f(location, x, y);
+  [dartx.uniform2f](...args) {
+    return this.uniform2f.apply(this, args);
   }
-  [dartx.uniform2fv](location, v) {
-    return this.uniform2fv(location, v);
+  [dartx.uniform2fv](...args) {
+    return this.uniform2fv.apply(this, args);
   }
-  [dartx.uniform2i](location, x, y) {
-    return this.uniform2i(location, x, y);
+  [dartx.uniform2i](...args) {
+    return this.uniform2i.apply(this, args);
   }
-  [dartx.uniform2iv](location, v) {
-    return this.uniform2iv(location, v);
+  [dartx.uniform2iv](...args) {
+    return this.uniform2iv.apply(this, args);
   }
-  [dartx.uniform3f](location, x, y, z) {
-    return this.uniform3f(location, x, y, z);
+  [dartx.uniform3f](...args) {
+    return this.uniform3f.apply(this, args);
   }
-  [dartx.uniform3fv](location, v) {
-    return this.uniform3fv(location, v);
+  [dartx.uniform3fv](...args) {
+    return this.uniform3fv.apply(this, args);
   }
-  [dartx.uniform3i](location, x, y, z) {
-    return this.uniform3i(location, x, y, z);
+  [dartx.uniform3i](...args) {
+    return this.uniform3i.apply(this, args);
   }
-  [dartx.uniform3iv](location, v) {
-    return this.uniform3iv(location, v);
+  [dartx.uniform3iv](...args) {
+    return this.uniform3iv.apply(this, args);
   }
-  [dartx.uniform4f](location, x, y, z, w) {
-    return this.uniform4f(location, x, y, z, w);
+  [dartx.uniform4f](...args) {
+    return this.uniform4f.apply(this, args);
   }
-  [dartx.uniform4fv](location, v) {
-    return this.uniform4fv(location, v);
+  [dartx.uniform4fv](...args) {
+    return this.uniform4fv.apply(this, args);
   }
-  [dartx.uniform4i](location, x, y, z, w) {
-    return this.uniform4i(location, x, y, z, w);
+  [dartx.uniform4i](...args) {
+    return this.uniform4i.apply(this, args);
   }
-  [dartx.uniform4iv](location, v) {
-    return this.uniform4iv(location, v);
+  [dartx.uniform4iv](...args) {
+    return this.uniform4iv.apply(this, args);
   }
-  [dartx.uniformMatrix2fv](location, transpose, array) {
-    return this.uniformMatrix2fv(location, transpose, array);
+  [dartx.uniformMatrix2fv](...args) {
+    return this.uniformMatrix2fv.apply(this, args);
   }
-  [dartx.uniformMatrix3fv](location, transpose, array) {
-    return this.uniformMatrix3fv(location, transpose, array);
+  [dartx.uniformMatrix3fv](...args) {
+    return this.uniformMatrix3fv.apply(this, args);
   }
-  [dartx.uniformMatrix4fv](location, transpose, array) {
-    return this.uniformMatrix4fv(location, transpose, array);
+  [dartx.uniformMatrix4fv](...args) {
+    return this.uniformMatrix4fv.apply(this, args);
   }
-  [dartx.useProgram](program) {
-    return this.useProgram(program);
+  [dartx.useProgram](...args) {
+    return this.useProgram.apply(this, args);
   }
-  [dartx.validateProgram](program) {
-    return this.validateProgram(program);
+  [dartx.validateProgram](...args) {
+    return this.validateProgram.apply(this, args);
   }
-  [dartx.vertexAttrib1f](indx, x) {
-    return this.vertexAttrib1f(indx, x);
+  [dartx.vertexAttrib1f](...args) {
+    return this.vertexAttrib1f.apply(this, args);
   }
-  [dartx.vertexAttrib1fv](indx, values) {
-    return this.vertexAttrib1fv(indx, values);
+  [dartx.vertexAttrib1fv](...args) {
+    return this.vertexAttrib1fv.apply(this, args);
   }
-  [dartx.vertexAttrib2f](indx, x, y) {
-    return this.vertexAttrib2f(indx, x, y);
+  [dartx.vertexAttrib2f](...args) {
+    return this.vertexAttrib2f.apply(this, args);
   }
-  [dartx.vertexAttrib2fv](indx, values) {
-    return this.vertexAttrib2fv(indx, values);
+  [dartx.vertexAttrib2fv](...args) {
+    return this.vertexAttrib2fv.apply(this, args);
   }
-  [dartx.vertexAttrib3f](indx, x, y, z) {
-    return this.vertexAttrib3f(indx, x, y, z);
+  [dartx.vertexAttrib3f](...args) {
+    return this.vertexAttrib3f.apply(this, args);
   }
-  [dartx.vertexAttrib3fv](indx, values) {
-    return this.vertexAttrib3fv(indx, values);
+  [dartx.vertexAttrib3fv](...args) {
+    return this.vertexAttrib3fv.apply(this, args);
   }
-  [dartx.vertexAttrib4f](indx, x, y, z, w) {
-    return this.vertexAttrib4f(indx, x, y, z, w);
+  [dartx.vertexAttrib4f](...args) {
+    return this.vertexAttrib4f.apply(this, args);
   }
-  [dartx.vertexAttrib4fv](indx, values) {
-    return this.vertexAttrib4fv(indx, values);
+  [dartx.vertexAttrib4fv](...args) {
+    return this.vertexAttrib4fv.apply(this, args);
   }
-  [dartx.vertexAttribPointer](indx, size, type, normalized, stride, offset) {
-    return this.vertexAttribPointer(indx, size, type, normalized, stride, offset);
+  [dartx.vertexAttribPointer](...args) {
+    return this.vertexAttribPointer.apply(this, args);
   }
-  [dartx.viewport](x, y, width, height) {
-    return this.viewport(x, y, width, height);
+  [dartx.viewport](...args) {
+    return this.viewport.apply(this, args);
   }
-  [dartx.texImage2DUntyped](targetTexture, levelOfDetail, internalFormat, format, type, data) {
-    return this.texImage2D(targetTexture, levelOfDetail, internalFormat, format, type, data);
+  [dartx.texImage2DUntyped](...args) {
+    return this.texImage2D.apply(this, args);
   }
-  [dartx.texImage2DTyped](targetTexture, levelOfDetail, internalFormat, width, height, border, format, type, data) {
-    return this.texImage2D(targetTexture, levelOfDetail, internalFormat, width, height, border, format, type, data);
+  [dartx.texImage2DTyped](...args) {
+    return this.texImage2D.apply(this, args);
   }
-  [dartx.texSubImage2DUntyped](targetTexture, levelOfDetail, xOffset, yOffset, format, type, data) {
-    return this.texSubImage2D(targetTexture, levelOfDetail, xOffset, yOffset, format, type, data);
+  [dartx.texSubImage2DUntyped](...args) {
+    return this.texSubImage2D.apply(this, args);
   }
-  [dartx.texSubImage2DTyped](targetTexture, levelOfDetail, xOffset, yOffset, width, height, border, format, type, data) {
-    return this.texSubImage2D(targetTexture, levelOfDetail, xOffset, yOffset, width, height, border, format, type, data);
+  [dartx.texSubImage2DTyped](...args) {
+    return this.texSubImage2D.apply(this, args);
   }
 };
 web_gl.RenderingContext[dart.implements] = () => [html.CanvasRenderingContext];
@@ -93017,14 +94907,14 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.drawArraysInstancedAngle](mode, first, count, primcount) {
-    return this.drawArraysInstancedANGLE(mode, first, count, primcount);
+  [dartx.drawArraysInstancedAngle](...args) {
+    return this.drawArraysInstancedANGLE.apply(this, args);
   }
-  [dartx.drawElementsInstancedAngle](mode, count, type, offset, primcount) {
-    return this.drawElementsInstancedANGLE(mode, count, type, offset, primcount);
+  [dartx.drawElementsInstancedAngle](...args) {
+    return this.drawElementsInstancedANGLE.apply(this, args);
   }
-  [dartx.vertexAttribDivisorAngle](index, divisor) {
-    return this.vertexAttribDivisorANGLE(index, divisor);
+  [dartx.vertexAttribDivisorAngle](...args) {
+    return this.vertexAttribDivisorANGLE.apply(this, args);
   }
 };
 dart.setSignature(web_gl.AngleInstancedArrays, {
@@ -93220,8 +95110,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.getTranslatedShaderSource](shader) {
-    return this.getTranslatedShaderSource(shader);
+  [dartx.getTranslatedShaderSource](...args) {
+    return this.getTranslatedShaderSource.apply(this, args);
   }
 };
 dart.setSignature(web_gl.DebugShaders, {
@@ -93247,8 +95137,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.drawBuffersWebgl](buffers) {
-    return this.drawBuffersWEBGL(buffers);
+  [dartx.drawBuffersWebgl](...args) {
+    return this.drawBuffersWEBGL.apply(this, args);
   }
 };
 dart.setSignature(web_gl.DrawBuffers, {
@@ -93391,11 +95281,11 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.loseContext]() {
-    return this.loseContext();
+  [dartx.loseContext](...args) {
+    return this.loseContext.apply(this, args);
   }
-  [dartx.restoreContext]() {
-    return this.restoreContext();
+  [dartx.restoreContext](...args) {
+    return this.restoreContext.apply(this, args);
   }
 };
 dart.setSignature(web_gl.LoseContext, {
@@ -93406,6 +95296,7 @@
   })
 });
 dart.registerExtension(dart.global.WebGLLoseContext, web_gl.LoseContext);
+dart.registerExtension(dart.global.WebGLExtensionLoseContext, web_gl.LoseContext);
 web_gl.OesElementIndexUint = class OesElementIndexUint extends _interceptors.Interceptor {
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
@@ -93463,17 +95354,17 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.bindVertexArray](arrayObject) {
-    return this.bindVertexArrayOES(arrayObject);
+  [dartx.bindVertexArray](...args) {
+    return this.bindVertexArrayOES.apply(this, args);
   }
-  [dartx.createVertexArray]() {
-    return this.createVertexArrayOES();
+  [dartx.createVertexArray](...args) {
+    return this.createVertexArrayOES.apply(this, args);
   }
-  [dartx.deleteVertexArray](arrayObject) {
-    return this.deleteVertexArrayOES(arrayObject);
+  [dartx.deleteVertexArray](...args) {
+    return this.deleteVertexArrayOES.apply(this, args);
   }
-  [dartx.isVertexArray](arrayObject) {
-    return this.isVertexArrayOES(arrayObject);
+  [dartx.isVertexArray](...args) {
+    return this.isVertexArrayOES.apply(this, args);
   }
 };
 dart.setSignature(web_gl.OesVertexArrayObject, {
@@ -93598,14 +95489,14 @@
   get [dartx.version]() {
     return this.version;
   }
-  [dartx.changeVersion](oldVersion, newVersion, callback, errorCallback, successCallback) {
-    return this.changeVersion(oldVersion, newVersion, callback, errorCallback, successCallback);
+  [dartx.changeVersion](...args) {
+    return this.changeVersion.apply(this, args);
   }
-  [dartx.readTransaction](callback, errorCallback, successCallback) {
-    return this.readTransaction(callback, errorCallback, successCallback);
+  [dartx.readTransaction](...args) {
+    return this.readTransaction.apply(this, args);
   }
-  [dartx.transaction](callback, errorCallback, successCallback) {
-    return this.transaction(callback, errorCallback, successCallback);
+  [dartx.transaction](...args) {
+    return this.transaction.apply(this, args);
   }
 };
 dart.setSignature(web_sql.SqlDatabase, {
@@ -93691,8 +95582,8 @@
 const _item_1 = Symbol('_item_1');
 dart.defineExtensionNames([
   'length',
-  'get',
-  'set',
+  '_get',
+  '_set',
   'length',
   'first',
   'last',
@@ -93707,11 +95598,11 @@
   get [dartx.length]() {
     return this.length;
   }
-  [dartx.get](index) {
+  [dartx._get](index) {
     if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
     return this[dartx.item](index);
   }
-  [dartx.set](index, value) {
+  [dartx._set](index, value) {
     dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
     return value;
   }
@@ -93740,13 +95631,13 @@
     dart.throw(new core.StateError("More than one element"));
   }
   [dartx.elementAt](index) {
-    return this[dartx.get](index);
+    return this[dartx._get](index);
   }
   [dartx.item](index) {
     return html_common.convertNativeToDart_Dictionary(this[_item_1](index));
   }
-  [_item_1](index) {
-    return this.item(index);
+  [_item_1](...args) {
+    return this.item.apply(this, args);
   }
 };
 web_sql.SqlResultSetRowList[dart.implements] = () => [ListOfMap()];
@@ -93760,8 +95651,8 @@
   }),
   setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
   methods: () => ({
-    [dartx.get]: dart.definiteFunctionType(core.Map, [core.int]),
-    [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, core.Map]),
+    [dartx._get]: dart.definiteFunctionType(core.Map, [core.int]),
+    [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, core.Map]),
     [dartx.elementAt]: dart.definiteFunctionType(core.Map, [core.int]),
     [dartx.item]: dart.definiteFunctionType(core.Map, [core.int]),
     [_item_1]: dart.definiteFunctionType(dart.dynamic, [dart.dynamic])
@@ -93775,8 +95666,8 @@
   static _() {
     dart.throw(new core.UnsupportedError("Not supported"));
   }
-  [dartx.executeSql](sqlStatement, arguments$, callback, errorCallback) {
-    return this.executeSql(sqlStatement, arguments$, callback, errorCallback);
+  [dartx.executeSql](...args) {
+    return this.executeSql.apply(this, args);
   }
 };
 dart.setSignature(web_sql.SqlTransaction, {
diff --git a/pkg/dev_compiler/lib/js/legacy/dart_library.js b/pkg/dev_compiler/lib/js/legacy/dart_library.js
index 3b766c2..d8dfd96 100644
--- a/pkg/dev_compiler/lib/js/legacy/dart_library.js
+++ b/pkg/dev_compiler/lib/js/legacy/dart_library.js
@@ -135,9 +135,16 @@
       // Expose constructors for DOM types dart:html needs to assume are
       // available on window.
       if (typeof PannerNode == "undefined") {
-        let audioContext = new AudioContext();
+        let audioContext;
+        if (typeof AudioContext == "undefined" &&
+            (typeof webkitAudioContext != "undefined")) {
+          audioContext = new webkitAudioContext();
+        } else {
+          audioContext = new AudioContext();
+          window.StereoPannerNode =
+              audioContext.createStereoPanner().constructor;
+        }
         window.PannerNode = audioContext.createPanner().constructor;
-        window.StereoPannerNode = audioContext.createStereoPanner().constructor;
       }
       if (typeof AudioSourceNode == "undefined") {
         window.AudioSourceNode = MediaElementAudioSourceNode.constructor;
@@ -146,14 +153,18 @@
         window.FontFaceSet = document.fonts.__proto__.constructor;
       }
       if (typeof MemoryInfo == "undefined") {
-        window.MemoryInfo = window.performance.memory.constructor;
+        if (typeof window.performance.memory != "undefined") {
+          window.MemoryInfo = window.performance.memory.constructor;
+        }
       }
       if (typeof Geolocation == "undefined") {
         navigator.geolocation.constructor;
       }
       if (typeof Animation == "undefined") {
         let d = document.createElement('div');
-        window.Animation = d.animate(d).constructor;
+        if (typeof d.animate != "undefined") {
+          window.Animation = d.animate(d).constructor;
+        }
       }
       if (typeof SourceBufferList == "undefined") {
         window.SourceBufferList = new MediaSource().sourceBuffers.constructor;
diff --git a/pkg/dev_compiler/lib/js/legacy/dart_sdk.js b/pkg/dev_compiler/lib/js/legacy/dart_sdk.js
index 4c981ff..53d7785 100644
--- a/pkg/dev_compiler/lib/js/legacy/dart_sdk.js
+++ b/pkg/dev_compiler/lib/js/legacy/dart_sdk.js
@@ -18,6 +18,7 @@
   const collection = Object.create(null);
   const convert = Object.create(null);
   const core = Object.create(null);
+  const developer = Object.create(null);
   const isolate = Object.create(null);
   const js = Object.create(null);
   const js_util = Object.create(null);
@@ -49,12 +50,14 @@
   let ListOfNameValuePair = () => (ListOfNameValuePair = dart.constFn(core.List$(_debugger.NameValuePair)))();
   let JSArrayOfString = () => (JSArrayOfString = dart.constFn(_interceptors.JSArray$(core.String)))();
   let JSArrayOfJsonMLFormatter = () => (JSArrayOfJsonMLFormatter = dart.constFn(_interceptors.JSArray$(_debugger.JsonMLFormatter)))();
+  let JSIndexable = () => (JSIndexable = dart.constFn(_interceptors.JSIndexable$()))();
   let JSArray = () => (JSArray = dart.constFn(_interceptors.JSArray$()))();
   let JSMutableArray = () => (JSMutableArray = dart.constFn(_interceptors.JSMutableArray$()))();
   let JSFixedArray = () => (JSFixedArray = dart.constFn(_interceptors.JSFixedArray$()))();
   let JSExtendableArray = () => (JSExtendableArray = dart.constFn(_interceptors.JSExtendableArray$()))();
   let JSUnmodifiableArray = () => (JSUnmodifiableArray = dart.constFn(_interceptors.JSUnmodifiableArray$()))();
   let ArrayIterator = () => (ArrayIterator = dart.constFn(_interceptors.ArrayIterator$()))();
+  let JSIndexableOfString = () => (JSIndexableOfString = dart.constFn(_interceptors.JSIndexable$(core.String)))();
   let MatchToString = () => (MatchToString = dart.constFn(dart.functionType(core.String, [core.Match])))();
   let StringToString = () => (StringToString = dart.constFn(dart.functionType(core.String, [core.String])))();
   let ComparableOfnum = () => (ComparableOfnum = dart.constFn(core.Comparable$(core.num)))();
@@ -143,6 +146,7 @@
   let ListOfClassMirror = () => (ListOfClassMirror = dart.constFn(core.List$(mirrors.ClassMirror)))();
   let ListOfTypeVariableMirror = () => (ListOfTypeVariableMirror = dart.constFn(core.List$(mirrors.TypeVariableMirror)))();
   let MapOfSymbol$MethodMirror = () => (MapOfSymbol$MethodMirror = dart.constFn(core.Map$(core.Symbol, mirrors.MethodMirror)))();
+  let JSArrayOfType = () => (JSArrayOfType = dart.constFn(_interceptors.JSArray$(core.Type)))();
   let ListOfParameterMirror = () => (ListOfParameterMirror = dart.constFn(core.List$(mirrors.ParameterMirror)))();
   let ListOfFloat32x4 = () => (ListOfFloat32x4 = dart.constFn(core.List$(typed_data.Float32x4)))();
   let ListOfInt32x4 = () => (ListOfInt32x4 = dart.constFn(core.List$(typed_data.Int32x4)))();
@@ -374,6 +378,12 @@
   let MapOfString$String = () => (MapOfString$String = dart.constFn(core.Map$(core.String, core.String)))();
   let IterableOfString = () => (IterableOfString = dart.constFn(core.Iterable$(core.String)))();
   let MapOfString$dynamic = () => (MapOfString$dynamic = dart.constFn(core.Map$(core.String, dart.dynamic)))();
+  let MapOfString$ServiceExtensionHandler = () => (MapOfString$ServiceExtensionHandler = dart.constFn(core.Map$(core.String, developer.ServiceExtensionHandler)))();
+  let MapOfString$Metric = () => (MapOfString$Metric = dart.constFn(core.Map$(core.String, developer.Metric)))();
+  let ListOf_SyncBlock = () => (ListOf_SyncBlock = dart.constFn(core.List$(developer._SyncBlock)))();
+  let JSArrayOf_AsyncBlock = () => (JSArrayOf_AsyncBlock = dart.constFn(_interceptors.JSArray$(developer._AsyncBlock)))();
+  let ListOf_AsyncBlock = () => (ListOf_AsyncBlock = dart.constFn(core.List$(developer._AsyncBlock)))();
+  let CompleterOfUri = () => (CompleterOfUri = dart.constFn(async.Completer$(core.Uri)))();
   let FutureOfIsolate = () => (FutureOfIsolate = dart.constFn(async.Future$(isolate.Isolate)))();
   let JsArray = () => (JsArray = dart.constFn(js.JsArray$()))();
   let ExpandoOfFunction = () => (ExpandoOfFunction = dart.constFn(core.Expando$(core.Function)))();
@@ -533,9 +543,9 @@
   let ListOfTransform = () => (ListOfTransform = dart.constFn(core.List$(svg$.Transform)))();
   let CompleterOfAudioBuffer = () => (CompleterOfAudioBuffer = dart.constFn(async.Completer$(web_audio.AudioBuffer)))();
   let EventStreamProviderOfAudioProcessingEvent = () => (EventStreamProviderOfAudioProcessingEvent = dart.constFn(html$.EventStreamProvider$(web_audio.AudioProcessingEvent)))();
+  let dynamicTodynamic$ = () => (dynamicTodynamic$ = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic])))();
   let StringAndStringToint = () => (StringAndStringToint = dart.constFn(dart.definiteFunctionType(core.int, [core.String, core.String])))();
   let VoidTo_MethodStats = () => (VoidTo_MethodStats = dart.constFn(dart.definiteFunctionType(dart._MethodStats, [])))();
-  let dynamicTodynamic$ = () => (dynamicTodynamic$ = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic])))();
   let dynamicToString = () => (dynamicToString = dart.constFn(dart.definiteFunctionType(core.String, [dart.dynamic])))();
   let dynamicToListOfString = () => (dynamicToListOfString = dart.constFn(dart.definiteFunctionType(ListOfString(), [dart.dynamic])))();
   let dynamicToList = () => (dynamicToList = dart.constFn(dart.definiteFunctionType(core.List, [dart.dynamic])))();
@@ -614,10 +624,12 @@
   let TypeToTypeMirror = () => (TypeToTypeMirror = dart.constFn(dart.definiteFunctionType(mirrors.TypeMirror, [core.Type])))();
   let dynamicAndListTodynamic = () => (dynamicAndListTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic, core.List])))();
   let dynamicAndStringAndListTodynamic = () => (dynamicAndStringAndListTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic, core.String, core.List])))();
-  let dynamicToMap = () => (dynamicToMap = dart.constFn(dart.definiteFunctionType(core.Map, [dart.dynamic])))();
+  let SymbolTodynamic = () => (SymbolTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [core.Symbol])))();
+  let dynamicToSymbol = () => (dynamicToSymbol = dart.constFn(dart.definiteFunctionType(core.Symbol, [dart.dynamic])))();
+  let dynamicToMapOfSymbol$dynamic = () => (dynamicToMapOfSymbol$dynamic = dart.constFn(dart.definiteFunctionType(MapOfSymbol$dynamic(), [dart.dynamic])))();
   let TypeAndInvocationTodynamic = () => (TypeAndInvocationTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [core.Type, core.Invocation])))();
   let SymbolAnddynamicTovoid = () => (SymbolAnddynamicTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.Symbol, dart.dynamic])))();
-  let StringAnddynamicTovoid = () => (StringAnddynamicTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String, dart.dynamic])))();
+  let MapOfSymbol$dynamicTodynamic = () => (MapOfSymbol$dynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [MapOfSymbol$dynamic()])))();
   let dynamicToTypeMirror = () => (dynamicToTypeMirror = dart.constFn(dart.definiteFunctionType(mirrors.TypeMirror, [dart.dynamic])))();
   let dynamicAnddynamicAnddynamicTovoid = () => (dynamicAnddynamicAnddynamicTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [dart.dynamic, dart.dynamic, dart.dynamic])))();
   let ListToList = () => (ListToList = dart.constFn(dart.definiteFunctionType(core.List, [core.List])))();
@@ -675,9 +687,24 @@
   let ObjectToint = () => (ObjectToint = dart.constFn(dart.definiteFunctionType(core.int, [core.Object])))();
   let ObjectTovoid = () => (ObjectTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.Object])))();
   let StringAndStringTovoid$ = () => (StringAndStringTovoid$ = dart.constFn(dart.definiteFunctionType(dart.void, [core.String, core.String])))();
+  let StringAnddynamicTovoid = () => (StringAnddynamicTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String, dart.dynamic])))();
   let MapOfString$StringAndStringToMapOfString$String = () => (MapOfString$StringAndStringToMapOfString$String = dart.constFn(dart.definiteFunctionType(MapOfString$String(), [MapOfString$String(), core.String])))();
   let intAndintAndintTovoid = () => (intAndintAndintTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.int, core.int, core.int])))();
   let String__Tovoid = () => (String__Tovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String], [dart.dynamic])))();
+  let __Tobool = () => (__Tobool = dart.constFn(dart.definiteFunctionType(core.bool, [], {when: core.bool, message: core.String})))();
+  let String__Tovoid$ = () => (String__Tovoid$ = dart.constFn(dart.definiteFunctionType(dart.void, [core.String], {time: core.DateTime, sequenceNumber: core.int, level: core.int, name: core.String, zone: async.Zone, error: core.Object, stackTrace: core.StackTrace})))();
+  let StringAndServiceExtensionHandlerTovoid = () => (StringAndServiceExtensionHandlerTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String, developer.ServiceExtensionHandler])))();
+  let StringAndMapTovoid = () => (StringAndMapTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String, core.Map])))();
+  let StringToServiceExtensionHandler = () => (StringToServiceExtensionHandler = dart.constFn(dart.definiteFunctionType(developer.ServiceExtensionHandler, [core.String])))();
+  let StringAndServiceExtensionHandlerTodynamic = () => (StringAndServiceExtensionHandlerTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [core.String, developer.ServiceExtensionHandler])))();
+  let VoidToUserTag = () => (VoidToUserTag = dart.constFn(dart.definiteFunctionType(developer.UserTag, [])))();
+  let MapToString = () => (MapToString = dart.constFn(dart.definiteFunctionType(core.String, [core.Map])))();
+  let intAndintAndString__Tovoid = () => (intAndintAndString__Tovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.int, core.int, core.String, core.String, core.String, core.String])))();
+  let intAndintAndString__Tovoid$ = () => (intAndintAndString__Tovoid$ = dart.constFn(dart.definiteFunctionType(dart.void, [core.int, core.int, core.String, core.String, core.String])))();
+  let intAndStringAndString__Tovoid = () => (intAndStringAndString__Tovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.int, core.String, core.String, core.String])))();
+  let UriTovoid = () => (UriTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.Uri])))();
+  let SendPortTovoid = () => (SendPortTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [isolate.SendPort])))();
+  let SendPortAndboolTovoid = () => (SendPortAndboolTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [isolate.SendPort, core.bool])))();
   let ListToIsolate = () => (ListToIsolate = dart.constFn(dart.definiteFunctionType(isolate.Isolate, [core.List])))();
   let dynamicTo_DartObject = () => (dynamicTo_DartObject = dart.constFn(dart.definiteFunctionType(js._DartObject, [dart.dynamic])))();
   let dynamicToJsObject = () => (dynamicToJsObject = dart.constFn(dart.definiteFunctionType(js.JsObject, [dart.dynamic])))();
@@ -746,6 +773,7 @@
   let NodeAndNodeTovoid = () => (NodeAndNodeTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [html$.Node, html$.Node])))();
   let dynamicToImageData = () => (dynamicToImageData = dart.constFn(dart.definiteFunctionType(html$.ImageData, [dart.dynamic])))();
   let ImageDataTodynamic = () => (ImageDataTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [html$.ImageData])))();
+  let dynamicToMap = () => (dynamicToMap = dart.constFn(dart.definiteFunctionType(core.Map, [dart.dynamic])))();
   let Map__Todynamic = () => (Map__Todynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [core.Map], [dynamicTovoid()])))();
   let ListOfStringToList = () => (ListOfStringToList = dart.constFn(dart.definiteFunctionType(core.List, [ListOfString()])))();
   let dynamicToDateTime = () => (dynamicToDateTime = dart.constFn(dart.definiteFunctionType(core.DateTime, [dart.dynamic])))();
@@ -777,10 +805,10 @@
     return Mixin;
   };
   dart.getMixins = function(clazz) {
-    return clazz[dart._mixins];
+    return Object.hasOwnProperty.call(clazz, dart._mixins) ? clazz[dart._mixins] : null;
   };
   dart.getImplements = function(clazz) {
-    return clazz[dart.implements];
+    return Object.hasOwnProperty.call(clazz, dart.implements) ? clazz[dart.implements] : null;
   };
   dart.flattenFutures = function(builder) {
     function flatten(T) {
@@ -794,43 +822,48 @@
     }
     return flatten;
   };
-  dart.generic = function(typeConstructor) {
-    let length = typeConstructor.length;
-    if (length < 1) {
-      dart.throwInternalError('must have at least one generic type argument');
-    }
-    let resultMap = new Map();
-    function makeGenericType(...args) {
-      if (args.length != length && args.length != 0) {
-        dart.throwInternalError('requires ' + length + ' or 0 type arguments');
+  dart.generic = function(typeConstructor, setBaseClass) {
+    if (setBaseClass === void 0) setBaseClass = null;
+    return (() => {
+      let length = typeConstructor.length;
+      if (length < 1) {
+        dart.throwInternalError('must have at least one generic type argument');
       }
-      while (args.length < length)
-        args.push(dart.dynamic);
-      let value = resultMap;
-      for (let i = 0; i < length; i++) {
-        let arg = args[i];
-        if (arg == null) {
-          dart.throwInternalError('type arguments should not be null: ' + typeConstructor);
+      let resultMap = new Map();
+      function makeGenericType(...args) {
+        if (args.length != length && args.length != 0) {
+          dart.throwInternalError('requires ' + length + ' or 0 type arguments');
         }
-        let map = value;
-        value = map.get(arg);
-        if (value === void 0) {
-          if (i + 1 == length) {
-            value = typeConstructor.apply(null, args);
-            if (value) {
-              value[dart._typeArguments] = args;
-              value[dart._originalDeclaration] = makeGenericType;
-            }
-          } else {
-            value = new Map();
+        while (args.length < length)
+          args.push(dart.dynamic);
+        let value = resultMap;
+        for (let i = 0; i < length; i++) {
+          let arg = args[i];
+          if (arg == null) {
+            dart.throwInternalError('type arguments should not be null: ' + typeConstructor);
           }
-          map.set(arg, value);
+          let map = value;
+          value = map.get(arg);
+          if (value === void 0) {
+            if (i + 1 == length) {
+              value = typeConstructor.apply(null, args);
+              if (value) {
+                value[dart._typeArguments] = args;
+                value[dart._originalDeclaration] = makeGenericType;
+              }
+              map.set(arg, value);
+              if (setBaseClass) setBaseClass(value);
+            } else {
+              value = new Map();
+              map.set(arg, value);
+            }
+          }
         }
+        return value;
       }
-      return value;
-    }
-    makeGenericType[dart._genericTypeCtor] = typeConstructor;
-    return makeGenericType;
+      makeGenericType[dart._genericTypeCtor] = typeConstructor;
+      return makeGenericType;
+    })();
   };
   dart.getGenericClass = function(type) {
     return dart.safeGetOwnProperty(type, dart._originalDeclaration);
@@ -1033,7 +1066,6 @@
     let proto = type.prototype;
     for (let name of methodNames) {
       let method = dart.getOwnPropertyDescriptor(proto, name);
-      if (!method) continue;
       dart.defineProperty(proto, dart.getExtensionSymbol(name), method);
     }
     let originalSigFn = dart.getOwnPropertyDescriptor(type, dart._methodSig).get;
@@ -1057,8 +1089,10 @@
     derived.__proto__ = base;
   };
   dart.setExtensionBaseClass = function(derived, base) {
-    derived.prototype[dart._extensionType] = derived;
-    derived.prototype.__proto__ = base.prototype;
+    if (base) {
+      derived.prototype[dart._extensionType] = derived;
+      derived.prototype.__proto__ = base.prototype;
+    }
   };
   dart.callableClass = function(callableCtor, classExpr) {
     callableCtor.prototype = classExpr.prototype;
@@ -1070,6 +1104,15 @@
     ctor.prototype = clazz.prototype;
     dart.defineProperty(clazz, name, {value: ctor, configurable: true});
   };
+  dart.defineEnumValues = function(enumClass, names) {
+    let values = [];
+    for (var i = 0; i < names.length; i++) {
+      let value = dart.const(new enumClass(i));
+      values.push(value);
+      Object.defineProperty(enumClass, names[i], {value: value, configurable: true});
+    }
+    enumClass.values = dart.constList(values, enumClass);
+  };
   dart.fn = function(closure, t) {
     if (t == null) {
       t = dart.definiteFunctionType(dart.dynamic, Array(closure.length).fill(dart.dynamic), void 0);
@@ -1129,6 +1172,23 @@
     }
     return type[dart._typeObject] = new dart.WrappedType(type);
   };
+  dart.lazyJSType = function(getJSTypeCallback, name) {
+    let key = getJSTypeCallback.toString();
+    if (dart._lazyJSTypes.has(key)) {
+      return dart._lazyJSTypes.get(key);
+    }
+    let ret = new dart.LazyJSType(getJSTypeCallback, name);
+    dart._lazyJSTypes.set(key, ret);
+    return ret;
+  };
+  dart.lazyAnonymousJSType = function(name) {
+    if (dart._lazyJSTypes.has(name)) {
+      return dart._lazyJSTypes.get(name);
+    }
+    let ret = new dart.LazyJSType(null, name);
+    dart._lazyJSTypes.set(name, ret);
+    return ret;
+  };
   const _wrappedType = Symbol('_wrappedType');
   dart.unwrapType = function(obj) {
     return dart.dload(obj, _wrappedType);
@@ -1151,6 +1211,42 @@
   dart.tagLazy = function(value, compute) {
     dart.defineLazyProperty(value, dart._runtimeType, {get: compute});
   };
+  dart._warn = function(arg) {
+    console.warn(arg);
+  };
+  const _jsTypeCallback = Symbol('_jsTypeCallback');
+  const _rawJSType = Symbol('_rawJSType');
+  const _dartName = Symbol('_dartName');
+  dart._isInstanceOfLazyJSType = function(o, t) {
+    if (t[_jsTypeCallback] != null) {
+      if (t[_rawJSType] == null) {
+        let expected = t[_dartName];
+        let actual = dart.typeName(dart.getReifiedType(o));
+        dart._warn(dart.str`Cannot find native JavaScript type (${expected}) ` + dart.str`to type check ${actual}`);
+        return true;
+      }
+      return dart.is(o, t[_rawJSType]);
+    }
+    if (o == null) return false;
+    return dart._isJSObject(o);
+  };
+  dart._asInstanceOfLazyJSType = function(o, t) {
+    if (t[_jsTypeCallback] != null) {
+      if (t[_rawJSType] == null) {
+        let expected = t[_dartName];
+        let actual = dart.typeName(dart.getReifiedType(o));
+        dart._warn(dart.str`Cannot find native JavaScript type (${expected}) ` + dart.str`to type check ${actual}`);
+        return o;
+      }
+      return dart.as(o, t[_rawJSType]);
+    }
+    if (o == null) return null;
+    if (!dart.test(dart._isJSObject(o))) dart._throwCastError(o, t, true);
+    return o;
+  };
+  dart._isJSObject = function(o) {
+    return !dart.getReifiedType(o)[dart._runtimeType];
+  };
   dart._initialize2 = function() {
     dart.TypeRep.prototype.is = function is_T(object) {
       return dart.is(object, this);
@@ -1170,6 +1266,15 @@
     dart.Dynamic.prototype._check = function check_Dynamic(object) {
       return object;
     };
+    dart.LazyJSType.prototype.is = function is_T(object) {
+      return dart._isInstanceOfLazyJSType(object, this);
+    };
+    dart.LazyJSType.prototype.as = function as_T(object) {
+      return dart._asInstanceOfLazyJSType(object, this);
+    };
+    dart.LazyJSType.prototype._check = function check_T(object) {
+      return dart._asInstanceOfLazyJSType(object, this);
+    };
   };
   dart._functionType = function(definite, returnType, args, extra) {
     if (args === void 0 && extra === void 0) {
@@ -1232,6 +1337,11 @@
   dart.isFunctionType = function(type) {
     return type instanceof dart.AbstractFunctionType || type === core.Function;
   };
+  dart.isLazyJSSubtype = function(t1, t2, covariant) {
+    if (dart.equals(t1, t2)) return true;
+    if (t1[_jsTypeCallback] == null || t2[_jsTypeCallback] == null) return true;
+    return dart.isClassSubType(t1[_rawJSType], t2[_rawJSType], covariant);
+  };
   dart.isFunctionSubtype = function(ft1, ft2, covariant) {
     if (ft2 === core.Function) {
       return true;
@@ -1327,6 +1437,9 @@
     if (dart.isFunctionType(t1) && dart.isFunctionType(t2)) {
       return dart.isFunctionSubtype(t1, t2, covariant);
     }
+    if (t1 instanceof dart.LazyJSType && t2 instanceof dart.LazyJSType) {
+      return dart.isLazyJSSubtype(t1, t2, covariant);
+    }
     return false;
   };
   dart.isClassSubType = function(t1, t2, covariant) {
@@ -1402,24 +1515,31 @@
     return true;
   };
   dart.throwCastError = function(object, actual, type) {
+    debugger;
     dart.throw(new _js_helper.CastErrorImplementation(object, dart.typeName(actual), dart.typeName(type)));
   };
   dart.throwTypeError = function(object, actual, type) {
+    debugger;
     dart.throw(new _js_helper.TypeErrorImplementation(object, dart.typeName(actual), dart.typeName(type)));
   };
   dart.throwStrongModeCastError = function(object, actual, type) {
+    debugger;
     dart.throw(new _js_helper.StrongModeCastError(object, dart.typeName(actual), dart.typeName(type)));
   };
   dart.throwStrongModeTypeError = function(object, actual, type) {
+    debugger;
     dart.throw(new _js_helper.StrongModeTypeError(object, dart.typeName(actual), dart.typeName(type)));
   };
   dart.throwUnimplementedError = function(message) {
+    debugger;
     dart.throw(new core.UnimplementedError(message));
   };
   dart.throwAssertionError = function() {
+    debugger;
     dart.throw(new core.AssertionError());
   };
   dart.throwNullValueError = function() {
+    debugger;
     dart.throw(new core.NoSuchMethodError(null, new core.Symbol('<Unexpected Null Value>'), null, null, null));
   };
   dart.syncStar = function(gen, E, ...args) {
@@ -1558,12 +1678,49 @@
   dart.dgcall = function(f, typeArgs, ...args) {
     return dart._checkAndCall(f, dart._getRuntimeType(f), void 0, typeArgs, args, 'call');
   };
+  dart._dhelperRepl = function(object, field, callback) {
+    let rawField = field;
+    if (typeof field == 'symbol') {
+      if (field in object) return callback(field);
+      field = field.toString();
+      field = field.substring('Symbol('.length, field.length - 1);
+    } else if (field.charAt(0) != '_') {
+      return callback(field);
+    }
+    if (field in object) return callback(field);
+    let proto = object;
+    while (proto !== null) {
+      let symbols = Object.getOwnPropertySymbols(proto);
+      let target = 'Symbol(' + field + ')';
+      for (let s = 0; s < symbols.length; s++) {
+        let sym = symbols[s];
+        if (target == sym.toString()) return callback(sym);
+      }
+      proto = proto.__proto__;
+    }
+    return callback(rawField);
+  };
+  dart.dloadRepl = function(obj, field) {
+    return dart._dhelperRepl(obj, field, dart.fn(resolvedField => dart.dload(obj, resolvedField), dynamicTodynamic$()));
+  };
+  dart.dputRepl = function(obj, field, value) {
+    return dart._dhelperRepl(obj, field, dart.fn(resolvedField => dart.dput(obj, resolvedField, value), dynamicTodynamic$()));
+  };
+  dart._callMethodRepl = function(obj, method, typeArgs, args) {
+    return dart._dhelperRepl(obj, method, dart.fn(resolvedField => dart._callMethod(obj, resolvedField, typeArgs, args, method), dynamicTodynamic$()));
+  };
+  dart.dsendRepl = function(obj, method, ...args) {
+    return dart._callMethodRepl(obj, method, null, args);
+  };
+  dart.dgsendRepl = function(obj, typeArgs, method, ...args) {
+    return dart._callMethodRepl(obj, method, typeArgs, args);
+  };
   dart.getDynamicStats = function() {
     let ret = JSArrayOfListOfObject().of([]);
     let keys = dart._callMethodStats[dartx.keys][dartx.toList]();
-    keys[dartx.sort](dart.fn((a, b) => dart._callMethodStats[dartx.get](b).count[dartx.compareTo](dart._callMethodStats[dartx.get](a).count), StringAndStringToint()));
+    keys[dartx.sort](dart.fn((a, b) => dart._callMethodStats[dartx._get](b).count[dartx.compareTo](dart._callMethodStats[dartx._get](a).count), StringAndStringToint()));
     for (let key of keys) {
-      let stats = dart._callMethodStats[dartx.get](key);
+      let stats = dart._callMethodStats[dartx._get](key);
       ret[dartx.add](JSArrayOfObject().of([stats.typeName, stats.frame, stats.count]));
     }
     return ret;
@@ -1578,7 +1735,7 @@
     let stack = stackStr[dartx.split]('\n    at ');
     let src = '';
     for (let i = 2; i < dart.notNull(stack[dartx.length]); ++i) {
-      let frame = stack[dartx.get](i);
+      let frame = stack[dartx._get](i);
       if (!dart.test(frame[dartx.contains]('dart_sdk.js'))) {
         src = frame;
         break;
@@ -1604,10 +1761,10 @@
     return dart._callMethod(obj, method, typeArgs, args, method);
   };
   dart.dindex = function(obj, index) {
-    return dart._callMethod(obj, 'get', null, [index], '[]');
+    return dart._callMethod(obj, '_get', null, [index], '[]');
   };
   dart.dsetindex = function(obj, index, value) {
-    return dart._callMethod(obj, 'set', null, [index, value], '[]=');
+    return dart._callMethod(obj, '_set', null, [index, value], '[]=');
   };
   dart._ignoreMemo = function(f) {
     let memo = new Map();
@@ -1730,11 +1887,11 @@
         for (let i = 0, end = values.length - 1; i < end; i += 2) {
           let key = values[i];
           let value = values[i + 1];
-          map.set(key, value);
+          map._set(key, value);
         }
       } else if (typeof values === 'object') {
         for (let key of dart.getOwnPropertyNames(values)) {
-          map.set(key, values[key]);
+          map._set(key, values[key]);
         }
       }
       return map;
@@ -1872,7 +2029,8 @@
     if (result != null) return dart.wrapType(result);
     let extension = dart.getExtensionType(obj);
     if (extension != null) {
-      return obj[dartx.runtimeType];
+      result = obj[dartx.runtimeType];
+      return result != null ? result : dart.wrapType(extension);
     }
     if (typeof obj == "function") {
       return dart.wrapType(dart.getReifiedType(obj));
@@ -1896,6 +2054,9 @@
     }
     return name;
   };
+  dart.loadLibrary = function() {
+    return async.Future.value();
+  };
   dart.defineProperty = function(obj, name, desc) {
     return Object.defineProperty(obj, name, desc);
   };
@@ -1909,9 +2070,11 @@
     return Object.getOwnPropertySymbols(obj);
   };
   dart.throwStrongModeError = function(message) {
+    debugger;
     throw new _js_helper.StrongModeErrorImplementation(message);
   };
   dart.throwInternalError = function(message) {
+    debugger;
     throw Error(message);
   };
   dart.getOwnNamesAndSymbols = function(obj) {
@@ -1998,6 +2161,12 @@
   dart.dartx = dartx;
   dart._runtimeType = Symbol("_runtimeType");
   dart.isNamedConstructor = Symbol("isNamedConstructor");
+  dart.defineLazy(dart, {
+    get _lazyJSTypes() {
+      return new Map();
+    },
+    set _lazyJSTypes(_) {}
+  });
   dart.metadata = Symbol("metadata");
   dart._typeObject = Symbol("typeObject");
   core.Object = class Object {
@@ -2068,6 +2237,27 @@
       return 'dynamic';
     }
   };
+  dart.LazyJSType = class LazyJSType extends core.Object {
+    new(jsTypeCallback, dartName) {
+      this[_jsTypeCallback] = jsTypeCallback;
+      this[_dartName] = dartName;
+    }
+    get [_rawJSType]() {
+      return this[_jsTypeCallback]();
+    }
+    toString() {
+      return core.String._check(this[_jsTypeCallback] != null ? dart.typeName(this[_rawJSType]) : this[_dartName]);
+    }
+  };
+  dart.LazyJSType[dart.implements] = () => [core.Type];
+  dart.setSignature(dart.LazyJSType, {
+    constructors: () => ({new: dart.definiteFunctionType(dart.LazyJSType, [dart.dynamic, dart.dynamic])}),
+    fields: () => ({
+      [_jsTypeCallback]: dart.dynamic,
+      [_dartName]: dart.dynamic
+    }),
+    getters: () => ({[_rawJSType]: dart.definiteFunctionType(dart.dynamic, [])})
+  });
   dart.dynamic = new dart.Dynamic();
   dart._initialize = dart._initialize2();
   dart.Void = class Void extends dart.TypeRep {
@@ -3074,7 +3264,7 @@
         if (genericTypeConstructor != null) {
           this.recordGenericParameters(core.String._check(name), genericTypeConstructor);
         } else {
-          nonGenericProperties.set(core.String._check(name), value);
+          nonGenericProperties._set(core.String._check(name), value);
         }
       }, dynamicAnddynamicTodynamic$()));
       nonGenericProperties.forEach(dart.fn((name, value) => {
@@ -3087,13 +3277,13 @@
       return children.toList();
     }
     recordGenericParameters(name, genericTypeConstructor) {
-      this.genericParameters.set(name, genericTypeConstructor.toString()[dartx.split](' =>')[dartx.first][dartx.replaceAll](core.RegExp.new('[(|)]'), ''));
+      this.genericParameters._set(name, genericTypeConstructor.toString()[dartx.split](' =>')[dartx.first][dartx.replaceAll](core.RegExp.new('[(|)]'), ''));
     }
     classChild(name, child) {
       let typeName = _debugger.getTypeName(core.Type._check(child));
       let parameterName = dart.str`${name}\$`;
       if (dart.test(this.genericParameters.keys[dartx.contains](parameterName))) {
-        typeName = dart.str`${typeName}<${this.genericParameters.get(parameterName)}>`;
+        typeName = dart.str`${typeName}<${this.genericParameters._get(parameterName)}>`;
         _debugger.JSNative.setProperty(child, 'genericTypeName', typeName);
       }
       return new _debugger.NameValuePair({name: typeName, value: child});
@@ -3556,8 +3746,12 @@
     constructors: () => ({new: dart.definiteFunctionType(_interceptors.JSBool, [])})
   });
   dart.registerExtension(dart.global.Boolean, _interceptors.JSBool);
-  _interceptors.JSIndexable = class JSIndexable extends core.Object {};
-  _interceptors.JSMutableIndexable = class JSMutableIndexable extends _interceptors.JSIndexable {};
+  _interceptors.JSIndexable$ = dart.generic(E => {
+    class JSIndexable extends core.Object {}
+    dart.addTypeTests(JSIndexable);
+    return JSIndexable;
+  });
+  _interceptors.JSIndexable = JSIndexable();
   _interceptors.JSObject = class JSObject extends core.Object {};
   _interceptors.JavaScriptObject = class JavaScriptObject extends _interceptors.Interceptor {
     new() {
@@ -3620,6 +3814,7 @@
     let SetOfE = () => (SetOfE = dart.constFn(core.Set$(E)))();
     let ArrayIteratorOfE = () => (ArrayIteratorOfE = dart.constFn(_interceptors.ArrayIterator$(E)))();
     let ListMapViewOfE = () => (ListMapViewOfE = dart.constFn(_internal.ListMapView$(E)))();
+    let JSIndexableOfE = () => (JSIndexableOfE = dart.constFn(_interceptors.JSIndexable$(E)))();
     let ETobool = () => (ETobool = dart.constFn(dart.functionType(core.bool, [E])))();
     let ETovoid = () => (ETovoid = dart.constFn(dart.functionType(dart.void, [E])))();
     let EAndEToint = () => (EAndEToint = dart.constFn(dart.functionType(core.int, [E, E])))();
@@ -3678,8 +3873,8 @@
       'hashCode',
       'length',
       'length',
-      'get',
-      'set',
+      '_get',
+      '_set',
       'asMap'
     ]);
     class JSArray extends core.Object {
@@ -3756,7 +3951,7 @@
         this[dartx.checkMutable]('setAll');
         core.RangeError.checkValueInInterval(index, 0, this[dartx.length], "index");
         for (let element of iterable) {
-          this[dartx.set]((() => {
+          this[dartx._set]((() => {
             let x = index;
             index = dart.notNull(x) + 1;
             return x;
@@ -3771,7 +3966,7 @@
       [dartx.remove](element) {
         this[dartx.checkGrowable]('remove');
         for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-          if (dart.equals(this[dartx.get](i), element)) {
+          if (dart.equals(this[dartx._get](i), element)) {
             this.splice(i, 1);
             return true;
           }
@@ -3799,7 +3994,7 @@
         if (retained[dartx.length] == end) return;
         this[dartx.length] = retained[dartx.length];
         for (let i = 0; i < dart.notNull(retained[dartx.length]); i++) {
-          this[dartx.set](i, E._check(retained[dartx.get](i)));
+          this[dartx._set](i, E._check(retained[dartx._get](i)));
         }
       }
       [dartx.where](f) {
@@ -3840,7 +4035,7 @@
         if (separator === void 0) separator = "";
         let list = core.List.new(this[dartx.length]);
         for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-          list[dartx.set](i, dart.str`${this[dartx.get](i)}`);
+          list[dartx._set](i, dart.str`${this[dartx._get](i)}`);
         }
         return list.join(separator);
       }
@@ -3860,7 +4055,7 @@
         EAndEToE()._check(combine);
         let length = this[dartx.length];
         if (length == 0) dart.throw(_internal.IterableElementError.noElement());
-        let value = this[dartx.get](0);
+        let value = this[dartx._get](0);
         for (let i = 1; i < dart.notNull(length); i++) {
           let element = this[i];
           value = combine(value, element);
@@ -3927,7 +4122,7 @@
         dart.throw(_internal.IterableElementError.noElement());
       }
       [dartx.elementAt](index) {
-        return this[dartx.get](index);
+        return this[dartx._get](index);
       }
       [dartx.sublist](start, end) {
         if (end === void 0) end = null;
@@ -3952,15 +4147,15 @@
         return new (SubListIterableOfE())(this, start, end);
       }
       get [dartx.first]() {
-        if (dart.notNull(this[dartx.length]) > 0) return this[dartx.get](0);
+        if (dart.notNull(this[dartx.length]) > 0) return this[dartx._get](0);
         dart.throw(_internal.IterableElementError.noElement());
       }
       get [dartx.last]() {
-        if (dart.notNull(this[dartx.length]) > 0) return this[dartx.get](dart.notNull(this[dartx.length]) - 1);
+        if (dart.notNull(this[dartx.length]) > 0) return this[dartx._get](dart.notNull(this[dartx.length]) - 1);
         dart.throw(_internal.IterableElementError.noElement());
       }
       get [dartx.single]() {
-        if (this[dartx.length] == 1) return this[dartx.get](0);
+        if (this[dartx.length] == 1) return this[dartx._get](0);
         if (this[dartx.length] == 0) dart.throw(_internal.IterableElementError.noElement());
         dart.throw(_internal.IterableElementError.tooMany());
       }
@@ -3992,12 +4187,12 @@
         }
         if (dart.notNull(otherStart) < dart.notNull(start)) {
           for (let i = length - 1; i >= 0; i--) {
-            let element = otherList[dartx.get](dart.notNull(otherStart) + i);
+            let element = otherList[dartx._get](dart.notNull(otherStart) + i);
             this[dart.notNull(start) + i] = element;
           }
         } else {
           for (let i = 0; i < length; i++) {
-            let element = otherList[dartx.get](dart.notNull(otherStart) + i);
+            let element = otherList[dartx._get](dart.notNull(otherStart) + i);
             this[dart.notNull(start) + i] = element;
           }
         }
@@ -4076,9 +4271,9 @@
         while (dart.notNull(length) > 1) {
           let pos = random.nextInt(length);
           length = dart.notNull(length) - 1;
-          let tmp = this[dartx.get](length);
-          this[dartx.set](length, this[dartx.get](pos));
-          this[dartx.set](pos, tmp);
+          let tmp = this[dartx._get](length);
+          this[dartx._set](length, this[dartx._get](pos));
+          this[dartx._set](pos, tmp);
         }
       }
       [dartx.indexOf](element, start) {
@@ -4090,7 +4285,7 @@
           start = 0;
         }
         for (let i = start; dart.notNull(i) < dart.notNull(this[dartx.length]); i = dart.notNull(i) + 1) {
-          if (dart.equals(this[dartx.get](i), element)) {
+          if (dart.equals(this[dartx._get](i), element)) {
             return i;
           }
         }
@@ -4109,7 +4304,7 @@
           }
         }
         for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) {
-          if (dart.equals(this[dartx.get](i), element)) {
+          if (dart.equals(this[dartx._get](i), element)) {
             return i;
           }
         }
@@ -4117,7 +4312,7 @@
       }
       [dartx.contains](other) {
         for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-          if (dart.equals(this[dartx.get](i), other)) return true;
+          if (dart.equals(this[dartx._get](i), other)) return true;
         }
         return false;
       }
@@ -4158,12 +4353,12 @@
         }
         this.length = newLength;
       }
-      [dartx.get](index) {
+      [dartx._get](index) {
         if (!(typeof index == 'number')) dart.throw(_js_helper.diagnoseIndexError(this, index));
         if (dart.notNull(index) >= dart.notNull(this[dartx.length]) || dart.notNull(index) < 0) dart.throw(_js_helper.diagnoseIndexError(this, index));
         return this[index];
       }
-      [dartx.set](index, value) {
+      [dartx._set](index, value) {
         E._check(value);
         this[dartx.checkMutable]('indexed set');
         if (!(typeof index == 'number')) dart.throw(_js_helper.diagnoseIndexError(this, index));
@@ -4177,7 +4372,7 @@
     }
     dart.setExtensionBaseClass(JSArray, dart.global.Array);
     dart.addTypeTests(JSArray);
-    JSArray[dart.implements] = () => [ListOfE(), _interceptors.JSIndexable];
+    JSArray[dart.implements] = () => [ListOfE(), JSIndexableOfE()];
     dart.setSignature(JSArray, {
       constructors: () => ({
         new: dart.definiteFunctionType(_interceptors.JSArray$(E), []),
@@ -4242,8 +4437,8 @@
         [dartx.contains]: dart.definiteFunctionType(core.bool, [core.Object]),
         [dartx.toList]: dart.definiteFunctionType(core.List$(E), [], {growable: core.bool}),
         [dartx.toSet]: dart.definiteFunctionType(core.Set$(E), []),
-        [dartx.get]: dart.definiteFunctionType(E, [core.int]),
-        [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, E]),
+        [dartx._get]: dart.definiteFunctionType(E, [core.int]),
+        [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, E]),
         [dartx.asMap]: dart.definiteFunctionType(core.Map$(core.int, E), [])
       }),
       statics: () => ({
@@ -4262,7 +4457,6 @@
         super.new();
       }
     }
-    JSMutableArray[dart.implements] = () => [_interceptors.JSMutableIndexable];
     return JSMutableArray;
   });
   _interceptors.JSMutableArray = JSMutableArray();
@@ -4319,7 +4513,7 @@
           this[_current] = null;
           return false;
         }
-        this[_current] = this[_iterable][dartx.get](this[_index]);
+        this[_current] = this[_iterable][dartx._get](this[_index]);
         this[_index] = dart.notNull(this[_index]) + 1;
         return true;
       }
@@ -4371,7 +4565,7 @@
     'toRadixString',
     'toString',
     'hashCode',
-    'unary-',
+    '_negate',
     '+',
     '-',
     '/',
@@ -4568,7 +4762,7 @@
     get [dartx.hashCode]() {
       return this & 0x1FFFFFFF;
     }
-    [dartx['unary-']]() {
+    [dartx._negate]() {
       return -this;
     }
     [dartx['+']](other) {
@@ -4866,7 +5060,7 @@
       [dartx.toStringAsExponential]: dart.definiteFunctionType(core.String, [], [core.int]),
       [dartx.toStringAsPrecision]: dart.definiteFunctionType(core.String, [core.int]),
       [dartx.toRadixString]: dart.definiteFunctionType(core.String, [core.int]),
-      [dartx['unary-']]: dart.definiteFunctionType(_interceptors.JSNumber, []),
+      [dartx._negate]: dart.definiteFunctionType(_interceptors.JSNumber, []),
       [dartx['+']]: dart.definiteFunctionType(_interceptors.JSNumber, [core.num]),
       [dartx['-']]: dart.definiteFunctionType(_interceptors.JSNumber, [core.num]),
       [dartx['/']]: dart.definiteFunctionType(core.double, [core.num]),
@@ -4949,7 +5143,7 @@
     'hashCode',
     'runtimeType',
     'length',
-    'get'
+    '_get'
   ]);
   _interceptors.JSString = class JSString extends _interceptors.Interceptor {
     new() {
@@ -5332,13 +5526,13 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (!(typeof index == 'number')) dart.throw(_js_helper.diagnoseIndexError(this, index));
       if (dart.notNull(index) >= dart.notNull(this[dartx.length]) || dart.notNull(index) < 0) dart.throw(_js_helper.diagnoseIndexError(this, index));
       return this[index];
     }
   };
-  _interceptors.JSString[dart.implements] = () => [core.String, _interceptors.JSIndexable];
+  _interceptors.JSString[dart.implements] = () => [core.String, JSIndexableOfString()];
   dart.setSignature(_interceptors.JSString, {
     constructors: () => ({new: dart.definiteFunctionType(_interceptors.JSString, [])}),
     getters: () => ({
@@ -5376,7 +5570,7 @@
       [dartx.lastIndexOf]: dart.definiteFunctionType(core.int, [core.Pattern], [core.int]),
       [dartx.contains]: dart.definiteFunctionType(core.bool, [core.Pattern], [core.int]),
       [dartx.compareTo]: dart.definiteFunctionType(core.int, [core.String]),
-      [dartx.get]: dart.definiteFunctionType(core.String, [core.int])
+      [dartx._get]: dart.definiteFunctionType(core.String, [core.int])
     }),
     statics: () => ({
       _isWhitespace: dart.definiteFunctionType(core.bool, [core.int]),
@@ -5452,6 +5646,7 @@
   });
   _internal.POWERS_OF_TEN = dart.constList([1.0, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, 10000000.0, 100000000.0, 1000000000.0, 10000000000.0, 100000000000.0, 1000000000000.0, 10000000000000.0, 100000000000000.0, 1000000000000000.0, 10000000000000000.0, 100000000000000000.0, 1000000000000000000.0, 10000000000000000000.0, 100000000000000000000.0, 1e+21, 1e+22], core.double);
   const _string = Symbol('_string');
+  const _filter = Symbol('_filter');
   collection.ListMixin$ = dart.generic(E => {
     let ListIteratorOfE = () => (ListIteratorOfE = dart.constFn(_internal.ListIterator$(E)))();
     let VoidToE = () => (VoidToE = dart.constFn(dart.functionType(E, [])))();
@@ -5463,6 +5658,7 @@
     let ListOfE = () => (ListOfE = dart.constFn(core.List$(E)))();
     let SetOfE = () => (SetOfE = dart.constFn(core.Set$(E)))();
     let IterableOfE = () => (IterableOfE = dart.constFn(core.Iterable$(E)))();
+    let JSArrayOfE = () => (JSArrayOfE = dart.constFn(_interceptors.JSArray$(E)))();
     let ListMapViewOfE = () => (ListMapViewOfE = dart.constFn(_internal.ListMapView$(E)))();
     let ReversedListIterableOfE = () => (ReversedListIterableOfE = dart.constFn(_internal.ReversedListIterable$(E)))();
     let ETovoid = () => (ETovoid = dart.constFn(dart.functionType(dart.void, [E])))();
@@ -5528,12 +5724,12 @@
         return new dart.JsIterator(this[dartx.iterator]);
       }
       elementAt(index) {
-        return this[dartx.get](index);
+        return this[dartx._get](index);
       }
       forEach(action) {
         let length = this[dartx.length];
         for (let i = 0; i < dart.notNull(length); i++) {
-          action(this[dartx.get](i));
+          action(this[dartx._get](i));
           if (length != this[dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this));
           }
@@ -5547,21 +5743,21 @@
       }
       get first() {
         if (this[dartx.length] == 0) dart.throw(_internal.IterableElementError.noElement());
-        return this[dartx.get](0);
+        return this[dartx._get](0);
       }
       get last() {
         if (this[dartx.length] == 0) dart.throw(_internal.IterableElementError.noElement());
-        return this[dartx.get](dart.notNull(this[dartx.length]) - 1);
+        return this[dartx._get](dart.notNull(this[dartx.length]) - 1);
       }
       get single() {
         if (this[dartx.length] == 0) dart.throw(_internal.IterableElementError.noElement());
         if (dart.notNull(this[dartx.length]) > 1) dart.throw(_internal.IterableElementError.tooMany());
-        return this[dartx.get](0);
+        return this[dartx._get](0);
       }
       contains(element) {
         let length = this[dartx.length];
         for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-          if (dart.equals(this[dartx.get](i), element)) return true;
+          if (dart.equals(this[dartx._get](i), element)) return true;
           if (length != this[dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this));
           }
@@ -5571,7 +5767,7 @@
       every(test) {
         let length = this[dartx.length];
         for (let i = 0; i < dart.notNull(length); i++) {
-          if (!dart.test(test(this[dartx.get](i)))) return false;
+          if (!dart.test(test(this[dartx._get](i)))) return false;
           if (length != this[dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this));
           }
@@ -5581,7 +5777,7 @@
       any(test) {
         let length = this[dartx.length];
         for (let i = 0; i < dart.notNull(length); i++) {
-          if (dart.test(test(this[dartx.get](i)))) return true;
+          if (dart.test(test(this[dartx._get](i)))) return true;
           if (length != this[dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this));
           }
@@ -5593,7 +5789,7 @@
         VoidToE()._check(orElse);
         let length = this[dartx.length];
         for (let i = 0; i < dart.notNull(length); i++) {
-          let element = this[dartx.get](i);
+          let element = this[dartx._get](i);
           if (dart.test(test(element))) return element;
           if (length != this[dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this));
@@ -5607,7 +5803,7 @@
         VoidToE()._check(orElse);
         let length = this[dartx.length];
         for (let i = dart.notNull(length) - 1; i >= 0; i--) {
-          let element = this[dartx.get](i);
+          let element = this[dartx._get](i);
           if (dart.test(test(element))) return element;
           if (length != this[dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this));
@@ -5621,7 +5817,7 @@
         let match = null;
         let matchFound = false;
         for (let i = 0; i < dart.notNull(length); i++) {
-          let element = this[dartx.get](i);
+          let element = this[dartx._get](i);
           if (dart.test(test(element))) {
             if (matchFound) {
               dart.throw(_internal.IterableElementError.tooMany());
@@ -5660,9 +5856,9 @@
         EAndEToE()._check(combine);
         let length = this[dartx.length];
         if (length == 0) dart.throw(_internal.IterableElementError.noElement());
-        let value = this[dartx.get](0);
+        let value = this[dartx._get](0);
         for (let i = 1; i < dart.notNull(length); i++) {
-          value = combine(value, this[dartx.get](i));
+          value = combine(value, this[dartx._get](i));
           if (length != this[dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this));
           }
@@ -5674,7 +5870,7 @@
           let value = initialValue;
           let length = this[dartx.length];
           for (let i = 0; i < dart.notNull(length); i++) {
-            value = combine(value, this[dartx.get](i));
+            value = combine(value, this[dartx._get](i));
             if (length != this[dartx.length]) {
               dart.throw(new core.ConcurrentModificationError(this));
             }
@@ -5704,20 +5900,20 @@
           result = ListOfE().new(this[dartx.length]);
         }
         for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-          result[dartx.set](i, this[dartx.get](i));
+          result[dartx._set](i, this[dartx._get](i));
         }
         return result;
       }
       toSet() {
         let result = SetOfE().new();
         for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-          result.add(this[dartx.get](i));
+          result.add(this[dartx._get](i));
         }
         return result;
       }
       add(element) {
         E._check(element);
-        this[dartx.set]((() => {
+        this[dartx._set]((() => {
           let x = this[dartx.length];
           this[dartx.length] = dart.notNull(x) + 1;
           return x;
@@ -5729,13 +5925,13 @@
         for (let element of iterable) {
           dart.assert(this[dartx.length] == i || dart.test(dart.throw(new core.ConcurrentModificationError(this))));
           this[dartx.length] = dart.notNull(i) + 1;
-          this[dartx.set](i, element);
+          this[dartx._set](i, element);
           i = dart.notNull(i) + 1;
         }
       }
       remove(element) {
         for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
-          if (dart.equals(this[dartx.get](i), element)) {
+          if (dart.equals(this[dartx._get](i), element)) {
             this[dartx.setRange](i, dart.notNull(this[dartx.length]) - 1, this, i + 1);
             this[dartx.length] = dart.notNull(this[dartx.length]) - 1;
             return true;
@@ -5744,16 +5940,17 @@
         return false;
       }
       removeWhere(test) {
-        collection.ListMixin._filter(this, test, false);
+        this[_filter](test, false);
       }
       retainWhere(test) {
-        collection.ListMixin._filter(this, test, true);
+        this[_filter](test, true);
       }
-      static _filter(source, test, retainMatching) {
-        let retained = [];
+      [_filter](test, retainMatching) {
+        let source = this;
+        let retained = JSArrayOfE().of([]);
         let length = source[dartx.length];
         for (let i = 0; i < dart.notNull(length); i++) {
-          let element = source[dartx.get](i);
+          let element = source[dartx._get](i);
           if (dart.dcall(test, element) == retainMatching) {
             retained[dartx.add](element);
           }
@@ -5773,7 +5970,7 @@
         if (this[dartx.length] == 0) {
           dart.throw(_internal.IterableElementError.noElement());
         }
-        let result = this[dartx.get](dart.notNull(this[dartx.length]) - 1);
+        let result = this[dartx._get](dart.notNull(this[dartx.length]) - 1);
         this[dartx.length] = dart.notNull(this[dartx.length]) - 1;
         return result;
       }
@@ -5792,9 +5989,9 @@
         while (dart.notNull(length) > 1) {
           let pos = random.nextInt(length);
           length = dart.notNull(length) - 1;
-          let tmp = this[dartx.get](length);
-          this[dartx.set](length, this[dartx.get](pos));
-          this[dartx.set](pos, tmp);
+          let tmp = this[dartx._get](length);
+          this[dartx._set](length, this[dartx._get](pos));
+          this[dartx._set](pos, tmp);
         }
       }
       asMap() {
@@ -5809,7 +6006,7 @@
         let result = ListOfE().new();
         result[dartx.length] = length;
         for (let i = 0; i < length; i++) {
-          result[dartx.set](i, this[dartx.get](dart.notNull(start) + i));
+          result[dartx._set](i, this[dartx._get](dart.notNull(start) + i));
         }
         return result;
       }
@@ -5828,7 +6025,7 @@
         E._check(fill);
         core.RangeError.checkValidRange(start, end, this[dartx.length]);
         for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-          this[dartx.set](i, fill);
+          this[dartx._set](i, fill);
         }
       }
       setRange(start, end, iterable, skipCount) {
@@ -5852,11 +6049,11 @@
         }
         if (dart.notNull(otherStart) < dart.notNull(start)) {
           for (let i = length - 1; i >= 0; i--) {
-            this[dartx.set](dart.notNull(start) + i, otherList[dartx.get](dart.notNull(otherStart) + i));
+            this[dartx._set](dart.notNull(start) + i, otherList[dartx._get](dart.notNull(otherStart) + i));
           }
         } else {
           for (let i = 0; i < length; i++) {
-            this[dartx.set](dart.notNull(start) + i, otherList[dartx.get](dart.notNull(otherStart) + i));
+            this[dartx._set](dart.notNull(start) + i, otherList[dartx._get](dart.notNull(otherStart) + i));
           }
         }
       }
@@ -5895,7 +6092,7 @@
           startIndex = 0;
         }
         for (let i = startIndex; dart.notNull(i) < dart.notNull(this[dartx.length]); i = dart.notNull(i) + 1) {
-          if (dart.equals(this[dartx.get](i), element)) {
+          if (dart.equals(this[dartx._get](i), element)) {
             return i;
           }
         }
@@ -5914,7 +6111,7 @@
           }
         }
         for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) {
-          if (dart.equals(this[dartx.get](i), element)) {
+          if (dart.equals(this[dartx._get](i), element)) {
             return i;
           }
         }
@@ -5930,10 +6127,10 @@
         if (!(typeof index == 'number')) dart.throw(new core.ArgumentError(index));
         this[dartx.length] = dart.notNull(this[dartx.length]) + 1;
         this[dartx.setRange](dart.notNull(index) + 1, this[dartx.length], this, index);
-        this[dartx.set](index, element);
+        this[dartx._set](index, element);
       }
       removeAt(index) {
-        let result = this[dartx.get](index);
+        let result = this[dartx._get](index);
         this[dartx.setRange](index, dart.notNull(this[dartx.length]) - 1, this, dart.notNull(index) + 1);
         this[dartx.length] = dart.notNull(this[dartx.length]) - 1;
         return result;
@@ -5959,7 +6156,7 @@
           this[dartx.setRange](index, dart.notNull(index) + dart.notNull(iterable[dartx.length]), iterable);
         } else {
           for (let element of iterable) {
-            this[dartx.set]((() => {
+            this[dartx._set]((() => {
               let x = index;
               index = dart.notNull(x) + 1;
               return x;
@@ -6012,6 +6209,7 @@
         remove: dart.definiteFunctionType(core.bool, [core.Object]),
         removeWhere: dart.definiteFunctionType(dart.void, [ETobool()]),
         retainWhere: dart.definiteFunctionType(dart.void, [ETobool()]),
+        [_filter]: dart.definiteFunctionType(dart.void, [dynamicTobool(), core.bool]),
         clear: dart.definiteFunctionType(dart.void, []),
         removeLast: dart.definiteFunctionType(E, []),
         sort: dart.definiteFunctionType(dart.void, [], [EAndEToint()]),
@@ -6029,9 +6227,7 @@
         removeAt: dart.definiteFunctionType(E, [core.int]),
         insertAll: dart.definiteFunctionType(dart.void, [core.int, IterableOfE()]),
         setAll: dart.definiteFunctionType(dart.void, [core.int, IterableOfE()])
-      }),
-      statics: () => ({_filter: dart.definiteFunctionType(dart.void, [core.List, dynamicTobool(), core.bool])}),
-      names: ['_filter']
+      })
     });
     dart.defineExtensionMembers(ListMixin, [
       'elementAt',
@@ -6108,7 +6304,7 @@
     let ETobool = () => (ETobool = dart.constFn(dart.functionType(core.bool, [E])))();
     let ComparatorOfE = () => (ComparatorOfE = dart.constFn(core.Comparator$(E)))();
     class UnmodifiableListMixin extends core.Object {
-      set(index, value) {
+      _set(index, value) {
         E._check(value);
         dart.throw(new core.UnsupportedError("Cannot modify an unmodifiable list"));
         return value;
@@ -6185,7 +6381,7 @@
     dart.setSignature(UnmodifiableListMixin, {
       setters: () => ({length: dart.definiteFunctionType(dart.void, [core.int])}),
       methods: () => ({
-        set: dart.definiteFunctionType(dart.void, [core.int, E]),
+        _set: dart.definiteFunctionType(dart.void, [core.int, E]),
         setAll: dart.definiteFunctionType(dart.void, [core.int, IterableOfE()]),
         add: dart.definiteFunctionType(dart.void, [E]),
         insert: dart.definiteFunctionType(dart.void, [core.int, E]),
@@ -6206,7 +6402,7 @@
       })
     });
     dart.defineExtensionMembers(UnmodifiableListMixin, [
-      'set',
+      '_set',
       'setAll',
       'add',
       'insert',
@@ -6275,7 +6471,7 @@
     set length(value) {
       super.length = value;
     }
-    get(i) {
+    _get(i) {
       return this[_string][dartx.codeUnitAt](i);
     }
     static stringOf(u) {
@@ -6287,11 +6483,11 @@
     constructors: () => ({new: dart.definiteFunctionType(_internal.CodeUnits, [core.String])}),
     fields: () => ({[_string]: core.String}),
     getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
-    methods: () => ({get: dart.definiteFunctionType(core.int, [core.int])}),
+    methods: () => ({_get: dart.definiteFunctionType(core.int, [core.int])}),
     statics: () => ({stringOf: dart.definiteFunctionType(core.String, [_internal.CodeUnits])}),
     names: ['stringOf']
   });
-  dart.defineExtensionMembers(_internal.CodeUnits, ['get', 'length']);
+  dart.defineExtensionMembers(_internal.CodeUnits, ['_get', 'length']);
   _internal.EfficientLength = class EfficientLength extends core.Object {};
   core.Iterable$ = dart.generic(E => {
     let EmptyIterableOfE = () => (EmptyIterableOfE = dart.constFn(_internal.EmptyIterable$(E)))();
@@ -6810,7 +7006,7 @@
           result = ListOfE().new(this.length);
         }
         for (let i = 0; i < dart.notNull(this.length); i++) {
-          result[dartx.set](i, this.elementAt(i));
+          result[dartx._set](i, this.elementAt(i));
         }
         return result;
       }
@@ -6958,7 +7154,7 @@
           return _;
         })() : ListOfE().new(length);
         for (let i = 0; i < length; i++) {
-          result[dartx.set](i, this[_iterable$][dartx.elementAt](dart.notNull(start) + i));
+          result[dartx._set](i, this[_iterable$][dartx.elementAt](dart.notNull(start) + i));
           if (dart.notNull(this[_iterable$][dartx.length]) < dart.notNull(end)) dart.throw(new core.ConcurrentModificationError(this));
         }
         return result;
@@ -8008,8 +8204,8 @@
       new(values) {
         this[_values] = values;
       }
-      get(key) {
-        return dart.test(this.containsKey(key)) ? this[_values][dartx.get](core.int._check(key)) : null;
+      _get(key) {
+        return dart.test(this.containsKey(key)) ? this[_values][dartx._get](core.int._check(key)) : null;
       }
       get length() {
         return this[_values][dartx.length];
@@ -8035,13 +8231,13 @@
       forEach(f) {
         let length = this[_values][dartx.length];
         for (let i = 0; i < dart.notNull(length); i++) {
-          f(i, this[_values][dartx.get](i));
+          f(i, this[_values][dartx._get](i));
           if (length != this[_values][dartx.length]) {
             dart.throw(new core.ConcurrentModificationError(this[_values]));
           }
         }
       }
-      set(key, value) {
+      _set(key, value) {
         E._check(value);
         dart.throw(new core.UnsupportedError("Cannot modify an unmodifiable map"));
         return value;
@@ -8077,11 +8273,11 @@
         isNotEmpty: dart.definiteFunctionType(core.bool, [])
       }),
       methods: () => ({
-        get: dart.definiteFunctionType(E, [core.Object]),
+        _get: dart.definiteFunctionType(E, [core.Object]),
         containsValue: dart.definiteFunctionType(core.bool, [core.Object]),
         containsKey: dart.definiteFunctionType(core.bool, [core.Object]),
         forEach: dart.definiteFunctionType(dart.void, [intAndETovoid()]),
-        set: dart.definiteFunctionType(dart.void, [core.int, E]),
+        _set: dart.definiteFunctionType(dart.void, [core.int, E]),
         putIfAbsent: dart.definiteFunctionType(E, [core.int, VoidToE()]),
         remove: dart.definiteFunctionType(E, [core.Object]),
         clear: dart.definiteFunctionType(dart.void, []),
@@ -8089,11 +8285,11 @@
       })
     });
     dart.defineExtensionMembers(ListMapView, [
-      'get',
+      '_get',
       'containsValue',
       'containsKey',
       'forEach',
-      'set',
+      '_set',
       'putIfAbsent',
       'remove',
       'clear',
@@ -8190,11 +8386,11 @@
     static copy(src, srcStart, dst, dstStart, count) {
       if (dart.notNull(srcStart) < dart.notNull(dstStart)) {
         for (let i = dart.notNull(srcStart) + dart.notNull(count) - 1, j = dart.notNull(dstStart) + dart.notNull(count) - 1; i >= dart.notNull(srcStart); i--, j--) {
-          dst[dartx.set](j, src[dartx.get](i));
+          dst[dartx._set](j, src[dartx._get](i));
         }
       } else {
         for (let i = srcStart, j = dstStart; dart.notNull(i) < dart.notNull(srcStart) + dart.notNull(count); i = dart.notNull(i) + 1, j = dart.notNull(j) + 1) {
-          dst[dartx.set](j, src[dartx.get](i));
+          dst[dartx._set](j, src[dartx._get](i));
         }
       }
     }
@@ -8204,7 +8400,7 @@
       let length = a[dartx.length];
       if (!dart.equals(length, dart.dload(b, 'length'))) return false;
       for (let i = 0; i < dart.notNull(length); i++) {
-        if (!core.identical(a[dartx.get](i), dart.dindex(b, i))) return false;
+        if (!core.identical(a[dartx._get](i), dart.dindex(b, i))) return false;
       }
       return true;
     }
@@ -8216,7 +8412,7 @@
         startIndex = 0;
       }
       for (let i = startIndex; dart.notNull(i) < dart.notNull(endIndex); i = dart.notNull(i) + 1) {
-        if (dart.equals(a[dartx.get](i), element)) {
+        if (dart.equals(a[dartx._get](i), element)) {
           return i;
         }
       }
@@ -8230,7 +8426,7 @@
         startIndex = dart.notNull(a[dartx.length]) - 1;
       }
       for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) {
-        if (dart.equals(a[dartx.get](i), element)) {
+        if (dart.equals(a[dartx._get](i), element)) {
           return i;
         }
       }
@@ -8290,13 +8486,13 @@
     static _insertionSort(E) {
       return (a, left, right, compare) => {
         for (let i = dart.notNull(left) + 1; i <= dart.notNull(right); i++) {
-          let el = a[dartx.get](i);
+          let el = a[dartx._get](i);
           let j = i;
-          while (j > dart.notNull(left) && dart.notNull(compare(a[dartx.get](j - 1), el)) > 0) {
-            a[dartx.set](j, a[dartx.get](j - 1));
+          while (j > dart.notNull(left) && dart.notNull(compare(a[dartx._get](j - 1), el)) > 0) {
+            a[dartx._set](j, a[dartx._get](j - 1));
             j--;
           }
-          a[dartx.set](j, el);
+          a[dartx._set](j, el);
         }
       };
     }
@@ -8309,11 +8505,11 @@
         let index3 = ((dart.notNull(left) + dart.notNull(right)) / 2)[dartx.truncate]();
         let index2 = index3 - sixth;
         let index4 = index3 + sixth;
-        let el1 = a[dartx.get](index1);
-        let el2 = a[dartx.get](index2);
-        let el3 = a[dartx.get](index3);
-        let el4 = a[dartx.get](index4);
-        let el5 = a[dartx.get](index5);
+        let el1 = a[dartx._get](index1);
+        let el2 = a[dartx._get](index2);
+        let el3 = a[dartx._get](index3);
+        let el4 = a[dartx._get](index4);
+        let el5 = a[dartx._get](index5);
         if (dart.notNull(compare(el1, el2)) > 0) {
           let t = el1;
           el1 = el2;
@@ -8361,40 +8557,40 @@
         }
         let pivot1 = el2;
         let pivot2 = el4;
-        a[dartx.set](index1, el1);
-        a[dartx.set](index3, el3);
-        a[dartx.set](index5, el5);
-        a[dartx.set](index2, a[dartx.get](left));
-        a[dartx.set](index4, a[dartx.get](right));
+        a[dartx._set](index1, el1);
+        a[dartx._set](index3, el3);
+        a[dartx._set](index5, el5);
+        a[dartx._set](index2, a[dartx._get](left));
+        a[dartx._set](index4, a[dartx._get](right));
         let less = dart.notNull(left) + 1;
         let great = dart.notNull(right) - 1;
         let pivots_are_equal = compare(pivot1, pivot2) == 0;
         if (pivots_are_equal) {
           let pivot = pivot1;
           for (let k = less; k <= great; k++) {
-            let ak = a[dartx.get](k);
+            let ak = a[dartx._get](k);
             let comp = compare(ak, pivot);
             if (comp == 0) continue;
             if (dart.notNull(comp) < 0) {
               if (k != less) {
-                a[dartx.set](k, a[dartx.get](less));
-                a[dartx.set](less, ak);
+                a[dartx._set](k, a[dartx._get](less));
+                a[dartx._set](less, ak);
               }
               less++;
             } else {
               while (true) {
-                comp = compare(a[dartx.get](great), pivot);
+                comp = compare(a[dartx._get](great), pivot);
                 if (dart.notNull(comp) > 0) {
                   great--;
                   continue;
                 } else if (dart.notNull(comp) < 0) {
-                  a[dartx.set](k, a[dartx.get](less));
-                  a[dartx.set](less++, a[dartx.get](great));
-                  a[dartx.set](great--, ak);
+                  a[dartx._set](k, a[dartx._get](less));
+                  a[dartx._set](less++, a[dartx._get](great));
+                  a[dartx._set](great--, ak);
                   break;
                 } else {
-                  a[dartx.set](k, a[dartx.get](great));
-                  a[dartx.set](great--, ak);
+                  a[dartx._set](k, a[dartx._get](great));
+                  a[dartx._set](great--, ak);
                   break;
                 }
               }
@@ -8402,32 +8598,32 @@
           }
         } else {
           for (let k = less; k <= great; k++) {
-            let ak = a[dartx.get](k);
+            let ak = a[dartx._get](k);
             let comp_pivot1 = compare(ak, pivot1);
             if (dart.notNull(comp_pivot1) < 0) {
               if (k != less) {
-                a[dartx.set](k, a[dartx.get](less));
-                a[dartx.set](less, ak);
+                a[dartx._set](k, a[dartx._get](less));
+                a[dartx._set](less, ak);
               }
               less++;
             } else {
               let comp_pivot2 = compare(ak, pivot2);
               if (dart.notNull(comp_pivot2) > 0) {
                 while (true) {
-                  let comp = compare(a[dartx.get](great), pivot2);
+                  let comp = compare(a[dartx._get](great), pivot2);
                   if (dart.notNull(comp) > 0) {
                     great--;
                     if (great < k) break;
                     continue;
                   } else {
-                    comp = compare(a[dartx.get](great), pivot1);
+                    comp = compare(a[dartx._get](great), pivot1);
                     if (dart.notNull(comp) < 0) {
-                      a[dartx.set](k, a[dartx.get](less));
-                      a[dartx.set](less++, a[dartx.get](great));
-                      a[dartx.set](great--, ak);
+                      a[dartx._set](k, a[dartx._get](less));
+                      a[dartx._set](less++, a[dartx._get](great));
+                      a[dartx._set](great--, ak);
                     } else {
-                      a[dartx.set](k, a[dartx.get](great));
-                      a[dartx.set](great--, ak);
+                      a[dartx._set](k, a[dartx._get](great));
+                      a[dartx._set](great--, ak);
                     }
                     break;
                   }
@@ -8436,49 +8632,49 @@
             }
           }
         }
-        a[dartx.set](left, a[dartx.get](less - 1));
-        a[dartx.set](less - 1, pivot1);
-        a[dartx.set](right, a[dartx.get](great + 1));
-        a[dartx.set](great + 1, pivot2);
+        a[dartx._set](left, a[dartx._get](less - 1));
+        a[dartx._set](less - 1, pivot1);
+        a[dartx._set](right, a[dartx._get](great + 1));
+        a[dartx._set](great + 1, pivot2);
         _internal.Sort._doSort(E)(a, left, less - 2, compare);
         _internal.Sort._doSort(E)(a, great + 2, right, compare);
         if (pivots_are_equal) {
           return;
         }
         if (less < index1 && great > index5) {
-          while (compare(a[dartx.get](less), pivot1) == 0) {
+          while (compare(a[dartx._get](less), pivot1) == 0) {
             less++;
           }
-          while (compare(a[dartx.get](great), pivot2) == 0) {
+          while (compare(a[dartx._get](great), pivot2) == 0) {
             great--;
           }
           for (let k = less; k <= great; k++) {
-            let ak = a[dartx.get](k);
+            let ak = a[dartx._get](k);
             let comp_pivot1 = compare(ak, pivot1);
             if (comp_pivot1 == 0) {
               if (k != less) {
-                a[dartx.set](k, a[dartx.get](less));
-                a[dartx.set](less, ak);
+                a[dartx._set](k, a[dartx._get](less));
+                a[dartx._set](less, ak);
               }
               less++;
             } else {
               let comp_pivot2 = compare(ak, pivot2);
               if (comp_pivot2 == 0) {
                 while (true) {
-                  let comp = compare(a[dartx.get](great), pivot2);
+                  let comp = compare(a[dartx._get](great), pivot2);
                   if (comp == 0) {
                     great--;
                     if (great < k) break;
                     continue;
                   } else {
-                    comp = compare(a[dartx.get](great), pivot1);
+                    comp = compare(a[dartx._get](great), pivot1);
                     if (dart.notNull(comp) < 0) {
-                      a[dartx.set](k, a[dartx.get](less));
-                      a[dartx.set](less++, a[dartx.get](great));
-                      a[dartx.set](great--, ak);
+                      a[dartx._set](k, a[dartx._get](less));
+                      a[dartx._set](less++, a[dartx._get](great));
+                      a[dartx._set](great--, ak);
                     } else {
-                      a[dartx.set](k, a[dartx.get](great));
-                      a[dartx.set](great--, ak);
+                      a[dartx._set](k, a[dartx._get](great));
+                      a[dartx._set](great--, ak);
                     }
                     break;
                   }
@@ -8506,18 +8702,26 @@
   });
   _internal.Sort._INSERTION_SORT_THRESHOLD = 32;
   const _name = Symbol('_name');
+  const _nativeSymbol = Symbol('_nativeSymbol');
   _internal.Symbol = class Symbol extends core.Object {
     new(name) {
       this[_name] = name;
+      this[_nativeSymbol] = null;
+    }
+    es6(name, nativeSymbol) {
+      this[_name] = name;
+      this[_nativeSymbol] = nativeSymbol;
     }
     unvalidated(name) {
       this[_name] = name;
+      this[_nativeSymbol] = null;
     }
     validated(name) {
       this[_name] = _internal.Symbol.validatePublicSymbol(name);
+      this[_nativeSymbol] = null;
     }
     ['=='](other) {
-      return _internal.Symbol.is(other) && this[_name] == other[_name];
+      return _internal.Symbol.is(other) && this[_name] == other[_name] && dart.equals(this[_nativeSymbol], other[_nativeSymbol]);
     }
     get hashCode() {
       let hash = this._hashCode;
@@ -8533,6 +8737,9 @@
     static getName(symbol) {
       return symbol[_name];
     }
+    static getNativeSymbol(symbol) {
+      return symbol[_nativeSymbol];
+    }
     static validatePublicSymbol(name) {
       if (dart.test(name[dartx.isEmpty]) || dart.test(_internal.Symbol.publicSymbolPattern.hasMatch(name))) return name;
       if (dart.test(name[dartx.startsWith]('_'))) {
@@ -8544,16 +8751,21 @@
       return dart.test(name[dartx.isEmpty]) || dart.test(_internal.Symbol.symbolPattern.hasMatch(name));
     }
   };
+  dart.defineNamedConstructor(_internal.Symbol, 'es6');
   dart.defineNamedConstructor(_internal.Symbol, 'unvalidated');
   dart.defineNamedConstructor(_internal.Symbol, 'validated');
   _internal.Symbol[dart.implements] = () => [core.Symbol];
   dart.setSignature(_internal.Symbol, {
     constructors: () => ({
       new: dart.definiteFunctionType(_internal.Symbol, [core.String]),
+      es6: dart.definiteFunctionType(_internal.Symbol, [core.String, dart.dynamic]),
       unvalidated: dart.definiteFunctionType(_internal.Symbol, [core.String]),
       validated: dart.definiteFunctionType(_internal.Symbol, [core.String])
     }),
-    fields: () => ({[_name]: core.String}),
+    fields: () => ({
+      [_name]: core.String,
+      [_nativeSymbol]: dart.dynamic
+    }),
     methods: () => ({'==': dart.definiteFunctionType(core.bool, [core.Object])}),
     sfields: () => ({
       reservedWordRE: core.String,
@@ -8565,10 +8777,11 @@
     }),
     statics: () => ({
       getName: dart.definiteFunctionType(core.String, [_internal.Symbol]),
+      getNativeSymbol: dart.definiteFunctionType(dart.dynamic, [_internal.Symbol]),
       validatePublicSymbol: dart.definiteFunctionType(core.String, [core.String]),
       isValidSymbol: dart.definiteFunctionType(core.bool, [core.String])
     }),
-    names: ['getName', 'validatePublicSymbol', 'isValidSymbol']
+    names: ['getName', 'getNativeSymbol', 'validatePublicSymbol', 'isValidSymbol']
   });
   _internal.Symbol.reservedWordRE = '(?:assert|break|c(?:a(?:se|tch)|lass|on(?:st|tinue))|d(?:efault|o)|' + 'e(?:lse|num|xtends)|f(?:alse|inal(?:ly)?|or)|i[fns]|n(?:ew|ull)|' + 'ret(?:hrow|urn)|s(?:uper|witch)|t(?:h(?:is|row)|r(?:ue|y))|' + 'v(?:ar|oid)|w(?:hile|ith))';
   _internal.Symbol.operatorRE = '(?:[\\-+*/%&|^]|\\[\\]=?|==|~/?|<[<=]?|>[>=]?|unary-)';
@@ -8853,8 +9066,8 @@
         return;
       }
       let message = core.List.new(2);
-      message[dartx.set](0, dart.toString(error));
-      message[dartx.set](1, stackTrace == null ? null : dart.toString(stackTrace));
+      message[dartx._set](0, dart.toString(error));
+      message[dartx._set](1, stackTrace == null ? null : dart.toString(stackTrace));
       for (let port of this.errorPorts)
         port.send(message);
     }
@@ -8942,13 +9155,13 @@
       }
     }
     lookup(portId) {
-      return this.ports[dartx.get](portId);
+      return this.ports[dartx._get](portId);
     }
     [_addRegistration](portId, port) {
       if (dart.test(this.ports[dartx.containsKey](portId))) {
         dart.throw(core.Exception.new("Registry: ports must be registered only once."));
       }
-      this.ports[dartx.set](portId, port);
+      this.ports[dartx._set](portId, port);
     }
     register(portId, port) {
       this[_addRegistration](portId, port);
@@ -8960,7 +9173,7 @@
     }
     [_updateGlobalState]() {
       if (dart.notNull(this.ports[dartx.length]) - dart.notNull(this.weakPorts.length) > 0 || dart.test(this.isPaused) || !dart.test(this.initialized)) {
-        _isolate_helper._globalState.isolates[dartx.set](this.id, this);
+        _isolate_helper._globalState.isolates[dartx._set](this.id, this);
       } else {
         this.kill();
       }
@@ -9245,7 +9458,7 @@
         }
         case 'close':
         {
-          _isolate_helper._globalState.managers[dartx.remove](_isolate_helper.IsolateNatives.workerIds.get(sender));
+          _isolate_helper._globalState.managers[dartx.remove](_isolate_helper.IsolateNatives.workerIds._get(sender));
           sender.terminate();
           _isolate_helper._globalState.topEventLoop.run();
           break;
@@ -9408,8 +9621,8 @@
       let o = _isolate_helper._globalState;
       let workerId = o.nextManagerId;
       o.nextManagerId = dart.notNull(workerId) + 1;
-      _isolate_helper.IsolateNatives.workerIds.set(worker, workerId);
-      _isolate_helper._globalState.managers[dartx.set](workerId, worker);
+      _isolate_helper.IsolateNatives.workerIds._set(worker, workerId);
+      _isolate_helper._globalState.managers[dartx._set](workerId, worker);
       worker.postMessage(_isolate_helper._serializeMessage(dart.map({command: 'start', id: workerId, replyTo: _isolate_helper._serializeMessage(replyPort), args: args, msg: _isolate_helper._serializeMessage(message), isSpawnUri: isSpawnUri, startPaused: startPaused, functionName: functionName}, core.String, core.Object)));
     }
     static workerOnError(event, uri, onError) {
@@ -9492,7 +9705,7 @@
       super.new(isolateId);
     }
     send(message) {
-      let isolate = _isolate_helper._globalState.isolates[dartx.get](this[_isolateId]);
+      let isolate = _isolate_helper._globalState.isolates[dartx._get](this[_isolateId]);
       if (isolate == null) return;
       if (dart.test(this[_receivePort][_isClosed])) return;
       let msg = _isolate_helper._clone(message);
@@ -9532,7 +9745,7 @@
       if (dart.test(_isolate_helper._globalState.isWorker)) {
         _isolate_helper._globalState.mainManager.postMessage(workerMessage);
       } else {
-        let manager = _isolate_helper._globalState.managers[dartx.get](this[_workerId]);
+        let manager = _isolate_helper._globalState.managers[dartx._get](this[_workerId]);
         if (manager != null) {
           manager.postMessage(workerMessage);
         }
@@ -10570,10 +10783,10 @@
     }
     serialize(x) {
       if (dart.test(this.isPrimitive(x))) return this.serializePrimitive(x);
-      let serializationId = this.serializedObjectIds[dartx.get](x);
+      let serializationId = this.serializedObjectIds[dartx._get](x);
       if (serializationId != null) return this.makeRef(serializationId);
       serializationId = this.serializedObjectIds[dartx.length];
-      this.serializedObjectIds[dartx.set](x, serializationId);
+      this.serializedObjectIds[dartx._set](x, serializationId);
       if (_native_typed_data.NativeByteBuffer.is(x)) return this.serializeByteBuffer(x);
       if (_native_typed_data.NativeTypedData.is(x)) return this.serializeTypedData(x);
       if (_interceptors.JSIndexable.is(x)) return this.serializeJSIndexable(x);
@@ -10622,13 +10835,13 @@
       let serialized = [];
       serialized[dartx.length] = x[dartx.length];
       for (let i = 0; i < dart.notNull(x[dartx.length]); i++) {
-        serialized[dartx.set](i, this.serialize(x[dartx.get](i)));
+        serialized[dartx._set](i, this.serialize(x[dartx._get](i)));
       }
       return serialized;
     }
     serializeArrayInPlace(x) {
       for (let i = 0; i < dart.notNull(x[dartx.length]); i++) {
-        x[dartx.set](i, this.serialize(x[dartx.get](i)));
+        x[dartx._set](i, this.serialize(x[dartx._get](i)));
       }
       return x;
     }
@@ -10644,7 +10857,7 @@
       let values = [];
       values[dartx.length] = keys[dartx.length];
       for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-        values[dartx.set](i, this.serialize(x[keys[dartx.get](i)]));
+        values[dartx._set](i, this.serialize(x[keys[dartx._get](i)]));
       }
       return JSArrayOfObject().of(['js-object', keys, values]);
     }
@@ -10783,7 +10996,7 @@
     deserializeRef(x) {
       dart.assert(dart.equals(dart.dindex(x, 0), 'ref'));
       let serializationId = core.int._check(dart.dindex(x, 1));
-      return this.deserializedObjects[dartx.get](serializationId);
+      return this.deserializedObjects[dartx._get](serializationId);
     }
     deserializeByteBuffer(x) {
       dart.assert(dart.equals(dart.dindex(x, 0), 'buffer'));
@@ -10799,7 +11012,7 @@
     }
     deserializeArrayInPlace(x) {
       for (let i = 0; i < dart.notNull(x[dartx.length]); i++) {
-        x[dartx.set](i, this.deserialize(x[dartx.get](i)));
+        x[dartx._set](i, this.deserialize(x[dartx._get](i)));
       }
       return x;
     }
@@ -10828,14 +11041,14 @@
       return _interceptors.JSArray.markFixed(this.deserializeArrayInPlace(_interceptors.JSArray._check(result)));
     }
     deserializeMap(x) {
-      dart.assert(dart.equals(x.get(0), 'map'));
-      let keys = core.List._check(x.get(1));
-      let values = core.List._check(x.get(2));
+      dart.assert(dart.equals(x._get(0), 'map'));
+      let keys = core.List._check(x._get(1));
+      let values = core.List._check(x._get(2));
       let result = dart.map();
       this.deserializedObjects[dartx.add](result);
       keys = keys[dartx.map](dart.dynamic)(dart.bind(this, 'deserialize'))[dartx.toList]();
       for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-        result[dartx.set](keys[dartx.get](i), this.deserialize(values[dartx.get](i)));
+        result[dartx._set](keys[dartx._get](i), this.deserialize(values[dartx._get](i)));
       }
       return result;
     }
@@ -10846,7 +11059,7 @@
       let receivePortId = core.int._check(dart.dindex(x, 3));
       let result = null;
       if (managerId == _isolate_helper._globalState.currentManagerId) {
-        let isolate = _isolate_helper._globalState.isolates[dartx.get](isolateId);
+        let isolate = _isolate_helper._globalState.isolates[dartx._get](isolateId);
         if (isolate == null) return null;
         let receivePort = isolate.lookup(receivePortId);
         if (receivePort == null) return null;
@@ -10870,7 +11083,7 @@
       let o = {};
       this.deserializedObjects[dartx.add](o);
       for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-        o[keys[dartx.get](i)] = this.deserialize(values[dartx.get](i));
+        o[keys[dartx._get](i)] = this.deserialize(values[dartx._get](i));
       }
       return o;
     }
@@ -10994,12 +11207,12 @@
       if (match == null) {
         return _js_helper.Primitives._parseIntError(source, handleError);
       }
-      let decimalMatch = match[dartx.get](decimalIndex);
+      let decimalMatch = match[dartx._get](decimalIndex);
       if (radix == null) {
         if (decimalMatch != null) {
           return parseInt(source, 10);
         }
-        if (match[dartx.get](hexIndex) != null) {
+        if (match[dartx._get](hexIndex) != null) {
           return parseInt(source, 16);
         }
         return _js_helper.Primitives._parseIntError(source, handleError);
@@ -11020,7 +11233,7 @@
         } else {
           maxCharCode = 97 - 10 - 1 + dart.notNull(radix);
         }
-        dart.assert(typeof match[dartx.get](digitsIndex) == 'string');
+        dart.assert(typeof match[dartx._get](digitsIndex) == 'string');
         let digitsPart = match[digitsIndex];
         for (let i = 0; i < dart.notNull(digitsPart[dartx.length]); i++) {
           let characterCode = (dart.notNull(digitsPart[dartx.codeUnitAt](i)) | 32) >>> 0;
@@ -11158,11 +11371,11 @@
     static getTimeZoneName(receiver) {
       let d = _js_helper.Primitives.lazyAsJsDate(receiver);
       let match = /\((.*)\)/.exec(d.toString());
-      if (match != null) return core.String._check(match[dartx.get](1));
+      if (match != null) return core.String._check(match[dartx._get](1));
       match = /^[A-Z,a-z]{3}\s[A-Z,a-z]{3}\s\d+\s\d{2}:\d{2}:\d{2}\s([A-Z]{3,5})\s\d{4}$/.exec(d.toString());
-      if (match != null) return core.String._check(match[dartx.get](1));
+      if (match != null) return core.String._check(match[dartx._get](1));
       match = /(?:GMT|UTC)[+-]\d{4}/.exec(d.toString());
-      if (match != null) return core.String._check(match[dartx.get](0));
+      if (match != null) return core.String._check(match[dartx._get](0));
       return "";
     }
     static getTimeZoneOffsetInMinutes(receiver) {
@@ -11514,7 +11727,7 @@
     while (index < dart.notNull(length)) {
       let key = _js_helper.getIndex(keyValuePairs, index++);
       let value = _js_helper.getIndex(keyValuePairs, index++);
-      result[dartx.set](key, value);
+      result[dartx._set](key, value);
     }
     return result;
   };
@@ -11558,7 +11771,7 @@
     constructors: () => ({new: dart.definiteFunctionType(_js_helper.JSName, [core.String])}),
     fields: () => ({name: core.String})
   });
-  _js_helper.JavaScriptIndexingBehavior = class JavaScriptIndexingBehavior extends _interceptors.JSMutableIndexable {};
+  _js_helper.JavaScriptIndexingBehavior = class JavaScriptIndexingBehavior extends core.Object {};
   _js_helper.TypeErrorImplementation = class TypeErrorImplementation extends core.Error {
     new(value, actualType, expectedType) {
       this.message = dart.str`Type '${actualType}' is not a subtype ` + dart.str`of type '${expectedType}'`;
@@ -11918,7 +12131,7 @@
         return new (LinkedHashMapKeyIterableOfK())(this);
       }
       get values() {
-        return MappedIterableOfK$V().new(this.keys, dart.fn(each => this.get(each), KToV()));
+        return MappedIterableOfK$V().new(this.keys, dart.fn(each => this._get(each), KToV()));
       }
       containsKey(key) {
         if (dart.test(_js_helper.JsLinkedHashMap._isStringKey(key))) {
@@ -11940,15 +12153,15 @@
         return dart.notNull(this.internalFindBucketIndex(bucket, key)) >= 0;
       }
       containsValue(value) {
-        return this.keys[dartx.any](dart.fn(each => dart.equals(this.get(each), value), KTobool()));
+        return this.keys[dartx.any](dart.fn(each => dart.equals(this._get(each), value), KTobool()));
       }
       addAll(other) {
         MapOfK$V()._check(other);
         other[dartx.forEach](dart.fn((key, value) => {
-          this.set(key, value);
+          this._set(key, value);
         }, KAndVTovoid$()));
       }
-      get(key) {
+      _get(key) {
         if (dart.test(_js_helper.JsLinkedHashMap._isStringKey(key))) {
           let strings = this[_strings];
           if (strings == null) return null;
@@ -11972,7 +12185,7 @@
         let cell = bucket[index];
         return cell.hashMapCellValue;
       }
-      set(key, value) {
+      _set(key, value) {
         K._check(key);
         V._check(value);
         if (dart.test(_js_helper.JsLinkedHashMap._isStringKey(key))) {
@@ -12012,9 +12225,9 @@
       putIfAbsent(key, ifAbsent) {
         K._check(key);
         VoidToV()._check(ifAbsent);
-        if (dart.test(this.containsKey(key))) return this.get(key);
+        if (dart.test(this.containsKey(key))) return this._get(key);
         let value = ifAbsent();
-        this.set(key, value);
+        this._set(key, value);
         return value;
       }
       remove(key) {
@@ -12187,9 +12400,9 @@
         internalContainsKey: dart.definiteFunctionType(core.bool, [core.Object]),
         containsValue: dart.definiteFunctionType(core.bool, [core.Object]),
         addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
-        get: dart.definiteFunctionType(V, [core.Object]),
+        _get: dart.definiteFunctionType(V, [core.Object]),
         internalGet: dart.definiteFunctionType(V, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         internalSet: dart.definiteFunctionType(dart.void, [K, V]),
         putIfAbsent: dart.definiteFunctionType(V, [K, VoidToV()]),
         remove: dart.definiteFunctionType(V, [core.Object]),
@@ -12221,8 +12434,8 @@
       'containsKey',
       'containsValue',
       'addAll',
-      'get',
-      'set',
+      '_get',
+      '_set',
       'putIfAbsent',
       'remove',
       'clear',
@@ -12509,7 +12722,7 @@
       regexp.lastIndex = start;
       let match = regexp.exec(string);
       if (match == null) return null;
-      if (match[dartx.get](dart.notNull(match[dartx.length]) - 1) != null) return null;
+      if (match[dartx._get](dart.notNull(match[dartx.length]) - 1) != null) return null;
       match[dartx.length] = dart.notNull(match[dartx.length]) - 1;
       return new _js_helper._MatchImplementation(this, ListOfString()._check(match));
     }
@@ -12572,12 +12785,12 @@
       return this[_match].index;
     }
     get end() {
-      return dart.notNull(this.start) + dart.notNull(this[_match][dartx.get](0)[dartx.length]);
+      return dart.notNull(this.start) + dart.notNull(this[_match][dartx._get](0)[dartx.length]);
     }
     group(index) {
-      return this[_match][dartx.get](index);
+      return this[_match][dartx._get](index);
     }
-    get(index) {
+    _get(index) {
       return this.group(index);
     }
     get groupCount() {
@@ -12606,7 +12819,7 @@
     }),
     methods: () => ({
       group: dart.definiteFunctionType(core.String, [core.int]),
-      get: dart.definiteFunctionType(core.String, [core.int]),
+      _get: dart.definiteFunctionType(core.String, [core.int]),
       groups: dart.definiteFunctionType(core.List$(core.String), [ListOfint()])
     })
   });
@@ -12708,7 +12921,7 @@
     get end() {
       return dart.notNull(this.start) + dart.notNull(this.pattern[dartx.length]);
     }
-    get(g) {
+    _get(g) {
       return this.group(g);
     }
     get groupCount() {
@@ -12741,7 +12954,7 @@
       groupCount: dart.definiteFunctionType(core.int, [])
     }),
     methods: () => ({
-      get: dart.definiteFunctionType(core.String, [core.int]),
+      _get: dart.definiteFunctionType(core.String, [core.int]),
       group: dart.definiteFunctionType(core.String, [core.int]),
       groups: dart.definiteFunctionType(core.List$(core.String), [ListOfint()])
     })
@@ -12864,7 +13077,7 @@
           let length = receiver[dartx.length];
           result.write(replacement);
           for (let i = 0; i < dart.notNull(length); i++) {
-            result.write(receiver[dartx.get](i));
+            result.write(receiver[dartx._get](i));
             result.write(replacement);
           }
           return result.toString();
@@ -12884,7 +13097,7 @@
   };
   dart.lazyFn(_js_helper.stringReplaceAllUnchecked, () => StringAndPatternAndStringToString());
   _js_helper._matchString = function(match) {
-    return match.get(0);
+    return match._get(0);
   };
   dart.lazyFn(_js_helper._matchString, () => MatchToString$());
   _js_helper._stringIdentity = function(string) {
@@ -12927,7 +13140,7 @@
           continue;
         }
       }
-      buffer.write(onNonMatch(receiver[dartx.get](i)));
+      buffer.write(onNonMatch(receiver[dartx._get](i)));
       i++;
     }
     buffer.write(onMatch(new _js_helper.StringMatch(i, receiver, "")));
@@ -13079,65 +13292,109 @@
     return _js_mirrors._dart.definiteFunctionType(type, []);
   };
   dart.fn(_js_mirrors._defaultConstructorType, dynamicTodynamic$());
+  _js_mirrors._getMixins = function(type) {
+    return _js_mirrors._dart.getMixins(type, []);
+  };
+  dart.fn(_js_mirrors._getMixins, dynamicTodynamic$());
   _js_mirrors._Lazy$ = dart.generic(T => {
     const _Lazy = dart.typedef('_Lazy', () => dart.functionType(T, []));
     return _Lazy;
   });
   _js_mirrors._Lazy = _Lazy();
+  _js_mirrors._getESSymbol = function(symbol) {
+    return _internal.Symbol.getNativeSymbol(_internal.Symbol.as(symbol));
+  };
+  dart.lazyFn(_js_mirrors._getESSymbol, () => SymbolTodynamic());
+  _js_mirrors._getMember = function(symbol) {
+    let privateSymbol = _js_mirrors._getESSymbol(symbol);
+    if (privateSymbol != null) {
+      return privateSymbol;
+    }
+    return _js_mirrors.getName(symbol);
+  };
+  dart.lazyFn(_js_mirrors._getMember, () => SymbolTodynamic());
+  _js_mirrors._getNameForESSymbol = function(member) {
+    dart.assert(typeof member == "symbol");
+    let str = dart.toString(member);
+    dart.assert(dart.test(str[dartx.startsWith]('Symbol(')) && dart.test(str[dartx.endsWith](')')));
+    return str[dartx.substring](7, dart.notNull(str[dartx.length]) - 1);
+  };
+  dart.lazyFn(_js_mirrors._getNameForESSymbol, () => dynamicToString());
+  _js_mirrors._getSymbolForESSymbol = function(member) {
+    let name = _js_mirrors._getNameForESSymbol(member);
+    return new _internal.Symbol.es6(name, member);
+  };
+  dart.lazyFn(_js_mirrors._getSymbolForESSymbol, () => dynamicToSymbol());
+  _js_mirrors._getSymbolForMember = function(member) {
+    if (typeof member == 'string') {
+      return core.Symbol.new(member);
+    } else {
+      let name = _js_mirrors._getNameForESSymbol(member);
+      return new _internal.Symbol.es6(name, member);
+    }
+  };
+  dart.lazyFn(_js_mirrors._getSymbolForMember, () => dynamicToSymbol());
+  _js_mirrors._toDartMap = function(data) {
+    if (data == null) return dart.map({}, core.Symbol, dart.dynamic);
+    let map = MapOfSymbol$dynamic().new();
+    let publicMembers = Object.getOwnPropertyNames(data);
+    for (let member of core.Iterable._check(publicMembers)) {
+      let symbol = core.Symbol.new(core.String._check(member));
+      map[dartx._set](symbol, data[member]);
+    }
+    let privateMembers = Object.getOwnPropertySymbols(data);
+    for (let member of core.Iterable._check(privateMembers)) {
+      let symbol = _js_mirrors._getSymbolForESSymbol(member);
+      map[dartx._set](symbol, data[member]);
+    }
+    return map;
+  };
+  dart.lazyFn(_js_mirrors._toDartMap, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getConstructors = function(obj) {
     let sig = _js_mirrors._dart.getConstructorSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getConstructors, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getConstructors, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getFields = function(obj) {
     let sig = _js_mirrors._dart.getFieldSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getFields, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getFields, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getMethods = function(obj) {
     let sig = _js_mirrors._dart.getMethodSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getMethods, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getMethods, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getGetters = function(obj) {
     let sig = _js_mirrors._dart.getGetterSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getGetters, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getGetters, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getSetters = function(obj) {
     let sig = _js_mirrors._dart.getSetterSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getSetters, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getSetters, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getStaticFields = function(obj) {
     let sig = _js_mirrors._dart.getStaticFieldSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getStaticFields, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getStaticFields, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getStatics = function(obj) {
     let sig = _js_mirrors._dart.getStaticSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getStatics, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getStatics, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getStaticGetters = function(obj) {
     let sig = _js_mirrors._dart.getStaticGetterSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getStaticGetters, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getStaticGetters, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._getStaticSetters = function(obj) {
     let sig = _js_mirrors._dart.getStaticSetterSig(obj);
-    if (sig == null) return dart.map();
-    return _js_mirrors._dart.map(sig);
+    return _js_mirrors._toDartMap(sig);
   };
-  dart.lazyFn(_js_mirrors._getStaticSetters, () => dynamicToMap());
+  dart.lazyFn(_js_mirrors._getStaticSetters, () => dynamicToMapOfSymbol$dynamic());
   _js_mirrors._unwrap = function(obj) {
     return _js_mirrors._dart.unwrapType(obj);
   };
@@ -13146,10 +13403,22 @@
     return _js_mirrors._dart.wrapType(obj);
   };
   dart.fn(_js_mirrors._wrap, dynamicTodynamic$());
+  _js_mirrors._runtimeType = function(obj) {
+    return _js_mirrors._wrap(_js_mirrors._dart.getReifiedType(obj));
+  };
+  dart.fn(_js_mirrors._runtimeType, dynamicTodynamic$());
   _js_mirrors._unimplemented = function(t, i) {
-    dart.throw(new core.UnimplementedError(dart.str`${t}.${i.memberName} unimplemented`));
+    dart.throw(new core.UnimplementedError(dart.str`${t}.${_js_mirrors.getName(i.memberName)} unimplemented`));
   };
   dart.fn(_js_mirrors._unimplemented, TypeAndInvocationTodynamic());
+  _js_mirrors._toJsMap = function(map) {
+    let obj = {};
+    map[dartx.forEach](dart.fn((key, value) => {
+      obj[_js_mirrors.getName(key)] = value;
+    }, SymbolAnddynamicTovoid()));
+    return obj;
+  };
+  dart.lazyFn(_js_mirrors._toJsMap, () => MapOfSymbol$dynamicTodynamic());
   _js_mirrors.JsMirror = class JsMirror extends core.Object {
     noSuchMethod(i) {
       _js_mirrors._unimplemented(this.runtimeType, i);
@@ -13243,14 +13512,14 @@
     }
   };
   _js_mirrors.JsObjectMirror[dart.implements] = () => [mirrors.ObjectMirror];
-  const _toJsMap = Symbol('_toJsMap');
+  const _getAccessor = Symbol('_getAccessor');
   _js_mirrors.JsInstanceMirror = class JsInstanceMirror extends _js_mirrors.JsObjectMirror {
     get hasReflectee() {
       return true;
     }
     get type() {
       if (this.reflectee == null) return mirrors.reflectClass(dart.wrapType(core.Null));
-      return mirrors.ClassMirror._check(_js_mirrors.reflectType(core.Type._check(dart.runtimeType(this.reflectee))));
+      return mirrors.ClassMirror._check(_js_mirrors.reflectType(core.Type._check(_js_mirrors._runtimeType(this.reflectee))));
     }
     _(reflectee) {
       this.reflectee = reflectee;
@@ -13261,32 +13530,33 @@
     get hashCode() {
       return (dart.notNull(core.identityHashCode(this.reflectee)) ^ 909522486) >>> 0;
     }
+    [_getAccessor](reflectee, symbol, args, namedArgs) {
+      if (args === void 0) args = null;
+      if (namedArgs === void 0) namedArgs = null;
+      return _js_mirrors._getMember(symbol);
+    }
     getField(symbol) {
-      let name = _js_mirrors.getName(symbol);
-      let field = _js_mirrors._dload(this.reflectee, name);
+      let name = this[_getAccessor](this.reflectee, symbol);
+      let field = _js_mirrors._dload(this.reflectee, core.String._check(name));
       return _js_mirrors.reflect(field);
     }
     setField(symbol, value) {
-      let name = _js_mirrors.getName(symbol);
-      _js_mirrors._dput(this.reflectee, name, value);
+      let name = this[_getAccessor](this.reflectee, symbol);
+      _js_mirrors._dput(this.reflectee, core.String._check(name), value);
       return _js_mirrors.reflect(value);
     }
     invoke(symbol, args, namedArgs) {
       if (namedArgs === void 0) namedArgs = null;
-      let name = _js_mirrors.getName(symbol);
+      let name = this[_getAccessor](this.reflectee, symbol, args, namedArgs);
       if (namedArgs != null) {
         args = core.List.from(args);
-        args[dartx.add](this[_toJsMap](namedArgs));
+        args[dartx.add](_js_mirrors._toJsMap(namedArgs));
       }
-      let result = _js_mirrors._dsend(this.reflectee, name, args);
+      let result = _js_mirrors._dsend(this.reflectee, core.String._check(name), args);
       return _js_mirrors.reflect(result);
     }
-    [_toJsMap](map) {
-      let obj = {};
-      map[dartx.forEach](dart.fn((key, value) => {
-        obj[_js_mirrors.getName(key)] = value;
-      }, SymbolAnddynamicTovoid()));
-      return obj;
+    toString() {
+      return dart.str`InstanceMirror on '${this.reflectee}'`;
     }
     delegate(...args) {
       return this.noSuchMethod(new dart.InvocationImpl('delegate', args, {isMethod: true}));
@@ -13303,10 +13573,10 @@
     }),
     methods: () => ({
       '==': dart.definiteFunctionType(core.bool, [core.Object]),
+      [_getAccessor]: dart.definiteFunctionType(dart.dynamic, [dart.dynamic, core.Symbol], [core.List, MapOfSymbol$dynamic()]),
       getField: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol]),
       setField: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.Object]),
-      invoke: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.List], [MapOfSymbol$dynamic()]),
-      [_toJsMap]: dart.definiteFunctionType(dart.dynamic, [MapOfSymbol$dynamic()])
+      invoke: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.List], [MapOfSymbol$dynamic()])
     })
   });
   _js_mirrors.JsClosureMirror = class JsClosureMirror extends _js_mirrors.JsInstanceMirror {
@@ -13317,7 +13587,7 @@
       if (namedArgs === void 0) namedArgs = null;
       if (namedArgs != null) {
         args = core.List.from(args);
-        args[dartx.add](this[_toJsMap](namedArgs));
+        args[dartx.add](_js_mirrors._toJsMap(namedArgs));
       }
       let result = _js_mirrors._dcall(this.reflectee, args);
       return _js_mirrors.reflect(result);
@@ -13340,12 +13610,14 @@
   let const$0;
   const _declarations = Symbol('_declarations');
   const _raw = Symbol('_raw');
+  const _mixin = Symbol('_mixin');
   const _typeArguments = Symbol('_typeArguments');
   let const$1;
   _js_mirrors.JsClassMirror = class JsClassMirror extends _js_mirrors.JsMirror {
     get metadata() {
       if (this[_metadata$] == null) {
-        let fn = _js_mirrors._unwrap(this[_cls])[dart.metadata];
+        let unwrapped = _js_mirrors._unwrap(this[_cls]);
+        let fn = Object.hasOwnProperty.call(unwrapped, dart.metadata) ? unwrapped[dart.metadata] : null;
         this[_metadata$] = fn == null ? const$0 || (const$0 = dart.constList([], mirrors.InstanceMirror)) : ListOfInstanceMirror().unmodifiable(core.Iterable._check(dart.dsend(dart.dcall(fn), 'map', dart.fn(i => _js_mirrors.reflect(i), dynamicToInstanceMirror()))));
       }
       return this[_metadata$];
@@ -13355,67 +13627,66 @@
         this[_declarations] = MapOfSymbol$DeclarationMirror().new();
         let unwrapped = _js_mirrors._unwrap(this[_cls]);
         let constructors = _js_mirrors._getConstructors(unwrapped);
-        constructors[dartx.forEach](dart.fn((name, ft) => {
-          let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._constructor(this, name, ft));
-        }, StringAnddynamicTovoid()));
+        constructors[dartx.forEach](dart.fn((symbol, ft) => {
+          let name = _js_mirrors.getName(symbol);
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._constructor(this, symbol, ft));
+        }, SymbolAnddynamicTovoid()));
         if (dart.test(constructors[dartx.isEmpty])) {
           let name = 'new';
           let ft = _js_mirrors._defaultConstructorType(_js_mirrors._unwrap(this[_cls]));
           let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._constructor(this, name, ft));
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._constructor(this, symbol, ft));
         }
         let fields = _js_mirrors._getFields(unwrapped);
-        fields[dartx.forEach](dart.fn((name, t) => {
-          let symbol = core.Symbol.new(name);
+        fields[dartx.forEach](dart.fn((symbol, t) => {
           let metadata = [];
           if (core.List.is(t)) {
             metadata = core.List._check(dart.dsend(dart.dsend(t, 'skip', 1), 'toList'));
             t = dart.dindex(t, 0);
           }
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsVariableMirror._(name, core.Type._check(_js_mirrors._wrap(t)), metadata));
-        }, StringAnddynamicTovoid()));
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsVariableMirror._(symbol, core.Type._check(_js_mirrors._wrap(t)), metadata));
+        }, SymbolAnddynamicTovoid()));
         let methods = _js_mirrors._getMethods(unwrapped);
-        methods[dartx.forEach](dart.fn((name, ft) => {
-          let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, name, ft));
-        }, StringAnddynamicTovoid()));
+        methods[dartx.forEach](dart.fn((symbol, ft) => {
+          let name = _js_mirrors.getName(symbol);
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, symbol, ft));
+        }, SymbolAnddynamicTovoid()));
         let getters = _js_mirrors._getGetters(unwrapped);
-        getters[dartx.forEach](dart.fn((name, ft) => {
-          let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, name, ft));
-        }, StringAnddynamicTovoid()));
+        getters[dartx.forEach](dart.fn((symbol, ft) => {
+          let name = _js_mirrors.getName(symbol);
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, symbol, ft));
+        }, SymbolAnddynamicTovoid()));
         let setters = _js_mirrors._getSetters(unwrapped);
-        setters[dartx.forEach](dart.fn((name, ft) => {
-          name = dart.notNull(name) + '=';
-          let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, name, ft));
-        }, StringAnddynamicTovoid()));
+        setters[dartx.forEach](dart.fn((symbol, ft) => {
+          let name = dart.notNull(_js_mirrors.getName(symbol)) + '=';
+          symbol = new _internal.Symbol.es6(name, _js_mirrors._getESSymbol(symbol));
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._instanceMethod(this, symbol, ft));
+        }, SymbolAnddynamicTovoid()));
         let staticFields = _js_mirrors._getStaticFields(unwrapped);
-        staticFields[dartx.forEach](dart.fn((name, t) => {
-          let symbol = core.Symbol.new(name);
+        staticFields[dartx.forEach](dart.fn((symbol, t) => {
+          let name = _js_mirrors.getName(symbol);
           let metadata = [];
           if (core.List.is(t)) {
             metadata = core.List._check(dart.dsend(dart.dsend(t, 'skip', 1), 'toList'));
             t = dart.dindex(t, 0);
           }
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsVariableMirror._(name, core.Type._check(_js_mirrors._wrap(t)), metadata));
-        }, StringAnddynamicTovoid()));
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsVariableMirror._(symbol, core.Type._check(_js_mirrors._wrap(t)), metadata));
+        }, SymbolAnddynamicTovoid()));
         let statics = _js_mirrors._getStatics(unwrapped);
-        statics[dartx.forEach](dart.fn((name, ft) => {
-          let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, name, ft));
-        }, StringAnddynamicTovoid()));
+        statics[dartx.forEach](dart.fn((symbol, ft) => {
+          let name = _js_mirrors.getName(symbol);
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, symbol, ft));
+        }, SymbolAnddynamicTovoid()));
         let staticGetters = _js_mirrors._getStaticGetters(unwrapped);
-        staticGetters[dartx.forEach](dart.fn((name, ft) => {
-          let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, name, ft));
-        }, StringAnddynamicTovoid()));
+        staticGetters[dartx.forEach](dart.fn((symbol, ft) => {
+          let name = _js_mirrors.getName(symbol);
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, symbol, ft));
+        }, SymbolAnddynamicTovoid()));
         let staticSetters = _js_mirrors._getStaticSetters(unwrapped);
-        staticSetters[dartx.forEach](dart.fn((name, ft) => {
-          let symbol = core.Symbol.new(name);
-          this[_declarations][dartx.set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, name, ft));
-        }, StringAnddynamicTovoid()));
+        staticSetters[dartx.forEach](dart.fn((symbol, ft) => {
+          let name = _js_mirrors.getName(symbol);
+          this[_declarations][dartx._set](symbol, new _js_mirrors.JsMethodMirror._staticMethod(this, symbol, ft));
+        }, SymbolAnddynamicTovoid()));
         this[_declarations] = MapOfSymbol$DeclarationMirror().unmodifiable(this[_declarations]);
       }
       return this[_declarations];
@@ -13424,7 +13695,7 @@
       this[_cls] = cls;
       this[_raw] = _js_mirrors._getGenericClass(_js_mirrors._unwrap(cls));
       this.simpleName = core.Symbol.new(_js_mirrors._unwrap(cls).name);
-      this.mixin = null;
+      this[_mixin] = null;
       this[_typeArguments] = null;
       this[_metadata$] = null;
       this[_declarations] = null;
@@ -13442,6 +13713,25 @@
       let instance = name == 'new' || name == '' ? new (_js_mirrors._unwrap(this[_cls]))(...args) : new (_js_mirrors._unwrap(this[_cls]))[name](...args);
       return _js_mirrors.reflect(instance);
     }
+    getField(symbol) {
+      let name = _js_mirrors.getName(symbol);
+      return _js_mirrors.reflect(_js_mirrors._unwrap(this[_cls])[name]);
+    }
+    setField(symbol, value) {
+      let name = _js_mirrors.getName(symbol);
+      _js_mirrors._unwrap(this[_cls])[name] = value;
+      return _js_mirrors.reflect(value);
+    }
+    invoke(symbol, args, namedArgs) {
+      if (namedArgs === void 0) namedArgs = null;
+      let name = _js_mirrors.getName(symbol);
+      if (namedArgs != null) {
+        args = core.List.from(args);
+        args[dartx.add](_js_mirrors._toJsMap(namedArgs));
+      }
+      let result = _js_mirrors._unwrap(this[_cls])[name](...args);
+      return _js_mirrors.reflect(result);
+    }
     get superinterfaces() {
       let interfaceThunk = _js_mirrors._unwrap(this[_cls])[dart.implements];
       if (interfaceThunk == null) {
@@ -13476,6 +13766,24 @@
         return mirrors.ClassMirror._check(_js_mirrors.reflectType(core.Type._check(_js_mirrors._wrap(_js_mirrors._unwrap(this[_cls]).__proto__))));
       }
     }
+    get mixin() {
+      if (this[_mixin] != null) {
+        return this[_mixin];
+      }
+      let mixins = _js_mirrors._getMixins(_js_mirrors._unwrap(this[_cls]));
+      if (mixins == null || dart.test(dart.dload(mixins, 'isEmpty'))) {
+        this[_mixin] = this;
+        return this[_mixin];
+      }
+      if (dart.test(dart.dsend(dart.dload(mixins, 'length'), '>', 1))) {
+        dart.throw(new core.UnsupportedError("ClassMirror.mixin not yet supported for " + dart.str`classes (${this[_cls]}) with multiple mixins`));
+      }
+      this[_mixin] = mirrors.ClassMirror._check(_js_mirrors.reflectType(core.Type._check(_js_mirrors._wrap(dart.dindex(mixins, 0)))));
+      return this[_mixin];
+    }
+    toString() {
+      return dart.str`ClassMirror on '${this[_cls]}'`;
+    }
     get qualifiedName() {
       return core.Symbol._check(this.noSuchMethod(new dart.InvocationImpl('qualifiedName', [], {isGetter: true})));
     }
@@ -13500,15 +13808,6 @@
     get typeVariables() {
       return ListOfTypeVariableMirror()._check(this.noSuchMethod(new dart.InvocationImpl('typeVariables', [], {isGetter: true})));
     }
-    invoke(...args) {
-      return mirrors.InstanceMirror._check(this.noSuchMethod(new dart.InvocationImpl('invoke', args, {isMethod: true})));
-    }
-    getField(...args) {
-      return mirrors.InstanceMirror._check(this.noSuchMethod(new dart.InvocationImpl('getField', args, {isMethod: true})));
-    }
-    setField(...args) {
-      return mirrors.InstanceMirror._check(this.noSuchMethod(new dart.InvocationImpl('setField', args, {isMethod: true})));
-    }
     isSubclassOf(...args) {
       return core.bool._check(this.noSuchMethod(new dart.InvocationImpl('isSubclassOf', args, {isMethod: true})));
     }
@@ -13530,7 +13829,7 @@
       [_cls]: core.Type,
       simpleName: core.Symbol,
       [_raw]: dart.dynamic,
-      mixin: mirrors.ClassMirror,
+      [_mixin]: mirrors.ClassMirror,
       [_typeArguments]: ListOfTypeMirror(),
       [_metadata$]: ListOfInstanceMirror(),
       [_declarations]: MapOfSymbol$DeclarationMirror()
@@ -13544,22 +13843,33 @@
       isOriginalDeclaration: dart.definiteFunctionType(core.bool, []),
       typeArguments: dart.definiteFunctionType(core.List$(mirrors.TypeMirror), []),
       originalDeclaration: dart.definiteFunctionType(mirrors.TypeMirror, []),
-      superclass: dart.definiteFunctionType(mirrors.ClassMirror, [])
+      superclass: dart.definiteFunctionType(mirrors.ClassMirror, []),
+      mixin: dart.definiteFunctionType(mirrors.ClassMirror, [])
     }),
-    methods: () => ({newInstance: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.List], [MapOfSymbol$dynamic()])})
+    methods: () => ({
+      newInstance: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.List], [MapOfSymbol$dynamic()]),
+      getField: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol]),
+      setField: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.Object]),
+      invoke: dart.definiteFunctionType(mirrors.InstanceMirror, [core.Symbol, core.List], [MapOfSymbol$dynamic()])
+    })
   });
+  const _symbol = Symbol('_symbol');
   const _name$ = Symbol('_name');
   _js_mirrors.JsVariableMirror = class JsVariableMirror extends _js_mirrors.JsMirror {
     get simpleName() {
-      return core.Symbol.new(this[_name$]);
+      return this[_symbol];
     }
-    _(name, t, annotations) {
-      this[_name$] = name;
+    _(symbol, t, annotations) {
+      this[_symbol] = symbol;
+      this[_name$] = _js_mirrors.getName(symbol);
       this.type = _js_mirrors.reflectType(t);
       this.metadata = ListOfInstanceMirror().unmodifiable(annotations[dartx.map](mirrors.InstanceMirror)(dart.fn(a => _js_mirrors.reflect(a), dynamicToInstanceMirror())));
       this.isStatic = false;
       this.isFinal = false;
     }
+    toString() {
+      return dart.str`VariableMirror on '${this[_name$]}'`;
+    }
     get qualifiedName() {
       return core.Symbol._check(this.noSuchMethod(new dart.InvocationImpl('qualifiedName', [], {isGetter: true})));
     }
@@ -13582,8 +13892,9 @@
   dart.defineNamedConstructor(_js_mirrors.JsVariableMirror, '_');
   _js_mirrors.JsVariableMirror[dart.implements] = () => [mirrors.VariableMirror];
   dart.setSignature(_js_mirrors.JsVariableMirror, {
-    constructors: () => ({_: dart.definiteFunctionType(_js_mirrors.JsVariableMirror, [core.String, core.Type, core.List])}),
+    constructors: () => ({_: dart.definiteFunctionType(_js_mirrors.JsVariableMirror, [core.Symbol, core.Type, core.List])}),
     fields: () => ({
+      [_symbol]: core.Symbol,
       [_name$]: core.String,
       type: mirrors.TypeMirror,
       metadata: ListOfInstanceMirror(),
@@ -13593,8 +13904,11 @@
     getters: () => ({simpleName: dart.definiteFunctionType(core.Symbol, [])})
   });
   _js_mirrors.JsParameterMirror = class JsParameterMirror extends _js_mirrors.JsVariableMirror {
-    _(name, t, annotations) {
-      super._(name, t, annotations);
+    _(member, t, annotations) {
+      super._(member, t, annotations);
+    }
+    toString() {
+      return dart.str`ParameterMirror on '${this[_name$]}'`;
     }
     get qualifiedName() {
       return core.Symbol._check(this.noSuchMethod(new dart.InvocationImpl('qualifiedName', [], {isGetter: true})));
@@ -13630,7 +13944,7 @@
   dart.defineNamedConstructor(_js_mirrors.JsParameterMirror, '_');
   _js_mirrors.JsParameterMirror[dart.implements] = () => [mirrors.ParameterMirror];
   dart.setSignature(_js_mirrors.JsParameterMirror, {
-    constructors: () => ({_: dart.definiteFunctionType(_js_mirrors.JsParameterMirror, [core.String, core.Type, core.List])})
+    constructors: () => ({_: dart.definiteFunctionType(_js_mirrors.JsParameterMirror, [core.Symbol, core.Type, core.List])})
   });
   const _params = Symbol('_params');
   const _createParameterMirrorList = Symbol('_createParameterMirrorList');
@@ -13645,10 +13959,11 @@
       return this[_name$][dartx.startsWith]('_');
     }
     get simpleName() {
-      return core.Symbol.new(this[_name$]);
+      return this[_symbol];
     }
-    _constructor(cls, name, ftype) {
-      this[_name$] = name;
+    _constructor(cls, symbol, ftype) {
+      this[_symbol] = symbol;
+      this[_name$] = _js_mirrors.getName(symbol);
       this.isConstructor = true;
       this.isStatic = false;
       this[_params] = null;
@@ -13656,8 +13971,9 @@
       this.isFinal = false;
       this[_createParameterMirrorList](ftype);
     }
-    _instanceMethod(cls, name, ftype) {
-      this[_name$] = name;
+    _instanceMethod(cls, symbol, ftype) {
+      this[_symbol] = symbol;
+      this[_name$] = _js_mirrors.getName(symbol);
       this.isConstructor = false;
       this.isStatic = false;
       this[_params] = null;
@@ -13665,8 +13981,9 @@
       this.isFinal = false;
       this[_createParameterMirrorList](ftype);
     }
-    _staticMethod(cls, name, ftype) {
-      this[_name$] = name;
+    _staticMethod(cls, symbol, ftype) {
+      this[_symbol] = symbol;
+      this[_name$] = _js_mirrors.getName(symbol);
       this.isConstructor = false;
       this.isStatic = true;
       this[_params] = null;
@@ -13675,7 +13992,7 @@
       this[_createParameterMirrorList](ftype);
     }
     get constructorName() {
-      return dart.test(this.isConstructor) ? core.Symbol.new(this[_name$]) : null;
+      return dart.test(this.isConstructor) ? this[_symbol] : null;
     }
     get parameters() {
       return this[_params];
@@ -13689,29 +14006,35 @@
         this[_metadata$] = const$3 || (const$3 = dart.constList([], mirrors.InstanceMirror));
         return;
       }
-      if (core.List.is(ftype)) {
+      if (!core.Function.is(ftype) && core.List.is(ftype)) {
         this[_metadata$] = ListOfInstanceMirror().unmodifiable(core.Iterable._check(dart.dsend(dart.dsend(ftype, 'skip', 1), 'map', dart.fn(a => _js_mirrors.reflect(a), dynamicToInstanceMirror()))));
         ftype = dart.dindex(ftype, 0);
       } else {
         this[_metadata$] = const$4 || (const$4 = dart.constList([], mirrors.InstanceMirror));
       }
+      if (typeof ftype == "function") {
+        ftype = ftype.apply(null, JSArrayOfType().of([dart.dynamic, dart.dynamic, dart.dynamic]));
+      }
       let args = core.List._check(dart.dload(ftype, 'args'));
       let opts = core.List._check(dart.dload(ftype, 'optionals'));
       let params = ListOfParameterMirror().new(dart.notNull(args[dartx.length]) + dart.notNull(opts[dartx.length]));
       for (let i = 0; i < dart.notNull(args[dartx.length]); ++i) {
-        let type = args[dartx.get](i);
+        let type = args[dartx._get](i);
         let metadata = dart.dindex(dart.dload(ftype, 'metadata'), i);
-        let param = new _js_mirrors.JsParameterMirror._('', core.Type._check(_js_mirrors._wrap(type)), core.List._check(metadata));
-        params[dartx.set](i, param);
+        let param = new _js_mirrors.JsParameterMirror._(core.Symbol.new(''), core.Type._check(_js_mirrors._wrap(type)), core.List._check(metadata));
+        params[dartx._set](i, param);
       }
       for (let i = 0; i < dart.notNull(opts[dartx.length]); ++i) {
-        let type = opts[dartx.get](i);
+        let type = opts[dartx._get](i);
         let metadata = dart.dindex(dart.dload(ftype, 'metadata'), dart.notNull(args[dartx.length]) + i);
-        let param = new _js_mirrors.JsParameterMirror._('', core.Type._check(_js_mirrors._wrap(type)), core.List._check(metadata));
-        params[dartx.set](i + dart.notNull(args[dartx.length]), param);
+        let param = new _js_mirrors.JsParameterMirror._(core.Symbol.new(''), core.Type._check(_js_mirrors._wrap(type)), core.List._check(metadata));
+        params[dartx._set](i + dart.notNull(args[dartx.length]), param);
       }
       this[_params] = ListOfParameterMirror().unmodifiable(params);
     }
+    toString() {
+      return dart.str`MethodMirror on '${this[_name$]}'`;
+    }
     get qualifiedName() {
       return core.Symbol._check(this.noSuchMethod(new dart.InvocationImpl('qualifiedName', [], {isGetter: true})));
     }
@@ -13764,11 +14087,12 @@
   _js_mirrors.JsMethodMirror[dart.implements] = () => [mirrors.MethodMirror];
   dart.setSignature(_js_mirrors.JsMethodMirror, {
     constructors: () => ({
-      _constructor: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.String, dart.dynamic]),
-      _instanceMethod: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.String, dart.dynamic]),
-      _staticMethod: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.String, dart.dynamic])
+      _constructor: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.Symbol, dart.dynamic]),
+      _instanceMethod: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.Symbol, dart.dynamic]),
+      _staticMethod: dart.definiteFunctionType(_js_mirrors.JsMethodMirror, [_js_mirrors.JsClassMirror, core.Symbol, dart.dynamic])
     }),
     fields: () => ({
+      [_symbol]: core.Symbol,
       [_name$]: core.String,
       [_params]: ListOfParameterMirror(),
       [_metadata$]: ListOfInstanceMirror(),
@@ -14539,11 +14863,11 @@
     _slowFromList(list) {
       this[_storage] = _native_typed_data.NativeFloat32List.new(dart.notNull(list[dartx.length]) * 4);
       for (let i = 0; i < dart.notNull(list[dartx.length]); i++) {
-        let e = list[dartx.get](i);
-        this[_storage][dartx.set](i * 4 + 0, e.x);
-        this[_storage][dartx.set](i * 4 + 1, e.y);
-        this[_storage][dartx.set](i * 4 + 2, e.z);
-        this[_storage][dartx.set](i * 4 + 3, e.w);
+        let e = list[dartx._get](i);
+        this[_storage][dartx._set](i * 4 + 0, e.x);
+        this[_storage][dartx._set](i * 4 + 1, e.y);
+        this[_storage][dartx._set](i * 4 + 2, e.z);
+        this[_storage][dartx._set](i * 4 + 3, e.w);
       }
     }
     get runtimeType() {
@@ -14574,20 +14898,20 @@
     set length(value) {
       super.length = value;
     }
-    get(index) {
+    _get(index) {
       _native_typed_data._checkValidIndex(index, this, this.length);
-      let _x = this[_storage][dartx.get](dart.notNull(index) * 4 + 0);
-      let _y = this[_storage][dartx.get](dart.notNull(index) * 4 + 1);
-      let _z = this[_storage][dartx.get](dart.notNull(index) * 4 + 2);
-      let _w = this[_storage][dartx.get](dart.notNull(index) * 4 + 3);
+      let _x = this[_storage][dartx._get](dart.notNull(index) * 4 + 0);
+      let _y = this[_storage][dartx._get](dart.notNull(index) * 4 + 1);
+      let _z = this[_storage][dartx._get](dart.notNull(index) * 4 + 2);
+      let _w = this[_storage][dartx._get](dart.notNull(index) * 4 + 3);
       return new _native_typed_data.NativeFloat32x4._truncated(_x, _y, _z, _w);
     }
-    set(index, value) {
+    _set(index, value) {
       _native_typed_data._checkValidIndex(index, this, this.length);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 0, value.x);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 1, value.y);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 2, value.z);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 3, value.w);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 0, value.x);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 1, value.y);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 2, value.z);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 3, value.w);
       return value;
     }
     sublist(start, end) {
@@ -14615,14 +14939,14 @@
       length: dart.definiteFunctionType(core.int, [])
     }),
     methods: () => ({
-      get: dart.definiteFunctionType(typed_data.Float32x4, [core.int]),
-      set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Float32x4]),
+      _get: dart.definiteFunctionType(typed_data.Float32x4, [core.int]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Float32x4]),
       sublist: dart.definiteFunctionType(core.List$(typed_data.Float32x4), [core.int], [core.int])
     })
   });
   dart.defineExtensionMembers(_native_typed_data.NativeFloat32x4List, [
-    'get',
-    'set',
+    '_get',
+    '_set',
     'sublist',
     'buffer',
     'lengthInBytes',
@@ -15172,11 +15496,11 @@
     _slowFromList(list) {
       this[_storage] = _native_typed_data.NativeInt32List.new(dart.notNull(list[dartx.length]) * 4);
       for (let i = 0; i < dart.notNull(list[dartx.length]); i++) {
-        let e = list[dartx.get](i);
-        this[_storage][dartx.set](i * 4 + 0, e.x);
-        this[_storage][dartx.set](i * 4 + 1, e.y);
-        this[_storage][dartx.set](i * 4 + 2, e.z);
-        this[_storage][dartx.set](i * 4 + 3, e.w);
+        let e = list[dartx._get](i);
+        this[_storage][dartx._set](i * 4 + 0, e.x);
+        this[_storage][dartx._set](i * 4 + 1, e.y);
+        this[_storage][dartx._set](i * 4 + 2, e.z);
+        this[_storage][dartx._set](i * 4 + 3, e.w);
       }
     }
     get runtimeType() {
@@ -15207,20 +15531,20 @@
     set length(value) {
       super.length = value;
     }
-    get(index) {
+    _get(index) {
       _native_typed_data._checkValidIndex(index, this, this.length);
-      let _x = this[_storage][dartx.get](dart.notNull(index) * 4 + 0);
-      let _y = this[_storage][dartx.get](dart.notNull(index) * 4 + 1);
-      let _z = this[_storage][dartx.get](dart.notNull(index) * 4 + 2);
-      let _w = this[_storage][dartx.get](dart.notNull(index) * 4 + 3);
+      let _x = this[_storage][dartx._get](dart.notNull(index) * 4 + 0);
+      let _y = this[_storage][dartx._get](dart.notNull(index) * 4 + 1);
+      let _z = this[_storage][dartx._get](dart.notNull(index) * 4 + 2);
+      let _w = this[_storage][dartx._get](dart.notNull(index) * 4 + 3);
       return new _native_typed_data.NativeInt32x4._truncated(_x, _y, _z, _w);
     }
-    set(index, value) {
+    _set(index, value) {
       _native_typed_data._checkValidIndex(index, this, this.length);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 0, value.x);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 1, value.y);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 2, value.z);
-      this[_storage][dartx.set](dart.notNull(index) * 4 + 3, value.w);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 0, value.x);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 1, value.y);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 2, value.z);
+      this[_storage][dartx._set](dart.notNull(index) * 4 + 3, value.w);
       return value;
     }
     sublist(start, end) {
@@ -15248,14 +15572,14 @@
       length: dart.definiteFunctionType(core.int, [])
     }),
     methods: () => ({
-      get: dart.definiteFunctionType(typed_data.Int32x4, [core.int]),
-      set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Int32x4]),
+      _get: dart.definiteFunctionType(typed_data.Int32x4, [core.int]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Int32x4]),
       sublist: dart.definiteFunctionType(core.List$(typed_data.Int32x4), [core.int], [core.int])
     })
   });
   dart.defineExtensionMembers(_native_typed_data.NativeInt32x4List, [
-    'get',
-    'set',
+    '_get',
+    '_set',
     'sublist',
     'buffer',
     'lengthInBytes',
@@ -15295,9 +15619,9 @@
     _slowFromList(list) {
       this[_storage] = _native_typed_data.NativeFloat64List.new(dart.notNull(list[dartx.length]) * 2);
       for (let i = 0; i < dart.notNull(list[dartx.length]); i++) {
-        let e = list[dartx.get](i);
-        this[_storage][dartx.set](i * 2 + 0, e.x);
-        this[_storage][dartx.set](i * 2 + 1, e.y);
+        let e = list[dartx._get](i);
+        this[_storage][dartx._set](i * 2 + 0, e.x);
+        this[_storage][dartx._set](i * 2 + 1, e.y);
       }
     }
     static fromList(list) {
@@ -15328,16 +15652,16 @@
     set length(value) {
       super.length = value;
     }
-    get(index) {
+    _get(index) {
       _native_typed_data._checkValidIndex(index, this, this.length);
-      let _x = this[_storage][dartx.get](dart.notNull(index) * 2 + 0);
-      let _y = this[_storage][dartx.get](dart.notNull(index) * 2 + 1);
+      let _x = this[_storage][dartx._get](dart.notNull(index) * 2 + 0);
+      let _y = this[_storage][dartx._get](dart.notNull(index) * 2 + 1);
       return typed_data.Float64x2.new(_x, _y);
     }
-    set(index, value) {
+    _set(index, value) {
       _native_typed_data._checkValidIndex(index, this, this.length);
-      this[_storage][dartx.set](dart.notNull(index) * 2 + 0, value.x);
-      this[_storage][dartx.set](dart.notNull(index) * 2 + 1, value.y);
+      this[_storage][dartx._set](dart.notNull(index) * 2 + 0, value.x);
+      this[_storage][dartx._set](dart.notNull(index) * 2 + 1, value.y);
       return value;
     }
     sublist(start, end) {
@@ -15365,14 +15689,14 @@
       length: dart.definiteFunctionType(core.int, [])
     }),
     methods: () => ({
-      get: dart.definiteFunctionType(typed_data.Float64x2, [core.int]),
-      set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Float64x2]),
+      _get: dart.definiteFunctionType(typed_data.Float64x2, [core.int]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, typed_data.Float64x2]),
       sublist: dart.definiteFunctionType(core.List$(typed_data.Float64x2), [core.int], [core.int])
     })
   });
   dart.defineExtensionMembers(_native_typed_data.NativeFloat64x2List, [
-    'get',
-    'set',
+    '_get',
+    '_set',
     'sublist',
     'buffer',
     'lengthInBytes',
@@ -15449,7 +15773,7 @@
     if (_interceptors.JSIndexable.is(list)) return list;
     let result = core.List.new(list[dartx.length]);
     for (let i = 0; i < dart.notNull(list[dartx.length]); i++) {
-      result[dartx.set](i, list[dartx.get](i));
+      result[dartx._set](i, list[dartx._get](i));
     }
     return result;
   };
@@ -15508,113 +15832,113 @@
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_getFloat32](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_getFloat32](byteOffset, littleEndian) {
-      return this.getFloat32(byteOffset, littleEndian);
+    [_getFloat32](...args) {
+      return this.getFloat32.apply(this, args);
     }
     [dartx.getFloat64](byteOffset, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_getFloat64](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_getFloat64](byteOffset, littleEndian) {
-      return this.getFloat64(byteOffset, littleEndian);
+    [_getFloat64](...args) {
+      return this.getFloat64.apply(this, args);
     }
     [dartx.getInt16](byteOffset, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_getInt16](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_getInt16](byteOffset, littleEndian) {
-      return this.getInt16(byteOffset, littleEndian);
+    [_getInt16](...args) {
+      return this.getInt16.apply(this, args);
     }
     [dartx.getInt32](byteOffset, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_getInt32](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_getInt32](byteOffset, littleEndian) {
-      return this.getInt32(byteOffset, littleEndian);
+    [_getInt32](...args) {
+      return this.getInt32.apply(this, args);
     }
     [dartx.getInt64](byteOffset, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       dart.throw(new core.UnsupportedError('Int64 accessor not supported by dart2js.'));
     }
-    [dartx.getInt8](byteOffset) {
-      return this.getInt8(byteOffset);
+    [dartx.getInt8](...args) {
+      return this.getInt8.apply(this, args);
     }
     [dartx.getUint16](byteOffset, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_getUint16](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_getUint16](byteOffset, littleEndian) {
-      return this.getUint16(byteOffset, littleEndian);
+    [_getUint16](...args) {
+      return this.getUint16.apply(this, args);
     }
     [dartx.getUint32](byteOffset, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_getUint32](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_getUint32](byteOffset, littleEndian) {
-      return this.getUint32(byteOffset, littleEndian);
+    [_getUint32](...args) {
+      return this.getUint32.apply(this, args);
     }
     [dartx.getUint64](byteOffset, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       dart.throw(new core.UnsupportedError('Uint64 accessor not supported by dart2js.'));
     }
-    [dartx.getUint8](byteOffset) {
-      return this.getUint8(byteOffset);
+    [dartx.getUint8](...args) {
+      return this.getUint8.apply(this, args);
     }
     [dartx.setFloat32](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_setFloat32](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_setFloat32](byteOffset, value, littleEndian) {
-      return this.setFloat32(byteOffset, value, littleEndian);
+    [_setFloat32](...args) {
+      return this.setFloat32.apply(this, args);
     }
     [dartx.setFloat64](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_setFloat64](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_setFloat64](byteOffset, value, littleEndian) {
-      return this.setFloat64(byteOffset, value, littleEndian);
+    [_setFloat64](...args) {
+      return this.setFloat64.apply(this, args);
     }
     [dartx.setInt16](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_setInt16](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_setInt16](byteOffset, value, littleEndian) {
-      return this.setInt16(byteOffset, value, littleEndian);
+    [_setInt16](...args) {
+      return this.setInt16.apply(this, args);
     }
     [dartx.setInt32](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_setInt32](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_setInt32](byteOffset, value, littleEndian) {
-      return this.setInt32(byteOffset, value, littleEndian);
+    [_setInt32](...args) {
+      return this.setInt32.apply(this, args);
     }
     [dartx.setInt64](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       dart.throw(new core.UnsupportedError('Int64 accessor not supported by dart2js.'));
     }
-    [dartx.setInt8](byteOffset, value) {
-      return this.setInt8(byteOffset, value);
+    [dartx.setInt8](...args) {
+      return this.setInt8.apply(this, args);
     }
     [dartx.setUint16](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_setUint16](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_setUint16](byteOffset, value, littleEndian) {
-      return this.setUint16(byteOffset, value, littleEndian);
+    [_setUint16](...args) {
+      return this.setUint16.apply(this, args);
     }
     [dartx.setUint32](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       return this[_setUint32](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
     }
-    [_setUint32](byteOffset, value, littleEndian) {
-      return this.setUint32(byteOffset, value, littleEndian);
+    [_setUint32](...args) {
+      return this.setUint32.apply(this, args);
     }
     [dartx.setUint64](byteOffset, value, endian) {
       if (endian === void 0) endian = typed_data.Endianness.BIG_ENDIAN;
       dart.throw(new core.UnsupportedError('Uint64 accessor not supported by dart2js.'));
     }
-    [dartx.setUint8](byteOffset, value) {
-      return this.setUint8(byteOffset, value);
+    [dartx.setUint8](...args) {
+      return this.setUint8.apply(this, args);
     }
     static _create1(arg) {
       return new DataView(new ArrayBuffer(arg));
@@ -15699,8 +16023,8 @@
   });
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'setRange'
   ]);
   _native_typed_data.NativeTypedArrayOfDouble = class NativeTypedArrayOfDouble extends dart.mixin(_native_typed_data.NativeTypedArray, collection.ListMixin$(core.double), _internal.FixedLengthListMixin$(core.double)) {
@@ -15710,11 +16034,11 @@
     set length(value) {
       super.length = value;
     }
-    get(index) {
+    _get(index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
-    set(index, value) {
+    _set(index, value) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       this[index] = value;
       return value;
@@ -15731,15 +16055,15 @@
   dart.setSignature(_native_typed_data.NativeTypedArrayOfDouble, {
     getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
     methods: () => ({
-      get: dart.definiteFunctionType(core.double, [core.int]),
-      set: dart.definiteFunctionType(dart.void, [core.int, core.num]),
+      _get: dart.definiteFunctionType(core.double, [core.int]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, core.num]),
       setRange: dart.definiteFunctionType(dart.void, [core.int, core.int, IterableOfdouble()], [core.int])
     })
   });
-  dart.defineExtensionMembers(_native_typed_data.NativeTypedArrayOfDouble, ['get', 'set', 'setRange', 'length']);
+  dart.defineExtensionMembers(_native_typed_data.NativeTypedArrayOfDouble, ['_get', '_set', 'setRange', 'length']);
   dart.defineExtensionNames([
     'length',
-    'set',
+    '_set',
     'setRange'
   ]);
   _native_typed_data.NativeTypedArrayOfInt = class NativeTypedArrayOfInt extends dart.mixin(_native_typed_data.NativeTypedArray, collection.ListMixin$(core.int), _internal.FixedLengthListMixin$(core.int)) {
@@ -15749,7 +16073,7 @@
     set length(value) {
       super.length = value;
     }
-    set(index, value) {
+    _set(index, value) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       this[index] = value;
       return value;
@@ -15767,11 +16091,11 @@
   dart.setSignature(_native_typed_data.NativeTypedArrayOfInt, {
     getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
     methods: () => ({
-      set: dart.definiteFunctionType(dart.void, [core.int, core.int]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, core.int]),
       setRange: dart.definiteFunctionType(dart.void, [core.int, core.int, IterableOfint()], [core.int])
     })
   });
-  dart.defineExtensionMembers(_native_typed_data.NativeTypedArrayOfInt, ['set', 'setRange', 'length']);
+  dart.defineExtensionMembers(_native_typed_data.NativeTypedArrayOfInt, ['_set', 'setRange', 'length']);
   dart.defineExtensionNames([
     'runtimeType',
     'sublist'
@@ -15874,7 +16198,7 @@
   dart.registerExtension(dart.global.Float64Array, _native_typed_data.NativeFloat64List);
   dart.defineExtensionNames([
     'runtimeType',
-    'get',
+    '_get',
     'sublist'
   ]);
   _native_typed_data.NativeInt16List = class NativeInt16List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -15891,7 +16215,7 @@
     get [dartx.runtimeType]() {
       return dart.wrapType(typed_data.Int16List);
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
@@ -15919,7 +16243,7 @@
       view: dart.definiteFunctionType(_native_typed_data.NativeInt16List, [_native_typed_data.NativeByteBuffer, core.int, core.int])
     }),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+      [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
       [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
     }),
     statics: () => ({
@@ -15932,7 +16256,7 @@
   dart.registerExtension(dart.global.Int16Array, _native_typed_data.NativeInt16List);
   dart.defineExtensionNames([
     'runtimeType',
-    'get',
+    '_get',
     'sublist'
   ]);
   _native_typed_data.NativeInt32List = class NativeInt32List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -15949,7 +16273,7 @@
     get [dartx.runtimeType]() {
       return dart.wrapType(typed_data.Int32List);
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
@@ -15977,7 +16301,7 @@
       view: dart.definiteFunctionType(_native_typed_data.NativeInt32List, [typed_data.ByteBuffer, core.int, core.int])
     }),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+      [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
       [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
     }),
     statics: () => ({
@@ -15990,7 +16314,7 @@
   dart.registerExtension(dart.global.Int32Array, _native_typed_data.NativeInt32List);
   dart.defineExtensionNames([
     'runtimeType',
-    'get',
+    '_get',
     'sublist'
   ]);
   _native_typed_data.NativeInt8List = class NativeInt8List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -16007,7 +16331,7 @@
     get [dartx.runtimeType]() {
       return dart.wrapType(typed_data.Int8List);
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
@@ -16035,7 +16359,7 @@
       view: dart.definiteFunctionType(_native_typed_data.NativeInt8List, [typed_data.ByteBuffer, core.int, core.int])
     }),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+      [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
       [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
     }),
     statics: () => ({
@@ -16048,7 +16372,7 @@
   dart.registerExtension(dart.global.Int8Array, _native_typed_data.NativeInt8List);
   dart.defineExtensionNames([
     'runtimeType',
-    'get',
+    '_get',
     'sublist'
   ]);
   _native_typed_data.NativeUint16List = class NativeUint16List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -16065,7 +16389,7 @@
     get [dartx.runtimeType]() {
       return dart.wrapType(typed_data.Uint16List);
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
@@ -16093,7 +16417,7 @@
       view: dart.definiteFunctionType(_native_typed_data.NativeUint16List, [typed_data.ByteBuffer, core.int, core.int])
     }),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+      [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
       [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
     }),
     statics: () => ({
@@ -16106,7 +16430,7 @@
   dart.registerExtension(dart.global.Uint16Array, _native_typed_data.NativeUint16List);
   dart.defineExtensionNames([
     'runtimeType',
-    'get',
+    '_get',
     'sublist'
   ]);
   _native_typed_data.NativeUint32List = class NativeUint32List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -16123,7 +16447,7 @@
     get [dartx.runtimeType]() {
       return dart.wrapType(typed_data.Uint32List);
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
@@ -16151,7 +16475,7 @@
       view: dart.definiteFunctionType(_native_typed_data.NativeUint32List, [typed_data.ByteBuffer, core.int, core.int])
     }),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+      [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
       [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
     }),
     statics: () => ({
@@ -16165,7 +16489,7 @@
   dart.defineExtensionNames([
     'runtimeType',
     'length',
-    'get',
+    '_get',
     'sublist'
   ]);
   _native_typed_data.NativeUint8ClampedList = class NativeUint8ClampedList extends _native_typed_data.NativeTypedArrayOfInt {
@@ -16188,7 +16512,7 @@
     set [dartx.length](value) {
       super[dartx.length] = value;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
@@ -16216,7 +16540,7 @@
       view: dart.definiteFunctionType(_native_typed_data.NativeUint8ClampedList, [typed_data.ByteBuffer, core.int, core.int])
     }),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+      [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
       [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
     }),
     statics: () => ({
@@ -16227,10 +16551,11 @@
     names: ['_create1', '_create2', '_create3']
   });
   dart.registerExtension(dart.global.Uint8ClampedArray, _native_typed_data.NativeUint8ClampedList);
+  dart.registerExtension(dart.global.CanvasPixelArray, _native_typed_data.NativeUint8ClampedList);
   dart.defineExtensionNames([
     'runtimeType',
     'length',
-    'get',
+    '_get',
     'sublist'
   ]);
   _native_typed_data.NativeUint8List = class NativeUint8List extends _native_typed_data.NativeTypedArrayOfInt {
@@ -16253,7 +16578,7 @@
     set [dartx.length](value) {
       super[dartx.length] = value;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       _native_typed_data._checkValidIndex(index, this, this[dartx.length]);
       return this[index];
     }
@@ -16281,7 +16606,7 @@
       view: dart.definiteFunctionType(_native_typed_data.NativeUint8List, [typed_data.ByteBuffer, core.int, core.int])
     }),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.int, [core.int]),
+      [dartx._get]: dart.definiteFunctionType(core.int, [core.int]),
       [dartx.sublist]: dart.definiteFunctionType(core.List$(core.int), [core.int], [core.int])
     }),
     statics: () => ({
@@ -16294,8 +16619,8 @@
   dart.registerExtension(dart.global.Uint8Array, _native_typed_data.NativeUint8List);
   _native_typed_data.NativeFloat32x4 = class NativeFloat32x4 extends core.Object {
     static _truncate(x) {
-      _native_typed_data.NativeFloat32x4._list[dartx.set](0, core.num._check(x));
-      return _native_typed_data.NativeFloat32x4._list[dartx.get](0);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](0, core.num._check(x));
+      return _native_typed_data.NativeFloat32x4._list[dartx._get](0);
     }
     new(x, y, z, w) {
       this.x = core.double._check(_native_typed_data.NativeFloat32x4._truncate(x));
@@ -16314,11 +16639,11 @@
       NativeFloat32x4.prototype._truncated.call(this, 0.0, 0.0, 0.0, 0.0);
     }
     static fromInt32x4Bits(i) {
-      _native_typed_data.NativeFloat32x4._uint32view[dartx.set](0, i.x);
-      _native_typed_data.NativeFloat32x4._uint32view[dartx.set](1, i.y);
-      _native_typed_data.NativeFloat32x4._uint32view[dartx.set](2, i.z);
-      _native_typed_data.NativeFloat32x4._uint32view[dartx.set](3, i.w);
-      return new _native_typed_data.NativeFloat32x4._truncated(_native_typed_data.NativeFloat32x4._list[dartx.get](0), _native_typed_data.NativeFloat32x4._list[dartx.get](1), _native_typed_data.NativeFloat32x4._list[dartx.get](2), _native_typed_data.NativeFloat32x4._list[dartx.get](3));
+      _native_typed_data.NativeFloat32x4._uint32view[dartx._set](0, i.x);
+      _native_typed_data.NativeFloat32x4._uint32view[dartx._set](1, i.y);
+      _native_typed_data.NativeFloat32x4._uint32view[dartx._set](2, i.z);
+      _native_typed_data.NativeFloat32x4._uint32view[dartx._set](3, i.w);
+      return new _native_typed_data.NativeFloat32x4._truncated(_native_typed_data.NativeFloat32x4._list[dartx._get](0), _native_typed_data.NativeFloat32x4._list[dartx._get](1), _native_typed_data.NativeFloat32x4._list[dartx._get](2), _native_typed_data.NativeFloat32x4._list[dartx._get](3));
     }
     fromFloat64x2(v) {
       NativeFloat32x4.prototype._truncated.call(this, core.double._check(_native_typed_data.NativeFloat32x4._truncate(v.x)), core.double._check(_native_typed_data.NativeFloat32x4._truncate(v.y)), 0.0, 0.0);
@@ -16345,7 +16670,7 @@
       let _w = dart.notNull(this.w) + dart.notNull(other.w);
       return new _native_typed_data.NativeFloat32x4._doubles(_x, _y, _z, _w);
     }
-    ['unary-']() {
+    _negate() {
       return new _native_typed_data.NativeFloat32x4._truncated(-dart.notNull(this.x), -dart.notNull(this.y), -dart.notNull(this.z), -dart.notNull(this.w));
     }
     ['-'](other) {
@@ -16451,46 +16776,46 @@
     get signMask() {
       let view = _native_typed_data.NativeFloat32x4._uint32view;
       let mx = null, my = null, mz = null, mw = null;
-      _native_typed_data.NativeFloat32x4._list[dartx.set](0, this.x);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](1, this.y);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](2, this.z);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](3, this.w);
-      mx = (dart.notNull(view[dartx.get](0)) & 2147483648) >>> 31;
-      my = (dart.notNull(view[dartx.get](1)) & 2147483648) >>> 30;
-      mz = (dart.notNull(view[dartx.get](2)) & 2147483648) >>> 29;
-      mw = (dart.notNull(view[dartx.get](3)) & 2147483648) >>> 28;
+      _native_typed_data.NativeFloat32x4._list[dartx._set](0, this.x);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](1, this.y);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](2, this.z);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](3, this.w);
+      mx = (dart.notNull(view[dartx._get](0)) & 2147483648) >>> 31;
+      my = (dart.notNull(view[dartx._get](1)) & 2147483648) >>> 30;
+      mz = (dart.notNull(view[dartx._get](2)) & 2147483648) >>> 29;
+      mw = (dart.notNull(view[dartx._get](3)) & 2147483648) >>> 28;
       return core.int._check(dart.dsend(dart.dsend(dart.dsend(mx, '|', my), '|', mz), '|', mw));
     }
     shuffle(mask) {
       if (dart.notNull(mask) < 0 || dart.notNull(mask) > 255) {
         dart.throw(new core.RangeError.range(mask, 0, 255, "mask"));
       }
-      _native_typed_data.NativeFloat32x4._list[dartx.set](0, this.x);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](1, this.y);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](2, this.z);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](3, this.w);
-      let _x = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) & 3);
-      let _y = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 2 & 3);
-      let _z = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 4 & 3);
-      let _w = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 6 & 3);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](0, this.x);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](1, this.y);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](2, this.z);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](3, this.w);
+      let _x = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) & 3);
+      let _y = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 2 & 3);
+      let _z = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 4 & 3);
+      let _w = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 6 & 3);
       return new _native_typed_data.NativeFloat32x4._truncated(_x, _y, _z, _w);
     }
     shuffleMix(other, mask) {
       if (dart.notNull(mask) < 0 || dart.notNull(mask) > 255) {
         dart.throw(new core.RangeError.range(mask, 0, 255, "mask"));
       }
-      _native_typed_data.NativeFloat32x4._list[dartx.set](0, this.x);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](1, this.y);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](2, this.z);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](3, this.w);
-      let _x = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) & 3);
-      let _y = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 2 & 3);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](0, other.x);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](1, other.y);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](2, other.z);
-      _native_typed_data.NativeFloat32x4._list[dartx.set](3, other.w);
-      let _z = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 4 & 3);
-      let _w = _native_typed_data.NativeFloat32x4._list[dartx.get](dart.notNull(mask) >> 6 & 3);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](0, this.x);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](1, this.y);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](2, this.z);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](3, this.w);
+      let _x = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) & 3);
+      let _y = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 2 & 3);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](0, other.x);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](1, other.y);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](2, other.z);
+      _native_typed_data.NativeFloat32x4._list[dartx._set](3, other.w);
+      let _z = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 4 & 3);
+      let _w = _native_typed_data.NativeFloat32x4._list[dartx._get](dart.notNull(mask) >> 6 & 3);
       return new _native_typed_data.NativeFloat32x4._truncated(_x, _y, _z, _w);
     }
     withX(newX) {
@@ -16566,7 +16891,7 @@
     getters: () => ({signMask: dart.definiteFunctionType(core.int, [])}),
     methods: () => ({
       '+': dart.definiteFunctionType(typed_data.Float32x4, [typed_data.Float32x4]),
-      'unary-': dart.definiteFunctionType(typed_data.Float32x4, []),
+      _negate: dart.definiteFunctionType(typed_data.Float32x4, []),
       '-': dart.definiteFunctionType(typed_data.Float32x4, [typed_data.Float32x4]),
       '*': dart.definiteFunctionType(typed_data.Float32x4, [typed_data.Float32x4]),
       '/': dart.definiteFunctionType(typed_data.Float32x4, [typed_data.Float32x4]),
@@ -16608,8 +16933,8 @@
   });
   _native_typed_data.NativeInt32x4 = class NativeInt32x4 extends core.Object {
     static _truncate(x) {
-      _native_typed_data.NativeInt32x4._list[dartx.set](0, core.int._check(x));
-      return _native_typed_data.NativeInt32x4._list[dartx.get](0);
+      _native_typed_data.NativeInt32x4._list[dartx._set](0, core.int._check(x));
+      return _native_typed_data.NativeInt32x4._list[dartx._get](0);
     }
     new(x, y, z, w) {
       this.x = core.int._check(_native_typed_data.NativeInt32x4._truncate(x));
@@ -16629,12 +16954,12 @@
     }
     static fromFloat32x4Bits(f) {
       let floatList = _native_typed_data.NativeFloat32x4._list;
-      floatList[dartx.set](0, f.x);
-      floatList[dartx.set](1, f.y);
-      floatList[dartx.set](2, f.z);
-      floatList[dartx.set](3, f.w);
+      floatList[dartx._set](0, f.x);
+      floatList[dartx._set](1, f.y);
+      floatList[dartx._set](2, f.z);
+      floatList[dartx._set](3, f.w);
       let view = _native_typed_data.NativeInt32List._check(floatList[dartx.buffer][dartx.asInt32List]());
-      return new _native_typed_data.NativeInt32x4._truncated(view[dartx.get](0), view[dartx.get](1), view[dartx.get](2), view[dartx.get](3));
+      return new _native_typed_data.NativeInt32x4._truncated(view[dartx._get](0), view[dartx._get](1), view[dartx._get](2), view[dartx._get](3));
     }
     _truncated(x, y, z, w) {
       this.x = x;
@@ -16660,7 +16985,7 @@
     ['-'](other) {
       return new _native_typed_data.NativeInt32x4._truncated(this.x - other.x | 0, this.y - other.y | 0, this.z - other.z | 0, this.w - other.w | 0);
     }
-    ['unary-']() {
+    _negate() {
       return new _native_typed_data.NativeInt32x4._truncated(-this.x | 0, -this.y | 0, -this.z | 0, -this.w | 0);
     }
     get signMask() {
@@ -16674,32 +16999,32 @@
       if (dart.notNull(mask) < 0 || dart.notNull(mask) > 255) {
         dart.throw(new core.RangeError.range(mask, 0, 255, "mask"));
       }
-      _native_typed_data.NativeInt32x4._list[dartx.set](0, this.x);
-      _native_typed_data.NativeInt32x4._list[dartx.set](1, this.y);
-      _native_typed_data.NativeInt32x4._list[dartx.set](2, this.z);
-      _native_typed_data.NativeInt32x4._list[dartx.set](3, this.w);
-      let _x = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) & 3);
-      let _y = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 2 & 3);
-      let _z = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 4 & 3);
-      let _w = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 6 & 3);
+      _native_typed_data.NativeInt32x4._list[dartx._set](0, this.x);
+      _native_typed_data.NativeInt32x4._list[dartx._set](1, this.y);
+      _native_typed_data.NativeInt32x4._list[dartx._set](2, this.z);
+      _native_typed_data.NativeInt32x4._list[dartx._set](3, this.w);
+      let _x = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) & 3);
+      let _y = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 2 & 3);
+      let _z = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 4 & 3);
+      let _w = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 6 & 3);
       return new _native_typed_data.NativeInt32x4._truncated(_x, _y, _z, _w);
     }
     shuffleMix(other, mask) {
       if (dart.notNull(mask) < 0 || dart.notNull(mask) > 255) {
         dart.throw(new core.RangeError.range(mask, 0, 255, "mask"));
       }
-      _native_typed_data.NativeInt32x4._list[dartx.set](0, this.x);
-      _native_typed_data.NativeInt32x4._list[dartx.set](1, this.y);
-      _native_typed_data.NativeInt32x4._list[dartx.set](2, this.z);
-      _native_typed_data.NativeInt32x4._list[dartx.set](3, this.w);
-      let _x = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) & 3);
-      let _y = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 2 & 3);
-      _native_typed_data.NativeInt32x4._list[dartx.set](0, other.x);
-      _native_typed_data.NativeInt32x4._list[dartx.set](1, other.y);
-      _native_typed_data.NativeInt32x4._list[dartx.set](2, other.z);
-      _native_typed_data.NativeInt32x4._list[dartx.set](3, other.w);
-      let _z = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 4 & 3);
-      let _w = _native_typed_data.NativeInt32x4._list[dartx.get](dart.notNull(mask) >> 6 & 3);
+      _native_typed_data.NativeInt32x4._list[dartx._set](0, this.x);
+      _native_typed_data.NativeInt32x4._list[dartx._set](1, this.y);
+      _native_typed_data.NativeInt32x4._list[dartx._set](2, this.z);
+      _native_typed_data.NativeInt32x4._list[dartx._set](3, this.w);
+      let _x = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) & 3);
+      let _y = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 2 & 3);
+      _native_typed_data.NativeInt32x4._list[dartx._set](0, other.x);
+      _native_typed_data.NativeInt32x4._list[dartx._set](1, other.y);
+      _native_typed_data.NativeInt32x4._list[dartx._set](2, other.z);
+      _native_typed_data.NativeInt32x4._list[dartx._set](3, other.w);
+      let _z = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 4 & 3);
+      let _w = _native_typed_data.NativeInt32x4._list[dartx._get](dart.notNull(mask) >> 6 & 3);
       return new _native_typed_data.NativeInt32x4._truncated(_x, _y, _z, _w);
     }
     withX(x) {
@@ -16749,31 +17074,31 @@
     select(trueValue, falseValue) {
       let floatList = _native_typed_data.NativeFloat32x4._list;
       let intView = _native_typed_data.NativeFloat32x4._uint32view;
-      floatList[dartx.set](0, trueValue.x);
-      floatList[dartx.set](1, trueValue.y);
-      floatList[dartx.set](2, trueValue.z);
-      floatList[dartx.set](3, trueValue.w);
-      let stx = intView[dartx.get](0);
-      let sty = intView[dartx.get](1);
-      let stz = intView[dartx.get](2);
-      let stw = intView[dartx.get](3);
-      floatList[dartx.set](0, falseValue.x);
-      floatList[dartx.set](1, falseValue.y);
-      floatList[dartx.set](2, falseValue.z);
-      floatList[dartx.set](3, falseValue.w);
-      let sfx = intView[dartx.get](0);
-      let sfy = intView[dartx.get](1);
-      let sfz = intView[dartx.get](2);
-      let sfw = intView[dartx.get](3);
+      floatList[dartx._set](0, trueValue.x);
+      floatList[dartx._set](1, trueValue.y);
+      floatList[dartx._set](2, trueValue.z);
+      floatList[dartx._set](3, trueValue.w);
+      let stx = intView[dartx._get](0);
+      let sty = intView[dartx._get](1);
+      let stz = intView[dartx._get](2);
+      let stw = intView[dartx._get](3);
+      floatList[dartx._set](0, falseValue.x);
+      floatList[dartx._set](1, falseValue.y);
+      floatList[dartx._set](2, falseValue.z);
+      floatList[dartx._set](3, falseValue.w);
+      let sfx = intView[dartx._get](0);
+      let sfy = intView[dartx._get](1);
+      let sfz = intView[dartx._get](2);
+      let sfw = intView[dartx._get](3);
       let _x = (dart.notNull(this.x) & dart.notNull(stx) | ~dart.notNull(this.x) & dart.notNull(sfx)) >>> 0;
       let _y = (dart.notNull(this.y) & dart.notNull(sty) | ~dart.notNull(this.y) & dart.notNull(sfy)) >>> 0;
       let _z = (dart.notNull(this.z) & dart.notNull(stz) | ~dart.notNull(this.z) & dart.notNull(sfz)) >>> 0;
       let _w = (dart.notNull(this.w) & dart.notNull(stw) | ~dart.notNull(this.w) & dart.notNull(sfw)) >>> 0;
-      intView[dartx.set](0, _x);
-      intView[dartx.set](1, _y);
-      intView[dartx.set](2, _z);
-      intView[dartx.set](3, _w);
-      return new _native_typed_data.NativeFloat32x4._truncated(floatList[dartx.get](0), floatList[dartx.get](1), floatList[dartx.get](2), floatList[dartx.get](3));
+      intView[dartx._set](0, _x);
+      intView[dartx._set](1, _y);
+      intView[dartx._set](2, _z);
+      intView[dartx._set](3, _w);
+      return new _native_typed_data.NativeFloat32x4._truncated(floatList[dartx._get](0), floatList[dartx._get](1), floatList[dartx._get](2), floatList[dartx._get](3));
     }
   };
   dart.defineNamedConstructor(_native_typed_data.NativeInt32x4, 'bool');
@@ -16805,7 +17130,7 @@
       '^': dart.definiteFunctionType(typed_data.Int32x4, [typed_data.Int32x4]),
       '+': dart.definiteFunctionType(typed_data.Int32x4, [typed_data.Int32x4]),
       '-': dart.definiteFunctionType(typed_data.Int32x4, [typed_data.Int32x4]),
-      'unary-': dart.definiteFunctionType(typed_data.Int32x4, []),
+      _negate: dart.definiteFunctionType(typed_data.Int32x4, []),
       shuffle: dart.definiteFunctionType(typed_data.Int32x4, [core.int]),
       shuffleMix: dart.definiteFunctionType(typed_data.Int32x4, [typed_data.Int32x4, core.int]),
       withX: dart.definiteFunctionType(typed_data.Int32x4, [core.int]),
@@ -16853,7 +17178,7 @@
     ['+'](other) {
       return new _native_typed_data.NativeFloat64x2._doubles(dart.notNull(this.x) + dart.notNull(other.x), dart.notNull(this.y) + dart.notNull(other.y));
     }
-    ['unary-']() {
+    _negate() {
       return new _native_typed_data.NativeFloat64x2._doubles(-dart.notNull(this.x), -dart.notNull(this.y));
     }
     ['-'](other) {
@@ -16886,10 +17211,10 @@
     }
     get signMask() {
       let view = _native_typed_data.NativeFloat64x2._uint32View;
-      _native_typed_data.NativeFloat64x2._list[dartx.set](0, this.x);
-      _native_typed_data.NativeFloat64x2._list[dartx.set](1, this.y);
-      let mx = (dart.notNull(view[dartx.get](1)) & 2147483648) >>> 31;
-      let my = (dart.notNull(view[dartx.get](3)) & 2147483648) >>> 31;
+      _native_typed_data.NativeFloat64x2._list[dartx._set](0, this.x);
+      _native_typed_data.NativeFloat64x2._list[dartx._set](1, this.y);
+      let mx = (dart.notNull(view[dartx._get](1)) & 2147483648) >>> 31;
+      let my = (dart.notNull(view[dartx._get](3)) & 2147483648) >>> 31;
       return (mx | my << 1) >>> 0;
     }
     withX(x) {
@@ -16930,7 +17255,7 @@
     getters: () => ({signMask: dart.definiteFunctionType(core.int, [])}),
     methods: () => ({
       '+': dart.definiteFunctionType(typed_data.Float64x2, [typed_data.Float64x2]),
-      'unary-': dart.definiteFunctionType(typed_data.Float64x2, []),
+      _negate: dart.definiteFunctionType(typed_data.Float64x2, []),
       '-': dart.definiteFunctionType(typed_data.Float64x2, [typed_data.Float64x2]),
       '*': dart.definiteFunctionType(typed_data.Float64x2, [typed_data.Float64x2]),
       '/': dart.definiteFunctionType(typed_data.Float64x2, [typed_data.Float64x2]),
@@ -18297,7 +18622,7 @@
             future.then(dart.dynamic)(dart.fn(value => {
               remaining--;
               if (values != null) {
-                values[dartx.set](pos, value);
+                values[dartx._set](pos, value);
                 if (remaining == 0) {
                   result[_completeWithValue](values);
                 }
@@ -22322,13 +22647,13 @@
         }
       };
     }
-    get(key) {
-      let result = this[_map$][dartx.get](key);
+    _get(key) {
+      let result = this[_map$][dartx._get](key);
       if (result != null || dart.test(this[_map$][dartx.containsKey](key))) return result;
       if (this.parent != null) {
-        let value = this.parent.get(key);
+        let value = this.parent._get(key);
         if (value != null) {
-          this[_map$][dartx.set](key, value);
+          this[_map$][dartx._set](key, value);
         }
         return value;
       }
@@ -22476,7 +22801,7 @@
       bindCallback: dart.definiteFunctionType(R => [async.ZoneCallback$(R), [dart.functionType(R, [])], {runGuarded: core.bool}]),
       bindUnaryCallback: dart.definiteFunctionType((R, T) => [async.ZoneUnaryCallback$(R, T), [dart.functionType(R, [T])], {runGuarded: core.bool}]),
       bindBinaryCallback: dart.definiteFunctionType((R, T1, T2) => [async.ZoneBinaryCallback$(R, T1, T2), [dart.functionType(R, [T1, T2])], {runGuarded: core.bool}]),
-      get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
+      _get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
       handleUncaughtError: dart.definiteFunctionType(R => [R, [dart.dynamic, core.StackTrace]]),
       fork: dart.definiteFunctionType(async.Zone, [], {specification: async.ZoneSpecification, zoneValues: core.Map}),
       run: dart.definiteFunctionType(R => [R, [dart.functionType(R, [])]]),
@@ -22758,7 +23083,7 @@
         }
       };
     }
-    get(key) {
+    _get(key) {
       return null;
     }
     handleUncaughtError(R) {
@@ -22848,7 +23173,7 @@
       bindCallback: dart.definiteFunctionType(R => [async.ZoneCallback$(R), [dart.functionType(R, [])], {runGuarded: core.bool}]),
       bindUnaryCallback: dart.definiteFunctionType((R, T) => [async.ZoneUnaryCallback$(R, T), [dart.functionType(R, [T])], {runGuarded: core.bool}]),
       bindBinaryCallback: dart.definiteFunctionType((R, T1, T2) => [async.ZoneBinaryCallback$(R, T1, T2), [dart.functionType(R, [T1, T2])], {runGuarded: core.bool}]),
-      get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
+      _get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
       handleUncaughtError: dart.definiteFunctionType(R => [R, [dart.dynamic, core.StackTrace]]),
       fork: dart.definiteFunctionType(async.Zone, [], {specification: async.ZoneSpecification, zoneValues: core.Map}),
       run: dart.definiteFunctionType(R => [R, [dart.functionType(R, [])]]),
@@ -22962,7 +23287,7 @@
         return new (_HashMapKeyIterableOfK())(this);
       }
       get values() {
-        return MappedIterableOfK$V().new(this.keys, dart.fn(each => this.get(each), KToV()));
+        return MappedIterableOfK$V().new(this.keys, dart.fn(each => this._get(each), KToV()));
       }
       containsKey(key) {
         if (dart.test(collection._HashMap._isStringKey(key))) {
@@ -22982,15 +23307,15 @@
         return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0;
       }
       containsValue(value) {
-        return this[_computeKeys]()[dartx.any](dart.fn(each => dart.equals(this.get(each), value), KTobool()));
+        return this[_computeKeys]()[dartx.any](dart.fn(each => dart.equals(this._get(each), value), KTobool()));
       }
       addAll(other) {
         MapOfK$V()._check(other);
         other[dartx.forEach](dart.fn((key, value) => {
-          this.set(key, value);
+          this._set(key, value);
         }, KAndVTovoid$()));
       }
-      get(key) {
+      _get(key) {
         if (dart.test(collection._HashMap._isStringKey(key))) {
           let strings = this[_strings$];
           return V._check(strings == null ? null : collection._HashMap._getTableEntry(strings, key));
@@ -23008,7 +23333,7 @@
         let index = this[_findBucketIndex](bucket, key);
         return V._check(dart.notNull(index) < 0 ? null : bucket[dart.notNull(index) + 1]);
       }
-      set(key, value) {
+      _set(key, value) {
         K._check(key);
         V._check(value);
         if (dart.test(collection._HashMap._isStringKey(key))) {
@@ -23049,9 +23374,9 @@
       putIfAbsent(key, ifAbsent) {
         K._check(key);
         VoidToV()._check(ifAbsent);
-        if (dart.test(this.containsKey(key))) return this.get(key);
+        if (dart.test(this.containsKey(key))) return this._get(key);
         let value = ifAbsent();
-        this.set(key, value);
+        this._set(key, value);
         return value;
       }
       remove(key) {
@@ -23083,7 +23408,7 @@
         let keys = this[_computeKeys]();
         for (let i = 0, length = keys[dartx.length]; i < dart.notNull(length); i++) {
           let key = keys[i];
-          action(K._check(key), this.get(key));
+          action(K._check(key), this._get(key));
           if (keys !== this[_keys]) {
             dart.throw(new core.ConcurrentModificationError(this));
           }
@@ -23221,9 +23546,9 @@
         [_containsKey]: dart.definiteFunctionType(core.bool, [core.Object]),
         containsValue: dart.definiteFunctionType(core.bool, [core.Object]),
         addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
-        get: dart.definiteFunctionType(V, [core.Object]),
+        _get: dart.definiteFunctionType(V, [core.Object]),
         [_get]: dart.definiteFunctionType(V, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         [_set]: dart.definiteFunctionType(dart.void, [K, V]),
         putIfAbsent: dart.definiteFunctionType(V, [K, VoidToV()]),
         remove: dart.definiteFunctionType(V, [core.Object]),
@@ -23252,8 +23577,8 @@
       'containsKey',
       'containsValue',
       'addAll',
-      'get',
-      'set',
+      '_get',
+      '_set',
       'putIfAbsent',
       'remove',
       'clear',
@@ -23300,11 +23625,11 @@
         this[_validKey] = validKey != null ? validKey : dart.fn(v => K.is(v), ObjectTobool());
         super.new();
       }
-      get(key) {
+      _get(key) {
         if (!dart.test(this[_validKey](key))) return null;
         return super[_get](key);
       }
-      set(key, value) {
+      _set(key, value) {
         K._check(key);
         V._check(value);
         super[_set](key, value);
@@ -23341,12 +23666,12 @@
         [_validKey]: _PredicateOfObject()
       }),
       methods: () => ({
-        get: dart.definiteFunctionType(V, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _get: dart.definiteFunctionType(V, [core.Object]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         remove: dart.definiteFunctionType(V, [core.Object])
       })
     });
-    dart.defineExtensionMembers(_CustomHashMap, ['get', 'set', 'containsKey', 'remove']);
+    dart.defineExtensionMembers(_CustomHashMap, ['_get', '_set', 'containsKey', 'remove']);
     return _CustomHashMap;
   });
   collection._CustomHashMap = _CustomHashMap();
@@ -23523,13 +23848,13 @@
       addAll(other) {
         MapOfK$V()._check(other);
         other[dartx.forEach](dart.fn((key, value) => {
-          this.set(key, value);
+          this._set(key, value);
         }, KAndVTovoid$()));
       }
-      get(key) {
+      _get(key) {
         return this[_map$0].get(key);
       }
-      set(key, value) {
+      _set(key, value) {
         K._check(key);
         V._check(value);
         this[_map$0].set(key, value);
@@ -23539,13 +23864,13 @@
       putIfAbsent(key, ifAbsent) {
         K._check(key);
         VoidToV()._check(ifAbsent);
-        if (dart.test(this.containsKey(key))) return this.get(key);
+        if (dart.test(this.containsKey(key))) return this._get(key);
         let value = ifAbsent();
-        this.set(key, value);
+        this._set(key, value);
         return value;
       }
       remove(key) {
-        let value = this.get(key);
+        let value = this._get(key);
         this[_map$0].delete(key);
         this[_modified$]();
         return value;
@@ -23590,8 +23915,8 @@
       }),
       methods: () => ({
         addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
-        get: dart.definiteFunctionType(V, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _get: dart.definiteFunctionType(V, [core.Object]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         putIfAbsent: dart.definiteFunctionType(V, [K, VoidToV()]),
         remove: dart.definiteFunctionType(V, [core.Object]),
         forEach: dart.definiteFunctionType(dart.void, [KAndVTovoid()]),
@@ -23602,8 +23927,8 @@
       'containsKey',
       'containsValue',
       'addAll',
-      'get',
-      'set',
+      '_get',
+      '_set',
       'putIfAbsent',
       'remove',
       'clear',
@@ -23749,11 +24074,11 @@
         this[_validKey] = validKey != null ? validKey : dart.fn(v => K.is(v), ObjectTobool());
         super.new();
       }
-      get(key) {
+      _get(key) {
         if (!dart.test(this[_validKey](key))) return null;
         return super.internalGet(key);
       }
-      set(key, value) {
+      _set(key, value) {
         K._check(key);
         V._check(value);
         super.internalSet(key, value);
@@ -23788,12 +24113,12 @@
         [_validKey]: _PredicateOfObject()
       }),
       methods: () => ({
-        get: dart.definiteFunctionType(V, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _get: dart.definiteFunctionType(V, [core.Object]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         remove: dart.definiteFunctionType(V, [core.Object])
       })
     });
-    dart.defineExtensionMembers(_LinkedCustomHashMap, ['get', 'set', 'containsKey', 'remove']);
+    dart.defineExtensionMembers(_LinkedCustomHashMap, ['_get', '_set', 'containsKey', 'remove']);
     return _LinkedCustomHashMap;
   });
   collection._LinkedCustomHashMap = _LinkedCustomHashMap();
@@ -23894,7 +24219,7 @@
         })() : ListOfE().new(this.length);
         let i = 0;
         for (let element of this)
-          result[dartx.set](i++, element);
+          result[dartx._set](i++, element);
         return result;
       }
       map(T) {
@@ -24230,7 +24555,7 @@
         let bucket = this[_getBucket$](rest, object);
         let index = this[_findBucketIndex](bucket, object);
         if (dart.notNull(index) < 0) return null;
-        return bucket[dartx.get](index);
+        return bucket[dartx._get](index);
       }
       add(element) {
         E._check(element);
@@ -24656,7 +24981,7 @@
         let bucket = this[_getBucket$](rest, object);
         let index = this[_findBucketIndex](bucket, object);
         if (dart.notNull(index) < 0) return null;
-        return bucket[dartx.get](index)[_element];
+        return bucket[dartx._get](index)[_element];
       }
       forEach(action) {
         let cell = this[_first$];
@@ -25088,7 +25413,7 @@
       set length(value) {
         super.length = value;
       }
-      get(index) {
+      _get(index) {
         return this[_source$0][dartx.elementAt](index);
       }
     }
@@ -25096,9 +25421,9 @@
       constructors: () => ({new: dart.definiteFunctionType(collection.UnmodifiableListView$(E), [IterableOfE()])}),
       fields: () => ({[_source$0]: IterableOfE()}),
       getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
-      methods: () => ({get: dart.definiteFunctionType(E, [core.int])})
+      methods: () => ({_get: dart.definiteFunctionType(E, [core.int])})
     });
-    dart.defineExtensionMembers(UnmodifiableListView, ['get', 'length']);
+    dart.defineExtensionMembers(UnmodifiableListView, ['_get', 'length']);
     return UnmodifiableListView;
   });
   collection.UnmodifiableListView = UnmodifiableListView();
@@ -25167,7 +25492,7 @@
       static from(other) {
         let result = HashMapOfK$V().new();
         other[dartx.forEach](dart.fn((k, v) => {
-          result.set(K.as(k), V.as(v));
+          result._set(K.as(k), V.as(v));
         }, dynamicAnddynamicTovoid$()));
         return result;
       }
@@ -25537,7 +25862,7 @@
   });
   collection._isToStringVisiting = function(o) {
     for (let i = 0; i < dart.notNull(collection._toStringVisiting[dartx.length]); i++) {
-      if (core.identical(o, collection._toStringVisiting[dartx.get](i))) return true;
+      if (core.identical(o, collection._toStringVisiting[dartx._get](i))) return true;
     }
     return false;
   };
@@ -25719,7 +26044,7 @@
       static from(other) {
         let result = LinkedHashMapOfK$V().new();
         other[dartx.forEach](dart.fn((k, v) => {
-          result.set(K.as(k), V.as(v));
+          result._set(K.as(k), V.as(v));
         }, dynamicAnddynamicTovoid$()));
         return result;
       }
@@ -26086,18 +26411,18 @@
     class MapMixin extends core.Object {
       forEach(action) {
         for (let key of this.keys) {
-          action(key, this.get(key));
+          action(key, this._get(key));
         }
       }
       addAll(other) {
         MapOfK$V()._check(other);
         for (let key of other[dartx.keys]) {
-          this.set(key, other[dartx.get](key));
+          this._set(key, other[dartx._get](key));
         }
       }
       containsValue(value) {
         for (let key of this.keys) {
-          if (dart.equals(this.get(key), value)) return true;
+          if (dart.equals(this._get(key), value)) return true;
         }
         return false;
       }
@@ -26105,9 +26430,9 @@
         K._check(key);
         VoidToV()._check(ifAbsent);
         if (dart.test(this.containsKey(key))) {
-          return this.get(key);
+          return this._get(key);
         }
-        return this.set(key, ifAbsent());
+        return this._set(key, ifAbsent());
       }
       containsKey(key) {
         return this.keys[dartx.contains](key);
@@ -26168,7 +26493,7 @@
     let MapOfK$V = () => (MapOfK$V = dart.constFn(core.Map$(K, V)))();
     let VoidToV = () => (VoidToV = dart.constFn(dart.functionType(V, [])))();
     class _UnmodifiableMapMixin extends core.Object {
-      set(key, value) {
+      _set(key, value) {
         K._check(key);
         V._check(value);
         dart.throw(new core.UnsupportedError("Cannot modify unmodifiable map"));
@@ -26194,7 +26519,7 @@
     _UnmodifiableMapMixin[dart.implements] = () => [MapOfK$V()];
     dart.setSignature(_UnmodifiableMapMixin, {
       methods: () => ({
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
         clear: dart.definiteFunctionType(dart.void, []),
         remove: dart.definiteFunctionType(V, [core.Object]),
@@ -26202,7 +26527,7 @@
       })
     });
     dart.defineExtensionMembers(_UnmodifiableMapMixin, [
-      'set',
+      '_set',
       'addAll',
       'clear',
       'remove',
@@ -26238,13 +26563,13 @@
         return this[_map$0][dartx.isNotEmpty];
       }
       get first() {
-        return this[_map$0][dartx.get](this[_map$0][dartx.keys][dartx.first]);
+        return this[_map$0][dartx._get](this[_map$0][dartx.keys][dartx.first]);
       }
       get single() {
-        return this[_map$0][dartx.get](this[_map$0][dartx.keys][dartx.single]);
+        return this[_map$0][dartx._get](this[_map$0][dartx.keys][dartx.single]);
       }
       get last() {
-        return this[_map$0][dartx.get](this[_map$0][dartx.keys][dartx.last]);
+        return this[_map$0][dartx._get](this[_map$0][dartx.keys][dartx.last]);
       }
       get iterator() {
         return new (_MapBaseValueIteratorOfK$V())(this[_map$0]);
@@ -26285,7 +26610,7 @@
       }
       moveNext() {
         if (dart.test(this[_keys].moveNext())) {
-          this[_current$2] = this[_map$0][dartx.get](this[_keys].current);
+          this[_current$2] = this[_map$0][dartx._get](this[_keys].current);
           return true;
         }
         this[_current$2] = null;
@@ -26318,13 +26643,13 @@
       new(map) {
         this[_map$0] = map;
       }
-      get(key) {
-        return this[_map$0][dartx.get](key);
+      _get(key) {
+        return this[_map$0][dartx._get](key);
       }
-      set(key, value) {
+      _set(key, value) {
         K._check(key);
         V._check(value);
-        this[_map$0][dartx.set](key, value);
+        this[_map$0][dartx._set](key, value);
         return value;
       }
       addAll(other) {
@@ -26383,8 +26708,8 @@
         values: dart.definiteFunctionType(core.Iterable$(V), [])
       }),
       methods: () => ({
-        get: dart.definiteFunctionType(V, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _get: dart.definiteFunctionType(V, [core.Object]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
         clear: dart.definiteFunctionType(dart.void, []),
         putIfAbsent: dart.definiteFunctionType(V, [K, VoidToV()]),
@@ -26395,8 +26720,8 @@
       })
     });
     dart.defineExtensionMembers(MapView, [
-      'get',
-      'set',
+      '_get',
+      '_set',
       'addAll',
       'clear',
       'putIfAbsent',
@@ -26441,10 +26766,10 @@
     }
     static putIfAbsent(map, key, ifAbsent) {
       if (dart.test(map[dartx.containsKey](key))) {
-        return map[dartx.get](key);
+        return map[dartx._get](key);
       }
       let v = ifAbsent();
-      map[dartx.set](key, v);
+      map[dartx._set](key, v);
       return v;
     }
     static clear(map) {
@@ -26454,11 +26779,11 @@
     }
     static forEach(map, f) {
       for (let k of map[dartx.keys]) {
-        dart.dcall(f, k, map[dartx.get](k));
+        dart.dcall(f, k, map[dartx._get](k));
       }
     }
     static getValues(map) {
-      return map[dartx.keys][dartx.map](dart.dynamic)(dart.fn(key => map[dartx.get](key), dynamicTodynamic$()));
+      return map[dartx.keys][dartx.map](dart.dynamic)(dart.fn(key => map[dartx._get](key), dynamicTodynamic$()));
     }
     static length(map) {
       return map[dartx.keys][dartx.length];
@@ -26501,7 +26826,7 @@
       if (key == null) key = collection.Maps._id;
       if (value == null) value = collection.Maps._id;
       for (let element of iterable) {
-        map[dartx.set](dart.dcall(key, element), dart.dcall(value, element));
+        map[dartx._set](dart.dcall(key, element), dart.dcall(value, element));
       }
     }
     static _fillMapWithIterables(map, keys, values) {
@@ -26510,7 +26835,7 @@
       let hasNextKey = keyIterator.moveNext();
       let hasNextValue = valueIterator.moveNext();
       while (dart.test(hasNextKey) && dart.test(hasNextValue)) {
-        map[dartx.set](keyIterator.current, valueIterator.current);
+        map[dartx._set](keyIterator.current, valueIterator.current);
         hasNextKey = keyIterator.moveNext();
         hasNextValue = valueIterator.moveNext();
       }
@@ -26641,7 +26966,6 @@
         return this[_nextLink];
       }
     }
-    dart.setBaseClass(_UserDoubleLinkedQueueEntry, collection._DoubleLink$(_UserDoubleLinkedQueueEntry));
     _UserDoubleLinkedQueueEntry[dart.implements] = () => [DoubleLinkedQueueEntryOfE()];
     dart.setSignature(_UserDoubleLinkedQueueEntry, {
       constructors: () => ({new: dart.definiteFunctionType(collection._UserDoubleLinkedQueueEntry$(E), [E])}),
@@ -26655,6 +26979,8 @@
       })
     });
     return _UserDoubleLinkedQueueEntry;
+  }, _UserDoubleLinkedQueueEntry => {
+    dart.setBaseClass(_UserDoubleLinkedQueueEntry, collection._DoubleLink$(_UserDoubleLinkedQueueEntry));
   });
   collection._UserDoubleLinkedQueueEntry = _UserDoubleLinkedQueueEntry();
   const _queue = Symbol('_queue');
@@ -26684,7 +27010,6 @@
         return this[_previousLink][_asNonSentinelEntry]();
       }
     }
-    dart.setBaseClass(_DoubleLinkedQueueEntry, collection._DoubleLink$(_DoubleLinkedQueueEntry));
     dart.setSignature(_DoubleLinkedQueueEntry, {
       constructors: () => ({new: dart.definiteFunctionType(collection._DoubleLinkedQueueEntry$(E), [DoubleLinkedQueueOfE()])}),
       fields: () => ({[_queue]: DoubleLinkedQueueOfE()}),
@@ -26696,6 +27021,8 @@
       })
     });
     return _DoubleLinkedQueueEntry;
+  }, _DoubleLinkedQueueEntry => {
+    dart.setBaseClass(_DoubleLinkedQueueEntry, collection._DoubleLink$(_DoubleLinkedQueueEntry));
   });
   collection._DoubleLinkedQueueEntry = _DoubleLinkedQueueEntry();
   const _elementCount = Symbol('_elementCount');
@@ -26784,7 +27111,6 @@
   });
   collection._DoubleLinkedQueueSentinel = _DoubleLinkedQueueSentinel();
   const _sentinel = Symbol('_sentinel');
-  const _filter = Symbol('_filter');
   collection.DoubleLinkedQueue$ = dart.generic(E => {
     let _DoubleLinkedQueueSentinelOfE = () => (_DoubleLinkedQueueSentinelOfE = dart.constFn(collection._DoubleLinkedQueueSentinel$(E)))();
     let DoubleLinkedQueueOfE = () => (DoubleLinkedQueueOfE = dart.constFn(collection.DoubleLinkedQueue$(E)))();
@@ -27049,7 +27375,7 @@
           let queue = new (ListQueueOfE())(dart.notNull(length) + 1);
           dart.assert(dart.notNull(queue[_table][dartx.length]) > dart.notNull(length));
           for (let i = 0; i < dart.notNull(length); i++) {
-            queue[_table][dartx.set](i, E.as(elements[dartx.get](i)));
+            queue[_table][dartx._set](i, E.as(elements[dartx._get](i)));
           }
           queue[_tail] = length;
           return queue;
@@ -27071,7 +27397,7 @@
       forEach(action) {
         let modificationCount = this[_modificationCount];
         for (let i = this[_head]; i != this[_tail]; i = (dart.notNull(i) + 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0) {
-          action(this[_table][dartx.get](i));
+          action(this[_table][dartx._get](i));
           this[_checkModification](modificationCount);
         }
       }
@@ -27083,20 +27409,20 @@
       }
       get first() {
         if (this[_head] == this[_tail]) dart.throw(_internal.IterableElementError.noElement());
-        return this[_table][dartx.get](this[_head]);
+        return this[_table][dartx._get](this[_head]);
       }
       get last() {
         if (this[_head] == this[_tail]) dart.throw(_internal.IterableElementError.noElement());
-        return this[_table][dartx.get]((dart.notNull(this[_tail]) - 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0);
+        return this[_table][dartx._get]((dart.notNull(this[_tail]) - 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0);
       }
       get single() {
         if (this[_head] == this[_tail]) dart.throw(_internal.IterableElementError.noElement());
         if (dart.notNull(this.length) > 1) dart.throw(_internal.IterableElementError.tooMany());
-        return this[_table][dartx.get](this[_head]);
+        return this[_table][dartx._get](this[_head]);
       }
       elementAt(index) {
         core.RangeError.checkValidIndex(index, this);
-        return this[_table][dartx.get]((dart.notNull(this[_head]) + dart.notNull(index) & dart.notNull(this[_table][dartx.length]) - 1) >>> 0);
+        return this[_table][dartx._get]((dart.notNull(this[_head]) + dart.notNull(index) & dart.notNull(this[_table][dartx.length]) - 1) >>> 0);
       }
       toList(opts) {
         let growable = opts && 'growable' in opts ? opts.growable : true;
@@ -27144,7 +27470,7 @@
       }
       remove(value) {
         for (let i = this[_head]; i != this[_tail]; i = (dart.notNull(i) + 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0) {
-          let element = this[_table][dartx.get](i);
+          let element = this[_table][dartx._get](i);
           if (dart.equals(element, value)) {
             this[_remove](i);
             this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
@@ -27157,7 +27483,7 @@
         let modificationCount = this[_modificationCount];
         let i = this[_head];
         while (i != this[_tail]) {
-          let element = this[_table][dartx.get](i);
+          let element = this[_table][dartx._get](i);
           let remove = core.identical(removeMatching, test(element));
           this[_checkModification](modificationCount);
           if (remove) {
@@ -27177,7 +27503,7 @@
       clear() {
         if (this[_head] != this[_tail]) {
           for (let i = this[_head]; i != this[_tail]; i = (dart.notNull(i) + 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0) {
-            this[_table][dartx.set](i, null);
+            this[_table][dartx._set](i, null);
           }
           this[_head] = this[_tail] = 0;
           this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
@@ -27193,15 +27519,15 @@
       addFirst(value) {
         E._check(value);
         this[_head] = (dart.notNull(this[_head]) - 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0;
-        this[_table][dartx.set](this[_head], value);
+        this[_table][dartx._set](this[_head], value);
         if (this[_head] == this[_tail]) this[_grow]();
         this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
       }
       removeFirst() {
         if (this[_head] == this[_tail]) dart.throw(_internal.IterableElementError.noElement());
         this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
-        let result = this[_table][dartx.get](this[_head]);
-        this[_table][dartx.set](this[_head], null);
+        let result = this[_table][dartx._get](this[_head]);
+        this[_table][dartx._set](this[_head], null);
         this[_head] = (dart.notNull(this[_head]) + 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0;
         return result;
       }
@@ -27209,8 +27535,8 @@
         if (this[_head] == this[_tail]) dart.throw(_internal.IterableElementError.noElement());
         this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
         this[_tail] = (dart.notNull(this[_tail]) - 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0;
-        let result = this[_table][dartx.get](this[_tail]);
-        this[_table][dartx.set](this[_tail], null);
+        let result = this[_table][dartx._get](this[_tail]);
+        this[_table][dartx._set](this[_tail], null);
         return result;
       }
       static _isPowerOf2(number) {
@@ -27232,7 +27558,7 @@
       }
       [_add$0](element) {
         E._check(element);
-        this[_table][dartx.set](this[_tail], element);
+        this[_table][dartx._set](this[_tail], element);
         this[_tail] = (dart.notNull(this[_tail]) + 1 & dart.notNull(this[_table][dartx.length]) - 1) >>> 0;
         if (this[_head] == this[_tail]) this[_grow]();
         this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
@@ -27245,10 +27571,10 @@
           let i = offset;
           while (i != this[_head]) {
             let prevOffset = (dart.notNull(i) - 1 & mask) >>> 0;
-            this[_table][dartx.set](i, this[_table][dartx.get](prevOffset));
+            this[_table][dartx._set](i, this[_table][dartx._get](prevOffset));
             i = prevOffset;
           }
-          this[_table][dartx.set](this[_head], null);
+          this[_table][dartx._set](this[_head], null);
           this[_head] = (dart.notNull(this[_head]) + 1 & mask) >>> 0;
           return (dart.notNull(offset) + 1 & mask) >>> 0;
         } else {
@@ -27256,10 +27582,10 @@
           let i = offset;
           while (i != this[_tail]) {
             let nextOffset = (dart.notNull(i) + 1 & mask) >>> 0;
-            this[_table][dartx.set](i, this[_table][dartx.get](nextOffset));
+            this[_table][dartx._set](i, this[_table][dartx._get](nextOffset));
             i = nextOffset;
           }
-          this[_table][dartx.set](this[_tail], null);
+          this[_table][dartx._set](this[_tail], null);
           return offset;
         }
       }
@@ -27381,7 +27707,7 @@
           this[_current$2] = null;
           return false;
         }
-        this[_current$2] = this[_queue][_table][dartx.get](this[_position]);
+        this[_current$2] = this[_queue][_table][dartx._get](this[_position]);
         this[_position] = (dart.notNull(this[_position]) + 1 & dart.notNull(this[_queue][_table][dartx.length]) - 1) >>> 0;
         return true;
       }
@@ -27656,7 +27982,7 @@
         if (isValidKey === void 0) isValidKey = null;
         let result = new (SplayTreeMapOfK$V())(compare, isValidKey);
         other[dartx.forEach](dart.fn((k, v) => {
-          result.set(K.as(k), V.as(v));
+          result._set(K.as(k), V.as(v));
         }, dynamicAnddynamicTovoid$()));
         return result;
       }
@@ -27688,7 +28014,7 @@
         this[_validKey] = null;
         super.new();
       }
-      get(key) {
+      _get(key) {
         if (!dart.test(dart.dcall(this[_validKey], key))) return null;
         if (this[_root] != null) {
           let comp = this[_splay](K.as(key));
@@ -27704,7 +28030,7 @@
         if (mapRoot != null) return mapRoot.value;
         return null;
       }
-      set(key, value) {
+      _set(key, value) {
         (() => {
           K._check(key);
           V._check(value);
@@ -27742,7 +28068,7 @@
       addAll(other) {
         MapOfK$V()._check(other);
         other[dartx.forEach](dart.fn((key, value) => {
-          this.set(key, value);
+          this._set(key, value);
         }, KAndVTovoid$()));
       }
       get isEmpty() {
@@ -27853,9 +28179,9 @@
       }),
       methods: () => ({
         [_compare]: dart.definiteFunctionType(core.int, [K, K]),
-        get: dart.definiteFunctionType(V, [core.Object]),
+        _get: dart.definiteFunctionType(V, [core.Object]),
         remove: dart.definiteFunctionType(V, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [K, V]),
+        _set: dart.definiteFunctionType(dart.void, [K, V]),
         putIfAbsent: dart.definiteFunctionType(V, [K, VoidToV()]),
         addAll: dart.definiteFunctionType(dart.void, [MapOfK$V()]),
         forEach: dart.definiteFunctionType(dart.void, [KAndVTovoid()]),
@@ -27869,9 +28195,9 @@
       })
     });
     dart.defineExtensionMembers(SplayTreeMap, [
-      'get',
+      '_get',
       'remove',
-      'set',
+      '_set',
       'putIfAbsent',
       'addAll',
       'forEach',
@@ -28291,14 +28617,12 @@
       }),
       getters: () => ({
         iterator: dart.definiteFunctionType(core.Iterator$(E), []),
-        length: dart.definiteFunctionType(core.int, []),
         first: dart.definiteFunctionType(E, []),
         last: dart.definiteFunctionType(E, []),
         single: dart.definiteFunctionType(E, [])
       }),
       methods: () => ({
         [_compare]: dart.definiteFunctionType(core.int, [E, E]),
-        contains: dart.definiteFunctionType(core.bool, [core.Object]),
         add: dart.definiteFunctionType(core.bool, [E]),
         remove: dart.definiteFunctionType(core.bool, [core.Object]),
         addAll: dart.definiteFunctionType(dart.void, [IterableOfE()]),
@@ -28346,7 +28670,7 @@
       let processed = map[_processed];
       let keys = map[_computeKeys$]();
       for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-        let key = keys[dartx.get](i);
+        let key = keys[dartx._get](i);
         let revived = dart.dcall(reviver, key, walk(e[key]));
         processed[key] = revived;
       }
@@ -28383,9 +28707,9 @@
       this[_original] = original;
       this[_data] = null;
     }
-    get(key) {
+    _get(key) {
       if (dart.test(this[_isUpgraded])) {
-        return this[_upgradedMap][dartx.get](key);
+        return this[_upgradedMap][dartx._get](key);
       } else if (!(typeof key == 'string')) {
         return null;
       } else {
@@ -28409,11 +28733,11 @@
     }
     get values() {
       if (dart.test(this[_isUpgraded])) return this[_upgradedMap][dartx.values];
-      return MappedIterableOfString$dynamic().new(this[_computeKeys$](), dart.fn(each => this.get(each), dynamicTodynamic$()));
+      return MappedIterableOfString$dynamic().new(this[_computeKeys$](), dart.fn(each => this._get(each), dynamicTodynamic$()));
     }
-    set(key, value) {
+    _set(key, value) {
       if (dart.test(this[_isUpgraded])) {
-        this[_upgradedMap][dartx.set](key, value);
+        this[_upgradedMap][dartx._set](key, value);
       } else if (dart.test(this.containsKey(key))) {
         let processed = this[_processed];
         convert._JsonMap._setProperty(processed, core.String._check(key), value);
@@ -28422,21 +28746,21 @@
           convert._JsonMap._setProperty(original, core.String._check(key), null);
         }
       } else {
-        this[_upgrade]()[dartx.set](key, value);
+        this[_upgrade]()[dartx._set](key, value);
       }
       return value;
     }
     addAll(other) {
       other[dartx.forEach](dart.fn((key, value) => {
-        this.set(key, value);
+        this._set(key, value);
       }, dynamicAnddynamicTovoid$()));
     }
     containsValue(value) {
       if (dart.test(this[_isUpgraded])) return this[_upgradedMap][dartx.containsValue](value);
       let keys = this[_computeKeys$]();
       for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-        let key = keys[dartx.get](i);
-        if (dart.equals(this.get(key), value)) return true;
+        let key = keys[dartx._get](i);
+        if (dart.equals(this._get(key), value)) return true;
       }
       return false;
     }
@@ -28446,9 +28770,9 @@
       return convert._JsonMap._hasProperty(this[_original], core.String._check(key));
     }
     putIfAbsent(key, ifAbsent) {
-      if (dart.test(this.containsKey(key))) return this.get(key);
+      if (dart.test(this.containsKey(key))) return this._get(key);
       let value = ifAbsent();
-      this.set(key, value);
+      this._set(key, value);
       return value;
     }
     remove(key) {
@@ -28470,7 +28794,7 @@
       if (dart.test(this[_isUpgraded])) return this[_upgradedMap][dartx.forEach](f);
       let keys = this[_computeKeys$]();
       for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-        let key = keys[dartx.get](i);
+        let key = keys[dartx._get](i);
         let value = convert._JsonMap._getProperty(this[_processed], key);
         if (dart.test(convert._JsonMap._isUnprocessed(value))) {
           value = convert._convertJsonToDartLazy(convert._JsonMap._getProperty(this[_original], key));
@@ -28505,8 +28829,8 @@
       let result = dart.map();
       let keys = this[_computeKeys$]();
       for (let i = 0; i < dart.notNull(keys[dartx.length]); i++) {
-        let key = keys[dartx.get](i);
-        result[dartx.set](key, this.get(key));
+        let key = keys[dartx._get](i);
+        result[dartx._set](key, this._get(key));
       }
       if (dart.test(keys[dartx.isEmpty])) {
         keys[dartx.add](null);
@@ -28560,8 +28884,8 @@
       [_upgradedMap]: dart.definiteFunctionType(core.Map, [])
     }),
     methods: () => ({
-      get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
-      set: dart.definiteFunctionType(dart.void, [dart.dynamic, dart.dynamic]),
+      _get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
+      _set: dart.definiteFunctionType(dart.void, [dart.dynamic, dart.dynamic]),
       addAll: dart.definiteFunctionType(dart.void, [core.Map]),
       containsValue: dart.definiteFunctionType(core.bool, [core.Object]),
       containsKey: dart.definiteFunctionType(core.bool, [core.Object]),
@@ -28584,8 +28908,8 @@
     names: ['_hasProperty', '_getProperty', '_setProperty', '_getPropertyNames', '_isUnprocessed', '_newJavaScriptObject']
   });
   dart.defineExtensionMembers(convert._JsonMap, [
-    'get',
-    'set',
+    '_get',
+    '_set',
     'addAll',
     'containsValue',
     'containsKey',
@@ -28609,7 +28933,7 @@
       return this[_parent].length;
     }
     elementAt(index) {
-      return core.String._check(dart.test(this[_parent][_isUpgraded]) ? this[_parent].keys[dartx.elementAt](index) : this[_parent][_computeKeys$]()[dartx.get](index));
+      return core.String._check(dart.test(this[_parent][_isUpgraded]) ? this[_parent].keys[dartx.elementAt](index) : this[_parent][_computeKeys$]()[dartx._get](index));
     }
     get iterator() {
       return dart.test(this[_parent][_isUpgraded]) ? this[_parent].keys[dartx.iterator] : this[_parent][_computeKeys$]()[dartx.iterator];
@@ -28712,9 +29036,7 @@
   let const$28;
   let const$29;
   convert.Codec$ = dart.generic((S, T) => {
-    let _FusedCodecOfS$T$dynamic = () => (_FusedCodecOfS$T$dynamic = dart.constFn(convert._FusedCodec$(S, T, dart.dynamic)))();
     let _InvertedCodecOfT$S = () => (_InvertedCodecOfT$S = dart.constFn(convert._InvertedCodec$(T, S)))();
-    let CodecOfT$dynamic = () => (CodecOfT$dynamic = dart.constFn(convert.Codec$(T, dart.dynamic)))();
     class Codec extends core.Object {
       new() {
       }
@@ -28726,9 +29048,11 @@
         T._check(encoded);
         return this.decoder.convert(encoded);
       }
-      fuse(other) {
-        CodecOfT$dynamic()._check(other);
-        return new (_FusedCodecOfS$T$dynamic())(this, other);
+      fuse(R) {
+        return other => {
+          convert.Codec$(T, R)._check(other);
+          return new (convert._FusedCodec$(S, T, R))(this, other);
+        };
       }
       get inverted() {
         return new (_InvertedCodecOfT$S())(this);
@@ -28741,7 +29065,7 @@
       methods: () => ({
         encode: dart.definiteFunctionType(T, [S]),
         decode: dart.definiteFunctionType(S, [T]),
-        fuse: dart.definiteFunctionType(convert.Codec$(S, dart.dynamic), [CodecOfT$dynamic()])
+        fuse: dart.definiteFunctionType(R => [convert.Codec$(S, R), [convert.Codec$(T, R)]])
       })
     });
     return Codec;
@@ -28853,7 +29177,7 @@
         let result = ListOfE().new(length);
         if (length != 0 && fill != null) {
           for (let i = 0; i < dart.notNull(result[dartx.length]); i++) {
-            result[dartx.set](i, fill);
+            result[dartx._set](i, fill);
           }
         }
         return result;
@@ -28877,7 +29201,7 @@
           result = ListOfE().new(length);
         }
         for (let i = 0; i < dart.notNull(length); i++) {
-          result[dartx.set](i, generator(i));
+          result[dartx._set](i, generator(i));
         }
         return result;
       }
@@ -28916,7 +29240,7 @@
     static getByName(name) {
       if (name == null) return null;
       name = name[dartx.toLowerCase]();
-      return convert.Encoding._nameToEncoding[dartx.get](name);
+      return convert.Encoding._nameToEncoding[dartx._get](name);
     }
   };
   dart.addSimpleTypeTests(convert.Encoding);
@@ -29027,7 +29351,7 @@
         if ((dart.notNull(codeUnit) & ~dart.notNull(this[_subsetMask])) != 0) {
           dart.throw(new core.ArgumentError("String contains invalid characters."));
         }
-        result[dartx.set](i, codeUnit);
+        result[dartx._set](i, codeUnit);
       }
       return result;
     }
@@ -29106,7 +29430,7 @@
       core.RangeError.checkValidRange(start, end, byteCount);
       if (end == null) end = byteCount;
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        let byte = bytes[dartx.get](i);
+        let byte = bytes[dartx._get](i);
         if ((dart.notNull(byte) & ~dart.notNull(this[_subsetMask])) != 0) {
           if (!dart.test(this[_allowInvalid])) {
             dart.throw(new core.FormatException(dart.str`Invalid value in input: ${byte}`));
@@ -29119,7 +29443,7 @@
     [_convertInvalid](bytes, start, end) {
       let buffer = new core.StringBuffer();
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        let value = bytes[dartx.get](i);
+        let value = bytes[dartx._get](i);
         if ((dart.notNull(value) & ~dart.notNull(this[_subsetMask])) != 0) value = 65533;
         buffer.writeCharCode(value);
       }
@@ -29235,7 +29559,7 @@
     addSlice(source, start, end, isLast) {
       core.RangeError.checkValidRange(start, end, source[dartx.length]);
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        if ((dart.notNull(source[dartx.get](i)) & ~convert._ASCII_MASK) != 0) {
+        if ((dart.notNull(source[dartx._get](i)) & ~convert._ASCII_MASK) != 0) {
           if (dart.notNull(i) > dart.notNull(start)) this[_utf8Sink].addSlice(source, start, i, false);
           this[_utf8Sink].add(const$30 || (const$30 = dart.constList([239, 191, 189], core.int)));
           start = dart.notNull(i) + 1;
@@ -29266,7 +29590,7 @@
     }
     add(source) {
       for (let i = 0; i < dart.notNull(source[dartx.length]); i++) {
-        if ((dart.notNull(source[dartx.get](i)) & ~convert._ASCII_MASK) != 0) {
+        if ((dart.notNull(source[dartx._get](i)) & ~convert._ASCII_MASK) != 0) {
           dart.throw(new core.FormatException("Source contains non-ASCII bytes."));
         }
       }
@@ -29407,27 +29731,27 @@
       let expectedChars = 3 - dart.notNull(convert._Base64Encoder._stateCount(state));
       let byteOr = 0;
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        let byte = bytes[dartx.get](i);
+        let byte = bytes[dartx._get](i);
         byteOr = (dart.notNull(byteOr) | dart.notNull(byte)) >>> 0;
         bits = (dart.notNull(bits) << 8 | dart.notNull(byte)) & 16777215;
         expectedChars--;
         if (expectedChars == 0) {
-          output[dartx.set]((() => {
+          output[dartx._set]((() => {
             let x = outputIndex;
             outputIndex = dart.notNull(x) + 1;
             return x;
           })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 18 & convert._Base64Encoder._sixBitMask));
-          output[dartx.set]((() => {
+          output[dartx._set]((() => {
             let x = outputIndex;
             outputIndex = dart.notNull(x) + 1;
             return x;
           })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 12 & convert._Base64Encoder._sixBitMask));
-          output[dartx.set]((() => {
+          output[dartx._set]((() => {
             let x = outputIndex;
             outputIndex = dart.notNull(x) + 1;
             return x;
           })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 6 & convert._Base64Encoder._sixBitMask));
-          output[dartx.set]((() => {
+          output[dartx._set]((() => {
             let x = outputIndex;
             outputIndex = dart.notNull(x) + 1;
             return x;
@@ -29445,53 +29769,53 @@
       }
       let i = start;
       while (dart.notNull(i) < dart.notNull(end)) {
-        let byte = bytes[dartx.get](i);
+        let byte = bytes[dartx._get](i);
         if (dart.notNull(byte) < 0 || dart.notNull(byte) > 255) break;
         i = dart.notNull(i) + 1;
       }
-      dart.throw(new core.ArgumentError.value(bytes, dart.str`Not a byte value at index ${i}: 0x${bytes[dartx.get](i)[dartx.toRadixString](16)}`));
+      dart.throw(new core.ArgumentError.value(bytes, dart.str`Not a byte value at index ${i}: 0x${bytes[dartx._get](i)[dartx.toRadixString](16)}`));
     }
     static writeFinalChunk(alphabet, output, outputIndex, count, bits) {
       dart.assert(dart.notNull(count) > 0);
       if (count == 1) {
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 2 & convert._Base64Encoder._sixBitMask));
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) << 4 & convert._Base64Encoder._sixBitMask));
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), convert._paddingChar);
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), convert._paddingChar);
       } else {
         dart.assert(count == 2);
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 10 & convert._Base64Encoder._sixBitMask));
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) >> 4 & convert._Base64Encoder._sixBitMask));
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
         })(), alphabet[dartx.codeUnitAt](dart.notNull(bits) << 2 & convert._Base64Encoder._sixBitMask));
-        output[dartx.set]((() => {
+        output[dartx._set]((() => {
           let x = outputIndex;
           outputIndex = dart.notNull(x) + 1;
           return x;
@@ -29703,23 +30027,23 @@
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
         let char = input[dartx.codeUnitAt](i);
         charOr = (dart.notNull(charOr) | dart.notNull(char)) >>> 0;
-        let code = convert._Base64Decoder._inverseAlphabet[dartx.get]((dart.notNull(char) & asciiMask) >>> 0);
+        let code = convert._Base64Decoder._inverseAlphabet[dartx._get]((dart.notNull(char) & asciiMask) >>> 0);
         if (dart.notNull(code) >= 0) {
           bits = (bits[dartx['<<']](bitsPerCharacter) | dart.notNull(code)) & 16777215;
           count = dart.notNull(count) + 1 & 3;
           if (count == 0) {
             dart.assert(dart.notNull(outIndex) + 3 <= dart.notNull(output[dartx.length]));
-            output[dartx.set]((() => {
+            output[dartx._set]((() => {
               let x = outIndex;
               outIndex = dart.notNull(x) + 1;
               return x;
             })(), (bits[dartx['>>']](16) & eightBitMask) >>> 0);
-            output[dartx.set]((() => {
+            output[dartx._set]((() => {
               let x = outIndex;
               outIndex = dart.notNull(x) + 1;
               return x;
             })(), (bits[dartx['>>']](8) & eightBitMask) >>> 0);
-            output[dartx.set]((() => {
+            output[dartx._set]((() => {
               let x = outIndex;
               outIndex = dart.notNull(x) + 1;
               return x;
@@ -29733,12 +30057,12 @@
             if ((dart.notNull(bits) & 3) != 0) {
               dart.throw(new core.FormatException("Invalid encoding before padding", input, i));
             }
-            output[dartx.set]((() => {
+            output[dartx._set]((() => {
               let x = outIndex;
               outIndex = dart.notNull(x) + 1;
               return x;
             })(), bits[dartx['>>']](10));
-            output[dartx.set]((() => {
+            output[dartx._set]((() => {
               let x = outIndex;
               outIndex = dart.notNull(x) + 1;
               return x;
@@ -29747,7 +30071,7 @@
             if ((dart.notNull(bits) & 15) != 0) {
               dart.throw(new core.FormatException("Invalid encoding before padding", input, i));
             }
-            output[dartx.set]((() => {
+            output[dartx._set]((() => {
               let x = outIndex;
               outIndex = dart.notNull(x) + 1;
               return x;
@@ -30299,7 +30623,7 @@
     [_convert](text, start, end) {
       let result = null;
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        let ch = text[dartx.get](i);
+        let ch = text[dartx._get](i);
         let replacement = null;
         switch (ch) {
           case '&':
@@ -30571,14 +30895,14 @@
       }
       dart.fn(addChunk, Uint8ListAndintAndintTovoid$());
       convert._JsonUtf8Stringifier.stringify(object, this[_indent], this[_toEncodable], this[_bufferSize], addChunk);
-      if (bytes[dartx.length] == 1) return bytes[dartx.get](0);
+      if (bytes[dartx.length] == 1) return bytes[dartx._get](0);
       let length = 0;
       for (let i = 0; i < dart.notNull(bytes[dartx.length]); i++) {
-        length = dart.notNull(length) + dart.notNull(bytes[dartx.get](i)[dartx.length]);
+        length = dart.notNull(length) + dart.notNull(bytes[dartx._get](i)[dartx.length]);
       }
       let result = typed_data.Uint8List.new(length);
       for (let i = 0, offset = 0; i < dart.notNull(bytes[dartx.length]); i++) {
-        let byteList = bytes[dartx.get](i);
+        let byteList = bytes[dartx._get](i);
         let end = offset + dart.notNull(byteList[dartx.length]);
         result[dartx.setRange](offset, end, byteList);
         offset = end;
@@ -30815,7 +31139,7 @@
     }
     [_checkCycle](object) {
       for (let i = 0; i < dart.notNull(this[_seen][dartx.length]); i++) {
-        if (core.identical(object, this[_seen][dartx.get](i))) {
+        if (core.identical(object, this[_seen][dartx._get](i))) {
           dart.throw(new convert.JsonCyclicError(object));
         }
       }
@@ -30876,10 +31200,10 @@
     writeList(list) {
       this.writeString('[');
       if (dart.notNull(list[dartx.length]) > 0) {
-        this.writeObject(list[dartx.get](0));
+        this.writeObject(list[dartx._get](0));
         for (let i = 1; i < dart.notNull(list[dartx.length]); i++) {
           this.writeString(',');
-          this.writeObject(list[dartx.get](i));
+          this.writeObject(list[dartx._get](i));
         }
       }
       this.writeString(']');
@@ -30896,8 +31220,8 @@
         if (!(typeof key == 'string')) {
           allStringKeys = false;
         }
-        keyValueList[dartx.set](i++, key);
-        keyValueList[dartx.set](i++, value);
+        keyValueList[dartx._set](i++, key);
+        keyValueList[dartx._set](i++, value);
       }, dynamicAnddynamicTovoid$()));
       if (!allStringKeys) return false;
       this.writeString('{');
@@ -30905,9 +31229,9 @@
       for (let i = 0; i < dart.notNull(keyValueList[dartx.length]); i = i + 2) {
         this.writeString(separator);
         separator = ',"';
-        this.writeStringContent(core.String._check(keyValueList[dartx.get](i)));
+        this.writeStringContent(core.String._check(keyValueList[dartx._get](i)));
         this.writeString('":');
-        this.writeObject(keyValueList[dartx.get](i + 1));
+        this.writeObject(keyValueList[dartx._get](i + 1));
       }
       this.writeString('}');
       return true;
@@ -30973,11 +31297,11 @@
         this.writeString('[\n');
         this[_indentLevel] = dart.notNull(this[_indentLevel]) + 1;
         this.writeIndentation(this[_indentLevel]);
-        this.writeObject(list[dartx.get](0));
+        this.writeObject(list[dartx._get](0));
         for (let i = 1; i < dart.notNull(list[dartx.length]); i++) {
           this.writeString(',\n');
           this.writeIndentation(this[_indentLevel]);
-          this.writeObject(list[dartx.get](i));
+          this.writeObject(list[dartx._get](i));
         }
         this.writeString('\n');
         this[_indentLevel] = dart.notNull(this[_indentLevel]) - 1;
@@ -30997,8 +31321,8 @@
         if (!(typeof key == 'string')) {
           allStringKeys = false;
         }
-        keyValueList[dartx.set](i++, key);
-        keyValueList[dartx.set](i++, value);
+        keyValueList[dartx._set](i++, key);
+        keyValueList[dartx._set](i++, value);
       }, dynamicAnddynamicTovoid$()));
       if (!allStringKeys) return false;
       this.writeString('{\n');
@@ -31009,9 +31333,9 @@
         separator = ",\n";
         this.writeIndentation(this[_indentLevel]);
         this.writeString('"');
-        this.writeStringContent(core.String._check(keyValueList[dartx.get](i)));
+        this.writeStringContent(core.String._check(keyValueList[dartx._get](i)));
         this.writeString('": ');
-        this.writeObject(keyValueList[dartx.get](i + 1));
+        this.writeObject(keyValueList[dartx._get](i + 1));
       }
       this.writeString('\n');
       this[_indentLevel] = dart.notNull(this[_indentLevel]) - 1;
@@ -31183,7 +31507,7 @@
         this.buffer = typed_data.Uint8List.new(this.bufferSize);
         this.index = 0;
       }
-      this.buffer[dartx.set]((() => {
+      this.buffer[dartx._set]((() => {
         let x = this.index;
         this.index = dart.notNull(x) + 1;
         return x;
@@ -31221,7 +31545,7 @@
       let indent = this.indent;
       let indentLength = indent[dartx.length];
       if (indentLength == 1) {
-        let char = indent[dartx.get](0);
+        let char = indent[dartx._get](0);
         while (dart.notNull(count) > 0) {
           this.writeByte(char);
           count = dart.notNull(count) - 1;
@@ -31236,7 +31560,7 @@
           this.index = end;
         } else {
           for (let i = 0; i < dart.notNull(indentLength); i++) {
-            this.writeByte(indent[dartx.get](i));
+            this.writeByte(indent[dartx._get](i));
           }
         }
       }
@@ -31345,7 +31669,7 @@
     static _checkValidLatin1(source, start, end) {
       let mask = 0;
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        mask = (dart.notNull(mask) | dart.notNull(source[dartx.get](i))) >>> 0;
+        mask = (dart.notNull(mask) | dart.notNull(source[dartx._get](i))) >>> 0;
       }
       if (dart.notNull(mask) >= 0 && dart.notNull(mask) <= convert._LATIN1_MASK) {
         return;
@@ -31354,7 +31678,7 @@
     }
     static _reportInvalidLatin1(source, start, end) {
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        let char = source[dartx.get](i);
+        let char = source[dartx._get](i);
         if (dart.notNull(char) < 0 || dart.notNull(char) > convert._LATIN1_MASK) {
           dart.throw(new core.FormatException("Source contains non-Latin-1 characters.", source, i));
         }
@@ -31384,7 +31708,7 @@
     addSlice(source, start, end, isLast) {
       core.RangeError.checkValidRange(start, end, source[dartx.length]);
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        let char = source[dartx.get](i);
+        let char = source[dartx._get](i);
         if (dart.notNull(char) > convert._LATIN1_MASK || dart.notNull(char) < 0) {
           if (dart.notNull(i) > dart.notNull(start)) this[_addSliceToSink](source, start, i, false);
           this[_addSliceToSink](const$49 || (const$49 = dart.constList([65533], core.int)), 0, 1, false);
@@ -31924,39 +32248,39 @@
         let rune = convert._combineSurrogatePair(leadingSurrogate, nextCodeUnit);
         dart.assert(dart.notNull(rune) > convert._THREE_BYTE_LIMIT);
         dart.assert(dart.notNull(rune) <= convert._FOUR_BYTE_LIMIT);
-        this[_buffer][dartx.set]((() => {
+        this[_buffer][dartx._set]((() => {
           let x = this[_bufferIndex];
           this[_bufferIndex] = dart.notNull(x) + 1;
           return x;
         })(), (240 | rune[dartx['>>']](18)) >>> 0);
-        this[_buffer][dartx.set]((() => {
+        this[_buffer][dartx._set]((() => {
           let x = this[_bufferIndex];
           this[_bufferIndex] = dart.notNull(x) + 1;
           return x;
         })(), 128 | dart.notNull(rune) >> 12 & 63);
-        this[_buffer][dartx.set]((() => {
+        this[_buffer][dartx._set]((() => {
           let x = this[_bufferIndex];
           this[_bufferIndex] = dart.notNull(x) + 1;
           return x;
         })(), 128 | dart.notNull(rune) >> 6 & 63);
-        this[_buffer][dartx.set]((() => {
+        this[_buffer][dartx._set]((() => {
           let x = this[_bufferIndex];
           this[_bufferIndex] = dart.notNull(x) + 1;
           return x;
         })(), 128 | dart.notNull(rune) & 63);
         return true;
       } else {
-        this[_buffer][dartx.set]((() => {
+        this[_buffer][dartx._set]((() => {
           let x = this[_bufferIndex];
           this[_bufferIndex] = dart.notNull(x) + 1;
           return x;
         })(), (224 | leadingSurrogate[dartx['>>']](12)) >>> 0);
-        this[_buffer][dartx.set]((() => {
+        this[_buffer][dartx._set]((() => {
           let x = this[_bufferIndex];
           this[_bufferIndex] = dart.notNull(x) + 1;
           return x;
         })(), 128 | dart.notNull(leadingSurrogate) >> 6 & 63);
-        this[_buffer][dartx.set]((() => {
+        this[_buffer][dartx._set]((() => {
           let x = this[_bufferIndex];
           this[_bufferIndex] = dart.notNull(x) + 1;
           return x;
@@ -31973,7 +32297,7 @@
         let codeUnit = str[dartx.codeUnitAt](stringIndex);
         if (dart.notNull(codeUnit) <= convert._ONE_BYTE_LIMIT) {
           if (dart.notNull(this[_bufferIndex]) >= dart.notNull(this[_buffer][dartx.length])) break;
-          this[_buffer][dartx.set]((() => {
+          this[_buffer][dartx._set]((() => {
             let x = this[_bufferIndex];
             this[_bufferIndex] = dart.notNull(x) + 1;
             return x;
@@ -31989,12 +32313,12 @@
           let rune = codeUnit;
           if (dart.notNull(rune) <= convert._TWO_BYTE_LIMIT) {
             if (dart.notNull(this[_bufferIndex]) + 1 >= dart.notNull(this[_buffer][dartx.length])) break;
-            this[_buffer][dartx.set]((() => {
+            this[_buffer][dartx._set]((() => {
               let x = this[_bufferIndex];
               this[_bufferIndex] = dart.notNull(x) + 1;
               return x;
             })(), (192 | rune[dartx['>>']](6)) >>> 0);
-            this[_buffer][dartx.set]((() => {
+            this[_buffer][dartx._set]((() => {
               let x = this[_bufferIndex];
               this[_bufferIndex] = dart.notNull(x) + 1;
               return x;
@@ -32002,17 +32326,17 @@
           } else {
             dart.assert(dart.notNull(rune) <= convert._THREE_BYTE_LIMIT);
             if (dart.notNull(this[_bufferIndex]) + 2 >= dart.notNull(this[_buffer][dartx.length])) break;
-            this[_buffer][dartx.set]((() => {
+            this[_buffer][dartx._set]((() => {
               let x = this[_bufferIndex];
               this[_bufferIndex] = dart.notNull(x) + 1;
               return x;
             })(), (224 | rune[dartx['>>']](12)) >>> 0);
-            this[_buffer][dartx.set]((() => {
+            this[_buffer][dartx._set]((() => {
               let x = this[_bufferIndex];
               this[_bufferIndex] = dart.notNull(x) + 1;
               return x;
             })(), 128 | dart.notNull(rune) >> 6 & 63);
-            this[_buffer][dartx.set]((() => {
+            this[_buffer][dartx._set]((() => {
               let x = this[_bufferIndex];
               this[_bufferIndex] = dart.notNull(x) + 1;
               return x;
@@ -32239,7 +32563,7 @@
                 if (i == endIndex) {
                   break loop;
                 }
-                let unit = codeUnits[dartx.get](i);
+                let unit = codeUnits[dartx._get](i);
                 if ((dart.notNull(unit) & 192) != 128) {
                   expectedUnits = 0;
                   if (!dart.test(this[_allowMalformed])) {
@@ -32254,7 +32578,7 @@
                   i = dart.notNull(i) + 1;
                 }
               } while (dart.notNull(expectedUnits) > 0);
-              if (dart.notNull(value) <= dart.notNull(convert._Utf8Decoder._LIMITS[dartx.get](dart.notNull(extraUnits) - 1))) {
+              if (dart.notNull(value) <= dart.notNull(convert._Utf8Decoder._LIMITS[dartx._get](dart.notNull(extraUnits) - 1))) {
                 if (!dart.test(this[_allowMalformed])) {
                   dart.throw(new core.FormatException(dart.str`Overlong encoding of 0x${value[dartx.toRadixString](16)}`));
                 }
@@ -32280,7 +32604,7 @@
               i = dart.notNull(i) + dart.notNull(oneBytes);
               if (i == endIndex) break;
             }
-            let unit = codeUnits[dartx.get]((() => {
+            let unit = codeUnits[dartx._get]((() => {
               let x = i;
               i = dart.notNull(x) + 1;
               return x;
@@ -32476,23 +32800,23 @@
           return result;
         }
         dart.fn(parseMilliAndMicroseconds, StringToint$());
-        let years = core.int.parse(match.get(1));
-        let month = core.int.parse(match.get(2));
-        let day = core.int.parse(match.get(3));
-        let hour = parseIntOrZero(match.get(4));
-        let minute = parseIntOrZero(match.get(5));
-        let second = parseIntOrZero(match.get(6));
+        let years = core.int.parse(match._get(1));
+        let month = core.int.parse(match._get(2));
+        let day = core.int.parse(match._get(3));
+        let hour = parseIntOrZero(match._get(4));
+        let minute = parseIntOrZero(match._get(5));
+        let second = parseIntOrZero(match._get(6));
         let addOneMillisecond = false;
-        let milliAndMicroseconds = parseMilliAndMicroseconds(match.get(7));
+        let milliAndMicroseconds = parseMilliAndMicroseconds(match._get(7));
         let millisecond = (dart.notNull(milliAndMicroseconds) / core.Duration.MICROSECONDS_PER_MILLISECOND)[dartx.truncate]();
         let microsecond = dart.asInt(milliAndMicroseconds[dartx.remainder](core.Duration.MICROSECONDS_PER_MILLISECOND));
         let isUtc = false;
-        if (match.get(8) != null) {
+        if (match._get(8) != null) {
           isUtc = true;
-          if (match.get(9) != null) {
-            let sign = match.get(9) == '-' ? -1 : 1;
-            let hourDifference = core.int.parse(match.get(10));
-            let minuteDifference = parseIntOrZero(match.get(11));
+          if (match._get(9) != null) {
+            let sign = match._get(9) == '-' ? -1 : 1;
+            let hourDifference = core.int.parse(match._get(10));
+            let minuteDifference = parseIntOrZero(match._get(11));
             minuteDifference = dart.notNull(minuteDifference) + 60 * dart.notNull(hourDifference);
             minute = dart.notNull(minute) - sign * dart.notNull(minuteDifference);
           }
@@ -32862,7 +33186,7 @@
       }
       dart.fn(twoDigits, intToString());
       if (dart.notNull(this.inMicroseconds) < 0) {
-        return dart.str`-${this['unary-']()}`;
+        return dart.str`-${this._negate()}`;
       }
       let twoDigitMinutes = twoDigits(dart.asInt(this.inMinutes[dartx.remainder](core.Duration.MINUTES_PER_HOUR)));
       let twoDigitSeconds = twoDigits(dart.asInt(this.inSeconds[dartx.remainder](core.Duration.SECONDS_PER_MINUTE)));
@@ -32875,7 +33199,7 @@
     abs() {
       return new core.Duration._microseconds(this[_duration][dartx.abs]());
     }
-    ['unary-']() {
+    _negate() {
       return new core.Duration._microseconds(-dart.notNull(this[_duration]));
     }
   };
@@ -32907,7 +33231,7 @@
       '>=': dart.definiteFunctionType(core.bool, [core.Duration]),
       compareTo: dart.definiteFunctionType(core.int, [core.Duration]),
       abs: dart.definiteFunctionType(core.Duration, []),
-      'unary-': dart.definiteFunctionType(core.Duration, [])
+      _negate: dart.definiteFunctionType(core.Duration, [])
     }),
     sfields: () => ({
       MICROSECONDS_PER_MILLISECOND: core.int,
@@ -33237,7 +33561,7 @@
           if (i > 0) {
             sb.write(", ");
           }
-          sb.write(core.Error.safeToString(this[_arguments][dartx.get](i)));
+          sb.write(core.Error.safeToString(this[_arguments][dartx._get](i)));
         }
       }
       if (this[_namedArguments] != null) {
@@ -33260,7 +33584,7 @@
           if (i > 0) {
             sb.write(", ");
           }
-          sb.write(this[_existingArgumentNames][dartx.get](i));
+          sb.write(this[_existingArgumentNames][dartx._get](i));
         }
         let formalParameters = sb.toString();
         return "NoSuchMethodError: incorrect number of arguments passed to " + dart.str`method named '${this[_memberName]}'\n` + dart.str`Receiver: ${core.Error.safeToString(this[_receiver$])}\n` + dart.str`Tried calling: ${this[_memberName]}(${actualParameters})\n` + dart.str`Found: ${this[_memberName]}(${formalParameters})`;
@@ -33518,11 +33842,11 @@
       toString() {
         return dart.str`Expando:${this.name}`;
       }
-      get(object) {
+      _get(object) {
         let values = _js_helper.Primitives.getProperty(object, core.Expando._EXPANDO_PROPERTY_NAME);
         return T._check(values == null ? null : _js_helper.Primitives.getProperty(values, this[_getKey]()));
       }
-      set(object, value) {
+      _set(object, value) {
         T._check(value);
         let values = _js_helper.Primitives.getProperty(object, core.Expando._EXPANDO_PROPERTY_NAME);
         if (values == null) {
@@ -33550,8 +33874,8 @@
       constructors: () => ({new: dart.definiteFunctionType(core.Expando$(T), [], [core.String])}),
       fields: () => ({name: core.String}),
       methods: () => ({
-        get: dart.definiteFunctionType(T, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [core.Object, T]),
+        _get: dart.definiteFunctionType(T, [core.Object]),
+        _set: dart.definiteFunctionType(dart.void, [core.Object, T]),
         [_getKey]: dart.definiteFunctionType(core.String, [])
       }),
       sfields: () => ({
@@ -33574,7 +33898,7 @@
     static _toMangledNames(namedArguments) {
       let result = dart.map({}, core.String, dart.dynamic);
       namedArguments[dartx.forEach](dart.fn((symbol, value) => {
-        result[dartx.set](core._symbolToString(symbol), value);
+        result[dartx._set](core._symbolToString(symbol), value);
       }, SymbolAnddynamicTovoid()));
       return result;
     }
@@ -34052,7 +34376,7 @@
     }
     get currentAsString() {
       if (this[_position$] == this[_nextPosition]) return null;
-      if (dart.notNull(this[_position$]) + 1 == this[_nextPosition]) return this.string[dartx.get](this[_position$]);
+      if (dart.notNull(this[_position$]) + 1 == this[_nextPosition]) return this.string[dartx._get](this[_position$]);
       return this.string[dartx.substring](this[_position$], this[_nextPosition]);
     }
     moveNext() {
@@ -34740,7 +35064,7 @@
       if (this[_queryParameterLists] == null) {
         let queryParameterLists = core.Uri._splitQueryStringAll(this.query);
         for (let key of queryParameterLists[dartx.keys]) {
-          queryParameterLists[dartx.set](key, ListOfString().unmodifiable(core.Iterable._check(queryParameterLists[dartx.get](key))));
+          queryParameterLists[dartx._set](key, ListOfString().unmodifiable(core.Iterable._check(queryParameterLists[dartx._get](key))));
         }
         this[_queryParameterLists] = MapOfString$ListOfString().unmodifiable(queryParameterLists);
       }
@@ -34776,7 +35100,7 @@
       return core.Uri._normalizeRegName(host, start, end);
     }
     static _isRegNameChar(char) {
-      return dart.notNull(char) < 127 && (dart.notNull(core.Uri._regNameTable[dartx.get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0;
+      return dart.notNull(char) < 127 && (dart.notNull(core.Uri._regNameTable[dartx._get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0;
     }
     static _normalizeRegName(host, start, end) {
       let buffer = null;
@@ -34971,9 +35295,9 @@
       let codeUnits = null;
       if (dart.notNull(char) < 128) {
         codeUnits = ListOfint().new(3);
-        codeUnits[dartx.set](0, core.Uri._PERCENT);
-        codeUnits[dartx.set](1, core.Uri._hexDigits[dartx.codeUnitAt](char[dartx['>>']](4)));
-        codeUnits[dartx.set](2, core.Uri._hexDigits[dartx.codeUnitAt](dart.notNull(char) & 15));
+        codeUnits[dartx._set](0, core.Uri._PERCENT);
+        codeUnits[dartx._set](1, core.Uri._hexDigits[dartx.codeUnitAt](char[dartx['>>']](4)));
+        codeUnits[dartx._set](2, core.Uri._hexDigits[dartx.codeUnitAt](dart.notNull(char) & 15));
       } else {
         let flag = 192;
         let encodedBytes = 2;
@@ -34989,9 +35313,9 @@
         let index = 0;
         while (--encodedBytes >= 0) {
           let byte = (char[dartx['>>']](6 * encodedBytes) & 63 | flag) >>> 0;
-          codeUnits[dartx.set](index, core.Uri._PERCENT);
-          codeUnits[dartx.set](index + 1, core.Uri._hexDigits[dartx.codeUnitAt](byte[dartx['>>']](4)));
-          codeUnits[dartx.set](index + 2, core.Uri._hexDigits[dartx.codeUnitAt](byte & 15));
+          codeUnits[dartx._set](index, core.Uri._PERCENT);
+          codeUnits[dartx._set](index + 1, core.Uri._hexDigits[dartx.codeUnitAt](byte[dartx['>>']](4)));
+          codeUnits[dartx._set](index + 2, core.Uri._hexDigits[dartx.codeUnitAt](byte & 15));
           index = index + 3;
           flag = 128;
         }
@@ -35004,7 +35328,7 @@
       let index = start;
       while (dart.notNull(index) < dart.notNull(end)) {
         let char = component[dartx.codeUnitAt](index);
-        if (dart.notNull(char) < 127 && (dart.notNull(charTable[dartx.get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0) {
+        if (dart.notNull(char) < 127 && (dart.notNull(charTable[dartx._get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0) {
           index = dart.notNull(index) + 1;
         } else {
           let replacement = null;
@@ -35052,10 +35376,10 @@
       return dart.toString(buffer);
     }
     static _isSchemeCharacter(ch) {
-      return dart.notNull(ch) < 128 && (dart.notNull(core.Uri._schemeTable[dartx.get](ch[dartx['>>']](4))) & 1 << (dart.notNull(ch) & 15)) != 0;
+      return dart.notNull(ch) < 128 && (dart.notNull(core.Uri._schemeTable[dartx._get](ch[dartx['>>']](4))) & 1 << (dart.notNull(ch) & 15)) != 0;
     }
     static _isGeneralDelimiter(ch) {
-      return dart.notNull(ch) <= core.Uri._RIGHT_BRACKET && (dart.notNull(core.Uri._genDelimitersTable[dartx.get](ch[dartx['>>']](4))) & 1 << (dart.notNull(ch) & 15)) != 0;
+      return dart.notNull(ch) <= core.Uri._RIGHT_BRACKET && (dart.notNull(core.Uri._genDelimitersTable[dartx._get](ch[dartx['>>']](4))) & 1 << (dart.notNull(ch) & 15)) != 0;
     }
     get isAbsolute() {
       return this.scheme != "" && this.fragment == "";
@@ -35132,7 +35456,7 @@
           output[dartx.add](segment);
         }
       }
-      if (dart.test(output[dartx.isEmpty]) || output[dartx.length] == 1 && dart.test(output[dartx.get](0)[dartx.isEmpty])) {
+      if (dart.test(output[dartx.isEmpty]) || output[dartx.length] == 1 && dart.test(output[dartx._get](0)[dartx.isEmpty])) {
         return "./";
       }
       if (appendSlash || output[dartx.last] == '..') output[dartx.add]("");
@@ -35262,8 +35586,8 @@
     [_toWindowsFilePath]() {
       let hasDriveLetter = false;
       let segments = this.pathSegments;
-      if (dart.notNull(segments[dartx.length]) > 0 && segments[dartx.get](0)[dartx.length] == 2 && segments[dartx.get](0)[dartx.codeUnitAt](1) == core.Uri._COLON) {
-        core.Uri._checkWindowsDriveLetter(segments[dartx.get](0)[dartx.codeUnitAt](0), false);
+      if (dart.notNull(segments[dartx.length]) > 0 && segments[dartx._get](0)[dartx.length] == 2 && segments[dartx._get](0)[dartx.codeUnitAt](1) == core.Uri._COLON) {
+        core.Uri._checkWindowsDriveLetter(segments[dartx._get](0)[dartx.codeUnitAt](0), false);
         core.Uri._checkWindowsPathReservedCharacters(segments, false, 1);
         hasDriveLetter = true;
       } else {
@@ -35360,12 +35684,12 @@
         let index = element[dartx.indexOf]("=");
         if (index == -1) {
           if (element != "") {
-            map[dartx.set](core.Uri.decodeQueryComponent(element, {encoding: encoding}), "");
+            map[dartx._set](core.Uri.decodeQueryComponent(element, {encoding: encoding}), "");
           }
         } else if (index != 0) {
           let key = element[dartx.substring](0, index);
           let value = element[dartx.substring](dart.notNull(index) + 1);
-          map[dartx.set](core.Uri.decodeQueryComponent(key, {encoding: encoding}), core.Uri.decodeQueryComponent(value, {encoding: encoding}));
+          map[dartx._set](core.Uri.decodeQueryComponent(key, {encoding: encoding}), core.Uri.decodeQueryComponent(value, {encoding: encoding}));
         }
         return map;
       }, MapOfString$StringAndStringToMapOfString$String()));
@@ -35483,8 +35807,8 @@
         } catch (e) {
           try {
             let last = core.Uri.parseIPv4Address(host[dartx.substring](partStart, end));
-            parts[dartx.add]((dart.notNull(last[dartx.get](0)) << 8 | dart.notNull(last[dartx.get](1))) >>> 0);
-            parts[dartx.add]((dart.notNull(last[dartx.get](2)) << 8 | dart.notNull(last[dartx.get](3))) >>> 0);
+            parts[dartx.add]((dart.notNull(last[dartx._get](0)) << 8 | dart.notNull(last[dartx._get](1))) >>> 0);
+            parts[dartx.add]((dart.notNull(last[dartx._get](2)) << 8 | dart.notNull(last[dartx._get](3))) >>> 0);
           } catch (e) {
             error('invalid end of IPv6 address.', partStart);
           }
@@ -35501,17 +35825,17 @@
       }
       let bytes = typed_data.Uint8List.new(16);
       for (let i = 0, index = 0; i < dart.notNull(parts[dartx.length]); i++) {
-        let value = parts[dartx.get](i);
+        let value = parts[dartx._get](i);
         if (value == -1) {
           let wildCardLength = 9 - dart.notNull(parts[dartx.length]);
           for (let j = 0; j < wildCardLength; j++) {
-            bytes[dartx.set](index, 0);
-            bytes[dartx.set](index + 1, 0);
+            bytes[dartx._set](index, 0);
+            bytes[dartx._set](index + 1, 0);
             index = index + 2;
           }
         } else {
-          bytes[dartx.set](index, value[dartx['>>']](8));
-          bytes[dartx.set](index + 1, dart.notNull(value) & 255);
+          bytes[dartx._set](index, value[dartx['>>']](8));
+          bytes[dartx._set](index + 1, dart.notNull(value) & 255);
           index = index + 2;
         }
       }
@@ -35524,16 +35848,16 @@
       let result = new core.StringBuffer();
       let bytes = encoding.encode(text);
       for (let i = 0; i < dart.notNull(bytes[dartx.length]); i++) {
-        let byte = bytes[dartx.get](i);
-        if (dart.notNull(byte) < 128 && (dart.notNull(canonicalTable[dartx.get](byte[dartx['>>']](4))) & 1 << (dart.notNull(byte) & 15)) != 0) {
+        let byte = bytes[dartx._get](i);
+        if (dart.notNull(byte) < 128 && (dart.notNull(canonicalTable[dartx._get](byte[dartx['>>']](4))) & 1 << (dart.notNull(byte) & 15)) != 0) {
           result.writeCharCode(byte);
         } else if (dart.test(spaceToPlus) && byte == core.Uri._SPACE) {
           result.write('+');
         } else {
           let hexDigits = '0123456789ABCDEF';
           result.write('%');
-          result.write(hexDigits[dartx.get](dart.notNull(byte) >> 4 & 15));
-          result.write(hexDigits[dartx.get](dart.notNull(byte) & 15));
+          result.write(hexDigits[dartx._get](dart.notNull(byte) >> 4 & 15));
+          result.write(hexDigits[dartx._get](dart.notNull(byte) & 15));
         }
       }
       return result.toString();
@@ -35602,7 +35926,7 @@
       return core.Uri._LOWER_CASE_A <= lowerCase && lowerCase <= core.Uri._LOWER_CASE_Z;
     }
     static _isUnreservedChar(char) {
-      return dart.notNull(char) < 127 && (dart.notNull(core.Uri._unreservedTable[dartx.get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0;
+      return dart.notNull(char) < 127 && (dart.notNull(core.Uri._unreservedTable[dartx._get](char[dartx['>>']](4))) & 1 << (dart.notNull(char) & 15)) != 0;
     }
   };
   dart.defineNamedConstructor(core.Uri, '_internal');
@@ -35820,7 +36144,7 @@
       let indices = JSArrayOfint().of([core.UriData._noScheme]);
       let charsetName = null;
       let encodingName = null;
-      if (parameters != null) charsetName = parameters[dartx.get]("charset");
+      if (parameters != null) charsetName = parameters[dartx._get]("charset");
       if (encoding == null) {
         if (charsetName != null) {
           encoding = convert.Encoding.getByName(charsetName);
@@ -35835,7 +36159,7 @@
       if (dart.test(base64)) {
         buffer.write(';base64,');
         indices[dartx.add](dart.notNull(buffer.length) - 1);
-        buffer.write(encoding.fuse(convert.BASE64).encode(content));
+        buffer.write(encoding.fuse(core.String)(convert.BASE64).encode(content));
       } else {
         buffer.write(',');
         core.UriData._uriEncodeBytes(core.UriData._uricTable, encoding.encode(content), buffer);
@@ -35936,7 +36260,7 @@
       if (this[_uriCache] != null) return this[_uriCache];
       let path = this[_text];
       let query = null;
-      let colonIndex = this[_separatorIndices][dartx.get](0);
+      let colonIndex = this[_separatorIndices][dartx._get](0);
       let queryIndex = this[_text][dartx.indexOf]('?', dart.notNull(colonIndex) + 1);
       let end = null;
       if (dart.notNull(queryIndex) >= 0) {
@@ -35948,8 +36272,8 @@
       return this[_uriCache];
     }
     get mimeType() {
-      let start = dart.notNull(this[_separatorIndices][dartx.get](0)) + 1;
-      let end = this[_separatorIndices][dartx.get](1);
+      let start = dart.notNull(this[_separatorIndices][dartx._get](0)) + 1;
+      let end = this[_separatorIndices][dartx._get](1);
       if (start == end) return "text/plain";
       return core.Uri._uriDecode(this[_text], start, end, convert.UTF8, false);
     }
@@ -35960,10 +36284,10 @@
         parameterEnd = parameterEnd - 1;
       }
       for (let i = parameterStart; i < parameterEnd; i = i + 2) {
-        let keyStart = dart.notNull(this[_separatorIndices][dartx.get](i)) + 1;
-        let keyEnd = this[_separatorIndices][dartx.get](i + 1);
+        let keyStart = dart.notNull(this[_separatorIndices][dartx._get](i)) + 1;
+        let keyEnd = this[_separatorIndices][dartx._get](i + 1);
         if (keyEnd == keyStart + 7 && dart.test(this[_text][dartx.startsWith]("charset", keyStart))) {
-          return core.Uri._uriDecode(this[_text], dart.notNull(keyEnd) + 1, this[_separatorIndices][dartx.get](i + 2), convert.UTF8, false);
+          return core.Uri._uriDecode(this[_text], dart.notNull(keyEnd) + 1, this[_separatorIndices][dartx._get](i + 2), convert.UTF8, false);
         }
       }
       return "US-ASCII";
@@ -35998,14 +36322,14 @@
       for (let i = start; i < dart.notNull(text[dartx.length]); i++) {
         let codeUnit = text[dartx.codeUnitAt](i);
         if (codeUnit != percent) {
-          result[dartx.set](index++, codeUnit);
+          result[dartx._set](index++, codeUnit);
         } else {
           if (i + 2 < dart.notNull(text[dartx.length])) {
             let digit1 = core.Uri._parseHexDigit(text[dartx.codeUnitAt](i + 1));
             let digit2 = core.Uri._parseHexDigit(text[dartx.codeUnitAt](i + 2));
             if (dart.notNull(digit1) >= 0 && dart.notNull(digit2) >= 0) {
               let byte = dart.notNull(digit1) * 16 + dart.notNull(digit2);
-              result[dartx.set](index++, byte);
+              result[dartx._set](index++, byte);
               i = i + 2;
               continue;
             }
@@ -36036,12 +36360,12 @@
     get parameters() {
       let result = dart.map({}, core.String, core.String);
       for (let i = 3; i < dart.notNull(this[_separatorIndices][dartx.length]); i = i + 2) {
-        let start = dart.notNull(this[_separatorIndices][dartx.get](i - 2)) + 1;
-        let equals = this[_separatorIndices][dartx.get](i - 1);
-        let end = this[_separatorIndices][dartx.get](i);
+        let start = dart.notNull(this[_separatorIndices][dartx._get](i - 2)) + 1;
+        let equals = this[_separatorIndices][dartx._get](i - 1);
+        let end = this[_separatorIndices][dartx._get](i);
         let key = core.Uri._uriDecode(this[_text], start, equals, convert.UTF8, false);
         let value = core.Uri._uriDecode(this[_text], dart.notNull(equals) + 1, end, convert.UTF8, false);
-        result[dartx.set](key, value);
+        result[dartx._set](key, value);
       }
       return result;
     }
@@ -36098,9 +36422,9 @@
     static _uriEncodeBytes(canonicalTable, bytes, buffer) {
       let byteOr = 0;
       for (let i = 0; i < dart.notNull(bytes[dartx.length]); i++) {
-        let byte = bytes[dartx.get](i);
+        let byte = bytes[dartx._get](i);
         byteOr = (dart.notNull(byteOr) | dart.notNull(byte)) >>> 0;
-        if (dart.notNull(byte) < 128 && (dart.notNull(canonicalTable[dartx.get](byte[dartx['>>']](4))) & 1 << (dart.notNull(byte) & 15)) != 0) {
+        if (dart.notNull(byte) < 128 && (dart.notNull(canonicalTable[dartx._get](byte[dartx['>>']](4))) & 1 << (dart.notNull(byte) & 15)) != 0) {
           buffer.writeCharCode(byte);
         } else {
           buffer.writeCharCode(core.Uri._PERCENT);
@@ -36110,7 +36434,7 @@
       }
       if ((dart.notNull(byteOr) & ~255) != 0) {
         for (let i = 0; i < dart.notNull(bytes[dartx.length]); i++) {
-          let byte = bytes[dartx.get](i);
+          let byte = bytes[dartx._get](i);
           if (dart.notNull(byte) < 0 || dart.notNull(byte) > 255) {
             dart.throw(new core.ArgumentError.value(byte, "non-byte value"));
           }
@@ -36118,7 +36442,7 @@
       }
     }
     toString() {
-      return this[_separatorIndices][dartx.get](0) == core.UriData._noScheme ? dart.str`data:${this[_text]}` : this[_text];
+      return this[_separatorIndices][dartx._get](0) == core.UriData._noScheme ? dart.str`data:${this[_text]}` : this[_text];
     }
   };
   dart.defineNamedConstructor(core.UriData, '_');
@@ -36163,6 +36487,741 @@
   core.UriData._noScheme = -1;
   core.UriData._tokenCharTable = dart.constList([0, 0, 27858, 1023, 65534, 51199, 65535, 32767], core.int);
   core.UriData._uricTable = core.Uri._queryCharTable;
+  developer.debugger = function(opts) {
+    let when = opts && 'when' in opts ? opts.when : true;
+    let message = opts && 'message' in opts ? opts.message : null;
+    if (dart.test(when)) {
+      debugger;
+    }
+    return when;
+  };
+  dart.fn(developer.debugger, __Tobool());
+  developer.inspect = function(object) {
+    return object;
+  };
+  dart.fn(developer.inspect, ObjectToObject());
+  developer.log = function(message, opts) {
+    let time = opts && 'time' in opts ? opts.time : null;
+    let sequenceNumber = opts && 'sequenceNumber' in opts ? opts.sequenceNumber : null;
+    let level = opts && 'level' in opts ? opts.level : 0;
+    let name = opts && 'name' in opts ? opts.name : '';
+    let zone = opts && 'zone' in opts ? opts.zone : null;
+    let error = opts && 'error' in opts ? opts.error : null;
+    let stackTrace = opts && 'stackTrace' in opts ? opts.stackTrace : null;
+  };
+  dart.fn(developer.log, String__Tovoid$());
+  dart.defineLazy(developer, {
+    get _extensions() {
+      return MapOfString$ServiceExtensionHandler().new();
+    }
+  });
+  developer._clockValue = 0;
+  const _result = Symbol('_result');
+  const _errorCode = Symbol('_errorCode');
+  const _errorDetail = Symbol('_errorDetail');
+  const _isError = Symbol('_isError');
+  const _toString = Symbol('_toString');
+  developer.ServiceExtensionResponse = class ServiceExtensionResponse extends core.Object {
+    result(result) {
+      this[_result] = result;
+      this[_errorCode] = null;
+      this[_errorDetail] = null;
+      if (!(typeof this[_result] == 'string')) {
+        dart.throw(new core.ArgumentError.value(this[_result], "result", "Must be a String"));
+      }
+    }
+    error(errorCode, errorDetail) {
+      this[_result] = null;
+      this[_errorCode] = errorCode;
+      this[_errorDetail] = errorDetail;
+      developer.ServiceExtensionResponse._validateErrorCode(this[_errorCode]);
+      if (!(typeof this[_errorDetail] == 'string')) {
+        dart.throw(new core.ArgumentError.value(this[_errorDetail], "errorDetail", "Must be a String"));
+      }
+    }
+    static _errorCodeMessage(errorCode) {
+      developer.ServiceExtensionResponse._validateErrorCode(errorCode);
+      if (errorCode == developer.ServiceExtensionResponse.kInvalidParams) {
+        return "Invalid params";
+      }
+      return "Server error";
+    }
+    static _validateErrorCode(errorCode) {
+      if (!(typeof errorCode == 'number')) {
+        dart.throw(new core.ArgumentError.value(errorCode, "errorCode", "Must be an int"));
+      }
+      if (errorCode == developer.ServiceExtensionResponse.invalidParams) {
+        return;
+      }
+      if (dart.notNull(errorCode) >= developer.ServiceExtensionResponse.extensionErrorMin && dart.notNull(errorCode) <= developer.ServiceExtensionResponse.extensionErrorMax) {
+        return;
+      }
+      dart.throw(new core.ArgumentError.value(errorCode, "errorCode", "Out of range"));
+    }
+    [_isError]() {
+      return this[_errorCode] != null && this[_errorDetail] != null;
+    }
+    [_toString]() {
+      if (this[_result] != null) {
+        return this[_result];
+      } else {
+        dart.assert(this[_errorCode] != null);
+        dart.assert(this[_errorDetail] != null);
+        return convert.JSON.encode(dart.map({code: this[_errorCode], message: developer.ServiceExtensionResponse._errorCodeMessage(this[_errorCode]), data: dart.map({details: this[_errorDetail]}, core.String, core.String)}, core.String, core.Object));
+      }
+    }
+  };
+  dart.defineNamedConstructor(developer.ServiceExtensionResponse, 'result');
+  dart.defineNamedConstructor(developer.ServiceExtensionResponse, 'error');
+  dart.setSignature(developer.ServiceExtensionResponse, {
+    constructors: () => ({
+      result: dart.definiteFunctionType(developer.ServiceExtensionResponse, [core.String]),
+      error: dart.definiteFunctionType(developer.ServiceExtensionResponse, [core.int, core.String])
+    }),
+    fields: () => ({
+      [_result]: core.String,
+      [_errorCode]: core.int,
+      [_errorDetail]: core.String
+    }),
+    methods: () => ({
+      [_isError]: dart.definiteFunctionType(core.bool, []),
+      [_toString]: dart.definiteFunctionType(core.String, [])
+    }),
+    sfields: () => ({
+      kInvalidParams: core.int,
+      kExtensionError: core.int,
+      kExtensionErrorMax: core.int,
+      kExtensionErrorMin: core.int,
+      invalidParams: core.int,
+      extensionError: core.int,
+      extensionErrorMax: core.int,
+      extensionErrorMin: core.int
+    }),
+    statics: () => ({
+      _errorCodeMessage: dart.definiteFunctionType(core.String, [core.int]),
+      _validateErrorCode: dart.definiteFunctionType(dart.dynamic, [core.int])
+    }),
+    names: ['_errorCodeMessage', '_validateErrorCode']
+  });
+  developer.ServiceExtensionResponse.invalidParams = -32602;
+  developer.ServiceExtensionResponse.extensionError = -32000;
+  developer.ServiceExtensionResponse.extensionErrorMax = -32000;
+  developer.ServiceExtensionResponse.extensionErrorMin = -32016;
+  dart.defineLazy(developer.ServiceExtensionResponse, {
+    get kInvalidParams() {
+      return developer.ServiceExtensionResponse.invalidParams;
+    },
+    get kExtensionError() {
+      return developer.ServiceExtensionResponse.extensionError;
+    },
+    get kExtensionErrorMax() {
+      return developer.ServiceExtensionResponse.extensionErrorMax;
+    },
+    get kExtensionErrorMin() {
+      return developer.ServiceExtensionResponse.extensionErrorMin;
+    }
+  });
+  developer.ServiceExtensionHandler = dart.typedef('ServiceExtensionHandler', () => dart.functionType(async.Future$(developer.ServiceExtensionResponse), [core.String, MapOfString$String()]));
+  developer.registerExtension = function(method, handler) {
+    if (!(typeof method == 'string')) {
+      dart.throw(new core.ArgumentError.value(method, 'method', 'Must be a String'));
+    }
+    if (!dart.test(method[dartx.startsWith]('ext.'))) {
+      dart.throw(new core.ArgumentError.value(method, 'method', 'Must begin with ext.'));
+    }
+    if (developer._lookupExtension(method) != null) {
+      dart.throw(new core.ArgumentError(dart.str`Extension already registered: ${method}`));
+    }
+    if (!developer.ServiceExtensionHandler.is(handler)) {
+      dart.throw(new core.ArgumentError.value(handler, 'handler', 'Must be a ServiceExtensionHandler'));
+    }
+    developer._registerExtension(method, handler);
+  };
+  dart.fn(developer.registerExtension, StringAndServiceExtensionHandlerTovoid());
+  developer.postEvent = function(eventKind, eventData) {
+    if (!(typeof eventKind == 'string')) {
+      dart.throw(new core.ArgumentError.value(eventKind, 'eventKind', 'Must be a String'));
+    }
+    if (!core.Map.is(eventData)) {
+      dart.throw(new core.ArgumentError.value(eventData, 'eventData', 'Must be a Map'));
+    }
+    let eventDataAsString = convert.JSON.encode(eventData);
+    developer._postEvent(eventKind, eventDataAsString);
+  };
+  dart.fn(developer.postEvent, StringAndMapTovoid());
+  developer._postEvent = function(eventKind, eventData) {
+  };
+  dart.fn(developer._postEvent, StringAndStringTodynamic());
+  developer._lookupExtension = function(method) {
+    return developer._extensions[dartx._get](method);
+  };
+  dart.fn(developer._lookupExtension, StringToServiceExtensionHandler());
+  developer._registerExtension = function(method, handler) {
+    developer._extensions[dartx._set](method, handler);
+  };
+  dart.fn(developer._registerExtension, StringAndServiceExtensionHandlerTodynamic());
+  developer.UserTag = class UserTag extends core.Object {
+    static new(label) {
+      return developer._FakeUserTag.new(label);
+    }
+    static get defaultTag() {
+      return developer._FakeUserTag._defaultTag;
+    }
+  };
+  dart.setSignature(developer.UserTag, {
+    constructors: () => ({new: dart.definiteFunctionType(developer.UserTag, [core.String])}),
+    sfields: () => ({MAX_USER_TAGS: core.int}),
+    sgetters: () => ({defaultTag: dart.definiteFunctionType(developer.UserTag, [])})
+  });
+  developer.UserTag.MAX_USER_TAGS = 64;
+  developer._FakeUserTag = class _FakeUserTag extends core.Object {
+    real(label) {
+      this.label = label;
+    }
+    static new(label) {
+      let existingTag = developer._FakeUserTag._instances[dartx._get](label);
+      if (existingTag != null) {
+        return developer._FakeUserTag._check(existingTag);
+      }
+      if (developer._FakeUserTag._instances[dartx.length] == developer.UserTag.MAX_USER_TAGS) {
+        dart.throw(new core.UnsupportedError(dart.str`UserTag instance limit (${developer.UserTag.MAX_USER_TAGS}) reached.`));
+      }
+      let instance = new developer._FakeUserTag.real(label);
+      developer._FakeUserTag._instances[dartx._set](label, instance);
+      return instance;
+    }
+    makeCurrent() {
+      let old = developer._currentTag;
+      developer._currentTag = this;
+      return old;
+    }
+  };
+  dart.defineNamedConstructor(developer._FakeUserTag, 'real');
+  developer._FakeUserTag[dart.implements] = () => [developer.UserTag];
+  dart.setSignature(developer._FakeUserTag, {
+    constructors: () => ({
+      real: dart.definiteFunctionType(developer._FakeUserTag, [core.String]),
+      new: dart.definiteFunctionType(developer._FakeUserTag, [core.String])
+    }),
+    fields: () => ({label: core.String}),
+    methods: () => ({makeCurrent: dart.definiteFunctionType(developer.UserTag, [])}),
+    sfields: () => ({
+      _instances: core.Map,
+      _defaultTag: developer.UserTag
+    })
+  });
+  dart.defineLazy(developer._FakeUserTag, {
+    get _instances() {
+      return dart.map();
+    },
+    set _instances(_) {},
+    get _defaultTag() {
+      return developer._FakeUserTag.new('Default');
+    }
+  });
+  dart.defineLazy(developer, {
+    get _currentTag() {
+      return developer._FakeUserTag._defaultTag;
+    },
+    set _currentTag(_) {}
+  });
+  developer.getCurrentTag = function() {
+    return developer._currentTag;
+  };
+  dart.fn(developer.getCurrentTag, VoidToUserTag());
+  developer.Metric = class Metric extends core.Object {
+    new(name, description) {
+      this.name = name;
+      this.description = description;
+      if (this.name == 'vm' || dart.test(this.name[dartx.contains]('/'))) {
+        dart.throw(new core.ArgumentError('Invalid Metric name.'));
+      }
+    }
+  };
+  dart.setSignature(developer.Metric, {
+    constructors: () => ({new: dart.definiteFunctionType(developer.Metric, [core.String, core.String])}),
+    fields: () => ({
+      name: core.String,
+      description: core.String
+    })
+  });
+  const _value$0 = Symbol('_value');
+  const _toJSON = Symbol('_toJSON');
+  developer.Gauge = class Gauge extends developer.Metric {
+    get value() {
+      return this[_value$0];
+    }
+    set value(v) {
+      if (dart.notNull(v) < dart.notNull(this.min)) {
+        v = this.min;
+      } else if (dart.notNull(v) > dart.notNull(this.max)) {
+        v = this.max;
+      }
+      this[_value$0] = v;
+    }
+    new(name, description, min, max) {
+      this.min = min;
+      this.max = max;
+      this[_value$0] = null;
+      super.new(name, description);
+      if (!(typeof this.min == 'number')) {
+        dart.throw(new core.ArgumentError('min must be a double'));
+      }
+      if (!(typeof this.max == 'number')) {
+        dart.throw(new core.ArgumentError('max must be a double'));
+      }
+      if (!(dart.notNull(this.min) < dart.notNull(this.max))) {
+        dart.throw(new core.ArgumentError('min must be less than max'));
+      }
+      this[_value$0] = this.min;
+    }
+    [_toJSON]() {
+      let map = dart.map({type: 'Gauge', id: dart.str`metrics/${this.name}`, name: this.name, description: this.description, value: this.value, min: this.min, max: this.max}, core.String, core.Object);
+      return map;
+    }
+  };
+  dart.setSignature(developer.Gauge, {
+    constructors: () => ({new: dart.definiteFunctionType(developer.Gauge, [core.String, core.String, core.double, core.double])}),
+    fields: () => ({
+      min: core.double,
+      max: core.double,
+      [_value$0]: core.double
+    }),
+    getters: () => ({value: dart.definiteFunctionType(core.double, [])}),
+    setters: () => ({value: dart.definiteFunctionType(dart.void, [core.double])}),
+    methods: () => ({[_toJSON]: dart.definiteFunctionType(core.Map, [])})
+  });
+  developer.Counter = class Counter extends developer.Metric {
+    new(name, description) {
+      this[_value$0] = 0.0;
+      super.new(name, description);
+    }
+    get value() {
+      return this[_value$0];
+    }
+    set value(v) {
+      this[_value$0] = v;
+    }
+    [_toJSON]() {
+      let map = dart.map({type: 'Counter', id: dart.str`metrics/${this.name}`, name: this.name, description: this.description, value: this.value}, core.String, core.Object);
+      return map;
+    }
+  };
+  dart.setSignature(developer.Counter, {
+    constructors: () => ({new: dart.definiteFunctionType(developer.Counter, [core.String, core.String])}),
+    fields: () => ({[_value$0]: core.double}),
+    getters: () => ({value: dart.definiteFunctionType(core.double, [])}),
+    setters: () => ({value: dart.definiteFunctionType(dart.void, [core.double])}),
+    methods: () => ({[_toJSON]: dart.definiteFunctionType(core.Map, [])})
+  });
+  developer.Metrics = class Metrics extends core.Object {
+    static register(metric) {
+      if (!developer.Metric.is(metric)) {
+        dart.throw(new core.ArgumentError('metric must be a Metric'));
+      }
+      if (developer.Metrics._metrics[dartx._get](metric.name) != null) {
+        dart.throw(new core.ArgumentError('Registered metrics have unique names'));
+      }
+      developer.Metrics._metrics[dartx._set](metric.name, metric);
+    }
+    static deregister(metric) {
+      if (!developer.Metric.is(metric)) {
+        dart.throw(new core.ArgumentError('metric must be a Metric'));
+      }
+      developer.Metrics._metrics[dartx.remove](metric.name);
+    }
+    static _printMetric(id) {
+      let metric = developer.Metrics._metrics[dartx._get](id);
+      if (metric == null) {
+        return null;
+      }
+      return convert.JSON.encode(metric[_toJSON]());
+    }
+    static _printMetrics() {
+      let metrics = [];
+      for (let metric of developer.Metrics._metrics[dartx.values]) {
+        metrics[dartx.add](metric[_toJSON]());
+      }
+      let map = dart.map({type: 'MetricList', metrics: metrics}, core.String, core.Object);
+      return convert.JSON.encode(map);
+    }
+  };
+  dart.setSignature(developer.Metrics, {
+    sfields: () => ({_metrics: MapOfString$Metric()}),
+    statics: () => ({
+      register: dart.definiteFunctionType(dart.void, [developer.Metric]),
+      deregister: dart.definiteFunctionType(dart.void, [developer.Metric]),
+      _printMetric: dart.definiteFunctionType(core.String, [core.String]),
+      _printMetrics: dart.definiteFunctionType(core.String, [])
+    }),
+    names: ['register', 'deregister', '_printMetric', '_printMetrics']
+  });
+  dart.defineLazy(developer.Metrics, {
+    get _metrics() {
+      return MapOfString$Metric().new();
+    }
+  });
+  developer._isProduct = false;
+  developer.TimelineSyncFunction = dart.typedef('TimelineSyncFunction', () => dart.functionType(dart.dynamic, []));
+  developer.TimelineAsyncFunction = dart.typedef('TimelineAsyncFunction', () => dart.functionType(async.Future, []));
+  const _appendArguments = Symbol('_appendArguments');
+  developer.Timeline = class Timeline extends core.Object {
+    static startSync(name, opts) {
+      let arguments$ = opts && 'arguments' in opts ? opts.arguments : null;
+      if (developer._isProduct) {
+        return;
+      }
+      if (!(typeof name == 'string')) {
+        dart.throw(new core.ArgumentError.value(name, 'name', 'Must be a String'));
+      }
+      if (!dart.test(developer._isDartStreamEnabled())) {
+        developer.Timeline._stack[dartx.add](null);
+        return;
+      }
+      let block = new developer._SyncBlock._(name, developer._getTraceClock(), developer._getThreadCpuClock());
+      if (core.Map.is(arguments$)) {
+        block[_appendArguments](arguments$);
+      }
+      developer.Timeline._stack[dartx.add](block);
+    }
+    static finishSync() {
+      if (developer._isProduct) {
+        return;
+      }
+      if (developer.Timeline._stack[dartx.length] == 0) {
+        dart.throw(new core.StateError('Uneven calls to startSync and finishSync'));
+      }
+      let block = developer.Timeline._stack[dartx.removeLast]();
+      if (block == null) {
+        return;
+      }
+      block.finish();
+    }
+    static instantSync(name, opts) {
+      let arguments$ = opts && 'arguments' in opts ? opts.arguments : null;
+      if (developer._isProduct) {
+        return;
+      }
+      if (!(typeof name == 'string')) {
+        dart.throw(new core.ArgumentError.value(name, 'name', 'Must be a String'));
+      }
+      if (!dart.test(developer._isDartStreamEnabled())) {
+        return;
+      }
+      let instantArguments = null;
+      if (core.Map.is(arguments$)) {
+        instantArguments = core.Map.from(arguments$);
+      }
+      developer._reportInstantEvent(developer._getTraceClock(), 'Dart', name, developer._argumentsAsJson(instantArguments));
+    }
+    static timeSync(name, func, opts) {
+      let arguments$ = opts && 'arguments' in opts ? opts.arguments : null;
+      developer.Timeline.startSync(name, {arguments: arguments$});
+      try {
+        return func();
+      } finally {
+        developer.Timeline.finishSync();
+      }
+    }
+    static get now() {
+      return developer._getTraceClock();
+    }
+  };
+  dart.setSignature(developer.Timeline, {
+    sfields: () => ({
+      _stack: ListOf_SyncBlock(),
+      _isolateId: core.int,
+      _isolateIdString: core.String
+    }),
+    sgetters: () => ({now: dart.definiteFunctionType(core.int, [])}),
+    statics: () => ({
+      startSync: dart.definiteFunctionType(dart.void, [core.String], {arguments: core.Map}),
+      finishSync: dart.definiteFunctionType(dart.void, []),
+      instantSync: dart.definiteFunctionType(dart.void, [core.String], {arguments: core.Map}),
+      timeSync: dart.definiteFunctionType(dart.dynamic, [core.String, developer.TimelineSyncFunction], {arguments: core.Map})
+    }),
+    names: ['startSync', 'finishSync', 'instantSync', 'timeSync']
+  });
+  dart.defineLazy(developer.Timeline, {
+    get _stack() {
+      return ListOf_SyncBlock().new();
+    },
+    get _isolateId() {
+      return developer._getIsolateNum();
+    },
+    get _isolateIdString() {
+      return dart.toString(developer.Timeline._isolateId);
+    }
+  });
+  const _stack = Symbol('_stack');
+  const _taskId = Symbol('_taskId');
+  const _start$1 = Symbol('_start');
+  const _finish = Symbol('_finish');
+  developer.TimelineTask = class TimelineTask extends core.Object {
+    new() {
+      this[_stack] = JSArrayOf_AsyncBlock().of([]);
+      this[_taskId] = developer._getNextAsyncId();
+    }
+    withTaskId(taskId) {
+      this[_stack] = JSArrayOf_AsyncBlock().of([]);
+      this[_taskId] = taskId;
+      if (!(typeof taskId == 'number')) {
+        dart.throw(new core.ArgumentError.value(taskId, 'taskId', 'Must be an int'));
+      }
+    }
+    start(name, opts) {
+      let arguments$ = opts && 'arguments' in opts ? opts.arguments : null;
+      if (developer._isProduct) {
+        return;
+      }
+      if (!(typeof name == 'string')) {
+        dart.throw(new core.ArgumentError.value(name, 'name', 'Must be a String'));
+      }
+      let block = new developer._AsyncBlock._(name, this[_taskId]);
+      if (core.Map.is(arguments$)) {
+        block[_appendArguments](arguments$);
+      }
+      this[_stack][dartx.add](block);
+      block[_start$1]();
+    }
+    instant(name, opts) {
+      let arguments$ = opts && 'arguments' in opts ? opts.arguments : null;
+      if (developer._isProduct) {
+        return;
+      }
+      if (!(typeof name == 'string')) {
+        dart.throw(new core.ArgumentError.value(name, 'name', 'Must be a String'));
+      }
+      let instantArguments = null;
+      if (core.Map.is(arguments$)) {
+        instantArguments = core.Map.from(arguments$);
+      }
+      developer._reportTaskEvent(developer._getTraceClock(), this[_taskId], 'n', 'Dart', name, developer._argumentsAsJson(instantArguments));
+    }
+    finish() {
+      if (developer._isProduct) {
+        return;
+      }
+      if (this[_stack][dartx.length] == 0) {
+        dart.throw(new core.StateError('Uneven calls to start and finish'));
+      }
+      let block = this[_stack][dartx.removeLast]();
+      block[_finish]();
+    }
+    pass() {
+      if (dart.notNull(this[_stack][dartx.length]) > 0) {
+        dart.throw(new core.StateError('You cannot pass a TimelineTask without finishing all started ' + 'operations'));
+      }
+      let r = this[_taskId];
+      return r;
+    }
+  };
+  dart.defineNamedConstructor(developer.TimelineTask, 'withTaskId');
+  dart.setSignature(developer.TimelineTask, {
+    constructors: () => ({
+      new: dart.definiteFunctionType(developer.TimelineTask, []),
+      withTaskId: dart.definiteFunctionType(developer.TimelineTask, [core.int])
+    }),
+    fields: () => ({
+      [_taskId]: core.int,
+      [_stack]: ListOf_AsyncBlock()
+    }),
+    methods: () => ({
+      start: dart.definiteFunctionType(dart.void, [core.String], {arguments: core.Map}),
+      instant: dart.definiteFunctionType(dart.void, [core.String], {arguments: core.Map}),
+      finish: dart.definiteFunctionType(dart.void, []),
+      pass: dart.definiteFunctionType(core.int, [])
+    })
+  });
+  const _arguments$ = Symbol('_arguments');
+  developer._AsyncBlock = class _AsyncBlock extends core.Object {
+    _(name, taskId) {
+      this.name = name;
+      this[_taskId] = taskId;
+      this.category = 'Dart';
+      this[_arguments$] = null;
+    }
+    [_start$1]() {
+      developer._reportTaskEvent(developer._getTraceClock(), this[_taskId], 'b', this.category, this.name, developer._argumentsAsJson(this[_arguments$]));
+    }
+    [_finish]() {
+      developer._reportTaskEvent(developer._getTraceClock(), this[_taskId], 'e', this.category, this.name, developer._argumentsAsJson(null));
+    }
+    [_appendArguments](arguments$) {
+      if (this[_arguments$] == null) {
+        this[_arguments$] = dart.map();
+      }
+      this[_arguments$][dartx.addAll](arguments$);
+    }
+  };
+  dart.defineNamedConstructor(developer._AsyncBlock, '_');
+  dart.setSignature(developer._AsyncBlock, {
+    constructors: () => ({_: dart.definiteFunctionType(developer._AsyncBlock, [core.String, core.int])}),
+    fields: () => ({
+      category: core.String,
+      name: core.String,
+      [_taskId]: core.int,
+      [_arguments$]: core.Map
+    }),
+    methods: () => ({
+      [_start$1]: dart.definiteFunctionType(dart.void, []),
+      [_finish]: dart.definiteFunctionType(dart.void, []),
+      [_appendArguments]: dart.definiteFunctionType(dart.void, [core.Map])
+    })
+  });
+  const _startCpu = Symbol('_startCpu');
+  developer._SyncBlock = class _SyncBlock extends core.Object {
+    _(name, start, startCpu) {
+      this.name = name;
+      this[_start$1] = start;
+      this[_startCpu] = startCpu;
+      this.category = 'Dart';
+      this[_arguments$] = null;
+    }
+    finish() {
+      developer._reportCompleteEvent(this[_start$1], this[_startCpu], this.category, this.name, developer._argumentsAsJson(this[_arguments$]));
+    }
+    [_appendArguments](arguments$) {
+      if (arguments$ == null) {
+        return;
+      }
+      if (this[_arguments$] == null) {
+        this[_arguments$] = dart.map();
+      }
+      this[_arguments$][dartx.addAll](arguments$);
+    }
+  };
+  dart.defineNamedConstructor(developer._SyncBlock, '_');
+  dart.setSignature(developer._SyncBlock, {
+    constructors: () => ({_: dart.definiteFunctionType(developer._SyncBlock, [core.String, core.int, core.int])}),
+    fields: () => ({
+      category: core.String,
+      name: core.String,
+      [_arguments$]: core.Map,
+      [_start$1]: core.int,
+      [_startCpu]: core.int
+    }),
+    methods: () => ({
+      finish: dart.definiteFunctionType(dart.void, []),
+      [_appendArguments]: dart.definiteFunctionType(dart.void, [core.Map])
+    })
+  });
+  developer._fastPathArguments = null;
+  developer._argumentsAsJson = function(arguments$) {
+    if (arguments$ == null || arguments$[dartx.length] == 0) {
+      if (developer._fastPathArguments == null) {
+        developer._fastPathArguments = dart.str`{"isolateNumber":"${developer.Timeline._isolateId}"}`;
+      }
+      return developer._fastPathArguments;
+    }
+    arguments$[dartx._set]('isolateNumber', developer.Timeline._isolateIdString);
+    return convert.JSON.encode(arguments$);
+  };
+  dart.fn(developer._argumentsAsJson, MapToString());
+  developer._isDartStreamEnabled = function() {
+    return false;
+  };
+  dart.fn(developer._isDartStreamEnabled, VoidTobool());
+  developer._getNextAsyncId = function() {
+    return 0;
+  };
+  dart.fn(developer._getNextAsyncId, VoidToint());
+  developer._getTraceClock = function() {
+    let x = developer._clockValue;
+    developer._clockValue = dart.notNull(x) + 1;
+    return x;
+  };
+  dart.fn(developer._getTraceClock, VoidToint());
+  developer._getThreadCpuClock = function() {
+    return -1;
+  };
+  dart.fn(developer._getThreadCpuClock, VoidToint());
+  developer._getIsolateNum = function() {
+    return 0;
+  };
+  dart.fn(developer._getIsolateNum, VoidToint());
+  developer._reportTaskEvent = function(start, taskId, phase, category, name, argumentsAsJson) {
+  };
+  dart.fn(developer._reportTaskEvent, intAndintAndString__Tovoid());
+  developer._reportCompleteEvent = function(start, startCpu, category, name, argumentsAsJson) {
+  };
+  dart.fn(developer._reportCompleteEvent, intAndintAndString__Tovoid$());
+  developer._reportInstantEvent = function(start, category, name, argumentsAsJson) {
+  };
+  dart.fn(developer._reportInstantEvent, intAndStringAndString__Tovoid());
+  developer.ServiceProtocolInfo = class ServiceProtocolInfo extends core.Object {
+    new(serverUri) {
+      this.majorVersion = developer._getServiceMajorVersion();
+      this.minorVersion = developer._getServiceMinorVersion();
+      this.serverUri = serverUri;
+    }
+    toString() {
+      if (this.serverUri != null) {
+        return dart.str`Dart VM Service Protocol v${this.majorVersion}.${this.minorVersion} ` + dart.str`listening on ${this.serverUri}`;
+      } else {
+        return dart.str`Dart VM Service Protocol v${this.majorVersion}.${this.minorVersion}`;
+      }
+    }
+  };
+  dart.setSignature(developer.ServiceProtocolInfo, {
+    constructors: () => ({new: dart.definiteFunctionType(developer.ServiceProtocolInfo, [core.Uri])}),
+    fields: () => ({
+      majorVersion: core.int,
+      minorVersion: core.int,
+      serverUri: core.Uri
+    })
+  });
+  developer.Service = class Service extends core.Object {
+    static getInfo() {
+      return dart.async(function*() {
+        let receivePort = isolate.RawReceivePort.new();
+        let uriCompleter = CompleterOfUri().new();
+        receivePort.handler = dart.fn(uri => uriCompleter.complete(uri), UriTovoid());
+        developer._getServerInfo(receivePort.sendPort);
+        let uri = (yield uriCompleter.future);
+        receivePort.close();
+        return new developer.ServiceProtocolInfo(uri);
+      }, developer.ServiceProtocolInfo);
+    }
+    static controlWebServer(opts) {
+      return dart.async(function*(opts) {
+        let enable = opts && 'enable' in opts ? opts.enable : false;
+        if (!(typeof enable == 'boolean')) {
+          dart.throw(new core.ArgumentError.value(enable, 'enable', 'Must be a bool'));
+        }
+        let receivePort = isolate.RawReceivePort.new();
+        let uriCompleter = CompleterOfUri().new();
+        receivePort.handler = dart.fn(uri => uriCompleter.complete(uri), UriTovoid());
+        developer._webServerControl(receivePort.sendPort, enable);
+        let uri = (yield uriCompleter.future);
+        receivePort.close();
+        return new developer.ServiceProtocolInfo(uri);
+      }, developer.ServiceProtocolInfo, opts);
+    }
+  };
+  dart.setSignature(developer.Service, {
+    statics: () => ({
+      getInfo: dart.definiteFunctionType(async.Future$(developer.ServiceProtocolInfo), []),
+      controlWebServer: dart.definiteFunctionType(async.Future$(developer.ServiceProtocolInfo), [], {enable: core.bool})
+    }),
+    names: ['getInfo', 'controlWebServer']
+  });
+  developer._getServerInfo = function(sp) {
+    sp.send(null);
+  };
+  dart.lazyFn(developer._getServerInfo, () => SendPortTovoid());
+  developer._webServerControl = function(sp, enable) {
+    sp.send(null);
+  };
+  dart.lazyFn(developer._webServerControl, () => SendPortAndboolTovoid());
+  developer._getServiceMajorVersion = function() {
+    return 0;
+  };
+  dart.fn(developer._getServiceMajorVersion, VoidToint());
+  developer._getServiceMinorVersion = function() {
+    return 0;
+  };
+  dart.fn(developer._getServiceMinorVersion, VoidToint());
   isolate.IsolateSpawnException = class IsolateSpawnException extends core.Object {
     new(message) {
       this.message = message;
@@ -36191,7 +37250,7 @@
     static spawn(entryPoint, message, opts) {
       let paused = opts && 'paused' in opts ? opts.paused : false;
       try {
-        return _isolate_helper.IsolateNatives.spawnFunction(entryPoint, message, paused).then(isolate.Isolate)(dart.fn(msg => new isolate.Isolate(isolate.SendPort._check(msg[dartx.get](1)), {pauseCapability: isolate.Capability._check(msg[dartx.get](2)), terminateCapability: isolate.Capability._check(msg[dartx.get](3))}), ListToIsolate()));
+        return _isolate_helper.IsolateNatives.spawnFunction(entryPoint, message, paused).then(isolate.Isolate)(dart.fn(msg => new isolate.Isolate(isolate.SendPort._check(msg[dartx._get](1)), {pauseCapability: isolate.Capability._check(msg[dartx._get](2)), terminateCapability: isolate.Capability._check(msg[dartx._get](3))}), ListToIsolate()));
       } catch (e) {
         let st = dart.stackTrace(e);
         return FutureOfIsolate().error(e, st);
@@ -36205,14 +37264,14 @@
       try {
         if (core.List.is(args)) {
           for (let i = 0; i < dart.notNull(args[dartx.length]); i++) {
-            if (!(typeof args[dartx.get](i) == 'string')) {
+            if (!(typeof args[dartx._get](i) == 'string')) {
               dart.throw(new core.ArgumentError(dart.str`Args must be a list of Strings ${args}`));
             }
           }
         } else if (args != null) {
           dart.throw(new core.ArgumentError(dart.str`Args must be a list of Strings ${args}`));
         }
-        return _isolate_helper.IsolateNatives.spawnUri(uri, args, message, paused).then(isolate.Isolate)(dart.fn(msg => new isolate.Isolate(isolate.SendPort._check(msg[dartx.get](1)), {pauseCapability: isolate.Capability._check(msg[dartx.get](2)), terminateCapability: isolate.Capability._check(msg[dartx.get](3))}), ListToIsolate()));
+        return _isolate_helper.IsolateNatives.spawnUri(uri, args, message, paused).then(isolate.Isolate)(dart.fn(msg => new isolate.Isolate(isolate.SendPort._check(msg[dartx._get](1)), {pauseCapability: isolate.Capability._check(msg[dartx._get](2)), terminateCapability: isolate.Capability._check(msg[dartx._get](3))}), ListToIsolate()));
       } catch (e) {
         let st = dart.stackTrace(e);
         return FutureOfIsolate().error(e, st);
@@ -36227,34 +37286,34 @@
     }
     [_pause](resumeCapability) {
       let message = core.List.new(3);
-      message[dartx.set](0, "pause");
-      message[dartx.set](1, this.pauseCapability);
-      message[dartx.set](2, resumeCapability);
+      message[dartx._set](0, "pause");
+      message[dartx._set](1, this.pauseCapability);
+      message[dartx._set](2, resumeCapability);
       this.controlPort.send(message);
     }
     resume(resumeCapability) {
       let message = core.List.new(2);
-      message[dartx.set](0, "resume");
-      message[dartx.set](1, resumeCapability);
+      message[dartx._set](0, "resume");
+      message[dartx._set](1, resumeCapability);
       this.controlPort.send(message);
     }
     addOnExitListener(responsePort) {
       let message = core.List.new(2);
-      message[dartx.set](0, "add-ondone");
-      message[dartx.set](1, responsePort);
+      message[dartx._set](0, "add-ondone");
+      message[dartx._set](1, responsePort);
       this.controlPort.send(message);
     }
     removeOnExitListener(responsePort) {
       let message = core.List.new(2);
-      message[dartx.set](0, "remove-ondone");
-      message[dartx.set](1, responsePort);
+      message[dartx._set](0, "remove-ondone");
+      message[dartx._set](1, responsePort);
       this.controlPort.send(message);
     }
     setErrorsFatal(errorsAreFatal) {
       let message = core.List.new(3);
-      message[dartx.set](0, "set-errors-fatal");
-      message[dartx.set](1, this.terminateCapability);
-      message[dartx.set](2, errorsAreFatal);
+      message[dartx._set](0, "set-errors-fatal");
+      message[dartx._set](1, this.terminateCapability);
+      message[dartx._set](2, errorsAreFatal);
       this.controlPort.send(message);
     }
     kill(priority) {
@@ -36264,21 +37323,21 @@
     ping(responsePort, pingType) {
       if (pingType === void 0) pingType = isolate.Isolate.IMMEDIATE;
       let message = core.List.new(3);
-      message[dartx.set](0, "ping");
-      message[dartx.set](1, responsePort);
-      message[dartx.set](2, pingType);
+      message[dartx._set](0, "ping");
+      message[dartx._set](1, responsePort);
+      message[dartx._set](2, pingType);
       this.controlPort.send(message);
     }
     addErrorListener(port) {
       let message = core.List.new(2);
-      message[dartx.set](0, "getErrors");
-      message[dartx.set](1, port);
+      message[dartx._set](0, "getErrors");
+      message[dartx._set](1, port);
       this.controlPort.send(message);
     }
     removeErrorListener(port) {
       let message = core.List.new(2);
-      message[dartx.set](0, "stopErrors");
-      message[dartx.set](1, port);
+      message[dartx._set](0, "stopErrors");
+      message[dartx._set](1, port);
       this.controlPort.send(message);
     }
     get errors() {
@@ -36469,18 +37528,18 @@
       let _convertedObjects = collection.HashMap.identity();
       function _convert(o) {
         if (dart.test(_convertedObjects.containsKey(o))) {
-          return _convertedObjects.get(o);
+          return _convertedObjects._get(o);
         }
         if (core.Map.is(o)) {
           let convertedMap = {};
-          _convertedObjects.set(o, convertedMap);
+          _convertedObjects._set(o, convertedMap);
           for (let key of o[dartx.keys]) {
-            convertedMap[key] = _convert(o[dartx.get](key));
+            convertedMap[key] = _convert(o[dartx._get](key));
           }
           return convertedMap;
         } else if (core.Iterable.is(o)) {
           let convertedList = [];
-          _convertedObjects.set(o, convertedList);
+          _convertedObjects._set(o, convertedList);
           convertedList[dartx.addAll](o[dartx.map](dart.dynamic)(_convert));
           return convertedList;
         } else {
@@ -36490,13 +37549,13 @@
       dart.fn(_convert, dynamicTodynamic$());
       return _convert(data);
     }
-    get(property) {
+    _get(property) {
       if (!(typeof property == 'string') && !(typeof property == 'number')) {
         dart.throw(new core.ArgumentError("property is not a String or num"));
       }
       return js._convertToDart(this[_jsObject][property]);
     }
-    set(property, value) {
+    _set(property, value) {
       if (!(typeof property == 'string') && !(typeof property == 'number')) {
         dart.throw(new core.ArgumentError("property is not a String or num"));
       }
@@ -36555,8 +37614,8 @@
     }),
     fields: () => ({[_jsObject]: dart.dynamic}),
     methods: () => ({
-      get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
-      set: dart.definiteFunctionType(dart.dynamic, [core.Object, dart.dynamic]),
+      _get: dart.definiteFunctionType(dart.dynamic, [core.Object]),
+      _set: dart.definiteFunctionType(dart.dynamic, [core.Object, dart.dynamic]),
       hasProperty: dart.definiteFunctionType(core.bool, [dart.dynamic]),
       deleteProperty: dart.definiteFunctionType(dart.void, [dart.dynamic]),
       instanceof: dart.definiteFunctionType(core.bool, [js.JsFunction]),
@@ -36630,18 +37689,18 @@
           dart.throw(new core.RangeError.range(end, start, length));
         }
       }
-      get(index) {
+      _get(index) {
         if (typeof index == 'number' && index == index[dartx.toInt]()) {
           this[_checkIndex](dart.asInt(index));
         }
-        return E.as(super.get(index));
+        return E.as(super._get(index));
       }
-      set(index, value) {
+      _set(index, value) {
         E._check(value);
         if (typeof index == 'number' && index == index[dartx.toInt]()) {
           this[_checkIndex](dart.asInt(index));
         }
-        super.set(index, value);
+        super._set(index, value);
         return value;
       }
       get length() {
@@ -36652,7 +37711,7 @@
         dart.throw(new core.StateError('Bad JsArray length'));
       }
       set length(length) {
-        super.set('length', length);
+        super._set('length', length);
       }
       add(value) {
         E._check(value);
@@ -36710,8 +37769,8 @@
       methods: () => ({
         [_checkIndex]: dart.definiteFunctionType(dart.dynamic, [core.int]),
         [_checkInsertIndex]: dart.definiteFunctionType(dart.dynamic, [core.int]),
-        get: dart.definiteFunctionType(E, [core.Object]),
-        set: dart.definiteFunctionType(dart.void, [core.Object, E]),
+        _get: dart.definiteFunctionType(E, [core.Object]),
+        _set: dart.definiteFunctionType(dart.void, [core.Object, E]),
         add: dart.definiteFunctionType(dart.void, [E]),
         addAll: dart.definiteFunctionType(dart.void, [IterableOfE()]),
         insert: dart.definiteFunctionType(dart.void, [core.int, E]),
@@ -36724,8 +37783,8 @@
       names: ['_checkRange']
     });
     dart.defineExtensionMembers(JsArray, [
-      'get',
-      'set',
+      '_get',
+      '_set',
       'add',
       'addAll',
       'insert',
@@ -36773,7 +37832,7 @@
       let args = Array.prototype.map.call(arguments, js._convertToDart);
       return js._convertToJS(f(...args));
     };
-    dart.dsetindex(js._dartProxies, wrapper, f);
+    js._dartProxies.set(wrapper, f);
     return wrapper;
   };
   dart.fn(js._wrapDartFunction, dynamicTodynamic$());
@@ -36832,7 +37891,7 @@
     set _interopCaptureThisExpando(_) {}
   });
   js.allowInteropCaptureThis = function(f) {
-    let ret = js._interopCaptureThisExpando.get(f);
+    let ret = js._interopCaptureThisExpando._get(f);
     if (ret == null) {
       ret = function() {
         let args = [this];
@@ -36841,7 +37900,7 @@
         }
         return f(...args);
       };
-      js._interopCaptureThisExpando.set(f, ret);
+      js._interopCaptureThisExpando._set(f, ret);
     }
     return ret;
   };
@@ -36857,18 +37916,18 @@
     let _convertedObjects = collection.HashMap.identity();
     function _convert(o) {
       if (dart.test(_convertedObjects.containsKey(o))) {
-        return _convertedObjects.get(o);
+        return _convertedObjects._get(o);
       }
       if (core.Map.is(o)) {
         let convertedMap = {};
-        _convertedObjects.set(o, convertedMap);
+        _convertedObjects._set(o, convertedMap);
         for (let key of o[dartx.keys]) {
-          convertedMap[key] = _convert(o[dartx.get](key));
+          convertedMap[key] = _convert(o[dartx._get](key));
         }
         return convertedMap;
       } else if (core.Iterable.is(o)) {
         let convertedList = [];
-        _convertedObjects.set(o, convertedList);
+        _convertedObjects._set(o, convertedList);
         convertedList[dartx.addAll](o[dartx.map](dart.dynamic)(_convert));
         return convertedList;
       } else {
@@ -36959,40 +38018,13 @@
   math.SQRT2 = 1.4142135623730951;
   math.min = function(T) {
     return (a, b) => {
-      if (!(typeof a == 'number')) dart.throw(new core.ArgumentError(a));
-      if (!(typeof b == 'number')) dart.throw(new core.ArgumentError(b));
-      if (dart.notNull(a) > dart.notNull(b)) return b;
-      if (dart.notNull(a) < dart.notNull(b)) return a;
-      if (typeof b == 'number') {
-        if (typeof a == 'number') {
-          if (a == 0.0) {
-            return (dart.notNull(a) + dart.notNull(b)) * dart.notNull(a) * dart.notNull(b);
-          }
-        }
-        if (a == 0 && dart.test(b[dartx.isNegative]) || dart.test(b[dartx.isNaN])) return b;
-        return a;
-      }
-      return a;
+      return Math.min(_js_helper.checkNum(a), _js_helper.checkNum(b));
     };
   };
   dart.fn(math.min, TAndTToT());
   math.max = function(T) {
     return (a, b) => {
-      if (!(typeof a == 'number')) dart.throw(new core.ArgumentError(a));
-      if (!(typeof b == 'number')) dart.throw(new core.ArgumentError(b));
-      if (dart.notNull(a) > dart.notNull(b)) return a;
-      if (dart.notNull(a) < dart.notNull(b)) return b;
-      if (typeof b == 'number') {
-        if (typeof a == 'number') {
-          if (a == 0.0) {
-            return dart.notNull(a) + dart.notNull(b);
-          }
-        }
-        if (dart.test(b[dartx.isNaN])) return b;
-        return a;
-      }
-      if (b == 0 && dart.test(a[dartx.isNegative])) return b;
-      return a;
+      return Math.max(_js_helper.checkNum(a), _js_helper.checkNum(b));
     };
   };
   dart.fn(math.max, TAndTToT$());
@@ -37409,7 +38441,8 @@
       }
       ['=='](other) {
         if (!RectangleOfnum().is(other)) return false;
-        return dart.equals(this[dartx.left], dart.dload(other, 'left')) && dart.equals(this[dartx.top], dart.dload(other, 'top')) && dart.equals(this[dartx.right], dart.dload(other, 'right')) && dart.equals(this[dartx.bottom], dart.dload(other, 'bottom'));
+        let otherRect = RectangleOfnum().as(other);
+        return this[dartx.left] == otherRect[dartx.left] && this[dartx.top] == otherRect[dartx.top] && this[dartx.right] == otherRect[dartx.right] && this[dartx.bottom] == otherRect[dartx.bottom];
       }
       get hashCode() {
         return math._JenkinsSmiHash.hash4(dart.hashCode(this[dartx.left]), dart.hashCode(this[dartx.top]), dart.hashCode(this[dartx.right]), dart.hashCode(this[dartx.bottom]));
@@ -37505,11 +38538,35 @@
       'height'
     ]);
     class Rectangle extends math._RectangleBase$(T) {
+      get left() {
+        return this[left$];
+      }
+      set left(value) {
+        super.left = value;
+      }
+      get top() {
+        return this[top$];
+      }
+      set top(value) {
+        super.top = value;
+      }
+      get width() {
+        return this[width$];
+      }
+      set width(value) {
+        super.width = value;
+      }
+      get height() {
+        return this[height$];
+      }
+      set height(value) {
+        super.height = value;
+      }
       new(left, top, width, height) {
-        this[dartx.left] = left;
-        this[dartx.top] = top;
-        this[dartx.width] = dart.notNull(width) < 0 ? -dart.notNull(width) * 0 : width;
-        this[dartx.height] = dart.notNull(height) < 0 ? -dart.notNull(height) * 0 : height;
+        this[left$] = left;
+        this[top$] = top;
+        this[width$] = dart.notNull(width) < 0 ? -dart.notNull(width) * 0 : width;
+        this[height$] = dart.notNull(height) < 0 ? -dart.notNull(height) * 0 : height;
         super.new();
       }
       static fromPoints(a, b) {
@@ -37520,6 +38577,10 @@
         return new (RectangleOfT())(left, top, width, height);
       }
     }
+    const left$ = Symbol(Rectangle.name + "." + 'left'.toString());
+    const top$ = Symbol(Rectangle.name + "." + 'top'.toString());
+    const width$ = Symbol(Rectangle.name + "." + 'width'.toString());
+    const height$ = Symbol(Rectangle.name + "." + 'height'.toString());
     dart.setSignature(Rectangle, {
       constructors: () => ({
         new: dart.definiteFunctionType(math.Rectangle$(T), [T, T, T, T]),
@@ -37543,9 +38604,21 @@
     let RectangleOfT = () => (RectangleOfT = dart.constFn(math.Rectangle$(T)))();
     let PointOfT = () => (PointOfT = dart.constFn(math.Point$(T)))();
     class MutableRectangle extends math._RectangleBase$(T) {
+      get left() {
+        return this[left$];
+      }
+      set left(value) {
+        this[left$] = value;
+      }
+      get top() {
+        return this[top$];
+      }
+      set top(value) {
+        this[top$] = value;
+      }
       new(left, top, width, height) {
-        this.left = left;
-        this.top = top;
+        this[left$] = left;
+        this[top$] = top;
         this[_width] = dart.notNull(width) < 0 ? math._clampToZero(T)(width) : width;
         this[_height] = dart.notNull(height) < 0 ? math._clampToZero(T)(height) : height;
         super.new();
@@ -37574,6 +38647,8 @@
         this[_height] = height;
       }
     }
+    const left$ = Symbol(MutableRectangle.name + "." + 'left'.toString());
+    const top$ = Symbol(MutableRectangle.name + "." + 'top'.toString());
     MutableRectangle[dart.implements] = () => [RectangleOfT()];
     dart.setSignature(MutableRectangle, {
       constructors: () => ({
@@ -38152,7 +39227,7 @@
       if (dart.test(html_common.isJavaScriptDate(object))) return true;
       if (core.List.is(object)) {
         for (let i = 0; i < dart.notNull(object[dartx.length]); i++) {
-          if (dart.test(containsDate(object[dartx.get](i)))) return true;
+          if (dart.test(containsDate(object[dartx._get](i)))) return true;
         }
       }
       return false;
@@ -38231,21 +39306,21 @@
     get [dartx.source]() {
       return this.source;
     }
-    [dartx.advance](count) {
-      return this.advance(count);
+    [dartx.advance](...args) {
+      return this.advance.apply(this, args);
     }
-    [dartx.continuePrimaryKey](key, primaryKey) {
-      return this.continuePrimaryKey(key, primaryKey);
+    [dartx.continuePrimaryKey](...args) {
+      return this.continuePrimaryKey.apply(this, args);
     }
-    [_delete]() {
-      return this.delete();
+    [_delete](...args) {
+      return this.delete.apply(this, args);
     }
     [_update](value) {
       let value_1 = html_common.convertDartToNative_SerializedScriptValue(value);
       return this[_update_1](value_1);
     }
-    [_update_1](value) {
-      return this.update(value);
+    [_update_1](...args) {
+      return this.update.apply(this, args);
     }
   };
   dart.setSignature(indexed_db.Cursor, {
@@ -38323,14 +39398,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [_addEventListener](type, listener, capture) {
-      return this.addEventListener(type, listener, capture);
+    [_addEventListener](...args) {
+      return this.addEventListener.apply(this, args);
     }
-    [dartx.dispatchEvent](event) {
-      return this.dispatchEvent(event);
+    [dartx.dispatchEvent](...args) {
+      return this.dispatchEvent.apply(this, args);
     }
-    [_removeEventListener](type, listener, capture) {
-      return this.removeEventListener(type, listener, capture);
+    [_removeEventListener](...args) {
+      return this.removeEventListener.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.EventTarget, '_created');
@@ -38371,10 +39446,10 @@
       let autoIncrement = opts && 'autoIncrement' in opts ? opts.autoIncrement : null;
       let options = dart.map();
       if (keyPath != null) {
-        options[dartx.set]('keyPath', keyPath);
+        options[dartx._set]('keyPath', keyPath);
       }
       if (autoIncrement != null) {
-        options[dartx.set]('autoIncrement', autoIncrement);
+        options[dartx._set]('autoIncrement', autoIncrement);
       }
       return this[_createObjectStore](name, options);
     }
@@ -38403,8 +39478,8 @@
       }
       return this[_transaction](storeNames, mode);
     }
-    [_transaction](stores, mode) {
-      return this.transaction(stores, mode);
+    [_transaction](...args) {
+      return this.transaction.apply(this, args);
     }
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
@@ -38418,8 +39493,8 @@
     get [dartx.version]() {
       return this.version;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
     [_createObjectStore](name, options) {
       if (options === void 0) options = null;
@@ -38429,14 +39504,14 @@
       }
       return this[_createObjectStore_2](name);
     }
-    [_createObjectStore_1](name, options) {
-      return this.createObjectStore(name, options);
+    [_createObjectStore_1](...args) {
+      return this.createObjectStore.apply(this, args);
     }
-    [_createObjectStore_2](name) {
-      return this.createObjectStore(name);
+    [_createObjectStore_2](...args) {
+      return this.createObjectStore.apply(this, args);
     }
-    [dartx.deleteObjectStore](name) {
-      return this.deleteObjectStore(name);
+    [dartx.deleteObjectStore](...args) {
+      return this.deleteObjectStore.apply(this, args);
     }
     get [dartx.onAbort]() {
       return indexed_db.Database.abortEvent.forTarget(this);
@@ -38575,17 +39650,17 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.cmp](first, second) {
-      return this.cmp(first, second);
+    [dartx.cmp](...args) {
+      return this.cmp.apply(this, args);
     }
-    [_deleteDatabase](name) {
-      return this.deleteDatabase(name);
+    [_deleteDatabase](...args) {
+      return this.deleteDatabase.apply(this, args);
     }
-    [_open](name, version) {
-      return this.open(name, version);
+    [_open](...args) {
+      return this.open.apply(this, args);
     }
-    [_webkitGetDatabaseNames]() {
-      return this.webkitGetDatabaseNames();
+    [_webkitGetDatabaseNames](...args) {
+      return this.webkitGetDatabaseNames.apply(this, args);
     }
   };
   dart.setSignature(indexed_db.IdbFactory, {
@@ -38728,26 +39803,26 @@
     get [dartx.unique]() {
       return this.unique;
     }
-    [_count$0](key) {
-      return this.count(key);
+    [_count$0](...args) {
+      return this.count.apply(this, args);
     }
-    [_get$](key) {
-      return this.get(key);
+    [_get$](...args) {
+      return this.get.apply(this, args);
     }
-    [dartx.getAll](range, maxCount) {
-      return this.getAll(range, maxCount);
+    [dartx.getAll](...args) {
+      return this.getAll.apply(this, args);
     }
-    [dartx.getAllKeys](range, maxCount) {
-      return this.getAllKeys(range, maxCount);
+    [dartx.getAllKeys](...args) {
+      return this.getAllKeys.apply(this, args);
     }
-    [_getKey$](key) {
-      return this.getKey(key);
+    [_getKey$](...args) {
+      return this.getKey.apply(this, args);
     }
-    [_openCursor](range, direction) {
-      return this.openCursor(range, direction);
+    [_openCursor](...args) {
+      return this.openCursor.apply(this, args);
     }
-    [_openKeyCursor](range, direction) {
-      return this.openKeyCursor(range, direction);
+    [_openKeyCursor](...args) {
+      return this.openKeyCursor.apply(this, args);
     }
   };
   dart.setSignature(indexed_db.Index, {
@@ -38966,10 +40041,10 @@
       let multiEntry = opts && 'multiEntry' in opts ? opts.multiEntry : null;
       let options = dart.map();
       if (unique != null) {
-        options[dartx.set]('unique', unique);
+        options[dartx._set]('unique', unique);
       }
       if (multiEntry != null) {
-        options[dartx.set]('multiEntry', multiEntry);
+        options[dartx._set]('multiEntry', multiEntry);
       }
       return this[_createIndex](name, keyPath, options);
     }
@@ -39001,17 +40076,17 @@
       let value_1 = html_common.convertDartToNative_SerializedScriptValue(value);
       return this[_add_2](value_1);
     }
-    [_add_1](value, key) {
-      return this.add(value, key);
+    [_add_1](...args) {
+      return this.add.apply(this, args);
     }
-    [_add_2](value) {
-      return this.add(value);
+    [_add_2](...args) {
+      return this.add.apply(this, args);
     }
-    [_clear$0]() {
-      return this.clear();
+    [_clear$0](...args) {
+      return this.clear.apply(this, args);
     }
-    [_count$0](key) {
-      return this.count(key);
+    [_count$0](...args) {
+      return this.count.apply(this, args);
     }
     [_createIndex](name, keyPath, options) {
       if (options === void 0) options = null;
@@ -39021,35 +40096,35 @@
       }
       return this[_createIndex_2](name, keyPath);
     }
-    [_createIndex_1](name, keyPath, options) {
-      return this.createIndex(name, keyPath, options);
+    [_createIndex_1](...args) {
+      return this.createIndex.apply(this, args);
     }
-    [_createIndex_2](name, keyPath) {
-      return this.createIndex(name, keyPath);
+    [_createIndex_2](...args) {
+      return this.createIndex.apply(this, args);
     }
-    [_delete](key) {
-      return this.delete(key);
+    [_delete](...args) {
+      return this.delete.apply(this, args);
     }
-    [dartx.deleteIndex](name) {
-      return this.deleteIndex(name);
+    [dartx.deleteIndex](...args) {
+      return this.deleteIndex.apply(this, args);
     }
-    [_get$](key) {
-      return this.get(key);
+    [_get$](...args) {
+      return this.get.apply(this, args);
     }
-    [dartx.getAll](range, maxCount) {
-      return this.getAll(range, maxCount);
+    [dartx.getAll](...args) {
+      return this.getAll.apply(this, args);
     }
-    [dartx.getAllKeys](range, maxCount) {
-      return this.getAllKeys(range, maxCount);
+    [dartx.getAllKeys](...args) {
+      return this.getAllKeys.apply(this, args);
     }
-    [dartx.index](name) {
-      return this.index(name);
+    [dartx.index](...args) {
+      return this.index.apply(this, args);
     }
-    [_openCursor](range, direction) {
-      return this.openCursor(range, direction);
+    [_openCursor](...args) {
+      return this.openCursor.apply(this, args);
     }
-    [dartx.openKeyCursor](range, direction) {
-      return this.openKeyCursor(range, direction);
+    [dartx.openKeyCursor](...args) {
+      return this.openKeyCursor.apply(this, args);
     }
     [_put](value, key) {
       if (key === void 0) key = null;
@@ -39061,11 +40136,11 @@
       let value_1 = html_common.convertDartToNative_SerializedScriptValue(value);
       return this[_put_2](value_1);
     }
-    [_put_1](value, key) {
-      return this.put(value, key);
+    [_put_1](...args) {
+      return this.put.apply(this, args);
     }
-    [_put_2](value) {
-      return this.put(value);
+    [_put_2](...args) {
+      return this.put.apply(this, args);
     }
     static _cursorStreamFromResult(T) {
       return (request, autoAdvance) => {
@@ -39236,6 +40311,7 @@
     }
   });
   dart.registerExtension(dart.global.IDBOpenDBRequest, indexed_db.OpenDBRequest);
+  dart.registerExtension(dart.global.IDBVersionChangeRequest, indexed_db.OpenDBRequest);
   dart.defineExtensionNames([
     'completed',
     'abort',
@@ -39279,11 +40355,11 @@
     get [dartx.objectStoreNames]() {
       return this.objectStoreNames;
     }
-    [dartx.abort]() {
-      return this.abort();
+    [dartx.abort](...args) {
+      return this.abort.apply(this, args);
     }
-    [dartx.objectStore](name) {
-      return this.objectStore(name);
+    [dartx.objectStore](...args) {
+      return this.objectStore.apply(this, args);
     }
     get [dartx.onAbort]() {
       return indexed_db.Transaction.abortEvent.forTarget(this);
@@ -39430,17 +40506,17 @@
     get [dartx.type]() {
       return this.type;
     }
-    [_initEvent](type, bubbles, cancelable) {
-      return this.initEvent(type, bubbles, cancelable);
+    [_initEvent](...args) {
+      return this.initEvent.apply(this, args);
     }
-    [dartx.preventDefault]() {
-      return this.preventDefault();
+    [dartx.preventDefault](...args) {
+      return this.preventDefault.apply(this, args);
     }
-    [dartx.stopImmediatePropagation]() {
-      return this.stopImmediatePropagation();
+    [dartx.stopImmediatePropagation](...args) {
+      return this.stopImmediatePropagation.apply(this, args);
     }
-    [dartx.stopPropagation]() {
-      return this.stopPropagation();
+    [dartx.stopPropagation](...args) {
+      return this.stopPropagation.apply(this, args);
     }
   };
   dart.setSignature(html$.Event, {
@@ -39487,6 +40563,7 @@
   html$.Event.BUBBLING_PHASE = 3;
   html$.Event.CAPTURING_PHASE = 1;
   dart.registerExtension(dart.global.Event, html$.Event);
+  dart.registerExtension(dart.global.InputEvent, html$.Event);
   dart.defineExtensionNames([
     'dataLoss',
     'dataLossMessage',
@@ -39740,26 +40817,26 @@
     set [dartx.text](value) {
       this.textContent = value;
     }
-    [dartx.append](node) {
-      return this.appendChild(node);
+    [dartx.append](...args) {
+      return this.appendChild.apply(this, args);
     }
-    [dartx.clone](deep) {
-      return this.cloneNode(deep);
+    [dartx.clone](...args) {
+      return this.cloneNode.apply(this, args);
     }
-    [dartx.contains](other) {
-      return this.contains(other);
+    [dartx.contains](...args) {
+      return this.contains.apply(this, args);
     }
-    [dartx.hasChildNodes]() {
-      return this.hasChildNodes();
+    [dartx.hasChildNodes](...args) {
+      return this.hasChildNodes.apply(this, args);
     }
-    [dartx.insertBefore](node, child) {
-      return this.insertBefore(node, child);
+    [dartx.insertBefore](...args) {
+      return this.insertBefore.apply(this, args);
     }
-    [_removeChild](child) {
-      return this.removeChild(child);
+    [_removeChild](...args) {
+      return this.removeChild.apply(this, args);
     }
-    [_replaceChild](node, child) {
-      return this.replaceChild(node, child);
+    [_replaceChild](...args) {
+      return this.replaceChild.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.Node, '_created');
@@ -40146,7 +41223,7 @@
       let attributes = this[dartx.attributes];
       attributes[dartx.clear]();
       for (let key of value[dartx.keys]) {
-        attributes[dartx.set](key, value[dartx.get](key));
+        attributes[dartx._set](key, value[dartx._get](key));
       }
     }
     get [dartx.children]() {
@@ -40186,7 +41263,7 @@
       let data = this[dartx.dataset];
       data[dartx.clear]();
       for (let key of value[dartx.keys]) {
-        data[dartx.set](key, value[dartx.get](key));
+        data[dartx._set](key, value[dartx._get](key));
       }
     }
     [dartx.getNamespacedAttributes](namespace) {
@@ -40239,8 +41316,8 @@
       let convertedTiming = core.Map.is(timing) ? html_common.convertDartToNative_Dictionary(timing) : timing;
       return convertedTiming == null ? this[_animate](convertedFrames) : this[_animate](convertedFrames, convertedTiming);
     }
-    [_animate](effect, timing) {
-      return this.animate(effect, timing);
+    [_animate](...args) {
+      return this.animate.apply(this, args);
     }
     [dartx.attributeChanged](name, oldValue, newValue) {}
     get [_xtag]() {
@@ -40300,8 +41377,8 @@
         this[_insertAdjacentNode](where, html$.Text.new(text));
       }
     }
-    [_insertAdjacentText](where, text) {
-      return this.insertAdjacentText(where, text);
+    [_insertAdjacentText](...args) {
+      return this.insertAdjacentText.apply(this, args);
     }
     [dartx.insertAdjacentHtml](where, html, opts) {
       let validator = opts && 'validator' in opts ? opts.validator : null;
@@ -40312,8 +41389,8 @@
         this[_insertAdjacentNode](where, this[dartx.createFragment](html, {validator: validator, treeSanitizer: treeSanitizer}));
       }
     }
-    [_insertAdjacentHtml](where, text) {
-      return this.insertAdjacentHTML(where, text);
+    [_insertAdjacentHtml](...args) {
+      return this.insertAdjacentHTML.apply(this, args);
     }
     [dartx.insertAdjacentElement](where, element) {
       if (!!this.insertAdjacentElement) {
@@ -40323,8 +41400,8 @@
       }
       return element;
     }
-    [_insertAdjacentElement](where, element) {
-      return this.insertAdjacentElement(where, element);
+    [_insertAdjacentElement](...args) {
+      return this.insertAdjacentElement.apply(this, args);
     }
     [_insertAdjacentNode](where, node) {
       switch (where[dartx.toLowerCase]()) {
@@ -40335,7 +41412,7 @@
         }
         case 'afterbegin':
         {
-          let first = dart.notNull(this[dartx.nodes][dartx.length]) > 0 ? this[dartx.nodes][dartx.get](0) : null;
+          let first = dart.notNull(this[dartx.nodes][dartx.length]) > 0 ? this[dartx.nodes][dartx._get](0) : null;
           this[dartx.insertBefore](node, first);
           break;
         }
@@ -40638,14 +41715,14 @@
     set [dartx.dropzone](value) {
       this.webkitdropzone = value;
     }
-    [dartx.blur]() {
-      return this.blur();
+    [dartx.blur](...args) {
+      return this.blur.apply(this, args);
     }
-    [dartx.click]() {
-      return this.click();
+    [dartx.click](...args) {
+      return this.click.apply(this, args);
     }
-    [dartx.focus]() {
-      return this.focus();
+    [dartx.focus](...args) {
+      return this.focus.apply(this, args);
     }
     get [_attributes$]() {
       return this.attributes;
@@ -40710,50 +41787,50 @@
     get [dartx.tagName]() {
       return this.tagName;
     }
-    [dartx.closest](selectors) {
-      return this.closest(selectors);
+    [dartx.closest](...args) {
+      return this.closest.apply(this, args);
     }
-    [dartx.getAnimations]() {
-      return this.getAnimations();
+    [dartx.getAnimations](...args) {
+      return this.getAnimations.apply(this, args);
     }
-    [dartx.getAttribute](name) {
-      return this.getAttribute(name);
+    [dartx.getAttribute](...args) {
+      return this.getAttribute.apply(this, args);
     }
-    [dartx.getAttributeNS](namespaceURI, localName) {
-      return this.getAttributeNS(namespaceURI, localName);
+    [dartx.getAttributeNS](...args) {
+      return this.getAttributeNS.apply(this, args);
     }
-    [dartx.getBoundingClientRect]() {
-      return this.getBoundingClientRect();
+    [dartx.getBoundingClientRect](...args) {
+      return this.getBoundingClientRect.apply(this, args);
     }
-    [dartx.getClientRects]() {
-      return this.getClientRects();
+    [dartx.getClientRects](...args) {
+      return this.getClientRects.apply(this, args);
     }
-    [dartx.getDestinationInsertionPoints]() {
-      return this.getDestinationInsertionPoints();
+    [dartx.getDestinationInsertionPoints](...args) {
+      return this.getDestinationInsertionPoints.apply(this, args);
     }
-    [dartx.getElementsByClassName](classNames) {
-      return this.getElementsByClassName(classNames);
+    [dartx.getElementsByClassName](...args) {
+      return this.getElementsByClassName.apply(this, args);
     }
-    [_getElementsByTagName](localName) {
-      return this.getElementsByTagName(localName);
+    [_getElementsByTagName](...args) {
+      return this.getElementsByTagName.apply(this, args);
     }
-    [_hasAttribute](name) {
-      return this.hasAttribute(name);
+    [_hasAttribute](...args) {
+      return this.hasAttribute.apply(this, args);
     }
-    [_hasAttributeNS](namespaceURI, localName) {
-      return this.hasAttributeNS(namespaceURI, localName);
+    [_hasAttributeNS](...args) {
+      return this.hasAttributeNS.apply(this, args);
     }
-    [_removeAttribute](name) {
-      return this.removeAttribute(name);
+    [_removeAttribute](...args) {
+      return this.removeAttribute.apply(this, args);
     }
-    [_removeAttributeNS](namespaceURI, localName) {
-      return this.removeAttributeNS(namespaceURI, localName);
+    [_removeAttributeNS](...args) {
+      return this.removeAttributeNS.apply(this, args);
     }
-    [dartx.requestFullscreen]() {
-      return this.requestFullscreen();
+    [dartx.requestFullscreen](...args) {
+      return this.requestFullscreen.apply(this, args);
     }
-    [dartx.requestPointerLock]() {
-      return this.requestPointerLock();
+    [dartx.requestPointerLock](...args) {
+      return this.requestPointerLock.apply(this, args);
     }
     [dartx.scroll](options_OR_x, y) {
       if (options_OR_x === void 0) options_OR_x = null;
@@ -40773,14 +41850,14 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_scroll_1]() {
-      return this.scroll();
+    [_scroll_1](...args) {
+      return this.scroll.apply(this, args);
     }
-    [_scroll_2](options) {
-      return this.scroll(options);
+    [_scroll_2](...args) {
+      return this.scroll.apply(this, args);
     }
-    [_scroll_3](x, y) {
-      return this.scroll(x, y);
+    [_scroll_3](...args) {
+      return this.scroll.apply(this, args);
     }
     [dartx.scrollBy](options_OR_x, y) {
       if (options_OR_x === void 0) options_OR_x = null;
@@ -40800,20 +41877,20 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_scrollBy_1]() {
-      return this.scrollBy();
+    [_scrollBy_1](...args) {
+      return this.scrollBy.apply(this, args);
     }
-    [_scrollBy_2](options) {
-      return this.scrollBy(options);
+    [_scrollBy_2](...args) {
+      return this.scrollBy.apply(this, args);
     }
-    [_scrollBy_3](x, y) {
-      return this.scrollBy(x, y);
+    [_scrollBy_3](...args) {
+      return this.scrollBy.apply(this, args);
     }
-    [_scrollIntoView](alignWithTop) {
-      return this.scrollIntoView(alignWithTop);
+    [_scrollIntoView](...args) {
+      return this.scrollIntoView.apply(this, args);
     }
-    [_scrollIntoViewIfNeeded](centerIfNeeded) {
-      return this.scrollIntoViewIfNeeded(centerIfNeeded);
+    [_scrollIntoViewIfNeeded](...args) {
+      return this.scrollIntoViewIfNeeded.apply(this, args);
     }
     [dartx.scrollTo](options_OR_x, y) {
       if (options_OR_x === void 0) options_OR_x = null;
@@ -40833,26 +41910,26 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_scrollTo_1]() {
-      return this.scrollTo();
+    [_scrollTo_1](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [_scrollTo_2](options) {
-      return this.scrollTo(options);
+    [_scrollTo_2](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [_scrollTo_3](x, y) {
-      return this.scrollTo(x, y);
+    [_scrollTo_3](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [dartx.setAttribute](name, value) {
-      return this.setAttribute(name, value);
+    [dartx.setAttribute](...args) {
+      return this.setAttribute.apply(this, args);
     }
-    [dartx.setAttributeNS](namespaceURI, name, value) {
-      return this.setAttributeNS(namespaceURI, name, value);
+    [dartx.setAttributeNS](...args) {
+      return this.setAttributeNS.apply(this, args);
     }
-    [dartx.after](nodes) {
-      return this.after(nodes);
+    [dartx.after](...args) {
+      return this.after.apply(this, args);
     }
-    [dartx.before](nodes) {
-      return this.before(nodes);
+    [dartx.before](...args) {
+      return this.before.apply(this, args);
     }
     get [dartx.nextElementSibling]() {
       return this.nextElementSibling;
@@ -40872,11 +41949,11 @@
     get [_lastElementChild]() {
       return this.lastElementChild;
     }
-    [dartx.querySelector](selectors) {
-      return this.querySelector(selectors);
+    [dartx.querySelector](...args) {
+      return this.querySelector.apply(this, args);
     }
-    [_querySelectorAll](selectors) {
-      return this.querySelectorAll(selectors);
+    [_querySelectorAll](...args) {
+      return this.querySelectorAll.apply(this, args);
     }
     get [dartx.onAbort]() {
       return html$.Element.abortEvent.forElement(this);
@@ -41932,20 +43009,20 @@
     set [dartx.startTime](value) {
       this.startTime = value;
     }
-    [dartx.cancel]() {
-      return this.cancel();
+    [dartx.cancel](...args) {
+      return this.cancel.apply(this, args);
     }
-    [dartx.finish]() {
-      return this.finish();
+    [dartx.finish](...args) {
+      return this.finish.apply(this, args);
     }
-    [dartx.pause]() {
-      return this.pause();
+    [dartx.pause](...args) {
+      return this.pause.apply(this, args);
     }
-    [dartx.play]() {
-      return this.play();
+    [dartx.play](...args) {
+      return this.play.apply(this, args);
     }
-    [dartx.reverse]() {
-      return this.reverse();
+    [dartx.reverse](...args) {
+      return this.reverse.apply(this, args);
     }
   };
   dart.setSignature(html$.Animation, {
@@ -42196,11 +43273,11 @@
     set [dartx.playbackRate](value) {
       this.playbackRate = value;
     }
-    [dartx.getAnimations]() {
-      return this.getAnimations();
+    [dartx.getAnimations](...args) {
+      return this.getAnimations.apply(this, args);
     }
-    [dartx.play](source) {
-      return this.play(source);
+    [dartx.play](...args) {
+      return this.play.apply(this, args);
     }
   };
   dart.setSignature(html$.AnimationTimeline, {
@@ -42262,14 +43339,14 @@
     get [dartx.status]() {
       return this.status;
     }
-    [dartx.abort]() {
-      return this.abort();
+    [dartx.abort](...args) {
+      return this.abort.apply(this, args);
     }
-    [dartx.swapCache]() {
-      return this.swapCache();
+    [dartx.swapCache](...args) {
+      return this.swapCache.apply(this, args);
     }
-    [dartx.update]() {
-      return this.update();
+    [dartx.update](...args) {
+      return this.update.apply(this, args);
     }
     get [dartx.onCached]() {
       return html$.ApplicationCache.cachedEvent.forTarget(this);
@@ -42365,6 +43442,8 @@
     }
   });
   dart.registerExtension(dart.global.ApplicationCache, html$.ApplicationCache);
+  dart.registerExtension(dart.global.DOMApplicationCache, html$.ApplicationCache);
+  dart.registerExtension(dart.global.OfflineResourceList, html$.ApplicationCache);
   dart.defineExtensionNames([
     'message',
     'reason',
@@ -42814,35 +43893,35 @@
     get [dartx.videoDecodedByteCount]() {
       return this.webkitVideoDecodedByteCount;
     }
-    [dartx.addTextTrack](kind, label, language) {
-      return this.addTextTrack(kind, label, language);
+    [dartx.addTextTrack](...args) {
+      return this.addTextTrack.apply(this, args);
     }
-    [dartx.canPlayType](type, keySystem) {
-      return this.canPlayType(type, keySystem);
+    [dartx.canPlayType](...args) {
+      return this.canPlayType.apply(this, args);
     }
-    [dartx.load]() {
-      return this.load();
+    [dartx.load](...args) {
+      return this.load.apply(this, args);
     }
-    [dartx.pause]() {
-      return this.pause();
+    [dartx.pause](...args) {
+      return this.pause.apply(this, args);
     }
-    [dartx.play]() {
-      return this.play();
+    [dartx.play](...args) {
+      return this.play.apply(this, args);
     }
-    [dartx.setMediaKeys](mediaKeys) {
-      return this.setMediaKeys(mediaKeys);
+    [dartx.setMediaKeys](...args) {
+      return this.setMediaKeys.apply(this, args);
     }
-    [dartx.setSinkId](sinkId) {
-      return this.setSinkId(sinkId);
+    [dartx.setSinkId](...args) {
+      return this.setSinkId.apply(this, args);
     }
-    [dartx.addKey](keySystem, key, initData, sessionId) {
-      return this.webkitAddKey(keySystem, key, initData, sessionId);
+    [dartx.addKey](...args) {
+      return this.webkitAddKey.apply(this, args);
     }
-    [dartx.cancelKeyRequest](keySystem, sessionId) {
-      return this.webkitCancelKeyRequest(keySystem, sessionId);
+    [dartx.cancelKeyRequest](...args) {
+      return this.webkitCancelKeyRequest.apply(this, args);
     }
-    [dartx.generateKeyRequest](keySystem, initData) {
-      return this.webkitGenerateKeyRequest(keySystem, initData);
+    [dartx.generateKeyRequest](...args) {
+      return this.webkitGenerateKeyRequest.apply(this, args);
     }
     get [dartx.onKeyAdded]() {
       return html$.MediaElement.keyAddedEvent.forElement(this);
@@ -43046,11 +44125,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [__getter__](index) {
-      return this.__getter__(index);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.getTrackById](id) {
-      return this.getTrackById(id);
+    [dartx.getTrackById](...args) {
+      return this.getTrackById.apply(this, args);
     }
     get [dartx.onChange]() {
       return html$.AudioTrackList.changeEvent.forTarget(this);
@@ -43250,8 +44329,8 @@
     get [dartx.userChoice]() {
       return this.userChoice;
     }
-    [dartx.prompt]() {
-      return this.prompt();
+    [dartx.prompt](...args) {
+      return this.prompt.apply(this, args);
     }
   };
   dart.setSignature(html$.BeforeInstallPromptEvent, {
@@ -43306,11 +44385,11 @@
     get [dartx.type]() {
       return this.type;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.slice](start, end, contentType) {
-      return this.slice(start, end, contentType);
+    [dartx.slice](...args) {
+      return this.slice.apply(this, args);
     }
     static new(blobParts, type, endings) {
       if (type === void 0) type = null;
@@ -43370,8 +44449,8 @@
       let options_1 = html_common.convertDartToNative_Dictionary(options);
       return this[_requestDevice_1](options_1);
     }
-    [_requestDevice_1](options) {
-      return this.requestDevice(options);
+    [_requestDevice_1](...args) {
+      return this.requestDevice.apply(this, args);
     }
   };
   dart.setSignature(html$.Bluetooth, {
@@ -43421,8 +44500,8 @@
     get [dartx.vendorIDSource]() {
       return this.vendorIDSource;
     }
-    [dartx.connectGatt]() {
-      return this.connectGATT();
+    [dartx.connectGatt](...args) {
+      return this.connectGATT.apply(this, args);
     }
   };
   dart.setSignature(html$.BluetoothDevice, {
@@ -43452,11 +44531,11 @@
     get [dartx.uuid]() {
       return this.uuid;
     }
-    [dartx.readValue]() {
-      return this.readValue();
+    [dartx.readValue](...args) {
+      return this.readValue.apply(this, args);
     }
-    [dartx.writeValue](value) {
-      return this.writeValue(value);
+    [dartx.writeValue](...args) {
+      return this.writeValue.apply(this, args);
     }
   };
   dart.setSignature(html$.BluetoothGattCharacteristic, {
@@ -43479,8 +44558,8 @@
     get [dartx.connected]() {
       return this.connected;
     }
-    [dartx.getPrimaryService](service) {
-      return this.getPrimaryService(service);
+    [dartx.getPrimaryService](...args) {
+      return this.getPrimaryService.apply(this, args);
     }
   };
   dart.setSignature(html$.BluetoothGattRemoteServer, {
@@ -43504,8 +44583,8 @@
     get [dartx.uuid]() {
       return this.uuid;
     }
-    [dartx.getCharacteristic](characteristic) {
-      return this.getCharacteristic(characteristic);
+    [dartx.getCharacteristic](...args) {
+      return this.getCharacteristic.apply(this, args);
     }
   };
   dart.setSignature(html$.BluetoothGattService, {
@@ -43547,17 +44626,17 @@
     get [dartx.bodyUsed]() {
       return this.bodyUsed;
     }
-    [dartx.arrayBuffer]() {
-      return this.arrayBuffer();
+    [dartx.arrayBuffer](...args) {
+      return this.arrayBuffer.apply(this, args);
     }
-    [dartx.blob]() {
-      return this.blob();
+    [dartx.blob](...args) {
+      return this.blob.apply(this, args);
     }
-    [dartx.json]() {
-      return this.json();
+    [dartx.json](...args) {
+      return this.json.apply(this, args);
     }
-    [dartx.text]() {
-      return this.text();
+    [dartx.text](...args) {
+      return this.text.apply(this, args);
     }
   };
   dart.setSignature(html$.Body, {
@@ -43831,14 +44910,14 @@
     get [dartx.willValidate]() {
       return this.willValidate;
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.ButtonElement, 'created');
@@ -43899,26 +44978,26 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.appendData](data) {
-      return this.appendData(data);
+    [dartx.appendData](...args) {
+      return this.appendData.apply(this, args);
     }
-    [dartx.deleteData](offset, count) {
-      return this.deleteData(offset, count);
+    [dartx.deleteData](...args) {
+      return this.deleteData.apply(this, args);
     }
-    [dartx.insertData](offset, data) {
-      return this.insertData(offset, data);
+    [dartx.insertData](...args) {
+      return this.insertData.apply(this, args);
     }
-    [dartx.replaceData](offset, count, data) {
-      return this.replaceData(offset, count, data);
+    [dartx.replaceData](...args) {
+      return this.replaceData.apply(this, args);
     }
-    [dartx.substringData](offset, count) {
-      return this.substringData(offset, count);
+    [dartx.substringData](...args) {
+      return this.substringData.apply(this, args);
     }
-    [dartx.after](nodes) {
-      return this.after(nodes);
+    [dartx.after](...args) {
+      return this.after.apply(this, args);
     }
-    [dartx.before](nodes) {
-      return this.before(nodes);
+    [dartx.before](...args) {
+      return this.before.apply(this, args);
     }
     get [dartx.nextElementSibling]() {
       return this.nextElementSibling;
@@ -43962,11 +45041,11 @@
     get [dartx.wholeText]() {
       return this.wholeText;
     }
-    [dartx.getDestinationInsertionPoints]() {
-      return this.getDestinationInsertionPoints();
+    [dartx.getDestinationInsertionPoints](...args) {
+      return this.getDestinationInsertionPoints.apply(this, args);
     }
-    [dartx.splitText](offset) {
-      return this.splitText(offset);
+    [dartx.splitText](...args) {
+      return this.splitText.apply(this, args);
     }
   };
   dart.setSignature(html$.Text, {
@@ -44003,14 +45082,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.delete](cacheName) {
-      return this.delete(cacheName);
+    [dartx.delete](...args) {
+      return this.delete.apply(this, args);
     }
-    [dartx.has](cacheName) {
-      return this.has(cacheName);
+    [dartx.has](...args) {
+      return this.has.apply(this, args);
     }
-    [dartx.keys]() {
-      return this.keys();
+    [dartx.keys](...args) {
+      return this.keys.apply(this, args);
     }
     [dartx.match](request, options) {
       if (options === void 0) options = null;
@@ -44020,14 +45099,14 @@
       }
       return this[_match_2](request);
     }
-    [_match_1](request, options) {
-      return this.match(request, options);
+    [_match_1](...args) {
+      return this.match.apply(this, args);
     }
-    [_match_2](request) {
-      return this.match(request);
+    [_match_2](...args) {
+      return this.match.apply(this, args);
     }
-    [dartx.open](cacheName) {
-      return this.open(cacheName);
+    [dartx.open](...args) {
+      return this.open.apply(this, args);
     }
   };
   dart.setSignature(html$.CacheStorage, {
@@ -44093,14 +45172,14 @@
       }
       return this[_getContext_2](contextId);
     }
-    [_getContext_1](contextId, attributes) {
-      return this.getContext(contextId, attributes);
+    [_getContext_1](...args) {
+      return this.getContext.apply(this, args);
     }
-    [_getContext_2](contextId) {
-      return this.getContext(contextId);
+    [_getContext_2](...args) {
+      return this.getContext.apply(this, args);
     }
-    [_toDataUrl](type, arguments_OR_quality) {
-      return this.toDataURL(type, arguments_OR_quality);
+    [_toDataUrl](...args) {
+      return this.toDataURL.apply(this, args);
     }
     get [dartx.onWebGlContextLost]() {
       return html$.CanvasElement.webGlContextLostEvent.forElement(this);
@@ -44177,8 +45256,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.addColorStop](offset, color) {
-      return this.addColorStop(offset, color);
+    [dartx.addColorStop](...args) {
+      return this.addColorStop.apply(this, args);
     }
   };
   dart.setSignature(html$.CanvasGradient, {
@@ -44193,8 +45272,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.setTransform](transform) {
-      return this.setTransform(transform);
+    [dartx.setTransform](...args) {
+      return this.setTransform.apply(this, args);
     }
   };
   dart.setSignature(html$.CanvasPattern, {
@@ -44423,23 +45502,23 @@
       this[_addHitRegion_2]();
       return;
     }
-    [_addHitRegion_1](options) {
-      return this.addHitRegion(options);
+    [_addHitRegion_1](...args) {
+      return this.addHitRegion.apply(this, args);
     }
-    [_addHitRegion_2]() {
-      return this.addHitRegion();
+    [_addHitRegion_2](...args) {
+      return this.addHitRegion.apply(this, args);
     }
-    [dartx.beginPath]() {
-      return this.beginPath();
+    [dartx.beginPath](...args) {
+      return this.beginPath.apply(this, args);
     }
-    [dartx.clearHitRegions]() {
-      return this.clearHitRegions();
+    [dartx.clearHitRegions](...args) {
+      return this.clearHitRegions.apply(this, args);
     }
-    [dartx.clearRect](x, y, width, height) {
-      return this.clearRect(x, y, width, height);
+    [dartx.clearRect](...args) {
+      return this.clearRect.apply(this, args);
     }
-    [dartx.clip](path_OR_winding, winding) {
-      return this.clip(path_OR_winding, winding);
+    [dartx.clip](...args) {
+      return this.clip.apply(this, args);
     }
     [dartx.createImageData](imagedata_OR_sw, sh) {
       if (sh === void 0) sh = null;
@@ -44452,53 +45531,53 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_createImageData_1](imagedata) {
-      return this.createImageData(imagedata);
+    [_createImageData_1](...args) {
+      return this.createImageData.apply(this, args);
     }
-    [_createImageData_2](sw, sh) {
-      return this.createImageData(sw, sh);
+    [_createImageData_2](...args) {
+      return this.createImageData.apply(this, args);
     }
-    [dartx.createLinearGradient](x0, y0, x1, y1) {
-      return this.createLinearGradient(x0, y0, x1, y1);
+    [dartx.createLinearGradient](...args) {
+      return this.createLinearGradient.apply(this, args);
     }
-    [dartx.createPattern](image, repetitionType) {
-      return this.createPattern(image, repetitionType);
+    [dartx.createPattern](...args) {
+      return this.createPattern.apply(this, args);
     }
-    [dartx.createRadialGradient](x0, y0, r0, x1, y1, r1) {
-      return this.createRadialGradient(x0, y0, r0, x1, y1, r1);
+    [dartx.createRadialGradient](...args) {
+      return this.createRadialGradient.apply(this, args);
     }
-    [dartx.drawFocusIfNeeded](element_OR_path, element) {
-      return this.drawFocusIfNeeded(element_OR_path, element);
+    [dartx.drawFocusIfNeeded](...args) {
+      return this.drawFocusIfNeeded.apply(this, args);
     }
-    [dartx.fillRect](x, y, width, height) {
-      return this.fillRect(x, y, width, height);
+    [dartx.fillRect](...args) {
+      return this.fillRect.apply(this, args);
     }
     [dartx.getContextAttributes]() {
       return html_common.convertNativeToDart_Dictionary(this[_getContextAttributes_1]());
     }
-    [_getContextAttributes_1]() {
-      return this.getContextAttributes();
+    [_getContextAttributes_1](...args) {
+      return this.getContextAttributes.apply(this, args);
     }
     [dartx.getImageData](sx, sy, sw, sh) {
       return html_common.convertNativeToDart_ImageData(this[_getImageData_1](sx, sy, sw, sh));
     }
-    [_getImageData_1](sx, sy, sw, sh) {
-      return this.getImageData(sx, sy, sw, sh);
+    [_getImageData_1](...args) {
+      return this.getImageData.apply(this, args);
     }
-    [_getLineDash]() {
-      return this.getLineDash();
+    [_getLineDash](...args) {
+      return this.getLineDash.apply(this, args);
     }
-    [dartx.isContextLost]() {
-      return this.isContextLost();
+    [dartx.isContextLost](...args) {
+      return this.isContextLost.apply(this, args);
     }
-    [dartx.isPointInPath](path_OR_x, x_OR_y, winding_OR_y, winding) {
-      return this.isPointInPath(path_OR_x, x_OR_y, winding_OR_y, winding);
+    [dartx.isPointInPath](...args) {
+      return this.isPointInPath.apply(this, args);
     }
-    [dartx.isPointInStroke](path_OR_x, x_OR_y, y) {
-      return this.isPointInStroke(path_OR_x, x_OR_y, y);
+    [dartx.isPointInStroke](...args) {
+      return this.isPointInStroke.apply(this, args);
     }
-    [dartx.measureText](text) {
-      return this.measureText(text);
+    [dartx.measureText](...args) {
+      return this.measureText.apply(this, args);
     }
     [dartx.putImageData](imagedata, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight) {
       if (dirtyX === void 0) dirtyX = null;
@@ -44517,77 +45596,77 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_putImageData_1](imagedata, dx, dy) {
-      return this.putImageData(imagedata, dx, dy);
+    [_putImageData_1](...args) {
+      return this.putImageData.apply(this, args);
     }
-    [_putImageData_2](imagedata, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight) {
-      return this.putImageData(imagedata, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight);
+    [_putImageData_2](...args) {
+      return this.putImageData.apply(this, args);
     }
-    [dartx.removeHitRegion](id) {
-      return this.removeHitRegion(id);
+    [dartx.removeHitRegion](...args) {
+      return this.removeHitRegion.apply(this, args);
     }
-    [dartx.resetTransform]() {
-      return this.resetTransform();
+    [dartx.resetTransform](...args) {
+      return this.resetTransform.apply(this, args);
     }
-    [dartx.restore]() {
-      return this.restore();
+    [dartx.restore](...args) {
+      return this.restore.apply(this, args);
     }
-    [dartx.rotate](angle) {
-      return this.rotate(angle);
+    [dartx.rotate](...args) {
+      return this.rotate.apply(this, args);
     }
-    [dartx.save]() {
-      return this.save();
+    [dartx.save](...args) {
+      return this.save.apply(this, args);
     }
-    [dartx.scale](x, y) {
-      return this.scale(x, y);
+    [dartx.scale](...args) {
+      return this.scale.apply(this, args);
     }
-    [dartx.scrollPathIntoView](path) {
-      return this.scrollPathIntoView(path);
+    [dartx.scrollPathIntoView](...args) {
+      return this.scrollPathIntoView.apply(this, args);
     }
-    [dartx.setTransform](a, b, c, d, e, f) {
-      return this.setTransform(a, b, c, d, e, f);
+    [dartx.setTransform](...args) {
+      return this.setTransform.apply(this, args);
     }
-    [dartx.stroke](path) {
-      return this.stroke(path);
+    [dartx.stroke](...args) {
+      return this.stroke.apply(this, args);
     }
-    [dartx.strokeRect](x, y, width, height) {
-      return this.strokeRect(x, y, width, height);
+    [dartx.strokeRect](...args) {
+      return this.strokeRect.apply(this, args);
     }
-    [dartx.strokeText](text, x, y, maxWidth) {
-      return this.strokeText(text, x, y, maxWidth);
+    [dartx.strokeText](...args) {
+      return this.strokeText.apply(this, args);
     }
-    [dartx.transform](a, b, c, d, e, f) {
-      return this.transform(a, b, c, d, e, f);
+    [dartx.transform](...args) {
+      return this.transform.apply(this, args);
     }
-    [dartx.translate](x, y) {
-      return this.translate(x, y);
+    [dartx.translate](...args) {
+      return this.translate.apply(this, args);
     }
-    [_arc](x, y, radius, startAngle, endAngle, anticlockwise) {
-      return this.arc(x, y, radius, startAngle, endAngle, anticlockwise);
+    [_arc](...args) {
+      return this.arc.apply(this, args);
     }
-    [dartx.arcTo](x1, y1, x2, y2, radius) {
-      return this.arcTo(x1, y1, x2, y2, radius);
+    [dartx.arcTo](...args) {
+      return this.arcTo.apply(this, args);
     }
-    [dartx.bezierCurveTo](cp1x, cp1y, cp2x, cp2y, x, y) {
-      return this.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
+    [dartx.bezierCurveTo](...args) {
+      return this.bezierCurveTo.apply(this, args);
     }
-    [dartx.closePath]() {
-      return this.closePath();
+    [dartx.closePath](...args) {
+      return this.closePath.apply(this, args);
     }
-    [dartx.ellipse](x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
-      return this.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
+    [dartx.ellipse](...args) {
+      return this.ellipse.apply(this, args);
     }
-    [dartx.lineTo](x, y) {
-      return this.lineTo(x, y);
+    [dartx.lineTo](...args) {
+      return this.lineTo.apply(this, args);
     }
-    [dartx.moveTo](x, y) {
-      return this.moveTo(x, y);
+    [dartx.moveTo](...args) {
+      return this.moveTo.apply(this, args);
     }
-    [dartx.quadraticCurveTo](cpx, cpy, x, y) {
-      return this.quadraticCurveTo(cpx, cpy, x, y);
+    [dartx.quadraticCurveTo](...args) {
+      return this.quadraticCurveTo.apply(this, args);
     }
-    [dartx.rect](x, y, width, height) {
-      return this.rect(x, y, width, height);
+    [dartx.rect](...args) {
+      return this.rect.apply(this, args);
     }
     [dartx.createImageDataFromImageData](imagedata) {
       return this.createImageData(imagedata);
@@ -44623,14 +45702,14 @@
         this[dartx.drawImageScaledFromSource](source, sourceRect[dartx.left], sourceRect[dartx.top], sourceRect[dartx.width], sourceRect[dartx.height], destRect[dartx.left], destRect[dartx.top], destRect[dartx.width], destRect[dartx.height]);
       }
     }
-    [dartx.drawImage](source, destX, destY) {
-      return this.drawImage(source, destX, destY);
+    [dartx.drawImage](...args) {
+      return this.drawImage.apply(this, args);
     }
-    [dartx.drawImageScaled](source, destX, destY, destWidth, destHeight) {
-      return this.drawImage(source, destX, destY, destWidth, destHeight);
+    [dartx.drawImageScaled](...args) {
+      return this.drawImage.apply(this, args);
     }
-    [dartx.drawImageScaledFromSource](source, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight) {
-      return this.drawImage(source, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight);
+    [dartx.drawImageScaledFromSource](...args) {
+      return this.drawImage.apply(this, args);
     }
     get [dartx.lineDashOffset]() {
       return this.lineDashOffset || this.webkitLineDashOffset;
@@ -44877,11 +45956,11 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
   };
   dart.setSignature(html$.Client, {
@@ -44909,8 +45988,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.claim]() {
-      return this.claim();
+    [dartx.claim](...args) {
+      return this.claim.apply(this, args);
     }
     [dartx.matchAll](options) {
       if (options === void 0) options = null;
@@ -44920,14 +45999,14 @@
       }
       return this[_matchAll_2]();
     }
-    [_matchAll_1](options) {
-      return this.matchAll(options);
+    [_matchAll_1](...args) {
+      return this.matchAll.apply(this, args);
     }
-    [_matchAll_2]() {
-      return this.matchAll();
+    [_matchAll_2](...args) {
+      return this.matchAll.apply(this, args);
     }
-    [dartx.openWindow](url) {
-      return this.openWindow(url);
+    [dartx.openWindow](...args) {
+      return this.openWindow.apply(this, args);
     }
   };
   dart.setSignature(html$.Clients, {
@@ -45085,8 +46164,8 @@
     get [_which]() {
       return this.which;
     }
-    [_initUIEvent](type, bubbles, cancelable, view, detail) {
-      return this.initUIEvent(type, bubbles, cancelable, view, detail);
+    [_initUIEvent](...args) {
+      return this.initUIEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.UIEvent, {
@@ -45149,8 +46228,8 @@
     get [dartx.data]() {
       return this.data;
     }
-    [_initCompositionEvent](type, bubbles, cancelable, view, data) {
-      return this.initCompositionEvent(type, bubbles, cancelable, view, data);
+    [_initCompositionEvent](...args) {
+      return this.initCompositionEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.CompositionEvent, {
@@ -45209,11 +46288,11 @@
     set [dartx.transform](value) {
       this.transform = value;
     }
-    [dartx.disconnect]() {
-      return this.disconnect();
+    [dartx.disconnect](...args) {
+      return this.disconnect.apply(this, args);
     }
-    [dartx.supports](attribute) {
-      return this.supports(attribute);
+    [dartx.supports](...args) {
+      return this.supports.apply(this, args);
     }
   };
   dart.setSignature(html$.CompositorProxy, {
@@ -45262,14 +46341,14 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [dartx.terminate]() {
-      return this.terminate();
+    [dartx.terminate](...args) {
+      return this.terminate.apply(this, args);
     }
     get [dartx.onError]() {
       return html$.CompositorWorker.errorEvent.forTarget(this);
@@ -45368,8 +46447,8 @@
     get [dartx.self]() {
       return this.self;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
     [dartx.fetch](input, init) {
       if (init === void 0) init = null;
@@ -45379,17 +46458,17 @@
       }
       return this[_fetch_2](input);
     }
-    [_fetch_1](input, init) {
-      return this.fetch(input, init);
+    [_fetch_1](...args) {
+      return this.fetch.apply(this, args);
     }
-    [_fetch_2](input) {
-      return this.fetch(input);
+    [_fetch_2](...args) {
+      return this.fetch.apply(this, args);
     }
-    [dartx.importScripts](urls) {
-      return this.importScripts(urls);
+    [dartx.importScripts](...args) {
+      return this.importScripts.apply(this, args);
     }
-    [_webkitRequestFileSystem](type, size, successCallback, errorCallback) {
-      return this.webkitRequestFileSystem(type, size, successCallback, errorCallback);
+    [_webkitRequestFileSystem](...args) {
+      return this.webkitRequestFileSystem.apply(this, args);
     }
     [dartx.webkitRequestFileSystem](type, size) {
       let completer = CompleterOfFileSystem().new();
@@ -45400,14 +46479,14 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [dartx.requestFileSystemSync](type, size) {
-      return this.webkitRequestFileSystemSync(type, size);
+    [dartx.requestFileSystemSync](...args) {
+      return this.webkitRequestFileSystemSync.apply(this, args);
     }
-    [dartx.resolveLocalFileSystemSyncUrl](url) {
-      return this.webkitResolveLocalFileSystemSyncURL(url);
+    [dartx.resolveLocalFileSystemSyncUrl](...args) {
+      return this.webkitResolveLocalFileSystemSyncURL.apply(this, args);
     }
-    [_webkitResolveLocalFileSystemUrl](url, successCallback, errorCallback) {
-      return this.webkitResolveLocalFileSystemURL(url, successCallback, errorCallback);
+    [_webkitResolveLocalFileSystemUrl](...args) {
+      return this.webkitResolveLocalFileSystemURL.apply(this, args);
     }
     [dartx.webkitResolveLocalFileSystemUrl](url) {
       let completer = CompleterOfEntry().new();
@@ -45418,29 +46497,29 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [dartx.atob](atob) {
-      return this.atob(atob);
+    [dartx.atob](...args) {
+      return this.atob.apply(this, args);
     }
-    [dartx.btoa](btoa) {
-      return this.btoa(btoa);
+    [dartx.btoa](...args) {
+      return this.btoa.apply(this, args);
     }
-    [_setInterval_String](handler, timeout, arguments$) {
-      return this.setInterval(handler, timeout, arguments$);
+    [_setInterval_String](...args) {
+      return this.setInterval.apply(this, args);
     }
-    [_setTimeout_String](handler, timeout, arguments$) {
-      return this.setTimeout(handler, timeout, arguments$);
+    [_setTimeout_String](...args) {
+      return this.setTimeout.apply(this, args);
     }
-    [_clearInterval](handle) {
-      return this.clearInterval(handle);
+    [_clearInterval](...args) {
+      return this.clearInterval.apply(this, args);
     }
-    [_clearTimeout](handle) {
-      return this.clearTimeout(handle);
+    [_clearTimeout](...args) {
+      return this.clearTimeout.apply(this, args);
     }
-    [_setInterval](handler, timeout) {
-      return this.setInterval(handler, timeout);
+    [_setInterval](...args) {
+      return this.setInterval.apply(this, args);
     }
-    [_setTimeout](handler, timeout) {
-      return this.setTimeout(handler, timeout);
+    [_setTimeout](...args) {
+      return this.setTimeout.apply(this, args);
     }
     get [dartx.onError]() {
       return html$.WorkerGlobalScope.errorEvent.forTarget(this);
@@ -45505,8 +46584,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.cancelAnimationFrame](handle) {
-      return this.cancelAnimationFrame(handle);
+    [dartx.cancelAnimationFrame](...args) {
+      return this.cancelAnimationFrame.apply(this, args);
     }
     [dartx.postMessage](message, transfer) {
       if (transfer === void 0) transfer = null;
@@ -45519,14 +46598,14 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [dartx.requestAnimationFrame](callback) {
-      return this.requestAnimationFrame(callback);
+    [dartx.requestAnimationFrame](...args) {
+      return this.requestAnimationFrame.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.CompositorWorkerGlobalScope.messageEvent.forTarget(this);
@@ -45676,14 +46755,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.assertCondition](condition, arg) {
-      return this.assert(condition, arg);
+    [dartx.assertCondition](...args) {
+      return this.assert.apply(this, args);
     }
-    [dartx.timeline](title) {
-      return this.timeline(title);
+    [dartx.timeline](...args) {
+      return this.timeline.apply(this, args);
     }
-    [dartx.timelineEnd](title) {
-      return this.timelineEnd(title);
+    [dartx.timelineEnd](...args) {
+      return this.timelineEnd.apply(this, args);
     }
   };
   dart.setSignature(html$.ConsoleBase, {
@@ -45719,8 +46798,8 @@
     set [dartx.select](value) {
       this.select = value;
     }
-    [dartx.getDistributedNodes]() {
-      return this.getDistributedNodes();
+    [dartx.getDistributedNodes](...args) {
+      return this.getDistributedNodes.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.ContentElement, 'created');
@@ -45827,8 +46906,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.notifySignedIn](credential) {
-      return this.notifySignedIn(credential);
+    [dartx.notifySignedIn](...args) {
+      return this.notifySignedIn.apply(this, args);
     }
     [dartx.request](options) {
       if (options === void 0) options = null;
@@ -45838,14 +46917,14 @@
       }
       return this[_request_2]();
     }
-    [_request_1](options) {
-      return this.request(options);
+    [_request_1](...args) {
+      return this.request.apply(this, args);
     }
-    [_request_2]() {
-      return this.request();
+    [_request_2](...args) {
+      return this.request.apply(this, args);
     }
-    [dartx.requireUserMediation]() {
-      return this.requireUserMediation();
+    [dartx.requireUserMediation](...args) {
+      return this.requireUserMediation.apply(this, args);
     }
   };
   dart.setSignature(html$.CredentialsContainer, {
@@ -45870,8 +46949,8 @@
     get [dartx.client]() {
       return this.client;
     }
-    [dartx.acceptConnection](shouldAccept) {
-      return this.acceptConnection(shouldAccept);
+    [dartx.acceptConnection](...args) {
+      return this.acceptConnection.apply(this, args);
     }
   };
   dart.setSignature(html$.CrossOriginConnectEvent, {
@@ -45906,11 +46985,11 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
   };
   dart.setSignature(html$.CrossOriginServiceWorkerClient, {
@@ -45944,8 +47023,8 @@
     get [dartx.subtle]() {
       return this.subtle;
     }
-    [_getRandomValues](array) {
-      return this.getRandomValues(array);
+    [_getRandomValues](...args) {
+      return this.getRandomValues.apply(this, args);
     }
   };
   dart.setSignature(html$.Crypto, {
@@ -46114,11 +47193,11 @@
     get [dartx.cssRules]() {
       return this.cssRules;
     }
-    [dartx.deleteRule](index) {
-      return this.deleteRule(index);
+    [dartx.deleteRule](...args) {
+      return this.deleteRule.apply(this, args);
     }
-    [dartx.insertRule](rule, index) {
-      return this.insertRule(rule, index);
+    [dartx.insertRule](...args) {
+      return this.insertRule.apply(this, args);
     }
   };
   dart.setSignature(html$.CssGroupingRule, {
@@ -46184,6 +47263,8 @@
     })
   });
   dart.registerExtension(dart.global.CSSKeyframeRule, html$.CssKeyframeRule);
+  dart.registerExtension(dart.global.MozCSSKeyframeRule, html$.CssKeyframeRule);
+  dart.registerExtension(dart.global.WebKitCSSKeyframeRule, html$.CssKeyframeRule);
   dart.defineExtensionNames([
     'appendRule',
     'deleteRule',
@@ -46204,17 +47285,17 @@
     set [dartx.name](value) {
       this.name = value;
     }
-    [__getter__](index) {
-      return this.__getter__(index);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.appendRule](rule) {
-      return this.appendRule(rule);
+    [dartx.appendRule](...args) {
+      return this.appendRule.apply(this, args);
     }
-    [dartx.deleteRule](select) {
-      return this.deleteRule(select);
+    [dartx.deleteRule](...args) {
+      return this.deleteRule.apply(this, args);
     }
-    [dartx.findRule](select) {
-      return this.findRule(select);
+    [dartx.findRule](...args) {
+      return this.findRule.apply(this, args);
     }
   };
   dart.setSignature(html$.CssKeyframesRule, {
@@ -46231,6 +47312,8 @@
     })
   });
   dart.registerExtension(dart.global.CSSKeyframesRule, html$.CssKeyframesRule);
+  dart.registerExtension(dart.global.MozCSSKeyframesRule, html$.CssKeyframesRule);
+  dart.registerExtension(dart.global.WebKitCSSKeyframesRule, html$.CssKeyframesRule);
   dart.defineExtensionNames([
     'media'
   ]);
@@ -50750,17 +51833,17 @@
     get [dartx.parentRule]() {
       return this.parentRule;
     }
-    [dartx.getPropertyPriority](property) {
-      return this.getPropertyPriority(property);
+    [dartx.getPropertyPriority](...args) {
+      return this.getPropertyPriority.apply(this, args);
     }
-    [_getPropertyValue](property) {
-      return this.getPropertyValue(property);
+    [_getPropertyValue](...args) {
+      return this.getPropertyValue.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.removeProperty](property) {
-      return this.removeProperty(property);
+    [dartx.removeProperty](...args) {
+      return this.removeProperty.apply(this, args);
     }
     get [dartx.background]() {
       return this[_background];
@@ -51972,6 +53055,8 @@
     }
   });
   dart.registerExtension(dart.global.CSSStyleDeclaration, html$.CssStyleDeclaration);
+  dart.registerExtension(dart.global.MSStyleCSSProperties, html$.CssStyleDeclaration);
+  dart.registerExtension(dart.global.CSS2Properties, html$.CssStyleDeclaration);
   const _elementIterable = Symbol('_elementIterable');
   const _elementCssStyleDeclarationSetIterable = Symbol('_elementCssStyleDeclarationSetIterable');
   const _setAll = Symbol('_setAll');
@@ -52740,17 +53825,17 @@
     get [dartx.rules]() {
       return this.rules;
     }
-    [dartx.addRule](selector, style, index) {
-      return this.addRule(selector, style, index);
+    [dartx.addRule](...args) {
+      return this.addRule.apply(this, args);
     }
-    [dartx.deleteRule](index) {
-      return this.deleteRule(index);
+    [dartx.deleteRule](...args) {
+      return this.deleteRule.apply(this, args);
     }
-    [dartx.insertRule](rule, index) {
-      return this.insertRule(rule, index);
+    [dartx.insertRule](...args) {
+      return this.insertRule.apply(this, args);
     }
-    [dartx.removeRule](index) {
-      return this.removeRule(index);
+    [dartx.removeRule](...args) {
+      return this.removeRule.apply(this, args);
     }
   };
   dart.setSignature(html$.CssStyleSheet, {
@@ -52784,11 +53869,11 @@
     get [dartx.cssRules]() {
       return this.cssRules;
     }
-    [dartx.deleteRule](index) {
-      return this.deleteRule(index);
+    [dartx.deleteRule](...args) {
+      return this.deleteRule.apply(this, args);
     }
-    [dartx.insertRule](rule, index) {
-      return this.insertRule(rule, index);
+    [dartx.insertRule](...args) {
+      return this.insertRule.apply(this, args);
     }
   };
   dart.setSignature(html$.CssSupportsRule, {
@@ -52878,8 +53963,8 @@
     get [_get__detail]() {
       return this.detail;
     }
-    [_initCustomEvent](type, bubbles, cancelable, detail) {
-      return this.initCustomEvent(type, bubbles, cancelable, detail);
+    [_initCustomEvent](...args) {
+      return this.initCustomEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.CustomEvent, {
@@ -52991,17 +54076,17 @@
     get [dartx.types]() {
       return this.types;
     }
-    [dartx.clearData](format) {
-      return this.clearData(format);
+    [dartx.clearData](...args) {
+      return this.clearData.apply(this, args);
     }
-    [dartx.getData](format) {
-      return this.getData(format);
+    [dartx.getData](...args) {
+      return this.getData.apply(this, args);
     }
-    [dartx.setData](format, data) {
-      return this.setData(format, data);
+    [dartx.setData](...args) {
+      return this.setData.apply(this, args);
     }
-    [dartx.setDragImage](image, x, y) {
-      return this.setDragImage(image, x, y);
+    [dartx.setDragImage](...args) {
+      return this.setDragImage.apply(this, args);
     }
   };
   dart.setSignature(html$.DataTransfer, {
@@ -53039,11 +54124,11 @@
     get [dartx.type]() {
       return this.type;
     }
-    [dartx.getAsFile]() {
-      return this.getAsFile();
+    [dartx.getAsFile](...args) {
+      return this.getAsFile.apply(this, args);
     }
-    [_getAsString](callback) {
-      return this.getAsString(callback);
+    [_getAsString](...args) {
+      return this.getAsString.apply(this, args);
     }
     [dartx.getAsString]() {
       let completer = CompleterOfString().new();
@@ -53052,8 +54137,8 @@
       }, StringTovoid$()));
       return completer.future;
     }
-    [dartx.getAsEntry]() {
-      return this.webkitGetAsEntry();
+    [dartx.getAsEntry](...args) {
+      return this.webkitGetAsEntry.apply(this, args);
     }
   };
   dart.setSignature(html$.DataTransferItem, {
@@ -53077,7 +54162,7 @@
     'clear',
     'item',
     'remove',
-    'get',
+    '_get',
     'length'
   ]);
   html$.DataTransferItemList = class DataTransferItemList extends _interceptors.Interceptor {
@@ -53087,25 +54172,25 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.add](data_OR_file, type) {
-      return this.add(data_OR_file, type);
+    [dartx.add](...args) {
+      return this.add.apply(this, args);
     }
-    [dartx.addData](data, type) {
-      return this.add(data, type);
+    [dartx.addData](...args) {
+      return this.add.apply(this, args);
     }
-    [dartx.addFile](file) {
-      return this.add(file);
+    [dartx.addFile](...args) {
+      return this.add.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.remove](index) {
-      return this.remove(index);
+    [dartx.remove](...args) {
+      return this.remove.apply(this, args);
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       return this[index];
     }
   };
@@ -53119,7 +54204,7 @@
       [dartx.clear]: dart.definiteFunctionType(dart.void, []),
       [dartx.item]: dart.definiteFunctionType(html$.DataTransferItem, [core.int]),
       [dartx.remove]: dart.definiteFunctionType(dart.void, [core.int]),
-      [dartx.get]: dart.definiteFunctionType(html$.DataTransferItem, [core.int])
+      [dartx._get]: dart.definiteFunctionType(html$.DataTransferItem, [core.int])
     })
   });
   dart.registerExtension(dart.global.DataTransferItemList, html$.DataTransferItemList);
@@ -53143,11 +54228,11 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.DedicatedWorkerGlobalScope.messageEvent.forTarget(this);
@@ -53215,11 +54300,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.queryUsageAndQuota](storageType, usageCallback, errorCallback) {
-      return this.queryUsageAndQuota(storageType, usageCallback, errorCallback);
+    [dartx.queryUsageAndQuota](...args) {
+      return this.queryUsageAndQuota.apply(this, args);
     }
-    [dartx.requestQuota](storageType, newQuotaInBytes, quotaCallback, errorCallback) {
-      return this.requestQuota(storageType, newQuotaInBytes, quotaCallback, errorCallback);
+    [dartx.requestQuota](...args) {
+      return this.requestQuota.apply(this, args);
     }
   };
   dart.setSignature(html$.DeprecatedStorageInfo, {
@@ -53244,11 +54329,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.queryUsageAndQuota](usageCallback, errorCallback) {
-      return this.queryUsageAndQuota(usageCallback, errorCallback);
+    [dartx.queryUsageAndQuota](...args) {
+      return this.queryUsageAndQuota.apply(this, args);
     }
-    [dartx.requestQuota](newQuotaInBytes, quotaCallback, errorCallback) {
-      return this.requestQuota(newQuotaInBytes, quotaCallback, errorCallback);
+    [dartx.requestQuota](...args) {
+      return this.requestQuota.apply(this, args);
     }
   };
   dart.setSignature(html$.DeprecatedStorageQuota, {
@@ -53383,8 +54468,8 @@
     get [dartx.rotationRate]() {
       return this.rotationRate;
     }
-    [dartx.initDeviceMotionEvent](type, bubbles, cancelable, acceleration, accelerationIncludingGravity, rotationRate, interval) {
-      return this.initDeviceMotionEvent(type, bubbles, cancelable, acceleration, accelerationIncludingGravity, rotationRate, interval);
+    [dartx.initDeviceMotionEvent](...args) {
+      return this.initDeviceMotionEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.DeviceMotionEvent, {
@@ -53432,8 +54517,8 @@
     get [dartx.gamma]() {
       return this.gamma;
     }
-    [_initDeviceOrientationEvent](type, bubbles, cancelable, alpha, beta, gamma, absolute) {
-      return this.initDeviceOrientationEvent(type, bubbles, cancelable, alpha, beta, gamma, absolute);
+    [_initDeviceOrientationEvent](...args) {
+      return this.initDeviceOrientationEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.DeviceOrientationEvent, {
@@ -53506,14 +54591,14 @@
     set [dartx.returnValue](value) {
       this.returnValue = value;
     }
-    [dartx.close](returnValue) {
-      return this.close(returnValue);
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.show]() {
-      return this.show();
+    [dartx.show](...args) {
+      return this.show.apply(this, args);
     }
-    [dartx.showModal]() {
-      return this.showModal();
+    [dartx.showModal](...args) {
+      return this.showModal.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.DialogElement, 'created');
@@ -53583,8 +54668,8 @@
     get [dartx.name]() {
       return this.name;
     }
-    [_copyTo](parent, opts) {
-      return this.copyTo(parent, opts);
+    [_copyTo](...args) {
+      return this.copyTo.apply(this, args);
     }
     [dartx.copyTo](parent, opts) {
       let name = opts && 'name' in opts ? opts.name : null;
@@ -53596,8 +54681,8 @@
         }, FileErrorTovoid())});
       return completer.future;
     }
-    [_getMetadata](successCallback, errorCallback) {
-      return this.getMetadata(successCallback, errorCallback);
+    [_getMetadata](...args) {
+      return this.getMetadata.apply(this, args);
     }
     [dartx.getMetadata]() {
       let completer = CompleterOfMetadata().new();
@@ -53608,8 +54693,8 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [_getParent](successCallback, errorCallback) {
-      return this.getParent(successCallback, errorCallback);
+    [_getParent](...args) {
+      return this.getParent.apply(this, args);
     }
     [dartx.getParent]() {
       let completer = CompleterOfEntry().new();
@@ -53620,8 +54705,8 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [_moveTo](parent, opts) {
-      return this.moveTo(parent, opts);
+    [_moveTo](...args) {
+      return this.moveTo.apply(this, args);
     }
     [dartx.moveTo](parent, opts) {
       let name = opts && 'name' in opts ? opts.name : null;
@@ -53633,8 +54718,8 @@
         }, FileErrorTovoid())});
       return completer.future;
     }
-    [_remove$](successCallback, errorCallback) {
-      return this.remove(successCallback, errorCallback);
+    [_remove$](...args) {
+      return this.remove.apply(this, args);
     }
     [dartx.remove]() {
       let completer = async.Completer.new();
@@ -53645,8 +54730,8 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [dartx.toUrl]() {
-      return this.toURL();
+    [dartx.toUrl](...args) {
+      return this.toURL.apply(this, args);
     }
   };
   dart.setSignature(html$.Entry, {
@@ -53699,8 +54784,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.createReader]() {
-      return this.createReader();
+    [dartx.createReader](...args) {
+      return this.createReader.apply(this, args);
     }
     [__getDirectory](path, opts) {
       let options = opts && 'options' in opts ? opts.options : null;
@@ -53724,17 +54809,17 @@
       this[__getDirectory_4](path);
       return;
     }
-    [__getDirectory_1](path, options, successCallback, errorCallback) {
-      return this.getDirectory(path, options, successCallback, errorCallback);
+    [__getDirectory_1](...args) {
+      return this.getDirectory.apply(this, args);
     }
-    [__getDirectory_2](path, options, successCallback) {
-      return this.getDirectory(path, options, successCallback);
+    [__getDirectory_2](...args) {
+      return this.getDirectory.apply(this, args);
     }
-    [__getDirectory_3](path, options) {
-      return this.getDirectory(path, options);
+    [__getDirectory_3](...args) {
+      return this.getDirectory.apply(this, args);
     }
-    [__getDirectory_4](path) {
-      return this.getDirectory(path);
+    [__getDirectory_4](...args) {
+      return this.getDirectory.apply(this, args);
     }
     [_getDirectory](path, opts) {
       let options = opts && 'options' in opts ? opts.options : null;
@@ -53768,17 +54853,17 @@
       this[__getFile_4](path);
       return;
     }
-    [__getFile_1](path, options, successCallback, errorCallback) {
-      return this.getFile(path, options, successCallback, errorCallback);
+    [__getFile_1](...args) {
+      return this.getFile.apply(this, args);
     }
-    [__getFile_2](path, options, successCallback) {
-      return this.getFile(path, options, successCallback);
+    [__getFile_2](...args) {
+      return this.getFile.apply(this, args);
     }
-    [__getFile_3](path, options) {
-      return this.getFile(path, options);
+    [__getFile_3](...args) {
+      return this.getFile.apply(this, args);
     }
-    [__getFile_4](path) {
-      return this.getFile(path);
+    [__getFile_4](...args) {
+      return this.getFile.apply(this, args);
     }
     [_getFile](path, opts) {
       let options = opts && 'options' in opts ? opts.options : null;
@@ -53790,8 +54875,8 @@
         }, FileErrorTovoid())});
       return completer.future;
     }
-    [_removeRecursively](successCallback, errorCallback) {
-      return this.removeRecursively(successCallback, errorCallback);
+    [_removeRecursively](...args) {
+      return this.removeRecursively.apply(this, args);
     }
     [dartx.removeRecursively]() {
       let completer = async.Completer.new();
@@ -53836,8 +54921,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [_readEntries](successCallback, errorCallback) {
-      return this.readEntries(successCallback, errorCallback);
+    [_readEntries](...args) {
+      return this.readEntries.apply(this, args);
     }
     [dartx.readEntries]() {
       let completer = CompleterOfListOfEntry().new();
@@ -54134,93 +55219,93 @@
     get [_webkitVisibilityState]() {
       return this.webkitVisibilityState;
     }
-    [dartx.adoptNode](node) {
-      return this.adoptNode(node);
+    [dartx.adoptNode](...args) {
+      return this.adoptNode.apply(this, args);
     }
-    [_caretRangeFromPoint](x, y) {
-      return this.caretRangeFromPoint(x, y);
+    [_caretRangeFromPoint](...args) {
+      return this.caretRangeFromPoint.apply(this, args);
     }
-    [dartx.createDocumentFragment]() {
-      return this.createDocumentFragment();
+    [dartx.createDocumentFragment](...args) {
+      return this.createDocumentFragment.apply(this, args);
     }
-    [_createElement](localName_OR_tagName, typeExtension) {
-      return this.createElement(localName_OR_tagName, typeExtension);
+    [_createElement](...args) {
+      return this.createElement.apply(this, args);
     }
-    [_createElementNS](namespaceURI, qualifiedName, typeExtension) {
-      return this.createElementNS(namespaceURI, qualifiedName, typeExtension);
+    [_createElementNS](...args) {
+      return this.createElementNS.apply(this, args);
     }
-    [_createEvent](eventType) {
-      return this.createEvent(eventType);
+    [_createEvent](...args) {
+      return this.createEvent.apply(this, args);
     }
-    [dartx.createRange]() {
-      return this.createRange();
+    [dartx.createRange](...args) {
+      return this.createRange.apply(this, args);
     }
-    [_createTextNode](data) {
-      return this.createTextNode(data);
+    [_createTextNode](...args) {
+      return this.createTextNode.apply(this, args);
     }
     [_createTouch](window, target, identifier, pageX, pageY, screenX, screenY, radiusX, radiusY, rotationAngle, force) {
       let target_1 = html$._convertDartToNative_EventTarget(target);
       return this[_createTouch_1](window, target_1, identifier, pageX, pageY, screenX, screenY, radiusX, radiusY, rotationAngle, force);
     }
-    [_createTouch_1](window, target, identifier, pageX, pageY, screenX, screenY, radiusX, radiusY, rotationAngle, force) {
-      return this.createTouch(window, target, identifier, pageX, pageY, screenX, screenY, radiusX, radiusY, rotationAngle, force);
+    [_createTouch_1](...args) {
+      return this.createTouch.apply(this, args);
     }
-    [_createTouchList](touches) {
-      return this.createTouchList(touches);
+    [_createTouchList](...args) {
+      return this.createTouchList.apply(this, args);
     }
-    [_elementFromPoint](x, y) {
-      return this.elementFromPoint(x, y);
+    [_elementFromPoint](...args) {
+      return this.elementFromPoint.apply(this, args);
     }
-    [dartx.elementsFromPoint](x, y) {
-      return this.elementsFromPoint(x, y);
+    [dartx.elementsFromPoint](...args) {
+      return this.elementsFromPoint.apply(this, args);
     }
-    [dartx.execCommand](commandId, showUI, value) {
-      return this.execCommand(commandId, showUI, value);
+    [dartx.execCommand](...args) {
+      return this.execCommand.apply(this, args);
     }
-    [dartx.exitFullscreen]() {
-      return this.exitFullscreen();
+    [dartx.exitFullscreen](...args) {
+      return this.exitFullscreen.apply(this, args);
     }
-    [dartx.exitPointerLock]() {
-      return this.exitPointerLock();
+    [dartx.exitPointerLock](...args) {
+      return this.exitPointerLock.apply(this, args);
     }
-    [_getCssCanvasContext](contextId, name, width, height) {
-      return this.getCSSCanvasContext(contextId, name, width, height);
+    [_getCssCanvasContext](...args) {
+      return this.getCSSCanvasContext.apply(this, args);
     }
-    [dartx.getElementsByClassName](classNames) {
-      return this.getElementsByClassName(classNames);
+    [dartx.getElementsByClassName](...args) {
+      return this.getElementsByClassName.apply(this, args);
     }
-    [dartx.getElementsByName](elementName) {
-      return this.getElementsByName(elementName);
+    [dartx.getElementsByName](...args) {
+      return this.getElementsByName.apply(this, args);
     }
-    [dartx.getElementsByTagName](localName) {
-      return this.getElementsByTagName(localName);
+    [dartx.getElementsByTagName](...args) {
+      return this.getElementsByTagName.apply(this, args);
     }
-    [dartx.importNode](node, deep) {
-      return this.importNode(node, deep);
+    [dartx.importNode](...args) {
+      return this.importNode.apply(this, args);
     }
-    [dartx.queryCommandEnabled](commandId) {
-      return this.queryCommandEnabled(commandId);
+    [dartx.queryCommandEnabled](...args) {
+      return this.queryCommandEnabled.apply(this, args);
     }
-    [dartx.queryCommandIndeterm](commandId) {
-      return this.queryCommandIndeterm(commandId);
+    [dartx.queryCommandIndeterm](...args) {
+      return this.queryCommandIndeterm.apply(this, args);
     }
-    [dartx.queryCommandState](commandId) {
-      return this.queryCommandState(commandId);
+    [dartx.queryCommandState](...args) {
+      return this.queryCommandState.apply(this, args);
     }
-    [dartx.queryCommandSupported](commandId) {
-      return this.queryCommandSupported(commandId);
+    [dartx.queryCommandSupported](...args) {
+      return this.queryCommandSupported.apply(this, args);
     }
-    [dartx.queryCommandValue](commandId) {
-      return this.queryCommandValue(commandId);
+    [dartx.queryCommandValue](...args) {
+      return this.queryCommandValue.apply(this, args);
     }
-    [dartx.transformDocumentToTreeView](noStyleMessage) {
-      return this.transformDocumentToTreeView(noStyleMessage);
+    [dartx.transformDocumentToTreeView](...args) {
+      return this.transformDocumentToTreeView.apply(this, args);
     }
-    [_webkitExitFullscreen]() {
-      return this.webkitExitFullscreen();
+    [_webkitExitFullscreen](...args) {
+      return this.webkitExitFullscreen.apply(this, args);
     }
-    [dartx.getElementById](elementId) {
-      return this.getElementById(elementId);
+    [dartx.getElementById](...args) {
+      return this.getElementById.apply(this, args);
     }
     get [_childElementCount]() {
       return this.childElementCount;
@@ -54234,11 +55319,11 @@
     get [_lastElementChild]() {
       return this.lastElementChild;
     }
-    [dartx.querySelector](selectors) {
-      return this.querySelector(selectors);
+    [dartx.querySelector](...args) {
+      return this.querySelector.apply(this, args);
     }
-    [_querySelectorAll](selectors) {
-      return this.querySelectorAll(selectors);
+    [_querySelectorAll](...args) {
+      return this.querySelectorAll.apply(this, args);
     }
     get [dartx.onAbort]() {
       return html$.Element.abortEvent.forTarget(this);
@@ -54773,8 +55858,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getElementById](elementId) {
-      return this.getElementById(elementId);
+    [dartx.getElementById](...args) {
+      return this.getElementById.apply(this, args);
     }
     get [_childElementCount]() {
       return this.childElementCount;
@@ -54785,11 +55870,11 @@
     get [_lastElementChild]() {
       return this.lastElementChild;
     }
-    [dartx.querySelector](selectors) {
-      return this.querySelector(selectors);
+    [dartx.querySelector](...args) {
+      return this.querySelector.apply(this, args);
     }
-    [_querySelectorAll](selectors) {
-      return this.querySelectorAll(selectors);
+    [_querySelectorAll](...args) {
+      return this.querySelectorAll.apply(this, args);
     }
   };
   html$.DocumentFragment[dart.implements] = () => [html$.NonElementParentNode, html$.ParentNode];
@@ -54954,17 +56039,17 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.createDocument](namespaceURI, qualifiedName, doctype) {
-      return this.createDocument(namespaceURI, qualifiedName, doctype);
+    [dartx.createDocument](...args) {
+      return this.createDocument.apply(this, args);
     }
-    [dartx.createDocumentType](qualifiedName, publicId, systemId) {
-      return this.createDocumentType(qualifiedName, publicId, systemId);
+    [dartx.createDocumentType](...args) {
+      return this.createDocumentType.apply(this, args);
     }
-    [dartx.createHtmlDocument](title) {
-      return this.createHTMLDocument(title);
+    [dartx.createHtmlDocument](...args) {
+      return this.createHTMLDocument.apply(this, args);
     }
-    [dartx.hasFeature]() {
-      return this.hasFeature();
+    [dartx.hasFeature](...args) {
+      return this.hasFeature.apply(this, args);
     }
   };
   dart.setSignature(html$.DomImplementation, {
@@ -54984,8 +56069,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.next](value) {
-      return this.next(value);
+    [dartx.next](...args) {
+      return this.next.apply(this, args);
     }
   };
   dart.setSignature(html$.DomIterator, {
@@ -55102,26 +56187,26 @@
     get [dartx.m44]() {
       return this.m44;
     }
-    [dartx.multiply](other) {
-      return this.multiply(other);
+    [dartx.multiply](...args) {
+      return this.multiply.apply(this, args);
     }
-    [dartx.scale](scale, originX, originY) {
-      return this.scale(scale, originX, originY);
+    [dartx.scale](...args) {
+      return this.scale.apply(this, args);
     }
-    [dartx.scale3d](scale, originX, originY, originZ) {
-      return this.scale3d(scale, originX, originY, originZ);
+    [dartx.scale3d](...args) {
+      return this.scale3d.apply(this, args);
     }
-    [dartx.scaleNonUniform](scaleX, scaleY, scaleZn, originX, originY, originZ) {
-      return this.scaleNonUniform(scaleX, scaleY, scaleZn, originX, originY, originZ);
+    [dartx.scaleNonUniform](...args) {
+      return this.scaleNonUniform.apply(this, args);
     }
-    [dartx.toFloat32Array]() {
-      return this.toFloat32Array();
+    [dartx.toFloat32Array](...args) {
+      return this.toFloat32Array.apply(this, args);
     }
-    [dartx.toFloat64Array]() {
-      return this.toFloat64Array();
+    [dartx.toFloat64Array](...args) {
+      return this.toFloat64Array.apply(this, args);
     }
-    [dartx.translate](tx, ty, tz) {
-      return this.translate(tx, ty, tz);
+    [dartx.translate](...args) {
+      return this.translate.apply(this, args);
     }
   };
   dart.setSignature(html$.DomMatrixReadOnly, {
@@ -55367,23 +56452,23 @@
     set [dartx.m44](value) {
       this.m44 = value;
     }
-    [dartx.multiplySelf](other) {
-      return this.multiplySelf(other);
+    [dartx.multiplySelf](...args) {
+      return this.multiplySelf.apply(this, args);
     }
-    [dartx.preMultiplySelf](other) {
-      return this.preMultiplySelf(other);
+    [dartx.preMultiplySelf](...args) {
+      return this.preMultiplySelf.apply(this, args);
     }
-    [dartx.scale3dSelf](scale, originX, originY, originZ) {
-      return this.scale3dSelf(scale, originX, originY, originZ);
+    [dartx.scale3dSelf](...args) {
+      return this.scale3dSelf.apply(this, args);
     }
-    [dartx.scaleNonUniformSelf](scaleX, scaleY, scaleZ, originX, originY, originZ) {
-      return this.scaleNonUniformSelf(scaleX, scaleY, scaleZ, originX, originY, originZ);
+    [dartx.scaleNonUniformSelf](...args) {
+      return this.scaleNonUniformSelf.apply(this, args);
     }
-    [dartx.scaleSelf](scale, originX, originY) {
-      return this.scaleSelf(scale, originX, originY);
+    [dartx.scaleSelf](...args) {
+      return this.scaleSelf.apply(this, args);
     }
-    [dartx.translateSelf](tx, ty, tz) {
-      return this.translateSelf(tx, ty, tz);
+    [dartx.translateSelf](...args) {
+      return this.translateSelf.apply(this, args);
     }
   };
   dart.setSignature(html$.DomMatrix, {
@@ -55443,8 +56528,8 @@
     static _create_1() {
       return new DOMParser();
     }
-    [dartx.parseFromString](str, type) {
-      return this.parseFromString(str, type);
+    [dartx.parseFromString](...args) {
+      return this.parseFromString.apply(this, args);
     }
   };
   dart.setSignature(html$.DomParser, {
@@ -55763,20 +56848,20 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.add](tokens) {
-      return this.add(tokens);
+    [dartx.add](...args) {
+      return this.add.apply(this, args);
     }
-    [dartx.contains](token) {
-      return this.contains(token);
+    [dartx.contains](...args) {
+      return this.contains.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.remove](tokens) {
-      return this.remove(tokens);
+    [dartx.remove](...args) {
+      return this.remove.apply(this, args);
     }
-    [dartx.toggle](token, force) {
-      return this.toggle(token, force);
+    [dartx.toggle](...args) {
+      return this.toggle.apply(this, args);
     }
   };
   dart.setSignature(html$.DomTokenList, {
@@ -55950,8 +57035,8 @@
   html$.ImmutableListMixin = ImmutableListMixin();
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -55966,11 +57051,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.item](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -55999,13 +57084,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__getter__](index) {
-      return this.__getter__(index);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$.DomStringList[dart.implements] = () => [ListOfString()];
@@ -56019,8 +57104,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.String, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, core.String]),
+      [dartx._get]: dart.definiteFunctionType(core.String, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, core.String]),
       [dartx.elementAt]: dart.definiteFunctionType(core.String, [core.int]),
       [__getter__]: dart.definiteFunctionType(core.String, [core.int]),
       [dartx.item]: dart.definiteFunctionType(core.String, [core.int])
@@ -56061,11 +57146,11 @@
     get length() {
       return this[_childElements][dartx.length];
     }
-    get(index) {
-      return html$.Element._check(this[_childElements][dartx.get](index));
+    _get(index) {
+      return html$.Element._check(this[_childElements][dartx._get](index));
     }
-    set(index, value) {
-      this[_element$][_replaceChild](value, this[_childElements][dartx.get](index));
+    _set(index, value) {
+      this[_element$][_replaceChild](value, this[_childElements][dartx._get](index));
       return value;
     }
     set length(newLength) {
@@ -56138,7 +57223,7 @@
       if (index == this.length) {
         this[_element$][dartx.append](element);
       } else {
-        this[_element$][dartx.insertBefore](element, this.get(index));
+        this[_element$][dartx.insertBefore](element, this._get(index));
       }
     }
     setAll(index, iterable) {
@@ -56148,7 +57233,7 @@
       this[_element$][_clearChildren]();
     }
     removeAt(index) {
-      let result = this.get(index);
+      let result = this._get(index);
       if (result != null) {
         this[_element$][_removeChild](result);
       }
@@ -56198,8 +57283,8 @@
     }),
     setters: () => ({length: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      get: dart.definiteFunctionType(html$.Element, [core.int]),
-      set: dart.definiteFunctionType(dart.void, [core.int, html$.Element]),
+      _get: dart.definiteFunctionType(html$.Element, [core.int]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, html$.Element]),
       add: dart.definiteFunctionType(html$.Element, [html$.Element]),
       addAll: dart.definiteFunctionType(dart.void, [IterableOfElement()]),
       sort: dart.definiteFunctionType(dart.void, [], [ElementAndElementToint()]),
@@ -56217,8 +57302,8 @@
   });
   dart.defineExtensionMembers(html$._ChildrenElementList, [
     'contains',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'add',
     'addAll',
     'sort',
@@ -56260,10 +57345,10 @@
       get length() {
         return this[_nodeList][dartx.length];
       }
-      get(index) {
-        return html$._downcast(html$.Node, E)(this[_nodeList][dartx.get](index));
+      _get(index) {
+        return html$._downcast(html$.Node, E)(this[_nodeList][dartx._get](index));
       }
-      set(index, value) {
+      _set(index, value) {
         E._check(value);
         dart.throw(new core.UnsupportedError('Cannot modify list'));
         return value;
@@ -56612,14 +57697,14 @@
         classes: dart.definiteFunctionType(dart.void, [IterableOfString()])
       }),
       methods: () => ({
-        get: dart.definiteFunctionType(E, [core.int]),
-        set: dart.definiteFunctionType(dart.void, [core.int, E]),
+        _get: dart.definiteFunctionType(E, [core.int]),
+        _set: dart.definiteFunctionType(dart.void, [core.int, E]),
         sort: dart.definiteFunctionType(dart.void, [], [ComparatorOfE()])
       })
     });
     dart.defineExtensionMembers(_FrozenElementList, [
-      'get',
-      'set',
+      '_get',
+      '_set',
       'sort',
       'shuffle',
       'length',
@@ -56643,19 +57728,19 @@
     statics: () => ({createElement_tag: dart.definiteFunctionType(dart.dynamic, [core.String, core.String])}),
     names: ['createElement_tag']
   });
-  const _value$0 = Symbol('_value');
+  const _value$1 = Symbol('_value');
   html$.ScrollAlignment = class ScrollAlignment extends core.Object {
     _internal(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
     }
     toString() {
-      return dart.str`ScrollAlignment.${this[_value$0]}`;
+      return dart.str`ScrollAlignment.${this[_value$1]}`;
     }
   };
   dart.defineNamedConstructor(html$.ScrollAlignment, '_internal');
   dart.setSignature(html$.ScrollAlignment, {
     constructors: () => ({_internal: dart.definiteFunctionType(html$.ScrollAlignment, [dart.dynamic])}),
-    fields: () => ({[_value$0]: dart.dynamic}),
+    fields: () => ({[_value$1]: dart.dynamic}),
     sfields: () => ({
       TOP: html$.ScrollAlignment,
       CENTER: html$.ScrollAlignment,
@@ -56729,11 +57814,11 @@
     set [dartx.width](value) {
       this.width = value;
     }
-    [__getter__](index_OR_name) {
-      return this.__getter__(index_OR_name);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [__setter__](index_OR_name, value) {
-      return this.__setter__(index_OR_name, value);
+    [__setter__](...args) {
+      return this.__setter__.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.EmbedElement, 'created');
@@ -56861,8 +57946,8 @@
     get [dartx.withCredentials]() {
       return this.withCredentials;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
     get [dartx.onError]() {
       return html$.EventSource.errorEvent.forTarget(this);
@@ -56925,23 +58010,23 @@
     new(ptr) {
       this[_ptr] = ptr;
     }
-    get(type) {
+    _get(type) {
       return new (_EventStreamOfEvent())(this[_ptr], type, false);
     }
   };
   dart.setSignature(html$.Events, {
     constructors: () => ({new: dart.definiteFunctionType(html$.Events, [html$.EventTarget])}),
     fields: () => ({[_ptr]: html$.EventTarget}),
-    methods: () => ({get: dart.definiteFunctionType(async.Stream, [core.String])})
+    methods: () => ({_get: dart.definiteFunctionType(async.Stream, [core.String])})
   });
   html$.ElementEvents = class ElementEvents extends html$.Events {
     new(ptr) {
       super.new(ptr);
     }
-    get(type) {
+    _get(type) {
       if (dart.test(html$.ElementEvents.webkitEvents[dartx.keys][dartx.contains](type[dartx.toLowerCase]()))) {
         if (dart.test(html_common.Device.isWebKit)) {
-          return new (_ElementEventStreamImplOfEvent())(this[_ptr], html$.ElementEvents.webkitEvents[dartx.get](type[dartx.toLowerCase]()), false);
+          return new (_ElementEventStreamImplOfEvent())(this[_ptr], html$.ElementEvents.webkitEvents[dartx._get](type[dartx.toLowerCase]()), false);
         }
       }
       return new (_ElementEventStreamImplOfEvent())(this[_ptr], type, false);
@@ -56977,8 +58062,8 @@
     static _create_2(type) {
       return new ExtendableEvent(type);
     }
-    [dartx.waitUntil](value) {
-      return this.waitUntil(value);
+    [dartx.waitUntil](...args) {
+      return this.waitUntil.apply(this, args);
     }
   };
   dart.setSignature(html$.ExtendableEvent, {
@@ -57058,8 +58143,8 @@
     get [dartx.request]() {
       return this.request;
     }
-    [dartx.respondWith](value) {
-      return this.respondWith(value);
+    [dartx.respondWith](...args) {
+      return this.respondWith.apply(this, args);
     }
   };
   dart.setSignature(html$.FetchEvent, {
@@ -57140,14 +58225,14 @@
     get [dartx.willValidate]() {
       return this.willValidate;
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.FieldSetElement, 'created');
@@ -57245,8 +58330,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [_createWriter](successCallback, errorCallback) {
-      return this.createWriter(successCallback, errorCallback);
+    [_createWriter](...args) {
+      return this.createWriter.apply(this, args);
     }
     [dartx.createWriter]() {
       let completer = CompleterOfFileWriter().new();
@@ -57257,8 +58342,8 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [_file](successCallback, errorCallback) {
-      return this.file(successCallback, errorCallback);
+    [_file](...args) {
+      return this.file.apply(this, args);
     }
     [dartx.file]() {
       let completer = CompleterOfFile().new();
@@ -57324,8 +58409,8 @@
   dart.registerExtension(dart.global.FileError, html$.FileError);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -57340,11 +58425,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -57373,10 +58458,10 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$.FileList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfFile()];
@@ -57390,8 +58475,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.File, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.File]),
+      [dartx._get]: dart.definiteFunctionType(html$.File, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.File]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.File, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.File, [core.int])
     })
@@ -57435,17 +58520,17 @@
     get [dartx.readyState]() {
       return this.readyState;
     }
-    [dartx.abort]() {
-      return this.abort();
+    [dartx.abort](...args) {
+      return this.abort.apply(this, args);
     }
-    [dartx.readAsArrayBuffer](blob) {
-      return this.readAsArrayBuffer(blob);
+    [dartx.readAsArrayBuffer](...args) {
+      return this.readAsArrayBuffer.apply(this, args);
     }
-    [dartx.readAsDataUrl](blob) {
-      return this.readAsDataURL(blob);
+    [dartx.readAsDataUrl](...args) {
+      return this.readAsDataURL.apply(this, args);
     }
-    [dartx.readAsText](blob, label) {
-      return this.readAsText(blob, label);
+    [dartx.readAsText](...args) {
+      return this.readAsText.apply(this, args);
     }
     get [dartx.onAbort]() {
       return html$.FileReader.abortEvent.forTarget(this);
@@ -57604,17 +58689,17 @@
     get [dartx.readyState]() {
       return this.readyState;
     }
-    [dartx.abort]() {
-      return this.abort();
+    [dartx.abort](...args) {
+      return this.abort.apply(this, args);
     }
-    [dartx.seek](position) {
-      return this.seek(position);
+    [dartx.seek](...args) {
+      return this.seek.apply(this, args);
     }
-    [dartx.truncate](size) {
-      return this.truncate(size);
+    [dartx.truncate](...args) {
+      return this.truncate.apply(this, args);
     }
-    [dartx.write](data) {
-      return this.write(data);
+    [dartx.write](...args) {
+      return this.write.apply(this, args);
     }
     get [dartx.onAbort]() {
       return html$.FileWriter.abortEvent.forTarget(this);
@@ -57815,8 +58900,8 @@
     set [dartx.weight](value) {
       this.weight = value;
     }
-    [dartx.load]() {
-      return this.load();
+    [dartx.load](...args) {
+      return this.load.apply(this, args);
     }
   };
   dart.setSignature(html$.FontFace, {
@@ -57863,23 +58948,23 @@
     get [dartx.status]() {
       return this.status;
     }
-    [dartx.add](fontFace) {
-      return this.add(fontFace);
+    [dartx.add](...args) {
+      return this.add.apply(this, args);
     }
-    [dartx.check](font, text) {
-      return this.check(font, text);
+    [dartx.check](...args) {
+      return this.check.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.delete](fontFace) {
-      return this.delete(fontFace);
+    [dartx.delete](...args) {
+      return this.delete.apply(this, args);
     }
-    [dartx.forEach](callback, thisArg) {
-      return this.forEach(callback, thisArg);
+    [dartx.forEach](...args) {
+      return this.forEach.apply(this, args);
     }
-    [dartx.has](fontFace) {
-      return this.has(fontFace);
+    [dartx.has](...args) {
+      return this.has.apply(this, args);
     }
   };
   dart.setSignature(html$.FontFaceSet, {
@@ -57944,26 +59029,26 @@
     static get supported() {
       return !!window.FormData;
     }
-    [dartx.append](name, value) {
-      return this.append(name, value);
+    [dartx.append](...args) {
+      return this.append.apply(this, args);
     }
-    [dartx.appendBlob](name, value, filename) {
-      return this.append(name, value, filename);
+    [dartx.appendBlob](...args) {
+      return this.append.apply(this, args);
     }
-    [dartx.delete](name) {
-      return this.delete(name);
+    [dartx.delete](...args) {
+      return this.delete.apply(this, args);
     }
-    [dartx.get](name) {
-      return this.get(name);
+    [dartx.get](...args) {
+      return this.get.apply(this, args);
     }
-    [dartx.getAll](name) {
-      return this.getAll(name);
+    [dartx.getAll](...args) {
+      return this.getAll.apply(this, args);
     }
-    [dartx.has](name) {
-      return this.has(name);
+    [dartx.has](...args) {
+      return this.has.apply(this, args);
     }
-    [dartx.set](name, value, filename) {
-      return this.set(name, value, filename);
+    [dartx.set](...args) {
+      return this.set.apply(this, args);
     }
   };
   dart.setSignature(html$.FormData, {
@@ -58084,31 +59169,31 @@
     set [dartx.target](value) {
       this.target = value;
     }
-    [__getter__](name) {
-      return this.__getter__(name);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
     [dartx.requestAutocomplete](details) {
       let details_1 = html_common.convertDartToNative_Dictionary(details);
       this[_requestAutocomplete_1](details_1);
       return;
     }
-    [_requestAutocomplete_1](details) {
-      return this.requestAutocomplete(details);
+    [_requestAutocomplete_1](...args) {
+      return this.requestAutocomplete.apply(this, args);
     }
-    [dartx.reset]() {
-      return this.reset();
+    [dartx.reset](...args) {
+      return this.reset.apply(this, args);
     }
-    [dartx.submit]() {
-      return this.submit();
+    [dartx.submit](...args) {
+      return this.submit.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.FormElement, 'created');
@@ -58261,14 +59346,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getRegisteredRegions]() {
-      return this.getRegisteredRegions();
+    [dartx.getRegisteredRegions](...args) {
+      return this.getRegisteredRegions.apply(this, args);
     }
-    [dartx.registerRegion](region) {
-      return this.registerRegion(region);
+    [dartx.registerRegion](...args) {
+      return this.registerRegion.apply(this, args);
     }
-    [dartx.unregisterRegion](regionId) {
-      return this.unregisterRegion(regionId);
+    [dartx.unregisterRegion](...args) {
+      return this.unregisterRegion.apply(this, args);
     }
   };
   dart.setSignature(html$.Geofencing, {
@@ -58324,13 +59409,13 @@
       let maximumAge = opts && 'maximumAge' in opts ? opts.maximumAge : null;
       let options = dart.map();
       if (enableHighAccuracy != null) {
-        options[dartx.set]('enableHighAccuracy', enableHighAccuracy);
+        options[dartx._set]('enableHighAccuracy', enableHighAccuracy);
       }
       if (timeout != null) {
-        options[dartx.set]('timeout', timeout.inMilliseconds);
+        options[dartx._set]('timeout', timeout.inMilliseconds);
       }
       if (maximumAge != null) {
-        options[dartx.set]('maximumAge', maximumAge.inMilliseconds);
+        options[dartx._set]('maximumAge', maximumAge.inMilliseconds);
       }
       let completer = CompleterOfGeoposition().new();
       try {
@@ -58352,13 +59437,13 @@
       let maximumAge = opts && 'maximumAge' in opts ? opts.maximumAge : null;
       let options = dart.map();
       if (enableHighAccuracy != null) {
-        options[dartx.set]('enableHighAccuracy', enableHighAccuracy);
+        options[dartx._set]('enableHighAccuracy', enableHighAccuracy);
       }
       if (timeout != null) {
-        options[dartx.set]('timeout', timeout.inMilliseconds);
+        options[dartx._set]('timeout', timeout.inMilliseconds);
       }
       if (maximumAge != null) {
-        options[dartx.set]('maximumAge', maximumAge.inMilliseconds);
+        options[dartx._set]('maximumAge', maximumAge.inMilliseconds);
       }
       let watchId = null;
       let controller = null;
@@ -58388,8 +59473,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [_clearWatch](watchID) {
-      return this.clearWatch(watchID);
+    [_clearWatch](...args) {
+      return this.clearWatch.apply(this, args);
     }
     [_getCurrentPosition](successCallback, errorCallback, options) {
       if (errorCallback === void 0) errorCallback = null;
@@ -58406,14 +59491,14 @@
       this[_getCurrentPosition_3](successCallback);
       return;
     }
-    [_getCurrentPosition_1](successCallback, errorCallback, options) {
-      return this.getCurrentPosition(successCallback, errorCallback, options);
+    [_getCurrentPosition_1](...args) {
+      return this.getCurrentPosition.apply(this, args);
     }
-    [_getCurrentPosition_2](successCallback, errorCallback) {
-      return this.getCurrentPosition(successCallback, errorCallback);
+    [_getCurrentPosition_2](...args) {
+      return this.getCurrentPosition.apply(this, args);
     }
-    [_getCurrentPosition_3](successCallback) {
-      return this.getCurrentPosition(successCallback);
+    [_getCurrentPosition_3](...args) {
+      return this.getCurrentPosition.apply(this, args);
     }
     [_watchPosition](successCallback, errorCallback, options) {
       if (errorCallback === void 0) errorCallback = null;
@@ -58427,14 +59512,14 @@
       }
       return this[_watchPosition_3](successCallback);
     }
-    [_watchPosition_1](successCallback, errorCallback, options) {
-      return this.watchPosition(successCallback, errorCallback, options);
+    [_watchPosition_1](...args) {
+      return this.watchPosition.apply(this, args);
     }
-    [_watchPosition_2](successCallback, errorCallback) {
-      return this.watchPosition(successCallback, errorCallback);
+    [_watchPosition_2](...args) {
+      return this.watchPosition.apply(this, args);
     }
-    [_watchPosition_3](successCallback) {
-      return this.watchPosition(successCallback);
+    [_watchPosition_3](...args) {
+      return this.watchPosition.apply(this, args);
     }
   };
   dart.setSignature(html$.Geolocation, {
@@ -59105,8 +60190,8 @@
     get [dartx.oldUrl]() {
       return this.oldURL;
     }
-    [_initHashChangeEvent](type, canBubble, cancelable, oldURL, newURL) {
-      return this.initHashChangeEvent(type, canBubble, cancelable, oldURL, newURL);
+    [_initHashChangeEvent](...args) {
+      return this.initHashChangeEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.HashChangeEvent, {
@@ -59273,14 +60358,14 @@
     get [_get_state]() {
       return this.state;
     }
-    [dartx.back]() {
-      return this.back();
+    [dartx.back](...args) {
+      return this.back.apply(this, args);
     }
-    [dartx.forward]() {
-      return this.forward();
+    [dartx.forward](...args) {
+      return this.forward.apply(this, args);
     }
-    [dartx.go](delta) {
-      return this.go(delta);
+    [dartx.go](...args) {
+      return this.go.apply(this, args);
     }
     [dartx.pushState](data, title, url, options) {
       if (options === void 0) options = null;
@@ -59294,11 +60379,11 @@
       this[_pushState_2](data_1, title, url);
       return;
     }
-    [_pushState_1](data, title, url, options) {
-      return this.pushState(data, title, url, options);
+    [_pushState_1](...args) {
+      return this.pushState.apply(this, args);
     }
-    [_pushState_2](data, title, url) {
-      return this.pushState(data, title, url);
+    [_pushState_2](...args) {
+      return this.pushState.apply(this, args);
     }
     [dartx.replaceState](data, title, url, options) {
       if (options === void 0) options = null;
@@ -59312,11 +60397,11 @@
       this[_replaceState_2](data_1, title, url);
       return;
     }
-    [_replaceState_1](data, title, url, options) {
-      return this.replaceState(data, title, url, options);
+    [_replaceState_1](...args) {
+      return this.replaceState.apply(this, args);
     }
-    [_replaceState_2](data, title, url) {
-      return this.replaceState(data, title, url);
+    [_replaceState_2](...args) {
+      return this.replaceState.apply(this, args);
     }
   };
   html$.History[dart.implements] = () => [html$.HistoryBase];
@@ -59381,11 +60466,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getEyeParameters](whichEye) {
-      return this.getEyeParameters(whichEye);
+    [dartx.getEyeParameters](...args) {
+      return this.getEyeParameters.apply(this, args);
     }
-    [dartx.setFieldOfView](leftFov, rightFov) {
-      return this.setFieldOfView(leftFov, rightFov);
+    [dartx.setFieldOfView](...args) {
+      return this.setFieldOfView.apply(this, args);
     }
   };
   dart.setSignature(html$.HmdvrDevice, {
@@ -59398,8 +60483,8 @@
   dart.registerExtension(dart.global.HMDVRDevice, html$.HmdvrDevice);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -59415,11 +60500,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -59448,13 +60533,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.namedItem](name) {
-      return this.namedItem(name);
+    [dartx.namedItem](...args) {
+      return this.namedItem.apply(this, args);
     }
   };
   html$.HtmlCollection[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfNode()];
@@ -59468,8 +60553,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.Node, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
+      [dartx._get]: dart.definiteFunctionType(html$.Node, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.Node, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.Node, [core.int]),
       [dartx.namedItem]: dart.definiteFunctionType(core.Object, [core.String])
@@ -59620,11 +60705,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.namedItem](name) {
-      return this.namedItem(name);
+    [dartx.namedItem](...args) {
+      return this.namedItem.apply(this, args);
     }
   };
   dart.setSignature(html$.HtmlFormControlsCollection, {
@@ -59656,8 +60741,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [_item](index) {
-      return this.item(index);
+    [_item](...args) {
+      return this.item.apply(this, args);
     }
   };
   dart.setSignature(html$.HtmlOptionsCollection, {
@@ -59903,15 +60988,15 @@
         let key = header[dartx.substring](0, splitIdx)[dartx.toLowerCase]();
         let value = header[dartx.substring](dart.notNull(splitIdx) + 2);
         if (dart.test(headers[dartx.containsKey](key))) {
-          headers[dartx.set](key, dart.str`${headers[dartx.get](key)}, ${value}`);
+          headers[dartx._set](key, dart.str`${headers[dartx._get](key)}, ${value}`);
         } else {
-          headers[dartx.set](key, value);
+          headers[dartx._set](key, value);
         }
       }
       return headers;
     }
-    [dartx.open](method, url, opts) {
-      return this.open(method, url, opts);
+    [dartx.open](...args) {
+      return this.open.apply(this, args);
     }
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
@@ -59967,23 +61052,23 @@
     set [dartx.withCredentials](value) {
       this.withCredentials = value;
     }
-    [dartx.abort]() {
-      return this.abort();
+    [dartx.abort](...args) {
+      return this.abort.apply(this, args);
     }
-    [dartx.getAllResponseHeaders]() {
-      return this.getAllResponseHeaders();
+    [dartx.getAllResponseHeaders](...args) {
+      return this.getAllResponseHeaders.apply(this, args);
     }
-    [dartx.getResponseHeader](name) {
-      return this.getResponseHeader(name);
+    [dartx.getResponseHeader](...args) {
+      return this.getResponseHeader.apply(this, args);
     }
-    [dartx.overrideMimeType](mime) {
-      return this.overrideMimeType(mime);
+    [dartx.overrideMimeType](...args) {
+      return this.overrideMimeType.apply(this, args);
     }
-    [dartx.send](body_OR_data) {
-      return this.send(body_OR_data);
+    [dartx.send](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.setRequestHeader](name, value) {
-      return this.setRequestHeader(name, value);
+    [dartx.setRequestHeader](...args) {
+      return this.setRequestHeader.apply(this, args);
     }
     get [dartx.onReadyStateChange]() {
       return html$.HttpRequest.readyStateChangeEvent.forTarget(this);
@@ -60385,8 +61470,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.inspect](objectId, hints) {
-      return this.inspect(objectId, hints);
+    [dartx.inspect](...args) {
+      return this.inspect.apply(this, args);
     }
   };
   dart.setSignature(html$.InjectedScriptHost, {
@@ -60849,29 +61934,29 @@
     get [dartx.willValidate]() {
       return this.willValidate;
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.select]() {
-      return this.select();
+    [dartx.select](...args) {
+      return this.select.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
-    [dartx.setRangeText](replacement, opts) {
-      return this.setRangeText(replacement, opts);
+    [dartx.setRangeText](...args) {
+      return this.setRangeText.apply(this, args);
     }
-    [dartx.setSelectionRange](start, end, direction) {
-      return this.setSelectionRange(start, end, direction);
+    [dartx.setSelectionRange](...args) {
+      return this.setSelectionRange.apply(this, args);
     }
-    [dartx.stepDown](n) {
-      return this.stepDown(n);
+    [dartx.stepDown](...args) {
+      return this.stepDown.apply(this, args);
     }
-    [dartx.stepUp](n) {
-      return this.stepUp(n);
+    [dartx.stepUp](...args) {
+      return this.stepUp.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.InputElement, 'created');
@@ -60961,14 +62046,56 @@
   ]);
   html$.InputElementBase = class InputElementBase extends core.Object {
     new() {
-      this[dartx.autofocus] = null;
-      this[dartx.disabled] = null;
-      this[dartx.incremental] = null;
-      this[dartx.indeterminate] = null;
-      this[dartx.name] = null;
-      this[dartx.value] = null;
+      this[autofocus] = null;
+      this[disabled] = null;
+      this[incremental] = null;
+      this[indeterminate] = null;
+      this[name] = null;
+      this[value$] = null;
+    }
+    get autofocus() {
+      return this[autofocus];
+    }
+    set autofocus(value) {
+      this[autofocus] = value;
+    }
+    get disabled() {
+      return this[disabled];
+    }
+    set disabled(value) {
+      this[disabled] = value;
+    }
+    get incremental() {
+      return this[incremental];
+    }
+    set incremental(value) {
+      this[incremental] = value;
+    }
+    get indeterminate() {
+      return this[indeterminate];
+    }
+    set indeterminate(value) {
+      this[indeterminate] = value;
+    }
+    get name() {
+      return this[name];
+    }
+    set name(value) {
+      this[name] = value;
+    }
+    get value() {
+      return this[value$];
+    }
+    set value(value) {
+      this[value$] = value;
     }
   };
+  const autofocus = Symbol(html$.InputElementBase.name + "." + 'autofocus'.toString());
+  const disabled = Symbol(html$.InputElementBase.name + "." + 'disabled'.toString());
+  const incremental = Symbol(html$.InputElementBase.name + "." + 'incremental'.toString());
+  const indeterminate = Symbol(html$.InputElementBase.name + "." + 'indeterminate'.toString());
+  const name = Symbol(html$.InputElementBase.name + "." + 'name'.toString());
+  const value$ = Symbol(html$.InputElementBase.name + "." + 'value'.toString());
   html$.InputElementBase[dart.implements] = () => [html$.Element];
   dart.setSignature(html$.InputElementBase, {
     fields: () => ({
@@ -61017,18 +62144,88 @@
   ]);
   html$.TextInputElementBase = class TextInputElementBase extends core.Object {
     new() {
-      this[dartx.autocomplete] = null;
-      this[dartx.maxLength] = null;
-      this[dartx.pattern] = null;
-      this[dartx.placeholder] = null;
-      this[dartx.readOnly] = null;
-      this[dartx.required] = null;
-      this[dartx.size] = null;
-      this[dartx.selectionDirection] = null;
-      this[dartx.selectionEnd] = null;
-      this[dartx.selectionStart] = null;
+      this[autocomplete] = null;
+      this[maxLength] = null;
+      this[pattern] = null;
+      this[placeholder] = null;
+      this[readOnly] = null;
+      this[required] = null;
+      this[size] = null;
+      this[selectionDirection] = null;
+      this[selectionEnd] = null;
+      this[selectionStart] = null;
+    }
+    get autocomplete() {
+      return this[autocomplete];
+    }
+    set autocomplete(value) {
+      this[autocomplete] = value;
+    }
+    get maxLength() {
+      return this[maxLength];
+    }
+    set maxLength(value) {
+      this[maxLength] = value;
+    }
+    get pattern() {
+      return this[pattern];
+    }
+    set pattern(value) {
+      this[pattern] = value;
+    }
+    get placeholder() {
+      return this[placeholder];
+    }
+    set placeholder(value) {
+      this[placeholder] = value;
+    }
+    get readOnly() {
+      return this[readOnly];
+    }
+    set readOnly(value) {
+      this[readOnly] = value;
+    }
+    get required() {
+      return this[required];
+    }
+    set required(value) {
+      this[required] = value;
+    }
+    get size() {
+      return this[size];
+    }
+    set size(value) {
+      this[size] = value;
+    }
+    get selectionDirection() {
+      return this[selectionDirection];
+    }
+    set selectionDirection(value) {
+      this[selectionDirection] = value;
+    }
+    get selectionEnd() {
+      return this[selectionEnd];
+    }
+    set selectionEnd(value) {
+      this[selectionEnd] = value;
+    }
+    get selectionStart() {
+      return this[selectionStart];
+    }
+    set selectionStart(value) {
+      this[selectionStart] = value;
     }
   };
+  const autocomplete = Symbol(html$.TextInputElementBase.name + "." + 'autocomplete'.toString());
+  const maxLength = Symbol(html$.TextInputElementBase.name + "." + 'maxLength'.toString());
+  const pattern = Symbol(html$.TextInputElementBase.name + "." + 'pattern'.toString());
+  const placeholder = Symbol(html$.TextInputElementBase.name + "." + 'placeholder'.toString());
+  const readOnly = Symbol(html$.TextInputElementBase.name + "." + 'readOnly'.toString());
+  const required = Symbol(html$.TextInputElementBase.name + "." + 'required'.toString());
+  const size = Symbol(html$.TextInputElementBase.name + "." + 'size'.toString());
+  const selectionDirection = Symbol(html$.TextInputElementBase.name + "." + 'selectionDirection'.toString());
+  const selectionEnd = Symbol(html$.TextInputElementBase.name + "." + 'selectionEnd'.toString());
+  const selectionStart = Symbol(html$.TextInputElementBase.name + "." + 'selectionStart'.toString());
   html$.TextInputElementBase[dart.implements] = () => [html$.InputElementBase];
   dart.setSignature(html$.TextInputElementBase, {
     fields: () => ({
@@ -61073,10 +62270,17 @@
     static new() {
       return html$.InputElement.new({type: 'search'});
     }
+    get dirName() {
+      return this[dirName];
+    }
+    set dirName(value) {
+      this[dirName] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'search'})[dartx.type] == 'search';
     }
   };
+  const dirName = Symbol(html$.SearchInputElement.name + "." + 'dirName'.toString());
   html$.SearchInputElement[dart.implements] = () => [html$.TextInputElementBase];
   dart.setSignature(html$.SearchInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.SearchInputElement, [])}),
@@ -61091,7 +62295,14 @@
     static new() {
       return html$.InputElement.new({type: 'text'});
     }
+    get dirName() {
+      return this[dirName$];
+    }
+    set dirName(value) {
+      this[dirName$] = value;
+    }
   };
+  const dirName$ = Symbol(html$.TextInputElement.name + "." + 'dirName'.toString());
   html$.TextInputElement[dart.implements] = () => [html$.TextInputElementBase];
   dart.setSignature(html$.TextInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.TextInputElement, [])}),
@@ -61139,10 +62350,73 @@
     static new() {
       return html$.InputElement.new({type: 'email'});
     }
+    get autocomplete() {
+      return this[autocomplete$];
+    }
+    set autocomplete(value) {
+      this[autocomplete$] = value;
+    }
+    get autofocus() {
+      return this[autofocus$];
+    }
+    set autofocus(value) {
+      this[autofocus$] = value;
+    }
+    get maxLength() {
+      return this[maxLength$];
+    }
+    set maxLength(value) {
+      this[maxLength$] = value;
+    }
+    get multiple() {
+      return this[multiple];
+    }
+    set multiple(value) {
+      this[multiple] = value;
+    }
+    get pattern() {
+      return this[pattern$];
+    }
+    set pattern(value) {
+      this[pattern$] = value;
+    }
+    get placeholder() {
+      return this[placeholder$];
+    }
+    set placeholder(value) {
+      this[placeholder$] = value;
+    }
+    get readOnly() {
+      return this[readOnly$];
+    }
+    set readOnly(value) {
+      this[readOnly$] = value;
+    }
+    get required() {
+      return this[required$];
+    }
+    set required(value) {
+      this[required$] = value;
+    }
+    get size() {
+      return this[size$];
+    }
+    set size(value) {
+      this[size$] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'email'})[dartx.type] == 'email';
     }
   };
+  const autocomplete$ = Symbol(html$.EmailInputElement.name + "." + 'autocomplete'.toString());
+  const autofocus$ = Symbol(html$.EmailInputElement.name + "." + 'autofocus'.toString());
+  const maxLength$ = Symbol(html$.EmailInputElement.name + "." + 'maxLength'.toString());
+  const multiple = Symbol(html$.EmailInputElement.name + "." + 'multiple'.toString());
+  const pattern$ = Symbol(html$.EmailInputElement.name + "." + 'pattern'.toString());
+  const placeholder$ = Symbol(html$.EmailInputElement.name + "." + 'placeholder'.toString());
+  const readOnly$ = Symbol(html$.EmailInputElement.name + "." + 'readOnly'.toString());
+  const required$ = Symbol(html$.EmailInputElement.name + "." + 'required'.toString());
+  const size$ = Symbol(html$.EmailInputElement.name + "." + 'size'.toString());
   html$.EmailInputElement[dart.implements] = () => [html$.TextInputElementBase];
   dart.setSignature(html$.EmailInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.EmailInputElement, [])}),
@@ -61196,12 +62470,40 @@
   ]);
   html$.RangeInputElementBase = class RangeInputElementBase extends core.Object {
     new() {
-      this[dartx.max] = null;
-      this[dartx.min] = null;
-      this[dartx.step] = null;
-      this[dartx.valueAsNumber] = null;
+      this[max] = null;
+      this[min] = null;
+      this[step] = null;
+      this[valueAsNumber] = null;
+    }
+    get max() {
+      return this[max];
+    }
+    set max(value) {
+      this[max] = value;
+    }
+    get min() {
+      return this[min];
+    }
+    set min(value) {
+      this[min] = value;
+    }
+    get step() {
+      return this[step];
+    }
+    set step(value) {
+      this[step] = value;
+    }
+    get valueAsNumber() {
+      return this[valueAsNumber];
+    }
+    set valueAsNumber(value) {
+      this[valueAsNumber] = value;
     }
   };
+  const max = Symbol(html$.RangeInputElementBase.name + "." + 'max'.toString());
+  const min = Symbol(html$.RangeInputElementBase.name + "." + 'min'.toString());
+  const step = Symbol(html$.RangeInputElementBase.name + "." + 'step'.toString());
+  const valueAsNumber = Symbol(html$.RangeInputElementBase.name + "." + 'valueAsNumber'.toString());
   html$.RangeInputElementBase[dart.implements] = () => [html$.InputElementBase];
   dart.setSignature(html$.RangeInputElementBase, {
     fields: () => ({
@@ -61230,10 +62532,31 @@
     static new() {
       return html$.InputElement.new({type: 'date'});
     }
+    get valueAsDate() {
+      return this[valueAsDate];
+    }
+    set valueAsDate(value) {
+      this[valueAsDate] = value;
+    }
+    get readOnly() {
+      return this[readOnly$0];
+    }
+    set readOnly(value) {
+      this[readOnly$0] = value;
+    }
+    get required() {
+      return this[required$0];
+    }
+    set required(value) {
+      this[required$0] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'date'})[dartx.type] == 'date';
     }
   };
+  const valueAsDate = Symbol(html$.DateInputElement.name + "." + 'valueAsDate'.toString());
+  const readOnly$0 = Symbol(html$.DateInputElement.name + "." + 'readOnly'.toString());
+  const required$0 = Symbol(html$.DateInputElement.name + "." + 'required'.toString());
   html$.DateInputElement[dart.implements] = () => [html$.RangeInputElementBase];
   dart.setSignature(html$.DateInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.DateInputElement, [])}),
@@ -61261,10 +62584,31 @@
     static new() {
       return html$.InputElement.new({type: 'month'});
     }
+    get valueAsDate() {
+      return this[valueAsDate$];
+    }
+    set valueAsDate(value) {
+      this[valueAsDate$] = value;
+    }
+    get readOnly() {
+      return this[readOnly$1];
+    }
+    set readOnly(value) {
+      this[readOnly$1] = value;
+    }
+    get required() {
+      return this[required$1];
+    }
+    set required(value) {
+      this[required$1] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'month'})[dartx.type] == 'month';
     }
   };
+  const valueAsDate$ = Symbol(html$.MonthInputElement.name + "." + 'valueAsDate'.toString());
+  const readOnly$1 = Symbol(html$.MonthInputElement.name + "." + 'readOnly'.toString());
+  const required$1 = Symbol(html$.MonthInputElement.name + "." + 'required'.toString());
   html$.MonthInputElement[dart.implements] = () => [html$.RangeInputElementBase];
   dart.setSignature(html$.MonthInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.MonthInputElement, [])}),
@@ -61292,10 +62636,31 @@
     static new() {
       return html$.InputElement.new({type: 'week'});
     }
+    get valueAsDate() {
+      return this[valueAsDate$0];
+    }
+    set valueAsDate(value) {
+      this[valueAsDate$0] = value;
+    }
+    get readOnly() {
+      return this[readOnly$2];
+    }
+    set readOnly(value) {
+      this[readOnly$2] = value;
+    }
+    get required() {
+      return this[required$2];
+    }
+    set required(value) {
+      this[required$2] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'week'})[dartx.type] == 'week';
     }
   };
+  const valueAsDate$0 = Symbol(html$.WeekInputElement.name + "." + 'valueAsDate'.toString());
+  const readOnly$2 = Symbol(html$.WeekInputElement.name + "." + 'readOnly'.toString());
+  const required$2 = Symbol(html$.WeekInputElement.name + "." + 'required'.toString());
   html$.WeekInputElement[dart.implements] = () => [html$.RangeInputElementBase];
   dart.setSignature(html$.WeekInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.WeekInputElement, [])}),
@@ -61323,10 +62688,31 @@
     static new() {
       return html$.InputElement.new({type: 'time'});
     }
+    get valueAsDate() {
+      return this[valueAsDate$1];
+    }
+    set valueAsDate(value) {
+      this[valueAsDate$1] = value;
+    }
+    get readOnly() {
+      return this[readOnly$3];
+    }
+    set readOnly(value) {
+      this[readOnly$3] = value;
+    }
+    get required() {
+      return this[required$3];
+    }
+    set required(value) {
+      this[required$3] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'time'})[dartx.type] == 'time';
     }
   };
+  const valueAsDate$1 = Symbol(html$.TimeInputElement.name + "." + 'valueAsDate'.toString());
+  const readOnly$3 = Symbol(html$.TimeInputElement.name + "." + 'readOnly'.toString());
+  const required$3 = Symbol(html$.TimeInputElement.name + "." + 'required'.toString());
   html$.TimeInputElement[dart.implements] = () => [html$.RangeInputElementBase];
   dart.setSignature(html$.TimeInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.TimeInputElement, [])}),
@@ -61353,10 +62739,24 @@
     static new() {
       return html$.InputElement.new({type: 'datetime-local'});
     }
+    get readOnly() {
+      return this[readOnly$4];
+    }
+    set readOnly(value) {
+      this[readOnly$4] = value;
+    }
+    get required() {
+      return this[required$4];
+    }
+    set required(value) {
+      this[required$4] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'datetime-local'})[dartx.type] == 'datetime-local';
     }
   };
+  const readOnly$4 = Symbol(html$.LocalDateTimeInputElement.name + "." + 'readOnly'.toString());
+  const required$4 = Symbol(html$.LocalDateTimeInputElement.name + "." + 'required'.toString());
   html$.LocalDateTimeInputElement[dart.implements] = () => [html$.RangeInputElementBase];
   dart.setSignature(html$.LocalDateTimeInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.LocalDateTimeInputElement, [])}),
@@ -61376,10 +62776,31 @@
     static new() {
       return html$.InputElement.new({type: 'number'});
     }
+    get placeholder() {
+      return this[placeholder$0];
+    }
+    set placeholder(value) {
+      this[placeholder$0] = value;
+    }
+    get readOnly() {
+      return this[readOnly$5];
+    }
+    set readOnly(value) {
+      this[readOnly$5] = value;
+    }
+    get required() {
+      return this[required$5];
+    }
+    set required(value) {
+      this[required$5] = value;
+    }
     static get supported() {
       return html$.InputElement.new({type: 'number'})[dartx.type] == 'number';
     }
   };
+  const placeholder$0 = Symbol(html$.NumberInputElement.name + "." + 'placeholder'.toString());
+  const readOnly$5 = Symbol(html$.NumberInputElement.name + "." + 'readOnly'.toString());
+  const required$5 = Symbol(html$.NumberInputElement.name + "." + 'required'.toString());
   html$.NumberInputElement[dart.implements] = () => [html$.RangeInputElementBase];
   dart.setSignature(html$.NumberInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.NumberInputElement, [])}),
@@ -61419,7 +62840,21 @@
     static new() {
       return html$.InputElement.new({type: 'checkbox'});
     }
+    get checked() {
+      return this[checked];
+    }
+    set checked(value) {
+      this[checked] = value;
+    }
+    get required() {
+      return this[required$6];
+    }
+    set required(value) {
+      this[required$6] = value;
+    }
   };
+  const checked = Symbol(html$.CheckboxInputElement.name + "." + 'checked'.toString());
+  const required$6 = Symbol(html$.CheckboxInputElement.name + "." + 'required'.toString());
   html$.CheckboxInputElement[dart.implements] = () => [html$.InputElementBase];
   dart.setSignature(html$.CheckboxInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.CheckboxInputElement, [])}),
@@ -61437,7 +62872,21 @@
     static new() {
       return html$.InputElement.new({type: 'radio'});
     }
+    get checked() {
+      return this[checked$];
+    }
+    set checked(value) {
+      this[checked$] = value;
+    }
+    get required() {
+      return this[required$7];
+    }
+    set required(value) {
+      this[required$7] = value;
+    }
   };
+  const checked$ = Symbol(html$.RadioButtonInputElement.name + "." + 'checked'.toString());
+  const required$7 = Symbol(html$.RadioButtonInputElement.name + "." + 'required'.toString());
   html$.RadioButtonInputElement[dart.implements] = () => [html$.InputElementBase];
   dart.setSignature(html$.RadioButtonInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.RadioButtonInputElement, [])}),
@@ -61457,7 +62906,35 @@
     static new() {
       return html$.InputElement.new({type: 'file'});
     }
+    get accept() {
+      return this[accept];
+    }
+    set accept(value) {
+      this[accept] = value;
+    }
+    get multiple() {
+      return this[multiple$];
+    }
+    set multiple(value) {
+      this[multiple$] = value;
+    }
+    get required() {
+      return this[required$8];
+    }
+    set required(value) {
+      this[required$8] = value;
+    }
+    get files() {
+      return this[files];
+    }
+    set files(value) {
+      this[files] = value;
+    }
   };
+  const accept = Symbol(html$.FileUploadInputElement.name + "." + 'accept'.toString());
+  const multiple$ = Symbol(html$.FileUploadInputElement.name + "." + 'multiple'.toString());
+  const required$8 = Symbol(html$.FileUploadInputElement.name + "." + 'required'.toString());
+  const files = Symbol(html$.FileUploadInputElement.name + "." + 'files'.toString());
   html$.FileUploadInputElement[dart.implements] = () => [html$.InputElementBase];
   dart.setSignature(html$.FileUploadInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.FileUploadInputElement, [])}),
@@ -61489,7 +62966,42 @@
     static new() {
       return html$.InputElement.new({type: 'submit'});
     }
+    get formAction() {
+      return this[formAction];
+    }
+    set formAction(value) {
+      this[formAction] = value;
+    }
+    get formEnctype() {
+      return this[formEnctype];
+    }
+    set formEnctype(value) {
+      this[formEnctype] = value;
+    }
+    get formMethod() {
+      return this[formMethod];
+    }
+    set formMethod(value) {
+      this[formMethod] = value;
+    }
+    get formNoValidate() {
+      return this[formNoValidate];
+    }
+    set formNoValidate(value) {
+      this[formNoValidate] = value;
+    }
+    get formTarget() {
+      return this[formTarget];
+    }
+    set formTarget(value) {
+      this[formTarget] = value;
+    }
   };
+  const formAction = Symbol(html$.SubmitButtonInputElement.name + "." + 'formAction'.toString());
+  const formEnctype = Symbol(html$.SubmitButtonInputElement.name + "." + 'formEnctype'.toString());
+  const formMethod = Symbol(html$.SubmitButtonInputElement.name + "." + 'formMethod'.toString());
+  const formNoValidate = Symbol(html$.SubmitButtonInputElement.name + "." + 'formNoValidate'.toString());
+  const formTarget = Symbol(html$.SubmitButtonInputElement.name + "." + 'formTarget'.toString());
   html$.SubmitButtonInputElement[dart.implements] = () => [html$.InputElementBase];
   dart.setSignature(html$.SubmitButtonInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.SubmitButtonInputElement, [])}),
@@ -61528,7 +63040,70 @@
     static new() {
       return html$.InputElement.new({type: 'image'});
     }
+    get alt() {
+      return this[alt];
+    }
+    set alt(value) {
+      this[alt] = value;
+    }
+    get formAction() {
+      return this[formAction$];
+    }
+    set formAction(value) {
+      this[formAction$] = value;
+    }
+    get formEnctype() {
+      return this[formEnctype$];
+    }
+    set formEnctype(value) {
+      this[formEnctype$] = value;
+    }
+    get formMethod() {
+      return this[formMethod$];
+    }
+    set formMethod(value) {
+      this[formMethod$] = value;
+    }
+    get formNoValidate() {
+      return this[formNoValidate$];
+    }
+    set formNoValidate(value) {
+      this[formNoValidate$] = value;
+    }
+    get formTarget() {
+      return this[formTarget$];
+    }
+    set formTarget(value) {
+      this[formTarget$] = value;
+    }
+    get height() {
+      return this[height];
+    }
+    set height(value) {
+      this[height] = value;
+    }
+    get src() {
+      return this[src];
+    }
+    set src(value) {
+      this[src] = value;
+    }
+    get width() {
+      return this[width];
+    }
+    set width(value) {
+      this[width] = value;
+    }
   };
+  const alt = Symbol(html$.ImageButtonInputElement.name + "." + 'alt'.toString());
+  const formAction$ = Symbol(html$.ImageButtonInputElement.name + "." + 'formAction'.toString());
+  const formEnctype$ = Symbol(html$.ImageButtonInputElement.name + "." + 'formEnctype'.toString());
+  const formMethod$ = Symbol(html$.ImageButtonInputElement.name + "." + 'formMethod'.toString());
+  const formNoValidate$ = Symbol(html$.ImageButtonInputElement.name + "." + 'formNoValidate'.toString());
+  const formTarget$ = Symbol(html$.ImageButtonInputElement.name + "." + 'formTarget'.toString());
+  const height = Symbol(html$.ImageButtonInputElement.name + "." + 'height'.toString());
+  const src = Symbol(html$.ImageButtonInputElement.name + "." + 'src'.toString());
+  const width = Symbol(html$.ImageButtonInputElement.name + "." + 'width'.toString());
   html$.ImageButtonInputElement[dart.implements] = () => [html$.InputElementBase];
   dart.setSignature(html$.ImageButtonInputElement, {
     constructors: () => ({new: dart.definiteFunctionType(html$.ImageButtonInputElement, [])}),
@@ -61676,8 +63251,8 @@
     get [dartx.shiftKey]() {
       return this.shiftKey;
     }
-    [dartx.getModifierState](keyArg) {
-      return this.getModifierState(keyArg);
+    [dartx.getModifierState](...args) {
+      return this.getModifierState.apply(this, args);
     }
   };
   dart.setSignature(html$.KeyboardEvent, {
@@ -61852,14 +63427,14 @@
     get [dartx.willValidate]() {
       return this.willValidate;
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.KeygenElement, 'created');
@@ -62184,14 +63759,14 @@
     set [dartx.search](value) {
       this.search = value;
     }
-    [dartx.assign](url) {
-      return this.assign(url);
+    [dartx.assign](...args) {
+      return this.assign.apply(this, args);
     }
-    [dartx.reload]() {
-      return this.reload();
+    [dartx.reload](...args) {
+      return this.reload.apply(this, args);
     }
-    [dartx.replace](url) {
-      return this.replace(url);
+    [dartx.replace](...args) {
+      return this.replace.apply(this, args);
     }
     get [dartx.origin]() {
       if ("origin" in this) {
@@ -62338,14 +63913,14 @@
     set [dartx.volume](value) {
       this.volume = value;
     }
-    [dartx.pause]() {
-      return this.pause();
+    [dartx.pause](...args) {
+      return this.pause.apply(this, args);
     }
-    [dartx.play]() {
-      return this.play();
+    [dartx.play](...args) {
+      return this.play.apply(this, args);
     }
-    [dartx.unpause]() {
-      return this.unpause();
+    [dartx.unpause](...args) {
+      return this.unpause.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaController, {
@@ -62417,15 +63992,15 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.enumerateDevices]() {
-      return this.enumerateDevices();
+    [dartx.enumerateDevices](...args) {
+      return this.enumerateDevices.apply(this, args);
     }
     [dartx.getUserMedia](options) {
       let options_1 = html_common.convertDartToNative_Dictionary(options);
       return this[_getUserMedia_1](options_1);
     }
-    [_getUserMedia_1](options) {
-      return this.getUserMedia(options);
+    [_getUserMedia_1](...args) {
+      return this.getUserMedia.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaDevices, {
@@ -62687,20 +64262,20 @@
     get [dartx.sessionId]() {
       return this.sessionId;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.generateRequest](initDataType, initData) {
-      return this.generateRequest(initDataType, initData);
+    [dartx.generateRequest](...args) {
+      return this.generateRequest.apply(this, args);
     }
-    [dartx.load](sessionId) {
-      return this.load(sessionId);
+    [dartx.load](...args) {
+      return this.load.apply(this, args);
     }
-    [dartx.remove]() {
-      return this.remove();
+    [dartx.remove](...args) {
+      return this.remove.apply(this, args);
     }
-    [_update$](response) {
-      return this.update(response);
+    [_update$](...args) {
+      return this.update.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaKeySession, {
@@ -62749,14 +64324,14 @@
     get [dartx.keySystem]() {
       return this.keySystem;
     }
-    [dartx.createMediaKeys]() {
-      return this.createMediaKeys();
+    [dartx.createMediaKeys](...args) {
+      return this.createMediaKeys.apply(this, args);
     }
     [dartx.getConfiguration]() {
       return html_common.convertNativeToDart_Dictionary(this[_getConfiguration_1]());
     }
-    [_getConfiguration_1]() {
-      return this.getConfiguration();
+    [_getConfiguration_1](...args) {
+      return this.getConfiguration.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaKeySystemAccess, {
@@ -62777,11 +64352,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [_createSession](sessionType) {
-      return this.createSession(sessionType);
+    [_createSession](...args) {
+      return this.createSession.apply(this, args);
     }
-    [dartx.setServerCertificate](serverCertificate) {
-      return this.setServerCertificate(serverCertificate);
+    [dartx.setServerCertificate](...args) {
+      return this.setServerCertificate.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaKeys, {
@@ -62812,14 +64387,14 @@
     set [dartx.mediaText](value) {
       this.mediaText = value;
     }
-    [dartx.appendMedium](medium) {
-      return this.appendMedium(medium);
+    [dartx.appendMedium](...args) {
+      return this.appendMedium.apply(this, args);
     }
-    [dartx.deleteMedium](medium) {
-      return this.deleteMedium(medium);
+    [dartx.deleteMedium](...args) {
+      return this.deleteMedium.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaList, {
@@ -62852,11 +64427,11 @@
     get [dartx.media]() {
       return this.media;
     }
-    [dartx.addListener](listener) {
-      return this.addListener(listener);
+    [dartx.addListener](...args) {
+      return this.addListener.apply(this, args);
     }
-    [dartx.removeListener](listener) {
-      return this.removeListener(listener);
+    [dartx.removeListener](...args) {
+      return this.removeListener.apply(this, args);
     }
     get [dartx.onChange]() {
       return html$.MediaQueryList.changeEvent.forTarget(this);
@@ -62940,11 +64515,11 @@
     static _create_1() {
       return new MediaSession();
     }
-    [dartx.activate]() {
-      return this.activate();
+    [dartx.activate](...args) {
+      return this.activate.apply(this, args);
     }
-    [dartx.deactivate]() {
-      return this.deactivate();
+    [dartx.deactivate](...args) {
+      return this.deactivate.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaSession, {
@@ -62997,14 +64572,14 @@
     get [dartx.sourceBuffers]() {
       return this.sourceBuffers;
     }
-    [dartx.addSourceBuffer](type) {
-      return this.addSourceBuffer(type);
+    [dartx.addSourceBuffer](...args) {
+      return this.addSourceBuffer.apply(this, args);
     }
-    [dartx.endOfStream](error) {
-      return this.endOfStream(error);
+    [dartx.endOfStream](...args) {
+      return this.endOfStream.apply(this, args);
     }
-    [dartx.removeSourceBuffer](buffer) {
-      return this.removeSourceBuffer(buffer);
+    [dartx.removeSourceBuffer](...args) {
+      return this.removeSourceBuffer.apply(this, args);
     }
   };
   dart.setSignature(html$.MediaSource, {
@@ -63086,29 +64661,29 @@
     get [dartx.label]() {
       return this.label;
     }
-    [dartx.addTrack](track) {
-      return this.addTrack(track);
+    [dartx.addTrack](...args) {
+      return this.addTrack.apply(this, args);
     }
-    [dartx.clone]() {
-      return this.clone();
+    [dartx.clone](...args) {
+      return this.clone.apply(this, args);
     }
-    [dartx.getAudioTracks]() {
-      return this.getAudioTracks();
+    [dartx.getAudioTracks](...args) {
+      return this.getAudioTracks.apply(this, args);
     }
-    [dartx.getTrackById](trackId) {
-      return this.getTrackById(trackId);
+    [dartx.getTrackById](...args) {
+      return this.getTrackById.apply(this, args);
     }
-    [dartx.getTracks]() {
-      return this.getTracks();
+    [dartx.getTracks](...args) {
+      return this.getTracks.apply(this, args);
     }
-    [dartx.getVideoTracks]() {
-      return this.getVideoTracks();
+    [dartx.getVideoTracks](...args) {
+      return this.getVideoTracks.apply(this, args);
     }
-    [dartx.removeTrack](track) {
-      return this.removeTrack(track);
+    [dartx.removeTrack](...args) {
+      return this.removeTrack.apply(this, args);
     }
-    [dartx.stop]() {
-      return this.stop();
+    [dartx.stop](...args) {
+      return this.stop.apply(this, args);
     }
     get [dartx.onAddTrack]() {
       return html$.MediaStream.addTrackEvent.forTarget(this);
@@ -63254,8 +64829,8 @@
     get [dartx.readyState]() {
       return this.readyState;
     }
-    [dartx.clone]() {
-      return this.clone();
+    [dartx.clone](...args) {
+      return this.clone.apply(this, args);
     }
     static getSources() {
       let completer = CompleterOfListOfSourceInfo().new();
@@ -63264,8 +64839,8 @@
       }, ListOfSourceInfoTovoid()));
       return completer.future;
     }
-    [dartx.stop]() {
-      return this.stop();
+    [dartx.stop](...args) {
+      return this.stop.apply(this, args);
     }
     get [dartx.onEnded]() {
       return html$.MediaStreamTrack.endedEvent.forTarget(this);
@@ -63576,8 +65151,8 @@
     get [_get_source]() {
       return this.source;
     }
-    [_initMessageEvent](typeArg, canBubbleArg, cancelableArg, dataArg, originArg, lastEventIdArg, sourceArg, portsArg) {
-      return this.initMessageEvent(typeArg, canBubbleArg, cancelableArg, dataArg, originArg, lastEventIdArg, sourceArg, portsArg);
+    [_initMessageEvent](...args) {
+      return this.initMessageEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.MessageEvent, {
@@ -63613,8 +65188,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
     [dartx.postMessage](message, transfer) {
       if (transfer === void 0) transfer = null;
@@ -63627,14 +65202,14 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [dartx.start]() {
-      return this.start();
+    [dartx.start](...args) {
+      return this.start.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.MessagePort.messageEvent.forTarget(this);
@@ -63928,11 +65503,11 @@
     get [dartx.version]() {
       return this.version;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.open]() {
-      return this.open();
+    [dartx.open](...args) {
+      return this.open.apply(this, args);
     }
   };
   dart.setSignature(html$.MidiPort, {
@@ -64042,8 +65617,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.send](data, timestamp) {
-      return this.send(data, timestamp);
+    [dartx.send](...args) {
+      return this.send.apply(this, args);
     }
   };
   dart.setSignature(html$.MidiOutput, {
@@ -64102,8 +65677,8 @@
   dart.registerExtension(dart.global.MimeType, html$.MimeType);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -64119,11 +65694,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -64152,13 +65727,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.namedItem](name) {
-      return this.namedItem(name);
+    [dartx.namedItem](...args) {
+      return this.namedItem.apply(this, args);
     }
   };
   html$.MimeTypeArray[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfMimeType()];
@@ -64172,8 +65747,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.MimeType, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.MimeType]),
+      [dartx._get]: dart.definiteFunctionType(html$.MimeType, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.MimeType]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.MimeType, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.MimeType, [core.int]),
       [dartx.namedItem]: dart.definiteFunctionType(html$.MimeType, [core.String])
@@ -64365,8 +65940,8 @@
       this[_initMouseEvent_1](type, bubbles, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget_1);
       return;
     }
-    [_initMouseEvent_1](type, bubbles, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget) {
-      return this.initMouseEvent(type, bubbles, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget);
+    [_initMouseEvent_1](...args) {
+      return this.initMouseEvent.apply(this, args);
     }
     get [dartx.client]() {
       return new (PointOfnum())(this[_clientX], this[_clientY]);
@@ -64448,6 +66023,7 @@
     names: ['_create_1', '_create_2']
   });
   dart.registerExtension(dart.global.MouseEvent, html$.MouseEvent);
+  dart.registerExtension(dart.global.DragEvent, html$.MouseEvent);
   html$.MutationCallback = dart.typedef('MutationCallback', () => dart.functionType(dart.void, [ListOfMutationRecord(), html$.MutationObserver]));
   const _observe_1 = Symbol('_observe_1');
   const _observe = Symbol('_observe');
@@ -64458,19 +66034,19 @@
     'observe'
   ]);
   html$.MutationObserver = class MutationObserver extends _interceptors.Interceptor {
-    [dartx.disconnect]() {
-      return this.disconnect();
+    [dartx.disconnect](...args) {
+      return this.disconnect.apply(this, args);
     }
     [_observe](target, options) {
       let options_1 = html_common.convertDartToNative_Dictionary(options);
       this[_observe_1](target, options_1);
       return;
     }
-    [_observe_1](target, options) {
-      return this.observe(target, options);
+    [_observe_1](...args) {
+      return this.observe.apply(this, args);
     }
-    [dartx.takeRecords]() {
-      return this.takeRecords();
+    [dartx.takeRecords](...args) {
+      return this.takeRecords.apply(this, args);
     }
     static get supported() {
       return !!(window.MutationObserver || window.WebKitMutationObserver);
@@ -64508,8 +66084,8 @@
     static _fixupList(list) {
       return list;
     }
-    [_call](target, options) {
-      return this.observe(target, options);
+    [_call](...args) {
+      return this.observe.apply(this, args);
     }
     static new(callback) {
       0;
@@ -64537,6 +66113,7 @@
   });
   html$.MutationObserver._boolKeys = dart.const(dart.map({childList: true, attributes: true, characterData: true, subtree: true, attributeOldValue: true, characterDataOldValue: true}, core.String, core.bool));
   dart.registerExtension(dart.global.MutationObserver, html$.MutationObserver);
+  dart.registerExtension(dart.global.WebKitMutationObserver, html$.MutationObserver);
   dart.defineExtensionNames([
     'addedNodes',
     'attributeName',
@@ -64662,8 +66239,8 @@
         this.getUserMedia = this.getUserMedia || this.webkitGetUserMedia || this.mozGetUserMedia || this.msGetUserMedia;
       }
     }
-    [_getUserMedia](options, success, error) {
-      return this.getUserMedia(options, success, error);
+    [_getUserMedia](...args) {
+      return this.getUserMedia.apply(this, args);
     }
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
@@ -64722,17 +66299,17 @@
     get [dartx.temporaryStorage]() {
       return this.webkitTemporaryStorage;
     }
-    [dartx.getBattery]() {
-      return this.getBattery();
+    [dartx.getBattery](...args) {
+      return this.getBattery.apply(this, args);
     }
-    [dartx.getGamepads]() {
-      return this.getGamepads();
+    [dartx.getGamepads](...args) {
+      return this.getGamepads.apply(this, args);
     }
-    [dartx.getVRDevices]() {
-      return this.getVRDevices();
+    [dartx.getVRDevices](...args) {
+      return this.getVRDevices.apply(this, args);
     }
-    [dartx.registerProtocolHandler](scheme, url, title) {
-      return this.registerProtocolHandler(scheme, url, title);
+    [dartx.registerProtocolHandler](...args) {
+      return this.registerProtocolHandler.apply(this, args);
     }
     [dartx.requestMidiAccess](options) {
       if (options === void 0) options = null;
@@ -64742,17 +66319,17 @@
       }
       return this[_requestMidiAccess_2]();
     }
-    [_requestMidiAccess_1](options) {
-      return this.requestMIDIAccess(options);
+    [_requestMidiAccess_1](...args) {
+      return this.requestMIDIAccess.apply(this, args);
     }
-    [_requestMidiAccess_2]() {
-      return this.requestMIDIAccess();
+    [_requestMidiAccess_2](...args) {
+      return this.requestMIDIAccess.apply(this, args);
     }
-    [dartx.requestMediaKeySystemAccess](keySystem, supportedConfigurations) {
-      return this.requestMediaKeySystemAccess(keySystem, supportedConfigurations);
+    [dartx.requestMediaKeySystemAccess](...args) {
+      return this.requestMediaKeySystemAccess.apply(this, args);
     }
-    [dartx.sendBeacon](url, data) {
-      return this.sendBeacon(url, data);
+    [dartx.sendBeacon](...args) {
+      return this.sendBeacon.apply(this, args);
     }
     get [dartx.hardwareConcurrency]() {
       return this.hardwareConcurrency;
@@ -64787,8 +66364,8 @@
     get [dartx.cookieEnabled]() {
       return this.cookieEnabled;
     }
-    [dartx.getStorageUpdates]() {
-      return this.getStorageUpdates();
+    [dartx.getStorageUpdates](...args) {
+      return this.getStorageUpdates.apply(this, args);
     }
   };
   html$.Navigator[dart.implements] = () => [html$.NavigatorStorageUtils, html$.NavigatorCpu, html$.NavigatorLanguage, html$.NavigatorOnLine, html$.NavigatorID];
@@ -64850,7 +66427,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get hardwareConcurrency() {
+      return this[hardwareConcurrency];
+    }
+    set hardwareConcurrency(value) {
+      super.hardwareConcurrency = value;
+    }
   };
+  const hardwareConcurrency = Symbol(html$.NavigatorCpu.name + "." + 'hardwareConcurrency'.toString());
   dart.setSignature(html$.NavigatorCpu, {
     constructors: () => ({_: dart.definiteFunctionType(html$.NavigatorCpu, [])}),
     fields: () => ({hardwareConcurrency: core.int})
@@ -64869,7 +66453,56 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get appCodeName() {
+      return this[appCodeName];
+    }
+    set appCodeName(value) {
+      super.appCodeName = value;
+    }
+    get appName() {
+      return this[appName];
+    }
+    set appName(value) {
+      super.appName = value;
+    }
+    get appVersion() {
+      return this[appVersion];
+    }
+    set appVersion(value) {
+      super.appVersion = value;
+    }
+    get dartEnabled() {
+      return this[dartEnabled];
+    }
+    set dartEnabled(value) {
+      super.dartEnabled = value;
+    }
+    get platform() {
+      return this[platform];
+    }
+    set platform(value) {
+      super.platform = value;
+    }
+    get product() {
+      return this[product];
+    }
+    set product(value) {
+      super.product = value;
+    }
+    get userAgent() {
+      return this[userAgent];
+    }
+    set userAgent(value) {
+      super.userAgent = value;
+    }
   };
+  const appCodeName = Symbol(html$.NavigatorID.name + "." + 'appCodeName'.toString());
+  const appName = Symbol(html$.NavigatorID.name + "." + 'appName'.toString());
+  const appVersion = Symbol(html$.NavigatorID.name + "." + 'appVersion'.toString());
+  const dartEnabled = Symbol(html$.NavigatorID.name + "." + 'dartEnabled'.toString());
+  const platform = Symbol(html$.NavigatorID.name + "." + 'platform'.toString());
+  const product = Symbol(html$.NavigatorID.name + "." + 'product'.toString());
+  const userAgent = Symbol(html$.NavigatorID.name + "." + 'userAgent'.toString());
   dart.setSignature(html$.NavigatorID, {
     constructors: () => ({_: dart.definiteFunctionType(html$.NavigatorID, [])}),
     fields: () => ({
@@ -64899,7 +66532,21 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get language() {
+      return this[language];
+    }
+    set language(value) {
+      super.language = value;
+    }
+    get languages() {
+      return this[languages];
+    }
+    set languages(value) {
+      super.languages = value;
+    }
   };
+  const language = Symbol(html$.NavigatorLanguage.name + "." + 'language'.toString());
+  const languages = Symbol(html$.NavigatorLanguage.name + "." + 'languages'.toString());
   dart.setSignature(html$.NavigatorLanguage, {
     constructors: () => ({_: dart.definiteFunctionType(html$.NavigatorLanguage, [])}),
     fields: () => ({
@@ -64915,7 +66562,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get onLine() {
+      return this[onLine];
+    }
+    set onLine(value) {
+      super.onLine = value;
+    }
   };
+  const onLine = Symbol(html$.NavigatorOnLine.name + "." + 'onLine'.toString());
   dart.setSignature(html$.NavigatorOnLine, {
     constructors: () => ({_: dart.definiteFunctionType(html$.NavigatorOnLine, [])}),
     fields: () => ({onLine: core.bool})
@@ -64932,8 +66586,8 @@
     get [dartx.cookieEnabled]() {
       return this.cookieEnabled;
     }
-    [dartx.getStorageUpdates]() {
-      return this.getStorageUpdates();
+    [dartx.getStorageUpdates](...args) {
+      return this.getStorageUpdates.apply(this, args);
     }
   };
   dart.setSignature(html$.NavigatorStorageUtils, {
@@ -65032,14 +66686,14 @@
       if (index == this.length) {
         this[_this][dartx.append](node);
       } else {
-        this[_this][dartx.insertBefore](node, this.get(index));
+        this[_this][dartx.insertBefore](node, this._get(index));
       }
     }
     insertAll(index, iterable) {
       if (index == this.length) {
         this.addAll(iterable);
       } else {
-        let item = this.get(index);
+        let item = this._get(index);
         this[_this][dartx.insertAllBefore](iterable, item);
       }
     }
@@ -65054,7 +66708,7 @@
       return result;
     }
     removeAt(index) {
-      let result = this.get(index);
+      let result = this._get(index);
       if (result != null) {
         this[_this][_removeChild](result);
       }
@@ -65086,8 +66740,8 @@
     clear() {
       this[_this][_clearChildren]();
     }
-    set(index, value) {
-      this[_this][_replaceChild](value, this.get(index));
+    _set(index, value) {
+      this[_this][_replaceChild](value, this._get(index));
       return value;
     }
     get iterator() {
@@ -65115,8 +66769,8 @@
     set length(value) {
       dart.throw(new core.UnsupportedError("Cannot set length on immutable List."));
     }
-    get(index) {
-      return this[_this][dartx.childNodes][dartx.get](index);
+    _get(index) {
+      return this[_this][dartx.childNodes][dartx._get](index);
     }
     get rawList() {
       return this[_this][dartx.childNodes];
@@ -65147,11 +66801,11 @@
       [_filter$]: dart.definiteFunctionType(dart.void, [NodeTobool(), core.bool]),
       removeWhere: dart.definiteFunctionType(dart.void, [NodeTobool()]),
       retainWhere: dart.definiteFunctionType(dart.void, [NodeTobool()]),
-      set: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
       sort: dart.definiteFunctionType(dart.void, [], [ComparatorOfNode()]),
       setRange: dart.definiteFunctionType(dart.void, [core.int, core.int, IterableOfNode()], [core.int]),
       fillRange: dart.definiteFunctionType(dart.void, [core.int, core.int], [html$.Node]),
-      get: dart.definiteFunctionType(html$.Node, [core.int])
+      _get: dart.definiteFunctionType(html$.Node, [core.int])
     })
   });
   dart.defineExtensionMembers(html$._ChildNodeListLazy, [
@@ -65166,12 +66820,12 @@
     'removeWhere',
     'retainWhere',
     'clear',
-    'set',
+    '_set',
     'sort',
     'shuffle',
     'setRange',
     'fillRange',
-    'get',
+    '_get',
     'first',
     'last',
     'single',
@@ -65240,14 +66894,14 @@
     get [dartx.whatToShow]() {
       return this.whatToShow;
     }
-    [dartx.detach]() {
-      return this.detach();
+    [dartx.detach](...args) {
+      return this.detach.apply(this, args);
     }
-    [dartx.nextNode]() {
-      return this.nextNode();
+    [dartx.nextNode](...args) {
+      return this.nextNode.apply(this, args);
     }
-    [dartx.previousNode]() {
-      return this.previousNode();
+    [dartx.previousNode](...args) {
+      return this.previousNode.apply(this, args);
     }
   };
   dart.setSignature(html$.NodeIterator, {
@@ -65270,8 +66924,8 @@
   dart.registerExtension(dart.global.NodeIterator, html$.NodeIterator);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -65285,11 +66939,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -65318,10 +66972,10 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [_item](index) {
-      return this.item(index);
+    [_item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$.NodeList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfNode()];
@@ -65335,13 +66989,14 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.Node, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
+      [dartx._get]: dart.definiteFunctionType(html$.Node, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.Node, [core.int]),
       [_item]: dart.definiteFunctionType(html$.Node, [core.int])
     })
   });
   dart.registerExtension(dart.global.NodeList, html$.NodeList);
+  dart.registerExtension(dart.global.RadioNodeList, html$.NodeList);
   dart.defineExtensionNames([
     'nextElementSibling',
     'previousElementSibling'
@@ -65372,8 +67027,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getElementById](elementId) {
-      return this.getElementById(elementId);
+    [dartx.getElementById](...args) {
+      return this.getElementById.apply(this, args);
     }
   };
   dart.setSignature(html$.NonElementParentNode, {
@@ -65406,11 +67061,11 @@
       let tag = opts && 'tag' in opts ? opts.tag : null;
       let icon = opts && 'icon' in opts ? opts.icon : null;
       let parsedOptions = dart.map();
-      if (dir != null) parsedOptions[dartx.set]('dir', dir);
-      if (body != null) parsedOptions[dartx.set]('body', body);
-      if (lang != null) parsedOptions[dartx.set]('lang', lang);
-      if (tag != null) parsedOptions[dartx.set]('tag', tag);
-      if (icon != null) parsedOptions[dartx.set]('icon', icon);
+      if (dir != null) parsedOptions[dartx._set]('dir', dir);
+      if (body != null) parsedOptions[dartx._set]('body', body);
+      if (lang != null) parsedOptions[dartx._set]('lang', lang);
+      if (tag != null) parsedOptions[dartx._set]('tag', tag);
+      if (icon != null) parsedOptions[dartx._set]('icon', icon);
       return html$.Notification._factoryNotification(title, parsedOptions);
     }
     static _() {
@@ -65463,8 +67118,8 @@
     get [dartx.vibrate]() {
       return this.vibrate;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
     static requestPermission() {
       let completer = CompleterOfString().new();
@@ -65717,20 +67372,20 @@
     get [dartx.willValidate]() {
       return this.willValidate;
     }
-    [__getter__](index_OR_name) {
-      return this.__getter__(index_OR_name);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [__setter__](index_OR_name, value) {
-      return this.__setter__(index_OR_name, value);
+    [__setter__](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.ObjectElement, 'created');
@@ -66004,14 +67659,14 @@
     get [dartx.willValidate]() {
       return this.willValidate;
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.OutputElement, 'created');
@@ -66245,35 +67900,35 @@
     static _create_3(path_OR_text) {
       return new Path2D(path_OR_text);
     }
-    [dartx.addPath](path, transform) {
-      return this.addPath(path, transform);
+    [dartx.addPath](...args) {
+      return this.addPath.apply(this, args);
     }
-    [dartx.arc](x, y, radius, startAngle, endAngle, anticlockwise) {
-      return this.arc(x, y, radius, startAngle, endAngle, anticlockwise);
+    [dartx.arc](...args) {
+      return this.arc.apply(this, args);
     }
-    [dartx.arcTo](x1, y1, x2, y2, radius) {
-      return this.arcTo(x1, y1, x2, y2, radius);
+    [dartx.arcTo](...args) {
+      return this.arcTo.apply(this, args);
     }
-    [dartx.bezierCurveTo](cp1x, cp1y, cp2x, cp2y, x, y) {
-      return this.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
+    [dartx.bezierCurveTo](...args) {
+      return this.bezierCurveTo.apply(this, args);
     }
-    [dartx.closePath]() {
-      return this.closePath();
+    [dartx.closePath](...args) {
+      return this.closePath.apply(this, args);
     }
-    [dartx.ellipse](x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
-      return this.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
+    [dartx.ellipse](...args) {
+      return this.ellipse.apply(this, args);
     }
-    [dartx.lineTo](x, y) {
-      return this.lineTo(x, y);
+    [dartx.lineTo](...args) {
+      return this.lineTo.apply(this, args);
     }
-    [dartx.moveTo](x, y) {
-      return this.moveTo(x, y);
+    [dartx.moveTo](...args) {
+      return this.moveTo.apply(this, args);
     }
-    [dartx.quadraticCurveTo](cpx, cpy, x, y) {
-      return this.quadraticCurveTo(cpx, cpy, x, y);
+    [dartx.quadraticCurveTo](...args) {
+      return this.quadraticCurveTo.apply(this, args);
     }
-    [dartx.rect](x, y, width, height) {
-      return this.rect(x, y, width, height);
+    [dartx.rect](...args) {
+      return this.rect.apply(this, args);
     }
   };
   html$.Path2D[dart.implements] = () => [html$._CanvasPathMethods];
@@ -66336,41 +67991,41 @@
     get [dartx.timing]() {
       return this.timing;
     }
-    [dartx.clearFrameTimings]() {
-      return this.clearFrameTimings();
+    [dartx.clearFrameTimings](...args) {
+      return this.clearFrameTimings.apply(this, args);
     }
-    [dartx.clearMarks](markName) {
-      return this.clearMarks(markName);
+    [dartx.clearMarks](...args) {
+      return this.clearMarks.apply(this, args);
     }
-    [dartx.clearMeasures](measureName) {
-      return this.clearMeasures(measureName);
+    [dartx.clearMeasures](...args) {
+      return this.clearMeasures.apply(this, args);
     }
-    [dartx.getEntries]() {
-      return this.getEntries();
+    [dartx.getEntries](...args) {
+      return this.getEntries.apply(this, args);
     }
-    [dartx.getEntriesByName](name, entryType) {
-      return this.getEntriesByName(name, entryType);
+    [dartx.getEntriesByName](...args) {
+      return this.getEntriesByName.apply(this, args);
     }
-    [dartx.getEntriesByType](entryType) {
-      return this.getEntriesByType(entryType);
+    [dartx.getEntriesByType](...args) {
+      return this.getEntriesByType.apply(this, args);
     }
-    [dartx.mark](markName) {
-      return this.mark(markName);
+    [dartx.mark](...args) {
+      return this.mark.apply(this, args);
     }
-    [dartx.measure](measureName, startMark, endMark) {
-      return this.measure(measureName, startMark, endMark);
+    [dartx.measure](...args) {
+      return this.measure.apply(this, args);
     }
-    [dartx.now]() {
-      return this.now();
+    [dartx.now](...args) {
+      return this.now.apply(this, args);
     }
-    [dartx.setFrameTimingBufferSize](maxSize) {
-      return this.setFrameTimingBufferSize(maxSize);
+    [dartx.setFrameTimingBufferSize](...args) {
+      return this.setFrameTimingBufferSize.apply(this, args);
     }
-    [dartx.clearResourceTimings]() {
-      return this.webkitClearResourceTimings();
+    [dartx.clearResourceTimings](...args) {
+      return this.webkitClearResourceTimings.apply(this, args);
     }
-    [dartx.setResourceTimingBufferSize](maxSize) {
-      return this.webkitSetResourceTimingBufferSize(maxSize);
+    [dartx.setResourceTimingBufferSize](...args) {
+      return this.webkitSetResourceTimingBufferSize.apply(this, args);
     }
     get [dartx.onResourceTimingBufferFull]() {
       return html$.Performance.resourceTimingBufferFullEvent.forTarget(this);
@@ -66763,14 +68418,14 @@
     get [dartx.minPossiblePeriod]() {
       return this.minPossiblePeriod;
     }
-    [dartx.getRegistration](tag) {
-      return this.getRegistration(tag);
+    [dartx.getRegistration](...args) {
+      return this.getRegistration.apply(this, args);
     }
-    [dartx.getRegistrations]() {
-      return this.getRegistrations();
+    [dartx.getRegistrations](...args) {
+      return this.getRegistrations.apply(this, args);
     }
-    [dartx.permissionState]() {
-      return this.permissionState();
+    [dartx.permissionState](...args) {
+      return this.permissionState.apply(this, args);
     }
     [dartx.register](options) {
       if (options === void 0) options = null;
@@ -66780,11 +68435,11 @@
       }
       return this[_register_2]();
     }
-    [_register_1](options) {
-      return this.register(options);
+    [_register_1](...args) {
+      return this.register.apply(this, args);
     }
-    [_register_2]() {
-      return this.register();
+    [_register_2](...args) {
+      return this.register.apply(this, args);
     }
   };
   dart.setSignature(html$.PeriodicSyncManager, {
@@ -66823,8 +68478,8 @@
     get [dartx.tag]() {
       return this.tag;
     }
-    [dartx.unregister]() {
-      return this.unregister();
+    [dartx.unregister](...args) {
+      return this.unregister.apply(this, args);
     }
   };
   dart.setSignature(html$.PeriodicSyncRegistration, {
@@ -66879,8 +68534,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.query](permission) {
-      return this.query(permission);
+    [dartx.query](...args) {
+      return this.query.apply(this, args);
     }
   };
   dart.setSignature(html$.Permissions, {
@@ -66928,11 +68583,11 @@
     get [dartx.name]() {
       return this.name;
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.namedItem](name) {
-      return this.namedItem(name);
+    [dartx.namedItem](...args) {
+      return this.namedItem.apply(this, args);
     }
   };
   dart.setSignature(html$.Plugin, {
@@ -66951,8 +68606,8 @@
   dart.registerExtension(dart.global.Plugin, html$.Plugin);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -66969,11 +68624,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -67002,16 +68657,16 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.namedItem](name) {
-      return this.namedItem(name);
+    [dartx.namedItem](...args) {
+      return this.namedItem.apply(this, args);
     }
-    [dartx.refresh](reload) {
-      return this.refresh(reload);
+    [dartx.refresh](...args) {
+      return this.refresh.apply(this, args);
     }
   };
   html$.PluginArray[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfPlugin()];
@@ -67025,8 +68680,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.Plugin, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.Plugin]),
+      [dartx._get]: dart.definiteFunctionType(html$.Plugin, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.Plugin]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.Plugin, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.Plugin, [core.int]),
       [dartx.namedItem]: dart.definiteFunctionType(html$.Plugin, [core.String]),
@@ -67060,8 +68715,8 @@
     set [dartx.message](value) {
       this.message = value;
     }
-    [dartx.createdCallback]() {
-      return this.createdCallback();
+    [dartx.createdCallback](...args) {
+      return this.createdCallback.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.PluginPlaceholderElement, 'created');
@@ -67236,14 +68891,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getImmediateState]() {
-      return this.getImmediateState();
+    [dartx.getImmediateState](...args) {
+      return this.getImmediateState.apply(this, args);
     }
-    [dartx.getState]() {
-      return this.getState();
+    [dartx.getState](...args) {
+      return this.getState.apply(this, args);
     }
-    [dartx.resetSensor]() {
-      return this.resetSensor();
+    [dartx.resetSensor](...args) {
+      return this.resetSensor.apply(this, args);
     }
   };
   dart.setSignature(html$.PositionSensorVRDevice, {
@@ -67288,14 +68943,14 @@
     get [dartx.session]() {
       return this.session;
     }
-    [dartx.getAvailability](url) {
-      return this.getAvailability(url);
+    [dartx.getAvailability](...args) {
+      return this.getAvailability.apply(this, args);
     }
-    [dartx.joinSession](url, presentationId) {
-      return this.joinSession(url, presentationId);
+    [dartx.joinSession](...args) {
+      return this.joinSession.apply(this, args);
     }
-    [dartx.startSession](url) {
-      return this.startSession(url);
+    [dartx.startSession](...args) {
+      return this.startSession.apply(this, args);
     }
   };
   dart.setSignature(html$.Presentation, {
@@ -67359,11 +69014,11 @@
     get [dartx.state]() {
       return this.state;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.send](data_OR_message) {
-      return this.send(data_OR_message);
+    [dartx.send](...args) {
+      return this.send.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.PresentationSession.messageEvent.forTarget(this);
@@ -67616,8 +69271,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getSubscription]() {
-      return this.getSubscription();
+    [dartx.getSubscription](...args) {
+      return this.getSubscription.apply(this, args);
     }
     [dartx.permissionState](options) {
       if (options === void 0) options = null;
@@ -67627,11 +69282,11 @@
       }
       return this[_permissionState_2]();
     }
-    [_permissionState_1](options) {
-      return this.permissionState(options);
+    [_permissionState_1](...args) {
+      return this.permissionState.apply(this, args);
     }
-    [_permissionState_2]() {
-      return this.permissionState();
+    [_permissionState_2](...args) {
+      return this.permissionState.apply(this, args);
     }
     [dartx.subscribe](options) {
       if (options === void 0) options = null;
@@ -67641,11 +69296,11 @@
       }
       return this[_subscribe_2]();
     }
-    [_subscribe_1](options) {
-      return this.subscribe(options);
+    [_subscribe_1](...args) {
+      return this.subscribe.apply(this, args);
     }
-    [_subscribe_2]() {
-      return this.subscribe();
+    [_subscribe_2](...args) {
+      return this.subscribe.apply(this, args);
     }
   };
   dart.setSignature(html$.PushManager, {
@@ -67677,17 +69332,17 @@
     static _create_1(message) {
       return new PushMessageData(message);
     }
-    [dartx.arrayBuffer]() {
-      return this.arrayBuffer();
+    [dartx.arrayBuffer](...args) {
+      return this.arrayBuffer.apply(this, args);
     }
-    [dartx.blob]() {
-      return this.blob();
+    [dartx.blob](...args) {
+      return this.blob.apply(this, args);
     }
-    [dartx.json]() {
-      return this.json();
+    [dartx.json](...args) {
+      return this.json.apply(this, args);
     }
-    [dartx.text]() {
-      return this.text();
+    [dartx.text](...args) {
+      return this.text.apply(this, args);
     }
   };
   dart.setSignature(html$.PushMessageData, {
@@ -67716,8 +69371,8 @@
     get [dartx.endpoint]() {
       return this.endpoint;
     }
-    [dartx.unsubscribe]() {
-      return this.unsubscribe();
+    [dartx.unsubscribe](...args) {
+      return this.unsubscribe.apply(this, args);
     }
   };
   dart.setSignature(html$.PushSubscription, {
@@ -67819,74 +69474,74 @@
     get [dartx.startOffset]() {
       return this.startOffset;
     }
-    [dartx.cloneContents]() {
-      return this.cloneContents();
+    [dartx.cloneContents](...args) {
+      return this.cloneContents.apply(this, args);
     }
-    [dartx.cloneRange]() {
-      return this.cloneRange();
+    [dartx.cloneRange](...args) {
+      return this.cloneRange.apply(this, args);
     }
-    [dartx.collapse](toStart) {
-      return this.collapse(toStart);
+    [dartx.collapse](...args) {
+      return this.collapse.apply(this, args);
     }
-    [dartx.compareBoundaryPoints](how, sourceRange) {
-      return this.compareBoundaryPoints(how, sourceRange);
+    [dartx.compareBoundaryPoints](...args) {
+      return this.compareBoundaryPoints.apply(this, args);
     }
-    [dartx.comparePoint](node, offset) {
-      return this.comparePoint(node, offset);
+    [dartx.comparePoint](...args) {
+      return this.comparePoint.apply(this, args);
     }
-    [dartx.createContextualFragment](fragment) {
-      return this.createContextualFragment(fragment);
+    [dartx.createContextualFragment](...args) {
+      return this.createContextualFragment.apply(this, args);
     }
-    [dartx.deleteContents]() {
-      return this.deleteContents();
+    [dartx.deleteContents](...args) {
+      return this.deleteContents.apply(this, args);
     }
-    [dartx.detach]() {
-      return this.detach();
+    [dartx.detach](...args) {
+      return this.detach.apply(this, args);
     }
-    [dartx.expand](unit) {
-      return this.expand(unit);
+    [dartx.expand](...args) {
+      return this.expand.apply(this, args);
     }
-    [dartx.extractContents]() {
-      return this.extractContents();
+    [dartx.extractContents](...args) {
+      return this.extractContents.apply(this, args);
     }
-    [dartx.getBoundingClientRect]() {
-      return this.getBoundingClientRect();
+    [dartx.getBoundingClientRect](...args) {
+      return this.getBoundingClientRect.apply(this, args);
     }
-    [dartx.getClientRects]() {
-      return this.getClientRects();
+    [dartx.getClientRects](...args) {
+      return this.getClientRects.apply(this, args);
     }
-    [dartx.insertNode](node) {
-      return this.insertNode(node);
+    [dartx.insertNode](...args) {
+      return this.insertNode.apply(this, args);
     }
-    [dartx.isPointInRange](node, offset) {
-      return this.isPointInRange(node, offset);
+    [dartx.isPointInRange](...args) {
+      return this.isPointInRange.apply(this, args);
     }
-    [dartx.selectNode](node) {
-      return this.selectNode(node);
+    [dartx.selectNode](...args) {
+      return this.selectNode.apply(this, args);
     }
-    [dartx.selectNodeContents](node) {
-      return this.selectNodeContents(node);
+    [dartx.selectNodeContents](...args) {
+      return this.selectNodeContents.apply(this, args);
     }
-    [dartx.setEnd](node, offset) {
-      return this.setEnd(node, offset);
+    [dartx.setEnd](...args) {
+      return this.setEnd.apply(this, args);
     }
-    [dartx.setEndAfter](node) {
-      return this.setEndAfter(node);
+    [dartx.setEndAfter](...args) {
+      return this.setEndAfter.apply(this, args);
     }
-    [dartx.setEndBefore](node) {
-      return this.setEndBefore(node);
+    [dartx.setEndBefore](...args) {
+      return this.setEndBefore.apply(this, args);
     }
-    [dartx.setStart](node, offset) {
-      return this.setStart(node, offset);
+    [dartx.setStart](...args) {
+      return this.setStart.apply(this, args);
     }
-    [dartx.setStartAfter](node) {
-      return this.setStartAfter(node);
+    [dartx.setStartAfter](...args) {
+      return this.setStartAfter.apply(this, args);
     }
-    [dartx.setStartBefore](node) {
-      return this.setStartBefore(node);
+    [dartx.setStartBefore](...args) {
+      return this.setStartBefore.apply(this, args);
     }
-    [dartx.surroundContents](newParent) {
-      return this.surroundContents(newParent);
+    [dartx.surroundContents](...args) {
+      return this.surroundContents.apply(this, args);
     }
     static get supportsCreateContextualFragment() {
       return "createContextualFragment" in window.Range.prototype;
@@ -67952,11 +69607,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.cancel](reason) {
-      return this.cancel(reason);
+    [dartx.cancel](...args) {
+      return this.cancel.apply(this, args);
     }
-    [dartx.getReader]() {
-      return this.getReader();
+    [dartx.getReader](...args) {
+      return this.getReader.apply(this, args);
     }
   };
   dart.setSignature(html$.ReadableByteStream, {
@@ -67980,14 +69635,14 @@
     get [dartx.closed]() {
       return this.closed;
     }
-    [dartx.cancel](reason) {
-      return this.cancel(reason);
+    [dartx.cancel](...args) {
+      return this.cancel.apply(this, args);
     }
-    [dartx.read]() {
-      return this.read();
+    [dartx.read](...args) {
+      return this.read.apply(this, args);
     }
-    [dartx.releaseLock]() {
-      return this.releaseLock();
+    [dartx.releaseLock](...args) {
+      return this.releaseLock.apply(this, args);
     }
   };
   dart.setSignature(html$.ReadableByteStreamReader, {
@@ -68008,11 +69663,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.cancel](reason) {
-      return this.cancel(reason);
+    [dartx.cancel](...args) {
+      return this.cancel.apply(this, args);
     }
-    [dartx.getReader]() {
-      return this.getReader();
+    [dartx.getReader](...args) {
+      return this.getReader.apply(this, args);
     }
   };
   dart.setSignature(html$.ReadableStream, {
@@ -68036,14 +69691,14 @@
     get [dartx.closed]() {
       return this.closed;
     }
-    [dartx.cancel](reason) {
-      return this.cancel(reason);
+    [dartx.cancel](...args) {
+      return this.cancel.apply(this, args);
     }
-    [dartx.read]() {
-      return this.read();
+    [dartx.read](...args) {
+      return this.read.apply(this, args);
     }
-    [dartx.releaseLock]() {
-      return this.releaseLock();
+    [dartx.releaseLock](...args) {
+      return this.releaseLock.apply(this, args);
     }
   };
   dart.setSignature(html$.ReadableStreamReader, {
@@ -68178,23 +69833,23 @@
     get [dartx.reliable]() {
       return this.reliable;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.send](data) {
-      return this.send(data);
+    [dartx.send](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendBlob](data) {
-      return this.send(data);
+    [dartx.sendBlob](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendByteBuffer](data) {
-      return this.send(data);
+    [dartx.sendByteBuffer](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendString](data) {
-      return this.send(data);
+    [dartx.sendString](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendTypedData](data) {
-      return this.send(data);
+    [dartx.sendTypedData](...args) {
+      return this.send.apply(this, args);
     }
     get [dartx.onClose]() {
       return html$.RtcDataChannel.closeEvent.forTarget(this);
@@ -68260,6 +69915,7 @@
     }
   });
   dart.registerExtension(dart.global.RTCDataChannel, html$.RtcDataChannel);
+  dart.registerExtension(dart.global.DataChannel, html$.RtcDataChannel);
   dart.defineExtensionNames([
     'channel'
   ]);
@@ -68304,8 +69960,8 @@
     get [dartx.track]() {
       return this.track;
     }
-    [dartx.insertDtmf](tones, duration, interToneGap) {
-      return this.insertDTMF(tones, duration, interToneGap);
+    [dartx.insertDtmf](...args) {
+      return this.insertDTMF.apply(this, args);
     }
     get [dartx.onToneChange]() {
       return html$.RtcDtmfSender.toneChangeEvent.forTarget(this);
@@ -68402,6 +70058,7 @@
     })
   });
   dart.registerExtension(dart.global.RTCIceCandidate, html$.RtcIceCandidate);
+  dart.registerExtension(dart.global.mozRTCIceCandidate, html$.RtcIceCandidate);
   dart.defineExtensionNames([
     'candidate'
   ]);
@@ -68418,6 +70075,7 @@
     fields: () => ({[dartx.candidate]: html$.RtcIceCandidate})
   });
   dart.registerExtension(dart.global.RTCIceCandidateEvent, html$.RtcIceCandidateEvent);
+  dart.registerExtension(dart.global.RTCPeerConnectionIceEvent, html$.RtcIceCandidateEvent);
   const _createOffer = Symbol('_createOffer');
   const _createAnswer = Symbol('_createAnswer');
   const _getStats = Symbol('_getStats');
@@ -68528,8 +70186,8 @@
     get [dartx.signalingState]() {
       return this.signalingState;
     }
-    [dartx.addIceCandidate](candidate, successCallback, failureCallback) {
-      return this.addIceCandidate(candidate, successCallback, failureCallback);
+    [dartx.addIceCandidate](...args) {
+      return this.addIceCandidate.apply(this, args);
     }
     [dartx.addStream](stream, mediaConstraints) {
       if (mediaConstraints === void 0) mediaConstraints = null;
@@ -68541,14 +70199,14 @@
       this[_addStream_2](stream);
       return;
     }
-    [_addStream_1](stream, mediaConstraints) {
-      return this.addStream(stream, mediaConstraints);
+    [_addStream_1](...args) {
+      return this.addStream.apply(this, args);
     }
-    [_addStream_2](stream) {
-      return this.addStream(stream);
+    [_addStream_2](...args) {
+      return this.addStream.apply(this, args);
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
     [_createAnswer](successCallback, failureCallback, mediaConstraints) {
       if (failureCallback === void 0) failureCallback = null;
@@ -68561,14 +70219,14 @@
       this[_createAnswer_2](successCallback, failureCallback);
       return;
     }
-    [_createAnswer_1](successCallback, failureCallback, mediaConstraints) {
-      return this.createAnswer(successCallback, failureCallback, mediaConstraints);
+    [_createAnswer_1](...args) {
+      return this.createAnswer.apply(this, args);
     }
-    [_createAnswer_2](successCallback, failureCallback) {
-      return this.createAnswer(successCallback, failureCallback);
+    [_createAnswer_2](...args) {
+      return this.createAnswer.apply(this, args);
     }
-    [dartx.createDtmfSender](track) {
-      return this.createDTMFSender(track);
+    [dartx.createDtmfSender](...args) {
+      return this.createDTMFSender.apply(this, args);
     }
     [dartx.createDataChannel](label, options) {
       if (options === void 0) options = null;
@@ -68578,11 +70236,11 @@
       }
       return this[_createDataChannel_2](label);
     }
-    [_createDataChannel_1](label, options) {
-      return this.createDataChannel(label, options);
+    [_createDataChannel_1](...args) {
+      return this.createDataChannel.apply(this, args);
     }
-    [_createDataChannel_2](label) {
-      return this.createDataChannel(label);
+    [_createDataChannel_2](...args) {
+      return this.createDataChannel.apply(this, args);
     }
     [_createOffer](successCallback, failureCallback, rtcOfferOptions) {
       if (failureCallback === void 0) failureCallback = null;
@@ -68595,29 +70253,29 @@
       this[_createOffer_2](successCallback, failureCallback);
       return;
     }
-    [_createOffer_1](successCallback, failureCallback, rtcOfferOptions) {
-      return this.createOffer(successCallback, failureCallback, rtcOfferOptions);
+    [_createOffer_1](...args) {
+      return this.createOffer.apply(this, args);
     }
-    [_createOffer_2](successCallback, failureCallback) {
-      return this.createOffer(successCallback, failureCallback);
+    [_createOffer_2](...args) {
+      return this.createOffer.apply(this, args);
     }
-    [dartx.getLocalStreams]() {
-      return this.getLocalStreams();
+    [dartx.getLocalStreams](...args) {
+      return this.getLocalStreams.apply(this, args);
     }
-    [dartx.getRemoteStreams]() {
-      return this.getRemoteStreams();
+    [dartx.getRemoteStreams](...args) {
+      return this.getRemoteStreams.apply(this, args);
     }
-    [_getStats](successCallback, selector) {
-      return this.getStats(successCallback, selector);
+    [_getStats](...args) {
+      return this.getStats.apply(this, args);
     }
-    [dartx.getStreamById](streamId) {
-      return this.getStreamById(streamId);
+    [dartx.getStreamById](...args) {
+      return this.getStreamById.apply(this, args);
     }
-    [dartx.removeStream](stream) {
-      return this.removeStream(stream);
+    [dartx.removeStream](...args) {
+      return this.removeStream.apply(this, args);
     }
-    [_setLocalDescription](description, successCallback, failureCallback) {
-      return this.setLocalDescription(description, successCallback, failureCallback);
+    [_setLocalDescription](...args) {
+      return this.setLocalDescription.apply(this, args);
     }
     [dartx.setLocalDescription](description) {
       let completer = async.Completer.new();
@@ -68628,8 +70286,8 @@
       }, StringTovoid$()));
       return completer.future;
     }
-    [_setRemoteDescription](description, successCallback, failureCallback) {
-      return this.setRemoteDescription(description, successCallback, failureCallback);
+    [_setRemoteDescription](...args) {
+      return this.setRemoteDescription.apply(this, args);
     }
     [dartx.setRemoteDescription](description) {
       let completer = async.Completer.new();
@@ -68657,14 +70315,14 @@
       this[_updateIce_3]();
       return;
     }
-    [_updateIce_1](configuration, mediaConstraints) {
-      return this.updateIce(configuration, mediaConstraints);
+    [_updateIce_1](...args) {
+      return this.updateIce.apply(this, args);
     }
-    [_updateIce_2](configuration) {
-      return this.updateIce(configuration);
+    [_updateIce_2](...args) {
+      return this.updateIce.apply(this, args);
     }
-    [_updateIce_3]() {
-      return this.updateIce();
+    [_updateIce_3](...args) {
+      return this.updateIce.apply(this, args);
     }
     get [dartx.onAddStream]() {
       return html$.RtcPeerConnection.addStreamEvent.forTarget(this);
@@ -68777,6 +70435,7 @@
     }
   });
   dart.registerExtension(dart.global.RTCPeerConnection, html$.RtcPeerConnection);
+  dart.registerExtension(dart.global.mozRTCPeerConnection, html$.RtcPeerConnection);
   dart.defineExtensionNames([
     'sdp',
     'type'
@@ -68813,6 +70472,7 @@
     })
   });
   dart.registerExtension(dart.global.RTCSessionDescription, html$.RtcSessionDescription);
+  dart.registerExtension(dart.global.mozRTCSessionDescription, html$.RtcSessionDescription);
   const _get_timestamp = Symbol('_get_timestamp');
   dart.defineExtensionNames([
     'timestamp',
@@ -68837,11 +70497,11 @@
     get [dartx.type]() {
       return this.type;
     }
-    [dartx.names]() {
-      return this.names();
+    [dartx.names](...args) {
+      return this.names.apply(this, args);
     }
-    [dartx.stat](name) {
-      return this.stat(name);
+    [dartx.stat](...args) {
+      return this.stat.apply(this, args);
     }
   };
   dart.setSignature(html$.RtcStatsReport, {
@@ -68866,11 +70526,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.namedItem](name) {
-      return this.namedItem(name);
+    [dartx.namedItem](...args) {
+      return this.namedItem.apply(this, args);
     }
-    [dartx.result]() {
-      return this.result();
+    [dartx.result](...args) {
+      return this.result.apply(this, args);
     }
   };
   dart.setSignature(html$.RtcStatsResponse, {
@@ -68961,11 +70621,11 @@
     get [dartx.type]() {
       return this.type;
     }
-    [dartx.lock](orientation) {
-      return this.lock(orientation);
+    [dartx.lock](...args) {
+      return this.lock.apply(this, args);
     }
-    [dartx.unlock]() {
-      return this.unlock();
+    [dartx.unlock](...args) {
+      return this.unlock.apply(this, args);
     }
     get [dartx.onChange]() {
       return html$.ScreenOrientation.changeEvent.forTarget(this);
@@ -69195,8 +70855,8 @@
     get [dartx.velocityY]() {
       return this.velocityY;
     }
-    [dartx.consumeDelta](x, y) {
-      return this.consumeDelta(x, y);
+    [dartx.consumeDelta](...args) {
+      return this.consumeDelta.apply(this, args);
     }
   };
   dart.setSignature(html$.ScrollState, {
@@ -69438,26 +71098,26 @@
     get [dartx.willValidate]() {
       return this.willValidate;
     }
-    [__setter__](index, option) {
-      return this.__setter__(index, option);
+    [__setter__](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.add](element, before) {
-      return this.add(element, before);
+    [dartx.add](...args) {
+      return this.add.apply(this, args);
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.namedItem](name) {
-      return this.namedItem(name);
+    [dartx.namedItem](...args) {
+      return this.namedItem.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
     get [dartx.options]() {
       let options = ListOfOptionElement().from(this[dartx.querySelectorAll](html$.Element)('option'));
@@ -69468,7 +71128,7 @@
         let options = this[dartx.options][dartx.where](dart.fn(o => o[dartx.selected], OptionElementTobool()))[dartx.toList]();
         return new (UnmodifiableListViewOfOptionElement())(options);
       } else {
-        return JSArrayOfOptionElement().of([this[dartx.options][dartx.get](this[dartx.selectedIndex])]);
+        return JSArrayOfOptionElement().of([this[dartx.options][dartx._get](this[dartx.selectedIndex])]);
       }
     }
   };
@@ -69575,47 +71235,47 @@
     get [dartx.type]() {
       return this.type;
     }
-    [dartx.addRange](range) {
-      return this.addRange(range);
+    [dartx.addRange](...args) {
+      return this.addRange.apply(this, args);
     }
-    [dartx.collapse](node, offset) {
-      return this.collapse(node, offset);
+    [dartx.collapse](...args) {
+      return this.collapse.apply(this, args);
     }
-    [dartx.collapseToEnd]() {
-      return this.collapseToEnd();
+    [dartx.collapseToEnd](...args) {
+      return this.collapseToEnd.apply(this, args);
     }
-    [dartx.collapseToStart]() {
-      return this.collapseToStart();
+    [dartx.collapseToStart](...args) {
+      return this.collapseToStart.apply(this, args);
     }
-    [dartx.containsNode](node, allowPartialContainment) {
-      return this.containsNode(node, allowPartialContainment);
+    [dartx.containsNode](...args) {
+      return this.containsNode.apply(this, args);
     }
-    [dartx.deleteFromDocument]() {
-      return this.deleteFromDocument();
+    [dartx.deleteFromDocument](...args) {
+      return this.deleteFromDocument.apply(this, args);
     }
-    [dartx.empty]() {
-      return this.empty();
+    [dartx.empty](...args) {
+      return this.empty.apply(this, args);
     }
-    [dartx.extend](node, offset) {
-      return this.extend(node, offset);
+    [dartx.extend](...args) {
+      return this.extend.apply(this, args);
     }
-    [dartx.getRangeAt](index) {
-      return this.getRangeAt(index);
+    [dartx.getRangeAt](...args) {
+      return this.getRangeAt.apply(this, args);
     }
-    [dartx.modify](alter, direction, granularity) {
-      return this.modify(alter, direction, granularity);
+    [dartx.modify](...args) {
+      return this.modify.apply(this, args);
     }
-    [dartx.removeAllRanges]() {
-      return this.removeAllRanges();
+    [dartx.removeAllRanges](...args) {
+      return this.removeAllRanges.apply(this, args);
     }
-    [dartx.selectAllChildren](node) {
-      return this.selectAllChildren(node);
+    [dartx.selectAllChildren](...args) {
+      return this.selectAllChildren.apply(this, args);
     }
-    [dartx.setBaseAndExtent](baseNode, baseOffset, extentNode, extentOffset) {
-      return this.setBaseAndExtent(baseNode, baseOffset, extentNode, extentOffset);
+    [dartx.setBaseAndExtent](...args) {
+      return this.setBaseAndExtent.apply(this, args);
     }
-    [dartx.setPosition](node, offset) {
-      return this.setPosition(node, offset);
+    [dartx.setPosition](...args) {
+      return this.setPosition.apply(this, args);
     }
   };
   dart.setSignature(html$.Selection, {
@@ -69671,8 +71331,8 @@
     get [dartx.targetUrl]() {
       return this.targetURL;
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
     [dartx.postMessage](message, transfer) {
       if (transfer === void 0) transfer = null;
@@ -69685,11 +71345,11 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
   };
   dart.setSignature(html$.ServicePort, {
@@ -69727,18 +71387,18 @@
       }
       return this[_connect_2](url);
     }
-    [_connect_1](url, options) {
-      return this.connect(url, options);
+    [_connect_1](...args) {
+      return this.connect.apply(this, args);
     }
-    [_connect_2](url) {
-      return this.connect(url);
+    [_connect_2](...args) {
+      return this.connect.apply(this, args);
     }
     [dartx.match](options) {
       let options_1 = html_common.convertDartToNative_Dictionary(options);
       return this[_match_1](options_1);
     }
-    [_match_1](options) {
-      return this.match(options);
+    [_match_1](...args) {
+      return this.match.apply(this, args);
     }
     [dartx.matchAll](options) {
       if (options === void 0) options = null;
@@ -69748,11 +71408,11 @@
       }
       return this[_matchAll_2]();
     }
-    [_matchAll_1](options) {
-      return this.matchAll(options);
+    [_matchAll_1](...args) {
+      return this.matchAll.apply(this, args);
     }
-    [_matchAll_2]() {
-      return this.matchAll();
+    [_matchAll_2](...args) {
+      return this.matchAll.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.ServicePortCollection.messageEvent.forTarget(this);
@@ -69808,8 +71468,8 @@
     get [dartx.targetUrl]() {
       return this.targetURL;
     }
-    [dartx.respondWith](response) {
-      return this.respondWith(response);
+    [dartx.respondWith](...args) {
+      return this.respondWith.apply(this, args);
     }
   };
   dart.setSignature(html$.ServicePortConnectEvent, {
@@ -69847,11 +71507,11 @@
     get [dartx.ready]() {
       return this.ready;
     }
-    [dartx.getRegistration](documentURL) {
-      return this.getRegistration(documentURL);
+    [dartx.getRegistration](...args) {
+      return this.getRegistration.apply(this, args);
     }
-    [dartx.getRegistrations]() {
-      return this.getRegistrations();
+    [dartx.getRegistrations](...args) {
+      return this.getRegistrations.apply(this, args);
     }
     [dartx.register](url, options) {
       if (options === void 0) options = null;
@@ -69861,11 +71521,11 @@
       }
       return this[_register_2](url);
     }
-    [_register_1](url, options) {
-      return this.register(url, options);
+    [_register_1](...args) {
+      return this.register.apply(this, args);
     }
-    [_register_2](url) {
-      return this.register(url);
+    [_register_2](...args) {
+      return this.register.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.ServiceWorkerContainer.messageEvent.forTarget(this);
@@ -69913,8 +71573,8 @@
     get [dartx.registration]() {
       return this.registration;
     }
-    [dartx.skipWaiting]() {
-      return this.skipWaiting();
+    [dartx.skipWaiting](...args) {
+      return this.skipWaiting.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.ServiceWorkerGlobalScope.messageEvent.forTarget(this);
@@ -70055,11 +71715,11 @@
       }
       return this[_getNotifications_2]();
     }
-    [_getNotifications_1](filter) {
-      return this.getNotifications(filter);
+    [_getNotifications_1](...args) {
+      return this.getNotifications.apply(this, args);
     }
-    [_getNotifications_2]() {
-      return this.getNotifications();
+    [_getNotifications_2](...args) {
+      return this.getNotifications.apply(this, args);
     }
     [dartx.showNotification](title, options) {
       if (options === void 0) options = null;
@@ -70069,17 +71729,17 @@
       }
       return this[_showNotification_2](title);
     }
-    [_showNotification_1](title, options) {
-      return this.showNotification(title, options);
+    [_showNotification_1](...args) {
+      return this.showNotification.apply(this, args);
     }
-    [_showNotification_2](title) {
-      return this.showNotification(title);
+    [_showNotification_2](...args) {
+      return this.showNotification.apply(this, args);
     }
-    [dartx.unregister]() {
-      return this.unregister();
+    [dartx.unregister](...args) {
+      return this.unregister.apply(this, args);
     }
-    [dartx.update]() {
-      return this.update();
+    [dartx.update](...args) {
+      return this.update.apply(this, args);
     }
   };
   dart.setSignature(html$.ServiceWorkerRegistration, {
@@ -70122,8 +71782,8 @@
     static get supported() {
       return html$.Element.isTagSupported('shadow');
     }
-    [dartx.getDistributedNodes]() {
-      return this.getDistributedNodes();
+    [dartx.getDistributedNodes](...args) {
+      return this.getDistributedNodes.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.ShadowElement, 'created');
@@ -70178,17 +71838,17 @@
     get [dartx.styleSheets]() {
       return this.styleSheets;
     }
-    [dartx.clone](deep) {
-      return this.cloneNode(deep);
+    [dartx.clone](...args) {
+      return this.cloneNode.apply(this, args);
     }
-    [dartx.elementFromPoint](x, y) {
-      return this.elementFromPoint(x, y);
+    [dartx.elementFromPoint](...args) {
+      return this.elementFromPoint.apply(this, args);
     }
-    [dartx.elementsFromPoint](x, y) {
-      return this.elementsFromPoint(x, y);
+    [dartx.elementsFromPoint](...args) {
+      return this.elementsFromPoint.apply(this, args);
     }
-    [dartx.getSelection]() {
-      return this.getSelection();
+    [dartx.getSelection](...args) {
+      return this.getSelection.apply(this, args);
     }
     static get supported() {
       return !!(Element.prototype.createShadowRoot || Element.prototype.webkitCreateShadowRoot);
@@ -70398,20 +72058,20 @@
     get [dartx.updating]() {
       return this.updating;
     }
-    [dartx.abort]() {
-      return this.abort();
+    [dartx.abort](...args) {
+      return this.abort.apply(this, args);
     }
-    [dartx.appendBuffer](data) {
-      return this.appendBuffer(data);
+    [dartx.appendBuffer](...args) {
+      return this.appendBuffer.apply(this, args);
     }
-    [dartx.appendStream](stream, maxSize) {
-      return this.appendStream(stream, maxSize);
+    [dartx.appendStream](...args) {
+      return this.appendStream.apply(this, args);
     }
-    [dartx.appendTypedData](data) {
-      return this.appendBuffer(data);
+    [dartx.appendTypedData](...args) {
+      return this.appendBuffer.apply(this, args);
     }
-    [dartx.remove](start, end) {
-      return this.remove(start, end);
+    [dartx.remove](...args) {
+      return this.remove.apply(this, args);
     }
   };
   dart.setSignature(html$.SourceBuffer, {
@@ -70436,8 +72096,8 @@
   dart.registerExtension(dart.global.SourceBuffer, html$.SourceBuffer);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -70452,11 +72112,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -70485,10 +72145,10 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$.SourceBufferList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfSourceBuffer()];
@@ -70502,8 +72162,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.SourceBuffer, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.SourceBuffer]),
+      [dartx._get]: dart.definiteFunctionType(html$.SourceBuffer, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.SourceBuffer]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.SourceBuffer, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.SourceBuffer, [core.int])
     })
@@ -70673,8 +72333,8 @@
   dart.registerExtension(dart.global.SpeechGrammar, html$.SpeechGrammar);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -70697,11 +72357,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -70730,16 +72390,16 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.addFromString](string, weight) {
-      return this.addFromString(string, weight);
+    [dartx.addFromString](...args) {
+      return this.addFromString.apply(this, args);
     }
-    [dartx.addFromUri](src, weight) {
-      return this.addFromUri(src, weight);
+    [dartx.addFromUri](...args) {
+      return this.addFromUri.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$.SpeechGrammarList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfSpeechGrammar()];
@@ -70756,8 +72416,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.SpeechGrammar, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.SpeechGrammar]),
+      [dartx._get]: dart.definiteFunctionType(html$.SpeechGrammar, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.SpeechGrammar]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.SpeechGrammar, [core.int]),
       [dartx.addFromString]: dart.definiteFunctionType(dart.void, [core.String], [core.num]),
       [dartx.addFromUri]: dart.definiteFunctionType(dart.void, [core.String], [core.num]),
@@ -70839,14 +72499,14 @@
     set [dartx.serviceUri](value) {
       this.serviceURI = value;
     }
-    [dartx.abort]() {
-      return this.abort();
+    [dartx.abort](...args) {
+      return this.abort.apply(this, args);
     }
-    [dartx.start]() {
-      return this.start();
+    [dartx.start](...args) {
+      return this.start.apply(this, args);
     }
-    [dartx.stop]() {
-      return this.stop();
+    [dartx.stop](...args) {
+      return this.stop.apply(this, args);
     }
     get [dartx.onAudioEnd]() {
       return html$.SpeechRecognition.audioEndEvent.forTarget(this);
@@ -71106,8 +72766,8 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   dart.setSignature(html$.SpeechRecognitionResult, {
@@ -71142,20 +72802,20 @@
     get [dartx.speaking]() {
       return this.speaking;
     }
-    [dartx.cancel]() {
-      return this.cancel();
+    [dartx.cancel](...args) {
+      return this.cancel.apply(this, args);
     }
-    [dartx.getVoices]() {
-      return this.getVoices();
+    [dartx.getVoices](...args) {
+      return this.getVoices.apply(this, args);
     }
-    [dartx.pause]() {
-      return this.pause();
+    [dartx.pause](...args) {
+      return this.pause.apply(this, args);
     }
-    [dartx.resume]() {
-      return this.resume();
+    [dartx.resume](...args) {
+      return this.resume.apply(this, args);
     }
-    [dartx.speak](utterance) {
-      return this.speak(utterance);
+    [dartx.speak](...args) {
+      return this.speak.apply(this, args);
     }
   };
   dart.setSignature(html$.SpeechSynthesis, {
@@ -71420,8 +73080,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.add](name, port) {
-      return this.add(name, port);
+    [dartx.add](...args) {
+      return this.add.apply(this, args);
     }
     get [dartx.onMessage]() {
       return html$.StashedPortCollection.messageEvent.forTarget(this);
@@ -71449,8 +73109,8 @@
     'addAll',
     'containsValue',
     'containsKey',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'putIfAbsent',
     'remove',
     'clear',
@@ -71464,7 +73124,7 @@
   html$.Storage = class Storage extends _interceptors.Interceptor {
     [dartx.addAll](other) {
       other[dartx.forEach](dart.fn((k, v) => {
-        this[dartx.set](k, v);
+        this[dartx._set](k, v);
       }, StringAndStringTovoid$()));
     }
     [dartx.containsValue](value) {
@@ -71473,19 +73133,19 @@
     [dartx.containsKey](key) {
       return this[_getItem](core.String._check(key)) != null;
     }
-    [dartx.get](key) {
+    [dartx._get](key) {
       return this[_getItem](core.String._check(key));
     }
-    [dartx.set](key, value) {
+    [dartx._set](key, value) {
       this[_setItem](key, value);
       return value;
     }
     [dartx.putIfAbsent](key, ifAbsent) {
-      if (!dart.test(this[dartx.containsKey](key))) this[dartx.set](key, ifAbsent());
-      return this[dartx.get](key);
+      if (!dart.test(this[dartx.containsKey](key))) this[dartx._set](key, ifAbsent());
+      return this[dartx._get](key);
     }
     [dartx.remove](key) {
-      let value = this[dartx.get](key);
+      let value = this[dartx._get](key);
       this[_removeItem](core.String._check(key));
       return value;
     }
@@ -71496,7 +73156,7 @@
       for (let i = 0; true; i++) {
         let key = this[_key](i);
         if (key == null) return;
-        f(key, this[dartx.get](key));
+        f(key, this[dartx._get](key));
       }
     }
     get [dartx.keys]() {
@@ -71524,29 +73184,29 @@
     get [_length$2]() {
       return this.length;
     }
-    [__delete__](index_OR_name) {
-      return this.__delete__(index_OR_name);
+    [__delete__](...args) {
+      return this.__delete__.apply(this, args);
     }
-    [__getter__](index_OR_name) {
-      return this.__getter__(index_OR_name);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [__setter__](index_OR_name, value) {
-      return this.__setter__(index_OR_name, value);
+    [__setter__](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [_clear$1]() {
-      return this.clear();
+    [_clear$1](...args) {
+      return this.clear.apply(this, args);
     }
-    [_getItem](key) {
-      return this.getItem(key);
+    [_getItem](...args) {
+      return this.getItem.apply(this, args);
     }
-    [_key](index) {
-      return this.key(index);
+    [_key](...args) {
+      return this.key.apply(this, args);
     }
-    [_removeItem](key) {
-      return this.removeItem(key);
+    [_removeItem](...args) {
+      return this.removeItem.apply(this, args);
     }
-    [_setItem](key, data) {
-      return this.setItem(key, data);
+    [_setItem](...args) {
+      return this.setItem.apply(this, args);
     }
   };
   html$.Storage[dart.implements] = () => [MapOfString$String()];
@@ -71564,8 +73224,8 @@
       [dartx.addAll]: dart.definiteFunctionType(dart.void, [MapOfString$String()]),
       [dartx.containsValue]: dart.definiteFunctionType(core.bool, [core.Object]),
       [dartx.containsKey]: dart.definiteFunctionType(core.bool, [core.Object]),
-      [dartx.get]: dart.definiteFunctionType(core.String, [core.Object]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.String, core.String]),
+      [dartx._get]: dart.definiteFunctionType(core.String, [core.Object]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.String, core.String]),
       [dartx.putIfAbsent]: dart.definiteFunctionType(core.String, [core.String, VoidToString()]),
       [dartx.remove]: dart.definiteFunctionType(core.String, [core.Object]),
       [dartx.clear]: dart.definiteFunctionType(dart.void, []),
@@ -71632,8 +73292,8 @@
     get [dartx.url]() {
       return this.url;
     }
-    [_initStorageEvent](typeArg, canBubbleArg, cancelableArg, keyArg, oldValueArg, newValueArg, urlArg, storageAreaArg) {
-      return this.initStorageEvent(typeArg, canBubbleArg, cancelableArg, keyArg, oldValueArg, newValueArg, urlArg, storageAreaArg);
+    [_initStorageEvent](...args) {
+      return this.initStorageEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.StorageEvent, {
@@ -71691,11 +73351,11 @@
     get [dartx.supportedTypes]() {
       return this.supportedTypes;
     }
-    [dartx.queryInfo](type) {
-      return this.queryInfo(type);
+    [dartx.queryInfo](...args) {
+      return this.queryInfo.apply(this, args);
     }
-    [dartx.requestPersistentQuota](newQuota) {
-      return this.requestPersistentQuota(newQuota);
+    [dartx.requestPersistentQuota](...args) {
+      return this.requestPersistentQuota.apply(this, args);
     }
   };
   dart.setSignature(html$.StorageQuota, {
@@ -71778,8 +73438,8 @@
     get [dartx.type]() {
       return this.type;
     }
-    [dartx.matchMedium](mediaquery) {
-      return this.matchMedium(mediaquery);
+    [dartx.matchMedium](...args) {
+      return this.matchMedium.apply(this, args);
     }
   };
   dart.setSignature(html$.StyleMedia, {
@@ -71826,14 +73486,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getRegistration](tag) {
-      return this.getRegistration(tag);
+    [dartx.getRegistration](...args) {
+      return this.getRegistration.apply(this, args);
     }
-    [dartx.getRegistrations]() {
-      return this.getRegistrations();
+    [dartx.getRegistrations](...args) {
+      return this.getRegistrations.apply(this, args);
     }
-    [dartx.permissionState]() {
-      return this.permissionState();
+    [dartx.permissionState](...args) {
+      return this.permissionState.apply(this, args);
     }
     [dartx.register](options) {
       if (options === void 0) options = null;
@@ -71843,11 +73503,11 @@
       }
       return this[_register_2]();
     }
-    [_register_1](options) {
-      return this.register(options);
+    [_register_1](...args) {
+      return this.register.apply(this, args);
     }
-    [_register_2]() {
-      return this.register();
+    [_register_2](...args) {
+      return this.register.apply(this, args);
     }
   };
   dart.setSignature(html$.SyncManager, {
@@ -71873,8 +73533,8 @@
     get [dartx.tag]() {
       return this.tag;
     }
-    [dartx.unregister]() {
-      return this.unregister();
+    [dartx.unregister](...args) {
+      return this.unregister.apply(this, args);
     }
   };
   dart.setSignature(html$.SyncRegistration, {
@@ -71960,6 +73620,8 @@
     })
   });
   dart.registerExtension(dart.global.HTMLTableCellElement, html$.TableCellElement);
+  dart.registerExtension(dart.global.HTMLTableDataCellElement, html$.TableCellElement);
+  dart.registerExtension(dart.global.HTMLTableHeaderCellElement, html$.TableCellElement);
   dart.defineExtensionNames([
     'span'
   ]);
@@ -72050,8 +73712,8 @@
       this[dartx.children][dartx.add](tbody);
       return html$.TableSectionElement._check(tbody);
     }
-    [_nativeCreateTBody]() {
-      return this.createTBody();
+    [_nativeCreateTBody](...args) {
+      return this.createTBody.apply(this, args);
     }
     [dartx.createFragment](html, opts) {
       let validator = opts && 'validator' in opts ? opts.validator : null;
@@ -72103,29 +73765,29 @@
     set [dartx.tHead](value) {
       this.tHead = value;
     }
-    [_createCaption]() {
-      return this.createCaption();
+    [_createCaption](...args) {
+      return this.createCaption.apply(this, args);
     }
-    [_createTFoot]() {
-      return this.createTFoot();
+    [_createTFoot](...args) {
+      return this.createTFoot.apply(this, args);
     }
-    [_createTHead]() {
-      return this.createTHead();
+    [_createTHead](...args) {
+      return this.createTHead.apply(this, args);
     }
-    [dartx.deleteCaption]() {
-      return this.deleteCaption();
+    [dartx.deleteCaption](...args) {
+      return this.deleteCaption.apply(this, args);
     }
-    [dartx.deleteRow](index) {
-      return this.deleteRow(index);
+    [dartx.deleteRow](...args) {
+      return this.deleteRow.apply(this, args);
     }
-    [dartx.deleteTFoot]() {
-      return this.deleteTFoot();
+    [dartx.deleteTFoot](...args) {
+      return this.deleteTFoot.apply(this, args);
     }
-    [dartx.deleteTHead]() {
-      return this.deleteTHead();
+    [dartx.deleteTHead](...args) {
+      return this.deleteTHead.apply(this, args);
     }
-    [_insertRow](index) {
-      return this.insertRow(index);
+    [_insertRow](...args) {
+      return this.insertRow.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.TableElement, 'created');
@@ -72220,11 +73882,11 @@
     get [dartx.sectionRowIndex]() {
       return this.sectionRowIndex;
     }
-    [dartx.deleteCell](index) {
-      return this.deleteCell(index);
+    [dartx.deleteCell](...args) {
+      return this.deleteCell.apply(this, args);
     }
-    [_insertCell](index) {
-      return this.insertCell(index);
+    [_insertCell](...args) {
+      return this.insertCell.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.TableRowElement, 'created');
@@ -72286,11 +73948,11 @@
     get [_rows]() {
       return this.rows;
     }
-    [dartx.deleteRow](index) {
-      return this.deleteRow(index);
+    [dartx.deleteRow](...args) {
+      return this.deleteRow.apply(this, args);
     }
-    [_insertRow](index) {
-      return this.insertRow(index);
+    [_insertRow](...args) {
+      return this.insertRow.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.TableSectionElement, 'created');
@@ -72554,23 +74216,23 @@
     set [dartx.wrap](value) {
       this.wrap = value;
     }
-    [dartx.checkValidity]() {
-      return this.checkValidity();
+    [dartx.checkValidity](...args) {
+      return this.checkValidity.apply(this, args);
     }
-    [dartx.reportValidity]() {
-      return this.reportValidity();
+    [dartx.reportValidity](...args) {
+      return this.reportValidity.apply(this, args);
     }
-    [dartx.select]() {
-      return this.select();
+    [dartx.select](...args) {
+      return this.select.apply(this, args);
     }
-    [dartx.setCustomValidity](error) {
-      return this.setCustomValidity(error);
+    [dartx.setCustomValidity](...args) {
+      return this.setCustomValidity.apply(this, args);
     }
-    [dartx.setRangeText](replacement, opts) {
-      return this.setRangeText(replacement, opts);
+    [dartx.setRangeText](...args) {
+      return this.setRangeText.apply(this, args);
     }
-    [dartx.setSelectionRange](start, end, direction) {
-      return this.setSelectionRange(start, end, direction);
+    [dartx.setSelectionRange](...args) {
+      return this.setSelectionRange.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.TextAreaElement, 'created');
@@ -72641,8 +74303,8 @@
     get [dartx.data]() {
       return this.data;
     }
-    [_initTextEvent](typeArg, canBubbleArg, cancelableArg, viewArg, dataArg) {
-      return this.initTextEvent(typeArg, canBubbleArg, cancelableArg, viewArg, dataArg);
+    [_initTextEvent](...args) {
+      return this.initTextEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.TextEvent, {
@@ -72773,17 +74435,17 @@
     get [dartx.regions]() {
       return this.regions;
     }
-    [dartx.addCue](cue) {
-      return this.addCue(cue);
+    [dartx.addCue](...args) {
+      return this.addCue.apply(this, args);
     }
-    [dartx.addRegion](region) {
-      return this.addRegion(region);
+    [dartx.addRegion](...args) {
+      return this.addRegion.apply(this, args);
     }
-    [dartx.removeCue](cue) {
-      return this.removeCue(cue);
+    [dartx.removeCue](...args) {
+      return this.removeCue.apply(this, args);
     }
-    [dartx.removeRegion](region) {
-      return this.removeRegion(region);
+    [dartx.removeRegion](...args) {
+      return this.removeRegion.apply(this, args);
     }
     get [dartx.onCueChange]() {
       return html$.TextTrack.cueChangeEvent.forTarget(this);
@@ -72892,8 +74554,8 @@
   dart.registerExtension(dart.global.TextTrackCue, html$.TextTrackCue);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -72909,11 +74571,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -72942,13 +74604,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.getCueById](id) {
-      return this.getCueById(id);
+    [dartx.getCueById](...args) {
+      return this.getCueById.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$.TextTrackCueList[dart.implements] = () => [ListOfTextTrackCue(), _js_helper.JavaScriptIndexingBehavior];
@@ -72962,8 +74624,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.TextTrackCue, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.TextTrackCue]),
+      [dartx._get]: dart.definiteFunctionType(html$.TextTrackCue, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.TextTrackCue]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.TextTrackCue, [core.int]),
       [dartx.getCueById]: dart.definiteFunctionType(html$.TextTrackCue, [core.String]),
       [dartx.item]: dart.definiteFunctionType(html$.TextTrackCue, [core.int])
@@ -72972,8 +74634,8 @@
   dart.registerExtension(dart.global.TextTrackCueList, html$.TextTrackCueList);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -72991,11 +74653,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -73024,13 +74686,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.getTrackById](id) {
-      return this.getTrackById(id);
+    [dartx.getTrackById](...args) {
+      return this.getTrackById.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
     get [dartx.onAddTrack]() {
       return html$.TextTrackList.addTrackEvent.forTarget(this);
@@ -73052,8 +74714,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.TextTrack, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.TextTrack]),
+      [dartx._get]: dart.definiteFunctionType(html$.TextTrack, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.TextTrack]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.TextTrack, [core.int]),
       [dartx.getTrackById]: dart.definiteFunctionType(html$.TextTrack, [core.String]),
       [dartx.item]: dart.definiteFunctionType(html$.TextTrack, [core.int])
@@ -73084,11 +74746,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.end](index) {
-      return this.end(index);
+    [dartx.end](...args) {
+      return this.end.apply(this, args);
     }
-    [dartx.start](index) {
-      return this.start(index);
+    [dartx.start](...args) {
+      return this.start.apply(this, args);
     }
   };
   dart.setSignature(html$.TimeRanges, {
@@ -73311,8 +74973,8 @@
     get [dartx.touches]() {
       return this.touches;
     }
-    [_initTouchEvent](touches, targetTouches, changedTouches, type, view, unused1, unused2, unused3, unused4, ctrlKey, altKey, shiftKey, metaKey) {
-      return this.initTouchEvent(touches, targetTouches, changedTouches, type, view, unused1, unused2, unused3, unused4, ctrlKey, altKey, shiftKey, metaKey);
+    [_initTouchEvent](...args) {
+      return this.initTouchEvent.apply(this, args);
     }
     static get supported() {
       return html_common.Device.isEventTypeSupported('TouchEvent');
@@ -73338,8 +75000,8 @@
   dart.registerExtension(dart.global.TouchEvent, html$.TouchEvent);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -73360,11 +75022,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -73393,10 +75055,10 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$.TouchList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfTouch()];
@@ -73413,8 +75075,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.Touch, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.Touch]),
+      [dartx._get]: dart.definiteFunctionType(html$.Touch, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.Touch]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.Touch, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.Touch, [core.int])
     }),
@@ -73506,8 +75168,8 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   dart.setSignature(html$.TrackDefaultList, {
@@ -73707,6 +75369,7 @@
     names: ['_create_1', '_create_2']
   });
   dart.registerExtension(dart.global.TransitionEvent, html$.TransitionEvent);
+  dart.registerExtension(dart.global.WebKitTransitionEvent, html$.TransitionEvent);
   dart.defineExtensionNames([
     'firstChild',
     'lastChild',
@@ -73742,26 +75405,26 @@
     get [dartx.whatToShow]() {
       return this.whatToShow;
     }
-    [dartx.firstChild]() {
-      return this.firstChild();
+    [dartx.firstChild](...args) {
+      return this.firstChild.apply(this, args);
     }
-    [dartx.lastChild]() {
-      return this.lastChild();
+    [dartx.lastChild](...args) {
+      return this.lastChild.apply(this, args);
     }
-    [dartx.nextNode]() {
-      return this.nextNode();
+    [dartx.nextNode](...args) {
+      return this.nextNode.apply(this, args);
     }
-    [dartx.nextSibling]() {
-      return this.nextSibling();
+    [dartx.nextSibling](...args) {
+      return this.nextSibling.apply(this, args);
     }
-    [dartx.parentNode]() {
-      return this.parentNode();
+    [dartx.parentNode](...args) {
+      return this.parentNode.apply(this, args);
     }
-    [dartx.previousNode]() {
-      return this.previousNode();
+    [dartx.previousNode](...args) {
+      return this.previousNode.apply(this, args);
     }
-    [dartx.previousSibling]() {
-      return this.previousSibling();
+    [dartx.previousSibling](...args) {
+      return this.previousSibling.apply(this, args);
     }
   };
   dart.setSignature(html$.TreeWalker, {
@@ -73965,7 +75628,84 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get hash() {
+      return this[hash];
+    }
+    set hash(value) {
+      this[hash] = value;
+    }
+    get host() {
+      return this[host];
+    }
+    set host(value) {
+      this[host] = value;
+    }
+    get hostname() {
+      return this[hostname];
+    }
+    set hostname(value) {
+      this[hostname] = value;
+    }
+    get href() {
+      return this[href];
+    }
+    set href(value) {
+      this[href] = value;
+    }
+    get origin() {
+      return this[origin];
+    }
+    set origin(value) {
+      super.origin = value;
+    }
+    get password() {
+      return this[password];
+    }
+    set password(value) {
+      this[password] = value;
+    }
+    get pathname() {
+      return this[pathname];
+    }
+    set pathname(value) {
+      this[pathname] = value;
+    }
+    get port() {
+      return this[port];
+    }
+    set port(value) {
+      this[port] = value;
+    }
+    get protocol() {
+      return this[protocol];
+    }
+    set protocol(value) {
+      this[protocol] = value;
+    }
+    get search() {
+      return this[search];
+    }
+    set search(value) {
+      this[search] = value;
+    }
+    get username() {
+      return this[username];
+    }
+    set username(value) {
+      this[username] = value;
+    }
   };
+  const hash = Symbol(html$.UrlUtils.name + "." + 'hash'.toString());
+  const host = Symbol(html$.UrlUtils.name + "." + 'host'.toString());
+  const hostname = Symbol(html$.UrlUtils.name + "." + 'hostname'.toString());
+  const href = Symbol(html$.UrlUtils.name + "." + 'href'.toString());
+  const origin = Symbol(html$.UrlUtils.name + "." + 'origin'.toString());
+  const password = Symbol(html$.UrlUtils.name + "." + 'password'.toString());
+  const pathname = Symbol(html$.UrlUtils.name + "." + 'pathname'.toString());
+  const port = Symbol(html$.UrlUtils.name + "." + 'port'.toString());
+  const protocol = Symbol(html$.UrlUtils.name + "." + 'protocol'.toString());
+  const search = Symbol(html$.UrlUtils.name + "." + 'search'.toString());
+  const username = Symbol(html$.UrlUtils.name + "." + 'username'.toString());
   dart.setSignature(html$.UrlUtils, {
     constructors: () => ({_: dart.definiteFunctionType(html$.UrlUtils, [])}),
     fields: () => ({
@@ -74020,7 +75760,70 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get hash() {
+      return this[hash$];
+    }
+    set hash(value) {
+      super.hash = value;
+    }
+    get host() {
+      return this[host$];
+    }
+    set host(value) {
+      super.host = value;
+    }
+    get hostname() {
+      return this[hostname$];
+    }
+    set hostname(value) {
+      super.hostname = value;
+    }
+    get href() {
+      return this[href$];
+    }
+    set href(value) {
+      super.href = value;
+    }
+    get origin() {
+      return this[origin$];
+    }
+    set origin(value) {
+      super.origin = value;
+    }
+    get pathname() {
+      return this[pathname$];
+    }
+    set pathname(value) {
+      super.pathname = value;
+    }
+    get port() {
+      return this[port$];
+    }
+    set port(value) {
+      super.port = value;
+    }
+    get protocol() {
+      return this[protocol$];
+    }
+    set protocol(value) {
+      super.protocol = value;
+    }
+    get search() {
+      return this[search$];
+    }
+    set search(value) {
+      super.search = value;
+    }
   };
+  const hash$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'hash'.toString());
+  const host$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'host'.toString());
+  const hostname$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'hostname'.toString());
+  const href$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'href'.toString());
+  const origin$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'origin'.toString());
+  const pathname$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'pathname'.toString());
+  const port$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'port'.toString());
+  const protocol$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'protocol'.toString());
+  const search$ = Symbol(html$.UrlUtilsReadOnly.name + "." + 'search'.toString());
   dart.setSignature(html$.UrlUtilsReadOnly, {
     constructors: () => ({_: dart.definiteFunctionType(html$.UrlUtilsReadOnly, [])}),
     fields: () => ({
@@ -74331,14 +76134,14 @@
     set [dartx.width](value) {
       this.width = value;
     }
-    [dartx.getVideoPlaybackQuality]() {
-      return this.getVideoPlaybackQuality();
+    [dartx.getVideoPlaybackQuality](...args) {
+      return this.getVideoPlaybackQuality.apply(this, args);
     }
-    [dartx.enterFullscreen]() {
-      return this.webkitEnterFullscreen();
+    [dartx.enterFullscreen](...args) {
+      return this.webkitEnterFullscreen.apply(this, args);
     }
-    [dartx.exitFullscreen]() {
-      return this.webkitExitFullscreen();
+    [dartx.exitFullscreen](...args) {
+      return this.webkitExitFullscreen.apply(this, args);
     }
   };
   dart.defineNamedConstructor(html$.VideoElement, 'created');
@@ -74455,11 +76258,11 @@
     get [dartx.selectedIndex]() {
       return this.selectedIndex;
     }
-    [__getter__](index) {
-      return this.__getter__(index);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.getTrackById](id) {
-      return this.getTrackById(id);
+    [dartx.getTrackById](...args) {
+      return this.getTrackById.apply(this, args);
     }
     get [dartx.onChange]() {
       return html$.VideoTrackList.changeEvent.forTarget(this);
@@ -74554,8 +76357,8 @@
     set [dartx.vertical](value) {
       this.vertical = value;
     }
-    [dartx.getCueAsHtml]() {
-      return this.getCueAsHTML();
+    [dartx.getCueAsHtml](...args) {
+      return this.getCueAsHTML.apply(this, args);
     }
   };
   dart.setSignature(html$.VttCue, {
@@ -74683,11 +76486,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.getRegionById](id) {
-      return this.getRegionById(id);
+    [dartx.getRegionById](...args) {
+      return this.getRegionById.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   dart.setSignature(html$.VttRegionList, {
@@ -74758,23 +76561,23 @@
     get [dartx.url]() {
       return this.url;
     }
-    [dartx.close](code, reason) {
-      return this.close(code, reason);
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.send](data) {
-      return this.send(data);
+    [dartx.send](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendBlob](data) {
-      return this.send(data);
+    [dartx.sendBlob](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendByteBuffer](data) {
-      return this.send(data);
+    [dartx.sendByteBuffer](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendString](data) {
-      return this.send(data);
+    [dartx.sendString](...args) {
+      return this.send.apply(this, args);
     }
-    [dartx.sendTypedData](data) {
-      return this.send(data);
+    [dartx.sendTypedData](...args) {
+      return this.send.apply(this, args);
     }
     get [dartx.onClose]() {
       return html$.WebSocket.closeEvent.forTarget(this);
@@ -74945,14 +76748,14 @@
     get [_hasInitMouseScrollEvent]() {
       return !!this.initMouseScrollEvent;
     }
-    [_initMouseScrollEvent](type, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, axis) {
-      return this.initMouseScrollEvent(type, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, axis);
+    [_initMouseScrollEvent](...args) {
+      return this.initMouseScrollEvent.apply(this, args);
     }
     get [_hasInitWheelEvent]() {
       return !!this.initWheelEvent;
     }
-    [_initWheelEvent](eventType, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, button, relatedTarget, modifiersList, deltaX, deltaY, deltaZ, deltaMode) {
-      return this.initWheelEvent(eventType, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, button, relatedTarget, modifiersList, deltaX, deltaY, deltaZ, deltaMode);
+    [_initWheelEvent](...args) {
+      return this.initWheelEvent.apply(this, args);
     }
   };
   dart.setSignature(html$.WheelEvent, {
@@ -75214,11 +77017,11 @@
       this[_ensureRequestAnimationFrame]();
       this[_cancelAnimationFrame](id);
     }
-    [_requestAnimationFrame](callback) {
-      return this.requestAnimationFrame(callback);
+    [_requestAnimationFrame](...args) {
+      return this.requestAnimationFrame.apply(this, args);
     }
-    [_cancelAnimationFrame](id) {
-      return this.cancelAnimationFrame(id);
+    [_cancelAnimationFrame](...args) {
+      return this.cancelAnimationFrame.apply(this, args);
     }
     [_ensureRequestAnimationFrame]() {
       if (!!(this.requestAnimationFrame && this.cancelAnimationFrame)) return;
@@ -75411,20 +77214,20 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [__getter___1](index) {
-      return this.__getter__(index);
+    [__getter___1](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [__getter___2](name) {
-      return this.__getter__(name);
+    [__getter___2](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.alert](message) {
-      return this.alert(message);
+    [dartx.alert](...args) {
+      return this.alert.apply(this, args);
     }
-    [dartx.close]() {
-      return this.close();
+    [dartx.close](...args) {
+      return this.close.apply(this, args);
     }
-    [dartx.confirm](message) {
-      return this.confirm(message);
+    [dartx.confirm](...args) {
+      return this.confirm.apply(this, args);
     }
     [dartx.fetch](input, init) {
       if (init === void 0) init = null;
@@ -75434,35 +77237,35 @@
       }
       return this[_fetch_2](input);
     }
-    [_fetch_1](input, init) {
-      return this.fetch(input, init);
+    [_fetch_1](...args) {
+      return this.fetch.apply(this, args);
     }
-    [_fetch_2](input) {
-      return this.fetch(input);
+    [_fetch_2](...args) {
+      return this.fetch.apply(this, args);
     }
-    [dartx.find](string, caseSensitive, backwards, wrap, wholeWord, searchInFrames, showDialog) {
-      return this.find(string, caseSensitive, backwards, wrap, wholeWord, searchInFrames, showDialog);
+    [dartx.find](...args) {
+      return this.find.apply(this, args);
     }
-    [_getComputedStyle](elt, pseudoElt) {
-      return this.getComputedStyle(elt, pseudoElt);
+    [_getComputedStyle](...args) {
+      return this.getComputedStyle.apply(this, args);
     }
-    [dartx.getMatchedCssRules](element, pseudoElement) {
-      return this.getMatchedCSSRules(element, pseudoElement);
+    [dartx.getMatchedCssRules](...args) {
+      return this.getMatchedCSSRules.apply(this, args);
     }
-    [dartx.getSelection]() {
-      return this.getSelection();
+    [dartx.getSelection](...args) {
+      return this.getSelection.apply(this, args);
     }
-    [dartx.matchMedia](query) {
-      return this.matchMedia(query);
+    [dartx.matchMedia](...args) {
+      return this.matchMedia.apply(this, args);
     }
-    [dartx.moveBy](x, y) {
-      return this.moveBy(x, y);
+    [dartx.moveBy](...args) {
+      return this.moveBy.apply(this, args);
     }
-    [_moveTo](x, y) {
-      return this.moveTo(x, y);
+    [_moveTo](...args) {
+      return this.moveTo.apply(this, args);
     }
-    [dartx.openDatabase](name, version, displayName, estimatedSize, creationCallback) {
-      return this.openDatabase(name, version, displayName, estimatedSize, creationCallback);
+    [dartx.openDatabase](...args) {
+      return this.openDatabase.apply(this, args);
     }
     [dartx.postMessage](message, targetOrigin, transfer) {
       if (transfer === void 0) transfer = null;
@@ -75475,20 +77278,20 @@
       this[_postMessage_2](message_1, targetOrigin);
       return;
     }
-    [_postMessage_1](message, targetOrigin, transfer) {
-      return this.postMessage(message, targetOrigin, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message, targetOrigin) {
-      return this.postMessage(message, targetOrigin);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [dartx.print]() {
-      return this.print();
+    [dartx.print](...args) {
+      return this.print.apply(this, args);
     }
-    [dartx.resizeBy](x, y) {
-      return this.resizeBy(x, y);
+    [dartx.resizeBy](...args) {
+      return this.resizeBy.apply(this, args);
     }
-    [dartx.resizeTo](x, y) {
-      return this.resizeTo(x, y);
+    [dartx.resizeTo](...args) {
+      return this.resizeTo.apply(this, args);
     }
     [dartx.scroll](options_OR_x, y, scrollOptions) {
       if (options_OR_x === void 0) options_OR_x = null;
@@ -75518,20 +77321,20 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_scroll_1]() {
-      return this.scroll();
+    [_scroll_1](...args) {
+      return this.scroll.apply(this, args);
     }
-    [_scroll_2](options) {
-      return this.scroll(options);
+    [_scroll_2](...args) {
+      return this.scroll.apply(this, args);
     }
-    [_scroll_3](x, y) {
-      return this.scroll(x, y);
+    [_scroll_3](...args) {
+      return this.scroll.apply(this, args);
     }
-    [_scroll_4](x, y) {
-      return this.scroll(x, y);
+    [_scroll_4](...args) {
+      return this.scroll.apply(this, args);
     }
-    [_scroll_5](x, y, scrollOptions) {
-      return this.scroll(x, y, scrollOptions);
+    [_scroll_5](...args) {
+      return this.scroll.apply(this, args);
     }
     [dartx.scrollBy](options_OR_x, y, scrollOptions) {
       if (options_OR_x === void 0) options_OR_x = null;
@@ -75561,20 +77364,20 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_scrollBy_1]() {
-      return this.scrollBy();
+    [_scrollBy_1](...args) {
+      return this.scrollBy.apply(this, args);
     }
-    [_scrollBy_2](options) {
-      return this.scrollBy(options);
+    [_scrollBy_2](...args) {
+      return this.scrollBy.apply(this, args);
     }
-    [_scrollBy_3](x, y) {
-      return this.scrollBy(x, y);
+    [_scrollBy_3](...args) {
+      return this.scrollBy.apply(this, args);
     }
-    [_scrollBy_4](x, y) {
-      return this.scrollBy(x, y);
+    [_scrollBy_4](...args) {
+      return this.scrollBy.apply(this, args);
     }
-    [_scrollBy_5](x, y, scrollOptions) {
-      return this.scrollBy(x, y, scrollOptions);
+    [_scrollBy_5](...args) {
+      return this.scrollBy.apply(this, args);
     }
     [dartx.scrollTo](options_OR_x, y, scrollOptions) {
       if (options_OR_x === void 0) options_OR_x = null;
@@ -75604,26 +77407,26 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_scrollTo_1]() {
-      return this.scrollTo();
+    [_scrollTo_1](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [_scrollTo_2](options) {
-      return this.scrollTo(options);
+    [_scrollTo_2](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [_scrollTo_3](x, y) {
-      return this.scrollTo(x, y);
+    [_scrollTo_3](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [_scrollTo_4](x, y) {
-      return this.scrollTo(x, y);
+    [_scrollTo_4](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [_scrollTo_5](x, y, scrollOptions) {
-      return this.scrollTo(x, y, scrollOptions);
+    [_scrollTo_5](...args) {
+      return this.scrollTo.apply(this, args);
     }
-    [dartx.stop]() {
-      return this.stop();
+    [dartx.stop](...args) {
+      return this.stop.apply(this, args);
     }
-    [__requestFileSystem](type, size, successCallback, errorCallback) {
-      return this.webkitRequestFileSystem(type, size, successCallback, errorCallback);
+    [__requestFileSystem](...args) {
+      return this.webkitRequestFileSystem.apply(this, args);
     }
     [_requestFileSystem](type, size) {
       let completer = CompleterOfFileSystem().new();
@@ -75634,8 +77437,8 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [_resolveLocalFileSystemUrl](url, successCallback, errorCallback) {
-      return this.webkitResolveLocalFileSystemURL(url, successCallback, errorCallback);
+    [_resolveLocalFileSystemUrl](...args) {
+      return this.webkitResolveLocalFileSystemURL.apply(this, args);
     }
     [dartx.resolveLocalFileSystemUrl](url) {
       let completer = CompleterOfEntry().new();
@@ -75646,29 +77449,29 @@
       }, FileErrorTovoid()));
       return completer.future;
     }
-    [dartx.atob](atob) {
-      return this.atob(atob);
+    [dartx.atob](...args) {
+      return this.atob.apply(this, args);
     }
-    [dartx.btoa](btoa) {
-      return this.btoa(btoa);
+    [dartx.btoa](...args) {
+      return this.btoa.apply(this, args);
     }
-    [_setInterval_String](handler, timeout, arguments$) {
-      return this.setInterval(handler, timeout, arguments$);
+    [_setInterval_String](...args) {
+      return this.setInterval.apply(this, args);
     }
-    [_setTimeout_String](handler, timeout, arguments$) {
-      return this.setTimeout(handler, timeout, arguments$);
+    [_setTimeout_String](...args) {
+      return this.setTimeout.apply(this, args);
     }
-    [_clearInterval](handle) {
-      return this.clearInterval(handle);
+    [_clearInterval](...args) {
+      return this.clearInterval.apply(this, args);
     }
-    [_clearTimeout](handle) {
-      return this.clearTimeout(handle);
+    [_clearTimeout](...args) {
+      return this.clearTimeout.apply(this, args);
     }
-    [_setInterval](handler, timeout) {
-      return this.setInterval(handler, timeout);
+    [_setInterval](...args) {
+      return this.setInterval.apply(this, args);
     }
-    [_setTimeout](handler, timeout) {
-      return this.setTimeout(handler, timeout);
+    [_setTimeout](...args) {
+      return this.setTimeout.apply(this, args);
     }
     get [dartx.onContentLoaded]() {
       return html$.Window.contentLoadedEvent.forTarget(this);
@@ -76205,6 +78008,7 @@
     }
   });
   dart.registerExtension(dart.global.Window, html$.Window);
+  dart.registerExtension(dart.global.DOMWindow, html$.Window);
   const _returnValue = Symbol('_returnValue');
   html$._WrappedEvent = class _WrappedEvent extends core.Object {
     new(wrapped) {
@@ -76381,8 +78185,8 @@
     get [dartx.visibilityState]() {
       return this.visibilityState;
     }
-    [dartx.focus]() {
-      return this.focus();
+    [dartx.focus](...args) {
+      return this.focus.apply(this, args);
     }
   };
   dart.setSignature(html$.WindowClient, {
@@ -76512,14 +78316,14 @@
       this[_postMessage_2](message_1);
       return;
     }
-    [_postMessage_1](message, transfer) {
-      return this.postMessage(message, transfer);
+    [_postMessage_1](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [_postMessage_2](message) {
-      return this.postMessage(message);
+    [_postMessage_2](...args) {
+      return this.postMessage.apply(this, args);
     }
-    [dartx.terminate]() {
-      return this.terminate();
+    [dartx.terminate](...args) {
+      return this.terminate.apply(this, args);
     }
     get [dartx.onError]() {
       return html$.Worker.errorEvent.forTarget(this);
@@ -76590,35 +78394,35 @@
     get [dartx.memory]() {
       return this.memory;
     }
-    [dartx.clearMarks](markName) {
-      return this.clearMarks(markName);
+    [dartx.clearMarks](...args) {
+      return this.clearMarks.apply(this, args);
     }
-    [dartx.clearMeasures](measureName) {
-      return this.clearMeasures(measureName);
+    [dartx.clearMeasures](...args) {
+      return this.clearMeasures.apply(this, args);
     }
-    [dartx.getEntries]() {
-      return this.getEntries();
+    [dartx.getEntries](...args) {
+      return this.getEntries.apply(this, args);
     }
-    [dartx.getEntriesByName](name, entryType) {
-      return this.getEntriesByName(name, entryType);
+    [dartx.getEntriesByName](...args) {
+      return this.getEntriesByName.apply(this, args);
     }
-    [dartx.getEntriesByType](entryType) {
-      return this.getEntriesByType(entryType);
+    [dartx.getEntriesByType](...args) {
+      return this.getEntriesByType.apply(this, args);
     }
-    [dartx.mark](markName) {
-      return this.mark(markName);
+    [dartx.mark](...args) {
+      return this.mark.apply(this, args);
     }
-    [dartx.measure](measureName, startMark, endMark) {
-      return this.measure(measureName, startMark, endMark);
+    [dartx.measure](...args) {
+      return this.measure.apply(this, args);
     }
-    [dartx.now]() {
-      return this.now();
+    [dartx.now](...args) {
+      return this.now.apply(this, args);
     }
-    [dartx.clearResourceTimings]() {
-      return this.webkitClearResourceTimings();
+    [dartx.clearResourceTimings](...args) {
+      return this.webkitClearResourceTimings.apply(this, args);
     }
-    [dartx.setResourceTimingBufferSize](maxSize) {
-      return this.webkitSetResourceTimingBufferSize(maxSize);
+    [dartx.setResourceTimingBufferSize](...args) {
+      return this.webkitSetResourceTimingBufferSize.apply(this, args);
     }
   };
   dart.setSignature(html$.WorkerPerformance, {
@@ -76653,14 +78457,14 @@
     static _create_1() {
       return new XPathEvaluator();
     }
-    [dartx.createExpression](expression, resolver) {
-      return this.createExpression(expression, resolver);
+    [dartx.createExpression](...args) {
+      return this.createExpression.apply(this, args);
     }
-    [dartx.createNSResolver](nodeResolver) {
-      return this.createNSResolver(nodeResolver);
+    [dartx.createNSResolver](...args) {
+      return this.createNSResolver.apply(this, args);
     }
-    [dartx.evaluate](expression, contextNode, resolver, type, inResult) {
-      return this.evaluate(expression, contextNode, resolver, type, inResult);
+    [dartx.evaluate](...args) {
+      return this.evaluate.apply(this, args);
     }
   };
   dart.setSignature(html$.XPathEvaluator, {
@@ -76684,8 +78488,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.evaluate](contextNode, type, inResult) {
-      return this.evaluate(contextNode, type, inResult);
+    [dartx.evaluate](...args) {
+      return this.evaluate.apply(this, args);
     }
   };
   dart.setSignature(html$.XPathExpression, {
@@ -76700,8 +78504,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.lookupNamespaceUri](prefix) {
-      return this.lookupNamespaceURI(prefix);
+    [dartx.lookupNamespaceUri](...args) {
+      return this.lookupNamespaceURI.apply(this, args);
     }
   };
   dart.setSignature(html$.XPathNSResolver, {
@@ -76745,11 +78549,11 @@
     get [dartx.stringValue]() {
       return this.stringValue;
     }
-    [dartx.iterateNext]() {
-      return this.iterateNext();
+    [dartx.iterateNext](...args) {
+      return this.iterateNext.apply(this, args);
     }
-    [dartx.snapshotItem](index) {
-      return this.snapshotItem(index);
+    [dartx.snapshotItem](...args) {
+      return this.snapshotItem.apply(this, args);
     }
   };
   dart.setSignature(html$.XPathResult, {
@@ -76813,8 +78617,8 @@
     static _create_1() {
       return new XMLSerializer();
     }
-    [dartx.serializeToString](root) {
-      return this.serializeToString(root);
+    [dartx.serializeToString](...args) {
+      return this.serializeToString.apply(this, args);
     }
   };
   dart.setSignature(html$.XmlSerializer, {
@@ -76850,29 +78654,29 @@
     static get supported() {
       return !!window.XSLTProcessor;
     }
-    [dartx.clearParameters]() {
-      return this.clearParameters();
+    [dartx.clearParameters](...args) {
+      return this.clearParameters.apply(this, args);
     }
-    [dartx.getParameter](namespaceURI, localName) {
-      return this.getParameter(namespaceURI, localName);
+    [dartx.getParameter](...args) {
+      return this.getParameter.apply(this, args);
     }
-    [dartx.importStylesheet](style) {
-      return this.importStylesheet(style);
+    [dartx.importStylesheet](...args) {
+      return this.importStylesheet.apply(this, args);
     }
-    [dartx.removeParameter](namespaceURI, localName) {
-      return this.removeParameter(namespaceURI, localName);
+    [dartx.removeParameter](...args) {
+      return this.removeParameter.apply(this, args);
     }
-    [dartx.reset]() {
-      return this.reset();
+    [dartx.reset](...args) {
+      return this.reset.apply(this, args);
     }
-    [dartx.setParameter](namespaceURI, localName, value) {
-      return this.setParameter(namespaceURI, localName, value);
+    [dartx.setParameter](...args) {
+      return this.setParameter.apply(this, args);
     }
-    [dartx.transformToDocument](source) {
-      return this.transformToDocument(source);
+    [dartx.transformToDocument](...args) {
+      return this.transformToDocument.apply(this, args);
     }
-    [dartx.transformToFragment](source, output) {
-      return this.transformToFragment(source, output);
+    [dartx.transformToFragment](...args) {
+      return this.transformToFragment.apply(this, args);
     }
   };
   dart.setSignature(html$.XsltProcessor, {
@@ -77086,8 +78890,8 @@
   });
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -77102,11 +78906,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.item](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -77135,13 +78939,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__getter__](index) {
-      return this.__getter__(index);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$._ClientRectList[dart.implements] = () => [ListOfRectangleOfnum()];
@@ -77155,18 +78959,19 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(math.Rectangle$(core.num), [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, RectangleOfnum()]),
+      [dartx._get]: dart.definiteFunctionType(math.Rectangle$(core.num), [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, RectangleOfnum()]),
       [dartx.elementAt]: dart.definiteFunctionType(math.Rectangle$(core.num), [core.int]),
       [__getter__]: dart.definiteFunctionType(math.Rectangle$(core.num), [core.int]),
       [dartx.item]: dart.definiteFunctionType(math.Rectangle$(core.num), [core.int])
     })
   });
   dart.registerExtension(dart.global.ClientRectList, html$._ClientRectList);
+  dart.registerExtension(dart.global.DOMRectList, html$._ClientRectList);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -77181,11 +78986,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -77214,10 +79019,10 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$._CssRuleList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfCssRule()];
@@ -77231,8 +79036,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.CssRule, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.CssRule]),
+      [dartx._get]: dart.definiteFunctionType(html$.CssRule, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.CssRule]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.CssRule, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.CssRule, [core.int])
     })
@@ -77418,8 +79223,8 @@
   dart.registerExtension(dart.global.FileWriterSync, html$._FileWriterSync);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -77434,11 +79239,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -77467,10 +79272,10 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$._GamepadList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfGamepad()];
@@ -77484,8 +79289,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.Gamepad, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.Gamepad]),
+      [dartx._get]: dart.definiteFunctionType(html$.Gamepad, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.Gamepad]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.Gamepad, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.Gamepad, [core.int])
     })
@@ -77495,8 +79300,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [_item](index) {
-      return this.item(index);
+    [_item](...args) {
+      return this.item.apply(this, args);
     }
   };
   dart.setSignature(html$._HTMLAllCollection, {
@@ -77603,8 +79408,8 @@
   dart.registerExtension(dart.global.HTMLMarqueeElement, html$._HTMLMarqueeElement);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -77625,11 +79430,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -77658,28 +79463,28 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.getNamedItem](name) {
-      return this.getNamedItem(name);
+    [dartx.getNamedItem](...args) {
+      return this.getNamedItem.apply(this, args);
     }
-    [dartx.getNamedItemNS](namespaceURI, localName) {
-      return this.getNamedItemNS(namespaceURI, localName);
+    [dartx.getNamedItemNS](...args) {
+      return this.getNamedItemNS.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
-    [dartx.removeNamedItem](name) {
-      return this.removeNamedItem(name);
+    [dartx.removeNamedItem](...args) {
+      return this.removeNamedItem.apply(this, args);
     }
-    [dartx.removeNamedItemNS](namespaceURI, localName) {
-      return this.removeNamedItemNS(namespaceURI, localName);
+    [dartx.removeNamedItemNS](...args) {
+      return this.removeNamedItemNS.apply(this, args);
     }
-    [dartx.setNamedItem](attr) {
-      return this.setNamedItem(attr);
+    [dartx.setNamedItem](...args) {
+      return this.setNamedItem.apply(this, args);
     }
-    [dartx.setNamedItemNS](attr) {
-      return this.setNamedItemNS(attr);
+    [dartx.setNamedItemNS](...args) {
+      return this.setNamedItemNS.apply(this, args);
     }
   };
   html$._NamedNodeMap[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfNode()];
@@ -77693,8 +79498,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.Node, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
+      [dartx._get]: dart.definiteFunctionType(html$.Node, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.Node]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.Node, [core.int]),
       [dartx.getNamedItem]: dart.definiteFunctionType(html$._Attr, [core.String]),
       [dartx.getNamedItemNS]: dart.definiteFunctionType(html$._Attr, [core.String, core.String]),
@@ -77706,6 +79511,7 @@
     })
   });
   dart.registerExtension(dart.global.NamedNodeMap, html$._NamedNodeMap);
+  dart.registerExtension(dart.global.MozNamedAttrMap, html$._NamedNodeMap);
   html$._PagePopupController = class _PagePopupController extends _interceptors.Interceptor {
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
@@ -77760,8 +79566,8 @@
     get [dartx.url]() {
       return this.url;
     }
-    [dartx.clone]() {
-      return this.clone();
+    [dartx.clone](...args) {
+      return this.clone.apply(this, args);
     }
   };
   dart.setSignature(html$._Request, {
@@ -77836,8 +79642,8 @@
   dart.registerExtension(dart.global.ServiceWorker, html$._ServiceWorker);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -77852,11 +79658,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -77885,10 +79691,10 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$._SpeechRecognitionResultList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfSpeechRecognitionResult()];
@@ -77902,8 +79708,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.SpeechRecognitionResult, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.SpeechRecognitionResult]),
+      [dartx._get]: dart.definiteFunctionType(html$.SpeechRecognitionResult, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.SpeechRecognitionResult]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.SpeechRecognitionResult, [core.int]),
       [dartx.item]: dart.definiteFunctionType(html$.SpeechRecognitionResult, [core.int])
     })
@@ -77911,8 +79717,8 @@
   dart.registerExtension(dart.global.SpeechRecognitionResultList, html$._SpeechRecognitionResultList);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -77927,11 +79733,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[index];
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -77960,13 +79766,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__getter__](name) {
-      return this.__getter__(name);
+    [__getter__](...args) {
+      return this.__getter__.apply(this, args);
     }
-    [dartx.item](index) {
-      return this.item(index);
+    [dartx.item](...args) {
+      return this.item.apply(this, args);
     }
   };
   html$._StyleSheetList[dart.implements] = () => [_js_helper.JavaScriptIndexingBehavior, ListOfStyleSheet()];
@@ -77980,8 +79786,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(html$.StyleSheet, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, html$.StyleSheet]),
+      [dartx._get]: dart.definiteFunctionType(html$.StyleSheet, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, html$.StyleSheet]),
       [dartx.elementAt]: dart.definiteFunctionType(html$.StyleSheet, [core.int]),
       [__getter__]: dart.definiteFunctionType(html$.CssStyleSheet, [core.String]),
       [dartx.item]: dart.definiteFunctionType(html$.StyleSheet, [core.int])
@@ -78071,7 +79877,7 @@
     }
     addAll(other) {
       other[dartx.forEach](dart.fn((k, v) => {
-        this.set(k, v);
+        this._set(k, v);
       }, StringAndStringTovoid$()));
     }
     containsValue(value) {
@@ -78084,9 +79890,9 @@
     }
     putIfAbsent(key, ifAbsent) {
       if (!dart.test(this[dartx.containsKey](key))) {
-        this.set(key, ifAbsent());
+        this._set(key, ifAbsent());
       }
-      return this.get(key);
+      return this._get(key);
     }
     clear() {
       for (let key of this.keys) {
@@ -78095,7 +79901,7 @@
     }
     forEach(f) {
       for (let key of this.keys) {
-        let value = this.get(key);
+        let value = this._get(key);
         f(key, value);
       }
     }
@@ -78103,7 +79909,7 @@
       let attributes = this[_element$][_attributes$];
       let keys = JSArrayOfString().of([]);
       for (let i = 0, len = attributes[dartx.length]; i < dart.notNull(len); i++) {
-        let attr = html$._Attr._check(attributes[dartx.get](i));
+        let attr = html$._Attr._check(attributes[dartx._get](i));
         if (dart.test(this[_matches](attr))) {
           keys[dartx.add](attr[dartx.name]);
         }
@@ -78114,7 +79920,7 @@
       let attributes = this[_element$][_attributes$];
       let values = JSArrayOfString().of([]);
       for (let i = 0, len = attributes[dartx.length]; i < dart.notNull(len); i++) {
-        let attr = html$._Attr._check(attributes[dartx.get](i));
+        let attr = html$._Attr._check(attributes[dartx._get](i));
         if (dart.test(this[_matches](attr))) {
           values[dartx.add](attr[dartx.value]);
         }
@@ -78164,10 +79970,10 @@
     containsKey(key) {
       return this[_element$][_hasAttribute](core.String._check(key));
     }
-    get(key) {
+    _get(key) {
       return this[_element$][dartx.getAttribute](core.String._check(key));
     }
-    set(key, value) {
+    _set(key, value) {
       this[_element$][dartx.setAttribute](key, value);
       return value;
     }
@@ -78188,16 +79994,16 @@
     getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
     methods: () => ({
       containsKey: dart.definiteFunctionType(core.bool, [core.Object]),
-      get: dart.definiteFunctionType(core.String, [core.Object]),
-      set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
+      _get: dart.definiteFunctionType(core.String, [core.Object]),
+      _set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
       remove: dart.definiteFunctionType(core.String, [core.Object]),
       [_matches]: dart.definiteFunctionType(core.bool, [html$.Node])
     })
   });
   dart.defineExtensionMembers(html$._ElementAttributeMap, [
     'containsKey',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'remove',
     'length'
   ]);
@@ -78210,15 +80016,15 @@
     containsKey(key) {
       return this[_element$][_hasAttributeNS](this[_namespace], core.String._check(key));
     }
-    get(key) {
+    _get(key) {
       return this[_element$][dartx.getAttributeNS](this[_namespace], core.String._check(key));
     }
-    set(key, value) {
+    _set(key, value) {
       this[_element$][dartx.setAttributeNS](this[_namespace], key, value);
       return value;
     }
     remove(key) {
-      let value = this.get(key);
+      let value = this._get(key);
       this[_element$][_removeAttributeNS](this[_namespace], core.String._check(key));
       return value;
     }
@@ -78235,16 +80041,16 @@
     getters: () => ({length: dart.definiteFunctionType(core.int, [])}),
     methods: () => ({
       containsKey: dart.definiteFunctionType(core.bool, [core.Object]),
-      get: dart.definiteFunctionType(core.String, [core.Object]),
-      set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
+      _get: dart.definiteFunctionType(core.String, [core.Object]),
+      _set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
       remove: dart.definiteFunctionType(core.String, [core.Object]),
       [_matches]: dart.definiteFunctionType(core.bool, [html$.Node])
     })
   });
   dart.defineExtensionMembers(html$._NamespacedAttributeMap, [
     'containsKey',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'remove',
     'length'
   ]);
@@ -78258,7 +80064,7 @@
     }
     addAll(other) {
       other[dartx.forEach](dart.fn((k, v) => {
-        this.set(k, v);
+        this._set(k, v);
       }, StringAndStringTovoid$()));
     }
     containsValue(value) {
@@ -78267,11 +80073,11 @@
     containsKey(key) {
       return this[_attributes$][dartx.containsKey](this[_attr](core.String._check(key)));
     }
-    get(key) {
-      return this[_attributes$][dartx.get](this[_attr](core.String._check(key)));
+    _get(key) {
+      return this[_attributes$][dartx._get](this[_attr](core.String._check(key)));
     }
-    set(key, value) {
-      this[_attributes$][dartx.set](this[_attr](key), value);
+    _set(key, value) {
+      this[_attributes$][dartx._set](this[_attr](key), value);
       return value;
     }
     putIfAbsent(key, ifAbsent) {
@@ -78333,9 +80139,9 @@
       let segments = hyphenedName[dartx.split]('-');
       let start = dart.test(startUppercase) ? 0 : 1;
       for (let i = start; i < dart.notNull(segments[dartx.length]); i++) {
-        let segment = segments[dartx.get](i);
+        let segment = segments[dartx._get](i);
         if (dart.notNull(segment[dartx.length]) > 0) {
-          segments[dartx.set](i, dart.str`${segment[dartx.get](0)[dartx.toUpperCase]()}${segment[dartx.substring](1)}`);
+          segments[dartx._set](i, dart.str`${segment[dartx._get](0)[dartx.toUpperCase]()}${segment[dartx.substring](1)}`);
         }
       }
       return segments[dartx.join]('');
@@ -78343,8 +80149,8 @@
     [_toHyphenedName](word) {
       let sb = new core.StringBuffer();
       for (let i = 0; i < dart.notNull(word[dartx.length]); i++) {
-        let lower = word[dartx.get](i)[dartx.toLowerCase]();
-        if (word[dartx.get](i) != lower && i > 0) sb.write('-');
+        let lower = word[dartx._get](i)[dartx.toLowerCase]();
+        if (word[dartx._get](i) != lower && i > 0) sb.write('-');
         sb.write(lower);
       }
       return sb.toString();
@@ -78365,8 +80171,8 @@
       addAll: dart.definiteFunctionType(dart.void, [MapOfString$String()]),
       containsValue: dart.definiteFunctionType(core.bool, [core.Object]),
       containsKey: dart.definiteFunctionType(core.bool, [core.Object]),
-      get: dart.definiteFunctionType(core.String, [core.Object]),
-      set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
+      _get: dart.definiteFunctionType(core.String, [core.Object]),
+      _set: dart.definiteFunctionType(dart.void, [core.String, core.String]),
       putIfAbsent: dart.definiteFunctionType(core.String, [core.String, VoidToString()]),
       remove: dart.definiteFunctionType(core.String, [core.Object]),
       clear: dart.definiteFunctionType(dart.void, []),
@@ -78382,8 +80188,8 @@
     'addAll',
     'containsValue',
     'containsKey',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'putIfAbsent',
     'remove',
     'clear',
@@ -79195,43 +81001,43 @@
   const _unit = Symbol('_unit');
   html$.Dimension = class Dimension extends core.Object {
     percent(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = '%';
     }
     px(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'px';
     }
     pc(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'pc';
     }
     pt(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'pt';
     }
     inch(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'in';
     }
     cm(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'cm';
     }
     mm(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'mm';
     }
     em(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'em';
     }
     ex(value) {
-      this[_value$0] = value;
+      this[_value$1] = value;
       this[_unit] = 'ex';
     }
     css(cssValue) {
-      this[_value$0] = null;
+      this[_value$1] = null;
       this[_unit] = null;
       if (cssValue == '') cssValue = '0px';
       if (dart.test(cssValue[dartx.endsWith]('%'))) {
@@ -79240,16 +81046,16 @@
         this[_unit] = cssValue[dartx.substring](dart.notNull(cssValue[dartx.length]) - 2);
       }
       if (dart.test(cssValue[dartx.contains]('.'))) {
-        this[_value$0] = core.double.parse(cssValue[dartx.substring](0, dart.notNull(cssValue[dartx.length]) - dart.notNull(this[_unit][dartx.length])));
+        this[_value$1] = core.double.parse(cssValue[dartx.substring](0, dart.notNull(cssValue[dartx.length]) - dart.notNull(this[_unit][dartx.length])));
       } else {
-        this[_value$0] = core.int.parse(cssValue[dartx.substring](0, dart.notNull(cssValue[dartx.length]) - dart.notNull(this[_unit][dartx.length])));
+        this[_value$1] = core.int.parse(cssValue[dartx.substring](0, dart.notNull(cssValue[dartx.length]) - dart.notNull(this[_unit][dartx.length])));
       }
     }
     toString() {
-      return dart.str`${this[_value$0]}${this[_unit]}`;
+      return dart.str`${this[_value$1]}${this[_unit]}`;
     }
     get value() {
-      return this[_value$0];
+      return this[_value$1];
     }
   };
   dart.defineNamedConstructor(html$.Dimension, 'percent');
@@ -79276,7 +81082,7 @@
       css: dart.definiteFunctionType(html$.Dimension, [core.String])
     }),
     fields: () => ({
-      [_value$0]: core.num,
+      [_value$1]: core.num,
       [_unit]: core.String
     }),
     getters: () => ({value: dart.definiteFunctionType(core.num, [])})
@@ -79929,7 +81735,7 @@
       add(stream) {
         StreamOfT()._check(stream);
         if (dart.test(this[_subscriptions][dartx.containsKey](stream))) return;
-        this[_subscriptions][dartx.set](stream, stream.listen(dart.bind(this[_controller$0], 'add'), {onError: dart.bind(this[_controller$0], 'addError'), onDone: dart.fn(() => this.remove(stream), VoidTovoid$())}));
+        this[_subscriptions][dartx._set](stream, stream.listen(dart.bind(this[_controller$0], 'add'), {onError: dart.bind(this[_controller$0], 'addError'), onDone: dart.fn(() => this.remove(stream), VoidTovoid$())}));
       }
       remove(stream) {
         StreamOfT()._check(stream);
@@ -80013,10 +81819,10 @@
       this.uriPolicy = uriPolicy != null ? uriPolicy : html$.UriPolicy.new();
       if (dart.test(html$._Html5NodeValidator._attributeValidators[dartx.isEmpty])) {
         for (let attr of html$._Html5NodeValidator._standardAttributes) {
-          html$._Html5NodeValidator._attributeValidators[dartx.set](attr, html$._Html5NodeValidator._standardAttributeValidator);
+          html$._Html5NodeValidator._attributeValidators[dartx._set](attr, html$._Html5NodeValidator._standardAttributeValidator);
         }
         for (let attr of html$._Html5NodeValidator._uriAttributes) {
-          html$._Html5NodeValidator._attributeValidators[dartx.set](attr, html$._Html5NodeValidator._uriAttributeValidator);
+          html$._Html5NodeValidator._attributeValidators[dartx._set](attr, html$._Html5NodeValidator._uriAttributeValidator);
         }
       }
     }
@@ -80025,9 +81831,9 @@
     }
     allowsAttribute(element, attributeName, value) {
       let tagName = html$.Element._safeTagName(element);
-      let validator = html$._Html5NodeValidator._attributeValidators[dartx.get](dart.str`${tagName}::${attributeName}`);
+      let validator = html$._Html5NodeValidator._attributeValidators[dartx._get](dart.str`${tagName}::${attributeName}`);
       if (validator == null) {
-        validator = html$._Html5NodeValidator._attributeValidators[dartx.get](dart.str`*::${attributeName}`);
+        validator = html$._Html5NodeValidator._attributeValidators[dartx._get](dart.str`*::${attributeName}`);
       }
       if (validator == null) {
         return false;
@@ -80858,7 +82664,7 @@
         if (prevEvent[_shadowCharCode] == event[dartx.charCode]) {
           return prevEvent.keyCode;
         }
-        if ((dart.test(event[dartx.shiftKey]) || dart.test(this[_capsLockOn])) && dart.notNull(event[dartx.charCode]) >= dart.notNull("A"[dartx.codeUnits][dartx.get](0)) && dart.notNull(event[dartx.charCode]) <= dart.notNull("Z"[dartx.codeUnits][dartx.get](0)) && dart.notNull(event[dartx.charCode]) + dart.notNull(html$._KeyboardEventHandler._ROMAN_ALPHABET_OFFSET) == prevEvent[_shadowCharCode]) {
+        if ((dart.test(event[dartx.shiftKey]) || dart.test(this[_capsLockOn])) && dart.notNull(event[dartx.charCode]) >= dart.notNull("A"[dartx.codeUnits][dartx._get](0)) && dart.notNull(event[dartx.charCode]) <= dart.notNull("Z"[dartx.codeUnits][dartx._get](0)) && dart.notNull(event[dartx.charCode]) + dart.notNull(html$._KeyboardEventHandler._ROMAN_ALPHABET_OFFSET) == prevEvent[_shadowCharCode]) {
           return prevEvent.keyCode;
         }
       }
@@ -81056,7 +82862,7 @@
       }
       e[_shadowKeyCode] = this[_determineKeyCodeForKeypress](e);
       if (e[_shadowKeyIdentifier] != null && dart.test(html$._KeyboardEventHandler._keyIdentifier[dartx.containsKey](e[_shadowKeyIdentifier]))) {
-        e[_shadowKeyCode] = html$._KeyboardEventHandler._keyIdentifier[dartx.get](e[_shadowKeyIdentifier]);
+        e[_shadowKeyCode] = html$._KeyboardEventHandler._keyIdentifier[dartx._get](e[_shadowKeyIdentifier]);
       }
       e[_shadowAltKey] = this[_keyDownList][dartx.any](dart.fn(element => element.altKey, KeyEventTobool()));
       this[_stream$].add(e);
@@ -81111,7 +82917,7 @@
   html$._KeyboardEventHandler._keyIdentifier = dart.const(dart.map({Up: html$.KeyCode.UP, Down: html$.KeyCode.DOWN, Left: html$.KeyCode.LEFT, Right: html$.KeyCode.RIGHT, Enter: html$.KeyCode.ENTER, F1: html$.KeyCode.F1, F2: html$.KeyCode.F2, F3: html$.KeyCode.F3, F4: html$.KeyCode.F4, F5: html$.KeyCode.F5, F6: html$.KeyCode.F6, F7: html$.KeyCode.F7, F8: html$.KeyCode.F8, F9: html$.KeyCode.F9, F10: html$.KeyCode.F10, F11: html$.KeyCode.F11, F12: html$.KeyCode.F12, 'U+007F': html$.KeyCode.DELETE, Home: html$.KeyCode.HOME, End: html$.KeyCode.END, PageUp: html$.KeyCode.PAGE_UP, PageDown: html$.KeyCode.PAGE_DOWN, Insert: html$.KeyCode.INSERT}, core.String, core.int));
   dart.defineLazy(html$._KeyboardEventHandler, {
     get _ROMAN_ALPHABET_OFFSET() {
-      return dart.notNull("a"[dartx.codeUnits][dartx.get](0)) - dart.notNull("A"[dartx.codeUnits][dartx.get](0));
+      return dart.notNull("a"[dartx.codeUnits][dartx._get](0)) - dart.notNull("A"[dartx.codeUnits][dartx._get](0));
     }
   });
   html$.KeyboardEventStream = class KeyboardEventStream extends core.Object {
@@ -81329,7 +83135,7 @@
     }
     allowsElement(element) {
       if (dart.test(this.allowTypeExtension)) {
-        let isAttr = element[dartx.attributes][dartx.get]('is');
+        let isAttr = element[dartx.attributes][dartx._get]('is');
         if (isAttr != null) {
           return dart.test(this.allowedElements.contains(isAttr[dartx.toUpperCase]())) && dart.test(this.allowedElements.contains(html$.Element._safeTagName(element)));
         }
@@ -81366,7 +83172,7 @@
       if (attributeName == 'template' && value == "") {
         return true;
       }
-      if (element[dartx.attributes][dartx.get]('template') == "") {
+      if (element[dartx.attributes][dartx._get]('template') == "") {
         return this[_templateAttrs].contains(attributeName);
       }
       return false;
@@ -81441,12 +83247,12 @@
       clear() {
         this[_list$][dartx.clear]();
       }
-      get(index) {
-        return html$._downcast(html$.Node, E)(this[_list$][dartx.get](index));
+      _get(index) {
+        return html$._downcast(html$.Node, E)(this[_list$][dartx._get](index));
       }
-      set(index, value) {
+      _set(index, value) {
         E._check(value);
-        this[_list$][dartx.set](index, value);
+        this[_list$][dartx._set](index, value);
         return value;
       }
       set length(newLength) {
@@ -81504,8 +83310,8 @@
       setters: () => ({length: dart.definiteFunctionType(dart.void, [core.int])}),
       methods: () => ({
         add: dart.definiteFunctionType(dart.void, [E]),
-        get: dart.definiteFunctionType(E, [core.int]),
-        set: dart.definiteFunctionType(dart.void, [core.int, E]),
+        _get: dart.definiteFunctionType(E, [core.int]),
+        _set: dart.definiteFunctionType(dart.void, [core.int, E]),
         sort: dart.definiteFunctionType(dart.void, [], [EAndEToint()]),
         insert: dart.definiteFunctionType(dart.void, [core.int, E]),
         removeAt: dart.definiteFunctionType(E, [core.int]),
@@ -81518,8 +83324,8 @@
       'add',
       'remove',
       'clear',
-      'get',
-      'set',
+      '_get',
+      '_set',
       'sort',
       'indexOf',
       'lastIndexOf',
@@ -81600,7 +83406,7 @@
       moveNext() {
         let nextPosition = dart.notNull(this[_position$0]) + 1;
         if (nextPosition < dart.notNull(this[_length$2])) {
-          this[_current$4] = this[_array][dartx.get](nextPosition);
+          this[_current$4] = this[_array][dartx._get](nextPosition);
           this[_position$0] = nextPosition;
           return true;
         }
@@ -81640,7 +83446,7 @@
       moveNext() {
         let nextPosition = dart.notNull(this[_position$0]) + 1;
         if (nextPosition < dart.notNull(this[_array][dartx.length])) {
-          this[_current$4] = this[_array][dartx.get](nextPosition);
+          this[_current$4] = this[_array][dartx._get](nextPosition);
           this[_position$0] = nextPosition;
           return true;
         }
@@ -82225,9 +84031,9 @@
       }
       let keys = attrs[dartx.keys][dartx.toList]();
       for (let i = dart.notNull(attrs[dartx.length]) - 1; i >= 0; --i) {
-        let name = keys[dartx.get](i);
-        if (!dart.test(this.validator.allowsAttribute(element, core.String._check(dart.dsend(name, 'toLowerCase')), core.String._check(attrs[dartx.get](name))))) {
-          html$.window[dartx.console].warn('Removing disallowed attribute ' + dart.str`<${tag} ${name}="${attrs[dartx.get](name)}">`);
+        let name = keys[dartx._get](i);
+        if (!dart.test(this.validator.allowsAttribute(element, core.String._check(dart.dsend(name, 'toLowerCase')), core.String._check(attrs[dartx._get](name))))) {
+          html$.window[dartx.console].warn('Removing disallowed attribute ' + dart.str`<${tag} ${name}="${attrs[dartx._get](name)}">`);
           attrs[dartx.remove](name);
         }
       }
@@ -82269,15 +84075,6 @@
       sanitizeNode: dart.definiteFunctionType(dart.void, [html$.Node, html$.Node])
     })
   });
-  html$.Point$ = math.Point$;
-  html$.Point = math.Point;
-  html$.Rectangle$ = math.Rectangle$;
-  html$.Rectangle = math.Rectangle;
-  html_common.SupportedBrowser = _metadata.SupportedBrowser;
-  html_common.Unstable = _metadata.Unstable;
-  html_common.DocsEditable = _metadata.DocsEditable;
-  html_common.Experimental = _metadata.Experimental;
-  html_common.DomName = _metadata.DomName;
   html_common.convertDartToNative_SerializedScriptValue = function(value) {
     return html_common.convertDartToNative_PrepareForStructuredClone(value);
   };
@@ -82294,17 +84091,17 @@
     findSlot(value) {
       let length = this.values[dartx.length];
       for (let i = 0; i < dart.notNull(length); i++) {
-        if (core.identical(this.values[dartx.get](i), value)) return i;
+        if (core.identical(this.values[dartx._get](i), value)) return i;
       }
       this.values[dartx.add](value);
       this.copies[dartx.add](null);
       return length;
     }
     readSlot(i) {
-      return this.copies[dartx.get](i);
+      return this.copies[dartx._get](i);
     }
     writeSlot(i, x) {
-      this.copies[dartx.set](i, x);
+      this.copies[dartx._set](i, x);
     }
     cleanupSlots() {}
     walk(e) {
@@ -82349,7 +84146,7 @@
       let copy = this.newJsList(length);
       this.writeSlot(slot, copy);
       for (; i < dart.notNull(length); i++) {
-        dart.dsetindex(copy, i, this.walk(e[dartx.get](i)));
+        dart.dsetindex(copy, i, this.walk(e[dartx._get](i)));
       }
       return copy;
     }
@@ -82383,17 +84180,17 @@
     findSlot(value) {
       let length = this.values[dartx.length];
       for (let i = 0; i < dart.notNull(length); i++) {
-        if (dart.test(this.identicalInJs(this.values[dartx.get](i), value))) return i;
+        if (dart.test(this.identicalInJs(this.values[dartx._get](i), value))) return i;
       }
       this.values[dartx.add](value);
       this.copies[dartx.add](null);
       return length;
     }
     readSlot(i) {
-      return this.copies[dartx.get](i);
+      return this.copies[dartx._get](i);
     }
     writeSlot(i, x) {
-      this.copies[dartx.set](i, x);
+      this.copies[dartx._set](i, x);
     }
     walk(e) {
       if (e == null) return e;
@@ -82526,7 +84323,7 @@
     let dict = dart.map();
     let keys = Object.getOwnPropertyNames(object);
     for (let key of core.Iterable._check(keys)) {
-      dict[dartx.set](key, object[key]);
+      dict[dartx._set](key, object[key]);
     }
     return dict;
   };
@@ -82762,8 +84559,8 @@
     forEach(f) {
       this[_filtered][dartx.forEach](f);
     }
-    set(index, value) {
-      this.get(index)[dartx.replaceWith](value);
+    _set(index, value) {
+      this._get(index)[dartx.replaceWith](value);
       return value;
     }
     set length(newLength) {
@@ -82836,7 +84633,7 @@
       }
     }
     removeAt(index) {
-      let result = this.get(index);
+      let result = this._get(index);
       result[dartx.remove]();
       return result;
     }
@@ -82852,7 +84649,7 @@
     get length() {
       return this[_iterable$0][dartx.length];
     }
-    get(index) {
+    _get(index) {
       return this[_iterable$0][dartx.elementAt](index);
     }
     get iterator() {
@@ -82881,7 +84678,7 @@
     setters: () => ({length: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
       forEach: dart.definiteFunctionType(dart.void, [ElementTovoid()]),
-      set: dart.definiteFunctionType(dart.void, [core.int, html$.Element]),
+      _set: dart.definiteFunctionType(dart.void, [core.int, html$.Element]),
       add: dart.definiteFunctionType(dart.void, [html$.Element]),
       addAll: dart.definiteFunctionType(dart.void, [IterableOfElement()]),
       sort: dart.definiteFunctionType(dart.void, [], [ElementAndElementToint()]),
@@ -82892,12 +84689,12 @@
       insert: dart.definiteFunctionType(dart.void, [core.int, html$.Element]),
       insertAll: dart.definiteFunctionType(dart.void, [core.int, IterableOfElement()]),
       removeAt: dart.definiteFunctionType(html$.Element, [core.int]),
-      get: dart.definiteFunctionType(html$.Element, [core.int])
+      _get: dart.definiteFunctionType(html$.Element, [core.int])
     })
   });
   dart.defineExtensionMembers(html_common.FilteredElementList, [
     'forEach',
-    'set',
+    '_set',
     'add',
     'addAll',
     'contains',
@@ -82912,7 +84709,7 @@
     'insertAll',
     'removeAt',
     'remove',
-    'get',
+    '_get',
     'length',
     'reversed',
     'length',
@@ -82927,7 +84724,7 @@
         startIndex = 0;
       }
       for (let i = startIndex; dart.notNull(i) < dart.notNull(endIndex); i = dart.notNull(i) + 1) {
-        if (dart.equals(a[dartx.get](i), element)) {
+        if (dart.equals(a[dartx._get](i), element)) {
           return i;
         }
       }
@@ -82941,7 +84738,7 @@
         startIndex = dart.notNull(a[dartx.length]) - 1;
       }
       for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) {
-        if (dart.equals(a[dartx.get](i), element)) {
+        if (dart.equals(a[dartx._get](i), element)) {
           return i;
         }
       }
@@ -82952,7 +84749,7 @@
       if (dart.notNull(end) < dart.notNull(start)) dart.throw(new core.RangeError.value(end));
       if (dart.notNull(end) > dart.notNull(a[dartx.length])) dart.throw(new core.RangeError.value(end));
       for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
-        accumulator[dartx.add](a[dartx.get](i));
+        accumulator[dartx.add](a[dartx._get](i));
       }
       return accumulator;
     }
@@ -83158,11 +84955,11 @@
     get [dartx.viewportElement]() {
       return this.viewportElement;
     }
-    [dartx.blur]() {
-      return this.blur();
+    [dartx.blur](...args) {
+      return this.blur.apply(this, args);
     }
-    [dartx.focus]() {
-      return this.focus();
+    [dartx.focus](...args) {
+      return this.focus.apply(this, args);
     }
     get [dartx.onAbort]() {
       return svg$.SvgElement.abortEvent.forElement(this);
@@ -83591,17 +85388,17 @@
     get [dartx.transform]() {
       return this.transform;
     }
-    [dartx.getBBox]() {
-      return this.getBBox();
+    [dartx.getBBox](...args) {
+      return this.getBBox.apply(this, args);
     }
-    [dartx.getCtm]() {
-      return this.getCTM();
+    [dartx.getCtm](...args) {
+      return this.getCTM.apply(this, args);
     }
-    [dartx.getScreenCtm]() {
-      return this.getScreenCTM();
+    [dartx.getScreenCtm](...args) {
+      return this.getScreenCTM.apply(this, args);
     }
-    [dartx.getTransformToElement](element) {
-      return this.getTransformToElement(element);
+    [dartx.getTransformToElement](...args) {
+      return this.getTransformToElement.apply(this, args);
     }
     get [dartx.requiredExtensions]() {
       return this.requiredExtensions;
@@ -83612,8 +85409,8 @@
     get [dartx.systemLanguage]() {
       return this.systemLanguage;
     }
-    [dartx.hasExtension](extension) {
-      return this.hasExtension(extension);
+    [dartx.hasExtension](...args) {
+      return this.hasExtension.apply(this, args);
     }
   };
   dart.defineNamedConstructor(svg$.GraphicsElement, 'created');
@@ -83710,11 +85507,11 @@
     set [dartx.valueInSpecifiedUnits](value) {
       this.valueInSpecifiedUnits = value;
     }
-    [dartx.convertToSpecifiedUnits](unitType) {
-      return this.convertToSpecifiedUnits(unitType);
+    [dartx.convertToSpecifiedUnits](...args) {
+      return this.convertToSpecifiedUnits.apply(this, args);
     }
-    [dartx.newValueSpecifiedUnits](unitType, valueInSpecifiedUnits) {
-      return this.newValueSpecifiedUnits(unitType, valueInSpecifiedUnits);
+    [dartx.newValueSpecifiedUnits](...args) {
+      return this.newValueSpecifiedUnits.apply(this, args);
     }
   };
   dart.setSignature(svg$.Angle, {
@@ -83774,26 +85571,26 @@
     get [dartx.targetElement]() {
       return this.targetElement;
     }
-    [dartx.beginElement]() {
-      return this.beginElement();
+    [dartx.beginElement](...args) {
+      return this.beginElement.apply(this, args);
     }
-    [dartx.beginElementAt](offset) {
-      return this.beginElementAt(offset);
+    [dartx.beginElementAt](...args) {
+      return this.beginElementAt.apply(this, args);
     }
-    [dartx.endElement]() {
-      return this.endElement();
+    [dartx.endElement](...args) {
+      return this.endElement.apply(this, args);
     }
-    [dartx.endElementAt](offset) {
-      return this.endElementAt(offset);
+    [dartx.endElementAt](...args) {
+      return this.endElementAt.apply(this, args);
     }
-    [dartx.getCurrentTime]() {
-      return this.getCurrentTime();
+    [dartx.getCurrentTime](...args) {
+      return this.getCurrentTime.apply(this, args);
     }
-    [dartx.getSimpleDuration]() {
-      return this.getSimpleDuration();
+    [dartx.getSimpleDuration](...args) {
+      return this.getSimpleDuration.apply(this, args);
     }
-    [dartx.getStartTime]() {
-      return this.getStartTime();
+    [dartx.getStartTime](...args) {
+      return this.getStartTime.apply(this, args);
     }
     get [dartx.requiredExtensions]() {
       return this.requiredExtensions;
@@ -83804,8 +85601,8 @@
     get [dartx.systemLanguage]() {
       return this.systemLanguage;
     }
-    [dartx.hasExtension](extension) {
-      return this.hasExtension(extension);
+    [dartx.hasExtension](...args) {
+      return this.hasExtension.apply(this, args);
     }
   };
   dart.defineNamedConstructor(svg$.AnimationElement, 'created');
@@ -84208,11 +86005,11 @@
     created() {
       super.created();
     }
-    [dartx.isPointInFill](point) {
-      return this.isPointInFill(point);
+    [dartx.isPointInFill](...args) {
+      return this.isPointInFill.apply(this, args);
     }
-    [dartx.isPointInStroke](point) {
-      return this.isPointInStroke(point);
+    [dartx.isPointInStroke](...args) {
+      return this.isPointInStroke.apply(this, args);
     }
   };
   dart.defineNamedConstructor(svg$.GeometryElement, 'created');
@@ -85338,8 +87135,8 @@
     get [dartx.stdDeviationY]() {
       return this.stdDeviationY;
     }
-    [dartx.setStdDeviation](stdDeviationX, stdDeviationY) {
-      return this.setStdDeviation(stdDeviationX, stdDeviationY);
+    [dartx.setStdDeviation](...args) {
+      return this.setStdDeviation.apply(this, args);
     }
     get [dartx.height]() {
       return this.height;
@@ -86174,7 +87971,42 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get height() {
+      return this[height$];
+    }
+    set height(value) {
+      super.height = value;
+    }
+    get result() {
+      return this[result];
+    }
+    set result(value) {
+      super.result = value;
+    }
+    get width() {
+      return this[width$];
+    }
+    set width(value) {
+      super.width = value;
+    }
+    get x() {
+      return this[x];
+    }
+    set x(value) {
+      super.x = value;
+    }
+    get y() {
+      return this[y];
+    }
+    set y(value) {
+      super.y = value;
+    }
   };
+  const height$ = Symbol(svg$.FilterPrimitiveStandardAttributes.name + "." + 'height'.toString());
+  const result = Symbol(svg$.FilterPrimitiveStandardAttributes.name + "." + 'result'.toString());
+  const width$ = Symbol(svg$.FilterPrimitiveStandardAttributes.name + "." + 'width'.toString());
+  const x = Symbol(svg$.FilterPrimitiveStandardAttributes.name + "." + 'x'.toString());
+  const y = Symbol(svg$.FilterPrimitiveStandardAttributes.name + "." + 'y'.toString());
   dart.setSignature(svg$.FilterPrimitiveStandardAttributes, {
     constructors: () => ({_: dart.definiteFunctionType(svg$.FilterPrimitiveStandardAttributes, [])}),
     fields: () => ({
@@ -86200,7 +88032,21 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get preserveAspectRatio() {
+      return this[preserveAspectRatio];
+    }
+    set preserveAspectRatio(value) {
+      super.preserveAspectRatio = value;
+    }
+    get viewBox() {
+      return this[viewBox];
+    }
+    set viewBox(value) {
+      super.viewBox = value;
+    }
   };
+  const preserveAspectRatio = Symbol(svg$.FitToViewBox.name + "." + 'preserveAspectRatio'.toString());
+  const viewBox = Symbol(svg$.FitToViewBox.name + "." + 'viewBox'.toString());
   dart.setSignature(svg$.FitToViewBox, {
     constructors: () => ({_: dart.definiteFunctionType(svg$.FitToViewBox, [])}),
     fields: () => ({
@@ -86375,11 +88221,11 @@
     set [dartx.valueInSpecifiedUnits](value) {
       this.valueInSpecifiedUnits = value;
     }
-    [dartx.convertToSpecifiedUnits](unitType) {
-      return this.convertToSpecifiedUnits(unitType);
+    [dartx.convertToSpecifiedUnits](...args) {
+      return this.convertToSpecifiedUnits.apply(this, args);
     }
-    [dartx.newValueSpecifiedUnits](unitType, valueInSpecifiedUnits) {
-      return this.newValueSpecifiedUnits(unitType, valueInSpecifiedUnits);
+    [dartx.newValueSpecifiedUnits](...args) {
+      return this.newValueSpecifiedUnits.apply(this, args);
     }
   };
   dart.setSignature(svg$.Length, {
@@ -86423,8 +88269,8 @@
   const __setter__$ = Symbol('__setter__');
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -86449,11 +88295,11 @@
     get [dartx.numberOfItems]() {
       return this.numberOfItems;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.getItem](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -86482,31 +88328,31 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__setter__$](index, newItem) {
-      return this.__setter__(index, newItem);
+    [__setter__$](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.appendItem](newItem) {
-      return this.appendItem(newItem);
+    [dartx.appendItem](...args) {
+      return this.appendItem.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.getItem](index) {
-      return this.getItem(index);
+    [dartx.getItem](...args) {
+      return this.getItem.apply(this, args);
     }
-    [dartx.initialize](newItem) {
-      return this.initialize(newItem);
+    [dartx.initialize](...args) {
+      return this.initialize.apply(this, args);
     }
-    [dartx.insertItemBefore](newItem, index) {
-      return this.insertItemBefore(newItem, index);
+    [dartx.insertItemBefore](...args) {
+      return this.insertItemBefore.apply(this, args);
     }
-    [dartx.removeItem](index) {
-      return this.removeItem(index);
+    [dartx.removeItem](...args) {
+      return this.removeItem.apply(this, args);
     }
-    [dartx.replaceItem](newItem, index) {
-      return this.replaceItem(newItem, index);
+    [dartx.replaceItem](...args) {
+      return this.replaceItem.apply(this, args);
     }
   };
   svg$.LengthList[dart.implements] = () => [ListOfLength()];
@@ -86521,8 +88367,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(svg$.Length, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, svg$.Length]),
+      [dartx._get]: dart.definiteFunctionType(svg$.Length, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, svg$.Length]),
       [dartx.elementAt]: dart.definiteFunctionType(svg$.Length, [core.int]),
       [__setter__$]: dart.definiteFunctionType(dart.void, [core.int, svg$.Length]),
       [dartx.appendItem]: dart.definiteFunctionType(svg$.Length, [svg$.Length]),
@@ -86738,11 +88584,11 @@
     get [dartx.refY]() {
       return this.refY;
     }
-    [dartx.setOrientToAngle](angle) {
-      return this.setOrientToAngle(angle);
+    [dartx.setOrientToAngle](...args) {
+      return this.setOrientToAngle.apply(this, args);
     }
-    [dartx.setOrientToAuto]() {
-      return this.setOrientToAuto();
+    [dartx.setOrientToAuto](...args) {
+      return this.setOrientToAuto.apply(this, args);
     }
     get [dartx.preserveAspectRatio]() {
       return this.preserveAspectRatio;
@@ -86848,8 +88694,8 @@
     get [dartx.systemLanguage]() {
       return this.systemLanguage;
     }
-    [dartx.hasExtension](extension) {
-      return this.hasExtension(extension);
+    [dartx.hasExtension](...args) {
+      return this.hasExtension.apply(this, args);
     }
   };
   dart.defineNamedConstructor(svg$.MaskElement, 'created');
@@ -86933,38 +88779,38 @@
     set [dartx.f](value) {
       this.f = value;
     }
-    [dartx.flipX]() {
-      return this.flipX();
+    [dartx.flipX](...args) {
+      return this.flipX.apply(this, args);
     }
-    [dartx.flipY]() {
-      return this.flipY();
+    [dartx.flipY](...args) {
+      return this.flipY.apply(this, args);
     }
-    [dartx.inverse]() {
-      return this.inverse();
+    [dartx.inverse](...args) {
+      return this.inverse.apply(this, args);
     }
-    [dartx.multiply](secondMatrix) {
-      return this.multiply(secondMatrix);
+    [dartx.multiply](...args) {
+      return this.multiply.apply(this, args);
     }
-    [dartx.rotate](angle) {
-      return this.rotate(angle);
+    [dartx.rotate](...args) {
+      return this.rotate.apply(this, args);
     }
-    [dartx.rotateFromVector](x, y) {
-      return this.rotateFromVector(x, y);
+    [dartx.rotateFromVector](...args) {
+      return this.rotateFromVector.apply(this, args);
     }
-    [dartx.scale](scaleFactor) {
-      return this.scale(scaleFactor);
+    [dartx.scale](...args) {
+      return this.scale.apply(this, args);
     }
-    [dartx.scaleNonUniform](scaleFactorX, scaleFactorY) {
-      return this.scaleNonUniform(scaleFactorX, scaleFactorY);
+    [dartx.scaleNonUniform](...args) {
+      return this.scaleNonUniform.apply(this, args);
     }
-    [dartx.skewX](angle) {
-      return this.skewX(angle);
+    [dartx.skewX](...args) {
+      return this.skewX.apply(this, args);
     }
-    [dartx.skewY](angle) {
-      return this.skewY(angle);
+    [dartx.skewY](...args) {
+      return this.skewY.apply(this, args);
     }
-    [dartx.translate](x, y) {
-      return this.translate(x, y);
+    [dartx.translate](...args) {
+      return this.translate.apply(this, args);
     }
   };
   dart.setSignature(svg$.Matrix, {
@@ -87029,8 +88875,8 @@
   dart.registerExtension(dart.global.SVGNumber, svg$.Number);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -87055,11 +88901,11 @@
     get [dartx.numberOfItems]() {
       return this.numberOfItems;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.getItem](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -87088,31 +88934,31 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__setter__$](index, newItem) {
-      return this.__setter__(index, newItem);
+    [__setter__$](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.appendItem](newItem) {
-      return this.appendItem(newItem);
+    [dartx.appendItem](...args) {
+      return this.appendItem.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.getItem](index) {
-      return this.getItem(index);
+    [dartx.getItem](...args) {
+      return this.getItem.apply(this, args);
     }
-    [dartx.initialize](newItem) {
-      return this.initialize(newItem);
+    [dartx.initialize](...args) {
+      return this.initialize.apply(this, args);
     }
-    [dartx.insertItemBefore](newItem, index) {
-      return this.insertItemBefore(newItem, index);
+    [dartx.insertItemBefore](...args) {
+      return this.insertItemBefore.apply(this, args);
     }
-    [dartx.removeItem](index) {
-      return this.removeItem(index);
+    [dartx.removeItem](...args) {
+      return this.removeItem.apply(this, args);
     }
-    [dartx.replaceItem](newItem, index) {
-      return this.replaceItem(newItem, index);
+    [dartx.replaceItem](...args) {
+      return this.replaceItem.apply(this, args);
     }
   };
   svg$.NumberList[dart.implements] = () => [ListOfNumber()];
@@ -87127,8 +88973,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(svg$.Number, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, svg$.Number]),
+      [dartx._get]: dart.definiteFunctionType(svg$.Number, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, svg$.Number]),
       [dartx.elementAt]: dart.definiteFunctionType(svg$.Number, [core.int]),
       [__setter__$]: dart.definiteFunctionType(dart.void, [core.int, svg$.Number]),
       [dartx.appendItem]: dart.definiteFunctionType(svg$.Number, [svg$.Number]),
@@ -87199,71 +89045,71 @@
     get [dartx.pathSegList]() {
       return this.pathSegList;
     }
-    [dartx.createSvgPathSegArcAbs](x, y, r1, r2, angle, largeArcFlag, sweepFlag) {
-      return this.createSVGPathSegArcAbs(x, y, r1, r2, angle, largeArcFlag, sweepFlag);
+    [dartx.createSvgPathSegArcAbs](...args) {
+      return this.createSVGPathSegArcAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegArcRel](x, y, r1, r2, angle, largeArcFlag, sweepFlag) {
-      return this.createSVGPathSegArcRel(x, y, r1, r2, angle, largeArcFlag, sweepFlag);
+    [dartx.createSvgPathSegArcRel](...args) {
+      return this.createSVGPathSegArcRel.apply(this, args);
     }
-    [dartx.createSvgPathSegClosePath]() {
-      return this.createSVGPathSegClosePath();
+    [dartx.createSvgPathSegClosePath](...args) {
+      return this.createSVGPathSegClosePath.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoCubicAbs](x, y, x1, y1, x2, y2) {
-      return this.createSVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2);
+    [dartx.createSvgPathSegCurvetoCubicAbs](...args) {
+      return this.createSVGPathSegCurvetoCubicAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoCubicRel](x, y, x1, y1, x2, y2) {
-      return this.createSVGPathSegCurvetoCubicRel(x, y, x1, y1, x2, y2);
+    [dartx.createSvgPathSegCurvetoCubicRel](...args) {
+      return this.createSVGPathSegCurvetoCubicRel.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoCubicSmoothAbs](x, y, x2, y2) {
-      return this.createSVGPathSegCurvetoCubicSmoothAbs(x, y, x2, y2);
+    [dartx.createSvgPathSegCurvetoCubicSmoothAbs](...args) {
+      return this.createSVGPathSegCurvetoCubicSmoothAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoCubicSmoothRel](x, y, x2, y2) {
-      return this.createSVGPathSegCurvetoCubicSmoothRel(x, y, x2, y2);
+    [dartx.createSvgPathSegCurvetoCubicSmoothRel](...args) {
+      return this.createSVGPathSegCurvetoCubicSmoothRel.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoQuadraticAbs](x, y, x1, y1) {
-      return this.createSVGPathSegCurvetoQuadraticAbs(x, y, x1, y1);
+    [dartx.createSvgPathSegCurvetoQuadraticAbs](...args) {
+      return this.createSVGPathSegCurvetoQuadraticAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoQuadraticRel](x, y, x1, y1) {
-      return this.createSVGPathSegCurvetoQuadraticRel(x, y, x1, y1);
+    [dartx.createSvgPathSegCurvetoQuadraticRel](...args) {
+      return this.createSVGPathSegCurvetoQuadraticRel.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoQuadraticSmoothAbs](x, y) {
-      return this.createSVGPathSegCurvetoQuadraticSmoothAbs(x, y);
+    [dartx.createSvgPathSegCurvetoQuadraticSmoothAbs](...args) {
+      return this.createSVGPathSegCurvetoQuadraticSmoothAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegCurvetoQuadraticSmoothRel](x, y) {
-      return this.createSVGPathSegCurvetoQuadraticSmoothRel(x, y);
+    [dartx.createSvgPathSegCurvetoQuadraticSmoothRel](...args) {
+      return this.createSVGPathSegCurvetoQuadraticSmoothRel.apply(this, args);
     }
-    [dartx.createSvgPathSegLinetoAbs](x, y) {
-      return this.createSVGPathSegLinetoAbs(x, y);
+    [dartx.createSvgPathSegLinetoAbs](...args) {
+      return this.createSVGPathSegLinetoAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegLinetoHorizontalAbs](x) {
-      return this.createSVGPathSegLinetoHorizontalAbs(x);
+    [dartx.createSvgPathSegLinetoHorizontalAbs](...args) {
+      return this.createSVGPathSegLinetoHorizontalAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegLinetoHorizontalRel](x) {
-      return this.createSVGPathSegLinetoHorizontalRel(x);
+    [dartx.createSvgPathSegLinetoHorizontalRel](...args) {
+      return this.createSVGPathSegLinetoHorizontalRel.apply(this, args);
     }
-    [dartx.createSvgPathSegLinetoRel](x, y) {
-      return this.createSVGPathSegLinetoRel(x, y);
+    [dartx.createSvgPathSegLinetoRel](...args) {
+      return this.createSVGPathSegLinetoRel.apply(this, args);
     }
-    [dartx.createSvgPathSegLinetoVerticalAbs](y) {
-      return this.createSVGPathSegLinetoVerticalAbs(y);
+    [dartx.createSvgPathSegLinetoVerticalAbs](...args) {
+      return this.createSVGPathSegLinetoVerticalAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegLinetoVerticalRel](y) {
-      return this.createSVGPathSegLinetoVerticalRel(y);
+    [dartx.createSvgPathSegLinetoVerticalRel](...args) {
+      return this.createSVGPathSegLinetoVerticalRel.apply(this, args);
     }
-    [dartx.createSvgPathSegMovetoAbs](x, y) {
-      return this.createSVGPathSegMovetoAbs(x, y);
+    [dartx.createSvgPathSegMovetoAbs](...args) {
+      return this.createSVGPathSegMovetoAbs.apply(this, args);
     }
-    [dartx.createSvgPathSegMovetoRel](x, y) {
-      return this.createSVGPathSegMovetoRel(x, y);
+    [dartx.createSvgPathSegMovetoRel](...args) {
+      return this.createSVGPathSegMovetoRel.apply(this, args);
     }
-    [dartx.getPathSegAtLength](distance) {
-      return this.getPathSegAtLength(distance);
+    [dartx.getPathSegAtLength](...args) {
+      return this.getPathSegAtLength.apply(this, args);
     }
-    [dartx.getPointAtLength](distance) {
-      return this.getPointAtLength(distance);
+    [dartx.getPointAtLength](...args) {
+      return this.getPointAtLength.apply(this, args);
     }
-    [dartx.getTotalLength]() {
-      return this.getTotalLength();
+    [dartx.getTotalLength](...args) {
+      return this.getTotalLength.apply(this, args);
     }
   };
   dart.defineNamedConstructor(svg$.PathElement, 'created');
@@ -88014,8 +89860,8 @@
   dart.registerExtension(dart.global.SVGPathSegLinetoVerticalRel, svg$.PathSegLinetoVerticalRel);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -88040,11 +89886,11 @@
     get [dartx.numberOfItems]() {
       return this.numberOfItems;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.getItem](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -88073,31 +89919,31 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__setter__$](index, newItem) {
-      return this.__setter__(index, newItem);
+    [__setter__$](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.appendItem](newItem) {
-      return this.appendItem(newItem);
+    [dartx.appendItem](...args) {
+      return this.appendItem.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.getItem](index) {
-      return this.getItem(index);
+    [dartx.getItem](...args) {
+      return this.getItem.apply(this, args);
     }
-    [dartx.initialize](newItem) {
-      return this.initialize(newItem);
+    [dartx.initialize](...args) {
+      return this.initialize.apply(this, args);
     }
-    [dartx.insertItemBefore](newItem, index) {
-      return this.insertItemBefore(newItem, index);
+    [dartx.insertItemBefore](...args) {
+      return this.insertItemBefore.apply(this, args);
     }
-    [dartx.removeItem](index) {
-      return this.removeItem(index);
+    [dartx.removeItem](...args) {
+      return this.removeItem.apply(this, args);
     }
-    [dartx.replaceItem](newItem, index) {
-      return this.replaceItem(newItem, index);
+    [dartx.replaceItem](...args) {
+      return this.replaceItem.apply(this, args);
     }
   };
   svg$.PathSegList[dart.implements] = () => [ListOfPathSeg()];
@@ -88112,8 +89958,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(svg$.PathSeg, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, svg$.PathSeg]),
+      [dartx._get]: dart.definiteFunctionType(svg$.PathSeg, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, svg$.PathSeg]),
       [dartx.elementAt]: dart.definiteFunctionType(svg$.PathSeg, [core.int]),
       [__setter__$]: dart.definiteFunctionType(dart.void, [core.int, svg$.PathSeg]),
       [dartx.appendItem]: dart.definiteFunctionType(svg$.PathSeg, [svg$.PathSeg]),
@@ -88258,8 +90104,8 @@
     get [dartx.systemLanguage]() {
       return this.systemLanguage;
     }
-    [dartx.hasExtension](extension) {
-      return this.hasExtension(extension);
+    [dartx.hasExtension](...args) {
+      return this.hasExtension.apply(this, args);
     }
     get [dartx.href]() {
       return this.href;
@@ -88312,8 +90158,8 @@
     set [dartx.y](value) {
       this.y = value;
     }
-    [dartx.matrixTransform](matrix) {
-      return this.matrixTransform(matrix);
+    [dartx.matrixTransform](...args) {
+      return this.matrixTransform.apply(this, args);
     }
   };
   dart.setSignature(svg$.Point, {
@@ -88346,29 +90192,29 @@
     get [dartx.numberOfItems]() {
       return this.numberOfItems;
     }
-    [__setter__$](index, newItem) {
-      return this.__setter__(index, newItem);
+    [__setter__$](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.appendItem](newItem) {
-      return this.appendItem(newItem);
+    [dartx.appendItem](...args) {
+      return this.appendItem.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.getItem](index) {
-      return this.getItem(index);
+    [dartx.getItem](...args) {
+      return this.getItem.apply(this, args);
     }
-    [dartx.initialize](newItem) {
-      return this.initialize(newItem);
+    [dartx.initialize](...args) {
+      return this.initialize.apply(this, args);
     }
-    [dartx.insertItemBefore](newItem, index) {
-      return this.insertItemBefore(newItem, index);
+    [dartx.insertItemBefore](...args) {
+      return this.insertItemBefore.apply(this, args);
     }
-    [dartx.removeItem](index) {
-      return this.removeItem(index);
+    [dartx.removeItem](...args) {
+      return this.removeItem.apply(this, args);
     }
-    [dartx.replaceItem](newItem, index) {
-      return this.replaceItem(newItem, index);
+    [dartx.replaceItem](...args) {
+      return this.replaceItem.apply(this, args);
     }
   };
   dart.setSignature(svg$.PointList, {
@@ -88779,8 +90625,8 @@
   dart.registerExtension(dart.global.SVGStopElement, svg$.StopElement);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -88805,11 +90651,11 @@
     get [dartx.numberOfItems]() {
       return this.numberOfItems;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.getItem](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -88838,31 +90684,31 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__setter__$](index, newItem) {
-      return this.__setter__(index, newItem);
+    [__setter__$](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.appendItem](newItem) {
-      return this.appendItem(newItem);
+    [dartx.appendItem](...args) {
+      return this.appendItem.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.getItem](index) {
-      return this.getItem(index);
+    [dartx.getItem](...args) {
+      return this.getItem.apply(this, args);
     }
-    [dartx.initialize](newItem) {
-      return this.initialize(newItem);
+    [dartx.initialize](...args) {
+      return this.initialize.apply(this, args);
     }
-    [dartx.insertItemBefore](item, index) {
-      return this.insertItemBefore(item, index);
+    [dartx.insertItemBefore](...args) {
+      return this.insertItemBefore.apply(this, args);
     }
-    [dartx.removeItem](index) {
-      return this.removeItem(index);
+    [dartx.removeItem](...args) {
+      return this.removeItem.apply(this, args);
     }
-    [dartx.replaceItem](newItem, index) {
-      return this.replaceItem(newItem, index);
+    [dartx.replaceItem](...args) {
+      return this.replaceItem.apply(this, args);
     }
   };
   svg$.StringList[dart.implements] = () => [ListOfString()];
@@ -88877,8 +90723,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.String, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, core.String]),
+      [dartx._get]: dart.definiteFunctionType(core.String, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, core.String]),
       [dartx.elementAt]: dart.definiteFunctionType(core.String, [core.int]),
       [__setter__$]: dart.definiteFunctionType(dart.void, [core.int, core.String]),
       [dartx.appendItem]: dart.definiteFunctionType(core.String, [core.String]),
@@ -88953,7 +90799,7 @@
       this[_element$0] = element;
     }
     readClasses() {
-      let classname = this[_element$0][dartx.attributes][dartx.get]('class');
+      let classname = this[_element$0][dartx.attributes][dartx._get]('class');
       let s = LinkedHashSetOfString().new();
       if (classname == null) {
         return s;
@@ -88967,7 +90813,7 @@
       return s;
     }
     writeClasses(s) {
-      this[_element$0][dartx.attributes][dartx.set]('class', s.join(' '));
+      this[_element$0][dartx.attributes][dartx._set]('class', s.join(' '));
     }
   };
   dart.setSignature(svg$._AttributeClassSet, {
@@ -89022,7 +90868,7 @@
   svg$.SvgSvgElement = class SvgSvgElement extends svg$.GraphicsElement {
     static new() {
       let el = svg$.SvgElement.tag("svg");
-      el[dartx.attributes][dartx.set]('version', "1.1");
+      el[dartx.attributes][dartx._set]('version', "1.1");
       return svg$.SvgSvgElement._check(el);
     }
     static _() {
@@ -89089,74 +90935,74 @@
     get [dartx.y]() {
       return this.y;
     }
-    [dartx.animationsPaused]() {
-      return this.animationsPaused();
+    [dartx.animationsPaused](...args) {
+      return this.animationsPaused.apply(this, args);
     }
-    [dartx.checkEnclosure](element, rect) {
-      return this.checkEnclosure(element, rect);
+    [dartx.checkEnclosure](...args) {
+      return this.checkEnclosure.apply(this, args);
     }
-    [dartx.checkIntersection](element, rect) {
-      return this.checkIntersection(element, rect);
+    [dartx.checkIntersection](...args) {
+      return this.checkIntersection.apply(this, args);
     }
-    [dartx.createSvgAngle]() {
-      return this.createSVGAngle();
+    [dartx.createSvgAngle](...args) {
+      return this.createSVGAngle.apply(this, args);
     }
-    [dartx.createSvgLength]() {
-      return this.createSVGLength();
+    [dartx.createSvgLength](...args) {
+      return this.createSVGLength.apply(this, args);
     }
-    [dartx.createSvgMatrix]() {
-      return this.createSVGMatrix();
+    [dartx.createSvgMatrix](...args) {
+      return this.createSVGMatrix.apply(this, args);
     }
-    [dartx.createSvgNumber]() {
-      return this.createSVGNumber();
+    [dartx.createSvgNumber](...args) {
+      return this.createSVGNumber.apply(this, args);
     }
-    [dartx.createSvgPoint]() {
-      return this.createSVGPoint();
+    [dartx.createSvgPoint](...args) {
+      return this.createSVGPoint.apply(this, args);
     }
-    [dartx.createSvgRect]() {
-      return this.createSVGRect();
+    [dartx.createSvgRect](...args) {
+      return this.createSVGRect.apply(this, args);
     }
-    [dartx.createSvgTransform]() {
-      return this.createSVGTransform();
+    [dartx.createSvgTransform](...args) {
+      return this.createSVGTransform.apply(this, args);
     }
-    [dartx.createSvgTransformFromMatrix](matrix) {
-      return this.createSVGTransformFromMatrix(matrix);
+    [dartx.createSvgTransformFromMatrix](...args) {
+      return this.createSVGTransformFromMatrix.apply(this, args);
     }
-    [dartx.deselectAll]() {
-      return this.deselectAll();
+    [dartx.deselectAll](...args) {
+      return this.deselectAll.apply(this, args);
     }
-    [dartx.forceRedraw]() {
-      return this.forceRedraw();
+    [dartx.forceRedraw](...args) {
+      return this.forceRedraw.apply(this, args);
     }
-    [dartx.getCurrentTime]() {
-      return this.getCurrentTime();
+    [dartx.getCurrentTime](...args) {
+      return this.getCurrentTime.apply(this, args);
     }
-    [dartx.getElementById](elementId) {
-      return this.getElementById(elementId);
+    [dartx.getElementById](...args) {
+      return this.getElementById.apply(this, args);
     }
-    [dartx.getEnclosureList](rect, referenceElement) {
-      return this.getEnclosureList(rect, referenceElement);
+    [dartx.getEnclosureList](...args) {
+      return this.getEnclosureList.apply(this, args);
     }
-    [dartx.getIntersectionList](rect, referenceElement) {
-      return this.getIntersectionList(rect, referenceElement);
+    [dartx.getIntersectionList](...args) {
+      return this.getIntersectionList.apply(this, args);
     }
-    [dartx.pauseAnimations]() {
-      return this.pauseAnimations();
+    [dartx.pauseAnimations](...args) {
+      return this.pauseAnimations.apply(this, args);
     }
-    [dartx.setCurrentTime](seconds) {
-      return this.setCurrentTime(seconds);
+    [dartx.setCurrentTime](...args) {
+      return this.setCurrentTime.apply(this, args);
     }
-    [dartx.suspendRedraw](maxWaitMilliseconds) {
-      return this.suspendRedraw(maxWaitMilliseconds);
+    [dartx.suspendRedraw](...args) {
+      return this.suspendRedraw.apply(this, args);
     }
-    [dartx.unpauseAnimations]() {
-      return this.unpauseAnimations();
+    [dartx.unpauseAnimations](...args) {
+      return this.unpauseAnimations.apply(this, args);
     }
-    [dartx.unsuspendRedraw](suspendHandleId) {
-      return this.unsuspendRedraw(suspendHandleId);
+    [dartx.unsuspendRedraw](...args) {
+      return this.unsuspendRedraw.apply(this, args);
     }
-    [dartx.unsuspendRedrawAll]() {
-      return this.unsuspendRedrawAll();
+    [dartx.unsuspendRedrawAll](...args) {
+      return this.unsuspendRedrawAll.apply(this, args);
     }
     get [dartx.preserveAspectRatio]() {
       return this.preserveAspectRatio;
@@ -89309,32 +91155,32 @@
     get [dartx.textLength]() {
       return this.textLength;
     }
-    [dartx.getCharNumAtPosition](point) {
-      return this.getCharNumAtPosition(point);
+    [dartx.getCharNumAtPosition](...args) {
+      return this.getCharNumAtPosition.apply(this, args);
     }
-    [dartx.getComputedTextLength]() {
-      return this.getComputedTextLength();
+    [dartx.getComputedTextLength](...args) {
+      return this.getComputedTextLength.apply(this, args);
     }
-    [dartx.getEndPositionOfChar](charnum) {
-      return this.getEndPositionOfChar(charnum);
+    [dartx.getEndPositionOfChar](...args) {
+      return this.getEndPositionOfChar.apply(this, args);
     }
-    [dartx.getExtentOfChar](charnum) {
-      return this.getExtentOfChar(charnum);
+    [dartx.getExtentOfChar](...args) {
+      return this.getExtentOfChar.apply(this, args);
     }
-    [dartx.getNumberOfChars]() {
-      return this.getNumberOfChars();
+    [dartx.getNumberOfChars](...args) {
+      return this.getNumberOfChars.apply(this, args);
     }
-    [dartx.getRotationOfChar](charnum) {
-      return this.getRotationOfChar(charnum);
+    [dartx.getRotationOfChar](...args) {
+      return this.getRotationOfChar.apply(this, args);
     }
-    [dartx.getStartPositionOfChar](charnum) {
-      return this.getStartPositionOfChar(charnum);
+    [dartx.getStartPositionOfChar](...args) {
+      return this.getStartPositionOfChar.apply(this, args);
     }
-    [dartx.getSubStringLength](charnum, nchars) {
-      return this.getSubStringLength(charnum, nchars);
+    [dartx.getSubStringLength](...args) {
+      return this.getSubStringLength.apply(this, args);
     }
-    [dartx.selectSubString](charnum, nchars) {
-      return this.selectSubString(charnum, nchars);
+    [dartx.selectSubString](...args) {
+      return this.selectSubString.apply(this, args);
     }
   };
   dart.defineNamedConstructor(svg$.TextContentElement, 'created');
@@ -89447,7 +91293,28 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get requiredExtensions() {
+      return this[requiredExtensions];
+    }
+    set requiredExtensions(value) {
+      super.requiredExtensions = value;
+    }
+    get requiredFeatures() {
+      return this[requiredFeatures];
+    }
+    set requiredFeatures(value) {
+      super.requiredFeatures = value;
+    }
+    get systemLanguage() {
+      return this[systemLanguage];
+    }
+    set systemLanguage(value) {
+      super.systemLanguage = value;
+    }
   };
+  const requiredExtensions = Symbol(svg$.Tests.name + "." + 'requiredExtensions'.toString());
+  const requiredFeatures = Symbol(svg$.Tests.name + "." + 'requiredFeatures'.toString());
+  const systemLanguage = Symbol(svg$.Tests.name + "." + 'systemLanguage'.toString());
   dart.setSignature(svg$.Tests, {
     constructors: () => ({_: dart.definiteFunctionType(svg$.Tests, [])}),
     fields: () => ({
@@ -89580,23 +91447,23 @@
     get [dartx.type]() {
       return this.type;
     }
-    [dartx.setMatrix](matrix) {
-      return this.setMatrix(matrix);
+    [dartx.setMatrix](...args) {
+      return this.setMatrix.apply(this, args);
     }
-    [dartx.setRotate](angle, cx, cy) {
-      return this.setRotate(angle, cx, cy);
+    [dartx.setRotate](...args) {
+      return this.setRotate.apply(this, args);
     }
-    [dartx.setScale](sx, sy) {
-      return this.setScale(sx, sy);
+    [dartx.setScale](...args) {
+      return this.setScale.apply(this, args);
     }
-    [dartx.setSkewX](angle) {
-      return this.setSkewX(angle);
+    [dartx.setSkewX](...args) {
+      return this.setSkewX.apply(this, args);
     }
-    [dartx.setSkewY](angle) {
-      return this.setSkewY(angle);
+    [dartx.setSkewY](...args) {
+      return this.setSkewY.apply(this, args);
     }
-    [dartx.setTranslate](tx, ty) {
-      return this.setTranslate(tx, ty);
+    [dartx.setTranslate](...args) {
+      return this.setTranslate.apply(this, args);
     }
   };
   dart.setSignature(svg$.Transform, {
@@ -89634,8 +91501,8 @@
   dart.registerExtension(dart.global.SVGTransform, svg$.Transform);
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -89662,11 +91529,11 @@
     get [dartx.numberOfItems]() {
       return this.numberOfItems;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.getItem](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -89695,37 +91562,37 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
-    [__setter__$](index, newItem) {
-      return this.__setter__(index, newItem);
+    [__setter__$](...args) {
+      return this.__setter__.apply(this, args);
     }
-    [dartx.appendItem](newItem) {
-      return this.appendItem(newItem);
+    [dartx.appendItem](...args) {
+      return this.appendItem.apply(this, args);
     }
-    [dartx.clear]() {
-      return this.clear();
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.consolidate]() {
-      return this.consolidate();
+    [dartx.consolidate](...args) {
+      return this.consolidate.apply(this, args);
     }
-    [dartx.createSvgTransformFromMatrix](matrix) {
-      return this.createSVGTransformFromMatrix(matrix);
+    [dartx.createSvgTransformFromMatrix](...args) {
+      return this.createSVGTransformFromMatrix.apply(this, args);
     }
-    [dartx.getItem](index) {
-      return this.getItem(index);
+    [dartx.getItem](...args) {
+      return this.getItem.apply(this, args);
     }
-    [dartx.initialize](newItem) {
-      return this.initialize(newItem);
+    [dartx.initialize](...args) {
+      return this.initialize.apply(this, args);
     }
-    [dartx.insertItemBefore](newItem, index) {
-      return this.insertItemBefore(newItem, index);
+    [dartx.insertItemBefore](...args) {
+      return this.insertItemBefore.apply(this, args);
     }
-    [dartx.removeItem](index) {
-      return this.removeItem(index);
+    [dartx.removeItem](...args) {
+      return this.removeItem.apply(this, args);
     }
-    [dartx.replaceItem](newItem, index) {
-      return this.replaceItem(newItem, index);
+    [dartx.replaceItem](...args) {
+      return this.replaceItem.apply(this, args);
     }
   };
   svg$.TransformList[dart.implements] = () => [ListOfTransform()];
@@ -89740,8 +91607,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(svg$.Transform, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, svg$.Transform]),
+      [dartx._get]: dart.definiteFunctionType(svg$.Transform, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, svg$.Transform]),
       [dartx.elementAt]: dart.definiteFunctionType(svg$.Transform, [core.int]),
       [__setter__$]: dart.definiteFunctionType(dart.void, [core.int, svg$.Transform]),
       [dartx.appendItem]: dart.definiteFunctionType(svg$.Transform, [svg$.Transform]),
@@ -89779,7 +91646,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get href() {
+      return this[href$0];
+    }
+    set href(value) {
+      super.href = value;
+    }
   };
+  const href$0 = Symbol(svg$.UriReference.name + "." + 'href'.toString());
   dart.setSignature(svg$.UriReference, {
     constructors: () => ({_: dart.definiteFunctionType(svg$.UriReference, [])}),
     fields: () => ({href: svg$.AnimatedString})
@@ -89961,7 +91835,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
+    get zoomAndPan() {
+      return this[zoomAndPan];
+    }
+    set zoomAndPan(value) {
+      this[zoomAndPan] = value;
+    }
   };
+  const zoomAndPan = Symbol(svg$.ZoomAndPan.name + "." + 'zoomAndPan'.toString());
   dart.setSignature(svg$.ZoomAndPan, {
     constructors: () => ({_: dart.definiteFunctionType(svg$.ZoomAndPan, [])}),
     fields: () => ({zoomAndPan: core.int}),
@@ -90119,11 +92000,11 @@
     get [dartx.numberOfOutputs]() {
       return this.numberOfOutputs;
     }
-    [_connect](destination, output, input) {
-      return this.connect(destination, output, input);
+    [_connect](...args) {
+      return this.connect.apply(this, args);
     }
-    [dartx.disconnect](output) {
-      return this.disconnect(output);
+    [dartx.disconnect](...args) {
+      return this.disconnect.apply(this, args);
     }
     [dartx.connectNode](destination, output, input) {
       if (output === void 0) output = 0;
@@ -90195,17 +92076,17 @@
     set [dartx.smoothingTimeConstant](value) {
       this.smoothingTimeConstant = value;
     }
-    [dartx.getByteFrequencyData](array) {
-      return this.getByteFrequencyData(array);
+    [dartx.getByteFrequencyData](...args) {
+      return this.getByteFrequencyData.apply(this, args);
     }
-    [dartx.getByteTimeDomainData](array) {
-      return this.getByteTimeDomainData(array);
+    [dartx.getByteTimeDomainData](...args) {
+      return this.getByteTimeDomainData.apply(this, args);
     }
-    [dartx.getFloatFrequencyData](array) {
-      return this.getFloatFrequencyData(array);
+    [dartx.getFloatFrequencyData](...args) {
+      return this.getFloatFrequencyData.apply(this, args);
     }
-    [dartx.getFloatTimeDomainData](array) {
-      return this.getFloatTimeDomainData(array);
+    [dartx.getFloatTimeDomainData](...args) {
+      return this.getFloatTimeDomainData.apply(this, args);
     }
   };
   dart.setSignature(web_audio.AnalyserNode, {
@@ -90225,6 +92106,7 @@
     })
   });
   dart.registerExtension(dart.global.AnalyserNode, web_audio.AnalyserNode);
+  dart.registerExtension(dart.global.RealtimeAnalyserNode, web_audio.AnalyserNode);
   dart.defineExtensionNames([
     'getChannelData',
     'duration',
@@ -90248,8 +92130,8 @@
     get [dartx.sampleRate]() {
       return this.sampleRate;
     }
-    [dartx.getChannelData](channelIndex) {
-      return this.getChannelData(channelIndex);
+    [dartx.getChannelData](...args) {
+      return this.getChannelData.apply(this, args);
     }
   };
   dart.setSignature(web_audio.AudioBuffer, {
@@ -90411,59 +92293,59 @@
     get [dartx.sampleRate]() {
       return this.sampleRate;
     }
-    [dartx.createAnalyser]() {
-      return this.createAnalyser();
+    [dartx.createAnalyser](...args) {
+      return this.createAnalyser.apply(this, args);
     }
-    [dartx.createBiquadFilter]() {
-      return this.createBiquadFilter();
+    [dartx.createBiquadFilter](...args) {
+      return this.createBiquadFilter.apply(this, args);
     }
-    [dartx.createBuffer](numberOfChannels, numberOfFrames, sampleRate) {
-      return this.createBuffer(numberOfChannels, numberOfFrames, sampleRate);
+    [dartx.createBuffer](...args) {
+      return this.createBuffer.apply(this, args);
     }
-    [dartx.createBufferSource]() {
-      return this.createBufferSource();
+    [dartx.createBufferSource](...args) {
+      return this.createBufferSource.apply(this, args);
     }
-    [dartx.createChannelMerger](numberOfInputs) {
-      return this.createChannelMerger(numberOfInputs);
+    [dartx.createChannelMerger](...args) {
+      return this.createChannelMerger.apply(this, args);
     }
-    [dartx.createChannelSplitter](numberOfOutputs) {
-      return this.createChannelSplitter(numberOfOutputs);
+    [dartx.createChannelSplitter](...args) {
+      return this.createChannelSplitter.apply(this, args);
     }
-    [dartx.createConvolver]() {
-      return this.createConvolver();
+    [dartx.createConvolver](...args) {
+      return this.createConvolver.apply(this, args);
     }
-    [dartx.createDelay](maxDelayTime) {
-      return this.createDelay(maxDelayTime);
+    [dartx.createDelay](...args) {
+      return this.createDelay.apply(this, args);
     }
-    [dartx.createDynamicsCompressor]() {
-      return this.createDynamicsCompressor();
+    [dartx.createDynamicsCompressor](...args) {
+      return this.createDynamicsCompressor.apply(this, args);
     }
-    [dartx.createMediaElementSource](mediaElement) {
-      return this.createMediaElementSource(mediaElement);
+    [dartx.createMediaElementSource](...args) {
+      return this.createMediaElementSource.apply(this, args);
     }
-    [dartx.createMediaStreamDestination]() {
-      return this.createMediaStreamDestination();
+    [dartx.createMediaStreamDestination](...args) {
+      return this.createMediaStreamDestination.apply(this, args);
     }
-    [dartx.createMediaStreamSource](mediaStream) {
-      return this.createMediaStreamSource(mediaStream);
+    [dartx.createMediaStreamSource](...args) {
+      return this.createMediaStreamSource.apply(this, args);
     }
-    [dartx.createOscillator]() {
-      return this.createOscillator();
+    [dartx.createOscillator](...args) {
+      return this.createOscillator.apply(this, args);
     }
-    [dartx.createPanner]() {
-      return this.createPanner();
+    [dartx.createPanner](...args) {
+      return this.createPanner.apply(this, args);
     }
-    [dartx.createPeriodicWave](real, imag) {
-      return this.createPeriodicWave(real, imag);
+    [dartx.createPeriodicWave](...args) {
+      return this.createPeriodicWave.apply(this, args);
     }
-    [dartx.createWaveShaper]() {
-      return this.createWaveShaper();
+    [dartx.createWaveShaper](...args) {
+      return this.createWaveShaper.apply(this, args);
     }
-    [_decodeAudioData](audioData, successCallback, errorCallback) {
-      return this.decodeAudioData(audioData, successCallback, errorCallback);
+    [_decodeAudioData](...args) {
+      return this.decodeAudioData.apply(this, args);
     }
-    [dartx.startRendering]() {
-      return this.startRendering();
+    [dartx.startRendering](...args) {
+      return this.startRendering.apply(this, args);
     }
     get [dartx.onComplete]() {
       return web_audio.AudioContext.completeEvent.forTarget(this);
@@ -90544,6 +92426,7 @@
   });
   web_audio.AudioContext.completeEvent = dart.const(new (EventStreamProviderOfEvent())('complete'));
   dart.registerExtension(dart.global.AudioContext, web_audio.AudioContext);
+  dart.registerExtension(dart.global.webkitAudioContext, web_audio.AudioContext);
   dart.defineExtensionNames([
     'maxChannelCount'
   ]);
@@ -90583,14 +92466,14 @@
     set [dartx.speedOfSound](value) {
       this.speedOfSound = value;
     }
-    [dartx.setOrientation](x, y, z, xUp, yUp, zUp) {
-      return this.setOrientation(x, y, z, xUp, yUp, zUp);
+    [dartx.setOrientation](...args) {
+      return this.setOrientation.apply(this, args);
     }
-    [dartx.setPosition](x, y, z) {
-      return this.setPosition(x, y, z);
+    [dartx.setPosition](...args) {
+      return this.setPosition.apply(this, args);
     }
-    [dartx.setVelocity](x, y, z) {
-      return this.setVelocity(x, y, z);
+    [dartx.setVelocity](...args) {
+      return this.setVelocity.apply(this, args);
     }
   };
   dart.setSignature(web_audio.AudioListener, {
@@ -90629,23 +92512,23 @@
     set [dartx.value](value) {
       this.value = value;
     }
-    [dartx.cancelScheduledValues](startTime) {
-      return this.cancelScheduledValues(startTime);
+    [dartx.cancelScheduledValues](...args) {
+      return this.cancelScheduledValues.apply(this, args);
     }
-    [dartx.exponentialRampToValueAtTime](value, time) {
-      return this.exponentialRampToValueAtTime(value, time);
+    [dartx.exponentialRampToValueAtTime](...args) {
+      return this.exponentialRampToValueAtTime.apply(this, args);
     }
-    [dartx.linearRampToValueAtTime](value, time) {
-      return this.linearRampToValueAtTime(value, time);
+    [dartx.linearRampToValueAtTime](...args) {
+      return this.linearRampToValueAtTime.apply(this, args);
     }
-    [dartx.setTargetAtTime](target, time, timeConstant) {
-      return this.setTargetAtTime(target, time, timeConstant);
+    [dartx.setTargetAtTime](...args) {
+      return this.setTargetAtTime.apply(this, args);
     }
-    [dartx.setValueAtTime](value, time) {
-      return this.setValueAtTime(value, time);
+    [dartx.setValueAtTime](...args) {
+      return this.setValueAtTime.apply(this, args);
     }
-    [dartx.setValueCurveAtTime](values, time, duration) {
-      return this.setValueCurveAtTime(values, time, duration);
+    [dartx.setValueCurveAtTime](...args) {
+      return this.setValueCurveAtTime.apply(this, args);
     }
   };
   dart.setSignature(web_audio.AudioParam, {
@@ -90722,8 +92605,8 @@
     set [dartx.type](value) {
       this.type = value;
     }
-    [dartx.getFrequencyResponse](frequencyHz, magResponse, phaseResponse) {
-      return this.getFrequencyResponse(frequencyHz, magResponse, phaseResponse);
+    [dartx.getFrequencyResponse](...args) {
+      return this.getFrequencyResponse.apply(this, args);
     }
   };
   dart.setSignature(web_audio.BiquadFilterNode, {
@@ -90747,6 +92630,7 @@
     constructors: () => ({_: dart.definiteFunctionType(web_audio.ChannelMergerNode, [])})
   });
   dart.registerExtension(dart.global.ChannelMergerNode, web_audio.ChannelMergerNode);
+  dart.registerExtension(dart.global.AudioChannelMerger, web_audio.ChannelMergerNode);
   web_audio.ChannelSplitterNode = class ChannelSplitterNode extends web_audio.AudioNode {
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
@@ -90756,6 +92640,7 @@
     constructors: () => ({_: dart.definiteFunctionType(web_audio.ChannelSplitterNode, [])})
   });
   dart.registerExtension(dart.global.ChannelSplitterNode, web_audio.ChannelSplitterNode);
+  dart.registerExtension(dart.global.AudioChannelSplitter, web_audio.ChannelSplitterNode);
   dart.defineExtensionNames([
     'buffer',
     'normalize'
@@ -90860,6 +92745,7 @@
     fields: () => ({[dartx.gain]: web_audio.AudioParam})
   });
   dart.registerExtension(dart.global.GainNode, web_audio.GainNode);
+  dart.registerExtension(dart.global.AudioGainNode, web_audio.GainNode);
   dart.defineExtensionNames([
     'mediaElement'
   ]);
@@ -90971,20 +92857,20 @@
     set [dartx.type](value) {
       this.type = value;
     }
-    [dartx.noteOff](when) {
-      return this.noteOff(when);
+    [dartx.noteOff](...args) {
+      return this.noteOff.apply(this, args);
     }
-    [dartx.noteOn](when) {
-      return this.noteOn(when);
+    [dartx.noteOn](...args) {
+      return this.noteOn.apply(this, args);
     }
-    [dartx.setPeriodicWave](periodicWave) {
-      return this.setPeriodicWave(periodicWave);
+    [dartx.setPeriodicWave](...args) {
+      return this.setPeriodicWave.apply(this, args);
     }
-    [dartx.start](when) {
-      return this.start(when);
+    [dartx.start](...args) {
+      return this.start.apply(this, args);
     }
-    [dartx.stop](when) {
-      return this.stop(when);
+    [dartx.stop](...args) {
+      return this.stop.apply(this, args);
     }
     get [dartx.onEnded]() {
       return web_audio.OscillatorNode.endedEvent.forTarget(this);
@@ -91009,6 +92895,7 @@
   });
   web_audio.OscillatorNode.endedEvent = dart.const(new (EventStreamProviderOfEvent())('ended'));
   dart.registerExtension(dart.global.OscillatorNode, web_audio.OscillatorNode);
+  dart.registerExtension(dart.global.Oscillator, web_audio.OscillatorNode);
   dart.defineExtensionNames([
     'setOrientation',
     'setPosition',
@@ -91074,14 +92961,14 @@
     set [dartx.rolloffFactor](value) {
       this.rolloffFactor = value;
     }
-    [dartx.setOrientation](x, y, z) {
-      return this.setOrientation(x, y, z);
+    [dartx.setOrientation](...args) {
+      return this.setOrientation.apply(this, args);
     }
-    [dartx.setPosition](x, y, z) {
-      return this.setPosition(x, y, z);
+    [dartx.setPosition](...args) {
+      return this.setPosition.apply(this, args);
     }
-    [dartx.setVelocity](x, y, z) {
-      return this.setVelocity(x, y, z);
+    [dartx.setVelocity](...args) {
+      return this.setVelocity.apply(this, args);
     }
   };
   dart.setSignature(web_audio.PannerNode, {
@@ -91103,6 +92990,8 @@
     })
   });
   dart.registerExtension(dart.global.PannerNode, web_audio.PannerNode);
+  dart.registerExtension(dart.global.AudioPannerNode, web_audio.PannerNode);
+  dart.registerExtension(dart.global.webkitAudioPannerNode, web_audio.PannerNode);
   web_audio.PeriodicWave = class PeriodicWave extends _interceptors.Interceptor {
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
@@ -91124,8 +93013,8 @@
     get [dartx.bufferSize]() {
       return this.bufferSize;
     }
-    [dartx.setEventListener](eventListener) {
-      return this.setEventListener(eventListener);
+    [dartx.setEventListener](...args) {
+      return this.setEventListener.apply(this, args);
     }
     get [dartx.onAudioProcess]() {
       return web_audio.ScriptProcessorNode.audioProcessEvent.forTarget(this);
@@ -91140,6 +93029,7 @@
   });
   web_audio.ScriptProcessorNode.audioProcessEvent = dart.const(new (EventStreamProviderOfAudioProcessingEvent())('audioprocess'));
   dart.registerExtension(dart.global.ScriptProcessorNode, web_audio.ScriptProcessorNode);
+  dart.registerExtension(dart.global.JavaScriptAudioNode, web_audio.ScriptProcessorNode);
   dart.defineExtensionNames([
     'curve',
     'oversample'
@@ -91355,323 +93245,323 @@
     get [dartx.drawingBufferWidth]() {
       return this.drawingBufferWidth;
     }
-    [dartx.activeTexture](texture) {
-      return this.activeTexture(texture);
+    [dartx.activeTexture](...args) {
+      return this.activeTexture.apply(this, args);
     }
-    [dartx.attachShader](program, shader) {
-      return this.attachShader(program, shader);
+    [dartx.attachShader](...args) {
+      return this.attachShader.apply(this, args);
     }
-    [dartx.bindAttribLocation](program, index, name) {
-      return this.bindAttribLocation(program, index, name);
+    [dartx.bindAttribLocation](...args) {
+      return this.bindAttribLocation.apply(this, args);
     }
-    [dartx.bindBuffer](target, buffer) {
-      return this.bindBuffer(target, buffer);
+    [dartx.bindBuffer](...args) {
+      return this.bindBuffer.apply(this, args);
     }
-    [dartx.bindFramebuffer](target, framebuffer) {
-      return this.bindFramebuffer(target, framebuffer);
+    [dartx.bindFramebuffer](...args) {
+      return this.bindFramebuffer.apply(this, args);
     }
-    [dartx.bindRenderbuffer](target, renderbuffer) {
-      return this.bindRenderbuffer(target, renderbuffer);
+    [dartx.bindRenderbuffer](...args) {
+      return this.bindRenderbuffer.apply(this, args);
     }
-    [dartx.bindTexture](target, texture) {
-      return this.bindTexture(target, texture);
+    [dartx.bindTexture](...args) {
+      return this.bindTexture.apply(this, args);
     }
-    [dartx.blendColor](red, green, blue, alpha) {
-      return this.blendColor(red, green, blue, alpha);
+    [dartx.blendColor](...args) {
+      return this.blendColor.apply(this, args);
     }
-    [dartx.blendEquation](mode) {
-      return this.blendEquation(mode);
+    [dartx.blendEquation](...args) {
+      return this.blendEquation.apply(this, args);
     }
-    [dartx.blendEquationSeparate](modeRGB, modeAlpha) {
-      return this.blendEquationSeparate(modeRGB, modeAlpha);
+    [dartx.blendEquationSeparate](...args) {
+      return this.blendEquationSeparate.apply(this, args);
     }
-    [dartx.blendFunc](sfactor, dfactor) {
-      return this.blendFunc(sfactor, dfactor);
+    [dartx.blendFunc](...args) {
+      return this.blendFunc.apply(this, args);
     }
-    [dartx.blendFuncSeparate](srcRGB, dstRGB, srcAlpha, dstAlpha) {
-      return this.blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
+    [dartx.blendFuncSeparate](...args) {
+      return this.blendFuncSeparate.apply(this, args);
     }
-    [dartx.bufferByteData](target, data, usage) {
-      return this.bufferData(target, data, usage);
+    [dartx.bufferByteData](...args) {
+      return this.bufferData.apply(this, args);
     }
-    [dartx.bufferData](target, data_OR_size, usage) {
-      return this.bufferData(target, data_OR_size, usage);
+    [dartx.bufferData](...args) {
+      return this.bufferData.apply(this, args);
     }
-    [dartx.bufferDataTyped](target, data, usage) {
-      return this.bufferData(target, data, usage);
+    [dartx.bufferDataTyped](...args) {
+      return this.bufferData.apply(this, args);
     }
-    [dartx.bufferSubByteData](target, offset, data) {
-      return this.bufferSubData(target, offset, data);
+    [dartx.bufferSubByteData](...args) {
+      return this.bufferSubData.apply(this, args);
     }
-    [dartx.bufferSubData](target, offset, data) {
-      return this.bufferSubData(target, offset, data);
+    [dartx.bufferSubData](...args) {
+      return this.bufferSubData.apply(this, args);
     }
-    [dartx.bufferSubDataTyped](target, offset, data) {
-      return this.bufferSubData(target, offset, data);
+    [dartx.bufferSubDataTyped](...args) {
+      return this.bufferSubData.apply(this, args);
     }
-    [dartx.checkFramebufferStatus](target) {
-      return this.checkFramebufferStatus(target);
+    [dartx.checkFramebufferStatus](...args) {
+      return this.checkFramebufferStatus.apply(this, args);
     }
-    [dartx.clear](mask) {
-      return this.clear(mask);
+    [dartx.clear](...args) {
+      return this.clear.apply(this, args);
     }
-    [dartx.clearColor](red, green, blue, alpha) {
-      return this.clearColor(red, green, blue, alpha);
+    [dartx.clearColor](...args) {
+      return this.clearColor.apply(this, args);
     }
-    [dartx.clearDepth](depth) {
-      return this.clearDepth(depth);
+    [dartx.clearDepth](...args) {
+      return this.clearDepth.apply(this, args);
     }
-    [dartx.clearStencil](s) {
-      return this.clearStencil(s);
+    [dartx.clearStencil](...args) {
+      return this.clearStencil.apply(this, args);
     }
-    [dartx.colorMask](red, green, blue, alpha) {
-      return this.colorMask(red, green, blue, alpha);
+    [dartx.colorMask](...args) {
+      return this.colorMask.apply(this, args);
     }
-    [dartx.compileShader](shader) {
-      return this.compileShader(shader);
+    [dartx.compileShader](...args) {
+      return this.compileShader.apply(this, args);
     }
-    [dartx.compressedTexImage2D](target, level, internalformat, width, height, border, data) {
-      return this.compressedTexImage2D(target, level, internalformat, width, height, border, data);
+    [dartx.compressedTexImage2D](...args) {
+      return this.compressedTexImage2D.apply(this, args);
     }
-    [dartx.compressedTexSubImage2D](target, level, xoffset, yoffset, width, height, format, data) {
-      return this.compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, data);
+    [dartx.compressedTexSubImage2D](...args) {
+      return this.compressedTexSubImage2D.apply(this, args);
     }
-    [dartx.copyTexImage2D](target, level, internalformat, x, y, width, height, border) {
-      return this.copyTexImage2D(target, level, internalformat, x, y, width, height, border);
+    [dartx.copyTexImage2D](...args) {
+      return this.copyTexImage2D.apply(this, args);
     }
-    [dartx.copyTexSubImage2D](target, level, xoffset, yoffset, x, y, width, height) {
-      return this.copyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
+    [dartx.copyTexSubImage2D](...args) {
+      return this.copyTexSubImage2D.apply(this, args);
     }
-    [dartx.createBuffer]() {
-      return this.createBuffer();
+    [dartx.createBuffer](...args) {
+      return this.createBuffer.apply(this, args);
     }
-    [dartx.createFramebuffer]() {
-      return this.createFramebuffer();
+    [dartx.createFramebuffer](...args) {
+      return this.createFramebuffer.apply(this, args);
     }
-    [dartx.createProgram]() {
-      return this.createProgram();
+    [dartx.createProgram](...args) {
+      return this.createProgram.apply(this, args);
     }
-    [dartx.createRenderbuffer]() {
-      return this.createRenderbuffer();
+    [dartx.createRenderbuffer](...args) {
+      return this.createRenderbuffer.apply(this, args);
     }
-    [dartx.createShader](type) {
-      return this.createShader(type);
+    [dartx.createShader](...args) {
+      return this.createShader.apply(this, args);
     }
-    [dartx.createTexture]() {
-      return this.createTexture();
+    [dartx.createTexture](...args) {
+      return this.createTexture.apply(this, args);
     }
-    [dartx.cullFace](mode) {
-      return this.cullFace(mode);
+    [dartx.cullFace](...args) {
+      return this.cullFace.apply(this, args);
     }
-    [dartx.deleteBuffer](buffer) {
-      return this.deleteBuffer(buffer);
+    [dartx.deleteBuffer](...args) {
+      return this.deleteBuffer.apply(this, args);
     }
-    [dartx.deleteFramebuffer](framebuffer) {
-      return this.deleteFramebuffer(framebuffer);
+    [dartx.deleteFramebuffer](...args) {
+      return this.deleteFramebuffer.apply(this, args);
     }
-    [dartx.deleteProgram](program) {
-      return this.deleteProgram(program);
+    [dartx.deleteProgram](...args) {
+      return this.deleteProgram.apply(this, args);
     }
-    [dartx.deleteRenderbuffer](renderbuffer) {
-      return this.deleteRenderbuffer(renderbuffer);
+    [dartx.deleteRenderbuffer](...args) {
+      return this.deleteRenderbuffer.apply(this, args);
     }
-    [dartx.deleteShader](shader) {
-      return this.deleteShader(shader);
+    [dartx.deleteShader](...args) {
+      return this.deleteShader.apply(this, args);
     }
-    [dartx.deleteTexture](texture) {
-      return this.deleteTexture(texture);
+    [dartx.deleteTexture](...args) {
+      return this.deleteTexture.apply(this, args);
     }
-    [dartx.depthFunc](func) {
-      return this.depthFunc(func);
+    [dartx.depthFunc](...args) {
+      return this.depthFunc.apply(this, args);
     }
-    [dartx.depthMask](flag) {
-      return this.depthMask(flag);
+    [dartx.depthMask](...args) {
+      return this.depthMask.apply(this, args);
     }
-    [dartx.depthRange](zNear, zFar) {
-      return this.depthRange(zNear, zFar);
+    [dartx.depthRange](...args) {
+      return this.depthRange.apply(this, args);
     }
-    [dartx.detachShader](program, shader) {
-      return this.detachShader(program, shader);
+    [dartx.detachShader](...args) {
+      return this.detachShader.apply(this, args);
     }
-    [dartx.disable](cap) {
-      return this.disable(cap);
+    [dartx.disable](...args) {
+      return this.disable.apply(this, args);
     }
-    [dartx.disableVertexAttribArray](index) {
-      return this.disableVertexAttribArray(index);
+    [dartx.disableVertexAttribArray](...args) {
+      return this.disableVertexAttribArray.apply(this, args);
     }
-    [dartx.drawArrays](mode, first, count) {
-      return this.drawArrays(mode, first, count);
+    [dartx.drawArrays](...args) {
+      return this.drawArrays.apply(this, args);
     }
-    [dartx.drawElements](mode, count, type, offset) {
-      return this.drawElements(mode, count, type, offset);
+    [dartx.drawElements](...args) {
+      return this.drawElements.apply(this, args);
     }
-    [dartx.enable](cap) {
-      return this.enable(cap);
+    [dartx.enable](...args) {
+      return this.enable.apply(this, args);
     }
-    [dartx.enableVertexAttribArray](index) {
-      return this.enableVertexAttribArray(index);
+    [dartx.enableVertexAttribArray](...args) {
+      return this.enableVertexAttribArray.apply(this, args);
     }
-    [dartx.finish]() {
-      return this.finish();
+    [dartx.finish](...args) {
+      return this.finish.apply(this, args);
     }
-    [dartx.flush]() {
-      return this.flush();
+    [dartx.flush](...args) {
+      return this.flush.apply(this, args);
     }
-    [dartx.framebufferRenderbuffer](target, attachment, renderbuffertarget, renderbuffer) {
-      return this.framebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
+    [dartx.framebufferRenderbuffer](...args) {
+      return this.framebufferRenderbuffer.apply(this, args);
     }
-    [dartx.framebufferTexture2D](target, attachment, textarget, texture, level) {
-      return this.framebufferTexture2D(target, attachment, textarget, texture, level);
+    [dartx.framebufferTexture2D](...args) {
+      return this.framebufferTexture2D.apply(this, args);
     }
-    [dartx.frontFace](mode) {
-      return this.frontFace(mode);
+    [dartx.frontFace](...args) {
+      return this.frontFace.apply(this, args);
     }
-    [dartx.generateMipmap](target) {
-      return this.generateMipmap(target);
+    [dartx.generateMipmap](...args) {
+      return this.generateMipmap.apply(this, args);
     }
-    [dartx.getActiveAttrib](program, index) {
-      return this.getActiveAttrib(program, index);
+    [dartx.getActiveAttrib](...args) {
+      return this.getActiveAttrib.apply(this, args);
     }
-    [dartx.getActiveUniform](program, index) {
-      return this.getActiveUniform(program, index);
+    [dartx.getActiveUniform](...args) {
+      return this.getActiveUniform.apply(this, args);
     }
-    [dartx.getAttachedShaders](program) {
-      return this.getAttachedShaders(program);
+    [dartx.getAttachedShaders](...args) {
+      return this.getAttachedShaders.apply(this, args);
     }
-    [dartx.getAttribLocation](program, name) {
-      return this.getAttribLocation(program, name);
+    [dartx.getAttribLocation](...args) {
+      return this.getAttribLocation.apply(this, args);
     }
-    [dartx.getBufferParameter](target, pname) {
-      return this.getBufferParameter(target, pname);
+    [dartx.getBufferParameter](...args) {
+      return this.getBufferParameter.apply(this, args);
     }
     [dartx.getContextAttributes]() {
       return web_gl.ContextAttributes._check(html_common.convertNativeToDart_ContextAttributes(this[_getContextAttributes_1$]()));
     }
-    [_getContextAttributes_1$]() {
-      return this.getContextAttributes();
+    [_getContextAttributes_1$](...args) {
+      return this.getContextAttributes.apply(this, args);
     }
-    [dartx.getError]() {
-      return this.getError();
+    [dartx.getError](...args) {
+      return this.getError.apply(this, args);
     }
-    [dartx.getExtension](name) {
-      return this.getExtension(name);
+    [dartx.getExtension](...args) {
+      return this.getExtension.apply(this, args);
     }
-    [dartx.getFramebufferAttachmentParameter](target, attachment, pname) {
-      return this.getFramebufferAttachmentParameter(target, attachment, pname);
+    [dartx.getFramebufferAttachmentParameter](...args) {
+      return this.getFramebufferAttachmentParameter.apply(this, args);
     }
-    [dartx.getParameter](pname) {
-      return this.getParameter(pname);
+    [dartx.getParameter](...args) {
+      return this.getParameter.apply(this, args);
     }
-    [dartx.getProgramInfoLog](program) {
-      return this.getProgramInfoLog(program);
+    [dartx.getProgramInfoLog](...args) {
+      return this.getProgramInfoLog.apply(this, args);
     }
-    [dartx.getProgramParameter](program, pname) {
-      return this.getProgramParameter(program, pname);
+    [dartx.getProgramParameter](...args) {
+      return this.getProgramParameter.apply(this, args);
     }
-    [dartx.getRenderbufferParameter](target, pname) {
-      return this.getRenderbufferParameter(target, pname);
+    [dartx.getRenderbufferParameter](...args) {
+      return this.getRenderbufferParameter.apply(this, args);
     }
-    [dartx.getShaderInfoLog](shader) {
-      return this.getShaderInfoLog(shader);
+    [dartx.getShaderInfoLog](...args) {
+      return this.getShaderInfoLog.apply(this, args);
     }
-    [dartx.getShaderParameter](shader, pname) {
-      return this.getShaderParameter(shader, pname);
+    [dartx.getShaderParameter](...args) {
+      return this.getShaderParameter.apply(this, args);
     }
-    [dartx.getShaderPrecisionFormat](shadertype, precisiontype) {
-      return this.getShaderPrecisionFormat(shadertype, precisiontype);
+    [dartx.getShaderPrecisionFormat](...args) {
+      return this.getShaderPrecisionFormat.apply(this, args);
     }
-    [dartx.getShaderSource](shader) {
-      return this.getShaderSource(shader);
+    [dartx.getShaderSource](...args) {
+      return this.getShaderSource.apply(this, args);
     }
-    [dartx.getSupportedExtensions]() {
-      return this.getSupportedExtensions();
+    [dartx.getSupportedExtensions](...args) {
+      return this.getSupportedExtensions.apply(this, args);
     }
-    [dartx.getTexParameter](target, pname) {
-      return this.getTexParameter(target, pname);
+    [dartx.getTexParameter](...args) {
+      return this.getTexParameter.apply(this, args);
     }
-    [dartx.getUniform](program, location) {
-      return this.getUniform(program, location);
+    [dartx.getUniform](...args) {
+      return this.getUniform.apply(this, args);
     }
-    [dartx.getUniformLocation](program, name) {
-      return this.getUniformLocation(program, name);
+    [dartx.getUniformLocation](...args) {
+      return this.getUniformLocation.apply(this, args);
     }
-    [dartx.getVertexAttrib](index, pname) {
-      return this.getVertexAttrib(index, pname);
+    [dartx.getVertexAttrib](...args) {
+      return this.getVertexAttrib.apply(this, args);
     }
-    [dartx.getVertexAttribOffset](index, pname) {
-      return this.getVertexAttribOffset(index, pname);
+    [dartx.getVertexAttribOffset](...args) {
+      return this.getVertexAttribOffset.apply(this, args);
     }
-    [dartx.hint](target, mode) {
-      return this.hint(target, mode);
+    [dartx.hint](...args) {
+      return this.hint.apply(this, args);
     }
-    [dartx.isBuffer](buffer) {
-      return this.isBuffer(buffer);
+    [dartx.isBuffer](...args) {
+      return this.isBuffer.apply(this, args);
     }
-    [dartx.isContextLost]() {
-      return this.isContextLost();
+    [dartx.isContextLost](...args) {
+      return this.isContextLost.apply(this, args);
     }
-    [dartx.isEnabled](cap) {
-      return this.isEnabled(cap);
+    [dartx.isEnabled](...args) {
+      return this.isEnabled.apply(this, args);
     }
-    [dartx.isFramebuffer](framebuffer) {
-      return this.isFramebuffer(framebuffer);
+    [dartx.isFramebuffer](...args) {
+      return this.isFramebuffer.apply(this, args);
     }
-    [dartx.isProgram](program) {
-      return this.isProgram(program);
+    [dartx.isProgram](...args) {
+      return this.isProgram.apply(this, args);
     }
-    [dartx.isRenderbuffer](renderbuffer) {
-      return this.isRenderbuffer(renderbuffer);
+    [dartx.isRenderbuffer](...args) {
+      return this.isRenderbuffer.apply(this, args);
     }
-    [dartx.isShader](shader) {
-      return this.isShader(shader);
+    [dartx.isShader](...args) {
+      return this.isShader.apply(this, args);
     }
-    [dartx.isTexture](texture) {
-      return this.isTexture(texture);
+    [dartx.isTexture](...args) {
+      return this.isTexture.apply(this, args);
     }
-    [dartx.lineWidth](width) {
-      return this.lineWidth(width);
+    [dartx.lineWidth](...args) {
+      return this.lineWidth.apply(this, args);
     }
-    [dartx.linkProgram](program) {
-      return this.linkProgram(program);
+    [dartx.linkProgram](...args) {
+      return this.linkProgram.apply(this, args);
     }
-    [dartx.pixelStorei](pname, param) {
-      return this.pixelStorei(pname, param);
+    [dartx.pixelStorei](...args) {
+      return this.pixelStorei.apply(this, args);
     }
-    [dartx.polygonOffset](factor, units) {
-      return this.polygonOffset(factor, units);
+    [dartx.polygonOffset](...args) {
+      return this.polygonOffset.apply(this, args);
     }
-    [dartx.readPixels](x, y, width, height, format, type, pixels) {
-      return this.readPixels(x, y, width, height, format, type, pixels);
+    [dartx.readPixels](...args) {
+      return this.readPixels.apply(this, args);
     }
-    [dartx.renderbufferStorage](target, internalformat, width, height) {
-      return this.renderbufferStorage(target, internalformat, width, height);
+    [dartx.renderbufferStorage](...args) {
+      return this.renderbufferStorage.apply(this, args);
     }
-    [dartx.sampleCoverage](value, invert) {
-      return this.sampleCoverage(value, invert);
+    [dartx.sampleCoverage](...args) {
+      return this.sampleCoverage.apply(this, args);
     }
-    [dartx.scissor](x, y, width, height) {
-      return this.scissor(x, y, width, height);
+    [dartx.scissor](...args) {
+      return this.scissor.apply(this, args);
     }
-    [dartx.shaderSource](shader, string) {
-      return this.shaderSource(shader, string);
+    [dartx.shaderSource](...args) {
+      return this.shaderSource.apply(this, args);
     }
-    [dartx.stencilFunc](func, ref, mask) {
-      return this.stencilFunc(func, ref, mask);
+    [dartx.stencilFunc](...args) {
+      return this.stencilFunc.apply(this, args);
     }
-    [dartx.stencilFuncSeparate](face, func, ref, mask) {
-      return this.stencilFuncSeparate(face, func, ref, mask);
+    [dartx.stencilFuncSeparate](...args) {
+      return this.stencilFuncSeparate.apply(this, args);
     }
-    [dartx.stencilMask](mask) {
-      return this.stencilMask(mask);
+    [dartx.stencilMask](...args) {
+      return this.stencilMask.apply(this, args);
     }
-    [dartx.stencilMaskSeparate](face, mask) {
-      return this.stencilMaskSeparate(face, mask);
+    [dartx.stencilMaskSeparate](...args) {
+      return this.stencilMaskSeparate.apply(this, args);
     }
-    [dartx.stencilOp](fail, zfail, zpass) {
-      return this.stencilOp(fail, zfail, zpass);
+    [dartx.stencilOp](...args) {
+      return this.stencilOp.apply(this, args);
     }
-    [dartx.stencilOpSeparate](face, fail, zfail, zpass) {
-      return this.stencilOpSeparate(face, fail, zfail, zpass);
+    [dartx.stencilOpSeparate](...args) {
+      return this.stencilOpSeparate.apply(this, args);
     }
     [dartx.texImage2D](target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video, format, type, pixels) {
       if (format === void 0) format = null;
@@ -91700,43 +93590,43 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_texImage2D_1](target, level, internalformat, width, height, border, format, type, pixels) {
-      return this.texImage2D(target, level, internalformat, width, height, border, format, type, pixels);
+    [_texImage2D_1](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [_texImage2D_2](target, level, internalformat, format, type, pixels) {
-      return this.texImage2D(target, level, internalformat, format, type, pixels);
+    [_texImage2D_2](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [_texImage2D_3](target, level, internalformat, format, type, image) {
-      return this.texImage2D(target, level, internalformat, format, type, image);
+    [_texImage2D_3](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [_texImage2D_4](target, level, internalformat, format, type, canvas) {
-      return this.texImage2D(target, level, internalformat, format, type, canvas);
+    [_texImage2D_4](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [_texImage2D_5](target, level, internalformat, format, type, video) {
-      return this.texImage2D(target, level, internalformat, format, type, video);
+    [_texImage2D_5](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [dartx.texImage2DCanvas](target, level, internalformat, format, type, canvas) {
-      return this.texImage2D(target, level, internalformat, format, type, canvas);
+    [dartx.texImage2DCanvas](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [dartx.texImage2DImage](target, level, internalformat, format, type, image) {
-      return this.texImage2D(target, level, internalformat, format, type, image);
+    [dartx.texImage2DImage](...args) {
+      return this.texImage2D.apply(this, args);
     }
     [dartx.texImage2DImageData](target, level, internalformat, format, type, pixels) {
       let pixels_1 = html_common.convertDartToNative_ImageData(pixels);
       this[_texImage2DImageData_1](target, level, internalformat, format, type, pixels_1);
       return;
     }
-    [_texImage2DImageData_1](target, level, internalformat, format, type, pixels) {
-      return this.texImage2D(target, level, internalformat, format, type, pixels);
+    [_texImage2DImageData_1](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [dartx.texImage2DVideo](target, level, internalformat, format, type, video) {
-      return this.texImage2D(target, level, internalformat, format, type, video);
+    [dartx.texImage2DVideo](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [dartx.texParameterf](target, pname, param) {
-      return this.texParameterf(target, pname, param);
+    [dartx.texParameterf](...args) {
+      return this.texParameterf.apply(this, args);
     }
-    [dartx.texParameteri](target, pname, param) {
-      return this.texParameteri(target, pname, param);
+    [dartx.texParameteri](...args) {
+      return this.texParameteri.apply(this, args);
     }
     [dartx.texSubImage2D](target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, type, pixels) {
       if (type === void 0) type = null;
@@ -91764,142 +93654,142 @@
       }
       dart.throw(new core.ArgumentError("Incorrect number or type of arguments"));
     }
-    [_texSubImage2D_1](target, level, xoffset, yoffset, width, height, format, type, pixels) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
+    [_texSubImage2D_1](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [_texSubImage2D_2](target, level, xoffset, yoffset, format, type, pixels) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, pixels);
+    [_texSubImage2D_2](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [_texSubImage2D_3](target, level, xoffset, yoffset, format, type, image) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, image);
+    [_texSubImage2D_3](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [_texSubImage2D_4](target, level, xoffset, yoffset, format, type, canvas) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, canvas);
+    [_texSubImage2D_4](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [_texSubImage2D_5](target, level, xoffset, yoffset, format, type, video) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, video);
+    [_texSubImage2D_5](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [dartx.texSubImage2DCanvas](target, level, xoffset, yoffset, format, type, canvas) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, canvas);
+    [dartx.texSubImage2DCanvas](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [dartx.texSubImage2DImage](target, level, xoffset, yoffset, format, type, image) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, image);
+    [dartx.texSubImage2DImage](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
     [dartx.texSubImage2DImageData](target, level, xoffset, yoffset, format, type, pixels) {
       let pixels_1 = html_common.convertDartToNative_ImageData(pixels);
       this[_texSubImage2DImageData_1](target, level, xoffset, yoffset, format, type, pixels_1);
       return;
     }
-    [_texSubImage2DImageData_1](target, level, xoffset, yoffset, format, type, pixels) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, pixels);
+    [_texSubImage2DImageData_1](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [dartx.texSubImage2DVideo](target, level, xoffset, yoffset, format, type, video) {
-      return this.texSubImage2D(target, level, xoffset, yoffset, format, type, video);
+    [dartx.texSubImage2DVideo](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [dartx.uniform1f](location, x) {
-      return this.uniform1f(location, x);
+    [dartx.uniform1f](...args) {
+      return this.uniform1f.apply(this, args);
     }
-    [dartx.uniform1fv](location, v) {
-      return this.uniform1fv(location, v);
+    [dartx.uniform1fv](...args) {
+      return this.uniform1fv.apply(this, args);
     }
-    [dartx.uniform1i](location, x) {
-      return this.uniform1i(location, x);
+    [dartx.uniform1i](...args) {
+      return this.uniform1i.apply(this, args);
     }
-    [dartx.uniform1iv](location, v) {
-      return this.uniform1iv(location, v);
+    [dartx.uniform1iv](...args) {
+      return this.uniform1iv.apply(this, args);
     }
-    [dartx.uniform2f](location, x, y) {
-      return this.uniform2f(location, x, y);
+    [dartx.uniform2f](...args) {
+      return this.uniform2f.apply(this, args);
     }
-    [dartx.uniform2fv](location, v) {
-      return this.uniform2fv(location, v);
+    [dartx.uniform2fv](...args) {
+      return this.uniform2fv.apply(this, args);
     }
-    [dartx.uniform2i](location, x, y) {
-      return this.uniform2i(location, x, y);
+    [dartx.uniform2i](...args) {
+      return this.uniform2i.apply(this, args);
     }
-    [dartx.uniform2iv](location, v) {
-      return this.uniform2iv(location, v);
+    [dartx.uniform2iv](...args) {
+      return this.uniform2iv.apply(this, args);
     }
-    [dartx.uniform3f](location, x, y, z) {
-      return this.uniform3f(location, x, y, z);
+    [dartx.uniform3f](...args) {
+      return this.uniform3f.apply(this, args);
     }
-    [dartx.uniform3fv](location, v) {
-      return this.uniform3fv(location, v);
+    [dartx.uniform3fv](...args) {
+      return this.uniform3fv.apply(this, args);
     }
-    [dartx.uniform3i](location, x, y, z) {
-      return this.uniform3i(location, x, y, z);
+    [dartx.uniform3i](...args) {
+      return this.uniform3i.apply(this, args);
     }
-    [dartx.uniform3iv](location, v) {
-      return this.uniform3iv(location, v);
+    [dartx.uniform3iv](...args) {
+      return this.uniform3iv.apply(this, args);
     }
-    [dartx.uniform4f](location, x, y, z, w) {
-      return this.uniform4f(location, x, y, z, w);
+    [dartx.uniform4f](...args) {
+      return this.uniform4f.apply(this, args);
     }
-    [dartx.uniform4fv](location, v) {
-      return this.uniform4fv(location, v);
+    [dartx.uniform4fv](...args) {
+      return this.uniform4fv.apply(this, args);
     }
-    [dartx.uniform4i](location, x, y, z, w) {
-      return this.uniform4i(location, x, y, z, w);
+    [dartx.uniform4i](...args) {
+      return this.uniform4i.apply(this, args);
     }
-    [dartx.uniform4iv](location, v) {
-      return this.uniform4iv(location, v);
+    [dartx.uniform4iv](...args) {
+      return this.uniform4iv.apply(this, args);
     }
-    [dartx.uniformMatrix2fv](location, transpose, array) {
-      return this.uniformMatrix2fv(location, transpose, array);
+    [dartx.uniformMatrix2fv](...args) {
+      return this.uniformMatrix2fv.apply(this, args);
     }
-    [dartx.uniformMatrix3fv](location, transpose, array) {
-      return this.uniformMatrix3fv(location, transpose, array);
+    [dartx.uniformMatrix3fv](...args) {
+      return this.uniformMatrix3fv.apply(this, args);
     }
-    [dartx.uniformMatrix4fv](location, transpose, array) {
-      return this.uniformMatrix4fv(location, transpose, array);
+    [dartx.uniformMatrix4fv](...args) {
+      return this.uniformMatrix4fv.apply(this, args);
     }
-    [dartx.useProgram](program) {
-      return this.useProgram(program);
+    [dartx.useProgram](...args) {
+      return this.useProgram.apply(this, args);
     }
-    [dartx.validateProgram](program) {
-      return this.validateProgram(program);
+    [dartx.validateProgram](...args) {
+      return this.validateProgram.apply(this, args);
     }
-    [dartx.vertexAttrib1f](indx, x) {
-      return this.vertexAttrib1f(indx, x);
+    [dartx.vertexAttrib1f](...args) {
+      return this.vertexAttrib1f.apply(this, args);
     }
-    [dartx.vertexAttrib1fv](indx, values) {
-      return this.vertexAttrib1fv(indx, values);
+    [dartx.vertexAttrib1fv](...args) {
+      return this.vertexAttrib1fv.apply(this, args);
     }
-    [dartx.vertexAttrib2f](indx, x, y) {
-      return this.vertexAttrib2f(indx, x, y);
+    [dartx.vertexAttrib2f](...args) {
+      return this.vertexAttrib2f.apply(this, args);
     }
-    [dartx.vertexAttrib2fv](indx, values) {
-      return this.vertexAttrib2fv(indx, values);
+    [dartx.vertexAttrib2fv](...args) {
+      return this.vertexAttrib2fv.apply(this, args);
     }
-    [dartx.vertexAttrib3f](indx, x, y, z) {
-      return this.vertexAttrib3f(indx, x, y, z);
+    [dartx.vertexAttrib3f](...args) {
+      return this.vertexAttrib3f.apply(this, args);
     }
-    [dartx.vertexAttrib3fv](indx, values) {
-      return this.vertexAttrib3fv(indx, values);
+    [dartx.vertexAttrib3fv](...args) {
+      return this.vertexAttrib3fv.apply(this, args);
     }
-    [dartx.vertexAttrib4f](indx, x, y, z, w) {
-      return this.vertexAttrib4f(indx, x, y, z, w);
+    [dartx.vertexAttrib4f](...args) {
+      return this.vertexAttrib4f.apply(this, args);
     }
-    [dartx.vertexAttrib4fv](indx, values) {
-      return this.vertexAttrib4fv(indx, values);
+    [dartx.vertexAttrib4fv](...args) {
+      return this.vertexAttrib4fv.apply(this, args);
     }
-    [dartx.vertexAttribPointer](indx, size, type, normalized, stride, offset) {
-      return this.vertexAttribPointer(indx, size, type, normalized, stride, offset);
+    [dartx.vertexAttribPointer](...args) {
+      return this.vertexAttribPointer.apply(this, args);
     }
-    [dartx.viewport](x, y, width, height) {
-      return this.viewport(x, y, width, height);
+    [dartx.viewport](...args) {
+      return this.viewport.apply(this, args);
     }
-    [dartx.texImage2DUntyped](targetTexture, levelOfDetail, internalFormat, format, type, data) {
-      return this.texImage2D(targetTexture, levelOfDetail, internalFormat, format, type, data);
+    [dartx.texImage2DUntyped](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [dartx.texImage2DTyped](targetTexture, levelOfDetail, internalFormat, width, height, border, format, type, data) {
-      return this.texImage2D(targetTexture, levelOfDetail, internalFormat, width, height, border, format, type, data);
+    [dartx.texImage2DTyped](...args) {
+      return this.texImage2D.apply(this, args);
     }
-    [dartx.texSubImage2DUntyped](targetTexture, levelOfDetail, xOffset, yOffset, format, type, data) {
-      return this.texSubImage2D(targetTexture, levelOfDetail, xOffset, yOffset, format, type, data);
+    [dartx.texSubImage2DUntyped](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
-    [dartx.texSubImage2DTyped](targetTexture, levelOfDetail, xOffset, yOffset, width, height, border, format, type, data) {
-      return this.texSubImage2D(targetTexture, levelOfDetail, xOffset, yOffset, width, height, border, format, type, data);
+    [dartx.texSubImage2DTyped](...args) {
+      return this.texSubImage2D.apply(this, args);
     }
   };
   web_gl.RenderingContext[dart.implements] = () => [html$.CanvasRenderingContext];
@@ -93020,14 +94910,14 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.drawArraysInstancedAngle](mode, first, count, primcount) {
-      return this.drawArraysInstancedANGLE(mode, first, count, primcount);
+    [dartx.drawArraysInstancedAngle](...args) {
+      return this.drawArraysInstancedANGLE.apply(this, args);
     }
-    [dartx.drawElementsInstancedAngle](mode, count, type, offset, primcount) {
-      return this.drawElementsInstancedANGLE(mode, count, type, offset, primcount);
+    [dartx.drawElementsInstancedAngle](...args) {
+      return this.drawElementsInstancedANGLE.apply(this, args);
     }
-    [dartx.vertexAttribDivisorAngle](index, divisor) {
-      return this.vertexAttribDivisorANGLE(index, divisor);
+    [dartx.vertexAttribDivisorAngle](...args) {
+      return this.vertexAttribDivisorANGLE.apply(this, args);
     }
   };
   dart.setSignature(web_gl.AngleInstancedArrays, {
@@ -93223,8 +95113,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.getTranslatedShaderSource](shader) {
-      return this.getTranslatedShaderSource(shader);
+    [dartx.getTranslatedShaderSource](...args) {
+      return this.getTranslatedShaderSource.apply(this, args);
     }
   };
   dart.setSignature(web_gl.DebugShaders, {
@@ -93250,8 +95140,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.drawBuffersWebgl](buffers) {
-      return this.drawBuffersWEBGL(buffers);
+    [dartx.drawBuffersWebgl](...args) {
+      return this.drawBuffersWEBGL.apply(this, args);
     }
   };
   dart.setSignature(web_gl.DrawBuffers, {
@@ -93394,11 +95284,11 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.loseContext]() {
-      return this.loseContext();
+    [dartx.loseContext](...args) {
+      return this.loseContext.apply(this, args);
     }
-    [dartx.restoreContext]() {
-      return this.restoreContext();
+    [dartx.restoreContext](...args) {
+      return this.restoreContext.apply(this, args);
     }
   };
   dart.setSignature(web_gl.LoseContext, {
@@ -93409,6 +95299,7 @@
     })
   });
   dart.registerExtension(dart.global.WebGLLoseContext, web_gl.LoseContext);
+  dart.registerExtension(dart.global.WebGLExtensionLoseContext, web_gl.LoseContext);
   web_gl.OesElementIndexUint = class OesElementIndexUint extends _interceptors.Interceptor {
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
@@ -93466,17 +95357,17 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.bindVertexArray](arrayObject) {
-      return this.bindVertexArrayOES(arrayObject);
+    [dartx.bindVertexArray](...args) {
+      return this.bindVertexArrayOES.apply(this, args);
     }
-    [dartx.createVertexArray]() {
-      return this.createVertexArrayOES();
+    [dartx.createVertexArray](...args) {
+      return this.createVertexArrayOES.apply(this, args);
     }
-    [dartx.deleteVertexArray](arrayObject) {
-      return this.deleteVertexArrayOES(arrayObject);
+    [dartx.deleteVertexArray](...args) {
+      return this.deleteVertexArrayOES.apply(this, args);
     }
-    [dartx.isVertexArray](arrayObject) {
-      return this.isVertexArrayOES(arrayObject);
+    [dartx.isVertexArray](...args) {
+      return this.isVertexArrayOES.apply(this, args);
     }
   };
   dart.setSignature(web_gl.OesVertexArrayObject, {
@@ -93601,14 +95492,14 @@
     get [dartx.version]() {
       return this.version;
     }
-    [dartx.changeVersion](oldVersion, newVersion, callback, errorCallback, successCallback) {
-      return this.changeVersion(oldVersion, newVersion, callback, errorCallback, successCallback);
+    [dartx.changeVersion](...args) {
+      return this.changeVersion.apply(this, args);
     }
-    [dartx.readTransaction](callback, errorCallback, successCallback) {
-      return this.readTransaction(callback, errorCallback, successCallback);
+    [dartx.readTransaction](...args) {
+      return this.readTransaction.apply(this, args);
     }
-    [dartx.transaction](callback, errorCallback, successCallback) {
-      return this.transaction(callback, errorCallback, successCallback);
+    [dartx.transaction](...args) {
+      return this.transaction.apply(this, args);
     }
   };
   dart.setSignature(web_sql.SqlDatabase, {
@@ -93694,8 +95585,8 @@
   const _item_1 = Symbol('_item_1');
   dart.defineExtensionNames([
     'length',
-    'get',
-    'set',
+    '_get',
+    '_set',
     'length',
     'first',
     'last',
@@ -93710,11 +95601,11 @@
     get [dartx.length]() {
       return this.length;
     }
-    [dartx.get](index) {
+    [dartx._get](index) {
       if (index >>> 0 !== index || index >= this[dartx.length]) dart.throw(core.RangeError.index(index, this));
       return this[dartx.item](index);
     }
-    [dartx.set](index, value) {
+    [dartx._set](index, value) {
       dart.throw(new core.UnsupportedError("Cannot assign element of immutable List."));
       return value;
     }
@@ -93743,13 +95634,13 @@
       dart.throw(new core.StateError("More than one element"));
     }
     [dartx.elementAt](index) {
-      return this[dartx.get](index);
+      return this[dartx._get](index);
     }
     [dartx.item](index) {
       return html_common.convertNativeToDart_Dictionary(this[_item_1](index));
     }
-    [_item_1](index) {
-      return this.item(index);
+    [_item_1](...args) {
+      return this.item.apply(this, args);
     }
   };
   web_sql.SqlResultSetRowList[dart.implements] = () => [ListOfMap()];
@@ -93763,8 +95654,8 @@
     }),
     setters: () => ({[dartx.length]: dart.definiteFunctionType(dart.void, [core.int])}),
     methods: () => ({
-      [dartx.get]: dart.definiteFunctionType(core.Map, [core.int]),
-      [dartx.set]: dart.definiteFunctionType(dart.void, [core.int, core.Map]),
+      [dartx._get]: dart.definiteFunctionType(core.Map, [core.int]),
+      [dartx._set]: dart.definiteFunctionType(dart.void, [core.int, core.Map]),
       [dartx.elementAt]: dart.definiteFunctionType(core.Map, [core.int]),
       [dartx.item]: dart.definiteFunctionType(core.Map, [core.int]),
       [_item_1]: dart.definiteFunctionType(dart.dynamic, [dart.dynamic])
@@ -93778,8 +95669,8 @@
     static _() {
       dart.throw(new core.UnsupportedError("Not supported"));
     }
-    [dartx.executeSql](sqlStatement, arguments$, callback, errorCallback) {
-      return this.executeSql(sqlStatement, arguments$, callback, errorCallback);
+    [dartx.executeSql](...args) {
+      return this.executeSql.apply(this, args);
     }
   };
   dart.setSignature(web_sql.SqlTransaction, {
@@ -93805,6 +95696,7 @@
   exports.collection = collection;
   exports.convert = convert;
   exports.core = core;
+  exports.developer = developer;
   exports.isolate = isolate;
   exports.js = js;
   exports.js_util = js_util;
diff --git a/pkg/dev_compiler/lib/runtime/dart_sdk.sum b/pkg/dev_compiler/lib/runtime/dart_sdk.sum
deleted file mode 100644
index 394bad4..0000000
--- a/pkg/dev_compiler/lib/runtime/dart_sdk.sum
+++ /dev/null
Binary files differ
diff --git a/pkg/dev_compiler/lib/sdk/ddc_sdk.sum b/pkg/dev_compiler/lib/sdk/ddc_sdk.sum
new file mode 100644
index 0000000..6286c3e
--- /dev/null
+++ b/pkg/dev_compiler/lib/sdk/ddc_sdk.sum
Binary files differ
diff --git a/pkg/dev_compiler/lib/src/analyzer/context.dart b/pkg/dev_compiler/lib/src/analyzer/context.dart
index bc47716..d2bfe96 100644
--- a/pkg/dev_compiler/lib/src/analyzer/context.dart
+++ b/pkg/dev_compiler/lib/src/analyzer/context.dart
@@ -22,8 +22,6 @@
 import 'package:cli_util/cli_util.dart' show getSdkDir;
 import 'package:path/path.dart' as path;
 
-import 'multi_package_resolver.dart' show MultiPackageResolver;
-
 /// Options used to set up Source URI resolution in the analysis context.
 class AnalyzerOptions {
   /// Custom URI mappings, such as "dart:foo" -> "path/to/foo.dart"
@@ -35,9 +33,6 @@
   /// List of summary file paths.
   final List<String> summaryPaths;
 
-  /// List of paths used for the multi-package resolver.
-  final List<String> packagePaths;
-
   /// Path to the dart-sdk. Null if `useMockSdk` is true or if the path couldn't
   /// be determined
   final String dartSdkPath;
@@ -46,42 +41,54 @@
   /// of the unsummarized one.
   final String dartSdkSummaryPath;
 
+  /// Defined variables used by `bool.fromEnvironment` etc.
+  final Map<String, String> declaredVariables;
+
   AnalyzerOptions(
       {this.summaryPaths: const [],
       String dartSdkPath,
       this.dartSdkSummaryPath,
       this.customUrlMappings: const {},
       this.packageRoot: null,
-      this.packagePaths: const []})
+      this.declaredVariables: const {}})
       : dartSdkPath = dartSdkPath ?? getSdkDir().path;
 
-  AnalyzerOptions.fromArguments(ArgResults args)
-      : summaryPaths = args['summary'] as List<String>,
-        dartSdkPath = args['dart-sdk'] ?? getSdkDir().path,
-        dartSdkSummaryPath = args['dart-sdk-summary'],
-        customUrlMappings = _parseUrlMappings(args['url-mapping']),
-        packageRoot = args['package-root'],
-        packagePaths = (args['package-paths'] as String)?.split(',') ?? [];
+  factory AnalyzerOptions.fromArguments(
+      ArgResults args, Map<String, String> declaredVariables) {
+    var sdkPath = args['dart-sdk'] ?? getSdkDir().path;
+    var sdkSummaryPath = args['dart-sdk-summary'];
 
-  /// Whether to resolve 'package:' uris using the multi-package resolver.
-  bool get useMultiPackage => packagePaths.isNotEmpty;
+    if (sdkSummaryPath == null) {
+      sdkSummaryPath = path.join(sdkPath, 'lib', '_internal', 'ddc_sdk.sum');
+    } else if (sdkSummaryPath == 'build') {
+      // For building the SDK, we explicitly set the path to none.
+      sdkSummaryPath = null;
+    }
+
+    return new AnalyzerOptions(
+        summaryPaths: args['summary'] as List<String>,
+        dartSdkPath: sdkPath,
+        dartSdkSummaryPath: sdkSummaryPath,
+        customUrlMappings: _parseUrlMappings(args['url-mapping']),
+        packageRoot: args['package-root'],
+        declaredVariables: declaredVariables);
+  }
 
   static void addArguments(ArgParser parser) {
     parser
       ..addOption('summary',
           abbr: 's', help: 'summary file(s) to include', allowMultiple: true)
-      ..addOption('dart-sdk', help: 'Dart SDK Path', defaultsTo: null)
+      ..addOption('dart-sdk',
+          help: 'Dart SDK Path', defaultsTo: null, hide: true)
       ..addOption('dart-sdk-summary',
-          help: 'Dart SDK Summary Path', defaultsTo: null)
+          help: 'Dart SDK Summary Path', defaultsTo: null, hide: true)
       ..addOption('package-root',
           abbr: 'p', help: 'Package root to resolve "package:" imports')
       ..addOption('url-mapping',
           help: '--url-mapping=libraryUri,/path/to/library.dart uses\n'
               'library.dart as the source for an import of of "libraryUri".',
           allowMultiple: true,
-          splitCommas: false)
-      ..addOption('package-paths',
-          help: 'use a list of directories to resolve "package:" imports');
+          splitCommas: false);
   }
 
   static Map<String, String> _parseUrlMappings(Iterable argument) {
@@ -139,20 +146,17 @@
     {ResourceProvider resourceProvider}) {
   resourceProvider ??= PhysicalResourceProvider.INSTANCE;
   UriResolver packageResolver() {
-    ContextBuilder builder = new ContextBuilder(resourceProvider, null, null);
+    ContextBuilderOptions builderOptions = new ContextBuilderOptions();
     if (options.packageRoot != null) {
-      builder.defaultPackagesDirectoryPath = options.packageRoot;
+      builderOptions.defaultPackagesDirectoryPath = options.packageRoot;
     }
+    ContextBuilder builder = new ContextBuilder(resourceProvider, null, null,
+        options: builderOptions);
     return new PackageMapUriResolver(resourceProvider,
         builder.convertPackagesToMap(builder.createPackageMap('')));
   }
 
-  return [
-    new ResourceUriResolver(resourceProvider),
-    options.useMultiPackage
-        ? new MultiPackageResolver(options.packagePaths)
-        : packageResolver()
-  ];
+  return [new ResourceUriResolver(resourceProvider), packageResolver()];
 }
 
 FolderBasedDartSdk _createFolderBasedDartSdk(String sdkPath) {
@@ -171,3 +175,25 @@
       : _createFolderBasedDartSdk(sdkPath);
   return new DartUriResolver(sdk);
 }
+
+List<String> parseDeclaredVariables(
+    List<String> args, Map<String, String> declaredVars) {
+  var count = args.length;
+  var remainingArgs = <String>[];
+  for (int i = 0; i < count; i++) {
+    var arg = args[i];
+    if (arg == '--') {
+      while (i < count) {
+        remainingArgs.add(args[i++]);
+      }
+    } else if (arg.startsWith("-D")) {
+      // The format for defined variables is:
+      //     -D<name>=<value>
+      var parts = arg.substring(2).split('=');
+      declaredVars[parts[0]] = parts.length > 1 ? parts[1] : '';
+    } else {
+      remainingArgs.add(arg);
+    }
+  }
+  return remainingArgs;
+}
diff --git a/pkg/dev_compiler/lib/src/analyzer/multi_package_resolver.dart b/pkg/dev_compiler/lib/src/analyzer/multi_package_resolver.dart
deleted file mode 100644
index 66905ec..0000000
--- a/pkg/dev_compiler/lib/src/analyzer/multi_package_resolver.dart
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:io';
-
-import 'package:analyzer/src/generated/java_io.dart';
-import 'package:analyzer/src/generated/source.dart';
-import 'package:analyzer/src/generated/source_io.dart';
-import 'package:path/path.dart' show join;
-
-/// A package resolver that supports a non-standard package layout, where
-/// packages with dotted names are expanded to a hierarchy of directories, and
-/// packages can be found on one or more locations.
-class MultiPackageResolver extends UriResolver {
-  final List<String> searchPaths;
-  MultiPackageResolver(this.searchPaths);
-
-  @override
-  Source resolveAbsolute(Uri uri, [Uri actualUri]) {
-    var candidates = _expandPath(uri);
-    if (candidates == null) return null;
-
-    for (var path in candidates) {
-      var resolvedPath = _resolve(path);
-      if (resolvedPath != null) {
-        return new FileBasedSource(
-            new JavaFile(resolvedPath), actualUri != null ? actualUri : uri);
-      }
-    }
-    return null;
-  }
-
-  /// Resolve [path] by looking at each prefix in [searchPaths] and returning
-  /// the first location where `prefix + path` exists.
-  String _resolve(String path) {
-    for (var prefix in searchPaths) {
-      var resolvedPath = join(prefix, path);
-      if (new File(resolvedPath).existsSync()) return resolvedPath;
-    }
-    return null;
-  }
-
-  /// Expand `uri.path`, replacing dots in the package name with slashes.
-  List<String> _expandPath(Uri uri) {
-    if (uri.scheme != 'package') return null;
-    var path = uri.path;
-    var slashPos = path.indexOf('/');
-    var packagePath = path.substring(0, slashPos).replaceAll(".", "/");
-    var filePath = path.substring(slashPos + 1);
-    return ['$packagePath/lib/$filePath', '$packagePath/$filePath'];
-  }
-}
diff --git a/pkg/dev_compiler/lib/src/compiler/code_generator.dart b/pkg/dev_compiler/lib/src/compiler/code_generator.dart
index 1b306a7..1d36734 100644
--- a/pkg/dev_compiler/lib/src/compiler/code_generator.dart
+++ b/pkg/dev_compiler/lib/src/compiler/code_generator.dart
@@ -74,7 +74,7 @@
   final _moduleItems = <JS.ModuleItem>[];
 
   /// Table of named and possibly hoisted types.
-  final _typeTable = new TypeTable();
+  TypeTable _typeTable;
 
   /// The global extension type table.
   final ExtensionTypeSet _extensionTypes;
@@ -97,8 +97,8 @@
   final _initializingFormalTemps =
       new HashMap<ParameterElement, JS.TemporaryId>();
 
-  final _dartxVar = new JS.Identifier('dartx');
-  final _runtimeLibVar = new JS.Identifier('dart');
+  JS.Identifier _extensionSymbolsModule;
+  JS.Identifier _runtimeModule;
   final namedArgumentTemp = new JS.TemporaryId('opts');
 
   final _hasDeferredSupertype = new HashSet<ClassElement>();
@@ -124,8 +124,9 @@
   final ClassElement numClass;
   final ClassElement objectClass;
   final ClassElement stringClass;
+  final ClassElement symbolClass;
 
-  ConstFieldVisitor _constField;
+  ConstFieldVisitor _constants;
 
   /// The current function body being compiled.
   FunctionBody _currentFunction;
@@ -164,6 +165,7 @@
         nullClass = _getLibrary(c, 'dart:core').getType('Null'),
         objectClass = _getLibrary(c, 'dart:core').getType('Object'),
         stringClass = _getLibrary(c, 'dart:core').getType('String'),
+        symbolClass = _getLibrary(c, 'dart:_internal').getType('Symbol'),
         dartJSLibrary = _getLibrary(c, 'dart:js');
 
   LibraryElement get currentLibrary => _loader.currentElement.library;
@@ -217,7 +219,10 @@
             true)
         .forEach(assembler.addLinkedLibrary);
 
-    return assembler.assemble().toBuffer();
+    var bundle = assembler.assemble();
+    // Preserve only API-level information in the summary.
+    bundle.flushInformative();
+    return bundle.toBuffer();
   }
 
   JS.Program _emitModule(List<CompilationUnit> compilationUnits) {
@@ -228,6 +233,18 @@
     // Transform the AST to make coercions explicit.
     compilationUnits = CoercionReifier.reify(compilationUnits);
 
+    if (compilationUnits.any((u) => _isDartRuntime(u.element.library))) {
+      // Don't allow these to be renamed when we're building the SDK.
+      // There is JS code in dart:* that depends on their names.
+      _runtimeModule = new JS.Identifier('dart');
+      _extensionSymbolsModule = new JS.Identifier('dartx');
+    } else {
+      // Otherwise allow these to be renamed so users can write them.
+      _runtimeModule = new JS.TemporaryId('dart');
+      _extensionSymbolsModule = new JS.TemporaryId('dartx');
+    }
+    _typeTable = new TypeTable(_runtimeModule);
+
     // Initialize our library variables.
     var items = <JS.ModuleItem>[];
     for (var unit in compilationUnits) {
@@ -235,7 +252,7 @@
       if (unit.element != library.definingCompilationUnit) continue;
 
       var libraryTemp = _isDartRuntime(library)
-          ? _runtimeLibVar
+          ? _runtimeModule
           : new JS.TemporaryId(jsLibraryName(_libraryRoot, library));
       _libraries[library] = libraryTemp;
       items.add(new JS.ExportDeclaration(
@@ -244,8 +261,8 @@
       // dart:_runtime has a magic module that holds extension method symbols.
       // TODO(jmesserly): find a cleaner design for this.
       if (_isDartRuntime(library)) {
-        items.add(new JS.ExportDeclaration(
-            js.call('const # = Object.create(null)', [_dartxVar])));
+        items.add(new JS.ExportDeclaration(js
+            .call('const # = Object.create(null)', [_extensionSymbolsModule])));
       }
     }
 
@@ -261,7 +278,7 @@
     }
     _loader = new ElementLoader(nodes);
     if (compilationUnits.isNotEmpty) {
-      _constField = new ConstFieldVisitor(types,
+      _constants = new ConstFieldVisitor(context,
           dummySource: compilationUnits.first.element.source);
     }
 
@@ -293,7 +310,8 @@
   }
 
   List<String> _getJSName(Element e) {
-    if (findAnnotation(e.library, isPublicJSAnnotation) == null) {
+    if (e.library == null ||
+        findAnnotation(e.library, isPublicJSAnnotation) == null) {
       return null;
     }
 
@@ -307,11 +325,9 @@
     if (findAnnotation(e, isPublicJSAnnotation) != null) {
       elementJSName = getAnnotationName(e, isPublicJSAnnotation) ?? '';
     }
-    if (e is TopLevelVariableElement &&
-        e.getter != null &&
-        (e.getter.isExternal ||
-            findAnnotation(e.getter, isPublicJSAnnotation) != null)) {
-      elementJSName = getAnnotationName(e.getter, isPublicJSAnnotation) ?? '';
+
+    if (e is TopLevelVariableElement) {
+      elementJSName = _jsInteropStaticMemberName(e);
     }
     if (elementJSName == null) return null;
 
@@ -329,13 +345,45 @@
     var jsName = _getJSName(e);
     if (jsName == null) return null;
     var fullName = ['global']..addAll(jsName);
-    JS.Expression access = _runtimeLibVar;
+    JS.Expression access = _runtimeModule;
     for (var part in fullName) {
       access = new JS.PropertyAccess(access, js.string(part));
     }
     return access;
   }
 
+  String _jsInteropStaticMemberName(Element e, {String name}) {
+    if (e == null ||
+        e.library == null ||
+        findAnnotation(e.library, isPublicJSAnnotation) == null) {
+      return null;
+    }
+    if (e is PropertyInducingElement) {
+      // Assume properties have consistent JS names for getters and setters.
+      return _jsInteropStaticMemberName(e.getter, name: e.name) ??
+          _jsInteropStaticMemberName(e.setter, name: e.name);
+    }
+    if (e is ExecutableElement &&
+        e.isExternal &&
+        findAnnotation(e, isPublicJSAnnotation) != null) {
+      return getAnnotationName(e, isPublicJSAnnotation) ?? name ?? e.name;
+    }
+    return null;
+  }
+
+  JS.Expression _emitJSInteropStaticMemberName(Element e) {
+    var name = _jsInteropStaticMemberName(e);
+    if (name == null) return null;
+    // We do not support statics names with JS annotations containing dots.
+    // See https://github.com/dart-lang/sdk/issues/27926
+    if (name.contains('.')) {
+      throw new UnimplementedError(
+          'We do not support JS annotations containing dots on static members. '
+          'See https://github.com/dart-lang/sdk/issues/27926');
+    }
+    return js.string(name);
+  }
+
   /// Flattens blocks in [items] to a single list.
   ///
   /// This will not flatten blocks that are marked as being scopes.
@@ -388,8 +436,8 @@
       var imports =
           libraries.map((l) => new JS.NameSpecifier(_imports[l])).toList();
       if (module == coreModuleName) {
-        imports.add(new JS.NameSpecifier(_runtimeLibVar));
-        imports.add(new JS.NameSpecifier(_dartxVar));
+        imports.add(new JS.NameSpecifier(_runtimeModule));
+        imports.add(new JS.NameSpecifier(_extensionSymbolsModule));
       }
       items.add(new JS.ImportDeclaration(
           namedImports: imports, from: js.string(module, "'")));
@@ -502,35 +550,32 @@
         // modules we import, so we will never go down this code path for them.
         _moduleItems
             .add(js.statement('#.# = #;', [libraryName, name.selector, name]));
-      } else {
-        // top-level fields, getters, setters need to copy the property
-        // descriptor.
-        _moduleItems.add(js.statement('dart.export(#, #, #);',
-            [libraryName, name.receiver, name.selector]));
       }
     }
 
-    for (var export in exportedNames.definedNames.values) {
-      if (export is PropertyAccessorElement) {
-        export = (export as PropertyAccessorElement).variable;
-      }
+    // We only need to export main as it is the only method party of the
+    // publicly exposed JS API for a library.
+    // TODO(jacobr): add a library level annotation indicating that all
+    // contents of a library need to be exposed to JS.
+    // https://github.com/dart-lang/sdk/issues/26368
 
-      // Don't allow redefining names from this library.
-      if (currentNames.containsKey(export.name)) continue;
+    var export = exportedNames.get('main');
 
-      if (export.isSynthetic && export is PropertyInducingElement) {
-        _emitDeclaration(export.getter);
-        _emitDeclaration(export.setter);
-      } else {
-        _emitDeclaration(export);
-      }
-      if (export is ClassElement && export.typeParameters.isNotEmpty) {
-        // Export the generic name as well.
-        // TODO(jmesserly): revisit generic classes
-        emitExport(export, suffix: r'$');
-      }
-      emitExport(export);
+    if (export == null) return;
+    if (export is PropertyAccessorElement) {
+      export = (export as PropertyAccessorElement).variable;
     }
+
+    // Don't allow redefining names from this library.
+    if (currentNames.containsKey(export.name)) return;
+
+    if (export.isSynthetic && export is PropertyInducingElement) {
+      _emitDeclaration(export.getter);
+      _emitDeclaration(export.setter);
+    } else {
+      _emitDeclaration(export);
+    }
+    emitExport(export);
   }
 
   @override
@@ -550,7 +595,7 @@
       // Make sure to check when converting to int.
       if (from != types.intType && to == types.intType) {
         // TODO(jmesserly): fuse this with notNull check.
-        return js.call('dart.asInt(#)', jsFrom);
+        return _callHelper('asInt(#)', jsFrom);
       }
 
       // A no-op in JavaScript.
@@ -604,7 +649,7 @@
     FunctionTypeAliasElement element = node.element;
 
     JS.Expression body = annotate(
-        js.call('dart.typedef(#, () => #)', [
+        _callHelper('typedef(#, () => #)', [
           js.string(element.name, "'"),
           _emitType(element.type, nameType: false, lowerTypedef: true)
         ]),
@@ -625,8 +670,8 @@
     if (node.type == null) {
       // TODO(jmesserly): if the type fails to resolve, should we generate code
       // that throws instead?
-      assert(options.unsafeForceCompile);
-      return js.call('dart.dynamic');
+      assert(options.unsafeForceCompile || options.replCompile);
+      return _callHelper('dynamic');
     }
     return _emitType(node.type);
   }
@@ -738,15 +783,15 @@
     var virtualFields = <FieldElement, JS.TemporaryId>{};
     var virtualFieldSymbols = <JS.Statement>[];
     var staticFieldOverrides = new HashSet<FieldElement>();
+    var extensions = _extensionsToImplement(classElem);
     _registerPropertyOverrides(classElem, className, superclasses, allFields,
-        virtualFields, virtualFieldSymbols, staticFieldOverrides);
+        virtualFields, virtualFieldSymbols, staticFieldOverrides, extensions);
 
     var classExpr = _emitClassExpression(classElem,
         _emitClassMethods(node, ctors, fields, superclasses, virtualFields),
         fields: allFields);
 
     var body = <JS.Statement>[];
-    var extensions = _extensionsToImplement(classElem);
     _initExtensionSymbols(classElem, methods, fields, body);
     _emitSuperHelperSymbols(_superHelperSymbols, body);
 
@@ -754,27 +799,32 @@
     _defineClass(classElem, className, classExpr, isCallable, body);
 
     // Emit things that come after the ES6 `class ... { ... }`.
-    var jsPeerName = _getJSPeerName(classElem);
-    _setBaseClass(classElem, className, jsPeerName, body);
+    var jsPeerNames = _getJSPeerNames(classElem);
+    JS.Statement deferredBaseClass =
+        _setBaseClass(classElem, className, jsPeerNames, body);
 
     _emitClassTypeTests(classElem, className, body);
 
     _defineNamedConstructors(ctors, body, className, isCallable);
-    _emitVirtualFieldSymbols(virtualFieldSymbols, body);
+    body.addAll(virtualFieldSymbols);
     _emitClassSignature(
         methods, allFields, classElem, ctors, extensions, className, body);
     _defineExtensionMembers(extensions, className, body);
     _emitClassMetadata(node.metadata, className, body);
 
     JS.Statement classDef = _statement(body);
+
     var typeFormals = classElem.typeParameters;
     if (typeFormals.isNotEmpty) {
-      classDef = _defineClassTypeArguments(classElem, typeFormals, classDef);
+      classDef = _defineClassTypeArguments(
+          classElem, typeFormals, classDef, className, deferredBaseClass);
     }
 
     body = <JS.Statement>[classDef];
     _emitStaticFields(staticFields, staticFieldOverrides, classElem, body);
-    _registerExtensionType(classElem, jsPeerName, body);
+    for (var peer in jsPeerNames) {
+      _registerExtensionType(classElem, peer, body);
+    }
     return _statement(body);
   }
 
@@ -789,7 +839,7 @@
         classExpr.name, _emitCallableClassConstructor(unnamedCtor));
 
     // Name the constructor function the same as the class.
-    return js.call('dart.callableClass(#, #)', [ctor, classExpr]);
+    return _callHelper('callableClass(#, #)', [ctor, classExpr]);
   }
 
   /// Emits a constructor that ensures instances of this class are callable as
@@ -820,21 +870,21 @@
       body.add(js.statement(
           '#.is = function is_Object(o) {'
           '  if (o instanceof this) return true;'
-          '  return dart.is(o, this);'
+          '  return #.is(o, this);'
           '}',
-          className));
+          [className, _runtimeModule]));
       body.add(js.statement(
           '#.as = function as_Object(o) {'
           '  if (o == null || o instanceof this) return o;'
-          '  return dart.as(o, this);'
+          '  return #.as(o, this);'
           '}',
-          className));
+          [className, _runtimeModule]));
       body.add(js.statement(
           '#._check = function check_Object(o) {'
           '  if (o == null || o instanceof this) return o;'
-          '  return dart.check(o, this);'
+          '  return #.check(o, this);'
           '}',
-          className));
+          [className, _runtimeModule]));
       return;
     }
     if (classElem == stringClass) {
@@ -844,15 +894,15 @@
       body.add(js.statement(
           '#.as = function as_String(o) {'
           '  if (typeof o == "string" || o == null) return o;'
-          '  return dart.as(o, #);'
+          '  return #.as(o, #);'
           '}',
-          [className, className]));
+          [className, _runtimeModule, className]));
       body.add(js.statement(
           '#._check = function check_String(o) {'
           '  if (typeof o == "string" || o == null) return o;'
-          '  return dart.check(o, #);'
+          '  return #.check(o, #);'
           '}',
-          [className, className]));
+          [className, _runtimeModule, className]));
       return;
     }
     if (classElem == intClass) {
@@ -865,16 +915,16 @@
           '#.as = function as_int(o) {'
           '  if ((typeof o == "number" && Math.floor(o) == o) || o == null)'
           '    return o;'
-          '  return dart.as(o, #);'
+          '  return #.as(o, #);'
           '}',
-          [className, className]));
+          [className, _runtimeModule, className]));
       body.add(js.statement(
           '#._check = function check_int(o) {'
           '  if ((typeof o == "number" && Math.floor(o) == o) || o == null)'
           '    return o;'
-          '  return dart.check(o, #);'
+          '  return #.check(o, #);'
           '}',
-          [className, className]));
+          [className, _runtimeModule, className]));
       return;
     }
     if (classElem == nullClass) {
@@ -883,15 +933,15 @@
       body.add(js.statement(
           '#.as = function as_Null(o) {'
           '  if (o == null) return o;'
-          '  return dart.as(o, #);'
+          '  return #.as(o, #);'
           '}',
-          [className, className]));
+          [className, _runtimeModule, className]));
       body.add(js.statement(
           '#._check = function check_Null(o) {'
           '  if (o == null) return o;'
-          '  return dart.check(o, #);'
+          '  return #.check(o, #);'
           '}',
-          [className, className]));
+          [className, _runtimeModule, className]));
       return;
     }
     if (classElem == numClass) {
@@ -901,15 +951,15 @@
       body.add(js.statement(
           '#.as = function as_num(o) {'
           '  if (typeof o == "number" || o == null) return o;'
-          '  return dart.as(o, #);'
+          '  return #.as(o, #);'
           '}',
-          [className, className]));
+          [className, _runtimeModule, className]));
       body.add(js.statement(
           '#._check = function check_num(o) {'
           '  if (typeof o == "number" || o == null) return o;'
-          '  return dart.check(o, #);'
+          '  return #.check(o, #);'
           '}',
-          [className, className]));
+          [className, _runtimeModule, className]));
       return;
     }
     if (classElem == boolClass) {
@@ -919,15 +969,15 @@
       body.add(js.statement(
           '#.as = function as_bool(o) {'
           '  if (o === true || o === false || o == null) return o;'
-          '  return dart.as(o, #);'
+          '  return #.as(o, #);'
           '}',
-          [className, className]));
+          [className, _runtimeModule, className]));
       body.add(js.statement(
           '#._check = function check_bool(o) {'
           '  if (o === true || o === false || o == null) return o;'
-          '  return dart.check(o, #);'
+          '  return #.check(o, #);'
           '}',
-          [className, className]));
+          [className, _runtimeModule, className]));
       return;
     }
     // TODO(sra): Add special cases for hot tests like `x is html.Element`.
@@ -940,7 +990,7 @@
           // Place non-instanceof version of checks on Interceptor. All
           // interceptor classes will inherit the methods via ES6 class static
           // inheritance.
-          body.add(js.statement('dart.addTypeTests(#);', className));
+          body.add(_callHelperStatement('addTypeTests(#);', className));
 
           // TODO(sra): We could place on the extension type a pointer to the
           // peer constructor and use that for the `instanceof` check, e.g.
@@ -978,9 +1028,9 @@
     if (thisIsSimple == superIsSimple) return;
 
     if (thisIsSimple) {
-      body.add(js.statement('dart.addSimpleTypeTests(#);', className));
+      body.add(_callHelperStatement('addSimpleTypeTests(#);', className));
     } else {
-      body.add(js.statement('dart.addTypeTests(#);', className));
+      body.add(_callHelperStatement('addTypeTests(#);', className));
     }
   }
 
@@ -999,22 +1049,25 @@
       List<FieldDeclaration> fields,
       Map<FieldElement, JS.TemporaryId> virtualFields,
       List<JS.Statement> virtualFieldSymbols,
-      Set<FieldElement> staticFieldOverrides) {
+      Set<FieldElement> staticFieldOverrides,
+      Iterable<ExecutableElement> extensionMembers) {
+    var extensionNames =
+        new HashSet<String>.from(extensionMembers.map((e) => e.name));
     for (var field in fields) {
-      for (VariableDeclaration field in field.fields.variables) {
-        var overrideInfo =
-            checkForPropertyOverride(field.element, superclasses);
-        if (overrideInfo.foundGetter || overrideInfo.foundSetter) {
-          if (field.element.isStatic) {
-            staticFieldOverrides.add(field.element);
+      for (VariableDeclaration fieldDecl in field.fields.variables) {
+        var field = fieldDecl.element as FieldElement;
+        var overrideInfo = checkForPropertyOverride(field, superclasses);
+        if (overrideInfo.foundGetter ||
+            overrideInfo.foundSetter ||
+            extensionNames.contains(field.name)) {
+          if (field.isStatic) {
+            staticFieldOverrides.add(field);
           } else {
-            var fieldName =
-                _emitMemberName(field.element.name, type: classElem.type);
-            var virtualField = new JS.TemporaryId(field.element.name);
-            virtualFields[field.element] = virtualField;
+            var virtualField = new JS.TemporaryId(field.name);
+            virtualFields[field] = virtualField;
             virtualFieldSymbols.add(js.statement(
                 'const # = Symbol(#.name + "." + #.toString());',
-                [virtualField, className, fieldName]));
+                [virtualField, className, _declareMemberName(field.getter)]));
           }
         }
       }
@@ -1040,11 +1093,6 @@
     }
   }
 
-  void _emitVirtualFieldSymbols(
-      List<JS.Statement> virtualFields, List<JS.Statement> body) {
-    body.addAll(virtualFields);
-  }
-
   List<JS.Identifier> _emitTypeFormals(List<TypeParameterElement> typeFormals) {
     return typeFormals
         .map((t) => new JS.Identifier(t.name))
@@ -1081,12 +1129,12 @@
         element.fields.where((f) => f.type == type));
 
     // Create toString() method
-    var properties = new List<JS.Property>();
+    var nameProperties = new List<JS.Property>(fields.length);
     for (var i = 0; i < fields.length; ++i) {
-      properties.add(new JS.Property(
-          js.number(i), js.string('${type.name}.${fields[i].name}')));
+      nameProperties[i] = new JS.Property(
+          js.number(i), js.string('${type.name}.${fields[i].name}'));
     }
-    var nameMap = new JS.ObjectInitializer(properties, multiline: true);
+    var nameMap = new JS.ObjectInitializer(nameProperties, multiline: true);
     var toStringF = new JS.Method(js.string('toString'),
         js.call('function() { return #[this.index]; }', nameMap) as JS.Fun);
 
@@ -1098,38 +1146,42 @@
       js.statement('# = #', [id, classExpr])
     ];
 
-    // Create static fields for each enum value
-    for (var i = 0; i < fields.length; ++i) {
-      result.add(js.statement('#.# = dart.const(new #(#));',
-          [id, fields[i].name, id, js.number(i)]));
-    }
-
-    // Create static values list
-    var values = new JS.ArrayInitializer(new List<JS.Expression>.from(
-        fields.map((f) => js.call('#.#', [id, f.name]))));
-
-    // dart.constList helper internally depends on _interceptors.JSArray.
+    // defineEnumValues internally depends on dart.constList which uses
+    // _interceptors.JSArray.
     _declareBeforeUse(_jsArray);
 
-    result.add(js.statement(
-        '#.values = dart.constList(#, #);', [id, values, _emitType(type)]));
+    // Create static fields for each enum value, and the "values" getter
+    result.add(_callHelperStatement('defineEnumValues(#, #);', [
+      id,
+      new JS.ArrayInitializer(fields.map((f) => _propertyName(f.name)).toList(),
+          multiline: true)
+    ]));
 
     return _statement(result);
   }
 
   /// Wraps a possibly generic class in its type arguments.
   JS.Statement _defineClassTypeArguments(TypeDefiningElement element,
-      List<TypeParameterElement> formals, JS.Statement body) {
+      List<TypeParameterElement> formals, JS.Statement body,
+      [JS.Expression className, JS.Statement deferredBaseClass]) {
     assert(formals.isNotEmpty);
-    var genericCall = js.call('dart.generic((#) => { #; #; return #; })', [
+    var typeConstructor = js.call('(#) => { #; #; return #; }', [
       _emitTypeFormals(formals),
       _typeTable.discharge(formals),
       body,
       element.name
     ]);
+
+    var genericArgs = [typeConstructor];
+    if (deferredBaseClass != null) {
+      genericArgs.add(js.call('(#) => { #; }', [className, deferredBaseClass]));
+    }
+
+    var genericCall = _callHelper('generic(#)', [genericArgs]);
+
     if (element.library.isDartAsync &&
         (element.name == "Future" || element.name == "_Future")) {
-      genericCall = js.call('dart.flattenFutures(#)', [genericCall]);
+      genericCall = _callHelper('flattenFutures(#)', [genericCall]);
     }
     var genericDef = js.statement(
         '# = #;', [_emitTopLevelName(element, suffix: r'$'), genericCall]);
@@ -1187,7 +1239,7 @@
       var mixins =
           type.mixins.map((t) => _emitType(t, nameType: false)).toList();
       mixins.insert(0, heritage);
-      heritage = js.call('dart.mixin(#)', [mixins]);
+      heritage = _callHelper('mixin(#)', [mixins]);
     }
 
     _loader.finishTopLevel(element);
@@ -1212,7 +1264,7 @@
         // Generate getter
         var fn = new JS.Fun([], js.statement('{ return this.#; }', [name]));
         var method =
-            new JS.Method(_elementMemberName(field.getter), fn, isGetter: true);
+            new JS.Method(_declareMemberName(field.getter), fn, isGetter: true);
         jsMethods.add(method);
 
         // Generate setter
@@ -1220,7 +1272,7 @@
           var value = new JS.TemporaryId('value');
           fn = new JS.Fun(
               [value], js.statement('{ this.# = #; }', [name, value]));
-          method = new JS.Method(_elementMemberName(field.setter), fn,
+          method = new JS.Method(_declareMemberName(field.setter), fn,
               isSetter: true);
           jsMethods.add(method);
         }
@@ -1407,8 +1459,7 @@
     JS.Expression positionalArgs;
 
     if (method.type.namedParameterTypes.isNotEmpty) {
-      addProperty(
-          'namedArguments', js.call('dart.extractNamedArgs(#)', [args]));
+      addProperty('namedArguments', _callHelper('extractNamedArgs(#)', [args]));
     }
 
     if (method is MethodElement) {
@@ -1430,9 +1481,9 @@
       }
     }
 
-    var fnBody =
-        js.call('this.noSuchMethod(new dart.InvocationImpl(#, #, #))', [
-      _elementMemberName(method),
+    var fnBody = js.call('this.noSuchMethod(new #.InvocationImpl(#, #, #))', [
+      _runtimeModule,
+      _declareMemberName(method),
       positionalArgs,
       new JS.ObjectInitializer(invocationProps)
     ]);
@@ -1447,7 +1498,7 @@
     // TODO(jmesserly): generic type arguments will get dropped.
     // We have a similar issue with `dgsend` helpers.
     return new JS.Method(
-        _elementMemberName(method,
+        _declareMemberName(method,
             useExtension:
                 _extensionTypes.isNativeClass(method.enclosingElement)),
         _makeGenericFunction(fn),
@@ -1480,8 +1531,7 @@
       Map<FieldElement, JS.TemporaryId> virtualFields) {
     var virtualField = virtualFields[field.element];
     var result = <JS.Method>[];
-    var name = _emitMemberName(field.element.name,
-        type: (field.element.enclosingElement as ClassElement).type);
+    var name = _declareMemberName((field.element as FieldElement).getter);
     var getter = js.call('function() { return this[#]; }', [virtualField]);
     result.add(new JS.Method(name, getter, isGetter: true));
 
@@ -1510,8 +1560,7 @@
         checkForPropertyOverride(methodElement.variable, superclasses);
 
     // Generate a corresponding virtual getter / setter.
-    var name = _elementMemberName(methodElement,
-        useExtension: _extensionTypes.isNativeClass(type.element));
+    var name = _declareMemberName(methodElement);
     if (method.isGetter) {
       // Generate a setter
       if (field.setter != null || !propertyOverrideResult.foundSetter)
@@ -1551,8 +1600,8 @@
     // an ES6 iterator.
     return new JS.Method(
         js.call('Symbol.iterator'),
-        js.call('function() { return new dart.JsIterator(this.#); }',
-            [_emitMemberName('iterator', type: t)]) as JS.Fun);
+        js.call('function() { return new #.JsIterator(this.#); }',
+            [_runtimeModule, _emitMemberName('iterator', type: t)]) as JS.Fun);
   }
 
   JS.Expression _instantiateAnnotation(Annotation node) {
@@ -1569,46 +1618,60 @@
   ///
   /// For example for dart:_interceptors `JSArray` this will return "Array",
   /// referring to the JavaScript built-in `Array` type.
-  String _getJSPeerName(ClassElement classElem) {
-    var jsPeerName = getAnnotationName(
+  List<String> _getJSPeerNames(ClassElement classElem) {
+    var jsPeerNames = getAnnotationName(
         classElem,
         (a) =>
             isJsPeerInterface(a) ||
             isNativeAnnotation(a) && _extensionTypes.isNativeClass(classElem));
-    if (jsPeerName != null && jsPeerName.contains(',')) {
-      jsPeerName = jsPeerName.split(',')[0];
+    if (jsPeerNames != null) {
+      // Omit the special name "!nonleaf" and any future hacks starting with "!"
+      return jsPeerNames
+          .split(',')
+          .where((peer) => !peer.startsWith("!"))
+          .toList();
+    } else {
+      return [];
     }
-    return jsPeerName;
   }
 
   void _registerExtensionType(
       ClassElement classElem, String jsPeerName, List<JS.Statement> body) {
     if (jsPeerName != null) {
-      body.add(js.statement('dart.registerExtension(dart.global.#, #);',
-          [_propertyName(jsPeerName), _emitTopLevelName(classElem)]));
+      body.add(_callHelperStatement('registerExtension(#.global.#, #);', [
+        _runtimeModule,
+        _propertyName(jsPeerName),
+        _emitTopLevelName(classElem)
+      ]));
     }
   }
 
-  void _setBaseClass(ClassElement classElem, JS.Expression className,
-      String jsPeerName, List<JS.Statement> body) {
-    if (jsPeerName != null && classElem.typeParameters.isNotEmpty) {
-      // TODO(jmesserly): we should really just extend Array in the first place.
-      var newBaseClass = js.call('dart.global.#', [jsPeerName]);
-      body.add(js.statement(
-          'dart.setExtensionBaseClass(#, #);', [className, newBaseClass]));
+  JS.Statement _setBaseClass(ClassElement classElem, JS.Expression className,
+      List<String> jsPeerNames, List<JS.Statement> body) {
+    var typeFormals = classElem.typeParameters;
+    if (jsPeerNames.isNotEmpty && typeFormals.isNotEmpty) {
+      for (var peer in jsPeerNames) {
+        // TODO(jmesserly): we should just extend Array in the first place
+        var newBaseClass = _callHelper('global.#', [peer]);
+        body.add(_callHelperStatement(
+            'setExtensionBaseClass(#, #);', [className, newBaseClass]));
+      }
     } else if (_hasDeferredSupertype.contains(classElem)) {
       var newBaseClass = _emitType(classElem.type.superclass,
           nameType: false, subClass: classElem, className: className);
-      body.add(
-          js.statement('dart.setBaseClass(#, #);', [className, newBaseClass]));
+      var deferredBaseClass = _callHelperStatement(
+          'setBaseClass(#, #);', [className, newBaseClass]);
+      if (typeFormals.isNotEmpty) return deferredBaseClass;
+      body.add(deferredBaseClass);
     }
+    return null;
   }
 
   void _defineNamedConstructors(List<ConstructorDeclaration> ctors,
       List<JS.Statement> body, JS.Expression className, bool isCallable) {
     var code = isCallable
-        ? 'dart.defineNamedConstructorCallable(#, #, #);'
-        : 'dart.defineNamedConstructor(#, #)';
+        ? 'defineNamedConstructorCallable(#, #, #);'
+        : 'defineNamedConstructor(#, #)';
 
     for (ConstructorDeclaration member in ctors) {
       if (member.name != null && member.factoryKeyword == null) {
@@ -1617,7 +1680,7 @@
           args.add(_emitCallableClassConstructor(member.element));
         }
 
-        body.add(js.statement(code, args));
+        body.add(_callHelperStatement(code, args));
       }
     }
   }
@@ -1650,8 +1713,9 @@
       List<JS.Statement> body) {
     // Metadata
     if (options.emitMetadata && metadata.isNotEmpty) {
-      body.add(js.statement('#[dart.metadata] = () => #;', [
+      body.add(js.statement('#[#.metadata] = () => #;', [
         className,
+        _runtimeModule,
         new JS.ArrayInitializer(
             new List<JS.Expression>.from(metadata.map(_instantiateAnnotation)))
       ]));
@@ -1667,9 +1731,9 @@
     if (extensions.isNotEmpty) {
       var methodNames = <JS.Expression>[];
       for (var e in extensions) {
-        methodNames.add(_elementMemberName(e, useExtension: false));
+        methodNames.add(_declareMemberName(e, useExtension: false));
       }
-      body.add(js.statement('dart.defineExtensionMembers(#, #);', [
+      body.add(_callHelperStatement('defineExtensionMembers(#, #);', [
         className,
         new JS.ArrayInitializer(methodNames, multiline: methodNames.length > 4)
       ]));
@@ -1686,8 +1750,9 @@
       JS.Expression className,
       List<JS.Statement> body) {
     if (classElem.interfaces.isNotEmpty) {
-      body.add(js.statement('#[dart.implements] = () => #;', [
+      body.add(js.statement('#[#.implements] = () => #;', [
         className,
+        _runtimeModule,
         new JS.ArrayInitializer(
             new List<JS.Expression>.from(classElem.interfaces.map(_emitType)))
       ]));
@@ -1733,8 +1798,7 @@
       if (inheritedElement != null && inheritedElement.type == element.type) {
         continue;
       }
-      var memberName = _elementMemberName(element,
-          useExtension: _extensionTypes.isNativeClass(classElem));
+      var memberName = _declareMemberName(element);
       var property = new JS.Property(memberName, type);
       tMember.add(property);
       // TODO(vsm): Why do we need this?
@@ -1748,8 +1812,7 @@
     for (FieldDeclaration node in fields) {
       for (VariableDeclaration field in node.fields.variables) {
         var element = field.element as FieldElement;
-        var memberName = _elementMemberName(element.getter,
-            useExtension: _extensionTypes.isNativeClass(classElem));
+        var memberName = _declareMemberName(element.getter);
         var type = _emitAnnotatedType(element.type, node.metadata);
         var property = new JS.Property(memberName, type);
         (node.isStatic ? tStaticFields : tInstanceFields).add(property);
@@ -1812,12 +1875,12 @@
     }
     if (!sigFields.isEmpty || extensions.isNotEmpty) {
       var sig = new JS.ObjectInitializer(sigFields);
-      body.add(js.statement('dart.setSignature(#, #);', [className, sig]));
+      body.add(_callHelperStatement('setSignature(#, #);', [className, sig]));
     }
     // Add static property dart._runtimeType to Object.
     // All other Dart classes will (statically) inherit this property.
     if (classElem == objectClass) {
-      body.add(js.statement('dart.tagComputed(#, () => #.#);',
+      body.add(_callHelperStatement('tagComputed(#, () => #.#);',
           [className, emitLibraryName(dartCoreLibrary), 'Type']));
     }
   }
@@ -1832,7 +1895,7 @@
       var dartxNames = <JS.Expression>[];
       for (var m in methods) {
         if (!m.isAbstract && !m.isStatic && m.element.isPublic) {
-          dartxNames.add(_elementMemberName(m.element, useExtension: false));
+          dartxNames.add(_declareMemberName(m.element, useExtension: false));
         }
       }
       for (var fieldDecl in fields) {
@@ -1840,13 +1903,13 @@
           for (var field in fieldDecl.fields.variables) {
             var e = field.element as FieldElement;
             if (e.isPublic) {
-              dartxNames.add(_elementMemberName(e.getter, useExtension: false));
+              dartxNames.add(_declareMemberName(e.getter, useExtension: false));
             }
           }
         }
       }
       if (dartxNames.isNotEmpty) {
-        body.add(js.statement('dart.defineExtensionNames(#)',
+        body.add(_callHelperStatement('defineExtensionNames(#)',
             [new JS.ArrayInitializer(dartxNames, multiline: true)]));
       }
     }
@@ -2103,7 +2166,7 @@
     for (var declaration in fieldDecls) {
       for (var fieldNode in declaration.fields.variables) {
         var element = fieldNode.element;
-        if (_constField.isFieldInitConstant(fieldNode)) {
+        if (_constants.isFieldInitConstant(fieldNode)) {
           unsetFields[element as FieldElement] = fieldNode;
         } else {
           fields[element as FieldElement] = _visitInitializer(fieldNode);
@@ -2144,13 +2207,8 @@
 
     var body = <JS.Statement>[];
     fields.forEach((FieldElement e, JS.Expression initialValue) {
-      if (virtualFields.containsKey(e)) {
-        body.add(
-            js.statement('this[#] = #;', [virtualFields[e], initialValue]));
-      } else {
-        var access = _emitMemberName(e.name, type: e.enclosingElement.type);
-        body.add(js.statement('this.# = #;', [access, initialValue]));
-      }
+      JS.Expression access = virtualFields[e] ?? _declareMemberName(e.getter);
+      body.add(js.statement('this.# = #;', [access, initialValue]));
     });
 
     if (isConst) _loader.finishTopLevel(cls.element);
@@ -2244,22 +2302,18 @@
   }
 
   JS.Fun _emitNativeFunctionBody(MethodDeclaration node) {
-    if (node.isStatic) {
-      // TODO(vsm): Do we need to handle this case?
-      return null;
-    }
-
-    var params = visitFormalParameterList(node.parameters, destructure: false);
     String name =
         getAnnotationName(node.element, isJSAnnotation) ?? node.name.name;
     if (node.isGetter) {
-      return new JS.Fun(params, js.statement('{ return this.#; }', [name]));
+      return new JS.Fun([], js.statement('{ return this.#; }', [name]));
     } else if (node.isSetter) {
+      var params =
+          visitFormalParameterList(node.parameters, destructure: false);
       return new JS.Fun(
           params, js.statement('{ this.# = #; }', [name, params.last]));
     } else {
-      return new JS.Fun(
-          params, js.statement('{ return this.#(#); }', [name, params]));
+      return js.call(
+          'function (...args) { return this.#.apply(this, args); }', name);
     }
   }
 
@@ -2270,9 +2324,11 @@
 
     JS.Fun fn;
     if (_externalOrNative(node)) {
+      if (node.isStatic) {
+        // TODO(vsm): Do we need to handle this case?
+        return null;
+      }
       fn = _emitNativeFunctionBody(node);
-      // TODO(vsm): Remove if / when we handle the static case above.
-      if (fn == null) return null;
     } else {
       fn = _emitFunctionBody(node.element, node.parameters, node.body);
 
@@ -2288,10 +2344,7 @@
     }
 
     return annotate(
-        new JS.Method(
-            _elementMemberName(node.element,
-                useExtension: _extensionTypes.isNativeClass(type.element)),
-            fn,
+        new JS.Method(_declareMemberName(node.element), fn,
             isGetter: node.isGetter,
             isSetter: node.isSetter,
             isStatic: node.isStatic),
@@ -2334,7 +2387,7 @@
         props.add(_loader.emitDeclaration(
             setter, (node) => _emitTopLevelProperty(node)));
       }
-      return js.statement('dart.copyProperties(#, { # });',
+      return _callHelperStatement('copyProperties(#, { # });',
           [emitLibraryName(currentLibrary), props]);
     }
     if (node.isSetter) {
@@ -2345,7 +2398,7 @@
         props.add(_loader.emitDeclaration(
             getter, (node) => _emitTopLevelProperty(node)));
       }
-      return js.statement('dart.copyProperties(#, { # });',
+      return _callHelperStatement('copyProperties(#, { # });',
           [emitLibraryName(currentLibrary), props]);
     }
 
@@ -2444,9 +2497,9 @@
     var lazy = topLevel && !_typeIsLoaded(type);
     var typeRep = _emitFunctionType(type, definite: true);
     if (lazy) {
-      return js.call('dart.lazyFn(#, () => #)', [fn, typeRep]);
+      return _callHelper('lazyFn(#, () => #)', [fn, typeRep]);
     } else {
-      return js.call('dart.fn(#, #)', [fn, typeRep]);
+      return _callHelper('fn(#, #)', [fn, typeRep]);
     }
   }
 
@@ -2474,7 +2527,7 @@
       JS.Block block = body;
       if (block.statements.length == 1) {
         JS.Statement s = block.statements[0];
-        if (s is JS.Return) body = s.value;
+        if (s is JS.Return && s.value != null) body = s.value;
       }
     }
 
@@ -2598,7 +2651,7 @@
     }
 
     var T = _emitType(returnType);
-    return js.call('dart.#(#)', [
+    return _callHelper('#(#)', [
       kind,
       [gen, T]..addAll(visitFormalParameterList(parameters, destructure: false))
     ]);
@@ -2638,7 +2691,7 @@
     if (typeArgs == null) {
       return simpleId;
     }
-    return js.call('dart.gbind(#, #)', [simpleId, typeArgs]);
+    return _callHelper('gbind(#, #)', [simpleId, typeArgs]);
   }
 
   /// Emits a simple identifier, handling implicit `this` as well as
@@ -2665,7 +2718,7 @@
       // If the type is a type literal expression in Dart code, wrap the raw
       // runtime type in a "Type" instance.
       if (!_isInForeignJS && _isTypeLiteral(node)) {
-        typeName = js.call('dart.wrapType(#)', typeName);
+        typeName = _callHelper('wrapType(#)', typeName);
       }
 
       return typeName;
@@ -2683,21 +2736,19 @@
     if (element is ClassMemberElement && element is! ConstructorElement) {
       bool isStatic = element.isStatic;
       var type = element.enclosingElement.type;
-      var member = _emitMemberName(name, isStatic: isStatic, type: type);
+      var member = _emitMemberName(name,
+          isStatic: isStatic, type: type, element: element);
 
-      // For static methods, we add the raw type name, without generics or
-      // library prefix. We don't need those because static calls can't use
-      // the generic type.
       if (isStatic) {
-        var dynType = _emitType(fillDynamicTypeArgs(type));
+        var dynType = _emitStaticAccess(type);
         return new JS.PropertyAccess(dynType, member);
       }
 
       // For instance members, we add implicit-this.
       // For method tear-offs, we ensure it's a bound method.
       var tearOff = element is MethodElement && !inInvocationContext(node);
-      var code = (tearOff) ? 'dart.bind(this, #)' : 'this.#';
-      return js.call(code, member);
+      if (tearOff) return _callHelper('bind(this, #)', member);
+      return js.call('this.#', member);
     }
 
     if (element is ParameterElement) {
@@ -2814,7 +2865,7 @@
         nameType: nameType,
         hoistType: hoistType);
     var helper = (definite) ? 'definiteFunctionType' : 'functionType';
-    var fullType = js.call('dart.${helper}(#)', [parts]);
+    var fullType = _callHelper('${helper}(#)', [parts]);
     if (!nameType) return fullType;
     return _typeTable.nameType(type, fullType,
         hoistType: hoistType, definite: definite);
@@ -2888,6 +2939,40 @@
     return typeParts;
   }
 
+  /// Emits an expression that lets you access statics on a [type] from code.
+  ///
+  /// If [nameType] is true, then the type will be named.  In addition,
+  /// if [hoistType] is true, then the named type will be hoisted.
+  JS.Expression _emitConstructorAccess(DartType type,
+      {bool nameType: true, bool hoistType: true}) {
+    return _emitJSInterop(type.element) ??
+        _emitType(type, nameType: nameType, hoistType: hoistType);
+  }
+
+  /// Emits an expression that lets you access statics on a [type] from code.
+  JS.Expression _emitStaticAccess(DartType type) {
+    // Make sure we aren't attempting to emit a static access path to a type
+    // that does not have a valid static access path.
+    assert(!type.isVoid &&
+        !type.isDynamic &&
+        !type.isBottom &&
+        type is! TypeParameterType);
+
+    // For statics, we add the raw type name, without generics or
+    // library prefix. We don't need those because static calls can't use
+    // the generic type.
+    type = fillDynamicTypeArgs(type);
+    var element = type.element;
+    _declareBeforeUse(element);
+
+    var interop = _emitJSInterop(element);
+    if (interop != null) return interop;
+
+    assert(type.name != '' && type.name != null);
+
+    return _emitTopLevelNameNoInterop(element);
+  }
+
   /// Emits a Dart [type] into code.
   ///
   /// If [lowerTypedef] is set, a typedef will be expanded as if it were a
@@ -2910,20 +2995,44 @@
       JS.Expression className}) {
     // The void and dynamic types are not defined in core.
     if (type.isVoid) {
-      return js.call('dart.void');
+      return _callHelper('void');
     } else if (type.isDynamic) {
-      return js.call('dart.dynamic');
+      return _callHelper('dynamic');
     } else if (type.isBottom) {
-      return js.call('dart.bottom');
+      return _callHelper('bottom');
     }
 
-    _declareBeforeUse(type.element);
+    var element = type.element;
+    _declareBeforeUse(element);
+
+    var interop = _emitJSInterop(element);
+    // Type parameters don't matter as JS interop types cannot be reified.
+    // We have to use lazy JS types because until we have proper module
+    // loading for JS libraries bundled with Dart libraries, we will sometimes
+    // need to load Dart libraries before the corresponding JS libraries are
+    // actually loaded.
+    // Given a JS type such as:
+    //     @JS('google.maps.Location')
+    //     class Location { ... }
+    // We can't emit a reference to MyType because the JS library that defines
+    // it may be loaded after our code. So for now, we use a special lazy type
+    // object to represent MyType.
+    // Anonymous JS types do not have a corresponding concrete JS type so we
+    // have to use a helper to define them.
+    if (interop != null) {
+      if (_isObjectLiteral(element)) {
+        return _callHelper(
+            'lazyAnonymousJSType(#)', js.string(element.displayName));
+      } else {
+        return _callHelper('lazyJSType(() => #, #)',
+            [interop, js.string(_getJSName(element).join('.'))]);
+      }
+    }
 
     // TODO(jmesserly): like constants, should we hoist function types out of
     // methods? Similar issue with generic types. For all of these, we may want
     // to canonicalize them too, at least when inside the same library.
     var name = type.name;
-    var element = type.element;
     if (name == '' || name == null || lowerTypedef) {
       // TODO(jmesserly): should we change how typedefs work? They currently
       // go through use similar logic as generic classes. This makes them
@@ -2937,9 +3046,7 @@
       return new JS.Identifier(name);
     }
 
-    if (type == subClass?.type) {
-      return className;
-    }
+    if (type == subClass?.type) return className;
 
     if (type is ParameterizedType) {
       var args = type.typeArguments;
@@ -2950,7 +3057,7 @@
             hoistType: hoistType,
             subClass: subClass,
             className: className));
-      } else if (lowerGeneric) {
+      } else if (lowerGeneric || element == subClass) {
         jsArgs = [];
       }
       if (jsArgs != null) {
@@ -2962,12 +3069,16 @@
       }
     }
 
-    return _emitTopLevelName(element);
+    return _emitTopLevelNameNoInterop(element);
   }
 
   JS.PropertyAccess _emitTopLevelName(Element e, {String suffix: ''}) {
     var interop = _emitJSInterop(e);
     if (interop != null) return interop;
+    return _emitTopLevelNameNoInterop(e, suffix: suffix);
+  }
+
+  JS.PropertyAccess _emitTopLevelNameNoInterop(Element e, {String suffix: ''}) {
     String name = getJSExportName(e) + suffix;
     return new JS.PropertyAccess(
         emitLibraryName(e.library), _propertyName(name));
@@ -3061,12 +3172,23 @@
         var l = _visit(_bindValue(vars, 'l', target));
         var name = _emitMemberName(id.name);
         return new JS.MetaLet(vars, [
-          js.call('(#[(#[dart._extensionType]) ? dartx[#] : #] = #)',
-              [l, l, name, name, _visit(rhs)])
+          js.call('(#[(#[#._extensionType]) ? #[#] : #] = #)', [
+            l,
+            l,
+            _runtimeModule,
+            _extensionSymbolsModule,
+            name,
+            name,
+            _visit(rhs)
+          ])
         ]);
       }
-      return js.call('dart.dput(#, #, #)',
-          [_visit(target), _emitMemberName(id.name), _visit(rhs)]);
+      return _callHelper('#(#, #, #)', [
+        _emitDynamicOperationName('dput'),
+        _visit(target),
+        _emitMemberName(id.name),
+        _visit(rhs)
+      ]);
     }
 
     var accessor = id.staticElement;
@@ -3094,7 +3216,7 @@
     // TODO(sra): We should get here only for compiler bugs or weirdness due to
     // --unsafe-force-compile. Once those paths have been addressed, throw at
     // compile time.
-    return js.call('dart.throwUnimplementedError((#, #, #))',
+    return _callHelper('throwUnimplementedError((#, #, #))',
         [js.string('$lhs ='), _visit(rhs), js.string(problem)]);
   }
 
@@ -3180,8 +3302,9 @@
     // the generic type.
     ClassElement classElement = element.enclosingElement;
     var type = classElement.type;
-    var dynType = _emitType(fillDynamicTypeArgs(type));
-    var member = _emitMemberName(element.name, isStatic: true, type: type);
+    var dynType = _emitStaticAccess(type);
+    var member = _emitMemberName(element.name,
+        isStatic: true, type: type, element: element);
     return _visit(rhs).toAssignExpression(
         annotate(new JS.PropertyAccess(dynType, member), lhs));
   }
@@ -3192,7 +3315,7 @@
       JS.Expression jsTarget, Element element, JS.Expression value) {
     String memberName = element.name;
     var type = (element.enclosingElement as ClassElement).type;
-    var name = _emitMemberName(memberName, type: type);
+    var name = _emitMemberName(memberName, type: type, element: element);
     return value.toAssignExpression(
         annotate(new JS.PropertyAccess(jsTarget, name), lhs));
   }
@@ -3251,6 +3374,11 @@
 
   @override
   visitMethodInvocation(MethodInvocation node) {
+    if (_isDeferredLoadLibrary(node.target, node.methodName)) {
+      // We are calling loadLibrary() on a deferred library prefix.
+      return _callHelper('loadLibrary()');
+    }
+
     if (node.operator?.lexeme == '?.') {
       return _emitNullSafe(node);
     }
@@ -3267,7 +3395,7 @@
       if (targetType is FunctionType) {
         // Call methods on function types should be handled as regular function
         // invocations.
-        return _emitFunctionCall(node);
+        return _emitFunctionCall(node, node.target);
       }
       if (targetType.isDartCoreFunction || targetType.isDynamic) {
         // TODO(vsm): Can a call method take generic type parameters?
@@ -3326,40 +3454,70 @@
     return helperMethodName;
   }
 
-  /// Emits a (possibly generic) instance method call.
+  JS.Expression _emitTarget(Expression target, Element element, bool isStatic) {
+    if (isStatic) {
+      if (element is ConstructorElement) {
+        return _emitConstructorAccess(element.enclosingElement.type);
+      }
+      if (element is ExecutableElement) {
+        return _emitStaticAccess(
+            (element.enclosingElement as ClassElement).type);
+      }
+      if (element is FieldElement) {
+        return _emitStaticAccess(element.enclosingElement.type);
+      }
+    }
+    return _visit(target);
+  }
+
+  /// Emits a (possibly generic) instance, or static method call.
   JS.Expression _emitMethodCallInternal(
       Expression target,
       MethodInvocation node,
       List<JS.Expression> args,
       List<JS.Expression> typeArgs) {
     var type = getStaticType(target);
-    var name = node.methodName.name;
     var element = node.methodName.staticElement;
     bool isStatic = element is ExecutableElement && element.isStatic;
-    var memberName = _emitMemberName(name, type: type, isStatic: isStatic);
+    var name = node.methodName.name;
+    var memberName =
+        _emitMemberName(name, type: type, isStatic: isStatic, element: element);
 
-    JS.Expression jsTarget = _visit(target);
+    JS.Expression jsTarget = _emitTarget(target, element, isStatic);
     if (isDynamicInvoke(target) || isDynamicInvoke(node.methodName)) {
       if (_inWhitelistCode(target)) {
         var vars = <JS.MetaLetVariable, JS.Expression>{};
         var l = _visit(_bindValue(vars, 'l', target));
         jsTarget = new JS.MetaLet(vars, [
-          js.call('(#[(#[dart._extensionType]) ? dartx[#] : #]).bind(#)',
-              [l, l, memberName, memberName, l])
+          js.call('(#[(#[#._extensionType]) ? #[#] : #]).bind(#)', [
+            l,
+            l,
+            _runtimeModule,
+            _extensionSymbolsModule,
+            memberName,
+            memberName,
+            l
+          ])
         ]);
         if (typeArgs != null) jsTarget = new JS.Call(jsTarget, typeArgs);
         return new JS.Call(jsTarget, args);
       }
       if (typeArgs != null) {
-        return js.call('dart.dgsend(#, #, #, #)',
-            [jsTarget, new JS.ArrayInitializer(typeArgs), memberName, args]);
+        return _callHelper('#(#, #, #, #)', [
+          _emitDynamicOperationName('dgsend'),
+          jsTarget,
+          new JS.ArrayInitializer(typeArgs),
+          memberName,
+          args
+        ]);
       } else {
-        return js.call('dart.dsend(#, #, #)', [jsTarget, memberName, args]);
+        return _callHelper('#(#, #, #)',
+            [_emitDynamicOperationName('dsend'), jsTarget, memberName, args]);
       }
     }
     if (_isObjectMemberCall(target, name)) {
       assert(typeArgs == null); // Object methods don't take type args.
-      return js.call('dart.#(#, #)', [name, jsTarget, args]);
+      return _callHelper('#(#, #)', [name, jsTarget, args]);
     }
 
     jsTarget = new JS.PropertyAccess(jsTarget, memberName);
@@ -3372,22 +3530,26 @@
       InvocationExpression node, JS.Expression fn, List<JS.Expression> args) {
     var typeArgs = _emitInvokeTypeArguments(node);
     if (typeArgs != null) {
-      return js.call('dart.dgcall(#, #, #)',
-          [fn, new JS.ArrayInitializer(typeArgs), args]);
+      return _callHelper(
+          'dgcall(#, #, #)', [fn, new JS.ArrayInitializer(typeArgs), args]);
     } else {
       if (_inWhitelistCode(node, isCall: true)) {
         return new JS.Call(fn, args);
       }
-      return js.call('dart.dcall(#, #)', [fn, args]);
+      return _callHelper('dcall(#, #)', [fn, args]);
     }
   }
 
   /// Emits a function call, to a top-level function, local function, or
   /// an expression.
-  JS.Expression _emitFunctionCall(InvocationExpression node) {
-    var fn = _visit(node.function);
+  JS.Expression _emitFunctionCall(InvocationExpression node,
+      [Expression function]) {
+    if (function == null) {
+      function = node.function;
+    }
+    var fn = _visit(function);
     var args = _visit(node.argumentList) as List<JS.Expression>;
-    if (isDynamicInvoke(node.function)) {
+    if (isDynamicInvoke(function)) {
       return _emitDynamicInvoke(node, fn, args);
     } else {
       return new JS.Call(_applyInvokeTypeArguments(fn, node), args);
@@ -3621,7 +3783,7 @@
   @override
   JS.Statement visitAssertStatement(AssertStatement node) =>
       // TODO(jmesserly): only emit in checked mode.
-      js.statement('dart.assert(#);', _visit(node.condition));
+      _callHelperStatement('assert(#);', _visit(node.condition));
 
   @override
   JS.Statement visitReturnStatement(ReturnStatement node) {
@@ -3731,7 +3893,7 @@
     bool isLoaded = _loader.finishCheckingReferences();
 
     bool eagerInit =
-        isLoaded && (field.isConst || _constField.isFieldInitConstant(field));
+        isLoaded && (field.isConst || _constants.isFieldInitConstant(field));
 
     var fieldName = field.name.name;
     if (eagerInit &&
@@ -3760,7 +3922,7 @@
 
     bool eagerInit;
     JS.Expression jsInit;
-    if (field.isConst || _constField.isFieldInitConstant(field)) {
+    if (field.isConst || _constants.isFieldInitConstant(field)) {
       // If the field is constant, try and generate it at the top level.
       _loader.startTopLevel(element);
       jsInit = _visitInitializer(field);
@@ -3831,7 +3993,7 @@
       objExpr = emitLibraryName(target);
     }
 
-    return js.statement('dart.defineLazy(#, { # });', [objExpr, methods]);
+    return _callHelperStatement('defineLazy(#, { # });', [objExpr, methods]);
   }
 
   PropertyAccessorElement _findAccessor(VariableElement element,
@@ -3850,7 +4012,7 @@
     var classElem = element.enclosingElement;
     var interop = _emitJSInterop(classElem);
     if (interop != null) return interop;
-    var typeName = _emitType(type);
+    var typeName = _emitConstructorAccess(type);
     if (name != null || element.isFactory) {
       var namedCtor = _constructorName(element);
       return new JS.PropertyAccess(typeName, namedCtor);
@@ -3872,10 +4034,11 @@
     JS.Expression emitNew() {
       JS.Expression ctor;
       bool isFactory = false;
+      bool isNative = false;
       if (element == null) {
         // TODO(jmesserly): this only happens if we had a static error.
         // Should we generate a throw instead?
-        ctor = _emitType(type,
+        ctor = _emitConstructorAccess(type,
             nameType: options.hoistInstanceCreation,
             hoistType: options.hoistInstanceCreation);
         if (name != null) {
@@ -3884,9 +4047,14 @@
       } else {
         ctor = _emitConstructorName(element, type, name);
         isFactory = element.isFactory;
+        var classElem = element.enclosingElement;
+        isNative = _isJSNative(classElem);
       }
       var args = _visit(argumentList) as List<JS.Expression>;
-      return isFactory ? new JS.Call(ctor, args) : new JS.New(ctor, args);
+      // Native factory constructors are JS constructors - use new here.
+      return isFactory && !isNative
+          ? new JS.Call(ctor, args)
+          : new JS.New(ctor, args);
     }
 
     if (element != null && _isObjectLiteral(element.enclosingElement)) {
@@ -3901,6 +4069,9 @@
         findAnnotation(classElem, isJSAnonymousAnnotation) != null;
   }
 
+  bool _isJSNative(ClassElement classElem) =>
+      findAnnotation(classElem, isPublicJSAnnotation) != null;
+
   JS.Expression _emitObjectLiteral(ArgumentList argumentList) {
     var args = _visit(argumentList) as List<JS.Expression>;
     if (args.isEmpty) {
@@ -3916,6 +4087,41 @@
     var constructor = node.constructorName;
     var name = constructor.name;
     var type = constructor.type.type;
+    if (node.isConst &&
+        element?.name == 'fromEnvironment' &&
+        element.library.isDartCore) {
+      var value = node.accept(_constants.constantVisitor);
+
+      if (value == null || value.isNull) {
+        return new JS.LiteralNull();
+      }
+      // Handle unknown value: when the declared variable wasn't found, and no
+      // explicit default value was passed either.
+      // TODO(jmesserly): ideally Analyzer would simply resolve this to the
+      // default value that is specified in the SDK. Instead we implement that
+      // here. `bool.fromEnvironment` defaults to `false`, the others to `null`:
+      // https://api.dartlang.org/stable/1.20.1/dart-core/bool/bool.fromEnvironment.html
+      if (value.isUnknown) {
+        return type == types.boolType
+            ? js.boolean(false)
+            : new JS.LiteralNull();
+      }
+      if (value.type == types.boolType) {
+        var boolValue = value.toBoolValue();
+        return boolValue != null ? js.boolean(boolValue) : new JS.LiteralNull();
+      }
+      if (value.type == types.intType) {
+        var intValue = value.toIntValue();
+        return intValue != null ? js.number(intValue) : new JS.LiteralNull();
+      }
+      if (value.type == types.stringType) {
+        var stringValue = value.toStringValue();
+        return stringValue != null
+            ? js.escapedString(stringValue)
+            : new JS.LiteralNull();
+      }
+      throw new StateError('failed to evaluate $node');
+    }
     return _emitInstanceCreationExpression(
         element, type, name, node.argumentList, node.isConst);
   }
@@ -3939,7 +4145,7 @@
     if (expr == null) return null;
     var jsExpr = _visit(expr);
     if (!isNullable(expr)) return jsExpr;
-    return js.call('dart.notNull(#)', jsExpr);
+    return _callHelper('notNull(#)', jsExpr);
   }
 
   @override
@@ -3969,7 +4175,8 @@
         return _emitSend(left, op.lexeme, [right]);
       } else {
         var bang = op.type == TokenType.BANG_EQ ? '!' : '';
-        code = '${bang}dart.equals(#, #)';
+        code = '${bang}#.equals(#, #)';
+        return js.call(code, [_runtimeModule, _visit(left), _visit(right)]);
       }
       return js.call(code, [_visit(left), _visit(right)]);
     }
@@ -4282,7 +4489,7 @@
   }
 
   JS.Expression _emitConst(JS.Expression expr()) =>
-      _cacheConst(() => js.call('dart.const(#)', expr()));
+      _cacheConst(() => _callHelper('const(#)', expr()));
 
   /// Returns a new expression, which can be be used safely *once* on the
   /// left hand side, and *once* on the right side of an assignment.
@@ -4453,7 +4660,10 @@
           context: expr);
     }
 
-    return _emitSend(expr, op.lexeme[0], []);
+    var operatorName = op.lexeme;
+    // Use the name from the Dart spec.
+    if (operatorName == '-') operatorName = 'unary-';
+    return _emitSend(expr, operatorName, []);
   }
 
   // Cascades can contain [IndexExpression], [MethodInvocation] and
@@ -4492,6 +4702,11 @@
 
   @override
   visitPrefixedIdentifier(PrefixedIdentifier node) {
+    if (_isDeferredLoadLibrary(node.prefix, node.identifier)) {
+      // We are tearing off "loadLibrary" on a library prefix.
+      return _callHelper('loadLibrary');
+    }
+
     if (isLibraryPrefix(node.prefix)) {
       return _visit(node.identifier);
     } else {
@@ -4541,8 +4756,8 @@
       }
     }
     if (tail.isEmpty) return _visit(node);
-    return js.call(
-        'dart.nullSafe(#, #)', [_visit(node) as JS.Expression, tail.reversed]);
+    return _callHelper(
+        'nullSafe(#, #)', [_visit(node) as JS.Expression, tail.reversed]);
   }
 
   static Token _getOperator(Expression node) {
@@ -4626,24 +4841,28 @@
     return _emitFunctionTypeArguments(type, instantiated);
   }
 
+  JS.LiteralString _emitDynamicOperationName(String name) =>
+      js.string(options.replCompile ? '${name}Repl' : name);
+
   JS.Expression _emitAccessInternal(Expression target, Element member,
       String memberName, List<JS.Expression> typeArgs) {
     bool isStatic = member is ClassMemberElement && member.isStatic;
     var name = _emitMemberName(memberName,
-        type: getStaticType(target), isStatic: isStatic);
+        type: getStaticType(target), isStatic: isStatic, element: member);
     if (isDynamicInvoke(target)) {
       if (_inWhitelistCode(target)) {
         var vars = <JS.MetaLetVariable, JS.Expression>{};
         var l = _visit(_bindValue(vars, 'l', target));
         return new JS.MetaLet(vars, [
-          js.call('(#[dart._extensionType]) ? #[dartx[#]] : #.#',
-              [l, l, name, l, name])
+          js.call('(#[#._extensionType]) ? #[#[#]] : #.#',
+              [l, _runtimeModule, l, _extensionSymbolsModule, name, l, name])
         ]);
       }
-      return js.call('dart.dload(#, #)', [_visit(target), name]);
+      return _callHelper('#(#, #)',
+          [_emitDynamicOperationName('dload'), _visit(target), name]);
     }
 
-    var jsTarget = _visit(target);
+    var jsTarget = _emitTarget(target, member, isStatic);
     bool isSuper = jsTarget is JS.Super;
 
     if (isSuper && member is FieldElement && !member.isSynthetic) {
@@ -4656,22 +4875,22 @@
     if (member != null && member is MethodElement && !isStatic) {
       // Tear-off methods: explicitly bind it.
       if (isSuper) {
-        result = js.call('dart.bind(this, #, #.#)', [name, jsTarget, name]);
+        result = _callHelper('bind(this, #, #.#)', [name, jsTarget, name]);
       } else if (_isObjectMemberCall(target, memberName)) {
-        result = js.call('dart.bind(#, #, dart.#)',
-            [jsTarget, _propertyName(memberName), memberName]);
+        result = _callHelper('bind(#, #, #.#)',
+            [jsTarget, _propertyName(memberName), _runtimeModule, memberName]);
       } else {
-        result = js.call('dart.bind(#, #)', [jsTarget, name]);
+        result = _callHelper('bind(#, #)', [jsTarget, name]);
       }
     } else if (_isObjectMemberCall(target, memberName)) {
-      result = js.call('dart.#(#)', [memberName, jsTarget]);
+      result = _callHelper('#(#)', [memberName, jsTarget]);
     } else {
       result = js.call('#.#', [jsTarget, name]);
     }
     if (typeArgs == null) {
       return result;
     }
-    return js.call('dart.gbind(#, #)', [result, typeArgs]);
+    return _callHelper('gbind(#, #)', [result, typeArgs]);
   }
 
   /// Emits a generic send, like an operator method.
@@ -4682,24 +4901,32 @@
   JS.Expression _emitSend(
       Expression target, String name, List<Expression> args) {
     var type = getStaticType(target);
-    var memberName = _emitMemberName(name, unary: args.isEmpty, type: type);
+    var memberName = _emitMemberName(name, type: type);
     if (isDynamicInvoke(target)) {
       if (_inWhitelistCode(target)) {
         var vars = <JS.MetaLetVariable, JS.Expression>{};
         var l = _visit(_bindValue(vars, 'l', target));
         return new JS.MetaLet(vars, [
-          js.call('(#[(#[dart._extensionType]) ? dartx[#] : #]).call(#, #)',
-              [l, l, memberName, memberName, l, _visitList(args)])
+          js.call('(#[(#[#._extensionType]) ? #[#] : #]).call(#, #)', [
+            l,
+            l,
+            _runtimeModule,
+            _extensionSymbolsModule,
+            memberName,
+            memberName,
+            l,
+            _visitList(args)
+          ])
         ]);
       }
       // dynamic dispatch
       var dynamicHelper = const {'[]': 'dindex', '[]=': 'dsetindex'}[name];
       if (dynamicHelper != null) {
-        return js.call('dart.$dynamicHelper(#, #)',
+        return _callHelper('$dynamicHelper(#, #)',
             [_visit(target) as JS.Expression, _visitList(args)]);
       } else {
-        return js.call('dart.dsend(#, #, #)',
-            [_visit(target), memberName, _visitList(args)]);
+        return _callHelper(
+            'dsend(#, #, #)', [_visit(target), memberName, _visitList(args)]);
       }
     }
 
@@ -4743,9 +4970,9 @@
   visitThrowExpression(ThrowExpression node) {
     var expr = _visit(node.expression);
     if (node.parent is ExpressionStatement) {
-      return js.statement('dart.throw(#);', expr);
+      return _callHelperStatement('throw(#);', expr);
     } else {
-      return js.call('dart.throw(#)', expr);
+      return _callHelper('throw(#)', expr);
     }
   }
 
@@ -4948,8 +5175,8 @@
       }
       if (node.stackTraceParameter != null) {
         var stackVar = node.stackTraceParameter.name;
-        body.add(js.statement(
-            'let # = dart.stackTrace(#);', [stackVar, _visit(name)]));
+        body.add(js.statement('let # = #.stackTrace(#);',
+            [stackVar, _runtimeModule, _visit(name)]));
       }
     }
 
@@ -5006,10 +5233,17 @@
   @override
   visitSymbolLiteral(SymbolLiteral node) {
     JS.Expression emitSymbol() {
-      // TODO(vsm): When we canonicalize, we need to treat private symbols
-      // correctly.
+      // TODO(vsm): Handle qualified symbols correctly.
+      var last = node.components.last.toString();
       var name = js.string(node.components.join('.'), "'");
-      return js.call('#.new(#)', [_emitType(types.symbolType), name]);
+      if (last.startsWith('_')) {
+        var nativeSymbol = _emitPrivateNameSymbol(currentLibrary, last);
+        return js.call('new #.es6(#, #)',
+            [_emitConstructorAccess(symbolClass.type), name, nativeSymbol]);
+      } else {
+        return js
+            .call('#.new(#)', [_emitConstructorAccess(types.symbolType), name]);
+      }
     }
 
     return _emitConst(emitSymbol);
@@ -5031,7 +5265,7 @@
         _declareBeforeUse(_jsArray);
         if (isConst) {
           var typeRep = _emitType(elementType);
-          list = js.call('dart.constList(#, #)', [list, typeRep]);
+          list = _callHelper('constList(#, #)', [list, typeRep]);
         } else {
           // Call `new JSArray<E>.of(list)`
           var jsArrayType = _jsArray.type.instantiate(type.typeArguments);
@@ -5077,7 +5311,7 @@
       if (reifyTypeArgs) {
         types.addAll(typeArgs.map((e) => _emitType(e)));
       }
-      return js.call('dart.map(#, #)', [mapArguments, types]);
+      return _callHelper('map(#, #)', [mapArguments, types]);
     }
 
     if (node.constKeyword != null) return _emitConst(emitMap);
@@ -5095,7 +5329,7 @@
   @override
   JS.Expression visitStringInterpolation(StringInterpolation node) {
     return new JS.TaggedTemplate(
-        js.call('dart.str'), new JS.TemplateString(_visitList(node.elements)));
+        _callHelper('str'), new JS.TemplateString(_visitList(node.elements)));
   }
 
   @override
@@ -5117,7 +5351,7 @@
       _unimplementedCall('Unimplemented ${node.runtimeType}: $node');
 
   JS.Expression _unimplementedCall(String comment) {
-    return js.call('dart.throw(#)', [js.escapedString(comment)]);
+    return _callHelper('throw(#)', [js.escapedString(comment)]);
   }
 
   @override
@@ -5174,10 +5408,10 @@
     }
     if (node is AsExpression && CoercionReifier.isImplicitCast(node)) {
       assert(node.staticType == types.boolType);
-      return js.call('dart.test(#)', _visit(node.expression));
+      return _callHelper('test(#)', _visit(node.expression));
     }
     JS.Expression result = _visit(node);
-    if (isNullable(node)) result = js.call('dart.test(#)', result);
+    if (isNullable(node)) result = _callHelper('test(#)', result);
     return result;
   }
 
@@ -5185,7 +5419,7 @@
   ///
   /// Unlike call sites, we always have an element available, so we can use it
   /// directly rather than computing the relevant options for [_emitMemberName].
-  JS.Expression _elementMemberName(ExecutableElement e, {bool useExtension}) {
+  JS.Expression _declareMemberName(ExecutableElement e, {bool useExtension}) {
     String name;
     if (e is PropertyAccessorElement) {
       name = e.variable.name;
@@ -5193,10 +5427,9 @@
       name = e.name;
     }
     return _emitMemberName(name,
-        type: (e.enclosingElement as ClassElement).type,
-        unary: e.parameters.isEmpty,
         isStatic: e.isStatic,
-        useExtension: useExtension);
+        useExtension:
+            useExtension ?? _extensionTypes.isNativeClass(e.enclosingElement));
   }
 
   /// This handles member renaming for private names and operators.
@@ -5234,34 +5467,41 @@
   /// This follows the same pattern as ECMAScript 6 Map:
   /// <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map>
   ///
-  /// Unary minus looks like: `x['unary-']()`. Note that [unary] must be passed
-  /// for this transformation to happen, otherwise binary minus is assumed.
+  /// Unary minus looks like: `x._negate()`.
   ///
   /// Equality is a bit special, it is generated via the Dart `equals` runtime
   /// helper, that checks for null. The user defined method is called '=='.
   ///
   JS.Expression _emitMemberName(String name,
       {DartType type,
-      bool unary: false,
       bool isStatic: false,
-      bool useExtension}) {
-    // Static members skip the rename steps.
-    if (isStatic) return _propertyName(name);
+      bool useExtension,
+      Element element}) {
+    // Static members skip the rename steps and may require JS interop renames.
+    if (isStatic) {
+      return _emitJSInteropStaticMemberName(element) ?? _propertyName(name);
+    }
 
     if (name.startsWith('_')) {
       return _emitPrivateNameSymbol(currentLibrary, name);
     }
 
-    if (name == '[]') {
-      name = 'get';
-    } else if (name == '[]=') {
-      name = 'set';
-    } else if (name == '-' && unary) {
-      name = 'unary-';
-    } else if (name == 'constructor' || name == 'prototype') {
-      // This uses an illegal (in Dart) character for a member, avoiding the
-      // conflict. We could use practically any character for this.
-      name = '+$name';
+    // When generating synthetic names, we use _ as the prefix, since Dart names
+    // won't have this (eliminated above), nor will static names reach here.
+    switch (name) {
+      case '[]':
+        name = '_get';
+        break;
+      case '[]=':
+        name = '_set';
+        break;
+      case 'unary-':
+        name = '_negate';
+        break;
+      case 'constructor':
+      case 'prototype':
+        name = '_$name';
+        break;
     }
 
     var result = _propertyName(name);
@@ -5277,7 +5517,9 @@
           !isObjectMember(name);
     }
 
-    return useExtension ? js.call('dartx.#', result) : result;
+    return useExtension
+        ? js.call('#.#', [_extensionSymbolsModule, result])
+        : result;
   }
 
   JS.TemporaryId _emitPrivateNameSymbol(LibraryElement library, String name) {
@@ -5380,6 +5622,26 @@
     }
   }
 
+  JS.Expression _callHelper(String code, [args]) {
+    if (args is List) {
+      args.insert(0, _runtimeModule);
+    } else if (args != null) {
+      args = [_runtimeModule, args];
+    } else {
+      args = _runtimeModule;
+    }
+    return js.call('#.$code', args);
+  }
+
+  JS.Statement _callHelperStatement(String code, args) {
+    if (args is List) {
+      args.insert(0, _runtimeModule);
+    } else {
+      args = [_runtimeModule, args];
+    }
+    return js.statement('#.$code', args);
+  }
+
   /// Maps whitelisted files to a list of whitelisted methods
   /// within the file.
   ///
@@ -5494,3 +5756,23 @@
 
 bool _isDartRuntime(LibraryElement l) =>
     l.isInSdk && l.source.uri.toString() == 'dart:_runtime';
+
+/// Returns `true` if [target] is a prefix for a deferred library and [name]
+/// is "loadLibrary".
+///
+/// If so, the expression should be compiled to call the runtime's
+/// "loadLibrary" helper function.
+bool _isDeferredLoadLibrary(Expression target, SimpleIdentifier name) {
+  if (name.name != "loadLibrary") return false;
+
+  if (target is! SimpleIdentifier) return false;
+  var targetIdentifier = target as SimpleIdentifier;
+
+  if (targetIdentifier.staticElement is! PrefixElement) return false;
+  var prefix = targetIdentifier.staticElement as PrefixElement;
+
+  // The library the prefix is referring to must come from a deferred import.
+  var containingLibrary = (target.root as CompilationUnit).element.library;
+  var imports = containingLibrary.getImportsWithPrefix(prefix);
+  return imports.length == 1 && imports[0].isDeferred;
+}
diff --git a/pkg/dev_compiler/lib/src/compiler/command.dart b/pkg/dev_compiler/lib/src/compiler/command.dart
index eff733c..221e7d4 100644
--- a/pkg/dev_compiler/lib/src/compiler/command.dart
+++ b/pkg/dev_compiler/lib/src/compiler/command.dart
@@ -10,12 +10,12 @@
 import 'package:args/command_runner.dart' show UsageException;
 import 'package:path/path.dart' as path;
 
-import '../analyzer/context.dart' show AnalyzerOptions;
+import '../analyzer/context.dart' show AnalyzerOptions, parseDeclaredVariables;
 import 'compiler.dart' show BuildUnit, CompilerOptions, ModuleCompiler;
 import 'module_builder.dart';
 
 final ArgParser _argParser = () {
-  var argParser = new ArgParser()
+  var argParser = new ArgParser(allowTrailingOptions: true)
     ..addFlag('help', abbr: 'h', help: 'Display this message.')
     ..addOption('out',
         abbr: 'o', allowMultiple: true, help: 'Output file (required).')
@@ -41,14 +41,15 @@
 int compile(List<String> args, {void printFn(Object obj)}) {
   printFn ??= print;
   ArgResults argResults;
+  var declaredVars = <String, String>{};
   try {
-    argResults = _argParser.parse(args);
+    argResults = _argParser.parse(parseDeclaredVariables(args, declaredVars));
   } on FormatException catch (error) {
     printFn('$error\n\n$_usageMessage');
     return 64;
   }
   try {
-    _compile(argResults, printFn);
+    _compile(argResults, declaredVars, printFn);
     return 0;
   } on UsageException catch (error) {
     // Incorrect usage, input file not found, etc.
@@ -81,14 +82,24 @@
   }
 }
 
-void _compile(ArgResults argResults, void printFn(Object obj)) {
-  var compiler =
-      new ModuleCompiler(new AnalyzerOptions.fromArguments(argResults));
-  var compilerOpts = new CompilerOptions.fromArguments(argResults);
+bool _changed(List<int> list1, List<int> list2) {
+  var length = list1.length;
+  if (length != list2.length) return true;
+  for (var i = 0; i < length; ++i) {
+    if (list1[i] != list2[i]) return true;
+  }
+  return false;
+}
+
+void _compile(ArgResults argResults, Map<String, String> declaredVars,
+    void printFn(Object obj)) {
   if (argResults['help']) {
     printFn(_usageMessage);
     return;
   }
+  var compiler = new ModuleCompiler(
+      new AnalyzerOptions.fromArguments(argResults, declaredVars));
+  var compilerOpts = new CompilerOptions.fromArguments(argResults);
   var outPaths = argResults['out'] as List<String>;
   var moduleFormats = parseModuleFormatOption(argResults);
   bool singleOutFile = argResults['single-out-file'];
@@ -145,12 +156,25 @@
 
   // Write JS file, as well as source map and summary (if requested).
   for (var i = 0; i < outPaths.length; i++) {
-    var outPath = outPaths[i];
-    module.writeCodeSync(moduleFormats[i], singleOutFile, outPath);
-    if (module.summaryBytes != null) {
-      var summaryPath =
-          path.withoutExtension(outPath) + '.${compilerOpts.summaryExtension}';
-      new File(summaryPath).writeAsBytesSync(module.summaryBytes);
+    module.writeCodeSync(moduleFormats[i], outPaths[i],
+        singleOutFile: singleOutFile);
+  }
+  if (module.summaryBytes != null) {
+    var summaryPaths = compilerOpts.summaryOutPath != null
+        ? [compilerOpts.summaryOutPath]
+        : outPaths.map((p) =>
+            '${path.withoutExtension(p)}.${compilerOpts.summaryExtension}');
+
+    // place next to every compiled module
+    for (var summaryPath in summaryPaths) {
+      // Only overwrite if summary changed.  This plays better with timestamp
+      // based build systems.
+      var file = new File(summaryPath);
+      if (!file.existsSync() ||
+          _changed(file.readAsBytesSync(), module.summaryBytes)) {
+        if (!file.parent.existsSync()) file.parent.createSync(recursive: true);
+        file.writeAsBytesSync(module.summaryBytes);
+      }
     }
   }
 }
diff --git a/pkg/dev_compiler/lib/src/compiler/compiler.dart b/pkg/dev_compiler/lib/src/compiler/compiler.dart
index e789bca..ea67648 100644
--- a/pkg/dev_compiler/lib/src/compiler/compiler.dart
+++ b/pkg/dev_compiler/lib/src/compiler/compiler.dart
@@ -16,6 +16,7 @@
     show Source, SourceKind, UriResolver;
 import 'package:analyzer/src/summary/package_bundle_reader.dart'
     show InSummarySource, InputPackagesResultProvider, SummaryDataStore;
+import 'package:analyzer/src/error/codes.dart' show StaticTypeWarningCode;
 import 'package:args/args.dart' show ArgParser, ArgResults;
 import 'package:args/src/usage_exception.dart' show UsageException;
 import 'package:func/func.dart' show Func1;
@@ -93,10 +94,27 @@
     context.typeProvider = sdkResolver.dartSdk.context.typeProvider;
     context.resultProvider =
         new InputPackagesResultProvider(context, summaryData);
+    options.declaredVariables.forEach(context.declaredVariables.define);
+    context.declaredVariables.define('dart.isVM', 'false');
 
     return new ModuleCompiler.withContext(context, summaryData);
   }
 
+  bool _isFatalError(AnalysisError e, CompilerOptions options) {
+    if (errorSeverity(context, e) != ErrorSeverity.ERROR) return false;
+
+    // These errors are not fatal in the REPL compile mode as we
+    // allow access to private members across library boundaries
+    // and those accesses will show up as undefined members unless
+    // additional analyzer changes are made to support them.
+    // TODO(jacobr): consider checking that the identifier name
+    // referenced by the error is private.
+    return !options.replCompile ||
+        (e.errorCode != StaticTypeWarningCode.UNDEFINED_GETTER &&
+            e.errorCode != StaticTypeWarningCode.UNDEFINED_SETTER &&
+            e.errorCode != StaticTypeWarningCode.UNDEFINED_METHOD);
+  }
+
   /// Compiles a single Dart build unit into a JavaScript module.
   ///
   /// *Warning* - this may require resolving the entire world.
@@ -159,6 +177,7 @@
     }
 
     sortErrors(context, errors);
+
     var messages = <String>[];
     for (var e in errors) {
       var m = formatError(context, e);
@@ -166,10 +185,9 @@
     }
 
     if (!options.unsafeForceCompile &&
-        errors.any((e) => errorSeverity(context, e) == ErrorSeverity.ERROR)) {
+        errors.any((e) => _isFatalError(e, options))) {
       return new JSModuleFile.invalid(unit.name, messages, options);
     }
-
     var codeGenerator =
         new CodeGenerator(context, summaryData, options, _extensionTypes);
     return codeGenerator.compile(unit, trees, messages);
@@ -204,6 +222,10 @@
   /// Whether to force compilation of code with static errors.
   final bool unsafeForceCompile;
 
+  /// Whether to compile code in a more permissive REPL mode allowing access
+  /// to private members across library boundaries.
+  final bool replCompile;
+
   /// Whether to emit Closure Compiler-friendly code.
   final bool closure;
 
@@ -241,6 +263,10 @@
   /// source maps.
   final Map<String, String> bazelMapping;
 
+  /// If specified, the path to write the summary file.
+  /// Used when building the SDK.
+  final String summaryOutPath;
+
   const CompilerOptions(
       {this.sourceMap: true,
       this.sourceMapComment: true,
@@ -248,6 +274,7 @@
       this.summarizeApi: true,
       this.summaryExtension: 'sum',
       this.unsafeForceCompile: false,
+      this.replCompile: false,
       this.emitMetadata: false,
       this.closure: false,
       this.destructureNamedParams: false,
@@ -256,7 +283,8 @@
       this.nameTypeTests: true,
       this.hoistTypeTests: true,
       this.useAngular2Whitelist: false,
-      this.bazelMapping: const {}});
+      this.bazelMapping: const {},
+      this.summaryOutPath});
 
   CompilerOptions.fromArguments(ArgResults args)
       : sourceMap = args['source-map'],
@@ -265,6 +293,7 @@
         summarizeApi = args['summarize'],
         summaryExtension = args['summary-extension'],
         unsafeForceCompile = args['unsafe-force-compile'],
+        replCompile = args['repl-compile'],
         emitMetadata = args['emit-metadata'],
         closure = args['closure-experimental'],
         destructureNamedParams = args['destructure-named-params'],
@@ -273,7 +302,8 @@
         nameTypeTests = args['name-type-tests'],
         hoistTypeTests = args['hoist-type-tests'],
         useAngular2Whitelist = args['unsafe-angular2-whitelist'],
-        bazelMapping = _parseBazelMappings(args['bazel-mapping']);
+        bazelMapping = _parseBazelMappings(args['bazel-mapping']),
+        summaryOutPath = args['summary-out'];
 
   static void addArguments(ArgParser parser) {
     parser
@@ -303,6 +333,11 @@
               'This has undefined behavior!',
           defaultsTo: false,
           hide: true)
+      ..addFlag('repl-compile',
+          help: 'Compile code more permissively when in REPL mode allowing '
+              'access to private members across library boundaries.',
+          defaultsTo: false,
+          hide: true)
       ..addFlag('hoist-instance-creation',
           help: 'Hoist the class type from generic instance creations',
           defaultsTo: true,
@@ -322,7 +357,9 @@
               'to/library.dart as the path for library.dart in source maps.',
           allowMultiple: true,
           splitCommas: false,
-          hide: true);
+          hide: true)
+      ..addOption('summary-out',
+          help: 'location to write the summary file', hide: true);
   }
 
   static Map<String, String> _parseBazelMappings(Iterable argument) {
@@ -400,8 +437,8 @@
   //
   // TODO(jmesserly): this should match our old logic, but I'm not sure we are
   // correctly handling the pointer from the .js file to the .map file.
-  JSModuleCode getCode(
-      ModuleFormat format, bool singleOutFile, String jsUrl, String mapUrl) {
+  JSModuleCode getCode(ModuleFormat format, String jsUrl, String mapUrl,
+      {bool singleOutFile: false}) {
     var opts = new JS.JavaScriptPrintingOptions(
         emitTypes: options.closure,
         allowKeywordsInProperties: true,
@@ -416,7 +453,8 @@
       printer = new JS.SimpleJavaScriptPrintingContext();
     }
 
-    var tree = transformModuleFormat(format, singleOutFile, moduleTree);
+    var tree =
+        transformModuleFormat(format, moduleTree, singleOutFile: singleOutFile);
     tree.accept(
         new JS.Printer(opts, printer, localNamer: new JS.TemporaryNamer(tree)));
 
@@ -450,24 +488,35 @@
   ///
   /// If [mapPath] is not supplied but [options.sourceMap] is set, mapPath
   /// will default to [jsPath].map.
-  void writeCodeSync(ModuleFormat format, bool singleOutFile, String jsPath) {
+  void writeCodeSync(ModuleFormat format, String jsPath,
+      {bool singleOutFile: false}) {
     String mapPath = jsPath + '.map';
-    var code = getCode(format, singleOutFile, jsPath, mapPath);
+    var code = getCode(format, jsPath, mapPath, singleOutFile: singleOutFile);
     var c = code.code;
     if (singleOutFile) {
       // In singleOutFile mode we wrap each module in an eval statement to
       // leverage sourceURL to improve the debugging experience when source maps
       // are not enabled.
-      c += '\n//# sourceURL=${name}.js\n';
+      //
+      // Note: We replace all `/` with `.` so that we don't break relative urls
+      // to sources in the original sourcemap. The name of this file is bogus
+      // anyways, so it has very little effect on things.
+      c += '\n//# sourceURL=${name.replaceAll("/", ".")}.js\n';
       c = 'eval(${JSON.encode(c)});\n';
     }
-    new File(jsPath).writeAsStringSync(c);
+
+    var file = new File(jsPath);
+    if (!file.parent.existsSync()) file.parent.createSync(recursive: true);
+    file.writeAsStringSync(c);
+
     // TODO(jacobr): it is a bit strange we are writing the source map to a file
     // even when options.inlineSourceMap is true. To be consistent perhaps we
     // should also write a copy of the source file without a sourcemap even when
     // inlineSourceMap is true.
     if (code.sourceMap != null) {
-      new File(mapPath).writeAsStringSync(JSON.encode(code.sourceMap));
+      file = new File(mapPath);
+      if (!file.parent.existsSync()) file.parent.createSync(recursive: true);
+      file.writeAsStringSync(JSON.encode(code.sourceMap));
     }
   }
 }
diff --git a/pkg/dev_compiler/lib/src/compiler/element_helpers.dart b/pkg/dev_compiler/lib/src/compiler/element_helpers.dart
index 053227d..7f4576d 100644
--- a/pkg/dev_compiler/lib/src/compiler/element_helpers.dart
+++ b/pkg/dev_compiler/lib/src/compiler/element_helpers.dart
@@ -51,7 +51,7 @@
 ///
 DartObject findAnnotation(Element element, bool test(DartObjectImpl value)) {
   for (var metadata in element.metadata) {
-    var value = metadata.constantValue;
+    var value = metadata.computeConstantValue();
     if (value != null && test(value)) return value;
   }
   return null;
diff --git a/pkg/dev_compiler/lib/src/compiler/js_field_storage.dart b/pkg/dev_compiler/lib/src/compiler/js_field_storage.dart
index decef3b..13d5980 100644
--- a/pkg/dev_compiler/lib/src/compiler/js_field_storage.dart
+++ b/pkg/dev_compiler/lib/src/compiler/js_field_storage.dart
@@ -30,10 +30,6 @@
     var setter = superprop.setter;
     bool hasSetter = setter != null && !setter.isAbstract;
     if (hasSetter) foundSetter = true;
-
-    // Stop if this is an abstract getter/setter
-    // TODO(jmesserly): why were we doing this?
-    if (!hasGetter && !hasSetter) break;
   }
 
   return new PropertyOverrideResult(foundGetter, foundSetter);
diff --git a/pkg/dev_compiler/lib/src/compiler/module_builder.dart b/pkg/dev_compiler/lib/src/compiler/module_builder.dart
index 828a0fa..0fd990c 100644
--- a/pkg/dev_compiler/lib/src/compiler/module_builder.dart
+++ b/pkg/dev_compiler/lib/src/compiler/module_builder.dart
@@ -65,9 +65,10 @@
         allowMultiple: allowMultiple,
         defaultsTo: 'amd')
     ..addFlag('single-out-file',
-        help: 'emit output so that libraries can be concatenated together into '
-            'a single file. Only compatible with legacy and amd module formats.',
-        defaultsTo: false);
+        help: 'emit modules that can be concatenated into one file.\n'
+            'Only compatible with legacy and amd module formats.',
+        defaultsTo: false,
+        hide: true);
 }
 
 /// Transforms an ES6 [module] into a given module [format].
@@ -78,17 +79,21 @@
 /// structure as possible with the original. The transformation is a shallow one
 /// that affects the top-level module items, especially [ImportDeclaration]s and
 /// [ExportDeclaration]s.
-Program transformModuleFormat(
-    ModuleFormat format, bool singleOutFile, Program module) {
+Program transformModuleFormat(ModuleFormat format, Program module,
+    {bool singleOutFile: false}) {
   switch (format) {
     case ModuleFormat.legacy:
-      return new LegacyModuleBuilder(singleOutFile).build(module);
+      // Legacy format always generates output compatible with single file mode.
+      return new LegacyModuleBuilder().build(module);
     case ModuleFormat.common:
-      return new CommonJSModuleBuilder(singleOutFile).build(module);
+      assert(!singleOutFile);
+      return new CommonJSModuleBuilder().build(module);
     case ModuleFormat.amd:
-      return new AmdModuleBuilder(singleOutFile).build(module);
+      // TODO(jmesserly): encode singleOutFile as a module format?
+      // Since it's irrelevant except for AMD.
+      return new AmdModuleBuilder(singleOutFile: singleOutFile).build(module);
     case ModuleFormat.es6:
-      assert(singleOutFile == false);
+      assert(!singleOutFile);
       return module;
   }
   return null; // unreachable. suppresses a bogus analyzer message
@@ -137,10 +142,6 @@
 /// Generates modules for with our legacy `dart_library.js` loading mechanism.
 // TODO(jmesserly): remove this and replace with something that interoperates.
 class LegacyModuleBuilder extends _ModuleBuilder {
-  /// The legacy module format always generates output compatible with a single
-  /// file mode.
-  LegacyModuleBuilder(bool singleOutFile);
-
   Program build(Program module) {
     // Collect imports/exports/statements.
     visitProgram(module);
@@ -198,14 +199,6 @@
 
 /// Generates CommonJS modules (used by Node.js).
 class CommonJSModuleBuilder extends _ModuleBuilder {
-  final bool singleOutFile;
-
-  CommonJSModuleBuilder(this.singleOutFile) {
-    // singleOutFile mode is not currently supported by the CommonJS module
-    // builder.
-    assert(singleOutFile == false);
-  }
-
   Program build(Program module) {
     var importStatements = <Statement>[];
 
@@ -257,7 +250,7 @@
 class AmdModuleBuilder extends _ModuleBuilder {
   final bool singleOutFile;
 
-  AmdModuleBuilder(this.singleOutFile);
+  AmdModuleBuilder({this.singleOutFile: false});
 
   Program build(Program module) {
     var importStatements = <Statement>[];
diff --git a/pkg/dev_compiler/lib/src/compiler/side_effect_analysis.dart b/pkg/dev_compiler/lib/src/compiler/side_effect_analysis.dart
index 5da18ea..499cb86 100644
--- a/pkg/dev_compiler/lib/src/compiler/side_effect_analysis.dart
+++ b/pkg/dev_compiler/lib/src/compiler/side_effect_analysis.dart
@@ -8,7 +8,7 @@
 import 'package:analyzer/src/generated/constant.dart';
 import 'package:analyzer/error/listener.dart'
     show AnalysisErrorListener, ErrorReporter;
-import 'package:analyzer/src/generated/resolver.dart' show TypeProvider;
+import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source.dart' show Source;
 import 'package:analyzer/src/dart/ast/ast.dart';
 
@@ -105,12 +105,12 @@
 }
 
 class ConstFieldVisitor {
-  final ConstantVisitor _constantVisitor;
+  final ConstantVisitor constantVisitor;
 
-  ConstFieldVisitor(TypeProvider types, {Source dummySource})
-      // TODO(jmesserly): support -D variables on the command line
-      : _constantVisitor = new ConstantVisitor(
-            new ConstantEvaluationEngine(types, new DeclaredVariables()),
+  ConstFieldVisitor(AnalysisContext context, {Source dummySource})
+      : constantVisitor = new ConstantVisitor(
+            new ConstantEvaluationEngine(
+                context.typeProvider, context.declaredVariables),
             new ErrorReporter(
                 AnalysisErrorListener.NULL_LISTENER, dummySource));
 
@@ -134,6 +134,6 @@
 
     var initializer = field.initializer;
     if (initializer == null) return null;
-    return initializer.accept(_constantVisitor);
+    return initializer.accept(constantVisitor);
   }
 }
diff --git a/pkg/dev_compiler/lib/src/compiler/type_utilities.dart b/pkg/dev_compiler/lib/src/compiler/type_utilities.dart
index 27abedd3..7632f08 100644
--- a/pkg/dev_compiler/lib/src/compiler/type_utilities.dart
+++ b/pkg/dev_compiler/lib/src/compiler/type_utilities.dart
@@ -122,13 +122,17 @@
 class _GeneratorTable extends _CacheTable {
   final _defs = new HashMap<DartType, JS.Expression>();
 
+  final JS.Identifier _runtimeModule;
+
+  _GeneratorTable(this._runtimeModule);
+
   JS.Statement _dischargeType(DartType t) {
     var name = _names.remove(t);
     if (name != null) {
       JS.Expression init = _defs.remove(t);
       assert(init != null);
-      return js.statement(
-          'let # = () => ((# = dart.constFn(#))());', [name, name, init]);
+      return js.statement('let # = () => ((# = #.constFn(#))());',
+          [name, name, _runtimeModule, init]);
     }
     return null;
   }
@@ -154,10 +158,10 @@
   final _definiteCacheNames = new _CacheTable();
 
   /// Generator variable names for hoisted types.
-  final _generators = new _GeneratorTable();
+  final _GeneratorTable _generators;
 
   /// Generator variable names for hoisted definite function types.
-  final _definiteGenerators = new _GeneratorTable();
+  final _GeneratorTable _definiteGenerators;
 
   /// Mapping from type parameters to the types which must have their
   /// cache/generator variables discharged at the binding site for the
@@ -166,6 +170,10 @@
   final _scopeDependencies =
       new HashMap<TypeParameterElement, List<DartType>>();
 
+  TypeTable(JS.Identifier runtime)
+      : _generators = new _GeneratorTable(runtime),
+        _definiteGenerators = new _GeneratorTable(runtime);
+
   /// Emit a list of statements declaring the cache variables and generator
   /// definitions tracked by the table.  If [formals] is present, only
   /// emit the definitions which depend on the formals.
diff --git a/pkg/dev_compiler/lib/src/js_ast/js_ast.dart b/pkg/dev_compiler/lib/src/js_ast/js_ast.dart
index 68c706a..21eadd3 100644
--- a/pkg/dev_compiler/lib/src/js_ast/js_ast.dart
+++ b/pkg/dev_compiler/lib/src/js_ast/js_ast.dart
@@ -11,7 +11,6 @@
 part 'nodes.dart';
 part 'builder.dart';
 part 'js_types.dart';
-part 'module_transform.dart';
 part 'printer.dart';
 part 'template.dart';
 part 'type_printer.dart';
diff --git a/pkg/dev_compiler/lib/src/js_ast/module_transform.dart b/pkg/dev_compiler/lib/src/js_ast/module_transform.dart
deleted file mode 100644
index d8749db..0000000
--- a/pkg/dev_compiler/lib/src/js_ast/module_transform.dart
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
-// for 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 js_ast;
-
-/**
- * Transforms ECMAScript 6 modules to an ES 5 file using a module pattern.
- *
- * There are various module patterns in JavaScript, see
- * <http://babeljs.io/docs/usage/modules/> for some examples.
- *
- * At the moment, we only support our "custom Dart" conversion, roughly similar
- * to Asynchronous Module Definition (AMD), see also
- * <http://requirejs.org/docs/whyamd.html>. Like AMD, module files can
- * be loaded directly in the browser with no further transformation (e.g.
- * browserify, webpack).
- */
-// TODO(jmesserly): deprecate the "custom dart" form in favor of AMD.
-class CustomDartModuleTransform extends BaseVisitor {
-  // TODO(jmesserly): implement these. Module should transform to Program.
-  visitImportDeclaration(ImportDeclaration node) {}
-  visitExportDeclaration(ExportDeclaration node) {}
-  visitModule(Module node) {}
-}
diff --git a/pkg/dev_compiler/package.json b/pkg/dev_compiler/package.json
index 0c3ef0b..2616c06 100644
--- a/pkg/dev_compiler/package.json
+++ b/pkg/dev_compiler/package.json
@@ -18,6 +18,7 @@
   "devDependencies": {
     "chai": "^2.2.0",
     "electron-prebuilt": "^0.36.0",
+    "is_js": "^0.9.0",
     "karma": "^0.12.31",
     "karma-chai": "^0.1.0",
     "karma-chrome-launcher": "^0.1.8",
diff --git a/pkg/dev_compiler/test-main.js b/pkg/dev_compiler/test-main.js
index fe330b7..bcb70fe 100644
--- a/pkg/dev_compiler/test-main.js
+++ b/pkg/dev_compiler/test-main.js
@@ -52,9 +52,11 @@
     expect: 'gen/codegen_output/pkg/expect',
     js: 'gen/codegen_output/pkg/js',
     matcher: 'gen/codegen_output/pkg/matcher',
+    minitest: 'gen/codegen_output/pkg/minitest',
     path: 'gen/codegen_output/pkg/path',
     stack_trace: 'gen/codegen_output/pkg/stack_trace',
     unittest: 'gen/codegen_output/pkg/unittest',
+    is: 'node_modules/is_js/is',
   },
 
   // Require all test files before starting tests.
diff --git a/pkg/dev_compiler/test/browser/language_tests.js b/pkg/dev_compiler/test/browser/language_tests.js
index 5922544..6cf5f8f 100644
--- a/pkg/dev_compiler/test/browser/language_tests.js
+++ b/pkg/dev_compiler/test/browser/language_tests.js
@@ -2,17 +2,19 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-define(['dart_sdk', 'async_helper', 'unittest', 'require'],
-      function(dart_sdk, async_helper, unittest, require) {
+define(['dart_sdk', 'async_helper', 'expect', 'unittest', 'is', 'require'],
+      function(dart_sdk, async_helper, expect, unittest, is, require) {
   'use strict';
 
   async_helper = async_helper.async_helper;
+  let minitest = expect.minitest;
 
   dart_sdk._isolate_helper.startRootIsolate(function() {}, []);
   let html_config = unittest.html_config;
   // Test attributes are a list of strings, or a string for a single
   // attribute. Valid attributes are:
   //
+  //   'pass' - test passes (default)
   //   'skip' - don't run the test
   //   'fail' - test fails
   //   'timeout' - test times out
@@ -21,14 +23,26 @@
   //   'unittest' - run separately as a unittest test.
   //
   // Common combinations:
+  const pass = 'pass';
   const fail = 'fail';
   const skip_fail = ['skip', 'fail'];
   const skip_timeout = ['skip', 'timeout'];
 
+  // Browsers
+  const firefox_fail = is.firefox() ? fail : pass;
+  const chrome_fail = is.chrome() ? fail : pass;
+
+  // Tests marked with this are still using the deprecated unittest package
+  // because they rely on its support for futures and asynchronous tests, which
+  // expect and minitest do not handle.
+  // TODO(rnystrom): Move all of these away from using the async test API so
+  // they can stop using unittest.
+  const async_unittest = ['unittest', 'skip', 'fail'];
+
   // The number of expected unittest errors should be zero but unfortunately
   // there are a lot of broken html unittests.
   let num_expected_unittest_fails = 3;
-  let num_expected_unittest_errors = 2;
+  let num_expected_unittest_errors = 0;
 
   // TODO(jmesserly): separate StrongModeError from other errors.
   let all_status = {
@@ -36,6 +50,7 @@
       'assert_with_type_test_or_cast_test': skip_fail,
       'assertion_test': skip_fail,
       'async_await_test_none_multi': 'unittest',
+      'async_await_test_02_multi': 'unittest',
       'async_await_test_03_multi': skip_fail,  // Flaky on travis (#634)
       'async_star_await_pauses_test': skip_fail,
 
@@ -109,22 +124,15 @@
       'cyclic_type_test_03_multi': skip_fail,
       'cyclic_type_test_04_multi': skip_fail,
       'cyclic_type_variable_test_none_multi': skip_fail,
+
+      // Deferred libraries are not actually deferred. These tests all test
+      // that synchronous access to the library fails.
       'deferred_call_empty_before_load_test': skip_fail,
-      'deferred_closurize_load_library_test': skip_fail,
-      'deferred_constant_list_test': skip_fail,
-      'deferred_function_type_test': skip_fail,
-      'deferred_inlined_test': skip_fail,
-      'deferred_load_inval_code_test': skip_fail,
-      'deferred_mixin_test': skip_fail,
-      'deferred_no_such_method_test': skip_fail, // deferred libs not implemented
       'deferred_not_loaded_check_test': skip_fail,
-      'deferred_only_constant_test': skip_fail,
-      'deferred_optimized_test': skip_fail,
       'deferred_redirecting_factory_test': skip_fail,
-      'deferred_regression_22995_test': skip_fail,
-      'deferred_shadow_load_library_test': skip_fail,
-      'deferred_shared_and_unshared_classes_test': skip_fail,
       'deferred_static_seperate_test': skip_fail,
+
+      'deferred_regression_22995_test': skip_fail, // Strong mode "is" rejects some type tests.
       'double_int_to_string_test': skip_fail,
       'double_to_string_test': skip_fail,
       'dynamic_test': skip_fail,
@@ -248,6 +256,7 @@
       'mixin_type_parameter3_test': skip_fail,
       'modulo_test': fail,
       'named_parameter_clash_test': skip_fail,
+      'named_parameters_passing_falsy_test': firefox_fail,
       'nan_identical_test': skip_fail,
       'nested_switch_label_test': skip_fail,
       'number_identifier_test_05_multi': skip_fail,
@@ -259,6 +268,7 @@
       'regress_13462_1_test': skip_fail,
       'regress_14105_test': skip_fail,
       'regress_16640_test': skip_fail,
+      'regress_18535_test': fail,
       'regress_21795_test': skip_fail,
       'regress_22443_test': skip_fail,
       'regress_22666_test': skip_fail,
@@ -333,8 +343,10 @@
       'const_list_remove_range_test': fail,
       'const_list_set_range_test': fail,
       'double_parse_test_01_multi': fail,
+      'double_parse_test_02_multi': firefox_fail,
       'error_stack_trace1_test': fail,
       'error_stack_trace2_test': fail,
+      'for_in_test': firefox_fail,
       'hash_map2_test': skip_timeout,
       'hash_set_test_01_multi': fail,
       'hidden_library2_test_01_multi': fail,
@@ -357,22 +369,28 @@
       'main_test': fail,
       'map_keys2_test': fail,
       'map_to_string_test': fail,
+      'map_from_iterable_test': firefox_fail,
       'nan_infinity_test_01_multi': fail,
       'null_nosuchmethod_test': fail,
       'null_test': fail,
       'num_sign_test': fail,
       'regress_r21715_test': fail,
       'throw_half_surrogate_pair_test_02_multi': fail,
-      'stacktrace_current_test': fail,
+      'splay_tree_from_iterable_test': firefox_fail,
+      'stacktrace_current_test': chrome_fail,
+      'string_case_test_01_multi': firefox_fail,
       'string_fromcharcodes_test': skip_timeout,
       'string_operations_with_null_test': fail,
       'symbol_reserved_word_test_06_multi': fail,
       'symbol_reserved_word_test_09_multi': fail,
       'symbol_reserved_word_test_12_multi': fail,
       'throw_half_surrogate_pair_test_01_multi': fail,
+      'unicode_test': firefox_fail,
+      'uri_parameters_all_test': firefox_fail,
       // TODO(rnystrom): Times out because it tests a huge number of
       // combinations of URLs (4 * 5 * 5 * 8 * 6 * 6 * 4 = 115200).
       'uri_parse_test': skip_timeout,
+      'uri_test': firefox_fail,
 
       'list_insert_test': fail,
       'list_removeat_test': fail,
@@ -380,7 +398,11 @@
     },
 
     'corelib/regexp': {
-      'default_arguments_test': fail
+      'default_arguments_test': fail,
+      'UC16_test': firefox_fail,
+    },
+
+    'lib/collection': {
     },
 
     'lib/convert': {
@@ -390,10 +412,6 @@
       // newer SDKs.
       'html_escape_test': ['skip'],
 
-      // TODO(rnystrom): If this test is enabled, karma gets confused and
-      // disconnects randomly.
-      'json_lib_test': skip_fail,
-
       'json_utf8_chunk_test': skip_timeout,
       'latin1_test': skip_timeout,
 
@@ -405,183 +423,114 @@
       'utf85_test': skip_timeout,
     },
 
-    // TODO(jacobr): enable more of the html tests in unittest once they have
-    // more hope of passing. Triage tests that can never run in this test
-    // runner and track them separately.
     'lib/html': {
-      'async_spawnuri_test': ['unittest', 'skip', 'fail'],
-      'async_test': ['unittest', 'skip', 'fail'],
-      'audiobuffersourcenode_test': ['unittest', 'skip', 'fail'],
-      'audiocontext_test': ['unittest', 'skip', 'fail'],
-      'audioelement_test': ['unittest', 'skip', 'fail'],
-      'b_element_test': ['unittest', 'skip', 'fail'],
-      'blob_constructor_test': ['unittest', 'skip', 'fail'],
-      'cache_test': ['unittest', 'skip', 'fail'],
-      'callbacks_test': ['unittest', 'skip', 'fail'],
-      'canvas_pixel_array_type_alias_test': ['unittest'],
-      'canvasrenderingcontext2d_test': ['unittest'],
+      'async_spawnuri_test': async_unittest,
+      'async_test': async_unittest,
+      'audiocontext_test': is.chrome('<=55') ? fail : pass, // was sdk#27578, needs triage
+      'blob_constructor_test': 'fail', // was sdk#27578, needs triage
       'canvas_test': ['unittest'],
-      'cdata_test': ['unittest', 'skip', 'fail'],
-      'client_rect_test': ['unittest', 'skip', 'fail'],
-      'cross_domain_iframe_test': ['unittest', 'skip', 'fail'],
-      'cross_frame_test': ['unittest', 'skip', 'fail'],
-      'crypto_test': ['unittest', 'skip', 'fail'],
-      'css_rule_list_test': ['unittest', 'skip', 'fail'],
-      'cssstyledeclaration_test': ['unittest', 'skip', 'fail'],
-      'css_test': ['unittest', 'skip', 'fail'],
-      'custom_element_method_clash_test': ['unittest', 'skip', 'fail'],
-      'custom_element_name_clash_test': ['unittest', 'skip', 'fail'],
-      'custom_elements_23127_test': ['unittest', 'skip', 'fail'],
-      'custom_elements_test': ['unittest', 'skip', 'fail'],
-      'custom_tags_test': ['unittest', 'skip', 'fail'],
-      'dart_object_local_storage_test': ['unittest', 'skip', 'fail'],
-      'datalistelement_test': ['unittest', 'skip', 'fail'],
-      'documentfragment_test': ['unittest', 'skip', 'fail'],
-      'document_test': ['unittest'],
-      'dom_constructors_test': ['unittest', 'skip', 'fail'],
-      'domparser_test': ['unittest', 'skip', 'fail'],
-      'element_add_test': ['unittest', 'skip', 'fail'],
-      'element_animate_test': ['unittest', 'skip', 'fail'],
-      'element_classes_svg_test': ['unittest', 'skip', 'fail'],
-      'element_classes_test': ['unittest', 'skip', 'fail'],
-      'element_constructor_1_test': ['unittest', 'skip', 'fail'],
-      'element_dimensions_test': ['unittest', 'skip', 'fail'],
-      'element_offset_test': ['unittest', 'skip', 'fail'],
-      'element_test': ['unittest', 'skip', 'fail'],
-      'element_types_constructors1_test': ['unittest', 'skip', 'fail'],
-      'element_types_constructors2_test': ['unittest', 'skip', 'fail'],
-      'element_types_constructors3_test': ['unittest', 'skip', 'fail'],
-      'element_types_constructors4_test': ['unittest', 'skip', 'fail'],
-      'element_types_constructors5_test': ['unittest', 'skip', 'fail'],
-      'element_types_constructors6_test': ['unittest', 'skip', 'fail'],
-      'element_types_test': ['unittest', 'skip', 'fail'],
-      'event_customevent_test': ['unittest', 'skip', 'fail'],
-      'events_test': ['unittest', 'skip', 'fail'],
-      'event_test': ['unittest', 'skip', 'fail'],
-      'exceptions_test': ['unittest', 'skip', 'fail'],
-      'fileapi_test': ['unittest', 'skip', 'fail'],
-      'filereader_test': ['unittest', 'skip', 'fail'],
-      'filteredelementlist_test': ['unittest', 'skip', 'fail'],
-      'fontface_loaded_test': ['unittest', 'skip', 'fail'],
-      'fontface_test': ['unittest', 'skip', 'fail'],
-      'form_data_test': ['unittest', 'skip', 'fail'],
-      'form_element_test': ['unittest', 'skip', 'fail'],
-      'geolocation_test': ['unittest', 'skip', 'fail'],
-      'hidden_dom_1_test': ['unittest', 'skip', 'fail'],
-      'hidden_dom_2_test': ['unittest', 'skip', 'fail'],
-      'history_test': ['unittest', 'skip', 'fail'],
-      'htmlcollection_test': ['unittest', 'skip', 'fail'],
-      'htmlelement_test': ['unittest', 'skip', 'fail'],
-      'htmloptionscollection_test': ['unittest', 'skip', 'fail'],
-      'indexeddb_1_test': ['unittest', 'skip', 'fail'],
-      'indexeddb_2_test': ['unittest', 'skip', 'fail'],
-      'indexeddb_3_test': ['unittest', 'skip', 'fail'],
-      'indexeddb_4_test': ['unittest', 'skip', 'fail'],
-      'indexeddb_5_test': ['unittest', 'skip', 'fail'],
-      'input_element_test': ['unittest', 'skip', 'fail'],
-      'instance_of_test': ['unittest', 'skip', 'fail'],
-      'interactive_test': ['unittest', 'skip', 'fail'],
-      'isolates_test': ['unittest', 'skip', 'fail'],
-      'js_function_getter_test': 'unittest',
-      'js_function_getter_trust_types_test': 'unittest',
-      'js_interop_1_test': 'unittest',
-      'js_test': 'unittest',
-      'js_util_test': 'unittest',
-      'js_typed_interop_anonymous2_exp_test': 'unittest',
-      'js_typed_interop_anonymous2_test': 'unittest',
-      'js_typed_interop_anonymous_exp_test': 'unittest',
-      'js_typed_interop_anonymous_test': 'unittest',
-      'js_typed_interop_anonymous_unreachable_exp_test': 'unittest',
-      'js_typed_interop_anonymous_unreachable_test': 'unittest',
-      'js_typed_interop_default_arg_test': 'unittest',
-      'js_typed_interop_side_cast_exp_test': 'unittest',
-      'js_typed_interop_side_cast_test': 'unittest',
-      'js_typed_interop_test': ['unittest', 'skip', 'fail'],
-      'keyboard_event_test': ['unittest', 'skip', 'fail'],
-      'localstorage_test': ['unittest', 'skip', 'fail'],
-      'location_test': ['unittest', 'skip', 'fail'],
-      'mediasource_test': ['unittest', 'skip', 'fail'],
-      'media_stream_test': ['unittest', 'skip', 'fail'],
-      'messageevent_test': ['unittest', 'skip', 'fail'],
-      'mirrors_js_typed_interop_test': ['unittest', 'skip', 'fail'],
-      'mouse_event_test': ['unittest', 'skip', 'fail'],
-      'mutationobserver_test': ['unittest', 'skip', 'fail'],
-      'native_gc_test': ['unittest', 'skip', 'fail'],
-      'navigator_test': ['unittest', 'skip', 'fail'],
-      'node_test': ['unittest', 'skip', 'fail'],
-      'node_validator_important_if_you_suppress_make_the_bug_critical_test': ['unittest', 'skip', 'fail'],
-      'non_instantiated_is_test': ['unittest', 'skip', 'fail'],
-      'notification_test': ['unittest', 'skip', 'fail'],
-      'performance_api_test': ['unittest', 'skip', 'fail'],
-      'postmessage_structured_test': ['unittest', 'skip', 'fail'],
-      'private_extension_member_test': ['unittest', 'skip', 'fail'],
-      'queryall_test': ['unittest', 'skip', 'fail'],
-      'query_test': ['unittest', 'skip', 'fail'],
-      'range_test': ['unittest', 'skip', 'fail'],
-      'request_animation_frame_test': ['unittest', 'skip', 'fail'],
-      'resource_http_test': ['unittest', 'skip', 'fail'],
-      'rtc_test': ['unittest', 'skip', 'fail'],
-      'selectelement_test': ['unittest', 'skip', 'fail'],
-      'serialized_script_value_test': ['unittest', 'skip', 'fail'],
-      'shadow_dom_test': ['unittest', 'skip', 'fail'],
-      'shadowroot_test': ['unittest', 'skip', 'fail'],
-      'speechrecognition_test': ['unittest', 'skip', 'fail'],
-      'storage_test': ['unittest', 'skip', 'fail'],
-      'streams_test': ['unittest', 'skip', 'fail'],
-      'svgelement_test': ['unittest', 'skip', 'fail'],
-      'svg_test': ['unittest', 'skip', 'fail'],
-      'table_test': ['unittest', 'skip', 'fail'],
-      'text_event_test': ['unittest', 'skip', 'fail'],
-      'touchevent_test': ['unittest', 'skip', 'fail'],
-      'track_element_constructor_test': ['unittest', 'skip', 'fail'],
-      'transferables_test': ['unittest', 'skip', 'fail'],
-      'transition_event_test': ['unittest', 'skip', 'fail'],
-      'trusted_html_tree_sanitizer_test': ['unittest', 'skip', 'fail'],
-      'typed_arrays_1_test': ['unittest', 'skip', 'fail'],
-      'typed_arrays_2_test': ['unittest', 'skip', 'fail'],
-      'typed_arrays_3_test': ['unittest', 'skip', 'fail'],
-      'typed_arrays_4_test': ['unittest', 'skip', 'fail'],
-      'typed_arrays_5_test': ['unittest', 'skip', 'fail'],
-      'typed_arrays_arraybuffer_test': ['unittest', 'skip', 'fail'],
-      'typed_arrays_dataview_test': ['unittest', 'skip', 'fail'],
-      'typed_arrays_range_checks_test': ['unittest', 'skip', 'fail'],
-      'typed_arrays_simd_test': ['unittest', 'skip', 'fail'],
-      'typing_test': ['unittest', 'skip', 'fail'],
-      'unknownelement_test': ['unittest', 'skip', 'fail'],
-      'uri_test': ['unittest', 'skip', 'fail'],
-      'url_test': ['unittest', 'skip', 'fail'],
-      'webgl_1_test': ['unittest', 'skip', 'fail'],
-      'websocket_test': ['unittest', 'skip', 'fail'],
-      'websql_test': ['unittest', 'skip', 'fail'],
-      'wheelevent_test': ['unittest', 'skip', 'fail'],
-      'window_eq_test': ['unittest', 'skip', 'fail'],
-      'window_mangling_test': ['unittest', 'skip', 'fail'],
-      'window_nosuchmethod_test': ['unittest', 'skip', 'fail'],
-      'window_test': ['unittest', 'skip', 'fail'],
-      'worker_api_test': ['unittest', 'skip', 'fail'],
-      'worker_test': ['unittest', 'skip', 'fail'],
-      'wrapping_collections_test': ['unittest', 'skip', 'fail'],
-      'xhr_cross_origin_test': ['unittest', 'skip', 'fail'],
-      'xhr_test': ['unittest', 'skip', 'fail'],
-      'xsltprocessor_test': ['unittest', 'skip', 'fail'],
+      'canvasrenderingcontext2d_test': ['unittest'],
+      'cross_domain_iframe_test': async_unittest,
+      'cssstyledeclaration_test': async_unittest,
+      'css_test': async_unittest,
 
-      'js_typed_interop_default_arg_test_none_multi': ['unittest', 'skip', 'fail'],
-      'js_typed_interop_default_arg_test_explicit_argument_multi': ['unittest', 'skip', 'fail'],
-      'js_typed_interop_default_arg_test_default_value_multi': ['unittest', 'skip', 'fail']
+      // This is failing with a range error, I'm guessing because it's looking
+      // for a stylesheet and the page has none.
+      'css_rule_list_test': 'fail',
+      'custom_element_method_clash_test': async_unittest,
+      'custom_element_name_clash_test': async_unittest,
+      'custom_elements_23127_test': async_unittest,
+      'custom_elements_test': async_unittest,
+      'dom_constructors_test': 'fail', // was sdk#27578, needs triage
+      'element_animate_test': async_unittest,
+      'element_classes_test': 'fail', // sdk#27579.
+      'element_classes_svg_test': 'fail', // sdk#27579.
+
+      // Failure: 'Expected 56 to be in the inclusive range [111, 160].'.
+      'element_offset_test': 'fail',
+      'element_test': async_unittest,
+      'element_types_test': firefox_fail,
+      'event_customevent_test': async_unittest,
+      'events_test': async_unittest,
+
+      // Failure: "Failed to execute 'dispatchEvent' on 'EventTarget': parameter
+      // 1 is not of type 'Event'."
+      'event_test': 'fail',
+      'fileapi_test': async_unittest,
+      'filereader_test': async_unittest,
+      'fontface_loaded_test': async_unittest,
+
+      // Failed because it's expecting "Ahem" but getting null. Maybe sdk#27579?
+      'fontface_test': 'fail',
+      'form_data_test': async_unittest,
+      'history_test': async_unittest,
+      'indexeddb_1_test': async_unittest,
+      'indexeddb_2_test': async_unittest,
+      'indexeddb_3_test': async_unittest,
+      'indexeddb_4_test': async_unittest,
+      'indexeddb_5_test': async_unittest,
+      'input_element_test': 'fail', // was sdk#27578, needs triage
+      'interactive_test': async_unittest,
+      'isolates_test': async_unittest,
+
+      // Failing on "identical JS objects should have identical proxies".
+      'js_test': 'fail',
+      'js_interop_1_test': async_unittest,
+
+      // Failing because accessing "zSomeInvalidName" does not throw.
+      'js_typed_interop_test': 'fail',
+
+      // The "typed literal" test fails because the object does not have "_c".
+      'js_util_test': 'fail',
+      'keyboard_event_test': async_unittest,
+
+      'mediasource_test': 'fail', // was sdk#27578, needs triage
+      'media_stream_test': 'fail', // was sdk#27578, needs triage
+      'messageevent_test': 'fail', // was sdk#27578, needs triage
+
+      // Should throw but does not.
+      'mirrors_js_typed_interop_test': 'fail',
+
+      'mutationobserver_test': async_unittest,
+      'native_gc_test': async_unittest,
+      'notification_test': 'fail', // was sdk#27578, needs triage
+      'postmessage_structured_test': async_unittest,
+      'queryall_test': ['slow'], // see sdk #27794
+      'request_animation_frame_test': async_unittest,
+      'resource_http_test': async_unittest,
+      'rtc_test': is.chrome('<=55') ? fail : pass, // was sdk#27578, needs triage
+
+      // Expected 1, got null.
+      'serialized_script_value_test': 'fail',
+      'shadow_dom_test': firefox_fail,
+      'speechrecognition_test': 'fail', // was sdk#27578, needs triage
+      'svgelement_test': chrome_fail, // was sdk#27578, needs triage
+      'text_event_test': firefox_fail,
+      'touchevent_test': 'fail', // was sdk#27578, needs triage
+      'transferables_test': async_unittest,
+      'transition_event_test': async_unittest,
+      'url_test': async_unittest,
+      'websocket_test': async_unittest,
+      'websql_test': async_unittest,
+      'wheelevent_test': async_unittest,
+      'worker_api_test': async_unittest,
+      'worker_test': async_unittest,
+
+      'xhr_cross_origin_test': async_unittest,
+      'xhr_test': async_unittest,
+
+      // Failing when it gets 3 instead of 42.
+      'js_typed_interop_default_arg_test_default_value_multi': 'fail',
     },
 
     'lib/html/custom': {
-      'attribute_changed_callback_test': ['unittest', 'skip', 'fail'],
-      'constructor_calls_created_synchronously_test':
-        ['unittest', 'skip', 'fail'],
-      'created_callback_test': ['unittest', 'skip', 'fail'],
-      'document_register_basic_test': ['unittest', 'skip', 'fail'],
-      'document_register_type_extensions_test': ['unittest', 'skip', 'fail'],
-      'element_upgrade_test': ['unittest', 'skip', 'fail'],
-      'entered_left_view_test': ['unittest', 'skip', 'fail'],
-      'js_custom_test': ['unittest', 'skip', 'fail'],
-      'mirrors_test': ['unittest', 'skip', 'fail'],
-      'regress_194523002_test': ['unittest', 'skip', 'fail'],
+      'attribute_changed_callback_test': async_unittest,
+      'constructor_calls_created_synchronously_test': async_unittest,
+      'created_callback_test': async_unittest,
+      'entered_left_view_test': async_unittest,
+      'js_custom_test': async_unittest,
+      'mirrors_test': async_unittest,
+      'regress_194523002_test': async_unittest,
     },
 
     'lib/math': {
@@ -591,9 +540,7 @@
       'math_test': skip_fail,
       'math2_test': skip_fail,
       'pi_test': skip_timeout,
-      'point_test': ['unittest', 'skip', 'fail'],
       'random_big_test': skip_fail,
-      'rectangle_test': 'unittest',
     },
 
     'lib/typed_data': {
@@ -645,8 +592,6 @@
       'generics_special_types_test': fail,
       'generics_substitution_test': fail,
       'generics_test_none_multi': fail,
-      'get_field_static_test_00_multi': fail,
-      'get_field_static_test_none_multi': fail,
       'globalized_closures2_test_00_multi': fail,
       'globalized_closures2_test_none_multi': fail,
       'globalized_closures_test_00_multi': fail,
@@ -707,7 +652,6 @@
       'private_class_field_test': fail,
       'private_symbol_mangling_test': fail,
       'private_types_test': fail,
-      'proxy_type_test': fail,
       'raw_type_test_01_multi': fail,
       'raw_type_test_none_multi': fail,
       'reflect_class_test_none_multi': fail,
@@ -724,10 +668,7 @@
       'regress_26187_test': fail,
       'relation_assignable_test': fail,
       'relation_subtype_test': fail,
-      'runtime_type_test': fail,
       'set_field_with_final_test': fail,
-      'static_const_field_test': fail,
-      'superclass2_test': fail,
       'symbol_validation_test_01_multi': fail,
       'symbol_validation_test_none_multi': fail,
       'to_string_test': fail,
@@ -757,7 +698,6 @@
 
   let languageTestPattern =
       new RegExp('gen/codegen_output/(.*)/([^/]*_test[^/]*)');
-  html_config.useHtmlConfiguration();
   // We need to let Dart unittest control when tests are run not mocha.
   // mocha.allowUncaught(true);
   for (let testFile of allTestFiles) {
@@ -828,30 +768,49 @@
             }
           }
         } else {
-          if (negative) {
-            assert.throws(mainLibrary.main);
-          } else {
-            mainLibrary.main();
+          try {
+            if (negative) {
+              assert.throws(mainLibrary.main);
+            } else {
+              mainLibrary.main();
+            }
+          } finally {
+            minitest.finishTests();
           }
         }
 
+        // If the test left any lingering detritus in the DOM, blow it away
+        // so it doesn't interfere with later tests.
+        document.body.innerHTML = '';
+        console.log("cleared");
+
         if (!async_helper.asyncTestStarted) done();
       });
     }
   }
 
-  // TODO(jmesserly): unitttest tests are currently broken
-  // https://github.com/dart-lang/dev_compiler/issues/631
-  return;
-
   let mochaOnError;
   // We run these tests in a mocha test wrapper to avoid the confusing failure
   // case of dart unittests being interleaved with mocha tests.
   // In practice we are really just suppressing all mocha test behavior while
   // Dart unittests run and then re-enabling it when the dart tests complete.
+  html_config.useHtmlConfiguration();
   test('run all dart unittests', function(done) { // 'function' to allow `this.timeout`
     if (unittest_tests.length == 0) return done();
 
+    // TODO(vsm): We're using an old deprecated version of unittest.
+    // We need to migrate all tests (in the SDK itself) off of
+    // unittest.
+
+    // All unittests need to be explicitly marked as such above.  If
+    // not, the unittest framework will be run in a 'normal' test and
+    // left in an inconsistent state at this point triggering spurious
+    // failures.  This check ensures we're not in such a state.  If it fails,
+    // we've likely added a new unittest and need to categorize it as such.
+    if (unittest.src__test_environment.environment.testCases[dart_sdk.dartx.length] != 0) {
+      return done(new Error('Unittest framework in an invalid state'));
+    }
+
     this.timeout(100000000);
     this.enableTimeouts(false);
     // Suppress mocha on-error handling because it will mess up unittests.
diff --git a/pkg/dev_compiler/test/codegen/closure.dart b/pkg/dev_compiler/test/codegen/closure.dart
index 2754282..ad2e3ab 100644
--- a/pkg/dev_compiler/test/codegen/closure.dart
+++ b/pkg/dev_compiler/test/codegen/closure.dart
@@ -61,6 +61,8 @@
 
 void main(args) {}
 
+var closure = () { return; };
+
 const String some_top_level_constant = "abc";
 final String some_top_level_final = "abc";
 String some_top_level_var = "abc";
diff --git a/pkg/dev_compiler/test/codegen/expect.dart b/pkg/dev_compiler/test/codegen/expect.dart
deleted file mode 100644
index e7eb892..0000000
--- a/pkg/dev_compiler/test/codegen/expect.dart
+++ /dev/null
@@ -1,426 +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.
-
-/**
- * This library contains an Expect class with static methods that can be used
- * for simple unit-tests.
- */
-library expect;
-
-/**
- * Expect is used for tests that do not want to make use of the
- * Dart unit test library - for example, the core language tests.
- * Third parties are discouraged from using this, and should use
- * the expect() function in the unit test library instead for
- * test assertions.
- */
-class Expect {
-  /**
-   * Return a slice of a string.
-   *
-   * The slice will contain at least the substring from [start] to the lower of
-   * [end] and `start + length`.
-   * If the result is no more than `length - 10` characters long,
-   * context may be added by extending the range of the slice, by decreasing
-   * [start] and increasing [end], up to at most length characters.
-   * If the start or end of the slice are not matching the start or end of
-   * the string, ellipses are added before or after the slice.
-   * Control characters may be encoded as "\xhh" codes.
-   */
-  static String _truncateString(String string, int start, int end, int length) {
-    if (end - start > length) {
-      end = start + length;
-    } else if (end - start < length) {
-      int overflow = length - (end - start);
-      if (overflow > 10) overflow = 10;
-      // Add context.
-      start = start - ((overflow + 1) ~/ 2);
-      end = end + (overflow ~/ 2);
-      if (start < 0) start = 0;
-      if (end > string.length) end = string.length;
-    }
-    if (start == 0 && end == string.length) return string;
-    StringBuffer buf = new StringBuffer();
-    if (start > 0) buf.write("...");
-    for (int i = start; i < end; i++) {
-      int code = string.codeUnitAt(i);
-      if (code < 0x20) {
-        buf.write(r"\x");
-        buf.write("0123456789abcdef"[code ~/ 16]);
-        buf.write("0123456789abcdef"[code % 16]);
-      } else {
-        buf.writeCharCode(string.codeUnitAt(i));
-      }
-    }
-    if (end < string.length) buf.write("...");
-    return buf.toString();
-  }
-
-  /**
-   * Find the difference between two strings.
-   *
-   * This finds the first point where two strings differ, and returns
-   * a text describing the difference.
-   *
-   * For small strings (length less than 20) nothing is done, and null is
-   * returned. Small strings can be compared visually, but for longer strings
-   * only a slice containing the first difference will be shown.
-   */
-  static String _stringDifference(String expected, String actual) {
-    if (expected.length < 20 && actual.length < 20) return null;
-    for (int i = 0; i < expected.length && i < actual.length; i++) {
-      if (expected.codeUnitAt(i) != actual.codeUnitAt(i)) {
-        int start = i;
-        i++;
-        while (i < expected.length && i < actual.length) {
-          if (expected.codeUnitAt(i) == actual.codeUnitAt(i)) break;
-          i++;
-        }
-        int end = i;
-        var truncExpected = _truncateString(expected, start, end, 20);
-        var truncActual = _truncateString(actual, start, end, 20);
-        return "at index $start: Expected <$truncExpected>, "
-                                "Found: <$truncActual>";
-      }
-    }
-    return null;
-  }
-
-  /**
-   * Checks whether the expected and actual values are equal (using `==`).
-   */
-  static void equals(var expected, var actual, [String reason = null]) {
-    if (expected == actual) return;
-    String msg = _getMessage(reason);
-    if (expected is String && actual is String) {
-      String stringDifference = _stringDifference(expected, actual);
-      if (stringDifference != null) {
-        _fail("Expect.equals($stringDifference$msg) fails.");
-      }
-    }
-    _fail("Expect.equals(expected: <$expected>, actual: <$actual>$msg) fails.");
-  }
-
-  /**
-   * Checks whether the actual value is a bool and its value is true.
-   */
-  static void isTrue(var actual, [String reason = null]) {
-    if (_identical(actual, true)) return;
-    String msg = _getMessage(reason);
-    _fail("Expect.isTrue($actual$msg) fails.");
-  }
-
-  /**
-   * Checks whether the actual value is a bool and its value is false.
-   */
-  static void isFalse(var actual, [String reason = null]) {
-    if (_identical(actual, false)) return;
-    String msg = _getMessage(reason);
-    _fail("Expect.isFalse($actual$msg) fails.");
-  }
-
-  /**
-   * Checks whether [actual] is null.
-   */
-  static void isNull(actual, [String reason = null]) {
-    if (null == actual) return;
-    String msg = _getMessage(reason);
-    _fail("Expect.isNull(actual: <$actual>$msg) fails.");
-  }
-
-  /**
-   * Checks whether [actual] is not null.
-   */
-  static void isNotNull(actual, [String reason = null]) {
-    if (null != actual) return;
-    String msg = _getMessage(reason);
-    _fail("Expect.isNotNull(actual: <$actual>$msg) fails.");
-  }
-
-  /**
-   * Checks whether the expected and actual values are identical
-   * (using `identical`).
-   */
-  static void identical(var expected, var actual, [String reason = null]) {
-    if (_identical(expected, actual)) return;
-    String msg = _getMessage(reason);
-    _fail("Expect.identical(expected: <$expected>, actual: <$actual>$msg) "
-          "fails.");
-  }
-
-  // Unconditional failure.
-  static void fail(String msg) {
-    _fail("Expect.fail('$msg')");
-  }
-
-  /**
-   * Failure if the difference between expected and actual is greater than the
-   * given tolerance. If no tolerance is given, tolerance is assumed to be the
-   * value 4 significant digits smaller than the value given for expected.
-   */
-  static void approxEquals(num expected,
-                           num actual,
-                           [num tolerance = null,
-                            String reason = null]) {
-    if (tolerance == null) {
-      tolerance = (expected / 1e4).abs();
-    }
-    // Note: use !( <= ) rather than > so we fail on NaNs
-    if ((expected - actual).abs() <= tolerance) return;
-
-    String msg = _getMessage(reason);
-    _fail('Expect.approxEquals(expected:<$expected>, actual:<$actual>, '
-          'tolerance:<$tolerance>$msg) fails');
-  }
-
-  static void notEquals(unexpected, actual, [String reason = null]) {
-    if (unexpected != actual) return;
-    String msg = _getMessage(reason);
-    _fail("Expect.notEquals(unexpected: <$unexpected>, actual:<$actual>$msg) "
-          "fails.");
-  }
-
-  /**
-   * Checks that all elements in [expected] and [actual] are equal `==`.
-   * This is different than the typical check for identity equality `identical`
-   * used by the standard list implementation.  It should also produce nicer
-   * error messages than just calling `Expect.equals(expected, actual)`.
-   */
-  static void listEquals(List expected, List actual, [String reason = null]) {
-    String msg = _getMessage(reason);
-    int n = (expected.length < actual.length) ? expected.length : actual.length;
-    for (int i = 0; i < n; i++) {
-      if (expected[i] != actual[i]) {
-        _fail('Expect.listEquals(at index $i, '
-              'expected: <${expected[i]}>, actual: <${actual[i]}>$msg) fails');
-      }
-    }
-    // We check on length at the end in order to provide better error
-    // messages when an unexpected item is inserted in a list.
-    if (expected.length != actual.length) {
-      _fail('Expect.listEquals(list length, '
-        'expected: <${expected.length}>, actual: <${actual.length}>$msg) '
-        'fails: Next element <'
-        '${expected.length > n ? expected[n] : actual[n]}>');
-    }
-  }
-
-  /**
-   * Checks that all [expected] and [actual] have the same set of keys (using
-   * the semantics of [Map.containsKey] to determine what "same" means. For
-   * each key, checks that the values in both maps are equal using `==`.
-   */
-  static void mapEquals(Map expected, Map actual, [String reason = null]) {
-    String msg = _getMessage(reason);
-
-    // Make sure all of the values are present in both and match.
-    for (final key in expected.keys) {
-      if (!actual.containsKey(key)) {
-        _fail('Expect.mapEquals(missing expected key: <$key>$msg) fails');
-      }
-
-      Expect.equals(expected[key], actual[key]);
-    }
-
-    // Make sure the actual map doesn't have any extra keys.
-    for (final key in actual.keys) {
-      if (!expected.containsKey(key)) {
-        _fail('Expect.mapEquals(unexpected key: <$key>$msg) fails');
-      }
-    }
-  }
-
-  /**
-   * Specialized equality test for strings. When the strings don't match,
-   * this method shows where the mismatch starts and ends.
-   */
-  static void stringEquals(String expected,
-                           String actual,
-                           [String reason = null]) {
-    if (expected == actual) return;
-
-    String msg = _getMessage(reason);
-    String defaultMessage =
-        'Expect.stringEquals(expected: <$expected>", <$actual>$msg) fails';
-
-    if ((expected == null) || (actual == null)) {
-      _fail('$defaultMessage');
-    }
-
-    // Scan from the left until we find the mismatch.
-    int left = 0;
-    int right = 0;
-    int eLen = expected.length;
-    int aLen = actual.length;
-
-    while (true) {
-      if (left == eLen || left == aLen || expected[left] != actual[left]) {
-        break;
-      }
-      left++;
-    }
-
-    // Scan from the right until we find the mismatch.
-    int eRem = eLen - left;  // Remaining length ignoring left match.
-    int aRem = aLen - left;
-    while (true) {
-      if (right == eRem || right == aRem ||
-          expected[eLen - right - 1] != actual[aLen - right - 1]) {
-        break;
-      }
-      right++;
-    }
-
-    // First difference is at index `left`, last at `length - right - 1`
-    // Make useful difference message.
-    // Example:
-    // Diff (1209..1209/1246):
-    // ...,{"name":"[  ]FallThroug...
-    // ...,{"name":"[ IndexError","kind":"class"},{"name":" ]FallThroug...
-    // (colors would be great!)
-
-    // Make snippets of up to ten characters before and after differences.
-
-    String leftSnippet = expected.substring(left < 10 ? 0 : left - 10, left);
-    int rightSnippetLength = right < 10 ? right : 10;
-    String rightSnippet =
-        expected.substring(eLen - right, eLen - right + rightSnippetLength);
-
-    // Make snippets of the differences.
-    String eSnippet = expected.substring(left, eLen - right);
-    String aSnippet = actual.substring(left, aLen - right);
-
-    // If snippets are long, elide the middle.
-    if (eSnippet.length > 43) {
-      eSnippet = eSnippet.substring(0, 20) + "..." +
-                 eSnippet.substring(eSnippet.length - 20);
-    }
-    if (aSnippet.length > 43) {
-      aSnippet = aSnippet.substring(0, 20) + "..." +
-                 aSnippet.substring(aSnippet.length - 20);
-    }
-    // Add "..." before and after, unless the snippets reach the end.
-    String leftLead = "...";
-    String rightTail = "...";
-    if (left <= 10) leftLead = "";
-    if (right <= 10) rightTail = "";
-
-    String diff = '\nDiff ($left..${eLen - right}/${aLen - right}):\n'
-                  '$leftLead$leftSnippet[ $eSnippet ]$rightSnippet$rightTail\n'
-                  '$leftLead$leftSnippet[ $aSnippet ]$rightSnippet$rightTail';
-    _fail("$defaultMessage$diff");
-  }
-
-  /**
-   * Checks that every element of [expected] is also in [actual], and that
-   * every element of [actual] is also in [expected].
-   */
-  static void setEquals(Iterable expected,
-                        Iterable actual,
-                        [String reason = null]) {
-    final missingSet = new Set.from(expected);
-    missingSet.removeAll(actual);
-    final extraSet = new Set.from(actual);
-    extraSet.removeAll(expected);
-
-    if (extraSet.isEmpty && missingSet.isEmpty) return;
-    String msg = _getMessage(reason);
-
-    StringBuffer sb = new StringBuffer("Expect.setEquals($msg) fails");
-    // Report any missing items.
-    if (!missingSet.isEmpty) {
-      sb.write('\nExpected collection does not contain: ');
-    }
-
-    for (final val in missingSet) {
-      sb.write('$val ');
-    }
-
-    // Report any extra items.
-    if (!extraSet.isEmpty) {
-      sb.write('\nExpected collection should not contain: ');
-    }
-
-    for (final val in extraSet) {
-      sb.write('$val ');
-    }
-    _fail(sb.toString());
-  }
-
-  /**
-   * Calls the function [f] and verifies that it throws an exception.
-   * The optional [check] function can provide additional validation
-   * that the correct exception is being thrown.  For example, to check
-   * the type of the exception you could write this:
-   *
-   *     Expect.throws(myThrowingFunction, (e) => e is MyException);
-   */
-  static void throws(void f(),
-                     [_CheckExceptionFn check = null,
-                      String reason = null]) {
-    String msg = reason == null ? "" : "($reason)";
-    if (f is! _Nullary) {
-      // Only throws from executing the funtion body should count as throwing.
-      // The failure to even call `f` should throw outside the try/catch.
-      _fail("Expect.throws$msg: Function f not callable with zero arguments");
-    }
-    try {
-      f();
-    } catch (e, s) {
-      if (check != null) {
-        if (!check(e)) {
-          _fail("Expect.throws$msg: Unexpected '$e'\n$s");
-        }
-      }
-      return;
-    }
-    _fail('Expect.throws$msg fails: Did not throw');
-  }
-
-  static String _getMessage(String reason)
-      => (reason == null) ? "" : ", '$reason'";
-
-  static void _fail(String message) {
-    throw new ExpectException(message);
-  }
-}
-
-bool _identical(a, b) => identical(a, b);
-
-typedef bool _CheckExceptionFn(exception);
-typedef _Nullary();  // Expect.throws argument must be this type.
-
-class ExpectException implements Exception {
-  ExpectException(this.message);
-  String toString() => message;
-  String message;
-}
-
-/// Annotation class for testing of dart2js. Use this as metadata on method
-/// declarations to disable inlining of the annotated method.
-class NoInline {
-  const NoInline();
-}
-
-/// Annotation class for testing of dart2js. Use this as metadata on method
-/// declarations to make the type inferrer trust the parameter and return types,
-/// effectively asserting the runtime values will (at least) be subtypes of the
-/// annotated types.
-///
-/// While the actually inferred type is guaranteed to be a subtype of the
-/// annotation, it often is more precise. In particular, if a method is only
-/// called with `null`, the inferrer will still infer null. To ensure that
-/// the annotated type is also the inferred type, additionally use
-/// [AssumeDynamic].
-class TrustTypeAnnotations {
-  const TrustTypeAnnotations();
-}
-
-/// Annotation class for testing of dart2js. Use this as metadata on method
-/// declarations to disable closed world assumptions on parameters, effectively
-/// assuming that the runtime arguments could be any value. Note that the
-/// constraints due to [TrustTypeAnnotations] still apply.
-class AssumeDynamic {
-  const AssumeDynamic();
-}
diff --git a/pkg/dev_compiler/test/codegen/language/call_function2_test.dart b/pkg/dev_compiler/test/codegen/language/call_function2_test.dart
new file mode 100644
index 0000000..f9a610d
--- /dev/null
+++ b/pkg/dev_compiler/test/codegen/language/call_function2_test.dart
@@ -0,0 +1,31 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+
+typedef Object Func(Object x);
+
+class Bar {
+  int x = 42;
+
+  Object call(Object x) {
+    return 'Bar $x';
+  }
+}
+
+Object baz(Object x) => x;
+
+var map = <String, Func>{
+  'baz': baz,
+  'bar': new Bar()
+};
+
+Object test(String str, Object arg) {
+  return map[str].call(arg);
+}
+
+void main() {
+  Expect.equals(42, test('baz', 42));
+  Expect.equals('Bar 42', test('bar', 42));
+}
\ No newline at end of file
diff --git a/pkg/dev_compiler/test/codegen/language/enum_value_name_test.dart b/pkg/dev_compiler/test/codegen/language/enum_value_name_test.dart
new file mode 100644
index 0000000..2b73f17
--- /dev/null
+++ b/pkg/dev_compiler/test/codegen/language/enum_value_name_test.dart
@@ -0,0 +1,13 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// SharedOptions=--enable-enum
+
+import 'package:expect/expect.dart';
+
+enum ErrorContext { general, name, description, targets }
+
+void main() {
+  Expect.equals(ErrorContext.name, ErrorContext.name);
+}
diff --git a/pkg/dev_compiler/test/codegen/language/field_test.dart b/pkg/dev_compiler/test/codegen/language/field_test.dart
index 6a1937f..ca41740 100644
--- a/pkg/dev_compiler/test/codegen/language/field_test.dart
+++ b/pkg/dev_compiler/test/codegen/language/field_test.dart
@@ -52,11 +52,11 @@
     // The tests below are a little cumbersome because not
     // everything is implemented yet.
     var o = new Second();
-    // 'a' getter is overriden, always returns -12.
+    // 'a' getter is overridden, always returns -12.
     Expect.equals(-12, o.a);
     o.a = 2;
     Expect.equals(-12, o.a);
-    // 'b' setter is overriden to write 12 to field 'c'.
+    // 'b' setter is overridden to write 12 to field 'c'.
     o.b = o;
     Expect.equals(12, o.c);
   }
diff --git a/pkg/dev_compiler/test/codegen/language/mixin_abstract_getter_test.dart b/pkg/dev_compiler/test/codegen/language/mixin_abstract_getter_test.dart
new file mode 100644
index 0000000..98ee18c
--- /dev/null
+++ b/pkg/dev_compiler/test/codegen/language/mixin_abstract_getter_test.dart
@@ -0,0 +1,43 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+abstract class B {
+  int get x;
+}
+
+class C {
+  int get x => 42;
+}
+
+class D extends C with B {
+  final int x;
+
+  D(this.x);
+}
+
+
+class C2 {
+  int get x => 42;
+}
+
+abstract class B2 extends C2 {
+  int get x;
+}
+
+class D2 extends B2 {
+  final int x;
+
+  D2(this.x);
+}
+
+
+void main() {
+  var d = new D(17);
+  Expect.equals(d.x, 17);
+
+  var d2 = new D2(17);
+  Expect.equals(d.x, 17);
+}
diff --git a/pkg/dev_compiler/test/codegen/language/parameter_initializer5_negative_test.dart b/pkg/dev_compiler/test/codegen/language/parameter_initializer5_negative_test.dart
deleted file mode 100644
index afa5e2a..0000000
--- a/pkg/dev_compiler/test/codegen/language/parameter_initializer5_negative_test.dart
+++ /dev/null
@@ -1,15 +0,0 @@
-// 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.
-
-// Fails because this.x parameter is used in initializer expression.
-
-class Foo {
-  var x, y;
-  Foo(this.x): y = x { }
-}
-
-
-main() {
-  new Foo(12);
-}
diff --git a/pkg/dev_compiler/test/codegen/language/parameter_initializer5_test.dart b/pkg/dev_compiler/test/codegen/language/parameter_initializer5_test.dart
new file mode 100644
index 0000000..eb7208d
--- /dev/null
+++ b/pkg/dev_compiler/test/codegen/language/parameter_initializer5_test.dart
@@ -0,0 +1,17 @@
+// 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.
+//
+// DartOptions=--initializing-formal-access
+// VMOptions=--initializing-formal-access
+
+// Use the this.x parameter in an initializer expression.
+
+class Foo {
+  var x, y;
+  Foo(this.x): y = x { }
+}
+
+main() {
+  new Foo(12);
+}
diff --git a/pkg/dev_compiler/test/codegen/language/recursive_generic_test.dart b/pkg/dev_compiler/test/codegen/language/recursive_generic_test.dart
new file mode 100644
index 0000000..3d8dcd6
--- /dev/null
+++ b/pkg/dev_compiler/test/codegen/language/recursive_generic_test.dart
@@ -0,0 +1,16 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+
+abstract class S<T extends S<T>> { m() => 123; get S_T => T; }
+class C<T extends C<T>> extends S<C> { m() => 456; get C_T => T; }
+
+main() {
+  Expect.equals(new C().m(), 456);
+  // TODO(jmesserly): this should be dart1 vs dart2, not DDC vs VM.
+  var isVM = const bool.fromEnvironment('dart.isVM');
+  Expect.equals(new C().S_T.toString(), isVM ? 'C' : 'C<C>');
+  Expect.equals(new C().C_T.toString(), isVM ? 'dynamic' : 'C');
+}
diff --git a/pkg/dev_compiler/test/codegen/language/variable_named_dart_test.dart b/pkg/dev_compiler/test/codegen/language/variable_named_dart_test.dart
new file mode 100644
index 0000000..233b60f
--- /dev/null
+++ b/pkg/dev_compiler/test/codegen/language/variable_named_dart_test.dart
@@ -0,0 +1,10 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+main() {
+  dynamic dart = 123;
+  Expect.equals(dart.toDouble(), 123.0);
+}
diff --git a/pkg/dev_compiler/test/codegen/language/void_subtype_test.dart b/pkg/dev_compiler/test/codegen/language/void_subtype_test.dart
new file mode 100644
index 0000000..f626232
--- /dev/null
+++ b/pkg/dev_compiler/test/codegen/language/void_subtype_test.dart
@@ -0,0 +1,59 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 type checks involving the void type.
+
+import "package:expect/expect.dart";
+
+var _str = new StringBuffer();
+
+/*=T*/ run/*<T>*/(/*=T*/ f()) {
+  _str.write("+");
+  var t = f();
+  _str.write("-");
+  return t;
+}
+
+void writeV() { _str.write("V"); }
+
+main() {
+  {
+    var x = run/*<dynamic>*/(writeV);
+    Expect.equals('+V-', _str.toString());
+    Expect.equals(null, x);
+    _str.clear();
+
+    var y = run(writeV);
+    Expect.equals('+V-', _str.toString());
+    Expect.equals(null, y);
+    _str.clear();
+  }
+
+  // implicit cast
+  {
+    dynamic d = writeV;
+    var x = run/*<dynamic>*/(d);
+    Expect.equals('+V-', _str.toString());
+    Expect.equals(null, x);
+    _str.clear();
+
+    var y = run(d);
+    Expect.equals('+V-', _str.toString());
+    Expect.equals(null, y);
+    _str.clear();
+  }
+
+  // dynamic dispatch
+  {
+    dynamic d = run;
+    var x = d/*<dynamic>*/(writeV);
+    Expect.equals('+V-', _str.toString());
+    Expect.equals(null, x);
+    _str.clear();
+
+    var y = d(writeV);
+    Expect.equals('+V-', _str.toString());
+    Expect.equals(null, y);
+    _str.clear();
+  }
+}
diff --git a/pkg/dev_compiler/test/codegen/lib/collection/list_test.dart b/pkg/dev_compiler/test/codegen/lib/collection/list_test.dart
new file mode 100644
index 0000000..76cd515
--- /dev/null
+++ b/pkg/dev_compiler/test/codegen/lib/collection/list_test.dart
@@ -0,0 +1,40 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:collection';
+import "package:expect/expect.dart";
+
+class MyList<E> extends Object with ListMixin<E> implements List<E> {
+  List<E> _list;
+
+  MyList(List<E> this._list);
+
+  int get length => _list.length;
+
+  void set length(int x) {
+    _list.length = x;
+  }
+
+  E operator[](int idx) => _list[idx];
+
+  void operator[]=(int idx, E value) {
+    _list[idx] = value;
+  }
+}
+
+void testRetainWhere() {
+  List<int> list = <int>[1, 2, 3];
+  list.retainWhere((x) => x % 2 == 0);
+  Expect.equals(1, list.length);
+  Expect.equals(2, list.first);
+
+  list = new MyList<int>([1, 2, 3]);
+  list.retainWhere((x) => x % 2 == 0);
+  Expect.equals(1, list.length);
+  Expect.equals(2, list.first);
+}
+
+void main() {
+  testRetainWhere();
+}
diff --git a/pkg/dev_compiler/test/codegen/lib/convert/json_lib_test.dart b/pkg/dev_compiler/test/codegen/lib/convert/json_lib_test.dart
index 1226f7b..0966eaf 100644
--- a/pkg/dev_compiler/test/codegen/lib/convert/json_lib_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/convert/json_lib_test.dart
@@ -2,162 +2,188 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library json_tests;
-import 'package:unittest/unittest.dart';
+import 'package:expect/expect.dart';
 import 'dart:convert';
 
 main() {
-  test('Parse', () {
-    // Scalars.
-    expect(JSON.decode(' 5 '), equals(5));
-    expect(JSON.decode(' -42 '), equals(-42));
-    expect(JSON.decode(' 3e0 '), equals(3));
-    expect(JSON.decode(' 3.14 '), equals(3.14));
-    expect(JSON.decode('true '), isTrue);
-    expect(JSON.decode(' false'), isFalse);
-    expect(JSON.decode(' null '), isNull);
-    expect(JSON.decode('\n\rnull\t'), isNull);
-    expect(JSON.decode(' "hi there\\" bob" '), equals('hi there" bob'));
-    expect(JSON.decode(' "" '), isEmpty);
+  testParsing();
+  testStringify();
+  testStringifyErrors();
+}
 
-    // Lists.
-    expect(JSON.decode(' [] '), isEmpty);
-    expect(JSON.decode('[ ]'), isEmpty);
-    expect(JSON.decode(' [3, -4.5, true, "hi", false] '),
-      equals([3, -4.5, true, 'hi', false]));
-    // Nulls are tricky.
-    expect(JSON.decode('[null]'), orderedEquals([null]));
-    expect(JSON.decode(' [3, -4.5, null, true, "hi", false] '),
-      equals([3, -4.5, null, true, 'hi', false]));
-    expect(JSON.decode('[[null]]'), equals([[null]]));
-    expect(JSON.decode(' [ [3], [], [null], ["hi", true]] '),
-      equals([[3], [], [null], ['hi', true]]));
+void testParsing() {
+  // Scalars.
+  Expect.equals(5, JSON.decode(' 5 '));
+  Expect.equals(-42, JSON.decode(' -42 '));
+  Expect.equals(3, JSON.decode(' 3e0 '));
+  Expect.equals(3.14, JSON.decode(' 3.14 '));
+  Expect.isTrue(JSON.decode('true '));
+  Expect.isFalse(JSON.decode(' false'));
+  Expect.isNull(JSON.decode(' null '));
+  Expect.isNull(JSON.decode('\n\rnull\t'));
+  Expect.equals('hi there" bob', JSON.decode(' "hi there\\" bob" '));
+  Expect.equals('', JSON.decode(' "" '));
 
-    // Maps.
-    expect(JSON.decode(' {} '), isEmpty);
-    expect(JSON.decode('{ }'), isEmpty);
+  // Lists.
+  Expect.deepEquals([], JSON.decode(' [] '));
+  Expect.deepEquals([], JSON.decode('[ ]'));
+  Expect.deepEquals([3, -4.5, true, 'hi', false],
+      JSON.decode(' [3, -4.5, true, "hi", false] '));
+  // Nulls are tricky.
+  Expect.deepEquals([null], JSON.decode('[null]'));
+  Expect.deepEquals([3, -4.5, null, true, 'hi', false],
+      JSON.decode(' [3, -4.5, null, true, "hi", false] '));
+  Expect.deepEquals([
+    [null]
+  ], JSON.decode('[[null]]'));
+  Expect.deepEquals([
+    [3],
+    [],
+    [null],
+    ['hi', true]
+  ], JSON.decode(' [ [3], [], [null], ["hi", true]] '));
 
-    expect(JSON.decode(
-        ' {"x":3, "y": -4.5,  "z" : "hi","u" : true, "v": false } '),
-        equals({"x":3, "y": -4.5,  "z" : "hi", "u" : true, "v": false }));
+  // Maps.
+  Expect.deepEquals({}, JSON.decode(' {} '));
+  Expect.deepEquals({}, JSON.decode('{ }'));
 
-    expect(JSON.decode(' {"x":3, "y": -4.5,  "z" : "hi" } '),
-        equals({"x":3, "y": -4.5,  "z" : "hi" }));
+  Expect.deepEquals({"x": 3, "y": -4.5, "z": "hi", "u": true, "v": false},
+      JSON.decode(' {"x":3, "y": -4.5,  "z" : "hi","u" : true, "v": false } '));
 
-    expect(JSON.decode(' {"y": -4.5,  "z" : "hi" ,"x":3 } '),
-        equals({"y": -4.5,  "z" : "hi" ,"x":3 }));
+  Expect.deepEquals({"x": 3, "y": -4.5, "z": "hi"},
+      JSON.decode(' {"x":3, "y": -4.5,  "z" : "hi" } '));
 
-    expect(JSON.decode('{ " hi bob " :3, "": 4.5}'),
-        equals({ " hi bob " :3, "": 4.5}));
+  Expect.deepEquals({"y": -4.5, "z": "hi", "x": 3},
+      JSON.decode(' {"y": -4.5,  "z" : "hi" ,"x":3 } '));
 
-    expect(JSON.decode(' { "x" : { } } '), equals({ 'x' : {}}));
-    expect(JSON.decode('{"x":{}}'), equals({ 'x' : {}}));
+  Expect.deepEquals(
+      {" hi bob ": 3, "": 4.5}, JSON.decode('{ " hi bob " :3, "": 4.5}'));
 
-    // Nulls are tricky.
-    expect(JSON.decode('{"w":null}'), equals({ 'w' : null}));
+  Expect.deepEquals({'x': {}}, JSON.decode(' { "x" : { } } '));
+  Expect.deepEquals({'x': {}}, JSON.decode('{"x":{}}'));
 
-    expect(JSON.decode('{"x":{"w":null}}'), equals({"x":{"w":null}}));
+  // Nulls are tricky.
+  Expect.deepEquals({'w': null}, JSON.decode('{"w":null}'));
 
-    expect(JSON.decode(' {"x":3, "y": -4.5,  "z" : "hi",'
-                   '"w":null, "u" : true, "v": false } '),
-        equals({"x":3, "y": -4.5,  "z" : "hi",
-                   "w":null, "u" : true, "v": false }));
+  Expect.deepEquals({
+    "x": {"w": null}
+  }, JSON.decode('{"x":{"w":null}}'));
 
-    expect(JSON.decode('{"x": {"a":3, "b": -4.5}, "y":[{}], '
-                   '"z":"hi","w":{"c":null,"d":true}, "v":null}'),
-        equals({"x": {"a":3, "b": -4.5}, "y":[{}],
-                   "z":"hi","w":{"c":null,"d":true}, "v":null}));
+  Expect.deepEquals(
+      {"x": 3, "y": -4.5, "z": "hi", "w": null, "u": true, "v": false},
+      JSON.decode(' {"x":3, "y": -4.5,  "z" : "hi",'
+          '"w":null, "u" : true, "v": false } '));
+
+  Expect.deepEquals(
+      {
+        "x": {"a": 3, "b": -4.5},
+        "y": [{}],
+        "z": "hi",
+        "w": {"c": null, "d": true},
+        "v": null
+      },
+      JSON.decode('{"x": {"a":3, "b": -4.5}, "y":[{}], '
+          '"z":"hi","w":{"c":null,"d":true}, "v":null}'));
+}
+
+void testStringify() {
+  // Scalars.
+  Expect.equals('5', JSON.encode(5));
+  Expect.equals('-42', JSON.encode(-42));
+  // Dart does not guarantee a formatting for doubles,
+  // so reparse and compare to the original.
+  validateRoundTrip(3.14);
+  Expect.equals('true', JSON.encode(true));
+  Expect.equals('false', JSON.encode(false));
+  Expect.equals('null', JSON.encode(null));
+  Expect.equals('" hi there\\" bob "', JSON.encode(' hi there" bob '));
+  Expect.equals('"hi\\\\there"', JSON.encode('hi\\there'));
+  Expect.equals('"hi\\nthere"', JSON.encode('hi\nthere'));
+  Expect.equals('"hi\\r\\nthere"', JSON.encode('hi\r\nthere'));
+  Expect.equals('""', JSON.encode(''));
+
+  // Lists.
+  Expect.equals('[]', JSON.encode([]));
+  Expect.equals('[]', JSON.encode(new List(0)));
+  Expect.equals('[null,null,null]', JSON.encode(new List(3)));
+  validateRoundTrip([3, -4.5, null, true, 'hi', false]);
+  Expect.equals(
+      '[[3],[],[null],["hi",true]]',
+      JSON.encode([
+        [3],
+        [],
+        [null],
+        ['hi', true]
+      ]));
+
+  // Maps.
+  Expect.equals('{}', JSON.encode({}));
+  Expect.equals('{}', JSON.encode(new Map()));
+  Expect.equals('{"x":{}}', JSON.encode({'x': {}}));
+  Expect.equals(
+      '{"x":{"a":3}}',
+      JSON.encode({
+        'x': {'a': 3}
+      }));
+
+  // Dart does not guarantee an order on the keys
+  // of a map literal, so reparse and compare to the original Map.
+  validateRoundTrip(
+      {'x': 3, 'y': -4.5, 'z': 'hi', 'w': null, 'u': true, 'v': false});
+  validateRoundTrip({"x": 3, "y": -4.5, "z": 'hi'});
+  validateRoundTrip({' hi bob ': 3, '': 4.5});
+  validateRoundTrip({
+    'x': {'a': 3, 'b': -4.5},
+    'y': [{}],
+    'z': 'hi',
+    'w': {'c': null, 'd': true},
+    'v': null
   });
 
-  test('stringify', () {
-    // Scalars.
-    expect(JSON.encode(5), equals('5'));
-    expect(JSON.encode(-42), equals('-42'));
-    // Dart does not guarantee a formatting for doubles,
-    // so reparse and compare to the original.
-    validateRoundTrip(3.14);
-    expect(JSON.encode(true), equals('true'));
-    expect(JSON.encode(false), equals('false'));
-    expect(JSON.encode(null), equals('null'));
-    expect(JSON.encode(' hi there" bob '), equals('" hi there\\" bob "'));
-    expect(JSON.encode('hi\\there'), equals('"hi\\\\there"'));
-    expect(JSON.encode('hi\nthere'), equals('"hi\\nthere"'));
-    expect(JSON.encode('hi\r\nthere'), equals('"hi\\r\\nthere"'));
-    expect(JSON.encode(''), equals('""'));
+  Expect.equals("4", JSON.encode(new ToJson(4)));
+  Expect.equals('[4,"a"]', JSON.encode(new ToJson([4, "a"])));
+  Expect.equals(
+      '[4,{"x":42}]',
+      JSON.encode(new ToJson([
+        4,
+        new ToJson({"x": 42})
+      ])));
 
-    // Lists.
-    expect(JSON.encode([]), equals('[]'));
-    expect(JSON.encode(new List(0)), equals('[]'));
-    expect(JSON.encode(new List(3)), equals('[null,null,null]'));
-    validateRoundTrip([3, -4.5, null, true, 'hi', false]);
-    expect(JSON.encode([[3], [], [null], ['hi', true]]),
-      equals('[[3],[],[null],["hi",true]]'));
+  expectThrowsJsonError(() => JSON.encode([new ToJson(new ToJson(4))]));
+  expectThrowsJsonError(() => JSON.encode([new Object()]));
+}
 
-    // Maps.
-    expect(JSON.encode({}), equals('{}'));
-    expect(JSON.encode(new Map()), equals('{}'));
-    expect(JSON.encode({'x':{}}), equals('{"x":{}}'));
-    expect(JSON.encode({'x':{'a':3}}), equals('{"x":{"a":3}}'));
+void testStringifyErrors() {
+  // Throws if argument cannot be converted.
+  expectThrowsJsonError(() => JSON.encode(new TestClass()));
 
-    // Dart does not guarantee an order on the keys
-    // of a map literal, so reparse and compare to the original Map.
-    validateRoundTrip(
-        {'x':3, 'y':-4.5, 'z':'hi', 'w':null, 'u':true, 'v':false});
-    validateRoundTrip({"x":3, "y":-4.5, "z":'hi'});
-    validateRoundTrip({' hi bob ':3, '':4.5});
-    validateRoundTrip(
-        {'x':{'a':3, 'b':-4.5}, 'y':[{}], 'z':'hi', 'w':{'c':null, 'd':true},
-                  'v':null});
+  // Throws if toJson throws.
+  expectThrowsJsonError(() => JSON.encode(new ToJsoner("bad", throws: true)));
 
-    expect(JSON.encode(new ToJson(4)), "4");
-    expect(JSON.encode(new ToJson([4, "a"])), '[4,"a"]');
-    expect(JSON.encode(new ToJson([4, new ToJson({"x":42})])),
-           '[4,{"x":42}]');
+  // Throws if toJson returns non-serializable value.
+  expectThrowsJsonError(() => JSON.encode(new ToJsoner(new TestClass())));
 
-    expect(() {
-      JSON.encode([new ToJson(new ToJson(4))]);
-    }, throwsJsonError);
+  // Throws on cyclic values.
+  var a = [];
+  var b = a;
+  for (int i = 0; i < 50; i++) {
+    b = [b];
+  }
+  a.add(b);
+  expectThrowsJsonError(() => JSON.encode(a));
+}
 
-    expect(() {
-      JSON.encode([new Object()]);
-    }, throwsJsonError);
-
-  });
-
-  test('stringify throws if argument cannot be converted', () {
-    /**
-     * Checks that we get an exception (rather than silently returning null) if
-     * we try to stringify something that cannot be converted to json.
-     */
-    expect(() => JSON.encode(new TestClass()), throwsJsonError);
-  });
-
-  test('stringify throws if toJson throws', () {
-    expect(() => JSON.encode(new ToJsoner("bad", throws: true)),
-           throwsJsonError);
-  });
-
-  test('stringify throws if toJson returns non-serializable value', () {
-    expect(() => JSON.encode(new ToJsoner(new TestClass())),
-           throwsJsonError);
-  });
-
-  test('stringify throws on cyclic values', () {
-    var a = [];
-    var b = a;
-    for (int i = 0; i < 50; i++) {
-      b = [b];
-    }
-    a.add(b);
-    expect(() => JSON.encode(a), throwsJsonError);
-  });
+void expectThrowsJsonError(void f()) {
+  Expect.throws(f, (e) => e is JsonUnsupportedObjectError);
 }
 
 class TestClass {
   int x;
   String y;
 
-  TestClass() : x = 3, y = 'joe' { }
+  TestClass()
+      : x = 3,
+        y = 'joe' {}
 }
 
 class ToJsoner {
@@ -176,13 +202,10 @@
   toJson() => object;
 }
 
-var throwsJsonError =
-    throwsA(new isInstanceOf<JsonUnsupportedObjectError>());
-
 /**
  * Checks that the argument can be converted to a JSON string and
  * back, and produce something equivalent to the argument.
  */
 validateRoundTrip(expected) {
-  expect(JSON.decode(JSON.encode(expected)), equals(expected));
+  Expect.deepEquals(expected, JSON.decode(JSON.encode(expected)));
 }
diff --git a/pkg/dev_compiler/test/codegen/lib/html/audiobuffersourcenode_test.dart b/pkg/dev_compiler/test/codegen/lib/html/audiobuffersourcenode_test.dart
index c55c08c..9c98cf0 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/audiobuffersourcenode_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/audiobuffersourcenode_test.dart
@@ -1,21 +1,17 @@
-library AudioBufferSourceNodeTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:web_audio';
 
+import 'package:expect/minitest.dart';
+
 main() {
-
-  useHtmlIndividualConfiguration();
-
   group('supported', () {
     test('supported', () {
-      expect(AudioContext.supported, true);
+      expect(AudioContext.supported, isTrue);
     });
   });
 
   group('functional', () {
     test('createBuffer', () {
-      if(AudioContext.supported) {
+      if (AudioContext.supported) {
         var ctx = new AudioContext();
         AudioBufferSourceNode node = ctx.createBufferSource();
         expect(node is AudioBufferSourceNode, isTrue);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/audiocontext_test.dart b/pkg/dev_compiler/test/codegen/lib/html/audiocontext_test.dart
index 68c2af9..195130f 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/audiocontext_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/audiocontext_test.dart
@@ -1,15 +1,11 @@
-library AudioContextTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
+import 'dart:async';
 import 'dart:html';
 import 'dart:typed_data';
 import 'dart:web_audio';
-import 'dart:async';
+
+import 'package:expect/minitest.dart';
 
 main() {
-
-  useHtmlIndividualConfiguration();
-
   var isAudioContext =
       predicate((x) => x is AudioContext, 'is an AudioContext');
 
@@ -24,16 +20,16 @@
     if (AudioContext.supported) {
       context = new AudioContext();
     }
-    
+
     test('constructorTest', () {
-      if(AudioContext.supported) {
+      if (AudioContext.supported) {
         expect(context, isNotNull);
         expect(context, isAudioContext);
       }
     });
 
     test('audioRenames', () {
-      if(AudioContext.supported) {
+      if (AudioContext.supported) {
         GainNode gainNode = context.createGain();
         gainNode.connectNode(context.destination);
         expect(gainNode is GainNode, isTrue);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/audioelement_test.dart b/pkg/dev_compiler/test/codegen/lib/html/audioelement_test.dart
index 9957ff7..9f47b9f 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/audioelement_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/audioelement_test.dart
@@ -1,11 +1,8 @@
-library AudioElementTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   test('constructorTest1', () {
       var audio = new AudioElement();
       expect(audio, isNotNull);
@@ -16,7 +13,7 @@
       var audio = new AudioElement('IntentionallyMissingFileURL');
       expect(audio, isNotNull);
       expect(audio is AudioElement, isTrue);
-      expect(audio.src, contains('IntentionallyMissingFileURL'));
+      expect(audio.src.contains('IntentionallyMissingFileURL'), isTrue);
     });
 
   test('canPlayTypeTest', () {
diff --git a/pkg/dev_compiler/test/codegen/lib/html/b_element_test.dart b/pkg/dev_compiler/test/codegen/lib/html/b_element_test.dart
index f208e6d..3dbb0e7 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/b_element_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/b_element_test.dart
@@ -1,13 +1,5 @@
-library BElementTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
 main() {
-  useHtmlConfiguration();
-
-  test('create b', () {
-    new Element.tag('b');
-  });
+  new Element.tag('b');
 }
-
diff --git a/pkg/dev_compiler/test/codegen/lib/html/blob_constructor_test.dart b/pkg/dev_compiler/test/codegen/lib/html/blob_constructor_test.dart
index 41461f5..b7f704c 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/blob_constructor_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/blob_constructor_test.dart
@@ -2,18 +2,15 @@
 // for 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 blob_test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 import 'dart:typed_data';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   test('basic', () {
       var b = new Blob([]);
-      expect(b.size, isZero);
+      expect(b.size, 0);
     });
 
   test('type1', () {
@@ -32,7 +29,7 @@
   test('endings2', () {
       // OPTIONALS var b = new Blob(['A\nB\n'], endings: 'native');
       var b = new Blob(['A\nB\n'], null, 'native');
-      expect(b.size, (x) => x == 4 || x == 6,
+      expect(b.size, predicate((x) => x == 4 || x == 6),
           reason: "b.size should be 4 or 6");
     });
 
@@ -45,7 +42,7 @@
   test('fromBlob1', () {
       var b1 = new Blob([]);
       var b2 = new Blob([b1]);
-      expect(b2.size, isZero);
+      expect(b2.size, 0);
     });
 
   test('fromBlob2', () {
diff --git a/pkg/dev_compiler/test/codegen/lib/html/cache_test.dart b/pkg/dev_compiler/test/codegen/lib/html/cache_test.dart
index d81770f..3b2e121 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/cache_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/cache_test.dart
@@ -1,14 +1,11 @@
-library CacheTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlIndividualConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   group('supported', () {
     test('supported', () {
-      expect(ApplicationCache.supported, true);
+      expect(ApplicationCache.supported, isTrue);
     });
   });
 
@@ -19,10 +16,8 @@
         ApplicationCache appCache = window.applicationCache;
         expect(cacheStatusToString(appCache.status), "UNCACHED");
       }, expectation);
-
     });
   });
-
 }
 
 String cacheStatusToString(int status) {
diff --git a/pkg/dev_compiler/test/codegen/lib/html/callbacks_test.dart b/pkg/dev_compiler/test/codegen/lib/html/callbacks_test.dart
index c6e9498..7afeae5 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/callbacks_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/callbacks_test.dart
@@ -1,11 +1,5 @@
-library CallbacksTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
 main() {
-  useHtmlConfiguration();
-  test('RequestAnimationFrameCallback', () {
-    window.requestAnimationFrame((num time) => false);
-  });
+  window.requestAnimationFrame((num time) => false);
 }
diff --git a/pkg/dev_compiler/test/codegen/lib/html/canvas_pixel_array_type_alias_test.dart b/pkg/dev_compiler/test/codegen/lib/html/canvas_pixel_array_type_alias_test.dart
index 4dd6b40..1bb2006 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/canvas_pixel_array_type_alias_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/canvas_pixel_array_type_alias_test.dart
@@ -2,12 +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
 
-library CanvasTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 import 'dart:typed_data';
 
+import 'package:expect/minitest.dart';
+
 // We have aliased the legacy type CanvasPixelArray with the new type
 // Uint8ClampedArray by mapping the CanvasPixelArray type tag to
 // Uint8ClampedArray.  It is not a perfect match since CanvasPixelArray is
@@ -16,9 +15,6 @@
 var inscrutable;
 
 main() {
-
-  useHtmlIndividualConfiguration();
-
   inscrutable = (x) => x;
 
   int width = 100;
@@ -39,7 +35,7 @@
       expect(inscrutable(data) is List<int>, isTrue,
           reason: 'canvas array type');
 
-      expect(data, hasLength(40000));
+      expect(data.length, 40000);
       checkPixel(data, 0, [0, 0, 0, 0]);
       checkPixel(data, width * height - 1, [0, 0, 0, 0]);
 
diff --git a/pkg/dev_compiler/test/codegen/lib/html/cdata_test.dart b/pkg/dev_compiler/test/codegen/lib/html/cdata_test.dart
index 424d52f..60c311a 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/cdata_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/cdata_test.dart
@@ -2,15 +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
 
-library cdata_test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
+import 'package:expect/minitest.dart';
 
 main() {
-  useHtmlConfiguration();
-
   test('remove', () {
     var div = new Element.html('<div>content</div>');
     var cdata = div.nodes[0];
diff --git a/pkg/dev_compiler/test/codegen/lib/html/client_rect_test.dart b/pkg/dev_compiler/test/codegen/lib/html/client_rect_test.dart
index b9c9bb54..526e011 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/client_rect_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/client_rect_test.dart
@@ -1,10 +1,8 @@
-library ClientRectTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-main() {
+import 'package:expect/minitest.dart';
 
+main() {
   var isRectList =
       predicate((x) => x is List<Rectangle>, 'is a List<Rectangle>');
 
@@ -19,9 +17,7 @@
     return element;
   }
 
-  useHtmlConfiguration();
-
-   test("ClientRectList test", () {
+  test("ClientRectList test", () {
     insertTestDiv();
     var range = new Range();
     var rects = range.getClientRects();
diff --git a/pkg/dev_compiler/test/codegen/lib/html/cross_frame_test.dart b/pkg/dev_compiler/test/codegen/lib/html/cross_frame_test.dart
index b5a37f6..bdb0d88 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/cross_frame_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/cross_frame_test.dart
@@ -1,11 +1,8 @@
-library CrossFrameTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   var isWindowBase = predicate((x) => x is WindowBase, 'is a WindowBase');
   var isWindow = predicate((x) => x is Window, 'is a Window');
   var isLocationBase = predicate((x) => x is LocationBase, 'is a LocationBase');
@@ -14,7 +11,7 @@
   var isHistoryBase = predicate((x) => x is HistoryBase, 'is a HistoryBase');
   var isHistory = predicate((x) => x is History, 'is a History');
 
-  final iframe = new Element.tag('iframe');
+  final iframe = new IFrameElement();
   document.body.append(iframe);
 
   test('window', () {
diff --git a/pkg/dev_compiler/test/codegen/lib/html/crypto_test.dart b/pkg/dev_compiler/test/codegen/lib/html/crypto_test.dart
index 41666a5..9cb63ab 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/crypto_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/crypto_test.dart
@@ -2,15 +2,12 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library crypto_test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 import 'dart:typed_data';
 
-main() {
-  useHtmlIndividualConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   group('supported', () {
     test('supported', () {
       expect(Crypto.supported, true);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/css_rule_list_test.dart b/pkg/dev_compiler/test/codegen/lib/html/css_rule_list_test.dart
index ade3833..481aca9 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/css_rule_list_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/css_rule_list_test.dart
@@ -1,17 +1,13 @@
-library CssRuleListTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-main() {
+import 'package:expect/minitest.dart';
 
+main() {
   var isCssRuleList =
       predicate((x) => x is List<CssRule>, 'is a List<CssRule>');
 
-  useHtmlConfiguration();
-
   test("ClientRectList test", () {
-    var sheet = document.styleSheets[0];
+    var sheet = document.styleSheets[0] as CssStyleSheet;
     List<CssRule> rulesList = sheet.cssRules;
     expect(rulesList, isCssRuleList);
   });
diff --git a/pkg/dev_compiler/test/codegen/lib/html/custom/document_register_basic_test.dart b/pkg/dev_compiler/test/codegen/lib/html/custom/document_register_basic_test.dart
index cf11b63..33f07ba 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/custom/document_register_basic_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/custom/document_register_basic_test.dart
@@ -2,10 +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.
 
-library document_register_basic_test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
+
+import 'package:expect/minitest.dart';
+
 import '../utils.dart';
 
 class Foo extends HtmlElement {
@@ -45,8 +45,6 @@
 }
 
 main() {
-  useHtmlConfiguration();
-
   // Adapted from Blink's fast/dom/custom/document-register-basic test.
 
   setUp(() => customElementsReady);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/custom/document_register_type_extensions_test.dart b/pkg/dev_compiler/test/codegen/lib/html/custom/document_register_type_extensions_test.dart
index 67957b12..682e821 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/custom/document_register_type_extensions_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/custom/document_register_type_extensions_test.dart
@@ -2,10 +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.
 
-library document_register_type_extensions_test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
+
+import 'package:expect/minitest.dart';
+
 import '../utils.dart';
 
 class Foo extends HtmlElement {
diff --git a/pkg/dev_compiler/test/codegen/lib/html/custom/element_upgrade_test.dart b/pkg/dev_compiler/test/codegen/lib/html/custom/element_upgrade_test.dart
index c8e7376..a1f071b 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/custom/element_upgrade_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/custom/element_upgrade_test.dart
@@ -2,13 +2,12 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library register_element_proxy_test;
-
 import 'dart:async';
 import 'dart:html';
 import 'dart:js' as js;
-import 'package:unittest/html_config.dart';
-import 'package:unittest/unittest.dart';
+
+import 'package:expect/minitest.dart';
+
 import '../utils.dart';
 
 class FooElement extends HtmlElement {
@@ -28,8 +27,6 @@
 }
 
 main() {
-  useHtmlConfiguration();
-
   var registered = false;
   var upgrader;
   setUp(() => customElementsReady.then((_) {
diff --git a/pkg/dev_compiler/test/codegen/lib/html/custom_elements_23127_test.dart b/pkg/dev_compiler/test/codegen/lib/html/custom_elements_23127_test.dart
index 6386690..7b0f576 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/custom_elements_23127_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/custom_elements_23127_test.dart
@@ -56,25 +56,25 @@
 class C1 extends B1 {
   int z;
   C1.created() : super.created();
-  action() => z = 3;
+  action() { z = 3; }
 }
 
 class C1T extends B1T {
   int z;
   C1T.created() : super.created();
-  action() => z = 3;
+  action() { z = 3; }
 }
 
 class C2 extends B2 {
   int z;
   C2.created() : super.created(20);
-  action() => z = 3;
+  action() { z = 3; }
 }
 
 class C2T extends B2T {
   int z;
   C2T.created() : super.created(20);
-  action() => z = 3;
+  action() { z = 3; }
 }
 
 
diff --git a/pkg/dev_compiler/test/codegen/lib/html/custom_elements_test.dart b/pkg/dev_compiler/test/codegen/lib/html/custom_elements_test.dart
index 3ab5207..05fe5d2 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/custom_elements_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/custom_elements_test.dart
@@ -48,7 +48,7 @@
       var tag = nextTag;
       document.registerElement(tag, CustomType);
 
-      var element = new Element.tag(tag);
+      var element = new Element.tag(tag) as CustomType;
       expect(element, isNotNull);
       expect(element is CustomType, isTrue);
       expect(element.createdCalled, isTrue);
@@ -64,7 +64,7 @@
       var newTag = nextTag;
       document.registerElement(newTag, CustomType);
 
-      var element = new Element.tag(newTag);
+      var element = new Element.tag(newTag) as CustomType;
       expect(element, isNotNull);
       expect(element is CustomType, isTrue);
     });
@@ -138,7 +138,7 @@
           treeSanitizer: new NullTreeSanitizer());
 	  upgradeCustomElements(element);
       document.body.nodes.add(element);
-      var queried = query(tag);
+      var queried = query(tag) as CustomType;
 
       expect(queried, isNotNull);
       expect(queried is CustomType, isTrue);
@@ -153,7 +153,7 @@
           treeSanitizer: new NullTreeSanitizer());
 	  upgradeCustomElements(element);
       document.body.nodes.add(element);
-      var queried = query('#someid');
+      var queried = query('#someid') as CustomType;
 
       expect(queried, isNotNull);
       expect(queried is CustomType, isTrue);
@@ -180,7 +180,7 @@
       var tag = nextTag;
       document.registerElement(tag, CustomType);
 
-      var element = new Element.tag(tag);
+      var element = new Element.tag(tag) as CustomType;
       element.invokeMixinMethod();
       expect(element.mixinMethodCalled, isTrue);
     });
diff --git a/pkg/dev_compiler/test/codegen/lib/html/custom_tags_test.dart b/pkg/dev_compiler/test/codegen/lib/html/custom_tags_test.dart
index 5f5457b..5c91168 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/custom_tags_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/custom_tags_test.dart
@@ -2,15 +2,13 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library custom_tags_test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
+
+import 'package:expect/minitest.dart';
+
 import 'utils.dart';
 
 main() {
-  useHtmlConfiguration();
-
   test('create via custom tag', () {
     var element = new Element.tag('x-basic1')..id = 'basic1';
     document.body.nodes.add(element);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/dart_object_local_storage_test.dart b/pkg/dev_compiler/test/codegen/lib/html/dart_object_local_storage_test.dart
index 22add6a..502f08a 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/dart_object_local_storage_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/dart_object_local_storage_test.dart
@@ -1,16 +1,13 @@
-library DartObjectLocalStorageTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
+import 'package:expect/minitest.dart';
+
 // TODO(vsm): Rename this to wrapper_caching_test or similar.  It's
 // basically a port of dom/dart_object_local_storage_test.dart.  For
 // wrapping implementation of dart:html (i.e., the dartium one), it is
 // effectively testing dart_object_local_storage in the underlying dom
 // object.
 main() {
-  useHtmlConfiguration();
-
   BodyElement body = document.body;
   Storage localStorage = window.localStorage;
   Storage sessionStorage = window.sessionStorage;
diff --git a/pkg/dev_compiler/test/codegen/lib/html/datalistelement_test.dart b/pkg/dev_compiler/test/codegen/lib/html/datalistelement_test.dart
index 2fd9fa8..f831a45 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/datalistelement_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/datalistelement_test.dart
@@ -2,14 +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.
 
-library datalistelement_dataview_test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   var isDataListElement =
       predicate((x) => x is DataListElement, 'is a DataListElement');
 
@@ -46,15 +43,15 @@
 
   test('list', () {
     expect(() {
-      var list = document.query('#browsers');
-      var input = document.query('#input');
+      var list = document.query('#browsers') as DataListElement;
+      var input = document.query('#input') as InputElement;
       expect(input.list, list);
     }, expectation);
   });
 
   test('options', () {
     expect(() {
-      var options = document.query('#browsers').options;
+      var options = (document.query('#browsers') as DataListElement).options;
       expect(options.length, 5);
     }, expectation);
   });
diff --git a/pkg/dev_compiler/test/codegen/lib/html/document_test.dart b/pkg/dev_compiler/test/codegen/lib/html/document_test.dart
index 2ed520f..b7d8f60 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/document_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/document_test.dart
@@ -1,11 +1,8 @@
-library DocumentTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlIndividualConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   var isElement = predicate((x) => x is Element, 'is an Element');
   var isDivElement = predicate((x) => x is DivElement, 'is a DivElement');
   var isAnchorElement =
@@ -59,7 +56,7 @@
       var div = new Element.html('<div><div id="foo">bar</div></div>');
       var doc = document.implementation.createHtmlDocument('');
       var div2 = doc.importNode(div, true);
-      expect(div2, isNot(equals(div)));
+      expect(div2, notEquals(div));
       expect(div2.ownerDocument, doc);
       doc.body.nodes.add(div2);
       expect(doc.query('#foo').text, 'bar');
diff --git a/pkg/dev_compiler/test/codegen/lib/html/documentfragment_test.dart b/pkg/dev_compiler/test/codegen/lib/html/documentfragment_test.dart
index b09c04d..3b5249f 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/documentfragment_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/documentfragment_test.dart
@@ -2,15 +2,13 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library DocumentFragmentTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
-import 'util.dart';
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+import 'util.dart';
+
+main() {
   var isAnchorElement =
       predicate((x) => x is AnchorElement, 'is an AnchorElement');
 
@@ -42,7 +40,7 @@
     expect(style.cssText, equals(''));
     expect(style.getPropertyPriority('color'), equals(''));
     expect(style.item(0), equals(''));
-    expect(style.length, isZero);
+    expect(style.length, equals(0));
     // TODO(jacobr): these checks throw UnimplementedErrors in dartium.
     // expect(style.parentRule, isNull);
     // expect(style.getPropertyCssValue('color'), isNull);
@@ -81,8 +79,8 @@
   });
 
   group('children', () {
-    var fragment;
-    var children;
+    DocumentFragment fragment;
+    List<Element> children;
 
     init() {
       fragment = new DocumentFragment();
@@ -102,36 +100,36 @@
     test('filters out non-element nodes', () {
       init();
       expect(_nodeStrings(fragment.nodes),
-          orderedEquals(["1", "A", "B", "2", "I", "3", "U"]));
+          equals(["1", "A", "B", "2", "I", "3", "U"]));
       expect(_nodeStrings(children),
-          orderedEquals(["A", "B", "I", "U"]));
+          equals(["A", "B", "I", "U"]));
     });
 
     test('only indexes children, not other nodes', () {
       init();
       children[1] = new Element.tag("BR");
       expect(_nodeStrings(fragment.nodes),
-          orderedEquals(["1", "A", "BR", "2", "I", "3", "U"]));
+          equals(["1", "A", "BR", "2", "I", "3", "U"]));
       expect(_nodeStrings(children),
-          orderedEquals(["A", "BR", "I", "U"]));
+          equals(["A", "BR", "I", "U"]));
     });
 
     test('adds to both children and nodes', () {
       init();
       children.add(new Element.tag("UL"));
       expect(_nodeStrings(fragment.nodes),
-          orderedEquals(["1", "A", "B", "2", "I", "3", "U", "UL"]));
+          equals(["1", "A", "B", "2", "I", "3", "U", "UL"]));
       expect(_nodeStrings(children),
-          orderedEquals(["A", "B", "I", "U", "UL"]));
+          equals(["A", "B", "I", "U", "UL"]));
     });
 
     test('removes only children, from both children and nodes', () {
       init();
       expect(children.removeLast().tagName, equals('U'));
       expect(_nodeStrings(fragment.nodes),
-          orderedEquals(["1", "A", "B", "2", "I", "3"]));
+          equals(["1", "A", "B", "2", "I", "3"]));
       expect(_nodeStrings(children),
-          orderedEquals(["A", "B", "I"]));
+          equals(["A", "B", "I"]));
 
       expect(children.removeLast().tagName, "I");
       expect(_nodeStrings(fragment.nodes),
diff --git a/pkg/dev_compiler/test/codegen/lib/html/dom_constructors_test.dart b/pkg/dev_compiler/test/codegen/lib/html/dom_constructors_test.dart
index a2bcf55..38c661a 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/dom_constructors_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/dom_constructors_test.dart
@@ -1,10 +1,8 @@
-library DOMConstructorsTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
+import 'package:expect/minitest.dart';
+
 main() {
-  useHtmlConfiguration();
   test('FileReader', () {
     FileReader fileReader = new FileReader();
     expect(fileReader.readyState, equals(FileReader.EMPTY));
diff --git a/pkg/dev_compiler/test/codegen/lib/html/domparser_test.dart b/pkg/dev_compiler/test/codegen/lib/html/domparser_test.dart
index 61ecf86..51f8ce1 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/domparser_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/domparser_test.dart
@@ -1,17 +1,13 @@
-library DOMParserTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
+import 'package:expect/minitest.dart';
+
 main() {
-
-  useHtmlConfiguration();
-
   var isDomParser = predicate((x) => x is DomParser, 'is a DomParser');
 
   test('constructorTest', () {
-      var ctx = new DomParser();
-      expect(ctx, isNotNull);
-      expect(ctx, isDomParser);
+    var ctx = new DomParser();
+    expect(ctx, isNotNull);
+    expect(ctx, isDomParser);
   });
 }
diff --git a/pkg/dev_compiler/test/codegen/lib/html/element_add_test.dart b/pkg/dev_compiler/test/codegen/lib/html/element_add_test.dart
index 2c2ea01..fc346d2 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/element_add_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/element_add_test.dart
@@ -2,15 +2,13 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file
 
-library ElementAddTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
-import 'util.dart';
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+import 'util.dart';
+
+main() {
   var isSpanElement = predicate((x) => x is SpanElement, 'is a SpanElemt');
   var isDivElement = predicate((x) => x is DivElement, 'is a DivElement');
   var isText = predicate((x) => x is Text, 'is a Text');
diff --git a/pkg/dev_compiler/test/codegen/lib/html/element_classes_svg_test.dart b/pkg/dev_compiler/test/codegen/lib/html/element_classes_svg_test.dart
index 0acd2a7..44d47f4 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/element_classes_svg_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/element_classes_svg_test.dart
@@ -2,13 +2,12 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library ElementTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:collection';
 import 'dart:html';
 import 'dart:svg' as svg;
 
+import 'package:expect/minitest.dart';
+
 // Test for `querySelectorAll(xxx).classes.op()` where the query returns mixed
 // Html and Svg elements.
 
@@ -53,8 +52,6 @@
 }
 
 main() {
-  useHtmlConfiguration();
-
   Set<String> extractClasses(Element el) {
     final match = new RegExp('class="([^"]+)"').firstMatch(el.outerHtml);
     return new LinkedHashSet.from(match[1].split(' '));
@@ -82,8 +79,8 @@
     expect(view(elements2), '[[foo, qux], [foo, qux], [foo, qux], [foo, qux]]');
 
     for (Element e in elements2) {
-      expect(e.classes, orderedEquals(['foo', 'qux']));
-      expect(extractClasses(e), orderedEquals(['foo', 'qux']));
+      expect(e.classes, equals(['foo', 'qux']));
+      expect(extractClasses(e), equals(['foo', 'qux']));
     }
 
     elements.classes = [];
@@ -103,7 +100,6 @@
     expect(elements.classes.contains('troll'), isFalse);
   });
 
-
   test('listAdd', () {
     var elements =  elementsSetup();
     var added = elements.classes.add('lassie');
diff --git a/pkg/dev_compiler/test/codegen/lib/html/element_classes_test.dart b/pkg/dev_compiler/test/codegen/lib/html/element_classes_test.dart
index 2846d0d..0139471 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/element_classes_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/element_classes_test.dart
@@ -2,18 +2,17 @@
 // for 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 ElementTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:collection';
 import 'dart:html';
 
+import 'package:expect/minitest.dart';
+
 Element makeElement() => new Element.tag('div');
 
 Element makeElementWithClasses() =>
     new Element.html('<div class="foo bar baz"></div>');
 
-Set<String> makeClassSet() => makeElementWithClasses().classes;
+CssClassSet makeClassSet() => makeElementWithClasses().classes;
 
 Element makeListElement() =>
     new Element.html('<ul class="foo bar baz">'
@@ -47,43 +46,40 @@
 }
 
 main() {
-  useHtmlConfiguration();
-
   Set<String> extractClasses(Element el) {
     final match = new RegExp('class="([^"]+)"').firstMatch(el.outerHtml);
     return new LinkedHashSet.from(match[1].split(' '));
   }
 
-
   test('affects the "class" attribute', () {
     final el = makeElementWithClasses();
     el.classes.add('qux');
-    expect(extractClasses(el), orderedEquals(['foo', 'bar', 'baz', 'qux']));
+    expect(extractClasses(el), equals(['foo', 'bar', 'baz', 'qux']));
   });
 
   test('is affected by the "class" attribute', () {
     final el = makeElementWithClasses();
     el.attributes['class'] = 'foo qux';
-    expect(el.classes, orderedEquals(['foo', 'qux']));
+    expect(el.classes, equals(['foo', 'qux']));
   });
 
   test('classes=', () {
     final el = makeElementWithClasses();
     el.classes = ['foo', 'qux'];
-    expect(el.classes, orderedEquals(['foo', 'qux']));
-    expect(extractClasses(el), orderedEquals(['foo', 'qux']));
+    expect(el.classes, equals(['foo', 'qux']));
+    expect(extractClasses(el), equals(['foo', 'qux']));
   });
 
   test('toString', () {
     expect(makeClassSet().toString().split(' '),
-        orderedEquals(['foo', 'bar', 'baz']));
+        equals(['foo', 'bar', 'baz']));
     expect(makeElement().classes.toString(), '');
   });
 
   test('forEach', () {
     final classes = <String>[];
     makeClassSet().forEach(classes.add);
-    expect(classes, orderedEquals(['foo', 'bar', 'baz']));
+    expect(classes, equals(['foo', 'bar', 'baz']));
   });
 
   test('iterator', () {
@@ -91,17 +87,17 @@
     for (var el in makeClassSet()) {
       classes.add(el);
     }
-    expect(classes, orderedEquals(['foo', 'bar', 'baz']));
+    expect(classes, equals(['foo', 'bar', 'baz']));
   });
 
   test('map', () {
     expect(makeClassSet().map((c) => c.toUpperCase()).toList(),
-        orderedEquals(['FOO', 'BAR', 'BAZ']));
+        equals(['FOO', 'BAR', 'BAZ']));
   });
 
   test('where', () {
     expect(makeClassSet().where((c) => c.contains('a')).toList(),
-        orderedEquals(['bar', 'baz']));
+        equals(['bar', 'baz']));
   });
 
   test('every', () {
@@ -142,13 +138,13 @@
     final classes = makeClassSet();
     var added = classes.add('qux');
     expect(added, isTrue);
-    expect(classes, orderedEquals(['foo', 'bar', 'baz', 'qux']));
+    expect(classes, equals(['foo', 'bar', 'baz', 'qux']));
 
     added = classes.add('qux');
     expect(added, isFalse);
     final list = new List.from(classes);
     list.sort((a, b) => a.compareTo(b));
-    expect(list, orderedEquals(['bar', 'baz', 'foo', 'qux']),
+    expect(list, equals(['bar', 'baz', 'foo', 'qux']),
         reason: "The class set shouldn't have duplicate elements.");
   });
 
@@ -161,9 +157,9 @@
   test('remove', () {
     final classes = makeClassSet();
     classes.remove('bar');
-    expect(classes, orderedEquals(['foo', 'baz']));
+    expect(classes, equals(['foo', 'baz']));
     classes.remove('qux');
-    expect(classes, orderedEquals(['foo', 'baz']));
+    expect(classes, equals(['foo', 'baz']));
   });
 
   test('remove-bad', () {
@@ -175,18 +171,18 @@
   test('toggle', () {
     final classes = makeClassSet();
     classes.toggle('bar');
-    expect(classes, orderedEquals(['foo', 'baz']));
+    expect(classes, equals(['foo', 'baz']));
     classes.toggle('qux');
-    expect(classes, orderedEquals(['foo', 'baz', 'qux']));
+    expect(classes, equals(['foo', 'baz', 'qux']));
 
     classes.toggle('qux', true);
-    expect(classes, orderedEquals(['foo', 'baz', 'qux']));
+    expect(classes, equals(['foo', 'baz', 'qux']));
     classes.toggle('qux', false);
-    expect(classes, orderedEquals(['foo', 'baz']));
+    expect(classes, equals(['foo', 'baz']));
     classes.toggle('qux', false);
-    expect(classes, orderedEquals(['foo', 'baz']));
+    expect(classes, equals(['foo', 'baz']));
     classes.toggle('qux', true);
-    expect(classes, orderedEquals(['foo', 'baz', 'qux']));
+    expect(classes, equals(['foo', 'baz', 'qux']));
   });
 
   test('toggle-bad', () {
@@ -202,43 +198,43 @@
   test('addAll', () {
     final classes = makeClassSet();
     classes.addAll(['bar', 'qux', 'bip']);
-    expect(classes, orderedEquals(['foo', 'bar', 'baz', 'qux', 'bip']));
+    expect(classes, equals(['foo', 'bar', 'baz', 'qux', 'bip']));
   });
 
   test('removeAll', () {
     final classes = makeClassSet();
     classes.removeAll(['bar', 'baz', 'qux']);
-    expect(classes, orderedEquals(['foo']));
+    expect(classes, equals(['foo']));
   });
 
   test('toggleAll', () {
     final classes = makeClassSet();
     classes.toggleAll(['bar', 'foo']);
-    expect(classes, orderedEquals(['baz']));
+    expect(classes, equals(['baz']));
     classes.toggleAll(['qux', 'quux']);
-    expect(classes, orderedEquals(['baz', 'qux', 'quux']));
+    expect(classes, equals(['baz', 'qux', 'quux']));
     classes.toggleAll(['bar', 'foo'], true);
-    expect(classes, orderedEquals(['baz', 'qux', 'quux', 'bar', 'foo']));
+    expect(classes, equals(['baz', 'qux', 'quux', 'bar', 'foo']));
     classes.toggleAll(['baz', 'quux'], false);
-    expect(classes, orderedEquals(['qux','bar', 'foo']));
+    expect(classes, equals(['qux','bar', 'foo']));
   });
 
   test('retainAll', () {
     final classes = makeClassSet();
     classes.retainAll(['bar', 'baz', 'qux']);
-    expect(classes, orderedEquals(['bar', 'baz']));
+    expect(classes, equals(['bar', 'baz']));
   });
 
   test('removeWhere', () {
     final classes = makeClassSet();
     classes.removeWhere((s) => s.startsWith('b'));
-    expect(classes, orderedEquals(['foo']));
+    expect(classes, equals(['foo']));
   });
 
   test('retainWhere', () {
     final classes = makeClassSet();
     classes.retainWhere((s) => s.startsWith('b'));
-    expect(classes, orderedEquals(['bar', 'baz']));
+    expect(classes, equals(['bar', 'baz']));
   });
 
   test('containsAll', () {
@@ -264,11 +260,11 @@
   test('order', () {
     var classes = makeClassSet();
     classes.add('aardvark');
-    expect(classes, orderedEquals(['foo', 'bar', 'baz', 'aardvark']));
+    expect(classes, equals(['foo', 'bar', 'baz', 'aardvark']));
     classes.toggle('baz');
-    expect(classes, orderedEquals(['foo', 'bar', 'aardvark']));
+    expect(classes, equals(['foo', 'bar', 'aardvark']));
     classes.toggle('baz');
-    expect(classes, orderedEquals(['foo', 'bar', 'aardvark', 'baz']));
+    expect(classes, equals(['foo', 'bar', 'aardvark', 'baz']));
   });
 
   tearDown(listElementTearDown);
@@ -286,8 +282,8 @@
     elements.classes = ['foo', 'qux'];
     elements = document.queryAll('li');
     for (Element e in elements) {
-      expect(e.classes, orderedEquals(['foo', 'qux']));
-      expect(extractClasses(e), orderedEquals(['foo', 'qux']));
+      expect(e.classes, equals(['foo', 'qux']));
+      expect(extractClasses(e), equals(['foo', 'qux']));
     }
 
     elements.classes = [];
diff --git a/pkg/dev_compiler/test/codegen/lib/html/element_constructor_1_test.dart b/pkg/dev_compiler/test/codegen/lib/html/element_constructor_1_test.dart
index b53e366..f97ce0f 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/element_constructor_1_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/element_constructor_1_test.dart
@@ -6,25 +6,22 @@
 // Move constructors that fail on some configuration to their own
 // element_constructor_foo_test.dart file.
 
-library ElementConstructorTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
-  var isAnchorElement = 
+main() {
+  var isAnchorElement =
       predicate((x) => x is AnchorElement, 'is an AnchorElement');
-  var isAreaElement = 
+  var isAreaElement =
       predicate((x) => x is AreaElement, 'is an AreaElement');
   var isDivElement = predicate((x) => x is DivElement, 'is a DivElement');
-  var isCanvasElement = 
+  var isCanvasElement =
       predicate((x) => x is CanvasElement, 'is a CanvasElement');
   var isParagraphElement =
       predicate((x) => x is ParagraphElement, 'is a ParagraphElement');
   var isSpanElement = predicate((x) => x is SpanElement, 'is a SpanElement');
-  var isSelectElement = 
+  var isSelectElement =
       predicate((x) => x is SelectElement, 'is a SelectElement');
 
   test('anchor1', () {
@@ -35,7 +32,7 @@
   test('anchor2', () {
       var e = new AnchorElement(href: '#blah');
       expect(e, isAnchorElement);
-      expect(e.href, endsWith('#blah'));
+      expect(e.href.endsWith('#blah'), isTrue);
     });
 
   test('area', () {
diff --git a/pkg/dev_compiler/test/codegen/lib/html/element_dimensions_test.dart b/pkg/dev_compiler/test/codegen/lib/html/element_dimensions_test.dart
index 413d302..2f11c40 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/element_dimensions_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/element_dimensions_test.dart
@@ -2,14 +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
 
-library element_dimensions_test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   var isElement = predicate((x) => x is Element, 'is an Element');
   var isCanvasElement =
       predicate((x) => x is CanvasElement, 'is a CanvasElement');
diff --git a/pkg/dev_compiler/test/codegen/lib/html/element_offset_test.dart b/pkg/dev_compiler/test/codegen/lib/html/element_offset_test.dart
index e7129d0..7e66523 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/element_offset_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/element_offset_test.dart
@@ -2,14 +2,12 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library element_offset_test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:async';
 import 'dart:html';
 
+import 'package:expect/minitest.dart';
+
 main() {
-  useHtmlIndividualConfiguration();
   void initPage() {
     var level1 = new UListElement()
       ..classes.add('level-1')
diff --git a/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors1_test.dart b/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors1_test.dart
index 202556a..d867cba 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors1_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors1_test.dart
@@ -2,12 +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.
 
-library element_types_constructors1_test;
-
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 
+import 'package:expect/minitest.dart';
+
 main() {
   check(String name, bool fn(), [bool supported = true]) {
     test(name, () {
diff --git a/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors2_test.dart b/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors2_test.dart
index 07a5fc4..9812ac7 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors2_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors2_test.dart
@@ -2,15 +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.
 
-library element_types_constructors2_test;
-
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlIndividualConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   check(String name, bool fn(), [bool supported = true]) {
     test(name, () {
       var expectation = supported ? returnsNormally : throws;
diff --git a/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors3_test.dart b/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors3_test.dart
index 54324a6..8c3957e 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors3_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors3_test.dart
@@ -2,15 +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.
 
-library element_types_constructors3_test;
-
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlIndividualConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   check(String name, bool fn(), [bool supported = true]) {
     test(name, () {
       var expectation = supported ? returnsNormally : throws;
diff --git a/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors4_test.dart b/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors4_test.dart
index 38223c9..f25660c 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors4_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors4_test.dart
@@ -2,15 +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.
 
-library element_types_constructors_test4;
-
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlIndividualConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   check(String name, bool fn(), [bool supported = true]) {
     test(name, () {
       var expectation = supported ? returnsNormally : throws;
diff --git a/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors5_test.dart b/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors5_test.dart
index e930ac1..3b66d81 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors5_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors5_test.dart
@@ -2,15 +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.
 
-library element_types_constructors5_test;
-
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlIndividualConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   check(String name, bool fn(), [bool supported = true]) {
     test(name, () {
       var expectation = supported ? returnsNormally : throws;
diff --git a/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors6_test.dart b/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors6_test.dart
index 6049ffc..57724b3 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors6_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/element_types_constructors6_test.dart
@@ -2,15 +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.
 
-library element_types_constructors6_test;
-
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlIndividualConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   check(String name, bool fn(), [bool supported = true]) {
     test(name, () {
       var expectation = supported ? returnsNormally : throws;
diff --git a/pkg/dev_compiler/test/codegen/lib/html/element_types_test.dart b/pkg/dev_compiler/test/codegen/lib/html/element_types_test.dart
index ab06012..2f01a7d 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/element_types_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/element_types_test.dart
@@ -2,14 +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.
 
-library element_types;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlIndividualConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   group('supported_content', () {
     test('supported', () {
       expect(ContentElement.supported, true);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/event_test.dart b/pkg/dev_compiler/test/codegen/lib/html/event_test.dart
index 14c92f1..82dc104 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/event_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/event_test.dart
@@ -2,14 +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.
 
-library EventTest;
-import "package:expect/expect.dart";
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-// TODO(nweiz): Make this private to testEvents when Frog supports closures with
-// optional arguments.
+import 'package:expect/minitest.dart';
+
 eventTest(String name, Event eventFn(), void validate(Event),
     [String type = 'foo']) {
   test(name, () {
@@ -25,8 +21,6 @@
 }
 
 main() {
-  useHtmlConfiguration();
-
   // Issue 1005.
   // eventTest('AnimationEvent', () => new AnimationEvent('foo', 'color', 0.5),
   //     (ev) {
@@ -101,7 +95,7 @@
 
   eventTest('MouseEvent',
       () => new MouseEvent('foo', view: window, detail: 1, screenX: 2,
-          screenY: 3, clientX: 4, clientY: 5, button: 6, 
+          screenY: 3, clientX: 4, clientY: 5, button: 6,
           ctrlKey: true, altKey: true, shiftKey: true,
           metaKey: true, relatedTarget: document.body),
       (ev) {
diff --git a/pkg/dev_compiler/test/codegen/lib/html/exceptions_test.dart b/pkg/dev_compiler/test/codegen/lib/html/exceptions_test.dart
index d7603b9..e07c328 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/exceptions_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/exceptions_test.dart
@@ -1,11 +1,8 @@
-library ExceptionsTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   test('EventException', () {
     final event = new Event('Event');
     // Intentionally do not initialize it!
diff --git a/pkg/dev_compiler/test/codegen/lib/html/filteredelementlist_test.dart b/pkg/dev_compiler/test/codegen/lib/html/filteredelementlist_test.dart
index b4110f7..eb5e364 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/filteredelementlist_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/filteredelementlist_test.dart
@@ -1,10 +1,8 @@
-library filteredelementlist_test;
-
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 import 'dart:html_common';
 
+import 'package:expect/minitest.dart';
+
 main() {
   var t1 = new Text('T1'),
       t2 = new Text('T2'),
@@ -28,8 +26,6 @@
     return testDiv;
   }
 
-  useHtmlConfiguration();
-
   test('FilteredElementList.insert test', () {
     var i = new DivElement();
 
@@ -95,8 +91,8 @@
  test('FilteredElementList.insertAndRemove', () {
     var emptyDiv = new DivElement();
     var elementList = new FilteredElementList(emptyDiv);
-    expect(() => elementList[0], throwsA(isRangeError));
-    expect(() => elementList.insert(2, new BRElement()), throwsA(isRangeError));
+    expect(() => elementList[0], throwsRangeError);
+    expect(() => elementList.insert(2, new BRElement()), throwsRangeError);
     var br = new BRElement();
     elementList.insert(0, br);
     expect(elementList.removeLast(), br);
@@ -106,6 +102,6 @@
     elementList.add(br);
     expect(elementList.remove(br2), isFalse);
     expect(elementList[0], br);
-    expect(() => elementList[1], throwsA(isRangeError));
+    expect(() => elementList[1], throwsRangeError);
  });
 }
diff --git a/pkg/dev_compiler/test/codegen/lib/html/fontface_test.dart b/pkg/dev_compiler/test/codegen/lib/html/fontface_test.dart
index 8247a8a..e7f9302 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/fontface_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/fontface_test.dart
@@ -2,16 +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.
 
-library fontface_test;
-
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
-
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   test("Creation with parameters", () {
     var font =
         new FontFace('Ahem', 'url(Ahem.ttf)', {'variant': 'small-caps'});
diff --git a/pkg/dev_compiler/test/codegen/lib/html/form_element_test.dart b/pkg/dev_compiler/test/codegen/lib/html/form_element_test.dart
index b3b06c3..f1c9222 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/form_element_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/form_element_test.dart
@@ -2,15 +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.
 
-library FormElementTest;
-
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-void main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+void main() {
   var isFormElement = predicate((x) => x is FormElement, 'is a FormElement');
 
   test('constructorTest1', () {
diff --git a/pkg/dev_compiler/test/codegen/lib/html/geolocation_test.dart b/pkg/dev_compiler/test/codegen/lib/html/geolocation_test.dart
index c49e531..889f874 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/geolocation_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/geolocation_test.dart
@@ -2,14 +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.
 
-library geolocation_test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   // Actual tests require browser interaction. This just makes sure the API
   // is present.
   test('is not null', () {
diff --git a/pkg/dev_compiler/test/codegen/lib/html/hidden_dom_1_test.dart b/pkg/dev_compiler/test/codegen/lib/html/hidden_dom_1_test.dart
index 120136b5..a1c5dc3 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/hidden_dom_1_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/hidden_dom_1_test.dart
@@ -1,14 +1,11 @@
-library HiddenDom1Test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
+import 'package:expect/minitest.dart';
+
 // Test that the dart:html API does not leak native jsdom methods:
 //   onfocus setter.
 
 main() {
-  useHtmlConfiguration();
-
   test('test1', () {
     document.body.children.add(new Element.html(r'''
 <div id='div1'>
@@ -17,7 +14,7 @@
     Element e = document.query('#div1');
     expect(e, isNotNull);
 
-    checkNoSuchMethod(() { confuse(e).onfocus = null; });
+    expect(() { confuse(e).onfocus = null; }, throwsNoSuchMethodError);
   });
 
 }
@@ -28,18 +25,5 @@
 
 confuse(x) => opaqueTrue() ? x : (opaqueTrue() ? new Object() : new Decoy());
 
-/** Returns [:true:], but in a way that confuses the compiler. */
+/** Returns `true`, but in a way that confuses the compiler. */
 opaqueTrue() => true;  // Expand as needed.
-
-checkNoSuchMethod(action()) {
-  var ex = null;
-  try {
-    action();
-  } catch (e) {
-    ex = e;
-  }
-  if (ex == null)
-    expect(false, isTrue, reason: 'Action should have thrown exception');
-
-  expect(ex, isNoSuchMethodError);
-}
diff --git a/pkg/dev_compiler/test/codegen/lib/html/hidden_dom_2_test.dart b/pkg/dev_compiler/test/codegen/lib/html/hidden_dom_2_test.dart
index e8abc4e..5e638b1 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/hidden_dom_2_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/hidden_dom_2_test.dart
@@ -1,14 +1,11 @@
-library HiddenDom2Test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
+import 'package:expect/minitest.dart';
+
 // Test that the dart:html API does not leak native jsdom methods:
 //   appendChild operation.
 
 main() {
-  useHtmlConfiguration();
-
   test('test1', () {
     document.body.children.add(new Element.html(r'''
 <div id='div1'>
@@ -18,7 +15,7 @@
     Element e2 = new Element.html(r"<div id='xx'>XX</div>");
     expect(e, isNotNull);
 
-    checkNoSuchMethod(() { confuse(e).appendChild(e2); });
+    expect(() { confuse(e).appendChild(e2); }, throwsNoSuchMethodError);
 
   });
 }
@@ -29,20 +26,5 @@
 
 confuse(x) => opaqueTrue() ? x : (opaqueTrue() ? new Object() : new Decoy());
 
-/** Returns [:true:], but in a way that confuses the compiler. */
+/** Returns `true`, but in a way that confuses the compiler. */
 opaqueTrue() => true;  // Expand as needed.
-
-checkNoSuchMethod(action()) {
-  var ex = null;
-  bool threw = false;
-  try {
-    action();
-  } catch (e) {
-    threw = true;
-    ex = e;
-  }
-  if (!threw)
-    expect(false, isTrue, reason: 'Action should have thrown exception');
-
-  expect(ex, isNoSuchMethodError);
-}
diff --git a/pkg/dev_compiler/test/codegen/lib/html/htmlcollection_test.dart b/pkg/dev_compiler/test/codegen/lib/html/htmlcollection_test.dart
index 9781c3c9..4496106 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/htmlcollection_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/htmlcollection_test.dart
@@ -1,8 +1,10 @@
-library ElementListTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
+import 'package:expect/minitest.dart';
+
+bool isChecked(Element e) => (e as CheckboxInputElement).checked;
+bool isUnchecked(Element e) => !(e as CheckboxInputElement).checked;
+
 // Test that List<Element> implements List<T>
 main() {
   Element insertTestDiv() {
@@ -32,15 +34,13 @@
     return element;
   }
 
-  useHtmlConfiguration();
-
   test('IsList', () {
     Element root = insertTestDiv();
 
     List<Element> eachChecked =
         document.query('#allChecked').children;
 
-    expect(eachChecked, isList);
+    expect(eachChecked is List, isTrue);
 
     root.remove();
   });
@@ -60,12 +60,12 @@
     expect(someChecked.length, 4);
     expect(noneChecked.length, 4);
 
-    expect(eachChecked.every((x) => x.checked), isTrue);
-    expect(eachChecked.every((x) => !x.checked), isFalse);
-    expect(someChecked.every((x) => x.checked), isFalse);
-    expect(someChecked.every((x) => !x.checked), isFalse);
-    expect(noneChecked.every((x) => x.checked), isFalse);
-    expect(noneChecked.every((x) => !x.checked), isTrue);
+    expect(eachChecked.every(isChecked), isTrue);
+    expect(eachChecked.every(isUnchecked), isFalse);
+    expect(someChecked.every(isChecked), isFalse);
+    expect(someChecked.every(isUnchecked), isFalse);
+    expect(noneChecked.every(isChecked), isFalse);
+    expect(noneChecked.every(isUnchecked), isTrue);
 
     root.remove();
   });
@@ -85,12 +85,12 @@
     expect(someChecked.length, 4);
     expect(noneChecked.length, 4);
 
-    expect(eachChecked.any((x) => x.checked), isTrue);
-    expect(eachChecked.any((x) => !x.checked), isFalse);
-    expect(someChecked.any((x) => x.checked), isTrue);
-    expect(someChecked.any((x) => !x.checked), isTrue);
-    expect(noneChecked.any((x) => x.checked), isFalse);
-    expect(noneChecked.any((x) => !x.checked), isTrue);
+    expect(eachChecked.any(isChecked), isTrue);
+    expect(eachChecked.any(isUnchecked), isFalse);
+    expect(someChecked.any(isChecked), isTrue);
+    expect(someChecked.any(isUnchecked), isTrue);
+    expect(noneChecked.any(isChecked), isFalse);
+    expect(noneChecked.any(isUnchecked), isTrue);
 
     root.remove();
   });
@@ -110,12 +110,12 @@
     expect(someChecked.length, 4);
     expect(noneChecked.length, 4);
 
-    expect(eachChecked.where((x) => x.checked).length, 4);
-    expect(eachChecked.where((x) => !x.checked).length, 0);
-    expect(someChecked.where((x) => x.checked).length, 2);
-    expect(someChecked.where((x) => !x.checked).length, 2);
-    expect(noneChecked.where((x) => x.checked).length, 0);
-    expect(noneChecked.where((x) => !x.checked).length, 4);
+    expect(eachChecked.where(isChecked).length, 4);
+    expect(eachChecked.where(isUnchecked).length, 0);
+    expect(someChecked.where(isChecked).length, 2);
+    expect(someChecked.where(isUnchecked).length, 2);
+    expect(noneChecked.where(isChecked).length, 0);
+    expect(noneChecked.where(isUnchecked).length, 4);
 
     root.remove();
   });
@@ -161,12 +161,12 @@
     expect(someChecked.length, 4);
     expect(noneChecked.length, 4);
 
-    expect(countWithForEach(eachChecked, (x) => x.checked), 4);
-    expect(countWithForEach(eachChecked, (x) => !x.checked), 0);
-    expect(countWithForEach(someChecked, (x) => x.checked), 2);
-    expect(countWithForEach(someChecked, (x) => !x.checked), 2);
-    expect(countWithForEach(noneChecked, (x) => x.checked), 0);
-    expect(countWithForEach(noneChecked, (x) => !x.checked), 4);
+    expect(countWithForEach(eachChecked, isChecked), 4);
+    expect(countWithForEach(eachChecked, isUnchecked), 0);
+    expect(countWithForEach(someChecked, isChecked), 2);
+    expect(countWithForEach(someChecked, isUnchecked), 2);
+    expect(countWithForEach(noneChecked, isChecked), 0);
+    expect(countWithForEach(noneChecked, isUnchecked), 4);
 
     root.remove();
   });
@@ -195,12 +195,12 @@
     expect(someChecked.length, 4);
     expect(noneChecked.length, 4);
 
-    expect(countWithForLoop(eachChecked, (x) => x.checked), 4);
-    expect(countWithForLoop(eachChecked, (x) => !x.checked), 0);
-    expect(countWithForLoop(someChecked, (x) => x.checked), 2);
-    expect(countWithForLoop(someChecked, (x) => !x.checked), 2);
-    expect(countWithForLoop(noneChecked, (x) => x.checked), 0);
-    expect(countWithForLoop(noneChecked, (x) => !x.checked), 4);
+    expect(countWithForLoop(eachChecked, isChecked), 4);
+    expect(countWithForLoop(eachChecked, isUnchecked), 0);
+    expect(countWithForLoop(someChecked, isChecked), 2);
+    expect(countWithForLoop(someChecked, isUnchecked), 2);
+    expect(countWithForLoop(noneChecked, isChecked), 0);
+    expect(countWithForLoop(noneChecked, isUnchecked), 4);
 
     root.remove();
   });
diff --git a/pkg/dev_compiler/test/codegen/lib/html/htmlelement_test.dart b/pkg/dev_compiler/test/codegen/lib/html/htmlelement_test.dart
index fd22c13..10b0070 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/htmlelement_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/htmlelement_test.dart
@@ -1,11 +1,10 @@
-library ElementTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
+
+import 'package:expect/minitest.dart';
+
 import 'utils.dart';
 
 main() {
-  useHtmlConfiguration();
   test('InnerHTML', () {
     Element element = new Element.tag('div');
     element.id = 'test';
@@ -17,7 +16,7 @@
     element.remove();
   });
   test('HTMLTable', () {
-    Element table = new Element.tag('table');
+    TableElement table = new Element.tag('table');
 
     TableRowElement row = new Element.tag('tr');
     table.append(row);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/htmloptionscollection_test.dart b/pkg/dev_compiler/test/codegen/lib/html/htmloptionscollection_test.dart
index cc5166a..3c1eaaa 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/htmloptionscollection_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/htmloptionscollection_test.dart
@@ -2,18 +2,15 @@
 // for 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 HTMLOptionsCollectionTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   test('indexedAccessTest', () {
     // FIXME: we need some massaging to dart:html to enable HTMLOptionsCollection.add
     // and hence programatic building of collection.
-    final selectElement = new Element.html('''
+    SelectElement selectElement = new Element.html('''
       <select>
         <option value="0">Option0</option>
         <option value="1">Option1</option>
@@ -29,7 +26,7 @@
     expect(optionsCollection[1].text, equals('Option1'));
     expect(optionsCollection[2].text, equals('Option2'));
 
-    expect(() { optionsCollection[0] = 1; }, throws);
+    expect(() { (optionsCollection as dynamic)[0] = 1; }, throws);
 
     // OPTIONALS optionsCollection[0] = new OptionElement(value: '42', data: 'Option42');
     expect(() {
diff --git a/pkg/dev_compiler/test/codegen/lib/html/indexeddb_2_test.dart b/pkg/dev_compiler/test/codegen/lib/html/indexeddb_2_test.dart
index 7350559..f14a3df 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/indexeddb_2_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/indexeddb_2_test.dart
@@ -69,7 +69,7 @@
   obj4['a'] = 100;
   obj4['b'] = 's';
 
-  var cyclic_list = [1, 2, 3];
+  var cyclic_list = <Object>[1, 2, 3];
   cyclic_list[1] = cyclic_list;
 
   go(name, data) => test(name,
diff --git a/pkg/dev_compiler/test/codegen/lib/html/input_element_test.dart b/pkg/dev_compiler/test/codegen/lib/html/input_element_test.dart
index 9509e02..c186399 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/input_element_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/input_element_test.dart
@@ -1,8 +1,7 @@
-library input_element_test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 
+import 'package:expect/minitest.dart';
+
 void check(InputElement element, String type, [bool supported = true]) {
   expect(element is InputElement, true);
   if (supported) {
@@ -13,8 +12,6 @@
 }
 
 main() {
-  useHtmlIndividualConfiguration();
-
   group('supported_search', () {
     test('supported', () {
       expect(SearchInputElement.supported, true);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/instance_of_test.dart b/pkg/dev_compiler/test/codegen/lib/html/instance_of_test.dart
index da664db..4322afb 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/instance_of_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/instance_of_test.dart
@@ -1,8 +1,7 @@
-library InstanceOfTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
+import 'package:expect/minitest.dart';
+
 main() {
   CanvasElement canvas;
 
@@ -13,53 +12,61 @@
 
   var isCanvasRenderingContext = predicate((x) => x is CanvasRenderingContext,
       'is a CanvasRenderingContext');
+  var isNotCanvasRenderingContext = predicate((x) => x is! CanvasRenderingContext,
+      'is not a CanvasRenderingContext');
   var isCanvasRenderingContext2D =
       predicate((x) => x is CanvasRenderingContext2D,
       'is a CanvasRenderingContext2D');
+  var isNotCanvasRenderingContext2D =
+      predicate((x) => x is! CanvasRenderingContext2D,
+      'is not a CanvasRenderingContext2D');
   var isElement = predicate((x) => x is Element, 'is an Element');
+  var isNotElement = predicate((x) => x is! Element, 'is not an Element');
   var isCanvasElement =
       predicate((x) => x is CanvasElement, 'is a CanvasElement');
+  var isNotCanvasElement =
+      predicate((x) => x is! CanvasElement, 'is not a CanvasElement');
   var isImageData = predicate((x) => x is ImageData, 'is an ImageData');
+  var isNotImageData = predicate((x) => x is! ImageData, 'is not an ImageData');
   //var isUint8ClampedArray =
   //  predicate((x) => x is Uint8ClampedArray, 'is a Uint8ClampedArray');
   var isIntList =
       predicate((x) => x is List<int>, 'is a List<int>');
 
-  useHtmlConfiguration();
   test('Instanceof', () {
-    expect(canvas, isNot(isCanvasRenderingContext));
-    expect(canvas, isNot(isCanvasRenderingContext2D));
+    expect(canvas, isNotCanvasRenderingContext);
+    expect(canvas, isNotCanvasRenderingContext2D);
     expect(canvas, isElement);
     expect(canvas, isCanvasElement);
-    expect(canvas, isNot(isImageData));
+    expect(canvas, isNotImageData);
     // expect(canvas, isNot(isCanvasPixelArray));
 
     CanvasRenderingContext2D context = canvas.getContext('2d');
     expect(context, isCanvasRenderingContext);
     expect(context, isCanvasRenderingContext2D);
-    expect(context, isNot(isElement));
-    expect(context, isNot(isCanvasElement));
-    expect(context, isNot(isImageData));
+    expect(context, isNotElement);
+    expect(context, isNotCanvasElement);
+    expect(context, isNotImageData);
     // expect(context, isNot(isCanvasPixelArray));
 
     // FIXME(b/5286633): Interface injection type check workaround.
     var image = context.createImageData(canvas.width as dynamic,
                                         canvas.height as dynamic);
-    expect(image, isNot(isCanvasRenderingContext));
-    expect(image, isNot(isCanvasRenderingContext2D));
-    expect(image, isNot(isElement));
-    expect(image, isNot(isCanvasElement));
+    expect(image, isNotCanvasRenderingContext);
+    expect(image, isNotCanvasRenderingContext2D);
+    expect(image, isNotElement);
+    expect(image, isNotCanvasElement);
     expect(image, isImageData);
     // expect(image, isNot(isCanvasPixelArray));
 
     // Include CanvasPixelArray since constructor and prototype are not
     // available until one is created.
     var bytes = image.data;
-    expect(bytes, isNot(isCanvasRenderingContext));
-    expect(bytes, isNot(isCanvasRenderingContext2D));
-    expect(bytes, isNot(isElement));
-    expect(bytes, isNot(isCanvasElement));
-    expect(bytes, isNot(isImageData));
+    expect(bytes, isNotCanvasRenderingContext);
+    expect(bytes, isNotCanvasRenderingContext2D);
+    expect(bytes, isNotElement);
+    expect(bytes, isNotCanvasElement);
+    expect(bytes, isNotImageData);
     expect(bytes, isIntList);
 
     // FIXME: Ensure this is an SpanElement when we next update
diff --git a/pkg/dev_compiler/test/codegen/lib/html/js_function_getter_test.dart b/pkg/dev_compiler/test/codegen/lib/html/js_function_getter_test.dart
index c8a61b8..4001209 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/js_function_getter_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/js_function_getter_test.dart
@@ -8,9 +8,7 @@
 import 'dart:html';
 
 import 'package:js/js.dart';
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
-import 'package:unittest/html_individual_config.dart';
+import 'package:expect/minitest.dart';
 
 _injectJs() {
   document.body.append(new ScriptElement()
@@ -63,8 +61,6 @@
 main() {
   _injectJs();
 
-  useHtmlIndividualConfiguration();
-
   group('call getter as function', () {
     test('member function', () {
       expect(foo.bar.instanceMember(), equals(0));
diff --git a/pkg/dev_compiler/test/codegen/lib/html/js_test.dart b/pkg/dev_compiler/test/codegen/lib/html/js_test.dart
index ae9d9b3..675ddde 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/js_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/js_test.dart
@@ -2,16 +2,12 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library jsTest;
-
-import 'dart:async';
 import 'dart:html';
 import 'dart:typed_data' show ByteBuffer, Int32List;
 import 'dart:indexed_db' show IdbFactory, KeyRange;
 import 'dart:js';
 
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
+import 'package:expect/minitest.dart';
 
 _injectJs() {
   final script = new ScriptElement();
@@ -230,7 +226,6 @@
 
 main() {
   _injectJs();
-  useHtmlIndividualConfiguration();
 
   group('identity', () {
 
@@ -274,7 +269,7 @@
       var foo2 = new JsObject(context['Foo'], [2]);
       context['foo1'] = foo1;
       context['foo2'] = foo2;
-      expect(foo1, isNot(equals(context['foo2'])));
+      expect(foo1, notEquals(context['foo2']));
       expect(foo2, equals(context['foo2']));
       context.deleteProperty('foo1');
       context.deleteProperty('foo2');
@@ -325,7 +320,7 @@
       var foo = new JsObject(context['Foo'], [42]);
       expect(foo['a'], equals(42));
       expect(foo.callMethod('bar'), equals(42));
-      expect(() => foo.callMethod('baz'), throwsA(isNoSuchMethodError));
+      expect(() => foo.callMethod('baz'), throwsNoSuchMethodError);
     });
 
     test('new container.Foo()', () {
@@ -337,7 +332,7 @@
 
     test('new Array()', () {
       var a = new JsObject(context['Array']);
-      expect(a, new isInstanceOf<JsArray>());
+      expect(a is JsArray, isTrue);
 
       // Test that the object still behaves via the base JsObject interface.
       // JsArray specific tests are below.
@@ -444,7 +439,7 @@
 
     test('new JsObject can return a JsFunction', () {
       var f = new JsObject(context['Function']);
-      expect(f, new isInstanceOf<JsFunction>());
+      expect(f is JsFunction, isTrue);
     });
 
     test('JsFunction.apply on a function defined in JS', () {
@@ -458,7 +453,7 @@
 
     test('JsObject.callMethod on a function defined in JS', () {
       expect(context.callMethod('razzle'), equals(42));
-      expect(() => context.callMethod('dazzle'), throwsA(isNoSuchMethodError));
+      expect(() => context.callMethod('dazzle'), throwsNoSuchMethodError);
     });
 
     test('callMethod with many arguments', () {
@@ -477,7 +472,7 @@
 
     test('callMethod throws if name is not a String or num', () {
       expect(() => context.callMethod(true),
-          throwsA(new isInstanceOf<ArgumentError>()));
+          throwsArgumentError);
     });
 */
   });
@@ -506,7 +501,7 @@
       expect(context.callMethod('isPropertyInstanceOf',
           ['a', context['Array']]), isTrue);
       var a = context['a'];
-      expect(a, new isInstanceOf<JsArray>());
+      expect(a is JsArray, isTrue);
       expect(a, [1, 2, 3]);
       context.deleteProperty('a');
     });
@@ -516,8 +511,8 @@
       expect(context.callMethod('isPropertyInstanceOf',
           ['a', context['Array']]), isTrue);
       var a = context['a'];
-      expect(a, new isInstanceOf<List>());
-      expect(a, isNot(new isInstanceOf<JsArray>()));
+      expect(a is List, isTrue);
+      expect(a is JsArray, isFalse);
       expect(a, [1, 2, 3]);
       context.deleteProperty('a');
     });
@@ -526,17 +521,17 @@
       var array = new JsArray.from([1, 2]);
       expect(array[0], 1);
       expect(array[1], 2);
-      expect(() => array[-1], throwsA(isRangeError));
-      expect(() => array[2], throwsA(isRangeError));
+      expect(() => array[-1], throwsRangeError);
+      expect(() => array[2], throwsRangeError);
     });
 
    test('[]=', () {
-      var array = new JsArray.from([1, 2]);
+      var array = new JsArray<Object>.from([1, 2]);
       array[0] = 'd';
       array[1] = 'e';
       expect(array, ['d', 'e']);
-      expect(() => array[-1] = 3, throwsA(isRangeError));
-      expect(() => array[2] = 3, throwsA(isRangeError));
+      expect(() => array[-1] = 3, throwsRangeError);
+      expect(() => array[2] = 3, throwsRangeError);
     });
 
     test('length', () {
@@ -575,16 +570,16 @@
       expect(array, ['a', 'b']);
       array.insert(2, 'c');
       expect(array, ['a', 'b', 'c']);
-      expect(() => array.insert(4, 'e'), throwsA(isRangeError));
-      expect(() => array.insert(-1, 'e'), throwsA(isRangeError));
+      expect(() => array.insert(4, 'e'), throwsRangeError);
+      expect(() => array.insert(-1, 'e'), throwsRangeError);
     });
 
     test('removeAt', () {
       var array = new JsArray.from(['a', 'b', 'c']);
       expect(array.removeAt(1), 'b');
       expect(array, ['a', 'c']);
-      expect(() => array.removeAt(2), throwsA(isRangeError));
-      expect(() => array.removeAt(-1), throwsA(isRangeError));
+      expect(() => array.removeAt(2), throwsRangeError);
+      expect(() => array.removeAt(-1), throwsRangeError);
     });
 
     test('removeLast', () {
@@ -592,16 +587,16 @@
       expect(array.removeLast(), 'c');
       expect(array, ['a', 'b']);
       array.length = 0;
-      expect(() => array.removeLast(), throwsA(isRangeError));
+      expect(() => array.removeLast(), throwsRangeError);
     });
 
     test('removeRange', () {
       var array = new JsArray.from(['a', 'b', 'c', 'd']);
       array.removeRange(1, 3);
       expect(array, ['a', 'd']);
-      expect(() => array.removeRange(-1, 2), throwsA(isRangeError));
-      expect(() => array.removeRange(0, 3), throwsA(isRangeError));
-      expect(() => array.removeRange(2, 1), throwsA(isRangeError));
+      expect(() => array.removeRange(-1, 2), throwsRangeError);
+      expect(() => array.removeRange(0, 3), throwsRangeError);
+      expect(() => array.removeRange(2, 1), throwsRangeError);
     });
 
     test('setRange', () {
@@ -639,8 +634,7 @@
 
     test('primitives and null throw ArgumentError', () {
       for (var v in ['a', 1, 2.0, true, null]) {
-        expect(() => new JsObject.fromBrowserObject(v),
-            throwsA(new isInstanceOf<ArgumentError>()));
+        expect(() => new JsObject.fromBrowserObject(v), throwsArgumentError);
       }
     });
 
@@ -725,7 +719,7 @@
     });
 
     test('deep convert a complex object', () {
-      final object = {
+      dynamic object = {
         'a': [1, [2, 3]],
         'b': {
           'c': 3,
@@ -744,8 +738,7 @@
     });
 
     test('throws if object is not a Map or Iterable', () {
-      expect(() => new JsObject.jsify('a'),
-          throwsA(new isInstanceOf<ArgumentError>()));
+      expect(() => new JsObject.jsify('a'), throwsArgumentError);
     });
   });
 
@@ -793,7 +786,7 @@
     test('deleteProperty throws if name is not a String or num', () {
       var object = new JsObject.jsify({});
       expect(() => object.deleteProperty(true),
-          throwsA(new isInstanceOf<ArgumentError>()));
+          throwsArgumentError);
     });
   */
 
@@ -808,7 +801,7 @@
     test('hasProperty throws if name is not a String or num', () {
       var object = new JsObject.jsify({});
       expect(() => object.hasProperty(true),
-          throwsA(new isInstanceOf<ArgumentError>()));
+          throwsArgumentError);
     });
 */
 
@@ -829,9 +822,9 @@
     test('[] and []= throw if name is not a String or num', () {
       var object = new JsObject.jsify({});
       expect(() => object[true],
-          throwsA(new isInstanceOf<ArgumentError>()));
+          throwsArgumentError);
       expect(() => object[true] = 1,
-          throwsA(new isInstanceOf<ArgumentError>()));
+          throwsArgumentError);
     });
 */
   });
@@ -916,7 +909,7 @@
           var list = context.callMethod('getNewInt32Array');
           print(list);
           expect(list is Int32List, isTrue);
-          expect(list, orderedEquals([1, 2, 3, 4, 5, 6, 7, 8]));
+          expect(list, equals([1, 2, 3, 4, 5, 6, 7, 8]));
         }
       });
 
@@ -988,7 +981,7 @@
       // is called, or if the other tests in this file are enabled
       skipIE9_test('ImageData', () {
         var canvas = new CanvasElement();
-        var ctx = canvas.getContext('2d');
+        var ctx = canvas.getContext('2d') as CanvasRenderingContext2D;
         context['o'] = ctx.createImageData(1, 1);
         var imageDataType = context['ImageData'];
         expect(context.callMethod('isPropertyInstanceOf', ['o', imageDataType]),
diff --git a/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous2_exp_test.dart b/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous2_exp_test.dart
index d1db741..efd16aa 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous2_exp_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous2_exp_test.dart
@@ -13,8 +13,7 @@
 import 'dart:js' as js;
 
 import 'package:js/js.dart';
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
+import 'package:expect/minitest.dart';
 
 @JS() @anonymous
 class A {
@@ -42,8 +41,6 @@
 }
 
 main() {
-  useHtmlConfiguration();
-
   test('simple', () {
     var b = new B();
     var a = new A(b: b);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous2_test.dart b/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous2_test.dart
index 449269e..058420a 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous2_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous2_test.dart
@@ -9,8 +9,7 @@
 import 'dart:js' as js;
 
 import 'package:js/js.dart';
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
+import 'package:expect/minitest.dart';
 
 @JS() @anonymous
 class A {
@@ -38,8 +37,6 @@
 }
 
 main() {
-  useHtmlConfiguration();
-
   test('simple', () {
     var b = new B();
     var a = new A(b: b);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous_exp_test.dart b/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous_exp_test.dart
index 8fdd50f..12af29e 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous_exp_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous_exp_test.dart
@@ -13,8 +13,7 @@
 import 'dart:js' as js;
 
 import 'package:js/js.dart';
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
+import 'package:expect/minitest.dart';
 
 @JS() @anonymous
 class Literal {
@@ -26,8 +25,6 @@
 }
 
 main() {
-  useHtmlConfiguration();
-
   test('simple', () {
     var l = new Literal(x: 3, y: "foo");
     expect(l.x, equals(3));
diff --git a/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous_test.dart b/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous_test.dart
index c4836c8..de36b8e 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous_test.dart
@@ -9,8 +9,7 @@
 import 'dart:js' as js;
 
 import 'package:js/js.dart';
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
+import 'package:expect/minitest.dart';
 
 @JS() @anonymous
 class Literal {
@@ -22,8 +21,6 @@
 }
 
 main() {
-  useHtmlConfiguration();
-
   test('simple', () {
     var l = new Literal(x: 3, y: "foo");
     expect(l.x, equals(3));
diff --git a/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous_unreachable_exp_test.dart b/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous_unreachable_exp_test.dart
index 7754012..1b9dc7d 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous_unreachable_exp_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous_unreachable_exp_test.dart
@@ -13,8 +13,7 @@
 import 'dart:js' as js;
 
 import 'package:js/js.dart';
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
+import 'package:expect/minitest.dart';
 
 @JS() @anonymous
 class Literal {
@@ -26,7 +25,6 @@
 }
 
 main() {
-  useHtmlConfiguration();
   test('nothing to do', () {
     // This test is empty, but it is a regression for Issue# 24974: dartjs
     // would crash trying to compile code that used @anonymous and that was
diff --git a/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous_unreachable_test.dart b/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous_unreachable_test.dart
index bbd97f0..6440c15 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous_unreachable_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_anonymous_unreachable_test.dart
@@ -9,8 +9,7 @@
 import 'dart:js' as js;
 
 import 'package:js/js.dart';
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
+import 'package:expect/minitest.dart';
 
 @JS() @anonymous
 class Literal {
@@ -22,7 +21,6 @@
 }
 
 main() {
-  useHtmlConfiguration();
   test('nothing to do', () {
     // This test is empty, but it is a regression for Issue# 24974: dartjs
     // would crash trying to compile code that used @anonymous and that was
diff --git a/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_default_arg_test.dart b/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_default_arg_test.dart
index 69a0756..963b0ba 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_default_arg_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_default_arg_test.dart
@@ -7,10 +7,8 @@
 
 import 'dart:html';
 
-import 'package:expect/expect.dart' show NoInline;
 import 'package:js/js.dart';
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
+import 'package:expect/minitest.dart';
 
 _injectJs() {
   document.body.append(new ScriptElement()
@@ -34,7 +32,6 @@
 
 main() {
   _injectJs();
-  useHtmlConfiguration();
 
   test('call directly from dart', () {
     expect(Foo.get42(2), 2);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_lazy_test.dart b/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_lazy_test.dart
new file mode 100644
index 0000000..97af07f
--- /dev/null
+++ b/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_lazy_test.dart
@@ -0,0 +1,114 @@
+// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+@JS()
+library js_typed_interop_lazy_test;
+
+import 'dart:html';
+
+import 'package:js/js.dart';
+import 'package:js/js_util.dart' as js_util;
+import 'package:expect/minitest.dart';
+
+@JS('someProperty')
+external get foo;
+
+@JS('baz.bar')
+external get bar;
+
+@JS('baz.LazyClass')
+class LazyClass {
+  external factory LazyClass(a);
+  external get a;
+}
+
+@anonymous
+@JS('some.bogus.ignored.js.path')
+class AnonClass {
+  external factory AnonClass({a});
+  external get a;
+}
+
+@anonymous
+@JS()
+class AnonClass2 {
+  external factory AnonClass2({b});
+  external get b;
+}
+
+abstract class Foo<T> {
+  T get obj;
+}
+
+// This class would cause compile time issues if JS classes are not properly lazy.
+class FooImpl extends Foo<LazyClass> {
+  LazyClass get obj => new LazyClass(100);
+}
+
+main() {
+  group('lazy property', () {
+    test('simple', () {
+      expect(foo, isNull);
+      js_util.setProperty(window, 'someProperty', 42);
+      expect(foo, equals(42));
+    });
+
+    test('nested', () {
+      js_util.setProperty(window, 'baz', js_util.newObject());
+      expect(bar, isNull);
+      js_util.setProperty(window, 'baz', js_util.jsify({'bar': 100}));
+      expect(bar, equals(100));
+    });
+  });
+
+  group('lazy class', () {
+    test('type literal', () {
+      // Fine because we can determine the class literals are equal without
+      // having to determine what (non-existant) JS type they correspond to.
+      var x = LazyClass;
+      var y = LazyClass;
+      expect(x == y, isTrue);
+    });
+
+    test('reference in type parameter', () {
+      var o = new FooImpl();
+      expect(o is Foo<LazyClass>, isTrue);
+    });
+
+    test('create instance', () {
+      document.body.append(new ScriptElement()
+        ..type = 'text/javascript'
+        ..innerHtml = r"""
+window.baz = {};
+
+baz.LazyClass = function LazyClass(a) {
+  this.a = a;
+};
+""");
+      var l = new LazyClass(42);
+      expect(l.a, equals(42));
+      expect(l is LazyClass, isTrue);
+      expect(l is AnonClass, isTrue);
+      expect((l as AnonClass) == l, isTrue);
+      expect((l as AnonClass2) == l, isTrue);
+      var anon = new AnonClass(a: 42);
+      expect(anon is! LazyClass, isTrue);
+      expect(anon is AnonClass, isTrue);
+      expect(anon is AnonClass2, isTrue);
+
+      // Sanity check that is and as are not broken.
+      expect(new Object() is! LazyClass, isTrue);
+      expect(new Object() is! AnonClass, isTrue);
+      expect(new Object() is! AnonClass2, isTrue);
+
+      expect(<AnonClass>[] is List<AnonClass>, isTrue);
+      // TODO(jacobr): why doesn't this test pass?
+      // expect(<AnonClass>[] is List<AnonClass2>, isTrue);
+      expect(<int>[] is! List<AnonClass>, isTrue);
+      expect(<AnonClass>[] is! List<LazyClass>, isTrue);
+      expect(<int>[] is! List<LazyClass>, isTrue);
+      expect(<LazyClass>[] is List<LazyClass>, isTrue);
+    });
+  });
+}
diff --git a/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_rename_static_test.dart b/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_rename_static_test.dart
new file mode 100644
index 0000000..99c3bac
--- /dev/null
+++ b/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_rename_static_test.dart
@@ -0,0 +1,95 @@
+// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+@JS()
+library js_typed_interop_rename_static_test;
+
+import 'dart:html';
+
+import 'package:js/js.dart';
+import 'package:js/js_util.dart' as js_util;
+import 'package:expect/minitest.dart';
+
+@JS('JSTopLevelField')
+external set topLevelFieldOnlySetter(v);
+
+@JS('JSTopLevelField')
+external get topLevelFieldOnlyGetter;
+
+@JS()
+external get topLevelFieldNoRename;
+
+@JS()
+external set topLevelSetterNoRename(v);
+
+@JS()
+external topLevelMethod(v);
+
+@JS('topLevelMethod')
+external renamedTopLevelMethod(v);
+
+@JS('JSFoo')
+class Foo {
+  @JS('JSBar')
+  external static get bar;
+
+  @JS('JSBar')
+  external static set bar(v);
+
+  @JS('JSBar2')
+  external static get bar2;
+
+  @JS('JSBaz')
+  external static set baz(v);
+
+  @JS('JSMethodAddBar')
+  external static addBar(a);
+}
+
+main() {
+  document.body.append(new ScriptElement()
+    ..type = 'text/javascript'
+    ..innerHtml = r"""
+window.JSFoo = {
+  'JSBar': 42,
+  'JSBar2': 80,
+  'JSMethodAddBar': function(a,b) { return a + this.JSBar; }
+};
+window.JSTopLevelField = 91;
+window.topLevelFieldNoRename = 8;
+window.topLevelMethod = function(a) { return a * 2; };
+""");
+
+  group('rename static', () {
+    test('getter', () {
+      expect(Foo.bar, equals(42));
+      expect(Foo.bar2, equals(80));
+      expect(topLevelFieldOnlyGetter, 91);
+      expect(topLevelFieldNoRename, 8);
+    });
+
+    test('setter', () {
+      Foo.baz = 100;
+      expect(js_util.getProperty(js_util.getProperty(window, 'JSFoo'), 'JSBaz'),
+          equals(100));
+      Foo.bar = 30;
+      expect(Foo.bar, equals(30));
+      expect(js_util.getProperty(js_util.getProperty(window, 'JSFoo'), 'JSBar'),
+          equals(30));
+      topLevelFieldOnlySetter = 83;
+      expect(topLevelFieldOnlyGetter, 83);
+      topLevelSetterNoRename = 10;
+      expect(js_util.getProperty(window, 'topLevelSetterNoRename'), 10);
+    });
+
+    test('method', () {
+      Foo.bar = 100;
+      expect(Foo.addBar(10), equals(110));
+      Foo.bar = 200;
+      expect(Foo.addBar(10), equals(210));
+      expect(topLevelMethod(10), equals(20));
+      expect(renamedTopLevelMethod(10), equals(20));
+    });
+  });
+}
diff --git a/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_test.dart b/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_test.dart
index 431d533..cae4b6f 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/js_typed_interop_test.dart
@@ -8,9 +8,7 @@
 import 'dart:html';
 
 import 'package:js/js.dart';
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
-import 'package:unittest/html_individual_config.dart';
+import 'package:expect/minitest.dart';
 
 _injectJs() {
   document.body.append(new ScriptElement()
@@ -71,7 +69,7 @@
     getA: function() { return this.a;}
   };
 
-  var selection = ["a", "b", "c", foo, bar];  
+  var selection = ["a", "b", "c", foo, bar];
 
   function returnNumArgs() { return arguments.length; };
   function returnLastArg() { return arguments[arguments.length-1]; };
@@ -110,6 +108,14 @@
   external get b;
 }
 
+@JS('ClassWithConstructor')
+class ClassWithFactory {
+  external factory ClassWithFactory(aParam, bParam);
+  external getA();
+  external get a;
+  external get b;
+}
+
 typedef num MultiplyWithDefault(num a, [num b]);
 
 @JS()
@@ -194,8 +200,6 @@
 main() {
   _injectJs();
 
-  useHtmlIndividualConfiguration();
-
   group('object literal', () {
     test('simple', () {
       var l = new ExampleLiteral(x: 3, y: "foo");
@@ -223,6 +227,13 @@
       expect(o.b, equals("bar"));
       expect(o.getA(), equals("foo"));
     });
+
+    test('external factory', () {
+      var o = new ClassWithFactory("foo", "bar");
+      expect(o.a, equals("foo"));
+      expect(o.b, equals("bar"));
+      expect(o.getA(), equals("foo"));
+    });
   });
 
   group('property', () {
@@ -259,7 +270,7 @@
       Function multiplyByX = foo.multiplyByX;
       // Tearing off a JS closure doesn't bind this.
       // You will need to use the new method tearoff syntax to bind this.
-      expect(multiplyByX(4), isNaN);
+      expect(multiplyByX(4), double.NAN);
 
       MultiplyWithDefault multiplyWithDefault = foo.multiplyDefault2Function;
       expect(multiplyWithDefault(6, 6), equals(36));
@@ -273,7 +284,7 @@
       // Calling a JavaScript method with too few arguments is also fine and
       // defaults to JavaScript behavior of setting all unspecified arguments
       // to undefined resulting in multiplying undefined by 2 == NAN.
-      expect(untypedFunction(), isNaN);
+      expect(untypedFunction(), double.NAN);
 
     });
   });
diff --git a/pkg/dev_compiler/test/codegen/lib/html/js_util_test.dart b/pkg/dev_compiler/test/codegen/lib/html/js_util_test.dart
index b0130b2..78ea380 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/js_util_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/js_util_test.dart
@@ -12,9 +12,7 @@
 
 import 'package:js/js.dart';
 import 'package:js/js_util.dart' as js_util;
-
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
+import 'package:expect/minitest.dart';
 
 _injectJs() {
   final script = new ScriptElement();
@@ -114,7 +112,6 @@
 
 main() {
   _injectJs();
-  useHtmlIndividualConfiguration();
 
   group('js_util.jsify()', () {
     test('convert a List', () {
@@ -148,7 +145,7 @@
     });
 
     test('deep convert a complex object', () {
-      final object = {
+      dynamic object = {
         'a': [
           1,
           [2, 3]
@@ -175,8 +172,7 @@
     });
 
     test('throws if object is not a Map or Iterable', () {
-      expect(() => js_util.jsify('a'),
-          throwsA(new isInstanceOf<ArgumentError>()));
+      expect(() => js_util.jsify('a'), throwsArgumentError);
     });
   });
 
@@ -287,7 +283,7 @@
 
   group('callMethod', () {
     test('html object', () {
-      var canvas = new Element.tag('canvas');
+      var canvas = new CanvasElement();
       expect(
           identical(canvas.getContext('2d'),
               js_util.callMethod(canvas, 'getContext', ['2d'])),
diff --git a/pkg/dev_compiler/test/codegen/lib/html/localstorage_test.dart b/pkg/dev_compiler/test/codegen/lib/html/localstorage_test.dart
index 3e92b10..2ed126e 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/localstorage_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/localstorage_test.dart
@@ -2,49 +2,42 @@
 // for 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 LocalStorageTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
+import 'package:expect/minitest.dart';
+
 main() {
-  useHtmlConfiguration();
+  setUp(() {
+    window.localStorage['key1'] = 'val1';
+    window.localStorage['key2'] = 'val2';
+    window.localStorage['key3'] = 'val3';
+  });
 
-  void testWithLocalStorage(String name, fn()) {
-    test(name, () {
-      window.localStorage['key1'] = 'val1';
-      window.localStorage['key2'] = 'val2';
-      window.localStorage['key3'] = 'val3';
+  tearDown(() {
+    window.localStorage.clear();
+  });
 
-      try {
-        fn();
-      } finally {
-      window.localStorage.clear();
-      }
-    });
-  }
-
-  testWithLocalStorage('containsValue', () {
+  test('containsValue', () {
     expect(window.localStorage.containsValue('does not exist'), isFalse);
     expect(window.localStorage.containsValue('key1'), isFalse);
     expect(window.localStorage.containsValue('val1'), isTrue);
     expect(window.localStorage.containsValue('val3'), isTrue);
   });
 
-  testWithLocalStorage('containsKey', () {
+  test('containsKey', () {
     expect(window.localStorage.containsKey('does not exist'), isFalse);
     expect(window.localStorage.containsKey('val1'), isFalse);
     expect(window.localStorage.containsKey('key1'), isTrue);
     expect(window.localStorage.containsKey('key3'), isTrue);
   });
 
-  testWithLocalStorage('[]', () {
+  test('[]', () {
     expect(window.localStorage['does not exist'], isNull);
     expect(window.localStorage['key1'], 'val1');
     expect(window.localStorage['key3'], 'val3');
   });
 
-  testWithLocalStorage('[]=', () {
+  test('[]=', () {
     expect(window.localStorage['key4'], isNull);
     window.localStorage['key4'] = 'val4';
     expect(window.localStorage['key4'], 'val4');
@@ -54,29 +47,32 @@
     expect(window.localStorage['key3'], 'val3-new');
   });
 
-  testWithLocalStorage('putIfAbsent', () {
+  test('putIfAbsent', () {
     expect(window.localStorage['key4'], isNull);
     expect(window.localStorage.putIfAbsent('key4', () => 'val4'), 'val4');
     expect(window.localStorage['key4'], 'val4');
 
     expect(window.localStorage['key3'], 'val3');
     expect(window.localStorage.putIfAbsent('key3',
-        () => expect(false, isTrue, reason: 'should not be called')), 'val3');
+        () {
+          fail('should not be called');
+          return 'unused';
+        }), 'val3');
     expect(window.localStorage['key3'], 'val3');
   });
 
-  testWithLocalStorage('remove', () {
+  test('remove', () {
     expect(window.localStorage.remove('does not exist'), isNull);
     expect(window.localStorage.remove('key3'), 'val3');
     expect(window.localStorage, equals({'key1': 'val1', 'key2': 'val2'}));
   });
 
-  testWithLocalStorage('clear', () {
+  test('clear', () {
     window.localStorage.clear();
     expect(window.localStorage, equals({}));
   });
 
-  testWithLocalStorage('forEach', () {
+  test('forEach', () {
     Map<String, String> results = {};
     window.localStorage.forEach((k, v) {
       results[k] = v;
@@ -84,23 +80,23 @@
     expect(results, equals({'key1': 'val1', 'key2': 'val2', 'key3': 'val3'}));
   });
 
-  testWithLocalStorage('getKeys', () {
+  test('getKeys', () {
     expect(window.localStorage.keys.toList(),
         unorderedEquals(['key1', 'key2', 'key3']));
   });
 
-  testWithLocalStorage('getVals', () {
+  test('getVals', () {
     expect(window.localStorage.values.toList(),
         unorderedEquals(['val1', 'val2', 'val3']));
   });
 
-  testWithLocalStorage('length', () {
+  test('length', () {
     expect(window.localStorage.length, 3);
     window.localStorage.clear();
     expect(window.localStorage.length, 0);
   });
 
-  testWithLocalStorage('isEmpty', () {
+  test('isEmpty', () {
     expect(window.localStorage.isEmpty, isFalse);
     window.localStorage.clear();
     expect(window.localStorage.isEmpty, isTrue);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/location_test.dart b/pkg/dev_compiler/test/codegen/lib/html/location_test.dart
index e274a2a0..703456d 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/location_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/location_test.dart
@@ -1,11 +1,8 @@
-library LocationTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   var isLocation = predicate((x) => x is Location, 'is a Location');
 
   test('location hash', () {
diff --git a/pkg/dev_compiler/test/codegen/lib/html/media_stream_test.dart b/pkg/dev_compiler/test/codegen/lib/html/media_stream_test.dart
index 602c199..7dc5bde 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/media_stream_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/media_stream_test.dart
@@ -2,14 +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.
 
-library media_stream_test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlIndividualConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   group('supported_media', () {
     test('supported', () {
       expect(MediaStream.supported, true);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/mediasource_test.dart b/pkg/dev_compiler/test/codegen/lib/html/mediasource_test.dart
index 7db8af8..f24b72d 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/mediasource_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/mediasource_test.dart
@@ -1,14 +1,9 @@
-library mediasource_test;
-
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 import 'dart:typed_data';
-import 'dart:async';
+
+import 'package:expect/minitest.dart';
 
 main() {
-  useHtmlIndividualConfiguration();
-
   var isMediaSource = predicate((x) => x is MediaSource, 'is a MediaSource');
 
   group('supported', () {
diff --git a/pkg/dev_compiler/test/codegen/lib/html/messageevent_test.dart b/pkg/dev_compiler/test/codegen/lib/html/messageevent_test.dart
index 86348fd..ae051f9 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/messageevent_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/messageevent_test.dart
@@ -1,11 +1,8 @@
-library SerializedScriptValueTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   test('new MessageEvent', () {
       final event = new MessageEvent('type', cancelable: true, data: 'data',
           origin: 'origin', lastEventId: 'lastEventId');
diff --git a/pkg/dev_compiler/test/codegen/lib/html/mirrors_js_typed_interop_test.dart b/pkg/dev_compiler/test/codegen/lib/html/mirrors_js_typed_interop_test.dart
index f4b30a6..e877295 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/mirrors_js_typed_interop_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/mirrors_js_typed_interop_test.dart
@@ -9,8 +9,7 @@
 import 'dart:html';
 
 import 'package:js/js.dart';
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
+import 'package:expect/minitest.dart';
 
 _injectJs() {
   document.body.append(new ScriptElement()
@@ -37,8 +36,6 @@
 main() {
   _injectJs();
 
-  useHtmlConfiguration();
-
   test('dynamic dispatch', () {
     var f = foo;
     expect(f.x, 3);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/mouse_event_test.dart b/pkg/dev_compiler/test/codegen/lib/html/mouse_event_test.dart
index 38792c2..7d7b0d9 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/mouse_event_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/mouse_event_test.dart
@@ -2,14 +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.
 
-library mouse_event_test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   test('relatedTarget', () {
     var event = new MouseEvent('mouseout');
     expect(event.relatedTarget, isNull);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/navigator_test.dart b/pkg/dev_compiler/test/codegen/lib/html/navigator_test.dart
index 2bc5cc8..c0f2627 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/navigator_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/navigator_test.dart
@@ -1,12 +1,7 @@
-library NavigatorTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/expect.dart';
 
-  test('language never returns null', () {
-      expect(window.navigator.language, isNotNull);
-    });
+main() {
+  Expect.isNotNull(window.navigator.language);
 }
diff --git a/pkg/dev_compiler/test/codegen/lib/html/node_test.dart b/pkg/dev_compiler/test/codegen/lib/html/node_test.dart
index 18f7f36..0e2b435 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/node_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/node_test.dart
@@ -2,14 +2,13 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library NodeTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 import 'dart:svg' as svg;
 
+import 'package:expect/minitest.dart';
+
 Node makeNode() => new Element.tag('div');
-Node makeNodeWithChildren() =>
+Element makeNodeWithChildren() =>
   new Element.html("<div>Foo<br/><!--baz--></div>");
 
 void testUnsupported(String name, void f()) {
@@ -19,8 +18,6 @@
 }
 
 main() {
-  useHtmlIndividualConfiguration();
-
   var isText = predicate((x) => x is Text, 'is a Text');
   var isComment = predicate((x) => x is Comment, 'is a Comment');
   var isBRElement = predicate((x) => x is BRElement, 'is a BRElement');
diff --git a/pkg/dev_compiler/test/codegen/lib/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart b/pkg/dev_compiler/test/codegen/lib/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart
index 4d7d338..84821ff 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart
@@ -10,8 +10,9 @@
 
 import 'dart:html';
 import 'dart:svg' as svg;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
+
+import 'package:expect/minitest.dart';
+
 import 'utils.dart';
 
 void validateHtml(String html, String reference, NodeValidator validator) {
@@ -52,8 +53,6 @@
 }
 
 main() {
-  useHtmlIndividualConfiguration();
-
   group('DOM_sanitization', () {
     var validator = new NodeValidatorBuilder.common();
 
@@ -126,7 +125,7 @@
         '</template>';
 
       var fragment = document.body.createFragment(html, validator: validator);
-      var template = fragment.nodes.single;
+      var template = fragment.nodes.single as TemplateElement;
 
       var expectedContent = document.body.createFragment(
           '<div></div>'
@@ -149,8 +148,9 @@
       var fragment = new DocumentFragment.html(html);
       fragment.appendHtml('<div id="bad"><script></script></div>');
       expect(fragment.childNodes.length, 1);
-      expect(fragment.childNodes[0].id, "bad");
-      expect(fragment.childNodes[0].childNodes.length, 0);
+      var child = fragment.childNodes[0] as Element;
+      expect(child.id, "bad");
+      expect(child.childNodes.length, 0);
     });
 
     testHtml("sanitizes embed",
@@ -500,7 +500,7 @@
         '</svg>';
 
       var fragment = new DocumentFragment.svg(svgText);
-      var element = fragment.nodes.first;
+      var element = fragment.nodes.first as Element;
       expect(element is svg.SvgSvgElement, isTrue);
       expect(element.children[0] is svg.ImageElement, isTrue);
     });
@@ -542,7 +542,7 @@
       var fragment = document.body.createFragment(
           "<form onmouseover='alert(2)'><input name='tagName'>",
           validator: validator);
-      var form = fragment.lastChild;
+      var form = fragment.lastChild as FormElement;
       // If the tagName was clobbered, the sanitizer should have removed
       // the whole thing and form is null.
       // If the tagName was not clobbered, then there will be content,
@@ -557,7 +557,7 @@
       var fragment = document.body.createFragment(
           "<form><input name='tagName'>",
           validator: validator);
-      var form = fragment.lastChild;
+      var form = fragment.lastChild as FormElement;
       // If the tagName was clobbered, the sanitizer should have removed
       // the whole thing and form is null.
       // If the tagName was not clobbered, then there will be content,
diff --git a/pkg/dev_compiler/test/codegen/lib/html/non_instantiated_is_test.dart b/pkg/dev_compiler/test/codegen/lib/html/non_instantiated_is_test.dart
index b226ea7..0865b07 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/non_instantiated_is_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/non_instantiated_is_test.dart
@@ -6,15 +6,11 @@
 // checks of native classes that are not instantiated.
 
 import 'dart:html';
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
+
+import 'package:expect/expect.dart';
 
 var a = [new Object()];
 
 main() {
-  useHtmlConfiguration();
-
-  test('is', () {
-    expect(a[0] is Node, isFalse);
-  });
+  Expect.isFalse(a[0] is Node);
 }
diff --git a/pkg/dev_compiler/test/codegen/lib/html/notification_test.dart b/pkg/dev_compiler/test/codegen/lib/html/notification_test.dart
index 077ea54..283dc5b 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/notification_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/notification_test.dart
@@ -2,15 +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.
 
-library notification_test;
-
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlIndividualConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   group('supported_notification', () {
     test('supported', () {
       expect(Notification.supported, true);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/performance_api_test.dart b/pkg/dev_compiler/test/codegen/lib/html/performance_api_test.dart
index f4f1d28..b66feeb 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/performance_api_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/performance_api_test.dart
@@ -1,11 +1,8 @@
-library PerformanceApiTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlIndividualConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   group('supported', () {
     test('supported', () {
       expect(Performance.supported, true);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/private_extension_member_test.dart b/pkg/dev_compiler/test/codegen/lib/html/private_extension_member_test.dart
index 4512d9e..0425e95 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/private_extension_member_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/private_extension_member_test.dart
@@ -13,6 +13,6 @@
   //
   // The createFragment() method sets `_innerHtml` on the element, so we use it
   // as a test case.
-  Expect.equals("[object DocumentFragment]",
+  Expect.equals("Instance of 'DocumentFragment'",
       new BRElement().createFragment("Hi").toString());
 }
diff --git a/pkg/dev_compiler/test/codegen/lib/html/query_test.dart b/pkg/dev_compiler/test/codegen/lib/html/query_test.dart
index bffe0d9..f40aa26 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/query_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/query_test.dart
@@ -2,21 +2,18 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library QueryTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   final div = new DivElement();
   final canvas = new CanvasElement(width: 200, height: 200);
   canvas.id = 'testcanvas';
   final element =
       new Element.html("<div><br/><img/><input/><img/></div>");
   document.body.nodes.addAll([div, canvas,  element]);
-  
+
   var isCanvasElement =
       predicate((x) => x is CanvasElement, 'is a CanvasElement');
   var isImageElement =
@@ -47,7 +44,7 @@
       expect(l.length, 2);
       expect(l[0], isImageElement);
       expect(l[1], isImageElement);
-      expect(l[0], isNot(equals(l[1])));
+      expect(l[0] == l[1], isFalse);
     });
 
   test('queryAll (None)', () {
diff --git a/pkg/dev_compiler/test/codegen/lib/html/queryall_test.dart b/pkg/dev_compiler/test/codegen/lib/html/queryall_test.dart
index be4e67b..c8c00f9 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/queryall_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/queryall_test.dart
@@ -2,14 +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
 
-library NodeListTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   var isElement = predicate((x) => x is Element, 'is an Element');
   var isCanvasElement =
       predicate((x) => x is CanvasElement, 'is a CanvasElement');
@@ -45,7 +42,7 @@
     });
 
   test('queryAll-canvas', () {
-      List<CanvasElement> all = queryAll('canvas');
+      var all = queryAll('canvas');
       for (var e in all) {
         expect(e, isCanvasElement);
       }
@@ -61,7 +58,7 @@
 
   test('queryAll-where', () {
       List<Element> all = queryAll('*');
-      Iterable<CanvasElement> canvases = all.where((e) => e is CanvasElement);
+      var canvases = all.where((e) => e is CanvasElement);
       for (var e in canvases) {
         expect(e is CanvasElement, isTrue);
       }
diff --git a/pkg/dev_compiler/test/codegen/lib/html/range_test.dart b/pkg/dev_compiler/test/codegen/lib/html/range_test.dart
index 5c2028d..01739fd 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/range_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/range_test.dart
@@ -1,12 +1,8 @@
-library range_test;
-
 import 'dart:html';
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
+
+import 'package:expect/minitest.dart';
 
 main() {
-  useHtmlIndividualConfiguration();
-
   group('supported', () {
     test('supports_createContextualFragment', () {
       expect(Range.supportsCreateContextualFragment, isTrue);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/rtc_test.dart b/pkg/dev_compiler/test/codegen/lib/html/rtc_test.dart
index e55e79f..8582b3a 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/rtc_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/rtc_test.dart
@@ -2,17 +2,14 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library RealTimeCommunicationTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlIndividualConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   group('supported', () {
     test('supported', () {
-      expect(RtcPeerConnection.supported, true);
+      expect(RtcPeerConnection.supported, isTrue);
     });
   });
 
diff --git a/pkg/dev_compiler/test/codegen/lib/html/selectelement_test.dart b/pkg/dev_compiler/test/codegen/lib/html/selectelement_test.dart
index b56912c..94a9a29 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/selectelement_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/selectelement_test.dart
@@ -2,14 +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.
 
-library selectelement_test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   test('selectedOptions', () {
     var element = new SelectElement();
     element.multiple = false;
@@ -64,14 +61,14 @@
         '<optgroup>'
           '<option>2</option>'
         '</optgroup>'
-      '</select>');
+      '</select>') as SelectElement;
 
     expect(element.options.length, 2);
     element.selectedIndex = 1;
 
     var optGroup = element.children[1];
     expect(optGroup is OptGroupElement, isTrue);
-    expect(optGroup.children.single.selected, isTrue);
+    expect((optGroup.children.single as OptionElement).selected, isTrue);
     expect(element.selectedOptions, optGroup.children);
   });
 }
diff --git a/pkg/dev_compiler/test/codegen/lib/html/serialized_script_value_test.dart b/pkg/dev_compiler/test/codegen/lib/html/serialized_script_value_test.dart
index 16c8b43..d4f5a9c 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/serialized_script_value_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/serialized_script_value_test.dart
@@ -1,21 +1,20 @@
-library SerializedScriptValueTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
+
+import 'package:expect/minitest.dart';
+
 import 'utils.dart';
 
-serializationTest(name, value) => test(name, () {
+serializationTest(name, value) {
+  test(name, () {
     // To check how value is serialized and deserialized, we create a
     // MessageEvent.
     final event =
         new MessageEvent('', data: value, origin: '', lastEventId: '');
     verifyGraph(value, event.data);
-});
-
+  });
+}
 
 main() {
-  useHtmlConfiguration();
-
   serializationTest('null', null);
   serializationTest('int', 1);
   serializationTest('double', 2.39);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/shadow_dom_test.dart b/pkg/dev_compiler/test/codegen/lib/html/shadow_dom_test.dart
index 323d0e2..704e81a 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/shadow_dom_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/shadow_dom_test.dart
@@ -2,14 +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.
 
-library ShadowDOMTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlIndividualConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   group('supported', () {
     test('supported', () {
       expect(ShadowRoot.supported, true);
@@ -17,7 +14,6 @@
   });
 
   group('ShadowDOM_tests', () {
-
     var div1, div2, shadowRoot, paragraph1, paragraph2;
 
     init() {
diff --git a/pkg/dev_compiler/test/codegen/lib/html/shadowroot_test.dart b/pkg/dev_compiler/test/codegen/lib/html/shadowroot_test.dart
index c3ac8d9..4e9252d 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/shadowroot_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/shadowroot_test.dart
@@ -2,14 +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.
 
-library ShadowRootTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   var isShadowRoot =
       predicate((x) => x is ShadowRoot, 'is a ShadowRoot');
 
diff --git a/pkg/dev_compiler/test/codegen/lib/html/speechrecognition_test.dart b/pkg/dev_compiler/test/codegen/lib/html/speechrecognition_test.dart
index 16fd9de..e85531c 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/speechrecognition_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/speechrecognition_test.dart
@@ -2,14 +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.
 
-library speech_recognition_test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlIndividualConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   group('supported', () {
     test('supported', () {
       expect(SpeechRecognition.supported, true);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/storage_test.dart b/pkg/dev_compiler/test/codegen/lib/html/storage_test.dart
index b68e9d4..c614ca9 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/storage_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/storage_test.dart
@@ -1,10 +1,8 @@
-library StorageTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
+import 'package:expect/minitest.dart';
+
 main() {
-  useHtmlConfiguration();
   test('GetItem', () {
     final value = window.localStorage['does not exist'];
     expect(value, isNull);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/streams_test.dart b/pkg/dev_compiler/test/codegen/lib/html/streams_test.dart
index edd77e7..2a43f4c 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/streams_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/streams_test.dart
@@ -1,9 +1,8 @@
-library streams_test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:async';
 import 'dart:html';
 
+import 'package:expect/minitest.dart';
+
 class StreamHelper {
   var _a;
   StreamHelper() {
@@ -22,8 +21,6 @@
 }
 
 main() {
-  useHtmlConfiguration();
-
   test('simple', () {
     var helper = new StreamHelper();
 
diff --git a/pkg/dev_compiler/test/codegen/lib/html/svg_test.dart b/pkg/dev_compiler/test/codegen/lib/html/svg_test.dart
index b24084a..0477852 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/svg_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/svg_test.dart
@@ -2,15 +2,12 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library SVGTest;
 import 'dart:html';
 import 'dart:svg' as svg;
-import 'package:unittest/html_individual_config.dart';
-import 'package:unittest/unittest.dart';
+
+import 'package:expect/minitest.dart';
 
 main() {
-  useHtmlIndividualConfiguration();
-
   group('svgPresence', () {
     var isSvgElement = predicate((x) => x is svg.SvgElement, 'is a SvgElement');
 
@@ -42,8 +39,7 @@
         </svg>
         """);
 
-    expect(logo, isSvgElement);
-
+      expect(logo, isSvgElement);
     });
   });
 
@@ -66,9 +62,13 @@
     var isSvgElement = predicate((x) => x is svg.SvgElement, 'is a SvgElement');
     var isSvgSvgElement =
         predicate((x) => x is svg.SvgSvgElement, 'is a SvgSvgElement');
+    var isNotSvgSvgElement =
+        predicate((x) => x is! svg.SvgSvgElement, 'is not a SvgSvgElement');
     var isNode = predicate((x) => x is Node, 'is a Node');
     var isSvgNumber = predicate((x) => x is svg.Number, 'is a svg.Number');
+    var isNotSvgNumber = predicate((x) => x is! svg.Number, 'is not a svg.Number');
     var isSvgRect = predicate((x) => x is svg.Rect, 'is a svg.Rect');
+    var isNotSvgRect = predicate((x) => x is! svg.Rect, 'is not a svg.Rect');
 
     test('rect_isChecks', () {
         var div = insertTestDiv();
@@ -80,9 +80,9 @@
         expect(r, isNode);
 
         // Interfaces not implemented.
-        expect(r, isNot(isSvgNumber));
-        expect(r, isNot(isSvgRect));
-        expect(r, isNot(isSvgSvgElement));
+        expect(r, isNotSvgNumber);
+        expect(r, isNotSvgRect);
+        expect(r, isNotSvgSvgElement);
 
         div.remove();
       });
diff --git a/pkg/dev_compiler/test/codegen/lib/html/svgelement_test.dart b/pkg/dev_compiler/test/codegen/lib/html/svgelement_test.dart
index 1fa7259..bd66420 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/svgelement_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/svgelement_test.dart
@@ -2,16 +2,12 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library SvgElementTest;
 import 'dart:html';
 import 'dart:svg' as svg;
-import 'package:expect/expect.dart';
-import 'package:unittest/html_individual_config.dart';
-import 'package:unittest/unittest.dart';
+
+import 'package:expect/minitest.dart';
 
 main() {
-  useHtmlIndividualConfiguration();
-
   var isSvgSvgElement =
       predicate((x) => x is svg.SvgSvgElement, 'is a SvgSvgElement');
 
@@ -47,12 +43,12 @@
           "</svg>";
       final el = new svg.SvgElement.svg(svgContent);
       expect(el, isSvgSvgElement);
-      expect(el.innerHtml, anyOf("<circle></circle><path></path>", '<circle '
+      expect(el.innerHtml, anyOf(["<circle></circle><path></path>", '<circle '
           'xmlns="http://www.w3.org/2000/svg" /><path '
-          'xmlns="http://www.w3.org/2000/svg" />'));
-      expect(el.outerHtml, anyOf(svgContent,
+          'xmlns="http://www.w3.org/2000/svg" />']));
+      expect(el.outerHtml, anyOf([svgContent,
           '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">\n  '
-          '<circle />\n  <path />\n</svg>'));
+          '<circle />\n  <path />\n</svg>']));
     });
 
     test('has no parent', () =>
diff --git a/pkg/dev_compiler/test/codegen/lib/html/table_test.dart b/pkg/dev_compiler/test/codegen/lib/html/table_test.dart
index 7432e5d..fca7e3a 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/table_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/table_test.dart
@@ -2,14 +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.
 
-library TableTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   test('createTBody', () {
     var table = new TableElement();
     var head = table.createTHead();
diff --git a/pkg/dev_compiler/test/codegen/lib/html/text_event_test.dart b/pkg/dev_compiler/test/codegen/lib/html/text_event_test.dart
index 5be0651..038e153 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/text_event_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/text_event_test.dart
@@ -2,17 +2,13 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library text_event_test;
-import "package:expect/expect.dart";
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
+import 'package:expect/minitest.dart';
+
 import 'event_test.dart';
 
 main() {
-  useHtmlConfiguration();
-
   eventTest('TextEvent', () => new TextEvent('foo', view: window, data: 'data'),
       (ev) { expect(ev.data, 'data'); });
 }
diff --git a/pkg/dev_compiler/test/codegen/lib/html/touchevent_test.dart b/pkg/dev_compiler/test/codegen/lib/html/touchevent_test.dart
index fba6e61..cd60245 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/touchevent_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/touchevent_test.dart
@@ -2,14 +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.
 
-library touch_event_test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlIndividualConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   group('supported', () {
     test('supported', () {
       expect(TouchEvent.supported, true);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/track_element_constructor_test.dart b/pkg/dev_compiler/test/codegen/lib/html/track_element_constructor_test.dart
index 883dabd..b2077ee 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/track_element_constructor_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/track_element_constructor_test.dart
@@ -11,19 +11,18 @@
 
 import 'dart:html';
 
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
+import 'package:expect/minitest.dart';
 
 void main() {
-  useHtmlConfiguration();
   test('', () {
     if (!TrackElement.supported) return;
     document.body.append(new TrackElement()..defaultValue = true);
-    if (!document.query('track').defaultValue) {
+    var trackElement = document.query('track') as TrackElement;
+    if (!trackElement.defaultValue) {
       throw 'Expected default value to be true';
     }
-    document.query('track').defaultValue = false;
-    if (document.query('track').defaultValue) {
+    trackElement.defaultValue = false;
+    if (trackElement.defaultValue) {
       throw 'Expected default value to be false';
     }
   });
diff --git a/pkg/dev_compiler/test/codegen/lib/html/trusted_html_tree_sanitizer_test.dart b/pkg/dev_compiler/test/codegen/lib/html/trusted_html_tree_sanitizer_test.dart
index c03e39d..3f9a534 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/trusted_html_tree_sanitizer_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/trusted_html_tree_sanitizer_test.dart
@@ -6,14 +6,13 @@
 /// for prevent XSS or other attacks. If you suppress this, or parts of it
 /// please make it a critical bug and bring it to the attention of the
 /// dart:html maintainers.
-library trusted_html_tree_sanitizer_test;
-
+import 'dart:js' as js;
 import 'dart:html';
 import 'dart:svg' as svg;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
+
+import 'package:expect/minitest.dart';
+
 import 'utils.dart';
-import 'dart:js' as js;
 
 var oldAdoptNode;
 var jsDocument;
@@ -33,8 +32,6 @@
 }
 
 main() {
-  useHtmlIndividualConfiguration();
-
   group('not_create_document_fragment', () {
     setUp(makeDocumentFragmentAdoptionThrow);
     tearDown(restoreOldAdoptNode);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_1_test.dart b/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_1_test.dart
index c3eb811..3bbd336 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_1_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_1_test.dart
@@ -2,17 +2,16 @@
 // for 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 TypedArrays1Test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 import 'dart:typed_data';
 
-main() {
-  useHtmlIndividualConfiguration();
+import 'package:expect/minitest.dart';
 
-  var isnumList = predicate((x) => x is List<num>, 'is a List<num>');
-  var isStringList = predicate((x) => x is List<String>, 'is a List<String>');
+main() {
+  var isList = predicate((x) => x is List, 'is a List');
+  var isNumList = predicate((x) => x is List<num>, 'is a List<num>');
+  var isNotStringList =
+      predicate((x) => x is! List<String>, 'is not a List<String>');
   var expectation = Platform.supportsTypedData ? returnsNormally : throws;
 
   group('supported', () {
@@ -63,8 +62,8 @@
         expect(() {
           var a = new Float32List(10);
           expect(a, isList);
-          expect(a, isnumList);
-          expect(a, isNot(isStringList));
+          expect(a, isNumList);
+          expect(a, isNotStringList);
         }, expectation);
       });
     }
diff --git a/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_2_test.dart b/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_2_test.dart
index 5a0d83a..15a0bd6 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_2_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_2_test.dart
@@ -2,15 +2,12 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library TypedArrays2Test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 import 'dart:typed_data';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   // Only perform tests if ArrayBuffer is supported.
   if (!Platform.supportsTypedData) {
     return;
diff --git a/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_3_test.dart b/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_3_test.dart
index efa4e17..b465a99 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_3_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_3_test.dart
@@ -2,15 +2,12 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library TypedArrays3Test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 import 'dart:typed_data';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   // Only perform tests if ArrayBuffer is supported.
   if (!Platform.supportsTypedData) {
     return;
diff --git a/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_4_test.dart b/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_4_test.dart
index 9f00357..c75ade8 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_4_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_4_test.dart
@@ -2,15 +2,12 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library TypedArrays4Test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 import 'dart:typed_data';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   // Only perform tests if ArrayBuffer is supported.
   if (!Platform.supportsTypedData) {
     return;
diff --git a/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_5_test.dart b/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_5_test.dart
index db149f6..555a7c9 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_5_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_5_test.dart
@@ -2,15 +2,12 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library typed_arrays_5_test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 import 'dart:typed_data';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   // Only perform tests if ArrayBuffer is supported.
   if (!Platform.supportsTypedData) {
     return;
diff --git a/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_arraybuffer_test.dart b/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_arraybuffer_test.dart
index 07541c8..69c98bb 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_arraybuffer_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_arraybuffer_test.dart
@@ -2,15 +2,12 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library typed_arrays_arraybuffer_test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 import 'dart:typed_data';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   // Only perform tests if ArrayBuffer is supported.
   if (!Platform.supportsTypedData) {
     return;
diff --git a/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_dataview_test.dart b/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_dataview_test.dart
index a56aecd..cd78a40 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_dataview_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_dataview_test.dart
@@ -2,15 +2,12 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library typed_arrays_dataview_test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 import 'dart:typed_data';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   // Only perform tests if ArrayBuffer is supported.
   if (!Platform.supportsTypedData) {
     return;
diff --git a/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_range_checks_test.dart b/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_range_checks_test.dart
index 1eb2222..4551f98 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_range_checks_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_range_checks_test.dart
@@ -2,12 +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.
 
-library TypedArraysRangeCheckTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 import 'dart:typed_data';
 
+import 'package:expect/minitest.dart';
+
 const N = 1024;
 
 class _TestList {
@@ -28,14 +27,12 @@
 }
 
 main() {
-  useHtmlConfiguration();
-
   // Only perform tests if ArrayBuffer is supported.
   if (!Platform.supportsTypedData) {
     return;
   }
 
-  test('outOfRangeAccess_dynamic', () {
+  test('outOfRangeAccess', () {
       var a = _obfuscatedList();
 
       expect(() => a[a.length], throws);
@@ -54,24 +51,4 @@
       expect(() => a[1.5] = 0xdeadbeef, throws);
       expect(() => a['length'] = 1, throws);
   });
-
-  test('outOfRange_typed', () {
-      Uint8List a = new Uint8List(N);
-
-      expect(() => a[a.length], throws);
-      expect(() => a[a.length + 1], throws);
-      expect(() => a[a.length + N], throws);
-
-      expect(() => a[-1], throws);
-      expect(() => a[1.5], throws);
-      expect(() => a['length'], throws);
-
-      expect(() => a[a.length] = 0xdeadbeef, throws);
-      expect(() => a[a.length + 1] = 0xdeadbeef, throws);
-      expect(() => a[a.length + N] = 0xdeadbeef, throws);
-
-      expect(() => a[-1] = 0xdeadbeef, throws);
-      expect(() => a[1.5] = 0xdeadbeef, throws);
-      expect(() => a['length'] = 1, throws);
-  });
 }
diff --git a/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_simd_test.dart b/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_simd_test.dart
index 0e3d780..5de04dd 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_simd_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/typed_arrays_simd_test.dart
@@ -2,12 +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.
 
-library TypedArraysSimdTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 import 'dart:typed_data';
 
+import 'package:expect/minitest.dart';
+
 const _FLOATING_POINT_ERROR = 0.0000000001;
 floatEquals(value) => closeTo(value, _FLOATING_POINT_ERROR);
 
@@ -19,8 +18,6 @@
 }
 
 main() {
-  useHtmlConfiguration();
-
   // Only perform tests if ArrayBuffer is supported.
   if (!Platform.supportsTypedData) {
     return;
diff --git a/pkg/dev_compiler/test/codegen/lib/html/typing_test.dart b/pkg/dev_compiler/test/codegen/lib/html/typing_test.dart
index 68ba294..e353bf5 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/typing_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/typing_test.dart
@@ -1,11 +1,8 @@
-library TypingTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   var isStyleSheetList =
       predicate((x) => x is List<StyleSheet>, 'is a List<StyleSheet>');
 
@@ -23,15 +20,16 @@
   });
 
   test('StyleSheetList', () {
-    List<StyleSheet> asList = window.document.styleSheets;
+    var document = window.document as HtmlDocument;
+    List<StyleSheet> asList = document.styleSheets;
     expect(asList, isStyleSheetList);
     // Check it's Iterable.
     int counter = 0;
-    for (StyleSheet styleSheet in window.document.styleSheets) {
+    for (StyleSheet styleSheet in document.styleSheets) {
       counter++;
     }
 
-    // There is one style sheet from the unittest framework.
-    expect(counter, 1);
+    // There are no style sheets.
+    expect(counter, 0);
   });
 }
diff --git a/pkg/dev_compiler/test/codegen/lib/html/unknownelement_test.dart b/pkg/dev_compiler/test/codegen/lib/html/unknownelement_test.dart
index 21ba1ef..43b30cf 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/unknownelement_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/unknownelement_test.dart
@@ -2,22 +2,19 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file
 
-library UnknownElementTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   var isUnknownElement =
       predicate((x) => x is UnknownElement, 'is an UnknownELement');
 
-  var foo = new Element.tag('foo');
+  dynamic foo = new Element.tag('foo');
   foo.id = 'foo';
   var bar = new Element.tag('bar');
   bar.id = 'bar';
-  document.body.nodes.addAll([foo, bar]);
+  document.body.nodes.addAll(<Node>[foo, bar]);
 
   test('type-check', () {
       expect(foo, isUnknownElement);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/uri_test.dart b/pkg/dev_compiler/test/codegen/lib/html/uri_test.dart
index 90798849..32ec865 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/uri_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/uri_test.dart
@@ -2,13 +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.
 
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   test('Uri.base', () {
     expect(Uri.base.scheme, "http");
     expect(Uri.base.toString(), window.location.href);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/util.dart b/pkg/dev_compiler/test/codegen/lib/html/util.dart
index 52735f2..0cf55fb 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/util.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/util.dart
@@ -5,15 +5,13 @@
 library test.html.util;
 
 import 'dart:html';
-import 'package:unittest/unittest.dart';
+import 'package:expect/minitest.dart';
 
-void expectUnsupported(f) => expect(f, throwsUnsupportedError);
-
-void expectEmptyRect(ClientRect rect) {
-  expect(rect.bottom, isZero);
-  expect(rect.top, isZero);
-  expect(rect.left, isZero);
-  expect(rect.right, isZero);
-  expect(rect.height, isZero);
-  expect(rect.width, isZero);
+void expectEmptyRect(Rectangle rect) {
+  expect(rect.bottom, 0);
+  expect(rect.top, 0);
+  expect(rect.left, 0);
+  expect(rect.right, 0);
+  expect(rect.height, 0);
+  expect(rect.width, 0);
 }
diff --git a/pkg/dev_compiler/test/codegen/lib/html/webgl_1_test.dart b/pkg/dev_compiler/test/codegen/lib/html/webgl_1_test.dart
index d6e6f1f..ce296ee 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/webgl_1_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/webgl_1_test.dart
@@ -2,19 +2,19 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library web_gl_test;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 import 'dart:typed_data';
 import 'dart:web_gl';
 import 'dart:web_gl' as gl;
 
+import 'package:expect/minitest.dart';
+
 // Test that WebGL is present in dart:web_gl API
 
-main() {
-  useHtmlIndividualConfiguration();
+final isRenderingContext = predicate((x) => x is RenderingContext);
+final isContextAttributes = predicate((x) => x is gl.ContextAttributes);
 
+main() {
   group('supported', () {
     test('supported', () {
       expect(RenderingContext.supported, isTrue);
@@ -27,7 +27,7 @@
       var context = canvas.getContext3d();
       if (RenderingContext.supported) {
         expect(context, isNotNull);
-        expect(context, new isInstanceOf<RenderingContext>());
+        expect(context, isRenderingContext);
       } else {
         expect(context, isNull);
       }
@@ -36,7 +36,8 @@
     if (RenderingContext.supported) {
       test('simple', () {
         var canvas = new CanvasElement();
-        var context = canvas.getContext('experimental-webgl');
+        var context =
+            canvas.getContext('experimental-webgl') as gl.RenderingContext;
         var shader = context.createShader(gl.VERTEX_SHADER);
         context.shaderSource(shader, 'void main() { }');
         context.compileShader(shader);
@@ -48,11 +49,11 @@
         var canvas = new CanvasElement();
         var context = canvas.getContext3d();
         expect(context, isNotNull);
-        expect(context, new isInstanceOf<RenderingContext>());
+        expect(context, isRenderingContext);
 
         context = canvas.getContext3d(depth: false);
         expect(context, isNotNull);
-        expect(context, new isInstanceOf<RenderingContext>());
+        expect(context, isRenderingContext);
       });
 
       test('texImage2D', () {
@@ -95,7 +96,7 @@
         var attributes = context.getContextAttributes();
 
         expect(attributes, isNotNull);
-        expect(attributes, new isInstanceOf<gl.ContextAttributes>());
+        expect(attributes, isContextAttributes);
 
         expect(attributes.alpha, isBoolean);
         expect(attributes.antialias, isBoolean);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/window_eq_test.dart b/pkg/dev_compiler/test/codegen/lib/html/window_eq_test.dart
index 6995a90..93313ab 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/window_eq_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/window_eq_test.dart
@@ -1,14 +1,12 @@
-library WindowEqualityTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
+import 'package:expect/minitest.dart';
+
 main() {
-  useHtmlConfiguration();
   var obfuscated = null;
 
   test('notNull', () {
       expect(window, isNotNull);
-      expect(window, isNot(equals(obfuscated)));
+      expect(window != obfuscated, isTrue);
     });
 }
diff --git a/pkg/dev_compiler/test/codegen/lib/html/window_mangling_test.dart b/pkg/dev_compiler/test/codegen/lib/html/window_mangling_test.dart
index f1a8b38..46f03c8 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/window_mangling_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/window_mangling_test.dart
@@ -2,11 +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.
 
-library WindowManglingTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html' as dom;
 
+import 'package:expect/minitest.dart';
+
 // Defined in dom.Window.
 get navigator => "Dummy";
 
@@ -14,13 +13,12 @@
 $eq$(x, y) => false;
 
 main() {
-  useHtmlConfiguration();
   var win = dom.window;
 
   test('windowMethod', () {
       final message = navigator;
       final x = win.navigator;
-      expect(x, isNot(equals(message)));
+      expect(x, notEquals(message));
     });
 
   test('windowEquals', () {
diff --git a/pkg/dev_compiler/test/codegen/lib/html/window_nosuchmethod_test.dart b/pkg/dev_compiler/test/codegen/lib/html/window_nosuchmethod_test.dart
index 93cb592..4cc84b4 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/window_nosuchmethod_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/window_nosuchmethod_test.dart
@@ -2,12 +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.
 
-library WindowNSMETest;
-import "package:expect/expect.dart";
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html' as dom;
 
+import 'package:expect/minitest.dart';
+
 // Not defined in dom.Window.
 foo(x) => x;
 
@@ -18,20 +16,12 @@
 int inscrutable(int x) => x == 0 ? 0 : x | inscrutable(x & (x - 1));
 
 main() {
-  useHtmlConfiguration();
-  var things = [new Unused(), dom.window];
+  var things = <dynamic>[new Unused(), dom.window];
 
   test('windowNonMethod', () {
       var win = things[inscrutable(1)];
       final message = foo("Hello World");
-      try {
-        String x = win.foo(message);
-        expect(false, isTrue, reason: 'Should not reach here: $x');
-      } on NoSuchMethodError catch (e) {
-        // Expected exception.
-      } on Exception catch (e) {
-        expect(false, isTrue, reason: 'Wrong exception: $e');
-      }
+      expect(() => win.foo(message), throwsNoSuchMethodError);
     });
 
   test('foo', () {
@@ -40,16 +30,10 @@
       expect(x, 'not bar');
     });
 
-  // Use dom.window direclty in case the compiler does type inference.
+  // Use dom.window directly in case the compiler does type inference.
   test('windowNonMethod2', () {
       final message = foo("Hello World");
-      try {
-        String x = dom.window.foo(message);
-        expect(false, isTrue, reason: 'Should not reach here: $x');
-      } on NoSuchMethodError catch (e) {
-        // Expected exception.
-      } on Exception catch (e) {
-        expect(false, isTrue, reason: 'Wrong exception: $e');
-      }
+      expect(() => (dom.window as dynamic).foo(message),
+          throwsNoSuchMethodError);
     });
 }
diff --git a/pkg/dev_compiler/test/codegen/lib/html/window_test.dart b/pkg/dev_compiler/test/codegen/lib/html/window_test.dart
index 51ccdfd..ab79e66 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/window_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/window_test.dart
@@ -2,14 +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.
 
-library WindowTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
 import 'dart:html';
 
-main() {
-  useHtmlConfiguration();
+import 'package:expect/minitest.dart';
 
+main() {
   test('scrollXY', () {
     expect(window.scrollX, 0);
     expect(window.scrollY, 0);
diff --git a/pkg/dev_compiler/test/codegen/lib/html/wrapping_collections_test.dart b/pkg/dev_compiler/test/codegen/lib/html/wrapping_collections_test.dart
index 218d255..0d4fa1f 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/wrapping_collections_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/wrapping_collections_test.dart
@@ -1,10 +1,8 @@
-library wrapping_collection_test;
-
 import 'dart:html';
 import 'dart:html_common';
 import 'dart:js' as js;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
+
+import 'package:expect/minitest.dart';
 
 /// Test that if we access objects through JS-interop we get the
 /// appropriate objects, even if dart:html maps them.
diff --git a/pkg/dev_compiler/test/codegen/lib/html/xsltprocessor_test.dart b/pkg/dev_compiler/test/codegen/lib/html/xsltprocessor_test.dart
index b645d81..3dd93a8 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/xsltprocessor_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/xsltprocessor_test.dart
@@ -1,12 +1,8 @@
-library XSLTProcessorTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
 import 'dart:html';
 
+import 'package:expect/minitest.dart';
+
 main() {
-
-  useHtmlIndividualConfiguration();
-
   group('supported', () {
     test('supported', () {
       expect(XsltProcessor.supported, true);
diff --git a/pkg/dev_compiler/test/codegen/lib/math/implement_rectangle_test.dart b/pkg/dev_compiler/test/codegen/lib/math/implement_rectangle_test.dart
new file mode 100644
index 0000000..3a31ed8
--- /dev/null
+++ b/pkg/dev_compiler/test/codegen/lib/math/implement_rectangle_test.dart
@@ -0,0 +1,80 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:math' hide Rectangle;
+import 'dart:math' as math show Point, Rectangle, MutableRectangle;
+import 'package:expect/expect.dart' show Expect;
+
+void main() {
+  verifyRectable(new Rectangle(1, 2, 3, 4));
+}
+
+void verifyRectable(math.Rectangle rect) {
+  Expect.equals(1.0, rect.left.toDouble());
+  Expect.equals(2.0, rect.top.toDouble());
+  Expect.equals(4.0, rect.right.toDouble());
+  Expect.equals(6.0, rect.bottom.toDouble());
+}
+
+class Rectangle<T extends num> implements math.MutableRectangle<T> {
+  T left;
+  T top;
+  T width;
+  T height;
+
+  Rectangle(this.left, this.top, this.width, this.height);
+
+  T get right => left + width;
+
+  T get bottom => top + height;
+
+  Point<T> get topLeft => new Point<T>(left, top);
+
+  Point<T> get topRight => new Point<T>(right, top);
+
+  Point<T> get bottomLeft => new Point<T>(left, bottom);
+
+  Point<T> get bottomRight => new Point<T>(right, bottom);
+
+  //---------------------------------------------------------------------------
+
+  bool contains(num px, num py) {
+    return left <= px && top <= py && right > px && bottom > py;
+  }
+
+  bool containsPoint(math.Point<num> p) {
+    return contains(p.x, p.y);
+  }
+
+  bool intersects(math.Rectangle<num> r) {
+    return left < r.right && right > r.left && top < r.bottom && bottom > r.top;
+  }
+
+  /// Returns a new rectangle which completely contains `this` and [other].
+
+  Rectangle<T> boundingBox(math.Rectangle<T> other) {
+    T rLeft = min(left, other.left);
+    T rTop = min(top, other.top);
+    T rRight = max(right, other.right);
+    T rBottom = max(bottom, other.bottom);
+    return new Rectangle<T>(rLeft, rTop, rRight - rLeft, rBottom - rTop);
+  }
+
+  /// Tests whether `this` entirely contains [another].
+
+  bool containsRectangle(math.Rectangle<num> r) {
+    return left <= r.left &&
+        top <= r.top &&
+        right >= r.right &&
+        bottom >= r.bottom;
+  }
+
+  Rectangle<T> intersection(math.Rectangle<T> rect) {
+    T rLeft = max(left, rect.left);
+    T rTop = max(top, rect.top);
+    T rRight = min(right, rect.right);
+    T rBottom = min(bottom, rect.bottom);
+    return new Rectangle<T>(rLeft, rTop, rRight - rLeft, rBottom - rTop);
+  }
+}
diff --git a/pkg/dev_compiler/test/codegen/lib/math/point_test.dart b/pkg/dev_compiler/test/codegen/lib/math/point_test.dart
index 93d6c4a..cb694b9 100644
--- a/pkg/dev_compiler/test/codegen/lib/math/point_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/math/point_test.dart
@@ -2,89 +2,98 @@
 // for 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 point_test;
-
 import 'dart:math';
-import 'package:unittest/unittest.dart';
+import 'package:expect/expect.dart';
 
 main() {
-  test('constructor', () {
+  // constructor
+  {
     var point = new Point(0, 0);
-    expect(point.x, 0);
-    expect(point.y, 0);
-    expect('$point', 'Point(0, 0)');
-  });
+    Expect.equals(0, point.x);
+    Expect.equals(0, point.y);
+    Expect.equals('Point(0, 0)', '$point');
+  }
 
-  test('constructor X', () {
+  // constructor X
+  {
     var point = new Point<int>(10, 0);
-    expect(point.x, 10);
-    expect(point.y, 0);
-    expect('$point', 'Point(10, 0)');
-  });
+    Expect.equals(10, point.x);
+    Expect.equals(0, point.y);
+    Expect.equals('Point(10, 0)', '$point');
+  }
 
-  test('constructor X Y', () {
+  // constructor X Y
+  {
     var point = new Point<int>(10, 20);
-    expect(point.x, 10);
-    expect(point.y, 20);
-    expect('$point', 'Point(10, 20)');
-  });
+    Expect.equals(10, point.x);
+    Expect.equals(20, point.y);
+    Expect.equals('Point(10, 20)', '$point');
+  }
 
-  test('constructor X Y double', () {
+  // constructor X Y double
+  {
     var point = new Point<double>(10.5, 20.897);
-    expect(point.x, 10.5);
-    expect(point.y, 20.897);
-    expect('$point', 'Point(10.5, 20.897)');
-  });
+    Expect.equals(10.5, point.x);
+    Expect.equals(20.897, point.y);
+    Expect.equals('Point(10.5, 20.897)', '$point');
+  }
 
-  test('constructor X Y NaN', () {
+  // constructor X Y NaN
+  {
     var point = new Point(double.NAN, 1000);
-    expect(point.x, isNaN);
-    expect(point.y, 1000);
-    expect('$point', 'Point(NaN, 1000)');
-  });
+    Expect.isTrue(point.x.isNaN);
+    Expect.equals(1000, point.y);
+    Expect.equals('Point(NaN, 1000)', '$point');
+  }
 
-  test('squaredDistanceTo', () {
+  // squaredDistanceTo
+  {
     var a = new Point(7, 11);
     var b = new Point(3, -1);
-    expect(a.squaredDistanceTo(b), 160);
-    expect(b.squaredDistanceTo(a), 160);
-  });
+    Expect.equals(160, a.squaredDistanceTo(b));
+    Expect.equals(160, b.squaredDistanceTo(a));
+  }
 
-  test('distanceTo', () {
+  // distanceTo
+  {
     var a = new Point(-2, -3);
     var b = new Point(2, 0);
-    expect(a.distanceTo(b), 5);
-    expect(b.distanceTo(a), 5);
-  });
+    Expect.equals(5, a.distanceTo(b));
+    Expect.equals(5, b.distanceTo(a));
+  }
 
-  test('subtract', () {
+  // subtract
+  {
     var a = new Point(5, 10);
     var b = new Point(2, 50);
-    expect(a - b, new Point(3, -40));
-  });
+    Expect.equals(new Point(3, -40), a - b);
+  }
 
-  test('add', () {
+  // add
+  {
     var a = new Point(5, 10);
     var b = new Point(2, 50);
-    expect(a + b, new Point(7, 60));
-  });
+    Expect.equals(new Point(7, 60), a + b);
+  }
 
-  test('hashCode', () {
+  // hashCode
+  {
     var a = new Point(0, 1);
     var b = new Point(0, 1);
-    expect(a.hashCode, b.hashCode);
+    Expect.equals(b.hashCode, a.hashCode);
 
     var c = new Point(1, 0);
-    expect(a.hashCode == c.hashCode, isFalse);
-  });
+    Expect.isFalse(a.hashCode == c.hashCode);
+  }
 
-  test('magnitute', () {
+  // magnitude
+  {
     var a = new Point(5, 10);
     var b = new Point(0, 0);
-    expect(a.magnitude, a.distanceTo(b));
-    expect(b.magnitude, 0);
+    Expect.equals(a.distanceTo(b), a.magnitude);
+    Expect.equals(0, b.magnitude);
 
     var c = new Point(-5, -10);
-    expect(c.magnitude, a.distanceTo(b));
-  });
+    Expect.equals(a.distanceTo(b), c.magnitude);
+  }
 }
diff --git a/pkg/dev_compiler/test/codegen/lib/math/rectangle_test.dart b/pkg/dev_compiler/test/codegen/lib/math/rectangle_test.dart
index baacd96..493a614 100644
--- a/pkg/dev_compiler/test/codegen/lib/math/rectangle_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/math/rectangle_test.dart
@@ -2,249 +2,254 @@
 // for 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 rect_test;
-
 import 'dart:math';
-import 'package:unittest/unittest.dart';
+import 'package:expect/expect.dart';
 
 main() {
-  Rectangle createRectangle(List<num> a) {
-    return a != null ? new Rectangle(a[0], a[1], a[2] - a[0], a[3] - a[1])
-        : null;
-  }
-
-  test('construction', () {
-    var r0 = new Rectangle(10, 20, 30, 40);
-    expect(r0.toString(), 'Rectangle (10, 20) 30 x 40');
-    expect(r0.right, 40);
-    expect(r0.bottom, 60);
-
-    var r1 = new Rectangle.fromPoints(r0.topLeft, r0.bottomRight);
-    expect(r1, r0);
-
-    var r2 = new Rectangle.fromPoints(r0.bottomRight, r0.topLeft);
-    expect(r2, r0);
-  });
-
-  test('intersection', () {
-    var tests = [
-        [[10, 10, 20, 20], [15, 15, 25, 25], [15, 15, 20, 20]],
-        [[10, 10, 20, 20], [20, 0, 30, 10], [20, 10, 20, 10]],
-        [[0, 0, 1, 1], [10, 11, 12, 13], null],
-        [[11, 12, 98, 99], [22, 23, 34, 35], [22, 23, 34, 35]]];
-
-    for (var test in tests) {
-      var r0 = createRectangle(test[0]);
-      var r1 = createRectangle(test[1]);
-      var expected = createRectangle(test[2]);
-
-      expect(r0.intersection(r1), expected);
-      expect(r1.intersection(r0), expected);
-    }
-  });
-
-  test('intersects', () {
-    var r0 = new Rectangle(10, 10, 20, 20);
-    var r1 = new Rectangle(15, 15, 25, 25);
-    var r2 = new Rectangle(0, 0, 1, 1);
-
-    expect(r0.intersects(r1), isTrue);
-    expect(r1.intersects(r0), isTrue);
-
-    expect(r0.intersects(r2), isFalse);
-    expect(r2.intersects(r0), isFalse);
-  });
-
-  test('boundingBox', () {
-    var tests = [
-        [[10, 10, 20, 20], [15, 15, 25, 25], [10, 10, 25, 25]],
-        [[10, 10, 20, 20], [20, 0, 30, 10], [10, 0, 30, 20]],
-        [[0, 0, 1, 1], [10, 11, 12, 13], [0, 0, 12, 13]],
-        [[11, 12, 98, 99], [22, 23, 34, 35], [11, 12, 98, 99]]];
-
-    for (var test in tests) {
-      var r0 = createRectangle(test[0]);
-      var r1 = createRectangle(test[1]);
-      var expected = createRectangle(test[2]);
-
-      expect(r0.boundingBox(r1), expected);
-      expect(r1.boundingBox(r0), expected);
-    }
-  });
-
-  test('containsRectangle', () {
-    var r = new Rectangle(-10, 0, 20, 10);
-    expect(r.containsRectangle(r), isTrue);
-
-    expect(r.containsRectangle(
-        new Rectangle(double.NAN, double.NAN, double.NAN, double.NAN)), isFalse);
-
-    var r2 = new Rectangle(0, 2, 5, 5);
-    expect(r.containsRectangle(r2), isTrue);
-    expect(r2.containsRectangle(r), isFalse);
-
-    r2 = new Rectangle(-11, 2, 5, 5);
-    expect(r.containsRectangle(r2), isFalse);
-    r2 = new Rectangle(0, 2, 15, 5);
-    expect(r.containsRectangle(r2), isFalse);
-    r2 = new Rectangle(0, 2, 5, 10);
-    expect(r.containsRectangle(r2), isFalse);
-    r2 = new Rectangle(0, 0, 5, 10);
-    expect(r.containsRectangle(r2), isTrue);
-  });
-
-  test('containsPoint', () {
-    var r = new Rectangle(20, 40, 60, 80);
-
-    // Test middle.
-    expect(r.containsPoint(new Point(50, 80)), isTrue);
-
-    // Test edges.
-    expect(r.containsPoint(new Point(20, 40)), isTrue);
-    expect(r.containsPoint(new Point(50, 40)), isTrue);
-    expect(r.containsPoint(new Point(80, 40)), isTrue);
-    expect(r.containsPoint(new Point(80, 80)), isTrue);
-    expect(r.containsPoint(new Point(80, 120)), isTrue);
-    expect(r.containsPoint(new Point(50, 120)), isTrue);
-    expect(r.containsPoint(new Point(20, 120)), isTrue);
-    expect(r.containsPoint(new Point(20, 80)), isTrue);
-
-    // Test outside.
-    expect(r.containsPoint(new Point(0, 0)), isFalse);
-    expect(r.containsPoint(new Point(50, 0)), isFalse);
-    expect(r.containsPoint(new Point(100, 0)), isFalse);
-    expect(r.containsPoint(new Point(100, 80)), isFalse);
-    expect(r.containsPoint(new Point(100, 160)), isFalse);
-    expect(r.containsPoint(new Point(50, 160)), isFalse);
-    expect(r.containsPoint(new Point(0, 160)), isFalse);
-    expect(r.containsPoint(new Point(0, 80)), isFalse);
-  });
-
-  test('hashCode', () {
-    var a = new Rectangle(0, 1, 2, 3);
-    var b = new Rectangle(0, 1, 2, 3);
-    expect(a.hashCode, b.hashCode);
-
-    var c = new Rectangle(1, 0, 2, 3);
-    expect(a.hashCode == c.hashCode, isFalse);
-  });
-
-  {  // Edge cases for boundingBox/intersection
-    edgeTest(a, l) {
-      test('edge case $a/$l', () {
-        var r = new Rectangle(a, a, l, l);
-        expect(r.boundingBox(r), r);
-        expect(r.intersection(r), r);
-      });
-    }
-
-    var bignum1 = 0x20000000000000 + 0.0;
-    var bignum2 = 0x20000000000002 + 0.0;
-    var bignum3 = 0x20000000000004 + 0.0;
-    edgeTest(1.0, bignum1);
-    edgeTest(1.0, bignum2);
-    edgeTest(1.0, bignum3);
-    edgeTest(bignum1, 1.0);
-    edgeTest(bignum2, 1.0);
-    edgeTest(bignum3, 1.0);
-  }
-
-  test("equality with different widths", () {
-    var bignum = 0x80000000000008 + 0.0;
-    var r1 = new Rectangle(bignum, bignum, 1.0, 1.0);
-    var r2 = new Rectangle(bignum, bignum, 2.0, 2.0);
-    expect(r1, r2);
-    expect(r1.hashCode, r2.hashCode);
-    expect(r1.right, r2.right);
-    expect(r1.bottom, r2.bottom);
-    expect(r1.width, 1.0);
-    expect(r2.width, 2.0);
-  });
-
-  test('negative lengths', () {
-    // Constructor allows negative lengths, but clamps them to zero.
-    expect(new Rectangle(4, 4, -2, -2), new Rectangle(4, 4, 0, 0));
-    expect(new MutableRectangle(4, 4, -2, -2), new Rectangle(4, 4, 0, 0));
-
-    // Setters clamp negative lengths to zero.
-    var r = new MutableRectangle(0, 0, 1, 1);
-    r.width = -1;
-    r.height = -1;
-    expect(r, new Rectangle(0, 0, 0, 0));
-
-    // Test that doubles are clamped to double zero.
-    r = new Rectangle(1.5, 1.5, -2.5, -2.5);
-    expect(identical(r.width, 0.0), isTrue);
-    expect(identical(r.height, 0.0), isTrue);
-  });
-
-  // A NaN-value in any rectangle value means the rectange is considered
-  // empty (contains no points, doesn't intersect any other rectangle).
-  const NaN = double.NAN;
-  var isNaN = predicate((x) => x is double && x.isNaN, "NaN");
-
-  test('NaN left', () {
-    var rectangles = [
-      const Rectangle(NaN, 1, 2, 3),
-      new MutableRectangle(NaN, 1, 2, 3),
-      new Rectangle.fromPoints(new Point(NaN, 1), new Point(2, 4)),
-      new MutableRectangle.fromPoints(new Point(NaN, 1), new Point(2, 4)),
-    ];
-    for (var r in rectangles) {
-      expect(r.containsPoint(new Point(0, 1)), false);
-      expect(r.containsRectangle(new Rectangle(0, 1, 2, 3)), false);
-      expect(r.intersects(new Rectangle(0, 1, 2, 3)), false);
-      expect(r.left, isNaN);
-      expect(r.right, isNaN);
-    }
-  });
-
-  test('NaN top', () {
-    var rectangles = [
-      const Rectangle(0, NaN, 2, 3),
-      new MutableRectangle(0, NaN, 2, 3),
-      new Rectangle.fromPoints(new Point(0, NaN), new Point(2, 4)),
-      new MutableRectangle.fromPoints(new Point(0, NaN), new Point(2, 4)),
-    ];
-    for (var r in rectangles) {
-      expect(r.containsPoint(new Point(0, 1)), false);
-      expect(r.containsRectangle(new Rectangle(0, 1, 2, 3)), false);
-      expect(r.intersects(new Rectangle(0, 1, 2, 3)), false);
-      expect(r.top, isNaN);
-      expect(r.bottom, isNaN);
-    }
-  });
-
-  test('NaN width', () {
-    var rectangles = [
-      const Rectangle(0, 1, NaN, 3),
-      new MutableRectangle(0, 1, NaN, 3),
-      new Rectangle.fromPoints(new Point(0, 1), new Point(NaN, 4)),
-      new MutableRectangle.fromPoints(new Point(0, 1), new Point(NaN, 4)),
-    ];
-    for (var r in rectangles) {
-      expect(r.containsPoint(new Point(0, 1)), false);
-      expect(r.containsRectangle(new Rectangle(0, 1, 2, 3)), false);
-      expect(r.intersects(new Rectangle(0, 1, 2, 3)), false);
-      expect(r.right, isNaN);
-      expect(r.width, isNaN);
-    }
-  });
-
-  test('NaN heigth', () {
-    var rectangles = [
-      const Rectangle(0, 1, 2, NaN),
-      new MutableRectangle(0, 1, 2, NaN),
-      new Rectangle.fromPoints(new Point(0, 1), new Point(2, NaN)),
-      new MutableRectangle.fromPoints(new Point(0, 1), new Point(2, NaN)),
-    ];
-    for (var r in rectangles) {
-      expect(r.containsPoint(new Point(0, 1)), false);
-      expect(r.containsRectangle(new Rectangle(0, 1, 2, 3)), false);
-      expect(r.intersects(new Rectangle(0, 1, 2, 3)), false);
-      expect(r.bottom, isNaN);
-      expect(r.height, isNaN);
-    }
-  });
+  testConstruction();
+  testIntersection();
+  testIntersects();
+  testBoundingBox();
+  testContainsRectangle();
+  testContainsPoint();
+  testHashCode();
+  testEdgeCases();
+  testEquality();
+  testNegativeLengths();
+  testNaNLeft();
+  testNaNTop();
+  testNaNWidth();
+  testNaNHeight();
 }
 
+Rectangle createRectangle(List<num> a) {
+  return a != null ? new Rectangle(a[0], a[1], a[2] - a[0], a[3] - a[1])
+      : null;
+}
+
+testConstruction() {
+  var r0 = new Rectangle(10, 20, 30, 40);
+  Expect.equals('Rectangle (10, 20) 30 x 40', r0.toString());
+  Expect.equals(40, r0.right);
+  Expect.equals(60, r0.bottom);
+
+  var r1 = new Rectangle.fromPoints(r0.topLeft, r0.bottomRight);
+  Expect.equals(r0, r1);
+
+  var r2 = new Rectangle.fromPoints(r0.bottomRight, r0.topLeft);
+  Expect.equals(r0, r2);
+}
+
+testIntersection() {
+  var tests = [
+      [[10, 10, 20, 20], [15, 15, 25, 25], [15, 15, 20, 20]],
+      [[10, 10, 20, 20], [20, 0, 30, 10], [20, 10, 20, 10]],
+      [[0, 0, 1, 1], [10, 11, 12, 13], null],
+      [[11, 12, 98, 99], [22, 23, 34, 35], [22, 23, 34, 35]]];
+
+  for (var test in tests) {
+    var r0 = createRectangle(test[0]);
+    var r1 = createRectangle(test[1]);
+    var expected = createRectangle(test[2]);
+
+    Expect.equals(expected, r0.intersection(r1));
+    Expect.equals(expected, r1.intersection(r0));
+  }
+}
+
+testIntersects() {
+  var r0 = new Rectangle(10, 10, 20, 20);
+  var r1 = new Rectangle(15, 15, 25, 25);
+  var r2 = new Rectangle(0, 0, 1, 1);
+
+  Expect.isTrue(r0.intersects(r1));
+  Expect.isTrue(r1.intersects(r0));
+
+  Expect.isFalse(r0.intersects(r2));
+  Expect.isFalse(r2.intersects(r0));
+}
+
+testBoundingBox() {
+  var tests = [
+      [[10, 10, 20, 20], [15, 15, 25, 25], [10, 10, 25, 25]],
+      [[10, 10, 20, 20], [20, 0, 30, 10], [10, 0, 30, 20]],
+      [[0, 0, 1, 1], [10, 11, 12, 13], [0, 0, 12, 13]],
+      [[11, 12, 98, 99], [22, 23, 34, 35], [11, 12, 98, 99]]];
+
+  for (var test in tests) {
+    var r0 = createRectangle(test[0]);
+    var r1 = createRectangle(test[1]);
+    var expected = createRectangle(test[2]);
+
+    Expect.equals(expected, r0.boundingBox(r1));
+    Expect.equals(expected, r1.boundingBox(r0));
+  }
+}
+
+testContainsRectangle() {
+  var r = new Rectangle(-10, 0, 20, 10);
+  Expect.isTrue(r.containsRectangle(r));
+
+  Expect.isFalse(r.containsRectangle(
+      new Rectangle(double.NAN, double.NAN, double.NAN, double.NAN)));
+
+  var r2 = new Rectangle(0, 2, 5, 5);
+  Expect.isTrue(r.containsRectangle(r2));
+  Expect.isFalse(r2.containsRectangle(r));
+
+  r2 = new Rectangle(-11, 2, 5, 5);
+  Expect.isFalse(r.containsRectangle(r2));
+  r2 = new Rectangle(0, 2, 15, 5);
+  Expect.isFalse(r.containsRectangle(r2));
+  r2 = new Rectangle(0, 2, 5, 10);
+  Expect.isFalse(r.containsRectangle(r2));
+  r2 = new Rectangle(0, 0, 5, 10);
+  Expect.isTrue(r.containsRectangle(r2));
+}
+
+testContainsPoint() {
+  var r = new Rectangle(20, 40, 60, 80);
+
+  // Test middle.
+  Expect.isTrue(r.containsPoint(new Point(50, 80)));
+
+  // Test edges.
+  Expect.isTrue(r.containsPoint(new Point(20, 40)));
+  Expect.isTrue(r.containsPoint(new Point(50, 40)));
+  Expect.isTrue(r.containsPoint(new Point(80, 40)));
+  Expect.isTrue(r.containsPoint(new Point(80, 80)));
+  Expect.isTrue(r.containsPoint(new Point(80, 120)));
+  Expect.isTrue(r.containsPoint(new Point(50, 120)));
+  Expect.isTrue(r.containsPoint(new Point(20, 120)));
+  Expect.isTrue(r.containsPoint(new Point(20, 80)));
+
+  // Test outside.
+  Expect.isFalse(r.containsPoint(new Point(0, 0)));
+  Expect.isFalse(r.containsPoint(new Point(50, 0)));
+  Expect.isFalse(r.containsPoint(new Point(100, 0)));
+  Expect.isFalse(r.containsPoint(new Point(100, 80)));
+  Expect.isFalse(r.containsPoint(new Point(100, 160)));
+  Expect.isFalse(r.containsPoint(new Point(50, 160)));
+  Expect.isFalse(r.containsPoint(new Point(0, 160)));
+  Expect.isFalse(r.containsPoint(new Point(0, 80)));
+}
+
+testHashCode() {
+  var a = new Rectangle(0, 1, 2, 3);
+  var b = new Rectangle(0, 1, 2, 3);
+  Expect.equals(b.hashCode, a.hashCode);
+
+  var c = new Rectangle(1, 0, 2, 3);
+  Expect.isFalse(a.hashCode == c.hashCode);
+}
+
+testEdgeCases() {
+  edgeTest(double a, double l) {
+      var r = new Rectangle(a, a, l, l);
+      Expect.equals(r, r.boundingBox(r));
+      Expect.equals(r, r.intersection(r));
+  }
+
+  var bignum1 = 0x20000000000000 + 0.0;
+  var bignum2 = 0x20000000000002 + 0.0;
+  var bignum3 = 0x20000000000004 + 0.0;
+  edgeTest(1.0, bignum1);
+  edgeTest(1.0, bignum2);
+  edgeTest(1.0, bignum3);
+  edgeTest(bignum1, 1.0);
+  edgeTest(bignum2, 1.0);
+  edgeTest(bignum3, 1.0);
+}
+
+testEquality() {
+  var bignum = 0x80000000000008 + 0.0;
+  var r1 = new Rectangle(bignum, bignum, 1.0, 1.0);
+  var r2 = new Rectangle(bignum, bignum, 2.0, 2.0);
+  Expect.equals(r2, r1);
+  Expect.equals(r2.hashCode, r1.hashCode);
+  Expect.equals(r2.right, r1.right);
+  Expect.equals(r2.bottom, r1.bottom);
+  Expect.equals(1.0, r1.width);
+  Expect.equals(2.0, r2.width);
+}
+
+testNegativeLengths() {
+  // Constructor allows negative lengths, but clamps them to zero.
+  Expect.equals(new Rectangle(4, 4, 0, 0), new Rectangle(4, 4, -2, -2));
+  Expect.equals(new Rectangle(4, 4, 0, 0),
+      new MutableRectangle(4, 4, -2, -2));
+
+  // Setters clamp negative lengths to zero.
+  var mutable = new MutableRectangle(0, 0, 1, 1);
+  mutable.width = -1;
+  mutable.height = -1;
+  Expect.equals(new Rectangle(0, 0, 0, 0), mutable);
+
+  // Test that doubles are clamped to double zero.
+  var rectangle = new Rectangle(1.5, 1.5, -2.5, -2.5);
+  Expect.isTrue(identical(rectangle.width, 0.0));
+  Expect.isTrue(identical(rectangle.height, 0.0));
+}
+
+testNaNLeft() {
+  var rectangles = [
+    const Rectangle(double.NAN, 1, 2, 3),
+    new MutableRectangle(double.NAN, 1, 2, 3),
+    new Rectangle.fromPoints(new Point(double.NAN, 1), new Point(2, 4)),
+    new MutableRectangle.fromPoints(new Point(double.NAN, 1), new Point(2, 4)),
+  ];
+  for (var r in rectangles) {
+    Expect.isFalse(r.containsPoint(new Point(0, 1)));
+    Expect.isFalse(r.containsRectangle(new Rectangle(0, 1, 2, 3)));
+    Expect.isFalse(r.intersects(new Rectangle(0, 1, 2, 3)));
+    Expect.isTrue(r.left.isNaN);
+    Expect.isTrue(r.right.isNaN);
+  }
+}
+testNaNTop() {
+  var rectangles = [
+    const Rectangle(0, double.NAN, 2, 3),
+    new MutableRectangle(0, double.NAN, 2, 3),
+    new Rectangle.fromPoints(new Point(0, double.NAN), new Point(2, 4)),
+    new MutableRectangle.fromPoints(new Point(0, double.NAN), new Point(2, 4)),
+  ];
+  for (var r in rectangles) {
+    Expect.isFalse(r.containsPoint(new Point(0, 1)));
+    Expect.isFalse(r.containsRectangle(new Rectangle(0, 1, 2, 3)));
+    Expect.isFalse(r.intersects(new Rectangle(0, 1, 2, 3)));
+    Expect.isTrue(r.top.isNaN);
+    Expect.isTrue(r.bottom.isNaN);
+  }
+}
+
+testNaNWidth() {
+  var rectangles = [
+    const Rectangle(0, 1, double.NAN, 3),
+    new MutableRectangle(0, 1, double.NAN, 3),
+    new Rectangle.fromPoints(new Point(0, 1), new Point(double.NAN, 4)),
+    new MutableRectangle.fromPoints(new Point(0, 1), new Point(double.NAN, 4)),
+  ];
+  for (var r in rectangles) {
+    Expect.isFalse(r.containsPoint(new Point(0, 1)));
+    Expect.isFalse(r.containsRectangle(new Rectangle(0, 1, 2, 3)));
+    Expect.isFalse(r.intersects(new Rectangle(0, 1, 2, 3)));
+    Expect.isTrue(r.right.isNaN);
+    Expect.isTrue(r.width.isNaN);
+  }
+}
+
+testNaNHeight() {
+  var rectangles = [
+    const Rectangle(0, 1, 2, double.NAN),
+    new MutableRectangle(0, 1, 2, double.NAN),
+    new Rectangle.fromPoints(new Point(0, 1), new Point(2, double.NAN)),
+    new MutableRectangle.fromPoints(new Point(0, 1), new Point(2, double.NAN)),
+  ];
+  for (var r in rectangles) {
+    Expect.isFalse(r.containsPoint(new Point(0, 1)));
+    Expect.isFalse(r.containsRectangle(new Rectangle(0, 1, 2, 3)));
+    Expect.isFalse(r.intersects(new Rectangle(0, 1, 2, 3)));
+    Expect.isTrue(r.bottom.isNaN);
+    Expect.isTrue(r.height.isNaN);
+  }
+}
\ No newline at end of file
diff --git a/pkg/dev_compiler/test/codegen/lib/mirrors/mixin_simple_test.dart b/pkg/dev_compiler/test/codegen/lib/mirrors/mixin_simple_test.dart
new file mode 100644
index 0000000..7edcbe4
--- /dev/null
+++ b/pkg/dev_compiler/test/codegen/lib/mirrors/mixin_simple_test.dart
@@ -0,0 +1,38 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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.mixin;
+
+import 'dart:mirrors';
+
+import 'package:expect/expect.dart';
+
+class Super {}
+class Mixin {}
+class Mixin2 {}
+
+class Class extends Super with Mixin {}
+class MultipleMixins extends Class with Mixin2 {}
+
+main() {
+  Expect.equals(reflectClass(Class),
+                reflectClass(Class).mixin);
+  Expect.equals(reflectClass(Mixin),
+                reflectClass(Class).superclass.mixin);
+  Expect.equals(reflectClass(Super),
+                reflectClass(Class).superclass.superclass.mixin);
+
+  Expect.equals(reflectClass(MultipleMixins),
+                reflectClass(MultipleMixins).mixin);
+  Expect.equals(reflectClass(Mixin2),
+                reflectClass(MultipleMixins).superclass.mixin);
+  Expect.equals(reflectClass(Class),
+                reflectClass(MultipleMixins).superclass.superclass.mixin);
+  Expect.equals(reflectClass(Mixin),
+                reflectClass(MultipleMixins).superclass.superclass.superclass
+                    .mixin);
+  Expect.equals(reflectClass(Super),
+                reflectClass(MultipleMixins).superclass.superclass.superclass
+                    .superclass.mixin);
+}
diff --git a/pkg/dev_compiler/test/codegen/lib/mirrors/private_field_helper.dart b/pkg/dev_compiler/test/codegen/lib/mirrors/private_field_helper.dart
new file mode 100644
index 0000000..8c82450
--- /dev/null
+++ b/pkg/dev_compiler/test/codegen/lib/mirrors/private_field_helper.dart
@@ -0,0 +1,18 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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.mixin;
+
+import 'dart:mirrors';
+
+import 'package:expect/expect.dart';
+
+class Bar {
+  String _field = "hello";
+  String get field => _field;
+}
+
+var privateSymbol2 = #_field;
+var publicSymbol2 = #field;
+
diff --git a/pkg/dev_compiler/test/codegen/lib/mirrors/private_field_test.dart b/pkg/dev_compiler/test/codegen/lib/mirrors/private_field_test.dart
new file mode 100644
index 0000000..14c110c
--- /dev/null
+++ b/pkg/dev_compiler/test/codegen/lib/mirrors/private_field_test.dart
@@ -0,0 +1,36 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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.mixin;
+
+import 'dart:mirrors';
+
+import 'package:expect/expect.dart';
+
+import 'private_field_helper.dart';
+
+class Foo extends Bar {
+  int _field = 42;
+
+  static int _staticField = 99;
+}
+
+var privateSymbol = #_field;
+var publicSymbol = #field;
+
+main() {
+  Expect.equals(publicSymbol, publicSymbol2);
+  Expect.notEquals(privateSymbol, privateSymbol2);
+  
+  var foo = new Foo();
+  var m = reflect(foo);
+  m.setField(privateSymbol, 38);
+  Expect.equals(38, foo._field);
+  m.setField(privateSymbol2, "world");
+  Expect.equals("world", foo.field);
+  Expect.equals("world", m.getField(publicSymbol).reflectee);
+
+  var type = reflectClass(Foo);
+  Expect.equals(99, type.getField(#_staticField).reflectee);
+}
diff --git a/pkg/dev_compiler/test/codegen_expected/BenchmarkBase.js b/pkg/dev_compiler/test/codegen_expected/BenchmarkBase.js
index 7535ac0..48a5eb6 100644
--- a/pkg/dev_compiler/test/codegen_expected/BenchmarkBase.js
+++ b/pkg/dev_compiler/test/codegen_expected/BenchmarkBase.js
@@ -16,7 +16,7 @@
         dart.throw(dart.str`Lists have different lengths: ${expected[dartx.length]} vs ${actual[dartx.length]}`);
       }
       for (let i = 0; i < dart.notNull(actual[dartx.length]); i++) {
-        BenchmarkBase$.Expect.equals(expected[dartx.get](i), actual[dartx.get](i));
+        BenchmarkBase$.Expect.equals(expected[dartx._get](i), actual[dartx._get](i));
       }
     }
     fail(message) {
diff --git a/pkg/dev_compiler/test/codegen_expected/closure.js b/pkg/dev_compiler/test/codegen_expected/closure.js
index ebfd865..698b90f 100644
--- a/pkg/dev_compiler/test/codegen_expected/closure.js
+++ b/pkg/dev_compiler/test/codegen_expected/closure.js
@@ -10,6 +10,7 @@
 let Foo = () => (Foo = dart.constFn(closure.Foo$()))();
 let ListOfTAndTToListOfT = () => (ListOfTAndTToListOfT = dart.constFn(dart.definiteFunctionType(T => [core.List$(T), [core.List$(T), T]])))();
 let dynamicTovoid = () => (dynamicTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [dart.dynamic])))();
+let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
 closure.generic_function = function(T) {
   return (items: core.List<T>, seed: T): core.List<T> => {
     let strings = items[dartx.map](core.String)(dart.fn((i: T): string => dart.str`${i}`, dart.definiteFunctionType(core.String, [T])))[dartx.toList]();
@@ -116,6 +117,14 @@
 closure.main = function(args): void {
 };
 dart.fn(closure.main, dynamicTovoid());
+dart.defineLazy(closure, {
+  get closure() {
+    return dart.fn(() => {
+      return;
+    }, VoidTodynamic());
+  },
+  set closure(_) {}
+});
 /** @final {string} */
 closure.some_top_level_constant = "abc";
 /** @final {string} */
diff --git a/pkg/dev_compiler/test/codegen_expected/expect.js b/pkg/dev_compiler/test/codegen_expected/expect.js
index f2a8dcc..793ac41 100644
--- a/pkg/dev_compiler/test/codegen_expected/expect.js
+++ b/pkg/dev_compiler/test/codegen_expected/expect.js
@@ -208,6 +208,37 @@
       }
       expect.Expect._fail(sb.toString());
     }
+    static deepEquals(expected, actual) {
+      if (dart.equals(expected, actual)) return;
+      if (typeof expected == 'string' && typeof actual == 'string') {
+        expect.Expect.stringEquals(expected, actual);
+      } else if (core.Iterable.is(expected) && core.Iterable.is(actual)) {
+        let expectedLength = expected[dartx.length];
+        let actualLength = actual[dartx.length];
+        let length = dart.notNull(expectedLength) < dart.notNull(actualLength) ? expectedLength : actualLength;
+        for (let i = 0; i < dart.notNull(length); i++) {
+          expect.Expect.deepEquals(expected[dartx.elementAt](i), actual[dartx.elementAt](i));
+        }
+        if (expectedLength != actualLength) {
+          let nextElement = (dart.notNull(expectedLength) > dart.notNull(length) ? expected : actual)[dartx.elementAt](length);
+          expect.Expect._fail('Expect.deepEquals(list length, ' + dart.str`expected: <${expectedLength}>, actual: <${actualLength}>) ` + dart.str`fails: Next element <${nextElement}>`);
+        }
+      } else if (core.Map.is(expected) && core.Map.is(actual)) {
+        for (let key of expected[dartx.keys]) {
+          if (!dart.test(actual[dartx.containsKey](key))) {
+            expect.Expect._fail(dart.str`Expect.deepEquals(missing expected key: <${key}>) fails`);
+          }
+          expect.Expect.deepEquals(expected[dartx.get](key), actual[dartx.get](key));
+        }
+        for (let key of actual[dartx.keys]) {
+          if (!dart.test(expected[dartx.containsKey](key))) {
+            expect.Expect._fail(dart.str`Expect.deepEquals(unexpected key: <${key}>) fails`);
+          }
+        }
+      } else {
+        expect.Expect._fail(dart.str`Expect.deepEquals(expected: <${expected}>, actual: <${actual}>) ` + "fails.");
+      }
+    }
     static throws(f, check, reason) {
       if (check === void 0) check = null;
       if (reason === void 0) reason = null;
@@ -253,11 +284,12 @@
       mapEquals: dart.definiteFunctionType(dart.void, [core.Map, core.Map], [core.String]),
       stringEquals: dart.definiteFunctionType(dart.void, [core.String, core.String], [core.String]),
       setEquals: dart.definiteFunctionType(dart.void, [core.Iterable, core.Iterable], [core.String]),
+      deepEquals: dart.definiteFunctionType(dart.void, [core.Object, core.Object]),
       throws: dart.definiteFunctionType(dart.void, [VoidTovoid()], [expect._CheckExceptionFn, core.String]),
       _getMessage: dart.definiteFunctionType(core.String, [core.String]),
       _fail: dart.definiteFunctionType(dart.void, [core.String])
     }),
-    names: ['_truncateString', '_stringDifference', 'equals', 'isTrue', 'isFalse', 'isNull', 'isNotNull', 'identical', 'fail', 'approxEquals', 'notEquals', 'listEquals', 'mapEquals', 'stringEquals', 'setEquals', 'throws', '_getMessage', '_fail']
+    names: ['_truncateString', '_stringDifference', 'equals', 'isTrue', 'isFalse', 'isNull', 'isNotNull', 'identical', 'fail', 'approxEquals', 'notEquals', 'listEquals', 'mapEquals', 'stringEquals', 'setEquals', 'deepEquals', 'throws', '_getMessage', '_fail']
   });
   expect._identical = function(a, b) {
     return core.identical(a, b);
diff --git a/pkg/dev_compiler/test/codegen_expected/minitest.js b/pkg/dev_compiler/test/codegen_expected/minitest.js
new file mode 100644
index 0000000..f251c5e
--- /dev/null
+++ b/pkg/dev_compiler/test/codegen_expected/minitest.js
@@ -0,0 +1,229 @@
+define(['dart_sdk', 'expect'], function(dart_sdk, expect) {
+  'use strict';
+  const core = dart_sdk.core;
+  const _interceptors = dart_sdk._interceptors;
+  const dart = dart_sdk.dart;
+  const dartx = dart_sdk.dartx;
+  const expect$ = expect.expect;
+  const minitest = Object.create(null);
+  let JSArrayOf_Group = () => (JSArrayOf_Group = dart.constFn(_interceptors.JSArray$(minitest._Group)))();
+  let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.functionType(dart.dynamic, [])))();
+  let ObjectTobool = () => (ObjectTobool = dart.constFn(dart.functionType(core.bool, [core.Object])))();
+  let ObjectTovoid = () => (ObjectTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.Object])))();
+  let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionType(core.bool, [dart.dynamic])))();
+  let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [])))();
+  let StringAndFnTovoid = () => (StringAndFnTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String, VoidTodynamic()])))();
+  let FnTovoid = () => (FnTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [VoidTodynamic()])))();
+  let ObjectAndObject__Tovoid = () => (ObjectAndObject__Tovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.Object, core.Object], {reason: core.String})))();
+  let StringTovoid = () => (StringTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String])))();
+  let ObjectToObject = () => (ObjectToObject = dart.constFn(dart.definiteFunctionType(core.Object, [core.Object])))();
+  let Fn__ToObject = () => (Fn__ToObject = dart.constFn(dart.definiteFunctionType(core.Object, [ObjectTobool()], [core.String])))();
+  let numAndnumToObject = () => (numAndnumToObject = dart.constFn(dart.definiteFunctionType(core.Object, [core.num, core.num])))();
+  let numToObject = () => (numToObject = dart.constFn(dart.definiteFunctionType(core.Object, [core.num])))();
+  minitest._Action = dart.typedef('_Action', () => dart.functionType(dart.void, []));
+  minitest._ExpectationFunction = dart.typedef('_ExpectationFunction', () => dart.functionType(dart.void, [core.Object]));
+  dart.defineLazy(minitest, {
+    get _groups() {
+      return JSArrayOf_Group().of([new minitest._Group()]);
+    }
+  });
+  dart.defineLazy(minitest, {
+    get isFalse() {
+      return new minitest._Expectation(expect$.Expect.isFalse);
+    }
+  });
+  dart.defineLazy(minitest, {
+    get isNotNull() {
+      return new minitest._Expectation(expect$.Expect.isNotNull);
+    }
+  });
+  dart.defineLazy(minitest, {
+    get isNull() {
+      return new minitest._Expectation(expect$.Expect.isNull);
+    }
+  });
+  dart.defineLazy(minitest, {
+    get isTrue() {
+      return new minitest._Expectation(expect$.Expect.isTrue);
+    }
+  });
+  dart.defineLazy(minitest, {
+    get returnsNormally() {
+      return new minitest._Expectation(dart.fn(actual => {
+        try {
+          minitest._Action.as(actual)();
+        } catch (error) {
+          expect$.Expect.fail(dart.str`Expected function to return normally, but threw:\n${error}`);
+        }
+
+      }, ObjectTovoid()));
+    }
+  });
+  dart.defineLazy(minitest, {
+    get throws() {
+      return new minitest._Expectation(dart.fn(actual => {
+        expect$.Expect.throws(minitest._Action.as(actual));
+      }, ObjectTovoid()));
+    }
+  });
+  dart.defineLazy(minitest, {
+    get throwsArgumentError() {
+      return new minitest._Expectation(dart.fn(actual => {
+        expect$.Expect.throws(minitest._Action.as(actual), dart.fn(error => core.ArgumentError.is(error), dynamicTobool()));
+      }, ObjectTovoid()));
+    }
+  });
+  dart.defineLazy(minitest, {
+    get throwsNoSuchMethodError() {
+      return new minitest._Expectation(dart.fn(actual => {
+        expect$.Expect.throws(minitest._Action.as(actual), dart.fn(error => core.NoSuchMethodError.is(error), dynamicTobool()));
+      }, ObjectTovoid()));
+    }
+  });
+  dart.defineLazy(minitest, {
+    get throwsRangeError() {
+      return new minitest._Expectation(dart.fn(actual => {
+        expect$.Expect.throws(minitest._Action.as(actual), dart.fn(error => core.RangeError.is(error), dynamicTobool()));
+      }, ObjectTovoid()));
+    }
+  });
+  dart.defineLazy(minitest, {
+    get throwsStateError() {
+      return new minitest._Expectation(dart.fn(actual => {
+        expect$.Expect.throws(minitest._Action.as(actual), dart.fn(error => core.StateError.is(error), dynamicTobool()));
+      }, ObjectTovoid()));
+    }
+  });
+  dart.defineLazy(minitest, {
+    get throwsUnsupportedError() {
+      return new minitest._Expectation(dart.fn(actual => {
+        expect$.Expect.throws(minitest._Action.as(actual), dart.fn(error => core.UnsupportedError.is(error), dynamicTobool()));
+      }, ObjectTovoid()));
+    }
+  });
+  minitest.finishTests = function() {
+    minitest._groups[dartx.clear]();
+    minitest._groups[dartx.add](new minitest._Group());
+  };
+  dart.fn(minitest.finishTests, VoidTovoid());
+  minitest.group = function(description, body) {
+    minitest._groups[dartx.add](new minitest._Group());
+    try {
+      body();
+    } finally {
+      minitest._groups[dartx.removeLast]();
+    }
+  };
+  dart.fn(minitest.group, StringAndFnTovoid());
+  minitest.test = function(description, body) {
+    for (let group of minitest._groups) {
+      if (group.setUpFunction != null) group.setUpFunction();
+    }
+    try {
+      body();
+    } finally {
+      for (let i = dart.notNull(minitest._groups[dartx.length]) - 1; i >= 0; i--) {
+        let group = minitest._groups[dartx.get](i);
+        if (group.tearDownFunction != null) group.tearDownFunction();
+      }
+    }
+  };
+  dart.fn(minitest.test, StringAndFnTovoid());
+  minitest.setUp = function(body) {
+    dart.assert(minitest._groups[dartx.last].setUpFunction == null);
+    minitest._groups[dartx.last].setUpFunction = body;
+  };
+  dart.fn(minitest.setUp, FnTovoid());
+  minitest.tearDown = function(body) {
+    dart.assert(minitest._groups[dartx.last].tearDownFunction == null);
+    minitest._groups[dartx.last].tearDownFunction = body;
+  };
+  dart.fn(minitest.tearDown, FnTovoid());
+  minitest.expect = function(actual, expected, opts) {
+    let reason = opts && 'reason' in opts ? opts.reason : null;
+    if (!minitest._Expectation.is(expected)) {
+      expected = minitest.equals(expected);
+    }
+    let expectation = minitest._Expectation.as(expected);
+    expectation.function(actual);
+  };
+  dart.fn(minitest.expect, ObjectAndObject__Tovoid());
+  minitest.fail = function(message) {
+    expect$.Expect.fail(message);
+  };
+  dart.fn(minitest.fail, StringTovoid());
+  minitest.equals = function(value) {
+    return new minitest._Expectation(dart.fn(actual => {
+      expect$.Expect.deepEquals(value, actual);
+    }, ObjectTovoid()));
+  };
+  dart.fn(minitest.equals, ObjectToObject());
+  minitest.notEquals = function(value) {
+    return new minitest._Expectation(dart.fn(actual => {
+      expect$.Expect.notEquals(value, actual);
+    }, ObjectTovoid()));
+  };
+  dart.fn(minitest.notEquals, ObjectToObject());
+  minitest.unorderedEquals = function(value) {
+    return new minitest._Expectation(dart.fn(actual => {
+      expect$.Expect.setEquals(core.Iterable._check(value), core.Iterable._check(actual));
+    }, ObjectTovoid()));
+  };
+  dart.fn(minitest.unorderedEquals, ObjectToObject());
+  minitest.predicate = function(fn, description) {
+    if (description === void 0) description = null;
+    return new minitest._Expectation(dart.fn(actual => {
+      expect$.Expect.isTrue(fn(actual));
+    }, ObjectTovoid()));
+  };
+  dart.fn(minitest.predicate, Fn__ToObject());
+  minitest.inInclusiveRange = function(min, max) {
+    return new minitest._Expectation(dart.fn(actual => {
+      let actualNum = core.num.as(actual);
+      if (dart.notNull(actualNum) < dart.notNull(min) || dart.notNull(actualNum) > dart.notNull(max)) {
+        minitest.fail(dart.str`Expected ${actualNum} to be in the inclusive range [${min}, ${max}].`);
+      }
+    }, ObjectTovoid()));
+  };
+  dart.fn(minitest.inInclusiveRange, numAndnumToObject());
+  minitest.greaterThan = function(value) {
+    return new minitest._Expectation(dart.fn(actual => {
+      let actualNum = core.num.as(actual);
+      if (dart.notNull(actualNum) <= dart.notNull(value)) {
+        minitest.fail(dart.str`Expected ${actualNum} to be greater than ${value}.`);
+      }
+    }, ObjectTovoid()));
+  };
+  dart.fn(minitest.greaterThan, numToObject());
+  minitest.same = function(value) {
+    return new minitest._Expectation(dart.fn(actual => {
+      expect$.Expect.identical(value, actual);
+    }, ObjectTovoid()));
+  };
+  dart.fn(minitest.same, ObjectToObject());
+  minitest._Group = class _Group extends core.Object {
+    new() {
+      this.setUpFunction = null;
+      this.tearDownFunction = null;
+    }
+  };
+  dart.setSignature(minitest._Group, {
+    fields: () => ({
+      setUpFunction: minitest._Action,
+      tearDownFunction: minitest._Action
+    })
+  });
+  minitest._Expectation = class _Expectation extends core.Object {
+    new(func) {
+      this.function = func;
+    }
+  };
+  dart.setSignature(minitest._Expectation, {
+    constructors: () => ({new: dart.definiteFunctionType(minitest._Expectation, [minitest._ExpectationFunction])}),
+    fields: () => ({function: minitest._ExpectationFunction})
+  });
+  // Exports:
+  return {
+    minitest: minitest
+  };
+});
diff --git a/pkg/dev_compiler/test/codegen_expected/sunflower/sunflower.js.map b/pkg/dev_compiler/test/codegen_expected/sunflower/sunflower.js.map
index 54b3f04..e102d33 100644
--- a/pkg/dev_compiler/test/codegen_expected/sunflower/sunflower.js.map
+++ b/pkg/dev_compiler/test/codegen_expected/sunflower/sunflower.js.map
@@ -1 +1 @@
-{"version":3,"sourceRoot":"","sources":["../../codegen/sunflower/sunflower.dart","../../codegen/sunflower/circle.dart","../../codegen/sunflower/painter.dart"],"names":["MAX_D","centerX","document","selector","querySelector","canvas","sqrt","slider","draw","seeds","int","context","i","TAU","PHI","SCALE_FACTOR","r","cos","theta","centerY","sin","x","y","SEED_RADIUS","notes","ORANGE","color","radius","PI"],"mappings":";;;;;;;;;;;;;AAYM,0BAAc,CAAC;AAAA,AACf,2BAAe,CAAC;AAAA,AAChB,oBAAQ,GAAG;AAAA,AACX,sBAAU,AAAAA,eAAK,GAAG,CAAC,AAAA;AAAA,AACnB,sBAAUC,iBAAO;AAAA,AAEvB,4BAAqB,SAAC,QAAe,EAAE;UAAG,AAAAC,cAAQ,sBAAeC,QAAQ,CAAC;GAAC,AAAA;AAAA;AACrE;IAAA;YAAS,uBAAA,AAAAC,uBAAa,CAAC,SAAS,CAAC,CAAiB;KAAA;;AAClD;IAAA;YAAU,kCAAA,AAAAC,gBAAM,mBAAY,IAAI,CAAC,CAA4B;KAAA;;AAC7D;IAAA;YAAS,sBAAA,AAAAD,uBAAa,CAAC,SAAS,CAAC,CAAgB;KAAA;;AACjD;IAAA;YAAQ,AAAAA,wBAAa,CAAC,QAAQ,CAAC;KAAA;;AAE/B;IAAA;YAAM,EAAA,aAAC,AAAAE,SAAI,CAAC,CAAC,CAAC,IAAG,CAAC,AAAC,IAAG,CAAC,AAAA;KAAA;;AACzB,oBAAQ,CAAC;AAAA,AAEb,mBAAS,WAAG;AACV,IAAA,AAAAC,gBAAM,yBAAkB,QAAQ,EAAE,QAAA,AAAC,CAAC,IAAK,AAAAC,cAAI,EAAE,AAAA,gBAAA,CAAC;AAAC,AACjD,IAAA,AAAAA,cAAI,EAAE;AAAC,GACR,AAAA;AAAA;AAED,mBACS,WAAG;AACV,IAAA,AAAAC,eAAK,GAAG,AAAAC,QAAG,OAAO,AAAAH,gBAAM,aAAM,CAAC,AAAA;AAAC,AAChC,IAAA,AAAAI,iBAAO,kBAAW,CAAC,EAAE,CAAC,EAAEX,eAAK,EAAEA,eAAK,CAAC;AAAC,AACtC,SAAK,IAAI,IAAI,CAAC,AAAA,AAAA,EAAE,AAAAY,CAAC,gBAAGH,eAAK,CAAA,EAAE,AAAAG,CAAC,EAAE,EAAE;AAC9B,kBAAc,AAAA,AAAAA,CAAC,GAAGC,WAAG,AAAA,gBAAGC,aAAG,CAAA;AAAC,AAC5B,cAAU,aAAA,AAAAR,SAAI,CAACM,CAAC,CAAC,IAAGG,sBAAY,AAAA;AAAC,AACjC,cAAU,AAAAd,iBAAO,GAAG,AAAAe,CAAC,gBAAGC,AAAA,QAAG,CAACC,KAAK,CAAC,CAAA,AAAA;AAAC,AACnC,cAAU,AAAAC,iBAAO,GAAG,AAAAH,CAAC,gBAAG,AAAAI,QAAG,CAACF,KAAK,CAAC,CAAA,AAAA;AAAC,AACnC,MAAA,AAAA,4BAAkBG,CAAC,EAAEC,CAAC,EAAEC,qBAAW,CAAC,MAAMZ,iBAAO,CAAC;AAAC,KACpD;AAAA,AACD,IAAA,AAAA,AAAAa,eAAK,YAAK,GAAG,WAAC,eAAM,QAAO,AAAA;AAAC,GAC7B,AAAA;AAAA;;ICnCC,IAAO,CAAM,EAAE,CAAM,EAAE,MAAW,EAAlC;;;;AAAmC,AAAC,KAAA;;;;;;;;;;;ICYtC;mBAEiBC,cAAM;KAevB;IAbE,KACU,OAAgC,EAAE;AAC1C,MAAAd,AACE,OADK,mBACQ;MADfA,AAEE,AAAA,OAFK,iBAEM,GAAG,CAAC,AAAA;MAFjBA,AAGE,AAAA,OAHK,iBAGM,GAAGe,UAAK,AAAA;MAHrBf,AAIE,AAAA,OAJK,mBAIQ,GAAGe,UAAK,AAAA;MAJvBf,AAKE,OALK,YAKCU,MAAC,EAAEC,MAAC,EAAEK,WAAM,EAAE,CAAC,EAAEd,WAAG,EAAE,KAAK,CAAC;MALpCF,AAME,OANK,cAMG;MANVA,AAOE,OAPK,mBAOQ;MAPfA,AAQE,OARK,gBAQK;AAAC,KACd,AAAA;;;;;;;;IFYD,IAAc,CAAK,EAAE,CAAK,EAAE,MAAU,EAAG,KAAY,EAArD;;AACE,gBAAMU,CAAC,EAAEC,CAAC,EAAEK,MAAM;AAAC,AAAC,AACpB,UAAI,AAAAD,KAAK,IAAI,IAAI,AAAA,EAAE,AAAA,AAAA,AAAA,IAAI,MAAM,GAAGA,KAAK,AAAA;AAAC,AAAA,AACvC,KAAA;;;;;AExCG,mBAAS,QAAQ;AAAA,AACjB,gBAAM,KAAK;AAAA,AACX,iBAAO,MAAM;AAAA,AACb,gBAAM,AAAAE,OAAE,GAAG,CAAC,AAAA;AAAA,AAElB,0BAAqB,SAAC,QAAe,EAAE;UAAG,AAAA1B,cAAQ,sBAAeC,QAAQ,CAAC;GAAC,AAAA;AAAA;AAErE;IAAA;YAAS,uBAAA,AAAAC,qBAAa,CAAC,SAAS,CAAC,CAAiB;KAAA;;AAClD;IAAA;YAAU,kCAAA,AAAAC,cAAM,mBAAY,IAAI,CAAC,CAA4B;KAAA","file":"sunflower.js"}
\ No newline at end of file
+{"version":3,"sourceRoot":"","sources":["../../codegen/sunflower/sunflower.dart","../../codegen/sunflower/circle.dart","../../codegen/sunflower/painter.dart"],"names":["MAX_D","centerX","document","selector","querySelector","canvas","sqrt","slider","draw","seeds","context","i","TAU","PHI","SCALE_FACTOR","r","cos","theta","centerY","sin","x","y","SEED_RADIUS","notes","ORANGE","color","radius","PI"],"mappings":";;;;;;;;;;;;;AAYM,0BAAc,CAAC;AAAA,AACf,2BAAe,CAAC;AAAA,AAChB,oBAAQ,GAAG;AAAA,AACX,sBAAU,AAAAA,eAAK,GAAG,CAAC,AAAA;AAAA,AACnB,sBAAUC,iBAAO;AAAA,AAEvB,4BAAqB,SAAC,QAAe,EAAE;UAAG,AAAAC,cAAQ,sBAAeC,QAAQ,CAAC;GAAC,AAAA;AAAA;AACrE;IAAA;YAAS,uBAAA,AAAAC,uBAAa,CAAC,SAAS,CAAC,CAAiB;KAAA;;AAClD;IAAA;YAAU,kCAAA,AAAAC,gBAAM,mBAAY,IAAI,CAAC,CAA4B;KAAA;;AAC7D;IAAA;YAAS,sBAAA,AAAAD,uBAAa,CAAC,SAAS,CAAC,CAAgB;KAAA;;AACjD;IAAA;YAAQ,AAAAA,wBAAa,CAAC,QAAQ,CAAC;KAAA;;AAE/B;IAAA;YAAM,EAAA,aAAC,AAAAE,SAAI,CAAC,CAAC,CAAC,IAAG,CAAC,AAAC,IAAG,CAAC,AAAA;KAAA;;AACzB,oBAAQ,CAAC;AAAA,AAEb,mBAAS,WAAG;AACV,IAAA,AAAAC,gBAAM,yBAAkB,QAAQ,EAAE,QAAA,AAAC,CAAC,IAAK,AAAAC,cAAI,EAAE,AAAA,gBAAA,CAAC;AAAC,AACjD,IAAA,AAAAA,cAAI,EAAE;AAAC,GACR,AAAA;AAAA;AAED,mBACS,WAAG;AACV,IAAA,AAAAC,eAAK,GAAG,eAAU,AAAAF,gBAAM,aAAM,CAAC,AAAA;AAAC,AAChC,IAAA,AAAAG,iBAAO,kBAAW,CAAC,EAAE,CAAC,EAAEV,eAAK,EAAEA,eAAK,CAAC;AAAC,AACtC,SAAK,IAAI,IAAI,CAAC,AAAA,AAAA,EAAE,AAAAW,CAAC,gBAAGF,eAAK,CAAA,EAAE,AAAAE,CAAC,EAAE,EAAE;AAC9B,kBAAc,AAAA,AAAAA,CAAC,GAAGC,WAAG,AAAA,gBAAGC,aAAG,CAAA;AAAC,AAC5B,cAAU,aAAA,AAAAP,SAAI,CAACK,CAAC,CAAC,IAAGG,sBAAY,AAAA;AAAC,AACjC,cAAU,AAAAb,iBAAO,GAAG,AAAAc,CAAC,gBAAG,AAAAC,QAAG,CAACC,KAAK,CAAC,CAAA,AAAA;AAAC,AACnC,cAAU,AAAAC,iBAAO,GAAG,AAAAH,CAAC,gBAAG,AAAAI,QAAG,CAACF,KAAK,CAAC,CAAA,AAAA;AAAC,AACnC,MAAA,AAAA,4BAAkBG,CAAC,EAAEC,CAAC,EAAEC,qBAAW,CAAC,MAAMZ,iBAAO,CAAC;AAAC,KACpD;AAAA,AACD,IAAA,AAAA,AAAAa,eAAK,YAAK,GAAG,WAAC,eAAM,QAAO,AAAA;AAAC,GAC7B,AAAA;AAAA;;ICnCC,IAAO,CAAM,EAAE,CAAM,EAAE,MAAW,EAAlC;;;;AAAmC,AAAC,KAAA;;;;;;;;;;;ICYtC;mBAEiBC,cAAM;KAevB;IAbE,KACU,OAAgC,EAAE;AAC1C,MAAAd,AACE,OADK,mBACQ;MADfA,AAEE,AAAA,OAFK,iBAEM,GAAG,CAAC,AAAA;MAFjBA,AAGE,AAAA,OAHK,iBAGM,GAAGe,UAAK,AAAA;MAHrBf,AAIE,AAAA,OAJK,mBAIQ,GAAGe,UAAK,AAAA;MAJvBf,AAKE,OALK,YAKCU,MAAC,EAAEC,MAAC,EAAEK,WAAM,EAAE,CAAC,EAAEd,WAAG,EAAE,KAAK,CAAC;MALpCF,AAME,OANK,cAMG;MANVA,AAOE,OAPK,mBAOQ;MAPfA,AAQE,OARK,gBAQK;AAAC,KACd,AAAA;;;;;;;;IFYD,IAAc,CAAK,EAAE,CAAK,EAAE,MAAU,EAAG,KAAY,EAArD;;AACE,gBAAMU,CAAC,EAAEC,CAAC,EAAEK,MAAM;AAAC,AAAC,AACpB,UAAI,AAAAD,KAAK,IAAI,IAAI,AAAA,EAAE,AAAA,AAAA,AAAA,IAAI,MAAM,GAAGA,KAAK,AAAA;AAAC,AAAA,AACvC,KAAA;;;;;AExCG,mBAAS,QAAQ;AAAA,AACjB,gBAAM,KAAK;AAAA,AACX,iBAAO,MAAM;AAAA,AACb,gBAAM,AAAAE,OAAE,GAAG,CAAC,AAAA;AAAA,AAElB,0BAAqB,SAAC,QAAe,EAAE;UAAG,AAAAzB,cAAQ,sBAAeC,QAAQ,CAAC;GAAC,AAAA;AAAA;AAErE;IAAA;YAAS,uBAAA,AAAAC,qBAAa,CAAC,SAAS,CAAC,CAAiB;KAAA;;AAClD;IAAA;YAAU,kCAAA,AAAAC,cAAM,mBAAY,IAAI,CAAC,CAA4B;KAAA","file":"sunflower.js"}
\ No newline at end of file
diff --git a/pkg/dev_compiler/test/codegen_test.dart b/pkg/dev_compiler/test/codegen_test.dart
index 1f171f0..4df5f64 100644
--- a/pkg/dev_compiler/test/codegen_test.dart
+++ b/pkg/dev_compiler/test/codegen_test.dart
@@ -20,9 +20,11 @@
         StringLiteral,
         UriBasedDirective,
         parseDirectives;
+import 'package:analyzer/src/dart/ast/ast.dart';
 import 'package:analyzer/src/generated/source.dart' show Source;
 import 'package:args/args.dart' show ArgParser, ArgResults;
-import 'package:dev_compiler/src/analyzer/context.dart' show AnalyzerOptions;
+import 'package:dev_compiler/src/analyzer/context.dart'
+    show AnalyzerOptions, parseDeclaredVariables;
 import 'package:dev_compiler/src/compiler/compiler.dart'
     show BuildUnit, CompilerOptions, JSModuleFile, ModuleCompiler;
 import 'package:dev_compiler/src/compiler/module_builder.dart'
@@ -68,7 +70,7 @@
 
   var sdkDir = path.join(repoDirectory, 'gen', 'patched_sdk');
   var sdkSummaryFile =
-      path.join(testDirectory, '..', 'lib', 'js', 'amd', 'dart_sdk.sum');
+      path.join(testDirectory, '..', 'lib', 'sdk', 'ddc_sdk.sum');
 
   var summaryPaths = new Directory(path.join(codegenOutputDir, 'pkg'))
       .listSync()
@@ -76,14 +78,14 @@
       .where((p) => p.endsWith('.sum'))
       .toList();
 
-  var analyzerOptions = new AnalyzerOptions(
-      dartSdkSummaryPath: sdkSummaryFile, summaryPaths: summaryPaths);
-  var compiler = new ModuleCompiler(analyzerOptions);
+  var sharedCompiler = new ModuleCompiler(new AnalyzerOptions(
+      dartSdkSummaryPath: sdkSummaryFile, summaryPaths: summaryPaths));
 
   var testDirs = [
     'language',
     'corelib',
     path.join('corelib', 'regexp'),
+    path.join('lib', 'collection'),
     path.join('lib', 'convert'),
     path.join('lib', 'html'),
     // TODO(vsm): Fix these - they import files from a different directory
@@ -100,9 +102,20 @@
 
   // Our default compiler options. Individual tests can override these.
   var defaultOptions = ['--no-source-map', '--no-summarize'];
-  var compilerArgParser = new ArgParser();
-  CompilerOptions.addArguments(compilerArgParser);
-  addModuleFormatOptions(compilerArgParser);
+  var compileArgParser = new ArgParser();
+  CompilerOptions.addArguments(compileArgParser);
+  addModuleFormatOptions(compileArgParser);
+
+  var testFileOptionsMatcher =
+      new RegExp(r'// (compile options: |SharedOptions=)(.*)', multiLine: true);
+
+  // Ignore dart2js options that we don't support in DDC.
+  var ignoreOptions = [
+    '--enable-enum',
+    '--experimental-trust-js-interop-type-annotations',
+    '--trust-type-annotations',
+    '--supermixin'
+  ];
 
   // Compile each test file to JS and put the result in gen/codegen_output.
   for (var testFile in testFiles) {
@@ -116,15 +129,17 @@
     test('dartdevc $name', () {
       // Check if we need to use special compile options.
       var contents = new File(testFile).readAsStringSync();
-      var match =
-          new RegExp(r'// compile options: (.*)').matchAsPrefix(contents);
+      var match = testFileOptionsMatcher.firstMatch(contents);
 
       var args = defaultOptions.toList();
       if (match != null) {
-        args.addAll(match.group(1).split(' '));
+        var matchedArgs = match.group(2).split(' ');
+        args.addAll(matchedArgs.where((s) => !ignoreOptions.contains(s)));
       }
 
-      var argResults = compilerArgParser.parse(args);
+      var declaredVars = <String, String>{};
+      var argResults =
+          compileArgParser.parse(parseDeclaredVariables(args, declaredVars));
       var options = new CompilerOptions.fromArguments(argResults);
       var moduleFormat = parseModuleFormatOption(argResults).first;
 
@@ -133,6 +148,14 @@
       _collectTransitiveImports(contents, files, from: testFile);
       var unit = new BuildUnit(
           name, path.dirname(testFile), files.toList(), _moduleForLibrary);
+
+      var compiler = sharedCompiler;
+      if (declaredVars.isNotEmpty) {
+        compiler = new ModuleCompiler(new AnalyzerOptions(
+            dartSdkSummaryPath: sdkSummaryFile,
+            summaryPaths: summaryPaths,
+            declaredVariables: declaredVars));
+      }
       var module = compiler.compile(unit, options);
 
       bool notStrong = notYetStrongTests.contains(name);
@@ -155,7 +178,7 @@
 
   if (filePattern.hasMatch('sunflower')) {
     test('sunflower', () {
-      _buildSunflower(compiler, codegenOutputDir, codegenExpectDir);
+      _buildSunflower(sharedCompiler, codegenOutputDir, codegenExpectDir);
     });
   }
 
@@ -174,7 +197,7 @@
   if (errors.isNotEmpty && !errors.endsWith('\n')) errors += '\n';
   new File(outPath + '.txt').writeAsStringSync(errors);
 
-  result.writeCodeSync(format, false, outPath + '.js');
+  result.writeCodeSync(format, outPath + '.js');
 
   if (result.summaryBytes != null) {
     new File(outPath + '.sum').writeAsBytesSync(result.summaryBytes);
@@ -188,7 +211,7 @@
 
     var expectFile = new File(expectPath + '.js');
     if (result.isValid) {
-      result.writeCodeSync(format, false, expectFile.path);
+      result.writeCodeSync(format, expectFile.path);
     } else {
       expectFile.writeAsStringSync("//FAILED TO COMPILE");
     }
@@ -330,5 +353,7 @@
     uriContent = uriContent.trim();
     directive.uriContent = uriContent;
   }
-  return directive.validate() == null ? uriContent : null;
+  return (directive as UriBasedDirectiveImpl).validate() == null
+      ? uriContent
+      : null;
 }
diff --git a/pkg/dev_compiler/test/not_yet_strong_tests.dart b/pkg/dev_compiler/test/not_yet_strong_tests.dart
index 013db81..0769af7 100644
--- a/pkg/dev_compiler/test/not_yet_strong_tests.dart
+++ b/pkg/dev_compiler/test/not_yet_strong_tests.dart
@@ -1600,7 +1600,6 @@
   'language/super_operator_index_test_07_multi',
   'language/super_operator_test',
   'language/super_test',
-  'language/switch6_test',
   'language/switch_bad_case_test_01_multi',
   'language/switch_bad_case_test_02_multi',
   'language/switch_case_test_00_multi',
@@ -2346,7 +2345,6 @@
   'language/parameter_initializer2_negative_test',
   'language/parameter_initializer3_negative_test',
   'language/parameter_initializer4_negative_test',
-  'language/parameter_initializer5_negative_test',
   'language/parameter_initializer6_negative_test',
   'language/prefix11_negative_test',
   'language/prefix12_negative_test',
@@ -2364,7 +2362,6 @@
   'language/private_member1_negative_test',
   'language/private_member2_negative_test',
   'language/private_member3_negative_test',
-  'language/regress_18535_test',
   'language/script1_negative_test',
   'language/script2_negative_test',
   'language/setter4_test',
@@ -2399,27 +2396,12 @@
   'language/unresolved_in_factory_negative_test',
   'language/unresolved_top_level_method_negative_test',
   'language/unresolved_top_level_var_negative_test',
-  'corelib/bool_from_environment_test',
   'corelib/file_resource_test',
-  'corelib/from_environment_const_type_test_none_multi',
-  'corelib/from_environment_const_type_test_01_multi',
-  'corelib/from_environment_const_type_test_05_multi',
-  'corelib/from_environment_const_type_test_10_multi',
-  'corelib/from_environment_const_type_test_15_multi',
-  'corelib/from_environment_const_type_undefined_test_none_multi',
-  'corelib/from_environment_const_type_undefined_test_01_multi',
-  'corelib/from_environment_const_type_undefined_test_05_multi',
-  'corelib/from_environment_const_type_undefined_test_10_multi',
-  'corelib/from_environment_const_type_undefined_test_15_multi',
-  'corelib/int_from_environment2_test',
-  'corelib/int_from_environment_test',
   'corelib/queue_test',
   'corelib/regexp/global_test',
   'corelib/regexp/regexp_test',
   'corelib/regexp/regress-regexp-codeflush_test',
   'corelib/regexp/standalones_test',
-  'corelib/string_from_environment2_test',
-  'corelib/string_from_environment_test',
   'corelib/string_from_list_test',
   'lib/convert/chunked_conversion_json_encode1_test',
   'lib/convert/chunked_conversion_utf84_test',
@@ -2427,50 +2409,21 @@
   'lib/convert/chunked_conversion_utf8_test',
   'lib/convert/line_splitter_test',
   'lib/html/cross_frame_test',
-  'lib/html/css_rule_list_test',
-  'lib/html/custom/constructor_calls_created_synchronously_test',
-  'lib/html/custom/created_callback_test',
-  'lib/html/custom/document_register_basic_test',
-  'lib/html/custom/document_register_type_extensions_test',
-  'lib/html/custom/element_upgrade_test',
-  'lib/html/custom_elements_23127_test',
-  'lib/html/custom_elements_test',
-  'lib/html/datalistelement_test',
-  'lib/html/documentfragment_test',
-  'lib/html/element_add_test',
-  'lib/html/element_classes_test',
   'lib/html/element_test',
   'lib/html/events_test',
   'lib/html/fileapi_test',
   'lib/html/filereader_test',
   'lib/html/fontface_loaded_test',
-  'lib/html/htmlcollection_test',
-  'lib/html/htmlelement_test',
-  'lib/html/htmloptionscollection_test',
-  'lib/html/indexeddb_2_test',
   'lib/html/js_function_getter_trust_types_test',
-  'lib/html/js_test',
-  'lib/html/js_util_test',
   'lib/html/js_typed_interop_side_cast_exp_test',
   'lib/html/js_typed_interop_side_cast_test',
   'lib/html/keyboard_event_test',
-  'lib/html/localstorage_test',
   'lib/html/mutationobserver_test',
-  'lib/html/node_test',
-  'lib/html/node_validator_important_if_you_suppress_make_the_bug_critical_test',
   'lib/html/postmessage_structured_test',
-  'lib/html/queryall_test',
   'lib/html/resource_http_test',
-  'lib/html/selectelement_test',
-  'lib/html/track_element_constructor_test',
   'lib/html/transferables_test',
-  'lib/html/typed_arrays_range_checks_test',
-  'lib/html/typing_test',
-  'lib/html/unknownelement_test',
   'lib/html/webgl_1_test',
-  'lib/html/window_nosuchmethod_test',
   'lib/html/wrapping_collections_test',
-  'lib/math/rectangle_test',
   // TODO(jmesserly): these are both under "dart:html" as well.
   'js_test',
   'js_util_test'
diff --git a/pkg/dev_compiler/test/worker/worker_test.dart b/pkg/dev_compiler/test/worker/worker_test.dart
index 8cb8f65..daa1841 100644
--- a/pkg/dev_compiler/test/worker/worker_test.dart
+++ b/pkg/dev_compiler/test/worker/worker_test.dart
@@ -16,11 +16,14 @@
   group('Hello World', () {
     final argsFile = new File('test/worker/hello_world.args').absolute;
     final inputDartFile = new File('test/worker/hello_world.dart').absolute;
-    final outputJsFile = new File('test/worker/hello_world.js').absolute;
+    final outputJsFile = new File('test/worker/out/hello_world.js').absolute;
+    final dartSdkSummary = new File('lib/sdk/ddc_sdk.sum').absolute;
     final executableArgs = ['bin/dartdevc.dart'];
     final compilerArgs = [
       '--no-source-map',
       '--no-summarize',
+      '--dart-sdk-summary',
+      dartSdkSummary.path,
       '-o',
       outputJsFile.path,
       inputDartFile.path,
@@ -33,7 +36,9 @@
 
     tearDown(() {
       if (inputDartFile.existsSync()) inputDartFile.deleteSync();
-      if (outputJsFile.existsSync()) outputJsFile.deleteSync();
+      if (outputJsFile.parent.existsSync()) {
+        outputJsFile.parent.deleteSync(recursive: true);
+      }
       if (argsFile.existsSync()) argsFile.deleteSync();
     });
 
@@ -116,10 +121,13 @@
     });
 
     test('can compile in basic mode', () {
+      final dartSdkSummary = new File('lib/sdk/ddc_sdk.sum').absolute;
       var result = Process.runSync('dart', [
         'bin/dartdevc.dart',
         '--summary-extension=api.ds',
         '--no-source-map',
+        '--dart-sdk-summary',
+        dartSdkSummary.path,
         '-o',
         greetingJS.path,
         greetingDart.path,
@@ -134,6 +142,8 @@
         'bin/dartdevc.dart',
         '--no-source-map',
         '--no-summarize',
+        '--dart-sdk-summary',
+        dartSdkSummary.path,
         '--summary-extension=api.ds',
         '-s',
         greetingSummary.path,
@@ -149,6 +159,7 @@
   });
 
   group('Error handling', () {
+    final dartSdkSummary = new File('lib/sdk/ddc_sdk.sum').absolute;
     final badFileDart = new File('test/worker/bad.dart').absolute;
     final badFileJs = new File('test/worker/bad.js').absolute;
 
@@ -158,7 +169,7 @@
     });
 
     test('incorrect usage', () {
-      var result = Process.runSync('dart', ['bin/dartdevc.dart', 'oops',]);
+      var result = Process.runSync('dart', ['bin/dartdevc.dart', '--dart-sdk-summary', dartSdkSummary.path, 'oops',]);
       expect(result.exitCode, 64);
       expect(
           result.stdout, contains('Please include the output file location.'));
@@ -170,6 +181,8 @@
       var result = Process.runSync('dart', [
         'bin/dartdevc.dart',
         '--no-source-map',
+        '--dart-sdk-summary',
+        dartSdkSummary.path,
         '-o',
         badFileJs.path,
         badFileDart.path,
@@ -180,6 +193,7 @@
   });
 
   group('Parts', () {
+    final dartSdkSummary = new File('lib/sdk/ddc_sdk.sum').absolute;
     final partFile = new File('test/worker/greeting.dart').absolute;
     final libraryFile = new File('test/worker/hello.dart').absolute;
 
@@ -204,6 +218,8 @@
         'bin/dartdevc.dart',
         '--no-summarize',
         '--no-source-map',
+        '--dart-sdk-summary',
+        dartSdkSummary.path,
         '-o',
         outJS.path,
         partFile.path,
@@ -220,6 +236,8 @@
         'bin/dartdevc.dart',
         '--no-summarize',
         '--no-source-map',
+        '--dart-sdk-summary',
+        dartSdkSummary.path,
         '-o',
         outJS.path,
         libraryFile.path,
@@ -235,6 +253,8 @@
         'bin/dartdevc.dart',
         '--no-summarize',
         '--no-source-map',
+        '--dart-sdk-summary',
+        dartSdkSummary.path,
         '-o',
         outJS.path,
         partFile.path,
diff --git a/pkg/dev_compiler/tool/build_pkgs.dart b/pkg/dev_compiler/tool/build_pkgs.dart
new file mode 100755
index 0000000..a6e2b6b
--- /dev/null
+++ b/pkg/dev_compiler/tool/build_pkgs.dart
@@ -0,0 +1,104 @@
+#!/usr/bin/env dart
+import 'dart:io';
+
+import 'package:dev_compiler/src/compiler/command.dart';
+
+/// Compiles the packages that the DDC tests use to JS into:
+///
+/// gen/codegen_output/pkg/...
+///
+/// Assumes the working directory is pkg/dev_compiler.
+///
+/// If no arguments are passed, builds the all of the modules tested on Travis.
+/// If "test" is passed, only builds the modules needed by the tests.
+void main(List<String> arguments) {
+  var test = arguments.length == 1 && arguments[0] == 'test';
+
+  new Directory("gen/codegen_output/pkg").createSync(recursive: true);
+
+  // Build leaf packages. These have no other package dependencies.
+
+  // Under pkg.
+  compileModule('async_helper');
+  compileModule('expect', libs: ['minitest']);
+  compileModule('js', libs: ['js_util']);
+  if (!test) {
+    compileModule('lookup_map');
+    compileModule('meta');
+    compileModule('microlytics', libs: ['html_channels']);
+    compileModule('typed_mock');
+  }
+
+  // Under third_party/pkg.
+  compileModule('collection');
+  compileModule('matcher');
+  compileModule('path');
+  if (!test) {
+    compileModule('args', libs: ['command_runner']);
+    compileModule('charcode');
+    compileModule('fixnum');
+    compileModule('logging');
+    compileModule('markdown');
+    compileModule('mime');
+    compileModule('plugin', libs: ['manager']);
+    compileModule('typed_data');
+    compileModule('usage');
+    compileModule('utf');
+    compileModule('when');
+  }
+
+  // Composite packages with dependencies.
+  compileModule('stack_trace', deps: ['path']);
+  if (!test) {
+    compileModule('async', deps: ['collection']);
+  }
+
+  if (test) {
+    compileModule('unittest',
+        deps: ['matcher', 'path', 'stack_trace'],
+        libs: ['html_config', 'html_individual_config', 'html_enhanced_config'],
+        unsafeForceCompile: true);
+  }
+}
+
+/// Compiles a [module] with a single matching ".dart" library and additional
+/// [libs] and [deps] on other modules.
+void compileModule(String module,
+    {List<String> libs, List<String> deps, bool unsafeForceCompile: false}) {
+  var args = [
+    '--dart-sdk-summary=lib/sdk/ddc_sdk.sum',
+    '-ogen/codegen_output/pkg/$module.js'
+  ];
+
+  // There is always a library that matches the module.
+  args.add('package:$module/$module.dart');
+
+  // Add any additional libraries.
+  if (libs != null) {
+    for (var lib in libs) {
+      args.add('package:$module/$lib.dart');
+    }
+  }
+
+  // Add summaries for any modules this depends on.
+  if (deps != null) {
+    for (var dep in deps) {
+      args.add('-sgen/codegen_output/pkg/$dep.sum');
+    }
+  }
+
+  if (unsafeForceCompile) {
+    args.add('--unsafe-force-compile');
+  }
+
+  // TODO(rnystrom): Hack. DDC has its own forked copy of async_helper that
+  // has a couple of differences from pkg/async_helper. We should unfork them,
+  // but I'm not sure how they'll affect the other non-DDC tests. For now, just
+  // use ours.
+  if (module == 'async_helper') {
+    args.add('--url-mapping=package:async_helper/async_helper.dart,'
+        'test/codegen/async_helper.dart');
+  }
+
+  compile(args);
+}
diff --git a/pkg/dev_compiler/tool/build_pkgs.sh b/pkg/dev_compiler/tool/build_pkgs.sh
new file mode 100755
index 0000000..87ec3c0
--- /dev/null
+++ b/pkg/dev_compiler/tool/build_pkgs.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+# TODO: This script is deprecated in favor of the Dart version. For now, forward
+# to it so existing scripts don't break. Eventually, delete this one.
+./tool/build_pkgs.dart
diff --git a/pkg/dev_compiler/tool/build_sdk.dart b/pkg/dev_compiler/tool/build_sdk.dart
index 7041b38..1b2b2cc 100644
--- a/pkg/dev_compiler/tool/build_sdk.dart
+++ b/pkg/dev_compiler/tool/build_sdk.dart
@@ -35,6 +35,7 @@
     'dart:collection',
     'dart:convert',
     'dart:core',
+    'dart:developer',
     'dart:isolate',
     'dart:js',
     'dart:js_util',
diff --git a/pkg/dev_compiler/tool/build_sdk.sh b/pkg/dev_compiler/tool/build_sdk.sh
index 71f6db4..561f5c4 100755
--- a/pkg/dev_compiler/tool/build_sdk.sh
+++ b/pkg/dev_compiler/tool/build_sdk.sh
@@ -11,6 +11,8 @@
 # TODO(jmesserly): break out dart:html & friends.
 dart -c tool/build_sdk.dart \
     --dart-sdk gen/patched_sdk \
+    --dart-sdk-summary=build \
+    --summary-out lib/sdk/ddc_sdk.sum \
     --modules=amd \
     -o lib/js/amd/dart_sdk.js \
     --modules=es6 \
diff --git a/pkg/dev_compiler/tool/build_test_pkgs.sh b/pkg/dev_compiler/tool/build_test_pkgs.sh
index 5b348e2..1aa3ddf 100755
--- a/pkg/dev_compiler/tool/build_test_pkgs.sh
+++ b/pkg/dev_compiler/tool/build_test_pkgs.sh
@@ -1,39 +1,5 @@
 #!/bin/bash
-set -e # bail on error
 
-cd $( dirname "${BASH_SOURCE[0]}" )/..
-
-mkdir -p gen/codegen_output/pkg/
-
-SDK=--dart-sdk-summary=lib/js/amd/dart_sdk.sum
-
-./bin/dartdevc.dart $SDK -o gen/codegen_output/pkg/expect.js \
-    --url-mapping=package:expect/expect.dart,test/codegen/expect.dart \
-    package:expect/expect.dart
-
-./bin/dartdevc.dart $SDK -o gen/codegen_output/pkg/async_helper.js \
-    --url-mapping=package:async_helper/async_helper.dart,test/codegen/async_helper.dart \
-    package:async_helper/async_helper.dart
-
-./bin/dartdevc.dart $SDK -o gen/codegen_output/pkg/js.js \
-    package:js/js.dart
-
-./bin/dartdevc.dart $SDK -o gen/codegen_output/pkg/matcher.js \
-    package:matcher/matcher.dart
-
-./bin/dartdevc.dart $SDK -o gen/codegen_output/pkg/path.js \
-    package:path/path.dart
-
-./bin/dartdevc.dart $SDK -o gen/codegen_output/pkg/stack_trace.js \
-    -s gen/codegen_output/pkg/path.sum \
-    package:stack_trace/stack_trace.dart
-
-./bin/dartdevc.dart $SDK --unsafe-force-compile \
-    -o gen/codegen_output/pkg/unittest.js \
-    -s gen/codegen_output/pkg/matcher.sum \
-    -s gen/codegen_output/pkg/path.sum \
-    -s gen/codegen_output/pkg/stack_trace.sum \
-    package:unittest/unittest.dart \
-    package:unittest/html_config.dart \
-    package:unittest/html_individual_config.dart \
-    package:unittest/html_enhanced_config.dart
+# TODO: This script is deprecated in favor of the Dart version. For now, forward
+# to it so existing scripts don't break. Eventually, delete this one.
+./tool/build_pkgs.dart test
diff --git a/pkg/dev_compiler/tool/global_compile.dart b/pkg/dev_compiler/tool/global_compile.dart
index b604099..56f1b0a 100644
--- a/pkg/dev_compiler/tool/global_compile.dart
+++ b/pkg/dev_compiler/tool/global_compile.dart
@@ -14,6 +14,7 @@
         StringLiteral,
         UriBasedDirective,
         parseDirectives;
+import 'package:analyzer/src/dart/ast/ast.dart';
 import 'package:args/args.dart' show ArgParser;
 import 'package:path/path.dart' as path;
 
@@ -257,7 +258,9 @@
     uriContent = uriContent.trim();
     directive.uriContent = uriContent;
   }
-  return directive.validate() == null ? uriContent : null;
+  return (directive as UriBasedDirectiveImpl).validate() == null
+      ? uriContent
+      : null;
 }
 
 String _loadFile(String uri, String packageRoot) {
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/_internal/libraries.dart b/pkg/dev_compiler/tool/input_sdk/lib/_internal/libraries.dart
index 2814a08..4e56e9f 100644
--- a/pkg/dev_compiler/tool/input_sdk/lib/_internal/libraries.dart
+++ b/pkg/dev_compiler/tool/input_sdk/lib/_internal/libraries.dart
@@ -42,6 +42,11 @@
       maturity: Maturity.STABLE,
       dart2jsPatchPath: "_internal/compiler/js_lib/core_patch.dart"),
 
+  "developer": const LibraryInfo(
+      "developer/developer.dart",
+      maturity: Maturity.STABLE,
+      dart2jsPatchPath: "_internal/js_runtime/lib/developer_patch.dart"),
+
   "html": const LibraryInfo(
       "html/dart2js/html_dart2js.dart",
       category: "Client",
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/collection/list.dart b/pkg/dev_compiler/tool/input_sdk/lib/collection/list.dart
index 37fdf0a..f999447 100644
--- a/pkg/dev_compiler/tool/input_sdk/lib/collection/list.dart
+++ b/pkg/dev_compiler/tool/input_sdk/lib/collection/list.dart
@@ -267,17 +267,16 @@
   }
 
   void removeWhere(bool test(E element)) {
-    _filter(this, test, false);
+    _filter(test, false);
   }
 
   void retainWhere(bool test(E element)) {
-    _filter(this, test, true);
+    _filter(test, true);
   }
 
-  static void _filter(List source,
-                      bool test(var element),
-                      bool retainMatching) {
-    List retained = [];
+  void _filter(bool test(var element), bool retainMatching) {
+    var source = this;
+    var retained = <E>[];
     int length = source.length;
     for (int i = 0; i < length; i++) {
       var element = source[i];
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/convert/codec.dart b/pkg/dev_compiler/tool/input_sdk/lib/convert/codec.dart
index 3fc2d31..7f42c86 100644
--- a/pkg/dev_compiler/tool/input_sdk/lib/convert/codec.dart
+++ b/pkg/dev_compiler/tool/input_sdk/lib/convert/codec.dart
@@ -62,8 +62,8 @@
    */
   // TODO(floitsch): use better example with line-splitter once that one is
   // in this library.
-  Codec<S, dynamic> fuse(Codec<T, dynamic> other) {
-    return new _FusedCodec<S, T, dynamic>(this, other);
+  Codec<S, dynamic/*=R*/> fuse/*<R>*/(Codec<T, dynamic/*=R*/> other) {
+    return new _FusedCodec<S, T, dynamic/*=R*/>(this, other);
   }
 
   /**
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/convert/utf.dart b/pkg/dev_compiler/tool/input_sdk/lib/convert/utf.dart
index 69bb72c..486ab4d 100644
--- a/pkg/dev_compiler/tool/input_sdk/lib/convert/utf.dart
+++ b/pkg/dev_compiler/tool/input_sdk/lib/convert/utf.dart
@@ -37,7 +37,7 @@
    * The optional [allowMalformed] argument defines how [decoder] (and [decode])
    * deal with invalid or unterminated character sequences.
    *
-   * If it is `true` (and not overriden at the method invocation) [decode] and
+   * If it is `true` (and not overridden at the method invocation) [decode] and
    * the [decoder] replace invalid (or unterminated) octet
    * sequences with the Unicode Replacement character `U+FFFD` (�). Otherwise
    * they throw a [FormatException].
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/developer/developer.dart b/pkg/dev_compiler/tool/input_sdk/lib/developer/developer.dart
new file mode 100644
index 0000000..47ea5ba
--- /dev/null
+++ b/pkg/dev_compiler/tool/input_sdk/lib/developer/developer.dart
@@ -0,0 +1,60 @@
+// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// Interact with developer tools such as the debugger and inspector.
+///
+/// The dart:developer library is _unstable_ and its API might change slightly
+/// as a result of developer feedback. This library is platform dependent and
+/// therefore it has implementations for both dart2js and the Dart VM. Both are
+/// under development and may not support all operations yet.
+///
+/// To use this library in your code:
+///
+///     import 'dart:developer';
+///
+library dart.developer;
+
+import 'dart:async';
+import 'dart:convert';
+import 'dart:isolate' show RawReceivePort, SendPort;
+
+part 'extension.dart';
+part 'profiler.dart';
+part 'timeline.dart';
+part 'service.dart';
+
+/// If [when] is true, stop the program as if a breakpoint were hit at the
+/// following statement.
+///
+/// Returns the value of [when]. Some debuggers may display [message].
+///
+/// NOTE: When invoked, the isolate will not return until a debugger
+/// continues execution. When running in the Dart VM the behaviour is the same
+/// regardless of whether or not a debugger is connected. When compiled to
+/// JavaScript, this uses the "debugger" statement, and behaves exactly as
+/// that does.
+external bool debugger({bool when: true, String message});
+
+/// Send a reference to [object] to any attached debuggers.
+///
+/// Debuggers may open an inspector on the object. Returns the argument.
+external Object inspect(Object object);
+
+/// Emit a log event.
+/// [message] is the log message.
+/// [time]  (optional) is the timestamp.
+/// [sequenceNumber]  (optional) is a monotonically increasing sequence number.
+/// [level]  (optional) is the severity level (value between 0 and 2000).
+/// [name]  (optional) is the name of the source of the log message.
+/// [zone]  (optional) the zone where the log was emitted
+/// [error]  (optional) an error object associated with this log event.
+/// [stackTrace]  (optional) a stack trace associated with this log event.
+external void log(String message,
+                  {DateTime time,
+                   int sequenceNumber,
+                   int level: 0,
+                   String name: '',
+                   Zone zone,
+                   Object error,
+                   StackTrace stackTrace});
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/developer/extension.dart b/pkg/dev_compiler/tool/input_sdk/lib/developer/extension.dart
new file mode 100644
index 0000000..5883fb5
--- /dev/null
+++ b/pkg/dev_compiler/tool/input_sdk/lib/developer/extension.dart
@@ -0,0 +1,177 @@
+// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
+// for 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 dart.developer;
+
+/// A response to a service protocol extension RPC.
+///
+/// If the RPC was successful, use [ServiceExtensionResponse.result], otherwise
+/// use [ServiceExtensionResponse.error].
+class ServiceExtensionResponse {
+  final String _result;
+  final int _errorCode;
+  final String _errorDetail;
+
+  /// Creates a successful response to a service protocol extension RPC.
+  ///
+  /// Requires [result] to be a JSON object encoded as a string. When forming
+  /// the JSON-RPC message [result] will be inlined directly.
+  ServiceExtensionResponse.result(String result)
+      : _result = result,
+        _errorCode = null,
+        _errorDetail = null {
+    if (_result is! String) {
+      throw new ArgumentError.value(_result, "result", "Must be a String");
+    }
+  }
+
+  /// Creates an error response to a service protocol extension RPC.
+  ///
+  /// Requires [errorCode] to be [invalidParams] or between [extensionErrorMin]
+  /// and [extensionErrorMax]. Requires [errorDetail] to be a JSON object
+  /// encoded as a string. When forming the JSON-RPC message [errorDetail] will
+  /// be inlined directly.
+  ServiceExtensionResponse.error(int errorCode, String errorDetail)
+      : _result = null,
+        _errorCode = errorCode,
+        _errorDetail = errorDetail {
+    _validateErrorCode(_errorCode);
+    if (_errorDetail is! String) {
+      throw new ArgumentError.value(_errorDetail,
+                                    "errorDetail",
+                                    "Must be a String");
+    }
+  }
+
+  /// Invalid method parameter(s) error code.
+  @deprecated static const kInvalidParams = invalidParams;
+  /// Generic extension error code.
+  @deprecated static const kExtensionError = extensionError;
+  /// Maximum extension provided error code.
+  @deprecated static const kExtensionErrorMax = extensionErrorMax;
+  /// Minimum extension provided error code.
+  @deprecated static const kExtensionErrorMin = extensionErrorMin;
+
+  /// Invalid method parameter(s) error code.
+  static const invalidParams = -32602;
+  /// Generic extension error code.
+  static const extensionError = -32000;
+  /// Maximum extension provided error code.
+  static const extensionErrorMax = -32000;
+  /// Minimum extension provided error code.
+  static const extensionErrorMin = -32016;
+
+
+  static String _errorCodeMessage(int errorCode) {
+    _validateErrorCode(errorCode);
+    if (errorCode == kInvalidParams) {
+      return "Invalid params";
+    }
+    return "Server error";
+  }
+
+  static _validateErrorCode(int errorCode) {
+    if (errorCode is! int) {
+      throw new ArgumentError.value(errorCode, "errorCode", "Must be an int");
+    }
+    if (errorCode == invalidParams) {
+      return;
+    }
+    if ((errorCode >= extensionErrorMin) &&
+        (errorCode <= extensionErrorMax)) {
+      return;
+    }
+    throw new ArgumentError.value(errorCode, "errorCode", "Out of range");
+  }
+
+  bool _isError() => (_errorCode != null) && (_errorDetail != null);
+
+  String _toString() {
+    if (_result != null) {
+      return _result;
+    } else {
+      assert(_errorCode != null);
+      assert(_errorDetail != null);
+      return JSON.encode({
+        'code': _errorCode,
+        'message': _errorCodeMessage(_errorCode),
+        'data': {
+          'details': _errorDetail
+        }
+      });
+    }
+  }
+}
+
+/// A service protocol extension handler. Registered with [registerExtension].
+///
+/// Must complete to a [ServiceExtensionResponse].
+///
+/// [method] - the method name of the service protocol request.
+/// [parameters] - A map holding the parameters to the service protocol request.
+///
+/// *NOTE*: All parameter names and values are **encoded as strings**.
+typedef Future<ServiceExtensionResponse>
+    ServiceExtensionHandler(String method, Map<String, String> parameters);
+
+/// Register a [ServiceExtensionHandler] that will be invoked in this isolate
+/// for [method]. *NOTE*: Service protocol extensions must be registered
+/// in each isolate.
+///
+/// *NOTE*: [method] must begin with 'ext.' and you should use the following
+/// structure to avoid conflicts with other packages: 'ext.package.command'.
+/// That is, immediately following the 'ext.' prefix, should be the registering
+/// package name followed by another period ('.') and then the command name.
+/// For example: 'ext.dart.io.getOpenFiles'.
+///
+/// Because service extensions are isolate specific, clients using extensions
+/// must always include an 'isolateId' parameter with each RPC.
+void registerExtension(String method, ServiceExtensionHandler handler) {
+  if (method is! String) {
+    throw new ArgumentError.value(method,
+                                  'method',
+                                  'Must be a String');
+  }
+  if (!method.startsWith('ext.')) {
+    throw new ArgumentError.value(method,
+                                  'method',
+                                  'Must begin with ext.');
+  }
+  if (_lookupExtension(method) != null) {
+    throw new ArgumentError('Extension already registered: $method');
+  }
+  if (handler is! ServiceExtensionHandler) {
+    throw new ArgumentError.value(handler,
+                                  'handler',
+                                  'Must be a ServiceExtensionHandler');
+  }
+  _registerExtension(method, handler);
+}
+
+/// Post an event of [eventKind] with payload of [eventData] to the `Extension`
+/// event stream.
+void postEvent(String eventKind, Map eventData) {
+  if (eventKind is! String) {
+    throw new ArgumentError.value(eventKind,
+                                  'eventKind',
+                                  'Must be a String');
+  }
+  if (eventData is! Map) {
+    throw new ArgumentError.value(eventData,
+                                  'eventData',
+                                  'Must be a Map');
+  }
+  String eventDataAsString = JSON.encode(eventData);
+  _postEvent(eventKind, eventDataAsString);
+}
+
+external _postEvent(String eventKind, String eventData);
+
+// Both of these functions are written inside C++ to avoid updating the data
+// structures in Dart, getting an OOB, and observing stale state. Do not move
+// these into Dart code unless you can ensure that the operations will can be
+// done atomically. Native code lives in vm/isolate.cc-
+// LookupServiceExtensionHandler and RegisterServiceExtensionHandler.
+external ServiceExtensionHandler _lookupExtension(String method);
+external _registerExtension(String method, ServiceExtensionHandler handler);
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/developer/profiler.dart b/pkg/dev_compiler/tool/input_sdk/lib/developer/profiler.dart
new file mode 100644
index 0000000..566d015
--- /dev/null
+++ b/pkg/dev_compiler/tool/input_sdk/lib/developer/profiler.dart
@@ -0,0 +1,197 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of dart.developer;
+
+/// A UserTag can be used to group samples in the Observatory profiler.
+abstract class UserTag {
+  /// The maximum number of UserTag instances that can be created by a program.
+  static const MAX_USER_TAGS = 64;
+
+  factory UserTag(String label) => new _FakeUserTag(label);
+
+  /// Label of [this].
+  String get label;
+
+  /// Make [this] the current tag for the isolate. Returns the current tag
+  /// before setting.
+  UserTag makeCurrent();
+
+  /// The default [UserTag] with label 'Default'.
+  static UserTag get defaultTag => _FakeUserTag._defaultTag;
+}
+
+// This is a fake implementation of UserTag so that code can compile and run
+// in dart2js.
+class _FakeUserTag implements UserTag {
+  static Map _instances = {};
+
+  _FakeUserTag.real(this.label);
+
+  factory _FakeUserTag(String label) {
+    // Canonicalize by name.
+    var existingTag = _instances[label];
+    if (existingTag != null) {
+      return existingTag;
+    }
+    // Throw an exception if we've reached the maximum number of user tags.
+    if (_instances.length == UserTag.MAX_USER_TAGS) {
+      throw new UnsupportedError(
+          'UserTag instance limit (${UserTag.MAX_USER_TAGS}) reached.');
+    }
+    // Create a new instance and add it to the instance map.
+    var instance = new _FakeUserTag.real(label);
+    _instances[label] = instance;
+    return instance;
+  }
+
+  final String label;
+
+  UserTag makeCurrent() {
+    var old = _currentTag;
+    _currentTag = this;
+    return old;
+  }
+
+  static final UserTag _defaultTag = new _FakeUserTag('Default');
+}
+
+var _currentTag = _FakeUserTag._defaultTag;
+
+/// Returns the current [UserTag] for the isolate.
+UserTag getCurrentTag() {
+  return _currentTag;
+}
+
+/// Abstract [Metric] class. Metric names must be unique, are hierarchical,
+/// and use periods as separators. For example, 'a.b.c'. Uniqueness is only
+/// enforced when a Metric is registered. The name of a metric cannot contain
+/// the slash ('/') character.
+abstract class Metric {
+  /// [name] of this metric.
+  final String name;
+  /// [description] of this metric.
+  final String description;
+
+  Metric(this.name, this.description) {
+    if ((name == 'vm') || name.contains('/')) {
+      throw new ArgumentError('Invalid Metric name.');
+    }
+
+  }
+
+  Map _toJSON();
+}
+
+/// A measured value with a min and max. Initial value is min. Value will
+/// be clamped to the interval [min, max].
+class Gauge extends Metric {
+  final double min;
+  final double max;
+
+  double _value;
+  double get value => _value;
+  set value(double v) {
+    if (v < min) {
+      v = min;
+    } else if (v > max) {
+      v = max;
+    }
+    _value = v;
+  }
+
+  Gauge(String name, String description, this.min, this.max)
+      : super(name, description) {
+    if (min is! double) {
+      throw new ArgumentError('min must be a double');
+    }
+    if (max is! double) {
+      throw new ArgumentError('max must be a double');
+    }
+    if (!(min < max)) {
+      throw new ArgumentError('min must be less than max');
+    }
+    _value = min;
+  }
+
+  Map _toJSON() {
+    var map = {
+      'type': 'Gauge',
+      'id': 'metrics/$name',
+      'name': name,
+      'description': description,
+      'value': value,
+      'min': min,
+      'max': max,
+    };
+    return map;
+  }
+}
+
+
+/// A changing value. Initial value is 0.0.
+class Counter extends Metric {
+  Counter(String name, String description)
+      : super(name, description);
+
+  double _value = 0.0;
+  double get value => _value;
+  set value(double v) {
+    _value = v;
+  }
+
+  Map _toJSON() {
+    var map = {
+      'type': 'Counter',
+      'id': 'metrics/$name',
+      'name': name,
+      'description': description,
+      'value': value,
+    };
+    return map;
+  }
+}
+
+class Metrics {
+  static final Map<String, Metric> _metrics = new Map<String, Metric>();
+
+  /// Register [Metric]s to make them visible to Observatory.
+  static void register(Metric metric) {
+    if (metric is! Metric) {
+      throw new ArgumentError('metric must be a Metric');
+    }
+    if (_metrics[metric.name] != null) {
+      throw new ArgumentError('Registered metrics have unique names');
+    }
+    _metrics[metric.name] = metric;
+  }
+
+  /// Deregister [Metric]s to make them not visible to Observatory.
+  static void deregister(Metric metric) {
+    if (metric is! Metric) {
+      throw new ArgumentError('metric must be a Metric');
+    }
+    _metrics.remove(metric.name);
+  }
+
+  static String _printMetric(String id) {
+    var metric = _metrics[id];
+    if (metric == null) {
+      return null;
+    }
+    return JSON.encode(metric._toJSON());
+  }
+
+  static String _printMetrics() {
+    var metrics = [];
+    for (var metric in _metrics.values) {
+      metrics.add(metric._toJSON());
+    }
+    var map = {
+      'type': 'MetricList',
+      'metrics': metrics,
+    };
+    return JSON.encode(map);
+  }
+}
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/developer/service.dart b/pkg/dev_compiler/tool/input_sdk/lib/developer/service.dart
new file mode 100644
index 0000000..9ccf0dc
--- /dev/null
+++ b/pkg/dev_compiler/tool/input_sdk/lib/developer/service.dart
@@ -0,0 +1,89 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 dart.developer;
+
+/// Service protocol is the protocol that a client like the observatory
+/// could use to access the services provided by the Dart VM for
+/// debugging and inspecting Dart programs. This class encapsulates the
+/// version number and Uri for accessing this service.
+class ServiceProtocolInfo {
+  /// The major version of the protocol. If the running Dart environment does
+  /// not support the service protocol, this is 0.
+  final int majorVersion = _getServiceMajorVersion();
+  /// The minor version of the protocol. If the running Dart environment does
+  /// not support the service protocol, this is 0.
+  final int minorVersion = _getServiceMinorVersion();
+  /// The Uri to access the service. If the web server is not running, this
+  /// will be null.
+  final Uri serverUri;
+
+  ServiceProtocolInfo(this.serverUri);
+
+  String toString() {
+    if (serverUri != null) {
+      return 'Dart VM Service Protocol v$majorVersion.$minorVersion '
+             'listening on $serverUri';
+    } else {
+      return 'Dart VM Service Protocol v$majorVersion.$minorVersion';
+    }
+  }
+}
+
+/// Access information about the service protocol and control the web server
+/// that provides access to the services provided by the Dart VM for
+/// debugging and inspecting Dart programs.
+class Service {
+  /// Get information about the service protocol (version number and
+  /// Uri to access the service).
+  static Future<ServiceProtocolInfo> getInfo() async {
+    // Port to receive response from service isolate.
+    final RawReceivePort receivePort = new RawReceivePort();
+    final Completer<Uri> uriCompleter = new Completer<Uri>();
+    receivePort.handler = (Uri uri) => uriCompleter.complete(uri);
+    // Request the information from the service isolate.
+    _getServerInfo(receivePort.sendPort);
+    // Await the response from the service isolate.
+    Uri uri = await uriCompleter.future;
+    // Close the port.
+    receivePort.close();
+    return new ServiceProtocolInfo(uri);
+  }
+
+  /// Control the web server that the service protocol is accessed through.
+  /// The [enable] argument must be a boolean and is used as a toggle to
+  /// enable(true) or disable(false) the web server servicing requests.
+  static Future<ServiceProtocolInfo> controlWebServer(
+      {bool enable: false}) async {
+    if (enable is! bool) {
+      throw new ArgumentError.value(enable,
+                                    'enable',
+                                    'Must be a bool');
+    }
+    // Port to receive response from service isolate.
+    final RawReceivePort receivePort = new RawReceivePort();
+    final Completer<Uri> uriCompleter = new Completer<Uri>();
+    receivePort.handler = (Uri uri) => uriCompleter.complete(uri);
+    // Request the information from the service isolate.
+    _webServerControl(receivePort.sendPort, enable);
+    // Await the response from the service isolate.
+    Uri uri = await uriCompleter.future;
+    // Close the port.
+    receivePort.close();
+    return new ServiceProtocolInfo(uri);
+  }
+}
+
+/// [sp] will receive a Uri or null.
+external void _getServerInfo(SendPort sp);
+
+/// [sp] will receive a Uri or null.
+external void _webServerControl(SendPort sp, bool enable);
+
+/// Returns the major version of the service protocol.
+external int _getServiceMajorVersion();
+
+/// Returns the minor version of the service protocol.
+external int _getServiceMinorVersion();
+
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/developer/timeline.dart b/pkg/dev_compiler/tool/input_sdk/lib/developer/timeline.dart
new file mode 100644
index 0000000..b6118af
--- /dev/null
+++ b/pkg/dev_compiler/tool/input_sdk/lib/developer/timeline.dart
@@ -0,0 +1,328 @@
+// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
+// for 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 dart.developer;
+
+const bool _isProduct = const bool.fromEnvironment("dart.vm.product");
+
+typedef dynamic TimelineSyncFunction();
+typedef Future TimelineAsyncFunction();
+
+/// Add to the timeline.
+class Timeline {
+  /// Start a synchronous operation labeled [name]. Optionally takes
+  /// a [Map] of [arguments]. This operation must be finished before
+  /// returning to the event queue.
+  static void startSync(String name, {Map arguments}) {
+    if (_isProduct) {
+      return;
+    }
+    if (name is! String) {
+      throw new ArgumentError.value(name,
+                                    'name',
+                                    'Must be a String');
+    }
+    if (!_isDartStreamEnabled()) {
+      // Push a null onto the stack and return.
+      _stack.add(null);
+      return;
+    }
+    var block = new _SyncBlock._(name, _getTraceClock(), _getThreadCpuClock());
+    if (arguments is Map) {
+      block._appendArguments(arguments);
+    }
+    _stack.add(block);
+  }
+
+  /// Finish the last synchronous operation that was started.
+  static void finishSync() {
+    if (_isProduct) {
+      return;
+    }
+    if (_stack.length == 0) {
+      throw new StateError(
+          'Uneven calls to startSync and finishSync');
+    }
+    // Pop top item off of stack.
+    var block = _stack.removeLast();
+    if (block == null) {
+      // Dart stream was disabled when startSync was called.
+      return;
+    }
+    // Finish it.
+    block.finish();
+  }
+
+  /// Emit an instant event.
+  static void instantSync(String name, {Map arguments}) {
+    if (_isProduct) {
+      return;
+    }
+    if (name is! String) {
+      throw new ArgumentError.value(name,
+                                    'name',
+                                    'Must be a String');
+    }
+    if (!_isDartStreamEnabled()) {
+      // Stream is disabled.
+      return;
+    }
+    Map instantArguments;
+    if (arguments is Map) {
+      instantArguments = new Map.from(arguments);
+    }
+    _reportInstantEvent(_getTraceClock(),
+                        'Dart',
+                        name,
+                        _argumentsAsJson(instantArguments));
+  }
+
+
+  /// A utility method to time a synchronous [function]. Internally calls
+  /// [function] bracketed by calls to [startSync] and [finishSync].
+  static dynamic timeSync(String name,
+                          TimelineSyncFunction function,
+                          {Map arguments}) {
+    startSync(name, arguments: arguments);
+    try {
+      return function();
+    } finally {
+      finishSync();
+    }
+  }
+
+  /// The current time stamp from the clock used by the timeline. Units are
+  /// microseconds.
+  static int get now => _getTraceClock();
+  static final List<_SyncBlock> _stack = new List<_SyncBlock>();
+  static final int _isolateId = _getIsolateNum();
+  static final String _isolateIdString = _isolateId.toString();
+}
+
+/// An asynchronous task on the timeline. An asynchronous task can have many
+/// (nested) synchronous operations. Synchronous operations can live longer than
+/// the current isolate event. To pass a [TimelineTask] to another isolate,
+/// you must first call [pass] to get the task id and then construct a new
+/// [TimelineTask] in the other isolate.
+class TimelineTask {
+  /// Create a task. [taskId] will be set by the system.
+  TimelineTask()
+      : _taskId = _getNextAsyncId() {
+  }
+
+  /// Create a task with an explicit [taskId]. This is useful if you are
+  /// passing a task from one isolate to another.
+  TimelineTask.withTaskId(int taskId)
+      : _taskId = taskId {
+    if (taskId is! int) {
+      throw new ArgumentError.value(taskId,
+                                    'taskId',
+                                    'Must be an int');
+    }
+  }
+
+  /// Start a synchronous operation within this task named [name].
+  /// Optionally takes a [Map] of [arguments].
+  void start(String name, {Map arguments}) {
+    if (_isProduct) {
+      return;
+    }
+    if (name is! String) {
+      throw new ArgumentError.value(name,
+                                    'name',
+                                    'Must be a String');
+    }
+    var block = new _AsyncBlock._(name, _taskId);
+    if (arguments is Map) {
+      block._appendArguments(arguments);
+    }
+    _stack.add(block);
+    block._start();
+  }
+
+  /// Emit an instant event for this task.
+  void instant(String name, {Map arguments}) {
+    if (_isProduct) {
+      return;
+    }
+    if (name is! String) {
+      throw new ArgumentError.value(name,
+                                    'name',
+                                    'Must be a String');
+    }
+    Map instantArguments;
+    if (arguments is Map) {
+      instantArguments = new Map.from(arguments);
+    }
+    _reportTaskEvent(_getTraceClock(),
+                     _taskId,
+                     'n',
+                     'Dart',
+                     name,
+                     _argumentsAsJson(instantArguments));
+  }
+
+  /// Finish the last synchronous operation that was started.
+  void finish() {
+    if (_isProduct) {
+      return;
+    }
+    if (_stack.length == 0) {
+      throw new StateError(
+          'Uneven calls to start and finish');
+    }
+    // Pop top item off of stack.
+    var block = _stack.removeLast();
+    block._finish();
+  }
+
+  /// Retrieve the [TimelineTask]'s task id. Will throw an exception if the
+  /// stack is not empty.
+  int pass() {
+    if (_stack.length > 0) {
+      throw new StateError(
+          'You cannot pass a TimelineTask without finishing all started '
+          'operations');
+    }
+    int r = _taskId;
+    return r;
+  }
+
+  final int _taskId;
+  final List<_AsyncBlock> _stack = [];
+}
+
+/// An asynchronous block of time on the timeline. This block can be kept
+/// open across isolate messages.
+class _AsyncBlock {
+  /// The category this block belongs to.
+  final String category = 'Dart';
+  /// The name of this block.
+  final String name;
+  /// The asynchronous task id.
+  final int _taskId;
+  /// An (optional) set of arguments which will be serialized to JSON and
+  /// associated with this block.
+  Map _arguments;
+
+  _AsyncBlock._(this.name, this._taskId);
+
+  // Emit the start event.
+  void _start() {
+    _reportTaskEvent(_getTraceClock(),
+                     _taskId,
+                     'b',
+                     category,
+                     name,
+                     _argumentsAsJson(_arguments));
+  }
+
+  // Emit the finish event.
+  void _finish() {
+    _reportTaskEvent(_getTraceClock(),
+                     _taskId,
+                     'e',
+                     category,
+                     name,
+                     _argumentsAsJson(null));
+  }
+
+  void _appendArguments(Map arguments) {
+    if (_arguments == null) {
+      _arguments = {};
+    }
+    _arguments.addAll(arguments);
+  }
+}
+
+/// A synchronous block of time on the timeline. This block should not be
+/// kept open across isolate messages.
+class _SyncBlock {
+  /// The category this block belongs to.
+  final String category = 'Dart';
+  /// The name of this block.
+  final String name;
+  /// An (optional) set of arguments which will be serialized to JSON and
+  /// associated with this block.
+  Map _arguments;
+  // The start time stamp.
+  final int _start;
+  // The start time stamp of the thread cpu clock.
+  final int _startCpu;
+
+  _SyncBlock._(this.name,
+               this._start,
+               this._startCpu);
+
+  /// Finish this block of time. At this point, this block can no longer be
+  /// used.
+  void finish() {
+    // Report event to runtime.
+    _reportCompleteEvent(_start,
+                         _startCpu,
+                         category,
+                         name,
+                         _argumentsAsJson(_arguments));
+  }
+
+  void _appendArguments(Map arguments) {
+    if (arguments == null) {
+      return;
+    }
+    if (_arguments == null) {
+      _arguments = {};
+    }
+    _arguments.addAll(arguments);
+  }
+}
+
+String _fastPathArguments;
+String _argumentsAsJson(Map arguments) {
+  if ((arguments == null) || (arguments.length == 0)) {
+    // Fast path no arguments. Avoid calling JSON.encode.
+    if (_fastPathArguments == null) {
+      _fastPathArguments = '{"isolateNumber":"${Timeline._isolateId}"}';
+    }
+    return _fastPathArguments;
+  }
+  // Add isolateNumber to arguments map.
+  arguments['isolateNumber'] = Timeline._isolateIdString;
+  return JSON.encode(arguments);
+}
+
+/// Returns true if the Dart Timeline stream is enabled.
+external bool _isDartStreamEnabled();
+
+/// Returns the next async task id.
+external int _getNextAsyncId();
+
+/// Returns the current value from the trace clock.
+external int _getTraceClock();
+
+/// Returns the current value from the thread CPU usage clock.
+external int _getThreadCpuClock();
+
+/// Returns the isolate's main port number.
+external int _getIsolateNum();
+
+/// Reports an event for a task.
+external void _reportTaskEvent(int start,
+                               int taskId,
+                               String phase,
+                               String category,
+                               String name,
+                               String argumentsAsJson);
+
+/// Reports a complete synchronous event.
+external void _reportCompleteEvent(int start,
+                                   int startCpu,
+                                   String category,
+                                   String name,
+                                   String argumentsAsJson);
+
+/// Reports an instant event.
+external void _reportInstantEvent(int start,
+                                  String category,
+                                  String name,
+                                  String argumentsAsJson);
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/html/dart2js/html_dart2js.dart b/pkg/dev_compiler/tool/input_sdk/lib/html/dart2js/html_dart2js.dart
index fc3cde5..e103c7d 100644
--- a/pkg/dev_compiler/tool/input_sdk/lib/html/dart2js/html_dart2js.dart
+++ b/pkg/dev_compiler/tool/input_sdk/lib/html/dart2js/html_dart2js.dart
@@ -39810,7 +39810,7 @@
   /**
    * Set this CSS Dimension to the specified number of x-heights.
    *
-   * One ex is equal to the the x-height of a font's baseline to its mean line,
+   * One ex is equal to the x-height of a font's baseline to its mean line,
    * generally the height of the letter "x" in the font, which is usually about
    * half the font-size.
    */
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/internal/symbol.dart b/pkg/dev_compiler/tool/input_sdk/lib/internal/symbol.dart
index 6722d98..b1aa855 100644
--- a/pkg/dev_compiler/tool/input_sdk/lib/internal/symbol.dart
+++ b/pkg/dev_compiler/tool/input_sdk/lib/internal/symbol.dart
@@ -15,6 +15,9 @@
 class Symbol implements core.Symbol {
   final String _name;
 
+  // Used internally by DDC to map ES6 symbols to Dart.
+  final dynamic _nativeSymbol;
+
   /**
    * Source of RegExp matching Dart reserved words.
    *
@@ -95,22 +98,28 @@
    * The empty symbol is handled before this regexp is used, and is not
    * accepted.
    */
-  static final RegExp symbolPattern = new RegExp(
-      '^(?:$operatorRE\$|$identifierRE(?:=?\$|[.](?!\$)))+?\$');
+  static final RegExp symbolPattern =
+      new RegExp('^(?:$operatorRE\$|$identifierRE(?:=?\$|[.](?!\$)))+?\$');
 
   external const Symbol(String name);
 
+  external const Symbol.es6(String name, nativeSymbol);
+
   /**
    * Platform-private method used by the mirror system to create
    * otherwise invalid names.
    */
-  const Symbol.unvalidated(this._name);
+  const Symbol.unvalidated(this._name) : this._nativeSymbol = null;
 
   // This is called by dart2js.
   Symbol.validated(String name)
-      : this._name = validatePublicSymbol(name);
+      : this._name = validatePublicSymbol(name),
+        this._nativeSymbol = null;
 
-  bool operator ==(Object other) => other is Symbol && _name == other._name;
+  bool operator ==(Object other) =>
+      other is Symbol &&
+      _name == other._name &&
+      _nativeSymbol == other._nativeSymbol;
 
   external int get hashCode;
 
@@ -119,6 +128,8 @@
   /// Platform-private accessor which cannot be called from user libraries.
   static String getName(Symbol symbol) => symbol._name;
 
+  static dynamic getNativeSymbol(Symbol symbol) => symbol._nativeSymbol;
+
   static String validatePublicSymbol(String name) {
     if (name.isEmpty || publicSymbolPattern.hasMatch(name)) return name;
     if (name.startsWith('_')) {
@@ -127,8 +138,7 @@
       // message.
       throw new ArgumentError('"$name" is a private identifier');
     }
-    throw new ArgumentError(
-        '"$name" is not a valid (qualified) symbol name');
+    throw new ArgumentError('"$name" is not a valid (qualified) symbol name');
   }
 
   /**
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/io/io.dart b/pkg/dev_compiler/tool/input_sdk/lib/io/io.dart
index c0d63de..66250ee 100644
--- a/pkg/dev_compiler/tool/input_sdk/lib/io/io.dart
+++ b/pkg/dev_compiler/tool/input_sdk/lib/io/io.dart
@@ -120,7 +120,7 @@
  *
  * The client connects to the WebSocket using the `connect()` method
  * and a URI that uses the Web Socket protocol.
- * The the client can write to the WebSocket with the `add()` method.
+ * The client can write to the WebSocket with the `add()` method.
  * For example,
  *
  *     WebSocket.connect('ws://127.0.0.1:4040/ws').then((socket) {
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/isolate/isolate.dart b/pkg/dev_compiler/tool/input_sdk/lib/isolate/isolate.dart
index 35d2a8b..f0fd886 100644
--- a/pkg/dev_compiler/tool/input_sdk/lib/isolate/isolate.dart
+++ b/pkg/dev_compiler/tool/input_sdk/lib/isolate/isolate.dart
@@ -312,7 +312,7 @@
    * [AS_EVENT].
    * The shutdown is performed at different times depending on the priority:
    *
-   * * `IMMEDIATE`: The the isolate shuts down as soon as possible.
+   * * `IMMEDIATE`: The isolate shuts down as soon as possible.
    *     Control messages are handled in order, so all previously sent control
    *     events from this isolate will all have been processed.
    *     The shutdown should happen no later than if sent with
@@ -345,7 +345,7 @@
    * [AS_EVENT].
    * The response is sent at different times depending on the ping type:
    *
-   * * `IMMEDIATE`: The the isolate responds as soon as it receives the
+   * * `IMMEDIATE`: The isolate responds as soon as it receives the
    *     control message. This is after any previous control message
    *     from the same isolate has been received.
    * * `BEFORE_NEXT_EVENT`: The response is scheduled for the next time
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/js/dart2js/js_dart2js.dart b/pkg/dev_compiler/tool/input_sdk/lib/js/dart2js/js_dart2js.dart
index 4e2d6fd..34636a7 100644
--- a/pkg/dev_compiler/tool/input_sdk/lib/js/dart2js/js_dart2js.dart
+++ b/pkg/dev_compiler/tool/input_sdk/lib/js/dart2js/js_dart2js.dart
@@ -383,7 +383,7 @@
     super['length'] = length;
   }
 
-  // Methods overriden for better performance
+  // Methods overridden for better performance
 
   void add(E value) {
     callMethod('push', [value]);
@@ -470,7 +470,8 @@
       '  let args = Array.prototype.map.call(arguments, #);'
       '  return #(#(...args));'
       '}', _convertToDart, _convertToJS, f);
-  _dartProxies[wrapper] = f;
+  JS('', '#.set(#, #)', _dartProxies, wrapper, f);
+
   return wrapper;
 }
 
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/math/math.dart b/pkg/dev_compiler/tool/input_sdk/lib/math/math.dart
index 73768c9..0f651b7 100644
--- a/pkg/dev_compiler/tool/input_sdk/lib/math/math.dart
+++ b/pkg/dev_compiler/tool/input_sdk/lib/math/math.dart
@@ -4,9 +4,9 @@
 
 /**
  * Mathematical constants and functions, plus a random number generator.
- * 
+ *
  * To use this library in your code:
- * 
+ *
  *     import 'dart:math';
  */
 library dart.math;
@@ -67,32 +67,7 @@
   * same mathematical value) then it is unspecified which of the two arguments
   * is returned.
   */
-num/*=T*/ min/*<T extends num>*/(num/*=T*/ a, num/*=T*/ b) {
-  // These partially redundant type checks improve code quality for dart2js.
-  // Most of the improvement is at call sites from the inferred non-null num
-  // return type.
-  if (a is! num) throw new ArgumentError(a);
-  if (b is! num) throw new ArgumentError(b);
-
-  if (a > b) return b;
-  if (a < b) return a;
-  if (b is double) {
-    // Special case for NaN and -0.0. If one argument is NaN return NaN.
-    // [min] must also distinguish between -0.0 and 0.0.
-    if (a is double) {
-      if (a == 0.0) {
-        // a is either 0.0 or -0.0. b is either 0.0, -0.0 or NaN.
-        // The following returns -0.0 if either a or b is -0.0, and it
-        // returns NaN if b is NaN.
-        return (a + b) * a * b;
-      }
-    }
-    // Check for NaN and b == -0.0.
-    if (a == 0 && b.isNegative || b.isNaN) return b;
-    return a;
-  }
-  return a;
-}
+external num/*=T*/ min/*<T extends num>*/(num/*=T*/ a, num/*=T*/ b);
 
 /**
   * Returns the larger of two numbers.
@@ -102,34 +77,7 @@
   * otherwise equal (including int and doubles with the same mathematical value)
   * then it is unspecified which of the two arguments is returned.
   */
-num/*=T*/ max/*<T extends num>*/(num/*=T*/ a, num/*=T*/ b) {
-  // These partially redundant type checks improve code quality for dart2js.
-  // Most of the improvement is at call sites from the inferred non-null num
-  // return type.
-  if (a is! num) throw new ArgumentError(a);
-  if (b is! num) throw new ArgumentError(b);
-
-  if (a > b) return a;
-  if (a < b) return b;
-  if (b is double) {
-    // Special case for NaN and -0.0. If one argument is NaN return NaN.
-    // [max] must also distinguish between -0.0 and 0.0.
-    if (a is double) {
-      if (a == 0.0) {
-        // a is either 0.0 or -0.0. b is either 0.0, -0.0, or NaN.
-        // The following returns 0.0 if either a or b is 0.0, and it
-        // returns NaN if b is NaN.
-        return a + b;
-      }
-    }
-    // Check for NaN.
-    if (b.isNaN) return b;
-    return a;
-  }
-  // max(-0.0, 0) must return 0.
-  if (b == 0 && a.isNegative) return b;
-  return a;
-}
+external num/*=T*/ max/*<T extends num>*/(num/*=T*/ a, num/*=T*/ b);
 
 /**
  * A variant of [atan].
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/math/rectangle.dart b/pkg/dev_compiler/tool/input_sdk/lib/math/rectangle.dart
index 6fe2075..bae6602 100644
--- a/pkg/dev_compiler/tool/input_sdk/lib/math/rectangle.dart
+++ b/pkg/dev_compiler/tool/input_sdk/lib/math/rectangle.dart
@@ -40,8 +40,15 @@
 
   bool operator ==(other) {
     if (other is !Rectangle) return false;
-    return left == other.left && top == other.top && right == other.right &&
-        bottom == other.bottom;
+    // TODO(rnystrom): Type promotion doesn't currently promote the [other]
+    // to Rectangle from the above line, so do it explicitly here to avoid a
+    // dynamic send and work around:
+    // https://github.com/dart-lang/sdk/issues/27551
+    var otherRect = other as Rectangle;
+    return left == otherRect.left &&
+        top == otherRect.top &&
+        right == otherRect.right &&
+        bottom == otherRect.bottom;
   }
 
   int get hashCode => _JenkinsSmiHash.hash4(left.hashCode, top.hashCode,
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/mirrors/mirrors.dart b/pkg/dev_compiler/tool/input_sdk/lib/mirrors/mirrors.dart
index f5c8370..25cab26 100644
--- a/pkg/dev_compiler/tool/input_sdk/lib/mirrors/mirrors.dart
+++ b/pkg/dev_compiler/tool/input_sdk/lib/mirrors/mirrors.dart
@@ -223,7 +223,7 @@
   /**
    * The simple name for this Dart language entity.
    *
-   * The simple name is in most cases the the identifier name of the entity,
+   * The simple name is in most cases the identifier name of the entity,
    * such as 'myMethod' for a method, [:void myMethod() {...}:] or 'mylibrary'
    * for a [:library 'mylibrary';:] declaration.
    */
@@ -920,7 +920,7 @@
   /**
    * The defining type for this typedef.
    *
-   * If the the type referred to by the reflectee is a function type *F*, the
+   * If the type referred to by the reflectee is a function type *F*, the
    * result will be [:FunctionTypeMirror:] reflecting *F* which is abstract
    * and has an abstract method [:call:] whose signature corresponds to *F*.
    * For instance [:void f(int):] is the referent for [:typedef void f(int):].
diff --git a/pkg/dev_compiler/tool/input_sdk/patch/developer_patch.dart b/pkg/dev_compiler/tool/input_sdk/patch/developer_patch.dart
new file mode 100644
index 0000000..93f19fb
--- /dev/null
+++ b/pkg/dev_compiler/tool/input_sdk/patch/developer_patch.dart
@@ -0,0 +1,127 @@
+// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
+// for 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:developer library.
+
+import 'dart:_js_helper' show patch, ForceInline;
+import 'dart:_foreign_helper' show JS;
+
+@patch
+// @ForceInline()
+bool debugger({bool when: true, String message}) {
+  if (when) {
+    JS('', 'debugger');
+  }
+  return when;
+}
+
+@patch
+Object inspect(Object object) {
+  return object;
+}
+
+@patch
+void log(String message,
+         {DateTime time,
+          int sequenceNumber,
+          int level: 0,
+          String name: '',
+          Zone zone,
+          Object error,
+          StackTrace stackTrace}) {
+  // TODO.
+}
+
+final _extensions = new Map<String, ServiceExtensionHandler>();
+
+@patch
+ServiceExtensionHandler _lookupExtension(String method) {
+  return _extensions[method];
+}
+
+@patch
+_registerExtension(String method, ServiceExtensionHandler handler) {
+  _extensions[method] = handler;
+}
+
+@patch
+_postEvent(String eventKind, String eventData) {
+  // TODO.
+}
+
+
+@patch
+bool _isDartStreamEnabled() {
+  return false;
+}
+
+@patch
+int _getTraceClock() {
+  // TODO.
+  return _clockValue++;
+}
+int _clockValue = 0;
+
+@patch
+int _getThreadCpuClock() {
+  return -1;
+}
+
+
+@patch
+void _reportCompleteEvent(int start,
+                          int startCpu,
+                          String category,
+                          String name,
+                          String argumentsAsJson) {
+  // TODO.
+}
+
+@patch
+void _reportInstantEvent(int start,
+                         String category,
+                         String name,
+                         String argumentsAsJson) {
+  // TODO.
+}
+
+@patch
+int _getNextAsyncId() {
+  return 0;
+}
+
+@patch
+int _getIsolateNum() {
+  return 0;
+}
+
+@patch
+void _reportTaskEvent(int start,
+                      int taskId,
+                      String phase,
+                      String category,
+                      String name,
+                      String argumentsAsJson) {
+ // TODO.
+}
+
+@patch
+int _getServiceMajorVersion() {
+  return 0;
+}
+
+@patch
+int _getServiceMinorVersion() {
+  return 0;
+}
+
+@patch
+void _getServerInfo(SendPort sp) {
+  sp.send(null);
+}
+
+@patch
+void _webServerControl(SendPort sp, bool enable) {
+  sp.send(null);
+}
diff --git a/pkg/dev_compiler/tool/input_sdk/patch/internal_patch.dart b/pkg/dev_compiler/tool/input_sdk/patch/internal_patch.dart
index e4fd296..22f67d3 100644
--- a/pkg/dev_compiler/tool/input_sdk/patch/internal_patch.dart
+++ b/pkg/dev_compiler/tool/input_sdk/patch/internal_patch.dart
@@ -11,7 +11,11 @@
 class Symbol implements core.Symbol {
   @patch
   const Symbol(String name)
-      : this._name = name;
+      : this._name = name, this._nativeSymbol = null;
+
+  @patch
+  const Symbol.es6(String name, dynamic nativeSymbol)
+      : this._name = name, this._nativeSymbol = nativeSymbol;
 
   @patch
   int get hashCode {
diff --git a/pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart b/pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart
index fc54f63..73a6723 100644
--- a/pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart
+++ b/pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart
@@ -8,6 +8,14 @@
 import 'dart:typed_data' show ByteData;
 
 @patch
+num/*=T*/ min/*<T extends num>*/(num/*=T*/ a, num/*=T*/ b)
+  => JS('num', r'Math.min(#, #)', checkNum(a), checkNum(b)) as num/*=T*/;
+
+@patch
+num/*=T*/ max/*<T extends num>*/(num/*=T*/ a, num/*=T*/ b)
+  => JS('num', r'Math.max(#, #)', checkNum(a), checkNum(b)) as num/*=T*/;
+
+@patch
 double sqrt(num x)
   => JS('num', r'Math.sqrt(#)', checkNum(x));
 
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
index d6f3423..629db38 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
@@ -64,12 +64,12 @@
 /// The Symbol for storing type arguments on a specialized generic type.
 final _mixins = JS('', 'Symbol("mixins")');
 
-getMixins(clazz) => JS('', '$clazz[$_mixins]');
+getMixins(clazz) => JS('', 'Object.hasOwnProperty.call(#, #) ? #[#] : null', clazz, _mixins, clazz, _mixins);
 
 @JSExportName('implements')
 final _implements = JS('', 'Symbol("implements")');
 
-getImplements(clazz) => JS('', '#[#]', clazz, _implements);
+getImplements(clazz) => JS('', 'Object.hasOwnProperty.call(#, #) ? #[#] : null', clazz, _implements, clazz, _implements);
 
 /// The Symbol for storing type arguments on a specialized generic type.
 final _typeArguments = JS('', 'Symbol("typeArguments")');
@@ -97,7 +97,7 @@
 })()''');
 
 /// Memoize a generic type constructor function.
-generic(typeConstructor) => JS(
+generic(typeConstructor, [setBaseClass]) => JS(
     '',
     '''(() => {
   let length = $typeConstructor.length;
@@ -128,10 +128,12 @@
             value[$_typeArguments] = args;
             value[$_originalDeclaration] = makeGenericType;
           }
+          map.set(arg, value);
+          if ($setBaseClass) $setBaseClass(value);
         } else {
           value = new Map();
+          map.set(arg, value);
         }
-        map.set(arg, value);
       }
     }
     return value;
@@ -459,11 +461,6 @@
   let proto = $type.prototype;
   for (let name of $methodNames) {
     let method = $getOwnPropertyDescriptor(proto, name);
-    // TODO(vsm): We should be able to generate code to avoid this case.
-    // The method may be null if this type implements a potentially native
-    // interface but isn't native itself.  For a field on this type, we're not
-    // generating a corresponding getter/setter method - it's just a field.
-    if (!method) continue;
     $defineProperty(proto, $getExtensionSymbol(name), method);
   }
   // Ensure the signature is available too.
@@ -501,10 +498,13 @@
 
 /// Like [setBaseClass] but for generic extension types, e.g. `JSArray<E>`
 setExtensionBaseClass(derived, base) {
-  // Mark the generic type as an extension type.
-  JS('', '#.prototype[#] = #', derived, _extensionType, derived);
-  // Link the prototype objects
-  JS('', '#.prototype.__proto__ = #.prototype', derived, base);
+  // Mark the generic type as an extension type and link the prototype objects
+  return JS('', '''(() => {
+    if ($base) {
+      $derived.prototype[$_extensionType] = $derived;
+      $derived.prototype.__proto__ = $base.prototype
+    }
+})()''');
 }
 
 /// Given a special constructor function that creates a function instances,
@@ -542,3 +542,16 @@
   // like `caller` and `arguments`.
   $defineProperty($clazz, $name, { value: ctor, configurable: true });
 })()''');
+
+defineEnumValues(enumClass, names) => JS(
+    '',
+    '''(() => {
+  let values = [];
+  for (var i = 0; i < $names.length; i++) {
+    let value = $const_(new $enumClass(i));
+    values.push(value);
+    Object.defineProperty($enumClass, $names[i],
+        { value: value, configurable: true });
+  }
+  $enumClass.values = $constList(values, $enumClass);
+})()''');
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/errors.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/errors.dart
index 8b77035..244a603 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/errors.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/errors.dart
@@ -4,34 +4,40 @@
 part of dart._runtime;
 
 throwCastError(object, actual, type) => JS('', '''(() => {
+  debugger;
   $throw_(new $CastErrorImplementation($object,
                                        $typeName($actual),
                                        $typeName($type)));
 })()''');
 
 throwTypeError(object, actual, type) => JS('', '''(() => {
+  debugger;
   $throw_(new $TypeErrorImplementation($object,
                                        $typeName($actual),
                                        $typeName($type)));
 })()''');
 
 throwStrongModeCastError(object, actual, type) => JS('', '''(() => {
+  debugger;
   $throw_(new $StrongModeCastError($object,
                                    $typeName($actual),
                                    $typeName($type)));
 })()''');
 
 throwStrongModeTypeError(object, actual, type) => JS('', '''(() => {
+  debugger;
   $throw_(new $StrongModeTypeError($object,
                                    $typeName($actual),
                                    $typeName($type)));
 })()''');
 
 throwUnimplementedError(message) => JS('', '''(() => {
+  debugger;
   $throw_(new $UnimplementedError($message));
 })()''');
 
 throwAssertionError() => JS('', '''(() => {
+  debugger;
   $throw_(new $AssertionError());
 })()''');
 
@@ -39,6 +45,7 @@
   // TODO(vsm): Per spec, we should throw an NSM here.  Technically, we ought
   // to thread through method info, but that uglifies the code and can't
   // actually be queried ... it only affects how the error is printed.
+  debugger;
   $throw_(new $NoSuchMethodError(null,
       new $Symbol('<Unexpected Null Value>'), null, null, null));
 })()''');
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
index 913860a..392abf0 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
@@ -19,15 +19,13 @@
       this.isMethod: false,
       this.isGetter: false,
       this.isSetter: false})
-    : memberName = _dartSymbol(memberName),
-      namedArguments = _namedArgsToSymbols(namedArguments);
+      : memberName = _dartSymbol(memberName),
+        namedArguments = _namedArgsToSymbols(namedArguments);
 
   static Map<Symbol, dynamic> _namedArgsToSymbols(namedArgs) {
     if (namedArgs == null) return {};
-    return new Map.fromIterable(
-        getOwnPropertyNames(namedArgs),
-        key: _dartSymbol,
-        value: (k) => JS('', '#[#]', namedArgs, k));
+    return new Map.fromIterable(getOwnPropertyNames(namedArgs),
+        key: _dartSymbol, value: (k) => JS('', '#[#]', namedArgs, k));
   }
 }
 
@@ -38,8 +36,8 @@
     if (hasMethod(obj, f)) return bind(obj, f, JS('', 'void 0'));
     return JS('', '#[#]', obj, f);
   }
-  return noSuchMethod(obj,
-      new InvocationImpl(field, JS('', '[]'), isGetter: true));
+  return noSuchMethod(
+      obj, new InvocationImpl(field, JS('', '[]'), isGetter: true));
 }
 
 dput(obj, field, value) {
@@ -48,13 +46,15 @@
   if (f != null) {
     return JS('', '#[#] = #', obj, f, value);
   }
-  return noSuchMethod(obj,
-      new InvocationImpl(field, JS('', '[#]', value), isSetter: true));
+  return noSuchMethod(
+      obj, new InvocationImpl(field, JS('', '[#]', value), isSetter: true));
 }
 
 /// Check that a function of a given type can be applied to
 /// actuals.
-_checkApply(type, actuals) => JS('', '''(() => {
+_checkApply(type, actuals) => JS(
+    '',
+    '''(() => {
   if ($actuals.length < $type.args.length) return false;
   let index = 0;
   for(let i = 0; i < $type.args.length; ++i) {
@@ -97,15 +97,17 @@
 extractNamedArgs(args) {
   if (JS('bool', '#.length > 0', args)) {
     var last = JS('', '#[#.length - 1]', args, args);
-    if (JS('bool', '# != null && #.__proto__ === Object.prototype',
-        last, last)) {
+    if (JS(
+        'bool', '# != null && #.__proto__ === Object.prototype', last, last)) {
       return JS('', '#.pop()', args);
     }
   }
   return null;
 }
 
-_checkAndCall(f, ftype, obj, typeArgs, args, name) => JS('', '''(() => {
+_checkAndCall(f, ftype, obj, typeArgs, args, name) => JS(
+    '',
+    '''(() => {
   $_trackCall($obj);
 
   let originalTarget = obj === void 0 ? f : obj;
@@ -176,12 +178,68 @@
   return callNSM();
 })()''');
 
-dcall(f, @rest args) => _checkAndCall(
-    f, _getRuntimeType(f), JS('', 'void 0'), null, args, 'call');
+dcall(f, @rest args) =>
+    _checkAndCall(f, _getRuntimeType(f), JS('', 'void 0'), null, args, 'call');
 
 dgcall(f, typeArgs, @rest args) => _checkAndCall(
     f, _getRuntimeType(f), JS('', 'void 0'), typeArgs, args, 'call');
 
+/// Helper for REPL dynamic invocation variants that make a best effort to
+/// enable accessing private members across library boundaries.
+_dhelperRepl(object, field, callback) => JS(
+    '',
+    '''(() => {
+  let rawField = $field;
+  if (typeof(field) == 'symbol') {
+    // test if the specified field exists in which case it is safe to use it.
+    if ($field in $object) return $callback($field);
+
+    // Symbol is from a different library. Make a best effort to
+    $field = $field.toString();
+    $field = $field.substring('Symbol('.length, field.length - 1);
+
+  } else if ($field.charAt(0) != '_') {
+    // Not a private member so default call path is safe.
+    return $callback($field);
+  }
+
+  // If the exact field name is present, invoke callback with it.
+  if ($field in $object) return $callback($field);
+
+  // TODO(jacobr): warn if there are multiple private members with the same
+  // name which could happen if super classes in different libraries have
+  // the same private member name.
+  let proto = $object;
+  while (proto !== null) {
+    // Private field (indicated with "_").
+    let symbols = Object.getOwnPropertySymbols(proto);
+    let target = 'Symbol(' + $field + ')';
+
+    for (let s = 0; s < symbols.length; s++) {
+      let sym = symbols[s];
+      if (target == sym.toString()) return $callback(sym);
+    }
+    proto = proto.__proto__;
+  }
+  // We didn't find a plausible alternate private symbol so just fall back
+  // to the regular field.
+  return $callback(rawField);
+})()''');
+
+dloadRepl(obj, field) =>
+    _dhelperRepl(obj, field, (resolvedField) => dload(obj, resolvedField));
+
+dputRepl(obj, field, value) => _dhelperRepl(
+    obj, field, (resolvedField) => dput(obj, resolvedField, value));
+
+_callMethodRepl(obj, method, typeArgs, args) => _dhelperRepl(obj, method,
+    (resolvedField) => _callMethod(obj, resolvedField, typeArgs, args, method));
+
+dsendRepl(obj, method, @rest args) => _callMethodRepl(obj, method, null, args);
+
+dgsendRepl(obj, typeArgs, method, @rest args) =>
+    _callMethodRepl(obj, method, typeArgs, args);
+
 class _MethodStats {
   final String typeName;
   final String frame;
@@ -199,8 +257,8 @@
 
   var keys = _callMethodStats.keys.toList();
 
-  keys.sort((a, b) => _callMethodStats[b].count.compareTo(
-      _callMethodStats[a].count));
+  keys.sort(
+      (a, b) => _callMethodStats[b].count.compareTo(_callMethodStats[a].count));
   for (var key in keys) {
     var stats = _callMethodStats[key];
     ret.add([stats.typeName, stats.frame, stats.count]);
@@ -231,16 +289,18 @@
   }
 
   var actualTypeName = typeName(actual);
-  _callMethodStats.putIfAbsent("$actualTypeName <$src>",
-      () => new _MethodStats(actualTypeName, src)).count++;
+  _callMethodStats
+      .putIfAbsent(
+          "$actualTypeName <$src>", () => new _MethodStats(actualTypeName, src))
+      .count++;
 }
 
 /// Shared code for dsend, dindex, and dsetindex.
 _callMethod(obj, name, typeArgs, args, displayName) {
   var symbol = _canonicalMember(obj, name);
   if (symbol == null) {
-    return noSuchMethod(obj,
-        new InvocationImpl(displayName, args, isMethod: true));
+    return noSuchMethod(
+        obj, new InvocationImpl(displayName, args, isMethod: true));
   }
   var f = obj != null ? JS('', '#[#]', obj, symbol) : null;
   var ftype = getMethodType(obj, symbol);
@@ -252,15 +312,17 @@
 dgsend(obj, typeArgs, method, @rest args) =>
     _callMethod(obj, method, typeArgs, args, method);
 
-dindex(obj, index) => _callMethod(obj, 'get', null, JS('', '[#]', index), '[]');
+dindex(obj, index) => _callMethod(obj, '_get', null, JS('', '[#]', index), '[]');
 
 dsetindex(obj, index, value) =>
-    _callMethod(obj, 'set', null, JS('', '[#, #]', index, value), '[]=');
+    _callMethod(obj, '_set', null, JS('', '[#, #]', index, value), '[]=');
 
 /// TODO(leafp): This duplicates code in types.dart.
 /// I haven't found a way to factor it out that makes the
 /// code generator happy though.
-_ignoreMemo(f) => JS('', '''(() => {
+_ignoreMemo(f) => JS(
+    '',
+    '''(() => {
   let memo = new Map();
   return (t1, t2) => {
     let map = memo.get(t1);
@@ -277,7 +339,9 @@
   };
 })()''');
 
-final _ignoreTypeFailure = JS('', '''(() => {
+final _ignoreTypeFailure = JS(
+    '',
+    '''(() => {
   return $_ignoreMemo((actual, type) => {
       // TODO(vsm): Remove this hack ...
       // This is primarily due to the lack of generic methods,
@@ -302,7 +366,9 @@
 ///  and strong mode
 /// Returns null if [obj] is not an instance of [type] in strong mode
 ///  but might be in spec mode
-bool strongInstanceOf(obj, type, ignoreFromWhiteList) => JS('', '''(() => {
+bool strongInstanceOf(obj, type, ignoreFromWhiteList) => JS(
+    '',
+    '''(() => {
   let actual = $getReifiedType($obj);
   let result = $isSubtype(actual, $type);
   if (result || actual == $jsobject ||
@@ -316,14 +382,18 @@
 /// Returns true if [obj] is null or an instance of [type]
 /// Returns false if [obj] is non-null and not an instance of [type]
 /// in strong mode
-instanceOfOrNull(obj, type) => JS('', '''(() => {
+instanceOfOrNull(obj, type) => JS(
+    '',
+    '''(() => {
   // If strongInstanceOf returns null, convert to false here.
   if (($obj == null) || $strongInstanceOf($obj, $type, true)) return true;
   return false;
 })()''');
 
 @JSExportName('is')
-instanceOf(obj, type) => JS('', '''(() => {
+instanceOf(obj, type) => JS(
+    '',
+    '''(() => {
   let result = $strongInstanceOf($obj, $type);
   if (result !== null) return result;
   let actual = $getReifiedType($obj);
@@ -389,7 +459,9 @@
 /// Adds type type test predicates to a constructor for a non-parameterized
 /// type. Non-parameterized types can use `instanceof` for subclass checks and
 /// fall through to a helper for subtype tests.
-addSimpleTypeTests(ctor) => JS('', '''(() => {
+addSimpleTypeTests(ctor) => JS(
+    '',
+    '''(() => {
   $ctor.is = function is_C(object) {
     // This is incorrect for classes [Null] and [Object], so we do not use
     // [addSimpleTypeTests] for these classes.
@@ -409,7 +481,9 @@
 /// Adds type type test predicates to a constructor. Used for parmeterized
 /// types. We avoid `instanceof` for, e.g. `x is ListQueue` since there is
 /// no common class for `ListQueue<int>` and `ListQueue<String>`.
-addTypeTests(ctor) => JS('', '''(() => {
+addTypeTests(ctor) => JS(
+    '',
+    '''(() => {
   $ctor.as = function as_G(object) {
     return dart.as(object, this);
   };
@@ -421,7 +495,9 @@
   };
 })()''');
 
-equals(x, y) => JS('', '''(() => {
+equals(x, y) => JS(
+    '',
+    '''(() => {
   if ($x == null || $y == null) return $x == $y;
   let eq = $x['=='];
   return eq ? eq.call($x, $y) : $x === $y;
@@ -449,7 +525,9 @@
 // TODO(jmesserly): this could be faster
 // TODO(jmesserly): we can use default values `= dynamic` once #417 is fixed.
 // TODO(jmesserly): move this to classes for consistentcy with list literals?
-map(values, [K, V]) => JS('', '''(() => {
+map(values, [K, V]) => JS(
+    '',
+    '''(() => {
   if ($K == null) $K = $dynamic;
   if ($V == null) $V = $dynamic;
   let map = ${getGenericClass(LinkedHashMap)}($K, $V).new();
@@ -457,24 +535,28 @@
     for (let i = 0, end = $values.length - 1; i < end; i += 2) {
       let key = $values[i];
       let value = $values[i + 1];
-      map.set(key, value);
+      map._set(key, value);
     }
   } else if (typeof $values === 'object') {
     for (let key of $getOwnPropertyNames($values)) {
-      map.set(key, $values[key]);
+      map._set(key, $values[key]);
     }
   }
   return map;
 })()''');
 
 @JSExportName('assert')
-assert_(condition) => JS('', '''(() => {
+assert_(condition) => JS(
+    '',
+    '''(() => {
   if (!$condition) $throwAssertionError();
 })()''');
 
 final _stack = JS('', 'new WeakMap()');
 @JSExportName('throw')
-throw_(obj) => JS('', '''(() => {
+throw_(obj) => JS(
+    '',
+    '''(() => {
   if ($obj != null && (typeof $obj == 'object' || typeof $obj == 'function')) {
     // TODO(jmesserly): couldn't we store the most recent stack in a single
     // variable? There should only be one active stack trace. That would
@@ -484,19 +566,25 @@
   throw $obj;
 })()''');
 
-getError(exception) => JS('', '''(() => {
+getError(exception) => JS(
+    '',
+    '''(() => {
   var stack = $_stack.get($exception);
   return stack !== void 0 ? stack : $exception;
 })()''');
 
 // This is a utility function: it is only intended to be called from dev
 // tools.
-stackPrint(exception) => JS('', '''(() => {
+stackPrint(exception) => JS(
+    '',
+    '''(() => {
   var error = $getError($exception);
   console.log(error.stack ? error.stack : 'No stack trace for: ' + error);
 })()''');
 
-stackTrace(exception) => JS('', '''(() => {
+stackTrace(exception) => JS(
+    '',
+    '''(() => {
   var error = $getError($exception);
   return $getTraceFromException(error);
 })()''');
@@ -507,7 +595,9 @@
 /// Will call each successive callback, unless one returns null, which stops
 /// the sequence.
 ///
-nullSafe(obj, @rest callbacks) => JS('', '''(() => {
+nullSafe(obj, @rest callbacks) => JS(
+    '',
+    '''(() => {
   if ($obj == null) return $obj;
   for (let callback of $callbacks) {
     $obj = callback($obj);
@@ -517,6 +607,7 @@
 })()''');
 
 final _value = JS('', 'Symbol("_value")');
+
 ///
 /// Looks up a sequence of [keys] in [map], recursively, and
 /// returns the result. If the value is not found, [valueFn] will be called to
@@ -529,7 +620,9 @@
 ///
 ///     { 1: { 2: { 'hi ': { 'there ': 'world' } } } }
 ///
-multiKeyPutIfAbsent(map, keys, valueFn) => JS('', '''(() => {
+multiKeyPutIfAbsent(map, keys, valueFn) => JS(
+    '',
+    '''(() => {
   for (let k of $keys) {
     let value = $map.get(k);
     if (!value) {
@@ -561,7 +654,9 @@
 /// - nested values of the object are themselves already canonicalized.
 ///
 @JSExportName('const')
-const_(obj) => JS('', '''(() => {
+const_(obj) => JS(
+    '',
+    '''(() => {
   // TODO(leafp): This table gets quite large in apps.
   // Keeping the paths is probably expensive.  It would probably
   // be more space efficient to just use a direct hash table with
@@ -611,8 +706,9 @@
 ///
 /// Canonicalize a constant list
 ///
-@JSExportName('constList')
-constList_(elements, elementType) => JS('', '''(() => {
+constList(elements, elementType) => JS(
+    '',
+    '''(() => {
   function lookupNonTerminal(map, key) {
     let result = map.get(key);
     if (result !== void 0) return result;
@@ -639,7 +735,7 @@
 
   switch (JS('String', 'typeof #', obj)) {
     case "number":
-      return JS('','# & 0x1FFFFFFF', obj);
+      return JS('', '# & 0x1FFFFFFF', obj);
     case "boolean":
       // From JSBool.hashCode, see comment there.
       return JS('', '# ? (2 * 3 * 23 * 3761) : (269 * 811)', obj);
@@ -664,8 +760,8 @@
     return JS('String', '#[dartx.toString]()', obj);
   }
   if (JS('bool', 'typeof # == "function"', obj)) {
-    return JS('String', r'"Closure: " + # + " from: " + #',
-        getReifiedType(obj), obj);
+    return JS(
+        'String', r'"Closure: " + # + " from: " + #', getReifiedType(obj), obj);
   }
   // TODO(jmesserly): restore this faster path once ES Symbol is treated as
   // an extension type (and thus hits the above code path).
@@ -677,11 +773,8 @@
 // TODO(jmesserly): is the argument type verified statically?
 noSuchMethod(obj, Invocation invocation) {
   if (obj == null || JS('bool', 'typeof # == "function"', obj)) {
-    throw new NoSuchMethodError(
-        obj,
-        invocation.memberName,
-        invocation.positionalArguments,
-        invocation.namedArguments);
+    throw new NoSuchMethodError(obj, invocation.memberName,
+        invocation.positionalArguments, invocation.namedArguments);
   }
   // Delegate to the (possibly user-defined) method on the object.
   var extension = getExtensionType(obj);
@@ -701,7 +794,9 @@
   // Delegate to the (possibly user-defined) method on the object.
   var extension = getExtensionType(obj);
   if (extension != null) {
-    return JS('', '#[dartx.runtimeType]', obj);
+    result = JS('', '#[dartx.runtimeType]', obj);
+    // If extension doesn't override runtimeType, return the extension type.
+    return result ?? wrapType(extension);
   }
   if (JS('bool', 'typeof # == "function"', obj)) {
     return wrapType(getReifiedType(obj));
@@ -712,7 +807,9 @@
 /// Implements Dart's interpolated strings as ES2015 tagged template literals.
 ///
 /// For example: dart.str`hello ${name}`
-String str(strings, @rest values) => JS('', '''(() => {
+String str(strings, @rest values) => JS(
+    '',
+    '''(() => {
   let s = $strings[0];
   for (let i = 0, len = $values.length; i < len; ) {
     s += $notNull($_toString($values[i])) + $strings[++i];
@@ -720,8 +817,9 @@
   return s;
 })()''');
 
-
-final JsIterator = JS('', '''
+final JsIterator = JS(
+    '',
+    '''
   class JsIterator {
     constructor(dartIterator) {
       this.dartIterator = dartIterator;
@@ -748,3 +846,9 @@
   }
   return name;
 }
+
+/// Emulates the implicit "loadLibrary" function provided by a deferred library.
+///
+/// Libraries are not actually deferred in DDC, so this just returns a future
+/// that completes immediately.
+Future loadLibrary() => new Future.value();
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/rtti.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/rtti.dart
index c6419a0..d97b6bd 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/rtti.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/rtti.dart
@@ -58,10 +58,8 @@
 fn(closure, t) {
   if (t == null) {
     // No type arguments, it's all dynamic
-    t = definiteFunctionType(
-        JS('', '#', dynamic),
-        JS('', 'Array(#.length).fill(#)', closure, dynamic),
-        JS('', 'void 0'));
+    t = definiteFunctionType(JS('', '#', dynamic),
+        JS('', 'Array(#.length).fill(#)', closure, dynamic), JS('', 'void 0'));
   }
   tag(closure, t);
   return closure;
@@ -161,6 +159,29 @@
   return JS('', '#[#] = new #(#)', type, _typeObject, WrappedType, type);
 }
 
+var _lazyJSTypes = JS('', 'new Map()');
+
+lazyJSType(getJSTypeCallback, name) {
+  var key = JS('String', '#.toString()', getJSTypeCallback);
+  if (JS('bool', '#.has(#)', _lazyJSTypes, key)) {
+    return JS('', '#.get(#)', _lazyJSTypes, key);
+  }
+  var ret = JS('', 'new #(#, #)', LazyJSType, getJSTypeCallback, name);
+  JS('', '#.set(#, #)', _lazyJSTypes, key, ret);
+  return ret;
+}
+
+// TODO(jacobr): do not use the same LazyJSType object for anonymous JS types
+// from different libraries.
+lazyAnonymousJSType(name) {
+  if (JS('bool', '#.has(#)', _lazyJSTypes, name)) {
+    return JS('', '#.get(#)', _lazyJSTypes, name);
+  }
+  var ret = JS('', 'new #(null, #)', LazyJSType, name);
+  JS('', '#.set(#, #)', _lazyJSTypes, name, ret);
+  return ret;
+}
+
 /// Given a WrappedType, return the internal runtime type object.
 unwrapType(obj) => obj._wrappedType;
 
@@ -180,6 +201,6 @@
 }
 
 void tagLazy(value, compute) {
-  JS('', '#(#, #, { get: # })',
-      defineLazyProperty, value, _runtimeType, compute);
+  JS('', '#(#, #, { get: # })', defineLazyProperty, value, _runtimeType,
+      compute);
 }
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/runtime.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/runtime.dart
index d5a5ae2..6b79332 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/runtime.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/runtime.dart
@@ -10,7 +10,7 @@
 import 'dart:_foreign_helper' show JS, JSExportName, rest, spread;
 import 'dart:_interceptors' show JSArray;
 import 'dart:_js_helper' show SyncIterable, BooleanConversionAssertionError,
-  CastErrorImplementation, TypeErrorImplementation, 
+  CastErrorImplementation, TypeErrorImplementation,
   StrongModeCastError, StrongModeTypeError, StrongModeErrorImplementation,
   getTraceFromException, Primitives;
 
@@ -25,10 +25,3 @@
 @JSExportName('global')
 final global_ = JS('', 'typeof window == "undefined" ? global : window');
 final JsSymbol = JS('', 'Symbol');
-
-// TODO(vsm): This is referenced (as init.globalState) from
-// isolate_helper.dart.  Where should it go?
-// See: https://github.com/dart-lang/dev_compiler/issues/164
-// exports.globalState = null;
-// TODO(ochafik).
-// _js_helper.checkNum = operations.notNull;
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/types.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/types.dart
index 1c1acb2..4d402db 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/types.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/types.dart
@@ -56,7 +56,9 @@
 // TODO(jmesserly): we shouldn't implement Type here. It should be moved down
 // to AbstractFunctionType.
 class TypeRep implements Type {
-  TypeRep() { _initialize; }
+  TypeRep() {
+    _initialize;
+  }
   String get name => this.toString();
 }
 
@@ -64,12 +66,64 @@
   toString() => 'dynamic';
 }
 
+class LazyJSType implements Type {
+  final _jsTypeCallback;
+  final _dartName;
+
+  LazyJSType(this._jsTypeCallback, this._dartName);
+
+  get _rawJSType => JS('', '#()', _jsTypeCallback);
+
+  toString() => _jsTypeCallback != null ? typeName(_rawJSType) : _dartName;
+}
+
+void _warn(arg) {
+  JS('void', 'console.warn(#)', arg);
+}
+
+_isInstanceOfLazyJSType(o, LazyJSType t) {
+  if (t._jsTypeCallback != null) {
+    if (t._rawJSType == null) {
+      var expected = t._dartName;
+      var actual = typeName(getReifiedType(o));
+      _warn('Cannot find native JavaScript type ($expected) '
+          'to type check $actual');
+      return true;
+    }
+    return JS('bool', 'dart.is(#, #)', o, t._rawJSType);
+  }
+  if (o == null) return false;
+  // Anonymous case: match any JS type.
+  return _isJSObject(o);
+}
+
+_asInstanceOfLazyJSType(o, LazyJSType t) {
+  if (t._jsTypeCallback != null) {
+    if (t._rawJSType == null) {
+      var expected = t._dartName;
+      var actual = typeName(getReifiedType(o));
+      _warn('Cannot find native JavaScript type ($expected) '
+          'to type check $actual');
+      return o;
+    }
+    return JS('bool', 'dart.as(#, #)', o, t._rawJSType);
+  }
+  // Anonymous case: allow any JS type.
+  if (o == null) return null;
+  if (!_isJSObject(o)) _throwCastError(o, t, true);
+  return o;
+}
+
+bool _isJSObject(o) => JS('bool', '!dart.getReifiedType(o)[dart._runtimeType]');
+
 @JSExportName('dynamic')
 final _dynamic = new Dynamic();
 
 final _initialize = _initialize2();
 
-_initialize2() => JS('', '''(() => {
+_initialize2() => JS(
+    '',
+    '''(() => {
   // JavaScript API forwards to runtime library.
   $TypeRep.prototype.is = function is_T(object) {
     return dart.is(object, this);
@@ -91,6 +145,16 @@
   $Dynamic.prototype._check = function check_Dynamic(object) {
     return object;
   };
+
+  $LazyJSType.prototype.is = function is_T(object) {
+    return $_isInstanceOfLazyJSType(object, this);
+  };
+  $LazyJSType.prototype.as = function as_T(object) {
+    return $_asInstanceOfLazyJSType(object, this);
+  };
+  $LazyJSType.prototype._check = function check_T(object) {
+    return $_asInstanceOfLazyJSType(object, this);
+  };
 })()''');
 
 class Void extends TypeRep {
@@ -103,6 +167,7 @@
 class Bottom extends TypeRep {
   toString() => 'bottom';
 }
+
 final bottom = new Bottom();
 
 class JSObject extends TypeRep {
@@ -117,7 +182,9 @@
   toString() => typeName(_wrappedType);
 }
 
-final AbstractFunctionType = JS('', '''
+final AbstractFunctionType = JS(
+    '',
+    '''
   class AbstractFunctionType extends $TypeRep {
     constructor() {
       super();
@@ -172,6 +239,7 @@
 /// reached via this path (if any) is the canonical representative
 /// for this packet.
 final _fnTypeNamedArgMap = JS('', 'new Map()');
+
 /// Memo table for positional argument groups. A positional argument
 /// packet [type1, ..., typen] (required or optional) corresponds to
 /// the path n, type1, ...., typen.  The element reached via
@@ -179,11 +247,13 @@
 /// packet. Note that required and optional parameters packages
 /// may have the same canonical representation.
 final _fnTypeArrayArgMap = JS('', 'new Map()');
+
 /// Memo table for function types. The index path consists of the
 /// path length - 1, the returnType, the canonical positional argument
 /// packet, and if present, the canonical optional or named argument
 /// packet.  A level of indirection could be avoided here if desired.
 final _fnTypeTypeMap = JS('', 'new Map()');
+
 /// Memo table for small function types with no optional or named
 /// arguments and less than a fixed n (currently 3) number of
 /// required arguments.  Indexing into this table by the number
@@ -192,7 +262,9 @@
 /// index path (if present) is the canonical function type.
 final _fnTypeSmallMap = JS('', '[new Map(), new Map(), new Map()]');
 
-final FunctionType = JS('', '''
+final FunctionType = JS(
+    '',
+    '''
   class FunctionType extends $AbstractFunctionType {
     static _memoizeArray(map, arr, create) {
       let len = arr.length;
@@ -346,8 +418,9 @@
   }
 ''');
 
-
-final Typedef = JS('', '''
+final Typedef = JS(
+    '',
+    '''
   class Typedef extends $AbstractFunctionType {
     constructor(name, closure) {
       super();
@@ -391,7 +464,9 @@
 
 final _typeFormalCount = JS('', 'Symbol("_typeFormalCount")');
 
-_functionType(definite, returnType, args, extra) => JS('', '''(() => {
+_functionType(definite, returnType, args, extra) => JS(
+    '',
+    '''(() => {
   // TODO(jmesserly): this is a bit of a retrofit, to easily fit
   // generic functions into all of the existing ways we generate function
   // signatures. Given `(T) => [T, [T]]` we'll return a function that does
@@ -427,7 +502,9 @@
 
 typedef(name, closure) => JS('', 'new #(#, #)', Typedef, name, closure);
 
-typeName(type) => JS('', '''(() => {
+typeName(type) => JS(
+    '',
+    '''(() => {
   if ($type === void 0) return "undefined type";
   if ($type === null) return "null type";
   // Non-instance types
@@ -480,9 +557,16 @@
   return getMethodTypeFromType(type, 'call');
 }
 
-bool isFunctionType(type) =>
-    JS('bool', '# instanceof # || # === #',
-        type, AbstractFunctionType, type, Function);
+bool isFunctionType(type) => JS('bool', '# instanceof # || # === #', type,
+    AbstractFunctionType, type, Function);
+
+isLazyJSSubtype(LazyJSType t1, LazyJSType t2, covariant) {
+  if (t1 == t2) return true;
+
+  // All anonymous JS types are subtypes of each other.
+  if (t1._jsTypeCallback == null || t2._jsTypeCallback == null) return true;
+  return isClassSubType(t1._rawJSType, t2._rawJSType, covariant);
+}
 
 /// Returns true if [ft1] <: [ft2].
 /// Returns false if [ft1] </: [ft2] in both spec and strong mode
@@ -491,7 +575,9 @@
 /// If [covariant] is true, then we are checking subtyping in a covariant
 /// position, and hence the direction of the check for function types
 /// corresponds to the direction of the check according to the Dart spec.
-isFunctionSubtype(ft1, ft2, covariant) => JS('', '''(() => {
+isFunctionSubtype(ft1, ft2, covariant) => JS(
+    '',
+    '''(() => {
   if ($ft2 === $Function) {
     return true;
   }
@@ -571,7 +657,9 @@
 /// TODO(leafp): This duplicates code in operations.dart.
 /// I haven't found a way to factor it out that makes the
 /// code generator happy though.
-_subtypeMemo(f) => JS('', '''(() => {
+_subtypeMemo(f) => JS(
+    '',
+    '''(() => {
   let memo = new Map();
   return (t1, t2) => {
     let map = memo.get(t1);
@@ -592,14 +680,16 @@
 /// Returns false if [t1] </: [t2] in both spec and strong mode
 /// Returns undefined if [t1] </: [t2] in strong mode, but spec
 ///  mode may differ
-final isSubtype =
-    JS('', '$_subtypeMemo((t1, t2) => (t1 === t2) || $_isSubtype(t1, t2, true))');
+final isSubtype = JS(
+    '', '$_subtypeMemo((t1, t2) => (t1 === t2) || $_isSubtype(t1, t2, true))');
 
 _isBottom(type) => JS('bool', '# == #', type, bottom);
 
 _isTop(type) => JS('bool', '# == # || # == #', type, Object, type, dynamic);
 
-_isSubtype(t1, t2, covariant) => JS('', '''(() => {
+_isSubtype(t1, t2, covariant) => JS(
+    '',
+    '''(() => {
   if ($t1 === $t2) return true;
 
   // Trivially true.
@@ -633,10 +723,17 @@
   if ($isFunctionType($t1) && $isFunctionType($t2)) {
     return $isFunctionSubtype($t1, $t2, $covariant);
   }
+  
+  if ($t1 instanceof $LazyJSType && $t2 instanceof $LazyJSType) {
+    return $isLazyJSSubtype($t1, $t2, $covariant);
+  }
+  
   return false;
 })()''');
 
-isClassSubType(t1, t2, covariant) => JS('', '''(() => {
+isClassSubType(t1, t2, covariant) => JS(
+    '',
+    '''(() => {
   // We support Dart's covariant generics with the caveat that we do not
   // substitute bottom for dynamic in subtyping rules.
   // I.e., given T1, ..., Tn where at least one Ti != dynamic we disallow:
@@ -717,7 +814,9 @@
 // TODO(jmesserly): this isn't currently used, but it could be if we want
 // `obj is NonGroundType<T,S>` to be rejected at runtime instead of compile
 // time.
-isGroundType(type) => JS('', '''(() => {
+isGroundType(type) => JS(
+    '',
+    '''(() => {
   // TODO(vsm): Cache this if we start using it at runtime.
 
   if ($type instanceof $AbstractFunctionType) {
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/utils.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/utils.dart
index 0a3e176..a604423 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/utils.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/utils.dart
@@ -24,11 +24,13 @@
 /// This error indicates a strong mode specific failure, other than a type
 /// assertion failure (TypeError) or CastError.
 void throwStrongModeError(String message) {
+  JS('', 'debugger');
   JS('', 'throw new #(#);', StrongModeErrorImplementation, message);
 }
 
 /// This error indicates a bug in the runtime or the compiler.
 void throwInternalError(String message) {
+  JS('', 'debugger');
   JS('', 'throw Error(#)', message);
 }
 
diff --git a/pkg/dev_compiler/tool/input_sdk/private/interceptors.dart b/pkg/dev_compiler/tool/input_sdk/private/interceptors.dart
index 307726b..daa0e77 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/interceptors.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/interceptors.dart
@@ -44,18 +44,9 @@
  * have a type mask that contains the objects that we can use the
  * native JS [] operator and length on.
  */
-abstract class JSIndexable {
+abstract class JSIndexable<E> {
   int get length;
-  operator[](int index);
-}
-
-/**
- * The supertype for JSMutableArray and
- * JavaScriptIndexingBehavior. Used by the backend to have a type mask
- * that contains the objects we can use the JS []= operator on.
- */
-abstract class JSMutableIndexable extends JSIndexable {
-  operator[]=(int index, var value);
+  E operator[](int index);
 }
 
 /**
diff --git a/pkg/dev_compiler/tool/input_sdk/private/js_array.dart b/pkg/dev_compiler/tool/input_sdk/private/js_array.dart
index b937132..80a5289 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/js_array.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/js_array.dart
@@ -11,7 +11,7 @@
  * argument added to each member.
  */
 @JsPeerInterface(name: 'Array')
-class JSArray<E> implements List<E>, JSIndexable {
+class JSArray<E> implements List<E>, JSIndexable<E> {
 
   const JSArray();
 
@@ -587,7 +587,7 @@
  * these classes can have specialized implementations. Doing so will challenge
  * many assuptions in the JS backend.
  */
-class JSMutableArray<E> extends JSArray<E> implements JSMutableIndexable {}
+class JSMutableArray<E> extends JSArray<E> {}
 class JSFixedArray<E> extends JSMutableArray<E> {}
 class JSExtendableArray<E> extends JSMutableArray<E> {}
 class JSUnmodifiableArray<E> extends JSArray<E> {} // Already is JSIndexable.
diff --git a/pkg/dev_compiler/tool/input_sdk/private/js_helper.dart b/pkg/dev_compiler/tool/input_sdk/private/js_helper.dart
index 09e9a78..351d94d 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/js_helper.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/js_helper.dart
@@ -768,7 +768,7 @@
  * objects that support integer indexing. This interface is not
  * visible to anyone, and is only injected into special libraries.
  */
-abstract class JavaScriptIndexingBehavior extends JSMutableIndexable {
+abstract class JavaScriptIndexingBehavior {
 }
 
 // TODO(lrn): These exceptions should be implemented in core.
diff --git a/pkg/dev_compiler/tool/input_sdk/private/js_mirrors.dart b/pkg/dev_compiler/tool/input_sdk/private/js_mirrors.dart
index 84e5143..8560096 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/js_mirrors.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/js_mirrors.dart
@@ -71,60 +71,110 @@
   return JS('', '#.definiteFunctionType(#, [])', _dart, type);
 }
 
+dynamic _getMixins(type) {
+  return JS('', '#.getMixins(#, [])', _dart, type);
+}
+
 typedef T _Lazy<T>();
 
-Map _getConstructors(obj) {
+dynamic _getESSymbol(Symbol symbol) =>
+    _internal.Symbol.getNativeSymbol(symbol as _internal.Symbol);
+
+dynamic _getMember(Symbol symbol) {
+  var privateSymbol = _getESSymbol(symbol);
+  if (privateSymbol != null) {
+    return privateSymbol;
+  }
+  return getName(symbol);
+}
+
+String _getNameForESSymbol(member) {
+  // Convert private JS symbol "Symbol(_foo)" to string "_foo".
+  assert(JS('bool', 'typeof # == "symbol"', member));
+  var str = member.toString();
+  assert(str.startsWith('Symbol(') && str.endsWith(')'));
+  return str.substring(7, str.length - 1);
+}
+
+Symbol _getSymbolForESSymbol(member) {
+  var name = _getNameForESSymbol(member);
+  return new _internal.Symbol.es6(name, member);
+}
+
+// The [member] must be either a string (public) or an ES6 symbol (private).
+Symbol _getSymbolForMember(member) {
+  if (member is String) {
+    return new Symbol(member);
+  } else {
+    var name = _getNameForESSymbol(member);
+    return new _internal.Symbol.es6(name, member);
+  }
+}
+
+Map<Symbol, dynamic> _toDartMap(data) {
+  if (data == null) return {};
+  var map = new Map<Symbol, dynamic>();
+  // Note: we recorded a map from fields/methods to their type and metadata.
+  // The key is a string name for public members but an ES6 symbol for private
+  // ones.  That's works nicely for dynamic operations, but dart:mirrors expects
+  // Dart symbols, so we convert here.
+  var publicMembers = JS('', 'Object.getOwnPropertyNames(#)', data);
+  for (var member in publicMembers) {
+    var symbol = new Symbol(member);
+    map[symbol] = JS('', '#[#]', data, member);
+  }
+
+  var privateMembers = JS('', 'Object.getOwnPropertySymbols(#)', data);
+  for (var member in privateMembers) {
+    var symbol = _getSymbolForESSymbol(member);
+    map[symbol] = JS('', '#[#]', data, member);
+  }
+  return map;
+}
+
+Map<Symbol, dynamic> _getConstructors(obj) {
   List sig = JS('', '#.getConstructorSig(#)', _dart, obj);
-  if (sig == null) return {};
-  return JS('', '#.map(#)', _dart, sig);
+  return _toDartMap(sig);
 }
 
-Map _getFields(obj) {
+Map<Symbol, dynamic> _getFields(obj) {
   List sig = JS('', '#.getFieldSig(#)', _dart, obj);
-  if (sig == null) return {};
-  return JS('', '#.map(#)', _dart, sig);
+  return _toDartMap(sig);
 }
 
-Map _getMethods(obj) {
+Map<Symbol, dynamic> _getMethods(obj) {
   List sig = JS('', '#.getMethodSig(#)', _dart, obj);
-  if (sig == null) return {};
-  return JS('', '#.map(#)', _dart, sig);
+  return _toDartMap(sig);
 }
 
-Map _getGetters(obj) {
+Map<Symbol, dynamic> _getGetters(obj) {
   List sig = JS('', '#.getGetterSig(#)', _dart, obj);
-  if (sig == null) return {};
-  return JS('', '#.map(#)', _dart, sig);
+  return _toDartMap(sig);
 }
 
-Map _getSetters(obj) {
+Map<Symbol, dynamic> _getSetters(obj) {
   List sig = JS('', '#.getSetterSig(#)', _dart, obj);
-  if (sig == null) return {};
-  return JS('', '#.map(#)', _dart, sig);
+  return _toDartMap(sig);
 }
 
-Map _getStaticFields(obj) {
+Map<Symbol, dynamic> _getStaticFields(obj) {
   List sig = JS('', '#.getStaticFieldSig(#)', _dart, obj);
-  if (sig == null) return {};
-  return JS('', '#.map(#)', _dart, sig);
+  return _toDartMap(sig);
 }
 
-Map _getStatics(obj) {
+Map<Symbol, dynamic> _getStatics(obj) {
   List sig = JS('', '#.getStaticSig(#)', _dart, obj);
-  if (sig == null) return {};
-  return JS('', '#.map(#)', _dart, sig);
+  return _toDartMap(sig);
 }
 
-Map _getStaticGetters(obj) {
+Map<Symbol, dynamic> _getStaticGetters(obj) {
   List sig = JS('', '#.getStaticGetterSig(#)', _dart, obj);
-  if (sig == null) return {};
-  return JS('', '#.map(#)', _dart, sig);
+  return _toDartMap(sig);
 }
 
-Map _getStaticSetters(obj) {
+Map<Symbol, dynamic> _getStaticSetters(obj) {
   List sig = JS('', '#.getStaticSetterSig(#)', _dart, obj);
-  if (sig == null) return {};
-  return JS('', '#.map(#)', _dart, sig);
+  return _toDartMap(sig);
 }
 
 // TODO(vsm): These methods need to validate whether we really have a
@@ -134,8 +184,19 @@
 
 dynamic _wrap(obj) => JS('', '#.wrapType(#)', _dart, obj);
 
+dynamic _runtimeType(obj) =>
+  _wrap(JS('', '#.getReifiedType(#)', _dart, obj));
+
 _unimplemented(Type t, Invocation i) {
-  throw new UnimplementedError('$t.${i.memberName} unimplemented');
+  throw new UnimplementedError('$t.${getName(i.memberName)} unimplemented');
+}
+
+dynamic _toJsMap(Map<Symbol, dynamic> map) {
+  var obj = JS('', '{}');
+  map.forEach((Symbol key, value) {
+    JS('', '#[#] = #', obj, getName(key), value);
+  });
+  return obj;
 }
 
 class JsMirror implements Mirror {
@@ -169,7 +230,7 @@
     // The spec guarantees that `null` is the singleton instance of the `Null`
     // class.
     if (reflectee == null) return reflectClass(Null);
-    return reflectType(reflectee.runtimeType);
+    return reflectType(_runtimeType(reflectee));
   }
 
   JsInstanceMirror._(this.reflectee);
@@ -184,21 +245,27 @@
     return identityHashCode(reflectee) ^ 0x36363636;
   }
 
+  // Returns a String for public members or an ES6 symbol for private members.
+  _getAccessor(dynamic reflectee, Symbol symbol, [List<dynamic> args,
+      Map<Symbol, dynamic> namedArgs]) {
+    return _getMember(symbol);
+  }
+
   InstanceMirror getField(Symbol symbol) {
-    var name = getName(symbol);
+    var name = _getAccessor(reflectee, symbol);
     var field = _dload(reflectee, name);
     return reflect(field);
   }
 
   InstanceMirror setField(Symbol symbol, Object value) {
-    var name = getName(symbol);
+    var name = _getAccessor(reflectee, symbol);
     _dput(reflectee, name, value);
     return reflect(value);
   }
 
   InstanceMirror invoke(Symbol symbol, List<dynamic> args,
       [Map<Symbol, dynamic> namedArgs]) {
-    var name = getName(symbol);
+    var name = _getAccessor(reflectee, symbol, args, namedArgs);
     if (namedArgs != null) {
       args = new List.from(args);
       args.add(_toJsMap(namedArgs));
@@ -207,13 +274,7 @@
     return reflect(result);
   }
 
-  dynamic _toJsMap(Map<Symbol, dynamic> map) {
-    var obj = JS('', '{}');
-    map.forEach((Symbol key, value) {
-      JS('', '#[#] = #', obj, getName(key), value);
-    });
-    return obj;
-  }
+  String toString() => "InstanceMirror on '$reflectee'";
 }
 
 class JsClosureMirror extends JsInstanceMirror implements ClosureMirror {
@@ -237,7 +298,7 @@
   final dynamic _raw;
 
   // TODO(vsm): Do this properly
-  final ClassMirror mixin = null;
+  ClassMirror _mixin = null;
   List<TypeMirror> _typeArguments;
 
   List<InstanceMirror> _metadata;
@@ -246,7 +307,12 @@
   List<InstanceMirror> get metadata {
     if (_metadata == null) {
       // Load metadata.
-      var fn = JS('Function', '#[dart.metadata]', _unwrap(_cls));
+      var unwrapped = _unwrap(_cls);
+      // Only get metadata directly embedded on this class, not its
+      // superclasses.
+      var fn = JS('Function',
+        'Object.hasOwnProperty.call(#, dart.metadata) ? #[dart.metadata] : null',
+        unwrapped, unwrapped);
       _metadata = (fn == null)
           ? const <InstanceMirror>[]
           : new List<InstanceMirror>.unmodifiable(
@@ -262,67 +328,67 @@
       _declarations = new Map<Symbol, DeclarationMirror>();
       var unwrapped = _unwrap(_cls);
       var constructors = _getConstructors(unwrapped);
-      constructors.forEach((String name, ft) {
-        var symbol = new Symbol(name);
-        _declarations[symbol] = new JsMethodMirror._constructor(this, name, ft);
+      constructors.forEach((symbol, ft) {
+        var name = getName(symbol);
+        _declarations[symbol] = new JsMethodMirror._constructor(this, symbol, ft);
       });
       if (constructors.isEmpty) {
         // Add a default
         var name = 'new';
         var ft = _defaultConstructorType(_unwrap(_cls));
         var symbol = new Symbol(name);
-        _declarations[symbol] = new JsMethodMirror._constructor(this, name, ft);
+        _declarations[symbol] = new JsMethodMirror._constructor(this, symbol, ft);
       }
       var fields = _getFields(unwrapped);
-      fields.forEach((String name, t) {
-        var symbol = new Symbol(name);
+      fields.forEach((symbol, t) {
         var metadata = [];
         if (t is List) {
           metadata = t.skip(1).toList();
           t = t[0];
         }
-        _declarations[symbol] = new JsVariableMirror._(name, _wrap(t), metadata);
+        _declarations[symbol] = new JsVariableMirror._(symbol, _wrap(t), metadata);
       });
       var methods = _getMethods(unwrapped);
-      methods.forEach((String name, ft) {
-        var symbol = new Symbol(name);
-        _declarations[symbol] = new JsMethodMirror._instanceMethod(this, name, ft);
+      methods.forEach((symbol, ft) {
+        var name = getName(symbol);
+        _declarations[symbol] = new JsMethodMirror._instanceMethod(this, symbol, ft);
       });
       var getters = _getGetters(unwrapped);
-      getters.forEach((String name, ft) {
-        var symbol = new Symbol(name);
-        _declarations[symbol] = new JsMethodMirror._instanceMethod(this, name, ft);
+      getters.forEach((symbol, ft) {
+        var name = getName(symbol);
+        _declarations[symbol] = new JsMethodMirror._instanceMethod(this, symbol, ft);
       });
       var setters = _getSetters(unwrapped);
-      setters.forEach((String name, ft) {
-        name += '=';
-        var symbol = new Symbol(name);
-        _declarations[symbol] = new JsMethodMirror._instanceMethod(this, name, ft);
+      setters.forEach((symbol, ft) {
+        var name = getName(symbol) + '=';
+        // Create a separate symbol for the setter.
+        symbol = new _internal.Symbol.es6(name, _getESSymbol(symbol));
+        _declarations[symbol] = new JsMethodMirror._instanceMethod(this, symbol, ft);
       });
       var staticFields = _getStaticFields(unwrapped);
-      staticFields.forEach((String name, t) {
-        var symbol = new Symbol(name);
+      staticFields.forEach((symbol, t) {
+        var name = getName(symbol);
         var metadata = [];
         if (t is List) {
           metadata = t.skip(1).toList();
           t = t[0];
         }
-        _declarations[symbol] = new JsVariableMirror._(name, _wrap(t), metadata);
+        _declarations[symbol] = new JsVariableMirror._(symbol, _wrap(t), metadata);
       });
       var statics = _getStatics(unwrapped);
-      statics.forEach((String name, ft) {
-        var symbol = new Symbol(name);
-        _declarations[symbol] = new JsMethodMirror._staticMethod(this, name, ft);
+      statics.forEach((symbol, ft) {
+        var name = getName(symbol);
+        _declarations[symbol] = new JsMethodMirror._staticMethod(this, symbol, ft);
       });
       var staticGetters = _getStaticGetters(unwrapped);
-      staticGetters.forEach((String name, ft) {
-        var symbol = new Symbol(name);
-        _declarations[symbol] = new JsMethodMirror._staticMethod(this, name, ft);
+      staticGetters.forEach((symbol, ft) {
+        var name = getName(symbol);
+        _declarations[symbol] = new JsMethodMirror._staticMethod(this, symbol, ft);
       });
       var staticSetters = _getStaticSetters(unwrapped);
-      staticSetters.forEach((String name, ft) {
-        var symbol = new Symbol(name);
-        _declarations[symbol] = new JsMethodMirror._staticMethod(this, name, ft);
+      staticSetters.forEach((symbol, ft) {
+        var name = getName(symbol);
+        _declarations[symbol] = new JsMethodMirror._staticMethod(this, symbol, ft);
       });
       _declarations = new Map<Symbol, DeclarationMirror>.unmodifiable(_declarations);
     }
@@ -352,6 +418,32 @@
     return reflect(instance);
   }
 
+  // TODO(vsm): Need to check for NSM, types on accessors below.  Unlike the
+  // InstanceMirror case, there is no dynamic helper to delegate to - we never
+  // need a dload, etc. on a static.
+
+  InstanceMirror getField(Symbol symbol) {
+    var name = getName(symbol);
+    return reflect(JS('', '#[#]', _unwrap(_cls), name));
+  }
+
+  InstanceMirror setField(Symbol symbol, Object value) {
+    var name = getName(symbol);
+    JS('', '#[#] = #', _unwrap(_cls), name, value);
+    return reflect(value);
+  }
+
+  InstanceMirror invoke(Symbol symbol, List<dynamic> args,
+      [Map<Symbol, dynamic> namedArgs]) {
+    var name = getName(symbol);
+    if (namedArgs != null) {
+      args = new List.from(args);
+      args.add(_toJsMap(namedArgs));
+    }
+    var result = JS('', '#.#(...#)', _unwrap(_cls), name, args);
+    return reflect(result);
+  }
+
   List<ClassMirror> get superinterfaces {
     _Lazy<List<Type>> interfaceThunk = JS('', '#[dart.implements]', _unwrap(_cls));
     if (interfaceThunk == null) {
@@ -385,33 +477,60 @@
       return reflectType(_wrap(JS('Type', '#.__proto__', _unwrap(_cls))));
     }
   }
+
+  ClassMirror get mixin {
+    if (_mixin != null) {
+      return _mixin;
+    }
+    var mixins = _getMixins(_unwrap(_cls));
+    if (mixins == null || mixins.isEmpty) {
+      // If there is no mixin, return this mirror per API.
+      _mixin = this;
+      return _mixin;
+    }
+    if (mixins.length > 1) {
+      throw new UnsupportedError("ClassMirror.mixin not yet supported for "
+        "classes ($_cls) with multiple mixins");
+    }
+    _mixin = reflectType(_wrap(mixins[0]));
+    return _mixin;
+  }
+
+  String toString() => "ClassMirror on '$_cls'";
 }
 
 class JsVariableMirror extends JsMirror implements VariableMirror {
+  final Symbol _symbol;
   final String _name;
   final TypeMirror type;
   final List<InstanceMirror> metadata;
 
   // TODO(vsm): Refactor this out.
-  Symbol get simpleName => new Symbol(_name);
+  Symbol get simpleName => _symbol;
 
   // TODO(vsm): Fix this
   final bool isStatic = false;
   final bool isFinal = false;
 
-  JsVariableMirror._(this._name, Type t, List annotations)
-      : type = reflectType(t),
+  JsVariableMirror._(Symbol symbol, Type t, List annotations)
+      : _symbol = symbol,
+        _name = getName(symbol),
+        type = reflectType(t),
         metadata = new List<InstanceMirror>.unmodifiable(
             annotations.map((a) => reflect(a)));
+
+  String toString() => "VariableMirror on '$_name'";
 }
 
 class JsParameterMirror extends JsVariableMirror implements ParameterMirror {
-  JsParameterMirror._(String name, Type t, List annotations)
-      : super._(name, t, annotations);
+  JsParameterMirror._(Symbol member, Type t, List annotations)
+      : super._(member, t, annotations);
+
+  String toString() => "ParameterMirror on '$_name'";
 }
 
 class JsMethodMirror extends JsMirror implements MethodMirror {
-  // TODO(vsm): This could be a JS symbol for private methods
+  final Symbol _symbol;
   final String _name;
   List<ParameterMirror> _params;
   List<InstanceMirror> _metadata;
@@ -424,25 +543,25 @@
   bool get isPrivate => _name.startsWith('_');
 
   // TODO(vsm): Refactor this out.
-  Symbol get simpleName => new Symbol(_name);
+  Symbol get simpleName => _symbol;
 
-  JsMethodMirror._constructor(JsClassMirror cls, String name, ftype)
-    : _name = name, isConstructor = true, isStatic = false {
+  JsMethodMirror._constructor(JsClassMirror cls, Symbol symbol, ftype)
+    : _symbol = symbol, _name = getName(symbol), isConstructor = true, isStatic = false {
       _createParameterMirrorList(ftype);
   }
 
-  JsMethodMirror._instanceMethod(JsClassMirror cls, String name, ftype)
-    : _name = name, isConstructor = false, isStatic = false {
+  JsMethodMirror._instanceMethod(JsClassMirror cls, Symbol symbol, ftype)
+    : _symbol = symbol, _name = getName(symbol), isConstructor = false, isStatic = false {
       _createParameterMirrorList(ftype);
   }
 
-  JsMethodMirror._staticMethod(JsClassMirror cls, String name, ftype)
-    : _name = name, isConstructor = false, isStatic = true {
+  JsMethodMirror._staticMethod(JsClassMirror cls, Symbol symbol, ftype)
+    : _symbol = symbol, _name = getName(symbol), isConstructor = false, isStatic = true {
       _createParameterMirrorList(ftype);
   }
 
   // TODO(vsm): Support named constructors.
-  Symbol get constructorName => isConstructor ? new Symbol(_name) : null;
+  Symbol get constructorName => isConstructor ? _symbol : null;
   List<ParameterMirror> get parameters => _params;
   List<InstanceMirror> get metadata => _metadata;
 
@@ -453,7 +572,9 @@
       _metadata = const [];
       return;
     }
-    if (ftype is List) {
+
+    // TODO(vsm): Why does generic function type trigger true for List?
+    if (ftype is! Function && ftype is List) {
       // Record metadata
       _metadata = new List<InstanceMirror>.unmodifiable(
           ftype.skip(1).map((a) => reflect(a)));
@@ -462,6 +583,14 @@
       _metadata = const [];
     }
 
+    // TODO(vsm): Handle generic function types properly.  Or deprecate mirrors
+    // before we need to!
+    if (JS('bool', 'typeof(#) == "function"', ftype)) {
+      // Instantiate the generic version.
+      // TODO(vsm): Can't use arguments.length on arrow function.
+      ftype = JS('', '#.apply(null, #)', ftype, [dynamic, dynamic, dynamic]);
+    }
+
     // TODO(vsm): Add named args.
     List args = ftype.args;
     List opts = ftype.optionals;
@@ -471,7 +600,7 @@
       var type = args[i];
       var metadata = ftype.metadata[i];
       // TODO(vsm): Recover the param name.
-      var param = new JsParameterMirror._('', _wrap(type), metadata);
+      var param = new JsParameterMirror._(new Symbol(''), _wrap(type), metadata);
       params[i] = param;
     }
 
@@ -479,10 +608,12 @@
       var type = opts[i];
       var metadata = ftype.metadata[args.length + i];
       // TODO(vsm): Recover the param name.
-      var param = new JsParameterMirror._('', _wrap(type), metadata);
+      var param = new JsParameterMirror._(new Symbol(''), _wrap(type), metadata);
       params[i + args.length] = param;
     }
 
     _params = new List.unmodifiable(params);
   }
+
+  String toString() => "MethodMirror on '$_name'";
 }
diff --git a/pkg/dev_compiler/tool/input_sdk/private/js_string.dart b/pkg/dev_compiler/tool/input_sdk/private/js_string.dart
index 3a28309..3e8a7ca 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/js_string.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/js_string.dart
@@ -11,7 +11,7 @@
  * argument added to each member.
  */
 @JsPeerInterface(name: 'String')
-class JSString extends Interceptor implements String, JSIndexable {
+class JSString extends Interceptor implements String, JSIndexable<String> {
   const JSString();
 
   int codeUnitAt(int index) {
@@ -243,7 +243,7 @@
     return index;
   }
 
-  /// Finds the index after the the last non-whitespace character, or 0.
+  /// Finds the index after the last non-whitespace character, or 0.
   /// Start looking at position [index - 1].
   static int _skipTrailingWhitespace(String string, int index) {
     const int SPACE = 0x20;
diff --git a/pkg/dev_compiler/tool/input_sdk/private/native_typed_data.dart b/pkg/dev_compiler/tool/input_sdk/private/native_typed_data.dart
index 40c3f76..d823c36 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/native_typed_data.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/native_typed_data.dart
@@ -752,8 +752,7 @@
 
 abstract class NativeTypedArray extends NativeTypedData
     implements JavaScriptIndexingBehavior {
-  // TODO(jmesserly): moved `length` to subclass to (somewhat) mitigate
-  // <https://github.com/dart-lang/dev_compiler/issues/138>
+  int get length;
 
   void _setRangeFast(int start, int end,
       NativeTypedArray source, int skipCount) {
diff --git a/pkg/dev_compiler/tool/patch_sdk.dart b/pkg/dev_compiler/tool/patch_sdk.dart
index 3c7e543..00ec5db 100755
--- a/pkg/dev_compiler/tool/patch_sdk.dart
+++ b/pkg/dev_compiler/tool/patch_sdk.dart
@@ -14,8 +14,8 @@
 import 'package:path/path.dart' as path;
 
 void main(List<String> argv) {
+  var self = path.relative(path.fromUri(Platform.script));
   if (argv.length < 2) {
-    var self = path.relative(path.fromUri(Platform.script));
     var toolDir = path.relative(path.dirname(path.fromUri(Platform.script)));
 
     var inputExample = path.join(toolDir, 'input_sdk');
@@ -28,6 +28,8 @@
     exit(1);
   }
 
+  var selfModifyTime = new File(self).lastModifiedSync().millisecondsSinceEpoch;
+
   var input = argv[0];
   var sdkLibIn = path.join(input, 'lib');
   var patchIn = path.join(input, 'patch');
@@ -71,8 +73,8 @@
       var outPaths = <String>[libraryOut];
       var libraryContents = libraryFile.readAsStringSync();
 
-      int inputModifyTime =
-          libraryFile.lastModifiedSync().millisecondsSinceEpoch;
+      int inputModifyTime = math.max(selfModifyTime,
+          libraryFile.lastModifiedSync().millisecondsSinceEpoch);
       var partFiles = <File>[];
       for (var part in parseDirectives(libraryContents).directives) {
         if (part is PartDirective) {
@@ -263,6 +265,15 @@
     int start = patchMeta.endToken.next.offset;
     var code = patch.contents.substring(start, patchNode.end);
 
+    // Const factory constructors can't be legally parsed from the patch file,
+    // so we need to omit the "const" there, but still preserve it.
+    if (node is ConstructorDeclaration &&
+        node.constKeyword != null &&
+        patchNode is ConstructorDeclaration &&
+        patchNode.constKeyword == null) {
+      code = 'const $code';
+    }
+
     // For some node like static fields, the node's offset doesn't include
     // the external keyword. Also starting from the keyword lets us preserve
     // documentation comments.
diff --git a/pkg/dev_compiler/tool/run.js b/pkg/dev_compiler/tool/run.js
index 4d186072..7306964 100644
--- a/pkg/dev_compiler/tool/run.js
+++ b/pkg/dev_compiler/tool/run.js
@@ -2,24 +2,52 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+/// This is a utility to run and debug an individual DDC compiled test.
+/// Tests can be run with either node or devtool (a Chrome-based utility with
+/// DOM APIs and developer tools support).
+///
+/// Install devtool via:
+/// > npm install -g devtool
+///
+/// Run via:
+/// > devtool tool/run.js -- corelib/apply2_test
+/// or
+/// > node tool/run.js corelib/apply2_test
+///
+/// See TODO below on async / unittest support. 
+
 var args = process.argv.slice(2);
 if (args.length != 1) {
-  throw new Error("Usage: node test/run.js <test-module-name>");
+  throw new Error("Usage: devtool tool/run.js <test-module-name>");
 }
 var test = args[0];
 
 var requirejs = require('requirejs');
-var ddcdir = __dirname + '/..';
+var ddcdir = __dirname + '/../';
 requirejs.config({
-  baseUrl: ddcdir + '/gen/codegen_output',
+  baseUrl: ddcdir + 'gen/codegen_output',
   paths: {
-    dart_sdk: ddcdir + '/lib/js/amd/dart_sdk'
+    dart_sdk: ddcdir + 'lib/js/amd/dart_sdk',
+    async_helper: ddcdir + 'gen/codegen_output/pkg/async_helper',
+    expect: ddcdir + 'gen/codegen_output/pkg/expect',
+    js: ddcdir + 'gen/codegen_output/pkg/js',
+    matcher: ddcdir + 'gen/codegen_output/pkg/matcher',
+    minitest: ddcdir + 'gen/codegen_output/pkg/minitest',
+    path: ddcdir + 'gen/codegen_output/pkg/path',
+    stack_trace: ddcdir + 'gen/codegen_output/pkg/stack_trace',
+    unittest: ddcdir + 'gen/codegen_output/pkg/unittest',
   }
 });
 
 // TODO(vsm): Factor out test framework code in test/browser/language_tests.js
 // and use here.  Async tests and unittests won't work without it.
-
+var sdk = requirejs('dart_sdk');
 var module = requirejs(test);
-test = test.split('/').slice(-1)[0];
-module[test].main();
+var lib = test.split('/').slice(-1)[0];
+try {
+  module[lib].main();
+  console.log('Test ' + test + ' passed.');
+} catch (e) {
+  console.log('Test ' + test + ' failed:\n' + e.toString());
+  sdk.dart.stackPrint(e);
+}
diff --git a/pkg/dev_compiler/tool/sdk_expected_errors.txt b/pkg/dev_compiler/tool/sdk_expected_errors.txt
index a7b684d..80eacbc 100644
--- a/pkg/dev_compiler/tool/sdk_expected_errors.txt
+++ b/pkg/dev_compiler/tool/sdk_expected_errors.txt
@@ -1,195 +1,106 @@
-[error] Base class introduces an invalid override. The type of JSArray.[]= ((int, E) → void) is not a subtype of JSMutableIndexable.[]= ((int, dynamic) → dynamic). (dart:_interceptors/js_array.dart, line 590, col 25)
-[error] Invalid override. The type of NativeTypedArrayOfDouble.[]= ((int, num) → void) is not a subtype of JSMutableIndexable.[]= ((int, dynamic) → dynamic). (dart:_native_typed_data, line 793, col 3)
-[error] Could not infer type parameter T, _ControllerEventSinkWrapper<dynamic> must be of type EventSink<T>. (dart:async/stream.dart, line 1346, col 16)
-[error] The argument type '_ControllerEventSinkWrapper' cannot be assigned to the parameter type 'EventSink<T>'. (dart:async/stream.dart, line 1346, col 53)
-[error] Invalid override. The type of ChunkedConverter.bind ((dynamic) → dynamic) is not a subtype of Converter<S, T>.bind ((Stream<S>) → Stream<T>). (dart:convert/chunked_conversion.dart, line 14, col 3)
-[error] Invalid override. The type of ChunkedConverter.bind ((dynamic) → dynamic) is not a subtype of StreamTransformer<S, T>.bind ((Stream<S>) → Stream<T>). (dart:convert/chunked_conversion.dart, line 14, col 3)
-[error] Invalid override. The type of ChunkedConverter.startChunkedConversion ((dynamic) → dynamic) is not a subtype of Converter<S, T>.startChunkedConversion ((Sink<T>) → Sink<S>). (dart:convert/chunked_conversion.dart, line 15, col 3)
-[error] Invalid override. The type of FileList.[]= ((int, File) → void) is not a subtype of JSMutableIndexable.[]= ((int, dynamic) → dynamic). (dart:html, line 16868, col 3)
-[error] Invalid override. The type of HtmlCollection.[]= ((int, Node) → void) is not a subtype of JSMutableIndexable.[]= ((int, dynamic) → dynamic). (dart:html, line 18903, col 3)
-[error] Invalid override. The type of MimeTypeArray.[]= ((int, MimeType) → void) is not a subtype of JSMutableIndexable.[]= ((int, dynamic) → dynamic). (dart:html, line 23817, col 3)
-[error] Invalid override. The type of NodeList.[]= ((int, Node) → void) is not a subtype of JSMutableIndexable.[]= ((int, dynamic) → dynamic). (dart:html, line 25466, col 3)
-[error] Invalid override. The type of PluginArray.[]= ((int, Plugin) → void) is not a subtype of JSMutableIndexable.[]= ((int, dynamic) → dynamic). (dart:html, line 26970, col 3)
-[error] Invalid override. The type of SourceBufferList.[]= ((int, SourceBuffer) → void) is not a subtype of JSMutableIndexable.[]= ((int, dynamic) → dynamic). (dart:html, line 30208, col 3)
-[error] Invalid override. The type of SpeechGrammarList.[]= ((int, SpeechGrammar) → void) is not a subtype of JSMutableIndexable.[]= ((int, dynamic) → dynamic). (dart:html, line 30409, col 3)
-[error] Invalid override. The type of TextTrackList.[]= ((int, TextTrack) → void) is not a subtype of JSMutableIndexable.[]= ((int, dynamic) → dynamic). (dart:html, line 32568, col 3)
-[error] Invalid override. The type of TouchList.[]= ((int, Touch) → void) is not a subtype of JSMutableIndexable.[]= ((int, dynamic) → dynamic). (dart:html, line 32903, col 3)
-[error] Invalid override. The type of _CssRuleList.[]= ((int, CssRule) → void) is not a subtype of JSMutableIndexable.[]= ((int, dynamic) → dynamic). (dart:html, line 37674, col 3)
-[error] Invalid override. The type of _GamepadList.[]= ((int, Gamepad) → void) is not a subtype of JSMutableIndexable.[]= ((int, dynamic) → dynamic). (dart:html, line 37928, col 3)
-[error] Invalid override. The type of _NamedNodeMap.[]= ((int, Node) → void) is not a subtype of JSMutableIndexable.[]= ((int, dynamic) → dynamic). (dart:html, line 38135, col 3)
-[error] Invalid override. The type of _SpeechRecognitionResultList.[]= ((int, SpeechRecognitionResult) → void) is not a subtype of JSMutableIndexable.[]= ((int, dynamic) → dynamic). (dart:html, line 38351, col 3)
-[error] Invalid override. The type of _StyleSheetList.[]= ((int, StyleSheet) → void) is not a subtype of JSMutableIndexable.[]= ((int, dynamic) → dynamic). (dart:html, line 38415, col 3)
-[error] Invalid override. The type of _EventStreamSubscription.asFuture (([dynamic]) → Future<dynamic>) is not a subtype of StreamSubscription<T>.asFuture (<E>([E]) → Future<E>). (dart:html, line 40152, col 3)
-[error] Invalid override. The type of JsArray.[]= ((Object, E) → void) is not a subtype of JsObject.[]= ((Object, dynamic) → dynamic). (dart:js, line 363, col 3)
-[error] The return type 'double' is not a 'T', as defined by the method 'min'. (dart:math, line 90, col 16)
-[error] The return type 'double' is not a 'T', as defined by the method 'min'. (dart:math, line 94, col 51)
-[error] The return type 'double' is not a 'T', as defined by the method 'max'. (dart:math, line 125, col 16)
-[error] The return type 'double' is not a 'T', as defined by the method 'max'. (dart:math, line 129, col 25)
-[warning] Unsound implicit cast from dynamic to List<String> (dart:_debugger, line 39, col 45)
-[warning] Unsound implicit cast from dynamic to List<NameValuePair> (dart:_debugger, line 750, col 43)
-[warning] Unsound implicit cast from dynamic to List<String> (dart:_isolate_helper, line 839, col 37)
-[warning] Unsound implicit cast from dynamic to List<String> (dart:_isolate_helper, line 886, col 11)
-[warning] Unsound implicit cast from dynamic to E (dart:_interceptors/js_array.dart, line 117, col 12)
-[warning] Unsound implicit cast from dynamic to E (dart:_interceptors/js_array.dart, line 159, col 17)
-[warning] Unsound implicit cast from dynamic to E (dart:_interceptors/js_array.dart, line 167, col 17)
-[warning] Unsound implicit cast from dynamic to E (dart:_interceptors/js_array.dart, line 198, col 27)
-[warning] Unsound implicit cast from dynamic to E (dart:_interceptors/js_array.dart, line 239, col 27)
-[warning] Unsound implicit cast from dynamic to E (dart:_interceptors/js_array.dart, line 252, col 27)
-[warning] Unsound implicit cast from dynamic to E (dart:_interceptors/js_array.dart, line 264, col 27)
-[warning] Unsound implicit cast from dynamic to E (dart:_interceptors/js_array.dart, line 277, col 27)
-[warning] Unsound implicit cast from dynamic to E (dart:_interceptors/js_array.dart, line 295, col 16)
-[warning] Unsound implicit cast from dynamic to E (dart:_interceptors/js_array.dart, line 300, col 17)
-[warning] Unsound implicit cast from dynamic to E (dart:_interceptors/js_array.dart, line 443, col 27)
-[warning] Unsound implicit cast from dynamic to E (dart:_interceptors/js_array.dart, line 455, col 27)
-[warning] Unsound implicit cast from dynamic to E (dart:_interceptors/js_array.dart, line 564, col 12)
-[warning] Unsound implicit cast from dynamic to JSArray<String> (dart:_js_helper, line 79, col 37)
-[warning] Unsound implicit cast from dynamic to E (dart:_js_helper, line 882, col 16)
-[warning] Unsound implicit cast from dynamic to () → List<Type> (dart:_js_mirrors, line 356, col 40)
-[warning] Unsound implicit cast from dynamic to List<String> (dart:_interceptors/js_string.dart, line 92, col 14)
-[warning] Unsound implicit cast from dynamic to List<String> (dart:_interceptors/js_string.dart, line 95, col 14)
-[warning] Unsound implicit cast from dynamic to LinkedHashMapCell<K, V> (dart:_js_helper/linked_hash_map.dart, line 119, col 40)
-[warning] Unsound implicit cast from dynamic to LinkedHashMapCell<K, V> (dart:_js_helper/linked_hash_map.dart, line 148, col 44)
-[warning] Unsound implicit cast from dynamic to LinkedHashMapCell<K, V> (dart:_js_helper/linked_hash_map.dart, line 183, col 9)
-[warning] Unsound implicit cast from dynamic to LinkedHashMapCell<K, V> (dart:_js_helper/linked_hash_map.dart, line 299, col 42)
-[warning] Unsound implicit cast from dynamic to LinkedHashMapCell<K, V> (dart:_js_helper/linked_hash_map.dart, line 308, col 12)
-[warning] Unsound implicit cast from dynamic to List<LinkedHashMapCell<K, V>> (dart:_js_helper/linked_hash_map.dart, line 312, col 12)
-[warning] Unsound implicit cast from dynamic to LinkedHashMapCell<K, V> (dart:_js_helper/linked_hash_map.dart, line 346, col 12)
-[warning] Unsound implicit cast from dynamic to List<LinkedHashMapCell<K, V>> (dart:_js_helper/linked_hash_map.dart, line 351, col 12)
-[warning] Unsound implicit cast from dynamic to List<String> (dart:_js_helper/regexp_helper.dart, line 108, col 22)
-[warning] Unsound implicit cast from List<dynamic> to List<String> (dart:_js_helper/regexp_helper.dart, line 140, col 43)
-[warning] Unsound implicit cast from List<dynamic> to List<String> (dart:_js_helper/regexp_helper.dart, line 152, col 43)
-[warning] Unsound implicit cast from dynamic to V (dart:collection, line 105, col 14)
-[warning] Unsound implicit cast from dynamic to V (dart:collection, line 108, col 14)
-[warning] Unsound implicit cast from dynamic to V (dart:collection, line 119, col 12)
-[warning] Unsound implicit cast from dynamic to V (dart:collection, line 186, col 12)
-[warning] Unsound implicit cast from dynamic to K (dart:collection, line 200, col 14)
-[warning] Unsound implicit cast from dynamic to V (dart:collection, line 268, col 17)
-[warning] Unsound implicit cast from dynamic to K (dart:collection, line 404, col 49)
-[warning] Unsound implicit cast from dynamic to K (dart:collection, line 411, col 19)
-[warning] Unsound implicit cast from Object to K (dart:collection, line 411, col 49)
-[warning] Unsound implicit cast from dynamic to E (dart:collection, line 436, col 9)
-[warning] Unsound implicit cast from dynamic to E (dart:collection, line 462, col 18)
-[warning] Unsound implicit cast from dynamic to LinkedHashMapCell<K, V> (dart:collection, line 495, col 42)
-[warning] Unsound implicit cast from dynamic to V (dart:collection, line 532, col 12)
-[warning] Unsound implicit cast from dynamic to K (dart:collection, line 569, col 14)
-[warning] Unsound implicit cast from dynamic to V (dart:collection, line 569, col 19)
-[warning] Unsound implicit cast from dynamic to E (dart:collection, line 614, col 9)
-[warning] Unsound implicit cast from dynamic to E (dart:collection, line 653, col 18)
-[warning] Unsound implicit cast from dynamic to K (dart:collection, line 689, col 49)
-[warning] Unsound implicit cast from dynamic to LinkedHashMapCell<K, V> (dart:collection, line 696, col 42)
-[warning] Unsound implicit cast from dynamic to K (dart:collection, line 697, col 40)
-[warning] Unsound implicit cast from Object to E (dart:collection, line 758, col 14)
-[warning] Unsound implicit cast from dynamic to List<E> (dart:collection, line 951, col 12)
-[warning] Unsound implicit cast from dynamic to E (dart:collection, line 1009, col 21)
-[warning] Unsound implicit cast from dynamic to E (dart:collection, line 1009, col 51)
-[warning] Unsound implicit cast from dynamic to E (dart:collection, line 1019, col 47)
-[warning] Unsound implicit cast from dynamic to E (dart:collection, line 1058, col 18)
-[warning] Unsound implicit cast from Object to E (dart:collection, line 1135, col 14)
-[warning] Unsound implicit cast from dynamic to _LinkedHashSetCell<E> (dart:collection, line 1222, col 38)
-[warning] Unsound implicit cast from dynamic to _LinkedHashSetCell<E> (dart:collection, line 1337, col 12)
-[warning] Unsound implicit cast from dynamic to List<_LinkedHashSetCell<E>> (dart:collection, line 1351, col 12)
-[warning] Unsound implicit cast from dynamic to _LinkedHashSetCell<E> (dart:collection, line 1358, col 40)
-[warning] Unsound implicit cast from dynamic to _LinkedHashSetCell<E> (dart:collection, line 1391, col 40)
-[warning] Unsound implicit cast from dynamic to _LinkedHashSetCell<E> (dart:collection, line 1412, col 40)
-[warning] Unsound implicit cast from dynamic to E (dart:collection, line 1413, col 36)
-[warning] Unsound implicit cast from dynamic to E (dart:collection, line 1423, col 47)
-[warning] Unsound implicit cast from dynamic to E (dart:collection, line 1485, col 18)
-[warning] Unsound implicit cast from dynamic to Stream<S> (dart:convert/chunked_conversion.dart, line 14, col 45)
-[warning] Unsound implicit cast from dynamic to Sink<T> (dart:convert/chunked_conversion.dart, line 16, col 36)
-[warning] Unsound implicit cast from dynamic to List<String> (dart:convert, line 311, col 12)
-[warning] Unsound implicit cast from dynamic to T (dart:core/expando.dart, line 55, col 12)
-[warning] Unsound implicit cast from dynamic to E (dart:core/list.dart, line 126, col 16)
-[warning] The final variable 'origin' must be initialized (dart:html, line 177, col 3)
-[warning] The final variable 'origin' must be initialized (dart:html, line 813, col 3)
-[warning] Unsound implicit cast from dynamic to List<String> (dart:html, line 1145, col 33)
-[warning] The final variables 'form', 'labels' and '3' more must be initialized (dart:html, line 1691, col 3)
-[warning] Unsound implicit cast from dynamic to List<num> (dart:html, line 2723, col 14)
-[warning] Unsound implicit cast from dynamic to List<num> (dart:html, line 2725, col 14)
-[warning] The final variable 'options' must be initialized (dart:html, line 8972, col 3)
-[warning] The final variables '_attributes', '_childElementCount' and '16' more must be initialized (dart:html, line 13009, col 3)
-[warning] The final variables 'elements', 'form' and '4' more must be initialized (dart:html, line 16625, col 3)
-[warning] The final variable 'length' must be initialized (dart:html, line 17555, col 3)
-[warning] The final variables '_get_contentWindow' and 'sandbox' must be initialized (dart:html, line 20113, col 3)
-[warning] The final variables 'complete', 'currentSrc' and '2' more must be initialized (dart:html, line 20246, col 3)
-[warning] The final variables '_get_valueAsDate', 'entries' and '6' more must be initialized (dart:html, line 20400, col 3)
-[warning] The final variables 'form', 'labels' and '4' more must be initialized (dart:html, line 21436, col 3)
-[warning] The final variables 'control' and 'form' must be initialized (dart:html, line 21547, col 3)
-[warning] The final variable 'form' must be initialized (dart:html, line 21581, col 3)
-[warning] The final variables 'import', 'sheet' and '1' more must be initialized (dart:html, line 21607, col 3)
-[warning] The final variable 'areas' must be initialized (dart:html, line 21759, col 3)
-[warning] The final variables 'audioDecodedByteCount', 'audioTracks' and '16' more must be initialized (dart:html, line 21985, col 3)
-[warning] The final variable 'labels' must be initialized (dart:html, line 23501, col 3)
-[warning] The final variables '_localName', '_namespaceUri' and '12' more must be initialized (dart:html, line 24939, col 3)
-[warning] The final variables 'form', 'validationMessage' and '2' more must be initialized (dart:html, line 25820, col 3)
-[warning] The final variables 'form' and 'index' must be initialized (dart:html, line 25955, col 3)
-[warning] The final variables 'form', 'htmlFor' and '5' more must be initialized (dart:html, line 26009, col 3)
-[warning] The final variables 'labels' and 'position' must be initialized (dart:html, line 27415, col 3)
-[warning] The final variables 'form', 'labels' and '4' more must be initialized (dart:html, line 29186, col 3)
-[warning] The final variable 'sheet' must be initialized (dart:html, line 31442, col 3)
-[warning] The final variable 'cellIndex' must be initialized (dart:html, line 31662, col 3)
-[warning] The final variables '_rows' and '_tBodies' must be initialized (dart:html, line 31773, col 3)
-[warning] The final variables '_cells', 'rowIndex' and '1' more must be initialized (dart:html, line 31883, col 3)
-[warning] The final variable '_rows' must be initialized (dart:html, line 31950, col 3)
-[warning] The final variable 'content' must be initialized (dart:html, line 31993, col 3)
-[warning] The final variables 'form', 'labels' and '5' more must be initialized (dart:html, line 32069, col 3)
-[warning] The final variables 'readyState' and 'track' must be initialized (dart:html, line 33056, col 3)
-[warning] The final variables 'decodedFrameCount', 'droppedFrameCount' and '2' more must be initialized (dart:html, line 33754, col 3)
-[warning] Unsound implicit cast from dynamic to Rectangle<num> (dart:html, line 37618, col 14)
-[warning] Unsound implicit cast from dynamic to Rectangle<num> (dart:html, line 37626, col 14)
-[warning] Unsound implicit cast from dynamic to Rectangle<num> (dart:html, line 37634, col 14)
-[warning] Unsound implicit cast from (T) → void to (Event) → dynamic (dart:html, line 40090, col 67)
-[warning] Unsound implicit cast from (T) → void to (Event) → dynamic (dart:html, line 40112, col 45)
-[warning] Unsound implicit cast from num to T (dart:math/rectangle.dart, line 151, col 22)
-[warning] Unsound implicit cast from num to T (dart:math/rectangle.dart, line 152, col 23)
-[warning] Unsound implicit cast from num to T (dart:math/rectangle.dart, line 275, col 10)
-[warning] The final variables 'href' and 'target' must be initialized (dart:svg, line 60, col 3)
-[warning] The final variables 'requiredExtensions', 'requiredFeatures' and '2' more must be initialized (dart:svg, line 489, col 3)
-[warning] The final variables 'cx', 'cy' and '1' more must be initialized (dart:svg, line 562, col 3)
-[warning] The final variable 'clipPathUnits' must be initialized (dart:svg, line 597, col 3)
-[warning] The final variables 'cx', 'cy' and '2' more must be initialized (dart:svg, line 689, col 3)
-[warning] The final variables 'height', 'in1' and '6' more must be initialized (dart:svg, line 732, col 3)
-[warning] The final variables 'height', 'in1' and '6' more must be initialized (dart:svg, line 820, col 3)
-[warning] The final variables 'height', 'in1' and '4' more must be initialized (dart:svg, line 904, col 3)
-[warning] The final variables 'height', 'in1' and '10' more must be initialized (dart:svg, line 952, col 3)
-[warning] The final variables 'bias', 'divisor' and '15' more must be initialized (dart:svg, line 1057, col 3)
-[warning] The final variables 'diffuseConstant', 'height' and '8' more must be initialized (dart:svg, line 1173, col 3)
-[warning] The final variables 'height', 'in1' and '8' more must be initialized (dart:svg, line 1245, col 3)
-[warning] The final variables 'azimuth' and 'elevation' must be initialized (dart:svg, line 1337, col 3)
-[warning] The final variables 'height', 'result' and '3' more must be initialized (dart:svg, line 1375, col 3)
-[warning] The final variables 'height', 'in1' and '6' more must be initialized (dart:svg, line 1547, col 3)
-[warning] The final variables 'height', 'href' and '5' more must be initialized (dart:svg, line 1615, col 3)
-[warning] The final variables 'height', 'result' and '3' more must be initialized (dart:svg, line 1677, col 3)
-[warning] The final variable 'in1' must be initialized (dart:svg, line 1729, col 3)
-[warning] The final variables 'height', 'in1' and '7' more must be initialized (dart:svg, line 1759, col 3)
-[warning] The final variables 'dx', 'dy' and '6' more must be initialized (dart:svg, line 1836, col 3)
-[warning] The final variables 'x', 'y' and '1' more must be initialized (dart:svg, line 1900, col 3)
-[warning] The final variables 'height', 'in1' and '9' more must be initialized (dart:svg, line 1942, col 3)
-[warning] The final variables 'limitingConeAngle', 'pointsAtX' and '6' more must be initialized (dart:svg, line 2020, col 3)
-[warning] The final variables 'height', 'in1' and '4' more must be initialized (dart:svg, line 2082, col 3)
-[warning] The final variables 'baseFrequencyX', 'baseFrequencyY' and '9' more must be initialized (dart:svg, line 2138, col 3)
-[warning] The final variables 'filterUnits', 'height' and '5' more must be initialized (dart:svg, line 2238, col 3)
-[warning] The final variables 'height', 'width' and '2' more must be initialized (dart:svg, line 2335, col 3)
-[warning] The final variables 'farthestViewportElement', 'nearestViewportElement' and '4' more must be initialized (dart:svg, line 2425, col 3)
-[warning] The final variables 'height', 'href' and '4' more must be initialized (dart:svg, line 2507, col 3)
-[warning] The final variables 'x1', 'x2' and '2' more must be initialized (dart:svg, line 2736, col 3)
-[warning] The final variables 'x1', 'x2' and '2' more must be initialized (dart:svg, line 2775, col 3)
-[warning] The final variables 'markerHeight', 'markerUnits' and '7' more must be initialized (dart:svg, line 2814, col 3)
-[warning] The final variables 'height', 'maskContentUnits' and '7' more must be initialized (dart:svg, line 2907, col 3)
-[warning] The final variables 'animatedNormalizedPathSegList', 'animatedPathSegList' and '3' more must be initialized (dart:svg, line 3188, col 3)
-[warning] The final variables 'height', 'href' and '11' more must be initialized (dart:svg, line 4017, col 3)
-[warning] The final variables 'animatedPoints' and 'points' must be initialized (dart:svg, line 4182, col 3)
-[warning] The final variables 'animatedPoints' and 'points' must be initialized (dart:svg, line 4213, col 3)
-[warning] The final variables 'cx', 'cy' and '4' more must be initialized (dart:svg, line 4321, col 3)
-[warning] The final variables 'height', 'rx' and '4' more must be initialized (dart:svg, line 4397, col 3)
-[warning] The final variable 'href' must be initialized (dart:svg, line 4444, col 3)
-[warning] The final variable 'gradientOffset' must be initialized (dart:svg, line 4506, col 3)
-[warning] The final variable 'sheet' must be initialized (dart:svg, line 4634, col 3)
-[warning] The final variables 'ownerSvgElement' and 'viewportElement' must be initialized (dart:svg, line 5072, col 3)
-[warning] The final variables 'currentTranslate', 'currentView' and '12' more must be initialized (dart:svg, line 5386, col 3)
-[warning] The final variables 'preserveAspectRatio' and 'viewBox' must be initialized (dart:svg, line 5605, col 3)
-[warning] The final variables 'lengthAdjust' and 'textLength' must be initialized (dart:svg, line 5677, col 3)
-[warning] The final variables 'href', 'method' and '2' more must be initialized (dart:svg, line 5775, col 3)
-[warning] The final variables 'dx', 'dy' and '3' more must be initialized (dart:svg, line 5836, col 3)
-[warning] The final variables 'height', 'href' and '3' more must be initialized (dart:svg, line 6126, col 3)
-[warning] The final variables 'preserveAspectRatio', 'viewBox' and '1' more must be initialized (dart:svg, line 6171, col 3)
-[warning] The final variables 'gradientTransform', 'gradientUnits' and '2' more must be initialized (dart:svg, line 6325, col 3)
+[error] Couldn't infer type parameter 'T'; '_ControllerEventSinkWrapper<dynamic>' must be of type 'EventSink<T>'. (dart:async/stream.dart, line 1346, col 16)
+[error] The argument type '_ControllerEventSinkWrapper' can't be assigned to the parameter type 'EventSink<T>'. (dart:async/stream.dart, line 1346, col 53)
+[error] Invalid override. The type of 'ChunkedConverter.bind' ('(dynamic) → dynamic') isn't a subtype of 'Converter<S, T>.bind' ('(Stream<S>) → Stream<T>'). (dart:convert/chunked_conversion.dart, line 14, col 3)
+[error] Invalid override. The type of 'ChunkedConverter.bind' ('(dynamic) → dynamic') isn't a subtype of 'StreamTransformer<S, T>.bind' ('(Stream<S>) → Stream<T>'). (dart:convert/chunked_conversion.dart, line 14, col 3)
+[error] Invalid override. The type of 'ChunkedConverter.startChunkedConversion' ('(dynamic) → dynamic') isn't a subtype of 'Converter<S, T>.startChunkedConversion' ('(Sink<T>) → Sink<S>'). (dart:convert/chunked_conversion.dart, line 15, col 3)
+[error] Only redirecting factory constructors can be declared to be 'const'. (dart:core/bool.dart, line 41, col 9)
+[error] Const constructors can't throw exceptions. (dart:core/bool.dart, line 42, col 5)
+[error] Only redirecting factory constructors can be declared to be 'const'. (dart:core/int.dart, line 33, col 9)
+[error] Const constructors can't throw exceptions. (dart:core/int.dart, line 34, col 5)
+[error] Only redirecting factory constructors can be declared to be 'const'. (dart:core/string.dart, line 156, col 9)
+[error] Const constructors can't throw exceptions. (dart:core/string.dart, line 157, col 5)
+[error] Invalid override. The type of '_EventStreamSubscription.asFuture' ('([dynamic]) → Future<dynamic>') isn't a subtype of 'StreamSubscription<T>.asFuture' ('<E>([E]) → Future<E>'). (dart:html, line 40152, col 3)
+[error] Invalid override. The type of 'JsArray.[]=' ('(Object, E) → void') isn't a subtype of 'JsObject.[]=' ('(Object, dynamic) → dynamic'). (dart:js, line 363, col 3)
+[warning] Unsafe implicit cast from 'List<dynamic>' to 'List<String>'. This usually indicates that type information was lost and resulted in 'dynamic' and/or a place that will have a failure at runtime. (dart:_js_helper/regexp_helper.dart, line 140, col 43)
+[warning] Unsafe implicit cast from 'List<dynamic>' to 'List<String>'. This usually indicates that type information was lost and resulted in 'dynamic' and/or a place that will have a failure at runtime. (dart:_js_helper/regexp_helper.dart, line 152, col 43)
+[warning] Unsafe implicit cast from 'Object' to 'K'. This usually indicates that type information was lost and resulted in 'dynamic' and/or a place that will have a failure at runtime. (dart:collection, line 411, col 49)
+[warning] Unsafe implicit cast from 'Object' to 'E'. This usually indicates that type information was lost and resulted in 'dynamic' and/or a place that will have a failure at runtime. (dart:collection, line 758, col 14)
+[warning] Unsafe implicit cast from 'Object' to 'E'. This usually indicates that type information was lost and resulted in 'dynamic' and/or a place that will have a failure at runtime. (dart:collection, line 1135, col 14)
+[warning] The final variable 'origin' must be initialized. (dart:html, line 177, col 3)
+[warning] The final variable 'origin' must be initialized. (dart:html, line 813, col 3)
+[warning] The final variables 'form', 'labels' and '3' more must be initialized. (dart:html, line 1691, col 3)
+[warning] The final variable 'options' must be initialized. (dart:html, line 8972, col 3)
+[warning] The final variables '_attributes', '_childElementCount' and '16' more must be initialized. (dart:html, line 13009, col 3)
+[warning] The final variables 'elements', 'form' and '4' more must be initialized. (dart:html, line 16625, col 3)
+[warning] The final variable 'length' must be initialized. (dart:html, line 17555, col 3)
+[warning] The final variables '_get_contentWindow' and 'sandbox' must be initialized. (dart:html, line 20113, col 3)
+[warning] The final variables 'complete', 'currentSrc' and '2' more must be initialized. (dart:html, line 20246, col 3)
+[warning] The final variables '_get_valueAsDate', 'entries' and '6' more must be initialized. (dart:html, line 20400, col 3)
+[warning] The final variables 'form', 'labels' and '4' more must be initialized. (dart:html, line 21436, col 3)
+[warning] The final variables 'control' and 'form' must be initialized. (dart:html, line 21547, col 3)
+[warning] The final variable 'form' must be initialized. (dart:html, line 21581, col 3)
+[warning] The final variables 'import', 'sheet' and '1' more must be initialized. (dart:html, line 21607, col 3)
+[warning] The final variable 'areas' must be initialized. (dart:html, line 21759, col 3)
+[warning] The final variables 'audioDecodedByteCount', 'audioTracks' and '16' more must be initialized. (dart:html, line 21985, col 3)
+[warning] The final variable 'labels' must be initialized. (dart:html, line 23501, col 3)
+[warning] The final variables '_localName', '_namespaceUri' and '12' more must be initialized. (dart:html, line 24939, col 3)
+[warning] The final variables 'form', 'validationMessage' and '2' more must be initialized. (dart:html, line 25820, col 3)
+[warning] The final variables 'form' and 'index' must be initialized. (dart:html, line 25955, col 3)
+[warning] The final variables 'form', 'htmlFor' and '5' more must be initialized. (dart:html, line 26009, col 3)
+[warning] The final variables 'labels' and 'position' must be initialized. (dart:html, line 27415, col 3)
+[warning] The final variables 'form', 'labels' and '4' more must be initialized. (dart:html, line 29186, col 3)
+[warning] The final variable 'sheet' must be initialized. (dart:html, line 31442, col 3)
+[warning] The final variable 'cellIndex' must be initialized. (dart:html, line 31662, col 3)
+[warning] The final variables '_rows' and '_tBodies' must be initialized. (dart:html, line 31773, col 3)
+[warning] The final variables '_cells', 'rowIndex' and '1' more must be initialized. (dart:html, line 31883, col 3)
+[warning] The final variable '_rows' must be initialized. (dart:html, line 31950, col 3)
+[warning] The final variable 'content' must be initialized. (dart:html, line 31993, col 3)
+[warning] The final variables 'form', 'labels' and '5' more must be initialized. (dart:html, line 32069, col 3)
+[warning] The final variables 'readyState' and 'track' must be initialized. (dart:html, line 33056, col 3)
+[warning] The final variables 'decodedFrameCount', 'droppedFrameCount' and '2' more must be initialized. (dart:html, line 33754, col 3)
+[warning] Unsafe implicit cast from '(T) → void' to '(Event) → dynamic'. This usually indicates that type information was lost and resulted in 'dynamic' and/or a place that will have a failure at runtime. (dart:html, line 40090, col 67)
+[warning] Unsafe implicit cast from '(T) → void' to '(Event) → dynamic'. This usually indicates that type information was lost and resulted in 'dynamic' and/or a place that will have a failure at runtime. (dart:html, line 40112, col 45)
+[warning] Unsafe implicit cast from 'num' to 'T'. This usually indicates that type information was lost and resulted in 'dynamic' and/or a place that will have a failure at runtime. (dart:math/rectangle.dart, line 158, col 22)
+[warning] Unsafe implicit cast from 'num' to 'T'. This usually indicates that type information was lost and resulted in 'dynamic' and/or a place that will have a failure at runtime. (dart:math/rectangle.dart, line 159, col 23)
+[warning] Unsafe implicit cast from 'num' to 'T'. This usually indicates that type information was lost and resulted in 'dynamic' and/or a place that will have a failure at runtime. (dart:math/rectangle.dart, line 282, col 10)
+[warning] The final variables 'href' and 'target' must be initialized. (dart:svg, line 60, col 3)
+[warning] The final variables 'requiredExtensions', 'requiredFeatures' and '2' more must be initialized. (dart:svg, line 489, col 3)
+[warning] The final variables 'cx', 'cy' and '1' more must be initialized. (dart:svg, line 562, col 3)
+[warning] The final variable 'clipPathUnits' must be initialized. (dart:svg, line 597, col 3)
+[warning] The final variables 'cx', 'cy' and '2' more must be initialized. (dart:svg, line 689, col 3)
+[warning] The final variables 'height', 'in1' and '6' more must be initialized. (dart:svg, line 732, col 3)
+[warning] The final variables 'height', 'in1' and '6' more must be initialized. (dart:svg, line 820, col 3)
+[warning] The final variables 'height', 'in1' and '4' more must be initialized. (dart:svg, line 904, col 3)
+[warning] The final variables 'height', 'in1' and '10' more must be initialized. (dart:svg, line 952, col 3)
+[warning] The final variables 'bias', 'divisor' and '15' more must be initialized. (dart:svg, line 1057, col 3)
+[warning] The final variables 'diffuseConstant', 'height' and '8' more must be initialized. (dart:svg, line 1173, col 3)
+[warning] The final variables 'height', 'in1' and '8' more must be initialized. (dart:svg, line 1245, col 3)
+[warning] The final variables 'azimuth' and 'elevation' must be initialized. (dart:svg, line 1337, col 3)
+[warning] The final variables 'height', 'result' and '3' more must be initialized. (dart:svg, line 1375, col 3)
+[warning] The final variables 'height', 'in1' and '6' more must be initialized. (dart:svg, line 1547, col 3)
+[warning] The final variables 'height', 'href' and '5' more must be initialized. (dart:svg, line 1615, col 3)
+[warning] The final variables 'height', 'result' and '3' more must be initialized. (dart:svg, line 1677, col 3)
+[warning] The final variable 'in1' must be initialized. (dart:svg, line 1729, col 3)
+[warning] The final variables 'height', 'in1' and '7' more must be initialized. (dart:svg, line 1759, col 3)
+[warning] The final variables 'dx', 'dy' and '6' more must be initialized. (dart:svg, line 1836, col 3)
+[warning] The final variables 'x', 'y' and '1' more must be initialized. (dart:svg, line 1900, col 3)
+[warning] The final variables 'height', 'in1' and '9' more must be initialized. (dart:svg, line 1942, col 3)
+[warning] The final variables 'limitingConeAngle', 'pointsAtX' and '6' more must be initialized. (dart:svg, line 2020, col 3)
+[warning] The final variables 'height', 'in1' and '4' more must be initialized. (dart:svg, line 2082, col 3)
+[warning] The final variables 'baseFrequencyX', 'baseFrequencyY' and '9' more must be initialized. (dart:svg, line 2138, col 3)
+[warning] The final variables 'filterUnits', 'height' and '5' more must be initialized. (dart:svg, line 2238, col 3)
+[warning] The final variables 'height', 'width' and '2' more must be initialized. (dart:svg, line 2335, col 3)
+[warning] The final variables 'farthestViewportElement', 'nearestViewportElement' and '4' more must be initialized. (dart:svg, line 2425, col 3)
+[warning] The final variables 'height', 'href' and '4' more must be initialized. (dart:svg, line 2507, col 3)
+[warning] The final variables 'x1', 'x2' and '2' more must be initialized. (dart:svg, line 2736, col 3)
+[warning] The final variables 'x1', 'x2' and '2' more must be initialized. (dart:svg, line 2775, col 3)
+[warning] The final variables 'markerHeight', 'markerUnits' and '7' more must be initialized. (dart:svg, line 2814, col 3)
+[warning] The final variables 'height', 'maskContentUnits' and '7' more must be initialized. (dart:svg, line 2907, col 3)
+[warning] The final variables 'animatedNormalizedPathSegList', 'animatedPathSegList' and '3' more must be initialized. (dart:svg, line 3188, col 3)
+[warning] The final variables 'height', 'href' and '11' more must be initialized. (dart:svg, line 4017, col 3)
+[warning] The final variables 'animatedPoints' and 'points' must be initialized. (dart:svg, line 4182, col 3)
+[warning] The final variables 'animatedPoints' and 'points' must be initialized. (dart:svg, line 4213, col 3)
+[warning] The final variables 'cx', 'cy' and '4' more must be initialized. (dart:svg, line 4321, col 3)
+[warning] The final variables 'height', 'rx' and '4' more must be initialized. (dart:svg, line 4397, col 3)
+[warning] The final variable 'href' must be initialized. (dart:svg, line 4444, col 3)
+[warning] The final variable 'gradientOffset' must be initialized. (dart:svg, line 4506, col 3)
+[warning] The final variable 'sheet' must be initialized. (dart:svg, line 4634, col 3)
+[warning] The final variables 'ownerSvgElement' and 'viewportElement' must be initialized. (dart:svg, line 5072, col 3)
+[warning] The final variables 'currentTranslate', 'currentView' and '12' more must be initialized. (dart:svg, line 5386, col 3)
+[warning] The final variables 'preserveAspectRatio' and 'viewBox' must be initialized. (dart:svg, line 5605, col 3)
+[warning] The final variables 'lengthAdjust' and 'textLength' must be initialized. (dart:svg, line 5677, col 3)
+[warning] The final variables 'href', 'method' and '2' more must be initialized. (dart:svg, line 5775, col 3)
+[warning] The final variables 'dx', 'dy' and '3' more must be initialized. (dart:svg, line 5836, col 3)
+[warning] The final variables 'height', 'href' and '3' more must be initialized. (dart:svg, line 6126, col 3)
+[warning] The final variables 'preserveAspectRatio', 'viewBox' and '1' more must be initialized. (dart:svg, line 6171, col 3)
+[warning] The final variables 'gradientTransform', 'gradientUnits' and '2' more must be initialized. (dart:svg, line 6325, col 3)
diff --git a/pkg/dev_compiler/tool/test.sh b/pkg/dev_compiler/tool/test.sh
index f32a6ad..f5593bc 100755
--- a/pkg/dev_compiler/tool/test.sh
+++ b/pkg/dev_compiler/tool/test.sh
@@ -27,7 +27,7 @@
   rm -r gen/codegen_output || fail
 fi
 
-./tool/build_test_pkgs.sh
+./tool/build_pkgs.dart test
 
 # Make sure we don't run tests in code coverage mode.
 # this will cause us to generate files that are not part of the baseline
diff --git a/pkg/dev_compiler/web/main.dart b/pkg/dev_compiler/web/main.dart
index 3ec8888..70f8440 100755
--- a/pkg/dev_compiler/web/main.dart
+++ b/pkg/dev_compiler/web/main.dart
@@ -17,7 +17,7 @@
 external set setUpCompilerInBrowser(Function function);
 
 Future main() async {
-  var args = ['compile'];
+  var args = ['compile', '--repl-compile'];
   _runCommand(args);
 }
 
@@ -61,7 +61,7 @@
     messageHandler("We're sorry, you've found a bug in our compiler.");
     messageHandler("You can report this bug at:");
     messageHandler(
-      "    https://github.com/dart-lang/sdk/issues/labels/area-dev-compiler");
+        "    https://github.com/dart-lang/sdk/issues/labels/area-dev-compiler");
     messageHandler("");
     messageHandler(
         "Please include the information below in your report, along with");
diff --git a/pkg/dev_compiler/web/web_command.dart b/pkg/dev_compiler/web/web_command.dart
index 5f6514a..bc4c1ad 100644
--- a/pkg/dev_compiler/web/web_command.dart
+++ b/pkg/dev_compiler/web/web_command.dart
@@ -5,9 +5,15 @@
 library dev_compiler.web.web_command;
 
 import 'dart:async';
+import 'dart:convert';
 import 'dart:html' show HttpRequest;
-import 'dart:convert' show BASE64;
 
+import 'package:analyzer/dart/element/element.dart'
+    show
+        LibraryElement,
+        ImportElement,
+        ShowElementCombinator,
+        HideElementCombinator;
 import 'package:analyzer/file_system/file_system.dart' show ResourceUriResolver;
 import 'package:analyzer/file_system/memory_file_system.dart'
     show MemoryResourceProvider;
@@ -20,6 +26,7 @@
         InSummaryUriResolver,
         InputPackagesResultProvider,
         InSummarySource;
+import 'package:analyzer/src/dart/resolver/scope.dart' show Scope;
 import 'package:analyzer/src/summary/summary_sdk.dart' show SummaryBasedDartSdk;
 
 import 'package:args/command_runner.dart';
@@ -30,6 +37,7 @@
 
 import 'package:dev_compiler/src/compiler/module_builder.dart';
 import 'package:js/js.dart';
+import 'package:path/path.dart' as path;
 
 typedef void MessageHandler(Object message);
 
@@ -40,8 +48,8 @@
       {String code, List<String> errors, bool isValid});
 }
 
-typedef CompileResult CompileModule(
-    String code, String libraryName, String fileName);
+typedef CompileModule(String imports, String body, String libraryName,
+    String existingLibrary, String fileName);
 
 /// The command for invoking the modular compiler.
 class WebCompileCommand extends Command {
@@ -102,7 +110,8 @@
       var summaryBundle = new PackageBundle.fromBuffer(bytes);
       summaryDataStore.addBundle(url, summaryBundle);
     }
-    var summaryResolver = new InSummaryUriResolver(resourceProvider, summaryDataStore);
+    var summaryResolver =
+        new InSummaryUriResolver(resourceProvider, summaryDataStore);
 
     var fileResolvers = [summaryResolver, resourceUriResolver];
 
@@ -112,26 +121,89 @@
         fileResolvers: fileResolvers,
         resourceProvider: resourceProvider);
 
-    (compiler.context as AnalysisContextImpl).resultProvider =
+    var context = compiler.context as AnalysisContextImpl;
+    context.resultProvider =
         new InputPackagesResultProvider(compiler.context, summaryDataStore);
 
     var compilerOptions = new CompilerOptions.fromArguments(argResults);
 
-    CompileModule compileFn =
-        (String sourceCode, String libraryName, String fileName) {
+    CompileModule compileFn = (String imports, String body, String libraryName,
+        String existingLibrary, String fileName) {
       // Create a new virtual File that contains the given Dart source.
-      resourceProvider.newFile("/$fileName", sourceCode);
+      String sourceCode;
+      if (existingLibrary == null) {
+        sourceCode = imports + body;
+      } else {
+        var dir = path.dirname(existingLibrary);
+        // Need to pull in all the imports from the existing library and
+        // re-export all privates as privates in this library.
+        var source = context.sourceFactory.forUri(existingLibrary);
+        if (source == null) {
+          throw "Unable to load source for library $existingLibrary";
+        }
 
-      var unit = new BuildUnit(
-          libraryName, "", ["file:///$fileName"], _moduleForLibrary);
+        LibraryElement libraryElement = context.computeLibraryElement(source);
+        if (libraryElement == null) {
+          throw "Unable to get library element.";
+        }
+        var sb = new StringBuffer(imports);
+        sb.write('\n');
+
+        // TODO(jacobr): we need to add a proper Analyzer flag specifing that
+        // cross-library privates should be in scope instead of this hack.
+        // We set the private name prefix for scope resolution to an invalid
+        // character code so that the analyzer ignores normal Dart private
+        // scoping rules for top level names allowing REPL users to access
+        // privates in arbitrary libraries. The downside of this scheme is it is
+        // possible to get errors if privates in the current library and
+        // imported libraries happen to have exactly the same name.
+        Scope.PRIVATE_NAME_PREFIX = -1;
+
+        // We emulate running code in the context of an existing library by
+        // importing that library and all libraries it imports.
+        sb.write('import ${JSON.encode(existingLibrary)};\n');
+
+        for (ImportElement importElement in libraryElement.imports) {
+          if (importElement.uri == null) continue;
+          var uri = importElement.uri;
+          // dart: and package: uris are not relative but the path package
+          // thinks they are. We have to provide absolute uris as our library
+          // has a different directory than the library we are pretending to be.
+          if (path.isRelative(uri) &&
+              !uri.startsWith('package:') &&
+              !uri.startsWith('dart:')) {
+            uri = path.normalize(path.join(dir, uri));
+          }
+          sb.write('import ${JSON.encode(uri)}');
+          if (importElement.prefix != null)
+            sb.write(' as ${importElement.prefix.name}');
+          for (var combinator in importElement.combinators) {
+            if (combinator is ShowElementCombinator) {
+              sb.write(' show ${combinator.shownNames.join(', ')}');
+            } else if (combinator is HideElementCombinator) {
+              sb.write(' hide ${combinator.hiddenNames.join(', ')}');
+            } else {
+              throw 'Unexpected element combinator';
+            }
+          }
+          sb.write(';\n');
+        }
+        sb.write(body);
+        sourceCode = sb.toString();
+      }
+      resourceProvider.newFile(fileName, sourceCode);
+
+      var unit = new BuildUnit(libraryName, "", [fileName], _moduleForLibrary);
 
       JSModuleFile module = compiler.compile(unit, compilerOptions);
 
-      var moduleCode = module.isValid
-          ? module
-              .getCode(ModuleFormat.legacy, false, unit.name, unit.name + '.map')
-              .code
-          : '';
+      var moduleCode = '';
+      if (module.isValid) {
+        moduleCode = module
+            .getCode(ModuleFormat.legacy, unit.name, unit.name + '.map',
+                singleOutFile: true)
+            .code;
+      }
 
       return new CompileResult(
           code: moduleCode, isValid: module.isValid, errors: module.errors);
diff --git a/pkg/expect/lib/expect.dart b/pkg/expect/lib/expect.dart
index 616920b..4ee2832 100644
--- a/pkg/expect/lib/expect.dart
+++ b/pkg/expect/lib/expect.dart
@@ -81,7 +81,7 @@
         var truncExpected = _truncateString(expected, start, end, 20);
         var truncActual = _truncateString(actual, start, end, 20);
         return "at index $start: Expected <$truncExpected>, "
-                                "Found: <$truncActual>";
+            "Found: <$truncActual>";
       }
     }
     return null;
@@ -146,7 +146,7 @@
     if (_identical(expected, actual)) return;
     String msg = _getMessage(reason);
     _fail("Expect.identical(expected: <$expected>, actual: <$actual>$msg) "
-          "fails.");
+        "fails.");
   }
 
   // Unconditional failure.
@@ -159,10 +159,8 @@
    * given tolerance. If no tolerance is given, tolerance is assumed to be the
    * value 4 significant digits smaller than the value given for expected.
    */
-  static void approxEquals(num expected,
-                           num actual,
-                           [num tolerance = null,
-                            String reason = null]) {
+  static void approxEquals(num expected, num actual,
+      [num tolerance = null, String reason = null]) {
     if (tolerance == null) {
       tolerance = (expected / 1e4).abs();
     }
@@ -171,14 +169,14 @@
 
     String msg = _getMessage(reason);
     _fail('Expect.approxEquals(expected:<$expected>, actual:<$actual>, '
-          'tolerance:<$tolerance>$msg) fails');
+        'tolerance:<$tolerance>$msg) fails');
   }
 
   static void notEquals(unexpected, actual, [String reason = null]) {
     if (unexpected != actual) return;
     String msg = _getMessage(reason);
     _fail("Expect.notEquals(unexpected: <$unexpected>, actual:<$actual>$msg) "
-          "fails.");
+        "fails.");
   }
 
   /**
@@ -193,16 +191,16 @@
     for (int i = 0; i < n; i++) {
       if (expected[i] != actual[i]) {
         _fail('Expect.listEquals(at index $i, '
-              'expected: <${expected[i]}>, actual: <${actual[i]}>$msg) fails');
+            'expected: <${expected[i]}>, actual: <${actual[i]}>$msg) fails');
       }
     }
     // We check on length at the end in order to provide better error
     // messages when an unexpected item is inserted in a list.
     if (expected.length != actual.length) {
       _fail('Expect.listEquals(list length, '
-        'expected: <${expected.length}>, actual: <${actual.length}>$msg) '
-        'fails: Next element <'
-        '${expected.length > n ? expected[n] : actual[n]}>');
+          'expected: <${expected.length}>, actual: <${actual.length}>$msg) '
+          'fails: Next element <'
+          '${expected.length > n ? expected[n] : actual[n]}>');
     }
   }
 
@@ -235,9 +233,8 @@
    * Specialized equality test for strings. When the strings don't match,
    * this method shows where the mismatch starts and ends.
    */
-  static void stringEquals(String expected,
-                           String actual,
-                           [String reason = null]) {
+  static void stringEquals(String expected, String actual,
+      [String reason = null]) {
     if (expected == actual) return;
 
     String msg = _getMessage(reason);
@@ -262,10 +259,11 @@
     }
 
     // Scan from the right until we find the mismatch.
-    int eRem = eLen - left;  // Remaining length ignoring left match.
+    int eRem = eLen - left; // Remaining length ignoring left match.
     int aRem = aLen - left;
     while (true) {
-      if (right == eRem || right == aRem ||
+      if (right == eRem ||
+          right == aRem ||
           expected[eLen - right - 1] != actual[aLen - right - 1]) {
         break;
       }
@@ -293,12 +291,14 @@
 
     // If snippets are long, elide the middle.
     if (eSnippet.length > 43) {
-      eSnippet = eSnippet.substring(0, 20) + "..." +
-                 eSnippet.substring(eSnippet.length - 20);
+      eSnippet = eSnippet.substring(0, 20) +
+          "..." +
+          eSnippet.substring(eSnippet.length - 20);
     }
     if (aSnippet.length > 43) {
-      aSnippet = aSnippet.substring(0, 20) + "..." +
-                 aSnippet.substring(aSnippet.length - 20);
+      aSnippet = aSnippet.substring(0, 20) +
+          "..." +
+          aSnippet.substring(aSnippet.length - 20);
     }
     // Add "..." before and after, unless the snippets reach the end.
     String leftLead = "...";
@@ -307,8 +307,8 @@
     if (right <= 10) rightTail = "";
 
     String diff = '\nDiff ($left..${eLen - right}/${aLen - right}):\n'
-                  '$leftLead$leftSnippet[ $eSnippet ]$rightSnippet$rightTail\n'
-                  '$leftLead$leftSnippet[ $aSnippet ]$rightSnippet$rightTail';
+        '$leftLead$leftSnippet[ $eSnippet ]$rightSnippet$rightTail\n'
+        '$leftLead$leftSnippet[ $aSnippet ]$rightSnippet$rightTail';
     _fail("$defaultMessage$diff");
   }
 
@@ -316,9 +316,8 @@
    * Checks that every element of [expected] is also in [actual], and that
    * every element of [actual] is also in [expected].
    */
-  static void setEquals(Iterable expected,
-                        Iterable actual,
-                        [String reason = null]) {
+  static void setEquals(Iterable expected, Iterable actual,
+      [String reason = null]) {
     final missingSet = new Set.from(expected);
     missingSet.removeAll(actual);
     final extraSet = new Set.from(actual);
@@ -349,6 +348,58 @@
   }
 
   /**
+   * Checks that [expected] is equivalent to [actual].
+   *
+   * If the objects are iterables or maps, recurses into them.
+   */
+  static void deepEquals(Object expected, Object actual) {
+    // Early exit check for equality.
+    if (expected == actual) return;
+
+    if (expected is String && actual is String) {
+      stringEquals(expected, actual);
+    } else if (expected is Iterable && actual is Iterable) {
+      var expectedLength = expected.length;
+      var actualLength = actual.length;
+
+      var length =
+          expectedLength < actualLength ? expectedLength : actualLength;
+      for (var i = 0; i < length; i++) {
+        deepEquals(expected.elementAt(i), actual.elementAt(i));
+      }
+
+      // We check on length at the end in order to provide better error
+      // messages when an unexpected item is inserted in a list.
+      if (expectedLength != actualLength) {
+        var nextElement =
+            (expectedLength > length ? expected : actual).elementAt(length);
+        _fail('Expect.deepEquals(list length, '
+            'expected: <$expectedLength>, actual: <$actualLength>) '
+            'fails: Next element <$nextElement>');
+      }
+    } else if (expected is Map && actual is Map) {
+      // Make sure all of the values are present in both and match.
+      for (final key in expected.keys) {
+        if (!actual.containsKey(key)) {
+          _fail('Expect.deepEquals(missing expected key: <$key>) fails');
+        }
+
+        Expect.deepEquals(expected[key], actual[key]);
+      }
+
+      // Make sure the actual map doesn't have any extra keys.
+      for (final key in actual.keys) {
+        if (!expected.containsKey(key)) {
+          _fail('Expect.deepEquals(unexpected key: <$key>) fails');
+        }
+      }
+    } else {
+      _fail("Expect.deepEquals(expected: <$expected>, actual: <$actual>) "
+          "fails.");
+    }
+  }
+
+  /**
    * Calls the function [f] and verifies that it throws an exception.
    * The optional [check] function can provide additional validation
    * that the correct exception is being thrown.  For example, to check
@@ -357,8 +408,7 @@
    *     Expect.throws(myThrowingFunction, (e) => e is MyException);
    */
   static void throws(void f(),
-                     [bool check(exception) = null,
-                      String reason = null]) {
+      [_CheckExceptionFn check = null, String reason = null]) {
     String msg = reason == null ? "" : "($reason)";
     if (f is! _Nullary) {
       // Only throws from executing the funtion body should count as throwing.
@@ -378,8 +428,8 @@
     _fail('Expect.throws$msg fails: Did not throw');
   }
 
-  static String _getMessage(String reason)
-      => (reason == null) ? "" : ", '$reason'";
+  static String _getMessage(String reason) =>
+      (reason == null) ? "" : ", '$reason'";
 
   static void _fail(String message) {
     throw new ExpectException(message);
@@ -388,7 +438,8 @@
 
 bool _identical(a, b) => identical(a, b);
 
-typedef _Nullary();  // Expect.throws argument must be this type.
+typedef bool _CheckExceptionFn(exception);
+typedef _Nullary(); // Expect.throws argument must be this type.
 
 class ExpectException implements Exception {
   ExpectException(this.message);
diff --git a/pkg/expect/lib/minitest.dart b/pkg/expect/lib/minitest.dart
new file mode 100644
index 0000000..d3057c2
--- /dev/null
+++ b/pkg/expect/lib/minitest.dart
@@ -0,0 +1,195 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// A minimal, dependency-free emulation layer for a subset of the
+/// unittest/test API used by the language and core library (especially HTML)
+/// tests.
+///
+/// A number of our language and core library tests were written against the
+/// unittest package, which is now deprecated in favor of the new test package.
+/// The latter is much better feature-wise, but is also quite complex and has
+/// many dependencies. For low-level language and core library tests, we don't
+/// want to have to pull in a large number of dependencies and be able to run
+/// them correctly in order to run a test, so we want to test them against
+/// something simpler.
+///
+/// When possible, we just use the tiny expect library. But to avoid rewriting
+/// all of the existing tests that use unittest, they can instead use this,
+/// which shims the unittest API with as little code as possible and calls into
+/// expect.
+///
+/// Eventually, it would be good to refactor those tests to use the expect
+/// package directly and remove this.
+
+import 'package:expect/expect.dart';
+
+typedef void _Action();
+typedef void _ExpectationFunction(Object actual);
+
+final List<_Group> _groups = [new _Group()];
+
+final Object isFalse = new _Expectation(Expect.isFalse);
+final Object isNotNull = new _Expectation(Expect.isNotNull);
+final Object isNull = new _Expectation(Expect.isNull);
+final Object isTrue = new _Expectation(Expect.isTrue);
+
+final Object returnsNormally = new _Expectation((actual) {
+  try {
+    (actual as _Action)();
+  } catch (error) {
+    Expect.fail("Expected function to return normally, but threw:\n$error");
+  }
+});
+
+final Object throws = new _Expectation((actual) {
+  Expect.throws(actual as _Action);
+});
+
+final Object throwsArgumentError = new _Expectation((actual) {
+  Expect.throws(actual as _Action, (error) => error is ArgumentError);
+});
+
+final Object throwsNoSuchMethodError = new _Expectation((actual) {
+  Expect.throws(actual as _Action, (error) => error is NoSuchMethodError);
+});
+
+final Object throwsRangeError = new _Expectation((actual) {
+  Expect.throws(actual as _Action, (error) => error is RangeError);
+});
+
+final Object throwsStateError = new _Expectation((actual) {
+  Expect.throws(actual as _Action, (error) => error is StateError);
+});
+
+final Object throwsUnsupportedError = new _Expectation((actual) {
+  Expect.throws(actual as _Action, (error) => error is UnsupportedError);
+});
+
+/// The test runner should call this once after running a test file.
+void finishTests() {
+  _groups.clear();
+  _groups.add(new _Group());
+}
+
+void group(String description, body()) {
+  // TODO(rnystrom): Do something useful with the description.
+  _groups.add(new _Group());
+
+  try {
+    body();
+  } finally {
+    _groups.removeLast();
+  }
+}
+
+void test(String description, body()) {
+  // TODO(rnystrom): Do something useful with the description.
+  for (var group in _groups) {
+    if (group.setUpFunction != null) group.setUpFunction();
+  }
+
+  try {
+    body();
+  } finally {
+    for (var i = _groups.length - 1; i >= 0; i--) {
+      var group = _groups[i];
+      if (group.tearDownFunction != null) group.tearDownFunction();
+    }
+  }
+}
+
+void setUp(body()) {
+  // Can't define multiple setUps at the same level.
+  assert(_groups.last.setUpFunction == null);
+  _groups.last.setUpFunction = body;
+}
+
+void tearDown(body()) {
+  // Can't define multiple tearDowns at the same level.
+  assert(_groups.last.tearDownFunction == null);
+  _groups.last.tearDownFunction = body;
+}
+
+void expect(Object actual, Object expected, {String reason}) {
+  // TODO(rnystrom): Do something useful with reason.
+  if (expected is! _Expectation) {
+    expected = equals(expected);
+  }
+
+  var expectation = expected as _Expectation;
+  expectation.function(actual);
+}
+
+void fail(String message) {
+  Expect.fail(message);
+}
+
+Object equals(Object value) => new _Expectation((actual) {
+      Expect.deepEquals(value, actual);
+    });
+
+Object notEquals(Object value) => new _Expectation((actual) {
+      Expect.notEquals(value, actual);
+    });
+
+Object unorderedEquals(Object value) => new _Expectation((actual) {
+      Expect.setEquals(value, actual);
+    });
+
+// TODO(bob): Do something useful with the description.
+Object predicate(bool fn(Object value), [String description]) =>
+    new _Expectation((actual) {
+      Expect.isTrue(fn(actual));
+    });
+
+Object inInclusiveRange(num min, num max) => new _Expectation((actual) {
+      var actualNum = actual as num;
+      if (actualNum < min || actualNum > max) {
+        fail("Expected $actualNum to be in the inclusive range [$min, $max].");
+      }
+    });
+
+Object greaterThan(num value) => new _Expectation((actual) {
+      var actualNum = actual as num;
+      if (actualNum <= value) {
+        fail("Expected $actualNum to be greater than $value.");
+      }
+    });
+
+Object same(Object value) => new _Expectation((actual) {
+      Expect.identical(value, actual);
+    });
+
+Object closeTo(num value, num tolerance) => new _Expectation((actual) {
+      Expect.approxEquals(value, actual, tolerance);
+    });
+
+/// Succeeds if the actual value is any of the given strings. Unlike matcher's
+/// [anyOf], this only works with strings and requires an explicit list.
+Object anyOf(List<String> expected) => new _Expectation((actual) {
+      for (var string in expected) {
+        if (actual == string) return;
+      }
+
+      fail("Expected $actual to be one of $expected.");
+    });
+
+/// One level of group() nesting to track an optional [setUp()] and [tearDown()]
+/// function for the group.
+///
+/// There is also an implicit top level group.
+class _Group {
+  _Action setUpFunction;
+  _Action tearDownFunction;
+}
+
+/// A wrapper around an expectation function.
+///
+/// This function is passed the actual value and should throw an
+/// [ExpectException] if the value doesn't match the expectation.
+class _Expectation {
+  final _ExpectationFunction function;
+
+  _Expectation(this.function);
+}
diff --git a/pkg/front_end/.analysis_options b/pkg/front_end/.analysis_options
new file mode 100644
index 0000000..f0ac32f
--- /dev/null
+++ b/pkg/front_end/.analysis_options
@@ -0,0 +1,4 @@
+analyzer:
+  strong-mode: true
+  language:
+    enableSuperMixins: true
diff --git a/pkg/front_end/BUILD.gn b/pkg/front_end/BUILD.gn
new file mode 100644
index 0000000..2ad4e93
--- /dev/null
+++ b/pkg/front_end/BUILD.gn
@@ -0,0 +1,16 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for 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("//build/dart/dart_package.gni")
+
+dart_package("front_end") {
+  package_name = "front_end"
+
+  source_dir = "lib"
+
+  deps = [
+    "//third_party/dart-pkg/pub/path",
+    "//third_party/dart-pkg/pub/source_span",
+  ]
+}
diff --git a/pkg/front_end/LICENSE b/pkg/front_end/LICENSE
new file mode 100644
index 0000000..82e9b52
--- /dev/null
+++ b/pkg/front_end/LICENSE
@@ -0,0 +1,26 @@
+Copyright 2016, the Dart project authors. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+    * Neither the name of Google Inc. nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/pkg/front_end/README.md b/pkg/front_end/README.md
new file mode 100644
index 0000000..2b5ed61
--- /dev/null
+++ b/pkg/front_end/README.md
@@ -0,0 +1,13 @@
+# Front end for Dart
+
+This package provides a low-level API for use by compiler back ends that wish to
+implement the Dart language.  It is intended for eventual use by dev_compiler,
+dart2js, and the Dart VM.  In addition, it will share implementation details
+with the analyzer package--this will be accomplished by having the analyzer
+package import (and re-export) parts of this package's private implementation.
+
+End-users should use the [dartanalyzer][analyzercli] command-line tool to
+analyze their Dart code.
+
+Integrators that want to write tools that analyze Dart code should use the
+[analyzer] package.
diff --git a/pkg/front_end/lib/compilation_error.dart b/pkg/front_end/lib/compilation_error.dart
new file mode 100644
index 0000000..5e30da1
--- /dev/null
+++ b/pkg/front_end/lib/compilation_error.dart
@@ -0,0 +1,26 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// Defines the API for the front end to communicate information about
+/// compilation errors to clients.
+library front_end.compilation_error;
+
+import 'package:source_span/source_span.dart' show SourceSpan;
+
+/// A single error that occurred during compilation, and information about where
+/// it occurred.
+///
+/// TODO(paulberry): add a reference to the analyzer error code.
+///
+/// Not intended to be implemented or extended by clients.
+abstract class CompilationError {
+  /// A text description of how the user can fix the error.  May be `null`.
+  String get correction;
+
+  /// The source span where the error occurred.
+  SourceSpan get span;
+
+  /// A text description of the compile error.
+  String get message;
+}
diff --git a/pkg/front_end/lib/compiler_options.dart b/pkg/front_end/lib/compiler_options.dart
new file mode 100644
index 0000000..f9f2f29
--- /dev/null
+++ b/pkg/front_end/lib/compiler_options.dart
@@ -0,0 +1,102 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 front_end.compiler_options;
+
+import 'compilation_error.dart';
+import 'file_system.dart';
+
+/// Callback used to report errors encountered during compilation.
+typedef void ErrorHandler(CompilationError error);
+
+/// Front-end options relevant to compiler back ends.
+///
+/// Not intended to be implemented or extended by clients.
+class CompilerOptions {
+  /// The path to the Dart SDK.
+  ///
+  /// If `null`, the SDK will be searched for using
+  /// [Platform.resolvedExecutable] as a starting point.
+  ///
+  /// This option is mutually exclusive with [sdkSummary].
+  String sdkPath;
+
+  /// Callback to which compilation errors should be delivered.
+  ///
+  /// If `null`, the first error will be reported by throwing an exception of
+  /// type [CompilationError].
+  ErrorHandler onError;
+
+  /// Path to the ".packages" file.
+  ///
+  /// If `null`, the ".packages" file will be found via the standard
+  /// package_config search algorithm.
+  String packagesFilePath;
+
+  /// Paths to the input summary files (excluding the SDK summary).  These files
+  /// should all be linked summaries.  They should also be closed, in the sense
+  /// that any libraries they reference should also appear in [inputSummaries]
+  /// or [sdkSummary].
+  List<String> inputSummaries = [];
+
+  /// Path to the SDK summary file.
+  ///
+  /// This should be a linked summary.  If `null`, the SDK summary will be
+  /// searched for at a default location within [sdkPath].
+  ///
+  /// This option is mutually exclusive with [sdkPath].  TODO(paulberry): if the
+  /// VM does not contain a pickled copy of the SDK, we might need to change
+  /// this.
+  String sdkSummary;
+
+  /// URI override map.
+  ///
+  /// This is a map from Uri to file path.  Any URI override listed in this map
+  /// takes precedence over the URI resolution that would be implied by the
+  /// packages file (see [packagesFilePath]) and/or [bazelRoots].
+  ///
+  /// If a URI is not listed in this map, then the normal URI resolution
+  /// algorithm will be used.
+  ///
+  /// TODO(paulberry): transition analyzer and dev_compiler to use the
+  /// "file:///bazel-root" mechanism, and then remove this.
+  @deprecated
+  Map<Uri, String> uriOverride = {};
+
+  /// Bazel roots.
+  ///
+  /// Any Uri that resolves to "file:///bazel-root/$rest" will be searched for
+  /// at "$root/$rest" ("$root\\$rest" in Windows), where "$root" is drawn from
+  /// this list.  If the file is not found at any of those locations, the URI
+  /// "file:///bazel-root/$rest" will be used directly.
+  ///
+  /// Intended use: if the Bazel workspace is located at path "$workspace", this
+  /// could be set to `['$workspace', '$workspace/bazel-bin',
+  /// '$workspace/bazel-genfiles']`, effectively overlaying source and generated
+  /// files.
+  List<String> bazelRoots = [];
+
+  /// Sets the platform bit, which determines which patch files should be
+  /// applied to the SDK.
+  ///
+  /// The value should be a power of two, and should match the `PLATFORM` bit
+  /// flags in sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart.  If
+  /// zero, no patch files will be applied.
+  int platformBit;
+
+  /// The declared variables for use by configurable imports and constant
+  /// evaluation.
+  Map<String, String> declaredVariables;
+
+  /// The [FileSystem] which should be used by the front end to access files.
+  ///
+  /// TODO(paulberry): once an implementation of [FileSystem] has been created
+  /// which uses the actual physical file system, make that the default.
+  ///
+  /// All file system access performed by the front end goes through this
+  /// mechanism, with one exception: if no value is specified for
+  /// [packagesFilePath], the packages file is located using the actual physical
+  /// file system.  TODO(paulberry): fix this.
+  FileSystem fileSystem;
+}
diff --git a/pkg/front_end/lib/file_system.dart b/pkg/front_end/lib/file_system.dart
new file mode 100644
index 0000000..cadf82f
--- /dev/null
+++ b/pkg/front_end/lib/file_system.dart
@@ -0,0 +1,75 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 front_end.file_system;
+
+import 'dart:async';
+
+import 'package:path/path.dart' as path;
+
+/// Abstract interface to file system operations.
+///
+/// All front end interaction with the file system goes through this interface;
+/// this makes it possible for clients to use the front end in a way that
+/// doesn't require file system access (e.g. to run unit tests, or to run
+/// inside a browser).
+///
+/// Not intended to be implemented or extended by clients.
+abstract class FileSystem {
+  /// Returns a path context suitable for use with this [FileSystem].
+  path.Context get context;
+
+  /// Returns a [FileSystemEntity] corresponding to the given [path].
+  ///
+  /// Uses of `..` and `.` in path are normalized before returning (so, for
+  /// example, `entityForPath('./foo')` and `entityForPath('foo')` are
+  /// equivalent).  Relative paths are also converted to absolute paths.
+  ///
+  /// Does not check whether a file or folder exists at the given location.
+  FileSystemEntity entityForPath(String path);
+
+  /// Returns a [FileSystemEntity] corresponding to the given [uri].
+  ///
+  /// Uses of `..` and `.` in the URI are normalized before returning.
+  ///
+  /// If [uri] is not an absolute `file:` URI, an [Error] will be thrown.
+  ///
+  /// Does not check whether a file or folder exists at the given location.
+  FileSystemEntity entityForUri(Uri uri);
+}
+
+/// Abstract representation of a file system entity that may or may not exist.
+///
+/// Instances of this class have suitable implementations of equality tests and
+/// hashCode.
+///
+/// Not intended to be implemented or extended by clients.
+abstract class FileSystemEntity {
+  /// Returns the absolute normalized path represented by this file system
+  /// entity.
+  ///
+  /// Note: if the [FileSystemEntity] was created using
+  /// [FileSystem.entityForPath], this is not necessarily the same as the path
+  /// that was used to create the object, since the path might have been
+  /// normalized.
+  String get path;
+
+  /// Attempts to access this file system entity as a file and read its contents
+  /// as raw bytes.
+  ///
+  /// If an error occurs while attempting to read the file (e.g. because no such
+  /// file exists, or the entity is a directory), the future is completed with
+  /// an [Exception].
+  Future<List<int>> readAsBytes();
+
+  /// Attempts to access this file system entity as a file and read its contents
+  /// as a string.
+  ///
+  /// The file is assumed to be UTF-8 encoded.
+  ///
+  /// If an error occurs while attempting to read the file (e.g. because no such
+  /// file exists, the entity is a directory, or the file is not valid UTF-8),
+  /// the future is completed with an [Exception].
+  Future<String> readAsString();
+}
diff --git a/pkg/front_end/lib/kernel_generator.dart b/pkg/front_end/lib/kernel_generator.dart
new file mode 100644
index 0000000..3b35086
--- /dev/null
+++ b/pkg/front_end/lib/kernel_generator.dart
@@ -0,0 +1,58 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// Defines the front-end API for converting source code to Dart Kernel objects.
+library front_end.kernel_generator;
+
+import 'dart:async';
+import 'compiler_options.dart';
+import 'package:kernel/kernel.dart' as kernel;
+
+/// Generates a kernel representation of the program whose main library is in
+/// the given [source].
+///
+/// Intended for whole program (non-modular) compilation.
+///
+/// Given the Uri of a file containing a program's `main` method, this function
+/// follows `import`, `export`, and `part` declarations to discover the whole
+/// program, and converts the result to Dart Kernel format.
+///
+/// If summaries are provided in [options], they may be used to speed up
+/// analysis, but they will not take the place of Dart source code (since the
+/// Dart source code is still needed to access the contents of method bodies).
+///
+/// TODO(paulberry): will the VM have a pickled version of the SDK inside it? If
+/// so, then maybe this method should not convert SDK libraries to kernel.
+Future<kernel.Program> kernelForProgram(Uri source, CompilerOptions options) =>
+    throw new UnimplementedError();
+
+/// Generates a kernel representation of the build unit whose source files are
+/// in [sources].
+///
+/// Intended for modular compilation.
+///
+/// [sources] should be the complete set of source files for a build unit
+/// (including both library and part files).  All of the library files are
+/// transformed into Dart Kernel Library objects.
+///
+/// The compilation process is hermetic, meaning that the only files which will
+/// be read are those listed in [sources], [CompilerOptions.inputSummaries], and
+/// [CompilerOptions.sdkSummary].  If a source file attempts to refer to a file
+/// which is not obtainable from these paths, that will result in an error, even
+/// if the file exists on the filesystem.
+///
+/// Any `part` declarations found in [sources] must refer to part files which
+/// are also listed in [sources], otherwise an error results.  (It is not
+/// permitted to refer to a part file declared in another build unit).
+///
+/// The return value is a [kernel.Program] object with no main method set.
+/// TODO(paulberry): would it be better to define a data type in kernel to
+/// represent a bundle of all the libraries in a given build unit?
+///
+/// TODO(paulberry): does additional information need to be output to allow the
+/// caller to match up referenced elements to the summary files they were
+/// obtained from?
+Future<kernel.Program> kernelForBuildUnit(
+        List<Uri> sources, CompilerOptions options) =>
+    throw new UnimplementedError();
diff --git a/pkg/front_end/lib/memory_file_system.dart b/pkg/front_end/lib/memory_file_system.dart
new file mode 100644
index 0000000..267cbe3
--- /dev/null
+++ b/pkg/front_end/lib/memory_file_system.dart
@@ -0,0 +1,100 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 front_end.memory_file_system;
+
+import 'dart:async';
+import 'dart:convert';
+import 'dart:typed_data';
+
+import 'package:path/path.dart' as p;
+
+import 'file_system.dart';
+
+/// Concrete implementation of [FileSystem] which performs its operations on an
+/// in-memory virtual file system.
+///
+/// Not intended to be implemented or extended by clients.
+class MemoryFileSystem implements FileSystem {
+  @override
+  final p.Context context;
+
+  final Map<String, Uint8List> _files = {};
+
+  /// The "current directory" in the in-memory virtual file system.
+  ///
+  /// This is used to convert relative paths to absolute paths.
+  String currentDirectory;
+
+  MemoryFileSystem(this.context, this.currentDirectory);
+
+  @override
+  MemoryFileSystemEntity entityForPath(String path) =>
+      new MemoryFileSystemEntity._(
+          this, context.normalize(context.join(currentDirectory, path)));
+
+  @override
+  MemoryFileSystemEntity entityForUri(Uri uri) {
+    if (uri.scheme != 'file') throw new ArgumentError('File URI expected');
+    // Note: we don't have to verify that the URI's path is absolute, because
+    // URIs with non-empty schemes always have absolute paths.
+    return entityForPath(context.fromUri(uri));
+  }
+}
+
+/// Concrete implementation of [FileSystemEntity] for use by
+/// [MemoryFileSystem].
+class MemoryFileSystemEntity implements FileSystemEntity {
+  final MemoryFileSystem _fileSystem;
+
+  @override
+  final String path;
+
+  MemoryFileSystemEntity._(this._fileSystem, this.path);
+
+  @override
+  int get hashCode => path.hashCode;
+
+  @override
+  bool operator ==(Object other) =>
+      other is MemoryFileSystemEntity &&
+      other.path == path &&
+      identical(other._fileSystem, _fileSystem);
+
+  @override
+  Future<List<int>> readAsBytes() async {
+    List<int> contents = _fileSystem._files[path];
+    if (contents != null) {
+      return contents.toList();
+    }
+    throw new Exception('File does not exist');
+  }
+
+  @override
+  Future<String> readAsString() async {
+    List<int> contents = await readAsBytes();
+    return UTF8.decode(contents);
+  }
+
+  /// Writes the given raw bytes to this file system entity.
+  ///
+  /// If no file exists, one is created.  If a file exists already, it is
+  /// overwritten.
+  void writeAsBytesSync(List<int> bytes) {
+    _fileSystem._files[path] = new Uint8List.fromList(bytes);
+  }
+
+  /// Writes the given string to this file system entity.
+  ///
+  /// The string is encoded as UTF-8.
+  ///
+  /// If no file exists, one is created.  If a file exists already, it is
+  /// overwritten.
+  void writeAsStringSync(String s) {
+    // Note: the return type of UTF8.encode is List<int>, but in practice it
+    // always returns Uint8List.  We rely on that for efficiency, so that we
+    // don't have to make an extra copy.
+    _fileSystem._files[path] = UTF8.encode(s) as Uint8List;
+  }
+}
diff --git a/pkg/front_end/lib/physical_file_system.dart b/pkg/front_end/lib/physical_file_system.dart
new file mode 100644
index 0000000..0ed5d8b
--- /dev/null
+++ b/pkg/front_end/lib/physical_file_system.dart
@@ -0,0 +1,59 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 front_end.physical_file_system;
+
+import 'dart:async';
+import 'dart:io' as io;
+
+import 'package:path/path.dart' as p;
+
+import 'file_system.dart';
+
+/// Concrete implementation of [FileSystem] which performs its operations using
+/// I/O.
+///
+/// Not intended to be implemented or extended by clients.
+class PhysicalFileSystem implements FileSystem {
+  static final PhysicalFileSystem instance = new PhysicalFileSystem._();
+
+  PhysicalFileSystem._();
+
+  @override
+  p.Context get context => p.context;
+
+  @override
+  FileSystemEntity entityForPath(String path) =>
+      new _PhysicalFileSystemEntity(context.normalize(context.absolute(path)));
+
+  @override
+  FileSystemEntity entityForUri(Uri uri) {
+    if (uri.scheme != 'file') throw new ArgumentError('File URI expected');
+    // Note: we don't have to verify that the URI's path is absolute, because
+    // URIs with non-empty schemes always have absolute paths.
+    return entityForPath(context.fromUri(uri));
+  }
+}
+
+/// Concrete implementation of [FileSystemEntity] for use by
+/// [PhysicalFileSystem].
+class _PhysicalFileSystemEntity implements FileSystemEntity {
+  @override
+  final String path;
+
+  _PhysicalFileSystemEntity(this.path);
+
+  @override
+  int get hashCode => path.hashCode;
+
+  @override
+  bool operator ==(Object other) =>
+      other is _PhysicalFileSystemEntity && other.path == path;
+
+  @override
+  Future<List<int>> readAsBytes() => new io.File(path).readAsBytes();
+
+  @override
+  Future<String> readAsString() => new io.File(path).readAsString();
+}
diff --git a/pkg/front_end/lib/resolved_ast_generator.dart b/pkg/front_end/lib/resolved_ast_generator.dart
new file mode 100644
index 0000000..4b37d38
--- /dev/null
+++ b/pkg/front_end/lib/resolved_ast_generator.dart
@@ -0,0 +1,61 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// Defines a front-end API for converting source code to resolved ASTs.
+///
+/// Note: this entire library is deprecated.  It is provided as a migration path
+/// until dev_compiler supports Dart Kernel.  Once dev_compiler has been
+/// converted to use Dart Kernel, this functionality will be removed.
+@deprecated
+library front_end.resolved_ast_generator;
+
+import 'dart:async';
+import 'compiler_options.dart';
+import 'package:analyzer/dart/ast/ast.dart' show CompilationUnit;
+import 'package:analyzer/dart/element/element.dart' show LibraryElement;
+
+/// Processes the build unit whose source files are in [sources].
+///
+/// Intended for modular compilation.
+///
+/// [sources] should be the complete set of source files for a build unit
+/// (including both library and part files).  All of the library files are
+/// compiled to resolved ASTs.
+///
+/// The compilation process is hermetic, meaning that the only files which will
+/// be read are those listed in [sources], [CompilerOptions.inputSummaries], and
+/// [CompilerOptions.sdkSummary].  If a source file attempts to refer to a file
+/// which is not obtainable from these paths, that will result in an error, even
+/// if the file exists on the filesystem.
+///
+/// Any `part` declarations found in [sources] must refer to part files which
+/// are also listed in [sources], otherwise an error results.  (It is not
+/// permitted to refer to a part file declared in another build unit).
+@deprecated
+Future<ResolvedAsts> resolvedAstsFor(
+        List<Uri> sources, CompilerOptions options) =>
+    throw new UnimplementedError();
+
+/// Representation of the resolved ASTs of a build unit.
+///
+/// Not intended to be implemented or extended by clients.
+@deprecated
+abstract class ResolvedAsts {
+  /// The resolved ASTs of the build unit's source libraries.
+  ///
+  /// There is one sub-list per source library; each sub-list consists of the
+  /// resolved AST for the library's defining compilation unit, followed by the
+  /// resolved ASTs for any of the library's part files.
+  List<List<CompilationUnit>> get compilationUnits;
+
+  /// Given a [LibraryElement] referred to by [compilationUnits], determine the
+  /// path to the summary that the library originated from.  If the
+  /// [LibraryElement] did not originate from a summary (i.e. because it
+  /// originated from one of the source files of *this* build unit), return
+  /// `null`.
+  ///
+  /// This can be used by the client to determine which build unit any
+  /// referenced element originated from.
+  String getOriginatingSummary(LibraryElement element);
+}
diff --git a/pkg/front_end/lib/src/base/analysis_target.dart b/pkg/front_end/lib/src/base/analysis_target.dart
new file mode 100644
index 0000000..ab50efd
--- /dev/null
+++ b/pkg/front_end/lib/src/base/analysis_target.dart
@@ -0,0 +1,26 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:front_end/src/base/source.dart';
+
+/**
+ * An object with which an analysis result can be associated.
+ *
+ * Clients may implement this class when creating new kinds of targets.
+ * Instances of this type are used in hashed data structures, so subtypes are
+ * required to correctly implement [==] and [hashCode].
+ */
+abstract class AnalysisTarget {
+  /**
+   * If this target is associated with a library, return the source of the
+   * library's defining compilation unit; otherwise return `null`.
+   */
+  Source get librarySource;
+
+  /**
+   * Return the source associated with this target, or `null` if this target is
+   * not associated with a source.
+   */
+  Source get source;
+}
diff --git a/pkg/front_end/lib/src/base/errors.dart b/pkg/front_end/lib/src/base/errors.dart
new file mode 100644
index 0000000..d39953f
--- /dev/null
+++ b/pkg/front_end/lib/src/base/errors.dart
@@ -0,0 +1,282 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/**
+ * An error code associated with an [AnalysisError].
+ *
+ * Generally, we want to provide messages that consist of three sentences. From
+ * the user's perspective these sentences should explain:
+ *
+ * 1. what is wrong,
+ * 2. why is it wrong, and
+ * 3. how do I fix it.
+ *
+ * However, we combine the first two in the [message] and the last in the
+ * [correction].
+ *
+ * When composing messages (including correction messages) keep the following
+ * guidelines in mind.
+ *
+ * 1. The message should be a complete sentence starting with an uppercase
+ * letter, and ending with a period.
+ *
+ * 2. Reserved words and embedded identifiers should be in single quotes, so
+ * prefer double quotes for the complete message. For example,
+ * ```
+ * "The class '{0}' can't use 'super'."
+ * ```
+ * Notice that the word 'class' in the preceding message is not quoted as it
+ * refers to the concept 'class', not the reserved word. On the other hand,
+ * 'super' refers to the reserved word. Do not quote 'null' and numeric literals.
+ *
+ * 3. Do not try to compose messages, as it can make translating them hard.
+ *
+ * 4. Try to keep the error messages short, but informative.
+ *
+ * 5. Use simple words and terminology, assume the reader of the message doesn't
+ * have an advanced degree in math, and that English is not the reader's native
+ * language. Do not assume any formal computer science training. For example, do
+ * not use Latin abbreviations (prefer "that is" over "i.e.", and "for example"
+ * over "e.g."). Also avoid phrases such as "if and only if" and "iff"; that
+ * level of precision is unnecessary.
+ *
+ * 6. Prefer contractions when they are in common use, for example, prefer
+ * "can't" over "cannot". Using "cannot", "must not", "shall not", etc. is
+ * off-putting to people new to programming.
+ *
+ * 7. Use common terminology, preferably from the Dart Language Specification.
+ * This increases the user's chance of finding a good explanation on the web.
+ *
+ * 8. Do not try to be cute or funny. It is extremely frustrating to work on a
+ * product that crashes with a "tongue-in-cheek" message, especially if you did
+ * not want to use this product to begin with.
+ *
+ * 9. Do not lie, that is, do not write error messages containing phrases like
+ * "can't happen".  If the user ever saw this message, it would be a lie. Prefer
+ * messages like: "Internal error: This function should not be called when 'x'
+ * is null.".
+ *
+ * 10. Prefer to not use the imperative tone. That is, the message should not
+ * sound accusing or like it is ordering the user around. The computer should
+ * describe the problem, not criticize the user for violating the specification.
+ */
+abstract class ErrorCode {
+  /**
+   * The name of the error code.
+   */
+  final String name;
+
+  /**
+   * The template used to create the message to be displayed for this error. The
+   * message should indicate what is wrong and why it is wrong.
+   */
+  final String message;
+
+  /**
+   * The template used to create the correction to be displayed for this error,
+   * or `null` if there is no correction information for this error. The
+   * correction should indicate how the user can fix the error.
+   */
+  final String correction;
+
+  /**
+   * Initialize a newly created error code to have the given [name]. The message
+   * associated with the error will be created from the given [message]
+   * template. The correction associated with the error will be created from the
+   * given [correction] template.
+   */
+  const ErrorCode(this.name, this.message, [this.correction]);
+
+  /**
+   * The severity of the error.
+   */
+  ErrorSeverity get errorSeverity;
+
+  /**
+   * The type of the error.
+   */
+  ErrorType get type;
+
+  /**
+   * The unique name of this error code.
+   */
+  String get uniqueName => "$runtimeType.$name";
+
+  @override
+  String toString() => uniqueName;
+}
+
+/**
+ * The severity of an [ErrorCode].
+ */
+class ErrorSeverity implements Comparable<ErrorSeverity> {
+  /**
+   * The severity representing a non-error. This is never used for any error
+   * code, but is useful for clients.
+   */
+  static const ErrorSeverity NONE = const ErrorSeverity('NONE', 0, " ", "none");
+
+  /**
+   * The severity representing an informational level analysis issue.
+   */
+  static const ErrorSeverity INFO = const ErrorSeverity('INFO', 1, "I", "info");
+
+  /**
+   * The severity representing a warning. Warnings can become errors if the `-Werror` command
+   * line flag is specified.
+   */
+  static const ErrorSeverity WARNING =
+      const ErrorSeverity('WARNING', 2, "W", "warning");
+
+  /**
+   * The severity representing an error.
+   */
+  static const ErrorSeverity ERROR =
+      const ErrorSeverity('ERROR', 3, "E", "error");
+
+  static const List<ErrorSeverity> values = const [NONE, INFO, WARNING, ERROR];
+
+  /**
+   * The name of this error code.
+   */
+  final String name;
+
+  /**
+   * The ordinal value of the error code.
+   */
+  final int ordinal;
+
+  /**
+   * The name of the severity used when producing machine output.
+   */
+  final String machineCode;
+
+  /**
+   * The name of the severity used when producing readable output.
+   */
+  final String displayName;
+
+  /**
+   * Initialize a newly created severity with the given names.
+   */
+  const ErrorSeverity(
+      this.name, this.ordinal, this.machineCode, this.displayName);
+
+  @override
+  int get hashCode => ordinal;
+
+  @override
+  int compareTo(ErrorSeverity other) => ordinal - other.ordinal;
+
+  /**
+   * Return the severity constant that represents the greatest severity.
+   */
+  ErrorSeverity max(ErrorSeverity severity) =>
+      this.ordinal >= severity.ordinal ? this : severity;
+
+  @override
+  String toString() => name;
+}
+
+/**
+ * The type of an [ErrorCode].
+ */
+class ErrorType implements Comparable<ErrorType> {
+  /**
+   * Task (todo) comments in user code.
+   */
+  static const ErrorType TODO = const ErrorType('TODO', 0, ErrorSeverity.INFO);
+
+  /**
+   * Extra analysis run over the code to follow best practices, which are not in
+   * the Dart Language Specification.
+   */
+  static const ErrorType HINT = const ErrorType('HINT', 1, ErrorSeverity.INFO);
+
+  /**
+   * Compile-time errors are errors that preclude execution. A compile time
+   * error must be reported by a Dart compiler before the erroneous code is
+   * executed.
+   */
+  static const ErrorType COMPILE_TIME_ERROR =
+      const ErrorType('COMPILE_TIME_ERROR', 2, ErrorSeverity.ERROR);
+
+  /**
+   * Checked mode compile-time errors are errors that preclude execution in
+   * checked mode.
+   */
+  static const ErrorType CHECKED_MODE_COMPILE_TIME_ERROR = const ErrorType(
+      'CHECKED_MODE_COMPILE_TIME_ERROR', 3, ErrorSeverity.ERROR);
+
+  /**
+   * Static warnings are those warnings reported by the static checker. They
+   * have no effect on execution. Static warnings must be provided by Dart
+   * compilers used during development.
+   */
+  static const ErrorType STATIC_WARNING =
+      const ErrorType('STATIC_WARNING', 4, ErrorSeverity.WARNING);
+
+  /**
+   * Many, but not all, static warnings relate to types, in which case they are
+   * known as static type warnings.
+   */
+  static const ErrorType STATIC_TYPE_WARNING =
+      const ErrorType('STATIC_TYPE_WARNING', 5, ErrorSeverity.WARNING);
+
+  /**
+   * Syntactic errors are errors produced as a result of input that does not
+   * conform to the grammar.
+   */
+  static const ErrorType SYNTACTIC_ERROR =
+      const ErrorType('SYNTACTIC_ERROR', 6, ErrorSeverity.ERROR);
+
+  /**
+   * Lint warnings describe style and best practice recommendations that can be
+   * used to formalize a project's style guidelines.
+   */
+  static const ErrorType LINT = const ErrorType('LINT', 7, ErrorSeverity.INFO);
+
+  static const List<ErrorType> values = const [
+    TODO,
+    HINT,
+    COMPILE_TIME_ERROR,
+    CHECKED_MODE_COMPILE_TIME_ERROR,
+    STATIC_WARNING,
+    STATIC_TYPE_WARNING,
+    SYNTACTIC_ERROR,
+    LINT
+  ];
+
+  /**
+   * The name of this error type.
+   */
+  final String name;
+
+  /**
+   * The ordinal value of the error type.
+   */
+  final int ordinal;
+
+  /**
+   * The severity of this type of error.
+   */
+  final ErrorSeverity severity;
+
+  /**
+   * Initialize a newly created error type to have the given [name] and
+   * [severity].
+   */
+  const ErrorType(this.name, this.ordinal, this.severity);
+
+  String get displayName => name.toLowerCase().replaceAll('_', ' ');
+
+  @override
+  int get hashCode => ordinal;
+
+  @override
+  int compareTo(ErrorType other) => ordinal - other.ordinal;
+
+  @override
+  String toString() => name;
+}
diff --git a/pkg/front_end/lib/src/base/jenkins_smi_hash.dart b/pkg/front_end/lib/src/base/jenkins_smi_hash.dart
new file mode 100644
index 0000000..8901ba4
--- /dev/null
+++ b/pkg/front_end/lib/src/base/jenkins_smi_hash.dart
@@ -0,0 +1,53 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// Jenkins hash function, optimized for small integers.
+///
+/// Static methods borrowed from sdk/lib/math/jenkins_smi_hash.dart.  Non-static
+/// methods are an enhancement for the "front_end" package.
+///
+/// Where performance is critical, use [hash2], [hash3], or [hash4], or the
+/// pattern `finish(combine(combine(...combine(0, a), b)..., z))`, where a..z
+/// are hash codes to be combined.
+///
+/// For ease of use, you may also use this pattern:
+/// `(new JenkinsSmiHash()..add(a)..add(b)....add(z)).hashCode`, where a..z are
+/// the sub-objects whose hashes should be combined.  This pattern performs the
+/// same operations as the performance critical variant, but allocates an extra
+/// object.
+class JenkinsSmiHash {
+  /// Accumulates the hash code [value] into the running hash [hash].
+  static int combine(int hash, int value) {
+    hash = 0x1fffffff & (hash + value);
+    hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
+    return hash ^ (hash >> 6);
+  }
+
+  /// Finalizes a running hash produced by [combine].
+  static int finish(int hash) {
+    hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
+    hash = hash ^ (hash >> 11);
+    return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
+  }
+
+  /// Combines together two hash codes.
+  static int hash2(a, b) => finish(combine(combine(0, a), b));
+
+  /// Combines together three hash codes.
+  static int hash3(a, b, c) => finish(combine(combine(combine(0, a), b), c));
+
+  /// Combines together four hash codes.
+  static int hash4(a, b, c, d) =>
+      finish(combine(combine(combine(combine(0, a), b), c), d));
+
+  int _hash = 0;
+
+  /// Accumulates the object [o] into the hash.
+  void add(Object o) {
+    _hash = combine(_hash, o.hashCode);
+  }
+
+  /// Finalizes the hash and return the resulting hashcode.
+  int get hashCode => finish(_hash);
+}
diff --git a/pkg/front_end/lib/src/base/source.dart b/pkg/front_end/lib/src/base/source.dart
new file mode 100644
index 0000000..0ed4747
--- /dev/null
+++ b/pkg/front_end/lib/src/base/source.dart
@@ -0,0 +1,148 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:front_end/src/base/analysis_target.dart';
+import 'package:front_end/src/base/timestamped_data.dart';
+import 'package:front_end/src/base/uri_kind.dart';
+
+/**
+ * The interface `Source` defines the behavior of objects representing source code that can be
+ * analyzed by the analysis engine.
+ *
+ * Implementations of this interface need to be aware of some assumptions made by the analysis
+ * engine concerning sources:
+ * * Sources are not required to be unique. That is, there can be multiple instances representing
+ * the same source.
+ * * Sources are long lived. That is, the engine is allowed to hold on to a source for an extended
+ * period of time and that source must continue to report accurate and up-to-date information.
+ * Because of these assumptions, most implementations will not maintain any state but will delegate
+ * to an authoritative system of record in order to implement this API. For example, a source that
+ * represents files on disk would typically query the file system to determine the state of the
+ * file.
+ *
+ * If the instances that implement this API are the system of record, then they will typically be
+ * unique. In that case, sources that are created that represent non-existent files must also be
+ * retained so that if those files are created at a later date the long-lived sources representing
+ * those files will know that they now exist.
+ */
+abstract class Source implements AnalysisTarget {
+  /**
+   * An empty list of sources.
+   */
+  static const List<Source> EMPTY_LIST = const <Source>[];
+
+  /**
+   * Get the contents and timestamp of this source.
+   *
+   * Clients should consider using the method [AnalysisContext.getContents]
+   * because contexts can have local overrides of the content of a source that the source is not
+   * aware of.
+   *
+   * @return the contents and timestamp of the source
+   * @throws Exception if the contents of this source could not be accessed
+   */
+  TimestampedData<String> get contents;
+
+  /**
+   * Return an encoded representation of this source that can be used to create a source that is
+   * equal to this source.
+   *
+   * @return an encoded representation of this source
+   * See [SourceFactory.fromEncoding].
+   */
+  String get encoding;
+
+  /**
+   * Return the full (long) version of the name that can be displayed to the user to denote this
+   * source. For example, for a source representing a file this would typically be the absolute path
+   * of the file.
+   *
+   * @return a name that can be displayed to the user to denote this source
+   */
+  String get fullName;
+
+  /**
+   * Return a hash code for this source.
+   *
+   * @return a hash code for this source
+   * See [Object.hashCode].
+   */
+  @override
+  int get hashCode;
+
+  /**
+   * Return `true` if this source is in one of the system libraries.
+   *
+   * @return `true` if this is in a system library
+   */
+  bool get isInSystemLibrary;
+
+  @override
+  Source get librarySource => null;
+
+  /**
+   * Return the modification stamp for this source, or a negative value if the
+   * source does not exist. A modification stamp is a non-negative integer with
+   * the property that if the contents of the source have not been modified
+   * since the last time the modification stamp was accessed then the same value
+   * will be returned, but if the contents of the source have been modified one
+   * or more times (even if the net change is zero) the stamps will be different.
+   *
+   * Clients should consider using the method
+   * [AnalysisContext.getModificationStamp] because contexts can have local
+   * overrides of the content of a source that the source is not aware of.
+   */
+  int get modificationStamp;
+
+  /**
+   * Return a short version of the name that can be displayed to the user to denote this source. For
+   * example, for a source representing a file this would typically be the name of the file.
+   *
+   * @return a name that can be displayed to the user to denote this source
+   */
+  String get shortName;
+
+  @override
+  Source get source => this;
+
+  /**
+   * Return the URI from which this source was originally derived.
+   *
+   * @return the URI from which this source was originally derived
+   */
+  Uri get uri;
+
+  /**
+   * Return the kind of URI from which this source was originally derived. If this source was
+   * created from an absolute URI, then the returned kind will reflect the scheme of the absolute
+   * URI. If it was created from a relative URI, then the returned kind will be the same as the kind
+   * of the source against which the relative URI was resolved.
+   *
+   * @return the kind of URI from which this source was originally derived
+   */
+  UriKind get uriKind;
+
+  /**
+   * Return `true` if the given object is a source that represents the same source code as
+   * this source.
+   *
+   * @param object the object to be compared with this object
+   * @return `true` if the given object is a source that represents the same source code as
+   *         this source
+   * See [Object.==].
+   */
+  @override
+  bool operator ==(Object object);
+
+  /**
+   * Return `true` if this source exists.
+   *
+   * Clients should consider using the method [AnalysisContext.exists] because
+   * contexts can have local overrides of the content of a source that the source is not aware of
+   * and a source with local content is considered to exist even if there is no file on disk.
+   *
+   * @return `true` if this source exists
+   */
+  bool exists();
+}
diff --git a/pkg/front_end/lib/src/base/syntactic_entity.dart b/pkg/front_end/lib/src/base/syntactic_entity.dart
new file mode 100644
index 0000000..b21a503
--- /dev/null
+++ b/pkg/front_end/lib/src/base/syntactic_entity.dart
@@ -0,0 +1,26 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/**
+ * Interface representing a syntactic entity (either a token or an AST node)
+ * which has a location and extent in the source file.
+ */
+abstract class SyntacticEntity {
+  /**
+   * Return the offset from the beginning of the file to the character after the
+   * last character of the syntactic entity.
+   */
+  int get end;
+
+  /**
+   * Return the number of characters in the syntactic entity's source range.
+   */
+  int get length;
+
+  /**
+   * Return the offset from the beginning of the file to the first character in
+   * the syntactic entity.
+   */
+  int get offset;
+}
diff --git a/pkg/front_end/lib/src/base/timestamped_data.dart b/pkg/front_end/lib/src/base/timestamped_data.dart
new file mode 100644
index 0000000..4c76dc5
--- /dev/null
+++ b/pkg/front_end/lib/src/base/timestamped_data.dart
@@ -0,0 +1,24 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/**
+ * Analysis data for which we have a modification time.
+ */
+class TimestampedData<E> {
+  /**
+   * The modification time of the source from which the data was created.
+   */
+  final int modificationTime;
+
+  /**
+   * The data that was created from the source.
+   */
+  final E data;
+
+  /**
+   * Initialize a newly created holder to associate the given [data] with the
+   * given [modificationTime].
+   */
+  TimestampedData(this.modificationTime, this.data);
+}
diff --git a/pkg/front_end/lib/src/base/uri_kind.dart b/pkg/front_end/lib/src/base/uri_kind.dart
new file mode 100644
index 0000000..0e6d007
--- /dev/null
+++ b/pkg/front_end/lib/src/base/uri_kind.dart
@@ -0,0 +1,87 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/**
+ * The enumeration `UriKind` defines the different kinds of URI's that are known to the
+ * analysis engine. These are used to keep track of the kind of URI associated with a given source.
+ */
+class UriKind implements Comparable<UriKind> {
+  /**
+   * A 'dart:' URI.
+   */
+  static const UriKind DART_URI = const UriKind('DART_URI', 0, 0x64);
+
+  /**
+   * A 'file:' URI.
+   */
+  static const UriKind FILE_URI = const UriKind('FILE_URI', 1, 0x66);
+
+  /**
+   * A 'package:' URI.
+   */
+  static const UriKind PACKAGE_URI = const UriKind('PACKAGE_URI', 2, 0x70);
+
+  static const List<UriKind> values = const [DART_URI, FILE_URI, PACKAGE_URI];
+
+  /**
+   * The name of this URI kind.
+   */
+  final String name;
+
+  /**
+   * The ordinal value of the URI kind.
+   */
+  final int ordinal;
+
+  /**
+   * The single character encoding used to identify this kind of URI.
+   */
+  final int encoding;
+
+  /**
+   * Initialize a newly created URI kind to have the given encoding.
+   */
+  const UriKind(this.name, this.ordinal, this.encoding);
+
+  @override
+  int get hashCode => ordinal;
+
+  @override
+  int compareTo(UriKind other) => ordinal - other.ordinal;
+
+  @override
+  String toString() => name;
+
+  /**
+   * Return the URI kind represented by the given [encoding], or `null` if there
+   * is no kind with the given encoding.
+   */
+  static UriKind fromEncoding(int encoding) {
+    while (true) {
+      if (encoding == 0x64) {
+        return DART_URI;
+      } else if (encoding == 0x66) {
+        return FILE_URI;
+      } else if (encoding == 0x70) {
+        return PACKAGE_URI;
+      }
+      break;
+    }
+    return null;
+  }
+
+  /**
+   * Return the URI kind corresponding to the given scheme string.
+   */
+  static UriKind fromScheme(String scheme) {
+    if (scheme == 'package') {
+      return UriKind.PACKAGE_URI;
+    } else if (scheme == 'dart') {
+      return UriKind.DART_URI;
+    } else if (scheme == 'file') {
+      return UriKind.FILE_URI;
+    }
+    return UriKind.FILE_URI;
+  }
+}
diff --git a/pkg/front_end/lib/src/scanner/errors.dart b/pkg/front_end/lib/src/scanner/errors.dart
new file mode 100644
index 0000000..bcf0c56
--- /dev/null
+++ b/pkg/front_end/lib/src/scanner/errors.dart
@@ -0,0 +1,59 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:front_end/src/base/errors.dart';
+
+/**
+ * The error codes used for errors detected by the scanner.
+ */
+class ScannerErrorCode extends ErrorCode {
+  /**
+   * Parameters:
+   * 0: the illegal character
+   */
+  static const ScannerErrorCode ILLEGAL_CHARACTER =
+      const ScannerErrorCode('ILLEGAL_CHARACTER', "Illegal character '{0}'.");
+
+  static const ScannerErrorCode MISSING_DIGIT =
+      const ScannerErrorCode('MISSING_DIGIT', "Decimal digit expected.");
+
+  static const ScannerErrorCode MISSING_HEX_DIGIT = const ScannerErrorCode(
+      'MISSING_HEX_DIGIT', "Hexidecimal digit expected.");
+
+  static const ScannerErrorCode MISSING_QUOTE =
+      const ScannerErrorCode('MISSING_QUOTE', "Expected quote (' or \").");
+
+  /**
+   * Parameters:
+   * 0: the path of the file that cannot be read
+   */
+  static const ScannerErrorCode UNABLE_GET_CONTENT = const ScannerErrorCode(
+      'UNABLE_GET_CONTENT', "Unable to get content of '{0}'.");
+
+  static const ScannerErrorCode UNTERMINATED_MULTI_LINE_COMMENT =
+      const ScannerErrorCode(
+          'UNTERMINATED_MULTI_LINE_COMMENT',
+          "Unterminated multi-line comment.",
+          "Try terminating the comment with '*/', or "
+          "removing any unbalanced occurances of '/*' (because comments nest in Dart).");
+
+  static const ScannerErrorCode UNTERMINATED_STRING_LITERAL =
+      const ScannerErrorCode(
+          'UNTERMINATED_STRING_LITERAL', "Unterminated string literal.");
+
+  /**
+   * Initialize a newly created error code to have the given [name]. The message
+   * associated with the error will be created from the given [message]
+   * template. The correction associated with the error will be created from the
+   * given [correction] template.
+   */
+  const ScannerErrorCode(String name, String message, [String correction])
+      : super(name, message, correction);
+
+  @override
+  ErrorSeverity get errorSeverity => ErrorSeverity.ERROR;
+
+  @override
+  ErrorType get type => ErrorType.SYNTACTIC_ERROR;
+}
diff --git a/pkg/front_end/lib/src/scanner/interner.dart b/pkg/front_end/lib/src/scanner/interner.dart
new file mode 100644
index 0000000..9f248c9
--- /dev/null
+++ b/pkg/front_end/lib/src/scanner/interner.dart
@@ -0,0 +1,24 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/**
+ * The interface `Interner` defines the behavior of objects that can intern
+ * strings.
+ */
+abstract class Interner {
+  /**
+   * Return a string that is identical to all of the other strings that have
+   * been interned that are equal to the given [string].
+   */
+  String intern(String string);
+}
+
+/**
+ * The class `NullInterner` implements an interner that does nothing (does not
+ * actually intern any strings).
+ */
+class NullInterner implements Interner {
+  @override
+  String intern(String string) => string;
+}
diff --git a/pkg/front_end/lib/src/scanner/reader.dart b/pkg/front_end/lib/src/scanner/reader.dart
new file mode 100644
index 0000000..b079139
--- /dev/null
+++ b/pkg/front_end/lib/src/scanner/reader.dart
@@ -0,0 +1,133 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/**
+ * An object used by the scanner to read the characters to be scanned.
+ */
+abstract class CharacterReader {
+  /**
+   * The current offset relative to the beginning of the source. Return the
+   * initial offset if the scanner has not yet scanned the source code, and one
+   * (1) past the end of the source code if the entire source code has been
+   * scanned.
+   */
+  int get offset;
+
+  /**
+   * Set the current offset relative to the beginning of the source to the given
+   * [offset]. The new offset must be between the initial offset and one (1)
+   * past the end of the source code.
+   */
+  void set offset(int offset);
+
+  /**
+   * Advance the current position and return the character at the new current
+   * position.
+   */
+  int advance();
+
+  /**
+   * Return the substring of the source code between the [start] offset and the
+   * modified current position. The current position is modified by adding the
+   * [endDelta], which is the number of characters after the current location to
+   * be included in the string, or the number of characters before the current
+   * location to be excluded if the offset is negative.
+   */
+  String getString(int start, int endDelta);
+
+  /**
+   * Return the character at the current position without changing the current
+   * position.
+   */
+  int peek();
+}
+
+/**
+ * A [CharacterReader] that reads characters from a character sequence.
+ */
+class CharSequenceReader implements CharacterReader {
+  /**
+   * The sequence from which characters will be read.
+   */
+  final String _sequence;
+
+  /**
+   * The number of characters in the string.
+   */
+  int _stringLength;
+
+  /**
+   * The index, relative to the string, of the next character to be read.
+   */
+  int _charOffset;
+
+  /**
+   * Initialize a newly created reader to read the characters in the given
+   * [_sequence].
+   */
+  CharSequenceReader(this._sequence) {
+    this._stringLength = _sequence.length;
+    this._charOffset = 0;
+  }
+
+  @override
+  int get offset => _charOffset - 1;
+
+  @override
+  void set offset(int offset) {
+    _charOffset = offset + 1;
+  }
+
+  @override
+  int advance() {
+    if (_charOffset >= _stringLength) {
+      return -1;
+    }
+    return _sequence.codeUnitAt(_charOffset++);
+  }
+
+  @override
+  String getString(int start, int endDelta) =>
+      _sequence.substring(start, _charOffset + endDelta);
+
+  @override
+  int peek() {
+    if (_charOffset >= _stringLength) {
+      return -1;
+    }
+    return _sequence.codeUnitAt(_charOffset);
+  }
+}
+
+/**
+ * A [CharacterReader] that reads characters from a character sequence, but adds
+ * a delta when reporting the current character offset so that the character
+ * sequence can be a subsequence from a larger sequence.
+ */
+class SubSequenceReader extends CharSequenceReader {
+  /**
+   * The offset from the beginning of the file to the beginning of the source
+   * being scanned.
+   */
+  final int _offsetDelta;
+
+  /**
+   * Initialize a newly created reader to read the characters in the given
+   * [sequence]. The [_offsetDelta] is the offset from the beginning of the file
+   * to the beginning of the source being scanned
+   */
+  SubSequenceReader(String sequence, this._offsetDelta) : super(sequence);
+
+  @override
+  int get offset => _offsetDelta + super.offset;
+
+  @override
+  void set offset(int offset) {
+    super.offset = offset - _offsetDelta;
+  }
+
+  @override
+  String getString(int start, int endDelta) =>
+      super.getString(start - _offsetDelta, endDelta);
+}
diff --git a/pkg/front_end/lib/src/scanner/scanner.dart b/pkg/front_end/lib/src/scanner/scanner.dart
new file mode 100644
index 0000000..be259fc
--- /dev/null
+++ b/pkg/front_end/lib/src/scanner/scanner.dart
@@ -0,0 +1,1341 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:charcode/ascii.dart';
+import 'package:front_end/src/scanner/errors.dart';
+import 'package:front_end/src/scanner/reader.dart';
+import 'package:front_end/src/scanner/string_utilities.dart';
+import 'package:front_end/src/scanner/token.dart';
+
+/**
+ * A state in a state machine used to scan keywords.
+ */
+class KeywordState {
+  /**
+   * An empty transition table used by leaf states.
+   */
+  static List<KeywordState> _EMPTY_TABLE = new List<KeywordState>(26);
+
+  /**
+   * The initial state in the state machine.
+   */
+  static final KeywordState KEYWORD_STATE = _createKeywordStateTable();
+
+  /**
+   * A table mapping characters to the states to which those characters will
+   * transition. (The index into the array is the offset from the character
+   * `'a'` to the transitioning character.)
+   */
+  final List<KeywordState> _table;
+
+  /**
+   * The keyword that is recognized by this state, or `null` if this state is
+   * not a terminal state.
+   */
+  Keyword _keyword;
+
+  /**
+   * Initialize a newly created state to have the given transitions and to
+   * recognize the keyword with the given [syntax].
+   */
+  KeywordState(this._table, String syntax) {
+    this._keyword = (syntax == null) ? null : Keyword.keywords[syntax];
+  }
+
+  /**
+   * Return the keyword that was recognized by this state, or `null` if this
+   * state does not recognized a keyword.
+   */
+  Keyword keyword() => _keyword;
+
+  /**
+   * Return the state that follows this state on a transition of the given
+   * [character], or `null` if there is no valid state reachable from this state
+   * with such a transition.
+   */
+  KeywordState next(int character) => _table[character - $a];
+
+  /**
+   * Create the next state in the state machine where we have already recognized
+   * the subset of strings in the given array of [strings] starting at the given
+   * [offset] and having the given [length]. All of these strings have a common
+   * prefix and the next character is at the given [start] index.
+   */
+  static KeywordState _computeKeywordStateTable(
+      int start, List<String> strings, int offset, int length) {
+    List<KeywordState> result = new List<KeywordState>(26);
+    assert(length != 0);
+    int chunk = $nul;
+    int chunkStart = -1;
+    bool isLeaf = false;
+    for (int i = offset; i < offset + length; i++) {
+      if (strings[i].length == start) {
+        isLeaf = true;
+      }
+      if (strings[i].length > start) {
+        int c = strings[i].codeUnitAt(start);
+        if (chunk != c) {
+          if (chunkStart != -1) {
+            result[chunk - $a] = _computeKeywordStateTable(
+                start + 1, strings, chunkStart, i - chunkStart);
+          }
+          chunkStart = i;
+          chunk = c;
+        }
+      }
+    }
+    if (chunkStart != -1) {
+      assert(result[chunk - $a] == null);
+      result[chunk - $a] = _computeKeywordStateTable(
+          start + 1, strings, chunkStart, offset + length - chunkStart);
+    } else {
+      assert(length == 1);
+      return new KeywordState(_EMPTY_TABLE, strings[offset]);
+    }
+    if (isLeaf) {
+      return new KeywordState(result, strings[offset]);
+    } else {
+      return new KeywordState(result, null);
+    }
+  }
+
+  /**
+   * Create and return the initial state in the state machine.
+   */
+  static KeywordState _createKeywordStateTable() {
+    List<Keyword> values = Keyword.values;
+    List<String> strings = new List<String>(values.length);
+    for (int i = 0; i < values.length; i++) {
+      strings[i] = values[i].syntax;
+    }
+    strings.sort();
+    return _computeKeywordStateTable(0, strings, 0, strings.length);
+  }
+}
+
+/**
+ * The class `Scanner` implements a scanner for Dart code.
+ *
+ * The lexical structure of Dart is ambiguous without knowledge of the context
+ * in which a token is being scanned. For example, without context we cannot
+ * determine whether source of the form "<<" should be scanned as a single
+ * left-shift operator or as two left angle brackets. This scanner does not have
+ * any context, so it always resolves such conflicts by scanning the longest
+ * possible token.
+ */
+abstract class Scanner {
+  /**
+   * The reader used to access the characters in the source.
+   */
+  final CharacterReader _reader;
+
+  /**
+   * The flag specifying whether documentation comments should be parsed.
+   */
+  bool _preserveComments = true;
+
+  /**
+   * The token pointing to the head of the linked list of tokens.
+   */
+  Token _tokens;
+
+  /**
+   * The last token that was scanned.
+   */
+  Token _tail;
+
+  /**
+   * The first token in the list of comment tokens found since the last
+   * non-comment token.
+   */
+  Token _firstComment;
+
+  /**
+   * The last token in the list of comment tokens found since the last
+   * non-comment token.
+   */
+  Token _lastComment;
+
+  /**
+   * The index of the first character of the current token.
+   */
+  int _tokenStart = 0;
+
+  /**
+   * A list containing the offsets of the first character of each line in the
+   * source code.
+   */
+  List<int> _lineStarts = new List<int>();
+
+  /**
+   * A list, treated something like a stack, of tokens representing the
+   * beginning of a matched pair. It is used to pair the end tokens with the
+   * begin tokens.
+   */
+  List<BeginToken> _groupingStack = new List<BeginToken>();
+
+  /**
+   * The index of the last item in the [_groupingStack], or `-1` if the stack is
+   * empty.
+   */
+  int _stackEnd = -1;
+
+  /**
+   * A flag indicating whether any unmatched groups were found during the parse.
+   */
+  bool _hasUnmatchedGroups = false;
+
+  /**
+   * A flag indicating whether to parse generic method comments, of the form
+   * `/*=T*/` and `/*<T>*/`.
+   */
+  bool scanGenericMethodComments = false;
+
+  /**
+   * A flag indicating whether the lazy compound assignment operators '&&=' and
+   * '||=' are enabled.
+   */
+  bool scanLazyAssignmentOperators = false;
+
+  /**
+   * Initialize a newly created scanner to scan characters from the given
+   * character [_reader].
+   */
+  Scanner(this._reader) {
+    _tokens = new Token(TokenType.EOF, -1);
+    _tokens.setNext(_tokens);
+    _tail = _tokens;
+    _tokenStart = -1;
+    _lineStarts.add(0);
+  }
+
+  /**
+   * Return the first token in the token stream that was scanned.
+   */
+  Token get firstToken => _tokens.next;
+
+  /**
+   * Return `true` if any unmatched groups were found during the parse.
+   */
+  bool get hasUnmatchedGroups => _hasUnmatchedGroups;
+
+  /**
+   * Return an array containing the offsets of the first character of each line
+   * in the source code.
+   */
+  List<int> get lineStarts => _lineStarts;
+
+  /**
+   * Set whether documentation tokens should be preserved.
+   */
+  void set preserveComments(bool preserveComments) {
+    this._preserveComments = preserveComments;
+  }
+
+  /**
+   * Return the last token that was scanned.
+   */
+  Token get tail => _tail;
+
+  /**
+   * Append the given [token] to the end of the token stream being scanned. This
+   * method is intended to be used by subclasses that copy existing tokens and
+   * should not normally be used because it will fail to correctly associate any
+   * comments with the token being passed in.
+   */
+  void appendToken(Token token) {
+    _tail = _tail.setNext(token);
+  }
+
+  int bigSwitch(int next) {
+    _beginToken();
+    if (next == $cr) {
+      // '\r'
+      next = _reader.advance();
+      if (next == $lf) {
+        // '\n'
+        next = _reader.advance();
+      }
+      recordStartOfLine();
+      return next;
+    } else if (next == $lf) {
+      // '\n'
+      next = _reader.advance();
+      recordStartOfLine();
+      return next;
+    } else if (next == $tab || next == $space) {
+      // '\t' || ' '
+      return _reader.advance();
+    }
+    if (next == $r) {
+      // 'r'
+      int peek = _reader.peek();
+      if (peek == $double_quote || peek == $single_quote) {
+        // '"' || "'"
+        int start = _reader.offset;
+        return _tokenizeString(_reader.advance(), start, true);
+      }
+    }
+    if ($a <= next && next <= $z) {
+      // 'a'-'z'
+      return _tokenizeKeywordOrIdentifier(next, true);
+    }
+    if (($A <= next && next <= $Z) || next == $_ || next == $$) {
+      // 'A'-'Z' || '_' || '$'
+      return _tokenizeIdentifier(next, _reader.offset, true);
+    }
+    if (next == $lt) {
+      // '<'
+      return _tokenizeLessThan(next);
+    }
+    if (next == $gt) {
+      // '>'
+      return _tokenizeGreaterThan(next);
+    }
+    if (next == $equal) {
+      // '='
+      return _tokenizeEquals(next);
+    }
+    if (next == $exclamation) {
+      // '!'
+      return _tokenizeExclamation(next);
+    }
+    if (next == $plus) {
+      // '+'
+      return _tokenizePlus(next);
+    }
+    if (next == $minus) {
+      // '-'
+      return _tokenizeMinus(next);
+    }
+    if (next == $asterisk) {
+      // '*'
+      return _tokenizeMultiply(next);
+    }
+    if (next == $percent) {
+      // '%'
+      return _tokenizePercent(next);
+    }
+    if (next == $ampersand) {
+      // '&'
+      return _tokenizeAmpersand(next);
+    }
+    if (next == $bar) {
+      // '|'
+      return _tokenizeBar(next);
+    }
+    if (next == $caret) {
+      // '^'
+      return _tokenizeCaret(next);
+    }
+    if (next == $open_bracket) {
+      // '['
+      return _tokenizeOpenSquareBracket(next);
+    }
+    if (next == $tilde) {
+      // '~'
+      return _tokenizeTilde(next);
+    }
+    if (next == $backslash) {
+      // '\\'
+      _appendTokenOfType(TokenType.BACKSLASH);
+      return _reader.advance();
+    }
+    if (next == $hash) {
+      // '#'
+      return _tokenizeTag(next);
+    }
+    if (next == $open_paren) {
+      // '('
+      _appendBeginToken(TokenType.OPEN_PAREN);
+      return _reader.advance();
+    }
+    if (next == $close_paren) {
+      // ')'
+      _appendEndToken(TokenType.CLOSE_PAREN, TokenType.OPEN_PAREN);
+      return _reader.advance();
+    }
+    if (next == $comma) {
+      // ','
+      _appendTokenOfType(TokenType.COMMA);
+      return _reader.advance();
+    }
+    if (next == $colon) {
+      // ':'
+      _appendTokenOfType(TokenType.COLON);
+      return _reader.advance();
+    }
+    if (next == $semicolon) {
+      // ';'
+      _appendTokenOfType(TokenType.SEMICOLON);
+      return _reader.advance();
+    }
+    if (next == $question) {
+      // '?'
+      return _tokenizeQuestion();
+    }
+    if (next == $close_bracket) {
+      // ']'
+      _appendEndToken(
+          TokenType.CLOSE_SQUARE_BRACKET, TokenType.OPEN_SQUARE_BRACKET);
+      return _reader.advance();
+    }
+    if (next == $backquote) {
+      // '`'
+      _appendTokenOfType(TokenType.BACKPING);
+      return _reader.advance();
+    }
+    if (next == $lbrace) {
+      // '{'
+      _appendBeginToken(TokenType.OPEN_CURLY_BRACKET);
+      return _reader.advance();
+    }
+    if (next == $rbrace) {
+      // '}'
+      _appendEndToken(
+          TokenType.CLOSE_CURLY_BRACKET, TokenType.OPEN_CURLY_BRACKET);
+      return _reader.advance();
+    }
+    if (next == $slash) {
+      // '/'
+      return _tokenizeSlashOrComment(next);
+    }
+    if (next == $at) {
+      // '@'
+      _appendTokenOfType(TokenType.AT);
+      return _reader.advance();
+    }
+    if (next == $double_quote || next == $single_quote) {
+      // '"' || "'"
+      return _tokenizeString(next, _reader.offset, false);
+    }
+    if (next == $dot) {
+      // '.'
+      return _tokenizeDotOrNumber(next);
+    }
+    if (next == $0) {
+      // '0'
+      return _tokenizeHexOrNumber(next);
+    }
+    if ($1 <= next && next <= $9) {
+      // '1'-'9'
+      return _tokenizeNumber(next);
+    }
+    if (next == -1) {
+      // EOF
+      return -1;
+    }
+    _reportError(ScannerErrorCode.ILLEGAL_CHARACTER, [next]);
+    return _reader.advance();
+  }
+
+  /**
+   * Record the fact that we are at the beginning of a new line in the source.
+   */
+  void recordStartOfLine() {
+    _lineStarts.add(_reader.offset);
+  }
+
+  /**
+   * Report an error at the given offset. The [errorCode] is the error code
+   * indicating the nature of the error. The [arguments] are any arguments
+   * needed to complete the error message
+   */
+  void reportError(
+      ScannerErrorCode errorCode, int offset, List<Object> arguments);
+
+  /**
+   * Record that the source begins on the given [line] and [column] at the
+   * current offset as given by the reader. Both the line and the column are
+   * one-based indexes. The line starts for lines before the given line will not
+   * be correct.
+   *
+   * This method must be invoked at most one time and must be invoked before
+   * scanning begins. The values provided must be sensible. The results are
+   * undefined if these conditions are violated.
+   */
+  void setSourceStart(int line, int column) {
+    int offset = _reader.offset;
+    if (line < 1 || column < 1 || offset < 0 || (line + column - 2) >= offset) {
+      return;
+    }
+    for (int i = 2; i < line; i++) {
+      _lineStarts.add(1);
+    }
+    _lineStarts.add(offset - column + 1);
+  }
+
+  /**
+   * Scan the source code to produce a list of tokens representing the source,
+   * and return the first token in the list of tokens that were produced.
+   */
+  Token tokenize() {
+    int next = _reader.advance();
+    while (next != -1) {
+      next = bigSwitch(next);
+    }
+    _appendEofToken();
+    return firstToken;
+  }
+
+  void _appendBeginToken(TokenType type) {
+    BeginToken token;
+    if (_firstComment == null) {
+      token = new BeginToken(type, _tokenStart);
+    } else {
+      token = new BeginTokenWithComment(type, _tokenStart, _firstComment);
+      _firstComment = null;
+      _lastComment = null;
+    }
+    _tail = _tail.setNext(token);
+    _groupingStack.add(token);
+    _stackEnd++;
+  }
+
+  void _appendCommentToken(TokenType type, String value) {
+    CommentToken token = null;
+    TokenType genericComment = _matchGenericMethodCommentType(value);
+    if (genericComment != null) {
+      token = new CommentToken(genericComment, value, _tokenStart);
+    } else if (!_preserveComments) {
+      // Ignore comment tokens if client specified that it doesn't need them.
+      return;
+    } else {
+      // OK, remember comment tokens.
+      if (_isDocumentationComment(value)) {
+        token = new DocumentationCommentToken(type, value, _tokenStart);
+      } else {
+        token = new CommentToken(type, value, _tokenStart);
+      }
+    }
+    if (_firstComment == null) {
+      _firstComment = token;
+      _lastComment = _firstComment;
+    } else {
+      _lastComment = _lastComment.setNext(token);
+    }
+  }
+
+  void _appendEndToken(TokenType type, TokenType beginType) {
+    Token token;
+    if (_firstComment == null) {
+      token = new Token(type, _tokenStart);
+    } else {
+      token = new TokenWithComment(type, _tokenStart, _firstComment);
+      _firstComment = null;
+      _lastComment = null;
+    }
+    _tail = _tail.setNext(token);
+    if (_stackEnd >= 0) {
+      BeginToken begin = _groupingStack[_stackEnd];
+      if (begin.type == beginType) {
+        begin.endToken = token;
+        _groupingStack.removeAt(_stackEnd--);
+      }
+    }
+  }
+
+  void _appendEofToken() {
+    Token eofToken;
+    if (_firstComment == null) {
+      eofToken = new Token(TokenType.EOF, _reader.offset + 1);
+    } else {
+      eofToken = new TokenWithComment(
+          TokenType.EOF, _reader.offset + 1, _firstComment);
+      _firstComment = null;
+      _lastComment = null;
+    }
+    // The EOF token points to itself so that there is always infinite
+    // look-ahead.
+    eofToken.setNext(eofToken);
+    _tail = _tail.setNext(eofToken);
+    if (_stackEnd >= 0) {
+      _hasUnmatchedGroups = true;
+      // TODO(brianwilkerson) Fix the ungrouped tokens?
+    }
+  }
+
+  void _appendKeywordToken(Keyword keyword) {
+    if (_firstComment == null) {
+      _tail = _tail.setNext(new KeywordToken(keyword, _tokenStart));
+    } else {
+      _tail = _tail.setNext(
+          new KeywordTokenWithComment(keyword, _tokenStart, _firstComment));
+      _firstComment = null;
+      _lastComment = null;
+    }
+  }
+
+  void _appendStringToken(TokenType type, String value) {
+    if (_firstComment == null) {
+      _tail = _tail.setNext(new StringToken(type, value, _tokenStart));
+    } else {
+      _tail = _tail.setNext(
+          new StringTokenWithComment(type, value, _tokenStart, _firstComment));
+      _firstComment = null;
+      _lastComment = null;
+    }
+  }
+
+  void _appendStringTokenWithOffset(TokenType type, String value, int offset) {
+    if (_firstComment == null) {
+      _tail = _tail.setNext(new StringToken(type, value, _tokenStart + offset));
+    } else {
+      _tail = _tail.setNext(new StringTokenWithComment(
+          type, value, _tokenStart + offset, _firstComment));
+      _firstComment = null;
+      _lastComment = null;
+    }
+  }
+
+  void _appendTokenOfType(TokenType type) {
+    if (_firstComment == null) {
+      _tail = _tail.setNext(new Token(type, _tokenStart));
+    } else {
+      _tail =
+          _tail.setNext(new TokenWithComment(type, _tokenStart, _firstComment));
+      _firstComment = null;
+      _lastComment = null;
+    }
+  }
+
+  void _appendTokenOfTypeWithOffset(TokenType type, int offset) {
+    if (_firstComment == null) {
+      _tail = _tail.setNext(new Token(type, offset));
+    } else {
+      _tail = _tail.setNext(new TokenWithComment(type, offset, _firstComment));
+      _firstComment = null;
+      _lastComment = null;
+    }
+  }
+
+  void _beginToken() {
+    _tokenStart = _reader.offset;
+  }
+
+  /**
+   * Return the beginning token corresponding to a closing brace that was found
+   * while scanning inside a string interpolation expression. Tokens that cannot
+   * be matched with the closing brace will be dropped from the stack.
+   */
+  BeginToken _findTokenMatchingClosingBraceInInterpolationExpression() {
+    while (_stackEnd >= 0) {
+      BeginToken begin = _groupingStack[_stackEnd];
+      if (begin.type == TokenType.OPEN_CURLY_BRACKET ||
+          begin.type == TokenType.STRING_INTERPOLATION_EXPRESSION) {
+        return begin;
+      }
+      _hasUnmatchedGroups = true;
+      _groupingStack.removeAt(_stackEnd--);
+    }
+    //
+    // We should never get to this point because we wouldn't be inside a string
+    // interpolation expression unless we had previously found the start of the
+    // expression.
+    //
+    return null;
+  }
+
+  /**
+   * Checks if [value] is the start of a generic method type annotation comment.
+   *
+   * This can either be of the form `/*<T>*/` or `/*=T*/`. The token type is
+   * returned, or null if it was not a generic method comment.
+   */
+  TokenType _matchGenericMethodCommentType(String value) {
+    if (scanGenericMethodComments) {
+      // Match /*< and >*/
+      if (StringUtilities.startsWith3(value, 0, $slash, $asterisk, $lt) &&
+          StringUtilities.endsWith3(value, $gt, $asterisk, $slash)) {
+        return TokenType.GENERIC_METHOD_TYPE_LIST;
+      }
+      // Match /*=
+      if (StringUtilities.startsWith3(value, 0, $slash, $asterisk, $equal)) {
+        return TokenType.GENERIC_METHOD_TYPE_ASSIGN;
+      }
+    }
+    return null;
+  }
+
+  /**
+   * Report an error at the current offset. The [errorCode] is the error code
+   * indicating the nature of the error. The [arguments] are any arguments
+   * needed to complete the error message
+   */
+  void _reportError(ScannerErrorCode errorCode, [List<Object> arguments]) {
+    reportError(errorCode, _reader.offset, arguments);
+  }
+
+  int _select(int choice, TokenType yesType, TokenType noType) {
+    int next = _reader.advance();
+    if (next == choice) {
+      _appendTokenOfType(yesType);
+      return _reader.advance();
+    } else {
+      _appendTokenOfType(noType);
+      return next;
+    }
+  }
+
+  int _selectWithOffset(
+      int choice, TokenType yesType, TokenType noType, int offset) {
+    int next = _reader.advance();
+    if (next == choice) {
+      _appendTokenOfTypeWithOffset(yesType, offset);
+      return _reader.advance();
+    } else {
+      _appendTokenOfTypeWithOffset(noType, offset);
+      return next;
+    }
+  }
+
+  int _tokenizeAmpersand(int next) {
+    // &&= && &= &
+    next = _reader.advance();
+    if (next == $ampersand) {
+      next = _reader.advance();
+      if (scanLazyAssignmentOperators && next == $equal) {
+        _appendTokenOfType(TokenType.AMPERSAND_AMPERSAND_EQ);
+        return _reader.advance();
+      }
+      _appendTokenOfType(TokenType.AMPERSAND_AMPERSAND);
+      return next;
+    } else if (next == $equal) {
+      _appendTokenOfType(TokenType.AMPERSAND_EQ);
+      return _reader.advance();
+    } else {
+      _appendTokenOfType(TokenType.AMPERSAND);
+      return next;
+    }
+  }
+
+  int _tokenizeBar(int next) {
+    // ||= || |= |
+    next = _reader.advance();
+    if (next == $bar) {
+      next = _reader.advance();
+      if (scanLazyAssignmentOperators && next == $equal) {
+        _appendTokenOfType(TokenType.BAR_BAR_EQ);
+        return _reader.advance();
+      }
+      _appendTokenOfType(TokenType.BAR_BAR);
+      return next;
+    } else if (next == $equal) {
+      _appendTokenOfType(TokenType.BAR_EQ);
+      return _reader.advance();
+    } else {
+      _appendTokenOfType(TokenType.BAR);
+      return next;
+    }
+  }
+
+  int _tokenizeCaret(int next) =>
+      _select($equal, TokenType.CARET_EQ, TokenType.CARET);
+
+  int _tokenizeDotOrNumber(int next) {
+    int start = _reader.offset;
+    next = _reader.advance();
+    if ($0 <= next && next <= $9) {
+      return _tokenizeFractionPart(next, start);
+    } else if ($dot == next) {
+      return _select(
+          $dot, TokenType.PERIOD_PERIOD_PERIOD, TokenType.PERIOD_PERIOD);
+    } else {
+      _appendTokenOfType(TokenType.PERIOD);
+      return next;
+    }
+  }
+
+  int _tokenizeEquals(int next) {
+    // = == =>
+    next = _reader.advance();
+    if (next == $equal) {
+      _appendTokenOfType(TokenType.EQ_EQ);
+      return _reader.advance();
+    } else if (next == $gt) {
+      _appendTokenOfType(TokenType.FUNCTION);
+      return _reader.advance();
+    }
+    _appendTokenOfType(TokenType.EQ);
+    return next;
+  }
+
+  int _tokenizeExclamation(int next) {
+    // ! !=
+    next = _reader.advance();
+    if (next == $equal) {
+      _appendTokenOfType(TokenType.BANG_EQ);
+      return _reader.advance();
+    }
+    _appendTokenOfType(TokenType.BANG);
+    return next;
+  }
+
+  int _tokenizeExponent(int next) {
+    if (next == $plus || next == $minus) {
+      next = _reader.advance();
+    }
+    bool hasDigits = false;
+    while (true) {
+      if ($0 <= next && next <= $9) {
+        hasDigits = true;
+      } else {
+        if (!hasDigits) {
+          _reportError(ScannerErrorCode.MISSING_DIGIT);
+        }
+        return next;
+      }
+      next = _reader.advance();
+    }
+  }
+
+  int _tokenizeFractionPart(int next, int start) {
+    bool done = false;
+    bool hasDigit = false;
+    LOOP:
+    while (!done) {
+      if ($0 <= next && next <= $9) {
+        hasDigit = true;
+      } else if ($e == next || $E == next) {
+        hasDigit = true;
+        next = _tokenizeExponent(_reader.advance());
+        done = true;
+        continue LOOP;
+      } else {
+        done = true;
+        continue LOOP;
+      }
+      next = _reader.advance();
+    }
+    if (!hasDigit) {
+      _appendStringToken(TokenType.INT, _reader.getString(start, -2));
+      if ($dot == next) {
+        return _selectWithOffset($dot, TokenType.PERIOD_PERIOD_PERIOD,
+            TokenType.PERIOD_PERIOD, _reader.offset - 1);
+      }
+      _appendTokenOfTypeWithOffset(TokenType.PERIOD, _reader.offset - 1);
+      return bigSwitch(next);
+    }
+    _appendStringToken(
+        TokenType.DOUBLE, _reader.getString(start, next < 0 ? 0 : -1));
+    return next;
+  }
+
+  int _tokenizeGreaterThan(int next) {
+    // > >= >> >>=
+    next = _reader.advance();
+    if ($equal == next) {
+      _appendTokenOfType(TokenType.GT_EQ);
+      return _reader.advance();
+    } else if ($gt == next) {
+      next = _reader.advance();
+      if ($equal == next) {
+        _appendTokenOfType(TokenType.GT_GT_EQ);
+        return _reader.advance();
+      } else {
+        _appendTokenOfType(TokenType.GT_GT);
+        return next;
+      }
+    } else {
+      _appendTokenOfType(TokenType.GT);
+      return next;
+    }
+  }
+
+  int _tokenizeHex(int next) {
+    int start = _reader.offset - 1;
+    bool hasDigits = false;
+    while (true) {
+      next = _reader.advance();
+      if (($0 <= next && next <= $9) ||
+          ($A <= next && next <= $F) ||
+          ($a <= next && next <= $f)) {
+        hasDigits = true;
+      } else {
+        if (!hasDigits) {
+          _reportError(ScannerErrorCode.MISSING_HEX_DIGIT);
+        }
+        _appendStringToken(
+            TokenType.HEXADECIMAL, _reader.getString(start, next < 0 ? 0 : -1));
+        return next;
+      }
+    }
+  }
+
+  int _tokenizeHexOrNumber(int next) {
+    int x = _reader.peek();
+    if (x == $x || x == $X) {
+      _reader.advance();
+      return _tokenizeHex(x);
+    }
+    return _tokenizeNumber(next);
+  }
+
+  int _tokenizeIdentifier(int next, int start, bool allowDollar) {
+    while (($a <= next && next <= $z) ||
+        ($A <= next && next <= $Z) ||
+        ($0 <= next && next <= $9) ||
+        next == $_ ||
+        (next == $$ && allowDollar)) {
+      next = _reader.advance();
+    }
+    _appendStringToken(
+        TokenType.IDENTIFIER, _reader.getString(start, next < 0 ? 0 : -1));
+    return next;
+  }
+
+  int _tokenizeInterpolatedExpression(int next, int start) {
+    _appendBeginToken(TokenType.STRING_INTERPOLATION_EXPRESSION);
+    next = _reader.advance();
+    while (next != -1) {
+      if (next == $rbrace) {
+        BeginToken begin =
+            _findTokenMatchingClosingBraceInInterpolationExpression();
+        if (begin == null) {
+          _beginToken();
+          _appendTokenOfType(TokenType.CLOSE_CURLY_BRACKET);
+          next = _reader.advance();
+          _beginToken();
+          return next;
+        } else if (begin.type == TokenType.OPEN_CURLY_BRACKET) {
+          _beginToken();
+          _appendEndToken(
+              TokenType.CLOSE_CURLY_BRACKET, TokenType.OPEN_CURLY_BRACKET);
+          next = _reader.advance();
+          _beginToken();
+        } else if (begin.type == TokenType.STRING_INTERPOLATION_EXPRESSION) {
+          _beginToken();
+          _appendEndToken(TokenType.CLOSE_CURLY_BRACKET,
+              TokenType.STRING_INTERPOLATION_EXPRESSION);
+          next = _reader.advance();
+          _beginToken();
+          return next;
+        }
+      } else {
+        next = bigSwitch(next);
+      }
+    }
+    return next;
+  }
+
+  int _tokenizeInterpolatedIdentifier(int next, int start) {
+    _appendStringTokenWithOffset(
+        TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 0);
+    if (($A <= next && next <= $Z) ||
+        ($a <= next && next <= $z) ||
+        next == $_) {
+      _beginToken();
+      next = _tokenizeKeywordOrIdentifier(next, false);
+    }
+    _beginToken();
+    return next;
+  }
+
+  int _tokenizeKeywordOrIdentifier(int next, bool allowDollar) {
+    KeywordState state = KeywordState.KEYWORD_STATE;
+    int start = _reader.offset;
+    while (state != null && $a <= next && next <= $z) {
+      state = state.next(next);
+      next = _reader.advance();
+    }
+    if (state == null || state.keyword() == null) {
+      return _tokenizeIdentifier(next, start, allowDollar);
+    }
+    if (($A <= next && next <= $Z) ||
+        ($0 <= next && next <= $9) ||
+        next == $_ ||
+        next == $$) {
+      return _tokenizeIdentifier(next, start, allowDollar);
+    } else if (next < 128) {
+      _appendKeywordToken(state.keyword());
+      return next;
+    } else {
+      return _tokenizeIdentifier(next, start, allowDollar);
+    }
+  }
+
+  int _tokenizeLessThan(int next) {
+    // < <= << <<=
+    next = _reader.advance();
+    if ($equal == next) {
+      _appendTokenOfType(TokenType.LT_EQ);
+      return _reader.advance();
+    } else if ($lt == next) {
+      return _select($equal, TokenType.LT_LT_EQ, TokenType.LT_LT);
+    } else {
+      _appendTokenOfType(TokenType.LT);
+      return next;
+    }
+  }
+
+  int _tokenizeMinus(int next) {
+    // - -- -=
+    next = _reader.advance();
+    if (next == $minus) {
+      _appendTokenOfType(TokenType.MINUS_MINUS);
+      return _reader.advance();
+    } else if (next == $equal) {
+      _appendTokenOfType(TokenType.MINUS_EQ);
+      return _reader.advance();
+    } else {
+      _appendTokenOfType(TokenType.MINUS);
+      return next;
+    }
+  }
+
+  int _tokenizeMultiLineComment(int next) {
+    int nesting = 1;
+    next = _reader.advance();
+    while (true) {
+      if (-1 == next) {
+        _reportError(ScannerErrorCode.UNTERMINATED_MULTI_LINE_COMMENT);
+        _appendCommentToken(
+            TokenType.MULTI_LINE_COMMENT, _reader.getString(_tokenStart, 0));
+        return next;
+      } else if ($asterisk == next) {
+        next = _reader.advance();
+        if ($slash == next) {
+          --nesting;
+          if (0 == nesting) {
+            _appendCommentToken(TokenType.MULTI_LINE_COMMENT,
+                _reader.getString(_tokenStart, 0));
+            return _reader.advance();
+          } else {
+            next = _reader.advance();
+          }
+        }
+      } else if ($slash == next) {
+        next = _reader.advance();
+        if ($asterisk == next) {
+          next = _reader.advance();
+          ++nesting;
+        }
+      } else if (next == $cr) {
+        next = _reader.advance();
+        if (next == $lf) {
+          next = _reader.advance();
+        }
+        recordStartOfLine();
+      } else if (next == $lf) {
+        next = _reader.advance();
+        recordStartOfLine();
+      } else {
+        next = _reader.advance();
+      }
+    }
+  }
+
+  int _tokenizeMultiLineRawString(int quoteChar, int start) {
+    int next = _reader.advance();
+    outer:
+    while (next != -1) {
+      while (next != quoteChar) {
+        if (next == -1) {
+          break outer;
+        } else if (next == $cr) {
+          next = _reader.advance();
+          if (next == $lf) {
+            next = _reader.advance();
+          }
+          recordStartOfLine();
+        } else if (next == $lf) {
+          next = _reader.advance();
+          recordStartOfLine();
+        } else {
+          next = _reader.advance();
+        }
+      }
+      next = _reader.advance();
+      if (next == quoteChar) {
+        next = _reader.advance();
+        if (next == quoteChar) {
+          _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
+          return _reader.advance();
+        }
+      }
+    }
+    _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL);
+    _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
+    return _reader.advance();
+  }
+
+  int _tokenizeMultiLineString(int quoteChar, int start, bool raw) {
+    if (raw) {
+      return _tokenizeMultiLineRawString(quoteChar, start);
+    }
+    int next = _reader.advance();
+    while (next != -1) {
+      if (next == $$) {
+        _appendStringToken(TokenType.STRING, _reader.getString(start, -1));
+        next = _tokenizeStringInterpolation(start);
+        _beginToken();
+        start = _reader.offset;
+        continue;
+      }
+      if (next == quoteChar) {
+        next = _reader.advance();
+        if (next == quoteChar) {
+          next = _reader.advance();
+          if (next == quoteChar) {
+            _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
+            return _reader.advance();
+          }
+        }
+        continue;
+      }
+      if (next == $backslash) {
+        next = _reader.advance();
+        if (next == -1) {
+          break;
+        }
+        if (next == $cr) {
+          next = _reader.advance();
+          if (next == $lf) {
+            next = _reader.advance();
+          }
+          recordStartOfLine();
+        } else if (next == $lf) {
+          recordStartOfLine();
+          next = _reader.advance();
+        } else {
+          next = _reader.advance();
+        }
+      } else if (next == $cr) {
+        next = _reader.advance();
+        if (next == $lf) {
+          next = _reader.advance();
+        }
+        recordStartOfLine();
+      } else if (next == $lf) {
+        recordStartOfLine();
+        next = _reader.advance();
+      } else {
+        next = _reader.advance();
+      }
+    }
+    _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL);
+    if (start == _reader.offset) {
+      _appendStringTokenWithOffset(TokenType.STRING, "", 1);
+    } else {
+      _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
+    }
+    return _reader.advance();
+  }
+
+  int _tokenizeMultiply(int next) =>
+      _select($equal, TokenType.STAR_EQ, TokenType.STAR);
+
+  int _tokenizeNumber(int next) {
+    int start = _reader.offset;
+    while (true) {
+      next = _reader.advance();
+      if ($0 <= next && next <= $9) {
+        continue;
+      } else if (next == $dot) {
+        return _tokenizeFractionPart(_reader.advance(), start);
+      } else if (next == $e || next == $E) {
+        return _tokenizeFractionPart(next, start);
+      } else {
+        _appendStringToken(
+            TokenType.INT, _reader.getString(start, next < 0 ? 0 : -1));
+        return next;
+      }
+    }
+  }
+
+  int _tokenizeOpenSquareBracket(int next) {
+    // [ []  []=
+    next = _reader.advance();
+    if (next == $close_bracket) {
+      return _select($equal, TokenType.INDEX_EQ, TokenType.INDEX);
+    } else {
+      _appendBeginToken(TokenType.OPEN_SQUARE_BRACKET);
+      return next;
+    }
+  }
+
+  int _tokenizePercent(int next) =>
+      _select($equal, TokenType.PERCENT_EQ, TokenType.PERCENT);
+
+  int _tokenizePlus(int next) {
+    // + ++ +=
+    next = _reader.advance();
+    if ($plus == next) {
+      _appendTokenOfType(TokenType.PLUS_PLUS);
+      return _reader.advance();
+    } else if ($equal == next) {
+      _appendTokenOfType(TokenType.PLUS_EQ);
+      return _reader.advance();
+    } else {
+      _appendTokenOfType(TokenType.PLUS);
+      return next;
+    }
+  }
+
+  int _tokenizeQuestion() {
+    // ? ?. ?? ??=
+    int next = _reader.advance();
+    if (next == $dot) {
+      // '.'
+      _appendTokenOfType(TokenType.QUESTION_PERIOD);
+      return _reader.advance();
+    } else if (next == $question) {
+      // '?'
+      next = _reader.advance();
+      if (next == $equal) {
+        // '='
+        _appendTokenOfType(TokenType.QUESTION_QUESTION_EQ);
+        return _reader.advance();
+      } else {
+        _appendTokenOfType(TokenType.QUESTION_QUESTION);
+        return next;
+      }
+    } else {
+      _appendTokenOfType(TokenType.QUESTION);
+      return next;
+    }
+  }
+
+  int _tokenizeSingleLineComment(int next) {
+    while (true) {
+      next = _reader.advance();
+      if (-1 == next) {
+        _appendCommentToken(
+            TokenType.SINGLE_LINE_COMMENT, _reader.getString(_tokenStart, 0));
+        return next;
+      } else if ($lf == next || $cr == next) {
+        _appendCommentToken(
+            TokenType.SINGLE_LINE_COMMENT, _reader.getString(_tokenStart, -1));
+        return next;
+      }
+    }
+  }
+
+  int _tokenizeSingleLineRawString(int next, int quoteChar, int start) {
+    next = _reader.advance();
+    while (next != -1) {
+      if (next == quoteChar) {
+        _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
+        return _reader.advance();
+      } else if (next == $cr || next == $lf) {
+        _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL);
+        _appendStringToken(TokenType.STRING, _reader.getString(start, -1));
+        return _reader.advance();
+      }
+      next = _reader.advance();
+    }
+    _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL);
+    _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
+    return _reader.advance();
+  }
+
+  int _tokenizeSingleLineString(int next, int quoteChar, int start) {
+    while (next != quoteChar) {
+      if (next == $backslash) {
+        next = _reader.advance();
+      } else if (next == $$) {
+        _appendStringToken(TokenType.STRING, _reader.getString(start, -1));
+        next = _tokenizeStringInterpolation(start);
+        _beginToken();
+        start = _reader.offset;
+        continue;
+      }
+      if (next <= $cr && (next == $lf || next == $cr || next == -1)) {
+        _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL);
+        if (start == _reader.offset) {
+          _appendStringTokenWithOffset(TokenType.STRING, "", 1);
+        } else if (next == -1) {
+          _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
+        } else {
+          _appendStringToken(TokenType.STRING, _reader.getString(start, -1));
+        }
+        return _reader.advance();
+      }
+      next = _reader.advance();
+    }
+    _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
+    return _reader.advance();
+  }
+
+  int _tokenizeSlashOrComment(int next) {
+    next = _reader.advance();
+    if ($asterisk == next) {
+      return _tokenizeMultiLineComment(next);
+    } else if ($slash == next) {
+      return _tokenizeSingleLineComment(next);
+    } else if ($equal == next) {
+      _appendTokenOfType(TokenType.SLASH_EQ);
+      return _reader.advance();
+    } else {
+      _appendTokenOfType(TokenType.SLASH);
+      return next;
+    }
+  }
+
+  int _tokenizeString(int next, int start, bool raw) {
+    int quoteChar = next;
+    next = _reader.advance();
+    if (quoteChar == next) {
+      next = _reader.advance();
+      if (quoteChar == next) {
+        // Multiline string.
+        return _tokenizeMultiLineString(quoteChar, start, raw);
+      } else {
+        // Empty string.
+        _appendStringToken(TokenType.STRING, _reader.getString(start, -1));
+        return next;
+      }
+    }
+    if (raw) {
+      return _tokenizeSingleLineRawString(next, quoteChar, start);
+    } else {
+      return _tokenizeSingleLineString(next, quoteChar, start);
+    }
+  }
+
+  int _tokenizeStringInterpolation(int start) {
+    _beginToken();
+    int next = _reader.advance();
+    if (next == $lbrace) {
+      return _tokenizeInterpolatedExpression(next, start);
+    } else {
+      return _tokenizeInterpolatedIdentifier(next, start);
+    }
+  }
+
+  int _tokenizeTag(int next) {
+    // # or #!.*[\n\r]
+    if (_reader.offset == 0) {
+      if (_reader.peek() == $exclamation) {
+        do {
+          next = _reader.advance();
+        } while (next != $lf && next != $cr && next > 0);
+        _appendStringToken(
+            TokenType.SCRIPT_TAG, _reader.getString(_tokenStart, 0));
+        return next;
+      }
+    }
+    _appendTokenOfType(TokenType.HASH);
+    return _reader.advance();
+  }
+
+  int _tokenizeTilde(int next) {
+    // ~ ~/ ~/=
+    next = _reader.advance();
+    if (next == $slash) {
+      return _select($equal, TokenType.TILDE_SLASH_EQ, TokenType.TILDE_SLASH);
+    } else {
+      _appendTokenOfType(TokenType.TILDE);
+      return next;
+    }
+  }
+
+  /**
+   * Checks if [value] is a single-line or multi-line comment.
+   */
+  static bool _isDocumentationComment(String value) {
+    return StringUtilities.startsWith3(value, 0, $slash, $slash, $slash) ||
+        StringUtilities.startsWith3(value, 0, $slash, $asterisk, $asterisk);
+  }
+}
diff --git a/pkg/front_end/lib/src/scanner/string_utilities.dart b/pkg/front_end/lib/src/scanner/string_utilities.dart
new file mode 100644
index 0000000..8387923
--- /dev/null
+++ b/pkg/front_end/lib/src/scanner/string_utilities.dart
@@ -0,0 +1,26 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:front_end/src/scanner/interner.dart';
+
+class StringUtilities {
+  static Interner INTERNER = new NullInterner();
+
+  static bool endsWith3(String str, int c1, int c2, int c3) {
+    var length = str.length;
+    return length >= 3 &&
+        str.codeUnitAt(length - 3) == c1 &&
+        str.codeUnitAt(length - 2) == c2 &&
+        str.codeUnitAt(length - 1) == c3;
+  }
+
+  static String intern(String string) => INTERNER.intern(string);
+
+  static bool startsWith3(String str, int start, int c1, int c2, int c3) {
+    return str.length - start >= 3 &&
+        str.codeUnitAt(start) == c1 &&
+        str.codeUnitAt(start + 1) == c2 &&
+        str.codeUnitAt(start + 2) == c3;
+  }
+}
diff --git a/pkg/front_end/lib/src/scanner/token.dart b/pkg/front_end/lib/src/scanner/token.dart
new file mode 100644
index 0000000..95c1005
--- /dev/null
+++ b/pkg/front_end/lib/src/scanner/token.dart
@@ -0,0 +1,1293 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/**
+ * Defines the tokens that are produced by the scanner, used by the parser, and
+ * referenced from the [AST structure](ast.dart).
+ */
+import 'dart:collection';
+
+import 'package:front_end/src/base/syntactic_entity.dart';
+import 'package:front_end/src/scanner/string_utilities.dart';
+
+/**
+ * The opening half of a grouping pair of tokens. This is used for curly
+ * brackets ('{'), parentheses ('('), and square brackets ('[').
+ */
+class BeginToken extends SimpleToken {
+  /**
+   * The token that corresponds to this token.
+   */
+  Token endToken;
+
+  /**
+   * Initialize a newly created token to have the given [type] at the given
+   * [offset].
+   */
+  BeginToken(TokenType type, int offset) : super(type, offset) {
+    assert(type == TokenType.OPEN_CURLY_BRACKET ||
+        type == TokenType.OPEN_PAREN ||
+        type == TokenType.OPEN_SQUARE_BRACKET ||
+        type == TokenType.STRING_INTERPOLATION_EXPRESSION);
+  }
+
+  @override
+  Token copy() => new BeginToken(type, offset);
+}
+
+/**
+ * A begin token that is preceded by comments.
+ */
+class BeginTokenWithComment extends BeginToken implements TokenWithComment {
+  /**
+   * The first comment in the list of comments that precede this token.
+   */
+  @override
+  CommentToken _precedingComment;
+
+  /**
+   * Initialize a newly created token to have the given [type] at the given
+   * [offset] and to be preceded by the comments reachable from the given
+   * [_precedingComment].
+   */
+  BeginTokenWithComment(TokenType type, int offset, this._precedingComment)
+      : super(type, offset) {
+    _setCommentParent(_precedingComment);
+  }
+
+  @override
+  CommentToken get precedingComments => _precedingComment;
+
+  @override
+  void set precedingComments(CommentToken comment) {
+    _precedingComment = comment;
+    _setCommentParent(_precedingComment);
+  }
+
+  @override
+  void applyDelta(int delta) {
+    super.applyDelta(delta);
+    Token token = precedingComments;
+    while (token != null) {
+      token.applyDelta(delta);
+      token = token.next;
+    }
+  }
+
+  @override
+  Token copy() =>
+      new BeginTokenWithComment(type, offset, copyComments(precedingComments));
+}
+
+/**
+ * A token representing a comment.
+ */
+class CommentToken extends StringToken {
+  /**
+   * The token that contains this comment.
+   */
+  TokenWithComment parent;
+
+  /**
+   * Initialize a newly created token to represent a token of the given [type]
+   * with the given [value] at the given [offset].
+   */
+  CommentToken(TokenType type, String value, int offset)
+      : super(type, value, offset);
+
+  @override
+  CommentToken copy() => new CommentToken(type, _value, offset);
+
+  /**
+   * Remove this comment token from the list.
+   *
+   * This is used when we decide to interpret the comment as syntax.
+   */
+  void remove() {
+    if (previous != null) {
+      previous.setNextWithoutSettingPrevious(next);
+      next?.previous = previous;
+    } else {
+      assert(parent.precedingComments == this);
+      parent.precedingComments = next;
+    }
+  }
+}
+
+/**
+ * A documentation comment token.
+ */
+class DocumentationCommentToken extends CommentToken {
+  /**
+   * The references embedded within the documentation comment.
+   * This list will be empty unless this is a documentation comment that has
+   * references embedded within it.
+   */
+  final List<Token> references = <Token>[];
+
+  /**
+   * Initialize a newly created token to represent a token of the given [type]
+   * with the given [value] at the given [offset].
+   */
+  DocumentationCommentToken(TokenType type, String value, int offset)
+      : super(type, value, offset);
+
+  @override
+  CommentToken copy() {
+    DocumentationCommentToken copy =
+        new DocumentationCommentToken(type, _value, offset);
+    references.forEach((ref) => copy.references.add(ref.copy()));
+    return copy;
+  }
+}
+
+/**
+ * The keywords in the Dart programming language.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class Keyword {
+  static const Keyword ABSTRACT = const Keyword._('ABSTRACT', "abstract", true);
+
+  static const Keyword AS = const Keyword._('AS', "as", true);
+
+  static const Keyword ASSERT = const Keyword._('ASSERT', "assert");
+
+  static const Keyword BREAK = const Keyword._('BREAK', "break");
+
+  static const Keyword CASE = const Keyword._('CASE', "case");
+
+  static const Keyword CATCH = const Keyword._('CATCH', "catch");
+
+  static const Keyword CLASS = const Keyword._('CLASS', "class");
+
+  static const Keyword CONST = const Keyword._('CONST', "const");
+
+  static const Keyword CONTINUE = const Keyword._('CONTINUE', "continue");
+
+  static const Keyword DEFAULT = const Keyword._('DEFAULT', "default");
+
+  static const Keyword DEFERRED = const Keyword._('DEFERRED', "deferred", true);
+
+  static const Keyword DO = const Keyword._('DO', "do");
+
+  static const Keyword DYNAMIC = const Keyword._('DYNAMIC', "dynamic", true);
+
+  static const Keyword ELSE = const Keyword._('ELSE', "else");
+
+  static const Keyword ENUM = const Keyword._('ENUM', "enum");
+
+  static const Keyword EXPORT = const Keyword._('EXPORT', "export", true);
+
+  static const Keyword EXTENDS = const Keyword._('EXTENDS', "extends");
+
+  static const Keyword EXTERNAL = const Keyword._('EXTERNAL', "external", true);
+
+  static const Keyword FACTORY = const Keyword._('FACTORY', "factory", true);
+
+  static const Keyword FALSE = const Keyword._('FALSE', "false");
+
+  static const Keyword FINAL = const Keyword._('FINAL', "final");
+
+  static const Keyword FINALLY = const Keyword._('FINALLY', "finally");
+
+  static const Keyword FOR = const Keyword._('FOR', "for");
+
+  static const Keyword GET = const Keyword._('GET', "get", true);
+
+  static const Keyword IF = const Keyword._('IF', "if");
+
+  static const Keyword IMPLEMENTS =
+      const Keyword._('IMPLEMENTS', "implements", true);
+
+  static const Keyword IMPORT = const Keyword._('IMPORT', "import", true);
+
+  static const Keyword IN = const Keyword._('IN', "in");
+
+  static const Keyword IS = const Keyword._('IS', "is");
+
+  static const Keyword LIBRARY = const Keyword._('LIBRARY', "library", true);
+
+  static const Keyword NEW = const Keyword._('NEW', "new");
+
+  static const Keyword NULL = const Keyword._('NULL', "null");
+
+  static const Keyword OPERATOR = const Keyword._('OPERATOR', "operator", true);
+
+  static const Keyword PART = const Keyword._('PART', "part", true);
+
+  static const Keyword RETHROW = const Keyword._('RETHROW', "rethrow");
+
+  static const Keyword RETURN = const Keyword._('RETURN', "return");
+
+  static const Keyword SET = const Keyword._('SET', "set", true);
+
+  static const Keyword STATIC = const Keyword._('STATIC', "static", true);
+
+  static const Keyword SUPER = const Keyword._('SUPER', "super");
+
+  static const Keyword SWITCH = const Keyword._('SWITCH', "switch");
+
+  static const Keyword THIS = const Keyword._('THIS', "this");
+
+  static const Keyword THROW = const Keyword._('THROW', "throw");
+
+  static const Keyword TRUE = const Keyword._('TRUE', "true");
+
+  static const Keyword TRY = const Keyword._('TRY', "try");
+
+  static const Keyword TYPEDEF = const Keyword._('TYPEDEF', "typedef", true);
+
+  static const Keyword VAR = const Keyword._('VAR', "var");
+
+  static const Keyword VOID = const Keyword._('VOID', "void");
+
+  static const Keyword WHILE = const Keyword._('WHILE', "while");
+
+  static const Keyword WITH = const Keyword._('WITH', "with");
+
+  static const List<Keyword> values = const <Keyword>[
+    ABSTRACT,
+    AS,
+    ASSERT,
+    BREAK,
+    CASE,
+    CATCH,
+    CLASS,
+    CONST,
+    CONTINUE,
+    DEFAULT,
+    DEFERRED,
+    DO,
+    DYNAMIC,
+    ELSE,
+    ENUM,
+    EXPORT,
+    EXTENDS,
+    EXTERNAL,
+    FACTORY,
+    FALSE,
+    FINAL,
+    FINALLY,
+    FOR,
+    GET,
+    IF,
+    IMPLEMENTS,
+    IMPORT,
+    IN,
+    IS,
+    LIBRARY,
+    NEW,
+    NULL,
+    OPERATOR,
+    PART,
+    RETHROW,
+    RETURN,
+    SET,
+    STATIC,
+    SUPER,
+    SWITCH,
+    THIS,
+    THROW,
+    TRUE,
+    TRY,
+    TYPEDEF,
+    VAR,
+    VOID,
+    WHILE,
+    WITH,
+  ];
+
+  /**
+   * A table mapping the lexemes of keywords to the corresponding keyword.
+   */
+  static final Map<String, Keyword> keywords = _createKeywordMap();
+
+  /**
+   * The name of the keyword type.
+   */
+  final String name;
+
+  /**
+   * The lexeme for the keyword.
+   */
+  final String syntax;
+
+  /**
+   * A flag indicating whether the keyword is a pseudo-keyword. Pseudo keywords
+   * can be used as identifiers.
+   */
+  final bool isPseudoKeyword;
+
+  /**
+   * Initialize a newly created keyword to have the given [name] and [syntax].
+   * The keyword is a pseudo-keyword if the [isPseudoKeyword] flag is `true`.
+   */
+  const Keyword._(this.name, this.syntax, [this.isPseudoKeyword = false]);
+
+  @override
+  String toString() => name;
+
+  /**
+   * Create a table mapping the lexemes of keywords to the corresponding keyword
+   * and return the table that was created.
+   */
+  static Map<String, Keyword> _createKeywordMap() {
+    LinkedHashMap<String, Keyword> result =
+        new LinkedHashMap<String, Keyword>();
+    for (Keyword keyword in values) {
+      result[keyword.syntax] = keyword;
+    }
+    return result;
+  }
+}
+
+/**
+ * A token representing a keyword in the language.
+ */
+class KeywordToken extends SimpleToken {
+  @override
+  final Keyword keyword;
+
+  /**
+   * Initialize a newly created token to represent the given [keyword] at the
+   * given [offset].
+   */
+  KeywordToken(this.keyword, int offset) : super(TokenType.KEYWORD, offset);
+
+  @override
+  String get lexeme => keyword.syntax;
+
+  @override
+  Token copy() => new KeywordToken(keyword, offset);
+
+  @override
+  Keyword value() => keyword;
+}
+
+/**
+ * A keyword token that is preceded by comments.
+ */
+class KeywordTokenWithComment extends KeywordToken implements TokenWithComment {
+  /**
+   * The first comment in the list of comments that precede this token.
+   */
+  @override
+  CommentToken _precedingComment;
+
+  /**
+   * Initialize a newly created token to to represent the given [keyword] at the
+   * given [offset] and to be preceded by the comments reachable from the given
+   * [_precedingComment].
+   */
+  KeywordTokenWithComment(Keyword keyword, int offset, this._precedingComment)
+      : super(keyword, offset) {
+    _setCommentParent(_precedingComment);
+  }
+
+  @override
+  CommentToken get precedingComments => _precedingComment;
+
+  void set precedingComments(CommentToken comment) {
+    _precedingComment = comment;
+    _setCommentParent(_precedingComment);
+  }
+
+  @override
+  void applyDelta(int delta) {
+    super.applyDelta(delta);
+    Token token = precedingComments;
+    while (token != null) {
+      token.applyDelta(delta);
+      token = token.next;
+    }
+  }
+
+  @override
+  Token copy() => new KeywordTokenWithComment(
+      keyword, offset, copyComments(precedingComments));
+}
+
+/**
+ * A token that was scanned from the input. Each token knows which tokens
+ * precede and follow it, acting as a link in a doubly linked list of tokens.
+ */
+class SimpleToken implements Token {
+  /**
+   * The type of the token.
+   */
+  @override
+  final TokenType type;
+
+  /**
+   * The offset from the beginning of the file to the first character in the
+   * token.
+   */
+  @override
+  int offset = 0;
+
+  /**
+   * The previous token in the token stream.
+   */
+  @override
+  Token previous;
+
+  /**
+   * The next token in the token stream.
+   */
+  Token _next;
+
+  /**
+   * Initialize a newly created token to have the given [type] and [offset].
+   */
+  SimpleToken(this.type, this.offset);
+
+  @override
+  int get end => offset + length;
+
+  @override
+  bool get isOperator => type.isOperator;
+
+  @override
+  bool get isSynthetic => length == 0;
+
+  @override
+  bool get isUserDefinableOperator => type.isUserDefinableOperator;
+
+  @override
+  Keyword get keyword => null;
+
+  @override
+  int get length => lexeme.length;
+
+  @override
+  String get lexeme => type.lexeme;
+
+  @override
+  Token get next => _next;
+
+  @override
+  CommentToken get precedingComments => null;
+
+  @override
+  void applyDelta(int delta) {
+    offset += delta;
+  }
+
+  @override
+  Token copy() => new Token(type, offset);
+
+  @override
+  Token copyComments(Token token) {
+    if (token == null) {
+      return null;
+    }
+    Token head = token.copy();
+    Token tail = head;
+    token = token.next;
+    while (token != null) {
+      tail = tail.setNext(token.copy());
+      token = token.next;
+    }
+    return head;
+  }
+
+  @override
+  bool matchesAny(List<TokenType> types) {
+    for (TokenType type in types) {
+      if (this.type == type) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  @override
+  Token setNext(Token token) {
+    _next = token;
+    token.previous = this;
+    return token;
+  }
+
+  @override
+  Token setNextWithoutSettingPrevious(Token token) {
+    _next = token;
+    return token;
+  }
+
+  @override
+  String toString() => lexeme;
+
+  @override
+  Object value() => type.lexeme;
+
+  /**
+   * Sets the `parent` property to `this` for the given [comment] and all the
+   * next tokens.
+   */
+  void _setCommentParent(CommentToken comment) {
+    while (comment != null) {
+      comment.parent = this;
+      comment = comment.next;
+    }
+  }
+}
+
+/**
+ * A token whose value is independent of it's type.
+ */
+class StringToken extends SimpleToken {
+  /**
+   * The lexeme represented by this token.
+   */
+  String _value;
+
+  /**
+   * Initialize a newly created token to represent a token of the given [type]
+   * with the given [value] at the given [offset].
+   */
+  StringToken(TokenType type, String value, int offset) : super(type, offset) {
+    this._value = StringUtilities.intern(value);
+  }
+
+  @override
+  String get lexeme => _value;
+
+  @override
+  Token copy() => new StringToken(type, _value, offset);
+
+  @override
+  String value() => _value;
+}
+
+/**
+ * A string token that is preceded by comments.
+ */
+class StringTokenWithComment extends StringToken implements TokenWithComment {
+  /**
+   * The first comment in the list of comments that precede this token.
+   */
+  CommentToken _precedingComment;
+
+  /**
+   * Initialize a newly created token to have the given [type] at the given
+   * [offset] and to be preceded by the comments reachable from the given
+   * [comment].
+   */
+  StringTokenWithComment(
+      TokenType type, String value, int offset, this._precedingComment)
+      : super(type, value, offset) {
+    _setCommentParent(_precedingComment);
+  }
+
+  @override
+  CommentToken get precedingComments => _precedingComment;
+
+  void set precedingComments(CommentToken comment) {
+    _precedingComment = comment;
+    _setCommentParent(_precedingComment);
+  }
+
+  @override
+  void applyDelta(int delta) {
+    super.applyDelta(delta);
+    Token token = precedingComments;
+    while (token != null) {
+      token.applyDelta(delta);
+      token = token.next;
+    }
+  }
+
+  @override
+  Token copy() => new StringTokenWithComment(
+      type, lexeme, offset, copyComments(precedingComments));
+}
+
+/**
+ * A token that was scanned from the input. Each token knows which tokens
+ * precede and follow it, acting as a link in a doubly linked list of tokens.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class Token implements SyntacticEntity {
+  /**
+   * Initialize a newly created token to have the given [type] and [offset].
+   */
+  factory Token(TokenType type, int offset) = SimpleToken;
+
+  @override
+  int get end;
+
+  /**
+   * Return `true` if this token represents an operator.
+   */
+  bool get isOperator;
+
+  /**
+   * Return `true` if this token is a synthetic token. A synthetic token is a
+   * token that was introduced by the parser in order to recover from an error
+   * in the code.
+   */
+  bool get isSynthetic;
+
+  /**
+   * Return `true` if this token represents an operator that can be defined by
+   * users.
+   */
+  bool get isUserDefinableOperator;
+
+  /**
+   * Return the keyword, if a keyword token, or `null` otherwise.
+   */
+  Keyword get keyword;
+
+  @override
+  int get length;
+
+  /**
+   * Return the lexeme that represents this token.
+   */
+  String get lexeme;
+
+  /**
+   * Return the next token in the token stream.
+   */
+  Token get next;
+
+  @override
+  int get offset;
+
+  /**
+   * Set the offset from the beginning of the file to the first character in
+   * the token to the given [offset].
+   */
+  void set offset(int offset);
+
+  /**
+   * Return the first comment in the list of comments that precede this token,
+   * or `null` if there are no comments preceding this token. Additional
+   * comments can be reached by following the token stream using [next] until
+   * `null` is returned.
+   *
+   * For example, if the original contents were `/* one */ /* two */ id`, then
+   * the first preceding comment token will have a lexeme of `/* one */` and
+   * the next comment token will have a lexeme of `/* two */`.
+   */
+  Token get precedingComments;
+
+  /**
+   * Return the previous token in the token stream.
+   */
+  Token get previous;
+
+  /**
+   * Set the previous token in the token stream to the given [token].
+   */
+  void set previous(Token token);
+
+  /**
+   * Return the type of the token.
+   */
+  TokenType get type;
+
+  /**
+   * Apply (add) the given [delta] to this token's offset.
+   */
+  void applyDelta(int delta);
+
+  /**
+   * Return a newly created token that is a copy of this token but that is not a
+   * part of any token stream.
+   */
+  Token copy();
+
+  /**
+   * Copy a linked list of comment tokens identical to the given comment tokens.
+   */
+  Token copyComments(Token token);
+
+  /**
+   * Return `true` if this token has any one of the given [types].
+   */
+  bool matchesAny(List<TokenType> types);
+
+  /**
+   * Set the next token in the token stream to the given [token]. This has the
+   * side-effect of setting this token to be the previous token for the given
+   * token. Return the token that was passed in.
+   */
+  Token setNext(Token token);
+
+  /**
+   * Set the next token in the token stream to the given token without changing
+   * which token is the previous token for the given token. Return the token
+   * that was passed in.
+   */
+  Token setNextWithoutSettingPrevious(Token token);
+
+  /**
+   * Return the value of this token. For keyword tokens, this is the keyword
+   * associated with the token, for other tokens it is the lexeme associated
+   * with the token.
+   */
+  Object value();
+
+  /**
+   * Compare the given [tokens] to find the token that appears first in the
+   * source being parsed. That is, return the left-most of all of the tokens.
+   * The list must be non-`null`, but the elements of the list are allowed to be
+   * `null`. Return the token with the smallest offset, or `null` if the list is
+   * empty or if all of the elements of the list are `null`.
+   */
+  static Token lexicallyFirst(List<Token> tokens) {
+    Token first = null;
+    int offset = -1;
+    int length = tokens.length;
+    for (int i = 0; i < length; i++) {
+      Token token = tokens[i];
+      if (token != null && (offset < 0 || token.offset < offset)) {
+        first = token;
+        offset = token.offset;
+      }
+    }
+    return first;
+  }
+}
+
+/**
+ * The classes (or groups) of tokens with a similar use.
+ */
+class TokenClass {
+  /**
+   * A value used to indicate that the token type is not part of any specific
+   * class of token.
+   */
+  static const TokenClass NO_CLASS = const TokenClass('NO_CLASS');
+
+  /**
+   * A value used to indicate that the token type is an additive operator.
+   */
+  static const TokenClass ADDITIVE_OPERATOR =
+      const TokenClass('ADDITIVE_OPERATOR', 13);
+
+  /**
+   * A value used to indicate that the token type is an assignment operator.
+   */
+  static const TokenClass ASSIGNMENT_OPERATOR =
+      const TokenClass('ASSIGNMENT_OPERATOR', 1);
+
+  /**
+   * A value used to indicate that the token type is a bitwise-and operator.
+   */
+  static const TokenClass BITWISE_AND_OPERATOR =
+      const TokenClass('BITWISE_AND_OPERATOR', 11);
+
+  /**
+   * A value used to indicate that the token type is a bitwise-or operator.
+   */
+  static const TokenClass BITWISE_OR_OPERATOR =
+      const TokenClass('BITWISE_OR_OPERATOR', 9);
+
+  /**
+   * A value used to indicate that the token type is a bitwise-xor operator.
+   */
+  static const TokenClass BITWISE_XOR_OPERATOR =
+      const TokenClass('BITWISE_XOR_OPERATOR', 10);
+
+  /**
+   * A value used to indicate that the token type is a cascade operator.
+   */
+  static const TokenClass CASCADE_OPERATOR =
+      const TokenClass('CASCADE_OPERATOR', 2);
+
+  /**
+   * A value used to indicate that the token type is a conditional operator.
+   */
+  static const TokenClass CONDITIONAL_OPERATOR =
+      const TokenClass('CONDITIONAL_OPERATOR', 3);
+
+  /**
+   * A value used to indicate that the token type is an equality operator.
+   */
+  static const TokenClass EQUALITY_OPERATOR =
+      const TokenClass('EQUALITY_OPERATOR', 7);
+
+  /**
+   * A value used to indicate that the token type is an if-null operator.
+   */
+  static const TokenClass IF_NULL_OPERATOR =
+      const TokenClass('IF_NULL_OPERATOR', 4);
+
+  /**
+   * A value used to indicate that the token type is a logical-and operator.
+   */
+  static const TokenClass LOGICAL_AND_OPERATOR =
+      const TokenClass('LOGICAL_AND_OPERATOR', 6);
+
+  /**
+   * A value used to indicate that the token type is a logical-or operator.
+   */
+  static const TokenClass LOGICAL_OR_OPERATOR =
+      const TokenClass('LOGICAL_OR_OPERATOR', 5);
+
+  /**
+   * A value used to indicate that the token type is a multiplicative operator.
+   */
+  static const TokenClass MULTIPLICATIVE_OPERATOR =
+      const TokenClass('MULTIPLICATIVE_OPERATOR', 14);
+
+  /**
+   * A value used to indicate that the token type is a relational operator.
+   */
+  static const TokenClass RELATIONAL_OPERATOR =
+      const TokenClass('RELATIONAL_OPERATOR', 8);
+
+  /**
+   * A value used to indicate that the token type is a shift operator.
+   */
+  static const TokenClass SHIFT_OPERATOR =
+      const TokenClass('SHIFT_OPERATOR', 12);
+
+  /**
+   * A value used to indicate that the token type is a unary operator.
+   */
+  static const TokenClass UNARY_POSTFIX_OPERATOR =
+      const TokenClass('UNARY_POSTFIX_OPERATOR', 16);
+
+  /**
+   * A value used to indicate that the token type is a unary operator.
+   */
+  static const TokenClass UNARY_PREFIX_OPERATOR =
+      const TokenClass('UNARY_PREFIX_OPERATOR', 15);
+
+  /**
+   * The name of the token class.
+   */
+  final String name;
+
+  /**
+   * The precedence of tokens of this class, or `0` if the such tokens do not
+   * represent an operator.
+   */
+  final int precedence;
+
+  /**
+   * Initialize a newly created class of tokens to have the given [name] and
+   * [precedence].
+   */
+  const TokenClass(this.name, [this.precedence = 0]);
+
+  @override
+  String toString() => name;
+}
+
+/**
+ * The types of tokens that can be returned by the scanner.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class TokenType {
+  /**
+   * The type of the token that marks the start or end of the input.
+   */
+  static const TokenType EOF = const _EndOfFileTokenType();
+
+  static const TokenType DOUBLE = const TokenType._('DOUBLE');
+
+  static const TokenType HEXADECIMAL = const TokenType._('HEXADECIMAL');
+
+  static const TokenType IDENTIFIER = const TokenType._('IDENTIFIER');
+
+  static const TokenType INT = const TokenType._('INT');
+
+  static const TokenType KEYWORD = const TokenType._('KEYWORD');
+
+  static const TokenType MULTI_LINE_COMMENT =
+      const TokenType._('MULTI_LINE_COMMENT');
+
+  static const TokenType SCRIPT_TAG = const TokenType._('SCRIPT_TAG');
+
+  static const TokenType SINGLE_LINE_COMMENT =
+      const TokenType._('SINGLE_LINE_COMMENT');
+
+  static const TokenType STRING = const TokenType._('STRING');
+
+  static const TokenType AMPERSAND =
+      const TokenType._('AMPERSAND', TokenClass.BITWISE_AND_OPERATOR, '&');
+
+  static const TokenType AMPERSAND_AMPERSAND = const TokenType._(
+      'AMPERSAND_AMPERSAND', TokenClass.LOGICAL_AND_OPERATOR, '&&');
+
+  static const TokenType AMPERSAND_AMPERSAND_EQ = const TokenType._(
+      'AMPERSAND_AMPERSAND_EQ', TokenClass.ASSIGNMENT_OPERATOR, '&&=');
+
+  static const TokenType AMPERSAND_EQ =
+      const TokenType._('AMPERSAND_EQ', TokenClass.ASSIGNMENT_OPERATOR, '&=');
+
+  static const TokenType AT = const TokenType._('AT', TokenClass.NO_CLASS, '@');
+
+  static const TokenType BANG =
+      const TokenType._('BANG', TokenClass.UNARY_PREFIX_OPERATOR, '!');
+
+  static const TokenType BANG_EQ =
+      const TokenType._('BANG_EQ', TokenClass.EQUALITY_OPERATOR, '!=');
+
+  static const TokenType BAR =
+      const TokenType._('BAR', TokenClass.BITWISE_OR_OPERATOR, '|');
+
+  static const TokenType BAR_BAR =
+      const TokenType._('BAR_BAR', TokenClass.LOGICAL_OR_OPERATOR, '||');
+
+  static const TokenType BAR_BAR_EQ =
+      const TokenType._('BAR_BAR_EQ', TokenClass.ASSIGNMENT_OPERATOR, '||=');
+
+  static const TokenType BAR_EQ =
+      const TokenType._('BAR_EQ', TokenClass.ASSIGNMENT_OPERATOR, '|=');
+
+  static const TokenType COLON =
+      const TokenType._('COLON', TokenClass.NO_CLASS, ':');
+
+  static const TokenType COMMA =
+      const TokenType._('COMMA', TokenClass.NO_CLASS, ',');
+
+  static const TokenType CARET =
+      const TokenType._('CARET', TokenClass.BITWISE_XOR_OPERATOR, '^');
+
+  static const TokenType CARET_EQ =
+      const TokenType._('CARET_EQ', TokenClass.ASSIGNMENT_OPERATOR, '^=');
+
+  static const TokenType CLOSE_CURLY_BRACKET =
+      const TokenType._('CLOSE_CURLY_BRACKET', TokenClass.NO_CLASS, '}');
+
+  static const TokenType CLOSE_PAREN =
+      const TokenType._('CLOSE_PAREN', TokenClass.NO_CLASS, ')');
+
+  static const TokenType CLOSE_SQUARE_BRACKET =
+      const TokenType._('CLOSE_SQUARE_BRACKET', TokenClass.NO_CLASS, ']');
+
+  static const TokenType EQ =
+      const TokenType._('EQ', TokenClass.ASSIGNMENT_OPERATOR, '=');
+
+  static const TokenType EQ_EQ =
+      const TokenType._('EQ_EQ', TokenClass.EQUALITY_OPERATOR, '==');
+
+  static const TokenType FUNCTION =
+      const TokenType._('FUNCTION', TokenClass.NO_CLASS, '=>');
+
+  static const TokenType GT =
+      const TokenType._('GT', TokenClass.RELATIONAL_OPERATOR, '>');
+
+  static const TokenType GT_EQ =
+      const TokenType._('GT_EQ', TokenClass.RELATIONAL_OPERATOR, '>=');
+
+  static const TokenType GT_GT =
+      const TokenType._('GT_GT', TokenClass.SHIFT_OPERATOR, '>>');
+
+  static const TokenType GT_GT_EQ =
+      const TokenType._('GT_GT_EQ', TokenClass.ASSIGNMENT_OPERATOR, '>>=');
+
+  static const TokenType HASH =
+      const TokenType._('HASH', TokenClass.NO_CLASS, '#');
+
+  static const TokenType INDEX =
+      const TokenType._('INDEX', TokenClass.UNARY_POSTFIX_OPERATOR, '[]');
+
+  static const TokenType INDEX_EQ =
+      const TokenType._('INDEX_EQ', TokenClass.UNARY_POSTFIX_OPERATOR, '[]=');
+
+  static const TokenType IS =
+      const TokenType._('IS', TokenClass.RELATIONAL_OPERATOR, 'is');
+
+  static const TokenType LT =
+      const TokenType._('LT', TokenClass.RELATIONAL_OPERATOR, '<');
+
+  static const TokenType LT_EQ =
+      const TokenType._('LT_EQ', TokenClass.RELATIONAL_OPERATOR, '<=');
+
+  static const TokenType LT_LT =
+      const TokenType._('LT_LT', TokenClass.SHIFT_OPERATOR, '<<');
+
+  static const TokenType LT_LT_EQ =
+      const TokenType._('LT_LT_EQ', TokenClass.ASSIGNMENT_OPERATOR, '<<=');
+
+  static const TokenType MINUS =
+      const TokenType._('MINUS', TokenClass.ADDITIVE_OPERATOR, '-');
+
+  static const TokenType MINUS_EQ =
+      const TokenType._('MINUS_EQ', TokenClass.ASSIGNMENT_OPERATOR, '-=');
+
+  static const TokenType MINUS_MINUS =
+      const TokenType._('MINUS_MINUS', TokenClass.UNARY_PREFIX_OPERATOR, '--');
+
+  static const TokenType OPEN_CURLY_BRACKET =
+      const TokenType._('OPEN_CURLY_BRACKET', TokenClass.NO_CLASS, '{');
+
+  static const TokenType OPEN_PAREN =
+      const TokenType._('OPEN_PAREN', TokenClass.UNARY_POSTFIX_OPERATOR, '(');
+
+  static const TokenType OPEN_SQUARE_BRACKET = const TokenType._(
+      'OPEN_SQUARE_BRACKET', TokenClass.UNARY_POSTFIX_OPERATOR, '[');
+
+  static const TokenType PERCENT =
+      const TokenType._('PERCENT', TokenClass.MULTIPLICATIVE_OPERATOR, '%');
+
+  static const TokenType PERCENT_EQ =
+      const TokenType._('PERCENT_EQ', TokenClass.ASSIGNMENT_OPERATOR, '%=');
+
+  static const TokenType PERIOD =
+      const TokenType._('PERIOD', TokenClass.UNARY_POSTFIX_OPERATOR, '.');
+
+  static const TokenType PERIOD_PERIOD =
+      const TokenType._('PERIOD_PERIOD', TokenClass.CASCADE_OPERATOR, '..');
+
+  static const TokenType PLUS =
+      const TokenType._('PLUS', TokenClass.ADDITIVE_OPERATOR, '+');
+
+  static const TokenType PLUS_EQ =
+      const TokenType._('PLUS_EQ', TokenClass.ASSIGNMENT_OPERATOR, '+=');
+
+  static const TokenType PLUS_PLUS =
+      const TokenType._('PLUS_PLUS', TokenClass.UNARY_PREFIX_OPERATOR, '++');
+
+  static const TokenType QUESTION =
+      const TokenType._('QUESTION', TokenClass.CONDITIONAL_OPERATOR, '?');
+
+  static const TokenType QUESTION_PERIOD = const TokenType._(
+      'QUESTION_PERIOD', TokenClass.UNARY_POSTFIX_OPERATOR, '?.');
+
+  static const TokenType QUESTION_QUESTION =
+      const TokenType._('QUESTION_QUESTION', TokenClass.IF_NULL_OPERATOR, '??');
+
+  static const TokenType QUESTION_QUESTION_EQ = const TokenType._(
+      'QUESTION_QUESTION_EQ', TokenClass.ASSIGNMENT_OPERATOR, '??=');
+
+  static const TokenType SEMICOLON =
+      const TokenType._('SEMICOLON', TokenClass.NO_CLASS, ';');
+
+  static const TokenType SLASH =
+      const TokenType._('SLASH', TokenClass.MULTIPLICATIVE_OPERATOR, '/');
+
+  static const TokenType SLASH_EQ =
+      const TokenType._('SLASH_EQ', TokenClass.ASSIGNMENT_OPERATOR, '/=');
+
+  static const TokenType STAR =
+      const TokenType._('STAR', TokenClass.MULTIPLICATIVE_OPERATOR, '*');
+
+  static const TokenType STAR_EQ =
+      const TokenType._('STAR_EQ', TokenClass.ASSIGNMENT_OPERATOR, "*=");
+
+  static const TokenType STRING_INTERPOLATION_EXPRESSION = const TokenType._(
+      'STRING_INTERPOLATION_EXPRESSION', TokenClass.NO_CLASS, '\${');
+
+  static const TokenType STRING_INTERPOLATION_IDENTIFIER = const TokenType._(
+      'STRING_INTERPOLATION_IDENTIFIER', TokenClass.NO_CLASS, '\$');
+
+  static const TokenType TILDE =
+      const TokenType._('TILDE', TokenClass.UNARY_PREFIX_OPERATOR, '~');
+
+  static const TokenType TILDE_SLASH = const TokenType._(
+      'TILDE_SLASH', TokenClass.MULTIPLICATIVE_OPERATOR, '~/');
+
+  static const TokenType TILDE_SLASH_EQ = const TokenType._(
+      'TILDE_SLASH_EQ', TokenClass.ASSIGNMENT_OPERATOR, '~/=');
+
+  static const TokenType BACKPING =
+      const TokenType._('BACKPING', TokenClass.NO_CLASS, '`');
+
+  static const TokenType BACKSLASH =
+      const TokenType._('BACKSLASH', TokenClass.NO_CLASS, '\\');
+
+  static const TokenType PERIOD_PERIOD_PERIOD =
+      const TokenType._('PERIOD_PERIOD_PERIOD', TokenClass.NO_CLASS, '...');
+
+  static const TokenType GENERIC_METHOD_TYPE_LIST =
+      const TokenType._('GENERIC_METHOD_TYPE_LIST');
+
+  static const TokenType GENERIC_METHOD_TYPE_ASSIGN =
+      const TokenType._('GENERIC_METHOD_TYPE_ASSIGN');
+
+  /**
+   * The class of the token.
+   */
+  final TokenClass _tokenClass;
+
+  /**
+   * The name of the token type.
+   */
+  final String name;
+
+  /**
+   * The lexeme that defines this type of token, or `null` if there is more than
+   * one possible lexeme for this type of token.
+   */
+  final String lexeme;
+
+  /**
+   * Initialize a newly created token type to have the given [name],
+   * [_tokenClass] and [lexeme].
+   */
+  const TokenType._(this.name,
+      [this._tokenClass = TokenClass.NO_CLASS, this.lexeme = null]);
+
+  /**
+   * Return `true` if this type of token represents an additive operator.
+   */
+  bool get isAdditiveOperator => _tokenClass == TokenClass.ADDITIVE_OPERATOR;
+
+  /**
+   * Return `true` if this type of token represents an assignment operator.
+   */
+  bool get isAssignmentOperator =>
+      _tokenClass == TokenClass.ASSIGNMENT_OPERATOR;
+
+  /**
+   * Return `true` if this type of token represents an associative operator. An
+   * associative operator is an operator for which the following equality is
+   * true: `(a * b) * c == a * (b * c)`. In other words, if the result of
+   * applying the operator to multiple operands does not depend on the order in
+   * which those applications occur.
+   *
+   * Note: This method considers the logical-and and logical-or operators to be
+   * associative, even though the order in which the application of those
+   * operators can have an effect because evaluation of the right-hand operand
+   * is conditional.
+   */
+  bool get isAssociativeOperator =>
+      this == AMPERSAND ||
+      this == AMPERSAND_AMPERSAND ||
+      this == BAR ||
+      this == BAR_BAR ||
+      this == CARET ||
+      this == PLUS ||
+      this == STAR;
+
+  /**
+   * Return `true` if this type of token represents an equality operator.
+   */
+  bool get isEqualityOperator => _tokenClass == TokenClass.EQUALITY_OPERATOR;
+
+  /**
+   * Return `true` if this type of token represents an increment operator.
+   */
+  bool get isIncrementOperator =>
+      identical(lexeme, '++') || identical(lexeme, '--');
+
+  /**
+   * Return `true` if this type of token represents a multiplicative operator.
+   */
+  bool get isMultiplicativeOperator =>
+      _tokenClass == TokenClass.MULTIPLICATIVE_OPERATOR;
+
+  /**
+   * Return `true` if this token type represents an operator.
+   */
+  bool get isOperator =>
+      _tokenClass != TokenClass.NO_CLASS &&
+      this != OPEN_PAREN &&
+      this != OPEN_SQUARE_BRACKET &&
+      this != PERIOD;
+
+  /**
+   * Return `true` if this type of token represents a relational operator.
+   */
+  bool get isRelationalOperator =>
+      _tokenClass == TokenClass.RELATIONAL_OPERATOR;
+
+  /**
+   * Return `true` if this type of token represents a shift operator.
+   */
+  bool get isShiftOperator => _tokenClass == TokenClass.SHIFT_OPERATOR;
+
+  /**
+   * Return `true` if this type of token represents a unary postfix operator.
+   */
+  bool get isUnaryPostfixOperator =>
+      _tokenClass == TokenClass.UNARY_POSTFIX_OPERATOR;
+
+  /**
+   * Return `true` if this type of token represents a unary prefix operator.
+   */
+  bool get isUnaryPrefixOperator =>
+      _tokenClass == TokenClass.UNARY_PREFIX_OPERATOR;
+
+  /**
+   * Return `true` if this token type represents an operator that can be defined
+   * by users.
+   */
+  bool get isUserDefinableOperator =>
+      identical(lexeme, '==') ||
+      identical(lexeme, '~') ||
+      identical(lexeme, '[]') ||
+      identical(lexeme, '[]=') ||
+      identical(lexeme, '*') ||
+      identical(lexeme, '/') ||
+      identical(lexeme, '%') ||
+      identical(lexeme, '~/') ||
+      identical(lexeme, '+') ||
+      identical(lexeme, '-') ||
+      identical(lexeme, '<<') ||
+      identical(lexeme, '>>') ||
+      identical(lexeme, '>=') ||
+      identical(lexeme, '>') ||
+      identical(lexeme, '<=') ||
+      identical(lexeme, '<') ||
+      identical(lexeme, '&') ||
+      identical(lexeme, '^') ||
+      identical(lexeme, '|');
+
+  /**
+   * Return the precedence of the token, or `0` if the token does not represent
+   * an operator.
+   */
+  int get precedence => _tokenClass.precedence;
+
+  @override
+  String toString() => name;
+}
+
+/**
+ * A normal token that is preceded by comments.
+ */
+class TokenWithComment extends SimpleToken {
+  /**
+   * The first comment in the list of comments that precede this token.
+   */
+  CommentToken _precedingComment;
+
+  /**
+   * Initialize a newly created token to have the given [type] at the given
+   * [offset] and to be preceded by the comments reachable from the given
+   * [comment].
+   */
+  TokenWithComment(TokenType type, int offset, this._precedingComment)
+      : super(type, offset) {
+    _setCommentParent(_precedingComment);
+  }
+
+  @override
+  CommentToken get precedingComments => _precedingComment;
+
+  void set precedingComments(CommentToken comment) {
+    _precedingComment = comment;
+    _setCommentParent(_precedingComment);
+  }
+
+  @override
+  Token copy() =>
+      new TokenWithComment(type, offset, copyComments(precedingComments));
+}
+
+/**
+ * A token representing the end (either the head or the tail) of a stream of
+ * tokens.
+ */
+class _EndOfFileTokenType extends TokenType {
+  /**
+   * Initialize a newly created token.
+   */
+  const _EndOfFileTokenType() : super._('EOF', TokenClass.NO_CLASS, '');
+
+  @override
+  String toString() => '-eof-';
+}
diff --git a/pkg/front_end/lib/summary_generator.dart b/pkg/front_end/lib/summary_generator.dart
new file mode 100644
index 0000000..0c494c4
--- /dev/null
+++ b/pkg/front_end/lib/summary_generator.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// Defines the front-end API for converting source code to summaries.
+library front_end.summary_generator;
+
+import 'dart:async';
+import 'compiler_options.dart';
+
+/// Creates a summary representation of the build unit whose source files are in
+/// [sources].
+///
+/// Intended to be a part of a modular compilation process.
+///
+/// [sources] should be the complete set of source files for a build unit
+/// (including both library and part files).
+///
+/// The summarization process is hermetic, meaning that the only files which
+/// will be read are those listed in [sources],
+/// [CompilerOptions.inputSummaries], and [CompilerOptions.sdkSummary].  If a
+/// source file attempts to refer to a file which is not obtainable from these
+/// paths, that will result in an error, even if the file exists on the
+/// filesystem.
+///
+/// Any `part` declarations found in [sources] must refer to part files which
+/// are also listed in [sources], otherwise an error results.  (It is not
+/// permitted to refer to a part file declared in another build unit).
+///
+/// The return value is a list of bytes to write to the summary file.
+Future<List<int>> summaryFor(List<Uri> sources, CompilerOptions options) =>
+    throw new UnimplementedError();
diff --git a/pkg/front_end/pubspec.yaml b/pkg/front_end/pubspec.yaml
new file mode 100644
index 0000000..5436751
--- /dev/null
+++ b/pkg/front_end/pubspec.yaml
@@ -0,0 +1,18 @@
+name: front_end
+version: 0.1.0-alpha.0
+author: Dart Team <misc@dartlang.org>
+description: Front end for compilation of Dart code.
+homepage: https://github.com/dart-lang/sdk/tree/master/pkg/front_end
+environment:
+  sdk: '>=1.12.0 <2.0.0'
+dependencies:
+  analyzer: '^0.29.0'
+  path: '^1.3.9'
+  source_span: '^1.2.3'
+dev_dependencies:
+  # TODO(sigmund): update to a version constraint once we roll the latest kernel
+  # to the repo.
+  kernel: {path: ../../pkg/kernel}
+  package_config: '^1.0.0'
+  test: ^0.12.0
+  test_reflective_loader: ^0.1.0
diff --git a/pkg/front_end/test/memory_file_system_test.dart b/pkg/front_end/test/memory_file_system_test.dart
new file mode 100644
index 0000000..b9757f3
--- /dev/null
+++ b/pkg/front_end/test/memory_file_system_test.dart
@@ -0,0 +1,259 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// SharedOptions=--supermixin
+
+library front_end.test.memory_file_system_test;
+
+import 'dart:convert';
+import 'dart:io' as io;
+
+import 'package:front_end/memory_file_system.dart';
+import 'package:path/path.dart' as pathos;
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(MemoryFileSystemTestNative);
+    defineReflectiveTests(MemoryFileSystemTestPosix);
+    defineReflectiveTests(MemoryFileSystemTestWindows);
+    defineReflectiveTests(FileTest);
+  });
+}
+
+@reflectiveTest
+class FileTest extends _BaseTestNative {
+  String path;
+  MemoryFileSystemEntity file;
+
+  setUp() {
+    super.setUp();
+    path = join(tempPath, 'file.txt');
+    file = fileSystem.entityForPath(path);
+  }
+
+  test_equals_differentPaths() {
+    expect(
+        file == fileSystem.entityForPath(join(tempPath, 'file2.txt')), isFalse);
+  }
+
+  test_equals_samePath() {
+    expect(
+        file == fileSystem.entityForPath(join(tempPath, 'file.txt')), isTrue);
+  }
+
+  test_hashCode_samePath() {
+    expect(file.hashCode,
+        fileSystem.entityForPath(join(tempPath, 'file.txt')).hashCode);
+  }
+
+  test_path() {
+    expect(file.path, path);
+  }
+
+  test_readAsBytes_badUtf8() async {
+    // A file containing invalid UTF-8 can still be read as raw bytes.
+    List<int> bytes = [0xc0, 0x40]; // Invalid UTF-8
+    file.writeAsBytesSync(bytes);
+    expect(await file.readAsBytes(), bytes);
+  }
+
+  test_readAsBytes_doesNotExist() {
+    expect(file.readAsBytes(), throwsException);
+  }
+
+  test_readAsBytes_exists() async {
+    var s = 'contents';
+    file.writeAsStringSync(s);
+    expect(await file.readAsBytes(), UTF8.encode(s));
+  }
+
+  test_readAsString_badUtf8() {
+    file.writeAsBytesSync([0xc0, 0x40]); // Invalid UTF-8
+    expect(file.readAsString(), throwsException);
+  }
+
+  test_readAsString_doesNotExist() {
+    expect(file.readAsString(), throwsException);
+  }
+
+  test_readAsString_exists() async {
+    var s = 'contents';
+    file.writeAsStringSync(s);
+    expect(await file.readAsString(), s);
+  }
+
+  test_readAsString_utf8() async {
+    file.writeAsBytesSync([0xe2, 0x82, 0xac]); // Unicode € symbol, in UTF-8
+    expect(await file.readAsString(), '\u20ac');
+  }
+
+  test_writeAsBytesSync_modifyAfterRead() async {
+    file.writeAsBytesSync([1]);
+    (await file.readAsBytes())[0] = 2;
+    expect(await file.readAsBytes(), [1]);
+  }
+
+  test_writeAsBytesSync_modifyAfterWrite() async {
+    var bytes = [1];
+    file.writeAsBytesSync(bytes);
+    bytes[0] = 2;
+    expect(await file.readAsBytes(), [1]);
+  }
+
+  test_writeAsBytesSync_overwrite() async {
+    file.writeAsBytesSync([1]);
+    file.writeAsBytesSync([2]);
+    expect(await file.readAsBytes(), [2]);
+  }
+
+  test_writeAsStringSync_overwrite() async {
+    file.writeAsStringSync('first');
+    file.writeAsStringSync('second');
+    expect(await file.readAsString(), 'second');
+  }
+
+  test_writeAsStringSync_utf8() async {
+    file.writeAsStringSync('\u20ac'); // Unicode € symbol
+    expect(await file.readAsBytes(), [0xe2, 0x82, 0xac]);
+  }
+}
+
+abstract class MemoryFileSystemTestMixin extends _BaseTest {
+  Uri tempUri;
+
+  setUp() {
+    super.setUp();
+    tempUri = fileSystem.context.toUri(tempPath);
+  }
+
+  test_entityForPath() {
+    var path = join(tempPath, 'file.txt');
+    expect(fileSystem.entityForPath(path).path, path);
+  }
+
+  test_entityForPath_absolutize() {
+    expect(fileSystem.entityForPath('file.txt').path,
+        join(fileSystem.currentDirectory, 'file.txt'));
+  }
+
+  test_entityForPath_normalize_dot() {
+    expect(fileSystem.entityForPath(join(tempPath, '.', 'file.txt')).path,
+        join(tempPath, 'file.txt'));
+  }
+
+  test_entityForPath_normalize_dotDot() {
+    expect(
+        fileSystem.entityForPath(join(tempPath, 'foo', '..', 'file.txt')).path,
+        join(tempPath, 'file.txt'));
+  }
+
+  test_entityForUri() {
+    expect(fileSystem.entityForUri(Uri.parse('$tempUri/file.txt')).path,
+        join(tempPath, 'file.txt'));
+  }
+
+  test_entityForUri_bareUri_absolute() {
+    expect(() => fileSystem.entityForUri(Uri.parse('/file.txt')),
+        throwsA(new isInstanceOf<Error>()));
+  }
+
+  test_entityForUri_bareUri_relative() {
+    expect(() => fileSystem.entityForUri(Uri.parse('file.txt')),
+        throwsA(new isInstanceOf<Error>()));
+  }
+
+  test_entityForUri_fileUri_relative() {
+    // A weird quirk of the Uri class is that it doesn't seem possible to create
+    // a `file:` uri with a relative path, no matter how many slashes you use or
+    // if you populate the fields directly.  But just to be certain, try to do
+    // so, and make that `file:` uris with relative paths are rejected.
+    for (var uri in <Uri>[
+      new Uri(scheme: 'file', path: 'file.txt'),
+      Uri.parse('file:file.txt'),
+      Uri.parse('file:/file.txt'),
+      Uri.parse('file://file.txt'),
+      Uri.parse('file:///file.txt')
+    ]) {
+      if (!uri.path.startsWith('/')) {
+        expect(() => fileSystem.entityForUri(uri),
+            throwsA(new isInstanceOf<Error>()));
+      }
+    }
+  }
+
+  test_entityForUri_nonFileUri() {
+    expect(() => fileSystem.entityForUri(Uri.parse('package:foo/bar.dart')),
+        throwsA(new isInstanceOf<Error>()));
+  }
+
+  test_entityForUri_normalize_dot() {
+    expect(fileSystem.entityForUri(Uri.parse('$tempUri/./file.txt')).path,
+        join(tempPath, 'file.txt'));
+  }
+
+  test_entityForUri_normalize_dotDot() {
+    expect(fileSystem.entityForUri(Uri.parse('$tempUri/foo/../file.txt')).path,
+        join(tempPath, 'file.txt'));
+  }
+}
+
+@reflectiveTest
+class MemoryFileSystemTestNative extends _BaseTestNative
+    with MemoryFileSystemTestMixin {}
+
+@reflectiveTest
+class MemoryFileSystemTestPosix extends _BaseTestPosix
+    with MemoryFileSystemTestMixin {}
+
+@reflectiveTest
+class MemoryFileSystemTestWindows extends _BaseTestWindows
+    with MemoryFileSystemTestMixin {}
+
+abstract class _BaseTest {
+  MemoryFileSystem get fileSystem;
+  String get tempPath;
+  String join(String path1, String path2, [String path3, String path4]);
+  void setUp();
+}
+
+class _BaseTestNative extends _BaseTest {
+  MemoryFileSystem fileSystem;
+  String tempPath;
+
+  String join(String path1, String path2, [String path3, String path4]) =>
+      pathos.join(path1, path2, path3, path4);
+
+  setUp() {
+    tempPath = pathos.join(io.Directory.systemTemp.path, 'test_file_system');
+    fileSystem =
+        new MemoryFileSystem(pathos.context, io.Directory.current.path);
+  }
+}
+
+class _BaseTestPosix extends _BaseTest {
+  MemoryFileSystem fileSystem;
+  String tempPath;
+
+  String join(String path1, String path2, [String path3, String path4]) =>
+      pathos.posix.join(path1, path2, path3, path4);
+
+  void setUp() {
+    tempPath = '/test_file_system';
+    fileSystem = new MemoryFileSystem(pathos.posix, '/cwd');
+  }
+}
+
+class _BaseTestWindows extends _BaseTest {
+  MemoryFileSystem fileSystem;
+  String tempPath;
+
+  String join(String path1, String path2, [String path3, String path4]) =>
+      pathos.windows.join(path1, path2, path3, path4);
+
+  void setUp() {
+    tempPath = r'c:\test_file_system';
+    fileSystem = new MemoryFileSystem(pathos.windows, r'c:\cwd');
+  }
+}
diff --git a/pkg/front_end/test/physical_file_system_test.dart b/pkg/front_end/test/physical_file_system_test.dart
new file mode 100644
index 0000000..859e998
--- /dev/null
+++ b/pkg/front_end/test/physical_file_system_test.dart
@@ -0,0 +1,221 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// SharedOptions=--supermixin
+
+library front_end.test.physical_file_system_test;
+
+import 'dart:async';
+import 'dart:convert';
+import 'dart:io' as io;
+
+import 'package:front_end/file_system.dart';
+import 'package:front_end/physical_file_system.dart';
+import 'package:path/path.dart' as p;
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(PhysicalFileSystemTest);
+    defineReflectiveTests(FileTest);
+  });
+}
+
+@reflectiveTest
+class FileTest extends _BaseTest {
+  String path;
+  FileSystemEntity file;
+
+  setUp() {
+    super.setUp();
+    path = p.join(tempPath, 'file.txt');
+    file = PhysicalFileSystem.instance.entityForPath(path);
+  }
+
+  test_equals_differentPaths() {
+    expect(
+        file ==
+            PhysicalFileSystem.instance
+                .entityForPath(p.join(tempPath, 'file2.txt')),
+        isFalse);
+  }
+
+  test_equals_samePath() {
+    expect(
+        file ==
+            PhysicalFileSystem.instance
+                .entityForPath(p.join(tempPath, 'file.txt')),
+        isTrue);
+  }
+
+  test_hashCode_samePath() {
+    expect(
+        file.hashCode,
+        PhysicalFileSystem.instance
+            .entityForPath(p.join(tempPath, 'file.txt'))
+            .hashCode);
+  }
+
+  test_path() {
+    expect(file.path, path);
+  }
+
+  test_readAsBytes_badUtf8() async {
+    // A file containing invalid UTF-8 can still be read as raw bytes.
+    List<int> bytes = [0xc0, 0x40]; // Invalid UTF-8
+    new io.File(path).writeAsBytesSync(bytes);
+    expect(await file.readAsBytes(), bytes);
+  }
+
+  test_readAsBytes_doesNotExist() {
+    expect(file.readAsBytes(), throwsException);
+  }
+
+  test_readAsBytes_exists() async {
+    var s = 'contents';
+    new io.File(path).writeAsStringSync(s);
+    expect(await file.readAsBytes(), UTF8.encode(s));
+  }
+
+  test_readAsString_badUtf8() {
+    new io.File(path).writeAsBytesSync([0xc0, 0x40]); // Invalid UTF-8
+    expect(file.readAsString(), throwsException);
+  }
+
+  test_readAsString_doesNotExist() {
+    expect(file.readAsString(), throwsException);
+  }
+
+  test_readAsString_exists() async {
+    var s = 'contents';
+    new io.File(path).writeAsStringSync(s);
+    expect(await file.readAsString(), s);
+  }
+
+  test_readAsString_utf8() async {
+    var bytes = [0xe2, 0x82, 0xac]; // Unicode € symbol (in UTF-8)
+    new io.File(path).writeAsBytesSync(bytes);
+    expect(await file.readAsString(), '\u20ac');
+  }
+}
+
+@reflectiveTest
+class PhysicalFileSystemTest extends _BaseTest {
+  Uri tempUri;
+
+  setUp() {
+    super.setUp();
+    tempUri = new Uri.directory(tempPath);
+  }
+
+  test_entityForPath() {
+    var path = p.join(tempPath, 'file.txt');
+    expect(PhysicalFileSystem.instance.entityForPath(path).path, path);
+  }
+
+  test_entityForPath_absolutize() {
+    expect(PhysicalFileSystem.instance.entityForPath('file.txt').path,
+        new io.File('file.txt').absolute.path);
+  }
+
+  test_entityForPath_normalize_dot() {
+    expect(
+        PhysicalFileSystem.instance
+            .entityForPath(p.join(tempPath, '.', 'file.txt'))
+            .path,
+        p.join(tempPath, 'file.txt'));
+  }
+
+  test_entityForPath_normalize_dotDot() {
+    expect(
+        PhysicalFileSystem.instance
+            .entityForPath(p.join(tempPath, 'foo', '..', 'file.txt'))
+            .path,
+        p.join(tempPath, 'file.txt'));
+  }
+
+  test_entityForUri() {
+    expect(
+        PhysicalFileSystem.instance
+            .entityForUri(Uri.parse('$tempUri/file.txt'))
+            .path,
+        p.join(tempPath, 'file.txt'));
+  }
+
+  test_entityForUri_bareUri_absolute() {
+    expect(
+        () => PhysicalFileSystem.instance.entityForUri(Uri.parse('/file.txt')),
+        throwsA(new isInstanceOf<Error>()));
+  }
+
+  test_entityForUri_bareUri_relative() {
+    expect(
+        () => PhysicalFileSystem.instance.entityForUri(Uri.parse('file.txt')),
+        throwsA(new isInstanceOf<Error>()));
+  }
+
+  test_entityForUri_fileUri_relative() {
+    // A weird quirk of the Uri class is that it doesn't seem possible to create
+    // a `file:` uri with a relative path, no matter how many slashes you use or
+    // if you populate the fields directly.  But just to be certain, try to do
+    // so, and make that `file:` uris with relative paths are rejected.
+    for (var uri in <Uri>[
+      new Uri(scheme: 'file', path: 'file.txt'),
+      Uri.parse('file:file.txt'),
+      Uri.parse('file:/file.txt'),
+      Uri.parse('file://file.txt'),
+      Uri.parse('file:///file.txt')
+    ]) {
+      if (!uri.path.startsWith('/')) {
+        expect(() => PhysicalFileSystem.instance.entityForUri(uri),
+            throwsA(new isInstanceOf<Error>()));
+      }
+    }
+  }
+
+  test_entityForUri_nonFileUri() {
+    expect(
+        () => PhysicalFileSystem.instance
+            .entityForUri(Uri.parse('package:foo/bar.dart')),
+        throwsA(new isInstanceOf<Error>()));
+  }
+
+  test_entityForUri_normalize_dot() {
+    expect(
+        PhysicalFileSystem.instance
+            .entityForUri(Uri.parse('$tempUri/./file.txt'))
+            .path,
+        p.join(tempPath, 'file.txt'));
+  }
+
+  test_entityForUri_normalize_dotDot() {
+    expect(
+        PhysicalFileSystem.instance
+            .entityForUri(Uri.parse('$tempUri/foo/../file.txt'))
+            .path,
+        p.join(tempPath, 'file.txt'));
+  }
+}
+
+class _BaseTest {
+  io.Directory tempDirectory;
+  String tempPath;
+
+  setUp() {
+    tempDirectory = io.Directory.systemTemp.createTempSync('test_file_system');
+    tempPath = tempDirectory.absolute.path;
+  }
+
+  tearDown() async {
+    try {
+      tempDirectory.deleteSync(recursive: true);
+    } on io.FileSystemException {
+      // Sometimes on Windows the delete fails with errno 32
+      // (ERROR_SHARING_VIOLATION: The process cannot access the file because it
+      // is being used by another process).  Wait 1 second and try again.
+      await new Future.delayed(new Duration(seconds: 1));
+      tempDirectory.deleteSync(recursive: true);
+    }
+  }
+}
diff --git a/pkg/front_end/test/scanner_test.dart b/pkg/front_end/test/scanner_test.dart
new file mode 100644
index 0000000..69e802d
--- /dev/null
+++ b/pkg/front_end/test/scanner_test.dart
@@ -0,0 +1,1298 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:front_end/src/base/errors.dart';
+import 'package:front_end/src/base/jenkins_smi_hash.dart';
+import 'package:front_end/src/scanner/errors.dart';
+import 'package:front_end/src/scanner/reader.dart';
+import 'package:front_end/src/scanner/scanner.dart';
+import 'package:front_end/src/scanner/token.dart';
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(CharSequenceReaderTest);
+    defineReflectiveTests(KeywordStateTest);
+    defineReflectiveTests(ScannerTest);
+    defineReflectiveTests(TokenTypeTest);
+  });
+}
+
+@reflectiveTest
+class CharSequenceReaderTest {
+  void test_advance() {
+    CharSequenceReader reader = new CharSequenceReader("x");
+    expect(reader.advance(), 0x78);
+    expect(reader.advance(), -1);
+    expect(reader.advance(), -1);
+  }
+
+  void test_creation() {
+    expect(new CharSequenceReader("x"), isNotNull);
+  }
+
+  void test_getOffset() {
+    CharSequenceReader reader = new CharSequenceReader("x");
+    expect(reader.offset, -1);
+    reader.advance();
+    expect(reader.offset, 0);
+    reader.advance();
+    expect(reader.offset, 0);
+  }
+
+  void test_getString() {
+    CharSequenceReader reader = new CharSequenceReader("xyzzy");
+    reader.offset = 3;
+    expect(reader.getString(1, 0), "yzz");
+    expect(reader.getString(2, 1), "zzy");
+  }
+
+  void test_peek() {
+    CharSequenceReader reader = new CharSequenceReader("xy");
+    expect(reader.peek(), 0x78);
+    expect(reader.peek(), 0x78);
+    reader.advance();
+    expect(reader.peek(), 0x79);
+    expect(reader.peek(), 0x79);
+    reader.advance();
+    expect(reader.peek(), -1);
+    expect(reader.peek(), -1);
+  }
+
+  void test_setOffset() {
+    CharSequenceReader reader = new CharSequenceReader("xyz");
+    reader.offset = 2;
+    expect(reader.offset, 2);
+  }
+}
+
+@reflectiveTest
+class KeywordStateTest {
+  void test_KeywordState() {
+    //
+    // Generate the test data to be scanned.
+    //
+    List<Keyword> keywords = Keyword.values;
+    int keywordCount = keywords.length;
+    List<String> textToTest = new List<String>(keywordCount * 3);
+    for (int i = 0; i < keywordCount; i++) {
+      String syntax = keywords[i].syntax;
+      textToTest[i] = syntax;
+      textToTest[i + keywordCount] = "${syntax}x";
+      textToTest[i + keywordCount * 2] = syntax.substring(0, syntax.length - 1);
+    }
+    //
+    // Scan each of the identifiers.
+    //
+    KeywordState firstState = KeywordState.KEYWORD_STATE;
+    for (int i = 0; i < textToTest.length; i++) {
+      String text = textToTest[i];
+      int index = 0;
+      int length = text.length;
+      KeywordState state = firstState;
+      while (index < length && state != null) {
+        state = state.next(text.codeUnitAt(index));
+        index++;
+      }
+      if (i < keywordCount) {
+        // keyword
+        expect(state, isNotNull);
+        expect(state.keyword(), isNotNull);
+        expect(state.keyword(), keywords[i]);
+      } else if (i < keywordCount * 2) {
+        // keyword + "x"
+        expect(state, isNull);
+      } else {
+        // keyword.substring(0, keyword.length() - 1)
+        expect(state, isNotNull);
+      }
+    }
+  }
+}
+
+@reflectiveTest
+class ScannerTest {
+  void fail_incomplete_string_interpolation() {
+    // https://code.google.com/p/dart/issues/detail?id=18073
+    _assertErrorAndTokens(
+        ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 9, "\"foo \${bar", [
+      new StringToken(TokenType.STRING, "\"foo ", 0),
+      new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 5),
+      new StringToken(TokenType.IDENTIFIER, "bar", 7)
+    ]);
+  }
+
+  void test_ampersand() {
+    _assertToken(TokenType.AMPERSAND, "&");
+  }
+
+  void test_ampersand_ampersand() {
+    _assertToken(TokenType.AMPERSAND_AMPERSAND, "&&");
+  }
+
+  void test_ampersand_ampersand_eq() {
+    _assertToken(TokenType.AMPERSAND_AMPERSAND_EQ, "&&=",
+        lazyAssignmentOperators: true);
+  }
+
+  void test_ampersand_eq() {
+    _assertToken(TokenType.AMPERSAND_EQ, "&=");
+  }
+
+  void test_at() {
+    _assertToken(TokenType.AT, "@");
+  }
+
+  void test_backping() {
+    _assertToken(TokenType.BACKPING, "`");
+  }
+
+  void test_backslash() {
+    _assertToken(TokenType.BACKSLASH, "\\");
+  }
+
+  void test_bang() {
+    _assertToken(TokenType.BANG, "!");
+  }
+
+  void test_bang_eq() {
+    _assertToken(TokenType.BANG_EQ, "!=");
+  }
+
+  void test_bar() {
+    _assertToken(TokenType.BAR, "|");
+  }
+
+  void test_bar_bar() {
+    _assertToken(TokenType.BAR_BAR, "||");
+  }
+
+  void test_bar_bar_eq() {
+    _assertToken(TokenType.BAR_BAR_EQ, "||=", lazyAssignmentOperators: true);
+  }
+
+  void test_bar_eq() {
+    _assertToken(TokenType.BAR_EQ, "|=");
+  }
+
+  void test_caret() {
+    _assertToken(TokenType.CARET, "^");
+  }
+
+  void test_caret_eq() {
+    _assertToken(TokenType.CARET_EQ, "^=");
+  }
+
+  void test_close_curly_bracket() {
+    _assertToken(TokenType.CLOSE_CURLY_BRACKET, "}");
+  }
+
+  void test_close_paren() {
+    _assertToken(TokenType.CLOSE_PAREN, ")");
+  }
+
+  void test_close_quare_bracket() {
+    _assertToken(TokenType.CLOSE_SQUARE_BRACKET, "]");
+  }
+
+  void test_colon() {
+    _assertToken(TokenType.COLON, ":");
+  }
+
+  void test_comma() {
+    _assertToken(TokenType.COMMA, ",");
+  }
+
+  void test_comment_disabled_multi() {
+    Scanner scanner =
+        new _TestScanner(new CharSequenceReader("/* comment */ "));
+    scanner.preserveComments = false;
+    Token token = scanner.tokenize();
+    expect(token, isNotNull);
+    expect(token.precedingComments, isNull);
+  }
+
+  void test_comment_generic_method_type_assign() {
+    _assertComment(TokenType.MULTI_LINE_COMMENT, "/*=comment*/");
+    _assertComment(TokenType.GENERIC_METHOD_TYPE_ASSIGN, "/*=comment*/",
+        genericMethodComments: true);
+  }
+
+  void test_comment_generic_method_type_list() {
+    _assertComment(TokenType.MULTI_LINE_COMMENT, "/*<comment>*/");
+    _assertComment(TokenType.GENERIC_METHOD_TYPE_LIST, "/*<comment>*/",
+        genericMethodComments: true);
+  }
+
+  void test_comment_multi() {
+    _assertComment(TokenType.MULTI_LINE_COMMENT, "/* comment */");
+  }
+
+  void test_comment_multi_lineEnds() {
+    String code = r'''
+/**
+ * aa
+ * bbb
+ * c
+ */''';
+    _ErrorListener listener = new _ErrorListener();
+    Scanner scanner = new _TestScanner(new CharSequenceReader(code), listener);
+    scanner.tokenize();
+    expect(
+        scanner.lineStarts,
+        equals(<int>[
+          code.indexOf('/**'),
+          code.indexOf(' * aa'),
+          code.indexOf(' * bbb'),
+          code.indexOf(' * c'),
+          code.indexOf(' */')
+        ]));
+  }
+
+  void test_comment_multi_unterminated() {
+    _assertError(ScannerErrorCode.UNTERMINATED_MULTI_LINE_COMMENT, 3, "/* x");
+  }
+
+  void test_comment_nested() {
+    _assertComment(
+        TokenType.MULTI_LINE_COMMENT, "/* comment /* within a */ comment */");
+  }
+
+  void test_comment_single() {
+    _assertComment(TokenType.SINGLE_LINE_COMMENT, "// comment");
+  }
+
+  void test_double_both_E() {
+    _assertToken(TokenType.DOUBLE, "0.123E4");
+  }
+
+  void test_double_both_e() {
+    _assertToken(TokenType.DOUBLE, "0.123e4");
+  }
+
+  void test_double_fraction() {
+    _assertToken(TokenType.DOUBLE, ".123");
+  }
+
+  void test_double_fraction_E() {
+    _assertToken(TokenType.DOUBLE, ".123E4");
+  }
+
+  void test_double_fraction_e() {
+    _assertToken(TokenType.DOUBLE, ".123e4");
+  }
+
+  void test_double_missingDigitInExponent() {
+    _assertError(ScannerErrorCode.MISSING_DIGIT, 1, "1e");
+  }
+
+  void test_double_whole_E() {
+    _assertToken(TokenType.DOUBLE, "12E4");
+  }
+
+  void test_double_whole_e() {
+    _assertToken(TokenType.DOUBLE, "12e4");
+  }
+
+  void test_eq() {
+    _assertToken(TokenType.EQ, "=");
+  }
+
+  void test_eq_eq() {
+    _assertToken(TokenType.EQ_EQ, "==");
+  }
+
+  void test_gt() {
+    _assertToken(TokenType.GT, ">");
+  }
+
+  void test_gt_eq() {
+    _assertToken(TokenType.GT_EQ, ">=");
+  }
+
+  void test_gt_gt() {
+    _assertToken(TokenType.GT_GT, ">>");
+  }
+
+  void test_gt_gt_eq() {
+    _assertToken(TokenType.GT_GT_EQ, ">>=");
+  }
+
+  void test_hash() {
+    _assertToken(TokenType.HASH, "#");
+  }
+
+  void test_hexidecimal() {
+    _assertToken(TokenType.HEXADECIMAL, "0x1A2B3C");
+  }
+
+  void test_hexidecimal_missingDigit() {
+    _assertError(ScannerErrorCode.MISSING_HEX_DIGIT, 1, "0x");
+  }
+
+  void test_identifier() {
+    _assertToken(TokenType.IDENTIFIER, "result");
+  }
+
+  void test_illegalChar_cyrillicLetter_middle() {
+    _assertError(
+        ScannerErrorCode.ILLEGAL_CHARACTER, 5, "Shche\u0433lov", [0x433]);
+  }
+
+  void test_illegalChar_cyrillicLetter_start() {
+    _assertError(ScannerErrorCode.ILLEGAL_CHARACTER, 0, "\u0429", [0x429]);
+  }
+
+  void test_illegalChar_nbsp() {
+    _assertError(ScannerErrorCode.ILLEGAL_CHARACTER, 0, "\u00A0", [0xa0]);
+  }
+
+  void test_illegalChar_notLetter() {
+    _assertError(ScannerErrorCode.ILLEGAL_CHARACTER, 0, "\u0312", [0x312]);
+  }
+
+  void test_index() {
+    _assertToken(TokenType.INDEX, "[]");
+  }
+
+  void test_index_eq() {
+    _assertToken(TokenType.INDEX_EQ, "[]=");
+  }
+
+  void test_int() {
+    _assertToken(TokenType.INT, "123");
+  }
+
+  void test_int_initialZero() {
+    _assertToken(TokenType.INT, "0123");
+  }
+
+  void test_keyword_abstract() {
+    _assertKeywordToken("abstract");
+  }
+
+  void test_keyword_as() {
+    _assertKeywordToken("as");
+  }
+
+  void test_keyword_assert() {
+    _assertKeywordToken("assert");
+  }
+
+  void test_keyword_break() {
+    _assertKeywordToken("break");
+  }
+
+  void test_keyword_case() {
+    _assertKeywordToken("case");
+  }
+
+  void test_keyword_catch() {
+    _assertKeywordToken("catch");
+  }
+
+  void test_keyword_class() {
+    _assertKeywordToken("class");
+  }
+
+  void test_keyword_const() {
+    _assertKeywordToken("const");
+  }
+
+  void test_keyword_continue() {
+    _assertKeywordToken("continue");
+  }
+
+  void test_keyword_default() {
+    _assertKeywordToken("default");
+  }
+
+  void test_keyword_deferred() {
+    _assertKeywordToken("deferred");
+  }
+
+  void test_keyword_do() {
+    _assertKeywordToken("do");
+  }
+
+  void test_keyword_dynamic() {
+    _assertKeywordToken("dynamic");
+  }
+
+  void test_keyword_else() {
+    _assertKeywordToken("else");
+  }
+
+  void test_keyword_enum() {
+    _assertKeywordToken("enum");
+  }
+
+  void test_keyword_export() {
+    _assertKeywordToken("export");
+  }
+
+  void test_keyword_extends() {
+    _assertKeywordToken("extends");
+  }
+
+  void test_keyword_factory() {
+    _assertKeywordToken("factory");
+  }
+
+  void test_keyword_false() {
+    _assertKeywordToken("false");
+  }
+
+  void test_keyword_final() {
+    _assertKeywordToken("final");
+  }
+
+  void test_keyword_finally() {
+    _assertKeywordToken("finally");
+  }
+
+  void test_keyword_for() {
+    _assertKeywordToken("for");
+  }
+
+  void test_keyword_get() {
+    _assertKeywordToken("get");
+  }
+
+  void test_keyword_if() {
+    _assertKeywordToken("if");
+  }
+
+  void test_keyword_implements() {
+    _assertKeywordToken("implements");
+  }
+
+  void test_keyword_import() {
+    _assertKeywordToken("import");
+  }
+
+  void test_keyword_in() {
+    _assertKeywordToken("in");
+  }
+
+  void test_keyword_is() {
+    _assertKeywordToken("is");
+  }
+
+  void test_keyword_library() {
+    _assertKeywordToken("library");
+  }
+
+  void test_keyword_new() {
+    _assertKeywordToken("new");
+  }
+
+  void test_keyword_null() {
+    _assertKeywordToken("null");
+  }
+
+  void test_keyword_operator() {
+    _assertKeywordToken("operator");
+  }
+
+  void test_keyword_part() {
+    _assertKeywordToken("part");
+  }
+
+  void test_keyword_rethrow() {
+    _assertKeywordToken("rethrow");
+  }
+
+  void test_keyword_return() {
+    _assertKeywordToken("return");
+  }
+
+  void test_keyword_set() {
+    _assertKeywordToken("set");
+  }
+
+  void test_keyword_static() {
+    _assertKeywordToken("static");
+  }
+
+  void test_keyword_super() {
+    _assertKeywordToken("super");
+  }
+
+  void test_keyword_switch() {
+    _assertKeywordToken("switch");
+  }
+
+  void test_keyword_this() {
+    _assertKeywordToken("this");
+  }
+
+  void test_keyword_throw() {
+    _assertKeywordToken("throw");
+  }
+
+  void test_keyword_true() {
+    _assertKeywordToken("true");
+  }
+
+  void test_keyword_try() {
+    _assertKeywordToken("try");
+  }
+
+  void test_keyword_typedef() {
+    _assertKeywordToken("typedef");
+  }
+
+  void test_keyword_var() {
+    _assertKeywordToken("var");
+  }
+
+  void test_keyword_void() {
+    _assertKeywordToken("void");
+  }
+
+  void test_keyword_while() {
+    _assertKeywordToken("while");
+  }
+
+  void test_keyword_with() {
+    _assertKeywordToken("with");
+  }
+
+  void test_lt() {
+    _assertToken(TokenType.LT, "<");
+  }
+
+  void test_lt_eq() {
+    _assertToken(TokenType.LT_EQ, "<=");
+  }
+
+  void test_lt_lt() {
+    _assertToken(TokenType.LT_LT, "<<");
+  }
+
+  void test_lt_lt_eq() {
+    _assertToken(TokenType.LT_LT_EQ, "<<=");
+  }
+
+  void test_minus() {
+    _assertToken(TokenType.MINUS, "-");
+  }
+
+  void test_minus_eq() {
+    _assertToken(TokenType.MINUS_EQ, "-=");
+  }
+
+  void test_minus_minus() {
+    _assertToken(TokenType.MINUS_MINUS, "--");
+  }
+
+  void test_open_curly_bracket() {
+    _assertToken(TokenType.OPEN_CURLY_BRACKET, "{");
+  }
+
+  void test_open_paren() {
+    _assertToken(TokenType.OPEN_PAREN, "(");
+  }
+
+  void test_open_square_bracket() {
+    _assertToken(TokenType.OPEN_SQUARE_BRACKET, "[");
+  }
+
+  void test_openSquareBracket() {
+    _assertToken(TokenType.OPEN_SQUARE_BRACKET, "[");
+  }
+
+  void test_percent() {
+    _assertToken(TokenType.PERCENT, "%");
+  }
+
+  void test_percent_eq() {
+    _assertToken(TokenType.PERCENT_EQ, "%=");
+  }
+
+  void test_period() {
+    _assertToken(TokenType.PERIOD, ".");
+  }
+
+  void test_period_period() {
+    _assertToken(TokenType.PERIOD_PERIOD, "..");
+  }
+
+  void test_period_period_period() {
+    _assertToken(TokenType.PERIOD_PERIOD_PERIOD, "...");
+  }
+
+  void test_periodAfterNumberNotIncluded_identifier() {
+    _assertTokens("42.isEven()", [
+      new StringToken(TokenType.INT, "42", 0),
+      new Token(TokenType.PERIOD, 2),
+      new StringToken(TokenType.IDENTIFIER, "isEven", 3),
+      new Token(TokenType.OPEN_PAREN, 9),
+      new Token(TokenType.CLOSE_PAREN, 10)
+    ]);
+  }
+
+  void test_periodAfterNumberNotIncluded_period() {
+    _assertTokens("42..isEven()", [
+      new StringToken(TokenType.INT, "42", 0),
+      new Token(TokenType.PERIOD_PERIOD, 2),
+      new StringToken(TokenType.IDENTIFIER, "isEven", 4),
+      new Token(TokenType.OPEN_PAREN, 10),
+      new Token(TokenType.CLOSE_PAREN, 11)
+    ]);
+  }
+
+  void test_plus() {
+    _assertToken(TokenType.PLUS, "+");
+  }
+
+  void test_plus_eq() {
+    _assertToken(TokenType.PLUS_EQ, "+=");
+  }
+
+  void test_plus_plus() {
+    _assertToken(TokenType.PLUS_PLUS, "++");
+  }
+
+  void test_question() {
+    _assertToken(TokenType.QUESTION, "?");
+  }
+
+  void test_question_dot() {
+    _assertToken(TokenType.QUESTION_PERIOD, "?.");
+  }
+
+  void test_question_question() {
+    _assertToken(TokenType.QUESTION_QUESTION, "??");
+  }
+
+  void test_question_question_eq() {
+    _assertToken(TokenType.QUESTION_QUESTION_EQ, "??=");
+  }
+
+  void test_scriptTag_withArgs() {
+    _assertToken(TokenType.SCRIPT_TAG, "#!/bin/dart -debug");
+  }
+
+  void test_scriptTag_withoutSpace() {
+    _assertToken(TokenType.SCRIPT_TAG, "#!/bin/dart");
+  }
+
+  void test_scriptTag_withSpace() {
+    _assertToken(TokenType.SCRIPT_TAG, "#! /bin/dart");
+  }
+
+  void test_semicolon() {
+    _assertToken(TokenType.SEMICOLON, ";");
+  }
+
+  void test_setSourceStart() {
+    int offsetDelta = 42;
+    _ErrorListener listener = new _ErrorListener();
+    Scanner scanner =
+        new _TestScanner(new SubSequenceReader("a", offsetDelta), listener);
+    scanner.setSourceStart(3, 9);
+    scanner.tokenize();
+    List<int> lineStarts = scanner.lineStarts;
+    expect(lineStarts, isNotNull);
+    expect(lineStarts.length, 3);
+    expect(lineStarts[2], 33);
+  }
+
+  void test_slash() {
+    _assertToken(TokenType.SLASH, "/");
+  }
+
+  void test_slash_eq() {
+    _assertToken(TokenType.SLASH_EQ, "/=");
+  }
+
+  void test_star() {
+    _assertToken(TokenType.STAR, "*");
+  }
+
+  void test_star_eq() {
+    _assertToken(TokenType.STAR_EQ, "*=");
+  }
+
+  void test_startAndEnd() {
+    Token token = _scan("a");
+    Token previous = token.previous;
+    expect(previous.next, token);
+    expect(previous.previous, previous);
+    Token next = token.next;
+    expect(next.next, next);
+    expect(next.previous, token);
+  }
+
+  void test_string_multi_double() {
+    _assertToken(TokenType.STRING, "\"\"\"line1\nline2\"\"\"");
+  }
+
+  void test_string_multi_embeddedQuotes() {
+    _assertToken(TokenType.STRING, "\"\"\"line1\n\"\"\nline2\"\"\"");
+  }
+
+  void test_string_multi_embeddedQuotes_escapedChar() {
+    _assertToken(TokenType.STRING, "\"\"\"a\"\"\\tb\"\"\"");
+  }
+
+  void test_string_multi_interpolation_block() {
+    _assertTokens("\"Hello \${name}!\"", [
+      new StringToken(TokenType.STRING, "\"Hello ", 0),
+      new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 7),
+      new StringToken(TokenType.IDENTIFIER, "name", 9),
+      new Token(TokenType.CLOSE_CURLY_BRACKET, 13),
+      new StringToken(TokenType.STRING, "!\"", 14)
+    ]);
+  }
+
+  void test_string_multi_interpolation_identifier() {
+    _assertTokens("\"Hello \$name!\"", [
+      new StringToken(TokenType.STRING, "\"Hello ", 0),
+      new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 7),
+      new StringToken(TokenType.IDENTIFIER, "name", 8),
+      new StringToken(TokenType.STRING, "!\"", 12)
+    ]);
+  }
+
+  void test_string_multi_single() {
+    _assertToken(TokenType.STRING, "'''string'''");
+  }
+
+  void test_string_multi_slashEnter() {
+    _assertToken(TokenType.STRING, "'''\\\n'''");
+  }
+
+  void test_string_multi_unterminated() {
+    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 8,
+        "'''string", [new StringToken(TokenType.STRING, "'''string", 0)]);
+  }
+
+  void test_string_multi_unterminated_interpolation_block() {
+    _assertErrorAndTokens(
+        ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 8, "'''\${name", [
+      new StringToken(TokenType.STRING, "'''", 0),
+      new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 3),
+      new StringToken(TokenType.IDENTIFIER, "name", 5),
+      new StringToken(TokenType.STRING, "", 9)
+    ]);
+  }
+
+  void test_string_multi_unterminated_interpolation_identifier() {
+    _assertErrorAndTokens(
+        ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 7, "'''\$name", [
+      new StringToken(TokenType.STRING, "'''", 0),
+      new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 3),
+      new StringToken(TokenType.IDENTIFIER, "name", 4),
+      new StringToken(TokenType.STRING, "", 8)
+    ]);
+  }
+
+  void test_string_raw_multi_double() {
+    _assertToken(TokenType.STRING, "r\"\"\"line1\nline2\"\"\"");
+  }
+
+  void test_string_raw_multi_single() {
+    _assertToken(TokenType.STRING, "r'''string'''");
+  }
+
+  void test_string_raw_multi_unterminated() {
+    String source = "r'''string";
+    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 9,
+        source, [new StringToken(TokenType.STRING, source, 0)]);
+  }
+
+  void test_string_raw_simple_double() {
+    _assertToken(TokenType.STRING, "r\"string\"");
+  }
+
+  void test_string_raw_simple_single() {
+    _assertToken(TokenType.STRING, "r'string'");
+  }
+
+  void test_string_raw_simple_unterminated_eof() {
+    String source = "r'string";
+    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 7,
+        source, [new StringToken(TokenType.STRING, source, 0)]);
+  }
+
+  void test_string_raw_simple_unterminated_eol() {
+    String source = "r'string";
+    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 8,
+        "$source\n", [new StringToken(TokenType.STRING, source, 0)]);
+  }
+
+  void test_string_simple_double() {
+    _assertToken(TokenType.STRING, "\"string\"");
+  }
+
+  void test_string_simple_escapedDollar() {
+    _assertToken(TokenType.STRING, "'a\\\$b'");
+  }
+
+  void test_string_simple_interpolation_adjacentIdentifiers() {
+    _assertTokens("'\$a\$b'", [
+      new StringToken(TokenType.STRING, "'", 0),
+      new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1),
+      new StringToken(TokenType.IDENTIFIER, "a", 2),
+      new StringToken(TokenType.STRING, "", 3),
+      new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 3),
+      new StringToken(TokenType.IDENTIFIER, "b", 4),
+      new StringToken(TokenType.STRING, "'", 5)
+    ]);
+  }
+
+  void test_string_simple_interpolation_block() {
+    _assertTokens("'Hello \${name}!'", [
+      new StringToken(TokenType.STRING, "'Hello ", 0),
+      new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 7),
+      new StringToken(TokenType.IDENTIFIER, "name", 9),
+      new Token(TokenType.CLOSE_CURLY_BRACKET, 13),
+      new StringToken(TokenType.STRING, "!'", 14)
+    ]);
+  }
+
+  void test_string_simple_interpolation_blockWithNestedMap() {
+    _assertTokens("'a \${f({'b' : 'c'})} d'", [
+      new StringToken(TokenType.STRING, "'a ", 0),
+      new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 3),
+      new StringToken(TokenType.IDENTIFIER, "f", 5),
+      new Token(TokenType.OPEN_PAREN, 6),
+      new Token(TokenType.OPEN_CURLY_BRACKET, 7),
+      new StringToken(TokenType.STRING, "'b'", 8),
+      new Token(TokenType.COLON, 12),
+      new StringToken(TokenType.STRING, "'c'", 14),
+      new Token(TokenType.CLOSE_CURLY_BRACKET, 17),
+      new Token(TokenType.CLOSE_PAREN, 18),
+      new Token(TokenType.CLOSE_CURLY_BRACKET, 19),
+      new StringToken(TokenType.STRING, " d'", 20)
+    ]);
+  }
+
+  void test_string_simple_interpolation_firstAndLast() {
+    _assertTokens("'\$greeting \$name'", [
+      new StringToken(TokenType.STRING, "'", 0),
+      new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1),
+      new StringToken(TokenType.IDENTIFIER, "greeting", 2),
+      new StringToken(TokenType.STRING, " ", 10),
+      new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 11),
+      new StringToken(TokenType.IDENTIFIER, "name", 12),
+      new StringToken(TokenType.STRING, "'", 16)
+    ]);
+  }
+
+  void test_string_simple_interpolation_identifier() {
+    _assertTokens("'Hello \$name!'", [
+      new StringToken(TokenType.STRING, "'Hello ", 0),
+      new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 7),
+      new StringToken(TokenType.IDENTIFIER, "name", 8),
+      new StringToken(TokenType.STRING, "!'", 12)
+    ]);
+  }
+
+  void test_string_simple_interpolation_missingIdentifier() {
+    _assertTokens("'\$x\$'", [
+      new StringToken(TokenType.STRING, "'", 0),
+      new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1),
+      new StringToken(TokenType.IDENTIFIER, "x", 2),
+      new StringToken(TokenType.STRING, "", 3),
+      new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 3),
+      new StringToken(TokenType.STRING, "'", 4)
+    ]);
+  }
+
+  void test_string_simple_interpolation_nonIdentifier() {
+    _assertTokens("'\$1'", [
+      new StringToken(TokenType.STRING, "'", 0),
+      new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1),
+      new StringToken(TokenType.STRING, "1'", 2)
+    ]);
+  }
+
+  void test_string_simple_single() {
+    _assertToken(TokenType.STRING, "'string'");
+  }
+
+  void test_string_simple_unterminated_eof() {
+    String source = "'string";
+    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 6,
+        source, [new StringToken(TokenType.STRING, source, 0)]);
+  }
+
+  void test_string_simple_unterminated_eol() {
+    String source = "'string";
+    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 7,
+        "$source\r", [new StringToken(TokenType.STRING, source, 0)]);
+  }
+
+  void test_string_simple_unterminated_interpolation_block() {
+    _assertErrorAndTokens(
+        ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 6, "'\${name", [
+      new StringToken(TokenType.STRING, "'", 0),
+      new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 1),
+      new StringToken(TokenType.IDENTIFIER, "name", 3),
+      new StringToken(TokenType.STRING, "", 7)
+    ]);
+  }
+
+  void test_string_simple_unterminated_interpolation_identifier() {
+    _assertErrorAndTokens(
+        ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 5, "'\$name", [
+      new StringToken(TokenType.STRING, "'", 0),
+      new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1),
+      new StringToken(TokenType.IDENTIFIER, "name", 2),
+      new StringToken(TokenType.STRING, "", 6)
+    ]);
+  }
+
+  void test_tilde() {
+    _assertToken(TokenType.TILDE, "~");
+  }
+
+  void test_tilde_slash() {
+    _assertToken(TokenType.TILDE_SLASH, "~/");
+  }
+
+  void test_tilde_slash_eq() {
+    _assertToken(TokenType.TILDE_SLASH_EQ, "~/=");
+  }
+
+  void test_unclosedPairInInterpolation() {
+    _ErrorListener listener = new _ErrorListener();
+    _scanWithListener("'\${(}'", listener);
+  }
+
+  void _assertComment(TokenType commentType, String source,
+      {bool genericMethodComments: false}) {
+    //
+    // Test without a trailing end-of-line marker
+    //
+    Token token = _scan(source, genericMethodComments: genericMethodComments);
+    expect(token, isNotNull);
+    expect(token.type, TokenType.EOF);
+    Token comment = token.precedingComments;
+    expect(comment, isNotNull);
+    expect(comment.type, commentType);
+    expect(comment.offset, 0);
+    expect(comment.length, source.length);
+    expect(comment.lexeme, source);
+    //
+    // Test with a trailing end-of-line marker
+    //
+    token = _scan("$source\n", genericMethodComments: genericMethodComments);
+    expect(token, isNotNull);
+    expect(token.type, TokenType.EOF);
+    comment = token.precedingComments;
+    expect(comment, isNotNull);
+    expect(comment.type, commentType);
+    expect(comment.offset, 0);
+    expect(comment.length, source.length);
+    expect(comment.lexeme, source);
+  }
+
+  /**
+   * Assert that scanning the given [source] produces an error with the given
+   * code.
+   *
+   * [expectedError] the error that should be produced
+   * [expectedOffset] the string offset that should be associated with the error
+   * [source] the source to be scanned to produce the error
+   */
+  void _assertError(
+      ScannerErrorCode expectedError, int expectedOffset, String source,
+      [List<Object> arguments]) {
+    _ErrorListener listener = new _ErrorListener();
+    _scanWithListener(source, listener);
+    listener.assertErrors(
+        [new _TestError(expectedOffset, 1, expectedError, arguments)]);
+  }
+
+  /**
+   * Assert that scanning the given [source] produces an error with the given
+   * code, and also produces the given tokens.
+   *
+   * [expectedError] the error that should be produced
+   * [expectedOffset] the string offset that should be associated with the error
+   * [source] the source to be scanned to produce the error
+   * [expectedTokens] the tokens that are expected to be in the source
+   */
+  void _assertErrorAndTokens(ScannerErrorCode expectedError, int expectedOffset,
+      String source, List<Token> expectedTokens) {
+    _ErrorListener listener = new _ErrorListener();
+    Token token = _scanWithListener(source, listener);
+    listener
+        .assertErrors([new _TestError(expectedOffset, 1, expectedError, null)]);
+    _checkTokens(token, expectedTokens);
+  }
+
+  /**
+   * Assert that when scanned the given [source] contains a single keyword token
+   * with the same lexeme as the original source.
+   */
+  void _assertKeywordToken(String source) {
+    Token token = _scan(source);
+    expect(token, isNotNull);
+    expect(token.type, TokenType.KEYWORD);
+    expect(token.offset, 0);
+    expect(token.length, source.length);
+    expect(token.lexeme, source);
+    Object value = token.value();
+    expect(value is Keyword, isTrue);
+    expect((value as Keyword).syntax, source);
+    token = _scan(" $source ");
+    expect(token, isNotNull);
+    expect(token.type, TokenType.KEYWORD);
+    expect(token.offset, 1);
+    expect(token.length, source.length);
+    expect(token.lexeme, source);
+    value = token.value();
+    expect(value is Keyword, isTrue);
+    expect((value as Keyword).syntax, source);
+    expect(token.next.type, TokenType.EOF);
+  }
+
+  /**
+   * Assert that the token scanned from the given [source] has the
+   * [expectedType].
+   */
+  Token _assertToken(TokenType expectedType, String source,
+      {bool lazyAssignmentOperators: false}) {
+    Token originalToken =
+        _scan(source, lazyAssignmentOperators: lazyAssignmentOperators);
+    expect(originalToken, isNotNull);
+    expect(originalToken.type, expectedType);
+    expect(originalToken.offset, 0);
+    expect(originalToken.length, source.length);
+    expect(originalToken.lexeme, source);
+    if (expectedType == TokenType.SCRIPT_TAG) {
+      // Adding space before the script tag is not allowed, and adding text at
+      // the end changes nothing.
+      return originalToken;
+    } else if (expectedType == TokenType.SINGLE_LINE_COMMENT) {
+      // Adding space to an end-of-line comment changes the comment.
+      Token tokenWithSpaces =
+          _scan(" $source", lazyAssignmentOperators: lazyAssignmentOperators);
+      expect(tokenWithSpaces, isNotNull);
+      expect(tokenWithSpaces.type, expectedType);
+      expect(tokenWithSpaces.offset, 1);
+      expect(tokenWithSpaces.length, source.length);
+      expect(tokenWithSpaces.lexeme, source);
+      return originalToken;
+    } else if (expectedType == TokenType.INT ||
+        expectedType == TokenType.DOUBLE) {
+      Token tokenWithLowerD =
+          _scan("${source}d", lazyAssignmentOperators: lazyAssignmentOperators);
+      expect(tokenWithLowerD, isNotNull);
+      expect(tokenWithLowerD.type, expectedType);
+      expect(tokenWithLowerD.offset, 0);
+      expect(tokenWithLowerD.length, source.length);
+      expect(tokenWithLowerD.lexeme, source);
+      Token tokenWithUpperD =
+          _scan("${source}D", lazyAssignmentOperators: lazyAssignmentOperators);
+      expect(tokenWithUpperD, isNotNull);
+      expect(tokenWithUpperD.type, expectedType);
+      expect(tokenWithUpperD.offset, 0);
+      expect(tokenWithUpperD.length, source.length);
+      expect(tokenWithUpperD.lexeme, source);
+    }
+    Token tokenWithSpaces =
+        _scan(" $source ", lazyAssignmentOperators: lazyAssignmentOperators);
+    expect(tokenWithSpaces, isNotNull);
+    expect(tokenWithSpaces.type, expectedType);
+    expect(tokenWithSpaces.offset, 1);
+    expect(tokenWithSpaces.length, source.length);
+    expect(tokenWithSpaces.lexeme, source);
+    expect(originalToken.next.type, TokenType.EOF);
+    return originalToken;
+  }
+
+  /**
+   * Assert that when scanned the given [source] contains a sequence of tokens
+   * identical to the given list of [expectedTokens].
+   */
+  void _assertTokens(String source, List<Token> expectedTokens) {
+    Token token = _scan(source);
+    _checkTokens(token, expectedTokens);
+  }
+
+  void _checkTokens(Token firstToken, List<Token> expectedTokens) {
+    expect(firstToken, isNotNull);
+    Token token = firstToken;
+    for (int i = 0; i < expectedTokens.length; i++) {
+      Token expectedToken = expectedTokens[i];
+      expect(token.type, expectedToken.type, reason: "Wrong type for token $i");
+      expect(token.offset, expectedToken.offset,
+          reason: "Wrong offset for token $i");
+      expect(token.length, expectedToken.length,
+          reason: "Wrong length for token $i");
+      expect(token.lexeme, expectedToken.lexeme,
+          reason: "Wrong lexeme for token $i");
+      token = token.next;
+      expect(token, isNotNull);
+    }
+    expect(token.type, TokenType.EOF);
+  }
+
+  Token _scan(String source,
+      {bool genericMethodComments: false,
+      bool lazyAssignmentOperators: false}) {
+    _ErrorListener listener = new _ErrorListener();
+    Token token = _scanWithListener(source, listener,
+        genericMethodComments: genericMethodComments,
+        lazyAssignmentOperators: lazyAssignmentOperators);
+    listener.assertNoErrors();
+    return token;
+  }
+
+  Token _scanWithListener(String source, _ErrorListener listener,
+      {bool genericMethodComments: false,
+      bool lazyAssignmentOperators: false}) {
+    Scanner scanner =
+        new _TestScanner(new CharSequenceReader(source), listener);
+    scanner.scanGenericMethodComments = genericMethodComments;
+    scanner.scanLazyAssignmentOperators = lazyAssignmentOperators;
+    return scanner.tokenize();
+  }
+}
+
+@reflectiveTest
+class TokenTypeTest {
+  void test_isOperator() {
+    expect(TokenType.AMPERSAND.isOperator, isTrue);
+    expect(TokenType.AMPERSAND_AMPERSAND.isOperator, isTrue);
+    expect(TokenType.AMPERSAND_EQ.isOperator, isTrue);
+    expect(TokenType.BANG.isOperator, isTrue);
+    expect(TokenType.BANG_EQ.isOperator, isTrue);
+    expect(TokenType.BAR.isOperator, isTrue);
+    expect(TokenType.BAR_BAR.isOperator, isTrue);
+    expect(TokenType.BAR_EQ.isOperator, isTrue);
+    expect(TokenType.CARET.isOperator, isTrue);
+    expect(TokenType.CARET_EQ.isOperator, isTrue);
+    expect(TokenType.EQ.isOperator, isTrue);
+    expect(TokenType.EQ_EQ.isOperator, isTrue);
+    expect(TokenType.GT.isOperator, isTrue);
+    expect(TokenType.GT_EQ.isOperator, isTrue);
+    expect(TokenType.GT_GT.isOperator, isTrue);
+    expect(TokenType.GT_GT_EQ.isOperator, isTrue);
+    expect(TokenType.INDEX.isOperator, isTrue);
+    expect(TokenType.INDEX_EQ.isOperator, isTrue);
+    expect(TokenType.IS.isOperator, isTrue);
+    expect(TokenType.LT.isOperator, isTrue);
+    expect(TokenType.LT_EQ.isOperator, isTrue);
+    expect(TokenType.LT_LT.isOperator, isTrue);
+    expect(TokenType.LT_LT_EQ.isOperator, isTrue);
+    expect(TokenType.MINUS.isOperator, isTrue);
+    expect(TokenType.MINUS_EQ.isOperator, isTrue);
+    expect(TokenType.MINUS_MINUS.isOperator, isTrue);
+    expect(TokenType.PERCENT.isOperator, isTrue);
+    expect(TokenType.PERCENT_EQ.isOperator, isTrue);
+    expect(TokenType.PERIOD_PERIOD.isOperator, isTrue);
+    expect(TokenType.PLUS.isOperator, isTrue);
+    expect(TokenType.PLUS_EQ.isOperator, isTrue);
+    expect(TokenType.PLUS_PLUS.isOperator, isTrue);
+    expect(TokenType.QUESTION.isOperator, isTrue);
+    expect(TokenType.SLASH.isOperator, isTrue);
+    expect(TokenType.SLASH_EQ.isOperator, isTrue);
+    expect(TokenType.STAR.isOperator, isTrue);
+    expect(TokenType.STAR_EQ.isOperator, isTrue);
+    expect(TokenType.TILDE.isOperator, isTrue);
+    expect(TokenType.TILDE_SLASH.isOperator, isTrue);
+    expect(TokenType.TILDE_SLASH_EQ.isOperator, isTrue);
+  }
+
+  void test_isUserDefinableOperator() {
+    expect(TokenType.AMPERSAND.isUserDefinableOperator, isTrue);
+    expect(TokenType.BAR.isUserDefinableOperator, isTrue);
+    expect(TokenType.CARET.isUserDefinableOperator, isTrue);
+    expect(TokenType.EQ_EQ.isUserDefinableOperator, isTrue);
+    expect(TokenType.GT.isUserDefinableOperator, isTrue);
+    expect(TokenType.GT_EQ.isUserDefinableOperator, isTrue);
+    expect(TokenType.GT_GT.isUserDefinableOperator, isTrue);
+    expect(TokenType.INDEX.isUserDefinableOperator, isTrue);
+    expect(TokenType.INDEX_EQ.isUserDefinableOperator, isTrue);
+    expect(TokenType.LT.isUserDefinableOperator, isTrue);
+    expect(TokenType.LT_EQ.isUserDefinableOperator, isTrue);
+    expect(TokenType.LT_LT.isUserDefinableOperator, isTrue);
+    expect(TokenType.MINUS.isUserDefinableOperator, isTrue);
+    expect(TokenType.PERCENT.isUserDefinableOperator, isTrue);
+    expect(TokenType.PLUS.isUserDefinableOperator, isTrue);
+    expect(TokenType.SLASH.isUserDefinableOperator, isTrue);
+    expect(TokenType.STAR.isUserDefinableOperator, isTrue);
+    expect(TokenType.TILDE.isUserDefinableOperator, isTrue);
+    expect(TokenType.TILDE_SLASH.isUserDefinableOperator, isTrue);
+  }
+}
+
+class _ErrorListener {
+  final errors = <_TestError>[];
+
+  void assertErrors(List<_TestError> expectedErrors) {
+    expect(errors, unorderedEquals(expectedErrors));
+  }
+
+  void assertNoErrors() {
+    assertErrors([]);
+  }
+}
+
+class _TestError {
+  final int offset;
+  final int length;
+  final ErrorCode errorCode;
+  final List<Object> arguments;
+
+  _TestError(this.offset, this.length, this.errorCode, this.arguments);
+
+  @override
+  get hashCode {
+    var h = new JenkinsSmiHash()..add(offset)..add(length)..add(errorCode);
+    if (arguments != null) {
+      for (Object argument in arguments) {
+        h.add(argument);
+      }
+    }
+    return h.hashCode;
+  }
+
+  @override
+  operator ==(Object other) {
+    if (other is _TestError &&
+        offset == other.offset &&
+        length == other.length &&
+        errorCode == other.errorCode) {
+      if (arguments == null) return other.arguments == null;
+      if (other.arguments == null) return false;
+      if (arguments.length != other.arguments.length) return false;
+      for (int i = 0; i < arguments.length; i++) {
+        if (arguments[i] != other.arguments[i]) return false;
+      }
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  toString() {
+    var end = offset + length;
+    var argString = arguments == null ? '' : '(${arguments.join(', ')})';
+    return 'Error($offset..$end, $errorCode$argString)';
+  }
+}
+
+class _TestScanner extends Scanner {
+  final _ErrorListener listener;
+
+  _TestScanner(CharacterReader reader, [this.listener]) : super(reader);
+
+  @override
+  void reportError(
+      ScannerErrorCode errorCode, int offset, List<Object> arguments) {
+    if (listener != null) {
+      listener.errors.add(new _TestError(offset, 1, errorCode, arguments));
+    }
+  }
+}
diff --git a/pkg/front_end/tool/perf.dart b/pkg/front_end/tool/perf.dart
new file mode 100644
index 0000000..4d61e9b
--- /dev/null
+++ b/pkg/front_end/tool/perf.dart
@@ -0,0 +1,256 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// An entrypoint used to run portions of front_end and measure its performance.
+library front_end.tool.perf;
+
+import 'dart:async';
+import 'dart:io' show exit, stderr;
+
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/error/listener.dart';
+import 'package:analyzer/file_system/file_system.dart' show ResourceUriResolver;
+import 'package:analyzer/file_system/physical_file_system.dart'
+    show PhysicalResourceProvider;
+import 'package:analyzer/source/package_map_resolver.dart';
+import 'package:analyzer/src/context/builder.dart';
+import 'package:analyzer/src/dart/sdk/sdk.dart' show FolderBasedDartSdk;
+import 'package:analyzer/src/generated/parser.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/generated/source_io.dart';
+import 'package:kernel/analyzer/loader.dart';
+import 'package:kernel/kernel.dart';
+import 'package:package_config/discovery.dart';
+
+import 'package:front_end/src/scanner/reader.dart';
+import 'package:front_end/src/scanner/scanner.dart';
+import 'package:front_end/src/scanner/token.dart';
+
+/// Cumulative total number of chars scanned.
+int scanTotalChars = 0;
+
+/// Cumulative time spent scanning.
+Stopwatch scanTimer = new Stopwatch();
+
+/// Factory to load and resolve app, packages, and sdk sources.
+SourceFactory sources;
+
+main(List<String> args) async {
+  // TODO(sigmund): provide sdk folder as well.
+  if (args.length < 2) {
+    print('usage: perf.dart <bench-id> <entry.dart>');
+    exit(1);
+  }
+  var totalTimer = new Stopwatch()..start();
+
+  var bench = args[0];
+  var entryUri = Uri.base.resolve(args[1]);
+
+  await setup(entryUri);
+
+  var handlers = {
+    'scan': () async {
+      Set<Source> files = scanReachableFiles(entryUri);
+      // TODO(sigmund): replace the warmup with instrumented snapshots.
+      for (int i = 0; i < 10; i++) scanFiles(files);
+    },
+    'parse': () async {
+      Set<Source> files = scanReachableFiles(entryUri);
+      // TODO(sigmund): replace the warmup with instrumented snapshots.
+      for (int i = 0; i < 10; i++) parseFiles(files);
+    },
+    'kernel_gen_e2e': () async {
+      // TODO(sigmund): remove. This is used to compute the input size, we
+      // should extract input size from frontend instead.
+      scanReachableFiles(entryUri);
+      // TODO(sigmund): replace this warmup. Note that for very large programs,
+      // the GC pressure on the VM seems to make this worse with time (maybe we
+      // are leaking memory?). That's why we run it twice and not 10 times.
+      for (int i = 0; i < 2; i++) await generateKernel(entryUri);
+    },
+  };
+
+  var handler = handlers[bench];
+  if (handler == null) {
+    // TODO(sigmund): implement the remaining benchmarks.
+    print('unsupported bench-id: $bench. Please specify one of the following: '
+        '${handlers.keys.join(", ")}');
+    exit(1);
+  }
+  await handler();
+
+  totalTimer.stop();
+  report("total", totalTimer.elapsedMicroseconds);
+}
+
+/// Sets up analyzer to be able to load and resolve app, packages, and sdk
+/// sources.
+Future setup(Uri entryUri) async {
+  var provider = PhysicalResourceProvider.INSTANCE;
+  var packageMap = new ContextBuilder(provider, null, null)
+      .convertPackagesToMap(await findPackages(entryUri));
+  sources = new SourceFactory([
+    new ResourceUriResolver(provider),
+    new PackageMapUriResolver(provider, packageMap),
+    new DartUriResolver(
+        new FolderBasedDartSdk(provider, provider.getFolder("sdk"))),
+  ]);
+}
+
+/// Load and scans all files we need to process: files reachable from the
+/// entrypoint and all core libraries automatically included by the VM.
+Set<Source> scanReachableFiles(Uri entryUri) {
+  var files = new Set<Source>();
+  var loadTimer = new Stopwatch()..start();
+  collectSources(sources.forUri2(entryUri), files);
+
+  var libs = [
+    "dart:async",
+    "dart:collection",
+    "dart:convert",
+    "dart:core",
+    "dart:developer",
+    "dart:_internal",
+    "dart:isolate",
+    "dart:math",
+    "dart:mirrors",
+    "dart:typed_data",
+    "dart:io"
+  ];
+
+  for (var lib in libs) {
+    collectSources(sources.forUri(lib), files);
+  }
+
+  loadTimer.stop();
+
+  print('input size: ${scanTotalChars} chars');
+  var loadTime = loadTimer.elapsedMicroseconds - scanTimer.elapsedMicroseconds;
+  report("load", loadTime);
+  report("scan", scanTimer.elapsedMicroseconds);
+  return files;
+}
+
+/// Scans every file in [files] and reports the time spent doing so.
+void scanFiles(Set<Source> files) {
+  // The code below will record again how many chars are scanned and how long it
+  // takes to scan them, even though we already did so in [scanReachableFiles].
+  // Recording and reporting this twice is unnecessary, but we do so for now to
+  // validate that the results are consistent.
+  scanTimer = new Stopwatch();
+  var old = scanTotalChars;
+  scanTotalChars = 0;
+  for (var source in files) {
+    tokenize(source);
+  }
+
+  // Report size and scanning time again. See discussion above.
+  if (old != scanTotalChars) print('input size changed? ${old} chars');
+  report("scan", scanTimer.elapsedMicroseconds);
+}
+
+/// Parses every file in [files] and reports the time spent doing so.
+void parseFiles(Set<Source> files) {
+  // The code below will record again how many chars are scanned and how long it
+  // takes to scan them, even though we already did so in [scanReachableFiles].
+  // Recording and reporting this twice is unnecessary, but we do so for now to
+  // validate that the results are consistent.
+  scanTimer = new Stopwatch();
+  var old = scanTotalChars;
+  scanTotalChars = 0;
+  var parseTimer = new Stopwatch()..start();
+  for (var source in files) {
+    parseFull(source);
+  }
+  parseTimer.stop();
+
+  // Report size and scanning time again. See discussion above.
+  if (old != scanTotalChars) print('input size changed? ${old} chars');
+  report("scan", scanTimer.elapsedMicroseconds);
+
+  var pTime = parseTimer.elapsedMicroseconds - scanTimer.elapsedMicroseconds;
+  report("parse", pTime);
+}
+
+/// Add to [files] all sources reachable from [start].
+void collectSources(Source start, Set<Source> files) {
+  if (!files.add(start)) return;
+  var unit = parseDirectives(start);
+  for (var directive in unit.directives) {
+    if (directive is UriBasedDirective) {
+      var next = sources.resolveUri(start, directive.uri.stringValue);
+      collectSources(next, files);
+    }
+  }
+}
+
+/// Uses the diet-parser to parse only directives in [source].
+CompilationUnit parseDirectives(Source source) {
+  var token = tokenize(source);
+  var parser = new Parser(source, AnalysisErrorListener.NULL_LISTENER);
+  return parser.parseDirectives(token);
+}
+
+/// Parse the full body of [source] and return it's compilation unit.
+CompilationUnit parseFull(Source source) {
+  var token = tokenize(source);
+  var parser = new Parser(source, AnalysisErrorListener.NULL_LISTENER);
+  return parser.parseCompilationUnit(token);
+}
+
+/// Scan [source] and return the first token produced by the scanner.
+Token tokenize(Source source) {
+  scanTimer.start();
+  var contents = source.contents.data;
+  scanTotalChars += contents.length;
+  // TODO(sigmund): is there a way to scan from a random-access-file without
+  // first converting to String?
+  var scanner = new _Scanner(contents);
+  var token = scanner.tokenize();
+  scanTimer.stop();
+  return token;
+}
+
+class _Scanner extends Scanner {
+  _Scanner(String contents) : super(new CharSequenceReader(contents)) {
+    preserveComments = false;
+  }
+
+  @override
+  void reportError(errorCode, int offset, List<Object> arguments) {
+    // ignore errors.
+  }
+}
+
+/// Report that metric [name] took [time] micro-seconds to process
+/// [scanTotalChars] characters.
+void report(String name, int time) {
+  var sb = new StringBuffer();
+  sb.write('$name: $time us, ${time ~/ 1000} ms');
+  sb.write(', ${scanTotalChars * 1000 ~/ time} chars/ms');
+  print('$sb');
+}
+
+// TODO(sigmund): replace this once kernel is produced by the frontend directly.
+Future<Program> generateKernel(Uri entryUri) async {
+  var dartkTimer = new Stopwatch()..start();
+  var options = new DartOptions(strongMode: false, sdk: 'sdk');
+  var packages =
+      await createPackages(options.packagePath, discoveryPath: entryUri.path);
+  var repository = new Repository();
+  DartLoader loader = new DartLoader(repository, options, packages);
+
+  Program program = loader.loadProgram(entryUri.path);
+  List errors = loader.errors;
+  if (errors.isNotEmpty) {
+    const int errorLimit = 100;
+    stderr.writeln(errors.take(errorLimit).join('\n'));
+    if (errors.length > errorLimit) {
+      stderr.writeln('[error] ${errors.length - errorLimit} errors not shown');
+    }
+  }
+  dartkTimer.stop();
+  report("kernel_gen_e2e", dartkTimer.elapsedMicroseconds);
+  return program;
+}
diff --git a/pkg/front_end/tool/perf_test.dart b/pkg/front_end/tool/perf_test.dart
new file mode 100644
index 0000000..5abc06f
--- /dev/null
+++ b/pkg/front_end/tool/perf_test.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// The only purpose of this file is to enable analyzer tests on `perf.dart`,
+/// the code here just has a dummy import to the rest of the code.
+library front_end.tool.perf_test;
+
+import 'perf.dart' as m;
+
+main() => print('done ${m.scanTotalChars}');
diff --git a/pkg/js/README.md b/pkg/js/README.md
index 393a489..e95e03e 100644
--- a/pkg/js/README.md
+++ b/pkg/js/README.md
@@ -90,6 +90,8 @@
 }
 ```
 
+NB: This _anonymous_ class must have an unnamed _factory constructor_.
+
 #### Passing functions to JavaScript.
 
 If you are passing a Dart function to a JavaScript API, you must wrap it using
diff --git a/pkg/kernel/.analysis_options b/pkg/kernel/.analysis_options
new file mode 100644
index 0000000..e96ec6a
--- /dev/null
+++ b/pkg/kernel/.analysis_options
@@ -0,0 +1,6 @@
+analyzer:
+  strong-mode: true
+  language:
+    enableSuperMixins: true
+  exclude:
+    - testcases/**
diff --git a/pkg/kernel/.gitignore b/pkg/kernel/.gitignore
new file mode 100644
index 0000000..a151f3d
--- /dev/null
+++ b/pkg/kernel/.gitignore
@@ -0,0 +1,5 @@
+.packages
+.pub
+packages
+pubspec.lock
+bin/dartk.snapshot
diff --git a/pkg/kernel/AUTHORS b/pkg/kernel/AUTHORS
new file mode 100644
index 0000000..5aff99a
--- /dev/null
+++ b/pkg/kernel/AUTHORS
@@ -0,0 +1,10 @@
+# Below is a list of people and organizations that have contributed
+# to the project. Names should be added to the list like so:
+#
+#   Name/Organization <email address>
+
+Google Inc.
+
+Asger Feldthaus <asgerf@google.com>
+Martin Kustermann <kustermann@google.com>
+Kevin Millikin <kmillikin@google.com>
diff --git a/pkg/kernel/LICENSE b/pkg/kernel/LICENSE
new file mode 100644
index 0000000..1883d24
--- /dev/null
+++ b/pkg/kernel/LICENSE
@@ -0,0 +1,24 @@
+Copyright 2016, the Dart project authors. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+    * Neither the name of Google Inc. nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/pkg/kernel/README.md b/pkg/kernel/README.md
new file mode 100644
index 0000000..8239a3d
--- /dev/null
+++ b/pkg/kernel/README.md
@@ -0,0 +1,67 @@
+Dart Kernel
+===========
+**Dart Kernel** is a small high-level language derived from Dart.
+It is designed for use as an intermediate format for whole-program analysis
+and transformations, and as a frontend for codegen and execution backends.
+
+The kernel language has in-memory representations in Dart and C++, and
+can be serialized as binary or text.
+
+Both the kernel language and its implementations are unstable and are under development.
+
+This package contains the Dart part of the implementation and contains:
+- A transformable IR for the kernel language
+- A frontend based on the analyzer
+- Serialization of kernel code
+
+Getting Kernel
+------------
+
+Checkout the repository and run pub get:
+```bash
+git clone https://github.com/dart-lang/kernel
+cd kernel
+pub get
+```
+
+Command-Line Tool
+-----------------
+
+Run `bin/dartk.dart` from the command-line to convert between .dart files
+and the serialized binary and textual formats.
+
+`dartk` expects the `.dill` extension for files in the binary format.
+The textual format has no preferred extension right now.
+
+Example commands:
+```bash
+dartk foo.dart            # print text IR for foo.dart
+dartk foo.dart -ofoo.dill # write binary IR for foo.dart to foo.dill
+dartk foo.dill            # print text IR for binary file foo.dill
+```
+
+Pass the `--link` or `-l` flag to link all transitive dependencies into one file:
+```bash
+dartk myapp.dart -ppackages -l -omyapp.dill # Bundle everything.
+dartk myapp.dill # Print it back out in a (very, very long) textual format.
+```
+
+See [ast.dart](lib/ast.dart) for the in-memory IR, or [binary.md](binary.md) for
+a description of the binary format.  For now, the textual format is very ad-hoc
+and cannot be parsed back in.
+
+
+Testing
+-------
+
+If you plan to make changes to kernel, get a checkout of the Dartk SDK and run:
+```bash
+tool/regenerate_dill_files.dart --sdk <path to SDK checkout>
+pub run test
+```
+
+
+Linking
+-------------------------
+Linking from binary files is not yet implemented.  In order to compile a whole
+program, currently everything must be compiled from source at once.
diff --git a/pkg/kernel/bin/batch_util.dart b/pkg/kernel/bin/batch_util.dart
new file mode 100644
index 0000000..0070aa0
--- /dev/null
+++ b/pkg/kernel/bin/batch_util.dart
@@ -0,0 +1,49 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.batch_util;
+
+import 'dart:async';
+import 'dart:convert';
+import 'dart:io';
+
+enum CompilerOutcome { Ok, Fail, }
+
+typedef Future<CompilerOutcome> BatchCallback(List<String> arguments);
+
+/// Runs the given [callback] in the batch mode for use by the test framework in
+/// `dart-lang/sdk`.
+///
+/// The [callback] should behave as a main method, except it should return a
+/// [CompilerOutcome] for reporting its outcome to the testing framework.
+Future runBatch(BatchCallback callback) async {
+  int totalTests = 0;
+  int testsFailed = 0;
+  var watch = new Stopwatch()..start();
+  print('>>> BATCH START');
+  Stream input = stdin.transform(UTF8.decoder).transform(new LineSplitter());
+  await for (String line in input) {
+    if (line.isEmpty) {
+      int time = watch.elapsedMilliseconds;
+      print('>>> BATCH END '
+          '(${totalTests - testsFailed})/$totalTests ${time}ms');
+      break;
+    }
+    ++totalTests;
+    var arguments = line.split(new RegExp(r'\s+'));
+    try {
+      var outcome = await callback(arguments);
+      stderr.writeln('>>> EOF STDERR');
+      if (outcome == CompilerOutcome.Ok) {
+        print('>>> TEST PASS ${watch.elapsedMilliseconds}ms');
+      } else {
+        print('>>> TEST FAIL ${watch.elapsedMilliseconds}ms');
+      }
+    } catch (e, stackTrace) {
+      stderr.writeln(e);
+      stderr.writeln(stackTrace);
+      stderr.writeln('>>> EOF STDERR');
+      print('>>> TEST CRASH');
+    }
+  }
+}
diff --git a/pkg/kernel/bin/dartk.dart b/pkg/kernel/bin/dartk.dart
new file mode 100755
index 0000000..e735f97
--- /dev/null
+++ b/pkg/kernel/bin/dartk.dart
@@ -0,0 +1,384 @@
+#!/usr/bin/env dart
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 'batch_util.dart';
+
+import 'package:args/args.dart';
+import 'package:kernel/analyzer/loader.dart';
+import 'package:kernel/verifier.dart';
+import 'package:kernel/kernel.dart';
+import 'package:kernel/log.dart';
+import 'package:kernel/target/targets.dart';
+import 'package:path/path.dart' as path;
+
+// Returns the path to the current sdk based on `Platform.resolvedExecutable`.
+String currentSdk() {
+  // The dart executable should be inside dart-sdk/bin/dart.
+  return path.dirname(path.dirname(path.absolute(Platform.resolvedExecutable)));
+}
+
+ArgParser parser = new ArgParser(allowTrailingOptions: true)
+  ..addOption('format',
+      abbr: 'f',
+      allowed: ['text', 'bin'],
+      help: 'Output format.\n'
+          '(defaults to "text" unless output file ends with ".dill")')
+  ..addOption('out',
+      abbr: 'o',
+      help: 'Output file.\n'
+          '(defaults to "out.dill" if format is "bin", otherwise stdout)')
+  ..addOption('sdk', defaultsTo: currentSdk(), help: 'Path to the Dart SDK.')
+  ..addOption('packages',
+      abbr: 'p', help: 'Path to the .packages file or packages folder.')
+  ..addOption('package-root', help: 'Deprecated alias for --packages')
+  ..addOption('target',
+      abbr: 't',
+      help: 'Tailor the IR to the given target.',
+      allowed: targetNames,
+      defaultsTo: 'vm')
+  ..addFlag('strong',
+      help: 'Load .dart files in strong mode.\n'
+          'Does not affect loading of binary files. Strong mode support is very\n'
+          'unstable and not well integrated yet.')
+  ..addFlag('link', abbr: 'l', help: 'Link the whole program into one file.')
+  ..addFlag('no-output', negatable: false, help: 'Do not output any files.')
+  ..addOption('url-mapping',
+      allowMultiple: true,
+      help: 'A custom url mapping of the form `<scheme>:<name>::<uri>`.')
+  ..addFlag('verbose',
+      abbr: 'v',
+      negatable: false,
+      help: 'Print internal warnings and diagnostics to stderr.')
+  ..addFlag('print-metrics',
+      negatable: false, help: 'Print performance metrics.')
+  ..addOption('write-dependencies',
+      help: 'Write all the .dart that were loaded to the given file.')
+  ..addFlag('verify-ir', help: 'Perform slow internal correctness checks.')
+  ..addFlag('tolerant',
+      help: 'Generate kernel even if there are compile-time errors.',
+      defaultsTo: false)
+  ..addOption('D',
+      abbr: 'D',
+      allowMultiple: true,
+      help: 'Define an environment variable.',
+      hide: true)
+  ..addFlag('show-external',
+      help: 'When printing a library as text, also print its dependencies\n'
+          'on external libraries.');
+
+String getUsage() => """
+Usage: dartk [options] FILE
+
+Convert .dart or .dill files to kernel's IR and print out its textual
+or binary form.
+
+Examples:
+    dartk foo.dart            # print text IR for foo.dart
+    dartk foo.dart -ofoo.dill # write binary IR for foo.dart to foo.dill
+    dartk foo.dill            # print text IR for binary file foo.dill
+
+Options:
+${parser.usage}
+
+    -D<name>=<value>        Define an environment variable.
+""";
+
+dynamic fail(String message) {
+  stderr.writeln(message);
+  exit(1);
+  return null;
+}
+
+ArgResults options;
+
+String defaultFormat() {
+  if (options['out'] != null && options['out'].endsWith('.dill')) {
+    return 'bin';
+  }
+  return 'text';
+}
+
+String defaultOutput() {
+  if (options['format'] == 'bin') {
+    return 'out.dill';
+  }
+  return null;
+}
+
+void checkIsDirectoryOrNull(String path, String option) {
+  if (path == null) return;
+  var stat = new File(path).statSync();
+  switch (stat.type) {
+    case FileSystemEntityType.DIRECTORY:
+    case FileSystemEntityType.LINK:
+      return;
+    case FileSystemEntityType.NOT_FOUND:
+      throw fail('$option not found: $path');
+    default:
+      fail('$option is not a directory: $path');
+  }
+}
+
+void checkIsFile(String path, {String option}) {
+  var stat = new File(path).statSync();
+  switch (stat.type) {
+    case FileSystemEntityType.DIRECTORY:
+      throw fail('$option is a directory: $path');
+
+    case FileSystemEntityType.NOT_FOUND:
+      throw fail('$option not found: $path');
+  }
+}
+
+void checkIsFileOrDirectoryOrNull(String path, String option) {
+  if (path == null) return;
+  var stat = new File(path).statSync();
+  if (stat.type == FileSystemEntityType.NOT_FOUND) {
+    fail('$option not found: $path');
+  }
+}
+
+int getTotalSourceSize(List<String> files) {
+  int size = 0;
+  for (var filename in files) {
+    size += new File(filename).statSync().size;
+  }
+  return size;
+}
+
+bool get shouldReportMetrics => options['print-metrics'];
+
+void dumpString(String value, [String filename]) {
+  if (filename == null) {
+    print(value);
+  } else {
+    new File(filename).writeAsStringSync(value);
+  }
+}
+
+Map<Uri, Uri> parseCustomUriMappings(List<String> mappings) {
+  Map<Uri, Uri> customUriMappings = <Uri, Uri>{};
+
+  fatal(String mapping) {
+    fail('Invalid uri mapping "$mapping". Each mapping should have the '
+        'form "<scheme>:<name>::<uri>".');
+  }
+
+  // Each mapping has the form <uri>::<uri>.
+  for (var mapping in mappings) {
+    List<String> parts = mapping.split('::');
+    if (parts.length != 2) {
+      fatal(mapping);
+    }
+    Uri fromUri = Uri.parse(parts[0]);
+    if (fromUri.scheme == '' || fromUri.path.contains('/')) {
+      fatal(mapping);
+    }
+    Uri toUri = Uri.parse(parts[1]);
+    if (toUri.scheme == '') {
+      toUri = new Uri.file(path.absolute(parts[1]));
+    }
+    customUriMappings[fromUri] = toUri;
+  }
+
+  return customUriMappings;
+}
+
+/// Maintains state that should be shared between batched executions when
+/// running in batch mode (for testing purposes).
+///
+/// This reuses the analyzer's in-memory copy of the Dart SDK between runs.
+class BatchModeState {
+  bool isBatchMode = false;
+  DartLoaderBatch batch = new DartLoaderBatch();
+}
+
+main(List<String> args) async {
+  if (args.isNotEmpty && args[0] == '--batch') {
+    if (args.length != 1) {
+      return fail('--batch cannot be used with other arguments');
+    }
+    var batchModeState = new BatchModeState()..isBatchMode = true;
+    await runBatch((args) => batchMain(args, batchModeState));
+  } else {
+    CompilerOutcome outcome = await batchMain(args, new BatchModeState());
+    exit(outcome == CompilerOutcome.Ok ? 0 : 1);
+  }
+}
+
+bool isSupportedArgument(String arg) {
+  if (arg.startsWith('--')) {
+    int equals = arg.indexOf('=');
+    var name = equals != -1 ? arg.substring(2, equals) : arg.substring(2);
+    return parser.options.containsKey(name);
+  }
+  if (arg.startsWith('-')) {
+    return parser.findByAbbreviation(arg.substring(1)) != null;
+  }
+  return true;
+}
+
+Future<CompilerOutcome> batchMain(
+    List<String> args, BatchModeState batchModeState) async {
+  if (args.contains('--ignore-unrecognized-flags')) {
+    args = args.where(isSupportedArgument).toList();
+  }
+
+  if (args.isEmpty) {
+    return fail(getUsage());
+  }
+
+  try {
+    options = parser.parse(args);
+  } on FormatException catch (e) {
+    return fail(e.message); // Don't puke stack traces.
+  }
+
+  checkIsDirectoryOrNull(options['sdk'], 'Dart SDK');
+
+  String packagePath = options['packages'] ?? options['package-root'];
+  checkIsFileOrDirectoryOrNull(packagePath, 'Package root or .packages');
+
+  // Set up logging.
+  if (options['verbose']) {
+    log.onRecord.listen((LogRecord rec) {
+      stderr.writeln(rec.message);
+    });
+  }
+
+  if (options.rest.length != 1) {
+    return fail('Exactly one FILE should be given.');
+  }
+
+  var file = options.rest.single;
+
+  checkIsFile(file, option: 'Input file');
+
+  String format = options['format'] ?? defaultFormat();
+  String outputFile = options['out'] ?? defaultOutput();
+
+  List<String> urlMapping = options['url-mapping'] as List<String>;
+  var customUriMappings = parseCustomUriMappings(urlMapping);
+  var repository = new Repository();
+
+  Program program;
+
+  var watch = new Stopwatch()..start();
+  List<String> loadedFiles;
+  Function getLoadedFiles;
+  List errors = const [];
+  TargetFlags targetFlags = new TargetFlags(strongMode: options['strong']);
+  Target target = getTarget(options['target'], targetFlags);
+
+  var declaredVariables = <String, String>{};
+  declaredVariables.addAll(target.extraDeclaredVariables);
+  for (String define in options['D']) {
+    int separator = define.indexOf('=');
+    if (separator == -1) {
+      fail('Invalid define: -D$define. Format is -D<name>=<value>');
+    }
+    String name = define.substring(0, separator);
+    String value = define.substring(separator + 1);
+    declaredVariables[name] = value;
+  }
+
+  if (file.endsWith('.dill')) {
+    program = loadProgramFromBinary(file, repository);
+    getLoadedFiles = () => [file];
+  } else {
+    DartOptions dartOptions = new DartOptions(
+        strongMode: target.strongMode,
+        strongModeSdk: target.strongModeSdk,
+        sdk: options['sdk'],
+        packagePath: packagePath,
+        customUriMappings: customUriMappings,
+        declaredVariables: declaredVariables);
+    String packageDiscoveryPath = batchModeState.isBatchMode ? null : file;
+    DartLoader loader = await batchModeState.batch.getLoader(
+        repository, dartOptions,
+        packageDiscoveryPath: packageDiscoveryPath);
+    if (options['link']) {
+      program = loader.loadProgram(file, target: target);
+    } else {
+      var library = loader.loadLibrary(file);
+      assert(library == repository.getLibrary(file));
+      program = new Program(repository.libraries);
+    }
+    errors = loader.errors;
+    if (errors.isNotEmpty) {
+      const int errorLimit = 100;
+      stderr.writeln(errors.take(errorLimit).join('\n'));
+      if (errors.length > errorLimit) {
+        stderr
+            .writeln('[error] ${errors.length - errorLimit} errors not shown');
+      }
+    }
+    getLoadedFiles = () => loadedFiles ??= loader.getLoadedFileNames();
+  }
+
+  bool canContinueCompilation = errors.isEmpty || options['tolerant'];
+
+  int loadTime = watch.elapsedMilliseconds;
+  if (shouldReportMetrics) {
+    print('loader.time = $loadTime ms');
+  }
+
+  void runVerifier() {
+    if (options['verify-ir']) {
+      verifyProgram(program);
+    }
+  }
+
+  if (canContinueCompilation) {
+    runVerifier();
+  }
+
+  String outputDependencies = options['write-dependencies'];
+  if (outputDependencies != null) {
+    new File(outputDependencies).writeAsStringSync(getLoadedFiles().join('\n'));
+  }
+
+  // Apply target-specific transformations.
+  if (target != null && options['link'] && canContinueCompilation) {
+    target.transformProgram(program);
+    runVerifier();
+  }
+
+  if (options['no-output']) {
+    return CompilerOutcome.Ok;
+  }
+
+  watch.reset();
+
+  Future ioFuture;
+  if (canContinueCompilation) {
+    switch (format) {
+      case 'text':
+        writeProgramToText(program,
+            path: outputFile, showExternal: options['show-external']);
+        break;
+      case 'bin':
+        ioFuture = writeProgramToBinary(program, outputFile);
+        break;
+    }
+  }
+
+  int time = watch.elapsedMilliseconds;
+  if (shouldReportMetrics) {
+    print('writer.time = $time ms');
+  }
+
+  await ioFuture;
+
+  if (shouldReportMetrics) {
+    int flushTime = watch.elapsedMilliseconds - time;
+    print('writer.flush_time = $flushTime ms');
+  }
+
+  return errors.length > 0 ? CompilerOutcome.Fail : CompilerOutcome.Ok;
+}
diff --git a/pkg/kernel/bin/dump.dart b/pkg/kernel/bin/dump.dart
new file mode 100755
index 0000000..540142a
--- /dev/null
+++ b/pkg/kernel/bin/dump.dart
@@ -0,0 +1,11 @@
+#!/usr/bin/env dart
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:kernel/kernel.dart';
+
+main(args) {
+  var binary = loadProgramFromBinary(args[0]);
+  writeProgramToText(binary, path: args[1]);
+}
diff --git a/pkg/kernel/bin/transform.dart b/pkg/kernel/bin/transform.dart
new file mode 100755
index 0000000..680a760
--- /dev/null
+++ b/pkg/kernel/bin/transform.dart
@@ -0,0 +1,96 @@
+#!/usr/bin/env dart
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:args/args.dart';
+import 'package:kernel/verifier.dart';
+import 'package:kernel/kernel.dart';
+import 'package:kernel/transformations/continuation.dart' as cont;
+import 'package:kernel/transformations/infer_values.dart' as infer_values;
+import 'package:kernel/transformations/mixin_full_resolution.dart' as mix;
+import 'package:kernel/transformations/treeshaker.dart' as treeshaker;
+
+import 'batch_util.dart';
+
+ArgParser parser = new ArgParser()
+  ..addOption('format',
+      abbr: 'f',
+      allowed: ['text', 'bin'],
+      defaultsTo: 'bin',
+      help: 'Output format.')
+  ..addOption('out', abbr: 'o', help: 'Output file.', defaultsTo: null)
+  ..addFlag('verbose',
+      abbr: 'v',
+      negatable: false,
+      help: 'Be verbose (e.g. prints transformed main library).',
+      defaultsTo: false)
+  ..addOption('transformation',
+      abbr: 't',
+      help: 'The transformation to apply.',
+      defaultsTo: 'continuation');
+
+main(List<String> arguments) async {
+  if (arguments.isNotEmpty && arguments[0] == '--batch') {
+    if (arguments.length != 1) {
+      throw '--batch cannot be used with other arguments';
+    }
+    await runBatch((arguments) => runTransformation(arguments));
+  } else {
+    CompilerOutcome outcome = await runTransformation(arguments);
+    exit(outcome == CompilerOutcome.Ok ? 0 : 1);
+  }
+}
+
+Future<CompilerOutcome> runTransformation(List<String> arguments) async {
+  ArgResults options = parser.parse(arguments);
+
+  if (options.rest.length != 1) {
+    throw 'Usage:\n${parser.usage}';
+  }
+
+  var input = options.rest.first;
+  var output = options['out'];
+  var format = options['format'];
+  var verbose = options['verbose'];
+
+  if (output == null) {
+    output = '${input.substring(0, input.lastIndexOf('.'))}.transformed.dill';
+  }
+
+  var program = loadProgramFromBinary(input);
+  switch (options['transformation']) {
+    case 'continuation':
+      program = cont.transformProgram(program);
+      break;
+    case 'infervalues':
+      program = infer_values.transformProgram(program);
+      break;
+    case 'resolve-mixins':
+      program = mix.transformProgram(program);
+      break;
+    case 'treeshake':
+      program = treeshaker.transformProgram(program);
+      break;
+    default:
+      throw 'Unknown transformation';
+  }
+
+  verifyProgram(program);
+
+  if (format == 'text') {
+    writeProgramToText(program, path: output);
+  } else {
+    assert(format == 'bin');
+    await writeProgramToBinary(program, output);
+  }
+
+  if (verbose) {
+    writeLibraryToText(program.mainMethod.parent as Library);
+  }
+
+  return CompilerOutcome.Ok;
+}
diff --git a/pkg/kernel/binary.md b/pkg/kernel/binary.md
new file mode 100644
index 0000000..6f8a03a
--- /dev/null
+++ b/pkg/kernel/binary.md
@@ -0,0 +1,904 @@
+This file describes the binary format of Dart Kernel.
+
+Notation
+--------
+Bitmasks are described with the syntax:
+```scala
+    Byte flags (flag1, flag2, ..., flagN)
+```
+where 'flag<N>' is the N-th least significant bit,
+(so flag1 is the least significant bit).
+
+Bytes with tagging bits are described with the syntax:
+```scala
+    Byte byte (10xxxxxx)
+```
+where the x'es represent the bit positions to be extracted from the
+byte and the 0'es and 1'es the bits used for tagging.  The leftmost bit
+is the most significant.
+
+Binary format
+-------------
+```scala
+type Byte = a byte
+
+abstract type UInt {}
+
+type UInt7 extends UInt {
+  Byte byte1(0xxxxxxx);
+}
+
+type UInt14 extends UInt {
+  Byte byte1(10xxxxxx); // most significant byte, discard the high bit
+  Byte byte2(xxxxxxxx); // least signficant byte
+}
+
+type UInt30 extends UInt {
+  Byte byte1(11xxxxxx); // most significant byte, discard the two high bits.
+  Byte byte2(xxxxxxxx);
+  Byte byte3(xxxxxxxx);
+  Byte byte4(xxxxxxxx); // least significant byte
+}
+
+type MagicWord = big endian 32-bit unsigned integer
+
+type String {
+  UInt num_bytes;
+  Byte[num_bytes] utf8_bytes;
+}
+
+type StringTable {
+  UInt num_strings;
+  String[num_strings] strings;
+}
+
+type StringReference {
+  UInt index; // Index into the StringTable.
+}
+
+type LineStarts {
+  UInt lineCount;
+  // Delta encoded, e.g. 0, 10, 15, 7, 10 means 0, 10, 25, 32, 42.
+  UInt[lineCount] lineStarts;
+}
+
+type UriLineStarts {
+  StringTable uris;
+  LineStarts[uris.num_strings] lineStarts;
+}
+
+type UriReference {
+  UInt index; // Index into the URIs StringTable.
+}
+
+type FileOffset {
+  // Saved as number+1 to accommodate literal "-1".
+  UInt fileOffset;
+}
+
+type List<T> {
+  UInt length;
+  T[length] items;
+}
+
+type Option<T> {
+  Byte tag;
+}
+type Nothing extends Option<T> {
+  Byte tag = 0;
+}
+type Something<T> extends Option<T> {
+  Byte tag = 1;
+  T value;
+}
+
+type ProgramFile {
+  MagicWord magic = 0x90ABCDEF;
+  StringTable strings;
+  UriLineStarts lineStartsMap;
+  List<Library> library;
+  LibraryProcedureReference mainMethod;
+}
+
+type LibraryReference {
+  // For library files, this is an index into the import table.
+  // For program files, this is an index into the list of libaries.
+  UInt index;
+}
+
+abstract type ClassReference {}
+
+type NormalClassReference extends ClassReference {
+  Byte tag = 100;
+  LibraryReference library;
+  UInt classIndex;
+}
+
+type MixinClassReference extends ClassReference {
+  Byte tag = 101;
+  LibraryReference library;
+  UInt classIndex;
+}
+
+abstract type MemberReference {
+}
+
+type LibraryFieldReference extends MemberReference {
+  Byte tag = 102;
+  LibraryReference library;
+  UInt fieldIndex; // Index in list of fields.
+}
+
+type ClassFieldReference extends MemberReference {
+  Byte tag = 103;
+  ClassReference class;
+  UInt fieldIndex;
+}
+
+type ClassConstructorReference extends MemberReference {
+  Byte tag = 104;
+  ClassReference class;
+  UInt constructorIndex; // Index in list of constructors.
+}
+
+type LibraryProcedureReference extends MemberReference {
+  Byte tag = 105;
+  LibraryReference library;
+  UInt procedureIndex; // Index in list of procedures.
+}
+
+type ClassProcedureReference extends MemberReference {
+  Byte tag = 106;
+  ClassReference class;
+  UInt procedureIndex;
+}
+
+// Can be used as MemberReference or ClassReference *only* if indicated that
+// the given reference may be a NullReference.
+type NullReference extends MemberReference, ClassReference {
+  Byte tag = 99;
+}
+
+type Name {
+  StringReference name;
+  if name begins with '_' {
+    LibraryReference library;
+  }
+}
+
+type Library {
+  Byte flags (isExternal);
+  StringReference name;
+  // A URI with the dart, package, or file scheme.  For file URIs, the path
+  // is an absolute path to the .dart file from which the library was created.
+  StringReference importUri;
+  // An absolute path URI to the .dart file from which the library was created.
+  UriReference fileUri;
+  List<Class> classes;
+  List<Field> fields;
+  List<Procedure> procedures;
+}
+
+abstract type Node {
+  Byte tag;
+}
+
+// A class can be represented at one of three levels: type, hierarchy, or body.
+//
+// If the enclosing library is external, a class is either at type or
+// hierarchy level, depending on its isTypeLevel flag.
+// If the enclosing library is not external, a class is always at body level.
+//
+// See ClassLevel in ast.dart for the details of each loading level.
+
+abstract type Class extends Node {}
+
+type NormalClass extends Class {
+  Byte tag = 2;
+  Byte flags (isAbstract, isTypeLevel);
+  StringReference name;
+  // An absolute path URI to the .dart file from which the class was created.
+  UriReference fileUri;
+  List<Expression> annotations;
+  List<TypeParameter> typeParameters;
+  Option<InterfaceType> superClass;
+  List<InterfaceType> implementedClasses;
+  List<Field> fields;
+  List<Constructor> constructors;
+  List<Procedure> procedures;
+}
+
+type MixinClass extends Class {
+  Byte tag = 3;
+  Byte flags (isAbstract, isTypeLevel);
+  StringReference name;
+  // An absolute path URI to the .dart file from which the class was created.
+  UriReference fileUri;
+  List<Expression> annotations;
+  List<TypeParameter> typeParameters;
+  InterfaceType firstSuperClass;
+  InterfaceType secondSuperClass;
+  List<InterfaceType> implementedClasses;
+  List<Constructor> constructors;
+}
+
+abstract type Member extends Node {}
+
+type Field extends Member {
+  Byte tag = 4;
+  FileOffset fileOffset;
+  Byte flags (isFinal, isConst, isStatic);
+  Name name;
+  // An absolute path URI to the .dart file from which the field was created.
+  UriReference fileUri;
+  List<Expression> annotations;
+  DartType type;
+  Option<InferredValue> inferredValue;
+  Option<Expression> initializer;
+}
+
+type Constructor extends Member {
+  Byte tag = 5;
+  Byte flags (isConst, isExternal);
+  Name name;
+  List<Expression> annotations;
+  FunctionNode function;
+  List<Initializer> initializers;
+}
+
+/*
+enum ProcedureKind {
+  Method,
+  Getter,
+  Setter,
+  Operator,
+  Factory,
+}
+*/
+
+type Procedure extends Member {
+  Byte tag = 6;
+  Byte kind; // Index into the ProcedureKind enum above.
+  Byte flags (isStatic, isAbstract, isExternal, isConst);
+  Name name;
+  // An absolute path URI to the .dart file from which the class was created.
+  UriReference fileUri;
+  List<Expression> annotations;
+  // Can only be absent if abstract, but tag is there anyway.
+  Option<FunctionNode> function;
+}
+
+abstract type Initializer extends Node {}
+
+type InvalidInitializer extends Initializer {
+  Byte tag = 7;
+}
+
+type FieldInitializer extends Initializer {
+  Byte tag = 8;
+  FieldReference field;
+  Expression value;
+}
+
+type SuperInitializer extends Initializer {
+  Byte tag = 9;
+  ConstructorReference target;
+  Arguments arguments;
+}
+
+type RedirectingInitializer extends Initializer {
+  Byte tag = 10;
+  ConstructorReference target;
+  Arguments arguments;
+}
+
+type LocalInitializer extends Initializer {
+  Byte tag = 11;
+  VariableDeclaration variable;
+}
+
+/*
+enum AsyncMarker {
+  Sync,
+  SyncStar,
+  Async,
+  AsyncStar
+}
+*/
+
+type FunctionNode {
+  // Note: there is no tag on FunctionNode.
+  Byte asyncMarker; // Index into AsyncMarker above.
+  List<TypeParameter> typeParameters;
+  UInt requiredParameterCount;
+  List<VariableDeclaration> positionalParameters;
+  List<VariableDeclaration> namedParameters;
+  DartType returnType;
+  Option<InferredValue> inferredReturnValue;
+  Option<Statement> body;
+}
+
+type VariableReference {
+  // Reference to the Nth variable in scope, with 0 being the
+  // first variable declared in the outermost scope, and larger
+  // numbers being the variables declared later in a given scope,
+  // or in a more deeply nested scope.
+  //
+  // Function parameters are indexed from left to right and make
+  // up the outermost scope (enclosing the function body).
+  // Variables ARE NOT in scope inside their own initializer.
+  // Variables ARE NOT in scope before their declaration, in contrast
+  // to how the Dart Specification defines scoping.
+  // Variables ARE in scope across function boundaries.
+  //
+  // When declared, a variable remains in scope until the end of the
+  // immediately enclosing Block, Let, FunctionNode, ForStatement,
+  // ForInStatement, or Catch.
+  //
+  // A special exception is made for constructor parameters, which are
+  // also in scope in the initializer list, even though the tree nesting
+  // is inconsistent with the scoping.
+  UInt stackIndex;
+}
+
+abstract type Expression extends Node {}
+
+type InvalidExpression extends Expression {
+  Byte tag = 19;
+}
+
+type VariableGet extends Expression {
+  Byte tag = 20;
+  VariableReference variable;
+}
+
+type SpecializedVariableGet extends Expression {
+  Byte tag = 128 + N; // Where 0 <= N < 8.
+  // Equivalent to a VariableGet with index N.
+}
+
+type VariableSet extends Expression {
+  Byte tag = 21;
+  VariableReference variable;
+  Expression value;
+}
+
+type SpecializedVariableSet extends Expression {
+  Byte tag = 136 + N; // Where 0 <= N < 8.
+  Expression value;
+  // Equivalent to VariableSet with index N.
+}
+
+type PropertyGet extends Expression {
+  Byte tag = 22;
+  FileOffset fileOffset;
+  Expression receiver;
+  Name name;
+  MemberReference interfaceTarget; // May be NullReference.
+}
+
+type PropertySet extends Expression {
+  Byte tag = 23;
+  FileOffset fileOffset;
+  Expression receiver;
+  Name name;
+  Expression value;
+  MemberReference interfaceTarget; // May be NullReference.
+}
+
+type SuperPropertyGet extends Expression {
+  Byte tag = 24;
+  Name name;
+  MemberReference interfaceTarget; // May be NullReference.
+}
+
+type SuperPropertySet extends Expression {
+  Byte tag = 25;
+  Name name;
+  Expression value;
+  MemberReference interfaceTarget; // May be NullReference.
+}
+
+type DirectPropertyGet extends Expression {
+  Byte tag = 15; // Note: tag is out of order
+  Expression receiver;
+  MemberReference target;
+}
+
+type DirectPropertySet extends Expression {
+  Byte tag = 16; // Note: tag is out of order
+  Expression receiver;
+  MemberReference target;
+  Expression value;
+}
+
+type StaticGet extends Expression {
+  Byte tag = 26;
+  FileOffset fileOffset;
+  MemberReference target;
+}
+
+type StaticSet extends Expression {
+  Byte tag = 27;
+  MemberReference target;
+  Expression value;
+}
+
+type Arguments {
+  // Note: there is no tag on Arguments.
+  List<DartType> types;
+  List<Expression> positional;
+  List<NamedExpression> named;
+}
+
+type NamedExpression {
+  // Note: there is no tag on NamedExpression.
+  StringReference name;
+  Expression value;
+}
+
+type MethodInvocation extends Expression {
+  Byte tag = 28;
+  FileOffset fileOffset;
+  Expression receiver;
+  Name name;
+  Arguments arguments;
+  MemberReference interfaceTarget; // May be NullReference.
+}
+
+type SuperMethodInvocation extends Expression {
+  Byte tag = 29;
+  FileOffset fileOffset;
+  Name name;
+  Arguments arguments;
+  MemberReference interfaceTarget; // May be NullReference.
+}
+
+type DirectMethodInvocation extends Expression {
+  Byte tag = 17; // Note: tag is out of order
+  Expression receiver;
+  MemberReference target;
+  Arguments arguments;
+}
+
+type StaticInvocation extends Expression {
+  Byte tag = 30;
+  FileOffset fileOffset;
+  MemberReference target;
+  Arguments arguments;
+}
+
+// Constant call to an external constant factory.
+type ConstStaticInvocation extends Expression {
+  Byte tag = 18; // Note: tag is out of order.
+  FileOffset fileOffset;
+  MemberReference target;
+  Arguments arguments;
+}
+
+type ConstructorInvocation extends Expression {
+  Byte tag = 31;
+  FileOffset fileOffset;
+  ConstructorReference target;
+  Arguments arguments;
+}
+
+type ConstConstructorInvocation extends Expression {
+  Byte tag = 32;
+  FileOffset fileOffset;
+  ConstructorReference target;
+  Arguments arguments;
+}
+
+type Not extends Expression {
+  Byte tag = 33;
+  Expression operand;
+}
+
+/*
+ enum LogicalOperator { &&, || }
+*/
+
+type LogicalExpression extends Expression {
+  Byte tag = 34;
+  Expression left;
+  Byte operator; // Index into LogicalOperator enum above
+  Expression right;
+  Option<DartType> staticType;
+}
+
+type ConditionalExpression extends Expression {
+  Byte tag = 35;
+  Expression condition;
+  Expression then;
+  Expression otherwise;
+  Option<DartType> staticType;
+}
+
+type StringConcatenation extends Expression {
+  Byte tag = 36;
+  List<Expression> expressions;
+}
+
+type IsExpression extends Expression {
+  Byte tag = 37;
+  Expression operand;
+  DartType type;
+}
+
+type AsExpression extends Expression {
+  Byte tag = 38;
+  Expression operand;
+  DartType type;
+}
+
+type StringLiteral extends Expression {
+  Byte tag = 39;
+  StringReference value;
+}
+
+type SpecializedIntLiteral extends Expression {
+  Byte tag = 144 + N; // Where 0 <= N < 8.
+  // Integer literal with value (N - 3), that is, an integer in range -3..4.
+}
+
+type PositiveIntLiteral extends Expression {
+  Byte tag = 55;
+  UInt value;
+}
+
+type NegativeIntLiteral extends Expression {
+  Byte tag = 56;
+  UInt absoluteValue;
+}
+
+type BigIntLiteral extends Expression {
+  Byte tag = 57;
+  StringReference valueString;
+}
+
+type DoubleLiteral extends Expression {
+  Byte tag = 40;
+  StringReference valueString;
+}
+
+type TrueLiteral extends Expression {
+  Byte tag = 41;
+}
+
+type FalseLiteral extends Expression {
+  Byte tag = 42;
+}
+
+type NullLiteral extends Expression {
+  Byte tag = 43;
+}
+
+type SymbolLiteral extends Expression {
+  Byte tag = 44;
+  StringReference value; // Everything strictly after the '#'.
+}
+
+type TypeLiteral extends Expression {
+  Byte tag = 45;
+  DartType type;
+}
+
+type ThisExpression extends Expression {
+  Byte tag = 46;
+}
+
+type Rethrow extends Expression {
+  Byte tag = 47;
+}
+
+type Throw extends Expression {
+  Byte tag = 48;
+  FileOffset fileOffset;
+  Expression value;
+}
+
+type ListLiteral extends Expression {
+  Byte tag = 49;
+  DartType typeArgument;
+  List<Expression> values;
+}
+
+type ConstListLiteral extends Expression {
+  Byte tag = 58; // Note: tag is out of order.
+  DartType typeArgument;
+  List<Expression> values;
+}
+
+type MapLiteral extends Expression {
+  Byte tag = 50;
+  DartType keyType;
+  DartType valueType;
+  List<MapEntry> entries;
+}
+
+type ConstMapLiteral extends Expression {
+  Byte tag = 59; // Note: tag is out of order.
+  DartType keyType;
+  DartType valueType;
+  List<MapEntry> entries;
+}
+
+type MapEntry {
+  // Note: there is no tag on MapEntry
+  Expression key;
+  Expression value;
+}
+
+type AwaitExpression extends Expression {
+  Byte tag = 51;
+  Expression operand;
+}
+
+type FunctionExpression extends Expression {
+  Byte tag = 52;
+  FunctionNode function;
+}
+
+type Let extends Expression {
+  Byte tag = 53;
+  VariableDeclaration variable;
+  Expression body;
+}
+
+abstract type Statement extends Node {}
+
+type InvalidStatement extends Statement {
+  Byte tag = 60;
+}
+
+type ExpressionStatement extends Statement {
+  Byte tag = 61;
+  Expression expression;
+}
+
+type Block extends Statement {
+  Byte tag = 62;
+  List<Expression> expressions;
+}
+
+type EmptyStatement extends Statement {
+  Byte tag = 63;
+}
+
+type AssertStatement extends Statement {
+  Byte tag = 64;
+  Expression condition;
+  Option<Expression> message;
+}
+
+type LabeledStatement extends Statement {
+  Byte tag = 65;
+  Statement body;
+}
+
+type BreakStatement extends Statement {
+  Byte tag = 66;
+
+  // Reference to the Nth LabeledStatement in scope, with 0 being the
+  // outermost enclosing labeled statement within the same FunctionNode.
+  //
+  // Labels are not in scope across function boundaries.
+  UInt labelIndex;
+}
+
+type WhileStatement extends Statement {
+  Byte tag = 67;
+  Expression condition;
+  Statement body;
+}
+
+type DoStatement extends Statement {
+  Byte tag = 68;
+  Statement body;
+  Expression condition;
+}
+
+type ForStatement extends Statement {
+  Byte tag = 69;
+  List<VariableDeclaration> variables;
+  Option<Expression> condition;
+  List<Expression> updates;
+  Statement body;
+}
+
+type ForInStatement extends Statement {
+  Byte tag = 70;
+  VariableDeclaration variable;
+  Expression iterable;
+  Statement body;
+}
+
+type AsyncForInStatement extends Statement {
+  Byte tag = 80; // Note: tag is out of order.
+  VariableDeclaration variable;
+  Expression iterable;
+  Statement body;
+}
+
+type SwitchStatement extends Statement {
+  Byte tag = 71;
+  Expression expression;
+  List<SwitchCase> cases;
+}
+
+type SwitchCase {
+  // Note: there is no tag on SwitchCase
+  List<Expression> expressions;
+  Byte isDefault; // 1 if default, 0 is not default.
+  Statement body;
+}
+
+type ContinueSwitchStatement extends Statement {
+  Byte tag = 72;
+
+  // Reference to the Nth SwitchCase in scope.
+  //
+  // A SwitchCase is in scope everywhere within its enclosing switch,
+  // except the scope is delimited by FunctionNodes.
+  //
+  // Switches are ordered from outermost to innermost, and the SwitchCases
+  // within a switch are consecutively indexed from first to last, so index
+  // 0 is the first SwitchCase of the outermost enclosing switch in the
+  // same FunctionNode.
+  UInt caseIndex;
+}
+
+type IfStatement extends Statement {
+  Byte tag = 73;
+  Expression condition;
+  Statement then;
+  Statement otherwise; // Empty statement if there was no else part.
+}
+
+type ReturnStatement extends Statement {
+  Byte tag = 74;
+  Option<Expression> expression;
+}
+
+type TryCatch extends Statement {
+  Byte tag = 75;
+  Statement body;
+  List<Catch> catches;
+}
+
+type Catch {
+  DartType guard;
+  Option<VariableDeclaration> exception;
+  Option<VariableDeclaration> stackTrace;
+  Statement body;
+}
+
+type TryFinally extends Statement {
+  Byte tag = 76;
+  Statement body;
+  Statement finalizer;
+}
+
+type YieldStatement extends Statement {
+  Byte tag = 77;
+  Byte flags (isYieldStar);
+  Expression expression;
+}
+
+type VariableDeclarationStatement extends Statement {
+  Byte tag = 78;
+  VariableDeclaration variable;
+}
+
+type VariableDeclaration {
+  Byte flags (isFinal, isConst);
+  // For named parameters, this is the parameter name.
+  // For other variables, the name is cosmetic, may be empty,
+  // and is not necessarily unique.
+  StringReference name;
+  DartType type;
+  Option<InferredValue> inferredValue;
+
+  // For statements and for-loops, this is the initial value.
+  // For optional parameters, this is the default value (if given).
+  // In all other contexts, it must be Nothing.
+  Option<Expression> initializer;
+}
+
+type FunctionDeclaration extends Statement {
+  Byte tag = 79;
+  // The variable binding the function.  The variable is in scope
+  // within the function for use as a self-reference.
+  // Some of the fields in the variable are redundant, but its presence here
+  // simplifies the rule for variable indexing.
+  VariableDeclaration variable;
+  FunctionNode function;
+}
+
+abstract type DartType extends Node {}
+
+type InvalidType extends DartType {
+  Byte tag = 90;
+}
+
+type DynamicType extends DartType {
+  Byte tag = 91;
+}
+
+type VoidType extends DartType {
+  Byte tag = 92;
+}
+
+type InterfaceType extends DartType {
+  Byte tag = 93;
+  ClassReference class;
+  List<DartType> typeArguments;
+}
+
+type SimpleInterfaceType extends DartType {
+  Byte tag = 96; // Note: tag is out of order.
+  ClassReference class;
+  // Equivalent to InterfaceType with empty list of type arguments.
+}
+
+type FunctionType extends DartType {
+  Byte tag = 94;
+  List<TypeParameter> typeParameters;
+  UInt requiredParameterCount;
+  List<DartType> positionalParameters;
+  List<NamedDartType> namedParameters;
+  DartType returnType;
+}
+
+type SimpleFunctionType extends DartType {
+  Byte tag = 97; // Note: tag is out of order.
+  List<DartType> positionalParameters;
+  DartType returnType;
+  // Equivalent to a FunctionType with no type parameters or named parameters,
+  // and where all positional parameters are required.
+}
+
+type NamedDartType {
+  StringReference name;
+  DartType type;
+}
+
+type TypeParameterType extends DartType {
+  Byte tag = 95;
+
+  // Reference to the Nth type parameter in scope (with some caveats about
+  // type parameter bounds).
+  //
+  // As with the other indexing schemes, outermost nodes have lower
+  // indices, and a type parameter list is consecutively indexed from
+  // left to right.
+  //
+  // In the case of type parameter bounds, this indexing diverges slightly
+  // from the definition of scoping, since type parameter N+1 is not "in scope"
+  // in the bound of type parameter N, but it takes up an index as if it was in
+  // scope there.
+  //
+  // The type parameter can be bound by a Class, FunctionNode, or FunctionType.
+  //
+  // Note that constructors currently do not declare type parameters.  Uses of
+  // the class type parameters in a constructor refer to those declared on the
+  // class.
+  UInt index;
+}
+
+type TypeParameter {
+  // Note: there is no tag on TypeParameter
+  StringReference name; // Cosmetic, may be empty, not unique.
+  DartType bound; // 'dynamic' if no explicit bound was given.
+}
+
+/* enum BaseClassKind { None, Exact, Subclass, Subtype, } */
+
+type InferredValue {
+  ClassReference baseClass; // May be NullReference if kind = None.
+  Byte kind; // Index into BaseClassKind.
+  Byte valueBits; // See lib/type_propagation/type_propagation.dart
+}
+
+```
diff --git a/pkg/kernel/codereview.settings b/pkg/kernel/codereview.settings
new file mode 100644
index 0000000..d777626
--- /dev/null
+++ b/pkg/kernel/codereview.settings
@@ -0,0 +1,7 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+CODE_REVIEW_SERVER: http://codereview.chromium.org
+VIEW_VC: https://github.com/dart-lang/kernel/commit/
+PROJECT: Dart Kernel
+CC_LIST: dart-kernel+reviews@google.com
diff --git a/pkg/kernel/lib/analyzer/analyzer.dart b/pkg/kernel/lib/analyzer/analyzer.dart
new file mode 100644
index 0000000..4ae4a67
--- /dev/null
+++ b/pkg/kernel/lib/analyzer/analyzer.dart
@@ -0,0 +1,13 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+/// A library that re-exports the analyzer's program representation parts.
+library kernel.analyzer.frontend;
+
+export 'package:analyzer/dart/ast/visitor.dart';
+export 'package:analyzer/dart/ast/ast.dart';
+export 'package:analyzer/dart/element/element.dart';
+export 'package:analyzer/dart/element/type.dart';
+export 'package:analyzer/src/generated/utilities_dart.dart' show ParameterKind;
+export 'package:analyzer/src/dart/element/member.dart' show Member;
+export 'package:analyzer/dart/ast/token.dart' show Token;
diff --git a/pkg/kernel/lib/analyzer/ast_from_analyzer.dart b/pkg/kernel/lib/analyzer/ast_from_analyzer.dart
new file mode 100644
index 0000000..9847b59
--- /dev/null
+++ b/pkg/kernel/lib/analyzer/ast_from_analyzer.dart
@@ -0,0 +1,2806 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.analyzer.ast_from_analyzer;
+
+import '../ast.dart' as ast;
+import '../frontend/accessors.dart';
+import '../frontend/super_initializers.dart';
+import '../log.dart';
+import '../type_algebra.dart';
+import '../transformations/flags.dart';
+import 'analyzer.dart';
+import 'loader.dart';
+import 'package:analyzer/analyzer.dart';
+import 'package:analyzer/src/generated/parser.dart';
+import 'package:analyzer/src/dart/element/member.dart';
+import 'package:analyzer/src/error/codes.dart';
+
+/// Provides reference-level access to libraries, classes, and members.
+///
+/// "Reference level" objects are incomplete nodes that have no children but
+/// can be used for linking until the loader promotes the node to a higher
+/// loading level.
+///
+/// The [ReferenceScope] is the most restrictive scope in a hierarchy of scopes
+/// that provide increasing amounts of contextual information.  [TypeScope] is
+/// used when type parameters might be in scope, and [MemberScope] is used when
+/// building the body of a [ast.Member].
+class ReferenceScope {
+  final ReferenceLevelLoader loader;
+
+  ReferenceScope(this.loader);
+
+  bool get strongMode => loader.strongMode;
+
+  ast.Library getLibraryReference(LibraryElement element) {
+    if (element == null) return null;
+    return loader.getLibraryReference(getBaseElement(element));
+  }
+
+  ast.Class getRootClassReference() {
+    return loader.getRootClassReference();
+  }
+
+  ast.Class getClassReference(ClassElement element) {
+    return loader.getClassReference(getBaseElement(element));
+  }
+
+  ast.Member getMemberReference(Element element) {
+    return loader.getMemberReference(getBaseElement(element));
+  }
+
+  static Element getBaseElement(Element element) {
+    while (element is Member) {
+      element = (element as Member).baseElement;
+    }
+    return element;
+  }
+
+  static bool supportsConcreteGet(Element element) {
+    return (element is PropertyAccessorElement &&
+            element.isGetter &&
+            !element.isAbstract) ||
+        element is FieldElement ||
+        element is TopLevelVariableElement ||
+        element is MethodElement && !element.isAbstract ||
+        isTopLevelFunction(element);
+  }
+
+  static bool supportsInterfaceGet(Element element) {
+    return (element is PropertyAccessorElement && element.isGetter) ||
+        element is FieldElement ||
+        element is MethodElement;
+  }
+
+  static bool supportsConcreteSet(Element element) {
+    return (element is PropertyAccessorElement &&
+            element.isSetter &&
+            !element.isAbstract) ||
+        element is FieldElement && !element.isFinal && !element.isConst ||
+        element is TopLevelVariableElement &&
+            !element.isFinal &&
+            !element.isConst;
+  }
+
+  static bool supportsInterfaceSet(Element element) {
+    return (element is PropertyAccessorElement && element.isSetter) ||
+        element is FieldElement && !element.isFinal && !element.isConst;
+  }
+
+  static bool supportsConcreteIndexGet(Element element) {
+    return element is MethodElement &&
+        element.name == '[]' &&
+        !element.isAbstract;
+  }
+
+  static bool supportsInterfaceIndexGet(Element element) {
+    return element is MethodElement && element.name == '[]';
+  }
+
+  static bool supportsConcreteIndexSet(Element element) {
+    return element is MethodElement &&
+        element.name == '[]=' &&
+        !element.isAbstract;
+  }
+
+  static bool supportsInterfaceIndexSet(Element element) {
+    return element is MethodElement && element.name == '[]=';
+  }
+
+  static bool supportsConcreteMethodCall(Element element) {
+    // Note that local functions are not valid targets for method calls because
+    // they are not "methods" or even "procedures" in our AST.
+    return element is MethodElement && !element.isAbstract ||
+        isTopLevelFunction(element) ||
+        element is ConstructorElement && element.isFactory;
+  }
+
+  static bool supportsInterfaceMethodCall(Element element) {
+    return element is MethodElement;
+  }
+
+  static bool supportsConstructorCall(Element element) {
+    return element is ConstructorElement && !element.isFactory;
+  }
+
+  ast.Member _resolveGet(
+      Element element, Element auxiliary, bool predicate(Element element)) {
+    element = desynthesizeGetter(element);
+    if (predicate(element)) return getMemberReference(element);
+    if (element is PropertyAccessorElement && element.isSetter) {
+      // The getter is sometimes stored as the 'corresponding getter' instead
+      // of the 'auxiliary' element.
+      auxiliary ??= element.correspondingGetter;
+    }
+    auxiliary = desynthesizeGetter(auxiliary);
+    if (predicate(auxiliary)) return getMemberReference(auxiliary);
+    return null;
+  }
+
+  ast.Member resolveConcreteGet(Element element, Element auxiliary) {
+    return _resolveGet(element, auxiliary, supportsConcreteGet);
+  }
+
+  ast.Member resolveInterfaceGet(Element element, Element auxiliary) {
+    if (!strongMode) return null;
+    return _resolveGet(element, auxiliary, supportsInterfaceGet);
+  }
+
+  DartType getterTypeOfElement(Element element) {
+    if (element is VariableElement) {
+      return element.type;
+    } else if (element is PropertyAccessorElement && element.isGetter) {
+      return element.returnType;
+    } else {
+      return null;
+    }
+  }
+
+  /// Returns the interface target of a `call` dispatch to the given member.
+  ///
+  /// For example, if the member is a field of type C, the target will be the
+  /// `call` method of class C, if it has such a method.
+  ///
+  /// If the class C has a getter or field named `call`, this method returns
+  /// `null` - the static type system does support typed calls with indirection.
+  ast.Member resolveInterfaceFunctionCall(Element element) {
+    if (!strongMode || element == null) return null;
+    return resolveInterfaceFunctionCallOnType(getterTypeOfElement(element));
+  }
+
+  /// Returns the `call` method of [callee], if it has one, otherwise `null`.
+  ast.Member resolveInterfaceFunctionCallOnType(DartType callee) {
+    return callee is InterfaceType
+        ? resolveInterfaceMethod(callee.getMethod('call'))
+        : null;
+  }
+
+  ast.Member _resolveSet(
+      Element element, Element auxiliary, bool predicate(Element element)) {
+    element = desynthesizeSetter(element);
+    if (predicate(element)) {
+      return getMemberReference(element);
+    }
+    if (element is PropertyAccessorElement && element.isSetter) {
+      // The setter is sometimes stored as the 'corresponding setter' instead
+      // of the 'auxiliary' element.
+      auxiliary ??= element.correspondingGetter;
+    }
+    auxiliary = desynthesizeSetter(auxiliary);
+    if (predicate(auxiliary)) {
+      return getMemberReference(auxiliary);
+    }
+    return null;
+  }
+
+  ast.Member resolveConcreteSet(Element element, Element auxiliary) {
+    return _resolveSet(element, auxiliary, supportsConcreteSet);
+  }
+
+  ast.Member resolveInterfaceSet(Element element, Element auxiliary) {
+    if (!strongMode) return null;
+    return _resolveSet(element, auxiliary, supportsInterfaceSet);
+  }
+
+  ast.Member resolveConcreteIndexGet(Element element, Element auxiliary) {
+    if (supportsConcreteIndexGet(element)) {
+      return getMemberReference(element);
+    }
+    if (supportsConcreteIndexGet(auxiliary)) {
+      return getMemberReference(auxiliary);
+    }
+    return null;
+  }
+
+  ast.Member resolveInterfaceIndexGet(Element element, Element auxiliary) {
+    if (!strongMode) return null;
+    if (supportsInterfaceIndexGet(element)) {
+      return getMemberReference(element);
+    }
+    if (supportsInterfaceIndexGet(auxiliary)) {
+      return getMemberReference(auxiliary);
+    }
+    return null;
+  }
+
+  ast.Member resolveConcreteIndexSet(Element element, Element auxiliary) {
+    if (supportsConcreteIndexSet(element)) {
+      return getMemberReference(element);
+    }
+    if (supportsConcreteIndexSet(auxiliary)) {
+      return getMemberReference(auxiliary);
+    }
+    return null;
+  }
+
+  ast.Member resolveInterfaceIndexSet(Element element, Element auxiliary) {
+    if (!strongMode) return null;
+    if (supportsInterfaceIndexSet(element)) {
+      return getMemberReference(element);
+    }
+    if (supportsInterfaceIndexSet(auxiliary)) {
+      return getMemberReference(auxiliary);
+    }
+    return null;
+  }
+
+  ast.Member resolveConcreteMethod(Element element) {
+    if (supportsConcreteMethodCall(element)) {
+      return getMemberReference(element);
+    }
+    return null;
+  }
+
+  ast.Member resolveInterfaceMethod(Element element) {
+    if (!strongMode) return null;
+    if (supportsInterfaceMethodCall(element)) {
+      return getMemberReference(element);
+    }
+    return null;
+  }
+
+  ast.Constructor resolveConstructor(Element element) {
+    if (supportsConstructorCall(element)) {
+      return getMemberReference(element);
+    }
+    return null;
+  }
+
+  ast.Field resolveField(Element element) {
+    if (element is FieldElement && !element.isSynthetic) {
+      return getMemberReference(element);
+    }
+    return null;
+  }
+
+  /// A static accessor that generates a 'throw NoSuchMethodError' when a
+  /// read or write access could not be resolved.
+  Accessor staticAccess(String name, Element element, [Element auxiliary]) {
+    return new _StaticAccessor(
+        this,
+        name,
+        resolveConcreteGet(element, auxiliary),
+        resolveConcreteSet(element, auxiliary));
+  }
+
+  /// An accessor that generates a 'throw NoSuchMethodError' on both read
+  /// and write access.
+  Accessor unresolvedAccess(String name) {
+    return new _StaticAccessor(this, name, null, null);
+  }
+}
+
+class TypeScope extends ReferenceScope {
+  final Map<TypeParameterElement, ast.TypeParameter> localTypeParameters =
+      <TypeParameterElement, ast.TypeParameter>{};
+
+  TypeScope(ReferenceLevelLoader loader) : super(loader);
+
+  String get location => '?';
+
+  bool get allowClassTypeParameters => false;
+
+  ast.DartType get defaultTypeParameterBound => getRootClassReference().rawType;
+
+  ast.TypeParameter getTypeParameterReference(TypeParameterElement element) {
+    return localTypeParameters[element] ??
+        loader.tryGetClassTypeParameter(element) ??
+        (localTypeParameters[element] = new ast.TypeParameter(element.name));
+  }
+
+  ast.TypeParameter makeTypeParameter(TypeParameterElement element,
+      {ast.DartType bound}) {
+    var typeParameter = getTypeParameterReference(element);
+    assert(bound != null);
+    typeParameter.bound = bound;
+    return typeParameter;
+  }
+
+  ast.DartType buildType(DartType type) {
+    return new TypeAnnotationBuilder(this).buildFromDartType(type);
+  }
+
+  ast.Supertype buildSupertype(DartType type) {
+    if (type is InterfaceType) {
+      var classElement = type.element;
+      if (classElement == null) return getRootClassReference().asRawSupertype;
+      var classNode = getClassReference(classElement);
+      if (classNode.typeParameters.isEmpty ||
+          classNode.typeParameters.length != type.typeArguments.length) {
+        return classNode.asRawSupertype;
+      } else {
+        return new ast.Supertype(classNode,
+            type.typeArguments.map(buildType).toList(growable: false));
+      }
+    }
+    return getRootClassReference().asRawSupertype;
+  }
+
+  ast.DartType buildTypeAnnotation(AstNode node) {
+    return new TypeAnnotationBuilder(this).build(node);
+  }
+
+  ast.DartType buildOptionalTypeAnnotation(AstNode node) {
+    return node == null ? null : new TypeAnnotationBuilder(this).build(node);
+  }
+
+  ast.DartType getInferredType(Expression node) {
+    if (!strongMode) return const ast.DynamicType();
+    // TODO: Is this official way to get the strong-mode inferred type?
+    return buildType(node.staticType);
+  }
+
+  ast.DartType getInferredTypeArgument(Expression node, int index) {
+    var type = getInferredType(node);
+    return type is ast.InterfaceType && index < type.typeArguments.length
+        ? type.typeArguments[index]
+        : const ast.DynamicType();
+  }
+
+  ast.DartType getInferredReturnType(Expression node) {
+    var type = getInferredType(node);
+    return type is ast.FunctionType ? type.returnType : const ast.DynamicType();
+  }
+
+  List<ast.DartType> getInferredInvocationTypeArguments(
+      InvocationExpression node) {
+    if (!strongMode) return <ast.DartType>[];
+    ast.DartType inferredFunctionType = buildType(node.staticInvokeType);
+    ast.DartType genericFunctionType = buildType(node.function.staticType);
+    if (genericFunctionType is ast.FunctionType) {
+      if (genericFunctionType.typeParameters.isEmpty) return <ast.DartType>[];
+      // Attempt to unify the two types to obtain a substitution of the type
+      // variables.  If successful, use the substituted types in the order
+      // they occur in the type parameter list.
+      var substitution = unifyTypes(genericFunctionType.withoutTypeParameters,
+          inferredFunctionType, genericFunctionType.typeParameters.toSet());
+      if (substitution != null) {
+        return genericFunctionType.typeParameters
+            .map((p) => substitution[p] ?? const ast.DynamicType())
+            .toList();
+      }
+      return new List<ast.DartType>.filled(
+          genericFunctionType.typeParameters.length, const ast.DynamicType());
+    } else {
+      return <ast.DartType>[];
+    }
+  }
+
+  List<ast.DartType> buildOptionalTypeArgumentList(TypeArgumentList node) {
+    if (node == null) return null;
+    return new TypeAnnotationBuilder(this).buildList(node.arguments);
+  }
+
+  List<ast.DartType> buildTypeArgumentList(TypeArgumentList node) {
+    return new TypeAnnotationBuilder(this).buildList(node.arguments);
+  }
+
+  List<ast.TypeParameter> buildOptionalTypeParameterList(
+      TypeParameterList node) {
+    if (node == null) return <ast.TypeParameter>[];
+    return node.typeParameters.map(buildTypeParameter).toList();
+  }
+
+  ast.TypeParameter buildTypeParameter(TypeParameter node) {
+    return makeTypeParameter(node.element,
+        bound: buildOptionalTypeAnnotation(node.bound) ??
+            defaultTypeParameterBound);
+  }
+
+  ConstructorElement findDefaultConstructor(ClassElement class_) {
+    for (var constructor in class_.constructors) {
+      // Note: isDefaultConstructor checks if the constructor is suitable for
+      // being invoked without arguments.  It does not imply that it is
+      // synthetic.
+      if (constructor.isDefaultConstructor && !constructor.isFactory) {
+        return constructor;
+      }
+    }
+    return null;
+  }
+
+  ast.FunctionNode buildFunctionInterface(FunctionTypedElement element) {
+    var positional = <ast.VariableDeclaration>[];
+    var named = <ast.VariableDeclaration>[];
+    int requiredParameterCount = 0;
+    // Initialize type parameters in two passes: put them into scope,
+    // and compute the bounds afterwards while they are all in scope.
+    var typeParameters = <ast.TypeParameter>[];
+    for (var parameter in element.typeParameters) {
+      var parameterNode = new ast.TypeParameter(parameter.name);
+      typeParameters.add(parameterNode);
+      localTypeParameters[parameter] = parameterNode;
+    }
+    for (int i = 0; i < typeParameters.length; ++i) {
+      var parameter = element.typeParameters[i];
+      var parameterNode = typeParameters[i];
+      parameterNode.bound = parameter.bound == null
+          ? defaultTypeParameterBound
+          : buildType(parameter.bound);
+    }
+    for (var parameter in element.parameters) {
+      var parameterNode = new ast.VariableDeclaration(parameter.name,
+          type: buildType(parameter.type));
+      switch (parameter.parameterKind) {
+        case ParameterKind.REQUIRED:
+          positional.add(parameterNode);
+          ++requiredParameterCount;
+          break;
+
+        case ParameterKind.POSITIONAL:
+          positional.add(parameterNode);
+          break;
+
+        case ParameterKind.NAMED:
+          named.add(parameterNode);
+          break;
+      }
+    }
+    var returnType = element is ConstructorElement
+        ? const ast.VoidType()
+        : buildType(element.returnType);
+    return new ast.FunctionNode(null,
+        typeParameters: typeParameters,
+        positionalParameters: positional,
+        namedParameters: named,
+        requiredParameterCount: requiredParameterCount,
+        returnType: returnType);
+  }
+}
+
+class ExpressionScope extends TypeScope {
+  ast.Library currentLibrary;
+  final Map<LocalElement, ast.VariableDeclaration> localVariables =
+      <LocalElement, ast.VariableDeclaration>{};
+
+  ExpressionBuilder _expressionBuilder;
+  StatementBuilder _statementBuilder;
+
+  ExpressionScope(ReferenceLevelLoader loader, this.currentLibrary)
+      : super(loader) {
+    assert(currentLibrary != null);
+    _expressionBuilder = new ExpressionBuilder(this);
+    _statementBuilder = new StatementBuilder(this);
+  }
+
+  bool get allowThis => false; // Overridden by MemberScope.
+
+  ast.Name buildName(SimpleIdentifier node) {
+    return new ast.Name(node.name, currentLibrary);
+  }
+
+  ast.Statement buildStatement(Statement node) {
+    return _statementBuilder.build(node);
+  }
+
+  ast.Statement buildOptionalFunctionBody(FunctionBody body) {
+    if (body == null ||
+        body is EmptyFunctionBody ||
+        body is NativeFunctionBody) {
+      return null;
+    }
+    return buildMandatoryFunctionBody(body);
+  }
+
+  ast.Statement buildMandatoryFunctionBody(FunctionBody body) {
+    try {
+      if (body is BlockFunctionBody) {
+        return buildStatement(body.block);
+      } else if (body is ExpressionFunctionBody) {
+        if (bodyHasVoidReturn(body)) {
+          return new ast.ExpressionStatement(buildExpression(body.expression));
+        } else {
+          return new ast.ReturnStatement(buildExpression(body.expression));
+        }
+      } else {
+        return internalError('Missing function body');
+      }
+    } on _CompilationError catch (e) {
+      return new ast.ExpressionStatement(buildThrowCompileTimeError(e.message));
+    }
+  }
+
+  ast.AsyncMarker getAsyncMarker({bool isAsync: false, bool isStar: false}) {
+    return ast.AsyncMarker.values[(isAsync ? 2 : 0) + (isStar ? 1 : 0)];
+  }
+
+  ast.FunctionNode buildFunctionNode(
+      FormalParameterList formalParameters, FunctionBody body,
+      {TypeName returnType,
+      List<ast.TypeParameter> typeParameters,
+      ast.DartType inferredReturnType}) {
+    // TODO(asgerf): This will in many cases rebuild the interface built by
+    //   TypeScope.buildFunctionInterface.
+    var positional = <ast.VariableDeclaration>[];
+    var named = <ast.VariableDeclaration>[];
+    int requiredParameterCount = 0;
+    var formals = formalParameters?.parameters ?? const <FormalParameter>[];
+    for (var parameter in formals) {
+      var declaration = makeVariableDeclaration(parameter.element,
+          initializer: parameter is DefaultFormalParameter
+              ? buildOptionalTopLevelExpression(parameter.defaultValue)
+              : null,
+          type: buildType(parameter.element.type));
+      switch (parameter.kind) {
+        case ParameterKind.REQUIRED:
+          positional.add(declaration);
+          ++requiredParameterCount;
+          declaration.initializer = null;
+          break;
+
+        case ParameterKind.POSITIONAL:
+          positional.add(declaration);
+          break;
+
+        case ParameterKind.NAMED:
+          named.add(declaration);
+          break;
+      }
+    }
+    return new ast.FunctionNode(buildOptionalFunctionBody(body),
+        typeParameters: typeParameters,
+        positionalParameters: positional,
+        namedParameters: named,
+        requiredParameterCount: requiredParameterCount,
+        returnType: buildOptionalTypeAnnotation(returnType) ??
+            inferredReturnType ??
+            const ast.DynamicType(),
+        asyncMarker: getAsyncMarker(
+            isAsync: body.isAsynchronous, isStar: body.isGenerator));
+  }
+
+  ast.Expression buildOptionalTopLevelExpression(Expression node) {
+    return node == null ? null : buildTopLevelExpression(node);
+  }
+
+  ast.Expression buildTopLevelExpression(Expression node) {
+    try {
+      return _expressionBuilder.build(node);
+    } on _CompilationError catch (e) {
+      return buildThrowCompileTimeError(e.message);
+    }
+  }
+
+  ast.Expression buildExpression(Expression node) {
+    return _expressionBuilder.build(node);
+  }
+
+  ast.Expression buildOptionalExpression(Expression node) {
+    return node == null ? null : _expressionBuilder.build(node);
+  }
+
+  Accessor buildLeftHandValue(Expression node) {
+    return _expressionBuilder.buildLeftHandValue(node);
+  }
+
+  ast.Expression buildStringLiteral(Expression node) {
+    List<ast.Expression> parts = <ast.Expression>[];
+    new StringLiteralPartBuilder(this, parts).build(node);
+    return parts.length == 1 && parts[0] is ast.StringLiteral
+        ? parts[0]
+        : new ast.StringConcatenation(parts);
+  }
+
+  ast.Expression buildThis() {
+    return allowThis
+        ? new ast.ThisExpression()
+        : emitCompileTimeError(CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS);
+  }
+
+  ast.Initializer buildInitializer(ConstructorInitializer node) {
+    try {
+      return new InitializerBuilder(this).build(node);
+    } on _CompilationError catch (_) {
+      return new ast.InvalidInitializer();
+    }
+  }
+
+  bool isFinal(Element element) {
+    return element is VariableElement && element.isFinal ||
+        element is FunctionElement;
+  }
+
+  bool isConst(Element element) {
+    return element is VariableElement && element.isConst;
+  }
+
+  ast.VariableDeclaration getVariableReference(LocalElement element) {
+    return localVariables.putIfAbsent(element, () {
+      return new ast.VariableDeclaration(element.name,
+          isFinal: isFinal(element), isConst: isConst(element));
+    });
+  }
+
+  ast.DartType getInferredVariableType(Element element) {
+    if (!strongMode) return const ast.DynamicType();
+    if (element is FunctionTypedElement) {
+      return buildType(element.type);
+    } else if (element is VariableElement) {
+      return buildType(element.type);
+    } else {
+      log.severe('Unexpected variable element: $element');
+      return const ast.DynamicType();
+    }
+  }
+
+  ast.VariableDeclaration makeVariableDeclaration(LocalElement element,
+      {ast.DartType type, ast.Expression initializer}) {
+    var declaration = getVariableReference(element);
+    declaration.type = type ?? getInferredVariableType(element);
+    if (initializer != null) {
+      declaration.initializer = initializer..parent = declaration;
+    }
+    return declaration;
+  }
+
+  /// Returns true if [arguments] can be accepted by [target]
+  /// (not taking type checks into account).
+  bool areArgumentsCompatible(
+      FunctionTypedElement target, ast.Arguments arguments) {
+    var positionals = arguments.positional;
+    var parameters = target.parameters;
+    const required = ParameterKind.REQUIRED; // For avoiding long lines.
+    const named = ParameterKind.NAMED;
+    // If the first unprovided parameter is required, there are too few
+    // positional arguments.
+    if (positionals.length < parameters.length &&
+        parameters[positionals.length].parameterKind == required) {
+      return false;
+    }
+    // If there are more positional arguments than parameters, or if the last
+    // positional argument corresponds to a named parameter, there are too many
+    // positional arguments.
+    if (positionals.length > parameters.length) return false;
+    if (positionals.isNotEmpty &&
+        parameters[positionals.length - 1].parameterKind == named) {
+      return false; // Too many positional arguments.
+    }
+    if (arguments.named.isEmpty) return true;
+    int firstNamedParameter = positionals.length;
+    while (firstNamedParameter < parameters.length &&
+        parameters[firstNamedParameter].parameterKind != ParameterKind.NAMED) {
+      ++firstNamedParameter;
+    }
+    namedLoop:
+    for (int i = 0; i < arguments.named.length; ++i) {
+      String name = arguments.named[i].name;
+      for (int j = firstNamedParameter; j < parameters.length; ++j) {
+        if (parameters[j].parameterKind == ParameterKind.NAMED &&
+            parameters[j].name == name) {
+          continue namedLoop;
+        }
+      }
+      return false;
+    }
+    return true;
+  }
+
+  /// Throws a NoSuchMethodError corresponding to a call to [memberName] on
+  /// [receiver] with the given [arguments].
+  ///
+  /// If provided, [candiateTarget] provides the expected arity and argument
+  /// names for the best candidate target.
+  ast.Expression buildThrowNoSuchMethodError(
+      ast.Expression receiver, String memberName, ast.Arguments arguments,
+      {Element candidateTarget}) {
+    // TODO(asgerf): When we have better integration with patch files, use
+    //   the internal constructor that provides a more detailed error message.
+    ast.Expression candidateArgumentNames;
+    if (candidateTarget is FunctionTypedElement) {
+      candidateArgumentNames = new ast.ListLiteral(candidateTarget.parameters
+          .map((p) => new ast.StringLiteral(p.name))
+          .toList());
+    } else {
+      candidateArgumentNames = new ast.NullLiteral();
+    }
+    return new ast.Throw(new ast.ConstructorInvocation(
+        loader.getCoreClassConstructorReference('NoSuchMethodError'),
+        new ast.Arguments(<ast.Expression>[
+          receiver,
+          new ast.SymbolLiteral(memberName),
+          new ast.ListLiteral(arguments.positional),
+          new ast.MapLiteral(arguments.named.map((arg) {
+            return new ast.MapEntry(new ast.SymbolLiteral(arg.name), arg.value);
+          }).toList()),
+          candidateArgumentNames
+        ])));
+  }
+
+  ast.Expression buildThrowCompileTimeError(String message) {
+    // The spec does not mandate a specific behavior in face of a compile-time
+    // error.  We just throw a string.  The VM throws an uncatchable exception
+    // for this case.
+    // TOOD(asgerf): Should we add uncatchable exceptions to kernel?
+    return new ast.Throw(new ast.StringLiteral(message));
+  }
+
+  static final RegExp _errorMessagePattern = new RegExp(r'\{(\d+)\}');
+
+  /// Throws an exception that will be caught at the function level, to replace
+  /// the entire function with a throw.
+  emitCompileTimeError(ErrorCode error, [List arguments]) {
+    String message = error.message;
+    if (arguments != null) {
+      message = message.replaceAllMapped(_errorMessagePattern, (m) {
+        String numberString = m.group(1);
+        int index = int.parse(numberString);
+        return arguments[index];
+      });
+    }
+    throw new _CompilationError(message);
+  }
+
+  ast.Expression buildThrowAbstractClassInstantiationError(String name) {
+    return new ast.Throw(new ast.ConstructorInvocation(
+        loader.getCoreClassConstructorReference(
+            'AbstractClassInstantiationError'),
+        new ast.Arguments(<ast.Expression>[new ast.StringLiteral(name)])));
+  }
+
+  ast.Expression buildThrowFallThroughError() {
+    return new ast.Throw(new ast.ConstructorInvocation(
+        loader.getCoreClassConstructorReference('FallThroughError'),
+        new ast.Arguments.empty()));
+  }
+
+  emitInvalidConstant([ErrorCode error]) {
+    error ??= CompileTimeErrorCode.INVALID_CONSTANT;
+    return emitCompileTimeError(error);
+  }
+
+  internalError(String message) {
+    throw 'Internal error when compiling $location: $message';
+  }
+
+  unsupportedFeature(String feature) {
+    throw new _CompilationError('$feature is not supported');
+  }
+
+  ast.Expression buildAnnotation(Annotation annotation) {
+    Element element = annotation.element;
+    if (annotation.arguments == null) {
+      var target = resolveConcreteGet(element, null);
+      return target == null
+          ? new ast.InvalidExpression()
+          : new ast.StaticGet(target);
+    } else if (element is ConstructorElement && element.isConst) {
+      var target = resolveConstructor(element);
+      return target == null
+          ? new ast.InvalidExpression()
+          : new ast.ConstructorInvocation(
+              target, _expressionBuilder.buildArguments(annotation.arguments),
+              isConst: true);
+    } else {
+      return new ast.InvalidExpression();
+    }
+  }
+
+  void addTransformerFlag(int flags) {
+    // Overridden by MemberScope.
+  }
+
+  /// True if the body of the given method must return nothing.
+  bool hasVoidReturn(ExecutableElement element) {
+    return (strongMode && element.returnType.isVoid) ||
+        (element is PropertyAccessorElement && element.isSetter) ||
+        element.name == '[]=';
+  }
+
+  bool bodyHasVoidReturn(FunctionBody body) {
+    AstNode parent = body.parent;
+    return parent is MethodDeclaration && hasVoidReturn(parent.element) ||
+        parent is FunctionDeclaration && hasVoidReturn(parent.element);
+  }
+}
+
+/// A scope in which class type parameters are in scope, while not in scope
+/// of a specific member.
+class ClassScope extends ExpressionScope {
+  @override
+  bool get allowClassTypeParameters => true;
+
+  ClassScope(ReferenceLevelLoader loader, ast.Library library)
+      : super(loader, library);
+}
+
+/// Translates expressions, statements, and other constructs into [ast] nodes.
+///
+/// Naming convention:
+/// - `buildX` may not be given null as argument (it may crash the compiler).
+/// - `buildOptionalX` returns null or an empty list if given null
+/// - `buildMandatoryX` returns an invalid node if given null.
+class MemberScope extends ExpressionScope {
+  /// A reference to the member currently being upgraded to body level.
+  final ast.Member currentMember;
+
+  MemberScope(ReferenceLevelLoader loader, ast.Member currentMember)
+      : currentMember = currentMember,
+        super(loader, currentMember.enclosingLibrary) {
+    assert(currentMember != null);
+  }
+
+  ast.Class get currentClass => currentMember.enclosingClass;
+
+  bool get allowThis => _memberHasThis(currentMember);
+
+  @override
+  bool get allowClassTypeParameters {
+    return currentMember.isInstanceMember || currentMember is ast.Constructor;
+  }
+
+  /// Returns a string for debugging use, indicating the location of the member
+  /// being built.
+  String get location {
+    var library = currentMember.enclosingLibrary?.importUri ?? '<No Library>';
+    var className = currentMember.enclosingClass == null
+        ? null
+        : (currentMember.enclosingClass?.name ?? '<Anonymous Class>');
+    var member =
+        currentMember.name?.name ?? '<Anonymous ${currentMember.runtimeType}>';
+    return [library, className, member].join('::');
+  }
+
+  bool _memberHasThis(ast.Member member) {
+    return member is ast.Procedure && !member.isStatic ||
+        member is ast.Constructor;
+  }
+
+  void addTransformerFlag(int flags) {
+    currentMember.transformerFlags |= flags;
+  }
+}
+
+class LabelStack {
+  final List<String> labels; // Contains null for unlabeled targets.
+  final LabelStack next;
+  final List<ast.Statement> jumps = <ast.Statement>[];
+  bool isSwitchTarget = false;
+
+  LabelStack(String label, this.next) : labels = <String>[label];
+  LabelStack.unlabeled(this.next) : labels = <String>[null];
+  LabelStack.switchCase(String label, this.next)
+      : isSwitchTarget = true,
+        labels = <String>[label];
+  LabelStack.many(this.labels, this.next);
+}
+
+class StatementBuilder extends GeneralizingAstVisitor<ast.Statement> {
+  final ExpressionScope scope;
+  final LabelStack breakStack, continueStack;
+
+  StatementBuilder(this.scope, [this.breakStack, this.continueStack]);
+
+  ast.Statement build(Statement node) {
+    return node.accept(this);
+  }
+
+  ast.Statement buildOptional(Statement node) {
+    return node?.accept(this);
+  }
+
+  ast.Statement buildInScope(
+      Statement node, LabelStack breakNode, LabelStack continueNode) {
+    return new StatementBuilder(scope, breakNode, continueNode).build(node);
+  }
+
+  void buildBlockMember(Statement node, List<ast.Statement> output) {
+    if (node is LabeledStatement &&
+        node.statement is VariableDeclarationStatement) {
+      // If a variable is labeled, its scope is part of the enclosing block.
+      LabeledStatement labeled = node;
+      node = labeled.statement;
+    }
+    if (node is VariableDeclarationStatement) {
+      VariableDeclarationList list = node.variables;
+      ast.DartType type = scope.buildOptionalTypeAnnotation(list.type);
+      for (VariableDeclaration decl in list.variables) {
+        LocalElement local = decl.element as dynamic; // Cross cast.
+        output.add(scope.makeVariableDeclaration(local,
+            type: type,
+            initializer: scope.buildOptionalExpression(decl.initializer)));
+      }
+    } else {
+      output.add(build(node));
+    }
+  }
+
+  ast.Statement makeBreakTarget(ast.Statement node, LabelStack stackNode) {
+    if (stackNode.jumps.isEmpty) return node;
+    var labeled = new ast.LabeledStatement(node);
+    for (var jump in stackNode.jumps) {
+      (jump as ast.BreakStatement).target = labeled;
+    }
+    return labeled;
+  }
+
+  LabelStack findLabelTarget(String label, LabelStack stack) {
+    while (stack != null) {
+      if (stack.labels.contains(label)) return stack;
+      stack = stack.next;
+    }
+    return null;
+  }
+
+  ast.Statement visitAssertStatement(AssertStatement node) {
+    return new ast.AssertStatement(scope.buildExpression(node.condition),
+        scope.buildOptionalExpression(node.message));
+  }
+
+  ast.Statement visitBlock(Block node) {
+    List<ast.Statement> statements = <ast.Statement>[];
+    for (Statement statement in node.statements) {
+      buildBlockMember(statement, statements);
+    }
+    return new ast.Block(statements);
+  }
+
+  ast.Statement visitBreakStatement(BreakStatement node) {
+    var stackNode = findLabelTarget(node.label?.name, breakStack);
+    if (stackNode == null) {
+      return node.label == null
+          ? scope.emitCompileTimeError(ParserErrorCode.BREAK_OUTSIDE_OF_LOOP)
+          : scope.emitCompileTimeError(
+              CompileTimeErrorCode.LABEL_UNDEFINED, [node.label.name]);
+    }
+    var result = new ast.BreakStatement(null);
+    stackNode.jumps.add(result);
+    return result;
+  }
+
+  ast.Statement visitContinueStatement(ContinueStatement node) {
+    var stackNode = findLabelTarget(node.label?.name, continueStack);
+    if (stackNode == null) {
+      return node.label == null
+          ? scope.emitCompileTimeError(ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP)
+          : scope.emitCompileTimeError(
+              CompileTimeErrorCode.LABEL_UNDEFINED, [node.label.name]);
+    }
+    var result = stackNode.isSwitchTarget
+        ? new ast.ContinueSwitchStatement(null)
+        : new ast.BreakStatement(null);
+    stackNode.jumps.add(result);
+    return result;
+  }
+
+  void addLoopLabels(Statement loop, LabelStack continueNode) {
+    AstNode parent = loop.parent;
+    if (parent is LabeledStatement) {
+      for (var label in parent.labels) {
+        continueNode.labels.add(label.label.name);
+      }
+    }
+  }
+
+  ast.Statement visitDoStatement(DoStatement node) {
+    LabelStack breakNode = new LabelStack.unlabeled(breakStack);
+    LabelStack continueNode = new LabelStack.unlabeled(continueStack);
+    addLoopLabels(node, continueNode);
+    var body = buildInScope(node.body, breakNode, continueNode);
+    var loop = new ast.DoStatement(makeBreakTarget(body, continueNode),
+        scope.buildExpression(node.condition));
+    return makeBreakTarget(loop, breakNode);
+  }
+
+  ast.Statement visitWhileStatement(WhileStatement node) {
+    LabelStack breakNode = new LabelStack.unlabeled(breakStack);
+    LabelStack continueNode = new LabelStack.unlabeled(continueStack);
+    addLoopLabels(node, continueNode);
+    var body = buildInScope(node.body, breakNode, continueNode);
+    var loop = new ast.WhileStatement(scope.buildExpression(node.condition),
+        makeBreakTarget(body, continueNode));
+    return makeBreakTarget(loop, breakNode);
+  }
+
+  ast.Statement visitEmptyStatement(EmptyStatement node) {
+    return new ast.EmptyStatement();
+  }
+
+  ast.Statement visitExpressionStatement(ExpressionStatement node) {
+    return new ast.ExpressionStatement(scope.buildExpression(node.expression));
+  }
+
+  static String _getLabelName(Label label) {
+    return label.label.name;
+  }
+
+  ast.Statement visitLabeledStatement(LabeledStatement node) {
+    // Only set up breaks here.  Loops handle labeling on their own.
+    var breakNode = new LabelStack.many(
+        node.labels.map(_getLabelName).toList(), breakStack);
+    var body = buildInScope(node.statement, breakNode, continueStack);
+    return makeBreakTarget(body, breakNode);
+  }
+
+  static bool isBreakingExpression(ast.Expression node) {
+    return node is ast.Throw || node is ast.Rethrow;
+  }
+
+  static bool isBreakingStatement(ast.Statement node) {
+    return node is ast.BreakStatement ||
+        node is ast.ContinueSwitchStatement ||
+        node is ast.ReturnStatement ||
+        node is ast.ExpressionStatement &&
+            isBreakingExpression(node.expression);
+  }
+
+  ast.Statement visitSwitchStatement(SwitchStatement node) {
+    // Group all cases into case blocks.  Use parallel lists to collect the
+    // intermediate terms until we are ready to create the AST nodes.
+    LabelStack breakNode = new LabelStack.unlabeled(breakStack);
+    LabelStack continueNode = continueStack;
+    var cases = <ast.SwitchCase>[];
+    var bodies = <List<Statement>>[];
+    var labelToNode = <String, ast.SwitchCase>{};
+    ast.SwitchCase currentCase = null;
+    for (var member in node.members) {
+      if (currentCase != null && currentCase.isDefault) {
+        var error = member is SwitchCase
+            ? ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE
+            : ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES;
+        return scope.emitCompileTimeError(error);
+      }
+      if (currentCase == null) {
+        currentCase = new ast.SwitchCase(<ast.Expression>[], null);
+        cases.add(currentCase);
+      }
+      if (member is SwitchCase) {
+        var expression = scope.buildExpression(member.expression);
+        currentCase.expressions.add(expression..parent = currentCase);
+      } else {
+        currentCase.isDefault = true;
+      }
+      for (Label label in member.labels) {
+        continueNode =
+            new LabelStack.switchCase(label.label.name, continueNode);
+        labelToNode[label.label.name] = currentCase;
+      }
+      if (member.statements?.isNotEmpty ?? false) {
+        bodies.add(member.statements);
+        currentCase = null;
+      }
+    }
+    if (currentCase != null) {
+      // Close off a trailing block.
+      bodies.add(const <Statement>[]);
+      currentCase = null;
+    }
+    // Now that the label environment is set up, build the bodies.
+    var innerBuilder = new StatementBuilder(scope, breakNode, continueNode);
+    for (int i = 0; i < cases.length; ++i) {
+      var blockNodes = <ast.Statement>[];
+      for (var statement in bodies[i]) {
+        innerBuilder.buildBlockMember(statement, blockNodes);
+      }
+      if (blockNodes.isEmpty || !isBreakingStatement(blockNodes.last)) {
+        if (i < cases.length - 1) {
+          blockNodes.add(
+              new ast.ExpressionStatement(scope.buildThrowFallThroughError()));
+        } else {
+          var jump = new ast.BreakStatement(null);
+          blockNodes.add(jump);
+          breakNode.jumps.add(jump);
+        }
+      }
+      cases[i].body = new ast.Block(blockNodes)..parent = cases[i];
+    }
+    // Unwind the stack of case labels and bind their jumps to the case target.
+    while (continueNode != continueStack) {
+      for (var jump in continueNode.jumps) {
+        (jump as ast.ContinueSwitchStatement).target =
+            labelToNode[continueNode.labels.first];
+      }
+      continueNode = continueNode.next;
+    }
+    var expression = scope.buildExpression(node.expression);
+    var result = new ast.SwitchStatement(expression, cases);
+    return makeBreakTarget(result, breakNode);
+  }
+
+  ast.Statement visitForStatement(ForStatement node) {
+    List<ast.VariableDeclaration> variables = <ast.VariableDeclaration>[];
+    ast.Expression initialExpression;
+    if (node.variables != null) {
+      VariableDeclarationList list = node.variables;
+      var type = scope.buildOptionalTypeAnnotation(list.type);
+      for (var variable in list.variables) {
+        LocalElement local = variable.element as dynamic; // Cross cast.
+        variables.add(scope.makeVariableDeclaration(local,
+            initializer: scope.buildOptionalExpression(variable.initializer),
+            type: type));
+      }
+    } else if (node.initialization != null) {
+      initialExpression = scope.buildExpression(node.initialization);
+    }
+    var breakNode = new LabelStack.unlabeled(breakStack);
+    var continueNode = new LabelStack.unlabeled(continueStack);
+    addLoopLabels(node, continueNode);
+    var body = buildInScope(node.body, breakNode, continueNode);
+    var loop = new ast.ForStatement(
+        variables,
+        scope.buildOptionalExpression(node.condition),
+        node.updaters.map(scope.buildExpression).toList(),
+        makeBreakTarget(body, continueNode));
+    loop = makeBreakTarget(loop, breakNode);
+    if (initialExpression != null) {
+      return new ast.Block(<ast.Statement>[
+        new ast.ExpressionStatement(initialExpression),
+        loop
+      ]);
+    }
+    return loop;
+  }
+
+  ast.Statement visitForEachStatement(ForEachStatement node) {
+    ast.VariableDeclaration variable;
+    Accessor leftHand;
+    if (node.loopVariable != null) {
+      DeclaredIdentifier loopVariable = node.loopVariable;
+      variable = scope.makeVariableDeclaration(loopVariable.element,
+          type: scope.buildOptionalTypeAnnotation(loopVariable.type));
+    } else if (node.identifier != null) {
+      leftHand = scope.buildLeftHandValue(node.identifier);
+      // TODO: In strong mode, set variable type based on iterable type.
+      variable = new ast.VariableDeclaration(null, isFinal: true);
+    }
+    var breakNode = new LabelStack.unlabeled(breakStack);
+    var continueNode = new LabelStack.unlabeled(continueStack);
+    addLoopLabels(node, continueNode);
+    var body = buildInScope(node.body, breakNode, continueNode);
+    if (leftHand != null) {
+      // Desugar
+      //
+      //     for (x in e) BODY
+      //
+      // to
+      //
+      //     for (var tmp in e) {
+      //       x = tmp;
+      //       BODY
+      //     }
+      body = new ast.Block(<ast.Statement>[
+        new ast.ExpressionStatement(leftHand
+            .buildAssignment(new ast.VariableGet(variable), voidContext: true)),
+        body
+      ]);
+    }
+    var loop = new ast.ForInStatement(
+        variable,
+        scope.buildExpression(node.iterable),
+        makeBreakTarget(body, continueNode),
+        isAsync: node.awaitKeyword != null);
+    return makeBreakTarget(loop, breakNode);
+  }
+
+  ast.Statement visitIfStatement(IfStatement node) {
+    return new ast.IfStatement(scope.buildExpression(node.condition),
+        build(node.thenStatement), buildOptional(node.elseStatement));
+  }
+
+  ast.Statement visitReturnStatement(ReturnStatement node) {
+    return new ast.ReturnStatement(
+        scope.buildOptionalExpression(node.expression));
+  }
+
+  ast.Catch buildCatchClause(CatchClause node) {
+    var exceptionVariable = node.exceptionParameter == null
+        ? null
+        : scope.makeVariableDeclaration(node.exceptionParameter.staticElement);
+    var stackTraceVariable = node.stackTraceParameter == null
+        ? null
+        : scope.makeVariableDeclaration(node.stackTraceParameter.staticElement);
+    return new ast.Catch(exceptionVariable, build(node.body),
+        stackTrace: stackTraceVariable,
+        guard: scope.buildOptionalTypeAnnotation(node.exceptionType) ??
+            const ast.DynamicType());
+  }
+
+  ast.Statement visitTryStatement(TryStatement node) {
+    ast.Statement statement = build(node.body);
+    if (node.catchClauses.isNotEmpty) {
+      statement = new ast.TryCatch(
+          statement, node.catchClauses.map(buildCatchClause).toList());
+    }
+    if (node.finallyBlock != null) {
+      statement = new ast.TryFinally(statement, build(node.finallyBlock));
+    }
+    return statement;
+  }
+
+  ast.Statement visitVariableDeclarationStatement(
+      VariableDeclarationStatement node) {
+    // This is only reached when a variable is declared in non-block level,
+    // because visitBlock intercepts visits to its children.
+    // An example where we hit this case is:
+    //
+    //   if (foo) var x = 5, y = x + 1;
+    //
+    // We wrap these in a block:
+    //
+    //   if (foo) {
+    //     var x = 5;
+    //     var y = x + 1;
+    //   }
+    //
+    // Note that the use of a block here is required by the kernel language,
+    // even if there is only one variable declaration.
+    List<ast.Statement> statements = <ast.Statement>[];
+    buildBlockMember(node, statements);
+    return new ast.Block(statements);
+  }
+
+  ast.Statement visitYieldStatement(YieldStatement node) {
+    return new ast.YieldStatement(scope.buildExpression(node.expression),
+        isYieldStar: node.star != null);
+  }
+
+  ast.Statement visitFunctionDeclarationStatement(
+      FunctionDeclarationStatement node) {
+    var declaration = node.functionDeclaration;
+    var expression = declaration.functionExpression;
+    LocalElement element = declaration.element as dynamic; // Cross cast.
+    // TODO: Set a function type on the variable.
+    return new ast.FunctionDeclaration(
+        scope.makeVariableDeclaration(element),
+        scope.buildFunctionNode(expression.parameters, expression.body,
+            typeParameters:
+                scope.buildOptionalTypeParameterList(expression.typeParameters),
+            returnType: declaration.returnType));
+  }
+
+  @override
+  visitStatement(Statement node) {
+    return scope.internalError('Unhandled statement ${node.runtimeType}');
+  }
+}
+
+class ExpressionBuilder
+    extends GeneralizingAstVisitor /* <ast.Expression | Accessor> */ {
+  final ExpressionScope scope;
+  final ast.VariableDeclaration cascadeReceiver;
+  ExpressionBuilder(this.scope, [this.cascadeReceiver]);
+
+  ast.Expression build(Expression node) {
+    var result = node.accept(this);
+    if (result is Accessor) {
+      result = result.buildSimpleRead();
+    }
+    return result..fileOffset = _getOffset(node);
+  }
+
+  int _getOffset(AstNode node) {
+    if (node is MethodInvocation) {
+      return node.methodName.offset;
+    } else if (node is InstanceCreationExpression) {
+      return node.constructorName.offset;
+    } else if (node is BinaryExpression) {
+      return node.operator.offset;
+    } else if (node is PrefixedIdentifier) {
+      return node.identifier.offset;
+    } else if (node is AssignmentExpression) {
+      return _getOffset(node.leftHandSide);
+    }
+    return node.offset;
+  }
+
+  Accessor buildLeftHandValue(Expression node) {
+    var result = node.accept(this);
+    if (result is Accessor) {
+      return result;
+    } else {
+      return new ReadOnlyAccessor(result);
+    }
+  }
+
+  ast.Expression visitAsExpression(AsExpression node) {
+    return new ast.AsExpression(
+        build(node.expression), scope.buildTypeAnnotation(node.type));
+  }
+
+  ast.Expression visitAssignmentExpression(AssignmentExpression node) {
+    bool voidContext = isInVoidContext(node);
+    String operator = node.operator.value();
+    var leftHand = buildLeftHandValue(node.leftHandSide);
+    var rightHand = build(node.rightHandSide);
+    if (operator == '=') {
+      return leftHand.buildAssignment(rightHand, voidContext: voidContext);
+    } else if (operator == '??=') {
+      return leftHand.buildNullAwareAssignment(
+          rightHand, scope.buildType(node.staticType),
+          voidContext: voidContext);
+    } else {
+      // Cut off the trailing '='.
+      var name = new ast.Name(operator.substring(0, operator.length - 1));
+      return leftHand.buildCompoundAssignment(name, rightHand,
+          voidContext: voidContext,
+          interfaceTarget: scope.resolveInterfaceMethod(node.staticElement));
+    }
+  }
+
+  ast.Expression visitAwaitExpression(AwaitExpression node) {
+    return new ast.AwaitExpression(build(node.expression));
+  }
+
+  ast.Arguments buildSingleArgument(Expression node) {
+    return new ast.Arguments(<ast.Expression>[build(node)]);
+  }
+
+  ast.Expression visitBinaryExpression(BinaryExpression node) {
+    String operator = node.operator.value();
+    if (operator == '&&' || operator == '||') {
+      return new ast.LogicalExpression(
+          build(node.leftOperand), operator, build(node.rightOperand));
+    }
+    if (operator == '??') {
+      ast.Expression leftOperand = build(node.leftOperand);
+      if (leftOperand is ast.VariableGet) {
+        return new ast.ConditionalExpression(
+            buildIsNull(leftOperand),
+            build(node.rightOperand),
+            new ast.VariableGet(leftOperand.variable),
+            scope.getInferredType(node));
+      } else {
+        var variable = new ast.VariableDeclaration.forValue(leftOperand);
+        return new ast.Let(
+            variable,
+            new ast.ConditionalExpression(
+                buildIsNull(new ast.VariableGet(variable)),
+                build(node.rightOperand),
+                new ast.VariableGet(variable),
+                scope.getInferredType(node)));
+      }
+    }
+    bool isNegated = false;
+    if (operator == '!=') {
+      isNegated = true;
+      operator = '==';
+    }
+    ast.Expression expression;
+    if (node.leftOperand is SuperExpression) {
+      scope.addTransformerFlag(TransformerFlag.superCalls);
+      expression = new ast.SuperMethodInvocation(
+          new ast.Name(operator),
+          buildSingleArgument(node.rightOperand),
+          scope.resolveConcreteMethod(node.staticElement));
+    } else {
+      expression = new ast.MethodInvocation(
+          build(node.leftOperand),
+          new ast.Name(operator),
+          buildSingleArgument(node.rightOperand),
+          scope.resolveInterfaceMethod(node.staticElement));
+    }
+    return isNegated ? new ast.Not(expression) : expression;
+  }
+
+  ast.Expression visitBooleanLiteral(BooleanLiteral node) {
+    return new ast.BoolLiteral(node.value);
+  }
+
+  ast.Expression visitDoubleLiteral(DoubleLiteral node) {
+    return new ast.DoubleLiteral(node.value);
+  }
+
+  ast.Expression visitIntegerLiteral(IntegerLiteral node) {
+    return new ast.IntLiteral(node.value);
+  }
+
+  ast.Expression visitNullLiteral(NullLiteral node) {
+    return new ast.NullLiteral();
+  }
+
+  ast.Expression visitSimpleStringLiteral(SimpleStringLiteral node) {
+    return new ast.StringLiteral(node.value);
+  }
+
+  ast.Expression visitStringLiteral(StringLiteral node) {
+    return scope.buildStringLiteral(node);
+  }
+
+  static Object _getTokenValue(Token token) {
+    return token.value();
+  }
+
+  ast.Expression visitSymbolLiteral(SymbolLiteral node) {
+    String value = node.components.map(_getTokenValue).join('.');
+    return new ast.SymbolLiteral(value);
+  }
+
+  ast.Expression visitCascadeExpression(CascadeExpression node) {
+    var receiver = build(node.target);
+    // If receiver is a variable it would be tempting to reuse it, but it
+    // might be reassigned in one of the cascade sections.
+    var receiverVariable = new ast.VariableDeclaration.forValue(receiver,
+        type: scope.getInferredType(node.target));
+    var inner = new ExpressionBuilder(scope, receiverVariable);
+    ast.Expression result = new ast.VariableGet(receiverVariable);
+    for (var section in node.cascadeSections.reversed) {
+      var dummy = new ast.VariableDeclaration.forValue(inner.build(section));
+      result = new ast.Let(dummy, result);
+    }
+    return new ast.Let(receiverVariable, result);
+  }
+
+  ast.Expression makeCascadeReceiver() {
+    assert(cascadeReceiver != null);
+    return new ast.VariableGet(cascadeReceiver);
+  }
+
+  ast.Expression visitConditionalExpression(ConditionalExpression node) {
+    return new ast.ConditionalExpression(
+        build(node.condition),
+        build(node.thenExpression),
+        build(node.elseExpression),
+        scope.getInferredType(node));
+  }
+
+  ast.Expression visitFunctionExpression(FunctionExpression node) {
+    return new ast.FunctionExpression(scope.buildFunctionNode(
+        node.parameters, node.body,
+        typeParameters:
+            scope.buildOptionalTypeParameterList(node.typeParameters),
+        inferredReturnType: scope.getInferredReturnType(node)));
+  }
+
+  ast.Arguments buildArguments(ArgumentList valueArguments,
+      {TypeArgumentList explicitTypeArguments,
+      List<ast.DartType> inferTypeArguments()}) {
+    var positional = <ast.Expression>[];
+    var named = <ast.NamedExpression>[];
+    for (var argument in valueArguments.arguments) {
+      if (argument is NamedExpression) {
+        named.add(new ast.NamedExpression(
+            argument.name.label.name, build(argument.expression)));
+      } else if (named.isNotEmpty) {
+        return scope.emitCompileTimeError(
+            ParserErrorCode.POSITIONAL_AFTER_NAMED_ARGUMENT);
+      } else {
+        positional.add(build(argument));
+      }
+    }
+    List<ast.DartType> typeArguments;
+    if (explicitTypeArguments != null) {
+      typeArguments = scope.buildTypeArgumentList(explicitTypeArguments);
+    } else if (inferTypeArguments != null) {
+      typeArguments = inferTypeArguments();
+    }
+    return new ast.Arguments(positional, named: named, types: typeArguments);
+  }
+
+  ast.Arguments buildArgumentsForInvocation(InvocationExpression node) {
+    return buildArguments(node.argumentList,
+        explicitTypeArguments: node.typeArguments,
+        inferTypeArguments: () =>
+            scope.getInferredInvocationTypeArguments(node));
+  }
+
+  static final ast.Name callName = new ast.Name('call');
+
+  ast.Expression visitFunctionExpressionInvocation(
+      FunctionExpressionInvocation node) {
+    return new ast.MethodInvocation(
+        build(node.function),
+        callName,
+        buildArgumentsForInvocation(node),
+        scope.resolveInterfaceFunctionCallOnType(node.function.staticType));
+  }
+
+  visitPrefixedIdentifier(PrefixedIdentifier node) {
+    switch (ElementKind.of(node.prefix.staticElement)) {
+      case ElementKind.CLASS:
+      case ElementKind.LIBRARY:
+      case ElementKind.PREFIX:
+      case ElementKind.IMPORT:
+        if (node.identifier.staticElement != null) {
+          // Should be resolved to a static access.
+          // Do not invoke 'build', because the identifier should be seen as a
+          // left-hand value or an expression depending on the context.
+          return visitSimpleIdentifier(node.identifier);
+        }
+        // Unresolved access on a class or library.
+        return scope.unresolvedAccess(node.identifier.name);
+
+      case ElementKind.DYNAMIC:
+      case ElementKind.FUNCTION_TYPE_ALIAS:
+      case ElementKind.TYPE_PARAMETER:
+      // TODO: Check with the spec to see exactly when a type literal can be
+      // used in a property access without surrounding parentheses.
+      // For now, just fall through to the property access case.
+
+      case ElementKind.FIELD:
+      case ElementKind.TOP_LEVEL_VARIABLE:
+      case ElementKind.FUNCTION:
+      case ElementKind.METHOD:
+      case ElementKind.GETTER:
+      case ElementKind.SETTER:
+      case ElementKind.LOCAL_VARIABLE:
+      case ElementKind.PARAMETER:
+      case ElementKind.ERROR:
+        Element element = node.identifier.staticElement;
+        Element auxiliary = node.identifier.auxiliaryElements?.staticElement;
+        return PropertyAccessor.make(
+            build(node.prefix),
+            scope.buildName(node.identifier),
+            scope.resolveInterfaceGet(element, auxiliary),
+            scope.resolveInterfaceSet(element, auxiliary));
+
+      case ElementKind.UNIVERSE:
+      case ElementKind.NAME:
+      case ElementKind.CONSTRUCTOR:
+      case ElementKind.EXPORT:
+      case ElementKind.LABEL:
+      default:
+        return scope.internalError(
+            'Unexpected element kind: ${node.prefix.staticElement}');
+    }
+  }
+
+  bool isStatic(Element element) {
+    if (element is ClassMemberElement) {
+      return element.isStatic || element.enclosingElement == null;
+    }
+    if (element is PropertyAccessorElement) {
+      return element.isStatic || element.enclosingElement == null;
+    }
+    if (element is FunctionElement) {
+      return element.isStatic;
+    }
+    return false;
+  }
+
+  visitSimpleIdentifier(SimpleIdentifier node) {
+    Element element = node.staticElement;
+    switch (ElementKind.of(element)) {
+      case ElementKind.CLASS:
+      case ElementKind.DYNAMIC:
+      case ElementKind.FUNCTION_TYPE_ALIAS:
+      case ElementKind.TYPE_PARAMETER:
+        return new ast.TypeLiteral(scope.buildTypeAnnotation(node));
+
+      case ElementKind.ERROR: // This covers the case where nothing was found.
+        if (!scope.allowThis) {
+          return scope.unresolvedAccess(node.name);
+        }
+        return PropertyAccessor.make(
+            scope.buildThis(), scope.buildName(node), null, null);
+
+      case ElementKind.FIELD:
+      case ElementKind.TOP_LEVEL_VARIABLE:
+      case ElementKind.GETTER:
+      case ElementKind.SETTER:
+      case ElementKind.METHOD:
+        Element auxiliary = node.auxiliaryElements?.staticElement;
+        if (isStatic(element)) {
+          return scope.staticAccess(node.name, element, auxiliary);
+        }
+        if (!scope.allowThis) {
+          return scope.unresolvedAccess(node.name);
+        }
+        return PropertyAccessor.make(
+            scope.buildThis(),
+            scope.buildName(node),
+            scope.resolveInterfaceGet(element, auxiliary),
+            scope.resolveInterfaceSet(element, auxiliary));
+
+      case ElementKind.FUNCTION:
+        FunctionElement function = element;
+        if (isTopLevelFunction(function)) {
+          return scope.staticAccess(node.name, function);
+        }
+        return new VariableAccessor(scope.getVariableReference(function));
+
+      case ElementKind.LOCAL_VARIABLE:
+      case ElementKind.PARAMETER:
+        VariableElement variable = element;
+        var type = identical(node.staticType, variable.type)
+            ? null
+            : scope.buildType(node.staticType);
+        return new VariableAccessor(scope.getVariableReference(element), type);
+
+      case ElementKind.IMPORT:
+      case ElementKind.LIBRARY:
+      case ElementKind.PREFIX:
+        return scope.emitCompileTimeError(
+            CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT,
+            [node.name]);
+
+      case ElementKind.COMPILATION_UNIT:
+      case ElementKind.CONSTRUCTOR:
+      case ElementKind.EXPORT:
+      case ElementKind.LABEL:
+      case ElementKind.UNIVERSE:
+      case ElementKind.NAME:
+      default:
+        return scope.internalError('Unexpected element kind: $element');
+    }
+  }
+
+  visitIndexExpression(IndexExpression node) {
+    Element element = node.staticElement;
+    Element auxiliary = node.auxiliaryElements?.staticElement;
+    if (node.isCascaded) {
+      return IndexAccessor.make(
+          makeCascadeReceiver(),
+          build(node.index),
+          scope.resolveInterfaceIndexGet(element, auxiliary),
+          scope.resolveInterfaceIndexSet(element, auxiliary));
+    } else if (node.target is SuperExpression) {
+      scope.addTransformerFlag(TransformerFlag.superCalls);
+      return new SuperIndexAccessor(
+          build(node.index),
+          scope.resolveConcreteIndexGet(element, auxiliary),
+          scope.resolveConcreteIndexSet(element, auxiliary));
+    } else {
+      return IndexAccessor.make(
+          build(node.target),
+          build(node.index),
+          scope.resolveInterfaceIndexGet(element, auxiliary),
+          scope.resolveInterfaceIndexSet(element, auxiliary));
+    }
+  }
+
+  /// Follows any number of redirecting factories, returning the effective
+  /// target or `null` if a cycle is found.
+  ///
+  /// The returned element is a [Member] if the type arguments to the effective
+  /// target are different from the original arguments.
+  ConstructorElement getEffectiveFactoryTarget(ConstructorElement element) {
+    ConstructorElement anchor = null;
+    int n = 1;
+    while (element.isFactory && element.redirectedConstructor != null) {
+      element = element.redirectedConstructor;
+      var base = ReferenceScope.getBaseElement(element);
+      if (base == anchor) return null; // Cyclic redirection.
+      if (n & ++n == 0) {
+        anchor = base;
+      }
+    }
+    return element;
+  }
+
+  ast.Expression visitInstanceCreationExpression(
+      InstanceCreationExpression node) {
+    ConstructorElement element = node.staticElement;
+    ClassElement classElement = element?.enclosingElement;
+    List<ast.DartType> inferTypeArguments() {
+      var inferredType = scope.getInferredType(node);
+      if (inferredType is ast.InterfaceType) {
+        return inferredType.typeArguments.toList();
+      }
+      int numberOfTypeArguments =
+          classElement == null ? 0 : classElement.typeParameters.length;
+      return new List<ast.DartType>.filled(
+          numberOfTypeArguments, const ast.DynamicType(),
+          growable: true);
+    }
+
+    var arguments = buildArguments(node.argumentList,
+        explicitTypeArguments: node.constructorName.type.typeArguments,
+        inferTypeArguments: inferTypeArguments);
+    ast.Expression noSuchMethodError() {
+      return node.isConst
+          ? scope.emitInvalidConstant()
+          : scope.buildThrowNoSuchMethodError(
+              new ast.NullLiteral(), '${node.constructorName}', arguments,
+              candidateTarget: element);
+    }
+
+    if (element == null) {
+      return noSuchMethodError();
+    }
+    assert(classElement != null);
+    var redirect = getEffectiveFactoryTarget(element);
+    if (redirect == null) {
+      return scope.buildThrowCompileTimeError(
+          CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT.message);
+    }
+    if (redirect != element) {
+      ast.InterfaceType returnType = scope.buildType(redirect.returnType);
+      arguments.types
+        ..clear()
+        ..addAll(returnType.typeArguments);
+      element = redirect;
+      classElement = element.enclosingElement;
+    }
+    element = ReferenceScope.getBaseElement(element);
+    if (node.isConst && !element.isConst) {
+      return scope
+          .emitInvalidConstant(CompileTimeErrorCode.CONST_WITH_NON_CONST);
+    }
+    if (classElement.isEnum) {
+      return scope.emitCompileTimeError(CompileTimeErrorCode.INSTANTIATE_ENUM);
+    }
+    if (element.isFactory) {
+      ast.Member target = scope.resolveConcreteMethod(element);
+      if (target is ast.Procedure &&
+          scope.areArgumentsCompatible(element, arguments)) {
+        return new ast.StaticInvocation(target, arguments,
+            isConst: node.isConst);
+      } else {
+        return noSuchMethodError();
+      }
+    }
+    if (classElement.isAbstract) {
+      return node.isConst
+          ? scope.emitInvalidConstant()
+          : scope.buildThrowAbstractClassInstantiationError(classElement.name);
+    }
+    ast.Constructor constructor = scope.resolveConstructor(element);
+    if (constructor != null &&
+        scope.areArgumentsCompatible(element, arguments)) {
+      return new ast.ConstructorInvocation(constructor, arguments,
+          isConst: node.isConst);
+    } else {
+      return noSuchMethodError();
+    }
+  }
+
+  ast.Expression visitIsExpression(IsExpression node) {
+    if (node.notOperator != null) {
+      return new ast.Not(new ast.IsExpression(
+          build(node.expression), scope.buildTypeAnnotation(node.type)));
+    } else {
+      return new ast.IsExpression(
+          build(node.expression), scope.buildTypeAnnotation(node.type));
+    }
+  }
+
+  /// Emit a method invocation, either as a direct call `o.f(x)` or decomposed
+  /// into a getter and function invocation `o.f.call(x)`.
+  ast.Expression buildDecomposableMethodInvocation(ast.Expression receiver,
+      ast.Name name, ast.Arguments arguments, Element targetElement) {
+    // Try to emit a typed call to an interface method.
+    ast.Procedure targetMethod = scope.resolveInterfaceMethod(targetElement);
+    if (targetMethod != null) {
+      return new ast.MethodInvocation(receiver, name, arguments, targetMethod);
+    }
+    // Try to emit a typed call to getter or field and call the returned
+    // function.
+    ast.Member targetGetter = scope.resolveInterfaceGet(targetElement, null);
+    if (targetGetter != null) {
+      return new ast.MethodInvocation(
+          new ast.PropertyGet(receiver, name, targetGetter),
+          callName,
+          arguments,
+          scope.resolveInterfaceFunctionCall(targetElement));
+    }
+    // Emit a dynamic call.
+    return new ast.MethodInvocation(receiver, name, arguments);
+  }
+
+  ast.Expression visitMethodInvocation(MethodInvocation node) {
+    Element element = node.methodName.staticElement;
+    if (element != null && element == element.library?.loadLibraryFunction) {
+      return scope.unsupportedFeature('Deferred loading');
+    }
+    var target = node.target;
+    if (node.isCascaded) {
+      return buildDecomposableMethodInvocation(
+          makeCascadeReceiver(),
+          scope.buildName(node.methodName),
+          buildArgumentsForInvocation(node),
+          element);
+    } else if (target is SuperExpression) {
+      scope.addTransformerFlag(TransformerFlag.superCalls);
+      return new ast.SuperMethodInvocation(
+          scope.buildName(node.methodName),
+          buildArgumentsForInvocation(node),
+          scope.resolveConcreteMethod(element));
+    } else if (isLocal(element)) {
+      return new ast.MethodInvocation(
+          new ast.VariableGet(scope.getVariableReference(element)),
+          callName,
+          buildArgumentsForInvocation(node),
+          scope.resolveInterfaceFunctionCall(element));
+    } else if (isStaticMethod(element)) {
+      var method = scope.resolveConcreteMethod(element);
+      var arguments = buildArgumentsForInvocation(node);
+      if (method == null || !scope.areArgumentsCompatible(element, arguments)) {
+        return scope.buildThrowNoSuchMethodError(
+            new ast.NullLiteral(), node.methodName.name, arguments,
+            candidateTarget: element);
+      }
+      return new ast.StaticInvocation(method, arguments);
+    } else if (isStaticVariableOrGetter(element)) {
+      var method = scope.resolveConcreteGet(element, null);
+      if (method == null) {
+        return scope.buildThrowNoSuchMethodError(
+            new ast.NullLiteral(), node.methodName.name, new ast.Arguments([]),
+            candidateTarget: element);
+      }
+      return new ast.MethodInvocation(
+          new ast.StaticGet(method),
+          callName,
+          buildArgumentsForInvocation(node),
+          scope.resolveInterfaceFunctionCall(element));
+    } else if (target == null && !scope.allowThis ||
+        target is Identifier && target.staticElement is ClassElement ||
+        target is Identifier && target.staticElement is PrefixElement) {
+      return scope.buildThrowNoSuchMethodError(new ast.NullLiteral(),
+          node.methodName.name, buildArgumentsForInvocation(node),
+          candidateTarget: element);
+    } else if (target == null) {
+      return buildDecomposableMethodInvocation(
+          scope.buildThis(),
+          scope.buildName(node.methodName),
+          buildArgumentsForInvocation(node),
+          element);
+    } else if (node.operator.value() == '?.') {
+      var receiver = makeOrReuseVariable(build(target));
+      return makeLet(
+          receiver,
+          new ast.ConditionalExpression(
+              buildIsNull(new ast.VariableGet(receiver)),
+              new ast.NullLiteral(),
+              buildDecomposableMethodInvocation(
+                  new ast.VariableGet(receiver),
+                  scope.buildName(node.methodName),
+                  buildArgumentsForInvocation(node),
+                  element),
+              scope.buildType(node.staticType)));
+    } else {
+      return buildDecomposableMethodInvocation(
+          build(node.target),
+          scope.buildName(node.methodName),
+          buildArgumentsForInvocation(node),
+          element);
+    }
+  }
+
+  ast.Expression visitNamedExpression(NamedExpression node) {
+    return scope.internalError('Unexpected named expression');
+  }
+
+  ast.Expression visitParenthesizedExpression(ParenthesizedExpression node) {
+    return build(node.expression);
+  }
+
+  bool isInVoidContext(Expression node) {
+    AstNode parent = node.parent;
+    return parent is ForStatement &&
+            (parent.updaters.contains(node) || parent.initialization == node) ||
+        parent is ExpressionStatement ||
+        parent is ExpressionFunctionBody && scope.bodyHasVoidReturn(parent);
+  }
+
+  ast.Expression visitPostfixExpression(PostfixExpression node) {
+    String operator = node.operator.value();
+    switch (operator) {
+      case '++':
+      case '--':
+        var leftHand = buildLeftHandValue(node.operand);
+        var binaryOperator = new ast.Name(operator[0]);
+        return leftHand.buildPostfixIncrement(binaryOperator,
+            voidContext: isInVoidContext(node),
+            interfaceTarget: scope.resolveInterfaceMethod(node.staticElement));
+
+      default:
+        return scope.internalError('Invalid postfix operator $operator');
+    }
+  }
+
+  ast.Expression visitPrefixExpression(PrefixExpression node) {
+    String operator = node.operator.value();
+    switch (operator) {
+      case '-':
+      case '~':
+        var name = new ast.Name(operator == '-' ? 'unary-' : '~');
+        if (node.operand is SuperExpression) {
+          scope.addTransformerFlag(TransformerFlag.superCalls);
+          return new ast.SuperMethodInvocation(name, new ast.Arguments.empty(),
+              scope.resolveConcreteMethod(node.staticElement));
+        }
+        return new ast.MethodInvocation(
+            build(node.operand),
+            name,
+            new ast.Arguments.empty(),
+            scope.resolveInterfaceMethod(node.staticElement));
+
+      case '!':
+        return new ast.Not(build(node.operand));
+
+      case '++':
+      case '--':
+        var leftHand = buildLeftHandValue(node.operand);
+        var binaryOperator = new ast.Name(operator[0]);
+        return leftHand.buildPrefixIncrement(binaryOperator,
+            interfaceTarget: scope.resolveInterfaceMethod(node.staticElement));
+
+      default:
+        return scope.internalError('Invalid prefix operator $operator');
+    }
+  }
+
+  visitPropertyAccess(PropertyAccess node) {
+    Element element = node.propertyName.staticElement;
+    Element auxiliary = node.propertyName.auxiliaryElements?.staticElement;
+    var getter = scope.resolveInterfaceGet(element, auxiliary);
+    var setter = scope.resolveInterfaceSet(element, auxiliary);
+    Expression target = node.target;
+    if (node.isCascaded) {
+      return PropertyAccessor.make(makeCascadeReceiver(),
+          scope.buildName(node.propertyName), getter, setter);
+    } else if (node.target is SuperExpression) {
+      scope.addTransformerFlag(TransformerFlag.superCalls);
+      return new SuperPropertyAccessor(
+          scope.buildName(node.propertyName),
+          scope.resolveConcreteGet(element, auxiliary),
+          scope.resolveConcreteSet(element, auxiliary));
+    } else if (target is Identifier && target.staticElement is ClassElement) {
+      // Note that this case also covers null-aware static access on a class,
+      // which is equivalent to a regular static access.
+      return scope.staticAccess(node.propertyName.name, element, auxiliary);
+    } else if (node.operator.value() == '?.') {
+      return new NullAwarePropertyAccessor(
+          build(target),
+          scope.buildName(node.propertyName),
+          getter,
+          setter,
+          scope.buildType(node.staticType));
+    } else {
+      return PropertyAccessor.make(
+          build(target), scope.buildName(node.propertyName), getter, setter);
+    }
+  }
+
+  ast.Expression visitRethrowExpression(RethrowExpression node) {
+    return new ast.Rethrow();
+  }
+
+  ast.Expression visitSuperExpression(SuperExpression node) {
+    return scope
+        .emitCompileTimeError(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT);
+  }
+
+  ast.Expression visitThisExpression(ThisExpression node) {
+    return scope.buildThis();
+  }
+
+  ast.Expression visitThrowExpression(ThrowExpression node) {
+    return new ast.Throw(build(node.expression));
+  }
+
+  ast.Expression visitListLiteral(ListLiteral node) {
+    ast.DartType type = node.typeArguments?.arguments?.isNotEmpty ?? false
+        ? scope.buildTypeAnnotation(node.typeArguments.arguments[0])
+        : scope.getInferredTypeArgument(node, 0);
+    return new ast.ListLiteral(node.elements.map(build).toList(),
+        typeArgument: type, isConst: node.constKeyword != null);
+  }
+
+  ast.Expression visitMapLiteral(MapLiteral node) {
+    ast.DartType key, value;
+    if (node.typeArguments != null && node.typeArguments.arguments.length > 1) {
+      key = scope.buildTypeAnnotation(node.typeArguments.arguments[0]);
+      value = scope.buildTypeAnnotation(node.typeArguments.arguments[1]);
+    } else {
+      key = scope.getInferredTypeArgument(node, 0);
+      value = scope.getInferredTypeArgument(node, 1);
+    }
+    return new ast.MapLiteral(node.entries.map(buildMapEntry).toList(),
+        keyType: key, valueType: value, isConst: node.constKeyword != null);
+  }
+
+  ast.MapEntry buildMapEntry(MapLiteralEntry node) {
+    return new ast.MapEntry(build(node.key), build(node.value));
+  }
+
+  ast.Expression visitExpression(Expression node) {
+    return scope.internalError('Unhandled expression ${node.runtimeType}');
+  }
+}
+
+class StringLiteralPartBuilder extends GeneralizingAstVisitor<Null> {
+  final ExpressionScope scope;
+  final List<ast.Expression> output;
+  StringLiteralPartBuilder(this.scope, this.output);
+
+  void build(Expression node) {
+    node.accept(this);
+  }
+
+  void buildInterpolationElement(InterpolationElement node) {
+    node.accept(this);
+  }
+
+  visitSimpleStringLiteral(SimpleStringLiteral node) {
+    output.add(new ast.StringLiteral(node.value));
+  }
+
+  visitAdjacentStrings(AdjacentStrings node) {
+    node.strings.forEach(build);
+  }
+
+  visitStringInterpolation(StringInterpolation node) {
+    node.elements.forEach(buildInterpolationElement);
+  }
+
+  visitInterpolationString(InterpolationString node) {
+    output.add(new ast.StringLiteral(node.value));
+  }
+
+  visitInterpolationExpression(InterpolationExpression node) {
+    output.add(scope.buildExpression(node.expression));
+  }
+}
+
+class TypeAnnotationBuilder extends GeneralizingAstVisitor<ast.DartType> {
+  final TypeScope scope;
+
+  TypeAnnotationBuilder(this.scope);
+
+  ast.DartType build(AstNode node) {
+    return node.accept(this);
+  }
+
+  List<ast.DartType> buildList(Iterable<AstNode> node) {
+    return node.map(build).toList();
+  }
+
+  /// Replace unbound type variables in [type] with 'dynamic' and convert
+  /// to an [ast.DartType].
+  ast.DartType buildClosedTypeFromDartType(DartType type) {
+    return convertType(type, <TypeParameterElement>[]);
+  }
+
+  /// Convert to an [ast.DartType] and keep type variables.
+  ast.DartType buildFromDartType(DartType type) {
+    return convertType(type, null);
+  }
+
+  /// Converts [type] to an [ast.DartType], while replacing unbound type
+  /// variables with 'dynamic'.
+  ///
+  /// If [boundVariables] is null, no type variables are replaced, otherwise all
+  /// type variables except those in [boundVariables] are replaced.  In other
+  /// words, it represents the bound variables, or "all variables" if omitted.
+  ast.DartType convertType(
+      DartType type, List<TypeParameterElement> boundVariables) {
+    if (type is TypeParameterType) {
+      if (boundVariables == null || boundVariables.contains(type)) {
+        var typeParameter = scope.getTypeParameterReference(type.element);
+        if (!scope.allowClassTypeParameters &&
+            typeParameter.parent is ast.Class) {
+          return const ast.InvalidType();
+        }
+        return new ast.TypeParameterType(typeParameter);
+      } else {
+        return const ast.DynamicType();
+      }
+    } else if (type is InterfaceType) {
+      var classNode = scope.getClassReference(type.element);
+      if (type.typeArguments.length == 0) {
+        return new ast.InterfaceType(classNode);
+      }
+      if (type.typeArguments.length != classNode.typeParameters.length) {
+        log.warning('Type parameter arity error in $type');
+        return const ast.InvalidType();
+      }
+      return new ast.InterfaceType(
+          classNode, convertTypeList(type.typeArguments, boundVariables));
+    } else if (type is FunctionType) {
+      // TODO: Avoid infinite recursion in case of illegal circular typedef.
+      boundVariables?.addAll(type.typeParameters);
+      var positionals =
+          concatenate(type.normalParameterTypes, type.optionalParameterTypes);
+      var result = new ast.FunctionType(
+          convertTypeList(positionals, boundVariables),
+          convertType(type.returnType, boundVariables),
+          typeParameters:
+              convertTypeParameterList(type.typeFormals, boundVariables),
+          namedParameters:
+              convertTypeMap(type.namedParameterTypes, boundVariables),
+          requiredParameterCount: type.normalParameterTypes.length);
+      boundVariables?.removeRange(
+          boundVariables.length - type.typeParameters.length,
+          boundVariables.length);
+      return result;
+    } else if (type.isUndefined) {
+      log.warning('Unresolved type found in ${scope.location}');
+      return const ast.InvalidType();
+    } else if (type.isVoid) {
+      return const ast.VoidType();
+    } else if (type.isDynamic) {
+      return const ast.DynamicType();
+    } else {
+      log.severe('Unexpected DartType: $type');
+      return const ast.InvalidType();
+    }
+  }
+
+  static Iterable/*<E>*/ concatenate/*<E>*/(
+          Iterable/*<E>*/ x, Iterable/*<E>*/ y) =>
+      <Iterable<dynamic/*=E*/ >>[x, y].expand((z) => z);
+
+  ast.TypeParameter convertTypeParameter(TypeParameterElement typeParameter,
+      List<TypeParameterElement> boundVariables) {
+    return scope.makeTypeParameter(typeParameter,
+        bound: typeParameter.bound == null
+            ? scope.defaultTypeParameterBound
+            : convertType(typeParameter.bound, boundVariables));
+  }
+
+  List<ast.TypeParameter> convertTypeParameterList(
+      Iterable<TypeParameterElement> typeParameters,
+      List<TypeParameterElement> boundVariables) {
+    if (typeParameters.isEmpty) return const <ast.TypeParameter>[];
+    return typeParameters
+        .map((tp) => convertTypeParameter(tp, boundVariables))
+        .toList();
+  }
+
+  List<ast.DartType> convertTypeList(
+      Iterable<DartType> types, List<TypeParameterElement> boundVariables) {
+    if (types.isEmpty) return const <ast.DartType>[];
+    return types.map((t) => convertType(t, boundVariables)).toList();
+  }
+
+  List<ast.NamedType> convertTypeMap(
+      Map<String, DartType> types, List<TypeParameterElement> boundVariables) {
+    if (types.isEmpty) return const <ast.NamedType>[];
+    List<ast.NamedType> result = <ast.NamedType>[];
+    types.forEach((name, type) {
+      result.add(new ast.NamedType(name, convertType(type, boundVariables)));
+    });
+    sortAndRemoveDuplicates(result);
+    return result;
+  }
+
+  ast.DartType visitSimpleIdentifier(SimpleIdentifier node) {
+    Element element = node.staticElement;
+    switch (ElementKind.of(element)) {
+      case ElementKind.CLASS:
+        return new ast.InterfaceType(scope.getClassReference(element));
+
+      case ElementKind.DYNAMIC:
+        return const ast.DynamicType();
+
+      case ElementKind.FUNCTION_TYPE_ALIAS:
+        FunctionTypeAliasElement functionType = element;
+        return buildClosedTypeFromDartType(functionType.type);
+
+      case ElementKind.TYPE_PARAMETER:
+        var typeParameter = scope.getTypeParameterReference(element);
+        if (!scope.allowClassTypeParameters &&
+            typeParameter.parent is ast.Class) {
+          return const ast.InvalidType();
+        }
+        return new ast.TypeParameterType(typeParameter);
+
+      case ElementKind.COMPILATION_UNIT:
+      case ElementKind.CONSTRUCTOR:
+      case ElementKind.EXPORT:
+      case ElementKind.IMPORT:
+      case ElementKind.LABEL:
+      case ElementKind.LIBRARY:
+      case ElementKind.PREFIX:
+      case ElementKind.UNIVERSE:
+      case ElementKind.ERROR: // This covers the case where nothing was found.
+      case ElementKind.FIELD:
+      case ElementKind.TOP_LEVEL_VARIABLE:
+      case ElementKind.GETTER:
+      case ElementKind.SETTER:
+      case ElementKind.METHOD:
+      case ElementKind.LOCAL_VARIABLE:
+      case ElementKind.PARAMETER:
+      case ElementKind.FUNCTION:
+      case ElementKind.NAME:
+      default:
+        log.severe('Invalid type annotation: $element');
+        return const ast.InvalidType();
+    }
+  }
+
+  visitPrefixedIdentifier(PrefixedIdentifier node) {
+    return build(node.identifier);
+  }
+
+  visitTypeName(TypeName node) {
+    return buildFromDartType(node.type);
+  }
+
+  visitNode(AstNode node) {
+    log.severe('Unexpected type annotation: $node');
+    return new ast.InvalidType();
+  }
+}
+
+class InitializerBuilder extends GeneralizingAstVisitor<ast.Initializer> {
+  final MemberScope scope;
+
+  InitializerBuilder(this.scope);
+
+  ast.Initializer build(ConstructorInitializer node) {
+    return node.accept(this);
+  }
+
+  visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
+    var target = scope.resolveField(node.fieldName.staticElement);
+    if (target == null) {
+      return new ast.InvalidInitializer();
+    }
+    return new ast.FieldInitializer(
+        target, scope.buildExpression(node.expression));
+  }
+
+  visitSuperConstructorInvocation(SuperConstructorInvocation node) {
+    var target = scope.resolveConstructor(node.staticElement);
+    if (target == null) {
+      return new ast.InvalidInitializer();
+    }
+    scope.addTransformerFlag(TransformerFlag.superCalls);
+    return new ast.SuperInitializer(
+        target, scope._expressionBuilder.buildArguments(node.argumentList));
+  }
+
+  visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
+    var target = scope.resolveConstructor(node.staticElement);
+    if (target == null) {
+      return new ast.InvalidInitializer();
+    }
+    return new ast.RedirectingInitializer(
+        target, scope._expressionBuilder.buildArguments(node.argumentList));
+  }
+
+  visitNode(AstNode node) {
+    log.severe('Unexpected constructor initializer: ${node.runtimeType}');
+    return new ast.InvalidInitializer();
+  }
+}
+
+/// Brings a class from hierarchy level to body level.
+//
+// TODO(asgerf): Error recovery during class construction is currently handled
+//   locally, but this can in theory break global invariants in the kernel IR.
+//   To safely compile code with compile-time errors, we may need a recovery
+//   pass to enforce all kernel invariants before it is given to the backend.
+class ClassBodyBuilder extends GeneralizingAstVisitor<Null> {
+  final ClassScope scope;
+  final ExpressionScope annotationScope;
+  final ast.Class currentClass;
+  final ClassElement element;
+  ast.Library get currentLibrary => currentClass.enclosingLibrary;
+
+  ClassBodyBuilder(
+      ReferenceLevelLoader loader, ast.Class currentClass, this.element)
+      : this.currentClass = currentClass,
+        scope = new ClassScope(loader, currentClass.enclosingLibrary),
+        annotationScope =
+            new ExpressionScope(loader, currentClass.enclosingLibrary);
+
+  void build(CompilationUnitMember node) {
+    if (node == null) {
+      buildBrokenClass();
+      return;
+    }
+    node.accept(this);
+  }
+
+  /// Builds an empty class for broken classes that have no AST.
+  ///
+  /// This should only be used to recover from a compile-time error.
+  void buildBrokenClass() {
+    currentClass.name = element.name;
+    currentClass.supertype = scope.getRootClassReference().asRawSupertype;
+    currentClass.constructors.add(
+        new ast.Constructor(new ast.FunctionNode(new ast.InvalidStatement())));
+  }
+
+  void addAnnotations(List<Annotation> annotations) {
+    // Class type parameters are not in scope in the annotation list.
+    for (var annotation in annotations) {
+      currentClass.addAnnotation(annotationScope.buildAnnotation(annotation));
+    }
+  }
+
+  void _buildMemberBody(ast.Member member, Element element, AstNode node) {
+    new MemberBodyBuilder(scope.loader, member, element).build(node);
+  }
+
+  /// True if the given class member should not be emitted, and does not
+  /// correspond to any Kernel member.
+  ///
+  /// This is true for redirecting factories with a resolved target. These are
+  /// always bypassed at the call site.
+  bool _isIgnoredMember(ClassMember node) {
+    return node is ConstructorDeclaration &&
+        node.factoryKeyword != null &&
+        node.element.redirectedConstructor != null;
+  }
+
+  visitClassDeclaration(ClassDeclaration node) {
+    addAnnotations(node.metadata);
+    ast.Class classNode = currentClass;
+    assert(classNode.members.isEmpty); // All members will be added here.
+
+    bool foundConstructor = false;
+    for (var member in node.members) {
+      if (_isIgnoredMember(member)) continue;
+      if (member is FieldDeclaration) {
+        for (var variable in member.fields.variables) {
+          // Ignore fields inserted through error recovery.
+          if (variable.isSynthetic || variable.length == 0) continue;
+          var field = scope.getMemberReference(variable.element);
+          classNode.addMember(field);
+          _buildMemberBody(field, variable.element, variable);
+        }
+      } else {
+        var memberNode = scope.getMemberReference(member.element);
+        classNode.addMember(memberNode);
+        _buildMemberBody(memberNode, member.element, member);
+        if (member is ConstructorDeclaration) {
+          foundConstructor = true;
+        }
+      }
+    }
+
+    if (!foundConstructor) {
+      var defaultConstructor = scope.findDefaultConstructor(node.element);
+      if (defaultConstructor != null) {
+        assert(defaultConstructor.enclosingElement == node.element);
+        if (!defaultConstructor.isSynthetic) {
+          throw 'Non-synthetic default constructor not in list of members. '
+              '${node} $element $defaultConstructor';
+        }
+        var memberNode = scope.getMemberReference(defaultConstructor);
+        classNode.addMember(memberNode);
+        buildDefaultConstructor(memberNode, defaultConstructor);
+      }
+    }
+
+    addDefaultInstanceFieldInitializers(classNode);
+  }
+
+  void buildDefaultConstructor(
+      ast.Constructor constructor, ConstructorElement element) {
+    var function = constructor.function;
+    function.body = new ast.EmptyStatement()..parent = function;
+    var class_ = element.enclosingElement;
+    if (class_.supertype != null) {
+      // DESIGN TODO: If the super class is a mixin application, we will link to
+      // a constructor not in the immediate super class.  This is a problem due
+      // to the fact that mixed-in fields come with initializers which need to
+      // be executed by a constructor.  The mixin transformer takes care of
+      // this by making forwarding constructors and the super initializers will
+      // be rewritten to use them (see `transformations/mixin_full_resolution`).
+      var superConstructor =
+          scope.findDefaultConstructor(class_.supertype.element);
+      var target = scope.resolveConstructor(superConstructor);
+      if (target == null) {
+        constructor.initializers
+            .add(new ast.InvalidInitializer()..parent = constructor);
+      } else {
+        var arguments = new ast.Arguments.empty();
+        constructor.initializers.add(
+            new ast.SuperInitializer(target, arguments)..parent = constructor);
+      }
+    }
+  }
+
+  /// Adds initializers to instance fields that are have no initializer and are
+  /// not initialized by all constructors in the class.
+  void addDefaultInstanceFieldInitializers(ast.Class node) {
+    List<ast.Field> uninitializedFields = new List<ast.Field>();
+    for (var field in node.fields) {
+      if (field.initializer != null || field.isStatic) continue;
+      uninitializedFields.add(field);
+    }
+    if (uninitializedFields.isEmpty) return;
+    constructorLoop:
+    for (var constructor in node.constructors) {
+      var remainingFields = uninitializedFields.toSet();
+      for (var initializer in constructor.initializers) {
+        if (initializer is ast.FieldInitializer) {
+          remainingFields.remove(initializer.field);
+        } else if (initializer is ast.RedirectingInitializer) {
+          // The target constructor will be checked in another iteration.
+          continue constructorLoop;
+        }
+      }
+      for (var field in remainingFields) {
+        if (field.initializer == null) {
+          field.initializer = new ast.NullLiteral()..parent = field;
+        }
+      }
+    }
+  }
+
+  /// True for the `values` field of an `enum` class.
+  static bool _isValuesField(FieldElement field) => field.name == 'values';
+
+  /// True for the `index` field of an `enum` class.
+  static bool _isIndexField(FieldElement field) => field.name == 'index';
+
+  visitEnumDeclaration(EnumDeclaration node) {
+    addAnnotations(node.metadata);
+    ast.Class classNode = currentClass;
+    var intType =
+        new ast.InterfaceType(scope.loader.getCoreClassReference('int'));
+    var indexFieldElement = element.fields.firstWhere(_isIndexField);
+    ast.Field indexField = scope.getMemberReference(indexFieldElement);
+    indexField.type = intType;
+    classNode.addMember(indexField);
+    var parameter = new ast.VariableDeclaration('index', type: intType);
+    var function = new ast.FunctionNode(new ast.EmptyStatement(),
+        positionalParameters: [parameter]);
+    var superConstructor = scope.loader.getRootClassConstructorReference();
+    var constructor = new ast.Constructor(function,
+        name: new ast.Name(''),
+        isConst: true,
+        initializers: [
+          new ast.FieldInitializer(indexField, new ast.VariableGet(parameter)),
+          new ast.SuperInitializer(superConstructor, new ast.Arguments.empty())
+        ]);
+    classNode.addMember(constructor);
+    int index = 0;
+    var enumConstantFields = <ast.Field>[];
+    for (var constant in node.constants) {
+      ast.Field field = scope.getMemberReference(constant.element);
+      field.initializer = new ast.ConstructorInvocation(
+          constructor, new ast.Arguments([new ast.IntLiteral(index)]),
+          isConst: true)..parent = field;
+      field.type = new ast.InterfaceType(classNode);
+      classNode.addMember(field);
+      ++index;
+      enumConstantFields.add(field);
+    }
+    // Add the 'values' field.
+    var valuesFieldElement = element.fields.firstWhere(_isValuesField);
+    ast.Field valuesField = scope.getMemberReference(valuesFieldElement);
+    var enumType = new ast.InterfaceType(classNode);
+    valuesField.type = new ast.InterfaceType(
+        scope.loader.getCoreClassReference('List'), <ast.DartType>[enumType]);
+    valuesField.initializer = new ast.ListLiteral(
+        enumConstantFields.map(_makeStaticGet).toList(),
+        isConst: true,
+        typeArgument: enumType)..parent = valuesField;
+    classNode.addMember(valuesField);
+    // TODO: Add the toString method.
+  }
+
+  visitClassTypeAlias(ClassTypeAlias node) {
+    addAnnotations(node.metadata);
+    assert(node.withClause != null && node.withClause.mixinTypes.isNotEmpty);
+    ast.Class classNode = currentClass;
+    for (var constructor in element.constructors) {
+      var constructorNode = scope.getMemberReference(constructor);
+      classNode.addMember(constructorNode);
+      buildMixinConstructor(constructorNode, constructor);
+    }
+  }
+
+  void buildMixinConstructor(
+      ast.Constructor constructor, ConstructorElement element) {
+    var function = constructor.function;
+    function.body = new ast.EmptyStatement()..parent = function;
+    // Call the corresponding constructor in super class.
+    ClassElement classElement = element.enclosingElement;
+    var targetConstructor = classElement.supertype.element.constructors
+        .firstWhere((c) => c.name == element.name);
+    var positionalArguments = constructor.function.positionalParameters
+        .map(_makeVariableGet)
+        .toList();
+    var namedArguments = constructor.function.namedParameters
+        .map(_makeNamedExpressionFrom)
+        .toList();
+    constructor.initializers.add(new ast.SuperInitializer(
+        scope.getMemberReference(targetConstructor),
+        new ast.Arguments(positionalArguments, named: namedArguments))
+      ..parent = constructor);
+  }
+
+  visitNode(AstNode node) {
+    throw 'Unsupported class declaration: ${node.runtimeType}';
+  }
+}
+
+/// Brings a member from reference level to body level.
+class MemberBodyBuilder extends GeneralizingAstVisitor<Null> {
+  final MemberScope scope;
+  final Element element;
+  ast.Member get currentMember => scope.currentMember;
+
+  MemberBodyBuilder(
+      ReferenceLevelLoader loader, ast.Member member, this.element)
+      : scope = new MemberScope(loader, member);
+
+  void build(AstNode node) {
+    if (node != null) {
+      node.accept(this);
+    } else {
+      buildBrokenMember();
+    }
+  }
+
+  /// Builds an empty member.
+  ///
+  /// This should only be used to recover from a compile-time error.
+  void buildBrokenMember() {
+    var member = currentMember;
+    member.name = new ast.Name(element.name, scope.currentLibrary);
+    if (member is ast.Procedure) {
+      member.function = new ast.FunctionNode(new ast.InvalidStatement())
+        ..parent = member;
+    } else if (member is ast.Constructor) {
+      member.function = new ast.FunctionNode(new ast.InvalidStatement())
+        ..parent = member;
+    }
+  }
+
+  void addAnnotations(List<Annotation> annotations) {
+    for (var annotation in annotations) {
+      currentMember.addAnnotation(scope.buildAnnotation(annotation));
+    }
+  }
+
+  void handleNativeBody(FunctionBody body) {
+    if (body is NativeFunctionBody) {
+      currentMember.isExternal = true;
+      currentMember.addAnnotation(new ast.ConstructorInvocation(
+          scope.loader.getCoreClassConstructorReference('ExternalName',
+              library: 'dart:_internal'),
+          new ast.Arguments(<ast.Expression>[
+            new ast.StringLiteral(body.stringLiteral.stringValue)
+          ]),
+          isConst: true));
+    }
+  }
+
+  visitConstructorDeclaration(ConstructorDeclaration node) {
+    if (node.factoryKeyword != null) {
+      buildFactoryConstructor(node);
+    } else {
+      buildGenerativeConstructor(node);
+    }
+  }
+
+  void buildGenerativeConstructor(ConstructorDeclaration node) {
+    addAnnotations(node.metadata);
+    ast.Constructor constructor = currentMember;
+    constructor.function = scope.buildFunctionNode(node.parameters, node.body,
+        inferredReturnType: const ast.VoidType())..parent = constructor;
+    handleNativeBody(node.body);
+    if (node.body is EmptyFunctionBody && !constructor.isExternal) {
+      var function = constructor.function;
+      function.body = new ast.EmptyStatement()..parent = function;
+    }
+    for (var parameter in node.parameters.parameterElements) {
+      if (parameter is FieldFormalParameterElement) {
+        var initializer = new ast.FieldInitializer(
+            scope.getMemberReference(parameter.field),
+            new ast.VariableGet(scope.getVariableReference(parameter)));
+        constructor.initializers.add(initializer..parent = constructor);
+      }
+    }
+    bool hasExplicitConstructorCall = false;
+    for (var initializer in node.initializers) {
+      var node = scope.buildInitializer(initializer);
+      constructor.initializers.add(node..parent = constructor);
+      if (node is ast.SuperInitializer || node is ast.RedirectingInitializer) {
+        hasExplicitConstructorCall = true;
+      }
+    }
+    ClassElement classElement = node.element.enclosingElement;
+    if (classElement.supertype != null && !hasExplicitConstructorCall) {
+      ConstructorElement targetElement =
+          scope.findDefaultConstructor(classElement.supertype.element);
+      ast.Constructor target = scope.resolveConstructor(targetElement);
+      ast.Initializer initializer = target == null
+          ? new ast.InvalidInitializer()
+          : new ast.SuperInitializer(
+              target, new ast.Arguments(<ast.Expression>[]));
+      constructor.initializers.add(initializer..parent = constructor);
+    } else {
+      moveSuperInitializerLast(constructor);
+    }
+  }
+
+  void buildFactoryConstructor(ConstructorDeclaration node) {
+    addAnnotations(node.metadata);
+    ast.Procedure procedure = currentMember;
+    ClassElement classElement = node.element.enclosingElement;
+    ast.Class classNode = procedure.enclosingClass;
+    var types = getFreshTypeParameters(classNode.typeParameters);
+    for (int i = 0; i < classElement.typeParameters.length; ++i) {
+      scope.localTypeParameters[classElement.typeParameters[i]] =
+          types.freshTypeParameters[i];
+    }
+    var function = scope.buildFunctionNode(node.parameters, node.body,
+        typeParameters: types.freshTypeParameters,
+        inferredReturnType: new ast.InterfaceType(classNode,
+            types.freshTypeParameters.map(makeTypeParameterType).toList()));
+    procedure.function = function..parent = procedure;
+    handleNativeBody(node.body);
+    if (node.redirectedConstructor != null) {
+      // Redirecting factories with resolved targets don't show up here.
+      assert(node.element.redirectedConstructor == null);
+      var function = procedure.function;
+      var name = node.redirectedConstructor.type.name.name;
+      if (node.redirectedConstructor.name != null) {
+        name += '.' + node.redirectedConstructor.name.name;
+      }
+      // TODO(asgerf): Sometimes a TypeError should be thrown.
+      function.body = new ast.ExpressionStatement(
+          scope.buildThrowNoSuchMethodError(
+              new ast.NullLiteral(), name, new ast.Arguments.empty()))
+        ..parent = function;
+    }
+  }
+
+  visitMethodDeclaration(MethodDeclaration node) {
+    addAnnotations(node.metadata);
+    ast.Procedure procedure = currentMember;
+    procedure.function = scope.buildFunctionNode(node.parameters, node.body,
+        returnType: node.returnType,
+        inferredReturnType: scope.buildType(node.element.returnType),
+        typeParameters:
+            scope.buildOptionalTypeParameterList(node.typeParameters))
+      ..parent = procedure;
+    handleNativeBody(node.body);
+  }
+
+  visitVariableDeclaration(VariableDeclaration node) {
+    addAnnotations(node.metadata);
+    ast.Field field = currentMember;
+    field.type = scope.buildType(node.element.type);
+    if (node.initializer != null) {
+      field.initializer = scope.buildTopLevelExpression(node.initializer)
+        ..parent = field;
+    } else if (field.isStatic) {
+      // Add null initializer to static fields without an initializer.
+      // For instance fields, this is handled when building the class.
+      field.initializer = new ast.NullLiteral()..parent = field;
+    }
+  }
+
+  visitFunctionDeclaration(FunctionDeclaration node) {
+    var function = node.functionExpression;
+    ast.Procedure procedure = currentMember;
+    procedure.function = scope.buildFunctionNode(
+        function.parameters, function.body,
+        returnType: node.returnType,
+        typeParameters:
+            scope.buildOptionalTypeParameterList(function.typeParameters))
+      ..parent = procedure;
+    handleNativeBody(function.body);
+  }
+
+  visitNode(AstNode node) {
+    log.severe('Unexpected class or library member: $node');
+  }
+}
+
+/// Internal exception thrown from the expression or statement builder when a
+/// compilation error is found.
+///
+/// This is then caught at the function level to replace the entire function
+/// body (or field initializer) with a throw.
+class _CompilationError {
+  String message;
+
+  _CompilationError(this.message);
+}
+
+/// Constructor alias for [ast.TypeParameterType], use instead of a closure.
+ast.DartType makeTypeParameterType(ast.TypeParameter parameter) {
+  return new ast.TypeParameterType(parameter);
+}
+
+/// Constructor alias for [ast.VariableGet], use instead of a closure.
+ast.VariableGet _makeVariableGet(ast.VariableDeclaration variable) {
+  return new ast.VariableGet(variable);
+}
+
+/// Constructor alias for [ast.StaticGet], use instead of a closure.
+ast.StaticGet _makeStaticGet(ast.Field field) {
+  return new ast.StaticGet(field);
+}
+
+/// Create a named expression with the name and value of the given variable.
+ast.NamedExpression _makeNamedExpressionFrom(ast.VariableDeclaration variable) {
+  return new ast.NamedExpression(variable.name, new ast.VariableGet(variable));
+}
+
+/// A [StaticAccessor] that throws a NoSuchMethodError when a suitable target
+/// could not be resolved.
+class _StaticAccessor extends StaticAccessor {
+  final ExpressionScope scope;
+  final String name;
+
+  _StaticAccessor(
+      this.scope, this.name, ast.Member readTarget, ast.Member writeTarget)
+      : super(readTarget, writeTarget);
+
+  @override
+  makeInvalidRead() {
+    return scope.buildThrowNoSuchMethodError(
+        new ast.NullLiteral(), name, new ast.Arguments([]));
+  }
+
+  @override
+  makeInvalidWrite(ast.Expression value) {
+    return scope.buildThrowNoSuchMethodError(
+        new ast.NullLiteral(), name, new ast.Arguments([value]));
+  }
+}
+
+bool isTopLevelFunction(Element element) {
+  return element is FunctionElement &&
+      element.enclosingElement is CompilationUnitElement;
+}
+
+bool isLocalFunction(Element element) {
+  return element is FunctionElement &&
+      element.enclosingElement is! CompilationUnitElement &&
+      element.enclosingElement is! LibraryElement;
+}
+
+bool isLocal(Element element) {
+  return isLocalFunction(element) ||
+      element is LocalVariableElement ||
+      element is ParameterElement;
+}
+
+bool isInstanceMethod(Element element) {
+  return element is MethodElement && !element.isStatic;
+}
+
+bool isStaticMethod(Element element) {
+  return element is MethodElement && element.isStatic ||
+      isTopLevelFunction(element);
+}
+
+bool isStaticVariableOrGetter(Element element) {
+  element = desynthesizeGetter(element);
+  return element is FieldElement && element.isStatic ||
+      element is TopLevelVariableElement;
+}
+
+Element desynthesizeGetter(Element element) {
+  if (element == null || !element.isSynthetic) return element;
+  if (element is PropertyAccessorElement) return element.variable;
+  if (element is FieldElement) return element.getter;
+  return element;
+}
+
+Element desynthesizeSetter(Element element) {
+  if (element == null || !element.isSynthetic) return element;
+  if (element is PropertyAccessorElement) return element.variable;
+  if (element is FieldElement) return element.setter;
+  return element;
+}
+
+void sortAndRemoveDuplicates/*<T extends Comparable<T>>*/(List/*<T>*/ list) {
+  list.sort();
+  int deleted = 0;
+  for (int i = 1; i < list.length; ++i) {
+    var item = list[i];
+    if (list[i - 1].compareTo(item) == 0) {
+      ++deleted;
+    } else if (deleted > 0) {
+      list[i - deleted] = item;
+    }
+  }
+  if (deleted > 0) {
+    list.length -= deleted;
+  }
+}
diff --git a/pkg/kernel/lib/analyzer/loader.dart b/pkg/kernel/lib/analyzer/loader.dart
new file mode 100644
index 0000000..1591bcf
--- /dev/null
+++ b/pkg/kernel/lib/analyzer/loader.dart
@@ -0,0 +1,818 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.analyzer.loader;
+
+import 'dart:async';
+import 'dart:io' as io;
+
+import 'package:analyzer/analyzer.dart';
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/file_system/physical_file_system.dart';
+import 'package:analyzer/source/package_map_resolver.dart';
+import 'package:analyzer/src/dart/scanner/scanner.dart';
+import 'package:analyzer/src/dart/sdk/sdk.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/parser.dart';
+import 'package:analyzer/src/generated/sdk.dart';
+import 'package:analyzer/src/generated/source_io.dart';
+import 'package:package_config/discovery.dart';
+import 'package:package_config/packages.dart';
+
+import '../ast.dart' as ast;
+import '../repository.dart';
+import '../target/targets.dart' show Target;
+import '../type_algebra.dart';
+import 'analyzer.dart';
+import 'ast_from_analyzer.dart';
+
+/// Options passed to the Dart frontend.
+class DartOptions {
+  /// True if user code should be loaded in strong mode.
+  bool strongMode;
+
+  /// True if the Dart SDK should be loaded in strong mode.
+  bool strongModeSdk;
+  String sdk;
+  String packagePath;
+  Map<Uri, Uri> customUriMappings;
+  Map<String, String> declaredVariables;
+
+  DartOptions(
+      {bool strongMode: false,
+      bool strongModeSdk,
+      this.sdk,
+      this.packagePath,
+      Map<Uri, Uri> customUriMappings,
+      Map<String, String> declaredVariables})
+      : this.customUriMappings = customUriMappings ?? <Uri, Uri>{},
+        this.declaredVariables = declaredVariables ?? <String, String>{},
+        this.strongMode = strongMode,
+        this.strongModeSdk = strongModeSdk ?? strongMode;
+}
+
+abstract class ReferenceLevelLoader {
+  ast.Library getLibraryReference(LibraryElement element);
+  ast.Class getClassReference(ClassElement element);
+  ast.Member getMemberReference(Element element);
+  ast.Class getRootClassReference();
+  ast.Constructor getRootClassConstructorReference();
+  ast.Class getCoreClassReference(String className);
+  ast.Constructor getCoreClassConstructorReference(String className,
+      {String constructorName, String library});
+  ast.TypeParameter tryGetClassTypeParameter(TypeParameterElement element);
+  ast.Class getSharedMixinApplicationClass(
+      ast.Library library, ast.Class supertype, ast.Class mixin);
+  bool get strongMode;
+}
+
+class DartLoader implements ReferenceLevelLoader {
+  final Repository repository;
+  final Bimap<ClassElement, ast.Class> _classes =
+      new Bimap<ClassElement, ast.Class>();
+  final Bimap<Element, ast.Member> _members = new Bimap<Element, ast.Member>();
+  final Map<TypeParameterElement, ast.TypeParameter> _classTypeParameters =
+      <TypeParameterElement, ast.TypeParameter>{};
+  final Map<ast.Library, Map<String, ast.Class>> _mixinApplications =
+      <ast.Library, Map<String, ast.Class>>{};
+  final AnalysisContext context;
+  LibraryElement _dartCoreLibrary;
+  final List errors = [];
+  final List libraryElements = [];
+
+  /// Classes that have been referenced, and must be promoted to type level
+  /// so as not to expose partially initialized classes.
+  final List<ast.Class> temporaryClassWorklist = [];
+
+  LibraryElement _libraryBeingLoaded = null;
+
+  bool get strongMode => context.analysisOptions.strongMode;
+
+  DartLoader(this.repository, DartOptions options, Packages packages,
+      {DartSdk dartSdk})
+      : this.context = createContext(options, packages, dartSdk: dartSdk);
+
+  LibraryElement getLibraryElement(ast.Library node) {
+    return context
+        .getLibraryElement(context.sourceFactory.forUri2(node.importUri));
+  }
+
+  String getLibraryName(LibraryElement element) {
+    return element.name.isEmpty ? null : element.name;
+  }
+
+  ast.Library getLibraryReference(LibraryElement element) {
+    return repository.getLibraryReference(element.source.uri)
+      ..name ??= getLibraryName(element)
+      ..fileUri = "file://${element.source.fullName}";
+  }
+
+  void _buildTopLevelMember(ast.Member member, Element element) {
+    var astNode = element.computeNode();
+    assert(member.parent != null);
+    new MemberBodyBuilder(this, member, element).build(astNode);
+  }
+
+  /// True if [element] is in the process of being loaded by
+  /// [_buildLibraryBody].
+  ///
+  /// If this is the case, we should avoid adding new members to the classes
+  /// in the library, since the AST builder will rebuild the member lists.
+  bool isLibraryBeingLoaded(LibraryElement element) {
+    return _libraryBeingLoaded == element;
+  }
+
+  void _buildLibraryBody(LibraryElement element, ast.Library library) {
+    assert(_libraryBeingLoaded == null);
+    _libraryBeingLoaded = element;
+    var classes = <ast.Class>[];
+    var procedures = <ast.Procedure>[];
+    var fields = <ast.Field>[];
+    void loadClass(ClassElement classElement) {
+      var node = getClassReference(classElement);
+      promoteToBodyLevel(node);
+      classes.add(node);
+    }
+
+    void loadProcedure(Element memberElement) {
+      var node = getMemberReference(memberElement);
+      _buildTopLevelMember(node, memberElement);
+      procedures.add(node);
+    }
+
+    void loadField(Element memberElement) {
+      var node = getMemberReference(memberElement);
+      _buildTopLevelMember(node, memberElement);
+      fields.add(node);
+    }
+
+    for (var unit in element.units) {
+      unit.types.forEach(loadClass);
+      unit.enums.forEach(loadClass);
+      for (var accessor in unit.accessors) {
+        if (!accessor.isSynthetic) {
+          loadProcedure(accessor);
+        }
+      }
+      for (var function in unit.functions) {
+        loadProcedure(function);
+      }
+      for (var field in unit.topLevelVariables) {
+        // Ignore fields inserted through error recovery.
+        if (!field.isSynthetic && field.name != '') {
+          loadField(field);
+        }
+      }
+    }
+    libraryElements.add(element);
+    _iterateWorklist();
+    // Ensure everything is stored in the original declaration order.
+    library.classes
+      ..clear()
+      ..addAll(classes)
+      ..addAll(_mixinApplications[library]?.values ?? const []);
+    library.fields
+      ..clear()
+      ..addAll(fields);
+    library.procedures
+      ..clear()
+      ..addAll(procedures);
+    _libraryBeingLoaded = null;
+  }
+
+  LibraryElement getDartCoreLibrary() {
+    return _dartCoreLibrary ??= _findLibraryElement('dart:core');
+  }
+
+  LibraryElement _findLibraryElement(String uri) {
+    var source = context.sourceFactory.forUri(uri);
+    if (source == null) return null;
+    return context.computeLibraryElement(source);
+  }
+
+  ast.Class getRootClassReference() {
+    return getCoreClassReference('Object');
+  }
+
+  ast.Constructor getRootClassConstructorReference() {
+    var element = getDartCoreLibrary().getType('Object').constructors[0];
+    return getMemberReference(element);
+  }
+
+  ast.Class getCoreClassReference(String className) {
+    return getClassReference(getDartCoreLibrary().getType(className));
+  }
+
+  ast.Constructor getCoreClassConstructorReference(String className,
+      {String constructorName, String library}) {
+    LibraryElement libraryElement =
+        library != null ? _findLibraryElement(library) : getDartCoreLibrary();
+    ClassElement element = libraryElement.getType(className);
+    if (element == null) {
+      throw 'Missing core class $className from ${libraryElement.name}';
+    }
+    var constructor = element.constructors.firstWhere((constructor) {
+      return (constructorName == null)
+          ? (constructor.nameLength == 0)
+          : (constructor.name == constructorName);
+    });
+    return getMemberReference(constructor);
+  }
+
+  ClassElement getClassElement(ast.Class node) {
+    return _classes.inverse[node];
+  }
+
+  void addMixinClassToLibrary(ast.Class class_, ast.Library library) {
+    assert(class_.parent == null);
+    library.addClass(class_);
+    var map =
+        _mixinApplications.putIfAbsent(library, () => <String, ast.Class>{});
+    map[class_.name] = class_;
+  }
+
+  /// Returns the IR for a class, at a temporary loading level.
+  ///
+  /// The returned class has the correct name, flags, type parameter arity,
+  /// and enclosing library.
+  ast.Class getClassReference(ClassElement element) {
+    var classNode = _classes[element];
+    if (classNode != null) return classNode;
+    _classes[element] = classNode = new ast.Class(
+        name: element.name,
+        isAbstract: element.isAbstract,
+        fileUri: "file://${element.source.fullName}");
+    classNode.level = ast.ClassLevel.Temporary;
+    var library = getLibraryReference(element.library);
+    library.addClass(classNode);
+    // Initialize type parameter list without bounds.
+    for (var parameter in element.typeParameters) {
+      var parameterNode = new ast.TypeParameter(parameter.name);
+      _classTypeParameters[parameter] = parameterNode;
+      classNode.typeParameters.add(parameterNode);
+      parameterNode.parent = classNode;
+    }
+    // Ensure the class is at least promoted to type level before exposing it
+    // to kernel consumers.
+    temporaryClassWorklist.add(classNode);
+    return classNode;
+  }
+
+  /// Ensures the supertypes and type parameter bounds have been generated for
+  /// the given class.
+  void promoteToTypeLevel(ast.Class classNode) {
+    if (classNode.level.index >= ast.ClassLevel.Type.index) return;
+    classNode.level = ast.ClassLevel.Type;
+    var element = getClassElement(classNode);
+    assert(element != null);
+    var library = getLibraryReference(element.library);
+    var scope = new ClassScope(this, library);
+    // Initialize bounds on type parameters.
+    for (int i = 0; i < classNode.typeParameters.length; ++i) {
+      var parameter = element.typeParameters[i];
+      var parameterNode = classNode.typeParameters[i];
+      parameterNode.bound = parameter.bound == null
+          ? scope.defaultTypeParameterBound
+          : scope.buildType(parameter.bound);
+    }
+    // Initialize supertypes.
+    Iterable<InterfaceType> mixins = element.mixins;
+    if (element.isMixinApplication && mixins.isNotEmpty) {
+      classNode.mixedInType = scope.buildSupertype(mixins.last);
+      mixins = mixins.take(mixins.length - 1);
+    }
+    if (element.supertype != null) {
+      ast.Supertype supertype = scope.buildSupertype(element.supertype);
+      bool useSharedMixin = true;
+      for (var mixin in mixins) {
+        var mixinType = scope.buildSupertype(mixin);
+        if (useSharedMixin &&
+            areDistinctUnboundTypeVariables(supertype, mixinType)) {
+          // Use a shared mixin application class for this library.
+          var mixinClass = getSharedMixinApplicationClass(
+              scope.currentLibrary, supertype.classNode, mixinType.classNode);
+          supertype = new ast.Supertype(
+              mixinClass,
+              supertype.typeArguments.length > mixinType.typeArguments.length
+                  ? supertype.typeArguments
+                  : mixinType.typeArguments);
+        } else {
+          // Generate a new class specific for this mixin application.
+          var freshParameters =
+              getFreshTypeParameters(classNode.typeParameters);
+          var mixinClass = new ast.Class(
+              name: '${classNode.name}^${mixinType.classNode.name}',
+              isAbstract: true,
+              typeParameters: freshParameters.freshTypeParameters,
+              supertype: freshParameters.substituteSuper(supertype),
+              mixedInType: freshParameters.substituteSuper(mixinType));
+          mixinClass.level = ast.ClassLevel.Type;
+          supertype = new ast.Supertype(mixinClass,
+              classNode.typeParameters.map(makeTypeParameterType).toList());
+          addMixinClassToLibrary(mixinClass, classNode.enclosingLibrary);
+          // This class cannot be used from anywhere else, so don't try to
+          // generate shared mixin applications using it.
+          useSharedMixin = false;
+        }
+      }
+      classNode.supertype = supertype;
+      for (var implementedType in element.interfaces) {
+        classNode.implementedTypes.add(scope.buildSupertype(implementedType));
+      }
+    }
+  }
+
+  void promoteToHierarchyLevel(ast.Class classNode) {
+    if (classNode.level.index >= ast.ClassLevel.Hierarchy.index) return;
+    promoteToTypeLevel(classNode);
+    classNode.level = ast.ClassLevel.Hierarchy;
+    var element = getClassElement(classNode);
+    if (element != null) {
+      // Ensure all instance members are at present.
+      for (var field in element.fields) {
+        if (!field.isStatic && !field.isSynthetic) {
+          getMemberReference(field);
+        }
+      }
+      for (var accessor in element.accessors) {
+        if (!accessor.isStatic && !accessor.isSynthetic) {
+          getMemberReference(accessor);
+        }
+      }
+      for (var method in element.methods) {
+        if (!method.isStatic && !method.isSynthetic) {
+          getMemberReference(method);
+        }
+      }
+    }
+    for (var supertype in classNode.supers) {
+      promoteToHierarchyLevel(supertype.classNode);
+    }
+  }
+
+  void promoteToBodyLevel(ast.Class classNode) {
+    if (classNode.level == ast.ClassLevel.Body) return;
+    promoteToHierarchyLevel(classNode);
+    classNode.level = ast.ClassLevel.Body;
+    var element = getClassElement(classNode);
+    if (element == null) return;
+    var astNode = element.computeNode();
+    // Clear out the member references that were put in the class.
+    // The AST builder will load them all put back in the right order.
+    classNode..fields.clear()..procedures.clear()..constructors.clear();
+    new ClassBodyBuilder(this, classNode, element).build(astNode);
+  }
+
+  ast.TypeParameter tryGetClassTypeParameter(TypeParameterElement element) {
+    return _classTypeParameters[element];
+  }
+
+  Element getMemberElement(ast.Member node) {
+    return _members.inverse[node];
+  }
+
+  ast.Member getMemberReference(Element element) {
+    assert(element is! Member); // Use the "base element".
+    return _members[element] ??= _buildMemberReference(element);
+  }
+
+  ast.Member _buildMemberReference(Element element) {
+    var node = _buildOrphanedMemberReference(element);
+    // Set the parent pointer and store it in the enclosing class or library.
+    // If the enclosing library is being built from the AST, do not add the
+    // member, since the AST builder will put it in there.
+    var parent = element.enclosingElement;
+    if (parent is ClassElement) {
+      var class_ = getClassReference(parent);
+      node.parent = class_;
+      if (!isLibraryBeingLoaded(element.library)) {
+        class_.addMember(node);
+      }
+    } else {
+      var library = getLibraryReference(element.library);
+      node.parent = library;
+      if (!isLibraryBeingLoaded(element.library)) {
+        library.addMember(node);
+      }
+    }
+    return node;
+  }
+
+  ast.Member _buildOrphanedMemberReference(Element element) {
+    ClassElement classElement = element.enclosingElement is ClassElement
+        ? element.enclosingElement
+        : null;
+    TypeScope scope = classElement != null
+        ? new ClassScope(this, getLibraryReference(element.library))
+        : new TypeScope(this);
+    if (classElement != null) {
+      getClassReference(classElement);
+    }
+    switch (element.kind) {
+      case ElementKind.CONSTRUCTOR:
+        ConstructorElement constructor = element;
+        if (constructor.isFactory) {
+          return new ast.Procedure(
+              _nameOfMember(constructor),
+              ast.ProcedureKind.Factory,
+              scope.buildFunctionInterface(constructor),
+              isAbstract: false,
+              isStatic: true,
+              isExternal: constructor.isExternal,
+              isConst: constructor.isConst,
+              fileUri: "file://${element.source.fullName}");
+        }
+        return new ast.Constructor(scope.buildFunctionInterface(constructor),
+            name: _nameOfMember(element),
+            isConst: constructor.isConst,
+            isExternal: constructor.isExternal);
+
+      case ElementKind.FIELD:
+      case ElementKind.TOP_LEVEL_VARIABLE:
+        VariableElement variable = element;
+        return new ast.Field(_nameOfMember(variable),
+            isStatic: variable.isStatic,
+            isFinal: variable.isFinal,
+            isConst: variable.isConst,
+            type: scope.buildType(variable.type),
+            fileUri: "file://${element.source.fullName}")
+          ..fileOffset = element.nameOffset;
+
+      case ElementKind.METHOD:
+      case ElementKind.GETTER:
+      case ElementKind.SETTER:
+      case ElementKind.FUNCTION:
+        if (element is FunctionElement &&
+            element.enclosingElement is! CompilationUnitElement) {
+          throw 'Function $element is nested in ${element.enclosingElement} '
+              'and hence is not a member';
+        }
+        ExecutableElement executable = element;
+        return new ast.Procedure(
+            _nameOfMember(element),
+            _procedureKindOf(executable),
+            scope.buildFunctionInterface(executable),
+            isAbstract: executable.isAbstract,
+            isStatic: executable.isStatic,
+            isExternal: executable.isExternal,
+            fileUri: "file://${element.source.fullName}");
+
+      default:
+        throw 'Unexpected member kind: $element';
+    }
+  }
+
+  ast.ProcedureKind _procedureKindOf(ExecutableElement element) {
+    if (element is PropertyAccessorElement) {
+      return element.isGetter
+          ? ast.ProcedureKind.Getter
+          : ast.ProcedureKind.Setter;
+    }
+    if (element is MethodElement) {
+      if (element.isOperator) return ast.ProcedureKind.Operator;
+      return ast.ProcedureKind.Method;
+    }
+    if (element is FunctionElement) {
+      return ast.ProcedureKind.Method;
+    }
+    if (element is ConstructorElement) {
+      assert(element.isFactory);
+      return ast.ProcedureKind.Factory;
+    }
+    throw 'Unexpected procedure: $element';
+  }
+
+  ast.Name _nameOfMember(Element element) {
+    // Use 'displayName' to avoid a trailing '=' for setters and 'name' to
+    // ensure unary minus is called 'unary-'.
+    String name =
+        element is PropertyAccessorElement ? element.displayName : element.name;
+    return new ast.Name(name, getLibraryReference(element.library));
+  }
+
+  /// True if the two types have form `C<T1 ... Tm>` and `D<T1 ... Tn>`, and
+  /// `T1 ... TN` are distinct type variables with no upper bound, where
+  /// `N = max(m,n)`.
+  bool areDistinctUnboundTypeVariables(
+      ast.Supertype first, ast.Supertype second) {
+    var seen = new Set<ast.TypeParameter>();
+    if (first.typeArguments.length < second.typeArguments.length) {
+      var tmp = first;
+      first = second;
+      second = tmp;
+    }
+    for (int i = 0; i < first.typeArguments.length; ++i) {
+      var firstArg = first.typeArguments[i];
+      if (!(firstArg is ast.TypeParameterType &&
+          seen.add(firstArg.parameter) &&
+          firstArg.parameter.bound is ast.DynamicType)) {
+        return false;
+      }
+      if (i < second.typeArguments.length &&
+          firstArg != second.typeArguments[i]) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  /// Returns the canonical mixin application of two classes, instantiated with
+  /// the same list of unbound type variables.
+  ///
+  /// Given two classes:
+  ///     class C<C1 ... Cm>
+  ///     class D<D1 ... Dn>
+  ///
+  /// This creates or reuses a mixin application class in the library of form:
+  ///
+  ///     abstract class C&D<T1 ... TN> = C<T1 ... Tm> with D<T1 ... Tn>
+  ///
+  /// where `N = max(m,n)`.
+  ///
+  /// Such a class can in general contain type errors due to incompatible
+  /// inheritance from `C` and `D`.  This method therefore should only be called
+  /// if a mixin application `C<S1 ... Sm> with D<S1 ... Sn>` is seen, where
+  /// `S1 ... SN` are distinct, unbound type variables.
+  ast.Class getSharedMixinApplicationClass(
+      ast.Library library, ast.Class superclass, ast.Class mixedInClass) {
+    // TODO(asgerf): Avoid potential name clash due to associativity.
+    // As it is, these mixins get the same name:
+    //   (A with B) with C
+    //   A with (B with C)
+    String name = '${superclass.name}&${mixedInClass.name}';
+    return _mixinApplications
+        .putIfAbsent(library, () => <String, ast.Class>{})
+        .putIfAbsent(name, () {
+      var fresh =
+          superclass.typeParameters.length >= mixedInClass.typeParameters.length
+              ? getFreshTypeParameters(superclass.typeParameters)
+              : getFreshTypeParameters(mixedInClass.typeParameters);
+      var typeArguments =
+          fresh.freshTypeParameters.map(makeTypeParameterType).toList();
+      var superArgs = typeArguments.length != superclass.typeParameters.length
+          ? typeArguments.sublist(0, superclass.typeParameters.length)
+          : typeArguments;
+      var mixinArgs = typeArguments.length != mixedInClass.typeParameters.length
+          ? typeArguments.sublist(0, mixedInClass.typeParameters.length)
+          : typeArguments;
+      var result = new ast.Class(
+          name: name,
+          isAbstract: true,
+          typeParameters: fresh.freshTypeParameters,
+          supertype: new ast.Supertype(superclass, superArgs),
+          mixedInType: new ast.Supertype(mixedInClass, mixinArgs),
+          fileUri: mixedInClass.fileUri);
+      result.level = ast.ClassLevel.Type;
+      library.addClass(result);
+      return result;
+    });
+  }
+
+  String formatErrorMessage(
+      AnalysisError error, String filename, LineInfo lines) {
+    var location = lines.getLocation(error.offset);
+    return '[error] ${error.message} ($filename, '
+        'line ${location.lineNumber}, '
+        'col ${location.columnNumber})';
+  }
+
+  void ensureLibraryIsLoaded(ast.Library node) {
+    if (!node.isExternal) return;
+    node.isExternal = false;
+    var source = context.sourceFactory.forUri2(node.importUri);
+    assert(source != null);
+    var element = context.computeLibraryElement(source);
+    context.resolveCompilationUnit(source, element);
+    _buildLibraryBody(element, node);
+    if (node.importUri.scheme != 'dart') {
+      for (var unit in element.units) {
+        LineInfo lines;
+        for (var error in context.computeErrors(unit.source)) {
+          if (error.errorCode is CompileTimeErrorCode ||
+              error.errorCode is ParserErrorCode ||
+              error.errorCode is ScannerErrorCode ||
+              error.errorCode is StrongModeCode) {
+            lines ??= context.computeLineInfo(source);
+            errors.add(formatErrorMessage(error, source.shortName, lines));
+          }
+        }
+      }
+    }
+  }
+
+  void loadEverything({Target target}) {
+    ensureLibraryIsLoaded(getLibraryReference(getDartCoreLibrary()));
+    if (target != null) {
+      for (var uri in target.extraRequiredLibraries) {
+        var library = _findLibraryElement(uri);
+        if (library == null) {
+          errors.add('Could not find required library $uri');
+          continue;
+        }
+        ensureLibraryIsLoaded(getLibraryReference(library));
+      }
+    }
+    for (int i = 0; i < repository.libraries.length; ++i) {
+      ensureLibraryIsLoaded(repository.libraries[i]);
+    }
+  }
+
+  /// Builds a list of sources that have been loaded.
+  ///
+  /// This operation may be expensive and should only be used for diagnostics.
+  List<String> getLoadedFileNames() {
+    var list = <String>[];
+    for (var library in repository.libraries) {
+      LibraryElement element = context.computeLibraryElement(
+          context.sourceFactory.forUri2(library.importUri));
+      for (var unit in element.units) {
+        list.add(unit.source.fullName);
+      }
+    }
+    return list;
+  }
+
+  void _iterateWorklist() {
+    while (temporaryClassWorklist.isNotEmpty) {
+      var element = temporaryClassWorklist.removeLast();
+      promoteToTypeLevel(element);
+    }
+  }
+
+  ast.Program loadProgram(String mainLibrary, {Target target}) {
+    ast.Library library = repository.getLibrary(mainLibrary);
+    ensureLibraryIsLoaded(library);
+    loadEverything(target: target);
+    var program = new ast.Program(repository.libraries);
+    program.mainMethod = library.procedures.firstWhere(
+        (member) => member.name?.name == 'main',
+        orElse: () => null);
+    for (LibraryElement libraryElement in libraryElements) {
+      for (CompilationUnitElement compilationUnitElement
+          in libraryElement.units) {
+        // TODO(jensj): Get this another way?
+        LineInfo lineInfo = compilationUnitElement.computeNode().lineInfo;
+        program.uriToLineStarts[
+                "file://${compilationUnitElement.source.source.fullName}"] =
+            new List<int>.generate(lineInfo.lineCount, lineInfo.getOffsetOfLine,
+                growable: false);
+      }
+    }
+    return program;
+  }
+
+  ast.Library loadLibrary(String mainLibrary) {
+    ast.Library library = repository.getLibrary(mainLibrary);
+    ensureLibraryIsLoaded(library);
+    return library;
+  }
+}
+
+class Bimap<K, V> {
+  final Map<K, V> nodeMap = <K, V>{};
+  final Map<V, K> inverse = <V, K>{};
+
+  bool containsKey(K key) => nodeMap.containsKey(key);
+
+  V operator [](K key) => nodeMap[key];
+
+  void operator []=(K key, V value) {
+    assert(!nodeMap.containsKey(key));
+    nodeMap[key] = value;
+    inverse[value] = key;
+  }
+}
+
+/// Creates [DartLoader]s for a given configuration, while reusing the
+/// [DartSdk] and [Packages] object if possible.
+class DartLoaderBatch {
+  Packages packages;
+  DartSdk dartSdk;
+
+  String lastSdk;
+  String lastPackagePath;
+  bool lastStrongMode;
+
+  Future<DartLoader> getLoader(Repository repository, DartOptions options,
+      {String packageDiscoveryPath}) async {
+    if (dartSdk == null ||
+        lastSdk != options.sdk ||
+        lastStrongMode != options.strongMode) {
+      lastSdk = options.sdk;
+      lastStrongMode = options.strongMode;
+      dartSdk = createDartSdk(options.sdk, strongMode: options.strongModeSdk);
+    }
+    if (packages == null ||
+        lastPackagePath != options.packagePath ||
+        packageDiscoveryPath != null) {
+      lastPackagePath = options.packagePath;
+      packages = await createPackages(options.packagePath,
+          discoveryPath: packageDiscoveryPath);
+    }
+    return new DartLoader(repository, options, packages, dartSdk: dartSdk);
+  }
+}
+
+Future<Packages> createPackages(String packagePath,
+    {String discoveryPath}) async {
+  if (packagePath != null) {
+    var absolutePath = new io.File(packagePath).absolute.path;
+    if (await new io.Directory(packagePath).exists()) {
+      return getPackagesDirectory(new Uri.file(absolutePath));
+    } else if (await new io.File(packagePath).exists()) {
+      return loadPackagesFile(new Uri.file(absolutePath));
+    } else {
+      throw 'Packages not found: $packagePath';
+    }
+  }
+  if (discoveryPath != null) {
+    return findPackagesFromFile(Uri.parse(discoveryPath));
+  }
+  return Packages.noPackages;
+}
+
+AnalysisOptions createAnalysisOptions(bool strongMode) {
+  return new AnalysisOptionsImpl()
+    ..strongMode = strongMode
+    ..generateImplicitErrors = false
+    ..generateSdkErrors = false
+    ..preserveComments = false
+    ..hint = false
+    ..enableSuperMixins = true;
+}
+
+DartSdk createDartSdk(String path, {bool strongMode}) {
+  var resources = PhysicalResourceProvider.INSTANCE;
+  return new FolderBasedDartSdk(resources, resources.getFolder(path))
+    ..context
+        .analysisOptions
+        .setCrossContextOptionsFrom(createAnalysisOptions(strongMode));
+}
+
+class CustomUriResolver extends UriResolver {
+  final ResourceUriResolver _resourceUriResolver;
+  final Map<Uri, Uri> _customUrlMappings;
+
+  CustomUriResolver(this._resourceUriResolver, this._customUrlMappings);
+
+  Source resolveAbsolute(Uri uri, [Uri actualUri]) {
+    // TODO(kustermann): Once dartk supports configurable imports we should be
+    // able to get rid of this.
+    if (uri.toString() == 'package:mojo/src/internal_contract.dart') {
+      uri = actualUri = Uri.parse('dart:mojo.internal');
+    }
+
+    Uri baseUri = uri;
+    String relative;
+    String path = uri.path;
+    int index = path.indexOf('/');
+    if (index > 0) {
+      baseUri = uri.replace(path: path.substring(0, index));
+      relative = path.substring(index + 1);
+    }
+    Uri baseMapped = _customUrlMappings[baseUri];
+    if (baseMapped == null) return null;
+
+    Uri mapped = relative != null ? baseMapped.resolve(relative) : baseMapped;
+    return _resourceUriResolver.resolveAbsolute(mapped, actualUri);
+  }
+
+  Uri restoreAbsolute(Source source) {
+    return _resourceUriResolver.restoreAbsolute(source);
+  }
+}
+
+AnalysisContext createContext(DartOptions options, Packages packages,
+    {DartSdk dartSdk}) {
+  dartSdk ??= createDartSdk(options.sdk, strongMode: options.strongModeSdk);
+
+  var resourceProvider = PhysicalResourceProvider.INSTANCE;
+  var resourceUriResolver = new ResourceUriResolver(resourceProvider);
+  List<UriResolver> resolvers = [];
+  var customUriMappings = options.customUriMappings;
+  if (customUriMappings != null && customUriMappings.length > 0) {
+    resolvers
+        .add(new CustomUriResolver(resourceUriResolver, customUriMappings));
+  }
+  resolvers.add(new DartUriResolver(dartSdk));
+  resolvers.add(resourceUriResolver);
+
+  if (packages != null) {
+    var folderMap = <String, List<Folder>>{};
+    packages.asMap().forEach((String packagePath, Uri uri) {
+      String path = resourceProvider.pathContext.fromUri(uri);
+      folderMap[packagePath] = [resourceProvider.getFolder(path)];
+    });
+    resolvers.add(new PackageMapUriResolver(resourceProvider, folderMap));
+  }
+
+  AnalysisContext context = AnalysisEngine.instance.createAnalysisContext()
+    ..sourceFactory = new SourceFactory(resolvers)
+    ..analysisOptions = createAnalysisOptions(options.strongMode);
+
+  options.declaredVariables.forEach((String name, String value) {
+    context.declaredVariables.define(name, value);
+  });
+
+  return context;
+}
diff --git a/pkg/kernel/lib/analyzer/readme.md b/pkg/kernel/lib/analyzer/readme.md
new file mode 100644
index 0000000..5c49769
--- /dev/null
+++ b/pkg/kernel/lib/analyzer/readme.md
@@ -0,0 +1 @@
+A frontend using the Dart analyzer.
diff --git a/pkg/kernel/lib/ast.dart b/pkg/kernel/lib/ast.dart
new file mode 100644
index 0000000..0cece08
--- /dev/null
+++ b/pkg/kernel/lib/ast.dart
@@ -0,0 +1,3651 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// -----------------------------------------------------------------------
+///                           ERROR HANDLING
+/// -----------------------------------------------------------------------
+///
+/// As a rule of thumb, errors that can be detected statically are handled by
+/// the frontend, typically by translating the erroneous code into a 'throw' or
+/// a call to 'noSuchMethod'.
+///
+/// For example, there are no arity mismatches in static invocations, and
+/// there are no direct invocations of a constructor on a abstract class.
+///
+/// -----------------------------------------------------------------------
+///                           STATIC vs TOP-LEVEL
+/// -----------------------------------------------------------------------
+///
+/// The term `static` includes both static class members and top-level members.
+///
+/// "Static class member" is the preferred term for non-top level statics.
+///
+/// Static class members are not lifted to the library level because mirrors
+/// and stack traces can observe that they are class members.
+///
+/// -----------------------------------------------------------------------
+///                                 PROCEDURES
+/// -----------------------------------------------------------------------
+///
+/// "Procedure" is an umbrella term for method, getter, setter, index-getter,
+/// index-setter, operator overloader, and factory constructor.
+///
+/// Generative constructors, field initializers, local functions are NOT
+/// procedures.
+///
+/// -----------------------------------------------------------------------
+///                               TRANSFORMATIONS
+/// -----------------------------------------------------------------------
+///
+/// AST transformations can be performed using [TreeNode.replaceWith] or the
+/// [Transformer] visitor class.
+///
+/// Use [Transformer] for bulk transformations that are likely to transform lots
+/// of nodes, and [TreeNode.replaceWith] for sparse transformations that mutate
+/// relatively few nodes.  Or use whichever is more convenient.
+///
+/// The AST can also be mutated by direct field manipulation, but the user then
+/// has to update parent pointers manually.
+///
+library kernel.ast;
+
+import 'visitor.dart';
+export 'visitor.dart';
+
+import 'type_propagation/type_propagation.dart';
+export 'type_propagation/type_propagation.dart';
+
+import 'transformations/flags.dart';
+import 'text/ast_to_text.dart';
+import 'type_algebra.dart';
+import 'type_environment.dart';
+
+/// Any type of node in the IR.
+abstract class Node {
+  const Node();
+
+  accept(Visitor v);
+  visitChildren(Visitor v);
+
+  /// Returns the textual representation of this node for use in debugging.
+  ///
+  /// [toString] should only be used for debugging and short-running test tools
+  /// as it can cause serious memory leaks.
+  ///
+  /// Synthetic names are cached globally to retain consistency across different
+  /// [toString] calls (hence the memory leak).
+  ///
+  /// Nodes that are named, such as [Class] and [Member], return their
+  /// (possibly synthesized) name, whereas other AST nodes return the complete
+  /// textual representation of their subtree.
+  String toString() => debugNodeToString(this);
+}
+
+/// A mutable AST node with a parent pointer.
+///
+/// This is anything other than [Name] and [DartType] nodes.
+abstract class TreeNode extends Node {
+  static int _hashCounter = 0;
+  final int hashCode = _hashCounter = (_hashCounter + 1) & 0x3fffffff;
+  static const int noOffset = -1;
+
+  TreeNode parent;
+
+  /// Offset in the source file it comes from. Valid values are from 0 and up,
+  /// or -1 ([noOffset]) if the file offset is not available
+  /// (this is the default if none is specifically set).
+  int fileOffset = noOffset;
+
+  accept(TreeVisitor v);
+  visitChildren(Visitor v);
+  transformChildren(Transformer v);
+
+  /// Replaces [child] with [replacement].
+  ///
+  /// The caller is responsible for ensuring that the AST remains a tree.  In
+  /// particular, [replacement] should be an orphan or be part of an orphaned
+  /// subtree.
+  ///
+  /// Has no effect if [child] is not actually a child of this node.
+  ///
+  /// If [replacement] is `null`, this will [remove] the [child] node.
+  void replaceChild(TreeNode child, TreeNode replacement) {
+    transformChildren(new _ChildReplacer(child, replacement));
+  }
+
+  /// Inserts another node in place of this one.
+  ///
+  /// The caller is responsible for ensuring that the AST remains a tree.  In
+  /// particular, [replacement] should be an orphan or be part of an orphaned
+  /// subtree.
+  ///
+  /// If [replacement] is `null`, this will [remove] the node.
+  void replaceWith(TreeNode replacement) {
+    parent.replaceChild(this, replacement);
+    parent = null;
+  }
+
+  /// Removes this node from the [List] it is currently stored in, or assigns
+  /// `null` to the field on the parent currently pointing to the node.
+  ///
+  /// Has no effect if the node is orphaned or if the parent pointer is stale.
+  void remove() {
+    parent?.replaceChild(this, null);
+    parent = null;
+  }
+
+  Program get enclosingProgram => parent?.enclosingProgram;
+
+  /// Returns the best known source location of the given AST node, or `null` if
+  /// the node is orphaned.
+  ///
+  /// This getter is intended for diagnostics and debugging, and should be
+  /// avoided in production code.
+  Location get location {
+    if (fileOffset == noOffset) return parent?.location;
+    return _getLocationInEnclosingFile(fileOffset);
+  }
+
+  Location _getLocationInEnclosingFile(int offset) {
+    return parent?._getLocationInEnclosingFile(offset);
+  }
+}
+
+// ------------------------------------------------------------------------
+//                      LIBRARIES and CLASSES
+// ------------------------------------------------------------------------
+
+class Library extends TreeNode implements Comparable<Library> {
+  /// An absolute import path to this library.
+  ///
+  /// The [Uri] should have the `dart`, `package`, or `file` scheme.
+  Uri importUri;
+
+  /// The uri of the source file this library was loaded from.
+  String fileUri;
+
+  /// If true, the library is part of another build unit and its contents
+  /// are only partially loaded.
+  ///
+  /// Classes of an external library are loaded at one of the [ClassLevel]s
+  /// other than [ClassLevel.Body].  Members in an external library have no
+  /// body, but have their typed interface present.
+  ///
+  /// If the libary is non-external, then its classes are at [ClassLevel.Body]
+  /// and all members are loaded.
+  bool isExternal;
+
+  String name;
+  final List<Class> classes;
+  final List<Procedure> procedures;
+  final List<Field> fields;
+
+  Library(this.importUri,
+      {this.name,
+      this.isExternal: false,
+      List<Class> classes,
+      List<Procedure> procedures,
+      List<Field> fields})
+      : this.classes = classes ?? <Class>[],
+        this.procedures = procedures ?? <Procedure>[],
+        this.fields = fields ?? <Field>[] {
+    setParents(this.classes, this);
+    setParents(this.procedures, this);
+    setParents(this.fields, this);
+  }
+
+  /// Returns the top-level fields and procedures defined in this library.
+  ///
+  /// This getter is for convenience, not efficiency.  Consider manually
+  /// iterating the members to speed up code in production.
+  Iterable<Member> get members =>
+      <Iterable<Member>>[fields, procedures].expand((x) => x);
+
+  void addMember(Member member) {
+    member.parent = this;
+    if (member is Procedure) {
+      procedures.add(member);
+    } else if (member is Field) {
+      fields.add(member);
+    } else {
+      throw new ArgumentError(member);
+    }
+  }
+
+  void addClass(Class class_) {
+    class_.parent = this;
+    classes.add(class_);
+  }
+
+  accept(TreeVisitor v) => v.visitLibrary(this);
+
+  visitChildren(Visitor v) {
+    visitList(classes, v);
+    visitList(procedures, v);
+    visitList(fields, v);
+  }
+
+  transformChildren(Transformer v) {
+    transformList(classes, v, this);
+    transformList(procedures, v, this);
+    transformList(fields, v, this);
+  }
+
+  static int _libraryIdCounter = 0;
+  int _libraryId = ++_libraryIdCounter;
+
+  int compareTo(Library other) => _libraryId - other._libraryId;
+
+  /// Returns a possibly synthesized name for this library, consistent with
+  /// the names across all [toString] calls.
+  String toString() => debugLibraryName(this);
+
+  Location _getLocationInEnclosingFile(int offset) {
+    return enclosingProgram.getLocation(fileUri, offset);
+  }
+}
+
+/// The degree to which the contents of a class have been loaded into memory.
+///
+/// Each level imply the requirements of the previous ones.
+enum ClassLevel {
+  /// Temporary loading level for internal use by IR producers.  Consumers of
+  /// kernel code should not expect to see classes at this level.
+  Temporary,
+
+  /// The class may be used as a type, and it may contain members that are
+  /// referenced from this build unit.
+  ///
+  /// The type parameters and their bounds are present.
+  ///
+  /// There is no guarantee that all members are present.
+  ///
+  /// All supertypes of this class are at [Type] level or higher.
+  Type,
+
+  /// All instance members of the class are present.
+  ///
+  /// All supertypes of this class are at [Hierarchy] level or higher.
+  ///
+  /// This level exists so supertypes of a fully loaded class contain all the
+  /// members needed to detect override constraints.
+  Hierarchy,
+
+  /// All members of the class are fully loaded and are in the correct order.
+  ///
+  /// Annotations are present on classes and members.
+  ///
+  /// All supertypes of this class are at [Hierarchy] level or higher,
+  /// not necessarily at [Body] level.
+  Body,
+}
+
+/// Declaration of a regular class or a mixin application.
+///
+/// Mixin applications may not contain fields or procedures, as they implicitly
+/// use those from its mixed-in type.  However, the IR does not enforce this
+/// rule directly, as doing so can obstruct transformations.  It is possible to
+/// transform a mixin application to become a regular class, and vice versa.
+class Class extends TreeNode {
+  /// The degree to which the contents of the class have been loaded.
+  ClassLevel level = ClassLevel.Body;
+
+  /// List of metadata annotations on the class.
+  ///
+  /// This defaults to an immutable empty list. Use [addAnnotation] to add
+  /// annotations if needed.
+  List<Expression> annotations = const <Expression>[];
+
+  /// Name of the class.
+  ///
+  /// Must be non-null and must be unique within the library.
+  ///
+  /// The name may contain characters that are not valid in a Dart identifier,
+  /// in particular, the symbol '&' is used in class names generated for mixin
+  /// applications.
+  String name;
+  bool isAbstract;
+
+  /// The uri of the source file this class was loaded from.
+  String fileUri;
+
+  final List<TypeParameter> typeParameters;
+
+  /// The immediate super type, or `null` if this is the root class.
+  Supertype supertype;
+
+  /// The mixed-in type if this is a mixin application, otherwise `null`.
+  Supertype mixedInType;
+
+  /// The types from the `implements` clause.
+  final List<Supertype> implementedTypes;
+
+  /// Fields declared in the class.
+  ///
+  /// For mixin applications this should be empty.
+  final List<Field> fields;
+
+  /// Constructors declared in the class.
+  final List<Constructor> constructors;
+
+  /// Procedures declared in the class.
+  ///
+  /// For mixin applications this should be empty.
+  final List<Procedure> procedures;
+
+  Class(
+      {this.name,
+      this.isAbstract: false,
+      this.supertype,
+      this.mixedInType,
+      List<TypeParameter> typeParameters,
+      List<InterfaceType> implementedTypes,
+      List<Constructor> constructors,
+      List<Procedure> procedures,
+      List<Field> fields,
+      this.fileUri})
+      : this.typeParameters = typeParameters ?? <TypeParameter>[],
+        this.implementedTypes = implementedTypes ?? <Supertype>[],
+        this.fields = fields ?? <Field>[],
+        this.constructors = constructors ?? <Constructor>[],
+        this.procedures = procedures ?? <Procedure>[] {
+    setParents(this.typeParameters, this);
+    setParents(this.constructors, this);
+    setParents(this.procedures, this);
+    setParents(this.fields, this);
+  }
+
+  /// The immediate super class, or `null` if this is the root class.
+  Class get superclass => supertype?.classNode;
+
+  /// The mixed-in class if this is a mixin application, otherwise `null`.
+  ///
+  /// Note that this may itself be a mixin application.  Use [mixin] to get the
+  /// class that has the fields and procedures.
+  Class get mixedInClass => mixedInType?.classNode;
+
+  /// The class that declares the field and procedures of this class.
+  Class get mixin => mixedInClass?.mixin ?? this;
+
+  bool get isMixinApplication => mixedInType != null;
+
+  /// Members declared in this class.
+  ///
+  /// This getter is for convenience, not efficiency.  Consider manually
+  /// iterating the members to speed up code in production.
+  Iterable<Member> get members =>
+      <Iterable<Member>>[fields, constructors, procedures].expand((x) => x);
+
+  /// The immediately extended, mixed-in, and implemented types.
+  ///
+  /// This getter is for convenience, not efficiency.  Consider manually
+  /// iterating the super types to speed up code in production.
+  Iterable<Supertype> get supers => <Iterable<Supertype>>[
+        supertype == null ? const [] : [supertype],
+        mixedInType == null ? const [] : [mixedInType],
+        implementedTypes
+      ].expand((x) => x);
+
+  /// The library containing this class.
+  Library get enclosingLibrary => parent;
+
+  /// Adds a member to this class.
+  ///
+  /// Throws an error if attempting to add a field or procedure to a mixin
+  /// application.
+  void addMember(Member member) {
+    member.parent = this;
+    if (member is Constructor) {
+      constructors.add(member);
+    } else if (member is Procedure) {
+      procedures.add(member);
+    } else if (member is Field) {
+      fields.add(member);
+    } else {
+      throw new ArgumentError(member);
+    }
+  }
+
+  void addAnnotation(Expression node) {
+    if (annotations.isEmpty) {
+      annotations = <Expression>[];
+    }
+    annotations.add(node);
+    node.parent = this;
+  }
+
+  accept(TreeVisitor v) => v.visitClass(this);
+  acceptReference(Visitor v) => v.visitClassReference(this);
+
+  /// If true, the class is part of an external library, that is, it is defined
+  /// in another build unit.  Only a subset of its members are present.
+  ///
+  /// These classes should be loaded at either [ClassLevel.Type] or
+  /// [ClassLevel.Hierarchy] level.
+  bool get isInExternalLibrary => enclosingLibrary.isExternal;
+
+  Supertype get asRawSupertype {
+    return new Supertype(this,
+        new List<DartType>.filled(typeParameters.length, const DynamicType()));
+  }
+
+  Supertype get asThisSupertype {
+    return new Supertype(this, _getAsTypeArguments(typeParameters));
+  }
+
+  InterfaceType _rawType;
+  InterfaceType get rawType => _rawType ??= new InterfaceType(this);
+
+  InterfaceType _thisType;
+  InterfaceType get thisType {
+    return _thisType ??=
+        new InterfaceType(this, _getAsTypeArguments(typeParameters));
+  }
+
+  InterfaceType _bottomType;
+  InterfaceType get bottomType {
+    return _bottomType ??= new InterfaceType(this,
+        new List<DartType>.filled(typeParameters.length, const BottomType()));
+  }
+
+  /// Returns a possibly synthesized name for this class, consistent with
+  /// the names used across all [toString] calls.
+  String toString() => debugQualifiedClassName(this);
+
+  visitChildren(Visitor v) {
+    visitList(annotations, v);
+    visitList(typeParameters, v);
+    supertype?.accept(v);
+    mixedInType?.accept(v);
+    visitList(implementedTypes, v);
+    visitList(constructors, v);
+    visitList(procedures, v);
+    visitList(fields, v);
+  }
+
+  transformChildren(Transformer v) {
+    transformList(annotations, v, this);
+    transformList(typeParameters, v, this);
+    if (supertype != null) {
+      supertype = v.visitSupertype(supertype);
+    }
+    if (mixedInType != null) {
+      mixedInType = v.visitSupertype(mixedInType);
+    }
+    transformSupertypeList(implementedTypes, v);
+    transformList(constructors, v, this);
+    transformList(procedures, v, this);
+    transformList(fields, v, this);
+  }
+
+  Location _getLocationInEnclosingFile(int offset) {
+    return enclosingProgram.getLocation(fileUri, offset);
+  }
+}
+
+// ------------------------------------------------------------------------
+//                            MEMBERS
+// ------------------------------------------------------------------------
+
+/// A indirect reference to a member, which can be updated to point at another
+/// member at a later time.
+class _MemberAccessor {
+  Member target;
+  _MemberAccessor(this.target);
+}
+
+abstract class Member extends TreeNode {
+  /// List of metadata annotations on the member.
+  ///
+  /// This defaults to an immutable empty list. Use [addAnnotation] to add
+  /// annotations if needed.
+  List<Expression> annotations = const <Expression>[];
+  Name name;
+
+  /// Flags summarizing the kinds of AST nodes contained in this member, for
+  /// speeding up transformations that only affect certain types of nodes.
+  ///
+  /// See [TransformerFlag] for the meaning of each bit.
+  ///
+  /// These should not be used for any purpose other than skipping certain
+  /// members if it can be determined that no work is needed in there.
+  ///
+  /// It is valid for these flags to be false positives in rare cases, so
+  /// transformers must tolerate the case where a flag is spuriously set.
+  ///
+  /// This value is not serialized; it is populated by the frontend and the
+  /// deserializer.
+  //
+  // TODO(asgerf): It might be worthwhile to put this on classes as well.
+  int transformerFlags = 0;
+
+  Member(this.name);
+
+  Class get enclosingClass => parent is Class ? parent : null;
+  Library get enclosingLibrary => parent is Class ? parent.parent : parent;
+
+  accept(MemberVisitor v);
+  acceptReference(MemberReferenceVisitor v);
+
+  /// If true, the member is part of an external library, that is, it is defined
+  /// in another build unit.  Such members have no body or initializer present
+  /// in the IR.
+  bool get isInExternalLibrary => enclosingLibrary.isExternal;
+
+  /// Returns true if this is an abstract procedure.
+  bool get isAbstract => false;
+
+  /// True if this is a field or non-setter procedure.
+  ///
+  /// Note that operators and factories return `true`, even though there are
+  /// normally no calls to their getter.
+  bool get hasGetter;
+
+  /// True if this is a setter or a mutable field.
+  bool get hasSetter;
+
+  /// True if this is a non-static field or procedure.
+  bool get isInstanceMember;
+
+  /// True if the member has the `external` modifier, implying that the
+  /// implementation is provided by the backend, and is not necessarily written
+  /// in Dart.
+  ///
+  /// Members can have this modifier independently of whether the enclosing
+  /// library is external.
+  bool get isExternal;
+  void set isExternal(bool value);
+
+  /// The body of the procedure or constructor, or `null` if this is a field.
+  FunctionNode get function => null;
+
+  /// Returns a possibly synthesized name for this member, consistent with
+  /// the names used across all [toString] calls.
+  String toString() => debugQualifiedMemberName(this);
+
+  void addAnnotation(Expression node) {
+    if (annotations.isEmpty) {
+      annotations = <Expression>[];
+    }
+    annotations.add(node);
+    node.parent = this;
+  }
+
+  DartType get getterType;
+  DartType get setterType;
+
+  bool get containsSuperCalls {
+    return transformerFlags & TransformerFlag.superCalls != 0;
+  }
+
+  _MemberAccessor get _getterInterface;
+  _MemberAccessor get _setterInterface;
+}
+
+/// A field declaration.
+///
+/// The implied getter and setter for the field are not represented explicitly,
+/// but can be made explicit if needed.
+class Field extends Member {
+  _MemberAccessor _getterInterface, _setterInterface;
+
+  DartType type; // Not null. Defaults to DynamicType.
+  InferredValue inferredValue; // May be null.
+  int flags = 0;
+  Expression initializer; // May be null.
+
+  /// The uri of the source file this field was loaded from.
+  String fileUri;
+
+  Field(Name name,
+      {this.type: const DynamicType(),
+      this.inferredValue,
+      this.initializer,
+      bool isFinal: false,
+      bool isConst: false,
+      bool isStatic: false,
+      bool hasImplicitGetter,
+      bool hasImplicitSetter,
+      int transformerFlags: 0,
+      this.fileUri})
+      : super(name) {
+    _getterInterface = new _MemberAccessor(this);
+    _setterInterface = new _MemberAccessor(this);
+    assert(type != null);
+    initializer?.parent = this;
+    this.isFinal = isFinal;
+    this.isConst = isConst;
+    this.isStatic = isStatic;
+    this.hasImplicitGetter = hasImplicitGetter ?? !isStatic;
+    this.hasImplicitSetter = hasImplicitSetter ?? (!isStatic && !isFinal);
+    this.transformerFlags = transformerFlags;
+  }
+
+  static const int FlagFinal = 1 << 0; // Must match serialized bit positions.
+  static const int FlagConst = 1 << 1;
+  static const int FlagStatic = 1 << 2;
+  static const int FlagHasImplicitGetter = 1 << 3;
+  static const int FlagHasImplicitSetter = 1 << 4;
+
+  bool get isFinal => flags & FlagFinal != 0;
+  bool get isConst => flags & FlagConst != 0;
+  bool get isStatic => flags & FlagStatic != 0;
+
+  /// If true, a getter should be generated for this field.
+  ///
+  /// If false, there may or may not exist an explicit getter in the same class
+  /// with the same name as the field.
+  ///
+  /// By default, all non-static fields have implicit getters.
+  bool get hasImplicitGetter => flags & FlagHasImplicitGetter != 0;
+
+  /// If true, a setter should be generated for this field.
+  ///
+  /// If false, there may or may not exist an explicit setter in the same class
+  /// with the same name as the field.
+  ///
+  /// Final fields never have implicit setters, but a field without an implicit
+  /// setter is not necessarily final, as it may be mutated by direct field
+  /// access.
+  ///
+  /// By default, all non-static, non-final fields have implicit getters.
+  bool get hasImplicitSetter => flags & FlagHasImplicitSetter != 0;
+
+  void set isFinal(bool value) {
+    flags = value ? (flags | FlagFinal) : (flags & ~FlagFinal);
+  }
+
+  void set isConst(bool value) {
+    flags = value ? (flags | FlagConst) : (flags & ~FlagConst);
+  }
+
+  void set isStatic(bool value) {
+    flags = value ? (flags | FlagStatic) : (flags & ~FlagStatic);
+  }
+
+  void set hasImplicitGetter(bool value) {
+    flags = value
+        ? (flags | FlagHasImplicitGetter)
+        : (flags & ~FlagHasImplicitGetter);
+  }
+
+  void set hasImplicitSetter(bool value) {
+    flags = value
+        ? (flags | FlagHasImplicitSetter)
+        : (flags & ~FlagHasImplicitSetter);
+  }
+
+  /// True if the field is neither final nor const.
+  bool get isMutable => flags & (FlagFinal | FlagConst) == 0;
+  bool get isInstanceMember => !isStatic;
+  bool get hasGetter => true;
+  bool get hasSetter => isMutable;
+
+  bool get isExternal => false;
+  void set isExternal(bool value) {
+    if (value) throw 'Fields cannot be external';
+  }
+
+  accept(MemberVisitor v) => v.visitField(this);
+
+  acceptReference(MemberReferenceVisitor v) => v.visitFieldReference(this);
+
+  visitChildren(Visitor v) {
+    visitList(annotations, v);
+    type?.accept(v);
+    inferredValue?.accept(v);
+    name?.accept(v);
+    initializer?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    type = v.visitDartType(type);
+    transformList(annotations, v, this);
+    if (initializer != null) {
+      initializer = initializer.accept(v);
+      initializer?.parent = this;
+    }
+  }
+
+  DartType get getterType => type;
+  DartType get setterType => isMutable ? type : const BottomType();
+
+  /// Makes all [PropertyGet]s that have this field as its interface target
+  /// use [getter] as its interface target instead.
+  ///
+  /// That can be used to introduce an explicit getter for a field instead of
+  /// its implicit getter.
+  ///
+  /// This method only updates the stored interface target -- the caller must
+  /// ensure that [getter] actually becomes the target for dispatches that
+  /// would previously hit the implicit field getter.
+  ///
+  /// [DirectPropertyGet]s are not affected, and will continue to access the
+  /// field directly. [PropertyGet] nodes created after the call will not be
+  /// affected until the method is called again.
+  ///
+  /// Existing [ClassHierarchy] instances are not affected by this call.
+  void replaceGetterInterfaceWith(Procedure getter) {
+    _getterInterface.target = getter;
+    _getterInterface = new _MemberAccessor(this);
+  }
+
+  /// Makes all [PropertySet]s that have this field as its interface target
+  /// use [setter] as its interface target instead.
+  ///
+  /// That can be used to introduce an explicit setter for a field instead of
+  /// its implicit setter.
+  ///
+  /// This method only updates the stored interface target -- the caller must
+  /// ensure that [setter] actually becomes the target for dispatches that
+  /// would previously hit the implicit field setter.
+  ///
+  /// [DirectPropertySet] and [FieldInitializer]s are not affected, and will
+  /// continue to access the field directly.  [PropertySet] nodes created after
+  /// the call will not be affected until the method is called again.
+  ///
+  /// Existing [ClassHierarchy] instances are not affected by this call.
+  void replaceSetterInterfaceWith(Procedure setter) {
+    _setterInterface.target = setter;
+    _setterInterface = new _MemberAccessor(this);
+  }
+
+  Location _getLocationInEnclosingFile(int offset) {
+    return enclosingProgram.getLocation(fileUri, offset);
+  }
+}
+
+/// A generative constructor, possibly redirecting.
+///
+/// Note that factory constructors are treated as [Procedure]s.
+///
+/// Constructors do not take type parameters.  Type arguments from a constructor
+/// invocation should be matched with the type parameters declared in the class.
+///
+/// For unnamed constructors, the name is an empty string (in a [Name]).
+class Constructor extends Member {
+  int flags = 0;
+  FunctionNode function;
+  List<Initializer> initializers;
+
+  Constructor(this.function,
+      {Name name,
+      bool isConst: false,
+      bool isExternal: false,
+      List<Initializer> initializers,
+      int transformerFlags: 0})
+      : this.initializers = initializers ?? <Initializer>[],
+        super(name) {
+    function?.parent = this;
+    setParents(this.initializers, this);
+    this.isConst = isConst;
+    this.isExternal = isExternal;
+    this.transformerFlags = transformerFlags;
+  }
+
+  static const int FlagConst = 1 << 0; // Must match serialized bit positions.
+  static const int FlagExternal = 1 << 1;
+
+  bool get isConst => flags & FlagConst != 0;
+  bool get isExternal => flags & FlagExternal != 0;
+
+  void set isConst(bool value) {
+    flags = value ? (flags | FlagConst) : (flags & ~FlagConst);
+  }
+
+  void set isExternal(bool value) {
+    flags = value ? (flags | FlagExternal) : (flags & ~FlagExternal);
+  }
+
+  bool get isInstanceMember => false;
+  bool get hasGetter => false;
+  bool get hasSetter => false;
+
+  accept(MemberVisitor v) => v.visitConstructor(this);
+
+  acceptReference(MemberReferenceVisitor v) =>
+      v.visitConstructorReference(this);
+
+  visitChildren(Visitor v) {
+    visitList(annotations, v);
+    name?.accept(v);
+    function?.accept(v);
+    visitList(initializers, v);
+  }
+
+  transformChildren(Transformer v) {
+    transformList(annotations, v, this);
+    if (function != null) {
+      function = function.accept(v);
+      function?.parent = this;
+    }
+    transformList(initializers, v, this);
+  }
+
+  DartType get getterType => const BottomType();
+  DartType get setterType => const BottomType();
+
+  _MemberAccessor get _getterInterface {
+    throw 'Constructors cannot be used as getters';
+  }
+
+  _MemberAccessor get _setterInterface {
+    throw 'Constructors cannot be used as setters';
+  }
+}
+
+/// A method, getter, setter, index-getter, index-setter, operator overloader,
+/// or factory.
+///
+/// Procedures can have the static, abstract, and/or external modifier, although
+/// only the static and external modifiers may be used together.
+///
+/// For non-static procedures the name is required for dynamic dispatch.
+/// For external procedures the name is required for identifying the external
+/// implementation.
+///
+/// For methods, getters, and setters the name is just as it was declared.
+/// For setters this does not include a trailing `=`.
+/// For index-getters/setters, this is `[]` and `[]=`.
+/// For operators, this is the token for the operator, e.g. `+` or `==`,
+/// except for the unary minus operator, whose name is `unary-`.
+class Procedure extends Member {
+  _MemberAccessor _reference;
+  ProcedureKind kind;
+  int flags = 0;
+  FunctionNode function; // Body is null if and only if abstract or external.
+
+  /// The uri of the source file this procedure was loaded from.
+  String fileUri;
+
+  Procedure(Name name, this.kind, this.function,
+      {bool isAbstract: false,
+      bool isStatic: false,
+      bool isExternal: false,
+      bool isConst: false,
+      int transformerFlags: 0,
+      this.fileUri})
+      : super(name) {
+    _reference = new _MemberAccessor(this);
+    function?.parent = this;
+    this.isAbstract = isAbstract;
+    this.isStatic = isStatic;
+    this.isExternal = isExternal;
+    this.isConst = isConst;
+    this.transformerFlags = transformerFlags;
+  }
+
+  static const int FlagStatic = 1 << 0; // Must match serialized bit positions.
+  static const int FlagAbstract = 1 << 1;
+  static const int FlagExternal = 1 << 2;
+  static const int FlagConst = 1 << 3; // Only for external const factories.
+
+  bool get isStatic => flags & FlagStatic != 0;
+  bool get isAbstract => flags & FlagAbstract != 0;
+  bool get isExternal => flags & FlagExternal != 0;
+
+  /// True if this has the `const` modifier.  This is only possible for external
+  /// constant factories, such as `String.fromEnvironment`.
+  bool get isConst => flags & FlagConst != 0;
+
+  void set isStatic(bool value) {
+    flags = value ? (flags | FlagStatic) : (flags & ~FlagStatic);
+  }
+
+  void set isAbstract(bool value) {
+    flags = value ? (flags | FlagAbstract) : (flags & ~FlagAbstract);
+  }
+
+  void set isExternal(bool value) {
+    flags = value ? (flags | FlagExternal) : (flags & ~FlagExternal);
+  }
+
+  void set isConst(bool value) {
+    flags = value ? (flags | FlagConst) : (flags & ~FlagConst);
+  }
+
+  bool get isInstanceMember => !isStatic;
+  bool get isGetter => kind == ProcedureKind.Getter;
+  bool get isSetter => kind == ProcedureKind.Setter;
+  bool get isAccessor => isGetter || isSetter;
+  bool get hasGetter => kind != ProcedureKind.Setter;
+  bool get hasSetter => kind == ProcedureKind.Setter;
+
+  accept(MemberVisitor v) => v.visitProcedure(this);
+
+  acceptReference(MemberReferenceVisitor v) => v.visitProcedureReference(this);
+
+  visitChildren(Visitor v) {
+    visitList(annotations, v);
+    name?.accept(v);
+    function?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    transformList(annotations, v, this);
+    if (function != null) {
+      function = function.accept(v);
+      function?.parent = this;
+    }
+  }
+
+  DartType get getterType {
+    return isGetter ? function.returnType : function.functionType;
+  }
+
+  DartType get setterType {
+    return isSetter
+        ? function.positionalParameters[0].type
+        : const BottomType();
+  }
+
+  _MemberAccessor get _getterInterface => _reference;
+  _MemberAccessor get _setterInterface => _reference;
+}
+
+enum ProcedureKind {
+  Method,
+  Getter,
+  Setter,
+  Operator,
+  Factory,
+}
+
+// ------------------------------------------------------------------------
+//                     CONSTRUCTOR INITIALIZERS
+// ------------------------------------------------------------------------
+
+/// Part of an initializer list in a constructor.
+abstract class Initializer extends TreeNode {
+  accept(InitializerVisitor v);
+}
+
+/// An initializer with a compile-time error.
+///
+/// Should throw an exception at runtime.
+//
+// DESIGN TODO: The frontend should use this in a lot more cases to catch
+// invalid cases.
+class InvalidInitializer extends Initializer {
+  accept(InitializerVisitor v) => v.visitInvalidInitializer(this);
+
+  visitChildren(Visitor v) {}
+  transformChildren(Transformer v) {}
+}
+
+/// A field assignment `field = value` occurring in the initializer list of
+/// a constructor.
+///
+/// This node has nothing to do with declaration-site field initializers; those
+/// are [Expression]s stored in [Field.initializer].
+//
+// TODO: The frontend should check that all final fields are initialized
+//  exactly once, and that no fields are assigned twice in the initializer list.
+class FieldInitializer extends Initializer {
+  /// Reference to the field being initialized.  Not null.
+  Field field;
+  Expression value;
+
+  FieldInitializer(this.field, this.value) {
+    value?.parent = this;
+  }
+
+  accept(InitializerVisitor v) => v.visitFieldInitializer(this);
+
+  visitChildren(Visitor v) {
+    field?.acceptReference(v);
+    value?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (value != null) {
+      value = value.accept(v);
+      value?.parent = this;
+    }
+  }
+}
+
+/// A super call `super(x,y)` occurring in the initializer list of a
+/// constructor.
+///
+/// There are no type arguments on this call.
+//
+// TODO: The frontend should check that there is no more than one super call.
+//
+// DESIGN TODO: Consider if the frontend should insert type arguments derived
+// from the extends clause.
+class SuperInitializer extends Initializer {
+  /// Reference to the constructor being invoked in the super class. Not null.
+  Constructor target;
+  Arguments arguments;
+
+  SuperInitializer(this.target, this.arguments) {
+    arguments?.parent = this;
+  }
+
+  accept(InitializerVisitor v) => v.visitSuperInitializer(this);
+
+  visitChildren(Visitor v) {
+    target?.acceptReference(v);
+    arguments?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (arguments != null) {
+      arguments = arguments.accept(v);
+      arguments?.parent = this;
+    }
+  }
+}
+
+/// A redirecting call `this(x,y)` occurring in the initializer list of
+/// a constructor.
+//
+// TODO: The frontend should check that this is the only initializer and if the
+// constructor has a body or if there is a cycle in the initializer calls.
+class RedirectingInitializer extends Initializer {
+  /// Reference to the constructor being invoked in the same class. Not null.
+  Constructor target;
+  Arguments arguments;
+
+  RedirectingInitializer(this.target, this.arguments) {
+    arguments?.parent = this;
+  }
+
+  accept(InitializerVisitor v) => v.visitRedirectingInitializer(this);
+
+  visitChildren(Visitor v) {
+    target?.acceptReference(v);
+    arguments?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (arguments != null) {
+      arguments = arguments.accept(v);
+      arguments?.parent = this;
+    }
+  }
+}
+
+/// Binding of a temporary variable in the initializer list of a constructor.
+///
+/// The variable is in scope for the remainder of the initializer list, but is
+/// not in scope in the constructor body.
+class LocalInitializer extends Initializer {
+  VariableDeclaration variable;
+
+  LocalInitializer(this.variable) {
+    variable?.parent = this;
+  }
+
+  accept(InitializerVisitor v) => v.visitLocalInitializer(this);
+
+  visitChildren(Visitor v) {
+    variable?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (variable != null) {
+      variable = variable.accept(v);
+      variable?.parent = this;
+    }
+  }
+}
+
+// ------------------------------------------------------------------------
+//                            FUNCTIONS
+// ------------------------------------------------------------------------
+
+/// A function declares parameters and has a body.
+///
+/// This may occur in a procedure, constructor, function expression, or local
+/// function declaration.
+class FunctionNode extends TreeNode {
+  AsyncMarker asyncMarker;
+  List<TypeParameter> typeParameters;
+  int requiredParameterCount;
+  List<VariableDeclaration> positionalParameters;
+  List<VariableDeclaration> namedParameters;
+  InferredValue inferredReturnValue; // May be null.
+  DartType returnType; // Not null.
+  Statement body;
+
+  FunctionNode(this.body,
+      {List<TypeParameter> typeParameters,
+      List<VariableDeclaration> positionalParameters,
+      List<VariableDeclaration> namedParameters,
+      int requiredParameterCount,
+      this.returnType: const DynamicType(),
+      this.inferredReturnValue,
+      this.asyncMarker: AsyncMarker.Sync})
+      : this.positionalParameters =
+            positionalParameters ?? <VariableDeclaration>[],
+        this.requiredParameterCount =
+            requiredParameterCount ?? positionalParameters?.length ?? 0,
+        this.namedParameters = namedParameters ?? <VariableDeclaration>[],
+        this.typeParameters = typeParameters ?? <TypeParameter>[] {
+    assert(returnType != null);
+    setParents(this.typeParameters, this);
+    setParents(this.positionalParameters, this);
+    setParents(this.namedParameters, this);
+    body?.parent = this;
+  }
+
+  static DartType _getTypeOfVariable(VariableDeclaration node) => node.type;
+
+  static NamedType _getNamedTypeOfVariable(VariableDeclaration node) {
+    return new NamedType(node.name, node.type);
+  }
+
+  FunctionType get functionType {
+    TreeNode parent = this.parent;
+    List<NamedType> named =
+        namedParameters.map(_getNamedTypeOfVariable).toList(growable: false);
+    named.sort();
+    return new FunctionType(
+        positionalParameters.map(_getTypeOfVariable).toList(growable: false),
+        returnType,
+        namedParameters: named,
+        typeParameters: parent is Constructor
+            ? parent.enclosingClass.typeParameters
+            : typeParameters,
+        requiredParameterCount: requiredParameterCount);
+  }
+
+  accept(TreeVisitor v) => v.visitFunctionNode(this);
+
+  visitChildren(Visitor v) {
+    visitList(typeParameters, v);
+    visitList(positionalParameters, v);
+    visitList(namedParameters, v);
+    returnType?.accept(v);
+    inferredReturnValue?.accept(v);
+    body?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    transformList(typeParameters, v, this);
+    transformList(positionalParameters, v, this);
+    transformList(namedParameters, v, this);
+    returnType = v.visitDartType(returnType);
+    if (body != null) {
+      body = body.accept(v);
+      body?.parent = this;
+    }
+  }
+}
+
+enum AsyncMarker {
+  // Do not change the order of these, the frontends depend on it.
+  Sync,
+  SyncStar,
+  Async,
+  AsyncStar,
+
+  // `SyncYielding` is a marker that tells Dart VM that this function is an
+  // artificial closure introduced by an async transformer which desugared all
+  // async syntax into a combination of native yields and helper method calls.
+  //
+  // Native yields (formatted as `[yield]`) are semantically close to
+  // `yield x` statement: they denote a yield/resume point within a function
+  // but are completely decoupled from the notion of iterators. When
+  // execution of the closure reaches `[yield] x` it stops and return the
+  // value of `x` to the caller. If closure is called again it continues
+  // to the next statement after this yield as if it was suspended and resumed.
+  //
+  // Consider this example:
+  //
+  //   g() {
+  //     var :await_jump_var = 0;
+  //     var :await_ctx_var;
+  //
+  //     f(x) yielding {
+  //       [yield] '${x}:0';
+  //       [yield] '${x}:1';
+  //       [yield] '${x}:2';
+  //     }
+  //
+  //     return f;
+  //   }
+  //
+  //   print(f('a'));  /* prints 'a:0', :await_jump_var = 1  */
+  //   print(f('b'));  /* prints 'b:1', :await_jump_var = 2  */
+  //   print(f('c'));  /* prints 'c:2', :await_jump_var = 3  */
+  //
+  // Note: currently Dart VM implicitly relies on async transformer to
+  // inject certain artificial variables into g (like `:await_jump_var`).
+  // As such SyncYielding and native yield are not intended to be used on their
+  // own, but are rather an implementation artifact of the async transformer
+  // itself.
+  SyncYielding,
+}
+
+// ------------------------------------------------------------------------
+//                                EXPRESSIONS
+// ------------------------------------------------------------------------
+
+abstract class Expression extends TreeNode {
+  /// Returns the static type of the expression.
+  ///
+  /// Should only be used on code compiled in strong mode, as this method
+  /// assumes the IR is strongly typed.
+  DartType getStaticType(TypeEnvironment types);
+
+  /// Returns the static type of the expression as an instantiation of
+  /// [superclass].
+  ///
+  /// Should only be used on code compiled in strong mode, as this method
+  /// assumes the IR is strongly typed.
+  ///
+  /// This method futhermore assumes that the type of the expression actually
+  /// is a subtype of (some instantiation of) the given [superclass].
+  /// If this is not the case, either an exception is thrown or the raw type of
+  /// [superclass] is returned.
+  InterfaceType getStaticTypeAsInstanceOf(
+      Class superclass, TypeEnvironment types) {
+    // This method assumes the program is correctly typed, so if the superclass
+    // is not generic, we can just return its raw type without computing the
+    // type of this expression.  It also ensures that all types are considered
+    // subtypes of Object (not just interface types), and function types are
+    // considered subtypes of Function.
+    if (superclass.typeParameters.isEmpty) {
+      return superclass.rawType;
+    }
+    var type = getStaticType(types);
+    while (type is TypeParameterType) {
+      type = (type as TypeParameterType).parameter.bound;
+    }
+    if (type is InterfaceType) {
+      var upcastType = types.hierarchy.getTypeAsInstanceOf(type, superclass);
+      if (upcastType != null) return upcastType;
+    } else if (type is BottomType) {
+      return superclass.bottomType;
+    }
+    types.typeError(this, '$type is not a subtype of $superclass');
+    return superclass.rawType;
+  }
+
+  accept(ExpressionVisitor v);
+}
+
+/// An expression containing compile-time errors.
+///
+/// Should throw a runtime error when evaluated.
+class InvalidExpression extends Expression {
+  DartType getStaticType(TypeEnvironment types) => const BottomType();
+
+  accept(ExpressionVisitor v) => v.visitInvalidExpression(this);
+
+  visitChildren(Visitor v) {}
+  transformChildren(Transformer v) {}
+}
+
+/// Read a local variable, a local function, or a function parameter.
+class VariableGet extends Expression {
+  VariableDeclaration variable;
+  DartType promotedType; // Null if not promoted.
+
+  VariableGet(this.variable, [this.promotedType]);
+
+  DartType getStaticType(TypeEnvironment types) {
+    return promotedType ?? variable.type;
+  }
+
+  accept(ExpressionVisitor v) => v.visitVariableGet(this);
+
+  visitChildren(Visitor v) {
+    promotedType?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (promotedType != null) {
+      promotedType = v.visitDartType(promotedType);
+    }
+  }
+}
+
+/// Assign a local variable or function parameter.
+///
+/// Evaluates to the value of [value].
+class VariableSet extends Expression {
+  VariableDeclaration variable;
+  Expression value;
+
+  VariableSet(this.variable, this.value) {
+    value?.parent = this;
+  }
+
+  DartType getStaticType(TypeEnvironment types) => value.getStaticType(types);
+
+  accept(ExpressionVisitor v) => v.visitVariableSet(this);
+
+  visitChildren(Visitor v) {
+    value?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (value != null) {
+      value = value.accept(v);
+      value?.parent = this;
+    }
+  }
+}
+
+/// Expression of form `x.field`.
+///
+/// This may invoke a getter, read a field, or tear off a method.
+class PropertyGet extends Expression {
+  Expression receiver;
+  Name name;
+
+  _MemberAccessor _interfaceTargetReference;
+
+  PropertyGet(this.receiver, this.name, [Member interfaceTarget]) {
+    receiver?.parent = this;
+    this.interfaceTarget = interfaceTarget;
+  }
+
+  Member get interfaceTarget => _interfaceTargetReference?.target;
+
+  void set interfaceTarget(Member newTarget) {
+    _interfaceTargetReference = newTarget?._getterInterface;
+  }
+
+  DartType getStaticType(TypeEnvironment types) {
+    var interfaceTarget = this.interfaceTarget;
+    if (interfaceTarget != null) {
+      Class superclass = interfaceTarget.enclosingClass;
+      var receiverType = receiver.getStaticTypeAsInstanceOf(superclass, types);
+      return Substitution
+          .fromInterfaceType(receiverType)
+          .substituteType(interfaceTarget.getterType);
+    }
+    // Treat the properties of Object specially.
+    String nameString = name.name;
+    if (nameString == 'hashCode') {
+      return types.intType;
+    } else if (nameString == 'runtimeType') {
+      return types.typeType;
+    }
+    return const DynamicType();
+  }
+
+  accept(ExpressionVisitor v) => v.visitPropertyGet(this);
+
+  visitChildren(Visitor v) {
+    receiver?.accept(v);
+    name?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (receiver != null) {
+      receiver = receiver.accept(v);
+      receiver?.parent = this;
+    }
+  }
+}
+
+/// Expression of form `x.field = value`.
+///
+/// This may invoke a setter or assign a field.
+///
+/// Evaluates to the value of [value].
+class PropertySet extends Expression {
+  Expression receiver;
+  Name name;
+  Expression value;
+
+  _MemberAccessor _interfaceTargetReference;
+
+  PropertySet(this.receiver, this.name, this.value, [Member interfaceTarget]) {
+    receiver?.parent = this;
+    value?.parent = this;
+    this.interfaceTarget = interfaceTarget;
+  }
+
+  Member get interfaceTarget => _interfaceTargetReference?.target;
+
+  void set interfaceTarget(Member newTarget) {
+    _interfaceTargetReference = newTarget?._setterInterface;
+  }
+
+  DartType getStaticType(TypeEnvironment types) => value.getStaticType(types);
+
+  accept(ExpressionVisitor v) => v.visitPropertySet(this);
+
+  visitChildren(Visitor v) {
+    receiver?.accept(v);
+    name?.accept(v);
+    value?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (receiver != null) {
+      receiver = receiver.accept(v);
+      receiver?.parent = this;
+    }
+    if (value != null) {
+      value = value.accept(v);
+      value?.parent = this;
+    }
+  }
+}
+
+/// Directly read a field, call a getter, or tear off a method.
+class DirectPropertyGet extends Expression {
+  Expression receiver;
+  Member target;
+
+  DirectPropertyGet(this.receiver, this.target) {
+    receiver?.parent = this;
+  }
+
+  visitChildren(Visitor v) {
+    receiver?.accept(v);
+    target?.acceptReference(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (receiver != null) {
+      receiver = receiver.accept(v);
+      receiver?.parent = this;
+    }
+  }
+
+  accept(ExpressionVisitor v) => v.visitDirectPropertyGet(this);
+
+  DartType getStaticType(TypeEnvironment types) {
+    Class superclass = target.enclosingClass;
+    var receiverType = receiver.getStaticTypeAsInstanceOf(superclass, types);
+    return Substitution
+        .fromInterfaceType(receiverType)
+        .substituteType(target.getterType);
+  }
+}
+
+/// Directly assign a field, or call a setter.
+///
+/// Evaluates to the value of [value].
+class DirectPropertySet extends Expression {
+  Expression receiver;
+  Member target;
+  Expression value;
+
+  DirectPropertySet(this.receiver, this.target, this.value) {
+    receiver?.parent = this;
+    value?.parent = this;
+  }
+
+  visitChildren(Visitor v) {
+    receiver?.accept(v);
+    target?.acceptReference(v);
+    value?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (receiver != null) {
+      receiver = receiver.accept(v);
+      receiver?.parent = this;
+    }
+    if (value != null) {
+      value = value.accept(v);
+      value?.parent = this;
+    }
+  }
+
+  accept(ExpressionVisitor v) => v.visitDirectPropertySet(this);
+
+  DartType getStaticType(TypeEnvironment types) => value.getStaticType(types);
+}
+
+/// Directly call an instance method, bypassing ordinary dispatch.
+class DirectMethodInvocation extends Expression {
+  Expression receiver;
+  Procedure target;
+  Arguments arguments;
+
+  DirectMethodInvocation(this.receiver, this.target, this.arguments) {
+    receiver?.parent = this;
+    arguments?.parent = this;
+  }
+
+  visitChildren(Visitor v) {
+    receiver?.accept(v);
+    target?.acceptReference(v);
+    arguments?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (receiver != null) {
+      receiver = receiver.accept(v);
+      receiver?.parent = this;
+    }
+    if (arguments != null) {
+      arguments = arguments.accept(v);
+      arguments?.parent = this;
+    }
+  }
+
+  accept(ExpressionVisitor v) => v.visitDirectMethodInvocation(this);
+
+  DartType getStaticType(TypeEnvironment types) {
+    if (types.isOverloadedArithmeticOperator(target)) {
+      return types.getTypeOfOverloadedArithmetic(receiver.getStaticType(types),
+          arguments.positional[0].getStaticType(types));
+    }
+    Class superclass = target.enclosingClass;
+    var receiverType = receiver.getStaticTypeAsInstanceOf(superclass, types);
+    var returnType = Substitution
+        .fromInterfaceType(receiverType)
+        .substituteType(target.function.returnType);
+    return Substitution
+        .fromPairs(target.function.typeParameters, arguments.types)
+        .substituteType(returnType);
+  }
+}
+
+/// Expression of form `super.field`.
+///
+/// This may invoke a getter, read a field, or tear off a method.
+class SuperPropertyGet extends Expression {
+  Name name;
+  _MemberAccessor _interfaceTargetReference;
+
+  SuperPropertyGet(this.name, [Member interfaceTarget]) {
+    _interfaceTargetReference = interfaceTarget?._getterInterface;
+  }
+
+  Member get interfaceTarget => _interfaceTargetReference?.target;
+
+  void set interfaceTarget(Member newTarget) {
+    _interfaceTargetReference = newTarget?._getterInterface;
+  }
+
+  DartType getStaticType(TypeEnvironment types) {
+    Class declaringClass = interfaceTarget.enclosingClass;
+    if (declaringClass.typeParameters.isEmpty) {
+      return interfaceTarget.getterType;
+    }
+    var receiver =
+        types.hierarchy.getTypeAsInstanceOf(types.thisType, declaringClass);
+    return Substitution
+        .fromInterfaceType(receiver)
+        .substituteType(interfaceTarget.getterType);
+  }
+
+  accept(ExpressionVisitor v) => v.visitSuperPropertyGet(this);
+
+  visitChildren(Visitor v) {
+    name?.accept(v);
+  }
+
+  transformChildren(Transformer v) {}
+}
+
+/// Expression of form `super.field = value`.
+///
+/// This may invoke a setter or assign a field.
+///
+/// Evaluates to the value of [value].
+class SuperPropertySet extends Expression {
+  Name name;
+  Expression value;
+  _MemberAccessor _interfaceTargetReference;
+
+  SuperPropertySet(this.name, this.value, [Member interfaceTarget]) {
+    value?.parent = this;
+    _interfaceTargetReference = interfaceTarget?._setterInterface;
+  }
+
+  Member get interfaceTarget => _interfaceTargetReference?.target;
+
+  void set interfaceTarget(Member newTarget) {
+    _interfaceTargetReference = newTarget?._setterInterface;
+  }
+
+  DartType getStaticType(TypeEnvironment types) => value.getStaticType(types);
+
+  accept(ExpressionVisitor v) => v.visitSuperPropertySet(this);
+
+  visitChildren(Visitor v) {
+    name?.accept(v);
+    value?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (value != null) {
+      value = value.accept(v);
+      value?.parent = this;
+    }
+  }
+}
+
+/// Read a static field, call a static getter, or tear off a static method.
+class StaticGet extends Expression {
+  /// A static field, getter, or method (for tear-off).
+  Member target;
+
+  StaticGet(this.target);
+
+  DartType getStaticType(TypeEnvironment types) => target.getterType;
+
+  accept(ExpressionVisitor v) => v.visitStaticGet(this);
+
+  visitChildren(Visitor v) {
+    target?.acceptReference(v);
+  }
+
+  transformChildren(Transformer v) {}
+}
+
+/// Assign a static field or call a static setter.
+///
+/// Evaluates to the value of [value].
+class StaticSet extends Expression {
+  /// A mutable static field or a static setter.
+  Member target;
+  Expression value;
+
+  StaticSet(this.target, this.value) {
+    value?.parent = this;
+  }
+
+  DartType getStaticType(TypeEnvironment types) => value.getStaticType(types);
+
+  accept(ExpressionVisitor v) => v.visitStaticSet(this);
+
+  visitChildren(Visitor v) {
+    target?.acceptReference(v);
+    value?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (value != null) {
+      value = value.accept(v);
+      value?.parent = this;
+    }
+  }
+}
+
+/// The arguments to a function call, divided into type arguments,
+/// positional arguments, and named arguments.
+class Arguments extends TreeNode {
+  final List<DartType> types;
+  final List<Expression> positional;
+  final List<NamedExpression> named;
+
+  Arguments(this.positional,
+      {List<DartType> types, List<NamedExpression> named})
+      : this.types = types ?? <DartType>[],
+        this.named = named ?? <NamedExpression>[] {
+    setParents(this.positional, this);
+    setParents(this.named, this);
+  }
+
+  Arguments.empty()
+      : types = <DartType>[],
+        positional = <Expression>[],
+        named = <NamedExpression>[];
+
+  accept(TreeVisitor v) => v.visitArguments(this);
+
+  visitChildren(Visitor v) {
+    visitList(types, v);
+    visitList(positional, v);
+    visitList(named, v);
+  }
+
+  transformChildren(Transformer v) {
+    transformTypeList(types, v);
+    transformList(positional, v, this);
+    transformList(named, v, this);
+  }
+}
+
+/// A named argument, `name: value`.
+class NamedExpression extends TreeNode {
+  String name;
+  Expression value;
+
+  NamedExpression(this.name, this.value) {
+    value?.parent = this;
+  }
+
+  accept(TreeVisitor v) => v.visitNamedExpression(this);
+
+  visitChildren(Visitor v) {
+    value?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (value != null) {
+      value = value.accept(v);
+      value?.parent = this;
+    }
+  }
+}
+
+/// Common super class for [MethodInvocation], [SuperMethodInvocation],
+/// [StaticInvocation], and [ConstructorInvocation].
+abstract class InvocationExpression extends Expression {
+  Arguments get arguments;
+  set arguments(Arguments value);
+
+  /// Name of the invoked method.
+  ///
+  /// May be `null` if the target is a synthetic static member without a name.
+  Name get name;
+}
+
+/// Expression of form `x.foo(y)`.
+class MethodInvocation extends InvocationExpression {
+  Expression receiver;
+  Name name;
+  Arguments arguments;
+
+  Procedure interfaceTarget;
+
+  MethodInvocation(this.receiver, this.name, this.arguments,
+      [this.interfaceTarget]) {
+    receiver?.parent = this;
+    arguments?.parent = this;
+  }
+
+  DartType getStaticType(TypeEnvironment types) {
+    if (interfaceTarget != null) {
+      if (types.isOverloadedArithmeticOperator(interfaceTarget)) {
+        return types.getTypeOfOverloadedArithmetic(
+            receiver.getStaticType(types),
+            arguments.positional[0].getStaticType(types));
+      }
+      Class superclass = interfaceTarget.enclosingClass;
+      var receiverType = receiver.getStaticTypeAsInstanceOf(superclass, types);
+      var returnType = Substitution
+          .fromInterfaceType(receiverType)
+          .substituteType(interfaceTarget.function.returnType);
+      return Substitution
+          .fromPairs(interfaceTarget.function.typeParameters, arguments.types)
+          .substituteType(returnType);
+    }
+    if (name.name == 'call') {
+      var receiverType = receiver.getStaticType(types);
+      if (receiverType is FunctionType) {
+        if (receiverType.typeParameters.length != arguments.types.length) {
+          return const BottomType();
+        }
+        return Substitution
+            .fromPairs(receiverType.typeParameters, arguments.types)
+            .substituteType(receiverType.returnType);
+      }
+    }
+    if (name.name == '==') {
+      // We use this special case to simplify generation of '==' checks.
+      return types.boolType;
+    }
+    return const DynamicType();
+  }
+
+  accept(ExpressionVisitor v) => v.visitMethodInvocation(this);
+
+  visitChildren(Visitor v) {
+    receiver?.accept(v);
+    name?.accept(v);
+    arguments?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (receiver != null) {
+      receiver = receiver.accept(v);
+      receiver?.parent = this;
+    }
+    if (arguments != null) {
+      arguments = arguments.accept(v);
+      arguments?.parent = this;
+    }
+  }
+}
+
+/// Expression of form `super.foo(x)`.
+///
+/// The provided arguments might not match the parameters of the target.
+class SuperMethodInvocation extends InvocationExpression {
+  Name name;
+  Arguments arguments;
+
+  Member interfaceTarget;
+
+  SuperMethodInvocation(this.name, this.arguments, this.interfaceTarget) {
+    arguments?.parent = this;
+  }
+
+  DartType getStaticType(TypeEnvironment types) {
+    if (interfaceTarget == null) return const DynamicType();
+    Class superclass = interfaceTarget.enclosingClass;
+    var receiverType =
+        types.hierarchy.getTypeAsInstanceOf(types.thisType, superclass);
+    var returnType = Substitution
+        .fromInterfaceType(receiverType)
+        .substituteType(interfaceTarget.function.returnType);
+    return Substitution
+        .fromPairs(interfaceTarget.function.typeParameters, arguments.types)
+        .substituteType(returnType);
+  }
+
+  accept(ExpressionVisitor v) => v.visitSuperMethodInvocation(this);
+
+  visitChildren(Visitor v) {
+    name?.accept(v);
+    arguments?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (arguments != null) {
+      arguments = arguments.accept(v);
+      arguments?.parent = this;
+    }
+  }
+}
+
+/// Expression of form `foo(x)`, or `const foo(x)` if the target is an
+/// external constant factory.
+///
+/// The provided arguments might not match the parameters of the target.
+class StaticInvocation extends InvocationExpression {
+  Procedure target;
+  Arguments arguments;
+
+  /// True if this is a constant call to an external constant factory.
+  bool isConst;
+
+  Name get name => target?.name;
+
+  StaticInvocation(this.target, this.arguments, {this.isConst: false}) {
+    arguments?.parent = this;
+  }
+
+  DartType getStaticType(TypeEnvironment types) {
+    return Substitution
+        .fromPairs(target.function.typeParameters, arguments.types)
+        .substituteType(target.function.returnType);
+  }
+
+  accept(ExpressionVisitor v) => v.visitStaticInvocation(this);
+
+  visitChildren(Visitor v) {
+    target?.acceptReference(v);
+    arguments?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (arguments != null) {
+      arguments = arguments.accept(v);
+      arguments?.parent = this;
+    }
+  }
+}
+
+/// Expression of form `new Foo(x)` or `const Foo(x)`.
+///
+/// The provided arguments might not match the parameters of the target.
+//
+// DESIGN TODO: Should we pass type arguments in a separate field
+// `classTypeArguments`? They are quite different from type arguments to
+// generic functions.
+class ConstructorInvocation extends InvocationExpression {
+  Constructor target;
+  Arguments arguments;
+  bool isConst;
+
+  Name get name => target?.name;
+
+  ConstructorInvocation(this.target, this.arguments, {this.isConst: false}) {
+    arguments?.parent = this;
+  }
+
+  DartType getStaticType(TypeEnvironment types) {
+    return arguments.types.isEmpty
+        ? target.enclosingClass.rawType
+        : new InterfaceType(target.enclosingClass, arguments.types);
+  }
+
+  accept(ExpressionVisitor v) => v.visitConstructorInvocation(this);
+
+  visitChildren(Visitor v) {
+    target?.acceptReference(v);
+    arguments?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (arguments != null) {
+      arguments = arguments.accept(v);
+      arguments?.parent = this;
+    }
+  }
+
+  InterfaceType get constructedType {
+    return arguments.types.isEmpty
+        ? target.enclosingClass.rawType
+        : new InterfaceType(target.enclosingClass, arguments.types);
+  }
+}
+
+/// Expression of form `!x`.
+///
+/// The `is!` and `!=` operators are desugared into [Not] nodes with `is` and
+/// `==` expressions inside, respectively.
+class Not extends Expression {
+  Expression operand;
+
+  Not(this.operand) {
+    operand?.parent = this;
+  }
+
+  DartType getStaticType(TypeEnvironment types) => types.boolType;
+
+  accept(ExpressionVisitor v) => v.visitNot(this);
+
+  visitChildren(Visitor v) {
+    operand?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (operand != null) {
+      operand = operand.accept(v);
+      operand?.parent = this;
+    }
+  }
+}
+
+/// Expression of form `x && y` or `x || y`
+class LogicalExpression extends Expression {
+  Expression left;
+  String operator; // && or || or ??
+  Expression right;
+
+  LogicalExpression(this.left, this.operator, this.right) {
+    left?.parent = this;
+    right?.parent = this;
+  }
+
+  DartType getStaticType(TypeEnvironment types) => types.boolType;
+
+  accept(ExpressionVisitor v) => v.visitLogicalExpression(this);
+
+  visitChildren(Visitor v) {
+    left?.accept(v);
+    right?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (left != null) {
+      left = left.accept(v);
+      left?.parent = this;
+    }
+    if (right != null) {
+      right = right.accept(v);
+      right?.parent = this;
+    }
+  }
+}
+
+/// Expression of form `x ? y : z`.
+class ConditionalExpression extends Expression {
+  Expression condition;
+  Expression then;
+  Expression otherwise;
+
+  /// The static type of the expression. Should not be `null`.
+  DartType staticType;
+
+  ConditionalExpression(
+      this.condition, this.then, this.otherwise, this.staticType) {
+    condition?.parent = this;
+    then?.parent = this;
+    otherwise?.parent = this;
+  }
+
+  DartType getStaticType(TypeEnvironment types) => staticType;
+
+  accept(ExpressionVisitor v) => v.visitConditionalExpression(this);
+
+  visitChildren(Visitor v) {
+    condition?.accept(v);
+    then?.accept(v);
+    otherwise?.accept(v);
+    staticType?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (condition != null) {
+      condition = condition.accept(v);
+      condition?.parent = this;
+    }
+    if (then != null) {
+      then = then.accept(v);
+      then?.parent = this;
+    }
+    if (otherwise != null) {
+      otherwise = otherwise.accept(v);
+      otherwise?.parent = this;
+    }
+    if (staticType != null) {
+      staticType = v.visitDartType(staticType);
+    }
+  }
+}
+
+/// Convert expressions to strings and concatenate them.  Semantically, calls
+/// `toString` on every argument, checks that a string is returned, and returns
+/// the concatenation of all the strings.
+///
+/// If [expressions] is empty then an empty string is returned.
+///
+/// These arise from string interpolations and adjacent string literals.
+class StringConcatenation extends Expression {
+  final List<Expression> expressions;
+
+  StringConcatenation(this.expressions) {
+    setParents(expressions, this);
+  }
+
+  DartType getStaticType(TypeEnvironment types) => types.stringType;
+
+  accept(ExpressionVisitor v) => v.visitStringConcatenation(this);
+
+  visitChildren(Visitor v) {
+    visitList(expressions, v);
+  }
+
+  transformChildren(Transformer v) {
+    transformList(expressions, v, this);
+  }
+}
+
+/// Expression of form `x is T`.
+class IsExpression extends Expression {
+  Expression operand;
+  DartType type;
+
+  IsExpression(this.operand, this.type) {
+    operand?.parent = this;
+  }
+
+  DartType getStaticType(TypeEnvironment types) => types.boolType;
+
+  accept(ExpressionVisitor v) => v.visitIsExpression(this);
+
+  visitChildren(Visitor v) {
+    operand?.accept(v);
+    type?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (operand != null) {
+      operand = operand.accept(v);
+      operand?.parent = this;
+    }
+    type = v.visitDartType(type);
+  }
+}
+
+/// Expression of form `x as T`.
+class AsExpression extends Expression {
+  Expression operand;
+  DartType type;
+
+  AsExpression(this.operand, this.type) {
+    operand?.parent = this;
+  }
+
+  DartType getStaticType(TypeEnvironment types) => type;
+
+  accept(ExpressionVisitor v) => v.visitAsExpression(this);
+
+  visitChildren(Visitor v) {
+    operand?.accept(v);
+    type?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (operand != null) {
+      operand = operand.accept(v);
+      operand?.parent = this;
+    }
+    type = v.visitDartType(type);
+  }
+}
+
+/// An integer, double, boolean, string, or null constant.
+abstract class BasicLiteral extends Expression {
+  Object get value;
+
+  visitChildren(Visitor v) {}
+  transformChildren(Transformer v) {}
+}
+
+class StringLiteral extends BasicLiteral {
+  String value;
+
+  StringLiteral(this.value);
+
+  DartType getStaticType(TypeEnvironment types) => types.stringType;
+
+  accept(ExpressionVisitor v) => v.visitStringLiteral(this);
+}
+
+class IntLiteral extends BasicLiteral {
+  int value;
+
+  IntLiteral(this.value);
+
+  DartType getStaticType(TypeEnvironment types) => types.intType;
+
+  accept(ExpressionVisitor v) => v.visitIntLiteral(this);
+}
+
+class DoubleLiteral extends BasicLiteral {
+  double value;
+
+  DoubleLiteral(this.value);
+
+  DartType getStaticType(TypeEnvironment types) => types.doubleType;
+
+  accept(ExpressionVisitor v) => v.visitDoubleLiteral(this);
+}
+
+class BoolLiteral extends BasicLiteral {
+  bool value;
+
+  BoolLiteral(this.value);
+
+  DartType getStaticType(TypeEnvironment types) => types.boolType;
+
+  accept(ExpressionVisitor v) => v.visitBoolLiteral(this);
+}
+
+class NullLiteral extends BasicLiteral {
+  Object get value => null;
+
+  DartType getStaticType(TypeEnvironment types) => const BottomType();
+
+  accept(ExpressionVisitor v) => v.visitNullLiteral(this);
+}
+
+class SymbolLiteral extends Expression {
+  String value; // Everything strictly after the '#'.
+
+  SymbolLiteral(this.value);
+
+  DartType getStaticType(TypeEnvironment types) => types.symbolType;
+
+  accept(ExpressionVisitor v) => v.visitSymbolLiteral(this);
+
+  visitChildren(Visitor v) {}
+  transformChildren(Transformer v) {}
+}
+
+class TypeLiteral extends Expression {
+  DartType type;
+
+  TypeLiteral(this.type);
+
+  DartType getStaticType(TypeEnvironment types) => types.typeType;
+
+  accept(ExpressionVisitor v) => v.visitTypeLiteral(this);
+
+  visitChildren(Visitor v) {
+    type?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    type = v.visitDartType(type);
+  }
+}
+
+class ThisExpression extends Expression {
+  DartType getStaticType(TypeEnvironment types) => types.thisType;
+
+  accept(ExpressionVisitor v) => v.visitThisExpression(this);
+
+  visitChildren(Visitor v) {}
+  transformChildren(Transformer v) {}
+}
+
+class Rethrow extends Expression {
+  DartType getStaticType(TypeEnvironment types) => const BottomType();
+
+  accept(ExpressionVisitor v) => v.visitRethrow(this);
+
+  visitChildren(Visitor v) {}
+  transformChildren(Transformer v) {}
+}
+
+class Throw extends Expression {
+  Expression expression;
+
+  Throw(this.expression) {
+    expression?.parent = this;
+  }
+
+  DartType getStaticType(TypeEnvironment types) => const BottomType();
+
+  accept(ExpressionVisitor v) => v.visitThrow(this);
+
+  visitChildren(Visitor v) {
+    expression?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (expression != null) {
+      expression = expression.accept(v);
+      expression?.parent = this;
+    }
+  }
+}
+
+class ListLiteral extends Expression {
+  bool isConst;
+  DartType typeArgument; // Not null, defaults to DynamicType.
+  final List<Expression> expressions;
+
+  ListLiteral(this.expressions,
+      {this.typeArgument: const DynamicType(), this.isConst: false}) {
+    assert(typeArgument != null);
+    setParents(expressions, this);
+  }
+
+  DartType getStaticType(TypeEnvironment types) {
+    return types.literalListType(typeArgument);
+  }
+
+  accept(ExpressionVisitor v) => v.visitListLiteral(this);
+
+  visitChildren(Visitor v) {
+    typeArgument?.accept(v);
+    visitList(expressions, v);
+  }
+
+  transformChildren(Transformer v) {
+    typeArgument = v.visitDartType(typeArgument);
+    transformList(expressions, v, this);
+  }
+}
+
+class MapLiteral extends Expression {
+  bool isConst;
+  DartType keyType; // Not null, defaults to DynamicType.
+  DartType valueType; // Not null, defaults to DynamicType.
+  final List<MapEntry> entries;
+
+  MapLiteral(this.entries,
+      {this.keyType: const DynamicType(),
+      this.valueType: const DynamicType(),
+      this.isConst: false}) {
+    assert(keyType != null);
+    assert(valueType != null);
+    setParents(entries, this);
+  }
+
+  DartType getStaticType(TypeEnvironment types) {
+    return types.literalMapType(keyType, valueType);
+  }
+
+  accept(ExpressionVisitor v) => v.visitMapLiteral(this);
+
+  visitChildren(Visitor v) {
+    keyType?.accept(v);
+    valueType?.accept(v);
+    visitList(entries, v);
+  }
+
+  transformChildren(Transformer v) {
+    keyType = v.visitDartType(keyType);
+    valueType = v.visitDartType(valueType);
+    transformList(entries, v, this);
+  }
+}
+
+class MapEntry extends TreeNode {
+  Expression key;
+  Expression value;
+
+  MapEntry(this.key, this.value) {
+    key?.parent = this;
+    value?.parent = this;
+  }
+
+  accept(TreeVisitor v) => v.visitMapEntry(this);
+
+  visitChildren(Visitor v) {
+    key?.accept(v);
+    value?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (key != null) {
+      key = key.accept(v);
+      key?.parent = this;
+    }
+    if (value != null) {
+      value = value.accept(v);
+      value?.parent = this;
+    }
+  }
+}
+
+/// Expression of form `await x`.
+class AwaitExpression extends Expression {
+  Expression operand;
+
+  AwaitExpression(this.operand) {
+    operand?.parent = this;
+  }
+
+  DartType getStaticType(TypeEnvironment types) {
+    return types.unfutureType(operand.getStaticType(types));
+  }
+
+  accept(ExpressionVisitor v) => v.visitAwaitExpression(this);
+
+  visitChildren(Visitor v) {
+    operand?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (operand != null) {
+      operand = operand.accept(v);
+      operand?.parent = this;
+    }
+  }
+}
+
+/// Expression of form `(x,y) => ...` or `(x,y) { ... }`
+///
+/// The arrow-body form `=> e` is desugared into `return e;`.
+class FunctionExpression extends Expression {
+  FunctionNode function;
+
+  FunctionExpression(this.function) {
+    function?.parent = this;
+  }
+
+  DartType getStaticType(TypeEnvironment types) => function.functionType;
+
+  accept(ExpressionVisitor v) => v.visitFunctionExpression(this);
+
+  visitChildren(Visitor v) {
+    function?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (function != null) {
+      function = function.accept(v);
+      function?.parent = this;
+    }
+  }
+}
+
+/// Synthetic expression of form `let v = x in y`
+class Let extends Expression {
+  VariableDeclaration variable; // Must have an initializer.
+  Expression body;
+
+  Let(this.variable, this.body) {
+    variable?.parent = this;
+    body?.parent = this;
+  }
+
+  DartType getStaticType(TypeEnvironment types) => body.getStaticType(types);
+
+  accept(ExpressionVisitor v) => v.visitLet(this);
+
+  visitChildren(Visitor v) {
+    variable?.accept(v);
+    body?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (variable != null) {
+      variable = variable.accept(v);
+      variable?.parent = this;
+    }
+    if (body != null) {
+      body = body.accept(v);
+      body?.parent = this;
+    }
+  }
+}
+
+// ------------------------------------------------------------------------
+//                              STATEMENTS
+// ------------------------------------------------------------------------
+
+abstract class Statement extends TreeNode {
+  accept(StatementVisitor v);
+}
+
+/// A statement with a compile-time error.
+///
+/// Should throw an exception at runtime.
+class InvalidStatement extends Statement {
+  accept(StatementVisitor v) => v.visitInvalidStatement(this);
+
+  visitChildren(Visitor v) {}
+  transformChildren(Transformer v) {}
+}
+
+class ExpressionStatement extends Statement {
+  Expression expression;
+
+  ExpressionStatement(this.expression) {
+    expression?.parent = this;
+  }
+
+  accept(StatementVisitor v) => v.visitExpressionStatement(this);
+
+  visitChildren(Visitor v) {
+    expression?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (expression != null) {
+      expression = expression.accept(v);
+      expression?.parent = this;
+    }
+  }
+}
+
+class Block extends Statement {
+  final List<Statement> statements;
+
+  Block(this.statements) {
+    setParents(statements, this);
+  }
+
+  accept(StatementVisitor v) => v.visitBlock(this);
+
+  visitChildren(Visitor v) {
+    visitList(statements, v);
+  }
+
+  transformChildren(Transformer v) {
+    transformList(statements, v, this);
+  }
+
+  void addStatement(Statement node) {
+    statements.add(node);
+    node.parent = this;
+  }
+}
+
+class EmptyStatement extends Statement {
+  accept(StatementVisitor v) => v.visitEmptyStatement(this);
+
+  visitChildren(Visitor v) {}
+  transformChildren(Transformer v) {}
+}
+
+class AssertStatement extends Statement {
+  Expression condition;
+  Expression message; // May be null.
+
+  AssertStatement(this.condition, [this.message]) {
+    condition?.parent = this;
+    message?.parent = this;
+  }
+
+  accept(StatementVisitor v) => v.visitAssertStatement(this);
+
+  visitChildren(Visitor v) {
+    condition?.accept(v);
+    message?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (condition != null) {
+      condition = condition.accept(v);
+      condition?.parent = this;
+    }
+    if (message != null) {
+      message = message.accept(v);
+      message?.parent = this;
+    }
+  }
+}
+
+/// A target of a [Break] statement.
+///
+/// The label itself has no name; breaks reference the statement directly.
+///
+/// The frontend does not generate labeled statements without uses.
+class LabeledStatement extends Statement {
+  Statement body;
+
+  LabeledStatement(this.body) {
+    body?.parent = this;
+  }
+
+  accept(StatementVisitor v) => v.visitLabeledStatement(this);
+
+  visitChildren(Visitor v) {
+    body?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (body != null) {
+      body = body.accept(v);
+      body?.parent = this;
+    }
+  }
+}
+
+/// Breaks out of an enclosing [LabeledStatement].
+///
+/// Both `break` and loop `continue` statements are translated into this node.
+///
+/// For example, the following loop with a `continue` will be desugared:
+///
+///     while(x) {
+///       if (y) continue;
+///       BODY'
+///     }
+///
+///     ==>
+///
+///     while(x) {
+///       L: {
+///         if (y) break L;
+///         BODY'
+///       }
+///     }
+//
+class BreakStatement extends Statement {
+  LabeledStatement target;
+
+  BreakStatement(this.target);
+
+  accept(StatementVisitor v) => v.visitBreakStatement(this);
+
+  visitChildren(Visitor v) {}
+  transformChildren(Transformer v) {}
+}
+
+class WhileStatement extends Statement {
+  Expression condition;
+  Statement body;
+
+  WhileStatement(this.condition, this.body) {
+    condition?.parent = this;
+    body?.parent = this;
+  }
+
+  accept(StatementVisitor v) => v.visitWhileStatement(this);
+
+  visitChildren(Visitor v) {
+    condition?.accept(v);
+    body?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (condition != null) {
+      condition = condition.accept(v);
+      condition?.parent = this;
+    }
+    if (body != null) {
+      body = body.accept(v);
+      body?.parent = this;
+    }
+  }
+}
+
+class DoStatement extends Statement {
+  Statement body;
+  Expression condition;
+
+  DoStatement(this.body, this.condition) {
+    body?.parent = this;
+    condition?.parent = this;
+  }
+
+  accept(StatementVisitor v) => v.visitDoStatement(this);
+
+  visitChildren(Visitor v) {
+    body?.accept(v);
+    condition?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (body != null) {
+      body = body.accept(v);
+      body?.parent = this;
+    }
+    if (condition != null) {
+      condition = condition.accept(v);
+      condition?.parent = this;
+    }
+  }
+}
+
+class ForStatement extends Statement {
+  final List<VariableDeclaration> variables; // May be empty, but not null.
+  Expression condition; // May be null.
+  final List<Expression> updates; // May be empty, but not null.
+  Statement body;
+
+  ForStatement(this.variables, this.condition, this.updates, this.body) {
+    setParents(variables, this);
+    condition?.parent = this;
+    setParents(updates, this);
+    body?.parent = this;
+  }
+
+  accept(StatementVisitor v) => v.visitForStatement(this);
+
+  visitChildren(Visitor v) {
+    visitList(variables, v);
+    condition?.accept(v);
+    visitList(updates, v);
+    body?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    transformList(variables, v, this);
+    if (condition != null) {
+      condition = condition.accept(v);
+      condition?.parent = this;
+    }
+    transformList(updates, v, this);
+    if (body != null) {
+      body = body.accept(v);
+      body?.parent = this;
+    }
+  }
+}
+
+class ForInStatement extends Statement {
+  VariableDeclaration variable; // Has no initializer.
+  Expression iterable;
+  Statement body;
+  bool isAsync; // True if this is an 'await for' loop.
+
+  ForInStatement(this.variable, this.iterable, this.body,
+      {this.isAsync: false}) {
+    variable?.parent = this;
+    iterable?.parent = this;
+    body?.parent = this;
+  }
+
+  accept(StatementVisitor v) => v.visitForInStatement(this);
+
+  visitChildren(Visitor v) {
+    variable?.accept(v);
+    iterable?.accept(v);
+    body?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (variable != null) {
+      variable = variable.accept(v);
+      variable?.parent = this;
+    }
+    if (iterable != null) {
+      iterable = iterable.accept(v);
+      iterable?.parent = this;
+    }
+    if (body != null) {
+      body = body.accept(v);
+      body?.parent = this;
+    }
+  }
+}
+
+/// Statement of form `switch (e) { case x: ... }`.
+///
+/// Adjacent case clauses have been merged into a single [SwitchCase]. A runtime
+/// exception must be thrown if one [SwitchCase] falls through to another case.
+class SwitchStatement extends Statement {
+  Expression expression;
+  final List<SwitchCase> cases;
+
+  SwitchStatement(this.expression, this.cases) {
+    expression?.parent = this;
+    setParents(cases, this);
+  }
+
+  accept(StatementVisitor v) => v.visitSwitchStatement(this);
+
+  visitChildren(Visitor v) {
+    expression?.accept(v);
+    visitList(cases, v);
+  }
+
+  transformChildren(Transformer v) {
+    if (expression != null) {
+      expression = expression.accept(v);
+      expression?.parent = this;
+    }
+    transformList(cases, v, this);
+  }
+}
+
+/// A group of `case` clauses and/or a `default` clause.
+///
+/// This is a potential target of [ContinueSwitchStatement].
+class SwitchCase extends TreeNode {
+  final List<Expression> expressions;
+  Statement body;
+  bool isDefault;
+
+  SwitchCase(this.expressions, this.body, {this.isDefault: false}) {
+    setParents(expressions, this);
+    body?.parent = this;
+  }
+
+  SwitchCase.defaultCase(this.body)
+      : isDefault = true,
+        expressions = <Expression>[] {
+    body?.parent = this;
+  }
+
+  SwitchCase.empty()
+      : expressions = <Expression>[],
+        body = null,
+        isDefault = false;
+
+  accept(TreeVisitor v) => v.visitSwitchCase(this);
+
+  visitChildren(Visitor v) {
+    visitList(expressions, v);
+    body?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    transformList(expressions, v, this);
+    if (body != null) {
+      body = body.accept(v);
+      body?.parent = this;
+    }
+  }
+}
+
+/// Jump to a case in an enclosing switch.
+class ContinueSwitchStatement extends Statement {
+  SwitchCase target;
+
+  ContinueSwitchStatement(this.target);
+
+  accept(StatementVisitor v) => v.visitContinueSwitchStatement(this);
+
+  visitChildren(Visitor v) {}
+  transformChildren(Transformer v) {}
+}
+
+class IfStatement extends Statement {
+  Expression condition;
+  Statement then;
+  Statement otherwise;
+
+  IfStatement(this.condition, this.then, this.otherwise) {
+    condition?.parent = this;
+    then?.parent = this;
+    otherwise?.parent = this;
+  }
+
+  accept(StatementVisitor v) => v.visitIfStatement(this);
+
+  visitChildren(Visitor v) {
+    condition?.accept(v);
+    then?.accept(v);
+    otherwise?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (condition != null) {
+      condition = condition.accept(v);
+      condition?.parent = this;
+    }
+    if (then != null) {
+      then = then.accept(v);
+      then?.parent = this;
+    }
+    if (otherwise != null) {
+      otherwise = otherwise.accept(v);
+      otherwise?.parent = this;
+    }
+  }
+}
+
+class ReturnStatement extends Statement {
+  Expression expression; // May be null.
+
+  ReturnStatement([this.expression]) {
+    expression?.parent = this;
+  }
+
+  accept(StatementVisitor v) => v.visitReturnStatement(this);
+
+  visitChildren(Visitor v) {
+    expression?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (expression != null) {
+      expression = expression.accept(v);
+      expression?.parent = this;
+    }
+  }
+}
+
+class TryCatch extends Statement {
+  Statement body;
+  List<Catch> catches;
+
+  TryCatch(this.body, this.catches) {
+    body?.parent = this;
+    setParents(catches, this);
+  }
+
+  accept(StatementVisitor v) => v.visitTryCatch(this);
+
+  visitChildren(Visitor v) {
+    body?.accept(v);
+    visitList(catches, v);
+  }
+
+  transformChildren(Transformer v) {
+    if (body != null) {
+      body = body.accept(v);
+      body?.parent = this;
+    }
+    transformList(catches, v, this);
+  }
+}
+
+class Catch extends TreeNode {
+  DartType guard; // Not null, defaults to dynamic.
+  VariableDeclaration exception; // May be null.
+  VariableDeclaration stackTrace; // May be null.
+  Statement body;
+
+  Catch(this.exception, this.body,
+      {this.guard: const DynamicType(), this.stackTrace}) {
+    assert(guard != null);
+    exception?.parent = this;
+    stackTrace?.parent = this;
+    body?.parent = this;
+  }
+
+  accept(TreeVisitor v) => v.visitCatch(this);
+
+  visitChildren(Visitor v) {
+    guard?.accept(v);
+    exception?.accept(v);
+    stackTrace?.accept(v);
+    body?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    guard = v.visitDartType(guard);
+    if (exception != null) {
+      exception = exception.accept(v);
+      exception?.parent = this;
+    }
+    if (stackTrace != null) {
+      stackTrace = stackTrace.accept(v);
+      stackTrace?.parent = this;
+    }
+    if (body != null) {
+      body = body.accept(v);
+      body?.parent = this;
+    }
+  }
+}
+
+class TryFinally extends Statement {
+  Statement body;
+  Statement finalizer;
+
+  TryFinally(this.body, this.finalizer) {
+    body?.parent = this;
+    finalizer?.parent = this;
+  }
+
+  accept(StatementVisitor v) => v.visitTryFinally(this);
+
+  visitChildren(Visitor v) {
+    body?.accept(v);
+    finalizer?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (body != null) {
+      body = body.accept(v);
+      body?.parent = this;
+    }
+    if (finalizer != null) {
+      finalizer = finalizer.accept(v);
+      finalizer?.parent = this;
+    }
+  }
+}
+
+/// Statement of form `yield x` or `yield* x`.
+///
+/// For native yield semantics see `AsyncMarker.SyncYielding`.
+class YieldStatement extends Statement {
+  Expression expression;
+  int flags = 0;
+
+  YieldStatement(this.expression,
+      {bool isYieldStar: false, bool isNative: false}) {
+    expression?.parent = this;
+    this.isYieldStar = isYieldStar;
+    this.isNative = isNative;
+  }
+
+  static const int FlagYieldStar = 1 << 0;
+  static const int FlagNative = 1 << 1;
+
+  bool get isYieldStar => flags & FlagYieldStar != 0;
+  bool get isNative => flags & FlagNative != 0;
+
+  void set isYieldStar(bool value) {
+    flags = value ? (flags | FlagYieldStar) : (flags & ~FlagYieldStar);
+  }
+
+  void set isNative(bool value) {
+    flags = value ? (flags | FlagNative) : (flags & ~FlagNative);
+  }
+
+  accept(StatementVisitor v) => v.visitYieldStatement(this);
+
+  visitChildren(Visitor v) {
+    expression?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (expression != null) {
+      expression = expression.accept(v);
+      expression?.parent = this;
+    }
+  }
+}
+
+/// Declaration of a local variable.
+///
+/// This may occur as a statement, but is also used in several non-statement
+/// contexts, such as in [ForStatement], [Catch], and [FunctionNode].
+///
+/// When this occurs as a statement, it must be a direct child of a [Block].
+//
+// DESIGN TODO: Should we remove the 'final' modifier from variables?
+class VariableDeclaration extends Statement {
+  /// For named parameters, this is the name of the parameter. No two named
+  /// parameters (in the same parameter list) can have the same name.
+  ///
+  /// In all other cases, the name is cosmetic, may be empty or null,
+  /// and is not necessarily unique.
+  String name;
+  int flags = 0;
+  DartType type; // Not null, defaults to dynamic.
+  InferredValue inferredValue; // May be null.
+
+  /// For locals, this is the initial value.
+  /// For parameters, this is the default value.
+  ///
+  /// Should be null in other cases.
+  Expression initializer; // May be null.
+
+  VariableDeclaration(this.name,
+      {this.initializer,
+      this.type: const DynamicType(),
+      this.inferredValue,
+      bool isFinal: false,
+      bool isConst: false}) {
+    assert(type != null);
+    initializer?.parent = this;
+    this.isFinal = isFinal;
+    this.isConst = isConst;
+  }
+
+  /// Creates a synthetic variable with the given expression as initializer.
+  VariableDeclaration.forValue(this.initializer,
+      {bool isFinal: true,
+      bool isConst: false,
+      this.type: const DynamicType()}) {
+    assert(type != null);
+    initializer?.parent = this;
+    this.isFinal = isFinal;
+    this.isConst = isConst;
+  }
+
+  static const int FlagFinal = 1 << 0; // Must match serialized bit positions.
+  static const int FlagConst = 1 << 1;
+  static const int FlagInScope = 1 << 2; // Temporary flag used by verifier.
+
+  bool get isFinal => flags & FlagFinal != 0;
+  bool get isConst => flags & FlagConst != 0;
+
+  void set isFinal(bool value) {
+    flags = value ? (flags | FlagFinal) : (flags & ~FlagFinal);
+  }
+
+  void set isConst(bool value) {
+    flags = value ? (flags | FlagConst) : (flags & ~FlagConst);
+  }
+
+  accept(StatementVisitor v) => v.visitVariableDeclaration(this);
+
+  visitChildren(Visitor v) {
+    type?.accept(v);
+    inferredValue?.accept(v);
+    initializer?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    type = v.visitDartType(type);
+    if (initializer != null) {
+      initializer = initializer.accept(v);
+      initializer?.parent = this;
+    }
+  }
+
+  /// Returns a possibly synthesized name for this variable, consistent with
+  /// the names used across all [toString] calls.
+  String toString() => debugVariableDeclarationName(this);
+}
+
+/// Declaration a local function.
+///
+/// The body of the function may use [variable] as its self-reference.
+class FunctionDeclaration extends Statement {
+  VariableDeclaration variable; // Is final and has no initializer.
+  FunctionNode function;
+
+  FunctionDeclaration(this.variable, this.function) {
+    variable?.parent = this;
+    function?.parent = this;
+  }
+
+  accept(StatementVisitor v) => v.visitFunctionDeclaration(this);
+
+  visitChildren(Visitor v) {
+    variable?.accept(v);
+    function?.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    if (variable != null) {
+      variable = variable.accept(v);
+      variable?.parent = this;
+    }
+    if (function != null) {
+      function = function.accept(v);
+      function?.parent = this;
+    }
+  }
+}
+
+// ------------------------------------------------------------------------
+//                                NAMES
+// ------------------------------------------------------------------------
+
+/// A public name, or a private name qualified by a library.
+///
+/// Names are only used for expressions with dynamic dispatch, as all
+/// statically resolved references are represented in nameless form.
+///
+/// [Name]s are immutable and compare based on structural equality, and they
+/// are not AST nodes.
+///
+/// The [toString] method returns a human-readable string that includes the
+/// library name for private names; uniqueness is not guaranteed.
+abstract class Name implements Node {
+  final int hashCode;
+  final String name;
+  Library get library;
+  bool get isPrivate;
+
+  Name._internal(this.hashCode, this.name);
+
+  factory Name(String name, [Library library]) {
+    /// Use separate subclasses for the public and private case to save memory
+    /// for public names.
+    if (name.startsWith('_')) {
+      assert(library != null);
+      return new _PrivateName(name, library);
+    } else {
+      return new _PublicName(name);
+    }
+  }
+
+  bool operator ==(other) {
+    return other is Name && name == other.name && library == other.library;
+  }
+
+  accept(Visitor v) => v.visitName(this);
+
+  visitChildren(Visitor v) {
+    // DESIGN TODO: Should we visit the library as a library reference?
+  }
+}
+
+class _PrivateName extends Name {
+  final Library library;
+  bool get isPrivate => true;
+
+  _PrivateName(String name, Library library)
+      : this.library = library,
+        super._internal(_computeHashCode(name, library), name);
+
+  String toString() => library != null ? '$library::$name' : name;
+
+  static int _computeHashCode(String name, Library library) {
+    return 131 * name.hashCode + 17 * library.hashCode;
+  }
+}
+
+class _PublicName extends Name {
+  Library get library => null;
+  bool get isPrivate => false;
+
+  _PublicName(String name) : super._internal(name.hashCode, name);
+
+  String toString() => name;
+}
+
+// ------------------------------------------------------------------------
+//                             TYPES
+// ------------------------------------------------------------------------
+
+/// A syntax-independent notion of a type.
+///
+/// [DartType]s are not AST nodes and may be shared between different parents.
+///
+/// [DartType] objects should be treated as unmodifiable objects, although
+/// immutability is not enforced for List fields, and [TypeParameter]s are
+/// cyclic structures that are constructed by mutation.
+///
+/// The `==` operator on [DartType]s compare based on type equality, not
+/// object identity.
+abstract class DartType extends Node {
+  const DartType();
+
+  accept(DartTypeVisitor v);
+
+  bool operator ==(Object other);
+}
+
+/// The type arising from invalid type annotations.
+///
+/// Can usually be treated as 'dynamic', but should occasionally be handled
+/// differently, e.g. `x is ERROR` should evaluate to false.
+class InvalidType extends DartType {
+  final int hashCode = 12345;
+
+  const InvalidType();
+
+  accept(DartTypeVisitor v) => v.visitInvalidType(this);
+  visitChildren(Visitor v) {}
+
+  bool operator ==(Object other) => other is InvalidType;
+}
+
+class DynamicType extends DartType {
+  final int hashCode = 54321;
+
+  const DynamicType();
+
+  accept(DartTypeVisitor v) => v.visitDynamicType(this);
+  visitChildren(Visitor v) {}
+
+  bool operator ==(Object other) => other is DynamicType;
+}
+
+class VoidType extends DartType {
+  final int hashCode = 123121;
+
+  const VoidType();
+
+  accept(DartTypeVisitor v) => v.visitVoidType(this);
+  visitChildren(Visitor v) {}
+
+  bool operator ==(Object other) => other is VoidType;
+}
+
+class BottomType extends DartType {
+  final int hashCode = 514213;
+
+  const BottomType();
+
+  accept(DartTypeVisitor v) => v.visitBottomType(this);
+  visitChildren(Visitor v) {}
+
+  bool operator ==(Object other) => other is BottomType;
+}
+
+class InterfaceType extends DartType {
+  final Class classNode;
+  final List<DartType> typeArguments;
+
+  /// The [typeArguments] list must not be modified after this call. If the
+  /// list is omitted, 'dynamic' type arguments are filled in.
+  InterfaceType(Class classNode, [List<DartType> typeArguments])
+      : this.classNode = classNode,
+        this.typeArguments = typeArguments ?? _defaultTypeArguments(classNode);
+
+  static List<DartType> _defaultTypeArguments(Class classNode) {
+    if (classNode.typeParameters.length == 0) {
+      // Avoid allocating a list in this very common case.
+      return const <DartType>[];
+    } else {
+      return new List<DartType>.filled(
+          classNode.typeParameters.length, const DynamicType());
+    }
+  }
+
+  accept(DartTypeVisitor v) => v.visitInterfaceType(this);
+
+  visitChildren(Visitor v) {
+    classNode.acceptReference(v);
+    visitList(typeArguments, v);
+  }
+
+  bool operator ==(Object other) {
+    if (identical(this, other)) return true;
+    if (other is InterfaceType) {
+      if (classNode != other.classNode) return false;
+      if (typeArguments.length != other.typeArguments.length) return false;
+      for (int i = 0; i < typeArguments.length; ++i) {
+        if (typeArguments[i] != other.typeArguments[i]) return false;
+      }
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+  int get hashCode {
+    int hash = 0x3fffffff & classNode.hashCode;
+    for (int i = 0; i < typeArguments.length; ++i) {
+      hash = 0x3fffffff & (hash * 31 + (hash ^ typeArguments[i].hashCode));
+    }
+    return hash;
+  }
+}
+
+/// A possibly generic function type.
+class FunctionType extends DartType {
+  final List<TypeParameter> typeParameters;
+  final int requiredParameterCount;
+  final List<DartType> positionalParameters;
+  final List<NamedType> namedParameters; // Must be sorted.
+  final DartType returnType;
+  int _hashCode;
+
+  FunctionType(List<DartType> positionalParameters, this.returnType,
+      {this.namedParameters: const <NamedType>[],
+      this.typeParameters: const <TypeParameter>[],
+      int requiredParameterCount})
+      : this.positionalParameters = positionalParameters,
+        this.requiredParameterCount =
+            requiredParameterCount ?? positionalParameters.length;
+
+  accept(DartTypeVisitor v) => v.visitFunctionType(this);
+
+  visitChildren(Visitor v) {
+    visitList(typeParameters, v);
+    visitList(positionalParameters, v);
+    visitList(namedParameters, v);
+    returnType.accept(v);
+  }
+
+  bool operator ==(Object other) {
+    if (identical(this, other)) return true;
+    if (other is FunctionType) {
+      if (typeParameters.length != other.typeParameters.length ||
+          requiredParameterCount != other.requiredParameterCount ||
+          positionalParameters.length != other.positionalParameters.length ||
+          namedParameters.length != other.namedParameters.length) {
+        return false;
+      }
+      if (typeParameters.isEmpty) {
+        for (int i = 0; i < positionalParameters.length; ++i) {
+          if (positionalParameters[i] != other.positionalParameters[i]) {
+            return false;
+          }
+        }
+        for (int i = 0; i < namedParameters.length; ++i) {
+          if (namedParameters[i] != other.namedParameters[i]) {
+            return false;
+          }
+        }
+        return returnType == other.returnType;
+      } else {
+        // Structural equality does not tell us if two generic function types
+        // are the same type.  If they are unifiable without substituting any
+        // type variables, they are equal.
+        return unifyTypes(this, other, new Set<TypeParameter>()) != null;
+      }
+    } else {
+      return false;
+    }
+  }
+
+  /// Returns a variant of this function type that does not declare any type
+  /// parameters.
+  ///
+  /// Any uses of its type parameters become free variables in the returned
+  /// type.
+  FunctionType get withoutTypeParameters {
+    if (typeParameters.isEmpty) return this;
+    return new FunctionType(positionalParameters, returnType,
+        requiredParameterCount: requiredParameterCount,
+        namedParameters: namedParameters);
+  }
+
+  int get hashCode => _hashCode ??= _computeHashCode();
+
+  int _computeHashCode() {
+    int hash = 1237;
+    hash = 0x3fffffff & (hash * 31 + requiredParameterCount);
+    for (int i = 0; i < typeParameters.length; ++i) {
+      TypeParameter parameter = typeParameters[i];
+      _temporaryHashCodeTable[parameter] = _temporaryHashCodeTable.length;
+      hash = 0x3fffffff & (hash * 31 + parameter.bound.hashCode);
+    }
+    for (int i = 0; i < positionalParameters.length; ++i) {
+      hash = 0x3fffffff & (hash * 31 + positionalParameters[i].hashCode);
+    }
+    for (int i = 0; i < namedParameters.length; ++i) {
+      hash = 0x3fffffff & (hash * 31 + namedParameters[i].hashCode);
+    }
+    hash = 0x3fffffff & (hash * 31 + returnType.hashCode);
+    for (int i = 0; i < typeParameters.length; ++i) {
+      // Remove the type parameters from the scope again.
+      _temporaryHashCodeTable.remove(typeParameters[i]);
+    }
+    return hash;
+  }
+}
+
+/// A named parameter in [FunctionType].
+class NamedType extends Node implements Comparable<NamedType> {
+  final String name;
+  final DartType type;
+
+  NamedType(this.name, this.type);
+
+  bool operator ==(Object other) {
+    return other is NamedType && name == other.name && type == other.type;
+  }
+
+  int get hashCode {
+    return name.hashCode * 31 + type.hashCode * 37;
+  }
+
+  int compareTo(NamedType other) => name.compareTo(other.name);
+
+  accept(Visitor v) => v.visitNamedType(this);
+
+  void visitChildren(Visitor v) {
+    type.accept(v);
+  }
+}
+
+/// Stores the hash code of function type parameters while computing the hash
+/// code of a [FunctionType] object.
+///
+/// This ensures that distinct [FunctionType] objects get the same hash code
+/// if they represent the same type, even though their type parameters are
+/// represented by different objects.
+final Map<TypeParameter, int> _temporaryHashCodeTable = <TypeParameter, int>{};
+
+/// Reference to a type variable.
+class TypeParameterType extends DartType {
+  TypeParameter parameter;
+
+  TypeParameterType(this.parameter);
+
+  accept(DartTypeVisitor v) => v.visitTypeParameterType(this);
+
+  visitChildren(Visitor v) {}
+
+  bool operator ==(Object other) {
+    return other is TypeParameterType && parameter == other.parameter;
+  }
+
+  int get hashCode => _temporaryHashCodeTable[parameter] ?? parameter.hashCode;
+}
+
+/// Declaration of a type variable.
+///
+/// Type parameters declared in a [Class] or [FunctionNode] are part of the AST,
+/// have a parent pointer to its declaring class or function, and will be seen
+/// by tree visitors.
+///
+/// Type parameters declared by a [FunctionType] are orphans and have a `null`
+/// parent pointer.  [TypeParameter] objects should not be shared between
+/// different [FunctionType] objects.
+class TypeParameter extends TreeNode {
+  String name; // Cosmetic name.
+
+  /// The bound on the type variable.
+  ///
+  /// Should not be null except temporarily during IR construction.  Should
+  /// be set to the root class for type parameters without an explicit bound.
+  DartType bound;
+
+  TypeParameter([this.name, this.bound]);
+
+  accept(TreeVisitor v) => v.visitTypeParameter(this);
+
+  visitChildren(Visitor v) {
+    bound.accept(v);
+  }
+
+  transformChildren(Transformer v) {
+    bound = v.visitDartType(bound);
+  }
+
+  /// Returns a possibly synthesized name for this type parameter, consistent
+  /// with the names used across all [toString] calls.
+  String toString() => debugQualifiedTypeParameterName(this);
+}
+
+class Supertype extends Node {
+  final Class classNode;
+  final List<DartType> typeArguments;
+
+  Supertype(this.classNode, this.typeArguments);
+
+  accept(Visitor v) => v.visitSupertype(this);
+
+  visitChildren(Visitor v) {
+    classNode.acceptReference(v);
+    visitList(typeArguments, v);
+  }
+
+  InterfaceType get asInterfaceType {
+    return new InterfaceType(classNode, typeArguments);
+  }
+
+  bool operator ==(Object other) {
+    if (identical(this, other)) return true;
+    if (other is Supertype) {
+      if (classNode != other.classNode) return false;
+      if (typeArguments.length != other.typeArguments.length) return false;
+      for (int i = 0; i < typeArguments.length; ++i) {
+        if (typeArguments[i] != other.typeArguments[i]) return false;
+      }
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+  int get hashCode {
+    int hash = 0x3fffffff & classNode.hashCode;
+    for (int i = 0; i < typeArguments.length; ++i) {
+      hash = 0x3fffffff & (hash * 31 + (hash ^ typeArguments[i].hashCode));
+    }
+    return hash;
+  }
+}
+
+// ------------------------------------------------------------------------
+//                                PROGRAM
+// ------------------------------------------------------------------------
+
+/// A way to bundle up all the libraries in a program.
+class Program extends TreeNode {
+  final List<Library> libraries;
+
+  /// Map from a source file uri to a line-starts table.
+  /// Given a source file uri and a offset in that file one can translate
+  /// it to a line:column position in that file.
+  final Map<String, List<int>> uriToLineStarts;
+
+  /// Reference to the main method in one of the libraries.
+  Procedure mainMethod;
+
+  Program([List<Library> libraries, Map<String, List<int>> uriToLineStarts])
+      : libraries = libraries ?? <Library>[],
+        uriToLineStarts = uriToLineStarts ?? {} {
+    setParents(libraries, this);
+  }
+
+  accept(TreeVisitor v) => v.visitProgram(this);
+
+  visitChildren(Visitor v) {
+    visitList(libraries, v);
+    mainMethod?.acceptReference(v);
+  }
+
+  transformChildren(Transformer v) {
+    transformList(libraries, v, this);
+  }
+
+  Program get enclosingProgram => this;
+
+  /// Translates an offset to line and column numbers in the given file.
+  Location getLocation(String file, int offset) {
+    List<int> lines = uriToLineStarts[file];
+    int low = 0, high = lines.length - 1;
+    while (low < high) {
+      int mid = high - ((high - low) >> 1); // Get middle, rounding up.
+      int pivot = lines[mid];
+      if (pivot <= offset) {
+        low = mid;
+      } else {
+        high = mid - 1;
+      }
+    }
+    int lineIndex = low;
+    int lineStart = lines[lineIndex];
+    int lineNumber = 1 + lineIndex;
+    int columnNumber = offset - lineStart;
+    return new Location(file, lineNumber, columnNumber);
+  }
+}
+
+/// A tuple with file, line, and column number, for displaying human-readable
+/// locations.
+class Location {
+  final String file;
+  final int line; // 1-based.
+  final int column; // 1-based.
+
+  Location(this.file, this.line, this.column);
+
+  String toString() => '$file:$line:$column';
+}
+
+// ------------------------------------------------------------------------
+//                             INTERNAL FUNCTIONS
+// ------------------------------------------------------------------------
+
+void setParents(List<TreeNode> nodes, TreeNode parent) {
+  for (int i = 0; i < nodes.length; ++i) {
+    nodes[i].parent = parent;
+  }
+}
+
+void visitList(List<Node> nodes, Visitor visitor) {
+  for (int i = 0; i < nodes.length; ++i) {
+    nodes[i].accept(visitor);
+  }
+}
+
+void visitIterable(Iterable<Node> nodes, Visitor visitor) {
+  for (var node in nodes) {
+    node.accept(visitor);
+  }
+}
+
+void transformTypeList(List<DartType> nodes, Transformer visitor) {
+  int storeIndex = 0;
+  for (int i = 0; i < nodes.length; ++i) {
+    var result = visitor.visitDartType(nodes[i]);
+    if (result != null) {
+      nodes[storeIndex] = result;
+      ++storeIndex;
+    }
+  }
+  if (storeIndex < nodes.length) {
+    nodes.length = storeIndex;
+  }
+}
+
+void transformSupertypeList(List<Supertype> nodes, Transformer visitor) {
+  int storeIndex = 0;
+  for (int i = 0; i < nodes.length; ++i) {
+    var result = visitor.visitSupertype(nodes[i]);
+    if (result != null) {
+      nodes[storeIndex] = result;
+      ++storeIndex;
+    }
+  }
+  if (storeIndex < nodes.length) {
+    nodes.length = storeIndex;
+  }
+}
+
+void transformList(List<TreeNode> nodes, Transformer visitor, TreeNode parent) {
+  int storeIndex = 0;
+  for (int i = 0; i < nodes.length; ++i) {
+    var result = nodes[i].accept(visitor);
+    if (result != null) {
+      nodes[storeIndex] = result;
+      result.parent = parent;
+      ++storeIndex;
+    }
+  }
+  if (storeIndex < nodes.length) {
+    nodes.length = storeIndex;
+  }
+}
+
+List<DartType> _getAsTypeArguments(List<TypeParameter> typeParameters) {
+  if (typeParameters.isEmpty) return const <DartType>[];
+  return new List<DartType>.generate(
+      typeParameters.length, (i) => new TypeParameterType(typeParameters[i]),
+      growable: false);
+}
+
+class _ChildReplacer extends Transformer {
+  final TreeNode child;
+  final TreeNode replacement;
+
+  _ChildReplacer(this.child, this.replacement);
+
+  @override
+  defaultTreeNode(TreeNode node) {
+    if (node == child) {
+      return replacement;
+    } else {
+      return node;
+    }
+  }
+}
diff --git a/pkg/kernel/lib/binary/ast_from_binary.dart b/pkg/kernel/lib/binary/ast_from_binary.dart
new file mode 100644
index 0000000..1b228b8
--- /dev/null
+++ b/pkg/kernel/lib/binary/ast_from_binary.dart
@@ -0,0 +1,941 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.ast_from_binary;
+
+import '../ast.dart';
+import 'tag.dart';
+import 'loader.dart';
+import 'dart:convert';
+import 'package:kernel/transformations/flags.dart';
+
+class ParseError {
+  String filename;
+  int byteIndex;
+  String message;
+  String path;
+
+  ParseError(this.message, {this.filename, this.byteIndex, this.path});
+
+  String toString() => '$filename:$byteIndex: $message at $path';
+}
+
+class BinaryBuilder {
+  final BinaryReferenceLoader loader;
+  final List<Library> importTable = <Library>[];
+  final List<VariableDeclaration> variableStack = <VariableDeclaration>[];
+  final List<LabeledStatement> labelStack = <LabeledStatement>[];
+  int labelStackBase = 0;
+  final List<SwitchCase> switchCaseStack = <SwitchCase>[];
+  final List<TypeParameter> typeParameterStack = <TypeParameter>[];
+  final String filename;
+  final List<int> _bytes;
+  int _byteIndex = 0;
+  Library _currentLibrary;
+  List<String> _stringTable;
+  List<String> _sourceUriTable;
+  int _transformerFlags = 0;
+
+  // If something goes wrong, this list should indicate what library,
+  // class, and member was being built.
+  List<String> debugPath = <String>[];
+
+  BinaryBuilder(this.loader, this._bytes, [this.filename]);
+
+  fail(String message) {
+    throw new ParseError(message,
+        byteIndex: _byteIndex, filename: filename, path: debugPath.join('::'));
+  }
+
+  int readByte() => _bytes[_byteIndex++];
+
+  int readUInt() {
+    var byte = readByte();
+    if (byte & 0x80 == 0) {
+      // 0xxxxxxx
+      return byte;
+    } else if (byte & 0x40 == 0) {
+      // 10xxxxxx
+      return ((byte & 0x3F) << 8) | readByte();
+    } else {
+      // 11xxxxxx
+      return ((byte & 0x3F) << 24) |
+          (readByte() << 16) |
+          (readByte() << 8) |
+          readByte();
+    }
+  }
+
+  int readMagicWord() {
+    return (readByte() << 24) |
+        (readByte() << 16) |
+        (readByte() << 8) |
+        readByte();
+  }
+
+  String readStringEntry() {
+    int numBytes = readUInt();
+    // Utf8Decoder will skip leading BOM characters, but we must preserve them.
+    // Collect leading BOMs before passing the bytes onto Utf8Decoder.
+    int numByteOrderMarks = 0;
+    while (_byteIndex + 2 < _bytes.length &&
+        _bytes[_byteIndex] == 0xef &&
+        _bytes[_byteIndex + 1] == 0xbb &&
+        _bytes[_byteIndex + 2] == 0xbf) {
+      ++numByteOrderMarks;
+      _byteIndex += 3;
+      numBytes -= 3;
+    }
+    String string =
+        const Utf8Decoder().convert(_bytes, _byteIndex, _byteIndex + numBytes);
+    _byteIndex += numBytes;
+    if (numByteOrderMarks > 0) {
+      return '\ufeff' * numByteOrderMarks + string;
+    }
+    return string;
+  }
+
+  void readStringTable() {
+    int length = readUInt();
+    _stringTable = new List<String>(length);
+    for (int i = 0; i < length; ++i) {
+      _stringTable[i] = readStringEntry();
+    }
+  }
+
+  String readUriReference() {
+    return _sourceUriTable[readUInt()];
+  }
+
+  void readSourceUriTable() {
+    int length = readUInt();
+    _sourceUriTable = new List<String>(length);
+    for (int i = 0; i < length; ++i) {
+      _sourceUriTable[i] = readStringEntry();
+    }
+  }
+
+  String readStringReference() {
+    return _stringTable[readUInt()];
+  }
+
+  String readStringOrNullIfEmpty() {
+    var string = readStringReference();
+    return string.isEmpty ? null : string;
+  }
+
+  InferredValue readOptionalInferredValue() {
+    if (readAndCheckOptionTag()) {
+      Class baseClass = readClassReference(allowNull: true);
+      BaseClassKind baseClassKind = BaseClassKind.values[readByte()];
+      int valueBits = readByte();
+      return new InferredValue(baseClass, baseClassKind, valueBits);
+    }
+    return null;
+  }
+
+  bool readAndCheckOptionTag() {
+    int tag = readByte();
+    if (tag == Tag.Nothing) {
+      return false;
+    } else if (tag == Tag.Something) {
+      return true;
+    } else {
+      throw fail('Invalid Option tag: $tag');
+    }
+  }
+
+  List<Expression> readAnnotationList(TreeNode parent) {
+    int length = readUInt();
+    if (length == 0) return const <Expression>[];
+    List<Expression> list = new List<Expression>(length);
+    for (int i = 0; i < length; ++i) {
+      list[i] = readExpression()..parent = parent;
+    }
+    return list;
+  }
+
+  void _fillTreeNodeList(
+      List<TreeNode> list, TreeNode buildObject(), TreeNode parent) {
+    list.length = readUInt();
+    for (int i = 0; i < list.length; ++i) {
+      list[i] = buildObject()..parent = parent;
+    }
+  }
+
+  void _fillNonTreeNodeList(List<Node> list, Node buildObject()) {
+    list.length = readUInt();
+    for (int i = 0; i < list.length; ++i) {
+      list[i] = buildObject();
+    }
+  }
+
+  Program readProgramFile() {
+    int magic = readMagicWord();
+    if (magic != Tag.ProgramFile) {
+      throw fail('This is not a binary dart file. '
+          'Magic number was: ${magic.toRadixString(16)}');
+    }
+    readStringTable();
+    Map<String, List<int>> uriToLineStarts = readUriToLineStarts();
+    importTable.length = readUInt();
+    for (int i = 0; i < importTable.length; ++i) {
+      importTable[i] = new Library(null);
+    }
+    for (int i = 0; i < importTable.length; ++i) {
+      _currentLibrary = importTable[i];
+      readLibrary();
+    }
+    var mainMethod = readMemberReference(allowNull: true);
+    return new Program(importTable, uriToLineStarts)..mainMethod = mainMethod;
+  }
+
+  Map<String, List<int>> readUriToLineStarts() {
+    readSourceUriTable();
+    int length = _sourceUriTable.length;
+    Map<String, List<int>> uriToLineStarts = {};
+    for (int i = 0; i < length; ++i) {
+      String uri = _sourceUriTable[i];
+      int lineCount = readUInt();
+      List<int> lineStarts = new List<int>(lineCount);
+      int previousLineStart = 0;
+      for (int j = 0; j < lineCount; ++j) {
+        int lineStart = readUInt() + previousLineStart;
+        lineStarts[j] = lineStart;
+        previousLineStart = lineStart;
+      }
+      uriToLineStarts[uri] = lineStarts;
+    }
+    return uriToLineStarts;
+  }
+
+  void _fillLazilyLoadedList(
+      List<TreeNode> list, void buildObject(int tag, int index)) {
+    int length = readUInt();
+    list.length = length;
+    for (int i = 0; i < length; ++i) {
+      int tag = readByte();
+      buildObject(tag, i);
+    }
+  }
+
+  Library readLibraryReference() {
+    int index = readUInt();
+    return importTable[index];
+  }
+
+  Class readClassReference({bool allowNull: false}) {
+    int tag = readByte();
+    if (tag == Tag.NullReference) {
+      if (!allowNull) {
+        throw 'Expected a class reference to be valid but was `null`.';
+      }
+      return null;
+    } else {
+      var library = readLibraryReference();
+      int index = readUInt();
+      return loader.getClassReference(library, tag, index);
+    }
+  }
+
+  Member readMemberReference({bool allowNull: false}) {
+    int tag = readByte();
+    switch (tag) {
+      case Tag.LibraryFieldReference:
+      case Tag.LibraryProcedureReference:
+        var library = readLibraryReference();
+        var index = readUInt();
+        return loader.getLibraryMemberReference(library, tag, index);
+
+      case Tag.ClassFieldReference:
+      case Tag.ClassConstructorReference:
+      case Tag.ClassProcedureReference:
+        var classNode = readClassReference();
+        var index = readUInt();
+        return loader.getClassMemberReference(classNode, tag, index);
+
+      case Tag.NullReference:
+        if (!allowNull) {
+          throw 'Expected a member reference to be valid but was `null`.';
+        }
+        return null;
+
+      default:
+        throw fail('Invalid member reference tag: $tag');
+    }
+  }
+
+  Name readName() {
+    String text = readStringReference();
+    if (text.isNotEmpty && text[0] == '_') {
+      return new Name(text, readLibraryReference());
+    } else {
+      return new Name(text);
+    }
+  }
+
+  Uri readImportUri() {
+    return Uri.parse(readStringReference());
+  }
+
+  void readLibrary() {
+    int flags = readByte();
+    _currentLibrary.isExternal = (flags & 0x1) != 0;
+    _currentLibrary.name = readStringOrNullIfEmpty();
+    _currentLibrary.importUri = readImportUri();
+    debugPath.add(_currentLibrary.name ??
+        _currentLibrary.importUri?.toString() ??
+        'library');
+
+    // TODO(jensj): We currently save (almost the same) uri twice.
+    _currentLibrary.fileUri = readUriReference();
+
+    _fillLazilyLoadedList(_currentLibrary.classes, (int tag, int index) {
+      readClass(loader.getClassReference(_currentLibrary, tag, index), tag);
+    });
+    _fillLazilyLoadedList(_currentLibrary.fields, (int tag, int index) {
+      readField(
+          loader.getLibraryMemberReference(_currentLibrary, tag, index), tag);
+    });
+    _fillLazilyLoadedList(_currentLibrary.procedures, (int tag, int index) {
+      readProcedure(
+          loader.getLibraryMemberReference(_currentLibrary, tag, index), tag);
+    });
+    debugPath.removeLast();
+  }
+
+  void readClass(Class node, int tag) {
+    assert(node != null);
+    switch (tag) {
+      case Tag.NormalClass:
+        readNormalClass(node);
+        break;
+      case Tag.MixinClass:
+        readMixinClass(node);
+        break;
+      default:
+        throw fail('Invalid class tag: $tag');
+    }
+  }
+
+  void readNormalClass(Class node) {
+    int flags = readByte();
+    node.isAbstract = flags & 0x1 != 0;
+    node.level = _currentLibrary.isExternal
+        ? (flags & 0x2 != 0) ? ClassLevel.Type : ClassLevel.Hierarchy
+        : ClassLevel.Body;
+    node.name = readStringOrNullIfEmpty();
+    node.fileUri = readUriReference();
+    node.annotations = readAnnotationList(node);
+    debugPath.add(node.name ?? 'normal-class');
+    readAndPushTypeParameterList(node.typeParameters, node);
+    node.supertype = readSupertypeOption();
+    _fillNonTreeNodeList(node.implementedTypes, readSupertype);
+    _fillLazilyLoadedList(node.fields, (int tag, int index) {
+      readField(loader.getClassMemberReference(node, tag, index), tag);
+    });
+    _fillLazilyLoadedList(node.constructors, (int tag, int index) {
+      readConstructor(loader.getClassMemberReference(node, tag, index), tag);
+    });
+    _fillLazilyLoadedList(node.procedures, (int tag, int index) {
+      readProcedure(loader.getClassMemberReference(node, tag, index), tag);
+    });
+    typeParameterStack.length = 0;
+    debugPath.removeLast();
+  }
+
+  void readMixinClass(Class node) {
+    int flags = readByte();
+    node.isAbstract = flags & 0x1 != 0;
+    node.level = _currentLibrary.isExternal
+        ? (flags & 0x2 != 0) ? ClassLevel.Type : ClassLevel.Hierarchy
+        : ClassLevel.Body;
+    node.name = readStringOrNullIfEmpty();
+    node.fileUri = readUriReference();
+    node.annotations = readAnnotationList(node);
+    debugPath.add(node.name ?? 'mixin-class');
+    readAndPushTypeParameterList(node.typeParameters, node);
+    node.supertype = readSupertype();
+    node.mixedInType = readSupertype();
+    _fillNonTreeNodeList(node.implementedTypes, readDartType);
+    _fillLazilyLoadedList(node.constructors, (int tag, int index) {
+      readConstructor(loader.getClassMemberReference(node, tag, index), tag);
+    });
+    typeParameterStack.length = 0;
+    debugPath.removeLast();
+  }
+
+  int getAndResetTransformerFlags() {
+    int flags = _transformerFlags;
+    _transformerFlags = 0;
+    return flags;
+  }
+
+  /// Adds the given flag to the current [Member.transformerFlags].
+  void addTransformerFlag(int flags) {
+    _transformerFlags |= flags;
+  }
+
+  void readField(Field node, int tag) {
+    // Note: as with readProcedure and readConstructor, the tag parameter
+    // is unused, but we pass it in to clarify that the tag has already been
+    // consumed from the input.
+    assert(tag == Tag.Field);
+    node.fileOffset = readOffset();
+    node.flags = readByte();
+    node.name = readName();
+    node.fileUri = readUriReference();
+    node.annotations = readAnnotationList(node);
+    debugPath.add(node.name?.name ?? 'field');
+    node.type = readDartType();
+    node.inferredValue = readOptionalInferredValue();
+    node.initializer = readExpressionOption();
+    node.initializer?.parent = node;
+    node.transformerFlags = getAndResetTransformerFlags();
+    debugPath.removeLast();
+  }
+
+  void readConstructor(Constructor node, int tag) {
+    assert(tag == Tag.Constructor);
+    node.flags = readByte();
+    node.name = readName();
+    node.annotations = readAnnotationList(node);
+    debugPath.add(node.name?.name ?? 'constructor');
+    node.function = readFunctionNode()..parent = node;
+    pushVariableDeclarations(node.function.positionalParameters);
+    pushVariableDeclarations(node.function.namedParameters);
+    _fillTreeNodeList(node.initializers, readInitializer, node);
+    variableStack.length = 0;
+    node.transformerFlags = getAndResetTransformerFlags();
+    debugPath.removeLast();
+  }
+
+  void readProcedure(Procedure node, int tag) {
+    assert(tag == Tag.Procedure);
+    int kindIndex = readByte();
+    node.kind = ProcedureKind.values[kindIndex];
+    node.flags = readByte();
+    node.name = readName();
+    node.fileUri = readUriReference();
+    node.annotations = readAnnotationList(node);
+    debugPath.add(node.name?.name ?? 'procedure');
+    node.function = readFunctionNodeOption();
+    node.function?.parent = node;
+    node.transformerFlags = getAndResetTransformerFlags();
+    debugPath.removeLast();
+  }
+
+  Initializer readInitializer() {
+    int tag = readByte();
+    switch (tag) {
+      case Tag.InvalidInitializer:
+        return new InvalidInitializer();
+      case Tag.FieldInitializer:
+        return new FieldInitializer(readMemberReference(), readExpression());
+      case Tag.SuperInitializer:
+        return new SuperInitializer(readMemberReference(), readArguments());
+      case Tag.RedirectingInitializer:
+        return new RedirectingInitializer(
+            readMemberReference(), readArguments());
+      case Tag.LocalInitializer:
+        return new LocalInitializer(readAndPushVariableDeclaration());
+      default:
+        throw fail('Invalid initializer tag: $tag');
+    }
+  }
+
+  FunctionNode readFunctionNodeOption() {
+    return readAndCheckOptionTag() ? readFunctionNode() : null;
+  }
+
+  FunctionNode readFunctionNode() {
+    AsyncMarker asyncMarker = AsyncMarker.values[readByte()];
+    int typeParameterStackHeight = typeParameterStack.length;
+    var typeParameters = readAndPushTypeParameterList();
+    var requiredParameterCount = readUInt();
+    int variableStackHeight = variableStack.length;
+    var positional = readAndPushVariableDeclarationList();
+    var named = readAndPushVariableDeclarationList();
+    var returnType = readDartType();
+    var inferredReturnValue = readOptionalInferredValue();
+    int oldLabelStackBase = labelStackBase;
+    labelStackBase = labelStack.length;
+    var body = readStatementOption();
+    labelStackBase = oldLabelStackBase;
+    variableStack.length = variableStackHeight;
+    typeParameterStack.length = typeParameterStackHeight;
+    return new FunctionNode(body,
+        typeParameters: typeParameters,
+        requiredParameterCount: requiredParameterCount,
+        positionalParameters: positional,
+        namedParameters: named,
+        returnType: returnType,
+        inferredReturnValue: inferredReturnValue,
+        asyncMarker: asyncMarker);
+  }
+
+  void pushVariableDeclaration(VariableDeclaration variable) {
+    variableStack.add(variable);
+  }
+
+  void pushVariableDeclarations(List<VariableDeclaration> variables) {
+    variableStack.addAll(variables);
+  }
+
+  VariableDeclaration readVariableReference() {
+    int index = readUInt();
+    if (index >= variableStack.length) {
+      throw fail('Invalid variable index: $index');
+    }
+    return variableStack[index];
+  }
+
+  String logicalOperatorToString(int index) {
+    switch (index) {
+      case 0:
+        return '&&';
+      case 1:
+        return '||';
+      default:
+        throw fail('Invalid logical operator index: $index');
+    }
+  }
+
+  List<Expression> readExpressionList() {
+    return new List<Expression>.generate(readUInt(), (i) => readExpression());
+  }
+
+  Expression readExpressionOption() {
+    return readAndCheckOptionTag() ? readExpression() : null;
+  }
+
+  Expression readExpression() {
+    int tagByte = readByte();
+    int tag = tagByte & Tag.SpecializedTagHighBit == 0
+        ? tagByte
+        : (tagByte & Tag.SpecializedTagMask);
+    switch (tag) {
+      case Tag.InvalidExpression:
+        return new InvalidExpression();
+      case Tag.VariableGet:
+        return new VariableGet(readVariableReference(), readDartTypeOption());
+      case Tag.SpecializedVariableGet:
+        int index = tagByte & Tag.SpecializedPayloadMask;
+        return new VariableGet(variableStack[index]);
+      case Tag.VariableSet:
+        return new VariableSet(readVariableReference(), readExpression());
+      case Tag.SpecializedVariableSet:
+        int index = tagByte & Tag.SpecializedPayloadMask;
+        return new VariableSet(variableStack[index], readExpression());
+      case Tag.PropertyGet:
+        int offset = readOffset();
+        return new PropertyGet(
+            readExpression(), readName(), readMemberReference(allowNull: true))
+          ..fileOffset = offset;
+      case Tag.PropertySet:
+        int offset = readOffset();
+        return new PropertySet(readExpression(), readName(), readExpression(),
+            readMemberReference(allowNull: true))..fileOffset = offset;
+      case Tag.SuperPropertyGet:
+        addTransformerFlag(TransformerFlag.superCalls);
+        return new SuperPropertyGet(
+            readName(), readMemberReference(allowNull: true));
+      case Tag.SuperPropertySet:
+        addTransformerFlag(TransformerFlag.superCalls);
+        return new SuperPropertySet(
+            readName(), readExpression(), readMemberReference(allowNull: true));
+      case Tag.DirectPropertyGet:
+        return new DirectPropertyGet(readExpression(), readMemberReference());
+      case Tag.DirectPropertySet:
+        return new DirectPropertySet(
+            readExpression(), readMemberReference(), readExpression());
+      case Tag.StaticGet:
+        int offset = readOffset();
+        return new StaticGet(readMemberReference())
+          ..fileOffset = offset;
+      case Tag.StaticSet:
+        return new StaticSet(readMemberReference(), readExpression());
+      case Tag.MethodInvocation:
+        int offset = readOffset();
+        return new MethodInvocation(
+            readExpression(),
+            readName(),
+            readArguments(),
+            readMemberReference(allowNull: true))..fileOffset = offset;
+      case Tag.SuperMethodInvocation:
+        int offset = readOffset();
+        addTransformerFlag(TransformerFlag.superCalls);
+        return new SuperMethodInvocation(
+            readName(), readArguments(), readMemberReference(allowNull: true))
+          ..fileOffset = offset;
+      case Tag.DirectMethodInvocation:
+        return new DirectMethodInvocation(
+            readExpression(), readMemberReference(), readArguments());
+      case Tag.StaticInvocation:
+        int offset = readOffset();
+        return new StaticInvocation(readMemberReference(), readArguments(),
+            isConst: false)..fileOffset = offset;
+      case Tag.ConstStaticInvocation:
+        int offset = readOffset();
+        return new StaticInvocation(readMemberReference(), readArguments(),
+            isConst: true)..fileOffset = offset;
+      case Tag.ConstructorInvocation:
+        int offset = readOffset();
+        return new ConstructorInvocation(readMemberReference(), readArguments(),
+            isConst: false)..fileOffset = offset;
+      case Tag.ConstConstructorInvocation:
+        int offset = readOffset();
+        return new ConstructorInvocation(readMemberReference(), readArguments(),
+            isConst: true)..fileOffset = offset;
+      case Tag.Not:
+        return new Not(readExpression());
+      case Tag.LogicalExpression:
+        return new LogicalExpression(readExpression(),
+            logicalOperatorToString(readByte()), readExpression());
+      case Tag.ConditionalExpression:
+        return new ConditionalExpression(readExpression(), readExpression(),
+            readExpression(), readDartTypeOption());
+      case Tag.StringConcatenation:
+        return new StringConcatenation(readExpressionList());
+      case Tag.IsExpression:
+        return new IsExpression(readExpression(), readDartType());
+      case Tag.AsExpression:
+        return new AsExpression(readExpression(), readDartType());
+      case Tag.StringLiteral:
+        return new StringLiteral(readStringReference());
+      case Tag.SpecializedIntLiteral:
+        int biasedValue = tagByte & Tag.SpecializedPayloadMask;
+        return new IntLiteral(biasedValue - Tag.SpecializedIntLiteralBias);
+      case Tag.PositiveIntLiteral:
+        return new IntLiteral(readUInt());
+      case Tag.NegativeIntLiteral:
+        return new IntLiteral(-readUInt());
+      case Tag.BigIntLiteral:
+        return new IntLiteral(int.parse(readStringReference()));
+      case Tag.DoubleLiteral:
+        return new DoubleLiteral(double.parse(readStringReference()));
+      case Tag.TrueLiteral:
+        return new BoolLiteral(true);
+      case Tag.FalseLiteral:
+        return new BoolLiteral(false);
+      case Tag.NullLiteral:
+        return new NullLiteral();
+      case Tag.SymbolLiteral:
+        return new SymbolLiteral(readStringReference());
+      case Tag.TypeLiteral:
+        return new TypeLiteral(readDartType());
+      case Tag.ThisExpression:
+        return new ThisExpression();
+      case Tag.Rethrow:
+        return new Rethrow();
+      case Tag.Throw:
+        int offset = readOffset();
+        return new Throw(readExpression())..fileOffset = offset;
+      case Tag.ListLiteral:
+        var typeArgument = readDartType();
+        return new ListLiteral(readExpressionList(),
+            typeArgument: typeArgument, isConst: false);
+      case Tag.ConstListLiteral:
+        var typeArgument = readDartType();
+        return new ListLiteral(readExpressionList(),
+            typeArgument: typeArgument, isConst: true);
+      case Tag.MapLiteral:
+        var keyType = readDartType();
+        var valueType = readDartType();
+        return new MapLiteral(readMapEntryList(),
+            keyType: keyType, valueType: valueType, isConst: false);
+      case Tag.ConstMapLiteral:
+        var keyType = readDartType();
+        var valueType = readDartType();
+        return new MapLiteral(readMapEntryList(),
+            keyType: keyType, valueType: valueType, isConst: true);
+      case Tag.AwaitExpression:
+        return new AwaitExpression(readExpression());
+      case Tag.FunctionExpression:
+        return new FunctionExpression(readFunctionNode());
+      case Tag.Let:
+        var variable = readVariableDeclaration();
+        int stackHeight = variableStack.length;
+        pushVariableDeclaration(variable);
+        var body = readExpression();
+        variableStack.length = stackHeight;
+        return new Let(variable, body);
+      default:
+        throw fail('Invalid expression tag: $tag');
+    }
+  }
+
+  List<MapEntry> readMapEntryList() {
+    return new List<MapEntry>.generate(readUInt(), (i) => readMapEntry());
+  }
+
+  MapEntry readMapEntry() {
+    return new MapEntry(readExpression(), readExpression());
+  }
+
+  List<Statement> readStatementList() {
+    return new List<Statement>.generate(readUInt(), (i) => readStatement());
+  }
+
+  Statement readStatementOrNullIfEmpty() {
+    var node = readStatement();
+    if (node is EmptyStatement) {
+      return null;
+    } else {
+      return node;
+    }
+  }
+
+  Statement readStatementOption() {
+    return readAndCheckOptionTag() ? readStatement() : null;
+  }
+
+  Statement readStatement() {
+    int tag = readByte();
+    switch (tag) {
+      case Tag.InvalidStatement:
+        return new InvalidStatement();
+      case Tag.ExpressionStatement:
+        return new ExpressionStatement(readExpression());
+      case Tag.Block:
+        return readBlock();
+      case Tag.EmptyStatement:
+        return new EmptyStatement();
+      case Tag.AssertStatement:
+        return new AssertStatement(readExpression(), readExpressionOption());
+      case Tag.LabeledStatement:
+        var label = new LabeledStatement(null);
+        labelStack.add(label);
+        label.body = readStatement()..parent = label;
+        labelStack.removeLast();
+        return label;
+      case Tag.BreakStatement:
+        int index = readUInt();
+        return new BreakStatement(labelStack[labelStackBase + index]);
+      case Tag.WhileStatement:
+        return new WhileStatement(readExpression(), readStatement());
+      case Tag.DoStatement:
+        return new DoStatement(readStatement(), readExpression());
+      case Tag.ForStatement:
+        int variableStackHeight = variableStack.length;
+        var variables = readAndPushVariableDeclarationList();
+        var condition = readExpressionOption();
+        var updates = readExpressionList();
+        var body = readStatement();
+        variableStack.length = variableStackHeight;
+        return new ForStatement(variables, condition, updates, body);
+      case Tag.ForInStatement:
+      case Tag.AsyncForInStatement:
+        bool isAsync = tag == Tag.AsyncForInStatement;
+        int variableStackHeight = variableStack.length;
+        var variable = readAndPushVariableDeclaration();
+        var iterable = readExpression();
+        var body = readStatement();
+        variableStack.length = variableStackHeight;
+        return new ForInStatement(variable, iterable, body, isAsync: isAsync);
+      case Tag.SwitchStatement:
+        var expression = readExpression();
+        int count = readUInt();
+        List<SwitchCase> cases =
+            new List<SwitchCase>.generate(count, (i) => new SwitchCase.empty());
+        switchCaseStack.addAll(cases);
+        for (int i = 0; i < cases.length; ++i) {
+          var caseNode = cases[i];
+          _fillTreeNodeList(caseNode.expressions, readExpression, caseNode);
+          caseNode.isDefault = readByte() == 1;
+          caseNode.body = readStatement()..parent = caseNode;
+        }
+        switchCaseStack.length -= count;
+        return new SwitchStatement(expression, cases);
+      case Tag.ContinueSwitchStatement:
+        int index = readUInt();
+        return new ContinueSwitchStatement(switchCaseStack[index]);
+      case Tag.IfStatement:
+        return new IfStatement(
+            readExpression(), readStatement(), readStatementOrNullIfEmpty());
+      case Tag.ReturnStatement:
+        return new ReturnStatement(readExpressionOption());
+      case Tag.TryCatch:
+        return new TryCatch(readStatement(), readCatchList());
+      case Tag.TryFinally:
+        return new TryFinally(readStatement(), readStatement());
+      case Tag.YieldStatement:
+        int flags = readByte();
+        return new YieldStatement(readExpression(),
+            isYieldStar: flags & YieldStatement.FlagYieldStar != 0,
+            isNative: flags & YieldStatement.FlagNative != 0);
+      case Tag.VariableDeclaration:
+        var variable = readVariableDeclaration();
+        variableStack.add(variable); // Will be popped by the enclosing scope.
+        return variable;
+      case Tag.FunctionDeclaration:
+        var variable = readVariableDeclaration();
+        variableStack.add(variable); // Will be popped by the enclosing scope.
+        var function = readFunctionNode();
+        return new FunctionDeclaration(variable, function);
+      default:
+        throw fail('Invalid statement tag: $tag');
+    }
+  }
+
+  List<Catch> readCatchList() {
+    return new List<Catch>.generate(readUInt(), (i) => readCatch());
+  }
+
+  Catch readCatch() {
+    int variableStackHeight = variableStack.length;
+    var guard = readDartType();
+    var exception = readAndPushVariableDeclarationOption();
+    var stackTrace = readAndPushVariableDeclarationOption();
+    var body = readStatement();
+    variableStack.length = variableStackHeight;
+    return new Catch(exception, body, guard: guard, stackTrace: stackTrace);
+  }
+
+  Block readBlock() {
+    int stackHeight = variableStack.length;
+    var body = readStatementList();
+    variableStack.length = stackHeight;
+    return new Block(body);
+  }
+
+  Supertype readSupertype() {
+    InterfaceType type = readDartType();
+    return new Supertype(type.classNode, type.typeArguments);
+  }
+
+  Supertype readSupertypeOption() {
+    return readAndCheckOptionTag() ? readSupertype() : null;
+  }
+
+  List<Supertype> readSupertypeList() {
+    return new List<Supertype>.generate(readUInt(), (i) => readSupertype());
+  }
+
+  List<DartType> readDartTypeList() {
+    return new List<DartType>.generate(readUInt(), (i) => readDartType());
+  }
+
+  List<NamedType> readNamedTypeList() {
+    return new List<NamedType>.generate(readUInt(), (i) => readNamedType());
+  }
+
+  NamedType readNamedType() {
+    return new NamedType(readStringReference(), readDartType());
+  }
+
+  DartType readDartTypeOption() {
+    return readAndCheckOptionTag() ? readDartType() : null;
+  }
+
+  DartType readDartType() {
+    int tag = readByte();
+    switch (tag) {
+      case Tag.BottomType:
+        return const BottomType();
+      case Tag.InvalidType:
+        return const InvalidType();
+      case Tag.DynamicType:
+        return const DynamicType();
+      case Tag.VoidType:
+        return const VoidType();
+      case Tag.InterfaceType:
+        return new InterfaceType(readClassReference(), readDartTypeList());
+      case Tag.SimpleInterfaceType:
+        return new InterfaceType(readClassReference(), const <DartType>[]);
+      case Tag.FunctionType:
+        int typeParameterStackHeight = typeParameterStack.length;
+        var typeParameters = readAndPushTypeParameterList();
+        var requiredParameterCount = readUInt();
+        var positional = readDartTypeList();
+        var named = readNamedTypeList();
+        var returnType = readDartType();
+        typeParameterStack.length = typeParameterStackHeight;
+        return new FunctionType(positional, returnType,
+            typeParameters: typeParameters,
+            requiredParameterCount: requiredParameterCount,
+            namedParameters: named);
+      case Tag.SimpleFunctionType:
+        var positional = readDartTypeList();
+        var returnType = readDartType();
+        return new FunctionType(positional, returnType);
+      case Tag.TypeParameterType:
+        int index = readUInt();
+        return new TypeParameterType(typeParameterStack[index]);
+      default:
+        throw fail('Invalid dart type tag: $tag');
+    }
+  }
+
+  List<TypeParameter> readAndPushTypeParameterList(
+      [List<TypeParameter> list, TreeNode parent]) {
+    int length = readUInt();
+    if (length == 0) return list ?? <TypeParameter>[];
+    if (list == null) {
+      list = new List<TypeParameter>.generate(
+          length, (i) => new TypeParameter(null, null)..parent = parent);
+    } else {
+      list.length = length;
+      for (int i = 0; i < length; ++i) {
+        list[i] = new TypeParameter(null, null)..parent = parent;
+      }
+    }
+    typeParameterStack.addAll(list);
+    for (int i = 0; i < list.length; ++i) {
+      readTypeParameter(list[i]);
+    }
+    return list;
+  }
+
+  void readTypeParameter(TypeParameter node) {
+    node.name = readStringOrNullIfEmpty();
+    node.bound = readDartType();
+  }
+
+  Arguments readArguments() {
+    var typeArguments = readDartTypeList();
+    var positional = readExpressionList();
+    var named = readNamedExpressionList();
+    return new Arguments(positional, types: typeArguments, named: named);
+  }
+
+  List<NamedExpression> readNamedExpressionList() {
+    return new List<NamedExpression>.generate(
+        readUInt(), (i) => readNamedExpression());
+  }
+
+  NamedExpression readNamedExpression() {
+    return new NamedExpression(readStringReference(), readExpression());
+  }
+
+  List<VariableDeclaration> readAndPushVariableDeclarationList() {
+    return new List<VariableDeclaration>.generate(
+        readUInt(), (i) => readAndPushVariableDeclaration());
+  }
+
+  VariableDeclaration readAndPushVariableDeclarationOption() {
+    return readAndCheckOptionTag() ? readAndPushVariableDeclaration() : null;
+  }
+
+  VariableDeclaration readAndPushVariableDeclaration() {
+    var variable = readVariableDeclaration();
+    variableStack.add(variable);
+    return variable;
+  }
+
+  VariableDeclaration readVariableDeclaration() {
+    int flags = readByte();
+    return new VariableDeclaration(readStringOrNullIfEmpty(),
+        type: readDartType(),
+        inferredValue: readOptionalInferredValue(),
+        initializer: readExpressionOption(),
+        isFinal: flags & 0x1 != 0,
+        isConst: flags & 0x2 != 0);
+  }
+
+  int readOffset() {
+    // Offset is saved as unsigned,
+    // but actually ranges from -1 and up (thus the -1)
+    return readUInt() - 1;
+  }
+}
diff --git a/pkg/kernel/lib/binary/ast_to_binary.dart b/pkg/kernel/lib/binary/ast_to_binary.dart
new file mode 100644
index 0000000..68f3687
--- /dev/null
+++ b/pkg/kernel/lib/binary/ast_to_binary.dart
@@ -0,0 +1,1226 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.ast_to_binary;
+
+import '../ast.dart';
+import '../import_table.dart';
+import 'tag.dart';
+import 'dart:convert';
+import 'dart:typed_data';
+import 'dart:collection';
+
+/// Writes to a binary file.
+///
+/// A [BinaryPrinter] can be used to write one file and must then be
+/// discarded.
+class BinaryPrinter extends Visitor {
+  ImportTable _importTable;
+
+  VariableIndexer _variableIndexer;
+  LabelIndexer _labelIndexer;
+  SwitchCaseIndexer _switchCaseIndexer;
+  final TypeParameterIndexer _typeParameterIndexer = new TypeParameterIndexer();
+  final GlobalIndexer _globalIndexer;
+  final StringIndexer _stringIndexer = new StringIndexer();
+  final StringIndexer _sourceUriIndexer = new StringIndexer();
+
+  final BufferedSink _sink;
+
+  /// Create a printer that writes to the given [sink].
+  ///
+  /// The BinaryPrinter will use its own buffer, so the [sink] does not need
+  /// one.
+  ///
+  /// If multiple binaries are to be written based on the same IR, a shared
+  /// [globalIndexer] may be passed in to avoid rebuilding the same indices
+  /// in every printer.
+  BinaryPrinter(Sink<List<int>> sink, {GlobalIndexer globalIndexer})
+      : _sink = new BufferedSink(sink),
+        _globalIndexer = globalIndexer ?? new GlobalIndexer();
+
+  void _flush() {
+    _sink.flushAndDestroy();
+  }
+
+  void writeByte(int byte) {
+    _sink.addByte(byte);
+  }
+
+  void writeBytes(List<int> bytes) {
+    _sink.addBytes(bytes);
+  }
+
+  void writeUInt30(int value) {
+    assert(value >= 0 && value >> 30 == 0);
+    if (value < 0x80) {
+      writeByte(value);
+    } else if (value < 0x4000) {
+      writeByte((value >> 8) | 0x80);
+      writeByte(value & 0xFF);
+    } else {
+      writeByte((value >> 24) | 0xC0);
+      writeByte((value >> 16) & 0xFF);
+      writeByte((value >> 8) & 0xFF);
+      writeByte(value & 0xFF);
+    }
+  }
+
+  void writeMagicWord(int value) {
+    writeByte((value >> 24) & 0xFF);
+    writeByte((value >> 16) & 0xFF);
+    writeByte((value >> 8) & 0xFF);
+    writeByte(value & 0xFF);
+  }
+
+  void writeStringTableEntry(String string) {
+    List<int> utf8Bytes = const Utf8Encoder().convert(string);
+    writeUInt30(utf8Bytes.length);
+    writeBytes(utf8Bytes);
+  }
+
+  void writeStringTable(StringIndexer indexer) {
+    writeUInt30(indexer.numberOfStrings);
+    for (var entry in indexer.entries) {
+      writeStringTableEntry(entry.value);
+    }
+  }
+
+  void writeStringReference(String string) {
+    writeUInt30(_stringIndexer[string]);
+  }
+
+  void writeUriReference(String string) {
+    int index = _sourceUriIndexer[string];
+    if (index == null) {
+      // Assume file was loaded without linking. Bail out to empty string.
+      index = _sourceUriIndexer[""];
+    }
+    writeUInt30(index);
+  }
+
+  void writeList(List items, writeItem(x)) {
+    writeUInt30(items.length);
+    items.forEach(writeItem);
+  }
+
+  void writeNodeList(List<Node> nodes) {
+    writeList(nodes, writeNode);
+  }
+
+  void writeNode(Node node) {
+    node.accept(this);
+  }
+
+  void writeOptionalNode(Node node) {
+    if (node == null) {
+      writeByte(Tag.Nothing);
+    } else {
+      writeByte(Tag.Something);
+      writeNode(node);
+    }
+  }
+
+  void writeOptionalInferredValue(InferredValue node) {
+    if (node == null) {
+      writeByte(Tag.Nothing);
+    } else {
+      writeByte(Tag.Something);
+      writeClassReference(node.baseClass, allowNull: true);
+      writeByte(node.baseClassKind.index);
+      writeByte(node.valueBits);
+    }
+  }
+
+  void writeProgramFile(Program program) {
+    writeMagicWord(Tag.ProgramFile);
+    _importTable = new ProgramImportTable(program);
+    _stringIndexer.build(program);
+    writeStringTable(_stringIndexer);
+    writeUriToLineStarts(program);
+    writeList(program.libraries, writeNode);
+    writeMemberReference(program.mainMethod, allowNull: true);
+    _flush();
+  }
+
+  void writeUriToLineStarts(Program program) {
+    program.uriToLineStarts.keys.forEach((uri) {
+      _sourceUriIndexer.put(uri);
+    });
+    writeStringTable(_sourceUriIndexer);
+    for (int i = 0; i < _sourceUriIndexer.entries.length; i++) {
+      String uri = _sourceUriIndexer.entries[i].value;
+      List<int> lineStarts = program.uriToLineStarts[uri] ?? [];
+      writeUInt30(lineStarts.length);
+      int previousLineStart = 0;
+      lineStarts.forEach((lineStart) {
+        writeUInt30(lineStart - previousLineStart);
+        previousLineStart = lineStart;
+      });
+    }
+  }
+
+  void writeLibraryImportTable(LibraryImportTable imports) {
+    writeList(imports.importPaths, writeStringReference);
+  }
+
+  void writeLibraryReference(Library node) {
+    int index = _importTable.getImportIndex(node);
+    if (index == -1) {
+      throw 'Missing import for library: ${node.importUri}';
+    }
+    writeUInt30(index);
+  }
+
+  void writeClassIndex(Class node) {
+    writeUInt30(_globalIndexer[node]);
+  }
+
+  void writeClassReference(Class node, {bool allowNull: false}) {
+    if (node == null) {
+      if (allowNull) {
+        writeByte(Tag.NullReference);
+      } else {
+        throw 'Expected a class reference to be valid but was `null`.';
+      }
+    } else {
+      node.acceptReference(this);
+    }
+  }
+
+  void writeMemberReference(Member node, {bool allowNull: false}) {
+    if (node == null) {
+      if (allowNull) {
+        writeByte(Tag.NullReference);
+      } else {
+        throw 'Expected a member reference to be valid but was `null`.';
+      }
+    } else {
+      node.acceptReference(this);
+    }
+  }
+
+  writeOffset(TreeNode node) {
+    // TODO(jensj): Delta-encoding.
+    // File offset ranges from -1 and up,
+    // but is here saved as unsigned (thus the +1)
+    writeUInt30(node.fileOffset + 1);
+  }
+
+  void visitClassReference(Class node) {
+    var library = node.enclosingLibrary;
+    writeByte(node.isMixinApplication
+        ? Tag.MixinClassReference
+        : Tag.NormalClassReference);
+    writeLibraryReference(library);
+    writeClassIndex(node);
+  }
+
+  void visitFieldReference(Field node) {
+    if (node.enclosingClass != null) {
+      writeByte(Tag.ClassFieldReference);
+      Class classNode = node.enclosingClass;
+      writeClassReference(classNode);
+      writeUInt30(_globalIndexer[node]);
+    } else {
+      writeByte(Tag.LibraryFieldReference);
+      writeLibraryReference(node.enclosingLibrary);
+      writeUInt30(_globalIndexer[node]);
+    }
+  }
+
+  void visitConstructorReference(Constructor node) {
+    writeByte(Tag.ClassConstructorReference);
+    writeClassReference(node.enclosingClass);
+    writeUInt30(_globalIndexer[node]);
+  }
+
+  void visitProcedureReference(Procedure node) {
+    if (node.enclosingClass != null) {
+      writeByte(Tag.ClassProcedureReference);
+      Class classNode = node.enclosingClass;
+      writeClassReference(classNode);
+      writeUInt30(_globalIndexer[node]);
+    } else {
+      writeByte(Tag.LibraryProcedureReference);
+      writeLibraryReference(node.enclosingLibrary);
+      writeUInt30(_globalIndexer[node]);
+    }
+  }
+
+  void writeName(Name node) {
+    writeStringReference(node.name);
+    // TODO: Consider a more compressed format for private names within the
+    // enclosing library.
+    if (node.isPrivate) {
+      writeLibraryReference(node.library);
+    }
+  }
+
+  bool insideExternalLibrary = false;
+
+  visitLibrary(Library node) {
+    insideExternalLibrary = node.isExternal;
+    writeByte(insideExternalLibrary ? 1 : 0);
+    writeStringReference(node.name ?? '');
+    writeStringReference('${node.importUri}');
+    // TODO(jensj): We save (almost) the same URI twice.
+    writeUriReference(node.fileUri ?? '');
+    writeNodeList(node.classes);
+    writeNodeList(node.fields);
+    writeNodeList(node.procedures);
+  }
+
+  void writeAnnotation(Expression annotation) {
+    _variableIndexer ??= new VariableIndexer();
+    writeNode(annotation);
+  }
+
+  void writeAnnotationList(List<Expression> annotations) {
+    writeList(annotations, writeAnnotation);
+  }
+
+  visitClass(Class node) {
+    int flags = node.isAbstract ? 1 : 0;
+    if (node.level == ClassLevel.Type) {
+      flags |= 0x2;
+    }
+    if (node.isMixinApplication) {
+      writeByte(Tag.MixinClass);
+      writeByte(flags);
+      writeStringReference(node.name ?? '');
+      writeUriReference(node.fileUri ?? '');
+      writeAnnotationList(node.annotations);
+      _typeParameterIndexer.enter(node.typeParameters);
+      writeNodeList(node.typeParameters);
+      writeNode(node.supertype);
+      writeNode(node.mixedInType);
+      writeNodeList(node.implementedTypes);
+      writeNodeList(node.constructors);
+      _typeParameterIndexer.exit(node.typeParameters);
+    } else {
+      writeByte(Tag.NormalClass);
+      writeByte(flags);
+      writeStringReference(node.name ?? '');
+      writeUriReference(node.fileUri ?? '');
+      writeAnnotationList(node.annotations);
+      _typeParameterIndexer.enter(node.typeParameters);
+      writeNodeList(node.typeParameters);
+      writeOptionalNode(node.supertype);
+      writeNodeList(node.implementedTypes);
+      writeNodeList(node.fields);
+      writeNodeList(node.constructors);
+      writeNodeList(node.procedures);
+      _typeParameterIndexer.exit(node.typeParameters);
+    }
+  }
+
+  static final Name _emptyName = new Name('');
+
+  visitConstructor(Constructor node) {
+    _variableIndexer = new VariableIndexer();
+    writeByte(Tag.Constructor);
+    writeByte(node.flags);
+    writeName(node.name ?? _emptyName);
+    writeAnnotationList(node.annotations);
+    assert(node.function.typeParameters.isEmpty);
+    writeNode(node.function);
+    // Parameters are in scope in the initializers.
+    _variableIndexer.restoreScope(node.function.positionalParameters.length +
+        node.function.namedParameters.length);
+    writeNodeList(node.initializers);
+    _variableIndexer = null;
+  }
+
+  visitProcedure(Procedure node) {
+    _variableIndexer = new VariableIndexer();
+    writeByte(Tag.Procedure);
+    writeByte(node.kind.index);
+    writeByte(node.flags);
+    writeName(node.name ?? '');
+    writeUriReference(node.fileUri ?? '');
+    writeAnnotationList(node.annotations);
+    writeOptionalNode(node.function);
+    _variableIndexer = null;
+  }
+
+  visitField(Field node) {
+    _variableIndexer = new VariableIndexer();
+    writeByte(Tag.Field);
+    writeOffset(node);
+    writeByte(node.flags);
+    writeName(node.name ?? '');
+    writeUriReference(node.fileUri ?? '');
+    writeAnnotationList(node.annotations);
+    writeNode(node.type);
+    writeOptionalInferredValue(node.inferredValue);
+    writeOptionalNode(node.initializer);
+    _variableIndexer = null;
+  }
+
+  visitInvalidInitializer(InvalidInitializer node) {
+    writeByte(Tag.InvalidInitializer);
+  }
+
+  visitFieldInitializer(FieldInitializer node) {
+    writeByte(Tag.FieldInitializer);
+    writeMemberReference(node.field);
+    writeNode(node.value);
+  }
+
+  visitSuperInitializer(SuperInitializer node) {
+    writeByte(Tag.SuperInitializer);
+    writeMemberReference(node.target);
+    writeNode(node.arguments);
+  }
+
+  visitRedirectingInitializer(RedirectingInitializer node) {
+    writeByte(Tag.RedirectingInitializer);
+    writeMemberReference(node.target);
+    writeNode(node.arguments);
+  }
+
+  visitLocalInitializer(LocalInitializer node) {
+    writeByte(Tag.LocalInitializer);
+    writeVariableDeclaration(node.variable);
+  }
+
+  visitFunctionNode(FunctionNode node) {
+    assert(_variableIndexer != null);
+    _variableIndexer.pushScope();
+    var oldLabels = _labelIndexer;
+    _labelIndexer = new LabelIndexer();
+    var oldCases = _switchCaseIndexer;
+    _switchCaseIndexer = new SwitchCaseIndexer();
+    // Note: FunctionNode has no tag.
+    _typeParameterIndexer.enter(node.typeParameters);
+    writeByte(node.asyncMarker.index);
+    writeNodeList(node.typeParameters);
+    writeUInt30(node.requiredParameterCount);
+    writeVariableDeclarationList(node.positionalParameters);
+    writeVariableDeclarationList(node.namedParameters);
+    writeNode(node.returnType);
+    writeOptionalInferredValue(node.inferredReturnValue);
+    writeOptionalNode(node.body);
+    _labelIndexer = oldLabels;
+    _switchCaseIndexer = oldCases;
+    _typeParameterIndexer.exit(node.typeParameters);
+    _variableIndexer.popScope();
+  }
+
+  visitInvalidExpression(InvalidExpression node) {
+    writeByte(Tag.InvalidExpression);
+  }
+
+  visitVariableGet(VariableGet node) {
+    assert(_variableIndexer != null);
+    int index = _variableIndexer[node.variable];
+    assert(index != null);
+    if (index & Tag.SpecializedPayloadMask == index &&
+        node.promotedType == null) {
+      writeByte(Tag.SpecializedVariableGet + index);
+    } else {
+      writeByte(Tag.VariableGet);
+      writeUInt30(_variableIndexer[node.variable]);
+      writeOptionalNode(node.promotedType);
+    }
+  }
+
+  visitVariableSet(VariableSet node) {
+    assert(_variableIndexer != null);
+    int index = _variableIndexer[node.variable];
+    if (index & Tag.SpecializedPayloadMask == index) {
+      writeByte(Tag.SpecializedVariableSet + index);
+      writeNode(node.value);
+    } else {
+      writeByte(Tag.VariableSet);
+      writeUInt30(_variableIndexer[node.variable]);
+      writeNode(node.value);
+    }
+  }
+
+  visitPropertyGet(PropertyGet node) {
+    writeByte(Tag.PropertyGet);
+    writeOffset(node);
+    writeNode(node.receiver);
+    writeName(node.name);
+    writeMemberReference(node.interfaceTarget, allowNull: true);
+  }
+
+  visitPropertySet(PropertySet node) {
+    writeByte(Tag.PropertySet);
+    writeOffset(node);
+    writeNode(node.receiver);
+    writeName(node.name);
+    writeNode(node.value);
+    writeMemberReference(node.interfaceTarget, allowNull: true);
+  }
+
+  visitSuperPropertyGet(SuperPropertyGet node) {
+    writeByte(Tag.SuperPropertyGet);
+    writeName(node.name);
+    writeMemberReference(node.interfaceTarget, allowNull: true);
+  }
+
+  visitSuperPropertySet(SuperPropertySet node) {
+    writeByte(Tag.SuperPropertySet);
+    writeName(node.name);
+    writeNode(node.value);
+    writeMemberReference(node.interfaceTarget, allowNull: true);
+  }
+
+  visitDirectPropertyGet(DirectPropertyGet node) {
+    writeByte(Tag.DirectPropertyGet);
+    writeNode(node.receiver);
+    writeMemberReference(node.target);
+  }
+
+  visitDirectPropertySet(DirectPropertySet node) {
+    writeByte(Tag.DirectPropertySet);
+    writeNode(node.receiver);
+    writeMemberReference(node.target);
+    writeNode(node.value);
+  }
+
+  visitStaticGet(StaticGet node) {
+    writeByte(Tag.StaticGet);
+    writeOffset(node);
+    writeMemberReference(node.target);
+  }
+
+  visitStaticSet(StaticSet node) {
+    writeByte(Tag.StaticSet);
+    writeMemberReference(node.target);
+    writeNode(node.value);
+  }
+
+  visitMethodInvocation(MethodInvocation node) {
+    writeByte(Tag.MethodInvocation);
+    writeOffset(node);
+    writeNode(node.receiver);
+    writeName(node.name);
+    writeNode(node.arguments);
+    writeMemberReference(node.interfaceTarget, allowNull: true);
+  }
+
+  visitSuperMethodInvocation(SuperMethodInvocation node) {
+    writeByte(Tag.SuperMethodInvocation);
+    writeOffset(node);
+    writeName(node.name);
+    writeNode(node.arguments);
+    writeMemberReference(node.interfaceTarget, allowNull: true);
+  }
+
+  visitDirectMethodInvocation(DirectMethodInvocation node) {
+    writeByte(Tag.DirectMethodInvocation);
+    writeNode(node.receiver);
+    writeMemberReference(node.target);
+    writeNode(node.arguments);
+  }
+
+  visitStaticInvocation(StaticInvocation node) {
+    writeByte(node.isConst ? Tag.ConstStaticInvocation : Tag.StaticInvocation);
+    writeOffset(node);
+    writeMemberReference(node.target);
+    writeNode(node.arguments);
+  }
+
+  visitConstructorInvocation(ConstructorInvocation node) {
+    writeByte(node.isConst
+        ? Tag.ConstConstructorInvocation
+        : Tag.ConstructorInvocation);
+    writeOffset(node);
+    writeMemberReference(node.target);
+    writeNode(node.arguments);
+  }
+
+  visitArguments(Arguments node) {
+    writeNodeList(node.types);
+    writeNodeList(node.positional);
+    writeNodeList(node.named);
+  }
+
+  visitNamedExpression(NamedExpression node) {
+    writeStringReference(node.name);
+    writeNode(node.value);
+  }
+
+  visitNot(Not node) {
+    writeByte(Tag.Not);
+    writeNode(node.operand);
+  }
+
+  int logicalOperatorIndex(String operator) {
+    switch (operator) {
+      case '&&':
+        return 0;
+      case '||':
+        return 1;
+    }
+    throw 'Not a logical operator: $operator';
+  }
+
+  visitLogicalExpression(LogicalExpression node) {
+    writeByte(Tag.LogicalExpression);
+    writeNode(node.left);
+    writeByte(logicalOperatorIndex(node.operator));
+    writeNode(node.right);
+  }
+
+  visitConditionalExpression(ConditionalExpression node) {
+    writeByte(Tag.ConditionalExpression);
+    writeNode(node.condition);
+    writeNode(node.then);
+    writeNode(node.otherwise);
+    writeOptionalNode(node.staticType);
+  }
+
+  visitStringConcatenation(StringConcatenation node) {
+    writeByte(Tag.StringConcatenation);
+    writeNodeList(node.expressions);
+  }
+
+  visitIsExpression(IsExpression node) {
+    writeByte(Tag.IsExpression);
+    writeNode(node.operand);
+    writeNode(node.type);
+  }
+
+  visitAsExpression(AsExpression node) {
+    writeByte(Tag.AsExpression);
+    writeNode(node.operand);
+    writeNode(node.type);
+  }
+
+  visitStringLiteral(StringLiteral node) {
+    writeByte(Tag.StringLiteral);
+    writeStringReference(node.value);
+  }
+
+  visitIntLiteral(IntLiteral node) {
+    int value = node.value;
+    int biasedValue = value + Tag.SpecializedIntLiteralBias;
+    if (biasedValue >= 0 &&
+        biasedValue & Tag.SpecializedPayloadMask == biasedValue) {
+      writeByte(Tag.SpecializedIntLiteral + biasedValue);
+    } else if (value.abs() >> 30 == 0) {
+      if (value < 0) {
+        writeByte(Tag.NegativeIntLiteral);
+        writeUInt30(-value);
+      } else {
+        writeByte(Tag.PositiveIntLiteral);
+        writeUInt30(value);
+      }
+    } else {
+      // TODO: Pick a better format for big int literals.
+      writeByte(Tag.BigIntLiteral);
+      writeStringReference('${node.value}');
+    }
+  }
+
+  visitDoubleLiteral(DoubleLiteral node) {
+    // TODO: Pick a better format for double literals.
+    writeByte(Tag.DoubleLiteral);
+    writeStringReference('${node.value}');
+  }
+
+  visitBoolLiteral(BoolLiteral node) {
+    writeByte(node.value ? Tag.TrueLiteral : Tag.FalseLiteral);
+  }
+
+  visitNullLiteral(NullLiteral node) {
+    writeByte(Tag.NullLiteral);
+  }
+
+  visitSymbolLiteral(SymbolLiteral node) {
+    writeByte(Tag.SymbolLiteral);
+    writeStringReference(node.value);
+  }
+
+  visitTypeLiteral(TypeLiteral node) {
+    writeByte(Tag.TypeLiteral);
+    writeNode(node.type);
+  }
+
+  visitThisExpression(ThisExpression node) {
+    writeByte(Tag.ThisExpression);
+  }
+
+  visitRethrow(Rethrow node) {
+    writeByte(Tag.Rethrow);
+  }
+
+  visitThrow(Throw node) {
+    writeByte(Tag.Throw);
+    writeOffset(node);
+    writeNode(node.expression);
+  }
+
+  visitListLiteral(ListLiteral node) {
+    writeByte(node.isConst ? Tag.ConstListLiteral : Tag.ListLiteral);
+    writeNode(node.typeArgument);
+    writeNodeList(node.expressions);
+  }
+
+  visitMapLiteral(MapLiteral node) {
+    writeByte(node.isConst ? Tag.ConstMapLiteral : Tag.MapLiteral);
+    writeNode(node.keyType);
+    writeNode(node.valueType);
+    writeNodeList(node.entries);
+  }
+
+  visitMapEntry(MapEntry node) {
+    // Note: there is no tag on MapEntry
+    writeNode(node.key);
+    writeNode(node.value);
+  }
+
+  visitAwaitExpression(AwaitExpression node) {
+    writeByte(Tag.AwaitExpression);
+    writeNode(node.operand);
+  }
+
+  visitFunctionExpression(FunctionExpression node) {
+    writeByte(Tag.FunctionExpression);
+    writeNode(node.function);
+  }
+
+  visitLet(Let node) {
+    writeByte(Tag.Let);
+    writeVariableDeclaration(node.variable);
+    writeNode(node.body);
+    --_variableIndexer.stackHeight;
+  }
+
+  writeStatementOrEmpty(Statement node) {
+    if (node == null) {
+      writeByte(Tag.EmptyStatement);
+    } else {
+      writeNode(node);
+    }
+  }
+
+  visitInvalidStatement(InvalidStatement node) {
+    writeByte(Tag.InvalidStatement);
+  }
+
+  visitExpressionStatement(ExpressionStatement node) {
+    writeByte(Tag.ExpressionStatement);
+    writeNode(node.expression);
+  }
+
+  visitBlock(Block node) {
+    _variableIndexer.pushScope();
+    writeByte(Tag.Block);
+    writeNodeList(node.statements);
+    _variableIndexer.popScope();
+  }
+
+  visitEmptyStatement(EmptyStatement node) {
+    writeByte(Tag.EmptyStatement);
+  }
+
+  visitAssertStatement(AssertStatement node) {
+    writeByte(Tag.AssertStatement);
+    writeNode(node.condition);
+    writeOptionalNode(node.message);
+  }
+
+  visitLabeledStatement(LabeledStatement node) {
+    _labelIndexer.enter(node);
+    writeByte(Tag.LabeledStatement);
+    writeNode(node.body);
+    _labelIndexer.exit();
+  }
+
+  visitBreakStatement(BreakStatement node) {
+    writeByte(Tag.BreakStatement);
+    writeUInt30(_labelIndexer[node.target]);
+  }
+
+  visitWhileStatement(WhileStatement node) {
+    writeByte(Tag.WhileStatement);
+    writeNode(node.condition);
+    writeNode(node.body);
+  }
+
+  visitDoStatement(DoStatement node) {
+    writeByte(Tag.DoStatement);
+    writeNode(node.body);
+    writeNode(node.condition);
+  }
+
+  visitForStatement(ForStatement node) {
+    _variableIndexer.pushScope();
+    writeByte(Tag.ForStatement);
+    writeVariableDeclarationList(node.variables);
+    writeOptionalNode(node.condition);
+    writeNodeList(node.updates);
+    writeNode(node.body);
+    _variableIndexer.popScope();
+  }
+
+  visitForInStatement(ForInStatement node) {
+    _variableIndexer.pushScope();
+    writeByte(node.isAsync ? Tag.AsyncForInStatement : Tag.ForInStatement);
+    writeVariableDeclaration(node.variable);
+    writeNode(node.iterable);
+    writeNode(node.body);
+    _variableIndexer.popScope();
+  }
+
+  visitSwitchStatement(SwitchStatement node) {
+    _switchCaseIndexer.enter(node);
+    writeByte(Tag.SwitchStatement);
+    writeNode(node.expression);
+    writeNodeList(node.cases);
+    _switchCaseIndexer.exit(node);
+  }
+
+  visitSwitchCase(SwitchCase node) {
+    // Note: there is no tag on SwitchCase.
+    writeNodeList(node.expressions);
+    writeByte(node.isDefault ? 1 : 0);
+    writeNode(node.body);
+  }
+
+  visitContinueSwitchStatement(ContinueSwitchStatement node) {
+    writeByte(Tag.ContinueSwitchStatement);
+    writeUInt30(_switchCaseIndexer[node.target]);
+  }
+
+  visitIfStatement(IfStatement node) {
+    writeByte(Tag.IfStatement);
+    writeNode(node.condition);
+    writeNode(node.then);
+    writeStatementOrEmpty(node.otherwise);
+  }
+
+  visitReturnStatement(ReturnStatement node) {
+    writeByte(Tag.ReturnStatement);
+    writeOptionalNode(node.expression);
+  }
+
+  visitTryCatch(TryCatch node) {
+    writeByte(Tag.TryCatch);
+    writeNode(node.body);
+    writeNodeList(node.catches);
+  }
+
+  visitCatch(Catch node) {
+    // Note: there is no tag on Catch.
+    _variableIndexer.pushScope();
+    writeNode(node.guard);
+    writeOptionalVariableDeclaration(node.exception);
+    writeOptionalVariableDeclaration(node.stackTrace);
+    writeNode(node.body);
+    _variableIndexer.popScope();
+  }
+
+  visitTryFinally(TryFinally node) {
+    writeByte(Tag.TryFinally);
+    writeNode(node.body);
+    writeNode(node.finalizer);
+  }
+
+  visitYieldStatement(YieldStatement node) {
+    writeByte(Tag.YieldStatement);
+    writeByte(node.flags);
+    writeNode(node.expression);
+  }
+
+  visitVariableDeclaration(VariableDeclaration node) {
+    writeByte(Tag.VariableDeclaration);
+    writeVariableDeclaration(node);
+  }
+
+  void writeVariableDeclaration(VariableDeclaration node) {
+    writeByte(node.flags);
+    writeStringReference(node.name ?? '');
+    writeNode(node.type);
+    writeOptionalInferredValue(node.inferredValue);
+    writeOptionalNode(node.initializer);
+    // Declare the variable after its initializer. It is not in scope in its
+    // own initializer.
+    _variableIndexer.declare(node);
+  }
+
+  void writeVariableDeclarationList(List<VariableDeclaration> nodes) {
+    writeList(nodes, writeVariableDeclaration);
+  }
+
+  void writeOptionalVariableDeclaration(VariableDeclaration node) {
+    if (node == null) {
+      writeByte(Tag.Nothing);
+    } else {
+      writeByte(Tag.Something);
+      writeVariableDeclaration(node);
+    }
+  }
+
+  visitFunctionDeclaration(FunctionDeclaration node) {
+    writeByte(Tag.FunctionDeclaration);
+    writeVariableDeclaration(node.variable);
+    writeNode(node.function);
+  }
+
+  visitBottomType(BottomType node) {
+    writeByte(Tag.BottomType);
+  }
+
+  visitInvalidType(InvalidType node) {
+    writeByte(Tag.InvalidType);
+  }
+
+  visitDynamicType(DynamicType node) {
+    writeByte(Tag.DynamicType);
+  }
+
+  visitVoidType(VoidType node) {
+    writeByte(Tag.VoidType);
+  }
+
+  visitInterfaceType(InterfaceType node) {
+    if (node.typeArguments.isEmpty) {
+      writeByte(Tag.SimpleInterfaceType);
+      writeClassReference(node.classNode);
+    } else {
+      writeByte(Tag.InterfaceType);
+      writeClassReference(node.classNode);
+      writeNodeList(node.typeArguments);
+    }
+  }
+
+  visitSupertype(Supertype node) {
+    if (node.typeArguments.isEmpty) {
+      writeByte(Tag.SimpleInterfaceType);
+      writeClassReference(node.classNode);
+    } else {
+      writeByte(Tag.InterfaceType);
+      writeClassReference(node.classNode);
+      writeNodeList(node.typeArguments);
+    }
+  }
+
+  visitFunctionType(FunctionType node) {
+    if (node.requiredParameterCount == node.positionalParameters.length &&
+        node.typeParameters.isEmpty &&
+        node.namedParameters.isEmpty) {
+      writeByte(Tag.SimpleFunctionType);
+      writeNodeList(node.positionalParameters);
+      writeNode(node.returnType);
+    } else {
+      writeByte(Tag.FunctionType);
+      _typeParameterIndexer.enter(node.typeParameters);
+      writeNodeList(node.typeParameters);
+      writeUInt30(node.requiredParameterCount);
+      writeNodeList(node.positionalParameters);
+      writeNodeList(node.namedParameters);
+      writeNode(node.returnType);
+      _typeParameterIndexer.exit(node.typeParameters);
+    }
+  }
+
+  visitNamedType(NamedType node) {
+    writeStringReference(node.name);
+    writeNode(node.type);
+  }
+
+  visitTypeParameterType(TypeParameterType node) {
+    writeByte(Tag.TypeParameterType);
+    writeUInt30(_typeParameterIndexer[node.parameter]);
+  }
+
+  visitTypeParameter(TypeParameter node) {
+    writeStringReference(node.name ?? '');
+    writeNode(node.bound);
+  }
+
+  defaultNode(Node node) {
+    throw 'Unsupported node: $node';
+  }
+}
+
+class VariableIndexer {
+  final Map<VariableDeclaration, int> index = <VariableDeclaration, int>{};
+  final List<int> scopes = <int>[];
+  int stackHeight = 0;
+
+  void declare(VariableDeclaration node) {
+    index[node] = stackHeight++;
+  }
+
+  void pushScope() {
+    scopes.add(stackHeight);
+  }
+
+  void popScope() {
+    stackHeight = scopes.removeLast();
+  }
+
+  void restoreScope(int numberOfVariables) {
+    stackHeight += numberOfVariables;
+  }
+
+  int operator [](VariableDeclaration node) {
+    return index[node];
+  }
+}
+
+class LabelIndexer {
+  final Map<LabeledStatement, int> index = <LabeledStatement, int>{};
+  int stackHeight = 0;
+
+  void enter(LabeledStatement node) {
+    index[node] = stackHeight++;
+  }
+
+  void exit() {
+    --stackHeight;
+  }
+
+  int operator [](LabeledStatement node) => index[node];
+}
+
+class SwitchCaseIndexer {
+  final Map<SwitchCase, int> index = <SwitchCase, int>{};
+  int stackHeight = 0;
+
+  void enter(SwitchStatement node) {
+    for (var caseNode in node.cases) {
+      index[caseNode] = stackHeight++;
+    }
+  }
+
+  void exit(SwitchStatement node) {
+    stackHeight -= node.cases.length;
+  }
+
+  int operator [](SwitchCase node) => index[node];
+}
+
+class TypeParameterIndexer {
+  final Map<TypeParameter, int> index = <TypeParameter, int>{};
+  int stackHeight = 0;
+
+  void enter(List<TypeParameter> typeParameters) {
+    for (var parameter in typeParameters) {
+      index[parameter] = stackHeight;
+      ++stackHeight;
+    }
+  }
+
+  void exit(List<TypeParameter> typeParameters) {
+    stackHeight -= typeParameters.length;
+  }
+
+  int operator [](TypeParameter parameter) => index[parameter];
+}
+
+class StringTableEntry implements Comparable<StringTableEntry> {
+  final String value;
+  int frequency = 0;
+
+  StringTableEntry(this.value);
+
+  int compareTo(StringTableEntry other) => other.frequency - frequency;
+}
+
+class StringIndexer extends RecursiveVisitor<Null> {
+  final List<StringTableEntry> entries = <StringTableEntry>[];
+  final LinkedHashMap<String, int> index = new LinkedHashMap<String, int>();
+
+  StringIndexer() {
+    put('');
+  }
+
+  int get numberOfStrings => index.length;
+
+  void build(Node node) {
+    node.accept(this);
+    entries.sort();
+    for (int i = 0; i < entries.length; ++i) {
+      index[entries[i].value] = i;
+    }
+  }
+
+  void put(String string) {
+    int i = index.putIfAbsent(string, () {
+      entries.add(new StringTableEntry(string));
+      return index.length;
+    });
+    ++entries[i].frequency;
+  }
+
+  void putOptional(String string) {
+    if (string != null) {
+      put(string);
+    }
+  }
+
+  int operator [](String string) => index[string];
+
+  void addLibraryImports(LibraryImportTable imports) {
+    imports.importPaths.forEach(put);
+  }
+
+  visitName(Name node) {
+    put(node.name);
+  }
+
+  visitLibrary(Library node) {
+    putOptional(node.name);
+    put('${node.importUri}');
+    node.visitChildren(this);
+  }
+
+  visitClass(Class node) {
+    putOptional(node.name);
+    node.visitChildren(this);
+  }
+
+  visitNamedExpression(NamedExpression node) {
+    put(node.name);
+    node.visitChildren(this);
+  }
+
+  visitStringLiteral(StringLiteral node) {
+    put(node.value);
+  }
+
+  visitIntLiteral(IntLiteral node) {
+    if (node.value.abs() >> 30 != 0) {
+      put('${node.value}');
+    }
+  }
+
+  visitDoubleLiteral(DoubleLiteral node) {
+    put('${node.value}');
+  }
+
+  visitSymbolLiteral(SymbolLiteral node) {
+    put(node.value);
+  }
+
+  visitVariableDeclaration(VariableDeclaration node) {
+    putOptional(node.name);
+    node.visitChildren(this);
+  }
+
+  visitNamedType(NamedType node) {
+    put(node.name);
+    node.visitChildren(this);
+  }
+
+  visitTypeParameter(TypeParameter node) {
+    putOptional(node.name);
+    node.visitChildren(this);
+  }
+}
+
+/// Computes and stores the index of a library, class, or member within its
+/// parent list.
+class GlobalIndexer extends TreeVisitor {
+  final Map<TreeNode, int> indices = <TreeNode, int>{};
+
+  void buildIndexForContainer(TreeNode libraryOrClass) {
+    libraryOrClass.accept(this);
+  }
+
+  void buildIndexForList(List<TreeNode> list) {
+    for (int i = 0; i < list.length; ++i) {
+      TreeNode child = list[i];
+      if (child != null) {
+        indices[child] = i;
+      }
+    }
+  }
+
+  visitProgram(Program node) {
+    buildIndexForList(node.libraries);
+  }
+
+  visitLibrary(Library node) {
+    buildIndexForList(node.classes);
+    buildIndexForList(node.fields);
+    buildIndexForList(node.procedures);
+  }
+
+  visitClass(Class node) {
+    buildIndexForList(node.fields);
+    buildIndexForList(node.constructors);
+    buildIndexForList(node.procedures);
+  }
+
+  int operator [](TreeNode memberOrLibraryOrClass) {
+    var node = memberOrLibraryOrClass;
+    assert(node is Member || node is Library || node is Class);
+    int index = indices[node];
+    if (index == null) {
+      buildIndexForContainer(node.parent);
+      return indices[node];
+    } else {
+      return index;
+    }
+  }
+}
+
+/// Puts a buffer in front of a [Sink<List<int>>].
+class BufferedSink {
+  static const int SIZE = 100000;
+  static const int SMALL = 10000;
+  final Sink<List<int>> _sink;
+  Uint8List _buffer = new Uint8List(SIZE);
+  int length = 0;
+
+  BufferedSink(this._sink);
+
+  void addByte(int byte) {
+    _buffer[length++] = byte;
+    if (length == SIZE) {
+      _sink.add(_buffer);
+      _buffer = new Uint8List(SIZE);
+      length = 0;
+    }
+  }
+
+  void addBytes(List<int> bytes) {
+    // Avoid copying a large buffer into the another large buffer. Also, if
+    // the bytes buffer is too large to fit in our own buffer, just emit both.
+    if (length + bytes.length < SIZE &&
+        (bytes.length < SMALL || length < SMALL)) {
+      if (length == 0) {
+        _sink.add(bytes);
+      } else {
+        _buffer.setRange(length, length + bytes.length, bytes);
+        length += bytes.length;
+      }
+    } else if (bytes.length < SMALL) {
+      // Flush as much as we can in the current buffer.
+      _buffer.setRange(length, SIZE, bytes);
+      _sink.add(_buffer);
+      // Copy over the remainder into a new buffer. It is guaranteed to fit
+      // because the input byte array is small.
+      int alreadyEmitted = SIZE - length;
+      int remainder = bytes.length - alreadyEmitted;
+      _buffer = new Uint8List(SIZE);
+      _buffer.setRange(0, remainder, bytes, alreadyEmitted);
+      length = remainder;
+    } else {
+      _sink.add(_buffer.sublist(0, length));
+      _sink.add(bytes);
+      _buffer = new Uint8List(SIZE);
+      length = 0;
+    }
+  }
+
+  void flush() {
+    _sink.add(_buffer.sublist(0, length));
+    _buffer = new Uint8List(SIZE);
+    length = 0;
+  }
+
+  void flushAndDestroy() {
+    _sink.add(_buffer.sublist(0, length));
+  }
+}
diff --git a/pkg/kernel/lib/binary/loader.dart b/pkg/kernel/lib/binary/loader.dart
new file mode 100644
index 0000000..8ee8fb5
--- /dev/null
+++ b/pkg/kernel/lib/binary/loader.dart
@@ -0,0 +1,116 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.binary.loader;
+
+import '../repository.dart';
+import '../ast.dart';
+import 'tag.dart';
+import 'dart:io';
+import 'ast_from_binary.dart';
+
+abstract class BinaryReferenceLoader {
+  Library getLibraryReference(Library from, String relativePath);
+  Class getClassReference(Library library, int tag, int index);
+  Member getMemberReference(TreeNode classOrLibrary, int tag, int index);
+  Member getLibraryMemberReference(Library library, int tag, int index);
+  Member getClassMemberReference(Class classNode, int tag, int index);
+}
+
+class BinaryLoader implements BinaryReferenceLoader {
+  final Repository repository;
+
+  BinaryLoader(this.repository);
+
+  Library getLibraryReference(Library from, String relativePath) {
+    var fullUri = from.importUri.resolve(relativePath);
+    return repository.getLibraryReference(fullUri);
+  }
+
+  static int _pow2roundup(int x) {
+    --x;
+    x |= x >> 1;
+    x |= x >> 2;
+    x |= x >> 4;
+    x |= x >> 8;
+    x |= x >> 16;
+    return x + 1;
+  }
+
+  TreeNode _extendList(
+      TreeNode parent, List<TreeNode> items, int index, TreeNode build()) {
+    if (items.length <= index) {
+      // Avoid excessive resizing by growing the list in steps.
+      items.length = _pow2roundup(index + 1);
+    }
+    return items[index] ??= build()..parent = parent;
+  }
+
+  Class getClassReference(Library library, int tag, int index) {
+    return _extendList(
+        library, library.classes, index, () => _buildClassReference(tag));
+  }
+
+  Class _buildClassReference(int tag) {
+    return new Class();
+  }
+
+  Field _buildFieldReference() {
+    return new Field(null);
+  }
+
+  Constructor _buildConstructorReference() {
+    return new Constructor(null);
+  }
+
+  Procedure _buildProcedureReference() {
+    return new Procedure(null, null, null);
+  }
+
+  Member getMemberReference(TreeNode classOrLibrary, int tag, int index) {
+    if (classOrLibrary is Class) {
+      return getClassMemberReference(classOrLibrary, tag, index);
+    } else {
+      return getLibraryMemberReference(classOrLibrary, tag, index);
+    }
+  }
+
+  Member getLibraryMemberReference(Library library, int tag, int index) {
+    switch (tag) {
+      case Tag.LibraryFieldReference:
+      case Tag.Field:
+        return _extendList(
+            library, library.fields, index, _buildFieldReference);
+      case Tag.LibraryProcedureReference:
+      case Tag.Procedure:
+        return _extendList(
+            library, library.procedures, index, _buildProcedureReference);
+      default:
+        throw 'Invalid library member reference tag: $tag';
+    }
+  }
+
+  Member getClassMemberReference(Class classNode, int tag, int index) {
+    switch (tag) {
+      case Tag.ClassFieldReference:
+      case Tag.Field:
+        return _extendList(
+            classNode, classNode.fields, index, _buildFieldReference);
+      case Tag.ClassConstructorReference:
+      case Tag.Constructor:
+        return _extendList(classNode, classNode.constructors, index,
+            _buildConstructorReference);
+      case Tag.ClassProcedureReference:
+      case Tag.Procedure:
+        return _extendList(
+            classNode, classNode.procedures, index, _buildProcedureReference);
+      default:
+        throw 'Invalid library member reference tag: $tag';
+    }
+  }
+
+  Program loadProgram(String filename) {
+    var bytes = new File(filename).readAsBytesSync();
+    return new BinaryBuilder(this, bytes, filename).readProgramFile();
+  }
+}
diff --git a/pkg/kernel/lib/binary/readme.md b/pkg/kernel/lib/binary/readme.md
new file mode 100644
index 0000000..8bd2346
--- /dev/null
+++ b/pkg/kernel/lib/binary/readme.md
@@ -0,0 +1,3 @@
+Conversion to and from a binary format.
+
+The binary format is described in [binary.md](../../binary.md).
diff --git a/pkg/kernel/lib/binary/tag.dart b/pkg/kernel/lib/binary/tag.dart
new file mode 100644
index 0000000..226b190
--- /dev/null
+++ b/pkg/kernel/lib/binary/tag.dart
@@ -0,0 +1,121 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.binary.tag;
+
+class Tag {
+  static const int Nothing = 0;
+  static const int Something = 1;
+
+  static const int NormalClass = 2;
+  static const int MixinClass = 3;
+
+  static const int Field = 4;
+  static const int Constructor = 5;
+  static const int Procedure = 6;
+
+  static const int InvalidInitializer = 7;
+  static const int FieldInitializer = 8;
+  static const int SuperInitializer = 9;
+  static const int RedirectingInitializer = 10;
+  static const int LocalInitializer = 11;
+
+  static const int DirectPropertyGet = 15;
+  static const int DirectPropertySet = 16;
+  static const int DirectMethodInvocation = 17;
+  static const int ConstStaticInvocation = 18;
+  static const int InvalidExpression = 19;
+  static const int VariableGet = 20;
+  static const int VariableSet = 21;
+  static const int PropertyGet = 22;
+  static const int PropertySet = 23;
+  static const int SuperPropertyGet = 24;
+  static const int SuperPropertySet = 25;
+  static const int StaticGet = 26;
+  static const int StaticSet = 27;
+  static const int MethodInvocation = 28;
+  static const int SuperMethodInvocation = 29;
+  static const int StaticInvocation = 30;
+  static const int ConstructorInvocation = 31;
+  static const int ConstConstructorInvocation = 32;
+  static const int Not = 33;
+  static const int LogicalExpression = 34;
+  static const int ConditionalExpression = 35;
+  static const int StringConcatenation = 36;
+  static const int IsExpression = 37;
+  static const int AsExpression = 38;
+  static const int StringLiteral = 39;
+  static const int DoubleLiteral = 40;
+  static const int TrueLiteral = 41;
+  static const int FalseLiteral = 42;
+  static const int NullLiteral = 43;
+  static const int SymbolLiteral = 44;
+  static const int TypeLiteral = 45;
+  static const int ThisExpression = 46;
+  static const int Rethrow = 47;
+  static const int Throw = 48;
+  static const int ListLiteral = 49;
+  static const int MapLiteral = 50;
+  static const int AwaitExpression = 51;
+  static const int FunctionExpression = 52;
+  static const int Let = 53;
+  static const int PositiveIntLiteral = 55;
+  static const int NegativeIntLiteral = 56;
+  static const int BigIntLiteral = 57;
+  static const int ConstListLiteral = 58;
+  static const int ConstMapLiteral = 59;
+
+  static const int InvalidStatement = 60;
+  static const int ExpressionStatement = 61;
+  static const int Block = 62;
+  static const int EmptyStatement = 63;
+  static const int AssertStatement = 64;
+  static const int LabeledStatement = 65;
+  static const int BreakStatement = 66;
+  static const int WhileStatement = 67;
+  static const int DoStatement = 68;
+  static const int ForStatement = 69;
+  static const int ForInStatement = 70;
+  static const int SwitchStatement = 71;
+  static const int ContinueSwitchStatement = 72;
+  static const int IfStatement = 73;
+  static const int ReturnStatement = 74;
+  static const int TryCatch = 75;
+  static const int TryFinally = 76;
+  static const int YieldStatement = 77;
+  static const int VariableDeclaration = 78;
+  static const int FunctionDeclaration = 79;
+  static const int AsyncForInStatement = 80;
+
+  static const int BottomType = 89;
+  static const int InvalidType = 90;
+  static const int DynamicType = 91;
+  static const int VoidType = 92;
+  static const int InterfaceType = 93;
+  static const int FunctionType = 94;
+  static const int TypeParameterType = 95;
+  static const int SimpleInterfaceType = 96;
+  static const int SimpleFunctionType = 97;
+
+  static const int NullReference = 99;
+  static const int NormalClassReference = 100;
+  static const int MixinClassReference = 101;
+
+  static const int LibraryFieldReference = 102;
+  static const int ClassFieldReference = 103;
+  static const int ClassConstructorReference = 104;
+  static const int LibraryProcedureReference = 105;
+  static const int ClassProcedureReference = 106;
+
+  static const int SpecializedTagHighBit = 0x80; // 10000000
+  static const int SpecializedTagMask = 0xF8; // 11111000
+  static const int SpecializedPayloadMask = 0x7; // 00000111
+
+  static const int SpecializedVariableGet = 128;
+  static const int SpecializedVariableSet = 136;
+  static const int SpecializedIntLiteral = 144;
+
+  static const int SpecializedIntLiteralBias = 3;
+
+  static const int ProgramFile = 0x90ABCDEF;
+}
diff --git a/pkg/kernel/lib/class_hierarchy.dart b/pkg/kernel/lib/class_hierarchy.dart
new file mode 100644
index 0000000..32bf6958
--- /dev/null
+++ b/pkg/kernel/lib/class_hierarchy.dart
@@ -0,0 +1,852 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.class_hierarchy;
+
+import 'ast.dart';
+import 'dart:math';
+import 'dart:typed_data';
+import 'type_algebra.dart';
+
+/// Data structure for answering various subclassing queries.
+class ClassHierarchy {
+  /// All classes in the program.
+  ///
+  /// The list is ordered so that classes occur after their super classes.
+  final List<Class> classes;
+
+  final Map<Class, _ClassInfo> _infoFor = <Class, _ClassInfo>{};
+
+  ClassHierarchy(Program program)
+      : this._internal(program, _countClasses(program));
+
+  Class get rootClass => classes[0];
+
+  /// Returns the index of [class_] in the [classes] list.
+  int getClassIndex(Class class_) => _infoFor[class_].topologicalIndex;
+
+  /// True if [subclass] inherits from [superclass] though zero or more
+  /// `extends` relationships.
+  bool isSubclassOf(Class subclass, Class superclass) {
+    if (identical(subclass, superclass)) return true;
+    return _infoFor[subclass].isSubclassOf(_infoFor[superclass]);
+  }
+
+  /// True if [submixture] inherits from [superclass] though zero or more
+  /// `extends` and `with` relationships.
+  bool isSubmixtureOf(Class submixture, Class superclass) {
+    if (identical(submixture, superclass)) return true;
+    return _infoFor[submixture].isSubmixtureOf(_infoFor[superclass]);
+  }
+
+  /// True if [subtype] inherits from [superclass] though zero or more
+  /// `extends`, `with`, and `implements` relationships.
+  bool isSubtypeOf(Class subtype, Class superclass) {
+    if (identical(subtype, superclass)) return true;
+    return _infoFor[subtype].isSubtypeOf(_infoFor[superclass]);
+  }
+
+  /// True if the given class is the direct super class of another class.
+  bool isUsedAsSuperClass(Class class_) {
+    return _infoFor[class_].directExtenders.isNotEmpty;
+  }
+
+  /// True if the given class is used as the right-hand operand to a
+  /// mixin application (i.e. [Class.mixedInType]).
+  bool isUsedAsMixin(Class class_) {
+    return _infoFor[class_].directMixers.isNotEmpty;
+  }
+
+  /// True if the given class is used in an `implements` clause.
+  bool isUsedAsSuperInterface(Class class_) {
+    return _infoFor[class_].directImplementers.isNotEmpty;
+  }
+
+  /// Returns the instantiation of [superclass] that is implemented by [class_],
+  /// or `null` if [class_] does not implement [superclass] at all.
+  Supertype getClassAsInstanceOf(Class class_, Class superclass) {
+    if (identical(class_, superclass)) return class_.asThisSupertype;
+    _ClassInfo info = _infoFor[class_];
+    _ClassInfo superInfo = _infoFor[superclass];
+    if (!info.isSubtypeOf(superInfo)) return null;
+    if (superclass.typeParameters.isEmpty) return superclass.asRawSupertype;
+    return info.genericSuperTypes[superclass];
+  }
+
+  /// Returns the instantiation of [superclass] that is implemented by [type],
+  /// or `null` if [type] does not implement [superclass] at all.
+  InterfaceType getTypeAsInstanceOf(InterfaceType type, Class superclass) {
+    Supertype castedType = getClassAsInstanceOf(type.classNode, superclass);
+    if (castedType == null) return null;
+    return Substitution
+        .fromInterfaceType(type)
+        .substituteType(castedType.asInterfaceType);
+  }
+
+  /// Returns the instance member that would respond to a dynamic dispatch of
+  /// [name] to an instance of [class_], or `null` if no such member exists.
+  ///
+  /// If [setter] is `false`, the name is dispatched as a getter or call,
+  /// and will return a field, getter, method, or operator (or null).
+  ///
+  /// If [setter] is `true`, the name is dispatched as a setter, roughly
+  /// corresponding to `name=` in the Dart specification, but note that the
+  /// returned member will not have a name ending with `=`.  In this case,
+  /// a non-final field or setter (or null) will be returned.
+  ///
+  /// If the class is abstract, abstract members are ignored and the dispatch
+  /// is resolved if the class was not abstract.
+  Member getDispatchTarget(Class class_, Name name, {bool setter: false}) {
+    _ClassInfo info = _infoFor[class_];
+    List<Member> list =
+        setter ? info.implementedSetters : info.implementedGettersAndCalls;
+    return _findMemberByName(list, name);
+  }
+
+  /// Returns the list of potential targets of dynamic dispatch to an instance
+  /// of [class_].
+  ///
+  /// If [setters] is `false`, only potential targets of a getter or call
+  /// dispatch are returned.  If [setters] is `true`, only potential targets
+  /// of a setter dispatch are returned.
+  ///
+  /// See [getDispatchTarget] for more details.
+  ///
+  /// The returned list should not be modified.
+  List<Member> getDispatchTargets(Class class_, {bool setters: false}) {
+    _ClassInfo info = _infoFor[class_];
+    return setters ? info.implementedSetters : info.implementedGettersAndCalls;
+  }
+
+  /// Returns the possibly abstract interface member of [class_] with the given
+  /// [name].
+  ///
+  /// If [setters] is `false`, only fields, methods, and getters with that name
+  /// will be found.  If [setters] is `true`, only non-final fields and setters
+  /// will be found.
+  ///
+  /// If multiple members with that name are inherited and not overidden, the
+  /// member from the first declared supertype is returned.
+  Member getInterfaceMember(Class class_, Name name, {bool setter: false}) {
+    List<Member> list = getInterfaceMembers(class_, setters: setter);
+    return _findMemberByName(list, name);
+  }
+
+  /// Returns the list of members denoting the interface for [class_], which
+  /// may include abstract members.
+  ///
+  /// The list may contain multiple members with a given name.  This happens
+  /// when members are inherited through different supertypes and not overridden
+  /// in the class.
+  ///
+  /// Also see [getInterfaceMember].
+  List<Member> getInterfaceMembers(Class class_, {bool setters: false}) {
+    return _buildInterfaceMembers(class_, _infoFor[class_], setters: setters);
+  }
+
+  /// Invokes [callback] for every member declared in or inherited by [class_]
+  /// that overrides or implements a member in a supertype of [class_]
+  /// (or in rare cases, overrides a member declared in [class_]).
+  ///
+  /// We use the term "inheritable" for members that are candidates for
+  /// inheritance but may have been overridden.  The "declared" members of a
+  /// mixin application are those declared in the mixed-in type. The callback is
+  /// invoked in the following cases:
+  ///
+  /// 1. A member declared in the class overrides a member inheritable through
+  /// one of the supertypes of the class.
+  ///
+  /// 2. A non-abstract member is inherited from a superclass, and in the
+  /// context of this class, it overrides an abstract member inheritable through
+  /// one of its superinterfaces.
+  ///
+  /// 3. A non-abstract member is inherited from a superclass, and it overrides
+  /// an abstract member declared in this class.
+  ///
+  /// This method will not report that a member overrides itself. A given pair
+  /// may be reported multiple times when there are multiple inheritance paths
+  /// to the overridden member.
+  ///
+  /// It is possible for two methods to override one another in both directions.
+  ///
+  /// Getters and setters are overridden separately.  The [isSetter] callback
+  /// parameter determines which type of access is being overridden.
+  void forEachOverridePair(Class class_,
+      callback(Member declaredMember, Member interfaceMember, bool isSetter)) {
+    _ClassInfo info = _infoFor[class_];
+    for (var supertype in class_.supers) {
+      var superclass = supertype.classNode;
+      var superGetters = getInterfaceMembers(superclass);
+      var superSetters = getInterfaceMembers(superclass, setters: true);
+      _reportOverrides(info.implementedGettersAndCalls, superGetters, callback);
+      _reportOverrides(info.declaredGettersAndCalls, superGetters, callback,
+          onlyAbstract: true);
+      _reportOverrides(info.implementedSetters, superSetters, callback,
+          isSetter: true);
+      _reportOverrides(info.declaredSetters, superSetters, callback,
+          isSetter: true, onlyAbstract: true);
+    }
+    if (!class_.isAbstract) {
+      // If a non-abstract class declares an abstract method M whose
+      // implementation M' is inherited from the superclass, then the inherited
+      // method M' overrides the declared method M.
+      // This flies in the face of conventional override logic, but is necessary
+      // because an instance of the class will contain the method M' which can
+      // be invoked through the interface of M.
+      // Note that [_reportOverrides] does not report self-overrides, so in
+      // most cases these calls will just scan both lists and report nothing.
+      _reportOverrides(info.implementedGettersAndCalls,
+          info.declaredGettersAndCalls, callback);
+      _reportOverrides(info.implementedSetters, info.declaredSetters, callback,
+          isSetter: true);
+    }
+  }
+
+  static void _reportOverrides(
+      List<Member> declaredList,
+      List<Member> inheritedList,
+      callback(Member declaredMember, Member interfaceMember, bool isSetter),
+      {bool isSetter: false,
+      bool onlyAbstract: false}) {
+    int i = 0, j = 0;
+    while (i < declaredList.length && j < inheritedList.length) {
+      Member declared = declaredList[i];
+      if (onlyAbstract && !declared.isAbstract) {
+        ++i;
+        continue;
+      }
+      Member inherited = inheritedList[j];
+      int comparison = _compareMembers(declared, inherited);
+      if (comparison < 0) {
+        ++i;
+      } else if (comparison > 0) {
+        ++j;
+      } else {
+        if (!identical(declared, inherited)) {
+          callback(declared, inherited, isSetter);
+        }
+        // A given declared member may override multiple interface members,
+        // so only move past the interface member.
+        ++j;
+      }
+    }
+  }
+
+  ClassHierarchy._internal(Program program, int numberOfClasses)
+      : classes = new List<Class>(numberOfClasses) {
+    // Build the class ordering based on a topological sort.
+    for (var library in program.libraries) {
+      for (var classNode in library.classes) {
+        _topologicalSortVisit(classNode);
+      }
+    }
+
+    // Build index of direct children.  Do this after the topological sort so
+    // that super types always occur before subtypes.
+    for (int i = 0; i < classes.length; ++i) {
+      var class_ = classes[i];
+      var info = _infoFor[class_];
+      if (class_.supertype != null) {
+        _infoFor[class_.supertype.classNode].directExtenders.add(info);
+      }
+      if (class_.mixedInType != null) {
+        _infoFor[class_.mixedInType.classNode].directMixers.add(info);
+      }
+      for (var supertype in class_.implementedTypes) {
+        _infoFor[supertype.classNode].directImplementers.add(info);
+      }
+    }
+
+    // Run a downward traversal from the root, compute preorder numbers for
+    // each class, and build their subtype sets as interval lists.
+    _topDownSortVisit(_infoFor[rootClass]);
+
+    for (int i = 0; i < classes.length; ++i) {
+      var class_ = classes[i];
+      _buildInterfaceMembers(class_, _infoFor[class_], setters: true);
+      _buildInterfaceMembers(class_, _infoFor[class_], setters: false);
+    }
+  }
+
+  /// Upwards traversal of the class hierarchy that orders classes so super
+  /// types before their subtypes.
+  int _topSortIndex = 0;
+  void _topologicalSortVisit(Class classNode) {
+    var info = _infoFor[classNode];
+    if (info != null) {
+      if (info.isBeingVisited) {
+        throw 'Cyclic inheritance involving ${info.classNode.name}';
+      }
+      return; // Already built.
+    }
+    _infoFor[classNode] = info = new _ClassInfo(classNode);
+    info.isBeingVisited = true;
+    if (classNode.supertype != null) {
+      _topologicalSortVisit(classNode.supertype.classNode);
+      _recordSuperTypes(info, classNode.supertype);
+    }
+    if (classNode.mixedInType != null) {
+      _topologicalSortVisit(classNode.mixedInType.classNode);
+      _recordSuperTypes(info, classNode.mixedInType);
+    }
+    for (var supertype in classNode.implementedTypes) {
+      _topologicalSortVisit(supertype.classNode);
+      _recordSuperTypes(info, supertype);
+    }
+    _buildDeclaredMembers(classNode, info);
+    _buildImplementedMembers(classNode, info);
+    int id = _topSortIndex++;
+    info.topologicalIndex = id;
+    classes[id] = info.classNode;
+    info.isBeingVisited = false;
+  }
+
+  void _buildDeclaredMembers(Class classNode, _ClassInfo info) {
+    if (classNode.mixedInType != null) {
+      _ClassInfo mixedInfo = _infoFor[classNode.mixedInType.classNode];
+      info.declaredGettersAndCalls = mixedInfo.declaredGettersAndCalls;
+      info.declaredSetters = mixedInfo.declaredSetters;
+    } else {
+      var members = info.declaredGettersAndCalls = <Member>[];
+      var setters = info.declaredSetters = <Member>[];
+      for (Procedure procedure in classNode.procedures) {
+        if (procedure.isStatic) continue;
+        if (procedure.kind == ProcedureKind.Setter) {
+          setters.add(procedure);
+        } else {
+          members.add(procedure);
+        }
+      }
+      for (Field field in classNode.fields) {
+        if (field.isStatic) continue;
+        if (field.hasImplicitGetter) {
+          members.add(field);
+        }
+        if (field.hasImplicitSetter) {
+          setters.add(field);
+        }
+      }
+      members.sort(_compareMembers);
+      setters.sort(_compareMembers);
+    }
+  }
+
+  void _buildImplementedMembers(Class classNode, _ClassInfo info) {
+    List<Member> inheritedMembers;
+    List<Member> inheritedSetters;
+    if (classNode.supertype == null) {
+      inheritedMembers = inheritedSetters = const <Member>[];
+    } else {
+      _ClassInfo superInfo = _infoFor[classNode.supertype.classNode];
+      inheritedMembers = superInfo.implementedGettersAndCalls;
+      inheritedSetters = superInfo.implementedSetters;
+    }
+    info.implementedGettersAndCalls = _inheritMembers(
+        info.declaredGettersAndCalls, inheritedMembers,
+        skipAbstractMembers: true);
+    info.implementedSetters = _inheritMembers(
+        info.declaredSetters, inheritedSetters,
+        skipAbstractMembers: true);
+  }
+
+  List<Member> _buildInterfaceMembers(Class classNode, _ClassInfo info,
+      {bool setters}) {
+    List<Member> members =
+        setters ? info.interfaceSetters : info.interfaceGettersAndCalls;
+    if (members != null) return members;
+    List<Member> allInheritedMembers = <Member>[];
+    List<Member> declared =
+        setters ? info.declaredSetters : info.declaredGettersAndCalls;
+    void inheritFrom(Supertype type) {
+      if (type == null) return;
+      List<Member> inherited = _buildInterfaceMembers(
+          type.classNode, _infoFor[type.classNode],
+          setters: setters);
+      inherited = _getUnshadowedInheritedMembers(declared, inherited);
+      allInheritedMembers = _merge(allInheritedMembers, inherited);
+    }
+    inheritFrom(classNode.supertype);
+    inheritFrom(classNode.mixedInType);
+    classNode.implementedTypes.forEach(inheritFrom);
+    members = _inheritMembers(declared, allInheritedMembers);
+    if (setters) {
+      info.interfaceSetters = members;
+    } else {
+      info.interfaceGettersAndCalls = members;
+    }
+    return members;
+  }
+
+  /// Computes the list of implemented members, based on the declared instance
+  /// members and inherited instance members.
+  ///
+  /// Both lists must be sorted by name beforehand.
+  static List<Member> _inheritMembers(
+      List<Member> declared, List<Member> inherited,
+      {bool skipAbstractMembers: false}) {
+    List<Member> result = <Member>[]
+      ..length = declared.length + inherited.length;
+    // Since both lists are sorted, we can fuse them like in merge sort.
+    int storeIndex = 0;
+    int i = 0, j = 0;
+    while (i < declared.length && j < inherited.length) {
+      Member declaredMember = declared[i];
+      Member inheritedMember = inherited[j];
+      if (skipAbstractMembers && declaredMember.isAbstract) {
+        ++i;
+        continue;
+      }
+      if (skipAbstractMembers && inheritedMember.isAbstract) {
+        ++j;
+        continue;
+      }
+      int comparison = _compareMembers(declaredMember, inheritedMember);
+      if (comparison < 0) {
+        result[storeIndex++] = declaredMember;
+        ++i;
+      } else if (comparison > 0) {
+        result[storeIndex++] = inheritedMember;
+        ++j;
+      } else {
+        result[storeIndex++] = declaredMember;
+        ++i;
+        ++j; // Move past overridden member.
+      }
+    }
+    // One of the two lists is now exhausted, copy over the remains.
+    while (i < declared.length) {
+      result[storeIndex++] = declared[i++];
+    }
+    while (j < inherited.length) {
+      result[storeIndex++] = inherited[j++];
+    }
+    result.length = storeIndex;
+    return result;
+  }
+
+  /// Returns the subset of members in [inherited] for which a member with the
+  /// same name does not occur in [declared].
+  ///
+  /// The input lists must be sorted, and the returned list is sorted.
+  static List<Member> _getUnshadowedInheritedMembers(
+      List<Member> declared, List<Member> inherited) {
+    List<Member> result = <Member>[]..length = inherited.length;
+    int storeIndex = 0;
+    int i = 0, j = 0;
+    while (i < declared.length && j < inherited.length) {
+      Member declaredMember = declared[i];
+      Member inheritedMember = inherited[j];
+      int comparison = _compareMembers(declaredMember, inheritedMember);
+      if (comparison < 0) {
+        ++i;
+      } else if (comparison > 0) {
+        result[storeIndex++] = inheritedMember;
+        ++j;
+      } else {
+        // Move past the shadowed member, but retain the declared member, as
+        // it may shadow multiple members.
+        ++j;
+      }
+    }
+    // If the list of declared members is exhausted, copy over the remains of
+    // the inherited members.
+    while (j < inherited.length) {
+      result[storeIndex++] = inherited[j++];
+    }
+    result.length = storeIndex;
+    return result;
+  }
+
+  /// Merges two sorted lists.
+  ///
+  /// If a given member occurs in both lists, the merge will attempt to exclude
+  /// the duplicate member, but is not strictly guaranteed to do so.
+  static List<Member> _merge(List<Member> first, List<Member> second) {
+    if (first.isEmpty) return second;
+    if (second.isEmpty) return first;
+    List<Member> result = <Member>[]..length = first.length + second.length;
+    int storeIndex = 0;
+    int i = 0, j = 0;
+    while (i < first.length && j < second.length) {
+      Member firstMember = first[i];
+      Member secondMember = second[j];
+      int compare = _compareMembers(firstMember, secondMember);
+      if (compare <= 0) {
+        result[storeIndex++] = firstMember;
+        ++i;
+        // If the same member occurs in both lists, skip the duplicate.
+        if (identical(firstMember, secondMember)) {
+          ++j;
+        }
+      } else {
+        result[storeIndex++] = secondMember;
+        ++j;
+      }
+    }
+    while (i < first.length) {
+      result[storeIndex++] = first[i++];
+    }
+    while (j < second.length) {
+      result[storeIndex++] = second[j++];
+    }
+    result.length = storeIndex;
+    return result;
+  }
+
+  void _recordSuperTypes(_ClassInfo subInfo, Supertype supertype) {
+    _ClassInfo superInfo = _infoFor[supertype.classNode];
+    if (supertype.typeArguments.isEmpty) {
+      if (superInfo.genericSuperTypes == null) return;
+      // Since the immediate super type is not generic, all entries in its
+      // super type map are also valid entries for this class.
+      if (subInfo.genericSuperTypes == null &&
+          superInfo.ownsGenericSuperTypeMap) {
+        // Instead of copying the map, take ownership of the map object.
+        // This may result in more entries being added to the map later. Those
+        // are not valid for the super type, but it works out because all
+        // lookups in the map are guarded by a subtype check, so the super type
+        // will not be bothered by the extra entries.
+        subInfo.genericSuperTypes = superInfo.genericSuperTypes;
+        superInfo.ownsGenericSuperTypeMap = false;
+      } else {
+        // Copy over the super type entries.
+        subInfo.genericSuperTypes ??= <Class, Supertype>{};
+        subInfo.genericSuperTypes.addAll(superInfo.genericSuperTypes);
+      }
+    } else {
+      // Copy over all transitive generic super types, and substitute the
+      // free variables with those provided in [supertype].
+      Class superclass = supertype.classNode;
+      var substitution = Substitution.fromPairs(
+          superclass.typeParameters, supertype.typeArguments);
+      subInfo.genericSuperTypes ??= <Class, Supertype>{};
+      superInfo.genericSuperTypes?.forEach((Class key, Supertype type) {
+        subInfo.genericSuperTypes[key] = substitution.substituteSupertype(type);
+      });
+      subInfo.genericSuperTypes[superclass] = supertype;
+    }
+  }
+
+  /// Downwards traversal of the class hierarchy that orders classes so local
+  /// hierarchies have contiguous indices.
+  int _topDownSortIndex = 0;
+  void _topDownSortVisit(_ClassInfo info) {
+    if (info.topDownIndex != -1) return;
+    bool isMixedIn = info.directMixers.isNotEmpty;
+    int index = _topDownSortIndex++;
+    info.topDownIndex = index;
+    var subclassSetBuilder = new _IntervalListBuilder()..addSingleton(index);
+    var submixtureSetBuilder =
+        isMixedIn ? (new _IntervalListBuilder()..addSingleton(index)) : null;
+    var subtypeSetBuilder = new _IntervalListBuilder()..addSingleton(index);
+    for (var subtype in info.directExtenders) {
+      _topDownSortVisit(subtype);
+      subclassSetBuilder.addIntervalList(subtype.subclassIntervalList);
+      submixtureSetBuilder?.addIntervalList(subtype.submixtureIntervalList);
+      subtypeSetBuilder.addIntervalList(subtype.subtypeIntervalList);
+    }
+    for (var subtype in info.directMixers) {
+      _topDownSortVisit(subtype);
+      submixtureSetBuilder.addIntervalList(subtype.submixtureIntervalList);
+      subtypeSetBuilder.addIntervalList(subtype.subtypeIntervalList);
+    }
+    for (var subtype in info.directImplementers) {
+      _topDownSortVisit(subtype);
+      subtypeSetBuilder.addIntervalList(subtype.subtypeIntervalList);
+    }
+    info.subclassIntervalList = subclassSetBuilder.buildIntervalList();
+    info.submixtureIntervalList = isMixedIn
+        ? submixtureSetBuilder.buildIntervalList()
+        : info.subclassIntervalList;
+    info.subtypeIntervalList = subtypeSetBuilder.buildIntervalList();
+  }
+
+  static int _countClasses(Program program) {
+    int count = 0;
+    for (var library in program.libraries) {
+      count += library.classes.length;
+    }
+    return count;
+  }
+
+  /// Creates a histogram such that index `N` contains the number of classes
+  /// that have `N` intervals in its subclass or subtype set (whichever is
+  /// larger).
+  ///
+  /// The more numbers are condensed near the beginning, the more efficient the
+  /// internal data structure is.
+  List<int> getExpenseHistogram() {
+    var result = <int>[];
+    for (Class class_ in classes) {
+      var info = _infoFor[class_];
+      int intervals = max(info.subclassIntervalList.length,
+              info.subtypeIntervalList.length) ~/
+          2;
+      if (intervals >= result.length) {
+        int oldLength = result.length;
+        result.length = intervals + 1;
+        result.fillRange(oldLength, result.length, 0);
+      }
+      result[intervals] += 1;
+    }
+    return result;
+  }
+
+  /// Returns the average number of intervals per subtype relation (less
+  /// is better, 1.0 is bad).
+  ///
+  /// This is an estimate of the memory use compared to a data structure that
+  /// enumerates all subclass/subtype pairs.
+  double getCompressionRatio() {
+    int intervals = 0;
+    int sizes = 0;
+    for (Class class_ in classes) {
+      var info = _infoFor[class_];
+      intervals += (info.subclassIntervalList.length +
+              info.subtypeIntervalList.length) ~/
+          2;
+      sizes += _intervalListSize(info.subclassIntervalList) +
+          _intervalListSize(info.subtypeIntervalList);
+    }
+    return sizes == 0 ? 1.0 : intervals / sizes;
+  }
+
+  /// Returns the number of entries in hash tables storing hierarchy data.
+  int getSuperTypeHashTableSize() {
+    int sum = 0;
+    for (Class class_ in classes) {
+      _ClassInfo info = _infoFor[class_];
+      if (info.ownsGenericSuperTypeMap) {
+        sum += _infoFor[class_].genericSuperTypes?.length ?? 0;
+      }
+    }
+    return sum;
+  }
+}
+
+class _IntervalListBuilder {
+  final List<int> events = <int>[];
+
+  void addInterval(int start, int end) {
+    // Add an event point for each interval end point, using the low bit to
+    // distinguish opening from closing end points. Closing end points should
+    // have the high bit to ensure they occur after an opening end point.
+    events.add(start << 1);
+    events.add((end << 1) + 1);
+  }
+
+  void addSingleton(int x) {
+    addInterval(x, x + 1);
+  }
+
+  void addIntervalList(Uint32List intervals) {
+    for (int i = 0; i < intervals.length; i += 2) {
+      addInterval(intervals[i], intervals[i + 1]);
+    }
+  }
+
+  List<int> buildIntervalList() {
+    // Sort the event points and sweep left to right while tracking how many
+    // intervals we are currently inside.  Record an interval end point when the
+    // number of intervals drop to zero or increase from zero to one.
+    // Event points are encoded so that an opening end point occur before a
+    // closing end point at the same value.
+    events.sort();
+    int insideCount = 0; // The number of intervals we are currently inside.
+    int storeIndex = 0;
+    for (int i = 0; i < events.length; ++i) {
+      int event = events[i];
+      if (event & 1 == 0) {
+        // Start point
+        ++insideCount;
+        if (insideCount == 1) {
+          // Store the results temporarily back in the event array.
+          events[storeIndex++] = event >> 1;
+        }
+      } else {
+        // End point
+        --insideCount;
+        if (insideCount == 0) {
+          events[storeIndex++] = event >> 1;
+        }
+      }
+    }
+    // Copy the results over to a typed array of the correct length.
+    var result = new Uint32List(storeIndex);
+    for (int i = 0; i < storeIndex; ++i) {
+      result[i] = events[i];
+    }
+    return result;
+  }
+}
+
+bool _intervalListContains(Uint32List intervalList, int x) {
+  int low = 0, high = intervalList.length - 1;
+  if (high == -1 || x < intervalList[0] || intervalList[high] <= x) {
+    return false;
+  }
+  // Find the lower bound of x in the list.
+  // If the lower bound is at an even index, the lower bound is an opening point
+  // of an interval that contains x, otherwise it is a closing point of an
+  // interval below x and there is no interval containing x.
+  while (low < high) {
+    int mid = high - ((high - low) >> 1); // Get middle, rounding up.
+    int pivot = intervalList[mid];
+    if (pivot <= x) {
+      low = mid;
+    } else {
+      high = mid - 1;
+    }
+  }
+  return low == high && (low & 1) == 0;
+}
+
+int _intervalListSize(Uint32List intervalList) {
+  int size = 0;
+  for (int i = 0; i < intervalList.length; i += 2) {
+    size += intervalList[i + 1] - intervalList[i];
+  }
+  return size;
+}
+
+/// Returns the member with the given name, or `null` if no member has the
+/// name.  In case the list contains multiple members with the given name,
+/// the one that occurs first in the list is returned.
+Member _findMemberByName(List<Member> members, Name name) {
+  int low = 0, high = members.length - 1;
+  while (low <= high) {
+    int mid = low + ((high - low) >> 1);
+    Member pivot = members[mid];
+    int comparison = _compareNames(name, pivot.name);
+    if (comparison < 0) {
+      high = mid - 1;
+    } else if (comparison > 0) {
+      low = mid + 1;
+    } else if (high != mid) {
+      // Ensure we find the first element of the given name.
+      high = mid;
+    } else {
+      return pivot;
+    }
+  }
+  return null;
+}
+
+/// Compares members by name.
+int _compareMembers(Member first, Member second) {
+  return _compareNames(first.name, second.name);
+}
+
+/// Compares names using an arbitrary as-fast-as-possible sorting criterion.
+int _compareNames(Name firstName, Name secondName) {
+  int firstHash = firstName.hashCode;
+  int secondHash = secondName.hashCode;
+  if (firstHash != secondHash) return firstHash - secondHash;
+  String firstString = firstName.name;
+  String secondString = secondName.name;
+  int firstLength = firstString.length;
+  int secondLength = secondString.length;
+  if (firstLength != secondLength) {
+    return firstLength - secondLength;
+  }
+  Library firstLibrary = firstName.library;
+  Library secondLibrary = secondName.library;
+  if (firstLibrary != secondLibrary) {
+    if (firstLibrary == null) return -1;
+    if (secondLibrary == null) return 1;
+    return firstLibrary.compareTo(secondLibrary);
+  }
+  for (int i = 0; i < firstLength; ++i) {
+    int firstUnit = firstString.codeUnitAt(i);
+    int secondUnit = secondString.codeUnitAt(i);
+    int delta = firstUnit - secondUnit;
+    if (delta != 0) return delta;
+  }
+  return 0;
+}
+
+class _ClassInfo {
+  final Class classNode;
+  int topologicalIndex = 0;
+  int topDownIndex = -1;
+  bool isBeingVisited = false;
+
+  // Super types must always occur before subtypes in these lists.
+  // For example:
+  //
+  //   class A extends Object
+  //   class B extends Object implements A
+  //
+  // Here `A` must occur before `B` in the list of direct extenders of Object,
+  // because `B` is a subtype of `A`.
+  final List<_ClassInfo> directExtenders = <_ClassInfo>[];
+  final List<_ClassInfo> directMixers = <_ClassInfo>[];
+  final List<_ClassInfo> directImplementers = <_ClassInfo>[];
+
+  /// Top-down indices of all subclasses of this class, represented as
+  /// interleaved begin/end interval end points.
+  Uint32List subclassIntervalList;
+  Uint32List submixtureIntervalList;
+  Uint32List subtypeIntervalList;
+
+  bool isSubclassOf(_ClassInfo other) {
+    return _intervalListContains(other.subclassIntervalList, topDownIndex);
+  }
+
+  bool isSubmixtureOf(_ClassInfo other) {
+    return _intervalListContains(other.submixtureIntervalList, topDownIndex);
+  }
+
+  bool isSubtypeOf(_ClassInfo other) {
+    return _intervalListContains(other.subtypeIntervalList, topDownIndex);
+  }
+
+  /// Maps generic supertype classes to the instantiation implemented by this
+  /// class.
+  ///
+  /// E.g. `List` maps to `List<String>` for a class that directly of indirectly
+  /// implements `List<String>`.
+  ///
+  /// However, the map may contain additional entries for classes that are not
+  /// supertypes of this class, so that a single map object can be shared
+  /// between different classes.  Lookups into the map should therefore be
+  /// guarded by a subtype check.
+  ///
+  /// For example:
+  ///
+  ///     class Q<T>
+  ///     class A<T>
+  ///
+  ///     class B extends A<String>
+  ///     class C extends B implements Q<int>
+  ///
+  /// In this case, a single map object `{A: A<String>, Q: Q<int>}` may be
+  /// shared by the classes `B` and `C`.
+  Map<Class, Supertype> genericSuperTypes;
+
+  /// If true, this is the current "owner" of [genericSuperTypes], meaning
+  /// we may add additional entries to the map or transfer ownership to another
+  /// class.
+  bool ownsGenericSuperTypeMap = true;
+
+  /// Instance fields, getters, methods, and operators declared in this class
+  /// or its mixed-in class, sorted according to [_compareMembers].
+  List<Member> declaredGettersAndCalls;
+
+  /// Non-final instance fields and setters declared in this class or its
+  /// mixed-in class, sorted according to [_compareMembers].
+  List<Member> declaredSetters;
+
+  /// Instance fields, getters, methods, and operators implemented by this class
+  /// (declared or inherited).
+  List<Member> implementedGettersAndCalls;
+
+  /// Non-final instance fields and setters implemented by this class
+  /// (declared or inherited).
+  List<Member> implementedSetters;
+
+  List<Member> interfaceGettersAndCalls;
+  List<Member> interfaceSetters;
+
+  _ClassInfo(this.classNode);
+}
diff --git a/pkg/kernel/lib/clone.dart b/pkg/kernel/lib/clone.dart
new file mode 100644
index 0000000..ee315e6
--- /dev/null
+++ b/pkg/kernel/lib/clone.dart
@@ -0,0 +1,399 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.clone;
+
+import 'ast.dart';
+import 'type_algebra.dart';
+
+/// Visitor that return a clone of a tree, maintaining references to cloned
+/// objects.
+///
+/// It is safe to clone members, but cloning a class or library is not
+/// supported.
+class CloneVisitor extends TreeVisitor {
+  final Map<VariableDeclaration, VariableDeclaration> variables =
+      <VariableDeclaration, VariableDeclaration>{};
+  final Map<LabeledStatement, LabeledStatement> labels =
+      <LabeledStatement, LabeledStatement>{};
+  final Map<SwitchCase, SwitchCase> switchCases = <SwitchCase, SwitchCase>{};
+  final Map<TypeParameter, DartType> typeSubstitution;
+
+  CloneVisitor({Map<TypeParameter, DartType> typeSubstitution})
+      : this.typeSubstitution = ensureMutable(typeSubstitution);
+
+  static Map<TypeParameter, DartType> ensureMutable(
+      Map<TypeParameter, DartType> map) {
+    // We need to mutate this map, so make sure we don't use a constant map.
+    if (map == null || map.isEmpty) {
+      return <TypeParameter, DartType>{};
+    }
+    return map;
+  }
+
+  TreeNode visitLibrary(Library node) {
+    throw 'Cloning of libraries is not implemented';
+  }
+
+  TreeNode visitClass(Class node) {
+    throw 'Cloning of classes is not implemented';
+  }
+
+  TreeNode clone(TreeNode node) =>
+      node.accept(this)..fileOffset = node.fileOffset;
+
+  TreeNode cloneOptional(TreeNode node) {
+    TreeNode result = node?.accept(this);
+    if (result != null) result.fileOffset = node.fileOffset;
+    return result;
+  }
+
+  DartType visitType(DartType type) {
+    return substitute(type, typeSubstitution);
+  }
+
+  DartType visitOptionalType(DartType type) {
+    return type == null ? null : substitute(type, typeSubstitution);
+  }
+
+  visitInvalidExpression(InvalidExpression node) => new InvalidExpression();
+
+  visitVariableGet(VariableGet node) {
+    return new VariableGet(
+        variables[node.variable], visitOptionalType(node.promotedType));
+  }
+
+  visitVariableSet(VariableSet node) {
+    return new VariableSet(variables[node.variable], clone(node.value));
+  }
+
+  visitPropertyGet(PropertyGet node) {
+    return new PropertyGet(
+        clone(node.receiver), node.name, node.interfaceTarget);
+  }
+
+  visitPropertySet(PropertySet node) {
+    return new PropertySet(clone(node.receiver), node.name, clone(node.value),
+        node.interfaceTarget);
+  }
+
+  visitDirectPropertyGet(DirectPropertyGet node) {
+    return new DirectPropertyGet(clone(node.receiver), node.target);
+  }
+
+  visitDirectPropertySet(DirectPropertySet node) {
+    return new DirectPropertySet(
+        clone(node.receiver), node.target, clone(node.value));
+  }
+
+  visitSuperPropertyGet(SuperPropertyGet node) {
+    return new SuperPropertyGet(node.name, node.interfaceTarget);
+  }
+
+  visitSuperPropertySet(SuperPropertySet node) {
+    return new SuperPropertySet(
+        node.name, clone(node.value), node.interfaceTarget);
+  }
+
+  visitStaticGet(StaticGet node) {
+    return new StaticGet(node.target);
+  }
+
+  visitStaticSet(StaticSet node) {
+    return new StaticSet(node.target, clone(node.value));
+  }
+
+  visitMethodInvocation(MethodInvocation node) {
+    return new MethodInvocation(clone(node.receiver), node.name,
+        clone(node.arguments), node.interfaceTarget);
+  }
+
+  visitDirectMethodInvocation(DirectMethodInvocation node) {
+    return new DirectMethodInvocation(
+        clone(node.receiver), node.target, clone(node.arguments));
+  }
+
+  visitSuperMethodInvocation(SuperMethodInvocation node) {
+    return new SuperMethodInvocation(
+        node.name, clone(node.arguments), node.interfaceTarget);
+  }
+
+  visitStaticInvocation(StaticInvocation node) {
+    return new StaticInvocation(node.target, clone(node.arguments));
+  }
+
+  visitConstructorInvocation(ConstructorInvocation node) {
+    return new ConstructorInvocation(node.target, clone(node.arguments));
+  }
+
+  visitNot(Not node) {
+    return new Not(clone(node.operand));
+  }
+
+  visitLogicalExpression(LogicalExpression node) {
+    return new LogicalExpression(
+        clone(node.left), node.operator, clone(node.right));
+  }
+
+  visitConditionalExpression(ConditionalExpression node) {
+    return new ConditionalExpression(clone(node.condition), clone(node.then),
+        clone(node.otherwise), visitOptionalType(node.staticType));
+  }
+
+  visitStringConcatenation(StringConcatenation node) {
+    return new StringConcatenation(node.expressions.map(clone).toList());
+  }
+
+  visitIsExpression(IsExpression node) {
+    return new IsExpression(clone(node.operand), visitType(node.type));
+  }
+
+  visitAsExpression(AsExpression node) {
+    return new AsExpression(clone(node.operand), visitType(node.type));
+  }
+
+  visitSymbolLiteral(SymbolLiteral node) {
+    return new SymbolLiteral(node.value);
+  }
+
+  visitTypeLiteral(TypeLiteral node) {
+    return new TypeLiteral(visitType(node.type));
+  }
+
+  visitThisExpression(ThisExpression node) {
+    return new ThisExpression();
+  }
+
+  visitRethrow(Rethrow node) {
+    return new Rethrow();
+  }
+
+  visitThrow(Throw node) {
+    return new Throw(cloneOptional(node.expression));
+  }
+
+  visitListLiteral(ListLiteral node) {
+    return new ListLiteral(node.expressions.map(clone).toList(),
+        typeArgument: visitType(node.typeArgument), isConst: node.isConst);
+  }
+
+  visitMapLiteral(MapLiteral node) {
+    return new MapLiteral(node.entries.map(clone).toList(),
+        keyType: visitType(node.keyType),
+        valueType: visitType(node.valueType),
+        isConst: node.isConst);
+  }
+
+  visitMapEntry(MapEntry node) {
+    return new MapEntry(clone(node.key), clone(node.value));
+  }
+
+  visitAwaitExpression(AwaitExpression node) {
+    return new AwaitExpression(clone(node.operand));
+  }
+
+  visitFunctionExpression(FunctionExpression node) {
+    return new FunctionExpression(clone(node.function));
+  }
+
+  visitStringLiteral(StringLiteral node) {
+    return new StringLiteral(node.value);
+  }
+
+  visitIntLiteral(IntLiteral node) {
+    return new IntLiteral(node.value);
+  }
+
+  visitDoubleLiteral(DoubleLiteral node) {
+    return new DoubleLiteral(node.value);
+  }
+
+  visitBoolLiteral(BoolLiteral node) {
+    return new BoolLiteral(node.value);
+  }
+
+  visitNullLiteral(NullLiteral node) {
+    return new NullLiteral();
+  }
+
+  visitLet(Let node) {
+    var newVariable = clone(node.variable);
+    return new Let(newVariable, clone(node.body));
+  }
+
+  // Statements
+  visitInvalidStatement(InvalidStatement node) {
+    return new InvalidStatement();
+  }
+
+  visitExpressionStatement(ExpressionStatement node) {
+    return new ExpressionStatement(clone(node.expression));
+  }
+
+  visitBlock(Block node) {
+    return new Block(node.statements.map(clone).toList());
+  }
+
+  visitEmptyStatement(EmptyStatement node) {
+    return new EmptyStatement();
+  }
+
+  visitAssertStatement(AssertStatement node) {
+    return new AssertStatement(
+        clone(node.condition), cloneOptional(node.message));
+  }
+
+  visitLabeledStatement(LabeledStatement node) {
+    LabeledStatement newNode = new LabeledStatement(null);
+    labels[node] = newNode;
+    newNode.body = clone(node.body)..parent = newNode;
+    return newNode;
+  }
+
+  visitBreakStatement(BreakStatement node) {
+    return new BreakStatement(labels[node.target]);
+  }
+
+  visitWhileStatement(WhileStatement node) {
+    return new WhileStatement(clone(node.condition), clone(node.body));
+  }
+
+  visitDoStatement(DoStatement node) {
+    return new DoStatement(clone(node.body), clone(node.condition));
+  }
+
+  visitForStatement(ForStatement node) {
+    var variables = node.variables.map(clone).toList();
+    return new ForStatement(variables, cloneOptional(node.condition),
+        node.updates.map(clone).toList(), clone(node.body));
+  }
+
+  visitForInStatement(ForInStatement node) {
+    var newVariable = clone(node.variable);
+    return new ForInStatement(
+        newVariable, clone(node.iterable), clone(node.body));
+  }
+
+  visitSwitchStatement(SwitchStatement node) {
+    for (SwitchCase switchCase in node.cases) {
+      switchCases[switchCase] =
+          new SwitchCase(switchCase.expressions.map(clone).toList(), null);
+    }
+    return new SwitchStatement(
+        clone(node.expression), node.cases.map(clone).toList());
+  }
+
+  visitSwitchCase(SwitchCase node) {
+    var switchCase = switchCases[node];
+    switchCase.body = clone(node.body)..parent = switchCase;
+    return switchCase;
+  }
+
+  visitContinueSwitchStatement(ContinueSwitchStatement node) {
+    return new ContinueSwitchStatement(switchCases[node.target]);
+  }
+
+  visitIfStatement(IfStatement node) {
+    return new IfStatement(
+        clone(node.condition), clone(node.then), cloneOptional(node.otherwise));
+  }
+
+  visitReturnStatement(ReturnStatement node) {
+    return new ReturnStatement(cloneOptional(node.expression));
+  }
+
+  visitTryCatch(TryCatch node) {
+    return new TryCatch(clone(node.body), node.catches.map(clone).toList());
+  }
+
+  visitCatch(Catch node) {
+    var newException = cloneOptional(node.exception);
+    var newStackTrace = cloneOptional(node.stackTrace);
+    return new Catch(newException, clone(node.body),
+        stackTrace: newStackTrace, guard: visitType(node.guard));
+  }
+
+  visitTryFinally(TryFinally node) {
+    return new TryFinally(clone(node.body), clone(node.finalizer));
+  }
+
+  visitYieldStatement(YieldStatement node) {
+    return new YieldStatement(clone(node.expression));
+  }
+
+  visitVariableDeclaration(VariableDeclaration node) {
+    return variables[node] = new VariableDeclaration(node.name,
+        initializer: cloneOptional(node.initializer),
+        type: visitType(node.type),
+        isFinal: node.isFinal,
+        isConst: node.isConst);
+  }
+
+  visitFunctionDeclaration(FunctionDeclaration node) {
+    var newVariable = clone(node.variable);
+    return new FunctionDeclaration(newVariable, clone(node.function));
+  }
+
+  // Members
+  visitConstructor(Constructor node) {
+    return new Constructor(clone(node.function),
+        name: node.name,
+        isConst: node.isConst,
+        isExternal: node.isExternal,
+        initializers: node.initializers.map(clone).toList(),
+        transformerFlags: node.transformerFlags);
+  }
+
+  visitProcedure(Procedure node) {
+    return new Procedure(node.name, node.kind, clone(node.function),
+        isAbstract: node.isAbstract,
+        isStatic: node.isStatic,
+        isExternal: node.isExternal,
+        isConst: node.isConst,
+        transformerFlags: node.transformerFlags,
+        fileUri: node.fileUri);
+  }
+
+  visitField(Field node) {
+    return new Field(node.name,
+        type: visitType(node.type),
+        initializer: cloneOptional(node.initializer),
+        isFinal: node.isFinal,
+        isConst: node.isConst,
+        isStatic: node.isStatic,
+        hasImplicitGetter: node.hasImplicitGetter,
+        hasImplicitSetter: node.hasImplicitSetter,
+        transformerFlags: node.transformerFlags,
+        fileUri: node.fileUri);
+  }
+
+  visitTypeParameter(TypeParameter node) {
+    var newNode = new TypeParameter(node.name);
+    typeSubstitution[node] = new TypeParameterType(newNode);
+    newNode.bound = visitType(node.bound);
+    return newNode;
+  }
+
+  visitFunctionNode(FunctionNode node) {
+    var typeParameters = node.typeParameters.map(clone).toList();
+    var positional = node.positionalParameters.map(clone).toList();
+    var named = node.namedParameters.map(clone).toList();
+    return new FunctionNode(cloneOptional(node.body),
+        typeParameters: typeParameters,
+        positionalParameters: positional,
+        namedParameters: named,
+        requiredParameterCount: node.requiredParameterCount,
+        returnType: visitType(node.returnType),
+        asyncMarker: node.asyncMarker);
+  }
+
+  visitArguments(Arguments node) {
+    return new Arguments(node.positional.map(clone).toList(),
+        types: node.types.map(visitType).toList(),
+        named: node.named.map(clone).toList());
+  }
+
+  visitNamedExpression(NamedExpression node) {
+    return new NamedExpression(node.name, clone(node.value));
+  }
+}
diff --git a/pkg/kernel/lib/core_types.dart b/pkg/kernel/lib/core_types.dart
new file mode 100644
index 0000000..790b3fd
--- /dev/null
+++ b/pkg/kernel/lib/core_types.dart
@@ -0,0 +1,96 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.class_table;
+
+import 'ast.dart';
+
+/// Provides access to the classes and libraries in the core libraries.
+class CoreTypes {
+  final Map<String, _LibraryIndex> _dartLibraries = <String, _LibraryIndex>{};
+  Class objectClass;
+  Class nullClass;
+  Class boolClass;
+  Class intClass;
+  Class numClass;
+  Class doubleClass;
+  Class stringClass;
+  Class listClass;
+  Class mapClass;
+  Class iterableClass;
+  Class iteratorClass;
+  Class futureClass;
+  Class streamClass;
+  Class symbolClass;
+  Class internalSymbolClass;
+  Class typeClass;
+  Class functionClass;
+
+  Library getCoreLibrary(String uri) => _dartLibraries[uri].library;
+
+  Class getCoreClass(String libraryUri, String className) {
+    return _dartLibraries[libraryUri].require(className);
+  }
+
+  Procedure getCoreProcedure(String libraryUri, String topLevelMemberName) {
+    Library library = getCoreLibrary(libraryUri);
+    for (Procedure procedure in library.procedures) {
+      if (procedure.name.name == topLevelMemberName) return procedure;
+    }
+    throw 'Missing procedure ${topLevelMemberName} from $libraryUri';
+  }
+
+  CoreTypes(Program program) {
+    for (var library in program.libraries) {
+      if (library.importUri.scheme == 'dart') {
+        _dartLibraries['${library.importUri}'] = new _LibraryIndex(library);
+      }
+    }
+    _LibraryIndex dartCore = _dartLibraries['dart:core'];
+    _LibraryIndex dartAsync = _dartLibraries['dart:async'];
+    _LibraryIndex dartInternal = _dartLibraries['dart:_internal'];
+    objectClass = dartCore.require('Object');
+    nullClass = dartCore.require('Null');
+    boolClass = dartCore.require('bool');
+    intClass = dartCore.require('int');
+    numClass = dartCore.require('num');
+    doubleClass = dartCore.require('double');
+    stringClass = dartCore.require('String');
+    listClass = dartCore.require('List');
+    mapClass = dartCore.require('Map');
+    iterableClass = dartCore.require('Iterable');
+    iteratorClass = dartCore.require('Iterator');
+    symbolClass = dartCore.require('Symbol');
+    typeClass = dartCore.require('Type');
+    functionClass = dartCore.require('Function');
+    futureClass = dartAsync.require('Future');
+    streamClass = dartAsync.require('Stream');
+    internalSymbolClass = dartInternal.require('Symbol');
+  }
+}
+
+/// Provides by-name lookup of classes in a library.
+class _LibraryIndex {
+  final Library library;
+  final Map<String, Class> classes = <String, Class>{};
+
+  _LibraryIndex(this.library) {
+    for (Class classNode in library.classes) {
+      if (classNode.name != null) {
+        classes[classNode.name] = classNode;
+      }
+    }
+  }
+
+  Class require(String name) {
+    Class result = classes[name];
+    if (result == null) {
+      if (library.isExternal) {
+        throw 'Missing class $name from external library ${library.name}';
+      } else {
+        throw 'Missing class $name from ${library.name}';
+      }
+    }
+    return result;
+  }
+}
diff --git a/pkg/kernel/lib/frontend/accessors.dart b/pkg/kernel/lib/frontend/accessors.dart
new file mode 100644
index 0000000..5271f0b
--- /dev/null
+++ b/pkg/kernel/lib/frontend/accessors.dart
@@ -0,0 +1,423 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// A library to help transform compounds and null-aware accessors into
+/// let expressions.
+library kernel.frontend.accessors;
+
+import '../ast.dart';
+
+abstract class Accessor {
+  // [builtBinary] and [builtGetter] capture the inner nodes. Used by
+  // dart2js+rasta for determining how subexpressions map to legacy dart2js Ast
+  // nodes. This will be removed once dart2js type analysis (aka inference) is
+  // reimplemented on kernel.
+  Expression builtBinary;
+  Expression builtGetter;
+
+  Expression buildSimpleRead() {
+    return _finish(_makeSimpleRead());
+  }
+
+  /// Returns an assignment to the accessor.
+  ///
+  /// The returned expression evaluates to the assigned value, unless
+  /// [voidContext] is true, in which case it may evaluate to anything.
+  Expression buildAssignment(Expression value, {bool voidContext: false}) {
+    return _finish(_makeSimpleWrite(value, voidContext));
+  }
+
+  Expression buildNullAwareAssignment(Expression value, DartType type,
+      {bool voidContext: false}) {
+    if (voidContext) {
+      return _finish(new ConditionalExpression(buildIsNull(_makeRead()),
+          _makeWrite(value, voidContext), new NullLiteral(), type));
+    }
+    var tmp = new VariableDeclaration.forValue(_makeRead());
+    return _finish(makeLet(
+        tmp,
+        new ConditionalExpression(buildIsNull(new VariableGet(tmp)),
+            _makeWrite(value, voidContext), new VariableGet(tmp), type)));
+  }
+
+  Expression buildCompoundAssignment(Name binaryOperator, Expression value,
+      {bool voidContext: false, Procedure interfaceTarget}) {
+    return _finish(_makeWrite(
+        builtBinary =
+            makeBinary(_makeRead(), binaryOperator, interfaceTarget, value),
+        voidContext));
+  }
+
+  Expression buildPrefixIncrement(Name binaryOperator,
+      {bool voidContext: false, Procedure interfaceTarget}) {
+    return buildCompoundAssignment(binaryOperator, new IntLiteral(1),
+        voidContext: voidContext, interfaceTarget: interfaceTarget);
+  }
+
+  Expression buildPostfixIncrement(Name binaryOperator,
+      {bool voidContext: false, Procedure interfaceTarget}) {
+    if (voidContext) {
+      return buildPrefixIncrement(binaryOperator,
+          voidContext: true, interfaceTarget: interfaceTarget);
+    }
+    var value = new VariableDeclaration.forValue(_makeRead());
+    valueAccess() => new VariableGet(value);
+    var dummy = new VariableDeclaration.forValue(_makeWrite(
+        builtBinary = makeBinary(
+            valueAccess(), binaryOperator, interfaceTarget, new IntLiteral(1)),
+        true));
+    return _finish(makeLet(value, makeLet(dummy, valueAccess())));
+  }
+
+  Expression _makeSimpleRead() => _makeRead();
+
+  Expression _makeSimpleWrite(Expression value, bool voidContext) {
+    return _makeWrite(value, voidContext);
+  }
+
+  Expression _makeRead();
+
+  Expression _makeWrite(Expression value, bool voidContext);
+
+  Expression _finish(Expression body) => body;
+
+  makeInvalidRead() => new InvalidExpression();
+
+  makeInvalidWrite(Expression value) => wrapInvalid(value);
+}
+
+class VariableAccessor extends Accessor {
+  VariableDeclaration variable;
+  DartType promotedType;
+
+  VariableAccessor(this.variable, [this.promotedType]);
+
+  _makeRead() => new VariableGet(variable, promotedType);
+
+  _makeWrite(Expression value, bool voidContext) {
+    return variable.isFinal || variable.isConst
+        ? makeInvalidWrite(value)
+        : new VariableSet(variable, value);
+  }
+}
+
+class PropertyAccessor extends Accessor {
+  VariableDeclaration _receiverVariable;
+  Expression receiver;
+  Name name;
+  Member getter, setter;
+
+  static Accessor make(
+      Expression receiver, Name name, Member getter, Member setter) {
+    if (receiver is ThisExpression) {
+      return new ThisPropertyAccessor(name, getter, setter);
+    } else {
+      return new PropertyAccessor._internal(receiver, name, getter, setter);
+    }
+  }
+
+  PropertyAccessor._internal(
+      this.receiver, this.name, this.getter, this.setter);
+
+  _makeSimpleRead() => new PropertyGet(receiver, name, getter);
+  _makeSimpleWrite(Expression value, bool voidContext) {
+    return new PropertySet(receiver, name, value, setter);
+  }
+
+  receiverAccess() {
+    _receiverVariable ??= new VariableDeclaration.forValue(receiver);
+    return new VariableGet(_receiverVariable);
+  }
+
+  _makeRead() => builtGetter = new PropertyGet(receiverAccess(), name, getter);
+
+  _makeWrite(Expression value, bool voidContext) {
+    return new PropertySet(receiverAccess(), name, value, setter);
+  }
+
+  _finish(Expression body) => makeLet(_receiverVariable, body);
+}
+
+/// Special case of [PropertyAccessor] to avoid creating an indirect access to
+/// 'this'.
+class ThisPropertyAccessor extends Accessor {
+  Name name;
+  Member getter, setter;
+
+  ThisPropertyAccessor(this.name, this.getter, this.setter);
+
+  _makeRead() =>
+      builtGetter = new PropertyGet(new ThisExpression(), name, getter);
+
+  _makeWrite(Expression value, bool voidContext) {
+    return new PropertySet(new ThisExpression(), name, value, setter);
+  }
+}
+
+class NullAwarePropertyAccessor extends Accessor {
+  VariableDeclaration receiver;
+  Name name;
+  Member getter, setter;
+  DartType type;
+
+  NullAwarePropertyAccessor(
+      Expression receiver, this.name, this.getter, this.setter, this.type)
+      : this.receiver = makeOrReuseVariable(receiver);
+
+  receiverAccess() => new VariableGet(receiver);
+
+  _makeRead() => builtGetter = new PropertyGet(receiverAccess(), name, getter);
+
+  _makeWrite(Expression value, bool voidContext) {
+    return new PropertySet(receiverAccess(), name, value, setter);
+  }
+
+  _finish(Expression body) => makeLet(
+      receiver,
+      new ConditionalExpression(
+          buildIsNull(receiverAccess()), new NullLiteral(), body, type));
+}
+
+class SuperPropertyAccessor extends Accessor {
+  Name name;
+  Member getter, setter;
+
+  SuperPropertyAccessor(this.name, this.getter, this.setter);
+
+  _makeRead() => new SuperPropertyGet(name, getter);
+
+  _makeWrite(Expression value, bool voidContext) {
+    return new SuperPropertySet(name, value, setter);
+  }
+}
+
+final Name _indexGet = new Name('[]');
+final Name _indexSet = new Name('[]=');
+
+class IndexAccessor extends Accessor {
+  Expression receiver;
+  Expression index;
+  VariableDeclaration receiverVariable;
+  VariableDeclaration indexVariable;
+  Procedure getter, setter;
+
+  static Accessor make(Expression receiver, Expression index, Procedure getter,
+      Procedure setter) {
+    if (receiver is ThisExpression) {
+      return new ThisIndexAccessor(index, getter, setter);
+    } else {
+      return new IndexAccessor._internal(receiver, index, getter, setter);
+    }
+  }
+
+  IndexAccessor._internal(this.receiver, this.index, this.getter, this.setter);
+
+  _makeSimpleRead() => new MethodInvocation(
+      receiver, _indexGet, new Arguments(<Expression>[index]), getter);
+
+  _makeSimpleWrite(Expression value, bool voidContext) {
+    if (!voidContext) return _makeWriteAndReturn(value);
+    return new MethodInvocation(
+        receiver, _indexSet, new Arguments(<Expression>[index, value]), setter);
+  }
+
+  receiverAccess() {
+    // We cannot reuse the receiver if it is a variable since it might be
+    // reassigned in the index expression.
+    receiverVariable ??= new VariableDeclaration.forValue(receiver);
+    return new VariableGet(receiverVariable);
+  }
+
+  indexAccess() {
+    indexVariable ??= new VariableDeclaration.forValue(index);
+    return new VariableGet(indexVariable);
+  }
+
+  _makeRead() {
+    return new MethodInvocation(receiverAccess(), _indexGet,
+        new Arguments(<Expression>[indexAccess()]), getter);
+  }
+
+  _makeWrite(Expression value, bool voidContext) {
+    if (!voidContext) return _makeWriteAndReturn(value);
+    return new MethodInvocation(receiverAccess(), _indexSet,
+        new Arguments(<Expression>[indexAccess(), value]), setter);
+  }
+
+  _makeWriteAndReturn(Expression value) {
+    // The call to []= does not return the value like direct-style assignments
+    // do.  We need to bind the value in a let.
+    var valueVariable = new VariableDeclaration.forValue(value);
+    var dummy = new VariableDeclaration.forValue(new MethodInvocation(
+        receiverAccess(),
+        _indexSet,
+        new Arguments(
+            <Expression>[indexAccess(), new VariableGet(valueVariable)]),
+        setter));
+    return makeLet(
+        valueVariable, makeLet(dummy, new VariableGet(valueVariable)));
+  }
+
+  Expression _finish(Expression body) {
+    return makeLet(receiverVariable, makeLet(indexVariable, body));
+  }
+}
+
+/// Special case of [IndexAccessor] to avoid creating an indirect access to
+/// 'this'.
+class ThisIndexAccessor extends Accessor {
+  Expression index;
+  VariableDeclaration indexVariable;
+  Procedure getter, setter;
+
+  ThisIndexAccessor(this.index, this.getter, this.setter);
+
+  _makeSimpleRead() {
+    return new MethodInvocation(new ThisExpression(), _indexGet,
+        new Arguments(<Expression>[index]), getter);
+  }
+
+  _makeSimpleWrite(Expression value, bool voidContext) {
+    if (!voidContext) return _makeWriteAndReturn(value);
+    return new MethodInvocation(new ThisExpression(), _indexSet,
+        new Arguments(<Expression>[index, value]), setter);
+  }
+
+  indexAccess() {
+    indexVariable ??= new VariableDeclaration.forValue(index);
+    return new VariableGet(indexVariable);
+  }
+
+  _makeRead() => new MethodInvocation(new ThisExpression(), _indexGet,
+      new Arguments(<Expression>[indexAccess()]), getter);
+
+  _makeWrite(Expression value, bool voidContext) {
+    if (!voidContext) return _makeWriteAndReturn(value);
+    return new MethodInvocation(new ThisExpression(), _indexSet,
+        new Arguments(<Expression>[indexAccess(), value]), setter);
+  }
+
+  _makeWriteAndReturn(Expression value) {
+    var valueVariable = new VariableDeclaration.forValue(value);
+    var dummy = new VariableDeclaration.forValue(new MethodInvocation(
+        new ThisExpression(),
+        _indexSet,
+        new Arguments(
+            <Expression>[indexAccess(), new VariableGet(valueVariable)]),
+        setter));
+    return makeLet(
+        valueVariable, makeLet(dummy, new VariableGet(valueVariable)));
+  }
+
+  Expression _finish(Expression body) => makeLet(indexVariable, body);
+}
+
+class SuperIndexAccessor extends Accessor {
+  Expression index;
+  VariableDeclaration indexVariable;
+  Member getter, setter;
+
+  SuperIndexAccessor(this.index, this.getter, this.setter);
+
+  indexAccess() {
+    indexVariable ??= new VariableDeclaration.forValue(index);
+    return new VariableGet(indexVariable);
+  }
+
+  _makeSimpleRead() => new SuperMethodInvocation(
+      _indexGet, new Arguments(<Expression>[index]), getter);
+
+  _makeSimpleWrite(Expression value, bool voidContext) {
+    if (!voidContext) return _makeWriteAndReturn(value);
+    return new SuperMethodInvocation(
+        _indexSet, new Arguments(<Expression>[index, value]), setter);
+  }
+
+  _makeRead() {
+    return new SuperMethodInvocation(
+        _indexGet, new Arguments(<Expression>[indexAccess()]), getter);
+  }
+
+  _makeWrite(Expression value, bool voidContext) {
+    if (!voidContext) return _makeWriteAndReturn(value);
+    return new SuperMethodInvocation(
+        _indexSet, new Arguments(<Expression>[indexAccess(), value]), setter);
+  }
+
+  _makeWriteAndReturn(Expression value) {
+    var valueVariable = new VariableDeclaration.forValue(value);
+    var dummy = new VariableDeclaration.forValue(new SuperMethodInvocation(
+        _indexSet,
+        new Arguments(
+            <Expression>[indexAccess(), new VariableGet(valueVariable)]),
+        setter));
+    return makeLet(
+        valueVariable, makeLet(dummy, new VariableGet(valueVariable)));
+  }
+
+  Expression _finish(Expression body) {
+    return makeLet(indexVariable, body);
+  }
+}
+
+class StaticAccessor extends Accessor {
+  Member readTarget;
+  Member writeTarget;
+
+  StaticAccessor(this.readTarget, this.writeTarget);
+
+  _makeRead() =>
+      readTarget == null ? makeInvalidRead() : new StaticGet(readTarget);
+
+  _makeWrite(Expression value, bool voidContext) {
+    return writeTarget == null
+        ? makeInvalidWrite(value)
+        : new StaticSet(writeTarget, value);
+  }
+}
+
+class ReadOnlyAccessor extends Accessor {
+  Expression expression;
+  VariableDeclaration value;
+
+  ReadOnlyAccessor(this.expression);
+
+  _makeSimpleRead() => expression;
+
+  _makeRead() {
+    value ??= new VariableDeclaration.forValue(expression);
+    return new VariableGet(value);
+  }
+
+  _makeWrite(Expression value, bool voidContext) => makeInvalidWrite(value);
+
+  Expression _finish(Expression body) => makeLet(value, body);
+}
+
+Expression makeLet(VariableDeclaration variable, Expression body) {
+  if (variable == null) return body;
+  return new Let(variable, body);
+}
+
+Expression makeBinary(Expression left, Name operator, Procedure interfaceTarget,
+    Expression right) {
+  return new MethodInvocation(
+      left, operator, new Arguments(<Expression>[right]), interfaceTarget);
+}
+
+final Name _equalOperator = new Name('==');
+
+Expression buildIsNull(Expression value) {
+  return makeBinary(value, _equalOperator, null, new NullLiteral());
+}
+
+VariableDeclaration makeOrReuseVariable(Expression value) {
+  // TODO: Devise a way to remember if a variable declaration was reused
+  // or is fresh (hence needs a let binding).
+  return new VariableDeclaration.forValue(value);
+}
+
+Expression wrapInvalid(Expression e) {
+  return new Let(new VariableDeclaration.forValue(e), new InvalidExpression());
+}
diff --git a/pkg/kernel/lib/frontend/readme.md b/pkg/kernel/lib/frontend/readme.md
new file mode 100644
index 0000000..53037ab
--- /dev/null
+++ b/pkg/kernel/lib/frontend/readme.md
@@ -0,0 +1 @@
+Utility method to help the frontend generate kernel IR.
diff --git a/pkg/kernel/lib/frontend/super_initializers.dart b/pkg/kernel/lib/frontend/super_initializers.dart
new file mode 100644
index 0000000..4569274
--- /dev/null
+++ b/pkg/kernel/lib/frontend/super_initializers.dart
@@ -0,0 +1,56 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// A library to help move super calls last in the initializer list.
+library kernel.frontend.super_calls;
+
+import '../ast.dart';
+
+/// Mutates the initializer list of [node] so that its super initializer occurs
+/// last, while its arguments are evaluated at the correct place.
+///
+/// Does nothing if there is no super initializer or if it is already last.
+void moveSuperInitializerLast(Constructor node) {
+  List<Initializer> initializers = node.initializers;
+  if (initializers.isEmpty) return;
+  if (initializers.last is SuperInitializer) return;
+  int superIndex = -1;
+  for (int i = initializers.length - 1; i >= 0; --i) {
+    Initializer initializer = initializers[i];
+    if (initializer is SuperInitializer) {
+      superIndex = i;
+      break;
+    }
+  }
+  if (superIndex == -1) return;
+  SuperInitializer superCall = initializers[superIndex];
+  Arguments arguments = superCall.arguments;
+  int argumentCount = arguments.positional.length + arguments.named.length;
+
+  // We move all initializers after the super call to the place where the super
+  // call was, but reserve [argumentCount] slots before that for
+  // [LocalInitializer]s.
+  initializers.length += argumentCount;
+  initializers.setRange(
+      superIndex + argumentCount,  // desination start (inclusive)
+      initializers.length - 1,     // desination end (exclusive)
+      initializers,                // source list
+      superIndex + 1);             // source start index
+  initializers[initializers.length - 1] = superCall;
+
+  // Fill in the [argumentCount] reserved slots with the evaluation expressions
+  // of the arguments to the super constructor call.
+  int storeIndex = superIndex;
+  for (int i = 0; i < arguments.positional.length; ++i) {
+    var variable = new VariableDeclaration.forValue(arguments.positional[i]);
+    arguments.positional[i] = new VariableGet(variable)..parent = arguments;
+    initializers[storeIndex++] = new LocalInitializer(variable)..parent = node;
+  }
+  for (int i = 0; i < arguments.named.length; ++i) {
+    NamedExpression argument = arguments.named[i];
+    var variable = new VariableDeclaration.forValue(argument.value);
+    arguments.named[i].value = new VariableGet(variable)..parent = argument;
+    initializers[storeIndex++] = new LocalInitializer(variable)..parent = node;
+  }
+}
diff --git a/pkg/kernel/lib/import_table.dart b/pkg/kernel/lib/import_table.dart
new file mode 100644
index 0000000..89c2998
--- /dev/null
+++ b/pkg/kernel/lib/import_table.dart
@@ -0,0 +1,114 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.import_table;
+
+import 'ast.dart';
+import 'package:path/path.dart' as path;
+
+abstract class ImportTable {
+  int getImportIndex(Library library);
+}
+
+class ProgramImportTable implements ImportTable {
+  final Map<Library, int> _libraryIndex = <Library, int>{};
+
+  ProgramImportTable(Program program) {
+    for (int i = 0; i < program.libraries.length; ++i) {
+      _libraryIndex[program.libraries[i]] = i;
+    }
+  }
+
+  int getImportIndex(Library library) => _libraryIndex[library] ?? -1;
+}
+
+class LibraryImportTable implements ImportTable {
+  final List<String> _importPaths = <String>[];
+  final List<Library> _importedLibraries = <Library>[];
+  final Map<Library, int> _libraryIndex = <Library, int>{};
+
+  factory LibraryImportTable(Library lib) {
+    return new _ImportTableBuilder(lib).build();
+  }
+
+  LibraryImportTable.empty();
+
+  /// The list of imports.
+  ///
+  /// Should not be modified directly, as the index map would go out of sync.
+  List<String> get importPaths => _importPaths;
+
+  List<Library> get importedLibraries => _importedLibraries;
+
+  int addImport(Library target, String importPath) {
+    int index = _libraryIndex[target];
+    if (index != null) return index;
+    index = _importPaths.length;
+    _importPaths.add(importPath);
+    _importedLibraries.add(target);
+    _libraryIndex[target] = index;
+    return index;
+  }
+
+  /// Returns the index of the given import, or -1 if not found.
+  int getImportIndex(Library library) {
+    return _libraryIndex[library] ?? -1;
+  }
+
+  String getImportPath(Library library) {
+    return _importPaths[getImportIndex(library)];
+  }
+}
+
+/// Builds the import table for a given library.
+class _ImportTableBuilder extends RecursiveVisitor {
+  final LibraryImportTable table = new LibraryImportTable.empty();
+  final Library referenceLibrary;
+
+  LibraryImportTable build() {
+    referenceLibrary.accept(this);
+    return table;
+  }
+
+  _ImportTableBuilder(this.referenceLibrary) {
+    table.addImport(referenceLibrary, '');
+  }
+
+  void addLibraryImport(Library target) {
+    if (target == referenceLibrary) return; // Self-reference is special.
+    var referenceUri = referenceLibrary.importUri;
+    var targetUri = target.importUri;
+    if (targetUri == null) {
+      throw '$referenceUri cannot refer to library without an import URI';
+    }
+    if (targetUri.scheme == 'file' && referenceUri.scheme == 'file') {
+      var targetDirectory = path.dirname(targetUri.path);
+      var currentDirectory = path.dirname(referenceUri.path);
+      var relativeDirectory =
+          path.relative(targetDirectory, from: currentDirectory);
+      var filename = path.basename(targetUri.path);
+      table.addImport(target, '$relativeDirectory/$filename');
+    } else if (targetUri.scheme == 'file') {
+      // Cannot import a file:URI from a dart:URI or package:URI.
+      // We may want to remove this restriction, but for now it's just a sanity
+      // check.
+      throw '$referenceUri cannot refer to application library $targetUri';
+    } else {
+      table.addImport(target, target.importUri.toString());
+    }
+  }
+
+  visitClassReference(Class node) {
+    addLibraryImport(node.enclosingLibrary);
+  }
+
+  defaultMemberReference(Member node) {
+    addLibraryImport(node.enclosingLibrary);
+  }
+
+  visitName(Name name) {
+    if (name.library != null) {
+      addLibraryImport(name.library);
+    }
+  }
+}
diff --git a/pkg/kernel/lib/kernel.dart b/pkg/kernel/lib/kernel.dart
new file mode 100644
index 0000000..123f843
--- /dev/null
+++ b/pkg/kernel/lib/kernel.dart
@@ -0,0 +1,61 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// Conventions for paths:
+///
+/// - Use the [Uri] class for paths that may have the `file`, `dart` or
+///   `package` scheme.  Never use [Uri] for relative paths.
+/// - Use [String]s for all filenames and paths that have no scheme prefix.
+/// - Never translate a `dart:` or `package:` URI into a `file:` URI, instead
+///   translate it to a [String] if the file system path is needed.
+/// - Only use [File] from dart:io at the last moment when it is needed.
+///
+library kernel;
+
+import 'ast.dart';
+import 'binary/ast_to_binary.dart';
+import 'binary/loader.dart';
+import 'dart:async';
+import 'dart:io';
+import 'repository.dart';
+import 'text/ast_to_text.dart';
+
+export 'ast.dart';
+export 'repository.dart';
+
+Program loadProgramFromBinary(String path, [Repository repository]) {
+  repository ??= new Repository();
+  return new BinaryLoader(repository).loadProgram(path);
+}
+
+Future writeProgramToBinary(Program program, String path) {
+  var sink = new File(path).openWrite();
+  var future;
+  try {
+    new BinaryPrinter(sink).writeProgramFile(program);
+  } finally {
+    future = sink.close();
+  }
+  return future;
+}
+
+void writeLibraryToText(Library library, {String path}) {
+  StringBuffer buffer = new StringBuffer();
+  new Printer(buffer).writeLibraryFile(library);
+  if (path == null) {
+    print(buffer);
+  } else {
+    new File(path).writeAsStringSync('$buffer');
+  }
+}
+
+void writeProgramToText(Program program, {String path, bool showExternal: false}) {
+  StringBuffer buffer = new StringBuffer();
+  new Printer(buffer, showExternal: showExternal).writeProgramFile(program);
+  if (path == null) {
+    print(buffer);
+  } else {
+    new File(path).writeAsStringSync('$buffer');
+  }
+}
diff --git a/pkg/kernel/lib/log.dart b/pkg/kernel/lib/log.dart
new file mode 100644
index 0000000..9a6d6a2
--- /dev/null
+++ b/pkg/kernel/lib/log.dart
@@ -0,0 +1,9 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.log;
+
+import 'package:logging/logging.dart';
+export 'package:logging/logging.dart';
+
+final Logger log = new Logger("dart-kernel");
diff --git a/pkg/kernel/lib/repository.dart b/pkg/kernel/lib/repository.dart
new file mode 100644
index 0000000..7689d90
--- /dev/null
+++ b/pkg/kernel/lib/repository.dart
@@ -0,0 +1,76 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.repository;
+
+import 'dart:io';
+
+import 'package:path/path.dart' as pathlib;
+
+import 'ast.dart';
+
+/// Keeps track of which [Library] objects have been created for a given URI.
+///
+/// To load different files into the same IR, pass in the same repository
+/// object to the loaders.
+class Repository {
+  final String workingDirectory;
+  final Map<Uri, Library> _uriToLibrary = <Uri, Library>{};
+  final List<Library> libraries = <Library>[];
+
+  Repository({String workingDirectory})
+      : this.workingDirectory = workingDirectory ?? Directory.current.path;
+
+  /// Get the [Library] object for the library addresesd by [path]; possibly
+  /// as an external library.
+  ///
+  /// The [path] may be a relative or absolute file path, or a URI string with a
+  /// `dart:`, `package:` or `file:` scheme.
+  ///
+  /// Note that this method does not check if the library can be loaded at all.
+  Library getLibrary(String path) {
+    return getLibraryReference(normalizePath(path));
+  }
+
+  String normalizeFileExtension(String path) {
+    if (path.endsWith('.dill')) {
+      return path.substring(0, path.length - '.dill'.length) + '.dart';
+    } else {
+      return path;
+    }
+  }
+
+  /// Get the canonical URI for the library addressed by the given [path].
+  ///
+  /// The [path] may be a relative or absolute file path, or a URI string with a
+  /// `dart:`, `package:` or `file:` scheme.
+  Uri normalizePath(String path) {
+    var uri = Uri.parse(path);
+    if (!uri.hasScheme) {
+      if (!pathlib.isAbsolute(path)) {
+        path = pathlib.join(workingDirectory, path);
+      }
+      uri = new Uri(scheme: 'file', path: normalizeFileExtension(path));
+    } else if (uri.scheme == 'file') {
+      var path = normalizeFileExtension(uri.path);
+      if (!uri.hasAbsolutePath) {
+        uri = uri.replace(path: pathlib.join(workingDirectory, path));
+      } else {
+        uri = uri.replace(path: path);
+      }
+    }
+    return uri;
+  }
+
+  Library getLibraryReference(Uri uri) {
+    assert(uri.hasScheme);
+    assert(uri.scheme != 'file' || uri.hasAbsolutePath);
+    return _uriToLibrary.putIfAbsent(uri, () => _buildLibraryReference(uri));
+  }
+
+  Library _buildLibraryReference(Uri uri) {
+    var library = new Library(uri, isExternal: true);
+    libraries.add(library);
+    return library;
+  }
+}
diff --git a/pkg/kernel/lib/target/flutter.dart b/pkg/kernel/lib/target/flutter.dart
new file mode 100644
index 0000000..5673a22
--- /dev/null
+++ b/pkg/kernel/lib/target/flutter.dart
@@ -0,0 +1,67 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.target.flutter;
+
+import '../ast.dart';
+import '../transformations/continuation.dart' as cont;
+import '../transformations/erasure.dart';
+import '../transformations/sanitize_for_vm.dart';
+import '../transformations/mixin_full_resolution.dart' as mix;
+import '../transformations/setup_builtin_library.dart' as setup_builtin_library;
+import 'targets.dart';
+
+class FlutterTarget extends Target {
+  final TargetFlags flags;
+
+  FlutterTarget(this.flags);
+
+  bool get strongMode => flags.strongMode;
+
+  bool get strongModeSdk => false;
+
+  String get name => 'flutter';
+
+  // This is the order that bootstrap libraries are loaded according to
+  // `runtime/vm/object_store.h`.
+  List<String> get extraRequiredLibraries => const <String>[
+        'dart:async',
+        'dart:collection',
+        'dart:convert',
+        'dart:developer',
+        'dart:_internal',
+        'dart:isolate',
+        'dart:math',
+
+        // The library dart:mirrors may be ignored by the VM, e.g. when built in
+        // PRODUCT mode.
+        'dart:mirrors',
+
+        'dart:profiler',
+        'dart:typed_data',
+        'dart:_vmservice',
+        'dart:_builtin',
+        'dart:nativewrappers',
+        'dart:io',
+
+        // Required for flutter.
+        'dart:ui',
+        'dart:jni',
+        'dart:vmservice_sky',
+      ];
+
+  void transformProgram(Program program) {
+    new mix.MixinFullResolution().transform(program);
+    cont.transformProgram(program);
+
+    // Repair `_getMainClosure()` function in dart:{_builtin,ui} libraries.
+    setup_builtin_library.transformProgram(program);
+    setup_builtin_library.transformProgram(program, libraryUri: 'dart:ui');
+
+    if (strongMode) {
+      new Erasure().transform(program);
+    }
+
+    new SanitizeForVM().transform(program);
+  }
+}
diff --git a/pkg/kernel/lib/target/readme.md b/pkg/kernel/lib/target/readme.md
new file mode 100644
index 0000000..d614241
--- /dev/null
+++ b/pkg/kernel/lib/target/readme.md
@@ -0,0 +1,3 @@
+Target configurations.
+
+A target can tailor the kernel IR for a specific backend.
diff --git a/pkg/kernel/lib/target/targets.dart b/pkg/kernel/lib/target/targets.dart
new file mode 100644
index 0000000..1dcae03
--- /dev/null
+++ b/pkg/kernel/lib/target/targets.dart
@@ -0,0 +1,67 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.target.targets;
+
+import '../ast.dart';
+
+import 'vm.dart';
+import 'flutter.dart';
+
+final List<String> targetNames = targets.keys.toList();
+
+class TargetFlags {
+  bool strongMode;
+  TargetFlags({this.strongMode: false});
+}
+
+typedef Target _TargetBuilder(TargetFlags flags);
+
+final Map<String, _TargetBuilder> targets = <String, _TargetBuilder>{
+  'none': (TargetFlags flags) => new NoneTarget(flags),
+  'vm': (TargetFlags flags) => new VmTarget(flags),
+  'flutter': (TargetFlags flags) => new FlutterTarget(flags),
+};
+
+Target getTarget(String name, TargetFlags flags) {
+  var builder = targets[name];
+  if (builder == null) return null;
+  return builder(flags);
+}
+
+/// A target provides backend-specific options for generating kernel IR.
+abstract class Target {
+  String get name;
+
+  /// A list of URIs of required libraries, not including dart:core.
+  ///
+  /// Libraries will be loaded in order.
+  List<String> get extraRequiredLibraries => <String>[];
+
+  /// Additional declared variables implied by this target.
+  ///
+  /// These can also be passed on the command-line of form `-D<name>=<value>`,
+  /// and those provided on the command-line take precedence over those defined
+  /// by the target.
+  Map<String, String> get extraDeclaredVariables => const <String, String>{};
+
+  bool get strongMode;
+
+  /// If true, the SDK should be loaded in strong mode.
+  bool get strongModeSdk => strongMode;
+
+  void transformProgram(Program program);
+
+  String toString() => 'Target($name)';
+}
+
+class NoneTarget extends Target {
+  final TargetFlags flags;
+
+  NoneTarget(this.flags);
+
+  bool get strongMode => flags.strongMode;
+  String get name => 'none';
+  List<String> get extraRequiredLibraries => <String>[];
+  void transformProgram(Program program) {}
+}
diff --git a/pkg/kernel/lib/target/vm.dart b/pkg/kernel/lib/target/vm.dart
new file mode 100644
index 0000000..e6c5d94
--- /dev/null
+++ b/pkg/kernel/lib/target/vm.dart
@@ -0,0 +1,66 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.target.vm;
+
+import '../ast.dart';
+import '../transformations/continuation.dart' as cont;
+import '../transformations/erasure.dart';
+import '../transformations/mixin_full_resolution.dart' as mix;
+import '../transformations/sanitize_for_vm.dart';
+import '../transformations/setup_builtin_library.dart' as setup_builtin_library;
+import 'targets.dart';
+
+/// Specializes the kernel IR to the Dart VM.
+class VmTarget extends Target {
+  final TargetFlags flags;
+
+  VmTarget(this.flags);
+
+  bool get strongMode => flags.strongMode;
+
+  /// The VM patch files are not strong mode clean, so we adopt a hybrid mode
+  /// where the SDK is internally unchecked, but trusted to satisfy the types
+  /// declared on its interface.
+  bool get strongModeSdk => false;
+
+  String get name => 'vm';
+
+  // This is the order that bootstrap libraries are loaded according to
+  // `runtime/vm/object_store.h`.
+  List<String> get extraRequiredLibraries => const <String>[
+        'dart:async',
+        'dart:collection',
+        'dart:convert',
+        'dart:developer',
+        'dart:_internal',
+        'dart:isolate',
+        'dart:math',
+
+        // The library dart:mirrors may be ignored by the VM, e.g. when built in
+        // PRODUCT mode.
+        'dart:mirrors',
+
+        'dart:profiler',
+        'dart:typed_data',
+        'dart:vmservice_io',
+        'dart:_vmservice',
+        'dart:_builtin',
+        'dart:nativewrappers',
+        'dart:io',
+      ];
+
+  void transformProgram(Program program) {
+    new mix.MixinFullResolution().transform(program);
+    cont.transformProgram(program);
+
+    // Repair `_getMainClosure()` function in dart:_builtin.
+    setup_builtin_library.transformProgram(program);
+
+    if (strongMode) {
+      new Erasure().transform(program);
+    }
+
+    new SanitizeForVM().transform(program);
+  }
+}
diff --git a/pkg/kernel/lib/text/ast_to_text.dart b/pkg/kernel/lib/text/ast_to_text.dart
new file mode 100644
index 0000000..18be9de
--- /dev/null
+++ b/pkg/kernel/lib/text/ast_to_text.dart
@@ -0,0 +1,1544 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.ast_to_text;
+
+import '../ast.dart';
+import '../import_table.dart';
+import '../type_propagation/type_propagation.dart';
+
+class Namer<T> {
+  int index = 0;
+  final String prefix;
+  final Map<T, String> map = <T, String>{};
+
+  Namer(this.prefix);
+
+  String getName(T key) => map.putIfAbsent(key, () => '$prefix${++index}');
+}
+
+class Disambiguator<T> {
+  final Map<T, String> names = <T, String>{};
+  final Set<String> usedNames = new Set<String>();
+
+  String disambiguate(T key, String proposeName()) {
+    return names.putIfAbsent(key, () {
+      var proposedName = proposeName();
+      if (usedNames.add(proposedName)) return proposedName;
+      int i = 2;
+      while (!usedNames.add('$proposedName$i')) {
+        ++i;
+      }
+      return '$proposedName$i';
+    });
+  }
+}
+
+NameSystem globalDebuggingNames = new NameSystem();
+
+String debugLibraryName(Library node) {
+  return node.name ?? globalDebuggingNames.nameLibrary(node);
+}
+
+String debugClassName(Class node) {
+  return node.name ?? globalDebuggingNames.nameClass(node);
+}
+
+String debugQualifiedClassName(Class node) {
+  return debugLibraryName(node.enclosingLibrary) + '::' + debugClassName(node);
+}
+
+String debugMemberName(Member node) {
+  return node.name?.name ?? globalDebuggingNames.nameMember(node);
+}
+
+String debugQualifiedMemberName(Member node) {
+  if (node.enclosingClass != null) {
+    return debugQualifiedClassName(node.enclosingClass) +
+        '::' +
+        debugMemberName(node);
+  } else {
+    return debugLibraryName(node.enclosingLibrary) +
+        '::' +
+        debugMemberName(node);
+  }
+}
+
+String debugTypeParameterName(TypeParameter node) {
+  return node.name ?? globalDebuggingNames.nameTypeParameter(node);
+}
+
+String debugQualifiedTypeParameterName(TypeParameter node) {
+  if (node.parent is Class) {
+    return debugQualifiedClassName(node.parent) +
+        '::' +
+        debugTypeParameterName(node);
+  }
+  if (node.parent is Member) {
+    return debugQualifiedMemberName(node.parent) +
+        '::' +
+        debugTypeParameterName(node);
+  }
+  return debugTypeParameterName(node);
+}
+
+String debugVariableDeclarationName(VariableDeclaration node) {
+  return node.name ?? globalDebuggingNames.nameVariable(node);
+}
+
+String debugNodeToString(Node node) {
+  StringBuffer buffer = new StringBuffer();
+  new Printer(buffer, syntheticNames: globalDebuggingNames).writeNode(node);
+  return '$buffer';
+}
+
+String programToString(Program node) {
+  StringBuffer buffer = new StringBuffer();
+  new Printer(buffer, syntheticNames: new NameSystem()).writeProgramFile(node);
+  return '$buffer';
+}
+
+class NameSystem {
+  final Namer<VariableDeclaration> variables =
+      new Namer<VariableDeclaration>('#t');
+  final Namer<Member> members = new Namer<Member>('#m');
+  final Namer<Class> classes = new Namer<Class>('#class');
+  final Namer<Library> libraries = new Namer<Library>('#lib');
+  final Namer<TypeParameter> typeParameters = new Namer<TypeParameter>('#T');
+  final Namer<TreeNode> labels = new Namer<TreeNode>('#L');
+  final Disambiguator<Library> prefixes = new Disambiguator<Library>();
+
+  nameVariable(VariableDeclaration node) => variables.getName(node);
+  nameMember(Member node) => members.getName(node);
+  nameClass(Class node) => classes.getName(node);
+  nameLibrary(Library node) => libraries.getName(node);
+  nameTypeParameter(TypeParameter node) => typeParameters.getName(node);
+  nameSwitchCase(SwitchCase node) => labels.getName(node);
+  nameLabeledStatement(LabeledStatement node) => labels.getName(node);
+
+  nameLibraryPrefix(Library node, {String proposedName}) {
+    return prefixes.disambiguate(node, () {
+      if (proposedName != null) return proposedName;
+      if (node.name != null) return abbreviateName(node.name);
+      if (node.importUri != null) {
+        var path = node.importUri.hasEmptyPath
+            ? '${node.importUri}'
+            : node.importUri.pathSegments.last;
+        if (path.endsWith('.dart')) {
+          path = path.substring(0, path.length - '.dart'.length);
+        }
+        return abbreviateName(path);
+      }
+      return 'L';
+    });
+  }
+
+  final RegExp punctuation = new RegExp('[.:]');
+
+  String abbreviateName(String name) {
+    int dot = name.lastIndexOf(punctuation);
+    if (dot != -1) {
+      name = name.substring(dot + 1);
+    }
+    if (name.length > 4) {
+      return name.substring(0, 3);
+    }
+    return name;
+  }
+}
+
+abstract class Annotator {
+  String annotateVariable(Printer printer, VariableDeclaration node);
+  String annotateReturn(Printer printer, FunctionNode node);
+  String annotateField(Printer printer, Field node);
+}
+
+class InferredValueAnnotator implements Annotator {
+  const InferredValueAnnotator();
+
+  String annotateVariable(Printer printer, VariableDeclaration node) {
+    if (node.inferredValue == null) return null;
+    return printer.getInferredValueString(node.inferredValue);
+  }
+
+  String annotateReturn(Printer printer, FunctionNode node) {
+    if (node.inferredReturnValue == null) return null;
+    return printer.getInferredValueString(node.inferredReturnValue);
+  }
+
+  String annotateField(Printer printer, Field node) {
+    if (node.inferredValue == null) return null;
+    return printer.getInferredValueString(node.inferredValue);
+  }
+}
+
+/// A quick and dirty ambiguous text printer.
+class Printer extends Visitor<Null> {
+  final NameSystem syntheticNames;
+  final StringSink sink;
+  final Annotator annotator;
+  ImportTable importTable;
+  int indentation = 0;
+  int column = 0;
+  bool showExternal;
+
+  static int SPACE = 0;
+  static int WORD = 1;
+  static int SYMBOL = 2;
+  int state = SPACE;
+
+  Printer(this.sink,
+      {NameSystem syntheticNames,
+      this.showExternal,
+      this.importTable,
+      this.annotator: const InferredValueAnnotator()})
+      : this.syntheticNames = syntheticNames ?? new NameSystem();
+
+  Printer._inner(Printer parent, this.importTable)
+      : sink = parent.sink,
+        syntheticNames = parent.syntheticNames,
+        annotator = parent.annotator,
+        showExternal = parent.showExternal;
+
+  String getLibraryName(Library node) {
+    return node.name ?? syntheticNames.nameLibrary(node);
+  }
+
+  String getLibraryReference(Library node) {
+    if (node == null) return '<No Library>';
+    if (importTable != null && importTable.getImportIndex(node) != -1) {
+      return syntheticNames.nameLibraryPrefix(node);
+    }
+    return getLibraryName(node);
+  }
+
+  String getClassName(Class node) {
+    return node.name ?? syntheticNames.nameClass(node);
+  }
+
+  String getClassReference(Class node) {
+    if (node == null) return '<No Class>';
+    String name = getClassName(node);
+    String library = getLibraryReference(node.enclosingLibrary);
+    return '$library::$name';
+  }
+
+  String getInferredValueString(InferredValue value) {
+    if (value.isNothing) return 'Nothing';
+    if (value.isAlwaysNull) return 'Null';
+    assert(value.baseClass != null);
+    String baseName = getClassReference(value.baseClass);
+    String baseSuffix = value.isSubclass ? '+' : value.isSubtype ? '*' : '!';
+    String bitSuffix = ValueBit.format(value.valueBits);
+    return '$baseName$baseSuffix $bitSuffix';
+  }
+
+  static final String emptyNameString = '•';
+  static final Name emptyName = new Name(emptyNameString);
+
+  Name getMemberName(Member node) {
+    if (node.name?.name == '') return emptyName;
+    if (node.name != null) return node.name;
+    return new Name(syntheticNames.nameMember(node));
+  }
+
+  String getMemberReference(Member node) {
+    if (node == null) return '<No Member>';
+    String name = getMemberName(node).name;
+    if (node.parent is Class) {
+      String className = getClassReference(node.parent);
+      return '$className::$name';
+    } else {
+      String library = getLibraryReference(node.enclosingLibrary);
+      return '$library::$name';
+    }
+  }
+
+  String getVariableName(VariableDeclaration node) {
+    return node.name ?? syntheticNames.nameVariable(node);
+  }
+
+  String getVariableReference(VariableDeclaration node) {
+    if (node == null) return '<No VariableDeclaration>';
+    return getVariableName(node);
+  }
+
+  String getTypeParameterName(TypeParameter node) {
+    return node.name ?? syntheticNames.nameTypeParameter(node);
+  }
+
+  String getTypeParameterReference(TypeParameter node) {
+    if (node == null) return '<No TypeParameter>';
+    String name = getTypeParameterName(node);
+    if (node.parent is FunctionNode && node.parent.parent is Member) {
+      String member = getMemberReference(node.parent.parent);
+      return '$member::$name';
+    } else if (node.parent is Class) {
+      String className = getClassReference(node.parent);
+      return '$className::$name';
+    } else {
+      return name; // Bound inside a function type.
+    }
+  }
+
+  void writeLibraryFile(Library library) {
+    writeWord('library');
+    if (library.name != null) {
+      writeWord(library.name);
+    }
+    endLine(';');
+    var imports = new LibraryImportTable(library);
+    for (var library in imports.importedLibraries) {
+      var importPath = imports.getImportPath(library);
+      if (importPath == "") {
+        var prefix =
+            syntheticNames.nameLibraryPrefix(library, proposedName: 'self');
+        endLine('import self as $prefix;');
+      } else {
+        var prefix = syntheticNames.nameLibraryPrefix(library);
+        endLine('import "$importPath" as $prefix;');
+      }
+    }
+    endLine();
+    var inner = new Printer._inner(this, imports);
+    library.classes.forEach(inner.writeNode);
+    library.fields.forEach(inner.writeNode);
+    library.procedures.forEach(inner.writeNode);
+  }
+
+  void writeProgramFile(Program program) {
+    ImportTable imports = new ProgramImportTable(program);
+    var inner = new Printer._inner(this, imports);
+    writeWord('main');
+    writeSpaced('=');
+    inner.writeMemberReference(program.mainMethod);
+    endLine(';');
+    for (var library in program.libraries) {
+      if (library.isExternal) {
+        if (!showExternal) {
+          continue;
+        }
+        writeWord('external');
+      }
+      writeWord('library');
+      if (library.name != null) {
+        writeWord(library.name);
+      }
+      if (library.importUri != null) {
+        writeSpaced('from');
+        writeWord('"${library.importUri}"');
+      }
+      var prefix = syntheticNames.nameLibraryPrefix(library);
+      writeSpaced('as');
+      writeWord(prefix);
+      endLine(' {');
+      ++inner.indentation;
+      library.classes.forEach(inner.writeNode);
+      library.fields.forEach(inner.writeNode);
+      library.procedures.forEach(inner.writeNode);
+      --inner.indentation;
+      endLine('}');
+    }
+  }
+
+  int getPrecedence(TreeNode node) {
+    return Precedence.of(node);
+  }
+
+  void write(String string) {
+    sink.write(string);
+    column += string.length;
+  }
+
+  void writeSpace([String string = ' ']) {
+    write(string);
+    state = SPACE;
+  }
+
+  void ensureSpace() {
+    if (state != SPACE) writeSpace();
+  }
+
+  void writeSymbol(String string) {
+    write(string);
+    state = SYMBOL;
+  }
+
+  void writeSpaced(String string) {
+    ensureSpace();
+    write(string);
+    writeSpace();
+  }
+
+  void writeComma([String string = ',']) {
+    write(string);
+    writeSpace();
+  }
+
+  void writeWord(String string) {
+    if (string.isEmpty) return;
+    ensureWordBoundary();
+    write(string);
+    state = WORD;
+  }
+
+  void ensureWordBoundary() {
+    if (state == WORD) {
+      writeSpace();
+    }
+  }
+
+  void writeIndentation() {
+    writeSpace('  ' * indentation);
+  }
+
+  void writeNode(Node node) {
+    node.accept(this);
+  }
+
+  void writeOptionalNode(Node node) {
+    if (node != null) {
+      node.accept(this);
+    }
+  }
+
+  void writeAnnotatedType(DartType type, String annotation) {
+    writeType(type);
+    if (annotation != null) {
+      write('/');
+      write(annotation);
+      state = WORD;
+    }
+  }
+
+  void writeType(DartType type) {
+    if (type == null) {
+      print('<No DartType>');
+    } else {
+      type.accept(this);
+    }
+  }
+
+  void writeOptionalType(DartType type) {
+    if (type != null) {
+      type.accept(this);
+    }
+  }
+
+  visitSupertype(Supertype type) {
+    if (type == null) {
+      print('<No Supertype>');
+    } else {
+      writeClassReference(type.classNode);
+      if (type.typeArguments.isNotEmpty) {
+        writeSymbol('<');
+        writeList(type.typeArguments, writeType);
+        writeSymbol('>');
+      }
+    }
+  }
+
+  void writeModifier(bool isThere, String name) {
+    if (isThere) {
+      writeWord(name);
+    }
+  }
+
+  void writeName(Name name) {
+    if (name?.name == '') {
+      writeWord(emptyNameString);
+    } else {
+      writeWord(name?.name ?? '<anon>'); // TODO: write library name
+    }
+  }
+
+  void endLine([String string]) {
+    if (string != null) {
+      write(string);
+    }
+    write('\n');
+    state = SPACE;
+    column = 0;
+  }
+
+  void writeFunction(FunctionNode function,
+      {name, List<Initializer> initializers, bool terminateLine: true}) {
+    if (name is String) {
+      writeWord(name);
+    } else if (name is Name) {
+      writeName(name);
+    } else {
+      assert(name == null);
+    }
+    writeTypeParameterList(function.typeParameters);
+    writeParameterList(function.positionalParameters, function.namedParameters,
+        function.requiredParameterCount);
+    writeReturnType(
+        function.returnType, annotator?.annotateReturn(this, function));
+    if (initializers != null && initializers.isNotEmpty) {
+      endLine();
+      ++indentation;
+      writeIndentation();
+      writeComma(':');
+      writeList(initializers, writeNode);
+      --indentation;
+    }
+    if (function.asyncMarker != AsyncMarker.Sync) {
+      writeSpaced(getAsyncMarkerKeyword(function.asyncMarker));
+    }
+    if (function.body != null) {
+      writeFunctionBody(function.body, terminateLine: terminateLine);
+    } else if (terminateLine) {
+      endLine(';');
+    }
+  }
+
+  String getAsyncMarkerKeyword(AsyncMarker marker) {
+    switch (marker) {
+      case AsyncMarker.Sync:
+        return 'sync';
+      case AsyncMarker.SyncStar:
+        return 'sync*';
+      case AsyncMarker.Async:
+        return 'async';
+      case AsyncMarker.AsyncStar:
+        return 'async*';
+      case AsyncMarker.SyncYielding:
+        return 'yielding';
+      default:
+        return '<Invalid async marker: $marker>';
+    }
+  }
+
+  void writeFunctionBody(Statement body, {bool terminateLine: true}) {
+    if (body is Block && body.statements.isEmpty) {
+      ensureSpace();
+      writeSymbol('{}');
+      state = WORD;
+      if (terminateLine) {
+        endLine();
+      }
+    } else if (body is Block) {
+      ensureSpace();
+      endLine('{');
+      ++indentation;
+      body.statements.forEach(writeNode);
+      --indentation;
+      writeIndentation();
+      writeSymbol('}');
+      state = WORD;
+      if (terminateLine) {
+        endLine();
+      }
+    } else if (body is ReturnStatement && !terminateLine) {
+      writeSpaced('=>');
+      writeExpression(body.expression);
+    } else {
+      writeBody(body);
+    }
+  }
+
+  void writeBody(Statement body) {
+    if (body is Block) {
+      endLine(' {');
+      ++indentation;
+      body.statements.forEach(writeNode);
+      --indentation;
+      writeIndentation();
+      endLine('}');
+    } else {
+      endLine();
+      ++indentation;
+      writeNode(body);
+      --indentation;
+    }
+  }
+
+  void writeReturnType(DartType type, String annotation) {
+    if (type == null) return;
+    writeSpaced('→');
+    writeAnnotatedType(type, annotation);
+  }
+
+  void writeTypeParameterList(List<TypeParameter> typeParameters) {
+    if (typeParameters.isEmpty) return;
+    writeSymbol('<');
+    writeList(typeParameters, writeNode);
+    writeSymbol('>');
+    state = WORD; // Ensure space if not followed by another symbol.
+  }
+
+  void writeParameterList(List<VariableDeclaration> positional,
+      List<VariableDeclaration> named, int requiredParameterCount) {
+    writeSymbol('(');
+    writeList(
+        positional.take(requiredParameterCount), writeVariableDeclaration);
+    if (requiredParameterCount < positional.length) {
+      if (requiredParameterCount > 0) {
+        writeComma();
+      }
+      writeSymbol('[');
+      writeList(
+          positional.skip(requiredParameterCount), writeVariableDeclaration);
+      writeSymbol(']');
+    }
+    if (named.isNotEmpty) {
+      if (positional.isNotEmpty) {
+        writeComma();
+      }
+      writeSymbol('{');
+      writeList(named, writeVariableDeclaration);
+      writeSymbol('}');
+    }
+    writeSymbol(')');
+  }
+
+  void writeList(Iterable nodes, callback(x), {String separator: ','}) {
+    bool first = true;
+    for (var node in nodes) {
+      if (first) {
+        first = false;
+      } else {
+        writeComma(separator);
+      }
+      callback(node);
+    }
+  }
+
+  void writeMemberReference(Member member) {
+    writeWord(getMemberReference(member));
+  }
+
+  void writeClassReference(Class classNode) {
+    writeWord(getClassReference(classNode));
+  }
+
+  void writeLibraryReference(Library library) {
+    writeWord(getLibraryReference(library));
+  }
+
+  void writeVariableReference(VariableDeclaration variable) {
+    writeWord(getVariableReference(variable));
+  }
+
+  void writeTypeParameterReference(TypeParameter node) {
+    writeWord(getTypeParameterReference(node));
+  }
+
+  void writeExpression(Expression node, [int minimumPrecedence]) {
+    bool needsParenteses = false;
+    if (minimumPrecedence != null && getPrecedence(node) < minimumPrecedence) {
+      needsParenteses = true;
+      writeSymbol('(');
+    }
+    writeNode(node);
+    if (needsParenteses) {
+      writeSymbol(')');
+    }
+  }
+
+  void writeAnnotation(Expression node) {
+    writeSymbol('@');
+    if (node is ConstructorInvocation) {
+      writeMemberReference(node.target);
+      visitArguments(node.arguments);
+    } else {
+      writeExpression(node);
+    }
+  }
+
+  void writeAnnotationList(List<Expression> nodes) {
+    for (Expression node in nodes) {
+      writeIndentation();
+      writeAnnotation(node);
+      endLine();
+    }
+  }
+
+  visitLibrary(Library node) {}
+
+  visitField(Field node) {
+    writeAnnotationList(node.annotations);
+    writeIndentation();
+    writeModifier(node.isStatic, 'static');
+    writeModifier(node.isFinal, 'final');
+    writeModifier(node.isConst, 'const');
+    // Only show implicit getter/setter modifiers in cases where they are
+    // out of the ordinary.
+    if (node.isStatic) {
+      writeModifier(node.hasImplicitGetter, '[getter]');
+      writeModifier(node.hasImplicitSetter, '[setter]');
+    } else {
+      writeModifier(!node.hasImplicitGetter, '[no-getter]');
+      if (node.isFinal) {
+        writeModifier(node.hasImplicitSetter, '[setter]');
+      } else {
+        writeModifier(!node.hasImplicitSetter, '[no-setter]');
+      }
+    }
+    writeWord('field');
+    writeSpace();
+    writeAnnotatedType(node.type, annotator?.annotateField(this, node));
+    writeName(getMemberName(node));
+    if (node.initializer != null) {
+      writeSpaced('=');
+      writeExpression(node.initializer);
+    }
+    if ((node.enclosingClass == null &&
+            node.enclosingLibrary.fileUri != node.fileUri) ||
+        (node.enclosingClass != null &&
+            node.enclosingClass.fileUri != node.fileUri)) {
+      writeWord("/* from ${node.fileUri} */");
+    }
+    endLine(';');
+  }
+
+  visitProcedure(Procedure node) {
+    writeAnnotationList(node.annotations);
+    writeIndentation();
+    writeModifier(node.isExternal, 'external');
+    writeModifier(node.isStatic, 'static');
+    writeModifier(node.isAbstract, 'abstract');
+    writeWord(procedureKindToString(node.kind));
+    if ((node.enclosingClass == null &&
+            node.enclosingLibrary.fileUri != node.fileUri) ||
+        (node.enclosingClass != null &&
+            node.enclosingClass.fileUri != node.fileUri)) {
+      writeWord("/* from ${node.fileUri} */");
+    }
+    writeFunction(node.function, name: getMemberName(node));
+  }
+
+  visitConstructor(Constructor node) {
+    writeAnnotationList(node.annotations);
+    writeIndentation();
+    writeModifier(node.isExternal, 'external');
+    writeModifier(node.isConst, 'const');
+    writeWord('constructor');
+    writeFunction(node.function,
+        name: node.name, initializers: node.initializers);
+  }
+
+  visitClass(Class node) {
+    writeAnnotationList(node.annotations);
+    writeIndentation();
+    writeModifier(node.isAbstract, 'abstract');
+    writeWord('class');
+    writeWord(getClassName(node));
+    writeTypeParameterList(node.typeParameters);
+    if (node.isMixinApplication) {
+      writeSpaced('=');
+      visitSupertype(node.supertype);
+      writeSpaced('with');
+      visitSupertype(node.mixedInType);
+    } else if (node.supertype != null) {
+      writeSpaced('extends');
+      visitSupertype(node.supertype);
+    }
+    if (node.implementedTypes.isNotEmpty) {
+      writeSpaced('implements');
+      writeList(node.implementedTypes, visitSupertype);
+    }
+    var endLineString = ' {';
+    if (node.enclosingLibrary.fileUri != node.fileUri) {
+      endLineString += ' // from ${node.fileUri}';
+    }
+    endLine(endLineString);
+    ++indentation;
+    node.fields.forEach(writeNode);
+    node.constructors.forEach(writeNode);
+    node.procedures.forEach(writeNode);
+    --indentation;
+    writeIndentation();
+    endLine('}');
+  }
+
+  visitInvalidExpression(InvalidExpression node) {
+    writeWord('invalid-expression');
+  }
+
+  visitMethodInvocation(MethodInvocation node) {
+    writeExpression(node.receiver, Precedence.PRIMARY);
+    writeSymbol('.');
+    writeInterfaceTarget(node.name, node.interfaceTarget);
+    writeNode(node.arguments);
+  }
+
+  visitDirectMethodInvocation(DirectMethodInvocation node) {
+    writeExpression(node.receiver, Precedence.PRIMARY);
+    writeSymbol('.{=');
+    writeMemberReference(node.target);
+    writeSymbol('}');
+    writeNode(node.arguments);
+  }
+
+  visitSuperMethodInvocation(SuperMethodInvocation node) {
+    writeWord('super');
+    writeSymbol('.');
+    writeInterfaceTarget(node.name, node.interfaceTarget);
+    writeNode(node.arguments);
+  }
+
+  visitStaticInvocation(StaticInvocation node) {
+    writeModifier(node.isConst, 'const');
+    writeMemberReference(node.target);
+    writeNode(node.arguments);
+  }
+
+  visitConstructorInvocation(ConstructorInvocation node) {
+    writeWord(node.isConst ? 'const' : 'new');
+    writeMemberReference(node.target);
+    writeNode(node.arguments);
+  }
+
+  visitNot(Not node) {
+    writeSymbol('!');
+    writeExpression(node.operand, Precedence.PREFIX);
+  }
+
+  visitLogicalExpression(LogicalExpression node) {
+    int precedence = Precedence.binaryPrecedence[node.operator];
+    writeExpression(node.left, precedence);
+    writeSpaced(node.operator);
+    writeExpression(node.right, precedence + 1);
+  }
+
+  visitConditionalExpression(ConditionalExpression node) {
+    writeExpression(node.condition, Precedence.LOGICAL_OR);
+    writeSpaced('?');
+    writeExpression(node.then);
+    writeSpaced(':');
+    writeExpression(node.otherwise);
+  }
+
+  String getEscapedCharacter(int codeUnit) {
+    switch (codeUnit) {
+      case 9:
+        return r'\t';
+      case 10:
+        return r'\n';
+      case 11:
+        return r'\v';
+      case 12:
+        return r'\f';
+      case 13:
+        return r'\r';
+      case 34:
+        return r'\"';
+      case 36:
+        return r'\$';
+      case 92:
+        return r'\\';
+      default:
+        if (codeUnit < 32 || codeUnit > 126) {
+          return r'\u' + '$codeUnit'.padLeft(4, '0');
+        } else {
+          return null;
+        }
+    }
+  }
+
+  String escapeString(String string) {
+    StringBuffer buffer;
+    for (int i = 0; i < string.length; ++i) {
+      String character = getEscapedCharacter(string.codeUnitAt(i));
+      if (character != null) {
+        buffer ??= new StringBuffer(string.substring(0, i));
+        buffer.write(character);
+      } else {
+        buffer?.write(string[i]);
+      }
+    }
+    return buffer == null ? string : buffer.toString();
+  }
+
+  visitStringConcatenation(StringConcatenation node) {
+    if (state == WORD) {
+      writeSpace();
+    }
+    write('"');
+    for (var part in node.expressions) {
+      if (part is StringLiteral) {
+        writeSymbol(escapeString(part.value));
+      } else {
+        writeSymbol(r'${');
+        writeExpression(part);
+        writeSymbol('}');
+      }
+    }
+    write('"');
+    state = WORD;
+  }
+
+  visitIsExpression(IsExpression node) {
+    writeExpression(node.operand, Precedence.BITWISE_OR);
+    writeSpaced('is');
+    writeType(node.type);
+  }
+
+  visitAsExpression(AsExpression node) {
+    writeExpression(node.operand, Precedence.BITWISE_OR);
+    writeSpaced('as');
+    writeType(node.type);
+  }
+
+  visitSymbolLiteral(SymbolLiteral node) {
+    writeSymbol('#');
+    writeWord(node.value);
+  }
+
+  visitTypeLiteral(TypeLiteral node) {
+    writeType(node.type);
+  }
+
+  visitThisExpression(ThisExpression node) {
+    writeWord('this');
+  }
+
+  visitRethrow(Rethrow node) {
+    writeWord('rethrow');
+  }
+
+  visitThrow(Throw node) {
+    writeWord('throw');
+    writeSpace();
+    writeExpression(node.expression);
+  }
+
+  visitListLiteral(ListLiteral node) {
+    if (node.isConst) {
+      writeWord('const');
+      writeSpace();
+    }
+    if (node.typeArgument != null) {
+      writeSymbol('<');
+      writeType(node.typeArgument);
+      writeSymbol('>');
+    }
+    writeSymbol('[');
+    writeList(node.expressions, writeNode);
+    writeSymbol(']');
+  }
+
+  visitMapLiteral(MapLiteral node) {
+    if (node.isConst) {
+      writeWord('const');
+      writeSpace();
+    }
+    if (node.keyType != null) {
+      writeSymbol('<');
+      writeList([node.keyType, node.valueType], writeType);
+      writeSymbol('>');
+    }
+    writeSymbol('{');
+    writeList(node.entries, writeNode);
+    writeSymbol('}');
+  }
+
+  visitMapEntry(MapEntry node) {
+    writeExpression(node.key);
+    writeComma(':');
+    writeExpression(node.value);
+  }
+
+  visitAwaitExpression(AwaitExpression node) {
+    writeWord('await');
+    writeExpression(node.operand);
+  }
+
+  visitFunctionExpression(FunctionExpression node) {
+    writeFunction(node.function, terminateLine: false);
+  }
+
+  visitStringLiteral(StringLiteral node) {
+    writeWord('"${escapeString(node.value)}"');
+  }
+
+  visitIntLiteral(IntLiteral node) {
+    writeWord('${node.value}');
+  }
+
+  visitDoubleLiteral(DoubleLiteral node) {
+    writeWord('${node.value}');
+  }
+
+  visitBoolLiteral(BoolLiteral node) {
+    writeWord('${node.value}');
+  }
+
+  visitNullLiteral(NullLiteral node) {
+    writeWord('null');
+  }
+
+  visitLet(Let node) {
+    writeWord('let');
+    writeVariableDeclaration(node.variable);
+    writeSpaced('in');
+    writeExpression(node.body);
+  }
+
+  defaultExpression(Expression node) {
+    writeWord('${node.runtimeType}');
+  }
+
+  visitVariableGet(VariableGet node) {
+    writeVariableReference(node.variable);
+  }
+
+  visitVariableSet(VariableSet node) {
+    writeVariableReference(node.variable);
+    writeSpaced('=');
+    writeExpression(node.value);
+  }
+
+  void writeInterfaceTarget(Name name, Member target) {
+    if (target != null) {
+      writeSymbol('{');
+      writeMemberReference(target);
+      writeSymbol('}');
+    } else {
+      writeName(name);
+    }
+  }
+
+  visitPropertyGet(PropertyGet node) {
+    writeExpression(node.receiver, Precedence.PRIMARY);
+    writeSymbol('.');
+    writeInterfaceTarget(node.name, node.interfaceTarget);
+  }
+
+  visitPropertySet(PropertySet node) {
+    writeExpression(node.receiver, Precedence.PRIMARY);
+    writeSymbol('.');
+    writeInterfaceTarget(node.name, node.interfaceTarget);
+    writeSpaced('=');
+    writeExpression(node.value);
+  }
+
+  visitSuperPropertyGet(SuperPropertyGet node) {
+    writeWord('super');
+    writeSymbol('.');
+    writeInterfaceTarget(node.name, node.interfaceTarget);
+  }
+
+  visitSuperPropertySet(SuperPropertySet node) {
+    writeWord('super');
+    writeSymbol('.');
+    writeInterfaceTarget(node.name, node.interfaceTarget);
+    writeSpaced('=');
+    writeExpression(node.value);
+  }
+
+  visitDirectPropertyGet(DirectPropertyGet node) {
+    writeExpression(node.receiver, Precedence.PRIMARY);
+    writeSymbol('.{=');
+    writeMemberReference(node.target);
+    writeSymbol('}');
+  }
+
+  visitDirectPropertySet(DirectPropertySet node) {
+    writeExpression(node.receiver, Precedence.PRIMARY);
+    writeSymbol('.{=');
+    writeMemberReference(node.target);
+    writeSymbol('}');
+    writeSpaced('=');
+    writeExpression(node.value);
+  }
+
+  visitStaticGet(StaticGet node) {
+    writeMemberReference(node.target);
+  }
+
+  visitStaticSet(StaticSet node) {
+    writeMemberReference(node.target);
+    writeSpaced('=');
+    writeExpression(node.value);
+  }
+
+  visitInvalidStatement(InvalidStatement node) {
+    writeIndentation();
+    endLine('invalid-statement;');
+  }
+
+  visitExpressionStatement(ExpressionStatement node) {
+    writeIndentation();
+    writeExpression(node.expression);
+    endLine(';');
+  }
+
+  visitBlock(Block node) {
+    writeIndentation();
+    if (node.statements.isEmpty) {
+      endLine('{}');
+      return null;
+    }
+    endLine('{');
+    ++indentation;
+    node.statements.forEach(writeNode);
+    --indentation;
+    writeIndentation();
+    endLine('}');
+  }
+
+  visitEmptyStatement(EmptyStatement node) {
+    writeIndentation();
+    endLine(';');
+  }
+
+  visitAssertStatement(AssertStatement node) {
+    writeIndentation();
+    writeWord('assert');
+    writeSymbol('(');
+    writeExpression(node.condition);
+    if (node.message != null) {
+      writeComma();
+      writeExpression(node.message);
+    }
+    endLine(');');
+  }
+
+  visitLabeledStatement(LabeledStatement node) {
+    writeIndentation();
+    writeWord(syntheticNames.nameLabeledStatement(node));
+    endLine(':');
+    writeNode(node.body);
+  }
+
+  visitBreakStatement(BreakStatement node) {
+    writeIndentation();
+    writeWord('break');
+    writeWord(syntheticNames.nameLabeledStatement(node.target));
+    endLine(';');
+  }
+
+  visitWhileStatement(WhileStatement node) {
+    writeIndentation();
+    writeSpaced('while');
+    writeSymbol('(');
+    writeExpression(node.condition);
+    writeSymbol(')');
+    writeBody(node.body);
+  }
+
+  visitDoStatement(DoStatement node) {
+    writeIndentation();
+    writeWord('do');
+    writeBody(node.body);
+    writeIndentation();
+    writeSpaced('while');
+    writeSymbol('(');
+    writeExpression(node.condition);
+    endLine(')');
+  }
+
+  visitForStatement(ForStatement node) {
+    writeIndentation();
+    writeSpaced('for');
+    writeSymbol('(');
+    writeList(node.variables, writeVariableDeclaration);
+    writeComma(';');
+    if (node.condition != null) {
+      writeExpression(node.condition);
+    }
+    writeComma(';');
+    writeList(node.updates, writeExpression);
+    writeSymbol(')');
+    writeBody(node.body);
+  }
+
+  visitForInStatement(ForInStatement node) {
+    writeIndentation();
+    writeSpaced('for');
+    writeSymbol('(');
+    writeVariableDeclaration(node.variable, useVarKeyword: true);
+    writeSpaced('in');
+    writeExpression(node.iterable);
+    writeSymbol(')');
+    writeBody(node.body);
+  }
+
+  visitSwitchStatement(SwitchStatement node) {
+    writeIndentation();
+    writeWord('switch');
+    writeSymbol('(');
+    writeExpression(node.expression);
+    endLine(') {');
+    ++indentation;
+    node.cases.forEach(writeNode);
+    --indentation;
+    writeIndentation();
+    endLine('}');
+  }
+
+  visitSwitchCase(SwitchCase node) {
+    String label = syntheticNames.nameSwitchCase(node);
+    writeIndentation();
+    writeWord(label);
+    endLine(':');
+    for (var expression in node.expressions) {
+      writeIndentation();
+      writeWord('case');
+      writeExpression(expression);
+      endLine(':');
+    }
+    if (node.isDefault) {
+      writeIndentation();
+      writeWord('default');
+      endLine(':');
+    }
+    ++indentation;
+    writeNode(node.body);
+    --indentation;
+  }
+
+  visitContinueSwitchStatement(ContinueSwitchStatement node) {
+    writeIndentation();
+    writeWord('continue');
+    writeWord(syntheticNames.nameSwitchCase(node.target));
+    endLine(';');
+  }
+
+  visitIfStatement(IfStatement node) {
+    writeIndentation();
+    writeWord('if');
+    writeSymbol('(');
+    writeExpression(node.condition);
+    writeSymbol(')');
+    writeBody(node.then);
+    if (node.otherwise != null) {
+      writeIndentation();
+      writeWord('else');
+      writeBody(node.otherwise);
+    }
+  }
+
+  visitReturnStatement(ReturnStatement node) {
+    writeIndentation();
+    writeWord('return');
+    if (node.expression != null) {
+      writeSpace();
+      writeExpression(node.expression);
+    }
+    endLine(';');
+  }
+
+  visitTryCatch(TryCatch node) {
+    writeIndentation();
+    writeWord('try');
+    writeBody(node.body);
+    node.catches.forEach(writeNode);
+  }
+
+  visitCatch(Catch node) {
+    writeIndentation();
+    if (node.guard != null) {
+      writeWord('on');
+      writeType(node.guard);
+      writeSpace();
+    }
+    writeWord('catch');
+    writeSymbol('(');
+    if (node.exception != null) {
+      writeVariableDeclaration(node.exception);
+    } else {
+      writeWord('no-exception-var');
+    }
+    if (node.stackTrace != null) {
+      writeComma();
+      writeVariableDeclaration(node.stackTrace);
+    }
+    writeSymbol(')');
+    writeBody(node.body);
+  }
+
+  visitTryFinally(TryFinally node) {
+    writeIndentation();
+    writeWord('try');
+    writeBody(node.body);
+    writeIndentation();
+    writeWord('finally');
+    writeBody(node.finalizer);
+  }
+
+  visitYieldStatement(YieldStatement node) {
+    writeIndentation();
+    if (node.isYieldStar) {
+      writeWord('yield*');
+    } else if (node.isNative) {
+      writeWord('[yield]');
+    } else {
+      writeWord('yield');
+    }
+    writeExpression(node.expression);
+    endLine(';');
+  }
+
+  visitVariableDeclaration(VariableDeclaration node) {
+    writeIndentation();
+    writeVariableDeclaration(node, useVarKeyword: true);
+    endLine(';');
+  }
+
+  visitFunctionDeclaration(FunctionDeclaration node) {
+    writeIndentation();
+    writeWord('function');
+    writeFunction(node.function, name: getVariableName(node.variable));
+  }
+
+  void writeVariableDeclaration(VariableDeclaration node,
+      {bool useVarKeyword: false}) {
+    writeModifier(node.isFinal, 'final');
+    writeModifier(node.isConst, 'const');
+    if (node.type != null) {
+      writeAnnotatedType(node.type, annotator?.annotateVariable(this, node));
+    }
+    if (useVarKeyword && !node.isFinal && !node.isConst && node.type == null) {
+      writeWord('var');
+    }
+    writeWord(getVariableName(node));
+    if (node.initializer != null) {
+      writeSpaced('=');
+      writeExpression(node.initializer);
+    }
+  }
+
+  visitArguments(Arguments node) {
+    if (node.types.isNotEmpty) {
+      writeSymbol('<');
+      writeList(node.types, writeType);
+      writeSymbol('>');
+    }
+    writeSymbol('(');
+    var allArgs =
+        <List<TreeNode>>[node.positional, node.named].expand((x) => x);
+    writeList(allArgs, writeNode);
+    writeSymbol(')');
+  }
+
+  visitNamedExpression(NamedExpression node) {
+    writeWord(node.name);
+    writeComma(':');
+    writeExpression(node.value);
+  }
+
+  defaultStatement(Statement node) {
+    writeIndentation();
+    endLine('${node.runtimeType}');
+  }
+
+  visitInvalidInitializer(InvalidInitializer node) {
+    writeWord('invalid-initializer');
+  }
+
+  visitFieldInitializer(FieldInitializer node) {
+    writeMemberReference(node.field);
+    writeSpaced('=');
+    writeExpression(node.value);
+  }
+
+  visitSuperInitializer(SuperInitializer node) {
+    writeWord('super');
+    writeMemberReference(node.target);
+    writeNode(node.arguments);
+  }
+
+  visitRedirectingInitializer(RedirectingInitializer node) {
+    writeWord('this');
+    writeMemberReference(node.target);
+    writeNode(node.arguments);
+  }
+
+  visitLocalInitializer(LocalInitializer node) {
+    writeVariableDeclaration(node.variable);
+  }
+
+  defaultInitializer(Initializer node) {
+    writeIndentation();
+    endLine(': ${node.runtimeType}');
+  }
+
+  visitInvalidType(InvalidType node) {
+    writeWord('invalid-type');
+  }
+
+  visitDynamicType(DynamicType node) {
+    writeWord('dynamic');
+  }
+
+  visitVoidType(VoidType node) {
+    writeWord('void');
+  }
+
+  visitInterfaceType(InterfaceType node) {
+    writeClassReference(node.classNode);
+    if (node.typeArguments.isNotEmpty) {
+      writeSymbol('<');
+      writeList(node.typeArguments, writeType);
+      writeSymbol('>');
+      state = WORD; // Disallow a word immediately after the '>'.
+    }
+  }
+
+  visitFunctionType(FunctionType node) {
+    writeTypeParameterList(node.typeParameters);
+    writeSymbol('(');
+    var positional = node.positionalParameters;
+    writeList(positional.take(node.requiredParameterCount), writeType);
+    if (node.requiredParameterCount < positional.length) {
+      if (node.requiredParameterCount > 0) {
+        writeComma();
+      }
+      writeSymbol('[');
+      writeList(positional.skip(node.requiredParameterCount), writeType);
+      writeSymbol(']');
+    }
+    if (node.namedParameters.isNotEmpty) {
+      if (node.positionalParameters.isNotEmpty) {
+        writeComma();
+      }
+      writeSymbol('{');
+      writeList(node.namedParameters, visitNamedType);
+      writeSymbol('}');
+    }
+    writeSymbol(')');
+    writeSpaced('→');
+    writeType(node.returnType);
+  }
+
+  visitNamedType(NamedType node) {
+    writeWord(node.name);
+    writeSymbol(':');
+    writeSpace();
+    writeType(node.type);
+  }
+
+  visitTypeParameterType(TypeParameterType node) {
+    writeTypeParameterReference(node.parameter);
+  }
+
+  visitTypeParameter(TypeParameter node) {
+    writeWord(getTypeParameterName(node));
+    writeSpaced('extends');
+    writeType(node.bound);
+  }
+
+  defaultNode(Node node) {
+    write('<${node.runtimeType}>');
+  }
+}
+
+class Precedence extends ExpressionVisitor<int> {
+  static final Precedence instance = new Precedence();
+
+  static int of(Expression node) => node.accept(instance);
+
+  static const int EXPRESSION = 1;
+  static const int CONDITIONAL = 2;
+  static const int LOGICAL_NULL_AWARE = 3;
+  static const int LOGICAL_OR = 4;
+  static const int LOGICAL_AND = 5;
+  static const int EQUALITY = 6;
+  static const int RELATIONAL = 7;
+  static const int BITWISE_OR = 8;
+  static const int BITWISE_XOR = 9;
+  static const int BITWISE_AND = 10;
+  static const int SHIFT = 11;
+  static const int ADDITIVE = 12;
+  static const int MULTIPLICATIVE = 13;
+  static const int PREFIX = 14;
+  static const int POSTFIX = 15;
+  static const int TYPE_LITERAL = 19;
+  static const int PRIMARY = 20;
+  static const int CALLEE = 21;
+
+  static const Map<String, int> binaryPrecedence = const {
+    '&&': LOGICAL_AND,
+    '||': LOGICAL_OR,
+    '??': LOGICAL_NULL_AWARE,
+    '==': EQUALITY,
+    '!=': EQUALITY,
+    '>': RELATIONAL,
+    '>=': RELATIONAL,
+    '<': RELATIONAL,
+    '<=': RELATIONAL,
+    '|': BITWISE_OR,
+    '^': BITWISE_XOR,
+    '&': BITWISE_AND,
+    '>>': SHIFT,
+    '<<': SHIFT,
+    '+': ADDITIVE,
+    '-': ADDITIVE,
+    '*': MULTIPLICATIVE,
+    '%': MULTIPLICATIVE,
+    '/': MULTIPLICATIVE,
+    '~/': MULTIPLICATIVE,
+    null: EXPRESSION,
+  };
+
+  static bool isAssociativeBinaryOperator(int precedence) {
+    return precedence != EQUALITY && precedence != RELATIONAL;
+  }
+
+  int defaultExpression(Expression node) => EXPRESSION;
+  int visitInvalidExpression(InvalidExpression node) => CALLEE;
+  int visitMethodInvocation(MethodInvocation node) => CALLEE;
+  int visitSuperMethodInvocation(SuperMethodInvocation node) => CALLEE;
+  int visitDirectMethodInvocation(DirectMethodInvocation node) => CALLEE;
+  int visitStaticInvocation(StaticInvocation node) => CALLEE;
+  int visitConstructorInvocation(ConstructorInvocation node) => CALLEE;
+  int visitNot(Not node) => PREFIX;
+  int visitLogicalExpression(LogicalExpression node) =>
+      binaryPrecedence[node.operator];
+  int visitConditionalExpression(ConditionalExpression node) => CONDITIONAL;
+  int visitStringConcatenation(StringConcatenation node) => PRIMARY;
+  int visitIsExpression(IsExpression node) => RELATIONAL;
+  int visitAsExpression(AsExpression node) => RELATIONAL;
+  int visitSymbolLiteral(SymbolLiteral node) => PRIMARY;
+  int visitTypeLiteral(TypeLiteral node) => PRIMARY;
+  int visitThisExpression(ThisExpression node) => CALLEE;
+  int visitRethrow(Rethrow node) => PRIMARY;
+  int visitThrow(Throw node) => EXPRESSION;
+  int visitListLiteral(ListLiteral node) => PRIMARY;
+  int visitMapLiteral(MapLiteral node) => PRIMARY;
+  int visitAwaitExpression(AwaitExpression node) => PREFIX;
+  int visitFunctionExpression(FunctionExpression node) => PRIMARY;
+  int visitStringLiteral(StringLiteral node) => CALLEE;
+  int visitIntLiteral(IntLiteral node) => CALLEE;
+  int visitDoubleLiteral(DoubleLiteral node) => CALLEE;
+  int visitBoolLiteral(BoolLiteral node) => CALLEE;
+  int visitNullLiteral(NullLiteral node) => CALLEE;
+  int visitVariableGet(VariableGet node) => PRIMARY;
+  int visitVariableSet(VariableSet node) => EXPRESSION;
+  int visitPropertyGet(PropertyGet node) => PRIMARY;
+  int visitPropertySet(PropertySet node) => EXPRESSION;
+  int visitSuperPropertyGet(SuperPropertyGet node) => PRIMARY;
+  int visitSuperPropertySet(SuperPropertySet node) => EXPRESSION;
+  int visitDirectPropertyGet(DirectPropertyGet node) => PRIMARY;
+  int visitDirectPropertySet(DirectPropertySet node) => EXPRESSION;
+  int visitStaticGet(StaticGet node) => PRIMARY;
+  int visitStaticSet(StaticSet node) => EXPRESSION;
+  int visitLet(Let node) => EXPRESSION;
+}
+
+String procedureKindToString(ProcedureKind kind) {
+  switch (kind) {
+    case ProcedureKind.Method:
+      return 'method';
+    case ProcedureKind.Getter:
+      return 'get';
+    case ProcedureKind.Setter:
+      return 'set';
+    case ProcedureKind.Operator:
+      return 'operator';
+    case ProcedureKind.Factory:
+      return 'factory';
+  }
+  throw 'illegal ProcedureKind: $kind';
+}
+
+class ExpressionPrinter {
+  final Printer writeer;
+  final int minimumPrecedence;
+
+  ExpressionPrinter(this.writeer, this.minimumPrecedence);
+}
diff --git a/pkg/kernel/lib/text/readme.md b/pkg/kernel/lib/text/readme.md
new file mode 100644
index 0000000..0d3f224
--- /dev/null
+++ b/pkg/kernel/lib/text/readme.md
@@ -0,0 +1,4 @@
+Conversion to a textual format.
+
+The text format is currently very ad-hoc and there is no conversion back, but
+it's a pleasant way to view the IR.
diff --git a/pkg/kernel/lib/transformations/async.dart b/pkg/kernel/lib/transformations/async.dart
new file mode 100644
index 0000000..fb3483d
--- /dev/null
+++ b/pkg/kernel/lib/transformations/async.dart
@@ -0,0 +1,489 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.transformations.async;
+
+import '../kernel.dart';
+import 'continuation.dart';
+
+/// A transformer that introduces temporary variables for all subexpressions
+/// that are alive across yield points (AwaitExpression).
+///
+/// The transformer is invoked by passing [rewrite] a top-level expression.
+///
+/// All intermediate values that are possible live across an await are named in
+/// local variables.
+///
+/// Await expressions are translated into a call to a helper function and a
+/// native yield.
+class ExpressionLifter extends Transformer {
+  final AsyncRewriterBase continuationRewriter;
+
+  /// Have we seen an await to the right in the expression tree.
+  ///
+  /// Subexpressions are visited right-to-left in the reverse of evaluation
+  /// order.
+  ///
+  /// On entry to an expression's visit method, [seenAwait] indicates whether a
+  /// sibling to the right contains an await.  If so the expression will be
+  /// named in a temporary variable because it is potentially live across an
+  /// await.
+  ///
+  /// On exit from an expression's visit method, [seenAwait] indicates whether
+  /// the expression itself or a sibling to the right contains an await.
+  bool seenAwait = false;
+
+  /// The (reverse order) sequence of statements that have been emitted.
+  ///
+  /// Transformation of an expression produces a transformed expression and a
+  /// sequence of statements which are assignments to local variables, calls to
+  /// helper functions, and yield points.  Only the yield points need to be a
+  /// statements, and they are statements so an implementation does not have to
+  /// handle unnamed expression intermediate live across yield points.
+  ///
+  /// The visit methods return the transformed expression and build a sequence
+  /// of statements by emitting statements into this list.  This list is built
+  /// in reverse because children are visited right-to-left.
+  ///
+  /// If an expression should be named it is named before visiting its children
+  /// so the naming assignment appears in the list before all statements
+  /// implementating the translation of the children.
+  ///
+  /// Children that are conditionally evaluated, such as some parts of logical
+  /// and conditional expressions, must be delimited so that they do not emit
+  /// unguarded statements into [statements].  This is implemented by setting
+  /// [statements] to a fresh empty list before transforming those children.
+  List<Statement> statements = <Statement>[];
+
+
+  /// The number of currently live named intermediate values.
+  ///
+  /// This index is used to allocate names to temporary values.  Because
+  /// children are visited right-to-left, names are assigned in reverse order of
+  /// index.
+  ///
+  /// When an assignment is emitted into [statements] to name an expression
+  /// before visiting its children, the index is not immediately reserved
+  /// because a child can freely use the same name as its parent.  In practice,
+  /// this will be the rightmost named child.
+  ///
+  /// After visiting the children of a named expression, [nameIndex] is set to
+  /// indicate one more live value (the value of the expression) than before
+  /// visiting the expression.
+  ///
+  /// After visiting the children of an expression that is not named,
+  /// [nameIndex] may still account for names of subexpressions.
+  int nameIndex = 0;
+
+  final VariableDeclaration asyncResult =
+      new VariableDeclaration(':result');
+  final List<VariableDeclaration> variables = <VariableDeclaration>[];
+
+  ExpressionLifter(this.continuationRewriter);
+
+  Block blockOf(List<Statement> stmts) => new Block(stmts.reversed.toList());
+
+  /// Rewrite a toplevel expression (toplevel wrt. a statement).
+  ///
+  /// Rewriting an expression produces a sequence of statements and an
+  /// expression.  The sequence of statements are added to the given list.  Pass
+  /// an empty list if the rewritten expression should be delimited from the
+  /// surrounding context.
+  Expression rewrite(Expression expression, List<Statement> outer) {
+    assert(statements.isEmpty);
+    assert(nameIndex == 0);
+    seenAwait = false;
+    Expression result = expression.accept(this);
+    outer.addAll(statements.reversed);
+    statements.clear();
+    nameIndex = 0;
+    return result;
+  }
+
+  // Perform an action with a given list of statements so that it cannot emit
+  // statements into the 'outer' list.
+  Expression delimit(Expression action(), List<Statement> inner) {
+    var index = nameIndex;
+    var outer = statements;
+    statements = inner;
+    Expression result = action();
+    nameIndex = index;
+    statements = outer;
+    return result;
+  }
+
+  // Name an expression by emitting an assignment to a temporary variable.
+  VariableGet name(Expression expr) {
+    VariableDeclaration temp = allocateTemporary(nameIndex);
+    statements.add(new ExpressionStatement(new VariableSet(temp, expr)));
+    return new VariableGet(temp);
+  }
+
+  VariableDeclaration allocateTemporary(int index) {
+    for (var i = variables.length; i <= index; i++) {
+      variables.add(new VariableDeclaration(":async_temporary_${i}"));
+    }
+    return variables[index];
+  }
+
+  // Simple literals.  These are pure expressions so they can be evaluated after
+  // an await to their right.
+  TreeNode visitSymbolLiteral(SymbolLiteral expr) => expr;
+  TreeNode visitTypeLiteral(TypeLiteral expr) => expr;
+  TreeNode visitThisExpression(ThisExpression expr) => expr;
+  TreeNode visitStringLiteral(StringLiteral expr) => expr;
+  TreeNode visitIntLiteral(IntLiteral expr) => expr;
+  TreeNode visitDoubleLiteral(DoubleLiteral expr) => expr;
+  TreeNode visitBoolLiteral(BoolLiteral expr) => expr;
+  TreeNode visitNullLiteral(NullLiteral expr) => expr;
+
+  // Nullary expressions with effects.
+  Expression nullary(Expression expr) {
+    if (seenAwait) {
+      expr = name(expr);
+      ++nameIndex;
+    }
+    return expr;
+  }
+
+  TreeNode visitInvalidExpression(InvalidExpression expr) => nullary(expr);
+  TreeNode visitSuperPropertyGet(SuperPropertyGet expr) => nullary(expr);
+  TreeNode visitStaticGet(StaticGet expr) => nullary(expr);
+  TreeNode visitRethrow(Rethrow expr) => nullary(expr);
+
+  // Getting a final or const variable is not an effect so it can be evaluated
+  // after an await to its right.
+  TreeNode visitVariableGet(VariableGet expr) {
+    if (seenAwait && !expr.variable.isFinal && !expr.variable.isConst) {
+      expr = name(expr);
+      ++nameIndex;
+    }
+    return expr;
+  }
+
+  // Transform an expression given an action to transform the children.  For
+  // this purposes of the await transformer the children should generally be
+  // translated from right to left, in the reverse of evaluation order.
+  Expression transform(Expression expr, void action()) {
+    var shouldName = seenAwait;
+
+    // 1. If there is an await in a sibling to the right, emit an assignment to
+    // a temporary variable before transforming the children.
+    var result = shouldName ? name(expr) : expr;
+
+    // 2. Remember the number of live temporaries before transforming the
+    // children.
+    var index = nameIndex;
+
+
+    // 3. Transform the children.  Initially they do not have an await in a
+    // sibling to their right.
+    seenAwait = false;
+    action();
+
+
+    // 4. If the expression was named then the variables used for children are
+    // no longer live but the variable used for the expression is.
+    if (shouldName) {
+      nameIndex = index + 1;
+      seenAwait = true;
+    }
+    return result;
+  }
+
+  // Unary expressions.
+  Expression unary(Expression expr) {
+    return transform(expr, () { expr.transformChildren(this); });
+  }
+
+  TreeNode visitVariableSet(VariableSet expr) => unary(expr);
+  TreeNode visitPropertyGet(PropertyGet expr) => unary(expr);
+  TreeNode visitDirectPropertyGet(DirectPropertyGet expr) => unary(expr);
+  TreeNode visitSuperPropertySet(SuperPropertySet expr) => unary(expr);
+  TreeNode visitStaticSet(StaticSet expr) => unary(expr);
+  TreeNode visitNot(Not expr) => unary(expr);
+  TreeNode visitIsExpression(IsExpression expr) => unary(expr);
+  TreeNode visitAsExpression(AsExpression expr) => unary(expr);
+  TreeNode visitThrow(Throw expr) => unary(expr);
+
+  TreeNode visitPropertySet(PropertySet expr) {
+    return transform(expr, () {
+      expr.value = expr.value.accept(this)..parent = expr;
+      expr.receiver = expr.receiver.accept(this)..parent = expr;
+    });
+  }
+
+  TreeNode visitDirectPropertySet(DirectPropertySet expr) {
+    return transform(expr, () {
+      expr.value = expr.value.accept(this)..parent = expr;
+      expr.receiver = expr.receiver.accept(this)..parent = expr;
+    });
+  }
+
+  TreeNode visitArguments(Arguments args) {
+    for (var named in args.named.reversed) {
+      named.value = named.value.accept(this)..parent = named;
+    }
+    var positional = args.positional;
+    for (var i = positional.length - 1; i >= 0; --i) {
+      positional[i] = positional[i].accept(this)..parent = args;
+    }
+    // Returns the arguments, which is assumed at the call sites because they do
+    // not replace the arguments or set parent pointers.
+    return args;
+  }
+
+  TreeNode visitMethodInvocation(MethodInvocation expr) {
+    return transform(expr, () {
+      visitArguments(expr.arguments);
+      expr.receiver = expr.receiver.accept(this)..parent = expr;
+    });
+  }
+
+  TreeNode visitDirectMethodInvocation(DirectMethodInvocation expr) {
+    return transform(expr, () {
+      visitArguments(expr.arguments);
+      expr.receiver = expr.receiver.accept(this)..parent = expr;
+    });
+  }
+
+  TreeNode visitSuperMethodInvocation(SuperMethodInvocation expr) {
+    return transform(expr, () { visitArguments(expr.arguments); });
+  }
+
+  TreeNode visitStaticInvocation(StaticInvocation expr) {
+    return transform(expr, () { visitArguments(expr.arguments); });
+  }
+
+  TreeNode visitConstructorInvocation(ConstructorInvocation expr) {
+    return transform(expr, () { visitArguments(expr.arguments); });
+  }
+
+  TreeNode visitStringConcatenation(StringConcatenation expr) {
+    return transform(expr, () {
+      var expressions = expr.expressions;
+      for (var i = expressions.length - 1; i >= 0; --i) {
+        expressions[i] = expressions[i].accept(this)..parent = expr;
+      }
+    });
+  }
+
+  TreeNode visitListLiteral(ListLiteral expr) {
+    return transform(expr, () {
+      var expressions = expr.expressions;
+      for (var i = expressions.length - 1; i >= 0; --i) {
+        expressions[i] = expr.expressions[i].accept(this)..parent = expr;
+      }
+    });
+  }
+
+  TreeNode visitMapLiteral(MapLiteral expr) {
+    return transform(expr, () {
+      for (var entry in expr.entries.reversed) {
+        entry.value = entry.value.accept(this)..parent = entry;
+        entry.key = entry.key.accept(this)..parent = entry;
+      }
+    });
+  }
+
+  // Control flow.
+  TreeNode visitLogicalExpression(LogicalExpression expr) {
+    var shouldName = seenAwait;
+
+    // Right is delimited because it is conditionally evaluated.
+    var rightStatements = <Statement>[];
+    seenAwait = false;
+    expr.right = delimit(() => expr.right.accept(this), rightStatements)
+        ..parent = expr;
+    var rightAwait = seenAwait;
+
+    if (rightStatements.isEmpty) {
+      // Easy case: right did not emit any statements.
+      seenAwait = shouldName;
+      return transform(expr, () {
+        expr.left = expr.left.accept(this)..parent = expr;
+        seenAwait = seenAwait || rightAwait;
+      });
+    }
+
+    // If right has emitted statements we will produce a temporary t and emit
+    // for && (there is an analogous case for ||):
+    //
+    // t = [left] == true;
+    // if (t) {
+    //   t = [right] == true;
+    // }
+
+    // Recall that statements are emitted in reverse order, so first emit the if
+    // statement, then the assignment of [left] == true, and then translate left
+    // so any statements it emits occur after in the accumulated list (that is,
+    // so they occur before in the corresponding block).
+    var rightBody = blockOf(rightStatements);
+    var result = allocateTemporary(nameIndex);
+    rightBody.addStatement(new ExpressionStatement(
+        new VariableSet(
+            result,
+            new MethodInvocation(
+                expr.right,
+                new Name('=='),
+                new Arguments(<Expression>[new BoolLiteral(true)])))));
+    var then, otherwise;
+    if (expr.operator == '&&') {
+      then = rightBody;
+      otherwise = null;
+    } else {
+      then = new EmptyStatement();
+      otherwise = rightBody;
+    }
+    statements.add(new IfStatement(new VariableGet(result), then, otherwise));
+
+    var test =
+        new MethodInvocation(
+            expr.left,
+            new Name('=='),
+            new Arguments(<Expression>[new BoolLiteral(true)]));
+    statements.add(
+        new ExpressionStatement(new VariableSet(result, test)));
+
+    seenAwait = false;
+    test.receiver = test.receiver.accept(this)..parent = test;
+
+    ++nameIndex;
+    seenAwait = seenAwait || rightAwait;
+    return new VariableGet(result);
+  }
+
+  TreeNode visitConditionalExpression(ConditionalExpression expr) {
+    // Then and otherwise are delimited because they are conditionally
+    // evaluated.
+    var shouldName = seenAwait;
+
+    var thenStatements = <Statement>[];
+    seenAwait = false;
+    expr.then = delimit(() => expr.then.accept(this), thenStatements)
+        ..parent = expr;
+    var thenAwait = seenAwait;
+
+    var otherwiseStatements = <Statement>[];
+    seenAwait = false;
+    expr.otherwise = delimit(() => expr.otherwise.accept(this),
+        otherwiseStatements)..parent = expr;
+    var otherwiseAwait = seenAwait;
+
+    if (thenStatements.isEmpty && otherwiseStatements.isEmpty) {
+      // Easy case: neither then nor otherwise emitted any statements.
+      seenAwait = shouldName;
+      return transform(expr, () {
+        expr.condition = expr.condition.accept(this)..parent = expr;
+        seenAwait = seenAwait || thenAwait || otherwiseAwait;
+      });
+    }
+
+    // If then or otherwise has emitted statements we will produce a temporary t
+    // and emit:
+    //
+    // if ([condition]) {
+    //   t = [left];
+    // } else {
+    //   t = [right];
+    // }
+    var result = allocateTemporary(nameIndex);
+    var thenBody = blockOf(thenStatements);
+    var otherwiseBody = blockOf(otherwiseStatements);
+    thenBody.addStatement(
+        new ExpressionStatement(new VariableSet(result, expr.then)));
+    otherwiseBody.addStatement(
+        new ExpressionStatement(new VariableSet(result, expr.otherwise)));
+    var branch = new IfStatement(expr.condition, thenBody, otherwiseBody);
+    statements.add(branch);
+
+    seenAwait = false;
+    branch.condition = branch.condition.accept(this)..parent = branch;
+
+    ++nameIndex;
+    seenAwait = seenAwait || thenAwait || otherwiseAwait;
+    return new VariableGet(result);
+  }
+
+  // Others.
+  TreeNode visitAwaitExpression(AwaitExpression expr) {
+    final R = continuationRewriter;
+    var shouldName = seenAwait;
+    var result = new VariableGet(asyncResult);
+    // The statements are in reverse order, so name the result first if
+    // necessary and then add the two other statements in reverse.
+    if (shouldName) result = name(result);
+    statements.add(R.createContinuationPoint());
+    Arguments arguments = new Arguments(<Expression>[
+        expr.operand,
+        new VariableGet(R.thenContinuationVariable),
+        new VariableGet(R.catchErrorContinuationVariable)]);
+    statements.add(new ExpressionStatement(
+        new StaticInvocation(R.helper.awaitHelper, arguments)));
+
+    seenAwait = false;
+    var index = nameIndex;
+    arguments.positional[0] = expr.operand.accept(this)..parent = arguments;
+
+    if (shouldName) nameIndex = index + 1;
+    seenAwait = true;
+    return result;
+  }
+
+  TreeNode visitFunctionExpression(FunctionExpression expr) {
+    expr.transformChildren(this);
+    return expr;
+  }
+
+  TreeNode visitLet(Let expr) {
+    var shouldName = seenAwait;
+
+    seenAwait = false;
+    var body = expr.body.accept(this);
+
+    VariableDeclaration variable = expr.variable;
+    if (seenAwait) {
+      // The body in `let var x = initializer in body` contained an await.  We
+      // will produce the sequence of statements:
+      //
+      // <initializer's statements>
+      // var x = <initializer's value>
+      // <body's statements>
+      //
+      // and return the body's value.
+      //
+      // So x is in scope for all the body's statements and the body's value.
+      // This has the unpleasant consequence that all let-bound variables with
+      // await in the let's body will end up hoisted out the the expression and
+      // allocated to the context in the VM, even if they have no uses
+      // (`let _ = e0 in e1` can be used for sequencing of `e0` and `e1`).
+      statements.add(variable);
+      var index = nameIndex;
+      seenAwait = false;
+      variable.initializer =
+          variable.initializer.accept(this)..parent = variable;
+      // Temporaries used in the initializer or the body are not live but the
+      // temporary used for the body is.
+      nameIndex = index + 1;
+      seenAwait = true;
+      return body;
+    } else {
+      // The body in `let x = initializer in body` did not contain an await.  We
+      // can leave a let expression.
+      seenAwait = shouldName;
+      return transform(expr, () {
+        // The body has already been translated.
+        expr.body = body..parent = expr;
+        variable.initializer =
+            variable.initializer.accept(this)..parent = variable;
+      });
+    }
+  }
+
+  visitFunctionNode(FunctionNode node) {
+    var nestedRewriter = new RecursiveContinuationRewriter(
+        continuationRewriter.helper);
+    return node.accept(nestedRewriter);
+  }
+}
diff --git a/pkg/kernel/lib/transformations/continuation.dart b/pkg/kernel/lib/transformations/continuation.dart
new file mode 100644
index 0000000..fd6e1d2
--- /dev/null
+++ b/pkg/kernel/lib/transformations/continuation.dart
@@ -0,0 +1,902 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.transformations.continuation;
+
+import 'dart:math' as math;
+
+import '../ast.dart';
+import '../visitor.dart';
+
+import 'async.dart';
+
+Program transformProgram(Program program) {
+  var helper = new HelperNodes.fromProgram(program);
+  var rewriter = new RecursiveContinuationRewriter(helper);
+  return rewriter.rewriteProgram(program);
+}
+
+class RecursiveContinuationRewriter extends Transformer {
+  final HelperNodes helper;
+  final VariableDeclaration asyncJumpVariable = new VariableDeclaration(
+      ":await_jump_var",
+      initializer: new IntLiteral(0));
+  final VariableDeclaration asyncContextVariable =
+      new VariableDeclaration(":await_ctx_var");
+
+  RecursiveContinuationRewriter(this.helper);
+
+  Program rewriteProgram(Program node) {
+    return node.accept(this);
+  }
+
+  visitFunctionNode(FunctionNode node) {
+    switch (node.asyncMarker) {
+      case AsyncMarker.Sync:
+      case AsyncMarker.SyncYielding:
+        node.transformChildren(new RecursiveContinuationRewriter(helper));
+        return node;
+      case AsyncMarker.SyncStar:
+        return new SyncStarFunctionRewriter(helper, node).rewrite();
+      case AsyncMarker.Async:
+        return new AsyncFunctionRewriter(helper, node).rewrite();
+      case AsyncMarker.AsyncStar:
+        return new AsyncStarFunctionRewriter(helper, node).rewrite();
+    }
+  }
+}
+
+abstract class ContinuationRewriterBase extends RecursiveContinuationRewriter {
+  final FunctionNode enclosingFunction;
+
+  int currentTryDepth; // Nesting depth for try-blocks.
+  int currentCatchDepth = 0; // Nesting depth for catch-blocks.
+  int capturedTryDepth = 0; // Deepest yield point within a try-block.
+  int capturedCatchDepth = 0; // Deepest yield point within a catch-block.
+
+  ContinuationRewriterBase(HelperNodes helper, this.enclosingFunction,
+      {this.currentTryDepth: 0})
+      : super(helper);
+
+  Statement createContinuationPoint([Expression value]) {
+    if (value == null) value = new NullLiteral();
+    capturedTryDepth = math.max(capturedTryDepth, currentTryDepth);
+    capturedCatchDepth = math.max(capturedCatchDepth, currentCatchDepth);
+    return new YieldStatement(value, isNative: true);
+  }
+
+  TreeNode visitTryCatch(TryCatch node) {
+    if (node.body != null) {
+      currentTryDepth++;
+      node.body = node.body.accept(this);
+      node.body?.parent = node;
+      currentTryDepth--;
+    }
+
+    currentCatchDepth++;
+    transformList(node.catches, this, node);
+    currentCatchDepth--;
+    return node;
+  }
+
+  TreeNode visitTryFinally(TryFinally node) {
+    if (node.body != null) {
+      currentTryDepth++;
+      node.body = node.body.accept(this);
+      node.body?.parent = node;
+      currentTryDepth--;
+    }
+    if (node.finalizer != null) {
+      node.finalizer = node.finalizer.accept(this);
+      node.finalizer?.parent = node;
+    }
+    return node;
+  }
+
+  Iterable<VariableDeclaration> createCapturedTryVariables() =>
+      new Iterable.generate(capturedTryDepth,
+          (depth) => new VariableDeclaration(":saved_try_context_var${depth}"));
+
+  Iterable<VariableDeclaration> createCapturedCatchVariables() =>
+      new Iterable.generate(capturedCatchDepth).expand((depth) => [
+            new VariableDeclaration(":exception${depth}"),
+            new VariableDeclaration(":stack_trace${depth}"),
+          ]);
+
+  List<VariableDeclaration> variableDeclarations() =>
+      [asyncJumpVariable, asyncContextVariable]
+        ..addAll(createCapturedTryVariables())
+        ..addAll(createCapturedCatchVariables());
+}
+
+class SyncStarFunctionRewriter extends ContinuationRewriterBase {
+  final VariableDeclaration iteratorVariable =
+      new VariableDeclaration(":iterator");
+
+  SyncStarFunctionRewriter(helper, enclosingFunction)
+      : super(helper, enclosingFunction);
+
+  FunctionNode rewrite() {
+    // :sync_body(:iterator) {
+    //     modified <node.body>;
+    // }
+    final nestedClosureVariable = new VariableDeclaration(":sync_op");
+    final function = new FunctionNode(buildClosureBody(),
+        positionalParameters: [iteratorVariable],
+        requiredParameterCount: 1,
+        asyncMarker: AsyncMarker.SyncYielding);
+    final closureFunction =
+        new FunctionDeclaration(nestedClosureVariable, function);
+
+    // return new _SyncIterable(:sync_body);
+    final arguments = new Arguments([new VariableGet(nestedClosureVariable)]);
+    final returnStatement = new ReturnStatement(
+        new ConstructorInvocation(helper.syncIterableConstructor, arguments));
+
+    enclosingFunction.body = new Block([]
+      ..addAll(variableDeclarations())
+      ..addAll([closureFunction, returnStatement]));
+    enclosingFunction.body.parent = enclosingFunction;
+    enclosingFunction.asyncMarker = AsyncMarker.Sync;
+    return enclosingFunction;
+  }
+
+  Statement buildClosureBody() {
+    // The body will insert calls to
+    //    :iterator.current_=
+    //    :iterator.isYieldEach=
+    // and return `true` as long as it did something and `false` when it's done.
+    return enclosingFunction.body.accept(this);
+  }
+
+  visitYieldStatement(YieldStatement node) {
+    var transformedExpression = node.expression.accept(this);
+
+    var statements = <Statement>[];
+    if (node.isYieldStar) {
+      var markYieldEach = new ExpressionStatement(new PropertySet(
+          new VariableGet(iteratorVariable),
+          new Name("isYieldEach", helper.coreLibrary),
+          new BoolLiteral(true)));
+      statements.add(markYieldEach);
+    }
+
+    var setCurrentIteratorValue = new ExpressionStatement(new PropertySet(
+        new VariableGet(iteratorVariable),
+        new Name("_current", helper.coreLibrary),
+        transformedExpression));
+
+    statements.add(setCurrentIteratorValue);
+    statements.add(createContinuationPoint(new BoolLiteral(true)));
+    return new Block(statements);
+  }
+}
+
+abstract class AsyncRewriterBase extends ContinuationRewriterBase {
+  final VariableDeclaration nestedClosureVariable =
+      new VariableDeclaration(":async_op");
+  final VariableDeclaration thenContinuationVariable =
+      new VariableDeclaration(":async_op_then");
+  final VariableDeclaration catchErrorContinuationVariable =
+      new VariableDeclaration(":async_op_error");
+
+  LabeledStatement labeledBody;
+
+  ExpressionLifter expressionRewriter;
+
+  AsyncRewriterBase(helper, enclosingFunction)
+      // Body is wrapped in the try-catch so initial currentTryDepth is 1.
+      : super(helper, enclosingFunction, currentTryDepth: 1) {}
+
+  void setupAsyncContinuations(List<Statement> statements) {
+    expressionRewriter = new ExpressionLifter(this);
+
+    // var :async_op_then;
+    statements.add(thenContinuationVariable);
+
+    // var :async_op_error;
+    statements.add(catchErrorContinuationVariable);
+
+    // :async_op([:result, :exception, :stack_trace]) {
+    //     modified <node.body>;
+    // }
+    final parameters = <VariableDeclaration>[
+      expressionRewriter.asyncResult,
+      new VariableDeclaration(':exception'),
+      new VariableDeclaration(':stack_trace'),
+    ];
+    final function = new FunctionNode(buildWrappedBody(),
+        positionalParameters: parameters,
+        requiredParameterCount: 0,
+        asyncMarker: AsyncMarker.SyncYielding);
+
+    // The await expression lifter might have created a number of
+    // [VariableDeclarations].
+    // TODO(kustermann): If we didn't need any variables we should not emit
+    // these.
+    statements.addAll(variableDeclarations());
+    statements.addAll(expressionRewriter.variables);
+
+    // Now add the closure function itself.
+    final closureFunction =
+        new FunctionDeclaration(nestedClosureVariable, function);
+    statements.add(closureFunction);
+
+    // :async_op_then = _asyncThenWrapperHelper(asyncBody);
+    final boundThenClosure = new StaticInvocation(helper.asyncThenWrapper,
+        new Arguments(<Expression>[new VariableGet(nestedClosureVariable)]));
+    final thenClosureVariableAssign = new ExpressionStatement(
+        new VariableSet(thenContinuationVariable, boundThenClosure));
+    statements.add(thenClosureVariableAssign);
+
+    // :async_op_error = _asyncErrorWrapperHelper(asyncBody);
+    final boundCatchErrorClosure = new StaticInvocation(
+        helper.asyncErrorWrapper,
+        new Arguments(<Expression>[new VariableGet(nestedClosureVariable)]));
+    final catchErrorClosureVariableAssign = new ExpressionStatement(
+        new VariableSet(
+            catchErrorContinuationVariable, boundCatchErrorClosure));
+    statements.add(catchErrorClosureVariableAssign);
+  }
+
+  Statement buildWrappedBody() {
+    labeledBody = new LabeledStatement(null);
+    labeledBody.body = visitDelimited(enclosingFunction.body)
+      ..parent = labeledBody;
+
+    var exceptionVariable = new VariableDeclaration(":exception");
+    var stackTraceVariable = new VariableDeclaration(":stack_trace");
+
+    return new TryCatch(buildReturn(labeledBody), <Catch>[
+      new Catch(
+          exceptionVariable,
+          new Block(<Statement>[
+            buildCatchBody(exceptionVariable, stackTraceVariable)
+          ]),
+          stackTrace: stackTraceVariable)
+    ]);
+  }
+
+  Statement buildCatchBody(
+      Statement exceptionVariable, Statement stackTraceVariable);
+
+  Statement buildReturn(Statement body);
+
+  List<Statement> statements = <Statement>[];
+
+  TreeNode visitInvalidStatement(InvalidStatement stmt) {
+    statements.add(stmt);
+    return null;
+  }
+
+  TreeNode visitExpressionStatement(ExpressionStatement stmt) {
+    stmt.expression = expressionRewriter.rewrite(stmt.expression, statements)
+      ..parent = stmt;
+    statements.add(stmt);
+    return null;
+  }
+
+  TreeNode visitBlock(Block stmt) {
+    var saved = statements;
+    statements = <Statement>[];
+    for (var statement in stmt.statements) {
+      statement.accept(this);
+    }
+    saved.add(new Block(statements));
+    statements = saved;
+    return null;
+  }
+
+  TreeNode visitEmptyStatement(EmptyStatement stmt) {
+    statements.add(stmt);
+    return null;
+  }
+
+  TreeNode visitAssertStatement(AssertStatement stmt) {
+    // TODO!
+    return null;
+  }
+
+  Statement visitDelimited(Statement stmt) {
+    var saved = statements;
+    statements = <Statement>[];
+    stmt.accept(this);
+    Statement result =
+        statements.length == 1 ? statements.first : new Block(statements);
+    statements = saved;
+    return result;
+  }
+
+  Statement visitLabeledStatement(LabeledStatement stmt) {
+    stmt.body = visitDelimited(stmt.body)..parent = stmt;
+    statements.add(stmt);
+    return null;
+  }
+
+  Statement visitBreakStatement(BreakStatement stmt) {
+    statements.add(stmt);
+    return null;
+  }
+
+  TreeNode visitWhileStatement(WhileStatement stmt) {
+    Statement body = visitDelimited(stmt.body);
+    List<Statement> effects = <Statement>[];
+    Expression cond = expressionRewriter.rewrite(stmt.condition, effects);
+    if (effects.isEmpty) {
+      stmt.condition = cond..parent = stmt;
+      stmt.body = body..parent = stmt;
+      statements.add(stmt);
+    } else {
+      // The condition rewrote to a non-empty sequence of statements S* and
+      // value V.  Rewrite the loop to:
+      //
+      // L: while (true) {
+      //   S*
+      //   if (V) {
+      //     [body]
+      //   else {
+      //     break L;
+      //   }
+      // }
+      LabeledStatement labeled = new LabeledStatement(stmt);
+      stmt.condition = new BoolLiteral(true)..parent = stmt;
+      effects.add(new IfStatement(cond, body, new BreakStatement(labeled)));
+      stmt.body = new Block(effects)..parent = stmt;
+      statements.add(labeled);
+    }
+    return null;
+  }
+
+  TreeNode visitDoStatement(DoStatement stmt) {
+    Statement body = visitDelimited(stmt.body);
+    List<Statement> effects = <Statement>[];
+    stmt.condition = expressionRewriter.rewrite(stmt.condition, effects)
+      ..parent = stmt;
+    if (effects.isNotEmpty) {
+      // The condition rewrote to a non-empty sequence of statements S* and
+      // value V.  Add the statements to the end of the loop body.
+      Block block = body is Block ? body : body = new Block(<Statement>[body]);
+      for (var effect in effects) {
+        block.statements.add(effect);
+        effect.parent = body;
+      }
+    }
+    stmt.body = body..parent = stmt;
+    statements.add(stmt);
+    return null;
+  }
+
+  TreeNode visitForStatement(ForStatement stmt) {
+    // Because of for-loop scoping and variable capture, it is tricky to deal
+    // with await in the loop's variable initializers or update expressions.
+    bool isSimple = true;
+    int length = stmt.variables.length;
+    List<List<Statement>> initEffects = new List<List<Statement>>(length);
+    for (int i = 0; i < length; ++i) {
+      VariableDeclaration decl = stmt.variables[i];
+      initEffects[i] = <Statement>[];
+      if (decl.initializer != null) {
+        decl.initializer = expressionRewriter.rewrite(
+            decl.initializer, initEffects[i])..parent = decl;
+      }
+      isSimple = isSimple && initEffects[i].isEmpty;
+    }
+
+    length = stmt.updates.length;
+    List<List<Statement>> updateEffects = new List<List<Statement>>(length);
+    for (int i = 0; i < length; ++i) {
+      updateEffects[i] = <Statement>[];
+      stmt.updates[i] = expressionRewriter.rewrite(
+          stmt.updates[i], updateEffects[i])..parent = stmt;
+      isSimple = isSimple && updateEffects[i].isEmpty;
+    }
+
+    Statement body = visitDelimited(stmt.body);
+    Expression cond = stmt.condition;
+    List<Statement> condEffects;
+    if (cond != null) {
+      condEffects = <Statement>[];
+      cond = expressionRewriter.rewrite(stmt.condition, condEffects);
+    }
+
+    if (isSimple) {
+      // If the condition contains await, we use a translation like the one for
+      // while loops, but leaving the variable declarations and the update
+      // expressions in place.
+      if (condEffects == null || condEffects.isEmpty) {
+        if (cond != null) stmt.condition = cond..parent = stmt;
+        stmt.body = body..parent = stmt;
+        statements.add(stmt);
+      } else {
+        LabeledStatement labeled = new LabeledStatement(stmt);
+        // No condition in a for loop is the same as true.
+        stmt.condition = null;
+        condEffects
+            .add(new IfStatement(cond, body, new BreakStatement(labeled)));
+        stmt.body = new Block(condEffects)..parent = stmt;
+        statements.add(labeled);
+      }
+      return null;
+    }
+
+    // If the rewrite of the initializer or update expressions produces a
+    // non-empty sequence of statements then the loop is desugared.  If the loop
+    // has the form:
+    //
+    // label: for (Type x = init; cond; update) body
+    //
+    // it is translated as if it were:
+    //
+    // {
+    //   bool first = true;
+    //   Type temp;
+    //   label: while (true) {
+    //     Type x;
+    //     if (first) {
+    //       first = false;
+    //       x = init;
+    //     } else {
+    //       x = temp;
+    //       update;
+    //     }
+    //     if (cond) {
+    //       body;
+    //       temp = x;
+    //     } else {
+    //       break;
+    //     }
+    //   }
+    // }
+
+    // Place the loop variable declarations at the beginning of the body
+    // statements and move their initializers to a guarded list of statements.
+    // Add assignments to the loop variables from the previous iteration's temp
+    // variables before the updates.
+    //
+    // temps.first is the flag 'first'.
+    // TODO(kmillikin) bool type for first.
+    List<VariableDeclaration> temps = <VariableDeclaration>[
+      new VariableDeclaration.forValue(new BoolLiteral(true), isFinal: false)
+    ];
+    List<Statement> loopBody = <Statement>[];
+    List<Statement> initializers = <Statement>[
+      new ExpressionStatement(
+          new VariableSet(temps.first, new BoolLiteral(false)))
+    ];
+    List<Statement> updates = <Statement>[];
+    List<Statement> newBody = <Statement>[body];
+    for (int i = 0; i < stmt.variables.length; ++i) {
+      VariableDeclaration decl = stmt.variables[i];
+      temps.add(new VariableDeclaration(null, type: decl.type));
+      loopBody.add(decl);
+      if (decl.initializer != null) {
+        initializers.addAll(initEffects[i]);
+        initializers.add(
+            new ExpressionStatement(new VariableSet(decl, decl.initializer)));
+        decl.initializer = null;
+      }
+      updates.add(new ExpressionStatement(
+          new VariableSet(decl, new VariableGet(temps.last))));
+      newBody.add(new ExpressionStatement(
+          new VariableSet(temps.last, new VariableGet(decl))));
+    }
+    // Add the updates to their guarded list of statements.
+    for (int i = 0; i < stmt.updates.length; ++i) {
+      updates.addAll(updateEffects[i]);
+      updates.add(new ExpressionStatement(stmt.updates[i]));
+    }
+    // Initializers or updates could be empty.
+    loopBody.add(new IfStatement(new VariableGet(temps.first),
+        new Block(initializers), new Block(updates)));
+
+    LabeledStatement labeled = new LabeledStatement(null);
+    if (cond != null) {
+      loopBody.addAll(condEffects);
+    } else {
+      cond = new BoolLiteral(true);
+    }
+    loopBody.add(
+        new IfStatement(cond, new Block(newBody), new BreakStatement(labeled)));
+    labeled.body = new WhileStatement(
+        new BoolLiteral(true), new Block(loopBody))..parent = labeled;
+    statements.add(new Block(<Statement>[]
+      ..addAll(temps)
+      ..add(labeled)));
+    return null;
+  }
+
+  TreeNode visitForInStatement(ForInStatement stmt) {
+    if (stmt.isAsync) {
+      // Transform
+      //
+      //   await for (var variable in <stream-expression>) { ... }
+      //
+      // To:
+      //
+      //   {
+      //     var :for-iterator = new StreamIterator(<stream-expression>);
+      //     try {
+      //       while (await :for-iterator.moveNext()) {
+      //         var <variable> = :for-iterator.current;
+      //         ...
+      //       }
+      //     } finally {
+      //       :for-iterator.cancel();
+      //     }
+      //   }
+      var iteratorVariable = new VariableDeclaration(':for-iterator',
+          initializer: new ConstructorInvocation(
+              helper.streamIteratorConstructor,
+              new Arguments(<Expression>[stmt.iterable])));
+
+      // await iterator.moveNext()
+      var condition = new AwaitExpression(new MethodInvocation(
+          new VariableGet(iteratorVariable),
+          new Name('moveNext'),
+          new Arguments(<Expression>[])));
+
+      // var <variable> = iterator.current;
+      var valueVariable = stmt.variable;
+      valueVariable.initializer = new PropertyGet(
+          new VariableGet(iteratorVariable), new Name('current'));
+      valueVariable.initializer.parent = valueVariable;
+
+      var whileBody = new Block(<Statement>[valueVariable, stmt.body]);
+      var tryBody = new WhileStatement(condition, whileBody);
+
+      // iterator.cancel();
+      var tryFinalizer = new ExpressionStatement(new MethodInvocation(
+          new VariableGet(iteratorVariable),
+          new Name('cancel'),
+          new Arguments(<Expression>[])));
+
+      var tryFinally = new TryFinally(tryBody, tryFinalizer);
+
+      var block = new Block(<Statement>[iteratorVariable, tryFinally]);
+      block.accept(this);
+    } else {
+      stmt.iterable = expressionRewriter.rewrite(stmt.iterable, statements)
+        ..parent = stmt;
+      stmt.body = visitDelimited(stmt.body)..parent = stmt;
+      statements.add(stmt);
+    }
+    return null;
+  }
+
+  TreeNode visitSwitchStatement(SwitchStatement stmt) {
+    stmt.expression = expressionRewriter.rewrite(stmt.expression, statements)
+      ..parent = stmt;
+    for (var switchCase in stmt.cases) {
+      // Expressions in switch cases cannot contain await so they do not need to
+      // be translated.
+      switchCase.body = visitDelimited(switchCase.body)..parent = switchCase;
+    }
+    statements.add(stmt);
+    return null;
+  }
+
+  TreeNode visitContinueSwitchStatement(ContinueSwitchStatement stmt) {
+    statements.add(stmt);
+    return null;
+  }
+
+  TreeNode visitIfStatement(IfStatement stmt) {
+    stmt.condition = expressionRewriter.rewrite(stmt.condition, statements)
+      ..parent = stmt;
+    stmt.then = visitDelimited(stmt.then)..parent = stmt;
+    if (stmt.otherwise != null) {
+      stmt.otherwise = visitDelimited(stmt.otherwise)..parent = stmt;
+    }
+    statements.add(stmt);
+    return null;
+  }
+
+  TreeNode visitTryCatch(TryCatch stmt) {
+    ++currentTryDepth;
+    stmt.body = visitDelimited(stmt.body)..parent = stmt;
+    --currentTryDepth;
+
+    ++currentCatchDepth;
+    for (var clause in stmt.catches) {
+      clause.body = visitDelimited(clause.body)..parent = clause;
+    }
+    --currentCatchDepth;
+    statements.add(stmt);
+    return null;
+  }
+
+  TreeNode visitTryFinally(TryFinally stmt) {
+    ++currentTryDepth;
+    stmt.body = visitDelimited(stmt.body)..parent = stmt;
+    --currentTryDepth;
+    stmt.finalizer = visitDelimited(stmt.finalizer)..parent = stmt;
+    statements.add(stmt);
+    return null;
+  }
+
+  TreeNode visitYieldStatement(YieldStatement stmt) {
+    stmt.expression = expressionRewriter.rewrite(stmt.expression, statements)
+      ..parent = stmt;
+    statements.add(stmt);
+    return null;
+  }
+
+  TreeNode visitVariableDeclaration(VariableDeclaration stmt) {
+    if (stmt.initializer != null) {
+      stmt.initializer = expressionRewriter.rewrite(
+          stmt.initializer, statements)..parent = stmt;
+    }
+    statements.add(stmt);
+    return null;
+  }
+
+  TreeNode visitFunctionDeclaration(FunctionDeclaration stmt) {
+    stmt.function = stmt.function.accept(this)..parent = stmt;
+    statements.add(stmt);
+    return null;
+  }
+
+  defaultExpression(TreeNode node) => throw 'unreachable';
+}
+
+class AsyncStarFunctionRewriter extends AsyncRewriterBase {
+  VariableDeclaration controllerVariable;
+
+  AsyncStarFunctionRewriter(helper, enclosingFunction)
+      : super(helper, enclosingFunction);
+
+  FunctionNode rewrite() {
+    var statements = <Statement>[];
+
+    // var :controller;
+    controllerVariable = new VariableDeclaration(":controller");
+    statements.add(controllerVariable);
+
+    setupAsyncContinuations(statements);
+
+    // :controller = new _AsyncController(:async_op);
+    var arguments =
+        new Arguments(<Expression>[new VariableGet(nestedClosureVariable)]);
+    var buildController = new ConstructorInvocation(
+        helper.streamControllerConstructor, arguments);
+    var setController = new ExpressionStatement(
+        new VariableSet(controllerVariable, buildController));
+    statements.add(setController);
+
+    // return :controller.stream;
+    var completerGet = new VariableGet(controllerVariable);
+    var returnStatement = new ReturnStatement(
+        new PropertyGet(completerGet, new Name('stream', helper.asyncLibrary)));
+    statements.add(returnStatement);
+
+    enclosingFunction.body = new Block(statements);
+    enclosingFunction.body.parent = enclosingFunction;
+    enclosingFunction.asyncMarker = AsyncMarker.Sync;
+    return enclosingFunction;
+  }
+
+  Statement buildCatchBody(exceptionVariable, stackTraceVariable) {
+    return new ExpressionStatement(new MethodInvocation(
+        new VariableGet(controllerVariable),
+        new Name("completeError", helper.asyncLibrary),
+        new Arguments(<Expression>[
+          new VariableGet(exceptionVariable),
+          new VariableGet(stackTraceVariable)
+        ])));
+  }
+
+  Statement buildReturn(Statement body) {
+    // Async* functions cannot return a value.  The returns from the function
+    // have been translated into breaks from the labeled body.
+    return new Block(<Statement>[
+      body,
+      new ExpressionStatement(new MethodInvocation(
+          new VariableGet(controllerVariable),
+          new Name("close", helper.asyncLibrary),
+          new Arguments(<Expression>[]))),
+      new ReturnStatement()
+    ]);
+  }
+
+  TreeNode visitYieldStatement(YieldStatement stmt) {
+    Expression expr = expressionRewriter.rewrite(stmt.expression, statements);
+
+    var addExpression = new MethodInvocation(
+        new VariableGet(controllerVariable),
+        new Name(stmt.isYieldStar ? 'addStream' : 'add', helper.asyncLibrary),
+        new Arguments(<Expression>[expr]));
+
+    statements.add(new IfStatement(addExpression,
+        new ReturnStatement(new NullLiteral()), createContinuationPoint()));
+    return null;
+  }
+
+  TreeNode visitReturnStatement(ReturnStatement node) {
+    // Async* functions cannot return a value.
+    assert(node.expression == null || node.expression is NullLiteral);
+    statements
+        .add(new BreakStatement(labeledBody)..fileOffset = node.fileOffset);
+    return null;
+  }
+}
+
+class AsyncFunctionRewriter extends AsyncRewriterBase {
+  VariableDeclaration completerVariable;
+  VariableDeclaration returnVariable;
+
+  AsyncFunctionRewriter(helper, enclosingFunction)
+      : super(helper, enclosingFunction);
+
+  FunctionNode rewrite() {
+    var statements = <Statement>[];
+
+    // var :completer = new Completer.sync();
+    completerVariable = new VariableDeclaration(":completer",
+        initializer: new StaticInvocation(
+            helper.completerConstructor, new Arguments([])),
+        isFinal: true);
+    statements.add(completerVariable);
+
+    returnVariable = new VariableDeclaration(":return_value");
+    statements.add(returnVariable);
+
+    setupAsyncContinuations(statements);
+
+    // new Future.microtask(:async_op);
+    var newMicrotaskStatement = new ExpressionStatement(new StaticInvocation(
+        helper.futureMicrotaskConstructor,
+        new Arguments([new VariableGet(nestedClosureVariable)])));
+    statements.add(newMicrotaskStatement);
+
+    // return :completer.future;
+    var completerGet = new VariableGet(completerVariable);
+    var returnStatement = new ReturnStatement(
+        new PropertyGet(completerGet, new Name('future', helper.asyncLibrary)));
+    statements.add(returnStatement);
+
+    enclosingFunction.body = new Block(statements);
+    enclosingFunction.body.parent = enclosingFunction;
+    enclosingFunction.asyncMarker = AsyncMarker.Sync;
+    return enclosingFunction;
+  }
+
+  Statement buildCatchBody(exceptionVariable, stackTraceVariable) {
+    return new ExpressionStatement(new MethodInvocation(
+        new VariableGet(completerVariable),
+        new Name("completeError", helper.asyncLibrary),
+        new Arguments([
+          new VariableGet(exceptionVariable),
+          new VariableGet(stackTraceVariable)
+        ])));
+  }
+
+  Statement buildReturn(Statement body) {
+    // Returns from the body have all been translated into assignments to the
+    // return value variable followed by a break from the labeled body.
+    return new Block(<Statement>[
+      body,
+      new ExpressionStatement(new MethodInvocation(
+          new VariableGet(completerVariable),
+          new Name("complete", helper.asyncLibrary),
+          new Arguments([new VariableGet(returnVariable)]))),
+      new ReturnStatement()
+    ]);
+  }
+
+  visitReturnStatement(ReturnStatement node) {
+    var expr = node.expression == null
+        ? new NullLiteral()
+        : expressionRewriter.rewrite(node.expression, statements);
+    statements
+        .add(new ExpressionStatement(new VariableSet(returnVariable, expr)));
+    statements
+        .add(new BreakStatement(labeledBody)..fileOffset = node.fileOffset);
+    return null;
+  }
+}
+
+class HelperNodes {
+  final Library asyncLibrary;
+  final Library coreLibrary;
+  final Procedure printProcedure;
+  final Procedure completerConstructor;
+  final Procedure futureMicrotaskConstructor;
+  final Constructor streamControllerConstructor;
+  final Constructor syncIterableConstructor;
+  final Constructor streamIteratorConstructor;
+  final Procedure asyncThenWrapper;
+  final Procedure asyncErrorWrapper;
+  final Procedure awaitHelper;
+
+  HelperNodes(
+      this.asyncLibrary,
+      this.coreLibrary,
+      this.printProcedure,
+      this.completerConstructor,
+      this.syncIterableConstructor,
+      this.streamIteratorConstructor,
+      this.futureMicrotaskConstructor,
+      this.streamControllerConstructor,
+      this.asyncThenWrapper,
+      this.asyncErrorWrapper,
+      this.awaitHelper);
+
+  factory HelperNodes.fromProgram(Program program) {
+    Library findLibrary(String name) {
+      Uri uri = Uri.parse(name);
+      for (var library in program.libraries) {
+        if (library.importUri == uri) return library;
+      }
+      throw 'Library "$name" not found';
+    }
+
+    Class findClass(Library library, String name) {
+      for (var klass in library.classes) {
+        if (klass.name == name) return klass;
+      }
+      throw 'Class "$name" not found';
+    }
+
+    Procedure findFactoryConstructor(Class klass, String name) {
+      for (var procedure in klass.procedures) {
+        if (procedure.isStatic && procedure.name.name == name) return procedure;
+      }
+      throw 'Factory constructor "$klass.$name" not found';
+    }
+
+    Constructor findConstructor(Class klass, String name) {
+      for (var constructor in klass.constructors) {
+        if (constructor.name.name == name) return constructor;
+      }
+      throw 'Constructor "$klass.$name" not found';
+    }
+
+    Procedure findProcedure(Library library, String name) {
+      for (var procedure in library.procedures) {
+        if (procedure.name.name == name ||
+            procedure.name.name == '${library.name}::${name}') {
+          return procedure;
+        }
+      }
+      throw 'Procedure "$name" not found';
+    }
+
+    var asyncLibrary = findLibrary('dart:async');
+    var coreLibrary = findLibrary('dart:core');
+
+    var completerClass = findClass(asyncLibrary, 'Completer');
+    var futureClass = findClass(asyncLibrary, 'Future');
+
+    // The VM's dart:async implementation has renamed _StreamIteratorImpl to
+    // _StreamIterator.  To support both old and new library implementations we
+    // look for the old name first and then the new name.
+    var streamIteratorClass;
+    try {
+      streamIteratorClass = findClass(asyncLibrary, '_StreamIteratorImpl');
+    } catch (e) {
+      if (e == 'Class "_StreamIteratorImpl" not found') {
+        streamIteratorClass = findClass(asyncLibrary, '_StreamIterator');
+      } else {
+        rethrow;
+      }
+    }
+
+    var syncIterableClass = findClass(coreLibrary, '_SyncIterable');
+    var streamControllerClass =
+        findClass(asyncLibrary, '_AsyncStarStreamController');
+
+    return new HelperNodes(
+        asyncLibrary,
+        coreLibrary,
+        findProcedure(coreLibrary, 'print'),
+        findFactoryConstructor(completerClass, 'sync'),
+        findConstructor(syncIterableClass, ''),
+        findConstructor(streamIteratorClass, ''),
+        findFactoryConstructor(futureClass, 'microtask'),
+        findConstructor(streamControllerClass, ''),
+        findProcedure(asyncLibrary, '_asyncThenWrapperHelper'),
+        findProcedure(asyncLibrary, '_asyncErrorWrapperHelper'),
+        findProcedure(asyncLibrary, '_awaitHelper'));
+  }
+}
diff --git a/pkg/kernel/lib/transformations/erasure.dart b/pkg/kernel/lib/transformations/erasure.dart
new file mode 100644
index 0000000..d2cb413
--- /dev/null
+++ b/pkg/kernel/lib/transformations/erasure.dart
@@ -0,0 +1,147 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.transformations.erasure;
+
+import '../ast.dart';
+import '../type_algebra.dart';
+
+/// This pass is a temporary measure to run strong mode code in the VM, which
+/// does not yet have the necessary runtime support.
+///
+/// Function type parameter lists are cleared and all uses of a function type
+/// parameter are replaced by its upper bound.
+///
+/// All uses of type parameters in constants are replaced by 'dynamic'.
+///
+/// This does not preserve dynamic type safety.
+class Erasure extends Transformer {
+  final Map<TypeParameter, DartType> substitution = <TypeParameter, DartType>{};
+  final Map<TypeParameter, DartType> constantSubstitution =
+      <TypeParameter, DartType>{};
+
+  int constantContexts = 0;
+
+  void transform(Program program) {
+    program.accept(this);
+  }
+
+  void pushConstantContext() {
+    ++constantContexts;
+  }
+
+  void popConstantContext() {
+    --constantContexts;
+  }
+
+  bool get isInConstantContext => constantContexts > 0;
+
+  @override
+  visitDartType(DartType type) {
+    type = substitute(type, substitution);
+    if (isInConstantContext) {
+      type = substitute(type, constantSubstitution);
+    }
+    return type;
+  }
+
+  @override
+  visitClass(Class node) {
+    for (var parameter in node.typeParameters) {
+      constantSubstitution[parameter] = const DynamicType();
+    }
+    node.transformChildren(this);
+    constantSubstitution.clear();
+    return node;
+  }
+
+  @override
+  visitProcedure(Procedure node) {
+    if (node.kind == ProcedureKind.Factory) {
+      assert(node.enclosingClass != null);
+      assert(node.enclosingClass.typeParameters.length ==
+          node.function.typeParameters.length);
+      // Factories can have function type parameters as long as they correspond
+      // exactly to those on the enclosing class. However, these type parameters
+      // may still not be in a constant.
+      for (var parameter in node.function.typeParameters) {
+        constantSubstitution[parameter] = const DynamicType();
+      }
+      // Skip the visitFunctionNode but traverse body.
+      node.function.transformChildren(this);
+      node.function.typeParameters.forEach(constantSubstitution.remove);
+    } else {
+      node.transformChildren(this);
+    }
+    return node;
+  }
+
+  bool isObject(DartType type) {
+    return type is InterfaceType && type.classNode.supertype == null;
+  }
+
+  @override
+  visitFunctionNode(FunctionNode node) {
+    for (var parameter in node.typeParameters) {
+      substitution[parameter] = const DynamicType();
+    }
+    for (var parameter in node.typeParameters) {
+      if (!isObject(parameter.bound)) {
+        substitution[parameter] = substitute(parameter.bound, substitution);
+      }
+    }
+    node.transformChildren(this);
+    node.typeParameters.forEach(substitution.remove);
+    node.typeParameters.clear();
+    return node;
+  }
+
+  @override
+  visitStaticInvocation(StaticInvocation node) {
+    if (node.target.kind != ProcedureKind.Factory) {
+      node.arguments.types.clear();
+    }
+    if (node.isConst) pushConstantContext();
+    node.transformChildren(this);
+    if (node.isConst) popConstantContext();
+    return node;
+  }
+
+  @override
+  visitMethodInvocation(MethodInvocation node) {
+    node.arguments.types.clear();
+    node.transformChildren(this);
+    return node;
+  }
+
+  @override
+  visitDirectMethodInvocation(DirectMethodInvocation node) {
+    node.arguments.types.clear();
+    node.transformChildren(this);
+    return node;
+  }
+
+  @override
+  visitConstructorInvocation(ConstructorInvocation node) {
+    if (node.isConst) pushConstantContext();
+    node.transformChildren(this);
+    if (node.isConst) popConstantContext();
+    return node;
+  }
+
+  @override
+  visitListLiteral(ListLiteral node) {
+    if (node.isConst) pushConstantContext();
+    node.transformChildren(this);
+    if (node.isConst) popConstantContext();
+    return node;
+  }
+
+  @override
+  visitMapLiteral(MapLiteral node) {
+    if (node.isConst) pushConstantContext();
+    node.transformChildren(this);
+    if (node.isConst) popConstantContext();
+    return node;
+  }
+}
diff --git a/pkg/kernel/lib/transformations/flags.dart b/pkg/kernel/lib/transformations/flags.dart
new file mode 100644
index 0000000..32cd627
--- /dev/null
+++ b/pkg/kernel/lib/transformations/flags.dart
@@ -0,0 +1,21 @@
+library kernel.transformations.flags;
+
+import '../ast.dart';
+
+/// Flags summarizing the kinds of AST nodes contained in a given member or
+/// class, for speeding up transformations that only affect certain types of
+/// nodes.
+///
+/// These are set by the frontend and the deserializer.
+class TransformerFlag {
+  /// The class or member contains 'super' calls, that is, one of the AST nodes
+  /// [SuperPropertyGet], [SuperPropertySet], [SuperMethodInvocation].
+  static const int superCalls = 1 << 0;
+
+  /// Temporary flag used by the verifier to indicate that the given member
+  /// has been seen.
+  static const int seenByVerifier = 1 << 1;
+
+  // TODO(asgerf):  We could also add a flag for 'async' and will probably have
+  // one for closures as well.
+}
diff --git a/pkg/kernel/lib/transformations/infer_values.dart b/pkg/kernel/lib/transformations/infer_values.dart
new file mode 100644
index 0000000..c7d51c5
--- /dev/null
+++ b/pkg/kernel/lib/transformations/infer_values.dart
@@ -0,0 +1,42 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.transformations.infer_types;
+
+import '../ast.dart';
+import '../type_propagation/type_propagation.dart';
+
+Program transformProgram(Program program) {
+  TypePropagation propagation = new TypePropagation(program);
+
+  var attacher = new InferredValueAttacher(propagation, program);
+  attacher.attachInferredValues();
+
+  return program;
+}
+
+class InferredValueAttacher extends RecursiveVisitor {
+  final TypePropagation propagation;
+  final Program program;
+
+  InferredValueAttacher(this.propagation, this.program);
+
+  attachInferredValues() => program.accept(this);
+
+  visitField(Field node) {
+    node.inferredValue = propagation.getFieldValue(node);
+    super.visitField(node);
+  }
+
+  visitFunctionNode(FunctionNode node) {
+    node.positionalParameters.forEach(_annotateVariableDeclaration);
+    node.namedParameters.forEach(_annotateVariableDeclaration);
+    node.inferredReturnValue = propagation.getReturnValue(node);
+    super.visitFunctionNode(node);
+  }
+
+  _annotateVariableDeclaration(VariableDeclaration variable) {
+    variable.inferredValue = propagation.getParameterValue(variable);
+  }
+}
diff --git a/pkg/kernel/lib/transformations/mixin_full_resolution.dart b/pkg/kernel/lib/transformations/mixin_full_resolution.dart
new file mode 100644
index 0000000..7669b1a
--- /dev/null
+++ b/pkg/kernel/lib/transformations/mixin_full_resolution.dart
@@ -0,0 +1,368 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.transformations.mixin_full_resolution;
+
+import '../ast.dart';
+import '../class_hierarchy.dart';
+import '../clone.dart';
+import '../core_types.dart';
+import '../type_algebra.dart';
+
+Program transformProgram(Program program) {
+  new MixinFullResolution().transform(program);
+  return program;
+}
+
+/// Replaces all mixin applications with regular classes, cloning all fields
+/// and procedures from the mixed-in class, cloning all constructors from the
+/// base class.
+///
+/// Super calls (as well as super initializer invocations) are also resolved
+/// to their targets in this pass.
+class MixinFullResolution {
+  ClassHierarchy hierarchy;
+  CoreTypes coreTypes;
+
+  void transform(Program program) {
+    var transformedClasses = new Set<Class>();
+
+    // Desugar all mixin application classes by copying in fields/methods from
+    // the mixin and constructors from the base class.
+    var processedClasses = new Set<Class>();
+    for (var library in program.libraries) {
+      for (var class_ in library.classes) {
+        transformClass(processedClasses, transformedClasses, class_);
+      }
+    }
+
+    hierarchy = new ClassHierarchy(program);
+    coreTypes = new CoreTypes(program);
+
+    // Resolve all super call expressions and super initializers.
+    for (var library in program.libraries) {
+      for (var class_ in library.classes) {
+        final bool hasTransformedSuperclass =
+            transformedClasses.contains(class_.superclass);
+
+        for (var procedure in class_.procedures) {
+          if (procedure.containsSuperCalls) {
+            new SuperCallResolutionTransformer(
+                    hierarchy, coreTypes, class_.superclass)
+                .visit(procedure);
+          }
+        }
+        for (var constructor in class_.constructors) {
+          if (constructor.containsSuperCalls) {
+            new SuperCallResolutionTransformer(
+                    hierarchy, coreTypes, class_.superclass)
+                .visit(constructor);
+          }
+          if (hasTransformedSuperclass && constructor.initializers.length > 0) {
+            new SuperInitializerResolutionTransformer(class_.superclass)
+                .transformInitializers(constructor.initializers);
+          }
+        }
+      }
+    }
+  }
+
+  transformClass(Set<Class> processedClasses, Set<Class> transformedClasses,
+      Class class_) {
+    // If this class was already handled then so were all classes up to the
+    // [Object] class.
+    if (!processedClasses.add(class_)) return;
+
+    // Ensure super classes have been transformed before this class.
+    if (class_.superclass != null) {
+      transformClass(processedClasses, transformedClasses, class_.superclass);
+    }
+
+    // If this is not a mixin application we don't need to make forwarding
+    // constructors in this class.
+    if (!class_.isMixinApplication) return;
+
+    transformedClasses.add(class_);
+
+    // Clone fields and methods from the mixin class.
+    var substitution = getSubstitutionMap(class_.mixedInType);
+    var cloner = new CloneVisitor(typeSubstitution: substitution);
+    for (var field in class_.mixin.fields) {
+      class_.addMember(cloner.clone(field));
+    }
+    for (var procedure in class_.mixin.procedures) {
+      class_.addMember(cloner.clone(procedure));
+    }
+    // For each generative constructor in the superclass we make a
+    // corresponding forwarding constructor in the subclass.
+    // Named mixin applications already have constructors, so only build the
+    // constructors for anonymous mixin applications.
+    if (class_.constructors.isEmpty) {
+      var superclassSubstitution = getSubstitutionMap(class_.supertype);
+      var superclassCloner =
+          new CloneVisitor(typeSubstitution: superclassSubstitution);
+      for (var superclassConstructor in class_.superclass.constructors) {
+        var forwardingConstructor =
+            buildForwardingConstructor(superclassCloner, superclassConstructor);
+        class_.constructors.add(forwardingConstructor..parent = class_);
+      }
+    }
+
+    // This class implements the mixin type.
+    class_.implementedTypes.add(class_.mixedInType);
+
+    // This class is now a normal class.
+    class_.mixedInType = null;
+  }
+
+  Constructor buildForwardingConstructor(
+      CloneVisitor cloner, Constructor superclassConstructor) {
+    var superFunction = superclassConstructor.function;
+
+    // We keep types and default values for the parameters but always mark the
+    // parameters as final (since we just forward them to the super
+    // constructor).
+    VariableDeclaration cloneVariable(VariableDeclaration variable) {
+      VariableDeclaration clone = cloner.clone(variable);
+      clone.isFinal = true;
+      return clone;
+    }
+
+    // Build a [FunctionNode] which has the same parameters as the one in the
+    // superclass constructor.
+    var positionalParameters =
+        superFunction.positionalParameters.map(cloneVariable).toList();
+    var namedParameters =
+        superFunction.namedParameters.map(cloneVariable).toList();
+    var function = new FunctionNode(new EmptyStatement(),
+        positionalParameters: positionalParameters,
+        namedParameters: namedParameters,
+        requiredParameterCount: superFunction.requiredParameterCount,
+        returnType: const VoidType());
+
+    // Build a [SuperInitializer] which takes all positional/named parameters
+    // and forward them to the super class constructor.
+    var positionalArguments = <Expression>[];
+    for (var variable in positionalParameters) {
+      positionalArguments.add(new VariableGet(variable));
+    }
+    var namedArguments = <NamedExpression>[];
+    for (var variable in namedParameters) {
+      namedArguments
+          .add(new NamedExpression(variable.name, new VariableGet(variable)));
+    }
+    var superInitializer = new SuperInitializer(superclassConstructor,
+        new Arguments(positionalArguments, named: namedArguments));
+
+    // Assemble the constructor.
+    return new Constructor(function,
+        name: superclassConstructor.name,
+        initializers: <Initializer>[superInitializer]);
+  }
+}
+
+class SuperCallResolutionTransformer extends Transformer {
+  final ClassHierarchy hierarchy;
+  final CoreTypes coreTypes;
+  final Class lookupClass;
+  Constructor _invocationMirrorConstructor; // cached
+  Procedure _listFrom; // cached
+
+  SuperCallResolutionTransformer(
+      this.hierarchy, this.coreTypes, this.lookupClass);
+
+  TreeNode visit(TreeNode node) => node.accept(this);
+
+  visitSuperPropertyGet(SuperPropertyGet node) {
+    Member target = hierarchy.getDispatchTarget(lookupClass, node.name);
+    if (target != null) {
+      return new DirectPropertyGet(new ThisExpression(), target);
+    } else {
+      return _callNoSuchMethod(node.name.name, new Arguments.empty(), node,
+          isGetter: true);
+    }
+  }
+
+  visitSuperPropertySet(SuperPropertySet node) {
+    Member target =
+        hierarchy.getDispatchTarget(lookupClass, node.name, setter: true);
+    if (target != null) {
+      return new DirectPropertySet(
+          new ThisExpression(), target, visit(node.value));
+    } else {
+      // Call has to return right-hand-side.
+      VariableDeclaration rightHandSide =
+          new VariableDeclaration.forValue(visit(node.value));
+      Expression result = _callNoSuchMethod(
+          node.name.name, new Arguments([new VariableGet(rightHandSide)]), node,
+          isSetter: true);
+      VariableDeclaration call = new VariableDeclaration.forValue(result);
+      return new Let(
+          rightHandSide, new Let(call, new VariableGet(rightHandSide)));
+    }
+  }
+
+  visitSuperMethodInvocation(SuperMethodInvocation node) {
+    Member target = hierarchy.getDispatchTarget(lookupClass, node.name);
+    Arguments visitedArguments = visit(node.arguments);
+    if (target is Procedure &&
+        !target.isAccessor &&
+        _callIsLegal(target.function, visitedArguments)) {
+      return new DirectMethodInvocation(
+          new ThisExpression(), target, visitedArguments)
+        ..fileOffset = node.fileOffset;
+    } else if (target == null || (target is Procedure && !target.isAccessor)) {
+      // Target not found at all, or call was illegal.
+      return _callNoSuchMethod(node.name.name, visitedArguments, node,
+          isSuper: true);
+    } else if (target != null) {
+      return new MethodInvocation(
+          new DirectPropertyGet(new ThisExpression(), target),
+          new Name('call'),
+          visitedArguments)..fileOffset = node.fileOffset;
+    }
+  }
+
+  /// Create a call to no such method.
+  Expression _callNoSuchMethod(
+      String methodName, Arguments methodArguments, TreeNode node,
+      {isSuper: false, isGetter: false, isSetter: false}) {
+    Member noSuchMethod =
+        hierarchy.getDispatchTarget(lookupClass, new Name("noSuchMethod"));
+    String methodNameUsed = (isGetter)
+        ? "get:$methodName"
+        : (isSetter) ? "set:$methodName" : methodName;
+    if (noSuchMethod != null &&
+        noSuchMethod.function.positionalParameters.length == 1 &&
+        noSuchMethod.function.namedParameters.isEmpty) {
+      // We have a correct noSuchMethod method.
+      ConstructorInvocation invocation = _createInvocation(
+          methodNameUsed, methodArguments, isSuper, new ThisExpression());
+      return new DirectMethodInvocation(
+          new ThisExpression(), noSuchMethod, new Arguments([invocation]))
+        ..fileOffset = node.fileOffset;
+    } else {
+      // Incorrect noSuchMethod method: Call noSuchMethod on Object
+      // with Invocation of noSuchMethod as the method that did not exist.
+      noSuchMethod = hierarchy.getDispatchTarget(
+          hierarchy.rootClass, new Name("noSuchMethod"));
+      ConstructorInvocation invocation = _createInvocation(
+          methodNameUsed, methodArguments, isSuper, new ThisExpression());
+      ConstructorInvocation invocationPrime = _createInvocation("noSuchMethod",
+          new Arguments([invocation]), false, new ThisExpression());
+      return new DirectMethodInvocation(
+          new ThisExpression(), noSuchMethod, new Arguments([invocationPrime]))
+        ..fileOffset = node.fileOffset;
+    }
+  }
+
+  /// Creates an "new _InvocationMirror(...)" invocation.
+  ConstructorInvocation _createInvocation(String methodName,
+      Arguments callArguments, bool isSuperInvocation, Expression receiver) {
+    if (_invocationMirrorConstructor == null) {
+      Class clazz = coreTypes.getCoreClass('dart:core', '_InvocationMirror');
+      _invocationMirrorConstructor = clazz.constructors[0];
+    }
+
+    // The _InvocationMirror constructor takes the following arguments:
+    // * Method name (a string).
+    // * An arguments descriptor - a list consisting of:
+    //   - number of arguments (including receiver).
+    //   - number of positional arguments (including receiver).
+    //   - pairs (2 entries in the list) of
+    //     * named arguments name.
+    //     * index of named argument in arguments list.
+    // * A list of arguments, where the first ones are the positional arguments.
+    // * Whether it's a super invocation or not.
+
+    int numPositionalArguments = callArguments.positional.length + 1;
+    int numArguments = numPositionalArguments + callArguments.named.length;
+    List<Expression> argumentsDescriptor = [
+      new IntLiteral(numArguments),
+      new IntLiteral(numPositionalArguments)
+    ];
+    List<Expression> arguments = [];
+    arguments.add(receiver);
+    for (Expression pos in callArguments.positional) {
+      arguments.add(pos);
+    }
+    for (NamedExpression named in callArguments.named) {
+      argumentsDescriptor.add(new StringLiteral(named.name));
+      argumentsDescriptor.add(new IntLiteral(arguments.length));
+      arguments.add(named.value);
+    }
+
+    return new ConstructorInvocation(
+        _invocationMirrorConstructor,
+        new Arguments([
+          new StringLiteral(methodName),
+          _fixedLengthList(argumentsDescriptor),
+          _fixedLengthList(arguments),
+          new BoolLiteral(isSuperInvocation)
+        ]));
+  }
+
+  /// Create a fixed length list containing given expressions.
+  Expression _fixedLengthList(List<Expression> list) {
+    if (_listFrom == null) {
+      Class clazz = coreTypes.getCoreClass('dart:core', 'List');
+      _listFrom = clazz.procedures.firstWhere((c) => c.name.name == "from");
+    }
+    return new StaticInvocation(
+        _listFrom,
+        new Arguments([new ListLiteral(list)],
+            named: [new NamedExpression("growable", new BoolLiteral(false))]));
+  }
+
+  /// Check that a call to the targetFunction is legal given the arguments.
+  ///
+  /// I.e. check that the number of positional parameters and the names of the
+  /// given named parameters represents a valid call to the function.
+  bool _callIsLegal(FunctionNode targetFunction, Arguments arguments) {
+    if ((targetFunction.requiredParameterCount > arguments.positional.length) ||
+        (targetFunction.positionalParameters.length <
+            arguments.positional.length)) {
+      // Given too few or too many positional arguments
+      return false;
+    }
+
+    // Do we give named that we don't take?
+    Set<String> givenNamed = arguments.named.map((v) => v.name).toSet();
+    Set<String> takenNamed =
+        targetFunction.namedParameters.map((v) => v.name).toSet();
+    givenNamed.removeAll(takenNamed);
+    return givenNamed.isEmpty;
+  }
+}
+
+class SuperInitializerResolutionTransformer extends InitializerVisitor {
+  final Class lookupClass;
+
+  SuperInitializerResolutionTransformer(this.lookupClass);
+
+  transformInitializers(List<Initializer> initializers) {
+    for (var initializer in initializers) {
+      initializer.accept(this);
+    }
+  }
+
+  visitSuperInitializer(SuperInitializer node) {
+    Constructor constructor = node.target;
+    if (constructor.enclosingClass != lookupClass) {
+      // If [node] refers to a constructor target which is not directly the
+      // superclass but some indirect base class then this is because classes in
+      // the middle are mixin applications.  These mixin applications will have
+      // received a forwarding constructor which we are required to use instead.
+      for (var replacement in lookupClass.constructors) {
+        if (constructor.name == replacement.name) {
+          node.target = replacement;
+          return null;
+        }
+      }
+
+      throw new Exception(
+          'Could not find a generative constructor named "${constructor.name}" '
+          'in lookup class "${lookupClass.name}"!');
+    }
+  }
+}
diff --git a/pkg/kernel/lib/transformations/sanitize_for_vm.dart b/pkg/kernel/lib/transformations/sanitize_for_vm.dart
new file mode 100644
index 0000000..f5f86c3
--- /dev/null
+++ b/pkg/kernel/lib/transformations/sanitize_for_vm.dart
@@ -0,0 +1,23 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.transformations.fixvm;
+
+import '../ast.dart';
+
+/// Ensures that classes all have either a constructor or a procedure.
+///
+/// VM-specific constraints that don't fit in anywhere else can be put here.
+class SanitizeForVM {
+  void transform(Program program) {
+    for (var library in program.libraries) {
+      for (var class_ in library.classes) {
+        if (class_.constructors.isEmpty && class_.procedures.isEmpty) {
+          class_.addMember(new Constructor(
+              new FunctionNode(new InvalidStatement()),
+              name: new Name('')));
+        }
+      }
+    }
+  }
+}
diff --git a/pkg/kernel/lib/transformations/setup_builtin_library.dart b/pkg/kernel/lib/transformations/setup_builtin_library.dart
new file mode 100644
index 0000000..cc4149a
--- /dev/null
+++ b/pkg/kernel/lib/transformations/setup_builtin_library.dart
@@ -0,0 +1,45 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.transformations.setup_builtin_library;
+
+import '../ast.dart';
+
+// The DartVM has a special `dart:_builtin` library which exposes a
+// `_getMainClosure()` method.  We need to change this method to return a
+// closure of `main()`.
+Program transformProgram(Program program,
+    {String libraryUri: 'dart:_builtin'}) {
+  Procedure mainMethod = program.mainMethod;
+
+  Library builtinLibrary;
+  for (Library library in program.libraries) {
+    if (library.importUri.toString() == libraryUri) {
+      builtinLibrary = library;
+      break;
+    }
+  }
+
+  if (builtinLibrary == null) {
+    throw new Exception('Could not find "dart:_builtin" library');
+  }
+
+  FunctionNode getMainClosure;
+  for (Procedure procedure in builtinLibrary.procedures) {
+    if (procedure.name.name == '_getMainClosure') {
+      getMainClosure = procedure.function;
+      break;
+    }
+  }
+
+  if (getMainClosure == null) {
+    throw new Exception('Could not find "_getMainClosure" in "$libraryUri"');
+  }
+
+  var returnMainStatement = new ReturnStatement(new StaticGet(mainMethod));
+  getMainClosure.body = returnMainStatement;
+  returnMainStatement.parent = getMainClosure;
+
+  return program;
+}
diff --git a/pkg/kernel/lib/transformations/treeshaker.dart b/pkg/kernel/lib/transformations/treeshaker.dart
new file mode 100644
index 0000000..bd33595
--- /dev/null
+++ b/pkg/kernel/lib/transformations/treeshaker.dart
@@ -0,0 +1,779 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.tree_shaker;
+
+import '../ast.dart';
+import '../class_hierarchy.dart';
+import '../core_types.dart';
+
+Program transformProgram(Program program) {
+  new TreeShaker(program).transform(program);
+  return program;
+}
+
+/// Tree shaking based on class hierarchy analysis.
+///
+/// Any dynamic dispatch not on `this` is conservatively assumed to target
+/// any instantiated class that implements a member matching the selector.
+///
+/// Member bodies are analyzed relative to a given "host class" which is the
+/// concrete type of `this` (or null if in static context), so dispatches on
+/// `this` can be resolved more precisely.
+///
+/// The tree shaker computes the following in a fixed-point iteration:
+/// - a set of instantiated classes
+/// - for each member, a set of potential host classes
+/// - a set of names used in dynamic dispatch not on `this`
+///
+/// The `dart:mirrors` library is not supported.
+//
+// TODO(asgerf): Shake off parts of the core libraries based on the Target.
+// TODO(asgerf): Tree shake unused instance fields.
+class TreeShaker {
+  final Program program;
+  final ClassHierarchy hierarchy;
+  final CoreTypes coreTypes;
+
+  /// Names used in a dynamic dispatch invocation that could not be resolved
+  /// to a concrete target (i.e. not on `this`).
+  final Set<Name> _dispatchedNames = new Set<Name>();
+
+  /// Instance members that are potential targets for dynamic dispatch, but
+  /// whose name has not yet been seen in a dynamic dispatch invocation.
+  ///
+  /// The map is indexed by the name of the member, and value is a list of
+  /// interleaved (host class, member) pairs.
+  final Map<Name, List<TreeNode>> _dispatchTargetCandidates =
+      <Name, List<TreeNode>>{};
+
+  /// Map from classes to the set of members that are reachable with that
+  /// class as host.
+  ///
+  /// The map is implemented as a list, indexed according to
+  /// [ClassHierarchy.getClassIndex].
+  final List<Set<Member>> _usedMembersWithHost;
+
+  /// Map from used members (regardless of host) to a summary object describing
+  /// how the member invokes other members on `this`.
+  ///
+  /// The summary object is a heterogenous list containing the [Member]s that
+  /// are invoked using `super` and the [Name]s that are dispatched on `this`.
+  ///
+  /// Names that are dispatched as a setter are preceded by the
+  /// [_setterSentinel] object, to distinguish them from getter/call names.
+  final Map<Member, List<Node>> _usedMembers = <Member, List<Node>>{};
+
+  /// The level to which a class must be retained after tree shaking.
+  ///
+  /// See [ClassRetention].
+  final List<ClassRetention> _classRetention;
+
+  /// Interleaved (host class, member) pairs that are reachable but have not yet
+  /// been analyzed for more uses.
+  final List<TreeNode> _worklist = new List<TreeNode>();
+
+  /// Classes whose interface can be used by external code to invoke user code.
+  final Set<Class> _escapedClasses = new Set<Class>();
+
+  /// AST visitor for finding static uses and dynamic dispatches in code.
+  _TreeShakerVisitor _visitor;
+
+  /// AST visitor for analyzing type annotations on external members.
+  _ExternalTypeVisitor _covariantVisitor;
+  _ExternalTypeVisitor _contravariantVisitor;
+  _ExternalTypeVisitor _bivariantVisitor;
+
+  TreeShaker(Program program, {ClassHierarchy hierarchy, CoreTypes coreTypes})
+      : this._internal(program, hierarchy ?? new ClassHierarchy(program),
+            coreTypes ?? new CoreTypes(program));
+
+  bool isMemberUsed(Member member) {
+    return _usedMembers.containsKey(member);
+  }
+
+  bool isInstantiated(Class classNode) {
+    return getClassRetention(classNode).index >= ClassRetention.Instance.index;
+  }
+
+  bool isHierarchyUsed(Class classNode) {
+    return getClassRetention(classNode).index >= ClassRetention.Hierarchy.index;
+  }
+
+  ClassRetention getClassRetention(Class classNode) {
+    int index = hierarchy.getClassIndex(classNode);
+    return _classRetention[index];
+  }
+
+  /// Applies the tree shaking results to the program.
+  ///
+  /// This removes unused classes, members, and hierarchy data.
+  void transform(Program program) {
+    new _TreeShakingTransformer(this).transform(program);
+  }
+
+  TreeShaker._internal(this.program, ClassHierarchy hierarchy, this.coreTypes)
+      : this.hierarchy = hierarchy,
+        this._usedMembersWithHost =
+            new List<Set<Member>>(hierarchy.classes.length),
+        this._classRetention = new List<ClassRetention>.filled(
+            hierarchy.classes.length, ClassRetention.None) {
+    _visitor = new _TreeShakerVisitor(this);
+    _covariantVisitor = new _ExternalTypeVisitor(this, isCovariant: true);
+    _contravariantVisitor =
+        new _ExternalTypeVisitor(this, isContravariant: true);
+    _bivariantVisitor = new _ExternalTypeVisitor(this,
+        isCovariant: true, isContravariant: true);
+    _build();
+  }
+
+  void _build() {
+    if (program.mainMethod == null) {
+      throw 'Cannot perform tree shaking on a program without a main method';
+    }
+    if (program.mainMethod.function.positionalParameters.length > 0) {
+      // The main method takes a List<String> as argument.
+      _addInstantiatedExternalSubclass(coreTypes.listClass);
+      _addInstantiatedExternalSubclass(coreTypes.stringClass);
+    }
+    _addDispatchedName(new Name('noSuchMethod'));
+    _addPervasiveUses();
+    _addUsedMember(null, program.mainMethod);
+    _iterateWorklist();
+  }
+
+  /// Registers some extremely commonly used core classes as instantiated, so
+  /// we don't have to register them for every use we find.
+  void _addPervasiveUses() {
+    _addInstantiatedExternalSubclass(coreTypes.stringClass);
+    _addInstantiatedExternalSubclass(coreTypes.intClass);
+    _addInstantiatedExternalSubclass(coreTypes.boolClass);
+    _addInstantiatedExternalSubclass(coreTypes.nullClass);
+  }
+
+  /// Registers the given name as seen in a dynamic dispatch, and discovers used
+  /// instance members accordingly.
+  void _addDispatchedName(Name name) {
+    // TODO(asgerf): make use of selector arity and getter/setter kind
+    if (_dispatchedNames.add(name)) {
+      List<TreeNode> targets = _dispatchTargetCandidates[name];
+      if (targets != null) {
+        for (int i = 0; i < targets.length; i += 2) {
+          _addUsedMember(targets[i], targets[i + 1]);
+        }
+      }
+    }
+  }
+
+  /// Registers the given method as a potential target of dynamic dispatch on
+  /// the given class.
+  void _addDispatchTarget(Class host, Member member) {
+    if (_dispatchedNames.contains(member.name)) {
+      _addUsedMember(host, member);
+    } else {
+      _dispatchTargetCandidates.putIfAbsent(member.name, _makeTreeNodeList)
+        ..add(host)
+        ..add(member);
+    }
+  }
+
+  static List<TreeNode> _makeTreeNodeList() => <TreeNode>[];
+
+  /// Registers the given class as instantiated and discovers new dispatch
+  /// target candidates accordingly.
+  void _addInstantiatedClass(Class classNode) {
+    int index = hierarchy.getClassIndex(classNode);
+    ClassRetention retention = _classRetention[index];
+    if (retention.index < ClassRetention.Instance.index) {
+      _classRetention[index] = ClassRetention.Instance;
+      _propagateClassInstanceLevel(classNode, retention);
+    }
+  }
+
+  /// Register that an external subclass of the given class may be instantiated.
+  void _addInstantiatedExternalSubclass(Class classNode) {
+    int index = hierarchy.getClassIndex(classNode);
+    ClassRetention retention = _classRetention[index];
+    if (retention.index < ClassRetention.ExternalInstance.index) {
+      _classRetention[index] = ClassRetention.ExternalInstance;
+      _propagateClassExternalInstanceLevel(classNode, retention);
+    }
+  }
+
+  void _propagateClassExternalInstanceLevel(
+      Class classNode, ClassRetention oldRetention) {
+    if (oldRetention.index >= ClassRetention.ExternalInstance.index) {
+      return;
+    }
+    _propagateClassInstanceLevel(classNode, oldRetention);
+    for (Member member in hierarchy.getInterfaceMembers(classNode)) {
+      if (member is Field) {
+        _covariantVisitor.visit(member.type);
+      } else {
+        _addCallToExternalProcedure(member);
+      }
+    }
+  }
+
+  /// Called when the retention level for [classNode] has been raised from
+  /// [oldRetention] to instance level.
+  ///
+  /// Ensures that the relevant members are put in the worklist, and super types
+  /// and raised to hierarchy level.
+  void _propagateClassInstanceLevel(
+      Class classNode, ClassRetention oldRetention) {
+    if (oldRetention.index >= ClassRetention.Instance.index) {
+      return;
+    }
+    _propagateClassHierarchyLevel(classNode, oldRetention);
+    for (Member member in hierarchy.getDispatchTargets(classNode)) {
+      _addDispatchTarget(classNode, member);
+    }
+    for (Member member
+        in hierarchy.getDispatchTargets(classNode, setters: true)) {
+      _addDispatchTarget(classNode, member);
+    }
+    // TODO(asgerf): Shake off unused instance fields.
+    // For now, just register them all inherited fields as used to ensure the
+    // effects of their initializers are taken into account.  To shake a field,
+    // we still need to preserve the side effects of the initializer.
+    for (Class node = classNode; node != null; node = node.superclass) {
+      for (Field field in node.mixin.fields) {
+        if (!field.isStatic) {
+          _addUsedMember(classNode, field);
+        }
+      }
+    }
+  }
+
+  /// Called when the retention level for [classNode] has been raised from
+  /// [oldRetention] to hierarchy level or higher.
+  ///
+  /// Ensure that all super types and type parameter bounds are also raised
+  /// to hierarchy level.
+  void _propagateClassHierarchyLevel(
+      Class classNode, ClassRetention oldRetention) {
+    if (oldRetention.index >= ClassRetention.Hierarchy.index) {
+      return;
+    }
+    _propagateClassNamespaceLevel(classNode, oldRetention);
+    var visitor = _visitor;
+    classNode.supertype?.accept(visitor);
+    classNode.mixedInType?.accept(visitor);
+    visitList(classNode.implementedTypes, visitor);
+    visitList(classNode.typeParameters, visitor);
+  }
+
+  /// Called when the retention level for [classNode] has been raised from
+  /// [oldRetention] to namespace level or higher.
+  ///
+  /// Ensures that all annotations on the class are analyzed.
+  void _propagateClassNamespaceLevel(
+      Class classNode, ClassRetention oldRetention) {
+    if (oldRetention.index >= ClassRetention.Namespace.index) {
+      return;
+    }
+    visitList(classNode.annotations, _visitor);
+  }
+
+  /// Registers the given class as being used in a type annotation.
+  void _addClassUsedInType(Class classNode) {
+    int index = hierarchy.getClassIndex(classNode);
+    ClassRetention retention = _classRetention[index];
+    if (retention.index < ClassRetention.Hierarchy.index) {
+      _classRetention[index] = ClassRetention.Hierarchy;
+      _propagateClassHierarchyLevel(classNode, retention);
+    }
+  }
+
+  /// Registers the given class or library as containing static members.
+  void _addStaticNamespace(TreeNode container) {
+    assert(container is Class || container is Library);
+    if (container is Class) {
+      int index = hierarchy.getClassIndex(container);
+      var oldRetention = _classRetention[index];
+      if (oldRetention == ClassRetention.None) {
+        _classRetention[index] = ClassRetention.Namespace;
+        _propagateClassNamespaceLevel(container, oldRetention);
+      }
+    }
+  }
+
+  /// Registers the given member as being used, in the following sense:
+  /// - Fields are used if they can be read or written or their initializer is
+  ///   evaluated.
+  /// - Constructors are used if they can be invoked, either directly or through
+  ///   the initializer list of another constructor.
+  /// - Procedures are used if they can be invoked or torn off.
+  void _addUsedMember(Class host, Member member) {
+    if (host != null) {
+      // Check if the member has been seen with this host before.
+      int index = hierarchy.getClassIndex(host);
+      Set<Member> members = _usedMembersWithHost[index] ??= new Set<Member>();
+      if (!members.add(member)) return;
+      _usedMembers.putIfAbsent(member, _makeIncompleteSummary);
+    } else {
+      // Check if the member has been seen before.
+      if (_usedMembers.containsKey(member)) return;
+      _usedMembers[member] = _makeIncompleteSummary();
+      if (member is! Constructor) {
+        _addStaticNamespace(member.parent);
+      }
+    }
+    _worklist..add(host)..add(member);
+    if (member is Procedure && member.isExternal) {
+      _addCallToExternalProcedure(member);
+    }
+  }
+
+  /// Models the impact of a call from user code to an external implementation
+  /// of [member] based on its type annotations.
+  ///
+  /// Types in covariant position are assumed to be instantiated externally,
+  /// and types in contravariant position are assumed to have their methods
+  /// invoked by the external code.
+  void _addCallToExternalProcedure(Procedure member) {
+    FunctionNode function = member.function;
+    _covariantVisitor.visit(function.returnType);
+    for (int i = 0; i < function.positionalParameters.length; ++i) {
+      _contravariantVisitor.visit(function.positionalParameters[i].type);
+    }
+    for (int i = 0; i < function.namedParameters.length; ++i) {
+      _contravariantVisitor.visit(function.namedParameters[i].type);
+    }
+  }
+
+  /// Called when external code may invoke the interface of the given class.
+  void _addEscapedClass(Class node) {
+    if (!_escapedClasses.add(node)) return;
+    for (Member member in hierarchy.getInterfaceMembers(node)) {
+      if (member is Procedure) {
+        _addDispatchedName(member.name);
+      }
+    }
+  }
+
+  /// Creates a incomplete summary object, indicating that a member has not
+  /// yet been analyzed.
+  static List<Node> _makeIncompleteSummary() => <Node>[null];
+
+  bool isIncompleteSummary(List<Node> summary) {
+    return summary.isNotEmpty && summary[0] == null;
+  }
+
+  void _iterateWorklist() {
+    while (_worklist.isNotEmpty) {
+      // Get the host and member.
+      Member member = _worklist.removeLast();
+      Class host = _worklist.removeLast();
+
+      // Analyze the method body if we have not done so before.
+      List<Node> summary = _usedMembers[member];
+      if (isIncompleteSummary(summary)) {
+        summary.clear();
+        _visitor.analyzeAndBuildSummary(member, summary);
+      }
+
+      // Apply the summary in the context of this host.
+      for (int i = 0; i < summary.length; ++i) {
+        Node summaryNode = summary[i];
+        if (summaryNode is Member) {
+          _addUsedMember(host, summaryNode);
+        } else if (summaryNode is Name) {
+          Member target = hierarchy.getDispatchTarget(host, summaryNode);
+          if (target != null) {
+            _addUsedMember(host, target);
+          }
+        } else if (identical(summaryNode, _setterSentinel)) {
+          Name name = summary[++i];
+          Member target = hierarchy.getDispatchTarget(host, name, setter: true);
+          if (target != null) {
+            _addUsedMember(host, target);
+          }
+        } else {
+          throw 'Unexpected summary node: $summaryNode';
+        }
+      }
+    }
+  }
+
+  String getDiagnosticString() {
+    return """
+dispatchNames: ${_dispatchedNames.length}
+dispatchTargetCandidates.keys: ${_dispatchTargetCandidates.length}
+usedMembersWithHost: ${_usedMembersWithHost.length}
+usedMembers: ${_usedMembers.length}
+classRetention: ${_classRetention.length}
+escapedClasses: ${_escapedClasses.length}
+""";
+  }
+}
+
+/// Sentinel that occurs in method summaries in front of each name that should
+/// be interpreted as a setter.
+final Node _setterSentinel = const InvalidType();
+
+/// Searches the AST for static references and dynamically dispatched names.
+class _TreeShakerVisitor extends RecursiveVisitor {
+  final TreeShaker shaker;
+  final CoreTypes coreTypes;
+  List<Node> summary;
+
+  _TreeShakerVisitor(TreeShaker shaker)
+      : this.shaker = shaker,
+        this.coreTypes = shaker.coreTypes;
+
+  void analyzeAndBuildSummary(Node node, List<Node> summary) {
+    this.summary = summary;
+    node.accept(this);
+  }
+
+  @override
+  visitFunctionNode(FunctionNode node) {
+    switch (node.asyncMarker) {
+      case AsyncMarker.Sync:
+        break;
+      case AsyncMarker.SyncStar:
+        shaker._addInstantiatedExternalSubclass(coreTypes.iterableClass);
+        break;
+      case AsyncMarker.Async:
+        shaker._addInstantiatedExternalSubclass(coreTypes.futureClass);
+        break;
+      case AsyncMarker.AsyncStar:
+        shaker._addInstantiatedExternalSubclass(coreTypes.streamClass);
+        break;
+      case AsyncMarker.SyncYielding:
+        break;
+    }
+    node.visitChildren(this);
+  }
+
+  void addUseFrom(Member target, Class from) {
+    shaker._addUsedMember(from, target);
+  }
+
+  void addUseFromCurrentHost(Member target) {
+    summary.add(target);
+  }
+
+  void addStaticUse(Member target) {
+    shaker._addUsedMember(null, target);
+  }
+
+  void addSelfDispatch(Name name, {bool setter: false}) {
+    if (setter) {
+      summary..add(_setterSentinel)..add(name);
+    } else {
+      summary.add(name);
+    }
+  }
+
+  @override
+  visitSuperInitializer(SuperInitializer node) {
+    addUseFromCurrentHost(node.target);
+    node.visitChildren(this);
+  }
+
+  @override
+  visitRedirectingInitializer(RedirectingInitializer node) {
+    addUseFromCurrentHost(node.target);
+    node.visitChildren(this);
+  }
+
+  @override
+  visitConstructorInvocation(ConstructorInvocation node) {
+    shaker._addInstantiatedClass(node.target.enclosingClass);
+    addUseFrom(node.target, node.target.enclosingClass);
+    node.visitChildren(this);
+  }
+
+  @override
+  visitStaticInvocation(StaticInvocation node) {
+    addStaticUse(node.target);
+    node.visitChildren(this);
+  }
+
+  @override
+  visitDirectMethodInvocation(DirectMethodInvocation node) {
+    if (node.receiver is! ThisExpression) {
+      // TODO(asgerf): Support arbitrary direct calls.
+      throw 'Direct calls are only supported on "this"';
+    }
+    addUseFromCurrentHost(node.target);
+    node.visitChildren(this);
+  }
+
+  @override
+  visitMethodInvocation(MethodInvocation node) {
+    if (node.receiver is ThisExpression) {
+      addSelfDispatch(node.name);
+    } else {
+      shaker._addDispatchedName(node.name);
+    }
+    node.visitChildren(this);
+  }
+
+  @override
+  visitStaticGet(StaticGet node) {
+    addStaticUse(node.target);
+    node.visitChildren(this);
+  }
+
+  @override
+  visitStaticSet(StaticSet node) {
+    addStaticUse(node.target);
+    node.visitChildren(this);
+  }
+
+  @override
+  visitDirectPropertyGet(DirectPropertyGet node) {
+    if (node.receiver is! ThisExpression) {
+      // TODO(asgerf): Support arbitrary direct calls.
+      throw 'Direct calls are only supported on "this"';
+    }
+    addUseFromCurrentHost(node.target);
+    node.visitChildren(this);
+  }
+
+  @override
+  visitDirectPropertySet(DirectPropertySet node) {
+    if (node.receiver is! ThisExpression) {
+      // TODO(asgerf): Support arbitrary direct calls.
+      throw 'Direct calls are only supported on "this"';
+    }
+    addUseFromCurrentHost(node.target);
+    node.visitChildren(this);
+  }
+
+  @override
+  visitPropertyGet(PropertyGet node) {
+    if (node.receiver is ThisExpression) {
+      addSelfDispatch(node.name);
+    } else {
+      shaker._addDispatchedName(node.name);
+    }
+    node.visitChildren(this);
+  }
+
+  @override
+  visitPropertySet(PropertySet node) {
+    if (node.receiver is ThisExpression) {
+      addSelfDispatch(node.name, setter: true);
+    } else {
+      shaker._addDispatchedName(node.name);
+    }
+    node.visitChildren(this);
+  }
+
+  @override
+  visitListLiteral(ListLiteral node) {
+    shaker._addInstantiatedExternalSubclass(coreTypes.listClass);
+    node.visitChildren(this);
+  }
+
+  @override
+  visitMapLiteral(MapLiteral node) {
+    shaker._addInstantiatedExternalSubclass(coreTypes.mapClass);
+    node.visitChildren(this);
+  }
+
+  static final Name _toStringName = new Name('toString');
+
+  @override
+  visitStringConcatenation(StringConcatenation node) {
+    shaker._addDispatchedName(_toStringName);
+    node.visitChildren(this);
+  }
+
+  @override
+  visitInterfaceType(InterfaceType node) {
+    shaker._addClassUsedInType(node.classNode);
+    node.visitChildren(this);
+  }
+
+  @override
+  visitDoubleLiteral(DoubleLiteral node) {
+    shaker._addInstantiatedExternalSubclass(coreTypes.doubleClass);
+  }
+
+  @override
+  visitSymbolLiteral(SymbolLiteral node) {
+    shaker._addInstantiatedExternalSubclass(coreTypes.symbolClass);
+    // Note: we do not support 'dart:mirrors' right now, so nothing else needs
+    // to be done for symbols.
+  }
+
+  @override
+  visitTypeLiteral(TypeLiteral node) {
+    shaker._addInstantiatedExternalSubclass(coreTypes.typeClass);
+    node.visitChildren(this);
+  }
+}
+
+/// The degree to which a class is needed in a program.
+///
+/// Each level implies those before it.
+enum ClassRetention {
+  /// The class can be removed.
+  None,
+
+  /// The class contains used static members but is otherwise unused.
+  Namespace,
+
+  /// The class is used in a type or has an instantiated subtype, or for some
+  /// other reason must have its hierarchy information preserved.
+  Hierarchy,
+
+  /// The class is instantiated.
+  Instance,
+
+  /// The class has an instantiated external subclass.
+  ExternalInstance,
+}
+
+/// Removes classes and members that are not needed.
+///
+/// There must not be any dangling references in the program afterwards.
+class _TreeShakingTransformer extends Transformer {
+  final TreeShaker shaker;
+
+  _TreeShakingTransformer(this.shaker);
+
+  void transform(Program program) {
+    for (var library in program.libraries) {
+      if (library.importUri.scheme == 'dart') {
+        // As long as patching happens in the backend, we cannot shake off
+        // anything in the core libraries.
+        continue;
+      }
+      library.transformChildren(this);
+      // Note: we can't shake off empty libraries yet since we don't check if
+      // there are private names that use the library.
+    }
+  }
+
+  Class visitClass(Class node) {
+    switch (shaker.getClassRetention(node)) {
+      case ClassRetention.None:
+        return null; // Remove the class.
+
+      case ClassRetention.Namespace:
+        // The class is only a namespace for static members.  Remove its
+        // hierarchy information.   This is mandatory, since these references
+        // might otherwise become dangling.
+        node.supertype = shaker.coreTypes.objectClass.asRawSupertype;
+        node.implementedTypes.clear();
+        node.typeParameters.clear();
+        // Mixin applications cannot have static members.
+        assert(node.mixedInType == null);
+        // Unused members will be removed below.
+        break;
+
+      case ClassRetention.Hierarchy:
+      case ClassRetention.Instance:
+      case ClassRetention.ExternalInstance:
+        break;
+    }
+    node.transformChildren(this);
+    if (node.constructors.isEmpty && node.procedures.isEmpty) {
+      // The VM does not like classes without any members, so ensure there is
+      // always a constructor left.
+      node.addMember(new Constructor(new FunctionNode(new EmptyStatement())));
+    }
+    return node;
+  }
+
+  Member defaultMember(Member node) {
+    if (!shaker.isMemberUsed(node)) {
+      return null; // Remove unused member.
+    }
+    return node;
+  }
+
+  TreeNode defaultTreeNode(TreeNode node) {
+    return node; // Do not traverse into other nodes.
+  }
+}
+
+class _ExternalTypeVisitor extends DartTypeVisitor {
+  final TreeShaker shaker;
+  final bool isCovariant;
+  final bool isContravariant;
+  ClassHierarchy get hierarchy => shaker.hierarchy;
+
+  _ExternalTypeVisitor(this.shaker,
+      {this.isCovariant: false, this.isContravariant: false});
+
+  void visit(DartType type) => type?.accept(this);
+
+  /// Analyze [type] with the opposite variance.
+  void visitContravariant(DartType type) {
+    if (isCovariant && isContravariant) {
+      type?.accept(this);
+    } else if (isContravariant) {
+      type?.accept(shaker._covariantVisitor);
+    } else {
+      type?.accept(shaker._contravariantVisitor);
+    }
+  }
+
+  visitCovariant(DartType type) => type?.accept(this);
+
+  visitBivariant(DartType type) => shaker._bivariantVisitor.visit(type);
+
+  visitInvalidType(InvalidType node) {}
+
+  visitDynamicType(DynamicType node) {
+    // TODO(asgerf): Find a suitable model for untyped externals, e.g. track
+    // them to the first type boundary.
+  }
+
+  visitVoidType(VoidType node) {}
+
+  visitInterfaceType(InterfaceType node) {
+    if (isCovariant) {
+      shaker._addInstantiatedExternalSubclass(node.classNode);
+    }
+    if (isContravariant) {
+      shaker._addEscapedClass(node.classNode);
+    }
+    for (int i = 0; i < node.typeArguments.length; ++i) {
+      DartType typeArgument = node.typeArguments[i];
+      // In practice we don't get much out of analyzing variance here, so
+      // just use a whitelist of classes that can be seen as covariant
+      // for external purposes.
+      // TODO(asgerf): Variance analysis might pay off for other external APIs.
+      if (isWhitelistedCovariant(node.classNode)) {
+        visitCovariant(typeArgument);
+      } else {
+        visitBivariant(typeArgument);
+      }
+    }
+  }
+
+  visitFunctionType(FunctionType node) {
+    visit(node.returnType);
+    for (int i = 0; i < node.positionalParameters.length; ++i) {
+      visitContravariant(node.positionalParameters[i]);
+    }
+    for (int i = 0; i < node.namedParameters.length; ++i) {
+      visitContravariant(node.namedParameters[i].type);
+    }
+  }
+
+  visitTypeParameterType(TypeParameterType node) {}
+
+  /// Just treat a couple of whitelisted classes as having covariant type
+  /// parameters.
+  bool isWhitelistedCovariant(Class classNode) {
+    if (classNode.typeParameters.isEmpty) return false;
+    CoreTypes coreTypes = shaker.coreTypes;
+    return classNode == coreTypes.iteratorClass ||
+        classNode == coreTypes.iterableClass ||
+        classNode == coreTypes.futureClass ||
+        classNode == coreTypes.streamClass ||
+        classNode == coreTypes.listClass ||
+        classNode == coreTypes.mapClass;
+  }
+}
diff --git a/pkg/kernel/lib/type_algebra.dart b/pkg/kernel/lib/type_algebra.dart
new file mode 100644
index 0000000..19508b1
--- /dev/null
+++ b/pkg/kernel/lib/type_algebra.dart
@@ -0,0 +1,643 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.type_algebra;
+
+import 'ast.dart';
+
+/// Returns a type where all occurrences of the given type parameters have been
+/// replaced with the corresponding types.
+///
+/// This will copy only the subterms of [type] that contain substituted
+/// variables; all other [DartType] objects will be reused.
+///
+/// In particular, if no variables were substituted, this is guaranteed to
+/// return the [type] instance (not a copy), so the caller may use [identical]
+/// to efficiently check if a distinct type was created.
+DartType substitute(DartType type, Map<TypeParameter, DartType> substitution) {
+  if (substitution.isEmpty) return type;
+  return Substitution.fromMap(substitution).substituteType(type);
+}
+
+/// Returns a mapping from the type parameters declared on the class of [type]
+/// to the actual type arguments provided in [type].
+///
+/// This can be passed as argument to [substitute].
+Map<TypeParameter, DartType> getSubstitutionMap(Supertype type) {
+  return type.typeArguments.isEmpty
+      ? const <TypeParameter, DartType>{}
+      : new Map<TypeParameter, DartType>.fromIterables(
+          type.classNode.typeParameters, type.typeArguments);
+}
+
+/// Like [substitute], except when a type in the [substitution] map references
+/// another substituted type variable, the mapping for that type is recursively
+/// inserted.
+///
+/// For example `Set<G>` substituted with `{T -> String, G -> List<T>}` results
+/// in `Set<List<String>>`.
+///
+/// Returns `null` if the substitution map contains a cycle reachable from a
+/// type variable in [type] (the resulting type would be infinite).
+///
+/// The [substitution] map will be mutated so that the right-hand sides may
+/// be remapped to the deeply substituted type, but only for the keys that are
+/// reachable from [type].
+///
+/// As with [substitute], this is guaranteed to return the same instance if no
+/// substitution was performed.
+DartType substituteDeep(
+    DartType type, Map<TypeParameter, DartType> substitution) {
+  if (substitution.isEmpty) return type;
+  var substitutor = new _DeepTypeSubstitutor(substitution);
+  var result = substitutor.visit(type);
+  return substitutor.isInfinite ? null : result;
+}
+
+/// Returns true if [type] contains a reference to any of the given [variables].
+///
+/// It is an error to call this with a [type] that contains a [FunctionType]
+/// that declares one of the parameters in [variables].
+bool containsTypeVariable(DartType type, Set<TypeParameter> variables) {
+  if (variables.isEmpty) return false;
+  return new _OccurrenceVisitor(variables).visit(type);
+}
+
+/// Given a set of type variables, finds a substitution of those variables such
+/// that the two given types becomes equal, or returns `null` if no such
+/// substitution exists.
+///
+/// For example, unifying `List<T>` with `List<String>`, where `T` is a
+/// quantified variable, yields the substitution `T = String`.
+///
+/// If successful, this equation holds:
+///
+///     substitute(type1, substitution) == substitute(type2, substitution)
+///
+/// The unification can fail for two reasons:
+/// - incompatible types, e.g. `List<T>` cannot be unified with `Set<T>`.
+/// - infinite types: e.g. `T` cannot be unified with `List<T>` because it
+///   would create the infinite type `List<List<List<...>>>`.
+Map<TypeParameter, DartType> unifyTypes(
+    DartType type1, DartType type2, Set<TypeParameter> quantifiedVariables) {
+  var unifier = new _TypeUnification(type1, type2, quantifiedVariables);
+  return unifier.success ? unifier.substitution : null;
+}
+
+/// Generates a fresh copy of the given type parameters, with their bounds
+/// substituted to reference the new parameters.
+///
+/// The returned object contains the fresh type parameter list as well as a
+/// mapping to be used for replacing other types to use the new type parameters.
+FreshTypeParameters getFreshTypeParameters(List<TypeParameter> typeParameters) {
+  var freshParameters = new List<TypeParameter>.generate(
+      typeParameters.length, (i) => new TypeParameter(typeParameters[i].name),
+      growable: true);
+  var map = <TypeParameter, DartType>{};
+  for (int i = 0; i < typeParameters.length; ++i) {
+    map[typeParameters[i]] = new TypeParameterType(freshParameters[i]);
+    freshParameters[i].bound = substitute(typeParameters[i].bound, map);
+  }
+  return new FreshTypeParameters(freshParameters, Substitution.fromMap(map));
+}
+
+class FreshTypeParameters {
+  final List<TypeParameter> freshTypeParameters;
+  final Substitution substitution;
+
+  FreshTypeParameters(this.freshTypeParameters, this.substitution);
+
+  DartType substitute(DartType type) => substitution.substituteType(type);
+
+  Supertype substituteSuper(Supertype type) {
+    return substitution.substituteSupertype(type);
+  }
+}
+
+// ------------------------------------------------------------------------
+//                              IMPLEMENTATION
+// ------------------------------------------------------------------------
+
+abstract class Substitution {
+  const Substitution();
+
+  static const Substitution empty = _NullSubstitution.instance;
+
+  /// Substitutes each parameter to the type it maps to in [map].
+  static Substitution fromMap(Map<TypeParameter, DartType> map) {
+    if (map.isEmpty) return _NullSubstitution.instance;
+    return new _MapSubstitution(map, map);
+  }
+
+  /// Substitutes all occurrences of the given type parameters with the
+  /// corresponding upper or lower bound, depending on the variance of the
+  /// context where it occurs.
+  ///
+  /// For example the type `(T) => T` with the bounds `bottom <: T <: num`
+  /// becomes `(bottom) => num` (in this example, `num` is the upper bound,
+  /// and `bottom` is the lower bound).
+  ///
+  /// This is a way to obtain an upper bound for a type while eliminating all
+  /// references to certain type variables.
+  static Substitution fromUpperAndLowerBounds(
+      Map<TypeParameter, DartType> upper, Map<TypeParameter, DartType> lower) {
+    if (upper.isEmpty && lower.isEmpty) return _NullSubstitution.instance;
+    return new _MapSubstitution(upper, lower);
+  }
+
+  /// Substitutes the type parameters on the class of [supertype] with the
+  /// type arguments provided in [supertype].
+  static Substitution fromSupertype(Supertype supertype) {
+    if (supertype.typeArguments.isEmpty) return _NullSubstitution.instance;
+    return fromMap(new Map<TypeParameter, DartType>.fromIterables(
+        supertype.classNode.typeParameters, supertype.typeArguments));
+  }
+
+  /// Substitutes the type parameters on the class of [type] with the
+  /// type arguments provided in [type].
+  static Substitution fromInterfaceType(InterfaceType type) {
+    if (type.typeArguments.isEmpty) return _NullSubstitution.instance;
+    return fromMap(new Map<TypeParameter, DartType>.fromIterables(
+        type.classNode.typeParameters, type.typeArguments));
+  }
+
+  /// Substitutes the Nth parameter in [parameters] with the Nth type in
+  /// [types].
+  static Substitution fromPairs(
+      List<TypeParameter> parameters, List<DartType> types) {
+    // TODO(asgerf): Investigate if it is more efficient to implement
+    // substitution based on parallel pairwise lists instead of Maps.
+    assert(parameters.length == types.length);
+    if (parameters.isEmpty) return _NullSubstitution.instance;
+    return fromMap(
+        new Map<TypeParameter, DartType>.fromIterables(parameters, types));
+  }
+
+  /// Substitutes the type parameters on the class with bottom or dynamic,
+  /// depending on the covariance of its use.
+  static Substitution bottomForClass(Class class_) {
+    if (class_.typeParameters.isEmpty) return _NullSubstitution.instance;
+    return new _ClassBottomSubstitution(class_);
+  }
+
+  /// Substitutes both variables from [first] and [second], favoring those from
+  /// [first] if they overlap.
+  ///
+  /// Neither substitution is applied to the results of the other, so this does
+  /// *not* correspond to a sequence of two subsitutions. For example, combining
+  /// `{T -> List<G>}` with `{G -> String}` does not correspond to
+  /// `{T -> List<String>}` because the result from substituting `T` is not
+  /// searched for occurences of `G`.
+  static Substitution combine(Substitution first, Substitution second) {
+    if (first == _NullSubstitution.instance) return second;
+    if (second == _NullSubstitution.instance) return first;
+    return new _CombinedSubstitution(first, second);
+  }
+
+  DartType getSubstitute(TypeParameter parameter, bool upperBound);
+
+  DartType substituteType(DartType node, {bool contravariant: false}) {
+    return new _TopSubstitutor(this, contravariant).visit(node);
+  }
+
+  Supertype substituteSupertype(Supertype node) {
+    return new _TopSubstitutor(this, false).visitSupertype(node);
+  }
+}
+
+class _NullSubstitution extends Substitution {
+  static const _NullSubstitution instance = const _NullSubstitution();
+
+  const _NullSubstitution();
+
+  DartType getSubstitute(TypeParameter parameter, bool upperBound) {
+    return new TypeParameterType(parameter);
+  }
+
+  @override
+  DartType substituteType(DartType node, {bool contravariant: false}) => node;
+
+  @override
+  Supertype substituteSupertype(Supertype node) => node;
+}
+
+class _MapSubstitution extends Substitution {
+  final Map<TypeParameter, DartType> upper;
+  final Map<TypeParameter, DartType> lower;
+
+  _MapSubstitution(this.upper, this.lower);
+
+  DartType getSubstitute(TypeParameter parameter, bool upperBound) {
+    return upperBound ? upper[parameter] : lower[parameter];
+  }
+}
+
+class _TopSubstitutor extends _TypeSubstitutor {
+  final Substitution substitution;
+
+  _TopSubstitutor(this.substitution, bool contravariant) : super(null) {
+    if (contravariant) {
+      invertVariance();
+    }
+  }
+
+  DartType lookup(TypeParameter parameter, bool upperBound) {
+    return substitution.getSubstitute(parameter, upperBound);
+  }
+
+  TypeParameter freshTypeParameter(TypeParameter node) {
+    throw 'Create a fresh environment first';
+  }
+}
+
+class _ClassBottomSubstitution extends Substitution {
+  final Class class_;
+
+  _ClassBottomSubstitution(this.class_);
+
+  DartType getSubstitute(TypeParameter parameter, bool upperBound) {
+    if (parameter.parent == class_) {
+      return upperBound ? const BottomType() : const DynamicType();
+    }
+    return null;
+  }
+}
+
+class _CombinedSubstitution extends Substitution {
+  final Substitution first, second;
+
+  _CombinedSubstitution(this.first, this.second);
+
+  DartType getSubstitute(TypeParameter parameter, bool upperBound) {
+    return first.getSubstitute(parameter, upperBound) ??
+        second.getSubstitute(parameter, upperBound);
+  }
+}
+
+class _InnerTypeSubstitutor extends _TypeSubstitutor {
+  final Map<TypeParameter, DartType> substitution = <TypeParameter, DartType>{};
+
+  _InnerTypeSubstitutor(_TypeSubstitutor outer) : super(outer);
+
+  DartType lookup(TypeParameter parameter, bool upperBound) {
+    return substitution[parameter];
+  }
+
+  TypeParameter freshTypeParameter(TypeParameter node) {
+    var fresh = new TypeParameter(node.name);
+    substitution[node] = new TypeParameterType(fresh);
+    fresh.bound = visit(node.bound);
+    return fresh;
+  }
+}
+
+abstract class _TypeSubstitutor extends DartTypeVisitor<DartType> {
+  final _TypeSubstitutor outer;
+  bool covariantContext = true;
+
+  _TypeSubstitutor(this.outer) {
+    covariantContext = outer == null ? true : outer.covariantContext;
+  }
+
+  DartType lookup(TypeParameter parameter, bool upperBound);
+
+  /// The number of times a variable from this environment has been used in
+  /// a substitution.
+  ///
+  /// There is a strict requirement that we must return the same instance for
+  /// types that were not altered by the substitution.  This counter lets us
+  /// check quickly if anything happened in a substitution.
+  int useCounter = 0;
+
+  _InnerTypeSubstitutor newInnerEnvironment() {
+    return new _InnerTypeSubstitutor(this);
+  }
+
+  void invertVariance() {
+    covariantContext = !covariantContext;
+  }
+
+  Supertype visitSupertype(Supertype node) {
+    if (node.typeArguments.isEmpty) return node;
+    int before = useCounter;
+    var typeArguments = node.typeArguments.map(visit).toList();
+    if (useCounter == before) return node;
+    return new Supertype(node.classNode, typeArguments);
+  }
+
+  NamedType visitNamedType(NamedType node) {
+    int before = useCounter;
+    var type = visit(node.type);
+    if (useCounter == before) return node;
+    return new NamedType(node.name, type);
+  }
+
+  DartType visit(DartType node) => node.accept(this);
+
+  DartType visitInvalidType(InvalidType node) => node;
+  DartType visitDynamicType(DynamicType node) => node;
+  DartType visitVoidType(VoidType node) => node;
+  DartType visitBottomType(BottomType node) => node;
+
+  DartType visitInterfaceType(InterfaceType node) {
+    if (node.typeArguments.isEmpty) return node;
+    int before = useCounter;
+    var typeArguments = node.typeArguments.map(visit).toList();
+    if (useCounter == before) return node;
+    return new InterfaceType(node.classNode, typeArguments);
+  }
+
+  List<TypeParameter> freshTypeParameters(List<TypeParameter> parameters) {
+    if (parameters.isEmpty) return const <TypeParameter>[];
+    return parameters.map(freshTypeParameter).toList();
+  }
+
+  TypeParameter freshTypeParameter(TypeParameter node);
+
+  DartType visitFunctionType(FunctionType node) {
+    // This is a bit tricky because we have to generate fresh type parameters
+    // in order to change the bounds.  At the same time, if the function type
+    // was unaltered, we have to return the [node] object (not a copy!).
+    // Substituting a type for a fresh type variable should not be confused with
+    // a "real" substitution.
+    //
+    // Create an inner environment to generate fresh type parameters.  The use
+    // counter on the inner environment tells if the fresh type parameters have
+    // any uses, but does not tell if the resulting function type is distinct.
+    // Our own use counter will get incremented if something from our
+    // environment has been used inside the function.
+    var inner = node.typeParameters.isEmpty ? this : newInnerEnvironment();
+    int before = this.useCounter;
+    // Invert the variance when translating parameters.
+    inner.invertVariance();
+    var typeParameters = inner.freshTypeParameters(node.typeParameters);
+    var positionalParameters = node.positionalParameters.isEmpty
+        ? const <DartType>[]
+        : node.positionalParameters.map(inner.visit).toList();
+    var namedParameters = node.namedParameters.isEmpty
+        ? const <NamedType>[]
+        : node.namedParameters.map(inner.visitNamedType).toList();
+    inner.invertVariance();
+    var returnType = inner.visit(node.returnType);
+    if (this.useCounter == before) return node;
+    return new FunctionType(positionalParameters, returnType,
+        namedParameters: namedParameters,
+        typeParameters: typeParameters,
+        requiredParameterCount: node.requiredParameterCount);
+  }
+
+  void bumpCountersUntil(_TypeSubstitutor target) {
+    var node = this;
+    while (node != target) {
+      ++node.useCounter;
+      node = node.outer;
+    }
+    ++target.useCounter;
+  }
+
+  DartType getSubstitute(TypeParameter variable) {
+    var environment = this;
+    while (environment != null) {
+      var replacement = environment.lookup(variable, covariantContext);
+      if (replacement != null) {
+        bumpCountersUntil(environment);
+        return replacement;
+      }
+      environment = environment.outer;
+    }
+    return null;
+  }
+
+  DartType visitTypeParameterType(TypeParameterType node) {
+    return getSubstitute(node.parameter) ?? node;
+  }
+}
+
+class _DeepTypeSubstitutor extends _InnerTypeSubstitutor {
+  int depth = 0;
+  bool isInfinite = false;
+
+  _DeepTypeSubstitutor(Map<TypeParameter, DartType> substitution,
+      [_DeepTypeSubstitutor outer])
+      : super(outer) {
+    this.substitution.addAll(substitution);
+  }
+
+  @override
+  _DeepTypeSubstitutor newInnerEnvironment() {
+    return new _DeepTypeSubstitutor(<TypeParameter, DartType>{}, this);
+  }
+
+  @override
+  DartType visitTypeParameterType(TypeParameterType node) {
+    DartType replacement = getSubstitute(node.parameter);
+    if (replacement == null) return node;
+    if (isInfinite) return replacement;
+    ++depth;
+    if (depth > substitution.length) {
+      isInfinite = true;
+      --depth;
+      return replacement;
+    } else {
+      replacement = visit(replacement);
+      // Update type to the fully fleshed-out type.
+      substitution[node.parameter] = replacement;
+      --depth;
+      return replacement;
+    }
+  }
+}
+
+class _TypeUnification {
+  // Acyclic invariant: There are no cycles in the map, that is, all types can
+  //   be resolved to finite types by substituting all contained type variables.
+  //
+  // The acyclic invariant holds everywhere except during cycle detection.
+  //
+  // It is not checked that the substitution satisfies the bound on the type
+  // parameter.
+  final Map<TypeParameter, DartType> substitution = <TypeParameter, DartType>{};
+
+  /// Variables that may be assigned freely in order to obtain unification.
+  ///
+  /// These are sometimes referred to as existentially quantified variables.
+  final Set<TypeParameter> quantifiedVariables;
+
+  /// Variables that are bound by a function type inside one of the types.
+  /// These may not occur in a substitution, because these variables are not in
+  /// scope at the existentially quantified variables.
+  ///
+  /// For example, suppose we are trying to satisfy the equation:
+  ///
+  ///     ∃S. <E>(E, S) => E  =  <E>(E, E) => E
+  ///
+  /// That is, we must choose `S` such that the generic function type
+  /// `<E>(E, S) => E` becomes `<E>(E, E) => E`.  Choosing `S = E` is not a
+  /// valid solution, because `E` is not in scope where `S` is quantified.
+  /// The two function types cannot be unified.
+  final Set<TypeParameter> _universallyQuantifiedVariables =
+      new Set<TypeParameter>();
+
+  bool success = true;
+
+  _TypeUnification(DartType type1, DartType type2, this.quantifiedVariables) {
+    _unify(type1, type2);
+    if (success && substitution.length >= 2) {
+      for (var key in substitution.keys) {
+        substitution[key] = substituteDeep(substitution[key], substitution);
+      }
+    }
+  }
+
+  DartType _substituteHead(TypeParameterType type) {
+    for (int i = 0; i <= substitution.length; ++i) {
+      DartType nextType = substitution[type.parameter];
+      if (nextType == null) return type;
+      if (nextType is TypeParameterType) {
+        type = nextType;
+      } else {
+        return nextType;
+      }
+    }
+    // The cycle should have been found by _trySubstitution when the cycle
+    // was created.
+    throw 'Unexpected cycle found during unification';
+  }
+
+  bool _unify(DartType type1, DartType type2) {
+    if (!success) return false;
+    type1 = type1 is TypeParameterType ? _substituteHead(type1) : type1;
+    type2 = type2 is TypeParameterType ? _substituteHead(type2) : type2;
+    if (type1 is DynamicType && type2 is DynamicType) return true;
+    if (type1 is VoidType && type2 is VoidType) return true;
+    if (type1 is InvalidType && type2 is InvalidType) return true;
+    if (type1 is BottomType && type2 is BottomType) return true;
+    if (type1 is InterfaceType && type2 is InterfaceType) {
+      if (type1.classNode != type2.classNode) return _fail();
+      assert(type1.typeArguments.length == type2.typeArguments.length);
+      for (int i = 0; i < type1.typeArguments.length; ++i) {
+        if (!_unify(type1.typeArguments[i], type2.typeArguments[i])) {
+          return false;
+        }
+      }
+      return true;
+    }
+    if (type1 is FunctionType && type2 is FunctionType) {
+      if (type1.typeParameters.length != type2.typeParameters.length ||
+          type1.positionalParameters.length !=
+              type2.positionalParameters.length ||
+          type1.namedParameters.length != type2.namedParameters.length ||
+          type1.requiredParameterCount != type2.requiredParameterCount) {
+        return _fail();
+      }
+      // When unifying two generic functions, transform the equation like this:
+      //
+      //    ∃S. <E>(fn1) = <T>(fn2)
+      //      ==>
+      //    ∃S. ∀G. fn1[G/E] = fn2[G/T]
+      //
+      // That is, assume some fixed identical choice of type parameters for both
+      // functions and try to unify the instantiated function types.
+      assert(!type1.typeParameters.any(quantifiedVariables.contains));
+      assert(!type2.typeParameters.any(quantifiedVariables.contains));
+      var leftInstance = <TypeParameter, DartType>{};
+      var rightInstance = <TypeParameter, DartType>{};
+      for (int i = 0; i < type1.typeParameters.length; ++i) {
+        var instantiator = new TypeParameter(type1.typeParameters[i].name);
+        var instantiatorType = new TypeParameterType(instantiator);
+        leftInstance[type1.typeParameters[i]] = instantiatorType;
+        rightInstance[type2.typeParameters[i]] = instantiatorType;
+        _universallyQuantifiedVariables.add(instantiator);
+      }
+      for (int i = 0; i < type1.typeParameters.length; ++i) {
+        var left = substitute(type1.typeParameters[i].bound, leftInstance);
+        var right = substitute(type2.typeParameters[i].bound, rightInstance);
+        if (!_unify(left, right)) return false;
+      }
+      for (int i = 0; i < type1.positionalParameters.length; ++i) {
+        var left = substitute(type1.positionalParameters[i], leftInstance);
+        var right = substitute(type2.positionalParameters[i], rightInstance);
+        if (!_unify(left, right)) return false;
+      }
+      for (int i = 0; i < type1.namedParameters.length; ++i) {
+        if (type1.namedParameters[i].name != type2.namedParameters[i].name) {
+          return false;
+        }
+        var left = substitute(type1.namedParameters[i].type, leftInstance);
+        var right = substitute(type2.namedParameters[i].type, rightInstance);
+        if (!_unify(left, right)) return false;
+      }
+      var leftReturn = substitute(type1.returnType, leftInstance);
+      var rightReturn = substitute(type2.returnType, rightInstance);
+      if (!_unify(leftReturn, rightReturn)) return false;
+      return true;
+    }
+    if (type1 is TypeParameterType &&
+        type2 is TypeParameterType &&
+        type1.parameter == type2.parameter) {
+      return true;
+    }
+    if (type1 is TypeParameterType &&
+        quantifiedVariables.contains(type1.parameter)) {
+      return _trySubstitution(type1.parameter, type2);
+    }
+    if (type2 is TypeParameterType &&
+        quantifiedVariables.contains(type2.parameter)) {
+      return _trySubstitution(type2.parameter, type1);
+    }
+    return _fail();
+  }
+
+  bool _trySubstitution(TypeParameter variable, DartType type) {
+    if (containsTypeVariable(type, _universallyQuantifiedVariables)) {
+      return _fail();
+    }
+    // Set the plain substitution first and then generate the deep
+    // substitution to detect cycles.
+    substitution[variable] = type;
+    DartType deepSubstitute = substituteDeep(type, substitution);
+    if (deepSubstitute == null) return _fail();
+    substitution[variable] = deepSubstitute;
+    return true;
+  }
+
+  bool _fail() {
+    return success = false;
+  }
+}
+
+class _OccurrenceVisitor extends DartTypeVisitor<bool> {
+  final Set<TypeParameter> variables;
+
+  _OccurrenceVisitor(this.variables);
+
+  bool visit(DartType node) => node.accept(this);
+
+  bool visitNamedType(NamedType node) {
+    return visit(node.type);
+  }
+
+  bool visitInvalidType(InvalidType node) => false;
+  bool visitDynamicType(DynamicType node) => false;
+  bool visitVoidType(VoidType node) => false;
+
+  bool visitInterfaceType(InterfaceType node) {
+    return node.typeArguments.any(visit);
+  }
+
+  bool visitFunctionType(FunctionType node) {
+    return node.typeParameters.any(handleTypeParameter) ||
+        node.positionalParameters.any(visit) ||
+        node.namedParameters.any(visitNamedType) ||
+        visit(node.returnType);
+  }
+
+  bool visitTypeParameterType(TypeParameterType node) {
+    return variables == null || variables.contains(node.parameter);
+  }
+
+  bool handleTypeParameter(TypeParameter node) {
+    assert(!variables.contains(node));
+    return node.bound.accept(this);
+  }
+}
diff --git a/pkg/kernel/lib/type_checker.dart b/pkg/kernel/lib/type_checker.dart
new file mode 100644
index 0000000..ab0351e
--- /dev/null
+++ b/pkg/kernel/lib/type_checker.dart
@@ -0,0 +1,863 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.type_checker;
+
+import 'ast.dart';
+import 'class_hierarchy.dart';
+import 'core_types.dart';
+import 'type_algebra.dart';
+import 'type_environment.dart';
+
+/// Performs strong-mode type checking on the kernel IR.
+///
+/// A concrete subclass of [TypeChecker] must implement [checkAssignable] and
+/// [fail] in order to deal with subtyping requirements and error handling.
+abstract class TypeChecker {
+  final CoreTypes coreTypes;
+  final ClassHierarchy hierarchy;
+  TypeEnvironment environment;
+
+  TypeChecker(this.coreTypes, this.hierarchy) {
+    environment = new TypeEnvironment(coreTypes, hierarchy);
+  }
+
+  void checkProgram(Program program) {
+    for (var library in program.libraries) {
+      if (library.importUri.scheme == 'dart') continue;
+      for (var class_ in library.classes) {
+        hierarchy.forEachOverridePair(class_,
+            (Member ownMember, Member superMember, bool isSetter) {
+          checkOverride(class_, ownMember, superMember, isSetter);
+        });
+      }
+    }
+    var visitor = new TypeCheckingVisitor(this, environment);
+    for (var library in program.libraries) {
+      if (library.importUri.scheme == 'dart') continue;
+      for (var class_ in library.classes) {
+        environment.thisType = class_.thisType;
+        for (var field in class_.fields) {
+          visitor.visitField(field);
+        }
+        for (var constructor in class_.constructors) {
+          visitor.visitConstructor(constructor);
+        }
+        for (var procedure in class_.procedures) {
+          visitor.visitProcedure(procedure);
+        }
+      }
+      environment.thisType = null;
+      for (var procedure in library.procedures) {
+        visitor.visitProcedure(procedure);
+      }
+      for (var field in library.fields) {
+        visitor.visitField(field);
+      }
+    }
+  }
+
+  DartType getterType(Class host, Member member) {
+    var hostType = hierarchy.getClassAsInstanceOf(host, member.enclosingClass);
+    var substitution = Substitution.fromSupertype(hostType);
+    return substitution.substituteType(member.getterType);
+  }
+
+  DartType setterType(Class host, Member member) {
+    var hostType = hierarchy.getClassAsInstanceOf(host, member.enclosingClass);
+    var substitution = Substitution.fromSupertype(hostType);
+    return substitution.substituteType(member.setterType, contravariant: true);
+  }
+
+  void checkOverride(
+      Class host, Member ownMember, Member superMember, bool isSetter) {
+    if (isSetter) {
+      checkAssignable(ownMember, setterType(host, superMember),
+          setterType(host, ownMember));
+    } else {
+      checkAssignable(ownMember, getterType(host, ownMember),
+          getterType(host, superMember));
+    }
+  }
+
+  /// Check that [from] is a subtype of [to].
+  ///
+  /// [where] is an AST node indicating roughly where the check is required.
+  void checkAssignable(TreeNode where, DartType from, DartType to);
+
+  /// Indicates that type checking failed.
+  void fail(TreeNode where, String message);
+}
+
+class TypeCheckingVisitor
+    implements
+        ExpressionVisitor<DartType>,
+        StatementVisitor<Null>,
+        MemberVisitor<Null>,
+        InitializerVisitor<Null> {
+  final TypeChecker checker;
+  final TypeEnvironment environment;
+
+  CoreTypes get coreTypes => environment.coreTypes;
+  ClassHierarchy get hierarchy => environment.hierarchy;
+  Class get currentClass => environment.thisType.classNode;
+
+  TypeCheckingVisitor(this.checker, this.environment);
+
+  void checkAssignable(TreeNode where, DartType from, DartType to) {
+    checker.checkAssignable(where, from, to);
+  }
+
+  void checkAssignableExpression(Expression from, DartType to) {
+    checker.checkAssignable(from, visitExpression(from), to);
+  }
+
+  void fail(TreeNode node, String message) {
+    checker.fail(node, message);
+  }
+
+  DartType visitExpression(Expression node) => node.accept(this);
+
+  void visitStatement(Statement node) {
+    node.accept(this);
+  }
+
+  void visitInitializer(Initializer node) {
+    node.accept(this);
+  }
+
+  defaultMember(Member node) => throw 'Unused';
+
+  DartType defaultBasicLiteral(BasicLiteral node) {
+    return defaultExpression(node);
+  }
+
+  DartType defaultExpression(Expression node) {
+    throw 'Unexpected expression ${node.runtimeType}';
+  }
+
+  defaultStatement(Statement node) {
+    throw 'Unexpected statement ${node.runtimeType}';
+  }
+
+  defaultInitializer(Initializer node) {
+    throw 'Unexpected initializer ${node.runtimeType}';
+  }
+
+  visitField(Field node) {
+    if (node.initializer != null) {
+      checkAssignableExpression(node.initializer, node.type);
+    }
+  }
+
+  visitConstructor(Constructor node) {
+    environment.returnType = null;
+    environment.yieldType = null;
+    node.initializers.forEach(visitInitializer);
+    handleFunctionNode(node.function);
+  }
+
+  visitProcedure(Procedure node) {
+    environment.returnType = _getInternalReturnType(node.function);
+    environment.yieldType = _getYieldType(node.function);
+    handleFunctionNode(node.function);
+  }
+
+  void handleFunctionNode(FunctionNode node) {
+    var oldAsyncMarker = environment.currentAsyncMarker;
+    environment.currentAsyncMarker = node.asyncMarker;
+    node.positionalParameters
+        .skip(node.requiredParameterCount)
+        .forEach(handleOptionalParameter);
+    node.namedParameters.forEach(handleOptionalParameter);
+    if (node.body != null) {
+      visitStatement(node.body);
+    }
+    environment.currentAsyncMarker = oldAsyncMarker;
+  }
+
+  void handleNestedFunctionNode(FunctionNode node) {
+    var oldReturn = environment.returnType;
+    var oldYield = environment.yieldType;
+    environment.returnType = _getInternalReturnType(node);
+    environment.yieldType = _getYieldType(node);
+    handleFunctionNode(node);
+    environment.returnType = oldReturn;
+    environment.yieldType = oldYield;
+  }
+
+  void handleOptionalParameter(VariableDeclaration parameter) {
+    if (parameter.initializer != null) {
+      checkAssignableExpression(parameter.initializer, parameter.type);
+    }
+  }
+
+  Substitution getReceiverType(
+      TreeNode access, Expression receiver, Member member) {
+    var type = visitExpression(receiver);
+    Class superclass = member.enclosingClass;
+    if (superclass.supertype == null) {
+      return Substitution.empty; // Members on Object are always accessible.
+    }
+    while (type is TypeParameterType) {
+      type = (type as TypeParameterType).parameter.bound;
+    }
+    if (type is BottomType) {
+      // The bottom type is a subtype of all types, so it should be allowed.
+      return Substitution.bottomForClass(superclass);
+    }
+    if (type is InterfaceType) {
+      // The receiver type should implement the interface declaring the member.
+      var upcastType = hierarchy.getTypeAsInstanceOf(type, superclass);
+      if (upcastType != null) {
+        return Substitution.fromInterfaceType(upcastType);
+      }
+    }
+    if (type is FunctionType && superclass == coreTypes.functionClass) {
+      assert(type.typeParameters.isEmpty);
+      return Substitution.empty;
+    }
+    // Note that we do not allow 'dynamic' here.  Dynamic calls should not
+    // have a declared interface target.
+    fail(access, '$member is not accessible on a receiver of type $type');
+    return Substitution.bottomForClass(superclass); // Continue type checking.
+  }
+
+  Substitution getSuperReceiverType(Member member) {
+    return Substitution.fromSupertype(
+        hierarchy.getClassAsInstanceOf(currentClass, member.enclosingClass));
+  }
+
+  DartType handleCall(Arguments arguments, FunctionNode function,
+      {Substitution receiver: Substitution.empty,
+      List<TypeParameter> typeParameters}) {
+    typeParameters ??= function.typeParameters;
+    if (arguments.positional.length < function.requiredParameterCount) {
+      fail(arguments, 'Too few positional arguments');
+      return const BottomType();
+    }
+    if (arguments.positional.length > function.positionalParameters.length) {
+      fail(arguments, 'Too many positional arguments');
+      return const BottomType();
+    }
+    if (arguments.types.length != typeParameters.length) {
+      fail(arguments, 'Wrong number of type arguments');
+      return const BottomType();
+    }
+    var instantiation = Substitution.fromPairs(typeParameters, arguments.types);
+    var substitution = Substitution.combine(receiver, instantiation);
+    for (int i = 0; i < typeParameters.length; ++i) {
+      var argument = arguments.types[i];
+      var bound = substitution.substituteType(typeParameters[i].bound);
+      checkAssignable(arguments, argument, bound);
+    }
+    for (int i = 0; i < arguments.positional.length; ++i) {
+      var expectedType = substitution.substituteType(
+          function.positionalParameters[i].type,
+          contravariant: true);
+      checkAssignableExpression(arguments.positional[i], expectedType);
+    }
+    for (int i = 0; i < arguments.named.length; ++i) {
+      var argument = arguments.named[i];
+      bool found = false;
+      for (int j = 0; j < function.namedParameters.length; ++j) {
+        if (argument.name == function.namedParameters[j].name) {
+          var expectedType = substitution.substituteType(
+              function.namedParameters[j].type,
+              contravariant: true);
+          checkAssignableExpression(argument.value, expectedType);
+          found = true;
+          break;
+        }
+      }
+      if (!found) {
+        fail(argument.value, 'Unexpected named parameter: ${argument.name}');
+        return const BottomType();
+      }
+    }
+    return substitution.substituteType(function.returnType);
+  }
+
+  DartType _getInternalReturnType(FunctionNode function) {
+    switch (function.asyncMarker) {
+      case AsyncMarker.Sync:
+        return function.returnType;
+
+      case AsyncMarker.Async:
+        Class container = coreTypes.futureClass;
+        DartType returnType = function.returnType;
+        if (returnType is InterfaceType && returnType.classNode == container) {
+          return returnType.typeArguments.single;
+        }
+        return const DynamicType();
+
+      case AsyncMarker.SyncStar:
+      case AsyncMarker.AsyncStar:
+      case AsyncMarker.SyncYielding:
+        return null;
+
+      default:
+        throw 'Unexpected async marker: ${function.asyncMarker}';
+    }
+  }
+
+  DartType _getYieldType(FunctionNode function) {
+    switch (function.asyncMarker) {
+      case AsyncMarker.Sync:
+      case AsyncMarker.Async:
+        return null;
+
+      case AsyncMarker.SyncStar:
+      case AsyncMarker.AsyncStar:
+        Class container = function.asyncMarker == AsyncMarker.SyncStar
+            ? coreTypes.iterableClass
+            : coreTypes.streamClass;
+        DartType returnType = function.returnType;
+        if (returnType is InterfaceType && returnType.classNode == container) {
+          return returnType.typeArguments.single;
+        }
+        return const DynamicType();
+
+      case AsyncMarker.SyncYielding:
+        return function.returnType;
+
+      default:
+        throw 'Unexpected async marker: ${function.asyncMarker}';
+    }
+  }
+
+  @override
+  DartType visitAsExpression(AsExpression node) {
+    visitExpression(node.operand);
+    return node.type;
+  }
+
+  @override
+  DartType visitAwaitExpression(AwaitExpression node) {
+    return environment.unfutureType(visitExpression(node.operand));
+  }
+
+  @override
+  DartType visitBoolLiteral(BoolLiteral node) {
+    return environment.boolType;
+  }
+
+  @override
+  DartType visitConditionalExpression(ConditionalExpression node) {
+    checkAssignableExpression(node.condition, environment.boolType);
+    checkAssignableExpression(node.then, node.staticType);
+    checkAssignableExpression(node.otherwise, node.staticType);
+    return node.staticType;
+  }
+
+  @override
+  DartType visitConstructorInvocation(ConstructorInvocation node) {
+    Constructor target = node.target;
+    Arguments arguments = node.arguments;
+    Class class_ = target.enclosingClass;
+    handleCall(arguments, target.function,
+        typeParameters: class_.typeParameters);
+    return new InterfaceType(target.enclosingClass, arguments.types);
+  }
+
+  @override
+  DartType visitDirectMethodInvocation(DirectMethodInvocation node) {
+    return handleCall(node.arguments, node.target.function,
+        receiver: getReceiverType(node, node.receiver, node.target));
+  }
+
+  @override
+  DartType visitDirectPropertyGet(DirectPropertyGet node) {
+    var receiver = getReceiverType(node, node.receiver, node.target);
+    return receiver.substituteType(node.target.getterType);
+  }
+
+  @override
+  DartType visitDirectPropertySet(DirectPropertySet node) {
+    var receiver = getReceiverType(node, node.receiver, node.target);
+    var value = visitExpression(node.value);
+    checkAssignable(node, value,
+        receiver.substituteType(node.target.setterType, contravariant: true));
+    return value;
+  }
+
+  @override
+  DartType visitDoubleLiteral(DoubleLiteral node) {
+    return environment.doubleType;
+  }
+
+  @override
+  DartType visitFunctionExpression(FunctionExpression node) {
+    handleNestedFunctionNode(node.function);
+    return node.function.functionType;
+  }
+
+  @override
+  DartType visitIntLiteral(IntLiteral node) {
+    return environment.intType;
+  }
+
+  @override
+  DartType visitInvalidExpression(InvalidExpression node) {
+    return const BottomType();
+  }
+
+  @override
+  DartType visitIsExpression(IsExpression node) {
+    visitExpression(node.operand);
+    return environment.boolType;
+  }
+
+  @override
+  DartType visitLet(Let node) {
+    var value = visitExpression(node.variable.initializer);
+    if (node.variable.type is DynamicType) {
+      node.variable.type = value;
+    }
+    return visitExpression(node.body);
+  }
+
+  @override
+  DartType visitListLiteral(ListLiteral node) {
+    for (var item in node.expressions) {
+      checkAssignableExpression(item, node.typeArgument);
+    }
+    return environment.literalListType(node.typeArgument);
+  }
+
+  @override
+  DartType visitLogicalExpression(LogicalExpression node) {
+    checkAssignableExpression(node.left, environment.boolType);
+    checkAssignableExpression(node.right, environment.boolType);
+    return environment.boolType;
+  }
+
+  @override
+  DartType visitMapLiteral(MapLiteral node) {
+    for (var entry in node.entries) {
+      checkAssignableExpression(entry.key, node.keyType);
+      checkAssignableExpression(entry.value, node.valueType);
+    }
+    return environment.literalMapType(node.keyType, node.valueType);
+  }
+
+  DartType handleDynamicCall(DartType receiver, Arguments arguments) {
+    arguments.positional.forEach(visitExpression);
+    arguments.named.forEach((NamedExpression n) => visitExpression(n.value));
+    return const DynamicType();
+  }
+
+  DartType handleFunctionCall(
+      TreeNode access, FunctionType function, Arguments arguments) {
+    if (function.requiredParameterCount > arguments.positional.length) {
+      fail(access, 'Too few positional arguments');
+      return const BottomType();
+    }
+    if (function.positionalParameters.length < arguments.positional.length) {
+      fail(access, 'Too many positional arguments');
+      return const BottomType();
+    }
+    if (function.typeParameters.length != arguments.types.length) {
+      fail(access, 'Wrong number of type arguments');
+      return const BottomType();
+    }
+    var instantiation =
+        Substitution.fromPairs(function.typeParameters, arguments.types);
+    for (int i = 0; i < arguments.positional.length; ++i) {
+      var expectedType = instantiation.substituteType(
+          function.positionalParameters[i],
+          contravariant: true);
+      checkAssignableExpression(arguments.positional[i], expectedType);
+    }
+    for (int i = 0; i < arguments.named.length; ++i) {
+      var argument = arguments.named[i];
+      bool found = false;
+      for (int j = 0; j < function.namedParameters.length; ++j) {
+        if (argument.name == function.namedParameters[j].name) {
+          var expectedType = instantiation.substituteType(
+              function.namedParameters[j].type,
+              contravariant: true);
+          checkAssignableExpression(argument.value, expectedType);
+          found = true;
+          break;
+        }
+      }
+      if (!found) {
+        fail(argument.value, 'Unexpected named parameter: ${argument.name}');
+        return const BottomType();
+      }
+    }
+    return instantiation.substituteType(function.returnType);
+  }
+
+  @override
+  DartType visitMethodInvocation(MethodInvocation node) {
+    var target = node.interfaceTarget;
+    if (target == null) {
+      var receiver = visitExpression(node.receiver);
+      if (node.name.name == '==') {
+        visitExpression(node.arguments.positional.single);
+        return environment.boolType;
+      }
+      if (node.name.name == 'call' && receiver is FunctionType) {
+        return handleFunctionCall(node, receiver, node.arguments);
+      }
+      return handleDynamicCall(receiver, node.arguments);
+    } else if (environment.isOverloadedArithmeticOperator(target)) {
+      assert(node.arguments.positional.length == 1);
+      var receiver = visitExpression(node.receiver);
+      var argument = visitExpression(node.arguments.positional[0]);
+      return environment.getTypeOfOverloadedArithmetic(receiver, argument);
+    } else {
+      return handleCall(node.arguments, target.function,
+          receiver: getReceiverType(node, node.receiver, node.interfaceTarget));
+    }
+  }
+
+  @override
+  DartType visitPropertyGet(PropertyGet node) {
+    if (node.interfaceTarget == null) {
+      visitExpression(node.receiver);
+      return const DynamicType();
+    } else {
+      var receiver = getReceiverType(node, node.receiver, node.interfaceTarget);
+      return receiver.substituteType(node.interfaceTarget.getterType);
+    }
+  }
+
+  @override
+  DartType visitPropertySet(PropertySet node) {
+    var value = visitExpression(node.value);
+    if (node.interfaceTarget != null) {
+      var receiver = getReceiverType(node, node.receiver, node.interfaceTarget);
+      checkAssignable(
+          node.value,
+          value,
+          receiver.substituteType(node.interfaceTarget.setterType,
+              contravariant: true));
+    } else {
+      visitExpression(node.receiver);
+    }
+    return value;
+  }
+
+  @override
+  DartType visitNot(Not node) {
+    visitExpression(node.operand);
+    return environment.boolType;
+  }
+
+  @override
+  DartType visitNullLiteral(NullLiteral node) {
+    return const BottomType();
+  }
+
+  @override
+  DartType visitRethrow(Rethrow node) {
+    return const BottomType();
+  }
+
+  @override
+  DartType visitStaticGet(StaticGet node) {
+    return node.target.getterType;
+  }
+
+  @override
+  DartType visitStaticInvocation(StaticInvocation node) {
+    return handleCall(node.arguments, node.target.function);
+  }
+
+  @override
+  DartType visitStaticSet(StaticSet node) {
+    var value = visitExpression(node.value);
+    checkAssignable(node.value, value, node.target.setterType);
+    return value;
+  }
+
+  @override
+  DartType visitStringConcatenation(StringConcatenation node) {
+    node.expressions.forEach(visitExpression);
+    return environment.stringType;
+  }
+
+  @override
+  DartType visitStringLiteral(StringLiteral node) {
+    return environment.stringType;
+  }
+
+  @override
+  DartType visitSuperMethodInvocation(SuperMethodInvocation node) {
+    if (node.interfaceTarget == null) {
+      return handleDynamicCall(environment.thisType, node.arguments);
+    } else {
+      return handleCall(node.arguments, node.interfaceTarget.function,
+          receiver: getSuperReceiverType(node.interfaceTarget));
+    }
+  }
+
+  @override
+  DartType visitSuperPropertyGet(SuperPropertyGet node) {
+    if (node.interfaceTarget == null) {
+      return const DynamicType();
+    } else {
+      var receiver = getSuperReceiverType(node.interfaceTarget);
+      return receiver.substituteType(node.interfaceTarget.getterType);
+    }
+  }
+
+  @override
+  DartType visitSuperPropertySet(SuperPropertySet node) {
+    var value = visitExpression(node.value);
+    if (node.interfaceTarget != null) {
+      var receiver = getSuperReceiverType(node.interfaceTarget);
+      checkAssignable(
+          node.value,
+          value,
+          receiver.substituteType(node.interfaceTarget.setterType,
+              contravariant: true));
+    }
+    return value;
+  }
+
+  @override
+  DartType visitSymbolLiteral(SymbolLiteral node) {
+    return environment.symbolType;
+  }
+
+  @override
+  DartType visitThisExpression(ThisExpression node) {
+    return environment.thisType;
+  }
+
+  @override
+  DartType visitThrow(Throw node) {
+    visitExpression(node.expression);
+    return const BottomType();
+  }
+
+  @override
+  DartType visitTypeLiteral(TypeLiteral node) {
+    return environment.typeType;
+  }
+
+  @override
+  DartType visitVariableGet(VariableGet node) {
+    return node.promotedType ?? node.variable.type;
+  }
+
+  @override
+  DartType visitVariableSet(VariableSet node) {
+    var value = visitExpression(node.value);
+    checkAssignable(node.value, value, node.variable.type);
+    return value;
+  }
+
+  @override
+  visitAssertStatement(AssertStatement node) {
+    visitExpression(node.condition);
+    if (node.message != null) {
+      visitExpression(node.message);
+    }
+  }
+
+  @override
+  visitBlock(Block node) {
+    node.statements.forEach(visitStatement);
+  }
+
+  @override
+  visitBreakStatement(BreakStatement node) {}
+
+  @override
+  visitContinueSwitchStatement(ContinueSwitchStatement node) {}
+
+  @override
+  visitDoStatement(DoStatement node) {
+    visitStatement(node.body);
+    checkAssignableExpression(node.condition, environment.boolType);
+  }
+
+  @override
+  visitEmptyStatement(EmptyStatement node) {}
+
+  @override
+  visitExpressionStatement(ExpressionStatement node) {
+    visitExpression(node.expression);
+  }
+
+  @override
+  visitForInStatement(ForInStatement node) {
+    var iterable = visitExpression(node.iterable);
+    // TODO(asgerf): Store interface targets on for-in loops or desugar them,
+    // instead of doing the ad-hoc resolution here.
+    if (node.isAsync) {
+      checkAssignable(node, getStreamElementType(iterable), node.variable.type);
+    } else {
+      checkAssignable(
+          node, getIterableElementType(iterable), node.variable.type);
+    }
+    visitStatement(node.body);
+  }
+
+  static final Name iteratorName = new Name('iterator');
+  static final Name nextName = new Name('next');
+
+  DartType getIterableElementType(DartType iterable) {
+    if (iterable is InterfaceType) {
+      var iteratorGetter =
+          hierarchy.getInterfaceMember(iterable.classNode, iteratorName);
+      if (iteratorGetter == null) return const DynamicType();
+      var iteratorType = Substitution
+          .fromInterfaceType(iterable)
+          .substituteType(iteratorGetter.getterType);
+      if (iteratorType is InterfaceType) {
+        var nextGetter =
+            hierarchy.getInterfaceMember(iteratorType.classNode, nextName);
+        if (nextGetter == null) return const DynamicType();
+        return Substitution
+            .fromInterfaceType(iteratorType)
+            .substituteType(nextGetter.getterType);
+      }
+    }
+    return const DynamicType();
+  }
+
+  DartType getStreamElementType(DartType stream) {
+    if (stream is InterfaceType) {
+      var asStream =
+          hierarchy.getTypeAsInstanceOf(stream, coreTypes.streamClass);
+      if (asStream == null) return const DynamicType();
+      return asStream.typeArguments.single;
+    }
+    return const DynamicType();
+  }
+
+  @override
+  visitForStatement(ForStatement node) {
+    node.variables.forEach(visitVariableDeclaration);
+    if (node.condition != null) {
+      checkAssignableExpression(node.condition, environment.boolType);
+    }
+    node.updates.forEach(visitExpression);
+    visitStatement(node.body);
+  }
+
+  @override
+  visitFunctionDeclaration(FunctionDeclaration node) {
+    handleNestedFunctionNode(node.function);
+  }
+
+  @override
+  visitIfStatement(IfStatement node) {
+    checkAssignableExpression(node.condition, environment.boolType);
+    visitStatement(node.then);
+    if (node.otherwise != null) {
+      visitStatement(node.otherwise);
+    }
+  }
+
+  @override
+  visitInvalidStatement(InvalidStatement node) {}
+
+  @override
+  visitLabeledStatement(LabeledStatement node) {
+    visitStatement(node.body);
+  }
+
+  @override
+  visitReturnStatement(ReturnStatement node) {
+    if (node.expression != null) {
+      if (environment.returnType == null) {
+        fail(node, 'Return of a value from void method');
+      } else {
+        var type = visitExpression(node.expression);
+        if (environment.currentAsyncMarker == AsyncMarker.Async) {
+          type = environment.unfutureType(type);
+        }
+        checkAssignable(node.expression, type, environment.returnType);
+      }
+    }
+  }
+
+  @override
+  visitSwitchStatement(SwitchStatement node) {
+    visitExpression(node.expression);
+    for (var switchCase in node.cases) {
+      switchCase.expressions.forEach(visitExpression);
+      visitStatement(switchCase.body);
+    }
+  }
+
+  @override
+  visitTryCatch(TryCatch node) {
+    visitStatement(node.body);
+    for (var catchClause in node.catches) {
+      visitStatement(catchClause.body);
+    }
+  }
+
+  @override
+  visitTryFinally(TryFinally node) {
+    visitStatement(node.body);
+    visitStatement(node.finalizer);
+  }
+
+  @override
+  visitVariableDeclaration(VariableDeclaration node) {
+    if (node.initializer != null) {
+      checkAssignableExpression(node.initializer, node.type);
+    }
+  }
+
+  @override
+  visitWhileStatement(WhileStatement node) {
+    checkAssignableExpression(node.condition, environment.boolType);
+    visitStatement(node.body);
+  }
+
+  @override
+  visitYieldStatement(YieldStatement node) {
+    if (node.isYieldStar) {
+      Class container = environment.currentAsyncMarker == AsyncMarker.AsyncStar
+          ? coreTypes.streamClass
+          : coreTypes.iterableClass;
+      var type = visitExpression(node.expression);
+      var asContainer = type is InterfaceType
+          ? hierarchy.getTypeAsInstanceOf(type, container)
+          : null;
+      if (asContainer != null) {
+        checkAssignable(node.expression, asContainer.typeArguments[0],
+            environment.yieldType);
+      } else {
+        fail(node.expression, '$type is not an instance of $container');
+      }
+    } else {
+      checkAssignableExpression(node.expression, environment.yieldType);
+    }
+  }
+
+  @override
+  visitFieldInitializer(FieldInitializer node) {
+    checkAssignableExpression(node.value, node.field.type);
+  }
+
+  @override
+  visitRedirectingInitializer(RedirectingInitializer node) {
+    handleCall(node.arguments, node.target.function,
+        typeParameters: const <TypeParameter>[]);
+  }
+
+  @override
+  visitSuperInitializer(SuperInitializer node) {
+    handleCall(node.arguments, node.target.function,
+        typeParameters: const <TypeParameter>[]);
+  }
+
+  @override
+  visitLocalInitializer(LocalInitializer node) {
+    visitVariableDeclaration(node.variable);
+  }
+
+  @override
+  visitInvalidInitializer(InvalidInitializer node) {}
+}
diff --git a/pkg/kernel/lib/type_environment.dart b/pkg/kernel/lib/type_environment.dart
new file mode 100644
index 0000000..c354c44
--- /dev/null
+++ b/pkg/kernel/lib/type_environment.dart
@@ -0,0 +1,225 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.type_environment;
+
+import 'ast.dart';
+import 'class_hierarchy.dart';
+import 'core_types.dart';
+import 'type_algebra.dart';
+
+typedef void ErrorHandler(TreeNode node, String message);
+
+class TypeEnvironment extends SubtypeTester {
+  final CoreTypes coreTypes;
+  final ClassHierarchy hierarchy;
+  InterfaceType thisType;
+
+  DartType returnType;
+  DartType yieldType;
+  AsyncMarker currentAsyncMarker = AsyncMarker.Sync;
+
+  /// An error handler for use in debugging, or `null` if type errors should not
+  /// be tolerated.  See [typeError].
+  ErrorHandler errorHandler;
+
+  TypeEnvironment(this.coreTypes, this.hierarchy);
+
+  InterfaceType get objectType => coreTypes.objectClass.rawType;
+  InterfaceType get nullType => coreTypes.nullClass.rawType;
+  InterfaceType get boolType => coreTypes.boolClass.rawType;
+  InterfaceType get intType => coreTypes.intClass.rawType;
+  InterfaceType get numType => coreTypes.numClass.rawType;
+  InterfaceType get doubleType => coreTypes.doubleClass.rawType;
+  InterfaceType get stringType => coreTypes.stringClass.rawType;
+  InterfaceType get symbolType => coreTypes.symbolClass.rawType;
+  InterfaceType get typeType => coreTypes.typeClass.rawType;
+  InterfaceType get rawFunctionType => coreTypes.functionClass.rawType;
+
+  Class get intClass => coreTypes.intClass;
+  Class get numClass => coreTypes.numClass;
+
+  InterfaceType literalListType(DartType elementType) {
+    return new InterfaceType(coreTypes.listClass, <DartType>[elementType]);
+  }
+
+  InterfaceType literalMapType(DartType key, DartType value) {
+    return new InterfaceType(coreTypes.mapClass, <DartType>[key, value]);
+  }
+
+  InterfaceType iterableType(DartType type) {
+    return new InterfaceType(coreTypes.iterableClass, <DartType>[type]);
+  }
+
+  InterfaceType streamType(DartType type) {
+    return new InterfaceType(coreTypes.streamClass, <DartType>[type]);
+  }
+
+  InterfaceType futureType(DartType type) {
+    return new InterfaceType(coreTypes.futureClass, <DartType>[type]);
+  }
+
+  /// Removes any number of `Future<>` types wrapping a type.
+  DartType unfutureType(DartType type) {
+    return type is InterfaceType && type.classNode == coreTypes.futureClass
+        ? unfutureType(type.typeArguments[0])
+        : type;
+  }
+
+  /// Called if the computation of a static type failed due to a type error.
+  ///
+  /// This should never happen in production.  The frontend should report type
+  /// errors, and either recover from the error during translation or abort
+  /// compilation if unable to recover.
+  ///
+  /// By default, this throws an exception, since programs in kernel are assumed
+  /// to be correctly typed.
+  ///
+  /// An [errorHandler] may be provided in order to override the default
+  /// behavior and tolerate the presence of type errors.  This can be useful for
+  /// debugging IR producers which are required to produce a strongly typed IR.
+  void typeError(TreeNode node, String message) {
+    if (errorHandler != null) {
+      errorHandler(node, message);
+    } else {
+      throw '$message in $node';
+    }
+  }
+
+  /// True if [member] is a binary operator that returns an `int` if both
+  /// operands are `int`, and otherwise returns `double`.
+  ///
+  /// This is a case of type-based overloading, which in Dart is only supported
+  /// by giving special treatment to certain arithmetic operators.
+  bool isOverloadedArithmeticOperator(Procedure member) {
+    Class class_ = member.enclosingClass;
+    if (class_ == coreTypes.intClass || class_ == coreTypes.numClass) {
+      String name = member.name.name;
+      return name == '+' || name == '-' || name == '*' || name == 'remainder';
+    }
+    return false;
+  }
+
+  /// Returns the static return type of an overloaded arithmetic operator
+  /// (see [isOverloadedArithmeticOperator]) given the static type of the
+  /// operands.
+  ///
+  /// If both types are `int`, the returned type is `int`.
+  /// If either type is `double`, the returned type is `double`.
+  /// If both types refer to the same type variable (typically with `num` as
+  /// the upper bound), then that type variable is returned.
+  /// Otherwise `num` is returned.
+  DartType getTypeOfOverloadedArithmetic(DartType type1, DartType type2) {
+    if (type1 == type2) return type1;
+    if (type1 == doubleType || type2 == doubleType) return doubleType;
+    return numType;
+  }
+}
+
+/// The part of [TypeEnvironment] that deals with subtype tests.
+///
+/// This lives in a separate class so it can be tested independently of the SDK.
+abstract class SubtypeTester {
+  InterfaceType get objectType;
+  InterfaceType get rawFunctionType;
+  ClassHierarchy get hierarchy;
+
+  /// Returns true if [subtype] is a subtype of [supertype].
+  bool isSubtypeOf(DartType subtype, DartType supertype) {
+    if (identical(subtype, supertype)) return true;
+    if (subtype is BottomType) return true;
+    if (supertype is DynamicType || supertype == objectType) {
+      return true;
+    }
+    if (subtype is InterfaceType && supertype is InterfaceType) {
+      var upcastType =
+          hierarchy.getTypeAsInstanceOf(subtype, supertype.classNode);
+      if (upcastType == null) return false;
+      for (int i = 0; i < upcastType.typeArguments.length; ++i) {
+        // Termination: the 'supertype' parameter decreases in size.
+        if (!isSubtypeOf(
+            upcastType.typeArguments[i], supertype.typeArguments[i])) {
+          return false;
+        }
+      }
+      return true;
+    }
+    if (subtype is TypeParameterType) {
+      if (supertype is TypeParameterType &&
+          subtype.parameter == supertype.parameter) {
+        return true;
+      }
+      // Termination: if there are no cyclically bound type parameters, this
+      // recursive call can only occur a finite number of times, before reaching
+      // a shrinking recursive call (or terminating).
+      return isSubtypeOf(subtype.parameter.bound, supertype);
+    }
+    if (subtype is FunctionType) {
+      if (supertype == rawFunctionType) return true;
+      if (supertype is FunctionType) {
+        return _isFunctionSubtypeOf(subtype, supertype);
+      }
+    }
+    return false;
+  }
+
+  bool _isFunctionSubtypeOf(FunctionType subtype, FunctionType supertype) {
+    if (subtype.requiredParameterCount > supertype.requiredParameterCount) {
+      return false;
+    }
+    if (subtype.positionalParameters.length <
+        supertype.positionalParameters.length) {
+      return false;
+    }
+    if (subtype.typeParameters.length != supertype.typeParameters.length) {
+      return false;
+    }
+    if (subtype.typeParameters.isNotEmpty) {
+      var substitution = <TypeParameter, DartType>{};
+      for (int i = 0; i < subtype.typeParameters.length; ++i) {
+        var subParameter = subtype.typeParameters[i];
+        var superParameter = supertype.typeParameters[i];
+        substitution[subParameter] = new TypeParameterType(superParameter);
+      }
+      for (int i = 0; i < subtype.typeParameters.length; ++i) {
+        var subParameter = subtype.typeParameters[i];
+        var superParameter = supertype.typeParameters[i];
+        var subBound = substitute(subParameter.bound, substitution);
+        // Termination: if there are no cyclically bound type parameters, this
+        // recursive call can only occur a finite number of times before
+        // reaching a shrinking recursive call (or terminating).
+        if (!isSubtypeOf(superParameter.bound, subBound)) {
+          return false;
+        }
+      }
+      subtype = substitute(subtype.withoutTypeParameters, substitution);
+    }
+    if (supertype.returnType is! VoidType &&
+        !isSubtypeOf(subtype.returnType, supertype.returnType)) {
+      return false;
+    }
+    for (int i = 0; i < supertype.positionalParameters.length; ++i) {
+      var supertypeParameter = supertype.positionalParameters[i];
+      var subtypeParameter = subtype.positionalParameters[i];
+      // Termination: Both types shrink in size.
+      if (!isSubtypeOf(supertypeParameter, subtypeParameter)) {
+        return false;
+      }
+    }
+    int subtypeNameIndex = 0;
+    for (NamedType supertypeParameter in supertype.namedParameters) {
+      while (subtypeNameIndex < subtype.namedParameters.length &&
+          subtype.namedParameters[subtypeNameIndex].name !=
+              supertypeParameter.name) {
+        ++subtypeNameIndex;
+      }
+      if (subtypeNameIndex == subtype.namedParameters.length) return false;
+      NamedType subtypeParameter = subtype.namedParameters[subtypeNameIndex];
+      // Termination: Both types shrink in size.
+      if (!isSubtypeOf(supertypeParameter.type, subtypeParameter.type)) {
+        return false;
+      }
+    }
+    return true;
+  }
+}
diff --git a/pkg/kernel/lib/type_propagation/builder.dart b/pkg/kernel/lib/type_propagation/builder.dart
new file mode 100644
index 0000000..f33e12e
--- /dev/null
+++ b/pkg/kernel/lib/type_propagation/builder.dart
@@ -0,0 +1,1977 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.type_propagation.builder;
+
+import '../ast.dart';
+import '../class_hierarchy.dart';
+import '../core_types.dart';
+import 'canonicalizer.dart';
+import 'constraints.dart';
+import 'type_propagation.dart';
+import 'visualizer.dart';
+
+/// Maps AST nodes to constraint variables at the level of function boundaries.
+///
+/// Bindings internally in a function are only preserved by the [Visualizer].
+class VariableMapping {
+  /// Variable holding all values that may flow into the given field.
+  final Map<Field, int> fields = <Field, int>{};
+
+  /// Variable holding all values that may be returned from the given function.
+  final Map<FunctionNode, int> returns = <FunctionNode, int>{};
+
+  /// Variable holding all values that may be passed into the given function
+  /// parameter (possibly through a default parameter value).
+  final Map<VariableDeclaration, int> parameters = <VariableDeclaration, int>{};
+
+  /// Variable holding the function object for the given function.
+  final Map<FunctionNode, int> functions = <FunctionNode, int>{};
+
+  static VariableMapping make(int _) => new VariableMapping();
+}
+
+/// Maps AST nodes to the lattice employed by the constraint system.
+class LatticeMapping {
+  /// Lattice point containing the torn-off functions originating from an
+  /// instance procedure that overrides the given procedure.
+  final Map<Procedure, int> functionsOverridingMethod = <Procedure, int>{};
+
+  /// Lattice point containing all torn-off functions originating from an
+  /// instance procedure of the given name,
+  ///
+  /// This ensures that calls to a method with unknown receiver may still
+  /// recover some information about the callee based on the name alone.
+  final Map<Name, int> functionsWithName = <Name, int>{};
+
+  /// Maps a class index to a lattice point containing all values that are
+  /// subtypes of that class.
+  final List<int> subtypesOfClass;
+
+  /// Maps a class index to a lattice point containing all values that are
+  /// subclasses of that class.
+  final List<int> subclassesOfClass;
+
+  LatticeMapping(int numberOfClasses)
+      : subtypesOfClass = new List<int>(numberOfClasses),
+        subclassesOfClass = new List<int>(numberOfClasses);
+}
+
+/// Generates a [ConstraintSystem] to be solved by [Solver].
+class Builder {
+  final Program program;
+  final ClassHierarchy hierarchy;
+  final CoreTypes coreTypes;
+  final ConstraintSystem constraints;
+  final FieldNames fieldNames;
+  final Visualizer visualizer;
+
+  final LatticeMapping lattice;
+
+  /// Bindings for all members. The values inferred for these variables is the
+  /// output of the analysis.
+  ///
+  /// For static members, these are the canonical variables representing the
+  /// member.
+  ///
+  /// For instance members, these are the context-insensitive joins over all
+  /// the specialized copies of the instance member.
+  final VariableMapping global = new VariableMapping();
+
+  /// Maps a class index to the bindings for instance members specific to that
+  /// class as the host class.
+  final List<VariableMapping> classMapping;
+
+  final Map<TypeParameter, int> functionTypeParameters = <TypeParameter, int>{};
+
+  /// Variable holding the result of the declaration-site field initializer
+  /// for the given field.
+  final Map<Field, int> declarationSiteFieldInitializer = <Field, int>{};
+
+  /// Maps a class index to the result of [getInterfaceEscapeVariable].
+  final List<int> interfaceEscapeVariables;
+
+  /// Maps a class index to the result of [getExternalInstanceVariable].
+  final List<int> externalClassVariables;
+  final List<int> externalClassValues;
+
+  final List<int> externalClassWorklist = <int>[];
+
+  final Uint31PairMap<int> _stores = new Uint31PairMap<int>();
+  final Uint31PairMap<int> _loads = new Uint31PairMap<int>();
+  final List<InferredValue> _baseTypeOfLatticePoint = <InferredValue>[];
+
+  int bottomNode;
+  int dynamicNode;
+  int boolNode;
+  int intNode;
+  int doubleNode;
+  int stringNode;
+  int symbolNode;
+  int typeNode;
+  int listNode;
+  int mapNode;
+  int nullNode;
+  int iterableNode;
+  int futureNode;
+  int streamNode;
+  int functionValueNode;
+
+  int iteratorField;
+  int currentField;
+
+  /// Lattice point containing all function values.
+  int latticePointForAllFunctions;
+
+  Member identicalFunction;
+
+  bool verbose;
+
+  Builder(Program program,
+      {ClassHierarchy hierarchy,
+      FieldNames names,
+      CoreTypes coreTypes,
+      Visualizer visualizer,
+      bool verbose: false})
+      : this._internal(
+            program,
+            hierarchy ?? new ClassHierarchy(program),
+            names ?? new FieldNames(),
+            coreTypes ?? new CoreTypes(program),
+            visualizer,
+            verbose);
+
+  Builder._internal(this.program, ClassHierarchy hierarchy, FieldNames names,
+      this.coreTypes, Visualizer visualizer, this.verbose)
+      : this.hierarchy = hierarchy,
+        this.fieldNames = names,
+        this.visualizer = visualizer,
+        this.constraints = new ConstraintSystem(),
+        this.classMapping = new List<VariableMapping>.generate(
+            hierarchy.classes.length, VariableMapping.make),
+        this.interfaceEscapeVariables = new List<int>(hierarchy.classes.length),
+        this.externalClassVariables = new List<int>(hierarchy.classes.length),
+        this.externalClassValues = new List<int>(hierarchy.classes.length),
+        this.lattice = new LatticeMapping(hierarchy.classes.length) {
+    if (visualizer != null) {
+      visualizer.builder = this;
+      visualizer.constraints = constraints;
+      visualizer.fieldNames = fieldNames;
+    }
+
+    // Build the subtype lattice points.
+    // The order in which lattice points are created determines how ambiguous
+    // upper bounds are resolved.  The lattice point with highest index among
+    // the potential upper bounds is the result of a join.
+    // We create all the subtype lattice point before all the subclass lattice
+    // points, to ensure that subclass information takes precedence over
+    // subtype information.
+    for (int i = 0; i < hierarchy.classes.length; ++i) {
+      Class class_ = hierarchy.classes[i];
+      List<int> supers = <int>[];
+      if (class_.supertype != null) {
+        supers.add(getLatticePointForSubtypesOfClass(class_.superclass));
+      }
+      if (class_.mixedInType != null) {
+        supers.add(getLatticePointForSubtypesOfClass(class_.mixedInClass));
+      }
+      for (Supertype supertype in class_.implementedTypes) {
+        supers.add(getLatticePointForSubtypesOfClass(supertype.classNode));
+      }
+      int subtypePoint = newLatticePoint(supers, class_,
+          i == 0 ? BaseClassKind.Subclass : BaseClassKind.Subtype);
+      lattice.subtypesOfClass[i] = subtypePoint;
+      visualizer?.annotateLatticePoint(subtypePoint, class_, 'subtype');
+    }
+
+    // Build the lattice points for subclasses and exact classes.
+    for (int i = 0; i < hierarchy.classes.length; ++i) {
+      Class class_ = hierarchy.classes[i];
+      int subtypePoint = lattice.subtypesOfClass[i];
+      assert(subtypePoint != null);
+      int subclassPoint;
+      if (class_.supertype == null) {
+        subclassPoint = subtypePoint;
+      } else {
+        subclassPoint = newLatticePoint(<int>[
+          getLatticePointForSubclassesOf(class_.superclass),
+          subtypePoint
+        ], class_, BaseClassKind.Subclass);
+      }
+      lattice.subclassesOfClass[i] = subclassPoint;
+      int concretePoint =
+          newLatticePoint(<int>[subclassPoint], class_, BaseClassKind.Exact);
+      int value = constraints.newValue(concretePoint);
+      int variable = constraints.newVariable();
+      // We construct the constraint system so the first N variables and values
+      // correspond to the N classes in the program.
+      assert(variable == i);
+      assert(value == -i);
+      visualizer?.annotateLatticePoint(subclassPoint, class_, 'subclass');
+      visualizer?.annotateLatticePoint(concretePoint, class_, 'concrete');
+      visualizer?.annotateVariable(variable, class_);
+      visualizer?.annotateValue(value, class_);
+      addInput(value, ValueBit.other, variable);
+    }
+
+    bottomNode = newVariable(null, 'bottom');
+    dynamicNode = getExternalInstanceVariable(coreTypes.objectClass);
+    boolNode = getExternalInstanceVariable(coreTypes.boolClass);
+    intNode = getExternalInstanceVariable(coreTypes.intClass);
+    doubleNode = getExternalInstanceVariable(coreTypes.doubleClass);
+    stringNode = getExternalInstanceVariable(coreTypes.stringClass);
+    symbolNode = getExternalInstanceVariable(coreTypes.symbolClass);
+    typeNode = getExternalInstanceVariable(coreTypes.typeClass);
+    listNode = getExternalInstanceVariable(coreTypes.listClass);
+    mapNode = getExternalInstanceVariable(coreTypes.mapClass);
+    iterableNode = getExternalInstanceVariable(coreTypes.iterableClass);
+    futureNode = getExternalInstanceVariable(coreTypes.futureClass);
+    streamNode = getExternalInstanceVariable(coreTypes.streamClass);
+    functionValueNode = getExternalInstanceVariable(coreTypes.functionClass);
+    nullNode = newVariable(null, 'Null');
+
+    iteratorField = getPropertyField(Names.iterator);
+    currentField = getPropertyField(Names.current);
+
+    latticePointForAllFunctions =
+        getLatticePointForSubtypesOfClass(coreTypes.functionClass);
+
+    identicalFunction = coreTypes.getCoreProcedure('dart:core', 'identical');
+
+    // Seed bitmasks for built-in values.
+    constraints.addBitmaskInput(ValueBit.null_, nullNode);
+    constraints.addBitmaskInput(ValueBit.all, dynamicNode);
+
+    for (Library library in program.libraries) {
+      for (Procedure procedure in library.procedures) {
+        buildProcedure(null, procedure);
+      }
+      for (Field field in library.fields) {
+        buildStaticField(field);
+      }
+      for (Class class_ in library.classes) {
+        for (Procedure procedure in class_.procedures) {
+          if (procedure.isStatic) {
+            buildProcedure(null, procedure);
+          }
+        }
+        for (Field field in class_.fields) {
+          if (field.isStatic) {
+            buildStaticField(field);
+          }
+        }
+        if (!class_.isAbstract) {
+          buildInstanceValue(class_);
+        }
+      }
+    }
+
+    // We don't track the values flowing into the identical function, as it
+    // causes a lot of spurious escape.  Every class that inherits Object.==
+    // would escape its 'this' value into a dynamic context.
+    // Mark the identical() parameters as 'dynamic' so the output is sound.
+    for (int i = 0; i < 2; ++i) {
+      constraints.addAssign(
+          dynamicNode,
+          getSharedParameterVariable(
+              identicalFunction.function.positionalParameters[i]));
+    }
+
+    // Build constraints mocking the external interfaces.
+    while (externalClassWorklist.isNotEmpty) {
+      int classIndex = externalClassWorklist.removeLast();
+      _buildExternalClassValue(classIndex);
+    }
+  }
+
+  int newLatticePoint(
+      List<int> parentLatticePoints, Class baseClass, BaseClassKind kind) {
+    _baseTypeOfLatticePoint.add(new InferredValue(baseClass, kind, 0));
+    return constraints.newLatticePoint(parentLatticePoints);
+  }
+
+  void addInput(int value, int bitmask, int destination) {
+    constraints.addAllocation(value, destination);
+    constraints.addBitmaskInput(bitmask, destination);
+  }
+
+  /// Returns an [InferredValue] with the base type relation for the given
+  /// lattice point but whose bitmask is 0.  The bitmask must be filled in
+  /// before this value is exposed to analysis clients.
+  InferredValue getBaseTypeOfLatticePoint(int latticePoint) {
+    return _baseTypeOfLatticePoint[latticePoint];
+  }
+
+  /// Returns the lattice point containing all subtypes of the given class.
+  int getLatticePointForSubtypesOfClass(Class classNode) {
+    int index = hierarchy.getClassIndex(classNode);
+    return lattice.subtypesOfClass[index];
+  }
+
+  /// Returns the lattice point containing all subclasses of the given class.
+  int getLatticePointForSubclassesOf(Class classNode) {
+    int index = hierarchy.getClassIndex(classNode);
+    return lattice.subclassesOfClass[index];
+  }
+
+  /// Returns the lattice point containing all function implementing the given
+  /// instance method.
+  int getLatticePointForFunctionsOverridingMethod(Procedure node) {
+    assert(!node.isStatic);
+    if (node.isAccessor) return latticePointForAllFunctions;
+    if (node.enclosingClass.supertype == null)
+      return latticePointForAllFunctions;
+    return lattice.functionsOverridingMethod[node] ??=
+        _makeLatticePointForFunctionsOverridingMethod(node);
+  }
+
+  int _makeLatticePointForFunctionsOverridingMethod(Procedure node) {
+    Class host = node.enclosingClass;
+    Member superMember = host.supertype == null
+        ? null
+        : hierarchy.getInterfaceMember(host.superclass, node.name);
+    int super_;
+    if (superMember is Procedure && !superMember.isAccessor) {
+      super_ = getLatticePointForFunctionsOverridingMethod(superMember);
+    } else {
+      super_ = getLatticePointForFunctionsWithName(node.name);
+    }
+    int point = newLatticePoint(
+        <int>[super_], coreTypes.functionClass, BaseClassKind.Subtype);
+    visualizer?.annotateLatticePoint(point, node, 'overriders');
+    return point;
+  }
+
+  int newVariable([TreeNode node, String info]) {
+    int variable = constraints.newVariable();
+    visualizer?.annotateVariable(variable, node, info);
+    return variable;
+  }
+
+  VariableMapping getClassMapping(Class host) {
+    if (host == null) return global;
+    int index = hierarchy.getClassIndex(host);
+    return classMapping[index];
+  }
+
+  /// Returns a variable that should contain all values that may be contained
+  /// in any copy the given field (hence "shared" between the copies).
+  int getSharedFieldVariable(Field field) {
+    return global.fields[field] ??= newVariable(field);
+  }
+
+  /// Returns a variable representing the given field on the given class.
+  ///
+  /// If the field is static, [host] should be `null`.
+  int getFieldVariable(Class host, Field field) {
+    if (host == null) return getSharedFieldVariable(field);
+    VariableMapping mapping = getClassMapping(host);
+    return mapping.fields[field] ??= _makeFieldVariable(host, field);
+  }
+
+  int _makeFieldVariable(Class host, Field field) {
+    // Create a variable specific to this host class, and add an assignment
+    // to the global sink for this field.
+    assert(host != null);
+    int variable = newVariable(field);
+    int sink = getSharedFieldVariable(field);
+    constraints.addSink(variable, sink);
+    visualizer?.annotateSink(variable, sink, field);
+    return variable;
+  }
+
+  /// Variable containing all values that may be passed into the given parameter
+  /// of any instantiation of the given function (hence "shared" between them).
+  int getSharedParameterVariable(VariableDeclaration node) {
+    return global.parameters[node] ??= newVariable(node, 'shared parameter');
+  }
+
+  int getParameterVariable(Class host, VariableDeclaration node) {
+    if (host == null) return getSharedParameterVariable(node);
+    VariableMapping mapping = getClassMapping(host);
+    return mapping.parameters[node] ??= _makeParameterVariable(host, node);
+  }
+
+  int _makeParameterVariable(Class host, VariableDeclaration node) {
+    assert(host != null);
+    int variable = newVariable(node, 'parameter');
+    int sink = getSharedParameterVariable(node);
+    constraints.addSink(variable, sink);
+    visualizer?.annotateSink(variable, sink, node);
+    return variable;
+  }
+
+  /// Returns the variable representing all the values that would be checked
+  /// against the given function type parameter in checked mode.
+  ///
+  /// This is used to model the behavior of external generic methods.
+  ///
+  /// For example:
+  ///
+  ///     class List {
+  ///         external static factory List<T> filled<T>(int length, T value);
+  ///     }
+  ///
+  /// A variable `v` representing `T` will be generated. All values that are
+  /// passed into the `value` parameter will flow into `v`, and `v` will
+  /// in turn flow into the type parameter field of `List`, because the method
+  /// returns `List<T>`.  Also see [FieldNames.getTypeParameterField].
+  int getFunctionTypeParameterVariable(TypeParameter node) {
+    return functionTypeParameters[node] ??= newVariable(node);
+  }
+
+  /// Variable containing all values that may be returned from any instantiation
+  /// of the given function (hence "shared" between them).
+  int getSharedReturnVariable(FunctionNode node) {
+    return global.returns[node] ??= newVariable(node, 'return');
+  }
+
+  int getReturnVariable(Class host, Procedure node) {
+    if (host == null) return getSharedReturnVariable(node.function);
+    VariableMapping mapping = getClassMapping(host);
+    return mapping.returns[node.function] ??= _makeReturnVariable(host, node);
+  }
+
+  int _makeReturnVariable(Class host, Procedure node) {
+    assert(host != null);
+    int variable = newVariable(node, 'return');
+    int sink = getSharedReturnVariable(node.function);
+    constraints.addSink(variable, sink);
+    visualizer?.annotateSink(variable, sink, node);
+    return variable;
+  }
+
+  /// Returns a variable containing all the function objects for all
+  /// instantiations of the given function.
+  int getSharedTearOffVariable(FunctionNode node) {
+    return global.functions[node] ??= newVariable(node);
+  }
+
+  /// Returns a variable containing the torn-off copy of the given function
+  /// occurring in static context.
+  int getStaticTearOffVariable(FunctionNode node) {
+    return global.functions[node] ??= _makeStaticTearOffVariable(node);
+  }
+
+  int _makeStaticTearOffVariable(FunctionNode node) {
+    return newFunction(node);
+  }
+
+  /// Returns a variable containing the torn-off copy of the given procedure.
+  int getTearOffVariable(Class host, Procedure node) {
+    if (host == null) return getStaticTearOffVariable(node.function);
+    VariableMapping mapping = getClassMapping(host);
+    return mapping.functions[node.function] ??=
+        _makeTearOffVariable(host, node);
+  }
+
+  int _makeTearOffVariable(Class host, Procedure node) {
+    int variable = newFunction(node.function, node);
+    int sink = getSharedTearOffVariable(node.function);
+    constraints.addSink(variable, sink);
+    visualizer?.annotateSink(variable, sink, node);
+    return variable;
+  }
+
+  /// Returns the variable holding the result of a 'get' selector dispatched
+  /// to the given member, or `null` if the member cannot respond to a 'get'
+  /// selector.
+  int getMemberGetter(Class host, Member member) {
+    if (member is Field) {
+      return getFieldVariable(host, member);
+    } else if (member is Procedure) {
+      if (member.isGetter) {
+        return getReturnVariable(host, member);
+      } else if (!member.isAccessor) {
+        return getTearOffVariable(host, member);
+      }
+    }
+    return null;
+  }
+
+  /// Returns the variable holding the argument to a 'set' selector dispatched
+  /// to the given member, or `null` if the member cannot respond to a 'set'
+  /// selector.
+  int getMemberSetter(Class host, Member member) {
+    if (member is Field && !member.isFinal) {
+      return getFieldVariable(host, member);
+    } else if (member is Procedure && member.isSetter) {
+      return getParameterVariable(
+          host, member.function.positionalParameters[0]);
+    }
+    return null;
+  }
+
+  /// Returns a lattice point containing all instance methods with the given
+  /// name.
+  int getLatticePointForFunctionsWithName(Name name) {
+    if (name == null) return latticePointForAllFunctions;
+    return lattice.functionsWithName[name] ??=
+        _makeLatticePointForFunctionsWithName(name);
+  }
+
+  int _makeLatticePointForFunctionsWithName(Name name) {
+    int point = newLatticePoint(<int>[latticePointForAllFunctions],
+        coreTypes.functionClass, BaseClassKind.Subtype);
+    visualizer?.annotateLatticePoint(point, null, 'Methods of name $name');
+    return point;
+  }
+
+  /// Returns a variable holding a new function value annotated with given AST
+  /// node.
+  ///
+  /// If the function is the body of an instance procedure, it should be passed
+  /// as [member] to ensure an effective lattice is built for it.
+  /// Otherwise, [member] should be omitted.
+  int newFunction(FunctionNode node, [Procedure member]) {
+    assert(node != null);
+    int functionVariable = newVariable(node);
+    int baseLatticePoint = member == null
+        ? latticePointForAllFunctions
+        : getLatticePointForFunctionsOverridingMethod(member);
+    int latticePoint = newLatticePoint(<int>[baseLatticePoint],
+        coreTypes.functionClass, BaseClassKind.Subtype);
+    visualizer?.annotateLatticePoint(latticePoint, member, 'function');
+    int minArity = node.requiredParameterCount;
+    int maxArity = node.positionalParameters.length;
+    int functionValue = constraints.newValue(latticePoint);
+    for (int i = 0; i < node.positionalParameters.length; ++i) {
+      int variable = newVariable();
+      for (int arity = minArity; arity <= maxArity; ++arity) {
+        int field = fieldNames.getPositionalParameterField(arity, i);
+        constraints.setStoreLocation(functionValue, field, variable);
+        constraints.setLoadLocation(functionValue, field, variable);
+      }
+    }
+    for (int i = 0; i < node.namedParameters.length; ++i) {
+      int variable = newVariable();
+      for (int arity = minArity; arity <= maxArity; ++arity) {
+        int field = fieldNames.getNamedParameterField(
+            arity, node.namedParameters[i].name);
+        constraints.setStoreLocation(functionValue, field, variable);
+        constraints.setLoadLocation(functionValue, field, variable);
+      }
+    }
+    int returnVariable = newVariable();
+    for (int arity = minArity; arity <= maxArity; ++arity) {
+      int returnField = fieldNames.getReturnField(arity);
+      constraints.setStoreLocation(functionValue, returnField, returnVariable);
+      constraints.setLoadLocation(functionValue, returnField, returnVariable);
+    }
+    visualizer?.annotateFunction(functionValue, node);
+    visualizer?.annotateValue(functionValue, member, 'function');
+    addInput(functionValue, ValueBit.other, functionVariable);
+    constraints.setLoadLocation(
+        functionValue, fieldNames.callHandlerField, functionVariable);
+    constraints.setLoadLocation(functionValue,
+        fieldNames.getPropertyField(Names.call_), functionVariable);
+    return functionVariable;
+  }
+
+  /// Returns a variable containing the concrete instances of the given class.
+  int getInstanceVariable(Class node) {
+    assert(!node.isAbstract);
+    return hierarchy.getClassIndex(node);
+  }
+
+  /// Returns the value representing the concrete instances of the given class.
+  int getInstanceValue(Class node) {
+    assert(!node.isAbstract);
+    // Values are negated to help distinguish them from variables and
+    // lattice points.
+    return -hierarchy.getClassIndex(node);
+  }
+
+  /// Returns a variable containing the external instances of the given class.
+  ///
+  /// An "external instance of C" is an instance allocated by external code,
+  /// and is either a direct instance of C or an instance of an external class
+  /// that implements C.
+  ///
+  /// For the moment, basic types like `int` and `bool` are treated as external
+  /// instances of their respective classes.
+  ///
+  /// Unlike [getInstanceVariable], this method ensures that the relevant
+  /// constraints have been generated to model an external implementation of the
+  /// class.
+  int getExternalInstanceVariable(Class node) {
+    int classIndex = hierarchy.getClassIndex(node);
+    return externalClassVariables[classIndex] ??=
+        _makeExternalInstanceVariable(node, classIndex);
+  }
+
+  int getValueBitForExternalClass(Class node) {
+    if (node == coreTypes.intClass) {
+      return ValueBit.integer;
+    } else if (node == coreTypes.doubleClass) {
+      return ValueBit.double_;
+    } else if (node == coreTypes.stringClass) {
+      return ValueBit.string;
+    } else {
+      return ValueBit.other;
+    }
+  }
+
+  int _makeExternalInstanceVariable(Class node, int classIndex) {
+    if (node == coreTypes.numClass) {
+      // Don't build an interface based on the "num" class, instead treat it
+      // as the union of "int" and "double".
+      int variable = newVariable(node);
+      constraints.addAssign(intNode, variable);
+      constraints.addAssign(doubleNode, variable);
+      return variable;
+    }
+    int baseLatticePoint = getLatticePointForSubtypesOfClass(node);
+    // TODO(asgerf): Use more fine-grained handling of externals, based on
+    //   metadata or on a specification read from a separate file (issue #22).
+    int latticePoint =
+        newLatticePoint(<int>[baseLatticePoint], node, BaseClassKind.Subtype);
+    visualizer?.annotateLatticePoint(latticePoint, node, 'external');
+    int value = constraints.newValue(latticePoint);
+    int variable = newVariable(node, 'external');
+    addInput(value, getValueBitForExternalClass(node), variable);
+    externalClassValues[classIndex] = value;
+    externalClassWorklist.add(classIndex);
+    return variable;
+  }
+
+  void _buildExternalClassValue(int index) {
+    Class node = hierarchy.classes[index];
+    int variable = externalClassVariables[index];
+    int externalObject = externalClassValues[index];
+    Name previousName = null;
+    for (Member member in hierarchy.getInterfaceMembers(node, setters: false)) {
+      // Do not generate an interface member for a given name more than once.
+      // This can happen if a class inherits two methods through different
+      // inheritance paths.
+      if (member.name == previousName) continue;
+      previousName = member.name;
+      _buildExternalInterfaceMember(node, member, externalObject, variable,
+          isSetter: false);
+    }
+    previousName = null;
+    for (Member member in hierarchy.getInterfaceMembers(node, setters: true)) {
+      if (member.name == previousName) continue;
+      previousName = member.name;
+      _buildExternalInterfaceMember(node, member, externalObject, variable,
+          isSetter: true);
+    }
+    for (TypeParameter parameter in node.typeParameters) {
+      int field = fieldNames.getTypeParameterField(parameter);
+      int location = newVariable(parameter);
+      constraints.setStoreLocation(externalObject, field, location);
+      constraints.setLoadLocation(externalObject, field, location);
+    }
+  }
+
+  void _buildExternalInterfaceMember(
+      Class host, Member member, int object, int variable,
+      {bool isSetter}) {
+    // TODO(asgerf): Handle nullability of return values.
+    TypeEnvironment environment =
+        new TypeEnvironment(this, host, member, thisVariable: variable);
+    int propertyField = fieldNames.getPropertyField(member.name);
+    if (member is Field) {
+      int fieldType = buildCovariantType(member.type, environment);
+      if (isSetter) {
+        constraints.setStoreLocation(object, propertyField, fieldType);
+      } else {
+        constraints.setLoadLocation(object, propertyField, fieldType);
+      }
+    } else {
+      Procedure procedure = member;
+      FunctionNode function = procedure.function;
+      if (procedure.isGetter) {
+        int returned = buildCovariantType(function.returnType, environment);
+        constraints.setLoadLocation(object, propertyField, returned);
+      } else if (procedure.isSetter) {
+        int escaping = environment.getLoad(variable, propertyField);
+        buildContravariantType(
+            function.positionalParameters[0].type, environment, escaping);
+      } else {
+        int externalMember = buildCovariantFunctionType(function, environment);
+        constraints.setLoadLocation(object, propertyField, externalMember);
+      }
+    }
+  }
+
+  /// Returns a variable that is exposed to external calls through the
+  /// given interface.
+  ///
+  /// For example, consider this code with a simplified version of SendPort:
+  ///
+  ///     abstract class SendPort {
+  ///         void send(dynamic x);
+  ///     }
+  ///
+  ///     class MySendPort implements SendPort {
+  ///         void send(x) { ... }
+  ///     }
+  ///
+  ///     external void spawnFunction(SendPort readyPort);
+  ///
+  ///     main() {
+  ///         spawnFunction(new MySendPort());
+  ///     }
+  ///
+  /// We must ensure that the parameter to `MySendPort::send` is inferred to
+  /// be unknown because the external function `spawnFunction` may cause an
+  /// invocation of its `send` method with an unknown argument.
+  ///
+  /// The interface escape variable for this version of `SendPort` would be a
+  /// variable `v` with constraints corresponding to a call `v.send(<dynamic>)`.
+  ///
+  /// Values that escape into an external parameter typed as `SendPort`, such
+  /// as `new MySendPort()` must then be made to flow into `v`.
+  int getInterfaceEscapeVariable(Class node) {
+    int index = hierarchy.getClassIndex(node);
+    return interfaceEscapeVariables[index] ??
+        _buildInterfaceEscapeVariable(node, index);
+  }
+
+  int _buildInterfaceEscapeVariable(Class node, int index) {
+    int escapingObject = constraints.newVariable();
+    visualizer?.annotateVariable(escapingObject, node, 'escape point');
+    interfaceEscapeVariables[index] = escapingObject;
+    for (Member member in hierarchy.getInterfaceMembers(node, setters: false)) {
+      _buildEscapingInterfaceMember(node, member, escapingObject);
+    }
+    for (Member member in hierarchy.getInterfaceMembers(node, setters: true)) {
+      _buildEscapingInterfaceMember(node, member, escapingObject);
+    }
+    return escapingObject;
+  }
+
+  /// Models the behavior of external code invoking [member] on
+  /// [escapingObject].
+  void _buildEscapingInterfaceMember(
+      Class host, Member member, int escapingObject) {
+    TypeEnvironment environment =
+        new TypeEnvironment(this, host, member, thisVariable: escapingObject);
+    int propertyField = fieldNames.getPropertyField(member.name);
+    if (member is Field) {
+      int escapingMember = environment.getLoad(escapingObject, propertyField);
+      buildContravariantType(member.type, environment, escapingMember);
+    } else {
+      Procedure procedure = member;
+      FunctionNode function = procedure.function;
+      if (procedure.isGetter) {
+        int escapingMember = environment.getLoad(escapingObject, propertyField);
+        buildContravariantType(
+            function.returnType, environment, escapingMember);
+      } else if (procedure.isSetter) {
+        VariableDeclaration parameter = function.positionalParameters[0];
+        int argument = buildCovariantType(parameter.type, environment);
+        environment.addStore(escapingObject, propertyField, argument);
+      } else {
+        int escapingMember = environment.getLoad(escapingObject, propertyField);
+        buildContravariantFunctionType(function, environment, escapingMember);
+      }
+    }
+  }
+
+  /// Returns a variable with the possible values of [type] as provided by
+  /// external code.
+  int buildCovariantType(DartType type, TypeEnvironment environment) {
+    return new CovariantExternalTypeVisitor(this, environment).visit(type);
+  }
+
+  /// Like [buildCovariantType], but for the function type implied by the
+  /// type annotations on a function AST node.
+  int buildCovariantFunctionType(
+      FunctionNode node, TypeEnvironment environment) {
+    return new CovariantExternalTypeVisitor(this, environment)
+        .buildFunctionNode(node);
+  }
+
+  /// Generates constraints to model the behavior of [input] escaping into
+  /// external code through a parameter annotated with [type].
+  void buildContravariantType(
+      DartType type, TypeEnvironment environment, int input) {
+    new ContravariantExternalTypeVisitor(this, environment, input).visit(type);
+  }
+
+  /// Like [buildContravariantType], but for the function type implied by the
+  /// type annotations on a function AST node.
+  void buildContravariantFunctionType(
+      FunctionNode node, TypeEnvironment environment, int input) {
+    new ContravariantExternalTypeVisitor(this, environment, input)
+        .buildFunctionNode(node);
+  }
+
+  int getPropertyField(Name name) {
+    return fieldNames.getPropertyField(name);
+  }
+
+  int getPositionalParameterField(int arity, int position) {
+    return fieldNames.getPositionalParameterField(arity, position);
+  }
+
+  int getNamedParameterField(int arity, String name) {
+    return fieldNames.getNamedParameterField(arity, name);
+  }
+
+  int getReturnField(int arity) {
+    return fieldNames.getReturnField(arity);
+  }
+
+  void buildInstanceValue(Class host) {
+    int value = getInstanceValue(host);
+    for (Member target in hierarchy.getDispatchTargets(host, setters: false)) {
+      var getter = getMemberGetter(host, target);
+      constraints.setLoadLocation(value, getPropertyField(target.name), getter);
+    }
+    for (Member target in hierarchy.getDispatchTargets(host, setters: true)) {
+      constraints.setStoreLocation(
+          value, getPropertyField(target.name), getMemberSetter(host, target));
+    }
+    for (Class node = host; node != null; node = node.superclass) {
+      for (Procedure procedure in node.mixin.procedures) {
+        if (!procedure.isStatic) {
+          buildProcedure(host, procedure);
+        }
+      }
+      for (Constructor constructor in node.constructors) {
+        buildConstructor(host, constructor);
+      }
+    }
+    // If the object is callable as a function, set up its call handler.
+    Member callHandler = hierarchy.getDispatchTarget(host, Names.call_);
+    if (callHandler != null) {
+      if (callHandler is Procedure && !callHandler.isAccessor) {
+        constraints.setLoadLocation(value, fieldNames.callHandlerField,
+            getTearOffVariable(host, callHandler));
+      } else {
+        // Generate `this.[call] = this.call.[call]` where [call] is the
+        // call handler field, corresponding to repeatedly reading "call".
+        var environment = new TypeEnvironment(this, host, callHandler);
+        int getter = getMemberGetter(host, callHandler);
+        constraints.setLoadLocation(value, fieldNames.callHandlerField,
+            environment.getLoad(getter, fieldNames.callHandlerField));
+      }
+    }
+  }
+
+  void buildStaticField(Field field) {
+    var environment = new Environment(this, null, field);
+    int initializer = field.initializer == null
+        ? nullNode
+        : new StatementBuilder(this, environment)
+            .buildExpression(field.initializer);
+    environment.addAssign(initializer, getSharedFieldVariable(field));
+  }
+
+  void buildProcedure(Class hostClass, Procedure node) {
+    if (node.isAbstract) return;
+    int host = hostClass == null ? null : getInstanceVariable(hostClass);
+    int function = getTearOffVariable(hostClass, node);
+    int returnVariable = getReturnVariable(hostClass, node);
+    var environment = new Environment(this, hostClass, node,
+        returnVariable: returnVariable, thisVariable: host);
+    buildFunctionNode(node.function, environment,
+        addTypeBasedSummary: node.isExternal, function: function);
+  }
+
+  int getDeclarationSiteFieldInitializer(Field field) {
+    if (field.initializer == null) return nullNode;
+    return declarationSiteFieldInitializer[field] ??=
+        _makeDeclarationSiteFieldInitializer(field);
+  }
+
+  int _makeDeclarationSiteFieldInitializer(Field field) {
+    final initializerEnvironment = new Environment(this, null, field);
+    return new StatementBuilder(this, initializerEnvironment)
+        .buildExpression(field.initializer);
+  }
+
+  void buildConstructor(Class hostClass, Constructor node) {
+    int host = getInstanceVariable(hostClass);
+    var environment =
+        new Environment(this, hostClass, node, thisVariable: host);
+    buildFunctionNode(node.function, environment);
+    InitializerBuilder builder = new InitializerBuilder(this, environment);
+    Set<Field> initializedFields = new Set<Field>();
+    for (Initializer initializer in node.initializers) {
+      builder.build(initializer);
+      if (initializer is FieldInitializer) {
+        initializedFields.add(initializer.field);
+      }
+    }
+    for (Field field in node.enclosingClass.mixin.fields) {
+      if (field.isInstanceMember) {
+        // Note: ensure the initializer is built even if it is not used.
+        int initializer = getDeclarationSiteFieldInitializer(field);
+        if (!initializedFields.contains(field)) {
+          int variable = getFieldVariable(hostClass, field);
+          environment.addAssign(initializer, variable);
+        }
+      }
+    }
+  }
+
+  /// Builds constraints to model the behavior of the given function.
+  ///
+  /// If the function is external, [addTypeBasedSummary] should be `true`;
+  /// its parameter and return type are then used to model its behavior instead
+  /// of the body.
+  ///
+  /// [function] should be a variable holding the function object itself, if
+  /// such an object exists (which is always the case except for constructors,
+  /// which currently do have function values).
+  void buildFunctionNode(FunctionNode node, Environment environment,
+      {int function, bool addTypeBasedSummary: false}) {
+    var expressionBuilder =
+        new StatementBuilder(this, environment).expressionBuilder;
+    int minArity = node.requiredParameterCount;
+    int maxArity = node.positionalParameters.length;
+    for (int i = 0; i < node.positionalParameters.length; ++i) {
+      var parameter = node.positionalParameters[i];
+      int variable = getParameterVariable(environment.host, parameter);
+      environment.localVariables[parameter] = variable;
+      if (function != null) {
+        for (int arity = minArity; arity <= maxArity; ++arity) {
+          if (i < arity) {
+            environment.addLoad(
+                function, getPositionalParameterField(arity, i), variable);
+          }
+        }
+      }
+      if (i >= node.requiredParameterCount) {
+        int parameterDefault = parameter.initializer == null
+            ? nullNode
+            : expressionBuilder.build(parameter.initializer);
+        environment.addAssign(parameterDefault, variable);
+      }
+      if (addTypeBasedSummary) {
+        buildContravariantType(parameter.type, environment, variable);
+      }
+    }
+    for (int i = 0; i < node.namedParameters.length; ++i) {
+      var parameter = node.namedParameters[i];
+      int variable = getParameterVariable(environment.host, parameter);
+      environment.localVariables[parameter] = variable;
+      if (function != null) {
+        for (int arity = minArity; arity <= maxArity; ++arity) {
+          environment.addLoad(function,
+              getNamedParameterField(arity, parameter.name), variable);
+        }
+      }
+      int parameterDefault = parameter.initializer == null
+          ? nullNode
+          : expressionBuilder.build(parameter.initializer);
+      environment.addAssign(parameterDefault, variable);
+      if (addTypeBasedSummary) {
+        buildContravariantType(parameter.type, environment, variable);
+      }
+    }
+    if (environment.returnVariable == null) {
+      environment.returnVariable = newVariable(node, 'return');
+      environment.addSink(
+          environment.returnVariable, getSharedReturnVariable(node));
+    } else {
+      visualizer?.annotateVariable(environment.returnVariable, node, 'return');
+    }
+    if (function != null) {
+      for (int arity = minArity; arity <= maxArity; ++arity) {
+        environment.addStore(
+            function, getReturnField(arity), environment.returnVariable);
+      }
+    }
+    if (addTypeBasedSummary) {
+      int returnFromType = buildCovariantType(node.returnType, environment);
+      environment.addAssign(returnFromType, environment.returnVariable);
+    } else if (node.body != null) {
+      Completion completes =
+          new StatementBuilder(this, environment).build(node.body);
+      if (completes == Completion.Maybe) {
+        // Null is returned when control falls over the end.
+        environment.addAssign(nullNode, environment.returnVariable);
+      }
+    }
+  }
+
+  /// Returns true if we can assume that externals treat the given types as
+  /// covariant.
+  ///
+  /// For example, if an external method returns a `List`, the values stored
+  /// in the list from user code are not considered escaping.
+  bool isAssumedCovariant(Class classNode) {
+    return classNode == coreTypes.listClass ||
+        classNode == coreTypes.mapClass ||
+        classNode == coreTypes.iterableClass ||
+        classNode == coreTypes.iteratorClass ||
+        classNode == coreTypes.futureClass ||
+        classNode == coreTypes.streamClass;
+  }
+
+  Set<String> _unsupportedNodes = new Set<String>();
+
+  int unsupported(Node node) {
+    if (verbose && _unsupportedNodes.add('${node.runtimeType}')) {
+      print('Unsupported: ${node.runtimeType}');
+    }
+    return dynamicNode;
+  }
+}
+
+/// Generates unique IDs for fields in the constraint system.
+///
+/// We use several fields in the constraint system that do not correspond to
+/// Dart fields.  A "field" in this context should be seen as a storage location
+/// that is specific to an instance.
+class FieldNames {
+  final TupleCanonicalizer _table = new TupleCanonicalizer();
+  static const int _TagName = 1;
+  static const int _TagPositionalParameter = 2;
+  static const int _TagNamedParameter = 3;
+  static const int _TagReturn = 4;
+  static const int _TagTypeParameter = 5;
+  static const int _TagCallHandler = 6;
+
+  /// Field mapping an object to the function value that should be invoked when
+  /// the object is called as a function.
+  ///
+  /// This is the equivalent of repeatedly reading the "call" property of an
+  /// object until a function value is found.
+  int callHandlerField;
+
+  FieldNames() {
+    callHandlerField = _table.get1(_TagCallHandler);
+  }
+
+  /// Field representing the value returned from a getter, passed into a setter,
+  /// or stored in a Dart field with the given name.
+  int getPropertyField(Name name) {
+    return _table.get2(_TagName, name);
+  }
+
+  /// Field representing the given positional parameter passed to a method
+  /// invoked with the given arity.
+  int getPositionalParameterField(int arity, int position) {
+    return _table.get3(_TagPositionalParameter, arity, position);
+  }
+
+  /// Field representing the given named parameter passed to a method invoked
+  /// with the given arity.
+  int getNamedParameterField(int arity, String name) {
+    return _table.get3(_TagNamedParameter, arity, name);
+  }
+
+  /// Field representing the return value of a method invoked the given arity.
+  int getReturnField(int arity) {
+    return _table.get2(_TagReturn, arity);
+  }
+
+  /// Field representing the values that would be checked against the given
+  /// type parameter in checked mode.
+  ///
+  /// The type-based modeling of externals uses this to handle types that
+  /// involve type variables.  Roughly speaking, we assume that a method whose
+  /// return type is a type variable T can return any value that was passed into
+  /// any parameter of type T.  In particular, this is used to model the
+  /// external backend storage in collection types.
+  ///
+  /// This field keeps track of the values that may flow into and out of a
+  /// type variable for a given instance.
+  int getTypeParameterField(TypeParameter parameter) {
+    return _table.get2(_TagTypeParameter, parameter);
+  }
+
+  int get length => _table.length;
+
+  String getDiagnosticNameOfField(int field) {
+    List<Object> tuple = _table.getFromIndex(field);
+    switch (tuple[0]) {
+      case _TagName:
+        return '${tuple[1]}';
+      case _TagPositionalParameter:
+        return 'pos(${tuple[1]},${tuple[2]})';
+      case _TagNamedParameter:
+        return 'named(${tuple[1]},${tuple[2]})';
+      case _TagReturn:
+        return 'return(${tuple[1]})';
+      case _TagTypeParameter:
+        return 'type-param(${tuple[1]})';
+      case _TagCallHandler:
+        return 'call-handler()';
+      default:
+        return '!error';
+    }
+  }
+}
+
+class TypeEnvironment {
+  final Builder builder;
+  final Class host;
+  final Member member;
+  int thisVariable;
+
+  ConstraintSystem get constraints => builder.constraints;
+  Visualizer get visualizer => builder.visualizer;
+
+  TypeEnvironment(this.builder, this.host, this.member, {this.thisVariable});
+
+  void addAssign(int source, int destination) {
+    constraints.addAssign(source, destination);
+    visualizer?.annotateAssign(source, destination, member);
+  }
+
+  int getJoin(int first, int second) {
+    // TODO(asgerf): Avoid redundant joins in common cases.
+    int joinPoint = constraints.newVariable();
+    addAssign(first, joinPoint);
+    addAssign(second, joinPoint);
+    return joinPoint;
+  }
+
+  int getLoad(int object, int field) {
+    int variable = builder._loads.lookup(object, field);
+    if (variable != null) return variable;
+    variable = constraints.newVariable();
+    constraints.addLoad(object, field, variable);
+    visualizer?.annotateLoad(object, field, variable, member);
+    builder._loads.put(variable);
+    return variable;
+  }
+
+  void addLoad(int object, int field, int destination) {
+    constraints.addLoad(object, field, destination);
+    visualizer?.annotateLoad(object, field, destination, member);
+  }
+
+  int getStore(int object, int field) {
+    int variable = builder._stores.lookup(object, field);
+    if (variable != null) return variable;
+    variable = constraints.newVariable();
+    constraints.addStore(object, field, variable);
+    visualizer?.annotateStore(object, field, variable, member);
+    builder._stores.put(variable);
+    return variable;
+  }
+
+  void addStore(int object, int field, int source) {
+    addAssign(source, getStore(object, field));
+  }
+
+  void addSink(int source, int sink) {
+    constraints.addSink(source, sink);
+    visualizer?.annotateSink(source, sink, member);
+  }
+}
+
+class Environment extends TypeEnvironment {
+  final Map<VariableDeclaration, int> localVariables;
+  int returnVariable;
+
+  Environment(Builder builder, Class host, Member member,
+      {int thisVariable, this.returnVariable})
+      : localVariables = <VariableDeclaration, int>{},
+        super(builder, host, member, thisVariable: thisVariable);
+
+  Environment.inner(Environment outer, {this.returnVariable})
+      : localVariables = outer.localVariables,
+        super(outer.builder, outer.host, outer.member,
+            thisVariable: outer.thisVariable);
+
+  int getVariable(VariableDeclaration variable) {
+    return localVariables[variable] ??= builder.newVariable(variable);
+  }
+}
+
+class ExpressionBuilder extends ExpressionVisitor<int> {
+  final Builder builder;
+  final Environment environment;
+  final StatementBuilder statementBuilder;
+
+  ConstraintSystem get constraints => builder.constraints;
+  Visualizer get visualizer => builder.visualizer;
+  FieldNames get fieldNames => builder.fieldNames;
+
+  ExpressionBuilder(this.builder, this.statementBuilder, this.environment);
+
+  int build(Expression node) {
+    int variable = node.accept(this);
+    visualizer?.annotateVariable(variable, node);
+    return variable;
+  }
+
+  int unsupported(Expression node) {
+    return builder.unsupported(node);
+  }
+
+  defaultExpression(Expression node) {
+    return unsupported(node);
+  }
+
+  int visitInvalidExpression(InvalidExpression node) {
+    return builder.bottomNode;
+  }
+
+  int visitVariableGet(VariableGet node) {
+    return environment.getVariable(node.variable);
+  }
+
+  int visitVariableSet(VariableSet node) {
+    int rightHandSide = build(node.value);
+    int variable = environment.getVariable(node.variable);
+    environment.addAssign(rightHandSide, variable);
+    return rightHandSide;
+  }
+
+  int visitPropertyGet(PropertyGet node) {
+    if (node.receiver is ThisExpression) {
+      Class host = environment.host;
+      Member target = builder.hierarchy.getDispatchTarget(host, node.name);
+      int source = builder.getMemberGetter(host, target);
+      return source == null ? builder.bottomNode : source;
+    }
+    int object = build(node.receiver);
+    int field = fieldNames.getPropertyField(node.name);
+    return environment.getLoad(object, field);
+  }
+
+  int visitPropertySet(PropertySet node) {
+    int object = build(node.receiver);
+    int rightHandSide = build(node.value);
+    if (node.receiver is ThisExpression) {
+      Class host = environment.host;
+      Member target =
+          builder.hierarchy.getDispatchTarget(host, node.name, setter: true);
+      int destination = builder.getMemberSetter(host, target);
+      if (destination != null) {
+        environment.addAssign(rightHandSide, destination);
+      }
+      return rightHandSide;
+    }
+    int field = fieldNames.getPropertyField(node.name);
+    environment.addStore(object, field, rightHandSide);
+    return rightHandSide;
+  }
+
+  int visitDirectPropertyGet(DirectPropertyGet node) {
+    return builder.getMemberGetter(environment.host, node.target);
+  }
+
+  int visitDirectPropertySet(DirectPropertySet node) {
+    int rightHandSide = build(node.value);
+    int destination = builder.getMemberSetter(environment.host, node.target);
+    if (destination != null) {
+      environment.addAssign(rightHandSide, destination);
+    }
+    return rightHandSide;
+  }
+
+  int visitSuperPropertyGet(SuperPropertyGet node) {
+    return unsupported(node);
+  }
+
+  int visitSuperPropertySet(SuperPropertySet node) {
+    build(node.value);
+    return unsupported(node);
+  }
+
+  int visitStaticGet(StaticGet node) {
+    return builder.getMemberGetter(null, node.target);
+  }
+
+  int visitStaticSet(StaticSet node) {
+    int rightHandSide = build(node.value);
+    int destination = builder.getMemberSetter(null, node.target);
+    assert(destination != null); // Static accessors must be valid.
+    environment.addAssign(rightHandSide, destination);
+    return rightHandSide;
+  }
+
+  int visitMethodInvocation(MethodInvocation node) {
+    // Resolve calls on 'this' directly.
+    if (node.receiver is ThisExpression) {
+      Class host = environment.host;
+      Member target = builder.hierarchy.getDispatchTarget(host, node.name);
+      if (target is Procedure && !target.isAccessor) {
+        FunctionNode function = target.function;
+        passArgumentsToFunction(node.arguments, host, function);
+        return builder.getReturnVariable(host, target);
+      }
+    }
+    // Dispatch call dynamically.
+    int receiver = build(node.receiver);
+    int methodProperty = builder.getPropertyField(node.name);
+    int function = node.name.name == 'call'
+        ? receiver
+        : environment.getLoad(receiver, methodProperty);
+    // We have to dispatch through any number of 'call' getters to get to
+    // the actual function.  The 'call handler' field unfolds all the 'call'
+    // getters and refers directly to the actual function (if it exists).
+    // TODO(asgerf): When we have strong mode types, skip the 'call handler'
+    //     load if the static type system resolves the target to a method.
+    //     It is only needed for getters, fields, and untyped calls.
+    int handler = environment.getLoad(function, fieldNames.callHandlerField);
+    visualizer?.annotateVariable(function, node, 'function');
+    visualizer?.annotateVariable(handler, node, 'call handler');
+    int arity = node.arguments.positional.length;
+    for (int i = 0; i < node.arguments.positional.length; ++i) {
+      int field = builder.getPositionalParameterField(arity, i);
+      int argument = build(node.arguments.positional[i]);
+      environment.addStore(handler, field, argument);
+    }
+    for (int i = 0; i < node.arguments.named.length; ++i) {
+      NamedExpression namedNode = node.arguments.named[i];
+      int field = builder.getNamedParameterField(arity, namedNode.name);
+      int argument = build(namedNode.value);
+      environment.addStore(handler, field, argument);
+    }
+    return environment.getLoad(handler, builder.getReturnField(arity));
+  }
+
+  void passArgumentsToFunction(
+      Arguments node, Class host, FunctionNode function) {
+    // TODO(asgerf): Check that arity matches (although mismatches are rare).
+    for (int i = 0; i < node.positional.length; ++i) {
+      int argument = build(node.positional[i]);
+      if (i < function.positionalParameters.length) {
+        int parameter = builder.getParameterVariable(
+            host, function.positionalParameters[i]);
+        environment.addAssign(argument, parameter);
+      }
+    }
+    for (int i = 0; i < node.named.length; ++i) {
+      NamedExpression namedNode = node.named[i];
+      int argument = build(namedNode.value);
+      // TODO(asgerf): Avoid the slow lookup for named parameters.
+      for (int j = 0; j < function.namedParameters.length; ++j) {
+        var namedParameter = function.namedParameters[j];
+        if (namedParameter.name == namedNode.name) {
+          int parameter = builder.getParameterVariable(host, namedParameter);
+          environment.addAssign(argument, parameter);
+          break;
+        }
+      }
+    }
+  }
+
+  int visitDirectMethodInvocation(DirectMethodInvocation node) {
+    // TODO(asgerf): Support cases where the receiver is not 'this'.
+    passArgumentsToFunction(
+        node.arguments, environment.host, node.target.function);
+    return builder.getReturnVariable(environment.host, node.target);
+  }
+
+  int visitSuperMethodInvocation(SuperMethodInvocation node) {
+    return unsupported(node);
+  }
+
+  void passArgumentsNowhere(Arguments node) {
+    for (int i = 0; i < node.positional.length; ++i) {
+      build(node.positional[i]);
+    }
+    for (int i = 0; i < node.named.length; ++i) {
+      build(node.named[i].value);
+    }
+  }
+
+  int visitStaticInvocation(StaticInvocation node) {
+    if (node.target == builder.identicalFunction) {
+      // Ignore calls to identical() as they cause a lot of spurious escape.
+      passArgumentsNowhere(node.arguments);
+      return builder.boolNode;
+    }
+    passArgumentsToFunction(node.arguments, null, node.target.function);
+    return builder.getReturnVariable(null, node.target);
+  }
+
+  int visitConstructorInvocation(ConstructorInvocation node) {
+    Class host = node.target.enclosingClass;
+    passArgumentsToFunction(node.arguments, host, node.target.function);
+    return builder.getInstanceVariable(host);
+  }
+
+  int visitNot(Not node) {
+    build(node.operand);
+    return builder.boolNode;
+  }
+
+  int visitLogicalExpression(LogicalExpression node) {
+    build(node.left);
+    build(node.right);
+    return builder.boolNode;
+  }
+
+  int visitConditionalExpression(ConditionalExpression node) {
+    build(node.condition);
+    int then = build(node.then);
+    int otherwise = build(node.otherwise);
+    return environment.getJoin(then, otherwise);
+  }
+
+  int visitStringConcatenation(StringConcatenation node) {
+    for (int i = 0; i < node.expressions.length; ++i) {
+      build(node.expressions[i]);
+    }
+    return builder.stringNode;
+  }
+
+  int visitIsExpression(IsExpression node) {
+    build(node.operand);
+    return builder.boolNode;
+  }
+
+  int visitAsExpression(AsExpression node) {
+    return build(node.operand);
+  }
+
+  int visitSymbolLiteral(SymbolLiteral node) {
+    return builder.symbolNode;
+  }
+
+  int visitTypeLiteral(TypeLiteral node) {
+    return builder.typeNode;
+  }
+
+  int visitThisExpression(ThisExpression node) {
+    return environment.thisVariable;
+  }
+
+  int visitRethrow(Rethrow node) {
+    return builder.bottomNode;
+  }
+
+  int visitThrow(Throw node) {
+    build(node.expression);
+    return builder.bottomNode;
+  }
+
+  int visitListLiteral(ListLiteral node) {
+    var object = builder.listNode;
+    TypeParameter parameter = builder.coreTypes.listClass.typeParameters.single;
+    int field = fieldNames.getTypeParameterField(parameter);
+    for (int i = 0; i < node.expressions.length; ++i) {
+      int content = build(node.expressions[i]);
+      environment.addStore(object, field, content);
+    }
+    return object;
+  }
+
+  int visitMapLiteral(MapLiteral node) {
+    var object = builder.mapNode;
+    List<TypeParameter> parameters = builder.coreTypes.mapClass.typeParameters;
+    int keys = fieldNames.getTypeParameterField(parameters[0]);
+    int values = fieldNames.getTypeParameterField(parameters[1]);
+    for (int i = 0; i < node.entries.length; ++i) {
+      var entry = node.entries[i];
+      environment.addStore(object, keys, build(entry.key));
+      environment.addStore(object, values, build(entry.value));
+    }
+    return object;
+  }
+
+  int visitAwaitExpression(AwaitExpression node) {
+    return unsupported(node);
+  }
+
+  int visitFunctionExpression(FunctionExpression node) {
+    return buildInnerFunction(node.function);
+  }
+
+  int visitStringLiteral(StringLiteral node) {
+    return builder.stringNode;
+  }
+
+  int visitIntLiteral(IntLiteral node) {
+    return builder.intNode;
+  }
+
+  int visitDoubleLiteral(DoubleLiteral node) {
+    return builder.doubleNode;
+  }
+
+  int visitBoolLiteral(BoolLiteral node) {
+    return builder.boolNode;
+  }
+
+  int visitNullLiteral(NullLiteral node) {
+    return builder.nullNode;
+  }
+
+  int visitLet(Let node) {
+    environment.localVariables[node.variable] =
+        build(node.variable.initializer);
+    return build(node.body);
+  }
+
+  int buildInnerFunction(FunctionNode node, {VariableDeclaration self}) {
+    int variable = builder.newFunction(node);
+    if (self != null) {
+      assert(!environment.localVariables.containsKey(self));
+      environment.localVariables[self] = variable;
+    }
+    Environment inner = new Environment.inner(environment);
+    builder.buildFunctionNode(node, inner, function: variable);
+    return variable;
+  }
+}
+
+/// Indicates whether a statement can complete normally.
+enum Completion {
+  /// The statement might complete normally.
+  Maybe,
+
+  /// The statement never completes normally, because it throws, returns,
+  /// breaks, loops forever, etc.
+  Never,
+}
+
+Completion neverCompleteIf(bool condition) {
+  return condition ? Completion.Never : Completion.Maybe;
+}
+
+Completion completeIfBoth(Completion first, Completion second) {
+  return first == Completion.Maybe && second == Completion.Maybe
+      ? Completion.Maybe
+      : Completion.Never;
+}
+
+Completion completeIfEither(Completion first, Completion second) {
+  return first == Completion.Maybe || second == Completion.Maybe
+      ? Completion.Maybe
+      : Completion.Never;
+}
+
+bool _isTrueConstant(Expression node) {
+  return node is BoolLiteral && node.value == true;
+}
+
+bool _isThrowing(Expression node) {
+  return node is Throw || node is Rethrow;
+}
+
+/// Translates a statement to constraints.
+///
+/// The visit methods return a [Completion] indicating if the statement can
+/// complete normally.  This is used to check if null can be returned due to
+/// control falling over the end of the method.
+class StatementBuilder extends StatementVisitor<Completion> {
+  final Builder builder;
+  final Environment environment;
+  ExpressionBuilder expressionBuilder;
+
+  ConstraintSystem get constraints => builder.constraints;
+  Visualizer get visualizer => builder.visualizer;
+  FieldNames get names => builder.fieldNames;
+
+  StatementBuilder(this.builder, this.environment) {
+    expressionBuilder = new ExpressionBuilder(builder, this, environment);
+  }
+
+  Completion build(Statement node) => node.accept(this);
+
+  Completion buildOptional(Statement node) {
+    return node != null ? node.accept(this) : Completion.Maybe;
+  }
+
+  int buildExpression(Expression node) {
+    return expressionBuilder.build(node);
+  }
+
+  void unsupported(Statement node) {
+    builder.unsupported(node);
+  }
+
+  Completion visitInvalidStatement(InvalidStatement node) => Completion.Never;
+
+  visitExpressionStatement(ExpressionStatement node) {
+    buildExpression(node.expression);
+    return neverCompleteIf(_isThrowing(node.expression));
+  }
+
+  visitBlock(Block node) {
+    for (int i = 0; i < node.statements.length; ++i) {
+      if (build(node.statements[i]) == Completion.Never) {
+        return Completion.Never;
+      }
+    }
+    return Completion.Maybe;
+  }
+
+  visitEmptyStatement(EmptyStatement node) => Completion.Maybe;
+
+  visitAssertStatement(AssertStatement node) {
+    unsupported(node);
+    return Completion.Maybe;
+  }
+
+  visitLabeledStatement(LabeledStatement node) {
+    build(node.body);
+    // We don't track reachability of breaks in the body, so just assume we
+    // might hit a break.
+    return Completion.Maybe;
+  }
+
+  visitBreakStatement(BreakStatement node) => Completion.Never;
+
+  visitWhileStatement(WhileStatement node) {
+    buildExpression(node.condition);
+    build(node.body);
+    return neverCompleteIf(_isTrueConstant(node.condition));
+  }
+
+  visitDoStatement(DoStatement node) {
+    build(node.body);
+    buildExpression(node.condition);
+    return neverCompleteIf(_isTrueConstant(node.condition));
+  }
+
+  visitForStatement(ForStatement node) {
+    for (int i = 0; i < node.variables.length; ++i) {
+      build(node.variables[i]);
+    }
+    if (node.condition != null) {
+      buildExpression(node.condition);
+    }
+    for (int i = 0; i < node.updates.length; ++i) {
+      buildExpression(node.updates[i]);
+    }
+    build(node.body);
+    return neverCompleteIf(_isTrueConstant(node.condition));
+  }
+
+  visitForInStatement(ForInStatement node) {
+    int iterable = buildExpression(node.iterable);
+    int iterator = environment.getLoad(iterable, builder.iteratorField);
+    int current = environment.getLoad(iterator, builder.currentField);
+    int variable = environment.getVariable(node.variable);
+    environment.addAssign(current, variable);
+    build(node.body);
+    return Completion.Maybe;
+  }
+
+  visitSwitchStatement(SwitchStatement node) {
+    buildExpression(node.expression);
+    Completion lastCanComplete = Completion.Maybe;
+    for (int i = 0; i < node.cases.length; ++i) {
+      // There is no need to visit the expression since constants cannot
+      // have side effects.
+      // Note that only the last case can actually fall out of the switch,
+      // as the others will throw an exception if they fall through.
+      // Also note that breaks from the switch have been desugared to breaks
+      // to a [LabeledStatement].
+      lastCanComplete = build(node.cases[i].body);
+    }
+    return lastCanComplete;
+  }
+
+  visitContinueSwitchStatement(ContinueSwitchStatement node) {
+    return Completion.Never;
+  }
+
+  visitIfStatement(IfStatement node) {
+    buildExpression(node.condition);
+    Completion thenCompletes = build(node.then);
+    Completion elseCompletes = buildOptional(node.otherwise);
+    return completeIfEither(thenCompletes, elseCompletes);
+  }
+
+  visitReturnStatement(ReturnStatement node) {
+    if (node.expression != null) {
+      int returned = buildExpression(node.expression);
+      environment.addAssign(returned, environment.returnVariable);
+    }
+    return Completion.Never;
+  }
+
+  visitTryCatch(TryCatch node) {
+    Completion bodyCompletes = build(node.body);
+    Completion catchCompletes = Completion.Never;
+    for (int i = 0; i < node.catches.length; ++i) {
+      Catch catchNode = node.catches[i];
+      if (catchNode.exception != null) {
+        environment.localVariables[catchNode.exception] = builder.dynamicNode;
+      }
+      if (catchNode.stackTrace != null) {
+        environment.localVariables[catchNode.stackTrace] = builder.dynamicNode;
+      }
+      if (build(catchNode.body) == Completion.Maybe) {
+        catchCompletes = Completion.Maybe;
+      }
+    }
+    return completeIfEither(bodyCompletes, catchCompletes);
+  }
+
+  visitTryFinally(TryFinally node) {
+    Completion bodyCompletes = build(node.body);
+    Completion finalizerCompletes = build(node.finalizer);
+    return completeIfBoth(bodyCompletes, finalizerCompletes);
+  }
+
+  visitYieldStatement(YieldStatement node) {
+    unsupported(node);
+    return Completion.Maybe;
+  }
+
+  visitVariableDeclaration(VariableDeclaration node) {
+    int initializer = node.initializer == null
+        ? builder.nullNode
+        : buildExpression(node.initializer);
+    int variable = environment.getVariable(node);
+    environment.addAssign(initializer, variable);
+    return neverCompleteIf(_isThrowing(node.initializer));
+  }
+
+  visitFunctionDeclaration(FunctionDeclaration node) {
+    expressionBuilder.buildInnerFunction(node.function, self: node.variable);
+    return Completion.Maybe;
+  }
+}
+
+class InitializerBuilder extends InitializerVisitor<Null> {
+  final Builder builder;
+  final Environment environment;
+  ExpressionBuilder expressionBuilder;
+
+  FieldNames get fieldNames => builder.fieldNames;
+
+  InitializerBuilder(this.builder, this.environment) {
+    expressionBuilder =
+        new StatementBuilder(builder, environment).expressionBuilder;
+  }
+
+  void build(Initializer node) {
+    node.accept(this);
+  }
+
+  int buildExpression(Expression node) {
+    return expressionBuilder.build(node);
+  }
+
+  visitInvalidInitializer(InvalidInitializer node) {}
+
+  visitFieldInitializer(FieldInitializer node) {
+    int fieldVariable = builder.getFieldVariable(environment.host, node.field);
+    int rightHandSide = buildExpression(node.value);
+    environment.addAssign(rightHandSide, fieldVariable);
+  }
+
+  visitSuperInitializer(SuperInitializer node) {
+    expressionBuilder.passArgumentsToFunction(
+        node.arguments, environment.host, node.target.function);
+  }
+
+  visitRedirectingInitializer(RedirectingInitializer node) {
+    expressionBuilder.passArgumentsToFunction(
+        node.arguments, environment.host, node.target.function);
+  }
+
+  visitLocalInitializer(LocalInitializer node) {
+    environment.localVariables[node.variable] =
+        buildExpression(node.variable.initializer);
+  }
+}
+
+class Names {
+  static final Name current = new Name('current');
+  static final Name iterator = new Name('iterator');
+  static final Name then = new Name('then');
+  static final Name call_ = new Name('call');
+}
+
+/// Returns a variable with the possible values of a given type, as provided
+/// by external code.
+class CovariantExternalTypeVisitor extends DartTypeVisitor<int> {
+  final Builder builder;
+  final TypeEnvironment environment;
+
+  FieldNames get fieldNames => builder.fieldNames;
+
+  CovariantExternalTypeVisitor(this.builder, this.environment);
+
+  void visitContravariant(DartType type, int input) {
+    return new ContravariantExternalTypeVisitor(builder, environment, input)
+        .visit(type);
+  }
+
+  int visit(DartType type) => type.accept(this);
+
+  int visitInvalidType(InvalidType node) {
+    return builder.bottomNode;
+  }
+
+  int visitDynamicType(DynamicType node) {
+    return builder.dynamicNode;
+  }
+
+  int visitVoidType(VoidType node) {
+    return builder.nullNode;
+  }
+
+  int visitInterfaceType(InterfaceType node) {
+    int object = builder.getExternalInstanceVariable(node.classNode);
+    for (int i = 0; i < node.typeArguments.length; ++i) {
+      int field =
+          fieldNames.getTypeParameterField(node.classNode.typeParameters[i]);
+      int outputValue = visit(node.typeArguments[i]);
+      environment.addStore(object, field, outputValue);
+      if (!builder.isAssumedCovariant(node.classNode)) {
+        int userValue = environment.getLoad(object, field);
+        visitContravariant(node.typeArguments[i], userValue);
+      }
+    }
+    return object;
+  }
+
+  int visitTypeParameterType(TypeParameterType node) {
+    if (node.parameter.parent is Class) {
+      assert(environment.thisVariable != null);
+      return environment.getLoad(environment.thisVariable,
+          fieldNames.getTypeParameterField(node.parameter));
+    } else {
+      return builder.getFunctionTypeParameterVariable(node.parameter);
+    }
+  }
+
+  int visitFunctionType(FunctionType node) {
+    // TODO: Handle arity range.
+    int arity = node.positionalParameters.length;
+    int function = builder.functionValueNode;
+    for (int i = 0; i < node.positionalParameters.length; ++i) {
+      int field = fieldNames.getPositionalParameterField(arity, i);
+      int argument = environment.getLoad(function, field);
+      visitContravariant(node.positionalParameters[i], argument);
+    }
+    for (int i = 0; i < node.namedParameters.length; ++i) {
+      var parameter = node.namedParameters[i];
+      int field = fieldNames.getNamedParameterField(arity, parameter.name);
+      int argument = environment.getLoad(function, field);
+      visitContravariant(parameter.type, argument);
+    }
+    int returnVariable = visit(node.returnType);
+    environment.addStore(
+        function, fieldNames.getReturnField(arity), returnVariable);
+    return function;
+  }
+
+  /// Equivalent to visiting the FunctionType for the given function.
+  int buildFunctionNode(FunctionNode node) {
+    int minArity = node.requiredParameterCount;
+    int maxArity = node.positionalParameters.length;
+    Member member = node.parent is Member ? node.parent : null;
+    int function = builder.newFunction(node, member);
+    for (int arity = minArity; arity <= maxArity; ++arity) {
+      for (int i = 0; i < arity; ++i) {
+        int field = fieldNames.getPositionalParameterField(arity, i);
+        int argument = environment.getLoad(function, field);
+        visitContravariant(node.positionalParameters[i].type, argument);
+      }
+    }
+    for (int i = 0; i < node.namedParameters.length; ++i) {
+      VariableDeclaration variable = node.namedParameters[i];
+      for (int arity = minArity; arity <= maxArity; ++arity) {
+        int field = fieldNames.getNamedParameterField(arity, variable.name);
+        int argument = environment.getLoad(function, field);
+        visitContravariant(variable.type, argument);
+      }
+    }
+    int returnVariable = visit(node.returnType);
+    for (int arity = minArity; arity <= maxArity; ++arity) {
+      environment.addStore(
+          function, fieldNames.getReturnField(arity), returnVariable);
+    }
+    return function;
+  }
+}
+
+/// Generates constraints to model the behavior of a value escaping into
+/// external code through a given type.
+class ContravariantExternalTypeVisitor extends DartTypeVisitor<Null> {
+  final Builder builder;
+  final TypeEnvironment environment;
+  final int input;
+
+  FieldNames get fieldNames => builder.fieldNames;
+  ConstraintSystem get constraints => builder.constraints;
+
+  ContravariantExternalTypeVisitor(this.builder, this.environment, this.input);
+
+  void visit(DartType type) {
+    type.accept(this);
+  }
+
+  void visitContravariant(DartType type, int input) {
+    return new ContravariantExternalTypeVisitor(builder, environment, input)
+        .visit(type);
+  }
+
+  int visitCovariant(DartType type) {
+    return new CovariantExternalTypeVisitor(builder, environment).visit(type);
+  }
+
+  visitInvalidType(InvalidType node) {}
+
+  visitDynamicType(DynamicType node) {}
+
+  visitVoidType(VoidType node) {}
+
+  visitInterfaceType(InterfaceType node) {
+    int escapePoint = builder.getInterfaceEscapeVariable(node.classNode);
+    environment.addAssign(input, escapePoint);
+  }
+
+  visitTypeParameterType(TypeParameterType node) {
+    if (node.parameter.parent is Class) {
+      assert(environment.thisVariable != null);
+      environment.addStore(environment.thisVariable,
+          fieldNames.getTypeParameterField(node.parameter), input);
+    } else {
+      environment.addAssign(
+          input, builder.getFunctionTypeParameterVariable(node.parameter));
+    }
+  }
+
+  visitFunctionType(FunctionType node) {
+    int minArity = node.requiredParameterCount;
+    int maxArity = node.positionalParameters.length;
+    for (int i = 0; i < node.positionalParameters.length; ++i) {
+      int argument = visitCovariant(node.positionalParameters[i]);
+      for (int arity = minArity; arity <= maxArity; ++arity) {
+        int field = fieldNames.getPositionalParameterField(arity, i);
+        environment.addStore(input, field, argument);
+      }
+    }
+    for (var parameter in node.namedParameters) {
+      int argument = visitCovariant(parameter.type);
+      for (int arity = minArity; arity <= maxArity; ++arity) {
+        int field = fieldNames.getNamedParameterField(arity, parameter.name);
+        environment.addStore(input, field, argument);
+      }
+    }
+    for (int arity = minArity; arity <= maxArity; ++arity) {
+      int returnLocation =
+          environment.getLoad(input, fieldNames.getReturnField(arity));
+      visitContravariant(node.returnType, returnLocation);
+    }
+  }
+
+  /// Equivalent to visiting the FunctionType for the given function.
+  void buildFunctionNode(FunctionNode node) {
+    int minArity = node.requiredParameterCount;
+    int maxArity = node.positionalParameters.length;
+    for (int arity = minArity; arity <= maxArity; ++arity) {
+      for (int i = 0; i < arity; ++i) {
+        int argument = visitCovariant(node.positionalParameters[i].type);
+        int field = fieldNames.getPositionalParameterField(arity, i);
+        environment.addStore(input, field, argument);
+      }
+    }
+    for (int i = 0; i < node.namedParameters.length; ++i) {
+      VariableDeclaration variable = node.namedParameters[i];
+      int argument = visitCovariant(variable.type);
+      for (int arity = minArity; arity <= maxArity; ++arity) {
+        int field = fieldNames.getNamedParameterField(arity, variable.name);
+        environment.addStore(input, field, argument);
+      }
+    }
+    for (int arity = minArity; arity <= maxArity; ++arity) {
+      int returnLocation =
+          environment.getLoad(input, fieldNames.getReturnField(arity));
+      visitContravariant(node.returnType, returnLocation);
+    }
+  }
+}
diff --git a/pkg/kernel/lib/type_propagation/canonicalizer.dart b/pkg/kernel/lib/type_propagation/canonicalizer.dart
new file mode 100644
index 0000000..420bd01
--- /dev/null
+++ b/pkg/kernel/lib/type_propagation/canonicalizer.dart
@@ -0,0 +1,109 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.type_propagation.canonicalizer;
+
+import 'dart:collection';
+
+/// Generates unique consecutive integer IDs for tuples of variable length.
+class TupleCanonicalizer {
+  final HashMap<List<Object>, int> _table = new HashMap<List<Object>, int>(
+      equals: _contentEquals, hashCode: _contentHashCode);
+  final List<List<Object>> _canonicalList = <List<Object>>[];
+  List<Object> _buffer = [];
+
+  void _push(Object value) {
+    _buffer.add(value);
+  }
+
+  int _finish() {
+    int index = _table[_buffer];
+    if (index == null) {
+      index = _canonicalList.length;
+      _canonicalList.add(_buffer);
+      _table[_buffer] = index;
+      _buffer = [];
+    } else {
+      // The item already existed.  Reuse the buffer object for the next query.
+      _buffer.clear();
+    }
+    return index;
+  }
+
+  /// Generate or get the ID for a "unary tuple".
+  int get1(Object first) {
+    _push(first);
+    return _finish();
+  }
+
+  /// Generate or get the ID for a pair.
+  int get2(Object first, Object second) {
+    _push(first);
+    _push(second);
+    return _finish();
+  }
+
+  /// Generate or get the ID for a triple.
+  int get3(Object first, Object second, Object third) {
+    _push(first);
+    _push(second);
+    _push(third);
+    return _finish();
+  }
+
+  List<Object> getFromIndex(int index) {
+    return _canonicalList[index];
+  }
+
+  int get length => _canonicalList.length;
+
+  static bool _contentEquals(List<Object> first, List<Object> second) {
+    if (first.length != second.length) return false;
+    for (int i = 0; i < first.length; ++i) {
+      if (first[i] != second[i]) return false;
+    }
+    return true;
+  }
+
+  static int _contentHashCode(List<Object> list) {
+    int hash = 0;
+    for (int i = 0; i < list.length; ++i) {
+      hash = (hash * 31 + hash ^ list[i].hashCode) & 0x3fffffff;
+    }
+    return hash;
+  }
+}
+
+/// Maps uint31 pairs to values of type [T].
+class Uint31PairMap<T> {
+  final HashMap<int, T> _table = new HashMap<int, T>(hashCode: _bigintHash);
+  int _key;
+
+  /// Returns the value associated with the given pair, or `null` if no value
+  /// is associated with the pair.
+  ///
+  /// This association can be changed using a subsequent call to [put].
+  T lookup(int x, int y) {
+    assert(x >= 0 && x >> 31 == 0);
+    assert(y >= 0 && y >> 31 == 0);
+    int key = (x << 31) + y;
+    _key = key;
+    return _table[key];
+  }
+
+  /// Associates [value] with the pair previously queried using [lookup].
+  void put(T value) {
+    _table[_key] = value;
+  }
+
+  Iterable<T> get values => _table.values;
+
+  static int _bigintHash(int bigint) {
+  	int x = 0x3fffffff & (bigint >> 31);
+  	int y = 0x3fffffff & bigint;
+    int hash = 0x3fffffff & (x * 1367);
+    hash = 0x3fffffff & (y * 31 + hash ^ y);
+    hash = 0x3fffffff & ((x ^ y) * 31 + hash ^ y);
+    return hash;
+  }
+}
diff --git a/pkg/kernel/lib/type_propagation/constraints.dart b/pkg/kernel/lib/type_propagation/constraints.dart
new file mode 100644
index 0000000..412b43a
--- /dev/null
+++ b/pkg/kernel/lib/type_propagation/constraints.dart
@@ -0,0 +1,175 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.type_propagation.constraints;
+
+import 'canonicalizer.dart';
+
+/// A system of constraints representing dataflow in a Dart program.
+///
+/// The system consists of variables, values, and lattice points, as well as
+/// constraints that express the relationships between these.
+///
+/// Internally, variables, values, and lattice points are represented as
+/// integers starting at 0.  The namespaces for these are overlapping; there is
+/// no runtime tag to distinguish variables from values from lattice points, so
+/// great care must be taken not to mix them up.
+///
+/// Externally, the methods on [ConstraintSystem] apply a layer of sanity checks
+/// using the sign bit to distinguish values from variables and lattice points.
+/// Users should therefore access the constraint system using either its methods
+/// or its fields, but not both.
+///
+/// The constraint system has the traditional Andersen-style constraints:
+///
+///  Allocate: `x = value`
+///  Assign:   `x = y`
+///  Store:    `x.f = y`
+///  Load:     `x = y.f`
+///
+/// Additionally, there is a "sink" constraint which acts as an assignment but
+/// only after the fixed-point has been found.
+///
+/// Lattice points represent sets of values.  All values must belong to one
+/// particular lattice point and are implicitly contained in the value set of
+/// all lattice points above it.
+///
+/// A solution to the constraint system is an assignment from each variable to
+/// a lattice point containing all values that may flow into the variable.
+class ConstraintSystem {
+  int _numberOfVariables = 0;
+  final List<int> assignments = <int>[];
+  final List<int> sinks = <int>[];
+  final List<int> loads = <int>[];
+  final List<int> stores = <int>[];
+  final List<int> allocations = <int>[];
+  final List<int> latticePointOfValue = <int>[];
+  final Uint31PairMap<int> storeLocations = new Uint31PairMap<int>();
+  final Uint31PairMap<int> loadLocations = new Uint31PairMap<int>();
+
+  /// The same as [storeLocations], for traversal instead of fast lookup.
+  final List<int> storeLocationList = <int>[];
+
+  /// The same as [loadLocations], for traversal instead of fast lookup.
+  final List<int> loadLocationList = <int>[];
+  final List<List<int>> parentsOfLatticePoint = <List<int>>[];
+  final List<int> bitmaskInputs = <int>[];
+
+  int get numberOfVariables => _numberOfVariables;
+  int get numberOfValues => latticePointOfValue.length;
+  int get numberOfLatticePoints => parentsOfLatticePoint.length;
+
+  int newVariable() {
+    return _numberOfVariables++;
+  }
+
+  /// Creates a new lattice point, initially representing or containing no
+  /// values.
+  ///
+  /// Values can be added to the lattice point passing it to [newValue] or by
+  /// creating lattice points below it and adding values to those.
+  ///
+  /// The first lattice point created must be an ancestor of all lattice points.
+  int newLatticePoint(List<int> supers) {
+    assert(supers != null);
+    int id = parentsOfLatticePoint.length;
+    parentsOfLatticePoint.add(supers);
+    return id;
+  }
+
+  /// Creates a new value as a member of the given [latticePoint], with the
+  /// given mutable fields.
+  ///
+  /// The lattice point should be specific to this value or the solver will not
+  /// be able to distinguish it from other values in the same lattice point.
+  ///
+  /// To help debugging, this method returns the the negated ID for the value.
+  /// Every method on the constraint system checks that arguments representing
+  /// values are non-positive in order to catch accidental bugs where a
+  /// variable or lattice point was accidentally used in place of a value.
+  int newValue(int latticePoint) {
+    assert(0 <= latticePoint && latticePoint < numberOfLatticePoints);
+    int valueId = latticePointOfValue.length;
+    latticePointOfValue.add(latticePoint);
+    return -valueId;
+  }
+
+  /// Sets [variable] as the storage location for values dynamically stored
+  /// into [field] on [value].
+  ///
+  /// Any store constraint where [value] can reach the receiver will propagate
+  /// the stored value into [variable].
+  void setStoreLocation(int value, int field, int variable) {
+    assert(value <= 0);
+    assert(field >= 0);
+    assert(variable >= 0);
+    value = -value;
+    int location = storeLocations.lookup(value, field);
+    assert(location == null);
+    storeLocations.put(variable);
+    storeLocationList..add(value)..add(field)..add(variable);
+  }
+
+  /// Sets [variable] as the storage location for values dynamically loaded
+  /// from [field] on [value].
+  ///
+  /// Any load constraint where [value] can reach the receiver object will
+  /// propagate the value from [variable] into the result of the load.
+  void setLoadLocation(int value, int field, int variable) {
+    assert(value <= 0);
+    assert(field >= 0);
+    assert(variable >= 0);
+    value = -value;
+    int location = loadLocations.lookup(value, field);
+    assert(location == null);
+    loadLocations.put(variable);
+    loadLocationList..add(value)..add(field)..add(variable);
+  }
+
+  void addAllocation(int value, int destination) {
+    assert(value <= 0);
+    assert(destination >= 0);
+    value = -value;
+    allocations..add(value)..add(destination);
+  }
+
+  void addBitmaskInput(int bitmask, int destination) {
+    bitmaskInputs..add(bitmask)..add(destination);
+  }
+
+  void addAssign(int source, int destination) {
+    assert(source >= 0);
+    assert(destination >= 0);
+    assignments..add(source)..add(destination);
+  }
+
+  void addLoad(int object, int field, int destination) {
+    assert(object >= 0);
+    assert(field >= 0);
+    assert(destination >= 0);
+    loads..add(object)..add(field)..add(destination);
+  }
+
+  void addStore(int object, int field, int source) {
+    assert(object >= 0);
+    assert(field >= 0);
+    assert(source >= 0);
+    stores..add(object)..add(field)..add(source);
+  }
+
+  /// Like an assignment from [source] to [sink], but is only propagated once
+  /// after the fixed-point has been found.
+  ///
+  /// This is for storing the results of the analysis in the [sink] variable
+  /// without intefering with the solver's escape analysis.
+  void addSink(int source, int sink) {
+    assert(source >= 0);
+    assert(sink >= 0);
+    sinks..add(source)..add(sink);
+  }
+
+  int get numberOfAllocations => allocations.length ~/ 2;
+  int get numberOfAssignments => assignments.length ~/ 2;
+  int get numberOfLoads => loads.length ~/ 3;
+  int get numberOfStores => stores.length ~/ 3;
+}
diff --git a/pkg/kernel/lib/type_propagation/solver.dart b/pkg/kernel/lib/type_propagation/solver.dart
new file mode 100644
index 0000000..e0deeaf
--- /dev/null
+++ b/pkg/kernel/lib/type_propagation/solver.dart
@@ -0,0 +1,427 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.type_propagation.solver;
+
+import 'constraints.dart';
+import 'builder.dart';
+import '../class_hierarchy.dart';
+import 'visualizer.dart';
+import 'canonicalizer.dart';
+import 'type_propagation.dart';
+
+class ValueVector {
+  List<int> values;
+  List<int> bitmasks;
+
+  ValueVector(int length)
+      : values = new List<int>.filled(length, Solver.bottom),
+        bitmasks = new List<int>.filled(length, 0);
+}
+
+/// We adopt a Hungarian-like notation in this class to distinguish variables,
+/// values, and lattice points, since they are all integers.
+///
+/// The term "values" (plural) always refers to a lattice point.
+class Solver {
+  final Builder builder;
+  final ConstraintSystem constraints;
+  final FieldNames canonicalizer;
+  final ClassHierarchy hierarchy;
+
+  /// Maps a variable index to a values that may flow into it.
+  final ValueVector valuesInVariable;
+
+  /// Maps a field index to the values that may be stored in the given field on
+  /// any object that escaped into a mega union.
+  final ValueVector valuesStoredOnEscapingObject;
+
+  /// Maps a field index to a lattice point containing all values that may be
+  /// stored into the given field where the receiver is a mega union.
+  ///
+  /// This is a way to avoid propagating such stores into almost every entry
+  /// store location.
+  final ValueVector valuesStoredOnUnknownObject;
+
+  /// Maps a lattice point to a sorted list of its ancestors in the lattice
+  /// (i.e. all lattice points that lie above it, and thus represent less
+  /// precise information).
+  ///
+  /// For this purpose, a lattice point is considered an ancestor of itself and
+  /// occurs as the end of its own ancestor list.
+  ///
+  /// We omit the entry for the lattice top (representing "any value") from all
+  /// the ancestor listss.
+  final List<List<int>> ancestorsOfLatticePoint;
+
+  /// Maps a lattice point to the list of values it contains (i.e. whose leaves
+  /// lie below it in the lattice).
+  ///
+  /// The entries for the `Object` and `Function` lattice points are empty.
+  /// They are special-cased to avoid traversing a huge number of values.
+  final List<List<int>> valuesBelowLatticePoint;
+
+  /// Maps a value to the lowest-indexed lattice point into which it has escaped
+  /// through a join operation.
+  ///
+  /// As a value escapes further up the lattice, more and more stores and loads
+  /// will see it as a potential target.
+  final List<int> valueEscape;
+
+  /// Maps a lattice point to its lowest-indexed ancestor (possibly itself) into
+  /// which all of its members must escape.
+  ///
+  /// Escaping into a lattice point is transitive in the following sense:
+  ///
+  ///    If a value `x` escapes into a lattice point `u`,
+  ///    and `u` escapes into an ancestor lattice point `w`,
+  ///    then `x` also escapes into `w`.
+  ///
+  /// The above rule also applies if the value `x` is replaced with a lattice
+  /// point.
+  ///
+  /// Note that some values below a given lattice point may escape further out
+  /// than the lattice point's own escape level.
+  final List<int> latticePointEscape;
+
+  /// The lattice point containing all functions.
+  final int _functionLatticePoint;
+
+  static const int bottom = -1;
+  static const int rootClass = 0;
+
+  /// Lattice points with more than this number values below it are considered
+  /// "mega unions".
+  ///
+  /// Stores and loads are tracked less precisely on mega unions in order to
+  /// speed up the analysis.
+  ///
+  /// The `Object` and `Function` lattice points are always considered mega
+  /// unions.
+  static const int megaUnionLimit = 100;
+
+  int iterations = 0;
+  bool _changed = false;
+
+  static List<int> _makeIntList(int _) => <int>[];
+
+  Visualizer get visualizer => builder.visualizer;
+
+  Solver(Builder builder)
+      : this.builder = builder,
+        this.constraints = builder.constraints,
+        this.canonicalizer = builder.fieldNames,
+        this.hierarchy = builder.hierarchy,
+        this.valuesInVariable =
+            new ValueVector(builder.constraints.numberOfVariables),
+        this.ancestorsOfLatticePoint = new List<List<int>>.generate(
+            builder.constraints.numberOfLatticePoints, _makeIntList),
+        this.valuesBelowLatticePoint = new List<List<int>>.generate(
+            builder.constraints.numberOfLatticePoints, _makeIntList),
+        this._functionLatticePoint = builder.latticePointForAllFunctions,
+        this.valuesStoredOnEscapingObject =
+            new ValueVector(builder.fieldNames.length),
+        this.valuesStoredOnUnknownObject =
+            new ValueVector(builder.fieldNames.length),
+        this.latticePointEscape =
+            new List<int>.filled(builder.constraints.numberOfLatticePoints, 0),
+        this.valueEscape =
+            new List<int>.filled(builder.constraints.numberOfValues, 0) {
+    // Initialize the lattice and escape data.
+    for (int i = 1; i < constraints.numberOfLatticePoints; ++i) {
+      List<int> parents = constraints.parentsOfLatticePoint[i];
+      List<int> ancestors = ancestorsOfLatticePoint[i];
+      for (int j = 0; j < parents.length; ++j) {
+        ancestors.addAll(ancestorsOfLatticePoint[parents[j]]);
+      }
+      _sortAndRemoveDuplicates(ancestors);
+      ancestors.add(i);
+      latticePointEscape[i] = i;
+    }
+    // Initialize the set of values below in a given lattice point.
+    for (int value = 0; value < constraints.numberOfValues; ++value) {
+      int latticePoint = constraints.latticePointOfValue[value];
+      List<int> ancestors = ancestorsOfLatticePoint[latticePoint];
+      for (int j = 0; j < ancestors.length; ++j) {
+        int ancestor = ancestors[j];
+        if (ancestor == rootClass || ancestor == _functionLatticePoint) {
+          continue;
+        }
+        valuesBelowLatticePoint[ancestor].add(value);
+      }
+      valueEscape[value] = latticePoint;
+    }
+  }
+
+  static void _sortAndRemoveDuplicates(List<int> list) {
+    list.sort();
+    int deleted = 0;
+    for (int i = 1; i < list.length; ++i) {
+      if (list[i] == list[i - 1]) {
+        ++deleted;
+      } else if (deleted > 0) {
+        list[i - deleted] = list[i];
+      }
+    }
+    if (deleted > 0) {
+      list.length -= deleted;
+    }
+  }
+
+  /// Returns a lattice point lying above both of the given points, thus
+  /// guaranteed to over-approximate the set of values in both.
+  ///
+  /// If the lattice point represent classes, the upper bound is a supertype
+  /// that is implemented by both, and for which no more specific supertype
+  /// exists. If multiple such classes exist, an arbitrary but fixed choice is
+  /// made.
+  ///
+  /// The ambiguity means the join operator is not associative, and the analysis
+  /// result can therefore depend on iteration order.
+  //
+  // TODO(asgerf): I think we can fix this by introducing intersection types
+  //   for the class pairs that are ambiguous least upper bounds. This could be
+  //   done as a preprocessing of the constraint system.
+  int join(int point1, int point2) {
+    if (point1 == point2) return point1;
+    // Check if either is the bottom value (-1).
+    if (point1 < 0) return point2;
+    if (point2 < 0) return point1;
+    List<int> ancestorList1 = ancestorsOfLatticePoint[point1];
+    List<int> ancestorList2 = ancestorsOfLatticePoint[point2];
+    // Classes are topologically and numerically sorted, so the more specific
+    // supertypes always occur after the less specific ones.  Traverse both
+    // lists from the right until a common supertype is found.  Starting from
+    // the right ensures we can only find one of the most specific supertypes.
+    int i = ancestorList1.length - 1, j = ancestorList2.length - 1;
+    while (i >= 0 && j >= 0) {
+      int super1 = ancestorList1[i];
+      int super2 = ancestorList2[j];
+      if (super1 < super2) {
+        --j;
+      } else if (super1 > super2) {
+        --i;
+      } else {
+        // Both types have "escaped" into their common super type.
+        _updateEscapeIndex(point1, super1);
+        _updateEscapeIndex(point2, super1);
+        return super1;
+      }
+    }
+    // Both types have escaped into a completely dynamic context.
+    _updateEscapeIndex(point1, rootClass);
+    _updateEscapeIndex(point2, rootClass);
+    return rootClass;
+  }
+
+  void _updateEscapeIndex(int point, int escapeTarget) {
+    if (latticePointEscape[point] > escapeTarget) {
+      latticePointEscape[point] = escapeTarget;
+      _changed = true;
+    }
+  }
+
+  void _initializeAllocations() {
+    List<int> allocations = constraints.allocations;
+    for (int i = 0; i < allocations.length; i += 2) {
+      int destination = allocations[i + 1];
+      int valueId = allocations[i];
+      int point = constraints.latticePointOfValue[valueId];
+      valuesInVariable.values[destination] =
+          join(valuesInVariable.values[destination], point);
+    }
+    List<int> bitmaskInputs = constraints.bitmaskInputs;
+    for (int i = 0; i < bitmaskInputs.length; i += 2) {
+      int destination = bitmaskInputs[i + 1];
+      int bitmask = bitmaskInputs[i];
+      valuesInVariable.bitmasks[destination] |= bitmask;
+    }
+  }
+
+  bool _isMegaUnion(int latticePoint) {
+    return latticePoint == rootClass ||
+        latticePoint == _functionLatticePoint ||
+        valuesBelowLatticePoint[latticePoint].length > megaUnionLimit;
+  }
+
+  void solve() {
+    _initializeAllocations();
+    List<int> assignments = constraints.assignments;
+    List<int> loads = constraints.loads;
+    List<int> stores = constraints.stores;
+    List<int> latticePointOfValue = constraints.latticePointOfValue;
+    Uint31PairMap storeLocations = constraints.storeLocations;
+    Uint31PairMap loadLocations = constraints.loadLocations;
+    do {
+      ++iterations;
+      _changed = false;
+      for (int i = 0; i < assignments.length; i += 2) {
+        int destination = assignments[i + 1];
+        int source = assignments[i];
+        _update(valuesInVariable, destination, valuesInVariable, source);
+      }
+      for (int i = 0; i < stores.length; i += 3) {
+        int sourceVariable = stores[i + 2];
+        int field = stores[i + 1];
+        int objectVariable = stores[i];
+        int objectValues = valuesInVariable.values[objectVariable];
+        if (objectValues == bottom) continue;
+        if (_isMegaUnion(objectValues)) {
+          _update(valuesStoredOnUnknownObject, field, valuesInVariable,
+              sourceVariable);
+        } else {
+          // Store the value on all subtypes that can escape into this
+          // context or worse.
+          List<int> receivers = valuesBelowLatticePoint[objectValues];
+          for (int j = 0; j < receivers.length; ++j) {
+            int receiver = receivers[j];
+            int escape = valueEscape[receiver];
+            if (escape > objectValues) {
+              continue; // Skip receivers that have not escaped this far.
+            }
+            int location = storeLocations.lookup(receiver, field);
+            if (location == null) continue;
+            _update(
+                valuesInVariable, location, valuesInVariable, sourceVariable);
+          }
+        }
+      }
+      for (int i = 0; i < loads.length; i += 3) {
+        int destination = loads[i + 2];
+        int field = loads[i + 1];
+        int objectVariable = loads[i];
+        int objectValues = valuesInVariable.values[objectVariable];
+        if (objectValues == bottom) continue;
+        if (_isMegaUnion(objectValues)) {
+          // Receiver is unknown. Take the value out of the tarpit.
+          _update(valuesInVariable, destination, valuesStoredOnEscapingObject,
+              field);
+        } else {
+          // Load the values stored on all the subtypes that can escape into
+          // this context or worse.
+          List<int> receivers = valuesBelowLatticePoint[objectValues];
+          for (int j = 0; j < receivers.length; ++j) {
+            int receiver = receivers[j];
+            int escape = valueEscape[receiver];
+            if (escape > objectValues) {
+              continue; // Skip receivers that have not escaped this far.
+            }
+            int location = loadLocations.lookup(receiver, field);
+            if (location == null) continue;
+            _update(valuesInVariable, destination, valuesInVariable, location);
+          }
+        }
+      }
+      // Apply the transitive escape rule on the lattice.
+      for (int point = 0; point < latticePointEscape.length; ++point) {
+        int oldEscape = latticePointEscape[point];
+        if (oldEscape == point) continue;
+        List<int> ancestors = ancestorsOfLatticePoint[point];
+        int newEscape = oldEscape;
+        for (int j = 0; j < ancestors.length; ++j) {
+          int ancestor = ancestors[j];
+          if (ancestor < oldEscape) continue;
+          int superEscape = latticePointEscape[ancestor];
+          if (superEscape < newEscape) {
+            newEscape = superEscape;
+          }
+        }
+        if (oldEscape != newEscape) {
+          latticePointEscape[point] = newEscape;
+          _changed = true;
+        }
+      }
+      // Update the escape level of every value.
+      for (int i = 0; i < latticePointOfValue.length; ++i) {
+        int value = i;
+        int latticePoint = latticePointOfValue[value];
+        int oldEscape = valueEscape[value];
+        int newEscape = latticePointEscape[latticePoint];
+        if (newEscape < oldEscape) {
+          valueEscape[value] = newEscape;
+          _changed = true;
+        }
+      }
+      // Handle stores on escaping objects.
+      List<int> storeLocationList = constraints.storeLocationList;
+      for (int i = 0; i < storeLocationList.length; i += 3) {
+        int variable = storeLocationList[i + 2];
+        int field = storeLocationList[i + 1];
+        int objectValue = storeLocationList[i];
+        int escape = valueEscape[objectValue];
+        if (_isMegaUnion(escape)) {
+          _update(
+              valuesInVariable, variable, valuesStoredOnUnknownObject, field);
+        }
+      }
+      // Handle loads from escaping objects.
+      List<int> loadLocationList = constraints.loadLocationList;
+      for (int i = 0; i < loadLocationList.length; i += 3) {
+        int variable = loadLocationList[i + 2];
+        int field = loadLocationList[i + 1];
+        int objectValue = loadLocationList[i];
+        int escape = valueEscape[objectValue];
+        if (_isMegaUnion(escape)) {
+          _update(
+              valuesStoredOnEscapingObject, field, valuesInVariable, variable);
+        }
+      }
+    } while (_changed);
+
+    // Propagate to sinks.
+    // This is done outside the fixed-point iteration so the sink-join does
+    // not cause values to be considered escaping.
+    List<int> sinks = constraints.sinks;
+    for (int i = 0; i < sinks.length; i += 2) {
+      int destination = sinks[i + 1];
+      int source = sinks[i];
+      _update(valuesInVariable, destination, valuesInVariable, source);
+    }
+  }
+
+  void _update(ValueVector destinationVector, int destinationIndex,
+      ValueVector sourceVector, int sourceIndex) {
+    int oldValues = destinationVector.values[destinationIndex];
+    int inputValues = sourceVector.values[sourceIndex];
+    int newValues = join(inputValues, oldValues);
+    if (newValues != oldValues) {
+      destinationVector.values[destinationIndex] = newValues;
+      _changed = true;
+    }
+    int oldBits = destinationVector.bitmasks[destinationIndex];
+    int inputBits = sourceVector.bitmasks[sourceIndex];
+    int newBits = inputBits | oldBits;
+    if (newBits != oldBits) {
+      destinationVector.bitmasks[destinationIndex] = newBits;
+      _changed = true;
+    }
+  }
+
+  /// Returns the index of a lattice point containing all values that can flow
+  /// into the given variable, or [bottom] if nothing can flow into the
+  /// variable.
+  int getVariableValue(int variable) {
+    return valuesInVariable.values[variable];
+  }
+
+  int getVariableBitmask(int variable) {
+    return valuesInVariable.bitmasks[variable];
+  }
+
+  /// Returns the lowest-indexed lattice point into which the given value can
+  /// escape.
+  int getEscapeContext(int value) {
+    return valueEscape[value];
+  }
+
+  InferredValue getValueInferredForVariable(int variable) {
+    assert(variable != null);
+    int latticePoint = valuesInVariable.values[variable];
+    int bitmask = valuesInVariable.bitmasks[variable];
+    if (latticePoint == bottom) {
+      return new InferredValue(null, BaseClassKind.None, bitmask);
+    }
+    InferredValue value = builder.getBaseTypeOfLatticePoint(latticePoint);
+    return value.withBitmask(bitmask);
+  }
+}
diff --git a/pkg/kernel/lib/type_propagation/type_propagation.dart b/pkg/kernel/lib/type_propagation/type_propagation.dart
new file mode 100644
index 0000000..48305c2
--- /dev/null
+++ b/pkg/kernel/lib/type_propagation/type_propagation.dart
@@ -0,0 +1,157 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.type_propagation;
+
+import '../ast.dart';
+import '../class_hierarchy.dart';
+import '../core_types.dart';
+import 'builder.dart';
+import 'solver.dart';
+
+/// High-level interface to type propagation.
+///
+/// This exposes inferred types as [InferredValue], context-insensitively at
+/// the level of function boundaries.  The internal analysis results may be
+/// more precise but their representation is private to the analysis, and
+/// except for diagnostics, clients should only depend on the results exposed
+/// by this interface.
+//
+// TODO(asgerf): Also expose return value of calls.
+// TODO(asgerf): Should we expose the value of all expressions?
+class TypePropagation {
+  final Builder builder;
+  final Solver solver;
+
+  TypePropagation(Program program,
+      {ClassHierarchy hierarchy, CoreTypes coreTypes})
+      : this.withBuilder(
+            new Builder(program, hierarchy: hierarchy, coreTypes: coreTypes));
+
+  TypePropagation.withBuilder(Builder builder)
+      : this.builder = builder,
+        this.solver = new Solver(builder)..solve();
+
+  InferredValue getFieldValue(Field node) {
+    int variable = builder.global.fields[node];
+    if (variable == null) return null;
+    return solver.getValueInferredForVariable(variable);
+  }
+
+  InferredValue getReturnValue(FunctionNode node) {
+    int variable = builder.global.returns[node];
+    if (variable == null) return null;
+    return solver.getValueInferredForVariable(variable);
+  }
+
+  InferredValue getParameterValue(VariableDeclaration node) {
+    int variable = builder.global.parameters[node];
+    if (variable == null) return null;
+    return solver.getValueInferredForVariable(variable);
+  }
+}
+
+enum BaseClassKind { None, Exact, Subclass, Subtype, }
+
+/// An abstract value inferred by type propagation.
+///
+/// Inferred values consist of two parts that each represent a set of values:
+/// its base class and its bitmask.  The InferredValue object represents the
+/// intersection of these two value sets.
+class InferredValue extends Node {
+  final Class baseClass;
+  final BaseClassKind baseClassKind;
+
+  /// A bitmask of the flags defined in [ValueBit], refining the set of values.
+  ///
+  /// These bits will always represent a subset of the values allowed by
+  /// the base class.  For example, if the base class is "subclass of List",
+  /// the bitmask cannot contain [ValueBit.string], as this would contradict the
+  /// base class.
+  ///
+  /// The main use of the bitmask is to track nullability, and to preserve some
+  /// particularly important bits of information in case the no useful base
+  /// class could be found.
+  final int valueBits;
+
+  InferredValue(this.baseClass, this.baseClassKind,
+      [this.valueBits = ValueBit.all]) {
+    assert(baseClass != null || baseClassKind == BaseClassKind.None);
+    assert(baseClass == null || baseClassKind != BaseClassKind.None);
+  }
+
+  InferredValue withBitmask(int newBitmask) {
+    if (newBitmask == valueBits) return this;
+    return new InferredValue(this.baseClass, this.baseClassKind, newBitmask);
+  }
+
+  static final InferredValue nothing =
+      new InferredValue(null, BaseClassKind.None, 0);
+
+  bool get canBeNull => valueBits & ValueBit.null_ != 0;
+  bool get isAlwaysNull => baseClass == null && valueBits == ValueBit.null_;
+
+  /// True if this represents no value at all.
+  ///
+  /// When this value is inferred for a variable, it implies that the
+  /// surrounding code is unreachable.
+  bool get isNothing => baseClass == null && valueBits == 0;
+
+  /// True if the value must be null or a concrete instance of [baseClass].
+  bool get isExact => baseClassKind == BaseClassKind.Exact;
+
+  /// True if the value must be null or a subclass of [baseClass].
+  bool get isSubclass => baseClassKind == BaseClassKind.Subclass;
+
+  /// True if the value must be null or a subtype of [baseClass].
+  bool get isSubtype => baseClassKind == BaseClassKind.Subtype;
+
+  accept(Visitor v) => v.visitInferredValue(this);
+
+  visitChildren(Visitor v) {
+    baseClass?.acceptReference(v);
+  }
+}
+
+/// Defines bits representing value sets for use in [InferredValue.valueBits].
+///
+/// The bitmask defines a partition of the entire value space, so every concrete
+/// value corresponds to exactly one value bit.
+class ValueBit {
+  static const int null_ = 1 << 0;
+  static const int integer = 1 << 1;
+  static const int double_ = 1 << 2;
+  static const int string = 1 << 3;
+
+  /// Bit representing all values other than those above.
+  ///
+  /// This bit ensures that the bitmask represents a complete partition of the
+  /// value space, allowing clients to reason about it as a closed union type.
+  ///
+  /// For example, if [integer] and [string] are the only bits that are set,
+  /// it is safe to conclude that the value can *only* be an integer or string
+  /// as all other potential values are ruled out.
+  static const int other = 1 << 4;
+
+  static const numberOfBits = 5;
+  static const int all = (1 << numberOfBits) - 1;
+
+  static const Map<int, String> names = const <int, String>{
+    null_: 'null',
+    integer: 'int',
+    double_: 'double',
+    string: 'string',
+    other: 'other',
+  };
+
+  static String format(int bitmask) {
+    if (bitmask == all) return '{*}';
+    List<String> list = <String>[];
+    for (int i = 0; i < numberOfBits; ++i) {
+      if (bitmask & (1 << i) != 0) {
+        list.add(names[1 << i] ?? '?');
+      }
+    }
+    return '{${list.join(",")}}';
+  }
+}
diff --git a/pkg/kernel/lib/type_propagation/visualizer.dart b/pkg/kernel/lib/type_propagation/visualizer.dart
new file mode 100644
index 0000000..8cfd86a
--- /dev/null
+++ b/pkg/kernel/lib/type_propagation/visualizer.dart
@@ -0,0 +1,395 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.type_propagation.visualizer;
+
+import 'constraints.dart';
+import 'builder.dart';
+import 'solver.dart';
+import '../ast.dart';
+import '../text/ast_to_text.dart';
+import '../class_hierarchy.dart';
+
+/// Visualizes the constraint system using a Graphviz dot graph.
+///
+/// Variables are visualized as nodes and constraints as labeled edges.
+class Visualizer {
+  final Program program;
+  final Map<int, GraphNode> variableNodes = <int, GraphNode>{};
+  final Map<int, FunctionNode> value2function = <int, FunctionNode>{};
+  final Map<FunctionNode, int> function2value = <FunctionNode, int>{};
+  final Map<int, Annotation> latticePointAnnotation = <int, Annotation>{};
+  final Map<int, Annotation> valueAnnotation = <int, Annotation>{};
+  FieldNames fieldNames;
+  ConstraintSystem constraints;
+  Solver solver;
+  Builder builder;
+
+  ClassHierarchy get hierarchy => builder.hierarchy;
+
+  final Map<Member, Set<GraphNode>> _graphNodesInMember =
+      <Member, Set<GraphNode>>{};
+
+  Visualizer(this.program);
+
+  static Set<GraphNode> _makeGraphNodeSet() => new Set<GraphNode>();
+
+  Annotator getTextAnnotator() {
+    return new TextAnnotator(this);
+  }
+
+  GraphNode getVariableNode(int variable) {
+    return variableNodes[variable] ??= new GraphNode(variable);
+  }
+
+  /// Called from the builder to associate information with a variable.
+  ///
+  /// The [node] has two purposes: it ensures that the variable will show
+  /// up in the graph for a the enclosing member, and the textual form of the
+  /// node will be part of its label.
+  ///
+  /// The optional [info] argument provides additional context beyond the AST
+  /// node.  When a constraint variable has no logical 1:1 corresondence with
+  /// an AST node, it is best to pick a nearby AST node and set the [info] to
+  /// clarify its relationship with the node.
+  void annotateVariable(int variable, TreeNode astNode, [String info]) {
+    if (astNode != null || info != null) {
+      if (astNode is VariableSet ||
+          astNode is PropertySet ||
+          astNode is StaticSet) {
+        // These will also be registered for the right-hand side, which makes
+        // for a better annotation.
+        return;
+      }
+      var node = getVariableNode(variable);
+      Member member = _getEnclosingMember(astNode);
+      node.addAnnotation(member, astNode, info);
+      _graphNodesInMember.putIfAbsent(member, _makeGraphNodeSet).add(node);
+    }
+  }
+
+  void annotateAssign(int source, int destination, TreeNode node) {
+    addEdge(source, destination, _getEnclosingMember(node), '');
+  }
+
+  void annotateSink(int source, int destination, TreeNode node) {
+    addEdge(source, destination, _getEnclosingMember(node), 'sink');
+  }
+
+  void annotateLoad(int object, int field, int destination, Member member) {
+    String fieldName = fieldNames.getDiagnosticNameOfField(field);
+    addEdge(object, destination, member, 'Load[$fieldName]');
+  }
+
+  void annotateStore(int object, int field, int source, Member member) {
+    String fieldName = fieldNames.getDiagnosticNameOfField(field);
+    addEdge(source, object, member, 'Store[$fieldName]');
+  }
+
+  void annotateDirectStore(int object, int field, int source, Member member) {
+    String fieldName = fieldNames.getDiagnosticNameOfField(field);
+    addEdge(source, object, member, 'Store![$fieldName]');
+  }
+
+  void annotateLatticePoint(int point, TreeNode node, [String info]) {
+    latticePointAnnotation[point] = new Annotation(node, info);
+  }
+
+  void annotateValue(int value, TreeNode node, [String info]) {
+    valueAnnotation[value] = new Annotation(node, info);
+  }
+
+  String getLatticePointName(int latticePoint) {
+    if (latticePoint < 0) return 'bottom';
+    return latticePointAnnotation[latticePoint].toLabel();
+  }
+
+  String getValueName(int value) {
+    return valueAnnotation[value].toLabel();
+  }
+
+  static Member _getEnclosingMember(TreeNode node) {
+    while (node != null) {
+      if (node is Member) return node;
+      node = node.parent;
+    }
+    return null;
+  }
+
+  void addEdge(int source, int destination, Member member, String label) {
+    var sourceNode = getVariableNode(source);
+    var destinationNode = getVariableNode(destination);
+    _graphNodesInMember.putIfAbsent(member, _makeGraphNodeSet)
+      ..add(sourceNode)
+      ..add(destinationNode);
+    sourceNode.addEdgeTo(destinationNode, member, label);
+  }
+
+  void annotateFunction(int value, FunctionNode function) {
+    value2function[value] = function;
+    function2value[function] = value;
+  }
+
+  FunctionNode getFunctionFromValue(int value) {
+    return value2function[value];
+  }
+
+  int getFunctionValue(FunctionNode node) {
+    return function2value[node];
+  }
+
+  Set<GraphNode> _getNodesInMember(Member member) {
+    return _graphNodesInMember.putIfAbsent(member, _makeGraphNodeSet);
+  }
+
+  String _getCodeAsLabel(Member member) {
+    String code = debugNodeToString(member);
+    code = escapeLabel(code);
+    // Replace line-breaks with left-aligned breaks.
+    code = code.replaceAll('\n', '\\l');
+    return code;
+  }
+
+  String _getValueLabel(GraphNode node) {
+    int latticePoint = solver.getVariableValue(node.variable);
+    if (latticePoint < 0) return 'bottom';
+    return escapeLabel(shorten(getLatticePointName(latticePoint)));
+  }
+
+  /// Returns the Graphviz Dot code a the subgraph relevant for [member].
+  String dumpMember(Member member) {
+    int freshIdCounter = 0;
+    StringBuffer buffer = new StringBuffer();
+    buffer.writeln('digraph {');
+    String source = _getCodeAsLabel(member);
+    buffer.writeln('source [shape=box,label="$source"]');
+    for (GraphNode node in _getNodesInMember(member)) {
+      int id = node.variable;
+      String label = node.getAnnotationInContextOf(member);
+      // Global nodes have a ton of edges that are visualized specially.
+      // If the global node has a local annotation, also print its annotated
+      // version somewhere, but omit all its edges.
+      if (node.isGlobal) {
+        if (label != '') {
+          label += '\n${node.globalAnnotation.toLabel()}';
+          buffer.writeln('$id [shape=record,label="$label"]');
+        }
+        continue;
+      }
+      String value = _getValueLabel(node);
+      buffer.writeln('$id [shape=record,label="{$label|$value}"]');
+      // Add outgoing edges.
+      // Keep track of all that edges leave the context of the current member
+      // ("external edges").  There can be a huge number of these, so we compact
+      // them into a single outgoing edge so as not to flood the graph.
+      Set<String> outgoingExternalEdgeLabels = new Set<String>();
+      for (Edge edge in node.outputs) {
+        if (edge.to.isLocal(member)) {
+          buffer.writeln('$id -> ${edge.to.variable} [label="${edge.label}"]');
+        } else if (outgoingExternalEdgeLabels.length < 3) {
+          String annotation = edge.to.externalLabel;
+          if (annotation != '') {
+            if (edge.label != '') {
+              annotation = '${edge.label} → $annotation';
+            }
+            outgoingExternalEdgeLabels.add(annotation);
+          }
+        } else if (outgoingExternalEdgeLabels.length == 3) {
+          outgoingExternalEdgeLabels.add('...');
+        }
+      }
+      // Emit the outgoing external edge.
+      if (outgoingExternalEdgeLabels.isNotEmpty) {
+        int freshId = ++freshIdCounter;
+        String outLabel = outgoingExternalEdgeLabels.join('\n');
+        buffer.writeln('x$freshId [shape=box,style=dotted,label="$outLabel"]');
+        buffer.writeln('$id -> x$freshId [style=dotted]');
+      }
+      // Show ingoing external edges. As before, avoid flooding the graph in
+      // case there are too many of them.
+      Set<String> ingoingExternalEdgeLabels = new Set<String>();
+      for (Edge edge in node.inputs) {
+        GraphNode source = edge.from;
+        if (source.isLocal(member)) continue;
+        String annotation = source.externalLabel;
+        if (annotation != '') {
+          if (ingoingExternalEdgeLabels.length < 3) {
+            if (edge.label != '') {
+              annotation = '$annotation → ${edge.label}';
+            }
+            ingoingExternalEdgeLabels.add(annotation);
+          } else {
+            ingoingExternalEdgeLabels.add('...');
+            break;
+          }
+        }
+      }
+      // Emit the ingoing external edge.
+      if (ingoingExternalEdgeLabels.isNotEmpty) {
+        int freshId = ++freshIdCounter;
+        String sourceLabel = ingoingExternalEdgeLabels.join('\n');
+        buffer.writeln('x$freshId '
+            '[shape=box,style=dotted,label="$sourceLabel"]');
+        buffer.writeln('x$freshId -> ${node.variable} [style=dotted]');
+      }
+    }
+    buffer.writeln('}');
+    return '$buffer';
+  }
+}
+
+class Annotation {
+  final TreeNode node;
+  final String info;
+
+  Annotation(this.node, this.info);
+
+  String toLabel() {
+    if (node == null && info == null) return '(missing annotation)';
+    if (node == null) return escapeLabel(info);
+    String label = node is NullLiteral
+        ? 'null literal'
+        : node is FunctionNode ? shorten('${node.parent}') : shorten('$node');
+    if (info != null) {
+      label = '$info: $label';
+    }
+    label = escapeLabel(label);
+    return label;
+  }
+
+  String toLabelWithContext(Member member) {
+    String label = toLabel();
+    if (node == member) {
+      return label;
+    } else {
+      return '$label in $member';
+    }
+  }
+}
+
+class GraphNode {
+  final int variable;
+  final List<Edge> inputs = <Edge>[];
+  final List<Edge> outputs = <Edge>[];
+  final List<Annotation> annotations = <Annotation>[];
+
+  /// The annotation to show when visualized in the context of a given member.
+  final Map<Member, Annotation> annotationForContext = <Member, Annotation>{};
+
+  GraphNode(this.variable);
+
+  bool get isGlobal => annotationForContext.containsKey(null);
+  Annotation get globalAnnotation => annotationForContext[null];
+  bool isInScope(Member member) => annotationForContext.containsKey(member);
+  bool isLocal(Member member) => !isGlobal && isInScope(member);
+
+  /// The label to show for the given node when seen from the context of
+  /// another member.
+  String get externalLabel {
+    if (isGlobal) return globalAnnotation.toLabel();
+    if (annotationForContext.isEmpty) return '$variable';
+    Member member = annotationForContext.keys.first;
+    Annotation annotation = annotationForContext[member];
+    return '$variable:' + annotation.toLabelWithContext(member);
+  }
+
+  String getAnnotationInContextOf(Member member) {
+    if (annotationForContext.isEmpty) return '';
+    Annotation annotation = annotationForContext[member];
+    if (annotation != null) return '$variable:' + annotation.toLabel();
+    annotation =
+        annotationForContext[null] ?? annotationForContext.values.first;
+    return '$variable:' + annotation.toLabelWithContext(member);
+  }
+
+  void addEdgeTo(GraphNode other, Member member, String label) {
+    Edge edge = new Edge(this, other, member, label);
+    outputs.add(edge);
+    other.inputs.add(edge);
+  }
+
+  void addAnnotation(Member member, TreeNode astNode, String info) {
+    var annotation = new Annotation(astNode, info);
+    annotations.add(annotation);
+    annotationForContext[member] = annotation;
+  }
+}
+
+class Edge {
+  final GraphNode from, to;
+  final Member member;
+  final String label;
+
+  Edge(this.from, this.to, this.member, this.label);
+}
+
+final RegExp escapeRegexp = new RegExp('["{}<>|]', multiLine: true);
+
+/// Escapes characters in [text] so it can be used as part of a label.
+String escapeLabel(String text) {
+  return text.replaceAllMapped(escapeRegexp, (m) => '\\${m.group(0)}');
+}
+
+String shorten(String text) {
+  text = text.replaceAll('\n  ', ' ').replaceAll('\n', ' ').trim();
+  if (text.length > 60) {
+    return text.substring(0, 30) + '...' + text.substring(text.length - 27);
+  }
+  return text;
+}
+
+class TextAnnotator extends Annotator {
+  final Visualizer visualizer;
+  final Map<VariableDeclaration, int> variables = <VariableDeclaration, int>{};
+  final Map<FunctionNode, int> functionReturns = <FunctionNode, int>{};
+
+  Builder get builder => visualizer.builder;
+
+  String getReference(Node node, Printer printer) {
+    if (node is Class) return printer.getClassReference(node);
+    if (node is Member) return printer.getMemberReference(node);
+    if (node is Library) return printer.getLibraryReference(node);
+    return debugNodeToString(node);
+  }
+
+  String getValueForVariable(Printer printer, int variable) {
+    if (variable == null) {
+      return '<missing type>';
+    }
+    var value = visualizer.solver.getValueInferredForVariable(variable);
+    return printer.getInferredValueString(value);
+  }
+
+  TextAnnotator(this.visualizer) {
+    // The correspondence between AST and constraint system is exposed by the
+    // builder, but only at the level of Members.
+    // To get to the correspondence at the statement/expression level, we use
+    // the annotation map from the visualizer API.
+    // TODO(asgerf): If we use these annotations for testing, the necessary
+    //   bindings should arguably be part of the API for the Builder.
+    visualizer.variableNodes.forEach((int variable, GraphNode node) {
+      for (Annotation annotation in node.annotations) {
+        if (annotation.node is VariableDeclaration && annotation.info == null) {
+          variables[annotation.node] = variable;
+        }
+        if (annotation.node is FunctionNode && annotation.info == 'return') {
+          functionReturns[annotation.node] = variable;
+        }
+      }
+    });
+  }
+
+  String annotateVariable(Printer printer, VariableDeclaration node) {
+    return getValueForVariable(
+        printer, builder.global.parameters[node] ?? variables[node]);
+  }
+
+  String annotateReturn(Printer printer, FunctionNode node) {
+    if (node.parent is Constructor) return null;
+    return getValueForVariable(printer, builder.global.returns[node]);
+  }
+
+  String annotateField(Printer printer, Field node) {
+    return getValueForVariable(printer, builder.global.fields[node]);
+  }
+}
diff --git a/pkg/kernel/lib/verifier.dart b/pkg/kernel/lib/verifier.dart
new file mode 100644
index 0000000..e40b2c0
--- /dev/null
+++ b/pkg/kernel/lib/verifier.dart
@@ -0,0 +1,309 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.checks;
+
+import 'ast.dart';
+import 'transformations/flags.dart';
+
+void verifyProgram(Program program) {
+  VerifyingVisitor.check(program);
+}
+
+/// Checks that a kernel program is well-formed.
+///
+/// This does not include any kind of type checking.
+class VerifyingVisitor extends RecursiveVisitor {
+  final Set<Class> classes = new Set<Class>();
+  final Set<TypeParameter> typeParameters = new Set<TypeParameter>();
+  final List<VariableDeclaration> variableStack = <VariableDeclaration>[];
+  bool classTypeParametersAreInScope = false;
+
+  Member currentMember;
+  Class currentClass;
+  TreeNode currentParent;
+
+  TreeNode get context => currentMember ?? currentClass;
+
+  static void check(Program program) {
+    program.accept(new VerifyingVisitor());
+  }
+
+  defaultTreeNode(TreeNode node) {
+    visitChildren(node);
+  }
+
+  TreeNode enterParent(TreeNode node) {
+    if (!identical(node.parent, currentParent)) {
+      throw 'Incorrect parent pointer on ${node.runtimeType} in $context. '
+          'Parent pointer is ${node.parent.runtimeType}, '
+          'actual parent is ${currentParent.runtimeType}.';
+    }
+    var oldParent = currentParent;
+    currentParent = node;
+    return oldParent;
+  }
+
+  void exitParent(TreeNode oldParent) {
+    currentParent = oldParent;
+  }
+
+  int enterLocalScope() => variableStack.length;
+
+  void exitLocalScope(int stackHeight) {
+    for (int i = stackHeight; i < variableStack.length; ++i) {
+      undeclareVariable(variableStack[i]);
+    }
+    variableStack.length = stackHeight;
+  }
+
+  void visitChildren(TreeNode node) {
+    var oldParent = enterParent(node);
+    node.visitChildren(this);
+    exitParent(oldParent);
+  }
+
+  void visitWithLocalScope(TreeNode node) {
+    int stackHeight = enterLocalScope();
+    visitChildren(node);
+    exitLocalScope(stackHeight);
+  }
+
+  void declareMember(Member member) {
+    if (member.transformerFlags & TransformerFlag.seenByVerifier != 0) {
+      throw '$member has been declared more than once (${member.location})';
+    }
+    member.transformerFlags |= TransformerFlag.seenByVerifier;
+  }
+
+  void undeclareMember(Member member) {
+    member.transformerFlags &= ~TransformerFlag.seenByVerifier;
+  }
+
+  void declareVariable(VariableDeclaration variable) {
+    if (variable.flags & VariableDeclaration.FlagInScope != 0) {
+      throw '$variable declared more than once (${variable.location})';
+    }
+    variable.flags |= VariableDeclaration.FlagInScope;
+    variableStack.add(variable);
+  }
+
+  void undeclareVariable(VariableDeclaration variable) {
+    variable.flags &= ~VariableDeclaration.FlagInScope;
+  }
+
+  void declareTypeParameters(List<TypeParameter> parameters) {
+    for (int i = 0; i < parameters.length; ++i) {
+      var parameter = parameters[i];
+      if (!typeParameters.add(parameter)) {
+        throw 'Type parameter $parameter redeclared in $context';
+      }
+    }
+  }
+
+  void undeclareTypeParameters(List<TypeParameter> parameters) {
+    typeParameters.removeAll(parameters);
+  }
+
+  void checkVariableInScope(VariableDeclaration variable, TreeNode where) {
+    if (variable.flags & VariableDeclaration.FlagInScope == 0) {
+      throw 'Variable $variable used out of scope in $context '
+          '(${where.location})';
+    }
+  }
+
+  visitProgram(Program program) {
+    for (var library in program.libraries) {
+      for (var class_ in library.classes) {
+        if (!classes.add(class_)) {
+          throw 'Class $class_ declared more than once';
+        }
+      }
+      library.members.forEach(declareMember);
+      for (var class_ in library.classes) {
+        class_.members.forEach(declareMember);
+      }
+    }
+    visitChildren(program);
+    for (var library in program.libraries) {
+      library.members.forEach(undeclareMember);
+      for (var class_ in library.classes) {
+        class_.members.forEach(undeclareMember);
+      }
+    }
+  }
+
+  visitField(Field node) {
+    currentMember = node;
+    var oldParent = enterParent(node);
+    classTypeParametersAreInScope = !node.isStatic;
+    node.initializer?.accept(this);
+    classTypeParametersAreInScope = false;
+    visitList(node.annotations, this);
+    exitParent(oldParent);
+    currentMember = null;
+  }
+
+  visitProcedure(Procedure node) {
+    currentMember = node;
+    var oldParent = enterParent(node);
+    classTypeParametersAreInScope = !node.isStatic;
+    node.function.accept(this);
+    classTypeParametersAreInScope = false;
+    visitList(node.annotations, this);
+    exitParent(oldParent);
+    currentMember = null;
+  }
+
+  visitConstructor(Constructor node) {
+    currentMember = node;
+    classTypeParametersAreInScope = true;
+    // The constructor member needs special treatment due to parameters being
+    // in scope in the initializer list.
+    var oldParent = enterParent(node);
+    int stackHeight = enterLocalScope();
+    visitChildren(node.function);
+    visitList(node.initializers, this);
+    exitLocalScope(stackHeight);
+    classTypeParametersAreInScope = false;
+    visitList(node.annotations, this);
+    exitParent(oldParent);
+    classTypeParametersAreInScope = false;
+    currentMember = null;
+  }
+
+  visitClass(Class node) {
+    currentClass = node;
+    declareTypeParameters(node.typeParameters);
+    var oldParent = enterParent(node);
+    classTypeParametersAreInScope = false;
+    visitList(node.annotations, this);
+    classTypeParametersAreInScope = true;
+    visitList(node.typeParameters, this);
+    visitList(node.fields, this);
+    visitList(node.constructors, this);
+    visitList(node.procedures, this);
+    exitParent(oldParent);
+    undeclareTypeParameters(node.typeParameters);
+    currentClass = null;
+  }
+
+  visitFunctionNode(FunctionNode node) {
+    declareTypeParameters(node.typeParameters);
+    visitWithLocalScope(node);
+    undeclareTypeParameters(node.typeParameters);
+  }
+
+  visitFunctionType(FunctionType node) {
+    for (int i = 1; i < node.namedParameters.length; ++i) {
+      if (node.namedParameters[i - 1].compareTo(node.namedParameters[i]) >= 0) {
+        throw 'Named parameters are not sorted on function type found in '
+            '$context';
+      }
+    }
+    declareTypeParameters(node.typeParameters);
+    for (var typeParameter in node.typeParameters) {
+      typeParameter.bound?.accept(this);
+    }
+    visitList(node.positionalParameters, this);
+    visitList(node.namedParameters, this);
+    node.returnType.accept(this);
+    undeclareTypeParameters(node.typeParameters);
+  }
+
+  visitBlock(Block node) {
+    visitWithLocalScope(node);
+  }
+
+  visitForStatement(ForStatement node) {
+    visitWithLocalScope(node);
+  }
+
+  visitForInStatement(ForInStatement node) {
+    visitWithLocalScope(node);
+  }
+
+  visitLet(Let node) {
+    visitWithLocalScope(node);
+  }
+
+  visitCatch(Catch node) {
+    visitWithLocalScope(node);
+  }
+
+  visitVariableDeclaration(VariableDeclaration node) {
+    visitChildren(node);
+    declareVariable(node);
+  }
+
+  visitVariableGet(VariableGet node) {
+    checkVariableInScope(node.variable, node);
+  }
+
+  visitVariableSet(VariableSet node) {
+    checkVariableInScope(node.variable, node);
+    visitChildren(node);
+  }
+
+  @override
+  defaultMemberReference(Member node) {
+    if (node.transformerFlags & TransformerFlag.seenByVerifier == 0) {
+      throw 'Dangling reference to $node found in $context.\n'
+          'Parent pointer is set to ${node.parent}';
+    }
+  }
+
+  @override
+  visitClassReference(Class node) {
+    if (!classes.contains(node)) {
+      throw 'Dangling reference to $node found in $context.\n'
+          'Parent pointer is set to ${node.parent}';
+    }
+  }
+
+  @override
+  visitTypeParameterType(TypeParameterType node) {
+    var parameter = node.parameter;
+    if (!typeParameters.contains(parameter)) {
+      throw 'Type parameter $parameter referenced out of scope in $context.\n'
+          'Parent pointer is set to ${parameter.parent}';
+    }
+    if (parameter.parent is Class && !classTypeParametersAreInScope) {
+      throw 'Type parameter $parameter referenced from static context '
+          'in $context.\n'
+          'Parent pointer is set to ${parameter.parent}';
+    }
+  }
+
+  @override
+  visitInterfaceType(InterfaceType node) {
+    node.visitChildren(this);
+    if (node.typeArguments.length != node.classNode.typeParameters.length) {
+      throw 'Type $node provides ${node.typeArguments.length} type arguments '
+          'but the class declares ${node.classNode.typeParameters.length} '
+          'parameters. Found in $context.';
+    }
+  }
+}
+
+class CheckParentPointers extends Visitor {
+  static void check(TreeNode node) {
+    node.accept(new CheckParentPointers(node.parent));
+  }
+
+  TreeNode parent;
+
+  CheckParentPointers([this.parent]);
+
+  defaultTreeNode(TreeNode node) {
+    if (node.parent != parent) {
+      throw 'Parent pointer on ${node.runtimeType} '
+          'is ${node.parent.runtimeType} '
+          'but should be ${parent.runtimeType}';
+    }
+    var oldParent = parent;
+    parent = node;
+    node.visitChildren(this);
+    parent = oldParent;
+  }
+}
diff --git a/pkg/kernel/lib/visitor.dart b/pkg/kernel/lib/visitor.dart
new file mode 100644
index 0000000..c48f0d4
--- /dev/null
+++ b/pkg/kernel/lib/visitor.dart
@@ -0,0 +1,315 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.ast.visitor;
+
+import 'ast.dart';
+
+abstract class ExpressionVisitor<R> {
+  R defaultExpression(Expression node) => null;
+  R defaultBasicLiteral(BasicLiteral node) => defaultExpression(node);
+
+  R visitInvalidExpression(InvalidExpression node) => defaultExpression(node);
+  R visitVariableGet(VariableGet node) => defaultExpression(node);
+  R visitVariableSet(VariableSet node) => defaultExpression(node);
+  R visitPropertyGet(PropertyGet node) => defaultExpression(node);
+  R visitPropertySet(PropertySet node) => defaultExpression(node);
+  R visitDirectPropertyGet(DirectPropertyGet node) => defaultExpression(node);
+  R visitDirectPropertySet(DirectPropertySet node) => defaultExpression(node);
+  R visitSuperPropertyGet(SuperPropertyGet node) => defaultExpression(node);
+  R visitSuperPropertySet(SuperPropertySet node) => defaultExpression(node);
+  R visitStaticGet(StaticGet node) => defaultExpression(node);
+  R visitStaticSet(StaticSet node) => defaultExpression(node);
+  R visitMethodInvocation(MethodInvocation node) => defaultExpression(node);
+  R visitDirectMethodInvocation(DirectMethodInvocation node) =>
+      defaultExpression(node);
+  R visitSuperMethodInvocation(SuperMethodInvocation node) =>
+      defaultExpression(node);
+  R visitStaticInvocation(StaticInvocation node) => defaultExpression(node);
+  R visitConstructorInvocation(ConstructorInvocation node) =>
+      defaultExpression(node);
+  R visitNot(Not node) => defaultExpression(node);
+  R visitLogicalExpression(LogicalExpression node) => defaultExpression(node);
+  R visitConditionalExpression(ConditionalExpression node) =>
+      defaultExpression(node);
+  R visitStringConcatenation(StringConcatenation node) =>
+      defaultExpression(node);
+  R visitIsExpression(IsExpression node) => defaultExpression(node);
+  R visitAsExpression(AsExpression node) => defaultExpression(node);
+  R visitSymbolLiteral(SymbolLiteral node) => defaultExpression(node);
+  R visitTypeLiteral(TypeLiteral node) => defaultExpression(node);
+  R visitThisExpression(ThisExpression node) => defaultExpression(node);
+  R visitRethrow(Rethrow node) => defaultExpression(node);
+  R visitThrow(Throw node) => defaultExpression(node);
+  R visitListLiteral(ListLiteral node) => defaultExpression(node);
+  R visitMapLiteral(MapLiteral node) => defaultExpression(node);
+  R visitAwaitExpression(AwaitExpression node) => defaultExpression(node);
+  R visitFunctionExpression(FunctionExpression node) => defaultExpression(node);
+  R visitStringLiteral(StringLiteral node) => defaultBasicLiteral(node);
+  R visitIntLiteral(IntLiteral node) => defaultBasicLiteral(node);
+  R visitDoubleLiteral(DoubleLiteral node) => defaultBasicLiteral(node);
+  R visitBoolLiteral(BoolLiteral node) => defaultBasicLiteral(node);
+  R visitNullLiteral(NullLiteral node) => defaultBasicLiteral(node);
+  R visitLet(Let node) => defaultExpression(node);
+}
+
+abstract class StatementVisitor<R> {
+  R defaultStatement(Statement node) => null;
+
+  R visitInvalidStatement(InvalidStatement node) => defaultStatement(node);
+  R visitExpressionStatement(ExpressionStatement node) =>
+      defaultStatement(node);
+  R visitBlock(Block node) => defaultStatement(node);
+  R visitEmptyStatement(EmptyStatement node) => defaultStatement(node);
+  R visitAssertStatement(AssertStatement node) => defaultStatement(node);
+  R visitLabeledStatement(LabeledStatement node) => defaultStatement(node);
+  R visitBreakStatement(BreakStatement node) => defaultStatement(node);
+  R visitWhileStatement(WhileStatement node) => defaultStatement(node);
+  R visitDoStatement(DoStatement node) => defaultStatement(node);
+  R visitForStatement(ForStatement node) => defaultStatement(node);
+  R visitForInStatement(ForInStatement node) => defaultStatement(node);
+  R visitSwitchStatement(SwitchStatement node) => defaultStatement(node);
+  R visitContinueSwitchStatement(ContinueSwitchStatement node) =>
+      defaultStatement(node);
+  R visitIfStatement(IfStatement node) => defaultStatement(node);
+  R visitReturnStatement(ReturnStatement node) => defaultStatement(node);
+  R visitTryCatch(TryCatch node) => defaultStatement(node);
+  R visitTryFinally(TryFinally node) => defaultStatement(node);
+  R visitYieldStatement(YieldStatement node) => defaultStatement(node);
+  R visitVariableDeclaration(VariableDeclaration node) =>
+      defaultStatement(node);
+  R visitFunctionDeclaration(FunctionDeclaration node) =>
+      defaultStatement(node);
+}
+
+abstract class MemberVisitor<R> {
+  R defaultMember(Member node) => null;
+
+  R visitConstructor(Constructor node) => defaultMember(node);
+  R visitProcedure(Procedure node) => defaultMember(node);
+  R visitField(Field node) => defaultMember(node);
+}
+
+abstract class InitializerVisitor<R> {
+  R defaultInitializer(Initializer node) => null;
+
+  R visitInvalidInitializer(InvalidInitializer node) =>
+      defaultInitializer(node);
+  R visitFieldInitializer(FieldInitializer node) => defaultInitializer(node);
+  R visitSuperInitializer(SuperInitializer node) => defaultInitializer(node);
+  R visitRedirectingInitializer(RedirectingInitializer node) =>
+      defaultInitializer(node);
+  R visitLocalInitializer(LocalInitializer node) => defaultInitializer(node);
+}
+
+class TreeVisitor<R>
+    implements
+        ExpressionVisitor<R>,
+        StatementVisitor<R>,
+        MemberVisitor<R>,
+        InitializerVisitor<R> {
+  R defaultTreeNode(TreeNode node) => null;
+
+  // Expressions
+  R defaultExpression(Expression node) => defaultTreeNode(node);
+  R defaultBasicLiteral(BasicLiteral node) => defaultExpression(node);
+  R visitInvalidExpression(InvalidExpression node) => defaultExpression(node);
+  R visitVariableGet(VariableGet node) => defaultExpression(node);
+  R visitVariableSet(VariableSet node) => defaultExpression(node);
+  R visitPropertyGet(PropertyGet node) => defaultExpression(node);
+  R visitPropertySet(PropertySet node) => defaultExpression(node);
+  R visitDirectPropertyGet(DirectPropertyGet node) => defaultExpression(node);
+  R visitDirectPropertySet(DirectPropertySet node) => defaultExpression(node);
+  R visitSuperPropertyGet(SuperPropertyGet node) => defaultExpression(node);
+  R visitSuperPropertySet(SuperPropertySet node) => defaultExpression(node);
+  R visitStaticGet(StaticGet node) => defaultExpression(node);
+  R visitStaticSet(StaticSet node) => defaultExpression(node);
+  R visitMethodInvocation(MethodInvocation node) => defaultExpression(node);
+  R visitDirectMethodInvocation(DirectMethodInvocation node) =>
+      defaultExpression(node);
+  R visitSuperMethodInvocation(SuperMethodInvocation node) =>
+      defaultExpression(node);
+  R visitStaticInvocation(StaticInvocation node) => defaultExpression(node);
+  R visitConstructorInvocation(ConstructorInvocation node) =>
+      defaultExpression(node);
+  R visitNot(Not node) => defaultExpression(node);
+  R visitLogicalExpression(LogicalExpression node) => defaultExpression(node);
+  R visitConditionalExpression(ConditionalExpression node) =>
+      defaultExpression(node);
+  R visitStringConcatenation(StringConcatenation node) =>
+      defaultExpression(node);
+  R visitIsExpression(IsExpression node) => defaultExpression(node);
+  R visitAsExpression(AsExpression node) => defaultExpression(node);
+  R visitSymbolLiteral(SymbolLiteral node) => defaultExpression(node);
+  R visitTypeLiteral(TypeLiteral node) => defaultExpression(node);
+  R visitThisExpression(ThisExpression node) => defaultExpression(node);
+  R visitRethrow(Rethrow node) => defaultExpression(node);
+  R visitThrow(Throw node) => defaultExpression(node);
+  R visitListLiteral(ListLiteral node) => defaultExpression(node);
+  R visitMapLiteral(MapLiteral node) => defaultExpression(node);
+  R visitAwaitExpression(AwaitExpression node) => defaultExpression(node);
+  R visitFunctionExpression(FunctionExpression node) => defaultExpression(node);
+  R visitStringLiteral(StringLiteral node) => defaultBasicLiteral(node);
+  R visitIntLiteral(IntLiteral node) => defaultBasicLiteral(node);
+  R visitDoubleLiteral(DoubleLiteral node) => defaultBasicLiteral(node);
+  R visitBoolLiteral(BoolLiteral node) => defaultBasicLiteral(node);
+  R visitNullLiteral(NullLiteral node) => defaultBasicLiteral(node);
+  R visitLet(Let node) => defaultExpression(node);
+
+  // Statements
+  R defaultStatement(Statement node) => defaultTreeNode(node);
+  R visitInvalidStatement(InvalidStatement node) => defaultStatement(node);
+  R visitExpressionStatement(ExpressionStatement node) =>
+      defaultStatement(node);
+  R visitBlock(Block node) => defaultStatement(node);
+  R visitEmptyStatement(EmptyStatement node) => defaultStatement(node);
+  R visitAssertStatement(AssertStatement node) => defaultStatement(node);
+  R visitLabeledStatement(LabeledStatement node) => defaultStatement(node);
+  R visitBreakStatement(BreakStatement node) => defaultStatement(node);
+  R visitWhileStatement(WhileStatement node) => defaultStatement(node);
+  R visitDoStatement(DoStatement node) => defaultStatement(node);
+  R visitForStatement(ForStatement node) => defaultStatement(node);
+  R visitForInStatement(ForInStatement node) => defaultStatement(node);
+  R visitSwitchStatement(SwitchStatement node) => defaultStatement(node);
+  R visitContinueSwitchStatement(ContinueSwitchStatement node) =>
+      defaultStatement(node);
+  R visitIfStatement(IfStatement node) => defaultStatement(node);
+  R visitReturnStatement(ReturnStatement node) => defaultStatement(node);
+  R visitTryCatch(TryCatch node) => defaultStatement(node);
+  R visitTryFinally(TryFinally node) => defaultStatement(node);
+  R visitYieldStatement(YieldStatement node) => defaultStatement(node);
+  R visitVariableDeclaration(VariableDeclaration node) =>
+      defaultStatement(node);
+  R visitFunctionDeclaration(FunctionDeclaration node) =>
+      defaultStatement(node);
+
+  // Members
+  R defaultMember(Member node) => defaultTreeNode(node);
+  R visitConstructor(Constructor node) => defaultMember(node);
+  R visitProcedure(Procedure node) => defaultMember(node);
+  R visitField(Field node) => defaultMember(node);
+
+  // Classes
+  R visitClass(Class node) => defaultTreeNode(node);
+
+  // Initializers
+  R defaultInitializer(Initializer node) => defaultTreeNode(node);
+  R visitInvalidInitializer(InvalidInitializer node) =>
+      defaultInitializer(node);
+  R visitFieldInitializer(FieldInitializer node) => defaultInitializer(node);
+  R visitSuperInitializer(SuperInitializer node) => defaultInitializer(node);
+  R visitRedirectingInitializer(RedirectingInitializer node) =>
+      defaultInitializer(node);
+  R visitLocalInitializer(LocalInitializer node) => defaultInitializer(node);
+
+  // Other tree nodes
+  R visitLibrary(Library node) => defaultTreeNode(node);
+  R visitTypeParameter(TypeParameter node) => defaultTreeNode(node);
+  R visitFunctionNode(FunctionNode node) => defaultTreeNode(node);
+  R visitArguments(Arguments node) => defaultTreeNode(node);
+  R visitNamedExpression(NamedExpression node) => defaultTreeNode(node);
+  R visitSwitchCase(SwitchCase node) => defaultTreeNode(node);
+  R visitCatch(Catch node) => defaultTreeNode(node);
+  R visitMapEntry(MapEntry node) => defaultTreeNode(node);
+  R visitProgram(Program node) => defaultTreeNode(node);
+}
+
+class DartTypeVisitor<R> {
+  R defaultDartType(DartType node) => null;
+
+  R visitInvalidType(InvalidType node) => defaultDartType(node);
+  R visitDynamicType(DynamicType node) => defaultDartType(node);
+  R visitVoidType(VoidType node) => defaultDartType(node);
+  R visitBottomType(BottomType node) => defaultDartType(node);
+  R visitInterfaceType(InterfaceType node) => defaultDartType(node);
+  R visitFunctionType(FunctionType node) => defaultDartType(node);
+  R visitTypeParameterType(TypeParameterType node) => defaultDartType(node);
+}
+
+class MemberReferenceVisitor<R> {
+  R defaultMemberReference(Member node) => null;
+
+  R visitFieldReference(Field node) => defaultMemberReference(node);
+  R visitConstructorReference(Constructor node) => defaultMemberReference(node);
+  R visitProcedureReference(Procedure node) => defaultMemberReference(node);
+}
+
+class Visitor<R> extends TreeVisitor<R>
+    implements
+        DartTypeVisitor<R>,
+        MemberReferenceVisitor<R> {
+  /// The catch-all case, except for references.
+  R defaultNode(Node node) => null;
+  R defaultTreeNode(TreeNode node) => defaultNode(node);
+
+  /// Inferred values
+  R visitInferredValue(InferredValue node) => defaultNode(node);
+
+  // DartTypes
+  R defaultDartType(DartType node) => defaultNode(node);
+  R visitInvalidType(InvalidType node) => defaultDartType(node);
+  R visitDynamicType(DynamicType node) => defaultDartType(node);
+  R visitVoidType(VoidType node) => defaultDartType(node);
+  R visitBottomType(BottomType node) => defaultDartType(node);
+  R visitInterfaceType(InterfaceType node) => defaultDartType(node);
+  R visitFunctionType(FunctionType node) => defaultDartType(node);
+  R visitTypeParameterType(TypeParameterType node) => defaultDartType(node);
+
+  // Class references
+  R visitClassReference(Class node) => null;
+
+  // Member references
+  R defaultMemberReference(Member node) => null;
+  R visitFieldReference(Field node) => defaultMemberReference(node);
+  R visitConstructorReference(Constructor node) => defaultMemberReference(node);
+  R visitProcedureReference(Procedure node) => defaultMemberReference(node);
+
+  R visitName(Name node) => defaultNode(node);
+  R visitSupertype(Supertype node) => defaultNode(node);
+  R visitNamedType(NamedType node) => defaultNode(node);
+}
+
+class RecursiveVisitor<R> extends Visitor<R> {
+  R defaultNode(Node node) {
+    node.visitChildren(this);
+    return null;
+  }
+}
+
+/// Visitor that recursively rewrites each node in tree.
+///
+/// Visit methods should return a new node, or the visited node (possibly
+/// mutated), or any node from the visited node's subtree.
+///
+/// Each subclass is responsible for ensuring that the AST remains a tree.
+///
+/// For example, the following transformer replaces every occurrence of
+/// `!(x && y)` with `(!x || !y)`:
+///
+///     class NegationSinker extends Transformer {
+///       @override
+///       Node visitNot(Not node) {
+///         var operand = node.operand.accept(this); // Remember to visit.
+///         if (operand is LogicalExpression && operand.operator == '&&') {
+///           return new LogicalExpression(
+///             new Not(operand.left),
+///             '||',
+///             new Not(operand.right));
+///         }
+///         return node;
+///       }
+///     }
+///
+class Transformer extends TreeVisitor<TreeNode> {
+  /// Replaces a use of a type.
+  ///
+  /// By default, recursion stops at this point.
+  DartType visitDartType(DartType node) => node;
+
+  Supertype visitSupertype(Supertype node) => node;
+
+  TreeNode defaultTreeNode(TreeNode node) {
+    node.transformChildren(this);
+    return node;
+  }
+}
diff --git a/pkg/kernel/pubspec.yaml b/pkg/kernel/pubspec.yaml
new file mode 100644
index 0000000..d4f3420
--- /dev/null
+++ b/pkg/kernel/pubspec.yaml
@@ -0,0 +1,19 @@
+name: kernel
+version: 0.2.0
+author: Dart Team <misc@dartlang.org>
+description: Dart IR (Intermediate Representation)
+homepage: https://github.com/dart-lang/kernel
+environment:
+  sdk: ">=1.8.0"
+dependencies:
+  analyzer: ^0.29.0
+  path: ^1.3.9
+  args: ^0.13.4
+  logging: ^0.11.2
+  package_config: ^1.0.0
+dev_dependencies:
+  test: ^0.12.15+6
+  stack_trace: ^1.6.6
+  ansicolor: ^0.0.9
+dependency_overrides:
+  analyzer: {path: ../analyzer}
diff --git a/pkg/kernel/test/ast_membench.dart b/pkg/kernel/test/ast_membench.dart
new file mode 100644
index 0000000..47eda46
--- /dev/null
+++ b/pkg/kernel/test/ast_membench.dart
@@ -0,0 +1,34 @@
+#!/usr/bin/env dart
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:kernel/kernel.dart';
+import 'dart:io';
+
+/// Builds N copies of the AST for the given program.
+/// Pass --print-metrics to the Dart VM to measure the memory use.
+main(List<String> args) {
+  if (args.length == 0) {
+    print('USAGE: ast_membench FILE.dill NUM_COPIES');
+    exit(1);
+  }
+  String filename = args[0];
+
+  const int defaultCopyCount = 10;
+  int copyCount = args.length == 2 ? int.parse(args[1]) : defaultCopyCount;
+  List<Program> keepAlive = <Program>[];
+  for (int i = 0; i < copyCount; ++i) {
+    keepAlive.add(loadProgramFromBinary(filename));
+  }
+
+  print('$copyCount copies built');
+
+  if (args.contains('-v')) {
+    // Use of the list for something to avoid premature GC.
+    int size = 0;
+    for (var program in keepAlive) {
+      size += program.libraries.length;
+    }
+    print(size);
+  }
+}
diff --git a/pkg/kernel/test/baseline_spec_mode_test_disabled.dart b/pkg/kernel/test/baseline_spec_mode_test_disabled.dart
new file mode 100644
index 0000000..f365d78
--- /dev/null
+++ b/pkg/kernel/test/baseline_spec_mode_test_disabled.dart
@@ -0,0 +1,28 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:kernel/kernel.dart';
+import 'package:kernel/transformations/mixin_full_resolution.dart';
+
+import 'baseline_tester.dart';
+
+class SpecModeTest extends TestTarget {
+  @override
+  List<String> get extraRequiredLibraries => [];
+
+  @override
+  String get name => 'spec-mode-test';
+
+  @override
+  bool get strongMode => false;
+
+  @override
+  List<String> transformProgram(Program program) {
+    new MixinFullResolution().transform(program);
+    return const <String>[];
+  }
+}
+
+void main() {
+  runBaselineTests('spec-mode', new SpecModeTest());
+}
diff --git a/pkg/kernel/test/baseline_strong_mode_test_disabled.dart b/pkg/kernel/test/baseline_strong_mode_test_disabled.dart
new file mode 100644
index 0000000..51d2a7c
--- /dev/null
+++ b/pkg/kernel/test/baseline_strong_mode_test_disabled.dart
@@ -0,0 +1,63 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:kernel/class_hierarchy.dart';
+import 'package:kernel/core_types.dart';
+import 'package:kernel/kernel.dart';
+import 'package:kernel/transformations/mixin_full_resolution.dart';
+import 'package:kernel/type_checker.dart';
+import 'package:path/path.dart' as pathlib;
+
+import 'baseline_tester.dart';
+
+class StrongModeTest extends TestTarget {
+  @override
+  List<String> get extraRequiredLibraries => [];
+
+  @override
+  String get name => 'strong-mode-test';
+
+  @override
+  bool get strongMode => true;
+
+  @override
+  List<String> transformProgram(Program program) {
+    List<String> errors = <String>[];
+    new MixinFullResolution().transform(program);
+    new TestTypeChecker(
+            errors, new CoreTypes(program), new ClassHierarchy(program))
+        .checkProgram(program);
+    return errors;
+  }
+}
+
+class TestTypeChecker extends TypeChecker {
+  final List<String> errors;
+
+  TestTypeChecker(this.errors, CoreTypes coreTypes, ClassHierarchy hierarchy)
+      : super(coreTypes, hierarchy);
+
+  @override
+  void checkAssignable(TreeNode where, DartType from, DartType to) {
+    if (!environment.isSubtypeOf(from, to)) {
+      fail(where, '$from is not a subtype of $to');
+    }
+  }
+
+  @override
+  void fail(TreeNode where, String message) {
+    var location = where.location;
+    var locationString;
+    if (location != null) {
+      var file = pathlib.basename(Uri.parse(location.file).path);
+      locationString = '($file:${location.line}:${location.column})';
+    } else {
+      locationString = '(no location)';
+    }
+    errors.add('$message $locationString');
+  }
+}
+
+void main() {
+  runBaselineTests('strong-mode', new StrongModeTest());
+}
diff --git a/pkg/kernel/test/baseline_tester.dart b/pkg/kernel/test/baseline_tester.dart
new file mode 100644
index 0000000..c2c47e5
--- /dev/null
+++ b/pkg/kernel/test/baseline_tester.dart
@@ -0,0 +1,80 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:kernel/analyzer/loader.dart';
+import 'package:kernel/kernel.dart';
+import 'package:kernel/target/targets.dart';
+import 'package:kernel/text/ast_to_text.dart';
+import 'package:kernel/verifier.dart';
+import 'package:path/path.dart' as pathlib;
+import 'package:test/test.dart';
+
+final String testcaseDirectory = 'pkg/kernel/testcases';
+final String inputDirectory = 'pkg/kernel/testcases/input';
+final String sdkDirectory = 'sdk';
+
+/// A target to be used for testing.
+///
+/// To simplify testing dependencies, we avoid transformations that rely on
+/// a patched SDK or any SDK changes that have not landed in the main SDK.
+abstract class TestTarget extends Target {
+  /// Annotations to apply on the textual output.
+  Annotator get annotator => null;
+
+  List<String> transformProgram(Program program);
+}
+
+void runBaselineTests(String folderName, TestTarget target) {
+  String outputDirectory = '$testcaseDirectory/$folderName';
+  var batch = new DartLoaderBatch();
+  Directory directory = new Directory(inputDirectory);
+  for (FileSystemEntity file in directory.listSync()) {
+    if (file is File && file.path.endsWith('.dart')) {
+      String name = pathlib.basename(file.path);
+      test(name, () async {
+        String dartPath = file.path;
+        String shortName = pathlib.withoutExtension(name);
+        String filenameOfBaseline = '$outputDirectory/$shortName.baseline.txt';
+        String filenameOfCurrent = '$outputDirectory/$shortName.current.txt';
+
+        var repository = new Repository();
+        var loader = await batch.getLoader(
+            repository,
+            new DartOptions(
+                strongMode: target.strongMode,
+                sdk: sdkDirectory,
+                declaredVariables: target.extraDeclaredVariables));
+        var program = loader.loadProgram(dartPath, target: target);
+        verifyProgram(program);
+        var errors = target.transformProgram(program);
+        verifyProgram(program);
+
+        var buffer = new StringBuffer();
+        for (var error in errors) {
+          buffer.writeln('// $error');
+        }
+        new Printer(buffer, annotator: target.annotator)
+            .writeLibraryFile(program.mainMethod.enclosingLibrary);
+        String current = '$buffer';
+        new File(filenameOfCurrent).writeAsStringSync(current);
+
+        var baselineFile = new File(filenameOfBaseline);
+        if (!baselineFile.existsSync()) {
+          new File(filenameOfBaseline).writeAsStringSync(current);
+        } else {
+          var baseline = baselineFile.readAsStringSync();
+          if (baseline != current) {
+            fail('Output of `$name` changed for $folderName.\n'
+                'Command to reset the baseline:\n'
+                '  rm $filenameOfBaseline\n'
+                'Command to see the diff:\n'
+                '  diff -cd $outputDirectory/$shortName.{baseline,current}.txt'
+                '\n');
+          }
+        }
+      });
+    }
+  }
+}
diff --git a/pkg/kernel/test/baseline_type_propagation_test_disabled.dart b/pkg/kernel/test/baseline_type_propagation_test_disabled.dart
new file mode 100644
index 0000000..3911df3
--- /dev/null
+++ b/pkg/kernel/test/baseline_type_propagation_test_disabled.dart
@@ -0,0 +1,41 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:kernel/kernel.dart';
+import 'package:kernel/text/ast_to_text.dart';
+import 'package:kernel/transformations/mixin_full_resolution.dart';
+import 'package:kernel/type_propagation/builder.dart';
+import 'package:kernel/type_propagation/solver.dart';
+import 'package:kernel/type_propagation/visualizer.dart';
+
+import 'baseline_tester.dart';
+
+class TypePropagationTest extends TestTarget {
+  @override
+  Annotator annotator;
+
+  @override
+  List<String> get extraRequiredLibraries => [];
+
+  @override
+  String get name => 'type-propagation-test';
+
+  @override
+  bool get strongMode => false;
+
+  @override
+  List<String> transformProgram(Program program) {
+    new MixinFullResolution().transform(program);
+    var visualizer = new Visualizer(program);
+    var builder = new Builder(program, visualizer: visualizer);
+    var solver = new Solver(builder);
+    solver.solve();
+    visualizer.solver = solver;
+    annotator = new TextAnnotator(visualizer);
+    return const <String>[];
+  }
+}
+
+void main() {
+  runBaselineTests('type-propagation', new TypePropagationTest());
+}
diff --git a/pkg/kernel/test/batch_consistency.dart b/pkg/kernel/test/batch_consistency.dart
new file mode 100644
index 0000000..7a098df
--- /dev/null
+++ b/pkg/kernel/test/batch_consistency.dart
@@ -0,0 +1,86 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.batch_consistency;
+
+import 'dart:async';
+import 'dart:io';
+import '../bin/dartk.dart' as dartk;
+import '../bin/batch_util.dart';
+import 'package:path/path.dart' as pathlib;
+import 'package:test/test.dart';
+
+String usage = """
+Usage: batch_consistency [options] -- files...
+
+Run dartk on the given files, both separately and in a batch, and check that
+the output is identical for the two modes.
+""";
+
+const String outputDir = 'out/batch-consistency';
+
+main(List<String> args) async {
+  int separator = args.indexOf('--');
+  if (separator == -1) {
+    print(usage);
+    exit(1);
+  }
+
+  List<String> options = args.sublist(0, separator);
+  List<String> files = args.sublist(separator + 1);
+
+  await new Directory(outputDir).create(recursive: true);
+
+  testBatchModeConsistency(options, files);
+}
+
+Future<bool> areFilesEqual(String first, String second) async {
+  List<List<int>> bytes = await Future
+      .wait([new File(first).readAsBytes(), new File(second).readAsBytes()]);
+  if (bytes[0].length != bytes[1].length) return false;
+  for (int i = 0; i < bytes[0].length; ++i) {
+    if (bytes[0][i] != bytes[1][i]) return false;
+  }
+  return true;
+}
+
+testBatchModeConsistency(List<String> options, List<String> files) {
+  var sharedState = new dartk.BatchModeState();
+  for (String file in files) {
+    test(file, () async {
+      var name = pathlib.basename(file);
+      List<String> outputFiles = <String>[
+        '$outputDir/$name.batch.dill',
+        '$outputDir/$name.unbatch.dill'
+      ];
+      List results = [null, null];
+      bool failed = false;
+      for (int i = 0; i < 2; ++i) {
+        var args = <String>[]
+          ..addAll(options)
+          ..addAll(['--out', outputFiles[i], file]);
+        var state = (i == 0) ? sharedState : new dartk.BatchModeState();
+        try {
+          // We run the two executions in a loop to ensure any stack traces
+          // are identical in case they both crash at the same place.
+          // Crashing at the same place is acceptable for the purpose of
+          // this test, there are other tests that check for crashes.
+          results[i] = await dartk.batchMain(args, state);
+        } catch (e) {
+          results[i] = '$e';
+          failed = true;
+        }
+      }
+      if (results[0] != results[1]) {
+        fail('Batch mode returned ${results[0]}, expected ${results[1]}');
+        return;
+      }
+      if (results[0] == CompilerOutcome.Fail) {
+        failed = true;
+      }
+      if (!failed && !await areFilesEqual(outputFiles[0], outputFiles[1])) {
+        fail('Batch mode output differs for $file');
+      }
+    });
+  }
+}
diff --git a/pkg/kernel/test/class_hierarchy_basic.dart b/pkg/kernel/test/class_hierarchy_basic.dart
new file mode 100644
index 0000000..601bf04
--- /dev/null
+++ b/pkg/kernel/test/class_hierarchy_basic.dart
@@ -0,0 +1,253 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.class_hierarchy_basic;
+
+import 'package:kernel/type_algebra.dart';
+import 'package:kernel/ast.dart';
+
+/// A simple implementation of the class hierarchy interface using
+/// hash tables for everything.
+class BasicClassHierarchy {
+  final Map<Class, Set<Class>> superclasses = <Class, Set<Class>>{};
+  final Map<Class, Set<Class>> superMixtures = <Class, Set<Class>>{};
+  final Map<Class, Set<Class>> supertypes = <Class, Set<Class>>{};
+  final Map<Class, Map<Class, Supertype>> supertypeInstantiations =
+      <Class, Map<Class, Supertype>>{};
+  final Map<Class, Map<Name, Member>> gettersAndCalls =
+      <Class, Map<Name, Member>>{};
+  final Map<Class, Map<Name, Member>> setters = <Class, Map<Name, Member>>{};
+  final Map<Class, Map<Name, List<Member>>> interfaceGettersAndCalls =
+      <Class, Map<Name, List<Member>>>{};
+  final Map<Class, Map<Name, List<Member>>> interfaceSetters =
+      <Class, Map<Name, List<Member>>>{};
+  final List<Class> classes = <Class>[];
+  final Map<Class, int> classIndex = <Class, int>{};
+
+  BasicClassHierarchy(Program program) {
+    for (var library in program.libraries) {
+      for (var classNode in library.classes) {
+        buildSuperTypeSets(classNode);
+        buildSuperTypeInstantiations(classNode);
+        buildDispatchTable(classNode);
+        buildInterfaceTable(classNode);
+      }
+    }
+  }
+
+  void forEachOverridePair(
+      Class class_, callback(Member member, Member superMember, bool setter)) {
+    void report(Member member, Member superMember, bool setter) {
+      if (!identical(member, superMember)) {
+        callback(member, superMember, setter);
+      }
+    }
+    // Report declared members overriding inheritable members.
+    for (var member in class_.mixin.members) {
+      for (var supertype in class_.supers) {
+        if (member.hasGetter) {
+          for (var superMember
+              in getInterfaceMembersByName(supertype.classNode, member.name)) {
+            report(member, superMember, false);
+          }
+        }
+        if (member.hasSetter) {
+          for (var superMember in getInterfaceMembersByName(
+              supertype.classNode, member.name,
+              setter: true)) {
+            report(member, superMember, true);
+          }
+        }
+      }
+    }
+    // Report inherited non-abstract members overriding inheritable or
+    // declared members.
+    for (var setter in [true, false]) {
+      for (var member in getDispatchTargets(class_, setters: setter)) {
+        // Report overriding inheritable members.
+        for (var supertype in class_.supers) {
+          for (var superMember in getInterfaceMembersByName(
+              supertype.classNode, member.name,
+              setter: setter)) {
+            report(member, superMember, setter);
+          }
+        }
+        // Report overriding declared abstract members.
+        if (!class_.isAbstract && member.enclosingClass != class_.mixin) {
+          for (var declaredMember in getInterfaceMembersByName(
+              class_, member.name,
+              setter: setter)) {
+            report(member, declaredMember, setter);
+          }
+        }
+      }
+    }
+  }
+
+  void buildSuperTypeSets(Class node) {
+    if (superclasses.containsKey(node)) return;
+    superclasses[node] = new Set<Class>()..add(node);
+    superMixtures[node] = new Set<Class>()..add(node);
+    supertypes[node] = new Set<Class>()..add(node);
+    if (node.supertype != null) {
+      buildSuperTypeSets(node.supertype.classNode);
+      superclasses[node].addAll(superclasses[node.supertype.classNode]);
+      superMixtures[node].addAll(superMixtures[node.supertype.classNode]);
+      supertypes[node].addAll(supertypes[node.supertype.classNode]);
+    }
+    if (node.mixedInType != null) {
+      buildSuperTypeSets(node.mixedInType.classNode);
+      superMixtures[node].addAll(superMixtures[node.mixedInType.classNode]);
+      supertypes[node].addAll(supertypes[node.mixedInType.classNode]);
+    }
+    for (var supertype in node.implementedTypes) {
+      buildSuperTypeSets(supertype.classNode);
+      supertypes[node].addAll(supertypes[supertype.classNode]);
+    }
+    classes.add(node);
+    classIndex[node] = classes.length - 1;
+  }
+
+  void buildSuperTypeInstantiations(Class node) {
+    if (supertypeInstantiations.containsKey(node)) return;
+    supertypeInstantiations[node] = <Class, Supertype>{
+      node: node.asThisSupertype
+    };
+    for (var supertype in node.supers) {
+      var superclass = supertype.classNode;
+      buildSuperTypeInstantiations(superclass);
+      var substitution = Substitution.fromPairs(
+          superclass.typeParameters, supertype.typeArguments);
+      supertypeInstantiations[superclass].forEach((key, type) {
+        supertypeInstantiations[node][key] =
+            substitution.substituteSupertype(type);
+      });
+    }
+  }
+
+  void buildDispatchTable(Class node) {
+    if (gettersAndCalls.containsKey(node)) return;
+    gettersAndCalls[node] = <Name, Member>{};
+    setters[node] = <Name, Member>{};
+    if (node.supertype != null) {
+      buildDispatchTable(node.supertype.classNode);
+      gettersAndCalls[node].addAll(gettersAndCalls[node.supertype.classNode]);
+      setters[node].addAll(setters[node.supertype.classNode]);
+    }
+    // Overwrite map entries with declared members.
+    Class mixin = node.mixedInType?.classNode ?? node;
+    for (Procedure procedure in mixin.procedures) {
+      if (procedure.isStatic || procedure.isAbstract) continue;
+      if (procedure.kind == ProcedureKind.Setter) {
+        setters[node][procedure.name] = procedure;
+      } else {
+        gettersAndCalls[node][procedure.name] = procedure;
+      }
+    }
+    for (Field field in mixin.fields) {
+      if (field.isStatic) continue;
+      gettersAndCalls[node][field.name] = field;
+      if (!field.isFinal) {
+        setters[node][field.name] = field;
+      }
+    }
+  }
+
+  void mergeMaps(
+      Map<Name, List<Member>> source, Map<Name, List<Member>> destination) {
+    for (var name in source.keys) {
+      destination.putIfAbsent(name, () => <Member>[]).addAll(source[name]);
+    }
+  }
+
+  void buildInterfaceTable(Class node) {
+    if (interfaceGettersAndCalls.containsKey(node)) return;
+    interfaceGettersAndCalls[node] = <Name, List<Member>>{};
+    interfaceSetters[node] = <Name, List<Member>>{};
+    void inheritFrom(Supertype type) {
+      if (type == null) return;
+      buildInterfaceTable(type.classNode);
+      mergeMaps(interfaceGettersAndCalls[type.classNode],
+          interfaceGettersAndCalls[node]);
+      mergeMaps(interfaceSetters[type.classNode], interfaceSetters[node]);
+    }
+    inheritFrom(node.supertype);
+    inheritFrom(node.mixedInType);
+    node.implementedTypes.forEach(inheritFrom);
+    // Overwrite map entries with declared members.
+    for (Procedure procedure in node.mixin.procedures) {
+      if (procedure.isStatic) continue;
+      if (procedure.kind == ProcedureKind.Setter) {
+        interfaceSetters[node][procedure.name] = <Member>[procedure];
+      } else {
+        interfaceGettersAndCalls[node][procedure.name] = <Member>[procedure];
+      }
+    }
+    for (Field field in node.mixin.fields) {
+      if (field.isStatic) continue;
+      interfaceGettersAndCalls[node][field.name] = <Member>[field];
+      if (!field.isFinal) {
+        interfaceSetters[node][field.name] = <Member>[field];
+      }
+    }
+  }
+
+  bool isSubclassOf(Class subtype, Class supertype) {
+    return superclasses[subtype].contains(supertype);
+  }
+
+  bool isSubmixtureOf(Class subtype, Class supertype) {
+    return superMixtures[subtype].contains(supertype);
+  }
+
+  bool isSubtypeOf(Class subtype, Class supertype) {
+    return supertypes[subtype].contains(supertype);
+  }
+
+  Supertype getClassAsInstanceOf(Class type, Class supertype) {
+    return supertypeInstantiations[type][supertype];
+  }
+
+  Member getDispatchTarget(Class class_, Name name, {bool setter: false}) {
+    return setter ? setters[class_][name] : gettersAndCalls[class_][name];
+  }
+
+  Iterable<Member> getDispatchTargets(Class class_, {bool setters: false}) {
+    return setters
+        ? this.setters[class_].values
+        : gettersAndCalls[class_].values;
+  }
+
+  Member tryFirst(List<Member> members) {
+    return (members == null || members.isEmpty) ? null : members[0];
+  }
+
+  Member getInterfaceMember(Class class_, Name name, {bool setter: false}) {
+    return tryFirst(getInterfaceMembersByName(class_, name, setter: setter));
+  }
+
+  Iterable<Member> getInterfaceMembersByName(Class class_, Name name,
+      {bool setter: false}) {
+    var iterable = setter
+        ? interfaceSetters[class_][name]
+        : interfaceGettersAndCalls[class_][name];
+    return iterable == null ? const <Member>[] : iterable;
+  }
+
+  Iterable<Member> getInterfaceMembers(Class class_, {bool setters: false}) {
+    return setters
+        ? interfaceSetters[class_].values.expand((x) => x)
+        : interfaceGettersAndCalls[class_].values.expand((x) => x);
+  }
+
+  int getClassIndex(Class node) {
+    return classIndex[node];
+  }
+
+  List<int> getExpenseHistogram() => <int>[];
+  double getCompressionRatio() => 0.0;
+  int getSuperTypeHashTableSize() => 0;
+
+  noSuchMethod(inv) => super.noSuchMethod(inv);
+}
diff --git a/pkg/kernel/test/class_hierarchy_bench.dart b/pkg/kernel/test/class_hierarchy_bench.dart
new file mode 100644
index 0000000..11fdb7a
--- /dev/null
+++ b/pkg/kernel/test/class_hierarchy_bench.dart
@@ -0,0 +1,345 @@
+#!/usr/bin/env dart
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:kernel/kernel.dart';
+import 'package:kernel/class_hierarchy.dart';
+import 'package:args/args.dart';
+import 'class_hierarchy_basic.dart';
+import 'dart:math';
+import 'dart:io';
+
+ArgParser argParser = new ArgParser()
+  ..addFlag('basic', help: 'Measure the basic implementation', negatable: false)
+  ..addOption('cycle',
+      abbr: 'c',
+      help: 'Build N copies of the class hierarchy and cycle queries '
+          'between them',
+      defaultsTo: '1');
+
+String usage = '''
+Usage: class_hierarchy_bench [options] FILE.dart
+
+Options:
+${argParser.usage}
+''';
+
+main(List<String> args) {
+  if (args.length == 0) {
+    print(usage);
+    exit(1);
+  }
+  ArgResults options = argParser.parse(args);
+  if (options.rest.length != 1) {
+    print('Exactly one file must be given');
+    exit(1);
+  }
+  String filename = options.rest.single;
+
+  Program program = loadProgramFromBinary(filename);
+
+  ClassHierarchy buildHierarchy() {
+    return options['basic']
+        ? new BasicClassHierarchy(program)
+        : new ClassHierarchy(program);
+  }
+
+  var watch = new Stopwatch()..start();
+  buildHierarchy();
+  int coldBuildTime = watch.elapsedMilliseconds;
+  watch.reset();
+  const int numBuildTrials = 100;
+  for (int i = 0; i < numBuildTrials; i++) {
+    buildHierarchy();
+  }
+  int hotBuildTime = watch.elapsedMilliseconds ~/ numBuildTrials;
+
+  int hierarchyCount = int.parse(options['cycle']);
+  var hierarchies = <ClassHierarchy>[];
+  for (int i = 0; i < hierarchyCount; i++) {
+    hierarchies.add(buildHierarchy());
+  }
+
+  int currentHierarchy = 0;
+  ClassHierarchy getClassHierarchy() {
+    currentHierarchy = (currentHierarchy + 1) % hierarchies.length;
+    return hierarchies[currentHierarchy];
+  }
+
+  Random rnd = new Random(12345);
+  const int numQueryTrials = 100000;
+
+  // Measure isSubclassOf, isSubmixtureOf, isSubtypeOf, getClassAsInstanceOf.
+
+  // Warm-up run to ensure the JIT compiler does not favor the first query we
+  // test.
+  watch.reset();
+  for (int i = 0; i < numQueryTrials; i++) {
+    var classHierarchy = getClassHierarchy();
+    int first = rnd.nextInt(classHierarchy.classes.length);
+    int second = rnd.nextInt(classHierarchy.classes.length);
+    Class firstClass = classHierarchy.classes[first];
+    Class secondClass = classHierarchy.classes[second];
+    classHierarchy.isSubclassOf(firstClass, secondClass);
+    classHierarchy.isSubmixtureOf(firstClass, secondClass);
+    classHierarchy.isSubtypeOf(firstClass, secondClass);
+    classHierarchy.getClassAsInstanceOf(firstClass, secondClass);
+  }
+
+  watch.reset();
+  for (int i = 0; i < numQueryTrials; i++) {
+    var classHierarchy = getClassHierarchy();
+    int first = rnd.nextInt(classHierarchy.classes.length);
+    int second = rnd.nextInt(classHierarchy.classes.length);
+    Class firstClass = classHierarchy.classes[first];
+    Class secondClass = classHierarchy.classes[second];
+    classHierarchy.isSubclassOf(firstClass, secondClass);
+  }
+  int subclassQueryTime = watch.elapsedMicroseconds;
+
+  watch.reset();
+  for (int i = 0; i < numQueryTrials; i++) {
+    var classHierarchy = getClassHierarchy();
+    int first = rnd.nextInt(classHierarchy.classes.length);
+    int second = rnd.nextInt(classHierarchy.classes.length);
+    Class firstClass = classHierarchy.classes[first];
+    Class secondClass = classHierarchy.classes[second];
+    classHierarchy.isSubmixtureOf(firstClass, secondClass);
+  }
+  int submixtureQueryTime = watch.elapsedMicroseconds;
+
+  watch.reset();
+  for (int i = 0; i < numQueryTrials; i++) {
+    var classHierarchy = getClassHierarchy();
+    int first = rnd.nextInt(classHierarchy.classes.length);
+    int second = rnd.nextInt(classHierarchy.classes.length);
+    Class firstClass = classHierarchy.classes[first];
+    Class secondClass = classHierarchy.classes[second];
+    classHierarchy.isSubtypeOf(firstClass, secondClass);
+  }
+  int subtypeQueryTime = watch.elapsedMicroseconds;
+
+  watch.reset();
+  for (int i = 0; i < numQueryTrials; i++) {
+    var classHierarchy = getClassHierarchy();
+    int first = rnd.nextInt(classHierarchy.classes.length);
+    int second = rnd.nextInt(classHierarchy.classes.length);
+    Class firstClass = classHierarchy.classes[first];
+    Class secondClass = classHierarchy.classes[second];
+    classHierarchy.getClassAsInstanceOf(firstClass, secondClass);
+  }
+  int asInstanceOfQueryTime = watch.elapsedMicroseconds;
+
+  // Estimate the overhead from test case generation.
+  watch.reset();
+  for (int i = 0; i < numQueryTrials; i++) {
+    var classHierarchy = getClassHierarchy();
+    int first = rnd.nextInt(classHierarchy.classes.length);
+    int second = rnd.nextInt(classHierarchy.classes.length);
+    classHierarchy.classes[first];
+    classHierarchy.classes[second];
+  }
+  int queryNoise = watch.elapsedMicroseconds;
+
+  subclassQueryTime -= queryNoise;
+  submixtureQueryTime -= queryNoise;
+  subtypeQueryTime -= queryNoise;
+  asInstanceOfQueryTime -= queryNoise;
+
+  String subclassPerSecond = perSecond(subclassQueryTime, numQueryTrials);
+  String submixturePerSecond = perSecond(submixtureQueryTime, numQueryTrials);
+  String subtypePerSecond = perSecond(subtypeQueryTime, numQueryTrials);
+  String asInstanceOfPerSecond =
+      perSecond(asInstanceOfQueryTime, numQueryTrials);
+
+  // Measure getDispatchTarget and getDispatchTargets.
+  watch.reset();
+  for (int i = 0; i < numQueryTrials; i++) {
+    var classHierarchy = getClassHierarchy();
+    int classId = rnd.nextInt(classHierarchy.classes.length);
+    Class classNode = classHierarchy.classes[classId];
+    classHierarchy.getDispatchTarget(classNode, new Name('toString'));
+  }
+  int dispatchToStringTime = watch.elapsedMicroseconds;
+
+  watch.reset();
+  for (int i = 0; i < numQueryTrials; i++) {
+    var classHierarchy = getClassHierarchy();
+    int classId = rnd.nextInt(classHierarchy.classes.length);
+    Class classNode = classHierarchy.classes[classId];
+    classHierarchy.getDispatchTarget(classNode, new Name('getFloo'));
+  }
+  int dispatchGenericGetTime = watch.elapsedMicroseconds;
+
+  watch.reset();
+  for (int i = 0; i < numQueryTrials; i++) {
+    var classHierarchy = getClassHierarchy();
+    int classId = rnd.nextInt(classHierarchy.classes.length);
+    Class classNode = classHierarchy.classes[classId];
+    for (var _ in classHierarchy.getDispatchTargets(classNode)) {}
+  }
+  int dispatchAllTargetsTime = watch.elapsedMicroseconds;
+
+  // Measure getInterfaceMember and getInterfaceMembers.
+  watch.reset();
+  for (int i = 0; i < numQueryTrials; i++) {
+    var classHierarchy = getClassHierarchy();
+    int classId = rnd.nextInt(classHierarchy.classes.length);
+    Class classNode = classHierarchy.classes[classId];
+    classHierarchy.getInterfaceMember(classNode, new Name('toString'));
+  }
+  int interfaceToStringTime = watch.elapsedMicroseconds;
+
+  watch.reset();
+  for (int i = 0; i < numQueryTrials; i++) {
+    var classHierarchy = getClassHierarchy();
+    int classId = rnd.nextInt(classHierarchy.classes.length);
+    Class classNode = classHierarchy.classes[classId];
+    classHierarchy.getInterfaceMember(classNode, new Name('getFloo'));
+  }
+  int interfaceGenericGetTime = watch.elapsedMicroseconds;
+
+  watch.reset();
+  for (int i = 0; i < numQueryTrials; i++) {
+    var classHierarchy = getClassHierarchy();
+    int classId = rnd.nextInt(classHierarchy.classes.length);
+    Class classNode = classHierarchy.classes[classId];
+    for (var _ in classHierarchy.getInterfaceMembers(classNode)) {}
+  }
+  int interfaceAllTargetsTime = watch.elapsedMicroseconds;
+
+  // Estimate overhead from test case generation.
+  watch.reset();
+  for (int i = 0; i < numQueryTrials; i++) {
+    var classHierarchy = getClassHierarchy();
+    int classId = rnd.nextInt(classHierarchy.classes.length);
+    classHierarchy.classes[classId];
+  }
+  int dispatchTargetNoise = watch.elapsedMicroseconds;
+
+  dispatchToStringTime -= dispatchTargetNoise;
+  dispatchGenericGetTime -= dispatchTargetNoise;
+  dispatchAllTargetsTime -= dispatchTargetNoise;
+  interfaceToStringTime -= dispatchTargetNoise;
+  interfaceGenericGetTime -= dispatchTargetNoise;
+  interfaceAllTargetsTime -= dispatchTargetNoise;
+
+  String dispatchToStringPerSecond =
+      perSecond(dispatchToStringTime, numQueryTrials);
+  String dispatchGetPerSecond =
+      perSecond(dispatchGenericGetTime, numQueryTrials);
+  String dispatchAllTargetsPerSecond =
+      perSecond(dispatchAllTargetsTime, numQueryTrials);
+
+  String interfaceToStringPerSecond =
+      perSecond(interfaceToStringTime, numQueryTrials);
+  String interfaceGetPerSecond =
+      perSecond(interfaceGenericGetTime, numQueryTrials);
+  String interfaceAllTargetsPerSecond =
+      perSecond(interfaceAllTargetsTime, numQueryTrials);
+
+  watch.reset();
+  var classHierarchy = getClassHierarchy();
+  int numberOfOverridePairs = 0;
+  for (var class_ in classHierarchy.classes) {
+    classHierarchy.forEachOverridePair(class_, (member, supermember, isSetter) {
+      ++numberOfOverridePairs;
+    });
+  }
+  int overrideTime = watch.elapsedMicroseconds;
+
+  String overridePairsPerSecond =
+      perSecond(overrideTime, numberOfOverridePairs);
+
+  List<int> depth = new List(classHierarchy.classes.length);
+  for (int i = 0; i < depth.length; ++i) {
+    int parentDepth = 0;
+    var classNode = classHierarchy.classes[i];
+    for (var supertype in classNode.supers) {
+      var superclass = supertype.classNode;
+      int index = classHierarchy.getClassIndex(superclass);
+      if (!(index < i)) {
+        throw '${classNode.name}($i) extends ${superclass.name}($index)';
+      }
+      assert(index < i);
+      parentDepth = max(parentDepth, depth[index]);
+    }
+    depth[i] = parentDepth + 1;
+  }
+  List<int> depthHistogram = getHistogramOf(depth);
+  double averageDepth = average(depth);
+  double medianDepth = median(depth);
+  int totalDepth = sum(depth);
+
+  int numberOfClasses = classHierarchy.classes.length;
+  String expenseHistogram =
+      classHierarchy.getExpenseHistogram().skip(1).join(' ');
+
+  print('''
+classes: $numberOfClasses
+build.cold: $coldBuildTime ms
+build.hot:  $hotBuildTime ms
+query.isSubclassOf:                 $subclassPerSecond
+query.isSubmixtureOf:               $submixturePerSecond
+query.isSubtypeOf:                  $subtypePerSecond
+query.getClassAsInstanceOf:         $asInstanceOfPerSecond
+query.getDispatchTarget(toString):  $dispatchToStringPerSecond
+query.getDispatchTarget(getFloo):   $dispatchGetPerSecond
+query.getDispatchTargets.iterate:   $dispatchAllTargetsPerSecond
+query.getInterfaceMember(toString): $interfaceToStringPerSecond
+query.getInterfaceMember(getFloo):  $interfaceGetPerSecond
+query.getInterfaceMembers.iterate:  $interfaceAllTargetsPerSecond
+isSubtypeOf.expense-histogram: $expenseHistogram
+isSubtypeOf.compression-ratio: ${classHierarchy.getCompressionRatio()}
+asInstanceOf.table-size: ${classHierarchy.getSuperTypeHashTableSize()}
+depth.histogram: ${depthHistogram.skip(1).join(' ')}
+depth.average: $averageDepth
+depth.median:  $medianDepth
+depth.total:   $totalDepth
+overrides.total:   $numberOfOverridePairs
+overrides.iterate: ${overrideTime ~/ 1000} ms ($overridePairsPerSecond)
+''');
+}
+
+String perSecond(int microseconds, int trials) {
+  double millionsPerSecond = trials / microseconds;
+  return '${millionsPerSecond.toStringAsFixed(1)} M/s';
+}
+
+List<int> getHistogramOf(Iterable<int> values) {
+  List<int> result = <int>[];
+  for (int value in values) {
+    while (result.length <= value) {
+      result.add(0);
+    }
+    ++result[value];
+  }
+  return result;
+}
+
+double average(Iterable<num> values) {
+  double sum = 0.0;
+  int length = 0;
+  for (num x in values) {
+    sum += x;
+    ++length;
+  }
+  return length == 0 ? 0.0 : sum / length;
+}
+
+double median(Iterable<num> values) {
+  List<num> list = values.toList(growable: false)..sort();
+  if (list.isEmpty) return 0.0;
+  int mid = list.length ~/ 2;
+  return list.length % 2 == 0
+      ? ((list[mid] + list[mid + 1]) / 2)
+      : list[mid].toDouble();
+}
+
+num sum(Iterable<num> values) {
+  num result = 0;
+  for (var x in values) {
+    result += x;
+  }
+  return result;
+}
diff --git a/pkg/kernel/test/class_hierarchy_membench.dart b/pkg/kernel/test/class_hierarchy_membench.dart
new file mode 100644
index 0000000..e8f6886
--- /dev/null
+++ b/pkg/kernel/test/class_hierarchy_membench.dart
@@ -0,0 +1,63 @@
+#!/usr/bin/env dart
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:kernel/kernel.dart';
+import 'package:kernel/class_hierarchy.dart';
+import 'package:args/args.dart';
+import 'class_hierarchy_basic.dart';
+import 'dart:io';
+
+ArgParser argParser = new ArgParser()
+  ..addFlag('basic', help: 'Measure the basic implementation', negatable: false)
+  ..addOption('count', abbr: 'c',
+      help: 'Build N copies of the class hierarchy',
+      defaultsTo: '300');
+
+String usage = """
+Usage: class_hierarchy_membench [options] FILE.dart
+
+Options:
+${argParser.usage}
+""";
+
+/// Builds N copies of the class hierarchy for the given program.
+/// Pass --print-metrics to the Dart VM to measure the memory use.
+main(List<String> args) {
+  if (args.length == 0) {
+    print(usage);
+    exit(1);
+  }
+  ArgResults options = argParser.parse(args);
+  if (options.rest.length != 1) {
+    print('Exactly one file should be given');
+    exit(1);
+  }
+  String filename = options.rest.single;
+
+  Program program = loadProgramFromBinary(filename);
+
+  int copyCount = int.parse(options['count']);
+
+  ClassHierarchy buildHierarchy() {
+    return options['basic']
+        ? new BasicClassHierarchy(program)
+        : new ClassHierarchy(program);
+  }
+
+  List<ClassHierarchy> keepAlive = <ClassHierarchy>[];
+  for (int i = 0; i < copyCount; ++i) {
+    keepAlive.add(buildHierarchy());
+  }
+
+  print('$copyCount copies built');
+
+  if (args.contains('-v')) {
+    // Use of the list for something to avoid premature GC.
+    int size = 0;
+    for (var classHierarchy in keepAlive) {
+      size += classHierarchy.getSuperTypeHashTableSize();
+    }
+    print(size);
+  }
+}
diff --git a/pkg/kernel/test/class_hierarchy_test_disabled.dart b/pkg/kernel/test/class_hierarchy_test_disabled.dart
new file mode 100644
index 0000000..89e1d7d
--- /dev/null
+++ b/pkg/kernel/test/class_hierarchy_test_disabled.dart
@@ -0,0 +1,13 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:kernel/kernel.dart';
+import 'package:test/test.dart';
+import 'class_hierarchy_tester.dart';
+
+main() {
+  test('All-pairs class hierarchy tests on dart2js', () {
+    testClassHierarchyOnProgram(
+        loadProgramFromBinary('test/data/dart2js.dill'));
+  });
+}
diff --git a/pkg/kernel/test/class_hierarchy_tester.dart b/pkg/kernel/test/class_hierarchy_tester.dart
new file mode 100644
index 0000000..d4e04ad
--- /dev/null
+++ b/pkg/kernel/test/class_hierarchy_tester.dart
@@ -0,0 +1,150 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:kernel/kernel.dart';
+import 'package:kernel/class_hierarchy.dart';
+import 'package:test/test.dart';
+import 'class_hierarchy_basic.dart';
+import 'dart:io';
+import 'dart:math';
+
+void testClassHierarchyOnProgram(Program program, {bool verbose: false}) {
+  BasicClassHierarchy basic = new BasicClassHierarchy(program);
+  ClassHierarchy classHierarchy = new ClassHierarchy(program);
+  int total = classHierarchy.classes.length;
+  int progress = 0;
+  for (var class1 in classHierarchy.classes) {
+    for (var class2 in classHierarchy.classes) {
+      bool isSubclass = classHierarchy.isSubclassOf(class1, class2);
+      bool isSubmixture = classHierarchy.isSubmixtureOf(class1, class2);
+      bool isSubtype = classHierarchy.isSubtypeOf(class1, class2);
+      var asInstance = classHierarchy.getClassAsInstanceOf(class1, class2);
+      if (isSubclass != basic.isSubclassOf(class1, class2)) {
+        fail('isSubclassOf(${class1.name}, ${class2.name}) returned '
+            '$isSubclass but should be ${!isSubclass}');
+      }
+      if (isSubmixture != basic.isSubmixtureOf(class1, class2)) {
+        fail('isSubmixtureOf(${class1.name}, ${class2.name}) returned '
+            '$isSubclass but should be ${!isSubclass}');
+      }
+      if (isSubtype != basic.isSubtypeOf(class1, class2)) {
+        fail('isSubtypeOf(${class1.name}, ${class2.name}) returned '
+            '$isSubtype but should be ${!isSubtype}');
+      }
+      if (asInstance != basic.getClassAsInstanceOf(class1, class2)) {
+        fail('asInstanceOf(${class1.name}, ${class2.name}) returned '
+            '$asInstance but should be '
+            '${basic.getClassAsInstanceOf(class1, class2)}');
+      }
+    }
+    ++progress;
+    if (verbose) {
+      stdout.write('\rSubclass queries ${100 * progress ~/ total}%');
+    }
+  }
+  Set<Name> names = new Set<Name>();
+  for (var classNode in classHierarchy.classes) {
+    for (var member in classNode.members) {
+      names.add(member.name);
+    }
+  }
+  List<Name> nameList = names.toList();
+  progress = 0;
+  for (var classNode in classHierarchy.classes) {
+    Iterable<Name> candidateNames = <Iterable<Name>>[
+      basic.gettersAndCalls[classNode].keys,
+      basic.setters[classNode].keys,
+      pickRandom(nameList, 100)
+    ].expand((x) => x);
+    for (Name name in candidateNames) {
+      Member expectedGetter =
+          basic.getDispatchTarget(classNode, name, setter: false);
+      Member expectedSetter =
+          basic.getDispatchTarget(classNode, name, setter: true);
+      Member actualGetter =
+          classHierarchy.getDispatchTarget(classNode, name, setter: false);
+      Member actualSetter =
+          classHierarchy.getDispatchTarget(classNode, name, setter: true);
+      if (actualGetter != expectedGetter) {
+        fail('lookupGetter($classNode, $name) returned '
+            '$actualGetter but should be $expectedGetter');
+      }
+      if (actualSetter != expectedSetter) {
+        fail('lookupSetter($classNode, $name) returned '
+            '$actualSetter but should be $expectedSetter');
+      }
+    }
+    ++progress;
+    if (verbose) {
+      stdout.write('\rDispatch queries ${100 * progress ~/ total}%');
+    }
+  }
+  progress = 0;
+  for (var classNode in classHierarchy.classes) {
+    Iterable<Name> candidateNames = [
+      basic.interfaceGettersAndCalls[classNode].keys,
+      basic.interfaceSetters[classNode].keys,
+      pickRandom(nameList, 100)
+    ].expand((x) => x);
+    for (Name name in candidateNames) {
+      Member expectedGetter =
+          basic.getInterfaceMember(classNode, name, setter: false);
+      Member expectedSetter =
+          basic.getInterfaceMember(classNode, name, setter: true);
+      Member actualGetter =
+          classHierarchy.getInterfaceMember(classNode, name, setter: false);
+      Member actualSetter =
+          classHierarchy.getInterfaceMember(classNode, name, setter: true);
+      if (actualGetter != expectedGetter) {
+        fail('getInterfaceMember($classNode, $name) returned '
+            '$actualGetter but should be $expectedGetter');
+      }
+      if (actualSetter != expectedSetter) {
+        fail('getInterfaceMember($classNode, $name, setter: true) '
+            'returned $actualSetter but should be $expectedSetter');
+      }
+    }
+    ++progress;
+    if (verbose) {
+      stdout.write('\rInterface queries ${100 * progress ~/ total}%');
+    }
+  }
+  for (var classNode in classHierarchy.classes) {
+    String getHash(member, superMember, setter) {
+      String eq = setter ? '=' : '';
+      return '$member$eq overrides $superMember$eq';
+    }
+    Set<String> expectedOverrides = new Set<String>();
+    basic.forEachOverridePair(classNode, (member, superMember, setter) {
+      expectedOverrides.add(getHash(member, superMember, setter));
+    });
+    Set<String> actualOverrides = new Set<String>();
+    classHierarchy.forEachOverridePair(classNode, (member, superMember, setter) {
+      actualOverrides.add(getHash(member, superMember, setter));
+    });
+    for (var actual in actualOverrides) {
+      if (!expectedOverrides.contains(actual)) {
+        fail("forEachOverridePair($classNode) should not report that $actual");
+      }
+    }
+    for (var expected in expectedOverrides) {
+      if (!actualOverrides.contains(expected)) {
+        fail("forEachOverridePair($classNode) did not report that $expected");
+      }
+    }
+  }
+  if (verbose) {
+    print('\rProgress 100%. Done.');
+  }
+}
+
+var random = new Random(12345);
+
+List/*<T>*/ pickRandom/*<T>*/(List/*<T>*/ items, int n) {
+  var result = /*<T>*/[];
+  for (int i = 0; i < n; ++i) {
+    result.add(items[random.nextInt(items.length)]);
+  }
+  return result;
+}
diff --git a/pkg/kernel/test/frontend_bench.dart b/pkg/kernel/test/frontend_bench.dart
new file mode 100644
index 0000000..796d064
--- /dev/null
+++ b/pkg/kernel/test/frontend_bench.dart
@@ -0,0 +1,66 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:analyzer/src/context/cache.dart';
+import 'package:analyzer/task/model.dart';
+import 'package:args/args.dart';
+import 'package:kernel/analyzer/loader.dart';
+import 'package:kernel/kernel.dart';
+import 'package:package_config/discovery.dart';
+
+ArgParser parser = new ArgParser()
+  ..addOption('sdk',
+      help: 'Path to Dart SDK', valueHelp: 'path', defaultsTo: '/usr/lib/dart')
+  ..addOption('packages',
+      abbr: 'p',
+      help: 'Path to the packages folder or .packages file',
+      valueHelp: 'path')
+  ..addFlag('strong', help: 'Use strong mode');
+
+String get usage => '''
+Usage: frontend_bench [options] FILE.dart
+
+Benchmark the analyzer-based frontend.
+
+Options:
+${parser.options}
+''';
+
+main(List<String> args) {
+  if (args.length == 0) {
+    print(usage);
+    exit(1);
+  }
+  ArgResults options = parser.parse(args);
+
+  if (options.rest.length != 1) {
+    print('Exactly one file must be given');
+    exit(1);
+  }
+
+  String sdk = options['sdk'];
+  String packagePath = options['packages'];
+  bool strongMode = options['strong'];
+
+  String path = options.rest.single;
+  var packages =
+      getPackagesDirectory(new Uri(scheme: 'file', path: packagePath));
+  Repository repository = new Repository();
+
+  new DartLoader(
+          repository,
+          new DartOptions(
+              strongMode: strongMode, sdk: sdk, packagePath: packagePath),
+          packages)
+      .loadProgram(path);
+
+  CacheEntry.recomputedCounts.forEach((key, value) {
+    print('Recomputed $key $value times');
+  });
+
+  AnalysisTask.stopwatchMap.forEach((key, Stopwatch watch) {
+    print('$key took ${watch.elapsedMilliseconds} ms');
+  });
+}
diff --git a/pkg/kernel/test/parent_pointer_test_disabled.dart b/pkg/kernel/test/parent_pointer_test_disabled.dart
new file mode 100644
index 0000000..2920227
--- /dev/null
+++ b/pkg/kernel/test/parent_pointer_test_disabled.dart
@@ -0,0 +1,10 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:kernel/kernel.dart';
+import 'package:kernel/verifier.dart';
+
+main() {
+  Program program = loadProgramFromBinary('test/data/dart2js.dill');
+  CheckParentPointers.check(program);
+}
diff --git a/pkg/kernel/test/round_trip.dart b/pkg/kernel/test/round_trip.dart
new file mode 100644
index 0000000..6ca417a
--- /dev/null
+++ b/pkg/kernel/test/round_trip.dart
@@ -0,0 +1,77 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.round_trip;
+
+import 'dart:async';
+import 'dart:io';
+import 'package:kernel/binary/ast_from_binary.dart';
+import 'package:kernel/binary/ast_to_binary.dart';
+import 'package:kernel/binary/loader.dart';
+import 'package:kernel/kernel.dart';
+
+const String usage = '''
+Usage: round_trip.dart FILE.dill
+
+Deserialize and serialize the given program and check that the resulting byte
+sequence is identical to the original.
+''';
+
+void main(List<String> args) {
+  if (args.length != 1) {
+    print(usage);
+    exit(1);
+  }
+  testRoundTrip(new File(args[0]).readAsBytesSync());
+}
+
+void testRoundTrip(List<int> bytes) {
+  var loader = new BinaryLoader(new Repository());
+  var program = new BinaryBuilder(loader, bytes).readProgramFile();
+  new BinaryPrinterWithExpectedOutput(bytes).writeProgramFile(program);
+}
+
+class DummyStreamConsumer extends StreamConsumer<List<int>> {
+  @override
+  Future addStream(Stream<List<int>> stream) async => null;
+
+  @override
+  Future close() async => null;
+}
+
+/// Variant of the binary serializer that compares the output against an
+/// existing buffer.
+///
+/// As opposed to comparing binary files directly, when this fails, the stack
+/// trace shows what the serializer was doing when the output started to differ.
+class BinaryPrinterWithExpectedOutput extends BinaryPrinter {
+  final List<int> expectedBytes;
+  int offset = 0;
+
+  static const int eof = -1;
+
+  BinaryPrinterWithExpectedOutput(this.expectedBytes)
+      : super(new IOSink(new DummyStreamConsumer()));
+
+
+  String show(int byte) {
+    if (byte == eof) return 'EOF';
+    return '$byte (0x${byte.toRadixString(16).padLeft(2, "0")})';
+  }
+
+  @override
+  void writeByte(int byte) {
+    if (offset == expectedBytes.length || expectedBytes[offset] != byte) {
+      int expected =
+          (offset >= expectedBytes.length) ? eof : expectedBytes[offset];
+      throw 'At offset $offset: '
+          'Expected ${show(expected)} but found ${show(byte)}';
+    }
+    ++offset;
+  }
+
+  @override
+  void writeBytes(List<int> bytes) {
+    bytes.forEach(writeByte);
+  }
+}
diff --git a/pkg/kernel/test/round_trip_test_disabled.dart b/pkg/kernel/test/round_trip_test_disabled.dart
new file mode 100644
index 0000000..946f252
--- /dev/null
+++ b/pkg/kernel/test/round_trip_test_disabled.dart
@@ -0,0 +1,19 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.round_trip_test;
+
+import 'package:test/test.dart';
+import 'round_trip.dart' as cmd;
+
+void main() {
+  test('dart2js', () {
+    cmd.main(['test/data/dart2js.dill']);
+  });
+  test('dart2js-strong', () {
+    cmd.main(['test/data/dart2js-strong.dill']);
+  });
+  test('boms', () {
+    cmd.main(['test/data/boms.dill']);
+  });
+}
diff --git a/pkg/kernel/test/serialize_bench.dart b/pkg/kernel/test/serialize_bench.dart
new file mode 100644
index 0000000..f19e1af
--- /dev/null
+++ b/pkg/kernel/test/serialize_bench.dart
@@ -0,0 +1,35 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:kernel/kernel.dart';
+import 'dart:io';
+
+final String usage = '''
+Usage: serialize_bench INPUT.dill OUTPUT.dill
+
+Deserialize INPUT and write it back to OUTPUT several times, measuring
+the time it takes, including I/O time.
+''';
+
+main(List<String> args) async {
+  if (args.length != 2) {
+    print(usage);
+    exit(1);
+  }
+  Program program = loadProgramFromBinary(args[0]);
+
+  String destination = args[1];
+  var watch = new Stopwatch()..start();
+  await writeProgramToBinary(program, destination);
+  int coldTime = watch.elapsedMilliseconds;
+
+  watch.reset();
+  int numTrials = 10;
+  for (int i = 0; i < numTrials; ++i) {
+    await writeProgramToBinary(program, destination);
+  }
+  double hotTime = watch.elapsedMilliseconds / numTrials;
+
+  print('Cold time: $coldTime ms');
+  print('Hot time:  $hotTime ms');
+}
diff --git a/pkg/kernel/test/treeshaker_bench.dart b/pkg/kernel/test/treeshaker_bench.dart
new file mode 100644
index 0000000..3096f99
--- /dev/null
+++ b/pkg/kernel/test/treeshaker_bench.dart
@@ -0,0 +1,94 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.treeshaker_bench;
+
+import 'dart:io';
+
+import 'package:args/args.dart';
+import 'package:kernel/class_hierarchy.dart';
+import 'package:kernel/core_types.dart';
+import 'package:kernel/kernel.dart';
+import 'package:kernel/transformations/treeshaker.dart';
+
+import 'class_hierarchy_basic.dart';
+
+ArgParser argParser = new ArgParser()
+  ..addFlag('basic',
+      help: 'Use the basic class hierarchy implementation', negatable: false)
+  ..addFlag('from-scratch',
+      help: 'Rebuild class hierarchy for each tree shaking', negatable: false)
+  ..addFlag('diagnose',
+      abbr: 'd', help: 'Print internal diagnostics', negatable: false);
+
+String usage = '''
+Usage: treeshaker_bench [options] FILE.dart
+
+Benchmark the tree shaker and the class hierarchy it depends on.
+
+Options:
+${argParser.usage}
+''';
+
+void main(List<String> args) {
+  if (args.length == 0) {
+    print(usage);
+    exit(1);
+  }
+  ArgResults options = argParser.parse(args);
+  if (options.rest.length != 1) {
+    print('Exactly one file must be given');
+    exit(1);
+  }
+  String filename = options.rest.single;
+
+  Program program = loadProgramFromBinary(filename);
+
+  ClassHierarchy buildClassHierarchy() {
+    return options['basic']
+        ? new BasicClassHierarchy(program)
+        : new ClassHierarchy(program);
+  }
+
+  CoreTypes coreTypes = new CoreTypes(program);
+
+  var watch = new Stopwatch()..start();
+  ClassHierarchy sharedClassHierarchy = buildClassHierarchy();
+  int coldHierarchyTime = watch.elapsedMicroseconds;
+  var shaker = new TreeShaker(program,
+      hierarchy: sharedClassHierarchy, coreTypes: coreTypes);
+  if (options['diagnose']) {
+    print(shaker.getDiagnosticString());
+  }
+  shaker = null;
+  int coldTreeShakingTime = watch.elapsedMicroseconds;
+
+  ClassHierarchy getClassHierarchy() {
+    return options['from-scratch']
+        ? buildClassHierarchy()
+        : sharedClassHierarchy;
+  }
+
+  const int numberOfTrials = 50;
+  int hotHierarchyTime = 0;
+  int hotTreeShakingTime = 0;
+  watch.reset();
+  for (int i = 0; i < numberOfTrials; i++) {
+    watch.reset();
+    var hierarchy = getClassHierarchy();
+    hotHierarchyTime += watch.elapsedMicroseconds;
+    new TreeShaker(program, hierarchy: hierarchy, coreTypes: coreTypes);
+    hotTreeShakingTime += watch.elapsedMicroseconds;
+  }
+  hotHierarchyTime ~/= numberOfTrials;
+  hotTreeShakingTime ~/= numberOfTrials;
+
+  var coldShakingMs = coldTreeShakingTime ~/ 1000;
+  var coldHierarchyMs = coldHierarchyTime ~/ 1000;
+  var hotShakingMs = hotTreeShakingTime ~/ 1000;
+  var hotHierarchyMs = hotHierarchyTime ~/ 1000;
+
+  print('''
+build.cold $coldShakingMs ms ($coldHierarchyMs ms from hierarchy)
+build.hot  $hotShakingMs ms ($hotHierarchyMs ms from hierarchy)''');
+}
diff --git a/pkg/kernel/test/treeshaker_check.dart b/pkg/kernel/test/treeshaker_check.dart
new file mode 100644
index 0000000..8abb640
--- /dev/null
+++ b/pkg/kernel/test/treeshaker_check.dart
@@ -0,0 +1,55 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.treeshaker_check;
+
+import 'package:kernel/kernel.dart';
+import 'package:kernel/transformations/treeshaker.dart';
+import 'dart:io';
+
+String usage = '''
+Usage: treeshaker_check FILE.dill
+
+Run the tree shaker on FILE.dill and perform some internal sanity checks.
+''';
+
+main(List<String> args) {
+  if (args.length == 0) {
+    print(usage);
+    exit(1);
+  }
+  var program = loadProgramFromBinary(args[0]);
+  var shaker = new TreeShaker(program);
+  shaker.transform(program);
+  new TreeShakingSanityCheck(shaker).visit(program);
+}
+
+class TreeShakingSanityCheck extends RecursiveVisitor {
+  final TreeShaker shaker;
+  bool isInCoreLibrary = false;
+
+  TreeShakingSanityCheck(this.shaker);
+
+  void visit(Node node) {
+    node.accept(this);
+  }
+
+  visitLibrary(Library node) {
+    isInCoreLibrary = (node.importUri.scheme == 'dart');
+    super.visitLibrary(node);
+  }
+
+  defaultMember(Member member) {
+    if (!isInCoreLibrary &&
+        member is! Constructor &&
+        !shaker.isMemberUsed(member)) {
+      throw 'Unused member $member was not removed';
+    }
+  }
+
+  defaultMemberReference(Member target) {
+    if (!shaker.isMemberUsed(target)) {
+      throw 'Found reference to $target';
+    }
+  }
+}
diff --git a/pkg/kernel/test/treeshaker_dump.dart b/pkg/kernel/test/treeshaker_dump.dart
new file mode 100644
index 0000000..8d1c7f4
--- /dev/null
+++ b/pkg/kernel/test/treeshaker_dump.dart
@@ -0,0 +1,141 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.treeshaker_dump;
+
+import 'dart:io';
+import 'package:kernel/kernel.dart';
+import 'package:kernel/transformations/treeshaker.dart';
+import 'package:args/args.dart';
+import 'package:path/path.dart' as pathlib;
+import 'package:kernel/text/ast_to_text.dart';
+
+ArgParser parser = new ArgParser(allowTrailingOptions: true)
+  ..addFlag('used', help: 'Print used members', negatable: false)
+  ..addFlag('unused', help: 'Print unused members', negatable: false)
+  ..addFlag('instantiated',
+      help: 'Print instantiated classes', negatable: false)
+  ..addFlag('types', help: 'Print classes used as a type', negatable: false)
+  ..addFlag('summary',
+      help: 'Print short summary of tree shaking results', defaultsTo: true)
+  ..addFlag('diff',
+      help: 'Print textual output before and after tree shaking.\n'
+          'Files are written to FILE.before.txt and FILE.after.txt',
+      negatable: false)
+  ..addOption('output',
+      help: 'The --diff files are written to the given directory instead of '
+          'the working directory');
+
+String usage = '''
+Usage: treeshaker_dump [options] FILE.dill
+
+Runs tree shaking on the given program and prints information about the results.
+
+Example:
+  treeshaker_dump --instantiated foo.dill
+
+Example:
+    treeshaker_dump --diff foo.dill
+    diff -cd foo.{before,after}.txt > diff.txt
+    # open diff.txt in an editor
+
+Options:
+${parser.usage}
+''';
+
+main(List<String> args) {
+  if (args.isEmpty) {
+    print(usage);
+    exit(1);
+  }
+  ArgResults options = parser.parse(args);
+  if (options.rest.length != 1) {
+    print('Exactly one file should be given.');
+    exit(1);
+  }
+  String filename = options.rest.single;
+
+  if (options['output'] != null && !options['diff']) {
+    print('--output must be used with --diff');
+    exit(1);
+  }
+
+  Program program = loadProgramFromBinary(filename);
+  TreeShaker shaker = new TreeShaker(program);
+  int totalClasses = 0;
+  int totalInstantiationCandidates = 0;
+  int totalMembers = 0;
+  int usedClasses = 0;
+  int instantiatedClasses = 0;
+  int usedMembers = 0;
+
+  void visitMember(Member member) {
+    if (member.isAbstract) return; // Abstract members are not relevant.
+    ++totalMembers;
+    bool isUsed = shaker.isMemberUsed(member);
+    if (isUsed) {
+      ++usedMembers;
+    }
+    if (isUsed && options['used'] || !isUsed && options['unused']) {
+      String prefix = (options['used'] && options['unused'])
+          ? (isUsed ? 'USED   ' : 'UNUSED ')
+          : '';
+      print('$prefix$member');
+    }
+  }
+
+  for (var library in program.libraries) {
+    library.members.forEach(visitMember);
+    for (Class classNode in library.classes) {
+      ++totalClasses;
+      if (shaker.isInstantiated(classNode)) {
+        ++instantiatedClasses;
+        ++totalInstantiationCandidates;
+      } else if (!classNode.isAbstract &&
+          classNode.members.any((m) => m.isInstanceMember)) {
+        ++totalInstantiationCandidates;
+      }
+      if (shaker.isHierarchyUsed(classNode)) {
+        ++usedClasses;
+      }
+      classNode.members.forEach(visitMember);
+      if (options['instantiated'] && shaker.isInstantiated(classNode)) {
+        print(classNode);
+      }
+      if (options['types'] && shaker.isHierarchyUsed(classNode)) {
+        print(classNode);
+      }
+    }
+  }
+
+  if (options['summary']) {
+    print('Classes used:         ${ratio(usedClasses, totalClasses)}');
+    print('Classes instantiated: '
+        '${ratio(instantiatedClasses, totalInstantiationCandidates)}');
+    print('Members used:         ${ratio(usedMembers, totalMembers)}');
+  }
+
+  if (options['diff']) {
+    String name = pathlib.basenameWithoutExtension(filename);
+    String outputDir = options['output'] ?? '';
+    String beforeFile = pathlib.join(outputDir, '$name.before.txt');
+    String afterFile = pathlib.join(outputDir, '$name.after.txt');
+    NameSystem names = new NameSystem();
+    StringBuffer before = new StringBuffer();
+    new Printer(before, syntheticNames: names).writeProgramFile(program);
+    new File(beforeFile).writeAsStringSync('$before');
+    new TreeShaker(program).transform(program);
+    StringBuffer after = new StringBuffer();
+    new Printer(after, syntheticNames: names).writeProgramFile(program);
+    new File(afterFile).writeAsStringSync('$after');
+    print('Text written to $beforeFile and $afterFile');
+  }
+}
+
+String ratio(num x, num total) {
+  return '$x / $total (${percent(x, total)})';
+}
+
+String percent(num x, num total) {
+  return total == 0 ? '0%' : ((100 * x / total).toStringAsFixed(0) + '%');
+}
diff --git a/pkg/kernel/test/treeshaker_membench.dart b/pkg/kernel/test/treeshaker_membench.dart
new file mode 100644
index 0000000..318ba74
--- /dev/null
+++ b/pkg/kernel/test/treeshaker_membench.dart
@@ -0,0 +1,63 @@
+#!/usr/bin/env dart
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.treeshaker_membench;
+
+import 'package:kernel/kernel.dart';
+import 'package:kernel/transformations/treeshaker.dart';
+import 'package:kernel/class_hierarchy.dart';
+import 'package:kernel/core_types.dart';
+import 'package:args/args.dart';
+import 'dart:io';
+
+ArgParser argParser = new ArgParser()
+  ..addOption('count', abbr: 'c',
+      help: 'Build N copies of the tree shaker',
+      defaultsTo: '100');
+
+String usage = """
+Usage: treeshaker_membench [options] FILE.dart
+
+Options:
+${argParser.usage}
+""";
+
+/// Builds N copies of the tree shaker data structure for the given program.
+/// Pass --print-metrics to the Dart VM to measure the memory use.
+main(List<String> args) {
+  if (args.length == 0) {
+    print(usage);
+    exit(1);
+  }
+  ArgResults options = argParser.parse(args);
+  if (options.rest.length != 1) {
+    print('Exactly one file should be given');
+    exit(1);
+  }
+  String filename = options.rest.single;
+
+  Program program = loadProgramFromBinary(filename);
+  ClassHierarchy hierarchy = new ClassHierarchy(program);
+  CoreTypes coreTypes = new CoreTypes(program);
+
+  int copyCount = int.parse(options['count']);
+
+  TreeShaker buildTreeShaker() {
+    return new TreeShaker(program, hierarchy: hierarchy, coreTypes: coreTypes);
+  }
+
+  List<TreeShaker> keepAlive = <TreeShaker>[];
+  for (int i = 0; i < copyCount; ++i) {
+    keepAlive.add(buildTreeShaker());
+  }
+
+  print('$copyCount copies built');
+
+  if (args.contains('-v')) {
+    // Use of the list for something to avoid premature GC.
+    for (var treeShaker in keepAlive) {
+      treeShaker.getClassRetention(hierarchy.rootClass);
+    }
+  }
+}
diff --git a/pkg/kernel/test/type_hashcode_quality.dart b/pkg/kernel/test/type_hashcode_quality.dart
new file mode 100644
index 0000000..53a2b70
--- /dev/null
+++ b/pkg/kernel/test/type_hashcode_quality.dart
@@ -0,0 +1,48 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:kernel/kernel.dart';
+import 'dart:io';
+
+String usage = '''
+Usage: type_hashcode_quality FILE.dill
+
+Counts the number of hash collisions between DartTypes in the given file.
+''';
+
+void main(List<String> args) {
+  if (args.length == 0) {
+    print(usage);
+    exit(1);
+  }
+  Program program = loadProgramFromBinary(args[0]);
+  var visitor = new DartTypeCollector();
+  program.accept(visitor);
+  print('''
+Types:      ${visitor.numberOfTypes}
+Collisions: ${visitor.numberOfCollisions}''');
+}
+
+class DartTypeCollector extends RecursiveVisitor {
+  final Set<DartType> seenTypes = new Set<DartType>();
+  final Map<int, DartType> table = <int, DartType>{};
+  int numberOfCollisions = 0;
+  int numberOfTypes = 0;
+
+  @override
+  defaultDartType(DartType node) {
+    if (!seenTypes.add(node)) return;
+    ++numberOfTypes;
+    int hash = node.hashCode;
+    if (hash == 0) {
+      print('Type has a hash code of zero: $node');
+    }
+    DartType existing = table[hash];
+    if (existing == null) {
+      table[hash] = node;
+    } else if (existing != node) {
+      print('Collision between $existing and $node');
+      ++numberOfCollisions;
+    }
+  }
+}
diff --git a/pkg/kernel/test/type_hashcode_test_disabled.dart b/pkg/kernel/test/type_hashcode_test_disabled.dart
new file mode 100644
index 0000000..aa7f2d4
--- /dev/null
+++ b/pkg/kernel/test/type_hashcode_test_disabled.dart
@@ -0,0 +1,40 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:kernel/kernel.dart';
+import 'type_parser.dart';
+import 'type_unification_test_disabled.dart' show testCases;
+import 'package:test/test.dart';
+
+void checkHashCodeEquality(DartType type1, DartType type2) {
+  if (type1 == type2 && type1.hashCode != type2.hashCode) {
+    fail('Equal types with different hash codes: $type1 and $type2');
+  }
+}
+
+const int MinimumSmi = -(1 << 30);
+const int MaximumSmi = (1 << 30) - 1;
+
+bool isSmallInteger(int hash) {
+  return MinimumSmi <= hash && hash <= MaximumSmi;
+}
+
+void checkHashCodeRange(DartType type) {
+  int hash = type.hashCode;
+  if (!isSmallInteger(hash)) {
+    fail('Hash code for $type is not a SMI: $hash');
+  }
+}
+
+void main() {
+  for (var testCase in testCases) {
+    test('$testCase', () {
+      var env = new LazyTypeEnvironment();
+      var type1 = env.parse(testCase.type1);
+      var type2 = env.parse(testCase.type2);
+      checkHashCodeEquality(type1, type2);
+      checkHashCodeRange(type1);
+      checkHashCodeRange(type2);
+    });
+  }
+}
diff --git a/pkg/kernel/test/type_parser.dart b/pkg/kernel/test/type_parser.dart
new file mode 100644
index 0000000..d2e1b4d
--- /dev/null
+++ b/pkg/kernel/test/type_parser.dart
@@ -0,0 +1,323 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// A very simple parser for a subset of DartTypes for use in testing type
+// algebra.
+library kernel.test.type_parser;
+
+import 'package:kernel/kernel.dart';
+import 'package:kernel/text/ast_to_text.dart';
+
+typedef TreeNode TypeEnvironment(String name);
+
+/// [lookupType] should return a [Class] or [TypeParameter].
+DartType parseDartType(String type, TreeNode lookupType(String name)) {
+  return new DartTypeParser(type, lookupType).parseType();
+}
+
+class Token {
+  static const int Eof = 0;
+  static const int Name = 1;
+  static const int Comma = 2;
+  static const int LeftAngle = 3; // '<'
+  static const int RightAngle = 4; // '>'
+  static const int LeftParen = 5;
+  static const int RightParen = 6;
+  static const int LeftBracket = 7;
+  static const int RightBracket = 8;
+  static const int LeftBrace = 9;
+  static const int RightBrace = 10;
+  static const int Arrow = 11; // '=>'
+  static const int Colon = 12;
+  static const int Invalid = 100;
+}
+
+class DartTypeParser {
+  final String string;
+  int index = 0;
+  String tokenText;
+  final TypeEnvironment environment;
+  final Map<String, TypeParameter> localTypeParameters =
+      <String, TypeParameter>{};
+
+  DartTypeParser(this.string, this.environment);
+
+  TreeNode lookupType(String name) {
+    return localTypeParameters[name] ?? environment(name);
+  }
+
+  bool isIdentifierChar(int charCode) {
+    return 65 <= charCode && charCode <= 90 ||
+        97 <= charCode && charCode <= 122 ||
+        charCode == 95 || // '_'
+        charCode == 36; // '$'
+  }
+
+  bool isWhitespaceChar(int charCode) {
+    return charCode == 32;
+  }
+
+  int next() => string.codeUnitAt(index++);
+  int peek() => index < string.length ? string.codeUnitAt(index) : 0;
+
+  void skipWhitespace() {
+    while (isWhitespaceChar(peek())) {
+      next();
+    }
+  }
+
+  int scanToken() {
+    skipWhitespace();
+    if (index >= string.length) return Token.Eof;
+    int startIndex = index;
+    int x = next();
+    if (isIdentifierChar(x)) {
+      while (isIdentifierChar(peek())) {
+        x = next();
+      }
+      tokenText = string.substring(startIndex, index);
+      return Token.Name;
+    } else {
+      tokenText = string[index - 1];
+      int type = getTokenType(x);
+      return type;
+    }
+  }
+
+  int peekToken() {
+    skipWhitespace();
+    if (index >= string.length) return Token.Eof;
+    return getTokenType(peek());
+  }
+
+  int getTokenType(int character) {
+    switch (character) {
+      case 44:
+        return Token.Comma;
+      case 60:
+        return Token.LeftAngle;
+      case 62:
+        return Token.RightAngle;
+      case 40:
+        return Token.LeftParen;
+      case 41:
+        return Token.RightParen;
+      case 91:
+        return Token.LeftBracket;
+      case 92:
+        return Token.RightBracket;
+      case 123:
+        return Token.LeftBrace;
+      case 125:
+        return Token.RightBrace;
+      case 58:
+        return Token.Colon;
+      default:
+        if (isIdentifierChar(character)) return Token.Name;
+        return Token.Invalid;
+    }
+  }
+
+  void consumeString(String text) {
+    skipWhitespace();
+    if (string.startsWith(text, index)) {
+      index += text.length;
+    } else {
+      return fail('Expected token $text');
+    }
+  }
+
+  DartType parseType() {
+    int token = peekToken();
+    switch (token) {
+      case Token.Name:
+        scanToken();
+        String name = this.tokenText;
+        if (name == '_') return const BottomType();
+        if (name == 'void') return const VoidType();
+        if (name == 'dynamic') return const DynamicType();
+        var target = lookupType(name);
+        if (target == null) {
+          return fail('Unresolved type $name');
+        } else if (target is Class) {
+          return new InterfaceType(target, parseOptionalTypeArgumentList());
+        } else if (target is TypeParameter) {
+          if (peekToken() == Token.LeftAngle) {
+            return fail('Attempt to apply type arguments to a type variable');
+          }
+          return new TypeParameterType(target);
+        }
+        return fail("Unexpected lookup result for $name: $target");
+
+      case Token.LeftParen:
+        List<DartType> parameters = <DartType>[];
+        List<NamedType> namedParameters = <NamedType>[];
+        parseParameterList(parameters, namedParameters);
+        consumeString('=>');
+        var returnType = parseType();
+        return new FunctionType(parameters, returnType,
+            namedParameters: namedParameters);
+
+      case Token.LeftAngle:
+        var typeParameters = parseAndPushTypeParameterList();
+        List<DartType> parameters = <DartType>[];
+        List<NamedType> namedParameters = <NamedType>[];
+        parseParameterList(parameters, namedParameters);
+        consumeString('=>');
+        var returnType = parseType();
+        popTypeParameters(typeParameters);
+        return new FunctionType(parameters, returnType,
+            typeParameters: typeParameters, namedParameters: namedParameters);
+
+      default:
+        return fail('Unexpected token: $tokenText');
+    }
+  }
+
+  void parseParameterList(List<DartType> positional, List<NamedType> named) {
+    int token = scanToken();
+    assert(token == Token.LeftParen);
+    token = peekToken();
+    while (token != Token.RightParen) {
+      var type = parseType(); // Could be a named parameter name.
+      token = scanToken();
+      if (token == Token.Colon) {
+        String name = convertTypeToParameterName(type);
+        named.add(new NamedType(name, parseType()));
+        token = scanToken();
+      } else {
+        positional.add(type);
+      }
+      if (token != Token.Comma && token != Token.RightParen) {
+        return fail('Unterminated parameter list');
+      }
+    }
+    named.sort();
+  }
+
+  String convertTypeToParameterName(DartType type) {
+    if (type is InterfaceType && type.typeArguments.isEmpty) {
+      return type.classNode.name;
+    } else if (type is TypeParameterType) {
+      return type.parameter.name;
+    } else {
+      return fail('Unexpected colon after $type');
+    }
+  }
+
+  List<DartType> parseTypeList(int open, int close) {
+    int token = scanToken();
+    assert(token == open);
+    List<DartType> types = <DartType>[];
+    token = peekToken();
+    while (token != close) {
+      types.add(parseType());
+      token = scanToken();
+      if (token != Token.Comma && token != close) {
+        throw fail('Unterminated list');
+      }
+    }
+    return types;
+  }
+
+  List<DartType> parseOptionalList(int open, int close) {
+    if (peekToken() != open) return null;
+    return parseTypeList(open, close);
+  }
+
+  List<DartType> parseOptionalTypeArgumentList() {
+    return parseOptionalList(Token.LeftAngle, Token.RightAngle);
+  }
+
+  void popTypeParameters(List<TypeParameter> typeParameters) {
+    typeParameters.forEach(localTypeParameters.remove);
+  }
+
+  List<TypeParameter> parseAndPushTypeParameterList() {
+    int token = scanToken();
+    assert(token == Token.LeftAngle);
+    List<TypeParameter> typeParameters = <TypeParameter>[];
+    token = peekToken();
+    while (token != Token.RightAngle) {
+      typeParameters.add(parseAndPushTypeParameter());
+      token = scanToken();
+      if (token != Token.Comma && token != Token.RightAngle) {
+        throw fail('Unterminated type parameter list');
+      }
+    }
+    return typeParameters;
+  }
+
+  TypeParameter parseAndPushTypeParameter() {
+    var nameTok = scanToken();
+    if (nameTok != Token.Name) return fail('Expected a name');
+    var typeParameter = new TypeParameter(tokenText);
+    if (localTypeParameters.containsKey(typeParameter.name)) {
+      return fail('Shadowing a type parameter is not allowed');
+    }
+    localTypeParameters[typeParameter.name] = typeParameter;
+    var next = peekToken();
+    if (next == Token.Colon) {
+      scanToken();
+      typeParameter.bound = parseType();
+    } else {
+      typeParameter.bound = new InterfaceType(lookupType('Object'));
+    }
+    return typeParameter;
+  }
+
+  dynamic fail(String message) {
+    throw '$message at index $index';
+  }
+}
+
+class LazyTypeEnvironment {
+  final Map<String, Class> classes = <String, Class>{};
+  final Map<String, TypeParameter> typeParameters = <String, TypeParameter>{};
+  final Library dummyLibrary =
+      new Library(new Uri(path: 'dummy.dart'), name: 'lib');
+
+  TreeNode lookup(String name) {
+    return name.length == 1
+        ? typeParameters.putIfAbsent(name, () => new TypeParameter(name))
+        : classes.putIfAbsent(name, () => makeClass(name));
+  }
+
+  Class makeClass(String name) {
+    var class_ = new Class(name: name);
+    dummyLibrary.addClass(class_);
+    return class_;
+  }
+
+  void clearTypeParameters() {
+    typeParameters.clear();
+  }
+
+  DartType parse(String type) => parseDartType(type, lookup);
+
+  Supertype parseSuper(String type) {
+    InterfaceType interfaceType = parse(type);
+    return new Supertype(interfaceType.classNode, interfaceType.typeArguments);
+  }
+
+  DartType parseFresh(String type) {
+    clearTypeParameters();
+    return parse(type);
+  }
+
+  TypeParameter getTypeParameter(String name) {
+    if (name.length != 1) throw 'Type parameter names must have length 1';
+    return lookup(name);
+  }
+}
+
+void main(List<String> args) {
+  if (args.length != 1) {
+    print('Usage: type_parser TYPE');
+  }
+  var environment = new LazyTypeEnvironment();
+  var type = parseDartType(args[0], environment.lookup);
+  var buffer = new StringBuffer();
+  new Printer(buffer).writeType(type);
+  print(buffer);
+}
diff --git a/pkg/kernel/test/type_propagation_dump.dart b/pkg/kernel/test/type_propagation_dump.dart
new file mode 100644
index 0000000..6de0872
--- /dev/null
+++ b/pkg/kernel/test/type_propagation_dump.dart
@@ -0,0 +1,187 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.type_propagation.dump;
+
+import 'package:kernel/kernel.dart';
+import 'package:kernel/text/ast_to_text.dart';
+import 'package:kernel/type_propagation/builder.dart';
+import 'package:kernel/type_propagation/solver.dart';
+import 'package:kernel/type_propagation/visualizer.dart';
+import 'package:kernel/type_propagation/constraints.dart';
+import 'package:kernel/type_propagation/type_propagation.dart';
+import 'package:args/args.dart';
+import 'dart:io';
+
+ArgParser parser = new ArgParser()
+  ..addFlag('graph', help: 'Generate graphviz dot files')
+  ..addOption('graph-filter',
+      valueHelp: 'name',
+      help: 'Only print graph for members whose name contains the given string')
+  ..addFlag('text', help: 'Generate annotated kernel text files')
+  ..addFlag('escape', help: 'Dump information from escape analysis')
+  ..addFlag('stats',
+      help: 'Print times and constraint system size', defaultsTo: true)
+  ..addFlag('solve', help: 'Solve the constraint system', defaultsTo: true);
+
+String get usage => """
+Usage: dump [options] FILE.dill
+
+Options:
+${parser.usage}
+""";
+
+const String outputDir = 'typegraph';
+
+main(List<String> args) {
+  if (args.length == 0) {
+    print(usage);
+    exit(1);
+  }
+  ArgResults options = parser.parse(args);
+  if (options.rest.length != 1) {
+    print('Exactly one file must be given');
+    exit(1);
+  }
+  String path = options.rest.single;
+
+  bool printGraphviz = options['graph'];
+  bool printText = options['text'];
+  bool printEscape = options['escape'];
+  bool useVisualizer = printGraphviz || printText || printEscape;
+
+  Program program = loadProgramFromBinary(path);
+  Stopwatch watch = new Stopwatch()..start();
+  Visualizer visualizer = useVisualizer ? new Visualizer(program) : null;
+  Builder builder = new Builder(program, visualizer: visualizer, verbose: true);
+  int buildTime = watch.elapsedMilliseconds;
+
+  watch.reset();
+  var solver = new Solver(builder);
+  if (options['solve']) {
+    solver.solve();
+  }
+  int solveTime = watch.elapsedMilliseconds;
+  visualizer?.solver = solver;
+  ConstraintSystem constraints = builder.constraints;
+
+  if (printEscape) {
+    for (int value = 0; value <= constraints.numberOfValues; ++value) {
+      TreeNode node;
+      if (value < builder.hierarchy.classes.length) {
+        node = builder.hierarchy.classes[value];
+      } else {
+        FunctionNode function = visualizer.getFunctionFromValue(value);
+        if (function == null || function.parent is! Member) continue;
+        node = function.parent;
+      }
+      int escape = solver.getEscapeContext(value);
+      String escapeString = (escape == constraints.latticePointOfValue[value])
+          ? 'no escape'
+          : visualizer.getLatticePointName(escape);
+      print('$node -> $escapeString');
+    }
+  }
+
+  if (printText) {
+    print('Printing kernel text files...');
+    new Directory(outputDir).createSync();
+    StringBuffer buffer = new StringBuffer();
+    Printer printer =
+        new Printer(buffer, annotator: visualizer.getTextAnnotator());
+    printer.writeProgramFile(program);
+    String path = '$outputDir/program.txt';
+    new File(path).writeAsStringSync('$buffer');
+  }
+
+  if (printGraphviz) {
+    print('Printing graphviz dot files...');
+    String filter = options['graph-filter'];
+    new Directory(outputDir).createSync();
+    void dumpMember(Member member) {
+      if (filter != null && !'$member'.contains(filter)) return;
+      String name = sanitizeFilename('$member');
+      String path = '$outputDir/$name.dot';
+      String dotCode = visualizer.dumpMember(member);
+      new File(path).writeAsStringSync(dotCode);
+    }
+    for (var library in program.libraries) {
+      library.members.forEach(dumpMember);
+      for (var class_ in library.classes) {
+        class_.members.forEach(dumpMember);
+      }
+    }
+  }
+
+  if (options['stats']) {
+    var constraints = solver.constraints;
+    int numberOfConstraints = constraints.numberOfAssignments +
+        constraints.numberOfLoads +
+        constraints.numberOfStores;
+    int numberOfTransfers = numberOfConstraints * solver.iterations;
+    double transfersPerSecond =
+        (numberOfConstraints * solver.iterations) / (solveTime / 1000);
+    Iterable<int> outputVariables = [
+      builder.global.fields.values,
+      builder.global.returns.values,
+      builder.global.parameters.values
+    ].expand((x) => x);
+    int outputCount = outputVariables.length;
+    int inferredUnknown = 0;
+    int inferredNothing = 0;
+    int inferredNullable = 0;
+    int inferredNonNullable = 0;
+    int inferredOnlyNull = 0;
+    for (int variable in outputVariables) {
+      int values = solver.getVariableValue(variable);
+      int bitmask = solver.getVariableBitmask(variable);
+      if (values == Solver.bottom && bitmask == 0) {
+        ++inferredNothing;
+      } else if (values == Solver.bottom && bitmask == ValueBit.null_) {
+        ++inferredOnlyNull;
+      } else if (values == Solver.rootClass && bitmask == ValueBit.all) {
+        ++inferredUnknown;
+      } else if (bitmask & ValueBit.null_ != 0) {
+        ++inferredNullable;
+      } else {
+        ++inferredNonNullable;
+      }
+    }
+    print("""
+Build time:  $buildTime ms
+Solve time:  $solveTime ms
+Iterations:  ${solver.iterations}
+
+Classes:     ${builder.hierarchy.classes.length}
+Values:      ${constraints.numberOfValues}
+Unions:      ${constraints.numberOfLatticePoints}
+Variables:   ${constraints.numberOfVariables}
+Fields:      ${builder.fieldNames.length}
+Assignments: ${constraints.numberOfAssignments}
+Loads:       ${constraints.numberOfLoads}
+Stores:      ${constraints.numberOfStores}
+
+Transfers:   $numberOfTransfers (${(transfersPerSecond / 1000000).toStringAsFixed(1)} M/s)
+
+Outputs:      $outputCount
+Unknown:      $inferredUnknown (${percent(inferredUnknown, outputCount)})
+Nullable:     $inferredNullable (${percent(inferredNullable, outputCount)})
+Non-nullable: $inferredNonNullable (${percent(inferredNonNullable, outputCount)})
+Only null:    $inferredOnlyNull (${percent(inferredOnlyNull, outputCount)})
+Nothing:      $inferredNothing (${percent(inferredNothing, outputCount)})
+  """);
+  }
+}
+
+String percent(int amount, int total) {
+  if (total == 0) return '0%';
+  return (amount / total * 100).toStringAsFixed(1) + '%';
+}
+
+String sanitizeFilename(String name) {
+  return name
+      .replaceAll('::', '.')
+      .replaceAll('/', r'$div')
+      .replaceAll('(', '')
+      .replaceAll(')', '');
+}
diff --git a/pkg/kernel/test/type_propagation_selfcheck.dart b/pkg/kernel/test/type_propagation_selfcheck.dart
new file mode 100644
index 0000000..f5ce293
--- /dev/null
+++ b/pkg/kernel/test/type_propagation_selfcheck.dart
@@ -0,0 +1,185 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.type_propagation.selfcheck;
+
+import 'dart:io';
+import 'package:kernel/core_types.dart';
+import 'package:kernel/kernel.dart';
+import 'package:kernel/type_propagation/type_propagation.dart';
+
+const String usage = '''
+Usage: selfcheck input.dill output.dill
+
+Runs type propagation on the given program and inserts dynamic checks
+to verify that all the propagated types are correct.
+''';
+
+main(List<String> args) {
+  if (args.length != 2) {
+    print(usage);
+    exit(1);
+  }
+  var program = loadProgramFromBinary(args[0]);
+  var typePropagation = new TypePropagation(program);
+  new SelfCheckTransformer(typePropagation).transform(program);
+  writeProgramToBinary(program, args[1]);
+}
+
+class SelfCheckTransformer {
+  final TypePropagation typePropagation;
+  Member currentMember;
+
+  CoreTypes get coreTypes => typePropagation.builder.coreTypes;
+
+  SelfCheckTransformer(this.typePropagation);
+
+  void transform(Program program) {
+    for (var library in program.libraries) {
+      library.procedures.forEach(transformProcedure);
+      library.fields.forEach(transformField);
+      for (var class_ in library.classes) {
+        class_.procedures.forEach(transformProcedure);
+        class_.fields.forEach(transformField);
+        class_.constructors.forEach(transformConstructor);
+      }
+    }
+  }
+
+  void transformProcedure(Procedure node) {
+    currentMember = node;
+    transformFunction(node.function, checkReturn: true);
+  }
+
+  void transformConstructor(Constructor node) {
+    currentMember = node;
+    transformFunction(node.function, checkReturn: false);
+  }
+
+  void transformField(Field node) {
+    // TODO(asgerf): To check this, we could wrap with a getter/setter pair
+    //   and instrument constructor initializers.  But for now we don't do
+    //   anything for fields.
+  }
+
+  void transformFunction(FunctionNode node, {bool checkReturn}) {
+    if (node.body == null) return; // Nothing to check if there is no body.
+    List<Statement> newStatements = <Statement>[];
+    for (VariableDeclaration parameter in node.positionalParameters) {
+      InferredValue value = typePropagation.getParameterValue(parameter);
+      newStatements.add(makeCheck(parameter, value));
+    }
+    for (VariableDeclaration parameter in node.namedParameters) {
+      InferredValue value = typePropagation.getParameterValue(parameter);
+      newStatements.add(makeCheck(parameter, value));
+    }
+    newStatements.add(node.body);
+    node.body = new Block(newStatements)..parent = node;
+    // TODO(asgerf): Also check return value.
+  }
+
+  /// Make a statement that throws if the value in [variable] is not in the
+  /// value set implied by [expected].
+  Statement makeCheck(VariableDeclaration variable, InferredValue expected) {
+    Expression condition = new LogicalExpression(
+        makeBaseClassCheck(variable, expected),
+        '&&',
+        makeBitmaskCheck(variable, expected));
+    return new IfStatement(
+        new Not(condition),
+        new ExpressionStatement(new Throw(new StringConcatenation([
+          new StringLiteral(
+              'Unexpected value in $currentMember::${variable.name}: '),
+          new VariableGet(variable)
+        ]))),
+        null);
+  }
+
+  /// Makes an expression that returns `false` if the base class relation or
+  /// nullability is not satisfied by the value in [variable],
+  Expression makeBaseClassCheck(
+      VariableDeclaration variable, InferredValue expected) {
+    Expression condition;
+    switch (expected.baseClassKind) {
+      case BaseClassKind.None:
+        condition = new BoolLiteral(false);
+        break;
+
+      case BaseClassKind.Exact:
+        if (expected.baseClass.typeParameters.isNotEmpty) {
+          // TODO(asgerf): For this we need a way to get the raw concrete type
+          //   of an object.  For now, just emit the less accurate subtype
+          //   check.
+          condition = new IsExpression(
+              new VariableGet(variable), expected.baseClass.rawType);
+        } else {
+          // Check `value.runtimeType == C`.
+          var runtimeType = new PropertyGet(
+              new VariableGet(variable), new Name('runtimeType'));
+          condition = new MethodInvocation(runtimeType, new Name('=='),
+              new Arguments([new TypeLiteral(expected.baseClass.rawType)]));
+        }
+        break;
+
+      case BaseClassKind.Subclass:
+      case BaseClassKind.Subtype:
+        // TODO(asgerf): For subclass checks, we should check more precisely
+        //   that is it a subclass, but for now just emit a subtype check.
+        condition = new IsExpression(
+            new VariableGet(variable), expected.baseClass.rawType);
+        break;
+    }
+    // Always allow 'null'.  The base class relation should always permit 'null'
+    // as a possible value, but the checks generated above disallow it.
+    var nullCheck = makeIsNull(new VariableGet(variable));
+    return new LogicalExpression(nullCheck, '||', condition);
+  }
+
+  Expression makeIsNull(Expression value) {
+    return new MethodInvocation(
+        value, new Name('=='), new Arguments([new NullLiteral()]));
+  }
+
+  /// Makes an expression that returns `false` if the value bits other than
+  /// [ValueBit.null_] are not satisfied by the value in [variable],
+  Expression makeBitmaskCheck(
+      VariableDeclaration variable, InferredValue expected) {
+    if (expected.valueBits == 0) return new BoolLiteral(false);
+
+    // List of conditions that all must hold.  For each zero bit we know that
+    // type of value is not allowed to occur.
+    List<Expression> allChecks = <Expression>[];
+
+    // List of condition of which one must hold.  This is used for checking the
+    // [ValueBit.other] bit.  For each one bit, we know that type of value
+    // is allowed to occur.  We use this because it is hard to check directly
+    // that a value is of the 'other' type.
+    bool disallowOtherValues = expected.valueBits & ValueBit.other == 0;
+    List<Expression> anyChecks = disallowOtherValues
+        ? <Expression>[]
+        : null;
+
+    void checkType(int bit, DartType type) {
+      if (expected.valueBits & bit == 0) {
+        allChecks
+            .add(new Not(new IsExpression(new VariableGet(variable), type)));
+      } else if (disallowOtherValues) {
+        anyChecks.add(new IsExpression(new VariableGet(variable), type));
+      }
+    }
+
+    checkType(ValueBit.integer, coreTypes.intClass.rawType);
+    checkType(ValueBit.double_, coreTypes.doubleClass.rawType);
+    checkType(ValueBit.string, coreTypes.stringClass.rawType);
+    checkType(ValueBit.null_, coreTypes.nullClass.rawType);
+
+    if (disallowOtherValues) {
+      Expression any =
+          anyChecks.reduce((e1, e2) => new LogicalExpression(e1, '||', e2));
+      allChecks.add(any);
+    }
+    return allChecks.isEmpty
+        ? new BoolLiteral(true)
+        : allChecks.reduce((e1, e2) => new LogicalExpression(e1, '&&', e2));
+  }
+}
diff --git a/pkg/kernel/test/type_substitute_bounds_test_disabled.dart b/pkg/kernel/test/type_substitute_bounds_test_disabled.dart
new file mode 100644
index 0000000..bddd7bd
--- /dev/null
+++ b/pkg/kernel/test/type_substitute_bounds_test_disabled.dart
@@ -0,0 +1,84 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 kernel.type_substitute_bounds_test;
+
+import 'package:kernel/kernel.dart';
+import 'package:kernel/type_algebra.dart';
+import 'package:test/test.dart';
+import 'type_parser.dart';
+
+final List<TestCase> testCases = <TestCase>[
+  testCase('T', {'T': bound('_', 'String')}, 'String'),
+  testCase('List<T>', {'T': bound('_', 'String')}, 'List<String>'),
+  testCase('List<List<T>>', {'T': bound('_', 'String')}, 'List<List<String>>'),
+  testCase('(T) => T', {'T': bound('_', 'String')}, '(_) => String'),
+  testCase('<G>(G,T) => T', {'T': bound('_', 'String')}, '<G>(G,_) => String'),
+  testCase(
+      '<G>(G,x:T) => T', {'T': bound('_', 'String')}, '<G>(G,x:_) => String'),
+  testCase('<G:T>(G) => G', {'T': bound('_', 'String')}, '<G:_>(G) => G'),
+  testCase('<G:T>(G) => G', {'T': bound('int', 'num')}, '<G:int>(G) => G'),
+  testCase('<G>(T,G) => void', {'T': bound('_', 'String')}, '<G>(_,G) => void'),
+  testCase('(T) => void', {'T': bound('_', 'String')}, '(_) => void'),
+  testCase('(int) => T', {'T': bound('_', 'String')}, '(int) => String'),
+  testCase('(int) => int', {'T': bound('_', 'String')}, '(int) => int'),
+  testCase('((T) => int) => int', {'T': bound('_', 'String')},
+      '((String) => int) => int'),
+  testCase('<E>(<F>(T) => int) => int', {'T': bound('_', 'String')},
+      '<E>(<F>(String) => int) => int'),
+  testCase('(<F>(T) => int) => int', {'T': bound('_', 'String')},
+      '(<F>(String) => int) => int'),
+  testCase('<E>((T) => int) => int', {'T': bound('_', 'String')},
+      '<E>((String) => int) => int'),
+];
+
+class TestCase {
+  final String type;
+  final Map<String, TypeBound> bounds;
+  final String expected;
+
+  TestCase(this.type, this.bounds, this.expected);
+
+  String toString() {
+    var substitution = bounds.keys.map((key) {
+      var bound = bounds[key];
+      return '${bound.lower} <: $key <: ${bound.upper}';
+    }).join(',');
+    return '$type [$substitution] <: $expected';
+  }
+}
+
+class TypeBound {
+  final String lower, upper;
+
+  TypeBound(this.lower, this.upper);
+}
+
+TypeBound bound(String lower, String upper) => new TypeBound(lower, upper);
+
+TestCase testCase(String type, Map<String, TypeBound> bounds, String expected) {
+  return new TestCase(type, bounds, expected);
+}
+
+main() {
+  for (var testCase in testCases) {
+    test('$testCase', () {
+      var environment = new LazyTypeEnvironment();
+      var type = environment.parse(testCase.type);
+      var upperBounds = <TypeParameter, DartType>{};
+      var lowerBounds = <TypeParameter, DartType>{};
+      testCase.bounds.forEach((String name, TypeBound bounds) {
+        var parameter = environment.getTypeParameter(name);
+        upperBounds[parameter] = environment.parse(bounds.upper);
+        lowerBounds[parameter] = environment.parse(bounds.lower);
+      });
+      var substituted = Substitution
+          .fromUpperAndLowerBounds(upperBounds, lowerBounds)
+          .substituteType(type);
+      var expected = environment.parse(testCase.expected);
+      if (substituted != expected) {
+        fail('Expected `$expected` but got `$substituted`');
+      }
+    });
+  }
+}
diff --git a/pkg/kernel/test/type_substitution_identity_test_disabled.dart b/pkg/kernel/test/type_substitution_identity_test_disabled.dart
new file mode 100644
index 0000000..2e6c263
--- /dev/null
+++ b/pkg/kernel/test/type_substitution_identity_test_disabled.dart
@@ -0,0 +1,30 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:kernel/kernel.dart';
+import 'package:kernel/type_algebra.dart';
+import 'type_parser.dart';
+import 'type_unification_test_disabled.dart' show testCases;
+import 'package:test/test.dart';
+
+checkType(DartType type) {
+  var map = {new TypeParameter(): const DynamicType()};
+  var other = substitute(type, map);
+  if (!identical(type, other)) {
+    fail('Identity substitution test failed for $type');
+  }
+  other = Substitution.fromUpperAndLowerBounds(map, map).substituteType(type);
+  if (!identical(type, other)) {
+    fail('Identity bounded substitution test failed for $type');
+  }
+}
+
+main() {
+  for (var testCase in testCases) {
+    test('$testCase', () {
+      var env = new LazyTypeEnvironment();
+      checkType(env.parse(testCase.type1));
+      checkType(env.parse(testCase.type2));
+    });
+  }
+}
diff --git a/pkg/kernel/test/type_subtype_test_disabled.dart b/pkg/kernel/test/type_subtype_test_disabled.dart
new file mode 100644
index 0000000..56b2339
--- /dev/null
+++ b/pkg/kernel/test/type_subtype_test_disabled.dart
@@ -0,0 +1,162 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:test/test.dart';
+import 'package:kernel/ast.dart';
+import 'package:kernel/class_hierarchy.dart';
+import 'package:kernel/type_environment.dart';
+import 'type_parser.dart';
+
+/// Description of a small class hierarchy for use in subtype tests.
+var classEnvironment = <String, List<String>>{
+  'Comparable<T>': ['Object'],
+  'num': ['Object', 'Comparable<num>'],
+  'int': ['num'],
+  'double': ['num'],
+  'Iterable<T>': ['Object'],
+  'List<T>': ['Iterable<T>'],
+};
+
+List<TestCase> testCases = <TestCase>[
+  subtype('int', 'num'),
+  subtype('int', 'Comparable<num>'),
+  subtype('int', 'Comparable<Object>'),
+  subtype('int', 'Object'),
+  subtype('double', 'num'),
+
+  notSubtype('int', 'double'),
+  notSubtype('int', 'Comparable<int>'),
+  notSubtype('int', 'Iterable<int>'),
+  notSubtype('Comparable<int>', 'Iterable<int>'),
+
+  subtype('List<int>', 'List<int>'),
+  subtype('List<int>', 'Iterable<int>'),
+  subtype('List<int>', 'List<num>'),
+  subtype('List<int>', 'Iterable<num>'),
+  subtype('List<int>', 'List<Object>'),
+  subtype('List<int>', 'Iterable<Object>'),
+  subtype('List<int>', 'Object'),
+  subtype('List<int>', 'List<Comparable<Object>>'),
+  subtype('List<int>', 'List<Comparable<num>>'),
+  subtype('List<int>', 'List<Comparable<Comparable<num>>>'),
+
+  notSubtype('List<int>', 'List<double>'),
+  notSubtype('List<int>', 'Iterable<double>'),
+  notSubtype('List<int>', 'Comparable<int>'),
+  notSubtype('List<int>', 'List<Comparable<int>>'),
+  notSubtype('List<int>', 'List<Comparable<Comparable<int>>>'),
+
+  subtype('(num) => num', '(int) => num'),
+  subtype('(num) => int', '(num) => num'),
+  subtype('(num) => int', '(int) => num'),
+  notSubtype('(int) => int', '(num) => num'),
+
+  subtype('(num) => (num) => num', '(num) => (int) => num'),
+  notSubtype('(num) => (int) => int', '(num) => (num) => num'),
+
+  subtype('(x:num) => num', '(x:int) => num'), // named parameters
+  subtype('(num,x:num) => num', '(int,x:int) => num'),
+  subtype('(x:num) => int', '(x:num) => num'),
+  notSubtype('(x:int) => int', '(x:num) => num'),
+
+  subtype('<E>(E) => int', '<E>(E) => num'), // type parameters
+  subtype('<E>(num) => E', '<E>(int) => E'),
+  subtype('<E>(E,num) => E', '<E>(E,int) => E'),
+  notSubtype('<E>(E,num) => E', '<E>(E,E) => E'),
+
+  subtype('<E>(E) => (E) => E', '<F>(F) => (F) => F'),
+  subtype('<E>(E, (int,E) => E) => E', '<E>(E, (int,E) => E) => E'),
+  subtype('<E>(E, (int,E) => E) => E', '<E>(E, (num,E) => E) => E'),
+  notSubtype('<E,F>(E) => (F) => E', '<E>(E) => <F>(F) => E'),
+  notSubtype('<E,F>(E) => (F) => E', '<F,E>(E) => (F) => E'),
+
+  subtype('<E>(E,num) => E', '<E:num>(E,E) => E'),
+  subtype('<E:num>(E) => int', '<E:int>(E) => int'),
+  subtype('<E:num>(E) => E', '<E:int>(E) => E'),
+  subtype('<E:num>(int) => E', '<E:int>(int) => E'),
+  notSubtype('<E>(int) => int', '(int) => int'),
+  notSubtype('<E,F>(int) => int', '<E>(int) => int'),
+
+  subtype('<E:List<E>>(E) => E', '<F:List<F>>(F) => F'),
+  subtype('<E:Iterable<E>>(E) => E', '<F:List<F>>(F) => F'),
+  subtype('<E>(E,List<Object>) => E', '<F:List<F>>(F,F) => F'),
+  notSubtype('<E>(E,List<Object>) => List<E>', '<F:List<F>>(F,F) => F'),
+  notSubtype('<E>(E,List<Object>) => int', '<F:List<F>>(F,F) => F'),
+  subtype('<E>(E,List<Object>) => E', '<F:List<F>>(F,F) => void'),
+];
+
+/// Assert that [subtype] is a subtype of [supertype], and that [supertype]
+/// is not a subtype of [subtype] (unless the two strings are equal).
+TestCase subtype(String subtype_, String supertype) {
+  return new TestCase(subtype_, supertype, isSubtype: true);
+}
+
+/// Assert that neither type is a subtype of the other.
+TestCase notSubtype(String subtype_, String supertype) {
+  return new TestCase(subtype_, supertype, isSubtype: false);
+}
+
+class TestCase {
+  String subtype;
+  String supertype;
+  bool isSubtype;
+  TestCase(this.subtype, this.supertype, {this.isSubtype});
+
+  String toString() =>
+      isSubtype ? '$subtype <: $supertype' : '$subtype </: $supertype';
+}
+
+class MockSubtypeTester extends SubtypeTester {
+  ClassHierarchy hierarchy;
+  InterfaceType objectType;
+  InterfaceType rawFunctionType;
+  LazyTypeEnvironment environment;
+
+  MockSubtypeTester(
+      this.hierarchy, this.objectType, this.rawFunctionType, this.environment);
+}
+
+MockSubtypeTester makeSubtypeTester(Map<String, List<String>> testcase) {
+  LazyTypeEnvironment environment = new LazyTypeEnvironment();
+  Class objectClass = environment.lookup('Object');
+  Class functionClass = environment.lookup('Function');
+  functionClass.supertype = objectClass.asRawSupertype;
+  for (var typeString in testcase.keys) {
+    InterfaceType type = environment.parseFresh(typeString);
+    Class class_ = type.classNode;
+    for (TypeParameterType typeArg in type.typeArguments) {
+      class_.typeParameters.add(typeArg.parameter);
+    }
+    for (var supertypeString in testcase[typeString]) {
+      if (class_.supertype == null) {
+        class_.supertype = environment.parseSuper(supertypeString);
+      } else {
+        class_.implementedTypes.add(environment.parseSuper(supertypeString));
+      }
+    }
+  }
+  var program = new Program([environment.dummyLibrary]);
+  var hierarchy = new ClassHierarchy(program);
+  return new MockSubtypeTester(
+      hierarchy, objectClass.rawType, functionClass.rawType, environment);
+}
+
+main() {
+  var tester = makeSubtypeTester(classEnvironment);
+  var environment = tester.environment;
+  for (var testCase in testCases) {
+    test('$testCase', () {
+      var subtype = environment.parseFresh(testCase.subtype);
+      var supertype = environment.parseFresh(testCase.supertype);
+      if (tester.isSubtypeOf(subtype, supertype) != testCase.isSubtype) {
+        fail('isSubtypeOf(${testCase.subtype}, ${testCase.supertype}) returned '
+            '${!testCase.isSubtype} but should return ${testCase.isSubtype}');
+      }
+      if (subtype != supertype && tester.isSubtypeOf(supertype, subtype)) {
+        fail('isSubtypeOf(${testCase.supertype}, ${testCase.subtype}) returned '
+            'true but should return false');
+      }
+    });
+  }
+}
diff --git a/pkg/kernel/test/type_unification_test_disabled.dart b/pkg/kernel/test/type_unification_test_disabled.dart
new file mode 100644
index 0000000..ed75d26
--- /dev/null
+++ b/pkg/kernel/test/type_unification_test_disabled.dart
@@ -0,0 +1,138 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:kernel/type_algebra.dart';
+import 'package:test/test.dart';
+import 'type_parser.dart';
+import 'dart:io';
+
+final List<TestCase> testCases = <TestCase>[
+  successCase('List<T>', 'List<String>', {'T': 'String'}),
+  successCase('List<String>', 'List<T>', {'T': 'String'}),
+  successCase('List<T>', 'List<T>', {'T': null}),
+  successCase('List<S>', 'List<T>', {'S': 'T'}),
+  successCase('List<S>', 'List<T>', {'T': 'S'}),
+  successCase(
+      'List<S>', 'List<T>', {'S': 'T', 'T': null}), // Require left bias.
+  failureCase('List<S>', 'List<T>', []),
+
+  failureCase('List<T>', 'T', ['T']),
+  failureCase('List<List<T>>', 'List<T>', ['T']),
+  failureCase('Map<S, T>', 'Map<List<T>, List<S>>', ['T', 'S']),
+
+  failureCase('Map<Map<S,String>, Map<int,S>>',
+      'Map<Map<int, S>, Map<S, String>>', ['S']),
+  successCase('Map<Map<S, int>, Map<int, S>>', 'Map<Map<int, S>, Map<S, int>>',
+      {'S': 'int'}),
+  successCase('Map<Map<S, String>, Map<int, T>>',
+      'Map<Map<int, T>, Map<S, String>>', {'S': 'int', 'T': 'String'}),
+
+  successCase('Map<S, List<T>>', 'Map<T, List<S>>', {'S': 'T'}),
+  successCase('Map<S, T>', 'Map<S, List<S>>', {'T': 'List<S>'}),
+  successCase('Map<S, T>', 'Map<S, List<S>>', {'T': 'List<S>', 'S': null}),
+  successCase('Map<List<S>, T>', 'Map<T, List<S>>', {'T': 'List<S>'}),
+  successCase(
+      'Map<List<S>, T>', 'Map<T, List<S>>', {'T': 'List<S>', 'S': null}),
+
+  successCase('<E>(E) => E', '<T>(T) => T', {}),
+  successCase('<E>(E, S) => E', '<T>(T, int) => T', {'S': 'int'}),
+  failureCase('<E>(E, S) => E', '<T>(T, T) => T', ['S']),
+  successCase(
+      '<E>(E) => <T>(T) => Map<E,T>', '<E>(E) => <T>(T) => Map<E,T>', {}),
+  successCase('<E>(E,_) => E', '<T>(T,_) => T', {}),
+
+  successCase('(x:int,y:String) => int', '(y:String,x:int) => int', {}),
+  successCase('<S,T>(x:S,y:T) => S', '<S,T>(y:T,x:S) => S', {}),
+  successCase('(x:<T>(T)=>T,y:<S>(S)=>S) => int', '(y:<S>(S)=>S,x:<T>(T)=>T) => int', {}),
+  successCase('(x:<T>(T)=>T,y:<S>(S,S,S)=>S) => int', '(y:<S>(S,S,S)=>S,x:<T>(T)=>T) => int', {}),
+];
+
+class TestCase {
+  String type1;
+  String type2;
+  Iterable<String> quantifiedVariables;
+  Map<String, String> expectedSubstitution; // Null if unification should fail.
+
+  TestCase.success(this.type1, this.type2, this.expectedSubstitution) {
+    quantifiedVariables = expectedSubstitution.keys;
+  }
+
+  TestCase.fail(this.type1, this.type2, this.quantifiedVariables);
+
+  bool get shouldSucceed => expectedSubstitution != null;
+
+  String toString() => '∃ ${quantifiedVariables.join(',')}. $type1 = $type2';
+}
+
+TestCase successCase(String type1, String type2, Map<String, String> expected,
+    {bool debug: false}) {
+  return new TestCase.success(type1, type2, expected);
+}
+
+TestCase failureCase(
+    String type1, String type2, List<String> quantifiedVariables,
+    {bool debug: false}) {
+  return new TestCase.fail(type1, type2, quantifiedVariables);
+}
+
+int numFailures = 0;
+
+void reportFailure(TestCase testCase, String message) {
+  ++numFailures;
+  fail('$message in `$testCase`');
+}
+
+main() {
+  for (TestCase testCase in testCases) {
+    test('$testCase', () {
+      var env = new LazyTypeEnvironment();
+      var type1 = env.parse(testCase.type1);
+      var type2 = env.parse(testCase.type2);
+      var quantifiedVariables =
+          testCase.quantifiedVariables.map(env.getTypeParameter).toSet();
+      var substitution = unifyTypes(type1, type2, quantifiedVariables);
+      if (testCase.shouldSucceed) {
+        if (substitution == null) {
+          reportFailure(testCase, 'Unification failed');
+        } else {
+          for (var key in testCase.expectedSubstitution.keys) {
+            var typeParameter = env.getTypeParameter(key);
+            if (testCase.expectedSubstitution[key] == null) {
+              if (substitution.containsKey(key)) {
+                var actualType = substitution[typeParameter];
+                reportFailure(
+                    testCase,
+                    'Incorrect substitution '
+                    '`$key = $actualType` should be unbound');
+              }
+            } else {
+              var expectedType = env.parse(testCase.expectedSubstitution[key]);
+              var actualType = substitution[typeParameter];
+              if (actualType != expectedType) {
+                reportFailure(
+                    testCase,
+                    'Incorrect substitution '
+                    '`$key = $actualType` should be `$key = $expectedType`');
+              }
+            }
+          }
+          var boundTypeVariables = testCase.expectedSubstitution.keys
+              .where((name) => testCase.expectedSubstitution[name] != null);
+          if (substitution.length != boundTypeVariables.length) {
+            reportFailure(
+                testCase,
+                'Substituted `${substitution.keys.join(',')}` '
+                'but should only substitute `${boundTypeVariables.join(',')}`');
+          }
+        }
+      } else {
+        if (substitution != null) {
+          reportFailure(testCase, 'Unification was supposed to fail');
+        }
+      }
+    });
+  }
+  if (numFailures > 0) {
+    exit(1);
+  }
+}
diff --git a/pkg/kernel/test/typecheck.dart b/pkg/kernel/test/typecheck.dart
new file mode 100644
index 0000000..a02815a
--- /dev/null
+++ b/pkg/kernel/test/typecheck.dart
@@ -0,0 +1,44 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:kernel/kernel.dart';
+import 'package:kernel/class_hierarchy.dart';
+import 'package:kernel/core_types.dart';
+import 'package:kernel/type_checker.dart';
+import 'dart:io';
+
+final String usage = '''
+Usage: typecheck FILE.dill
+
+Runs the strong mode type checker on the given program.
+''';
+
+main(List<String> args) {
+  if (args.length != 1) {
+    print(usage);
+    exit(1);
+  }
+  var program = loadProgramFromBinary(args[0]);
+  var coreTypes = new CoreTypes(program);
+  var hierarchy = new ClassHierarchy(program);
+  new TestTypeChecker(coreTypes, hierarchy).checkProgram(program);
+}
+
+class TestTypeChecker extends TypeChecker {
+  TestTypeChecker(CoreTypes coreTypes, ClassHierarchy hierarchy)
+      : super(coreTypes, hierarchy);
+
+  @override
+  void checkAssignable(TreeNode where, DartType from, DartType to) {
+    if (!environment.isSubtypeOf(from, to)) {
+      fail(where, '$from is not a subtype of $to');
+    }
+  }
+
+  @override
+  void fail(TreeNode where, String message) {
+    Location location = where.location;
+    String locationString = location == null ? '' : '($location)';
+    print('[error] $message $locationString');
+  }
+}
diff --git a/pkg/kernel/test/uint31_pair_map_bench.dart b/pkg/kernel/test/uint31_pair_map_bench.dart
new file mode 100644
index 0000000..1e6d5b0
--- /dev/null
+++ b/pkg/kernel/test/uint31_pair_map_bench.dart
@@ -0,0 +1,65 @@
+import 'package:kernel/type_propagation/canonicalizer.dart';
+
+main() {
+  Stopwatch watch = new Stopwatch()..start();
+
+  const int lowBiasKeys = 100;
+  const int highBiasKeys = 10000;
+  const int noBiasKeys = 1000;
+
+  Uint31PairMap map;
+
+  // Warm up.
+  map = new Uint31PairMap();
+  for (int i = 0; i < noBiasKeys; ++i) {
+    for (int j = 0; j < noBiasKeys; ++j) {
+      map.lookup(i, j);
+      map.put(i + j);
+    }
+  }
+
+  // Even distributed tuple components.
+  watch.reset();
+  map = new Uint31PairMap();
+  for (int i = 0; i < noBiasKeys; ++i) {
+    for (int j = 0; j < noBiasKeys; ++j) {
+      map.lookup(i, j);
+      map.put(i + j);
+    }
+  }
+  int noBiasTime = watch.elapsedMicroseconds;
+
+  // Left-bias: more unique keys in the first component.
+  watch.reset();
+  map = new Uint31PairMap();
+  for (int i = 0; i < highBiasKeys; ++i) {
+    for (int j = 0; j < lowBiasKeys; ++j) {
+      map.lookup(i, j);
+      map.put(i + j);
+    }
+  }
+  int leftBiasTime = watch.elapsedMicroseconds;
+
+  // Right-bias: more unique keys in the second component.
+  watch.reset();
+  map = new Uint31PairMap();
+  for (int i = 0; i < lowBiasKeys; ++i) {
+    for (int j = 0; j < highBiasKeys; ++j) {
+      map.lookup(i, j);
+      map.put(i + j);
+    }
+  }
+  int rightBiasTime = watch.elapsedMicroseconds;
+
+  print('''
+bias.none:  ${formatTime(noBiasTime)}
+bias.left:  ${formatTime(leftBiasTime)}
+bias.right: ${formatTime(rightBiasTime)}
+''');
+}
+
+
+String formatTime(int microseconds) {
+  double seconds = microseconds / 1000000.0;
+  return '$seconds s';
+}
diff --git a/pkg/kernel/test/uint31_pair_map_test_disabled.dart b/pkg/kernel/test/uint31_pair_map_test_disabled.dart
new file mode 100644
index 0000000..316f971
--- /dev/null
+++ b/pkg/kernel/test/uint31_pair_map_test_disabled.dart
@@ -0,0 +1,33 @@
+import 'dart:math';
+import 'package:kernel/type_propagation/canonicalizer.dart';
+import 'package:test/test.dart';
+
+Random random = new Random(12345);
+
+main() {
+  test('Uint31PairMap randomized tests', runTest);
+}
+
+runTest() {
+  const int trials = 1000;
+  const int insertions = 1000;
+  const int uniqueKeys = 900;
+  for (int trial = 0; trial < trials; ++trial) {
+    int nextValue = 1;
+    Map<Point<int>, int> trusted = <Point<int>, int>{};
+    Uint31PairMap candidate = new Uint31PairMap();
+    for (int i = 0; i < insertions; ++i) {
+      int x = random.nextInt(uniqueKeys);
+      int y = random.nextInt(uniqueKeys);
+      Point key = new Point(x, y);
+      int trustedValue = trusted[key];
+      int candidateValue = candidate.lookup(x, y);
+      expect(candidateValue, equals(trustedValue));
+      if (trustedValue == null) {
+        int newValue = nextValue++;
+        trusted[key] = newValue;
+        candidate.put(newValue);
+      }
+    }
+  }
+}
diff --git a/pkg/kernel/test/verify_bench.dart b/pkg/kernel/test/verify_bench.dart
new file mode 100644
index 0000000..17fd65d
--- /dev/null
+++ b/pkg/kernel/test/verify_bench.dart
@@ -0,0 +1,36 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:kernel/kernel.dart';
+import 'package:kernel/verifier.dart';
+
+final String usage = '''
+Usage: verify_bench FILE.dill
+
+Measures the time it takes to run kernel verifier on the given program.
+''';
+
+main(List<String> args) {
+  if (args.length != 1) {
+    print(usage);
+    exit(1);
+  }
+  var program = loadProgramFromBinary(args[0]);
+  var watch = new Stopwatch()..start();
+  verifyProgram(program);
+  print('Cold: ${watch.elapsedMilliseconds} ms');
+  const int warmUpTrials = 20;
+  for (int i = 0; i < warmUpTrials; ++i) {
+    verifyProgram(program);
+  }
+  watch.reset();
+  const int numberOfTrials = 100;
+  for (int i = 0; i < numberOfTrials; ++i) {
+    verifyProgram(program);
+  }
+  double millisecondsPerRun = watch.elapsedMilliseconds / numberOfTrials;
+  print('Hot:  $millisecondsPerRun ms');
+}
diff --git a/pkg/kernel/test/verify_test.dart b/pkg/kernel/test/verify_test.dart
new file mode 100644
index 0000000..e9f03b9
--- /dev/null
+++ b/pkg/kernel/test/verify_test.dart
@@ -0,0 +1,197 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:kernel/ast.dart';
+import 'package:kernel/text/ast_to_text.dart';
+import 'package:kernel/verifier.dart';
+import 'package:test/test.dart';
+
+/// Checks that the verifier correctly find errors in invalid programs.
+///
+/// The frontend should never generate invalid programs, so we have to test
+/// these by manually constructing invalid ASTs.
+///
+/// We mostly test negative cases here, as we get plenty of positive cases by
+/// compiling the Dart test suite with the verifier enabled.
+main() {
+  positiveTest('Test harness has no errors', () {
+    return new NullLiteral();
+  });
+  negativeTest('VariableGet out of scope', () {
+    return new VariableGet(makeVariable());
+  });
+  negativeTest('VariableSet out of scope', () {
+    return new VariableSet(makeVariable(), new NullLiteral());
+  });
+  negativeTest('Variable block scope', () {
+    VariableDeclaration variable = makeVariable();
+    return new Block([
+      new Block([variable]),
+      new ReturnStatement(new VariableGet(variable))
+    ]);
+  });
+  negativeTest('Variable let scope', () {
+    VariableDeclaration variable = makeVariable();
+    return new LogicalExpression(new Let(variable, new VariableGet(variable)),
+        '&&', new VariableGet(variable));
+  });
+  negativeTest('Variable redeclared', () {
+    VariableDeclaration variable = makeVariable();
+    return new Block([variable, variable]);
+  });
+  negativeTest('Member redeclared', () {
+    Field field = new Field(new Name('field'), initializer: new NullLiteral());
+    return new Class(
+        name: 'Test',
+        supertype: objectClass.asRawSupertype,
+        fields: [field, field]);
+  });
+  negativeTest('Class redeclared', () {
+    return otherClass; // Test harness also adds otherClass to program.
+  });
+  negativeTest('Class type parameter redeclared', () {
+    var parameter = makeTypeParameter();
+    return new Class(
+        name: 'Test',
+        supertype: objectClass.asRawSupertype,
+        typeParameters: [parameter, parameter]);
+  });
+  negativeTest('Member type parameter redeclared', () {
+    var parameter = makeTypeParameter();
+    return new Procedure(
+        new Name('test'),
+        ProcedureKind.Method,
+        new FunctionNode(new ReturnStatement(new NullLiteral()),
+            typeParameters: [parameter, parameter]));
+  });
+  negativeTest('Type parameter out of scope', () {
+    var parameter = makeTypeParameter();
+    return new ListLiteral([], typeArgument: new TypeParameterType(parameter));
+  });
+  negativeTest('Class type parameter from another class', () {
+    return new TypeLiteral(new TypeParameterType(otherClass.typeParameters[0]));
+  });
+  negativeTest('Class type parameter in static method', () {
+    return new Procedure(
+        new Name('test'),
+        ProcedureKind.Method,
+        new FunctionNode(new ReturnStatement(
+            new TypeLiteral(new TypeParameterType(classTypeParameter)))),
+        isStatic: true);
+  });
+  negativeTest('Class type parameter in static field', () {
+    return new Field(new Name('field'),
+        initializer: new TypeLiteral(new TypeParameterType(classTypeParameter)),
+        isStatic: true);
+  });
+  negativeTest('Method type parameter out of scope', () {
+    var parameter = makeTypeParameter();
+    return new Class(
+        name: 'Test',
+        supertype: objectClass.asRawSupertype,
+        procedures: [
+          new Procedure(
+              new Name('generic'),
+              ProcedureKind.Method,
+              new FunctionNode(new EmptyStatement(),
+                  typeParameters: [parameter])),
+          new Procedure(
+              new Name('use'),
+              ProcedureKind.Method,
+              new FunctionNode(new ReturnStatement(
+                  new TypeLiteral(new TypeParameterType(parameter)))))
+        ]);
+  });
+  negativeTest('Interface type arity too low', () {
+    return new TypeLiteral(new InterfaceType(otherClass, []));
+  });
+  negativeTest('Interface type arity too high', () {
+    return new TypeLiteral(
+        new InterfaceType(otherClass, [new DynamicType(), new DynamicType()]));
+  });
+  negativeTest('Dangling interface type', () {
+    return new TypeLiteral(new InterfaceType(new Class()));
+  });
+  negativeTest('Dangling field get', () {
+    return new DirectPropertyGet(new NullLiteral(), new Field(new Name('foo')));
+  });
+  negativeTest('Missing block parent pointer', () {
+    var block = new Block([]);
+    block.statements.add(new ReturnStatement());
+    return block;
+  });
+  negativeTest('Missing function parent pointer', () {
+    var procedure = new Procedure(new Name('test'), ProcedureKind.Method, null);
+    procedure.function = new FunctionNode(new EmptyStatement());
+    return procedure;
+  });
+}
+
+checkHasError(Program program) {
+  bool passed = false;
+  try {
+    verifyProgram(program);
+    passed = true;
+  } catch (e) {}
+  if (passed) {
+    fail('Failed to reject invalid program:\n${programToString(program)}');
+  }
+}
+
+Class objectClass = new Class(name: 'Object');
+
+Library stubLibrary = new Library(Uri.parse('dart:core'))
+  ..addClass(objectClass);
+
+TypeParameter classTypeParameter = makeTypeParameter('T');
+
+Class otherClass = new Class(
+    name: 'OtherClass',
+    typeParameters: [makeTypeParameter('OtherT')],
+    supertype: objectClass.asRawSupertype);
+
+Program makeProgram(TreeNode makeBody()) {
+  var node = makeBody();
+  if (node is Expression) {
+    node = new ReturnStatement(node);
+  }
+  if (node is Statement) {
+    node = new FunctionNode(node);
+  }
+  if (node is FunctionNode) {
+    node = new Procedure(new Name('test'), ProcedureKind.Method, node);
+  }
+  if (node is Member) {
+    node = new Class(
+        name: 'Test',
+        typeParameters: [classTypeParameter],
+        supertype: objectClass.asRawSupertype)..addMember(node);
+  }
+  if (node is Class) {
+    node =
+        new Library(Uri.parse('test.dart'), classes: <Class>[node, otherClass]);
+  }
+  if (node is Library) {
+    node = new Program(<Library>[node, stubLibrary]);
+  }
+  assert(node is Program);
+  return node;
+}
+
+negativeTest(String name, TreeNode makeBody()) {
+  test(name, () {
+    checkHasError(makeProgram(makeBody));
+  });
+}
+
+positiveTest(String name, TreeNode makeBody()) {
+  test(name, () {
+    verifyProgram(makeProgram(makeBody));
+  });
+}
+
+VariableDeclaration makeVariable() => new VariableDeclaration(null);
+
+TypeParameter makeTypeParameter([String name]) {
+  return new TypeParameter(name, new InterfaceType(objectClass));
+}
diff --git a/pkg/kernel/testcases/.gitignore b/pkg/kernel/testcases/.gitignore
new file mode 100644
index 0000000..8958632
--- /dev/null
+++ b/pkg/kernel/testcases/.gitignore
@@ -0,0 +1 @@
+*.current.txt
diff --git a/pkg/kernel/testcases/input/DeltaBlue.dart b/pkg/kernel/testcases/input/DeltaBlue.dart
new file mode 100644
index 0000000..cb606f8
--- /dev/null
+++ b/pkg/kernel/testcases/input/DeltaBlue.dart
@@ -0,0 +1,722 @@
+// Copyright 2011 Google Inc. All Rights Reserved.
+// Copyright 1996 John Maloney and Mario Wolczko
+//
+// This file is part of GNU Smalltalk.
+//
+// GNU Smalltalk is free software; you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2, or (at your option) any later version.
+//
+// GNU Smalltalk is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+// FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General Public License along with
+// GNU Smalltalk; see the file COPYING.  If not, write to the Free Software
+// Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+// Translated first from Smalltalk to JavaScript, and finally to
+// Dart by Google 2008-2010.
+
+/**
+ * A Dart implementation of the DeltaBlue constraint-solving
+ * algorithm, as described in:
+ *
+ * "The DeltaBlue Algorithm: An Incremental Constraint Hierarchy Solver"
+ *   Bjorn N. Freeman-Benson and John Maloney
+ *   January 1990 Communications of the ACM,
+ *   also available as University of Washington TR 89-08-06.
+ *
+ * Beware: this benchmark is written in a grotesque style where
+ * the constraint model is built by side-effects from constructors.
+ * I've kept it this way to avoid deviating too much from the original
+ * implementation.
+ */
+
+main() {
+  new DeltaBlue().run();
+}
+
+/// Benchmark class required to report results.
+class DeltaBlue {
+  void run() {
+    chainTest(100);
+    projectionTest(100);
+  }
+}
+
+
+/**
+ * Strengths are used to measure the relative importance of constraints.
+ * New strengths may be inserted in the strength hierarchy without
+ * disrupting current constraints.  Strengths cannot be created outside
+ * this class, so == can be used for value comparison.
+ */
+class Strength {
+
+  final int value;
+  final String name;
+
+  const Strength(this.value, this.name);
+
+  Strength nextWeaker() =>
+     const <Strength>[STRONG_PREFERRED, PREFERRED, STRONG_DEFAULT, NORMAL,
+                      WEAK_DEFAULT, WEAKEST][value];
+
+  static bool stronger(Strength s1, Strength s2) {
+    return s1.value < s2.value;
+  }
+
+  static bool weaker(Strength s1, Strength s2) {
+    return s1.value > s2.value;
+  }
+
+  static Strength weakest(Strength s1, Strength s2) {
+    return weaker(s1, s2) ? s1 : s2;
+  }
+
+  static Strength strongest(Strength s1, Strength s2) {
+    return stronger(s1, s2) ? s1 : s2;
+  }
+}
+
+
+// Compile time computed constants.
+const REQUIRED         = const Strength(0, "required");
+const STRONG_PREFERRED = const Strength(1, "strongPreferred");
+const PREFERRED        = const Strength(2, "preferred");
+const STRONG_DEFAULT   = const Strength(3, "strongDefault");
+const NORMAL           = const Strength(4, "normal");
+const WEAK_DEFAULT     = const Strength(5, "weakDefault");
+const WEAKEST          = const Strength(6, "weakest");
+
+
+abstract class Constraint {
+
+  final Strength strength;
+
+  const Constraint(this.strength);
+
+  bool isSatisfied();
+  void markUnsatisfied();
+  void addToGraph();
+  void removeFromGraph();
+  void chooseMethod(int mark);
+  void markInputs(int mark);
+  bool inputsKnown(int mark);
+  Variable output();
+  void execute();
+  void recalculate();
+
+  /// Activate this constraint and attempt to satisfy it.
+  void addConstraint() {
+    addToGraph();
+    planner.incrementalAdd(this);
+  }
+
+  /**
+   * Attempt to find a way to enforce this constraint. If successful,
+   * record the solution, perhaps modifying the current dataflow
+   * graph. Answer the constraint that this constraint overrides, if
+   * there is one, or nil, if there isn't.
+   * Assume: I am not already satisfied.
+   */
+  Constraint satisfy(mark) {
+    chooseMethod(mark);
+    if (!isSatisfied()) {
+      if (strength == REQUIRED) {
+        print("Could not satisfy a required constraint!");
+      }
+      return null;
+    }
+    markInputs(mark);
+    Variable out = output();
+    Constraint overridden = out.determinedBy;
+    if (overridden != null) overridden.markUnsatisfied();
+    out.determinedBy = this;
+    if (!planner.addPropagate(this, mark)) print("Cycle encountered");
+    out.mark = mark;
+    return overridden;
+  }
+
+  void destroyConstraint() {
+    if (isSatisfied()) planner.incrementalRemove(this);
+    removeFromGraph();
+  }
+
+  /**
+   * Normal constraints are not input constraints.  An input constraint
+   * is one that depends on external state, such as the mouse, the
+   * keybord, a clock, or some arbitraty piece of imperative code.
+   */
+  bool isInput() => false;
+}
+
+/**
+ * Abstract superclass for constraints having a single possible output variable.
+ */
+abstract class UnaryConstraint extends Constraint {
+
+  final Variable myOutput;
+  bool satisfied = false;
+
+  UnaryConstraint(this.myOutput, Strength strength) : super(strength) {
+    addConstraint();
+  }
+
+  /// Adds this constraint to the constraint graph
+  void addToGraph() {
+    myOutput.addConstraint(this);
+    satisfied = false;
+  }
+
+  /// Decides if this constraint can be satisfied and records that decision.
+  void chooseMethod(int mark) {
+    satisfied = (myOutput.mark != mark)
+      && Strength.stronger(strength, myOutput.walkStrength);
+  }
+
+  /// Returns true if this constraint is satisfied in the current solution.
+  bool isSatisfied() => satisfied;
+
+  void markInputs(int mark) {
+    // has no inputs.
+  }
+
+  /// Returns the current output variable.
+  Variable output() => myOutput;
+
+  /**
+   * Calculate the walkabout strength, the stay flag, and, if it is
+   * 'stay', the value for the current output of this constraint. Assume
+   * this constraint is satisfied.
+   */
+  void recalculate() {
+    myOutput.walkStrength = strength;
+    myOutput.stay = !isInput();
+    if (myOutput.stay) execute(); // Stay optimization.
+  }
+
+  /// Records that this constraint is unsatisfied.
+  void markUnsatisfied() {
+    satisfied = false;
+  }
+
+  bool inputsKnown(int mark) => true;
+
+  void removeFromGraph() {
+    if (myOutput != null) myOutput.removeConstraint(this);
+    satisfied = false;
+  }
+}
+
+
+/**
+ * Variables that should, with some level of preference, stay the same.
+ * Planners may exploit the fact that instances, if satisfied, will not
+ * change their output during plan execution.  This is called "stay
+ * optimization".
+ */
+class StayConstraint extends UnaryConstraint {
+
+  StayConstraint(Variable v, Strength str) : super(v, str);
+
+  void execute() {
+    // Stay constraints do nothing.
+  }
+}
+
+
+/**
+ * A unary input constraint used to mark a variable that the client
+ * wishes to change.
+ */
+class EditConstraint extends UnaryConstraint {
+
+  EditConstraint(Variable v, Strength str) : super(v, str);
+
+  /// Edits indicate that a variable is to be changed by imperative code.
+  bool isInput() => true;
+
+  void execute() {
+    // Edit constraints do nothing.
+  }
+}
+
+
+// Directions.
+const int NONE = 1;
+const int FORWARD = 2;
+const int BACKWARD = 0;
+
+
+/**
+ * Abstract superclass for constraints having two possible output
+ * variables.
+ */
+abstract class BinaryConstraint extends Constraint {
+
+  Variable v1;
+  Variable v2;
+  int direction = NONE;
+
+  BinaryConstraint(this.v1, this.v2, Strength strength) : super(strength) {
+    addConstraint();
+  }
+
+  /**
+   * Decides if this constraint can be satisfied and which way it
+   * should flow based on the relative strength of the variables related,
+   * and record that decision.
+   */
+  void chooseMethod(int mark) {
+    if (v1.mark == mark) {
+      direction = (v2.mark != mark &&
+                   Strength.stronger(strength, v2.walkStrength))
+        ? FORWARD : NONE;
+    }
+    if (v2.mark == mark) {
+      direction = (v1.mark != mark &&
+                   Strength.stronger(strength, v1.walkStrength))
+        ? BACKWARD : NONE;
+    }
+    if (Strength.weaker(v1.walkStrength, v2.walkStrength)) {
+      direction = Strength.stronger(strength, v1.walkStrength)
+        ? BACKWARD : NONE;
+    } else {
+      direction = Strength.stronger(strength, v2.walkStrength)
+        ? FORWARD : BACKWARD;
+    }
+  }
+
+  /// Add this constraint to the constraint graph.
+  void addToGraph() {
+    v1.addConstraint(this);
+    v2.addConstraint(this);
+    direction = NONE;
+  }
+
+  /// Answer true if this constraint is satisfied in the current solution.
+  bool isSatisfied() => direction != NONE;
+
+  /// Mark the input variable with the given mark.
+  void markInputs(int mark) {
+    input().mark = mark;
+  }
+
+  /// Returns the current input variable
+  Variable input() => direction == FORWARD ? v1 : v2;
+
+  /// Returns the current output variable.
+  Variable output() => direction == FORWARD ? v2 : v1;
+
+  /**
+   * Calculate the walkabout strength, the stay flag, and, if it is
+   * 'stay', the value for the current output of this
+   * constraint. Assume this constraint is satisfied.
+   */
+  void recalculate() {
+    Variable ihn = input(), out = output();
+    out.walkStrength = Strength.weakest(strength, ihn.walkStrength);
+    out.stay = ihn.stay;
+    if (out.stay) execute();
+  }
+
+  /// Record the fact that this constraint is unsatisfied.
+  void markUnsatisfied() {
+    direction = NONE;
+  }
+
+  bool inputsKnown(int mark) {
+    Variable i = input();
+    return i.mark == mark || i.stay || i.determinedBy == null;
+  }
+
+  void removeFromGraph() {
+    if (v1 != null) v1.removeConstraint(this);
+    if (v2 != null) v2.removeConstraint(this);
+    direction = NONE;
+  }
+}
+
+
+/**
+ * Relates two variables by the linear scaling relationship: "v2 =
+ * (v1 * scale) + offset". Either v1 or v2 may be changed to maintain
+ * this relationship but the scale factor and offset are considered
+ * read-only.
+ */
+
+class ScaleConstraint extends BinaryConstraint {
+
+  final Variable scale;
+  final Variable offset;
+
+  ScaleConstraint(Variable src, this.scale, this.offset,
+                  Variable dest, Strength strength)
+    : super(src, dest, strength);
+
+  /// Adds this constraint to the constraint graph.
+  void addToGraph() {
+    super.addToGraph();
+    scale.addConstraint(this);
+    offset.addConstraint(this);
+  }
+
+  void removeFromGraph() {
+    super.removeFromGraph();
+    if (scale != null) scale.removeConstraint(this);
+    if (offset != null) offset.removeConstraint(this);
+  }
+
+  void markInputs(int mark) {
+    super.markInputs(mark);
+    scale.mark = offset.mark = mark;
+  }
+
+  /// Enforce this constraint. Assume that it is satisfied.
+  void execute() {
+    if (direction == FORWARD) {
+      v2.value = v1.value * scale.value + offset.value;
+    } else {
+      v1.value = (v2.value - offset.value) ~/ scale.value;
+    }
+  }
+
+  /**
+   * Calculate the walkabout strength, the stay flag, and, if it is
+   * 'stay', the value for the current output of this constraint. Assume
+   * this constraint is satisfied.
+   */
+  void recalculate() {
+    Variable ihn = input(), out = output();
+    out.walkStrength = Strength.weakest(strength, ihn.walkStrength);
+    out.stay = ihn.stay && scale.stay && offset.stay;
+    if (out.stay) execute();
+  }
+
+}
+
+
+/**
+ * Constrains two variables to have the same value.
+ */
+class EqualityConstraint extends BinaryConstraint {
+
+  EqualityConstraint(Variable v1, Variable v2, Strength strength)
+    : super(v1, v2, strength);
+
+  /// Enforce this constraint. Assume that it is satisfied.
+  void execute() {
+    output().value = input().value;
+  }
+}
+
+
+/**
+ * A constrained variable. In addition to its value, it maintain the
+ * structure of the constraint graph, the current dataflow graph, and
+ * various parameters of interest to the DeltaBlue incremental
+ * constraint solver.
+ **/
+class Variable {
+
+  List<Constraint> constraints = <Constraint>[];
+  Constraint determinedBy;
+  int mark = 0;
+  Strength walkStrength = WEAKEST;
+  bool stay = true;
+  int value;
+  final String name;
+
+  Variable(this.name, this.value);
+
+  /**
+   * Add the given constraint to the set of all constraints that refer
+   * this variable.
+   */
+  void addConstraint(Constraint c) {
+    constraints.add(c);
+  }
+
+  /// Removes all traces of c from this variable.
+  void removeConstraint(Constraint c) {
+    constraints.remove(c);
+    if (determinedBy == c) determinedBy = null;
+  }
+}
+
+
+class Planner {
+
+  int currentMark = 0;
+
+  /**
+   * Attempt to satisfy the given constraint and, if successful,
+   * incrementally update the dataflow graph.  Details: If satifying
+   * the constraint is successful, it may override a weaker constraint
+   * on its output. The algorithm attempts to resatisfy that
+   * constraint using some other method. This process is repeated
+   * until either a) it reaches a variable that was not previously
+   * determined by any constraint or b) it reaches a constraint that
+   * is too weak to be satisfied using any of its methods. The
+   * variables of constraints that have been processed are marked with
+   * a unique mark value so that we know where we've been. This allows
+   * the algorithm to avoid getting into an infinite loop even if the
+   * constraint graph has an inadvertent cycle.
+   */
+  void incrementalAdd(Constraint c) {
+    int mark = newMark();
+    for(Constraint overridden = c.satisfy(mark);
+        overridden != null;
+        overridden = overridden.satisfy(mark));
+  }
+
+  /**
+   * Entry point for retracting a constraint. Remove the given
+   * constraint and incrementally update the dataflow graph.
+   * Details: Retracting the given constraint may allow some currently
+   * unsatisfiable downstream constraint to be satisfied. We therefore collect
+   * a list of unsatisfied downstream constraints and attempt to
+   * satisfy each one in turn. This list is traversed by constraint
+   * strength, strongest first, as a heuristic for avoiding
+   * unnecessarily adding and then overriding weak constraints.
+   * Assume: [c] is satisfied.
+   */
+  void incrementalRemove(Constraint c) {
+    Variable out = c.output();
+    c.markUnsatisfied();
+    c.removeFromGraph();
+    List<Constraint> unsatisfied = removePropagateFrom(out);
+    Strength strength = REQUIRED;
+    do {
+      for (int i = 0; i < unsatisfied.length; i++) {
+        Constraint u = unsatisfied[i];
+        if (u.strength == strength) incrementalAdd(u);
+      }
+      strength = strength.nextWeaker();
+    } while (strength != WEAKEST);
+  }
+
+  /// Select a previously unused mark value.
+  int newMark() => ++currentMark;
+
+  /**
+   * Extract a plan for resatisfaction starting from the given source
+   * constraints, usually a set of input constraints. This method
+   * assumes that stay optimization is desired; the plan will contain
+   * only constraints whose output variables are not stay. Constraints
+   * that do no computation, such as stay and edit constraints, are
+   * not included in the plan.
+   * Details: The outputs of a constraint are marked when it is added
+   * to the plan under construction. A constraint may be appended to
+   * the plan when all its input variables are known. A variable is
+   * known if either a) the variable is marked (indicating that has
+   * been computed by a constraint appearing earlier in the plan), b)
+   * the variable is 'stay' (i.e. it is a constant at plan execution
+   * time), or c) the variable is not determined by any
+   * constraint. The last provision is for past states of history
+   * variables, which are not stay but which are also not computed by
+   * any constraint.
+   * Assume: [sources] are all satisfied.
+   */
+  Plan makePlan(List<Constraint> sources) {
+    int mark = newMark();
+    Plan plan = new Plan();
+    List<Constraint> todo = sources;
+    while (todo.length > 0) {
+      Constraint c = todo.removeLast();
+      if (c.output().mark != mark && c.inputsKnown(mark)) {
+        plan.addConstraint(c);
+        c.output().mark = mark;
+        addConstraintsConsumingTo(c.output(), todo);
+      }
+    }
+    return plan;
+  }
+
+  /**
+   * Extract a plan for resatisfying starting from the output of the
+   * given [constraints], usually a set of input constraints.
+   */
+  Plan extractPlanFromConstraints(List<Constraint> constraints) {
+    List<Constraint> sources = <Constraint>[];
+    for (int i = 0; i < constraints.length; i++) {
+      Constraint c = constraints[i];
+      // if not in plan already and eligible for inclusion.
+      if (c.isInput() && c.isSatisfied()) sources.add(c);
+    }
+    return makePlan(sources);
+  }
+
+  /**
+   * Recompute the walkabout strengths and stay flags of all variables
+   * downstream of the given constraint and recompute the actual
+   * values of all variables whose stay flag is true. If a cycle is
+   * detected, remove the given constraint and answer
+   * false. Otherwise, answer true.
+   * Details: Cycles are detected when a marked variable is
+   * encountered downstream of the given constraint. The sender is
+   * assumed to have marked the inputs of the given constraint with
+   * the given mark. Thus, encountering a marked node downstream of
+   * the output constraint means that there is a path from the
+   * constraint's output to one of its inputs.
+   */
+  bool addPropagate(Constraint c, int mark) {
+    List<Constraint> todo = <Constraint>[c];
+    while (todo.length > 0) {
+      Constraint d = todo.removeLast();
+      if (d.output().mark == mark) {
+        incrementalRemove(c);
+        return false;
+      }
+      d.recalculate();
+      addConstraintsConsumingTo(d.output(), todo);
+    }
+    return true;
+  }
+
+  /**
+   * Update the walkabout strengths and stay flags of all variables
+   * downstream of the given constraint. Answer a collection of
+   * unsatisfied constraints sorted in order of decreasing strength.
+   */
+  List<Constraint> removePropagateFrom(Variable out) {
+    out.determinedBy = null;
+    out.walkStrength = WEAKEST;
+    out.stay = true;
+    List<Constraint> unsatisfied = <Constraint>[];
+    List<Variable> todo = <Variable>[out];
+    while (todo.length > 0) {
+      Variable v = todo.removeLast();
+      for (int i = 0; i < v.constraints.length; i++) {
+        Constraint c = v.constraints[i];
+        if (!c.isSatisfied()) unsatisfied.add(c);
+      }
+      Constraint determining = v.determinedBy;
+      for (int i = 0; i < v.constraints.length; i++) {
+        Constraint next = v.constraints[i];
+        if (next != determining && next.isSatisfied()) {
+          next.recalculate();
+          todo.add(next.output());
+        }
+      }
+    }
+    return unsatisfied;
+  }
+
+  void addConstraintsConsumingTo(Variable v, List<Constraint> coll) {
+    Constraint determining = v.determinedBy;
+    for (int i = 0; i < v.constraints.length; i++) {
+      Constraint c = v.constraints[i];
+      if (c != determining && c.isSatisfied()) coll.add(c);
+    }
+  }
+}
+
+
+/**
+ * A Plan is an ordered list of constraints to be executed in sequence
+ * to resatisfy all currently satisfiable constraints in the face of
+ * one or more changing inputs.
+ */
+class Plan {
+  List<Constraint> list = <Constraint>[];
+
+  void addConstraint(Constraint c) {
+    list.add(c);
+  }
+
+  int size() => list.length;
+
+  void execute() {
+    for (int i = 0; i < list.length; i++) {
+      list[i].execute();
+    }
+  }
+}
+
+
+/**
+ * This is the standard DeltaBlue benchmark. A long chain of equality
+ * constraints is constructed with a stay constraint on one end. An
+ * edit constraint is then added to the opposite end and the time is
+ * measured for adding and removing this constraint, and extracting
+ * and executing a constraint satisfaction plan. There are two cases.
+ * In case 1, the added constraint is stronger than the stay
+ * constraint and values must propagate down the entire length of the
+ * chain. In case 2, the added constraint is weaker than the stay
+ * constraint so it cannot be accomodated. The cost in this case is,
+ * of course, very low. Typical situations lie somewhere between these
+ * two extremes.
+ */
+void chainTest(int n) {
+  planner = new Planner();
+  Variable prev = null, first = null, last = null;
+  // Build chain of n equality constraints.
+  for (int i = 0; i <= n; i++) {
+    Variable v = new Variable("v$i", 0);
+    if (prev != null) new EqualityConstraint(prev, v, REQUIRED);
+    if (i == 0) first = v;
+    if (i == n) last = v;
+    prev = v;
+  }
+  new StayConstraint(last, STRONG_DEFAULT);
+  EditConstraint edit = new EditConstraint(first, PREFERRED);
+  Plan plan = planner.extractPlanFromConstraints(<Constraint>[edit]);
+  for (int i = 0; i < 100; i++) {
+    first.value = i;
+    plan.execute();
+    if (last.value != i) {
+      print("Chain test failed:");
+      print("Expected last value to be $i but it was ${last.value}.");
+    }
+  }
+}
+
+/**
+ * This test constructs a two sets of variables related to each
+ * other by a simple linear transformation (scale and offset). The
+ * time is measured to change a variable on either side of the
+ * mapping and to change the scale and offset factors.
+ */
+void projectionTest(int n) {
+  planner = new Planner();
+  Variable scale = new Variable("scale", 10);
+  Variable offset = new Variable("offset", 1000);
+  Variable src = null, dst = null;
+
+  List<Variable> dests = <Variable>[];
+  for (int i = 0; i < n; i++) {
+    src = new Variable("src", i);
+    dst = new Variable("dst", i);
+    dests.add(dst);
+    new StayConstraint(src, NORMAL);
+    new ScaleConstraint(src, scale, offset, dst, REQUIRED);
+  }
+  change(src, 17);
+  if (dst.value != 1170) print("Projection 1 failed");
+  change(dst, 1050);
+  if (src.value != 5) print("Projection 2 failed");
+  change(scale, 5);
+  for (int i = 0; i < n - 1; i++) {
+    if (dests[i].value != i * 5 + 1000) print("Projection 3 failed");
+  }
+  change(offset, 2000);
+  for (int i = 0; i < n - 1; i++) {
+    if (dests[i].value != i * 5 + 2000) print("Projection 4 failed");
+  }
+}
+
+void change(Variable v, int newValue) {
+  EditConstraint edit = new EditConstraint(v, PREFERRED);
+  Plan plan = planner.extractPlanFromConstraints(<EditConstraint>[edit]);
+  for (int i = 0; i < 10; i++) {
+    v.value = newValue;
+    plan.execute();
+  }
+  edit.destroyConstraint();
+}
+
+Planner planner;
diff --git a/pkg/kernel/testcases/input/argument.dart b/pkg/kernel/testcases/input/argument.dart
new file mode 100644
index 0000000..5052721
--- /dev/null
+++ b/pkg/kernel/testcases/input/argument.dart
@@ -0,0 +1,32 @@
+abstract class Base {}
+
+class Foo extends Base {}
+class Bar extends Base {}
+class Baz extends Base {}
+
+void foo(x) {
+
+}
+
+void bar(x) {
+
+}
+
+void foo_escaped(x) {
+
+}
+
+void bar_escaped(x) {
+
+}
+
+void escape(fn) {
+  fn(new Baz());
+}
+
+main() {
+  foo(new Foo());
+  bar(new Bar());
+  escape(foo_escaped);
+  escape(bar_escaped);
+}
diff --git a/pkg/kernel/testcases/input/arithmetic.dart b/pkg/kernel/testcases/input/arithmetic.dart
new file mode 100644
index 0000000..91b5c0a
--- /dev/null
+++ b/pkg/kernel/testcases/input/arithmetic.dart
@@ -0,0 +1,18 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+int foo(int x, int y) {
+  var z = x + y;
+  return z << 4;
+}
+
+void loop(List xs) {
+  int _ = xs.length;
+  for (int i = 0; i < xs.length; i++) {}
+}
+
+main() {
+  foo(4, 5);
+  foo(6, 7);
+  loop(['dfg']);
+}
diff --git a/pkg/kernel/testcases/input/async_function.dart b/pkg/kernel/testcases/input/async_function.dart
new file mode 100644
index 0000000..7b3001e
--- /dev/null
+++ b/pkg/kernel/testcases/input/async_function.dart
@@ -0,0 +1,38 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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';
+
+Future<String> asyncString() async {
+  return "foo";
+}
+
+Future<String> asyncString2() async {
+  return asyncString();
+}
+
+Iterable<String> syncStarString() sync* {
+  yield "foo";
+  yield* syncStarString2();
+  yield* stringList;
+}
+
+Iterable<String> syncStarString2() sync* {
+  yield "foo";
+}
+
+Stream<String> asyncStarString() async* {
+  yield "foo";
+  yield* asyncStarString2();
+  yield await asyncString();
+}
+
+Stream<String> asyncStarString2() async* {
+  yield "bar";
+}
+
+List<String> stringList = ["bar"];
+
+main() async {
+  String str = await asyncString();
+}
diff --git a/pkg/kernel/testcases/input/bad_store.dart b/pkg/kernel/testcases/input/bad_store.dart
new file mode 100644
index 0000000..98c7095
--- /dev/null
+++ b/pkg/kernel/testcases/input/bad_store.dart
@@ -0,0 +1,19 @@
+class Foo {
+  var field;
+}
+
+dynamic identity(x) => x;
+
+void use(x) {}
+
+main(List<String> args) {
+  dynamic foo = identity(new Foo());
+  if (args.length > 1) {
+    foo.field = "string";
+    var first = foo.field;
+    use(first);
+    foo.noField = "string";
+    var second = foo.noField;
+    use(second);
+  }
+}
diff --git a/pkg/kernel/testcases/input/call.dart b/pkg/kernel/testcases/input/call.dart
new file mode 100644
index 0000000..15ddb85
--- /dev/null
+++ b/pkg/kernel/testcases/input/call.dart
@@ -0,0 +1,44 @@
+class Callable {
+  call(x) {
+    return "string";
+  }
+}
+
+class CallableGetter {
+  get call => new Callable();
+}
+
+main() {
+  var closure = (x) => x;
+  var int1 = closure(1);
+  var int2 = closure.call(1);
+  var int3 = closure.call.call(1);
+  var int4 = closure.call.call.call(1);
+
+  var callable = new Callable();
+  var string1 = callable(1);
+  var string2 = callable.call(1);
+  var string3 = callable.call.call(1);
+  var string4 = callable.call.call.call(1);
+
+  var callableGetter = new CallableGetter();
+  var string5 = callableGetter(1);
+  var string6 = callableGetter.call(1);
+  var string7 = callableGetter.call.call(1);
+  var string8 = callableGetter.call.call.call(1);
+
+  var nothing1 = closure();
+  var nothing2 = closure.call();
+  var nothing3 = closure.call.call();
+  var nothing4 = closure.call.call.call();
+
+  var nothing5 = callable();
+  var nothing6 = callable.call();
+  var nothing7 = callable.call.call();
+  var nothing8 = callable.call.call.call();
+
+  var nothing9  = callableGetter();
+  var nothing10 = callableGetter.call();
+  var nothing11 = callableGetter.call.call();
+  var nothing12 = callableGetter.call.call.call();
+}
diff --git a/pkg/kernel/testcases/input/closure.dart b/pkg/kernel/testcases/input/closure.dart
new file mode 100644
index 0000000..dbabb52
--- /dev/null
+++ b/pkg/kernel/testcases/input/closure.dart
@@ -0,0 +1,19 @@
+class Foo {
+  var _field = new Bar();
+}
+
+class Bar {}
+
+useCallback(callback) {
+  var _ = callback();
+}
+
+main() {
+  var x;
+  inner() {
+    x = new Foo();
+    return new Foo();
+  }
+  useCallback(inner);
+  var _ = inner()._field;
+}
diff --git a/pkg/kernel/testcases/input/escape.dart b/pkg/kernel/testcases/input/escape.dart
new file mode 100644
index 0000000..7dbc54e
--- /dev/null
+++ b/pkg/kernel/testcases/input/escape.dart
@@ -0,0 +1,42 @@
+class A {
+  var field;
+}
+class B {
+  var field;
+}
+class C {
+  operator==(x) => false;
+}
+
+class X implements A, B {
+  var field;
+}
+
+void useAsA(A object) {
+  var _ = object.field;
+}
+
+void useAsB(B object) {
+  var _ = object.field;
+  escape(object);
+}
+
+void escape(x) {
+  x ??= "";
+  x ??= 45;
+  if (x is! int && x is! String) {
+    x.field = 45;
+  }
+}
+
+main() {
+  // escape("");
+  // escape(45);
+
+  var object = new X();
+  useAsA(new A());
+  useAsA(object);
+
+  useAsB(new B());
+  useAsB(object);
+}
diff --git a/pkg/kernel/testcases/input/external.dart b/pkg/kernel/testcases/input/external.dart
new file mode 100644
index 0000000..54ce8a7
--- /dev/null
+++ b/pkg/kernel/testcases/input/external.dart
@@ -0,0 +1,18 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+import 'dart:isolate';
+
+var subscription;
+
+void onData(x) {
+  print(x);
+  subscription.cancel();
+}
+
+main() {
+  var string = new String.fromCharCode(65); // External string factory.
+  var port = new ReceivePort(); // External factory.
+  subscription = port.listen(onData); // Dynamic call on external instance.
+  port.sendPort.send(string);
+}
diff --git a/pkg/kernel/testcases/input/fallthrough.dart b/pkg/kernel/testcases/input/fallthrough.dart
new file mode 100644
index 0000000..7aab1e3
--- /dev/null
+++ b/pkg/kernel/testcases/input/fallthrough.dart
@@ -0,0 +1,17 @@
+void main(List<String> args) {
+  var x = args.length;
+  switch (x) {
+    case 3:
+      x = 4;
+    case 5:
+      break;
+    case 6:
+    case 7:
+      if (args[0] == '') {
+        break;
+      } else {
+        return;
+      }
+    case 4:
+  }
+}
diff --git a/pkg/kernel/testcases/input/micro.dart b/pkg/kernel/testcases/input/micro.dart
new file mode 100644
index 0000000..51ae34b
--- /dev/null
+++ b/pkg/kernel/testcases/input/micro.dart
@@ -0,0 +1,75 @@
+staticMethod() {
+  return "sdfg";
+}
+
+class Foo {
+  instanceMethod() {
+    return 123;
+  }
+}
+
+external bool externalStatic();
+
+abstract class ExternalValue {}
+
+abstract class Bar {
+  ExternalValue externalInstanceMethod();
+}
+
+external Bar createBar();
+
+class Box {
+  var field;
+}
+
+stringArgument(x) {
+}
+
+intArgument(x) {
+}
+
+class FinalBox {
+  final finalField;
+  FinalBox(this.finalField);
+}
+
+class SubFinalBox extends FinalBox {
+  SubFinalBox(value) : super(value);
+}
+
+class DynamicReceiver1 {
+  dynamicallyCalled(x) {}
+}
+class DynamicReceiver2 {
+  dynamicallyCalled(x) {}
+}
+
+void makeDynamicCall(receiver) {
+  receiver.dynamicallyCalled("sdfg");
+}
+
+main() {
+  var x = staticMethod();
+  var y = new Foo().instanceMethod();
+  var z = externalStatic();
+  var w = createBar().externalInstanceMethod();
+
+  stringArgument("sdfg");
+  intArgument(42);
+
+  var box = new Box();
+  box.field = "sdfg";
+  var a = box.field;
+
+  var finalBox = new FinalBox("dfg");
+  var b = finalBox.finalField;
+
+  var subBox = new SubFinalBox("dfg");
+  var c = subBox.finalField;
+
+  makeDynamicCall(new DynamicReceiver1());
+  makeDynamicCall(new DynamicReceiver2());
+
+  var list = ["string"];
+  var d = list[0];
+}
diff --git a/pkg/kernel/testcases/input/named_parameters.dart b/pkg/kernel/testcases/input/named_parameters.dart
new file mode 100644
index 0000000..edf1f1d
--- /dev/null
+++ b/pkg/kernel/testcases/input/named_parameters.dart
@@ -0,0 +1,29 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 Superclass {
+  foo({alpha, beta}) {}
+  bar({beta, alpha}) {}
+
+  namedCallback(callback({String alpha, int beta})) {
+    callback(alpha: 'one', beta: 2);
+    callback(beta: 1, alpha: 'two');
+  }
+}
+
+class Subclass extends Superclass {
+  foo({beta, alpha}) {}
+  bar({alpha, beta}) {}
+
+  namedCallback(callback({int beta, String alpha})) {}
+}
+
+topLevelNamed(beta, alpha, {gamma, delta}) {}
+topLevelOptional(beta, alpha, [gamma, delta]) {}
+
+main() {
+  new Subclass().foo(beta: 1, alpha: 2);
+  new Subclass().foo(alpha: 1, beta: 2);
+  topLevelNamed(1, 2, gamma: 3, delta: 4);
+  topLevelNamed(1, 2, delta: 3, gamma: 4);
+}
diff --git a/pkg/kernel/testcases/input/null_aware.dart b/pkg/kernel/testcases/input/null_aware.dart
new file mode 100644
index 0000000..bb1e3e0
--- /dev/null
+++ b/pkg/kernel/testcases/input/null_aware.dart
@@ -0,0 +1,20 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 Foo {
+  int field;
+  static int staticField;
+}
+
+main() {
+  Foo foo = new Foo();
+  foo?.field = 5;
+  Foo?.staticField = 5;
+  foo.field ??= 5;
+  Foo.staticField ??= 5;
+  foo?.field ??= 5;
+  Foo?.staticField ??= 5;
+
+  int intValue = foo.field ?? 6;
+  num numValue = foo.field ?? 4.5;
+}
diff --git a/pkg/kernel/testcases/input/optional.dart b/pkg/kernel/testcases/input/optional.dart
new file mode 100644
index 0000000..cabd741
--- /dev/null
+++ b/pkg/kernel/testcases/input/optional.dart
@@ -0,0 +1,48 @@
+class Foo {
+  method(x, [y, z]) {
+    return "string";
+  }
+}
+
+abstract class External {
+  String externalMethod(int x, [int y, int z]);
+  void listen(Listener listener);
+}
+external External createExternal();
+
+abstract class Listener {
+  void event(String input, [int x, int y]);
+}
+
+class TestListener extends Listener {
+  void event(input, [x, y]) {}
+}
+
+class ExtendedListener extends Listener {
+  void event(input, [x, y, z]) {}
+}
+
+class InvalidListener {
+  void event(input, [x]) {}
+}
+
+main() {
+  var foo = new Foo();
+  var string1 = foo.method(1);
+  var string2 = foo.method(1, 2);
+  var string3 = foo.method(1, 2, 3);
+
+  var extern = createExternal();
+  var string4 = extern.externalMethod(1);
+  var string5 = extern.externalMethod(1, 2);
+  var string6 = extern.externalMethod(1, 2, 3);
+
+  extern.listen(new TestListener());
+  extern.listen(new ExtendedListener());
+  extern.listen(new InvalidListener());
+
+  var nothing1 = foo.method();
+  var nothing2 = foo.method(1, 2, 3, 4);
+  var nothing3 = extern.externalMethod();
+  var nothing4 = extern.externalMethod(1, 2, 3, 4);
+}
diff --git a/pkg/kernel/testcases/input/override.dart b/pkg/kernel/testcases/input/override.dart
new file mode 100644
index 0000000..89e2b31
--- /dev/null
+++ b/pkg/kernel/testcases/input/override.dart
@@ -0,0 +1,20 @@
+class Foo {}
+class Bar extends Foo {}
+
+class Base {
+  Foo method() {
+    return new Foo();
+  }
+}
+
+class Sub extends Base {
+  Foo method() {
+    return new Bar();
+  }
+}
+
+main(List<String> args) {
+  var object = args.length == 0 ? new Base() : new Sub();
+  var a = object.method();
+  print(a);
+}
diff --git a/pkg/kernel/testcases/input/prefer_baseclass.dart b/pkg/kernel/testcases/input/prefer_baseclass.dart
new file mode 100644
index 0000000..67b93b6
--- /dev/null
+++ b/pkg/kernel/testcases/input/prefer_baseclass.dart
@@ -0,0 +1,26 @@
+class A {}
+class B {}
+
+class AB1 extends A implements B {}
+class AB2 extends A implements B {}
+
+class BA1 extends B implements A {}
+class BA2 extends B implements A {}
+
+takeSubclassOfA(obj) {
+  // The analysis should at least infer that 'obj' is a subclass of A,
+  // When the upper bound is ambiguous, it should use the common superclass, if
+  // there is one besides Object.
+}
+
+takeSubclassOfB(obj) {
+  // Likewise, the analysis should infer that 'obj' is a subclass of B.
+}
+
+main() {
+  takeSubclassOfA(new AB1());
+  takeSubclassOfA(new AB2());
+
+  takeSubclassOfB(new BA1());
+  takeSubclassOfB(new BA2());
+}
diff --git a/pkg/kernel/testcases/input/redirecting_factory.dart b/pkg/kernel/testcases/input/redirecting_factory.dart
new file mode 100644
index 0000000..cf7e91e
--- /dev/null
+++ b/pkg/kernel/testcases/input/redirecting_factory.dart
@@ -0,0 +1,47 @@
+abstract class FooBase<Tf> {
+	int get x;
+	factory FooBase(int x) = Foo<Tf>;
+}
+
+abstract class Foo<T> implements FooBase {
+	factory Foo(int x) = Bar<String,T>;
+}
+
+class Bar<Sb,Tb> implements Foo<Tb> {
+	int x;
+	Bar(this.x) {
+		print('Bar<$Sb,$Tb>');
+	}
+}
+
+class Builder<X> {
+	method() {
+		return new FooBase<X>(4);
+	}
+}
+
+class SimpleCase<A,B> {
+	factory SimpleCase() = SimpleCaseImpl<A,B>;
+}
+
+class SimpleCaseImpl<Ai,Bi> implements SimpleCase<Ai,Bi> {
+	factory SimpleCaseImpl() = SimpleCaseImpl2<Ai,Bi>;
+}
+
+class SimpleCaseImpl2<Ai2,Bi2> implements SimpleCaseImpl<Ai2,Bi2> {
+}
+
+class Base<M> {
+
+}
+class Mixin<M> {
+
+}
+
+class Mix<M> = Base<M> with Mixin<M>;
+
+main() {
+	print(new FooBase<double>(4).x);
+	new SimpleCase<int,double>();
+	new Mix<double>();
+}
diff --git a/pkg/kernel/testcases/input/static_setter.dart b/pkg/kernel/testcases/input/static_setter.dart
new file mode 100644
index 0000000..55e6b0a
--- /dev/null
+++ b/pkg/kernel/testcases/input/static_setter.dart
@@ -0,0 +1,9 @@
+class Foo {}
+
+set foo(x) {
+
+}
+
+main() {
+  foo = new Foo();
+}
diff --git a/pkg/kernel/testcases/input/store_load.dart b/pkg/kernel/testcases/input/store_load.dart
new file mode 100644
index 0000000..79243bf
--- /dev/null
+++ b/pkg/kernel/testcases/input/store_load.dart
@@ -0,0 +1,24 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 Foo {
+  var _field;
+}
+class FooValue {}
+
+class Bar {
+  var _field; // Same name.
+}
+class BarValue {}
+
+main() {
+  var foo = new Foo();
+  foo._field = new FooValue();
+  var fooValue = foo._field;
+  print(fooValue);
+
+  var bar = new Bar();
+  bar._field = new BarValue();
+  var barValue = bar._field;
+  print(barValue);
+}
diff --git a/pkg/kernel/testcases/input/stringliteral.dart b/pkg/kernel/testcases/input/stringliteral.dart
new file mode 100644
index 0000000..8e64de2
--- /dev/null
+++ b/pkg/kernel/testcases/input/stringliteral.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+var color = 'brown';
+var thing = 'lazy dog';
+var phrase = "The quick $color fox\njumped over the $thing.\n";
+var adjacent = '$color$color$color';
+var linebreaks = '$color\n$color\n$color';
+var other = '$color\n is \n$color';
+
+main() {}
diff --git a/pkg/kernel/testcases/input/uninitialized_fields.dart b/pkg/kernel/testcases/input/uninitialized_fields.dart
new file mode 100644
index 0000000..5ff04ff
--- /dev/null
+++ b/pkg/kernel/testcases/input/uninitialized_fields.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 Uninitialized {
+  int x;
+}
+class PartiallyInitialized {
+  int x;
+  PartiallyInitialized(this.x);
+  PartiallyInitialized.noInitializer();
+}
+class Initialized {
+  int x;
+  Initialized(this.x);
+}
+class Forwarding {
+  int x;
+  Forwarding.initialize(this.x);
+  Forwarding(int arg) : this.initialize(arg);
+}
+
+int uninitializedTopLevel;
+int initializedTopLevel = 4;
+
+main() {
+
+}
diff --git a/pkg/kernel/testcases/input/void-methods.dart b/pkg/kernel/testcases/input/void-methods.dart
new file mode 100644
index 0000000..36f4e72
--- /dev/null
+++ b/pkg/kernel/testcases/input/void-methods.dart
@@ -0,0 +1,12 @@
+class Foo {
+  List list = [1,2,3];
+  set first(x) => list[0] = x;
+  operator[]=(x,y) => list[x] = y;
+  void clear() => list.clear();
+}
+
+main() {
+  new Foo().first = 4;
+  new Foo()[3] = 4;
+  new Foo().clear();
+}
diff --git a/pkg/kernel/testcases/spec-mode/DeltaBlue.baseline.txt b/pkg/kernel/testcases/spec-mode/DeltaBlue.baseline.txt
new file mode 100644
index 0000000..edb8f83
--- /dev/null
+++ b/pkg/kernel/testcases/spec-mode/DeltaBlue.baseline.txt
@@ -0,0 +1,450 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class DeltaBlue extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method run() → void {
+    self::chainTest(100);
+    self::projectionTest(100);
+  }
+}
+class Strength extends core::Object {
+  final field core::int value;
+  final field core::String name;
+  const constructor •(core::int value, core::String name) → void
+    : self::Strength::value = value, self::Strength::name = name, super core::Object::•()
+    ;
+  method nextWeaker() → self::Strength
+    return const <self::Strength>[self::STRONG_PREFERRED, self::PREFERRED, self::STRONG_DEFAULT, self::NORMAL, self::WEAK_DEFAULT, self::WEAKEST].[](this.value);
+  static method stronger(self::Strength s1, self::Strength s2) → core::bool {
+    return s1.value.<(s2.value);
+  }
+  static method weaker(self::Strength s1, self::Strength s2) → core::bool {
+    return s1.value.>(s2.value);
+  }
+  static method weakest(self::Strength s1, self::Strength s2) → self::Strength {
+    return self::Strength::weaker(s1, s2) ? s1 : s2;
+  }
+  static method strongest(self::Strength s1, self::Strength s2) → self::Strength {
+    return self::Strength::stronger(s1, s2) ? s1 : s2;
+  }
+}
+abstract class Constraint extends core::Object {
+  final field self::Strength strength;
+  const constructor •(self::Strength strength) → void
+    : self::Constraint::strength = strength, super core::Object::•()
+    ;
+  abstract method isSatisfied() → core::bool;
+  abstract method markUnsatisfied() → void;
+  abstract method addToGraph() → void;
+  abstract method removeFromGraph() → void;
+  abstract method chooseMethod(core::int mark) → void;
+  abstract method markInputs(core::int mark) → void;
+  abstract method inputsKnown(core::int mark) → core::bool;
+  abstract method output() → self::Variable;
+  abstract method execute() → void;
+  abstract method recalculate() → void;
+  method addConstraint() → void {
+    this.addToGraph();
+    self::planner.incrementalAdd(this);
+  }
+  method satisfy(dynamic mark) → self::Constraint {
+    this.chooseMethod(mark);
+    if(!this.isSatisfied()) {
+      if(this.strength.==(self::REQUIRED)) {
+        core::print("Could not satisfy a required constraint!");
+      }
+      return null;
+    }
+    this.markInputs(mark);
+    self::Variable out = this.output();
+    self::Constraint overridden = out.determinedBy;
+    if(!overridden.==(null))
+      overridden.markUnsatisfied();
+    out.determinedBy = this;
+    if(!self::planner.addPropagate(this, mark))
+      core::print("Cycle encountered");
+    out.mark = mark;
+    return overridden;
+  }
+  method destroyConstraint() → void {
+    if(this.isSatisfied())
+      self::planner.incrementalRemove(this);
+    this.removeFromGraph();
+  }
+  method isInput() → core::bool
+    return false;
+}
+abstract class UnaryConstraint extends self::Constraint {
+  final field self::Variable myOutput;
+  field core::bool satisfied = false;
+  constructor •(self::Variable myOutput, self::Strength strength) → void
+    : self::UnaryConstraint::myOutput = myOutput, super self::Constraint::•(strength) {
+    this.addConstraint();
+  }
+  method addToGraph() → void {
+    this.myOutput.addConstraint(this);
+    this.satisfied = false;
+  }
+  method chooseMethod(core::int mark) → void {
+    this.satisfied = !this.myOutput.mark.==(mark) && self::Strength::stronger(this.strength, this.myOutput.walkStrength);
+  }
+  method isSatisfied() → core::bool
+    return this.satisfied;
+  method markInputs(core::int mark) → void {}
+  method output() → self::Variable
+    return this.myOutput;
+  method recalculate() → void {
+    this.myOutput.walkStrength = this.strength;
+    this.myOutput.stay = !this.isInput();
+    if(this.myOutput.stay)
+      this.execute();
+  }
+  method markUnsatisfied() → void {
+    this.satisfied = false;
+  }
+  method inputsKnown(core::int mark) → core::bool
+    return true;
+  method removeFromGraph() → void {
+    if(!this.myOutput.==(null))
+      this.myOutput.removeConstraint(this);
+    this.satisfied = false;
+  }
+}
+class StayConstraint extends self::UnaryConstraint {
+  constructor •(self::Variable v, self::Strength str) → void
+    : super self::UnaryConstraint::•(v, str)
+    ;
+  method execute() → void {}
+}
+class EditConstraint extends self::UnaryConstraint {
+  constructor •(self::Variable v, self::Strength str) → void
+    : super self::UnaryConstraint::•(v, str)
+    ;
+  method isInput() → core::bool
+    return true;
+  method execute() → void {}
+}
+abstract class BinaryConstraint extends self::Constraint {
+  field self::Variable v1;
+  field self::Variable v2;
+  field core::int direction = self::NONE;
+  constructor •(self::Variable v1, self::Variable v2, self::Strength strength) → void
+    : self::BinaryConstraint::v1 = v1, self::BinaryConstraint::v2 = v2, super self::Constraint::•(strength) {
+    this.addConstraint();
+  }
+  method chooseMethod(core::int mark) → void {
+    if(this.v1.mark.==(mark)) {
+      this.direction = !this.v2.mark.==(mark) && self::Strength::stronger(this.strength, this.v2.walkStrength) ? self::FORWARD : self::NONE;
+    }
+    if(this.v2.mark.==(mark)) {
+      this.direction = !this.v1.mark.==(mark) && self::Strength::stronger(this.strength, this.v1.walkStrength) ? self::BACKWARD : self::NONE;
+    }
+    if(self::Strength::weaker(this.v1.walkStrength, this.v2.walkStrength)) {
+      this.direction = self::Strength::stronger(this.strength, this.v1.walkStrength) ? self::BACKWARD : self::NONE;
+    }
+    else {
+      this.direction = self::Strength::stronger(this.strength, this.v2.walkStrength) ? self::FORWARD : self::BACKWARD;
+    }
+  }
+  method addToGraph() → void {
+    this.v1.addConstraint(this);
+    this.v2.addConstraint(this);
+    this.direction = self::NONE;
+  }
+  method isSatisfied() → core::bool
+    return !this.direction.==(self::NONE);
+  method markInputs(core::int mark) → void {
+    this.input().mark = mark;
+  }
+  method input() → self::Variable
+    return this.direction.==(self::FORWARD) ? this.v1 : this.v2;
+  method output() → self::Variable
+    return this.direction.==(self::FORWARD) ? this.v2 : this.v1;
+  method recalculate() → void {
+    self::Variable ihn = this.input();
+    self::Variable out = this.output();
+    out.walkStrength = self::Strength::weakest(this.strength, ihn.walkStrength);
+    out.stay = ihn.stay;
+    if(out.stay)
+      this.execute();
+  }
+  method markUnsatisfied() → void {
+    this.direction = self::NONE;
+  }
+  method inputsKnown(core::int mark) → core::bool {
+    self::Variable i = this.input();
+    return i.mark.==(mark) || i.stay || i.determinedBy.==(null);
+  }
+  method removeFromGraph() → void {
+    if(!this.v1.==(null))
+      this.v1.removeConstraint(this);
+    if(!this.v2.==(null))
+      this.v2.removeConstraint(this);
+    this.direction = self::NONE;
+  }
+}
+class ScaleConstraint extends self::BinaryConstraint {
+  final field self::Variable scale;
+  final field self::Variable offset;
+  constructor •(self::Variable src, self::Variable scale, self::Variable offset, self::Variable dest, self::Strength strength) → void
+    : self::ScaleConstraint::scale = scale, self::ScaleConstraint::offset = offset, super self::BinaryConstraint::•(src, dest, strength)
+    ;
+  method addToGraph() → void {
+    this.{=self::BinaryConstraint::addToGraph}();
+    this.scale.addConstraint(this);
+    this.offset.addConstraint(this);
+  }
+  method removeFromGraph() → void {
+    this.{=self::BinaryConstraint::removeFromGraph}();
+    if(!this.scale.==(null))
+      this.scale.removeConstraint(this);
+    if(!this.offset.==(null))
+      this.offset.removeConstraint(this);
+  }
+  method markInputs(core::int mark) → void {
+    this.{=self::BinaryConstraint::markInputs}(mark);
+    this.scale.mark = this.offset.mark = mark;
+  }
+  method execute() → void {
+    if(this.direction.==(self::FORWARD)) {
+      this.v2.value = this.v1.value.*(this.scale.value).+(this.offset.value);
+    }
+    else {
+      this.v1.value = this.v2.value.-(this.offset.value).~/(this.scale.value);
+    }
+  }
+  method recalculate() → void {
+    self::Variable ihn = this.input();
+    self::Variable out = this.output();
+    out.walkStrength = self::Strength::weakest(this.strength, ihn.walkStrength);
+    out.stay = ihn.stay && this.scale.stay && this.offset.stay;
+    if(out.stay)
+      this.execute();
+  }
+}
+class EqualityConstraint extends self::BinaryConstraint {
+  constructor •(self::Variable v1, self::Variable v2, self::Strength strength) → void
+    : super self::BinaryConstraint::•(v1, v2, strength)
+    ;
+  method execute() → void {
+    this.output().value = this.input().value;
+  }
+}
+class Variable extends core::Object {
+  field core::List<self::Constraint> constraints = <self::Constraint>[];
+  field self::Constraint determinedBy = null;
+  field core::int mark = 0;
+  field self::Strength walkStrength = self::WEAKEST;
+  field core::bool stay = true;
+  field core::int value;
+  final field core::String name;
+  constructor •(core::String name, core::int value) → void
+    : self::Variable::name = name, self::Variable::value = value, super core::Object::•()
+    ;
+  method addConstraint(self::Constraint c) → void {
+    this.constraints.add(c);
+  }
+  method removeConstraint(self::Constraint c) → void {
+    this.constraints.remove(c);
+    if(this.determinedBy.==(c))
+      this.determinedBy = null;
+  }
+}
+class Planner extends core::Object {
+  field core::int currentMark = 0;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method incrementalAdd(self::Constraint c) → void {
+    core::int mark = this.newMark();
+    for (self::Constraint overridden = c.satisfy(mark); !overridden.==(null); overridden = overridden.satisfy(mark))
+      ;
+  }
+  method incrementalRemove(self::Constraint c) → void {
+    self::Variable out = c.output();
+    c.markUnsatisfied();
+    c.removeFromGraph();
+    core::List<self::Constraint> unsatisfied = this.removePropagateFrom(out);
+    self::Strength strength = self::REQUIRED;
+    do {
+      for (core::int i = 0; i.<(unsatisfied.length); i = i.+(1)) {
+        self::Constraint u = unsatisfied.[](i);
+        if(u.strength.==(strength))
+          this.incrementalAdd(u);
+      }
+      strength = strength.nextWeaker();
+    }
+    while (!strength.==(self::WEAKEST))
+  }
+  method newMark() → core::int
+    return this.currentMark = this.currentMark.+(1);
+  method makePlan(core::List<self::Constraint> sources) → self::Plan {
+    core::int mark = this.newMark();
+    self::Plan plan = new self::Plan::•();
+    core::List<self::Constraint> todo = sources;
+    while (todo.length.>(0)) {
+      self::Constraint c = todo.removeLast();
+      if(!c.output().mark.==(mark) && c.inputsKnown(mark)) {
+        plan.addConstraint(c);
+        c.output().mark = mark;
+        this.addConstraintsConsumingTo(c.output(), todo);
+      }
+    }
+    return plan;
+  }
+  method extractPlanFromConstraints(core::List<self::Constraint> constraints) → self::Plan {
+    core::List<self::Constraint> sources = <self::Constraint>[];
+    for (core::int i = 0; i.<(constraints.length); i = i.+(1)) {
+      self::Constraint c = constraints.[](i);
+      if(c.isInput() && c.isSatisfied())
+        sources.add(c);
+    }
+    return this.makePlan(sources);
+  }
+  method addPropagate(self::Constraint c, core::int mark) → core::bool {
+    core::List<self::Constraint> todo = <self::Constraint>[c];
+    while (todo.length.>(0)) {
+      self::Constraint d = todo.removeLast();
+      if(d.output().mark.==(mark)) {
+        this.incrementalRemove(c);
+        return false;
+      }
+      d.recalculate();
+      this.addConstraintsConsumingTo(d.output(), todo);
+    }
+    return true;
+  }
+  method removePropagateFrom(self::Variable out) → core::List<self::Constraint> {
+    out.determinedBy = null;
+    out.walkStrength = self::WEAKEST;
+    out.stay = true;
+    core::List<self::Constraint> unsatisfied = <self::Constraint>[];
+    core::List<self::Variable> todo = <self::Variable>[out];
+    while (todo.length.>(0)) {
+      self::Variable v = todo.removeLast();
+      for (core::int i = 0; i.<(v.constraints.length); i = i.+(1)) {
+        self::Constraint c = v.constraints.[](i);
+        if(!c.isSatisfied())
+          unsatisfied.add(c);
+      }
+      self::Constraint determining = v.determinedBy;
+      for (core::int i = 0; i.<(v.constraints.length); i = i.+(1)) {
+        self::Constraint next = v.constraints.[](i);
+        if(!next.==(determining) && next.isSatisfied()) {
+          next.recalculate();
+          todo.add(next.output());
+        }
+      }
+    }
+    return unsatisfied;
+  }
+  method addConstraintsConsumingTo(self::Variable v, core::List<self::Constraint> coll) → void {
+    self::Constraint determining = v.determinedBy;
+    for (core::int i = 0; i.<(v.constraints.length); i = i.+(1)) {
+      self::Constraint c = v.constraints.[](i);
+      if(!c.==(determining) && c.isSatisfied())
+        coll.add(c);
+    }
+  }
+}
+class Plan extends core::Object {
+  field core::List<self::Constraint> list = <self::Constraint>[];
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method addConstraint(self::Constraint c) → void {
+    this.list.add(c);
+  }
+  method size() → core::int
+    return this.list.length;
+  method execute() → void {
+    for (core::int i = 0; i.<(this.list.length); i = i.+(1)) {
+      this.list.[](i).execute();
+    }
+  }
+}
+static const field dynamic REQUIRED = const self::Strength::•(0, "required");
+static const field dynamic STRONG_PREFERRED = const self::Strength::•(1, "strongPreferred");
+static const field dynamic PREFERRED = const self::Strength::•(2, "preferred");
+static const field dynamic STRONG_DEFAULT = const self::Strength::•(3, "strongDefault");
+static const field dynamic NORMAL = const self::Strength::•(4, "normal");
+static const field dynamic WEAK_DEFAULT = const self::Strength::•(5, "weakDefault");
+static const field dynamic WEAKEST = const self::Strength::•(6, "weakest");
+static const field core::int NONE = 1;
+static const field core::int FORWARD = 2;
+static const field core::int BACKWARD = 0;
+static field self::Planner planner = null;
+static method main() → dynamic {
+  new self::DeltaBlue::•().run();
+}
+static method chainTest(core::int n) → void {
+  self::planner = new self::Planner::•();
+  self::Variable prev = null;
+  self::Variable first = null;
+  self::Variable last = null;
+  for (core::int i = 0; i.<=(n); i = i.+(1)) {
+    self::Variable v = new self::Variable::•("v${i}", 0);
+    if(!prev.==(null))
+      new self::EqualityConstraint::•(prev, v, self::REQUIRED);
+    if(i.==(0))
+      first = v;
+    if(i.==(n))
+      last = v;
+    prev = v;
+  }
+  new self::StayConstraint::•(last, self::STRONG_DEFAULT);
+  self::EditConstraint edit = new self::EditConstraint::•(first, self::PREFERRED);
+  self::Plan plan = self::planner.extractPlanFromConstraints(<self::Constraint>[edit]);
+  for (core::int i = 0; i.<(100); i = i.+(1)) {
+    first.value = i;
+    plan.execute();
+    if(!last.value.==(i)) {
+      core::print("Chain test failed:");
+      core::print("Expected last value to be ${i} but it was ${last.value}.");
+    }
+  }
+}
+static method projectionTest(core::int n) → void {
+  self::planner = new self::Planner::•();
+  self::Variable scale = new self::Variable::•("scale", 10);
+  self::Variable offset = new self::Variable::•("offset", 1000);
+  self::Variable src = null;
+  self::Variable dst = null;
+  core::List<self::Variable> dests = <self::Variable>[];
+  for (core::int i = 0; i.<(n); i = i.+(1)) {
+    src = new self::Variable::•("src", i);
+    dst = new self::Variable::•("dst", i);
+    dests.add(dst);
+    new self::StayConstraint::•(src, self::NORMAL);
+    new self::ScaleConstraint::•(src, scale, offset, dst, self::REQUIRED);
+  }
+  self::change(src, 17);
+  if(!dst.value.==(1170))
+    core::print("Projection 1 failed");
+  self::change(dst, 1050);
+  if(!src.value.==(5))
+    core::print("Projection 2 failed");
+  self::change(scale, 5);
+  for (core::int i = 0; i.<(n.-(1)); i = i.+(1)) {
+    if(!dests.[](i).value.==(i.*(5).+(1000)))
+      core::print("Projection 3 failed");
+  }
+  self::change(offset, 2000);
+  for (core::int i = 0; i.<(n.-(1)); i = i.+(1)) {
+    if(!dests.[](i).value.==(i.*(5).+(2000)))
+      core::print("Projection 4 failed");
+  }
+}
+static method change(self::Variable v, core::int newValue) → void {
+  self::EditConstraint edit = new self::EditConstraint::•(v, self::PREFERRED);
+  self::Plan plan = self::planner.extractPlanFromConstraints(<self::EditConstraint>[edit]);
+  for (core::int i = 0; i.<(10); i = i.+(1)) {
+    v.value = newValue;
+    plan.execute();
+  }
+  edit.destroyConstraint();
+}
diff --git a/pkg/kernel/testcases/spec-mode/argument.baseline.txt b/pkg/kernel/testcases/spec-mode/argument.baseline.txt
new file mode 100644
index 0000000..27c776c
--- /dev/null
+++ b/pkg/kernel/testcases/spec-mode/argument.baseline.txt
@@ -0,0 +1,37 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+abstract class Base extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class Foo extends self::Base {
+  constructor •() → void
+    : super self::Base::•()
+    ;
+}
+class Bar extends self::Base {
+  constructor •() → void
+    : super self::Base::•()
+    ;
+}
+class Baz extends self::Base {
+  constructor •() → void
+    : super self::Base::•()
+    ;
+}
+static method foo(dynamic x) → void {}
+static method bar(dynamic x) → void {}
+static method foo_escaped(dynamic x) → void {}
+static method bar_escaped(dynamic x) → void {}
+static method escape(dynamic fn) → void {
+  fn.call(new self::Baz::•());
+}
+static method main() → dynamic {
+  self::foo(new self::Foo::•());
+  self::bar(new self::Bar::•());
+  self::escape(self::foo_escaped);
+  self::escape(self::bar_escaped);
+}
diff --git a/pkg/kernel/testcases/spec-mode/arithmetic.baseline.txt b/pkg/kernel/testcases/spec-mode/arithmetic.baseline.txt
new file mode 100644
index 0000000..7c867f3
--- /dev/null
+++ b/pkg/kernel/testcases/spec-mode/arithmetic.baseline.txt
@@ -0,0 +1,18 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+static method foo(core::int x, core::int y) → core::int {
+  dynamic z = x.+(y);
+  return z.<<(4);
+}
+static method loop(core::List<dynamic> xs) → void {
+  core::int _ = xs.length;
+  for (core::int i = 0; i.<(xs.length); i = i.+(1)) {
+  }
+}
+static method main() → dynamic {
+  self::foo(4, 5);
+  self::foo(6, 7);
+  self::loop(<dynamic>["dfg"]);
+}
diff --git a/pkg/kernel/testcases/spec-mode/async_function.baseline.txt b/pkg/kernel/testcases/spec-mode/async_function.baseline.txt
new file mode 100644
index 0000000..6a9bffa
--- /dev/null
+++ b/pkg/kernel/testcases/spec-mode/async_function.baseline.txt
@@ -0,0 +1,31 @@
+library;
+import self as self;
+import "dart:async" as asy;
+import "dart:core" as core;
+
+static field core::List<core::String> stringList = <dynamic>["bar"];
+static method asyncString() → asy::Future<core::String> async {
+  return "foo";
+}
+static method asyncString2() → asy::Future<core::String> async {
+  return self::asyncString();
+}
+static method syncStarString() → core::Iterable<core::String> sync* {
+  yield "foo";
+  yield* self::syncStarString2();
+  yield* self::stringList;
+}
+static method syncStarString2() → core::Iterable<core::String> sync* {
+  yield "foo";
+}
+static method asyncStarString() → asy::Stream<core::String> async* {
+  yield "foo";
+  yield* self::asyncStarString2();
+  yield await self::asyncString();
+}
+static method asyncStarString2() → asy::Stream<core::String> async* {
+  yield "bar";
+}
+static method main() → dynamic async {
+  core::String str = await self::asyncString();
+}
diff --git a/pkg/kernel/testcases/spec-mode/bad_store.baseline.txt b/pkg/kernel/testcases/spec-mode/bad_store.baseline.txt
new file mode 100644
index 0000000..06f7dd5
--- /dev/null
+++ b/pkg/kernel/testcases/spec-mode/bad_store.baseline.txt
@@ -0,0 +1,24 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  field dynamic field = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+static method identity(dynamic x) → dynamic
+  return x;
+static method use(dynamic x) → void {}
+static method main(core::List<core::String> args) → dynamic {
+  dynamic foo = self::identity(new self::Foo::•());
+  if(args.length.>(1)) {
+    foo.field = "string";
+    dynamic first = foo.field;
+    self::use(first);
+    foo.noField = "string";
+    dynamic second = foo.noField;
+    self::use(second);
+  }
+}
diff --git a/pkg/kernel/testcases/spec-mode/call.baseline.txt b/pkg/kernel/testcases/spec-mode/call.baseline.txt
new file mode 100644
index 0000000..5ef0d83
--- /dev/null
+++ b/pkg/kernel/testcases/spec-mode/call.baseline.txt
@@ -0,0 +1,48 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Callable extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method call(dynamic x) → dynamic {
+    return "string";
+  }
+}
+class CallableGetter extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  get call() → dynamic
+    return new self::Callable::•();
+}
+static method main() → dynamic {
+  dynamic closure = (dynamic x) → dynamic => x;
+  dynamic int1 = closure.call(1);
+  dynamic int2 = closure.call(1);
+  dynamic int3 = closure.call.call(1);
+  dynamic int4 = closure.call.call.call(1);
+  dynamic callable = new self::Callable::•();
+  dynamic string1 = callable.call(1);
+  dynamic string2 = callable.call(1);
+  dynamic string3 = callable.call.call(1);
+  dynamic string4 = callable.call.call.call(1);
+  dynamic callableGetter = new self::CallableGetter::•();
+  dynamic string5 = callableGetter.call(1);
+  dynamic string6 = callableGetter.call(1);
+  dynamic string7 = callableGetter.call.call(1);
+  dynamic string8 = callableGetter.call.call.call(1);
+  dynamic nothing1 = closure.call();
+  dynamic nothing2 = closure.call();
+  dynamic nothing3 = closure.call.call();
+  dynamic nothing4 = closure.call.call.call();
+  dynamic nothing5 = callable.call();
+  dynamic nothing6 = callable.call();
+  dynamic nothing7 = callable.call.call();
+  dynamic nothing8 = callable.call.call.call();
+  dynamic nothing9 = callableGetter.call();
+  dynamic nothing10 = callableGetter.call();
+  dynamic nothing11 = callableGetter.call.call();
+  dynamic nothing12 = callableGetter.call.call.call();
+}
diff --git a/pkg/kernel/testcases/spec-mode/closure.baseline.txt b/pkg/kernel/testcases/spec-mode/closure.baseline.txt
new file mode 100644
index 0000000..364fb6f
--- /dev/null
+++ b/pkg/kernel/testcases/spec-mode/closure.baseline.txt
@@ -0,0 +1,27 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  field dynamic _field = new self::Bar::•();
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class Bar extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+static method useCallback(dynamic callback) → dynamic {
+  dynamic _ = callback.call();
+}
+static method main() → dynamic {
+  dynamic x;
+  function inner() → dynamic {
+    x = new self::Foo::•();
+    return new self::Foo::•();
+  }
+  self::useCallback(inner);
+  dynamic _ = inner.call()._field;
+}
diff --git a/pkg/kernel/testcases/spec-mode/escape.baseline.txt b/pkg/kernel/testcases/spec-mode/escape.baseline.txt
new file mode 100644
index 0000000..2370690
--- /dev/null
+++ b/pkg/kernel/testcases/spec-mode/escape.baseline.txt
@@ -0,0 +1,50 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+  field dynamic field = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class B extends core::Object {
+  field dynamic field = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class C extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  operator ==(dynamic x) → dynamic
+    return false;
+}
+class X extends core::Object implements self::A, self::B {
+  field dynamic field = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+static method useAsA(self::A object) → void {
+  dynamic _ = object.field;
+}
+static method useAsB(self::B object) → void {
+  dynamic _ = object.field;
+  self::escape(object);
+}
+static method escape(dynamic x) → void {
+  x.==(null) ? x = "" : null;
+  x.==(null) ? x = 45 : null;
+  if(!(x is core::int) && !(x is core::String)) {
+    x.field = 45;
+  }
+}
+static method main() → dynamic {
+  dynamic object = new self::X::•();
+  self::useAsA(new self::A::•());
+  self::useAsA(object);
+  self::useAsB(new self::B::•());
+  self::useAsB(object);
+}
diff --git a/pkg/kernel/testcases/spec-mode/external.baseline.txt b/pkg/kernel/testcases/spec-mode/external.baseline.txt
new file mode 100644
index 0000000..74c2005
--- /dev/null
+++ b/pkg/kernel/testcases/spec-mode/external.baseline.txt
@@ -0,0 +1,16 @@
+library;
+import self as self;
+import "dart:core" as core;
+import "dart:isolate" as iso;
+
+static field dynamic subscription = null;
+static method onData(dynamic x) → void {
+  core::print(x);
+  self::subscription.cancel();
+}
+static method main() → dynamic {
+  dynamic string = core::String::fromCharCode(65);
+  dynamic port = iso::ReceivePort::•();
+  self::subscription = port.listen(self::onData);
+  port.sendPort.send(string);
+}
diff --git a/pkg/kernel/testcases/spec-mode/fallthrough.baseline.txt b/pkg/kernel/testcases/spec-mode/fallthrough.baseline.txt
new file mode 100644
index 0000000..d14510f
--- /dev/null
+++ b/pkg/kernel/testcases/spec-mode/fallthrough.baseline.txt
@@ -0,0 +1,38 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args) → void {
+  dynamic x = args.length;
+  #L1:
+  switch(x) {
+    #L2:
+    case 3:
+      {
+        x = 4;
+        throw new core::FallThroughError::•();
+      }
+    #L3:
+    case 5:
+      {
+        break #L1;
+      }
+    #L4:
+    case 6:
+    case 7:
+      {
+        if(args.[](0).==("")) {
+          break #L1;
+        }
+        else {
+          return;
+        }
+        throw new core::FallThroughError::•();
+      }
+    #L5:
+    case 4:
+      {
+        break #L1;
+      }
+  }
+}
diff --git a/pkg/kernel/testcases/spec-mode/micro.baseline.txt b/pkg/kernel/testcases/spec-mode/micro.baseline.txt
new file mode 100644
index 0000000..585ce19
--- /dev/null
+++ b/pkg/kernel/testcases/spec-mode/micro.baseline.txt
@@ -0,0 +1,81 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method instanceMethod() → dynamic {
+    return 123;
+  }
+}
+abstract class ExternalValue extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+abstract class Bar extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  abstract method externalInstanceMethod() → self::ExternalValue;
+}
+class Box extends core::Object {
+  field dynamic field = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class FinalBox extends core::Object {
+  final field dynamic finalField;
+  constructor •(dynamic finalField) → void
+    : self::FinalBox::finalField = finalField, super core::Object::•()
+    ;
+}
+class SubFinalBox extends self::FinalBox {
+  constructor •(dynamic value) → void
+    : super self::FinalBox::•(value)
+    ;
+}
+class DynamicReceiver1 extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method dynamicallyCalled(dynamic x) → dynamic {}
+}
+class DynamicReceiver2 extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method dynamicallyCalled(dynamic x) → dynamic {}
+}
+static method staticMethod() → dynamic {
+  return "sdfg";
+}
+external static method externalStatic() → core::bool;
+external static method createBar() → self::Bar;
+static method stringArgument(dynamic x) → dynamic {}
+static method intArgument(dynamic x) → dynamic {}
+static method makeDynamicCall(dynamic receiver) → void {
+  receiver.dynamicallyCalled("sdfg");
+}
+static method main() → dynamic {
+  dynamic x = self::staticMethod();
+  dynamic y = new self::Foo::•().instanceMethod();
+  dynamic z = self::externalStatic();
+  dynamic w = self::createBar().externalInstanceMethod();
+  self::stringArgument("sdfg");
+  self::intArgument(42);
+  dynamic box = new self::Box::•();
+  box.field = "sdfg";
+  dynamic a = box.field;
+  dynamic finalBox = new self::FinalBox::•("dfg");
+  dynamic b = finalBox.finalField;
+  dynamic subBox = new self::SubFinalBox::•("dfg");
+  dynamic c = subBox.finalField;
+  self::makeDynamicCall(new self::DynamicReceiver1::•());
+  self::makeDynamicCall(new self::DynamicReceiver2::•());
+  dynamic list = <dynamic>["string"];
+  dynamic d = list.[](0);
+}
diff --git a/pkg/kernel/testcases/spec-mode/named_parameters.baseline.txt b/pkg/kernel/testcases/spec-mode/named_parameters.baseline.txt
new file mode 100644
index 0000000..0963b64
--- /dev/null
+++ b/pkg/kernel/testcases/spec-mode/named_parameters.baseline.txt
@@ -0,0 +1,31 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Superclass extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method foo({dynamic alpha, dynamic beta}) → dynamic {}
+  method bar({dynamic beta, dynamic alpha}) → dynamic {}
+  method namedCallback(({alpha: core::String, beta: core::int}) → dynamic callback) → dynamic {
+    callback.call(alpha: "one", beta: 2);
+    callback.call(beta: 1, alpha: "two");
+  }
+}
+class Subclass extends self::Superclass {
+  constructor •() → void
+    : super self::Superclass::•()
+    ;
+  method foo({dynamic beta, dynamic alpha}) → dynamic {}
+  method bar({dynamic alpha, dynamic beta}) → dynamic {}
+  method namedCallback(({alpha: core::String, beta: core::int}) → dynamic callback) → dynamic {}
+}
+static method topLevelNamed(dynamic beta, dynamic alpha, {dynamic gamma, dynamic delta}) → dynamic {}
+static method topLevelOptional(dynamic beta, dynamic alpha, [dynamic gamma, dynamic delta]) → dynamic {}
+static method main() → dynamic {
+  new self::Subclass::•().foo(beta: 1, alpha: 2);
+  new self::Subclass::•().foo(alpha: 1, beta: 2);
+  self::topLevelNamed(1, 2, gamma: 3, delta: 4);
+  self::topLevelNamed(1, 2, delta: 3, gamma: 4);
+}
diff --git a/pkg/kernel/testcases/spec-mode/null_aware.baseline.txt b/pkg/kernel/testcases/spec-mode/null_aware.baseline.txt
new file mode 100644
index 0000000..9a60a62
--- /dev/null
+++ b/pkg/kernel/testcases/spec-mode/null_aware.baseline.txt
@@ -0,0 +1,22 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  field core::int field = null;
+  static field core::int staticField = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+static method main() → dynamic {
+  self::Foo foo = new self::Foo::•();
+  let final dynamic #t1 = foo in #t1.==(null) ? null : #t1.field = 5;
+  self::Foo::staticField = 5;
+  let final dynamic #t2 = foo in #t2.field.==(null) ? #t2.field = 5 : null;
+  self::Foo::staticField.==(null) ? self::Foo::staticField = 5 : null;
+  let final dynamic #t3 = foo in #t3.==(null) ? null : #t3.field.==(null) ? #t3.field = 5 : null;
+  self::Foo::staticField.==(null) ? self::Foo::staticField = 5 : null;
+  core::int intValue = let final dynamic #t4 = foo.field in #t4.==(null) ? 6 : #t4;
+  core::num numValue = let final dynamic #t5 = foo.field in #t5.==(null) ? 4.5 : #t5;
+}
diff --git a/pkg/kernel/testcases/spec-mode/optional.baseline.txt b/pkg/kernel/testcases/spec-mode/optional.baseline.txt
new file mode 100644
index 0000000..947d12b
--- /dev/null
+++ b/pkg/kernel/testcases/spec-mode/optional.baseline.txt
@@ -0,0 +1,61 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method method(dynamic x, [dynamic y, dynamic z]) → dynamic {
+    return "string";
+  }
+}
+abstract class External extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  abstract method externalMethod(core::int x, [core::int y, core::int z]) → core::String;
+  abstract method listen(self::Listener listener) → void;
+}
+abstract class Listener extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  abstract method event(core::String input, [core::int x, core::int y]) → void;
+}
+class TestListener extends self::Listener {
+  constructor •() → void
+    : super self::Listener::•()
+    ;
+  method event(dynamic input, [dynamic x, dynamic y]) → void {}
+}
+class ExtendedListener extends self::Listener {
+  constructor •() → void
+    : super self::Listener::•()
+    ;
+  method event(dynamic input, [dynamic x, dynamic y, dynamic z]) → void {}
+}
+class InvalidListener extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method event(dynamic input, [dynamic x]) → void {}
+}
+external static method createExternal() → self::External;
+static method main() → dynamic {
+  dynamic foo = new self::Foo::•();
+  dynamic string1 = foo.method(1);
+  dynamic string2 = foo.method(1, 2);
+  dynamic string3 = foo.method(1, 2, 3);
+  dynamic extern = self::createExternal();
+  dynamic string4 = extern.externalMethod(1);
+  dynamic string5 = extern.externalMethod(1, 2);
+  dynamic string6 = extern.externalMethod(1, 2, 3);
+  extern.listen(new self::TestListener::•());
+  extern.listen(new self::ExtendedListener::•());
+  extern.listen(new self::InvalidListener::•());
+  dynamic nothing1 = foo.method();
+  dynamic nothing2 = foo.method(1, 2, 3, 4);
+  dynamic nothing3 = extern.externalMethod();
+  dynamic nothing4 = extern.externalMethod(1, 2, 3, 4);
+}
diff --git a/pkg/kernel/testcases/spec-mode/override.baseline.txt b/pkg/kernel/testcases/spec-mode/override.baseline.txt
new file mode 100644
index 0000000..c46b187
--- /dev/null
+++ b/pkg/kernel/testcases/spec-mode/override.baseline.txt
@@ -0,0 +1,35 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class Bar extends self::Foo {
+  constructor •() → void
+    : super self::Foo::•()
+    ;
+}
+class Base extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method method() → self::Foo {
+    return new self::Foo::•();
+  }
+}
+class Sub extends self::Base {
+  constructor •() → void
+    : super self::Base::•()
+    ;
+  method method() → self::Foo {
+    return new self::Bar::•();
+  }
+}
+static method main(core::List<core::String> args) → dynamic {
+  dynamic object = args.length.==(0) ? new self::Base::•() : new self::Sub::•();
+  dynamic a = object.method();
+  core::print(a);
+}
diff --git a/pkg/kernel/testcases/spec-mode/prefer_baseclass.baseline.txt b/pkg/kernel/testcases/spec-mode/prefer_baseclass.baseline.txt
new file mode 100644
index 0000000..8e82d39
--- /dev/null
+++ b/pkg/kernel/testcases/spec-mode/prefer_baseclass.baseline.txt
@@ -0,0 +1,42 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class B extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class AB1 extends self::A implements self::B {
+  constructor •() → void
+    : super self::A::•()
+    ;
+}
+class AB2 extends self::A implements self::B {
+  constructor •() → void
+    : super self::A::•()
+    ;
+}
+class BA1 extends self::B implements self::A {
+  constructor •() → void
+    : super self::B::•()
+    ;
+}
+class BA2 extends self::B implements self::A {
+  constructor •() → void
+    : super self::B::•()
+    ;
+}
+static method takeSubclassOfA(dynamic obj) → dynamic {}
+static method takeSubclassOfB(dynamic obj) → dynamic {}
+static method main() → dynamic {
+  self::takeSubclassOfA(new self::AB1::•());
+  self::takeSubclassOfA(new self::AB2::•());
+  self::takeSubclassOfB(new self::BA1::•());
+  self::takeSubclassOfB(new self::BA2::•());
+}
diff --git a/pkg/kernel/testcases/spec-mode/redirecting_factory.baseline.txt b/pkg/kernel/testcases/spec-mode/redirecting_factory.baseline.txt
new file mode 100644
index 0000000..8ad4aa2
--- /dev/null
+++ b/pkg/kernel/testcases/spec-mode/redirecting_factory.baseline.txt
@@ -0,0 +1,53 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+abstract class FooBase<Tf extends core::Object> extends core::Object {
+  abstract get x() → core::int;
+}
+abstract class Foo<T extends core::Object> extends core::Object implements self::FooBase<dynamic> {
+}
+class Bar<Sb extends core::Object, Tb extends core::Object> extends core::Object implements self::Foo<self::Bar::Tb> {
+  field core::int x;
+  constructor •(core::int x) → void
+    : self::Bar::x = x, super core::Object::•() {
+    core::print("Bar<${self::Bar::Sb},${self::Bar::Tb}>");
+  }
+}
+class Builder<X extends core::Object> extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method method() → dynamic {
+    return new self::Bar::•<core::String, self::Builder::X>(4);
+  }
+}
+class SimpleCase<A extends core::Object, B extends core::Object> extends core::Object {
+}
+class SimpleCaseImpl<Ai extends core::Object, Bi extends core::Object> extends core::Object implements self::SimpleCase<self::SimpleCaseImpl::Ai, self::SimpleCaseImpl::Bi> {
+}
+class SimpleCaseImpl2<Ai2 extends core::Object, Bi2 extends core::Object> extends core::Object implements self::SimpleCaseImpl<self::SimpleCaseImpl2::Ai2, self::SimpleCaseImpl2::Bi2> {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class Base<M extends core::Object> extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class Mixin<M extends core::Object> extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class Mix<M extends core::Object> extends self::Base<self::Mix::M> implements self::Mixin<self::Mix::M> {
+  constructor •() → void
+    : super self::Base::•()
+    ;
+}
+static method main() → dynamic {
+  core::print(new self::Bar::•<core::String, core::double>(4).x);
+  new self::SimpleCaseImpl2::•<core::int, core::double>();
+  new self::Mix::•<core::double>();
+}
diff --git a/pkg/kernel/testcases/spec-mode/static_setter.baseline.txt b/pkg/kernel/testcases/spec-mode/static_setter.baseline.txt
new file mode 100644
index 0000000..af6242f
--- /dev/null
+++ b/pkg/kernel/testcases/spec-mode/static_setter.baseline.txt
@@ -0,0 +1,13 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+static set foo(dynamic x) → dynamic {}
+static method main() → dynamic {
+  self::foo = new self::Foo::•();
+}
diff --git a/pkg/kernel/testcases/spec-mode/store_load.baseline.txt b/pkg/kernel/testcases/spec-mode/store_load.baseline.txt
new file mode 100644
index 0000000..166eccc
--- /dev/null
+++ b/pkg/kernel/testcases/spec-mode/store_load.baseline.txt
@@ -0,0 +1,36 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  field dynamic _field = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class FooValue extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class Bar extends core::Object {
+  field dynamic _field = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class BarValue extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+static method main() → dynamic {
+  dynamic foo = new self::Foo::•();
+  foo._field = new self::FooValue::•();
+  dynamic fooValue = foo._field;
+  core::print(fooValue);
+  dynamic bar = new self::Bar::•();
+  bar._field = new self::BarValue::•();
+  dynamic barValue = bar._field;
+  core::print(barValue);
+}
diff --git a/pkg/kernel/testcases/spec-mode/stringliteral.baseline.txt b/pkg/kernel/testcases/spec-mode/stringliteral.baseline.txt
new file mode 100644
index 0000000..5fce998
--- /dev/null
+++ b/pkg/kernel/testcases/spec-mode/stringliteral.baseline.txt
@@ -0,0 +1,10 @@
+library;
+import self as self;
+
+static field dynamic color = "brown";
+static field dynamic thing = "lazy dog";
+static field dynamic phrase = "The quick ${self::color} fox\njumped over the ${self::thing}.\n";
+static field dynamic adjacent = "${self::color}${self::color}${self::color}";
+static field dynamic linebreaks = "${self::color}\n${self::color}\n${self::color}";
+static field dynamic other = "${self::color}\n is \n${self::color}";
+static method main() → dynamic {}
diff --git a/pkg/kernel/testcases/spec-mode/uninitialized_fields.baseline.txt b/pkg/kernel/testcases/spec-mode/uninitialized_fields.baseline.txt
new file mode 100644
index 0000000..c4b9044
--- /dev/null
+++ b/pkg/kernel/testcases/spec-mode/uninitialized_fields.baseline.txt
@@ -0,0 +1,37 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Uninitialized extends core::Object {
+  field core::int x = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class PartiallyInitialized extends core::Object {
+  field core::int x = null;
+  constructor •(core::int x) → void
+    : self::PartiallyInitialized::x = x, super core::Object::•()
+    ;
+  constructor noInitializer() → void
+    : super core::Object::•()
+    ;
+}
+class Initialized extends core::Object {
+  field core::int x;
+  constructor •(core::int x) → void
+    : self::Initialized::x = x, super core::Object::•()
+    ;
+}
+class Forwarding extends core::Object {
+  field core::int x;
+  constructor initialize(core::int x) → void
+    : self::Forwarding::x = x, super core::Object::•()
+    ;
+  constructor •(core::int arg) → void
+    : this self::Forwarding::initialize(arg)
+    ;
+}
+static field core::int uninitializedTopLevel = null;
+static field core::int initializedTopLevel = 4;
+static method main() → dynamic {}
diff --git a/pkg/kernel/testcases/spec-mode/void-methods.baseline.txt b/pkg/kernel/testcases/spec-mode/void-methods.baseline.txt
new file mode 100644
index 0000000..e0dc634
--- /dev/null
+++ b/pkg/kernel/testcases/spec-mode/void-methods.baseline.txt
@@ -0,0 +1,21 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  field core::List<dynamic> list = <dynamic>[1, 2, 3];
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  set first(dynamic x) → dynamic
+    this.list.[]=(0, x);
+  operator []=(dynamic x, dynamic y) → dynamic
+    this.list.[]=(x, y);
+  method clear() → void
+    return this.list.clear();
+}
+static method main() → dynamic {
+  new self::Foo::•().first = 4;
+  new self::Foo::•().[]=(3, 4);
+  new self::Foo::•().clear();
+}
diff --git a/pkg/kernel/testcases/strong-mode/DeltaBlue.baseline.txt b/pkg/kernel/testcases/strong-mode/DeltaBlue.baseline.txt
new file mode 100644
index 0000000..f2735c6
--- /dev/null
+++ b/pkg/kernel/testcases/strong-mode/DeltaBlue.baseline.txt
@@ -0,0 +1,454 @@
+// dynamic is not a subtype of dart.core::int (DeltaBlue.dart:126:17)
+// dynamic is not a subtype of dart.core::int (DeltaBlue.dart:133:15)
+// dynamic is not a subtype of dart.core::int (DeltaBlue.dart:138:36)
+// dynamic is not a subtype of dart.core::int (DeltaBlue.dart:139:15)
+library;
+import self as self;
+import "dart:core" as core;
+
+class DeltaBlue extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method run() → void {
+    self::chainTest(100);
+    self::projectionTest(100);
+  }
+}
+class Strength extends core::Object {
+  final field core::int value;
+  final field core::String name;
+  const constructor •(core::int value, core::String name) → void
+    : self::Strength::value = value, self::Strength::name = name, super core::Object::•()
+    ;
+  method nextWeaker() → self::Strength
+    return const <self::Strength>[self::STRONG_PREFERRED, self::PREFERRED, self::STRONG_DEFAULT, self::NORMAL, self::WEAK_DEFAULT, self::WEAKEST].{core::List::[]}(this.{self::Strength::value});
+  static method stronger(self::Strength s1, self::Strength s2) → core::bool {
+    return s1.{self::Strength::value}.{core::num::<}(s2.{self::Strength::value});
+  }
+  static method weaker(self::Strength s1, self::Strength s2) → core::bool {
+    return s1.{self::Strength::value}.{core::num::>}(s2.{self::Strength::value});
+  }
+  static method weakest(self::Strength s1, self::Strength s2) → self::Strength {
+    return self::Strength::weaker(s1, s2) ? s1 : s2;
+  }
+  static method strongest(self::Strength s1, self::Strength s2) → self::Strength {
+    return self::Strength::stronger(s1, s2) ? s1 : s2;
+  }
+}
+abstract class Constraint extends core::Object {
+  final field self::Strength strength;
+  const constructor •(self::Strength strength) → void
+    : self::Constraint::strength = strength, super core::Object::•()
+    ;
+  abstract method isSatisfied() → core::bool;
+  abstract method markUnsatisfied() → void;
+  abstract method addToGraph() → void;
+  abstract method removeFromGraph() → void;
+  abstract method chooseMethod(core::int mark) → void;
+  abstract method markInputs(core::int mark) → void;
+  abstract method inputsKnown(core::int mark) → core::bool;
+  abstract method output() → self::Variable;
+  abstract method execute() → void;
+  abstract method recalculate() → void;
+  method addConstraint() → void {
+    this.{self::Constraint::addToGraph}();
+    self::planner.{self::Planner::incrementalAdd}(this);
+  }
+  method satisfy(dynamic mark) → self::Constraint {
+    this.{self::Constraint::chooseMethod}(mark);
+    if(!this.{self::Constraint::isSatisfied}()) {
+      if(this.{self::Constraint::strength}.{core::Object::==}(self::REQUIRED)) {
+        core::print("Could not satisfy a required constraint!");
+      }
+      return null;
+    }
+    this.{self::Constraint::markInputs}(mark);
+    self::Variable out = this.{self::Constraint::output}();
+    self::Constraint overridden = out.{self::Variable::determinedBy};
+    if(!overridden.{core::Object::==}(null))
+      overridden.{self::Constraint::markUnsatisfied}();
+    out.{self::Variable::determinedBy} = this;
+    if(!self::planner.{self::Planner::addPropagate}(this, mark))
+      core::print("Cycle encountered");
+    out.{self::Variable::mark} = mark;
+    return overridden;
+  }
+  method destroyConstraint() → void {
+    if(this.{self::Constraint::isSatisfied}())
+      self::planner.{self::Planner::incrementalRemove}(this);
+    this.{self::Constraint::removeFromGraph}();
+  }
+  method isInput() → core::bool
+    return false;
+}
+abstract class UnaryConstraint extends self::Constraint {
+  final field self::Variable myOutput;
+  field core::bool satisfied = false;
+  constructor •(self::Variable myOutput, self::Strength strength) → void
+    : self::UnaryConstraint::myOutput = myOutput, super self::Constraint::•(strength) {
+    this.{self::Constraint::addConstraint}();
+  }
+  method addToGraph() → void {
+    this.{self::UnaryConstraint::myOutput}.{self::Variable::addConstraint}(this);
+    this.{self::UnaryConstraint::satisfied} = false;
+  }
+  method chooseMethod(core::int mark) → void {
+    this.{self::UnaryConstraint::satisfied} = !this.{self::UnaryConstraint::myOutput}.{self::Variable::mark}.{core::num::==}(mark) && self::Strength::stronger(this.{self::Constraint::strength}, this.{self::UnaryConstraint::myOutput}.{self::Variable::walkStrength});
+  }
+  method isSatisfied() → core::bool
+    return this.{self::UnaryConstraint::satisfied};
+  method markInputs(core::int mark) → void {}
+  method output() → self::Variable
+    return this.{self::UnaryConstraint::myOutput};
+  method recalculate() → void {
+    this.{self::UnaryConstraint::myOutput}.{self::Variable::walkStrength} = this.{self::Constraint::strength};
+    this.{self::UnaryConstraint::myOutput}.{self::Variable::stay} = !this.{self::Constraint::isInput}();
+    if(this.{self::UnaryConstraint::myOutput}.{self::Variable::stay})
+      this.{self::Constraint::execute}();
+  }
+  method markUnsatisfied() → void {
+    this.{self::UnaryConstraint::satisfied} = false;
+  }
+  method inputsKnown(core::int mark) → core::bool
+    return true;
+  method removeFromGraph() → void {
+    if(!this.{self::UnaryConstraint::myOutput}.{core::Object::==}(null))
+      this.{self::UnaryConstraint::myOutput}.{self::Variable::removeConstraint}(this);
+    this.{self::UnaryConstraint::satisfied} = false;
+  }
+}
+class StayConstraint extends self::UnaryConstraint {
+  constructor •(self::Variable v, self::Strength str) → void
+    : super self::UnaryConstraint::•(v, str)
+    ;
+  method execute() → void {}
+}
+class EditConstraint extends self::UnaryConstraint {
+  constructor •(self::Variable v, self::Strength str) → void
+    : super self::UnaryConstraint::•(v, str)
+    ;
+  method isInput() → core::bool
+    return true;
+  method execute() → void {}
+}
+abstract class BinaryConstraint extends self::Constraint {
+  field self::Variable v1;
+  field self::Variable v2;
+  field core::int direction = self::NONE;
+  constructor •(self::Variable v1, self::Variable v2, self::Strength strength) → void
+    : self::BinaryConstraint::v1 = v1, self::BinaryConstraint::v2 = v2, super self::Constraint::•(strength) {
+    this.{self::Constraint::addConstraint}();
+  }
+  method chooseMethod(core::int mark) → void {
+    if(this.{self::BinaryConstraint::v1}.{self::Variable::mark}.{core::num::==}(mark)) {
+      this.{self::BinaryConstraint::direction} = !this.{self::BinaryConstraint::v2}.{self::Variable::mark}.{core::num::==}(mark) && self::Strength::stronger(this.{self::Constraint::strength}, this.{self::BinaryConstraint::v2}.{self::Variable::walkStrength}) ? self::FORWARD : self::NONE;
+    }
+    if(this.{self::BinaryConstraint::v2}.{self::Variable::mark}.{core::num::==}(mark)) {
+      this.{self::BinaryConstraint::direction} = !this.{self::BinaryConstraint::v1}.{self::Variable::mark}.{core::num::==}(mark) && self::Strength::stronger(this.{self::Constraint::strength}, this.{self::BinaryConstraint::v1}.{self::Variable::walkStrength}) ? self::BACKWARD : self::NONE;
+    }
+    if(self::Strength::weaker(this.{self::BinaryConstraint::v1}.{self::Variable::walkStrength}, this.{self::BinaryConstraint::v2}.{self::Variable::walkStrength})) {
+      this.{self::BinaryConstraint::direction} = self::Strength::stronger(this.{self::Constraint::strength}, this.{self::BinaryConstraint::v1}.{self::Variable::walkStrength}) ? self::BACKWARD : self::NONE;
+    }
+    else {
+      this.{self::BinaryConstraint::direction} = self::Strength::stronger(this.{self::Constraint::strength}, this.{self::BinaryConstraint::v2}.{self::Variable::walkStrength}) ? self::FORWARD : self::BACKWARD;
+    }
+  }
+  method addToGraph() → void {
+    this.{self::BinaryConstraint::v1}.{self::Variable::addConstraint}(this);
+    this.{self::BinaryConstraint::v2}.{self::Variable::addConstraint}(this);
+    this.{self::BinaryConstraint::direction} = self::NONE;
+  }
+  method isSatisfied() → core::bool
+    return !this.{self::BinaryConstraint::direction}.{core::num::==}(self::NONE);
+  method markInputs(core::int mark) → void {
+    this.{self::BinaryConstraint::input}().{self::Variable::mark} = mark;
+  }
+  method input() → self::Variable
+    return this.{self::BinaryConstraint::direction}.{core::num::==}(self::FORWARD) ? this.{self::BinaryConstraint::v1} : this.{self::BinaryConstraint::v2};
+  method output() → self::Variable
+    return this.{self::BinaryConstraint::direction}.{core::num::==}(self::FORWARD) ? this.{self::BinaryConstraint::v2} : this.{self::BinaryConstraint::v1};
+  method recalculate() → void {
+    self::Variable ihn = this.{self::BinaryConstraint::input}();
+    self::Variable out = this.{self::BinaryConstraint::output}();
+    out.{self::Variable::walkStrength} = self::Strength::weakest(this.{self::Constraint::strength}, ihn.{self::Variable::walkStrength});
+    out.{self::Variable::stay} = ihn.{self::Variable::stay};
+    if(out.{self::Variable::stay})
+      this.{self::Constraint::execute}();
+  }
+  method markUnsatisfied() → void {
+    this.{self::BinaryConstraint::direction} = self::NONE;
+  }
+  method inputsKnown(core::int mark) → core::bool {
+    self::Variable i = this.{self::BinaryConstraint::input}();
+    return i.{self::Variable::mark}.{core::num::==}(mark) || i.{self::Variable::stay} || i.{self::Variable::determinedBy}.{core::Object::==}(null);
+  }
+  method removeFromGraph() → void {
+    if(!this.{self::BinaryConstraint::v1}.{core::Object::==}(null))
+      this.{self::BinaryConstraint::v1}.{self::Variable::removeConstraint}(this);
+    if(!this.{self::BinaryConstraint::v2}.{core::Object::==}(null))
+      this.{self::BinaryConstraint::v2}.{self::Variable::removeConstraint}(this);
+    this.{self::BinaryConstraint::direction} = self::NONE;
+  }
+}
+class ScaleConstraint extends self::BinaryConstraint {
+  final field self::Variable scale;
+  final field self::Variable offset;
+  constructor •(self::Variable src, self::Variable scale, self::Variable offset, self::Variable dest, self::Strength strength) → void
+    : self::ScaleConstraint::scale = scale, self::ScaleConstraint::offset = offset, super self::BinaryConstraint::•(src, dest, strength)
+    ;
+  method addToGraph() → void {
+    this.{=self::BinaryConstraint::addToGraph}();
+    this.{self::ScaleConstraint::scale}.{self::Variable::addConstraint}(this);
+    this.{self::ScaleConstraint::offset}.{self::Variable::addConstraint}(this);
+  }
+  method removeFromGraph() → void {
+    this.{=self::BinaryConstraint::removeFromGraph}();
+    if(!this.{self::ScaleConstraint::scale}.{core::Object::==}(null))
+      this.{self::ScaleConstraint::scale}.{self::Variable::removeConstraint}(this);
+    if(!this.{self::ScaleConstraint::offset}.{core::Object::==}(null))
+      this.{self::ScaleConstraint::offset}.{self::Variable::removeConstraint}(this);
+  }
+  method markInputs(core::int mark) → void {
+    this.{=self::BinaryConstraint::markInputs}(mark);
+    this.{self::ScaleConstraint::scale}.{self::Variable::mark} = this.{self::ScaleConstraint::offset}.{self::Variable::mark} = mark;
+  }
+  method execute() → void {
+    if(this.{self::BinaryConstraint::direction}.{core::num::==}(self::FORWARD)) {
+      this.{self::BinaryConstraint::v2}.{self::Variable::value} = this.{self::BinaryConstraint::v1}.{self::Variable::value}.{core::num::*}(this.{self::ScaleConstraint::scale}.{self::Variable::value}).{core::num::+}(this.{self::ScaleConstraint::offset}.{self::Variable::value});
+    }
+    else {
+      this.{self::BinaryConstraint::v1}.{self::Variable::value} = this.{self::BinaryConstraint::v2}.{self::Variable::value}.{core::num::-}(this.{self::ScaleConstraint::offset}.{self::Variable::value}).{core::num::~/}(this.{self::ScaleConstraint::scale}.{self::Variable::value});
+    }
+  }
+  method recalculate() → void {
+    self::Variable ihn = this.{self::BinaryConstraint::input}();
+    self::Variable out = this.{self::BinaryConstraint::output}();
+    out.{self::Variable::walkStrength} = self::Strength::weakest(this.{self::Constraint::strength}, ihn.{self::Variable::walkStrength});
+    out.{self::Variable::stay} = ihn.{self::Variable::stay} && this.{self::ScaleConstraint::scale}.{self::Variable::stay} && this.{self::ScaleConstraint::offset}.{self::Variable::stay};
+    if(out.{self::Variable::stay})
+      this.{self::ScaleConstraint::execute}();
+  }
+}
+class EqualityConstraint extends self::BinaryConstraint {
+  constructor •(self::Variable v1, self::Variable v2, self::Strength strength) → void
+    : super self::BinaryConstraint::•(v1, v2, strength)
+    ;
+  method execute() → void {
+    this.{self::BinaryConstraint::output}().{self::Variable::value} = this.{self::BinaryConstraint::input}().{self::Variable::value};
+  }
+}
+class Variable extends core::Object {
+  field core::List<self::Constraint> constraints = <self::Constraint>[];
+  field self::Constraint determinedBy = null;
+  field core::int mark = 0;
+  field self::Strength walkStrength = self::WEAKEST;
+  field core::bool stay = true;
+  field core::int value;
+  final field core::String name;
+  constructor •(core::String name, core::int value) → void
+    : self::Variable::name = name, self::Variable::value = value, super core::Object::•()
+    ;
+  method addConstraint(self::Constraint c) → void {
+    this.{self::Variable::constraints}.{core::List::add}(c);
+  }
+  method removeConstraint(self::Constraint c) → void {
+    this.{self::Variable::constraints}.{core::List::remove}(c);
+    if(this.{self::Variable::determinedBy}.{core::Object::==}(c))
+      this.{self::Variable::determinedBy} = null;
+  }
+}
+class Planner extends core::Object {
+  field core::int currentMark = 0;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method incrementalAdd(self::Constraint c) → void {
+    core::int mark = this.{self::Planner::newMark}();
+    for (self::Constraint overridden = c.{self::Constraint::satisfy}(mark); !overridden.{core::Object::==}(null); overridden = overridden.{self::Constraint::satisfy}(mark))
+      ;
+  }
+  method incrementalRemove(self::Constraint c) → void {
+    self::Variable out = c.{self::Constraint::output}();
+    c.{self::Constraint::markUnsatisfied}();
+    c.{self::Constraint::removeFromGraph}();
+    core::List<self::Constraint> unsatisfied = this.{self::Planner::removePropagateFrom}(out);
+    self::Strength strength = self::REQUIRED;
+    do {
+      for (core::int i = 0; i.{core::num::<}(unsatisfied.{core::List::length}); i = i.{core::num::+}(1)) {
+        self::Constraint u = unsatisfied.{core::List::[]}(i);
+        if(u.{self::Constraint::strength}.{core::Object::==}(strength))
+          this.{self::Planner::incrementalAdd}(u);
+      }
+      strength = strength.{self::Strength::nextWeaker}();
+    }
+    while (!strength.{core::Object::==}(self::WEAKEST))
+  }
+  method newMark() → core::int
+    return this.{self::Planner::currentMark} = this.{self::Planner::currentMark}.{core::num::+}(1);
+  method makePlan(core::List<self::Constraint> sources) → self::Plan {
+    core::int mark = this.{self::Planner::newMark}();
+    self::Plan plan = new self::Plan::•();
+    core::List<self::Constraint> todo = sources;
+    while (todo.{core::List::length}.{core::num::>}(0)) {
+      self::Constraint c = todo.{core::List::removeLast}();
+      if(!c.{self::Constraint::output}().{self::Variable::mark}.{core::num::==}(mark) && c.{self::Constraint::inputsKnown}(mark)) {
+        plan.{self::Plan::addConstraint}(c);
+        c.{self::Constraint::output}().{self::Variable::mark} = mark;
+        this.{self::Planner::addConstraintsConsumingTo}(c.{self::Constraint::output}(), todo);
+      }
+    }
+    return plan;
+  }
+  method extractPlanFromConstraints(core::List<self::Constraint> constraints) → self::Plan {
+    core::List<self::Constraint> sources = <self::Constraint>[];
+    for (core::int i = 0; i.{core::num::<}(constraints.{core::List::length}); i = i.{core::num::+}(1)) {
+      self::Constraint c = constraints.{core::List::[]}(i);
+      if(c.{self::Constraint::isInput}() && c.{self::Constraint::isSatisfied}())
+        sources.{core::List::add}(c);
+    }
+    return this.{self::Planner::makePlan}(sources);
+  }
+  method addPropagate(self::Constraint c, core::int mark) → core::bool {
+    core::List<self::Constraint> todo = <self::Constraint>[c];
+    while (todo.{core::List::length}.{core::num::>}(0)) {
+      self::Constraint d = todo.{core::List::removeLast}();
+      if(d.{self::Constraint::output}().{self::Variable::mark}.{core::num::==}(mark)) {
+        this.{self::Planner::incrementalRemove}(c);
+        return false;
+      }
+      d.{self::Constraint::recalculate}();
+      this.{self::Planner::addConstraintsConsumingTo}(d.{self::Constraint::output}(), todo);
+    }
+    return true;
+  }
+  method removePropagateFrom(self::Variable out) → core::List<self::Constraint> {
+    out.{self::Variable::determinedBy} = null;
+    out.{self::Variable::walkStrength} = self::WEAKEST;
+    out.{self::Variable::stay} = true;
+    core::List<self::Constraint> unsatisfied = <self::Constraint>[];
+    core::List<self::Variable> todo = <self::Variable>[out];
+    while (todo.{core::List::length}.{core::num::>}(0)) {
+      self::Variable v = todo.{core::List::removeLast}();
+      for (core::int i = 0; i.{core::num::<}(v.{self::Variable::constraints}.{core::List::length}); i = i.{core::num::+}(1)) {
+        self::Constraint c = v.{self::Variable::constraints}.{core::List::[]}(i);
+        if(!c.{self::Constraint::isSatisfied}())
+          unsatisfied.{core::List::add}(c);
+      }
+      self::Constraint determining = v.{self::Variable::determinedBy};
+      for (core::int i = 0; i.{core::num::<}(v.{self::Variable::constraints}.{core::List::length}); i = i.{core::num::+}(1)) {
+        self::Constraint next = v.{self::Variable::constraints}.{core::List::[]}(i);
+        if(!next.{core::Object::==}(determining) && next.{self::Constraint::isSatisfied}()) {
+          next.{self::Constraint::recalculate}();
+          todo.{core::List::add}(next.{self::Constraint::output}());
+        }
+      }
+    }
+    return unsatisfied;
+  }
+  method addConstraintsConsumingTo(self::Variable v, core::List<self::Constraint> coll) → void {
+    self::Constraint determining = v.{self::Variable::determinedBy};
+    for (core::int i = 0; i.{core::num::<}(v.{self::Variable::constraints}.{core::List::length}); i = i.{core::num::+}(1)) {
+      self::Constraint c = v.{self::Variable::constraints}.{core::List::[]}(i);
+      if(!c.{core::Object::==}(determining) && c.{self::Constraint::isSatisfied}())
+        coll.{core::List::add}(c);
+    }
+  }
+}
+class Plan extends core::Object {
+  field core::List<self::Constraint> list = <self::Constraint>[];
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method addConstraint(self::Constraint c) → void {
+    this.{self::Plan::list}.{core::List::add}(c);
+  }
+  method size() → core::int
+    return this.{self::Plan::list}.{core::List::length};
+  method execute() → void {
+    for (core::int i = 0; i.{core::num::<}(this.{self::Plan::list}.{core::List::length}); i = i.{core::num::+}(1)) {
+      this.{self::Plan::list}.{core::List::[]}(i).{self::Constraint::execute}();
+    }
+  }
+}
+static const field self::Strength REQUIRED = const self::Strength::•(0, "required");
+static const field self::Strength STRONG_PREFERRED = const self::Strength::•(1, "strongPreferred");
+static const field self::Strength PREFERRED = const self::Strength::•(2, "preferred");
+static const field self::Strength STRONG_DEFAULT = const self::Strength::•(3, "strongDefault");
+static const field self::Strength NORMAL = const self::Strength::•(4, "normal");
+static const field self::Strength WEAK_DEFAULT = const self::Strength::•(5, "weakDefault");
+static const field self::Strength WEAKEST = const self::Strength::•(6, "weakest");
+static const field core::int NONE = 1;
+static const field core::int FORWARD = 2;
+static const field core::int BACKWARD = 0;
+static field self::Planner planner = null;
+static method main() → dynamic {
+  new self::DeltaBlue::•().{self::DeltaBlue::run}();
+}
+static method chainTest(core::int n) → void {
+  self::planner = new self::Planner::•();
+  self::Variable prev = null;
+  self::Variable first = null;
+  self::Variable last = null;
+  for (core::int i = 0; i.{core::num::<=}(n); i = i.{core::num::+}(1)) {
+    self::Variable v = new self::Variable::•("v${i}", 0);
+    if(!prev.{core::Object::==}(null))
+      new self::EqualityConstraint::•(prev, v, self::REQUIRED);
+    if(i.{core::num::==}(0))
+      first = v;
+    if(i.{core::num::==}(n))
+      last = v;
+    prev = v;
+  }
+  new self::StayConstraint::•(last, self::STRONG_DEFAULT);
+  self::EditConstraint edit = new self::EditConstraint::•(first, self::PREFERRED);
+  self::Plan plan = self::planner.{self::Planner::extractPlanFromConstraints}(<self::Constraint>[edit]);
+  for (core::int i = 0; i.{core::num::<}(100); i = i.{core::num::+}(1)) {
+    first.{self::Variable::value} = i;
+    plan.{self::Plan::execute}();
+    if(!last.{self::Variable::value}.{core::num::==}(i)) {
+      core::print("Chain test failed:");
+      core::print("Expected last value to be ${i} but it was ${last.{self::Variable::value}}.");
+    }
+  }
+}
+static method projectionTest(core::int n) → void {
+  self::planner = new self::Planner::•();
+  self::Variable scale = new self::Variable::•("scale", 10);
+  self::Variable offset = new self::Variable::•("offset", 1000);
+  self::Variable src = null;
+  self::Variable dst = null;
+  core::List<self::Variable> dests = <self::Variable>[];
+  for (core::int i = 0; i.{core::num::<}(n); i = i.{core::num::+}(1)) {
+    src = new self::Variable::•("src", i);
+    dst = new self::Variable::•("dst", i);
+    dests.{core::List::add}(dst);
+    new self::StayConstraint::•(src, self::NORMAL);
+    new self::ScaleConstraint::•(src, scale, offset, dst, self::REQUIRED);
+  }
+  self::change(src, 17);
+  if(!dst.{self::Variable::value}.{core::num::==}(1170))
+    core::print("Projection 1 failed");
+  self::change(dst, 1050);
+  if(!src.{self::Variable::value}.{core::num::==}(5))
+    core::print("Projection 2 failed");
+  self::change(scale, 5);
+  for (core::int i = 0; i.{core::num::<}(n.{core::num::-}(1)); i = i.{core::num::+}(1)) {
+    if(!dests.{core::List::[]}(i).{self::Variable::value}.{core::num::==}(i.{core::num::*}(5).{core::num::+}(1000)))
+      core::print("Projection 3 failed");
+  }
+  self::change(offset, 2000);
+  for (core::int i = 0; i.{core::num::<}(n.{core::num::-}(1)); i = i.{core::num::+}(1)) {
+    if(!dests.{core::List::[]}(i).{self::Variable::value}.{core::num::==}(i.{core::num::*}(5).{core::num::+}(2000)))
+      core::print("Projection 4 failed");
+  }
+}
+static method change(self::Variable v, core::int newValue) → void {
+  self::EditConstraint edit = new self::EditConstraint::•(v, self::PREFERRED);
+  self::Plan plan = self::planner.{self::Planner::extractPlanFromConstraints}(<self::EditConstraint>[edit]);
+  for (core::int i = 0; i.{core::num::<}(10); i = i.{core::num::+}(1)) {
+    v.{self::Variable::value} = newValue;
+    plan.{self::Plan::execute}();
+  }
+  edit.{self::Constraint::destroyConstraint}();
+}
diff --git a/pkg/kernel/testcases/strong-mode/argument.baseline.txt b/pkg/kernel/testcases/strong-mode/argument.baseline.txt
new file mode 100644
index 0000000..27c776c
--- /dev/null
+++ b/pkg/kernel/testcases/strong-mode/argument.baseline.txt
@@ -0,0 +1,37 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+abstract class Base extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class Foo extends self::Base {
+  constructor •() → void
+    : super self::Base::•()
+    ;
+}
+class Bar extends self::Base {
+  constructor •() → void
+    : super self::Base::•()
+    ;
+}
+class Baz extends self::Base {
+  constructor •() → void
+    : super self::Base::•()
+    ;
+}
+static method foo(dynamic x) → void {}
+static method bar(dynamic x) → void {}
+static method foo_escaped(dynamic x) → void {}
+static method bar_escaped(dynamic x) → void {}
+static method escape(dynamic fn) → void {
+  fn.call(new self::Baz::•());
+}
+static method main() → dynamic {
+  self::foo(new self::Foo::•());
+  self::bar(new self::Bar::•());
+  self::escape(self::foo_escaped);
+  self::escape(self::bar_escaped);
+}
diff --git a/pkg/kernel/testcases/strong-mode/arithmetic.baseline.txt b/pkg/kernel/testcases/strong-mode/arithmetic.baseline.txt
new file mode 100644
index 0000000..e2b593f
--- /dev/null
+++ b/pkg/kernel/testcases/strong-mode/arithmetic.baseline.txt
@@ -0,0 +1,18 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+static method foo(core::int x, core::int y) → core::int {
+  core::int z = x.{core::num::+}(y);
+  return z.{core::int::<<}(4);
+}
+static method loop(core::List<dynamic> xs) → void {
+  core::int _ = xs.{core::List::length};
+  for (core::int i = 0; i.{core::num::<}(xs.{core::List::length}); i = i.{core::num::+}(1)) {
+  }
+}
+static method main() → dynamic {
+  self::foo(4, 5);
+  self::foo(6, 7);
+  self::loop(<core::String>["dfg"]);
+}
diff --git a/pkg/kernel/testcases/strong-mode/async_function.baseline.txt b/pkg/kernel/testcases/strong-mode/async_function.baseline.txt
new file mode 100644
index 0000000..4cbc5e0
--- /dev/null
+++ b/pkg/kernel/testcases/strong-mode/async_function.baseline.txt
@@ -0,0 +1,31 @@
+library;
+import self as self;
+import "dart:async" as asy;
+import "dart:core" as core;
+
+static field core::List<core::String> stringList = <core::String>["bar"];
+static method asyncString() → asy::Future<core::String> async {
+  return "foo";
+}
+static method asyncString2() → asy::Future<core::String> async {
+  return self::asyncString();
+}
+static method syncStarString() → core::Iterable<core::String> sync* {
+  yield "foo";
+  yield* self::syncStarString2();
+  yield* self::stringList;
+}
+static method syncStarString2() → core::Iterable<core::String> sync* {
+  yield "foo";
+}
+static method asyncStarString() → asy::Stream<core::String> async* {
+  yield "foo";
+  yield* self::asyncStarString2();
+  yield await self::asyncString();
+}
+static method asyncStarString2() → asy::Stream<core::String> async* {
+  yield "bar";
+}
+static method main() → dynamic async {
+  core::String str = await self::asyncString();
+}
diff --git a/pkg/kernel/testcases/strong-mode/bad_store.baseline.txt b/pkg/kernel/testcases/strong-mode/bad_store.baseline.txt
new file mode 100644
index 0000000..161e6a5
--- /dev/null
+++ b/pkg/kernel/testcases/strong-mode/bad_store.baseline.txt
@@ -0,0 +1,24 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  field dynamic field = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+static method identity(dynamic x) → dynamic
+  return x;
+static method use(dynamic x) → void {}
+static method main(core::List<core::String> args) → dynamic {
+  dynamic foo = self::identity(new self::Foo::•());
+  if(args.{core::List::length}.{core::num::>}(1)) {
+    foo.field = "string";
+    dynamic first = foo.field;
+    self::use(first);
+    foo.noField = "string";
+    dynamic second = foo.noField;
+    self::use(second);
+  }
+}
diff --git a/pkg/kernel/testcases/strong-mode/call.baseline.txt b/pkg/kernel/testcases/strong-mode/call.baseline.txt
new file mode 100644
index 0000000..387757e
--- /dev/null
+++ b/pkg/kernel/testcases/strong-mode/call.baseline.txt
@@ -0,0 +1,53 @@
+// Too few positional arguments (call.dart:30:17)
+// Too few positional arguments (call.dart:31:25)
+// Too few positional arguments (call.dart:35:17)
+// Too few positional arguments (call.dart:36:26)
+// Too few positional arguments (call.dart:37:31)
+library;
+import self as self;
+import "dart:core" as core;
+
+class Callable extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method call(dynamic x) → dynamic {
+    return "string";
+  }
+}
+class CallableGetter extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  get call() → dynamic
+    return new self::Callable::•();
+}
+static method main() → dynamic {
+  (dynamic) → dynamic closure = (dynamic x) → dynamic => x;
+  dynamic int1 = closure.call(1);
+  dynamic int2 = closure.call(1);
+  dynamic int3 = closure.call.call(1);
+  dynamic int4 = closure.call.call.call(1);
+  self::Callable callable = new self::Callable::•();
+  dynamic string1 = callable.{self::Callable::call}(1);
+  dynamic string2 = callable.{self::Callable::call}(1);
+  dynamic string3 = callable.{self::Callable::call}.call(1);
+  dynamic string4 = callable.{self::Callable::call}.call.call(1);
+  self::CallableGetter callableGetter = new self::CallableGetter::•();
+  dynamic string5 = callableGetter.call(1);
+  dynamic string6 = callableGetter.{self::CallableGetter::call}.call(1);
+  dynamic string7 = callableGetter.{self::CallableGetter::call}.call(1);
+  dynamic string8 = callableGetter.{self::CallableGetter::call}.call.call(1);
+  dynamic nothing1 = closure.call();
+  dynamic nothing2 = closure.call();
+  dynamic nothing3 = closure.call.call();
+  dynamic nothing4 = closure.call.call.call();
+  dynamic nothing5 = callable.{self::Callable::call}();
+  dynamic nothing6 = callable.{self::Callable::call}();
+  dynamic nothing7 = callable.{self::Callable::call}.call();
+  dynamic nothing8 = callable.{self::Callable::call}.call.call();
+  dynamic nothing9 = callableGetter.call();
+  dynamic nothing10 = callableGetter.{self::CallableGetter::call}.call();
+  dynamic nothing11 = callableGetter.{self::CallableGetter::call}.call();
+  dynamic nothing12 = callableGetter.{self::CallableGetter::call}.call.call();
+}
diff --git a/pkg/kernel/testcases/strong-mode/closure.baseline.txt b/pkg/kernel/testcases/strong-mode/closure.baseline.txt
new file mode 100644
index 0000000..01ba4e5
--- /dev/null
+++ b/pkg/kernel/testcases/strong-mode/closure.baseline.txt
@@ -0,0 +1,27 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  field self::Bar _field = new self::Bar::•();
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class Bar extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+static method useCallback(dynamic callback) → dynamic {
+  dynamic _ = callback.call();
+}
+static method main() → dynamic {
+  dynamic x;
+  function inner() → dynamic {
+    x = new self::Foo::•();
+    return new self::Foo::•();
+  }
+  self::useCallback(inner);
+  self::Bar _ = inner.call().{self::Foo::_field};
+}
diff --git a/pkg/kernel/testcases/strong-mode/escape.baseline.txt b/pkg/kernel/testcases/strong-mode/escape.baseline.txt
new file mode 100644
index 0000000..fd61f99
--- /dev/null
+++ b/pkg/kernel/testcases/strong-mode/escape.baseline.txt
@@ -0,0 +1,50 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+  field dynamic field = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class B extends core::Object {
+  field dynamic field = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class C extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  operator ==(dynamic x) → core::bool
+    return false;
+}
+class X extends core::Object implements self::A, self::B {
+  field dynamic field = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+static method useAsA(self::A object) → void {
+  dynamic _ = object.{self::A::field};
+}
+static method useAsB(self::B object) → void {
+  dynamic _ = object.{self::B::field};
+  self::escape(object);
+}
+static method escape(dynamic x) → void {
+  x.==(null) ? x = "" : null;
+  x.==(null) ? x = 45 : null;
+  if(!(x is core::int) && !(x is core::String)) {
+    x.field = 45;
+  }
+}
+static method main() → dynamic {
+  self::X object = new self::X::•();
+  self::useAsA(new self::A::•());
+  self::useAsA(object);
+  self::useAsB(new self::B::•());
+  self::useAsB(object);
+}
diff --git a/pkg/kernel/testcases/strong-mode/external.baseline.txt b/pkg/kernel/testcases/strong-mode/external.baseline.txt
new file mode 100644
index 0000000..e4d6f84
--- /dev/null
+++ b/pkg/kernel/testcases/strong-mode/external.baseline.txt
@@ -0,0 +1,16 @@
+library;
+import self as self;
+import "dart:core" as core;
+import "dart:isolate" as iso;
+
+static field dynamic subscription = null;
+static method onData(dynamic x) → void {
+  core::print(x);
+  self::subscription.cancel();
+}
+static method main() → dynamic {
+  core::String string = core::String::fromCharCode(65);
+  iso::ReceivePort port = iso::ReceivePort::•();
+  self::subscription = port.{iso::ReceivePort::listen}(self::onData);
+  port.{iso::ReceivePort::sendPort}.{iso::SendPort::send}(string);
+}
diff --git a/pkg/kernel/testcases/strong-mode/fallthrough.baseline.txt b/pkg/kernel/testcases/strong-mode/fallthrough.baseline.txt
new file mode 100644
index 0000000..8c544b3
--- /dev/null
+++ b/pkg/kernel/testcases/strong-mode/fallthrough.baseline.txt
@@ -0,0 +1,38 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+static method main(core::List<core::String> args) → void {
+  core::int x = args.{core::List::length};
+  #L1:
+  switch(x) {
+    #L2:
+    case 3:
+      {
+        x = 4;
+        throw new core::FallThroughError::•();
+      }
+    #L3:
+    case 5:
+      {
+        break #L1;
+      }
+    #L4:
+    case 6:
+    case 7:
+      {
+        if(args.{core::List::[]}(0).{core::String::==}("")) {
+          break #L1;
+        }
+        else {
+          return;
+        }
+        throw new core::FallThroughError::•();
+      }
+    #L5:
+    case 4:
+      {
+        break #L1;
+      }
+  }
+}
diff --git a/pkg/kernel/testcases/strong-mode/micro.baseline.txt b/pkg/kernel/testcases/strong-mode/micro.baseline.txt
new file mode 100644
index 0000000..994a9c9
--- /dev/null
+++ b/pkg/kernel/testcases/strong-mode/micro.baseline.txt
@@ -0,0 +1,81 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method instanceMethod() → dynamic {
+    return 123;
+  }
+}
+abstract class ExternalValue extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+abstract class Bar extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  abstract method externalInstanceMethod() → self::ExternalValue;
+}
+class Box extends core::Object {
+  field dynamic field = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class FinalBox extends core::Object {
+  final field dynamic finalField;
+  constructor •(dynamic finalField) → void
+    : self::FinalBox::finalField = finalField, super core::Object::•()
+    ;
+}
+class SubFinalBox extends self::FinalBox {
+  constructor •(dynamic value) → void
+    : super self::FinalBox::•(value)
+    ;
+}
+class DynamicReceiver1 extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method dynamicallyCalled(dynamic x) → dynamic {}
+}
+class DynamicReceiver2 extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method dynamicallyCalled(dynamic x) → dynamic {}
+}
+static method staticMethod() → dynamic {
+  return "sdfg";
+}
+external static method externalStatic() → core::bool;
+external static method createBar() → self::Bar;
+static method stringArgument(dynamic x) → dynamic {}
+static method intArgument(dynamic x) → dynamic {}
+static method makeDynamicCall(dynamic receiver) → void {
+  receiver.dynamicallyCalled("sdfg");
+}
+static method main() → dynamic {
+  dynamic x = self::staticMethod();
+  dynamic y = new self::Foo::•().{self::Foo::instanceMethod}();
+  core::bool z = self::externalStatic();
+  self::ExternalValue w = self::createBar().{self::Bar::externalInstanceMethod}();
+  self::stringArgument("sdfg");
+  self::intArgument(42);
+  self::Box box = new self::Box::•();
+  box.{self::Box::field} = "sdfg";
+  dynamic a = box.{self::Box::field};
+  self::FinalBox finalBox = new self::FinalBox::•("dfg");
+  dynamic b = finalBox.{self::FinalBox::finalField};
+  self::SubFinalBox subBox = new self::SubFinalBox::•("dfg");
+  dynamic c = subBox.{self::FinalBox::finalField};
+  self::makeDynamicCall(new self::DynamicReceiver1::•());
+  self::makeDynamicCall(new self::DynamicReceiver2::•());
+  core::List<core::String> list = <core::String>["string"];
+  core::String d = list.{core::List::[]}(0);
+}
diff --git a/pkg/kernel/testcases/strong-mode/named_parameters.baseline.txt b/pkg/kernel/testcases/strong-mode/named_parameters.baseline.txt
new file mode 100644
index 0000000..279ed4a
--- /dev/null
+++ b/pkg/kernel/testcases/strong-mode/named_parameters.baseline.txt
@@ -0,0 +1,33 @@
+// ({alpha: dynamic, beta: dynamic}) → dynamic is not a subtype of ({beta: dynamic, alpha: dynamic}) → dynamic (no location)
+// ({beta: dynamic, alpha: dynamic}) → dynamic is not a subtype of ({alpha: dynamic, beta: dynamic}) → dynamic (no location)
+library;
+import self as self;
+import "dart:core" as core;
+
+class Superclass extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method foo({dynamic alpha, dynamic beta}) → dynamic {}
+  method bar({dynamic beta, dynamic alpha}) → dynamic {}
+  method namedCallback(({alpha: core::String, beta: core::int}) → dynamic callback) → dynamic {
+    callback.call(alpha: "one", beta: 2);
+    callback.call(beta: 1, alpha: "two");
+  }
+}
+class Subclass extends self::Superclass {
+  constructor •() → void
+    : super self::Superclass::•()
+    ;
+  method foo({dynamic beta, dynamic alpha}) → dynamic {}
+  method bar({dynamic alpha, dynamic beta}) → dynamic {}
+  method namedCallback(({alpha: core::String, beta: core::int}) → dynamic callback) → dynamic {}
+}
+static method topLevelNamed(dynamic beta, dynamic alpha, {dynamic gamma, dynamic delta}) → dynamic {}
+static method topLevelOptional(dynamic beta, dynamic alpha, [dynamic gamma, dynamic delta]) → dynamic {}
+static method main() → dynamic {
+  new self::Subclass::•().{self::Subclass::foo}(beta: 1, alpha: 2);
+  new self::Subclass::•().{self::Subclass::foo}(alpha: 1, beta: 2);
+  self::topLevelNamed(1, 2, gamma: 3, delta: 4);
+  self::topLevelNamed(1, 2, delta: 3, gamma: 4);
+}
diff --git a/pkg/kernel/testcases/strong-mode/null_aware.baseline.txt b/pkg/kernel/testcases/strong-mode/null_aware.baseline.txt
new file mode 100644
index 0000000..7788c08
--- /dev/null
+++ b/pkg/kernel/testcases/strong-mode/null_aware.baseline.txt
@@ -0,0 +1,22 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  field core::int field = null;
+  static field core::int staticField = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+static method main() → dynamic {
+  self::Foo foo = new self::Foo::•();
+  let final self::Foo #t1 = foo in #t1.==(null) ? null : #t1.{self::Foo::field} = 5;
+  self::Foo::staticField = 5;
+  let final self::Foo #t2 = foo in #t2.{self::Foo::field}.==(null) ? #t2.{self::Foo::field} = 5 : null;
+  self::Foo::staticField.==(null) ? self::Foo::staticField = 5 : null;
+  let final self::Foo #t3 = foo in #t3.==(null) ? null : #t3.{self::Foo::field}.==(null) ? #t3.{self::Foo::field} = 5 : null;
+  self::Foo::staticField.==(null) ? self::Foo::staticField = 5 : null;
+  core::int intValue = let final core::int #t4 = foo.{self::Foo::field} in #t4.==(null) ? 6 : #t4;
+  core::num numValue = let final core::int #t5 = foo.{self::Foo::field} in #t5.==(null) ? 4.5 : #t5;
+}
diff --git a/pkg/kernel/testcases/strong-mode/optional.baseline.txt b/pkg/kernel/testcases/strong-mode/optional.baseline.txt
new file mode 100644
index 0000000..1087a03
--- /dev/null
+++ b/pkg/kernel/testcases/strong-mode/optional.baseline.txt
@@ -0,0 +1,66 @@
+// #lib1::InvalidListener is not a subtype of #lib1::Listener (optional.dart:42:20)
+// Too few positional arguments (optional.dart:44:21)
+// Too many positional arguments (optional.dart:45:21)
+// Too few positional arguments (optional.dart:46:24)
+// Too many positional arguments (optional.dart:47:24)
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method method(dynamic x, [dynamic y, dynamic z]) → dynamic {
+    return "string";
+  }
+}
+abstract class External extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  abstract method externalMethod(core::int x, [core::int y, core::int z]) → core::String;
+  abstract method listen(self::Listener listener) → void;
+}
+abstract class Listener extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  abstract method event(core::String input, [core::int x, core::int y]) → void;
+}
+class TestListener extends self::Listener {
+  constructor •() → void
+    : super self::Listener::•()
+    ;
+  method event(core::String input, [core::int x, core::int y]) → void {}
+}
+class ExtendedListener extends self::Listener {
+  constructor •() → void
+    : super self::Listener::•()
+    ;
+  method event(core::String input, [core::int x, core::int y, dynamic z]) → void {}
+}
+class InvalidListener extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method event(dynamic input, [dynamic x]) → void {}
+}
+external static method createExternal() → self::External;
+static method main() → dynamic {
+  self::Foo foo = new self::Foo::•();
+  dynamic string1 = foo.{self::Foo::method}(1);
+  dynamic string2 = foo.{self::Foo::method}(1, 2);
+  dynamic string3 = foo.{self::Foo::method}(1, 2, 3);
+  self::External extern = self::createExternal();
+  core::String string4 = extern.{self::External::externalMethod}(1);
+  core::String string5 = extern.{self::External::externalMethod}(1, 2);
+  core::String string6 = extern.{self::External::externalMethod}(1, 2, 3);
+  extern.{self::External::listen}(new self::TestListener::•());
+  extern.{self::External::listen}(new self::ExtendedListener::•());
+  extern.{self::External::listen}(new self::InvalidListener::•());
+  dynamic nothing1 = foo.{self::Foo::method}();
+  dynamic nothing2 = foo.{self::Foo::method}(1, 2, 3, 4);
+  core::String nothing3 = extern.{self::External::externalMethod}();
+  core::String nothing4 = extern.{self::External::externalMethod}(1, 2, 3, 4);
+}
diff --git a/pkg/kernel/testcases/strong-mode/override.baseline.txt b/pkg/kernel/testcases/strong-mode/override.baseline.txt
new file mode 100644
index 0000000..1f28522
--- /dev/null
+++ b/pkg/kernel/testcases/strong-mode/override.baseline.txt
@@ -0,0 +1,35 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class Bar extends self::Foo {
+  constructor •() → void
+    : super self::Foo::•()
+    ;
+}
+class Base extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method method() → self::Foo {
+    return new self::Foo::•();
+  }
+}
+class Sub extends self::Base {
+  constructor •() → void
+    : super self::Base::•()
+    ;
+  method method() → self::Foo {
+    return new self::Bar::•();
+  }
+}
+static method main(core::List<core::String> args) → dynamic {
+  self::Base object = args.{core::List::length}.{core::num::==}(0) ? new self::Base::•() : new self::Sub::•();
+  self::Foo a = object.{self::Base::method}();
+  core::print(a);
+}
diff --git a/pkg/kernel/testcases/strong-mode/prefer_baseclass.baseline.txt b/pkg/kernel/testcases/strong-mode/prefer_baseclass.baseline.txt
new file mode 100644
index 0000000..8e82d39
--- /dev/null
+++ b/pkg/kernel/testcases/strong-mode/prefer_baseclass.baseline.txt
@@ -0,0 +1,42 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class B extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class AB1 extends self::A implements self::B {
+  constructor •() → void
+    : super self::A::•()
+    ;
+}
+class AB2 extends self::A implements self::B {
+  constructor •() → void
+    : super self::A::•()
+    ;
+}
+class BA1 extends self::B implements self::A {
+  constructor •() → void
+    : super self::B::•()
+    ;
+}
+class BA2 extends self::B implements self::A {
+  constructor •() → void
+    : super self::B::•()
+    ;
+}
+static method takeSubclassOfA(dynamic obj) → dynamic {}
+static method takeSubclassOfB(dynamic obj) → dynamic {}
+static method main() → dynamic {
+  self::takeSubclassOfA(new self::AB1::•());
+  self::takeSubclassOfA(new self::AB2::•());
+  self::takeSubclassOfB(new self::BA1::•());
+  self::takeSubclassOfB(new self::BA2::•());
+}
diff --git a/pkg/kernel/testcases/strong-mode/redirecting_factory.baseline.txt b/pkg/kernel/testcases/strong-mode/redirecting_factory.baseline.txt
new file mode 100644
index 0000000..be5bd7c
--- /dev/null
+++ b/pkg/kernel/testcases/strong-mode/redirecting_factory.baseline.txt
@@ -0,0 +1,53 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+abstract class FooBase<Tf extends core::Object> extends core::Object {
+  abstract get x() → core::int;
+}
+abstract class Foo<T extends core::Object> extends core::Object implements self::FooBase<dynamic> {
+}
+class Bar<Sb extends core::Object, Tb extends core::Object> extends core::Object implements self::Foo<self::Bar::Tb> {
+  field core::int x;
+  constructor •(core::int x) → void
+    : self::Bar::x = x, super core::Object::•() {
+    core::print("Bar<${self::Bar::Sb},${self::Bar::Tb}>");
+  }
+}
+class Builder<X extends core::Object> extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method method() → dynamic {
+    return new self::Bar::•<core::String, self::Builder::X>(4);
+  }
+}
+class SimpleCase<A extends core::Object, B extends core::Object> extends core::Object {
+}
+class SimpleCaseImpl<Ai extends core::Object, Bi extends core::Object> extends core::Object implements self::SimpleCase<self::SimpleCaseImpl::Ai, self::SimpleCaseImpl::Bi> {
+}
+class SimpleCaseImpl2<Ai2 extends core::Object, Bi2 extends core::Object> extends core::Object implements self::SimpleCaseImpl<self::SimpleCaseImpl2::Ai2, self::SimpleCaseImpl2::Bi2> {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class Base<M extends core::Object> extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class Mixin<M extends core::Object> extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class Mix<M extends core::Object> extends self::Base<self::Mix::M> implements self::Mixin<self::Mix::M> {
+  constructor •() → void
+    : super self::Base::•()
+    ;
+}
+static method main() → dynamic {
+  core::print(new self::Bar::•<core::String, core::double>(4).{self::FooBase::x});
+  new self::SimpleCaseImpl2::•<core::int, core::double>();
+  new self::Mix::•<core::double>();
+}
diff --git a/pkg/kernel/testcases/strong-mode/static_setter.baseline.txt b/pkg/kernel/testcases/strong-mode/static_setter.baseline.txt
new file mode 100644
index 0000000..af6242f
--- /dev/null
+++ b/pkg/kernel/testcases/strong-mode/static_setter.baseline.txt
@@ -0,0 +1,13 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+static set foo(dynamic x) → dynamic {}
+static method main() → dynamic {
+  self::foo = new self::Foo::•();
+}
diff --git a/pkg/kernel/testcases/strong-mode/store_load.baseline.txt b/pkg/kernel/testcases/strong-mode/store_load.baseline.txt
new file mode 100644
index 0000000..c06ea70
--- /dev/null
+++ b/pkg/kernel/testcases/strong-mode/store_load.baseline.txt
@@ -0,0 +1,36 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  field dynamic _field = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class FooValue extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class Bar extends core::Object {
+  field dynamic _field = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class BarValue extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+static method main() → dynamic {
+  self::Foo foo = new self::Foo::•();
+  foo.{self::Foo::_field} = new self::FooValue::•();
+  dynamic fooValue = foo.{self::Foo::_field};
+  core::print(fooValue);
+  self::Bar bar = new self::Bar::•();
+  bar.{self::Bar::_field} = new self::BarValue::•();
+  dynamic barValue = bar.{self::Bar::_field};
+  core::print(barValue);
+}
diff --git a/pkg/kernel/testcases/strong-mode/stringliteral.baseline.txt b/pkg/kernel/testcases/strong-mode/stringliteral.baseline.txt
new file mode 100644
index 0000000..00fca06
--- /dev/null
+++ b/pkg/kernel/testcases/strong-mode/stringliteral.baseline.txt
@@ -0,0 +1,11 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+static field core::String color = "brown";
+static field core::String thing = "lazy dog";
+static field core::String phrase = "The quick ${self::color} fox\njumped over the ${self::thing}.\n";
+static field core::String adjacent = "${self::color}${self::color}${self::color}";
+static field core::String linebreaks = "${self::color}\n${self::color}\n${self::color}";
+static field core::String other = "${self::color}\n is \n${self::color}";
+static method main() → dynamic {}
diff --git a/pkg/kernel/testcases/strong-mode/uninitialized_fields.baseline.txt b/pkg/kernel/testcases/strong-mode/uninitialized_fields.baseline.txt
new file mode 100644
index 0000000..c4b9044
--- /dev/null
+++ b/pkg/kernel/testcases/strong-mode/uninitialized_fields.baseline.txt
@@ -0,0 +1,37 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Uninitialized extends core::Object {
+  field core::int x = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class PartiallyInitialized extends core::Object {
+  field core::int x = null;
+  constructor •(core::int x) → void
+    : self::PartiallyInitialized::x = x, super core::Object::•()
+    ;
+  constructor noInitializer() → void
+    : super core::Object::•()
+    ;
+}
+class Initialized extends core::Object {
+  field core::int x;
+  constructor •(core::int x) → void
+    : self::Initialized::x = x, super core::Object::•()
+    ;
+}
+class Forwarding extends core::Object {
+  field core::int x;
+  constructor initialize(core::int x) → void
+    : self::Forwarding::x = x, super core::Object::•()
+    ;
+  constructor •(core::int arg) → void
+    : this self::Forwarding::initialize(arg)
+    ;
+}
+static field core::int uninitializedTopLevel = null;
+static field core::int initializedTopLevel = 4;
+static method main() → dynamic {}
diff --git a/pkg/kernel/testcases/strong-mode/void-methods.baseline.txt b/pkg/kernel/testcases/strong-mode/void-methods.baseline.txt
new file mode 100644
index 0000000..73cd4d9
--- /dev/null
+++ b/pkg/kernel/testcases/strong-mode/void-methods.baseline.txt
@@ -0,0 +1,22 @@
+// dynamic is not a subtype of dart.core::int (void-methods.dart:4:27)
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  field core::List<dynamic> list = <core::int>[1, 2, 3];
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  set first(dynamic x) → void
+    this.{self::Foo::list}.{core::List::[]=}(0, x);
+  operator []=(dynamic x, dynamic y) → dynamic
+    this.{self::Foo::list}.{core::List::[]=}(x, y);
+  method clear() → void
+    this.{self::Foo::list}.{core::List::clear}();
+}
+static method main() → dynamic {
+  new self::Foo::•().{self::Foo::first} = 4;
+  new self::Foo::•().{self::Foo::[]=}(3, 4);
+  new self::Foo::•().{self::Foo::clear}();
+}
diff --git a/pkg/kernel/testcases/type-propagation/DeltaBlue.baseline.txt b/pkg/kernel/testcases/type-propagation/DeltaBlue.baseline.txt
new file mode 100644
index 0000000..298b869
--- /dev/null
+++ b/pkg/kernel/testcases/type-propagation/DeltaBlue.baseline.txt
@@ -0,0 +1,450 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class DeltaBlue extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method run() → void/Null {
+    self::chainTest(100);
+    self::projectionTest(100);
+  }
+}
+class Strength extends core::Object {
+  final field core::int/core::int* {int} value;
+  final field core::String/core::String* {string} name;
+  const constructor •(core::int/core::int* {int} value, core::String/core::String* {string} name) → void
+    : self::Strength::value = value, self::Strength::name = name, super core::Object::•()
+    ;
+  method nextWeaker() → self::Strength/core::Object+ {*}
+    return const <self::Strength>[self::STRONG_PREFERRED, self::PREFERRED, self::STRONG_DEFAULT, self::NORMAL, self::WEAK_DEFAULT, self::WEAKEST].[](this.value);
+  static method stronger(self::Strength/self::Strength! {other} s1, self::Strength/self::Strength! {other} s2) → core::bool/core::bool* {other} {
+    return s1.value.<(s2.value);
+  }
+  static method weaker(self::Strength/self::Strength! {other} s1, self::Strength/self::Strength! {other} s2) → core::bool/core::bool* {other} {
+    return s1.value.>(s2.value);
+  }
+  static method weakest(self::Strength/self::Strength! {other} s1, self::Strength/self::Strength! {other} s2) → self::Strength/self::Strength! {other} {
+    return self::Strength::weaker(s1, s2) ? s1 : s2;
+  }
+  static method strongest(self::Strength/Nothing s1, self::Strength/Nothing s2) → self::Strength/Nothing {
+    return self::Strength::stronger(s1, s2) ? s1 : s2;
+  }
+}
+abstract class Constraint extends core::Object {
+  final field self::Strength/self::Strength! {other} strength;
+  const constructor •(self::Strength/self::Strength! {other} strength) → void
+    : self::Constraint::strength = strength, super core::Object::•()
+    ;
+  abstract method isSatisfied() → core::bool/<missing type>;
+  abstract method markUnsatisfied() → void/<missing type>;
+  abstract method addToGraph() → void/<missing type>;
+  abstract method removeFromGraph() → void/<missing type>;
+  abstract method chooseMethod(core::int/<missing type> mark) → void/<missing type>;
+  abstract method markInputs(core::int/<missing type> mark) → void/<missing type>;
+  abstract method inputsKnown(core::int/<missing type> mark) → core::bool/<missing type>;
+  abstract method output() → self::Variable/<missing type>;
+  abstract method execute() → void/<missing type>;
+  abstract method recalculate() → void/<missing type>;
+  method addConstraint() → void/Null {
+    this.addToGraph();
+    self::planner.incrementalAdd(this);
+  }
+  method satisfy(dynamic/core::num* {int,double} mark) → self::Constraint/self::Constraint+ {null,other} {
+    this.chooseMethod(mark);
+    if(!this.isSatisfied()) {
+      if(this.strength.==(self::REQUIRED)) {
+        core::print("Could not satisfy a required constraint!");
+      }
+      return null;
+    }
+    this.markInputs(mark);
+    self::Variable/self::Variable! {null,other} out = this.output();
+    self::Constraint/self::Constraint+ {null,other} overridden = out.determinedBy;
+    if(!overridden.==(null))
+      overridden.markUnsatisfied();
+    out.determinedBy = this;
+    if(!self::planner.addPropagate(this, mark))
+      core::print("Cycle encountered");
+    out.mark = mark;
+    return overridden;
+  }
+  method destroyConstraint() → void/Null {
+    if(this.isSatisfied())
+      self::planner.incrementalRemove(this);
+    this.removeFromGraph();
+  }
+  method isInput() → core::bool/core::bool* {other}
+    return false;
+}
+abstract class UnaryConstraint extends self::Constraint {
+  final field self::Variable/self::Variable! {null,other} myOutput;
+  field core::bool/core::bool* {other} satisfied = false;
+  constructor •(self::Variable/self::Variable! {null,other} myOutput, self::Strength/self::Strength! {other} strength) → void
+    : self::UnaryConstraint::myOutput = myOutput, super self::Constraint::•(strength) {
+    this.addConstraint();
+  }
+  method addToGraph() → void/Null {
+    this.myOutput.addConstraint(this);
+    this.satisfied = false;
+  }
+  method chooseMethod(core::int/core::num* {int,double} mark) → void/Null {
+    this.satisfied = !this.myOutput.mark.==(mark) && self::Strength::stronger(this.strength, this.myOutput.walkStrength);
+  }
+  method isSatisfied() → core::bool/core::bool* {other}
+    return this.satisfied;
+  method markInputs(core::int/core::num* {int,double} mark) → void/Null {}
+  method output() → self::Variable/self::Variable! {null,other}
+    return this.myOutput;
+  method recalculate() → void/Null {
+    this.myOutput.walkStrength = this.strength;
+    this.myOutput.stay = !this.isInput();
+    if(this.myOutput.stay)
+      this.execute();
+  }
+  method markUnsatisfied() → void/Null {
+    this.satisfied = false;
+  }
+  method inputsKnown(core::int/core::num* {int,double} mark) → core::bool/core::bool* {other}
+    return true;
+  method removeFromGraph() → void/Null {
+    if(!this.myOutput.==(null))
+      this.myOutput.removeConstraint(this);
+    this.satisfied = false;
+  }
+}
+class StayConstraint extends self::UnaryConstraint {
+  constructor •(self::Variable/self::Variable! {null,other} v, self::Strength/self::Strength! {other} str) → void
+    : super self::UnaryConstraint::•(v, str)
+    ;
+  method execute() → void/Null {}
+}
+class EditConstraint extends self::UnaryConstraint {
+  constructor •(self::Variable/self::Variable! {null,other} v, self::Strength/self::Strength! {other} str) → void
+    : super self::UnaryConstraint::•(v, str)
+    ;
+  method isInput() → core::bool/core::bool* {other}
+    return true;
+  method execute() → void/Null {}
+}
+abstract class BinaryConstraint extends self::Constraint {
+  field self::Variable/self::Variable! {null,other} v1;
+  field self::Variable/self::Variable! {null,other} v2;
+  field core::int/core::int* {int} direction = self::NONE;
+  constructor •(self::Variable/self::Variable! {null,other} v1, self::Variable/self::Variable! {null,other} v2, self::Strength/self::Strength! {other} strength) → void
+    : self::BinaryConstraint::v1 = v1, self::BinaryConstraint::v2 = v2, super self::Constraint::•(strength) {
+    this.addConstraint();
+  }
+  method chooseMethod(core::int/core::num* {int,double} mark) → void/Null {
+    if(this.v1.mark.==(mark)) {
+      this.direction = !this.v2.mark.==(mark) && self::Strength::stronger(this.strength, this.v2.walkStrength) ? self::FORWARD : self::NONE;
+    }
+    if(this.v2.mark.==(mark)) {
+      this.direction = !this.v1.mark.==(mark) && self::Strength::stronger(this.strength, this.v1.walkStrength) ? self::BACKWARD : self::NONE;
+    }
+    if(self::Strength::weaker(this.v1.walkStrength, this.v2.walkStrength)) {
+      this.direction = self::Strength::stronger(this.strength, this.v1.walkStrength) ? self::BACKWARD : self::NONE;
+    }
+    else {
+      this.direction = self::Strength::stronger(this.strength, this.v2.walkStrength) ? self::FORWARD : self::BACKWARD;
+    }
+  }
+  method addToGraph() → void/Null {
+    this.v1.addConstraint(this);
+    this.v2.addConstraint(this);
+    this.direction = self::NONE;
+  }
+  method isSatisfied() → core::bool/core::bool* {other}
+    return !this.direction.==(self::NONE);
+  method markInputs(core::int/core::num* {int,double} mark) → void/Null {
+    this.input().mark = mark;
+  }
+  method input() → self::Variable/self::Variable! {null,other}
+    return this.direction.==(self::FORWARD) ? this.v1 : this.v2;
+  method output() → self::Variable/self::Variable! {null,other}
+    return this.direction.==(self::FORWARD) ? this.v2 : this.v1;
+  method recalculate() → void/Null {
+    self::Variable/self::Variable! {null,other} ihn = this.input();
+    self::Variable/self::Variable! {null,other} out = this.output();
+    out.walkStrength = self::Strength::weakest(this.strength, ihn.walkStrength);
+    out.stay = ihn.stay;
+    if(out.stay)
+      this.execute();
+  }
+  method markUnsatisfied() → void/Null {
+    this.direction = self::NONE;
+  }
+  method inputsKnown(core::int/core::num* {int,double} mark) → core::bool/core::bool* {other} {
+    self::Variable/self::Variable! {null,other} i = this.input();
+    return i.mark.==(mark) || i.stay || i.determinedBy.==(null);
+  }
+  method removeFromGraph() → void/Null {
+    if(!this.v1.==(null))
+      this.v1.removeConstraint(this);
+    if(!this.v2.==(null))
+      this.v2.removeConstraint(this);
+    this.direction = self::NONE;
+  }
+}
+class ScaleConstraint extends self::BinaryConstraint {
+  final field self::Variable/self::Variable! {other} scale;
+  final field self::Variable/self::Variable! {other} offset;
+  constructor •(self::Variable/self::Variable! {null,other} src, self::Variable/self::Variable! {other} scale, self::Variable/self::Variable! {other} offset, self::Variable/self::Variable! {null,other} dest, self::Strength/self::Strength! {other} strength) → void
+    : self::ScaleConstraint::scale = scale, self::ScaleConstraint::offset = offset, super self::BinaryConstraint::•(src, dest, strength)
+    ;
+  method addToGraph() → void/Null {
+    this.{=self::BinaryConstraint::addToGraph}();
+    this.scale.addConstraint(this);
+    this.offset.addConstraint(this);
+  }
+  method removeFromGraph() → void/Null {
+    this.{=self::BinaryConstraint::removeFromGraph}();
+    if(!this.scale.==(null))
+      this.scale.removeConstraint(this);
+    if(!this.offset.==(null))
+      this.offset.removeConstraint(this);
+  }
+  method markInputs(core::int/core::num* {int,double} mark) → void/Null {
+    this.{=self::BinaryConstraint::markInputs}(mark);
+    this.scale.mark = this.offset.mark = mark;
+  }
+  method execute() → void/Null {
+    if(this.direction.==(self::FORWARD)) {
+      this.v2.value = this.v1.value.*(this.scale.value).+(this.offset.value);
+    }
+    else {
+      this.v1.value = this.v2.value.-(this.offset.value).~/(this.scale.value);
+    }
+  }
+  method recalculate() → void/Null {
+    self::Variable/self::Variable! {null,other} ihn = this.input();
+    self::Variable/self::Variable! {null,other} out = this.output();
+    out.walkStrength = self::Strength::weakest(this.strength, ihn.walkStrength);
+    out.stay = ihn.stay && this.scale.stay && this.offset.stay;
+    if(out.stay)
+      this.execute();
+  }
+}
+class EqualityConstraint extends self::BinaryConstraint {
+  constructor •(self::Variable/self::Variable! {null,other} v1, self::Variable/self::Variable! {other} v2, self::Strength/self::Strength! {other} strength) → void
+    : super self::BinaryConstraint::•(v1, v2, strength)
+    ;
+  method execute() → void/Null {
+    this.output().value = this.input().value;
+  }
+}
+class Variable extends core::Object {
+  field core::List<self::Constraint>/core::List* {other} constraints = <self::Constraint>[];
+  field self::Constraint/self::Constraint+ {null,other} determinedBy = null;
+  field core::int/core::num* {int,double} mark = 0;
+  field self::Strength/self::Strength! {other} walkStrength = self::WEAKEST;
+  field core::bool/core::bool* {other} stay = true;
+  field core::int/core::num* {int,double} value;
+  final field core::String/core::String* {string} name;
+  constructor •(core::String/core::String* {string} name, core::int/core::num* {int,double} value) → void
+    : self::Variable::name = name, self::Variable::value = value, super core::Object::•()
+    ;
+  method addConstraint(self::Constraint/self::Constraint+ {other} c) → void/Null {
+    this.constraints.add(c);
+  }
+  method removeConstraint(self::Constraint/self::Constraint+ {other} c) → void/Null {
+    this.constraints.remove(c);
+    if(this.determinedBy.==(c))
+      this.determinedBy = null;
+  }
+}
+class Planner extends core::Object {
+  field core::int/core::num* {int,double} currentMark = 0;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method incrementalAdd(self::Constraint/core::Object+ {*} c) → void/Null {
+    core::int/core::num* {int,double} mark = this.newMark();
+    for (self::Constraint/self::Constraint+ {null,other} overridden = c.satisfy(mark); !overridden.==(null); overridden = overridden.satisfy(mark))
+      ;
+  }
+  method incrementalRemove(self::Constraint/self::Constraint+ {other} c) → void/Null {
+    self::Variable/self::Variable! {null,other} out = c.output();
+    c.markUnsatisfied();
+    c.removeFromGraph();
+    core::List<self::Constraint>/core::List* {other} unsatisfied = this.removePropagateFrom(out);
+    self::Strength/core::Object+ {*} strength = self::REQUIRED;
+    do {
+      for (core::int/core::num* {int,double} i = 0; i.<(unsatisfied.length); i = i.+(1)) {
+        self::Constraint/core::Object+ {*} u = unsatisfied.[](i);
+        if(u.strength.==(strength))
+          this.incrementalAdd(u);
+      }
+      strength = strength.nextWeaker();
+    }
+    while (!strength.==(self::WEAKEST))
+  }
+  method newMark() → core::int/core::num* {int,double}
+    return this.currentMark = this.currentMark.+(1);
+  method makePlan(core::List<self::Constraint>/core::List* {other} sources) → self::Plan/self::Plan! {other} {
+    core::int/core::num* {int,double} mark = this.newMark();
+    self::Plan/self::Plan! {other} plan = new self::Plan::•();
+    core::List<self::Constraint>/core::List* {other} todo = sources;
+    while (todo.length.>(0)) {
+      self::Constraint/core::Object+ {*} c = todo.removeLast();
+      if(!c.output().mark.==(mark) && c.inputsKnown(mark)) {
+        plan.addConstraint(c);
+        c.output().mark = mark;
+        this.addConstraintsConsumingTo(c.output(), todo);
+      }
+    }
+    return plan;
+  }
+  method extractPlanFromConstraints(core::List<self::Constraint>/core::List* {other} constraints) → self::Plan/self::Plan! {other} {
+    core::List<self::Constraint>/core::List* {other} sources = <self::Constraint>[];
+    for (core::int/core::num* {int,double} i = 0; i.<(constraints.length); i = i.+(1)) {
+      self::Constraint/core::Object+ {*} c = constraints.[](i);
+      if(c.isInput() && c.isSatisfied())
+        sources.add(c);
+    }
+    return this.makePlan(sources);
+  }
+  method addPropagate(self::Constraint/self::Constraint+ {other} c, core::int/core::num* {int,double} mark) → core::bool/core::bool* {other} {
+    core::List<self::Constraint>/core::List* {other} todo = <self::Constraint>[c];
+    while (todo.length.>(0)) {
+      self::Constraint/core::Object+ {*} d = todo.removeLast();
+      if(d.output().mark.==(mark)) {
+        this.incrementalRemove(c);
+        return false;
+      }
+      d.recalculate();
+      this.addConstraintsConsumingTo(d.output(), todo);
+    }
+    return true;
+  }
+  method removePropagateFrom(self::Variable/self::Variable! {null,other} out) → core::List<self::Constraint>/core::List* {other} {
+    out.determinedBy = null;
+    out.walkStrength = self::WEAKEST;
+    out.stay = true;
+    core::List<self::Constraint>/core::List* {other} unsatisfied = <self::Constraint>[];
+    core::List<self::Variable>/core::List* {other} todo = <self::Variable>[out];
+    while (todo.length.>(0)) {
+      self::Variable/core::Object+ {*} v = todo.removeLast();
+      for (core::int/core::num* {int,double} i = 0; i.<(v.constraints.length); i = i.+(1)) {
+        self::Constraint/core::Object+ {*} c = v.constraints.[](i);
+        if(!c.isSatisfied())
+          unsatisfied.add(c);
+      }
+      self::Constraint/self::Constraint+ {null,other} determining = v.determinedBy;
+      for (core::int/core::num* {int,double} i = 0; i.<(v.constraints.length); i = i.+(1)) {
+        self::Constraint/core::Object+ {*} next = v.constraints.[](i);
+        if(!next.==(determining) && next.isSatisfied()) {
+          next.recalculate();
+          todo.add(next.output());
+        }
+      }
+    }
+    return unsatisfied;
+  }
+  method addConstraintsConsumingTo(self::Variable/self::Variable! {null,other} v, core::List<self::Constraint>/core::List* {other} coll) → void/Null {
+    self::Constraint/self::Constraint+ {null,other} determining = v.determinedBy;
+    for (core::int/core::num* {int,double} i = 0; i.<(v.constraints.length); i = i.+(1)) {
+      self::Constraint/core::Object+ {*} c = v.constraints.[](i);
+      if(!c.==(determining) && c.isSatisfied())
+        coll.add(c);
+    }
+  }
+}
+class Plan extends core::Object {
+  field core::List<self::Constraint>/core::List* {other} list = <self::Constraint>[];
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method addConstraint(self::Constraint/core::Object+ {*} c) → void/Null {
+    this.list.add(c);
+  }
+  method size() → core::int/core::int* {int}
+    return this.list.length;
+  method execute() → void/Null {
+    for (core::int/core::num* {int,double} i = 0; i.<(this.list.length); i = i.+(1)) {
+      this.list.[](i).execute();
+    }
+  }
+}
+static const field dynamic/self::Strength! {other} REQUIRED = const self::Strength::•(0, "required");
+static const field dynamic/self::Strength! {other} STRONG_PREFERRED = const self::Strength::•(1, "strongPreferred");
+static const field dynamic/self::Strength! {other} PREFERRED = const self::Strength::•(2, "preferred");
+static const field dynamic/self::Strength! {other} STRONG_DEFAULT = const self::Strength::•(3, "strongDefault");
+static const field dynamic/self::Strength! {other} NORMAL = const self::Strength::•(4, "normal");
+static const field dynamic/self::Strength! {other} WEAK_DEFAULT = const self::Strength::•(5, "weakDefault");
+static const field dynamic/self::Strength! {other} WEAKEST = const self::Strength::•(6, "weakest");
+static const field core::int/core::int* {int} NONE = 1;
+static const field core::int/core::int* {int} FORWARD = 2;
+static const field core::int/core::int* {int} BACKWARD = 0;
+static field self::Planner/self::Planner! {null,other} planner = null;
+static method main() → dynamic/Null {
+  new self::DeltaBlue::•().run();
+}
+static method chainTest(core::int/core::int* {int} n) → void/Null {
+  self::planner = new self::Planner::•();
+  self::Variable/self::Variable! {null,other} prev = null;
+  self::Variable/self::Variable! {null,other} first = null;
+  self::Variable/self::Variable! {null,other} last = null;
+  for (core::int/core::num* {int,double} i = 0; i.<=(n); i = i.+(1)) {
+    self::Variable/self::Variable! {other} v = new self::Variable::•("v${i}", 0);
+    if(!prev.==(null))
+      new self::EqualityConstraint::•(prev, v, self::REQUIRED);
+    if(i.==(0))
+      first = v;
+    if(i.==(n))
+      last = v;
+    prev = v;
+  }
+  new self::StayConstraint::•(last, self::STRONG_DEFAULT);
+  self::EditConstraint/self::EditConstraint! {other} edit = new self::EditConstraint::•(first, self::PREFERRED);
+  self::Plan/self::Plan! {other} plan = self::planner.extractPlanFromConstraints(<self::Constraint>[edit]);
+  for (core::int/core::num* {int,double} i = 0; i.<(100); i = i.+(1)) {
+    first.value = i;
+    plan.execute();
+    if(!last.value.==(i)) {
+      core::print("Chain test failed:");
+      core::print("Expected last value to be ${i} but it was ${last.value}.");
+    }
+  }
+}
+static method projectionTest(core::int/core::int* {int} n) → void/Null {
+  self::planner = new self::Planner::•();
+  self::Variable/self::Variable! {other} scale = new self::Variable::•("scale", 10);
+  self::Variable/self::Variable! {other} offset = new self::Variable::•("offset", 1000);
+  self::Variable/self::Variable! {null,other} src = null;
+  self::Variable/self::Variable! {null,other} dst = null;
+  core::List<self::Variable>/core::List* {other} dests = <self::Variable>[];
+  for (core::int/core::num* {int,double} i = 0; i.<(n); i = i.+(1)) {
+    src = new self::Variable::•("src", i);
+    dst = new self::Variable::•("dst", i);
+    dests.add(dst);
+    new self::StayConstraint::•(src, self::NORMAL);
+    new self::ScaleConstraint::•(src, scale, offset, dst, self::REQUIRED);
+  }
+  self::change(src, 17);
+  if(!dst.value.==(1170))
+    core::print("Projection 1 failed");
+  self::change(dst, 1050);
+  if(!src.value.==(5))
+    core::print("Projection 2 failed");
+  self::change(scale, 5);
+  for (core::int/core::num* {int,double} i = 0; i.<(n.-(1)); i = i.+(1)) {
+    if(!dests.[](i).value.==(i.*(5).+(1000)))
+      core::print("Projection 3 failed");
+  }
+  self::change(offset, 2000);
+  for (core::int/core::num* {int,double} i = 0; i.<(n.-(1)); i = i.+(1)) {
+    if(!dests.[](i).value.==(i.*(5).+(2000)))
+      core::print("Projection 4 failed");
+  }
+}
+static method change(self::Variable/self::Variable! {null,other} v, core::int/core::int* {int} newValue) → void/Null {
+  self::EditConstraint/self::EditConstraint! {other} edit = new self::EditConstraint::•(v, self::PREFERRED);
+  self::Plan/self::Plan! {other} plan = self::planner.extractPlanFromConstraints(<self::EditConstraint>[edit]);
+  for (core::int/core::num* {int,double} i = 0; i.<(10); i = i.+(1)) {
+    v.value = newValue;
+    plan.execute();
+  }
+  edit.destroyConstraint();
+}
diff --git a/pkg/kernel/testcases/type-propagation/argument.baseline.txt b/pkg/kernel/testcases/type-propagation/argument.baseline.txt
new file mode 100644
index 0000000..f120511
--- /dev/null
+++ b/pkg/kernel/testcases/type-propagation/argument.baseline.txt
@@ -0,0 +1,37 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+abstract class Base extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class Foo extends self::Base {
+  constructor •() → void
+    : super self::Base::•()
+    ;
+}
+class Bar extends self::Base {
+  constructor •() → void
+    : super self::Base::•()
+    ;
+}
+class Baz extends self::Base {
+  constructor •() → void
+    : super self::Base::•()
+    ;
+}
+static method foo(dynamic/self::Foo! {other} x) → void/Null {}
+static method bar(dynamic/self::Bar! {other} x) → void/Null {}
+static method foo_escaped(dynamic/core::Object+ {*} x) → void/Null {}
+static method bar_escaped(dynamic/core::Object+ {*} x) → void/Null {}
+static method escape(dynamic/core::Function* {other} fn) → void/Null {
+  fn.call(new self::Baz::•());
+}
+static method main() → dynamic/Null {
+  self::foo(new self::Foo::•());
+  self::bar(new self::Bar::•());
+  self::escape(self::foo_escaped);
+  self::escape(self::bar_escaped);
+}
diff --git a/pkg/kernel/testcases/type-propagation/arithmetic.baseline.txt b/pkg/kernel/testcases/type-propagation/arithmetic.baseline.txt
new file mode 100644
index 0000000..8a8496d
--- /dev/null
+++ b/pkg/kernel/testcases/type-propagation/arithmetic.baseline.txt
@@ -0,0 +1,18 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+static method foo(core::int/core::int* {int} x, core::int/core::int* {int} y) → core::int/core::int* {int} {
+  dynamic/core::num* {int,double} z = x.+(y);
+  return z.<<(4);
+}
+static method loop(core::List<dynamic>/core::List* {other} xs) → void/Null {
+  core::int/core::int* {int} _ = xs.length;
+  for (core::int/core::num* {int,double} i = 0; i.<(xs.length); i = i.+(1)) {
+  }
+}
+static method main() → dynamic/Null {
+  self::foo(4, 5);
+  self::foo(6, 7);
+  self::loop(<dynamic>["dfg"]);
+}
diff --git a/pkg/kernel/testcases/type-propagation/async_function.baseline.txt b/pkg/kernel/testcases/type-propagation/async_function.baseline.txt
new file mode 100644
index 0000000..6735807
--- /dev/null
+++ b/pkg/kernel/testcases/type-propagation/async_function.baseline.txt
@@ -0,0 +1,31 @@
+library;
+import self as self;
+import "dart:async" as asy;
+import "dart:core" as core;
+
+static field core::List<core::String>/core::List* {other} stringList = <dynamic>["bar"];
+static method asyncString() → asy::Future<core::String>/core::String* {string} async {
+  return "foo";
+}
+static method asyncString2() → asy::Future<core::String>/core::String* {string} async {
+  return self::asyncString();
+}
+static method syncStarString() → core::Iterable<core::String>/Null sync* {
+  yield "foo";
+  yield* self::syncStarString2();
+  yield* self::stringList;
+}
+static method syncStarString2() → core::Iterable<core::String>/Null sync* {
+  yield "foo";
+}
+static method asyncStarString() → asy::Stream<core::String>/Null async* {
+  yield "foo";
+  yield* self::asyncStarString2();
+  yield await self::asyncString();
+}
+static method asyncStarString2() → asy::Stream<core::String>/Null async* {
+  yield "bar";
+}
+static method main() → dynamic/Null async {
+  core::String/core::Object* {*} str = await self::asyncString();
+}
diff --git a/pkg/kernel/testcases/type-propagation/bad_store.baseline.txt b/pkg/kernel/testcases/type-propagation/bad_store.baseline.txt
new file mode 100644
index 0000000..fa01512
--- /dev/null
+++ b/pkg/kernel/testcases/type-propagation/bad_store.baseline.txt
@@ -0,0 +1,24 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  field dynamic/core::String* {null,string} field = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+static method identity(dynamic/self::Foo! {other} x) → dynamic/self::Foo! {other}
+  return x;
+static method use(dynamic/core::String* {null,string} x) → void/Null {}
+static method main(core::List<core::String>/Nothing args) → dynamic/Null {
+  dynamic/self::Foo! {other} foo = self::identity(new self::Foo::•());
+  if(args.length.>(1)) {
+    foo.field = "string";
+    dynamic/core::String* {null,string} first = foo.field;
+    self::use(first);
+    foo.noField = "string";
+    dynamic/Nothing second = foo.noField;
+    self::use(second);
+  }
+}
diff --git a/pkg/kernel/testcases/type-propagation/call.baseline.txt b/pkg/kernel/testcases/type-propagation/call.baseline.txt
new file mode 100644
index 0000000..2198610
--- /dev/null
+++ b/pkg/kernel/testcases/type-propagation/call.baseline.txt
@@ -0,0 +1,48 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Callable extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method call(dynamic/core::int* {int} x) → dynamic/core::String* {string} {
+    return "string";
+  }
+}
+class CallableGetter extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  get call() → dynamic/self::Callable! {other}
+    return new self::Callable::•();
+}
+static method main() → dynamic/Null {
+  dynamic/core::Function* {other} closure = (dynamic/core::int* {int} x) → dynamic/core::int* {int} => x;
+  dynamic/core::int* {int} int1 = closure.call(1);
+  dynamic/core::int* {int} int2 = closure.call(1);
+  dynamic/core::int* {int} int3 = closure.call.call(1);
+  dynamic/core::int* {int} int4 = closure.call.call.call(1);
+  dynamic/self::Callable! {other} callable = new self::Callable::•();
+  dynamic/core::String* {string} string1 = callable.call(1);
+  dynamic/core::String* {string} string2 = callable.call(1);
+  dynamic/core::String* {string} string3 = callable.call.call(1);
+  dynamic/core::String* {string} string4 = callable.call.call.call(1);
+  dynamic/self::CallableGetter! {other} callableGetter = new self::CallableGetter::•();
+  dynamic/core::String* {string} string5 = callableGetter.call(1);
+  dynamic/core::String* {string} string6 = callableGetter.call(1);
+  dynamic/core::String* {string} string7 = callableGetter.call.call(1);
+  dynamic/core::String* {string} string8 = callableGetter.call.call.call(1);
+  dynamic/Nothing nothing1 = closure.call();
+  dynamic/Nothing nothing2 = closure.call();
+  dynamic/Nothing nothing3 = closure.call.call();
+  dynamic/Nothing nothing4 = closure.call.call.call();
+  dynamic/Nothing nothing5 = callable.call();
+  dynamic/Nothing nothing6 = callable.call();
+  dynamic/Nothing nothing7 = callable.call.call();
+  dynamic/Nothing nothing8 = callable.call.call.call();
+  dynamic/Nothing nothing9 = callableGetter.call();
+  dynamic/Nothing nothing10 = callableGetter.call();
+  dynamic/Nothing nothing11 = callableGetter.call.call();
+  dynamic/Nothing nothing12 = callableGetter.call.call.call();
+}
diff --git a/pkg/kernel/testcases/type-propagation/closure.baseline.txt b/pkg/kernel/testcases/type-propagation/closure.baseline.txt
new file mode 100644
index 0000000..abb3a73
--- /dev/null
+++ b/pkg/kernel/testcases/type-propagation/closure.baseline.txt
@@ -0,0 +1,27 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  field dynamic/self::Bar! {other} _field = new self::Bar::•();
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class Bar extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+static method useCallback(dynamic/core::Function* {other} callback) → dynamic/Null {
+  dynamic/self::Foo! {other} _ = callback.call();
+}
+static method main() → dynamic/Null {
+  dynamic/self::Foo! {null,other} x;
+  function inner() → dynamic/self::Foo! {other} {
+    x = new self::Foo::•();
+    return new self::Foo::•();
+  }
+  self::useCallback(inner);
+  dynamic/self::Bar! {other} _ = inner.call()._field;
+}
diff --git a/pkg/kernel/testcases/type-propagation/escape.baseline.txt b/pkg/kernel/testcases/type-propagation/escape.baseline.txt
new file mode 100644
index 0000000..f7ece34
--- /dev/null
+++ b/pkg/kernel/testcases/type-propagation/escape.baseline.txt
@@ -0,0 +1,50 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+  field dynamic/Null field = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class B extends core::Object {
+  field dynamic/core::int* {null,int} field = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class C extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  operator ==(dynamic/Nothing x) → dynamic/core::bool* {other}
+    return false;
+}
+class X extends core::Object implements self::A, self::B {
+  field dynamic/core::int* {null,int} field = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+static method useAsA(self::A/self::A* {other} object) → void/Null {
+  dynamic/core::int* {null,int} _ = object.field;
+}
+static method useAsB(self::B/self::B* {other} object) → void/Null {
+  dynamic/core::int* {null,int} _ = object.field;
+  self::escape(object);
+}
+static method escape(dynamic/core::Object+ {int,string,other} x) → void/Null {
+  x.==(null) ? x = "" : null;
+  x.==(null) ? x = 45 : null;
+  if(!(x is core::int) && !(x is core::String)) {
+    x.field = 45;
+  }
+}
+static method main() → dynamic/Null {
+  dynamic/self::X! {other} object = new self::X::•();
+  self::useAsA(new self::A::•());
+  self::useAsA(object);
+  self::useAsB(new self::B::•());
+  self::useAsB(object);
+}
diff --git a/pkg/kernel/testcases/type-propagation/external.baseline.txt b/pkg/kernel/testcases/type-propagation/external.baseline.txt
new file mode 100644
index 0000000..c80d0b4
--- /dev/null
+++ b/pkg/kernel/testcases/type-propagation/external.baseline.txt
@@ -0,0 +1,16 @@
+library;
+import self as self;
+import "dart:core" as core;
+import "dart:isolate" as iso;
+
+static field dynamic/dart.async::StreamSubscription* {null,other} subscription = null;
+static method onData(dynamic/core::Object* {*} x) → void/Null {
+  core::print(x);
+  self::subscription.cancel();
+}
+static method main() → dynamic/Null {
+  dynamic/core::String* {string} string = core::String::fromCharCode(65);
+  dynamic/iso::ReceivePort* {other} port = iso::ReceivePort::•();
+  self::subscription = port.listen(self::onData);
+  port.sendPort.send(string);
+}
diff --git a/pkg/kernel/testcases/type-propagation/fallthrough.baseline.txt b/pkg/kernel/testcases/type-propagation/fallthrough.baseline.txt
new file mode 100644
index 0000000..1d635f0
--- /dev/null
+++ b/pkg/kernel/testcases/type-propagation/fallthrough.baseline.txt
@@ -0,0 +1,38 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+static method main(core::List<core::String>/Nothing args) → void/Null {
+  dynamic/core::int* {int} x = args.length;
+  #L1:
+  switch(x) {
+    #L2:
+    case 3:
+      {
+        x = 4;
+        throw new core::FallThroughError::•();
+      }
+    #L3:
+    case 5:
+      {
+        break #L1;
+      }
+    #L4:
+    case 6:
+    case 7:
+      {
+        if(args.[](0).==("")) {
+          break #L1;
+        }
+        else {
+          return;
+        }
+        throw new core::FallThroughError::•();
+      }
+    #L5:
+    case 4:
+      {
+        break #L1;
+      }
+  }
+}
diff --git a/pkg/kernel/testcases/type-propagation/micro.baseline.txt b/pkg/kernel/testcases/type-propagation/micro.baseline.txt
new file mode 100644
index 0000000..ccde2c4
--- /dev/null
+++ b/pkg/kernel/testcases/type-propagation/micro.baseline.txt
@@ -0,0 +1,81 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method instanceMethod() → dynamic/core::int* {int} {
+    return 123;
+  }
+}
+abstract class ExternalValue extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+abstract class Bar extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  abstract method externalInstanceMethod() → self::ExternalValue/<missing type>;
+}
+class Box extends core::Object {
+  field dynamic/core::String* {null,string} field = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class FinalBox extends core::Object {
+  final field dynamic/core::String* {string} finalField;
+  constructor •(dynamic/core::String* {string} finalField) → void
+    : self::FinalBox::finalField = finalField, super core::Object::•()
+    ;
+}
+class SubFinalBox extends self::FinalBox {
+  constructor •(dynamic/core::String* {string} value) → void
+    : super self::FinalBox::•(value)
+    ;
+}
+class DynamicReceiver1 extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method dynamicallyCalled(dynamic/core::String* {string} x) → dynamic/Null {}
+}
+class DynamicReceiver2 extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method dynamicallyCalled(dynamic/core::String* {string} x) → dynamic/Null {}
+}
+static method staticMethod() → dynamic/core::String* {string} {
+  return "sdfg";
+}
+external static method externalStatic() → core::bool/core::bool* {other};
+external static method createBar() → self::Bar/self::Bar* {other};
+static method stringArgument(dynamic/core::String* {string} x) → dynamic/Null {}
+static method intArgument(dynamic/core::int* {int} x) → dynamic/Null {}
+static method makeDynamicCall(dynamic/core::Object+ {other} receiver) → void/Null {
+  receiver.dynamicallyCalled("sdfg");
+}
+static method main() → dynamic/Null {
+  dynamic/core::String* {string} x = self::staticMethod();
+  dynamic/core::int* {int} y = new self::Foo::•().instanceMethod();
+  dynamic/core::bool* {other} z = self::externalStatic();
+  dynamic/self::ExternalValue* {other} w = self::createBar().externalInstanceMethod();
+  self::stringArgument("sdfg");
+  self::intArgument(42);
+  dynamic/self::Box! {other} box = new self::Box::•();
+  box.field = "sdfg";
+  dynamic/core::String* {null,string} a = box.field;
+  dynamic/self::FinalBox! {other} finalBox = new self::FinalBox::•("dfg");
+  dynamic/core::String* {string} b = finalBox.finalField;
+  dynamic/self::SubFinalBox! {other} subBox = new self::SubFinalBox::•("dfg");
+  dynamic/core::String* {string} c = subBox.finalField;
+  self::makeDynamicCall(new self::DynamicReceiver1::•());
+  self::makeDynamicCall(new self::DynamicReceiver2::•());
+  dynamic/core::List* {other} list = <dynamic>["string"];
+  dynamic/core::Object+ {*} d = list.[](0);
+}
diff --git a/pkg/kernel/testcases/type-propagation/named_parameters.baseline.txt b/pkg/kernel/testcases/type-propagation/named_parameters.baseline.txt
new file mode 100644
index 0000000..d005aa2
--- /dev/null
+++ b/pkg/kernel/testcases/type-propagation/named_parameters.baseline.txt
@@ -0,0 +1,31 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Superclass extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method foo({dynamic/Null alpha, dynamic/Null beta}) → dynamic/Null {}
+  method bar({dynamic/Null beta, dynamic/Null alpha}) → dynamic/Null {}
+  method namedCallback(({alpha: core::String, beta: core::int}) → dynamic/Nothing callback) → dynamic/Null {
+    callback.call(alpha: "one", beta: 2);
+    callback.call(beta: 1, alpha: "two");
+  }
+}
+class Subclass extends self::Superclass {
+  constructor •() → void
+    : super self::Superclass::•()
+    ;
+  method foo({dynamic/core::int* {null,int} beta, dynamic/core::int* {null,int} alpha}) → dynamic/Null {}
+  method bar({dynamic/Null alpha, dynamic/Null beta}) → dynamic/Null {}
+  method namedCallback(({alpha: core::String, beta: core::int}) → dynamic/Nothing callback) → dynamic/Null {}
+}
+static method topLevelNamed(dynamic/core::int* {int} beta, dynamic/core::int* {int} alpha, {dynamic/core::int* {null,int} gamma, dynamic/core::int* {null,int} delta}) → dynamic/Null {}
+static method topLevelOptional(dynamic/Nothing beta, dynamic/Nothing alpha, [dynamic/Null gamma, dynamic/Null delta]) → dynamic/Null {}
+static method main() → dynamic/Null {
+  new self::Subclass::•().foo(beta: 1, alpha: 2);
+  new self::Subclass::•().foo(alpha: 1, beta: 2);
+  self::topLevelNamed(1, 2, gamma: 3, delta: 4);
+  self::topLevelNamed(1, 2, delta: 3, gamma: 4);
+}
diff --git a/pkg/kernel/testcases/type-propagation/null_aware.baseline.txt b/pkg/kernel/testcases/type-propagation/null_aware.baseline.txt
new file mode 100644
index 0000000..7e706e1
--- /dev/null
+++ b/pkg/kernel/testcases/type-propagation/null_aware.baseline.txt
@@ -0,0 +1,22 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  field core::int/core::int* {null,int} field = null;
+  static field core::int/core::int* {null,int} staticField = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+static method main() → dynamic/Null {
+  self::Foo/self::Foo! {other} foo = new self::Foo::•();
+  let final dynamic/<missing type> #t1 = foo in #t1.==(null) ? null : #t1.field = 5;
+  self::Foo::staticField = 5;
+  let final dynamic/<missing type> #t2 = foo in #t2.field.==(null) ? #t2.field = 5 : null;
+  self::Foo::staticField.==(null) ? self::Foo::staticField = 5 : null;
+  let final dynamic/<missing type> #t3 = foo in #t3.==(null) ? null : #t3.field.==(null) ? #t3.field = 5 : null;
+  self::Foo::staticField.==(null) ? self::Foo::staticField = 5 : null;
+  core::int/core::int* {null,int} intValue = let final dynamic/<missing type> #t4 = foo.field in #t4.==(null) ? 6 : #t4;
+  core::num/core::num* {null,int,double} numValue = let final dynamic/<missing type> #t5 = foo.field in #t5.==(null) ? 4.5 : #t5;
+}
diff --git a/pkg/kernel/testcases/type-propagation/optional.baseline.txt b/pkg/kernel/testcases/type-propagation/optional.baseline.txt
new file mode 100644
index 0000000..cc8f47e
--- /dev/null
+++ b/pkg/kernel/testcases/type-propagation/optional.baseline.txt
@@ -0,0 +1,61 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method method(dynamic/core::int* {int} x, [dynamic/core::int* {null,int} y, dynamic/core::int* {null,int} z]) → dynamic/core::String* {string} {
+    return "string";
+  }
+}
+abstract class External extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  abstract method externalMethod(core::int/<missing type> x, [core::int/<missing type> y, core::int/<missing type> z]) → core::String/<missing type>;
+  abstract method listen(self::Listener/<missing type> listener) → void/<missing type>;
+}
+abstract class Listener extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  abstract method event(core::String/<missing type> input, [core::int/<missing type> x, core::int/<missing type> y]) → void/<missing type>;
+}
+class TestListener extends self::Listener {
+  constructor •() → void
+    : super self::Listener::•()
+    ;
+  method event(dynamic/core::String* {string} input, [dynamic/core::int* {null,int} x, dynamic/core::int* {null,int} y]) → void/Null {}
+}
+class ExtendedListener extends self::Listener {
+  constructor •() → void
+    : super self::Listener::•()
+    ;
+  method event(dynamic/core::String* {string} input, [dynamic/core::int* {null,int} x, dynamic/core::int* {null,int} y, dynamic/Null z]) → void/Null {}
+}
+class InvalidListener extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method event(dynamic/core::String* {string} input, [dynamic/core::int* {null,int} x]) → void/Null {}
+}
+external static method createExternal() → self::External/self::External* {other};
+static method main() → dynamic/Null {
+  dynamic/self::Foo! {other} foo = new self::Foo::•();
+  dynamic/core::String* {string} string1 = foo.method(1);
+  dynamic/core::String* {string} string2 = foo.method(1, 2);
+  dynamic/core::String* {string} string3 = foo.method(1, 2, 3);
+  dynamic/self::External* {other} extern = self::createExternal();
+  dynamic/core::String* {string} string4 = extern.externalMethod(1);
+  dynamic/core::String* {string} string5 = extern.externalMethod(1, 2);
+  dynamic/core::String* {string} string6 = extern.externalMethod(1, 2, 3);
+  extern.listen(new self::TestListener::•());
+  extern.listen(new self::ExtendedListener::•());
+  extern.listen(new self::InvalidListener::•());
+  dynamic/Nothing nothing1 = foo.method();
+  dynamic/Nothing nothing2 = foo.method(1, 2, 3, 4);
+  dynamic/Nothing nothing3 = extern.externalMethod();
+  dynamic/Nothing nothing4 = extern.externalMethod(1, 2, 3, 4);
+}
diff --git a/pkg/kernel/testcases/type-propagation/override.baseline.txt b/pkg/kernel/testcases/type-propagation/override.baseline.txt
new file mode 100644
index 0000000..89d7c33
--- /dev/null
+++ b/pkg/kernel/testcases/type-propagation/override.baseline.txt
@@ -0,0 +1,35 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class Bar extends self::Foo {
+  constructor •() → void
+    : super self::Foo::•()
+    ;
+}
+class Base extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method method() → self::Foo/self::Foo! {other} {
+    return new self::Foo::•();
+  }
+}
+class Sub extends self::Base {
+  constructor •() → void
+    : super self::Base::•()
+    ;
+  method method() → self::Foo/self::Bar! {other} {
+    return new self::Bar::•();
+  }
+}
+static method main(core::List<core::String>/Nothing args) → dynamic/Null {
+  dynamic/self::Base+ {other} object = args.length.==(0) ? new self::Base::•() : new self::Sub::•();
+  dynamic/self::Foo+ {other} a = object.method();
+  core::print(a);
+}
diff --git a/pkg/kernel/testcases/type-propagation/prefer_baseclass.baseline.txt b/pkg/kernel/testcases/type-propagation/prefer_baseclass.baseline.txt
new file mode 100644
index 0000000..c54543b
--- /dev/null
+++ b/pkg/kernel/testcases/type-propagation/prefer_baseclass.baseline.txt
@@ -0,0 +1,42 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class B extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class AB1 extends self::A implements self::B {
+  constructor •() → void
+    : super self::A::•()
+    ;
+}
+class AB2 extends self::A implements self::B {
+  constructor •() → void
+    : super self::A::•()
+    ;
+}
+class BA1 extends self::B implements self::A {
+  constructor •() → void
+    : super self::B::•()
+    ;
+}
+class BA2 extends self::B implements self::A {
+  constructor •() → void
+    : super self::B::•()
+    ;
+}
+static method takeSubclassOfA(dynamic/self::A+ {other} obj) → dynamic/Null {}
+static method takeSubclassOfB(dynamic/self::B+ {other} obj) → dynamic/Null {}
+static method main() → dynamic/Null {
+  self::takeSubclassOfA(new self::AB1::•());
+  self::takeSubclassOfA(new self::AB2::•());
+  self::takeSubclassOfB(new self::BA1::•());
+  self::takeSubclassOfB(new self::BA2::•());
+}
diff --git a/pkg/kernel/testcases/type-propagation/redirecting_factory.baseline.txt b/pkg/kernel/testcases/type-propagation/redirecting_factory.baseline.txt
new file mode 100644
index 0000000..20a2d4c
--- /dev/null
+++ b/pkg/kernel/testcases/type-propagation/redirecting_factory.baseline.txt
@@ -0,0 +1,53 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+abstract class FooBase<Tf extends core::Object> extends core::Object {
+  abstract get x() → core::int/<missing type>;
+}
+abstract class Foo<T extends core::Object> extends core::Object implements self::FooBase<dynamic> {
+}
+class Bar<Sb extends core::Object, Tb extends core::Object> extends core::Object implements self::Foo<self::Bar::Tb> {
+  field core::int/core::int* {int} x;
+  constructor •(core::int/core::int* {int} x) → void
+    : self::Bar::x = x, super core::Object::•() {
+    core::print("Bar<${self::Bar::Sb},${self::Bar::Tb}>");
+  }
+}
+class Builder<X extends core::Object> extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  method method() → dynamic/self::Bar! {other} {
+    return new self::Bar::•<core::String, self::Builder::X>(4);
+  }
+}
+class SimpleCase<A extends core::Object, B extends core::Object> extends core::Object {
+}
+class SimpleCaseImpl<Ai extends core::Object, Bi extends core::Object> extends core::Object implements self::SimpleCase<self::SimpleCaseImpl::Ai, self::SimpleCaseImpl::Bi> {
+}
+class SimpleCaseImpl2<Ai2 extends core::Object, Bi2 extends core::Object> extends core::Object implements self::SimpleCaseImpl<self::SimpleCaseImpl2::Ai2, self::SimpleCaseImpl2::Bi2> {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class Base<M extends core::Object> extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class Mixin<M extends core::Object> extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class Mix<M extends core::Object> extends self::Base<self::Mix::M> implements self::Mixin<self::Mix::M> {
+  constructor •() → void
+    : super self::Base::•()
+    ;
+}
+static method main() → dynamic/Null {
+  core::print(new self::Bar::•<core::String, core::double>(4).x);
+  new self::SimpleCaseImpl2::•<core::int, core::double>();
+  new self::Mix::•<core::double>();
+}
diff --git a/pkg/kernel/testcases/type-propagation/static_setter.baseline.txt b/pkg/kernel/testcases/type-propagation/static_setter.baseline.txt
new file mode 100644
index 0000000..6bf6f26
--- /dev/null
+++ b/pkg/kernel/testcases/type-propagation/static_setter.baseline.txt
@@ -0,0 +1,13 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+static set foo(dynamic/self::Foo! {other} x) → dynamic/Null {}
+static method main() → dynamic/Null {
+  self::foo = new self::Foo::•();
+}
diff --git a/pkg/kernel/testcases/type-propagation/store_load.baseline.txt b/pkg/kernel/testcases/type-propagation/store_load.baseline.txt
new file mode 100644
index 0000000..0e1c0ee
--- /dev/null
+++ b/pkg/kernel/testcases/type-propagation/store_load.baseline.txt
@@ -0,0 +1,36 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  field dynamic/self::FooValue! {null,other} _field = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class FooValue extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class Bar extends core::Object {
+  field dynamic/self::BarValue! {null,other} _field = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class BarValue extends core::Object {
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+static method main() → dynamic/Null {
+  dynamic/self::Foo! {other} foo = new self::Foo::•();
+  foo._field = new self::FooValue::•();
+  dynamic/self::FooValue! {null,other} fooValue = foo._field;
+  core::print(fooValue);
+  dynamic/self::Bar! {other} bar = new self::Bar::•();
+  bar._field = new self::BarValue::•();
+  dynamic/self::BarValue! {null,other} barValue = bar._field;
+  core::print(barValue);
+}
diff --git a/pkg/kernel/testcases/type-propagation/stringliteral.baseline.txt b/pkg/kernel/testcases/type-propagation/stringliteral.baseline.txt
new file mode 100644
index 0000000..ded8c03
--- /dev/null
+++ b/pkg/kernel/testcases/type-propagation/stringliteral.baseline.txt
@@ -0,0 +1,10 @@
+library;
+import self as self;
+
+static field dynamic/dart.core::String* {string} color = "brown";
+static field dynamic/dart.core::String* {string} thing = "lazy dog";
+static field dynamic/dart.core::String* {string} phrase = "The quick ${self::color} fox\njumped over the ${self::thing}.\n";
+static field dynamic/dart.core::String* {string} adjacent = "${self::color}${self::color}${self::color}";
+static field dynamic/dart.core::String* {string} linebreaks = "${self::color}\n${self::color}\n${self::color}";
+static field dynamic/dart.core::String* {string} other = "${self::color}\n is \n${self::color}";
+static method main() → dynamic/Null {}
diff --git a/pkg/kernel/testcases/type-propagation/uninitialized_fields.baseline.txt b/pkg/kernel/testcases/type-propagation/uninitialized_fields.baseline.txt
new file mode 100644
index 0000000..d9a8ef5
--- /dev/null
+++ b/pkg/kernel/testcases/type-propagation/uninitialized_fields.baseline.txt
@@ -0,0 +1,37 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Uninitialized extends core::Object {
+  field core::int/Null x = null;
+  constructor •() → void
+    : super core::Object::•()
+    ;
+}
+class PartiallyInitialized extends core::Object {
+  field core::int/Null x = null;
+  constructor •(core::int/Nothing x) → void
+    : self::PartiallyInitialized::x = x, super core::Object::•()
+    ;
+  constructor noInitializer() → void
+    : super core::Object::•()
+    ;
+}
+class Initialized extends core::Object {
+  field core::int/Nothing x;
+  constructor •(core::int/Nothing x) → void
+    : self::Initialized::x = x, super core::Object::•()
+    ;
+}
+class Forwarding extends core::Object {
+  field core::int/Null x;
+  constructor initialize(core::int/Nothing x) → void
+    : self::Forwarding::x = x, super core::Object::•()
+    ;
+  constructor •(core::int/Nothing arg) → void
+    : this self::Forwarding::initialize(arg)
+    ;
+}
+static field core::int/Null uninitializedTopLevel = null;
+static field core::int/core::int* {int} initializedTopLevel = 4;
+static method main() → dynamic/Null {}
diff --git a/pkg/kernel/testcases/type-propagation/void-methods.baseline.txt b/pkg/kernel/testcases/type-propagation/void-methods.baseline.txt
new file mode 100644
index 0000000..72fa578
--- /dev/null
+++ b/pkg/kernel/testcases/type-propagation/void-methods.baseline.txt
@@ -0,0 +1,21 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo extends core::Object {
+  field core::List<dynamic>/core::List* {other} list = <dynamic>[1, 2, 3];
+  constructor •() → void
+    : super core::Object::•()
+    ;
+  set first(dynamic/core::int* {int} x) → dynamic/Null
+    this.list.[]=(0, x);
+  operator []=(dynamic/core::int* {int} x, dynamic/core::int* {int} y) → dynamic/Null
+    this.list.[]=(x, y);
+  method clear() → void/Null
+    return this.list.clear();
+}
+static method main() → dynamic/Null {
+  new self::Foo::•().first = 4;
+  new self::Foo::•().[]=(3, 4);
+  new self::Foo::•().clear();
+}
diff --git a/pkg/meta/lib/meta.dart b/pkg/meta/lib/meta.dart
index 9842875..44f71b8 100644
--- a/pkg/meta/lib/meta.dart
+++ b/pkg/meta/lib/meta.dart
@@ -18,6 +18,14 @@
 /// in the language tour.
 library meta;
 
+/// Used to annotate a parameter of an instance method that overrides another
+/// method.
+///
+/// Indicates that this parameter may have a tighter type than the parameter on
+/// its superclass. The actual argument will be checked at runtime to ensure it
+/// is a subtype of the overridden parameter type.
+const _Checked checked = const _Checked();
+
 /// Used to annotate an instance or static method `m`. Indicates that `m` must
 /// either be abstract or must return a newly allocated object or `null`. In
 /// addition, every method that either implements or overrides `m` is implicitly
@@ -30,6 +38,18 @@
 ///   can return anything other than a newly allocated object or `null`.
 const _Factory factory = const _Factory();
 
+/// Used to annotate a class `C`. Indicates that `C` and all subtypes of `C`
+/// must be immutable.
+///
+/// A class is immutable if all of the instance fields of the class, whether
+/// defined directly or inherited, are `final`.
+///
+/// Tools, such as the analyzer, can provide feedback if
+/// * the annotation is associated with anything other than a class, or
+/// * a class that has this annotation or extends, implements or mixes in a
+///   class that has this annotation is not immutable.
+const Immutable immutable = const Immutable();
+
 /// Used to annotate a const constructor `c`. Indicates that any invocation of
 /// the constructor must use the keyword `const` unless one or more of the
 /// arguments to the constructor is not a compile-time constant.
@@ -97,6 +117,21 @@
 ///   corresponding to a named parameter that has this annotation.
 const Required required = const Required();
 
+/// Used to annotate a field that is allowed to be overridden in Strong Mode.
+const _Virtual virtual = const _Virtual();
+
+/// Used to annotate an instance member that was made public so that it could be
+/// overridden but that is not intended to be referenced from outside the
+/// defining library.
+///
+/// Tools, such as the analyzer, can provide feedback if
+///
+/// * the annotation is associated with a declaration other than a public
+///   instance member in a class, or
+/// * the member is referenced outside of the defining library.
+const _VisibleForOverriding visibleForOverriding =
+    const _VisibleForOverriding();
+
 /// Used to annotate a declaration was made public, so that it is more visible
 /// than otherwise necessary, to make code testable.
 ///
@@ -109,6 +144,17 @@
 ///   library which is in the `test` folder of the defining package.
 const _VisibleForTesting visibleForTesting = const _VisibleForTesting();
 
+/// Used to annotate a class.
+///
+/// See [immutable] for more details.
+class Immutable {
+  /// A human-readable explanation of the reason why the class is immutable.
+  final String reason;
+
+  /// Initialize a newly created instance to have the given [reason].
+  const Immutable([this.reason]);
+}
+
 /// Used to annotate a named parameter `p` in a method or function `f`.
 ///
 /// See [required] for more details.
@@ -128,17 +174,6 @@
   const Required([this.reason]);
 }
 
-/// Used to annotate a parameter of an instance method that overrides another
-/// method.
-///
-/// Indicates that this parameter may have a tighter type than the parameter on
-/// its superclass. The actual argument will be checked at runtime to ensure it
-/// is a subtype of the overridden parameter type.
-const _Checked checked = const _Checked();
-
-/// Used to annotate a field is allowed to be overridden in Strong Mode.
-const _Virtual virtual = const _Virtual();
-
 class _Checked {
   const _Checked();
 }
@@ -167,6 +202,10 @@
   const _Virtual();
 }
 
+class _VisibleForOverriding {
+  const _VisibleForOverriding();
+}
+
 class _VisibleForTesting {
   const _VisibleForTesting();
 }
diff --git a/pkg/pkg.status b/pkg/pkg.status
index db253b5..17e515b 100644
--- a/pkg/pkg.status
+++ b/pkg/pkg.status
@@ -26,6 +26,7 @@
 mutation_observer: Skip # Issue 21149
 unittest/*: Skip # Issue 21949
 lookup_map/*: SkipByDesign
+front_end/*: SkipByDesign
 
 [ $runtime == vm && $mode == debug ]
 analysis_server/test/completion_test: Pass, Slow
@@ -34,6 +35,7 @@
 analysis_server/test/completion_test: Pass, Slow
 
 [ $runtime == vm && $system == windows]
+analysis_server/*: Skip # Issue 27557
 analysis_server/test/analysis/get_errors_test: Skip # runtime error, Issue 22180
 analysis_server/test/integration/analysis/analysis_options_test: RuntimeError # Issue 24796
 analyzer/test/generated/all_the_rest_test: Fail # Issue 21772
@@ -48,8 +50,15 @@
 collection/test/equality_test/04: Fail # Issue 1533
 collection/test/equality_test/05: Fail # Issue 1533
 collection/test/equality_test/none: Pass, Fail # Issue 14348
+compiler/tool/*: SkipByDesign # Only meant to run on vm
+front_end/tool/*: SkipByDesign # Only meant to run on vm
 lookup_map/test/version_check_test: SkipByDesign # Only meant to run in vm.
 typed_data/test/typed_buffers_test/01: Fail # Not supporting Int64List, Uint64List.
+front_end/test/memory_file_system_test: CompileTimeError # Issue 23773
+front_end/test/physical_file_system_test: SkipByDesign # Uses dart:io
+
+[ $compiler == dart2js && $fast_startup ]
+front_end/test/*: SkipByDesign # Tests written with dart:mirrors.
 
 [ $compiler == dart2js && $builder_tag != dart2js_analyzer ]
 analyzer/test/*: Skip # Issue 26813
@@ -62,6 +71,8 @@
 [ $runtime == jsshell ]
 async/test/stream_zip_test: RuntimeError, OK # Issue 26103. Timers are not supported.
 lookup_map/test/lookup_map_test: RuntimeError, OK # Issue 26103. Timers are not supported.
+front_end/test/*: RuntimeError, OK # Issue 26103. Timers are not supported.
+kernel/test/*: RuntimeError, OK # Issue 26103. Timers are not supported.
 
 [ $compiler == dart2js && $runtime == drt ]
 async/test/stream_zip_test: RuntimeError, Pass # Issue 18548
@@ -95,6 +106,8 @@
 analyzer/tool/task_dependency_graph/check_test: SkipByDesign # Uses dart:io.
 analyzer/tool/summary/check_test: SkipByDesign # Uses dart:io.
 analyzer2dart/*: SkipByDesign # Uses dart:io.
+compiler/tool/*: SkipByDesign # Only meant to run on vm
+front_end/tool/*: SkipByDesign # Only meant to run on vm
 http_server/test/*: Fail, OK # Uses dart:io.
 observe/test/transformer_test: Fail, OK # Uses dart:io.
 observe/test/unique_message_test: SkipByDesign  # Uses dart:io.
diff --git a/pkg/pkg_files.gyp b/pkg/pkg_files.gyp
index 9dd13e3..55dd284 100644
--- a/pkg/pkg_files.gyp
+++ b/pkg/pkg_files.gyp
@@ -9,8 +9,8 @@
     # This target lists all the files in pkg and third_party/pkg,
     # and creates the timestamp pkg_files.stamp, which depends on some
     # intermediate helper timestamps.
-    # We split third_party/pkg up into three groups, based on the last
-    # character before .dart at the end of the filename.
+    # We split third_party/pkg up into three groups, based on the first letter
+    # of the package name.
     {
       'target_name': 'pkg_files_stamp',
       'type': 'none',
@@ -19,12 +19,10 @@
           'action_name': 'make_pkg_files_stamp',
           'inputs': [
             '../tools/create_timestamp_file.py',
-            '<!@(["python", "../tools/list_files.py",'
-                '"^(?!.*/test/).*(?<!_test)[.]dart$",'
-                '"."])',
-            '<(SHARED_INTERMEDIATE_DIR)/third_party_pkg_files_1.stamp',
-            '<(SHARED_INTERMEDIATE_DIR)/third_party_pkg_files_2.stamp',
-            '<(SHARED_INTERMEDIATE_DIR)/third_party_pkg_files_3.stamp',
+            '<!@(["python", "../tools/list_dart_files.py", "."])',
+            '<(SHARED_INTERMEDIATE_DIR)/third_party_pkg_files_a_k.stamp',
+            '<(SHARED_INTERMEDIATE_DIR)/third_party_pkg_files_l_r.stamp',
+            '<(SHARED_INTERMEDIATE_DIR)/third_party_pkg_files_s_z.stamp',
           ],
           'outputs': [
             '<(SHARED_INTERMEDIATE_DIR)/pkg_files.stamp',
@@ -35,15 +33,13 @@
           ],
         },
         {
-          'action_name': 'make_third_party_pkg_files_1_stamp',
+          'action_name': 'make_third_party_pkg_files_a_k_stamp',
           'inputs': [
             '../tools/create_timestamp_file.py',
-            '<!@(["python", "../tools/list_files.py",'
-                '"^(?!.*_test\.dart).*[a-k]\.dart$",'
-                '"../third_party/pkg"])',
+            '<!@(["python", "../tools/list_dart_files.py", "../third_party/pkg", "[a-k].*"])',
           ],
           'outputs': [
-            '<(SHARED_INTERMEDIATE_DIR)/third_party_pkg_files_1.stamp',
+            '<(SHARED_INTERMEDIATE_DIR)/third_party_pkg_files_a_k.stamp',
           ],
           'action': [
             'python', '../tools/create_timestamp_file.py',
@@ -51,15 +47,13 @@
           ],
         },
         {
-          'action_name': 'make_third_party_pkg_files_2_stamp',
+          'action_name': 'make_third_party_pkg_files_l_r_stamp',
           'inputs': [
             '../tools/create_timestamp_file.py',
-            '<!@(["python", "../tools/list_files.py",'
-                '"^(?!.*_test\.dart).*[l-r]\.dart$",'
-                '"../third_party/pkg"])',
+            '<!@(["python", "../tools/list_dart_files.py", "../third_party/pkg", "[l-r].*"])',
           ],
           'outputs': [
-            '<(SHARED_INTERMEDIATE_DIR)/third_party_pkg_files_2.stamp',
+            '<(SHARED_INTERMEDIATE_DIR)/third_party_pkg_files_l_r.stamp',
           ],
           'action': [
             'python', '../tools/create_timestamp_file.py',
@@ -67,15 +61,13 @@
           ],
         },
         {
-          'action_name': 'make_third_party_pkg_files_3_stamp',
+          'action_name': 'make_third_party_pkg_files_s_z_stamp',
           'inputs': [
             '../tools/create_timestamp_file.py',
-            '<!@(["python", "../tools/list_files.py",'
-                '"^(?!.*_test\.dart).*[^a-r]\.dart$",'
-                '"../third_party/pkg"])',
+            '<!@(["python", "../tools/list_dart_files.py", "../third_party/pkg", "[s-z].*"])',
           ],
           'outputs': [
-            '<(SHARED_INTERMEDIATE_DIR)/third_party_pkg_files_3.stamp',
+            '<(SHARED_INTERMEDIATE_DIR)/third_party_pkg_files_s_z.stamp',
           ],
           'action': [
             'python', '../tools/create_timestamp_file.py',
diff --git a/pkg/pkgbuild.status b/pkg/pkgbuild.status
index 20e54e1..cefeb2f 100644
--- a/pkg/pkgbuild.status
+++ b/pkg/pkgbuild.status
@@ -7,6 +7,8 @@
 
 [ ($use_repository_packages || $use_public_packages) ]
 pkg/dev_compiler: SkipByDesign # we have relative paths to analyzer
+pkg/analyzer: Fail # Issue 27654
+pkg/front_end: Fail # Issue 27655
 
 [ $use_repository_packages ]
  # third_party/pkg/dart2js_info: Fail # Issue https://github.com/dart-lang/dart2js_info/pull/14
diff --git a/pkg/typed_mock/BUILD.gn b/pkg/typed_mock/BUILD.gn
new file mode 100644
index 0000000..b00e00b
--- /dev/null
+++ b/pkg/typed_mock/BUILD.gn
@@ -0,0 +1,11 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for 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("//build/dart/dart_package.gni")
+
+dart_package("typed_mock") {
+  package_name = "typed_mock"
+
+  source_dir = "lib"
+}
diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn
index afc963ab..8556ba2 100644
--- a/runtime/BUILD.gn
+++ b/runtime/BUILD.gn
@@ -31,18 +31,15 @@
 }
 
 config("dart_public_config") {
-  include_dirs = [
-    ".",
-  ]
+  include_dirs = [ "." ]
 }
 
 # Adds PRODUCT define if Flutter has specified "release" for dart_runtime_mode
 config("dart_maybe_product_config") {
   defines = []
 
-  if ((dart_runtime_mode != "develop") &&
-      (dart_runtime_mode != "profile") &&
-      (dart_runtime_mode != "release")) {
+  if (dart_runtime_mode != "develop" && dart_runtime_mode != "profile" &&
+      dart_runtime_mode != "release") {
     print("Invalid |dart_runtime_mode|")
     assert(false)
   }
@@ -52,7 +49,7 @@
       print("Debug and release mode are mutually exclusive.")
     }
     assert(!dart_debug)
-    defines += ["PRODUCT"]
+    defines += [ "PRODUCT" ]
   }
 }
 
@@ -61,9 +58,8 @@
 config("dart_maybe_precompiled_runtime_config") {
   defines = []
 
-  if ((dart_runtime_mode != "develop") &&
-      (dart_runtime_mode != "profile") &&
-      (dart_runtime_mode != "release")) {
+  if (dart_runtime_mode != "develop" && dart_runtime_mode != "profile" &&
+      dart_runtime_mode != "release") {
     print("Invalid |dart_runtime_mode|")
     assert(false)
   }
@@ -75,29 +71,29 @@
     assert(!dart_debug)
 
     if (!dart_experimental_interpreter) {
-      defines += ["DART_PRECOMPILED_RUNTIME"]
+      defines += [ "DART_PRECOMPILED_RUNTIME" ]
     }
   } else if (dart_runtime_mode == "profile") {
     if (!dart_experimental_interpreter) {
-      defines += ["DART_PRECOMPILED_RUNTIME"]
+      defines += [ "DART_PRECOMPILED_RUNTIME" ]
     }
   }
 }
 
 config("dart_precompiled_runtime_config") {
   defines = []
-  defines += ["DART_PRECOMPILED_RUNTIME"]
+  defines += [ "DART_PRECOMPILED_RUNTIME" ]
 }
 
 # Controls DART_PRECOMPILER #define.
 config("dart_precompiler_config") {
   defines = []
-  defines += ["DART_PRECOMPILER"]
+  defines += [ "DART_PRECOMPILER" ]
 }
 
 config("dart_no_snapshot_config") {
   defines = []
-  defines += ["DART_NO_SNAPSHOT"]
+  defines += [ "DART_NO_SNAPSHOT" ]
 }
 
 config("dart_config") {
@@ -108,81 +104,71 @@
   }
 
   if (dart_target_arch != "") {
-    if ((dart_target_arch == "arm") ||
-        (dart_target_arch == "simarm")) {
+    if (dart_target_arch == "arm" || dart_target_arch == "simarm") {
       defines += [ "TARGET_ARCH_ARM" ]
       if (target_os == "mac" || target_os == "ios") {
         defines += [ "TARGET_ABI_IOS" ]
       } else {
         defines += [ "TARGET_ABI_EABI" ]
       }
-    } else if ((dart_target_arch == "armv6") ||
-               (dart_target_arch == "simarmv6")) {
+    } else if (dart_target_arch == "armv6" || dart_target_arch == "simarmv6") {
       defines += [ "TARGET_ARCH_ARM" ]
       defines += [ "TARGET_ARCH_ARM_6" ]
       defines += [ "TARGET_ABI_EABI" ]
-    } else if ((dart_target_arch == "armv5te") ||
-               (dart_target_arch == "simarmv5te")) {
+    } else if (dart_target_arch == "armv5te" ||
+               dart_target_arch == "simarmv5te") {
       defines += [ "TARGET_ARCH_ARM" ]
       defines += [ "TARGET_ARCH_ARM_5TE" ]
       defines += [ "TARGET_ABI_EABI" ]
-    } else if ((dart_target_arch == "arm64") ||
-               (dart_target_arch == "simarm64")) {
+    } else if (dart_target_arch == "arm64" || dart_target_arch == "simarm64") {
       defines += [ "TARGET_ARCH_ARM64" ]
-    } else if ((dart_target_arch == "mips") ||
-               (dart_target_arch == "simmips")) {
+    } else if (dart_target_arch == "mips" || dart_target_arch == "simmips") {
       defines += [ "TARGET_ARCH_MIPS" ]
     } else if (dart_target_arch == "x64") {
       defines += [ "TARGET_ARCH_X64" ]
     } else if (dart_target_arch == "ia32") {
       defines += [ "TARGET_ARCH_IA32" ]
-    } else if ((dart_target_arch == "dbc") ||
-               (dart_target_arch == "simdbc") ||
-               (dart_target_arch == "simdbc64")) {
+    } else if (dart_target_arch == "dbc" || dart_target_arch == "simdbc" ||
+               dart_target_arch == "simdbc64") {
       defines += [ "TARGET_ARCH_DBC" ]
       defines += [ "USING_SIMULATOR" ]
-    } else  {
+    } else {
       print("Invalid |dart_target_arch|")
       assert(false)
     }
   }
 
   if (dart_debug) {
-    defines += ["DEBUG"]
+    defines += [ "DEBUG" ]
   } else {
-    defines += ["NDEBUG"]
+    defines += [ "NDEBUG" ]
   }
 
-  cflags = [
-    "-Werror",
-    "-Wall",
-    "-Wextra", # Also known as -W.
-    "-Wno-unused-parameter",
-    "-Wnon-virtual-dtor",
-    "-Wvla",
-    "-Wno-conversion-null",
-    "-Woverloaded-virtual",
-    "-g3",
-    "-ggdb3",
-    "-fno-rtti",
-    "-fno-exceptions",
-  ]
+  if (!is_win) {
+    cflags = [
+      "-Werror",
+      "-Wall",
+      "-Wextra",  # Also known as -W.
+      "-Wno-unused-parameter",
+      "-Wnon-virtual-dtor",
+      "-Wvla",
+      "-Wno-conversion-null",
+      "-Woverloaded-virtual",
+      "-g3",
+      "-ggdb3",
+      "-fno-rtti",
+      "-fno-exceptions",
+    ]
 
-  if (dart_debug) {
-    cflags += [
-      "-O1",
-    ]
-  } else {
-    cflags += [
-      "-O3",
-    ]
-  }
+    if (dart_debug) {
+      cflags += [ "-O1" ]
+    } else {
+      cflags += [ "-O3" ]
+    }
 
-  if (defined(is_asan) && is_asan) {
-    ldflags = [
-      "-Wl,-u_sanitizer_options_link_helper",
-      "-fsanitize=address",
-    ]
+    if (defined(is_asan) && is_asan) {
+      ldflags = [ "-fsanitize=address" ]
+    }
   }
 }
 
@@ -197,19 +183,18 @@
   }
   static_library(target_name) {
     configs += [
-      ":dart_config",
-      ":dart_maybe_product_config"
-    ] + extra_configs
+                 ":dart_config",
+                 ":dart_maybe_product_config",
+               ] + extra_configs
     deps = [
-      "vm:libdart_platform",
-      "third_party/double-conversion/src:libdouble_conversion",
-      ":generate_version_cc_file",
-    ] + extra_deps
-    include_dirs = [
-      ".",
-    ]
-    public_configs = [":dart_public_config"]
+             "vm:libdart_platform",
+             "third_party/double-conversion/src:libdouble_conversion",
+             ":generate_version_cc_file",
+           ] + extra_deps
+    include_dirs = [ "." ]
+    public_configs = [ ":dart_public_config" ]
     sources = [
+      "$target_gen_dir/version.cc",
       "include/dart_api.h",
       "include/dart_mirrors_api.h",
       "include/dart_native_api.h",
@@ -219,29 +204,33 @@
       "vm/mirrors_api_impl.cc",
       "vm/native_api_impl.cc",
       "vm/version.h",
-      "$target_gen_dir/version.cc",
     ]
-    defines = [
-      "DART_SHARED_LIB",
-    ]
+    defines = [ "DART_SHARED_LIB" ]
   }
 }
 
 libdart_library("libdart") {
-  extra_configs = [
-    ":dart_maybe_precompiled_runtime_config"
-  ]
+  extra_configs = [ ":dart_maybe_precompiled_runtime_config" ]
   extra_deps = [
     "vm:libdart_lib",
     "vm:libdart_vm",
   ]
 }
 
-libdart_library("libdart_precompiled_runtime") {
+libdart_library("libdart_noopt") {
   extra_configs = [
-    ":dart_precompiled_runtime_config"
+    ":dart_maybe_precompiled_runtime_config",
+    ":dart_precompiler_config",
   ]
   extra_deps = [
+    "vm:libdart_lib",
+    "vm:libdart_vm_noopt",
+  ]
+}
+
+libdart_library("libdart_precompiled_runtime") {
+  extra_configs = [ ":dart_precompiled_runtime_config" ]
+  extra_deps = [
     "vm:libdart_lib_precompiled_runtime",
     "vm:libdart_vm_precompiled_runtime",
   ]
@@ -250,7 +239,7 @@
 libdart_library("libdart_nosnapshot") {
   extra_configs = [
     ":dart_no_snapshot_config",
-    ":dart_maybe_precompiled_runtime_config"
+    ":dart_maybe_precompiled_runtime_config",
   ]
   extra_deps = [
     "vm:libdart_lib_nosnapshot",
@@ -258,17 +247,6 @@
   ]
 }
 
-libdart_library("libdart_nosnapshot_precompiled_runtime") {
-  extra_configs = [
-    ":dart_no_snapshot_config",
-    ":dart_precompiled_runtime_config"
-  ]
-  extra_deps = [
-    "vm:libdart_lib_nosnapshot_precompiled_runtime",
-    "vm:libdart_vm_nosnapshot_precompiled_runtime",
-  ]
-}
-
 libdart_library("libdart_nosnapshot_with_precompiler") {
   extra_configs = [
     ":dart_no_snapshot_config",
@@ -291,26 +269,31 @@
     "vm/version_in.cc",
   ]
   output = "$target_gen_dir/version.cc"
-  outputs = [ output, ]
+  outputs = [
+    output,
+  ]
 
   script = "../tools/make_version.py"
   args = [
     "--quiet",
-    "--output", rebase_path(output, root_build_dir),
-    "--input", rebase_path("vm/version_in.cc", root_build_dir),
+    "--output",
+    rebase_path(output, root_build_dir),
+    "--input",
+    rebase_path("vm/version_in.cc", root_build_dir),
   ]
 }
 
-
 executable("libdart_dependency_helper") {
-  configs += [":dart_config",
-              ":dart_maybe_product_config"]
+  configs += [
+    ":dart_config",
+    ":dart_maybe_product_config",
+  ]
   deps = [
-    "vm:libdart_lib_nosnapshot",
-    "vm:libdart_lib",
-    "vm:libdart_vm",
-    "vm:libdart_platform",
     "third_party/double-conversion/src:libdouble_conversion",
+    "vm:libdart_lib",
+    "vm:libdart_lib_nosnapshot",
+    "vm:libdart_vm",
+    "vm:libdart_vm_nosnapshot",
   ]
   sources = [
     "vm/libdart_dependency_helper.cc",
diff --git a/runtime/CPPLINT.cfg b/runtime/CPPLINT.cfg
index 64aa482..c9f2821 100644
--- a/runtime/CPPLINT.cfg
+++ b/runtime/CPPLINT.cfg
@@ -4,4 +4,7 @@
 
 # Do not limit function size. For example parts of
 # the simulator are really large.
-filter=-readability/fn_size
+#
+# Do not complain about whitespace. That is handled
+# by the clang format presubmit check.
+filter=-readability/fn_size,-whitespace/indent
diff --git a/runtime/PRESUBMIT.py b/runtime/PRESUBMIT.py
index ca55214..0170f2f9 100644
--- a/runtime/PRESUBMIT.py
+++ b/runtime/PRESUBMIT.py
@@ -6,37 +6,23 @@
 import cpplint
 import re
 
-
-class PathHackException(Exception):
-  def __init__(self, error_msg):
-    self.error_msg = error_msg
-
-  def __str__(self):
-    return repr(self.error_msg)
-
-def AddSvnPathIfNeeded(runtime_path):
-  # Add the .svn into the runtime directory if needed for git or svn 1.7.
-  fake_svn_path = os.path.join(runtime_path, '.svn')
-  if os.path.exists(fake_svn_path):
-    return None
-  open(fake_svn_path, 'w').close()
-  return lambda: os.remove(fake_svn_path)
-
-
-def TrySvnPathHack(parent_path):
-  orig_path = os.path.join(parent_path, '.svn')
-  renamed_path = os.path.join(parent_path, '.svn_orig')
-  if os.path.exists(renamed_path):
-    error_msg = '".svn_orig" exists in presubmit parent directory('
-    error_msg += parent_path
-    error_msg += '). Consider renaming it manually to ".svn".'
-    raise PathHackException(error_msg)
-  if os.path.exists(orig_path):
-    # Make the parent SVN directory non-discoverable by cpplint to get
-    # the correct header guard checks. This is needed if using all Dart
-    # checkout.
-    os.rename(orig_path, renamed_path)
-    return lambda: os.rename(renamed_path, orig_path)
+# memcpy does not handle overlapping memory regions. Even though this
+# is well documented it seems to be used in error quite often. To avoid
+# problems we disallow the direct use of memcpy.  The exceptions are in
+# third-party code and in platform/globals.h which uses it to implement
+# bit_cast and bit_copy.
+def CheckMemcpy(filename):
+  if filename.endswith(os.path.join('platform', 'globals.h')) or \
+     filename.find('third_party') != -1:
+    return 0
+  fh = open(filename, 'r')
+  content = fh.read()
+  match = re.search('\\bmemcpy\\b', content)
+  if match:
+    line_number = content[0:match.start()].count('\n') + 1
+    print "%s:%d: use of memcpy is forbidden" % (filename, line_number)
+    return 1
+  return 0
 
 
 def RunLint(input_api, output_api):
@@ -44,39 +30,13 @@
   cpplint._cpplint_state.ResetErrorCounts()
   memcpy_match_count = 0
   # Find all .cc and .h files in the change list.
-  for svn_file in input_api.AffectedTextFiles():
-    filename = svn_file.AbsoluteLocalPath()
+  for git_file in input_api.AffectedTextFiles():
+    filename = git_file.AbsoluteLocalPath()
     if filename.endswith('.cc') or filename.endswith('.h'):
-      cleanup_parent = None
-      cleanup_runtime = None
-      try:
-        runtime_path = input_api.PresubmitLocalPath()
-        parent_path = os.path.dirname(runtime_path)
-        if filename.endswith('.h'):
-          cleanup_runtime = AddSvnPathIfNeeded(runtime_path)
-          cleanup_parent = TrySvnPathHack(parent_path)
-      except PathHackException, exception:
-        return [output_api.PresubmitError(str(exception))]
       # Run cpplint on the file.
       cpplint.ProcessFile(filename, 1)
-      if cleanup_parent is not None:
-        cleanup_parent()
-      if cleanup_runtime is not None:
-        cleanup_runtime()
-      # memcpy does not handle overlapping memory regions. Even though this
-      # is well documented it seems to be used in error quite often. To avoid
-      # problems we disallow the direct use of memcpy.  The exceptions are in
-      # third-party code and in platform/globals.h which uses it to implement
-      # bit_cast and bit_copy.
-      if not filename.endswith(os.path.join('platform', 'globals.h')) and \
-         filename.find('third_party') == -1:
-        fh = open(filename, 'r')
-        content = fh.read()
-        match = re.search('\\bmemcpy\\b', content)
-        if match:
-          line_number = content[0:match.start()].count('\n') + 1
-          print "%s:%d: use of memcpy is forbidden" % (filename, line_number)
-          memcpy_match_count += 1
+      # Check for memcpy use.
+      memcpy_match_count += CheckMemcpy(filename)
 
   # Report a presubmit error if any of the files had an error.
   if cpplint._cpplint_state.error_count > 0 or memcpy_match_count > 0:
@@ -84,9 +44,21 @@
   return result
 
 
+def CheckGn(input_api, output_api):
+  return input_api.canned_checks.CheckGNFormatted(input_api, output_api)
+
+
+def CheckFormatted(input_api, output_api):
+  return input_api.canned_checks.CheckPatchFormatted(input_api, output_api)
+
+
 def CheckChangeOnUpload(input_api, output_api):
-  return RunLint(input_api, output_api)
+  return (RunLint(input_api, output_api) +
+          CheckGn(input_api, output_api) +
+          CheckFormatted(input_api, output_api))
 
 
 def CheckChangeOnCommit(input_api, output_api):
-  return RunLint(input_api, output_api)
+  return (RunLint(input_api, output_api) +
+          CheckGn(input_api, output_api) +
+          CheckFormatted(input_api, output_api))
diff --git a/runtime/bin/BUILD.gn b/runtime/bin/BUILD.gn
index 549807b..903cc40 100644
--- a/runtime/bin/BUILD.gn
+++ b/runtime/bin/BUILD.gn
@@ -2,6 +2,8 @@
 # for details. All rights reserved. Use of this source code is governed by a
 # BSD-style license that can be found in the LICENSE file.
 
+import("gypi_contents.gni")
+
 declare_args() {
   # Whether to fall back to built-in root certificates when they cannot be
   # verified at the operating system level.
@@ -18,33 +20,37 @@
   dart_use_tcmalloc = false
 }
 
-resources_sources_gypi =
-    exec_script("../../tools/gypi_to_gn.py",
-                [rebase_path("vmservice/vmservice_sources.gypi")],
-                "scope",
-                ["vmservice/vmservice_sources.gypi"])
+# TODO(zra): Remove this when Fuchsia has a root cert cache on the filesystem.
+if (defined(is_fuchsia) && is_fuchsia) {
+  dart_use_fallback_root_certificates = true
+}
 
 # Generate a resources.cc file for the service isolate without Observatory.
 action("gen_resources_cc") {
-  visibility = [ ":*" ] # Only targets in this file can see this.
+  visibility = [ ":*" ]  # Only targets in this file can see this.
   script = "../tools/create_resources.py"
   inputs = [
     "../tools/create_resources.py",
   ]
+
   # The path below is hard coded for the Mojo and Flutter trees. When moving
   # the Dart runtime to gn, this path might need to be updated.
-  sources = rebase_path(resources_sources_gypi.sources,
-                        "",
-                        "../bin/vmservice/")
-  outputs = [ "$target_gen_dir/resources_gen.cc" ]
+  sources = rebase_path(resources_sources_gypi, "", "../bin/vmservice/")
+  outputs = [
+    "$target_gen_dir/resources_gen.cc",
+  ]
   args = [
-    "--output",
-    rebase_path("$target_gen_dir/resources_gen.cc", root_build_dir),
-    "--outer_namespace", "dart",
-    "--inner_namespace", "bin",
-    "--table_name", "service_bin",
-    "--root_prefix", rebase_path(".", root_build_dir) + "/",
-  ] + rebase_path(sources, root_build_dir)
+           "--output",
+           rebase_path("$target_gen_dir/resources_gen.cc", root_build_dir),
+           "--outer_namespace",
+           "dart",
+           "--inner_namespace",
+           "bin",
+           "--table_name",
+           "service_bin",
+           "--root_prefix",
+           rebase_path(".", root_build_dir) + "/",
+         ] + rebase_path(sources, root_build_dir)
 }
 
 template("gen_library_src_path") {
@@ -54,10 +60,12 @@
     visibility = [ ":*" ]  # Only targets in this file can see this.
     script = "../tools/gen_library_src_paths.py"
     inputs = [
-      "../tools/gen_library_src_paths.py",
-      "builtin_in.cc",
-    ] + invoker.sources
-    outputs = [ invoker.output, ]
+               "../tools/gen_library_src_paths.py",
+               "builtin_in.cc",
+             ] + invoker.sources
+    outputs = [
+      invoker.output,
+    ]
     name = invoker.name
     kind = invoker.kind
     library_name = "dart:${name}"
@@ -65,60 +73,55 @@
       library_name = invoker.library_name
     }
     args = [
-      "--output", rebase_path(invoker.output, root_build_dir),
-      "--input_cc", rebase_path("builtin_in.cc", root_build_dir),
-      "--include", "bin/builtin.h",
-      "--var_name", "dart::bin::Builtin::${name}_${kind}_paths_",
-      "--library_name", library_name,] +
-      rebase_path(invoker.sources, root_build_dir)
+             "--output",
+             rebase_path(invoker.output, root_build_dir),
+             "--input_cc",
+             rebase_path("builtin_in.cc", root_build_dir),
+             "--include",
+             "bin/builtin.h",
+             "--var_name",
+             "dart::bin::Builtin::${name}_${kind}_paths_",
+             "--library_name",
+             library_name,
+           ] + rebase_path(invoker.sources, root_build_dir)
   }
 }
 
-builtin_sources_gypi =
-    exec_script("../../tools/gypi_to_gn.py",
-                [rebase_path("builtin_sources.gypi")],
-                "scope",
-                ["builtin_sources.gypi"])
-
 gen_library_src_path("generate_builtin_cc_file") {
   name = "_builtin"
   kind = "source"
-  sources = builtin_sources_gypi.sources
+  sources = builtin_sources_gypi
   output = "$target_gen_dir/builtin_gen.cc"
 }
 
 sdk_io_sources_gypi =
     exec_script("../../tools/gypi_to_gn.py",
-                [rebase_path("../../sdk/lib/io/io_sources.gypi")],
+                [ rebase_path("../../sdk/lib/io/io_sources.gypi") ],
                 "scope",
-                ["../../sdk/lib/io/io_sources.gypi"])
+                [ "../../sdk/lib/io/io_sources.gypi" ])
 sdk_io_sources =
     rebase_path(sdk_io_sources_gypi.sources, ".", "../../sdk/lib/io")
 
 gen_library_src_path("generate_io_cc_file") {
   name = "io"
   kind = "source"
-  sources = ["../../sdk/lib/io/io.dart"] + sdk_io_sources
+  sources = [ "../../sdk/lib/io/io.dart" ] + sdk_io_sources
   output = "$target_gen_dir/io_gen.cc"
 }
 
-io_sources_gypi =
-    exec_script("../../tools/gypi_to_gn.py",
-                [rebase_path("io_sources.gypi")],
-                "scope",
-                ["io_sources.gypi"])
-
 gen_library_src_path("generate_io_patch_cc_file") {
   name = "io"
   kind = "patch"
-  sources = io_sources_gypi.sources
+  sources = io_sources_gypi
   output = "$target_gen_dir/io_patch_gen.cc"
 }
 
 gen_library_src_path("generate_html_cc_file") {
   name = "html"
   kind = "source"
-  sources = ["../../sdk/lib/html/dartium/html_dartium.dart"]
+  sources = [
+    "../../sdk/lib/html/dartium/html_dartium.dart",
+  ]
   output = "$target_gen_dir/html_gen.cc"
 }
 
@@ -126,13 +129,13 @@
   name = "html_common"
   kind = "source"
   sources = [
-    "../../sdk/lib/html/html_common/html_common.dart",
+    "../../sdk/lib/html/html_common/conversions.dart",
+    "../../sdk/lib/html/html_common/conversions_dartium.dart",
     "../../sdk/lib/html/html_common/css_class_set.dart",
     "../../sdk/lib/html/html_common/device.dart",
     "../../sdk/lib/html/html_common/filtered_element_list.dart",
+    "../../sdk/lib/html/html_common/html_common.dart",
     "../../sdk/lib/html/html_common/lists.dart",
-    "../../sdk/lib/html/html_common/conversions.dart",
-    "../../sdk/lib/html/html_common/conversions_dartium.dart",
   ]
   output = "$target_gen_dir/html_common_gen.cc"
 }
@@ -140,36 +143,55 @@
 gen_library_src_path("generate_js_cc_file") {
   name = "js"
   kind = "source"
-  sources = ["../../sdk/lib/js/dartium/js_dartium.dart"]
+  sources = [
+    "../../sdk/lib/js/dartium/js_dartium.dart",
+  ]
   output = "$target_gen_dir/js_gen.cc"
 }
 
+gen_library_src_path("generate_js_util_cc_file") {
+  name = "js_util"
+  kind = "source"
+  sources = [
+    "../../sdk/lib/js_util/dartium/js_util_dartium.dart",
+  ]
+  output = "$target_gen_dir/js_util_gen.cc"
+}
+
 gen_library_src_path("generate_blink_cc_file") {
   name = "_blink"
   kind = "source"
-  sources = ["../../sdk/lib/_blink/dartium/_blink_dartium.dart"]
+  sources = [
+    "../../sdk/lib/_blink/dartium/_blink_dartium.dart",
+  ]
   output = "$target_gen_dir/blink_gen.cc"
 }
 
 gen_library_src_path("generate_indexed_db_cc_file") {
   name = "indexed_db"
   kind = "source"
-  sources = ["../../sdk/lib/indexed_db/dartium/indexed_db_dartium.dart"]
+  sources = [
+    "../../sdk/lib/indexed_db/dartium/indexed_db_dartium.dart",
+  ]
   output = "$target_gen_dir/indexed_db_gen.cc"
 }
 
 gen_library_src_path("generate_cached_patches_cc_file") {
   name = "cached_patches"
   library_name = "cached_patches.dart"
-  kind = "sources"
-  sources = ["../../sdk/lib/js/dartium/cached_patches.dart"]
+  kind = "source"
+  sources = [
+    "../../sdk/lib/js/dartium/cached_patches.dart",
+  ]
   output = "$target_gen_dir/cached_patches_gen.cc"
 }
 
 gen_library_src_path("generate_web_gl_cc_file") {
   name = "web_gl"
   kind = "source"
-  sources = ["../../sdk/lib/web_gl/dartium/web_gl_dartium.dart"]
+  sources = [
+    "../../sdk/lib/web_gl/dartium/web_gl_dartium.dart",
+  ]
   output = "$target_gen_dir/web_gl_gen.cc"
 }
 
@@ -177,35 +199,43 @@
   name = "metadata"
   library_name = "metadata.dart"
   kind = "source"
-  sources = ["../../sdk/lib/html/html_common/metadata.dart"]
+  sources = [
+    "../../sdk/lib/html/html_common/metadata.dart",
+  ]
   output = "$target_gen_dir/metadata_gen.cc"
 }
 
 gen_library_src_path("generate_web_sql_cc_file") {
   name = "web_sql"
   kind = "source"
-  sources = ["../../sdk/lib/web_sql/dartium/web_sql_dartium.dart"]
+  sources = [
+    "../../sdk/lib/web_sql/dartium/web_sql_dartium.dart",
+  ]
   output = "$target_gen_dir/web_sql_gen.cc"
 }
 
 gen_library_src_path("generate_svg_cc_file") {
   name = "svg"
   kind = "source"
-  sources = ["../../sdk/lib/svg/dartium/svg_dartium.dart"]
+  sources = [
+    "../../sdk/lib/svg/dartium/svg_dartium.dart",
+  ]
   output = "$target_gen_dir/svg_gen.cc"
 }
 
 gen_library_src_path("generate_web_audio_cc_file") {
   name = "web_audio"
   kind = "source"
-  sources = ["../../sdk/lib/web_audio/dartium/web_audio_dartium.dart"]
+  sources = [
+    "../../sdk/lib/web_audio/dartium/web_audio_dartium.dart",
+  ]
   output = "$target_gen_dir/web_audio_gen.cc"
 }
 
 config("libdart_builtin_config") {
-  libs = [
-    "dl",
-  ]
+  if (!is_win) {
+    libs = [ "dl" ]
+  }
   if (is_android) {
     libs += [
       "android",
@@ -214,55 +244,49 @@
   }
 }
 
-builtin_impl_sources_gypi =
-    exec_script("../../tools/gypi_to_gn.py",
-                [rebase_path("builtin_impl_sources.gypi")],
-                "scope",
-                ["builtin_impl_sources.gypi"])
-
 static_library("libdart_builtin") {
-  configs += ["..:dart_config",
-              "..:dart_maybe_product_config"]
-  public_configs = [":libdart_builtin_config"]
+  configs += [
+    "..:dart_config",
+    "..:dart_maybe_product_config",
+  ]
+  public_configs = [ ":libdart_builtin_config" ]
   deps = [
+    ":generate_blink_cc_file",
     ":generate_builtin_cc_file",
-    ":generate_io_cc_file",
-    ":generate_io_patch_cc_file",
+    ":generate_cached_patches_cc_file",
     ":generate_html_cc_file",
     ":generate_html_common_cc_file",
-    ":generate_js_cc_file",
-    ":generate_blink_cc_file",
     ":generate_indexed_db_cc_file",
-    ":generate_cached_patches_cc_file",
-    ":generate_web_gl_cc_file",
+    ":generate_io_cc_file",
+    ":generate_io_patch_cc_file",
+    ":generate_js_cc_file",
+    ":generate_js_util_cc_file",
     ":generate_metadata_cc_file",
-    ":generate_web_sql_cc_file",
     ":generate_svg_cc_file",
     ":generate_web_audio_cc_file",
+    ":generate_web_gl_cc_file",
+    ":generate_web_sql_cc_file",
   ]
-  include_dirs = [
-    "..",
-  ]
-  set_sources_assignment_filter(["*_test.cc", "*_test.h"])
+  include_dirs = [ ".." ]
+  set_sources_assignment_filter([
+                                  "*_test.cc",
+                                  "*_test.h",
+                                ])
   sources = [
-    "log_android.cc",
-    "log_fuchsia.cc",
-    "log_linux.cc",
-    "log_macos.cc",
-    "log_win.cc",
-  ] + builtin_impl_sources_gypi.sources
+              "log_android.cc",
+              "log_fuchsia.cc",
+              "log_linux.cc",
+              "log_macos.cc",
+              "log_win.cc",
+            ] + builtin_impl_sources_gypi
 }
 
-io_impl_sources_gypi =
-    exec_script("../../tools/gypi_to_gn.py",
-                [ rebase_path("io_impl_sources.gypi") ],
-                "scope",
-                [ "io_impl_sources.gypi" ])
-
 executable("gen_snapshot") {
-  configs += ["..:dart_config",
-              "..:dart_maybe_product_config",
-              "..:dart_precompiler_config"]
+  configs += [
+    "..:dart_config",
+    "..:dart_maybe_product_config",
+    "..:dart_precompiler_config",
+  ]
   deps = [
     ":gen_resources_cc",
     ":gen_snapshot_dart_io",
@@ -274,30 +298,39 @@
   ]
 
   sources = [
-    "address_sanitizer.cc",
-    "gen_snapshot.cc",
-    # Very limited native resolver provided.
-    "builtin_common.cc",
-    "builtin_gen_snapshot.cc",
-    "builtin.cc",
-    "builtin.h",
-    "vmservice_impl.cc",
-    "vmservice_impl.h",
     # Include generated source files.
     "$target_gen_dir/builtin_gen.cc",
     "$target_gen_dir/io_gen.cc",
     "$target_gen_dir/io_patch_gen.cc",
     "$target_gen_dir/resources_gen.cc",
+    "address_sanitizer.cc",
+    "builtin.cc",
+    "builtin.h",
+
+    # Very limited native resolver provided.
+    "builtin_common.cc",
+    "builtin_gen_snapshot.cc",
+    "gen_snapshot.cc",
+    "vmservice_impl.cc",
+    "vmservice_impl.h",
   ]
 
-  include_dirs = [
-    "..",
-  ]
+  include_dirs = [ ".." ]
 
   if (is_mac) {
     libs = [
       "CoreFoundation.framework",
-      "CoreServices.framework"
+      "CoreServices.framework",
+    ]
+  }
+
+  if (is_win) {
+    libs = [
+      "iphlpapi.lib",
+      "psapi.lib",
+      "ws2_32.lib",
+      "Rpcrt4.lib",
+      "winmm.lib",
     ]
   }
 }
@@ -305,9 +338,11 @@
 # A source set for the implementation of 'dart:io' library
 # (without secure sockets) suitable for linking with gen_snapshot.
 source_set("gen_snapshot_dart_io") {
-  configs += ["..:dart_config",
-              "..:dart_maybe_product_config",
-              "..:dart_precompiler_config"]
+  configs += [
+    "..:dart_config",
+    "..:dart_maybe_product_config",
+    "..:dart_precompiler_config",
+  ]
 
   deps = [
     "$dart_zlib_path",
@@ -331,7 +366,7 @@
 
   defines = [ "DART_IO_SECURE_SOCKET_DISABLED" ]
 
-  sources = io_impl_sources_gypi.sources + builtin_impl_sources_gypi.sources
+  sources = io_impl_sources_gypi + builtin_impl_sources_gypi
   sources += [
     "io_natives.cc",
     "io_natives.h",
@@ -339,85 +374,101 @@
 
   include_dirs = [
     "..",
-    "//third_party"
+    "//third_party",
   ]
 }
 
 source_set("libdart_embedder_noio") {
-  configs += ["..:dart_config",
-              "..:dart_maybe_product_config"]
+  configs += [
+    "..:dart_config",
+    "..:dart_maybe_product_config",
+  ]
   deps = [
     "..:libdart",
   ]
 }
 
 # A source set for the implementation of 'dart:io' library.
-source_set("embedded_dart_io") {
-  configs += ["..:dart_config",
-              "..:dart_maybe_product_config"]
-  custom_sources_filter = [
-    "*_test.cc",
-    "*_test.h",
-    "builtin.cc",
-    "builtin_gen_snapshot.cc",
-  ]
-  if (!is_mac && !is_ios) {
-    # Dart tree uses *_macos.* instead of *_mac.*
-    custom_sources_filter += [
-      "*_macos.h",
-      "*_macos.cc",
-    ]
+template("dart_io") {
+  extra_sources = []
+  if (defined(invoker.extra_sources)) {
+    extra_sources += invoker.extra_sources
   }
-  set_sources_assignment_filter(custom_sources_filter)
-
-  defines = []
-  if (is_mac || is_ios) {
-    libs = [
-      "CoreFoundation.framework",
-      "CoreServices.framework",
-      "Security.framework",
+  source_set(target_name) {
+    configs += [
+      "..:dart_config",
+      "..:dart_maybe_product_config",
     ]
-  } else if (defined(is_fuchsia) && is_fuchsia) {
-    defines += [
-      "DART_IO_SECURE_SOCKET_DISABLED"
+    custom_sources_filter = [
+      "*_test.cc",
+      "*_test.h",
+      "builtin.cc",
+      "builtin_gen_snapshot.cc",
     ]
-  } else {
-    deps = [
-      "//third_party/boringssl",
-    ]
-  }
-
-  sources = io_impl_sources_gypi.sources + builtin_impl_sources_gypi.sources
-  sources += [
-    "builtin_nolib.cc",
-    "builtin_natives.cc",
-    "io_natives.cc",
-    "io_natives.h",
-    "embedded_dart_io.cc",
-    "embedded_dart_io.h",
-    "log_android.cc",
-    "log_linux.cc",
-    "log_macos.cc",
-    "log_win.cc",
-    "log.h",
-  ]
-
-  if (is_linux || is_win) {
-    if (dart_use_fallback_root_certificates) {
-      sources += [ "//third_party/root_certificates/root_certificates.cc"]
-    } else {
-      defines += [
-        "DART_IO_ROOT_CERTS_DISABLED",
+    if (!is_mac && !is_ios) {
+      # Dart tree uses *_macos.* instead of *_mac.*
+      custom_sources_filter += [
+        "*_macos.h",
+        "*_macos.cc",
       ]
     }
-  }
+    set_sources_assignment_filter(custom_sources_filter)
 
-  include_dirs = [
-    "..",
-    "//third_party"
+    defines = []
+    if (is_mac || is_ios) {
+      libs = [
+        "CoreFoundation.framework",
+        "Security.framework",
+      ]
+
+      if (is_mac) {
+        libs += [ "CoreServices.framework" ]
+      }
+    } else {
+      deps = [
+        "//third_party/boringssl",
+      ]
+    }
+
+    sources = io_impl_sources_gypi + builtin_impl_sources_gypi
+    sources += [
+                 "builtin_natives.cc",
+                 "io_natives.cc",
+                 "io_natives.h",
+                 "log_android.cc",
+                 "log_linux.cc",
+                 "log_macos.cc",
+                 "log_win.cc",
+                 "log.h",
+               ] + extra_sources
+
+    if (is_linux || is_win || (defined(is_fuchsia) && is_fuchsia)) {
+      if (dart_use_fallback_root_certificates) {
+        sources += [ "//third_party/root_certificates/root_certificates.cc" ]
+      } else {
+        defines += [ "DART_IO_ROOT_CERTS_DISABLED" ]
+      }
+    }
+
+    include_dirs = [
+      "..",
+      "//third_party",
+    ]
+  }
+}
+
+dart_io("embedded_dart_io") {
+  extra_sources = [
+    "builtin_nolib.cc",
+    "embedded_dart_io.cc",
+    "embedded_dart_io.h",
   ]
 }
 
+dart_io("standalone_dart_io") {
+  extra_sources = []
+}
+
 action("generate_snapshot_bin") {
   deps = [
     "../bin:gen_snapshot($host_toolchain)",
@@ -509,40 +560,50 @@
   }
   executable(target_name) {
     configs += [
-      "..:dart_config",
-      "..:dart_maybe_product_config"
-    ] + extra_configs
+                 "..:dart_config",
+                 "..:dart_maybe_product_config",
+               ] + extra_configs
 
     deps = [
-      ":gen_resources_cc",
-      ":embedded_dart_io",
-      ":libdart_builtin",
-      "$dart_zlib_path",
-    ] + extra_deps
+             ":gen_resources_cc",
+             ":standalone_dart_io",
+             ":libdart_builtin",
+             "$dart_zlib_path",
+           ] + extra_deps
 
     if (dart_use_tcmalloc) {
-      deps += [
-        "//third_party/tcmalloc",
-      ]
+      deps += [ "//third_party/tcmalloc" ]
     }
 
     defines = extra_defines
 
     sources = [
-      "main.cc",
-      "vmservice_impl.cc",
-      "vmservice_impl.h",
-      "$target_gen_dir/resources_gen.cc",
-    ] + extra_sources
+                "main.cc",
+                "vmservice_impl.cc",
+                "vmservice_impl.h",
+                "$target_gen_dir/resources_gen.cc",
+              ] + extra_sources
 
     include_dirs = [
       "..",
       "//third_party",
     ]
 
-    ldflags = [
-      "-rdynamic",
-    ]
+    if (is_win) {
+      ldflags = [ "/EXPORT:Dart_True" ]
+    } else {
+      ldflags = [ "-rdynamic" ]
+    }
+
+    if (is_win) {
+      libs = [
+        "iphlpapi.lib",
+        "psapi.lib",
+        "ws2_32.lib",
+        "Rpcrt4.lib",
+        "winmm.lib",
+      ]
+    }
   }
 }
 
@@ -553,17 +614,29 @@
       ":dart_snapshot_cc",
       "../observatory:standalone_observatory_archive",
     ]
+    extra_sources = [ "builtin_nolib.cc" ]
+  }
+
+  dart_executable("dart_noopt") {
+    extra_configs = [ "..:dart_precompiler_config" ]
+    extra_deps = [
+      "..:libdart_noopt",
+      ":dart_snapshot_cc",
+      "../observatory:standalone_observatory_archive",
+    ]
+    extra_sources = [ "builtin_nolib.cc" ]
   }
 
   dart_executable("dart_precompiled_runtime") {
-    extra_configs = [
-      "..:dart_precompiled_runtime_config"
-    ]
+    extra_configs = [ "..:dart_precompiled_runtime_config" ]
     extra_deps = [
       "..:libdart_precompiled_runtime",
-      ":dart_snapshot_cc",
       "../observatory:standalone_observatory_archive",
     ]
+    extra_sources = [
+      "builtin_nolib.cc",
+      "snapshot_empty.cc",
+    ]
   }
 }
 
@@ -573,33 +646,68 @@
     "..:dart_no_snapshot_config",
   ]
   extra_deps = [
-    "..:libdart",
+    ":generate_builtin_cc_file",
+    ":generate_io_cc_file",
+    ":generate_io_patch_cc_file",
+    ":generate_html_cc_file",
+    ":generate_html_common_cc_file",
+    ":generate_js_cc_file",
+    ":generate_js_util_cc_file",
+    ":generate_blink_cc_file",
+    ":generate_indexed_db_cc_file",
+    ":generate_cached_patches_cc_file",
+    ":generate_web_gl_cc_file",
+    ":generate_metadata_cc_file",
+    ":generate_web_sql_cc_file",
+    ":generate_svg_cc_file",
+    ":generate_web_audio_cc_file",
+    "..:libdart_nosnapshot_with_precompiler",
   ]
-  extra_defines = [
-    "NO_OBSERVATORY",
-  ]
+  extra_defines = [ "NO_OBSERVATORY" ]
   extra_sources = [
+    "builtin.cc",
+    "builtin.h",
     "observatory_assets_empty.cc",
     "snapshot_empty.cc",
+
+    # Include generated source files.
+    "$target_gen_dir/builtin_gen.cc",
+    "$target_gen_dir/io_gen.cc",
+    "$target_gen_dir/io_patch_gen.cc",
+    "$target_gen_dir/html_gen.cc",
+    "$target_gen_dir/html_common_gen.cc",
+    "$target_gen_dir/js_gen.cc",
+    "$target_gen_dir/js_util_gen.cc",
+    "$target_gen_dir/blink_gen.cc",
+    "$target_gen_dir/indexed_db_gen.cc",
+    "$target_gen_dir/cached_patches_gen.cc",
+    "$target_gen_dir/web_gl_gen.cc",
+    "$target_gen_dir/metadata_gen.cc",
+    "$target_gen_dir/web_sql_gen.cc",
+    "$target_gen_dir/svg_gen.cc",
+    "$target_gen_dir/web_audio_gen.cc",
   ]
 }
 
 if (defined(is_fuchsia) && is_fuchsia) {
   copy("hello_fuchsia") {
-    sources = [ "../tests/vm/dart/hello_fuchsia_test.dart" ]
-    outputs = [ "$root_out_dir/hello_fuchsia.dart" ]
+    sources = [
+      "../tests/vm/dart/hello_fuchsia_test.dart",
+    ]
+    outputs = [
+      "$root_out_dir/hello_fuchsia.dart",
+    ]
   }
 
   executable("run_vm_tests_fuchsia") {
     testonly = true
-    configs += ["..:dart_config"]
+    configs += [ "..:dart_config" ]
     sources = [
-      "run_vm_tests_fuchsia.cc"
+      "run_vm_tests_fuchsia.cc",
     ]
     libs = [
       "launchpad",
       "magenta",
-      "runtime",
     ]
   }
 }
@@ -614,10 +722,9 @@
   if (defined(is_fuchsia) && is_fuchsia) {
     extra_deps += [ ":hello_fuchsia" ]
   }
-  extra_defines = [
-    "NO_OBSERVATORY",
-  ]
+  extra_defines = [ "NO_OBSERVATORY" ]
   extra_sources = [
+    "builtin_nolib.cc",
     "observatory_assets_empty.cc",
   ]
 }
@@ -657,55 +764,50 @@
 }
 
 executable("run_vm_tests") {
-  configs += ["..:dart_config",
-              "..:dart_maybe_product_config"]
+  configs += [
+    "..:dart_config",
+    "..:dart_maybe_product_config",
+  ]
   deps = [
-    "..:libdart",
-    ":libdart_builtin",
-    ":embedded_dart_io",
     ":dart_snapshot_cc",
     ":generate_snapshot_test_dat_file",
+    ":libdart_builtin",
+    ":standalone_dart_io",
     "$dart_zlib_path",
+    "..:libdart",
   ]
   include_dirs = [
     "..",
     "$target_gen_dir",
   ]
-  defines = [
-    "TESTING",
-  ]
+  defines = [ "TESTING" ]
 
   if (dart_use_tcmalloc) {
-    deps += [
-      "//third_party/tcmalloc",
-    ]
+    deps += [ "//third_party/tcmalloc" ]
   }
 
   # The VM sources are already included in libdart, so we just want to add in
   # the tests here.
-  vm_tests_list = exec_script("../../tools/gypi_to_gn.py",
-                                [rebase_path("../vm/vm_sources.gypi"),
-                                 "--keep_only=_test.cc",
-                                 "--keep_only=_test.h",],
-                                "scope",
-                                ["../vm/vm_sources.gypi"])
-  vm_tests = rebase_path(vm_tests_list.sources, ".", "../vm")
-
-  builtin_impl_tests_list =
-      exec_script("../../tools/gypi_to_gn.py",
-                  [rebase_path("builtin_impl_sources.gypi"),
-                   "--keep_only=_test.cc",
-                   "--keep_only=_test.h",],
-                  "scope",
-                  ["builtin_impl_sources.gypi"])
+  vm_tests = rebase_path(vm_tests_list, ".", "../vm")
 
   sources = [
-    "run_vm_tests.cc",
-  ] + builtin_impl_tests_list.sources + vm_tests
+              "builtin_nolib.cc",
+              "run_vm_tests.cc",
+            ] + builtin_impl_tests_list + vm_tests
 
-  ldflags = [
-    "-rdynamic",
-  ]
+  if (!is_win) {
+    ldflags = [ "-rdynamic" ]
+  }
+
+  if (is_win) {
+    libs = [
+      "iphlpapi.lib",
+      "psapi.lib",
+      "ws2_32.lib",
+      "Rpcrt4.lib",
+      "winmm.lib",
+    ]
+  }
 }
 
 if (!defined(is_fuchsia) || !is_fuchsia) {
@@ -717,13 +819,16 @@
       "test_extension.c",
       "test_extension_dllmain_win.cc",
     ]
-    include_dirs = [
-      "..",
-    ]
+    include_dirs = [ ".." ]
     defines = [
       # The only effect of DART_SHARED_LIB is to export the Dart API.
       "DART_SHARED_LIB",
     ]
+    if (is_win) {
+      libs = [ "dart.lib" ]
+      abs_root_out_dir = rebase_path(root_out_dir)
+      ldflags = [ "/LIBPATH:$abs_root_out_dir" ]
+    }
   }
 
   shared_library("sample_extension") {
@@ -734,12 +839,15 @@
       "../../samples/sample_extension/sample_extension.cc",
       "../../samples/sample_extension/sample_extension_dllmain_win.cc",
     ]
-    include_dirs = [
-      "..",
-    ]
+    include_dirs = [ ".." ]
     defines = [
       # The only effect of DART_SHARED_LIB is to export the Dart API.
       "DART_SHARED_LIB",
     ]
+    if (is_win) {
+      libs = [ "dart.lib" ]
+      abs_root_out_dir = rebase_path(root_out_dir)
+      ldflags = [ "/LIBPATH:$abs_root_out_dir" ]
+    }
   }
 }
diff --git a/runtime/bin/address_sanitizer.cc b/runtime/bin/address_sanitizer.cc
index 6795da8..db2c65e 100644
--- a/runtime/bin/address_sanitizer.cc
+++ b/runtime/bin/address_sanitizer.cc
@@ -8,17 +8,16 @@
 #if defined(__has_feature)
 #if __has_feature(address_sanitizer)
 
-const char *kAsanDefaultOptions =
+const char* kAsanDefaultOptions =
     "strict_memcmp=0 symbolize=0 check_printf=1 use_sigaltstack=1 "
     "detect_leaks=0 fast_unwind_on_fatal=1 handle_segv=0 ";
 
-extern "C"
-__attribute__((no_sanitize_address))
+extern "C" __attribute__((no_sanitize_address))
 __attribute__((visibility("default")))
 // The function isn't referenced from the executable itself. Make sure it isn't
 // stripped by the linker.
-__attribute__((used))
-const char *__asan_default_options() {
+__attribute__((used)) const char*
+__asan_default_options() {
   return kAsanDefaultOptions;
 }
 
diff --git a/runtime/bin/bin.gypi b/runtime/bin/bin.gypi
index 650f587..f460a08 100644
--- a/runtime/bin/bin.gypi
+++ b/runtime/bin/bin.gypi
@@ -1147,7 +1147,7 @@
             },
           },
         }],
-        ['OS == "linux" and asan == 0', {
+        ['OS == "linux" and asan == 0 and msan == 0', {
           'dependencies': [
             '../third_party/tcmalloc/tcmalloc.gypi:tcmalloc',
           ],
@@ -1398,7 +1398,7 @@
             'libraries': [ '-lws2_32.lib', '-lRpcrt4.lib', '-lwinmm.lib' ],
           },
         }],
-        ['OS == "linux" and asan == 0', {
+        ['OS == "linux" and asan == 0 and msan == 0', {
           'dependencies': [
             '../third_party/tcmalloc/tcmalloc.gypi:tcmalloc',
           ],
diff --git a/runtime/bin/builtin.cc b/runtime/bin/builtin.cc
index b3215bb..cbc2006 100644
--- a/runtime/bin/builtin.cc
+++ b/runtime/bin/builtin.cc
@@ -14,30 +14,29 @@
 namespace bin {
 
 Builtin::builtin_lib_props Builtin::builtin_libraries_[] = {
-  /* { url_, source_, patch_url_, patch_source_, has_natives_ } */
-  { DartUtils::kBuiltinLibURL, _builtin_source_paths_, NULL, NULL, true },
-  { DartUtils::kIOLibURL, io_source_paths_,
-    DartUtils::kIOLibPatchURL, io_patch_paths_, true },
+    /* { url_, source_, patch_url_, patch_source_, has_natives_ } */
+    {DartUtils::kBuiltinLibURL, _builtin_source_paths_, NULL, NULL, true},
+    {DartUtils::kIOLibURL, io_source_paths_, DartUtils::kIOLibPatchURL,
+     io_patch_paths_, true},
 
 #if defined(DART_NO_SNAPSHOT)
-  // Only include these libraries in the dart_bootstrap case for now.
-  { "dart:html", html_source_paths_, NULL, NULL, true },
-  { "dart:html_common", html_common_source_paths_, NULL, NULL, true},
-  { "dart:js", js_source_paths_, NULL, NULL, true},
-  { "dart:js_util", js_util_source_paths_, NULL, NULL, true},
-  { "dart:_blink", _blink_source_paths_, NULL, NULL, true },
-  { "dart:indexed_db", indexed_db_source_paths_, NULL, NULL, true },
-  { "cached_patches.dart", cached_patches_source_paths_, NULL, NULL, true },
-  { "dart:web_gl", web_gl_source_paths_, NULL, NULL, true },
-  { "metadata.dart", metadata_source_paths_, NULL, NULL, true },
-  { "dart:web_sql", web_sql_source_paths_, NULL, NULL, true },
-  { "dart:svg", svg_source_paths_, NULL, NULL, true },
-  { "dart:web_audio", web_audio_source_paths_, NULL, NULL, true },
+    // Only include these libraries in the dart_bootstrap case for now.
+    {"dart:html", html_source_paths_, NULL, NULL, true},
+    {"dart:html_common", html_common_source_paths_, NULL, NULL, true},
+    {"dart:js", js_source_paths_, NULL, NULL, true},
+    {"dart:js_util", js_util_source_paths_, NULL, NULL, true},
+    {"dart:_blink", _blink_source_paths_, NULL, NULL, true},
+    {"dart:indexed_db", indexed_db_source_paths_, NULL, NULL, true},
+    {"cached_patches.dart", cached_patches_source_paths_, NULL, NULL, true},
+    {"dart:web_gl", web_gl_source_paths_, NULL, NULL, true},
+    {"metadata.dart", metadata_source_paths_, NULL, NULL, true},
+    {"dart:web_sql", web_sql_source_paths_, NULL, NULL, true},
+    {"dart:svg", svg_source_paths_, NULL, NULL, true},
+    {"dart:web_audio", web_audio_source_paths_, NULL, NULL, true},
 #endif  // defined(DART_NO_SNAPSHOT)
 
-  // End marker.
-  { NULL, NULL, NULL, NULL, false }
-};
+    // End marker.
+    {NULL, NULL, NULL, NULL, false}};
 
 Dart_Port Builtin::load_port_ = ILLEGAL_PORT;
 const int Builtin::num_libs_ =
@@ -100,8 +99,8 @@
       if (!Dart_IsString(src)) {
         // In case reading the file caused an error, use the sources directly.
         const char* source = source_paths[i + 2];
-        src = Dart_NewStringFromUTF8(
-            reinterpret_cast<const uint8_t*>(source), strlen(source));
+        src = Dart_NewStringFromUTF8(reinterpret_cast<const uint8_t*>(source),
+                                     strlen(source));
       }
       return src;
     }
@@ -111,7 +110,17 @@
 
 
 void Builtin::SetNativeResolver(BuiltinLibraryId id) {
-  UNREACHABLE();
+  ASSERT(static_cast<int>(id) >= 0);
+  ASSERT(static_cast<int>(id) < num_libs_);
+
+  if (builtin_libraries_[id].has_natives_) {
+    Dart_Handle url = DartUtils::NewString(builtin_libraries_[id].url_);
+    Dart_Handle library = Dart_LookupLibrary(url);
+    ASSERT(!Dart_IsError(library));
+    // Setup the native resolver for built in library functions.
+    DART_CHECK_VALID(
+        Dart_SetNativeResolver(library, NativeLookup, NativeSymbol));
+  }
 }
 
 
@@ -127,8 +136,7 @@
   }
   if (builtin_libraries_[id].patch_url_ != NULL) {
     ASSERT(builtin_libraries_[id].patch_paths_ != NULL);
-    LoadPatchFiles(library,
-                   builtin_libraries_[id].patch_url_,
+    LoadPatchFiles(library, builtin_libraries_[id].patch_url_,
                    builtin_libraries_[id].patch_paths_);
   }
   return library;
diff --git a/runtime/bin/builtin.dart b/runtime/bin/builtin.dart
index d4aa012..ceba8cd 100644
--- a/runtime/bin/builtin.dart
+++ b/runtime/bin/builtin.dart
@@ -1,5 +1,5 @@
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights solveserved. Use of this source code is governed by a
+// for 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 builtin;
diff --git a/runtime/bin/builtin.h b/runtime/bin/builtin.h
index d7e1e4c..f42f2cf 100644
--- a/runtime/bin/builtin.h
+++ b/runtime/bin/builtin.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_BUILTIN_H_
-#define BIN_BUILTIN_H_
+#ifndef RUNTIME_BIN_BUILTIN_H_
+#define RUNTIME_BIN_BUILTIN_H_
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -17,8 +17,7 @@
 namespace bin {
 
 #define FUNCTION_NAME(name) Builtin_##name
-#define REGISTER_FUNCTION(name, count)                                         \
-  { ""#name, FUNCTION_NAME(name), count },
+#define REGISTER_FUNCTION(name, count) {"" #name, FUNCTION_NAME(name), count},
 #define DECLARE_FUNCTION(name, count)                                          \
   extern void FUNCTION_NAME(name)(Dart_NativeArguments args);
 
@@ -103,4 +102,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_BUILTIN_H_
+#endif  // RUNTIME_BIN_BUILTIN_H_
diff --git a/runtime/bin/builtin_common.cc b/runtime/bin/builtin_common.cc
index 79713e1..064d004 100644
--- a/runtime/bin/builtin_common.cc
+++ b/runtime/bin/builtin_common.cc
@@ -27,9 +27,9 @@
       Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary);
   RETURN_IF_ERROR(builtin_lib);
   // Set the _isolateId field.
-  Dart_Handle result = Dart_SetField(builtin_lib,
-                                     DartUtils::NewString("_isolateId"),
-                                     Dart_NewInteger(Dart_GetMainPortId()));
+  Dart_Handle result =
+      Dart_SetField(builtin_lib, DartUtils::NewString("_isolateId"),
+                    Dart_NewInteger(Dart_GetMainPortId()));
   RETURN_IF_ERROR(result);
   load_port_ = port;
   ASSERT(load_port_ != ILLEGAL_PORT);
diff --git a/runtime/bin/builtin_gen_snapshot.cc b/runtime/bin/builtin_gen_snapshot.cc
index 17d4a57..8cf1d23 100644
--- a/runtime/bin/builtin_gen_snapshot.cc
+++ b/runtime/bin/builtin_gen_snapshot.cc
@@ -15,8 +15,7 @@
 namespace bin {
 
 // Lists the native function implementing basic logging facility.
-#define BUILTIN_NATIVE_LIST(V)                                                 \
-  V(Builtin_PrintString, 1)
+#define BUILTIN_NATIVE_LIST(V) V(Builtin_PrintString, 1)
 
 BUILTIN_NATIVE_LIST(DECLARE_FUNCTION);
 
@@ -24,9 +23,7 @@
   const char* name_;
   Dart_NativeFunction function_;
   int argument_count_;
-} BuiltinEntries[] = {
-  BUILTIN_NATIVE_LIST(REGISTER_FUNCTION)
-};
+} BuiltinEntries[] = {BUILTIN_NATIVE_LIST(REGISTER_FUNCTION)};
 
 
 Dart_NativeFunction Builtin::NativeLookup(Dart_Handle name,
diff --git a/runtime/bin/builtin_impl_sources.gypi b/runtime/bin/builtin_impl_sources.gypi
index 846244a..a60f8a8 100644
--- a/runtime/bin/builtin_impl_sources.gypi
+++ b/runtime/bin/builtin_impl_sources.gypi
@@ -37,6 +37,7 @@
     'extensions_win.cc',
     'fdutils.h',
     'fdutils_android.cc',
+    'fdutils_fuchsia.cc',
     'fdutils_linux.cc',
     'fdutils_macos.cc',
     'file.cc',
diff --git a/runtime/bin/builtin_in.cc b/runtime/bin/builtin_in.cc
index 45b2cbf..2fd818b 100644
--- a/runtime/bin/builtin_in.cc
+++ b/runtime/bin/builtin_in.cc
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// clang-format off
+
 #include "{{INCLUDE}}" // NOLINT
 
 // This file is used to generate the mapping of standalone dart libraries
diff --git a/runtime/bin/builtin_natives.cc b/runtime/bin/builtin_natives.cc
index dc6ee17..394beb3 100644
--- a/runtime/bin/builtin_natives.cc
+++ b/runtime/bin/builtin_natives.cc
@@ -27,10 +27,7 @@
 // using functions listed in io_natives.cc.
 #define BUILTIN_NATIVE_LIST(V)                                                 \
   V(Builtin_PrintString, 1)                                                    \
-  V(Builtin_LoadSource, 4)                                                     \
-  V(Builtin_AsyncLoadError, 3)                                                 \
-  V(Builtin_DoneLoading, 0)                                                    \
-  V(Builtin_GetCurrentDirectory, 0)                                            \
+  V(Builtin_GetCurrentDirectory, 0)
 
 
 BUILTIN_NATIVE_LIST(DECLARE_FUNCTION);
@@ -39,9 +36,7 @@
   const char* name_;
   Dart_NativeFunction function_;
   int argument_count_;
-} BuiltinEntries[] = {
-  BUILTIN_NATIVE_LIST(REGISTER_FUNCTION)
-};
+} BuiltinEntries[] = {BUILTIN_NATIVE_LIST(REGISTER_FUNCTION)};
 
 
 void Builtin_DummyNative(Dart_NativeArguments args) {
@@ -49,7 +44,6 @@
 }
 
 
-
 /**
  * Looks up native functions in both libdart_builtin and libdart_io.
  */
@@ -109,10 +103,9 @@
   fflush(stdout);
   if (ShouldCaptureStdout()) {
     // For now we report print output on the Stdout stream.
-    uint8_t newline[] = { '\n' };
+    uint8_t newline[] = {'\n'};
     Dart_ServiceSendDataEvent("Stdout", "WriteEvent", chars, length);
-    Dart_ServiceSendDataEvent("Stdout", "WriteEvent",
-                              newline, sizeof(newline));
+    Dart_ServiceSendDataEvent("Stdout", "WriteEvent", newline, sizeof(newline));
   }
 }
 
diff --git a/runtime/bin/builtin_nolib.cc b/runtime/bin/builtin_nolib.cc
index 5ccf5c8..a61d915 100644
--- a/runtime/bin/builtin_nolib.cc
+++ b/runtime/bin/builtin_nolib.cc
@@ -14,13 +14,12 @@
 namespace bin {
 
 Builtin::builtin_lib_props Builtin::builtin_libraries_[] = {
-  /* { url_, source_, patch_url_, patch_source_, has_natives_ } */
-  { DartUtils::kBuiltinLibURL, NULL, NULL, NULL, true },
-  { DartUtils::kIOLibURL, NULL, NULL, NULL, true  },
+    /* { url_, source_, patch_url_, patch_source_, has_natives_ } */
+    {DartUtils::kBuiltinLibURL, NULL, NULL, NULL, true},
+    {DartUtils::kIOLibURL, NULL, NULL, NULL, true},
 
-  // End marker.
-  { NULL, NULL, NULL, NULL, false }
-};
+    // End marker.
+    {NULL, NULL, NULL, NULL, false}};
 
 Dart_Port Builtin::load_port_ = ILLEGAL_PORT;
 const int Builtin::num_libs_ =
@@ -33,14 +32,14 @@
 
 
 Dart_Handle Builtin::PartSource(BuiltinLibraryId id, const char* uri) {
-  return DartUtils::NewError(
-      "Unreachable code in Builtin::PartSource (%d).", id);
+  return DartUtils::NewError("Unreachable code in Builtin::PartSource (%d).",
+                             id);
 }
 
 
 Dart_Handle Builtin::GetSource(const char** source_paths, const char* uri) {
-  return DartUtils::NewError(
-      "Unreachable code in Builtin::GetSource (%s).", uri);
+  return DartUtils::NewError("Unreachable code in Builtin::GetSource (%s).",
+                             uri);
 }
 
 
@@ -60,8 +59,8 @@
 
 
 Dart_Handle Builtin::LoadLibrary(Dart_Handle url, BuiltinLibraryId id) {
-  return DartUtils::NewError(
-      "Unreachable code in Builtin::LoadLibrary (%d).", id);
+  return DartUtils::NewError("Unreachable code in Builtin::LoadLibrary (%d).",
+                             id);
 }
 
 
diff --git a/runtime/bin/common_patch.dart b/runtime/bin/common_patch.dart
index b485dc9a..3e9be62 100644
--- a/runtime/bin/common_patch.dart
+++ b/runtime/bin/common_patch.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+import 'dart:nativewrappers';
+
 @patch class _IOCrypto {
   @patch static Uint8List getRandomBytes(int count)
       native "Crypto_GetRandomBytes";
@@ -10,4 +12,4 @@
 _setupHooks() {
   VMLibraryHooks.eventHandlerSendData = _EventHandler._sendData;
   VMLibraryHooks.timerMillisecondClock = _EventHandler._timerMillisecondClock;
-}
\ No newline at end of file
+}
diff --git a/runtime/bin/crypto.cc b/runtime/bin/crypto.cc
index ec4840f..24b5f2b 100644
--- a/runtime/bin/crypto.cc
+++ b/runtime/bin/crypto.cc
@@ -14,11 +14,11 @@
   Dart_Handle count_obj = Dart_GetNativeArgument(args, 0);
   const int64_t kMaxRandomBytes = 4096;
   int64_t count64 = 0;
-  if (!DartUtils::GetInt64Value(count_obj, &count64) ||
-      (count64 < 0) || (count64 > kMaxRandomBytes)) {
-    Dart_Handle error =
-        DartUtils::NewString("Invalid argument: count must be a positive int "
-                             "less than or equal to 4096.");
+  if (!DartUtils::GetInt64Value(count_obj, &count64) || (count64 < 0) ||
+      (count64 > kMaxRandomBytes)) {
+    Dart_Handle error = DartUtils::NewString(
+        "Invalid argument: count must be a positive int "
+        "less than or equal to 4096.");
     Dart_ThrowException(error);
   }
   intptr_t count = static_cast<intptr_t>(count64);
diff --git a/runtime/bin/crypto.h b/runtime/bin/crypto.h
index b82fc4f..5e39404 100644
--- a/runtime/bin/crypto.h
+++ b/runtime/bin/crypto.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_CRYPTO_H_
-#define BIN_CRYPTO_H_
+#ifndef RUNTIME_BIN_CRYPTO_H_
+#define RUNTIME_BIN_CRYPTO_H_
 
 #include "bin/builtin.h"
 #include "bin/utils.h"
@@ -23,5 +23,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_CRYPTO_H_
-
+#endif  // RUNTIME_BIN_CRYPTO_H_
diff --git a/runtime/bin/crypto_android.cc b/runtime/bin/crypto_android.cc
index 7a970d0..b83a71b 100644
--- a/runtime/bin/crypto_android.cc
+++ b/runtime/bin/crypto_android.cc
@@ -17,8 +17,8 @@
 
 bool Crypto::GetRandomBytes(intptr_t count, uint8_t* buffer) {
   ThreadSignalBlocker signal_blocker(SIGPROF);
-  intptr_t fd = TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(
-      open("/dev/urandom", O_RDONLY));
+  intptr_t fd =
+      TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(open("/dev/urandom", O_RDONLY));
   if (fd < 0) {
     return false;
   }
diff --git a/runtime/bin/crypto_fuchsia.cc b/runtime/bin/crypto_fuchsia.cc
index 04c5f22..a066574 100644
--- a/runtime/bin/crypto_fuchsia.cc
+++ b/runtime/bin/crypto_fuchsia.cc
@@ -17,10 +17,10 @@
   while (read < count) {
     const intptr_t remaining = count - read;
     const intptr_t len =
-        (MX_CPRNG_DRAW_MAX_LEN < remaining) ? MX_CPRNG_DRAW_MAX_LEN
-                                            : remaining;
-    const mx_ssize_t res = mx_cprng_draw(buffer + read, len);
-    if (res == ERR_INVALID_ARGS) {
+        (MX_CPRNG_DRAW_MAX_LEN < remaining) ? MX_CPRNG_DRAW_MAX_LEN : remaining;
+    mx_size_t res = 0;
+    const mx_status_t status = mx_cprng_draw(buffer + read, len, &res);
+    if (status != NO_ERROR) {
       return false;
     }
     read += res;
diff --git a/runtime/bin/crypto_linux.cc b/runtime/bin/crypto_linux.cc
index c2e4ccd..b618101 100644
--- a/runtime/bin/crypto_linux.cc
+++ b/runtime/bin/crypto_linux.cc
@@ -17,8 +17,8 @@
 
 bool Crypto::GetRandomBytes(intptr_t count, uint8_t* buffer) {
   ThreadSignalBlocker signal_blocker(SIGPROF);
-  intptr_t fd = TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(
-      open("/dev/urandom", O_RDONLY));
+  intptr_t fd =
+      TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(open("/dev/urandom", O_RDONLY));
   if (fd < 0) {
     return false;
   }
diff --git a/runtime/bin/crypto_macos.cc b/runtime/bin/crypto_macos.cc
index 7bea2ae..e2447c0 100644
--- a/runtime/bin/crypto_macos.cc
+++ b/runtime/bin/crypto_macos.cc
@@ -17,8 +17,8 @@
 
 bool Crypto::GetRandomBytes(intptr_t count, uint8_t* buffer) {
   ThreadSignalBlocker signal_blocker(SIGPROF);
-  intptr_t fd = TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(
-      open("/dev/urandom", O_RDONLY));
+  intptr_t fd =
+      TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(open("/dev/urandom", O_RDONLY));
   if (fd < 0) {
     return false;
   }
diff --git a/runtime/bin/dart_io_entries.txt b/runtime/bin/dart_io_entries.txt
index 4cfcd70..b24bd38 100644
--- a/runtime/bin/dart_io_entries.txt
+++ b/runtime/bin/dart_io_entries.txt
@@ -12,8 +12,13 @@
 dart:io,TlsException,TlsException.
 dart:io,X509Certificate,X509Certificate._
 dart:io,_ExternalBuffer,set:data
+dart:io,_ExternalBuffer,get:start
+dart:io,_ExternalBuffer,set:start
+dart:io,_ExternalBuffer,set:end
+dart:io,_ExternalBuffer,get:end
 dart:io,_Platform,set:_nativeScript
 dart:io,_ProcessStartStatus,set:_errorCode
 dart:io,_ProcessStartStatus,set:_errorMessage
+dart:io,_SecureFilterImpl,get:buffers
 dart:io,_SecureFilterImpl,get:ENCRYPTED_SIZE
 dart:io,_SecureFilterImpl,get:SIZE
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index e723764..cd005db 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -18,6 +18,7 @@
 
 #include "platform/assert.h"
 #include "platform/globals.h"
+#include "platform/memory_sanitizer.h"
 
 // Return the error from the containing function if handle is in error handle.
 #define RETURN_IF_ERROR(handle)                                                \
@@ -46,13 +47,56 @@
 const char* const DartUtils::kHttpScheme = "http:";
 const char* const DartUtils::kVMServiceLibURL = "dart:vmservice";
 
-const uint8_t DartUtils::magic_number[] = { 0xf5, 0xf5, 0xdc, 0xdc };
+
+struct MagicNumberData {
+  static const intptr_t kLength = 4;
+
+  const uint8_t bytes[kLength];
+  bool should_skip;
+};
+
+
+MagicNumberData snapshot_magic_number = {{0xf5, 0xf5, 0xdc, 0xdc}, true};
+MagicNumberData kernel_magic_number = {{0x90, 0xab, 0xcd, 0xef}, false};
+
+
+bool TryReadKernel(const char* script_uri,
+                   const uint8_t** kernel_file,
+                   intptr_t* kernel_length) {
+  *kernel_file = NULL;
+  *kernel_length = -1;
+  bool is_kernel_file = false;
+  void* script_file = DartUtils::OpenFile(script_uri, false);
+  if (script_file != NULL) {
+    const uint8_t* buffer = NULL;
+    DartUtils::ReadFile(&buffer, kernel_length, script_file);
+    DartUtils::CloseFile(script_file);
+    if (*kernel_length > 0 && buffer != NULL) {
+      // We need a temporary variable because SniffForMagicNumber modifies the
+      // buffer pointer to skip snapshot magic number.
+      const uint8_t* temp = buffer;
+      if (DartUtils::SniffForMagicNumber(&temp, kernel_length) !=
+          DartUtils::kKernelMagicNumber) {
+        free(const_cast<uint8_t*>(buffer));
+        *kernel_file = NULL;
+      } else {
+        // Do not free buffer if this is a kernel file - kernel_file will be
+        // backed by the same memory as the buffer and caller will own it.
+        // Caller is responsible for freeing the buffer when this function
+        // returns true.
+        is_kernel_file = true;
+        *kernel_file = buffer;
+      }
+    }
+  }
+  return is_kernel_file;
+}
 
 
 static bool IsWindowsHost() {
 #if defined(TARGET_OS_WINDOWS)
   return true;
-#else  // defined(TARGET_OS_WINDOWS)
+#else   // defined(TARGET_OS_WINDOWS)
   return false;
 #endif  // defined(TARGET_OS_WINDOWS)
 }
@@ -84,8 +128,9 @@
 }
 
 
-int64_t DartUtils::GetInt64ValueCheckRange(
-    Dart_Handle value_obj, int64_t lower, int64_t upper) {
+int64_t DartUtils::GetInt64ValueCheckRange(Dart_Handle value_obj,
+                                           int64_t lower,
+                                           int64_t upper) {
   int64_t value = DartUtils::GetIntegerValue(value_obj);
   if (value < lower || upper < value) {
     Dart_PropagateError(Dart_NewApiError("Value outside expected range"));
@@ -142,8 +187,8 @@
 
 
 Dart_Handle DartUtils::SetStringField(Dart_Handle handle,
-                               const char* name,
-                               const char* val) {
+                                      const char* name,
+                                      const char* val) {
   return Dart_SetField(handle, NewString(name), NewString(val));
 }
 
@@ -166,8 +211,8 @@
   static const intptr_t kDartExtensionSchemeLen = strlen(kDartExtensionScheme);
   // If the URL starts with "dartext:" then it is considered as a special
   // extension library URL which is handled differently from other URLs.
-  return
-      (strncmp(url_name, kDartExtensionScheme, kDartExtensionSchemeLen) == 0);
+  return (strncmp(url_name, kDartExtensionScheme, kDartExtensionSchemeLen) ==
+          0);
 }
 
 
@@ -191,14 +236,13 @@
 }
 
 
-void* DartUtils::MapExecutable(const char* name, intptr_t* len) {
-  File* file = File::Open(name, File::kRead);
-  if (file == NULL) {
-    return NULL;
+char* DartUtils::DirName(const char* url) {
+  const char* slash = strrchr(url, File::PathSeparator()[0]);
+  if (slash == NULL) {
+    return strdup(url);
+  } else {
+    return StringUtils::StrNDup(url, slash - url + 1);
   }
-  void* addr = file->MapExecutable(len);
-  file->Release();
-  return addr;
 }
 
 
@@ -208,9 +252,7 @@
 }
 
 
-void DartUtils::ReadFile(const uint8_t** data,
-                         intptr_t* len,
-                         void* stream) {
+void DartUtils::ReadFile(const uint8_t** data, intptr_t* len, void* stream) {
   ASSERT(data != NULL);
   ASSERT(len != NULL);
   ASSERT(stream != NULL);
@@ -254,7 +296,8 @@
 }
 
 
-static Dart_Handle SingleArgDart_Invoke(Dart_Handle lib, const char* method,
+static Dart_Handle SingleArgDart_Invoke(Dart_Handle lib,
+                                        const char* method,
                                         Dart_Handle arg) {
   const int kNumArgs = 1;
   Dart_Handle dart_args[kNumArgs];
@@ -300,7 +343,7 @@
     return Dart_NewApiError(error_msg);
   }
   Dart_Handle str = Dart_NewStringFromUTF8(text_buffer, len);
-  free(const_cast<uint8_t *>(text_buffer));
+  free(const_cast<uint8_t*>(text_buffer));
   return str;
 }
 
@@ -340,8 +383,7 @@
   Dart_Handle dart_args[kNumArgs];
   dart_args[0] = script_uri;
   return Dart_Invoke(DartUtils::BuiltinLib(),
-                     NewString("_resolveInWorkingDirectory"),
-                     kNumArgs,
+                     NewString("_resolveInWorkingDirectory"), kNumArgs,
                      dart_args);
 }
 
@@ -350,10 +392,8 @@
   const int kNumArgs = 1;
   Dart_Handle dart_args[kNumArgs];
   dart_args[0] = library_uri;
-  return Dart_Invoke(DartUtils::BuiltinLib(),
-                     NewString("_libraryFilePath"),
-                     kNumArgs,
-                     dart_args);
+  return Dart_Invoke(DartUtils::BuiltinLib(), NewString("_libraryFilePath"),
+                     kNumArgs, dart_args);
 }
 
 
@@ -361,10 +401,8 @@
   const int kNumArgs = 1;
   Dart_Handle dart_args[kNumArgs];
   dart_args[0] = url;
-  return Dart_Invoke(DartUtils::BuiltinLib(),
-                     NewString("_resolveScriptUri"),
-                     kNumArgs,
-                     dart_args);
+  return Dart_Invoke(DartUtils::BuiltinLib(), NewString("_resolveScriptUri"),
+                     kNumArgs, dart_args);
 }
 
 
@@ -377,8 +415,7 @@
   dart_args[1] = url;
   dart_args[2] = library_url;
   return Dart_Invoke(DartUtils::BuiltinLib(),
-                     DartUtils::NewString("_loadDataAsync"),
-                     kNumArgs,
+                     DartUtils::NewString("_loadDataAsync"), kNumArgs,
                      dart_args);
 }
 
@@ -415,17 +452,21 @@
     if (tag == Dart_kImportTag) {
       Builtin::BuiltinLibraryId id = Builtin::FindId(url_string);
       if (id == Builtin::kInvalidLibrary) {
-        return NewError("The built-in library '%s' is not available"
-                        " on the stand-alone VM.\n", url_string);
+        return NewError(
+            "The built-in library '%s' is not available"
+            " on the stand-alone VM.\n",
+            url_string);
       }
       return Builtin::LoadLibrary(url, id);
     } else {
       ASSERT(tag == Dart_kSourceTag);
       Builtin::BuiltinLibraryId id = Builtin::FindId(library_url_string);
       if (id == Builtin::kInvalidLibrary) {
-        return NewError("The built-in library '%s' is not available"
-                        " on the stand-alone VM. Trying to load"
-                        " '%s'.\n", library_url_string, url_string);
+        return NewError(
+            "The built-in library '%s' is not available"
+            " on the stand-alone VM. Trying to load"
+            " '%s'.\n",
+            library_url_string, url_string);
       }
       // Prepend the library URI to form a unique script URI for the part.
       intptr_t len = snprintf(NULL, 0, "%s/%s", library_url_string, url_string);
@@ -433,8 +474,7 @@
       snprintf(part_uri, len + 1, "%s/%s", library_url_string, url_string);
       Dart_Handle part_uri_obj = DartUtils::NewString(part_uri);
       free(part_uri);
-      return Dart_LoadSource(library,
-                             part_uri_obj, Dart_Null(),
+      return Dart_LoadSource(library, part_uri_obj, Dart_Null(),
                              Builtin::PartSource(id, url_string), 0, 0);
     }
     // All cases should have been handled above.
@@ -456,9 +496,7 @@
           "Relative paths for dart extensions are not supported: '%s'",
           extension_path);
     }
-    return Extensions::LoadExtension(lib_path_str,
-                                     extension_path,
-                                     library);
+    return Extensions::LoadExtension(lib_path_str, extension_path, library);
   }
 
   // Handle 'import' or 'part' requests for all other URIs. Call dart code to
@@ -467,159 +505,52 @@
 }
 
 
-const uint8_t* DartUtils::SniffForMagicNumber(const uint8_t* text_buffer,
-                                              intptr_t* buffer_len,
-                                              bool* is_snapshot) {
-  intptr_t len = sizeof(magic_number);
-  if (*buffer_len <= len) {
-    *is_snapshot = false;
-    return text_buffer;
-  }
-  for (intptr_t i = 0; i < len; i++) {
-    if (text_buffer[i] != magic_number[i]) {
-      *is_snapshot = false;
-      return text_buffer;
+static bool CheckMagicNumber(const uint8_t** buf,
+                             intptr_t* len,
+                             const MagicNumberData& magic_number) {
+  if ((*len >= MagicNumberData::kLength) &&
+      (memcmp(*buf, magic_number.bytes, MagicNumberData::kLength) == 0)) {
+    if (magic_number.should_skip) {
+      *buf += MagicNumberData::kLength;
+      *len -= MagicNumberData::kLength;
     }
+    return true;
   }
-  *is_snapshot = true;
-  ASSERT(*buffer_len > len);
-  *buffer_len -= len;
-  return text_buffer + len;
+  return false;
+}
+
+
+DartUtils::MagicNumber DartUtils::SniffForMagicNumber(const uint8_t** buf,
+                                                      intptr_t* len) {
+  if (CheckMagicNumber(buf, len, snapshot_magic_number)) {
+    return kSnapshotMagicNumber;
+  }
+
+  if (CheckMagicNumber(buf, len, kernel_magic_number)) {
+    return kKernelMagicNumber;
+  }
+
+  return kUnknownMagicNumber;
 }
 
 
 void DartUtils::WriteMagicNumber(File* file) {
   // Write a magic number and version information into the snapshot file.
-  bool bytes_written = file->WriteFully(magic_number, sizeof(magic_number));
+  bool bytes_written =
+      file->WriteFully(snapshot_magic_number.bytes, MagicNumberData::kLength);
   ASSERT(bytes_written);
 }
 
 
 Dart_Handle DartUtils::LoadScript(const char* script_uri) {
-  Dart_TimelineEvent("LoadScript",
-                     Dart_TimelineGetMicros(),
-                     Dart_GetMainPortId(),
-                     Dart_Timeline_Event_Async_Begin,
-                     0, NULL, NULL);
+  Dart_TimelineEvent("LoadScript", Dart_TimelineGetMicros(),
+                     Dart_GetMainPortId(), Dart_Timeline_Event_Async_Begin, 0,
+                     NULL, NULL);
   Dart_Handle uri = Dart_NewStringFromCString(script_uri);
   return LoadDataAsync_Invoke(Dart_Null(), uri, Dart_Null());
 }
 
 
-// Callback function, gets called from asynchronous script and library
-// reading code when there is an i/o error.
-void FUNCTION_NAME(Builtin_AsyncLoadError)(Dart_NativeArguments args) {
-  //  Dart_Handle source_uri = Dart_GetNativeArgument(args, 0);
-  Dart_Handle library_uri = Dart_GetNativeArgument(args, 1);
-  Dart_Handle error = Dart_GetNativeArgument(args, 2);
-
-  Dart_Handle library = Dart_LookupLibrary(library_uri);
-  // If a library with the given uri exists, give it a chance to handle
-  // the error. If the load requests stems from a deferred library load,
-  // an IO error is not fatal.
-  if (!Dart_IsError(library)) {
-    ASSERT(Dart_IsLibrary(library));
-    Dart_Handle res = Dart_LibraryHandleError(library, error);
-    if (Dart_IsNull(res)) {
-      return;
-    }
-  }
-  // The error was not handled above. Propagate an unhandled exception.
-  error = Dart_NewUnhandledExceptionError(error);
-  Dart_PropagateError(error);
-}
-
-
-// Callback function that gets called from dartutils when the library
-// source has been read. Loads the library or part into the VM.
-void FUNCTION_NAME(Builtin_LoadSource)(Dart_NativeArguments args) {
-  Dart_Handle tag_in = Dart_GetNativeArgument(args, 0);
-  Dart_Handle resolved_script_uri = Dart_GetNativeArgument(args, 1);
-  Dart_Handle library_uri = Dart_GetNativeArgument(args, 2);
-  Dart_Handle source_data = Dart_GetNativeArgument(args, 3);
-
-  Dart_TypedData_Type type = Dart_GetTypeOfExternalTypedData(source_data);
-  bool external = type == Dart_TypedData_kUint8;
-  uint8_t* data = NULL;
-  intptr_t num_bytes;
-  Dart_Handle result = Dart_TypedDataAcquireData(
-      source_data, &type, reinterpret_cast<void**>(&data), &num_bytes);
-  if (Dart_IsError(result)) Dart_PropagateError(result);
-
-  uint8_t* buffer_copy = NULL;
-  if (!external) {
-    // If the buffer is not external, take a copy.
-    buffer_copy = reinterpret_cast<uint8_t*>(malloc(num_bytes));
-    memmove(buffer_copy, data, num_bytes);
-    data = buffer_copy;
-  }
-
-  Dart_TypedDataReleaseData(source_data);
-
-  if (Dart_IsNull(tag_in) && Dart_IsNull(library_uri)) {
-    // Entry file. Check for payload and load accordingly.
-    bool is_snapshot = false;
-    const uint8_t *payload =
-        DartUtils::SniffForMagicNumber(data, &num_bytes, &is_snapshot);
-
-    if (is_snapshot) {
-      result = Dart_LoadScriptFromSnapshot(payload, num_bytes);
-    } else {
-      Dart_Handle source = Dart_NewStringFromUTF8(data, num_bytes);
-      if (Dart_IsError(source)) {
-        result = DartUtils::NewError("%s is not a valid UTF-8 script",
-                                     resolved_script_uri);
-      } else {
-        result = Dart_LoadScript(resolved_script_uri, Dart_Null(),
-                                 source, 0, 0);
-      }
-    }
-  } else {
-    int64_t tag = DartUtils::GetIntegerValue(tag_in);
-
-    Dart_Handle source = Dart_NewStringFromUTF8(data, num_bytes);
-    if (Dart_IsError(source)) {
-      result = DartUtils::NewError("%s is not a valid UTF-8 script",
-                                   resolved_script_uri);
-    } else {
-      if (tag == Dart_kImportTag) {
-        result = Dart_LoadLibrary(resolved_script_uri, Dart_Null(),
-                                  source, 0, 0);
-      } else {
-        ASSERT(tag == Dart_kSourceTag);
-        Dart_Handle library = Dart_LookupLibrary(library_uri);
-        if (Dart_IsError(library)) {
-          Dart_PropagateError(library);
-        }
-        result = Dart_LoadSource(library, resolved_script_uri, Dart_Null(),
-                                 source, 0, 0);
-      }
-    }
-  }
-
-  if (buffer_copy != NULL) {
-    free(buffer_copy);
-  }
-
-  if (Dart_IsError(result)) {
-    Dart_PropagateError(result);
-  }
-}
-
-
-// Callback function that gets called from dartutils when there are
-// no more outstanding load requests.
-void FUNCTION_NAME(Builtin_DoneLoading)(Dart_NativeArguments args) {
-  Dart_Handle res = Dart_FinalizeLoading(true);
-  if (Dart_IsError(res)) {
-    // TODO(hausner): If compilation/loading errors are supposed to
-    // be observable by the program, we need to mark the bad library
-    // with the error instead of propagating it.
-    Dart_PropagateError(res);
-  }
-}
-
-
 void FUNCTION_NAME(Builtin_GetCurrentDirectory)(Dart_NativeArguments args) {
   const char* current = Directory::Current();
   if (current != NULL) {
@@ -636,8 +567,8 @@
                                              bool is_service_isolate,
                                              bool trace_loading) {
   // Setup the internal library's 'internalPrint' function.
-  Dart_Handle print = Dart_Invoke(
-      builtin_lib, NewString("_getPrintClosure"), 0, NULL);
+  Dart_Handle print =
+      Dart_Invoke(builtin_lib, NewString("_getPrintClosure"), 0, NULL);
   RETURN_IF_ERROR(print);
   Dart_Handle result =
       Dart_SetField(internal_lib, NewString("_printClosure"), print);
@@ -649,8 +580,8 @@
       RETURN_IF_ERROR(result);
     }
     if (trace_loading) {
-      result = Dart_SetField(builtin_lib,
-                             NewString("_traceLoading"), Dart_True());
+      result =
+          Dart_SetField(builtin_lib, NewString("_traceLoading"), Dart_True());
       RETURN_IF_ERROR(result);
     }
     // Set current working directory.
@@ -666,12 +597,11 @@
                                           bool is_service_isolate) {
   if (!is_service_isolate) {
     // Setup the 'Uri.base' getter in dart:core.
-    Dart_Handle uri_base = Dart_Invoke(
-        builtin_lib, NewString("_getUriBaseClosure"), 0, NULL);
+    Dart_Handle uri_base =
+        Dart_Invoke(builtin_lib, NewString("_getUriBaseClosure"), 0, NULL);
     RETURN_IF_ERROR(uri_base);
-    Dart_Handle result = Dart_SetField(core_lib,
-                                       NewString("_uriBaseClosure"),
-                                       uri_base);
+    Dart_Handle result =
+        Dart_SetField(core_lib, NewString("_uriBaseClosure"), uri_base);
     RETURN_IF_ERROR(result);
   }
   return Dart_True();
@@ -680,14 +610,13 @@
 
 Dart_Handle DartUtils::PrepareAsyncLibrary(Dart_Handle async_lib,
                                            Dart_Handle isolate_lib) {
-  Dart_Handle schedule_immediate_closure =
-      Dart_Invoke(isolate_lib, NewString("_getIsolateScheduleImmediateClosure"),
-                  0, NULL);
+  Dart_Handle schedule_immediate_closure = Dart_Invoke(
+      isolate_lib, NewString("_getIsolateScheduleImmediateClosure"), 0, NULL);
   RETURN_IF_ERROR(schedule_immediate_closure);
   Dart_Handle args[1];
   args[0] = schedule_immediate_closure;
-  return Dart_Invoke(
-      async_lib, NewString("_setScheduleImmediateClosure"), 1, args);
+  return Dart_Invoke(async_lib, NewString("_setScheduleImmediateClosure"), 1,
+                     args);
 }
 
 
@@ -722,10 +651,8 @@
     const int kNumArgs = 1;
     Dart_Handle dart_args[kNumArgs];
     dart_args[0] = result;
-    result = Dart_Invoke(DartUtils::BuiltinLib(),
-                         NewString("_setPackageRoot"),
-                         kNumArgs,
-                         dart_args);
+    result = Dart_Invoke(DartUtils::BuiltinLib(), NewString("_setPackageRoot"),
+                         kNumArgs, dart_args);
     RETURN_IF_ERROR(result);
   } else if (packages_config != NULL) {
     Dart_Handle result = NewString(packages_config);
@@ -733,10 +660,8 @@
     const int kNumArgs = 1;
     Dart_Handle dart_args[kNumArgs];
     dart_args[0] = result;
-    result = Dart_Invoke(DartUtils::BuiltinLib(),
-                         NewString("_setPackagesMap"),
-                         kNumArgs,
-                         dart_args);
+    result = Dart_Invoke(DartUtils::BuiltinLib(), NewString("_setPackagesMap"),
+                         kNumArgs, dart_args);
     RETURN_IF_ERROR(result);
   }
   return Dart_True();
@@ -780,15 +705,13 @@
   Dart_Handle result = Dart_FinalizeLoading(false);
   RETURN_IF_ERROR(result);
 
-  result = PrepareBuiltinLibrary(builtin_lib,
-                                 internal_lib,
-                                 is_service_isolate,
+  result = PrepareBuiltinLibrary(builtin_lib, internal_lib, is_service_isolate,
                                  trace_loading);
   RETURN_IF_ERROR(result);
 
   RETURN_IF_ERROR(PrepareAsyncLibrary(async_lib, isolate_lib));
-  RETURN_IF_ERROR(PrepareCoreLibrary(
-      core_lib, builtin_lib, is_service_isolate));
+  RETURN_IF_ERROR(
+      PrepareCoreLibrary(core_lib, builtin_lib, is_service_isolate));
   RETURN_IF_ERROR(PrepareIsolateLibrary(isolate_lib));
   RETURN_IF_ERROR(PrepareIOLibrary(io_lib));
   return result;
@@ -896,16 +819,12 @@
 
 
 Dart_Handle DartUtils::NewDartArgumentError(const char* message) {
-  return NewDartExceptionWithMessage(kCoreLibURL,
-                                     "ArgumentError",
-                                     message);
+  return NewDartExceptionWithMessage(kCoreLibURL, "ArgumentError", message);
 }
 
 
 Dart_Handle DartUtils::NewDartUnsupportedError(const char* message) {
-  return NewDartExceptionWithMessage(kCoreLibURL,
-                                     "UnsupportedError",
-                                     message);
+  return NewDartExceptionWithMessage(kCoreLibURL, "UnsupportedError", message);
 }
 
 
@@ -913,9 +832,7 @@
                                           const char* message,
                                           Dart_Handle os_error) {
   // Create a dart:io exception object of the given type.
-  return NewDartExceptionWithOSError(kIOLibURL,
-                                     exception_name,
-                                     message,
+  return NewDartExceptionWithOSError(kIOLibURL, exception_name, message,
                                      os_error);
 }
 
@@ -927,6 +844,7 @@
   va_end(args);
 
   char* buffer = reinterpret_cast<char*>(Dart_ScopeAllocate(len + 1));
+  MSAN_UNPOISON(buffer, (len + 1));
   va_list args2;
   va_start(args2, format);
   vsnprintf(buffer, (len + 1), format, args2);
@@ -963,9 +881,9 @@
 // objects. As these will be used by different threads the use of
 // these depends on the fact that the marking internally in the
 // Dart_CObject structure is not marking simple value objects.
-Dart_CObject CObject::api_null_ = { Dart_CObject_kNull , { 0 } };
-Dart_CObject CObject::api_true_ = { Dart_CObject_kBool , { true } };
-Dart_CObject CObject::api_false_ = { Dart_CObject_kBool, { false } };
+Dart_CObject CObject::api_null_ = {Dart_CObject_kNull, {0}};
+Dart_CObject CObject::api_true_ = {Dart_CObject_kBool, {true}};
+Dart_CObject CObject::api_false_ = {Dart_CObject_kBool, {false}};
 CObject CObject::null_ = CObject(&api_null_);
 CObject CObject::true_ = CObject(&api_true_);
 CObject CObject::false_ = CObject(&api_false_);
@@ -1022,9 +940,8 @@
 
 
 static bool IsHexDigit(char c) {
-  return (('0' <= c) && (c <= '9'))
-      || (('A' <= c) && (c <= 'F'))
-      || (('a' <= c) && (c <= 'f'));
+  return (('0' <= c) && (c <= '9')) || (('A' <= c) && (c <= 'F')) ||
+         (('a' <= c) && (c <= 'f'));
 }
 
 
@@ -1194,7 +1111,7 @@
 
 
 Dart_CObject* CObject::NewUint32Array(intptr_t length) {
-  Dart_CObject* cobject = New(Dart_CObject_kTypedData, 4*length);
+  Dart_CObject* cobject = New(Dart_CObject_kTypedData, 4 * length);
   cobject->value.as_typed_data.type = Dart_TypedData_kUint32;
   cobject->value.as_typed_data.length = length;
   cobject->value.as_typed_data.values = reinterpret_cast<uint8_t*>(cobject + 1);
@@ -1203,7 +1120,9 @@
 
 
 Dart_CObject* CObject::NewExternalUint8Array(
-    intptr_t length, uint8_t* data, void* peer,
+    intptr_t length,
+    uint8_t* data,
+    void* peer,
     Dart_WeakPersistentHandleFinalizer callback) {
   Dart_CObject* cobject = New(Dart_CObject_kExternalTypedData);
   cobject->value.as_external_typed_data.type = Dart_TypedData_kUint8;
@@ -1224,17 +1143,15 @@
   }
   uint8_t* data = IOBuffer::Allocate(static_cast<intptr_t>(length));
   ASSERT(data != NULL);
-  return NewExternalUint8Array(
-      static_cast<intptr_t>(length), data, data, IOBuffer::Finalizer);
+  return NewExternalUint8Array(static_cast<intptr_t>(length), data, data,
+                               IOBuffer::Finalizer);
 }
 
 
 void CObject::FreeIOBufferData(Dart_CObject* cobject) {
   ASSERT(cobject->type == Dart_CObject_kExternalTypedData);
   cobject->value.as_external_typed_data.callback(
-      NULL,
-      NULL,
-      cobject->value.as_external_typed_data.peer);
+      NULL, NULL, cobject->value.as_external_typed_data.peer);
   cobject->value.as_external_typed_data.data = NULL;
 }
 
diff --git a/runtime/bin/dartutils.h b/runtime/bin/dartutils.h
index b9fe476..9cbebf6 100644
--- a/runtime/bin/dartutils.h
+++ b/runtime/bin/dartutils.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_DARTUTILS_H_
-#define BIN_DARTUTILS_H_
+#ifndef RUNTIME_BIN_DARTUTILS_H_
+#define RUNTIME_BIN_DARTUTILS_H_
 
 #include "bin/isolate_data.h"
 #include "include/dart_api.h"
@@ -33,12 +33,21 @@
   return handle;
 }
 
+// Tries to read [script_uri] as a Kernel IR file.  If successful this function
+// returns `true` and sets [kernel_file] and [kernel_length] to be the memory
+// contents.
+//
+// The caller is responsible for free()ing [kernel_file] if `true` was returned.
+bool TryReadKernel(const char* script_uri,
+                   const uint8_t** kernel_file,
+                   intptr_t* kernel_length);
+
 class CommandLineOptions {
  public:
   explicit CommandLineOptions(int max_count)
       : count_(0), max_count_(max_count), arguments_(NULL) {
     static const int kWordSize = sizeof(intptr_t);
-    arguments_ = reinterpret_cast<const char **>(malloc(max_count * kWordSize));
+    arguments_ = reinterpret_cast<const char**>(malloc(max_count * kWordSize));
     if (arguments_ == NULL) {
       max_count_ = 0;
     }
@@ -86,8 +95,9 @@
   // Returns the integer value of a Dart object. If the object is not
   // an integer value or outside the requested range an API error is
   // propagated.
-  static int64_t GetInt64ValueCheckRange(
-      Dart_Handle value_obj, int64_t lower, int64_t upper);
+  static int64_t GetInt64ValueCheckRange(Dart_Handle value_obj,
+                                         int64_t lower,
+                                         int64_t upper);
   // Returns the intptr_t value of a Dart object. If the object is not
   // an integer value or the value is outside the intptr_t range an
   // API error is propagated.
@@ -116,6 +126,7 @@
   static bool IsDartBuiltinLibURL(const char* url_name);
   static bool IsHttpSchemeURL(const char* url_name);
   static const char* RemoveScheme(const char* url);
+  static char* DirName(const char* url);
   static void* MapExecutable(const char* name, intptr_t* file_len);
   static void* OpenFile(const char* name, bool write);
   static void ReadFile(const uint8_t** data, intptr_t* file_len, void* stream);
@@ -168,8 +179,8 @@
   // Allocate length bytes for a C string with Dart_ScopeAllocate.
   static char* ScopedCString(intptr_t length) {
     char* result = NULL;
-    result = reinterpret_cast<char*>(
-        Dart_ScopeAllocate(length * sizeof(*result)));
+    result =
+        reinterpret_cast<char*>(Dart_ScopeAllocate(length * sizeof(*result)));
     return result;
   }
 
@@ -200,14 +211,21 @@
   static Dart_Handle ResolveUriInWorkingDirectory(Dart_Handle script_uri);
   static Dart_Handle ResolveScript(Dart_Handle url);
 
+  enum MagicNumber {
+    kSnapshotMagicNumber,
+    kKernelMagicNumber,
+    kUnknownMagicNumber
+  };
+
+  // static const uint8_t* GetMagicNumber(MagicNumber number);
+
   // Sniffs the specified text_buffer to see if it contains the magic number
   // representing a script snapshot. If the text_buffer is a script snapshot
   // the return value is an updated pointer to the text_buffer pointing past
   // the magic number value. The 'buffer_len' parameter is also appropriately
   // adjusted.
-  static const uint8_t* SniffForMagicNumber(const uint8_t* text_buffer,
-                                            intptr_t* buffer_len,
-                                            bool* is_snapshot);
+  static MagicNumber SniffForMagicNumber(const uint8_t** text_buffer,
+                                         intptr_t* buffer_len);
 
   // Write a magic number to indicate a script snapshot file.
   static void WriteMagicNumber(File* file);
@@ -231,8 +249,6 @@
   static const char* const kHttpScheme;
   static const char* const kVMServiceLibURL;
 
-  static const uint8_t magic_number[];
-
   static Dart_Handle LibraryFilePath(Dart_Handle library_uri);
 
  private:
@@ -242,10 +258,10 @@
                                            bool is_service_isolate,
                                            bool trace_loading);
   static Dart_Handle PrepareCoreLibrary(Dart_Handle core_lib,
-                                 Dart_Handle builtin_lib,
-                                 bool is_service_isolate);
+                                        Dart_Handle builtin_lib,
+                                        bool is_service_isolate);
   static Dart_Handle PrepareAsyncLibrary(Dart_Handle async_lib,
-                                  Dart_Handle isolate_lib);
+                                         Dart_Handle isolate_lib);
   static Dart_Handle PrepareIOLibrary(Dart_Handle io_lib);
   static Dart_Handle PrepareIsolateLibrary(Dart_Handle isolate_lib);
 
@@ -262,7 +278,7 @@
   static const int kOSError = 2;
   static const int kFileClosedError = 3;
 
-  explicit CObject(Dart_CObject *cobject) : cobject_(cobject) {}
+  explicit CObject(Dart_CObject* cobject) : cobject_(cobject) {}
   Dart_CObject_Type type() { return cobject_->type; }
   Dart_TypedData_Type byte_array_type() {
     ASSERT(type() == Dart_CObject_kTypedData ||
@@ -295,9 +311,7 @@
     return type() == Dart_CObject_kBool && !cobject_->value.as_bool;
   }
 
-  void* operator new(size_t size) {
-    return Dart_ScopeAllocate(size);
-  }
+  void* operator new(size_t size) { return Dart_ScopeAllocate(size); }
 
   static CObject* Null();
   static CObject* True();
@@ -315,7 +329,9 @@
   static Dart_CObject* NewUint8Array(intptr_t length);
   static Dart_CObject* NewUint32Array(intptr_t length);
   static Dart_CObject* NewExternalUint8Array(
-      intptr_t length, uint8_t* data, void* peer,
+      intptr_t length,
+      uint8_t* data,
+      void* peer,
       Dart_WeakPersistentHandleFinalizer callback);
 
   static Dart_CObject* NewIOBuffer(int64_t length);
@@ -352,7 +368,7 @@
 
 
 #define DECLARE_COBJECT_CONSTRUCTORS(t)                                        \
-  explicit CObject##t(Dart_CObject *cobject) : CObject(cobject) {              \
+  explicit CObject##t(Dart_CObject* cobject) : CObject(cobject) {              \
     ASSERT(type() == Dart_CObject_k##t);                                       \
     cobject_ = cobject;                                                        \
   }                                                                            \
@@ -360,11 +376,11 @@
     ASSERT(cobject != NULL);                                                   \
     ASSERT(cobject->type() == Dart_CObject_k##t);                              \
     cobject_ = cobject->AsApiCObject();                                        \
-  }                                                                            \
+  }
 
 
 #define DECLARE_COBJECT_TYPED_DATA_CONSTRUCTORS(t)                             \
-  explicit CObject##t##Array(Dart_CObject *cobject) : CObject(cobject) {       \
+  explicit CObject##t##Array(Dart_CObject* cobject) : CObject(cobject) {       \
     ASSERT(type() == Dart_CObject_kTypedData);                                 \
     ASSERT(byte_array_type() == Dart_TypedData_k##t);                          \
     cobject_ = cobject;                                                        \
@@ -374,11 +390,11 @@
     ASSERT(cobject->type() == Dart_CObject_kTypedData);                        \
     ASSERT(cobject->byte_array_type() == Dart_TypedData_k##t);                 \
     cobject_ = cobject->AsApiCObject();                                        \
-  }                                                                            \
+  }
 
 
 #define DECLARE_COBJECT_EXTERNAL_TYPED_DATA_CONSTRUCTORS(t)                    \
-  explicit CObjectExternal##t##Array(Dart_CObject *cobject)                    \
+  explicit CObjectExternal##t##Array(Dart_CObject* cobject)                    \
       : CObject(cobject) {                                                     \
     ASSERT(type() == Dart_CObject_kExternalTypedData);                         \
     ASSERT(byte_array_type() == Dart_TypedData_k##t);                          \
@@ -389,7 +405,7 @@
     ASSERT(cobject->type() == Dart_CObject_kExternalTypedData);                \
     ASSERT(cobject->byte_array_type() == Dart_TypedData_k##t);                 \
     cobject_ = cobject->AsApiCObject();                                        \
-  }                                                                            \
+  }
 
 
 class CObjectBool : public CObject {
@@ -427,7 +443,7 @@
 
 class CObjectIntptr : public CObject {
  public:
-  explicit CObjectIntptr(Dart_CObject *cobject) : CObject(cobject) {
+  explicit CObjectIntptr(Dart_CObject* cobject) : CObject(cobject) {
     ASSERT(type() == Dart_CObject_kInt32 || type() == Dart_CObject_kInt64);
     cobject_ = cobject;
   }
@@ -438,7 +454,7 @@
     cobject_ = cobject->AsApiCObject();
   }
 
-  intptr_t Value()  {
+  intptr_t Value() {
     intptr_t result;
     if (type() == Dart_CObject_kInt32) {
       result = cobject_->value.as_int32;
@@ -457,7 +473,7 @@
 class CObjectBigint : public CObject {
  public:
   // DECLARE_COBJECT_CONSTRUCTORS(Bigint) would miss hex_value_ initialization.
-  explicit CObjectBigint(Dart_CObject *cobject) : CObject(cobject) {
+  explicit CObjectBigint(Dart_CObject* cobject) : CObject(cobject) {
     ASSERT(type() == Dart_CObject_kBigint);
     cobject_ = cobject;
     hex_value_ = NULL;
@@ -477,9 +493,7 @@
     return hex_value_;
   }
 
-  ~CObjectBigint() {
-    free(hex_value_);
-  }
+  ~CObjectBigint() { free(hex_value_); }
 
  private:
   char* hex_value_;
@@ -541,7 +555,7 @@
 
 class CObjectTypedData : public CObject {
  public:
-  explicit CObjectTypedData(Dart_CObject *cobject) : CObject(cobject) {
+  explicit CObjectTypedData(Dart_CObject* cobject) : CObject(cobject) {
     ASSERT(type() == Dart_CObject_kTypedData);
     cobject_ = cobject;
   }
@@ -597,13 +611,9 @@
 
 class ScopedBlockingCall {
  public:
-  ScopedBlockingCall() {
-    Dart_ThreadDisableProfiling();
-  }
+  ScopedBlockingCall() { Dart_ThreadDisableProfiling(); }
 
-  ~ScopedBlockingCall() {
-    Dart_ThreadEnableProfiling();
-  }
+  ~ScopedBlockingCall() { Dart_ThreadEnableProfiling(); }
 
  private:
   DISALLOW_ALLOCATION();
@@ -621,8 +631,8 @@
  public:
   explicit ScopedMemBuffer(Dart_Handle object) {
     if (!Dart_IsTypedData(object) && !Dart_IsList(object)) {
-      Dart_ThrowException(DartUtils::NewDartArgumentError(
-          "Argument is not a List<int>"));
+      Dart_ThrowException(
+          DartUtils::NewDartArgumentError("Argument is not a List<int>"));
     }
 
     uint8_t* bytes = NULL;
@@ -632,10 +642,7 @@
       is_typed_data = true;
       Dart_TypedData_Type typ;
       ThrowIfError(Dart_TypedDataAcquireData(
-          object,
-          &typ,
-          reinterpret_cast<void**>(&bytes),
-          &bytes_len));
+          object, &typ, reinterpret_cast<void**>(&bytes), &bytes_len));
     } else {
       ASSERT(Dart_IsList(object));
       ThrowIfError(Dart_ListLength(object, &bytes_len));
@@ -672,4 +679,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_DARTUTILS_H_
+#endif  // RUNTIME_BIN_DARTUTILS_H_
diff --git a/runtime/bin/directory.cc b/runtime/bin/directory.cc
index ccf5918..3997a32d 100644
--- a/runtime/bin/directory.cc
+++ b/runtime/bin/directory.cc
@@ -79,12 +79,12 @@
 void FUNCTION_NAME(Directory_CreateTemp)(Dart_NativeArguments args) {
   Dart_Handle path = Dart_GetNativeArgument(args, 0);
   if (!Dart_IsString(path)) {
-    Dart_SetReturnValue(args, DartUtils::NewDartArgumentError(
-        "Prefix argument of CreateSystemTempSync is not a String"));
+    Dart_SetReturnValue(
+        args, DartUtils::NewDartArgumentError(
+                  "Prefix argument of CreateSystemTempSync is not a String"));
     return;
   }
-  const char* result =
-      Directory::CreateTemp(DartUtils::GetStringValue(path));
+  const char* result = Directory::CreateTemp(DartUtils::GetStringValue(path));
   if (result != NULL) {
     Dart_SetReturnValue(args, DartUtils::NewString(result));
   } else {
@@ -126,8 +126,7 @@
   Dart_Handle follow_links = Dart_GetNativeArgument(args, 3);
   // Pass the list that should hold the directory listing to the
   // SyncDirectoryListing object, which adds elements to it.
-  SyncDirectoryListing sync_listing(results,
-                                    DartUtils::GetStringValue(path),
+  SyncDirectoryListing sync_listing(results, DartUtils::GetStringValue(path),
                                     DartUtils::GetBooleanValue(recursive),
                                     DartUtils::GetBooleanValue(follow_links));
   Directory::List(&sync_listing);
@@ -142,10 +141,9 @@
   AsyncDirectoryListing* listing;
   Dart_Handle dart_this = ThrowIfError(Dart_GetNativeArgument(args, 0));
   ASSERT(Dart_IsInstance(dart_this));
-  ThrowIfError(Dart_GetNativeInstanceField(
-      dart_this,
-      kAsyncDirectoryListerFieldIndex,
-      reinterpret_cast<intptr_t*>(&listing)));
+  ThrowIfError(
+      Dart_GetNativeInstanceField(dart_this, kAsyncDirectoryListerFieldIndex,
+                                  reinterpret_cast<intptr_t*>(&listing)));
   if (listing != NULL) {
     intptr_t listing_pointer = reinterpret_cast<intptr_t>(listing);
     // Increment the listing's reference count. This native should only be
@@ -173,15 +171,10 @@
       DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 1));
   AsyncDirectoryListing* listing =
       reinterpret_cast<AsyncDirectoryListing*>(listing_pointer);
-  Dart_NewWeakPersistentHandle(
-      dart_this,
-      reinterpret_cast<void*>(listing),
-      sizeof(*listing),
-      ReleaseListing);
+  Dart_NewWeakPersistentHandle(dart_this, reinterpret_cast<void*>(listing),
+                               sizeof(*listing), ReleaseListing);
   Dart_Handle result = Dart_SetNativeInstanceField(
-      dart_this,
-      kAsyncDirectoryListerFieldIndex,
-      listing_pointer);
+      dart_this, kAsyncDirectoryListerFieldIndex, listing_pointer);
   if (Dart_IsError(result)) {
     Log::PrintErr("SetAsyncDirectoryListerPointer failed\n");
     Dart_PropagateError(result);
@@ -214,8 +207,8 @@
 
 
 CObject* Directory::DeleteRequest(const CObjectArray& request) {
-  if ((request.Length() == 2) &&
-       request[0]->IsString() && request[1]->IsBool()) {
+  if ((request.Length() == 2) && request[0]->IsString() &&
+      request[1]->IsBool()) {
     CObjectString path(request[0]);
     CObjectBool recursive(request[1]);
     if (Directory::Delete(path.CString(), recursive.Value())) {
@@ -265,7 +258,7 @@
   // Respond with an illegal argument list error message.
   CObjectArray* error = new CObjectArray(CObject::NewArray(3));
   error->SetAt(0, new CObjectInt32(
-      CObject::NewInt32(AsyncDirectoryListing::kListError)));
+                      CObject::NewInt32(AsyncDirectoryListing::kListError)));
   error->SetAt(1, CObject::Null());
   error->SetAt(2, CObject::IllegalArgumentError());
   return error;
@@ -273,31 +266,27 @@
 
 
 CObject* Directory::ListStartRequest(const CObjectArray& request) {
-  if ((request.Length() == 3) &&
-      request[0]->IsString() &&
-      request[1]->IsBool() &&
-      request[2]->IsBool()) {
+  if ((request.Length() == 3) && request[0]->IsString() &&
+      request[1]->IsBool() && request[2]->IsBool()) {
     CObjectString path(request[0]);
     CObjectBool recursive(request[1]);
     CObjectBool follow_links(request[2]);
-    AsyncDirectoryListing* dir_listing =
-        new AsyncDirectoryListing(path.CString(),
-                                  recursive.Value(),
-                                  follow_links.Value());
+    AsyncDirectoryListing* dir_listing = new AsyncDirectoryListing(
+        path.CString(), recursive.Value(), follow_links.Value());
     if (dir_listing->error()) {
       // Report error now, so we capture the correct OSError.
       CObject* err = CObject::NewOSError();
       dir_listing->Release();
       CObjectArray* error = new CObjectArray(CObject::NewArray(3));
-      error->SetAt(0, new CObjectInt32(
-          CObject::NewInt32(AsyncDirectoryListing::kListError)));
+      error->SetAt(0, new CObjectInt32(CObject::NewInt32(
+                          AsyncDirectoryListing::kListError)));
       error->SetAt(1, request[0]);
       error->SetAt(2, err);
       return error;
     }
     // TODO(ajohnsen): Consider returning the first few results.
-    return new CObjectIntptr(CObject::NewIntptr(
-        reinterpret_cast<intptr_t>(dir_listing)));
+    return new CObjectIntptr(
+        CObject::NewIntptr(reinterpret_cast<intptr_t>(dir_listing)));
   }
   return CreateIllegalArgumentError();
 }
@@ -346,8 +335,7 @@
 
 
 CObject* Directory::RenameRequest(const CObjectArray& request) {
-  if ((request.Length() == 2) &&
-      request[0]->IsString() &&
+  if ((request.Length() == 2) && request[0]->IsString() &&
       request[1]->IsString()) {
     CObjectString path(request[0]);
     CObjectString new_path(request[1]);
@@ -401,7 +389,7 @@
   // Delay calling CurrentPath() until after CObject::NewOSError() in case
   // CurrentPath() pollutes the OS error code.
   response->SetAt(1, new CObjectString(CObject::NewString(
-      error() ? "Invalid path" : CurrentPath())));
+                         error() ? "Invalid path" : CurrentPath())));
   response->SetAt(2, err);
   array_->SetAt(index_++, response);
   return index_ < length_;
@@ -410,8 +398,7 @@
 
 bool SyncDirectoryListing::HandleDirectory(const char* dir_name) {
   Dart_Handle dir_name_dart = DartUtils::NewString(dir_name);
-  Dart_Handle dir =
-      Dart_New(directory_type_, Dart_Null(), 1, &dir_name_dart);
+  Dart_Handle dir = Dart_New(directory_type_, Dart_Null(), 1, &dir_name_dart);
   Dart_Handle result = Dart_Invoke(results_, add_string_, 1, &dir);
   if (Dart_IsError(result)) {
     Dart_PropagateError(result);
@@ -422,8 +409,7 @@
 
 bool SyncDirectoryListing::HandleLink(const char* link_name) {
   Dart_Handle link_name_dart = DartUtils::NewString(link_name);
-  Dart_Handle link =
-      Dart_New(link_type_, Dart_Null(), 1, &link_name_dart);
+  Dart_Handle link = Dart_New(link_type_, Dart_Null(), 1, &link_name_dart);
   Dart_Handle result = Dart_Invoke(results_, add_string_, 1, &link);
   if (Dart_IsError(result)) {
     Dart_PropagateError(result);
@@ -434,8 +420,7 @@
 
 bool SyncDirectoryListing::HandleFile(const char* file_name) {
   Dart_Handle file_name_dart = DartUtils::NewString(file_name);
-  Dart_Handle file =
-      Dart_New(file_type_, Dart_Null(), 1, &file_name_dart);
+  Dart_Handle file = Dart_New(file_type_, Dart_Null(), 1, &file_name_dart);
   Dart_Handle result = Dart_Invoke(results_, add_string_, 1, &file);
   if (Dart_IsError(result)) {
     Dart_PropagateError(result);
@@ -452,9 +437,7 @@
   args[2] = dart_os_error;
   Dart_ThrowException(Dart_New(
       DartUtils::GetDartType(DartUtils::kIOLibURL, "FileSystemException"),
-      Dart_Null(),
-      3,
-      args));
+      Dart_Null(), 3, args));
   return true;
 }
 
@@ -497,7 +480,8 @@
     listing->HandleError();
     listing->HandleDone();
   } else {
-    while (ListNext(listing)) {}
+    while (ListNext(listing)) {
+    }
   }
 }
 
diff --git a/runtime/bin/directory.h b/runtime/bin/directory.h
index ee1f389..86026b7 100644
--- a/runtime/bin/directory.h
+++ b/runtime/bin/directory.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_DIRECTORY_H_
-#define BIN_DIRECTORY_H_
+#ifndef RUNTIME_BIN_DIRECTORY_H_
+#define RUNTIME_BIN_DIRECTORY_H_
 
 #include "bin/builtin.h"
 #include "bin/dartutils.h"
@@ -38,9 +38,7 @@
 
   void Reset(intptr_t new_length);
 
-  intptr_t length() const {
-    return length_;
-  }
+  intptr_t length() const { return length_; }
 
  private:
   void* data_;
@@ -64,23 +62,17 @@
 class DirectoryListingEntry {
  public:
   explicit DirectoryListingEntry(DirectoryListingEntry* parent)
-    : parent_(parent), lister_(0), done_(false), link_(NULL) {}
+      : parent_(parent), lister_(0), done_(false), link_(NULL) {}
 
   ~DirectoryListingEntry();
 
   ListType Next(DirectoryListing* listing);
 
-  DirectoryListingEntry* parent() const {
-    return parent_;
-  }
+  DirectoryListingEntry* parent() const { return parent_; }
 
-  LinkList* link() {
-    return link_;
-  }
+  LinkList* link() { return link_; }
 
-  void set_link(LinkList* link) {
-    link_ = link;
-  }
+  void set_link(LinkList* link) { link_ = link; }
 
   void ResetLink();
 
@@ -97,19 +89,17 @@
 class DirectoryListing {
  public:
   DirectoryListing(const char* dir_name, bool recursive, bool follow_links)
-    : top_(NULL),
-      error_(false),
-      recursive_(recursive),
-      follow_links_(follow_links) {
+      : top_(NULL),
+        error_(false),
+        recursive_(recursive),
+        follow_links_(follow_links) {
     if (!path_buffer_.Add(dir_name)) {
       error_ = true;
     }
     Push(new DirectoryListingEntry(NULL));
   }
 
-  virtual ~DirectoryListing() {
-    PopAll();
-  }
+  virtual ~DirectoryListing() { PopAll(); }
 
   virtual bool HandleDirectory(const char* dir_name) = 0;
   virtual bool HandleFile(const char* file_name) = 0;
@@ -117,9 +107,7 @@
   virtual bool HandleError() = 0;
   virtual void HandleDone() {}
 
-  void Push(DirectoryListingEntry* directory) {
-    top_ = directory;
-  }
+  void Push(DirectoryListingEntry* directory) { top_ = directory; }
 
   void Pop() {
     ASSERT(!IsEmpty());
@@ -128,9 +116,7 @@
     delete current;
   }
 
-  bool IsEmpty() const {
-    return top_ == NULL;
-  }
+  bool IsEmpty() const { return top_ == NULL; }
 
   void PopAll() {
     while (!IsEmpty()) {
@@ -138,29 +124,17 @@
     }
   }
 
-  DirectoryListingEntry* top() const {
-    return top_;
-  }
+  DirectoryListingEntry* top() const { return top_; }
 
-  bool recursive() const {
-    return recursive_;
-  }
+  bool recursive() const { return recursive_; }
 
-  bool follow_links() const {
-    return follow_links_;
-  }
+  bool follow_links() const { return follow_links_; }
 
-  const char* CurrentPath() {
-    return path_buffer_.AsScopedString();
-  }
+  const char* CurrentPath() { return path_buffer_.AsScopedString(); }
 
-  PathBuffer& path_buffer() {
-    return path_buffer_;
-  }
+  PathBuffer& path_buffer() { return path_buffer_; }
 
-  bool error() const {
-    return error_;
-  }
+  bool error() const { return error_; }
 
  private:
   PathBuffer path_buffer_;
@@ -182,9 +156,7 @@
     kListDone = 4
   };
 
-  AsyncDirectoryListing(const char* dir_name,
-                        bool recursive,
-                        bool follow_links)
+  AsyncDirectoryListing(const char* dir_name, bool recursive, bool follow_links)
       : ReferenceCounted(),
         DirectoryListing(dir_name, recursive, follow_links),
         array_(NULL),
@@ -204,9 +176,7 @@
     length_ = length;
   }
 
-  intptr_t index() const {
-    return index_;
-  }
+  intptr_t index() const { return index_; }
 
  private:
   virtual ~AsyncDirectoryListing() {}
@@ -220,21 +190,17 @@
 };
 
 
-class SyncDirectoryListing: public DirectoryListing {
+class SyncDirectoryListing : public DirectoryListing {
  public:
   SyncDirectoryListing(Dart_Handle results,
                        const char* dir_name,
                        bool recursive,
                        bool follow_links)
-      : DirectoryListing(dir_name, recursive, follow_links),
-        results_(results) {
+      : DirectoryListing(dir_name, recursive, follow_links), results_(results) {
     add_string_ = DartUtils::NewString("add");
-    directory_type_ =
-        DartUtils::GetDartType(DartUtils::kIOLibURL, "Directory");
-    file_type_ =
-        DartUtils::GetDartType(DartUtils::kIOLibURL, "File");
-    link_type_ =
-        DartUtils::GetDartType(DartUtils::kIOLibURL, "Link");
+    directory_type_ = DartUtils::GetDartType(DartUtils::kIOLibURL, "Directory");
+    file_type_ = DartUtils::GetDartType(DartUtils::kIOLibURL, "File");
+    link_type_ = DartUtils::GetDartType(DartUtils::kIOLibURL, "Link");
   }
   virtual ~SyncDirectoryListing() {}
   virtual bool HandleDirectory(const char* dir_name);
@@ -256,11 +222,7 @@
 
 class Directory {
  public:
-  enum ExistsResult {
-    UNKNOWN,
-    EXISTS,
-    DOES_NOT_EXIST
-  };
+  enum ExistsResult { UNKNOWN, EXISTS, DOES_NOT_EXIST };
 
   static void List(DirectoryListing* listing);
   static ExistsResult Exists(const char* path);
@@ -300,4 +262,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_DIRECTORY_H_
+#endif  // RUNTIME_BIN_DIRECTORY_H_
diff --git a/runtime/bin/directory_android.cc b/runtime/bin/directory_android.cc
index 75ca974..e61d513 100644
--- a/runtime/bin/directory_android.cc
+++ b/runtime/bin/directory_android.cc
@@ -7,12 +7,12 @@
 
 #include "bin/directory.h"
 
-#include <dirent.h>  // NOLINT
-#include <errno.h>  // NOLINT
-#include <string.h>  // NOLINT
+#include <dirent.h>     // NOLINT
+#include <errno.h>      // NOLINT
+#include <string.h>     // NOLINT
 #include <sys/param.h>  // NOLINT
-#include <sys/stat.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <sys/stat.h>   // NOLINT
+#include <unistd.h>     // NOLINT
 
 #include "bin/dartutils.h"
 #include "bin/file.h"
@@ -56,13 +56,9 @@
 
 bool PathBuffer::Add(const char* name) {
   char* data = AsString();
-  int written = snprintf(data + length_,
-                         PATH_MAX - length_,
-                         "%s",
-                         name);
+  int written = snprintf(data + length_, PATH_MAX - length_, "%s", name);
   data[PATH_MAX] = '\0';
-  if ((written <= PATH_MAX - length_) &&
-      (written >= 0) &&
+  if ((written <= PATH_MAX - length_) && (written >= 0) &&
       (static_cast<size_t>(written) == strnlen(name, PATH_MAX + 1))) {
     length_ += written;
     return true;
@@ -119,8 +115,8 @@
   int status = 0;
   dirent entry;
   dirent* result;
-  status = NO_RETRY_EXPECTED(readdir_r(
-      reinterpret_cast<DIR*>(lister_), &entry, &result));
+  status = NO_RETRY_EXPECTED(
+      readdir_r(reinterpret_cast<DIR*>(lister_), &entry, &result));
   if ((status == 0) && (result != NULL)) {
     if (!listing->path_buffer().Add(entry.d_name)) {
       done_ = true;
@@ -139,8 +135,8 @@
         if (!listing->follow_links()) {
           return kListLink;
         }
-        // Else fall through to next case.
-        // Fall through.
+      // Else fall through to next case.
+      // Fall through.
       case DT_UNKNOWN: {
         // On some file systems the entry type is not determined by
         // readdir_r. For those and for links we use stat to determine
@@ -155,9 +151,7 @@
         }
         if (listing->follow_links() && S_ISLNK(entry_info.st_mode)) {
           // Check to see if we are in a loop created by a symbolic link.
-          LinkList current_link = { entry_info.st_dev,
-                                    entry_info.st_ino,
-                                    link_ };
+          LinkList current_link = {entry_info.st_dev, entry_info.st_ino, link_};
           LinkList* previous = link_;
           while (previous != NULL) {
             if ((previous->dev == current_link.dev) &&
@@ -234,14 +228,12 @@
 static bool DeleteRecursively(PathBuffer* path);
 
 
-static bool DeleteFile(char* file_name,
-                       PathBuffer* path) {
+static bool DeleteFile(char* file_name, PathBuffer* path) {
   return path->Add(file_name) && (unlink(path->AsString()) == 0);
 }
 
 
-static bool DeleteDir(char* dir_name,
-                      PathBuffer* path) {
+static bool DeleteDir(char* dir_name, PathBuffer* path) {
   if ((strcmp(dir_name, ".") == 0) || (strcmp(dir_name, "..") == 0)) {
     return true;
   }
@@ -281,7 +273,7 @@
     if (result == NULL) {
       // End of directory.
       return NO_RETRY_EXPECTED(closedir(dir_pointer)) == 0 &&
-          NO_RETRY_EXPECTED(remove(path->AsString())) == 0;
+             NO_RETRY_EXPECTED(remove(path->AsString())) == 0;
     }
     bool ok = false;
     switch (entry.d_type) {
@@ -344,19 +336,14 @@
       return DOES_NOT_EXIST;
     }
   } else {
-    if ((errno == EACCES) ||
-        (errno == EBADF) ||
-        (errno == EFAULT) ||
-        (errno == ENOMEM) ||
-        (errno == EOVERFLOW)) {
+    if ((errno == EACCES) || (errno == EBADF) || (errno == EFAULT) ||
+        (errno == ENOMEM) || (errno == EOVERFLOW)) {
       // Search permissions denied for one of the directories in the
       // path or a low level error occured. We do not know if the
       // directory exists.
       return UNKNOWN;
     }
-    ASSERT((errno == ELOOP) ||
-           (errno == ENAMETOOLONG) ||
-           (errno == ENOENT) ||
+    ASSERT((errno == ELOOP) || (errno == ENAMETOOLONG) || (errno == ENOENT) ||
            (errno == ENOTDIR));
     return DOES_NOT_EXIST;
   }
@@ -406,13 +393,13 @@
   if (Directory::system_temp_path_override_ != NULL) {
     return DartUtils::ScopedCopyCString(Directory::system_temp_path_override_);
   }
-  // Android does not have a /tmp directory. A partial substitute,
-  // suitable for bring-up work and tests, is to create a tmp
-  // directory in /data/local/tmp.
-  //
-  // TODO(4413): In the long run, when running in an application we should
-  // probably use the appropriate directory from the Android API,
-  // probably what File.createTempFile uses.
+// Android does not have a /tmp directory. A partial substitute,
+// suitable for bring-up work and tests, is to create a tmp
+// directory in /data/local/tmp.
+//
+// TODO(4413): In the long run, when running in an application we should
+// probably use the appropriate directory from the Android API,
+// probably what File.createTempFile uses.
 #define ANDROID_TEMP_DIR "/data/local/tmp"
   struct stat st;
   if (stat(ANDROID_TEMP_DIR, &st) != 0) {
diff --git a/runtime/bin/directory_fuchsia.cc b/runtime/bin/directory_fuchsia.cc
index 1593ff7..24ecd27 100644
--- a/runtime/bin/directory_fuchsia.cc
+++ b/runtime/bin/directory_fuchsia.cc
@@ -7,11 +7,11 @@
 
 #include "bin/directory.h"
 
-#include <errno.h>  // NOLINT
-#include <stdlib.h>  // NOLINT
-#include <string.h>  // NOLINT
+#include <errno.h>     // NOLINT
+#include <stdlib.h>    // NOLINT
+#include <string.h>    // NOLINT
 #include <sys/stat.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <unistd.h>    // NOLINT
 
 #include "bin/dartutils.h"
 #include "bin/file.h"
@@ -60,13 +60,9 @@
     return false;
   }
   char* data = AsString();
-  int written = snprintf(data + length_,
-                         PATH_MAX - length_,
-                         "%s",
-                         name);
+  int written = snprintf(data + length_, PATH_MAX - length_, "%s", name);
   data[PATH_MAX] = '\0';
-  if ((written <= (PATH_MAX - length_)) &&
-      (written > 0) &&
+  if ((written <= (PATH_MAX - length_)) && (written > 0) &&
       (static_cast<size_t>(written) == strnlen(name, PATH_MAX + 1))) {
     length_ += written;
     return true;
@@ -109,19 +105,14 @@
       return DOES_NOT_EXIST;
     }
   } else {
-    if ((errno == EACCES) ||
-        (errno == EBADF) ||
-        (errno == EFAULT) ||
-        (errno == ENOMEM) ||
-        (errno == EOVERFLOW)) {
+    if ((errno == EACCES) || (errno == EBADF) || (errno == EFAULT) ||
+        (errno == ENOMEM) || (errno == EOVERFLOW)) {
       // Search permissions denied for one of the directories in the
       // path or a low level error occured. We do not know if the
       // directory exists.
       return UNKNOWN;
     }
-    ASSERT((errno == ELOOP) ||
-           (errno == ENAMETOOLONG) ||
-           (errno == ENOENT) ||
+    ASSERT((errno == ELOOP) || (errno == ENAMETOOLONG) || (errno == ENOENT) ||
            (errno == ENOTDIR));
     return DOES_NOT_EXIST;
   }
@@ -231,4 +222,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // defined(TARGET_OS_LINUX)
+#endif  // defined(TARGET_OS_FUCHSIA)
diff --git a/runtime/bin/directory_linux.cc b/runtime/bin/directory_linux.cc
index 2f2e6b0..43ee548 100644
--- a/runtime/bin/directory_linux.cc
+++ b/runtime/bin/directory_linux.cc
@@ -7,13 +7,13 @@
 
 #include "bin/directory.h"
 
-#include <dirent.h>  // NOLINT
-#include <errno.h>  // NOLINT
-#include <stdlib.h>  // NOLINT
-#include <string.h>  // NOLINT
+#include <dirent.h>     // NOLINT
+#include <errno.h>      // NOLINT
+#include <stdlib.h>     // NOLINT
+#include <string.h>     // NOLINT
 #include <sys/param.h>  // NOLINT
-#include <sys/stat.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <sys/stat.h>   // NOLINT
+#include <unistd.h>     // NOLINT
 
 #include "bin/dartutils.h"
 #include "bin/file.h"
@@ -57,13 +57,9 @@
 
 bool PathBuffer::Add(const char* name) {
   char* data = AsString();
-  int written = snprintf(data + length_,
-                         PATH_MAX - length_,
-                         "%s",
-                         name);
+  int written = snprintf(data + length_, PATH_MAX - length_, "%s", name);
   data[PATH_MAX] = '\0';
-  if ((written <= PATH_MAX - length_) &&
-      (written >= 0) &&
+  if ((written <= PATH_MAX - length_) && (written >= 0) &&
       (static_cast<size_t>(written) == strnlen(name, PATH_MAX + 1))) {
     length_ += written;
     return true;
@@ -137,8 +133,8 @@
         if (!listing->follow_links()) {
           return kListLink;
         }
-        // Else fall through to next case.
-        // Fall through.
+      // Else fall through to next case.
+      // Fall through.
       case DT_UNKNOWN: {
         // On some file systems the entry type is not determined by
         // readdir. For those and for links we use stat to determine
@@ -153,9 +149,7 @@
         }
         if (listing->follow_links() && S_ISLNK(entry_info.st_mode)) {
           // Check to see if we are in a loop created by a symbolic link.
-          LinkList current_link = { entry_info.st_dev,
-                                    entry_info.st_ino,
-                                    link_ };
+          LinkList current_link = {entry_info.st_dev, entry_info.st_ino, link_};
           LinkList* previous = link_;
           while (previous != NULL) {
             if ((previous->dev == current_link.dev) &&
@@ -231,15 +225,13 @@
 static bool DeleteRecursively(PathBuffer* path);
 
 
-static bool DeleteFile(char* file_name,
-                       PathBuffer* path) {
+static bool DeleteFile(char* file_name, PathBuffer* path) {
   return path->Add(file_name) &&
-      (NO_RETRY_EXPECTED(unlink(path->AsString())) == 0);
+         (NO_RETRY_EXPECTED(unlink(path->AsString())) == 0);
 }
 
 
-static bool DeleteDir(char* dir_name,
-                      PathBuffer* path) {
+static bool DeleteDir(char* dir_name, PathBuffer* path) {
   if ((strcmp(dir_name, ".") == 0) || (strcmp(dir_name, "..") == 0)) {
     return true;
   }
@@ -273,24 +265,20 @@
 
   // Iterate the directory and delete all files and directories.
   int path_length = path->length();
-  while (true){
-    // In case `readdir()` returns `NULL` we distinguish between end-of-stream and error
-    // by looking if `errno` was updated.
+  while (true) {
+    // In case `readdir()` returns `NULL` we distinguish between end-of-stream
+    // and error by looking if `errno` was updated.
     errno = 0;
     // In glibc 2.24+, readdir_r is deprecated.
     // According to the man page for readdir:
     // "readdir(3) is not required to be thread-safe. However, in modern
     // implementations (including the glibc implementation), concurrent calls to
-    // readdir(3) that specify different directory streams are thread-safe.
-    // Therefore, the use of readdir_r() is generally unnecessary in multithreaded
-    // programs. In cases where multiple threads must read from the same directory
-    // stream, using readdir(3) with external synchronization is still preferable
-    // to the use of readdir_r(), for the reasons given in the points above."
+    // readdir(3) that specify different directory streams are thread-safe."
     dirent* entry = readdir(dir_pointer);
     if (entry == NULL) {
       // Failed to read next directory entry.
       if (errno != 0) {
-          break;
+        break;
       }
       // End of directory.
       return (NO_RETRY_EXPECTED(closedir(dir_pointer)) == 0) &&
@@ -357,19 +345,14 @@
       return DOES_NOT_EXIST;
     }
   } else {
-    if ((errno == EACCES) ||
-        (errno == EBADF) ||
-        (errno == EFAULT) ||
-        (errno == ENOMEM) ||
-        (errno == EOVERFLOW)) {
+    if ((errno == EACCES) || (errno == EBADF) || (errno == EFAULT) ||
+        (errno == ENOMEM) || (errno == EOVERFLOW)) {
       // Search permissions denied for one of the directories in the
       // path or a low level error occured. We do not know if the
       // directory exists.
       return UNKNOWN;
     }
-    ASSERT((errno == ELOOP) ||
-           (errno == ENAMETOOLONG) ||
-           (errno == ENOENT) ||
+    ASSERT((errno == ELOOP) || (errno == ENAMETOOLONG) || (errno == ENOENT) ||
            (errno == ENOTDIR));
     return DOES_NOT_EXIST;
   }
diff --git a/runtime/bin/directory_macos.cc b/runtime/bin/directory_macos.cc
index 5c0f5a6..18c254c 100644
--- a/runtime/bin/directory_macos.cc
+++ b/runtime/bin/directory_macos.cc
@@ -7,12 +7,12 @@
 
 #include "bin/directory.h"
 
-#include <dirent.h>  // NOLINT
-#include <errno.h>  // NOLINT
-#include <string.h>  // NOLINT
+#include <dirent.h>     // NOLINT
+#include <errno.h>      // NOLINT
+#include <string.h>     // NOLINT
 #include <sys/param.h>  // NOLINT
-#include <sys/stat.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <sys/stat.h>   // NOLINT
+#include <unistd.h>     // NOLINT
 
 #include "bin/dartutils.h"
 #include "bin/file.h"
@@ -56,13 +56,9 @@
 
 bool PathBuffer::Add(const char* name) {
   char* data = AsString();
-  int written = snprintf(data + length_,
-                         PATH_MAX - length_,
-                         "%s",
-                         name);
+  int written = snprintf(data + length_, PATH_MAX - length_, "%s", name);
   data[PATH_MAX] = '\0';
-  if ((written <= PATH_MAX - length_) &&
-      (written >= 0) &&
+  if ((written <= PATH_MAX - length_) && (written >= 0) &&
       (static_cast<size_t>(written) == strlen(name))) {
     length_ += written;
     return true;
@@ -119,8 +115,8 @@
   int status = 0;
   dirent entry;
   dirent* result;
-  status = NO_RETRY_EXPECTED(readdir_r(
-      reinterpret_cast<DIR*>(lister_), &entry, &result));
+  status = NO_RETRY_EXPECTED(
+      readdir_r(reinterpret_cast<DIR*>(lister_), &entry, &result));
   if ((status == 0) && (result != NULL)) {
     if (!listing->path_buffer().Add(entry.d_name)) {
       done_ = true;
@@ -139,8 +135,8 @@
         if (!listing->follow_links()) {
           return kListLink;
         }
-        // Else fall through to next case.
-        // Fall through.
+      // Else fall through to next case.
+      // Fall through.
       case DT_UNKNOWN: {
         // On some file systems the entry type is not determined by
         // readdir_r. For those and for links we use stat to determine
@@ -155,9 +151,7 @@
         }
         if (listing->follow_links() && S_ISLNK(entry_info.st_mode)) {
           // Check to see if we are in a loop created by a symbolic link.
-          LinkList current_link = { entry_info.st_dev,
-                                    entry_info.st_ino,
-                                    link_ };
+          LinkList current_link = {entry_info.st_dev, entry_info.st_ino, link_};
           LinkList* previous = link_;
           while (previous != NULL) {
             if ((previous->dev == current_link.dev) &&
@@ -234,14 +228,12 @@
 static bool DeleteRecursively(PathBuffer* path);
 
 
-static bool DeleteFile(char* file_name,
-                       PathBuffer* path) {
+static bool DeleteFile(char* file_name, PathBuffer* path) {
   return path->Add(file_name) && (unlink(path->AsString()) == 0);
 }
 
 
-static bool DeleteDir(char* dir_name,
-                      PathBuffer* path) {
+static bool DeleteDir(char* dir_name, PathBuffer* path) {
   if ((strcmp(dir_name, ".") == 0) || (strcmp(dir_name, "..") == 0)) {
     return true;
   }
@@ -344,19 +336,14 @@
       return DOES_NOT_EXIST;
     }
   } else {
-    if ((errno == EACCES) ||
-        (errno == EBADF) ||
-        (errno == EFAULT) ||
-        (errno == ENOMEM) ||
-        (errno == EOVERFLOW)) {
+    if ((errno == EACCES) || (errno == EBADF) || (errno == EFAULT) ||
+        (errno == ENOMEM) || (errno == EOVERFLOW)) {
       // Search permissions denied for one of the directories in the
       // path or a low level error occured. We do not know if the
       // directory exists.
       return UNKNOWN;
     }
-    ASSERT((errno == ELOOP) ||
-           (errno == ENAMETOOLONG) ||
-           (errno == ENOENT) ||
+    ASSERT((errno == ELOOP) || (errno == ENAMETOOLONG) || (errno == ENOENT) ||
            (errno == ENOTDIR));
     return DOES_NOT_EXIST;
   }
diff --git a/runtime/bin/directory_test.cc b/runtime/bin/directory_test.cc
index 35c0d22..da4a084 100644
--- a/runtime/bin/directory_test.cc
+++ b/runtime/bin/directory_test.cc
@@ -131,8 +131,8 @@
       snprintf(NULL, 0, "%s/%snewname", system_temp, kTempDirName);
   ASSERT(new_name_len > 0);
   char* new_name = new char[new_name_len + 1];
-  snprintf(new_name, new_name_len + 1, "%s/%snewname",
-      system_temp, kTempDirName);
+  snprintf(new_name, new_name_len + 1, "%s/%snewname", system_temp,
+           kTempDirName);
 
   EXPECT(dart::bin::Directory::Rename(name, new_name));
 
diff --git a/runtime/bin/directory_unsupported.cc b/runtime/bin/directory_unsupported.cc
index c4398bb..d3a5152 100644
--- a/runtime/bin/directory_unsupported.cc
+++ b/runtime/bin/directory_unsupported.cc
@@ -13,70 +13,70 @@
 
 void FUNCTION_NAME(Directory_Current)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "Directory is not supported on this platform"));
+      "Directory is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Directory_SetCurrent)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "Directory is not supported on this platform"));
+      "Directory is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Directory_Exists)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "Directory is not supported on this platform"));
+      "Directory is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Directory_Create)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "Directory is not supported on this platform"));
+      "Directory is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Directory_SystemTemp)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "Directory is not supported on this platform"));
+      "Directory is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Directory_CreateTemp)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "Directory is not supported on this platform"));
+      "Directory is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Directory_Delete)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "Directory is not supported on this platform"));
+      "Directory is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Directory_Rename)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "Directory is not supported on this platform"));
+      "Directory is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Directory_FillWithDirectoryListing)(
     Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "Directory is not supported on this platform"));
+      "Directory is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Directory_GetAsyncDirectoryListerPointer)(
     Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "Directory is not supported on this platform"));
+      "Directory is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Directory_SetAsyncDirectoryListerPointer)(
     Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "Directory is not supported on this platform"));
+      "Directory is not supported on this platform"));
 }
 
 }  // namespace bin
diff --git a/runtime/bin/directory_win.cc b/runtime/bin/directory_win.cc
index efaaaf9..e9a5be9 100644
--- a/runtime/bin/directory_win.cc
+++ b/runtime/bin/directory_win.cc
@@ -10,7 +10,7 @@
 #include "bin/utils.h"
 #include "bin/utils_win.h"
 
-#include <errno.h>  // NOLINT
+#include <errno.h>     // NOLINT
 #include <sys/stat.h>  // NOLINT
 
 #include "bin/dartutils.h"
@@ -50,20 +50,17 @@
 
 
 bool PathBuffer::Add(const char* name) {
-  const wchar_t* wide_name = StringUtilsWin::Utf8ToWide(name);
-  return AddW(wide_name);
+  Utf8ToWideScope wide_name(name);
+  return AddW(wide_name.wide());
 }
 
 
 bool PathBuffer::AddW(const wchar_t* name) {
   wchar_t* data = AsStringW();
-  int written = _snwprintf(data + length_,
-                           MAX_LONG_PATH - length_,
-                           L"%s",
-                           name);
+  int written =
+      _snwprintf(data + length_, MAX_LONG_PATH - length_, L"%s", name);
   data[MAX_LONG_PATH] = L'\0';
-  if ((written <= MAX_LONG_PATH - length_) &&
-      (written >= 0) &&
+  if ((written <= MAX_LONG_PATH - length_) && (written >= 0) &&
       (static_cast<size_t>(written) == wcsnlen(name, MAX_LONG_PATH + 1))) {
     length_ += written;
     return true;
@@ -84,13 +81,8 @@
 // points to an invalid target.
 static bool IsBrokenLink(const wchar_t* link_name) {
   HANDLE handle = CreateFileW(
-      link_name,
-      0,
-      FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
-      NULL,
-      OPEN_EXISTING,
-      FILE_FLAG_BACKUP_SEMANTICS,
-      NULL);
+      link_name, 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+      NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
   if (handle == INVALID_HANDLE_VALUE) {
     return true;
   } else {
@@ -124,14 +116,10 @@
     if (!listing->follow_links()) {
       return kListLink;
     }
-    HANDLE handle = CreateFileW(
-        listing->path_buffer().AsStringW(),
-        0,
-        FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
-        NULL,
-        OPEN_EXISTING,
-        FILE_FLAG_BACKUP_SEMANTICS,
-        NULL);
+    HANDLE handle =
+        CreateFileW(listing->path_buffer().AsStringW(), 0,
+                    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+                    NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
     if (handle == INVALID_HANDLE_VALUE) {
       // Report as (broken) link.
       return kListLink;
@@ -199,8 +187,8 @@
 
     path_length_ = listing->path_buffer().length() - 1;
 
-    HANDLE find_handle = FindFirstFileW(listing->path_buffer().AsStringW(),
-                                        &find_file_data);
+    HANDLE find_handle =
+        FindFirstFileW(listing->path_buffer().AsStringW(), &find_file_data);
 
     if (find_handle == INVALID_HANDLE_VALUE) {
       done_ = true;
@@ -285,8 +273,7 @@
 
 
 static bool DeleteDir(wchar_t* dir_name, PathBuffer* path) {
-  if ((wcscmp(dir_name, L".") == 0) ||
-      (wcscmp(dir_name, L"..") == 0)) {
+  if ((wcscmp(dir_name, L".") == 0) || (wcscmp(dir_name, L"..") == 0)) {
     return true;
   }
   return path->AddW(dir_name) && DeleteRecursively(path);
@@ -377,8 +364,8 @@
 
 
 Directory::ExistsResult Directory::Exists(const char* dir_name) {
-  const wchar_t* system_name = StringUtilsWin::Utf8ToWide(dir_name);
-  return ExistsHelper(system_name);
+  Utf8ToWideScope system_name(dir_name);
+  return ExistsHelper(system_name.wide());
 }
 
 
@@ -389,8 +376,8 @@
   }
   wchar_t* current = new wchar_t[length + 1];
   GetCurrentDirectoryW(length + 1, current);
-  int utf8_len = WideCharToMultiByte(
-      CP_UTF8, 0, current, -1, NULL, 0, NULL, NULL);
+  int utf8_len =
+      WideCharToMultiByte(CP_UTF8, 0, current, -1, NULL, 0, NULL, NULL);
   char* result = reinterpret_cast<char*>(malloc(utf8_len));
   WideCharToMultiByte(CP_UTF8, 0, current, -1, result, utf8_len, NULL, NULL);
   delete[] current;
@@ -412,19 +399,18 @@
 
 
 bool Directory::SetCurrent(const char* path) {
-  const wchar_t* system_path = StringUtilsWin::Utf8ToWide(path);
-  bool result = SetCurrentDirectoryW(system_path) != 0;
+  Utf8ToWideScope system_path(path);
+  bool result = SetCurrentDirectoryW(system_path.wide()) != 0;
   return result;
 }
 
 
 bool Directory::Create(const char* dir_name) {
-  const wchar_t* system_name = StringUtilsWin::Utf8ToWide(dir_name);
-  int create_status = CreateDirectoryW(system_name, NULL);
+  Utf8ToWideScope system_name(dir_name);
+  int create_status = CreateDirectoryW(system_name.wide(), NULL);
   // If the directory already existed, treat it as a success.
-  if ((create_status == 0) &&
-      (GetLastError() == ERROR_ALREADY_EXISTS) &&
-      (ExistsHelper(system_name) == EXISTS)) {
+  if ((create_status == 0) && (GetLastError() == ERROR_ALREADY_EXISTS) &&
+      (ExistsHelper(system_name.wide()) == EXISTS)) {
     return true;
   }
   return (create_status != 0);
@@ -446,8 +432,8 @@
   // descriptor inherited from its parent directory.
   // The return value is Dart_ScopeAllocated.
   PathBuffer path;
-  const wchar_t* system_prefix = StringUtilsWin::Utf8ToWide(prefix);
-  if (!path.AddW(system_prefix)) {
+  Utf8ToWideScope system_prefix(prefix);
+  if (!path.AddW(system_prefix.wide())) {
     return NULL;
   }
 
@@ -481,16 +467,16 @@
 
 bool Directory::Delete(const char* dir_name, bool recursive) {
   bool result = false;
-  const wchar_t* system_dir_name = StringUtilsWin::Utf8ToWide(dir_name);
+  Utf8ToWideScope system_dir_name(dir_name);
   if (!recursive) {
     if (File::GetType(dir_name, true) == File::kIsDirectory) {
-      result = (RemoveDirectoryW(system_dir_name) != 0);
+      result = (RemoveDirectoryW(system_dir_name.wide()) != 0);
     } else {
       SetLastError(ERROR_FILE_NOT_FOUND);
     }
   } else {
     PathBuffer path;
-    if (path.AddW(system_dir_name)) {
+    if (path.AddW(system_dir_name.wide())) {
       result = DeleteRecursively(&path);
     }
   }
@@ -499,13 +485,13 @@
 
 
 bool Directory::Rename(const char* path, const char* new_path) {
-  const wchar_t* system_path = StringUtilsWin::Utf8ToWide(path);
-  const wchar_t* system_new_path = StringUtilsWin::Utf8ToWide(new_path);
-  ExistsResult exists = ExistsHelper(system_path);
+  Utf8ToWideScope system_path(path);
+  Utf8ToWideScope system_new_path(new_path);
+  ExistsResult exists = ExistsHelper(system_path.wide());
   if (exists != EXISTS) {
     return false;
   }
-  ExistsResult new_exists = ExistsHelper(system_new_path);
+  ExistsResult new_exists = ExistsHelper(system_new_path.wide());
   // MoveFile does not allow replacing exising directories. Therefore,
   // if the new_path is currently a directory we need to delete it
   // first.
@@ -517,7 +503,7 @@
   }
   DWORD flags = MOVEFILE_WRITE_THROUGH;
   int move_status =
-      MoveFileExW(system_path, system_new_path, flags);
+      MoveFileExW(system_path.wide(), system_new_path.wide(), flags);
   return (move_status != 0);
 }
 
diff --git a/runtime/bin/embedded_dart_io.h b/runtime/bin/embedded_dart_io.h
index 56dbba8..84f5aa4 100644
--- a/runtime/bin/embedded_dart_io.h
+++ b/runtime/bin/embedded_dart_io.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_EMBEDDED_DART_IO_H_
-#define BIN_EMBEDDED_DART_IO_H_
+#ifndef RUNTIME_BIN_EMBEDDED_DART_IO_H_
+#define RUNTIME_BIN_EMBEDDED_DART_IO_H_
 
 namespace dart {
 namespace bin {
@@ -30,4 +30,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_EMBEDDED_DART_IO_H_
+#endif  // RUNTIME_BIN_EMBEDDED_DART_IO_H_
diff --git a/runtime/bin/eventhandler.cc b/runtime/bin/eventhandler.cc
index 8ce45b2..60c13a5 100644
--- a/runtime/bin/eventhandler.cc
+++ b/runtime/bin/eventhandler.cc
@@ -59,7 +59,7 @@
 
 
 static EventHandler* event_handler = NULL;
-static Monitor *shutdown_monitor = NULL;
+static Monitor* shutdown_monitor = NULL;
 
 
 void EventHandler::Start() {
diff --git a/runtime/bin/eventhandler.h b/runtime/bin/eventhandler.h
index 44b5ec8..50852cd 100644
--- a/runtime/bin/eventhandler.h
+++ b/runtime/bin/eventhandler.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_EVENTHANDLER_H_
-#define BIN_EVENTHANDLER_H_
+#ifndef RUNTIME_BIN_EVENTHANDLER_H_
+#define RUNTIME_BIN_EVENTHANDLER_H_
 
 #include "bin/builtin.h"
 #include "bin/dartutils.h"
@@ -33,26 +33,28 @@
   kPipe = 17,
 };
 
-#define COMMAND_MASK ((1 << kCloseCommand) | \
-                      (1 << kShutdownReadCommand) | \
-                      (1 << kShutdownWriteCommand) | \
-                      (1 << kReturnTokenCommand) | \
+// clang-format off
+#define COMMAND_MASK ((1 << kCloseCommand) |                                   \
+                      (1 << kShutdownReadCommand) |                            \
+                      (1 << kShutdownWriteCommand) |                           \
+                      (1 << kReturnTokenCommand) |                             \
                       (1 << kSetEventMaskCommand))
-#define EVENT_MASK ((1 << kInEvent) | \
-                    (1 << kOutEvent) | \
-                    (1 << kErrorEvent) | \
-                    (1 << kCloseEvent) | \
+#define EVENT_MASK ((1 << kInEvent) |                                          \
+                    (1 << kOutEvent) |                                         \
+                    (1 << kErrorEvent) |                                       \
+                    (1 << kCloseEvent) |                                       \
                     (1 << kDestroyedEvent))
-#define IS_COMMAND(data, command_bit) \
+#define IS_COMMAND(data, command_bit)                                          \
     ((data & COMMAND_MASK) == (1 << command_bit))  // NOLINT
-#define IS_EVENT(data, event_bit) \
+#define IS_EVENT(data, event_bit)                                              \
     ((data & EVENT_MASK) == (1 << event_bit))  // NOLINT
-#define IS_IO_EVENT(data) \
-    ((data & (1 << kInEvent | 1 << kOutEvent | 1 << kCloseEvent)) != 0 && \
+#define IS_IO_EVENT(data)                                                      \
+    ((data & (1 << kInEvent | 1 << kOutEvent | 1 << kCloseEvent)) != 0 &&      \
      (data & ~(1 << kInEvent | 1 << kOutEvent | 1 << kCloseEvent)) == 0)
-#define IS_LISTENING_SOCKET(data) \
+#define IS_LISTENING_SOCKET(data)                                              \
     ((data & (1 << kListeningSocket)) != 0)  // NOLINT
 #define TOKEN_COUNT(data) (data & ((1 << kCloseCommand) - 1))
+// clang-format on
 
 class TimeoutQueue {
  private:
@@ -70,9 +72,7 @@
     }
 
     Timeout* next() const { return next_; }
-    void set_next(Timeout* next) {
-      next_ = next;
-    }
+    void set_next(Timeout* next) { next_ = next; }
 
    private:
     Dart_Port port_;
@@ -84,7 +84,8 @@
   TimeoutQueue() : next_timeout_(NULL), timeouts_(NULL) {}
 
   ~TimeoutQueue() {
-    while (HasTimeout()) RemoveCurrent();
+    while (HasTimeout())
+      RemoveCurrent();
   }
 
   bool HasTimeout() const { return next_timeout_ != NULL; }
@@ -99,9 +100,7 @@
     return next_timeout_->port();
   }
 
-  void RemoveCurrent() {
-    UpdateTimeout(CurrentPort(), -1);
-  }
+  void RemoveCurrent() { UpdateTimeout(CurrentPort(), -1); }
 
   void UpdateTimeout(Dart_Port port, int64_t timeout);
 
@@ -127,12 +126,12 @@
 static const int kShutdownId = -2;
 
 
-template<typename T>
+template <typename T>
 class CircularLinkedList {
  public:
   CircularLinkedList() : head_(NULL) {}
 
-  typedef void (*ClearFun) (void* value);
+  typedef void (*ClearFun)(void* value);
 
   // Returns true if the list was empty.
   bool Add(T t) {
@@ -180,11 +179,11 @@
         return;
       }
     } else {
-      Entry *current = head_;
+      Entry* current = head_;
       do {
         if (current->t == item) {
-          Entry *next = current->next_;
-          Entry *prev = current->prev_;
+          Entry* next = current->next_;
+          Entry* prev = current->prev_;
           prev->next_ = next;
           next->prev_ = prev;
 
@@ -208,9 +207,7 @@
 
   T head() const { return head_->t; }
 
-  bool HasHead() const {
-    return head_ != NULL;
-  }
+  bool HasHead() const { return head_ != NULL; }
 
   void Rotate() {
     if (head_ != NULL) {
@@ -235,9 +232,7 @@
 
 class DescriptorInfoBase {
  public:
-  explicit DescriptorInfoBase(intptr_t fd) : fd_(fd) {
-    ASSERT(fd_ != -1);
-  }
+  explicit DescriptorInfoBase(intptr_t fd) : fd_(fd) { ASSERT(fd_ != -1); }
 
   virtual ~DescriptorInfoBase() {}
 
@@ -287,17 +282,20 @@
 // windows) which is connected to a single Dart_Port.
 //
 // Subclasses of this class can be e.g. connected tcp sockets.
-template<typename DI>
+template <typename DI>
 class DescriptorInfoSingleMixin : public DI {
  private:
   static const int kTokenCount = 16;
 
  public:
   DescriptorInfoSingleMixin(intptr_t fd, bool disable_tokens)
-      : DI(fd), port_(0), tokens_(kTokenCount), mask_(0),
+      : DI(fd),
+        port_(0),
+        tokens_(kTokenCount),
+        mask_(0),
         disable_tokens_(disable_tokens) {}
 
-  virtual ~DescriptorInfoSingleMixin() { }
+  virtual ~DescriptorInfoSingleMixin() {}
 
   virtual bool IsListeningSocket() const { return false; }
 
@@ -332,8 +330,7 @@
   virtual void NotifyAllDartPorts(uintptr_t events) {
     // Unexpected close, asynchronous destroy or error events are the only
     // ones we broadcast to all listeners.
-    ASSERT(IS_EVENT(events, kCloseEvent) ||
-           IS_EVENT(events, kErrorEvent) ||
+    ASSERT(IS_EVENT(events, kCloseEvent) || IS_EVENT(events, kErrorEvent) ||
            IS_EVENT(events, kDestroyedEvent));
 
     if (port_ != 0) {
@@ -359,9 +356,7 @@
     return mask_;
   }
 
-  virtual void Close() {
-    DI::Close();
-  }
+  virtual void Close() { DI::Close(); }
 
  private:
   Dart_Port port_;
@@ -378,14 +373,14 @@
 //
 // Subclasses of this class can be e.g. a listening socket which multiple
 // isolates are listening on.
-template<typename DI>
+template <typename DI>
 class DescriptorInfoMultipleMixin : public DI {
  private:
   static const int kTokenCount = 4;
 
   static bool SamePortValue(void* key1, void* key2) {
     return reinterpret_cast<Dart_Port>(key1) ==
-        reinterpret_cast<Dart_Port>(key2);
+           reinterpret_cast<Dart_Port>(key2);
   }
 
   static uint32_t GetHashmapHashFromPort(Dart_Port port) {
@@ -415,12 +410,11 @@
 
  public:
   DescriptorInfoMultipleMixin(intptr_t fd, bool disable_tokens)
-      : DI(fd), tokens_map_(&SamePortValue, kTokenCount),
+      : DI(fd),
+        tokens_map_(&SamePortValue, kTokenCount),
         disable_tokens_(disable_tokens) {}
 
-  virtual ~DescriptorInfoMultipleMixin() {
-    RemoveAllPorts();
-  }
+  virtual ~DescriptorInfoMultipleMixin() { RemoveAllPorts(); }
 
   virtual bool IsListeningSocket() const { return true; }
 
@@ -466,8 +460,7 @@
       } while (current != root);
     }
 
-    for (HashMap::Entry *entry = tokens_map_.Start();
-         entry != NULL;
+    for (HashMap::Entry* entry = tokens_map_.Start(); entry != NULL;
          entry = tokens_map_.Next(entry)) {
       PortEntry* pentry = reinterpret_cast<PortEntry*>(entry->value);
       if (pentry->IsReady()) {
@@ -487,8 +480,8 @@
       if (pentry->IsReady()) {
         active_readers_.Remove(pentry);
       }
-      tokens_map_.Remove(
-          GetHashmapKeyFromPort(port), GetHashmapHashFromPort(port));
+      tokens_map_.Remove(GetHashmapKeyFromPort(port),
+                         GetHashmapHashFromPort(port));
       delete pentry;
     } else {
       // NOTE: This is a listening socket which has been immediately closed.
@@ -504,8 +497,7 @@
   }
 
   virtual void RemoveAllPorts() {
-    for (HashMap::Entry *entry = tokens_map_.Start();
-         entry != NULL;
+    for (HashMap::Entry* entry = tokens_map_.Start(); entry != NULL;
          entry = tokens_map_.Next(entry)) {
       PortEntry* pentry = reinterpret_cast<PortEntry*>(entry->value);
       entry->value = NULL;
@@ -543,12 +535,10 @@
   virtual void NotifyAllDartPorts(uintptr_t events) {
     // Unexpected close, asynchronous destroy or error events are the only
     // ones we broadcast to all listeners.
-    ASSERT(IS_EVENT(events, kCloseEvent) ||
-           IS_EVENT(events, kErrorEvent) ||
+    ASSERT(IS_EVENT(events, kCloseEvent) || IS_EVENT(events, kErrorEvent) ||
            IS_EVENT(events, kDestroyedEvent));
 
-    for (HashMap::Entry *entry = tokens_map_.Start();
-         entry != NULL;
+    for (HashMap::Entry* entry = tokens_map_.Start(); entry != NULL;
          entry = tokens_map_.Next(entry)) {
       PortEntry* pentry = reinterpret_cast<PortEntry*>(entry->value);
       DartUtils::PostInt32(pentry->dart_port, events);
@@ -589,9 +579,7 @@
     return 0;
   }
 
-  virtual void Close() {
-    DI::Close();
-  }
+  virtual void Close() { DI::Close(); }
 
  private:
   static void DeletePortEntry(void* data) {
@@ -602,7 +590,7 @@
   // The [Dart_Port]s which are not paused (i.e. are interested in read events,
   // i.e. `mask == (1 << kInEvent)`) and we have enough tokens to communicate
   // with them.
-  CircularLinkedList<PortEntry *> active_readers_;
+  CircularLinkedList<PortEntry*> active_readers_;
 
   // A convenience mapping:
   //   Dart_Port -> struct PortEntry { dart_port, mask, token_count }
@@ -669,4 +657,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_EVENTHANDLER_H_
+#endif  // RUNTIME_BIN_EVENTHANDLER_H_
diff --git a/runtime/bin/eventhandler_android.cc b/runtime/bin/eventhandler_android.cc
index c298a04..c9c4b0d 100644
--- a/runtime/bin/eventhandler_android.cc
+++ b/runtime/bin/eventhandler_android.cc
@@ -10,14 +10,14 @@
 #include "bin/eventhandler.h"
 #include "bin/eventhandler_android.h"
 
-#include <errno.h>  // NOLINT
-#include <fcntl.h>  // NOLINT
-#include <pthread.h>  // NOLINT
-#include <stdio.h>  // NOLINT
-#include <string.h>  // NOLINT
+#include <errno.h>      // NOLINT
+#include <fcntl.h>      // NOLINT
+#include <pthread.h>    // NOLINT
+#include <stdio.h>      // NOLINT
+#include <string.h>     // NOLINT
 #include <sys/epoll.h>  // NOLINT
-#include <sys/stat.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <sys/stat.h>   // NOLINT
+#include <unistd.h>     // NOLINT
 
 #include "bin/dartutils.h"
 #include "bin/fdutils.h"
@@ -53,12 +53,8 @@
 
 // Unregister the file descriptor for a DescriptorInfo structure with
 // epoll.
-static void RemoveFromEpollInstance(intptr_t epoll_fd_,
-                                    DescriptorInfo* di) {
-  VOID_NO_RETRY_EXPECTED(epoll_ctl(epoll_fd_,
-                                   EPOLL_CTL_DEL,
-                                   di->fd(),
-                                   NULL));
+static void RemoveFromEpollInstance(intptr_t epoll_fd_, DescriptorInfo* di) {
+  VOID_NO_RETRY_EXPECTED(epoll_ctl(epoll_fd_, EPOLL_CTL_DEL, di->fd(), NULL));
 }
 
 
@@ -69,10 +65,8 @@
     event.events |= EPOLLET;
   }
   event.data.ptr = di;
-  int status = NO_RETRY_EXPECTED(epoll_ctl(epoll_fd_,
-                                           EPOLL_CTL_ADD,
-                                           di->fd(),
-                                           &event));
+  int status =
+      NO_RETRY_EXPECTED(epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, di->fd(), &event));
   if (status == -1) {
     // TODO(dart:io): Verify that the dart end is handling this correctly.
 
@@ -92,26 +86,32 @@
   if (result != 0) {
     FATAL("Pipe creation failed");
   }
-  FDUtils::SetNonBlocking(interrupt_fds_[0]);
-  FDUtils::SetCloseOnExec(interrupt_fds_[0]);
-  FDUtils::SetCloseOnExec(interrupt_fds_[1]);
+  if (!FDUtils::SetNonBlocking(interrupt_fds_[0])) {
+    FATAL("Failed to set pipe fd non blocking\n");
+  }
+  if (!FDUtils::SetCloseOnExec(interrupt_fds_[0])) {
+    FATAL("Failed to set pipe fd close on exec\n");
+  }
+  if (!FDUtils::SetCloseOnExec(interrupt_fds_[1])) {
+    FATAL("Failed to set pipe fd close on exec\n");
+  }
   shutdown_ = false;
-  // The initial size passed to epoll_create is ignore on newer (>=
-  // 2.6.8) Linux versions
+  // The initial size passed to epoll_create is ignored on newer (>= 2.6.8)
+  // Linux versions
   static const int kEpollInitialSize = 64;
   epoll_fd_ = NO_RETRY_EXPECTED(epoll_create(kEpollInitialSize));
   if (epoll_fd_ == -1) {
     FATAL1("Failed creating epoll file descriptor: %i", errno);
   }
-  FDUtils::SetCloseOnExec(epoll_fd_);
+  if (!FDUtils::SetCloseOnExec(epoll_fd_)) {
+    FATAL("Failed to set epoll fd close on exec\n");
+  }
   // Register the interrupt_fd with the epoll instance.
   struct epoll_event event;
   event.events = EPOLLIN;
   event.data.ptr = NULL;
-  int status = NO_RETRY_EXPECTED(epoll_ctl(epoll_fd_,
-                                           EPOLL_CTL_ADD,
-                                           interrupt_fds_[0],
-                                           &event));
+  int status = NO_RETRY_EXPECTED(
+      epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, interrupt_fds_[0], &event));
   if (status == -1) {
     FATAL("Failed adding interrupt fd to epoll instance");
   }
@@ -134,7 +134,7 @@
 
 
 void EventHandlerImplementation::UpdateEpollInstance(intptr_t old_mask,
-                                                     DescriptorInfo *di) {
+                                                     DescriptorInfo* di) {
   intptr_t new_mask = di->Mask();
   if ((old_mask != 0) && (new_mask == 0)) {
     RemoveFromEpollInstance(epoll_fd_, di);
@@ -149,13 +149,13 @@
 
 
 DescriptorInfo* EventHandlerImplementation::GetDescriptorInfo(
-    intptr_t fd, bool is_listening) {
+    intptr_t fd,
+    bool is_listening) {
   ASSERT(fd >= 0);
-  HashMap::Entry* entry = socket_map_.Lookup(
-      GetHashmapKeyFromFd(fd), GetHashmapHashFromFd(fd), true);
+  HashMap::Entry* entry = socket_map_.Lookup(GetHashmapKeyFromFd(fd),
+                                             GetHashmapHashFromFd(fd), true);
   ASSERT(entry != NULL);
-  DescriptorInfo* di =
-      reinterpret_cast<DescriptorInfo*>(entry->value);
+  DescriptorInfo* di = reinterpret_cast<DescriptorInfo*>(entry->value);
   if (di == NULL) {
     // If there is no data in the hash map for this file descriptor a
     // new DescriptorInfo for the file descriptor is inserted.
@@ -206,8 +206,8 @@
     } else {
       ASSERT((msg[i].data & COMMAND_MASK) != 0);
 
-      DescriptorInfo* di = GetDescriptorInfo(
-          msg[i].id, IS_LISTENING_SOCKET(msg[i].data));
+      DescriptorInfo* di =
+          GetDescriptorInfo(msg[i].id, IS_LISTENING_SOCKET(msg[i].data));
       if (IS_COMMAND(msg[i].data, kShutdownReadCommand)) {
         ASSERT(!di->IsListeningSocket());
         // Close the socket for reading.
@@ -230,7 +230,7 @@
           // We only close the socket file descriptor from the operating
           // system if there are no other dart socket objects which
           // are listening on the same (address, port) combination.
-          ListeningSocketRegistry *registry =
+          ListeningSocketRegistry* registry =
               ListeningSocketRegistry::Instance();
 
           MutexLocker locker(registry->mutex());
@@ -244,8 +244,7 @@
           }
         } else {
           ASSERT(new_mask == 0);
-          socket_map_.Remove(
-              GetHashmapKeyFromFd(fd), GetHashmapHashFromFd(fd));
+          socket_map_.Remove(GetHashmapKeyFromFd(fd), GetHashmapHashFromFd(fd));
           di->Close();
           delete di;
         }
@@ -293,8 +292,8 @@
   if ((events & EPOLLRDHUP) != 0) {
     Log::Print("EPOLLRDHUP ");
   }
-  int all_events = EPOLLIN | EPOLLPRI | EPOLLOUT |
-      EPOLLERR | EPOLLHUP | EPOLLRDHUP;
+  int all_events =
+      EPOLLIN | EPOLLPRI | EPOLLOUT | EPOLLERR | EPOLLHUP | EPOLLRDHUP;
   if ((events & ~all_events) != 0) {
     Log::Print("(and %08x) ", events & ~all_events);
   }
@@ -359,8 +358,8 @@
   if (!timeout_queue_.HasTimeout()) {
     return kInfinityTimeout;
   }
-  int64_t millis = timeout_queue_.CurrentTimeout() -
-      TimerUtils::GetCurrentMonotonicMillis();
+  int64_t millis =
+      timeout_queue_.CurrentTimeout() - TimerUtils::GetCurrentMonotonicMillis();
   return (millis < 0) ? 0 : millis;
 }
 
@@ -368,7 +367,7 @@
 void EventHandlerImplementation::HandleTimeout() {
   if (timeout_queue_.HasTimeout()) {
     int64_t millis = timeout_queue_.CurrentTimeout() -
-        TimerUtils::GetCurrentMonotonicMillis();
+                     TimerUtils::GetCurrentMonotonicMillis();
     if (millis <= 0) {
       DartUtils::PostNull(timeout_queue_.CurrentPort());
       timeout_queue_.RemoveCurrent();
diff --git a/runtime/bin/eventhandler_android.h b/runtime/bin/eventhandler_android.h
index 8841861..156ba4f 100644
--- a/runtime/bin/eventhandler_android.h
+++ b/runtime/bin/eventhandler_android.h
@@ -2,10 +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.
 
-#ifndef BIN_EVENTHANDLER_ANDROID_H_
-#define BIN_EVENTHANDLER_ANDROID_H_
+#ifndef RUNTIME_BIN_EVENTHANDLER_ANDROID_H_
+#define RUNTIME_BIN_EVENTHANDLER_ANDROID_H_
 
-#if !defined(BIN_EVENTHANDLER_H_)
+#if !defined(RUNTIME_BIN_EVENTHANDLER_H_)
 #error Do not include eventhandler_android.h directly;
 #error use eventhandler.h instead.
 #endif
@@ -23,9 +23,9 @@
 
 class DescriptorInfo : public DescriptorInfoBase {
  public:
-  explicit DescriptorInfo(intptr_t fd) : DescriptorInfoBase(fd) { }
+  explicit DescriptorInfo(intptr_t fd) : DescriptorInfoBase(fd) {}
 
-  virtual ~DescriptorInfo() { }
+  virtual ~DescriptorInfo() {}
 
   intptr_t GetPollEvents();
 
@@ -39,8 +39,7 @@
 };
 
 
-class DescriptorInfoSingle
-    : public DescriptorInfoSingleMixin<DescriptorInfo> {
+class DescriptorInfoSingle : public DescriptorInfoSingleMixin<DescriptorInfo> {
  public:
   explicit DescriptorInfoSingle(intptr_t fd)
       : DescriptorInfoSingleMixin(fd, false) {}
@@ -68,7 +67,7 @@
   EventHandlerImplementation();
   ~EventHandlerImplementation();
 
-  void UpdateEpollInstance(intptr_t old_mask, DescriptorInfo *di);
+  void UpdateEpollInstance(intptr_t old_mask, DescriptorInfo* di);
 
   // Gets the socket data structure for a given file
   // descriptor. Creates a new one if one is not found.
@@ -101,4 +100,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_EVENTHANDLER_ANDROID_H_
+#endif  // RUNTIME_BIN_EVENTHANDLER_ANDROID_H_
diff --git a/runtime/bin/eventhandler_fuchsia.cc b/runtime/bin/eventhandler_fuchsia.cc
index cdd4fad..c298e22 100644
--- a/runtime/bin/eventhandler_fuchsia.cc
+++ b/runtime/bin/eventhandler_fuchsia.cc
@@ -10,32 +10,234 @@
 #include "bin/eventhandler.h"
 #include "bin/eventhandler_fuchsia.h"
 
-#include <magenta/syscalls.h>
-#include <runtime/status.h>
+#include <errno.h>      // NOLINT
+#include <fcntl.h>      // NOLINT
+#include <pthread.h>    // NOLINT
+#include <stdio.h>      // NOLINT
+#include <string.h>     // NOLINT
+#include <sys/epoll.h>  // NOLINT
+#include <sys/stat.h>   // NOLINT
+#include <unistd.h>     // NOLINT
 
+#include "bin/fdutils.h"
+#include "bin/lockers.h"
+#include "bin/log.h"
+#include "bin/socket.h"
 #include "bin/thread.h"
 #include "bin/utils.h"
+#include "platform/hashmap.h"
+#include "platform/utils.h"
+
+// #define EVENTHANDLER_LOGGING 1
+#if defined(EVENTHANDLER_LOGGING)
+#define LOG_ERR(msg, ...) Log::PrintErr(msg, ##__VA_ARGS__)
+#define LOG_INFO(msg, ...) Log::Print(msg, ##__VA_ARGS__)
+#else
+#define LOG_ERR(msg, ...)
+#define LOG_INFO(msg, ...)
+#endif  // defined(EVENTHANDLER_LOGGING)
 
 namespace dart {
 namespace bin {
 
-EventHandlerImplementation::EventHandlerImplementation() {
-  mx_status_t status = mx_msgpipe_create(interrupt_handles_, 0);
-  if (status != NO_ERROR) {
-    FATAL1("mx_msgpipe_create failed: %s\n", mx_strstatus(status));
+#if defined(EVENTHANDLER_LOGGING)
+static void PrintEventMask(intptr_t fd, intptr_t events) {
+  Log::PrintErr("%d ", fd);
+  if ((events & EPOLLIN) != 0) {
+    Log::PrintErr("EPOLLIN ");
+  }
+  if ((events & EPOLLPRI) != 0) {
+    Log::PrintErr("EPOLLPRI ");
+  }
+  if ((events & EPOLLOUT) != 0) {
+    Log::PrintErr("EPOLLOUT ");
+  }
+  if ((events & EPOLLERR) != 0) {
+    Log::PrintErr("EPOLLERR ");
+  }
+  if ((events & EPOLLHUP) != 0) {
+    Log::PrintErr("EPOLLHUP ");
+  }
+  if ((events & EPOLLRDHUP) != 0) {
+    Log::PrintErr("EPOLLRDHUP ");
+  }
+  int all_events =
+      EPOLLIN | EPOLLPRI | EPOLLOUT | EPOLLERR | EPOLLHUP | EPOLLRDHUP;
+  if ((events & ~all_events) != 0) {
+    Log::PrintErr("(and %08x) ", events & ~all_events);
+  }
+
+  Log::PrintErr("\n");
+}
+#endif
+
+
+intptr_t DescriptorInfo::GetPollEvents() {
+  // Do not ask for EPOLLERR and EPOLLHUP explicitly as they are
+  // triggered anyway.
+  intptr_t events = 0;
+  if ((Mask() & (1 << kInEvent)) != 0) {
+    events |= EPOLLIN;
+  }
+  if ((Mask() & (1 << kOutEvent)) != 0) {
+    events |= EPOLLOUT;
+  }
+  return events;
+}
+
+
+// Unregister the file descriptor for a DescriptorInfo structure with
+// epoll.
+static void RemoveFromEpollInstance(intptr_t epoll_fd_, DescriptorInfo* di) {
+  LOG_INFO("RemoveFromEpollInstance: fd = %ld\n", di->fd());
+  VOID_NO_RETRY_EXPECTED(epoll_ctl(epoll_fd_, EPOLL_CTL_DEL, di->fd(), NULL));
+}
+
+
+static void AddToEpollInstance(intptr_t epoll_fd_, DescriptorInfo* di) {
+  struct epoll_event event;
+  event.events = EPOLLRDHUP | di->GetPollEvents();
+  if (!di->IsListeningSocket()) {
+    event.events |= EPOLLET;
+  }
+  event.data.ptr = di;
+  LOG_INFO("AddToEpollInstance: fd = %ld\n", di->fd());
+  int status =
+      NO_RETRY_EXPECTED(epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, di->fd(), &event));
+  LOG_INFO("AddToEpollInstance: fd = %ld, status = %d\n", di->fd(), status);
+#if defined(EVENTHANDLER_LOGGING)
+  PrintEventMask(di->fd(), event.events);
+#endif
+  if (status == -1) {
+    // TODO(dart:io): Verify that the dart end is handling this correctly.
+
+    // Epoll does not accept the file descriptor. It could be due to
+    // already closed file descriptor, or unuspported devices, such
+    // as /dev/null. In such case, mark the file descriptor as closed,
+    // so dart will handle it accordingly.
+    di->NotifyAllDartPorts(1 << kCloseEvent);
   }
 }
 
 
+EventHandlerImplementation::EventHandlerImplementation()
+    : socket_map_(&HashMap::SamePointerValue, 16) {
+  intptr_t result;
+  result = NO_RETRY_EXPECTED(pipe(interrupt_fds_));
+  if (result != 0) {
+    FATAL("Pipe creation failed");
+  }
+  if (!FDUtils::SetNonBlocking(interrupt_fds_[0])) {
+    FATAL("Failed to set pipe fd non blocking\n");
+  }
+  if (!FDUtils::SetCloseOnExec(interrupt_fds_[0])) {
+    FATAL("Failed to set pipe fd close on exec\n");
+  }
+  if (!FDUtils::SetCloseOnExec(interrupt_fds_[1])) {
+    FATAL("Failed to set pipe fd close on exec\n");
+  }
+  shutdown_ = false;
+  // The initial size passed to epoll_create is ignore on newer (>=
+  // 2.6.8) Linux versions
+  static const int kEpollInitialSize = 64;
+  epoll_fd_ = NO_RETRY_EXPECTED(epoll_create(kEpollInitialSize));
+  if (epoll_fd_ == -1) {
+    FATAL1("Failed creating epoll file descriptor: %i", errno);
+  }
+  if (!FDUtils::SetCloseOnExec(epoll_fd_)) {
+    FATAL("Failed to set epoll fd close on exec\n");
+  }
+  // Register the interrupt_fd with the epoll instance.
+  struct epoll_event event;
+  event.events = EPOLLIN;
+  event.data.ptr = NULL;
+  LOG_INFO("EventHandlerImplementation(): epoll_ctl: fd = %ld\n", epoll_fd_);
+  int status = NO_RETRY_EXPECTED(
+      epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, interrupt_fds_[0], &event));
+  LOG_INFO("EventHandlerImplementation(): epoll_ctl: fd = %ld, status = %d\n",
+           epoll_fd_, status);
+  if (status == -1) {
+    FATAL("Failed adding interrupt fd to epoll instance");
+  }
+}
+
+
+static void DeleteDescriptorInfo(void* info) {
+  DescriptorInfo* di = reinterpret_cast<DescriptorInfo*>(info);
+  di->Close();
+  LOG_INFO("Closed %d\n", di->fd());
+  delete di;
+}
+
+
 EventHandlerImplementation::~EventHandlerImplementation() {
-  mx_status_t status = mx_handle_close(interrupt_handles_[0]);
-  if (status != NO_ERROR) {
-    FATAL1("mx_handle_close failed: %s\n", mx_strstatus(status));
+  socket_map_.Clear(DeleteDescriptorInfo);
+  VOID_NO_RETRY_EXPECTED(close(epoll_fd_));
+  VOID_NO_RETRY_EXPECTED(close(interrupt_fds_[0]));
+  VOID_NO_RETRY_EXPECTED(close(interrupt_fds_[1]));
+}
+
+
+void EventHandlerImplementation::UpdateEpollInstance(intptr_t old_mask,
+                                                     DescriptorInfo* di) {
+  intptr_t new_mask = di->Mask();
+  LOG_INFO("UpdateEpollInstance: %d old=%ld, new=%ld\n", di->fd(), old_mask,
+           new_mask);
+  if ((old_mask != 0) && (new_mask == 0)) {
+    RemoveFromEpollInstance(epoll_fd_, di);
+  } else if ((old_mask == 0) && (new_mask != 0)) {
+    AddToEpollInstance(epoll_fd_, di);
+  } else if ((old_mask != 0) && (new_mask != 0) && (old_mask != new_mask)) {
+    ASSERT(!di->IsListeningSocket());
+    RemoveFromEpollInstance(epoll_fd_, di);
+    AddToEpollInstance(epoll_fd_, di);
   }
-  status = mx_handle_close(interrupt_handles_[1]);
-  if (status != NO_ERROR) {
-    FATAL1("mx_handle_close failed: %s\n", mx_strstatus(status));
+}
+
+
+DescriptorInfo* EventHandlerImplementation::GetDescriptorInfo(
+    intptr_t fd,
+    bool is_listening) {
+  ASSERT(fd >= 0);
+  HashMap::Entry* entry = socket_map_.Lookup(GetHashmapKeyFromFd(fd),
+                                             GetHashmapHashFromFd(fd), true);
+  ASSERT(entry != NULL);
+  DescriptorInfo* di = reinterpret_cast<DescriptorInfo*>(entry->value);
+  if (di == NULL) {
+    // If there is no data in the hash map for this file descriptor a
+    // new DescriptorInfo for the file descriptor is inserted.
+    if (is_listening) {
+      di = new DescriptorInfoMultiple(fd);
+    } else {
+      di = new DescriptorInfoSingle(fd);
+    }
+    entry->value = di;
   }
+  ASSERT(fd == di->fd());
+  return di;
+}
+
+
+static ssize_t WriteToBlocking(int fd, const void* buffer, size_t count) {
+  size_t remaining = count;
+  char* buffer_pos = const_cast<char*>(reinterpret_cast<const char*>(buffer));
+  while (remaining > 0) {
+    ssize_t bytes_written = NO_RETRY_EXPECTED(write(fd, buffer_pos, remaining));
+    if (bytes_written == 0) {
+      return count - remaining;
+    } else if (bytes_written == -1) {
+      ASSERT(EAGAIN == EWOULDBLOCK);
+      // Error code EWOULDBLOCK should only happen for non blocking
+      // file descriptors.
+      ASSERT(errno != EWOULDBLOCK);
+      return -1;
+    } else {
+      ASSERT(bytes_written > 0);
+      remaining -= bytes_written;
+      buffer_pos += bytes_written;
+    }
+  }
+  return count;
 }
 
 
@@ -46,46 +248,172 @@
   msg.id = id;
   msg.dart_port = dart_port;
   msg.data = data;
-
-  mx_status_t status =
-    mx_msgpipe_write(interrupt_handles_[1], &msg, sizeof(msg), NULL, 0, 0);
-  if (status != NO_ERROR) {
-    FATAL1("mx_msgpipe_write failed: %s\n", mx_strstatus(status));
+  // WriteToBlocking will write up to 512 bytes atomically, and since our msg
+  // is smaller than 512, we don't need a thread lock.
+  // See: http://linux.die.net/man/7/pipe, section 'Pipe_buf'.
+  ASSERT(kInterruptMessageSize < PIPE_BUF);
+  intptr_t result =
+      WriteToBlocking(interrupt_fds_[1], &msg, kInterruptMessageSize);
+  if (result != kInterruptMessageSize) {
+    if (result == -1) {
+      perror("Interrupt message failure:");
+    }
+    FATAL1("Interrupt message failure. Wrote %" Pd " bytes.", result);
   }
 }
 
 
 void EventHandlerImplementation::HandleInterruptFd() {
-  InterruptMessage msg;
-  uint32_t bytes = kInterruptMessageSize;
-  mx_status_t status;
-  while (true) {
-    status = mx_msgpipe_read(
-        interrupt_handles_[0], &msg, &bytes, NULL, NULL, 0);
-    if (status != NO_ERROR) {
-      break;
-    }
-    ASSERT(bytes == kInterruptMessageSize);
-    if (msg.id == kTimerId) {
-      timeout_queue_.UpdateTimeout(msg.dart_port, msg.data);
-    } else if (msg.id == kShutdownId) {
+  const intptr_t MAX_MESSAGES = kInterruptMessageSize;
+  InterruptMessage msg[MAX_MESSAGES];
+  ssize_t bytes = NO_RETRY_EXPECTED(
+      read(interrupt_fds_[0], msg, MAX_MESSAGES * kInterruptMessageSize));
+  LOG_INFO("HandleInterruptFd read %ld bytes\n", bytes);
+  for (ssize_t i = 0; i < bytes / kInterruptMessageSize; i++) {
+    if (msg[i].id == kTimerId) {
+      LOG_INFO("HandleInterruptFd read timer update\n");
+      timeout_queue_.UpdateTimeout(msg[i].dart_port, msg[i].data);
+    } else if (msg[i].id == kShutdownId) {
+      LOG_INFO("HandleInterruptFd read shutdown\n");
       shutdown_ = true;
     } else {
-      UNIMPLEMENTED();
+      ASSERT((msg[i].data & COMMAND_MASK) != 0);
+      LOG_INFO("HandleInterruptFd command\n");
+      DescriptorInfo* di =
+          GetDescriptorInfo(msg[i].id, IS_LISTENING_SOCKET(msg[i].data));
+      if (IS_COMMAND(msg[i].data, kShutdownReadCommand)) {
+        ASSERT(!di->IsListeningSocket());
+        // Close the socket for reading.
+        LOG_INFO("\tSHUT_RD: %d\n", di->fd());
+        VOID_NO_RETRY_EXPECTED(shutdown(di->fd(), SHUT_RD));
+      } else if (IS_COMMAND(msg[i].data, kShutdownWriteCommand)) {
+        ASSERT(!di->IsListeningSocket());
+        // Close the socket for writing.
+        LOG_INFO("\tSHUT_WR: %d\n", di->fd());
+        VOID_NO_RETRY_EXPECTED(shutdown(di->fd(), SHUT_WR));
+      } else if (IS_COMMAND(msg[i].data, kCloseCommand)) {
+        // Close the socket and free system resources and move on to next
+        // message.
+        intptr_t old_mask = di->Mask();
+        Dart_Port port = msg[i].dart_port;
+        di->RemovePort(port);
+        intptr_t new_mask = di->Mask();
+        UpdateEpollInstance(old_mask, di);
+
+        LOG_INFO("\tCLOSE: %d: %lx -> %lx\n", di->fd(), old_mask, new_mask);
+        intptr_t fd = di->fd();
+        if (di->IsListeningSocket()) {
+          // We only close the socket file descriptor from the operating
+          // system if there are no other dart socket objects which
+          // are listening on the same (address, port) combination.
+          ListeningSocketRegistry* registry =
+              ListeningSocketRegistry::Instance();
+
+          MutexLocker locker(registry->mutex());
+
+          if (registry->CloseSafe(fd)) {
+            ASSERT(new_mask == 0);
+            socket_map_.Remove(GetHashmapKeyFromFd(fd),
+                               GetHashmapHashFromFd(fd));
+            di->Close();
+            LOG_INFO("Closed %d\n", di->fd());
+            delete di;
+          }
+        } else {
+          ASSERT(new_mask == 0);
+          socket_map_.Remove(GetHashmapKeyFromFd(fd), GetHashmapHashFromFd(fd));
+          di->Close();
+          LOG_INFO("Closed %d\n", di->fd());
+          delete di;
+        }
+
+        DartUtils::PostInt32(port, 1 << kDestroyedEvent);
+      } else if (IS_COMMAND(msg[i].data, kReturnTokenCommand)) {
+        int count = TOKEN_COUNT(msg[i].data);
+        intptr_t old_mask = di->Mask();
+        LOG_INFO("\t Return Token: %d: %lx\n", di->fd(), old_mask);
+        di->ReturnTokens(msg[i].dart_port, count);
+        UpdateEpollInstance(old_mask, di);
+      } else if (IS_COMMAND(msg[i].data, kSetEventMaskCommand)) {
+        // `events` can only have kInEvent/kOutEvent flags set.
+        intptr_t events = msg[i].data & EVENT_MASK;
+        ASSERT(0 == (events & ~(1 << kInEvent | 1 << kOutEvent)));
+
+        intptr_t old_mask = di->Mask();
+        LOG_INFO("\t Set Event Mask: %d: %lx %lx\n", di->fd(), old_mask,
+                 msg[i].data & EVENT_MASK);
+        di->SetPortAndMask(msg[i].dart_port, msg[i].data & EVENT_MASK);
+        UpdateEpollInstance(old_mask, di);
+      } else {
+        UNREACHABLE();
+      }
     }
   }
-  // status == ERR_BAD_STATE when we try to read and there are no messages
-  // available, so it is an error if we get here and status != ERR_BAD_STATE.
-  if (status != ERR_BAD_STATE) {
-    FATAL1("mx_msgpipe_read failed: %s\n", mx_strstatus(status));
-  }
+  LOG_INFO("HandleInterruptFd exit\n");
 }
 
 
-void EventHandlerImplementation::HandleEvents() {
-  // TODO(zra): Handle events from other handles. At the moment we are only
-  // interrupted when there is a message on interrupt_handles_[0].
-  HandleInterruptFd();
+intptr_t EventHandlerImplementation::GetPollEvents(intptr_t events,
+                                                   DescriptorInfo* di) {
+#ifdef EVENTHANDLER_LOGGING
+  PrintEventMask(di->fd(), events);
+#endif
+  if ((events & EPOLLERR) != 0) {
+    // Return error only if EPOLLIN is present.
+    return ((events & EPOLLIN) != 0) ? (1 << kErrorEvent) : 0;
+  }
+  intptr_t event_mask = 0;
+  if ((events & EPOLLIN) != 0) {
+    event_mask |= (1 << kInEvent);
+  }
+  if ((events & EPOLLOUT) != 0) {
+    event_mask |= (1 << kOutEvent);
+  }
+  if ((events & (EPOLLHUP | EPOLLRDHUP)) != 0) {
+    event_mask |= (1 << kCloseEvent);
+  }
+  return event_mask;
+}
+
+
+void EventHandlerImplementation::HandleEvents(struct epoll_event* events,
+                                              int size) {
+  bool interrupt_seen = false;
+  for (int i = 0; i < size; i++) {
+    if (events[i].data.ptr == NULL) {
+      interrupt_seen = true;
+    } else {
+      DescriptorInfo* di =
+          reinterpret_cast<DescriptorInfo*>(events[i].data.ptr);
+      intptr_t event_mask = GetPollEvents(events[i].events, di);
+
+      if ((event_mask & (1 << kErrorEvent)) != 0) {
+        di->NotifyAllDartPorts(event_mask);
+      }
+      event_mask &= ~(1 << kErrorEvent);
+
+      LOG_INFO("HandleEvents: fd=%ld events=%ld\n", di->fd(), event_mask);
+      if (event_mask != 0) {
+        intptr_t old_mask = di->Mask();
+        Dart_Port port = di->NextNotifyDartPort(event_mask);
+        ASSERT(port != 0);
+        UpdateEpollInstance(old_mask, di);
+        LOG_INFO("HandleEvents: Posting %ld to %ld for fd=%ld\n", event_mask,
+                 port, di->fd());
+        bool success = DartUtils::PostInt32(port, event_mask);
+        if (!success) {
+          // This can happen if e.g. the isolate that owns the port has died
+          // for some reason.
+          FATAL2("Failed to post event for fd %ld to port %ld", di->fd(), port);
+        }
+      }
+    }
+  }
+  if (interrupt_seen) {
+    // Handle after socket events, so we avoid closing a socket before we handle
+    // the current events.
+    HandleInterruptFd();
+  }
 }
 
 
@@ -93,8 +421,8 @@
   if (!timeout_queue_.HasTimeout()) {
     return kInfinityTimeout;
   }
-  int64_t millis = timeout_queue_.CurrentTimeout() -
-      TimerUtils::GetCurrentMonotonicMillis();
+  int64_t millis =
+      timeout_queue_.CurrentTimeout() - TimerUtils::GetCurrentMonotonicMillis();
   return (millis < 0) ? 0 : millis;
 }
 
@@ -102,7 +430,7 @@
 void EventHandlerImplementation::HandleTimeout() {
   if (timeout_queue_.HasTimeout()) {
     int64_t millis = timeout_queue_.CurrentTimeout() -
-        TimerUtils::GetCurrentMonotonicMillis();
+                     TimerUtils::GetCurrentMonotonicMillis();
     if (millis <= 0) {
       DartUtils::PostNull(timeout_queue_.CurrentPort());
       timeout_queue_.RemoveCurrent();
@@ -112,6 +440,8 @@
 
 
 void EventHandlerImplementation::Poll(uword args) {
+  static const intptr_t kMaxEvents = 16;
+  struct epoll_event events[kMaxEvents];
   EventHandler* handler = reinterpret_cast<EventHandler*>(args);
   EventHandlerImplementation* handler_impl = &handler->delegate_;
   ASSERT(handler_impl != NULL);
@@ -119,25 +449,18 @@
   while (!handler_impl->shutdown_) {
     int64_t millis = handler_impl->GetTimeout();
     ASSERT((millis == kInfinityTimeout) || (millis >= 0));
-
-    mx_time_t timeout =
-        millis * kMicrosecondsPerMillisecond * kNanosecondsPerMicrosecond;
-    mx_signals_state_t signals_state;
-    mx_status_t status = mx_handle_wait_one(
-        handler_impl->interrupt_handles_[0],
-        MX_SIGNAL_READABLE | MX_SIGNAL_PEER_CLOSED,
-        timeout,
-        &signals_state);
-    if ((status != NO_ERROR) && (status != ERR_TIMED_OUT)) {
-      FATAL1("mx_handle_wait_one failed: %s\n", mx_strstatus(status));
+    LOG_INFO("epoll_wait(millis = %ld)\n", millis);
+    intptr_t result = NO_RETRY_EXPECTED(
+        epoll_wait(handler_impl->epoll_fd_, events, kMaxEvents, millis));
+    ASSERT(EAGAIN == EWOULDBLOCK);
+    LOG_INFO("epoll_wait(millis = %ld) -> %ld\n", millis, result);
+    if (result < 0) {
+      if (errno != EWOULDBLOCK) {
+        perror("Poll failed");
+      }
     } else {
       handler_impl->HandleTimeout();
-      if ((signals_state.satisfied & MX_SIGNAL_READABLE) != 0) {
-        handler_impl->HandleEvents();
-      }
-      if ((signals_state.satisfied & MX_SIGNAL_PEER_CLOSED) != 0) {
-        FATAL("EventHandlerImplementation::Poll: Unexpected peer closed\n");
-      }
+      handler_impl->HandleEvents(events, result);
     }
   }
   handler->NotifyShutdownDone();
@@ -164,6 +487,17 @@
   WakeupHandler(id, dart_port, data);
 }
 
+void* EventHandlerImplementation::GetHashmapKeyFromFd(intptr_t fd) {
+  // The hashmap does not support keys with value 0.
+  return reinterpret_cast<void*>(fd + 1);
+}
+
+
+uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) {
+  // The hashmap does not support keys with value 0.
+  return dart::Utils::WordHash(fd + 1);
+}
+
 }  // namespace bin
 }  // namespace dart
 
diff --git a/runtime/bin/eventhandler_fuchsia.h b/runtime/bin/eventhandler_fuchsia.h
index 0130992..545fdb8 100644
--- a/runtime/bin/eventhandler_fuchsia.h
+++ b/runtime/bin/eventhandler_fuchsia.h
@@ -2,38 +2,93 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_EVENTHANDLER_FUCHSIA_H_
-#define BIN_EVENTHANDLER_FUCHSIA_H_
+#ifndef RUNTIME_BIN_EVENTHANDLER_FUCHSIA_H_
+#define RUNTIME_BIN_EVENTHANDLER_FUCHSIA_H_
 
-#if !defined(BIN_EVENTHANDLER_H_)
-#error Do not include eventhandler_fuchsia.h directly; use eventhandler.h instead.
+#if !defined(RUNTIME_BIN_EVENTHANDLER_H_)
+#error Do not include eventhandler_fuchsia.h directly; use eventhandler.h.
 #endif
 
-#include <magenta/syscalls.h>
+#include <errno.h>
+#include <sys/epoll.h>
+#include <sys/socket.h>
+#include <unistd.h>
+
+#include "platform/signal_blocker.h"
 
 namespace dart {
 namespace bin {
 
+class DescriptorInfo : public DescriptorInfoBase {
+ public:
+  explicit DescriptorInfo(intptr_t fd) : DescriptorInfoBase(fd) {}
+
+  virtual ~DescriptorInfo() {}
+
+  intptr_t GetPollEvents();
+
+  virtual void Close() {
+    // Should be VOID_TEMP_FAILURE_RETRY
+    VOID_NO_RETRY_EXPECTED(close(fd_));
+    fd_ = -1;
+  }
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(DescriptorInfo);
+};
+
+class DescriptorInfoSingle : public DescriptorInfoSingleMixin<DescriptorInfo> {
+ public:
+  explicit DescriptorInfoSingle(intptr_t fd)
+      : DescriptorInfoSingleMixin(fd, false) {}
+  virtual ~DescriptorInfoSingle() {}
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(DescriptorInfoSingle);
+};
+
+class DescriptorInfoMultiple
+    : public DescriptorInfoMultipleMixin<DescriptorInfo> {
+ public:
+  explicit DescriptorInfoMultiple(intptr_t fd)
+      : DescriptorInfoMultipleMixin(fd, false) {}
+  virtual ~DescriptorInfoMultiple() {}
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(DescriptorInfoMultiple);
+};
+
 class EventHandlerImplementation {
  public:
   EventHandlerImplementation();
   ~EventHandlerImplementation();
 
+  void UpdateEpollInstance(intptr_t old_mask, DescriptorInfo* di);
+
+  // Gets the socket data structure for a given file
+  // descriptor. Creates a new one if one is not found.
+  DescriptorInfo* GetDescriptorInfo(intptr_t fd, bool is_listening);
   void SendData(intptr_t id, Dart_Port dart_port, int64_t data);
   void Start(EventHandler* handler);
   void Shutdown();
 
  private:
+  static void Poll(uword args);
+  static void* GetHashmapKeyFromFd(intptr_t fd);
+  static uint32_t GetHashmapHashFromFd(intptr_t fd);
+
   int64_t GetTimeout() const;
-  void HandleEvents();
+  void HandleEvents(struct epoll_event* events, int size);
   void HandleTimeout();
   void WakeupHandler(intptr_t id, Dart_Port dart_port, int64_t data);
+  intptr_t GetPollEvents(intptr_t events, DescriptorInfo* di);
   void HandleInterruptFd();
-  static void Poll(uword args);
 
+  HashMap socket_map_;
   TimeoutQueue timeout_queue_;
   bool shutdown_;
-  mx_handle_t interrupt_handles_[2];
+  int interrupt_fds_[2];
+  int epoll_fd_;
 
   DISALLOW_COPY_AND_ASSIGN(EventHandlerImplementation);
 };
@@ -41,4 +96,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_EVENTHANDLER_FUCHSIA_H_
+#endif  // RUNTIME_BIN_EVENTHANDLER_FUCHSIA_H_
diff --git a/runtime/bin/eventhandler_linux.cc b/runtime/bin/eventhandler_linux.cc
index bd61e80..8b35818 100644
--- a/runtime/bin/eventhandler_linux.cc
+++ b/runtime/bin/eventhandler_linux.cc
@@ -10,15 +10,15 @@
 #include "bin/eventhandler.h"
 #include "bin/eventhandler_linux.h"
 
-#include <errno.h>  // NOLINT
-#include <fcntl.h>  // NOLINT
-#include <pthread.h>  // NOLINT
-#include <stdio.h>  // NOLINT
-#include <string.h>  // NOLINT
-#include <sys/epoll.h>  // NOLINT
-#include <sys/stat.h>  // NOLINT
+#include <errno.h>        // NOLINT
+#include <fcntl.h>        // NOLINT
+#include <pthread.h>      // NOLINT
+#include <stdio.h>        // NOLINT
+#include <string.h>       // NOLINT
+#include <sys/epoll.h>    // NOLINT
+#include <sys/stat.h>     // NOLINT
 #include <sys/timerfd.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <unistd.h>       // NOLINT
 
 #include "bin/dartutils.h"
 #include "bin/fdutils.h"
@@ -47,12 +47,8 @@
 
 // Unregister the file descriptor for a DescriptorInfo structure with
 // epoll.
-static void RemoveFromEpollInstance(intptr_t epoll_fd_,
-                                    DescriptorInfo* di) {
-  VOID_NO_RETRY_EXPECTED(epoll_ctl(epoll_fd_,
-                                   EPOLL_CTL_DEL,
-                                   di->fd(),
-                                   NULL));
+static void RemoveFromEpollInstance(intptr_t epoll_fd_, DescriptorInfo* di) {
+  VOID_NO_RETRY_EXPECTED(epoll_ctl(epoll_fd_, EPOLL_CTL_DEL, di->fd(), NULL));
 }
 
 
@@ -63,10 +59,8 @@
     event.events |= EPOLLET;
   }
   event.data.ptr = di;
-  int status = NO_RETRY_EXPECTED(epoll_ctl(epoll_fd_,
-                                           EPOLL_CTL_ADD,
-                                           di->fd(),
-                                           &event));
+  int status =
+      NO_RETRY_EXPECTED(epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, di->fd(), &event));
   if (status == -1) {
     // TODO(dart:io): Verify that the dart end is handling this correctly.
 
@@ -86,9 +80,15 @@
   if (result != 0) {
     FATAL("Pipe creation failed");
   }
-  FDUtils::SetNonBlocking(interrupt_fds_[0]);
-  FDUtils::SetCloseOnExec(interrupt_fds_[0]);
-  FDUtils::SetCloseOnExec(interrupt_fds_[1]);
+  if (!FDUtils::SetNonBlocking(interrupt_fds_[0])) {
+    FATAL("Failed to set pipe fd non blocking\n");
+  }
+  if (!FDUtils::SetCloseOnExec(interrupt_fds_[0])) {
+    FATAL("Failed to set pipe fd close on exec\n");
+  }
+  if (!FDUtils::SetCloseOnExec(interrupt_fds_[1])) {
+    FATAL("Failed to set pipe fd close on exec\n");
+  }
   shutdown_ = false;
   // The initial size passed to epoll_create is ignore on newer (>=
   // 2.6.8) Linux versions
@@ -97,15 +97,15 @@
   if (epoll_fd_ == -1) {
     FATAL1("Failed creating epoll file descriptor: %i", errno);
   }
-  FDUtils::SetCloseOnExec(epoll_fd_);
+  if (!FDUtils::SetCloseOnExec(epoll_fd_)) {
+    FATAL("Failed to set epoll fd close on exec\n");
+  }
   // Register the interrupt_fd with the epoll instance.
   struct epoll_event event;
   event.events = EPOLLIN;
   event.data.ptr = NULL;
-  int status = NO_RETRY_EXPECTED(epoll_ctl(epoll_fd_,
-                                           EPOLL_CTL_ADD,
-                                           interrupt_fds_[0],
-                                           &event));
+  int status = NO_RETRY_EXPECTED(
+      epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, interrupt_fds_[0], &event));
   if (status == -1) {
     FATAL("Failed adding interrupt fd to epoll instance");
   }
@@ -116,13 +116,11 @@
   // Register the timer_fd_ with the epoll instance.
   event.events = EPOLLIN;
   event.data.fd = timer_fd_;
-  status = NO_RETRY_EXPECTED(epoll_ctl(epoll_fd_,
-                                       EPOLL_CTL_ADD,
-                                       timer_fd_,
-                                       &event));
+  status =
+      NO_RETRY_EXPECTED(epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, timer_fd_, &event));
   if (status == -1) {
-    FATAL2(
-        "Failed adding timerfd fd(%i) to epoll instance: %i", timer_fd_, errno);
+    FATAL2("Failed adding timerfd fd(%i) to epoll instance: %i", timer_fd_,
+           errno);
   }
 }
 
@@ -144,7 +142,7 @@
 
 
 void EventHandlerImplementation::UpdateEpollInstance(intptr_t old_mask,
-                                                     DescriptorInfo *di) {
+                                                     DescriptorInfo* di) {
   intptr_t new_mask = di->Mask();
   if ((old_mask != 0) && (new_mask == 0)) {
     RemoveFromEpollInstance(epoll_fd_, di);
@@ -159,10 +157,11 @@
 
 
 DescriptorInfo* EventHandlerImplementation::GetDescriptorInfo(
-    intptr_t fd, bool is_listening) {
+    intptr_t fd,
+    bool is_listening) {
   ASSERT(fd >= 0);
-  HashMap::Entry* entry = socket_map_.Lookup(
-      GetHashmapKeyFromFd(fd), GetHashmapHashFromFd(fd), true);
+  HashMap::Entry* entry = socket_map_.Lookup(GetHashmapKeyFromFd(fd),
+                                             GetHashmapHashFromFd(fd), true);
   ASSERT(entry != NULL);
   DescriptorInfo* di = reinterpret_cast<DescriptorInfo*>(entry->value);
   if (di == NULL) {
@@ -224,8 +223,8 @@
     } else {
       ASSERT((msg[i].data & COMMAND_MASK) != 0);
 
-      DescriptorInfo* di = GetDescriptorInfo(
-          msg[i].id, IS_LISTENING_SOCKET(msg[i].data));
+      DescriptorInfo* di =
+          GetDescriptorInfo(msg[i].id, IS_LISTENING_SOCKET(msg[i].data));
       if (IS_COMMAND(msg[i].data, kShutdownReadCommand)) {
         ASSERT(!di->IsListeningSocket());
         // Close the socket for reading.
@@ -248,7 +247,7 @@
           // We only close the socket file descriptor from the operating
           // system if there are no other dart socket objects which
           // are listening on the same (address, port) combination.
-          ListeningSocketRegistry *registry =
+          ListeningSocketRegistry* registry =
               ListeningSocketRegistry::Instance();
 
           MutexLocker locker(registry->mutex());
@@ -262,8 +261,7 @@
           }
         } else {
           ASSERT(new_mask == 0);
-          socket_map_.Remove(
-              GetHashmapKeyFromFd(fd), GetHashmapHashFromFd(fd));
+          socket_map_.Remove(GetHashmapKeyFromFd(fd), GetHashmapHashFromFd(fd));
           di->Close();
           delete di;
         }
@@ -311,8 +309,8 @@
   if ((events & EPOLLRDHUP) != 0) {
     Log::Print("EPOLLRDHUP ");
   }
-  int all_events = EPOLLIN | EPOLLPRI | EPOLLOUT |
-      EPOLLERR | EPOLLHUP | EPOLLRDHUP;
+  int all_events =
+      EPOLLIN | EPOLLPRI | EPOLLOUT | EPOLLERR | EPOLLHUP | EPOLLRDHUP;
   if ((events & ~all_events) != 0) {
     Log::Print("(and %08x) ", events & ~all_events);
   }
diff --git a/runtime/bin/eventhandler_linux.h b/runtime/bin/eventhandler_linux.h
index dd87c22..5386eb6 100644
--- a/runtime/bin/eventhandler_linux.h
+++ b/runtime/bin/eventhandler_linux.h
@@ -2,10 +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.
 
-#ifndef BIN_EVENTHANDLER_LINUX_H_
-#define BIN_EVENTHANDLER_LINUX_H_
+#ifndef RUNTIME_BIN_EVENTHANDLER_LINUX_H_
+#define RUNTIME_BIN_EVENTHANDLER_LINUX_H_
 
-#if !defined(BIN_EVENTHANDLER_H_)
+#if !defined(RUNTIME_BIN_EVENTHANDLER_H_)
 #error Do not include eventhandler_linux.h directly; use eventhandler.h instead.
 #endif
 
@@ -23,9 +23,9 @@
 
 class DescriptorInfo : public DescriptorInfoBase {
  public:
-  explicit DescriptorInfo(intptr_t fd) : DescriptorInfoBase(fd) { }
+  explicit DescriptorInfo(intptr_t fd) : DescriptorInfoBase(fd) {}
 
-  virtual ~DescriptorInfo() { }
+  virtual ~DescriptorInfo() {}
 
   intptr_t GetPollEvents();
 
@@ -39,8 +39,7 @@
 };
 
 
-class DescriptorInfoSingle
-    : public DescriptorInfoSingleMixin<DescriptorInfo> {
+class DescriptorInfoSingle : public DescriptorInfoSingleMixin<DescriptorInfo> {
  public:
   explicit DescriptorInfoSingle(intptr_t fd)
       : DescriptorInfoSingleMixin(fd, false) {}
@@ -68,7 +67,7 @@
   EventHandlerImplementation();
   ~EventHandlerImplementation();
 
-  void UpdateEpollInstance(intptr_t old_mask, DescriptorInfo *di);
+  void UpdateEpollInstance(intptr_t old_mask, DescriptorInfo* di);
 
   // Gets the socket data structure for a given file
   // descriptor. Creates a new one if one is not found.
@@ -100,4 +99,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_EVENTHANDLER_LINUX_H_
+#endif  // RUNTIME_BIN_EVENTHANDLER_LINUX_H_
diff --git a/runtime/bin/eventhandler_macos.cc b/runtime/bin/eventhandler_macos.cc
index b55ea8e..640f05a 100644
--- a/runtime/bin/eventhandler_macos.cc
+++ b/runtime/bin/eventhandler_macos.cc
@@ -10,13 +10,13 @@
 #include "bin/eventhandler.h"
 #include "bin/eventhandler_macos.h"
 
-#include <errno.h>  // NOLINT
-#include <fcntl.h>  // NOLINT
-#include <pthread.h>  // NOLINT
-#include <stdio.h>  // NOLINT
-#include <string.h>  // NOLINT
+#include <errno.h>      // NOLINT
+#include <fcntl.h>      // NOLINT
+#include <pthread.h>    // NOLINT
+#include <stdio.h>      // NOLINT
+#include <string.h>     // NOLINT
 #include <sys/event.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <unistd.h>     // NOLINT
 
 #include "bin/dartutils.h"
 #include "bin/fdutils.h"
@@ -72,24 +72,12 @@
 
   // Register or unregister READ filter if needed.
   if (di->HasReadEvent()) {
-    EV_SET(events + changes,
-           di->fd(),
-           EVFILT_READ,
-           flags,
-           0,
-           0,
-           di);
+    EV_SET(events + changes, di->fd(), EVFILT_READ, flags, 0, 0, di);
     ++changes;
   }
   // Register or unregister WRITE filter if needed.
   if (di->HasWriteEvent()) {
-    EV_SET(events + changes,
-           di->fd(),
-           EVFILT_WRITE,
-           flags,
-           0,
-           0,
-           di);
+    EV_SET(events + changes, di->fd(), EVFILT_WRITE, flags, 0, 0, di);
     ++changes;
   }
   ASSERT(changes > 0);
@@ -117,16 +105,24 @@
   if (result != 0) {
     FATAL("Pipe creation failed");
   }
-  FDUtils::SetNonBlocking(interrupt_fds_[0]);
-  FDUtils::SetCloseOnExec(interrupt_fds_[0]);
-  FDUtils::SetCloseOnExec(interrupt_fds_[1]);
+  if (!FDUtils::SetNonBlocking(interrupt_fds_[0])) {
+    FATAL("Failed to set pipe fd non-blocking\n");
+  }
+  if (!FDUtils::SetCloseOnExec(interrupt_fds_[0])) {
+    FATAL("Failed to set pipe fd close on exec\n");
+  }
+  if (!FDUtils::SetCloseOnExec(interrupt_fds_[1])) {
+    FATAL("Failed to set pipe fd close on exec\n");
+  }
   shutdown_ = false;
 
   kqueue_fd_ = NO_RETRY_EXPECTED(kqueue());
   if (kqueue_fd_ == -1) {
     FATAL("Failed creating kqueue");
   }
-  FDUtils::SetCloseOnExec(kqueue_fd_);
+  if (!FDUtils::SetCloseOnExec(kqueue_fd_)) {
+    FATAL("Failed to set kqueue fd close on exec\n");
+  }
   // Register the interrupt_fd with the kqueue.
   struct kevent event;
   EV_SET(&event, interrupt_fds_[0], EVFILT_READ, EV_ADD, 0, 0, NULL);
@@ -156,7 +152,7 @@
 
 
 void EventHandlerImplementation::UpdateKQueueInstance(intptr_t old_mask,
-                                                      DescriptorInfo *di) {
+                                                      DescriptorInfo* di) {
   intptr_t new_mask = di->Mask();
   if (old_mask != 0 && new_mask == 0) {
     RemoveFromKqueue(kqueue_fd_, di);
@@ -171,13 +167,13 @@
 
 
 DescriptorInfo* EventHandlerImplementation::GetDescriptorInfo(
-    intptr_t fd, bool is_listening) {
+    intptr_t fd,
+    bool is_listening) {
   ASSERT(fd >= 0);
-  HashMap::Entry* entry = socket_map_.Lookup(
-      GetHashmapKeyFromFd(fd), GetHashmapHashFromFd(fd), true);
+  HashMap::Entry* entry = socket_map_.Lookup(GetHashmapKeyFromFd(fd),
+                                             GetHashmapHashFromFd(fd), true);
   ASSERT(entry != NULL);
-  DescriptorInfo* di =
-      reinterpret_cast<DescriptorInfo*>(entry->value);
+  DescriptorInfo* di = reinterpret_cast<DescriptorInfo*>(entry->value);
   if (di == NULL) {
     // If there is no data in the hash map for this file descriptor a
     // new DescriptorInfo for the file descriptor is inserted.
@@ -227,8 +223,8 @@
     } else {
       ASSERT((msg[i].data & COMMAND_MASK) != 0);
 
-      DescriptorInfo* di = GetDescriptorInfo(
-          msg[i].id, IS_LISTENING_SOCKET(msg[i].data));
+      DescriptorInfo* di =
+          GetDescriptorInfo(msg[i].id, IS_LISTENING_SOCKET(msg[i].data));
       if (IS_COMMAND(msg[i].data, kShutdownReadCommand)) {
         ASSERT(!di->IsListeningSocket());
         // Close the socket for reading.
@@ -251,7 +247,7 @@
           // We only close the socket file descriptor from the operating
           // system if there are no other dart socket objects which
           // are listening on the same (address, port) combination.
-          ListeningSocketRegistry *registry =
+          ListeningSocketRegistry* registry =
               ListeningSocketRegistry::Instance();
 
           MutexLocker locker(registry->mutex());
@@ -265,8 +261,7 @@
           }
         } else {
           ASSERT(new_mask == 0);
-          socket_map_.Remove(
-              GetHashmapKeyFromFd(fd), GetHashmapHashFromFd(fd));
+          socket_map_.Remove(GetHashmapKeyFromFd(fd), GetHashmapHashFromFd(fd));
           di->Close();
           delete di;
         }
@@ -379,8 +374,7 @@
 }
 
 
-void EventHandlerImplementation::HandleEvents(struct kevent* events,
-                                              int size) {
+void EventHandlerImplementation::HandleEvents(struct kevent* events, int size) {
   bool interrupt_seen = false;
   for (int i = 0; i < size; i++) {
     // If flag EV_ERROR is set it indicates an error in kevent processing.
@@ -393,8 +387,7 @@
     if (events[i].udata == NULL) {
       interrupt_seen = true;
     } else {
-      DescriptorInfo* di =
-          reinterpret_cast<DescriptorInfo*>(events[i].udata);
+      DescriptorInfo* di = reinterpret_cast<DescriptorInfo*>(events[i].udata);
       intptr_t event_mask = GetEvents(events + i, di);
       if ((event_mask & (1 << kErrorEvent)) != 0) {
         di->NotifyAllDartPorts(event_mask);
@@ -422,8 +415,8 @@
   if (!timeout_queue_.HasTimeout()) {
     return kInfinityTimeout;
   }
-  int64_t millis = timeout_queue_.CurrentTimeout() -
-      TimerUtils::GetCurrentMonotonicMillis();
+  int64_t millis =
+      timeout_queue_.CurrentTimeout() - TimerUtils::GetCurrentMonotonicMillis();
   return (millis < 0) ? 0 : millis;
 }
 
@@ -431,7 +424,7 @@
 void EventHandlerImplementation::HandleTimeout() {
   if (timeout_queue_.HasTimeout()) {
     int64_t millis = timeout_queue_.CurrentTimeout() -
-        TimerUtils::GetCurrentMonotonicMillis();
+                     TimerUtils::GetCurrentMonotonicMillis();
     if (millis <= 0) {
       DartUtils::PostNull(timeout_queue_.CurrentPort());
       timeout_queue_.RemoveCurrent();
@@ -483,9 +476,8 @@
 
 
 void EventHandlerImplementation::Start(EventHandler* handler) {
-  int result =
-      Thread::Start(&EventHandlerImplementation::EventHandlerEntry,
-                    reinterpret_cast<uword>(handler));
+  int result = Thread::Start(&EventHandlerImplementation::EventHandlerEntry,
+                             reinterpret_cast<uword>(handler));
   if (result != 0) {
     FATAL1("Failed to start event handler thread %d", result);
   }
diff --git a/runtime/bin/eventhandler_macos.h b/runtime/bin/eventhandler_macos.h
index b846594..414dfbe 100644
--- a/runtime/bin/eventhandler_macos.h
+++ b/runtime/bin/eventhandler_macos.h
@@ -2,10 +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.
 
-#ifndef BIN_EVENTHANDLER_MACOS_H_
-#define BIN_EVENTHANDLER_MACOS_H_
+#ifndef RUNTIME_BIN_EVENTHANDLER_MACOS_H_
+#define RUNTIME_BIN_EVENTHANDLER_MACOS_H_
 
-#if !defined(BIN_EVENTHANDLER_H_)
+#if !defined(RUNTIME_BIN_EVENTHANDLER_H_)
 #error Do not include eventhandler_macos.h directly; use eventhandler.h instead.
 #endif
 
@@ -24,9 +24,9 @@
 class DescriptorInfo : public DescriptorInfoBase {
  public:
   explicit DescriptorInfo(intptr_t fd)
-      : DescriptorInfoBase(fd), tracked_by_kqueue_(false) { }
+      : DescriptorInfoBase(fd), tracked_by_kqueue_(false) {}
 
-  virtual ~DescriptorInfo() { }
+  virtual ~DescriptorInfo() {}
 
   intptr_t GetPollEvents();
 
@@ -35,9 +35,7 @@
     fd_ = -1;
   }
 
-  void set_tracked_by_kqueue(bool value) {
-    tracked_by_kqueue_ = value;
-  }
+  void set_tracked_by_kqueue(bool value) { tracked_by_kqueue_ = value; }
 
   bool tracked_by_kqueue() { return tracked_by_kqueue_; }
 
@@ -53,8 +51,7 @@
 };
 
 
-class DescriptorInfoSingle
-    : public DescriptorInfoSingleMixin<DescriptorInfo> {
+class DescriptorInfoSingle : public DescriptorInfoSingleMixin<DescriptorInfo> {
  public:
   explicit DescriptorInfoSingle(intptr_t fd)
       : DescriptorInfoSingleMixin(fd, false) {}
@@ -82,7 +79,7 @@
   EventHandlerImplementation();
   ~EventHandlerImplementation();
 
-  void UpdateKQueueInstance(intptr_t old_mask, DescriptorInfo *di);
+  void UpdateKQueueInstance(intptr_t old_mask, DescriptorInfo* di);
 
   // Gets the socket data structure for a given file
   // descriptor. Creates a new one if one is not found.
@@ -115,4 +112,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_EVENTHANDLER_MACOS_H_
+#endif  // RUNTIME_BIN_EVENTHANDLER_MACOS_H_
diff --git a/runtime/bin/eventhandler_patch.dart b/runtime/bin/eventhandler_patch.dart
index effe402..588a4b8 100644
--- a/runtime/bin/eventhandler_patch.dart
+++ b/runtime/bin/eventhandler_patch.dart
@@ -2,8 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import 'dart:nativewrappers';
-
 @patch class _EventHandler {
   @patch static void _sendData(Object sender,
                                     SendPort sendPort,
diff --git a/runtime/bin/eventhandler_unsupported.cc b/runtime/bin/eventhandler_unsupported.cc
index c79ad24..e936055 100644
--- a/runtime/bin/eventhandler_unsupported.cc
+++ b/runtime/bin/eventhandler_unsupported.cc
@@ -13,24 +13,22 @@
 namespace dart {
 namespace bin {
 
-void EventHandler::Start() {
-}
+void EventHandler::Start() {}
 
 
-void EventHandler::Stop() {
-}
+void EventHandler::Stop() {}
 
 
 void FUNCTION_NAME(EventHandler_SendData)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "EventHandler is not supported on this platform"));
+      "EventHandler is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(EventHandler_TimerMillisecondClock)(
     Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "EventHandler is not supported on this platform"));
+      "EventHandler is not supported on this platform"));
 }
 
 }  // namespace bin
diff --git a/runtime/bin/eventhandler_win.cc b/runtime/bin/eventhandler_win.cc
index f125bb8..81adcfd 100644
--- a/runtime/bin/eventhandler_win.cc
+++ b/runtime/bin/eventhandler_win.cc
@@ -10,9 +10,9 @@
 #include "bin/eventhandler.h"
 #include "bin/eventhandler_win.h"
 
-#include <fcntl.h>  // NOLINT
-#include <io.h>  // NOLINT
-#include <mswsock.h>  // NOLINT
+#include <fcntl.h>     // NOLINT
+#include <io.h>        // NOLINT
+#include <mswsock.h>   // NOLINT
 #include <winsock2.h>  // NOLINT
 #include <ws2tcpip.h>  // NOLINT
 
@@ -36,7 +36,7 @@
 OverlappedBuffer* OverlappedBuffer::AllocateBuffer(int buffer_size,
                                                    Operation operation) {
   OverlappedBuffer* buffer =
-      new(buffer_size) OverlappedBuffer(buffer_size, operation);
+      new (buffer_size) OverlappedBuffer(buffer_size, operation);
   return buffer;
 }
 
@@ -129,8 +129,7 @@
       read_thread_handle_(NULL),
       read_thread_starting_(false),
       read_thread_finished_(false),
-      monitor_(new Monitor()) {
-}
+      monitor_(new Monitor()) {}
 
 
 Handle::~Handle() {
@@ -139,10 +138,8 @@
 
 
 bool Handle::CreateCompletionPort(HANDLE completion_port) {
-  completion_port_ = CreateIoCompletionPort(handle(),
-                                            completion_port,
-                                            reinterpret_cast<ULONG_PTR>(this),
-                                            0);
+  completion_port_ = CreateIoCompletionPort(
+      handle(), completion_port, reinterpret_cast<ULONG_PTR>(this), 0);
   return (completion_port_ != NULL);
 }
 
@@ -280,19 +277,14 @@
   }
   char* buffer_start = pending_read_->GetBufferStart();
   DWORD bytes_read = 0;
-  BOOL ok = ReadFile(handle_,
-                     buffer_start,
-                     buffer_size,
-                     &bytes_read,
-                     NULL);
+  BOOL ok = ReadFile(handle_, buffer_start, buffer_size, &bytes_read, NULL);
   if (!ok) {
     bytes_read = 0;
   }
   OVERLAPPED* overlapped = pending_read_->GetCleanOverlapped();
-  ok = PostQueuedCompletionStatus(event_handler_->completion_port(),
-                                  bytes_read,
-                                  reinterpret_cast<ULONG_PTR>(this),
-                                  overlapped);
+  ok =
+      PostQueuedCompletionStatus(event_handler_->completion_port(), bytes_read,
+                                 reinterpret_cast<ULONG_PTR>(this), overlapped);
   if (!ok) {
     FATAL("PostQueuedCompletionStatus failed");
   }
@@ -307,11 +299,9 @@
   if (SupportsOverlappedIO()) {
     ASSERT(completion_port_ != INVALID_HANDLE_VALUE);
 
-    BOOL ok = ReadFile(handle_,
-                       buffer->GetBufferStart(),
-                       buffer->GetBufferSize(),
-                       NULL,
-                       buffer->GetCleanOverlapped());
+    BOOL ok =
+        ReadFile(handle_, buffer->GetBufferStart(), buffer->GetBufferSize(),
+                 NULL, buffer->GetCleanOverlapped());
     if (ok || (GetLastError() == ERROR_IO_PENDING)) {
       // Completing asynchronously.
       pending_read_ = buffer;
@@ -324,8 +314,7 @@
     // Completing asynchronously through thread.
     pending_read_ = buffer;
     read_thread_starting_ = true;
-    int result = Thread::Start(ReadFileThread,
-                               reinterpret_cast<uword>(this));
+    int result = Thread::Start(ReadFileThread, reinterpret_cast<uword>(this));
     if (result != 0) {
       FATAL1("Failed to start read file thread %d", result);
     }
@@ -347,11 +336,9 @@
   ASSERT(pending_write_->operation() == OverlappedBuffer::kWrite);
 
   OverlappedBuffer* buffer = pending_write_;
-  BOOL ok = WriteFile(handle_,
-                      buffer->GetBufferStart(),
-                      buffer->GetBufferSize(),
-                      NULL,
-                      buffer->GetCleanOverlapped());
+  BOOL ok =
+      WriteFile(handle_, buffer->GetBufferStart(), buffer->GetBufferSize(),
+                NULL, buffer->GetCleanOverlapped());
   if (ok || (GetLastError() == ERROR_IO_PENDING)) {
     // Completing asynchronously.
     pending_write_ = buffer;
@@ -433,14 +420,9 @@
   }
   OverlappedBuffer* buffer = OverlappedBuffer::AllocateReadBuffer(kBufferSize);
   ASSERT(completion_port_ != INVALID_HANDLE_VALUE);
-  BOOL ok = ReadDirectoryChangesW(handle_,
-                                  buffer->GetBufferStart(),
-                                  buffer->GetBufferSize(),
-                                  recursive_,
-                                  events_,
-                                  NULL,
-                                  buffer->GetCleanOverlapped(),
-                                  NULL);
+  BOOL ok = ReadDirectoryChangesW(handle_, buffer->GetBufferStart(),
+                                  buffer->GetBufferSize(), recursive_, events_,
+                                  NULL, buffer->GetCleanOverlapped(), NULL);
   if (ok || (GetLastError() == ERROR_IO_PENDING)) {
     // Completing asynchronously.
     pending_read_ = buffer;
@@ -479,15 +461,9 @@
   // Load the AcceptEx function into memory using WSAIoctl.
   GUID guid_accept_ex = WSAID_ACCEPTEX;
   DWORD bytes;
-  int status = WSAIoctl(socket(),
-                        SIO_GET_EXTENSION_FUNCTION_POINTER,
-                        &guid_accept_ex,
-                        sizeof(guid_accept_ex),
-                        &AcceptEx_,
-                        sizeof(AcceptEx_),
-                        &bytes,
-                        NULL,
-                        NULL);
+  int status = WSAIoctl(socket(), SIO_GET_EXTENSION_FUNCTION_POINTER,
+                        &guid_accept_ex, sizeof(guid_accept_ex), &AcceptEx_,
+                        sizeof(AcceptEx_), &bytes, NULL, NULL);
   return (status != SOCKET_ERROR);
 }
 
@@ -507,14 +483,10 @@
       OverlappedBuffer::AllocateAcceptBuffer(2 * kAcceptExAddressStorageSize);
   DWORD received;
   BOOL ok;
-  ok = AcceptEx_(socket(),
-                 buffer->client(),
-                 buffer->GetBufferStart(),
+  ok = AcceptEx_(socket(), buffer->client(), buffer->GetBufferStart(),
                  0,  // For now don't receive data with accept.
-                 kAcceptExAddressStorageSize,
-                 kAcceptExAddressStorageSize,
-                 &received,
-                 buffer->GetCleanOverlapped());
+                 kAcceptExAddressStorageSize, kAcceptExAddressStorageSize,
+                 &received, buffer->GetCleanOverlapped());
   if (!ok) {
     if (WSAGetLastError() != WSA_IO_PENDING) {
       int error = WSAGetLastError();
@@ -537,9 +509,7 @@
   if (!IsClosing()) {
     // Update the accepted socket to support the full range of API calls.
     SOCKET s = socket();
-    int rc = setsockopt(buffer->client(),
-                        SOL_SOCKET,
-                        SO_UPDATE_ACCEPT_CONTEXT,
+    int rc = setsockopt(buffer->client(), SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT,
                         reinterpret_cast<char*>(&s), sizeof(s));
     if (rc == NO_ERROR) {
       // Insert the accepted socket into the list.
@@ -582,7 +552,7 @@
   handle_ = INVALID_HANDLE_VALUE;
   while (CanAccept()) {
     // Get rid of connections already accepted.
-    ClientSocket *client = Accept();
+    ClientSocket* client = Accept();
     if (client != NULL) {
       client->Close();
       DeleteIfClosed(client);
@@ -602,7 +572,7 @@
 ClientSocket* ListenSocket::Accept() {
   MonitorLocker ml(monitor_);
 
-  ClientSocket *result = NULL;
+  ClientSocket* result = NULL;
 
   if (accepted_head_ != NULL) {
     result = accepted_head_;
@@ -660,8 +630,8 @@
   if (data_ready_ == NULL) {
     return 0;
   }
-  num_bytes = data_ready_->Read(
-      buffer, Utils::Minimum<intptr_t>(num_bytes, INT_MAX));
+  num_bytes =
+      data_ready_->Read(buffer, Utils::Minimum<intptr_t>(num_bytes, INT_MAX));
   if (data_ready_->IsEmpty()) {
     OverlappedBuffer::DisposeBuffer(data_ready_);
     data_ready_ = NULL;
@@ -673,14 +643,16 @@
 }
 
 
-intptr_t Handle::RecvFrom(
-    void* buffer, intptr_t num_bytes, struct sockaddr* sa, socklen_t sa_len) {
+intptr_t Handle::RecvFrom(void* buffer,
+                          intptr_t num_bytes,
+                          struct sockaddr* sa,
+                          socklen_t sa_len) {
   MonitorLocker ml(monitor_);
   if (data_ready_ == NULL) {
     return 0;
   }
-  num_bytes = data_ready_->Read(
-      buffer, Utils::Minimum<intptr_t>(num_bytes, INT_MAX));
+  num_bytes =
+      data_ready_->Read(buffer, Utils::Minimum<intptr_t>(num_bytes, INT_MAX));
   if (data_ready_->from()->sa_family == AF_INET) {
     ASSERT(sa_len >= sizeof(struct sockaddr_in));
     memmove(sa, data_ready_->from(), sizeof(struct sockaddr_in));
@@ -777,20 +749,16 @@
   ASSERT(pending_write_ != NULL);
 
   DWORD bytes_written = -1;
-  BOOL ok = WriteFile(handle_,
-                      pending_write_->GetBufferStart(),
-                      pending_write_->GetBufferSize(),
-                      &bytes_written,
-                      NULL);
+  BOOL ok = WriteFile(handle_, pending_write_->GetBufferStart(),
+                      pending_write_->GetBufferSize(), &bytes_written, NULL);
   if (!ok) {
     bytes_written = 0;
   }
   thread_wrote_ += bytes_written;
   OVERLAPPED* overlapped = pending_write_->GetCleanOverlapped();
-  ok = PostQueuedCompletionStatus(event_handler_->completion_port(),
-                                  bytes_written,
-                                  reinterpret_cast<ULONG_PTR>(this),
-                                  overlapped);
+  ok = PostQueuedCompletionStatus(
+      event_handler_->completion_port(), bytes_written,
+      reinterpret_cast<ULONG_PTR>(this), overlapped);
   if (!ok) {
     FATAL("PostQueuedCompletionStatus failed");
   }
@@ -818,8 +786,7 @@
   }
   if (!write_thread_exists_) {
     write_thread_exists_ = true;
-    int result = Thread::Start(
-        WriteFileThread, reinterpret_cast<uword>(this));
+    int result = Thread::Start(WriteFileThread, reinterpret_cast<uword>(this));
     if (result != 0) {
       FATAL1("Failed to start write file thread %d", result);
     }
@@ -859,15 +826,10 @@
   // Load the DisconnectEx function into memory using WSAIoctl.
   GUID guid_disconnect_ex = WSAID_DISCONNECTEX;
   DWORD bytes;
-  int status = WSAIoctl(socket(),
-                        SIO_GET_EXTENSION_FUNCTION_POINTER,
-                        &guid_disconnect_ex,
-                        sizeof(guid_disconnect_ex),
-                        &DisconnectEx_,
-                        sizeof(DisconnectEx_),
-                        &bytes,
-                        NULL,
-                        NULL);
+  int status =
+      WSAIoctl(socket(), SIO_GET_EXTENSION_FUNCTION_POINTER,
+               &guid_disconnect_ex, sizeof(guid_disconnect_ex), &DisconnectEx_,
+               sizeof(DisconnectEx_), &bytes, NULL, NULL);
   return (status != SOCKET_ERROR);
 }
 
@@ -906,13 +868,8 @@
 
   DWORD flags;
   flags = 0;
-  int rc = WSARecv(socket(),
-                   buffer->GetWASBUF(),
-                   1,
-                   NULL,
-                   &flags,
-                   buffer->GetCleanOverlapped(),
-                   NULL);
+  int rc = WSARecv(socket(), buffer->GetWASBUF(), 1, NULL, &flags,
+                   buffer->GetCleanOverlapped(), NULL);
   if ((rc == NO_ERROR) || (WSAGetLastError() == WSA_IO_PENDING)) {
     pending_read_ = buffer;
     return true;
@@ -930,13 +887,8 @@
   ASSERT(pending_write_ != NULL);
   ASSERT(pending_write_->operation() == OverlappedBuffer::kWrite);
 
-  int rc = WSASend(socket(),
-                   pending_write_->GetWASBUF(),
-                   1,
-                   NULL,
-                   0,
-                   pending_write_->GetCleanOverlapped(),
-                   NULL);
+  int rc = WSASend(socket(), pending_write_->GetWASBUF(), 1, NULL, 0,
+                   pending_write_->GetCleanOverlapped(), NULL);
   if ((rc == NO_ERROR) || (WSAGetLastError() == WSA_IO_PENDING)) {
     return true;
   }
@@ -949,8 +901,8 @@
 
 void ClientSocket::IssueDisconnect() {
   OverlappedBuffer* buffer = OverlappedBuffer::AllocateDisconnectBuffer();
-  BOOL ok = DisconnectEx_(
-    socket(), buffer->GetCleanOverlapped(), TF_REUSE_SOCKET, 0);
+  BOOL ok =
+      DisconnectEx_(socket(), buffer->GetCleanOverlapped(), TF_REUSE_SOCKET, 0);
   // DisconnectEx works like other OverlappedIO APIs, where we can get either an
   // immediate success or delayed operation by WSA_IO_PENDING being set.
   if (ok || (WSAGetLastError() != WSA_IO_PENDING)) {
@@ -1009,15 +961,8 @@
   ASSERT(pending_write_ != NULL);
   ASSERT(pending_write_->operation() == OverlappedBuffer::kSendTo);
 
-  int rc = WSASendTo(socket(),
-                     pending_write_->GetWASBUF(),
-                     1,
-                     NULL,
-                     0,
-                     sa,
-                     sa_len,
-                     pending_write_->GetCleanOverlapped(),
-                     NULL);
+  int rc = WSASendTo(socket(), pending_write_->GetWASBUF(), 1, NULL, 0, sa,
+                     sa_len, pending_write_->GetCleanOverlapped(), NULL);
   if ((rc == NO_ERROR) || (WSAGetLastError() == WSA_IO_PENDING)) {
     return true;
   }
@@ -1038,15 +983,9 @@
 
   DWORD flags;
   flags = 0;
-  int rc = WSARecvFrom(socket(),
-                       buffer->GetWASBUF(),
-                       1,
-                       NULL,
-                       &flags,
-                       buffer->from(),
-                       buffer->from_len_addr(),
-                       buffer->GetCleanOverlapped(),
-                       NULL);
+  int rc = WSARecvFrom(socket(), buffer->GetWASBUF(), 1, NULL, &flags,
+                       buffer->from(), buffer->from_len_addr(),
+                       buffer->GetCleanOverlapped(), NULL);
   if ((rc == NO_ERROR) || (WSAGetLastError() == WSA_IO_PENDING)) {
     pending_read_ = buffer;
     return true;
@@ -1096,8 +1035,7 @@
     ASSERT(handle != NULL);
 
     if (handle->is_listen_socket()) {
-      ListenSocket* listen_socket =
-          reinterpret_cast<ListenSocket*>(handle);
+      ListenSocket* listen_socket = reinterpret_cast<ListenSocket*>(handle);
       listen_socket->EnsureInitialized(this);
 
       MonitorLocker ml(listen_socket->monitor_);
@@ -1116,8 +1054,7 @@
         // We only close the socket file descriptor from the operating
         // system if there are no other dart socket objects which
         // are listening on the same (address, port) combination.
-        ListeningSocketRegistry *registry =
-            ListeningSocketRegistry::Instance();
+        ListeningSocketRegistry* registry = ListeningSocketRegistry::Instance();
         MutexLocker locker(registry->mutex());
         if (registry->CloseSafe(reinterpret_cast<intptr_t>(listen_socket))) {
           ASSERT(listen_socket->Mask() == 0);
@@ -1213,12 +1150,11 @@
 
 
 void EventHandlerImplementation::TryDispatchingPendingAccepts(
-    ListenSocket *listen_socket) {
+    ListenSocket* listen_socket) {
   if (!listen_socket->IsClosing() && listen_socket->CanAccept()) {
     intptr_t event_mask = 1 << kInEvent;
-    for (int i = 0;
-         (i < listen_socket->accepted_count()) &&
-         (listen_socket->Mask() == event_mask);
+    for (int i = 0; (i < listen_socket->accepted_count()) &&
+                    (listen_socket->Mask() == event_mask);
          i++) {
       Dart_Port port = listen_socket->NextNotifyDartPort(event_mask);
       DartUtils::PostInt32(port, event_mask);
@@ -1298,19 +1234,17 @@
 }
 
 
-void EventHandlerImplementation::HandleDisconnect(
-    ClientSocket* client_socket,
-    int bytes,
-    OverlappedBuffer* buffer) {
+void EventHandlerImplementation::HandleDisconnect(ClientSocket* client_socket,
+                                                  int bytes,
+                                                  OverlappedBuffer* buffer) {
   client_socket->DisconnectComplete(buffer);
   DeleteIfClosed(client_socket);
 }
 
 
-void EventHandlerImplementation::HandleConnect(
-    ClientSocket* client_socket,
-    int bytes,
-    OverlappedBuffer* buffer) {
+void EventHandlerImplementation::HandleConnect(ClientSocket* client_socket,
+                                               int bytes,
+                                               OverlappedBuffer* buffer) {
   if (bytes < 0) {
     HandleError(client_socket);
     OverlappedBuffer::DisposeBuffer(buffer);
@@ -1400,8 +1334,8 @@
   if (!timeout_queue_.HasTimeout()) {
     return kInfinityTimeout;
   }
-  int64_t millis = timeout_queue_.CurrentTimeout() -
-      TimerUtils::GetCurrentMonotonicMillis();
+  int64_t millis =
+      timeout_queue_.CurrentTimeout() - TimerUtils::GetCurrentMonotonicMillis();
   return (millis < 0) ? 0 : millis;
 }
 
@@ -1413,8 +1347,8 @@
   msg->id = id;
   msg->dart_port = dart_port;
   msg->data = data;
-  BOOL ok = PostQueuedCompletionStatus(
-      completion_port_, 0, NULL, reinterpret_cast<OVERLAPPED*>(msg));
+  BOOL ok = PostQueuedCompletionStatus(completion_port_, 0, NULL,
+                                       reinterpret_cast<OVERLAPPED*>(msg));
   if (!ok) {
     FATAL("PostQueuedCompletionStatus failed");
   }
@@ -1444,11 +1378,9 @@
       millis = kMaxInt32;
     }
     ASSERT(sizeof(int32_t) == sizeof(DWORD));
-    BOOL ok = GetQueuedCompletionStatus(handler_impl->completion_port(),
-                                        &bytes,
-                                        &key,
-                                        &overlapped,
-                                        static_cast<DWORD>(millis));
+    BOOL ok =
+        GetQueuedCompletionStatus(handler_impl->completion_port(), &bytes, &key,
+                                  &overlapped, static_cast<DWORD>(millis));
 
     if (!ok && (overlapped == NULL)) {
       if (GetLastError() == ERROR_ABANDONED_WAIT_0) {
@@ -1495,8 +1427,8 @@
 
 
 void EventHandlerImplementation::Start(EventHandler* handler) {
-  int result = Thread::Start(EventHandlerEntry,
-                             reinterpret_cast<uword>(handler));
+  int result =
+      Thread::Start(EventHandlerEntry, reinterpret_cast<uword>(handler));
   if (result != 0) {
     FATAL1("Failed to start event handler thread %d", result);
   }
diff --git a/runtime/bin/eventhandler_win.h b/runtime/bin/eventhandler_win.h
index 9daff93..7795ac9 100644
--- a/runtime/bin/eventhandler_win.h
+++ b/runtime/bin/eventhandler_win.h
@@ -2,10 +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.
 
-#ifndef BIN_EVENTHANDLER_WIN_H_
-#define BIN_EVENTHANDLER_WIN_H_
+#ifndef RUNTIME_BIN_EVENTHANDLER_WIN_H_
+#define RUNTIME_BIN_EVENTHANDLER_WIN_H_
 
-#if !defined(BIN_EVENTHANDLER_H_)
+#if !defined(RUNTIME_BIN_EVENTHANDLER_H_)
 #error Do not include eventhandler_win.h directly; use eventhandler.h instead.
 #endif
 
@@ -33,7 +33,13 @@
 class OverlappedBuffer {
  public:
   enum Operation {
-    kAccept, kRead, kRecvFrom, kWrite, kSendTo, kDisconnect, kConnect
+    kAccept,
+    kRead,
+    kRecvFrom,
+    kWrite,
+    kSendTo,
+    kDisconnect,
+    kConnect
   };
 
   static OverlappedBuffer* AllocateAcceptBuffer(int buffer_size);
@@ -68,7 +74,9 @@
   SOCKET client() { return client_; }
   char* GetBufferStart() { return reinterpret_cast<char*>(&buffer_data_); }
   int GetBufferSize() { return buflen_; }
-  struct sockaddr* from() { return from_; }
+  struct sockaddr* from() {
+    return from_;
+  }
   socklen_t* from_len_addr() { return from_len_addr_; }
   socklen_t from_len() { return from_ == NULL ? 0 : *from_len_addr_; }
 
@@ -99,8 +107,8 @@
           sizeof(struct sockaddr_storage) + sizeof(socklen_t);
       ASSERT(buflen_ > kAdditionalSize);
       buflen_ -= kAdditionalSize;
-      from_len_addr_ = reinterpret_cast<socklen_t*>(
-          GetBufferStart() + GetBufferSize());
+      from_len_addr_ =
+          reinterpret_cast<socklen_t*>(GetBufferStart() + GetBufferSize());
       *from_len_addr_ = sizeof(struct sockaddr_storage);
       from_ = reinterpret_cast<struct sockaddr*>(from_len_addr_ + 1);
     } else {
@@ -118,22 +126,19 @@
     return malloc(size + buffer_size);
   }
 
-  void operator delete(void* buffer) {
-    free(buffer);
-  }
+  void operator delete(void* buffer) { free(buffer); }
 
   // Allocate an overlapped buffer for thse specified amount of data and
   // operation. Some operations need additional buffer space, which is
   // handled by this method.
-  static OverlappedBuffer* AllocateBuffer(int buffer_size,
-                                          Operation operation);
+  static OverlappedBuffer* AllocateBuffer(int buffer_size, Operation operation);
 
   OVERLAPPED overlapped_;  // OVERLAPPED structure for overlapped IO.
-  SOCKET client_;  // Used for AcceptEx client socket.
-  int buflen_;  // Length of the buffer.
-  Operation operation_;  // Type of operation issued.
+  SOCKET client_;          // Used for AcceptEx client socket.
+  int buflen_;             // Length of the buffer.
+  Operation operation_;    // Type of operation issued.
 
-  int index_;  // Index for next read from read buffer.
+  int index_;        // Index for next read from read buffer.
   int data_length_;  // Length of the actual data in the buffer.
 
   WSABUF wbuf_;  // Structure for passing buffer to WSA functions.
@@ -141,7 +146,7 @@
   // For the recvfrom operation additional storace is allocated for the
   // source sockaddr.
   socklen_t* from_len_addr_;  // Pointer to source sockaddr size storage.
-  struct sockaddr* from_;  // Pointer to source sockaddr storage.
+  struct sockaddr* from_;     // Pointer to source sockaddr storage.
 
   // Buffer for recv/send/AcceptEx. This must be at the end of the
   // object as the object is allocated larger than it's definition
@@ -200,8 +205,7 @@
   void MarkClosedWrite() { flags_ |= (1 << kCloseWrite); }
   void MarkError() { flags_ |= (1 << kError); }
 
-  virtual void EnsureInitialized(
-    EventHandlerImplementation* event_handler) = 0;
+  virtual void EnsureInitialized(EventHandlerImplementation* event_handler) = 0;
 
   HANDLE handle() { return handle_; }
 
@@ -215,9 +219,10 @@
 
   Type type() { return type_; }
   bool is_file() { return type_ == kFile; }
-  bool is_socket() { return type_ == kListenSocket ||
-                            type_ == kClientSocket ||
-                            type_ == kDatagramSocket; }
+  bool is_socket() {
+    return type_ == kListenSocket || type_ == kClientSocket ||
+           type_ == kDatagramSocket;
+  }
   bool is_listen_socket() { return type_ == kListenSocket; }
   bool is_client_socket() { return type_ == kClientSocket; }
   bool is_datagram_socket() { return type_ == kDatagramSocket; }
@@ -256,8 +261,8 @@
   HANDLE completion_port_;
   EventHandlerImplementation* event_handler_;
 
-  OverlappedBuffer* data_ready_;  // Buffer for data ready to be read.
-  OverlappedBuffer* pending_read_;  // Buffer for pending read.
+  OverlappedBuffer* data_ready_;     // Buffer for data ready to be read.
+  OverlappedBuffer* pending_read_;   // Buffer for pending read.
   OverlappedBuffer* pending_write_;  // Buffer for pending write
 
   DWORD last_error_;
@@ -352,9 +357,7 @@
   SOCKET socket() const { return socket_; }
 
  protected:
-  explicit SocketHandle(intptr_t s)
-      : Handle(s),
-        socket_(s) {}
+  explicit SocketHandle(intptr_t s) : Handle(s), socket_(s) {}
 
   virtual void HandleIssueError();
 
@@ -368,12 +371,13 @@
 // Information on listen sockets.
 class ListenSocket : public DescriptorInfoMultipleMixin<SocketHandle> {
  public:
-  explicit ListenSocket(intptr_t s) : DescriptorInfoMultipleMixin(s, true),
-                                      AcceptEx_(NULL),
-                                      pending_accept_count_(0),
-                                      accepted_head_(NULL),
-                                      accepted_tail_(NULL),
-                                      accepted_count_(0) {
+  explicit ListenSocket(intptr_t s)
+      : DescriptorInfoMultipleMixin(s, true),
+        AcceptEx_(NULL),
+        pending_accept_count_(0),
+        accepted_head_(NULL),
+        accepted_tail_(NULL),
+        accepted_count_(0) {
     type_ = kListenSocket;
   }
   virtual ~ListenSocket() {
@@ -391,8 +395,7 @@
   bool IssueAccept();
   void AcceptComplete(OverlappedBuffer* buffer, HANDLE completion_port);
 
-  virtual void EnsureInitialized(
-    EventHandlerImplementation* event_handler);
+  virtual void EnsureInitialized(EventHandlerImplementation* event_handler);
   virtual void DoClose();
   virtual bool IsClosed();
 
@@ -425,11 +428,12 @@
 // Information on connected sockets.
 class ClientSocket : public DescriptorInfoSingleMixin<SocketHandle> {
  public:
-  explicit ClientSocket(intptr_t s) : DescriptorInfoSingleMixin(s, true),
-                                      DisconnectEx_(NULL),
-                                      next_(NULL),
-                                      connected_(false),
-                                      closed_(false) {
+  explicit ClientSocket(intptr_t s)
+      : DescriptorInfoSingleMixin(s, true),
+        DisconnectEx_(NULL),
+        next_(NULL),
+        connected_(false),
+        closed_(false) {
     LoadDisconnectEx();
     type_ = kClientSocket;
   }
@@ -452,22 +456,17 @@
 
   void ConnectComplete(OverlappedBuffer* buffer);
 
-  virtual void EnsureInitialized(
-    EventHandlerImplementation* event_handler);
+  virtual void EnsureInitialized(EventHandlerImplementation* event_handler);
   virtual void DoClose();
   virtual bool IsClosed();
 
   ClientSocket* next() { return next_; }
   void set_next(ClientSocket* next) { next_ = next; }
 
-  void mark_connected() {
-    connected_ = true;
-  }
+  void mark_connected() { connected_ = true; }
   bool is_connected() const { return connected_; }
 
-  void mark_closed() {
-    closed_ = true;
-  }
+  void mark_closed() { closed_ = true; }
 
  private:
   bool LoadDisconnectEx();
@@ -522,7 +521,7 @@
   void HandleInterrupt(InterruptMessage* msg);
   void HandleTimeout();
   void HandleAccept(ListenSocket* listen_socket, OverlappedBuffer* buffer);
-  void TryDispatchingPendingAccepts(ListenSocket *listen_socket);
+  void TryDispatchingPendingAccepts(ListenSocket* listen_socket);
   void HandleRead(Handle* handle, int bytes, OverlappedBuffer* buffer);
   void HandleRecvFrom(Handle* handle, int bytes, OverlappedBuffer* buffer);
   void HandleWrite(Handle* handle, int bytes, OverlappedBuffer* buffer);
@@ -553,4 +552,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_EVENTHANDLER_WIN_H_
+#endif  // RUNTIME_BIN_EVENTHANDLER_WIN_H_
diff --git a/runtime/bin/extensions.cc b/runtime/bin/extensions.cc
index 4584d01..fd0961f 100644
--- a/runtime/bin/extensions.cc
+++ b/runtime/bin/extensions.cc
@@ -28,14 +28,14 @@
   // First try to find the library with a suffix specifying the architecture.
   {
     const char* path_components[] = {
-      dir,
-      Platform::LibraryPrefix(),
-      name,
-      "-",
-      Platform::HostArchitecture(),  // arm
-      ".",
-      Platform::LibraryExtension(),  // so
-      NULL,
+        dir,
+        Platform::LibraryPrefix(),
+        name,
+        "-",
+        Platform::HostArchitecture(),  // arm
+        ".",
+        Platform::LibraryExtension(),  // so
+        NULL,
     };
     const char* library_file = Concatenate(path_components);
     void* library_handle = LoadExtensionLibrary(library_file);
@@ -47,12 +47,12 @@
   // Fall back on a library name without the suffix.
   {
     const char* path_components[] = {
-      dir,
-      Platform::LibraryPrefix(),
-      name,
-      ".",
-      Platform::LibraryExtension(),  // so
-      NULL,
+        dir,
+        Platform::LibraryPrefix(),
+        name,
+        ".",
+        Platform::LibraryExtension(),  // so
+        NULL,
     };
     const char* library_file = Concatenate(path_components);
     return LoadExtensionLibrary(library_file);
@@ -85,8 +85,8 @@
 
   // If the path following dart-ext is just a file name, first look next to
   // the importing Dart library.
-  void* library_handle = MakePathAndResolve(extension_directory,
-                                            extension_name);
+  void* library_handle =
+      MakePathAndResolve(extension_directory, extension_name);
   if (library_handle != NULL) {
     return library_handle;
   }
@@ -110,7 +110,7 @@
     extension = strrchr(extension_name, PathSeparator()) + 1;
   }
 
-  const char* strings[] = { extension, "_Init", NULL };
+  const char* strings[] = {extension, "_Init", NULL};
   const char* init_function_name = Concatenate(strings);
   void* init_function = ResolveSymbol(library_handle, init_function_name);
   Dart_Handle result = GetError();
diff --git a/runtime/bin/extensions.h b/runtime/bin/extensions.h
index bcbcac3..3739c43 100644
--- a/runtime/bin/extensions.h
+++ b/runtime/bin/extensions.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_EXTENSIONS_H_
-#define BIN_EXTENSIONS_H_
+#ifndef RUNTIME_BIN_EXTENSIONS_H_
+#define RUNTIME_BIN_EXTENSIONS_H_
 
 #include "include/dart_api.h"
 #include "platform/globals.h"
@@ -41,4 +41,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_EXTENSIONS_H_
+#endif  // RUNTIME_BIN_EXTENSIONS_H_
diff --git a/runtime/bin/extensions_android.cc b/runtime/bin/extensions_android.cc
index c34902c..44df410 100644
--- a/runtime/bin/extensions_android.cc
+++ b/runtime/bin/extensions_android.cc
@@ -11,7 +11,8 @@
 namespace dart {
 namespace bin {
 
-const char* kPrecompiledLibraryName = "libprecompiled.so";
+const char* kPrecompiledVMIsolateSymbolName = "_kVmIsolateSnapshot";
+const char* kPrecompiledIsolateSymbolName = "_kIsolateSnapshot";
 const char* kPrecompiledInstructionsSymbolName = "_kInstructionsSnapshot";
 const char* kPrecompiledDataSymbolName = "_kDataSnapshot";
 
diff --git a/runtime/bin/extensions_fuchsia.cc b/runtime/bin/extensions_fuchsia.cc
index d474672..691cac3 100644
--- a/runtime/bin/extensions_fuchsia.cc
+++ b/runtime/bin/extensions_fuchsia.cc
@@ -11,7 +11,8 @@
 namespace dart {
 namespace bin {
 
-const char* kPrecompiledLibraryName = "libprecompiled.so";
+const char* kPrecompiledVMIsolateSymbolName = "_kVmIsolateSnapshot";
+const char* kPrecompiledIsolateSymbolName = "_kIsolateSnapshot";
 const char* kPrecompiledInstructionsSymbolName = "_kInstructionsSnapshot";
 const char* kPrecompiledDataSymbolName = "_kDataSnapshot";
 
diff --git a/runtime/bin/extensions_linux.cc b/runtime/bin/extensions_linux.cc
index 8a25cba..264c4ee 100644
--- a/runtime/bin/extensions_linux.cc
+++ b/runtime/bin/extensions_linux.cc
@@ -11,7 +11,8 @@
 namespace dart {
 namespace bin {
 
-const char* kPrecompiledLibraryName = "libprecompiled.so";
+const char* kPrecompiledVMIsolateSymbolName = "_kVmIsolateSnapshot";
+const char* kPrecompiledIsolateSymbolName = "_kIsolateSnapshot";
 const char* kPrecompiledInstructionsSymbolName = "_kInstructionsSnapshot";
 const char* kPrecompiledDataSymbolName = "_kDataSnapshot";
 
diff --git a/runtime/bin/extensions_macos.cc b/runtime/bin/extensions_macos.cc
index 9910f10..69d712d 100644
--- a/runtime/bin/extensions_macos.cc
+++ b/runtime/bin/extensions_macos.cc
@@ -11,7 +11,8 @@
 namespace dart {
 namespace bin {
 
-const char* kPrecompiledLibraryName = "libprecompiled.dylib";
+const char* kPrecompiledVMIsolateSymbolName = "kVmIsolateSnapshot";
+const char* kPrecompiledIsolateSymbolName = "kIsolateSnapshot";
 const char* kPrecompiledInstructionsSymbolName = "kInstructionsSnapshot";
 const char* kPrecompiledDataSymbolName = "kDataSnapshot";
 
diff --git a/runtime/bin/extensions_win.cc b/runtime/bin/extensions_win.cc
index 493acad..17bb58f 100644
--- a/runtime/bin/extensions_win.cc
+++ b/runtime/bin/extensions_win.cc
@@ -12,13 +12,23 @@
 namespace dart {
 namespace bin {
 
-const char* kPrecompiledLibraryName = "precompiled.dll";
+const char* kPrecompiledVMIsolateSymbolName = "_kVmIsolateSnapshot";
+const char* kPrecompiledIsolateSymbolName = "_kIsolateSnapshot";
 const char* kPrecompiledInstructionsSymbolName = "_kInstructionsSnapshot";
 const char* kPrecompiledDataSymbolName = "_kDataSnapshot";
 
 void* Extensions::LoadExtensionLibrary(const char* library_file) {
   SetLastError(0);
-  return LoadLibraryW(StringUtilsWin::Utf8ToWide(library_file));
+
+  // Convert to wchar_t string.
+  int name_len = MultiByteToWideChar(CP_UTF8, 0, library_file, -1, NULL, 0);
+  wchar_t* name;
+  name = new wchar_t[name_len];
+  MultiByteToWideChar(CP_UTF8, 0, library_file, -1, name, name_len);
+
+  void* ext = LoadLibraryW(name);
+  delete[] name;
+  return ext;
 }
 
 void* Extensions::ResolveSymbol(void* lib_handle, const char* symbol) {
diff --git a/runtime/bin/fdutils.h b/runtime/bin/fdutils.h
index 93bebfb..81c4541 100644
--- a/runtime/bin/fdutils.h
+++ b/runtime/bin/fdutils.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_FDUTILS_H_
-#define BIN_FDUTILS_H_
+#ifndef RUNTIME_BIN_FDUTILS_H_
+#define RUNTIME_BIN_FDUTILS_H_
 
 #include "bin/builtin.h"
 #include "platform/globals.h"
@@ -39,6 +39,9 @@
   // descriptor must be in blocking mode.
   static ssize_t WriteToBlocking(int fd, const void* buffer, size_t count);
 
+  // Closes fd without modifying errno.
+  static void SaveErrorAndClose(intptr_t fd);
+
  private:
   DISALLOW_ALLOCATION();
   DISALLOW_IMPLICIT_CONSTRUCTORS(FDUtils);
@@ -47,4 +50,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_FDUTILS_H_
+#endif  // RUNTIME_BIN_FDUTILS_H_
diff --git a/runtime/bin/fdutils_android.cc b/runtime/bin/fdutils_android.cc
index 3c22a04..ad5b91e 100644
--- a/runtime/bin/fdutils_android.cc
+++ b/runtime/bin/fdutils_android.cc
@@ -7,10 +7,10 @@
 
 #include "bin/fdutils.h"
 
-#include <errno.h>  // NOLINT
-#include <fcntl.h>  // NOLINT
+#include <errno.h>      // NOLINT
+#include <fcntl.h>      // NOLINT
 #include <sys/ioctl.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <unistd.h>     // NOLINT
 
 #include "platform/signal_blocker.h"
 
@@ -21,10 +21,12 @@
   intptr_t status;
   status = NO_RETRY_EXPECTED(fcntl(fd, F_GETFD));
   if (status < 0) {
+    perror("fcntl(F_GETFD) failed");
     return false;
   }
   status |= FD_CLOEXEC;
   if (NO_RETRY_EXPECTED(fcntl(fd, F_SETFD, status)) < 0) {
+    perror("fcntl(F_SETFD, FD_CLOEXEC) failed");
     return false;
   }
   return true;
@@ -35,10 +37,12 @@
   intptr_t status;
   status = NO_RETRY_EXPECTED(fcntl(fd, F_GETFL));
   if (status < 0) {
+    perror("fcntl(F_GETFL) failed");
     return false;
   }
   status = blocking ? (status & ~O_NONBLOCK) : (status | O_NONBLOCK);
   if (NO_RETRY_EXPECTED(fcntl(fd, F_SETFL, status)) < 0) {
+    perror("fcntl(F_SETFL, O_NONBLOCK) failed");
     return false;
   }
   return true;
@@ -133,6 +137,13 @@
   return count;
 }
 
+
+void FDUtils::SaveErrorAndClose(intptr_t fd) {
+  int err = errno;
+  VOID_TEMP_FAILURE_RETRY(close(fd));
+  errno = err;
+}
+
 }  // namespace bin
 }  // namespace dart
 
diff --git a/runtime/bin/fdutils_fuchsia.cc b/runtime/bin/fdutils_fuchsia.cc
new file mode 100644
index 0000000..4aa4b29
--- /dev/null
+++ b/runtime/bin/fdutils_fuchsia.cc
@@ -0,0 +1,149 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#include "platform/globals.h"
+#if defined(TARGET_OS_FUCHSIA)
+
+#include "bin/fdutils.h"
+
+#include <errno.h>      // NOLINT
+#include <fcntl.h>      // NOLINT
+#include <sys/ioctl.h>  // NOLINT
+#include <unistd.h>     // NOLINT
+
+#include "platform/signal_blocker.h"
+
+namespace dart {
+namespace bin {
+
+bool FDUtils::SetCloseOnExec(intptr_t fd) {
+  intptr_t status;
+  status = NO_RETRY_EXPECTED(fcntl(fd, F_GETFD));
+  if (status < 0) {
+    perror("fcntl(F_GETFD) failed");
+    return false;
+  }
+  status |= FD_CLOEXEC;
+  if (NO_RETRY_EXPECTED(fcntl(fd, F_SETFD, status)) < 0) {
+    perror("fcntl(F_SETFD, FD_CLOEXEC) failed");
+    return false;
+  }
+  return true;
+}
+
+
+static bool SetBlockingHelper(intptr_t fd, bool blocking) {
+  intptr_t status;
+  status = NO_RETRY_EXPECTED(fcntl(fd, F_GETFL));
+  if (status < 0) {
+    perror("fcntl(F_GETFL) failed");
+    return false;
+  }
+  status = blocking ? (status & ~O_NONBLOCK) : (status | O_NONBLOCK);
+  if (NO_RETRY_EXPECTED(fcntl(fd, F_SETFL, status)) < 0) {
+    perror("fcntl(F_SETFL, O_NONBLOCK) failed");
+    return false;
+  }
+  return true;
+}
+
+
+bool FDUtils::SetNonBlocking(intptr_t fd) {
+  return SetBlockingHelper(fd, false);
+}
+
+
+bool FDUtils::SetBlocking(intptr_t fd) {
+  return SetBlockingHelper(fd, true);
+}
+
+
+bool FDUtils::IsBlocking(intptr_t fd, bool* is_blocking) {
+  intptr_t status;
+  status = NO_RETRY_EXPECTED(fcntl(fd, F_GETFL));
+  if (status < 0) {
+    return false;
+  }
+  *is_blocking = (status & O_NONBLOCK) == 0;
+  return true;
+}
+
+
+intptr_t FDUtils::AvailableBytes(intptr_t fd) {
+  int available;  // ioctl for FIONREAD expects an 'int*' argument.
+  int result = NO_RETRY_EXPECTED(ioctl(fd, FIONREAD, &available));
+  if (result < 0) {
+    return result;
+  }
+  ASSERT(available >= 0);
+  return static_cast<intptr_t>(available);
+}
+
+
+ssize_t FDUtils::ReadFromBlocking(int fd, void* buffer, size_t count) {
+#ifdef DEBUG
+  bool is_blocking = false;
+  ASSERT(FDUtils::IsBlocking(fd, &is_blocking));
+  ASSERT(is_blocking);
+#endif
+  size_t remaining = count;
+  char* buffer_pos = reinterpret_cast<char*>(buffer);
+  while (remaining > 0) {
+    ssize_t bytes_read = NO_RETRY_EXPECTED(read(fd, buffer_pos, remaining));
+    if (bytes_read == 0) {
+      return count - remaining;
+    } else if (bytes_read == -1) {
+      ASSERT(EAGAIN == EWOULDBLOCK);
+      // Error code EWOULDBLOCK should only happen for non blocking
+      // file descriptors.
+      ASSERT(errno != EWOULDBLOCK);
+      return -1;
+    } else {
+      ASSERT(bytes_read > 0);
+      remaining -= bytes_read;
+      buffer_pos += bytes_read;
+    }
+  }
+  return count;
+}
+
+
+ssize_t FDUtils::WriteToBlocking(int fd, const void* buffer, size_t count) {
+#ifdef DEBUG
+  bool is_blocking = false;
+  ASSERT(FDUtils::IsBlocking(fd, &is_blocking));
+  ASSERT(is_blocking);
+#endif
+  size_t remaining = count;
+  char* buffer_pos = const_cast<char*>(reinterpret_cast<const char*>(buffer));
+  while (remaining > 0) {
+    ssize_t bytes_written = NO_RETRY_EXPECTED(write(fd, buffer_pos, remaining));
+    if (bytes_written == 0) {
+      return count - remaining;
+    } else if (bytes_written == -1) {
+      ASSERT(EAGAIN == EWOULDBLOCK);
+      // Error code EWOULDBLOCK should only happen for non blocking
+      // file descriptors.
+      ASSERT(errno != EWOULDBLOCK);
+      return -1;
+    } else {
+      ASSERT(bytes_written > 0);
+      remaining -= bytes_written;
+      buffer_pos += bytes_written;
+    }
+  }
+  return count;
+}
+
+
+void FDUtils::SaveErrorAndClose(intptr_t fd) {
+  int err = errno;
+  NO_RETRY_EXPECTED(close(fd));
+  errno = err;
+}
+
+}  // namespace bin
+}  // namespace dart
+
+#endif  // defined(TARGET_OS_FUCHSIA)
diff --git a/runtime/bin/fdutils_linux.cc b/runtime/bin/fdutils_linux.cc
index f80356e..7f4598b 100644
--- a/runtime/bin/fdutils_linux.cc
+++ b/runtime/bin/fdutils_linux.cc
@@ -7,10 +7,10 @@
 
 #include "bin/fdutils.h"
 
-#include <errno.h>  // NOLINT
-#include <fcntl.h>  // NOLINT
+#include <errno.h>      // NOLINT
+#include <fcntl.h>      // NOLINT
 #include <sys/ioctl.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <unistd.h>     // NOLINT
 
 #include "platform/signal_blocker.h"
 
@@ -21,10 +21,12 @@
   intptr_t status;
   status = NO_RETRY_EXPECTED(fcntl(fd, F_GETFD));
   if (status < 0) {
+    perror("fcntl(F_GETFD) failed");
     return false;
   }
   status |= FD_CLOEXEC;
   if (NO_RETRY_EXPECTED(fcntl(fd, F_SETFD, status)) < 0) {
+    perror("fcntl(F_SETFD, FD_CLOEXEC) failed");
     return false;
   }
   return true;
@@ -35,10 +37,12 @@
   intptr_t status;
   status = NO_RETRY_EXPECTED(fcntl(fd, F_GETFL));
   if (status < 0) {
+    perror("fcntl(F_GETFL) failed");
     return false;
   }
   status = blocking ? (status & ~O_NONBLOCK) : (status | O_NONBLOCK);
   if (NO_RETRY_EXPECTED(fcntl(fd, F_SETFL, status)) < 0) {
+    perror("fcntl(F_SETFL, O_NONBLOCK) failed");
     return false;
   }
   return true;
@@ -133,6 +137,13 @@
   return count;
 }
 
+
+void FDUtils::SaveErrorAndClose(intptr_t fd) {
+  int err = errno;
+  VOID_TEMP_FAILURE_RETRY(close(fd));
+  errno = err;
+}
+
 }  // namespace bin
 }  // namespace dart
 
diff --git a/runtime/bin/fdutils_macos.cc b/runtime/bin/fdutils_macos.cc
index 41f1d24..4a0e3c0 100644
--- a/runtime/bin/fdutils_macos.cc
+++ b/runtime/bin/fdutils_macos.cc
@@ -7,10 +7,10 @@
 
 #include "bin/fdutils.h"
 
-#include <errno.h>  // NOLINT
-#include <fcntl.h>  // NOLINT
+#include <errno.h>      // NOLINT
+#include <fcntl.h>      // NOLINT
 #include <sys/ioctl.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <unistd.h>     // NOLINT
 
 #include "platform/signal_blocker.h"
 
@@ -21,10 +21,12 @@
   intptr_t status;
   status = NO_RETRY_EXPECTED(fcntl(fd, F_GETFD));
   if (status < 0) {
+    perror("fcntl(F_GETFD) failed");
     return false;
   }
   status |= FD_CLOEXEC;
   if (NO_RETRY_EXPECTED(fcntl(fd, F_SETFD, status)) < 0) {
+    perror("fcntl(F_SETFD, FD_CLOEXEC) failed");
     return false;
   }
   return true;
@@ -35,10 +37,12 @@
   intptr_t status;
   status = NO_RETRY_EXPECTED(fcntl(fd, F_GETFL));
   if (status < 0) {
+    perror("fcntl(F_GETFL) failed");
     return false;
   }
   status = blocking ? (status & ~O_NONBLOCK) : (status | O_NONBLOCK);
   if (NO_RETRY_EXPECTED(fcntl(fd, F_SETFL, status)) < 0) {
+    perror("fcntl(F_SETFL, O_NONBLOCK) failed");
     return false;
   }
   return true;
@@ -133,6 +137,13 @@
   return count;
 }
 
+
+void FDUtils::SaveErrorAndClose(intptr_t fd) {
+  int err = errno;
+  VOID_TEMP_FAILURE_RETRY(close(fd));
+  errno = err;
+}
+
 }  // namespace bin
 }  // namespace dart
 
diff --git a/runtime/bin/file.cc b/runtime/bin/file.cc
index a3dcd7f..ee3255a 100644
--- a/runtime/bin/file.cc
+++ b/runtime/bin/file.cc
@@ -28,19 +28,15 @@
   File* file;
   Dart_Handle dart_this = ThrowIfError(Dart_GetNativeArgument(args, 0));
   ASSERT(Dart_IsInstance(dart_this));
-  ThrowIfError(Dart_GetNativeInstanceField(
-      dart_this,
-      kFileNativeFieldIndex,
-      reinterpret_cast<intptr_t*>(&file)));
+  ThrowIfError(Dart_GetNativeInstanceField(dart_this, kFileNativeFieldIndex,
+                                           reinterpret_cast<intptr_t*>(&file)));
   return file;
 }
 
 
 static void SetFile(Dart_Handle dart_this, intptr_t file_pointer) {
   Dart_Handle result = Dart_SetNativeInstanceField(
-      dart_this,
-      kFileNativeFieldIndex,
-      file_pointer);
+      dart_this, kFileNativeFieldIndex, file_pointer);
   if (Dart_IsError(result)) {
     Log::PrintErr("SetNativeInstanceField in SetFile() failed\n");
     Dart_PropagateError(result);
@@ -92,7 +88,7 @@
   // reading. This is to prevent the opening of directories as
   // files. Directories can be opened for reading using the posix
   // 'open' call.
-  File* file = File::ScopedOpen(filename, file_mode);
+  File* file = File::Open(filename, file_mode);
   if (file != NULL) {
     Dart_SetReturnValue(args,
                         Dart_NewInteger(reinterpret_cast<intptr_t>(file)));
@@ -183,10 +179,8 @@
           Dart_PropagateError(io_lib);
         }
         Dart_Handle array_view =
-            Dart_Invoke(io_lib,
-                        DartUtils::NewString("_makeUint8ListView"),
-                        kNumArgs,
-                        dart_args);
+            Dart_Invoke(io_lib, DartUtils::NewString("_makeUint8ListView"),
+                        kNumArgs, dart_args);
         Dart_SetReturnValue(args, array_view);
       } else {
         Dart_SetReturnValue(args, external_array);
@@ -208,10 +202,8 @@
   // integers and have the property that end <=
   // list.length. Therefore, it is safe to extract their value as
   // intptr_t.
-  intptr_t start =
-      DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 2));
-  intptr_t end =
-      DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 3));
+  intptr_t start = DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 2));
+  intptr_t end = DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 3));
   intptr_t length = end - start;
   intptr_t array_len = 0;
   Dart_Handle result = Dart_ListLength(buffer_obj, &array_len);
@@ -244,10 +236,8 @@
   // integers and have the property that (offset + length) <=
   // list.length. Therefore, it is safe to extract their value as
   // intptr_t.
-  intptr_t start =
-      DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 2));
-  intptr_t end =
-      DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 3));
+  intptr_t start = DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 2));
+  intptr_t end = DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 3));
 
   // The buffer object passed in has to be an Int8List or Uint8List object.
   // Acquire a direct pointer to the data area of the buffer object.
@@ -341,8 +331,7 @@
 
 
 void FUNCTION_NAME(File_LengthFromPath)(Dart_NativeArguments args) {
-  const char* path =
-      DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
+  const char* path = DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
   int64_t return_value = File::LengthFromPath(path);
   if (return_value >= 0) {
     Dart_SetReturnValue(args, Dart_NewInteger(return_value));
@@ -353,8 +342,7 @@
 
 
 void FUNCTION_NAME(File_LastModified)(Dart_NativeArguments args) {
-  const char* name =
-      DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
+  const char* name = DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
   int64_t return_value = File::LastModified(name);
   if (return_value >= 0) {
     Dart_SetReturnValue(args, Dart_NewInteger(return_value * kMSPerSecond));
@@ -384,8 +372,8 @@
   if (DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 1), &lock) &&
       DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 2), &start) &&
       DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 3), &end)) {
-    if ((lock >= File::kLockMin) && (lock <= File::kLockMax) &&
-        (start >= 0) && (end == -1 || end > start)) {
+    if ((lock >= File::kLockMin) && (lock <= File::kLockMax) && (start >= 0) &&
+        (end == -1 || end > start)) {
       if (file->Lock(static_cast<File::LockType>(lock), start, end)) {
         Dart_SetReturnValue(args, Dart_True());
       } else {
@@ -400,8 +388,7 @@
 
 
 void FUNCTION_NAME(File_Create)(Dart_NativeArguments args) {
-  const char* str =
-      DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
+  const char* str = DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
   bool result = File::Create(str);
   if (result) {
     Dart_SetReturnValue(args, Dart_NewBoolean(result));
@@ -421,9 +408,9 @@
     if (!File::CreateLink(name, target)) {
       Dart_SetReturnValue(args, DartUtils::NewDartOSError());
     }
-  } else  {
-    Dart_Handle err = DartUtils::NewDartArgumentError(
-        "Non-string argument to Link.create");
+  } else {
+    Dart_Handle err =
+        DartUtils::NewDartArgumentError("Non-string argument to Link.create");
     Dart_SetReturnValue(args, err);
   }
 }
@@ -440,16 +427,15 @@
       Dart_SetReturnValue(args, DartUtils::NewString(target));
     }
   } else {
-    Dart_Handle err = DartUtils::NewDartArgumentError(
-        "Non-string argument to Link.target");
+    Dart_Handle err =
+        DartUtils::NewDartArgumentError("Non-string argument to Link.target");
     Dart_SetReturnValue(args, err);
   }
 }
 
 
 void FUNCTION_NAME(File_Delete)(Dart_NativeArguments args) {
-  const char* str =
-      DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
+  const char* str = DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
   bool result = File::Delete(str);
   if (result) {
     Dart_SetReturnValue(args, Dart_NewBoolean(result));
@@ -460,8 +446,7 @@
 
 
 void FUNCTION_NAME(File_DeleteLink)(Dart_NativeArguments args) {
-  const char* str =
-      DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
+  const char* str = DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
   bool result = File::DeleteLink(str);
   if (result) {
     Dart_SetReturnValue(args, Dart_NewBoolean(result));
@@ -514,8 +499,7 @@
 
 
 void FUNCTION_NAME(File_ResolveSymbolicLinks)(Dart_NativeArguments args) {
-  const char* str =
-      DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
+  const char* str = DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
   const char* path = File::GetCanonicalPath(str);
   if (path != NULL) {
     Dart_SetReturnValue(args, DartUtils::NewString(path));
@@ -527,8 +511,7 @@
 
 void FUNCTION_NAME(File_OpenStdio)(Dart_NativeArguments args) {
   int64_t fd = DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 0));
-  ASSERT((fd == STDIN_FILENO) ||
-         (fd == STDOUT_FILENO) ||
+  ASSERT((fd == STDIN_FILENO) || (fd == STDOUT_FILENO) ||
          (fd == STDERR_FILENO));
   File* file = File::OpenStdio(static_cast<int>(fd));
   Dart_SetReturnValue(args, Dart_NewInteger(reinterpret_cast<intptr_t>(file)));
@@ -537,8 +520,7 @@
 
 void FUNCTION_NAME(File_GetStdioHandleType)(Dart_NativeArguments args) {
   int64_t fd = DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 0));
-  ASSERT((fd == STDIN_FILENO) ||
-         (fd == STDOUT_FILENO) ||
+  ASSERT((fd == STDIN_FILENO) || (fd == STDOUT_FILENO) ||
          (fd == STDERR_FILENO));
   File::StdioHandleType type = File::GetStdioHandleType(static_cast<int>(fd));
   Dart_SetReturnValue(args, Dart_NewInteger(type));
@@ -554,7 +536,7 @@
         DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 1));
     File::Type type = File::GetType(str, follow_links);
     Dart_SetReturnValue(args, Dart_NewInteger(static_cast<int>(type)));
-  } else  {
+  } else {
     Dart_Handle err = DartUtils::NewDartArgumentError(
         "Non-string argument to FileSystemEntity.type");
     Dart_SetReturnValue(args, err);
@@ -572,18 +554,17 @@
     if (stat_data[File::kType] == File::kDoesNotExist) {
       Dart_SetReturnValue(args, DartUtils::NewDartOSError());
     } else {
-      Dart_Handle returned_data = Dart_NewTypedData(Dart_TypedData_kInt64,
-                                                    File::kStatSize);
+      Dart_Handle returned_data =
+          Dart_NewTypedData(Dart_TypedData_kInt64, File::kStatSize);
       if (Dart_IsError(returned_data)) {
         Dart_PropagateError(returned_data);
       }
       Dart_TypedData_Type data_type_unused;
       void* data_location;
       intptr_t data_length_unused;
-      Dart_Handle status = Dart_TypedDataAcquireData(returned_data,
-                                                     &data_type_unused,
-                                                     &data_location,
-                                                     &data_length_unused);
+      Dart_Handle status =
+          Dart_TypedDataAcquireData(returned_data, &data_type_unused,
+                                    &data_location, &data_length_unused);
       if (Dart_IsError(status)) {
         Dart_PropagateError(status);
       }
@@ -615,7 +596,7 @@
     } else {
       Dart_SetReturnValue(args, Dart_NewBoolean(result == File::kIdentical));
     }
-  } else  {
+  } else {
     Dart_Handle err = DartUtils::NewDartArgumentError(
         "Non-string argument to FileSystemEntity.identical");
     Dart_SetReturnValue(args, err);
@@ -669,15 +650,14 @@
 
 CObject* File::OpenRequest(const CObjectArray& request) {
   File* file = NULL;
-  if ((request.Length() == 2) &&
-      request[0]->IsString() &&
+  if ((request.Length() == 2) && request[0]->IsString() &&
       request[1]->IsInt32()) {
     CObjectString filename(request[0]);
     CObjectInt32 mode(request[1]);
     File::DartFileOpenMode dart_file_mode =
         static_cast<File::DartFileOpenMode>(mode.Value());
     File::FileOpenMode file_mode = File::DartModeToFileMode(dart_file_mode);
-    file = File::ScopedOpen(filename.CString(), file_mode);
+    file = File::Open(filename.CString(), file_mode);
     if (file != NULL) {
       return new CObjectIntptr(
           CObject::NewIntptr(reinterpret_cast<intptr_t>(file)));
@@ -704,8 +684,7 @@
 
 
 CObject* File::RenameRequest(const CObjectArray& request) {
-  if ((request.Length() == 2) &&
-      request[0]->IsString() &&
+  if ((request.Length() == 2) && request[0]->IsString() &&
       request[1]->IsString()) {
     CObjectString old_path(request[0]);
     CObjectString new_path(request[1]);
@@ -720,8 +699,7 @@
 
 
 CObject* File::CopyRequest(const CObjectArray& request) {
-  if ((request.Length() == 2) &&
-      request[0]->IsString() &&
+  if ((request.Length() == 2) && request[0]->IsString() &&
       request[1]->IsString()) {
     CObjectString old_path(request[0]);
     CObjectString new_path(request[1]);
@@ -1046,8 +1024,7 @@
     RefCntReleaseScope<File> rs(file);
     if ((request.Length() == 4) &&
         (request[1]->IsTypedData() || request[1]->IsArray()) &&
-        request[2]->IsInt32OrInt64() &&
-        request[3]->IsInt32OrInt64()) {
+        request[2]->IsInt32OrInt64() && request[3]->IsInt32OrInt64()) {
       if (!file->IsClosed()) {
         int64_t start = CObjectInt32OrInt64ToInt64(request[2]);
         int64_t end = CObjectInt32OrInt64ToInt64(request[3]);
@@ -1091,8 +1068,7 @@
 
 
 CObject* File::CreateLinkRequest(const CObjectArray& request) {
-  if ((request.Length() != 2) ||
-      !request[0]->IsString() ||
+  if ((request.Length() != 2) || !request[0]->IsString() ||
       !request[1]->IsString()) {
     return CObject::IllegalArgumentError();
   }
@@ -1121,8 +1097,7 @@
 
 
 CObject* File::RenameLinkRequest(const CObjectArray& request) {
-  if ((request.Length() == 2) &&
-      request[0]->IsString() &&
+  if ((request.Length() == 2) && request[0]->IsString() &&
       request[1]->IsString()) {
     CObjectString old_path(request[0]);
     CObjectString new_path(request[1]);
@@ -1152,8 +1127,7 @@
 
 
 CObject* File::TypeRequest(const CObjectArray& request) {
-  if ((request.Length() == 2) &&
-      request[0]->IsString() &&
+  if ((request.Length() == 2) && request[0]->IsString() &&
       request[1]->IsBool()) {
     CObjectString path(request[0]);
     CObjectBool follow_links(request[1]);
@@ -1165,13 +1139,12 @@
 
 
 CObject* File::IdenticalRequest(const CObjectArray& request) {
-  if ((request.Length() == 2) &&
-      request[0]->IsString() &&
+  if ((request.Length() == 2) && request[0]->IsString() &&
       request[1]->IsString()) {
     CObjectString path1(request[0]);
     CObjectString path2(request[1]);
-    File::Identical result = File::AreIdentical(path1.CString(),
-                                                path2.CString());
+    File::Identical result =
+        File::AreIdentical(path1.CString(), path2.CString());
     if (result == File::kError) {
       return CObject::NewOSError();
     } else if (result == File::kIdentical) {
@@ -1192,8 +1165,7 @@
     if (data[File::kType] == File::kDoesNotExist) {
       return CObject::NewOSError();
     }
-    CObjectArray* result =
-        new CObjectArray(CObject::NewArray(File::kStatSize));
+    CObjectArray* result = new CObjectArray(CObject::NewArray(File::kStatSize));
     for (int i = 0; i < File::kStatSize; ++i) {
       result->SetAt(i, new CObjectInt64(CObject::NewInt64(data[i])));
     }
@@ -1210,10 +1182,8 @@
   if ((request.Length() >= 1) && request[0]->IsIntptr()) {
     File* file = CObjectToFilePointer(request[0]);
     RefCntReleaseScope<File> rs(file);
-    if ((request.Length() == 4) &&
-        request[1]->IsInt32OrInt64() &&
-        request[2]->IsInt32OrInt64() &&
-        request[3]->IsInt32OrInt64()) {
+    if ((request.Length() == 4) && request[1]->IsInt32OrInt64() &&
+        request[2]->IsInt32OrInt64() && request[3]->IsInt32OrInt64()) {
       if (!file->IsClosed()) {
         int64_t lock = CObjectInt32OrInt64ToInt64(request[1]);
         int64_t start = CObjectInt32OrInt64ToInt64(request[2]);
diff --git a/runtime/bin/file.h b/runtime/bin/file.h
index 6b22793..300e561 100644
--- a/runtime/bin/file.h
+++ b/runtime/bin/file.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_FILE_H_
-#define BIN_FILE_H_
+#ifndef RUNTIME_BIN_FILE_H_
+#define RUNTIME_BIN_FILE_H_
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -43,18 +43,9 @@
     kDartWriteOnlyAppend = 4
   };
 
-  enum Type {
-    kIsFile = 0,
-    kIsDirectory = 1,
-    kIsLink = 2,
-    kDoesNotExist = 3
-  };
+  enum Type { kIsFile = 0, kIsDirectory = 1, kIsLink = 2, kDoesNotExist = 3 };
 
-  enum Identical {
-    kIdentical = 0,
-    kDifferent = 1,
-    kError = 2
-  };
+  enum Identical { kIdentical = 0, kDifferent = 1, kError = 2 };
 
   enum StdioHandleType {
     kTerminal = 0,
@@ -88,7 +79,11 @@
 
   intptr_t GetFD();
 
-  void* MapExecutable(intptr_t* num_bytes);
+  enum MapType {
+    kReadOnly = 0,
+    kReadExecute = 1,
+  };
+  void* Map(MapType type, int64_t position, int64_t length);
 
   // Read/Write attempt to transfer num_bytes to/from buffer. It returns
   // the number of bytes read/written.
@@ -101,9 +96,7 @@
   // occurred the result will be set to false.
   bool ReadFully(void* buffer, int64_t num_bytes);
   bool WriteFully(const void* buffer, int64_t num_bytes);
-  bool WriteByte(uint8_t byte) {
-    return WriteFully(&byte, 1);
-  }
+  bool WriteByte(uint8_t byte) { return WriteFully(&byte, 1); }
 
   // Get the length of the file. Returns a negative value if the length cannot
   // be determined (e.g. not seekable device).
@@ -153,9 +146,6 @@
   // reading and writing. If mode contains kWrite and the file does
   // not exist the file is created. The file is truncated to length 0 if
   // mode contains kTruncate. Assumes we are in an API scope.
-  static File* ScopedOpen(const char* path, FileOpenMode mode);
-
-  // Like ScopedOpen(), but no API scope is needed.
   static File* Open(const char* path, FileOpenMode mode);
 
   // Create a file object for the specified stdio file descriptor
@@ -173,15 +163,17 @@
   static int64_t LengthFromPath(const char* path);
   static void Stat(const char* path, int64_t* data);
   static time_t LastModified(const char* path);
-  static const char* LinkTarget(const char* pathname);
   static bool IsAbsolutePath(const char* path);
-  static const char* GetCanonicalPath(const char* path);
   static const char* PathSeparator();
   static const char* StringEscapedPathSeparator();
   static Type GetType(const char* path, bool follow_links);
   static Identical AreIdentical(const char* file_1, const char* file_2);
   static StdioHandleType GetStdioHandleType(int fd);
 
+  // LinkTarget and GetCanonicalPath may call Dart_ScopeAllocate.
+  static const char* LinkTarget(const char* pathname);
+  static const char* GetCanonicalPath(const char* path);
+
   static FileOpenMode DartModeToFileMode(DartFileOpenMode mode);
 
   static CObject* ExistsRequest(const CObjectArray& request);
@@ -214,10 +206,8 @@
   static CObject* LockRequest(const CObjectArray& request);
 
  private:
-  explicit File(FileHandle* handle) :
-      ReferenceCounted(),
-      handle_(handle),
-      weak_handle_(NULL) {}
+  explicit File(FileHandle* handle)
+      : ReferenceCounted(), handle_(handle), weak_handle_(NULL) {}
 
   ~File();
 
@@ -240,4 +230,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_FILE_H_
+#endif  // RUNTIME_BIN_FILE_H_
diff --git a/runtime/bin/file_android.cc b/runtime/bin/file_android.cc
index 9bcf44c..afe0966 100644
--- a/runtime/bin/file_android.cc
+++ b/runtime/bin/file_android.cc
@@ -7,14 +7,14 @@
 
 #include "bin/file.h"
 
-#include <errno.h>  // NOLINT
-#include <fcntl.h>  // NOLINT
-#include <libgen.h>  // NOLINT
-#include <sys/mman.h>  // NOLINT
+#include <errno.h>         // NOLINT
+#include <fcntl.h>         // NOLINT
+#include <libgen.h>        // NOLINT
+#include <sys/mman.h>      // NOLINT
 #include <sys/sendfile.h>  // NOLINT
-#include <sys/stat.h>  // NOLINT
-#include <sys/types.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <sys/stat.h>      // NOLINT
+#include <sys/types.h>     // NOLINT
+#include <unistd.h>        // NOLINT
 
 #include "bin/builtin.h"
 #include "bin/log.h"
@@ -27,8 +27,8 @@
 
 class FileHandle {
  public:
-  explicit FileHandle(int fd) : fd_(fd) { }
-  ~FileHandle() { }
+  explicit FileHandle(int fd) : fd_(fd) {}
+  ~FileHandle() {}
   int fd() const { return fd_; }
   void set_fd(int fd) { fd_ = fd; }
 
@@ -78,17 +78,22 @@
 }
 
 
-void* File::MapExecutable(intptr_t* len) {
+void* File::Map(MapType type, int64_t position, int64_t length) {
   ASSERT(handle_->fd() >= 0);
-
-  intptr_t length = Length();
-  void* addr = mmap(0, length,
-                    PROT_READ | PROT_EXEC, MAP_PRIVATE,
-                    handle_->fd(), 0);
+  int prot = PROT_NONE;
+  switch (type) {
+    case kReadOnly:
+      prot = PROT_READ;
+      break;
+    case kReadExecute:
+      prot = PROT_READ | PROT_EXEC;
+      break;
+    default:
+      return NULL;
+  }
+  void* addr = mmap(NULL, length, prot, MAP_PRIVATE, handle_->fd(), position);
   if (addr == MAP_FAILED) {
-    *len = -1;
-  } else {
-    *len = length;
+    return NULL;
   }
   return addr;
 }
@@ -177,7 +182,7 @@
 }
 
 
-File* File::ScopedOpen(const char* name, FileOpenMode mode) {
+File* File::Open(const char* name, FileOpenMode mode) {
   // Report errors for non-regular files.
   struct stat st;
   if (NO_RETRY_EXPECTED(stat(name, &st)) == 0) {
@@ -214,12 +219,6 @@
 }
 
 
-File* File::Open(const char* path, FileOpenMode mode) {
-  // ScopedOpen doesn't actually need a scope.
-  return ScopedOpen(path, mode);
-}
-
-
 File* File::OpenStdio(int fd) {
   return ((fd < 0) || (2 < fd)) ? NULL : new File(new FileHandle(fd));
 }
@@ -320,8 +319,7 @@
     int result = 1;
     while (result > 0) {
       // Loop to ensure we copy everything, and not only up to 2GB.
-      result = NO_RETRY_EXPECTED(
-          sendfile(new_fd, old_fd, &offset, kMaxUint32));
+      result = NO_RETRY_EXPECTED(sendfile(new_fd, old_fd, &offset, kMaxUint32));
     }
     // From sendfile man pages:
     //   Applications may wish to fall back to read(2)/write(2) in the case
@@ -329,8 +327,8 @@
     if ((result < 0) && ((errno == EINVAL) || (errno == ENOSYS))) {
       const intptr_t kBufferSize = 8 * KB;
       uint8_t buffer[kBufferSize];
-      while ((result = TEMP_FAILURE_RETRY(
-          read(old_fd, buffer, kBufferSize))) > 0) {
+      while ((result = TEMP_FAILURE_RETRY(read(old_fd, buffer, kBufferSize))) >
+             0) {
         int wrote = TEMP_FAILURE_RETRY(write(new_fd, buffer, result));
         if (wrote != result) {
           result = -1;
@@ -506,9 +504,9 @@
     return File::kError;
   }
   return ((file_1_info.st_ino == file_2_info.st_ino) &&
-          (file_1_info.st_dev == file_2_info.st_dev)) ?
-      File::kIdentical :
-      File::kDifferent;
+          (file_1_info.st_dev == file_2_info.st_dev))
+             ? File::kIdentical
+             : File::kDifferent;
 }
 
 }  // namespace bin
diff --git a/runtime/bin/file_fuchsia.cc b/runtime/bin/file_fuchsia.cc
index fdc2623..bda6113 100644
--- a/runtime/bin/file_fuchsia.cc
+++ b/runtime/bin/file_fuchsia.cc
@@ -7,13 +7,13 @@
 
 #include "bin/file.h"
 
-#include <errno.h>  // NOLINT
-#include <fcntl.h>  // NOLINT
-#include <libgen.h>  // NOLINT
-#include <sys/mman.h>  // NOLINT
-#include <sys/stat.h>  // NOLINT
+#include <errno.h>      // NOLINT
+#include <fcntl.h>      // NOLINT
+#include <libgen.h>     // NOLINT
+#include <sys/mman.h>   // NOLINT
+#include <sys/stat.h>   // NOLINT
 #include <sys/types.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <unistd.h>     // NOLINT
 
 #include "bin/builtin.h"
 #include "bin/log.h"
@@ -25,8 +25,8 @@
 
 class FileHandle {
  public:
-  explicit FileHandle(int fd) : fd_(fd) { }
-  ~FileHandle() { }
+  explicit FileHandle(int fd) : fd_(fd) {}
+  ~FileHandle() {}
   int fd() const { return fd_; }
   void set_fd(int fd) { fd_ = fd; }
 
@@ -75,7 +75,7 @@
 }
 
 
-void* File::MapExecutable(intptr_t* len) {
+void* File::Map(MapType type, int64_t position, int64_t length) {
   UNIMPLEMENTED();
   return NULL;
 }
@@ -164,7 +164,7 @@
 }
 
 
-File* File::ScopedOpen(const char* name, FileOpenMode mode) {
+File* File::Open(const char* name, FileOpenMode mode) {
   // Report errors for non-regular files.
   struct stat st;
   if (NO_RETRY_EXPECTED(stat(name, &st)) == 0) {
@@ -201,12 +201,6 @@
 }
 
 
-File* File::Open(const char* path, FileOpenMode mode) {
-  // ScopedOpen doesn't actually need a scope.
-  return ScopedOpen(path, mode);
-}
-
-
 File* File::OpenStdio(int fd) {
   return ((fd < 0) || (2 < fd)) ? NULL : new File(new FileHandle(fd));
 }
@@ -441,9 +435,9 @@
     return File::kError;
   }
   return ((file_1_info.st_ino == file_2_info.st_ino) &&
-          (file_1_info.st_dev == file_2_info.st_dev)) ?
-      File::kIdentical :
-      File::kDifferent;
+          (file_1_info.st_dev == file_2_info.st_dev))
+             ? File::kIdentical
+             : File::kDifferent;
 }
 
 }  // namespace bin
diff --git a/runtime/bin/file_linux.cc b/runtime/bin/file_linux.cc
index 4f61db1..9a6dc41 100644
--- a/runtime/bin/file_linux.cc
+++ b/runtime/bin/file_linux.cc
@@ -7,14 +7,14 @@
 
 #include "bin/file.h"
 
-#include <errno.h>  // NOLINT
-#include <fcntl.h>  // NOLINT
-#include <libgen.h>  // NOLINT
-#include <sys/mman.h>  // NOLINT
+#include <errno.h>         // NOLINT
+#include <fcntl.h>         // NOLINT
+#include <libgen.h>        // NOLINT
+#include <sys/mman.h>      // NOLINT
 #include <sys/sendfile.h>  // NOLINT
-#include <sys/stat.h>  // NOLINT
-#include <sys/types.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <sys/stat.h>      // NOLINT
+#include <sys/types.h>     // NOLINT
+#include <unistd.h>        // NOLINT
 
 #include "bin/builtin.h"
 #include "bin/log.h"
@@ -26,8 +26,8 @@
 
 class FileHandle {
  public:
-  explicit FileHandle(int fd) : fd_(fd) { }
-  ~FileHandle() { }
+  explicit FileHandle(int fd) : fd_(fd) {}
+  ~FileHandle() {}
   int fd() const { return fd_; }
   void set_fd(int fd) { fd_ = fd; }
 
@@ -39,8 +39,8 @@
 
 
 File::~File() {
-  if (!IsClosed() &&
-      handle_->fd() != STDOUT_FILENO && handle_->fd() != STDERR_FILENO) {
+  if (!IsClosed() && handle_->fd() != STDOUT_FILENO &&
+      handle_->fd() != STDERR_FILENO) {
     Close();
   }
   delete handle_;
@@ -77,16 +77,22 @@
 }
 
 
-void* File::MapExecutable(intptr_t* len) {
+void* File::Map(MapType type, int64_t position, int64_t length) {
   ASSERT(handle_->fd() >= 0);
-  intptr_t length = Length();
-  void* addr = mmap(0, length,
-                    PROT_READ | PROT_EXEC, MAP_PRIVATE,
-                    handle_->fd(), 0);
+  int prot = PROT_NONE;
+  switch (type) {
+    case kReadOnly:
+      prot = PROT_READ;
+      break;
+    case kReadExecute:
+      prot = PROT_READ | PROT_EXEC;
+      break;
+    default:
+      return NULL;
+  }
+  void* addr = mmap(NULL, length, prot, MAP_PRIVATE, handle_->fd(), position);
   if (addr == MAP_FAILED) {
-    *len = -1;
-  } else {
-    *len = length;
+    return NULL;
   }
   return addr;
 }
@@ -175,7 +181,7 @@
 }
 
 
-File* File::ScopedOpen(const char* name, FileOpenMode mode) {
+File* File::Open(const char* name, FileOpenMode mode) {
   // Report errors for non-regular files.
   struct stat64 st;
   if (TEMP_FAILURE_RETRY(stat64(name, &st)) == 0) {
@@ -213,12 +219,6 @@
 }
 
 
-File* File::Open(const char* path, FileOpenMode mode) {
-  // ScopedOpen doesn't actually need a scope.
-  return ScopedOpen(path, mode);
-}
-
-
 File* File::OpenStdio(int fd) {
   return ((fd < 0) || (2 < fd)) ? NULL : new File(new FileHandle(fd));
 }
@@ -235,8 +235,8 @@
 
 
 bool File::Create(const char* name) {
-  int fd = TEMP_FAILURE_RETRY(
-      open64(name, O_RDONLY | O_CREAT | O_CLOEXEC, 0666));
+  int fd =
+      TEMP_FAILURE_RETRY(open64(name, O_RDONLY | O_CREAT | O_CLOEXEC, 0666));
   if (fd < 0) {
     return false;
   }
@@ -319,8 +319,8 @@
     intptr_t result = 1;
     while (result > 0) {
       // Loop to ensure we copy everything, and not only up to 2GB.
-      result = NO_RETRY_EXPECTED(
-          sendfile64(new_fd, old_fd, &offset, kMaxUint32));
+      result =
+          NO_RETRY_EXPECTED(sendfile64(new_fd, old_fd, &offset, kMaxUint32));
     }
     // From sendfile man pages:
     //   Applications may wish to fall back to read(2)/write(2) in the case
@@ -328,8 +328,8 @@
     if ((result < 0) && ((errno == EINVAL) || (errno == ENOSYS))) {
       const intptr_t kBufferSize = 8 * KB;
       uint8_t buffer[kBufferSize];
-      while ((result = TEMP_FAILURE_RETRY(
-          read(old_fd, buffer, kBufferSize))) > 0) {
+      while ((result = TEMP_FAILURE_RETRY(read(old_fd, buffer, kBufferSize))) >
+             0) {
         int wrote = TEMP_FAILURE_RETRY(write(new_fd, buffer, result));
         if (wrote != result) {
           result = -1;
@@ -366,7 +366,7 @@
 
 static int64_t TimespecToMilliseconds(const struct timespec& t) {
   return static_cast<int64_t>(t.tv_sec) * 1000L +
-      static_cast<int64_t>(t.tv_nsec) / 1000000L;
+         static_cast<int64_t>(t.tv_nsec) / 1000000L;
 }
 
 
@@ -416,8 +416,8 @@
   // 0. Also the link might have changed before the readlink call.
   const int kBufferSize = PATH_MAX + 1;
   char target[kBufferSize];
-  size_t target_size = TEMP_FAILURE_RETRY(
-      readlink(pathname, target, kBufferSize));
+  size_t target_size =
+      TEMP_FAILURE_RETRY(readlink(pathname, target, kBufferSize));
   if (target_size <= 0) {
     return NULL;
   }
@@ -517,9 +517,9 @@
     return File::kError;
   }
   return ((file_1_info.st_ino == file_2_info.st_ino) &&
-          (file_1_info.st_dev == file_2_info.st_dev)) ?
-      File::kIdentical :
-      File::kDifferent;
+          (file_1_info.st_dev == file_2_info.st_dev))
+             ? File::kIdentical
+             : File::kDifferent;
 }
 
 }  // namespace bin
diff --git a/runtime/bin/file_macos.cc b/runtime/bin/file_macos.cc
index 38699cd..2b32bc1 100644
--- a/runtime/bin/file_macos.cc
+++ b/runtime/bin/file_macos.cc
@@ -8,13 +8,13 @@
 #include "bin/file.h"
 
 #include <copyfile.h>  // NOLINT
-#include <errno.h>  // NOLINT
-#include <fcntl.h>  // NOLINT
-#include <libgen.h>  // NOLINT
-#include <limits.h>  // NOLINT
+#include <errno.h>     // NOLINT
+#include <fcntl.h>     // NOLINT
+#include <libgen.h>    // NOLINT
+#include <limits.h>    // NOLINT
 #include <sys/mman.h>  // NOLINT
 #include <sys/stat.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <unistd.h>    // NOLINT
 
 #include "bin/builtin.h"
 #include "bin/fdutils.h"
@@ -28,8 +28,8 @@
 
 class FileHandle {
  public:
-  explicit FileHandle(int fd) : fd_(fd) { }
-  ~FileHandle() { }
+  explicit FileHandle(int fd) : fd_(fd) {}
+  ~FileHandle() {}
   int fd() const { return fd_; }
   void set_fd(int fd) { fd_ = fd; }
 
@@ -41,8 +41,8 @@
 
 
 File::~File() {
-  if (!IsClosed() &&
-      handle_->fd() != STDOUT_FILENO && handle_->fd() != STDERR_FILENO) {
+  if (!IsClosed() && handle_->fd() != STDOUT_FILENO &&
+      handle_->fd() != STDERR_FILENO) {
     Close();
   }
   delete handle_;
@@ -80,16 +80,22 @@
 }
 
 
-void* File::MapExecutable(intptr_t* len) {
+void* File::Map(MapType type, int64_t position, int64_t length) {
   ASSERT(handle_->fd() >= 0);
-  intptr_t length = Length();
-  void* addr = mmap(0, length,
-                    PROT_READ | PROT_EXEC, MAP_PRIVATE,
-                    handle_->fd(), 0);
+  int prot = PROT_NONE;
+  switch (type) {
+    case kReadOnly:
+      prot = PROT_READ;
+      break;
+    case kReadExecute:
+      prot = PROT_READ | PROT_EXEC;
+      break;
+    default:
+      return NULL;
+  }
+  void* addr = mmap(NULL, length, prot, MAP_PRIVATE, handle_->fd(), position);
   if (addr == MAP_FAILED) {
-    *len = -1;
-  } else {
-    *len = length;
+    return NULL;
   }
   return addr;
 }
@@ -178,7 +184,7 @@
 }
 
 
-File* File::ScopedOpen(const char* name, FileOpenMode mode) {
+File* File::Open(const char* name, FileOpenMode mode) {
   // Report errors for non-regular files.
   struct stat st;
   if (NO_RETRY_EXPECTED(stat(name, &st)) == 0) {
@@ -216,12 +222,6 @@
 }
 
 
-File* File::Open(const char* path, FileOpenMode mode) {
-  // ScopedOpen doesn't actually need a scope.
-  return ScopedOpen(path, mode);
-}
-
-
 File* File::OpenStdio(int fd) {
   return ((fd < 0) || (2 < fd)) ? NULL : new File(new FileHandle(fd));
 }
@@ -325,7 +325,7 @@
 
 static int64_t TimespecToMilliseconds(const struct timespec& t) {
   return static_cast<int64_t>(t.tv_sec) * 1000L +
-      static_cast<int64_t>(t.tv_nsec) / 1000000L;
+         static_cast<int64_t>(t.tv_nsec) / 1000000L;
 }
 
 
@@ -377,8 +377,8 @@
   // target. The link might have changed before the readlink call.
   const int kBufferSize = 1024;
   char target[kBufferSize];
-  size_t target_size = TEMP_FAILURE_RETRY(
-      readlink(pathname, target, kBufferSize));
+  size_t target_size =
+      TEMP_FAILURE_RETRY(readlink(pathname, target, kBufferSize));
   if (target_size <= 0) {
     return NULL;
   }
@@ -481,9 +481,9 @@
     return File::kError;
   }
   return ((file_1_info.st_ino == file_2_info.st_ino) &&
-          (file_1_info.st_dev == file_2_info.st_dev)) ?
-      File::kIdentical :
-      File::kDifferent;
+          (file_1_info.st_dev == file_2_info.st_dev))
+             ? File::kIdentical
+             : File::kDifferent;
 }
 
 }  // namespace bin
diff --git a/runtime/bin/file_support.cc b/runtime/bin/file_support.cc
index 0ad5edc..41de702 100644
--- a/runtime/bin/file_support.cc
+++ b/runtime/bin/file_support.cc
@@ -50,7 +50,7 @@
     if (bytes_read <= 0) {
       return false;
     }
-    remaining -= bytes_read;  // Reduce the number of remaining bytes.
+    remaining -= bytes_read;       // Reduce the number of remaining bytes.
     current_buffer += bytes_read;  // Move the buffer forward.
   }
   return true;
@@ -65,7 +65,7 @@
     if (bytes_written < 0) {
       return false;
     }
-    remaining -= bytes_written;  // Reduce the number of remaining bytes.
+    remaining -= bytes_written;       // Reduce the number of remaining bytes.
     current_buffer += bytes_written;  // Move the buffer forward.
   }
   if (capture_stdout || capture_stderr) {
@@ -85,10 +85,8 @@
 
 
 File::FileOpenMode File::DartModeToFileMode(DartFileOpenMode mode) {
-  ASSERT((mode == File::kDartRead) ||
-         (mode == File::kDartWrite) ||
-         (mode == File::kDartAppend) ||
-         (mode == File::kDartWriteOnly) ||
+  ASSERT((mode == File::kDartRead) || (mode == File::kDartWrite) ||
+         (mode == File::kDartAppend) || (mode == File::kDartWriteOnly) ||
          (mode == File::kDartWriteOnlyAppend));
   if (mode == File::kDartWrite) {
     return File::kWriteTruncate;
diff --git a/runtime/bin/file_system_watcher.h b/runtime/bin/file_system_watcher.h
index 5026da7..8dfbbab 100644
--- a/runtime/bin/file_system_watcher.h
+++ b/runtime/bin/file_system_watcher.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_FILE_SYSTEM_WATCHER_H_
-#define BIN_FILE_SYSTEM_WATCHER_H_
+#ifndef RUNTIME_BIN_FILE_SYSTEM_WATCHER_H_
+#define RUNTIME_BIN_FILE_SYSTEM_WATCHER_H_
 
 #if defined(DART_IO_DISABLED)
 #error "file_system_watcher.h can only be included on builds with IO enabled"
@@ -57,5 +57,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_FILE_SYSTEM_WATCHER_H_
-
+#endif  // RUNTIME_BIN_FILE_SYSTEM_WATCHER_H_
diff --git a/runtime/bin/file_system_watcher_android.cc b/runtime/bin/file_system_watcher_android.cc
index 4c0380e..0cecfe2 100644
--- a/runtime/bin/file_system_watcher_android.cc
+++ b/runtime/bin/file_system_watcher_android.cc
@@ -9,7 +9,7 @@
 
 #include "bin/file_system_watcher.h"
 
-#include <errno.h>  // NOLINT
+#include <errno.h>        // NOLINT
 #include <sys/inotify.h>  // NOLINT
 
 #include "bin/fdutils.h"
@@ -120,14 +120,15 @@
   while (offset < bytes) {
     struct inotify_event* e =
         reinterpret_cast<struct inotify_event*>(buffer + offset);
-    if ((e->mask & IN_IGNORED) == 0) {;
+    if ((e->mask & IN_IGNORED) == 0) {
       Dart_Handle event = Dart_NewList(5);
       int mask = InotifyEventToMask(e);
       Dart_ListSetAt(event, 0, Dart_NewInteger(mask));
       Dart_ListSetAt(event, 1, Dart_NewInteger(e->cookie));
       if (e->len > 0) {
         Dart_ListSetAt(event, 2, Dart_NewStringFromUTF8(
-            reinterpret_cast<uint8_t*>(e->name), strlen(e->name)));
+                                     reinterpret_cast<uint8_t*>(e->name),
+                                     strlen(e->name)));
       } else {
         Dart_ListSetAt(event, 2, Dart_Null());
       }
diff --git a/runtime/bin/file_system_watcher_linux.cc b/runtime/bin/file_system_watcher_linux.cc
index ef4eaef..91c8184 100644
--- a/runtime/bin/file_system_watcher_linux.cc
+++ b/runtime/bin/file_system_watcher_linux.cc
@@ -9,7 +9,7 @@
 
 #include "bin/file_system_watcher.h"
 
-#include <errno.h>  // NOLINT
+#include <errno.h>        // NOLINT
 #include <sys/inotify.h>  // NOLINT
 
 #include "bin/fdutils.h"
@@ -121,14 +121,15 @@
   while (offset < bytes) {
     struct inotify_event* e =
         reinterpret_cast<struct inotify_event*>(buffer + offset);
-    if ((e->mask & IN_IGNORED) == 0) {;
+    if ((e->mask & IN_IGNORED) == 0) {
       Dart_Handle event = Dart_NewList(5);
       int mask = InotifyEventToMask(e);
       Dart_ListSetAt(event, 0, Dart_NewInteger(mask));
       Dart_ListSetAt(event, 1, Dart_NewInteger(e->cookie));
       if (e->len > 0) {
         Dart_ListSetAt(event, 2, Dart_NewStringFromUTF8(
-            reinterpret_cast<uint8_t*>(e->name), strlen(e->name)));
+                                     reinterpret_cast<uint8_t*>(e->name),
+                                     strlen(e->name)));
       } else {
         Dart_ListSetAt(event, 2, Dart_Null());
       }
diff --git a/runtime/bin/file_system_watcher_macos.cc b/runtime/bin/file_system_watcher_macos.cc
index 7bc0e0c..3636eb3 100644
--- a/runtime/bin/file_system_watcher_macos.cc
+++ b/runtime/bin/file_system_watcher_macos.cc
@@ -11,9 +11,9 @@
 
 #if !TARGET_OS_IOS
 
-#include <errno.h>  // NOLINT
-#include <fcntl.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <errno.h>                      // NOLINT
+#include <fcntl.h>                      // NOLINT
+#include <unistd.h>                     // NOLINT
 #include <CoreServices/CoreServices.h>  // NOLINT
 
 #include "bin/eventhandler.h"
@@ -24,9 +24,7 @@
 #include "platform/signal_blocker.h"
 
 #ifndef MAC_OS_X_VERSION_10_7
-enum {
-  kFSEventStreamCreateFlagFileEvents = 0x00000010
-};
+enum { kFSEventStreamCreateFlagFileEvents = 0x00000010 };
 enum {
   kFSEventStreamEventFlagItemCreated = 0x00000100,
   kFSEventStreamEventFlagItemRemoved = 0x00000200,
@@ -59,13 +57,17 @@
  public:
   class Node {
    public:
-    Node(FSEventsWatcher* watcher, char* base_path, int read_fd,
-         int write_fd, bool recursive)
+    Node(FSEventsWatcher* watcher,
+         char* base_path,
+         int read_fd,
+         int write_fd,
+         bool recursive)
         : watcher_(watcher),
           ready_(false),
           base_path_length_(strlen(base_path)),
-          path_ref_(CFStringCreateWithCString(
-              NULL, base_path, kCFStringEncodingUTF8)),
+          path_ref_(CFStringCreateWithCString(NULL,
+                                              base_path,
+                                              kCFStringEncodingUTF8)),
           read_fd_(read_fd),
           write_fd_(write_fd),
           recursive_(recursive),
@@ -79,17 +81,15 @@
       CFRelease(path_ref_);
     }
 
-    void set_ref(FSEventStreamRef ref) {
-      ref_ = ref;
-    }
+    void set_ref(FSEventStreamRef ref) { ref_ = ref; }
 
     void Start() {
       // Schedule StartCallback to be executed in the RunLoop.
       CFRunLoopTimerContext context;
       memset(&context, 0, sizeof(context));
       context.info = this;
-      CFRunLoopTimerRef timer = CFRunLoopTimerCreate(
-          NULL, 0, 0, 0, 0, Node::StartCallback, &context);
+      CFRunLoopTimerRef timer =
+          CFRunLoopTimerCreate(NULL, 0, 0, 0, 0, Node::StartCallback, &context);
       CFRunLoopAddTimer(watcher_->run_loop_, timer, kCFRunLoopCommonModes);
       CFRelease(timer);
       watcher_->monitor_.Enter();
@@ -109,21 +109,14 @@
       CFArrayRef array = CFArrayCreate(
           NULL, reinterpret_cast<const void**>(&node->path_ref_), 1, NULL);
       FSEventStreamRef ref = FSEventStreamCreate(
-          NULL,
-          Callback,
-          &context,
-          array,
-          kFSEventStreamEventIdSinceNow,
-          0.10,
+          NULL, Callback, &context, array, kFSEventStreamEventIdSinceNow, 0.10,
           kFSEventStreamCreateFlagFileEvents);
       CFRelease(array);
 
       node->set_ref(ref);
 
-      FSEventStreamScheduleWithRunLoop(
-          node->ref_,
-          node->watcher_->run_loop_,
-          kCFRunLoopDefaultMode);
+      FSEventStreamScheduleWithRunLoop(node->ref_, node->watcher_->run_loop_,
+                                       kCFRunLoopDefaultMode);
 
       FSEventStreamStart(node->ref_);
       FSEventStreamFlushSync(node->ref_);
@@ -140,8 +133,8 @@
       CFRunLoopTimerContext context;
       memset(&context, 0, sizeof(context));
       context.info = this;
-      CFRunLoopTimerRef timer = CFRunLoopTimerCreate(
-          NULL, 0, 0, 0, 0, StopCallback, &context);
+      CFRunLoopTimerRef timer =
+          CFRunLoopTimerCreate(NULL, 0, 0, 0, 0, StopCallback, &context);
       CFRunLoopAddTimer(watcher_->run_loop_, timer, kCFRunLoopCommonModes);
       CFRelease(timer);
       watcher_->monitor_.Enter();
@@ -185,9 +178,7 @@
   };
 
 
-  FSEventsWatcher() : run_loop_(0) {
-    Start();
-  }
+  FSEventsWatcher() : run_loop_(0) { Start(); }
 
   void Start() {
     Thread::Start(Run, reinterpret_cast<uword>(this));
@@ -211,13 +202,7 @@
     watcher->monitor().Exit();
 
     CFRunLoopTimerRef timer = CFRunLoopTimerCreate(
-        NULL,
-        CFAbsoluteTimeGetCurrent() + 1,
-        1,
-        0,
-        0,
-        TimerCallback,
-        NULL);
+        NULL, CFAbsoluteTimeGetCurrent() + 1, 1, 0, 0, TimerCallback, NULL);
     CFRunLoopAddTimer(watcher->run_loop_, timer, kCFRunLoopCommonModes);
     CFRelease(timer);
 
@@ -235,8 +220,8 @@
     CFRunLoopTimerContext context;
     memset(&context, 0, sizeof(context));
     context.info = this;
-    CFRunLoopTimerRef timer = CFRunLoopTimerCreate(
-        NULL, 0, 0, 0, 0, StopCallback, &context);
+    CFRunLoopTimerRef timer =
+        CFRunLoopTimerCreate(NULL, 0, 0, 0, 0, StopCallback, &context);
     CFRunLoopAddTimer(run_loop_, timer, kCFRunLoopCommonModes);
     CFRelease(timer);
     monitor_.Enter();
@@ -248,14 +233,11 @@
 
   static void StopCallback(CFRunLoopTimerRef timer, void* info) {
     FSEventsWatcher* watcher = reinterpret_cast<FSEventsWatcher*>(info);
-    ASSERT(Thread::Compare(watcher->threadId_,
-                           Thread::GetCurrentThreadId()));
+    ASSERT(Thread::Compare(watcher->threadId_, Thread::GetCurrentThreadId()));
     CFRunLoopStop(watcher->run_loop_);
   }
 
-  ~FSEventsWatcher() {
-    Stop();
-  }
+  ~FSEventsWatcher() { Stop(); }
 
   Monitor& monitor() { return monitor_; }
 
@@ -293,7 +275,7 @@
       return;
     }
     for (size_t i = 0; i < num_events; i++) {
-      char *path = reinterpret_cast<char**>(event_paths)[i];
+      char* path = reinterpret_cast<char**>(event_paths)[i];
       FSEvent event;
       event.data.exists = File::GetType(path, false) != File::kDoesNotExist;
       path += node->base_path_length();
@@ -318,7 +300,7 @@
 };
 
 
-#define kCFCoreFoundationVersionNumber10_7      635.00
+#define kCFCoreFoundationVersionNumber10_7 635.00
 bool FileSystemWatcher::IsSupported() {
   return kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber10_7;
 }
@@ -402,8 +384,9 @@
     }
     Dart_ListSetAt(event, 0, Dart_NewInteger(mask));
     Dart_ListSetAt(event, 1, Dart_NewInteger(1));
-    Dart_ListSetAt(event, 2, Dart_NewStringFromUTF8(
-        reinterpret_cast<uint8_t*>(e.data.path), path_len));
+    Dart_ListSetAt(event, 2,
+                   Dart_NewStringFromUTF8(
+                       reinterpret_cast<uint8_t*>(e.data.path), path_len));
     Dart_ListSetAt(event, 3, Dart_NewBoolean(true));
     Dart_ListSetAt(event, 4, Dart_NewInteger(path_id));
     Dart_ListSetAt(events, i, event);
@@ -435,8 +418,7 @@
 }
 
 
-void FileSystemWatcher::UnwatchPath(intptr_t id, intptr_t path_id) {
-}
+void FileSystemWatcher::UnwatchPath(intptr_t id, intptr_t path_id) {}
 
 
 intptr_t FileSystemWatcher::Init() {
@@ -444,8 +426,7 @@
 }
 
 
-void FileSystemWatcher::Close(intptr_t id) {
-}
+void FileSystemWatcher::Close(intptr_t id) {}
 
 
 intptr_t FileSystemWatcher::WatchPath(intptr_t id,
diff --git a/runtime/bin/file_system_watcher_unsupported.cc b/runtime/bin/file_system_watcher_unsupported.cc
index 7803215..82c6c70 100644
--- a/runtime/bin/file_system_watcher_unsupported.cc
+++ b/runtime/bin/file_system_watcher_unsupported.cc
@@ -13,43 +13,43 @@
 
 void FUNCTION_NAME(FileSystemWatcher_IsSupported)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "FileSystemWatcher is not supported on this platform"));
+      "FileSystemWatcher is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(FileSystemWatcher_InitWatcher)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "FileSystemWatcher is not supported on this platform"));
+      "FileSystemWatcher is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(FileSystemWatcher_CloseWatcher)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "FileSystemWatcher is not supported on this platform"));
+      "FileSystemWatcher is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(FileSystemWatcher_WatchPath)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "FileSystemWatcher is not supported on this platform"));
+      "FileSystemWatcher is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(FileSystemWatcher_UnwatchPath)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "FileSystemWatcher is not supported on this platform"));
+      "FileSystemWatcher is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(FileSystemWatcher_ReadEvents)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "FileSystemWatcher is not supported on this platform"));
+      "FileSystemWatcher is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(FileSystemWatcher_GetSocketId)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "FileSystemWatcher is not supported on this platform"));
+      "FileSystemWatcher is not supported on this platform"));
 }
 
 }  // namespace bin
diff --git a/runtime/bin/file_system_watcher_win.cc b/runtime/bin/file_system_watcher_win.cc
index 698b049..16a49a0 100644
--- a/runtime/bin/file_system_watcher_win.cc
+++ b/runtime/bin/file_system_watcher_win.cc
@@ -40,16 +40,11 @@
                                       int events,
                                       bool recursive) {
   USE(id);
-  const wchar_t* name = StringUtilsWin::Utf8ToWide(path);
-  HANDLE dir = CreateFileW(name,
-                           FILE_LIST_DIRECTORY,
-                           FILE_SHARE_READ |
-                               FILE_SHARE_WRITE |
-                               FILE_SHARE_DELETE,
-                           NULL,
-                           OPEN_EXISTING,
-                           FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED,
-                           NULL);
+  Utf8ToWideScope name(path);
+  HANDLE dir = CreateFileW(
+      name.wide(), FILE_LIST_DIRECTORY,
+      FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,
+      OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, NULL);
 
   if (dir == INVALID_HANDLE_VALUE) {
     return -1;
@@ -57,8 +52,7 @@
 
   int list_events = 0;
   if ((events & (kCreate | kMove | kDelete)) != 0) {
-    list_events |= FILE_NOTIFY_CHANGE_FILE_NAME |
-                   FILE_NOTIFY_CHANGE_DIR_NAME;
+    list_events |= FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME;
   }
   if ((events & kModifyContent) != 0) {
     list_events |= FILE_NOTIFY_CHANGE_LAST_WRITE;
@@ -124,7 +118,8 @@
     // Move events come in pairs. Just 'enable' by default.
     Dart_ListSetAt(event, 1, Dart_NewInteger(1));
     Dart_ListSetAt(event, 2, Dart_NewStringFromUTF16(
-        reinterpret_cast<uint16_t*>(e->FileName), e->FileNameLength / 2));
+                                 reinterpret_cast<uint16_t*>(e->FileName),
+                                 e->FileNameLength / 2));
     Dart_ListSetAt(event, 3, Dart_NewBoolean(true));
     Dart_ListSetAt(event, 4, Dart_NewInteger(path_id));
     Dart_ListSetAt(events, i, event);
diff --git a/runtime/bin/file_unsupported.cc b/runtime/bin/file_unsupported.cc
index 55a88d0..88e85c6 100644
--- a/runtime/bin/file_unsupported.cc
+++ b/runtime/bin/file_unsupported.cc
@@ -13,194 +13,194 @@
 
 
 void FUNCTION_NAME(File_GetPointer)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_SetPointer)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_Open)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_Exists)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_Close)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_ReadByte)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_WriteByte)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_Read)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_ReadInto)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_WriteFrom)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_Position)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_SetPosition)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_Truncate)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_Length)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_LengthFromPath)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_LastModified)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_Flush)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_Lock)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_Create)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_CreateLink)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_LinkTarget)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_Delete)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_DeleteLink)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_Rename)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_RenameLink)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_Copy)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_ResolveSymbolicLinks)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_OpenStdio)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_GetStdioHandleType)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_GetType)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_Stat)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(File_AreIdentical)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "File is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("File is not supported on this platform"));
 }
 
 }  // namespace bin
diff --git a/runtime/bin/file_win.cc b/runtime/bin/file_win.cc
index f487a88..79272d3 100644
--- a/runtime/bin/file_win.cc
+++ b/runtime/bin/file_win.cc
@@ -7,10 +7,10 @@
 
 #include "bin/file.h"
 
-#include <fcntl.h>  // NOLINT
-#include <io.h>  // NOLINT
-#include <stdio.h>  // NOLINT
-#include <string.h>  // NOLINT
+#include <fcntl.h>     // NOLINT
+#include <io.h>        // NOLINT
+#include <stdio.h>     // NOLINT
+#include <string.h>    // NOLINT
 #include <sys/stat.h>  // NOLINT
 #include <WinIoCtl.h>  // NOLINT
 
@@ -25,8 +25,8 @@
 
 class FileHandle {
  public:
-  explicit FileHandle(int fd) : fd_(fd) { }
-  ~FileHandle() { }
+  explicit FileHandle(int fd) : fd_(fd) {}
+  ~FileHandle() {}
   int fd() const { return fd_; }
   void set_fd(int fd) { fd_ = fd; }
 
@@ -38,8 +38,8 @@
 
 
 File::~File() {
-  if (!IsClosed() &&
-      handle_->fd() != _fileno(stdout) && handle_->fd() != _fileno(stderr)) {
+  if (!IsClosed() && handle_->fd() != _fileno(stdout) &&
+      handle_->fd() != _fileno(stderr)) {
     Close();
   }
   delete handle_;
@@ -74,9 +74,43 @@
 }
 
 
-void* File::MapExecutable(intptr_t* len) {
-  UNIMPLEMENTED();
-  return NULL;
+void* File::Map(File::MapType type, int64_t position, int64_t length) {
+  DWORD prot_alloc;
+  DWORD prot_final;
+  switch (type) {
+    case File::kReadOnly:
+      prot_alloc = PAGE_READWRITE;
+      prot_final = PAGE_READONLY;
+      break;
+    case File::kReadExecute:
+      prot_alloc = PAGE_EXECUTE_READWRITE;
+      prot_final = PAGE_EXECUTE_READ;
+      break;
+    default:
+      return NULL;
+  }
+
+  void* addr = VirtualAlloc(NULL, length, MEM_COMMIT | MEM_RESERVE, prot_alloc);
+  if (addr == NULL) {
+    Log::PrintErr("VirtualAlloc failed %d\n", GetLastError());
+    return NULL;
+  }
+
+  SetPosition(position);
+  if (!ReadFully(addr, length)) {
+    Log::PrintErr("ReadFully failed %d\n", GetLastError());
+    VirtualFree(addr, 0, MEM_RELEASE);
+    return NULL;
+  }
+
+  DWORD old_prot;
+  bool result = VirtualProtect(addr, length, prot_final, &old_prot);
+  if (!result) {
+    Log::PrintErr("VirtualProtect failed %d\n", GetLastError());
+    VirtualFree(addr, 0, MEM_RELEASE);
+    return NULL;
+  }
+  return addr;
 }
 
 
@@ -150,8 +184,7 @@
           (lock == File::kLockBlockingExclusive)) {
         flags |= LOCKFILE_EXCLUSIVE_LOCK;
       }
-      rc = LockFileEx(handle, flags, 0,
-                      length_low, length_high, &overlapped);
+      rc = LockFileEx(handle, flags, 0, length_low, length_high, &overlapped);
       break;
     }
     default:
@@ -199,21 +232,9 @@
 }
 
 
-File* File::ScopedOpen(const char* name, FileOpenMode mode) {
-  const wchar_t* system_name = StringUtilsWin::Utf8ToWide(name);
-  return FileOpenW(system_name, mode);
-}
-
-
 File* File::Open(const char* path, FileOpenMode mode) {
-  int path_len = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0);
-  wchar_t* system_name = new wchar_t[path_len];
-  if (system_name == NULL) {
-    return NULL;
-  }
-  MultiByteToWideChar(CP_UTF8, 0, path, -1, system_name, path_len);
-  File* file = FileOpenW(system_name, mode);
-  delete[] system_name;
+  Utf8ToWideScope system_name(path);
+  File* file = FileOpenW(system_name.wide(), mode);
   return file;
 }
 
@@ -236,8 +257,8 @@
 
 bool File::Exists(const char* name) {
   struct __stat64 st;
-  const wchar_t* system_name = StringUtilsWin::Utf8ToWide(name);
-  bool stat_status = _wstat64(system_name, &st);
+  Utf8ToWideScope system_name(name);
+  bool stat_status = _wstat64(system_name.wide(), &st);
   if (stat_status == 0) {
     return ((st.st_mode & S_IFMT) == S_IFREG);
   } else {
@@ -247,8 +268,8 @@
 
 
 bool File::Create(const char* name) {
-  const wchar_t* system_name = StringUtilsWin::Utf8ToWide(name);
-  int fd = _wopen(system_name, O_RDONLY | O_CREAT, 0666);
+  Utf8ToWideScope system_name(name);
+  int fd = _wopen(system_name.wide(), O_RDONLY | O_CREAT, 0666);
   if (fd < 0) {
     return false;
   }
@@ -258,32 +279,32 @@
 
 // This structure is needed for creating and reading Junctions.
 typedef struct _REPARSE_DATA_BUFFER {
-    ULONG  ReparseTag;
-    USHORT ReparseDataLength;
-    USHORT Reserved;
+  ULONG ReparseTag;
+  USHORT ReparseDataLength;
+  USHORT Reserved;
 
-    union {
-        struct {
-            USHORT  SubstituteNameOffset;
-            USHORT  SubstituteNameLength;
-            USHORT  PrintNameOffset;
-            USHORT  PrintNameLength;
-            ULONG   Flags;
-            WCHAR   PathBuffer[1];
-        } SymbolicLinkReparseBuffer;
+  union {
+    struct {
+      USHORT SubstituteNameOffset;
+      USHORT SubstituteNameLength;
+      USHORT PrintNameOffset;
+      USHORT PrintNameLength;
+      ULONG Flags;
+      WCHAR PathBuffer[1];
+    } SymbolicLinkReparseBuffer;
 
-        struct {
-            USHORT  SubstituteNameOffset;
-            USHORT  SubstituteNameLength;
-            USHORT  PrintNameOffset;
-            USHORT  PrintNameLength;
-            WCHAR   PathBuffer[1];
-        } MountPointReparseBuffer;
+    struct {
+      USHORT SubstituteNameOffset;
+      USHORT SubstituteNameLength;
+      USHORT PrintNameOffset;
+      USHORT PrintNameLength;
+      WCHAR PathBuffer[1];
+    } MountPointReparseBuffer;
 
-        struct {
-            UCHAR   DataBuffer[1];
-        } GenericReparseBuffer;
-    };
+    struct {
+      UCHAR DataBuffer[1];
+    } GenericReparseBuffer;
+  };
 } REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER;
 
 
@@ -292,29 +313,26 @@
 
 
 bool File::CreateLink(const char* utf8_name, const char* utf8_target) {
-  const wchar_t* name = StringUtilsWin::Utf8ToWide(utf8_name);
-  int create_status = CreateDirectoryW(name, NULL);
+  Utf8ToWideScope name(utf8_name);
+  int create_status = CreateDirectoryW(name.wide(), NULL);
   // If the directory already existed, treat it as a success.
   if ((create_status == 0) &&
       ((GetLastError() != ERROR_ALREADY_EXISTS) ||
-       ((GetFileAttributesW(name) & FILE_ATTRIBUTE_DIRECTORY) != 0))) {
+       ((GetFileAttributesW(name.wide()) & FILE_ATTRIBUTE_DIRECTORY) != 0))) {
     return false;
   }
 
   HANDLE dir_handle = CreateFileW(
-      name,
-      GENERIC_READ | GENERIC_WRITE,
-      FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
-      NULL,
-      OPEN_EXISTING,
-      FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT,
+      name.wide(), GENERIC_READ | GENERIC_WRITE,
+      FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,
+      OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT,
       NULL);
   if (dir_handle == INVALID_HANDLE_VALUE) {
     return false;
   }
 
-  const wchar_t* target = StringUtilsWin::Utf8ToWide(utf8_target);
-  int target_len = wcslen(target);
+  Utf8ToWideScope target(utf8_target);
+  int target_len = wcslen(target.wide());
   if (target_len > MAX_PATH - 1) {
     CloseHandle(dir_handle);
     return false;
@@ -323,13 +341,13 @@
   int reparse_data_buffer_size =
       sizeof REPARSE_DATA_BUFFER + 2 * MAX_PATH * sizeof WCHAR;
   REPARSE_DATA_BUFFER* reparse_data_buffer =
-      reinterpret_cast<REPARSE_DATA_BUFFER*>(Dart_ScopeAllocate(
-          reparse_data_buffer_size));
+      reinterpret_cast<REPARSE_DATA_BUFFER*>(malloc(reparse_data_buffer_size));
   reparse_data_buffer->ReparseTag = IO_REPARSE_TAG_MOUNT_POINT;
-  wcscpy(reparse_data_buffer->MountPointReparseBuffer.PathBuffer, target);
+  wcscpy(reparse_data_buffer->MountPointReparseBuffer.PathBuffer,
+         target.wide());
   wcscpy(
       reparse_data_buffer->MountPointReparseBuffer.PathBuffer + target_len + 1,
-      target);
+      target.wide());
   reparse_data_buffer->MountPointReparseBuffer.SubstituteNameOffset = 0;
   reparse_data_buffer->MountPointReparseBuffer.SubstituteNameLength =
       target_len * sizeof WCHAR;
@@ -341,14 +359,10 @@
       (target_len + 1) * 2 * sizeof WCHAR + kMountPointHeaderSize;
   DWORD dummy_received_bytes;
   int result = DeviceIoControl(
-      dir_handle,
-      FSCTL_SET_REPARSE_POINT,
-      reparse_data_buffer,
-      reparse_data_buffer->ReparseDataLength + kReparseDataHeaderSize,
-      NULL,
-      0,
-      &dummy_received_bytes,
-      NULL);
+      dir_handle, FSCTL_SET_REPARSE_POINT, reparse_data_buffer,
+      reparse_data_buffer->ReparseDataLength + kReparseDataHeaderSize, NULL, 0,
+      &dummy_received_bytes, NULL);
+  free(reparse_data_buffer);
   if (CloseHandle(dir_handle) == 0) {
     return false;
   }
@@ -357,20 +371,20 @@
 
 
 bool File::Delete(const char* name) {
-  const wchar_t* system_name = StringUtilsWin::Utf8ToWide(name);
-  int status = _wremove(system_name);
+  Utf8ToWideScope system_name(name);
+  int status = _wremove(system_name.wide());
   return status != -1;
 }
 
 
 bool File::DeleteLink(const char* name) {
-  const wchar_t* system_name = StringUtilsWin::Utf8ToWide(name);
+  Utf8ToWideScope system_name(name);
   bool result = false;
-  DWORD attributes = GetFileAttributesW(system_name);
+  DWORD attributes = GetFileAttributesW(system_name.wide());
   if ((attributes != INVALID_FILE_ATTRIBUTES) &&
       (attributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0) {
     // It's a junction(link), delete it.
-    result = (RemoveDirectoryW(system_name) != 0);
+    result = (RemoveDirectoryW(system_name.wide()) != 0);
   } else {
     SetLastError(ERROR_NOT_A_REPARSE_POINT);
   }
@@ -381,11 +395,11 @@
 bool File::Rename(const char* old_path, const char* new_path) {
   File::Type type = GetType(old_path, false);
   if (type == kIsFile) {
-    const wchar_t* system_old_path = StringUtilsWin::Utf8ToWide(old_path);
-    const wchar_t* system_new_path = StringUtilsWin::Utf8ToWide(new_path);
+    Utf8ToWideScope system_old_path(old_path);
+    Utf8ToWideScope system_new_path(new_path);
     DWORD flags = MOVEFILE_WRITE_THROUGH | MOVEFILE_REPLACE_EXISTING;
     int move_status =
-        MoveFileExW(system_old_path, system_new_path, flags);
+        MoveFileExW(system_old_path.wide(), system_new_path.wide(), flags);
     return (move_status != 0);
   } else {
     SetLastError(ERROR_FILE_NOT_FOUND);
@@ -397,11 +411,11 @@
 bool File::RenameLink(const char* old_path, const char* new_path) {
   File::Type type = GetType(old_path, false);
   if (type == kIsLink) {
-    const wchar_t* system_old_path = StringUtilsWin::Utf8ToWide(old_path);
-    const wchar_t* system_new_path = StringUtilsWin::Utf8ToWide(new_path);
+    Utf8ToWideScope system_old_path(old_path);
+    Utf8ToWideScope system_new_path(new_path);
     DWORD flags = MOVEFILE_WRITE_THROUGH | MOVEFILE_REPLACE_EXISTING;
     int move_status =
-        MoveFileExW(system_old_path, system_new_path, flags);
+        MoveFileExW(system_old_path.wide(), system_new_path.wide(), flags);
     return (move_status != 0);
   } else {
     SetLastError(ERROR_FILE_NOT_FOUND);
@@ -413,14 +427,10 @@
 bool File::Copy(const char* old_path, const char* new_path) {
   File::Type type = GetType(old_path, false);
   if (type == kIsFile) {
-    const wchar_t* system_old_path = StringUtilsWin::Utf8ToWide(old_path);
-    const wchar_t* system_new_path = StringUtilsWin::Utf8ToWide(new_path);
-    bool success = CopyFileExW(system_old_path,
-                               system_new_path,
-                               NULL,
-                               NULL,
-                               NULL,
-                               0) != 0;
+    Utf8ToWideScope system_old_path(old_path);
+    Utf8ToWideScope system_new_path(new_path);
+    bool success = CopyFileExW(system_old_path.wide(), system_new_path.wide(),
+                               NULL, NULL, NULL, 0) != 0;
     return success;
   } else {
     SetLastError(ERROR_FILE_NOT_FOUND);
@@ -431,8 +441,8 @@
 
 int64_t File::LengthFromPath(const char* name) {
   struct __stat64 st;
-  const wchar_t* system_name = StringUtilsWin::Utf8ToWide(name);
-  int stat_status = _wstat64(system_name, &st);
+  Utf8ToWideScope system_name(name);
+  int stat_status = _wstat64(system_name.wide(), &st);
   if (stat_status == 0) {
     return st.st_size;
   }
@@ -443,12 +453,9 @@
 const char* File::LinkTarget(const char* pathname) {
   const wchar_t* name = StringUtilsWin::Utf8ToWide(pathname);
   HANDLE dir_handle = CreateFileW(
-      name,
-      GENERIC_READ,
-      FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
-      NULL,
-      OPEN_EXISTING,
-      FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT,
+      name, GENERIC_READ,
+      FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,
+      OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT,
       NULL);
   if (dir_handle == INVALID_HANDLE_VALUE) {
     return NULL;
@@ -456,18 +463,11 @@
 
   int buffer_size =
       sizeof REPARSE_DATA_BUFFER + 2 * (MAX_PATH + 1) * sizeof WCHAR;
-  REPARSE_DATA_BUFFER* buffer = reinterpret_cast<REPARSE_DATA_BUFFER*>(
-      Dart_ScopeAllocate(buffer_size));
+  REPARSE_DATA_BUFFER* buffer =
+      reinterpret_cast<REPARSE_DATA_BUFFER*>(Dart_ScopeAllocate(buffer_size));
   DWORD received_bytes;  // Value is not used.
-  int result = DeviceIoControl(
-      dir_handle,
-      FSCTL_GET_REPARSE_POINT,
-      NULL,
-      0,
-      buffer,
-      buffer_size,
-      &received_bytes,
-      NULL);
+  int result = DeviceIoControl(dir_handle, FSCTL_GET_REPARSE_POINT, NULL, 0,
+                               buffer, buffer_size, &received_bytes, NULL);
   if (result == 0) {
     DWORD error = GetLastError();
     CloseHandle(dir_handle);
@@ -502,23 +502,11 @@
     target += 4;
     target_length -= 4;
   }
-  int utf8_length = WideCharToMultiByte(CP_UTF8,
-                                        0,
-                                        target,
-                                        target_length,
-                                        NULL,
-                                        0,
-                                        NULL,
-                                        NULL);
+  int utf8_length = WideCharToMultiByte(CP_UTF8, 0, target, target_length, NULL,
+                                        0, NULL, NULL);
   char* utf8_target = DartUtils::ScopedCString(utf8_length + 1);
-  if (0 == WideCharToMultiByte(CP_UTF8,
-                               0,
-                               target,
-                               target_length,
-                               utf8_target,
-                               utf8_length,
-                               NULL,
-                               NULL)) {
+  if (0 == WideCharToMultiByte(CP_UTF8, 0, target, target_length, utf8_target,
+                               utf8_length, NULL, NULL)) {
     return NULL;
   }
   utf8_target[utf8_length] = '\0';
@@ -531,8 +519,8 @@
   data[kType] = type;
   if (type != kDoesNotExist) {
     struct _stat64 st;
-    const wchar_t* system_name = StringUtilsWin::Utf8ToWide(name);
-    int stat_status = _wstat64(system_name, &st);
+    Utf8ToWideScope system_name(name);
+    int stat_status = _wstat64(system_name.wide(), &st);
     if (stat_status == 0) {
       data[kCreatedTime] = st.st_ctime * 1000;
       data[kModifiedTime] = st.st_mtime * 1000;
@@ -548,8 +536,8 @@
 
 time_t File::LastModified(const char* name) {
   struct __stat64 st;
-  const wchar_t* system_name = StringUtilsWin::Utf8ToWide(name);
-  int stat_status = _wstat64(system_name, &st);
+  Utf8ToWideScope system_name(name);
+  int stat_status = _wstat64(system_name.wide(), &st);
   if (stat_status == 0) {
     return st.st_mtime;
   }
@@ -562,30 +550,22 @@
   if (pathname == NULL) {
     return false;
   }
-  return ((strlen(pathname) > 2) &&
-      (pathname[1] == ':') &&
-      ((pathname[2] == '\\') || (pathname[2] == '/')));
+  return ((strlen(pathname) > 2) && (pathname[1] == ':') &&
+          ((pathname[2] == '\\') || (pathname[2] == '/')));
 }
 
 
 const char* File::GetCanonicalPath(const char* pathname) {
-  const wchar_t* system_name = StringUtilsWin::Utf8ToWide(pathname);
-  HANDLE file_handle = CreateFileW(
-        system_name,
-        0,
-        FILE_SHARE_READ,
-        NULL,
-        OPEN_EXISTING,
-        FILE_FLAG_BACKUP_SEMANTICS,
-        NULL);
+  Utf8ToWideScope system_name(pathname);
+  HANDLE file_handle =
+      CreateFileW(system_name.wide(), 0, FILE_SHARE_READ, NULL, OPEN_EXISTING,
+                  FILE_FLAG_BACKUP_SEMANTICS, NULL);
   if (file_handle == INVALID_HANDLE_VALUE) {
     return NULL;
   }
   wchar_t dummy_buffer[1];
-  int required_size = GetFinalPathNameByHandle(file_handle,
-                                               dummy_buffer,
-                                               0,
-                                               VOLUME_NAME_DOS);
+  int required_size =
+      GetFinalPathNameByHandle(file_handle, dummy_buffer, 0, VOLUME_NAME_DOS);
   if (required_size == 0) {
     DWORD error = GetLastError();
     CloseHandle(file_handle);
@@ -595,17 +575,14 @@
   wchar_t* path;
   path = reinterpret_cast<wchar_t*>(
       Dart_ScopeAllocate(required_size * sizeof(*path)));
-  int result_size = GetFinalPathNameByHandle(file_handle,
-                                             path,
-                                             required_size,
+  int result_size = GetFinalPathNameByHandle(file_handle, path, required_size,
                                              VOLUME_NAME_DOS);
   ASSERT(result_size <= required_size - 1);
   // Remove leading \\?\ if possible, unless input used it.
   char* result;
-  if ((result_size < MAX_PATH - 1 + 4) &&
-      (result_size > 4) &&
+  if ((result_size < MAX_PATH - 1 + 4) && (result_size > 4) &&
       (wcsncmp(path, L"\\\\?\\", 4) == 0) &&
-      (wcsncmp(system_name, L"\\\\?\\", 4) != 0)) {
+      (wcsncmp(system_name.wide(), L"\\\\?\\", 4) != 0)) {
     result = StringUtilsWin::WideToUtf8(path + 4);
   } else {
     result = StringUtilsWin::WideToUtf8(path);
@@ -635,21 +612,18 @@
 
 
 File::Type File::GetType(const char* pathname, bool follow_links) {
-  const wchar_t* name = StringUtilsWin::Utf8ToWide(pathname);
-  DWORD attributes = GetFileAttributesW(name);
+  // Convert to wchar_t string.
+  Utf8ToWideScope name(pathname);
+  DWORD attributes = GetFileAttributesW(name.wide());
   File::Type result = kIsFile;
   if (attributes == INVALID_FILE_ATTRIBUTES) {
     result = kDoesNotExist;
   } else if ((attributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0) {
     if (follow_links) {
-      HANDLE dir_handle = CreateFileW(
-          name,
-          0,
-          FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
-          NULL,
-          OPEN_EXISTING,
-          FILE_FLAG_BACKUP_SEMANTICS,
-          NULL);
+      HANDLE dir_handle =
+          CreateFileW(name.wide(), 0,
+                      FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+                      NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
       if (dir_handle == INVALID_HANDLE_VALUE) {
         result = File::kIsLink;
       } else {
@@ -668,17 +642,14 @@
 
 File::Identical File::AreIdentical(const char* file_1, const char* file_2) {
   BY_HANDLE_FILE_INFORMATION file_info[2];
-  const char* file_names[2] = { file_1, file_2 };
+  const char* file_names[2] = {file_1, file_2};
   for (int i = 0; i < 2; ++i) {
-    const wchar_t* wide_name = StringUtilsWin::Utf8ToWide(file_names[i]);
+    Utf8ToWideScope wide_name(file_names[i]);
     HANDLE file_handle = CreateFileW(
-        wide_name,
-        0,
-        FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
-        NULL,
+        wide_name.wide(), 0,
+        FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,
         OPEN_EXISTING,
-        FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT,
-        NULL);
+        FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, NULL);
     if (file_handle == INVALID_HANDLE_VALUE) {
       return File::kError;
     }
@@ -694,7 +665,7 @@
     }
   }
   if ((file_info[0].dwVolumeSerialNumber ==
-          file_info[1].dwVolumeSerialNumber) &&
+       file_info[1].dwVolumeSerialNumber) &&
       (file_info[0].nFileIndexHigh == file_info[1].nFileIndexHigh) &&
       (file_info[0].nFileIndexLow == file_info[1].nFileIndexLow)) {
     return kIdentical;
diff --git a/runtime/bin/filter.cc b/runtime/bin/filter.cc
index 60887ef..6665979 100644
--- a/runtime/bin/filter.cc
+++ b/runtime/bin/filter.cc
@@ -52,8 +52,8 @@
     return Dart_NewApiError("Could not allocate new dictionary");
   }
 
-  err = Dart_TypedDataAcquireData(
-      dictionary_obj, &type, reinterpret_cast<void**>(&src), &size);
+  err = Dart_TypedDataAcquireData(dictionary_obj, &type,
+                                  reinterpret_cast<void**>(&src), &size);
   if (!Dart_IsError(err)) {
     memmove(result, src, size);
     Dart_TypedDataReleaseData(dictionary_obj);
@@ -99,13 +99,13 @@
       static_cast<int32_t>(window_bits), dictionary, dictionary_length, raw);
   if (filter == NULL) {
     delete[] dictionary;
-    Dart_PropagateError(Dart_NewApiError(
-        "Could not allocate ZLibInflateFilter"));
+    Dart_PropagateError(
+        Dart_NewApiError("Could not allocate ZLibInflateFilter"));
   }
   if (!filter->Init()) {
     delete filter;
-    Dart_ThrowException(DartUtils::NewInternalError(
-        "Failed to create ZLibInflateFilter"));
+    Dart_ThrowException(
+        DartUtils::NewInternalError("Failed to create ZLibInflateFilter"));
   }
   err = Filter::SetFilterAndCreateFinalizer(
       filter_obj, filter, sizeof(*filter) + dictionary_length);
@@ -121,8 +121,8 @@
   Dart_Handle gzip_obj = Dart_GetNativeArgument(args, 1);
   bool gzip = DartUtils::GetBooleanValue(gzip_obj);
   Dart_Handle level_obj = Dart_GetNativeArgument(args, 2);
-  int64_t level = DartUtils::GetInt64ValueCheckRange(level_obj, kMinInt32,
-      kMaxInt32);
+  int64_t level =
+      DartUtils::GetInt64ValueCheckRange(level_obj, kMinInt32, kMaxInt32);
   Dart_Handle window_bits_obj = Dart_GetNativeArgument(args, 3);
   int64_t window_bits = DartUtils::GetIntegerValue(window_bits_obj);
   Dart_Handle mLevel_obj = Dart_GetNativeArgument(args, 4);
@@ -151,21 +151,18 @@
   }
 
   ZLibDeflateFilter* filter = new ZLibDeflateFilter(
-      gzip,
-      static_cast<int32_t>(level),
-      static_cast<int32_t>(window_bits),
-      static_cast<int32_t>(mem_level),
-      static_cast<int32_t>(strategy),
+      gzip, static_cast<int32_t>(level), static_cast<int32_t>(window_bits),
+      static_cast<int32_t>(mem_level), static_cast<int32_t>(strategy),
       dictionary, dictionary_length, raw);
   if (filter == NULL) {
     delete[] dictionary;
-    Dart_PropagateError(Dart_NewApiError(
-        "Could not allocate ZLibDeflateFilter"));
+    Dart_PropagateError(
+        Dart_NewApiError("Could not allocate ZLibDeflateFilter"));
   }
   if (!filter->Init()) {
     delete filter;
-    Dart_ThrowException(DartUtils::NewInternalError(
-        "Failed to create ZLibDeflateFilter"));
+    Dart_ThrowException(
+        DartUtils::NewInternalError("Failed to create ZLibDeflateFilter"));
   }
   Dart_Handle result = Filter::SetFilterAndCreateFinalizer(
       filter_obj, filter, sizeof(*filter) + dictionary_length);
@@ -247,13 +244,10 @@
     Dart_PropagateError(err);
   }
 
-  intptr_t read = filter->Processed(filter->processed_buffer(),
-                                    filter->processed_buffer_size(),
-                                    flush,
-                                    end);
+  intptr_t read = filter->Processed(
+      filter->processed_buffer(), filter->processed_buffer_size(), flush, end);
   if (read < 0) {
-    Dart_ThrowException(DartUtils::NewInternalError(
-        "Filter error, bad data"));
+    Dart_ThrowException(DartUtils::NewInternalError("Filter error, bad data"));
   } else if (read == 0) {
     Dart_SetReturnValue(args, Dart_Null());
   } else {
@@ -265,10 +259,9 @@
 }
 
 
-static void DeleteFilter(
-    void* isolate_data,
-    Dart_WeakPersistentHandle handle,
-    void* filter_pointer) {
+static void DeleteFilter(void* isolate_data,
+                         Dart_WeakPersistentHandle handle,
+                         void* filter_pointer) {
   Filter* filter = reinterpret_cast<Filter*>(filter_pointer);
   delete filter;
 }
@@ -277,17 +270,14 @@
 Dart_Handle Filter::SetFilterAndCreateFinalizer(Dart_Handle filter,
                                                 Filter* filter_pointer,
                                                 intptr_t size) {
-  Dart_Handle err = Dart_SetNativeInstanceField(
-      filter,
-      kFilterPointerNativeField,
-      reinterpret_cast<intptr_t>(filter_pointer));
+  Dart_Handle err =
+      Dart_SetNativeInstanceField(filter, kFilterPointerNativeField,
+                                  reinterpret_cast<intptr_t>(filter_pointer));
   if (Dart_IsError(err)) {
     return err;
   }
-  Dart_NewWeakPersistentHandle(filter,
-                               reinterpret_cast<void*>(filter_pointer),
-                               size,
-                               DeleteFilter);
+  Dart_NewWeakPersistentHandle(filter, reinterpret_cast<void*>(filter_pointer),
+                               size, DeleteFilter);
   return err;
 }
 
@@ -295,8 +285,7 @@
 Dart_Handle Filter::GetFilterNativeField(Dart_Handle filter,
                                          Filter** filter_pointer) {
   return Dart_GetNativeInstanceField(
-      filter,
-      kFilterPointerNativeField,
+      filter, kFilterPointerNativeField,
       reinterpret_cast<intptr_t*>(filter_pointer));
 }
 
@@ -355,8 +344,8 @@
   stream_.avail_out = length;
   stream_.next_out = buffer;
   bool error = false;
-  switch (deflate(&stream_,
-                  end ? Z_FINISH : flush ? Z_SYNC_FLUSH : Z_NO_FLUSH)) {
+  switch (
+      deflate(&stream_, end ? Z_FINISH : flush ? Z_SYNC_FLUSH : Z_NO_FLUSH)) {
     case Z_STREAM_END:
     case Z_BUF_ERROR:
     case Z_OK: {
@@ -369,7 +358,7 @@
 
     default:
     case Z_STREAM_ERROR:
-        error = true;
+      error = true;
   }
 
   delete[] current_buffer_;
@@ -389,9 +378,8 @@
 
 
 bool ZLibInflateFilter::Init() {
-  int window_bits = raw_ ?
-      -window_bits_ :
-      window_bits_ | kZLibFlagAcceptAnyHeader;
+  int window_bits =
+      raw_ ? -window_bits_ : window_bits_ | kZLibFlagAcceptAnyHeader;
 
   stream_.next_in = Z_NULL;
   stream_.avail_in = 0;
@@ -426,7 +414,7 @@
   bool error = false;
   int v;
   switch (v = inflate(&stream_,
-                  end ? Z_FINISH : flush ? Z_SYNC_FLUSH : Z_NO_FLUSH)) {
+                      end ? Z_FINISH : flush ? Z_SYNC_FLUSH : Z_NO_FLUSH)) {
     case Z_STREAM_END:
     case Z_BUF_ERROR:
     case Z_OK: {
@@ -441,8 +429,8 @@
       if (dictionary_ == NULL) {
         error = true;
       } else {
-        int result = inflateSetDictionary(&stream_, dictionary_,
-                                          dictionary_length_);
+        int result =
+            inflateSetDictionary(&stream_, dictionary_, dictionary_length_);
         delete[] dictionary_;
         dictionary_ = NULL;
         error = result != Z_OK;
diff --git a/runtime/bin/filter.h b/runtime/bin/filter.h
index 28c229f..9239d56 100644
--- a/runtime/bin/filter.h
+++ b/runtime/bin/filter.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_FILTER_H_
-#define BIN_FILTER_H_
+#ifndef RUNTIME_BIN_FILTER_H_
+#define RUNTIME_BIN_FILTER_H_
 
 #if defined(DART_IO_DISABLED)
 #error "filter.h can only be included on builds with IO enabled"
@@ -29,7 +29,9 @@
    * a delete[] call.
    */
   virtual bool Process(uint8_t* data, intptr_t length) = 0;
-  virtual intptr_t Processed(uint8_t* buffer, intptr_t length, bool finish,
+  virtual intptr_t Processed(uint8_t* buffer,
+                             intptr_t length,
+                             bool finish,
                              bool end) = 0;
 
   static Dart_Handle SetFilterAndCreateFinalizer(Dart_Handle filter,
@@ -56,18 +58,30 @@
 
 class ZLibDeflateFilter : public Filter {
  public:
-  ZLibDeflateFilter(bool gzip, int32_t level, int32_t window_bits,
-                    int32_t mem_level, int32_t strategy,
-                    uint8_t* dictionary, intptr_t dictionary_length, bool raw)
-      : gzip_(gzip), level_(level), window_bits_(window_bits),
-        mem_level_(mem_level), strategy_(strategy), dictionary_(dictionary),
-        dictionary_length_(dictionary_length), raw_(raw), current_buffer_(NULL)
-    {}
+  ZLibDeflateFilter(bool gzip,
+                    int32_t level,
+                    int32_t window_bits,
+                    int32_t mem_level,
+                    int32_t strategy,
+                    uint8_t* dictionary,
+                    intptr_t dictionary_length,
+                    bool raw)
+      : gzip_(gzip),
+        level_(level),
+        window_bits_(window_bits),
+        mem_level_(mem_level),
+        strategy_(strategy),
+        dictionary_(dictionary),
+        dictionary_length_(dictionary_length),
+        raw_(raw),
+        current_buffer_(NULL) {}
   virtual ~ZLibDeflateFilter();
 
   virtual bool Init();
   virtual bool Process(uint8_t* data, intptr_t length);
-  virtual intptr_t Processed(uint8_t* buffer, intptr_t length, bool finish,
+  virtual intptr_t Processed(uint8_t* buffer,
+                             intptr_t length,
+                             bool finish,
                              bool end);
 
  private:
@@ -87,16 +101,22 @@
 
 class ZLibInflateFilter : public Filter {
  public:
-  ZLibInflateFilter(int32_t window_bits, uint8_t* dictionary,
-                    intptr_t dictionary_length, bool raw)
-      : window_bits_(window_bits), dictionary_(dictionary),
-        dictionary_length_(dictionary_length), raw_(raw), current_buffer_(NULL)
-    {}
+  ZLibInflateFilter(int32_t window_bits,
+                    uint8_t* dictionary,
+                    intptr_t dictionary_length,
+                    bool raw)
+      : window_bits_(window_bits),
+        dictionary_(dictionary),
+        dictionary_length_(dictionary_length),
+        raw_(raw),
+        current_buffer_(NULL) {}
   virtual ~ZLibInflateFilter();
 
   virtual bool Init();
   virtual bool Process(uint8_t* data, intptr_t length);
-  virtual intptr_t Processed(uint8_t* buffer, intptr_t length, bool finish,
+  virtual intptr_t Processed(uint8_t* buffer,
+                             intptr_t length,
+                             bool finish,
                              bool end);
 
  private:
@@ -113,4 +133,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_FILTER_H_
+#endif  // RUNTIME_BIN_FILTER_H_
diff --git a/runtime/bin/filter_unsupported.cc b/runtime/bin/filter_unsupported.cc
index 37d7b6f..d330393 100644
--- a/runtime/bin/filter_unsupported.cc
+++ b/runtime/bin/filter_unsupported.cc
@@ -13,25 +13,25 @@
 
 void FUNCTION_NAME(Filter_CreateZLibInflate)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "ZLibInflater and Deflater not supported on this platform"));
+      "ZLibInflater and Deflater not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Filter_CreateZLibDeflate)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "ZLibInflater and Deflater not supported on this platform"));
+      "ZLibInflater and Deflater not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Filter_Process)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "ZLibInflater and Deflater not supported on this platform"));
+      "ZLibInflater and Deflater not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Filter_Processed)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "ZLibInflater and Deflater not supported on this platform"));
+      "ZLibInflater and Deflater not supported on this platform"));
 }
 
 }  // namespace bin
diff --git a/runtime/bin/gen_snapshot.cc b/runtime/bin/gen_snapshot.cc
index 319a322..e18f2f5 100644
--- a/runtime/bin/gen_snapshot.cc
+++ b/runtime/bin/gen_snapshot.cc
@@ -22,6 +22,7 @@
 #include "bin/vmservice_impl.h"
 
 #include "include/dart_api.h"
+#include "include/dart_tools_api.h"
 
 #include "platform/hashmap.h"
 #include "platform/globals.h"
@@ -140,8 +141,8 @@
     name[name_len] = '\0';
     value = strdup(equals_pos + 1);
   }
-  HashMap::Entry* entry = environment->Lookup(
-      GetHashmapKeyFromString(name), HashMap::StringHash(name), true);
+  HashMap::Entry* entry = environment->Lookup(GetHashmapKeyFromString(name),
+                                              HashMap::StringHash(name), true);
   ASSERT(entry != NULL);  // Lookup adds an entry if key not found.
   entry->value = value;
   return true;
@@ -162,10 +163,9 @@
     name_chars[utf8_len] = '\0';
     const char* value = NULL;
     if (environment != NULL) {
-      HashMap::Entry* entry = environment->Lookup(
-          GetHashmapKeyFromString(name_chars),
-          HashMap::StringHash(name_chars),
-          false);
+      HashMap::Entry* entry =
+          environment->Lookup(GetHashmapKeyFromString(name_chars),
+                              HashMap::StringHash(name_chars), false);
       if (entry != NULL) {
         value = reinterpret_cast<char*>(entry->value);
       }
@@ -180,7 +180,6 @@
 }
 
 
-
 static const char* ProcessOption(const char* option, const char* name) {
   const intptr_t length = strlen(name);
   if (strncmp(option, name, length) == 0) {
@@ -311,10 +310,8 @@
         ProcessInstructionsBlobOption(argv[i]) ||
         ProcessRodataBlobOption(argv[i]) ||
         ProcessEmbedderEntryPointsManifestOption(argv[i]) ||
-        ProcessURLmappingOption(argv[i]) ||
-        ProcessPackageRootOption(argv[i]) ||
-        ProcessPackagesOption(argv[i]) ||
-        ProcessEnvironmentOption(argv[i])) {
+        ProcessURLmappingOption(argv[i]) || ProcessPackageRootOption(argv[i]) ||
+        ProcessPackagesOption(argv[i]) || ProcessEnvironmentOption(argv[i])) {
       i += 1;
       continue;
     }
@@ -333,8 +330,9 @@
   // Verify consistency of arguments.
   if ((commandline_package_root != NULL) &&
       (commandline_packages_file != NULL)) {
-    Log::PrintErr("Specifying both a packages directory and a packages "
-                  "file is invalid.\n");
+    Log::PrintErr(
+        "Specifying both a packages directory and a packages "
+        "file is invalid.\n");
     return -1;
   }
 
@@ -349,25 +347,24 @@
   }
 
   bool precompiled_as_assembly = assembly_filename != NULL;
-  bool precompiled_as_blobs = (instructions_blob_filename != NULL) ||
-                              (rodata_blob_filename != NULL);
+  bool precompiled_as_blobs =
+      (instructions_blob_filename != NULL) || (rodata_blob_filename != NULL);
   if (precompiled_as_assembly && precompiled_as_blobs) {
     Log::PrintErr(
-      "Cannot request a precompiled snapshot simultaneously as "
-      "assembly (--assembly=<output.file>) and as blobs "
-      "(--instructions-blob=<output.file> and "
-      "--rodata-blob=<output.file>)\n\n");
+        "Cannot request a precompiled snapshot simultaneously as "
+        "assembly (--assembly=<output.file>) and as blobs "
+        "(--instructions-blob=<output.file> and "
+        "--rodata-blob=<output.file>)\n\n");
     return -1;
   }
   if ((instructions_blob_filename != NULL) != (rodata_blob_filename != NULL)) {
     Log::PrintErr(
-      "Requesting a precompiled snapshot as blobs requires both "
-      "(--instructions-blob=<output.file> and "
-      "--rodata-blob=<output.file>)\n\n");
+        "Requesting a precompiled snapshot as blobs requires both "
+        "(--instructions-blob=<output.file> and "
+        "--rodata-blob=<output.file>)\n\n");
     return -1;
   }
-  if (IsSnapshottingForPrecompilation() &&
-      (entry_points_files->count() == 0)) {
+  if (IsSnapshottingForPrecompilation() && (entry_points_files->count() == 0)) {
     Log::PrintErr(
         "Specifying an instructions snapshot filename indicates precompilation"
         ". But no embedder entry points manifest was specified.\n\n");
@@ -382,7 +379,12 @@
                               const uint8_t* buffer,
                               const intptr_t size) {
   File* file = File::Open(filename, File::kWriteTruncate);
-  ASSERT(file != NULL);
+  if (file == NULL) {
+    Log::PrintErr("Error: Unable to write snapshot file: %s\n\n", filename);
+    Dart_ExitScope();
+    Dart_ShutdownIsolate();
+    exit(kErrorExitCode);
+  }
   if (!file->WriteFully(buffer, size)) {
     Log::PrintErr("Error: Failed to write snapshot file.\n\n");
   }
@@ -429,9 +431,8 @@
     UriResolverIsolateScope scope;
 
     Dart_Handle resolved_uri = Dart_NewStringFromCString(uri_string);
-    Dart_Handle result =  Loader::LoadUrlContents(resolved_uri,
-                                                  &payload,
-                                                  &payload_length);
+    Dart_Handle result =
+        Loader::LoadUrlContents(resolved_uri, &payload, &payload_length);
     if (Dart_IsError(result)) {
       failed = true;
       result_string = strdup(Dart_GetError(result));
@@ -470,8 +471,8 @@
     }
   }
 
-  Dart_Handle result = failed ? Dart_NewApiError(result_string) :
-                                DartUtils::NewString(result_string);
+  Dart_Handle result = failed ? Dart_NewApiError(result_string)
+                              : DartUtils::NewString(result_string);
   free(result_string);
   return result;
 }
@@ -486,7 +487,8 @@
   }
   // Now load the contents of the specified uri.
   const char* resolved_uri_string = DartUtils::GetStringValue(resolved_uri);
-  Dart_Handle source =  LoadUrlContents(resolved_uri_string);
+  Dart_Handle source = LoadUrlContents(resolved_uri_string);
+
   if (Dart_IsError(source)) {
     return source;
   }
@@ -520,8 +522,8 @@
     return Dart_NewApiError("accessing library url failed");
   }
   const char* library_url_string = DartUtils::GetStringValue(library_url);
-  const char* mapped_library_url_string = DartUtils::MapLibraryUrl(
-      library_url_string);
+  const char* mapped_library_url_string =
+      DartUtils::MapLibraryUrl(library_url_string);
   if (mapped_library_url_string != NULL) {
     library_url = ResolveUriInWorkingDirectory(mapped_library_url_string);
     library_url_string = DartUtils::GetStringValue(library_url);
@@ -559,7 +561,8 @@
     // Special case for parting sources of a builtin library.
     if (tag == Dart_kSourceTag) {
       return Dart_LoadSource(library, url, Dart_Null(),
-          Builtin::PartSource(libraryBuiltinId, url_string), 0, 0);
+                             Builtin::PartSource(libraryBuiltinId, url_string),
+                             0, 0);
     }
     ASSERT(tag == Dart_kImportTag);
     return DartUtils::NewError("Unable to import '%s' ", url_string);
@@ -574,7 +577,7 @@
     }
   }
   const char* resolved_uri_string = DartUtils::GetStringValue(resolved_url);
-  Dart_Handle source =  LoadUrlContents(resolved_uri_string);
+  Dart_Handle source = LoadUrlContents(resolved_uri_string);
   if (Dart_IsError(source)) {
     return source;
   }
@@ -602,6 +605,7 @@
 }
 
 
+// clang-format off
 static void PrintUsage() {
   Log::PrintErr(
 "Usage:                                                                      \n"
@@ -663,6 +667,7 @@
 "                                      points into Dart code from the C API. \n"
 "\n");
 }
+// clang-format on
 
 
 static void VerifyLoaded(Dart_Handle library) {
@@ -680,7 +685,8 @@
 
 void StubNativeFunction(Dart_NativeArguments arguments) {
   // This is a stub function for the resolver
-  UNREACHABLE();
+  Dart_SetReturnValue(
+      arguments, Dart_NewApiError("<EMBEDDER DID NOT SETUP NATIVE RESOLVER>"));
 }
 
 
@@ -692,7 +698,7 @@
 
 
 static const uint8_t* StubNativeSymbol(Dart_NativeFunction nf) {
-  return reinterpret_cast<const uint8_t *>(StubNativeFunctionName);
+  return reinterpret_cast<const uint8_t*>(StubNativeFunctionName);
 }
 
 
@@ -709,20 +715,15 @@
     static const uint32_t kLoadBufferMaxSize = 128;
     char* load_buffer =
         reinterpret_cast<char*>(calloc(kLoadBufferMaxSize, sizeof(char)));
-    snprintf(load_buffer,
-             kLoadBufferMaxSize,
-             "import '%s';",
+    snprintf(load_buffer, kLoadBufferMaxSize, "import '%s';",
              DartUtils::GetStringValue(library_string));
     Dart_Handle script_handle = Dart_NewStringFromCString(load_buffer);
     memset(load_buffer, 0, kLoadBufferMaxSize);
-    snprintf(load_buffer,
-             kLoadBufferMaxSize,
-             "dart:_snapshot_%zu",
-             lib_index);
+    snprintf(load_buffer, kLoadBufferMaxSize, "dart:_snapshot_%zu", lib_index);
     Dart_Handle script_url = Dart_NewStringFromCString(load_buffer);
     free(load_buffer);
-    Dart_Handle loaded = Dart_LoadLibrary(script_url, Dart_Null(),
-                                          script_handle, 0, 0);
+    Dart_Handle loaded =
+        Dart_LoadLibrary(script_url, Dart_Null(), script_handle, 0, 0);
     DART_CHECK_VALID(loaded);
 
     // Do a fresh lookup
@@ -730,13 +731,33 @@
   }
 
   DART_CHECK_VALID(library);
-  Dart_Handle result =  Dart_SetNativeResolver(library,
-                                               &StubNativeLookup,
-                                               &StubNativeSymbol);
+  Dart_Handle result =
+      Dart_SetNativeResolver(library, &StubNativeLookup, &StubNativeSymbol);
   DART_CHECK_VALID(result);
 }
 
 
+// Iterate over all libraries and setup the stub native lookup. This must be
+// run after |SetupStubNativeResolversForPrecompilation| because the former
+// loads some libraries.
+static void SetupStubNativeResolvers() {
+  Dart_Handle libraries = Dart_GetLoadedLibraries();
+  intptr_t libraries_length;
+  Dart_ListLength(libraries, &libraries_length);
+  for (intptr_t i = 0; i < libraries_length; i++) {
+    Dart_Handle library = Dart_ListGetAt(libraries, i);
+    DART_CHECK_VALID(library);
+    Dart_NativeEntryResolver old_resolver = NULL;
+    Dart_GetNativeResolver(library, &old_resolver);
+    if (old_resolver == NULL) {
+      Dart_Handle result =
+          Dart_SetNativeResolver(library, &StubNativeLookup, &StubNativeSymbol);
+      DART_CHECK_VALID(result);
+    }
+  }
+}
+
+
 static void ImportNativeEntryPointLibrariesIntoRoot(
     const Dart_QualifiedFunctionName* entries) {
   if (entries == NULL) {
@@ -762,7 +783,6 @@
 
 static void SetupStubNativeResolversForPrecompilation(
     const Dart_QualifiedFunctionName* entries) {
-
   if (entries == NULL) {
     return;
   }
@@ -781,7 +801,7 @@
 }
 
 
-static void CleanupEntryPointItem(const Dart_QualifiedFunctionName *entry) {
+static void CleanupEntryPointItem(const Dart_QualifiedFunctionName* entry) {
   if (entry == NULL) {
     return;
   }
@@ -842,7 +862,9 @@
 
 
 static bool ParseEntryPointsManifestSingleLine(
-    const char* line, Dart_QualifiedFunctionName* entry, char** error) {
+    const char* line,
+    Dart_QualifiedFunctionName* entry,
+    char** error) {
   bool success = true;
   size_t offset = 0;
   for (uint8_t i = 0; i < 3; i++) {
@@ -996,7 +1018,7 @@
   if ((entries == NULL) && IsSnapshottingForPrecompilation()) {
     Log::PrintErr(
         "Could not find native embedder entry points during precompilation\n");
-    exit(255);
+    exit(kErrorExitCode);
   }
   return entries;
 }
@@ -1011,20 +1033,15 @@
   intptr_t isolate_size = 0;
 
   // First create a snapshot.
-  result = Dart_CreateSnapshot(&vm_isolate_buffer,
-                               &vm_isolate_size,
-                               &isolate_buffer,
-                               &isolate_size);
+  result = Dart_CreateSnapshot(&vm_isolate_buffer, &vm_isolate_size,
+                               &isolate_buffer, &isolate_size);
   CHECK_RESULT(result);
 
   // Now write the vm isolate and isolate snapshots out to the
   // specified file and exit.
-  WriteSnapshotFile(vm_isolate_snapshot_filename,
-                    vm_isolate_buffer,
+  WriteSnapshotFile(vm_isolate_snapshot_filename, vm_isolate_buffer,
                     vm_isolate_size);
-  WriteSnapshotFile(isolate_snapshot_filename,
-                    isolate_buffer,
-                    isolate_size);
+  WriteSnapshotFile(isolate_snapshot_filename, isolate_buffer, isolate_size);
   Dart_ExitScope();
 
   // Shutdown the isolate.
@@ -1036,16 +1053,6 @@
     Dart_QualifiedFunctionName* standalone_entry_points) {
   ASSERT(IsSnapshottingForPrecompilation());
   Dart_Handle result;
-  uint8_t* vm_isolate_buffer = NULL;
-  intptr_t vm_isolate_size = 0;
-  uint8_t* isolate_buffer = NULL;
-  intptr_t isolate_size = 0;
-  uint8_t* assembly_buffer = NULL;
-  intptr_t assembly_size = 0;
-  uint8_t* instructions_blob_buffer = NULL;
-  intptr_t instructions_blob_size = 0;
-  uint8_t* rodata_blob_buffer = NULL;
-  intptr_t rodata_blob_size = 0;
 
   // Precompile with specified embedder entry points
   result = Dart_Precompile(standalone_entry_points, true);
@@ -1054,44 +1061,35 @@
   // Create a precompiled snapshot.
   bool as_assembly = assembly_filename != NULL;
   if (as_assembly) {
-    result = Dart_CreatePrecompiledSnapshotAssembly(&vm_isolate_buffer,
-                                                    &vm_isolate_size,
-                                                    &isolate_buffer,
-                                                    &isolate_size,
-                                                    &assembly_buffer,
+    uint8_t* assembly_buffer = NULL;
+    intptr_t assembly_size = 0;
+    result = Dart_CreatePrecompiledSnapshotAssembly(&assembly_buffer,
                                                     &assembly_size);
     CHECK_RESULT(result);
+    WriteSnapshotFile(assembly_filename, assembly_buffer, assembly_size);
   } else {
-    result = Dart_CreatePrecompiledSnapshotBlob(&vm_isolate_buffer,
-                                                &vm_isolate_size,
-                                                &isolate_buffer,
-                                                &isolate_size,
-                                                &instructions_blob_buffer,
-                                                &instructions_blob_size,
-                                                &rodata_blob_buffer,
-                                                &rodata_blob_size);
+    uint8_t* vm_isolate_buffer = NULL;
+    intptr_t vm_isolate_size = 0;
+    uint8_t* isolate_buffer = NULL;
+    intptr_t isolate_size = 0;
+    uint8_t* instructions_blob_buffer = NULL;
+    intptr_t instructions_blob_size = 0;
+    uint8_t* rodata_blob_buffer = NULL;
+    intptr_t rodata_blob_size = 0;
+    result = Dart_CreatePrecompiledSnapshotBlob(
+        &vm_isolate_buffer, &vm_isolate_size, &isolate_buffer, &isolate_size,
+        &instructions_blob_buffer, &instructions_blob_size, &rodata_blob_buffer,
+        &rodata_blob_size);
     CHECK_RESULT(result);
-  }
-
-  // Now write the snapshot pieces out to the specified files and exit.
-  WriteSnapshotFile(vm_isolate_snapshot_filename,
-                    vm_isolate_buffer,
-                    vm_isolate_size);
-  WriteSnapshotFile(isolate_snapshot_filename,
-                    isolate_buffer,
-                    isolate_size);
-  if (as_assembly) {
-    WriteSnapshotFile(assembly_filename,
-                      assembly_buffer,
-                      assembly_size);
-  } else {
-    WriteSnapshotFile(instructions_blob_filename,
-                      instructions_blob_buffer,
+    WriteSnapshotFile(vm_isolate_snapshot_filename, vm_isolate_buffer,
+                      vm_isolate_size);
+    WriteSnapshotFile(isolate_snapshot_filename, isolate_buffer, isolate_size);
+    WriteSnapshotFile(instructions_blob_filename, instructions_blob_buffer,
                       instructions_blob_size);
-    WriteSnapshotFile(rodata_blob_filename,
-                      rodata_blob_buffer,
+    WriteSnapshotFile(rodata_blob_filename, rodata_blob_buffer,
                       rodata_blob_size);
   }
+
   Dart_ExitScope();
 
   // Shutdown the isolate.
@@ -1106,7 +1104,7 @@
     Log::PrintErr("%s", Dart_GetError(result));
     Dart_ExitScope();
     Dart_ShutdownIsolate();
-    exit(255);
+    exit(kErrorExitCode);
   }
   // This is a generic dart snapshot which needs builtin library setup.
   Dart_Handle library =
@@ -1126,7 +1124,7 @@
     Log::PrintErr("Errors encountered while loading: %s\n", err_msg);
     Dart_ExitScope();
     Dart_ShutdownIsolate();
-    exit(255);
+    exit(kErrorExitCode);
   }
 }
 
@@ -1138,16 +1136,11 @@
                                          Dart_IsolateFlags* flags,
                                          void* data,
                                          char** error) {
-  IsolateData* isolate_data = new IsolateData(script_uri,
-                                              package_root,
-                                              package_config);
+  IsolateData* isolate_data =
+      new IsolateData(script_uri, package_root, package_config);
   Dart_Isolate isolate = NULL;
-  isolate = Dart_CreateIsolate(script_uri,
-                               main,
-                               NULL,
-                               NULL,
-                               isolate_data,
-                               error);
+  isolate =
+      Dart_CreateIsolate(script_uri, main, NULL, NULL, isolate_data, error);
 
   if (isolate == NULL) {
     Log::PrintErr("Error: Could not create service isolate");
@@ -1170,9 +1163,7 @@
   CHECK_RESULT(result);
   ASSERT(Dart_IsServiceIsolate(isolate));
   // Load embedder specific bits and return. Will not start http server.
-  if (!VmService::Setup("127.0.0.1",
-                        -1,
-                        false /* running_precompiled */,
+  if (!VmService::Setup("127.0.0.1", -1, false /* running_precompiled */,
                         false /* server dev mode */)) {
     *error = strdup(VmService::GetErrorMessage());
     return NULL;
@@ -1196,12 +1187,9 @@
   entry_points_files = &entry_points_files_array;
 
   // Parse command line arguments.
-  if (ParseArguments(argc,
-                     argv,
-                     &vm_options,
-                     &app_script_name) < 0) {
+  if (ParseArguments(argc, argv, &vm_options, &app_script_name) < 0) {
     PrintUsage();
-    return 255;
+    return kErrorExitCode;
   }
 
   Thread::InitOnce();
@@ -1218,6 +1206,7 @@
 
   if (IsSnapshottingForPrecompilation()) {
     vm_options.AddArgument("--precompilation");
+    vm_options.AddArgument("--print_snapshot_sizes");
 #if TARGET_ARCH_ARM
     // This is for the iPod Touch 5th Generation (and maybe other older devices)
     vm_options.AddArgument("--no-use_integer_division");
@@ -1248,18 +1237,17 @@
   if (error != NULL) {
     Log::PrintErr("VM initialization failed: %s\n", error);
     free(error);
-    return 255;
+    return kErrorExitCode;
   }
 
-  IsolateData* isolate_data = new IsolateData(NULL,
-                                              commandline_package_root,
+  IsolateData* isolate_data = new IsolateData(NULL, commandline_package_root,
                                               commandline_packages_file);
-  Dart_Isolate isolate = Dart_CreateIsolate(
-      NULL, NULL, NULL, NULL, isolate_data, &error);
+  Dart_Isolate isolate =
+      Dart_CreateIsolate(NULL, NULL, NULL, NULL, isolate_data, &error);
   if (isolate == NULL) {
     Log::PrintErr("Error: %s", error);
     free(error);
-    exit(255);
+    exit(kErrorExitCode);
   }
 
   Dart_Handle result;
@@ -1302,11 +1290,26 @@
     // Now we create an isolate into which we load all the code that needs to
     // be in the snapshot.
     isolate_data = new IsolateData(NULL, NULL, NULL);
-    if (Dart_CreateIsolate(
-            NULL, NULL, NULL, NULL, isolate_data, &error) == NULL) {
-      fprintf(stderr, "%s", error);
+    const uint8_t* kernel = NULL;
+    intptr_t kernel_length = 0;
+    const bool is_kernel_file =
+        TryReadKernel(app_script_name, &kernel, &kernel_length);
+
+    void* kernel_program = NULL;
+    if (is_kernel_file) {
+      kernel_program = Dart_ReadKernelBinary(kernel, kernel_length);
+      free(const_cast<uint8_t*>(kernel));
+    }
+
+    Dart_Isolate isolate =
+        is_kernel_file
+            ? Dart_CreateIsolateFromKernel(NULL, NULL, kernel_program, NULL,
+                                           isolate_data, &error)
+            : Dart_CreateIsolate(NULL, NULL, NULL, NULL, isolate_data, &error);
+    if (isolate == NULL) {
+      Log::PrintErr("%s", error);
       free(error);
-      exit(255);
+      exit(kErrorExitCode);
     }
     Dart_EnterScope();
     result = Dart_SetEnvironmentCallback(EnvironmentCallback);
@@ -1320,13 +1323,27 @@
     Dart_QualifiedFunctionName* entry_points =
         ParseEntryPointsManifestIfPresent();
 
+    if (is_kernel_file) {
+      Dart_Handle library = Dart_LoadKernel(kernel_program);
+      if (Dart_IsError(library)) FATAL("Failed to load app from Kernel IR");
+    } else {
+      // Set up the library tag handler in such a manner that it will use the
+      // URL mapping specified on the command line to load the libraries.
+      result = Dart_SetLibraryTagHandler(CreateSnapshotLibraryTagHandler);
+      CHECK_RESULT(result);
+    }
+
     SetupStubNativeResolversForPrecompilation(entry_points);
 
-    // Load the specified script.
-    library = LoadSnapshotCreationScript(app_script_name);
-    VerifyLoaded(library);
+    SetupStubNativeResolvers();
 
-    ImportNativeEntryPointLibrariesIntoRoot(entry_points);
+    if (!is_kernel_file) {
+      // Load the specified script.
+      library = LoadSnapshotCreationScript(app_script_name);
+      VerifyLoaded(library);
+
+      ImportNativeEntryPointLibrariesIntoRoot(entry_points);
+    }
 
     // Ensure that we mark all libraries as loaded.
     result = Dart_FinalizeLoading(false);
diff --git a/runtime/bin/gypi_contents.gni b/runtime/bin/gypi_contents.gni
new file mode 100644
index 0000000..34fc269
--- /dev/null
+++ b/runtime/bin/gypi_contents.gni
@@ -0,0 +1,43 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+_gypi_files = [
+  "builtin_sources.gypi",
+  "builtin_impl_sources.gypi",
+  "vmservice/vmservice_sources.gypi",
+  "io_sources.gypi",
+  "io_impl_sources.gypi",
+]
+
+_gypi_contents = exec_script("../../tools/gypi_to_gn.py",
+                             rebase_path(_gypi_files) + [ "--prefix" ],
+                             "scope",
+                             _gypi_files)
+
+resources_sources_gypi = _gypi_contents.vmservice_sources_sources
+
+builtin_sources_gypi = _gypi_contents.builtin_sources_sources
+builtin_impl_sources_gypi = _gypi_contents.builtin_impl_sources_sources
+
+io_sources_gypi = _gypi_contents.io_sources_sources
+io_impl_sources_gypi = _gypi_contents.io_impl_sources_sources
+
+_test_gypi_files = [
+  "../vm/vm_sources.gypi",
+  "builtin_impl_sources.gypi",
+]
+
+_test_only_gypi_contents = exec_script("../../tools/gypi_to_gn.py",
+                                       rebase_path(_test_gypi_files) + [
+                                             "--keep_only=_test.cc",
+                                             "--keep_only=_test.h",
+                                             "--prefix",
+                                           ],
+                                       "scope",
+                                       _test_gypi_files)
+
+# The VM sources are already included in libdart, so we just want to add in
+# the tests here.
+vm_tests_list = _test_only_gypi_contents.vm_sources_sources
+builtin_impl_tests_list = _test_only_gypi_contents.builtin_impl_sources_sources
diff --git a/runtime/bin/hashmap_test.cc b/runtime/bin/hashmap_test.cc
index 3a74138..47849e0 100644
--- a/runtime/bin/hashmap_test.cc
+++ b/runtime/bin/hashmap_test.cc
@@ -19,7 +19,7 @@
 class IntSet {
  public:
   explicit IntSet(IntKeyHash hash)
-      : hash_(hash), map_(HashMap::SamePointerValue, kInitialSize)  {}
+      : hash_(hash), map_(HashMap::SamePointerValue, kInitialSize) {}
 
   void Insert(int x) {
     EXPECT_NE(0, x);  // 0 corresponds to (void*)NULL - illegal key value
@@ -43,9 +43,7 @@
     return p != NULL;
   }
 
-  void Clear() {
-    map_.Clear();
-  }
+  void Clear() { map_.Clear(); }
 
   uint32_t occupancy() const {
     uint32_t count = 0;
@@ -62,12 +60,24 @@
 };
 
 
-static uint32_t WordHash(uint32_t key) { return dart::Utils::WordHash(key); }
-static uint32_t Hash(uint32_t key)  { return 23; }
-static uint32_t CollisionHash1(uint32_t key)  { return key & 0x3; }
-static uint32_t CollisionHash2(uint32_t key)  { return kInitialSize - 1; }
-static uint32_t CollisionHash3(uint32_t key)  { return kInitialSize - 2; }
-static uint32_t CollisionHash4(uint32_t key)  { return kInitialSize - 2; }
+static uint32_t WordHash(uint32_t key) {
+  return dart::Utils::WordHash(key);
+}
+static uint32_t Hash(uint32_t key) {
+  return 23;
+}
+static uint32_t CollisionHash1(uint32_t key) {
+  return key & 0x3;
+}
+static uint32_t CollisionHash2(uint32_t key) {
+  return kInitialSize - 1;
+}
+static uint32_t CollisionHash3(uint32_t key) {
+  return kInitialSize - 2;
+}
+static uint32_t CollisionHash4(uint32_t key) {
+  return kInitialSize - 2;
+}
 
 
 void TestSet(IntKeyHash hash, int size) {
diff --git a/runtime/bin/io_buffer.cc b/runtime/bin/io_buffer.cc
index 2317afa..3d671e0 100644
--- a/runtime/bin/io_buffer.cc
+++ b/runtime/bin/io_buffer.cc
@@ -7,10 +7,10 @@
 namespace dart {
 namespace bin {
 
-Dart_Handle IOBuffer::Allocate(intptr_t size, uint8_t **buffer) {
+Dart_Handle IOBuffer::Allocate(intptr_t size, uint8_t** buffer) {
   uint8_t* data = Allocate(size);
-  Dart_Handle result = Dart_NewExternalTypedData(
-      Dart_TypedData_kUint8, data, size);
+  Dart_Handle result =
+      Dart_NewExternalTypedData(Dart_TypedData_kUint8, data, size);
   Dart_NewWeakPersistentHandle(result, data, size, IOBuffer::Finalizer);
 
   if (Dart_IsError(result)) {
diff --git a/runtime/bin/io_buffer.h b/runtime/bin/io_buffer.h
index fe38932..066a2b9 100644
--- a/runtime/bin/io_buffer.h
+++ b/runtime/bin/io_buffer.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_IO_BUFFER_H_
-#define BIN_IO_BUFFER_H_
+#ifndef RUNTIME_BIN_IO_BUFFER_H_
+#define RUNTIME_BIN_IO_BUFFER_H_
 
 #include "include/dart_api.h"
 #include "platform/globals.h"
@@ -15,7 +15,7 @@
  public:
   // Allocate an IO buffer dart object (of type Uint8List) backed by
   // an external byte array.
-  static Dart_Handle Allocate(intptr_t size, uint8_t **buffer);
+  static Dart_Handle Allocate(intptr_t size, uint8_t** buffer);
 
   // Allocate IO buffer storage.
   static uint8_t* Allocate(intptr_t size);
@@ -41,4 +41,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_IO_BUFFER_H_
+#endif  // RUNTIME_BIN_IO_BUFFER_H_
diff --git a/runtime/bin/io_natives.cc b/runtime/bin/io_natives.cc
index 8c9c8c8..4662d82 100644
--- a/runtime/bin/io_natives.cc
+++ b/runtime/bin/io_natives.cc
@@ -157,9 +157,7 @@
   const char* name_;
   Dart_NativeFunction function_;
   int argument_count_;
-} IOEntries[] = {
-  IO_NATIVE_LIST(REGISTER_FUNCTION)
-};
+} IOEntries[] = {IO_NATIVE_LIST(REGISTER_FUNCTION)};
 
 
 Dart_NativeFunction IONativeLookup(Dart_Handle name,
diff --git a/runtime/bin/io_natives.h b/runtime/bin/io_natives.h
index c17dce5..0c64e59 100644
--- a/runtime/bin/io_natives.h
+++ b/runtime/bin/io_natives.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_IO_NATIVES_H_
-#define BIN_IO_NATIVES_H_
+#ifndef RUNTIME_BIN_IO_NATIVES_H_
+#define RUNTIME_BIN_IO_NATIVES_H_
 
 #include "include/dart_api.h"
 
@@ -19,4 +19,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_IO_NATIVES_H_
+#endif  // RUNTIME_BIN_IO_NATIVES_H_
diff --git a/runtime/bin/io_service.cc b/runtime/bin/io_service.cc
index 491fa29..2a685f1 100644
--- a/runtime/bin/io_service.cc
+++ b/runtime/bin/io_service.cc
@@ -27,24 +27,20 @@
     response = type::method##Request(data);                                    \
     break;
 
-void IOServiceCallback(Dart_Port dest_port_id,
-                       Dart_CObject* message) {
+void IOServiceCallback(Dart_Port dest_port_id, Dart_CObject* message) {
   Dart_Port reply_port_id = ILLEGAL_PORT;
   CObject* response = CObject::IllegalArgumentError();
   CObjectArray request(message);
-  if ((message->type == Dart_CObject_kArray) &&
-      (request.Length() == 4) &&
-      request[0]->IsInt32() &&
-      request[1]->IsSendPort() &&
-      request[2]->IsInt32() &&
-      request[3]->IsArray()) {
+  if ((message->type == Dart_CObject_kArray) && (request.Length() == 4) &&
+      request[0]->IsInt32() && request[1]->IsSendPort() &&
+      request[2]->IsInt32() && request[3]->IsArray()) {
     CObjectInt32 message_id(request[0]);
     CObjectSendPort reply_port(request[1]);
     CObjectInt32 request_id(request[2]);
     CObjectArray data(request[3]);
     reply_port_id = reply_port.Value();
     switch (request_id.Value()) {
-  IO_SERVICE_REQUEST_LIST(CASE_REQUEST);
+      IO_SERVICE_REQUEST_LIST(CASE_REQUEST);
       default:
         UNREACHABLE();
     }
diff --git a/runtime/bin/io_service.h b/runtime/bin/io_service.h
index 209561a..7439253 100644
--- a/runtime/bin/io_service.h
+++ b/runtime/bin/io_service.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_IO_SERVICE_H_
-#define BIN_IO_SERVICE_H_
+#ifndef RUNTIME_BIN_IO_SERVICE_H_
+#define RUNTIME_BIN_IO_SERVICE_H_
 
 #if defined(DART_IO_DISABLED) || defined(DART_IO_SECURE_SOCKET_DISABLED)
 #error "io_service.h can only be included on builds with IO and SSL enabled"
@@ -58,14 +58,11 @@
   V(Directory, Rename, 38)                                                     \
   V(SSLFilter, ProcessFilter, 39)
 
-#define DECLARE_REQUEST(type, method, id)                                      \
-  k##type##method##Request = id,
+#define DECLARE_REQUEST(type, method, id) k##type##method##Request = id,
 
 class IOService {
  public:
-  enum {
-IO_SERVICE_REQUEST_LIST(DECLARE_REQUEST)
-  };
+  enum { IO_SERVICE_REQUEST_LIST(DECLARE_REQUEST) };
 
   static Dart_Port GetServicePort();
 
@@ -77,4 +74,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_IO_SERVICE_H_
+#endif  // RUNTIME_BIN_IO_SERVICE_H_
diff --git a/runtime/bin/io_service_no_ssl.cc b/runtime/bin/io_service_no_ssl.cc
index ece9ab8..189eb03 100644
--- a/runtime/bin/io_service_no_ssl.cc
+++ b/runtime/bin/io_service_no_ssl.cc
@@ -26,24 +26,20 @@
     response = type::method##Request(data);                                    \
     break;
 
-void IOServiceCallback(Dart_Port dest_port_id,
-                       Dart_CObject* message) {
+void IOServiceCallback(Dart_Port dest_port_id, Dart_CObject* message) {
   Dart_Port reply_port_id = ILLEGAL_PORT;
   CObject* response = CObject::IllegalArgumentError();
   CObjectArray request(message);
-  if ((message->type == Dart_CObject_kArray) &&
-      (request.Length() == 4) &&
-      request[0]->IsInt32() &&
-      request[1]->IsSendPort() &&
-      request[2]->IsInt32() &&
-      request[3]->IsArray()) {
+  if ((message->type == Dart_CObject_kArray) && (request.Length() == 4) &&
+      request[0]->IsInt32() && request[1]->IsSendPort() &&
+      request[2]->IsInt32() && request[3]->IsArray()) {
     CObjectInt32 message_id(request[0]);
     CObjectSendPort reply_port(request[1]);
     CObjectInt32 request_id(request[2]);
     CObjectArray data(request[3]);
     reply_port_id = reply_port.Value();
     switch (request_id.Value()) {
-  IO_SERVICE_REQUEST_LIST(CASE_REQUEST);
+      IO_SERVICE_REQUEST_LIST(CASE_REQUEST);
       default:
         UNREACHABLE();
     }
diff --git a/runtime/bin/io_service_no_ssl.h b/runtime/bin/io_service_no_ssl.h
index b8cb545..125f237 100644
--- a/runtime/bin/io_service_no_ssl.h
+++ b/runtime/bin/io_service_no_ssl.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_IO_SERVICE_NO_SSL_H_
-#define BIN_IO_SERVICE_NO_SSL_H_
+#ifndef RUNTIME_BIN_IO_SERVICE_NO_SSL_H_
+#define RUNTIME_BIN_IO_SERVICE_NO_SSL_H_
 
 #if defined(DART_IO_DISABLED) || !defined(DART_IO_SECURE_SOCKET_DISABLED)
 #error "io_service_no_ssl.h can only be included on builds with IO enabled"
@@ -59,14 +59,11 @@
   V(Directory, ListStop, 37)                                                   \
   V(Directory, Rename, 38)
 
-#define DECLARE_REQUEST(type, method, id)                                      \
-  k##type##method##Request = id,
+#define DECLARE_REQUEST(type, method, id) k##type##method##Request = id,
 
 class IOService {
  public:
-  enum {
-IO_SERVICE_REQUEST_LIST(DECLARE_REQUEST)
-  };
+  enum { IO_SERVICE_REQUEST_LIST(DECLARE_REQUEST) };
 
   static Dart_Port GetServicePort();
 
@@ -78,4 +75,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_IO_SERVICE_NO_SSL_H_
+#endif  // RUNTIME_BIN_IO_SERVICE_NO_SSL_H_
diff --git a/runtime/bin/isolate_data.h b/runtime/bin/isolate_data.h
index a5e8bfb..5ed1ed8 100644
--- a/runtime/bin/isolate_data.h
+++ b/runtime/bin/isolate_data.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_ISOLATE_DATA_H_
-#define BIN_ISOLATE_DATA_H_
+#ifndef RUNTIME_BIN_ISOLATE_DATA_H_
+#define RUNTIME_BIN_ISOLATE_DATA_H_
 
 #include "include/dart_api.h"
 #include "platform/assert.h"
@@ -90,4 +90,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_ISOLATE_DATA_H_
+#endif  // RUNTIME_BIN_ISOLATE_DATA_H_
diff --git a/runtime/bin/loader.cc b/runtime/bin/loader.cc
index 4d35728..d0a95e2 100644
--- a/runtime/bin/loader.cc
+++ b/runtime/bin/loader.cc
@@ -11,6 +11,7 @@
 #include "bin/file.h"
 #include "bin/lockers.h"
 #include "bin/utils.h"
+#include "include/dart_tools_api.h"
 
 namespace dart {
 namespace bin {
@@ -33,9 +34,7 @@
       payload_length_(0) {
   monitor_ = new Monitor();
   ASSERT(isolate_data_ != NULL);
-  port_ = Dart_NewNativePort("Loader",
-                             Loader::NativeMessageHandler,
-                             false);
+  port_ = Dart_NewNativePort("Loader", Loader::NativeMessageHandler, false);
   isolate_data_->set_loader(this);
   AddLoader(port_, isolate_data_);
 }
@@ -111,8 +110,7 @@
     ASSERT(payload_message->value.as_typed_data.type == Dart_TypedData_kUint8);
     payload_length = payload_message->value.as_typed_data.length;
     payload = reinterpret_cast<uint8_t*>(malloc(payload_length));
-    memmove(payload,
-            payload_message->value.as_typed_data.values,
+    memmove(payload, payload_message->value.as_typed_data.values,
             payload_length);
   }
 }
@@ -145,17 +143,16 @@
   Dart_ListSetAt(request, 1, Dart_NewInteger(Dart_GetMainPortId()));
   Dart_ListSetAt(request, 2, Dart_NewInteger(_Dart_kInitLoader));
   Dart_ListSetAt(request, 3, Dart_NewSendPort(port_));
-  Dart_ListSetAt(request, 4,
-                 (package_root == NULL) ? Dart_Null() :
-                      Dart_NewStringFromCString(package_root));
-  Dart_ListSetAt(request, 5,
-                 (packages_file == NULL) ? Dart_Null() :
-                      Dart_NewStringFromCString(packages_file));
-  Dart_ListSetAt(request, 6,
-                      Dart_NewStringFromCString(working_directory));
-  Dart_ListSetAt(request, 7,
-                 (root_script_uri == NULL) ? Dart_Null() :
-                      Dart_NewStringFromCString(root_script_uri));
+  Dart_ListSetAt(request, 4, (package_root == NULL)
+                                 ? Dart_Null()
+                                 : Dart_NewStringFromCString(package_root));
+  Dart_ListSetAt(request, 5, (packages_file == NULL)
+                                 ? Dart_Null()
+                                 : Dart_NewStringFromCString(packages_file));
+  Dart_ListSetAt(request, 6, Dart_NewStringFromCString(working_directory));
+  Dart_ListSetAt(request, 7, (root_script_uri == NULL)
+                                 ? Dart_Null()
+                                 : Dart_NewStringFromCString(root_script_uri));
 
   bool success = Dart_Post(loader_port, request);
   ASSERT(success);
@@ -214,10 +211,8 @@
   if (results_length_ == results_capacity_) {
     // Grow to an initial capacity or double in size.
     results_capacity_ = (results_capacity_ == 0) ? 4 : results_capacity_ * 2;
-    results_ =
-        reinterpret_cast<IOResult*>(
-            realloc(results_,
-                    sizeof(IOResult) * results_capacity_));
+    results_ = reinterpret_cast<IOResult*>(
+        realloc(results_, sizeof(IOResult) * results_capacity_));
     ASSERT(results_ != NULL);
   }
   ASSERT(results_ != NULL);
@@ -286,8 +281,8 @@
   // isolate. The payload is a C string of the error message.
   if (result->tag < 0) {
     Dart_Handle library = Dart_LookupLibrary(uri);
-    Dart_Handle error = Dart_NewStringFromUTF8(result->payload,
-                                               result->payload_length);
+    Dart_Handle error =
+        Dart_NewStringFromUTF8(result->payload, result->payload_length);
     // If a library with the given uri exists, give it a chance to handle
     // the error. If the load requests stems from a deferred library load,
     // an IO error is not fatal.
@@ -306,9 +301,9 @@
     const char* lib_uri = reinterpret_cast<const char*>(result->payload);
     if (strncmp(lib_uri, "http://", 7) == 0 ||
         strncmp(lib_uri, "https://", 8) == 0) {
-      loader->error_ =
-        Dart_NewApiError("Cannot load native extensions over http: or https:");
-        return false;
+      loader->error_ = Dart_NewApiError(
+          "Cannot load native extensions over http: or https:");
+      return false;
     }
     const char* extension_uri = reinterpret_cast<const char*>(result->uri);
     const char* lib_path = NULL;
@@ -325,9 +320,8 @@
           extension_path);
       return false;
     }
-    Dart_Handle result = Extensions::LoadExtension(lib_path,
-                                                   extension_path,
-                                                   library);
+    Dart_Handle result =
+        Extensions::LoadExtension(lib_path, extension_path, library);
     if (Dart_IsError(result)) {
       loader->error_ = result;
       return false;
@@ -336,21 +330,17 @@
   }
 
   // Check for payload and load accordingly.
-  bool is_snapshot = false;
   const uint8_t* payload = result->payload;
   intptr_t payload_length = result->payload_length;
-  payload =
-      DartUtils::SniffForMagicNumber(payload,
-                                     &payload_length,
-                                     &is_snapshot);
+  const DartUtils::MagicNumber payload_type =
+      DartUtils::SniffForMagicNumber(&payload, &payload_length);
   Dart_Handle source = Dart_Null();
-  if (!is_snapshot) {
-    source = Dart_NewStringFromUTF8(result->payload,
-                                    result->payload_length);
+  if (payload_type == DartUtils::kUnknownMagicNumber) {
+    source = Dart_NewStringFromUTF8(result->payload, result->payload_length);
     if (Dart_IsError(source)) {
-      loader->error_ = DartUtils::NewError(
-          "%s is not a valid UTF-8 script",
-          reinterpret_cast<char*>(result->uri));
+      loader->error_ =
+          DartUtils::NewError("%s is not a valid UTF-8 script",
+                              reinterpret_cast<char*>(result->uri));
       return false;
     }
   }
@@ -364,25 +354,33 @@
   loader->monitor_->Exit();
 
   Dart_Handle dart_result = Dart_Null();
+  bool reload_extensions = false;
 
   switch (tag) {
     case Dart_kImportTag:
       dart_result = Dart_LoadLibrary(uri, resolved_uri, source, 0, 0);
-    break;
+      break;
     case Dart_kSourceTag: {
       ASSERT(library_uri != Dart_Null());
       Dart_Handle library = Dart_LookupLibrary(library_uri);
       ASSERT(!Dart_IsError(library));
       dart_result = Dart_LoadSource(library, uri, resolved_uri, source, 0, 0);
-    }
-    break;
+    } break;
     case Dart_kScriptTag:
-      if (is_snapshot) {
+      if (payload_type == DartUtils::kSnapshotMagicNumber) {
         dart_result = Dart_LoadScriptFromSnapshot(payload, payload_length);
+        reload_extensions = true;
+      } else if (payload_type == DartUtils::kKernelMagicNumber) {
+        // TODO(27590): This code path is only hit when trying to spawn
+        // isolates. We currently do not have support for neither
+        // `Isolate.spawn()` nor `Isolate.spawnUri()` with kernel-based
+        // frontend.
+        void* kernel_binary = Dart_ReadKernelBinary(payload, payload_length);
+        dart_result = Dart_LoadKernel(kernel_binary);
       } else {
         dart_result = Dart_LoadScript(uri, resolved_uri, source, 0, 0);
       }
-    break;
+      break;
     default:
       UNREACHABLE();
   }
@@ -395,6 +393,15 @@
     return false;
   }
 
+  if (reload_extensions) {
+    dart_result = ReloadNativeExtensions();
+    if (Dart_IsError(dart_result)) {
+      // Remember the error if we encountered one.
+      loader->error_ = dart_result;
+      return false;
+    }
+  }
+
   return true;
 }
 
@@ -404,8 +411,8 @@
   // A negative result tag indicates a loading error occurred in the service
   // isolate. The payload is a C string of the error message.
   if (result->tag < 0) {
-    Dart_Handle error = Dart_NewStringFromUTF8(result->payload,
-                                               result->payload_length);
+    Dart_Handle error =
+        Dart_NewStringFromUTF8(result->payload, result->payload_length);
     loader->error_ = Dart_NewUnhandledExceptionError(error);
     return false;
   }
@@ -440,15 +447,58 @@
   // Setup a loader. The constructor does a bunch of leg work.
   Loader* loader = new Loader(isolate_data);
   // Send the init message.
-  loader->Init(isolate_data->package_root,
-               isolate_data->packages_file,
-               DartUtils::original_working_directory,
-               snapshot_uri);
+  loader->Init(isolate_data->package_root, isolate_data->packages_file,
+               DartUtils::original_working_directory, snapshot_uri);
   // Destroy the loader. The destructor does a bunch of leg work.
   delete loader;
 }
 
 
+#define RETURN_ERROR(result)                                                   \
+  if (Dart_IsError(result)) return result;
+
+Dart_Handle Loader::ReloadNativeExtensions() {
+  Dart_Handle scheme =
+      Dart_NewStringFromCString(DartUtils::kDartExtensionScheme);
+  Dart_Handle extension_imports = Dart_GetImportsOfScheme(scheme);
+  RETURN_ERROR(extension_imports);
+
+  intptr_t length = -1;
+  Dart_Handle result = Dart_ListLength(extension_imports, &length);
+  RETURN_ERROR(result);
+  Dart_Handle* import_handles = reinterpret_cast<Dart_Handle*>(
+      Dart_ScopeAllocate(sizeof(Dart_Handle) * length));
+  result = Dart_ListGetRange(extension_imports, 0, length, import_handles);
+  RETURN_ERROR(result);
+  for (intptr_t i = 0; i < length; i += 2) {
+    Dart_Handle importer = import_handles[i];
+    Dart_Handle importee = import_handles[i + 1];
+
+    const char* extension_uri = NULL;
+    result = Dart_StringToCString(Dart_LibraryUrl(importee), &extension_uri);
+    RETURN_ERROR(result);
+    const char* extension_path = DartUtils::RemoveScheme(extension_uri);
+
+    const char* lib_uri = NULL;
+    result = Dart_StringToCString(Dart_LibraryUrl(importer), &lib_uri);
+    RETURN_ERROR(result);
+
+    char* lib_path = NULL;
+    if (strncmp(lib_uri, "file://", 7) == 0) {
+      lib_path = DartUtils::DirName(DartUtils::RemoveScheme(lib_uri));
+    } else {
+      lib_path = strdup(lib_uri);
+    }
+
+    result = Extensions::LoadExtension(lib_path, extension_path, importer);
+    free(lib_path);
+    RETURN_ERROR(result);
+  }
+
+  return Dart_True();
+}
+
+
 Dart_Handle Loader::LoadUrlContents(Dart_Handle url,
                                     uint8_t** payload,
                                     intptr_t* payload_length) {
@@ -460,10 +510,8 @@
 
   // Setup the loader. The constructor does a bunch of leg work.
   loader = new Loader(isolate_data);
-  loader->Init(isolate_data->package_root,
-               isolate_data->packages_file,
-               DartUtils::original_working_directory,
-               NULL);
+  loader->Init(isolate_data->package_root, isolate_data->packages_file,
+               DartUtils::original_working_directory, NULL);
   ASSERT(loader != NULL);
   ASSERT(isolate_data->HasLoader());
 
@@ -524,10 +572,7 @@
     bool is_dart_library = DartUtils::IsDartSchemeURL(library_url_string);
 
     if (is_dart_scheme_url || is_dart_library) {
-      return DartColonLibraryTagHandler(tag,
-                                        library,
-                                        url,
-                                        library_url_string,
+      return DartColonLibraryTagHandler(tag, library, url, library_url_string,
                                         url_string);
     }
   }
@@ -564,8 +609,7 @@
 
     // Setup the loader. The constructor does a bunch of leg work.
     loader = new Loader(isolate_data);
-    loader->Init(isolate_data->package_root,
-                 isolate_data->packages_file,
+    loader->Init(isolate_data->package_root, isolate_data->packages_file,
                  DartUtils::original_working_directory,
                  (tag == Dart_kScriptTag) ? url_string : NULL);
   } else {
@@ -581,10 +625,9 @@
   if (DartUtils::IsDartExtensionSchemeURL(url_string)) {
     loader->SendImportExtensionRequest(url, Dart_LibraryUrl(library));
   } else {
-    loader->SendRequest(tag,
-                        url,
-                        (library != Dart_Null()) ?
-                            Dart_LibraryUrl(library) : Dart_Null());
+    loader->SendRequest(tag, url, (library != Dart_Null())
+                                      ? Dart_LibraryUrl(library)
+                                      : Dart_Null());
   }
 
 
@@ -641,17 +684,21 @@
   } else if (tag == Dart_kImportTag) {
     Builtin::BuiltinLibraryId id = Builtin::FindId(url_string);
     if (id == Builtin::kInvalidLibrary) {
-      return DartUtils::NewError("The built-in library '%s' is not available"
-                                 " on the stand-alone VM.\n", url_string);
+      return DartUtils::NewError(
+          "The built-in library '%s' is not available"
+          " on the stand-alone VM.\n",
+          url_string);
     }
     return Builtin::LoadLibrary(url, id);
   } else {
     ASSERT(tag == Dart_kSourceTag);
     Builtin::BuiltinLibraryId id = Builtin::FindId(library_url_string);
     if (id == Builtin::kInvalidLibrary) {
-      return DartUtils::NewError("The built-in library '%s' is not available"
-                                 " on the stand-alone VM. Trying to load"
-                                 " '%s'.\n", library_url_string, url_string);
+      return DartUtils::NewError(
+          "The built-in library '%s' is not available"
+          " on the stand-alone VM. Trying to load"
+          " '%s'.\n",
+          library_url_string, url_string);
     }
     // Prepend the library URI to form a unique script URI for the part.
     intptr_t len = snprintf(NULL, 0, "%s/%s", library_url_string, url_string);
@@ -659,8 +706,7 @@
     snprintf(part_uri, len + 1, "%s/%s", library_url_string, url_string);
     Dart_Handle part_uri_obj = DartUtils::NewString(part_uri);
     free(part_uri);
-    return Dart_LoadSource(library,
-                           part_uri_obj, Dart_Null(),
+    return Dart_LoadSource(library, part_uri_obj, Dart_Null(),
                            Builtin::PartSource(id, url_string), 0, 0);
   }
   // All cases should have been handled above.
@@ -691,10 +737,8 @@
     // Grow to an initial capacity or double in size.
     loader_infos_capacity_ =
         (loader_infos_capacity_ == 0) ? 4 : loader_infos_capacity_ * 2;
-    loader_infos_ =
-        reinterpret_cast<Loader::LoaderInfo*>(
-            realloc(loader_infos_,
-                    sizeof(Loader::LoaderInfo) * loader_infos_capacity_));
+    loader_infos_ = reinterpret_cast<Loader::LoaderInfo*>(realloc(
+        loader_infos_, sizeof(Loader::LoaderInfo) * loader_infos_capacity_));
     ASSERT(loader_infos_ != NULL);
     // Initialize new entries.
     for (intptr_t i = loader_infos_length_; i < loader_infos_capacity_; i++) {
diff --git a/runtime/bin/loader.h b/runtime/bin/loader.h
index 4fe6ac0..2076be8 100644
--- a/runtime/bin/loader.h
+++ b/runtime/bin/loader.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_LOADER_H_
-#define BIN_LOADER_H_
+#ifndef RUNTIME_BIN_LOADER_H_
+#define RUNTIME_BIN_LOADER_H_
 
 #include "bin/isolate_data.h"
 #include "include/dart_api.h"
@@ -22,6 +22,8 @@
 
   static void InitForSnapshot(const char* snapshot_uri);
 
+  static Dart_Handle ReloadNativeExtensions();
+
   // Loads contents of the specified url.
   static Dart_Handle LoadUrlContents(Dart_Handle url,
                                      uint8_t** payload,
@@ -33,9 +35,7 @@
                                        Dart_Handle library,
                                        Dart_Handle url);
 
-  Dart_Handle error() const {
-    return error_;
-  }
+  Dart_Handle error() const { return error_; }
 
   static void InitOnce();
 
@@ -86,8 +86,7 @@
             const char* root_script_uri);
 
   // Send a request for a dart-ext: import to the service isolate.
-  void SendImportExtensionRequest(Dart_Handle url,
-                                  Dart_Handle library_url);
+  void SendImportExtensionRequest(Dart_Handle url, Dart_Handle library_url);
 
   // Send a request from the tag handler to the service isolate.
   void SendRequest(Dart_LibraryTag tag,
@@ -146,4 +145,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_LOADER_H_
+#endif  // RUNTIME_BIN_LOADER_H_
diff --git a/runtime/bin/lockers.h b/runtime/bin/lockers.h
index 0aefd99..83dd0bd 100644
--- a/runtime/bin/lockers.h
+++ b/runtime/bin/lockers.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_LOCKERS_H_
-#define BIN_LOCKERS_H_
+#ifndef RUNTIME_BIN_LOCKERS_H_
+#define RUNTIME_BIN_LOCKERS_H_
 
 #include "bin/thread.h"
 #include "platform/assert.h"
@@ -11,16 +11,14 @@
 namespace dart {
 namespace bin {
 
-class MutexLocker  {
+class MutexLocker {
  public:
   explicit MutexLocker(Mutex* mutex) : mutex_(mutex) {
     ASSERT(mutex != NULL);
     mutex_->Lock();
   }
 
-  virtual ~MutexLocker() {
-    mutex_->Unlock();
-  }
+  virtual ~MutexLocker() { mutex_->Unlock(); }
 
  private:
   Mutex* const mutex_;
@@ -36,21 +34,15 @@
     monitor_->Enter();
   }
 
-  virtual ~MonitorLocker() {
-    monitor_->Exit();
-  }
+  virtual ~MonitorLocker() { monitor_->Exit(); }
 
   Monitor::WaitResult Wait(int64_t millis = Monitor::kNoTimeout) {
     return monitor_->Wait(millis);
   }
 
-  void Notify() {
-    monitor_->Notify();
-  }
+  void Notify() { monitor_->Notify(); }
 
-  void NotifyAll() {
-    monitor_->NotifyAll();
-  }
+  void NotifyAll() { monitor_->NotifyAll(); }
 
  private:
   Monitor* const monitor_;
@@ -61,4 +53,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_LOCKERS_H_
+#endif  // RUNTIME_BIN_LOCKERS_H_
diff --git a/runtime/bin/log.h b/runtime/bin/log.h
index 51a4379..022dd1b 100644
--- a/runtime/bin/log.h
+++ b/runtime/bin/log.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_LOG_H_
-#define BIN_LOG_H_
+#ifndef RUNTIME_BIN_LOG_H_
+#define RUNTIME_BIN_LOG_H_
 
 #include <stdarg.h>
 
@@ -41,4 +41,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_LOG_H_
+#endif  // RUNTIME_BIN_LOG_H_
diff --git a/runtime/bin/log_android.cc b/runtime/bin/log_android.cc
index 9dbbf05..42a6755 100644
--- a/runtime/bin/log_android.cc
+++ b/runtime/bin/log_android.cc
@@ -8,7 +8,7 @@
 #include "bin/log.h"
 
 #include <android/log.h>  // NOLINT
-#include <stdio.h>  // NOLINT
+#include <stdio.h>        // NOLINT
 
 namespace dart {
 namespace bin {
@@ -21,6 +21,7 @@
   // (critical ones or not) if we print them to stdout/stderr.
   // We also log using android's logging system.
   vprintf(format, args);
+  fflush(stdout);
   __android_log_vprint(ANDROID_LOG_INFO, "Dart", format, args);
 }
 
@@ -29,6 +30,7 @@
   // (critical ones or not) if we print them to stdout/stderr.
   // We also log using android's logging system.
   vfprintf(stderr, format, args);
+  fflush(stderr);
   __android_log_vprint(ANDROID_LOG_ERROR, "Dart", format, args);
 }
 
diff --git a/runtime/bin/log_fuchsia.cc b/runtime/bin/log_fuchsia.cc
index 0c1f7af..b3f9d1d 100644
--- a/runtime/bin/log_fuchsia.cc
+++ b/runtime/bin/log_fuchsia.cc
@@ -19,7 +19,7 @@
 
 void Log::VPrintErr(const char* format, va_list args) {
   vfprintf(stderr, format, args);
-  fflush(stdout);
+  fflush(stderr);
 }
 
 }  // namespace bin
diff --git a/runtime/bin/log_linux.cc b/runtime/bin/log_linux.cc
index abb19832..e9dcf1c 100644
--- a/runtime/bin/log_linux.cc
+++ b/runtime/bin/log_linux.cc
@@ -19,7 +19,7 @@
 
 void Log::VPrintErr(const char* format, va_list args) {
   vfprintf(stderr, format, args);
-  fflush(stdout);
+  fflush(stderr);
 }
 
 }  // namespace bin
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 8a80c7e..0adf4ac 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -44,14 +44,12 @@
 
 /**
  * Global state used to control and store generation of application snapshots
- * (script/full).
- * A full application snapshot can be generated and run using the following
- * commands
- * - Generating a full application snapshot :
- * dart_bootstrap --full-snapshot-after-run=<filename> --package-root=<dirs>
- *   <script_uri> [<script_options>]
- * - Running the full application snapshot generated above :
- * dart --run-full-snapshot=<filename> <script_uri> [<script_options>]
+ * An application snapshot can be generated and run using the following
+ * command
+ *   dart --snapshot-kind=app-jit --snapshot=<app_snapshot_filename>
+ *       <script_uri> [<script_options>]
+ * To Run the application snapshot generated above, use :
+ *   dart <app_snapshot_filename> [<script_options>]
  */
 static bool run_app_snapshot = false;
 static const char* snapshot_filename = NULL;
@@ -59,8 +57,7 @@
   kNone,
   kScript,
   kAppAOT,
-  kAppJITAfterRun,
-  kAppAfterRun,
+  kAppJIT,
 };
 static SnapshotKind gen_snapshot_kind = kNone;
 
@@ -97,23 +94,21 @@
 #endif
 
 
-extern const char* kPrecompiledLibraryName;
+extern const char* kPrecompiledVMIsolateSymbolName;
+extern const char* kPrecompiledIsolateSymbolName;
 extern const char* kPrecompiledInstructionsSymbolName;
 extern const char* kPrecompiledDataSymbolName;
 
-static const char* kVMIsolateSuffix = "snapshot.vmisolate";
-static const char* kIsolateSuffix = "snapshot.isolate";
-static const char* kAssemblySuffix = "snapshot.S";
-static const char* kInstructionsSuffix = "snapshot.instructions";
-static const char* kRODataSuffix = "snapshot.rodata";
-
 
 // Global flag that is used to indicate that we want to trace resolution of
 // URIs and the loading of libraries, parts and scripts.
 static bool trace_loading = false;
 
 
-static const char* DEFAULT_VM_SERVICE_SERVER_IP = "127.0.0.1";
+static Dart_Isolate main_isolate = NULL;
+
+
+static const char* DEFAULT_VM_SERVICE_SERVER_IP = "localhost";
 static const int DEFAULT_VM_SERVICE_SERVER_PORT = 8181;
 // VM Service options.
 static const char* vm_service_server_ip = DEFAULT_VM_SERVICE_SERVER_IP;
@@ -138,7 +133,6 @@
   va_start(arguments, format);
   Log::VPrintErr(format, arguments);
   va_end(arguments);
-  fflush(stderr);
 
   Dart_ExitScope();
   Dart_ShutdownIsolate();
@@ -228,19 +222,20 @@
 }
 
 
-static bool ExtractPortAndIP(const char *option_value,
-                             int *out_port,
-                             const char **out_ip,
-                             int default_port,
-                             const char *default_ip) {
+static bool ExtractPortAndAddress(const char* option_value,
+                                  int* out_port,
+                                  const char** out_ip,
+                                  int default_port,
+                                  const char* default_ip) {
   // [option_value] has to be one of the following formats:
   //   - ""
   //   - ":8181"
   //   - "=8181"
   //   - ":8181/192.168.0.1"
   //   - "=8181/192.168.0.1"
+  //   - "=8181/::1"
 
-  if (*option_value== '\0') {
+  if (*option_value == '\0') {
     *out_ip = default_ip;
     *out_port = default_port;
     return true;
@@ -251,23 +246,16 @@
   }
 
   int port = atoi(option_value + 1);
-  const char *slash = strstr(option_value, "/");
+  const char* slash = strstr(option_value, "/");
   if (slash == NULL) {
     *out_ip = default_ip;
     *out_port = port;
     return true;
   }
 
-  int _, n;
-  if (sscanf(option_value + 1, "%d/%d.%d.%d.%d%n",  // NOLINT(runtime/printf)
-             &_, &_, &_, &_, &_, &n)) {
-    if (option_value[1 + n] == '\0') {
-      *out_ip = slash + 1;
-      *out_port = port;
-      return true;
-    }
-  }
-  return false;
+  *out_ip = slash + 1;
+  *out_port = port;
+  return true;
 }
 
 
@@ -276,34 +264,34 @@
   ASSERT(arg != NULL);
   if (*arg == '\0') {
     // Ignore empty -D option.
-    Log::PrintErr("No arguments given to -D option\n");
+    Log::PrintErr("No arguments given to -D option, ignoring it\n");
     return true;
   }
-  if (environment == NULL) {
-    environment = new HashMap(&HashMap::SameStringValue, 4);
-  }
   // Split the name=value part of the -Dname=value argument.
   const char* equals_pos = strchr(arg, '=');
   if (equals_pos == NULL) {
     // No equal sign (name without value) currently not supported.
-    Log::PrintErr("No value given to -D option\n");
-    return false;
+    Log::PrintErr("No value given in -D%s option, ignoring it\n", arg);
+    return true;
   }
 
   char* name;
   char* value = NULL;
   int name_len = equals_pos - arg;
   if (name_len == 0) {
-    Log::PrintErr("No name given to -D option\n");
-    return false;
+    Log::PrintErr("No name given in -D%s option, ignoring it\n", arg);
+    return true;
   }
   // Split name=value into name and value.
   name = reinterpret_cast<char*>(malloc(name_len + 1));
   strncpy(name, arg, name_len);
   name[name_len] = '\0';
   value = strdup(equals_pos + 1);
-  HashMap::Entry* entry = environment->Lookup(
-      GetHashmapKeyFromString(name), HashMap::StringHash(name), true);
+  if (environment == NULL) {
+    environment = new HashMap(&HashMap::SameStringValue, 4);
+  }
+  HashMap::Entry* entry = environment->Lookup(GetHashmapKeyFromString(name),
+                                              HashMap::StringHash(name), true);
   ASSERT(entry != NULL);  // Lookup adds an entry if key not found.
   if (entry->value != NULL) {
     free(name);
@@ -365,39 +353,28 @@
   } else if (strcmp(kind, "app-aot") == 0) {
     gen_snapshot_kind = kAppAOT;
     return true;
-  } else if (strcmp(kind, "app-jit-after-run") == 0) {
-    gen_snapshot_kind = kAppJITAfterRun;
-    return true;
-  } else if (strcmp(kind, "app-after-run") == 0) {
-    gen_snapshot_kind = kAppAfterRun;
+  } else if (strcmp(kind, "app-jit") == 0) {
+    gen_snapshot_kind = kAppJIT;
     return true;
   }
-  Log::PrintErr("Unrecognized snapshot kind: '%s'\nValid kinds are: "
-                "script, app-aot, app-jit-after-run, app-after-run\n", kind);
+  Log::PrintErr(
+      "Unrecognized snapshot kind: '%s'\nValid kinds are: "
+      "script, app-aot, app-jit\n",
+      kind);
   return false;
 }
 
 
-static bool ProcessRunAppSnapshotOption(
-    const char* filename, CommandLineOptions* vm_options) {
-  ASSERT(filename != NULL);
-  snapshot_filename = filename;
-  run_app_snapshot = true;
-  return true;
-}
-
-
 static bool ProcessEnableVmServiceOption(const char* option_value,
                                          CommandLineOptions* vm_options) {
   ASSERT(option_value != NULL);
 
-  if (!ExtractPortAndIP(option_value,
-                        &vm_service_server_port,
-                        &vm_service_server_ip,
-                        DEFAULT_VM_SERVICE_SERVER_PORT,
-                        DEFAULT_VM_SERVICE_SERVER_IP)) {
-    Log::PrintErr("unrecognized --enable-vm-service option syntax. "
-                  "Use --enable-vm-service[=<port number>[/<IPv4 address>]]\n");
+  if (!ExtractPortAndAddress(
+          option_value, &vm_service_server_port, &vm_service_server_ip,
+          DEFAULT_VM_SERVICE_SERVER_PORT, DEFAULT_VM_SERVICE_SERVER_IP)) {
+    Log::PrintErr(
+        "unrecognized --enable-vm-service option syntax. "
+        "Use --enable-vm-service[=<port number>[/<bind address>]]\n");
     return false;
   }
 
@@ -406,10 +383,12 @@
 
 
 static bool ProcessDisableServiceOriginCheckOption(
-    const char* option_value, CommandLineOptions* vm_options) {
+    const char* option_value,
+    CommandLineOptions* vm_options) {
   ASSERT(option_value != NULL);
-  Log::PrintErr("WARNING: You are running with the service protocol in an "
-                "insecure mode.\n");
+  Log::PrintErr(
+      "WARNING: You are running with the service protocol in an "
+      "insecure mode.\n");
   vm_service_dev_mode = true;
   return true;
 }
@@ -419,13 +398,12 @@
                                  CommandLineOptions* vm_options) {
   ASSERT(option_value != NULL);
 
-  if (!ExtractPortAndIP(option_value,
-                        &vm_service_server_port,
-                        &vm_service_server_ip,
-                        DEFAULT_VM_SERVICE_SERVER_PORT,
-                        DEFAULT_VM_SERVICE_SERVER_IP)) {
-    Log::PrintErr("unrecognized --observe option syntax. "
-                  "Use --observe[=<port number>[/<IPv4 address>]]\n");
+  if (!ExtractPortAndAddress(
+          option_value, &vm_service_server_port, &vm_service_server_ip,
+          DEFAULT_VM_SERVICE_SERVER_PORT, DEFAULT_VM_SERVICE_SERVER_IP)) {
+    Log::PrintErr(
+        "unrecognized --observe option syntax. "
+        "Use --observe[=<port number>[/<bind address>]]\n");
     return false;
   }
 
@@ -469,8 +447,8 @@
 
 
 static bool ProcessHotReloadRollbackTestModeOption(
-      const char* arg,
-      CommandLineOptions* vm_options) {
+    const char* arg,
+    CommandLineOptions* vm_options) {
   // Identity reload.
   vm_options->AddArgument("--identity_reload");
   // Start reloading quickly.
@@ -517,8 +495,9 @@
     return false;
   }
   if (commandline_root_certs_cache != NULL) {
-    Log::PrintErr("Only one of --root-certs-file and --root-certs-cache "
-                  "may be specified");
+    Log::PrintErr(
+        "Only one of --root-certs-file and --root-certs-cache "
+        "may be specified");
     return false;
   }
   commandline_root_certs_file = arg;
@@ -527,14 +506,15 @@
 
 
 static bool ProcessRootCertsCacheOption(const char* arg,
-                                       CommandLineOptions* vm_options) {
+                                        CommandLineOptions* vm_options) {
   ASSERT(arg != NULL);
   if (*arg == '-') {
     return false;
   }
   if (commandline_root_certs_file != NULL) {
-    Log::PrintErr("Only one of --root-certs-file and --root-certs-cache "
-                  "may be specified");
+    Log::PrintErr(
+        "Only one of --root-certs-file and --root-certs-cache "
+        "may be specified");
     return false;
   }
   commandline_root_certs_cache = arg;
@@ -547,37 +527,35 @@
   const char* option_name;
   bool (*process)(const char* option, CommandLineOptions* vm_options);
 } main_options[] = {
-  // Standard options shared with dart2js.
-  { "-D", ProcessEnvironmentOption },
-  { "-h", ProcessHelpOption },
-  { "--help", ProcessHelpOption },
-  { "--packages=", ProcessPackagesOption },
-  { "--package-root=", ProcessPackageRootOption },
-  { "-v", ProcessVerboseOption },
-  { "--verbose", ProcessVerboseOption },
-  { "--version", ProcessVersionOption },
+    // Standard options shared with dart2js.
+    {"-D", ProcessEnvironmentOption},
+    {"-h", ProcessHelpOption},
+    {"--help", ProcessHelpOption},
+    {"--packages=", ProcessPackagesOption},
+    {"--package-root=", ProcessPackageRootOption},
+    {"-v", ProcessVerboseOption},
+    {"--verbose", ProcessVerboseOption},
+    {"--version", ProcessVersionOption},
 
-  // VM specific options to the standalone dart program.
-  { "--compile_all", ProcessCompileAllOption },
-  { "--parse_all", ProcessParseAllOption },
-  { "--enable-vm-service", ProcessEnableVmServiceOption },
-  { "--disable-service-origin-check", ProcessDisableServiceOriginCheckOption },
-  { "--observe", ProcessObserveOption },
-  { "--snapshot=", ProcessSnapshotFilenameOption },
-  { "--snapshot-kind=", ProcessSnapshotKindOption },
-  { "--run-app-snapshot=", ProcessRunAppSnapshotOption },
-  { "--use-blobs", ProcessUseBlobsOption },
-  { "--trace-loading", ProcessTraceLoadingOption },
-  { "--hot-reload-test-mode", ProcessHotReloadTestModeOption },
-  { "--hot-reload-rollback-test-mode", ProcessHotReloadRollbackTestModeOption },
-  { "--short_socket_read", ProcessShortSocketReadOption },
-  { "--short_socket_write", ProcessShortSocketWriteOption },
+    // VM specific options to the standalone dart program.
+    {"--compile_all", ProcessCompileAllOption},
+    {"--parse_all", ProcessParseAllOption},
+    {"--enable-vm-service", ProcessEnableVmServiceOption},
+    {"--disable-service-origin-check", ProcessDisableServiceOriginCheckOption},
+    {"--observe", ProcessObserveOption},
+    {"--snapshot=", ProcessSnapshotFilenameOption},
+    {"--snapshot-kind=", ProcessSnapshotKindOption},
+    {"--use-blobs", ProcessUseBlobsOption},
+    {"--trace-loading", ProcessTraceLoadingOption},
+    {"--hot-reload-test-mode", ProcessHotReloadTestModeOption},
+    {"--hot-reload-rollback-test-mode", ProcessHotReloadRollbackTestModeOption},
+    {"--short_socket_read", ProcessShortSocketReadOption},
+    {"--short_socket_write", ProcessShortSocketWriteOption},
 #if !defined(TARGET_OS_MACOS)
-  { "--root-certs-file=", ProcessRootCertsFileOption },
-  { "--root-certs-cache=", ProcessRootCertsCacheOption },
+    {"--root-certs-file=", ProcessRootCertsFileOption},
+    {"--root-certs-cache=", ProcessRootCertsCacheOption},
 #endif  // !defined(TARGET_OS_MACOS)
-  { NULL, NULL }
-};
+    {NULL, NULL}};
 
 
 static bool ProcessMainOptions(const char* option,
@@ -630,7 +608,7 @@
                                       vm_options)) {
           i++;
           if ((argv[i] == NULL) ||
-               !ProcessPackageRootOption(argv[i], vm_options)) {
+              !ProcessPackageRootOption(argv[i], vm_options)) {
             Log::PrintErr("Invalid option specification : '%s'\n", argv[i - 1]);
             i++;
             break;
@@ -654,12 +632,10 @@
       if ((strncmp(argv[i], kPrintFlags1, strlen(kPrintFlags1)) == 0) ||
           (strncmp(argv[i], kPrintFlags2, strlen(kPrintFlags2)) == 0)) {
         *print_flags_seen = true;
-      } else if ((strncmp(argv[i],
-                          kVerboseDebug1,
-                          strlen(kVerboseDebug1)) == 0) ||
-                 (strncmp(argv[i],
-                          kVerboseDebug2,
-                          strlen(kVerboseDebug2)) == 0)) {
+      } else if ((strncmp(argv[i], kVerboseDebug1, strlen(kVerboseDebug1)) ==
+                  0) ||
+                 (strncmp(argv[i], kVerboseDebug2, strlen(kVerboseDebug2)) ==
+                  0)) {
         *verbose_debug_seen = true;
       }
       vm_options->AddArgument(argv[i]);
@@ -687,8 +663,9 @@
   // Verify consistency of arguments.
   if ((commandline_package_root != NULL) &&
       (commandline_packages_file != NULL)) {
-    Log::PrintErr("Specifying both a packages directory and a packages "
-                  "file is invalid.\n");
+    Log::PrintErr(
+        "Specifying both a packages directory and a packages "
+        "file is invalid.\n");
     return -1;
   }
   if ((commandline_package_root != NULL) &&
@@ -710,8 +687,9 @@
     return -1;
   }
   if ((gen_snapshot_kind != kNone) && run_app_snapshot) {
-    Log::PrintErr("Specifying an option to generate a snapshot and"
-                  " run using a snapshot is invalid.\n");
+    Log::PrintErr(
+        "Specifying an option to generate a snapshot and"
+        " run using a snapshot is invalid.\n");
     return -1;
   }
 
@@ -726,8 +704,7 @@
     return dart_arguments;
   }
   for (int i = 0; i < options_count; i++) {
-    Dart_Handle argument_value =
-        DartUtils::NewString(options->GetArgument(i));
+    Dart_Handle argument_value = DartUtils::NewString(options->GetArgument(i));
     if (Dart_IsError(argument_value)) {
       return argument_value;
     }
@@ -754,10 +731,9 @@
     name_chars[utf8_len] = '\0';
     const char* value = NULL;
     if (environment != NULL) {
-      HashMap::Entry* entry = environment->Lookup(
-          GetHashmapKeyFromString(name_chars),
-          HashMap::StringHash(name_chars),
-          false);
+      HashMap::Entry* entry =
+          environment->Lookup(GetHashmapKeyFromString(name_chars),
+                              HashMap::StringHash(name_chars), false);
       if (entry != NULL) {
         value = reinterpret_cast<char*>(entry->value);
       }
@@ -787,7 +763,10 @@
     Dart_ExitScope();                                                          \
     Dart_ShutdownIsolate();                                                    \
     return NULL;                                                               \
-  }                                                                            \
+  }
+
+
+static void SnapshotOnExitHook(int64_t exit_code);
 
 
 // Returns true on success, false on failure.
@@ -813,15 +792,27 @@
     return NULL;
   }
 
-  IsolateData* isolate_data = new IsolateData(script_uri,
-                                              package_root,
-                                              packages_config);
-  Dart_Isolate isolate = Dart_CreateIsolate(script_uri,
-                                            main,
-                                            isolate_snapshot_buffer,
-                                            flags,
-                                            isolate_data,
-                                            error);
+  // If the script is a Kernel binary, then we will try to bootstrap from the
+  // script.
+  const uint8_t* kernel_file = NULL;
+  intptr_t kernel_length = -1;
+  const bool is_kernel =
+      !run_app_snapshot &&
+      TryReadKernel(script_uri, &kernel_file, &kernel_length);
+
+  void* kernel_program = NULL;
+  if (is_kernel) {
+    kernel_program = Dart_ReadKernelBinary(kernel_file, kernel_length);
+    free(const_cast<uint8_t*>(kernel_file));
+  }
+
+  IsolateData* isolate_data =
+      new IsolateData(script_uri, package_root, packages_config);
+  Dart_Isolate isolate =
+      is_kernel ? Dart_CreateIsolateFromKernel(script_uri, main, kernel_program,
+                                               flags, isolate_data, error)
+                : Dart_CreateIsolate(script_uri, main, isolate_snapshot_buffer,
+                                     flags, isolate_data, error);
   if (isolate == NULL) {
     delete isolate_data;
     return NULL;
@@ -829,23 +820,29 @@
 
   Dart_EnterScope();
 
-  if (isolate_snapshot_buffer != NULL) {
-    // Setup the native resolver as the snapshot does not carry it.
-    Builtin::SetNativeResolver(Builtin::kBuiltinLibrary);
-    Builtin::SetNativeResolver(Builtin::kIOLibrary);
-  }
-
   // Set up the library tag handler for this isolate.
   Dart_Handle result = Dart_SetLibraryTagHandler(Loader::LibraryTagHandler);
   CHECK_RESULT(result);
 
+  if (is_kernel) {
+    Dart_Handle result = Dart_LoadKernel(kernel_program);
+    CHECK_RESULT(result);
+  }
+  if (is_kernel || (isolate_snapshot_buffer != NULL)) {
+    // Setup the native resolver as the snapshot does not carry it.
+    Builtin::SetNativeResolver(Builtin::kBuiltinLibrary);
+    Builtin::SetNativeResolver(Builtin::kIOLibrary);
+  }
+  if (run_app_snapshot) {
+    Dart_Handle result = Loader::ReloadNativeExtensions();
+    CHECK_RESULT(result);
+  }
+
   if (Dart_IsServiceIsolate(isolate)) {
     // If this is the service isolate, load embedder specific bits and return.
     bool skip_library_load = run_app_snapshot;
-    if (!VmService::Setup(vm_service_server_ip,
-                          vm_service_server_port,
-                          skip_library_load,
-                          vm_service_dev_mode)) {
+    if (!VmService::Setup(vm_service_server_ip, vm_service_server_port,
+                          skip_library_load, vm_service_dev_mode)) {
       *error = strdup(VmService::GetErrorMessage());
       return NULL;
     }
@@ -853,6 +850,8 @@
       result = Dart_CompileAll();
       CHECK_RESULT(result);
     }
+    result = Dart_SetEnvironmentCallback(EnvironmentCallback);
+    CHECK_RESULT(result);
     Dart_ExitScope();
     Dart_ExitIsolate();
     return isolate;
@@ -887,16 +886,14 @@
     Dart_Handle uri =
         DartUtils::ResolveScript(Dart_NewStringFromCString(script_uri));
     CHECK_RESULT(uri);
-    result = Loader::LibraryTagHandler(Dart_kScriptTag,
-                                       Dart_Null(),
-                                       uri);
-    CHECK_RESULT(result);
+    if (!is_kernel) {
+      result = Loader::LibraryTagHandler(Dart_kScriptTag, Dart_Null(), uri);
+      CHECK_RESULT(result);
+    }
 
-    Dart_TimelineEvent("LoadScript",
-                       Dart_TimelineGetMicros(),
-                       Dart_GetMainPortId(),
-                       Dart_Timeline_Event_Async_End,
-                       0, NULL, NULL);
+    Dart_TimelineEvent("LoadScript", Dart_TimelineGetMicros(),
+                       Dart_GetMainPortId(), Dart_Timeline_Event_Async_End, 0,
+                       NULL, NULL);
 
     result = DartUtils::SetupIOLibrary(script_uri);
     CHECK_RESULT(result);
@@ -924,24 +921,21 @@
                                           const char* package_root,
                                           const char* package_config,
                                           Dart_IsolateFlags* flags,
-                                          void* data, char** error) {
+                                          void* data,
+                                          char** error) {
   // The VM should never call the isolate helper with a NULL flags.
   ASSERT(flags != NULL);
   ASSERT(flags->version == DART_FLAGS_CURRENT_VERSION);
   if ((package_root != NULL) && (package_config != NULL)) {
-    *error = strdup("Invalid arguments - Cannot simultaneously specify "
-                    "package root and package map.");
+    *error = strdup(
+        "Invalid arguments - Cannot simultaneously specify "
+        "package root and package map.");
     return NULL;
   }
 
   int exit_code = 0;
-  return CreateIsolateAndSetupHelper(script_uri,
-                                     main,
-                                     package_root,
-                                     package_config,
-                                     flags,
-                                     error,
-                                     &exit_code);
+  return CreateIsolateAndSetupHelper(script_uri, main, package_root,
+                                     package_config, flags, error, &exit_code);
 }
 
 
@@ -950,6 +944,7 @@
 }
 
 
+// clang-format off
 static void PrintUsage() {
   Log::PrintErr(
       "Usage: dart [<vm-flags>] <dart-script-file> [<dart-options>]\n"
@@ -978,6 +973,13 @@
 "      --warn-on-pause-with-no-debugger\n"
 "  This set is subject to change.\n"
 "  Please see these options (--help --verbose) for further documentation.\n"
+"--snapshot-kind=<snapsot_kind>\n"
+"--snapshot=<file_name>\n"
+"  These snapshot options are used to generate a snapshot of the loaded\n"
+"  Dart script:\n"
+"    <snapshot-kind> controls the kind of snapshot, it could be\n"
+"                    script(default), app-aot or app-jit\n"
+"    <file_name> specifies the file into which the snapshot is written\n"
 "--version\n"
 "  Print the VM version.\n");
   } else {
@@ -1002,18 +1004,22 @@
 "      --warn-on-pause-with-no-debugger\n"
 "  This set is subject to change.\n"
 "  Please see these options for further documentation.\n"
+"--snapshot-kind=<snapsot_kind>\n"
+"--snapshot=<file_name>\n"
+"  These snapshot options are used to generate a snapshot of the loaded\n"
+"  Dart script:\n"
+"    <snapshot-kind> controls the kind of snapshot, it could be\n"
+"                    script(default), app-aot or app-jit\n"
+"    <file_name> specifies the file into which the snapshot is written\n"
 "--version\n"
 "  Print the VM version.\n"
 "\n"
-"--snapshot=<file_name>\n"
-"  loads Dart script and generates a snapshot in the specified file\n"
-"\n"
 "--trace-loading\n"
 "  enables tracing of library and script loading\n"
 "\n"
 "--enable-vm-service[=<port>[/<bind-address>]]\n"
 "  enables the VM service and listens on specified port for connections\n"
-"  (default port number is 8181, default bind address is 127.0.0.1).\n"
+"  (default port number is 8181, default bind address is localhost).\n"
 #if !defined(TARGET_OS_MACOS)
 "\n"
 "--root-certs-file=<path>\n"
@@ -1030,10 +1036,10 @@
     Dart_SetVMFlags(1, &print_flags);
   }
 }
+// clang-format on
 
 
-char* BuildIsolateName(const char* script_name,
-                       const char* func_name) {
+char* BuildIsolateName(const char* script_name, const char* func_name) {
   // Skip past any slashes in the script name.
   const char* last_slash = strrchr(script_name, '/');
   if (last_slash != NULL) {
@@ -1056,10 +1062,11 @@
 
 static const char* InternalJsonRpcError(Dart_Handle error) {
   TextBuffer buffer(128);
-  buffer.Printf("{\"code\":-32603,"
-                "\"message\":\"Internal error\","
-                "\"details\": \"%s\"}",
-                Dart_GetError(error));
+  buffer.Printf(
+      "{\"code\":-32603,"
+      "\"message\":\"Internal error\","
+      "\"details\": \"%s\"}",
+      Dart_GetError(error));
   return buffer.Steal();
 }
 
@@ -1071,13 +1078,12 @@
 };
 
 
-static bool ServiceGetIOHandler(
-    const char* method,
-    const char** param_keys,
-    const char** param_values,
-    intptr_t num_params,
-    void* user_data,
-    const char** response) {
+static bool ServiceGetIOHandler(const char* method,
+                                const char** param_keys,
+                                const char** param_values,
+                                intptr_t num_params,
+                                void* user_data,
+                                const char** response) {
   DartScope scope;
   // TODO(ajohnsen): Store the library/function in isolate data or user_data.
   Dart_Handle dart_io_str = Dart_NewStringFromCString("dart:io");
@@ -1115,7 +1121,7 @@
     return false;
   }
 
-  const char *json;
+  const char* json;
   result = Dart_StringToCString(result, &json);
   if (Dart_IsError(result)) {
     *response = InternalJsonRpcError(result);
@@ -1167,27 +1173,15 @@
 }
 
 
-static void WriteSnapshotFile(const char* snapshot_directory,
-                              const char* filename,
+static void WriteSnapshotFile(const char* filename,
                               bool write_magic_number,
                               const uint8_t* buffer,
                               const intptr_t size) {
   char* concat = NULL;
-  const char* qualified_filename;
-  if ((snapshot_directory != NULL) && (strlen(snapshot_directory) > 0)) {
-    intptr_t len = snprintf(NULL, 0, "%s/%s", snapshot_directory, filename);
-    concat = new char[len + 1];
-    snprintf(concat, len + 1, "%s/%s", snapshot_directory, filename);
-    qualified_filename = concat;
-  } else {
-    qualified_filename = filename;
-  }
-
-  File* file = File::Open(qualified_filename, File::kWriteTruncate);
+  File* file = File::Open(filename, File::kWriteTruncate);
   if (file == NULL) {
-    ErrorExit(kErrorExitCode,
-              "Unable to open file %s for writing snapshot\n",
-              qualified_filename);
+    ErrorExit(kErrorExitCode, "Unable to open file %s for writing snapshot\n",
+              filename);
   }
 
   if (write_magic_number) {
@@ -1196,9 +1190,8 @@
   }
 
   if (!file->WriteFully(buffer, size)) {
-    ErrorExit(kErrorExitCode,
-              "Unable to write file %s for writing snapshot\n",
-              qualified_filename);
+    ErrorExit(kErrorExitCode, "Unable to write file %s for writing snapshot\n",
+              filename);
   }
   file->Release();
   if (concat != NULL) {
@@ -1207,93 +1200,209 @@
 }
 
 
-static void ReadSnapshotFile(const char* snapshot_directory,
-                             const char* filename,
-                             const uint8_t** buffer) {
-  char* concat = NULL;
-  const char* qualified_filename;
-  if ((snapshot_directory != NULL) && (strlen(snapshot_directory) > 0)) {
-    intptr_t len = snprintf(NULL, 0, "%s/%s", snapshot_directory, filename);
-    concat = new char[len + 1];
-    snprintf(concat, len + 1, "%s/%s", snapshot_directory, filename);
-    qualified_filename = concat;
-  } else {
-    qualified_filename = filename;
-  }
+static const int64_t kAppSnapshotHeaderSize = 5 * sizeof(int64_t);  // NOLINT
+static const int64_t kAppSnapshotMagicNumber = 0xf6f6dcdc;
+static const int64_t kAppSnapshotPageSize = 4 * KB;
 
-  void* file = DartUtils::OpenFile(qualified_filename, false);
+
+static bool ReadAppSnapshotBlobs(const char* script_name,
+                                 const uint8_t** vmisolate_buffer,
+                                 const uint8_t** isolate_buffer,
+                                 const uint8_t** instructions_buffer,
+                                 const uint8_t** rodata_buffer) {
+  File* file = File::Open(script_name, File::kRead);
   if (file == NULL) {
-    fprintf(stderr,
-            "Error: Unable to open file %s for reading snapshot\n",
-            qualified_filename);
-    fflush(stderr);
+    return false;
+  }
+  if (file->Length() < kAppSnapshotHeaderSize) {
+    file->Release();
+    return false;
+  }
+  int64_t header[5];
+  ASSERT(sizeof(header) == kAppSnapshotHeaderSize);
+  if (!file->ReadFully(&header, kAppSnapshotHeaderSize)) {
+    file->Release();
+    return false;
+  }
+  if (header[0] != kAppSnapshotMagicNumber) {
+    file->Release();
+    return false;
+  }
+
+  int64_t vmisolate_size = header[1];
+  int64_t vmisolate_position =
+      Utils::RoundUp(file->Position(), kAppSnapshotPageSize);
+  int64_t isolate_size = header[2];
+  int64_t isolate_position =
+      Utils::RoundUp(vmisolate_position + vmisolate_size, kAppSnapshotPageSize);
+  int64_t rodata_size = header[3];
+  int64_t rodata_position = isolate_position + isolate_size;
+  if (rodata_size != 0) {
+    rodata_position = Utils::RoundUp(rodata_position, kAppSnapshotPageSize);
+  }
+  int64_t instructions_size = header[4];
+  int64_t instructions_position = rodata_position + rodata_size;
+  if (instructions_size != 0) {
+    instructions_position =
+        Utils::RoundUp(instructions_position, kAppSnapshotPageSize);
+  }
+
+  void* read_only_buffer =
+      file->Map(File::kReadOnly, vmisolate_position,
+                instructions_position - vmisolate_position);
+  if (read_only_buffer == NULL) {
+    Log::PrintErr("Failed to memory map snapshot\n");
     Platform::Exit(kErrorExitCode);
   }
-  intptr_t len = -1;
-  DartUtils::ReadFile(buffer, &len, file);
-  if ((*buffer == NULL) || (len == -1)) {
-    fprintf(stderr,
-            "Error: Unable to read snapshot file %s\n", qualified_filename);
-    fflush(stderr);
-    Platform::Exit(kErrorExitCode);
+
+  *vmisolate_buffer = reinterpret_cast<const uint8_t*>(read_only_buffer) +
+                      (vmisolate_position - vmisolate_position);
+  *isolate_buffer = reinterpret_cast<const uint8_t*>(read_only_buffer) +
+                    (isolate_position - vmisolate_position);
+  if (rodata_size == 0) {
+    *rodata_buffer = NULL;
+  } else {
+    *rodata_buffer = reinterpret_cast<const uint8_t*>(read_only_buffer) +
+                     (rodata_position - vmisolate_position);
   }
-  DartUtils::CloseFile(file);
-  if (concat != NULL) {
-    delete[] concat;
+
+  if (instructions_size == 0) {
+    *instructions_buffer = NULL;
+  } else {
+    *instructions_buffer = reinterpret_cast<const uint8_t*>(
+        file->Map(File::kReadExecute, instructions_position, header[4]));
+    if (*instructions_buffer == NULL) {
+      Log::PrintErr("Failed to memory map snapshot\n");
+      Platform::Exit(kErrorExitCode);
+    }
   }
+
+  file->Release();
+  return true;
 }
 
 
-static void ReadExecutableSnapshotFile(const char* snapshot_directory,
-                                       const char* filename,
-                                       const uint8_t** buffer) {
-  char* concat = NULL;
-  const char* qualified_filename;
-  if ((snapshot_directory != NULL) && (strlen(snapshot_directory) > 0)) {
-    intptr_t len = snprintf(NULL, 0, "%s/%s", snapshot_directory, filename);
-    concat = new char[len + 1];
-    snprintf(concat, len + 1, "%s/%s", snapshot_directory, filename);
-    qualified_filename = concat;
-  } else {
-    qualified_filename = filename;
-  }
-
-  intptr_t len = -1;
-  *buffer = reinterpret_cast<uint8_t*>(
-      DartUtils::MapExecutable(qualified_filename, &len));
-  if ((*buffer == NULL) || (len == -1)) {
-    fprintf(stderr,
-            "Error: Unable to read snapshot file %s\n", qualified_filename);
-    fflush(stderr);
-    Platform::Exit(kErrorExitCode);
-  }
-  if (concat != NULL) {
-    delete[] concat;
-  }
-}
-
-
-static void* LoadLibrarySymbol(const char* snapshot_directory,
-                               const char* libname,
-                               const char* symname) {
-  char* concat = NULL;
-  const char* qualified_libname;
-  if ((snapshot_directory != NULL) && (strlen(snapshot_directory) > 0)) {
-    intptr_t len = snprintf(NULL, 0, "%s/%s", snapshot_directory, libname);
-    concat = new char[len + 1];
-    snprintf(concat, len + 1, "%s/%s", snapshot_directory, libname);
-    qualified_libname = concat;
-  } else {
-    qualified_libname = libname;
-  }
-  void* library = Extensions::LoadExtensionLibrary(qualified_libname);
-  if (concat != NULL) {
-    delete concat;
-  }
+static bool ReadAppSnapshotDynamicLibrary(const char* script_name,
+                                          const uint8_t** vmisolate_buffer,
+                                          const uint8_t** isolate_buffer,
+                                          const uint8_t** instructions_buffer,
+                                          const uint8_t** rodata_buffer) {
+  void* library = Extensions::LoadExtensionLibrary(script_name);
   if (library == NULL) {
-    return NULL;
+    return false;
   }
-  return Extensions::ResolveSymbol(library, symname);
+
+  *vmisolate_buffer = reinterpret_cast<const uint8_t*>(
+      Extensions::ResolveSymbol(library, kPrecompiledVMIsolateSymbolName));
+  if (*vmisolate_buffer == NULL) {
+    Log::PrintErr("Failed to resolve symbol '%s'\n",
+                  kPrecompiledVMIsolateSymbolName);
+    Platform::Exit(kErrorExitCode);
+  }
+
+  *isolate_buffer = reinterpret_cast<const uint8_t*>(
+      Extensions::ResolveSymbol(library, kPrecompiledIsolateSymbolName));
+  if (*isolate_buffer == NULL) {
+    Log::PrintErr("Failed to resolve symbol '%s'\n",
+                  kPrecompiledIsolateSymbolName);
+    Platform::Exit(kErrorExitCode);
+  }
+
+  *instructions_buffer = reinterpret_cast<const uint8_t*>(
+      Extensions::ResolveSymbol(library, kPrecompiledInstructionsSymbolName));
+  if (*instructions_buffer == NULL) {
+    Log::PrintErr("Failed to resolve symbol '%s'\n",
+                  kPrecompiledInstructionsSymbolName);
+    Platform::Exit(kErrorExitCode);
+  }
+
+  *rodata_buffer = reinterpret_cast<const uint8_t*>(
+      Extensions::ResolveSymbol(library, kPrecompiledDataSymbolName));
+  if (*rodata_buffer == NULL) {
+    Log::PrintErr("Failed to resolve symbol '%s'\n",
+                  kPrecompiledDataSymbolName);
+    Platform::Exit(kErrorExitCode);
+  }
+
+  return true;
+}
+
+
+static bool ReadAppSnapshot(const char* script_name,
+                            const uint8_t** vmisolate_buffer,
+                            const uint8_t** isolate_buffer,
+                            const uint8_t** instructions_buffer,
+                            const uint8_t** rodata_buffer) {
+  if (File::GetType(script_name, true) != File::kIsFile) {
+    // If 'script_name' refers to a pipe, don't read to check for an app
+    // snapshot since we cannot rewind if it isn't (and couldn't mmap it in
+    // anyway if it was).
+    return false;
+  }
+  if (ReadAppSnapshotBlobs(script_name, vmisolate_buffer, isolate_buffer,
+                           instructions_buffer, rodata_buffer)) {
+    return true;
+  }
+  return ReadAppSnapshotDynamicLibrary(script_name, vmisolate_buffer,
+                                       isolate_buffer, instructions_buffer,
+                                       rodata_buffer);
+}
+
+
+static bool WriteInt64(File* file, int64_t size) {
+  return file->WriteFully(&size, sizeof(size));
+}
+
+
+static void WriteAppSnapshot(const char* filename,
+                             uint8_t* vmisolate_buffer,
+                             intptr_t vmisolate_size,
+                             uint8_t* isolate_buffer,
+                             intptr_t isolate_size,
+                             uint8_t* instructions_buffer,
+                             intptr_t instructions_size,
+                             uint8_t* rodata_buffer,
+                             intptr_t rodata_size) {
+  File* file = File::Open(filename, File::kWriteTruncate);
+  if (file == NULL) {
+    ErrorExit(kErrorExitCode, "Unable to write snapshot file '%s'\n", filename);
+  }
+
+  file->WriteFully(&kAppSnapshotMagicNumber, sizeof(kAppSnapshotMagicNumber));
+  WriteInt64(file, vmisolate_size);
+  WriteInt64(file, isolate_size);
+  WriteInt64(file, rodata_size);
+  WriteInt64(file, instructions_size);
+  ASSERT(file->Position() == kAppSnapshotHeaderSize);
+
+  file->SetPosition(Utils::RoundUp(file->Position(), kAppSnapshotPageSize));
+  if (!file->WriteFully(vmisolate_buffer, vmisolate_size)) {
+    ErrorExit(kErrorExitCode, "Unable to write snapshot file '%s'\n", filename);
+  }
+
+  file->SetPosition(Utils::RoundUp(file->Position(), kAppSnapshotPageSize));
+  if (!file->WriteFully(isolate_buffer, isolate_size)) {
+    ErrorExit(kErrorExitCode, "Unable to write snapshot file '%s'\n", filename);
+  }
+
+  if (rodata_size != 0) {
+    file->SetPosition(Utils::RoundUp(file->Position(), kAppSnapshotPageSize));
+    if (!file->WriteFully(rodata_buffer, rodata_size)) {
+      ErrorExit(kErrorExitCode, "Unable to write snapshot file '%s'\n",
+                filename);
+    }
+  }
+
+  if (instructions_size != 0) {
+    file->SetPosition(Utils::RoundUp(file->Position(), kAppSnapshotPageSize));
+    if (!file->WriteFully(instructions_buffer, instructions_size)) {
+      ErrorExit(kErrorExitCode, "Unable to write snapshot file '%s'\n",
+                filename);
+    }
+  }
+
+  file->Flush();
+  file->Release();
 }
 
 
@@ -1306,7 +1415,7 @@
     ErrorExit(kErrorExitCode, "%s\n", Dart_GetError(result));
   }
 
-  WriteSnapshotFile(NULL, snapshot_filename, true, buffer, size);
+  WriteSnapshotFile(snapshot_filename, true, buffer, size);
 }
 
 
@@ -1324,57 +1433,29 @@
   Dart_Handle result;
   if (use_blobs) {
     result = Dart_CreatePrecompiledSnapshotBlob(
-        &vm_isolate_buffer,
-        &vm_isolate_size,
-        &isolate_buffer,
-        &isolate_size,
-        &instructions_blob_buffer,
-        &instructions_blob_size,
-        &rodata_blob_buffer,
+        &vm_isolate_buffer, &vm_isolate_size, &isolate_buffer, &isolate_size,
+        &instructions_blob_buffer, &instructions_blob_size, &rodata_blob_buffer,
         &rodata_blob_size);
   } else {
-    result = Dart_CreatePrecompiledSnapshotAssembly(
-        &vm_isolate_buffer,
-        &vm_isolate_size,
-        &isolate_buffer,
-        &isolate_size,
-        &assembly_buffer,
-        &assembly_size);
+    result = Dart_CreatePrecompiledSnapshotAssembly(&assembly_buffer,
+                                                    &assembly_size);
   }
   if (Dart_IsError(result)) {
     ErrorExit(kErrorExitCode, "%s\n", Dart_GetError(result));
   }
-  WriteSnapshotFile(snapshot_filename, kVMIsolateSuffix,
-                    false,
-                    vm_isolate_buffer,
-                    vm_isolate_size);
-  WriteSnapshotFile(snapshot_filename, kIsolateSuffix,
-                    false,
-                    isolate_buffer,
-                    isolate_size);
   if (use_blobs) {
-    WriteSnapshotFile(snapshot_filename, kInstructionsSuffix,
-                      false,
-                      instructions_blob_buffer,
-                      instructions_blob_size);
-    WriteSnapshotFile(snapshot_filename, kRODataSuffix,
-                      false,
-                      rodata_blob_buffer,
-                      rodata_blob_size);
+    WriteAppSnapshot(snapshot_filename, vm_isolate_buffer, vm_isolate_size,
+                     isolate_buffer, isolate_size, instructions_blob_buffer,
+                     instructions_blob_size, rodata_blob_buffer,
+                     rodata_blob_size);
   } else {
-    WriteSnapshotFile(snapshot_filename, kAssemblySuffix,
-                      false,
-                      assembly_buffer,
-                      assembly_size);
+    WriteSnapshotFile(snapshot_filename, false, assembly_buffer, assembly_size);
   }
 }
 
 
+#if defined(TARGET_ARCH_X64)
 static void GeneratePrecompiledJITSnapshot() {
-  if (!use_blobs) {
-    ErrorExit(kErrorExitCode,
-              "Generating app JIT snapshots as assembly unimplemented\n");
-  }
   uint8_t* vm_isolate_buffer = NULL;
   intptr_t vm_isolate_size = 0;
   uint8_t* isolate_buffer = NULL;
@@ -1384,62 +1465,44 @@
   uint8_t* rodata_blob_buffer = NULL;
   intptr_t rodata_blob_size = 0;
   Dart_Handle result = Dart_CreateAppJITSnapshot(
-      &vm_isolate_buffer,
-      &vm_isolate_size,
-      &isolate_buffer,
-      &isolate_size,
-      &instructions_blob_buffer,
-      &instructions_blob_size,
-      &rodata_blob_buffer,
+      &vm_isolate_buffer, &vm_isolate_size, &isolate_buffer, &isolate_size,
+      &instructions_blob_buffer, &instructions_blob_size, &rodata_blob_buffer,
       &rodata_blob_size);
   if (Dart_IsError(result)) {
     ErrorExit(kErrorExitCode, "%s\n", Dart_GetError(result));
   }
-  WriteSnapshotFile(snapshot_filename, kVMIsolateSuffix,
-                    false,
-                    vm_isolate_buffer,
-                    vm_isolate_size);
-  WriteSnapshotFile(snapshot_filename, kIsolateSuffix,
-                    false,
-                    isolate_buffer,
-                    isolate_size);
-  WriteSnapshotFile(snapshot_filename, kInstructionsSuffix,
-                    false,
-                    instructions_blob_buffer,
-                    instructions_blob_size);
-  WriteSnapshotFile(snapshot_filename, kRODataSuffix,
-                    false,
-                    rodata_blob_buffer,
-                    rodata_blob_size);
+  WriteAppSnapshot(snapshot_filename, vm_isolate_buffer, vm_isolate_size,
+                   isolate_buffer, isolate_size, instructions_blob_buffer,
+                   instructions_blob_size, rodata_blob_buffer,
+                   rodata_blob_size);
 }
+#endif  // defined(TARGET_ARCH_X64)
 
 
-static void GenerateFullSnapshot() {
-  // Create a full snapshot of the script.
+static void GenerateAppSnapshot() {
   Dart_Handle result;
+#if defined(TARGET_ARCH_X64)
+  result = Dart_PrecompileJIT();
+  if (Dart_IsError(result)) {
+    ErrorExit(kErrorExitCode, "%s\n", Dart_GetError(result));
+  }
+  GeneratePrecompiledJITSnapshot();
+#else
+  // Create an application snapshot of the script.
   uint8_t* vm_isolate_buffer = NULL;
   intptr_t vm_isolate_size = 0;
   uint8_t* isolate_buffer = NULL;
   intptr_t isolate_size = 0;
 
-  result = Dart_CreateSnapshot(&vm_isolate_buffer,
-                               &vm_isolate_size,
-                               &isolate_buffer,
-                               &isolate_size);
+  result = Dart_CreateSnapshot(&vm_isolate_buffer, &vm_isolate_size,
+                               &isolate_buffer, &isolate_size);
   if (Dart_IsError(result)) {
     ErrorExit(kErrorExitCode, "%s\n", Dart_GetError(result));
   }
 
-  WriteSnapshotFile(snapshot_filename,
-                    kVMIsolateSuffix,
-                    false,
-                    vm_isolate_buffer,
-                    vm_isolate_size);
-  WriteSnapshotFile(snapshot_filename,
-                    kIsolateSuffix,
-                    false,
-                    isolate_buffer,
-                    isolate_size);
+  WriteAppSnapshot(snapshot_filename, vm_isolate_buffer, vm_isolate_size,
+                   isolate_buffer, isolate_size, NULL, 0, NULL, 0);
+#endif  // defined(TARGET_ARCH_X64)
 }
 
 
@@ -1450,28 +1513,38 @@
       Dart_ShutdownIsolate();                                                  \
       return true;                                                             \
     }                                                                          \
-    const int exit_code = Dart_IsCompilationError(result) ?                    \
-        kCompilationErrorExitCode : kErrorExitCode;                            \
+    const int exit_code = Dart_IsCompilationError(result)                      \
+                              ? kCompilationErrorExitCode                      \
+                              : kErrorExitCode;                                \
     ErrorExit(exit_code, "%s\n", Dart_GetError(result));                       \
   }
 
 
-bool RunMainIsolate(const char* script_name,
-                    CommandLineOptions* dart_options) {
+static void SnapshotOnExitHook(int64_t exit_code) {
+  if (Dart_CurrentIsolate() != main_isolate) {
+    Log::PrintErr(
+        "A snapshot was requested, but a secondary isolate "
+        "performed a hard exit (%" Pd64 ").\n",
+        exit_code);
+    Platform::Exit(kErrorExitCode);
+  }
+  if (exit_code == 0) {
+    GenerateAppSnapshot();
+  }
+}
+
+
+bool RunMainIsolate(const char* script_name, CommandLineOptions* dart_options) {
   // Call CreateIsolateAndSetup which creates an isolate and loads up
   // the specified application script.
   char* error = NULL;
   int exit_code = 0;
   char* isolate_name = BuildIsolateName(script_name, "main");
-  Dart_Isolate isolate = CreateIsolateAndSetupHelper(script_name,
-                                                     "main",
-                                                     commandline_package_root,
-                                                     commandline_packages_file,
-                                                     NULL,
-                                                     &error,
-                                                     &exit_code);
+  Dart_Isolate isolate = CreateIsolateAndSetupHelper(
+      script_name, "main", commandline_package_root, commandline_packages_file,
+      NULL, &error, &exit_code);
   if (isolate == NULL) {
-    delete [] isolate_name;
+    delete[] isolate_name;
     if (exit_code == kRestartRequestExitCode) {
       free(error);
       return true;
@@ -1488,7 +1561,8 @@
     EventHandler::Stop();
     Platform::Exit((exit_code != 0) ? exit_code : kErrorExitCode);
   }
-  delete [] isolate_name;
+  main_isolate = isolate;
+  delete[] isolate_name;
 
   Dart_EnterIsolate(isolate);
   ASSERT(isolate == Dart_CurrentIsolate());
@@ -1506,19 +1580,15 @@
     // lookup the main entry point exported from the root library.
     IsolateData* isolate_data =
         reinterpret_cast<IsolateData*>(Dart_IsolateData(isolate));
-    result = Dart_LibraryImportLibrary(
-        isolate_data->builtin_lib(), root_lib, Dart_Null());
-    if (is_noopt ||
-        (gen_snapshot_kind == kAppAfterRun) ||
-        (gen_snapshot_kind == kAppAOT) ||
-        (gen_snapshot_kind == kAppJITAfterRun)) {
+    result = Dart_LibraryImportLibrary(isolate_data->builtin_lib(), root_lib,
+                                       Dart_Null());
+    if (is_noopt || (gen_snapshot_kind == kAppAOT) ||
+        (gen_snapshot_kind == kAppJIT)) {
       // Load the embedder's portion of the VM service's Dart code so it will
       // be included in the app snapshot.
       if (!VmService::LoadForGenPrecompiled()) {
-        fprintf(stderr,
-                "VM service loading failed: %s\n",
-                VmService::GetErrorMessage());
-        fflush(stderr);
+        Log::PrintErr("VM service loading failed: %s\n",
+                      VmService::GetErrorMessage());
         exit(kErrorExitCode);
       }
     }
@@ -1539,35 +1609,40 @@
 
     if (is_noopt || (gen_snapshot_kind == kAppAOT)) {
       Dart_QualifiedFunctionName standalone_entry_points[] = {
-        { "dart:_builtin", "::", "_getMainClosure" },
-        { "dart:_builtin", "::", "_getPrintClosure" },
-        { "dart:_builtin", "::", "_getUriBaseClosure" },
-        { "dart:_builtin", "::", "_resolveInWorkingDirectory" },
-        { "dart:_builtin", "::", "_setWorkingDirectory" },
-        { "dart:_builtin", "::", "_setPackageRoot" },
-        { "dart:_builtin", "::", "_setPackagesMap" },
-        { "dart:_builtin", "::", "_libraryFilePath" },
-        { "dart:io", "::", "_makeUint8ListView" },
-        { "dart:io", "::", "_makeDatagram" },
-        { "dart:io", "::", "_setupHooks" },
-        { "dart:io", "::", "_getWatchSignalInternal" },
-        { "dart:io", "CertificateException", "CertificateException." },
-        { "dart:io", "Directory", "Directory." },
-        { "dart:io", "File", "File." },
-        { "dart:io", "FileSystemException", "FileSystemException." },
-        { "dart:io", "HandshakeException", "HandshakeException." },
-        { "dart:io", "Link", "Link." },
-        { "dart:io", "OSError", "OSError." },
-        { "dart:io", "TlsException", "TlsException." },
-        { "dart:io", "X509Certificate", "X509Certificate._" },
-        { "dart:io", "_ExternalBuffer", "set:data" },
-        { "dart:io", "_Platform", "set:_nativeScript" },
-        { "dart:io", "_ProcessStartStatus", "set:_errorCode" },
-        { "dart:io", "_ProcessStartStatus", "set:_errorMessage" },
-        { "dart:io", "_SecureFilterImpl", "get:ENCRYPTED_SIZE" },
-        { "dart:io", "_SecureFilterImpl", "get:SIZE" },
-        { "dart:vmservice_io", "::", "main" },
-        { NULL, NULL, NULL }  // Must be terminated with NULL entries.
+          {"dart:_builtin", "::", "_getMainClosure"},
+          {"dart:_builtin", "::", "_getPrintClosure"},
+          {"dart:_builtin", "::", "_getUriBaseClosure"},
+          {"dart:_builtin", "::", "_resolveInWorkingDirectory"},
+          {"dart:_builtin", "::", "_setWorkingDirectory"},
+          {"dart:_builtin", "::", "_setPackageRoot"},
+          {"dart:_builtin", "::", "_setPackagesMap"},
+          {"dart:_builtin", "::", "_libraryFilePath"},
+          {"dart:io", "::", "_makeUint8ListView"},
+          {"dart:io", "::", "_makeDatagram"},
+          {"dart:io", "::", "_setupHooks"},
+          {"dart:io", "::", "_getWatchSignalInternal"},
+          {"dart:io", "CertificateException", "CertificateException."},
+          {"dart:io", "Directory", "Directory."},
+          {"dart:io", "File", "File."},
+          {"dart:io", "FileSystemException", "FileSystemException."},
+          {"dart:io", "HandshakeException", "HandshakeException."},
+          {"dart:io", "Link", "Link."},
+          {"dart:io", "OSError", "OSError."},
+          {"dart:io", "TlsException", "TlsException."},
+          {"dart:io", "X509Certificate", "X509Certificate._"},
+          {"dart:io", "_ExternalBuffer", "set:data"},
+          {"dart:io", "_ExternalBuffer", "get:start"},
+          {"dart:io", "_ExternalBuffer", "set:start"},
+          {"dart:io", "_ExternalBuffer", "get:end"},
+          {"dart:io", "_ExternalBuffer", "set:end"},
+          {"dart:io", "_Platform", "set:_nativeScript"},
+          {"dart:io", "_ProcessStartStatus", "set:_errorCode"},
+          {"dart:io", "_ProcessStartStatus", "set:_errorMessage"},
+          {"dart:io", "_SecureFilterImpl", "get:buffers"},
+          {"dart:io", "_SecureFilterImpl", "get:ENCRYPTED_SIZE"},
+          {"dart:io", "_SecureFilterImpl", "get:SIZE"},
+          {"dart:vmservice_io", "::", "main"},
+          {NULL, NULL, NULL}  // Must be terminated with NULL entries.
       };
 
       const bool reset_fields = gen_snapshot_kind == kAppAOT;
@@ -1579,16 +1654,16 @@
       GeneratePrecompiledSnapshot();
     } else {
       if (Dart_IsNull(root_lib)) {
-        ErrorExit(kErrorExitCode,
-                  "Unable to find root library for '%s'\n",
+        ErrorExit(kErrorExitCode, "Unable to find root library for '%s'\n",
                   script_name);
       }
 
       // The helper function _getMainClosure creates a closure for the main
       // entry point which is either explicitly or implictly exported from the
       // root library.
-      Dart_Handle main_closure = Dart_Invoke(isolate_data->builtin_lib(),
-          Dart_NewStringFromCString("_getMainClosure"), 0, NULL);
+      Dart_Handle main_closure =
+          Dart_Invoke(isolate_data->builtin_lib(),
+                      Dart_NewStringFromCString("_getMainClosure"), 0, NULL);
       CHECK_RESULT(main_closure);
 
       // Call _startIsolate in the isolate library to enable dispatching the
@@ -1608,17 +1683,10 @@
       // Keep handling messages until the last active receive port is closed.
       result = Dart_RunLoop();
       // Generate an app snapshot after execution if specified.
-      if ((gen_snapshot_kind == kAppAfterRun) ||
-          (gen_snapshot_kind == kAppJITAfterRun)) {
+      if (gen_snapshot_kind == kAppJIT) {
         if (!Dart_IsCompilationError(result) &&
             !Dart_IsVMRestartRequest(result)) {
-          if (gen_snapshot_kind == kAppAfterRun) {
-            GenerateFullSnapshot();
-          } else {
-            Dart_Handle prepare_result = Dart_PrecompileJIT();
-            CHECK_RESULT(prepare_result);
-            GeneratePrecompiledJITSnapshot();
-          }
+          GenerateAppSnapshot();
         }
       }
       CHECK_RESULT(result);
@@ -1645,8 +1713,10 @@
 // |input| is assumed to be a gzipped stream.
 // This function allocates the output buffer in the C heap and the caller
 // is responsible for freeing it.
-void Decompress(const uint8_t* input, unsigned int input_len,
-                uint8_t** output, unsigned int* output_length) {
+void Decompress(const uint8_t* input,
+                unsigned int input_len,
+                uint8_t** output,
+                unsigned int* output_length) {
   ASSERT(input != NULL);
   ASSERT(input_len > 0);
   ASSERT(output != NULL);
@@ -1709,17 +1779,15 @@
 Dart_Handle GetVMServiceAssetsArchiveCallback() {
   uint8_t* decompressed = NULL;
   unsigned int decompressed_len = 0;
-  Decompress(observatory_assets_archive,
-             observatory_assets_archive_len,
-             &decompressed,
-             &decompressed_len);
-  Dart_Handle tar_file = DartUtils::MakeUint8Array(decompressed,
-                                                   decompressed_len);
+  Decompress(observatory_assets_archive, observatory_assets_archive_len,
+             &decompressed, &decompressed_len);
+  Dart_Handle tar_file =
+      DartUtils::MakeUint8Array(decompressed, decompressed_len);
   // Free decompressed memory as it has been copied into a Dart array.
   free(decompressed);
   return tar_file;
 }
-#else  // !defined(DART_PRECOMPILER)
+#else   // !defined(DART_PRECOMPILER)
 static Dart_GetVMServiceAssetsArchive GetVMServiceAssetsArchiveCallback = NULL;
 #endif  // !defined(DART_PRECOMPILER)
 
@@ -1743,13 +1811,8 @@
   bool argv_converted = ShellUtils::GetUtf8Argv(argc, argv);
 
   // Parse command line arguments.
-  if (ParseArguments(argc,
-                     argv,
-                     &vm_options,
-                     &script_name,
-                     &dart_options,
-                     &print_flags_seen,
-                     &verbose_debug_seen) < 0) {
+  if (ParseArguments(argc, argv, &vm_options, &script_name, &dart_options,
+                     &print_flags_seen, &verbose_debug_seen) < 0) {
     if (help_option) {
       PrintUsage();
       Platform::Exit(0);
@@ -1773,11 +1836,19 @@
 
   if (!DartUtils::SetOriginalWorkingDirectory()) {
     OSError err;
-    fprintf(stderr, "Error determining current directory: %s\n", err.message());
-    fflush(stderr);
+    Log::PrintErr("Error determining current directory: %s\n", err.message());
     Platform::Exit(kErrorExitCode);
   }
 
+  const uint8_t* instructions_snapshot = NULL;
+  const uint8_t* data_snapshot = NULL;
+
+  if (ReadAppSnapshot(script_name, &vm_isolate_snapshot_buffer,
+                      &isolate_snapshot_buffer, &instructions_snapshot,
+                      &data_snapshot)) {
+    run_app_snapshot = true;
+  }
+
 #if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
   // Constant true if PRODUCT or DART_PRECOMPILED_RUNTIME.
   if ((gen_snapshot_kind != kNone) || run_app_snapshot) {
@@ -1785,12 +1856,21 @@
   }
 #endif
 
+  if (gen_snapshot_kind == kAppJIT) {
+    vm_options.AddArgument("--fields_may_be_reset");
+#if !defined(PRODUCT)
+    vm_options.AddArgument("--collect_code=false");
+#endif
+  }
   if ((gen_snapshot_kind == kAppAOT) || is_noopt) {
     vm_options.AddArgument("--precompilation");
   }
 #if defined(DART_PRECOMPILED_RUNTIME)
   vm_options.AddArgument("--precompilation");
 #endif
+  if (gen_snapshot_kind == kAppJIT) {
+    Process::SetExitHook(SnapshotOnExitHook);
+  }
 
   Dart_SetVMFlags(vm_options.count(), vm_options.arguments());
 
@@ -1798,31 +1878,6 @@
   TimerUtils::InitOnce();
   EventHandler::Start();
 
-  const uint8_t* instructions_snapshot = NULL;
-  const uint8_t* data_snapshot = NULL;
-  if (run_app_snapshot) {
-    ReadSnapshotFile(snapshot_filename, kVMIsolateSuffix,
-                     &vm_isolate_snapshot_buffer);
-    ReadSnapshotFile(snapshot_filename, kIsolateSuffix,
-                     &isolate_snapshot_buffer);
-    if (use_blobs) {
-      ReadExecutableSnapshotFile(snapshot_filename,
-                                 kInstructionsSuffix,
-                                 &instructions_snapshot);
-      ReadSnapshotFile(snapshot_filename, kRODataSuffix,
-                       &data_snapshot);
-    } else {
-      instructions_snapshot = reinterpret_cast<const uint8_t*>(
-          LoadLibrarySymbol(snapshot_filename,
-                            kPrecompiledLibraryName,
-                            kPrecompiledInstructionsSymbolName));
-      data_snapshot = reinterpret_cast<const uint8_t*>(
-          LoadLibrarySymbol(snapshot_filename,
-                            kPrecompiledLibraryName,
-                            kPrecompiledDataSymbolName));
-    }
-  }
-
   // Initialize the Dart VM.
   Dart_InitializeParams init_params;
   memset(&init_params, 0, sizeof(init_params));
@@ -1842,14 +1897,13 @@
   char* error = Dart_Initialize(&init_params);
   if (error != NULL) {
     EventHandler::Stop();
-    fprintf(stderr, "VM initialization failed: %s\n", error);
-    fflush(stderr);
+    Log::PrintErr("VM initialization failed: %s\n", error);
     free(error);
     Platform::Exit(kErrorExitCode);
   }
 
-  Dart_RegisterIsolateServiceRequestCallback(
-        "getIO", &ServiceGetIOHandler, NULL);
+  Dart_RegisterIsolateServiceRequestCallback("getIO", &ServiceGetIOHandler,
+                                             NULL);
   Dart_SetServiceStreamCallbacks(&ServiceStreamListenCallback,
                                  &ServiceStreamCancelCallback);
   Dart_SetFileModifiedCallback(&FileModifiedCallback);
@@ -1878,8 +1932,7 @@
 
   // Free environment if any.
   if (environment != NULL) {
-    for (HashMap::Entry* p = environment->Start();
-         p != NULL;
+    for (HashMap::Entry* p = environment->Start(); p != NULL;
          p = environment->Next(p)) {
       free(p->key);
       free(p->value);
diff --git a/runtime/bin/observatory_assets_empty.cc b/runtime/bin/observatory_assets_empty.cc
index 80d5fe1..e7e1738 100644
--- a/runtime/bin/observatory_assets_empty.cc
+++ b/runtime/bin/observatory_assets_empty.cc
@@ -16,7 +16,7 @@
 namespace dart {
 namespace bin {
 
-static const uint8_t observatory_assets_archive_[] = { '\0' };
+static const uint8_t observatory_assets_archive_[] = {'\0'};
 unsigned int observatory_assets_archive_len = 0;
 const uint8_t* observatory_assets_archive = observatory_assets_archive_;
 
diff --git a/runtime/bin/platform.cc b/runtime/bin/platform.cc
index d09a8be..e8b7849 100644
--- a/runtime/bin/platform.cc
+++ b/runtime/bin/platform.cc
@@ -40,16 +40,6 @@
 
 
 void FUNCTION_NAME(Platform_ExecutableName)(Dart_NativeArguments args) {
-  if (Dart_IsRunningPrecompiledCode()) {
-    // This is a work-around to be able to use most of the existing test suite
-    // for precompilation. Many tests do something like Process.run(
-    // Platform.executable, some_other_script.dart). But with precompilation
-    // the script is already fixed, so the spawned process runs the same script
-    // again and we have a fork-bomb.
-    Dart_ThrowException(Dart_NewStringFromCString(
-        "Platform.executable not supported under precompilation"));
-    UNREACHABLE();
-  }
   if (Platform::GetExecutableName() != NULL) {
     Dart_SetReturnValue(
         args, Dart_NewStringFromCString(Platform::GetExecutableName()));
@@ -60,12 +50,6 @@
 
 
 void FUNCTION_NAME(Platform_ResolvedExecutableName)(Dart_NativeArguments args) {
-  if (Dart_IsRunningPrecompiledCode()) {
-    Dart_ThrowException(Dart_NewStringFromCString(
-        "Platform.resolvedExecutable not supported under precompilation"));
-    UNREACHABLE();
-  }
-
   if (Platform::GetResolvedExecutableName() != NULL) {
     Dart_SetReturnValue(
         args, Dart_NewStringFromCString(Platform::GetResolvedExecutableName()));
@@ -94,8 +78,7 @@
   intptr_t count = 0;
   char** env = Platform::Environment(&count);
   if (env == NULL) {
-    OSError error(-1,
-                  "Failed to retrieve environment variables.",
+    OSError error(-1, "Failed to retrieve environment variables.",
                   OSError::kUnknown);
     Dart_SetReturnValue(args, DartUtils::NewDartOSError(&error));
   } else {
diff --git a/runtime/bin/platform.h b/runtime/bin/platform.h
index 1f52ef9..9dc7e7a 100644
--- a/runtime/bin/platform.h
+++ b/runtime/bin/platform.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_PLATFORM_H_
-#define BIN_PLATFORM_H_
+#ifndef RUNTIME_BIN_PLATFORM_H_
+#define RUNTIME_BIN_PLATFORM_H_
 
 #include "bin/builtin.h"
 #include "platform/globals.h"
@@ -63,9 +63,7 @@
   static void SetExecutableName(const char* executable_name) {
     executable_name_ = executable_name;
   }
-  static const char* GetExecutableName() {
-    return executable_name_;
-  }
+  static const char* GetExecutableName() { return executable_name_; }
   static const char* GetResolvedExecutableName() {
     if (resolved_executable_name_ == NULL) {
       // Try to resolve the executable path using platform specific APIs.
@@ -82,12 +80,8 @@
     script_index_ = script_index;
     argv_ = argv;
   }
-  static int GetScriptIndex() {
-    return script_index_;
-  }
-  static char** GetArgv() {
-    return argv_;
-  }
+  static int GetScriptIndex() { return script_index_; }
+  static char** GetArgv() { return argv_; }
 
   static DART_NORETURN void Exit(int exit_code);
 
@@ -107,4 +101,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_PLATFORM_H_
+#endif  // RUNTIME_BIN_PLATFORM_H_
diff --git a/runtime/bin/platform_android.cc b/runtime/bin/platform_android.cc
index 3d1a764..404f95d 100644
--- a/runtime/bin/platform_android.cc
+++ b/runtime/bin/platform_android.cc
@@ -57,7 +57,7 @@
 }
 
 
-bool Platform::LocalHostname(char *buffer, intptr_t buffer_length) {
+bool Platform::LocalHostname(char* buffer, intptr_t buffer_length) {
   return gethostname(buffer, buffer_length) == 0;
 }
 
diff --git a/runtime/bin/platform_fuchsia.cc b/runtime/bin/platform_fuchsia.cc
index 3e636d1..caa5aef 100644
--- a/runtime/bin/platform_fuchsia.cc
+++ b/runtime/bin/platform_fuchsia.cc
@@ -46,7 +46,7 @@
 }
 
 
-bool Platform::LocalHostname(char *buffer, intptr_t buffer_length) {
+bool Platform::LocalHostname(char* buffer, intptr_t buffer_length) {
   return gethostname(buffer, buffer_length) == 0;
 }
 
diff --git a/runtime/bin/platform_linux.cc b/runtime/bin/platform_linux.cc
index 4eb1a07..0d3338c 100644
--- a/runtime/bin/platform_linux.cc
+++ b/runtime/bin/platform_linux.cc
@@ -22,6 +22,12 @@
 int Platform::script_index_ = 1;
 char** Platform::argv_ = NULL;
 
+static void segv_handler(int signal, siginfo_t* siginfo, void* context) {
+  Dart_DumpNativeStackTrace(context);
+  abort();
+}
+
+
 bool Platform::Initialize() {
   // Turn off the signal handler for SIGPIPE as it causes the process
   // to terminate on writing to a closed pipe. Without the signal
@@ -33,6 +39,21 @@
     perror("Setting signal handler failed");
     return false;
   }
+
+  act.sa_flags = SA_SIGINFO;
+  act.sa_sigaction = &segv_handler;
+  if (sigemptyset(&act.sa_mask) != 0) {
+    perror("sigemptyset() failed.");
+    return false;
+  }
+  if (sigaddset(&act.sa_mask, SIGPROF) != 0) {
+    perror("sigaddset() failed");
+    return false;
+  }
+  if (sigaction(SIGSEGV, &act, NULL) != 0) {
+    perror("sigaction() failed.");
+    return false;
+  }
   return true;
 }
 
@@ -57,7 +78,7 @@
 }
 
 
-bool Platform::LocalHostname(char *buffer, intptr_t buffer_length) {
+bool Platform::LocalHostname(char* buffer, intptr_t buffer_length) {
   return gethostname(buffer, buffer_length) == 0;
 }
 
diff --git a/runtime/bin/platform_macos.cc b/runtime/bin/platform_macos.cc
index 628056b..0c6de4d 100644
--- a/runtime/bin/platform_macos.cc
+++ b/runtime/bin/platform_macos.cc
@@ -9,13 +9,13 @@
 
 #if !TARGET_OS_IOS
 #include <crt_externs.h>  // NOLINT
-#endif  // !TARGET_OS_IOS
+#endif                    // !TARGET_OS_IOS
 #include <mach-o/dyld.h>
-#include <signal.h>  // NOLINT
-#include <string.h>  // NOLINT
+#include <signal.h>      // NOLINT
+#include <string.h>      // NOLINT
 #include <sys/sysctl.h>  // NOLINT
-#include <sys/types.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <sys/types.h>   // NOLINT
+#include <unistd.h>      // NOLINT
 
 #include "bin/fdutils.h"
 #include "bin/file.h"
@@ -28,6 +28,12 @@
 int Platform::script_index_ = 1;
 char** Platform::argv_ = NULL;
 
+static void segv_handler(int signal, siginfo_t* siginfo, void* context) {
+  Dart_DumpNativeStackTrace(context);
+  abort();
+}
+
+
 bool Platform::Initialize() {
   // Turn off the signal handler for SIGPIPE as it causes the process
   // to terminate on writing to a closed pipe. Without the signal
@@ -39,6 +45,20 @@
     perror("Setting signal handler failed");
     return false;
   }
+  act.sa_flags = SA_SIGINFO;
+  act.sa_sigaction = &segv_handler;
+  if (sigemptyset(&act.sa_mask) != 0) {
+    perror("sigemptyset() failed.");
+    return false;
+  }
+  if (sigaddset(&act.sa_mask, SIGPROF) != 0) {
+    perror("sigaddset() failed");
+    return false;
+  }
+  if (sigaction(SIGSEGV, &act, NULL) != 0) {
+    perror("sigaction() failed.");
+    return false;
+  }
   return true;
 }
 
@@ -74,7 +94,7 @@
 }
 
 
-bool Platform::LocalHostname(char *buffer, intptr_t buffer_length) {
+bool Platform::LocalHostname(char* buffer, intptr_t buffer_length) {
   return gethostname(buffer, buffer_length) == 0;
 }
 
diff --git a/runtime/bin/platform_patch.dart b/runtime/bin/platform_patch.dart
index 8110ea1..c4b3481 100644
--- a/runtime/bin/platform_patch.dart
+++ b/runtime/bin/platform_patch.dart
@@ -28,7 +28,7 @@
       => VMLibraryHooks.packageConfigString;
 
   // This script singleton is written to by the embedder if applicable.
-  @patch static void set _nativeScript(String path) {
+  static void set _nativeScript(String path) {
     if (path.startsWith('http:') ||
         path.startsWith('https:') ||
         path.startsWith('package:') ||
diff --git a/runtime/bin/platform_unsupported.cc b/runtime/bin/platform_unsupported.cc
index 83893fb..64f62ef 100644
--- a/runtime/bin/platform_unsupported.cc
+++ b/runtime/bin/platform_unsupported.cc
@@ -13,55 +13,55 @@
 
 void FUNCTION_NAME(Platform_NumberOfProcessors)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "Platform is not supported on this platform"));
+      "Platform is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Platform_OperatingSystem)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "Platform is not supported on this platform"));
+      "Platform is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Platform_PathSeparator)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "Platform is not supported on this platform"));
+      "Platform is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Platform_LocalHostname)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "Platform is not supported on this platform"));
+      "Platform is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Platform_ExecutableName)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "Platform is not supported on this platform"));
+      "Platform is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Platform_ResolvedExecutableName)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "Platform is not supported on this platform"));
+      "Platform is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Platform_ExecutableArguments)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "Platform is not supported on this platform"));
+      "Platform is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Platform_Environment)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "Platform is not supported on this platform"));
+      "Platform is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Platform_GetVersion)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewInternalError(
-        "Platform is not supported on this platform"));
+      "Platform is not supported on this platform"));
 }
 
 }  // namespace bin
diff --git a/runtime/bin/platform_win.cc b/runtime/bin/platform_win.cc
index ee1ac49..601d4d7 100644
--- a/runtime/bin/platform_win.cc
+++ b/runtime/bin/platform_win.cc
@@ -28,7 +28,7 @@
 char** Platform::argv_ = NULL;
 
 bool Platform::Initialize() {
-  // Nothing to do on Windows.
+  SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
   return true;
 }
 
@@ -55,7 +55,7 @@
 }
 
 
-bool Platform::LocalHostname(char *buffer, intptr_t buffer_length) {
+bool Platform::LocalHostname(char* buffer, intptr_t buffer_length) {
 #if defined(DART_IO_DISABLED) || defined(PLATFORM_DISABLE_SOCKET)
   return false;
 #else
diff --git a/runtime/bin/process.cc b/runtime/bin/process.cc
index 672b3e3..9720d39 100644
--- a/runtime/bin/process.cc
+++ b/runtime/bin/process.cc
@@ -39,8 +39,8 @@
     if (Dart_IsError(result)) {
       Dart_PropagateError(result);
     }
-    result = DartUtils::SetStringField(
-        status_handle, "_errorMessage", "Max argument list length exceeded");
+    result = DartUtils::SetStringField(status_handle, "_errorMessage",
+                                       "Max argument list length exceeded");
     if (Dart_IsError(result)) {
       Dart_PropagateError(result);
     }
@@ -48,8 +48,8 @@
   }
   *length = len;
   char** string_args;
-  string_args = reinterpret_cast<char**>(
-      Dart_ScopeAllocate(len * sizeof(*string_args)));
+  string_args =
+      reinterpret_cast<char**>(Dart_ScopeAllocate(len * sizeof(*string_args)));
   for (int i = 0; i < len; i++) {
     Dart_Handle arg = Dart_ListGetAt(strings, i);
     if (Dart_IsError(arg)) {
@@ -60,20 +60,20 @@
       if (Dart_IsError(result)) {
         Dart_PropagateError(result);
       }
-      result = DartUtils::SetStringField(
-          status_handle, "_errorMessage", error_msg);
+      result =
+          DartUtils::SetStringField(status_handle, "_errorMessage", error_msg);
       if (Dart_IsError(result)) {
         Dart_PropagateError(result);
       }
       return NULL;
     }
-    string_args[i] = const_cast<char *>(DartUtils::GetStringValue(arg));
+    string_args[i] = const_cast<char*>(DartUtils::GetStringValue(arg));
   }
   return string_args;
 }
 
 void FUNCTION_NAME(Process_Start)(Dart_NativeArguments args) {
-  Dart_Handle process =  Dart_GetNativeArgument(args, 0);
+  Dart_Handle process = Dart_GetNativeArgument(args, 0);
   intptr_t process_stdin;
   intptr_t process_stdout;
   intptr_t process_stderr;
@@ -89,8 +89,8 @@
     if (Dart_IsError(result)) {
       Dart_PropagateError(result);
     }
-    result = DartUtils::SetStringField(
-        status_handle, "_errorMessage", "Path must be a builtin string");
+    result = DartUtils::SetStringField(status_handle, "_errorMessage",
+                                       "Path must be a builtin string");
     if (Dart_IsError(result)) {
       Dart_PropagateError(result);
     }
@@ -101,10 +101,8 @@
   Dart_Handle arguments = Dart_GetNativeArgument(args, 2);
   intptr_t args_length = 0;
   char** string_args =
-      ExtractCStringList(arguments,
-                         status_handle,
-                         "Arguments must be builtin strings",
-                         &args_length);
+      ExtractCStringList(arguments, status_handle,
+                         "Arguments must be builtin strings", &args_length);
   if (string_args == NULL) {
     Dart_SetReturnValue(args, Dart_NewBoolean(false));
     return;
@@ -119,9 +117,9 @@
     if (Dart_IsError(result)) {
       Dart_PropagateError(result);
     }
-    result = DartUtils::SetStringField(
-        status_handle, "_errorMessage",
-        "WorkingDirectory must be a builtin string");
+    result =
+        DartUtils::SetStringField(status_handle, "_errorMessage",
+                                  "WorkingDirectory must be a builtin string");
     if (Dart_IsError(result)) {
       Dart_PropagateError(result);
     }
@@ -132,11 +130,9 @@
   intptr_t environment_length = 0;
   char** string_environment = NULL;
   if (!Dart_IsNull(environment)) {
-    string_environment =
-        ExtractCStringList(environment,
-                           status_handle,
-                           "Environment values must be builtin strings",
-                           &environment_length);
+    string_environment = ExtractCStringList(
+        environment, status_handle,
+        "Environment values must be builtin strings", &environment_length);
     if (string_environment == NULL) {
       Dart_SetReturnValue(args, Dart_NewBoolean(false));
       return;
@@ -151,19 +147,10 @@
   intptr_t pid = -1;
   char* os_error_message = NULL;  // Scope allocated by Process::Start.
 
-  int error_code = Process::Start(path,
-                                  string_args,
-                                  args_length,
-                                  working_directory,
-                                  string_environment,
-                                  environment_length,
-                                  static_cast<ProcessStartMode>(mode),
-                                  &process_stdout,
-                                  &process_stdin,
-                                  &process_stderr,
-                                  &pid,
-                                  &exit_event,
-                                  &os_error_message);
+  int error_code = Process::Start(
+      path, string_args, args_length, working_directory, string_environment,
+      environment_length, static_cast<ProcessStartMode>(mode), &process_stdout,
+      &process_stdin, &process_stderr, &pid, &exit_event, &os_error_message);
   if (error_code == 0) {
     if (mode != kDetached) {
       Socket::SetSocketIdNativeField(stdin_handle, process_stdin);
@@ -175,16 +162,15 @@
     }
     Process::SetProcessIdNativeField(process, pid);
   } else {
-    result = DartUtils::SetIntegerField(
-        status_handle, "_errorCode", error_code);
+    result =
+        DartUtils::SetIntegerField(status_handle, "_errorCode", error_code);
     if (Dart_IsError(result)) {
       Dart_PropagateError(result);
     }
-    result = DartUtils::SetStringField(
-        status_handle,
-        "_errorMessage",
-        os_error_message != NULL ? os_error_message
-                                 : "Cannot get error message");
+    result = DartUtils::SetStringField(status_handle, "_errorMessage",
+                                       os_error_message != NULL
+                                           ? os_error_message
+                                           : "Cannot get error message");
     if (Dart_IsError(result)) {
       Dart_PropagateError(result);
     }
@@ -194,7 +180,7 @@
 
 
 void FUNCTION_NAME(Process_Wait)(Dart_NativeArguments args) {
-  Dart_Handle process =  Dart_GetNativeArgument(args, 0);
+  Dart_Handle process = Dart_GetNativeArgument(args, 0);
   intptr_t process_stdin =
       Socket::GetSocketIdNativeField(Dart_GetNativeArgument(args, 1));
   intptr_t process_stdout =
@@ -206,12 +192,8 @@
   ProcessResult result;
   intptr_t pid;
   Process::GetProcessIdNativeField(process, &pid);
-  if (Process::Wait(pid,
-                    process_stdin,
-                    process_stdout,
-                    process_stderr,
-                    exit_event,
-                    &result)) {
+  if (Process::Wait(pid, process_stdin, process_stdout, process_stderr,
+                    exit_event, &result)) {
     Dart_Handle out = result.stdout_data();
     if (Dart_IsError(out)) {
       Dart_PropagateError(out);
@@ -246,6 +228,7 @@
   int64_t status = 0;
   // Ignore result if passing invalid argument and just exit 0.
   DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &status);
+  Process::RunExitHook(status);
   Dart_ExitIsolate();
   Platform::Exit(static_cast<int>(status));
 }
@@ -329,14 +312,13 @@
     Dart_PropagateError(result);
   }
   intptr_t len;
-  char* str = StringUtils::ConsoleStringToUtf8(
-      reinterpret_cast<char*>(buffer), bytes_length, &len);
+  char* str = StringUtils::ConsoleStringToUtf8(reinterpret_cast<char*>(buffer),
+                                               bytes_length, &len);
   if (str == NULL) {
     Dart_ThrowException(
         DartUtils::NewInternalError("SystemEncodingToString failed"));
   }
-  result =
-      Dart_NewStringFromUTF8(reinterpret_cast<const uint8_t*>(str), len);
+  result = Dart_NewStringFromUTF8(reinterpret_cast<const uint8_t*>(str), len);
   Dart_SetReturnValue(args, result);
 }
 
@@ -345,8 +327,8 @@
   Dart_Handle str = Dart_GetNativeArgument(args, 0);
   char* utf8;
   intptr_t utf8_len;
-  Dart_Handle result = Dart_StringToUTF8(
-      str, reinterpret_cast<uint8_t **>(&utf8), &utf8_len);
+  Dart_Handle result =
+      Dart_StringToUTF8(str, reinterpret_cast<uint8_t**>(&utf8), &utf8_len);
   if (Dart_IsError(result)) {
     Dart_PropagateError(result);
   }
diff --git a/runtime/bin/process.h b/runtime/bin/process.h
index 359c8c1..48cf21b 100644
--- a/runtime/bin/process.h
+++ b/runtime/bin/process.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_PROCESS_H_
-#define BIN_PROCESS_H_
+#ifndef RUNTIME_BIN_PROCESS_H_
+#define RUNTIME_BIN_PROCESS_H_
 
 #include "bin/builtin.h"
 #include "bin/io_buffer.h"
@@ -19,12 +19,8 @@
  public:
   ProcessResult() : exit_code_(0) {}
 
-  void set_stdout_data(Dart_Handle stdout_data) {
-    stdout_data_ = stdout_data;
-  }
-  void set_stderr_data(Dart_Handle stderr_data) {
-    stderr_data_ = stderr_data;
-  }
+  void set_stdout_data(Dart_Handle stdout_data) { stdout_data_ = stdout_data; }
+  void set_stderr_data(Dart_Handle stderr_data) { stderr_data_ = stderr_data; }
 
   void set_exit_code(intptr_t exit_code) { exit_code_ = exit_code; }
 
@@ -126,6 +122,14 @@
     global_exit_code_ = exit_code;
   }
 
+  typedef void (*ExitHook)(int64_t exit_code);
+  static void SetExitHook(ExitHook hook) { exit_hook_ = hook; }
+  static void RunExitHook(int64_t exit_code) {
+    if (exit_hook_ != NULL) {
+      exit_hook_(exit_code);
+    }
+  }
+
   static intptr_t CurrentProcessId();
 
   static intptr_t SetSignalHandler(intptr_t signal);
@@ -133,12 +137,12 @@
 
   static Dart_Handle GetProcessIdNativeField(Dart_Handle process,
                                              intptr_t* pid);
-  static Dart_Handle SetProcessIdNativeField(Dart_Handle process,
-                                             intptr_t pid);
+  static Dart_Handle SetProcessIdNativeField(Dart_Handle process, intptr_t pid);
 
  private:
   static int global_exit_code_;
   static Mutex* global_exit_code_mutex_;
+  static ExitHook exit_hook_;
 
   DISALLOW_ALLOCATION();
   DISALLOW_IMPLICIT_CONSTRUCTORS(Process);
@@ -203,9 +207,7 @@
       next_ = NULL;
     }
 
-    ~BufferListNode() {
-      delete[] data_;
-    }
+    ~BufferListNode() { delete[] data_; }
 
     uint8_t* data_;
     BufferListNode* next_;
@@ -231,8 +233,7 @@
       Free();
       return result;
     }
-    for (BufferListNode* current = head_;
-         current != NULL;
+    for (BufferListNode* current = head_; current != NULL;
          current = current->next_) {
       intptr_t to_copy = dart::Utils::Minimum(data_size_, kBufferSize);
       memmove(buffer + buffer_position, current->data_, to_copy);
@@ -294,4 +295,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_PROCESS_H_
+#endif  // RUNTIME_BIN_PROCESS_H_
diff --git a/runtime/bin/process_android.cc b/runtime/bin/process_android.cc
index 00d6ca2..b49515f 100644
--- a/runtime/bin/process_android.cc
+++ b/runtime/bin/process_android.cc
@@ -9,14 +9,14 @@
 
 #include "bin/process.h"
 
-#include <errno.h>  // NOLINT
-#include <fcntl.h>  // NOLINT
-#include <poll.h>  // NOLINT
-#include <stdio.h>  // NOLINT
-#include <stdlib.h>  // NOLINT
-#include <string.h>  // NOLINT
+#include <errno.h>     // NOLINT
+#include <fcntl.h>     // NOLINT
+#include <poll.h>      // NOLINT
+#include <stdio.h>     // NOLINT
+#include <stdlib.h>    // NOLINT
+#include <string.h>    // NOLINT
 #include <sys/wait.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <unistd.h>    // NOLINT
 
 #include "bin/dartutils.h"
 #include "bin/fdutils.h"
@@ -27,13 +27,14 @@
 #include "platform/signal_blocker.h"
 #include "platform/utils.h"
 
-extern char **environ;
+extern char** environ;
 
 namespace dart {
 namespace bin {
 
 int Process::global_exit_code_ = 0;
 Mutex* Process::global_exit_code_mutex_ = new Mutex();
+Process::ExitHook Process::exit_hook_ = NULL;
 
 // ProcessInfo is used to map a process id to the file descriptor for
 // the pipe used to communicate the exit code of the process to Dart.
@@ -41,7 +42,7 @@
 // ProcessInfoList.
 class ProcessInfo {
  public:
-  ProcessInfo(pid_t pid, intptr_t fd) : pid_(pid), fd_(fd) { }
+  ProcessInfo(pid_t pid, intptr_t fd) : pid_(pid), fd_(fd) {}
   ~ProcessInfo() {
     int closed = TEMP_FAILURE_RETRY(close(fd_));
     if (closed != 0) {
@@ -205,7 +206,7 @@
         }
         intptr_t exit_code_fd = ProcessInfoList::LookupProcessExitFd(pid);
         if (exit_code_fd != 0) {
-          int message[2] = { exit_code, negative };
+          int message[2] = {exit_code, negative};
           ssize_t result =
               FDUtils::WriteToBlocking(exit_code_fd, &message, sizeof(message));
           // If the process has been closed, the read end of the exit
@@ -545,8 +546,8 @@
     // Read exec result from child. If no data is returned the exec was
     // successful and the exec call closed the pipe. Otherwise the errno
     // is written to the pipe.
-    bytes_read = FDUtils::ReadFromBlocking(
-        exec_control_[0], &child_errno, sizeof(child_errno));
+    bytes_read = FDUtils::ReadFromBlocking(exec_control_[0], &child_errno,
+                                           sizeof(child_errno));
     if (bytes_read == sizeof(child_errno)) {
       ReadChildError();
       return child_errno;
@@ -557,7 +558,7 @@
   }
 
 
-  int ReadDetachedExecResult(pid_t *pid) {
+  int ReadDetachedExecResult(pid_t* pid) {
     int child_errno;
     int bytes_read = -1;
     // Read exec result from child. If only pid data is returned the exec was
@@ -620,10 +621,8 @@
       max_fds = _POSIX_OPEN_MAX;
     }
     for (int fd = 0; fd < max_fds; fd++) {
-      if ((fd != exec_control_[1]) &&
-          (fd != write_out_[0]) &&
-          (fd != read_in_[1]) &&
-          (fd != read_err_[1])) {
+      if ((fd != exec_control_[1]) && (fd != write_out_[0]) &&
+          (fd != read_in_[1]) && (fd != read_err_[1])) {
         VOID_TEMP_FAILURE_RETRY(close(fd));
       }
     }
@@ -673,12 +672,11 @@
     const int kBufferSize = 1024;
     char os_error_message[kBufferSize];
     Utils::StrError(errno, os_error_message, kBufferSize);
-    int bytes_written =
-        FDUtils::WriteToBlocking(
-            exec_control_[1], &child_errno, sizeof(child_errno));
+    int bytes_written = FDUtils::WriteToBlocking(exec_control_[1], &child_errno,
+                                                 sizeof(child_errno));
     if (bytes_written == sizeof(child_errno)) {
-      FDUtils::WriteToBlocking(
-          exec_control_[1], os_error_message, strlen(os_error_message) + 1);
+      FDUtils::WriteToBlocking(exec_control_[1], os_error_message,
+                               strlen(os_error_message) + 1);
     }
     VOID_TEMP_FAILURE_RETRY(close(exec_control_[1]));
     exit(1);
@@ -727,9 +725,9 @@
   }
 
 
-  int read_in_[2];  // Pipe for stdout to child process.
-  int read_err_[2];  // Pipe for stderr to child process.
-  int write_out_[2];  // Pipe for stdin to child process.
+  int read_in_[2];       // Pipe for stdout to child process.
+  int read_err_[2];      // Pipe for stderr to child process.
+  int write_out_[2];     // Pipe for stdin to child process.
   int exec_control_[2];  // Pipe to get the result from exec.
 
   char** program_arguments_;
@@ -763,24 +761,14 @@
                    intptr_t* id,
                    intptr_t* exit_event,
                    char** os_error_message) {
-  ProcessStarter starter(path,
-                         arguments,
-                         arguments_length,
-                         working_directory,
-                         environment,
-                         environment_length,
-                         mode,
-                         in,
-                         out,
-                         err,
-                         id,
-                         exit_event,
-                         os_error_message);
+  ProcessStarter starter(path, arguments, arguments_length, working_directory,
+                         environment, environment_length, mode, in, out, err,
+                         id, exit_event, os_error_message);
   return starter.Start();
 }
 
 
-class BufferList: public BufferListBase {
+class BufferList : public BufferListBase {
  public:
   BufferList() {}
 
@@ -793,10 +781,8 @@
       ASSERT(free_size_ > 0);
       ASSERT(free_size_ <= kBufferSize);
       intptr_t block_size = dart::Utils::Minimum(free_size_, available);
-      intptr_t bytes = TEMP_FAILURE_RETRY(read(
-          fd,
-          reinterpret_cast<void*>(FreeSpaceAddress()),
-          block_size));
+      intptr_t bytes = TEMP_FAILURE_RETRY(
+          read(fd, reinterpret_cast<void*>(FreeSpaceAddress()), block_size));
       if (bytes < 0) {
         return false;
       }
@@ -872,8 +858,8 @@
           }
         } else if (fds[i].fd == exit_event) {
           if (avail == 8) {
-            intptr_t b = TEMP_FAILURE_RETRY(read(exit_event,
-                                                 exit_code_data.bytes, 8));
+            intptr_t b =
+                TEMP_FAILURE_RETRY(read(exit_event, exit_code_data.bytes, 8));
             if (b != 8) {
               return CloseProcessBuffers(fds);
             }
@@ -927,13 +913,8 @@
 static SignalInfo* signal_handlers = NULL;
 static const int kSignalsCount = 7;
 static const int kSignals[kSignalsCount] = {
-  SIGHUP,
-  SIGINT,
-  SIGTERM,
-  SIGUSR1,
-  SIGUSR2,
-  SIGWINCH,
-  SIGQUIT  // Allow VMService to listen on SIGQUIT.
+    SIGHUP, SIGINT, SIGTERM, SIGUSR1, SIGUSR2, SIGWINCH,
+    SIGQUIT  // Allow VMService to listen on SIGQUIT.
 };
 
 
diff --git a/runtime/bin/process_fuchsia.cc b/runtime/bin/process_fuchsia.cc
index 5858800..058234f 100644
--- a/runtime/bin/process_fuchsia.cc
+++ b/runtime/bin/process_fuchsia.cc
@@ -18,9 +18,9 @@
 
 int Process::global_exit_code_ = 0;
 Mutex* Process::global_exit_code_mutex_ = new Mutex();
+Process::ExitHook Process::exit_hook_ = NULL;
 
-void Process::TerminateExitCodeHandler() {
-}
+void Process::TerminateExitCodeHandler() {}
 
 intptr_t Process::CurrentProcessId() {
   UNIMPLEMENTED();
diff --git a/runtime/bin/process_linux.cc b/runtime/bin/process_linux.cc
index e533cc5..22dc683 100644
--- a/runtime/bin/process_linux.cc
+++ b/runtime/bin/process_linux.cc
@@ -9,14 +9,14 @@
 
 #include "bin/process.h"
 
-#include <errno.h>  // NOLINT
-#include <fcntl.h>  // NOLINT
-#include <poll.h>  // NOLINT
-#include <stdio.h>  // NOLINT
-#include <stdlib.h>  // NOLINT
-#include <string.h>  // NOLINT
+#include <errno.h>     // NOLINT
+#include <fcntl.h>     // NOLINT
+#include <poll.h>      // NOLINT
+#include <stdio.h>     // NOLINT
+#include <stdlib.h>    // NOLINT
+#include <string.h>    // NOLINT
 #include <sys/wait.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <unistd.h>    // NOLINT
 
 #include "bin/dartutils.h"
 #include "bin/fdutils.h"
@@ -27,13 +27,14 @@
 #include "platform/signal_blocker.h"
 #include "platform/utils.h"
 
-extern char **environ;
+extern char** environ;
 
 namespace dart {
 namespace bin {
 
 int Process::global_exit_code_ = 0;
 Mutex* Process::global_exit_code_mutex_ = new Mutex();
+Process::ExitHook Process::exit_hook_ = NULL;
 
 // ProcessInfo is used to map a process id to the file descriptor for
 // the pipe used to communicate the exit code of the process to Dart.
@@ -41,7 +42,7 @@
 // ProcessInfoList.
 class ProcessInfo {
  public:
-  ProcessInfo(pid_t pid, intptr_t fd) : pid_(pid), fd_(fd) { }
+  ProcessInfo(pid_t pid, intptr_t fd) : pid_(pid), fd_(fd) {}
   ~ProcessInfo() {
     int closed = TEMP_FAILURE_RETRY(close(fd_));
     if (closed != 0) {
@@ -205,7 +206,7 @@
         }
         intptr_t exit_code_fd = ProcessInfoList::LookupProcessExitFd(pid);
         if (exit_code_fd != 0) {
-          int message[2] = { exit_code, negative };
+          int message[2] = {exit_code, negative};
           ssize_t result =
               FDUtils::WriteToBlocking(exit_code_fd, &message, sizeof(message));
           // If the process has been closed, the read end of the exit
@@ -545,8 +546,8 @@
     // Read exec result from child. If no data is returned the exec was
     // successful and the exec call closed the pipe. Otherwise the errno
     // is written to the pipe.
-    bytes_read = FDUtils::ReadFromBlocking(
-        exec_control_[0], &child_errno, sizeof(child_errno));
+    bytes_read = FDUtils::ReadFromBlocking(exec_control_[0], &child_errno,
+                                           sizeof(child_errno));
     if (bytes_read == sizeof(child_errno)) {
       ReadChildError();
       return child_errno;
@@ -557,7 +558,7 @@
   }
 
 
-  int ReadDetachedExecResult(pid_t *pid) {
+  int ReadDetachedExecResult(pid_t* pid) {
     int child_errno;
     int bytes_read = -1;
     // Read exec result from child. If only pid data is returned the exec was
@@ -620,10 +621,8 @@
       max_fds = _POSIX_OPEN_MAX;
     }
     for (int fd = 0; fd < max_fds; fd++) {
-      if ((fd != exec_control_[1]) &&
-          (fd != write_out_[0]) &&
-          (fd != read_in_[1]) &&
-          (fd != read_err_[1])) {
+      if ((fd != exec_control_[1]) && (fd != write_out_[0]) &&
+          (fd != read_in_[1]) && (fd != read_err_[1])) {
         VOID_TEMP_FAILURE_RETRY(close(fd));
       }
     }
@@ -673,11 +672,11 @@
     const int kBufferSize = 1024;
     char error_buf[kBufferSize];
     char* os_error_message = Utils::StrError(errno, error_buf, kBufferSize);
-    int bytes_written = FDUtils::WriteToBlocking(
-        exec_control_[1], &child_errno, sizeof(child_errno));
+    int bytes_written = FDUtils::WriteToBlocking(exec_control_[1], &child_errno,
+                                                 sizeof(child_errno));
     if (bytes_written == sizeof(child_errno)) {
-      FDUtils::WriteToBlocking(
-          exec_control_[1], os_error_message, strlen(os_error_message) + 1);
+      FDUtils::WriteToBlocking(exec_control_[1], os_error_message,
+                               strlen(os_error_message) + 1);
     }
     VOID_TEMP_FAILURE_RETRY(close(exec_control_[1]));
     exit(1);
@@ -726,9 +725,9 @@
   }
 
 
-  int read_in_[2];  // Pipe for stdout to child process.
-  int read_err_[2];  // Pipe for stderr to child process.
-  int write_out_[2];  // Pipe for stdin to child process.
+  int read_in_[2];       // Pipe for stdout to child process.
+  int read_err_[2];      // Pipe for stderr to child process.
+  int write_out_[2];     // Pipe for stdin to child process.
   int exec_control_[2];  // Pipe to get the result from exec.
 
   char** program_arguments_;
@@ -762,24 +761,14 @@
                    intptr_t* id,
                    intptr_t* exit_event,
                    char** os_error_message) {
-  ProcessStarter starter(path,
-                         arguments,
-                         arguments_length,
-                         working_directory,
-                         environment,
-                         environment_length,
-                         mode,
-                         in,
-                         out,
-                         err,
-                         id,
-                         exit_event,
-                         os_error_message);
+  ProcessStarter starter(path, arguments, arguments_length, working_directory,
+                         environment, environment_length, mode, in, out, err,
+                         id, exit_event, os_error_message);
   return starter.Start();
 }
 
 
-class BufferList: public BufferListBase {
+class BufferList : public BufferListBase {
  public:
   BufferList() {}
 
@@ -792,10 +781,8 @@
       ASSERT(free_size_ > 0);
       ASSERT(free_size_ <= kBufferSize);
       intptr_t block_size = dart::Utils::Minimum(free_size_, available);
-      intptr_t bytes = TEMP_FAILURE_RETRY(read(
-          fd,
-          reinterpret_cast<void*>(FreeSpaceAddress()),
-          block_size));
+      intptr_t bytes = TEMP_FAILURE_RETRY(
+          read(fd, reinterpret_cast<void*>(FreeSpaceAddress()), block_size));
       if (bytes < 0) {
         return false;
       }
@@ -871,8 +858,8 @@
           }
         } else if (fds[i].fd == exit_event) {
           if (avail == 8) {
-            intptr_t b = TEMP_FAILURE_RETRY(read(exit_event,
-                                                 exit_code_data.bytes, 8));
+            intptr_t b =
+                TEMP_FAILURE_RETRY(read(exit_event, exit_code_data.bytes, 8));
             if (b != 8) {
               return CloseProcessBuffers(fds);
             }
@@ -926,13 +913,8 @@
 static SignalInfo* signal_handlers = NULL;
 static const int kSignalsCount = 7;
 static const int kSignals[kSignalsCount] = {
-  SIGHUP,
-  SIGINT,
-  SIGTERM,
-  SIGUSR1,
-  SIGUSR2,
-  SIGWINCH,
-  SIGQUIT  // Allow VMService to listen on SIGQUIT.
+    SIGHUP, SIGINT, SIGTERM, SIGUSR1, SIGUSR2, SIGWINCH,
+    SIGQUIT  // Allow VMService to listen on SIGQUIT.
 };
 
 
diff --git a/runtime/bin/process_macos.cc b/runtime/bin/process_macos.cc
index b3b5662..584968e 100644
--- a/runtime/bin/process_macos.cc
+++ b/runtime/bin/process_macos.cc
@@ -12,11 +12,11 @@
 #if !TARGET_OS_IOS
 #include <crt_externs.h>  // NOLINT
 #endif
-#include <errno.h>  // NOLINT
-#include <fcntl.h>  // NOLINT
-#include <poll.h>  // NOLINT
+#include <errno.h>   // NOLINT
+#include <fcntl.h>   // NOLINT
+#include <poll.h>    // NOLINT
 #include <signal.h>  // NOLINT
-#include <stdio.h>  // NOLINT
+#include <stdio.h>   // NOLINT
 #include <stdlib.h>  // NOLINT
 #include <string.h>  // NOLINT
 #include <unistd.h>  // NOLINT
@@ -35,6 +35,7 @@
 
 int Process::global_exit_code_ = 0;
 Mutex* Process::global_exit_code_mutex_ = new Mutex();
+Process::ExitHook Process::exit_hook_ = NULL;
 
 // ProcessInfo is used to map a process id to the file descriptor for
 // the pipe used to communicate the exit code of the process to Dart.
@@ -42,7 +43,7 @@
 // ProcessInfoList.
 class ProcessInfo {
  public:
-  ProcessInfo(pid_t pid, intptr_t fd) : pid_(pid), fd_(fd) { }
+  ProcessInfo(pid_t pid, intptr_t fd) : pid_(pid), fd_(fd) {}
   ~ProcessInfo() {
     int closed = TEMP_FAILURE_RETRY(close(fd_));
     if (closed != 0) {
@@ -206,7 +207,7 @@
         }
         intptr_t exit_code_fd = ProcessInfoList::LookupProcessExitFd(pid);
         if (exit_code_fd != 0) {
-          int message[2] = { exit_code, negative };
+          int message[2] = {exit_code, negative};
           ssize_t result =
               FDUtils::WriteToBlocking(exit_code_fd, &message, sizeof(message));
           // If the process has been closed, the read end of the exit
@@ -561,8 +562,8 @@
     // Read exec result from child. If no data is returned the exec was
     // successful and the exec call closed the pipe. Otherwise the errno
     // is written to the pipe.
-    bytes_read = FDUtils::ReadFromBlocking(
-        exec_control_[0], &child_errno, sizeof(child_errno));
+    bytes_read = FDUtils::ReadFromBlocking(exec_control_[0], &child_errno,
+                                           sizeof(child_errno));
     if (bytes_read == sizeof(child_errno)) {
       ReadChildError();
       return child_errno;
@@ -573,7 +574,7 @@
   }
 
 
-  int ReadDetachedExecResult(pid_t *pid) {
+  int ReadDetachedExecResult(pid_t* pid) {
     int child_errno;
     int bytes_read = -1;
     // Read exec result from child. If only pid data is returned the exec was
@@ -636,10 +637,8 @@
       max_fds = _POSIX_OPEN_MAX;
     }
     for (int fd = 0; fd < max_fds; fd++) {
-      if ((fd != exec_control_[1]) &&
-          (fd != write_out_[0]) &&
-          (fd != read_in_[1]) &&
-          (fd != read_err_[1])) {
+      if ((fd != exec_control_[1]) && (fd != write_out_[0]) &&
+          (fd != read_in_[1]) && (fd != read_err_[1])) {
         VOID_TEMP_FAILURE_RETRY(close(fd));
       }
     }
@@ -689,11 +688,11 @@
     const int kBufferSize = 1024;
     char os_error_message[kBufferSize];
     Utils::StrError(errno, os_error_message, kBufferSize);
-    int bytes_written = FDUtils::WriteToBlocking(
-        exec_control_[1], &child_errno, sizeof(child_errno));
+    int bytes_written = FDUtils::WriteToBlocking(exec_control_[1], &child_errno,
+                                                 sizeof(child_errno));
     if (bytes_written == sizeof(child_errno)) {
-      FDUtils::WriteToBlocking(
-          exec_control_[1], os_error_message, strlen(os_error_message) + 1);
+      FDUtils::WriteToBlocking(exec_control_[1], os_error_message,
+                               strlen(os_error_message) + 1);
     }
     VOID_TEMP_FAILURE_RETRY(close(exec_control_[1]));
     exit(1);
@@ -742,9 +741,9 @@
   }
 
 
-  int read_in_[2];  // Pipe for stdout to child process.
-  int read_err_[2];  // Pipe for stderr to child process.
-  int write_out_[2];  // Pipe for stdin to child process.
+  int read_in_[2];       // Pipe for stdout to child process.
+  int read_err_[2];      // Pipe for stderr to child process.
+  int write_out_[2];     // Pipe for stdin to child process.
   int exec_control_[2];  // Pipe to get the result from exec.
 
   char** program_arguments_;
@@ -778,24 +777,14 @@
                    intptr_t* id,
                    intptr_t* exit_event,
                    char** os_error_message) {
-  ProcessStarter starter(path,
-                         arguments,
-                         arguments_length,
-                         working_directory,
-                         environment,
-                         environment_length,
-                         mode,
-                         in,
-                         out,
-                         err,
-                         id,
-                         exit_event,
-                         os_error_message);
+  ProcessStarter starter(path, arguments, arguments_length, working_directory,
+                         environment, environment_length, mode, in, out, err,
+                         id, exit_event, os_error_message);
   return starter.Start();
 }
 
 
-class BufferList: public BufferListBase {
+class BufferList : public BufferListBase {
  public:
   BufferList() {}
 
@@ -808,10 +797,8 @@
       ASSERT(free_size_ > 0);
       ASSERT(free_size_ <= kBufferSize);
       size_t block_size = dart::Utils::Minimum(free_size_, available);
-      ssize_t bytes = TEMP_FAILURE_RETRY(read(
-          fd,
-          reinterpret_cast<void*>(FreeSpaceAddress()),
-          block_size));
+      ssize_t bytes = TEMP_FAILURE_RETRY(
+          read(fd, reinterpret_cast<void*>(FreeSpaceAddress()), block_size));
       if (bytes < 0) {
         return false;
       }
@@ -891,8 +878,8 @@
             }
           } else if (fds[i].fd == exit_event) {
             if (avail == 8) {
-              intptr_t b = TEMP_FAILURE_RETRY(read(fds[i].fd,
-                                                   exit_code_data.bytes, 8));
+              intptr_t b =
+                  TEMP_FAILURE_RETRY(read(fds[i].fd, exit_code_data.bytes, 8));
               if (b != 8) {
                 return CloseProcessBuffers(fds);
               }
@@ -931,35 +918,64 @@
 
 static int SignalMap(intptr_t id) {
   switch (static_cast<ProcessSignals>(id)) {
-    case kSighup: return SIGHUP;
-    case kSigint: return SIGINT;
-    case kSigquit: return SIGQUIT;
-    case kSigill: return SIGILL;
-    case kSigtrap: return SIGTRAP;
-    case kSigabrt: return SIGABRT;
-    case kSigbus: return SIGBUS;
-    case kSigfpe: return SIGFPE;
-    case kSigkill: return SIGKILL;
-    case kSigusr1: return SIGUSR1;
-    case kSigsegv: return SIGSEGV;
-    case kSigusr2: return SIGUSR2;
-    case kSigpipe: return SIGPIPE;
-    case kSigalrm: return SIGALRM;
-    case kSigterm: return SIGTERM;
-    case kSigchld: return SIGCHLD;
-    case kSigcont: return SIGCONT;
-    case kSigstop: return SIGSTOP;
-    case kSigtstp: return SIGTSTP;
-    case kSigttin: return SIGTTIN;
-    case kSigttou: return SIGTTOU;
-    case kSigurg: return SIGURG;
-    case kSigxcpu: return SIGXCPU;
-    case kSigxfsz: return SIGXFSZ;
-    case kSigvtalrm: return SIGVTALRM;
-    case kSigprof: return SIGPROF;
-    case kSigwinch: return SIGWINCH;
-    case kSigpoll: return -1;
-    case kSigsys: return SIGSYS;
+    case kSighup:
+      return SIGHUP;
+    case kSigint:
+      return SIGINT;
+    case kSigquit:
+      return SIGQUIT;
+    case kSigill:
+      return SIGILL;
+    case kSigtrap:
+      return SIGTRAP;
+    case kSigabrt:
+      return SIGABRT;
+    case kSigbus:
+      return SIGBUS;
+    case kSigfpe:
+      return SIGFPE;
+    case kSigkill:
+      return SIGKILL;
+    case kSigusr1:
+      return SIGUSR1;
+    case kSigsegv:
+      return SIGSEGV;
+    case kSigusr2:
+      return SIGUSR2;
+    case kSigpipe:
+      return SIGPIPE;
+    case kSigalrm:
+      return SIGALRM;
+    case kSigterm:
+      return SIGTERM;
+    case kSigchld:
+      return SIGCHLD;
+    case kSigcont:
+      return SIGCONT;
+    case kSigstop:
+      return SIGSTOP;
+    case kSigtstp:
+      return SIGTSTP;
+    case kSigttin:
+      return SIGTTIN;
+    case kSigttou:
+      return SIGTTOU;
+    case kSigurg:
+      return SIGURG;
+    case kSigxcpu:
+      return SIGXCPU;
+    case kSigxfsz:
+      return SIGXFSZ;
+    case kSigvtalrm:
+      return SIGVTALRM;
+    case kSigprof:
+      return SIGPROF;
+    case kSigwinch:
+      return SIGWINCH;
+    case kSigpoll:
+      return -1;
+    case kSigsys:
+      return SIGSYS;
   }
   return -1;
 }
@@ -984,13 +1000,8 @@
 static SignalInfo* signal_handlers = NULL;
 static const int kSignalsCount = 7;
 static const int kSignals[kSignalsCount] = {
-  SIGHUP,
-  SIGINT,
-  SIGTERM,
-  SIGUSR1,
-  SIGUSR2,
-  SIGWINCH,
-  SIGQUIT  // Allow VMService to listen on SIGQUIT.
+    SIGHUP, SIGINT, SIGTERM, SIGUSR1, SIGUSR2, SIGWINCH,
+    SIGQUIT  // Allow VMService to listen on SIGQUIT.
 };
 
 
@@ -1031,8 +1042,7 @@
   if (NO_RETRY_EXPECTED(pipe(fds)) != 0) {
     return -1;
   }
-  if (!FDUtils::SetCloseOnExec(fds[0]) ||
-      !FDUtils::SetCloseOnExec(fds[1]) ||
+  if (!FDUtils::SetCloseOnExec(fds[0]) || !FDUtils::SetCloseOnExec(fds[1]) ||
       !FDUtils::SetNonBlocking(fds[0])) {
     VOID_TEMP_FAILURE_RETRY(close(fds[0]));
     VOID_TEMP_FAILURE_RETRY(close(fds[1]));
diff --git a/runtime/bin/process_patch.dart b/runtime/bin/process_patch.dart
index bfb09db..d34a28c 100644
--- a/runtime/bin/process_patch.dart
+++ b/runtime/bin/process_patch.dart
@@ -125,9 +125,9 @@
     }
   }
 
-  @patch static _setSignalHandler(int signal)
+  static _setSignalHandler(int signal)
       native "Process_SetSignalHandler";
-  @patch static int _clearSignalHandler(int signal)
+  static int _clearSignalHandler(int signal)
       native "Process_ClearSignalHandler";
 }
 
diff --git a/runtime/bin/process_unsupported.cc b/runtime/bin/process_unsupported.cc
index 64bed26..c8e0bdb 100644
--- a/runtime/bin/process_unsupported.cc
+++ b/runtime/bin/process_unsupported.cc
@@ -15,80 +15,80 @@
 
 int Process::global_exit_code_ = 0;
 Mutex* Process::global_exit_code_mutex_ = new Mutex();
+Process::ExitHook Process::exit_hook_ = NULL;
 
-void Process::TerminateExitCodeHandler() {
-}
+void Process::TerminateExitCodeHandler() {}
 
 
 void FUNCTION_NAME(Process_Start)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "Process is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("Process is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Process_Wait)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "Process is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("Process is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Process_KillPid)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "Process is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("Process is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Process_Exit)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "Process is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("Process is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Process_SetExitCode)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "Process is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("Process is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Process_GetExitCode)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "Process is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("Process is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Process_Sleep)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "Process is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("Process is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Process_Pid)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "Process is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("Process is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Process_SetSignalHandler)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "Process is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("Process is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(Process_ClearSignalHandler)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "Process is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("Process is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(SystemEncodingToString)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "Process is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("Process is not supported on this platform"));
 }
 
 
 void FUNCTION_NAME(StringToSystemEncoding)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewInternalError(
-        "Process is not supported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewInternalError("Process is not supported on this platform"));
 }
 
 }  // namespace bin
diff --git a/runtime/bin/process_win.cc b/runtime/bin/process_win.cc
index b96e67b..a2d93a4 100644
--- a/runtime/bin/process_win.cc
+++ b/runtime/bin/process_win.cc
@@ -29,6 +29,7 @@
 
 int Process::global_exit_code_ = 0;
 Mutex* Process::global_exit_code_mutex_ = new Mutex();
+Process::ExitHook Process::exit_hook_ = NULL;
 
 // ProcessInfo is used to map a process id to the process handle,
 // wait handle for registered exit code event and the pipe used to
@@ -44,7 +45,7 @@
       : process_id_(process_id),
         process_handle_(process_handle),
         wait_handle_(wait_handle),
-        exit_pipe_(exit_pipe) { }
+        exit_pipe_(exit_pipe) {}
 
   ~ProcessInfo() {
     BOOL success = CloseHandle(process_handle_);
@@ -93,12 +94,8 @@
     MutexLocker locker(mutex_);
     HANDLE wait_handle = INVALID_HANDLE_VALUE;
     BOOL success = RegisterWaitForSingleObject(
-        &wait_handle,
-        handle,
-        &ExitCodeCallback,
-        reinterpret_cast<void*>(pid),
-        INFINITE,
-        WT_EXECUTEONLYONCE);
+        &wait_handle, handle, &ExitCodeCallback, reinterpret_cast<void*>(pid),
+        INFINITE, WT_EXECUTEONLYONCE);
     if (!success) {
       FATAL("Failed to register exit code wait operation.");
     }
@@ -176,7 +173,7 @@
       exit_code = abs(exit_code);
       negative = 1;
     }
-    int message[2] = { exit_code, negative };
+    int message[2] = {exit_code, negative};
     DWORD written;
     ok = WriteFile(exit_pipe, message, sizeof(message), &written, NULL);
     // If the process has been closed, the read end of the exit
@@ -209,11 +206,7 @@
 
 
 // Types of pipes to create.
-enum NamedPipeType {
-  kInheritRead,
-  kInheritWrite,
-  kInheritNone
-};
+enum NamedPipeType { kInheritRead, kInheritWrite, kInheritNone };
 
 
 // Create a pipe for communicating with a new process. The handles array
@@ -232,13 +225,12 @@
 
   if (type == kInheritRead) {
     handles[kWriteHandle] =
-        CreateNamedPipeW(pipe_name,
-                         PIPE_ACCESS_OUTBOUND | FILE_FLAG_OVERLAPPED,
+        CreateNamedPipeW(pipe_name, PIPE_ACCESS_OUTBOUND | FILE_FLAG_OVERLAPPED,
                          PIPE_TYPE_BYTE | PIPE_WAIT,
-                         1,             // Number of pipes
-                         1024,          // Out buffer size
-                         1024,          // In buffer size
-                         0,             // Timeout in ms
+                         1,     // Number of pipes
+                         1024,  // Out buffer size
+                         1024,  // In buffer size
+                         0,     // Timeout in ms
                          NULL);
 
     if (handles[kWriteHandle] == INVALID_HANDLE_VALUE) {
@@ -247,13 +239,8 @@
     }
 
     handles[kReadHandle] =
-        CreateFileW(pipe_name,
-                    GENERIC_READ,
-                    0,
-                    &inherit_handle,
-                    OPEN_EXISTING,
-                    FILE_READ_ATTRIBUTES | FILE_FLAG_OVERLAPPED,
-                    NULL);
+        CreateFileW(pipe_name, GENERIC_READ, 0, &inherit_handle, OPEN_EXISTING,
+                    FILE_READ_ATTRIBUTES | FILE_FLAG_OVERLAPPED, NULL);
     if (handles[kReadHandle] == INVALID_HANDLE_VALUE) {
       Log::PrintErr("CreateFile failed %d\n", GetLastError());
       return false;
@@ -261,13 +248,12 @@
   } else {
     ASSERT((type == kInheritWrite) || (type == kInheritNone));
     handles[kReadHandle] =
-        CreateNamedPipeW(pipe_name,
-                         PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED,
+        CreateNamedPipeW(pipe_name, PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED,
                          PIPE_TYPE_BYTE | PIPE_WAIT,
-                         1,             // Number of pipes
-                         1024,          // Out buffer size
-                         1024,          // In buffer size
-                         0,             // Timeout in ms
+                         1,     // Number of pipes
+                         1024,  // Out buffer size
+                         1024,  // In buffer size
+                         0,     // Timeout in ms
                          NULL);
 
     if (handles[kReadHandle] == INVALID_HANDLE_VALUE) {
@@ -275,14 +261,10 @@
       return false;
     }
 
-    handles[kWriteHandle] =
-        CreateFileW(pipe_name,
-                    GENERIC_WRITE,
-                    0,
-                    (type == kInheritWrite) ? &inherit_handle : NULL,
-                    OPEN_EXISTING,
-                    FILE_WRITE_ATTRIBUTES | FILE_FLAG_OVERLAPPED,
-                    NULL);
+    handles[kWriteHandle] = CreateFileW(
+        pipe_name, GENERIC_WRITE, 0,
+        (type == kInheritWrite) ? &inherit_handle : NULL, OPEN_EXISTING,
+        FILE_WRITE_ATTRIBUTES | FILE_FLAG_OVERLAPPED, NULL);
     if (handles[kWriteHandle] == INVALID_HANDLE_VALUE) {
       Log::PrintErr("CreateFile failed %d\n", GetLastError());
       return false;
@@ -331,13 +313,8 @@
   inherit_handle.nLength = sizeof(SECURITY_ATTRIBUTES);
   inherit_handle.bInheritHandle = TRUE;
   inherit_handle.lpSecurityDescriptor = NULL;
-  HANDLE nul = CreateFile(L"NUL",
-                          GENERIC_READ | GENERIC_WRITE,
-                          0,
-                          &inherit_handle,
-                          OPEN_EXISTING,
-                          0,
-                          NULL);
+  HANDLE nul = CreateFile(L"NUL", GENERIC_READ | GENERIC_WRITE, 0,
+                          &inherit_handle, OPEN_EXISTING, 0, NULL);
   if (nul == INVALID_HANDLE_VALUE) {
     Log::PrintErr("CloseHandle failed %d\n", GetLastError());
   }
@@ -345,15 +322,20 @@
 }
 
 
-typedef BOOL (WINAPI *InitProcThreadAttrListFn)(
-    LPPROC_THREAD_ATTRIBUTE_LIST, DWORD, DWORD, PSIZE_T);
+typedef BOOL(WINAPI* InitProcThreadAttrListFn)(LPPROC_THREAD_ATTRIBUTE_LIST,
+                                               DWORD,
+                                               DWORD,
+                                               PSIZE_T);
 
-typedef BOOL (WINAPI *UpdateProcThreadAttrFn)(
-    LPPROC_THREAD_ATTRIBUTE_LIST, DWORD, DWORD_PTR,
-    PVOID, SIZE_T, PVOID, PSIZE_T);
+typedef BOOL(WINAPI* UpdateProcThreadAttrFn)(LPPROC_THREAD_ATTRIBUTE_LIST,
+                                             DWORD,
+                                             DWORD_PTR,
+                                             PVOID,
+                                             SIZE_T,
+                                             PVOID,
+                                             PSIZE_T);
 
-typedef VOID (WINAPI *DeleteProcThreadAttrListFn)(
-     LPPROC_THREAD_ATTRIBUTE_LIST);
+typedef VOID(WINAPI* DeleteProcThreadAttrListFn)(LPPROC_THREAD_ATTRIBUTE_LIST);
 
 
 static InitProcThreadAttrListFn init_proc_thread_attr_list = NULL;
@@ -384,7 +366,7 @@
 
 
 const int kMaxPipeNameSize = 80;
-template<int Count>
+template <int Count>
 static int GenerateNames(wchar_t pipe_names[Count][kMaxPipeNameSize]) {
   UUID uuid;
   RPC_STATUS status = UuidCreateSequential(&uuid);
@@ -398,9 +380,8 @@
   }
   for (int i = 0; i < Count; i++) {
     static const wchar_t* prefix = L"\\\\.\\Pipe\\dart";
-    _snwprintf(pipe_names[i],
-               kMaxPipeNameSize,
-               L"%s_%s_%d", prefix, uuid_string, i + 1);
+    _snwprintf(pipe_names[i], kMaxPipeNameSize, L"%s_%s_%d", prefix,
+               uuid_string, i + 1);
   }
   status = RpcStringFreeW(&uuid_string);
   if (status != RPC_S_OK) {
@@ -449,7 +430,7 @@
     system_arguments = reinterpret_cast<wchar_t**>(
         Dart_ScopeAllocate(arguments_length * sizeof(*system_arguments)));
     for (int i = 0; i < arguments_length; i++) {
-       system_arguments[i] = StringUtilsWin::Utf8ToWide(arguments[i]);
+      system_arguments[i] = StringUtilsWin::Utf8ToWide(arguments[i]);
     }
 
     // Compute command-line length.
@@ -461,8 +442,8 @@
     command_line_length += arguments_length + 1;
 
     // Put together command-line string.
-    command_line_ = reinterpret_cast<wchar_t*>(Dart_ScopeAllocate(
-        command_line_length * sizeof(*command_line_)));
+    command_line_ = reinterpret_cast<wchar_t*>(
+        Dart_ScopeAllocate(command_line_length * sizeof(*command_line_)));
     int len = 0;
     int remaining = command_line_length;
     int written =
@@ -471,8 +452,8 @@
     remaining -= written;
     ASSERT(remaining >= 0);
     for (int i = 0; i < arguments_length; i++) {
-      written = _snwprintf(
-          command_line_ + len, remaining, L" %s", system_arguments[i]);
+      written = _snwprintf(command_line_ + len, remaining, L" %s",
+                           system_arguments[i]);
       len += written;
       remaining -= written;
       ASSERT(remaining >= 0);
@@ -495,15 +476,13 @@
       for (intptr_t i = 0; i < environment_length; i++) {
         block_size += wcslen(system_environment[i]) + 1;
       }
-      environment_block_ = reinterpret_cast<wchar_t*>(Dart_ScopeAllocate(
-          block_size * sizeof(*environment_block_)));
+      environment_block_ = reinterpret_cast<wchar_t*>(
+          Dart_ScopeAllocate(block_size * sizeof(*environment_block_)));
       intptr_t block_index = 0;
       for (intptr_t i = 0; i < environment_length; i++) {
         intptr_t len = wcslen(system_environment[i]);
-        intptr_t result = _snwprintf(environment_block_ + block_index,
-                                     len,
-                                     L"%s",
-                                     system_environment[i]);
+        intptr_t result = _snwprintf(environment_block_ + block_index, len,
+                                     L"%s", system_environment[i]);
         ASSERT(result == len);
         block_index += len;
         environment_block_[block_index++] = '\0';
@@ -564,17 +543,13 @@
         return CleanupAndReturnError();
       }
       static const int kNumInheritedHandles = 3;
-      HANDLE inherited_handles[kNumInheritedHandles] =
-          { stdin_handles_[kReadHandle],
-            stdout_handles_[kWriteHandle],
-            stderr_handles_[kWriteHandle] };
-      if (!update_proc_thread_attr(attribute_list_,
-                                   0,
-                                   PROC_THREAD_ATTRIBUTE_HANDLE_LIST,
-                                   inherited_handles,
-                                   kNumInheritedHandles * sizeof(HANDLE),
-                                   NULL,
-                                   NULL)) {
+      HANDLE inherited_handles[kNumInheritedHandles] = {
+          stdin_handles_[kReadHandle], stdout_handles_[kWriteHandle],
+          stderr_handles_[kWriteHandle]};
+      if (!update_proc_thread_attr(
+              attribute_list_, 0, PROC_THREAD_ATTRIBUTE_HANDLE_LIST,
+              inherited_handles, kNumInheritedHandles * sizeof(HANDLE), NULL,
+              NULL)) {
         return CleanupAndReturnError();
       }
       startup_info.lpAttributeList = attribute_list_;
@@ -589,16 +564,14 @@
     if (mode_ != kNormal) {
       creation_flags |= DETACHED_PROCESS;
     }
-    BOOL result = CreateProcessW(NULL,   // ApplicationName
-                                 command_line_,
-                                 NULL,   // ProcessAttributes
-                                 NULL,   // ThreadAttributes
-                                 TRUE,   // InheritHandles
-                                 creation_flags,
-                                 environment_block_,
-                                 system_working_directory_,
-                                 reinterpret_cast<STARTUPINFOW*>(&startup_info),
-                                 &process_info);
+    BOOL result = CreateProcessW(
+        NULL,  // ApplicationName
+        command_line_,
+        NULL,  // ProcessAttributes
+        NULL,  // ThreadAttributes
+        TRUE,  // InheritHandles
+        creation_flags, environment_block_, system_working_directory_,
+        reinterpret_cast<STARTUPINFOW*>(&startup_info), &process_info);
 
     if (result == 0) {
       return CleanupAndReturnError();
@@ -681,8 +654,8 @@
 
   int CleanupAndReturnError() {
     int error_code = SetOsErrorMessage(os_error_message_);
-    CloseProcessPipes(
-        stdin_handles_, stdout_handles_, stderr_handles_, exit_handles_);
+    CloseProcessPipes(stdin_handles_, stdout_handles_, stderr_handles_,
+                      exit_handles_);
     return error_code;
   }
 
@@ -726,26 +699,16 @@
                    intptr_t* id,
                    intptr_t* exit_handler,
                    char** os_error_message) {
-  ProcessStarter starter(path,
-                         arguments,
-                         arguments_length,
-                         working_directory,
-                         environment,
-                         environment_length,
-                         mode,
-                         in,
-                         out,
-                         err,
-                         id,
-                         exit_handler,
-                         os_error_message);
+  ProcessStarter starter(path, arguments, arguments_length, working_directory,
+                         environment, environment_length, mode, in, out, err,
+                         id, exit_handler, os_error_message);
   return starter.Start();
 }
 
 
-class BufferList: public BufferListBase {
+class BufferList : public BufferListBase {
  public:
-  BufferList() : read_pending_(true) { }
+  BufferList() : read_pending_(true) {}
 
   // Indicate that data has been read into the buffer provided to
   // overlapped read.
@@ -770,9 +733,7 @@
     read_pending_ = true;
   }
 
-  intptr_t GetDataSize() {
-    return data_size_;
-  }
+  intptr_t GetDataSize() { return data_size_; }
 
   uint8_t* GetFirstDataBuffer() {
     ASSERT(head_ != NULL);
@@ -781,9 +742,7 @@
     return head_->data_;
   }
 
-  void FreeDataBuffer() {
-    Free();
-  }
+  void FreeDataBuffer() { Free(); }
 
  private:
   bool read_pending_;
@@ -802,9 +761,7 @@
     ClearOverlapped();
   }
 
-  bool HasEvent(HANDLE event) {
-    return (event_ == event);
-  }
+  bool HasEvent(HANDLE event) { return (event_ == event); }
 
   bool Read() {
     // Get the data read as a result of a completed overlapped operation.
@@ -828,21 +785,13 @@
     }
   }
 
-  Dart_Handle GetData() {
-    return buffer_.GetData();
-  }
+  Dart_Handle GetData() { return buffer_.GetData(); }
 
-  intptr_t GetDataSize() {
-    return buffer_.GetDataSize();
-  }
+  intptr_t GetDataSize() { return buffer_.GetDataSize(); }
 
-  uint8_t* GetFirstDataBuffer() {
-    return buffer_.GetFirstDataBuffer();
-  }
+  uint8_t* GetFirstDataBuffer() { return buffer_.GetFirstDataBuffer(); }
 
-  void FreeDataBuffer() {
-    return buffer_.FreeDataBuffer();
-  }
+  void FreeDataBuffer() { return buffer_.FreeDataBuffer(); }
 
   void Close() {
     CloseHandle(handle_);
@@ -955,10 +904,8 @@
   HANDLE wait_handle;
   HANDLE exit_pipe;
   // First check the process info list for the process to get a handle to it.
-  bool success = ProcessInfoList::LookupProcess(id,
-                                                &process_handle,
-                                                &wait_handle,
-                                                &exit_pipe);
+  bool success = ProcessInfoList::LookupProcess(id, &process_handle,
+                                                &wait_handle, &exit_pipe);
   // For detached processes we don't have the process registered in the
   // process info list. Try to look it up through the OS.
   if (!success) {
@@ -1010,8 +957,10 @@
 
 intptr_t GetWinSignal(intptr_t signal) {
   switch (signal) {
-    case kSighup: return CTRL_CLOSE_EVENT;
-    case kSigint: return CTRL_C_EVENT;
+    case kSighup:
+      return CTRL_CLOSE_EVENT;
+    case kSigint:
+      return CTRL_C_EVENT;
     default:
       return -1;
   }
diff --git a/runtime/bin/reference_counting.h b/runtime/bin/reference_counting.h
index 8e79f4f..8721948 100644
--- a/runtime/bin/reference_counting.h
+++ b/runtime/bin/reference_counting.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_REFERENCE_COUNTING_H_
-#define BIN_REFERENCE_COUNTING_H_
+#ifndef RUNTIME_BIN_REFERENCE_COUNTING_H_
+#define RUNTIME_BIN_REFERENCE_COUNTING_H_
 
 #include "vm/atomic.h"
 
@@ -11,7 +11,8 @@
 namespace bin {
 
 // Forward declaration.
-template <class Target> class RefCntReleaseScope;
+template <class Target>
+class RefCntReleaseScope;
 
 // Inherit from this class where instances of the derived class should be
 // reference counted. Reference counts on instances are incremented and
@@ -32,13 +33,9 @@
 template <class Derived>
 class ReferenceCounted {
  public:
-  ReferenceCounted() :
-    ref_count_(1) {
-  }
+  ReferenceCounted() : ref_count_(1) {}
 
-  ~ReferenceCounted() {
-    ASSERT(ref_count_ == 0);
-  }
+  ~ReferenceCounted() { ASSERT(ref_count_ == 0); }
 
   void Retain() {
     uintptr_t old = AtomicOperations::FetchAndIncrement(&ref_count_);
@@ -78,9 +75,7 @@
     ASSERT(target_ != NULL);
     ASSERT(target_->ref_count() > 0);
   }
-  ~RefCntReleaseScope() {
-    target_->Release();
-  }
+  ~RefCntReleaseScope() { target_->Release(); }
 
  private:
   ReferenceCounted<Target>* target_;
@@ -142,9 +137,7 @@
     }
   }
 
-  Target* get() const {
-    return static_cast<Target*>(target_);
-  }
+  Target* get() const { return static_cast<Target*>(target_); }
 
  private:
   ReferenceCounted<Target>* target_;
@@ -156,4 +149,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_REFERENCE_COUNTING_H_
+#endif  // RUNTIME_BIN_REFERENCE_COUNTING_H_
diff --git a/runtime/bin/root_certificates_unsupported.cc b/runtime/bin/root_certificates_unsupported.cc
index 304a59e..1ba98c8 100644
--- a/runtime/bin/root_certificates_unsupported.cc
+++ b/runtime/bin/root_certificates_unsupported.cc
@@ -5,8 +5,7 @@
 #if !defined(DART_IO_DISABLED) && !defined(DART_IO_SECURE_SOCKET_DISABLED)
 
 #include "platform/globals.h"
-#if defined(TARGET_OS_MACOS) || \
-    defined(TARGET_OS_ANDROID) || \
+#if defined(TARGET_OS_MACOS) || defined(TARGET_OS_ANDROID) ||                  \
     defined(DART_IO_ROOT_CERTS_DISABLED)
 
 namespace dart {
diff --git a/runtime/bin/run_vm_tests.cc b/runtime/bin/run_vm_tests.cc
index 0be9565..3f621fe 100644
--- a/runtime/bin/run_vm_tests.cc
+++ b/runtime/bin/run_vm_tests.cc
@@ -55,8 +55,8 @@
   if ((run_filter == kAllBenchmarks) ||
       (strcmp(run_filter, this->name()) == 0)) {
     this->Run();
-    OS::Print("%s(%s): %" Pd64 "\n",
-              this->name(), this->score_kind(), this->score());
+    OS::Print("%s(%s): %" Pd64 "\n", this->name(), this->score_kind(),
+              this->score());
     run_matches++;
   } else if (run_filter == kList) {
     fprintf(stdout, "%s\n", this->name());
@@ -66,8 +66,9 @@
 
 
 static void PrintUsage() {
-  fprintf(stderr, "run_vm_tests [--list | --benchmarks | "
-                  "<test name> | <benchmark name>]\n");
+  fprintf(stderr,
+          "run_vm_tests [--list | --benchmarks | "
+          "<test name> | <benchmark name>]\n");
   fprintf(stderr, "run_vm_tests [vm-flags ...] <test name>\n");
   fprintf(stderr, "run_vm_tests [vm-flags ...] <benchmark name>\n");
 }
@@ -103,19 +104,14 @@
     dart_argc = argc - 2;
     dart_argv = &argv[1];
   }
-  bool set_vm_flags_success = Flags::ProcessCommandLineFlags(dart_argc,
-                                                             dart_argv);
+  bool set_vm_flags_success =
+      Flags::ProcessCommandLineFlags(dart_argc, dart_argv);
   ASSERT(set_vm_flags_success);
-  const char* err_msg = Dart::InitOnce(dart::bin::vm_isolate_snapshot_buffer,
-                                       NULL, NULL,
-                                       NULL, NULL,
-                                       NULL,
-                                       dart::bin::DartUtils::OpenFile,
-                                       dart::bin::DartUtils::ReadFile,
-                                       dart::bin::DartUtils::WriteFile,
-                                       dart::bin::DartUtils::CloseFile,
-                                       NULL,
-                                       NULL);
+  const char* err_msg = Dart::InitOnce(
+      dart::bin::vm_isolate_snapshot_buffer, NULL, NULL, NULL, NULL, NULL,
+      dart::bin::DartUtils::OpenFile, dart::bin::DartUtils::ReadFile,
+      dart::bin::DartUtils::WriteFile, dart::bin::DartUtils::CloseFile, NULL,
+      NULL);
   ASSERT(err_msg == NULL);
   // Apply the filter to all registered tests.
   TestCaseBase::RunAll();
diff --git a/runtime/bin/run_vm_tests_fuchsia.cc b/runtime/bin/run_vm_tests_fuchsia.cc
index 8137a59..71cf5c3 100644
--- a/runtime/bin/run_vm_tests_fuchsia.cc
+++ b/runtime/bin/run_vm_tests_fuchsia.cc
@@ -5,11 +5,11 @@
 #include <fcntl.h>
 #include <launchpad/launchpad.h>
 #include <launchpad/vmo.h>
+#include <magenta/status.h>
 #include <magenta/syscalls.h>
+#include <magenta/syscalls/object.h>
 #include <mxio/util.h>
 #include <pthread.h>
-#include <runtime/status.h>
-#include <runtime/sysinfo.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -23,8 +23,9 @@
 // tests, and then runs them.
 
 // TODO(zra): Make this a command line argument
-const char* kRunVmTestsPath = "/boot/bin/dart_vm_tests";
+const char* kRunVmTestsPath = "/system/bin/dart_vm_tests";
 
+// clang-format off
 // Tests that are invalid, wedge, or cause panics.
 const char* kSkip[] = {
   // These expect a file to exist that we aren't putting in the image.
@@ -98,21 +99,16 @@
   "Fail2",
   "AllocGeneric_Overflow",
   "CodeImmutability",
+  // Assumes initial thread's stack is the same size as spawned thread stacks.
+  "StackOverflowStacktraceInfo",
 };
 
 // Bugs to fix, or things that are not yet implemented.
 const char* kBugs[] = {
-  // Needs NativeSymbolResolver
-  "Service_PersistentHandles",
-  // Needs lstat
-  "DirectoryCreateTemp",
-  "DirectoryCreateDelete",
-  // Needs rename
-  "DirectoryRename",
   // Needs read of RSS.
   "InitialRSS",
 };
-
+// clang-format on
 
 static bool contains(const char** list, intptr_t len, const char* str) {
   for (intptr_t i = 0; i < len; i++) {
@@ -125,14 +121,13 @@
 
 
 static bool isSkip(const char* test) {
-  return contains(
-      kSkip, sizeof(kSkip) / sizeof(kSkip[0]), test);
+  return contains(kSkip, sizeof(kSkip) / sizeof(kSkip[0]), test);
 }
 
 
 static bool isExpectFail(const char* test) {
-  return contains(
-      kExpectFail, sizeof(kExpectFail) / sizeof(kExpectFail[0]), test);
+  return contains(kExpectFail, sizeof(kExpectFail) / sizeof(kExpectFail[0]),
+                  test);
 }
 
 
@@ -140,27 +135,28 @@
   return contains(kBugs, sizeof(kBugs) / sizeof(kBugs[0]), test);
 }
 
-
 #define RETURN_IF_ERROR(status)                                                \
   if (status < 0) {                                                            \
-    fprintf(stderr, "%s:%d: Magenta call failed: %s\n",                        \
-        __FILE__, __LINE__, mx_strstatus(static_cast<mx_status_t>(status)));   \
+    fprintf(stderr, "%s:%d: Magenta call failed: %s\n", __FILE__, __LINE__,    \
+            mx_status_get_string(static_cast<mx_status_t>(status)));           \
     fflush(0);                                                                 \
     return status;                                                             \
-  }                                                                            \
-
+  }
 
 // This is mostly taken from //magenta/system/uapp/mxsh with the addtion of
 // launchpad_add_pipe calls to setup pipes for stdout and stderr.
-static mx_status_t lp_setup(launchpad_t** lp_out, mx_handle_t binary_vmo,
-                            int argc, const char* const* argv,
-                            int *stdout_out, int *stderr_out) {
+static mx_status_t lp_setup(launchpad_t** lp_out,
+                            mx_handle_t binary_vmo,
+                            int argc,
+                            const char* const* argv,
+                            int* stdout_out,
+                            int* stderr_out) {
   if ((lp_out == NULL) || (stdout_out == NULL) || (stderr_out == NULL)) {
     return ERR_INVALID_ARGS;
   }
   launchpad_t* lp;
   mx_status_t status;
-  status = launchpad_create(argv[0], &lp);
+  status = launchpad_create(0, argv[0], &lp);
   RETURN_IF_ERROR(status);
   status = launchpad_arguments(lp, argc, argv);
   RETURN_IF_ERROR(status);
@@ -183,8 +179,10 @@
 
 // Start the test running and return file descriptors for the stdout and stderr
 // pipes.
-static mx_handle_t start_test(mx_handle_t binary_vmo, const char* test_name,
-                              int* stdout_out, int* stderr_out) {
+static mx_handle_t start_test(mx_handle_t binary_vmo,
+                              const char* test_name,
+                              int* stdout_out,
+                              int* stderr_out) {
   const intptr_t kArgc = 2;
   const char* argv[kArgc];
 
@@ -194,8 +192,8 @@
   launchpad_t* lp = NULL;
   int stdout_pipe = -1;
   int stderr_pipe = -1;
-  mx_status_t status = lp_setup(
-      &lp, binary_vmo, kArgc, argv, &stdout_pipe, &stderr_pipe);
+  mx_status_t status =
+      lp_setup(&lp, binary_vmo, kArgc, argv, &stdout_pipe, &stderr_pipe);
   if (status != NO_ERROR) {
     if (lp != NULL) {
       launchpad_destroy(lp);
@@ -261,8 +259,10 @@
 
 // Runs test 'test_name' and gives stdout and stderr for the test in
 // 'test_stdout' and 'test_stderr'. Returns the exit code from the test.
-static int run_test(mx_handle_t binary_vmo, const char* test_name,
-                    char** test_stdout, char** test_stderr) {
+static int run_test(mx_handle_t binary_vmo,
+                    const char* test_name,
+                    char** test_stdout,
+                    char** test_stderr) {
   int stdout_pipe = -1;
   int stderr_pipe = -1;
   mx_handle_t p = start_test(binary_vmo, test_name, &stdout_pipe, &stderr_pipe);
@@ -271,36 +271,38 @@
   drain_fd(stdout_pipe, test_stdout);
   drain_fd(stderr_pipe, test_stderr);
 
-  mx_signals_state_t state;
-  mx_status_t r = mx_handle_wait_one(
-      p, MX_SIGNAL_SIGNALED, MX_TIME_INFINITE, &state);
+  mx_status_t r =
+      mx_handle_wait_one(p, MX_SIGNAL_SIGNALED, MX_TIME_INFINITE, NULL);
   RETURN_IF_ERROR(r);
 
   mx_info_process_t proc_info;
-  mx_ssize_t info_size = mx_object_get_info(
-      p, MX_INFO_PROCESS, sizeof(proc_info.rec), &proc_info, sizeof(proc_info));
-  RETURN_IF_ERROR(info_size);
+  mx_status_t status = mx_object_get_info(p, MX_INFO_PROCESS, &proc_info,
+                                          sizeof(proc_info), nullptr, nullptr);
+  RETURN_IF_ERROR(status);
 
   r = mx_handle_close(p);
   RETURN_IF_ERROR(r);
-  return proc_info.rec.return_code;
+  return proc_info.return_code;
 }
 
 
-static void handle_result(
-    intptr_t result, char* test_stdout, char* test_stderr, const char* test) {
+static void handle_result(intptr_t result,
+                          char* test_stdout,
+                          char* test_stderr,
+                          const char* test) {
   if (result != 0) {
     if (!isExpectFail(test) && !isBug(test)) {
-      printf("**** Test %s FAILED\n\nstdout:\n%s\nstderr:\n%s\n",
-          test, test_stdout, test_stderr);
+      printf("**** Test %s FAILED\n\nstdout:\n%s\nstderr:\n%s\n", test,
+             test_stdout, test_stderr);
     } else {
       printf("Test %s FAILED and is expected to fail\n", test);
     }
   } else {
     if (isExpectFail(test)) {
-      printf("**** Test %s is expected to fail, but PASSED\n\n"
-             "stdout:\n%s\nstderr:\n%s\n",
-             test, test_stdout, test_stderr);
+      printf(
+          "**** Test %s is expected to fail, but PASSED\n\n"
+          "stdout:\n%s\nstderr:\n%s\n",
+          test, test_stdout, test_stderr);
     } else if (isBug(test)) {
       printf("**** Test %s is marked as a bug, but PASSED\n", test);
     } else {
@@ -332,7 +334,8 @@
     const char* test = args->test_list[index];
     char* test_stdout = NULL;
     char* test_stderr = NULL;
-    mx_handle_t vmo_dup = mx_handle_duplicate(binary_vmo, MX_RIGHT_SAME_RIGHTS);
+    mx_handle_t vmo_dup = MX_HANDLE_INVALID;
+    mx_handle_duplicate(binary_vmo, MX_RIGHT_SAME_RIGHTS, &vmo_dup);
     int test_status = run_test(vmo_dup, test, &test_stdout, &test_stderr);
     handle_result(test_status, test_stdout, test_stderr, test);
     free(test_stdout);
@@ -348,7 +351,7 @@
 static void run_all_tests(runner_args_t* args) {
   const intptr_t num_cpus = sysconf(_SC_NPROCESSORS_CONF);
   pthread_t* threads =
-    reinterpret_cast<pthread_t*>(malloc(num_cpus * sizeof(pthread_t)));
+      reinterpret_cast<pthread_t*>(malloc(num_cpus * sizeof(pthread_t)));
   for (int i = 0; i < num_cpus; i++) {
     pthread_create(&threads[i], NULL, test_runner_thread, args);
   }
@@ -400,8 +403,10 @@
   // Run with --list to grab the list of tests.
   char* list_stdout = NULL;
   char* list_stderr = NULL;
-  mx_handle_t list_vmo = mx_handle_duplicate(binary_vmo, MX_RIGHT_SAME_RIGHTS);
-  RETURN_IF_ERROR(list_vmo);
+  mx_handle_t list_vmo = MX_HANDLE_INVALID;
+  mx_status_t status =
+      mx_handle_duplicate(binary_vmo, MX_RIGHT_SAME_RIGHTS, &list_vmo);
+  RETURN_IF_ERROR(status);
   int list_result = run_test(list_vmo, "--list", &list_stdout, &list_stderr);
   if (list_result != 0) {
     fprintf(stderr, "Failed to list tests: %s\n%s\n", list_stdout, list_stderr);
@@ -438,7 +443,7 @@
   }
   free(test_list);
   pthread_mutex_destroy(&args_mutex);
-  mx_status_t status = mx_handle_close(binary_vmo);
+  status = mx_handle_close(binary_vmo);
   RETURN_IF_ERROR(status);
 
   // Complain if we didn't try to run all of the tests.
diff --git a/runtime/bin/secure_socket.h b/runtime/bin/secure_socket.h
index 5dfee9e..543820b 100644
--- a/runtime/bin/secure_socket.h
+++ b/runtime/bin/secure_socket.h
@@ -2,17 +2,16 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_SECURE_SOCKET_H_
-#define BIN_SECURE_SOCKET_H_
+#ifndef RUNTIME_BIN_SECURE_SOCKET_H_
+#define RUNTIME_BIN_SECURE_SOCKET_H_
 
 #if defined(DART_IO_DISABLED) || defined(DART_IO_SECURE_SOCKET_DISABLED)
 #error "secure_socket.h can only be included on builds with SSL enabled"
 #endif
 
 #include "platform/globals.h"
-#if defined(TARGET_OS_ANDROID) || \
-    defined(TARGET_OS_LINUX)   || \
-    defined(TARGET_OS_WINDOWS)
+#if defined(TARGET_OS_ANDROID) || defined(TARGET_OS_LINUX) ||                  \
+    defined(TARGET_OS_WINDOWS) || defined(TARGET_OS_FUCHSIA)
 #include "bin/secure_socket_boringssl.h"
 #elif defined(TARGET_OS_MACOS)
 #if TARGET_OS_IOS
@@ -24,4 +23,4 @@
 #error Unknown target os.
 #endif
 
-#endif  // BIN_SECURE_SOCKET_H_
+#endif  // RUNTIME_BIN_SECURE_SOCKET_H_
diff --git a/runtime/bin/secure_socket_boringssl.cc b/runtime/bin/secure_socket_boringssl.cc
index 132588d..90d22fb 100644
--- a/runtime/bin/secure_socket_boringssl.cc
+++ b/runtime/bin/secure_socket_boringssl.cc
@@ -5,9 +5,8 @@
 #if !defined(DART_IO_DISABLED) && !defined(DART_IO_SECURE_SOCKET_DISABLED)
 
 #include "platform/globals.h"
-#if defined(TARGET_OS_ANDROID) || \
-    defined(TARGET_OS_LINUX)   || \
-    defined(TARGET_OS_WINDOWS)
+#if defined(TARGET_OS_ANDROID) || defined(TARGET_OS_LINUX) ||                  \
+    defined(TARGET_OS_WINDOWS) || defined(TARGET_OS_FUCHSIA)
 
 #include "bin/secure_socket.h"
 #include "bin/secure_socket_boringssl.h"
@@ -117,18 +116,16 @@
   SSLFilter* filter;
   Dart_Handle dart_this = ThrowIfError(Dart_GetNativeArgument(args, 0));
   ASSERT(Dart_IsInstance(dart_this));
-  ThrowIfError(Dart_GetNativeInstanceField(
-      dart_this,
-      kSSLFilterNativeFieldIndex,
-      reinterpret_cast<intptr_t*>(&filter)));
+  ThrowIfError(
+      Dart_GetNativeInstanceField(dart_this, kSSLFilterNativeFieldIndex,
+                                  reinterpret_cast<intptr_t*>(&filter)));
   return filter;
 }
 
 
-static void DeleteFilter(
-    void* isolate_data,
-    Dart_WeakPersistentHandle handle,
-    void* context_pointer) {
+static void DeleteFilter(void* isolate_data,
+                         Dart_WeakPersistentHandle handle,
+                         void* context_pointer) {
   SSLFilter* filter = reinterpret_cast<SSLFilter*>(context_pointer);
   filter->Release();
 }
@@ -139,15 +136,12 @@
   Dart_Handle dart_this = Dart_GetNativeArgument(args, 0);
   RETURN_IF_ERROR(dart_this);
   ASSERT(Dart_IsInstance(dart_this));
-  Dart_Handle err = Dart_SetNativeInstanceField(
-      dart_this,
-      kSSLFilterNativeFieldIndex,
-      reinterpret_cast<intptr_t>(filter));
+  Dart_Handle err =
+      Dart_SetNativeInstanceField(dart_this, kSSLFilterNativeFieldIndex,
+                                  reinterpret_cast<intptr_t>(filter));
   RETURN_IF_ERROR(err);
-  Dart_NewWeakPersistentHandle(dart_this,
-                               reinterpret_cast<void*>(filter),
-                               sizeof(*filter),
-                               DeleteFilter);
+  Dart_NewWeakPersistentHandle(dart_this, reinterpret_cast<void*>(filter),
+                               sizeof(*filter), DeleteFilter);
   return Dart_Null();
 }
 
@@ -156,18 +150,16 @@
   SSLContext* context;
   Dart_Handle dart_this = ThrowIfError(Dart_GetNativeArgument(args, 0));
   ASSERT(Dart_IsInstance(dart_this));
-  ThrowIfError(Dart_GetNativeInstanceField(
-      dart_this,
-      kSecurityContextNativeFieldIndex,
-      reinterpret_cast<intptr_t*>(&context)));
+  ThrowIfError(
+      Dart_GetNativeInstanceField(dart_this, kSecurityContextNativeFieldIndex,
+                                  reinterpret_cast<intptr_t*>(&context)));
   return context;
 }
 
 
-static void DeleteSecurityContext(
-    void* isolate_data,
-    Dart_WeakPersistentHandle handle,
-    void* context_pointer) {
+static void DeleteSecurityContext(void* isolate_data,
+                                  Dart_WeakPersistentHandle handle,
+                                  void* context_pointer) {
   SSLContext* context = static_cast<SSLContext*>(context_pointer);
   delete context;
 }
@@ -179,14 +171,11 @@
   Dart_Handle dart_this = Dart_GetNativeArgument(args, 0);
   RETURN_IF_ERROR(dart_this);
   ASSERT(Dart_IsInstance(dart_this));
-  Dart_Handle err = Dart_SetNativeInstanceField(
-      dart_this,
-      kSecurityContextNativeFieldIndex,
-      reinterpret_cast<intptr_t>(context));
+  Dart_Handle err =
+      Dart_SetNativeInstanceField(dart_this, kSecurityContextNativeFieldIndex,
+                                  reinterpret_cast<intptr_t>(context));
   RETURN_IF_ERROR(err);
-  Dart_NewWeakPersistentHandle(dart_this,
-                               context,
-                               approximate_size_of_context,
+  Dart_NewWeakPersistentHandle(dart_this, context, approximate_size_of_context,
                                DeleteSecurityContext);
   return Dart_Null();
 }
@@ -196,10 +185,9 @@
   X509* certificate;
   Dart_Handle dart_this = ThrowIfError(Dart_GetNativeArgument(args, 0));
   ASSERT(Dart_IsInstance(dart_this));
-  ThrowIfError(Dart_GetNativeInstanceField(
-      dart_this,
-      kX509NativeFieldIndex,
-      reinterpret_cast<intptr_t*>(&certificate)));
+  ThrowIfError(
+      Dart_GetNativeInstanceField(dart_this, kX509NativeFieldIndex,
+                                  reinterpret_cast<intptr_t*>(&certificate)));
   return certificate;
 }
 
@@ -237,8 +225,7 @@
       DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 4));
   bool require_client_certificate =
       DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 5));
-  Dart_Handle protocols_handle =
-      ThrowIfError(Dart_GetNativeArgument(args, 6));
+  Dart_Handle protocols_handle = ThrowIfError(Dart_GetNativeArgument(args, 6));
 
   const char* host_name = NULL;
   // TODO(whesse): Is truncating a Dart string containing \0 what we want?
@@ -247,8 +234,7 @@
   SSLContext* context = NULL;
   if (!Dart_IsNull(context_object)) {
     ThrowIfError(Dart_GetNativeInstanceField(
-        context_object,
-        kSecurityContextNativeFieldIndex,
+        context_object, kSecurityContextNativeFieldIndex,
         reinterpret_cast<intptr_t*>(&context)));
   }
 
@@ -256,12 +242,9 @@
   // It will have the correct length encoding of the protocols array.
   ASSERT(!Dart_IsNull(protocols_handle));
 
-  GetFilter(args)->Connect(host_name,
-                           context->context(),
-                           is_server,
+  GetFilter(args)->Connect(host_name, context->context(), is_server,
                            request_client_certificate,
-                           require_client_certificate,
-                           protocols_handle);
+                           require_client_certificate, protocols_handle);
 }
 
 
@@ -295,8 +278,7 @@
       DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 2));
   bool require_client_certificate =
       DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 3));
-  GetFilter(args)->Renegotiate(use_session_cache,
-                               request_client_certificate,
+  GetFilter(args)->Renegotiate(use_session_cache, request_client_certificate,
                                require_client_certificate);
 }
 
@@ -315,8 +297,7 @@
 
 void FUNCTION_NAME(SecureSocket_RegisterBadCertificateCallback)(
     Dart_NativeArguments args) {
-  Dart_Handle callback =
-      ThrowIfError(Dart_GetNativeArgument(args, 1));
+  Dart_Handle callback = ThrowIfError(Dart_GetNativeArgument(args, 1));
   if (!Dart_IsClosure(callback) && !Dart_IsNull(callback)) {
     Dart_ThrowException(DartUtils::NewDartArgumentError(
         "Illegal argument to RegisterBadCertificateCallback"));
@@ -325,8 +306,7 @@
 }
 
 
-void FUNCTION_NAME(SecureSocket_PeerCertificate)
-    (Dart_NativeArguments args) {
+void FUNCTION_NAME(SecureSocket_PeerCertificate)(Dart_NativeArguments args) {
   Dart_Handle cert = ThrowIfError(GetFilter(args)->PeerCertificate());
   Dart_SetReturnValue(args, cert);
 }
@@ -342,10 +322,9 @@
 }
 
 
-static void ReleaseCertificate(
-    void* isolate_data,
-    Dart_WeakPersistentHandle handle,
-    void* context_pointer) {
+static void ReleaseCertificate(void* isolate_data,
+                               Dart_WeakPersistentHandle handle,
+                               void* context_pointer) {
   X509* cert = reinterpret_cast<X509*>(context_pointer);
   X509_free(cert);
 }
@@ -365,7 +344,7 @@
     X509_free(certificate);
     return x509_type;
   }
-  Dart_Handle arguments[] = { NULL };
+  Dart_Handle arguments[] = {NULL};
   Dart_Handle result =
       Dart_New(x509_type, DartUtils::NewString("_"), 0, arguments);
   if (Dart_IsError(result)) {
@@ -374,15 +353,12 @@
   }
   ASSERT(Dart_IsInstance(result));
   Dart_Handle status = Dart_SetNativeInstanceField(
-      result,
-      kX509NativeFieldIndex,
-      reinterpret_cast<intptr_t>(certificate));
+      result, kX509NativeFieldIndex, reinterpret_cast<intptr_t>(certificate));
   if (Dart_IsError(status)) {
     X509_free(certificate);
     return status;
   }
-  Dart_NewWeakPersistentHandle(result,
-                               reinterpret_cast<void*>(certificate),
+  Dart_NewWeakPersistentHandle(result, reinterpret_cast<void*>(certificate),
                                approximate_size_of_certificate,
                                ReleaseCertificate);
   return result;
@@ -399,8 +375,8 @@
   }
   X509* certificate = X509_STORE_CTX_get_current_cert(store_ctx);
   int ssl_index = SSL_get_ex_data_X509_STORE_CTX_idx();
-  SSL* ssl = static_cast<SSL*>(
-      X509_STORE_CTX_get_ex_data(store_ctx, ssl_index));
+  SSL* ssl =
+      static_cast<SSL*>(X509_STORE_CTX_get_ex_data(store_ctx, ssl_index));
   SSLFilter* filter = static_cast<SSLFilter*>(
       SSL_get_ex_data(ssl, SSLFilter::filter_ssl_index));
   Dart_Handle callback = filter->bad_certificate_callback();
@@ -439,7 +415,6 @@
   SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, CertificateCallback);
   SSL_CTX_set_min_version(ctx, TLS1_VERSION);
   SSL_CTX_set_cipher_list(ctx, "HIGH:MEDIUM");
-  SSL_CTX_set_cipher_list_tls11(ctx, "HIGH:MEDIUM");
   SSLContext* context = new SSLContext(ctx);
   Dart_Handle err = SetSecurityContext(args, context);
   if (Dart_IsError(err)) {
@@ -485,8 +460,8 @@
  public:
   explicit ScopedMemBIO(Dart_Handle object) {
     if (!Dart_IsTypedData(object) && !Dart_IsList(object)) {
-      Dart_ThrowException(DartUtils::NewDartArgumentError(
-          "Argument is not a List<int>"));
+      Dart_ThrowException(
+          DartUtils::NewDartArgumentError("Argument is not a List<int>"));
     }
 
     uint8_t* bytes = NULL;
@@ -496,10 +471,7 @@
       is_typed_data = true;
       Dart_TypedData_Type typ;
       ThrowIfError(Dart_TypedDataAcquireData(
-          object,
-          &typ,
-          reinterpret_cast<void**>(&bytes),
-          &bytes_len));
+          object, &typ, reinterpret_cast<void**>(&bytes), &bytes_len));
     } else {
       ASSERT(Dart_IsList(object));
       ThrowIfError(Dart_ListLength(object, &bytes_len));
@@ -542,7 +514,7 @@
   DISALLOW_COPY_AND_ASSIGN(ScopedMemBIO);
 };
 
-template<typename T, void (*free_func)(T*)>
+template <typename T, void (*free_func)(T*)>
 class ScopedSSLType {
  public:
   explicit ScopedSSLType(T* obj) : obj_(obj) {}
@@ -569,7 +541,7 @@
   DISALLOW_COPY_AND_ASSIGN(ScopedSSLType);
 };
 
-template<typename T, typename E, void (*func)(E*)>
+template <typename T, typename E, void (*func)(E*)>
 class ScopedSSLStackType {
  public:
   explicit ScopedSSLStackType(T* obj) : obj_(obj) {}
@@ -577,7 +549,7 @@
   ~ScopedSSLStackType() {
     if (obj_ != NULL) {
       sk_pop_free(reinterpret_cast<_STACK*>(obj_),
-                  reinterpret_cast<void (*)(void *)>(func));
+                  reinterpret_cast<void (*)(void*)>(func));
     }
   }
 
@@ -615,8 +587,8 @@
   }
 
   EVP_PKEY* key = NULL;
-  X509 *cert = NULL;
-  STACK_OF(X509) *ca_certs = NULL;
+  X509* cert = NULL;
+  STACK_OF(X509)* ca_certs = NULL;
   int status = PKCS12_parse(p12.get(), password, &key, &cert, &ca_certs);
   if (status == 0) {
     return NULL;
@@ -630,8 +602,8 @@
 
 
 static EVP_PKEY* GetPrivateKey(BIO* bio, const char* password) {
-  EVP_PKEY *key = PEM_read_bio_PrivateKey(
-      bio, NULL, PasswordCallback, const_cast<char*>(password));
+  EVP_PKEY* key = PEM_read_bio_PrivateKey(bio, NULL, PasswordCallback,
+                                          const_cast<char*>(password));
   if (key == NULL) {
     // We try reading data as PKCS12 only if reading as PEM was unsuccessful and
     // if there is no indication that the data is malformed PEM. We assume the
@@ -659,13 +631,13 @@
     ThrowIfError(Dart_StringToCString(password_object, &password));
     if (strlen(password) > PEM_BUFSIZE - 1) {
       Dart_ThrowException(DartUtils::NewDartArgumentError(
-        "Password length is greater than 1023 (PEM_BUFSIZE)"));
+          "Password length is greater than 1023 (PEM_BUFSIZE)"));
     }
   } else if (Dart_IsNull(password_object)) {
     password = "";
   } else {
-    Dart_ThrowException(DartUtils::NewDartArgumentError(
-        "Password is not a String or null"));
+    Dart_ThrowException(
+        DartUtils::NewDartArgumentError("Password is not a String or null"));
   }
   return password;
 }
@@ -679,7 +651,7 @@
   int status;
   {
     ScopedMemBIO bio(ThrowIfError(Dart_GetNativeArgument(args, 1)));
-    EVP_PKEY *key = GetPrivateKey(bio.bio(), password);
+    EVP_PKEY* key = GetPrivateKey(bio.bio(), password);
     status = SSL_CTX_use_PrivateKey(context->context(), key);
     // SSL_CTX_use_PrivateKey increments the reference count of key on success,
     // so we have to call EVP_PKEY_free on both success and failure.
@@ -702,8 +674,8 @@
   }
 
   EVP_PKEY* key = NULL;
-  X509 *cert = NULL;
-  STACK_OF(X509) *ca_certs = NULL;
+  X509* cert = NULL;
+  STACK_OF(X509)* ca_certs = NULL;
   int status = PKCS12_parse(p12.get(), password, &key, &cert, &ca_certs);
   if (status == 0) {
     return status;
@@ -780,12 +752,10 @@
   int status;
   {
     ScopedMemBIO bio(ThrowIfError(Dart_GetNativeArgument(args, 1)));
-    status = SetTrustedCertificatesBytes(
-        context->context(), bio.bio(), password);
+    status =
+        SetTrustedCertificatesBytes(context->context(), bio.bio(), password);
   }
-  CheckStatus(status,
-              "TlsException",
-              "Failure in setTrustedCertificatesBytes");
+  CheckStatus(status, "TlsException", "Failure in setTrustedCertificatesBytes");
 }
 
 
@@ -796,6 +766,9 @@
 
 static void AddCompiledInCerts(SSLContext* context) {
   if (root_certificates_pem == NULL) {
+    if (SSL_LOG_STATUS) {
+      Log::Print("Missing compiled-in roots\n");
+    }
     return;
   }
   X509_STORE* store = SSL_CTX_get_cert_store(context->context());
@@ -830,7 +803,7 @@
     ThrowIOException(-1, "TlsException", "Failed to find root cert file");
   }
   int status = SSL_CTX_load_verify_locations(context->context(), file, NULL);
-  CheckStatus(status, "TlsException", "Failure trusting builtint roots");
+  CheckStatus(status, "TlsException", "Failure trusting builtin roots");
   if (SSL_LOG_STATUS) {
     Log::Print("Trusting roots from: %s\n", file);
   }
@@ -845,7 +818,7 @@
     ThrowIOException(-1, "TlsException", "Failed to find root cert cache");
   }
   int status = SSL_CTX_load_verify_locations(context->context(), NULL, cache);
-  CheckStatus(status, "TlsException", "Failure trusting builtint roots");
+  CheckStatus(status, "TlsException", "Failure trusting builtin roots");
   if (SSL_LOG_STATUS) {
     Log::Print("Trusting roots from: %s\n", cache);
   }
@@ -899,10 +872,10 @@
 
   // Fall back on the compiled-in certs if the standard locations don't exist,
   // or we aren't on Linux.
-  AddCompiledInCerts(context);
   if (SSL_LOG_STATUS) {
     Log::Print("Trusting compiled-in roots\n");
   }
+  AddCompiledInCerts(context);
 }
 
 
@@ -915,8 +888,8 @@
   }
 
   EVP_PKEY* key = NULL;
-  X509 *cert = NULL;
-  STACK_OF(X509) *ca_certs = NULL;
+  X509* cert = NULL;
+  STACK_OF(X509)* ca_certs = NULL;
   int status = PKCS12_parse(p12.get(), password, &key, &cert, &ca_certs);
   if (status == 0) {
     return status;
@@ -1011,9 +984,7 @@
     ScopedMemBIO bio(ThrowIfError(Dart_GetNativeArgument(args, 1)));
     status = UseChainBytes(context->context(), bio.bio(), password);
   }
-  CheckStatus(status,
-              "TlsException",
-              "Failure in useCertificateChainBytes");
+  CheckStatus(status, "TlsException", "Failure in useCertificateChainBytes");
 }
 
 
@@ -1026,8 +997,8 @@
   }
 
   EVP_PKEY* key = NULL;
-  X509 *cert = NULL;
-  STACK_OF(X509) *ca_certs = NULL;
+  X509* cert = NULL;
+  STACK_OF(X509)* ca_certs = NULL;
   int status = PKCS12_parse(p12.get(), password, &key, &cert, &ca_certs);
   if (status == 0) {
     return status;
@@ -1098,19 +1069,15 @@
     status = SetClientAuthorities(context->context(), bio.bio(), password);
   }
 
-  CheckStatus(status,
-      "TlsException",
-      "Failure in setClientAuthoritiesBytes");
+  CheckStatus(status, "TlsException", "Failure in setClientAuthoritiesBytes");
 }
 
 
 void FUNCTION_NAME(SecurityContext_SetAlpnProtocols)(
     Dart_NativeArguments args) {
   SSLContext* context = GetSecurityContext(args);
-  Dart_Handle protocols_handle =
-      ThrowIfError(Dart_GetNativeArgument(args, 1));
-  Dart_Handle is_server_handle =
-      ThrowIfError(Dart_GetNativeArgument(args, 2));
+  Dart_Handle protocols_handle = ThrowIfError(Dart_GetNativeArgument(args, 1));
+  Dart_Handle is_server_handle = ThrowIfError(Dart_GetNativeArgument(args, 2));
   if (Dart_IsBoolean(is_server_handle)) {
     bool is_server = DartUtils::GetBooleanValue(is_server_handle);
     SetAlpnProtocolList(protocols_handle, NULL, context, is_server);
@@ -1121,8 +1088,7 @@
 }
 
 
-void FUNCTION_NAME(X509_Subject)(
-    Dart_NativeArguments args) {
+void FUNCTION_NAME(X509_Subject)(Dart_NativeArguments args) {
   X509* certificate = GetX509Certificate(args);
   X509_NAME* subject = X509_get_subject_name(certificate);
   char* subject_string = X509_NAME_oneline(subject, NULL, 0);
@@ -1131,8 +1097,7 @@
 }
 
 
-void FUNCTION_NAME(X509_Issuer)(
-    Dart_NativeArguments args) {
+void FUNCTION_NAME(X509_Issuer)(Dart_NativeArguments args) {
   X509* certificate = GetX509Certificate(args);
   X509_NAME* issuer = X509_get_issuer_name(certificate);
   char* issuer_string = X509_NAME_oneline(issuer, NULL, 0);
@@ -1154,16 +1119,14 @@
   return Dart_NewInteger((86400LL * days + seconds) * 1000LL);
 }
 
-void FUNCTION_NAME(X509_StartValidity)(
-    Dart_NativeArguments args) {
+void FUNCTION_NAME(X509_StartValidity)(Dart_NativeArguments args) {
   X509* certificate = GetX509Certificate(args);
   ASN1_TIME* not_before = X509_get_notBefore(certificate);
   Dart_SetReturnValue(args, ASN1TimeToMilliseconds(not_before));
 }
 
 
-void FUNCTION_NAME(X509_EndValidity)(
-    Dart_NativeArguments args) {
+void FUNCTION_NAME(X509_EndValidity)(Dart_NativeArguments args) {
   X509* certificate = GetX509Certificate(args);
   ASN1_TIME* not_after = X509_get_notAfter(certificate);
   Dart_SetReturnValue(args, ASN1TimeToMilliseconds(not_after));
@@ -1205,8 +1168,8 @@
   }
 
   if (filter->ProcessAllBuffers(starts, ends, in_handshake)) {
-    CObjectArray* result = new CObjectArray(
-        CObject::NewArray(SSLFilter::kNumBuffers * 2));
+    CObjectArray* result =
+        new CObjectArray(CObject::NewArray(SSLFilter::kNumBuffers * 2));
     for (int i = 0; i < SSLFilter::kNumBuffers; ++i) {
       result->SetAt(2 * i, new CObjectInt32(CObject::NewInt32(starts[i])));
       result->SetAt(2 * i + 1, new CObjectInt32(CObject::NewInt32(ends[i])));
@@ -1246,18 +1209,18 @@
           // Then, since the last free byte is at position start - 2,
           // the interval is [end, size - 1).
           int buffer_end = (start == 0) ? size - 1 : size;
-          int bytes = (i == kReadPlaintext) ?
-              ProcessReadPlaintextBuffer(end, buffer_end) :
-              ProcessWriteEncryptedBuffer(end, buffer_end);
+          int bytes = (i == kReadPlaintext)
+                          ? ProcessReadPlaintextBuffer(end, buffer_end)
+                          : ProcessWriteEncryptedBuffer(end, buffer_end);
           if (bytes < 0) return false;
           end += bytes;
           ASSERT(end <= size);
           if (end == size) end = 0;
         }
         if (start > end + 1) {
-          int bytes =  (i == kReadPlaintext) ?
-              ProcessReadPlaintextBuffer(end, start - 1) :
-              ProcessWriteEncryptedBuffer(end, start - 1);
+          int bytes = (i == kReadPlaintext)
+                          ? ProcessReadPlaintextBuffer(end, start - 1)
+                          : ProcessWriteEncryptedBuffer(end, start - 1);
           if (bytes < 0) return false;
           end += bytes;
           ASSERT(end < start);
@@ -1271,18 +1234,18 @@
         if (end < start) {
           // Data may be split into two segments.  In this case,
           // the first is [start, size).
-          int bytes = (i == kReadEncrypted) ?
-              ProcessReadEncryptedBuffer(start, size) :
-              ProcessWritePlaintextBuffer(start, size);
+          int bytes = (i == kReadEncrypted)
+                          ? ProcessReadEncryptedBuffer(start, size)
+                          : ProcessWritePlaintextBuffer(start, size);
           if (bytes < 0) return false;
           start += bytes;
           ASSERT(start <= size);
           if (start == size) start = 0;
         }
         if (start < end) {
-          int bytes = (i == kReadEncrypted) ?
-              ProcessReadEncryptedBuffer(start, end) :
-              ProcessWritePlaintextBuffer(start, end);
+          int bytes = (i == kReadEncrypted)
+                          ? ProcessReadEncryptedBuffer(start, end)
+                          : ProcessWritePlaintextBuffer(start, end);
           if (bytes < 0) return false;
           start += bytes;
           ASSERT(start <= end);
@@ -1326,8 +1289,8 @@
   RETURN_IF_ERROR(secure_filter_impl_type);
   Dart_Handle size_string = DartUtils::NewString("SIZE");
   RETURN_IF_ERROR(size_string);
-  Dart_Handle dart_buffer_size = Dart_GetField(
-      secure_filter_impl_type, size_string);
+  Dart_Handle dart_buffer_size =
+      Dart_GetField(secure_filter_impl_type, size_string);
   RETURN_IF_ERROR(dart_buffer_size);
 
   int64_t buffer_size = 0;
@@ -1337,8 +1300,8 @@
   Dart_Handle encrypted_size_string = DartUtils::NewString("ENCRYPTED_SIZE");
   RETURN_IF_ERROR(encrypted_size_string);
 
-  Dart_Handle dart_encrypted_buffer_size = Dart_GetField(
-      secure_filter_impl_type, encrypted_size_string);
+  Dart_Handle dart_encrypted_buffer_size =
+      Dart_GetField(secure_filter_impl_type, encrypted_size_string);
   RETURN_IF_ERROR(dart_encrypted_buffer_size);
 
   int64_t encrypted_buffer_size = 0;
@@ -1430,12 +1393,12 @@
 }
 
 
-int AlpnCallback(SSL *ssl,
-                 const uint8_t **out,
-                 uint8_t *outlen,
-                 const uint8_t *in,
+int AlpnCallback(SSL* ssl,
+                 const uint8_t** out,
+                 uint8_t* outlen,
+                 const uint8_t* in,
                  unsigned int inlen,
-                 void *arg) {
+                 void* arg) {
   // 'in' and 'arg' are sequences of (length, data) strings with 1-byte lengths.
   // 'arg' is 0-terminated. Finds the first string in 'arg' that is in 'in'.
   uint8_t* server_list = static_cast<uint8_t*>(arg);
@@ -1474,10 +1437,8 @@
   int status;
 
   Dart_Handle result = Dart_TypedDataAcquireData(
-      protocols_handle,
-      &protocols_type,
-      reinterpret_cast<void**>(&protocol_string),
-      &protocol_string_len);
+      protocols_handle, &protocols_type,
+      reinterpret_cast<void**>(&protocol_string), &protocol_string_len);
   if (Dart_IsError(result)) {
     Dart_PropagateError(result);
   }
@@ -1500,8 +1461,8 @@
           static_cast<uint8_t*>(malloc(protocol_string_len + 1));
       memmove(protocol_string_copy, protocol_string, protocol_string_len);
       protocol_string_copy[protocol_string_len] = '\0';
-      SSL_CTX_set_alpn_select_cb(
-          context->context(), AlpnCallback, protocol_string_copy);
+      SSL_CTX_set_alpn_select_cb(context->context(), AlpnCallback,
+                                 protocol_string_copy);
       context->set_alpn_protocol_string(protocol_string_copy);
     } else {
       // The function makes a local copy of protocol_string, which it owns.
@@ -1511,8 +1472,8 @@
       } else {
         ASSERT(context != NULL);
         ASSERT(ssl == NULL);
-        status = SSL_CTX_set_alpn_protos(
-            context->context(), protocol_string, protocol_string_len);
+        status = SSL_CTX_set_alpn_protos(context->context(), protocol_string,
+                                         protocol_string_len);
       }
       ASSERT(status == 0);  // The function returns a non-standard status.
     }
@@ -1544,9 +1505,13 @@
   SSL_set_mode(ssl_, SSL_MODE_AUTO_RETRY);  // TODO(whesse): Is this right?
   SSL_set_ex_data(ssl_, filter_ssl_index, this);
 
+#if defined(TARGET_OS_FUCHSIA)
+  // Temporary workaround until we isolate the memory leak issue.
+  SSL_set_verify(ssl_, SSL_VERIFY_NONE, NULL);
+#else
   if (is_server_) {
     int certificate_mode =
-      request_client_certificate ? SSL_VERIFY_PEER : SSL_VERIFY_NONE;
+        request_client_certificate ? SSL_VERIFY_PEER : SSL_VERIFY_NONE;
     if (require_client_certificate) {
       certificate_mode |= SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
     }
@@ -1559,15 +1524,16 @@
     // against the certificate presented by the server.
     X509_VERIFY_PARAM* certificate_checking_parameters = SSL_get0_param(ssl_);
     hostname_ = strdup(hostname);
-    X509_VERIFY_PARAM_set_flags(certificate_checking_parameters,
-                                X509_V_FLAG_PARTIAL_CHAIN |
-                                X509_V_FLAG_TRUSTED_FIRST);
+    X509_VERIFY_PARAM_set_flags(
+        certificate_checking_parameters,
+        X509_V_FLAG_PARTIAL_CHAIN | X509_V_FLAG_TRUSTED_FIRST);
     X509_VERIFY_PARAM_set_hostflags(certificate_checking_parameters, 0);
     status = X509_VERIFY_PARAM_set1_host(certificate_checking_parameters,
                                          hostname_, strlen(hostname_));
     CheckStatus(status, "TlsException",
                 "Set hostname for certificate checking");
   }
+#endif  // defined(TARGET_OS_FUCHSIA)
   // Make the connection:
   if (is_server_) {
     status = SSL_accept(ssl_);
@@ -1598,11 +1564,12 @@
 }
 
 
-int printErrorCallback(const char *str, size_t len, void *ctx) {
+int printErrorCallback(const char* str, size_t len, void* ctx) {
   Log::PrintErr("%.*s\n", static_cast<int>(len), str);
   return 1;
 }
 
+
 void SSLFilter::Handshake() {
   // Try and push handshake along.
   int status;
@@ -1618,9 +1585,9 @@
     in_handshake_ = true;
     return;
   }
-  CheckStatus(status,
-      "HandshakeException",
-      is_server_ ? "Handshake error in server" : "Handshake error in client");
+  CheckStatus(status, "HandshakeException", is_server_
+                                                ? "Handshake error in server"
+                                                : "Handshake error in client");
   // Handshake succeeded.
   if (in_handshake_) {
     // TODO(24071): Check return value of SSL_get_verify_result, this
@@ -1644,6 +1611,7 @@
   }
 }
 
+
 void SSLFilter::GetSelectedProtocol(Dart_NativeArguments args) {
   const uint8_t* protocol;
   unsigned length;
@@ -1722,8 +1690,7 @@
   int bytes_processed = 0;
   if (length > 0) {
     bytes_processed = SSL_read(
-        ssl_,
-        reinterpret_cast<char*>((buffers_[kReadPlaintext] + start)),
+        ssl_, reinterpret_cast<char*>((buffers_[kReadPlaintext] + start)),
         length);
     if (bytes_processed < 0) {
       int error = SSL_get_error(ssl_, bytes_processed);
@@ -1737,8 +1704,8 @@
 
 int SSLFilter::ProcessWritePlaintextBuffer(int start, int end) {
   int length = end - start;
-  int bytes_processed = SSL_write(
-      ssl_, buffers_[kWritePlaintext] + start, length);
+  int bytes_processed =
+      SSL_write(ssl_, buffers_[kWritePlaintext] + start, length);
   if (bytes_processed < 0) {
     if (SSL_LOG_DATA) {
       Log::Print("SSL_write returned error %d\n", bytes_processed);
@@ -1752,8 +1719,8 @@
 /* Read encrypted data from the circular buffer to the filter */
 int SSLFilter::ProcessReadEncryptedBuffer(int start, int end) {
   int length = end - start;
-  if (SSL_LOG_DATA) Log::Print(
-      "Entering ProcessReadEncryptedBuffer with %d bytes\n", length);
+  if (SSL_LOG_DATA)
+    Log::Print("Entering ProcessReadEncryptedBuffer with %d bytes\n", length);
   int bytes_processed = 0;
   if (length > 0) {
     bytes_processed =
@@ -1761,14 +1728,15 @@
     if (bytes_processed <= 0) {
       bool retry = BIO_should_retry(socket_side_);
       if (!retry) {
-        if (SSL_LOG_DATA) Log::Print(
-            "BIO_write failed in ReadEncryptedBuffer\n");
+        if (SSL_LOG_DATA)
+          Log::Print("BIO_write failed in ReadEncryptedBuffer\n");
       }
       bytes_processed = 0;
     }
   }
-  if (SSL_LOG_DATA) Log::Print(
-      "Leaving ProcessReadEncryptedBuffer wrote %d bytes\n", bytes_processed);
+  if (SSL_LOG_DATA)
+    Log::Print("Leaving ProcessReadEncryptedBuffer wrote %d bytes\n",
+               bytes_processed);
   return bytes_processed;
 }
 
@@ -1777,16 +1745,17 @@
   int length = end - start;
   int bytes_processed = 0;
   if (length > 0) {
-    bytes_processed = BIO_read(socket_side_,
-                               buffers_[kWriteEncrypted] + start,
-                               length);
+    bytes_processed =
+        BIO_read(socket_side_, buffers_[kWriteEncrypted] + start, length);
     if (bytes_processed < 0) {
-      if (SSL_LOG_DATA) Log::Print(
-          "WriteEncrypted BIO_read returned error %d\n", bytes_processed);
+      if (SSL_LOG_DATA)
+        Log::Print("WriteEncrypted BIO_read returned error %d\n",
+                   bytes_processed);
       return 0;
     } else {
-      if (SSL_LOG_DATA) Log::Print(
-          "WriteEncrypted  BIO_read wrote %d bytes\n", bytes_processed);
+      if (SSL_LOG_DATA)
+        Log::Print("WriteEncrypted  BIO_read wrote %d bytes\n",
+                   bytes_processed);
     }
   }
   return bytes_processed;
diff --git a/runtime/bin/secure_socket_boringssl.h b/runtime/bin/secure_socket_boringssl.h
index 788b257..a24194a 100644
--- a/runtime/bin/secure_socket_boringssl.h
+++ b/runtime/bin/secure_socket_boringssl.h
@@ -2,10 +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.
 
-#ifndef BIN_SECURE_SOCKET_BORINGSSL_H_
-#define BIN_SECURE_SOCKET_BORINGSSL_H_
+#ifndef RUNTIME_BIN_SECURE_SOCKET_BORINGSSL_H_
+#define RUNTIME_BIN_SECURE_SOCKET_BORINGSSL_H_
 
-#if !defined(BIN_SECURE_SOCKET_H_)
+#if !defined(RUNTIME_BIN_SECURE_SOCKET_H_)
 #error Do not include secure_socket_boringssl.h directly. Use secure_socket.h.
 #endif
 
@@ -35,10 +35,8 @@
 
 class SSLContext {
  public:
-  explicit SSLContext(SSL_CTX* context) :
-      context_(context),
-      alpn_protocol_string_(NULL) {
-  }
+  explicit SSLContext(SSL_CTX* context)
+      : context_(context), alpn_protocol_string_(NULL) {}
 
   ~SSLContext() {
     SSL_CTX_free(context_);
@@ -92,7 +90,7 @@
         handshake_complete_(NULL),
         bad_certificate_callback_(NULL),
         in_handshake_(false),
-        hostname_(NULL) { }
+        hostname_(NULL) {}
 
   ~SSLFilter();
 
@@ -162,4 +160,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_SECURE_SOCKET_BORINGSSL_H_
+#endif  // RUNTIME_BIN_SECURE_SOCKET_BORINGSSL_H_
diff --git a/runtime/bin/secure_socket_ios.cc b/runtime/bin/secure_socket_ios.cc
index a92c45b..0f19380 100644
--- a/runtime/bin/secure_socket_ios.cc
+++ b/runtime/bin/secure_socket_ios.cc
@@ -74,7 +74,7 @@
                              const char* message) {
   TextBuffer status_message(SSL_ERROR_MESSAGE_BUFFER_SIZE);
   status_message.Printf("OSStatus = %ld: https://www.osstatus.com",
-      static_cast<intptr_t>(status));
+                        static_cast<intptr_t>(status));
   OSError os_error_struct(status, status_message.buf(), OSError::kBoringSSL);
   Dart_Handle os_error = DartUtils::NewDartOSError(&os_error_struct);
   Dart_Handle exception =
@@ -99,10 +99,9 @@
   SSLFilter* filter;
   Dart_Handle dart_this = ThrowIfError(Dart_GetNativeArgument(args, 0));
   ASSERT(Dart_IsInstance(dart_this));
-  ThrowIfError(Dart_GetNativeInstanceField(
-      dart_this,
-      kSSLFilterNativeFieldIndex,
-      reinterpret_cast<intptr_t*>(&filter)));
+  ThrowIfError(
+      Dart_GetNativeInstanceField(dart_this, kSSLFilterNativeFieldIndex,
+                                  reinterpret_cast<intptr_t*>(&filter)));
   return filter;
 }
 
@@ -121,15 +120,12 @@
   Dart_Handle dart_this = Dart_GetNativeArgument(args, 0);
   RETURN_IF_ERROR(dart_this);
   ASSERT(Dart_IsInstance(dart_this));
-  Dart_Handle err = Dart_SetNativeInstanceField(
-      dart_this,
-      kSSLFilterNativeFieldIndex,
-      reinterpret_cast<intptr_t>(filter));
+  Dart_Handle err =
+      Dart_SetNativeInstanceField(dart_this, kSSLFilterNativeFieldIndex,
+                                  reinterpret_cast<intptr_t>(filter));
   RETURN_IF_ERROR(err);
-  Dart_NewWeakPersistentHandle(dart_this,
-                               reinterpret_cast<void*>(filter),
-                               approximate_size_of_filter,
-                               DeleteFilter);
+  Dart_NewWeakPersistentHandle(dart_this, reinterpret_cast<void*>(filter),
+                               approximate_size_of_filter, DeleteFilter);
   return Dart_Null();
 }
 
@@ -138,10 +134,9 @@
   SSLCertContext* context;
   Dart_Handle dart_this = ThrowIfError(Dart_GetNativeArgument(args, 0));
   ASSERT(Dart_IsInstance(dart_this));
-  ThrowIfError(Dart_GetNativeInstanceField(
-      dart_this,
-      kSecurityContextNativeFieldIndex,
-      reinterpret_cast<intptr_t*>(&context)));
+  ThrowIfError(
+      Dart_GetNativeInstanceField(dart_this, kSecurityContextNativeFieldIndex,
+                                  reinterpret_cast<intptr_t*>(&context)));
   return context;
 }
 
@@ -160,14 +155,11 @@
   Dart_Handle dart_this = Dart_GetNativeArgument(args, 0);
   RETURN_IF_ERROR(dart_this);
   ASSERT(Dart_IsInstance(dart_this));
-  Dart_Handle err = Dart_SetNativeInstanceField(
-      dart_this,
-      kSecurityContextNativeFieldIndex,
-      reinterpret_cast<intptr_t>(context));
+  Dart_Handle err =
+      Dart_SetNativeInstanceField(dart_this, kSecurityContextNativeFieldIndex,
+                                  reinterpret_cast<intptr_t>(context));
   RETURN_IF_ERROR(err);
-  Dart_NewWeakPersistentHandle(dart_this,
-                               context,
-                               approximate_size_of_context,
+  Dart_NewWeakPersistentHandle(dart_this, context, approximate_size_of_context,
                                DeleteCertContext);
   return Dart_Null();
 }
@@ -177,10 +169,9 @@
   SecCertificateRef certificate;
   Dart_Handle dart_this = ThrowIfError(Dart_GetNativeArgument(args, 0));
   ASSERT(Dart_IsInstance(dart_this));
-  ThrowIfError(Dart_GetNativeInstanceField(
-      dart_this,
-      kX509NativeFieldIndex,
-      reinterpret_cast<intptr_t*>(&certificate)));
+  ThrowIfError(
+      Dart_GetNativeInstanceField(dart_this, kX509NativeFieldIndex,
+                                  reinterpret_cast<intptr_t*>(&certificate)));
   return certificate;
 }
 
@@ -203,7 +194,7 @@
   if (Dart_IsError(x509_type)) {
     return x509_type;
   }
-  Dart_Handle arguments[] = { NULL };
+  Dart_Handle arguments[] = {NULL};
 
   Dart_Handle result =
       Dart_New(x509_type, DartUtils::NewString("_"), 0, arguments);
@@ -215,15 +206,12 @@
   // CFRetain in case the returned Dart object outlives the SecurityContext.
   // CFRelease is in the Dart object's finalizer
   CFRetain(certificate);
-  Dart_NewWeakPersistentHandle(result,
-                               reinterpret_cast<void*>(certificate),
+  Dart_NewWeakPersistentHandle(result, reinterpret_cast<void*>(certificate),
                                approximate_size_of_certificate,
                                ReleaseCertificate);
 
   Dart_Handle status = Dart_SetNativeInstanceField(
-      result,
-      kX509NativeFieldIndex,
-      reinterpret_cast<intptr_t>(certificate));
+      result, kX509NativeFieldIndex, reinterpret_cast<intptr_t>(certificate));
   if (Dart_IsError(status)) {
     return status;
   }
@@ -245,8 +233,8 @@
   } else if (Dart_IsNull(password_object)) {
     password = "";
   } else {
-    Dart_ThrowException(DartUtils::NewDartArgumentError(
-        "Password is not a String or null"));
+    Dart_ThrowException(
+        DartUtils::NewDartArgumentError("Password is not a String or null"));
   }
   return password;
 }
@@ -256,8 +244,8 @@
                                 CFStringRef password,
                                 CFArrayRef* out_certs,
                                 SecIdentityRef* out_identity) {
-  const void* keys[] = { kSecImportExportPassphrase };
-  const void* values[] = { password };
+  const void* keys[] = {kSecImportExportPassphrase};
+  const void* values[] = {password};
   CFDictionaryRef params =
       CFDictionaryCreate(NULL, keys, values, 1, NULL, NULL);
   CFArrayRef items = NULL;
@@ -267,7 +255,7 @@
   if (status != noErr) {
     if (SSL_LOG_STATUS) {
       Log::PrintErr("SecPKCS12Import: status = %ld",
-          static_cast<intptr_t>(status));
+                    static_cast<intptr_t>(status));
       return status;
     }
   }
@@ -328,8 +316,8 @@
         CFIndex count = CFArrayGetCount(certs);
         Log::PrintErr("\titem %ld has a cert chain %ld certs long\n", i, count);
       }
-      CFArrayAppendArray(
-          result_certs, certs, CFRangeMake(0, CFArrayGetCount(certs)));
+      CFArrayAppendArray(result_certs, certs,
+                         CFRangeMake(0, CFArrayGetCount(certs)));
     }
   }
 
@@ -365,8 +353,8 @@
   ASSERT(password != NULL);
   OSStatus status = noErr;
 
-  CFDataRef cfdata = CFDataCreateWithBytesNoCopy(
-      NULL, buffer, length, kCFAllocatorNull);
+  CFDataRef cfdata =
+      CFDataCreateWithBytesNoCopy(NULL, buffer, length, kCFAllocatorNull);
   CFStringRef cfpassword = CFStringCreateWithCStringNoCopy(
       NULL, password, kCFStringEncodingUTF8, kCFAllocatorNull);
   ASSERT(cfdata != NULL);
@@ -415,15 +403,11 @@
   SSLCertContext* context = NULL;
   if (!Dart_IsNull(context_object)) {
     ThrowIfError(Dart_GetNativeInstanceField(
-        context_object,
-        kSecurityContextNativeFieldIndex,
+        context_object, kSecurityContextNativeFieldIndex,
         reinterpret_cast<intptr_t*>(&context)));
   }
 
-  GetFilter(args)->Connect(dart_this,
-                           host_name,
-                           context,
-                           is_server,
+  GetFilter(args)->Connect(dart_this, host_name, context, is_server,
                            request_client_certificate,
                            require_client_certificate);
 }
@@ -460,8 +444,7 @@
       DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 2));
   bool require_client_certificate =
       DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 3));
-  GetFilter(args)->Renegotiate(use_session_cache,
-                               request_client_certificate,
+  GetFilter(args)->Renegotiate(use_session_cache, request_client_certificate,
                                require_client_certificate);
 }
 
@@ -480,8 +463,7 @@
 
 void FUNCTION_NAME(SecureSocket_RegisterBadCertificateCallback)(
     Dart_NativeArguments args) {
-  Dart_Handle callback =
-      ThrowIfError(Dart_GetNativeArgument(args, 1));
+  Dart_Handle callback = ThrowIfError(Dart_GetNativeArgument(args, 1));
   if (!Dart_IsClosure(callback) && !Dart_IsNull(callback)) {
     Dart_ThrowException(DartUtils::NewDartArgumentError(
         "Illegal argument to RegisterBadCertificateCallback"));
@@ -526,8 +508,8 @@
   SecIdentityRef identity = NULL;
   {
     ScopedMemBuffer buffer(ThrowIfError(Dart_GetNativeArgument(args, 1)));
-    status = ExtractSecItems(
-        buffer.get(), buffer.length(), password, &cert_chain, &identity);
+    status = ExtractSecItems(buffer.get(), buffer.length(), password,
+                             &cert_chain, &identity);
   }
 
   // Set the context fields. Repeated calls to usePrivateKeyBytes are an error.
@@ -642,7 +624,7 @@
 
 
 void FUNCTION_NAME(X509_EndValidity)(Dart_NativeArguments args) {
-    Dart_ThrowException(DartUtils::NewDartUnsupportedError(
+  Dart_ThrowException(DartUtils::NewDartUnsupportedError(
       "X509Certificate.endValidity is not supported on this platform."));
 }
 
@@ -681,8 +663,8 @@
 
   OSStatus status = filter->ProcessAllBuffers(starts, ends, in_handshake);
   if (status == noErr) {
-    CObjectArray* result = new CObjectArray(
-        CObject::NewArray(SSLFilter::kNumBuffers * 2));
+    CObjectArray* result =
+        new CObjectArray(CObject::NewArray(SSLFilter::kNumBuffers * 2));
     for (intptr_t i = 0; i < SSLFilter::kNumBuffers; ++i) {
       result->SetAt(2 * i, new CObjectInt32(CObject::NewInt32(starts[i])));
       result->SetAt(2 * i + 1, new CObjectInt32(CObject::NewInt32(ends[i])));
@@ -691,11 +673,11 @@
   } else {
     TextBuffer status_message(SSL_ERROR_MESSAGE_BUFFER_SIZE);
     status_message.Printf("OSStatus = %ld: https://www.osstatus.com",
-        static_cast<intptr_t>(status));
+                          static_cast<intptr_t>(status));
     CObjectArray* result = new CObjectArray(CObject::NewArray(2));
     result->SetAt(0, new CObjectInt32(CObject::NewInt32(status)));
-    result->SetAt(1, new CObjectString(CObject::NewString(
-        status_message.buf())));
+    result->SetAt(1,
+                  new CObjectString(CObject::NewString(status_message.buf())));
     return result;
   }
 }
@@ -741,8 +723,8 @@
   }
   Dart_Handle buffer_handle =
       ThrowIfError(Dart_HandleFromPersistent(dart_buffer_objects_[idx]));
-  ThrowIfError(DartUtils::SetIntegerField(
-      buffer_handle, "start", static_cast<int64_t>(value)));
+  ThrowIfError(DartUtils::SetIntegerField(buffer_handle, "start",
+                                          static_cast<int64_t>(value)));
 }
 
 
@@ -753,8 +735,8 @@
   }
   Dart_Handle buffer_handle =
       ThrowIfError(Dart_HandleFromPersistent(dart_buffer_objects_[idx]));
-  ThrowIfError(DartUtils::SetIntegerField(
-      buffer_handle, "end", static_cast<int64_t>(value)));
+  ThrowIfError(DartUtils::SetIntegerField(buffer_handle, "end",
+                                          static_cast<int64_t>(value)));
 }
 
 
@@ -888,8 +870,8 @@
   RETURN_IF_ERROR(secure_filter_impl_type);
   Dart_Handle size_string = DartUtils::NewString("SIZE");
   RETURN_IF_ERROR(size_string);
-  Dart_Handle dart_buffer_size = Dart_GetField(
-      secure_filter_impl_type, size_string);
+  Dart_Handle dart_buffer_size =
+      Dart_GetField(secure_filter_impl_type, size_string);
   RETURN_IF_ERROR(dart_buffer_size);
 
   int64_t buffer_size = 0;
@@ -899,8 +881,8 @@
   Dart_Handle encrypted_size_string = DartUtils::NewString("ENCRYPTED_SIZE");
   RETURN_IF_ERROR(encrypted_size_string);
 
-  Dart_Handle dart_encrypted_buffer_size = Dart_GetField(
-      secure_filter_impl_type, encrypted_size_string);
+  Dart_Handle dart_encrypted_buffer_size =
+      Dart_GetField(secure_filter_impl_type, encrypted_size_string);
   RETURN_IF_ERROR(dart_encrypted_buffer_size);
 
   int64_t encrypted_buffer_size = 0;
@@ -1008,34 +990,25 @@
   // Configure the context.
   OSStatus status;
   status = SSLSetPeerDomainName(ssl_context, hostname, strlen(hostname));
-  CheckStatus(status,
-      "TlsException",
-      "Failed to set peer domain name");
+  CheckStatus(status, "TlsException", "Failed to set peer domain name");
 
-  status = SSLSetIOFuncs(
-      ssl_context, SSLFilter::SSLReadCallback, SSLFilter::SSLWriteCallback);
-  CheckStatus(status,
-      "TlsException",
-      "Failed to set IO Callbacks");
+  status = SSLSetIOFuncs(ssl_context, SSLFilter::SSLReadCallback,
+                         SSLFilter::SSLWriteCallback);
+  CheckStatus(status, "TlsException", "Failed to set IO Callbacks");
 
-  status = SSLSetConnection(
-      ssl_context, reinterpret_cast<SSLConnectionRef>(this));
-  CheckStatus(status,
-      "TlsException",
-      "Failed to set connection object");
+  status =
+      SSLSetConnection(ssl_context, reinterpret_cast<SSLConnectionRef>(this));
+  CheckStatus(status, "TlsException", "Failed to set connection object");
 
   // Always evaluate the certs manually so that we can cache the peer
   // certificates in the context for calls to peerCertificate.
-  status = SSLSetSessionOption(
-      ssl_context, kSSLSessionOptionBreakOnServerAuth, true);
-  CheckStatus(status,
-      "TlsException",
-      "Failed to set BreakOnServerAuth option");
+  status = SSLSetSessionOption(ssl_context, kSSLSessionOptionBreakOnServerAuth,
+                               true);
+  CheckStatus(status, "TlsException", "Failed to set BreakOnServerAuth option");
 
   status = SSLSetProtocolVersionMin(ssl_context, kTLSProtocol1);
-  CheckStatus(status,
-      "TlsException",
-      "Failed to set minimum protocol version to kTLSProtocol1");
+  CheckStatus(status, "TlsException",
+              "Failed to set minimum protocol version to kTLSProtocol1");
 
   // If the context has an identity pass it to SSLSetCertificate().
   if (context->identity() != NULL) {
@@ -1048,8 +1021,8 @@
       // Skip the first one, it's already included in the identity.
       CFIndex chain_length = CFArrayGetCount(context->cert_chain());
       if (chain_length > 1) {
-        CFArrayAppendArray(
-            chain, context->cert_chain(), CFRangeMake(1, chain_length));
+        CFArrayAppendArray(chain, context->cert_chain(),
+                           CFRangeMake(1, chain_length));
       }
     }
 
@@ -1061,21 +1034,20 @@
   if (is_server) {
     SSLAuthenticate auth =
         require_client_certificate
-        ? kAlwaysAuthenticate
-        : (request_client_certificate ? kTryAuthenticate : kNeverAuthenticate);
+            ? kAlwaysAuthenticate
+            : (request_client_certificate ? kTryAuthenticate
+                                          : kNeverAuthenticate);
     status = SSLSetClientSideAuthenticate(ssl_context, auth);
-    CheckStatus(status,
-        "TlsException",
-        "Failed to set client authentication mode");
+    CheckStatus(status, "TlsException",
+                "Failed to set client authentication mode");
 
     // If we're at least trying client authentication, then break handshake
     // for client authentication.
     if (auth != kNeverAuthenticate) {
-      status = SSLSetSessionOption(
-          ssl_context, kSSLSessionOptionBreakOnClientAuth, true);
-      CheckStatus(status,
-          "TlsException",
-          "Failed to set client authentication mode");
+      status = SSLSetSessionOption(ssl_context,
+                                   kSSLSessionOptionBreakOnClientAuth, true);
+      CheckStatus(status, "TlsException",
+                  "Failed to set client authentication mode");
     }
   }
 
@@ -1092,9 +1064,9 @@
     status = noErr;
     in_handshake_ = true;
   }
-  CheckStatus(status,
-     "HandshakeException",
-      is_server_ ? "Handshake error in server" : "Handshake error in client");
+  CheckStatus(status, "HandshakeException", is_server_
+                                                ? "Handshake error in server"
+                                                : "Handshake error in client");
 }
 
 
@@ -1113,7 +1085,7 @@
     }
     if (SSL_LOG_STATUS) {
       Log::PrintErr("Handshake error from SSLCopyPeerTrust(): %ld.\n",
-          static_cast<intptr_t>(status));
+                    static_cast<intptr_t>(status));
     }
     return status;
   }
@@ -1130,7 +1102,7 @@
   if (status != noErr) {
     if (SSL_LOG_STATUS) {
       Log::PrintErr("Handshake error from SecTrustSetAnchorCertificates: %ld\n",
-          static_cast<intptr_t>(status));
+                    static_cast<intptr_t>(status));
     }
     CFRelease(trusted_certs);
     CFRelease(peer_trust);
@@ -1138,7 +1110,8 @@
   }
 
   if (SSL_LOG_STATUS) {
-    Log::PrintErr("Handshake %s built in root certs\n",
+    Log::PrintErr(
+        "Handshake %s built in root certs\n",
         cert_context_.get()->trust_builtin() ? "trusting" : "not trusting");
   }
 
@@ -1350,7 +1323,8 @@
 
 
 OSStatus SSLFilter::SSLReadCallback(SSLConnectionRef connection,
-                                    void* data, size_t* data_requested) {
+                                    void* data,
+                                    size_t* data_requested) {
   // Copy at most `data_requested` bytes from `buffers_[kReadEncrypted]` into
   // `data`
   ASSERT(connection != NULL);
@@ -1396,7 +1370,7 @@
 
   if (SSL_LOG_DATA) {
     Log::PrintErr("SSLReadCallback: requested: %ld, read %ld bytes\n",
-        *data_requested, data_read);
+                  *data_requested, data_read);
   }
 
   filter->SetBufferStart(kReadEncrypted, start);
@@ -1415,11 +1389,10 @@
   OSStatus status = noErr;
   size_t bytes = 0;
   if (length > 0) {
-    status = SSLRead(
-        ssl_context_,
-        reinterpret_cast<void*>((buffers_[kReadPlaintext] + start)),
-        length,
-        &bytes);
+    status =
+        SSLRead(ssl_context_,
+                reinterpret_cast<void*>((buffers_[kReadPlaintext] + start)),
+                length, &bytes);
     if (SSL_LOG_STATUS) {
       Log::PrintErr("SSLRead: status = %ld\n", static_cast<intptr_t>(status));
     }
@@ -1430,8 +1403,8 @@
   }
   if (SSL_LOG_DATA) {
     Log::PrintErr(
-        "ProcessReadPlaintextBuffer: requested: %ld, read %ld bytes\n",
-        length, bytes);
+        "ProcessReadPlaintextBuffer: requested: %ld, read %ld bytes\n", length,
+        bytes);
   }
   *bytes_processed = static_cast<intptr_t>(bytes);
   return status;
@@ -1439,7 +1412,8 @@
 
 
 OSStatus SSLFilter::SSLWriteCallback(SSLConnectionRef connection,
-                                     const void* data, size_t* data_provided) {
+                                     const void* data,
+                                     size_t* data_provided) {
   // Copy at most `data_provided` bytes from data into
   // `buffers_[kWriteEncrypted]`.
   ASSERT(connection != NULL);
@@ -1447,7 +1421,7 @@
   ASSERT(data_provided != NULL);
 
   SSLFilter* filter =
-    const_cast<SSLFilter*>(reinterpret_cast<const SSLFilter*>(connection));
+      const_cast<SSLFilter*>(reinterpret_cast<const SSLFilter*>(connection));
   const uint8_t* datap = reinterpret_cast<const uint8_t*>(data);
   uint8_t* buffer = filter->buffers_[kWriteEncrypted];
   intptr_t start = filter->GetBufferStart(kWriteEncrypted);
@@ -1488,7 +1462,7 @@
 
   if (SSL_LOG_DATA) {
     Log::PrintErr("SSLWriteCallback: provided: %ld, written %ld bytes\n",
-        *data_provided, data_written);
+                  *data_provided, data_written);
   }
 
   filter->SetBufferEnd(kWriteEncrypted, end);
@@ -1505,11 +1479,10 @@
   OSStatus status = noErr;
   size_t bytes = 0;
   if (length > 0) {
-    status = SSLWrite(
-        ssl_context_,
-        reinterpret_cast<void*>(buffers_[kWritePlaintext] + start),
-        length,
-        &bytes);
+    status =
+        SSLWrite(ssl_context_,
+                 reinterpret_cast<void*>(buffers_[kWritePlaintext] + start),
+                 length, &bytes);
     if (SSL_LOG_STATUS) {
       Log::PrintErr("SSLWrite: status = %ld\n", static_cast<intptr_t>(status));
     }
@@ -1520,7 +1493,7 @@
   }
   if (SSL_LOG_DATA) {
     Log::PrintErr("ProcessWritePlaintextBuffer: requested: %ld, written: %ld\n",
-        length, bytes);
+                  length, bytes);
   }
   *bytes_processed = static_cast<intptr_t>(bytes);
   return status;
diff --git a/runtime/bin/secure_socket_ios.h b/runtime/bin/secure_socket_ios.h
index d67de71..8a59cb7 100644
--- a/runtime/bin/secure_socket_ios.h
+++ b/runtime/bin/secure_socket_ios.h
@@ -2,10 +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.
 
-#ifndef BIN_SECURE_SOCKET_IOS_H_
-#define BIN_SECURE_SOCKET_IOS_H_
+#ifndef RUNTIME_BIN_SECURE_SOCKET_IOS_H_
+#define RUNTIME_BIN_SECURE_SOCKET_IOS_H_
 
-#if !defined(BIN_SECURE_SOCKET_H_)
+#if !defined(RUNTIME_BIN_SECURE_SOCKET_H_)
 #error Do not include secure_socket_macos.h directly. Use secure_socket.h.
 #endif
 
@@ -35,13 +35,13 @@
 // thread. Setters return false if the field was already set.
 class SSLCertContext : public ReferenceCounted<SSLCertContext> {
  public:
-  SSLCertContext() :
-      ReferenceCounted(),
-      mutex_(new Mutex()),
-      trusted_certs_(NULL),
-      identity_(NULL),
-      cert_chain_(NULL),
-      trust_builtin_(false) {}
+  SSLCertContext()
+      : ReferenceCounted(),
+        mutex_(new Mutex()),
+        trusted_certs_(NULL),
+        identity_(NULL),
+        cert_chain_(NULL),
+        trust_builtin_(false) {}
 
   ~SSLCertContext() {
     {
@@ -150,8 +150,7 @@
         connected_(false),
         bad_cert_(false),
         is_server_(false),
-        hostname_(NULL) {
-  }
+        hostname_(NULL) {}
 
   ~SSLFilter();
 
@@ -237,4 +236,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_SECURE_SOCKET_IOS_H_
+#endif  // RUNTIME_BIN_SECURE_SOCKET_IOS_H_
diff --git a/runtime/bin/secure_socket_macos.cc b/runtime/bin/secure_socket_macos.cc
index 6b564df..910008c 100644
--- a/runtime/bin/secure_socket_macos.cc
+++ b/runtime/bin/secure_socket_macos.cc
@@ -86,11 +86,11 @@
   CFStringRef error_string = SecCopyErrorMessageString(status, NULL);
   if (error_string == NULL) {
     status_message.Printf("OSStatus = %ld: https://www.osstatus.com",
-        static_cast<intptr_t>(status));
+                          static_cast<intptr_t>(status));
   } else {
     char* error = CFStringRefToCString(error_string);
-    status_message.Printf("OSStatus = %ld: %s",
-        static_cast<intptr_t>(status), error);
+    status_message.Printf("OSStatus = %ld: %s", static_cast<intptr_t>(status),
+                          error);
     CFRelease(error_string);
   }
   OSError os_error_struct(status, status_message.buf(), OSError::kBoringSSL);
@@ -117,10 +117,9 @@
   SSLFilter* filter;
   Dart_Handle dart_this = ThrowIfError(Dart_GetNativeArgument(args, 0));
   ASSERT(Dart_IsInstance(dart_this));
-  ThrowIfError(Dart_GetNativeInstanceField(
-      dart_this,
-      kSSLFilterNativeFieldIndex,
-      reinterpret_cast<intptr_t*>(&filter)));
+  ThrowIfError(
+      Dart_GetNativeInstanceField(dart_this, kSSLFilterNativeFieldIndex,
+                                  reinterpret_cast<intptr_t*>(&filter)));
   return filter;
 }
 
@@ -139,15 +138,12 @@
   Dart_Handle dart_this = Dart_GetNativeArgument(args, 0);
   RETURN_IF_ERROR(dart_this);
   ASSERT(Dart_IsInstance(dart_this));
-  Dart_Handle err = Dart_SetNativeInstanceField(
-      dart_this,
-      kSSLFilterNativeFieldIndex,
-      reinterpret_cast<intptr_t>(filter));
+  Dart_Handle err =
+      Dart_SetNativeInstanceField(dart_this, kSSLFilterNativeFieldIndex,
+                                  reinterpret_cast<intptr_t>(filter));
   RETURN_IF_ERROR(err);
-  Dart_NewWeakPersistentHandle(dart_this,
-                               reinterpret_cast<void*>(filter),
-                               approximate_size_of_filter,
-                               DeleteFilter);
+  Dart_NewWeakPersistentHandle(dart_this, reinterpret_cast<void*>(filter),
+                               approximate_size_of_filter, DeleteFilter);
   return Dart_Null();
 }
 
@@ -156,10 +152,9 @@
   SSLCertContext* context;
   Dart_Handle dart_this = ThrowIfError(Dart_GetNativeArgument(args, 0));
   ASSERT(Dart_IsInstance(dart_this));
-  ThrowIfError(Dart_GetNativeInstanceField(
-      dart_this,
-      kSecurityContextNativeFieldIndex,
-      reinterpret_cast<intptr_t*>(&context)));
+  ThrowIfError(
+      Dart_GetNativeInstanceField(dart_this, kSecurityContextNativeFieldIndex,
+                                  reinterpret_cast<intptr_t*>(&context)));
   return context;
 }
 
@@ -178,14 +173,11 @@
   Dart_Handle dart_this = Dart_GetNativeArgument(args, 0);
   RETURN_IF_ERROR(dart_this);
   ASSERT(Dart_IsInstance(dart_this));
-  Dart_Handle err = Dart_SetNativeInstanceField(
-      dart_this,
-      kSecurityContextNativeFieldIndex,
-      reinterpret_cast<intptr_t>(context));
+  Dart_Handle err =
+      Dart_SetNativeInstanceField(dart_this, kSecurityContextNativeFieldIndex,
+                                  reinterpret_cast<intptr_t>(context));
   RETURN_IF_ERROR(err);
-  Dart_NewWeakPersistentHandle(dart_this,
-                               context,
-                               approximate_size_of_context,
+  Dart_NewWeakPersistentHandle(dart_this, context, approximate_size_of_context,
                                DeleteCertContext);
   return Dart_Null();
 }
@@ -195,10 +187,9 @@
   SecCertificateRef certificate;
   Dart_Handle dart_this = ThrowIfError(Dart_GetNativeArgument(args, 0));
   ASSERT(Dart_IsInstance(dart_this));
-  ThrowIfError(Dart_GetNativeInstanceField(
-      dart_this,
-      kX509NativeFieldIndex,
-      reinterpret_cast<intptr_t*>(&certificate)));
+  ThrowIfError(
+      Dart_GetNativeInstanceField(dart_this, kX509NativeFieldIndex,
+                                  reinterpret_cast<intptr_t*>(&certificate)));
   return certificate;
 }
 
@@ -221,7 +212,7 @@
   if (Dart_IsError(x509_type)) {
     return x509_type;
   }
-  Dart_Handle arguments[] = { NULL };
+  Dart_Handle arguments[] = {NULL};
 
   Dart_Handle result =
       Dart_New(x509_type, DartUtils::NewString("_"), 0, arguments);
@@ -233,15 +224,12 @@
   // CFRetain in case the returned Dart object outlives the SecurityContext.
   // CFRelease is in the Dart object's finalizer
   CFRetain(certificate);
-  Dart_NewWeakPersistentHandle(result,
-                               reinterpret_cast<void*>(certificate),
+  Dart_NewWeakPersistentHandle(result, reinterpret_cast<void*>(certificate),
                                approximate_size_of_certificate,
                                ReleaseCertificate);
 
   Dart_Handle status = Dart_SetNativeInstanceField(
-      result,
-      kX509NativeFieldIndex,
-      reinterpret_cast<intptr_t>(certificate));
+      result, kX509NativeFieldIndex, reinterpret_cast<intptr_t>(certificate));
   if (Dart_IsError(status)) {
     return status;
   }
@@ -263,8 +251,8 @@
   } else if (Dart_IsNull(password_object)) {
     password = "";
   } else {
-    Dart_ThrowException(DartUtils::NewDartArgumentError(
-        "Password is not a String or null"));
+    Dart_ThrowException(
+        DartUtils::NewDartArgumentError("Password is not a String or null"));
   }
   return password;
 }
@@ -358,13 +346,13 @@
   params.passphrase = password;
 
   CFArrayRef items = NULL;
-  status = SecItemImport(
-      cfdata, NULL, &format, &sitem_type, 0, &params, NULL, &items);
+  status = SecItemImport(cfdata, NULL, &format, &sitem_type, 0, &params, NULL,
+                         &items);
 
   if (status != noErr) {
     if (SSL_LOG_CERTS) {
       Log::Print("TrySecItemImport failed with: %ld, type = %d, format = %d\n",
-          static_cast<intptr_t>(status), sitem_type, format);
+                 static_cast<intptr_t>(status), sitem_type, format);
     }
     return status;
   }
@@ -406,8 +394,7 @@
   ASSERT(ret != NULL);
   path.Printf("/%s", fname);
 
-  char* result =
-      reinterpret_cast<char*>(Dart_ScopeAllocate(path.length() + 1));
+  char* result = reinterpret_cast<char*>(Dart_ScopeAllocate(path.length() + 1));
   return strncpy(result, path.buf(), path.length() + 1);
 }
 
@@ -421,11 +408,10 @@
   if (SSL_LOG_CERTS) {
     Log::Print("Temporary keychain at: '%s'\n", temp_file_path);
   }
-  status = SecKeychainCreate(temp_file_path,
-                             strlen(temp_keychain_pwd) + 1,
+  status = SecKeychainCreate(temp_file_path, strlen(temp_keychain_pwd) + 1,
                              reinterpret_cast<const void*>(temp_keychain_pwd),
                              FALSE,  // Prompt user? Definitely no.
-                             NULL,  // Default access rights.
+                             NULL,   // Default access rights.
                              keychain);
   if (status != noErr) {
     return status;
@@ -454,7 +440,7 @@
   CFArrayRef items = NULL;
   if (SSL_LOG_CERTS) {
     Log::Print("Trying PKCS12 import with: type = %d, format = %d\n",
-        sitem_type, format);
+               sitem_type, format);
   }
 
   // The documentation for SecKeychainItemImport here:
@@ -490,12 +476,12 @@
     *out_keychain = keychain;
   }
 
-  status = SecItemImport(
-      cfdata, NULL, &format, &sitem_type, 0, &params, keychain, &items);
+  status = SecItemImport(cfdata, NULL, &format, &sitem_type, 0, &params,
+                         keychain, &items);
   if (status != noErr) {
     if (SSL_LOG_CERTS) {
       Log::Print("TrySecItemImport failed with: %ld, it = %d, format = %d\n",
-          static_cast<intptr_t>(status), sitem_type, format);
+                 static_cast<intptr_t>(status), sitem_type, format);
     }
     return status;
   }
@@ -527,8 +513,8 @@
   ASSERT(password != NULL);
   OSStatus status = noErr;
 
-  CFDataRef cfdata = CFDataCreateWithBytesNoCopy(
-      NULL, buffer, length, kCFAllocatorNull);
+  CFDataRef cfdata =
+      CFDataCreateWithBytesNoCopy(NULL, buffer, length, kCFAllocatorNull);
   CFStringRef cfpassword = CFStringCreateWithCStringNoCopy(
       NULL, password, kCFStringEncodingUTF8, kCFAllocatorNull);
   ASSERT(cfdata != NULL);
@@ -581,15 +567,11 @@
   SSLCertContext* context = NULL;
   if (!Dart_IsNull(context_object)) {
     ThrowIfError(Dart_GetNativeInstanceField(
-        context_object,
-        kSecurityContextNativeFieldIndex,
+        context_object, kSecurityContextNativeFieldIndex,
         reinterpret_cast<intptr_t*>(&context)));
   }
 
-  GetFilter(args)->Connect(dart_this,
-                           host_name,
-                           context,
-                           is_server,
+  GetFilter(args)->Connect(dart_this, host_name, context, is_server,
                            request_client_certificate,
                            require_client_certificate);
 }
@@ -626,8 +608,7 @@
       DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 2));
   bool require_client_certificate =
       DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 3));
-  GetFilter(args)->Renegotiate(use_session_cache,
-                               request_client_certificate,
+  GetFilter(args)->Renegotiate(use_session_cache, request_client_certificate,
                                require_client_certificate);
 }
 
@@ -646,8 +627,7 @@
 
 void FUNCTION_NAME(SecureSocket_RegisterBadCertificateCallback)(
     Dart_NativeArguments args) {
-  Dart_Handle callback =
-      ThrowIfError(Dart_GetNativeArgument(args, 1));
+  Dart_Handle callback = ThrowIfError(Dart_GetNativeArgument(args, 1));
   if (!Dart_IsClosure(callback) && !Dart_IsNull(callback)) {
     Dart_ThrowException(DartUtils::NewDartArgumentError(
         "Illegal argument to RegisterBadCertificateCallback"));
@@ -656,8 +636,7 @@
 }
 
 
-void FUNCTION_NAME(SecureSocket_PeerCertificate)
-    (Dart_NativeArguments args) {
+void FUNCTION_NAME(SecureSocket_PeerCertificate)(Dart_NativeArguments args) {
   Dart_SetReturnValue(args, GetFilter(args)->PeerCertificate());
 }
 
@@ -693,8 +672,8 @@
   SecKeychainRef keychain = NULL;
   {
     ScopedMemBuffer buffer(ThrowIfError(Dart_GetNativeArgument(args, 1)));
-    status = ExtractSecItems(
-        buffer.get(), buffer.length(), password, NULL, &key, &keychain);
+    status = ExtractSecItems(buffer.get(), buffer.length(), password, NULL,
+                             &key, &keychain);
   }
 
   // Set the context fields. If there's a failure, release the items.
@@ -727,8 +706,8 @@
   CFArrayRef certs = NULL;
   {
     ScopedMemBuffer buffer(ThrowIfError(Dart_GetNativeArgument(args, 1)));
-    status = ExtractSecItems(
-        buffer.get(), buffer.length(), password, &certs, NULL, NULL);
+    status = ExtractSecItems(buffer.get(), buffer.length(), password, &certs,
+                             NULL, NULL);
   }
 
   // Set the field in the context. If there's a failure, release the certs,
@@ -765,8 +744,8 @@
   CFArrayRef certs = NULL;
   {
     ScopedMemBuffer buffer(ThrowIfError(Dart_GetNativeArgument(args, 1)));
-    status = ExtractSecItems(
-        buffer.get(), buffer.length(), password, &certs, NULL, NULL);
+    status = ExtractSecItems(buffer.get(), buffer.length(), password, &certs,
+                             NULL, NULL);
   }
 
   // Set the field in the context. If there's a failure, release the certs,
@@ -791,8 +770,8 @@
   CFArrayRef certs = NULL;
   {
     ScopedMemBuffer buffer(ThrowIfError(Dart_GetNativeArgument(args, 1)));
-    status = ExtractSecItems(
-        buffer.get(), buffer.length(), password, &certs, NULL, NULL);
+    status = ExtractSecItems(buffer.get(), buffer.length(), password, &certs,
+                             NULL, NULL);
   }
 
   // Set the field in the context. If there's a failure, release the certs,
@@ -820,7 +799,7 @@
                              CFStringRef name) {
   char* issuer_name = NULL;
 
-  CFTypeRef keys[] = { field };
+  CFTypeRef keys[] = {field};
   CFArrayRef key_array = CFArrayCreate(NULL, keys, 1, &kCFTypeArrayCallBacks);
   CFErrorRef error = NULL;
   CFDictionaryRef cert_dict =
@@ -865,10 +844,9 @@
 
 void FUNCTION_NAME(X509_Subject)(Dart_NativeArguments args) {
   SecCertificateRef certificate = GetX509Certificate(args);
-  char* subject_name = GetNameFromCert(
-      certificate,
-      kSecOIDX509V1SubjectName,
-      reinterpret_cast<CFStringRef>(kSecOIDCommonName));
+  char* subject_name =
+      GetNameFromCert(certificate, kSecOIDX509V1SubjectName,
+                      reinterpret_cast<CFStringRef>(kSecOIDCommonName));
   if (subject_name == NULL) {
     Dart_ThrowException(DartUtils::NewDartArgumentError(
         "X509.subject failed to find subject's common name."));
@@ -880,10 +858,9 @@
 
 void FUNCTION_NAME(X509_Issuer)(Dart_NativeArguments args) {
   SecCertificateRef certificate = GetX509Certificate(args);
-  char* issuer_name = GetNameFromCert(
-      certificate,
-      kSecOIDX509V1IssuerName,
-      reinterpret_cast<CFStringRef>(kSecOIDCommonName));
+  char* issuer_name =
+      GetNameFromCert(certificate, kSecOIDX509V1IssuerName,
+                      reinterpret_cast<CFStringRef>(kSecOIDCommonName));
   if (issuer_name == NULL) {
     Dart_ThrowException(DartUtils::NewDartArgumentError(
         "X509.issuer failed to find issuer's common name."));
@@ -895,7 +872,7 @@
 
 // Returns the number of seconds since the epoch from 'field'.
 static int64_t GetTimeFromCert(SecCertificateRef certificate, CFTypeRef field) {
-  CFTypeRef keys[] = { field };
+  CFTypeRef keys[] = {field};
   CFArrayRef key_array = CFArrayCreate(NULL, keys, 1, &kCFTypeArrayCallBacks);
   CFErrorRef error = NULL;
   CFDictionaryRef cert_dict =
@@ -924,18 +901,20 @@
 
 void FUNCTION_NAME(X509_StartValidity)(Dart_NativeArguments args) {
   SecCertificateRef certificate = GetX509Certificate(args);
-  int64_t seconds_since_epoch = GetTimeFromCert(certificate,
-                                                kSecOIDX509V1ValidityNotBefore);
-  Dart_SetReturnValue(args,
+  int64_t seconds_since_epoch =
+      GetTimeFromCert(certificate, kSecOIDX509V1ValidityNotBefore);
+  Dart_SetReturnValue(
+      args,
       Dart_NewInteger(static_cast<int64_t>(seconds_since_epoch) * 1000LL));
 }
 
 
 void FUNCTION_NAME(X509_EndValidity)(Dart_NativeArguments args) {
   SecCertificateRef certificate = GetX509Certificate(args);
-  int64_t seconds_since_epoch = GetTimeFromCert(certificate,
-                                                kSecOIDX509V1ValidityNotAfter);
-  Dart_SetReturnValue(args,
+  int64_t seconds_since_epoch =
+      GetTimeFromCert(certificate, kSecOIDX509V1ValidityNotAfter);
+  Dart_SetReturnValue(
+      args,
       Dart_NewInteger(static_cast<int64_t>(seconds_since_epoch) * 1000LL));
 }
 
@@ -974,8 +953,8 @@
 
   OSStatus status = filter->ProcessAllBuffers(starts, ends, in_handshake);
   if (status == noErr) {
-    CObjectArray* result = new CObjectArray(
-        CObject::NewArray(SSLFilter::kNumBuffers * 2));
+    CObjectArray* result =
+        new CObjectArray(CObject::NewArray(SSLFilter::kNumBuffers * 2));
     for (intptr_t i = 0; i < SSLFilter::kNumBuffers; ++i) {
       result->SetAt(2 * i, new CObjectInt32(CObject::NewInt32(starts[i])));
       result->SetAt(2 * i + 1, new CObjectInt32(CObject::NewInt32(ends[i])));
@@ -986,17 +965,17 @@
     CFStringRef error_string = SecCopyErrorMessageString(status, NULL);
     if (error_string == NULL) {
       status_message.Printf("OSStatus = %ld: https://www.osstatus.com",
-          static_cast<intptr_t>(status));
+                            static_cast<intptr_t>(status));
     } else {
       char* error = CFStringRefToCString(error_string);
-      status_message.Printf("OSStatus = %ld: %s",
-          static_cast<intptr_t>(status), error);
+      status_message.Printf("OSStatus = %ld: %s", static_cast<intptr_t>(status),
+                            error);
       CFRelease(error_string);
     }
     CObjectArray* result = new CObjectArray(CObject::NewArray(2));
     result->SetAt(0, new CObjectInt32(CObject::NewInt32(status)));
-    result->SetAt(1, new CObjectString(CObject::NewString(
-        status_message.buf())));
+    result->SetAt(1,
+                  new CObjectString(CObject::NewString(status_message.buf())));
     return result;
   }
 }
@@ -1042,8 +1021,8 @@
   }
   Dart_Handle buffer_handle =
       ThrowIfError(Dart_HandleFromPersistent(dart_buffer_objects_[idx]));
-  ThrowIfError(DartUtils::SetIntegerField(
-      buffer_handle, "start", static_cast<int64_t>(value)));
+  ThrowIfError(DartUtils::SetIntegerField(buffer_handle, "start",
+                                          static_cast<int64_t>(value)));
 }
 
 
@@ -1054,8 +1033,8 @@
   }
   Dart_Handle buffer_handle =
       ThrowIfError(Dart_HandleFromPersistent(dart_buffer_objects_[idx]));
-  ThrowIfError(DartUtils::SetIntegerField(
-      buffer_handle, "end", static_cast<int64_t>(value)));
+  ThrowIfError(DartUtils::SetIntegerField(buffer_handle, "end",
+                                          static_cast<int64_t>(value)));
 }
 
 
@@ -1189,8 +1168,8 @@
   RETURN_IF_ERROR(secure_filter_impl_type);
   Dart_Handle size_string = DartUtils::NewString("SIZE");
   RETURN_IF_ERROR(size_string);
-  Dart_Handle dart_buffer_size = Dart_GetField(
-      secure_filter_impl_type, size_string);
+  Dart_Handle dart_buffer_size =
+      Dart_GetField(secure_filter_impl_type, size_string);
   RETURN_IF_ERROR(dart_buffer_size);
 
   int64_t buffer_size = 0;
@@ -1200,8 +1179,8 @@
   Dart_Handle encrypted_size_string = DartUtils::NewString("ENCRYPTED_SIZE");
   RETURN_IF_ERROR(encrypted_size_string);
 
-  Dart_Handle dart_encrypted_buffer_size = Dart_GetField(
-      secure_filter_impl_type, encrypted_size_string);
+  Dart_Handle dart_encrypted_buffer_size =
+      Dart_GetField(secure_filter_impl_type, encrypted_size_string);
   RETURN_IF_ERROR(dart_encrypted_buffer_size);
 
   int64_t encrypted_buffer_size = 0;
@@ -1309,34 +1288,25 @@
   // Configure the context.
   OSStatus status;
   status = SSLSetPeerDomainName(ssl_context, hostname, strlen(hostname));
-  CheckStatus(status,
-      "TlsException",
-      "Failed to set peer domain name");
+  CheckStatus(status, "TlsException", "Failed to set peer domain name");
 
-  status = SSLSetIOFuncs(
-      ssl_context, SSLFilter::SSLReadCallback, SSLFilter::SSLWriteCallback);
-  CheckStatus(status,
-      "TlsException",
-      "Failed to set IO Callbacks");
+  status = SSLSetIOFuncs(ssl_context, SSLFilter::SSLReadCallback,
+                         SSLFilter::SSLWriteCallback);
+  CheckStatus(status, "TlsException", "Failed to set IO Callbacks");
 
-  status = SSLSetConnection(
-      ssl_context, reinterpret_cast<SSLConnectionRef>(this));
-  CheckStatus(status,
-      "TlsException",
-      "Failed to set connection object");
+  status =
+      SSLSetConnection(ssl_context, reinterpret_cast<SSLConnectionRef>(this));
+  CheckStatus(status, "TlsException", "Failed to set connection object");
 
   // Always evaluate the certs manually so that we can cache the peer
   // certificates in the context for calls to peerCertificate.
-  status = SSLSetSessionOption(
-      ssl_context, kSSLSessionOptionBreakOnServerAuth, true);
-  CheckStatus(status,
-      "TlsException",
-      "Failed to set BreakOnServerAuth option");
+  status = SSLSetSessionOption(ssl_context, kSSLSessionOptionBreakOnServerAuth,
+                               true);
+  CheckStatus(status, "TlsException", "Failed to set BreakOnServerAuth option");
 
   status = SSLSetProtocolVersionMin(ssl_context, kTLSProtocol1);
-  CheckStatus(status,
-      "TlsException",
-      "Failed to set minimum protocol version to kTLSProtocol1");
+  CheckStatus(status, "TlsException",
+              "Failed to set minimum protocol version to kTLSProtocol1");
 
   // If the context has a private key and certificate chain, combine the
   // private key and first certificate into a SecIdentityRef, and place that
@@ -1363,31 +1333,29 @@
   }
 
   if (context->cert_authorities() != NULL) {
-    status = SSLSetCertificateAuthorities(
-        ssl_context, context->cert_authorities(), true);
-    CheckStatus(status,
-        "TlsException",
-        "Failed to set certificate authorities");
+    status = SSLSetCertificateAuthorities(ssl_context,
+                                          context->cert_authorities(), true);
+    CheckStatus(status, "TlsException",
+                "Failed to set certificate authorities");
   }
 
   if (is_server) {
     SSLAuthenticate auth =
         require_client_certificate
-        ? kAlwaysAuthenticate
-        : (request_client_certificate ? kTryAuthenticate : kNeverAuthenticate);
+            ? kAlwaysAuthenticate
+            : (request_client_certificate ? kTryAuthenticate
+                                          : kNeverAuthenticate);
     status = SSLSetClientSideAuthenticate(ssl_context, auth);
-    CheckStatus(status,
-        "TlsException",
-        "Failed to set client authentication mode");
+    CheckStatus(status, "TlsException",
+                "Failed to set client authentication mode");
 
     // If we're at least trying client authentication, then break handshake
     // for client authentication.
     if (auth != kNeverAuthenticate) {
-      status = SSLSetSessionOption(
-          ssl_context, kSSLSessionOptionBreakOnClientAuth, true);
-      CheckStatus(status,
-          "TlsException",
-          "Failed to set client authentication mode");
+      status = SSLSetSessionOption(ssl_context,
+                                   kSSLSessionOptionBreakOnClientAuth, true);
+      CheckStatus(status, "TlsException",
+                  "Failed to set client authentication mode");
     }
   }
 
@@ -1404,9 +1372,9 @@
     status = noErr;
     in_handshake_ = true;
   }
-  CheckStatus(status,
-     "HandshakeException",
-      is_server_ ? "Handshake error in server" : "Handshake error in client");
+  CheckStatus(status, "HandshakeException", is_server_
+                                                ? "Handshake error in server"
+                                                : "Handshake error in client");
 }
 
 
@@ -1425,7 +1393,7 @@
     }
     if (SSL_LOG_STATUS) {
       Log::Print("Handshake error from SSLCopyPeerTrust(): %ld.\n",
-          static_cast<intptr_t>(status));
+                 static_cast<intptr_t>(status));
     }
     return status;
   }
@@ -1433,7 +1401,7 @@
   CFArrayRef trusted_certs = NULL;
   if (cert_context_.get()->trusted_certs() != NULL) {
     trusted_certs =
-      CFArrayCreateCopy(NULL, cert_context_.get()->trusted_certs());
+        CFArrayCreateCopy(NULL, cert_context_.get()->trusted_certs());
   } else {
     trusted_certs = CFArrayCreate(NULL, NULL, 0, &kCFTypeArrayCallBacks);
   }
@@ -1442,7 +1410,7 @@
   if (status != noErr) {
     if (SSL_LOG_STATUS) {
       Log::Print("Handshake error from SecTrustSetAnchorCertificates: %ld\n",
-          static_cast<intptr_t>(status));
+                 static_cast<intptr_t>(status));
     }
     CFRelease(trusted_certs);
     CFRelease(peer_trust);
@@ -1450,7 +1418,8 @@
   }
 
   if (SSL_LOG_STATUS) {
-    Log::Print("Handshake %s built in root certs\n",
+    Log::Print(
+        "Handshake %s built in root certs\n",
         cert_context_.get()->trust_builtin() ? "trusting" : "not trusting");
   }
 
@@ -1662,7 +1631,8 @@
 
 
 OSStatus SSLFilter::SSLReadCallback(SSLConnectionRef connection,
-                                    void* data, size_t* data_requested) {
+                                    void* data,
+                                    size_t* data_requested) {
   // Copy at most `data_requested` bytes from `buffers_[kReadEncrypted]` into
   // `data`
   ASSERT(connection != NULL);
@@ -1708,7 +1678,7 @@
 
   if (SSL_LOG_DATA) {
     Log::Print("SSLReadCallback: requested: %ld, read %ld bytes\n",
-        *data_requested, data_read);
+               *data_requested, data_read);
   }
 
   filter->SetBufferStart(kReadEncrypted, start);
@@ -1727,11 +1697,10 @@
   OSStatus status = noErr;
   size_t bytes = 0;
   if (length > 0) {
-    status = SSLRead(
-        ssl_context_,
-        reinterpret_cast<void*>((buffers_[kReadPlaintext] + start)),
-        length,
-        &bytes);
+    status =
+        SSLRead(ssl_context_,
+                reinterpret_cast<void*>((buffers_[kReadPlaintext] + start)),
+                length, &bytes);
     if (SSL_LOG_STATUS) {
       Log::Print("SSLRead: status = %ld\n", static_cast<intptr_t>(status));
     }
@@ -1742,7 +1711,7 @@
   }
   if (SSL_LOG_DATA) {
     Log::Print("ProcessReadPlaintextBuffer: requested: %ld, read %ld bytes\n",
-        length, bytes);
+               length, bytes);
   }
   *bytes_processed = static_cast<intptr_t>(bytes);
   return status;
@@ -1750,7 +1719,8 @@
 
 
 OSStatus SSLFilter::SSLWriteCallback(SSLConnectionRef connection,
-                                     const void* data, size_t* data_provided) {
+                                     const void* data,
+                                     size_t* data_provided) {
   // Copy at most `data_provided` bytes from data into
   // `buffers_[kWriteEncrypted]`.
   ASSERT(connection != NULL);
@@ -1758,7 +1728,7 @@
   ASSERT(data_provided != NULL);
 
   SSLFilter* filter =
-    const_cast<SSLFilter*>(reinterpret_cast<const SSLFilter*>(connection));
+      const_cast<SSLFilter*>(reinterpret_cast<const SSLFilter*>(connection));
   const uint8_t* datap = reinterpret_cast<const uint8_t*>(data);
   uint8_t* buffer = filter->buffers_[kWriteEncrypted];
   intptr_t start = filter->GetBufferStart(kWriteEncrypted);
@@ -1799,7 +1769,7 @@
 
   if (SSL_LOG_DATA) {
     Log::Print("SSLWriteCallback: provided: %ld, written %ld bytes\n",
-        *data_provided, data_written);
+               *data_provided, data_written);
   }
 
   filter->SetBufferEnd(kWriteEncrypted, end);
@@ -1816,11 +1786,10 @@
   OSStatus status = noErr;
   size_t bytes = 0;
   if (length > 0) {
-    status = SSLWrite(
-        ssl_context_,
-        reinterpret_cast<void*>(buffers_[kWritePlaintext] + start),
-        length,
-        &bytes);
+    status =
+        SSLWrite(ssl_context_,
+                 reinterpret_cast<void*>(buffers_[kWritePlaintext] + start),
+                 length, &bytes);
     if (SSL_LOG_STATUS) {
       Log::Print("SSLWrite: status = %ld\n", static_cast<intptr_t>(status));
     }
@@ -1831,7 +1800,7 @@
   }
   if (SSL_LOG_DATA) {
     Log::Print("ProcessWritePlaintextBuffer: requested: %ld, written: %ld\n",
-        length, bytes);
+               length, bytes);
   }
   *bytes_processed = static_cast<intptr_t>(bytes);
   return status;
diff --git a/runtime/bin/secure_socket_macos.h b/runtime/bin/secure_socket_macos.h
index b4fe635..f84cc42 100644
--- a/runtime/bin/secure_socket_macos.h
+++ b/runtime/bin/secure_socket_macos.h
@@ -2,10 +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.
 
-#ifndef BIN_SECURE_SOCKET_MACOS_H_
-#define BIN_SECURE_SOCKET_MACOS_H_
+#ifndef RUNTIME_BIN_SECURE_SOCKET_MACOS_H_
+#define RUNTIME_BIN_SECURE_SOCKET_MACOS_H_
 
-#if !defined(BIN_SECURE_SOCKET_H_)
+#if !defined(RUNTIME_BIN_SECURE_SOCKET_H_)
 #error Do not include secure_socket_macos.h directly. Use secure_socket.h.
 #endif
 
@@ -35,16 +35,15 @@
 // thread. Setters return false if the field was already set.
 class SSLCertContext : public ReferenceCounted<SSLCertContext> {
  public:
-  SSLCertContext() :
-      ReferenceCounted(),
-      mutex_(new Mutex()),
-      private_key_(NULL),
-      keychain_(NULL),
-      cert_chain_(NULL),
-      trusted_certs_(NULL),
-      cert_authorities_(NULL),
-      trust_builtin_(false) {
-  }
+  SSLCertContext()
+      : ReferenceCounted(),
+        mutex_(new Mutex()),
+        private_key_(NULL),
+        keychain_(NULL),
+        cert_chain_(NULL),
+        trusted_certs_(NULL),
+        cert_authorities_(NULL),
+        trust_builtin_(false) {}
 
   ~SSLCertContext() {
     {
@@ -191,8 +190,7 @@
         connected_(false),
         bad_cert_(false),
         is_server_(false),
-        hostname_(NULL) {
-  }
+        hostname_(NULL) {}
 
   ~SSLFilter();
 
@@ -278,4 +276,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_SECURE_SOCKET_MACOS_H_
+#endif  // RUNTIME_BIN_SECURE_SOCKET_MACOS_H_
diff --git a/runtime/bin/secure_socket_unsupported.cc b/runtime/bin/secure_socket_unsupported.cc
index fb7e713..8ed4f24 100644
--- a/runtime/bin/secure_socket_unsupported.cc
+++ b/runtime/bin/secure_socket_unsupported.cc
@@ -71,15 +71,13 @@
 }
 
 
-void FUNCTION_NAME(SecureSocket_InitializeLibrary)
-    (Dart_NativeArguments args) {
+void FUNCTION_NAME(SecureSocket_InitializeLibrary)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewDartArgumentError(
       "Secure Sockets unsupported on this platform"));
 }
 
 
-void FUNCTION_NAME(SecureSocket_PeerCertificate)
-    (Dart_NativeArguments args) {
+void FUNCTION_NAME(SecureSocket_PeerCertificate)(Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewDartArgumentError(
       "Secure Sockets unsupported on this platform"));
 }
diff --git a/runtime/bin/snapshot_in.cc b/runtime/bin/snapshot_in.cc
index 769d96c..1f63a86 100644
--- a/runtime/bin/snapshot_in.cc
+++ b/runtime/bin/snapshot_in.cc
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// clang-format off
+
 // This file is linked into the dart executable when it has a snapshot
 // linked into it.
 
diff --git a/runtime/bin/socket.cc b/runtime/bin/socket.cc
index 687b773..d520572 100644
--- a/runtime/bin/socket.cc
+++ b/runtime/bin/socket.cc
@@ -23,7 +23,7 @@
 
 static const int kSocketIdNativeField = 0;
 
-ListeningSocketRegistry *globalTcpListeningSocketRegistry = NULL;
+ListeningSocketRegistry* globalTcpListeningSocketRegistry = NULL;
 
 bool short_socket_read = false;
 
@@ -35,7 +35,7 @@
 }
 
 
-ListeningSocketRegistry *ListeningSocketRegistry::Instance() {
+ListeningSocketRegistry* ListeningSocketRegistry::Instance() {
   return globalTcpListeningSocketRegistry;
 }
 
@@ -48,9 +48,8 @@
 
 ListeningSocketRegistry::OSSocket* ListeningSocketRegistry::LookupByPort(
     intptr_t port) {
-  HashMap::Entry* entry =
-     sockets_by_port_.Lookup(GetHashmapKeyFromIntptr(port),
-                             GetHashmapHashFromIntptr(port), false);
+  HashMap::Entry* entry = sockets_by_port_.Lookup(
+      GetHashmapKeyFromIntptr(port), GetHashmapHashFromIntptr(port), false);
   if (entry == NULL) {
     return NULL;
   }
@@ -59,25 +58,23 @@
 
 
 void ListeningSocketRegistry::InsertByPort(intptr_t port, OSSocket* socket) {
-  HashMap::Entry* entry =
-     sockets_by_port_.Lookup(GetHashmapKeyFromIntptr(port),
-                             GetHashmapHashFromIntptr(port), true);
+  HashMap::Entry* entry = sockets_by_port_.Lookup(
+      GetHashmapKeyFromIntptr(port), GetHashmapHashFromIntptr(port), true);
   ASSERT(entry != NULL);
   entry->value = reinterpret_cast<void*>(socket);
 }
 
 
 void ListeningSocketRegistry::RemoveByPort(intptr_t port) {
-  sockets_by_port_.Remove(
-      GetHashmapKeyFromIntptr(port), GetHashmapHashFromIntptr(port));
+  sockets_by_port_.Remove(GetHashmapKeyFromIntptr(port),
+                          GetHashmapHashFromIntptr(port));
 }
 
 
 ListeningSocketRegistry::OSSocket* ListeningSocketRegistry::LookupByFd(
     intptr_t fd) {
-  HashMap::Entry* entry =
-     sockets_by_fd_.Lookup(GetHashmapKeyFromIntptr(fd),
-                           GetHashmapHashFromIntptr(fd), false);
+  HashMap::Entry* entry = sockets_by_fd_.Lookup(
+      GetHashmapKeyFromIntptr(fd), GetHashmapHashFromIntptr(fd), false);
   if (entry == NULL) {
     return NULL;
   }
@@ -86,17 +83,16 @@
 
 
 void ListeningSocketRegistry::InsertByFd(intptr_t fd, OSSocket* socket) {
-  HashMap::Entry* entry =
-     sockets_by_fd_.Lookup(GetHashmapKeyFromIntptr(fd),
-                           GetHashmapHashFromIntptr(fd), true);
+  HashMap::Entry* entry = sockets_by_fd_.Lookup(
+      GetHashmapKeyFromIntptr(fd), GetHashmapHashFromIntptr(fd), true);
   ASSERT(entry != NULL);
   entry->value = reinterpret_cast<void*>(socket);
 }
 
 
 void ListeningSocketRegistry::RemoveByFd(intptr_t fd) {
-  sockets_by_fd_.Remove(
-      GetHashmapKeyFromIntptr(fd), GetHashmapHashFromIntptr(fd));
+  sockets_by_fd_.Remove(GetHashmapKeyFromIntptr(fd),
+                        GetHashmapHashFromIntptr(fd));
 }
 
 
@@ -105,44 +101,48 @@
                                                       intptr_t backlog,
                                                       bool v6_only,
                                                       bool shared) {
-  MutexLocker ml(ListeningSocketRegistry::mutex_);
+  MutexLocker ml(mutex_);
 
+  OSSocket* first_os_socket = NULL;
   intptr_t port = SocketAddress::GetAddrPort(addr);
-  OSSocket* first_os_socket = LookupByPort(port);
-  if (first_os_socket != NULL) {
-    // There is already a socket listening on this port. We need to ensure
-    // that if there is one also listening on the same address, it was created
-    // with `shared = true`, ...
-    OSSocket *os_socket = first_os_socket;
-    OSSocket *os_socket_same_addr = findOSSocketWithAddress(os_socket, addr);
+  if (port > 0) {
+    first_os_socket = LookupByPort(port);
+    if (first_os_socket != NULL) {
+      // There is already a socket listening on this port. We need to ensure
+      // that if there is one also listening on the same address, it was created
+      // with `shared = true`, ...
+      OSSocket* os_socket = first_os_socket;
+      OSSocket* os_socket_same_addr = findOSSocketWithAddress(os_socket, addr);
 
-    if (os_socket_same_addr != NULL) {
-      if (!os_socket_same_addr->shared || !shared) {
-        OSError os_error(-1,
-                         "The shared flag to bind() needs to be `true` if "
-                         "binding multiple times on the same (address, port) "
-                         "combination.",
-                        OSError::kUnknown);
-        return DartUtils::NewDartOSError(&os_error);
+      if (os_socket_same_addr != NULL) {
+        if (!os_socket_same_addr->shared || !shared) {
+          OSError os_error(-1,
+                           "The shared flag to bind() needs to be `true` if "
+                           "binding multiple times on the same (address, port) "
+                           "combination.",
+                           OSError::kUnknown);
+          return DartUtils::NewDartOSError(&os_error);
+        }
+        if (os_socket_same_addr->v6_only != v6_only) {
+          OSError os_error(-1,
+                           "The v6Only flag to bind() needs to be the same if "
+                           "binding multiple times on the same (address, port) "
+                           "combination.",
+                           OSError::kUnknown);
+          return DartUtils::NewDartOSError(&os_error);
+        }
+
+        // This socket creation is the exact same as the one which originally
+        // created the socket. We therefore increment the refcount and reuse
+        // the file descriptor.
+        os_socket->ref_count++;
+
+        // We set as a side-effect the file descriptor on the dart
+        // socket_object.
+        Socket::SetSocketIdNativeField(socket_object, os_socket->socketfd);
+
+        return Dart_True();
       }
-      if (os_socket_same_addr->v6_only != v6_only) {
-        OSError os_error(-1,
-                         "The v6Only flag to bind() needs to be the same if "
-                         "binding multiple times on the same (address, port) "
-                         "combination.",
-                        OSError::kUnknown);
-        return DartUtils::NewDartOSError(&os_error);
-      }
-
-      // This socket creation is the exact same as the one which originally
-      // created the socket. We therefore increment the refcount and reuse
-      // the file descriptor.
-      os_socket->ref_count++;
-
-      // We set as a side-effect the file descriptor on the dart socket_object.
-      Socket::SetSocketIdNativeField(socket_object, os_socket->socketfd);
-
-      return Dart_True();
     }
   }
 
@@ -163,7 +163,25 @@
   intptr_t allocated_port = Socket::GetPort(socketfd);
   ASSERT(allocated_port > 0);
 
-  OSSocket *os_socket =
+  if (allocated_port != port) {
+    // There are two cases to consider:
+    //
+    //   a) The user requested (address, port) where port != 0 which means
+    //      we re-use an existing socket if available (and it is shared) or we
+    //      create a new one. The new socket is guaranteed to have that
+    //      selected port.
+    //
+    //   b) The user requested (address, 0). This will make us *always* create a
+    //      new socket. The OS will assign it a new `allocated_port` and we will
+    //      insert into our data structures. *BUT* There might already be an
+    //      existing (address2, `allocated_port`) where address != address2. So
+    //      we need to do another `LookupByPort(allocated_port)` and link them
+    //      via `OSSocket->next`.
+    ASSERT(port == 0);
+    first_os_socket = LookupByPort(allocated_port);
+  }
+
+  OSSocket* os_socket =
       new OSSocket(addr, allocated_port, v6_only, shared, socketfd);
   os_socket->ref_count = 1;
   os_socket->next = first_os_socket;
@@ -216,8 +234,7 @@
 
 void ListeningSocketRegistry::CloseAllSafe() {
   MutexLocker ml(mutex_);
-  for (HashMap::Entry* p = sockets_by_fd_.Start();
-       p != NULL;
+  for (HashMap::Entry* p = sockets_by_fd_.Start(); p != NULL;
        p = sockets_by_fd_.Next(p)) {
     CloseOneSafe(reinterpret_cast<OSSocket*>(p->value));
   }
@@ -440,16 +457,12 @@
     Dart_PropagateError(dart_args[3]);
   }
   // TODO(sgjesse): Cache the _makeDatagram function somewhere.
-  Dart_Handle io_lib =
-      Dart_LookupLibrary(DartUtils::NewString("dart:io"));
+  Dart_Handle io_lib = Dart_LookupLibrary(DartUtils::NewString("dart:io"));
   if (Dart_IsError(io_lib)) {
     Dart_PropagateError(io_lib);
   }
-  Dart_Handle result =
-      Dart_Invoke(io_lib,
-                  DartUtils::NewString("_makeDatagram"),
-                  kNumArgs,
-                  dart_args);
+  Dart_Handle result = Dart_Invoke(
+      io_lib, DartUtils::NewString("_makeDatagram"), kNumArgs, dart_args);
   Dart_SetReturnValue(args, result);
 }
 
@@ -459,10 +472,8 @@
       Socket::GetSocketIdNativeField(Dart_GetNativeArgument(args, 0));
   Dart_Handle buffer_obj = Dart_GetNativeArgument(args, 1);
   ASSERT(Dart_IsList(buffer_obj));
-  intptr_t offset =
-      DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 2));
-  intptr_t length =
-      DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 3));
+  intptr_t offset = DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 2));
+  intptr_t length = DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 3));
   bool short_write = false;
   if (short_socket_write) {
     if (length > 1) {
@@ -503,18 +514,14 @@
   intptr_t socket =
       Socket::GetSocketIdNativeField(Dart_GetNativeArgument(args, 0));
   Dart_Handle buffer_obj = Dart_GetNativeArgument(args, 1);
-  intptr_t offset =
-      DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 2));
-  intptr_t length =
-      DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 3));
+  intptr_t offset = DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 2));
+  intptr_t length = DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 3));
   Dart_Handle address_obj = Dart_GetNativeArgument(args, 4);
   ASSERT(Dart_IsList(address_obj));
   RawAddr addr;
   SocketAddress::GetSockAddr(address_obj, &addr);
   int64_t port = DartUtils::GetInt64ValueCheckRange(
-      Dart_GetNativeArgument(args, 5),
-      0,
-      65535);
+      Dart_GetNativeArgument(args, 5), 0, 65535);
   SocketAddress::SetAddrPort(&addr, port);
   Dart_TypedData_Type type;
   uint8_t* buffer = NULL;
@@ -566,7 +573,7 @@
     Dart_ListSetAt(entry, 1, Dart_NewStringFromCString(addr->as_string()));
 
     RawAddr raw = addr->addr();
-    intptr_t data_length = SocketAddress::GetAddrLength(raw);
+    intptr_t data_length = SocketAddress::GetInAddrLength(raw);
     Dart_Handle data = Dart_NewTypedData(Dart_TypedData_kUint8, data_length);
     Dart_ListSetAsBytes(data, 0, reinterpret_cast<uint8_t*>(&raw), data_length);
     Dart_ListSetAt(entry, 2, data);
@@ -604,8 +611,8 @@
 
 
 void FUNCTION_NAME(Socket_GetStdioHandle)(Dart_NativeArguments args) {
-  int64_t num = DartUtils::GetInt64ValueCheckRange(
-      Dart_GetNativeArgument(args, 1), 0, 2);
+  int64_t num =
+      DartUtils::GetInt64ValueCheckRange(Dart_GetNativeArgument(args, 1), 0, 2);
   intptr_t socket = Socket::GetStdioHandle(num);
   Socket::SetSocketIdNativeField(Dart_GetNativeArgument(args, 0), socket);
   Dart_SetReturnValue(args, Dart_NewBoolean(socket >= 0));
@@ -628,14 +635,10 @@
   RawAddr addr;
   SocketAddress::GetSockAddr(Dart_GetNativeArgument(args, 1), &addr);
   int64_t port = DartUtils::GetInt64ValueCheckRange(
-      Dart_GetNativeArgument(args, 2),
-      0,
-      65535);
+      Dart_GetNativeArgument(args, 2), 0, 65535);
   SocketAddress::SetAddrPort(&addr, port);
   int64_t backlog = DartUtils::GetInt64ValueCheckRange(
-      Dart_GetNativeArgument(args, 3),
-      0,
-      65535);
+      Dart_GetNativeArgument(args, 3), 0, 65535);
   bool v6_only = DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 4));
   bool shared = DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 5));
 
@@ -662,8 +665,7 @@
 
 
 CObject* Socket::LookupRequest(const CObjectArray& request) {
-  if ((request.Length() == 2) &&
-      request[0]->IsString() &&
+  if ((request.Length() == 2) && request[0]->IsString() &&
       request[1]->IsInt32()) {
     CObjectString host(request[0]);
     CObjectInt32 type(request[1]);
@@ -672,19 +674,19 @@
     AddressList<SocketAddress>* addresses =
         Socket::LookupAddress(host.CString(), type.Value(), &os_error);
     if (addresses != NULL) {
-      CObjectArray* array = new CObjectArray(
-          CObject::NewArray(addresses->count() + 1));
+      CObjectArray* array =
+          new CObjectArray(CObject::NewArray(addresses->count() + 1));
       array->SetAt(0, new CObjectInt32(CObject::NewInt32(0)));
       for (intptr_t i = 0; i < addresses->count(); i++) {
         SocketAddress* addr = addresses->GetAt(i);
         CObjectArray* entry = new CObjectArray(CObject::NewArray(3));
 
-        CObjectInt32* type = new CObjectInt32(
-            CObject::NewInt32(addr->GetType()));
+        CObjectInt32* type =
+            new CObjectInt32(CObject::NewInt32(addr->GetType()));
         entry->SetAt(0, type);
 
-        CObjectString* as_string = new CObjectString(CObject::NewString(
-            addr->as_string()));
+        CObjectString* as_string =
+            new CObjectString(CObject::NewString(addr->as_string()));
         entry->SetAt(1, as_string);
 
         RawAddr raw = addr->addr();
@@ -706,23 +708,20 @@
 
 
 CObject* Socket::ReverseLookupRequest(const CObjectArray& request) {
-  if ((request.Length() == 1) &&
-      request[0]->IsTypedData()) {
+  if ((request.Length() == 1) && request[0]->IsTypedData()) {
     CObjectUint8Array addr_object(request[0]);
     RawAddr addr;
     int len = addr_object.Length();
     memset(reinterpret_cast<void*>(&addr), 0, sizeof(RawAddr));
     if (len == sizeof(in_addr)) {
       addr.in.sin_family = AF_INET;
-      memmove(reinterpret_cast<void*>(&addr.in.sin_addr),
-              addr_object.Buffer(),
+      memmove(reinterpret_cast<void*>(&addr.in.sin_addr), addr_object.Buffer(),
               len);
     } else {
       ASSERT(len == sizeof(in6_addr));
       addr.in6.sin6_family = AF_INET6;
       memmove(reinterpret_cast<void*>(&addr.in6.sin6_addr),
-              addr_object.Buffer(),
-              len);
+              addr_object.Buffer(), len);
     }
 
     OSError* os_error = NULL;
@@ -741,40 +740,39 @@
 
 
 CObject* Socket::ListInterfacesRequest(const CObjectArray& request) {
-  if ((request.Length() == 1) &&
-      request[0]->IsInt32()) {
+  if ((request.Length() == 1) && request[0]->IsInt32()) {
     CObjectInt32 type(request[0]);
     CObject* result = NULL;
     OSError* os_error = NULL;
-    AddressList<InterfaceSocketAddress>* addresses = Socket::ListInterfaces(
-        type.Value(), &os_error);
+    AddressList<InterfaceSocketAddress>* addresses =
+        Socket::ListInterfaces(type.Value(), &os_error);
     if (addresses != NULL) {
-      CObjectArray* array = new CObjectArray(
-          CObject::NewArray(addresses->count() + 1));
+      CObjectArray* array =
+          new CObjectArray(CObject::NewArray(addresses->count() + 1));
       array->SetAt(0, new CObjectInt32(CObject::NewInt32(0)));
       for (intptr_t i = 0; i < addresses->count(); i++) {
         InterfaceSocketAddress* interface = addresses->GetAt(i);
         SocketAddress* addr = interface->socket_address();
         CObjectArray* entry = new CObjectArray(CObject::NewArray(5));
 
-        CObjectInt32* type = new CObjectInt32(
-            CObject::NewInt32(addr->GetType()));
+        CObjectInt32* type =
+            new CObjectInt32(CObject::NewInt32(addr->GetType()));
         entry->SetAt(0, type);
 
-        CObjectString* as_string = new CObjectString(CObject::NewString(
-            addr->as_string()));
+        CObjectString* as_string =
+            new CObjectString(CObject::NewString(addr->as_string()));
         entry->SetAt(1, as_string);
 
         RawAddr raw = addr->addr();
         CObjectUint8Array* data = SocketAddress::ToCObject(raw);
         entry->SetAt(2, data);
 
-        CObjectString* interface_name = new CObjectString(CObject::NewString(
-            interface->interface_name()));
+        CObjectString* interface_name =
+            new CObjectString(CObject::NewString(interface->interface_name()));
         entry->SetAt(3, interface_name);
 
-        CObjectInt64* interface_index = new CObjectInt64(CObject::NewInt64(
-            interface->interface_index()));
+        CObjectInt64* interface_index =
+            new CObjectInt64(CObject::NewInt64(interface->interface_index()));
         entry->SetAt(4, interface_index);
 
         array->SetAt(i + 1, entry);
@@ -795,9 +793,8 @@
   intptr_t socket =
       Socket::GetSocketIdNativeField(Dart_GetNativeArgument(args, 0));
   int64_t option = DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 1));
-  intptr_t protocol =
-      static_cast<intptr_t>(
-          DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 2)));
+  intptr_t protocol = static_cast<intptr_t>(
+      DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 2)));
   bool ok = false;
   switch (option) {
     case 0: {  // TCP_NODELAY.
@@ -853,8 +850,7 @@
       Socket::GetSocketIdNativeField(Dart_GetNativeArgument(args, 0));
   int64_t option = DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 1));
   int64_t protocol = DartUtils::GetInt64ValueCheckRange(
-      Dart_GetNativeArgument(args, 2),
-      SocketAddress::TYPE_IPV4,
+      Dart_GetNativeArgument(args, 2), SocketAddress::TYPE_IPV4,
       SocketAddress::TYPE_IPV6);
   switch (option) {
     case 0:  // TCP_NODELAY.
@@ -863,14 +859,12 @@
       break;
     case 1:  // IP_MULTICAST_LOOP.
       result = Socket::SetMulticastLoop(
-          socket,
-          protocol,
+          socket, protocol,
           DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 3)));
       break;
     case 2:  // IP_MULTICAST_TTL.
       result = Socket::SetMulticastHops(
-          socket,
-          protocol,
+          socket, protocol,
           DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 3)));
       break;
     case 3: {  // IP_MULTICAST_IF.
diff --git a/runtime/bin/socket.h b/runtime/bin/socket.h
index ea8dade..35d4acc 100644
--- a/runtime/bin/socket.h
+++ b/runtime/bin/socket.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_SOCKET_H_
-#define BIN_SOCKET_H_
+#ifndef RUNTIME_BIN_SOCKET_H_
+#define RUNTIME_BIN_SOCKET_H_
 
 #if defined(DART_IO_DISABLED)
 #error "socket.h can only be included on builds with IO enabled"
@@ -74,14 +74,14 @@
 
   static intptr_t GetAddrLength(const RawAddr& addr) {
     ASSERT((addr.ss.ss_family == AF_INET) || (addr.ss.ss_family == AF_INET6));
-    return (addr.ss.ss_family == AF_INET6) ?
-        sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in);
+    return (addr.ss.ss_family == AF_INET6) ? sizeof(struct sockaddr_in6)
+                                           : sizeof(struct sockaddr_in);
   }
 
   static intptr_t GetInAddrLength(const RawAddr& addr) {
     ASSERT((addr.ss.ss_family == AF_INET) || (addr.ss.ss_family == AF_INET6));
-    return (addr.ss.ss_family == AF_INET6) ?
-        sizeof(struct in6_addr) : sizeof(struct in_addr);
+    return (addr.ss.ss_family == AF_INET6) ? sizeof(struct in6_addr)
+                                           : sizeof(struct in_addr);
   }
 
   static bool AreAddressesEqual(const RawAddr& a, const RawAddr& b) {
@@ -94,8 +94,7 @@
       if (b.ss.ss_family != AF_INET6) {
         return false;
       }
-      return memcmp(&a.in6.sin6_addr,
-                    &b.in6.sin6_addr,
+      return memcmp(&a.in6.sin6_addr, &b.in6.sin6_addr,
                     sizeof(a.in6.sin6_addr)) == 0;
     } else {
       UNREACHABLE();
@@ -120,7 +119,7 @@
     memset(reinterpret_cast<void*>(addr), 0, sizeof(RawAddr));
     if (len == sizeof(in_addr)) {
       addr->in.sin_family = AF_INET;
-      memmove(reinterpret_cast<void *>(&addr->in.sin_addr), data, len);
+      memmove(reinterpret_cast<void*>(&addr->in.sin_addr), data, len);
     } else {
       ASSERT(len == sizeof(in6_addr));
       addr->in6.sin6_family = AF_INET6;
@@ -165,8 +164,8 @@
     Dart_Handle err;
     if (addr.addr.sa_family == AF_INET6) {
       err = Dart_ListSetAsBytes(
-          result, 0,
-          reinterpret_cast<const uint8_t*>(&addr.in6.sin6_addr), len);
+          result, 0, reinterpret_cast<const uint8_t*>(&addr.in6.sin6_addr),
+          len);
     } else {
       err = Dart_ListSetAsBytes(
           result, 0, reinterpret_cast<const uint8_t*>(&addr.in.sin_addr), len);
@@ -208,9 +207,7 @@
         interface_name_(interface_name),
         interface_index_(interface_index) {}
 
-  ~InterfaceSocketAddress() {
-    delete socket_address_;
-  }
+  ~InterfaceSocketAddress() { delete socket_address_; }
 
   SocketAddress* socket_address() const { return socket_address_; }
   const char* interface_name() const { return interface_name_; }
@@ -225,12 +222,11 @@
 };
 
 
-template<typename T>
+template <typename T>
 class AddressList {
  public:
   explicit AddressList(intptr_t count)
-      : count_(count),
-        addresses_(new T*[count_]) {}
+      : count_(count), addresses_(new T*[count_]) {}
 
   ~AddressList() {
     for (intptr_t i = 0; i < count_; i++) {
@@ -266,10 +262,14 @@
   // Send data on a socket. The port to send to is specified in the port
   // component of the passed RawAddr structure. The RawAddr structure is only
   // used for datagram sockets.
-  static intptr_t SendTo(
-      intptr_t fd, const void* buffer, intptr_t num_bytes, const RawAddr& addr);
-  static intptr_t RecvFrom(
-      intptr_t fd, void* buffer, intptr_t num_bytes, RawAddr* addr);
+  static intptr_t SendTo(intptr_t fd,
+                         const void* buffer,
+                         intptr_t num_bytes,
+                         const RawAddr& addr);
+  static intptr_t RecvFrom(intptr_t fd,
+                           void* buffer,
+                           intptr_t num_bytes,
+                           RawAddr* addr);
   // Creates a socket which is bound and connected. The port to connect to is
   // specified as the port component of the passed RawAddr structure.
   static intptr_t CreateConnect(const RawAddr& addr);
@@ -372,10 +372,10 @@
 
 class ListeningSocketRegistry {
  public:
-  ListeningSocketRegistry() :
-      sockets_by_port_(SameIntptrValue, kInitialSocketsCount),
-      sockets_by_fd_(SameIntptrValue, kInitialSocketsCount),
-      mutex_(new Mutex()) {}
+  ListeningSocketRegistry()
+      : sockets_by_port_(SameIntptrValue, kInitialSocketsCount),
+        sockets_by_fd_(SameIntptrValue, kInitialSocketsCount),
+        mutex_(new Mutex()) {}
 
   ~ListeningSocketRegistry() {
     CloseAllSafe();
@@ -385,7 +385,7 @@
 
   static void Initialize();
 
-  static ListeningSocketRegistry *Instance();
+  static ListeningSocketRegistry* Instance();
 
   static void Cleanup();
 
@@ -407,7 +407,7 @@
   // this function.
   bool CloseSafe(intptr_t socketfd);
 
-  Mutex *mutex() { return mutex_; }
+  Mutex* mutex() { return mutex_; }
 
  private:
   struct OSSocket {
@@ -420,17 +420,25 @@
 
     // Singly linked lists of OSSocket instances which listen on the same port
     // but on different addresses.
-    OSSocket *next;
+    OSSocket* next;
 
-    OSSocket(RawAddr address, int port, bool v6_only, bool shared,
+    OSSocket(RawAddr address,
+             int port,
+             bool v6_only,
+             bool shared,
              intptr_t socketfd)
-        : address(address), port(port), v6_only(v6_only), shared(shared),
-          ref_count(0), socketfd(socketfd), next(NULL) {}
+        : address(address),
+          port(port),
+          v6_only(v6_only),
+          shared(shared),
+          ref_count(0),
+          socketfd(socketfd),
+          next(NULL) {}
   };
 
   static const intptr_t kInitialSocketsCount = 8;
 
-  OSSocket *findOSSocketWithAddress(OSSocket *current, const RawAddr& addr) {
+  OSSocket* findOSSocketWithAddress(OSSocket* current, const RawAddr& addr) {
     while (current != NULL) {
       if (SocketAddress::AreAddressesEqual(current->address, addr)) {
         return current;
@@ -467,7 +475,7 @@
   HashMap sockets_by_port_;
   HashMap sockets_by_fd_;
 
-  Mutex *mutex_;
+  Mutex* mutex_;
 
   DISALLOW_COPY_AND_ASSIGN(ListeningSocketRegistry);
 };
@@ -475,4 +483,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_SOCKET_H_
+#endif  // RUNTIME_BIN_SOCKET_H_
diff --git a/runtime/bin/socket_android.cc b/runtime/bin/socket_android.cc
index caddb3a..08e49be 100644
--- a/runtime/bin/socket_android.cc
+++ b/runtime/bin/socket_android.cc
@@ -10,13 +10,13 @@
 #include "bin/socket.h"
 #include "bin/socket_android.h"
 
-#include <errno.h>  // NOLINT
+#include <errno.h>        // NOLINT
 #include <netinet/tcp.h>  // NOLINT
-#include <stdio.h>  // NOLINT
-#include <stdlib.h>  // NOLINT
-#include <string.h>  // NOLINT
-#include <sys/stat.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <stdio.h>        // NOLINT
+#include <stdlib.h>       // NOLINT
+#include <string.h>       // NOLINT
+#include <sys/stat.h>     // NOLINT
+#include <unistd.h>       // NOLINT
 
 #include "bin/fdutils.h"
 #include "bin/file.h"
@@ -27,19 +27,19 @@
 
 SocketAddress::SocketAddress(struct sockaddr* sa) {
   ASSERT(INET6_ADDRSTRLEN >= INET_ADDRSTRLEN);
-  if (!Socket::FormatNumericAddress(
-          *reinterpret_cast<RawAddr*>(sa), as_string_, INET6_ADDRSTRLEN)) {
+  if (!Socket::FormatNumericAddress(*reinterpret_cast<RawAddr*>(sa), as_string_,
+                                    INET6_ADDRSTRLEN)) {
     as_string_[0] = 0;
   }
   socklen_t salen = GetAddrLength(*reinterpret_cast<RawAddr*>(sa));
-  memmove(reinterpret_cast<void *>(&addr_), sa, salen);
+  memmove(reinterpret_cast<void*>(&addr_), sa, salen);
 }
 
 
 bool Socket::FormatNumericAddress(const RawAddr& addr, char* address, int len) {
   socklen_t salen = SocketAddress::GetAddrLength(addr);
-  return (NO_RETRY_EXPECTED(getnameinfo(
-      &addr.addr, salen, address, len, NULL, 0, NI_NUMERICHOST)) == 0);
+  return (NO_RETRY_EXPECTED(getnameinfo(&addr.addr, salen, address, len, NULL,
+                                        0, NI_NUMERICHOST)) == 0);
 }
 
 
@@ -55,7 +55,10 @@
   if (fd < 0) {
     return -1;
   }
-  FDUtils::SetCloseOnExec(fd);
+  if (!FDUtils::SetCloseOnExec(fd)) {
+    FDUtils::SaveErrorAndClose(fd);
+    return -1;
+  }
   return fd;
 }
 
@@ -66,7 +69,7 @@
   if ((result == 0) || (errno == EINPROGRESS)) {
     return fd;
   }
-  VOID_TEMP_FAILURE_RETRY(close(fd));
+  FDUtils::SaveErrorAndClose(fd);
   return -1;
 }
 
@@ -77,8 +80,10 @@
     return fd;
   }
 
-  FDUtils::SetNonBlocking(fd);
-
+  if (!FDUtils::SetNonBlocking(fd)) {
+    FDUtils::SaveErrorAndClose(fd);
+    return -1;
+  }
   return Connect(fd, addr);
 }
 
@@ -93,7 +98,7 @@
   intptr_t result = TEMP_FAILURE_RETRY(
       bind(fd, &source_addr.addr, SocketAddress::GetAddrLength(source_addr)));
   if ((result != 0) && (errno != EINPROGRESS)) {
-    VOID_TEMP_FAILURE_RETRY(close(fd));
+    FDUtils::SaveErrorAndClose(fd);
     return -1;
   }
 
@@ -103,7 +108,7 @@
 
 bool Socket::IsBindError(intptr_t error_number) {
   return error_number == EADDRINUSE || error_number == EADDRNOTAVAIL ||
-      error_number == EINVAL;
+         error_number == EINVAL;
 }
 
 
@@ -125,8 +130,10 @@
 }
 
 
-intptr_t Socket::RecvFrom(
-    intptr_t fd, void* buffer, intptr_t num_bytes, RawAddr* addr) {
+intptr_t Socket::RecvFrom(intptr_t fd,
+                          void* buffer,
+                          intptr_t num_bytes,
+                          RawAddr* addr) {
   ASSERT(fd >= 0);
   socklen_t addr_len = sizeof(addr->ss);
   ssize_t read_bytes = TEMP_FAILURE_RETRY(
@@ -153,12 +160,14 @@
 }
 
 
-intptr_t Socket::SendTo(
-    intptr_t fd, const void* buffer, intptr_t num_bytes, const RawAddr& addr) {
+intptr_t Socket::SendTo(intptr_t fd,
+                        const void* buffer,
+                        intptr_t num_bytes,
+                        const RawAddr& addr) {
   ASSERT(fd >= 0);
-  ssize_t written_bytes = TEMP_FAILURE_RETRY(
-      sendto(fd, buffer, num_bytes, 0,
-             &addr.addr, SocketAddress::GetAddrLength(addr)));
+  ssize_t written_bytes =
+      TEMP_FAILURE_RETRY(sendto(fd, buffer, num_bytes, 0, &addr.addr,
+                                SocketAddress::GetAddrLength(addr)));
   ASSERT(EAGAIN == EWOULDBLOCK);
   if ((written_bytes == -1) && (errno == EWOULDBLOCK)) {
     // If the would block we need to retry and therefore return 0 as
@@ -195,10 +204,7 @@
 void Socket::GetError(intptr_t fd, OSError* os_error) {
   int errorNumber;
   socklen_t len = sizeof(errorNumber);
-  getsockopt(fd,
-             SOL_SOCKET,
-             SO_ERROR,
-             reinterpret_cast<void*>(&errorNumber),
+  getsockopt(fd, SOL_SOCKET, SO_ERROR, reinterpret_cast<void*>(&errorNumber),
              &len);
   os_error->SetCodeAndMessage(OSError::kSystem, errorNumber);
 }
@@ -247,9 +253,8 @@
     status = getaddrinfo(host, 0, &hints, &info);
     if (status != 0) {
       ASSERT(*os_error == NULL);
-      *os_error = new OSError(status,
-                              gai_strerror(status),
-                              OSError::kGetAddressInfo);
+      *os_error =
+          new OSError(status, gai_strerror(status), OSError::kGetAddressInfo);
       return NULL;
     }
   }
@@ -277,19 +282,13 @@
                            intptr_t host_len,
                            OSError** os_error) {
   ASSERT(host_len >= NI_MAXHOST);
-  int status = NO_RETRY_EXPECTED(getnameinfo(
-      &addr.addr,
-      SocketAddress::GetAddrLength(addr),
-      host,
-      host_len,
-      NULL,
-      0,
-      NI_NAMEREQD));
+  int status = NO_RETRY_EXPECTED(
+      getnameinfo(&addr.addr, SocketAddress::GetAddrLength(addr), host,
+                  host_len, NULL, 0, NI_NAMEREQD));
   if (status != 0) {
     ASSERT(*os_error == NULL);
-    *os_error = new OSError(status,
-                            gai_strerror(status),
-                            OSError::kGetAddressInfo);
+    *os_error =
+        new OSError(status, gai_strerror(status), OSError::kGetAddressInfo);
     return false;
   }
   return true;
@@ -316,7 +315,10 @@
     return -1;
   }
 
-  FDUtils::SetCloseOnExec(fd);
+  if (!FDUtils::SetCloseOnExec(fd)) {
+    FDUtils::SaveErrorAndClose(fd);
+    return -1;
+  }
 
   if (reuseAddress) {
     int optval = 1;
@@ -325,14 +327,15 @@
   }
 
   if (NO_RETRY_EXPECTED(
-          bind(fd,
-               &addr.addr,
-               SocketAddress::GetAddrLength(addr))) < 0) {
-    VOID_TEMP_FAILURE_RETRY(close(fd));
+          bind(fd, &addr.addr, SocketAddress::GetAddrLength(addr))) < 0) {
+    FDUtils::SaveErrorAndClose(fd);
     return -1;
   }
 
-  FDUtils::SetNonBlocking(fd);
+  if (!FDUtils::SetNonBlocking(fd)) {
+    FDUtils::SaveErrorAndClose(fd);
+    return -1;
+  }
   return fd;
 }
 
@@ -366,7 +369,10 @@
     return -1;
   }
 
-  FDUtils::SetCloseOnExec(fd);
+  if (!FDUtils::SetCloseOnExec(fd)) {
+    FDUtils::SaveErrorAndClose(fd);
+    return -1;
+  }
 
   int optval = 1;
   VOID_NO_RETRY_EXPECTED(
@@ -379,10 +385,8 @@
   }
 
   if (NO_RETRY_EXPECTED(
-          bind(fd,
-               &addr.addr,
-               SocketAddress::GetAddrLength(addr))) < 0) {
-    VOID_TEMP_FAILURE_RETRY(close(fd));
+          bind(fd, &addr.addr, SocketAddress::GetAddrLength(addr))) < 0) {
+    FDUtils::SaveErrorAndClose(fd);
     return -1;
   }
 
@@ -392,18 +396,19 @@
     // Don't close the socket until we have created a new socket, ensuring
     // that we do not get the bad port number again.
     intptr_t new_fd = CreateBindListen(addr, backlog, v6_only);
-    int err = errno;
-    VOID_TEMP_FAILURE_RETRY(close(fd));
-    errno = err;
+    FDUtils::SaveErrorAndClose(fd);
     return new_fd;
   }
 
   if (NO_RETRY_EXPECTED(listen(fd, backlog > 0 ? backlog : SOMAXCONN)) != 0) {
-    VOID_TEMP_FAILURE_RETRY(close(fd));
+    FDUtils::SaveErrorAndClose(fd);
     return -1;
   }
 
-  FDUtils::SetNonBlocking(fd);
+  if (!FDUtils::SetNonBlocking(fd)) {
+    FDUtils::SaveErrorAndClose(fd);
+    return -1;
+  }
   return fd;
 }
 
@@ -418,9 +423,9 @@
   // On Android a number of protocol errors should be treated as EAGAIN.
   // These are the ones for TCP/IP.
   return (error == EAGAIN) || (error == ENETDOWN) || (error == EPROTO) ||
-      (error == ENOPROTOOPT) || (error == EHOSTDOWN) || (error == ENONET) ||
-      (error == EHOSTUNREACH) || (error == EOPNOTSUPP) ||
-      (error == ENETUNREACH);
+         (error == ENOPROTOOPT) || (error == EHOSTDOWN) || (error == ENONET) ||
+         (error == EHOSTUNREACH) || (error == EOPNOTSUPP) ||
+         (error == ENETUNREACH);
 }
 
 
@@ -438,8 +443,14 @@
       socket = kTemporaryFailure;
     }
   } else {
-    FDUtils::SetCloseOnExec(socket);
-    FDUtils::SetNonBlocking(socket);
+    if (!FDUtils::SetCloseOnExec(socket)) {
+      FDUtils::SaveErrorAndClose(socket);
+      return -1;
+    }
+    if (!FDUtils::SetNonBlocking(socket)) {
+      FDUtils::SaveErrorAndClose(socket);
+      return -1;
+    }
   }
   return socket;
 }
@@ -454,11 +465,8 @@
 bool Socket::GetNoDelay(intptr_t fd, bool* enabled) {
   int on;
   socklen_t len = sizeof(on);
-  int err = NO_RETRY_EXPECTED(getsockopt(fd,
-                                         IPPROTO_TCP,
-                                         TCP_NODELAY,
-                                         reinterpret_cast<void *>(&on),
-                                         &len));
+  int err = NO_RETRY_EXPECTED(getsockopt(fd, IPPROTO_TCP, TCP_NODELAY,
+                                         reinterpret_cast<void*>(&on), &len));
   if (err == 0) {
     *enabled = (on == 1);
   }
@@ -468,10 +476,8 @@
 
 bool Socket::SetNoDelay(intptr_t fd, bool enabled) {
   int on = enabled ? 1 : 0;
-  return NO_RETRY_EXPECTED(setsockopt(fd,
-                                      IPPROTO_TCP,
-                                      TCP_NODELAY,
-                                      reinterpret_cast<char *>(&on),
+  return NO_RETRY_EXPECTED(setsockopt(fd, IPPROTO_TCP, TCP_NODELAY,
+                                      reinterpret_cast<char*>(&on),
                                       sizeof(on))) == 0;
 }
 
@@ -480,13 +486,10 @@
   uint8_t on;
   socklen_t len = sizeof(on);
   int level = protocol == SocketAddress::TYPE_IPV4 ? IPPROTO_IP : IPPROTO_IPV6;
-  int optname = protocol == SocketAddress::TYPE_IPV4
-      ? IP_MULTICAST_LOOP : IPV6_MULTICAST_LOOP;
-  if (NO_RETRY_EXPECTED(getsockopt(fd,
-                                   level,
-                                   optname,
-                                   reinterpret_cast<char *>(&on),
-                                   &len)) == 0) {
+  int optname = protocol == SocketAddress::TYPE_IPV4 ? IP_MULTICAST_LOOP
+                                                     : IPV6_MULTICAST_LOOP;
+  if (NO_RETRY_EXPECTED(getsockopt(fd, level, optname,
+                                   reinterpret_cast<char*>(&on), &len)) == 0) {
     *enabled = (on == 1);
     return true;
   }
@@ -497,26 +500,21 @@
 bool Socket::SetMulticastLoop(intptr_t fd, intptr_t protocol, bool enabled) {
   int on = enabled ? 1 : 0;
   int level = protocol == SocketAddress::TYPE_IPV4 ? IPPROTO_IP : IPPROTO_IPV6;
-  int optname = protocol == SocketAddress::TYPE_IPV4
-      ? IP_MULTICAST_LOOP : IPV6_MULTICAST_LOOP;
-  return NO_RETRY_EXPECTED(setsockopt(fd,
-                                      level,
-                                      optname,
-                                      reinterpret_cast<char *>(&on),
-                                      sizeof(on))) == 0;
+  int optname = protocol == SocketAddress::TYPE_IPV4 ? IP_MULTICAST_LOOP
+                                                     : IPV6_MULTICAST_LOOP;
+  return NO_RETRY_EXPECTED(setsockopt(
+             fd, level, optname, reinterpret_cast<char*>(&on), sizeof(on))) ==
+         0;
 }
 
 bool Socket::GetMulticastHops(intptr_t fd, intptr_t protocol, int* value) {
   uint8_t v;
   socklen_t len = sizeof(v);
   int level = protocol == SocketAddress::TYPE_IPV4 ? IPPROTO_IP : IPPROTO_IPV6;
-  int optname = protocol == SocketAddress::TYPE_IPV4
-      ? IP_MULTICAST_TTL : IPV6_MULTICAST_HOPS;
-  if (NO_RETRY_EXPECTED(getsockopt(fd,
-                                   level,
-                                   optname,
-                                   reinterpret_cast<char *>(&v),
-                                   &len)) == 0) {
+  int optname = protocol == SocketAddress::TYPE_IPV4 ? IP_MULTICAST_TTL
+                                                     : IPV6_MULTICAST_HOPS;
+  if (NO_RETRY_EXPECTED(getsockopt(fd, level, optname,
+                                   reinterpret_cast<char*>(&v), &len)) == 0) {
     *value = v;
     return true;
   }
@@ -527,24 +525,18 @@
 bool Socket::SetMulticastHops(intptr_t fd, intptr_t protocol, int value) {
   int v = value;
   int level = protocol == SocketAddress::TYPE_IPV4 ? IPPROTO_IP : IPPROTO_IPV6;
-  int optname = protocol == SocketAddress::TYPE_IPV4
-      ? IP_MULTICAST_TTL : IPV6_MULTICAST_HOPS;
-  return NO_RETRY_EXPECTED(setsockopt(fd,
-                                      level,
-                                      optname,
-                                      reinterpret_cast<char *>(&v),
-                                      sizeof(v))) == 0;
+  int optname = protocol == SocketAddress::TYPE_IPV4 ? IP_MULTICAST_TTL
+                                                     : IPV6_MULTICAST_HOPS;
+  return NO_RETRY_EXPECTED(setsockopt(
+             fd, level, optname, reinterpret_cast<char*>(&v), sizeof(v))) == 0;
 }
 
 
 bool Socket::GetBroadcast(intptr_t fd, bool* enabled) {
   int on;
   socklen_t len = sizeof(on);
-  int err = NO_RETRY_EXPECTED(getsockopt(fd,
-                                         SOL_SOCKET,
-                                         SO_BROADCAST,
-                                         reinterpret_cast<char *>(&on),
-                                         &len));
+  int err = NO_RETRY_EXPECTED(getsockopt(fd, SOL_SOCKET, SO_BROADCAST,
+                                         reinterpret_cast<char*>(&on), &len));
   if (err == 0) {
     *enabled = (on == 1);
   }
@@ -554,33 +546,35 @@
 
 bool Socket::SetBroadcast(intptr_t fd, bool enabled) {
   int on = enabled ? 1 : 0;
-  return NO_RETRY_EXPECTED(setsockopt(fd,
-                                      SOL_SOCKET,
-                                      SO_BROADCAST,
-                                      reinterpret_cast<char *>(&on),
+  return NO_RETRY_EXPECTED(setsockopt(fd, SOL_SOCKET, SO_BROADCAST,
+                                      reinterpret_cast<char*>(&on),
                                       sizeof(on))) == 0;
 }
 
 
-bool Socket::JoinMulticast(
-    intptr_t fd, const RawAddr& addr, const RawAddr&, int interfaceIndex) {
+bool Socket::JoinMulticast(intptr_t fd,
+                           const RawAddr& addr,
+                           const RawAddr&,
+                           int interfaceIndex) {
   int proto = (addr.addr.sa_family == AF_INET) ? IPPROTO_IP : IPPROTO_IPV6;
   struct group_req mreq;
   mreq.gr_interface = interfaceIndex;
   memmove(&mreq.gr_group, &addr.ss, SocketAddress::GetAddrLength(addr));
-  return NO_RETRY_EXPECTED(setsockopt(
-      fd, proto, MCAST_JOIN_GROUP, &mreq, sizeof(mreq))) == 0;
+  return NO_RETRY_EXPECTED(
+             setsockopt(fd, proto, MCAST_JOIN_GROUP, &mreq, sizeof(mreq))) == 0;
 }
 
 
-bool Socket::LeaveMulticast(
-    intptr_t fd, const RawAddr& addr, const RawAddr&, int interfaceIndex) {
+bool Socket::LeaveMulticast(intptr_t fd,
+                            const RawAddr& addr,
+                            const RawAddr&,
+                            int interfaceIndex) {
   int proto = (addr.addr.sa_family == AF_INET) ? IPPROTO_IP : IPPROTO_IPV6;
   struct group_req mreq;
   mreq.gr_interface = interfaceIndex;
   memmove(&mreq.gr_group, &addr.ss, SocketAddress::GetAddrLength(addr));
-  return NO_RETRY_EXPECTED(setsockopt(
-      fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0;
+  return NO_RETRY_EXPECTED(setsockopt(fd, proto, MCAST_LEAVE_GROUP, &mreq,
+                                      sizeof(mreq))) == 0;
 }
 
 }  // namespace bin
diff --git a/runtime/bin/socket_android.h b/runtime/bin/socket_android.h
index 13ff16e..43fddc1 100644
--- a/runtime/bin/socket_android.h
+++ b/runtime/bin/socket_android.h
@@ -2,10 +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.
 
-#ifndef BIN_SOCKET_ANDROID_H_
-#define BIN_SOCKET_ANDROID_H_
+#ifndef RUNTIME_BIN_SOCKET_ANDROID_H_
+#define RUNTIME_BIN_SOCKET_ANDROID_H_
 
-#if !defined(BIN_SOCKET_H_)
+#if !defined(RUNTIME_BIN_SOCKET_H_)
 #error Do not include socket_android.h directly. Use socket.h.
 #endif
 
@@ -13,4 +13,4 @@
 #include <netdb.h>
 #include <sys/socket.h>
 
-#endif  // BIN_SOCKET_ANDROID_H_
+#endif  // RUNTIME_BIN_SOCKET_ANDROID_H_
diff --git a/runtime/bin/socket_fuchsia.cc b/runtime/bin/socket_fuchsia.cc
index b79d1c0..2443ee3 100644
--- a/runtime/bin/socket_fuchsia.cc
+++ b/runtime/bin/socket_fuchsia.cc
@@ -10,103 +10,236 @@
 #include "bin/socket.h"
 #include "bin/socket_fuchsia.h"
 
+#include <errno.h>        // NOLINT
+#include <fcntl.h>        // NOLINT
+#include <ifaddrs.h>      // NOLINT
+#include <net/if.h>       // NOLINT
+#include <netinet/tcp.h>  // NOLINT
+#include <stdio.h>        // NOLINT
+#include <stdlib.h>       // NOLINT
+#include <string.h>       // NOLINT
+#include <sys/ioctl.h>    // NOLINT
+#include <sys/stat.h>     // NOLINT
+#include <unistd.h>       // NOLINT
+
+#include "bin/fdutils.h"
 #include "bin/file.h"
+#include "platform/signal_blocker.h"
+
+// #define SOCKET_LOG_INFO 1
+// #define SOCKET_LOG_ERROR 1
+
+// define SOCKET_LOG_ERROR to get log messages only for errors.
+// define SOCKET_LOG_INFO to get log messages for both information and errors.
+#if defined(SOCKET_LOG_INFO) || defined(SOCKET_LOG_ERROR)
+#define LOG_ERR(msg, ...)                                                      \
+  {                                                                            \
+    int err = errno;                                                           \
+    Log::PrintErr("Dart Socket ERROR: %s:%d: " msg, __FILE__, __LINE__,        \
+                  ##__VA_ARGS__);                                              \
+    errno = err;                                                               \
+  }
+#if defined(SOCKET_LOG_INFO)
+#define LOG_INFO(msg, ...)                                                     \
+  Log::Print("Dart Socket INFO: %s:%d: " msg, __FILE__, __LINE__, ##__VA_ARGS__)
+#else
+#define LOG_INFO(msg, ...)
+#endif  // defined(SOCKET_LOG_INFO)
+#else
+#define LOG_ERR(msg, ...)
+#define LOG_INFO(msg, ...)
+#endif  // defined(SOCKET_LOG_INFO) || defined(SOCKET_LOG_ERROR)
 
 namespace dart {
 namespace bin {
 
 SocketAddress::SocketAddress(struct sockaddr* sa) {
-  UNIMPLEMENTED();
+  ASSERT(INET6_ADDRSTRLEN >= INET_ADDRSTRLEN);
+  if (!Socket::FormatNumericAddress(*reinterpret_cast<RawAddr*>(sa), as_string_,
+                                    INET6_ADDRSTRLEN)) {
+    as_string_[0] = 0;
+  }
+  socklen_t salen = GetAddrLength(*reinterpret_cast<RawAddr*>(sa));
+  memmove(reinterpret_cast<void*>(&addr_), sa, salen);
 }
 
 
 bool Socket::FormatNumericAddress(const RawAddr& addr, char* address, int len) {
-  UNIMPLEMENTED();
-  return false;
+  socklen_t salen = SocketAddress::GetAddrLength(addr);
+  LOG_INFO("Socket::FormatNumericAddress: calling getnameinfo\n");
+  return (NO_RETRY_EXPECTED(getnameinfo(&addr.addr, salen, address, len, NULL,
+                                        0, NI_NUMERICHOST) == 0));
 }
 
 
 bool Socket::Initialize() {
-  UNIMPLEMENTED();
+  // Nothing to do on Fuchsia.
   return true;
 }
 
 
-intptr_t Socket::CreateConnect(const RawAddr& addr) {
-  UNIMPLEMENTED();
+static intptr_t Create(const RawAddr& addr) {
+  LOG_INFO("Create: calling socket(SOCK_STREAM)\n");
+  intptr_t fd = NO_RETRY_EXPECTED(socket(addr.ss.ss_family, SOCK_STREAM, 0));
+  if (fd < 0) {
+    LOG_ERR("Create: socket(SOCK_STREAM) failed\n");
+    return -1;
+  }
+  LOG_INFO("Create: socket(SOCK_STREAM) -> fd %ld\n", fd);
+  if (!FDUtils::SetCloseOnExec(fd)) {
+    LOG_ERR("Create: FDUtils::SetCloseOnExec(%ld) failed\n", fd);
+    FDUtils::SaveErrorAndClose(fd);
+    return -1;
+  }
+  return fd;
+}
+
+
+static intptr_t Connect(intptr_t fd, const RawAddr& addr) {
+  LOG_INFO("Connect: calling connect(%ld)\n", fd);
+  intptr_t result = NO_RETRY_EXPECTED(
+      connect(fd, &addr.addr, SocketAddress::GetAddrLength(addr)));
+  if ((result == 0) || (errno == EINPROGRESS)) {
+    return fd;
+  }
+  LOG_ERR("Connect: connect(%ld) failed\n", fd);
+  FDUtils::SaveErrorAndClose(fd);
   return -1;
 }
 
 
+intptr_t Socket::CreateConnect(const RawAddr& addr) {
+  intptr_t fd = Create(addr);
+  if (fd < 0) {
+    return fd;
+  }
+  if (!FDUtils::SetNonBlocking(fd)) {
+    LOG_ERR("CreateConnect: FDUtils::SetNonBlocking(%ld) failed\n", fd);
+    FDUtils::SaveErrorAndClose(fd);
+    return -1;
+  }
+  return Connect(fd, addr);
+}
+
+
 intptr_t Socket::CreateBindConnect(const RawAddr& addr,
                                    const RawAddr& source_addr) {
+  LOG_ERR("Socket::CreateBindConnect is unimplemented\n");
   UNIMPLEMENTED();
   return -1;
 }
 
 
 bool Socket::IsBindError(intptr_t error_number) {
-  UNIMPLEMENTED();
-  return false;
+  return error_number == EADDRINUSE || error_number == EADDRNOTAVAIL ||
+         error_number == EINVAL;
 }
 
 
 intptr_t Socket::Available(intptr_t fd) {
-  UNIMPLEMENTED();
-  return -1;
+  return FDUtils::AvailableBytes(fd);
 }
 
 
 intptr_t Socket::Read(intptr_t fd, void* buffer, intptr_t num_bytes) {
-  UNIMPLEMENTED();
-  return -1;
+  ASSERT(fd >= 0);
+  LOG_INFO("Socket::Read: calling read(%ld, %p, %ld)\n", fd, buffer, num_bytes);
+  ssize_t read_bytes = NO_RETRY_EXPECTED(read(fd, buffer, num_bytes));
+  ASSERT(EAGAIN == EWOULDBLOCK);
+  if ((read_bytes == -1) && (errno == EWOULDBLOCK)) {
+    // If the read would block we need to retry and therefore return 0
+    // as the number of bytes written.
+    read_bytes = 0;
+  } else if (read_bytes == -1) {
+    LOG_ERR("Socket::Read: read(%ld, %p, %ld) failed\n", fd, buffer, num_bytes);
+  } else {
+    LOG_INFO("Socket::Read: read(%ld, %p, %ld) succeeded\n", fd, buffer,
+             num_bytes);
+  }
+  return read_bytes;
 }
 
 
-intptr_t Socket::RecvFrom(
-    intptr_t fd, void* buffer, intptr_t num_bytes, RawAddr* addr) {
+intptr_t Socket::RecvFrom(intptr_t fd,
+                          void* buffer,
+                          intptr_t num_bytes,
+                          RawAddr* addr) {
+  LOG_ERR("Socket::RecvFrom is unimplemented\n");
   UNIMPLEMENTED();
   return -1;
 }
 
 
 intptr_t Socket::Write(intptr_t fd, const void* buffer, intptr_t num_bytes) {
-  UNIMPLEMENTED();
-  return -1;
+  ASSERT(fd >= 0);
+  LOG_INFO("Socket::Write: calling write(%ld, %p, %ld)\n", fd, buffer,
+           num_bytes);
+  ssize_t written_bytes = NO_RETRY_EXPECTED(write(fd, buffer, num_bytes));
+  ASSERT(EAGAIN == EWOULDBLOCK);
+  if ((written_bytes == -1) && (errno == EWOULDBLOCK)) {
+    // If the would block we need to retry and therefore return 0 as
+    // the number of bytes written.
+    written_bytes = 0;
+  } else if (written_bytes == -1) {
+    LOG_ERR("Socket::Write: write(%ld, %p, %ld) failed\n", fd, buffer,
+            num_bytes);
+  } else {
+    LOG_INFO("Socket::Write: write(%ld, %p, %ld) succeeded\n", fd, buffer,
+             num_bytes);
+  }
+  return written_bytes;
 }
 
 
-intptr_t Socket::SendTo(
-    intptr_t fd, const void* buffer, intptr_t num_bytes, const RawAddr& addr) {
+intptr_t Socket::SendTo(intptr_t fd,
+                        const void* buffer,
+                        intptr_t num_bytes,
+                        const RawAddr& addr) {
+  LOG_ERR("Socket::SendTo is unimplemented\n");
   UNIMPLEMENTED();
   return -1;
 }
 
 
 intptr_t Socket::GetPort(intptr_t fd) {
-  UNIMPLEMENTED();
-  return -1;
+  ASSERT(fd >= 0);
+  RawAddr raw;
+  socklen_t size = sizeof(raw);
+  LOG_INFO("Socket::GetPort: calling getsockname(%ld)\n", fd);
+  if (NO_RETRY_EXPECTED(getsockname(fd, &raw.addr, &size))) {
+    return 0;
+  }
+  return SocketAddress::GetAddrPort(raw);
 }
 
 
 SocketAddress* Socket::GetRemotePeer(intptr_t fd, intptr_t* port) {
-  UNIMPLEMENTED();
-  return NULL;
+  ASSERT(fd >= 0);
+  RawAddr raw;
+  socklen_t size = sizeof(raw);
+  if (NO_RETRY_EXPECTED(getpeername(fd, &raw.addr, &size))) {
+    return NULL;
+  }
+  *port = SocketAddress::GetAddrPort(raw);
+  return new SocketAddress(&raw.addr);
 }
 
 
 void Socket::GetError(intptr_t fd, OSError* os_error) {
+  LOG_ERR("Socket::GetError is unimplemented\n");
   UNIMPLEMENTED();
 }
 
 
 int Socket::GetType(intptr_t fd) {
+  LOG_ERR("Socket::GetType is unimplemented\n");
   UNIMPLEMENTED();
   return File::kOther;
 }
 
 
 intptr_t Socket::GetStdioHandle(intptr_t num) {
+  LOG_ERR("Socket::GetStdioHandle is unimplemented\n");
   UNIMPLEMENTED();
   return num;
 }
@@ -115,8 +248,45 @@
 AddressList<SocketAddress>* Socket::LookupAddress(const char* host,
                                                   int type,
                                                   OSError** os_error) {
-  UNIMPLEMENTED();
-  return NULL;
+  // Perform a name lookup for a host name.
+  struct addrinfo hints;
+  memset(&hints, 0, sizeof(hints));
+  hints.ai_family = SocketAddress::FromType(type);
+  hints.ai_socktype = SOCK_STREAM;
+  hints.ai_flags = AI_ADDRCONFIG;
+  hints.ai_protocol = IPPROTO_TCP;
+  struct addrinfo* info = NULL;
+  LOG_INFO("Socket::LookupAddress: calling getaddrinfo\n");
+  int status = NO_RETRY_EXPECTED(getaddrinfo(host, 0, &hints, &info));
+  if (status != 0) {
+    // We failed, try without AI_ADDRCONFIG. This can happen when looking up
+    // e.g. '::1', when there are no global IPv6 addresses.
+    hints.ai_flags = 0;
+    LOG_INFO("Socket::LookupAddress: calling getaddrinfo again\n");
+    status = NO_RETRY_EXPECTED(getaddrinfo(host, 0, &hints, &info));
+    if (status != 0) {
+      ASSERT(*os_error == NULL);
+      *os_error =
+          new OSError(status, gai_strerror(status), OSError::kGetAddressInfo);
+      return NULL;
+    }
+  }
+  intptr_t count = 0;
+  for (struct addrinfo* c = info; c != NULL; c = c->ai_next) {
+    if ((c->ai_family == AF_INET) || (c->ai_family == AF_INET6)) {
+      count++;
+    }
+  }
+  intptr_t i = 0;
+  AddressList<SocketAddress>* addresses = new AddressList<SocketAddress>(count);
+  for (struct addrinfo* c = info; c != NULL; c = c->ai_next) {
+    if ((c->ai_family == AF_INET) || (c->ai_family == AF_INET6)) {
+      addresses->SetAt(i, new SocketAddress(c->ai_addr));
+      i++;
+    }
+  }
+  freeaddrinfo(info);
+  return addresses;
 }
 
 
@@ -124,18 +294,27 @@
                            char* host,
                            intptr_t host_len,
                            OSError** os_error) {
+  LOG_ERR("Socket::ReverseLookup is unimplemented\n");
   UNIMPLEMENTED();
   return false;
 }
 
 
 bool Socket::ParseAddress(int type, const char* address, RawAddr* addr) {
-  UNIMPLEMENTED();
-  return false;
+  int result;
+  if (type == SocketAddress::TYPE_IPV4) {
+    result = NO_RETRY_EXPECTED(inet_pton(AF_INET, address, &addr->in.sin_addr));
+  } else {
+    ASSERT(type == SocketAddress::TYPE_IPV6);
+    result =
+        NO_RETRY_EXPECTED(inet_pton(AF_INET6, address, &addr->in6.sin6_addr));
+  }
+  return (result == 1);
 }
 
 
 intptr_t Socket::CreateBindDatagram(const RawAddr& addr, bool reuseAddress) {
+  LOG_ERR("Socket::CreateBindDatagram is unimplemented\n");
   UNIMPLEMENTED();
   return -1;
 }
@@ -157,85 +336,195 @@
 intptr_t ServerSocket::CreateBindListen(const RawAddr& addr,
                                         intptr_t backlog,
                                         bool v6_only) {
-  UNIMPLEMENTED();
-  return -1;
+  LOG_INFO("ServerSocket::CreateBindListen: calling socket(SOCK_STREAM)\n");
+  intptr_t fd = NO_RETRY_EXPECTED(socket(addr.ss.ss_family, SOCK_STREAM, 0));
+  if (fd < 0) {
+    LOG_ERR("ServerSocket::CreateBindListen: socket() failed\n");
+    return -1;
+  }
+  LOG_INFO("ServerSocket::CreateBindListen: socket(SOCK_STREAM) -> %ld\n", fd);
+
+  if (!FDUtils::SetCloseOnExec(fd)) {
+    LOG_ERR("ServerSocket::CreateBindListen: SetCloseOnExec(%ld) failed\n", fd);
+    FDUtils::SaveErrorAndClose(fd);
+    return -1;
+  }
+
+  LOG_INFO("ServerSocket::CreateBindListen: calling setsockopt(%ld)\n", fd);
+  int optval = 1;
+  VOID_NO_RETRY_EXPECTED(
+      setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)));
+
+  if (addr.ss.ss_family == AF_INET6) {
+    optval = v6_only ? 1 : 0;
+    LOG_INFO("ServerSocket::CreateBindListen: calling setsockopt(%ld)\n", fd);
+    VOID_NO_RETRY_EXPECTED(
+        setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &optval, sizeof(optval)));
+  }
+
+  LOG_INFO("ServerSocket::CreateBindListen: calling bind(%ld)\n", fd);
+  if (NO_RETRY_EXPECTED(
+          bind(fd, &addr.addr, SocketAddress::GetAddrLength(addr))) < 0) {
+    LOG_ERR("ServerSocket::CreateBindListen: bind(%ld) failed\n", fd);
+    FDUtils::SaveErrorAndClose(fd);
+    return -1;
+  }
+  LOG_INFO("ServerSocket::CreateBindListen: bind(%ld) succeeded\n", fd);
+
+  // Test for invalid socket port 65535 (some browsers disallow it).
+  if ((SocketAddress::GetAddrPort(addr) == 0) &&
+      (Socket::GetPort(fd) == 65535)) {
+    // Don't close the socket until we have created a new socket, ensuring
+    // that we do not get the bad port number again.
+    intptr_t new_fd = CreateBindListen(addr, backlog, v6_only);
+    FDUtils::SaveErrorAndClose(fd);
+    return new_fd;
+  }
+
+  LOG_INFO("ServerSocket::CreateBindListen: calling listen(%ld)\n", fd);
+  if (NO_RETRY_EXPECTED(listen(fd, backlog > 0 ? backlog : SOMAXCONN)) != 0) {
+    LOG_ERR("ServerSocket::CreateBindListen: listen failed(%ld)\n", fd);
+    FDUtils::SaveErrorAndClose(fd);
+    return -1;
+  }
+  LOG_INFO("ServerSocket::CreateBindListen: listen(%ld) succeeded\n", fd);
+
+  if (!FDUtils::SetNonBlocking(fd)) {
+    LOG_ERR("CreateBindListen: FDUtils::SetNonBlocking(%ld) failed\n", fd);
+    FDUtils::SaveErrorAndClose(fd);
+    return -1;
+  }
+  return fd;
 }
 
 
 bool ServerSocket::StartAccept(intptr_t fd) {
-  UNIMPLEMENTED();
-  return false;
+  USE(fd);
+  return true;
+}
+
+
+static bool IsTemporaryAcceptError(int error) {
+  // On Linux a number of protocol errors should be treated as EAGAIN.
+  // These are the ones for TCP/IP.
+  return (error == EAGAIN) || (error == ENETDOWN) || (error == EPROTO) ||
+         (error == ENOPROTOOPT) || (error == EHOSTDOWN) || (error == ENONET) ||
+         (error == EHOSTUNREACH) || (error == EOPNOTSUPP) ||
+         (error == ENETUNREACH);
 }
 
 
 intptr_t ServerSocket::Accept(intptr_t fd) {
-  UNIMPLEMENTED();
-  return -1;
+  intptr_t socket;
+  struct sockaddr clientaddr;
+  socklen_t addrlen = sizeof(clientaddr);
+  LOG_INFO("ServerSocket::Accept: calling accept(%ld)\n", fd);
+  socket = NO_RETRY_EXPECTED(accept(fd, &clientaddr, &addrlen));
+  if (socket == -1) {
+    if (IsTemporaryAcceptError(errno)) {
+      // We need to signal to the caller that this is actually not an
+      // error. We got woken up from the poll on the listening socket,
+      // but there is no connection ready to be accepted.
+      ASSERT(kTemporaryFailure != -1);
+      socket = kTemporaryFailure;
+    } else {
+      LOG_ERR("ServerSocket::Accept: accept(%ld) failed\n", fd);
+    }
+  } else {
+    LOG_INFO("ServerSocket::Accept: accept(%ld) -> socket %ld\n", fd, socket);
+    if (!FDUtils::SetCloseOnExec(socket)) {
+      LOG_ERR("FDUtils::SetCloseOnExec(%ld) failed\n", socket);
+      FDUtils::SaveErrorAndClose(socket);
+      return -1;
+    }
+    if (!FDUtils::SetNonBlocking(socket)) {
+      LOG_ERR("FDUtils::SetNonBlocking(%ld) failed\n", socket);
+      FDUtils::SaveErrorAndClose(socket);
+      return -1;
+    }
+  }
+  return socket;
 }
 
 
 void Socket::Close(intptr_t fd) {
-  UNIMPLEMENTED();
+  ASSERT(fd >= 0);
+  NO_RETRY_EXPECTED(close(fd));
 }
 
 
 bool Socket::GetNoDelay(intptr_t fd, bool* enabled) {
+  LOG_ERR("Socket::GetNoDelay is unimplemented\n");
   UNIMPLEMENTED();
   return false;
 }
 
 
 bool Socket::SetNoDelay(intptr_t fd, bool enabled) {
-  UNIMPLEMENTED();
-  return false;
+  int on = enabled ? 1 : 0;
+  return NO_RETRY_EXPECTED(setsockopt(fd, IPPROTO_TCP, TCP_NODELAY,
+                                      reinterpret_cast<char*>(&on),
+                                      sizeof(on))) == 0;
 }
 
 
 bool Socket::GetMulticastLoop(intptr_t fd, intptr_t protocol, bool* enabled) {
+  LOG_ERR("Socket::GetMulticastLoop is unimplemented\n");
   UNIMPLEMENTED();
   return false;
 }
 
 
 bool Socket::SetMulticastLoop(intptr_t fd, intptr_t protocol, bool enabled) {
+  LOG_ERR("Socket::SetMulticastLoop is unimplemented\n");
   UNIMPLEMENTED();
   return false;
 }
 
 
 bool Socket::GetMulticastHops(intptr_t fd, intptr_t protocol, int* value) {
+  LOG_ERR("Socket::GetMulticastHops is unimplemented\n");
   UNIMPLEMENTED();
   return false;
 }
 
 
 bool Socket::SetMulticastHops(intptr_t fd, intptr_t protocol, int value) {
+  LOG_ERR("Socket::SetMulticastHops is unimplemented\n");
   UNIMPLEMENTED();
   return false;
 }
 
 
 bool Socket::GetBroadcast(intptr_t fd, bool* enabled) {
+  LOG_ERR("Socket::GetBroadcast is unimplemented\n");
   UNIMPLEMENTED();
   return false;
 }
 
 
 bool Socket::SetBroadcast(intptr_t fd, bool enabled) {
+  LOG_ERR("Socket::SetBroadcast is unimplemented\n");
   UNIMPLEMENTED();
   return false;
 }
 
 
-bool Socket::JoinMulticast(
-    intptr_t fd, const RawAddr& addr, const RawAddr&, int interfaceIndex) {
+bool Socket::JoinMulticast(intptr_t fd,
+                           const RawAddr& addr,
+                           const RawAddr&,
+                           int interfaceIndex) {
+  LOG_ERR("Socket::JoinMulticast is unimplemented\n");
   UNIMPLEMENTED();
   return false;
 }
 
 
-bool Socket::LeaveMulticast(
-    intptr_t fd, const RawAddr& addr, const RawAddr&, int interfaceIndex) {
+bool Socket::LeaveMulticast(intptr_t fd,
+                            const RawAddr& addr,
+                            const RawAddr&,
+                            int interfaceIndex) {
+  LOG_ERR("Socket::LeaveMulticast is unimplemented\n");
   UNIMPLEMENTED();
   return false;
 }
diff --git a/runtime/bin/socket_fuchsia.h b/runtime/bin/socket_fuchsia.h
index 82f8916..a19df5d 100644
--- a/runtime/bin/socket_fuchsia.h
+++ b/runtime/bin/socket_fuchsia.h
@@ -2,11 +2,15 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_SOCKET_FUCHSIA_H_
-#define BIN_SOCKET_FUCHSIA_H_
+#ifndef RUNTIME_BIN_SOCKET_FUCHSIA_H_
+#define RUNTIME_BIN_SOCKET_FUCHSIA_H_
 
-#if !defined(BIN_SOCKET_H_)
+#if !defined(RUNTIME_BIN_SOCKET_H_)
 #error Do not include socket_fuchsia.h directly. Use socket.h.
 #endif
 
-#endif  // BIN_SOCKET_FUCHSIA_H_
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <sys/socket.h>
+
+#endif  // RUNTIME_BIN_SOCKET_FUCHSIA_H_
diff --git a/runtime/bin/socket_linux.cc b/runtime/bin/socket_linux.cc
index fc0f1e4..af53878 100644
--- a/runtime/bin/socket_linux.cc
+++ b/runtime/bin/socket_linux.cc
@@ -10,15 +10,15 @@
 #include "bin/socket.h"
 #include "bin/socket_linux.h"
 
-#include <errno.h>  // NOLINT
-#include <ifaddrs.h>  // NOLINT
-#include <net/if.h>  // NOLINT
+#include <errno.h>        // NOLINT
+#include <ifaddrs.h>      // NOLINT
+#include <net/if.h>       // NOLINT
 #include <netinet/tcp.h>  // NOLINT
-#include <stdio.h>  // NOLINT
-#include <stdlib.h>  // NOLINT
-#include <string.h>  // NOLINT
-#include <sys/stat.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <stdio.h>        // NOLINT
+#include <stdlib.h>       // NOLINT
+#include <string.h>       // NOLINT
+#include <sys/stat.h>     // NOLINT
+#include <unistd.h>       // NOLINT
 
 #include "bin/fdutils.h"
 #include "bin/file.h"
@@ -30,19 +30,19 @@
 
 SocketAddress::SocketAddress(struct sockaddr* sa) {
   ASSERT(INET6_ADDRSTRLEN >= INET_ADDRSTRLEN);
-  if (!Socket::FormatNumericAddress(
-          *reinterpret_cast<RawAddr*>(sa), as_string_, INET6_ADDRSTRLEN)) {
+  if (!Socket::FormatNumericAddress(*reinterpret_cast<RawAddr*>(sa), as_string_,
+                                    INET6_ADDRSTRLEN)) {
     as_string_[0] = 0;
   }
   socklen_t salen = GetAddrLength(*reinterpret_cast<RawAddr*>(sa));
-  memmove(reinterpret_cast<void *>(&addr_), sa, salen);
+  memmove(reinterpret_cast<void*>(&addr_), sa, salen);
 }
 
 
 bool Socket::FormatNumericAddress(const RawAddr& addr, char* address, int len) {
   socklen_t salen = SocketAddress::GetAddrLength(addr);
-  return (NO_RETRY_EXPECTED(getnameinfo(
-      &addr.addr, salen, address, len, NULL, 0, NI_NUMERICHOST) == 0));
+  return (NO_RETRY_EXPECTED(getnameinfo(&addr.addr, salen, address, len, NULL,
+                                        0, NI_NUMERICHOST) == 0));
 }
 
 
@@ -69,7 +69,7 @@
   if ((result == 0) || (errno == EINPROGRESS)) {
     return fd;
   }
-  VOID_TEMP_FAILURE_RETRY(close(fd));
+  FDUtils::FDUtils::SaveErrorAndClose(fd);
   return -1;
 }
 
@@ -93,7 +93,7 @@
   intptr_t result = TEMP_FAILURE_RETRY(
       bind(fd, &source_addr.addr, SocketAddress::GetAddrLength(source_addr)));
   if ((result != 0) && (errno != EINPROGRESS)) {
-    VOID_TEMP_FAILURE_RETRY(close(fd));
+    FDUtils::SaveErrorAndClose(fd);
     return -1;
   }
 
@@ -103,7 +103,7 @@
 
 bool Socket::IsBindError(intptr_t error_number) {
   return error_number == EADDRINUSE || error_number == EADDRNOTAVAIL ||
-      error_number == EINVAL;
+         error_number == EINVAL;
 }
 
 
@@ -125,8 +125,10 @@
 }
 
 
-intptr_t Socket::RecvFrom(
-    intptr_t fd, void* buffer, intptr_t num_bytes, RawAddr* addr) {
+intptr_t Socket::RecvFrom(intptr_t fd,
+                          void* buffer,
+                          intptr_t num_bytes,
+                          RawAddr* addr) {
   ASSERT(fd >= 0);
   socklen_t addr_len = sizeof(addr->ss);
   ssize_t read_bytes = TEMP_FAILURE_RETRY(
@@ -153,12 +155,14 @@
 }
 
 
-intptr_t Socket::SendTo(
-    intptr_t fd, const void* buffer, intptr_t num_bytes, const RawAddr& addr) {
+intptr_t Socket::SendTo(intptr_t fd,
+                        const void* buffer,
+                        intptr_t num_bytes,
+                        const RawAddr& addr) {
   ASSERT(fd >= 0);
-  ssize_t written_bytes = TEMP_FAILURE_RETRY(
-      sendto(fd, buffer, num_bytes, 0,
-             &addr.addr, SocketAddress::GetAddrLength(addr)));
+  ssize_t written_bytes =
+      TEMP_FAILURE_RETRY(sendto(fd, buffer, num_bytes, 0, &addr.addr,
+                                SocketAddress::GetAddrLength(addr)));
   ASSERT(EAGAIN == EWOULDBLOCK);
   if ((written_bytes == -1) && (errno == EWOULDBLOCK)) {
     // If the would block we need to retry and therefore return 0 as
@@ -195,8 +199,8 @@
 void Socket::GetError(intptr_t fd, OSError* os_error) {
   int len = sizeof(errno);
   int err = 0;
-  VOID_NO_RETRY_EXPECTED(getsockopt(
-      fd, SOL_SOCKET, SO_ERROR, &err, reinterpret_cast<socklen_t*>(&len)));
+  VOID_NO_RETRY_EXPECTED(getsockopt(fd, SOL_SOCKET, SO_ERROR, &err,
+                                    reinterpret_cast<socklen_t*>(&len)));
   errno = err;
   os_error->SetCodeAndMessage(OSError::kSystem, errno);
 }
@@ -245,9 +249,8 @@
     status = NO_RETRY_EXPECTED(getaddrinfo(host, 0, &hints, &info));
     if (status != 0) {
       ASSERT(*os_error == NULL);
-      *os_error = new OSError(status,
-                              gai_strerror(status),
-                              OSError::kGetAddressInfo);
+      *os_error =
+          new OSError(status, gai_strerror(status), OSError::kGetAddressInfo);
       return NULL;
     }
   }
@@ -275,19 +278,13 @@
                            intptr_t host_len,
                            OSError** os_error) {
   ASSERT(host_len >= NI_MAXHOST);
-  int status = NO_RETRY_EXPECTED(getnameinfo(
-      &addr.addr,
-      SocketAddress::GetAddrLength(addr),
-      host,
-      host_len,
-      NULL,
-      0,
-      NI_NAMEREQD));
+  int status = NO_RETRY_EXPECTED(
+      getnameinfo(&addr.addr, SocketAddress::GetAddrLength(addr), host,
+                  host_len, NULL, 0, NI_NAMEREQD));
   if (status != 0) {
     ASSERT(*os_error == NULL);
-    *os_error = new OSError(status,
-                            gai_strerror(status),
-                            OSError::kGetAddressInfo);
+    *os_error =
+        new OSError(status, gai_strerror(status), OSError::kGetAddressInfo);
     return false;
   }
   return true;
@@ -300,8 +297,8 @@
     result = NO_RETRY_EXPECTED(inet_pton(AF_INET, address, &addr->in.sin_addr));
   } else {
     ASSERT(type == SocketAddress::TYPE_IPV6);
-    result = NO_RETRY_EXPECTED(
-        inet_pton(AF_INET6, address, &addr->in6.sin6_addr));
+    result =
+        NO_RETRY_EXPECTED(inet_pton(AF_INET6, address, &addr->in6.sin6_addr));
   }
   return (result == 1);
 }
@@ -311,8 +308,8 @@
   intptr_t fd;
 
   fd = NO_RETRY_EXPECTED(socket(addr.addr.sa_family,
-                         SOCK_DGRAM | SOCK_CLOEXEC | SOCK_NONBLOCK,
-                         IPPROTO_UDP));
+                                SOCK_DGRAM | SOCK_CLOEXEC | SOCK_NONBLOCK,
+                                IPPROTO_UDP));
   if (fd < 0) {
     return -1;
   }
@@ -325,7 +322,7 @@
 
   if (NO_RETRY_EXPECTED(
           bind(fd, &addr.addr, SocketAddress::GetAddrLength(addr))) < 0) {
-    VOID_TEMP_FAILURE_RETRY(close(fd));
+    FDUtils::SaveErrorAndClose(fd);
     return -1;
   }
   return fd;
@@ -339,8 +336,8 @@
   }
   int family = ifa->ifa_addr->sa_family;
   return ((lookup_family == family) ||
-         (((lookup_family == AF_UNSPEC) &&
-          ((family == AF_INET) || (family == AF_INET6)))));
+          (((lookup_family == AF_UNSPEC) &&
+            ((family == AF_INET) || (family == AF_INET6)))));
 }
 
 
@@ -357,9 +354,8 @@
   int status = NO_RETRY_EXPECTED(getifaddrs(&ifaddr));
   if (status != 0) {
     ASSERT(*os_error == NULL);
-    *os_error = new OSError(status,
-                            gai_strerror(status),
-                            OSError::kGetAddressInfo);
+    *os_error =
+        new OSError(status, gai_strerror(status), OSError::kGetAddressInfo);
     return NULL;
   }
 
@@ -378,8 +374,9 @@
   for (struct ifaddrs* ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
     if (ShouldIncludeIfaAddrs(ifa, lookup_family)) {
       char* ifa_name = DartUtils::ScopedCopyCString(ifa->ifa_name);
-      addresses->SetAt(i, new InterfaceSocketAddress(
-          ifa->ifa_addr, ifa_name, if_nametoindex(ifa->ifa_name)));
+      addresses->SetAt(
+          i, new InterfaceSocketAddress(ifa->ifa_addr, ifa_name,
+                                        if_nametoindex(ifa->ifa_name)));
       i++;
     }
   }
@@ -411,7 +408,7 @@
 
   if (NO_RETRY_EXPECTED(
           bind(fd, &addr.addr, SocketAddress::GetAddrLength(addr))) < 0) {
-    VOID_TEMP_FAILURE_RETRY(close(fd));
+    FDUtils::SaveErrorAndClose(fd);
     return -1;
   }
 
@@ -421,14 +418,12 @@
     // Don't close the socket until we have created a new socket, ensuring
     // that we do not get the bad port number again.
     intptr_t new_fd = CreateBindListen(addr, backlog, v6_only);
-    int err = errno;
-    VOID_TEMP_FAILURE_RETRY(close(fd));
-    errno = err;
+    FDUtils::SaveErrorAndClose(fd);
     return new_fd;
   }
 
   if (NO_RETRY_EXPECTED(listen(fd, backlog > 0 ? backlog : SOMAXCONN)) != 0) {
-    VOID_TEMP_FAILURE_RETRY(close(fd));
+    FDUtils::SaveErrorAndClose(fd);
     return -1;
   }
 
@@ -446,9 +441,9 @@
   // On Linux a number of protocol errors should be treated as EAGAIN.
   // These are the ones for TCP/IP.
   return (error == EAGAIN) || (error == ENETDOWN) || (error == EPROTO) ||
-      (error == ENOPROTOOPT) || (error == EHOSTDOWN) || (error == ENONET) ||
-      (error == EHOSTUNREACH) || (error == EOPNOTSUPP) ||
-      (error == ENETUNREACH);
+         (error == ENOPROTOOPT) || (error == EHOSTDOWN) || (error == ENONET) ||
+         (error == EHOSTUNREACH) || (error == EOPNOTSUPP) ||
+         (error == ENETUNREACH);
 }
 
 
@@ -466,8 +461,14 @@
       socket = kTemporaryFailure;
     }
   } else {
-    FDUtils::SetCloseOnExec(socket);
-    FDUtils::SetNonBlocking(socket);
+    if (!FDUtils::SetCloseOnExec(socket)) {
+      FDUtils::SaveErrorAndClose(socket);
+      return -1;
+    }
+    if (!FDUtils::SetNonBlocking(socket)) {
+      FDUtils::SaveErrorAndClose(socket);
+      return -1;
+    }
   }
   return socket;
 }
@@ -482,8 +483,8 @@
 bool Socket::GetNoDelay(intptr_t fd, bool* enabled) {
   int on;
   socklen_t len = sizeof(on);
-  int err = NO_RETRY_EXPECTED(getsockopt(
-      fd, IPPROTO_TCP, TCP_NODELAY, reinterpret_cast<void *>(&on), &len));
+  int err = NO_RETRY_EXPECTED(getsockopt(fd, IPPROTO_TCP, TCP_NODELAY,
+                                         reinterpret_cast<void*>(&on), &len));
   if (err == 0) {
     *enabled = (on == 1);
   }
@@ -493,11 +494,9 @@
 
 bool Socket::SetNoDelay(intptr_t fd, bool enabled) {
   int on = enabled ? 1 : 0;
-  return NO_RETRY_EXPECTED(setsockopt(fd,
-                           IPPROTO_TCP,
-                           TCP_NODELAY,
-                           reinterpret_cast<char *>(&on),
-                           sizeof(on))) == 0;
+  return NO_RETRY_EXPECTED(setsockopt(fd, IPPROTO_TCP, TCP_NODELAY,
+                                      reinterpret_cast<char*>(&on),
+                                      sizeof(on))) == 0;
 }
 
 
@@ -505,10 +504,10 @@
   uint8_t on;
   socklen_t len = sizeof(on);
   int level = protocol == SocketAddress::TYPE_IPV4 ? IPPROTO_IP : IPPROTO_IPV6;
-  int optname = protocol == SocketAddress::TYPE_IPV4
-      ? IP_MULTICAST_LOOP : IPV6_MULTICAST_LOOP;
-  if (NO_RETRY_EXPECTED(getsockopt(
-        fd, level, optname, reinterpret_cast<char *>(&on), &len)) == 0) {
+  int optname = protocol == SocketAddress::TYPE_IPV4 ? IP_MULTICAST_LOOP
+                                                     : IPV6_MULTICAST_LOOP;
+  if (NO_RETRY_EXPECTED(getsockopt(fd, level, optname,
+                                   reinterpret_cast<char*>(&on), &len)) == 0) {
     *enabled = (on == 1);
     return true;
   }
@@ -519,10 +518,11 @@
 bool Socket::SetMulticastLoop(intptr_t fd, intptr_t protocol, bool enabled) {
   int on = enabled ? 1 : 0;
   int level = protocol == SocketAddress::TYPE_IPV4 ? IPPROTO_IP : IPPROTO_IPV6;
-  int optname = protocol == SocketAddress::TYPE_IPV4
-      ? IP_MULTICAST_LOOP : IPV6_MULTICAST_LOOP;
+  int optname = protocol == SocketAddress::TYPE_IPV4 ? IP_MULTICAST_LOOP
+                                                     : IPV6_MULTICAST_LOOP;
   return NO_RETRY_EXPECTED(setsockopt(
-      fd, level, optname, reinterpret_cast<char *>(&on), sizeof(on))) == 0;
+             fd, level, optname, reinterpret_cast<char*>(&on), sizeof(on))) ==
+         0;
 }
 
 
@@ -530,10 +530,10 @@
   uint8_t v;
   socklen_t len = sizeof(v);
   int level = protocol == SocketAddress::TYPE_IPV4 ? IPPROTO_IP : IPPROTO_IPV6;
-  int optname = protocol == SocketAddress::TYPE_IPV4
-      ? IP_MULTICAST_TTL : IPV6_MULTICAST_HOPS;
-  if (NO_RETRY_EXPECTED(getsockopt(
-          fd, level, optname, reinterpret_cast<char *>(&v), &len)) == 0) {
+  int optname = protocol == SocketAddress::TYPE_IPV4 ? IP_MULTICAST_TTL
+                                                     : IPV6_MULTICAST_HOPS;
+  if (NO_RETRY_EXPECTED(getsockopt(fd, level, optname,
+                                   reinterpret_cast<char*>(&v), &len)) == 0) {
     *value = v;
     return true;
   }
@@ -544,18 +544,18 @@
 bool Socket::SetMulticastHops(intptr_t fd, intptr_t protocol, int value) {
   int v = value;
   int level = protocol == SocketAddress::TYPE_IPV4 ? IPPROTO_IP : IPPROTO_IPV6;
-  int optname = protocol == SocketAddress::TYPE_IPV4
-      ? IP_MULTICAST_TTL : IPV6_MULTICAST_HOPS;
+  int optname = protocol == SocketAddress::TYPE_IPV4 ? IP_MULTICAST_TTL
+                                                     : IPV6_MULTICAST_HOPS;
   return NO_RETRY_EXPECTED(setsockopt(
-      fd, level, optname, reinterpret_cast<char *>(&v), sizeof(v))) == 0;
+             fd, level, optname, reinterpret_cast<char*>(&v), sizeof(v))) == 0;
 }
 
 
 bool Socket::GetBroadcast(intptr_t fd, bool* enabled) {
   int on;
   socklen_t len = sizeof(on);
-  int err = NO_RETRY_EXPECTED(getsockopt(
-      fd, SOL_SOCKET, SO_BROADCAST, reinterpret_cast<char *>(&on), &len));
+  int err = NO_RETRY_EXPECTED(getsockopt(fd, SOL_SOCKET, SO_BROADCAST,
+                                         reinterpret_cast<char*>(&on), &len));
   if (err == 0) {
     *enabled = (on == 1);
   }
@@ -565,33 +565,35 @@
 
 bool Socket::SetBroadcast(intptr_t fd, bool enabled) {
   int on = enabled ? 1 : 0;
-  return NO_RETRY_EXPECTED(setsockopt(fd,
-                           SOL_SOCKET,
-                           SO_BROADCAST,
-                           reinterpret_cast<char *>(&on),
-                           sizeof(on))) == 0;
+  return NO_RETRY_EXPECTED(setsockopt(fd, SOL_SOCKET, SO_BROADCAST,
+                                      reinterpret_cast<char*>(&on),
+                                      sizeof(on))) == 0;
 }
 
 
-bool Socket::JoinMulticast(
-    intptr_t fd, const RawAddr& addr, const RawAddr&, int interfaceIndex) {
+bool Socket::JoinMulticast(intptr_t fd,
+                           const RawAddr& addr,
+                           const RawAddr&,
+                           int interfaceIndex) {
   int proto = addr.addr.sa_family == AF_INET ? IPPROTO_IP : IPPROTO_IPV6;
   struct group_req mreq;
   mreq.gr_interface = interfaceIndex;
   memmove(&mreq.gr_group, &addr.ss, SocketAddress::GetAddrLength(addr));
   return NO_RETRY_EXPECTED(
-      setsockopt(fd, proto, MCAST_JOIN_GROUP, &mreq, sizeof(mreq))) == 0;
+             setsockopt(fd, proto, MCAST_JOIN_GROUP, &mreq, sizeof(mreq))) == 0;
 }
 
 
-bool Socket::LeaveMulticast(
-    intptr_t fd, const RawAddr& addr, const RawAddr&, int interfaceIndex) {
+bool Socket::LeaveMulticast(intptr_t fd,
+                            const RawAddr& addr,
+                            const RawAddr&,
+                            int interfaceIndex) {
   int proto = addr.addr.sa_family == AF_INET ? IPPROTO_IP : IPPROTO_IPV6;
   struct group_req mreq;
   mreq.gr_interface = interfaceIndex;
   memmove(&mreq.gr_group, &addr.ss, SocketAddress::GetAddrLength(addr));
-  return NO_RETRY_EXPECTED(
-      setsockopt(fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0;
+  return NO_RETRY_EXPECTED(setsockopt(fd, proto, MCAST_LEAVE_GROUP, &mreq,
+                                      sizeof(mreq))) == 0;
 }
 
 }  // namespace bin
diff --git a/runtime/bin/socket_linux.h b/runtime/bin/socket_linux.h
index 5d073c4..e153f88 100644
--- a/runtime/bin/socket_linux.h
+++ b/runtime/bin/socket_linux.h
@@ -2,10 +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.
 
-#ifndef BIN_SOCKET_LINUX_H_
-#define BIN_SOCKET_LINUX_H_
+#ifndef RUNTIME_BIN_SOCKET_LINUX_H_
+#define RUNTIME_BIN_SOCKET_LINUX_H_
 
-#if !defined(BIN_SOCKET_H_)
+#if !defined(RUNTIME_BIN_SOCKET_H_)
 #error Do not include socket_linux.h directly. Use socket.h.
 #endif
 
@@ -13,4 +13,4 @@
 #include <netdb.h>
 #include <sys/socket.h>
 
-#endif  // BIN_SOCKET_LINUX_H_
+#endif  // RUNTIME_BIN_SOCKET_LINUX_H_
diff --git a/runtime/bin/socket_macos.cc b/runtime/bin/socket_macos.cc
index e54cc59..c1f48cc 100644
--- a/runtime/bin/socket_macos.cc
+++ b/runtime/bin/socket_macos.cc
@@ -10,15 +10,15 @@
 #include "bin/socket.h"
 #include "bin/socket_macos.h"
 
-#include <errno.h>  // NOLINT
-#include <ifaddrs.h>  // NOLINT
-#include <net/if.h>  // NOLINT
+#include <errno.h>        // NOLINT
+#include <ifaddrs.h>      // NOLINT
+#include <net/if.h>       // NOLINT
 #include <netinet/tcp.h>  // NOLINT
-#include <stdio.h>  // NOLINT
-#include <stdlib.h>  // NOLINT
-#include <string.h>  // NOLINT
-#include <sys/stat.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <stdio.h>        // NOLINT
+#include <stdlib.h>       // NOLINT
+#include <string.h>       // NOLINT
+#include <sys/stat.h>     // NOLINT
+#include <unistd.h>       // NOLINT
 
 #include "bin/fdutils.h"
 #include "bin/file.h"
@@ -29,19 +29,19 @@
 
 SocketAddress::SocketAddress(struct sockaddr* sa) {
   ASSERT(INET6_ADDRSTRLEN >= INET_ADDRSTRLEN);
-  if (!Socket::FormatNumericAddress(
-          *reinterpret_cast<RawAddr*>(sa), as_string_, INET6_ADDRSTRLEN)) {
+  if (!Socket::FormatNumericAddress(*reinterpret_cast<RawAddr*>(sa), as_string_,
+                                    INET6_ADDRSTRLEN)) {
     as_string_[0] = 0;
   }
   socklen_t salen = GetAddrLength(*reinterpret_cast<RawAddr*>(sa));
-  memmove(reinterpret_cast<void *>(&addr_), sa, salen);
+  memmove(reinterpret_cast<void*>(&addr_), sa, salen);
 }
 
 
 bool Socket::FormatNumericAddress(const RawAddr& addr, char* address, int len) {
   socklen_t salen = SocketAddress::GetAddrLength(addr);
-  return (NO_RETRY_EXPECTED(getnameinfo(
-      &addr.addr, salen, address, len, NULL, 0, NI_NUMERICHOST)) == 0);
+  return (NO_RETRY_EXPECTED(getnameinfo(&addr.addr, salen, address, len, NULL,
+                                        0, NI_NUMERICHOST)) == 0);
 }
 
 
@@ -57,8 +57,14 @@
   if (fd < 0) {
     return -1;
   }
-  FDUtils::SetCloseOnExec(fd);
-  FDUtils::SetNonBlocking(fd);
+  if (!FDUtils::SetCloseOnExec(fd)) {
+    FDUtils::SaveErrorAndClose(fd);
+    return -1;
+  }
+  if (!FDUtils::SetNonBlocking(fd)) {
+    FDUtils::SaveErrorAndClose(fd);
+    return -1;
+  }
   return fd;
 }
 
@@ -69,7 +75,7 @@
   if ((result == 0) || (errno == EINPROGRESS)) {
     return fd;
   }
-  VOID_TEMP_FAILURE_RETRY(close(fd));
+  FDUtils::SaveErrorAndClose(fd);
   return -1;
 }
 
@@ -94,7 +100,7 @@
   intptr_t result = TEMP_FAILURE_RETRY(
       bind(fd, &source_addr.addr, SocketAddress::GetAddrLength(source_addr)));
   if ((result != 0) && (errno != EINPROGRESS)) {
-    VOID_TEMP_FAILURE_RETRY(close(fd));
+    FDUtils::SaveErrorAndClose(fd);
     return -1;
   }
 
@@ -104,7 +110,7 @@
 
 bool Socket::IsBindError(intptr_t error_number) {
   return error_number == EADDRINUSE || error_number == EADDRNOTAVAIL ||
-      error_number == EINVAL;
+         error_number == EINVAL;
 }
 
 
@@ -126,8 +132,10 @@
 }
 
 
-intptr_t Socket::RecvFrom(
-    intptr_t fd, void* buffer, intptr_t num_bytes, RawAddr* addr) {
+intptr_t Socket::RecvFrom(intptr_t fd,
+                          void* buffer,
+                          intptr_t num_bytes,
+                          RawAddr* addr) {
   ASSERT(fd >= 0);
   socklen_t addr_len = sizeof(addr->ss);
   ssize_t read_bytes = TEMP_FAILURE_RETRY(
@@ -154,12 +162,14 @@
 }
 
 
-intptr_t Socket::SendTo(
-    intptr_t fd, const void* buffer, intptr_t num_bytes, const RawAddr& addr) {
+intptr_t Socket::SendTo(intptr_t fd,
+                        const void* buffer,
+                        intptr_t num_bytes,
+                        const RawAddr& addr) {
   ASSERT(fd >= 0);
-  ssize_t written_bytes = TEMP_FAILURE_RETRY(
-      sendto(fd, buffer, num_bytes, 0,
-             &addr.addr, SocketAddress::GetAddrLength(addr)));
+  ssize_t written_bytes =
+      TEMP_FAILURE_RETRY(sendto(fd, buffer, num_bytes, 0, &addr.addr,
+                                SocketAddress::GetAddrLength(addr)));
   ASSERT(EAGAIN == EWOULDBLOCK);
   if ((written_bytes == -1) && (errno == EWOULDBLOCK)) {
     // If the would block we need to retry and therefore return 0 as
@@ -195,10 +205,7 @@
 
 void Socket::GetError(intptr_t fd, OSError* os_error) {
   int len = sizeof(errno);
-  getsockopt(fd,
-             SOL_SOCKET,
-             SO_ERROR,
-             &errno,
+  getsockopt(fd, SOL_SOCKET, SO_ERROR, &errno,
              reinterpret_cast<socklen_t*>(&len));
   os_error->SetCodeAndMessage(OSError::kSystem, errno);
 }
@@ -242,9 +249,8 @@
   int status = getaddrinfo(host, 0, &hints, &info);
   if (status != 0) {
     ASSERT(*os_error == NULL);
-    *os_error = new OSError(status,
-                            gai_strerror(status),
-                            OSError::kGetAddressInfo);
+    *os_error =
+        new OSError(status, gai_strerror(status), OSError::kGetAddressInfo);
     return NULL;
   }
   intptr_t count = 0;
@@ -271,19 +277,13 @@
                            intptr_t host_len,
                            OSError** os_error) {
   ASSERT(host_len >= NI_MAXHOST);
-  int status = NO_RETRY_EXPECTED(getnameinfo(
-      &addr.addr,
-      SocketAddress::GetAddrLength(addr),
-      host,
-      host_len,
-      NULL,
-      0,
-      NI_NAMEREQD));
+  int status = NO_RETRY_EXPECTED(
+      getnameinfo(&addr.addr, SocketAddress::GetAddrLength(addr), host,
+                  host_len, NULL, 0, NI_NAMEREQD));
   if (status != 0) {
     ASSERT(*os_error == NULL);
-    *os_error = new OSError(status,
-                            gai_strerror(status),
-                            OSError::kGetAddressInfo);
+    *os_error =
+        new OSError(status, gai_strerror(status), OSError::kGetAddressInfo);
     return false;
   }
   return true;
@@ -310,7 +310,10 @@
     return -1;
   }
 
-  FDUtils::SetCloseOnExec(fd);
+  if (!FDUtils::SetCloseOnExec(fd)) {
+    FDUtils::SaveErrorAndClose(fd);
+    return -1;
+  }
 
   if (reuseAddress) {
     int optval = 1;
@@ -320,11 +323,14 @@
 
   if (NO_RETRY_EXPECTED(
           bind(fd, &addr.addr, SocketAddress::GetAddrLength(addr))) < 0) {
-    VOID_TEMP_FAILURE_RETRY(close(fd));
+    FDUtils::SaveErrorAndClose(fd);
     return -1;
   }
 
-  FDUtils::SetNonBlocking(fd);
+  if (!FDUtils::SetNonBlocking(fd)) {
+    FDUtils::SaveErrorAndClose(fd);
+    return -1;
+  }
   return fd;
 }
 
@@ -336,8 +342,8 @@
   }
   int family = ifa->ifa_addr->sa_family;
   return ((lookup_family == family) ||
-         ((lookup_family == AF_UNSPEC) &&
-          ((family == AF_INET) || (family == AF_INET6))));
+          ((lookup_family == AF_UNSPEC) &&
+           ((family == AF_INET) || (family == AF_INET6))));
 }
 
 
@@ -354,9 +360,8 @@
   int status = getifaddrs(&ifaddr);
   if (status != 0) {
     ASSERT(*os_error == NULL);
-    *os_error = new OSError(status,
-                            gai_strerror(status),
-                            OSError::kGetAddressInfo);
+    *os_error =
+        new OSError(status, gai_strerror(status), OSError::kGetAddressInfo);
     return NULL;
   }
 
@@ -364,7 +369,9 @@
 
   intptr_t count = 0;
   for (struct ifaddrs* ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
-    if (ShouldIncludeIfaAddrs(ifa, lookup_family)) count++;
+    if (ShouldIncludeIfaAddrs(ifa, lookup_family)) {
+      count++;
+    }
   }
 
   AddressList<InterfaceSocketAddress>* addresses =
@@ -373,8 +380,9 @@
   for (struct ifaddrs* ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
     if (ShouldIncludeIfaAddrs(ifa, lookup_family)) {
       char* ifa_name = DartUtils::ScopedCopyCString(ifa->ifa_name);
-      addresses->SetAt(i, new InterfaceSocketAddress(
-          ifa->ifa_addr, ifa_name, if_nametoindex(ifa->ifa_name)));
+      addresses->SetAt(
+          i, new InterfaceSocketAddress(ifa->ifa_addr, ifa_name,
+                                        if_nametoindex(ifa->ifa_name)));
       i++;
     }
   }
@@ -393,7 +401,10 @@
     return -1;
   }
 
-  FDUtils::SetCloseOnExec(fd);
+  if (!FDUtils::SetCloseOnExec(fd)) {
+    FDUtils::SaveErrorAndClose(fd);
+    return -1;
+  }
 
   int optval = 1;
   VOID_NO_RETRY_EXPECTED(
@@ -407,7 +418,7 @@
 
   if (NO_RETRY_EXPECTED(
           bind(fd, &addr.addr, SocketAddress::GetAddrLength(addr))) < 0) {
-    VOID_TEMP_FAILURE_RETRY(close(fd));
+    FDUtils::SaveErrorAndClose(fd);
     return -1;
   }
 
@@ -417,18 +428,19 @@
     // Don't close the socket until we have created a new socket, ensuring
     // that we do not get the bad port number again.
     intptr_t new_fd = CreateBindListen(addr, backlog, v6_only);
-    int err = errno;
-    VOID_TEMP_FAILURE_RETRY(close(fd));
-    errno = err;
+    FDUtils::SaveErrorAndClose(fd);
     return new_fd;
   }
 
   if (NO_RETRY_EXPECTED(listen(fd, backlog > 0 ? backlog : SOMAXCONN)) != 0) {
-    VOID_TEMP_FAILURE_RETRY(close(fd));
+    FDUtils::SaveErrorAndClose(fd);
     return -1;
   }
 
-  FDUtils::SetNonBlocking(fd);
+  if (!FDUtils::SetNonBlocking(fd)) {
+    FDUtils::SaveErrorAndClose(fd);
+    return -1;
+  }
   return fd;
 }
 
@@ -453,8 +465,14 @@
       socket = kTemporaryFailure;
     }
   } else {
-    FDUtils::SetCloseOnExec(socket);
-    FDUtils::SetNonBlocking(socket);
+    if (!FDUtils::SetCloseOnExec(socket)) {
+      FDUtils::SaveErrorAndClose(socket);
+      return -1;
+    }
+    if (!FDUtils::SetNonBlocking(socket)) {
+      FDUtils::SaveErrorAndClose(socket);
+      return -1;
+    }
   }
   return socket;
 }
@@ -469,11 +487,8 @@
 bool Socket::GetNoDelay(intptr_t fd, bool* enabled) {
   int on;
   socklen_t len = sizeof(on);
-  int err = NO_RETRY_EXPECTED(getsockopt(fd,
-                                         IPPROTO_TCP,
-                                         TCP_NODELAY,
-                                         reinterpret_cast<void *>(&on),
-                                         &len));
+  int err = NO_RETRY_EXPECTED(getsockopt(fd, IPPROTO_TCP, TCP_NODELAY,
+                                         reinterpret_cast<void*>(&on), &len));
   if (err == 0) {
     *enabled = (on == 1);
   }
@@ -483,10 +498,8 @@
 
 bool Socket::SetNoDelay(intptr_t fd, bool enabled) {
   int on = enabled ? 1 : 0;
-  return NO_RETRY_EXPECTED(setsockopt(fd,
-                                      IPPROTO_TCP,
-                                      TCP_NODELAY,
-                                      reinterpret_cast<char *>(&on),
+  return NO_RETRY_EXPECTED(setsockopt(fd, IPPROTO_TCP, TCP_NODELAY,
+                                      reinterpret_cast<char*>(&on),
                                       sizeof(on))) == 0;
 }
 
@@ -495,13 +508,10 @@
   uint8_t on;
   socklen_t len = sizeof(on);
   int level = protocol == SocketAddress::TYPE_IPV4 ? IPPROTO_IP : IPPROTO_IPV6;
-  int optname = protocol == SocketAddress::TYPE_IPV4
-      ? IP_MULTICAST_LOOP : IPV6_MULTICAST_LOOP;
-  if (NO_RETRY_EXPECTED(getsockopt(fd,
-                                   level,
-                                   optname,
-                                   reinterpret_cast<char *>(&on),
-                                   &len)) == 0) {
+  int optname = protocol == SocketAddress::TYPE_IPV4 ? IP_MULTICAST_LOOP
+                                                     : IPV6_MULTICAST_LOOP;
+  if (NO_RETRY_EXPECTED(getsockopt(fd, level, optname,
+                                   reinterpret_cast<char*>(&on), &len)) == 0) {
     *enabled = (on == 1);
     return true;
   }
@@ -512,13 +522,11 @@
 bool Socket::SetMulticastLoop(intptr_t fd, intptr_t protocol, bool enabled) {
   u_int on = enabled ? 1 : 0;
   int level = protocol == SocketAddress::TYPE_IPV4 ? IPPROTO_IP : IPPROTO_IPV6;
-  int optname = protocol == SocketAddress::TYPE_IPV4
-      ? IP_MULTICAST_LOOP : IPV6_MULTICAST_LOOP;
-  return NO_RETRY_EXPECTED(setsockopt(fd,
-                                      level,
-                                      optname,
-                                      reinterpret_cast<char *>(&on),
-                                      sizeof(on))) == 0;
+  int optname = protocol == SocketAddress::TYPE_IPV4 ? IP_MULTICAST_LOOP
+                                                     : IPV6_MULTICAST_LOOP;
+  return NO_RETRY_EXPECTED(setsockopt(
+             fd, level, optname, reinterpret_cast<char*>(&on), sizeof(on))) ==
+         0;
 }
 
 
@@ -526,13 +534,10 @@
   uint8_t v;
   socklen_t len = sizeof(v);
   int level = protocol == SocketAddress::TYPE_IPV4 ? IPPROTO_IP : IPPROTO_IPV6;
-  int optname = protocol == SocketAddress::TYPE_IPV4
-      ? IP_MULTICAST_TTL : IPV6_MULTICAST_HOPS;
-  if (NO_RETRY_EXPECTED(getsockopt(fd,
-                                   level,
-                                   optname,
-                                   reinterpret_cast<char *>(&v),
-                                   &len)) == 0) {
+  int optname = protocol == SocketAddress::TYPE_IPV4 ? IP_MULTICAST_TTL
+                                                     : IPV6_MULTICAST_HOPS;
+  if (NO_RETRY_EXPECTED(getsockopt(fd, level, optname,
+                                   reinterpret_cast<char*>(&v), &len)) == 0) {
     *value = v;
     return true;
   }
@@ -543,24 +548,18 @@
 bool Socket::SetMulticastHops(intptr_t fd, intptr_t protocol, int value) {
   int v = value;
   int level = protocol == SocketAddress::TYPE_IPV4 ? IPPROTO_IP : IPPROTO_IPV6;
-  int optname = protocol == SocketAddress::TYPE_IPV4
-      ? IP_MULTICAST_TTL : IPV6_MULTICAST_HOPS;
-  return NO_RETRY_EXPECTED(setsockopt(fd,
-                                      level,
-                                      optname,
-                                      reinterpret_cast<char *>(&v),
-                                      sizeof(v))) == 0;
+  int optname = protocol == SocketAddress::TYPE_IPV4 ? IP_MULTICAST_TTL
+                                                     : IPV6_MULTICAST_HOPS;
+  return NO_RETRY_EXPECTED(setsockopt(
+             fd, level, optname, reinterpret_cast<char*>(&v), sizeof(v))) == 0;
 }
 
 
 bool Socket::GetBroadcast(intptr_t fd, bool* enabled) {
   int on;
   socklen_t len = sizeof(on);
-  int err = NO_RETRY_EXPECTED(getsockopt(fd,
-                                         SOL_SOCKET,
-                                         SO_BROADCAST,
-                                         reinterpret_cast<char *>(&on),
-                                         &len));
+  int err = NO_RETRY_EXPECTED(getsockopt(fd, SOL_SOCKET, SO_BROADCAST,
+                                         reinterpret_cast<char*>(&on), &len));
   if (err == 0) {
     *enabled = (on == 1);
   }
@@ -570,10 +569,8 @@
 
 bool Socket::SetBroadcast(intptr_t fd, bool enabled) {
   int on = enabled ? 1 : 0;
-  return NO_RETRY_EXPECTED(setsockopt(fd,
-                                      SOL_SOCKET,
-                                      SO_BROADCAST,
-                                      reinterpret_cast<char *>(&on),
+  return NO_RETRY_EXPECTED(setsockopt(fd, SOL_SOCKET, SO_BROADCAST,
+                                      reinterpret_cast<char*>(&on),
                                       sizeof(on))) == 0;
 }
 
@@ -586,32 +583,29 @@
   if (addr.addr.sa_family == AF_INET) {
     ASSERT(interface.addr.sa_family == AF_INET);
     struct ip_mreq mreq;
-    memmove(&mreq.imr_multiaddr,
-            &addr.in.sin_addr,
+    memmove(&mreq.imr_multiaddr, &addr.in.sin_addr,
             SocketAddress::GetInAddrLength(addr));
-    memmove(&mreq.imr_interface,
-            &interface.in.sin_addr,
+    memmove(&mreq.imr_interface, &interface.in.sin_addr,
             SocketAddress::GetInAddrLength(interface));
     if (join) {
-      return NO_RETRY_EXPECTED(setsockopt(
-          fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq))) == 0;
+      return NO_RETRY_EXPECTED(setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP,
+                                          &mreq, sizeof(mreq))) == 0;
     } else {
-      return NO_RETRY_EXPECTED(setsockopt(
-          fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, &mreq, sizeof(mreq))) == 0;
+      return NO_RETRY_EXPECTED(setsockopt(fd, IPPROTO_IP, IP_DROP_MEMBERSHIP,
+                                          &mreq, sizeof(mreq))) == 0;
     }
   } else {
     ASSERT(addr.addr.sa_family == AF_INET6);
     struct ipv6_mreq mreq;
-    memmove(&mreq.ipv6mr_multiaddr,
-            &addr.in6.sin6_addr,
+    memmove(&mreq.ipv6mr_multiaddr, &addr.in6.sin6_addr,
             SocketAddress::GetInAddrLength(addr));
     mreq.ipv6mr_interface = interfaceIndex;
     if (join) {
-      return NO_RETRY_EXPECTED(setsockopt(
-          fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq))) == 0;
+      return NO_RETRY_EXPECTED(setsockopt(fd, IPPROTO_IPV6, IPV6_JOIN_GROUP,
+                                          &mreq, sizeof(mreq))) == 0;
     } else {
-      return NO_RETRY_EXPECTED(setsockopt(
-          fd, IPPROTO_IPV6, IPV6_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0;
+      return NO_RETRY_EXPECTED(setsockopt(fd, IPPROTO_IPV6, IPV6_LEAVE_GROUP,
+                                          &mreq, sizeof(mreq))) == 0;
     }
   }
 }
diff --git a/runtime/bin/socket_macos.h b/runtime/bin/socket_macos.h
index dce6d97..b3ab619 100644
--- a/runtime/bin/socket_macos.h
+++ b/runtime/bin/socket_macos.h
@@ -2,10 +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.
 
-#ifndef BIN_SOCKET_MACOS_H_
-#define BIN_SOCKET_MACOS_H_
+#ifndef RUNTIME_BIN_SOCKET_MACOS_H_
+#define RUNTIME_BIN_SOCKET_MACOS_H_
 
-#if !defined(BIN_SOCKET_H_)
+#if !defined(RUNTIME_BIN_SOCKET_H_)
 #error Do not include socket_macos.h directly. Use socket.h.
 #endif
 
@@ -13,4 +13,4 @@
 #include <netdb.h>
 #include <sys/socket.h>
 
-#endif  // BIN_SOCKET_MACOS_H_
+#endif  // RUNTIME_BIN_SOCKET_MACOS_H_
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
index 4850827..cd02b29 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -449,7 +449,12 @@
               connectNext();
             } else {
               // Query the local port, for error messages.
-              socket.port;
+              try {
+                socket.port;
+              } catch (e) {
+                error = createError(e, "Connection failed", address, port);
+                connectNext();
+              }
               // Set up timer for when we should retry the next address
               // (if any).
               var duration = address.isLoopback ?
diff --git a/runtime/bin/socket_unsupported.cc b/runtime/bin/socket_unsupported.cc
index d3ecf1e..39b2f57 100644
--- a/runtime/bin/socket_unsupported.cc
+++ b/runtime/bin/socket_unsupported.cc
@@ -16,146 +16,146 @@
 bool short_socket_write = false;
 
 void FUNCTION_NAME(InternetAddress_Parse)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(NetworkInterface_ListSupported)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Socket_CreateConnect)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Socket_CreateBindConnect)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Socket_IsBindError)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Socket_CreateBindDatagram)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Socket_Available)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Socket_Read)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Socket_RecvFrom)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Socket_WriteList)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Socket_SendTo)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Socket_GetPort)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Socket_GetRemotePeer)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Socket_GetError)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Socket_GetType)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Socket_GetStdioHandle)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Socket_GetSocketId)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Socket_SetSocketId)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(ServerSocket_CreateBindListen)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(ServerSocket_Accept)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Socket_GetOption)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Socket_SetOption)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Socket_JoinMulticast)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Socket_LeaveMulticast)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Sockets unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Sockets unsupported on this platform"));
 }
 
 }  // namespace bin
diff --git a/runtime/bin/socket_win.cc b/runtime/bin/socket_win.cc
index f76f764..55cc107 100644
--- a/runtime/bin/socket_win.cc
+++ b/runtime/bin/socket_win.cc
@@ -33,8 +33,7 @@
   if (err != 0) {
     as_string_[0] = 0;
   }
-  memmove(reinterpret_cast<void *>(&addr_),
-          sockaddr,
+  memmove(reinterpret_cast<void*>(&addr_), sockaddr,
           SocketAddress::GetAddrLength(*raw));
 }
 
@@ -43,11 +42,7 @@
   socklen_t salen = SocketAddress::GetAddrLength(addr);
   DWORD l = len;
   RawAddr& raw = const_cast<RawAddr&>(addr);
-  return WSAAddressToStringA(&raw.addr,
-                             salen,
-                             NULL,
-                             address,
-                             &l) != 0;
+  return WSAAddressToStringA(&raw.addr, salen, NULL, address, &l) != 0;
 }
 
 
@@ -83,8 +78,10 @@
 }
 
 
-intptr_t Socket::RecvFrom(
-    intptr_t fd, void* buffer, intptr_t num_bytes, RawAddr* addr) {
+intptr_t Socket::RecvFrom(intptr_t fd,
+                          void* buffer,
+                          intptr_t num_bytes,
+                          RawAddr* addr) {
   Handle* handle = reinterpret_cast<Handle*>(fd);
   socklen_t addr_len = sizeof(addr->ss);
   return handle->RecvFrom(buffer, num_bytes, &addr->addr, addr_len);
@@ -97,12 +94,14 @@
 }
 
 
-intptr_t Socket::SendTo(
-    intptr_t fd, const void* buffer, intptr_t num_bytes, const RawAddr& addr) {
+intptr_t Socket::SendTo(intptr_t fd,
+                        const void* buffer,
+                        intptr_t num_bytes,
+                        const RawAddr& addr) {
   Handle* handle = reinterpret_cast<Handle*>(fd);
   RawAddr& raw = const_cast<RawAddr&>(addr);
-  return handle->SendTo(
-    buffer, num_bytes, &raw.addr, SocketAddress::GetAddrLength(addr));
+  return handle->SendTo(buffer, num_bytes, &raw.addr,
+                        SocketAddress::GetAddrLength(addr));
 }
 
 
@@ -111,7 +110,7 @@
   SocketHandle* socket_handle = reinterpret_cast<SocketHandle*>(fd);
   RawAddr raw;
   socklen_t size = sizeof(raw);
-  if (getsockname(socket_handle->socket(),  &raw.addr, &size) == SOCKET_ERROR) {
+  if (getsockname(socket_handle->socket(), &raw.addr, &size) == SOCKET_ERROR) {
     return 0;
   }
   return SocketAddress::GetAddrPort(raw);
@@ -143,10 +142,7 @@
   linger l;
   l.l_onoff = 1;
   l.l_linger = 10;
-  int status = setsockopt(s,
-                          SOL_SOCKET,
-                          SO_LINGER,
-                          reinterpret_cast<char*>(&l),
+  int status = setsockopt(s, SOL_SOCKET, SO_LINGER, reinterpret_cast<char*>(&l),
                           sizeof(l));
   if (status != NO_ERROR) {
     FATAL("Failed setting SO_LINGER on socket");
@@ -157,14 +153,15 @@
 }
 
 
-static intptr_t Connect(
-    intptr_t fd, const RawAddr& addr, const RawAddr& bind_addr) {
+static intptr_t Connect(intptr_t fd,
+                        const RawAddr& addr,
+                        const RawAddr& bind_addr) {
   ASSERT(reinterpret_cast<Handle*>(fd)->is_client_socket());
   ClientSocket* handle = reinterpret_cast<ClientSocket*>(fd);
   SOCKET s = handle->socket();
 
-  int status = bind(
-      s, &bind_addr.addr, SocketAddress::GetAddrLength(bind_addr));
+  int status =
+      bind(s, &bind_addr.addr, SocketAddress::GetAddrLength(bind_addr));
   if (status != NO_ERROR) {
     int rc = WSAGetLastError();
     handle->mark_closed();  // Destructor asserts that socket is marked closed.
@@ -177,28 +174,17 @@
   LPFN_CONNECTEX connectEx = NULL;
   GUID guid_connect_ex = WSAID_CONNECTEX;
   DWORD bytes;
-  status = WSAIoctl(s,
-                    SIO_GET_EXTENSION_FUNCTION_POINTER,
-                    &guid_connect_ex,
-                    sizeof(guid_connect_ex),
-                    &connectEx,
-                    sizeof(connectEx),
-                    &bytes,
-                    NULL,
-                    NULL);
+  status = WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, &guid_connect_ex,
+                    sizeof(guid_connect_ex), &connectEx, sizeof(connectEx),
+                    &bytes, NULL, NULL);
   DWORD rc;
   if (status != SOCKET_ERROR) {
     handle->EnsureInitialized(EventHandler::delegate());
 
     OverlappedBuffer* overlapped = OverlappedBuffer::AllocateConnectBuffer();
 
-    status = connectEx(s,
-                       &addr.addr,
-                       SocketAddress::GetAddrLength(addr),
-                       NULL,
-                       0,
-                       NULL,
-                       overlapped->GetCleanOverlapped());
+    status = connectEx(s, &addr.addr, SocketAddress::GetAddrLength(addr), NULL,
+                       0, NULL, overlapped->GetCleanOverlapped());
 
 
     if (status == TRUE) {
@@ -252,7 +238,7 @@
 
 bool Socket::IsBindError(intptr_t error_number) {
   return error_number == WSAEADDRINUSE || error_number == WSAEADDRNOTAVAIL ||
-      error_number == WSAEINVAL;
+         error_number == WSAEINVAL;
 }
 
 
@@ -265,10 +251,14 @@
 int Socket::GetType(intptr_t fd) {
   Handle* handle = reinterpret_cast<Handle*>(fd);
   switch (GetFileType(handle->handle())) {
-    case FILE_TYPE_CHAR: return File::kTerminal;
-    case FILE_TYPE_PIPE: return File::kPipe;
-    case FILE_TYPE_DISK: return File::kFile;
-    default: return GetLastError == NO_ERROR ? File::kOther : -1;
+    case FILE_TYPE_CHAR:
+      return File::kTerminal;
+    case FILE_TYPE_PIPE:
+      return File::kPipe;
+    case FILE_TYPE_DISK:
+      return File::kFile;
+    default:
+      return GetLastError == NO_ERROR ? File::kOther : -1;
   }
 }
 
@@ -350,13 +340,8 @@
                            intptr_t host_len,
                            OSError** os_error) {
   ASSERT(host_len >= NI_MAXHOST);
-  int status = getnameinfo(&addr.addr,
-                           SocketAddress::GetAddrLength(addr),
-                           host,
-                           host_len,
-                           NULL,
-                           0,
-                           NI_NAMEREQD);
+  int status = getnameinfo(&addr.addr, SocketAddress::GetAddrLength(addr), host,
+                           host_len, NULL, 0, NI_NAMEREQD);
   if (status != 0) {
     ASSERT(*os_error == NULL);
     DWORD error_code = WSAGetLastError();
@@ -370,12 +355,12 @@
 
 bool Socket::ParseAddress(int type, const char* address, RawAddr* addr) {
   int result;
-  const wchar_t* system_address = StringUtilsWin::Utf8ToWide(address);
+  Utf8ToWideScope system_address(address);
   if (type == SocketAddress::TYPE_IPV4) {
-    result = InetPton(AF_INET, system_address, &addr->in.sin_addr);
+    result = InetPton(AF_INET, system_address.wide(), &addr->in.sin_addr);
   } else {
     ASSERT(type == SocketAddress::TYPE_IPV6);
-    result = InetPton(AF_INET6, system_address, &addr->in6.sin6_addr);
+    result = InetPton(AF_INET6, system_address.wide(), &addr->in6.sin6_addr);
   }
   return result == 1;
 }
@@ -390,11 +375,8 @@
   int status;
   if (reuseAddress) {
     BOOL optval = true;
-    status = setsockopt(s,
-                        SOL_SOCKET,
-                        SO_REUSEADDR,
-                        reinterpret_cast<const char*>(&optval),
-                        sizeof(optval));
+    status = setsockopt(s, SOL_SOCKET, SO_REUSEADDR,
+                        reinterpret_cast<const char*>(&optval), sizeof(optval));
     if (status == SOCKET_ERROR) {
       DWORD rc = WSAGetLastError();
       closesocket(s);
@@ -403,7 +385,7 @@
     }
   }
 
-  status = bind(s, &addr.addr,  SocketAddress::GetAddrLength(addr));
+  status = bind(s, &addr.addr, SocketAddress::GetAddrLength(addr));
   if (status == SOCKET_ERROR) {
     DWORD rc = WSAGetLastError();
     closesocket(s);
@@ -428,24 +410,17 @@
   Initialize();
 
   ULONG size = 0;
-  DWORD flags = GAA_FLAG_SKIP_ANYCAST |
-                GAA_FLAG_SKIP_MULTICAST |
+  DWORD flags = GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_MULTICAST |
                 GAA_FLAG_SKIP_DNS_SERVER;
   // Query the size needed.
-  int status = GetAdaptersAddresses(SocketAddress::FromType(type),
-                                    flags,
-                                    NULL,
-                                    NULL,
-                                    &size);
+  int status = GetAdaptersAddresses(SocketAddress::FromType(type), flags, NULL,
+                                    NULL, &size);
   IP_ADAPTER_ADDRESSES* addrs = NULL;
   if (status == ERROR_BUFFER_OVERFLOW) {
     addrs = reinterpret_cast<IP_ADAPTER_ADDRESSES*>(malloc(size));
     // Get the addresses now we have the right buffer.
-    status = GetAdaptersAddresses(SocketAddress::FromType(type),
-                                  flags,
-                                  NULL,
-                                  addrs,
-                                  &size);
+    status = GetAdaptersAddresses(SocketAddress::FromType(type), flags, NULL,
+                                  addrs, &size);
   }
   if (status != NO_ERROR) {
     ASSERT(*os_error == NULL);
@@ -456,8 +431,8 @@
   }
   intptr_t count = 0;
   for (IP_ADAPTER_ADDRESSES* a = addrs; a != NULL; a = a->Next) {
-    for (IP_ADAPTER_UNICAST_ADDRESS* u = a->FirstUnicastAddress;
-         u != NULL; u = u->Next) {
+    for (IP_ADAPTER_UNICAST_ADDRESS* u = a->FirstUnicastAddress; u != NULL;
+         u = u->Next) {
       count++;
     }
   }
@@ -465,12 +440,12 @@
       new AddressList<InterfaceSocketAddress>(count);
   intptr_t i = 0;
   for (IP_ADAPTER_ADDRESSES* a = addrs; a != NULL; a = a->Next) {
-    for (IP_ADAPTER_UNICAST_ADDRESS* u = a->FirstUnicastAddress;
-         u != NULL; u = u->Next) {
-      addresses->SetAt(i, new InterfaceSocketAddress(
-          u->Address.lpSockaddr,
-          StringUtilsWin::WideToUtf8(a->FriendlyName),
-          a->Ipv6IfIndex));
+    for (IP_ADAPTER_UNICAST_ADDRESS* u = a->FirstUnicastAddress; u != NULL;
+         u = u->Next) {
+      addresses->SetAt(
+          i, new InterfaceSocketAddress(
+                 u->Address.lpSockaddr,
+                 StringUtilsWin::WideToUtf8(a->FriendlyName), a->Ipv6IfIndex));
       i++;
     }
   }
@@ -488,11 +463,9 @@
   }
 
   BOOL optval = true;
-  int status = setsockopt(s,
-                          SOL_SOCKET,
-                          SO_EXCLUSIVEADDRUSE,
-                          reinterpret_cast<const char*>(&optval),
-                          sizeof(optval));
+  int status =
+      setsockopt(s, SOL_SOCKET, SO_EXCLUSIVEADDRUSE,
+                 reinterpret_cast<const char*>(&optval), sizeof(optval));
   if (status == SOCKET_ERROR) {
     DWORD rc = WSAGetLastError();
     closesocket(s);
@@ -502,11 +475,8 @@
 
   if (addr.ss.ss_family == AF_INET6) {
     optval = v6_only;
-    setsockopt(s,
-               IPPROTO_IPV6,
-               IPV6_V6ONLY,
-               reinterpret_cast<const char*>(&optval),
-               sizeof(optval));
+    setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
+               reinterpret_cast<const char*>(&optval), sizeof(optval));
   }
 
   status = bind(s, &addr.addr, SocketAddress::GetAddrLength(addr));
@@ -576,11 +546,8 @@
   SocketHandle* handle = reinterpret_cast<SocketHandle*>(fd);
   int on;
   socklen_t len = sizeof(on);
-  int err = getsockopt(handle->socket(),
-                       IPPROTO_TCP,
-                       TCP_NODELAY,
-                       reinterpret_cast<char *>(&on),
-                       &len);
+  int err = getsockopt(handle->socket(), IPPROTO_TCP, TCP_NODELAY,
+                       reinterpret_cast<char*>(&on), &len);
   if (err == 0) {
     *enabled = (on == 1);
   }
@@ -591,11 +558,8 @@
 bool Socket::SetNoDelay(intptr_t fd, bool enabled) {
   SocketHandle* handle = reinterpret_cast<SocketHandle*>(fd);
   int on = enabled ? 1 : 0;
-  return setsockopt(handle->socket(),
-                    IPPROTO_TCP,
-                    TCP_NODELAY,
-                    reinterpret_cast<char *>(&on),
-                    sizeof(on)) == 0;
+  return setsockopt(handle->socket(), IPPROTO_TCP, TCP_NODELAY,
+                    reinterpret_cast<char*>(&on), sizeof(on)) == 0;
 }
 
 
@@ -604,12 +568,9 @@
   uint8_t on;
   socklen_t len = sizeof(on);
   int level = protocol == SocketAddress::TYPE_IPV4 ? IPPROTO_IP : IPPROTO_IPV6;
-  int optname = protocol == SocketAddress::TYPE_IPV4
-      ? IP_MULTICAST_LOOP : IPV6_MULTICAST_LOOP;
-  if (getsockopt(handle->socket(),
-                 level,
-                 optname,
-                 reinterpret_cast<char *>(&on),
+  int optname = protocol == SocketAddress::TYPE_IPV4 ? IP_MULTICAST_LOOP
+                                                     : IPV6_MULTICAST_LOOP;
+  if (getsockopt(handle->socket(), level, optname, reinterpret_cast<char*>(&on),
                  &len) == 0) {
     *enabled = (on == 1);
     return true;
@@ -622,13 +583,10 @@
   SocketHandle* handle = reinterpret_cast<SocketHandle*>(fd);
   int on = enabled ? 1 : 0;
   int level = protocol == SocketAddress::TYPE_IPV4 ? IPPROTO_IP : IPPROTO_IPV6;
-  int optname = protocol == SocketAddress::TYPE_IPV4
-      ? IP_MULTICAST_LOOP : IPV6_MULTICAST_LOOP;
-  return setsockopt(handle->socket(),
-                    level,
-                    optname,
-                    reinterpret_cast<char *>(&on),
-                    sizeof(on)) == 0;
+  int optname = protocol == SocketAddress::TYPE_IPV4 ? IP_MULTICAST_LOOP
+                                                     : IPV6_MULTICAST_LOOP;
+  return setsockopt(handle->socket(), level, optname,
+                    reinterpret_cast<char*>(&on), sizeof(on)) == 0;
 }
 
 
@@ -637,12 +595,9 @@
   uint8_t v;
   socklen_t len = sizeof(v);
   int level = protocol == SocketAddress::TYPE_IPV4 ? IPPROTO_IP : IPPROTO_IPV6;
-  int optname = protocol == SocketAddress::TYPE_IPV4
-      ? IP_MULTICAST_TTL : IPV6_MULTICAST_HOPS;
-  if (getsockopt(handle->socket(),
-                 level,
-                 optname,
-                 reinterpret_cast<char *>(&v),
+  int optname = protocol == SocketAddress::TYPE_IPV4 ? IP_MULTICAST_TTL
+                                                     : IPV6_MULTICAST_HOPS;
+  if (getsockopt(handle->socket(), level, optname, reinterpret_cast<char*>(&v),
                  &len) == 0) {
     *value = v;
     return true;
@@ -655,13 +610,10 @@
   SocketHandle* handle = reinterpret_cast<SocketHandle*>(fd);
   int v = value;
   int level = protocol == SocketAddress::TYPE_IPV4 ? IPPROTO_IP : IPPROTO_IPV6;
-  int optname = protocol == SocketAddress::TYPE_IPV4
-      ? IP_MULTICAST_TTL : IPV6_MULTICAST_HOPS;
-  return setsockopt(handle->socket(),
-                    level,
-                    optname,
-                    reinterpret_cast<char *>(&v),
-                    sizeof(v)) == 0;
+  int optname = protocol == SocketAddress::TYPE_IPV4 ? IP_MULTICAST_TTL
+                                                     : IPV6_MULTICAST_HOPS;
+  return setsockopt(handle->socket(), level, optname,
+                    reinterpret_cast<char*>(&v), sizeof(v)) == 0;
 }
 
 
@@ -669,11 +621,8 @@
   SocketHandle* handle = reinterpret_cast<SocketHandle*>(fd);
   int on;
   socklen_t len = sizeof(on);
-  int err = getsockopt(handle->socket(),
-                       SOL_SOCKET,
-                       SO_BROADCAST,
-                       reinterpret_cast<char *>(&on),
-                       &len);
+  int err = getsockopt(handle->socket(), SOL_SOCKET, SO_BROADCAST,
+                       reinterpret_cast<char*>(&on), &len);
   if (err == 0) {
     *enabled = (on == 1);
   }
@@ -684,41 +633,36 @@
 bool Socket::SetBroadcast(intptr_t fd, bool enabled) {
   SocketHandle* handle = reinterpret_cast<SocketHandle*>(fd);
   int on = enabled ? 1 : 0;
-  return setsockopt(handle->socket(),
-                    SOL_SOCKET,
-                    SO_BROADCAST,
-                    reinterpret_cast<char *>(&on),
-                    sizeof(on)) == 0;
+  return setsockopt(handle->socket(), SOL_SOCKET, SO_BROADCAST,
+                    reinterpret_cast<char*>(&on), sizeof(on)) == 0;
 }
 
 
-bool Socket::JoinMulticast(
-    intptr_t fd, const RawAddr& addr, const RawAddr&, int interfaceIndex) {
+bool Socket::JoinMulticast(intptr_t fd,
+                           const RawAddr& addr,
+                           const RawAddr&,
+                           int interfaceIndex) {
   SocketHandle* handle = reinterpret_cast<SocketHandle*>(fd);
   int proto = addr.addr.sa_family == AF_INET ? IPPROTO_IP : IPPROTO_IPV6;
   struct group_req mreq;
   mreq.gr_interface = interfaceIndex;
   memmove(&mreq.gr_group, &addr.ss, SocketAddress::GetAddrLength(addr));
-  return setsockopt(handle->socket(),
-                    proto,
-                    MCAST_JOIN_GROUP,
-                    reinterpret_cast<char *>(&mreq),
-                    sizeof(mreq)) == 0;
+  return setsockopt(handle->socket(), proto, MCAST_JOIN_GROUP,
+                    reinterpret_cast<char*>(&mreq), sizeof(mreq)) == 0;
 }
 
 
-bool Socket::LeaveMulticast(
-    intptr_t fd, const RawAddr& addr, const RawAddr&, int interfaceIndex) {
+bool Socket::LeaveMulticast(intptr_t fd,
+                            const RawAddr& addr,
+                            const RawAddr&,
+                            int interfaceIndex) {
   SocketHandle* handle = reinterpret_cast<SocketHandle*>(fd);
   int proto = addr.addr.sa_family == AF_INET ? IPPROTO_IP : IPPROTO_IPV6;
   struct group_req mreq;
   mreq.gr_interface = interfaceIndex;
   memmove(&mreq.gr_group, &addr.ss, SocketAddress::GetAddrLength(addr));
-  return setsockopt(handle->socket(),
-                    proto,
-                    MCAST_LEAVE_GROUP,
-                    reinterpret_cast<char *>(&mreq),
-                    sizeof(mreq)) == 0;
+  return setsockopt(handle->socket(), proto, MCAST_LEAVE_GROUP,
+                    reinterpret_cast<char*>(&mreq), sizeof(mreq)) == 0;
 }
 
 }  // namespace bin
diff --git a/runtime/bin/socket_win.h b/runtime/bin/socket_win.h
index 7b71e38..38aeea2 100644
--- a/runtime/bin/socket_win.h
+++ b/runtime/bin/socket_win.h
@@ -2,10 +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.
 
-#ifndef BIN_SOCKET_WIN_H_
-#define BIN_SOCKET_WIN_H_
+#ifndef RUNTIME_BIN_SOCKET_WIN_H_
+#define RUNTIME_BIN_SOCKET_WIN_H_
 
-#if !defined(BIN_SOCKET_H_)
+#if !defined(RUNTIME_BIN_SOCKET_H_)
 #error Do not include socket_win.h directly. Use socket.h.
 #endif
 
@@ -14,4 +14,4 @@
 #include <winsock2.h>
 #include <ws2tcpip.h>
 
-#endif  // BIN_SOCKET_WIN_H_
+#endif  // RUNTIME_BIN_SOCKET_WIN_H_
diff --git a/runtime/bin/stdio.h b/runtime/bin/stdio.h
index 55884df..9bf079a 100644
--- a/runtime/bin/stdio.h
+++ b/runtime/bin/stdio.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_STDIO_H_
-#define BIN_STDIO_H_
+#ifndef RUNTIME_BIN_STDIO_H_
+#define RUNTIME_BIN_STDIO_H_
 
 #if defined(DART_IO_DISABLED)
 #error "stdio.h can only be included on builds with IO enabled"
@@ -45,4 +45,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_STDIO_H_
+#endif  // RUNTIME_BIN_STDIO_H_
diff --git a/runtime/bin/stdio_android.cc b/runtime/bin/stdio_android.cc
index 019efeb..35d83e5 100644
--- a/runtime/bin/stdio_android.cc
+++ b/runtime/bin/stdio_android.cc
@@ -9,9 +9,9 @@
 
 #include "bin/stdio.h"
 
-#include <errno.h>  // NOLINT
+#include <errno.h>      // NOLINT
 #include <sys/ioctl.h>  // NOLINT
-#include <termios.h>  // NOLINT
+#include <termios.h>    // NOLINT
 
 #include "bin/fdutils.h"
 #include "platform/signal_blocker.h"
diff --git a/runtime/bin/stdio_linux.cc b/runtime/bin/stdio_linux.cc
index 0634fa4..280c75f 100644
--- a/runtime/bin/stdio_linux.cc
+++ b/runtime/bin/stdio_linux.cc
@@ -9,9 +9,9 @@
 
 #include "bin/stdio.h"
 
-#include <errno.h>  // NOLINT
+#include <errno.h>      // NOLINT
 #include <sys/ioctl.h>  // NOLINT
-#include <termios.h>  // NOLINT
+#include <termios.h>    // NOLINT
 
 #include "bin/fdutils.h"
 #include "platform/signal_blocker.h"
diff --git a/runtime/bin/stdio_macos.cc b/runtime/bin/stdio_macos.cc
index d22f192..a8bd159 100644
--- a/runtime/bin/stdio_macos.cc
+++ b/runtime/bin/stdio_macos.cc
@@ -9,9 +9,9 @@
 
 #include "bin/stdio.h"
 
-#include <errno.h>  // NOLINT
+#include <errno.h>      // NOLINT
 #include <sys/ioctl.h>  // NOLINT
-#include <termios.h>  // NOLINT
+#include <termios.h>    // NOLINT
 
 #include "bin/fdutils.h"
 #include "platform/signal_blocker.h"
diff --git a/runtime/bin/stdio_patch.dart b/runtime/bin/stdio_patch.dart
index b3dc68e..9478180 100644
--- a/runtime/bin/stdio_patch.dart
+++ b/runtime/bin/stdio_patch.dart
@@ -3,7 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 @patch class _StdIOUtils {
-  static Stdin _getStdioInputStream() {
+  @patch static Stdin _getStdioInputStream() {
     switch (_getStdioHandleType(0)) {
       case _STDIO_HANDLE_TYPE_TERMINAL:
       case _STDIO_HANDLE_TYPE_PIPE:
@@ -16,7 +16,7 @@
     }
   }
 
-  static _getStdioOutputStream(int fd) {
+  @patch static _getStdioOutputStream(int fd) {
     assert(fd == 1 || fd == 2);
     switch (_getStdioHandleType(fd)) {
       case _STDIO_HANDLE_TYPE_TERMINAL:
@@ -29,7 +29,7 @@
     }
   }
 
-  static int _socketType(Socket socket) {
+  @patch static int _socketType(Socket socket) {
     if (socket is _Socket) return _nativeSocketType(socket._nativeSocket);
     return null;
   }
@@ -43,7 +43,7 @@
     return result;
   }
 
-  static _getStdioHandleType(int fd) native "File_GetStdioHandleType";
+  @patch static _getStdioHandleType(int fd) native "File_GetStdioHandleType";
 }
 
 @patch class Stdin {
diff --git a/runtime/bin/stdio_unsupported.cc b/runtime/bin/stdio_unsupported.cc
index 1e6c213..1482f91 100644
--- a/runtime/bin/stdio_unsupported.cc
+++ b/runtime/bin/stdio_unsupported.cc
@@ -12,38 +12,38 @@
 namespace bin {
 
 void FUNCTION_NAME(Stdin_ReadByte)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Stdin unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Stdin unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Stdin_GetEchoMode)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Stdin unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Stdin unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Stdin_SetEchoMode)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Stdin unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Stdin unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Stdin_GetLineMode)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Stdin unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Stdin unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Stdin_SetLineMode)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Stdin unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Stdin unsupported on this platform"));
 }
 
 
 void FUNCTION_NAME(Stdout_GetTerminalSize)(Dart_NativeArguments args) {
-  Dart_ThrowException(DartUtils::NewDartArgumentError(
-      "Stdout unsupported on this platform"));
+  Dart_ThrowException(
+      DartUtils::NewDartArgumentError("Stdout unsupported on this platform"));
 }
 
 }  // namespace bin
diff --git a/runtime/bin/test_extension_dllmain_win.cc b/runtime/bin/test_extension_dllmain_win.cc
index ba2199a..93b66d6 100644
--- a/runtime/bin/test_extension_dllmain_win.cc
+++ b/runtime/bin/test_extension_dllmain_win.cc
@@ -8,9 +8,7 @@
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>  // NOLINT
 
-BOOL APIENTRY DllMain(HMODULE module,
-                      DWORD  reason,
-                      LPVOID reserved) {
+BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) {
   return true;
 }
 
diff --git a/runtime/bin/thread.h b/runtime/bin/thread.h
index 37a4b9f..e33e7f2 100644
--- a/runtime/bin/thread.h
+++ b/runtime/bin/thread.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_THREAD_H_
-#define BIN_THREAD_H_
+#ifndef RUNTIME_BIN_THREAD_H_
+#define RUNTIME_BIN_THREAD_H_
 
 #include "platform/globals.h"
 
@@ -38,7 +38,7 @@
   static const ThreadLocalKey kUnsetThreadLocalKey;
   static const ThreadId kInvalidThreadId;
 
-  typedef void (*ThreadStartFunction) (uword parameter);
+  typedef void (*ThreadStartFunction)(uword parameter);
 
   // Start a thread running the specified function. Returns 0 if the
   // thread started successfuly and a system specific error code if
@@ -83,10 +83,7 @@
 
 class Monitor {
  public:
-  enum WaitResult {
-    kNotified,
-    kTimedOut
-  };
+  enum WaitResult { kNotified, kTimedOut };
 
   static const int64_t kNoTimeout = 0;
 
@@ -114,4 +111,4 @@
 }  // namespace dart
 
 
-#endif  // BIN_THREAD_H_
+#endif  // RUNTIME_BIN_THREAD_H_
diff --git a/runtime/bin/thread_android.cc b/runtime/bin/thread_android.cc
index ce27ea3..cee224d 100644
--- a/runtime/bin/thread_android.cc
+++ b/runtime/bin/thread_android.cc
@@ -8,7 +8,7 @@
 #include "bin/thread.h"
 #include "bin/thread_android.h"
 
-#include <errno.h>  // NOLINT
+#include <errno.h>     // NOLINT
 #include <sys/time.h>  // NOLINT
 
 #include "platform/assert.h"
@@ -17,29 +17,29 @@
 namespace dart {
 namespace bin {
 
-#define VALIDATE_PTHREAD_RESULT(result) \
-  if (result != 0) { \
-    const int kBufferSize = 1024; \
-    char error_message[kBufferSize]; \
-    Utils::StrError(result, error_message, kBufferSize); \
-    FATAL2("pthread error: %d (%s)", result, error_message); \
+#define VALIDATE_PTHREAD_RESULT(result)                                        \
+  if (result != 0) {                                                           \
+    const int kBufferSize = 1024;                                              \
+    char error_message[kBufferSize];                                           \
+    Utils::StrError(result, error_message, kBufferSize);                       \
+    FATAL2("pthread error: %d (%s)", result, error_message);                   \
   }
 
 
 #ifdef DEBUG
-#define RETURN_ON_PTHREAD_FAILURE(result) \
-  if (result != 0) { \
-    const int kBufferSize = 1024; \
-    char error_message[kBufferSize]; \
-    Utils::StrError(result, error_message, kBufferSize); \
-    fprintf(stderr, "%s:%d: pthread error: %d (%s)\n", \
-            __FILE__, __LINE__, result, error_message); \
-    return result; \
+#define RETURN_ON_PTHREAD_FAILURE(result)                                      \
+  if (result != 0) {                                                           \
+    const int kBufferSize = 1024;                                              \
+    char error_message[kBufferSize];                                           \
+    Utils::StrError(result, error_message, kBufferSize);                       \
+    fprintf(stderr, "%s:%d: pthread error: %d (%s)\n", __FILE__, __LINE__,     \
+            result, error_message);                                            \
+    return result;                                                             \
   }
 #else
-#define RETURN_ON_PTHREAD_FAILURE(result) \
-  if (result != 0) { \
-    return result; \
+#define RETURN_ON_PTHREAD_FAILURE(result)                                      \
+  if (result != 0) {                                                           \
+    return result;                                                             \
   }
 #endif
 
@@ -61,8 +61,7 @@
 
 class ThreadStartData {
  public:
-  ThreadStartData(Thread::ThreadStartFunction function,
-                  uword parameter)
+  ThreadStartData(Thread::ThreadStartFunction function, uword parameter)
       : function_(function), parameter_(parameter) {}
 
   Thread::ThreadStartFunction function() const { return function_; }
diff --git a/runtime/bin/thread_android.h b/runtime/bin/thread_android.h
index 2551c01..154339c 100644
--- a/runtime/bin/thread_android.h
+++ b/runtime/bin/thread_android.h
@@ -2,10 +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.
 
-#ifndef BIN_THREAD_ANDROID_H_
-#define BIN_THREAD_ANDROID_H_
+#ifndef RUNTIME_BIN_THREAD_ANDROID_H_
+#define RUNTIME_BIN_THREAD_ANDROID_H_
 
-#if !defined(BIN_THREAD_H_)
+#if !defined(RUNTIME_BIN_THREAD_H_)
 #error Do not include thread_android.h directly; use thread.h instead.
 #endif
 
@@ -74,4 +74,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_THREAD_ANDROID_H_
+#endif  // RUNTIME_BIN_THREAD_ANDROID_H_
diff --git a/runtime/bin/thread_fuchsia.cc b/runtime/bin/thread_fuchsia.cc
index 57f4cd0..fa5397f 100644
--- a/runtime/bin/thread_fuchsia.cc
+++ b/runtime/bin/thread_fuchsia.cc
@@ -8,9 +8,9 @@
 #include "bin/thread.h"
 #include "bin/thread_fuchsia.h"
 
-#include <errno.h>  // NOLINT
+#include <errno.h>         // NOLINT
 #include <sys/resource.h>  // NOLINT
-#include <sys/time.h>  // NOLINT
+#include <sys/time.h>      // NOLINT
 
 #include "platform/assert.h"
 #include "platform/utils.h"
@@ -18,29 +18,28 @@
 namespace dart {
 namespace bin {
 
-#define VALIDATE_PTHREAD_RESULT(result) \
-  if (result != 0) { \
-    const int kBufferSize = 1024; \
-    char error_buf[kBufferSize]; \
-    FATAL2("pthread error: %d (%s)", result, \
-           Utils::StrError(result, error_buf, kBufferSize)); \
+#define VALIDATE_PTHREAD_RESULT(result)                                        \
+  if (result != 0) {                                                           \
+    const int kBufferSize = 1024;                                              \
+    char error_buf[kBufferSize];                                               \
+    FATAL2("pthread error: %d (%s)", result,                                   \
+           Utils::StrError(result, error_buf, kBufferSize));                   \
   }
 
 
 #ifdef DEBUG
-#define RETURN_ON_PTHREAD_FAILURE(result) \
-  if (result != 0) { \
-    const int kBufferSize = 1024; \
-    char error_buf[kBufferSize]; \
-    fprintf(stderr, "%s:%d: pthread error: %d (%s)\n", \
-            __FILE__, __LINE__, result, \
-            Utils::StrError(result, error_buf, kBufferSize)); \
-    return result; \
+#define RETURN_ON_PTHREAD_FAILURE(result)                                      \
+  if (result != 0) {                                                           \
+    const int kBufferSize = 1024;                                              \
+    char error_buf[kBufferSize];                                               \
+    fprintf(stderr, "%s:%d: pthread error: %d (%s)\n", __FILE__, __LINE__,     \
+            result, Utils::StrError(result, error_buf, kBufferSize));          \
+    return result;                                                             \
   }
 #else
-#define RETURN_ON_PTHREAD_FAILURE(result) \
-  if (result != 0) { \
-    return result; \
+#define RETURN_ON_PTHREAD_FAILURE(result)                                      \
+  if (result != 0) {                                                           \
+    return result;                                                             \
   }
 #endif
 
@@ -62,8 +61,7 @@
 
 class ThreadStartData {
  public:
-  ThreadStartData(Thread::ThreadStartFunction function,
-                  uword parameter)
+  ThreadStartData(Thread::ThreadStartFunction function, uword parameter)
       : function_(function), parameter_(parameter) {}
 
   Thread::ThreadStartFunction function() const { return function_; }
diff --git a/runtime/bin/thread_fuchsia.h b/runtime/bin/thread_fuchsia.h
index 6168719..2923a514 100644
--- a/runtime/bin/thread_fuchsia.h
+++ b/runtime/bin/thread_fuchsia.h
@@ -2,10 +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.
 
-#ifndef BIN_THREAD_FUCHSIA_H_
-#define BIN_THREAD_FUCHSIA_H_
+#ifndef RUNTIME_BIN_THREAD_FUCHSIA_H_
+#define RUNTIME_BIN_THREAD_FUCHSIA_H_
 
-#if !defined(BIN_THREAD_H_)
+#if !defined(RUNTIME_BIN_THREAD_H_)
 #error Do not include thread_fuchsia.h directly; use thread.h instead.
 #endif
 
@@ -74,4 +74,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_THREAD_FUCHSIA_H_
+#endif  // RUNTIME_BIN_THREAD_FUCHSIA_H_
diff --git a/runtime/bin/thread_linux.cc b/runtime/bin/thread_linux.cc
index 6ea923e..6e6971f 100644
--- a/runtime/bin/thread_linux.cc
+++ b/runtime/bin/thread_linux.cc
@@ -8,9 +8,9 @@
 #include "bin/thread.h"
 #include "bin/thread_linux.h"
 
-#include <errno.h>  // NOLINT
+#include <errno.h>         // NOLINT
 #include <sys/resource.h>  // NOLINT
-#include <sys/time.h>  // NOLINT
+#include <sys/time.h>      // NOLINT
 
 #include "platform/assert.h"
 #include "platform/utils.h"
@@ -18,29 +18,28 @@
 namespace dart {
 namespace bin {
 
-#define VALIDATE_PTHREAD_RESULT(result) \
-  if (result != 0) { \
-    const int kBufferSize = 1024; \
-    char error_buf[kBufferSize]; \
-    FATAL2("pthread error: %d (%s)", result, \
-           Utils::StrError(result, error_buf, kBufferSize)); \
+#define VALIDATE_PTHREAD_RESULT(result)                                        \
+  if (result != 0) {                                                           \
+    const int kBufferSize = 1024;                                              \
+    char error_buf[kBufferSize];                                               \
+    FATAL2("pthread error: %d (%s)", result,                                   \
+           Utils::StrError(result, error_buf, kBufferSize));                   \
   }
 
 
 #ifdef DEBUG
-#define RETURN_ON_PTHREAD_FAILURE(result) \
-  if (result != 0) { \
-    const int kBufferSize = 1024; \
-    char error_buf[kBufferSize]; \
-    fprintf(stderr, "%s:%d: pthread error: %d (%s)\n", \
-            __FILE__, __LINE__, result, \
-            Utils::StrError(result, error_buf, kBufferSize)); \
-    return result; \
+#define RETURN_ON_PTHREAD_FAILURE(result)                                      \
+  if (result != 0) {                                                           \
+    const int kBufferSize = 1024;                                              \
+    char error_buf[kBufferSize];                                               \
+    fprintf(stderr, "%s:%d: pthread error: %d (%s)\n", __FILE__, __LINE__,     \
+            result, Utils::StrError(result, error_buf, kBufferSize));          \
+    return result;                                                             \
   }
 #else
-#define RETURN_ON_PTHREAD_FAILURE(result) \
-  if (result != 0) { \
-    return result; \
+#define RETURN_ON_PTHREAD_FAILURE(result)                                      \
+  if (result != 0) {                                                           \
+    return result;                                                             \
   }
 #endif
 
@@ -62,8 +61,7 @@
 
 class ThreadStartData {
  public:
-  ThreadStartData(Thread::ThreadStartFunction function,
-                  uword parameter)
+  ThreadStartData(Thread::ThreadStartFunction function, uword parameter)
       : function_(function), parameter_(parameter) {}
 
   Thread::ThreadStartFunction function() const { return function_; }
diff --git a/runtime/bin/thread_linux.h b/runtime/bin/thread_linux.h
index 9f4093c..403c353 100644
--- a/runtime/bin/thread_linux.h
+++ b/runtime/bin/thread_linux.h
@@ -2,10 +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.
 
-#ifndef BIN_THREAD_LINUX_H_
-#define BIN_THREAD_LINUX_H_
+#ifndef RUNTIME_BIN_THREAD_LINUX_H_
+#define RUNTIME_BIN_THREAD_LINUX_H_
 
-#if !defined(BIN_THREAD_H_)
+#if !defined(RUNTIME_BIN_THREAD_H_)
 #error Do not include thread_linux.h directly; use thread.h instead.
 #endif
 
@@ -74,4 +74,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_THREAD_LINUX_H_
+#endif  // RUNTIME_BIN_THREAD_LINUX_H_
diff --git a/runtime/bin/thread_macos.cc b/runtime/bin/thread_macos.cc
index 9477e8ab..b63b0b9 100644
--- a/runtime/bin/thread_macos.cc
+++ b/runtime/bin/thread_macos.cc
@@ -8,16 +8,16 @@
 #include "bin/thread.h"
 #include "bin/thread_macos.h"
 
-#include <mach/mach_host.h>  // NOLINT
-#include <mach/mach_init.h>  // NOLINT
-#include <mach/mach_port.h>  // NOLINT
-#include <mach/mach_traps.h>  // NOLINT
-#include <mach/task_info.h>  // NOLINT
-#include <mach/thread_act.h>  // NOLINT
+#include <mach/mach_host.h>    // NOLINT
+#include <mach/mach_init.h>    // NOLINT
+#include <mach/mach_port.h>    // NOLINT
+#include <mach/mach_traps.h>   // NOLINT
+#include <mach/task_info.h>    // NOLINT
+#include <mach/thread_act.h>   // NOLINT
 #include <mach/thread_info.h>  // NOLINT
-#include <sys/errno.h>  // NOLINT
-#include <sys/sysctl.h>  // NOLINT
-#include <sys/types.h>  // NOLINT
+#include <sys/errno.h>         // NOLINT
+#include <sys/sysctl.h>        // NOLINT
+#include <sys/types.h>         // NOLINT
 
 #include "platform/assert.h"
 #include "platform/utils.h"
@@ -25,37 +25,36 @@
 namespace dart {
 namespace bin {
 
-#define VALIDATE_PTHREAD_RESULT(result)         \
-  if (result != 0) { \
-    const int kBufferSize = 1024; \
-    char error_message[kBufferSize]; \
-    Utils::StrError(result, error_message, kBufferSize); \
-    FATAL2("pthread error: %d (%s)", result, error_message); \
+#define VALIDATE_PTHREAD_RESULT(result)                                        \
+  if (result != 0) {                                                           \
+    const int kBufferSize = 1024;                                              \
+    char error_message[kBufferSize];                                           \
+    Utils::StrError(result, error_message, kBufferSize);                       \
+    FATAL2("pthread error: %d (%s)", result, error_message);                   \
   }
 
 
 #ifdef DEBUG
-#define RETURN_ON_PTHREAD_FAILURE(result) \
-  if (result != 0) { \
-    const int kBufferSize = 1024; \
-    char error_message[kBufferSize]; \
-    Utils::StrError(result, error_message, kBufferSize); \
-    fprintf(stderr, "%s:%d: pthread error: %d (%s)\n", \
-            __FILE__, __LINE__, result, error_message); \
-    return result; \
+#define RETURN_ON_PTHREAD_FAILURE(result)                                      \
+  if (result != 0) {                                                           \
+    const int kBufferSize = 1024;                                              \
+    char error_message[kBufferSize];                                           \
+    Utils::StrError(result, error_message, kBufferSize);                       \
+    fprintf(stderr, "%s:%d: pthread error: %d (%s)\n", __FILE__, __LINE__,     \
+            result, error_message);                                            \
+    return result;                                                             \
   }
 #else
-#define RETURN_ON_PTHREAD_FAILURE(result) \
-  if (result != 0) { \
-    return result; \
+#define RETURN_ON_PTHREAD_FAILURE(result)                                      \
+  if (result != 0) {                                                           \
+    return result;                                                             \
   }
 #endif
 
 
 class ThreadStartData {
  public:
-  ThreadStartData(Thread::ThreadStartFunction function,
-                  uword parameter)
+  ThreadStartData(Thread::ThreadStartFunction function, uword parameter)
       : function_(function), parameter_(parameter) {}
 
   Thread::ThreadStartFunction function() const { return function_; }
@@ -311,9 +310,8 @@
         (micros - (secs * kMicrosecondsPerSecond)) * kNanosecondsPerMicrosecond;
     ts.tv_sec = static_cast<int32_t>(secs);
     ts.tv_nsec = static_cast<long>(nanos);  // NOLINT (long used in timespec).
-    int result = pthread_cond_timedwait_relative_np(data_.cond(),
-                                                    data_.mutex(),
-                                                    &ts);
+    int result =
+        pthread_cond_timedwait_relative_np(data_.cond(), data_.mutex(), &ts);
     ASSERT((result == 0) || (result == ETIMEDOUT));
     if (result == ETIMEDOUT) {
       retval = kTimedOut;
diff --git a/runtime/bin/thread_macos.h b/runtime/bin/thread_macos.h
index a074896..419bc8b 100644
--- a/runtime/bin/thread_macos.h
+++ b/runtime/bin/thread_macos.h
@@ -2,10 +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.
 
-#ifndef BIN_THREAD_MACOS_H_
-#define BIN_THREAD_MACOS_H_
+#ifndef RUNTIME_BIN_THREAD_MACOS_H_
+#define RUNTIME_BIN_THREAD_MACOS_H_
 
-#if !defined(BIN_THREAD_H_)
+#if !defined(RUNTIME_BIN_THREAD_H_)
 #error Do not include thread_macos.h directly; use thread.h instead.
 #endif
 
@@ -74,4 +74,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_THREAD_MACOS_H_
+#endif  // RUNTIME_BIN_THREAD_MACOS_H_
diff --git a/runtime/bin/thread_win.cc b/runtime/bin/thread_win.cc
index 92a9801..b491a51 100644
--- a/runtime/bin/thread_win.cc
+++ b/runtime/bin/thread_win.cc
@@ -133,11 +133,8 @@
   TimeStamp kernel;
   TimeStamp user;
   HANDLE handle = OpenThread(THREAD_QUERY_INFORMATION, false, thread_id);
-  BOOL result = GetThreadTimes(handle,
-                               &created.ft_,
-                               &exited.ft_,
-                               &kernel.ft_,
-                               &user.ft_);
+  BOOL result =
+      GetThreadTimes(handle, &created.ft_, &exited.ft_, &kernel.ft_, &user.ft_);
   CloseHandle(handle);
   if (!result) {
     FATAL1("GetThreadCpuUsage failed %d\n", GetLastError());
@@ -234,10 +231,9 @@
 
 
 void MonitorWaitData::ThreadExit() {
-  if (MonitorWaitData::monitor_wait_data_key_ !=
-      Thread::kUnsetThreadLocalKey) {
+  if (MonitorWaitData::monitor_wait_data_key_ != Thread::kUnsetThreadLocalKey) {
     uword raw_wait_data =
-      Thread::GetThreadLocal(MonitorWaitData::monitor_wait_data_key_);
+        Thread::GetThreadLocal(MonitorWaitData::monitor_wait_data_key_);
     if (raw_wait_data != 0) {
       MonitorWaitData* wait_data =
           reinterpret_cast<MonitorWaitData*>(raw_wait_data);
@@ -351,7 +347,7 @@
   // Get the MonitorWaitData object containing the event for this
   // thread from thread local storage. Create it if it does not exist.
   uword raw_wait_data =
-    Thread::GetThreadLocal(MonitorWaitData::monitor_wait_data_key_);
+      Thread::GetThreadLocal(MonitorWaitData::monitor_wait_data_key_);
   MonitorWaitData* wait_data = NULL;
   if (raw_wait_data == 0) {
     HANDLE event = CreateEvent(NULL, FALSE, FALSE, NULL);
diff --git a/runtime/bin/thread_win.h b/runtime/bin/thread_win.h
index 5e1dba51..85ab38f 100644
--- a/runtime/bin/thread_win.h
+++ b/runtime/bin/thread_win.h
@@ -2,10 +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.
 
-#ifndef BIN_THREAD_WIN_H_
-#define BIN_THREAD_WIN_H_
+#ifndef RUNTIME_BIN_THREAD_WIN_H_
+#define RUNTIME_BIN_THREAD_WIN_H_
 
-#if !defined(BIN_THREAD_H_)
+#if !defined(RUNTIME_BIN_THREAD_H_)
 #error Do not include thread_win.h directly; use thread.h instead.
 #endif
 
@@ -119,4 +119,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_THREAD_WIN_H_
+#endif  // RUNTIME_BIN_THREAD_WIN_H_
diff --git a/runtime/bin/utils.h b/runtime/bin/utils.h
index 5311d36..03c1578 100644
--- a/runtime/bin/utils.h
+++ b/runtime/bin/utils.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_UTILS_H_
-#define BIN_UTILS_H_
+#ifndef RUNTIME_BIN_UTILS_H_
+#define RUNTIME_BIN_UTILS_H_
 
 #include <stdlib.h>
 #include <string.h>
@@ -16,12 +16,7 @@
 
 class OSError {
  public:
-  enum SubSystem {
-    kSystem,
-    kGetAddressInfo,
-    kBoringSSL,
-    kUnknown = -1
-  };
+  enum SubSystem { kSystem, kGetAddressInfo, kBoringSSL, kUnknown = -1 };
 
   OSError();
   OSError(int code, const char* message, SubSystem sub_system) {
@@ -123,4 +118,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_UTILS_H_
+#endif  // RUNTIME_BIN_UTILS_H_
diff --git a/runtime/bin/utils_android.cc b/runtime/bin/utils_android.cc
index 8c6ad24..e40d66a 100644
--- a/runtime/bin/utils_android.cc
+++ b/runtime/bin/utils_android.cc
@@ -5,10 +5,10 @@
 #include "platform/globals.h"
 #if defined(TARGET_OS_ANDROID)
 
-#include <errno.h>  // NOLINT
-#include <netdb.h>  // NOLINT
+#include <errno.h>     // NOLINT
+#include <netdb.h>     // NOLINT
 #include <sys/time.h>  // NOLINT
-#include <time.h>  // NOLINT
+#include <time.h>      // NOLINT
 
 #include "bin/utils.h"
 #include "platform/assert.h"
@@ -43,29 +43,33 @@
 }
 
 
-const char* StringUtils::ConsoleStringToUtf8(
-    const char* str, intptr_t len, intptr_t* result_len) {
+const char* StringUtils::ConsoleStringToUtf8(const char* str,
+                                             intptr_t len,
+                                             intptr_t* result_len) {
   UNIMPLEMENTED();
   return NULL;
 }
 
 
-const char* StringUtils::Utf8ToConsoleString(
-    const char* utf8, intptr_t len, intptr_t* result_len) {
+const char* StringUtils::Utf8ToConsoleString(const char* utf8,
+                                             intptr_t len,
+                                             intptr_t* result_len) {
   UNIMPLEMENTED();
   return NULL;
 }
 
 
-char* StringUtils::ConsoleStringToUtf8(
-    char* str, intptr_t len, intptr_t* result_len) {
+char* StringUtils::ConsoleStringToUtf8(char* str,
+                                       intptr_t len,
+                                       intptr_t* result_len) {
   UNIMPLEMENTED();
   return NULL;
 }
 
 
-char* StringUtils::Utf8ToConsoleString(
-    char* utf8, intptr_t len, intptr_t* result_len) {
+char* StringUtils::Utf8ToConsoleString(char* utf8,
+                                       intptr_t len,
+                                       intptr_t* result_len) {
   UNIMPLEMENTED();
   return NULL;
 }
@@ -81,8 +85,7 @@
 }
 
 
-void TimerUtils::InitOnce() {
-}
+void TimerUtils::InitOnce() {}
 
 
 int64_t TimerUtils::GetCurrentMonotonicMillis() {
diff --git a/runtime/bin/utils_fuchsia.cc b/runtime/bin/utils_fuchsia.cc
index 0809723..2425e49 100644
--- a/runtime/bin/utils_fuchsia.cc
+++ b/runtime/bin/utils_fuchsia.cc
@@ -40,29 +40,33 @@
 }
 
 
-const char* StringUtils::ConsoleStringToUtf8(
-    const char* str, intptr_t len, intptr_t* result_len) {
+const char* StringUtils::ConsoleStringToUtf8(const char* str,
+                                             intptr_t len,
+                                             intptr_t* result_len) {
   UNIMPLEMENTED();
   return NULL;
 }
 
 
-const char* StringUtils::Utf8ToConsoleString(
-    const char* utf8, intptr_t len, intptr_t* result_len) {
+const char* StringUtils::Utf8ToConsoleString(const char* utf8,
+                                             intptr_t len,
+                                             intptr_t* result_len) {
   UNIMPLEMENTED();
   return NULL;
 }
 
 
-char* StringUtils::ConsoleStringToUtf8(
-    char* str, intptr_t len, intptr_t* result_len) {
+char* StringUtils::ConsoleStringToUtf8(char* str,
+                                       intptr_t len,
+                                       intptr_t* result_len) {
   UNIMPLEMENTED();
   return NULL;
 }
 
 
-char* StringUtils::Utf8ToConsoleString(
-    char* utf8, intptr_t len, intptr_t* result_len) {
+char* StringUtils::Utf8ToConsoleString(char* utf8,
+                                       intptr_t len,
+                                       intptr_t* result_len) {
   UNIMPLEMENTED();
   return NULL;
 }
@@ -78,8 +82,7 @@
 }
 
 
-void TimerUtils::InitOnce() {
-}
+void TimerUtils::InitOnce() {}
 
 
 int64_t TimerUtils::GetCurrentMonotonicMillis() {
@@ -88,14 +91,14 @@
 
 
 int64_t TimerUtils::GetCurrentMonotonicMicros() {
-  int64_t ticks = mx_current_time();
+  int64_t ticks = mx_time_get(MX_CLOCK_MONOTONIC);
   return ticks / kNanosecondsPerMicrosecond;
 }
 
 
 void TimerUtils::Sleep(int64_t millis) {
-  mx_nanosleep(
-      millis * kMicrosecondsPerMillisecond * kNanosecondsPerMicrosecond);
+  mx_nanosleep(millis * kMicrosecondsPerMillisecond *
+               kNanosecondsPerMicrosecond);
 }
 
 }  // namespace bin
diff --git a/runtime/bin/utils_linux.cc b/runtime/bin/utils_linux.cc
index 8266102..c59531f 100644
--- a/runtime/bin/utils_linux.cc
+++ b/runtime/bin/utils_linux.cc
@@ -5,10 +5,10 @@
 #include "platform/globals.h"
 #if defined(TARGET_OS_LINUX)
 
-#include <errno.h>  // NOLINT
-#include <netdb.h>  // NOLINT
+#include <errno.h>     // NOLINT
+#include <netdb.h>     // NOLINT
 #include <sys/time.h>  // NOLINT
-#include <time.h>  // NOLINT
+#include <time.h>      // NOLINT
 
 #include "bin/utils.h"
 #include "platform/assert.h"
@@ -41,29 +41,33 @@
 }
 
 
-const char* StringUtils::ConsoleStringToUtf8(
-    const char* str, intptr_t len, intptr_t* result_len) {
+const char* StringUtils::ConsoleStringToUtf8(const char* str,
+                                             intptr_t len,
+                                             intptr_t* result_len) {
   UNIMPLEMENTED();
   return NULL;
 }
 
 
-const char* StringUtils::Utf8ToConsoleString(
-    const char* utf8, intptr_t len, intptr_t* result_len) {
+const char* StringUtils::Utf8ToConsoleString(const char* utf8,
+                                             intptr_t len,
+                                             intptr_t* result_len) {
   UNIMPLEMENTED();
   return NULL;
 }
 
 
-char* StringUtils::ConsoleStringToUtf8(
-    char* str, intptr_t len, intptr_t* result_len) {
+char* StringUtils::ConsoleStringToUtf8(char* str,
+                                       intptr_t len,
+                                       intptr_t* result_len) {
   UNIMPLEMENTED();
   return NULL;
 }
 
 
-char* StringUtils::Utf8ToConsoleString(
-    char* utf8, intptr_t len, intptr_t* result_len) {
+char* StringUtils::Utf8ToConsoleString(char* utf8,
+                                       intptr_t len,
+                                       intptr_t* result_len) {
   UNIMPLEMENTED();
   return NULL;
 }
@@ -79,8 +83,7 @@
 }
 
 
-void TimerUtils::InitOnce() {
-}
+void TimerUtils::InitOnce() {}
 
 
 int64_t TimerUtils::GetCurrentMonotonicMillis() {
diff --git a/runtime/bin/utils_macos.cc b/runtime/bin/utils_macos.cc
index 97717c7..5753cd0 100644
--- a/runtime/bin/utils_macos.cc
+++ b/runtime/bin/utils_macos.cc
@@ -5,16 +5,16 @@
 #include "platform/globals.h"
 #if defined(TARGET_OS_MACOS)
 
-#include <errno.h>  // NOLINT
-#include <mach/clock.h>  // NOLINT
-#include <mach/mach.h>  // NOLINT
+#include <errno.h>           // NOLINT
+#include <mach/clock.h>      // NOLINT
+#include <mach/mach.h>       // NOLINT
 #include <mach/mach_time.h>  // NOLINT
-#include <netdb.h>  // NOLINT
+#include <netdb.h>           // NOLINT
 #if TARGET_OS_IOS
 #include <sys/sysctl.h>  // NOLINT
 #endif
 #include <sys/time.h>  // NOLINT
-#include <time.h>  // NOLINT
+#include <time.h>      // NOLINT
 
 #include "bin/utils.h"
 #include "platform/assert.h"
@@ -49,38 +49,42 @@
 }
 
 
-const char* StringUtils::ConsoleStringToUtf8(
-    const char* str, intptr_t len, intptr_t* result_len) {
+const char* StringUtils::ConsoleStringToUtf8(const char* str,
+                                             intptr_t len,
+                                             intptr_t* result_len) {
   UNIMPLEMENTED();
   return NULL;
 }
 
 
-const char* StringUtils::Utf8ToConsoleString(
-    const char* utf8, intptr_t len, intptr_t* result_len) {
+const char* StringUtils::Utf8ToConsoleString(const char* utf8,
+                                             intptr_t len,
+                                             intptr_t* result_len) {
   UNIMPLEMENTED();
   return NULL;
 }
 
 
-char* StringUtils::ConsoleStringToUtf8(
-    char* str, intptr_t len, intptr_t* result_len) {
+char* StringUtils::ConsoleStringToUtf8(char* str,
+                                       intptr_t len,
+                                       intptr_t* result_len) {
   UNIMPLEMENTED();
   return NULL;
 }
 
 
-char* StringUtils::Utf8ToConsoleString(
-    char* utf8, intptr_t len, intptr_t* result_len) {
+char* StringUtils::Utf8ToConsoleString(char* utf8,
+                                       intptr_t len,
+                                       intptr_t* result_len) {
   UNIMPLEMENTED();
   return NULL;
 }
 
 
 char* StringUtils::StrNDup(const char* s, intptr_t n) {
-  // strndup has only been added to Mac OS X in 10.7. We are supplying
-  // our own copy here if needed.
-#if !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || \
+// strndup has only been added to Mac OS X in 10.7. We are supplying
+// our own copy here if needed.
+#if !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) ||                 \
     __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ <= 1060
   intptr_t len = strlen(s);
   if ((n < 0) || (len < 0)) {
@@ -95,7 +99,7 @@
   }
   result[len] = '\0';
   return reinterpret_cast<char*>(memmove(result, s, len));
-#else  // !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || ...
+#else   // !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || ...
   return strndup(s, n);
 #endif  // !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || ...
 }
diff --git a/runtime/bin/utils_win.cc b/runtime/bin/utils_win.cc
index 4b0b1fa..8faa7d0 100644
--- a/runtime/bin/utils_win.cc
+++ b/runtime/bin/utils_win.cc
@@ -6,7 +6,7 @@
 #if defined(TARGET_OS_WINDOWS)
 
 #include <errno.h>  // NOLINT
-#include <time.h>  // NOLINT
+#include <time.h>   // NOLINT
 
 #include "bin/log.h"
 #include "bin/utils.h"
@@ -17,18 +17,12 @@
 namespace bin {
 
 void FormatMessageIntoBuffer(DWORD code, wchar_t* buffer, int buffer_length) {
-  DWORD message_size =
-      FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
-                     NULL,
-                     code,
-                     MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-                     buffer,
-                     buffer_length,
-                     NULL);
+  DWORD message_size = FormatMessageW(
+      FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, code,
+      MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buffer, buffer_length, NULL);
   if (message_size == 0) {
     if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
-      Log::PrintErr("FormatMessage failed for error code %d (error %d)\n",
-                    code,
+      Log::PrintErr("FormatMessage failed for error code %d (error %d)\n", code,
                     GetLastError());
     }
     _snwprintf(buffer, buffer_length, L"OS Error %d", code);
@@ -79,8 +73,8 @@
                                        intptr_t* result_len) {
   intptr_t wide_len;
   wchar_t* wide = StringUtilsWin::Utf8ToWide(utf8, len, &wide_len);
-  int system_len = WideCharToMultiByte(
-      CP_ACP, 0, wide, wide_len, NULL, 0, NULL, NULL);
+  int system_len =
+      WideCharToMultiByte(CP_ACP, 0, wide, wide_len, NULL, 0, NULL, NULL);
   char* ansi;
   ansi =
       reinterpret_cast<char*>(Dart_ScopeAllocate(system_len * sizeof(*ansi)));
@@ -100,8 +94,8 @@
                                  intptr_t* result_len) {
   // If len is -1 then WideCharToMultiByte will include the terminating
   // NUL byte in the length.
-  int utf8_len = WideCharToMultiByte(
-      CP_UTF8, 0, wide, len, NULL, 0, NULL, NULL);
+  int utf8_len =
+      WideCharToMultiByte(CP_UTF8, 0, wide, len, NULL, 0, NULL, NULL);
   char* utf8;
   utf8 = reinterpret_cast<char*>(Dart_ScopeAllocate(utf8_len * sizeof(*utf8)));
   WideCharToMultiByte(CP_UTF8, 0, wide, len, utf8, utf8_len, NULL, NULL);
@@ -129,31 +123,33 @@
 }
 
 
-const char* StringUtils::Utf8ToConsoleString(
-    const char* utf8, intptr_t len, intptr_t* result_len) {
-  return const_cast<const char*>(
-      StringUtils::Utf8ToConsoleString(
-          const_cast<char*>(utf8), len, result_len));
+const char* StringUtils::Utf8ToConsoleString(const char* utf8,
+                                             intptr_t len,
+                                             intptr_t* result_len) {
+  return const_cast<const char*>(StringUtils::Utf8ToConsoleString(
+      const_cast<char*>(utf8), len, result_len));
 }
 
 
-const char* StringUtils::ConsoleStringToUtf8(
-    const char* str, intptr_t len, intptr_t* result_len) {
-  return const_cast<const char*>(
-      StringUtils::ConsoleStringToUtf8(
-          const_cast<char*>(str), len, result_len));
+const char* StringUtils::ConsoleStringToUtf8(const char* str,
+                                             intptr_t len,
+                                             intptr_t* result_len) {
+  return const_cast<const char*>(StringUtils::ConsoleStringToUtf8(
+      const_cast<char*>(str), len, result_len));
 }
 
 
-const char* StringUtilsWin::WideToUtf8(
-    const wchar_t* wide, intptr_t len, intptr_t* result_len) {
+const char* StringUtilsWin::WideToUtf8(const wchar_t* wide,
+                                       intptr_t len,
+                                       intptr_t* result_len) {
   return const_cast<const char*>(
       StringUtilsWin::WideToUtf8(const_cast<wchar_t*>(wide), len, result_len));
 }
 
 
-const wchar_t* StringUtilsWin::Utf8ToWide(
-    const char* utf8, intptr_t len, intptr_t* result_len) {
+const wchar_t* StringUtilsWin::Utf8ToWide(const char* utf8,
+                                          intptr_t len,
+                                          intptr_t* result_len) {
   return const_cast<const wchar_t*>(
       StringUtilsWin::Utf8ToWide(const_cast<char*>(utf8), len, result_len));
 }
@@ -190,8 +186,7 @@
   }
   for (int i = 0; i < unicode_argc; i++) {
     wchar_t* arg = unicode_argv[i];
-    int arg_len =
-        WideCharToMultiByte(CP_UTF8, 0, arg, -1, NULL, 0, NULL, NULL);
+    int arg_len = WideCharToMultiByte(CP_UTF8, 0, arg, -1, NULL, 0, NULL, NULL);
     char* utf8_arg = reinterpret_cast<char*>(malloc(arg_len));
     WideCharToMultiByte(CP_UTF8, 0, arg, -1, utf8_arg, arg_len, NULL, NULL);
     argv[i] = utf8_arg;
diff --git a/runtime/bin/utils_win.h b/runtime/bin/utils_win.h
index fe0fa5c..a46bbb8 100644
--- a/runtime/bin/utils_win.h
+++ b/runtime/bin/utils_win.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_UTILS_WIN_H_
-#define BIN_UTILS_WIN_H_
+#ifndef RUNTIME_BIN_UTILS_WIN_H_
+#define RUNTIME_BIN_UTILS_WIN_H_
 
 #include "platform/globals.h"
 
@@ -37,7 +37,60 @@
   DISALLOW_IMPLICIT_CONSTRUCTORS(StringUtilsWin);
 };
 
+// These scopes provide strings converted as indicated by the scope names.
+// The provided strings are allocated with 'new' and have the same lifetime as
+// the scope.
+class WideToUtf8Scope {
+ public:
+  explicit WideToUtf8Scope(const wchar_t* wide) {
+    intptr_t utf8_len =
+        WideCharToMultiByte(CP_UTF8, 0, wide, -1, NULL, 0, NULL, NULL);
+    char* utf8 = new char[utf8_len];
+    WideCharToMultiByte(CP_UTF8, 0, wide, -1, utf8, utf8_len, NULL, NULL);
+    length_ = utf8_len;
+    utf8_ = utf8;
+  }
+
+  ~WideToUtf8Scope() {
+    delete[] utf8_;
+    utf8_ = NULL;
+  }
+
+  char* utf8() const { return utf8_; }
+  intptr_t length() const { return length_; }
+
+ private:
+  intptr_t length_;
+  char* utf8_;
+
+  DISALLOW_ALLOCATION();
+  DISALLOW_IMPLICIT_CONSTRUCTORS(WideToUtf8Scope);
+};
+
+class Utf8ToWideScope {
+ public:
+  explicit Utf8ToWideScope(const char* utf8) {
+    int wide_len = MultiByteToWideChar(CP_UTF8, 0, utf8, -1, NULL, 0);
+    wchar_t* wide = new wchar_t[wide_len];
+    MultiByteToWideChar(CP_UTF8, 0, utf8, -1, wide, wide_len);
+    length_ = wide_len;
+    wide_ = wide;
+  }
+
+  ~Utf8ToWideScope() { delete[] wide_; }
+
+  wchar_t* wide() const { return wide_; }
+  intptr_t length() const { return length_; }
+
+ private:
+  intptr_t length_;
+  wchar_t* wide_;
+
+  DISALLOW_ALLOCATION();
+  DISALLOW_IMPLICIT_CONSTRUCTORS(Utf8ToWideScope);
+};
+
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_UTILS_WIN_H_
+#endif  // RUNTIME_BIN_UTILS_WIN_H_
diff --git a/runtime/bin/vmservice/server.dart b/runtime/bin/vmservice/server.dart
index e1cb822..9a48adf 100644
--- a/runtime/bin/vmservice/server.dart
+++ b/runtime/bin/vmservice/server.dart
@@ -126,12 +126,20 @@
   final bool _originCheckDisabled;
   HttpServer _server;
   bool get running => _server != null;
-  bool _displayMessages = false;
 
-  Server(this._service, this._ip, this._port, this._originCheckDisabled) {
-    _displayMessages = (_ip != '127.0.0.1' || _port != 8181);
+  /// Returns the server address including the auth token.
+  Uri get serverAddress {
+    if (!running) {
+      return null;
+    }
+    var ip = _server.address.address;
+    var port = _server.port;
+    var path = useAuthToken ? "$serviceAuthToken/" : "/";
+    return new Uri(scheme: 'http', host: ip, port: port, path: path);
   }
 
+  Server(this._service, this._ip, this._port, this._originCheckDisabled);
+
   bool _isAllowedOrigin(String origin) {
     Uri uri;
     try {
@@ -143,6 +151,7 @@
     // Explicitly add localhost and 127.0.0.1 on any port (necessary for
     // adb port forwarding).
     if ((uri.host == 'localhost') ||
+        (uri.host == '::1') ||
         (uri.host == '127.0.0.1')) {
       return true;
     }
@@ -179,6 +188,28 @@
     return false;
   }
 
+  /// Checks the [requestUri] for the service auth token and returns the path.
+  /// If the service auth token check fails, returns null.
+  String _checkAuthTokenAndGetPath(Uri requestUri) {
+    if (!useAuthToken) {
+      return requestUri.path == '/' ? ROOT_REDIRECT_PATH : requestUri.path;
+    }
+    final List<String> requestPathSegments = requestUri.pathSegments;
+    if (requestPathSegments.length < 2) {
+      // Malformed.
+      return null;
+    }
+    // Check that we were given the auth token.
+    final String authToken = requestPathSegments[0];
+    if (authToken != serviceAuthToken) {
+      // Malformed.
+      return null;
+    }
+    // Construct the actual request path by chopping off the auth token.
+    return (requestPathSegments[1] == '') ?
+        ROOT_REDIRECT_PATH : '/${requestPathSegments.sublist(1).join('/')}';
+  }
+
   Future _requestHandler(HttpRequest request) async {
     if (!_originCheck(request)) {
       // This is a cross origin attempt to connect
@@ -190,15 +221,23 @@
 
       List fsNameList;
       List fsPathList;
+      List fsPathBase64List;
       Object fsName;
       Object fsPath;
 
       try {
         // Extract the fs name and fs path from the request headers.
         fsNameList = request.headers['dev_fs_name'];
-        fsPathList = request.headers['dev_fs_path'];
         fsName = fsNameList[0];
-        fsPath = fsPathList[0];
+
+        fsPathList = request.headers['dev_fs_path'];
+        fsPathBase64List = request.headers['dev_fs_path_b64'];
+        // If the 'dev_fs_path_b64' header field was sent, use that instead.
+        if ((fsPathBase64List != null) && (fsPathBase64List.length > 0)) {
+          fsPath = UTF8.decode(BASE64.decode(fsPathBase64List[0]));
+        } else {
+          fsPath = fsPathList[0];
+        }
       } catch (e) { /* ignore */ }
 
       String result;
@@ -223,8 +262,12 @@
       return;
     }
 
-    final String path =
-          request.uri.path == '/' ? ROOT_REDIRECT_PATH : request.uri.path;
+    final String path = _checkAuthTokenAndGetPath(request.uri);
+    if (path == null) {
+      // Malformed.
+      request.response.close();
+      return;
+    }
 
     if (path == WEBSOCKET_PATH) {
       WebSocketTransformer.upgrade(request).then(
@@ -255,32 +298,34 @@
     }
   }
 
-  Future startup() {
+  Future startup() async {
     if (_server != null) {
       // Already running.
-      return new Future.value(this);
+      return this;
     }
 
-    var address = new InternetAddress(_ip);
     // Startup HTTP server.
-    return HttpServer.bind(address, _port).then((s) {
-      _server = s;
-      _server.listen(_requestHandler, cancelOnError: true);
-      var ip = _server.address.address;
-      var port = _server.port;
-      if (_displayMessages) {
-        print('Observatory listening on http://$ip:$port');
+    try {
+      var addresses = await InternetAddress.lookup(_ip);
+      var address;
+      // Prefer IPv4 addresses.
+      for (var i = 0; i < addresses.length; i++) {
+        address = addresses[i];
+        if (address.type == InternetAddressType.IP_V4) break;
       }
+      _server = await HttpServer.bind(address, _port);
+      _server.listen(_requestHandler, cancelOnError: true);
+      print('Observatory listening on $serverAddress');
       // Server is up and running.
-      _notifyServerState(ip, _server.port);
-      onServerAddressChange('http://$ip:$port');
+      _notifyServerState(serverAddress.toString());
+      onServerAddressChange('$serverAddress');
       return this;
-    }).catchError((e, st) {
+    } catch (e, st) {
       print('Could not start Observatory HTTP server:\n$e\n$st\n');
-      _notifyServerState("", 0);
+      _notifyServerState("");
       onServerAddressChange(null);
       return this;
-    });
+    }
   }
 
   Future cleanup(bool force) {
@@ -296,24 +341,18 @@
       return new Future.value(this);
     }
 
-    // Force displaying of status messages if we are forcibly shutdown.
-    _displayMessages = _displayMessages || forced;
-
     // Shutdown HTTP server and subscription.
-    var ip = _server.address.address.toString();
-    var port = _server.port.toString();
+    Uri oldServerAddress = serverAddress;
     return cleanup(forced).then((_) {
-      if (_displayMessages) {
-        print('Observatory no longer listening on http://$ip:$port');
-      }
+      print('Observatory no longer listening on $oldServerAddress');
       _server = null;
-      _notifyServerState("", 0);
+      _notifyServerState("");
       onServerAddressChange(null);
       return this;
     }).catchError((e, st) {
       _server = null;
       print('Could not shutdown Observatory HTTP server:\n$e\n$st\n');
-      _notifyServerState("", 0);
+      _notifyServerState("");
       onServerAddressChange(null);
       return this;
     });
@@ -321,5 +360,5 @@
 
 }
 
-void _notifyServerState(String ip, int port)
+void _notifyServerState(String uri)
     native "VMServiceIO_NotifyServerState";
diff --git a/runtime/bin/vmservice/vmservice_io.dart b/runtime/bin/vmservice/vmservice_io.dart
index 7ae65d4..a883a73 100644
--- a/runtime/bin/vmservice/vmservice_io.dart
+++ b/runtime/bin/vmservice/vmservice_io.dart
@@ -162,6 +162,27 @@
   return result;
 }
 
+Future<Uri> serverInformationCallback() async {
+  _lazyServerBoot();
+  return server.serverAddress;
+}
+
+Future<Uri> webServerControlCallback(bool enable) async {
+  _lazyServerBoot();
+  if (server.running == enable) {
+    // No change.
+    return server.serverAddress;
+  }
+
+  if (enable) {
+    await server.startup();
+    return server.serverAddress;
+  } else {
+    await server.shutdown(true);
+    return server.serverAddress;
+  }
+}
+
 _clearFuture(_) {
   serverFuture = null;
 }
@@ -204,6 +225,8 @@
   VMServiceEmbedderHooks.writeStreamFile = writeStreamFileCallback;
   VMServiceEmbedderHooks.readFile = readFileCallback;
   VMServiceEmbedderHooks.listFiles = listFilesCallback;
+  VMServiceEmbedderHooks.serverInformation = serverInformationCallback;
+  VMServiceEmbedderHooks.webServerControl = webServerControlCallback;
   // Always instantiate the vmservice object so that the exit message
   // can be delivered and waiting loaders can be cancelled.
   var service = new VMService();
diff --git a/runtime/bin/vmservice_dartium.cc b/runtime/bin/vmservice_dartium.cc
index cd40dd7..613b005 100644
--- a/runtime/bin/vmservice_dartium.cc
+++ b/runtime/bin/vmservice_dartium.cc
@@ -22,8 +22,7 @@
     Dart_ExitScope();                                                          \
     Dart_ShutdownIsolate();                                                    \
     return 0;                                                                  \
-  }                                                                            \
-
+  }
 
 
 static const char* DEFAULT_VM_SERVICE_SERVER_IP = "127.0.0.1";
@@ -43,16 +42,12 @@
 Dart_Isolate VmServiceServer::CreateIsolate(const uint8_t* snapshot_buffer) {
   ASSERT(snapshot_buffer != NULL);
   // Create the isolate.
-  IsolateData* isolate_data = new IsolateData(DART_VM_SERVICE_ISOLATE_NAME,
-                                              NULL,
-                                              NULL);
+  IsolateData* isolate_data =
+      new IsolateData(DART_VM_SERVICE_ISOLATE_NAME, NULL, NULL);
   char* error = 0;
-  Dart_Isolate isolate = Dart_CreateIsolate(DART_VM_SERVICE_ISOLATE_NAME,
-                                            "main",
-                                            snapshot_buffer,
-                                            NULL,
-                                            isolate_data,
-                                            &error);
+  Dart_Isolate isolate =
+      Dart_CreateIsolate(DART_VM_SERVICE_ISOLATE_NAME, "main", snapshot_buffer,
+                         NULL, isolate_data, &error);
   if (!isolate) {
     fprintf(stderr, "Dart_CreateIsolate failed: %s\n", error);
     return 0;
@@ -63,12 +58,11 @@
   Builtin::SetNativeResolver(Builtin::kIOLibrary);
 
   ASSERT(Dart_IsServiceIsolate(isolate));
-  if (!VmService::Setup(DEFAULT_VM_SERVICE_SERVER_IP,
-                        DEFAULT_VM_SERVICE_SERVER_PORT,
-                        false /* running_precompiled */,
-                        false /* disable origin checks */)) {
-    fprintf(stderr,
-            "Vmservice::Setup failed: %s\n", VmService::GetErrorMessage());
+  if (!VmService::Setup(
+          DEFAULT_VM_SERVICE_SERVER_IP, DEFAULT_VM_SERVICE_SERVER_PORT,
+          false /* running_precompiled */, false /* disable origin checks */)) {
+    fprintf(stderr, "Vmservice::Setup failed: %s\n",
+            VmService::GetErrorMessage());
     isolate = NULL;
   }
   Dart_ExitScope();
@@ -77,13 +71,8 @@
 }
 
 
-const char* VmServiceServer::GetServerIP() {
-  return VmService::GetServerIP();
-}
-
-
-intptr_t VmServiceServer::GetServerPort() {
-  return VmService::GetServerPort();
+const char* VmServiceServer::GetServerAddress() {
+  return VmService::GetServerAddress();
 }
 
 
@@ -151,7 +140,7 @@
 
 
 /* DISALLOW_ALLOCATION */
-void VmServiceServer::operator delete(void* pointer)  {
+void VmServiceServer::operator delete(void* pointer) {
   fprintf(stderr, "unreachable code\n");
   abort();
 }
diff --git a/runtime/bin/vmservice_dartium.h b/runtime/bin/vmservice_dartium.h
index 11067ee..472df34 100644
--- a/runtime/bin/vmservice_dartium.h
+++ b/runtime/bin/vmservice_dartium.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_VMSERVICE_DARTIUM_H_
-#define BIN_VMSERVICE_DARTIUM_H_
+#ifndef RUNTIME_BIN_VMSERVICE_DARTIUM_H_
+#define RUNTIME_BIN_VMSERVICE_DARTIUM_H_
 
 /* In order to avoid conflicts / issues with blink, no headers are included */
 
@@ -18,18 +18,20 @@
   static void Bootstrap();
   static Dart_Isolate CreateIsolate(const uint8_t* snapshot_buffer);
 
-  static const char* GetServerIP();
-  static intptr_t GetServerPort();
+  static const char* GetServerAddress();
 
-  static void DecompressAssets(const uint8_t* input, unsigned int input_len,
-                               uint8_t** output, unsigned int* output_length);
+  static void DecompressAssets(const uint8_t* input,
+                               unsigned int input_len,
+                               uint8_t** output,
+                               unsigned int* output_length);
 
-/* DISALLOW_ALLOCATION */
+  /* DISALLOW_ALLOCATION */
   void operator delete(void* pointer);
+
  private:
   void* operator new(size_t size);
 
-/* DISALLOW_IMPLICIT_CONSTRUCTORS */
+  /* DISALLOW_IMPLICIT_CONSTRUCTORS */
   VmServiceServer();
   VmServiceServer(const VmServiceServer&);
   void operator=(const VmServiceServer&);
@@ -38,4 +40,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_VMSERVICE_DARTIUM_H_
+#endif  // RUNTIME_BIN_VMSERVICE_DARTIUM_H_
diff --git a/runtime/bin/vmservice_impl.cc b/runtime/bin/vmservice_impl.cc
index 871a91c..acbcba9 100644
--- a/runtime/bin/vmservice_impl.cc
+++ b/runtime/bin/vmservice_impl.cc
@@ -17,17 +17,17 @@
 namespace dart {
 namespace bin {
 
-#define RETURN_ERROR_HANDLE(handle)                             \
-  if (Dart_IsError(handle)) {                                   \
-    return handle;                                              \
+#define RETURN_ERROR_HANDLE(handle)                                            \
+  if (Dart_IsError(handle)) {                                                  \
+    return handle;                                                             \
   }
 
-#define SHUTDOWN_ON_ERROR(handle)                               \
-  if (Dart_IsError(handle)) {                                   \
-    error_msg_ = strdup(Dart_GetError(handle));                 \
-    Dart_ExitScope();                                           \
-    Dart_ShutdownIsolate();                                     \
-    return false;                                               \
+#define SHUTDOWN_ON_ERROR(handle)                                              \
+  if (Dart_IsError(handle)) {                                                  \
+    error_msg_ = strdup(Dart_GetError(handle));                                \
+    Dart_ExitScope();                                                          \
+    Dart_ShutdownIsolate();                                                    \
+    return false;                                                              \
   }
 
 #define kLibrarySourceNamePrefix "/vmservice"
@@ -91,27 +91,20 @@
 
 void NotifyServerState(Dart_NativeArguments args) {
   Dart_EnterScope();
-  const char* ip_chars;
-  Dart_Handle ip_arg = Dart_GetNativeArgument(args, 0);
-  if (Dart_IsError(ip_arg)) {
-    VmService::SetServerIPAndPort("", 0);
+  const char* uri_chars;
+  Dart_Handle uri_arg = Dart_GetNativeArgument(args, 0);
+  if (Dart_IsError(uri_arg)) {
+    VmService::SetServerAddress("");
     Dart_ExitScope();
     return;
   }
-  Dart_Handle result = Dart_StringToCString(ip_arg, &ip_chars);
+  Dart_Handle result = Dart_StringToCString(uri_arg, &uri_chars);
   if (Dart_IsError(result)) {
-    VmService::SetServerIPAndPort("", 0);
+    VmService::SetServerAddress("");
     Dart_ExitScope();
     return;
   }
-  Dart_Handle port_arg = Dart_GetNativeArgument(args, 1);
-  if (Dart_IsError(port_arg)) {
-    VmService::SetServerIPAndPort("", 0);
-    Dart_ExitScope();
-    return;
-  }
-  int64_t port = DartUtils::GetInt64ValueCheckRange(port_arg, 0, 65535);
-  VmService::SetServerIPAndPort(ip_chars, port);
+  VmService::SetServerAddress(uri_chars);
   Dart_ExitScope();
 }
 
@@ -129,8 +122,8 @@
 
 
 static VmServiceIONativeEntry _VmServiceIONativeEntries[] = {
-  {"VMServiceIO_NotifyServerState", 2, NotifyServerState},
-  {"VMServiceIO_Shutdown", 0, Shutdown },
+    {"VMServiceIO_NotifyServerState", 1, NotifyServerState},
+    {"VMServiceIO_Shutdown", 0, Shutdown},
 };
 
 
@@ -156,14 +149,14 @@
 
 
 const char* VmService::error_msg_ = NULL;
-char VmService::server_ip_[kServerIpStringBufferSize];
-intptr_t VmService::server_port_ = 0;
+char VmService::server_uri_[kServerUriStringBufferSize];
 
 
 bool VmService::LoadForGenPrecompiled() {
   Dart_Handle result;
   Dart_SetLibraryTagHandler(LibraryTagHandler);
-  Dart_Handle library = LoadLibrary(kVMServiceIOLibraryScriptResourceName);
+  Dart_Handle library =
+      LookupOrLoadLibrary(kVMServiceIOLibraryScriptResourceName);
   ASSERT(library != Dart_Null());
   SHUTDOWN_ON_ERROR(library);
   result = Dart_SetNativeResolver(library, VmServiceIONativeResolver, NULL);
@@ -180,7 +173,7 @@
                       bool dev_mode_server) {
   Dart_Isolate isolate = Dart_CurrentIsolate();
   ASSERT(isolate != NULL);
-  SetServerIPAndPort("", 0);
+  SetServerAddress("");
 
   Dart_Handle result;
 
@@ -238,15 +231,13 @@
   }
   result = DartUtils::SetIntegerField(library, "_port", server_port);
   SHUTDOWN_ON_ERROR(result);
-  result = Dart_SetField(library,
-                         DartUtils::NewString("_autoStart"),
+  result = Dart_SetField(library, DartUtils::NewString("_autoStart"),
                          Dart_NewBoolean(auto_start));
   SHUTDOWN_ON_ERROR(result);
-  result = Dart_SetField(library,
-                         DartUtils::NewString("_originCheckDisabled"),
+  result = Dart_SetField(library, DartUtils::NewString("_originCheckDisabled"),
                          Dart_NewBoolean(dev_mode_server));
 
-  // Are we running on Windows?
+// Are we running on Windows?
 #if defined(TARGET_OS_WINDOWS)
   Dart_Handle is_windows = Dart_True();
 #else
@@ -256,7 +247,7 @@
       Dart_SetField(library, DartUtils::NewString("_isWindows"), is_windows);
   SHUTDOWN_ON_ERROR(result);
 
-  // Are we running on Fuchsia?
+// Are we running on Fuchsia?
 #if defined(TARGET_OS_FUCHSIA)
   Dart_Handle is_fuchsia = Dart_True();
 #else
@@ -278,8 +269,7 @@
   SHUTDOWN_ON_ERROR(signal_watch);
   Dart_Handle field_name = Dart_NewStringFromCString("_signalWatch");
   SHUTDOWN_ON_ERROR(field_name);
-  result =
-      Dart_SetField(library, field_name, signal_watch);
+  result = Dart_SetField(library, field_name, signal_watch);
   SHUTDOWN_ON_ERROR(field_name);
   return true;
 }
@@ -290,20 +280,24 @@
 }
 
 
-void VmService::SetServerIPAndPort(const char* ip, intptr_t port) {
-  if (ip == NULL) {
-    ip = "";
+void VmService::SetServerAddress(const char* server_uri) {
+  if (server_uri == NULL) {
+    server_uri = "";
   }
-  strncpy(server_ip_, ip, kServerIpStringBufferSize);
-  server_ip_[kServerIpStringBufferSize - 1] = '\0';
-  server_port_ = port;
+  const intptr_t server_uri_len = strlen(server_uri);
+  if (server_uri_len >= (kServerUriStringBufferSize - 1)) {
+    FATAL1("vm-service: Server URI exceeded length: %s\n", server_uri);
+  }
+  strncpy(server_uri_, server_uri, kServerUriStringBufferSize);
+  server_uri_[kServerUriStringBufferSize - 1] = '\0';
 }
 
 
 Dart_Handle VmService::GetSource(const char* name) {
   const intptr_t kBufferSize = 512;
   char buffer[kBufferSize];
-  snprintf(&buffer[0], kBufferSize-1, "%s/%s", kLibrarySourceNamePrefix, name);
+  snprintf(&buffer[0], kBufferSize - 1, "%s/%s", kLibrarySourceNamePrefix,
+           name);
   const char* vmservice_source = NULL;
   int r = Resources::ResourceLookup(buffer, &vmservice_source);
   if (r == Resources::kNoSuchInstance) {
@@ -321,10 +315,14 @@
 }
 
 
-Dart_Handle VmService::LoadLibrary(const char* name) {
+Dart_Handle VmService::LookupOrLoadLibrary(const char* name) {
   Dart_Handle uri = Dart_NewStringFromCString(kVMServiceIOLibraryUri);
-  Dart_Handle source = GetSource(name);
-  return Dart_LoadLibrary(uri, Dart_Null(), source, 0, 0);
+  Dart_Handle library = Dart_LookupLibrary(uri);
+  if (!Dart_IsLibrary(library)) {
+    Dart_Handle source = GetSource(name);
+    library = Dart_LoadLibrary(uri, Dart_Null(), source, 0, 0);
+  }
+  return library;
 }
 
 
diff --git a/runtime/bin/vmservice_impl.h b/runtime/bin/vmservice_impl.h
index f499abf..8bdc81e 100644
--- a/runtime/bin/vmservice_impl.h
+++ b/runtime/bin/vmservice_impl.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef BIN_VMSERVICE_IMPL_H_
-#define BIN_VMSERVICE_IMPL_H_
+#ifndef RUNTIME_BIN_VMSERVICE_IMPL_H_
+#define RUNTIME_BIN_VMSERVICE_IMPL_H_
 
 #include "include/dart_api.h"
 
@@ -24,33 +24,26 @@
   // Error message if startup failed.
   static const char* GetErrorMessage();
 
-  // HTTP server's IP.
-  static const char* GetServerIP() {
-    return &server_ip_[0];
-  }
-
-  // HTTP server's port.
-  static intptr_t GetServerPort() {
-    return server_port_;
-  }
+  // HTTP Server's address.
+  static const char* GetServerAddress() { return &server_uri_[0]; }
 
  private:
-  static const intptr_t kServerIpStringBufferSize = 256;
+  static const intptr_t kServerUriStringBufferSize = 1024;
   friend void NotifyServerState(Dart_NativeArguments args);
 
-  static void SetServerIPAndPort(const char* ip, intptr_t port);
+  static void SetServerAddress(const char* server_uri_);
   static Dart_Handle GetSource(const char* name);
   static Dart_Handle LoadScript(const char* name);
-  static Dart_Handle LoadLibrary(const char* name);
+  static Dart_Handle LookupOrLoadLibrary(const char* name);
   static Dart_Handle LoadSource(Dart_Handle library, const char* name);
   static Dart_Handle LoadResources(Dart_Handle library);
   static Dart_Handle LoadResource(Dart_Handle library, const char* name);
-  static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag, Dart_Handle library,
+  static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag,
+                                       Dart_Handle library,
                                        Dart_Handle url);
 
   static const char* error_msg_;
-  static char server_ip_[kServerIpStringBufferSize];
-  static intptr_t server_port_;
+  static char server_uri_[kServerUriStringBufferSize];
 
   DISALLOW_ALLOCATION();
   DISALLOW_IMPLICIT_CONSTRUCTORS(VmService);
@@ -59,4 +52,4 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // BIN_VMSERVICE_IMPL_H_
+#endif  // RUNTIME_BIN_VMSERVICE_IMPL_H_
diff --git a/runtime/bin/zlib/BUILD.gn b/runtime/bin/zlib/BUILD.gn
index ad78238..8950ae1 100644
--- a/runtime/bin/zlib/BUILD.gn
+++ b/runtime/bin/zlib/BUILD.gn
@@ -49,8 +49,6 @@
   all_dependent_configs = [ ":zlib_config" ]
 
   if (is_clang) {
-    cflags = [
-      "-Wno-shift-negative-value",
-    ]
+    cflags = [ "-Wno-shift-negative-value" ]
   }
 }
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
old mode 100755
new mode 100644
index c9c0d1a..93d6da5
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -4,8 +4,8 @@
  * BSD-style license that can be found in the LICENSE file.
  */
 
-#ifndef INCLUDE_DART_API_H_
-#define INCLUDE_DART_API_H_
+#ifndef RUNTIME_INCLUDE_DART_API_H_
+#define RUNTIME_INCLUDE_DART_API_H_
 
 /** \mainpage Dart Embedding API Reference
  *
@@ -54,8 +54,8 @@
 #include <stdbool.h>
 #if __GNUC__ >= 4
 #if defined(DART_SHARED_LIB)
-#define DART_EXPORT DART_EXTERN_C __attribute__ ((visibility("default"))) \
-    __attribute((used))
+#define DART_EXPORT                                                            \
+  DART_EXTERN_C __attribute__((visibility("default"))) __attribute((used))
 #else
 #define DART_EXPORT DART_EXTERN_C
 #endif
@@ -418,10 +418,10 @@
   {                                                                            \
     Dart_Handle __handle = handle;                                             \
     if (Dart_IsError((__handle))) {                                            \
-      _Dart_ReportErrorHandle(__FILE__, __LINE__,                              \
-                              #handle, Dart_GetError(__handle));               \
+      _Dart_ReportErrorHandle(__FILE__, __LINE__, #handle,                     \
+                              Dart_GetError(__handle));                        \
     }                                                                          \
-  }                                                                            \
+  }
 
 /**
  * Converts an object to a string.
@@ -467,8 +467,8 @@
 /**
  * Allocates a handle in the current scope from a weak persistent handle.
  */
-DART_EXPORT Dart_Handle Dart_HandleFromWeakPersistent(
-    Dart_WeakPersistentHandle object);
+DART_EXPORT Dart_Handle
+Dart_HandleFromWeakPersistent(Dart_WeakPersistentHandle object);
 
 /**
  * Allocates a persistent handle for an object.
@@ -532,11 +532,11 @@
  * \return The weak persistent handle or NULL. NULL is returned in case of bad
  *   parameters.
  */
-DART_EXPORT Dart_WeakPersistentHandle Dart_NewWeakPersistentHandle(
-    Dart_Handle object,
-    void* peer,
-    intptr_t external_allocation_size,
-    Dart_WeakPersistentHandleFinalizer callback);
+DART_EXPORT Dart_WeakPersistentHandle
+Dart_NewWeakPersistentHandle(Dart_Handle object,
+                             void* peer,
+                             intptr_t external_allocation_size,
+                             Dart_WeakPersistentHandleFinalizer callback);
 
 DART_EXPORT void Dart_DeleteWeakPersistentHandle(
     Dart_Isolate isolate,
@@ -582,9 +582,9 @@
  * \return Success if the callbacks were added.  Otherwise, returns an
  *   error handle.
  */
-DART_EXPORT Dart_Handle Dart_SetGcCallbacks(
-    Dart_GcPrologueCallback prologue_callback,
-    Dart_GcEpilogueCallback epilogue_callback);
+DART_EXPORT Dart_Handle
+Dart_SetGcCallbacks(Dart_GcPrologueCallback prologue_callback,
+                    Dart_GcEpilogueCallback epilogue_callback);
 
 
 /*
@@ -793,19 +793,19 @@
  *    See Dart_GetVMServiceAssetsArchive.
  */
 typedef struct {
-    int32_t version;
-    const uint8_t* vm_isolate_snapshot;
-    const uint8_t* instructions_snapshot;
-    const uint8_t* data_snapshot;
-    Dart_IsolateCreateCallback create;
-    Dart_IsolateShutdownCallback shutdown;
-    Dart_ThreadExitCallback thread_exit;
-    Dart_FileOpenCallback file_open;
-    Dart_FileReadCallback file_read;
-    Dart_FileWriteCallback file_write;
-    Dart_FileCloseCallback file_close;
-    Dart_EntropySource entropy_source;
-    Dart_GetVMServiceAssetsArchive get_service_assets;
+  int32_t version;
+  const uint8_t* vm_isolate_snapshot;
+  const uint8_t* instructions_snapshot;
+  const uint8_t* data_snapshot;
+  Dart_IsolateCreateCallback create;
+  Dart_IsolateShutdownCallback shutdown;
+  Dart_ThreadExitCallback thread_exit;
+  Dart_FileOpenCallback file_open;
+  Dart_FileReadCallback file_read;
+  Dart_FileWriteCallback file_write;
+  Dart_FileCloseCallback file_close;
+  Dart_EntropySource entropy_source;
+  Dart_GetVMServiceAssetsArchive get_service_assets;
 } Dart_InitializeParams;
 
 /**
@@ -854,7 +854,9 @@
  *
  * A snapshot can be used to restore the VM quickly to a saved state
  * and is useful for fast startup. If snapshot data is provided, the
- * isolate will be started using that snapshot data.
+ * isolate will be started using that snapshot data. Requires a core snapshot or
+ * an app snapshot created by Dart_CreateSnapshot or
+ * Dart_CreatePrecompiledSnapshot* from a VM with the same version.
  *
  * Requires there to be no current isolate.
  *
@@ -871,7 +873,7 @@
  * \param error DOCUMENT
  *
  * \return The new isolate is returned. May be NULL if an error
- *   occurs duing isolate initialization.
+ *   occurs during isolate initialization.
  */
 DART_EXPORT Dart_Isolate Dart_CreateIsolate(const char* script_uri,
                                             const char* main,
@@ -883,6 +885,35 @@
  * isolate. */
 
 /**
+ * Creates a new isolate from a Dart Kernel file. The new isolate
+ * becomes the current isolate.
+ *
+ * Requires there to be no current isolate.
+ *
+ * After this call, the `kernel_program` needs to be supplied to a call to
+ * `Dart_LoadKernel()` which will then take ownership of the memory.
+ *
+ * \param script_uri The name of the script this isolate will load.
+ *   Provided only for advisory purposes to improve debugging messages.
+ * \param main The name of the main entry point this isolate will run.
+ *   Provided only for advisory purposes to improve debugging messages.
+ * \param kernel_program The `dart::kernel::Program` object.
+ * \param flags Pointer to VM specific flags or NULL for default flags.
+ * \param callback_data Embedder data.  This data will be passed to
+ *   the Dart_IsolateCreateCallback when new isolates are spawned from
+ *   this parent isolate.
+ * \param error DOCUMENT
+ *
+ * \return The new isolate is returned. May be NULL if an error
+ *   occurs during isolate initialization.
+ */
+DART_EXPORT Dart_Isolate Dart_CreateIsolateFromKernel(const char* script_uri,
+                                                      const char* main,
+                                                      void* kernel_program,
+                                                      Dart_IsolateFlags* flags,
+                                                      void* callback_data,
+                                                      char** error);
+/**
  * Shuts down the current isolate. After this call, the current isolate
  * is NULL. Invokes the shutdown callback and any callbacks of remaining
  * weak persistent handles.
@@ -977,11 +1008,11 @@
  *
  * \return A valid handle if no error occurs during the operation.
  */
-DART_EXPORT Dart_Handle Dart_CreateSnapshot(
-    uint8_t** vm_isolate_snapshot_buffer,
-    intptr_t* vm_isolate_snapshot_size,
-    uint8_t** isolate_snapshot_buffer,
-    intptr_t* isolate_snapshot_size);
+DART_EXPORT Dart_Handle
+Dart_CreateSnapshot(uint8_t** vm_isolate_snapshot_buffer,
+                    intptr_t* vm_isolate_snapshot_size,
+                    uint8_t** isolate_snapshot_buffer,
+                    intptr_t* isolate_snapshot_size);
 
 /**
  * Creates a snapshot of the application script loaded in the isolate.
@@ -1062,7 +1093,7 @@
  * ILLEGAL_PORT is a port number guaranteed never to be associated with a valid
  * port.
  */
-#define ILLEGAL_PORT ((Dart_Port) 0)
+#define ILLEGAL_PORT ((Dart_Port)0)
 
 /**
  * A message notification callback.
@@ -1432,7 +1463,7 @@
 DART_EXPORT bool Dart_IsDouble(Dart_Handle object);
 DART_EXPORT bool Dart_IsBoolean(Dart_Handle object);
 DART_EXPORT bool Dart_IsString(Dart_Handle object);
-DART_EXPORT bool Dart_IsStringLatin1(Dart_Handle object);  /* (ISO-8859-1) */
+DART_EXPORT bool Dart_IsStringLatin1(Dart_Handle object); /* (ISO-8859-1) */
 DART_EXPORT bool Dart_IsExternalString(Dart_Handle object);
 DART_EXPORT bool Dart_IsList(Dart_Handle object);
 DART_EXPORT bool Dart_IsMap(Dart_Handle object);
@@ -1716,11 +1747,11 @@
  * \return The String object if no error occurs. Otherwise returns
  *   an error handle.
  */
-DART_EXPORT Dart_Handle Dart_NewExternalLatin1String(
-    const uint8_t* latin1_array,
-    intptr_t length,
-    void* peer,
-    Dart_PeerFinalizer cback);
+DART_EXPORT Dart_Handle
+Dart_NewExternalLatin1String(const uint8_t* latin1_array,
+                             intptr_t length,
+                             void* peer,
+                             Dart_PeerFinalizer cback);
 
 /**
  * Returns a String which references an external array of UTF-16 encoded
@@ -1838,12 +1869,12 @@
  *  result = Dart_MakeExternalString(str, data, size, NULL, NULL);
  *
  */
-DART_EXPORT Dart_Handle Dart_MakeExternalString(
-    Dart_Handle str,
-    void* array,
-    intptr_t external_allocation_size,
-    void* peer,
-    Dart_PeerFinalizer cback);
+DART_EXPORT Dart_Handle
+Dart_MakeExternalString(Dart_Handle str,
+                        void* array,
+                        intptr_t external_allocation_size,
+                        void* peer,
+                        Dart_PeerFinalizer cback);
 
 /**
  * Retrieves some properties associated with a String.
@@ -1905,8 +1936,7 @@
  * \return The Object in the List at the specified index if no error
  *   occurs. Otherwise returns an error handle.
  */
-DART_EXPORT Dart_Handle Dart_ListGetAt(Dart_Handle list,
-                                       intptr_t index);
+DART_EXPORT Dart_Handle Dart_ListGetAt(Dart_Handle list, intptr_t index);
 
 /**
 * Gets a range of Objects from a List.
@@ -2042,8 +2072,8 @@
  * \return kInvalid if the object is not an external TypedData object or
  *   the appropriate Dart_TypedData_Type.
  */
-DART_EXPORT Dart_TypedData_Type Dart_GetTypeOfExternalTypedData(
-    Dart_Handle object);
+DART_EXPORT Dart_TypedData_Type
+Dart_GetTypeOfExternalTypedData(Dart_Handle object);
 
 /**
  * Returns a TypedData object of the desired length and type.
@@ -2181,10 +2211,10 @@
  * \return The new object. If an error occurs during execution, then an
  *   error handle is returned.
  */
-DART_EXPORT Dart_Handle Dart_AllocateWithNativeFields(
-    Dart_Handle type,
-    intptr_t num_native_fields,
-    const intptr_t* native_fields);
+DART_EXPORT Dart_Handle
+Dart_AllocateWithNativeFields(Dart_Handle type,
+                              intptr_t num_native_fields,
+                              const intptr_t* native_fields);
 
 /**
  * Invokes a method or function.
@@ -2273,8 +2303,7 @@
  * \return If no error occurs, then the value of the field is
  *   returned. Otherwise an error handle is returned.
  */
-DART_EXPORT Dart_Handle Dart_GetField(Dart_Handle container,
-                                      Dart_Handle name);
+DART_EXPORT Dart_Handle Dart_GetField(Dart_Handle container, Dart_Handle name);
 
 /**
  * Sets the value of a field.
@@ -2446,7 +2475,7 @@
 #define BITMASK(size) ((1 << size) - 1)
 #define DART_NATIVE_ARG_DESCRIPTOR(type, position)                             \
   (((type & BITMASK(kNativeArgTypeSize)) << kNativeArgTypePos) |               \
-    (position & BITMASK(kNativeArgNumberSize)))
+   (position & BITMASK(kNativeArgNumberSize)))
 
 /**
  * Gets the native arguments based on the types passed in and populates
@@ -2469,11 +2498,11 @@
  *   returns an error handle if there were any errors while extracting the
  *   arguments (mismatched number of arguments, incorrect types, etc.).
  */
-DART_EXPORT Dart_Handle Dart_GetNativeArguments(
-    Dart_NativeArguments args,
-    int num_arguments,
-    const Dart_NativeArgument_Descriptor* arg_descriptors,
-    Dart_NativeArgument_Value* arg_values);
+DART_EXPORT Dart_Handle
+Dart_GetNativeArguments(Dart_NativeArguments args,
+                        int num_arguments,
+                        const Dart_NativeArgument_Descriptor* arg_descriptors,
+                        Dart_NativeArgument_Value* arg_values);
 
 
 /**
@@ -2500,11 +2529,11 @@
  *   null object then 0 is copied as the native field values into the
  *   'field_values' array.
  */
-DART_EXPORT Dart_Handle Dart_GetNativeFieldsOfArgument(
-    Dart_NativeArguments args,
-    int arg_index,
-    int num_fields,
-    intptr_t* field_values);
+DART_EXPORT Dart_Handle
+Dart_GetNativeFieldsOfArgument(Dart_NativeArguments args,
+                               int arg_index,
+                               int num_fields,
+                               intptr_t* field_values);
 
 /**
  * Gets the native field of the receiver.
@@ -2657,8 +2686,8 @@
  * the const constructors bool.fromEnvironment, int.fromEnvironment
  * and String.fromEnvironment.
  */
-DART_EXPORT Dart_Handle Dart_SetEnvironmentCallback(
-    Dart_EnvironmentCallback callback);
+DART_EXPORT Dart_Handle
+Dart_SetEnvironmentCallback(Dart_EnvironmentCallback callback);
 
 /**
  * Sets the callback used to resolve native functions for a library.
@@ -2668,13 +2697,37 @@
  *
  * \return A valid handle if the native resolver was set successfully.
  */
-DART_EXPORT Dart_Handle Dart_SetNativeResolver(
-    Dart_Handle library,
-    Dart_NativeEntryResolver resolver,
-    Dart_NativeEntrySymbol symbol);
+DART_EXPORT Dart_Handle
+Dart_SetNativeResolver(Dart_Handle library,
+                       Dart_NativeEntryResolver resolver,
+                       Dart_NativeEntrySymbol symbol);
 /* TODO(turnidge): Rename to Dart_LibrarySetNativeResolver? */
 
 
+/**
+ * Returns the callback used to resolve native functions for a library.
+ *
+ * \param library A library.
+ * \param resolver a pointer to a Dart_NativeEntryResolver
+ *
+ * \return A valid handle if the library was found.
+ */
+DART_EXPORT Dart_Handle
+Dart_GetNativeResolver(Dart_Handle library, Dart_NativeEntryResolver* resolver);
+
+
+/**
+ * Returns the callback used to resolve native function symbols for a library.
+ *
+ * \param library A library.
+ * \param resolver a pointer to a Dart_NativeEntrySymbol.
+ *
+ * \return A valid handle if the library was found.
+ */
+DART_EXPORT Dart_Handle Dart_GetNativeSymbol(Dart_Handle library,
+                                             Dart_NativeEntrySymbol* resolver);
+
+
 /*
  * =====================
  * Scripts and Libraries
@@ -2706,7 +2759,8 @@
  * Dart_kScriptTag
  *
  * This tag indicates that the root script should be loaded from
- * 'url'.  The 'library' parameter will always be null.  Once the root
+ * 'url'.  If the 'library' parameter is not null, it is the url of the
+ * package map that should be used when loading.  Once the root
  * script is loaded, the embedder should call Dart_LoadScript to
  * install the root script in the VM.  The return value should be an
  * error or null.
@@ -2725,9 +2779,10 @@
  * call Dart_LoadLibrary to provide the script source to the VM.  The
  * return value should be an error or null.
  */
-typedef Dart_Handle (*Dart_LibraryTagHandler)(Dart_LibraryTag tag,
-                                              Dart_Handle library,
-                                              Dart_Handle url);
+typedef Dart_Handle (*Dart_LibraryTagHandler)(
+    Dart_LibraryTag tag,
+    Dart_Handle library_or_package_map_url,
+    Dart_Handle url);
 
 /**
  * Sets library tag handler for the current isolate. This handler is
@@ -2742,8 +2797,8 @@
  *
  * TODO(turnidge): Document.
  */
-DART_EXPORT Dart_Handle Dart_SetLibraryTagHandler(
-    Dart_LibraryTagHandler handler);
+DART_EXPORT Dart_Handle
+Dart_SetLibraryTagHandler(Dart_LibraryTagHandler handler);
 
 /**
  * Canonicalizes a url with respect to some library.
@@ -2795,10 +2850,12 @@
                                         intptr_t col_offset);
 
 /**
- * Loads the root script for current isolate from a snapshot.
+ * Loads the root script for current isolate from a script snapshot. The
+ * snapshot must have been created by Dart_CreateScriptSnapshot from a VM with
+ * the same version.
  *
  * \param buffer A buffer which contains a snapshot of the script.
- * \param length Length of the passed in buffer.
+ * \param buffer_len Length of the passed in buffer.
  *
  * \return If no error occurs, the Library object corresponding to the root
  *   script is returned. Otherwise an error handle is returned.
@@ -2807,6 +2864,31 @@
                                                     intptr_t buffer_len);
 
 /**
+ * Loads a dart application via an in-memory kernel program.
+ *
+ * \param kernel_program The kernel program obtained via
+ *        `Dart_ReadKernelBinary`.
+ *
+ * The VM will take ownership of the `kernel_program` object.
+ *
+ * \return If no error occurs, the Library object corresponding to the root
+ *   script is returned. Otherwise an error handle is returned.
+ */
+DART_EXPORT Dart_Handle Dart_LoadKernel(void* kernel_program);
+
+
+/**
+ * Constructs an in-memory kernel program form a binary.
+ *
+ * \param buffer The start of a memory buffer containing the binary format.
+ * \param buffer_len The length of the memory buffer.
+ *
+ * \return kernel_program The `dart::kernel::Program` object.
+ */
+DART_EXPORT void* Dart_ReadKernelBinary(const uint8_t* buffer,
+                                        intptr_t buffer_len);
+
+/**
  * Gets the library for the root script for the current isolate.
  *
  * If the root script has not yet been set for the current isolate,
@@ -2863,6 +2945,13 @@
  */
 DART_EXPORT Dart_Handle Dart_LibraryUrl(Dart_Handle library);
 
+
+/**
+ * \return An array of libraries.
+ */
+DART_EXPORT Dart_Handle Dart_GetLoadedLibraries();
+
+
 DART_EXPORT Dart_Handle Dart_LookupLibrary(Dart_Handle url);
 /* TODO(turnidge): Consider returning Dart_Null() when the library is
  * not found to distinguish that from a true error case. */
@@ -2928,6 +3017,19 @@
                                                   Dart_Handle import,
                                                   Dart_Handle prefix);
 
+
+/**
+ * Returns a flattened list of pairs. The first element in each pair is the
+ * importing library and and the second element is the imported library for each
+ * import in the isolate of a library whose URI's scheme is [scheme].
+ *
+ * Requires there to be a current isolate.
+ *
+ * \return A handle to a list of flattened pairs of importer-importee.
+ */
+DART_EXPORT Dart_Handle Dart_GetImportsOfScheme(Dart_Handle scheme);
+
+
 /**
  * Called by the embedder to provide the source for a "part of"
  * directive.  This function should be called in response to a
@@ -3090,9 +3192,8 @@
  * \return An error handle if a compilation error or runtime error running const
  * constructors was encountered.
  */
-DART_EXPORT Dart_Handle Dart_Precompile(
-    Dart_QualifiedFunctionName entry_points[],
-    bool reset_fields);
+DART_EXPORT Dart_Handle
+Dart_Precompile(Dart_QualifiedFunctionName entry_points[], bool reset_fields);
 
 
 /**
@@ -3114,13 +3215,9 @@
  *
  * \return A valid handle if no error occurs during the operation.
  */
-DART_EXPORT Dart_Handle Dart_CreatePrecompiledSnapshotAssembly(
-    uint8_t** vm_isolate_snapshot_buffer,
-    intptr_t* vm_isolate_snapshot_size,
-    uint8_t** isolate_snapshot_buffer,
-    intptr_t* isolate_snapshot_size,
-    uint8_t** assembly_buffer,
-    intptr_t* assembly_size);
+DART_EXPORT Dart_Handle
+Dart_CreatePrecompiledSnapshotAssembly(uint8_t** assembly_buffer,
+                                       intptr_t* assembly_size);
 
 
 /**
@@ -3129,15 +3226,15 @@
  *  load with mmap. The instructions piece must be loaded with read and
  *  execute permissions; the rodata piece may be loaded as read-only.
  */
-DART_EXPORT Dart_Handle Dart_CreatePrecompiledSnapshotBlob(
-    uint8_t** vm_isolate_snapshot_buffer,
-    intptr_t* vm_isolate_snapshot_size,
-    uint8_t** isolate_snapshot_buffer,
-    intptr_t* isolate_snapshot_size,
-    uint8_t** instructions_blob_buffer,
-    intptr_t* instructions_blob_size,
-    uint8_t** rodata_blob_buffer,
-    intptr_t* rodata_blob_size);
+DART_EXPORT Dart_Handle
+Dart_CreatePrecompiledSnapshotBlob(uint8_t** vm_isolate_snapshot_buffer,
+                                   intptr_t* vm_isolate_snapshot_size,
+                                   uint8_t** isolate_snapshot_buffer,
+                                   intptr_t* isolate_snapshot_size,
+                                   uint8_t** instructions_blob_buffer,
+                                   intptr_t* instructions_blob_size,
+                                   uint8_t** rodata_blob_buffer,
+                                   intptr_t* rodata_blob_size);
 
 
 DART_EXPORT Dart_Handle Dart_PrecompileJIT();
@@ -3166,32 +3263,28 @@
  *
  * \return A valid handle if no error occurs during the operation.
  */
-DART_EXPORT Dart_Handle Dart_CreateAppJITSnapshot(
-    uint8_t** vm_isolate_snapshot_buffer,
-    intptr_t* vm_isolate_snapshot_size,
-    uint8_t** isolate_snapshot_buffer,
-    intptr_t* isolate_snapshot_size,
-    uint8_t** instructions_blob_buffer,
-    intptr_t* instructions_blob_size,
-    uint8_t** rodata_blob_buffer,
-    intptr_t* rodata_blob_size);
+DART_EXPORT Dart_Handle
+Dart_CreateAppJITSnapshot(uint8_t** vm_isolate_snapshot_buffer,
+                          intptr_t* vm_isolate_snapshot_size,
+                          uint8_t** isolate_snapshot_buffer,
+                          intptr_t* isolate_snapshot_size,
+                          uint8_t** instructions_blob_buffer,
+                          intptr_t* instructions_blob_size,
+                          uint8_t** rodata_blob_buffer,
+                          intptr_t* rodata_blob_size);
 
 
 /**
  *  Returns whether the VM only supports running from precompiled snapshots and
- *  not from any other kind of snapshot or no snapshot (that is, the VM was
+ *  not from any other kind of snapshot or from source (that is, the VM was
  *  compiled with DART_PRECOMPILED_RUNTIME).
  */
 DART_EXPORT bool Dart_IsPrecompiledRuntime();
 
 
 /**
- *  Returns whether the VM was initialized with a precompiled snapshot. Only
- *  valid after Dart_Initialize.
- *  DEPRECATED. This is currently used to disable Platform.executable and
- *  Platform.resolvedExecutable under precompilation to prevent process
- *  spawning tests from becoming fork-bombs.
+ *  Print a native stack trace. Used for crash handling.
  */
-DART_EXPORT bool Dart_IsRunningPrecompiledCode();
+DART_EXPORT void Dart_DumpNativeStackTrace(void* context);
 
-#endif  /* INCLUDE_DART_API_H_ */  /* NOLINT */
+#endif /* INCLUDE_DART_API_H_ */ /* NOLINT */
diff --git a/runtime/include/dart_mirrors_api.h b/runtime/include/dart_mirrors_api.h
index 3a4c9ce..517adb9 100644
--- a/runtime/include/dart_mirrors_api.h
+++ b/runtime/include/dart_mirrors_api.h
@@ -4,8 +4,8 @@
  * BSD-style license that can be found in the LICENSE file.
  */
 
-#ifndef INCLUDE_DART_MIRRORS_API_H_
-#define INCLUDE_DART_MIRRORS_API_H_
+#ifndef RUNTIME_INCLUDE_DART_MIRRORS_API_H_
+#define RUNTIME_INCLUDE_DART_MIRRORS_API_H_
 
 #include "include/dart_api.h"
 
@@ -139,4 +139,4 @@
 DART_EXPORT Dart_Handle Dart_ClosureFunction(Dart_Handle closure);
 
 
-#endif  /* INCLUDE_DART_MIRRORS_API_H_ */  /* NOLINT */
+#endif /* INCLUDE_DART_MIRRORS_API_H_ */ /* NOLINT */
diff --git a/runtime/include/dart_native_api.h b/runtime/include/dart_native_api.h
index 74237c1..fd0e0fb 100644
--- a/runtime/include/dart_native_api.h
+++ b/runtime/include/dart_native_api.h
@@ -4,8 +4,8 @@
  * BSD-style license that can be found in the LICENSE file.
  */
 
-#ifndef INCLUDE_DART_NATIVE_API_H_
-#define INCLUDE_DART_NATIVE_API_H_
+#ifndef RUNTIME_INCLUDE_DART_NATIVE_API_H_
+#define RUNTIME_INCLUDE_DART_NATIVE_API_H_
 
 #include "include/dart_api.h"
 
@@ -176,4 +176,4 @@
  */
 DART_EXPORT Dart_Handle Dart_ParseAll();
 
-#endif  /* INCLUDE_DART_NATIVE_API_H_ */  /* NOLINT */
+#endif /* INCLUDE_DART_NATIVE_API_H_ */ /* NOLINT */
diff --git a/runtime/include/dart_tools_api.h b/runtime/include/dart_tools_api.h
index edf8918..bfd8f89 100644
--- a/runtime/include/dart_tools_api.h
+++ b/runtime/include/dart_tools_api.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef INCLUDE_DART_TOOLS_API_H_
-#define INCLUDE_DART_TOOLS_API_H_
+#ifndef RUNTIME_INCLUDE_DART_TOOLS_API_H_
+#define RUNTIME_INCLUDE_DART_TOOLS_API_H_
 
 #include "include/dart_api.h"
 
@@ -18,7 +18,7 @@
  */
 
 
- /*
+/*
   * ========
   * Debugger
   * ========
@@ -155,9 +155,8 @@
  * \return A handle to string containing the source text if no error
  * occurs.
  */
-DART_EXPORT Dart_Handle Dart_ScriptGetSource(
-                            intptr_t library_id,
-                            Dart_Handle script_url_in);
+DART_EXPORT Dart_Handle Dart_ScriptGetSource(intptr_t library_id,
+                                             Dart_Handle script_url_in);
 
 
 /**
@@ -177,9 +176,8 @@
  *
  * \return A handle to an array or an error object.
  */
-DART_EXPORT Dart_Handle Dart_ScriptGetTokenInfo(
-                            intptr_t library_id,
-                            Dart_Handle script_url_in);
+DART_EXPORT Dart_Handle Dart_ScriptGetTokenInfo(intptr_t library_id,
+                                                Dart_Handle script_url_in);
 
 
 /**
@@ -205,9 +203,8 @@
  * \return A handle containing the breakpoint id, which is an integer
  * value, or an error object if a breakpoint could not be set.
  */
-DART_EXPORT Dart_Handle Dart_SetBreakpoint(
-                            Dart_Handle script_url,
-                            intptr_t line_number);
+DART_EXPORT Dart_Handle Dart_SetBreakpoint(Dart_Handle script_url,
+                                           intptr_t line_number);
 
 /**
  * Deletes the breakpoint with the given id \pb_id.
@@ -251,10 +248,9 @@
  * \return A handle containing the breakpoint id, which is an integer
  * value, or an error object if a breakpoint could not be set.
  */
-DART_EXPORT Dart_Handle Dart_SetBreakpointAtEntry(
-                            Dart_Handle library,
-                            Dart_Handle class_name,
-                            Dart_Handle function_name);
+DART_EXPORT Dart_Handle Dart_SetBreakpointAtEntry(Dart_Handle library,
+                                                  Dart_Handle class_name,
+                                                  Dart_Handle function_name);
 
 
 /**
@@ -266,10 +262,9 @@
  *
  * \return A handle to the True object if no error occurs.
  */
-DART_EXPORT Dart_Handle Dart_OneTimeBreakAtEntry(
-                            Dart_Handle library,
-                            Dart_Handle class_name,
-                            Dart_Handle function_name);
+DART_EXPORT Dart_Handle Dart_OneTimeBreakAtEntry(Dart_Handle library,
+                                                 Dart_Handle class_name,
+                                                 Dart_Handle function_name);
 
 
 /**
@@ -305,8 +300,7 @@
  *
  * Requires there to be a current isolate.
  */
-DART_EXPORT void Dart_SetPausedEventHandler(
-                            Dart_PausedEventHandler handler);
+DART_EXPORT void Dart_SetPausedEventHandler(Dart_PausedEventHandler handler);
 
 
 /**
@@ -316,7 +310,7 @@
  * Requires there to be a current isolate.
  */
 DART_EXPORT void Dart_SetBreakpointResolvedHandler(
-                            Dart_BreakpointResolvedHandler handler);
+    Dart_BreakpointResolvedHandler handler);
 
 /**
  * Installs a callback function that gets called by the VM when
@@ -325,7 +319,7 @@
  * Requires there to be a current isolate.
  */
 DART_EXPORT void Dart_SetExceptionThrownHandler(
-                            Dart_ExceptionThrownHandler handler);
+    Dart_ExceptionThrownHandler handler);
 
 /**
  * Installs a callback function that gets called by the VM when
@@ -349,8 +343,8 @@
  *
  * Requires there to be a current isolate.
  */
-DART_EXPORT Dart_Handle Dart_SetExceptionPauseInfo(
-                            Dart_ExceptionPauseInfo pause_info);
+DART_EXPORT Dart_Handle
+Dart_SetExceptionPauseInfo(Dart_ExceptionPauseInfo pause_info);
 
 
 /**
@@ -390,9 +384,8 @@
  *
  * \return A handle to the True object if no error occurs.
  */
-DART_EXPORT Dart_Handle Dart_StackTraceLength(
-                            Dart_StackTrace trace,
-                            intptr_t* length);
+DART_EXPORT Dart_Handle Dart_StackTraceLength(Dart_StackTrace trace,
+                                              intptr_t* length);
 
 
 /**
@@ -403,10 +396,9 @@
  *
  * \return A handle to the True object if no error occurs.
  */
-DART_EXPORT Dart_Handle Dart_GetActivationFrame(
-                            Dart_StackTrace trace,
-                            int frame_index,
-                            Dart_ActivationFrame* frame);
+DART_EXPORT Dart_Handle Dart_GetActivationFrame(Dart_StackTrace trace,
+                                                int frame_index,
+                                                Dart_ActivationFrame* frame);
 
 
 /**
@@ -425,12 +417,12 @@
  *
  * \return A valid handle if no error occurs during the operation.
  */
-DART_EXPORT Dart_Handle Dart_ActivationFrameInfo(
-                            Dart_ActivationFrame activation_frame,
-                            Dart_Handle* function_name,
-                            Dart_Handle* script_url,
-                            intptr_t* line_number,
-                            intptr_t* column_number);
+DART_EXPORT Dart_Handle
+Dart_ActivationFrameInfo(Dart_ActivationFrame activation_frame,
+                         Dart_Handle* function_name,
+                         Dart_Handle* script_url,
+                         intptr_t* line_number,
+                         intptr_t* column_number);
 
 
 /**
@@ -456,11 +448,11 @@
  *         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* function_name,
-                            Dart_Handle* function,
-                            Dart_CodeLocation* location);
+DART_EXPORT Dart_Handle
+Dart_ActivationFrameGetLocation(Dart_ActivationFrame activation_frame,
+                                Dart_Handle* function_name,
+                                Dart_Handle* function,
+                                Dart_CodeLocation* location);
 
 /**
  * Returns frame pointer of the given activation frame.
@@ -471,9 +463,9 @@
  *
  * \return A handle to the True object if no error occurs.
  */
-DART_EXPORT Dart_Handle Dart_ActivationFrameGetFramePointer(
-                            Dart_ActivationFrame activation_frame,
-                            uintptr_t* frame_pointer);
+DART_EXPORT Dart_Handle
+Dart_ActivationFrameGetFramePointer(Dart_ActivationFrame activation_frame,
+                                    uintptr_t* frame_pointer);
 
 /**
  * Returns an array containing all the local variable names and values of
@@ -486,8 +478,8 @@
  * no variables. If non-empty, variable names are at array offsets 2*n,
  * values at offset 2*n+1.
  */
-DART_EXPORT Dart_Handle Dart_GetLocalVariables(
-                            Dart_ActivationFrame activation_frame);
+DART_EXPORT Dart_Handle
+Dart_GetLocalVariables(Dart_ActivationFrame activation_frame);
 
 
 /**
@@ -519,9 +511,9 @@
  * Execute the expression given in string \expr in the context
  * of stack frame \activation_frame.
  */
-DART_EXPORT Dart_Handle Dart_ActivationFrameEvaluate(
-                            Dart_ActivationFrame activation_frame,
-                            Dart_Handle expr_in);
+DART_EXPORT Dart_Handle
+Dart_ActivationFrameEvaluate(Dart_ActivationFrame activation_frame,
+                             Dart_Handle expr_in);
 
 
 /**
@@ -542,8 +534,7 @@
  * the compilation of the expression fails, or if the evaluation throws
  * an error.
  */
-DART_EXPORT Dart_Handle Dart_EvaluateExpr(Dart_Handle target,
-                                          Dart_Handle expr);
+DART_EXPORT Dart_Handle Dart_EvaluateExpr(Dart_Handle target, Dart_Handle expr);
 
 
 /**
@@ -783,13 +774,12 @@
  * \return True if the result is a regular JSON-RPC response, false if the
  *   result is a JSON-RPC error.
  */
-typedef bool (*Dart_ServiceRequestCallback)(
-    const char* method,
-    const char** param_keys,
-    const char** param_values,
-    intptr_t num_params,
-    void* user_data,
-    const char** json_object);
+typedef bool (*Dart_ServiceRequestCallback)(const char* method,
+                                            const char** param_keys,
+                                            const char** param_values,
+                                            intptr_t num_params,
+                                            void* user_data,
+                                            const char** json_object);
 
 
 /**
@@ -913,8 +903,8 @@
  */
 typedef bool (*Dart_FileModifiedCallback)(const char* url, int64_t since);
 
-DART_EXPORT Dart_Handle Dart_SetFileModifiedCallback(
-    Dart_FileModifiedCallback file_modified_callback);
+DART_EXPORT Dart_Handle
+Dart_SetFileModifiedCallback(Dart_FileModifiedCallback file_modified_callback);
 
 /*
  * ========
@@ -948,14 +938,11 @@
 #define DART_TIMELINE_STREAM_VM (1 << 7)
 
 /** All timeline streams */
-#define DART_TIMELINE_STREAM_ALL (DART_TIMELINE_STREAM_API |                   \
-                                  DART_TIMELINE_STREAM_COMPILER |              \
-                                  DART_TIMELINE_STREAM_DART |                  \
-                                  DART_TIMELINE_STREAM_DEBUGGER |              \
-                                  DART_TIMELINE_STREAM_EMBEDDER |              \
-                                  DART_TIMELINE_STREAM_GC |                    \
-                                  DART_TIMELINE_STREAM_ISOLATE |               \
-                                  DART_TIMELINE_STREAM_VM)
+#define DART_TIMELINE_STREAM_ALL                                               \
+  (DART_TIMELINE_STREAM_API | DART_TIMELINE_STREAM_COMPILER |                  \
+   DART_TIMELINE_STREAM_DART | DART_TIMELINE_STREAM_DEBUGGER |                 \
+   DART_TIMELINE_STREAM_EMBEDDER | DART_TIMELINE_STREAM_GC |                   \
+   DART_TIMELINE_STREAM_ISOLATE | DART_TIMELINE_STREAM_VM)
 
 /** Disable all timeline stream recording */
 #define DART_TIMELINE_STREAM_DISABLE 0
@@ -1001,12 +988,11 @@
  * At the end of each stream state will be DART_STREAM_CONSUMER_STATE_FINISH
  * and buffer will be NULL.
  */
-typedef void (*Dart_StreamConsumer)(
-    Dart_StreamConsumer_State state,
-    const char* stream_name,
-    const uint8_t* buffer,
-    intptr_t buffer_length,
-    void* stream_callback_data);
+typedef void (*Dart_StreamConsumer)(Dart_StreamConsumer_State state,
+                                    const char* stream_name,
+                                    const uint8_t* buffer,
+                                    intptr_t buffer_length,
+                                    void* stream_callback_data);
 
 /**
  * Get the timeline for entire VM (including all isolates).
@@ -1087,4 +1073,4 @@
     Dart_EmbedderTimelineStartRecording start_recording,
     Dart_EmbedderTimelineStopRecording stop_recording);
 
-#endif  // INCLUDE_DART_TOOLS_API_H_
+#endif  // RUNTIME_INCLUDE_DART_TOOLS_API_H_
diff --git a/runtime/lib/array.cc b/runtime/lib/array.cc
index b95e6b0..9d43816 100644
--- a/runtime/lib/array.cc
+++ b/runtime/lib/array.cc
@@ -54,20 +54,14 @@
   GET_NON_NULL_NATIVE_ARGUMENT(Bool, needs_type_arg, arguments->NativeArgAt(3));
   intptr_t istart = start.Value();
   if ((istart < 0) || (istart > src.Length())) {
-    Exceptions::ThrowRangeError(
-        "start",
-        start,
-        0,
-        src.Length());
+    Exceptions::ThrowRangeError("start", start, 0, src.Length());
   }
   intptr_t icount = count.Value();
   // Zero count should be handled outside already.
   if ((icount <= 0) || (icount > src.Length())) {
-    Exceptions::ThrowRangeError(
-        "count",
-        count,
-        0,                        // This is the limit the user sees.
-        src.Length() - istart);
+    Exceptions::ThrowRangeError("count", count,
+                                0,  // This is the limit the user sees.
+                                src.Length() - istart);
   }
 
   return src.Slice(istart, icount, needs_type_arg.value());
diff --git a/runtime/lib/array_patch.dart b/runtime/lib/array_patch.dart
index e62524b..f834394 100644
--- a/runtime/lib/array_patch.dart
+++ b/runtime/lib/array_patch.dart
@@ -33,7 +33,7 @@
   }
 
   @patch factory List.from(Iterable elements, { bool growable: true }) {
-    if (elements is EfficientLength) {
+    if (elements is EfficientLengthIterable) {
       int length = elements.length;
       var list = growable ? new _GrowableList<E>(length) : new _List<E>(length);
       if (length > 0) {  // Avoid creating iterator unless necessary.
diff --git a/runtime/lib/class_id.cc b/runtime/lib/class_id.cc
index 2d9f67d..c950b0e 100644
--- a/runtime/lib/class_id.cc
+++ b/runtime/lib/class_id.cc
@@ -13,4 +13,24 @@
   return Smi::New(instance.GetClassId());
 }
 
+
+DEFINE_NATIVE_ENTRY(ClassID_byName, 1) {
+  GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(0));
+
+#define CLASS_LIST_WITH_NULL(V)                                                \
+  V(Null)                                                                      \
+  CLASS_LIST_NO_OBJECT(V)
+
+#define COMPARE(clazz)                                                         \
+  if (name.Equals(#clazz)) return Smi::New(k##clazz##Cid);
+
+  CLASS_LIST_WITH_NULL(COMPARE)
+
+#undef COMPARE
+#undef CLASS_LIST_WITH_NULL
+
+  UNREACHABLE();
+  return Smi::New(-1);
+}
+
 }  // namespace dart
diff --git a/runtime/lib/class_id.dart b/runtime/lib/class_id.dart
index 045cfa1..8a8d670 100644
--- a/runtime/lib/class_id.dart
+++ b/runtime/lib/class_id.dart
@@ -4,4 +4,14 @@
 
 class ClassID {
   static int getID(Object value) native "ClassID_getID";
+
+  static int _lookup(String name) native "ClassID_byName";
+
+  static final int cidArray = _lookup('Array');
+  static final int cidExternalOneByteString = _lookup('ExternalOneByteString');
+  static final int cidGrowableObjectArray = _lookup('GrowableObjectArray');
+  static final int cidImmutableArray = _lookup('ImmutableArray');
+  static final int cidOneByteString = _lookup('OneByteString');
+  static final int cidTwoByteString = _lookup('TwoByteString');
+  static final int cidBigint = _lookup('Bigint');
 }
diff --git a/runtime/lib/collection_patch.dart b/runtime/lib/collection_patch.dart
index ed76535..f7cd33d 100644
--- a/runtime/lib/collection_patch.dart
+++ b/runtime/lib/collection_patch.dart
@@ -2,10 +2,13 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+import 'dart:typed_data';
+import 'dart:_internal' as internal;
+
 @patch class HashMap<K, V> {
   @patch factory HashMap({ bool equals(K key1, K key2),
-                                 int hashCode(K key),
-                                 bool isValidKey(potentialKey) }) {
+                           int hashCode(K key),
+                           bool isValidKey(potentialKey) }) {
     if (isValidKey == null) {
       if (hashCode == null) {
         if (equals == null) {
@@ -432,8 +435,7 @@
   _HashMapEntry(this.key, this.value, this.hashCode, this.next);
 }
 
-abstract class _HashMapIterable<E> extends IterableBase<E>
-                                   implements EfficientLength {
+abstract class _HashMapIterable<E> extends EfficientLengthIterable<E> {
   final HashMap _map;
   _HashMapIterable(this._map);
   int get length => _map.length;
@@ -835,8 +837,7 @@
   }
 }
 
-class _LinkedHashMapKeyIterable<K> extends IterableBase<K>
-                                   implements EfficientLength {
+class _LinkedHashMapKeyIterable<K> extends EfficientLengthIterable<K> {
   LinkedHashMap<K, dynamic> _map;
   _LinkedHashMapKeyIterable(this._map);
   Iterator<K> get iterator => new _LinkedHashMapKeyIterator<K>(_map);
@@ -847,8 +848,7 @@
   Set<K> toSet() => _map._newKeySet()..addAll(this);
 }
 
-class _LinkedHashMapValueIterable<V> extends IterableBase<V>
-                                     implements EfficientLength {
+class _LinkedHashMapValueIterable<V> extends EfficientLengthIterable<V> {
   LinkedHashMap<dynamic, V> _map;
   _LinkedHashMapValueIterable(this._map);
   Iterator<V> get iterator => new _LinkedHashMapValueIterator<V>(_map);
diff --git a/runtime/lib/collection_sources.gypi b/runtime/lib/collection_sources.gypi
index 0e1e21e..8576980 100644
--- a/runtime/lib/collection_sources.gypi
+++ b/runtime/lib/collection_sources.gypi
@@ -4,6 +4,8 @@
 
 {
   'sources': [
+    # collection_patch.dart needs to be the first dart file because it contains
+    # imports.
     'collection_patch.dart',
     'compact_hash.dart',
     'linked_hash_map.cc',
diff --git a/runtime/lib/compact_hash.dart b/runtime/lib/compact_hash.dart
index 9912d07..86ec9d8 100644
--- a/runtime/lib/compact_hash.dart
+++ b/runtime/lib/compact_hash.dart
@@ -2,9 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import 'dart:typed_data';
-import 'dart:_internal' as internal;
-
 // Hash table with open addressing that separates the index from keys/values.
 
 abstract class _HashFieldBase {
diff --git a/runtime/lib/core_patch.dart b/runtime/lib/core_patch.dart
index f06c98b..29357ae 100644
--- a/runtime/lib/core_patch.dart
+++ b/runtime/lib/core_patch.dart
@@ -2,8 +2,13 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+import "dart:async";
+import "dart:collection" show LinkedList, LinkedListEntry;
+import 'dart:convert' show ASCII, JSON;
+import "dart:isolate";
 import "dart:math";
 import "dart:typed_data";
+import 'dart:_internal' as internal;
 
 // Equivalent of calling FATAL from C++ code.
 _fatal(msg) native "DartCore_fatal";
diff --git a/runtime/lib/date.cc b/runtime/lib/date.cc
index ba9fa95..137652b 100644
--- a/runtime/lib/date.cc
+++ b/runtime/lib/date.cc
@@ -15,8 +15,8 @@
 static int64_t kMaxAllowedSeconds = kMaxInt32;
 
 DEFINE_NATIVE_ENTRY(DateTime_timeZoneName, 1) {
-  GET_NON_NULL_NATIVE_ARGUMENT(
-      Integer, dart_seconds, arguments->NativeArgAt(0));
+  GET_NON_NULL_NATIVE_ARGUMENT(Integer, dart_seconds,
+                               arguments->NativeArgAt(0));
   int64_t seconds = dart_seconds.AsInt64Value();
   if (llabs(seconds) > kMaxAllowedSeconds) {
     Exceptions::ThrowArgumentError(dart_seconds);
@@ -27,8 +27,8 @@
 
 
 DEFINE_NATIVE_ENTRY(DateTime_timeZoneOffsetInSeconds, 1) {
-  GET_NON_NULL_NATIVE_ARGUMENT(
-      Integer, dart_seconds, arguments->NativeArgAt(0));
+  GET_NON_NULL_NATIVE_ARGUMENT(Integer, dart_seconds,
+                               arguments->NativeArgAt(0));
   int64_t seconds = dart_seconds.AsInt64Value();
   if (llabs(seconds) > kMaxAllowedSeconds) {
     Exceptions::ThrowArgumentError(dart_seconds);
diff --git a/runtime/lib/developer.cc b/runtime/lib/developer.cc
index 57a1a4c..e2f5a1b 100644
--- a/runtime/lib/developer.cc
+++ b/runtime/lib/developer.cc
@@ -9,6 +9,7 @@
 #include "vm/debugger.h"
 #include "vm/exceptions.h"
 #include "vm/flags.h"
+#include "vm/message.h"
 #include "vm/native_entry.h"
 #include "vm/object.h"
 #include "vm/object_store.h"
@@ -58,15 +59,9 @@
   GET_NATIVE_ARGUMENT(Instance, dart_zone, arguments->NativeArgAt(5));
   GET_NATIVE_ARGUMENT(Instance, error, arguments->NativeArgAt(6));
   GET_NATIVE_ARGUMENT(Instance, stack_trace, arguments->NativeArgAt(7));
-  Service::SendLogEvent(isolate,
-                        sequence.AsInt64Value(),
-                        timestamp.AsInt64Value(),
-                        level.Value(),
-                        name,
-                        message,
-                        dart_zone,
-                        error,
-                        stack_trace);
+  Service::SendLogEvent(isolate, sequence.AsInt64Value(),
+                        timestamp.AsInt64Value(), level.Value(), name, message,
+                        dart_zone, error, stack_trace);
   return Object::null();
 #endif  // PRODUCT
 }
@@ -120,4 +115,73 @@
 #endif  // PRODUCT
 }
 
+DEFINE_NATIVE_ENTRY(Developer_getServiceMajorVersion, 0) {
+#if defined(PRODUCT)
+  return Smi::New(0);
+#else
+  return Smi::New(SERVICE_PROTOCOL_MAJOR_VERSION);
+#endif
+}
+
+
+DEFINE_NATIVE_ENTRY(Developer_getServiceMinorVersion, 0) {
+#if defined(PRODUCT)
+  return Smi::New(0);
+#else
+  return Smi::New(SERVICE_PROTOCOL_MINOR_VERSION);
+#endif
+}
+
+
+static void SendNull(const SendPort& port) {
+  const Dart_Port destination_port_id = port.Id();
+  PortMap::PostMessage(new Message(destination_port_id, Object::null(),
+                                   Message::kNormalPriority));
+}
+
+
+DEFINE_NATIVE_ENTRY(Developer_getServerInfo, 1) {
+  GET_NON_NULL_NATIVE_ARGUMENT(SendPort, port, arguments->NativeArgAt(0));
+#if defined(PRODUCT)
+  SendNull(port);
+  return Object::null();
+#else
+  if (!ServiceIsolate::IsRunning()) {
+    SendNull(port);
+  } else {
+    ServiceIsolate::RequestServerInfo(port);
+  }
+  return Object::null();
+#endif
+}
+
+
+DEFINE_NATIVE_ENTRY(Developer_webServerControl, 2) {
+  GET_NON_NULL_NATIVE_ARGUMENT(SendPort, port, arguments->NativeArgAt(0));
+#if defined(PRODUCT)
+  SendNull(port);
+  return Object::null();
+#else
+  GET_NON_NULL_NATIVE_ARGUMENT(Bool, enabled, arguments->NativeArgAt(1));
+  if (!ServiceIsolate::IsRunning()) {
+    SendNull(port);
+  } else {
+    ServiceIsolate::ControlWebServer(port, enabled.value());
+  }
+  return Object::null();
+#endif
+}
+
+
+DEFINE_NATIVE_ENTRY(Developer_getIsolateIDFromSendPort, 1) {
+#if defined(PRODUCT)
+  return Object::null();
+#else
+  GET_NON_NULL_NATIVE_ARGUMENT(SendPort, port, arguments->NativeArgAt(0));
+  int64_t port_id = port.Id();
+  return String::NewFormatted(ISOLATE_SERVICE_ID_FORMAT_STRING, port_id);
+#endif
+}
+
+
 }  // namespace dart
diff --git a/runtime/lib/developer.dart b/runtime/lib/developer.dart
index ec3d38b..78c1d6d 100644
--- a/runtime/lib/developer.dart
+++ b/runtime/lib/developer.dart
@@ -3,6 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import 'dart:isolate';
+import 'dart:_internal';
 
 @patch bool debugger({bool when: true,
                      String message}) native "Developer_debugger";
@@ -148,3 +149,15 @@
   }
   replyPort.send(sb.toString());
 }
+
+@patch int _getServiceMajorVersion() native "Developer_getServiceMajorVersion";
+
+@patch int _getServiceMinorVersion() native "Developer_getServiceMinorVersion";
+
+@patch void _getServerInfo(SendPort sendPort) native "Developer_getServerInfo";
+
+@patch void _webServerControl(SendPort sendPort, bool enable)
+    native "Developer_webServerControl";
+
+@patch String _getIsolateIDFromSendPort(SendPort sendPort)
+    native "Developer_getIsolateIDFromSendPort";
diff --git a/runtime/lib/developer_sources.gypi b/runtime/lib/developer_sources.gypi
index e3f1ea6..896f2e1 100644
--- a/runtime/lib/developer_sources.gypi
+++ b/runtime/lib/developer_sources.gypi
@@ -7,6 +7,8 @@
 {
   'sources': [
     'developer.cc',
+    # developer.dart needs to be the first dart file because it contains
+    # imports.
     'developer.dart',
     'profiler.cc',
     'profiler.dart',
diff --git a/runtime/lib/double.cc b/runtime/lib/double.cc
index c28e1b1..2cd1921 100644
--- a/runtime/lib/double.cc
+++ b/runtime/lib/double.cc
@@ -144,8 +144,8 @@
   GET_NON_NULL_NATIVE_ARGUMENT(Double, right, arguments->NativeArgAt(1));
   bool result = right.IsNull() ? false : (left.value() > right.value());
   if (FLAG_trace_intrinsified_natives) {
-    OS::Print("Double_greaterThan %s > %s\n",
-        left.ToCString(), right.ToCString());
+    OS::Print("Double_greaterThan %s > %s\n", left.ToCString(),
+              right.ToCString());
   }
   return Bool::Get(result).raw();
 }
@@ -163,8 +163,7 @@
   GET_NON_NULL_NATIVE_ARGUMENT(Double, right, arguments->NativeArgAt(1));
   bool result = right.IsNull() ? false : (left.value() == right.value());
   if (FLAG_trace_intrinsified_natives) {
-    OS::Print("Double_equal %s == %s\n",
-        left.ToCString(), right.ToCString());
+    OS::Print("Double_equal %s == %s\n", left.ToCString(), right.ToCString());
   }
   return Bool::Get(result).raw();
 }
@@ -245,8 +244,8 @@
   GET_NON_NULL_NATIVE_ARGUMENT(Smi, fraction_digits, arguments->NativeArgAt(1));
   double d = arg.value();
   intptr_t fraction_digits_value = fraction_digits.Value();
-  if (0 <= fraction_digits_value && fraction_digits_value <= 20
-      && kLowerBoundary < d && d < kUpperBoundary) {
+  if (0 <= fraction_digits_value && fraction_digits_value <= 20 &&
+      kLowerBoundary < d && d < kUpperBoundary) {
     return DoubleToStringAsFixed(d, static_cast<int>(fraction_digits_value));
   } else {
     Exceptions::ThrowArgumentError(String::Handle(
@@ -262,8 +261,8 @@
   double d = arg.value();
   intptr_t fraction_digits_value = fraction_digits.Value();
   if (-1 <= fraction_digits_value && fraction_digits_value <= 20) {
-    return DoubleToStringAsExponential(
-        d, static_cast<int>(fraction_digits_value));
+    return DoubleToStringAsExponential(d,
+                                       static_cast<int>(fraction_digits_value));
   } else {
     Exceptions::ThrowArgumentError(String::Handle(
         String::New("Illegal arguments to double.toStringAsExponential")));
diff --git a/runtime/lib/double.dart b/runtime/lib/double.dart
index 34d7803..6a532ef 100644
--- a/runtime/lib/double.dart
+++ b/runtime/lib/double.dart
@@ -6,8 +6,6 @@
   factory _Double.fromInteger(int value)
       native "Double_doubleFromInteger";
 
-  Type get runtimeType => double;
-
   // TODO: Make a stared static method for hashCode and _identityHashCode
   //       when semantics are corrected as described in:
   //       https://github.com/dart-lang/sdk/issues/2884
@@ -277,11 +275,4 @@
       return LESS;
     }
   }
-
-  static const int _FRACTIONAL_BITS = // Bits to keep after the decimal point.
-      const int.fromEnvironment("doubleFractionalBits", defaultValue: 20);
-  static const double _BIAS = 1.5 * (1 << (52 - _FRACTIONAL_BITS));
-
-  // Returns this with only _FRACTIONAL_BITS bits after the decimal point.
-  double get p => this + _BIAS - _BIAS;
 }
diff --git a/runtime/lib/errors.cc b/runtime/lib/errors.cc
index 28d4ef4..27770a9 100644
--- a/runtime/lib/errors.cc
+++ b/runtime/lib/errors.cc
@@ -7,9 +7,58 @@
 #include "vm/object_store.h"
 #include "vm/runtime_entry.h"
 #include "vm/stack_frame.h"
+#include "vm/symbols.h"
 
 namespace dart {
 
+// Scan the stack until we hit the first function in the _AssertionError
+// class. We then return the next frame's script taking inlining into account.
+static RawScript* FindScript(DartFrameIterator* iterator) {
+  if (FLAG_precompiled_runtime) {
+    // The precompiled runtime faces two issues in recovering the correct
+    // assertion text. First, the precompiled runtime does not include
+    // the inlining meta-data so we cannot walk the inline-aware stack trace.
+    // Second, the script text itself is missing so whatever script is returned
+    // from here will be missing the assertion expression text.
+    iterator->NextFrame();  // Skip _AssertionError._checkAssertion frame
+    return Exceptions::GetCallerScript(iterator);
+  }
+  StackFrame* stack_frame = iterator->NextFrame();
+  Code& code = Code::Handle();
+  Function& func = Function::Handle();
+  const Class& assert_error_class =
+      Class::Handle(Library::LookupCoreClass(Symbols::AssertionError()));
+  ASSERT(!assert_error_class.IsNull());
+  bool hit_assertion_error = false;
+  while (stack_frame != NULL) {
+    code ^= stack_frame->LookupDartCode();
+    if (code.is_optimized()) {
+      InlinedFunctionsIterator inlined_iterator(code, stack_frame->pc());
+      while (!inlined_iterator.Done()) {
+        func ^= inlined_iterator.function();
+        if (hit_assertion_error) {
+          return func.script();
+        }
+        ASSERT(!hit_assertion_error);
+        hit_assertion_error = (func.Owner() == assert_error_class.raw());
+        inlined_iterator.Advance();
+      }
+    } else {
+      func ^= code.function();
+      ASSERT(!func.IsNull());
+      if (hit_assertion_error) {
+        return func.script();
+      }
+      ASSERT(!hit_assertion_error);
+      hit_assertion_error = (func.Owner() == assert_error_class.raw());
+    }
+    stack_frame = iterator->NextFrame();
+  }
+  UNREACHABLE();
+  return Script::null();
+}
+
+
 // Allocate and throw a new AssertionError.
 // Arg0: index of the first token of the failed assertion.
 // Arg1: index of the first token after the failed assertion.
@@ -26,8 +75,7 @@
 
   DartFrameIterator iterator;
   iterator.NextFrame();  // Skip native call.
-  iterator.NextFrame();  // Skip _AssertionError._checkAssertion frame
-  const Script& script = Script::Handle(Exceptions::GetCallerScript(&iterator));
+  const Script& script = Script::Handle(FindScript(&iterator));
 
   // Initialize argument 'failed_assertion' with source snippet.
   intptr_t from_line, from_column;
@@ -36,8 +84,8 @@
   script.GetTokenLocation(assertion_end, &to_line, &to_column);
   // The snippet will extract the correct assertion code even if the source
   // is generated.
-  args.SetAt(0, String::Handle(
-      script.GetSnippet(from_line, from_column, to_line, to_column)));
+  args.SetAt(0, String::Handle(script.GetSnippet(from_line, from_column,
+                                                 to_line, to_column)));
 
   // Initialize location arguments starting at position 1.
   // Do not set a column if the source has been generated as it will be wrong.
@@ -69,9 +117,10 @@
       AbstractType::CheckedHandle(arguments->NativeArgAt(2));
   const String& dst_name = String::CheckedHandle(arguments->NativeArgAt(3));
   const String& error_msg = String::CheckedHandle(arguments->NativeArgAt(4));
-  const AbstractType& src_type = AbstractType::Handle(src_value.GetType());
-  Exceptions::CreateAndThrowTypeError(
-      location, src_type, dst_type, dst_name, error_msg);
+  const AbstractType& src_type =
+      AbstractType::Handle(src_value.GetType(Heap::kNew));
+  Exceptions::CreateAndThrowTypeError(location, src_type, dst_type, dst_name,
+                                      error_msg);
   UNREACHABLE();
   return Object::null();
 }
diff --git a/runtime/lib/errors_patch.dart b/runtime/lib/errors_patch.dart
index 961f71c..2635802 100644
--- a/runtime/lib/errors_patch.dart
+++ b/runtime/lib/errors_patch.dart
@@ -2,9 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import 'dart:_internal' as internal;
-import 'dart:convert' show JSON;
-
 @patch class Error {
   @patch static String _objectToString(Object object) {
     return Object._toString(object);
@@ -106,7 +103,7 @@
 
   static _throwNew(int case_clause_pos) native "FallThroughError_throwNew";
 
-  @patch String toString() {
+  String toString() {
     return "'$_url': Switch case fall-through at line $_line.";
   }
 
@@ -166,14 +163,13 @@
     int numPositionalArguments = arguments == null ? 0 : arguments.length;
     numPositionalArguments -= numNamedArguments;
     List positionalArguments;
-    if (numPositionalArguments == 0) {
-      // Differ between no arguments specified and 0 arguments.
-      // TODO(srdjan): This can currently occur for unresolvable static methods.
-      // In that case, the arguments are evaluated but not passed to the
+    if (numPositionalArguments > 0) {
+      // TODO(srdjan): Unresolvable static methods sometimes do not provide the
+      // arguments, because the arguments are evaluated but not passed to the
       // throwing stub (see EffectGraphVisitor::BuildThrowNoSuchMethodError and
-      // Parser::ThrowNoSuchMethodError)).
-      positionalArguments = argumentNames == null ? null : [];
-    } else {
+      // Parser::ThrowNoSuchMethodError)). There is no way to distinguish the
+      // case of no arguments from the case of the arguments not being passed
+      // in here, though. See https://github.com/dart-lang/sdk/issues/27572
       positionalArguments = arguments.sublist(0, numPositionalArguments);
     }
     Map<Symbol, dynamic> namedArguments = new Map<Symbol, dynamic>();
@@ -207,6 +203,7 @@
   // that no information is available.
   final int _invocation_type;
 
+  @patch
   NoSuchMethodError(Object this._receiver,
                     Symbol this._memberName,
                     List this._arguments,
@@ -234,127 +231,128 @@
                     value: (k) => namedArguments[k]),
         this._existingArgumentNames = existingArgumentNames;
 
-
-  String _developerMessage(args_mismatch) {
-    if (_invocation_type < 0) {
-      return "";
-    }
-    var type = _invocation_type & _InvocationMirror._TYPE_MASK;
+  @patch String toString() {
     var level = (_invocation_type >> _InvocationMirror._CALL_SHIFT) &
-         _InvocationMirror._CALL_MASK;
-    var type_str =
-        (const ["method", "getter", "setter", "getter or setter", "variable"])[type];
-    var args_message = args_mismatch ? " with matching arguments" : "";
-    var msg;
-    var memberName =
-        (_memberName == null) ? "" : internal.Symbol.getUnmangledName(_memberName);
+        _InvocationMirror._CALL_MASK;
+    var type = _invocation_type & _InvocationMirror._TYPE_MASK;
+    String memberName = (_memberName == null) ? "" :
+        internal.Symbol.getUnmangledName(_memberName);
 
     if (type == _InvocationMirror._LOCAL_VAR) {
-      return "cannot assign to final variable '$memberName'.\n\n";
+      return "NoSuchMethodError: Cannot assign to final variable '$memberName'";
     }
+
+    StringBuffer arguments = new StringBuffer();
+    int argumentCount = 0;
+    if (_arguments != null) {
+      for (; argumentCount < _arguments.length; argumentCount++) {
+        if (argumentCount > 0) {
+          arguments.write(", ");
+        }
+        arguments.write(Error.safeToString(_arguments[argumentCount]));
+      }
+    }
+    if (_namedArguments != null) {
+      _namedArguments.forEach((Symbol key, var value) {
+        if (argumentCount > 0) {
+          arguments.write(", ");
+        }
+        arguments.write(internal.Symbol.getUnmangledName(key));
+        arguments.write(": ");
+        arguments.write(Error.safeToString(value));
+        argumentCount++;
+      });
+    }
+    bool args_mismatch = _existingArgumentNames != null;
+    String args_message = args_mismatch ? " with matching arguments" : "";
+
+    String type_str;
+    if (type >= 0 && type < 5) {
+      type_str = (const ["method", "getter", "setter", "getter or setter",
+          "variable"])[type];
+    }
+
+    StringBuffer msg_buf = new StringBuffer("NoSuchMethodError: ");
+    bool is_type_call = false;
     switch (level) {
       case _InvocationMirror._DYNAMIC: {
         if (_receiver == null) {
-          msg = "The null object does not have a $type_str '$memberName'"
-              "$args_message.";
+          if (args_mismatch) {
+            msg_buf.writeln("The null object does not have a $type_str "
+                "'$memberName'$args_message.");
+          } else {
+            msg_buf.writeln("The $type_str '$memberName' was called on null.");
+          }
         } else {
           if (_receiver is Function) {
-            msg = "Closure call with mismatched arguments: "
-                "function '$memberName'";
+            msg_buf.writeln("Closure call with mismatched arguments: "
+                "function '$memberName'");
+          } else if (_receiver is _Type && memberName == "call") {
+            is_type_call = true;
+            String name = _receiver.toString();
+            msg_buf.writeln("Attempted to use type '$name' as a function. "
+                "Since types do not define a method 'call', this is not "
+                "possible. Did you intend to call the $name constructor and "
+                "forget the 'new' operator?");
           } else {
-            msg = "Class '${_receiver.runtimeType}' has no instance $type_str "
-                "'$memberName'$args_message.";
+            msg_buf.writeln("Class '${_receiver.runtimeType}' has no instance "
+                "$type_str '$memberName'$args_message.");
           }
         }
         break;
       }
       case _InvocationMirror._SUPER: {
-        msg = "Super class of class '${_receiver.runtimeType}' has no instance "
-              "$type_str '$memberName'$args_message.";
+        msg_buf.writeln("Super class of class '${_receiver.runtimeType}' has "
+              "no instance $type_str '$memberName'$args_message.");
+        memberName = "super.$memberName";
         break;
       }
       case _InvocationMirror._STATIC: {
-        msg = "No static $type_str '$memberName' declared in class "
-            "'$_receiver'.";
+        msg_buf.writeln("No static $type_str '$memberName'$args_message "
+            "declared in class '$_receiver'.");
         break;
       }
       case _InvocationMirror._CONSTRUCTOR: {
-        msg = "No constructor '$memberName'$args_message declared in class '$_receiver'.";
+        msg_buf.writeln("No constructor '$memberName'$args_message declared "
+            "in class '$_receiver'.");
+        memberName = "new $memberName";
         break;
       }
       case _InvocationMirror._TOP_LEVEL: {
-        msg = "No top-level $type_str '$memberName'$args_message declared.";
+        msg_buf.writeln("No top-level $type_str '$memberName'$args_message "
+            "declared.");
         break;
       }
     }
-    return "$msg\n\n";
-  }
 
-  @patch String toString() {
-    StringBuffer actual_buf = new StringBuffer();
-    int i = 0;
-    if (_arguments == null) {
-      // Actual arguments unknown.
-      // TODO(srdjan): Remove once arguments are passed for unresolvable
-      // static methods.
-      actual_buf.write("...");
+    if (level == _InvocationMirror._TOP_LEVEL) {
+      msg_buf.writeln("Receiver: top-level");
     } else {
-      for (; i < _arguments.length; i++) {
-        if (i > 0) {
-          actual_buf.write(", ");
-        }
-        actual_buf.write(Error.safeToString(_arguments[i]));
-      }
+      msg_buf.writeln("Receiver: ${Error.safeToString(_receiver)}");
     }
-    if (_namedArguments != null) {
-      _namedArguments.forEach((Symbol key, var value) {
-        if (i > 0) {
-          actual_buf.write(", ");
-        }
-        actual_buf.write(internal.Symbol.getUnmangledName(key));
-        actual_buf.write(": ");
-        actual_buf.write(Error.safeToString(value));
-        i++;
-      });
-    }
-    var args_mismatch = _existingArgumentNames != null;
-    StringBuffer msg_buf = new StringBuffer(_developerMessage(args_mismatch));
-    String receiver_str;
-    var level = (_invocation_type >> _InvocationMirror._CALL_SHIFT) &
-        _InvocationMirror._CALL_MASK;
-    if ( level == _InvocationMirror._TOP_LEVEL) {
-      receiver_str = "top-level";
+
+    if (type == _InvocationMirror._METHOD) {
+      String m = is_type_call ? "$_receiver" : "$memberName";
+      msg_buf.write("Tried calling: $m($arguments)");
+    } else if (argumentCount == 0) {
+      msg_buf.write("Tried calling: $memberName");
+    } else if (type == _InvocationMirror._SETTER) {
+      msg_buf.write("Tried calling: $memberName$arguments");
     } else {
-      receiver_str = Error.safeToString(_receiver);
+      msg_buf.write("Tried calling: $memberName = $arguments");
     }
-    var memberName =
-        (_memberName == null) ? "" : internal.Symbol.getUnmangledName(_memberName);
-    var type = _invocation_type & _InvocationMirror._TYPE_MASK;
-    if (type == _InvocationMirror._LOCAL_VAR) {
-      msg_buf.write(
-          "NoSuchMethodError: cannot assign to final variable '$memberName'");
-    } else if (!args_mismatch) {
-      msg_buf.write(
-          "NoSuchMethodError: method not found: '$memberName'\n"
-          "Receiver: $receiver_str\n"
-          "Arguments: [$actual_buf]");
-    } else {
-      String actualParameters = actual_buf.toString();
-      StringBuffer formal_buf = new StringBuffer();
+
+    if (args_mismatch) {
+      StringBuffer formalParameters = new StringBuffer();
       for (int i = 0; i < _existingArgumentNames.length; i++) {
         if (i > 0) {
-          formal_buf.write(", ");
+          formalParameters.write(", ");
         }
-        formal_buf.write(_existingArgumentNames[i]);
+        formalParameters.write(_existingArgumentNames[i]);
       }
-      String formalParameters = formal_buf.toString();
-      msg_buf.write(
-          "NoSuchMethodError: incorrect number of arguments passed to "
-          "method named '$memberName'\n"
-          "Receiver: $receiver_str\n"
-          "Tried calling: $memberName($actualParameters)\n"
-          "Found: $memberName($formalParameters)");
+      msg_buf.write("\nFound: $memberName($formalParameters)");
     }
+
     return msg_buf.toString();
   }
 }
diff --git a/runtime/lib/function.cc b/runtime/lib/function.cc
index 4241762..2abdde71 100644
--- a/runtime/lib/function.cc
+++ b/runtime/lib/function.cc
@@ -16,9 +16,8 @@
 DEFINE_NATIVE_ENTRY(Function_apply, 2) {
   const Array& fun_arguments = Array::CheckedHandle(arguments->NativeArgAt(0));
   const Array& fun_arg_names = Array::CheckedHandle(arguments->NativeArgAt(1));
-  const Array& fun_args_desc =
-      Array::Handle(ArgumentsDescriptor::New(fun_arguments.Length(),
-                                             fun_arg_names));
+  const Array& fun_args_desc = Array::Handle(
+      ArgumentsDescriptor::New(fun_arguments.Length(), fun_arg_names));
   const Object& result =
       Object::Handle(DartEntry::InvokeClosure(fun_arguments, fun_args_desc));
   if (result.IsError()) {
@@ -29,8 +28,8 @@
 
 
 DEFINE_NATIVE_ENTRY(Closure_equals, 2) {
-  const Closure& receiver = Closure::CheckedHandle(
-      zone, arguments->NativeArgAt(0));
+  const Closure& receiver =
+      Closure::CheckedHandle(zone, arguments->NativeArgAt(0));
   GET_NATIVE_ARGUMENT(Instance, other, arguments->NativeArgAt(1));
   ASSERT(!other.IsNull());
   if (receiver.raw() == other.raw()) return Bool::True().raw();
@@ -41,8 +40,8 @@
       ASSERT(!func_a.IsImplicitStaticClosureFunction());
       if (func_a.IsImplicitInstanceClosureFunction()) {
         const Context& context_a = Context::Handle(receiver.context());
-        const Context& context_b = Context::Handle(
-            Closure::Cast(other).context());
+        const Context& context_b =
+            Context::Handle(Closure::Cast(other).context());
         const Object& receiver_a = Object::Handle(context_a.At(0));
         const Object& receiver_b = Object::Handle(context_b.At(0));
         if (receiver_a.raw() == receiver_b.raw()) return Bool::True().raw();
@@ -51,8 +50,8 @@
                func_b.IsImplicitInstanceClosureFunction()) {
       // TODO(rmacnak): Patch existing tears off during reload instead.
       const Context& context_a = Context::Handle(receiver.context());
-      const Context& context_b = Context::Handle(
-          Closure::Cast(other).context());
+      const Context& context_b =
+          Context::Handle(Closure::Cast(other).context());
       const Object& receiver_a = Object::Handle(context_a.At(0));
       const Object& receiver_b = Object::Handle(context_b.At(0));
       if ((receiver_a.raw() == receiver_b.raw()) &&
@@ -67,8 +66,8 @@
 
 
 DEFINE_NATIVE_ENTRY(Closure_hashCode, 1) {
-  const Closure& receiver = Closure::CheckedHandle(
-      zone, arguments->NativeArgAt(0));
+  const Closure& receiver =
+      Closure::CheckedHandle(zone, arguments->NativeArgAt(0));
   const Function& func = Function::Handle(receiver.function());
   // Hash together name, class name and signature.
   const Class& cls = Class::Handle(func.Owner());
@@ -85,8 +84,8 @@
 
 
 DEFINE_NATIVE_ENTRY(Closure_clone, 1) {
-  const Closure& receiver = Closure::CheckedHandle(
-      zone, arguments->NativeArgAt(0));
+  const Closure& receiver =
+      Closure::CheckedHandle(zone, arguments->NativeArgAt(0));
   const Function& func = Function::Handle(zone, receiver.function());
   const Context& ctx = Context::Handle(zone, receiver.context());
   Context& cloned_ctx =
diff --git a/runtime/lib/growable_array.cc b/runtime/lib/growable_array.cc
index e892813..501cea6 100644
--- a/runtime/lib/growable_array.cc
+++ b/runtime/lib/growable_array.cc
@@ -17,11 +17,10 @@
       TypeArguments::CheckedHandle(arguments->NativeArgAt(0));
   GET_NON_NULL_NATIVE_ARGUMENT(Array, data, arguments->NativeArgAt(1));
   if (data.Length() <= 0) {
-    Exceptions::ThrowRangeError(
-        "length",
-        Integer::Handle(Integer::New(data.Length())),
-        0,  // This is the limit the user sees.
-        Array::kMaxElements);
+    Exceptions::ThrowRangeError("length",
+                                Integer::Handle(Integer::New(data.Length())),
+                                0,  // This is the limit the user sees.
+                                Array::kMaxElements);
   }
   const GrowableObjectArray& new_array =
       GrowableObjectArray::Handle(GrowableObjectArray::New(data));
diff --git a/runtime/lib/growable_array.dart b/runtime/lib/growable_array.dart
index 9e942e4..d35c1c4 100644
--- a/runtime/lib/growable_array.dart
+++ b/runtime/lib/growable_array.dart
@@ -174,7 +174,7 @@
         (cid == ClassID.cidArray) ||
         (cid == ClassID.cidGrowableObjectArray) ||
         (cid == ClassID.cidImmutableArray);
-    if (isVMList || (iterable is EfficientLength)) {
+    if (isVMList || (iterable is EfficientLengthIterable)) {
       var cap = _capacity;
       // Pregrow if we know iterable.length.
       var iterLen = iterable.length;
diff --git a/runtime/lib/immutable_map.dart b/runtime/lib/immutable_map.dart
index b8d0d3c..ba866e3 100644
--- a/runtime/lib/immutable_map.dart
+++ b/runtime/lib/immutable_map.dart
@@ -85,8 +85,7 @@
   }
 }
 
-class _ImmutableMapKeyIterable<E> extends IterableBase<E>
-                                  implements EfficientLength {
+class _ImmutableMapKeyIterable<E> extends EfficientLengthIterable<E> {
   final ImmutableMap _map;
   _ImmutableMapKeyIterable(this._map);
 
@@ -97,8 +96,7 @@
   int get length => _map.length;
 }
 
-class _ImmutableMapValueIterable<E> extends IterableBase<E>
-                                    implements EfficientLength {
+class _ImmutableMapValueIterable<E> extends EfficientLengthIterable<E> {
   final ImmutableMap _map;
   _ImmutableMapValueIterable(this._map);
 
diff --git a/runtime/lib/integers.cc b/runtime/lib/integers.cc
index efb12af..3624178 100644
--- a/runtime/lib/integers.cc
+++ b/runtime/lib/integers.cc
@@ -16,8 +16,10 @@
 
 namespace dart {
 
-DEFINE_FLAG(bool, trace_intrinsified_natives, false,
-    "Report if any of the intrinsified natives are called");
+DEFINE_FLAG(bool,
+            trace_intrinsified_natives,
+            false,
+            "Report if any of the intrinsified natives are called");
 
 // Smi natives.
 
@@ -42,8 +44,8 @@
   ASSERT(CheckInteger(right));
   ASSERT(CheckInteger(left));
   if (FLAG_trace_intrinsified_natives) {
-    OS::Print("Integer_bitAndFromInteger %s & %s\n",
-        right.ToCString(), left.ToCString());
+    OS::Print("Integer_bitAndFromInteger %s & %s\n", right.ToCString(),
+              left.ToCString());
   }
   const Integer& result = Integer::Handle(left.BitOp(Token::kBIT_AND, right));
   // A null result indicates that a bigint operation is required.
@@ -57,8 +59,8 @@
   ASSERT(CheckInteger(right));
   ASSERT(CheckInteger(left));
   if (FLAG_trace_intrinsified_natives) {
-    OS::Print("Integer_bitOrFromInteger %s | %s\n",
-        left.ToCString(), right.ToCString());
+    OS::Print("Integer_bitOrFromInteger %s | %s\n", left.ToCString(),
+              right.ToCString());
   }
   const Integer& result = Integer::Handle(left.BitOp(Token::kBIT_OR, right));
   // A null result indicates that a bigint operation is required.
@@ -72,8 +74,8 @@
   ASSERT(CheckInteger(right));
   ASSERT(CheckInteger(left));
   if (FLAG_trace_intrinsified_natives) {
-    OS::Print("Integer_bitXorFromInteger %s ^ %s\n",
-        left.ToCString(), right.ToCString());
+    OS::Print("Integer_bitXorFromInteger %s ^ %s\n", left.ToCString(),
+              right.ToCString());
   }
   const Integer& result = Integer::Handle(left.BitOp(Token::kBIT_XOR, right));
   // A null result indicates that a bigint operation is required.
@@ -87,8 +89,8 @@
   ASSERT(CheckInteger(right_int));
   ASSERT(CheckInteger(left_int));
   if (FLAG_trace_intrinsified_natives) {
-    OS::Print("Integer_addFromInteger %s + %s\n",
-        left_int.ToCString(), right_int.ToCString());
+    OS::Print("Integer_addFromInteger %s + %s\n", left_int.ToCString(),
+              right_int.ToCString());
   }
   const Integer& result =
       Integer::Handle(left_int.ArithmeticOp(Token::kADD, right_int));
@@ -103,8 +105,8 @@
   ASSERT(CheckInteger(right_int));
   ASSERT(CheckInteger(left_int));
   if (FLAG_trace_intrinsified_natives) {
-    OS::Print("Integer_subFromInteger %s - %s\n",
-        left_int.ToCString(), right_int.ToCString());
+    OS::Print("Integer_subFromInteger %s - %s\n", left_int.ToCString(),
+              right_int.ToCString());
   }
   const Integer& result =
       Integer::Handle(left_int.ArithmeticOp(Token::kSUB, right_int));
@@ -119,8 +121,8 @@
   ASSERT(CheckInteger(right_int));
   ASSERT(CheckInteger(left_int));
   if (FLAG_trace_intrinsified_natives) {
-    OS::Print("Integer_mulFromInteger %s * %s\n",
-        left_int.ToCString(), right_int.ToCString());
+    OS::Print("Integer_mulFromInteger %s * %s\n", left_int.ToCString(),
+              right_int.ToCString());
   }
   const Integer& result =
       Integer::Handle(left_int.ArithmeticOp(Token::kMUL, right_int));
@@ -148,8 +150,8 @@
   ASSERT(CheckInteger(right_int));
   ASSERT(CheckInteger(left_int));
   if (FLAG_trace_intrinsified_natives) {
-    OS::Print("Integer_moduloFromInteger %s mod %s\n",
-        left_int.ToCString(), right_int.ToCString());
+    OS::Print("Integer_moduloFromInteger %s mod %s\n", left_int.ToCString(),
+              right_int.ToCString());
   }
   if (right_int.IsZero()) {
     // Should have been caught before calling into runtime.
@@ -168,8 +170,8 @@
   ASSERT(CheckInteger(right));
   ASSERT(CheckInteger(left));
   if (FLAG_trace_intrinsified_natives) {
-    OS::Print("Integer_greaterThanFromInteger %s > %s\n",
-        left.ToCString(), right.ToCString());
+    OS::Print("Integer_greaterThanFromInteger %s > %s\n", left.ToCString(),
+              right.ToCString());
   }
   return Bool::Get(left.CompareWith(right) == 1).raw();
 }
@@ -181,8 +183,8 @@
   ASSERT(CheckInteger(left));
   ASSERT(CheckInteger(right));
   if (FLAG_trace_intrinsified_natives) {
-    OS::Print("Integer_equalToInteger %s == %s\n",
-        left.ToCString(), right.ToCString());
+    OS::Print("Integer_equalToInteger %s == %s\n", left.ToCString(),
+              right.ToCString());
   }
   return Bool::Get(left.CompareWith(right) == 0).raw();
 }
@@ -289,8 +291,8 @@
   const Smi& left = Smi::CheckedHandle(arguments->NativeArgAt(0));
   GET_NON_NULL_NATIVE_ARGUMENT(Smi, right, arguments->NativeArgAt(1));
   if (FLAG_trace_intrinsified_natives) {
-    OS::Print("Smi_bitAndFromSmi %s & %s\n",
-        left.ToCString(), right.ToCString());
+    OS::Print("Smi_bitAndFromSmi %s & %s\n", left.ToCString(),
+              right.ToCString());
   }
   const Smi& left_value = Smi::Cast(left);
   const Smi& right_value = Smi::Cast(right);
@@ -303,25 +305,24 @@
   GET_NON_NULL_NATIVE_ARGUMENT(Integer, value, arguments->NativeArgAt(1));
   ASSERT(CheckInteger(amount));
   ASSERT(CheckInteger(value));
-  const Integer& result = Integer::Handle(
-      ShiftOperationHelper(Token::kSHR, value, amount));
+  const Integer& result =
+      Integer::Handle(ShiftOperationHelper(Token::kSHR, value, amount));
   // A null result indicates that a bigint operation is required.
   return result.IsNull() ? result.raw() : result.AsValidInteger();
 }
 
 
-
 DEFINE_NATIVE_ENTRY(Smi_shlFromInt, 2) {
   const Smi& amount = Smi::CheckedHandle(arguments->NativeArgAt(0));
   GET_NON_NULL_NATIVE_ARGUMENT(Integer, value, arguments->NativeArgAt(1));
   ASSERT(CheckInteger(amount));
   ASSERT(CheckInteger(value));
   if (FLAG_trace_intrinsified_natives) {
-    OS::Print("Smi_shlFromInt: %s << %s\n",
-        value.ToCString(), amount.ToCString());
+    OS::Print("Smi_shlFromInt: %s << %s\n", value.ToCString(),
+              amount.ToCString());
   }
-  const Integer& result = Integer::Handle(
-      ShiftOperationHelper(Token::kSHL, value, amount));
+  const Integer& result =
+      Integer::Handle(ShiftOperationHelper(Token::kSHL, value, amount));
   // A null result indicates that a bigint operation is required.
   return result.IsNull() ? result.raw() : result.AsValidInteger();
 }
diff --git a/runtime/lib/integers.dart b/runtime/lib/integers.dart
index 0c5b119..f465e3b 100644
--- a/runtime/lib/integers.dart
+++ b/runtime/lib/integers.dart
@@ -6,8 +6,6 @@
   // The Dart class _Bigint extending _IntegerImplementation requires a
   // default constructor.
 
-  Type get runtimeType => int;
-
   num operator +(num other) {
     var result = other._addFromInteger(this);
     if (result != null) return result;
diff --git a/runtime/lib/integers_patch.dart b/runtime/lib/integers_patch.dart
index 67db176..6f8b384 100644
--- a/runtime/lib/integers_patch.dart
+++ b/runtime/lib/integers_patch.dart
@@ -5,8 +5,6 @@
 
 // VM implementation of int.
 
-import 'dart:_internal' as internal;
-
 @patch class int {
 
   @patch const factory int.fromEnvironment(String name,
diff --git a/runtime/lib/invocation_mirror.h b/runtime/lib/invocation_mirror.h
index 78d1ba4..6061c84 100644
--- a/runtime/lib/invocation_mirror.h
+++ b/runtime/lib/invocation_mirror.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef LIB_INVOCATION_MIRROR_H_
-#define LIB_INVOCATION_MIRROR_H_
+#ifndef RUNTIME_LIB_INVOCATION_MIRROR_H_
+#define RUNTIME_LIB_INVOCATION_MIRROR_H_
 
 #include "vm/allocation.h"
 
@@ -20,7 +20,7 @@
     kMethod = 0,
     kGetter = 1,
     kSetter = 2,
-    kField  = 3,
+    kField = 3,
     kLocalVar = 4,
     kTypeShift = 0,
     kTypeBits = 3,
@@ -32,7 +32,7 @@
     // NoSuchMethodError for compile-time resolution failures.
     kDynamic = 0,
     kSuper = 1,
-    kStatic  = 2,
+    kStatic = 2,
     kConstructor = 3,
     kTopLevel = 4,
     kCallShift = kTypeBits,
@@ -47,4 +47,4 @@
 
 }  // namespace dart
 
-#endif  // LIB_INVOCATION_MIRROR_H_
+#endif  // RUNTIME_LIB_INVOCATION_MIRROR_H_
diff --git a/runtime/lib/isolate.cc b/runtime/lib/isolate.cc
index 54a55ee..d88fbc8 100644
--- a/runtime/lib/isolate.cc
+++ b/runtime/lib/isolate.cc
@@ -25,7 +25,9 @@
 
 namespace dart {
 
-DEFINE_FLAG(bool, i_like_slow_isolate_spawn, false,
+DEFINE_FLAG(bool,
+            i_like_slow_isolate_spawn,
+            false,
             "Block the parent thread when loading spawned isolates.");
 
 static uint8_t* allocator(uint8_t* ptr, intptr_t old_size, intptr_t new_size) {
@@ -60,8 +62,7 @@
 
 DEFINE_NATIVE_ENTRY(RawReceivePortImpl_factory, 1) {
   ASSERT(TypeArguments::CheckedHandle(arguments->NativeArgAt(0)).IsNull());
-  Dart_Port port_id =
-      PortMap::CreatePort(isolate->message_handler());
+  Dart_Port port_id = PortMap::CreatePort(isolate->message_handler());
   return ReceivePort::New(port_id, false /* not control port */);
 }
 
@@ -111,16 +112,16 @@
   const bool can_send_any_object = isolate->origin_id() == port.origin_id();
 
   if (ApiObjectConverter::CanConvert(obj.raw())) {
-    PortMap::PostMessage(new Message(
-        destination_port_id, obj.raw(), Message::kNormalPriority));
+    PortMap::PostMessage(
+        new Message(destination_port_id, obj.raw(), Message::kNormalPriority));
   } else {
     uint8_t* data = NULL;
     MessageWriter writer(&data, &allocator, can_send_any_object);
     writer.WriteMessage(obj);
 
     // TODO(turnidge): Throw an exception when the return value is false?
-    PortMap::PostMessage(new Message(destination_port_id,
-                                     data, writer.BytesWritten(),
+    PortMap::PostMessage(new Message(destination_port_id, data,
+                                     writer.BytesWritten(),
                                      Message::kNormalPriority));
   }
   return Object::null();
@@ -154,14 +155,9 @@
     // Make a copy of the state's isolate flags and hand it to the callback.
     Dart_IsolateFlags api_flags = *(state_->isolate_flags());
 
-    Isolate* isolate = reinterpret_cast<Isolate*>(
-        (callback)(state_->script_url(),
-                   state_->function_name(),
-                   state_->package_root(),
-                   state_->package_config(),
-                   &api_flags,
-                   state_->init_data(),
-                   &error));
+    Isolate* isolate = reinterpret_cast<Isolate*>((callback)(
+        state_->script_url(), state_->function_name(), state_->package_root(),
+        state_->package_config(), &api_flags, state_->init_data(), &error));
     state_->DecrementSpawnCount();
     if (isolate == NULL) {
       ReportError(error);
@@ -245,21 +241,12 @@
       Dart_Port on_exit_port = onExit.IsNull() ? ILLEGAL_PORT : onExit.Id();
       Dart_Port on_error_port = onError.IsNull() ? ILLEGAL_PORT : onError.Id();
 
-      IsolateSpawnState* state =
-          new IsolateSpawnState(port.Id(),
-                                isolate->origin_id(),
-                                isolate->init_callback_data(),
-                                String2UTF8(script_uri),
-                                func,
-                                message,
-                                isolate->spawn_count_monitor(),
-                                isolate->spawn_count(),
-                                utf8_package_root,
-                                utf8_package_config,
-                                paused.value(),
-                                fatal_errors,
-                                on_exit_port,
-                                on_error_port);
+      IsolateSpawnState* state = new IsolateSpawnState(
+          port.Id(), isolate->origin_id(), isolate->init_callback_data(),
+          String2UTF8(script_uri), func, message,
+          isolate->spawn_count_monitor(), isolate->spawn_count(),
+          utf8_package_root, utf8_package_config, paused.value(), fatal_errors,
+          on_exit_port, on_error_port);
       ThreadPool::Task* spawn_task = new SpawnIsolateTask(state);
 
       isolate->IncrementSpawnCount();
@@ -300,9 +287,9 @@
   if (handler != NULL) {
     TransitionVMToNative transition(thread);
     Dart_EnterScope();
-    Dart_Handle handle = handler(Dart_kCanonicalizeUrl,
-                                 Api::NewHandle(thread, library.raw()),
-                                 Api::NewHandle(thread, uri.raw()));
+    Dart_Handle handle =
+        handler(Dart_kCanonicalizeUrl, Api::NewHandle(thread, library.raw()),
+                Api::NewHandle(thread, uri.raw()));
     const Object& obj = Object::Handle(Api::UnwrapHandle(handle));
     if (obj.IsString()) {
       result = String2UTF8(String::Cast(obj));
@@ -312,9 +299,10 @@
       *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());
+      *error = zone->PrintToString(
+          "Unable to canonicalize uri '%s': "
+          "library tag handler returned wrong type",
+          uri.ToCString());
     }
     Dart_ExitScope();
   } else {
@@ -348,7 +336,7 @@
   if (Snapshot::IncludesCode(Dart::snapshot_kind())) {
     const Array& args = Array::Handle(Array::New(1));
     args.SetAt(0, String::Handle(String::New(
-        "Isolate.spawnUri not supported under precompilation")));
+                      "Isolate.spawnUri not supported under precompilation")));
     Exceptions::ThrowByType(Exceptions::kUnsupported, args);
     UNREACHABLE();
   }
@@ -372,21 +360,11 @@
   Dart_Port on_exit_port = onExit.IsNull() ? ILLEGAL_PORT : onExit.Id();
   Dart_Port on_error_port = onError.IsNull() ? ILLEGAL_PORT : onError.Id();
 
-  IsolateSpawnState* state =
-      new IsolateSpawnState(
-          port.Id(),
-          isolate->init_callback_data(),
-          canonical_uri,
-          utf8_package_root,
-          utf8_package_config,
-          args,
-          message,
-          isolate->spawn_count_monitor(),
-          isolate->spawn_count(),
-          paused.value(),
-          fatal_errors,
-          on_exit_port,
-          on_error_port);
+  IsolateSpawnState* state = new IsolateSpawnState(
+      port.Id(), isolate->init_callback_data(), canonical_uri,
+      utf8_package_root, utf8_package_config, args, message,
+      isolate->spawn_count_monitor(), isolate->spawn_count(), paused.value(),
+      fatal_errors, on_exit_port, on_error_port);
 
   // If we were passed a value then override the default flags state for
   // checked mode.
@@ -423,17 +401,17 @@
 DEFINE_NATIVE_ENTRY(Isolate_getPortAndCapabilitiesOfCurrentIsolate, 0) {
   const Array& result = Array::Handle(Array::New(3));
   result.SetAt(0, SendPort::Handle(SendPort::New(isolate->main_port())));
-  result.SetAt(1, Capability::Handle(
-                      Capability::New(isolate->pause_capability())));
-  result.SetAt(2, Capability::Handle(
-                      Capability::New(isolate->terminate_capability())));
+  result.SetAt(
+      1, Capability::Handle(Capability::New(isolate->pause_capability())));
+  result.SetAt(
+      2, Capability::Handle(Capability::New(isolate->terminate_capability())));
   return result.raw();
 }
 
 
 DEFINE_NATIVE_ENTRY(Isolate_getCurrentRootUriStr, 0) {
-  const Library& root_lib = Library::Handle(zone,
-      isolate->object_store()->root_library());
+  const Library& root_lib =
+      Library::Handle(zone, isolate->object_store()->root_library());
   return root_lib.url();
 }
 
@@ -449,8 +427,7 @@
   MessageWriter writer(&data, &allocator, false);
   writer.WriteMessage(msg);
 
-  PortMap::PostMessage(new Message(port.Id(),
-                                   data, writer.BytesWritten(),
+  PortMap::PostMessage(new Message(port.Id(), data, writer.BytesWritten(),
                                    Message::kOOBPriority));
   return Object::null();
 }
diff --git a/runtime/lib/isolate_patch.dart b/runtime/lib/isolate_patch.dart
index 7e4579a..3a02c7a 100644
--- a/runtime/lib/isolate_patch.dart
+++ b/runtime/lib/isolate_patch.dart
@@ -193,9 +193,9 @@
   void _sendInternal(var message) native "SendPortImpl_sendInternal_";
 }
 
-typedef _MainFunction();
-typedef _MainFunctionArgs(args);
-typedef _MainFunctionArgsMessage(args, message);
+typedef _NullaryFunction();
+typedef _UnaryFunction(args);
+typedef _BinaryFunction(args, message);
 
 /**
  * Takes the real entry point as argument and invokes it with the
@@ -253,9 +253,9 @@
     port.close();
 
     if (isSpawnUri) {
-      if (entryPoint is _MainFunctionArgsMessage) {
+      if (entryPoint is _BinaryFunction) {
         entryPoint(args, message);
-      } else if (entryPoint is _MainFunctionArgs) {
+      } else if (entryPoint is _UnaryFunction) {
         entryPoint(args);
       } else {
         entryPoint();
@@ -310,6 +310,11 @@
     // `paused` isn't handled yet.
     RawReceivePort readyPort;
     try {
+      // Check for the type of `entryPoint` on the spawning isolate to make
+      // error-handling easier.
+      if (entryPoint is! _UnaryFunction) {
+        throw new ArgumentError(entryPoint);
+      }
       // The VM will invoke [_startIsolate] with entryPoint as argument.
       readyPort = new RawReceivePort();
 
diff --git a/runtime/lib/lib_prefix.dart b/runtime/lib/lib_prefix.dart
index f457b02..1b0e87d 100644
--- a/runtime/lib/lib_prefix.dart
+++ b/runtime/lib/lib_prefix.dart
@@ -2,9 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:async";
-import "dart:isolate";
-
 // This type corresponds to the VM-internal class LibraryPrefix.
 class _LibraryPrefix {
   bool _load() native "LibraryPrefix_load";
diff --git a/runtime/lib/libgen_in.cc b/runtime/lib/libgen_in.cc
index 4e10df6..ba6f4df 100644
--- a/runtime/lib/libgen_in.cc
+++ b/runtime/lib/libgen_in.cc
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// clang-format off
+
 #include "{{INCLUDE}}" // NOLINT
 
 // This file is used to generate the mapping of libraries which have
diff --git a/runtime/lib/linked_hash_map.cc b/runtime/lib/linked_hash_map.cc
index bc128c7..7c96ed4 100644
--- a/runtime/lib/linked_hash_map.cc
+++ b/runtime/lib/linked_hash_map.cc
@@ -23,8 +23,7 @@
 DEFINE_NATIVE_ENTRY(LinkedHashMap_setIndex, 2) {
   const LinkedHashMap& map =
       LinkedHashMap::CheckedHandle(arguments->NativeArgAt(0));
-  const TypedData& index =
-      TypedData::CheckedHandle(arguments->NativeArgAt(1));
+  const TypedData& index = TypedData::CheckedHandle(arguments->NativeArgAt(1));
   map.SetIndex(index);
   return Object::null();
 }
@@ -40,8 +39,7 @@
 DEFINE_NATIVE_ENTRY(LinkedHashMap_setData, 2) {
   const LinkedHashMap& map =
       LinkedHashMap::CheckedHandle(arguments->NativeArgAt(0));
-  const Array& data =
-      Array::CheckedHandle(arguments->NativeArgAt(1));
+  const Array& data = Array::CheckedHandle(arguments->NativeArgAt(1));
   map.SetData(data);
   return Object::null();
 }
@@ -57,8 +55,7 @@
 DEFINE_NATIVE_ENTRY(LinkedHashMap_setHashMask, 2) {
   const LinkedHashMap& map =
       LinkedHashMap::CheckedHandle(arguments->NativeArgAt(0));
-  const Smi& hashMask =
-      Smi::CheckedHandle(arguments->NativeArgAt(1));
+  const Smi& hashMask = Smi::CheckedHandle(arguments->NativeArgAt(1));
   map.SetHashMask(hashMask.Value());
   return Object::null();
 }
@@ -74,8 +71,7 @@
 DEFINE_NATIVE_ENTRY(LinkedHashMap_setDeletedKeys, 2) {
   const LinkedHashMap& map =
       LinkedHashMap::CheckedHandle(arguments->NativeArgAt(0));
-  const Smi& deletedKeys =
-      Smi::CheckedHandle(arguments->NativeArgAt(1));
+  const Smi& deletedKeys = Smi::CheckedHandle(arguments->NativeArgAt(1));
   map.SetDeletedKeys(deletedKeys.Value());
   return Object::null();
 }
@@ -91,8 +87,7 @@
 DEFINE_NATIVE_ENTRY(LinkedHashMap_setUsedData, 2) {
   const LinkedHashMap& map =
       LinkedHashMap::CheckedHandle(arguments->NativeArgAt(0));
-  const Smi& usedData =
-      Smi::CheckedHandle(arguments->NativeArgAt(1));
+  const Smi& usedData = Smi::CheckedHandle(arguments->NativeArgAt(1));
   map.SetUsedData(usedData.Value());
   return Object::null();
 }
diff --git a/runtime/lib/math.cc b/runtime/lib/math.cc
index 0199782..d95e32f 100644
--- a/runtime/lib/math.cc
+++ b/runtime/lib/math.cc
@@ -68,8 +68,8 @@
 DEFINE_NATIVE_ENTRY(Math_doublePow, 2) {
   const double operand =
       Double::CheckedHandle(arguments->NativeArgAt(0)).value();
-  GET_NON_NULL_NATIVE_ARGUMENT(
-      Double, exponent_object, arguments->NativeArgAt(1));
+  GET_NON_NULL_NATIVE_ARGUMENT(Double, exponent_object,
+                               arguments->NativeArgAt(1));
   const double exponent = exponent_object.value();
   return Double::New(pow(operand, exponent));
 }
@@ -106,14 +106,14 @@
   uint64_t state = (A * state_lo) + state_hi;
   array.SetUint32(0, static_cast<uint32_t>(state));
   array.SetUint32(array.ElementSizeInBytes(),
-      static_cast<uint32_t>(state >> 32));
+                  static_cast<uint32_t>(state >> 32));
   return Object::null();
 }
 
 
 RawTypedData* CreateRandomState(Zone* zone, uint64_t seed) {
-  const TypedData& result = TypedData::Handle(
-      zone, TypedData::New(kTypedDataUint32ArrayCid, 2));
+  const TypedData& result =
+      TypedData::Handle(zone, TypedData::New(kTypedDataUint32ArrayCid, 2));
   result.SetUint32(0, static_cast<uint32_t>(seed));
   result.SetUint32(result.ElementSizeInBytes(),
                    static_cast<uint32_t>(seed >> 32));
@@ -125,11 +125,11 @@
   // Thomas Wang 64-bit mix.
   // http://www.concentric.net/~Ttwang/tech/inthash.htm
   // via. http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
-  n = (~n) + (n << 21);           // n = (n << 21) - n - 1;
+  n = (~n) + (n << 21);  // n = (n << 21) - n - 1;
   n = n ^ (n >> 24);
-  n = n * 265;                    // n = (n + (n << 3)) + (n << 8);
+  n = n * 265;  // n = (n + (n << 3)) + (n << 8);
   n = n ^ (n >> 14);
-  n = n * 21;                     // n = (n + (n << 2)) + (n << 4);
+  n = n * 21;  // n = (n + (n << 2)) + (n << 4);
   n = n ^ (n >> 28);
   n = n + (n << 31);
   return n;
diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc
index 1478f04..7a2efe0 100644
--- a/runtime/lib/mirrors.cc
+++ b/runtime/lib/mirrors.cc
@@ -24,18 +24,15 @@
 #define PROPAGATE_IF_MALFORMED(type)                                           \
   if (type.IsMalformed()) {                                                    \
     Exceptions::PropagateError(Error::Handle(type.error()));                   \
-  }                                                                            \
+  }
 
 static RawInstance* CreateMirror(const String& mirror_class_name,
                                  const Array& constructor_arguments) {
   const Library& mirrors_lib = Library::Handle(Library::MirrorsLibrary());
   const String& constructor_name = Symbols::Dot();
 
-  const Object& result = Object::Handle(
-      DartLibraryCalls::InstanceCreate(mirrors_lib,
-                                       mirror_class_name,
-                                       constructor_name,
-                                       constructor_arguments));
+  const Object& result = Object::Handle(DartLibraryCalls::InstanceCreate(
+      mirrors_lib, mirror_class_name, constructor_name, constructor_arguments));
   ASSERT(!result.IsError());
   return Instance::Cast(result).raw();
 }
@@ -53,8 +50,8 @@
                               const Array& argument_names,
                               const InvocationMirror::Call call,
                               const InvocationMirror::Type type) {
-  const Smi& invocation_type = Smi::Handle(Smi::New(
-      InvocationMirror::EncodeType(call, type)));
+  const Smi& invocation_type =
+      Smi::Handle(Smi::New(InvocationMirror::EncodeType(call, type)));
 
   const Array& args = Array::Handle(Array::New(6));
   args.SetAt(0, receiver);
@@ -73,12 +70,12 @@
   }
 
   const Library& libcore = Library::Handle(Library::CoreLibrary());
-  const Class& NoSuchMethodError = Class::Handle(
-      libcore.LookupClass(Symbols::NoSuchMethodError()));
+  const Class& NoSuchMethodError =
+      Class::Handle(libcore.LookupClass(Symbols::NoSuchMethodError()));
   const Function& throwNew = Function::Handle(
       NoSuchMethodError.LookupFunctionAllowPrivate(Symbols::ThrowNew()));
-  const Object& result = Object::Handle(
-      DartEntry::InvokeFunction(throwNew, args));
+  const Object& result =
+      Object::Handle(DartEntry::InvokeFunction(throwNew, args));
   ASSERT(result.IsError());
   Exceptions::PropagateError(Error::Cast(result));
   UNREACHABLE();
@@ -98,8 +95,8 @@
     UNREACHABLE();
   }
   if (!func.HasCode()) {
-    const Error& error = Error::Handle(
-        zone, Compiler::CompileFunction(thread, func));
+    const Error& error =
+        Error::Handle(zone, Compiler::CompileFunction(thread, func));
     if (!error.IsNull()) {
       Exceptions::PropagateError(error);
       UNREACHABLE();
@@ -111,8 +108,8 @@
                                               const Instance& owner_mirror) {
   HANDLESCOPE(Thread::Current());
   const intptr_t implicit_param_count = func.NumImplicitParameters();
-  const intptr_t non_implicit_param_count = func.NumParameters() -
-                                            implicit_param_count;
+  const intptr_t non_implicit_param_count =
+      func.NumParameters() - implicit_param_count;
   const intptr_t index_of_first_optional_param =
       non_implicit_param_count - func.NumOptionalParameters();
   const intptr_t index_of_first_named_param =
@@ -178,11 +175,11 @@
     name ^= func.ParameterNameAt(implicit_param_count + i);
     if (has_extra_parameter_info) {
       is_final ^= param_descriptor.At(i * Parser::kParameterEntrySize +
-          Parser::kParameterIsFinalOffset);
+                                      Parser::kParameterIsFinalOffset);
       default_value = param_descriptor.At(i * Parser::kParameterEntrySize +
-          Parser::kParameterDefaultValueOffset);
+                                          Parser::kParameterDefaultValueOffset);
       metadata = param_descriptor.At(i * Parser::kParameterEntrySize +
-          Parser::kParameterMetadataOffset);
+                                     Parser::kParameterMetadataOffset);
     }
     ASSERT(default_value.IsNull() || default_value.IsInstance());
 
@@ -278,15 +275,15 @@
 
   intptr_t kind_flags = 0;
   kind_flags |= (func.is_abstract() << Mirrors::kAbstract);
-  kind_flags |= (func.IsGetterFunction()  << Mirrors::kGetter);
-  kind_flags |= (func.IsSetterFunction()  << Mirrors::kSetter);
+  kind_flags |= (func.IsGetterFunction() << Mirrors::kGetter);
+  kind_flags |= (func.IsSetterFunction() << Mirrors::kSetter);
   bool is_ctor = (func.kind() == RawFunction::kConstructor);
-  kind_flags |= (is_ctor  << Mirrors::kConstructor);
+  kind_flags |= (is_ctor << Mirrors::kConstructor);
   kind_flags |= ((is_ctor && func.is_const()) << Mirrors::kConstCtor);
-  kind_flags |= ((is_ctor && func.IsGenerativeConstructor())
-                 << Mirrors::kGenerativeCtor);
-  kind_flags |= ((is_ctor && func.is_redirecting())
-                 << Mirrors::kRedirectingCtor);
+  kind_flags |=
+      ((is_ctor && func.IsGenerativeConstructor()) << Mirrors::kGenerativeCtor);
+  kind_flags |=
+      ((is_ctor && func.is_redirecting()) << Mirrors::kRedirectingCtor);
   kind_flags |= ((is_ctor && func.IsFactory()) << Mirrors::kFactoryCtor);
   kind_flags |= (func.is_external() << Mirrors::kExternal);
   args.SetAt(5, Smi::Handle(Smi::New(kind_flags)));
@@ -364,10 +361,7 @@
   args.SetAt(1, str);
   str = lib.url();
   const char* censored_libraries[] = {
-    "dart:_builtin",
-    "dart:_blink",
-    "dart:_vmservice",
-    NULL,
+      "dart:_builtin", "dart:_blink", "dart:_vmservice", NULL,
   };
   for (intptr_t i = 0; censored_libraries[i] != NULL; i++) {
     if (str.Equals(censored_libraries[i])) {
@@ -378,8 +372,8 @@
   if (str.Equals("dart:io")) {
     // Hack around dart:io being loaded into non-service isolates in Dartium.
     Isolate* isolate = thread->isolate();
-    const GrowableObjectArray& libraries = GrowableObjectArray::Handle(
-      zone, isolate->object_store()->libraries());
+    const GrowableObjectArray& libraries =
+        GrowableObjectArray::Handle(zone, isolate->object_store()->libraries());
     Library& other_lib = Library::Handle(zone);
     String& other_uri = String::Handle(zone);
     for (intptr_t i = 0; i < libraries.Length(); i++) {
@@ -483,8 +477,8 @@
   for (intptr_t i = 0; i < ports.Length(); i++) {
     ns ^= ports.At(i);
     if (!ns.IsNull()) {
-      dep = CreateLibraryDependencyMirror(
-          thread, lib_mirror, ns, prefix, true, false);
+      dep = CreateLibraryDependencyMirror(thread, lib_mirror, ns, prefix, true,
+                                          false);
       if (!dep.IsNull()) {
         deps.Add(dep);
       }
@@ -495,8 +489,8 @@
   ports = lib.exports();
   for (intptr_t i = 0; i < ports.Length(); i++) {
     ns ^= ports.At(i);
-    dep = CreateLibraryDependencyMirror(
-        thread, lib_mirror, ns, prefix, false, false);
+    dep = CreateLibraryDependencyMirror(thread, lib_mirror, ns, prefix, false,
+                                        false);
     if (!dep.IsNull()) {
       deps.Add(dep);
     }
@@ -513,8 +507,8 @@
       for (intptr_t i = 0; i < ports.Length(); i++) {
         ns ^= ports.At(i);
         if (!ns.IsNull()) {
-          dep = CreateLibraryDependencyMirror(
-              thread, lib_mirror, ns, prefix, true, prefix.is_deferred_load());
+          dep = CreateLibraryDependencyMirror(thread, lib_mirror, ns, prefix,
+                                              true, prefix.is_deferred_load());
           if (!dep.IsNull()) {
             deps.Add(dep);
           }
@@ -541,8 +535,8 @@
   if (type.IsFunctionType()) {
     const Class& scope_class = Class::Handle(Type::Cast(type).type_class());
     if (scope_class.IsTypedefClass()) {
-      return CreateTypedefMirror(scope_class,
-                                 type, Bool::False(), Object::null_instance());
+      return CreateTypedefMirror(scope_class, type, Bool::False(),
+                                 Object::null_instance());
     } else {
       return CreateFunctionTypeMirror(type);
     }
@@ -577,8 +571,8 @@
   Thread* thread = Thread::Current();
   Isolate* isolate = thread->isolate();
   const String& debug_name = String::Handle(String::New(isolate->name()));
-  const Library& root_library = Library::Handle(thread->zone(),
-      isolate->object_store()->root_library());
+  const Library& root_library =
+      Library::Handle(thread->zone(), isolate->object_store()->root_library());
   const Instance& root_library_mirror =
       Instance::Handle(CreateLibraryMirror(thread, root_library));
 
@@ -594,21 +588,21 @@
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
   const Library& lib = Library::Handle(zone, Library::MirrorsLibrary());
-  const Class& cls = Class::Handle(zone,
-      lib.LookupClassAllowPrivate(Symbols::_LocalMethodMirror()));
+  const Class& cls = Class::Handle(
+      zone, lib.LookupClassAllowPrivate(Symbols::_LocalMethodMirror()));
   const Error& error = Error::Handle(zone, cls.EnsureIsFinalized(thread));
   ASSERT(error.IsNull());
 
   Field& field = Field::Handle();
   Smi& value = Smi::Handle();
 
-  #define CHECK_KIND_SHIFT(name)                                               \
-    field = cls.LookupField(String::Handle(String::New(#name)));               \
-    ASSERT(!field.IsNull());                                                   \
-    value ^= field.StaticValue();                                              \
-    ASSERT(value.Value() == Mirrors::name);
+#define CHECK_KIND_SHIFT(name)                                                 \
+  field = cls.LookupField(String::Handle(String::New(#name)));                 \
+  ASSERT(!field.IsNull());                                                     \
+  value ^= field.StaticValue();                                                \
+  ASSERT(value.Value() == Mirrors::name);
   MIRRORS_KIND_SHIFT_LIST(CHECK_KIND_SHIFT)
-  #undef CHECK_KIND_SHIFT
+#undef CHECK_KIND_SHIFT
 #endif
 }
 
@@ -628,27 +622,21 @@
 
 // Invoke the function, or noSuchMethod if it is null. Propagate any unhandled
 // exceptions. Wrap and propagate any compilation errors.
-static RawInstance* InvokeDynamicFunction(
-    const Instance& receiver,
-    const Function& function,
-    const String& target_name,
-    const Array& args,
-    const Array& args_descriptor_array) {
+static RawInstance* InvokeDynamicFunction(const Instance& receiver,
+                                          const Function& function,
+                                          const String& target_name,
+                                          const Array& args,
+                                          const Array& args_descriptor_array) {
   // Note "args" is already the internal arguments with the receiver as the
   // first element.
   Object& result = Object::Handle();
   ArgumentsDescriptor args_descriptor(args_descriptor_array);
-  if (function.IsNull() ||
-      !function.is_reflectable() ||
+  if (function.IsNull() || !function.is_reflectable() ||
       !function.AreValidArguments(args_descriptor, NULL)) {
-    result = DartEntry::InvokeNoSuchMethod(receiver,
-                                           target_name,
-                                           args,
+    result = DartEntry::InvokeNoSuchMethod(receiver, target_name, args,
                                            args_descriptor_array);
   } else {
-    result = DartEntry::InvokeFunction(function,
-                                       args,
-                                       args_descriptor_array);
+    result = DartEntry::InvokeFunction(function, args, args_descriptor_array);
   }
   return ReturnResult(result);
 }
@@ -661,8 +649,7 @@
   // The getter function may either be in the library or in the field's owner
   // class, depending on whether it was an actual getter, or an uninitialized
   // field.
-  const Field& field = Field::Handle(
-      library.LookupLocalField(getter_name));
+  const Field& field = Field::Handle(library.LookupLocalField(getter_name));
   Function& getter = Function::Handle();
   if (field.IsNull()) {
     // No field found. Check for a getter in the lib.
@@ -698,13 +685,9 @@
   }
 
   if (throw_nsm_if_absent) {
-    ThrowNoSuchMethod(Instance::null_instance(),
-                      getter_name,
-                      getter,
-                      Object::null_array(),
-                      Object::null_array(),
-                      InvocationMirror::kTopLevel,
-                      InvocationMirror::kGetter);
+    ThrowNoSuchMethod(Instance::null_instance(), getter_name, getter,
+                      Object::null_array(), Object::null_array(),
+                      InvocationMirror::kTopLevel, InvocationMirror::kGetter);
     UNREACHABLE();
   }
 
@@ -719,13 +702,12 @@
                                       const String& getter_name,
                                       const bool throw_nsm_if_absent) {
   // Note static fields do not have implicit getters.
-  const Field& field =
-      Field::Handle(klass.LookupStaticField(getter_name));
+  const Field& field = Field::Handle(klass.LookupStaticField(getter_name));
   if (field.IsNull() || field.IsUninitialized()) {
-    const String& internal_getter_name = String::Handle(
-        Field::GetterName(getter_name));
-    Function& getter = Function::Handle(
-        klass.LookupStaticFunction(internal_getter_name));
+    const String& internal_getter_name =
+        String::Handle(Field::GetterName(getter_name));
+    Function& getter =
+        Function::Handle(klass.LookupStaticFunction(internal_getter_name));
 
     if (getter.IsNull() || !getter.is_reflectable()) {
       if (getter.IsNull()) {
@@ -738,13 +720,9 @@
         }
       }
       if (throw_nsm_if_absent) {
-        ThrowNoSuchMethod(AbstractType::Handle(klass.RareType()),
-                          getter_name,
-                          getter,
-                          Object::null_array(),
-                          Object::null_array(),
-                          InvocationMirror::kStatic,
-                          InvocationMirror::kGetter);
+        ThrowNoSuchMethod(AbstractType::Handle(klass.RareType()), getter_name,
+                          getter, Object::null_array(), Object::null_array(),
+                          InvocationMirror::kStatic, InvocationMirror::kGetter);
         UNREACHABLE();
       }
       // Fall through case: Indicate that we didn't find any function or field
@@ -791,8 +769,8 @@
 
 
 DEFINE_NATIVE_ENTRY(MirrorSystem_libraries, 0) {
-  const GrowableObjectArray& libraries = GrowableObjectArray::Handle(
-      zone, isolate->object_store()->libraries());
+  const GrowableObjectArray& libraries =
+      GrowableObjectArray::Handle(zone, isolate->object_store()->libraries());
 
   const intptr_t num_libraries = libraries.Length();
   const GrowableObjectArray& library_mirrors = GrowableObjectArray::Handle(
@@ -829,8 +807,7 @@
     Exceptions::ThrowArgumentError(type);
     UNREACHABLE();
   }
-  return CreateClassMirror(cls,
-                           AbstractType::Handle(cls.DeclarationType()),
+  return CreateClassMirror(cls, AbstractType::Handle(cls.DeclarationType()),
                            Bool::True(),  // is_declaration
                            Object::null_instance());
 }
@@ -899,8 +876,7 @@
 
 
 DEFINE_NATIVE_ENTRY(FunctionTypeMirror_call_method, 2) {
-  GET_NON_NULL_NATIVE_ARGUMENT(Instance,
-                               owner_mirror,
+  GET_NON_NULL_NATIVE_ARGUMENT(Instance, owner_mirror,
                                arguments->NativeArgAt(0));
   GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(1));
   // TODO(rmacnak): Return get:call() method on class _Closure instead?
@@ -921,8 +897,7 @@
 
 DEFINE_NATIVE_ENTRY(FunctionTypeMirror_return_type, 2) {
   GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0));
-  GET_NON_NULL_NATIVE_ARGUMENT(AbstractType,
-                               instantiator,
+  GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, instantiator,
                                arguments->NativeArgAt(1));
   const Function& func = Function::Handle(ref.GetFunctionReferent());
   ASSERT(!func.IsNull());
@@ -1011,8 +986,7 @@
 
 DEFINE_NATIVE_ENTRY(ClassMirror_mixin_instantiated, 2) {
   GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, type, arguments->NativeArgAt(0));
-  GET_NON_NULL_NATIVE_ARGUMENT(AbstractType,
-                               instantiator,
+  GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, instantiator,
                                arguments->NativeArgAt(1));
   PROPAGATE_IF_MALFORMED(type);
   ASSERT(type.IsFinalized());
@@ -1027,11 +1001,9 @@
 
 
 DEFINE_NATIVE_ENTRY(ClassMirror_members, 3) {
-  GET_NON_NULL_NATIVE_ARGUMENT(Instance,
-                               owner_mirror,
+  GET_NON_NULL_NATIVE_ARGUMENT(Instance, owner_mirror,
                                arguments->NativeArgAt(0));
-  GET_NATIVE_ARGUMENT(AbstractType,
-                      owner_instantiator,
+  GET_NATIVE_ARGUMENT(AbstractType, owner_instantiator,
                       arguments->NativeArgAt(1));
   GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(2));
   const Class& klass = Class::Handle(ref.GetClassReferent());
@@ -1065,10 +1037,10 @@
     func ^= functions.At(i);
     if (func.is_reflectable() &&
         (func.kind() == RawFunction::kRegularFunction ||
-        func.kind() == RawFunction::kGetterFunction ||
-        func.kind() == RawFunction::kSetterFunction)) {
-      member_mirror = CreateMethodMirror(func, owner_mirror,
-                                         owner_instantiator);
+         func.kind() == RawFunction::kGetterFunction ||
+         func.kind() == RawFunction::kSetterFunction)) {
+      member_mirror =
+          CreateMethodMirror(func, owner_mirror, owner_instantiator);
       member_mirrors.Add(member_mirror);
     }
   }
@@ -1078,11 +1050,9 @@
 
 
 DEFINE_NATIVE_ENTRY(ClassMirror_constructors, 3) {
-  GET_NON_NULL_NATIVE_ARGUMENT(Instance,
-                               owner_mirror,
+  GET_NON_NULL_NATIVE_ARGUMENT(Instance, owner_mirror,
                                arguments->NativeArgAt(0));
-  GET_NATIVE_ARGUMENT(AbstractType,
-                      owner_instantiator,
+  GET_NATIVE_ARGUMENT(AbstractType, owner_instantiator,
                       arguments->NativeArgAt(1));
   GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(2));
   const Class& klass = Class::Handle(ref.GetClassReferent());
@@ -1096,15 +1066,15 @@
   const intptr_t num_functions = functions.Length();
 
   Instance& constructor_mirror = Instance::Handle();
-  const GrowableObjectArray& constructor_mirrors = GrowableObjectArray::Handle(
-      GrowableObjectArray::New(num_functions));
+  const GrowableObjectArray& constructor_mirrors =
+      GrowableObjectArray::Handle(GrowableObjectArray::New(num_functions));
 
   Function& func = Function::Handle();
   for (intptr_t i = 0; i < num_functions; i++) {
     func ^= functions.At(i);
     if (func.is_reflectable() && func.kind() == RawFunction::kConstructor) {
-      constructor_mirror = CreateMethodMirror(func, owner_mirror,
-                                              owner_instantiator);
+      constructor_mirror =
+          CreateMethodMirror(func, owner_mirror, owner_instantiator);
       constructor_mirrors.Add(constructor_mirror);
     }
   }
@@ -1114,8 +1084,7 @@
 
 
 DEFINE_NATIVE_ENTRY(LibraryMirror_members, 2) {
-  GET_NON_NULL_NATIVE_ARGUMENT(Instance,
-                               owner_mirror,
+  GET_NON_NULL_NATIVE_ARGUMENT(Instance, owner_mirror,
                                arguments->NativeArgAt(0));
   GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(1));
   const Library& library = Library::Handle(ref.GetLibraryReferent());
@@ -1139,8 +1108,7 @@
       // mixin applications.
       if (!klass.IsDynamicClass() && !klass.IsMixinApplication()) {
         type = klass.DeclarationType();
-        member_mirror = CreateClassMirror(klass,
-                                          type,
+        member_mirror = CreateClassMirror(klass, type,
                                           Bool::True(),  // is_declaration
                                           owner_mirror);
         member_mirrors.Add(member_mirror);
@@ -1155,10 +1123,10 @@
       const Function& func = Function::Cast(entry);
       if (func.is_reflectable() &&
           (func.kind() == RawFunction::kRegularFunction ||
-          func.kind() == RawFunction::kGetterFunction ||
-          func.kind() == RawFunction::kSetterFunction)) {
-        member_mirror = CreateMethodMirror(func, owner_mirror,
-                                           AbstractType::Handle());
+           func.kind() == RawFunction::kGetterFunction ||
+           func.kind() == RawFunction::kSetterFunction)) {
+        member_mirror =
+            CreateMethodMirror(func, owner_mirror, AbstractType::Handle());
         member_mirrors.Add(member_mirror);
       }
     }
@@ -1222,8 +1190,7 @@
   GET_NON_NULL_NATIVE_ARGUMENT(TypeParameter, param, arguments->NativeArgAt(0));
   const Class& owner = Class::Handle(param.parameterized_class());
   const AbstractType& type = AbstractType::Handle(owner.DeclarationType());
-  return CreateClassMirror(owner,
-                           type,
+  return CreateClassMirror(owner, type,
                            Bool::True(),  // is_declaration
                            Instance::null_instance());
 }
@@ -1259,10 +1226,8 @@
     }
   }
   ASSERT(!ctxt_library.IsNull());
-  const Object& result =
-     Object::Handle(ctxt_library.Evaluate(expression,
-                                          Array::empty_array(),
-                                          Array::empty_array()));
+  const Object& result = Object::Handle(ctxt_library.Evaluate(
+      expression, Array::empty_array(), Array::empty_array()));
   if (result.IsError()) {
     Exceptions::PropagateError(Error::Cast(result));
     UNREACHABLE();
@@ -1285,8 +1250,7 @@
   ASSERT(type.IsFunctionType());
   const Class& cls = Class::Handle(type.type_class());
   ASSERT(cls.IsTypedefClass());
-  return CreateTypedefMirror(cls,
-                             AbstractType::Handle(cls.DeclarationType()),
+  return CreateTypedefMirror(cls, AbstractType::Handle(cls.DeclarationType()),
                              Bool::True(),  // is_declaration
                              Object::null_instance());
 }
@@ -1296,14 +1260,14 @@
   // because this native is an instance method in order to be polymorphic
   // with its cousins.
   GET_NATIVE_ARGUMENT(Instance, reflectee, arguments->NativeArgAt(1));
-  GET_NON_NULL_NATIVE_ARGUMENT(
-      String, function_name, arguments->NativeArgAt(2));
+  GET_NON_NULL_NATIVE_ARGUMENT(String, function_name,
+                               arguments->NativeArgAt(2));
   GET_NON_NULL_NATIVE_ARGUMENT(Array, args, arguments->NativeArgAt(3));
   GET_NON_NULL_NATIVE_ARGUMENT(Array, arg_names, arguments->NativeArgAt(4));
 
   Class& klass = Class::Handle(reflectee.clazz());
-  Function& function = Function::Handle(zone,
-      Resolver::ResolveDynamicAnyArgs(zone, klass, function_name));
+  Function& function = Function::Handle(
+      zone, Resolver::ResolveDynamicAnyArgs(zone, klass, function_name));
 
   const Array& args_descriptor =
       Array::Handle(zone, ArgumentsDescriptor::New(args.Length(), arg_names));
@@ -1321,12 +1285,9 @@
       getter_args.SetAt(0, reflectee);
       const Array& getter_args_descriptor =
           Array::Handle(zone, ArgumentsDescriptor::New(getter_args.Length()));
-      const Instance& getter_result = Instance::Handle(zone,
-          InvokeDynamicFunction(reflectee,
-                                function,
-                                getter_name,
-                                getter_args,
-                                getter_args_descriptor));
+      const Instance& getter_result = Instance::Handle(
+          zone, InvokeDynamicFunction(reflectee, function, getter_name,
+                                      getter_args, getter_args_descriptor));
       // Replace the closure as the receiver in the arguments list.
       args.SetAt(0, getter_result);
       // Call the closure.
@@ -1341,10 +1302,7 @@
   }
 
   // Found an ordinary method.
-  return InvokeDynamicFunction(reflectee,
-                               function,
-                               function_name,
-                               args,
+  return InvokeDynamicFunction(reflectee, function, function_name, args,
                                args_descriptor);
 }
 
@@ -1357,17 +1315,17 @@
   GET_NON_NULL_NATIVE_ARGUMENT(String, getter_name, arguments->NativeArgAt(2));
   Class& klass = Class::Handle(reflectee.clazz());
 
-  const String& internal_getter_name = String::Handle(
-      Field::GetterName(getter_name));
-  Function& function = Function::Handle(zone,
-      Resolver::ResolveDynamicAnyArgs(zone, klass, internal_getter_name));
+  const String& internal_getter_name =
+      String::Handle(Field::GetterName(getter_name));
+  Function& function = Function::Handle(
+      zone, Resolver::ResolveDynamicAnyArgs(zone, klass, internal_getter_name));
 
   // Check for method extraction when method extractors are not created.
   if (function.IsNull() && !FLAG_lazy_dispatchers) {
     function = Resolver::ResolveDynamicAnyArgs(zone, klass, getter_name);
     if (!function.IsNull()) {
       const Function& closure_function =
-        Function::Handle(zone, function.ImplicitClosureFunction());
+          Function::Handle(zone, function.ImplicitClosureFunction());
       return closure_function.ImplicitInstanceClosure(reflectee);
     }
   }
@@ -1379,10 +1337,7 @@
       Array::Handle(zone, ArgumentsDescriptor::New(args.Length()));
 
   // InvokeDynamic invokes NoSuchMethod if the provided function is null.
-  return InvokeDynamicFunction(reflectee,
-                               function,
-                               internal_getter_name,
-                               args,
+  return InvokeDynamicFunction(reflectee, function, internal_getter_name, args,
                                args_descriptor);
 }
 
@@ -1398,8 +1353,8 @@
   const Class& klass = Class::Handle(zone, reflectee.clazz());
   const String& internal_setter_name =
       String::Handle(zone, Field::SetterName(setter_name));
-  const Function& setter = Function::Handle(zone,
-      Resolver::ResolveDynamicAnyArgs(zone, klass, internal_setter_name));
+  const Function& setter = Function::Handle(
+      zone, Resolver::ResolveDynamicAnyArgs(zone, klass, internal_setter_name));
 
   const int kNumArgs = 2;
   const Array& args = Array::Handle(zone, Array::New(kNumArgs));
@@ -1408,17 +1363,14 @@
   const Array& args_descriptor =
       Array::Handle(zone, ArgumentsDescriptor::New(args.Length()));
 
-  return InvokeDynamicFunction(reflectee,
-                               setter,
-                               internal_setter_name,
-                               args,
+  return InvokeDynamicFunction(reflectee, setter, internal_setter_name, args,
                                args_descriptor);
 }
 
 
 DEFINE_NATIVE_ENTRY(InstanceMirror_computeType, 1) {
   GET_NON_NULL_NATIVE_ARGUMENT(Instance, instance, arguments->NativeArgAt(0));
-  const AbstractType& type = AbstractType::Handle(instance.GetType());
+  const AbstractType& type = AbstractType::Handle(instance.GetType(Heap::kNew));
   // The static type of null is specified to be the bottom type, however, the
   // runtime type of null is the Null type, which we correctly return here.
   return type.Canonicalize();
@@ -1449,8 +1401,7 @@
       instantiator = Type::New(cls, arguments, TokenPosition::kNoSource);
       instantiator.SetIsFinalized();
     }
-    return CreateMethodMirror(function,
-                              Instance::null_instance(),
+    return CreateMethodMirror(function, Instance::null_instance(),
                               instantiator);
   }
   return Instance::null();
@@ -1463,8 +1414,8 @@
   // with its cousins.
   GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(1));
   const Class& klass = Class::Handle(ref.GetClassReferent());
-  GET_NON_NULL_NATIVE_ARGUMENT(
-      String, function_name, arguments->NativeArgAt(2));
+  GET_NON_NULL_NATIVE_ARGUMENT(String, function_name,
+                               arguments->NativeArgAt(2));
   GET_NON_NULL_NATIVE_ARGUMENT(Array, args, arguments->NativeArgAt(3));
   GET_NON_NULL_NATIVE_ARGUMENT(Array, arg_names, arguments->NativeArgAt(4));
 
@@ -1474,8 +1425,8 @@
     UNREACHABLE();
   }
 
-  Function& function = Function::Handle(
-      klass.LookupStaticFunction(function_name));
+  Function& function =
+      Function::Handle(klass.LookupStaticFunction(function_name));
 
   if (function.IsNull()) {
     // Didn't find a method: try to find a getter and invoke call on its result.
@@ -1499,8 +1450,8 @@
         call_args.SetAt(i + 1, temp);
       }
       call_args.SetAt(0, getter_result);
-      const Array& call_args_descriptor_array =
-        Array::Handle(ArgumentsDescriptor::New(call_args.Length(), arg_names));
+      const Array& call_args_descriptor_array = Array::Handle(
+          ArgumentsDescriptor::New(call_args.Length(), arg_names));
       // Call the closure.
       const Object& call_result = Object::Handle(
           DartEntry::InvokeClosure(call_args, call_args_descriptor_array));
@@ -1517,15 +1468,10 @@
 
   ArgumentsDescriptor args_descriptor(args_descriptor_array);
 
-  if (function.IsNull() ||
-      !function.AreValidArguments(args_descriptor, NULL) ||
+  if (function.IsNull() || !function.AreValidArguments(args_descriptor, NULL) ||
       !function.is_reflectable()) {
-    ThrowNoSuchMethod(AbstractType::Handle(klass.RareType()),
-                      function_name,
-                      function,
-                      args,
-                      arg_names,
-                      InvocationMirror::kStatic,
+    ThrowNoSuchMethod(AbstractType::Handle(klass.RareType()), function_name,
+                      function, args, arg_names, InvocationMirror::kStatic,
                       InvocationMirror::kMethod);
     UNREACHABLE();
   }
@@ -1572,11 +1518,10 @@
   }
 
   // Check for real fields and user-defined setters.
-  const Field& field =
-      Field::Handle(klass.LookupStaticField(setter_name));
+  const Field& field = Field::Handle(klass.LookupStaticField(setter_name));
   Function& setter = Function::Handle();
-  const String& internal_setter_name = String::Handle(
-      Field::SetterName(setter_name));
+  const String& internal_setter_name =
+      String::Handle(Field::SetterName(setter_name));
 
   if (field.IsNull()) {
     setter = klass.LookupStaticFunction(internal_setter_name);
@@ -1587,18 +1532,14 @@
 
     if (setter.IsNull() || !setter.is_reflectable()) {
       ThrowNoSuchMethod(AbstractType::Handle(klass.RareType()),
-                        internal_setter_name,
-                        setter,
-                        args,
-                        Object::null_array(),
-                        InvocationMirror::kStatic,
+                        internal_setter_name, setter, args,
+                        Object::null_array(), InvocationMirror::kStatic,
                         InvocationMirror::kSetter);
       UNREACHABLE();
     }
 
     // Invoke the setter and return the result.
-    Object& result = Object::Handle(
-        DartEntry::InvokeFunction(setter, args));
+    Object& result = Object::Handle(DartEntry::InvokeFunction(setter, args));
     if (result.IsError()) {
       Exceptions::PropagateError(Error::Cast(result));
       UNREACHABLE();
@@ -1607,13 +1548,13 @@
   }
 
   if (field.is_final() || !field.is_reflectable()) {
+    const int kNumArgs = 1;
+    const Array& args = Array::Handle(Array::New(kNumArgs));
+    args.SetAt(0, value);
+
     ThrowNoSuchMethod(AbstractType::Handle(klass.RareType()),
-                      internal_setter_name,
-                      setter,
-                      Object::null_array(),
-                      Object::null_array(),
-                      InvocationMirror::kStatic,
-                      InvocationMirror::kSetter);
+                      internal_setter_name, setter, args, Object::null_array(),
+                      InvocationMirror::kStatic, InvocationMirror::kSetter);
     UNREACHABLE();
   }
 
@@ -1626,8 +1567,8 @@
   GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0));
   const Class& klass = Class::Handle(ref.GetClassReferent());
   GET_NATIVE_ARGUMENT(Type, type, arguments->NativeArgAt(1));
-  GET_NON_NULL_NATIVE_ARGUMENT(
-      String, constructor_name, arguments->NativeArgAt(2));
+  GET_NON_NULL_NATIVE_ARGUMENT(String, constructor_name,
+                               arguments->NativeArgAt(2));
   GET_NON_NULL_NATIVE_ARGUMENT(Array, explicit_args, arguments->NativeArgAt(3));
   GET_NON_NULL_NATIVE_ARGUMENT(Array, arg_names, arguments->NativeArgAt(4));
 
@@ -1651,18 +1592,15 @@
     external_constructor_name = internal_constructor_name.raw();
   }
 
-  Function& lookup_constructor = Function::Handle(
-      klass.LookupFunction(internal_constructor_name));
+  Function& lookup_constructor =
+      Function::Handle(klass.LookupFunction(internal_constructor_name));
 
   if (lookup_constructor.IsNull() ||
       (lookup_constructor.kind() != RawFunction::kConstructor) ||
       !lookup_constructor.is_reflectable()) {
     ThrowNoSuchMethod(AbstractType::Handle(klass.RareType()),
-                      external_constructor_name,
-                      lookup_constructor,
-                      explicit_args,
-                      arg_names,
-                      InvocationMirror::kConstructor,
+                      external_constructor_name, lookup_constructor,
+                      explicit_args, arg_names, InvocationMirror::kConstructor,
                       InvocationMirror::kMethod);
     UNREACHABLE();
   }
@@ -1726,19 +1664,15 @@
   }
 
   const Array& args_descriptor_array =
-      Array::Handle(ArgumentsDescriptor::New(args.Length(),
-                                             arg_names));
+      Array::Handle(ArgumentsDescriptor::New(args.Length(), arg_names));
 
   ArgumentsDescriptor args_descriptor(args_descriptor_array);
   if (!redirected_constructor.AreValidArguments(args_descriptor, NULL) ||
       !redirected_constructor.is_reflectable()) {
     external_constructor_name = redirected_constructor.name();
     ThrowNoSuchMethod(AbstractType::Handle(klass.RareType()),
-                      external_constructor_name,
-                      redirected_constructor,
-                      explicit_args,
-                      arg_names,
-                      InvocationMirror::kConstructor,
+                      external_constructor_name, redirected_constructor,
+                      explicit_args, arg_names, InvocationMirror::kConstructor,
                       InvocationMirror::kMethod);
     UNREACHABLE();
   }
@@ -1762,10 +1696,8 @@
   }
 
   // Invoke the constructor and return the new object.
-  const Object& result =
-      Object::Handle(DartEntry::InvokeFunction(redirected_constructor,
-                                               args,
-                                               args_descriptor_array));
+  const Object& result = Object::Handle(DartEntry::InvokeFunction(
+      redirected_constructor, args, args_descriptor_array));
   if (result.IsError()) {
     Exceptions::PropagateError(Error::Cast(result));
     UNREACHABLE();
@@ -1788,13 +1720,13 @@
   // with its cousins.
   GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(1));
   const Library& library = Library::Handle(ref.GetLibraryReferent());
-  GET_NON_NULL_NATIVE_ARGUMENT(
-      String, function_name, arguments->NativeArgAt(2));
+  GET_NON_NULL_NATIVE_ARGUMENT(String, function_name,
+                               arguments->NativeArgAt(2));
   GET_NON_NULL_NATIVE_ARGUMENT(Array, args, arguments->NativeArgAt(3));
   GET_NON_NULL_NATIVE_ARGUMENT(Array, arg_names, arguments->NativeArgAt(4));
 
-  Function& function = Function::Handle(
-      library.LookupLocalFunction(function_name));
+  Function& function =
+      Function::Handle(library.LookupLocalFunction(function_name));
 
   if (function.IsNull()) {
     // Didn't find a method: try to find a getter and invoke call on its result.
@@ -1827,15 +1759,10 @@
       Array::Handle(ArgumentsDescriptor::New(args.Length(), arg_names));
   ArgumentsDescriptor args_descriptor(args_descriptor_array);
 
-  if (function.IsNull() ||
-      !function.AreValidArguments(args_descriptor, NULL) ||
+  if (function.IsNull() || !function.AreValidArguments(args_descriptor, NULL) ||
       !function.is_reflectable()) {
-    ThrowNoSuchMethod(Instance::null_instance(),
-                      function_name,
-                      function,
-                      args,
-                      arg_names,
-                      InvocationMirror::kTopLevel,
+    ThrowNoSuchMethod(Instance::null_instance(), function_name, function, args,
+                      arg_names, InvocationMirror::kTopLevel,
                       InvocationMirror::kMethod);
     UNREACHABLE();
   }
@@ -1873,8 +1800,7 @@
   // To access a top-level we may need to use the Field or the
   // setter Function.  The setter function may either be in the
   // library or in the field's owner class, depending.
-  const Field& field = Field::Handle(
-      library.LookupLocalField(setter_name));
+  const Field& field = Field::Handle(library.LookupLocalField(setter_name));
   Function& setter = Function::Handle();
   const String& internal_setter_name =
       String::Handle(Field::SetterName(setter_name));
@@ -1887,19 +1813,15 @@
     args.SetAt(0, value);
 
     if (setter.IsNull() || !setter.is_reflectable()) {
-      ThrowNoSuchMethod(Instance::null_instance(),
-                        internal_setter_name,
-                        setter,
-                        args,
-                        Object::null_array(),
-                        InvocationMirror::kTopLevel,
+      ThrowNoSuchMethod(Instance::null_instance(), internal_setter_name, setter,
+                        args, Object::null_array(), InvocationMirror::kTopLevel,
                         InvocationMirror::kSetter);
       UNREACHABLE();
     }
 
     // Invoke the setter and return the result.
-    const Object& result = Object::Handle(
-        DartEntry::InvokeFunction(setter, args));
+    const Object& result =
+        Object::Handle(DartEntry::InvokeFunction(setter, args));
     if (result.IsError()) {
       Exceptions::PropagateError(Error::Cast(result));
       UNREACHABLE();
@@ -1908,12 +1830,12 @@
   }
 
   if (field.is_final() || !field.is_reflectable()) {
-    ThrowNoSuchMethod(Instance::null_instance(),
-                      internal_setter_name,
-                      setter,
-                      Object::null_array(),
-                      Object::null_array(),
-                      InvocationMirror::kTopLevel,
+    const int kNumArgs = 1;
+    const Array& args = Array::Handle(Array::New(kNumArgs));
+    args.SetAt(0, value);
+
+    ThrowNoSuchMethod(Instance::null_instance(), internal_setter_name, setter,
+                      args, Object::null_array(), InvocationMirror::kTopLevel,
                       InvocationMirror::kSetter);
     UNREACHABLE();
   }
@@ -1928,8 +1850,8 @@
   GET_NATIVE_ARGUMENT(AbstractType, instantiator, arguments->NativeArgAt(1));
   const Function& func = Function::Handle(ref.GetFunctionReferent());
   if (func.IsNonImplicitClosureFunction()) {
-    return CreateMethodMirror(Function::Handle(
-        func.parent_function()), Object::null_instance(), instantiator);
+    return CreateMethodMirror(Function::Handle(func.parent_function()),
+                              Object::null_instance(), instantiator);
   }
   const Class& owner = Class::Handle(func.Owner());
   if (owner.IsTopLevel()) {
@@ -2004,10 +1926,8 @@
   } else if (decl.IsClass()) {
     const Class& cls = Class::Cast(decl);
     const bool is_typedef = cls.IsTypedefClass();
-    if (cls.is_synthesized_class() &&
-        !is_typedef &&
-        !cls.is_mixin_app_alias() &&
-        !cls.is_enum_class()) {
+    if (cls.is_synthesized_class() && !is_typedef &&
+        !cls.is_mixin_app_alias() && !cls.is_enum_class()) {
       return Instance::null();  // Synthetic.
     }
     script = cls.script();
diff --git a/runtime/lib/mirrors.h b/runtime/lib/mirrors.h
index 40bd5d5..d6a5398 100644
--- a/runtime/lib/mirrors.h
+++ b/runtime/lib/mirrors.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef LIB_MIRRORS_H_
-#define LIB_MIRRORS_H_
+#ifndef RUNTIME_LIB_MIRRORS_H_
+#define RUNTIME_LIB_MIRRORS_H_
 
 #include "vm/allocation.h"
 
@@ -11,25 +11,25 @@
 
 class Mirrors : public AllStatic {
  public:
-  #define MIRRORS_KIND_SHIFT_LIST(V)                                           \
-    V(kAbstract)                                                               \
-    V(kGetter)                                                                 \
-    V(kSetter)                                                                 \
-    V(kConstructor)                                                            \
-    V(kConstCtor)                                                              \
-    V(kGenerativeCtor)                                                         \
-    V(kRedirectingCtor)                                                        \
-    V(kFactoryCtor)                                                            \
-    V(kExternal)                                                               \
+#define MIRRORS_KIND_SHIFT_LIST(V)                                             \
+  V(kAbstract)                                                                 \
+  V(kGetter)                                                                   \
+  V(kSetter)                                                                   \
+  V(kConstructor)                                                              \
+  V(kConstCtor)                                                                \
+  V(kGenerativeCtor)                                                           \
+  V(kRedirectingCtor)                                                          \
+  V(kFactoryCtor)                                                              \
+  V(kExternal)
 
   // These offsets much be kept in sync with those in mirrors_impl.dart.
   enum KindShifts {
-  #define DEFINE_KIND_SHIFT_ENUM(name) name,
-  MIRRORS_KIND_SHIFT_LIST(DEFINE_KIND_SHIFT_ENUM)
-  #undef DEFINE_KIND_SHIFT_ENUM
+#define DEFINE_KIND_SHIFT_ENUM(name) name,
+    MIRRORS_KIND_SHIFT_LIST(DEFINE_KIND_SHIFT_ENUM)
+#undef DEFINE_KIND_SHIFT_ENUM
   };
 };
 
 }  // namespace dart
 
-#endif  // LIB_MIRRORS_H_
+#endif  // RUNTIME_LIB_MIRRORS_H_
diff --git a/runtime/lib/mirrors_impl.dart b/runtime/lib/mirrors_impl.dart
index 8fdd7ba..0305f12 100644
--- a/runtime/lib/mirrors_impl.dart
+++ b/runtime/lib/mirrors_impl.dart
@@ -4,9 +4,6 @@
 
 // VM-specific implementation of the dart:mirrors library.
 
-import "dart:collection" show UnmodifiableListView, UnmodifiableMapView;
-import "dart:async" show Future;
-
 var dirty = false;
 final emptyList = new UnmodifiableListView([]);
 final emptyMap = new UnmodifiableMapView({});
diff --git a/runtime/lib/mirrors_patch.dart b/runtime/lib/mirrors_patch.dart
index 2e2da5b..03bd1b6 100644
--- a/runtime/lib/mirrors_patch.dart
+++ b/runtime/lib/mirrors_patch.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+import "dart:async" show Future;
+import "dart:collection" show UnmodifiableListView, UnmodifiableMapView;
 import "dart:_internal" as internal;
 
 /**
diff --git a/runtime/lib/mirrors_sources.gypi b/runtime/lib/mirrors_sources.gypi
index 295ab85..46da082 100644
--- a/runtime/lib/mirrors_sources.gypi
+++ b/runtime/lib/mirrors_sources.gypi
@@ -8,6 +8,8 @@
   'sources': [
     'mirrors.cc',
     'mirrors.h',
+    # mirrors_patch.dart needs to be the first dart file because it contains
+    # imports.
     'mirrors_patch.dart',
     'mirrors_impl.dart',
     'mirror_reference.dart',
diff --git a/runtime/lib/null_patch.dart b/runtime/lib/null_patch.dart
index 312804e..0f22e67 100644
--- a/runtime/lib/null_patch.dart
+++ b/runtime/lib/null_patch.dart
@@ -5,14 +5,7 @@
 // Dart core library.
 
 @patch class Null {
-
-  factory Null._uninstantiable() {
-    throw new UnsupportedError("class Null cannot be instantiated");
-  }
-
   static const _HASH_CODE = 2011; // The year Dart was announced and a prime.
   int get hashCode => _HASH_CODE;
   int get _identityHashCode => _HASH_CODE;
-
-  String toString() => 'null';
 }
diff --git a/runtime/lib/object.cc b/runtime/lib/object.cc
index e1b7a71..6a7db55 100644
--- a/runtime/lib/object.cc
+++ b/runtime/lib/object.cc
@@ -73,8 +73,8 @@
   GET_NON_NULL_NATIVE_ARGUMENT(String, member_name, arguments->NativeArgAt(2));
   GET_NON_NULL_NATIVE_ARGUMENT(Smi, invocation_type, arguments->NativeArgAt(3));
   GET_NON_NULL_NATIVE_ARGUMENT(Instance, func_args, arguments->NativeArgAt(4));
-  GET_NON_NULL_NATIVE_ARGUMENT(
-      Instance, func_named_args, arguments->NativeArgAt(5));
+  GET_NON_NULL_NATIVE_ARGUMENT(Instance, func_named_args,
+                               arguments->NativeArgAt(5));
   const Array& dart_arguments = Array::Handle(Array::New(6));
   dart_arguments.SetAt(0, instance);
   dart_arguments.SetAt(1, member_name);
@@ -116,9 +116,53 @@
 
 DEFINE_NATIVE_ENTRY(Object_runtimeType, 1) {
   const Instance& instance = Instance::CheckedHandle(arguments->NativeArgAt(0));
-  // Special handling for following types outside this native.
-  ASSERT(!instance.IsString() && !instance.IsInteger() && !instance.IsDouble());
-  return instance.GetType();
+  if (instance.IsString()) {
+    return Type::StringType();
+  } else if (instance.IsInteger()) {
+    return Type::IntType();
+  } else if (instance.IsDouble()) {
+    return Type::Double();
+  }
+  return instance.GetType(Heap::kNew);
+}
+
+
+DEFINE_NATIVE_ENTRY(Object_haveSameRuntimeType, 2) {
+  const Instance& left = Instance::CheckedHandle(arguments->NativeArgAt(0));
+  const Instance& right = Instance::CheckedHandle(arguments->NativeArgAt(1));
+
+  const intptr_t left_cid = left.GetClassId();
+  const intptr_t right_cid = right.GetClassId();
+
+  if (left_cid != right_cid) {
+    if (RawObject::IsIntegerClassId(left_cid)) {
+      return Bool::Get(RawObject::IsIntegerClassId(right_cid)).raw();
+    } else if (RawObject::IsStringClassId(right_cid)) {
+      return Bool::Get(RawObject::IsStringClassId(right_cid)).raw();
+    } else {
+      return Bool::False().raw();
+    }
+  }
+
+  const Class& cls = Class::Handle(left.clazz());
+  if (cls.IsClosureClass()) {
+    // TODO(vegorov): provide faster implementation for closure classes.
+    const AbstractType& left_type =
+        AbstractType::Handle(left.GetType(Heap::kNew));
+    const AbstractType& right_type =
+        AbstractType::Handle(right.GetType(Heap::kNew));
+    return Bool::Get(left_type.raw() == right_type.raw()).raw();
+  }
+
+  if (!cls.IsGeneric()) {
+    return Bool::True().raw();
+  }
+
+  const TypeArguments& left_type_arguments =
+      TypeArguments::Handle(left.GetTypeArguments());
+  const TypeArguments& right_type_arguments =
+      TypeArguments::Handle(right.GetTypeArguments());
+  return Bool::Get(left_type_arguments.Equals(right_type_arguments)).raw();
 }
 
 
@@ -134,14 +178,13 @@
   ASSERT(!type.IsMalformed());
   ASSERT(!type.IsMalbounded());
   Error& bound_error = Error::Handle(zone, Error::null());
-  const bool is_instance_of = instance.IsInstanceOf(type,
-                                                    instantiator_type_arguments,
-                                                    &bound_error);
+  const bool is_instance_of =
+      instance.IsInstanceOf(type, instantiator_type_arguments, &bound_error);
   if (FLAG_trace_type_checks) {
     const char* result_str = is_instance_of ? "true" : "false";
     OS::Print("Native Object.instanceOf: result %s\n", result_str);
     const AbstractType& instance_type =
-        AbstractType::Handle(zone, instance.GetType());
+        AbstractType::Handle(zone, instance.GetType(Heap::kNew));
     OS::Print("  instance type: %s\n",
               String::Handle(zone, instance_type.Name()).ToCString());
     OS::Print("  test type: %s\n",
@@ -156,11 +199,11 @@
     StackFrame* caller_frame = iterator.NextFrame();
     ASSERT(caller_frame != NULL);
     const TokenPosition location = caller_frame->GetTokenPos();
-    String& bound_error_message = String::Handle(
-        zone, String::New(bound_error.ToErrorCString()));
-    Exceptions::CreateAndThrowTypeError(
-        location, AbstractType::Handle(zone), AbstractType::Handle(zone),
-        Symbols::Empty(), bound_error_message);
+    String& bound_error_message =
+        String::Handle(zone, String::New(bound_error.ToErrorCString()));
+    Exceptions::CreateAndThrowTypeError(location, AbstractType::Handle(zone),
+                                        AbstractType::Handle(zone),
+                                        Symbols::Empty(), bound_error_message);
     UNREACHABLE();
   }
   return Bool::Get(negate.value() ? !is_instance_of : is_instance_of).raw();
@@ -179,20 +222,19 @@
   ASSERT(!type.IsMalformed());
   ASSERT(!type.IsMalbounded());
   Error& bound_error = Error::Handle(zone, Error::null());
-  const bool is_instance_of = instance.IsInstanceOf(type,
-                                                    instantiator_type_arguments,
-                                                    &bound_error);
+  const bool is_instance_of =
+      instance.IsInstanceOf(type, instantiator_type_arguments, &bound_error);
   if (!is_instance_of && !bound_error.IsNull()) {
     // Throw a dynamic type error only if the instanceof test fails.
     DartFrameIterator iterator;
     StackFrame* caller_frame = iterator.NextFrame();
     ASSERT(caller_frame != NULL);
     const TokenPosition location = caller_frame->GetTokenPos();
-    String& bound_error_message = String::Handle(
-        zone, String::New(bound_error.ToErrorCString()));
-    Exceptions::CreateAndThrowTypeError(
-        location, AbstractType::Handle(zone), AbstractType::Handle(zone),
-        Symbols::Empty(), bound_error_message);
+    String& bound_error_message =
+        String::Handle(zone, String::New(bound_error.ToErrorCString()));
+    Exceptions::CreateAndThrowTypeError(location, AbstractType::Handle(zone),
+                                        AbstractType::Handle(zone),
+                                        Symbols::Empty(), bound_error_message);
     UNREACHABLE();
   }
   return Bool::Get(is_instance_of).raw();
@@ -272,14 +314,13 @@
   if (instance.IsNull()) {
     return instance.raw();
   }
-  const bool is_instance_of = instance.IsInstanceOf(type,
-                                                    instantiator_type_arguments,
-                                                    &bound_error);
+  const bool is_instance_of =
+      instance.IsInstanceOf(type, instantiator_type_arguments, &bound_error);
   if (FLAG_trace_type_checks) {
     const char* result_str = is_instance_of ? "true" : "false";
     OS::Print("Object.as: result %s\n", result_str);
     const AbstractType& instance_type =
-        AbstractType::Handle(zone, instance.GetType());
+        AbstractType::Handle(zone, instance.GetType(Heap::kNew));
     OS::Print("  instance type: %s\n",
               String::Handle(zone, instance_type.Name()).ToCString());
     OS::Print("  cast type: %s\n",
@@ -294,24 +335,24 @@
     ASSERT(caller_frame != NULL);
     const TokenPosition location = caller_frame->GetTokenPos();
     const AbstractType& instance_type =
-        AbstractType::Handle(zone, instance.GetType());
+        AbstractType::Handle(zone, instance.GetType(Heap::kNew));
     if (!type.IsInstantiated()) {
       // Instantiate type before reporting the error.
-      type = type.InstantiateFrom(instantiator_type_arguments, NULL,
-                                  NULL, NULL, Heap::kNew);
+      type = type.InstantiateFrom(instantiator_type_arguments, NULL, NULL, NULL,
+                                  Heap::kNew);
       // Note that the instantiated type may be malformed.
     }
     if (bound_error.IsNull()) {
-      Exceptions::CreateAndThrowTypeError(
-          location, instance_type, type,
-          Symbols::InTypeCast(), Object::null_string());
+      Exceptions::CreateAndThrowTypeError(location, instance_type, type,
+                                          Symbols::InTypeCast(),
+                                          Object::null_string());
     } else {
       ASSERT(isolate->type_checks());
       const String& bound_error_message =
           String::Handle(zone, String::New(bound_error.ToErrorCString()));
       Exceptions::CreateAndThrowTypeError(
-          location, instance_type, AbstractType::Handle(zone),
-          Symbols::Empty(), bound_error_message);
+          location, instance_type, AbstractType::Handle(zone), Symbols::Empty(),
+          bound_error_message);
     }
     UNREACHABLE();
   }
diff --git a/runtime/lib/object_patch.dart b/runtime/lib/object_patch.dart
index 0af593d..d83ba13 100644
--- a/runtime/lib/object_patch.dart
+++ b/runtime/lib/object_patch.dart
@@ -5,7 +5,7 @@
 @patch class Object {
 
   // The VM has its own implementation of equals.
-  bool operator ==(other) native "Object_equals";
+  @patch bool operator ==(other) native "Object_equals";
 
   // Helpers used to implement hashCode. If a hashCode is used, we remember it
   // in a weak table in the VM. A new hashCode value is calculated using a
@@ -53,6 +53,8 @@
 
   @patch Type get runtimeType native "Object_runtimeType";
 
+  static bool _haveSameRuntimeType(a, b) native "Object_haveSameRuntimeType";
+
   // Call this function instead of inlining instanceof, thus collecting
   // type feedback and reducing code size of unoptimized code.
   bool _instanceOf(instantiator_type_arguments, type, bool negate)
diff --git a/runtime/lib/profiler.dart b/runtime/lib/profiler.dart
index 2a085c2..b60760a 100644
--- a/runtime/lib/profiler.dart
+++ b/runtime/lib/profiler.dart
@@ -2,8 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import 'dart:_internal';
-
 @patch class UserTag {
   @patch factory UserTag(String label) {
     return new _UserTag(label);
diff --git a/runtime/lib/regexp.cc b/runtime/lib/regexp.cc
index 921a101..8779573 100644
--- a/runtime/lib/regexp.cc
+++ b/runtime/lib/regexp.cc
@@ -20,10 +20,10 @@
 DEFINE_NATIVE_ENTRY(RegExp_factory, 4) {
   ASSERT(TypeArguments::CheckedHandle(arguments->NativeArgAt(0)).IsNull());
   GET_NON_NULL_NATIVE_ARGUMENT(String, pattern, arguments->NativeArgAt(1));
-  GET_NON_NULL_NATIVE_ARGUMENT(
-      Instance, handle_multi_line, arguments->NativeArgAt(2));
-  GET_NON_NULL_NATIVE_ARGUMENT(
-      Instance, handle_case_sensitive, arguments->NativeArgAt(3));
+  GET_NON_NULL_NATIVE_ARGUMENT(Instance, handle_multi_line,
+                               arguments->NativeArgAt(2));
+  GET_NON_NULL_NATIVE_ARGUMENT(Instance, handle_case_sensitive,
+                               arguments->NativeArgAt(3));
   bool ignore_case = handle_case_sensitive.raw() != Bool::True().raw();
   bool multi_line = handle_multi_line.raw() == Bool::True().raw();
 
@@ -36,10 +36,7 @@
   }
 
   // Create a RegExp object containing only the initial parameters.
-  return RegExpEngine::CreateRegExp(thread,
-                                    pattern,
-                                    multi_line,
-                                    ignore_case);
+  return RegExpEngine::CreateRegExp(thread, pattern, multi_line, ignore_case);
 }
 
 
@@ -81,19 +78,34 @@
 }
 
 
-DEFINE_NATIVE_ENTRY(RegExp_ExecuteMatch, 3) {
-  // This function is intrinsified. See Intrinsifier::RegExp_ExecuteMatch.
+static RawObject* ExecuteMatch(Zone* zone,
+                               NativeArguments* arguments,
+                               bool sticky) {
   const RegExp& regexp = RegExp::CheckedHandle(arguments->NativeArgAt(0));
   ASSERT(!regexp.IsNull());
   GET_NON_NULL_NATIVE_ARGUMENT(String, subject, arguments->NativeArgAt(1));
   GET_NON_NULL_NATIVE_ARGUMENT(Smi, start_index, arguments->NativeArgAt(2));
 
-  if (FLAG_interpret_irregexp || FLAG_precompiled_runtime) {
+  if (FLAG_interpret_irregexp) {
     return BytecodeRegExpMacroAssembler::Interpret(regexp, subject, start_index,
-                                                   zone);
+                                                   /*sticky=*/sticky, zone);
   }
 
-  return IRRegExpMacroAssembler::Execute(regexp, subject, start_index, zone);
+  return IRRegExpMacroAssembler::Execute(regexp, subject, start_index,
+                                         /*sticky=*/sticky, zone);
 }
 
+
+DEFINE_NATIVE_ENTRY(RegExp_ExecuteMatch, 3) {
+  // This function is intrinsified. See Intrinsifier::RegExp_ExecuteMatch.
+  return ExecuteMatch(zone, arguments, /*sticky=*/false);
+}
+
+
+DEFINE_NATIVE_ENTRY(RegExp_ExecuteMatchSticky, 3) {
+  // This function is intrinsified. See Intrinsifier::RegExp_ExecuteMatchSticky.
+  return ExecuteMatch(zone, arguments, /*sticky=*/true);
+}
+
+
 }  // namespace dart
diff --git a/runtime/lib/regexp_patch.dart b/runtime/lib/regexp_patch.dart
index 7e8bc19..0c93204 100644
--- a/runtime/lib/regexp_patch.dart
+++ b/runtime/lib/regexp_patch.dart
@@ -2,8 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:collection" show LinkedList, LinkedListEntry;
-
 @patch class RegExp {
   @patch factory RegExp(String source,
                               {bool multiLine: false,
@@ -162,11 +160,8 @@
     if (start < 0 || start > string.length) {
       throw new RangeError.range(start, 0, string.length);
     }
-    // Inefficient check that searches for a later match too.
-    // Change this when possible.
-    List<int> list = _ExecuteMatch(string, start);
+    List<int> list = _ExecuteMatchSticky(string, start);
     if (list == null) return null;
-    if (list[0] != start) return null;
     return new _RegExpMatch(this, string, list);
   }
 
@@ -240,6 +235,9 @@
 
   List _ExecuteMatch(String str, int start_index)
       native "RegExp_ExecuteMatch";
+
+  List _ExecuteMatchSticky(String str, int start_index)
+      native "RegExp_ExecuteMatchSticky";
 }
 
 class _AllMatchesIterable extends IterableBase<Match> {
diff --git a/runtime/lib/simd128.cc b/runtime/lib/simd128.cc
index 4492555..f9520c3 100644
--- a/runtime/lib/simd128.cc
+++ b/runtime/lib/simd128.cc
@@ -13,8 +13,8 @@
 
 static void ThrowMaskRangeException(int64_t m) {
   if ((m < 0) || (m > 255)) {
-    Exceptions::ThrowRangeError(
-        "mask", Integer::Handle(Integer::New(m)), 0, 255);
+    Exceptions::ThrowRangeError("mask", Integer::Handle(Integer::New(m)), 0,
+                                255);
   }
 }
 
@@ -95,8 +95,7 @@
 
 DEFINE_NATIVE_ENTRY(Float32x4_mul, 2) {
   GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, self, arguments->NativeArgAt(0));
-  GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, other,
-                               arguments->NativeArgAt(1));
+  GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, other, arguments->NativeArgAt(1));
   float _x = self.x() * other.x();
   float _y = self.y() * other.y();
   float _z = self.z() * other.z();
@@ -277,7 +276,7 @@
   GET_NON_NULL_NATIVE_ARGUMENT(Integer, mask, arguments->NativeArgAt(1));
   int64_t m = mask.AsInt64Value();
   ThrowMaskRangeException(m);
-  float data[4] = { self.x(), self.y(), self.z(), self.w() };
+  float data[4] = {self.x(), self.y(), self.z(), self.w()};
   float _x = data[m & 0x3];
   float _y = data[(m >> 2) & 0x3];
   float _z = data[(m >> 4) & 0x3];
@@ -292,8 +291,8 @@
   GET_NON_NULL_NATIVE_ARGUMENT(Integer, mask, arguments->NativeArgAt(2));
   int64_t m = mask.AsInt64Value();
   ThrowMaskRangeException(m);
-  float data[4] = { self.x(), self.y(), self.z(), self.w() };
-  float other_data[4] = { other.x(), other.y(), other.z(), other.w() };
+  float data[4] = {self.x(), self.y(), self.z(), self.w()};
+  float other_data[4] = {other.x(), other.y(), other.z(), other.w()};
   float _x = data[m & 0x3];
   float _y = data[(m >> 2) & 0x3];
   float _z = other_data[(m >> 4) & 0x3];
@@ -348,8 +347,7 @@
 
 DEFINE_NATIVE_ENTRY(Float32x4_min, 2) {
   GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, self, arguments->NativeArgAt(0));
-  GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, other,
-                               arguments->NativeArgAt(1));
+  GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, other, arguments->NativeArgAt(1));
   float _x = self.x() < other.x() ? self.x() : other.x();
   float _y = self.y() < other.y() ? self.y() : other.y();
   float _z = self.z() < other.z() ? self.z() : other.z();
@@ -360,8 +358,7 @@
 
 DEFINE_NATIVE_ENTRY(Float32x4_max, 2) {
   GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, self, arguments->NativeArgAt(0));
-  GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, other,
-                               arguments->NativeArgAt(1));
+  GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, other, arguments->NativeArgAt(1));
   float _x = self.x() > other.x() ? self.x() : other.x();
   float _y = self.y() > other.y() ? self.y() : other.y();
   float _z = self.z() > other.z() ? self.z() : other.z();
@@ -522,7 +519,7 @@
   GET_NON_NULL_NATIVE_ARGUMENT(Integer, mask, arguments->NativeArgAt(1));
   int64_t m = mask.AsInt64Value();
   ThrowMaskRangeException(m);
-  int32_t data[4] = { self.x(), self.y(), self.z(), self.w() };
+  int32_t data[4] = {self.x(), self.y(), self.z(), self.w()};
   int32_t _x = data[m & 0x3];
   int32_t _y = data[(m >> 2) & 0x3];
   int32_t _z = data[(m >> 4) & 0x3];
@@ -537,8 +534,8 @@
   GET_NON_NULL_NATIVE_ARGUMENT(Integer, mask, arguments->NativeArgAt(2));
   int64_t m = mask.AsInt64Value();
   ThrowMaskRangeException(m);
-  int32_t data[4] = { self.x(), self.y(), self.z(), self.w() };
-  int32_t zw_data[4] = { zw.x(), zw.y(), zw.z(), zw.w() };
+  int32_t data[4] = {self.x(), self.y(), self.z(), self.w()};
+  int32_t zw_data[4] = {zw.x(), zw.y(), zw.z(), zw.w()};
   int32_t _x = data[m & 0x3];
   int32_t _y = data[(m >> 2) & 0x3];
   int32_t _z = zw_data[(m >> 4) & 0x3];
@@ -672,12 +669,8 @@
 union float32_int32 {
   float f;
   int32_t u;
-  float32_int32(float v) {
-    f = v;
-  }
-  float32_int32(int32_t v) {
-    u = v;
-  }
+  float32_int32(float v) { f = v; }
+  float32_int32(int32_t v) { u = v; }
 };
 
 
@@ -854,8 +847,7 @@
 
 DEFINE_NATIVE_ENTRY(Float64x2_min, 2) {
   GET_NON_NULL_NATIVE_ARGUMENT(Float64x2, self, arguments->NativeArgAt(0));
-  GET_NON_NULL_NATIVE_ARGUMENT(Float64x2, other,
-                               arguments->NativeArgAt(1));
+  GET_NON_NULL_NATIVE_ARGUMENT(Float64x2, other, arguments->NativeArgAt(1));
   double _x = self.x() < other.x() ? self.x() : other.x();
   double _y = self.y() < other.y() ? self.y() : other.y();
   return Float64x2::New(_x, _y);
@@ -864,8 +856,7 @@
 
 DEFINE_NATIVE_ENTRY(Float64x2_max, 2) {
   GET_NON_NULL_NATIVE_ARGUMENT(Float64x2, self, arguments->NativeArgAt(0));
-  GET_NON_NULL_NATIVE_ARGUMENT(Float64x2, other,
-                               arguments->NativeArgAt(1));
+  GET_NON_NULL_NATIVE_ARGUMENT(Float64x2, other, arguments->NativeArgAt(1));
   double _x = self.x() > other.x() ? self.x() : other.x();
   double _y = self.y() > other.y() ? self.y() : other.y();
   return Float64x2::New(_x, _y);
diff --git a/runtime/lib/stacktrace.cc b/runtime/lib/stacktrace.cc
index 12d6058..dcc4834 100644
--- a/runtime/lib/stacktrace.cc
+++ b/runtime/lib/stacktrace.cc
@@ -46,8 +46,8 @@
   const Array& code_array = Array::Handle(Array::MakeArray(code_list));
   const Array& pc_offset_array =
       Array::Handle(Array::MakeArray(pc_offset_list));
-  const Stacktrace& stacktrace = Stacktrace::Handle(
-      Stacktrace::New(code_array, pc_offset_array));
+  const Stacktrace& stacktrace =
+      Stacktrace::Handle(Stacktrace::New(code_array, pc_offset_array));
   return stacktrace;
 }
 
diff --git a/runtime/lib/stacktrace.h b/runtime/lib/stacktrace.h
index c3b16e4..e6bccae 100644
--- a/runtime/lib/stacktrace.h
+++ b/runtime/lib/stacktrace.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef LIB_STACKTRACE_H_
-#define LIB_STACKTRACE_H_
+#ifndef RUNTIME_LIB_STACKTRACE_H_
+#define RUNTIME_LIB_STACKTRACE_H_
 
 namespace dart {
 
@@ -18,4 +18,4 @@
 
 }  // namespace dart
 
-#endif  // LIB_STACKTRACE_H_
+#endif  // RUNTIME_LIB_STACKTRACE_H_
diff --git a/runtime/lib/string.cc b/runtime/lib/string.cc
index d4008a3..8affbbd 100644
--- a/runtime/lib/string.cc
+++ b/runtime/lib/string.cc
@@ -91,8 +91,8 @@
 
 
 DEFINE_NATIVE_ENTRY(StringBase_substringUnchecked, 3) {
-  const String& receiver = String::CheckedHandle(zone,
-                                                 arguments->NativeArgAt(0));
+  const String& receiver =
+      String::CheckedHandle(zone, arguments->NativeArgAt(0));
   GET_NON_NULL_NATIVE_ARGUMENT(Smi, start_obj, arguments->NativeArgAt(1));
   GET_NON_NULL_NATIVE_ARGUMENT(Smi, end_obj, arguments->NativeArgAt(2));
 
@@ -102,10 +102,10 @@
 }
 
 
-
 // Return the bitwise-or of all characters in the slice from start to end.
 static uint16_t CharacterLimit(const String& string,
-                               intptr_t start, intptr_t end) {
+                               intptr_t start,
+                               intptr_t end) {
   ASSERT(string.IsTwoByteString() || string.IsExternalTwoByteString());
   // Maybe do loop unrolling, and handle two uint16_t in a single uint32_t
   // operation.
@@ -164,10 +164,9 @@
 
 
 DEFINE_NATIVE_ENTRY(StringBase_joinReplaceAllResult, 4) {
-  const String& base = String::CheckedHandle(zone,
-                                             arguments->NativeArgAt(0));
-  GET_NON_NULL_NATIVE_ARGUMENT(GrowableObjectArray,
-                               matches_growable, arguments->NativeArgAt(1));
+  const String& base = String::CheckedHandle(zone, arguments->NativeArgAt(0));
+  GET_NON_NULL_NATIVE_ARGUMENT(GrowableObjectArray, matches_growable,
+                               arguments->NativeArgAt(1));
   GET_NON_NULL_NATIVE_ARGUMENT(Smi, length_obj, arguments->NativeArgAt(2));
   GET_NON_NULL_NATIVE_ARGUMENT(Bool, is_onebyte_obj, arguments->NativeArgAt(3));
 
@@ -219,12 +218,9 @@
         }
       }
       if (slice_length > 0) {
-        if (0 <= slice_start &&
-            slice_start + slice_length <= base_length &&
+        if (0 <= slice_start && slice_start + slice_length <= base_length &&
             write_index + slice_length <= length) {
-          String::Copy(result, write_index,
-                       base, slice_start,
-                       slice_length);
+          String::Copy(result, write_index, base, slice_start, slice_length);
           write_index += slice_length;
           continue;
         }
@@ -253,8 +249,8 @@
 }
 
 DEFINE_NATIVE_ENTRY(OneByteString_substringUnchecked, 3) {
-  const String& receiver = String::CheckedHandle(zone,
-                                                 arguments->NativeArgAt(0));
+  const String& receiver =
+      String::CheckedHandle(zone, arguments->NativeArgAt(0));
   ASSERT(receiver.IsOneByteString());
   GET_NON_NULL_NATIVE_ARGUMENT(Smi, start_obj, arguments->NativeArgAt(1));
   GET_NON_NULL_NATIVE_ARGUMENT(Smi, end_obj, arguments->NativeArgAt(2));
@@ -267,31 +263,26 @@
 
 // This is high-performance code.
 DEFINE_NATIVE_ENTRY(OneByteString_splitWithCharCode, 2) {
-  const String& receiver = String::CheckedHandle(zone,
-                                                 arguments->NativeArgAt(0));
+  const String& receiver =
+      String::CheckedHandle(zone, arguments->NativeArgAt(0));
   ASSERT(receiver.IsOneByteString());
   GET_NON_NULL_NATIVE_ARGUMENT(Smi, smi_split_code, arguments->NativeArgAt(1));
   const intptr_t len = receiver.Length();
   const intptr_t split_code = smi_split_code.Value();
   const GrowableObjectArray& result = GrowableObjectArray::Handle(
-      zone,
-      GrowableObjectArray::New(16, Heap::kNew));
+      zone, GrowableObjectArray::New(16, Heap::kNew));
   String& str = String::Handle(zone);
   intptr_t start = 0;
   intptr_t i = 0;
   for (; i < len; i++) {
     if (split_code == OneByteString::CharAt(receiver, i)) {
-      str = OneByteString::SubStringUnchecked(receiver,
-                                              start,
-                                              (i - start),
+      str = OneByteString::SubStringUnchecked(receiver, start, (i - start),
                                               Heap::kNew);
       result.Add(str);
       start = i + 1;
     }
   }
-  str = OneByteString::SubStringUnchecked(receiver,
-                                          start,
-                                          (i - start),
+  str = OneByteString::SubStringUnchecked(receiver, start, (i - start),
                                           Heap::kNew);
   result.Add(str);
   return result.raw();
@@ -305,8 +296,7 @@
 
 
 DEFINE_NATIVE_ENTRY(OneByteString_allocateFromOneByteList, 3) {
-  Instance& list = Instance::CheckedHandle(zone,
-                                           arguments->NativeArgAt(0));
+  Instance& list = Instance::CheckedHandle(zone, arguments->NativeArgAt(0));
   GET_NON_NULL_NATIVE_ARGUMENT(Smi, start_obj, arguments->NativeArgAt(1));
   GET_NON_NULL_NATIVE_ARGUMENT(Smi, end_obj, arguments->NativeArgAt(2));
 
@@ -409,8 +399,7 @@
 
 
 DEFINE_NATIVE_ENTRY(TwoByteString_allocateFromTwoByteList, 3) {
-  Instance& list = Instance::CheckedHandle(zone,
-                                           arguments->NativeArgAt(0));
+  Instance& list = Instance::CheckedHandle(zone, arguments->NativeArgAt(0));
   GET_NON_NULL_NATIVE_ARGUMENT(Smi, start_obj, arguments->NativeArgAt(1));
   GET_NON_NULL_NATIVE_ARGUMENT(Smi, end_obj, arguments->NativeArgAt(2));
 
@@ -451,8 +440,8 @@
     if (end > Smi::Value(TypedDataView::Length(list))) {
       Exceptions::ThrowArgumentError(end_obj);
     }
-    const Instance& data_obj = Instance::Handle(zone,
-                                                TypedDataView::Data(list));
+    const Instance& data_obj =
+        Instance::Handle(zone, TypedDataView::Data(list));
     intptr_t data_offset = Smi::Value(TypedDataView::OffsetInBytes(list));
     if (data_obj.IsTypedData()) {
       const TypedData& array = TypedData::Cast(data_obj);
@@ -468,8 +457,8 @@
     if (end > array.Length()) {
       Exceptions::ThrowArgumentError(end_obj);
     }
-    const String& string = String::Handle(zone,
-                                          TwoByteString::New(length, space));
+    const String& string =
+        String::Handle(zone, TwoByteString::New(length, space));
     for (int i = 0; i < length; i++) {
       intptr_t value =
           Smi::Value(reinterpret_cast<RawSmi*>(array.At(start + i)));
@@ -481,8 +470,8 @@
     if (end > array.Length()) {
       Exceptions::ThrowArgumentError(end_obj);
     }
-    const String& string = String::Handle(zone,
-                                          TwoByteString::New(length, space));
+    const String& string =
+        String::Handle(zone, TwoByteString::New(length, space));
     for (int i = 0; i < length; i++) {
       intptr_t value =
           Smi::Value(reinterpret_cast<RawSmi*>(array.At(start + i)));
@@ -496,8 +485,8 @@
 
 
 DEFINE_NATIVE_ENTRY(String_getHashCode, 1) {
-  const String& receiver = String::CheckedHandle(zone,
-                                                 arguments->NativeArgAt(0));
+  const String& receiver =
+      String::CheckedHandle(zone, arguments->NativeArgAt(0));
   intptr_t hash_val = receiver.Hash();
   ASSERT(hash_val > 0);
   ASSERT(Smi::IsValid(hash_val));
@@ -506,8 +495,8 @@
 
 
 DEFINE_NATIVE_ENTRY(String_getLength, 1) {
-  const String& receiver = String::CheckedHandle(zone,
-                                                 arguments->NativeArgAt(0));
+  const String& receiver =
+      String::CheckedHandle(zone, arguments->NativeArgAt(0));
   return Smi::New(receiver.Length());
 }
 
@@ -527,8 +516,8 @@
 
 
 DEFINE_NATIVE_ENTRY(String_charAt, 2) {
-  const String& receiver = String::CheckedHandle(zone,
-                                                 arguments->NativeArgAt(0));
+  const String& receiver =
+      String::CheckedHandle(zone, arguments->NativeArgAt(0));
   GET_NON_NULL_NATIVE_ARGUMENT(Integer, index, arguments->NativeArgAt(1));
   uint16_t value = StringValueAt(receiver, index);
   return Symbols::FromCharCode(thread, static_cast<int32_t>(value));
@@ -537,8 +526,8 @@
 
 // Returns the 16-bit UTF-16 code unit at the given index.
 DEFINE_NATIVE_ENTRY(String_codeUnitAt, 2) {
-  const String& receiver = String::CheckedHandle(zone,
-                                                 arguments->NativeArgAt(0));
+  const String& receiver =
+      String::CheckedHandle(zone, arguments->NativeArgAt(0));
   GET_NON_NULL_NATIVE_ARGUMENT(Integer, index, arguments->NativeArgAt(1));
   uint16_t value = StringValueAt(receiver, index);
   return Smi::New(static_cast<intptr_t>(value));
@@ -546,24 +535,24 @@
 
 
 DEFINE_NATIVE_ENTRY(String_concat, 2) {
-  const String& receiver = String::CheckedHandle(zone,
-                                                 arguments->NativeArgAt(0));
+  const String& receiver =
+      String::CheckedHandle(zone, arguments->NativeArgAt(0));
   GET_NON_NULL_NATIVE_ARGUMENT(String, b, arguments->NativeArgAt(1));
   return String::Concat(receiver, b);
 }
 
 
 DEFINE_NATIVE_ENTRY(String_toLowerCase, 1) {
-  const String& receiver = String::CheckedHandle(zone,
-                                                 arguments->NativeArgAt(0));
+  const String& receiver =
+      String::CheckedHandle(zone, arguments->NativeArgAt(0));
   ASSERT(!receiver.IsNull());
   return String::ToLowerCase(receiver);
 }
 
 
 DEFINE_NATIVE_ENTRY(String_toUpperCase, 1) {
-  const String& receiver = String::CheckedHandle(zone,
-                                                 arguments->NativeArgAt(0));
+  const String& receiver =
+      String::CheckedHandle(zone, arguments->NativeArgAt(0));
   ASSERT(!receiver.IsNull());
   return String::ToUpperCase(receiver);
 }
@@ -586,7 +575,7 @@
   } else if (argument.IsGrowableObjectArray()) {
     const GrowableObjectArray& g_array = GrowableObjectArray::Cast(argument);
     strings = g_array.data();
-    length =  g_array.Length();
+    length = g_array.Length();
   } else {
     Exceptions::ThrowArgumentError(argument);
   }
@@ -614,9 +603,10 @@
   if (length_value < 0 || length_value > array_length) {
     Exceptions::ThrowRangeError("length", length, 0, array_length);
   }
-  const String& result = isLatin1.value()
-      ? String::Handle(OneByteString::New(length_value, Heap::kNew))
-      : String::Handle(TwoByteString::New(length_value, Heap::kNew));
+  const String& result =
+      isLatin1.value()
+          ? String::Handle(OneByteString::New(length_value, Heap::kNew))
+          : String::Handle(TwoByteString::New(length_value, Heap::kNew));
   NoSafepointScope no_safepoint;
 
   uint16_t* data_position = reinterpret_cast<uint16_t*>(codeUnits.DataAddr(0));
diff --git a/runtime/lib/string_patch.dart b/runtime/lib/string_patch.dart
index 17962df..f046d8f 100644
--- a/runtime/lib/string_patch.dart
+++ b/runtime/lib/string_patch.dart
@@ -83,8 +83,6 @@
         "_StringBase can't be instaniated");
   }
 
-  Type get runtimeType => String;
-
   int get hashCode native "String_getHashCode";
 
   bool get _isOneByte {
@@ -157,7 +155,7 @@
   static String _createStringFromIterable(Iterable<int> charCodes,
                                           int start, int end) {
     // Treat charCodes as Iterable.
-    if (charCodes is EfficientLength) {
+    if (charCodes is EfficientLengthIterable) {
       int length = charCodes.length;
       end = RangeError.checkValidRange(start, end, length);
       List charCodeList = new List.from(charCodes.take(end).skip(start),
diff --git a/runtime/lib/timeline.cc b/runtime/lib/timeline.cc
index 300d6e3..18b89e9 100644
--- a/runtime/lib/timeline.cc
+++ b/runtime/lib/timeline.cc
@@ -85,32 +85,26 @@
   // Convert phase to a C string and perform a sanity check.
   const char* phase_string = phase.ToCString();
   ASSERT(phase_string != NULL);
-  ASSERT((phase_string[0] == 'n') ||
-         (phase_string[0] == 'b') ||
+  ASSERT((phase_string[0] == 'n') || (phase_string[0] == 'b') ||
          (phase_string[0] == 'e'));
   ASSERT(phase_string[1] == '\0');
-  char* json = OS::SCreate(zone,
-      "{\"name\":\"%s\",\"cat\":\"%s\",\"tid\":%" Pd64 ",\"pid\":%" Pd64 ","
-      "\"ts\":%" Pd64 ",\"ph\":\"%s\",\"id\":%" Pd64 ", \"args\":%s}",
-      name.ToCString(),
-      category.ToCString(),
-      tid,
-      pid,
-      start.AsInt64Value(),
-      phase_string,
-      id.AsInt64Value(),
-      args.ToCString());
+  char* json = OS::SCreate(
+      zone, "{\"name\":\"%s\",\"cat\":\"%s\",\"tid\":%" Pd64 ",\"pid\":%" Pd64
+            ","
+            "\"ts\":%" Pd64 ",\"ph\":\"%s\",\"id\":%" Pd64 ", \"args\":%s}",
+      name.ToCString(), category.ToCString(), tid, pid, start.AsInt64Value(),
+      phase_string, id.AsInt64Value(), args.ToCString());
 
   switch (phase_string[0]) {
     case 'n':
       event->AsyncInstant("", id.AsInt64Value(), start.AsInt64Value());
-    break;
+      break;
     case 'b':
       event->AsyncBegin("", id.AsInt64Value(), start.AsInt64Value());
-    break;
+      break;
     case 'e':
       event->AsyncEnd("", id.AsInt64Value(), start.AsInt64Value());
-    break;
+      break;
     default:
       UNREACHABLE();
   }
@@ -156,36 +150,25 @@
   char* json = NULL;
 
   if ((start_cpu.AsInt64Value() != -1) && (end_cpu != -1)) {
-    json = OS::SCreate(zone,
-        "{\"name\":\"%s\",\"cat\":\"%s\",\"tid\":%" Pd64 ",\"pid\":%" Pd64 ","
-        "\"ts\":%" Pd64 ",\"ph\":\"X\",\"dur\":%" Pd64 ","
-        "\"tdur\":%" Pd64 ",\"args\":%s}",
-        name.ToCString(),
-        category.ToCString(),
-        tid,
-        pid,
-        start.AsInt64Value(),
-        duration,
-        duration_cpu,
-        args.ToCString());
+    json = OS::SCreate(
+        zone, "{\"name\":\"%s\",\"cat\":\"%s\",\"tid\":%" Pd64 ",\"pid\":%" Pd64
+              ","
+              "\"ts\":%" Pd64 ",\"ph\":\"X\",\"dur\":%" Pd64
+              ","
+              "\"tdur\":%" Pd64 ",\"args\":%s}",
+        name.ToCString(), category.ToCString(), tid, pid, start.AsInt64Value(),
+        duration, duration_cpu, args.ToCString());
   } else {
-    json = OS::SCreate(zone,
-        "{\"name\":\"%s\",\"cat\":\"%s\",\"tid\":%" Pd64 ",\"pid\":%" Pd64 ","
-        "\"ts\":%" Pd64 ",\"ph\":\"X\",\"dur\":%" Pd64 ",\"args\":%s}",
-        name.ToCString(),
-        category.ToCString(),
-        tid,
-        pid,
-        start.AsInt64Value(),
-        duration,
-        args.ToCString());
+    json = OS::SCreate(
+        zone, "{\"name\":\"%s\",\"cat\":\"%s\",\"tid\":%" Pd64 ",\"pid\":%" Pd64
+              ","
+              "\"ts\":%" Pd64 ",\"ph\":\"X\",\"dur\":%" Pd64 ",\"args\":%s}",
+        name.ToCString(), category.ToCString(), tid, pid, start.AsInt64Value(),
+        duration, args.ToCString());
   }
   ASSERT(json != NULL);
 
-  event->Duration("",
-                  start.AsInt64Value(),
-                  end,
-                  start_cpu.AsInt64Value(),
+  event->Duration("", start.AsInt64Value(), end, start_cpu.AsInt64Value(),
                   end_cpu);
   // json was allocated in the zone and a copy will be stored in event.
   event->CompleteWithPreSerializedJSON(json);
@@ -220,14 +203,11 @@
   ASSERT(os_thread != NULL);
   int64_t tid = OSThread::ThreadIdToIntPtr(os_thread->trace_id());
 
-  char* json = OS::SCreate(zone,
-      "{\"name\":\"%s\",\"cat\":\"%s\",\"tid\":%" Pd64 ",\"pid\":%" Pd64 ","
-      "\"ts\":%" Pd64 ",\"ph\":\"I\",\"args\":%s}",
-      name.ToCString(),
-      category.ToCString(),
-      tid,
-      pid,
-      start.AsInt64Value(),
+  char* json = OS::SCreate(
+      zone, "{\"name\":\"%s\",\"cat\":\"%s\",\"tid\":%" Pd64 ",\"pid\":%" Pd64
+            ","
+            "\"ts\":%" Pd64 ",\"ph\":\"I\",\"args\":%s}",
+      name.ToCString(), category.ToCString(), tid, pid, start.AsInt64Value(),
       args.ToCString());
 
   event->Instant("", start.AsInt64Value());
diff --git a/runtime/lib/timeline.dart b/runtime/lib/timeline.dart
index da5760e..b2aa165 100644
--- a/runtime/lib/timeline.dart
+++ b/runtime/lib/timeline.dart
@@ -2,8 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import 'dart:_internal';
-
 @patch bool _isDartStreamEnabled() native "Timeline_isDartStreamEnabled";
 
 @patch int _getTraceClock() native "Timeline_getTraceClock";
diff --git a/runtime/lib/typed_data.cc b/runtime/lib/typed_data.cc
index 4130e60..986c035 100644
--- a/runtime/lib/typed_data.cc
+++ b/runtime/lib/typed_data.cc
@@ -22,10 +22,9 @@
   if (!Utils::RangeCheck(offset_in_bytes, access_size, length_in_bytes)) {
     const intptr_t index =
         (offset_in_bytes + access_size) / element_size_in_bytes;
-    const intptr_t length =
-        length_in_bytes / element_size_in_bytes;
-    Exceptions::ThrowRangeError(
-        "index", Integer::Handle(Integer::New(index)), 0, length);
+    const intptr_t length = length_in_bytes / element_size_in_bytes;
+    Exceptions::ThrowRangeError("index", Integer::Handle(Integer::New(index)),
+                                0, length);
   }
 }
 
@@ -34,8 +33,7 @@
 static void LengthCheck(intptr_t len, intptr_t max) {
   if (len < 0 || len > max) {
     const String& error = String::Handle(String::NewFormatted(
-        "Length (%" Pd ") of object must be in range [0..%" Pd "]",
-        len, max));
+        "Length (%" Pd ") of object must be in range [0..%" Pd "]", len, max));
     Exceptions::ThrowArgumentError(error);
   }
 }
@@ -44,8 +42,8 @@
 DEFINE_NATIVE_ENTRY(TypedData_length, 1) {
   GET_NON_NULL_NATIVE_ARGUMENT(Instance, instance, arguments->NativeArgAt(0));
   if (instance.IsTypedData()) {
-     const TypedData& array = TypedData::Cast(instance);
-     return Smi::New(array.Length());
+    const TypedData& array = TypedData::Cast(instance);
+    return Smi::New(array.Length());
   }
   if (instance.IsExternalTypedData()) {
     const ExternalTypedData& array = ExternalTypedData::Cast(instance);
@@ -59,8 +57,10 @@
 
 
 template <typename DstType, typename SrcType>
-static RawBool* CopyData(const Instance& dst, const Instance& src,
-                         const Smi& dst_start, const Smi& src_start,
+static RawBool* CopyData(const Instance& dst,
+                         const Instance& src,
+                         const Smi& dst_start,
+                         const Smi& src_start,
                          const Smi& length,
                          bool clamped) {
   const DstType& dst_array = DstType::Cast(dst);
@@ -68,18 +68,17 @@
   const intptr_t dst_offset_in_bytes = dst_start.Value();
   const intptr_t src_offset_in_bytes = src_start.Value();
   const intptr_t length_in_bytes = length.Value();
-  ASSERT(Utils::RangeCheck(
-      src_offset_in_bytes, length_in_bytes, src_array.LengthInBytes()));
-  ASSERT(Utils::RangeCheck(
-      dst_offset_in_bytes, length_in_bytes, dst_array.LengthInBytes()));
+  ASSERT(Utils::RangeCheck(src_offset_in_bytes, length_in_bytes,
+                           src_array.LengthInBytes()));
+  ASSERT(Utils::RangeCheck(dst_offset_in_bytes, length_in_bytes,
+                           dst_array.LengthInBytes()));
   if (clamped) {
     TypedData::ClampedCopy<DstType, SrcType>(dst_array, dst_offset_in_bytes,
                                              src_array, src_offset_in_bytes,
                                              length_in_bytes);
   } else {
-    TypedData::Copy<DstType, SrcType>(dst_array, dst_offset_in_bytes,
-                                      src_array, src_offset_in_bytes,
-                                      length_in_bytes);
+    TypedData::Copy<DstType, SrcType>(dst_array, dst_offset_in_bytes, src_array,
+                                      src_offset_in_bytes, length_in_bytes);
   }
   return Bool::True().raw();
 }
@@ -132,8 +131,8 @@
   const bool needs_clamping = IsClamped(to_cid) && !IsUint8(from_cid);
   if (dst.IsTypedData()) {
     if (src.IsTypedData()) {
-      return CopyData<TypedData, TypedData>(
-          dst, src, dst_start, src_start, length, needs_clamping);
+      return CopyData<TypedData, TypedData>(dst, src, dst_start, src_start,
+                                            length, needs_clamping);
     } else if (src.IsExternalTypedData()) {
       return CopyData<TypedData, ExternalTypedData>(
           dst, src, dst_start, src_start, length, needs_clamping);
@@ -158,83 +157,79 @@
 // on whether the underlying architecture is 32-bit or 64-bit.
 // Argument 0 is type arguments and is ignored.
 #define TYPED_DATA_NEW(name)                                                   \
-DEFINE_NATIVE_ENTRY(TypedData_##name##_new, 2) {                               \
-  GET_NON_NULL_NATIVE_ARGUMENT(Smi, length, arguments->NativeArgAt(1));        \
-  intptr_t cid = kTypedData##name##Cid;                                        \
-  intptr_t len = length.Value();                                               \
-  intptr_t max = TypedData::MaxElements(cid);                                  \
-  LengthCheck(len, max);                                                       \
-  return TypedData::New(cid, len);                                             \
-}                                                                              \
+  DEFINE_NATIVE_ENTRY(TypedData_##name##_new, 2) {                             \
+    GET_NON_NULL_NATIVE_ARGUMENT(Smi, length, arguments->NativeArgAt(1));      \
+    intptr_t cid = kTypedData##name##Cid;                                      \
+    intptr_t len = length.Value();                                             \
+    intptr_t max = TypedData::MaxElements(cid);                                \
+    LengthCheck(len, max);                                                     \
+    return TypedData::New(cid, len);                                           \
+  }
 
 
-#define TYPED_DATA_NEW_NATIVE(name)                                            \
-  TYPED_DATA_NEW(name)                                                         \
+#define TYPED_DATA_NEW_NATIVE(name) TYPED_DATA_NEW(name)
 
 
 CLASS_LIST_TYPED_DATA(TYPED_DATA_NEW_NATIVE)
 
 #define TYPED_DATA_GETTER(getter, object, ctor, access_size)                   \
-DEFINE_NATIVE_ENTRY(TypedData_##getter, 2) {                                   \
-  GET_NON_NULL_NATIVE_ARGUMENT(Instance, instance, arguments->NativeArgAt(0)); \
-  GET_NON_NULL_NATIVE_ARGUMENT(Smi, offsetInBytes, arguments->NativeArgAt(1)); \
-  if (instance.IsTypedData()) {                                                \
-    const TypedData& array = TypedData::Cast(instance);                        \
-    RangeCheck(offsetInBytes.Value(), access_size,                             \
-               array.LengthInBytes(), access_size);                            \
-    return object::ctor(array.getter(offsetInBytes.Value()));                  \
-  }                                                                            \
-  if (instance.IsExternalTypedData()) {                                        \
-    const ExternalTypedData& array = ExternalTypedData::Cast(instance);        \
-    RangeCheck(offsetInBytes.Value(), access_size,                             \
-               array.LengthInBytes(), access_size);                            \
-    return object::ctor(array.getter(offsetInBytes.Value()));                  \
-  }                                                                            \
-  const String& error = String::Handle(String::NewFormatted(                   \
-      "Expected a TypedData object but found %s", instance.ToCString()));      \
-  Exceptions::ThrowArgumentError(error);                                       \
-  return object::null();                                                       \
-}                                                                              \
-
-
-#define TYPED_DATA_SETTER(setter,                                              \
-                          object,                                              \
-                          get_object_value,                                    \
-                          access_size,                                         \
-                          access_type)                                         \
-DEFINE_NATIVE_ENTRY(TypedData_##setter, 3) {                                   \
-  GET_NON_NULL_NATIVE_ARGUMENT(Instance, instance, arguments->NativeArgAt(0)); \
-  GET_NON_NULL_NATIVE_ARGUMENT(Smi, offsetInBytes, arguments->NativeArgAt(1)); \
-  GET_NON_NULL_NATIVE_ARGUMENT(object, value, arguments->NativeArgAt(2));      \
-  if (instance.IsTypedData()) {                                                \
-    const TypedData& array = TypedData::Cast(instance);                        \
-    RangeCheck(offsetInBytes.Value(), access_size,                             \
-               array.LengthInBytes(), access_size);                            \
-    array.setter(offsetInBytes.Value(),                                        \
-                 static_cast<access_type>(value.get_object_value()));          \
-  } else if (instance.IsExternalTypedData()) {                                 \
-    const ExternalTypedData& array = ExternalTypedData::Cast(instance);        \
-    RangeCheck(offsetInBytes.Value(), access_size,                             \
-               array.LengthInBytes(), access_size);                            \
-    array.setter(offsetInBytes.Value(),                                        \
-                 static_cast<access_type>(value.get_object_value()));          \
-  } else {                                                                     \
+  DEFINE_NATIVE_ENTRY(TypedData_##getter, 2) {                                 \
+    GET_NON_NULL_NATIVE_ARGUMENT(Instance, instance,                           \
+                                 arguments->NativeArgAt(0));                   \
+    GET_NON_NULL_NATIVE_ARGUMENT(Smi, offsetInBytes,                           \
+                                 arguments->NativeArgAt(1));                   \
+    if (instance.IsTypedData()) {                                              \
+      const TypedData& array = TypedData::Cast(instance);                      \
+      RangeCheck(offsetInBytes.Value(), access_size, array.LengthInBytes(),    \
+                 access_size);                                                 \
+      return object::ctor(array.getter(offsetInBytes.Value()));                \
+    }                                                                          \
+    if (instance.IsExternalTypedData()) {                                      \
+      const ExternalTypedData& array = ExternalTypedData::Cast(instance);      \
+      RangeCheck(offsetInBytes.Value(), access_size, array.LengthInBytes(),    \
+                 access_size);                                                 \
+      return object::ctor(array.getter(offsetInBytes.Value()));                \
+    }                                                                          \
     const String& error = String::Handle(String::NewFormatted(                 \
         "Expected a TypedData object but found %s", instance.ToCString()));    \
     Exceptions::ThrowArgumentError(error);                                     \
-  }                                                                            \
-  return Object::null();                                                       \
-}
+    return object::null();                                                     \
+  }
 
-#define TYPED_DATA_NATIVES(type_name,                                          \
-                           object,                                             \
-                           ctor,                                               \
-                           get_object_value,                                   \
-                           access_size,                                        \
-                           access_type)                                        \
+
+#define TYPED_DATA_SETTER(setter, object, get_object_value, access_size,       \
+                          access_type)                                         \
+  DEFINE_NATIVE_ENTRY(TypedData_##setter, 3) {                                 \
+    GET_NON_NULL_NATIVE_ARGUMENT(Instance, instance,                           \
+                                 arguments->NativeArgAt(0));                   \
+    GET_NON_NULL_NATIVE_ARGUMENT(Smi, offsetInBytes,                           \
+                                 arguments->NativeArgAt(1));                   \
+    GET_NON_NULL_NATIVE_ARGUMENT(object, value, arguments->NativeArgAt(2));    \
+    if (instance.IsTypedData()) {                                              \
+      const TypedData& array = TypedData::Cast(instance);                      \
+      RangeCheck(offsetInBytes.Value(), access_size, array.LengthInBytes(),    \
+                 access_size);                                                 \
+      array.setter(offsetInBytes.Value(),                                      \
+                   static_cast<access_type>(value.get_object_value()));        \
+    } else if (instance.IsExternalTypedData()) {                               \
+      const ExternalTypedData& array = ExternalTypedData::Cast(instance);      \
+      RangeCheck(offsetInBytes.Value(), access_size, array.LengthInBytes(),    \
+                 access_size);                                                 \
+      array.setter(offsetInBytes.Value(),                                      \
+                   static_cast<access_type>(value.get_object_value()));        \
+    } else {                                                                   \
+      const String& error = String::Handle(String::NewFormatted(               \
+          "Expected a TypedData object but found %s", instance.ToCString()));  \
+      Exceptions::ThrowArgumentError(error);                                   \
+    }                                                                          \
+    return Object::null();                                                     \
+  }
+
+#define TYPED_DATA_NATIVES(type_name, object, ctor, get_object_value,          \
+                           access_size, access_type)                           \
   TYPED_DATA_GETTER(Get##type_name, object, ctor, access_size)                 \
-  TYPED_DATA_SETTER(Set##type_name, object,                                    \
-      get_object_value, access_size, access_type)                              \
+  TYPED_DATA_SETTER(Set##type_name, object, get_object_value, access_size,     \
+                    access_type)
 
 TYPED_DATA_NATIVES(Int8, Integer, New, AsTruncatedUint32Value, 1, int8_t)
 TYPED_DATA_NATIVES(Uint8, Integer, New, AsTruncatedUint32Value, 1, uint8_t)
@@ -243,11 +238,15 @@
 TYPED_DATA_NATIVES(Int32, Integer, New, AsTruncatedUint32Value, 4, int32_t)
 TYPED_DATA_NATIVES(Uint32, Integer, New, AsTruncatedUint32Value, 4, uint32_t)
 TYPED_DATA_NATIVES(Int64, Integer, New, AsTruncatedInt64Value, 8, int64_t)
-TYPED_DATA_NATIVES(
-    Uint64, Integer, NewFromUint64, AsTruncatedInt64Value, 8, uint64_t)
+TYPED_DATA_NATIVES(Uint64,
+                   Integer,
+                   NewFromUint64,
+                   AsTruncatedInt64Value,
+                   8,
+                   uint64_t)
 TYPED_DATA_NATIVES(Float32, Double, New, value, 4, float)
 TYPED_DATA_NATIVES(Float64, Double, New, value, 8, double)
-TYPED_DATA_NATIVES(Float32x4, Float32x4, New,  value, 16, simd128_value_t)
+TYPED_DATA_NATIVES(Float32x4, Float32x4, New, value, 16, simd128_value_t)
 TYPED_DATA_NATIVES(Int32x4, Int32x4, New, value, 16, simd128_value_t)
 TYPED_DATA_NATIVES(Float64x2, Float64x2, New, value, 16, simd128_value_t)
 
@@ -344,11 +343,11 @@
   GET_NON_NULL_NATIVE_ARGUMENT(Bool, little_endian, arguments->NativeArgAt(1));
   float value = host_value.value();
   if (little_endian.value()) {
-    value = bit_cast<float>(
-        Utils::HostToLittleEndian32(bit_cast<uint32_t>(value)));
+    value =
+        bit_cast<float>(Utils::HostToLittleEndian32(bit_cast<uint32_t>(value)));
   } else {
-    value = bit_cast<float>(
-        Utils::HostToBigEndian32(bit_cast<uint32_t>(value)));
+    value =
+        bit_cast<float>(Utils::HostToBigEndian32(bit_cast<uint32_t>(value)));
   }
   return Double::New(value);
 }
@@ -362,8 +361,8 @@
     value = bit_cast<double>(
         Utils::HostToLittleEndian64(bit_cast<uint64_t>(value)));
   } else {
-    value = bit_cast<double>(
-        Utils::HostToBigEndian64(bit_cast<uint64_t>(value)));
+    value =
+        bit_cast<double>(Utils::HostToBigEndian64(bit_cast<uint64_t>(value)));
   }
   return Double::New(value);
 }
diff --git a/runtime/lib/typed_data.dart b/runtime/lib/typed_data.dart
index c010555..0875fbc 100644
--- a/runtime/lib/typed_data.dart
+++ b/runtime/lib/typed_data.dart
@@ -2,6 +2,9 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// Unlike the other SDK libraries, this file is not a patch that is applied to
+// dart:typed_data.  Instead, it completely replaces the implementation from the
+// SDK.
 library dart.typed_data;
 
 import "dart:_internal";
diff --git a/runtime/lib/uri_patch.dart b/runtime/lib/uri_patch.dart
index 0ce6b11..27e5efd 100644
--- a/runtime/lib/uri_patch.dart
+++ b/runtime/lib/uri_patch.dart
@@ -2,8 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:convert" show ASCII;
-
 // VM implementation of Uri.
 typedef Uri _UriBaseClosure();
 
diff --git a/runtime/lib/vmservice.cc b/runtime/lib/vmservice.cc
index b4a8b14..6e39021 100644
--- a/runtime/lib/vmservice.cc
+++ b/runtime/lib/vmservice.cc
@@ -68,12 +68,11 @@
     args.SetAt(0, port_int);
     args.SetAt(1, send_port);
     args.SetAt(2, name);
-    const Object& r = Object::Handle(
-        DartEntry::InvokeFunction(register_function_, args));
+    const Object& r =
+        Object::Handle(DartEntry::InvokeFunction(register_function_, args));
     if (FLAG_trace_service) {
       OS::Print("vm-service: Isolate %s %" Pd64 " registered.\n",
-                name.ToCString(),
-                port_id);
+                name.ToCString(), port_id);
     }
     ASSERT(!r.IsError());
   }
@@ -92,8 +91,8 @@
   GET_NON_NULL_NATIVE_ARGUMENT(Array, message, arguments->NativeArgAt(1));
 
   // Set the type of the OOB message.
-  message.SetAt(0, Smi::Handle(thread->zone(),
-                               Smi::New(Message::kServiceOOBMsg)));
+  message.SetAt(0,
+                Smi::Handle(thread->zone(), Smi::New(Message::kServiceOOBMsg)));
 
   // Serialize message.
   uint8_t* data = NULL;
@@ -102,8 +101,7 @@
 
   // TODO(turnidge): Throw an exception when the return value is false?
   bool result = PortMap::PostMessage(
-      new Message(sp.Id(), data, writer.BytesWritten(),
-                  Message::kOOBPriority));
+      new Message(sp.Id(), data, writer.BytesWritten(), Message::kOOBPriority));
   return Bool::Get(result).raw();
 }
 
@@ -223,21 +221,13 @@
     }
   }
 
-  char* NextFilename() {
-    return filenames_.RemoveLast();
-  }
+  char* NextFilename() { return filenames_.RemoveLast(); }
 
-  uint8_t* NextContent() {
-    return contents_.RemoveLast();
-  }
+  uint8_t* NextContent() { return contents_.RemoveLast(); }
 
-  intptr_t NextContentLength() {
-    return content_lengths_.RemoveLast();
-  }
+  intptr_t NextContentLength() { return content_lengths_.RemoveLast(); }
 
-  bool HasMore() const {
-    return filenames_.length() > 0;
-  }
+  bool HasMore() const { return filenames_.length() > 0; }
 
   intptr_t Length() const { return filenames_.length(); }
 
@@ -266,9 +256,7 @@
     kTarXglType = 'g',
   };
 
-  bool HasNext() const {
-    return !EndOfArchive();
-  }
+  bool HasNext() const { return !EndOfArchive(); }
 
   bool Next(char** filename, uint8_t** data, intptr_t* data_length) {
     intptr_t startOfBlock = rs_.Position();
@@ -404,8 +392,8 @@
   Dart_TypedData_Type typ;
   void* bytes;
   intptr_t length;
-  Dart_Handle err = Dart_TypedDataAcquireData(
-      data_handle, &typ, &bytes, &length);
+  Dart_Handle err =
+      Dart_TypedDataAcquireData(data_handle, &typ, &bytes, &length);
   ASSERT(!Dart_IsError(err));
 
   TarArchive archive(reinterpret_cast<uint8_t*>(bytes), length);
@@ -426,17 +414,15 @@
     intptr_t contents_length = archive.NextContentLength();
 
     Dart_Handle dart_filename = Dart_NewExternalLatin1String(
-        reinterpret_cast<uint8_t*>(filename),
-        strlen(filename),
-        filename,
+        reinterpret_cast<uint8_t*>(filename), strlen(filename), filename,
         FilenameFinalizer);
     ASSERT(!Dart_IsError(dart_filename));
 
     Dart_Handle dart_contents = Dart_NewExternalTypedData(
         Dart_TypedData_kUint8, contents, contents_length);
     ASSERT(!Dart_IsError(dart_contents));
-    Dart_NewWeakPersistentHandle(
-        dart_contents, contents, contents_length, ContentsFinalizer);
+    Dart_NewWeakPersistentHandle(dart_contents, contents, contents_length,
+                                 ContentsFinalizer);
 
     Dart_ListSetAt(result_list, idx, dart_filename);
     Dart_ListSetAt(result_list, (idx + 1), dart_contents);
@@ -449,7 +435,6 @@
 }
 
 
-
 DEFINE_NATIVE_ENTRY(VMService_spawnUriNotify, 2) {
 #ifndef PRODUCT
   if (!FLAG_support_service) {
@@ -469,8 +454,8 @@
       // There is no isolate at the control port anymore.  Must have
       // died already.
       ServiceEvent spawn_event(NULL, ServiceEvent::kIsolateSpawn);
-      const String& error = String::Handle(String::New(
-          "spawned isolate exited before notification completed"));
+      const String& error = String::Handle(
+          String::New("spawned isolate exited before notification completed"));
       spawn_event.set_spawn_token(&token);
       spawn_event.set_spawn_error(&error);
       Service::HandleEvent(&spawn_event);
diff --git a/runtime/lib/weak_property.cc b/runtime/lib/weak_property.cc
index 80da580..88b9bf8 100644
--- a/runtime/lib/weak_property.cc
+++ b/runtime/lib/weak_property.cc
@@ -21,22 +21,22 @@
 
 
 DEFINE_NATIVE_ENTRY(WeakProperty_getKey, 1) {
-  GET_NON_NULL_NATIVE_ARGUMENT(
-      WeakProperty, weak_property, arguments->NativeArgAt(0));
+  GET_NON_NULL_NATIVE_ARGUMENT(WeakProperty, weak_property,
+                               arguments->NativeArgAt(0));
   return weak_property.key();
 }
 
 
 DEFINE_NATIVE_ENTRY(WeakProperty_getValue, 1) {
-  GET_NON_NULL_NATIVE_ARGUMENT(
-      WeakProperty, weak_property, arguments->NativeArgAt(0));
+  GET_NON_NULL_NATIVE_ARGUMENT(WeakProperty, weak_property,
+                               arguments->NativeArgAt(0));
   return weak_property.value();
 }
 
 
 DEFINE_NATIVE_ENTRY(WeakProperty_setValue, 2) {
-  GET_NON_NULL_NATIVE_ARGUMENT(
-      WeakProperty, weak_property, arguments->NativeArgAt(0));
+  GET_NON_NULL_NATIVE_ARGUMENT(WeakProperty, weak_property,
+                               arguments->NativeArgAt(0));
   GET_NON_NULL_NATIVE_ARGUMENT(Instance, value, arguments->NativeArgAt(1));
   weak_property.set_value(value);
   return Object::null();
diff --git a/runtime/observatory/BUILD.gn b/runtime/observatory/BUILD.gn
index a476414..d4c736c 100644
--- a/runtime/observatory/BUILD.gn
+++ b/runtime/observatory/BUILD.gn
@@ -2,6 +2,9 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
+import("../../build/executable_suffix.gni")
+import("../../build/prebuilt_dart_sdk.gni")
+
 # Currently paths here are hard coded for convenience in building Mojo/Flutter.
 declare_args() {
   # Specify the path to a host compatible version of the Dart SDK.
@@ -10,52 +13,75 @@
 
   # Specify the path to a host compatible version of pub.
   # This is used to compile the Observatory frontend sources.
+  #
+  # The observatory build tool searches for pub first using this GN arg, then
+  # for the checked-in SDK, and if that doesn't work, it uses the dart_bootstrap
+  # built as part of the build to invoke pub. If this arg is set to a non-empty
+  # string, we assume that there is no need for dart_bootstrap. If it is set to
+  # "", then we assume that there may be a need for dart_bootstrap.
   dart_host_pub_exe = rebase_path("$dart_host_sdk/bin/pub")
 }
 
+# Construct arguments to the observatory tool for finding pub.
+pub_build_deps = []
+pub_build_args = []
+if (dart_host_pub_exe != "") {
+  pub_build_args = [
+    "--pub-executable",
+    dart_host_pub_exe,
+  ]
+} else if (!prebuilt_dart_exe_works) {
+  pub_build_deps += [ "../bin:dart_bootstrap($host_toolchain)" ]
+
+  dart_out_dir =
+      get_label_info("../bin:dart_bootstrap($host_toolchain)", "root_out_dir")
+  dart_bootstrap = rebase_path("$dart_out_dir/dart_bootstrap$executable_suffix")
+
+  pub_build_args = [
+    "--sdk=True",
+    "--dart-executable",
+    dart_bootstrap,
+  ]
+} else {
+  pub_build_args = [ "--sdk=True" ]
+}
+
+current_dir = rebase_path(".", "//")
+
 # Helper build rules for packaging the Dart observatory resources.
 observatory_sources_gypi =
     exec_script("../../tools/gypi_to_gn.py",
-                [ rebase_path(
-                    "../observatory/observatory_sources.gypi") ],
+                [ rebase_path("../observatory/observatory_sources.gypi") ],
                 "scope",
                 [ "../observatory/observatory_sources.gypi" ])
 
 copy("copy_observatory") {
-  sources = rebase_path(observatory_sources_gypi.sources,
-                        "",
-                        ".")
+  sources = rebase_path(observatory_sources_gypi.sources, "", ".")
   outputs = [
     "$root_gen_dir/observatory_copy/{{source_root_relative_dir}}/{{source_file_part}}",
   ]
 }
 
 action("write_observatory_pubspec_yaml") {
-  deps = [
-    ":copy_observatory",
-  ]
-
-  script = "../../tools/observatory_tool.py"
+  deps = [ ":copy_observatory" ] + pub_build_deps
 
   inputs = [
     rebase_path("pubspec.yaml"),
   ]
 
-  current_dir = rebase_path(".", "//")
-  args = [
-    "--silent=True",
-    "--pub-executable",
-    dart_host_pub_exe,
-    "--directory",
-    rebase_path("$root_gen_dir/observatory_copy/$current_dir/"),
-    "--command",
-    "rewrite",
-    rebase_path("../observatory/pubspec.yaml"),
-    rebase_path(
-        "$root_gen_dir/observatory_copy/$current_dir/pubspec.yaml"),
-    "../../third_party/",
-    rebase_path("../../third_party/"),
-  ]
+  script = "../../tools/observatory_tool.py"
+  args =
+      pub_build_args + [
+        "--silent=True",
+        "--directory",
+        rebase_path("$root_gen_dir/observatory_copy/$current_dir/"),
+        "--command",
+        "rewrite",
+        rebase_path("../observatory/pubspec.yaml"),
+        rebase_path("$root_gen_dir/observatory_copy/$current_dir/pubspec.yaml"),
+        "../../third_party/",
+        rebase_path("../../third_party/"),
+      ]
 
   outputs = [
     "$root_gen_dir/observatory_copy/$current_dir/pubspec.yaml",
@@ -63,29 +89,23 @@
 }
 
 action("copy_observatory_deps") {
-  deps = [
-    ":write_observatory_pubspec_yaml",
-  ]
+  deps = [ ":write_observatory_pubspec_yaml" ] + pub_build_deps
 
-  script = "../../tools/observatory_tool.py"
-
-  current_dir = rebase_path(".", "//")
   inputs = [
-    script,
     "$root_gen_dir/observatory_copy/$current_dir/pubspec.yaml",
   ]
 
-  args = [
-    "--silent=True",
-    "--pub-executable",
-    dart_host_pub_exe,
-    "--stamp",
-    rebase_path("$root_gen_dir/observatory_copy/$current_dir/packages.stamp"),
-    "--directory",
-    rebase_path("$root_gen_dir/observatory_copy/$current_dir/"),
-    "--command",
-    "get",
-  ]
+  script = "../../tools/observatory_tool.py"
+  args = pub_build_args + [
+           "--silent=True",
+           "--stamp",
+           rebase_path(
+               "$root_gen_dir/observatory_copy/$current_dir/packages.stamp"),
+           "--directory",
+           rebase_path("$root_gen_dir/observatory_copy/$current_dir/"),
+           "--command",
+           "get",
+         ]
 
   outputs = [
     "$root_gen_dir/observatory_copy/$current_dir/packages.stamp",
@@ -93,35 +113,27 @@
 }
 
 action("pub_build_observatory") {
-  current_dir = rebase_path(".", "//")
-  sources =
-      rebase_path(observatory_sources_gypi.sources,
-                  "",
-                  "$root_gen_dir/observatory_copy/$current_dir")
-
   deps = [
-    ":copy_observatory",
-    ":copy_observatory_deps",
-  ]
+           ":copy_observatory",
+           ":copy_observatory_deps",
+         ] + pub_build_deps
+
+  sources = rebase_path(observatory_sources_gypi.sources,
+                        "",
+                        "$root_gen_dir/observatory_copy/$current_dir")
+
+  inputs =
+      sources + [ "$root_gen_dir/observatory_copy/$current_dir/packages.stamp" ]
 
   script = "../../tools/observatory_tool.py"
-
-  inputs = [
-    script,
-    "$root_gen_dir/observatory_copy/$current_dir/packages.stamp",
-  ]
-  inputs += sources
-
-  args = [
-    "--silent=True",
-    "--pub-executable",
-    dart_host_pub_exe,
-    "--directory",
-    rebase_path("$root_gen_dir/observatory_copy/$current_dir/"),
-    "--command",
-    "build",
-    rebase_path("$root_out_dir/observatory/build"),
-  ]
+  args = pub_build_args + [
+           "--silent=True",
+           "--directory",
+           rebase_path("$root_gen_dir/observatory_copy/$current_dir/"),
+           "--command",
+           "build",
+           rebase_path("$root_out_dir/observatory/build"),
+         ]
 
   outputs = [
     "$root_out_dir/observatory/build/web/main.dart.js",
@@ -129,9 +141,7 @@
 }
 
 action("deploy_observatory") {
-  deps = [
-    ":pub_build_observatory",
-  ]
+  deps = [ ":pub_build_observatory" ] + pub_build_deps
 
   script = "../../tools/observatory_tool.py"
 
@@ -140,15 +150,13 @@
     "$root_out_dir/observatory/build/web/main.dart.js",
   ]
 
-  args = [
-    "--silent=True",
-    "--pub-executable",
-    dart_host_pub_exe,
-    "--directory",
-    rebase_path("$root_out_dir/observatory"),
-    "--command",
-    "deploy",
-  ]
+  args = pub_build_args + [
+           "--silent=True",
+           "--directory",
+           rebase_path("$root_out_dir/observatory"),
+           "--command",
+           "deploy",
+         ]
 
   outputs = [
     "$root_out_dir/observatory/deployed/web/main.dart.js",
@@ -160,31 +168,41 @@
          "Need inner_namespace in $target_name")
   assert(defined(invoker.outer_namespace),
          "Need outer_namespace in $target_name")
+  enable_compression = false
+  if (defined(invoker.compress) && invoker.compress) {
+    enable_compression = true
+  }
   action(target_name) {
     deps = [
       ":deploy_observatory",
     ]
 
-    script = "../tools/create_archive.py"
-
-  inputs = [
-    script,
-    "$root_out_dir/observatory/deployed/web/main.dart.js",
-  ]
+    inputs = [
+      "$root_out_dir/observatory/deployed/web/main.dart.js",
+    ]
 
     inner_namespace = invoker.inner_namespace
     outer_namespace = invoker.outer_namespace
     output_name = target_name
+
+    script = "../tools/create_archive.py"
     args = [
       "--output",
       rebase_path("$root_gen_dir/observatory/${output_name}.cc"),
       "--tar_output",
       rebase_path("$root_gen_dir/observatory/${output_name}.tar"),
-      "--outer_namespace", outer_namespace,
-      "--inner_namespace", inner_namespace,
-      "--name", "observatory_assets_archive",
-      "--client_root", rebase_path("$root_out_dir/observatory/deployed/web/"),
+      "--outer_namespace",
+      outer_namespace,
+      "--inner_namespace",
+      inner_namespace,
+      "--name",
+      "observatory_assets_archive",
+      "--client_root",
+      rebase_path("$root_out_dir/observatory/deployed/web/"),
     ]
+    if (enable_compression) {
+      args += [ "--compress" ]
+    }
 
     outputs = [
       "$root_gen_dir/observatory/${output_name}.cc",
@@ -209,6 +227,7 @@
 }
 
 observatory_archive("standalone_archive_observatory") {
+  compress = true
   outer_namespace = "dart"
   inner_namespace = "bin"
 }
diff --git a/runtime/observatory/HACKING.md b/runtime/observatory/HACKING.md
index e8c5500..fe47693 100644
--- a/runtime/observatory/HACKING.md
+++ b/runtime/observatory/HACKING.md
@@ -185,7 +185,7 @@
 See: __Run existing tests__
 
 [build_sdk]: https://github.com/dart-lang/sdk/wiki/Building "Building the Dart SDK"
-[download_dartium]: https://www.dartlang.org/tools/dartium/ "Download Dartium"
+[download_dartium]: https://webdev.dartlang.org/tools/dartium/ "Download Dartium"
 [build_dartium]: https://github.com/dart-lang/sdk/wiki/Building-Dartium "Build Dartium"
 [open_observatory]: http://localhost:8080/ "Open Observatory"
 [observatory_get_started]: https://dart-lang.github.io/observatory/get-started.html "Observatory get started"
diff --git a/runtime/observatory/lib/event.dart b/runtime/observatory/lib/event.dart
index 4ca9106..07c7d41 100644
--- a/runtime/observatory/lib/event.dart
+++ b/runtime/observatory/lib/event.dart
@@ -138,6 +138,21 @@
   }
 }
 
+
+class PausePostRequestEvent implements M.PausePostRequestEvent {
+  final DateTime timestamp;
+  final M.IsolateRef isolate;
+  final M.Frame topFrame;
+  final bool atAsyncSuspension;
+  PausePostRequestEvent(
+      this.timestamp, this.isolate, this.topFrame, this.atAsyncSuspension) {
+    assert(timestamp != null);
+    assert(isolate != null);
+    assert(atAsyncSuspension != null);
+  }
+}
+
+
 class PauseExceptionEvent implements M.PauseExceptionEvent {
   final DateTime timestamp;
   final M.IsolateRef isolate;
@@ -303,6 +318,12 @@
       return new PauseStartEvent(event.timestamp, event.isolate);
     case S.ServiceEvent.kPauseExit:
       return new PauseExitEvent(event.timestamp, event.isolate);
+    case S.ServiceEvent.kPausePostRequest:
+      return new PausePostRequestEvent(
+          event.timestamp,
+          event.isolate,
+          event.topFrame,
+          event.atAsyncSuspension);
     case S.ServiceEvent.kPauseBreakpoint:
       return new PauseBreakpointEvent(
           event.timestamp,
diff --git a/runtime/observatory/lib/object_graph.dart b/runtime/observatory/lib/object_graph.dart
index c2b4169..146badc 100644
--- a/runtime/observatory/lib/object_graph.dart
+++ b/runtime/observatory/lib/object_graph.dart
@@ -8,6 +8,8 @@
 import 'dart:collection';
 import 'dart:typed_data';
 
+import 'package:logging/logging.dart';
+
 class _JenkinsSmiHash {
   static int combine(int hash, int value) {
     hash = 0x1fffffff & (hash + value);
@@ -214,14 +216,20 @@
   static const int maxUnsignedDataPerByte = byteMask;
 }
 
+// Node indices for the root and sentinel nodes. Note that using 0 as the
+// sentinel means a newly allocated typed array comes initialized with all
+// elements as the sentinel.
+const ROOT = 1;
+const SENTINEL = 0;
+
 class ObjectVertex {
-  // 0 represents invalid/uninitialized, 1 is the root.
   final int _id;
   final ObjectGraph _graph;
 
   ObjectVertex._(this._id, this._graph);
 
-  bool get isRoot => _id == 1;
+  bool get isRoot => ROOT == _id;
+  bool get isStack => vmCid == _graph._kStackCid;
 
   bool operator ==(other) => _id == other._id && _graph == other._graph;
   int get hashCode => _id;
@@ -272,7 +280,7 @@
     var parentId = _id;
     var domChildren = [];
 
-    for (var childId = 1; childId <= N; childId++) {
+    for (var childId = ROOT; childId <= N; childId++) {
       if (doms[childId] == parentId) {
         domChildren.add(new ObjectVertex._(childId, _graph));
       }
@@ -282,6 +290,82 @@
   }
 }
 
+// A node in the dominator tree where siblings with the same class are merged.
+// That is, a set of objects with the same cid whose parent chains in the
+// dominator tree have the same cids at each level. [id_] is the representative
+// object of this set. The other members of the set are found by walking the
+// mergedDomNext links until finding the sentinel node or a node with a
+// different class.
+class MergedObjectVertex {
+  final int _id;
+  final ObjectGraph _graph;
+
+  MergedObjectVertex._(this._id, this._graph);
+
+  bool get isRoot => ROOT == _id;
+  bool get isStack => vmCid == _graph._kStackCid;
+
+  bool operator ==(other) => _id == other._id && _graph == other._graph;
+  int get hashCode => _id;
+
+  int get vmCid => _graph._cids[_id];
+
+  int get shallowSize {
+    var cids = _graph._cids;
+    var size = 0;
+    var sibling = _id;
+    while (sibling != SENTINEL &&
+           cids[sibling] == cids[_id]) {
+      size += _graph._shallowSizes[sibling];
+      sibling = _graph._mergedDomNext[sibling];
+    }
+    return size;
+  }
+  int get retainedSize {
+    var cids = _graph._cids;
+    var size = 0;
+    var sibling = _id;
+    while (sibling != SENTINEL &&
+           cids[sibling] == cids[_id]) {
+      size += _graph._retainedSizes[sibling];
+      sibling = _graph._mergedDomNext[sibling];
+    }
+    return size;
+  }
+  int get instanceCount {
+    var cids = _graph._cids;
+    var count = 0;
+    var sibling = _id;
+    while (sibling != SENTINEL &&
+           cids[sibling] == cids[_id]) {
+      count++;
+      sibling = _graph._mergedDomNext[sibling];
+    }
+    return count;
+  }
+
+  List<MergedObjectVertex> dominatorTreeChildren() {
+    var next = _graph._mergedDomNext;
+    var cids = _graph._cids;
+
+    var domChildren = [];
+    var prev = SENTINEL;
+    var child = _graph._mergedDomHead[_id];
+    // Walk the list of children and look for the representative objects, i.e.
+    // the first sibling of each cid.
+    while (child != SENTINEL) {
+      if (prev == SENTINEL ||
+          cids[prev] != cids[child]) {
+        domChildren.add(new MergedObjectVertex._(child, _graph));
+      }
+      prev = child;
+      child = next[child];
+    }
+
+    return domChildren;
+  }
+}
+
 class _SuccessorsIterable extends IterableBase<ObjectVertex> {
   final ObjectGraph _graph;
   final int _id;
@@ -345,7 +429,8 @@
   int get vertexCount => _N;
   int get edgeCount => _E;
 
-  ObjectVertex get root => new ObjectVertex._(1, this);
+  ObjectVertex get root => new ObjectVertex._(ROOT, this);
+  MergedObjectVertex get mergedRoot => new MergedObjectVertex._(ROOT, this);
   Iterable<ObjectVertex> get vertices => new _VerticesIterable(this);
 
   Iterable<ObjectVertex> getMostRetained({int classId, int limit}) {
@@ -381,10 +466,10 @@
       controller.add(["Finding depth-first order...", 30.0]);
       await new Future(() => _dfs());
 
-      controller.add(["Finding predecessors...", 45.0]);
+      controller.add(["Finding predecessors...", 40.0]);
       await new Future(() => _buildPredecessors());
 
-      controller.add(["Finding dominators...", 60.0]);
+      controller.add(["Finding dominators...", 50.0]);
       await new Future(() => _buildDominators());
 
       _firstPreds = null;
@@ -393,12 +478,21 @@
       _semi = null;
       _parent = null;
 
-      controller.add(["Finding retained sizes...", 75.0]);
+      controller.add(["Finding retained sizes...", 60.0]);
       await new Future(() => _calculateRetainedSizes());
 
       _vertex = null;
 
-      controller.add(["Loaded", 100.0]);
+      controller.add(["Linking dominator tree children...", 70.0]);
+      await new Future(() => _linkDominatorChildren());
+
+      controller.add(["Sorting dominator tree children...", 80.0]);
+      await new Future(() => _sortDominatorChildren());
+
+      controller.add(["Merging dominator tree siblings...", 90.0]);
+      await new Future(() => _mergeDominatorSiblings());
+
+      controller.add(["Processed", 100.0]);
       controller.close();
     }());
     return controller.stream;
@@ -407,8 +501,10 @@
   List<ByteData> _chunks;
 
   int _kObjectAlignment;
-  int _N;
-  int _E;
+  int _kStackCid;
+  int _N;  // Objects in the snapshot.
+  int _Nconnected;  // Objects reachable from root.
+  int _E;  // References in the snapshot.
   int _size;
 
   // Indexed by node id, with id 0 representing invalid/uninitialized.
@@ -431,6 +527,8 @@
   // Outputs.
   Uint32List _doms;
   Uint32List _retainedSizes;
+  Uint32List _mergedDomHead;
+  Uint32List _mergedDomNext;
 
   void _remapNodes() {
     var N = _N;
@@ -445,8 +543,10 @@
     var stream = new ReadStream(_chunks);
     stream.readUnsigned();
     _kObjectAlignment = stream.clampedUint32;
+    stream.readUnsigned();
+    _kStackCid = stream.clampedUint32;
 
-    var id = 1;
+    var id = ROOT;
     while (stream.pendingBytes > 0) {
       stream.readUnsigned(); // addr
       addrToId.put(stream.high, stream.mid, stream.low, id);
@@ -466,8 +566,7 @@
     }
     assert(id == (N + 1));
 
-    var root = addrToId.get(0, 0, 0);
-    assert(root == 1);
+    assert(ROOT == addrToId.get(0, 0, 0));
 
     _E = E;
     _addrToId = addrToId;
@@ -486,7 +585,8 @@
     var succs = new Uint32List(E);
 
     var stream = new ReadStream(_chunks);
-    stream.skipUnsigned(); // addr alignment
+    stream.skipUnsigned(); // kObjectAlignment
+    stream.skipUnsigned(); // kStackCid
 
     var id = 1, edge = 0;
     while (stream.pendingBytes > 0) {
@@ -503,7 +603,8 @@
           succs[edge] = childId;
           edge++;
         } else {
-          // Reference into VM isolate's heap.
+          throw new Exception(
+              "Heap snapshot contains an edge but lacks its target node");
         }
         stream.readUnsigned();
       }
@@ -512,8 +613,7 @@
     firstSuccs[id] = edge; // Extra entry for cheap boundary detection.
 
     assert(id == N + 1);
-    assert(edge <= E); // edge is smaller because E was computed before we knew
-    // if references pointed into the VM isolate
+    assert(edge == E);
 
     _E = edge;
     _firstSuccs = firstSuccs;
@@ -534,11 +634,10 @@
     var dfsNumber = 0;
 
     var stackTop = 0;
-    var root = 1;
 
     // Push root.
-    stackNodes[0] = root;
-    stackCurrentEdgePos[0] = firstSuccs[root];
+    stackNodes[0] = ROOT;
+    stackCurrentEdgePos[0] = firstSuccs[ROOT];
 
     while (stackTop >= 0) {
       var v = stackNodes[stackTop];
@@ -570,15 +669,40 @@
       }
     }
 
-    assert(dfsNumber == N);
-    for (var i = 1; i <= N; i++) {
-      assert(semi[i] != 0);
-    }
-    assert(parent[1] == 0);
-    for (var i = 2; i <= N; i++) {
-      assert(parent[i] != 0);
+    if (dfsNumber != N) {
+      // This may happen in filtered snapshots.
+      Logger.root.warning('Heap snapshot contains unreachable nodes.');
     }
 
+    assert(() {
+      for (var i = 1; i <= dfsNumber; i++) {
+        var v = vertex[i];
+        assert(semi[v] != SENTINEL);
+      }
+      assert(parent[1] == SENTINEL);
+      for (var i = 2; i <= dfsNumber; i++) {
+        var v = vertex[i];
+        assert(parent[v] != SENTINEL);
+      }
+      return true;
+    });
+
+    if (dfsNumber != N) {
+      // Remove successors of unconnected nodes
+      for (var i = ROOT + 1; i <= N; i++) {
+        if (parent[i] == SENTINEL) {
+          var startSuccIndex = firstSuccs[i];
+          var limitSuccIndex = firstSuccs[i + 1];
+          for (var succIndex = startSuccIndex;
+               succIndex < limitSuccIndex;
+               succIndex++) {
+            succs[succIndex] = SENTINEL;
+          }
+        }
+      }
+    }
+
+    _Nconnected = dfsNumber;
     _vertex = vertex;
     _semi = semi;
     _parent = parent;
@@ -586,6 +710,7 @@
 
   void _buildPredecessors() {
     var N = _N;
+    var Nconnected = _Nconnected;
     var E = _E;
     var firstSuccs = _firstSuccs;
     var succs = _succs;
@@ -601,7 +726,9 @@
     // Count predecessors of each node.
     for (var succIndex = 0; succIndex < E; succIndex++) {
       var succId = succs[succIndex];
-      numPreds[succId]++;
+      if (succId != SENTINEL) {
+        numPreds[succId]++;
+      }
     }
 
     // Assign indices into predecessors array.
@@ -614,8 +741,10 @@
       firstPreds[i] = thisPredIndex;
       nextPreds[i] = thisPredIndex;
     }
-    assert(predIndex == E);
-    firstPreds[N + 1] = E; // Extra entry for cheap boundary detection.
+    if (N == Nconnected) {
+      assert(predIndex == E);
+    }
+    firstPreds[N + 1] = predIndex; // Extra entry for cheap boundary detection.
 
     // Fill predecessors array.
     for (var i = 1; i <= N; i++) {
@@ -625,8 +754,10 @@
           succIndex < limitSuccIndex;
           succIndex++) {
         var succId = succs[succIndex];
-        var predIndex = nextPreds[succId]++;
-        preds[predIndex] = i;
+        if (succId != SENTINEL) {
+          var predIndex = nextPreds[succId]++;
+          preds[predIndex] = i;
+        }
       }
     }
 
@@ -636,7 +767,7 @@
 
   static int _eval(int v, Uint32List ancestor, Uint32List semi,
       Uint32List label, Uint32List stackNode, Uint8List stackState) {
-    if (ancestor[v] == 0) {
+    if (ancestor[v] == SENTINEL) {
       return label[v];
     } else {
       {
@@ -712,6 +843,7 @@
   // in a Flowgraph."
   void _buildDominators() {
     var N = _N;
+    var Nconnected = _Nconnected;
 
     var vertex = _vertex;
     var semi = _semi;
@@ -719,7 +851,6 @@
     var firstPreds = _firstPreds;
     var preds = _preds;
 
-    var root = 1;
     var dom = new Uint32List(N + 1);
 
     var ancestor = new Uint32List(N + 1);
@@ -736,9 +867,9 @@
     var stackNode = new Uint32List(N + 1);
     var stackState = new Uint8List(N + 1);
 
-    for (var i = N; i > 1; i--) {
+    for (var i = Nconnected; i > 1; i--) {
       var w = vertex[i];
-      assert(w != root);
+      assert(w != ROOT);
 
       // Lengauer & Tarjan Step 2.
       var startPred = firstPreds[w];
@@ -771,11 +902,11 @@
         }
       }
     }
-    for (var i = 1; i <= N; i++) {
+    for (var i = ROOT; i <= N; i++) {
       assert(buckets[i] == null);
     }
     // Lengauer & Tarjan Step 4.
-    for (var i = 2; i <= N; i++) {
+    for (var i = 2; i <= Nconnected; i++) {
       var w = vertex[i];
       if (dom[w] != vertex[semi[w]]) {
         dom[w] = dom[dom[w]];
@@ -787,6 +918,7 @@
 
   void _calculateRetainedSizes() {
     var N = _N;
+    var Nconnected = _Nconnected;
 
     var size = 0;
     var shallowSizes = _shallowSizes;
@@ -794,8 +926,9 @@
     var doms = _doms;
 
     // Sum shallow sizes.
-    for (var i = 1; i < N; i++) {
-      size += shallowSizes[i];
+    for (var i = 1; i <= Nconnected; i++) {
+      var v = vertex[i];
+      size += shallowSizes[v];
     }
 
     // Start with retained size as shallow size.
@@ -803,13 +936,176 @@
 
     // In post order (bottom up), add retained size to dominator's retained
     // size, skipping root.
-    for (var i = N; i > 1; i--) {
+    for (var i = Nconnected; i > 1; i--) {
       var v = vertex[i];
-      assert(v != 1);
-      retainedSizes[doms[i]] += retainedSizes[i];
+      assert(v != ROOT);
+      retainedSizes[doms[v]] += retainedSizes[v];
     }
 
+    assert(retainedSizes[ROOT] == size);  // Root retains everything.
+
     _retainedSizes = retainedSizes;
     _size = size;
   }
+
+  // Build linked lists of the children for each node in the dominator tree.
+  void _linkDominatorChildren() {
+    var N = _N;
+    var doms = _doms;
+    var head = new Uint32List(N + 1);
+    var next = new Uint32List(N + 1);
+
+    for (var child = ROOT; child <= N; child++) {
+      var parent = doms[child];
+      next[child] = head[parent];
+      head[parent] = child;
+    }
+
+    _mergedDomHead = head;
+    _mergedDomNext = next;
+  }
+
+  // Merge the given lists according to the given key in ascending order.
+  // Returns the head of the merged list.
+  static int _mergeSorted(int head1, int head2,
+                          Uint32List next, Uint16List key) {
+    var head = head1;
+    var beforeInsert = SENTINEL;
+    var afterInsert = head1;
+    var startInsert = head2;
+
+    while (startInsert != SENTINEL) {
+      while ((afterInsert != SENTINEL) &&
+             (key[afterInsert] <= key[startInsert])) {
+        beforeInsert = afterInsert;
+        afterInsert = next[beforeInsert];
+      }
+
+      var endInsert = startInsert;
+      var peek = next[endInsert];
+
+      while ((peek != SENTINEL) && (key[peek] < key[afterInsert])) {
+        endInsert = peek;
+        peek = next[endInsert];
+      }
+      assert(endInsert != SENTINEL);
+
+      if (beforeInsert == SENTINEL) {
+        head = startInsert;
+      } else {
+        next[beforeInsert] = startInsert;
+      }
+      next[endInsert] = afterInsert;
+
+      startInsert = peek;
+      beforeInsert = endInsert;
+    }
+
+    return head;
+  }
+
+  void _sortDominatorChildren() {
+    var N = _N;
+    var cids = _cids;
+    var head = _mergedDomHead;
+    var next = _mergedDomNext;
+
+    // Returns the new head of the sorted list.
+    int sort(int head) {
+      if (head == SENTINEL) return SENTINEL;
+      if (next[head] == SENTINEL) return head;
+
+      // Find the middle of the list.
+      int head1 = head;
+      int slow = head;
+      int fast = head;
+      while (next[fast] != SENTINEL &&
+             next[next[fast]] != SENTINEL) {
+        slow = next[slow];
+        fast = next[next[fast]];
+      }
+
+      // Split the list in half.
+      int head2 = next[slow];
+      next[slow] = SENTINEL;
+
+      // Recursively sort the sublists and merge.
+      assert(head1 != head2);
+      int newHead1 = sort(head1);
+      int newHead2 = sort(head2);
+      return _mergeSorted(newHead1, newHead2, next, cids);
+    }
+
+    // Sort all list of dominator tree children by cid.
+    for (var parent = ROOT; parent <= N; parent++) {
+      head[parent] = sort(head[parent]);
+    }
+  }
+
+  void _mergeDominatorSiblings() {
+    var N = _N;
+    var cids = _cids;
+    var head = _mergedDomHead;
+    var next = _mergedDomNext;
+    var workStack = new Uint32List(N);
+    var workStackTop = 0;
+
+    mergeChildrenAndSort(var parent1, var end) {
+      assert(parent1 != SENTINEL);
+      if (next[parent1] == end) return;
+
+      // Find the middle of the list.
+      int cid = cids[parent1];
+      int slow = parent1;
+      int fast = parent1;
+      while (next[fast] != end &&
+             next[next[fast]] != end) {
+        slow = next[slow];
+        fast = next[next[fast]];
+      }
+
+      int parent2 = next[slow];
+
+      assert(parent2 != SENTINEL);
+      assert(parent1 != parent2);
+      assert(cids[parent1] == cids[parent2]);
+
+      // Recursively sort the sublists.
+      mergeChildrenAndSort(parent1, parent2);
+      mergeChildrenAndSort(parent2, end);
+
+      // Merge sorted sublists.
+      head[parent1] = _mergeSorted(head[parent1], head[parent2], next, cids);
+
+      // Children moved to parent1.
+      head[parent2] = SENTINEL;
+    }
+
+    // Push root.
+    workStack[workStackTop++] = ROOT;
+
+    while (workStackTop > 0) {
+      var parent = workStack[--workStackTop];
+
+      var prev = SENTINEL;
+      var child = head[parent];
+      while (child != SENTINEL) {
+        // Push child.
+        workStack[workStackTop++] = child;
+
+        // Find next sibling with a different cid.
+        var after = child;
+        while (after != SENTINEL &&
+               cids[after] == cids[child]) {
+          after = next[after];
+        }
+
+        // From all the siblings between child and after, take their children,
+        // merge them and given to child.
+        mergeChildrenAndSort(child, after);
+
+        child = after;
+      }
+    }
+  }
 }
diff --git a/runtime/observatory/lib/repositories.dart b/runtime/observatory/lib/repositories.dart
index 03e6cc6..a4b73ff 100644
--- a/runtime/observatory/lib/repositories.dart
+++ b/runtime/observatory/lib/repositories.dart
@@ -13,7 +13,6 @@
 import 'package:observatory/models.dart' as M;
 import 'package:observatory/service.dart' as S;
 import 'package:observatory/service_common.dart' as SC;
-import 'package:observatory/utils.dart';
 
 part 'src/repositories/allocation_profile.dart';
 part 'src/repositories/breakpoint.dart';
diff --git a/runtime/observatory/lib/src/app/application.dart b/runtime/observatory/lib/src/app/application.dart
index 977550f..db07c701 100644
--- a/runtime/observatory/lib/src/app/application.dart
+++ b/runtime/observatory/lib/src/app/application.dart
@@ -239,6 +239,7 @@
       final bool currentTargetConnected = (_vm != null) && !_vm.isDisconnected;
       if (!currentTarget || !currentTargetConnected) {
         _switchVM(new WebSocketVM(targets.current));
+        app.locationManager.go(Uris.vm());
       }
     });
 
diff --git a/runtime/observatory/lib/src/elements/heap_snapshot.dart b/runtime/observatory/lib/src/elements/heap_snapshot.dart
index 2fd6e78..830e1a0 100644
--- a/runtime/observatory/lib/src/elements/heap_snapshot.dart
+++ b/runtime/observatory/lib/src/elements/heap_snapshot.dart
@@ -17,6 +17,7 @@
 import 'package:observatory/src/elements/helpers/nav_menu.dart';
 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart';
 import 'package:observatory/src/elements/helpers/tag.dart';
+import 'package:observatory/src/elements/helpers/uris.dart';
 import 'package:observatory/src/elements/nav/isolate_menu.dart';
 import 'package:observatory/src/elements/nav/notify.dart';
 import 'package:observatory/src/elements/nav/refresh.dart';
@@ -24,7 +25,7 @@
 import 'package:observatory/src/elements/nav/vm_menu.dart';
 import 'package:observatory/utils.dart';
 
-enum HeapSnapshotTreeMode { dominatorTree, groupByClass }
+enum HeapSnapshotTreeMode { dominatorTree, mergedDominatorTree, groupByClass }
 
 class HeapSnapshotElement extends HtmlElement implements Renderable {
   static const tag =
@@ -51,6 +52,7 @@
   M.HeapSnapshot _snapshot;
   Stream<M.HeapSnapshotLoadingProgressEvent> _progressStream;
   M.HeapSnapshotLoadingProgress _progress;
+  M.HeapSnapshotRoots _roots = M.HeapSnapshotRoots.user;
   HeapSnapshotTreeMode _mode = HeapSnapshotTreeMode.dominatorTree;
 
   M.IsolateRef get isolate => _isolate;
@@ -138,7 +140,9 @@
 
   Future _refresh() async {
     _progress = null;
-    _progressStream = _snapshots.get(isolate);
+    _progressStream = _snapshots.get(isolate,
+                                     roots: _roots,
+                                     gc: true);
     _r.dirty();
     _progressStream.listen((e) {
       _progress = e.progress;
@@ -233,6 +237,16 @@
                 ..children = [
                   new DivElement()
                     ..classes = ['memberName']
+                    ..text = 'Roots ',
+                  new DivElement()
+                    ..classes = ['memberName']
+                    ..children = _createRootsSelect()
+                ],
+              new DivElement()
+                ..classes = ['memberItem']
+                ..children = [
+                  new DivElement()
+                    ..classes = ['memberName']
                     ..text = 'Analysis ',
                   new DivElement()
                     ..classes = ['memberName']
@@ -266,6 +280,23 @@
           _tree
         ]);
         break;
+      case HeapSnapshotTreeMode.mergedDominatorTree:
+        _tree = new VirtualTreeElement(
+            _createMergedDominator, _updateMergedDominator,
+            _getChildrenMergedDominator,
+            items: _getChildrenMergedDominator(_snapshot.mergedDominatorTree),
+            queue: _r.queue);
+        _tree.expand(_snapshot.mergedDominatorTree);
+        final text = 'A heap dominator tree, where siblings with the same class'
+                     ' have been merged into a single node.';
+        report.addAll([
+          new DivElement()
+            ..classes = ['content-centered-big', 'explanation']
+            ..text = text
+            ..title = text,
+          _tree
+        ]);
+        break;
       case HeapSnapshotTreeMode.groupByClass:
         final items = _snapshot.classReferences.toList();
         items.sort((a, b) => b.shallowSize - a.shallowSize);
@@ -299,6 +330,24 @@
       ];
   }
 
+  static Element _createMergedDominator(toggle) {
+    return new DivElement()
+      ..classes = ['tree-item']
+      ..children = [
+        new SpanElement()
+          ..classes = ['size']
+          ..title = 'retained size',
+        new SpanElement()..classes = ['lines'],
+        new ButtonElement()
+          ..classes = ['expander']
+          ..onClick.listen((_) => toggle(autoToggleSingleChildNodes: true)),
+        new SpanElement()
+          ..classes = ['percentage']
+          ..title = 'percentage of heap being retained',
+        new SpanElement()..classes = ['name']
+      ];
+  }
+
   static Element _createGroup(toggle) {
     return new DivElement()
       ..classes = ['tree-item']
@@ -327,6 +376,13 @@
         .where((child) => child.retainedSize >= kMinRetainedSize)
         .take(kMaxChildren);
   }
+  static _getChildrenMergedDominator(M.HeapSnapshotMergedDominatorNode node) {
+    final list = node.children.toList();
+    list.sort((a, b) => b.retainedSize - a.retainedSize);
+    return list
+        .where((child) => child.retainedSize >= kMinRetainedSize)
+        .take(kMaxChildren);
+  }
 
   static _getChildrenGroup(item) {
     if (item is M.HeapSnapshotClassReferences) {
@@ -354,11 +410,54 @@
       ..classes = ['name']
       ..text = 'Loading...';
     element.children[4] = wrapper;
-    node.object.then((object) {
+    if (node.isStack) {
       wrapper
         ..text = ''
-        ..children = [anyRef(_isolate, object, _instances, queue: _r.queue)];
-    });
+        ..children = [
+          new AnchorElement(href: Uris.debugger(isolate))
+            ..text = 'stack frames'
+        ];
+    } else {
+      node.object.then((object) {
+        wrapper
+          ..text = ''
+          ..children = [anyRef(_isolate, object, _instances, queue: _r.queue)];
+      });
+    }
+  }
+
+  void _updateMergedDominator(
+      HtmlElement element, M.HeapSnapshotMergedDominatorNode node, int depth) {
+    element.children[0].text = Utils.formatSize(node.retainedSize);
+    _updateLines(element.children[1].children, depth);
+    if (_getChildrenMergedDominator(node).isNotEmpty) {
+      element.children[2].text = _tree.isExpanded(node) ? '▼' : '►';
+    } else {
+      element.children[2].text = '';
+    }
+    element.children[3].text =
+        Utils.formatPercentNormalized(node.retainedSize * 1.0 / _snapshot.size);
+    final wrapper = new SpanElement()
+      ..classes = ['name']
+      ..text = 'Loading...';
+    element.children[4] = wrapper;
+    if (node.isStack) {
+      wrapper
+        ..text = ''
+        ..children = [
+          new AnchorElement(href: Uris.debugger(isolate))
+            ..text = 'stack frames'
+        ];
+    } else {
+      node.klass.then((klass) {
+        wrapper
+          ..text = ''
+          ..children = [
+            new SpanElement()..text = '${node.instanceCount} instances of ',
+            anyRef(_isolate, klass, _instances, queue: _r.queue)
+          ];
+      });
+    }
   }
 
   void _updateGroup(HtmlElement element, item, int depth) {
@@ -420,14 +519,44 @@
     }
   }
 
+  static String rootsToString(M.HeapSnapshotRoots roots) {
+    switch (roots) {
+      case M.HeapSnapshotRoots.user:
+        return 'User';
+      case M.HeapSnapshotRoots.vm:
+        return 'VM';
+    }
+    throw new Exception('Unknown HeapSnapshotRoots');
+  }
+
+  List<Element> _createRootsSelect() {
+    var s;
+    return [
+      s = new SelectElement()
+        ..classes = ['roots-select']
+        ..value = rootsToString(_roots)
+        ..children = M.HeapSnapshotRoots.values.map((roots) {
+          return new OptionElement(
+              value: rootsToString(roots),
+              selected: _roots == roots)..text = rootsToString(roots);
+        }).toList(growable: false)
+        ..onChange.listen((_) {
+          _roots = M.HeapSnapshotRoots.values[s.selectedIndex];
+          _refresh();
+        })
+    ];
+  }
+
   static String modeToString(HeapSnapshotTreeMode mode) {
     switch (mode) {
       case HeapSnapshotTreeMode.dominatorTree:
         return 'Dominator tree';
+      case HeapSnapshotTreeMode.mergedDominatorTree:
+        return 'Dominator tree (merged siblings by class)';
       case HeapSnapshotTreeMode.groupByClass:
         return 'Group by class';
     }
-    throw new Exception('Unknown ProfileTreeMode');
+    throw new Exception('Unknown HeapSnapshotTreeMode');
   }
 
   List<Element> _createModeSelect() {
diff --git a/runtime/observatory/lib/src/elements/img/chromium_icon.png b/runtime/observatory/lib/src/elements/img/chromium_icon.png
index e6b0d45..a467bca 100644
--- a/runtime/observatory/lib/src/elements/img/chromium_icon.png
+++ b/runtime/observatory/lib/src/elements/img/chromium_icon.png
Binary files differ
diff --git a/runtime/observatory/lib/src/elements/img/dart_icon.png b/runtime/observatory/lib/src/elements/img/dart_icon.png
index 4772285..6341f65 100644
--- a/runtime/observatory/lib/src/elements/img/dart_icon.png
+++ b/runtime/observatory/lib/src/elements/img/dart_icon.png
Binary files differ
diff --git a/runtime/observatory/lib/src/elements/img/isolate_icon.png b/runtime/observatory/lib/src/elements/img/isolate_icon.png
index 57a5157..a739a54 100644
--- a/runtime/observatory/lib/src/elements/img/isolate_icon.png
+++ b/runtime/observatory/lib/src/elements/img/isolate_icon.png
Binary files differ
diff --git a/runtime/observatory/lib/src/elements/library_view.dart b/runtime/observatory/lib/src/elements/library_view.dart
index 2265d1b..165ffc8 100644
--- a/runtime/observatory/lib/src/elements/library_view.dart
+++ b/runtime/observatory/lib/src/elements/library_view.dart
@@ -156,7 +156,7 @@
       new DivElement()
         ..classes = ['content-centered-big']
         ..children = [
-          new HeadingElement.h2()..text = 'ICData',
+          new HeadingElement.h2()..text = 'Library',
           new HRElement(),
           new ObjectCommonElement(_isolate, _library, _retainedSizes,
               _reachableSizes, _references, _retainingPaths, _instances,
diff --git a/runtime/observatory/lib/src/elements/view_footer.dart b/runtime/observatory/lib/src/elements/view_footer.dart
index f85b1d9..cd8cd94 100644
--- a/runtime/observatory/lib/src/elements/view_footer.dart
+++ b/runtime/observatory/lib/src/elements/view_footer.dart
@@ -40,7 +40,7 @@
   void render() {
     children = [
       new AnchorElement()
-        ..href = 'https://www.dartlang.org/tools/observatory'
+        ..href = 'https://dart-lang.github.io/observatory/'
         ..text = 'View documentation',
       new AnchorElement()
         ..href =
diff --git a/runtime/observatory/lib/src/elements/vm_connect.dart b/runtime/observatory/lib/src/elements/vm_connect.dart
index 6c0b87f..e57463b 100644
--- a/runtime/observatory/lib/src/elements/vm_connect.dart
+++ b/runtime/observatory/lib/src/elements/vm_connect.dart
@@ -12,6 +12,7 @@
 import 'package:observatory/src/elements/helpers/tag.dart';
 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart';
 import 'package:observatory/src/elements/helpers/nav_bar.dart';
+import 'package:observatory/src/elements/helpers/uris.dart';
 import 'package:observatory/src/elements/nav/notify.dart';
 import 'package:observatory/src/elements/nav/top_menu.dart';
 import 'package:observatory/src/elements/view_footer.dart';
@@ -119,7 +120,7 @@
                         ..text = 'Connect'
                         ..onClick.listen((e) {
                           e.preventDefault();
-                          _create();
+                          _createAndConnect();
                         }),
                     ],
                   new BRElement(),
@@ -150,11 +151,11 @@
   TextInputElement _createAddressBox() {
     var textbox = new TextInputElement()
       ..classes = ['textbox']
-      ..placeholder = '127.0.0.1:8181'
+      ..placeholder = 'http://127.0.0.1:8181/...'
       ..value = _address
       ..onKeyUp.where((e) => e.key == '\n').listen((e) {
         e.preventDefault();
-        _create();
+        _createAndConnect();
       });
     textbox.onInput.listen((e) {
       _address = textbox.value;
@@ -176,9 +177,14 @@
     return e;
   }
 
-  void _create() {
+  void _createAndConnect() {
     if (_address == null || _address.isEmpty) return;
-    _targets.add(_normalizeStandaloneAddress(_address));
+    String normalizedNetworkAddress = _normalizeStandaloneAddress(_address);
+    _targets.add(normalizedNetworkAddress);
+    var target = _targets.find(normalizedNetworkAddress);
+    assert(target != null);
+    _targets.setCurrent(target);
+    ObservatoryApplication.app.locationManager.go(Uris.vm());
   }
 
   void _connect(TargetEvent e) {
@@ -194,8 +200,7 @@
     }
     try {
       Uri uri = Uri.parse(networkAddress);
-      print('returning ${uri.host} ${uri.port}');
-      return 'ws://${uri.host}:${uri.port}/ws';
+      return 'ws://${uri.authority}${uri.path}ws';
     } catch (e) {
       print('caught exception with: $networkAddress -- $e');
       return networkAddress;
diff --git a/runtime/observatory/lib/src/heap_snapshot/heap_snapshot.dart b/runtime/observatory/lib/src/heap_snapshot/heap_snapshot.dart
index 5345d8c..5f0bd3e 100644
--- a/runtime/observatory/lib/src/heap_snapshot/heap_snapshot.dart
+++ b/runtime/observatory/lib/src/heap_snapshot/heap_snapshot.dart
@@ -11,6 +11,7 @@
   int get references => graph.edgeCount;
   int get size => graph.size;
   HeapSnapshotDominatorNode dominatorTree;
+  HeapSnapshotMergedDominatorNode mergedDominatorTree;
   List<MergedVertex> classReferences;
 
   static Future sleep([Duration duration = const Duration(microseconds: 0)]) {
@@ -36,6 +37,8 @@
       });
       await stream.last;
       dominatorTree = new HeapSnapshotDominatorNode(isolate, graph.root);
+      mergedDominatorTree =
+          new HeapSnapshotMergedDominatorNode(isolate, graph.mergedRoot);
       classReferences = await buildMergedVertices(isolate, graph, signal);
       progress.close();
     }());
@@ -121,6 +124,8 @@
   final S.Isolate isolate;
   S.HeapObject _preloaded;
 
+  bool get isStack => v.isStack;
+
   Future<S.HeapObject> get object {
     if (_preloaded != null) {
       return new Future.value(_preloaded);
@@ -151,6 +156,38 @@
         v = vertex;
 }
 
+class HeapSnapshotMergedDominatorNode
+    implements M.HeapSnapshotMergedDominatorNode {
+  final MergedObjectVertex v;
+  final S.Isolate isolate;
+
+  bool get isStack => v.isStack;
+
+  Future<S.HeapObject> get klass {
+    return new Future.value(isolate.getClassByCid(v.vmCid));
+  }
+
+  Iterable<HeapSnapshotMergedDominatorNode> _children;
+  Iterable<HeapSnapshotMergedDominatorNode> get children {
+    if (_children != null) {
+      return _children;
+    } else {
+      return _children =
+          new List.unmodifiable(v.dominatorTreeChildren().map((v) {
+        return new HeapSnapshotMergedDominatorNode(isolate, v);
+      }));
+    }
+  }
+
+  int get instanceCount => v.instanceCount;
+  int get retainedSize => v.retainedSize;
+  int get shallowSize => v.shallowSize;
+
+  HeapSnapshotMergedDominatorNode(S.Isolate isolate, MergedObjectVertex vertex)
+      : isolate = isolate,
+        v = vertex;
+}
+
 class MergedEdge {
   final MergedVertex sourceVertex;
   final MergedVertex targetVertex;
diff --git a/runtime/observatory/lib/src/models/objects/event.dart b/runtime/observatory/lib/src/models/objects/event.dart
index 18f491e..9fd7359 100644
--- a/runtime/observatory/lib/src/models/objects/event.dart
+++ b/runtime/observatory/lib/src/models/objects/event.dart
@@ -16,6 +16,7 @@
         event is PauseBreakpointEvent ||
         event is PauseInterruptedEvent ||
         event is PauseExceptionEvent ||
+        event is PausePostRequestEvent ||
         event is NoneEvent;
   }
 }
@@ -88,6 +89,15 @@
   bool get atAsyncSuspension;
 }
 
+abstract class PausePostRequestEvent extends DebugEvent {
+  /// [optional] The top stack frame associated with this event. There will be
+  /// no top frame if the isolate is idle (waiting in the message loop).
+  Frame get topFrame;
+
+  /// Is the isolate paused at an await, yield, or yield* statement?
+  bool get atAsyncSuspension;
+}
+
 abstract class PauseExceptionEvent extends DebugEvent {
   /// The top stack frame associated with this event.
   Frame get topFrame;
diff --git a/runtime/observatory/lib/src/models/objects/heap_snapshot.dart b/runtime/observatory/lib/src/models/objects/heap_snapshot.dart
index 19392f9..aae5493 100644
--- a/runtime/observatory/lib/src/models/objects/heap_snapshot.dart
+++ b/runtime/observatory/lib/src/models/objects/heap_snapshot.dart
@@ -4,22 +4,35 @@
 
 part of models;
 
+enum HeapSnapshotRoots { user, vm }
+
 abstract class HeapSnapshot {
   DateTime get timestamp;
   int get objects;
   int get references;
   int get size;
   HeapSnapshotDominatorNode get dominatorTree;
+  HeapSnapshotMergedDominatorNode get mergedDominatorTree;
   Iterable<HeapSnapshotClassReferences> get classReferences;
 }
 
 abstract class HeapSnapshotDominatorNode {
   int get shallowSize;
   int get retainedSize;
+  bool get isStack;
   Future<ObjectRef> get object;
   Iterable<HeapSnapshotDominatorNode> get children;
 }
 
+abstract class HeapSnapshotMergedDominatorNode {
+  int get instanceCount;
+  int get shallowSize;
+  int get retainedSize;
+  bool get isStack;
+  Future<ObjectRef> get klass;
+  Iterable<HeapSnapshotMergedDominatorNode> get children;
+}
+
 abstract class HeapSnapshotClassReferences {
   ClassRef get clazz;
   int get instances;
diff --git a/runtime/observatory/lib/src/models/repositories/heap_snapshot.dart b/runtime/observatory/lib/src/models/repositories/heap_snapshot.dart
index da71fe9..9e87e64 100644
--- a/runtime/observatory/lib/src/models/repositories/heap_snapshot.dart
+++ b/runtime/observatory/lib/src/models/repositories/heap_snapshot.dart
@@ -30,6 +30,8 @@
 }
 
 abstract class HeapSnapshotRepository {
-  Stream<HeapSnapshotLoadingProgressEvent> get(IsolateRef isolate,
-      {bool gc: false});
+  Stream<HeapSnapshotLoadingProgressEvent> get(
+      IsolateRef isolate,
+      {HeapSnapshotRoots roots: HeapSnapshotRoots.vm,
+      bool gc: false});
 }
diff --git a/runtime/observatory/lib/src/repositories/heap_snapshot.dart b/runtime/observatory/lib/src/repositories/heap_snapshot.dart
index e56b352..a4f90b3 100644
--- a/runtime/observatory/lib/src/repositories/heap_snapshot.dart
+++ b/runtime/observatory/lib/src/repositories/heap_snapshot.dart
@@ -16,6 +16,7 @@
   Stream<HeapSnapshotLoadingProgressEvent> get onProgress => _onProgress.stream;
 
   final S.Isolate isolate;
+  final M.HeapSnapshotRoots roots;
   final bool gc;
 
   M.HeapSnapshotLoadingStatus _status = M.HeapSnapshotLoadingStatus.fetching;
@@ -32,7 +33,7 @@
   Duration get loadingTime => _loadingTime.elapsed;
   HeapSnapshot get snapshot => _snapshot;
 
-  HeapSnapshotLoadingProgress(this.isolate, this.gc) {
+  HeapSnapshotLoadingProgress(this.isolate, this.roots, this.gc) {
     _run();
   }
 
@@ -44,7 +45,7 @@
 
       await isolate.getClassRefs();
 
-      final stream = isolate.fetchHeapSnapshot(gc);
+      final stream = isolate.fetchHeapSnapshot(roots, gc);
 
       stream.listen((status) {
         if (status is List) {
@@ -99,11 +100,13 @@
 }
 
 class HeapSnapshotRepository implements M.HeapSnapshotRepository {
-  Stream<HeapSnapshotLoadingProgressEvent> get(M.IsolateRef i,
-      {bool gc: false}) {
+  Stream<HeapSnapshotLoadingProgressEvent> get(
+      M.IsolateRef i,
+      {M.HeapSnapshotRoots roots: M.HeapSnapshotRoots.vm,
+      bool gc: false}) {
     S.Isolate isolate = i as S.Isolate;
     assert(isolate != null);
     assert(gc != null);
-    return new HeapSnapshotLoadingProgress(isolate, gc).onProgress;
+    return new HeapSnapshotLoadingProgress(isolate, roots, gc).onProgress;
   }
 }
diff --git a/runtime/observatory/lib/src/repositories/target.dart b/runtime/observatory/lib/src/repositories/target.dart
index cad6dc5..69290fc 100644
--- a/runtime/observatory/lib/src/repositories/target.dart
+++ b/runtime/observatory/lib/src/repositories/target.dart
@@ -29,15 +29,15 @@
   TargetRepository._(this._onChange, this.onChange) {
     _restore();
     // Add the default address if it doesn't already exist.
-    if (_find(_networkAddressOfDefaultTarget()) == null) {
+    if (find(_networkAddressOfDefaultTarget()) == null) {
       add(_networkAddressOfDefaultTarget());
     }
     // Set the current target to the default target.
-    current = _find(_networkAddressOfDefaultTarget());
+    current = find(_networkAddressOfDefaultTarget());
   }
 
   void add(String address) {
-    if (_find(address) != null) {
+    if (find(address) != null) {
       return;
     }
     _list.insert(0, new SC.WebSocketVMTarget(address));
@@ -91,7 +91,7 @@
   }
 
   /// Find by networkAddress.
-  SC.WebSocketVMTarget _find(String networkAddress) {
+  SC.WebSocketVMTarget find(String networkAddress) {
     for (SC.WebSocketVMTarget item in _list) {
       if (item.networkAddress == networkAddress) {
         return item;
@@ -101,14 +101,7 @@
   }
 
   static String _networkAddressOfDefaultTarget() {
-    if (Utils.runningInJavaScript()) {
-      // We are running as JavaScript, use the same host that Observatory has
-      // been loaded from.
-      return 'ws://${window.location.host}/ws';
-    } else {
-      // Otherwise, assume we are running from Dart Editor and want to connect
-      // to the default host.
-      return 'ws://localhost:8181/ws';
-    }
+    Uri serverAddress = Uri.parse(window.location.toString());
+    return 'ws://${serverAddress.authority}${serverAddress.path}ws';
   }
 }
diff --git a/runtime/observatory/lib/src/repositories/top_retaining_instances.dart b/runtime/observatory/lib/src/repositories/top_retaining_instances.dart
index 0094762..400ac14 100644
--- a/runtime/observatory/lib/src/repositories/top_retaining_instances.dart
+++ b/runtime/observatory/lib/src/repositories/top_retaining_instances.dart
@@ -11,7 +11,8 @@
     S.Class cls = c as S.Class;
     assert(isolate != null);
     assert(cls != null);
-    final raw = await isolate.fetchHeapSnapshot(true).last;
+    final raw =
+        await isolate.fetchHeapSnapshot(M.HeapSnapshotRoots.vm, true).last;
     final snapshot = new HeapSnapshot();
     await snapshot.loadProgress(isolate, raw).last;
     return (await Future.wait(
diff --git a/runtime/observatory/lib/src/service/object.dart b/runtime/observatory/lib/src/service/object.dart
index 85d9385..c3ea07da 100644
--- a/runtime/observatory/lib/src/service/object.dart
+++ b/runtime/observatory/lib/src/service/object.dart
@@ -1333,9 +1333,19 @@
     return invokeRpc('getSourceReport', params);
   }
 
-  Future<ServiceMap> reloadSources() {
-    return invokeRpc('_reloadSources', {}).then((_) {
+  Future<ServiceMap> reloadSources(
+      {String rootLibUri,
+       bool pause}) {
+    Map<String, dynamic> params = <String, dynamic>{};
+    if (rootLibUri != null) {
+      params['rootLibUri'] = rootLibUri;
+    }
+    if (pause != null) {
+      params['pause'] = pause;
+    }
+    return invokeRpc('reloadSources', params).then((result) {
       reloading = true;
+      return result;
     });
   }
 
@@ -1521,12 +1531,21 @@
     }
   }
 
-  Stream fetchHeapSnapshot(collectGarbage) {
+  static String _rootsToString(M.HeapSnapshotRoots roots) {
+    switch (roots) {
+      case M.HeapSnapshotRoots.user: return "User";
+      case M.HeapSnapshotRoots.vm: return "VM";
+    }
+    return null;
+  }
+
+  Stream fetchHeapSnapshot(M.HeapSnapshotRoots roots, bool collectGarbage) {
     if (_snapshotFetch == null || _snapshotFetch.isClosed) {
       _snapshotFetch = new StreamController.broadcast();
       // isolate.vm.streamListen('_Graph');
-      isolate.invokeRpcNoUpgrade(
-          '_requestHeapSnapshot', {'collectGarbage': collectGarbage});
+      isolate.invokeRpcNoUpgrade('_requestHeapSnapshot',
+                                 {'roots': _rootsToString(roots),
+                                  'collectGarbage': collectGarbage});
     }
     return _snapshotFetch.stream;
   }
@@ -1675,6 +1694,7 @@
       case ServiceEvent.kPauseBreakpoint:
       case ServiceEvent.kPauseInterrupted:
       case ServiceEvent.kPauseException:
+      case ServiceEvent.kPausePostRequest:
       case ServiceEvent.kNone:
       case ServiceEvent.kResume:
         assert((pauseEvent == null) ||
@@ -2017,6 +2037,7 @@
   static const kPauseBreakpoint = 'PauseBreakpoint';
   static const kPauseInterrupted = 'PauseInterrupted';
   static const kPauseException = 'PauseException';
+  static const kPausePostRequest = 'PausePostRequest';
   static const kNone = 'None';
   static const kResume = 'Resume';
   static const kBreakpointAdded = 'BreakpointAdded';
@@ -2067,6 +2088,7 @@
         kind == kPauseBreakpoint ||
         kind == kPauseInterrupted ||
         kind == kPauseException ||
+        kind == kPausePostRequest ||
         kind == kNone);
   }
 
@@ -3251,6 +3273,7 @@
 
   Script._empty(ServiceObjectOwner owner) : super._empty(owner);
 
+  /// Retrieves line number [line] if it exists.
   ScriptLine getLine(int line) {
     assert(_loaded);
     assert(line >= 1);
@@ -3258,10 +3281,12 @@
   }
 
   /// This function maps a token position to a line number.
+  /// The VM considers the first line to be line 1.
   int tokenToLine(int tokenPos) => _tokenToLine[tokenPos];
   Map _tokenToLine = {};
 
   /// This function maps a token position to a column number.
+  /// The VM considers the first column to be column 1.
   int tokenToCol(int tokenPos) => _tokenToCol[tokenPos];
   Map _tokenToCol = {};
 
@@ -3324,7 +3349,7 @@
 
   static bool _isIdentifierChar(int c) {
     if (_isInitialIdentifierChar(c)) return true;
-    return c >= 48 && c <= 75; // Digit
+    return c >= 48 && c <= 57; // Digit
   }
 
   void _update(Map map, bool mapIsRef) {
@@ -3405,6 +3430,28 @@
     }
   }
 
+  // Note, this may return source beyond the token length if [guessTokenLength]
+  // fails.
+  String getToken(int tokenPos) {
+    final int line = tokenToLine(tokenPos);
+    int column = tokenToCol(tokenPos);
+    if ((line == null) || (column == null)) {
+      return null;
+    }
+    // Line and column numbers start at 1 in the VM.
+    column -= 1;
+    String sourceLine = getLine(line).text;
+    if (sourceLine == null) {
+      return null;
+    }
+    final int length = guessTokenLength(line, column);
+    if (length == null) {
+      return sourceLine.substring(column);
+    } else {
+      return sourceLine.substring(column, column + length);
+    }
+  }
+
   void _addBreakpoint(Breakpoint bpt) {
     var line;
     if (bpt.location.tokenPos != null) {
@@ -3607,13 +3654,20 @@
   final String id;
   final String name;
   final int index;
+  final int declarationPos;
   final int beginPos;
   final int endPos;
   final int scopeId;
   final String kind;
 
-  LocalVarDescriptor(this.id, this.name, this.index, this.beginPos, this.endPos,
-      this.scopeId, this.kind);
+  LocalVarDescriptor(this.id,
+                     this.name,
+                     this.index,
+                     this.declarationPos,
+                     this.beginPos,
+                     this.endPos,
+                     this.scopeId,
+                     this.kind);
 }
 
 class LocalVarDescriptors extends ServiceObject {
@@ -3635,12 +3689,13 @@
       var id = descriptor['name'];
       var name = descriptor['name'];
       var index = descriptor['index'];
-      var beginPos = descriptor['beginPos'];
-      var endPos = descriptor['endPos'];
+      var declarationPos = descriptor['declarationTokenPos'];
+      var beginPos = descriptor['scopeStartTokenPos'];
+      var endPos = descriptor['scopeEndTokenPos'];
       var scopeId = descriptor['scopeId'];
       var kind = descriptor['kind'].trim();
       descriptors.add(new LocalVarDescriptor(
-          id, name, index, beginPos, endPos, scopeId, kind));
+          id, name, index, declarationPos, beginPos, endPos, scopeId, kind));
     }
   }
 }
diff --git a/runtime/observatory/tests/observatory_ui/observatory_ui.status b/runtime/observatory/tests/observatory_ui/observatory_ui.status
index f683fd8..0aa7e3f 100644
--- a/runtime/observatory/tests/observatory_ui/observatory_ui.status
+++ b/runtime/observatory/tests/observatory_ui/observatory_ui.status
@@ -8,8 +8,16 @@
 [ $runtime == dartium ]
 isolate/*: Skip
 allocation_profile: Skip
+vm_connect/element_test: Skip # See issue 27714
+heap_snapshot/element_test: RuntimeError # Issue 27925
 
 [ $runtime == ff || $runtime == safari ]
 allocation_profile: Skip
 cpu_profile_table: Skip
 persistent_handles_page: Skip
+vm_connect/element_test: Skip # See issue 27714
+heap_snapshot/element_test: RuntimeError # Issue 27925
+
+[ $runtime == ff || $runtime == chrome ]
+vm_connect/element_test: Skip # Times out
+heap_snapshot/element_test: RuntimeError # Issue 27925
diff --git a/runtime/observatory/tests/service/auth_token1_test.dart b/runtime/observatory/tests/service/auth_token1_test.dart
new file mode 100644
index 0000000..134047a
--- /dev/null
+++ b/runtime/observatory/tests/service/auth_token1_test.dart
@@ -0,0 +1,49 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--error_on_bad_type --error_on_bad_override
+
+import 'dart:async';
+import 'dart:developer';
+import 'dart:io' as io;
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'test_helper.dart';
+
+Future<Null> testeeBefore() async {
+  print('testee before');
+  print(await Service.getInfo());
+  // Start the web server.
+  ServiceProtocolInfo info = await Service.controlWebServer(enable: true);
+  expect(info.serverUri, isNotNull);
+  // Ensure that we have no auth token in the path segments.
+  expect(info.serverUri.pathSegments.length, equals(0));
+
+  // Try connecting to the server without the auth token, it should succeed.
+  var port = info.serverUri.port;
+  var url = Uri.parse('http://localhost:$port');
+  var httpClient = new io.HttpClient();
+  try {
+    var request = await httpClient.getUrl(url);
+    expect(true, true);
+  } catch (e) {
+    expect(true, false);
+  }
+}
+
+var tests = [
+(Isolate isolate) async {
+  await isolate.reload();
+  // Just getting here means that the testee enabled the service protocol
+  // web server.
+  expect(true, true);
+}
+];
+
+main(args) => runIsolateTests(args,
+                              tests,
+                              testeeBefore: testeeBefore,
+                              // the testee is responsible for starting the
+                              // web server.
+                              testeeControlsServer: true,
+                              useAuthToken: false);
diff --git a/runtime/observatory/tests/service/auth_token_test.dart b/runtime/observatory/tests/service/auth_token_test.dart
new file mode 100644
index 0000000..69c162b
--- /dev/null
+++ b/runtime/observatory/tests/service/auth_token_test.dart
@@ -0,0 +1,60 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--error_on_bad_type --error_on_bad_override
+
+import 'dart:async';
+import 'dart:developer';
+import 'dart:io' as io;
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'test_helper.dart';
+
+Future<Null> testeeBefore() async {
+  print('testee before');
+  print(await Service.getInfo());
+  // Start the web server.
+  ServiceProtocolInfo info = await Service.controlWebServer(enable: true);
+  expect(info.serverUri, isNotNull);
+  // Ensure that we have the auth token in the path segments.
+  expect(info.serverUri.pathSegments.length, greaterThan(1));
+  // Sanity check the length of the auth token.
+  expect(info.serverUri.pathSegments[0].length, greaterThan(8));
+
+  // Try connecting to the server without the auth token, it should throw
+  // an exception.
+  var port = info.serverUri.port;
+  var url = Uri.parse('http://localhost:$port');
+  var httpClient = new io.HttpClient();
+  try {
+    var request = await httpClient.getUrl(url);
+    expect(true, false);
+  } catch (e) {
+    expect(true, true);
+  }
+
+  // Try connecting to the server with the auth token, it should succeed.
+  try {
+    var request = await httpClient.getUrl(info.serverUri);
+    expect(true, true);
+  } catch (e) {
+    expect(true, false);
+  }
+}
+
+var tests = [
+(Isolate isolate) async {
+  await isolate.reload();
+  // Just getting here means that the testee enabled the service protocol
+  // web server.
+  expect(true, true);
+}
+];
+
+main(args) => runIsolateTests(args,
+                              tests,
+                              testeeBefore: testeeBefore,
+                              // the testee is responsible for starting the
+                              // web server.
+                              testeeControlsServer: true,
+                              useAuthToken: true);
diff --git a/runtime/observatory/tests/service/complex_reload/v1/main.dart b/runtime/observatory/tests/service/complex_reload/v1/main.dart
new file mode 100644
index 0000000..055565f
--- /dev/null
+++ b/runtime/observatory/tests/service/complex_reload/v1/main.dart
@@ -0,0 +1,14 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--error_on_bad_type --error_on_bad_override
+
+import 'dart:isolate';
+
+test() => 'apple';
+
+main() {
+  RawReceivePort keepAlive = new RawReceivePort();
+  print('slave isolate running');
+}
+
diff --git a/runtime/observatory/tests/service/complex_reload/v2/main.dart b/runtime/observatory/tests/service/complex_reload/v2/main.dart
new file mode 100644
index 0000000..b0cc841
--- /dev/null
+++ b/runtime/observatory/tests/service/complex_reload/v2/main.dart
@@ -0,0 +1,6 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--error_on_bad_type --error_on_bad_override
+
+test() => 'banana';
diff --git a/runtime/observatory/tests/service/complex_reload/v3/main.dart b/runtime/observatory/tests/service/complex_reload/v3/main.dart
new file mode 100644
index 0000000..751ca96
--- /dev/null
+++ b/runtime/observatory/tests/service/complex_reload/v3/main.dart
@@ -0,0 +1,6 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--error_on_bad_type --error_on_bad_override
+
+test() => 'cabbage';
diff --git a/runtime/observatory/tests/service/complex_reload_test.dart b/runtime/observatory/tests/service/complex_reload_test.dart
new file mode 100644
index 0000000..f3fd806
--- /dev/null
+++ b/runtime/observatory/tests/service/complex_reload_test.dart
@@ -0,0 +1,95 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--error_on_bad_type --error_on_bad_override
+
+import 'test_helper.dart';
+import 'dart:async';
+import 'dart:developer';
+import 'dart:isolate' as I;
+import 'dart:io';
+import 'service_test_common.dart';
+import 'package:observatory/service.dart';
+import 'package:unittest/unittest.dart';
+
+testMain() async {
+  debugger();  // Stop here.
+  // Spawn the child isolate.
+  I.Isolate isolate =
+      await I.Isolate.spawnUri(Uri.parse('complex_reload/v1/main.dart'),
+                               [],
+                               null);
+  print(isolate);
+  debugger();
+}
+
+// Directory that we are running in.
+String directory = (Platform.isWindows ? '' : Platform.pathSeparator) +
+    Platform.script.pathSegments.sublist(
+        0,
+        Platform.script.pathSegments.length - 1).join(Platform.pathSeparator);
+
+Future<String> invokeTest(Isolate isolate) async {
+  await isolate.reload();
+  Library lib = isolate.rootLibrary;
+  await lib.load();
+  Instance result = await lib.evaluate('test()');
+  expect(result.isString, isTrue);
+  return result.valueAsString;
+}
+
+var tests = [
+  // Stopped at 'debugger' statement.
+  hasStoppedAtBreakpoint,
+  // Resume the isolate into the while loop.
+  resumeIsolate,
+  // Stop at 'debugger' statement.
+  hasStoppedAtBreakpoint,
+  (Isolate mainIsolate) async {
+    for (var i = 0; i < Platform.script.pathSegments.length; i++) {
+      print('segment $i: "${Platform.script.pathSegments[i]}"');
+    }
+    print('Directory: $directory');
+    // Grab the VM.
+    VM vm = mainIsolate.vm;
+    await vm.reloadIsolates();
+    expect(vm.isolates.length, 2);
+
+    // Find the slave isolate.
+    Isolate slaveIsolate =
+        vm.isolates.firstWhere((Isolate i) => i != mainIsolate);
+    expect(slaveIsolate, isNotNull);
+
+    // Invoke test in v1.
+    String v1 = await invokeTest(slaveIsolate);
+    expect(v1, 'apple');
+
+    // Reload to v2.
+    var response = await slaveIsolate.reloadSources(
+       rootLibUri: '$directory${Platform.pathSeparator}'
+                  'complex_reload${Platform.pathSeparator}'
+                  'v2${Platform.pathSeparator}'
+                  'main.dart',
+    );
+    expect(response['success'], isTrue);
+
+    // Invoke test in v2.
+    String v2 = await invokeTest(slaveIsolate);
+    expect(v2, 'banana');
+
+    // Reload to v3.
+    response = await slaveIsolate.reloadSources(
+      rootLibUri: '$directory${Platform.pathSeparator}'
+                  'complex_reload${Platform.pathSeparator}'
+                  'v3${Platform.pathSeparator}'
+                  'main.dart',
+    );
+    expect(response['success'], isTrue);
+
+    // Invoke test in v3.
+    String v3 = await invokeTest(slaveIsolate);
+    expect(v3, 'cabbage');
+  }
+];
+
+main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain);
diff --git a/runtime/observatory/tests/service/dev_fs_http_put_weird_char_test.dart b/runtime/observatory/tests/service/dev_fs_http_put_weird_char_test.dart
new file mode 100644
index 0000000..517a832
--- /dev/null
+++ b/runtime/observatory/tests/service/dev_fs_http_put_weird_char_test.dart
@@ -0,0 +1,102 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--error_on_bad_type --error_on_bad_override
+
+import 'dart:async';
+import 'dart:convert';
+import 'dart:io';
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'test_helper.dart';
+
+Future<String> readResponse(HttpClientResponse response) {
+  var completer = new Completer();
+  var contents = new StringBuffer();
+  response.transform(UTF8.decoder).listen((String data) {
+    contents.write(data);
+  }, onDone: () => completer.complete(contents.toString()));
+  return completer.future;
+}
+
+
+var tests = [
+  // Write a file with the \r character in the filename.
+  (VM vm) async {
+    var fsId = 'test';
+    var filePath = '/foo/b\rar.dart';
+    var filePathBase64 = BASE64.encode(UTF8.encode(filePath));
+    var fileContents = [0, 1, 2, 3, 4, 5, 6, 255];
+    var fileContentsBase64 = BASE64.encode(fileContents);
+
+    var result;
+    // Create DevFS.
+    result = await vm.invokeRpcNoUpgrade('_createDevFS', { 'fsName': fsId });
+    expect(result['type'], equals('FileSystem'));
+    expect(result['name'], equals(fsId));
+    expect(result['uri'], new isInstanceOf<String>());
+
+    // Write the file by issuing an HTTP PUT.
+    HttpClient client = new HttpClient();
+    HttpClientRequest request =
+        await client.putUrl(Uri.parse(serviceHttpAddress));
+    request.headers.add('dev_fs_name', fsId);
+    request.headers.add('dev_fs_path_b64', filePathBase64);
+    request.add(GZIP.encode([9]));
+    HttpClientResponse response = await request.close();
+    String responseBody = await readResponse(response);
+    result = JSON.decode(responseBody);
+    expect(result['result']['type'], equals('Success'));
+
+    // Trigger an error by issuing an HTTP PUT.
+    request = await client.putUrl(Uri.parse(serviceHttpAddress));
+    request.headers.add('dev_fs_name', fsId);
+    // omit the 'dev_fs_path' parameter.
+    request.write(GZIP.encode(fileContents));
+    response = await request.close();
+    responseBody = await readResponse(response);
+    result = JSON.decode(responseBody);
+    Map error = result['error']['data'];
+    expect(error, isNotNull);
+    expect(error['details'].contains("expects the 'path' parameter"), isTrue);
+
+    // Write the file again but this time with the true file contents.
+    client = new HttpClient();
+    request =
+        await client.putUrl(Uri.parse(serviceHttpAddress));
+    request.headers.add('dev_fs_name', fsId);
+    request.headers.add('dev_fs_path_b64', filePathBase64);
+    request.add(GZIP.encode(fileContents));
+    response = await request.close();
+    responseBody = await readResponse(response);
+    result = JSON.decode(responseBody);
+    expect(result['result']['type'], equals('Success'));
+
+    // Close the HTTP client.
+    client.close();
+
+    // Read the file back.
+    result = await vm.invokeRpcNoUpgrade('_readDevFSFile', {
+        'fsName': fsId,
+        'path': filePath,
+    });
+    expect(result['type'], equals('FSFile'));
+    expect(result['fileContents'], equals(fileContentsBase64));
+
+    // List all the files in the file system.
+    result = await vm.invokeRpcNoUpgrade('_listDevFSFiles', {
+        'fsName': fsId,
+    });
+    expect(result['type'], equals('FSFileList'));
+    expect(result['files'].length, equals(1));
+    expect(result['files'][0]['name'], equals(filePath));
+
+    // Delete DevFS.
+    result = await vm.invokeRpcNoUpgrade('_deleteDevFS', {
+        'fsName': fsId,
+    });
+    expect(result['type'], equals('Success'));
+  },
+];
+
+main(args) async => runVMTests(args, tests);
diff --git a/runtime/observatory/tests/service/developer_server_control_test.dart b/runtime/observatory/tests/service/developer_server_control_test.dart
new file mode 100644
index 0000000..400796b
--- /dev/null
+++ b/runtime/observatory/tests/service/developer_server_control_test.dart
@@ -0,0 +1,85 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--error_on_bad_type --error_on_bad_override
+
+import 'dart:async';
+import 'dart:developer';
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'test_helper.dart';
+
+int majorVersion;
+int minorVersion;
+Uri serverUri;
+
+Future<Null> testeeBefore() async {
+  print('testee before');
+  // First grab the URL where the observatory is listening on and the
+  // service protocol version numbers. We expect the URL to be null as
+  // the server has not been started yet.
+  ServiceProtocolInfo info = await Service.getInfo();
+  majorVersion = info.majorVersion;
+  minorVersion = info.minorVersion;
+  serverUri = info.serverUri;
+  expect(info.serverUri, isNull);
+  {
+    // Now, start the web server and store the URI which is expected to be
+    // non NULL in the top level variable.
+    ServiceProtocolInfo info = await Service.controlWebServer(enable: true);
+    expect(info.majorVersion, equals(majorVersion));
+    expect(info.minorVersion, equals(minorVersion));
+    expect(info.serverUri, isNotNull);
+    serverUri = info.serverUri;
+  }
+  {
+    // Now try starting the web server again, this should just return the
+    // existing state without any change (port number does not change).
+    ServiceProtocolInfo info = await Service.controlWebServer(enable: true);
+    expect(info.majorVersion, equals(majorVersion));
+    expect(info.minorVersion, equals(minorVersion));
+    expect(info.serverUri, equals(serverUri));
+  }
+  {
+    // Try turning off the web server, this should turn off the server and
+    // the Uri returned should be null.
+    ServiceProtocolInfo info = await Service.controlWebServer(enable: false);
+    expect(info.majorVersion, equals(majorVersion));
+    expect(info.minorVersion, equals(minorVersion));
+    expect(info.serverUri, isNull);
+  }
+  {
+    // Try turning off the web server again, this should be a nop
+    // and the Uri returned should be null.
+    ServiceProtocolInfo info = await Service.controlWebServer(enable: false);
+    expect(info.majorVersion, equals(majorVersion));
+    expect(info.minorVersion, equals(minorVersion));
+    expect(info.serverUri, isNull);
+  }
+  {
+    // Start the web server again for the test below.
+    ServiceProtocolInfo info = await Service.controlWebServer(enable: true);
+    majorVersion = info.majorVersion;
+    minorVersion = info.minorVersion;
+    serverUri = info.serverUri;
+    expect(info.majorVersion, equals(majorVersion));
+    expect(info.minorVersion, equals(minorVersion));
+    expect(info.serverUri, equals(serverUri));
+  }
+}
+
+var tests = [
+(Isolate isolate) async {
+  await isolate.reload();
+  // Just getting here means that the testee enabled the service protocol
+  // web server.
+  expect(true, true);
+}
+];
+
+main(args) => runIsolateTests(args,
+                              tests,
+                              testeeBefore: testeeBefore,
+                              // the testee is responsible for starting the
+                              // web server.
+                              testeeControlsServer: true);
diff --git a/runtime/observatory/tests/service/developer_service_get_isolate_id_test.dart b/runtime/observatory/tests/service/developer_service_get_isolate_id_test.dart
new file mode 100644
index 0000000..f3a24b0
--- /dev/null
+++ b/runtime/observatory/tests/service/developer_service_get_isolate_id_test.dart
@@ -0,0 +1,90 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--error_on_bad_type --error_on_bad_override
+
+import 'dart:async';
+import 'dart:developer' as dev;
+import 'dart:isolate' as Core;
+
+import 'package:observatory/service_io.dart' as Service;
+import 'package:unittest/unittest.dart';
+import 'service_test_common.dart';
+import 'test_helper.dart';
+
+
+// testee state.
+String selfId;
+Core.Isolate childIsolate;
+String childId;
+
+void spawnEntry(int i) {
+  dev.debugger();
+}
+
+Future testeeMain() async {
+  dev.debugger();
+  // Spawn an isolate.
+  childIsolate = await Core.Isolate.spawn(spawnEntry, 0);
+  // Assign the id for this isolate and it's child to strings so they can
+  // be read by the tester.
+  selfId = dev.Service.getIsolateID(Core.Isolate.current);
+  childId = dev.Service.getIsolateID(childIsolate);
+  dev.debugger();
+}
+
+// tester state:
+Service.Isolate initialIsolate;
+Service.Isolate localChildIsolate;
+
+var tests = [
+  (Service.VM vm) async {
+    // Sanity check.
+    expect(vm.isolates.length, 1);
+    initialIsolate = vm.isolates[0];
+    await hasStoppedAtBreakpoint(initialIsolate);
+    // Resume.
+    await initialIsolate.resume();
+  },
+  (Service.VM vm) async {
+    // Initial isolate has paused at second debugger call.
+    await hasStoppedAtBreakpoint(initialIsolate);
+  },
+  (Service.VM vm) async {
+    // Reload the VM.
+    await vm.reload();
+
+    // Grab the child isolate.
+    localChildIsolate =
+        vm.isolates.firstWhere(
+            (Service.Isolate i) => i != initialIsolate);
+    expect(localChildIsolate, isNotNull);
+
+    // Reload the initial isolate.
+    await initialIsolate.reload();
+
+    // Grab the root library.
+    Service.Library rootLbirary = await initialIsolate.rootLibrary.load();
+
+    // Grab self id.
+    Service.Instance localSelfId =
+        await initialIsolate.eval(rootLbirary, 'selfId');
+
+    // Check that the id reported from dart:developer matches the id reported
+    // from the service protocol.
+    expect(localSelfId.isString, true);
+    expect(initialIsolate.id, equals(localSelfId.valueAsString));
+
+    // Grab the child isolate's id.
+    Service.Instance localChildId =
+        await initialIsolate.eval(rootLbirary, 'childId');
+
+    // Check that the id reported from dart:developer matches the id reported
+    // from the service protocol.
+    expect(localChildId.isString, true);
+    expect(localChildIsolate.id, equals(localChildId.valueAsString));
+  }
+];
+
+main(args) async => runVMTests(args, tests,
+    testeeConcurrent: testeeMain);
diff --git a/runtime/observatory/tests/service/dominator_tree_test.dart b/runtime/observatory/tests/service/dominator_tree_test.dart
deleted file mode 100644
index 037fbeb..0000000
--- a/runtime/observatory/tests/service/dominator_tree_test.dart
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--error_on_bad_type --error_on_bad_override
-
-import 'package:observatory/heap_snapshot.dart';
-import 'package:observatory/service_io.dart';
-import 'package:unittest/unittest.dart';
-import 'test_helper.dart';
-
-// small example from [Lenguaer & Tarjan 1979]
-class R { var x; var y; var z; }
-class A { var x; }
-class B { var x; var y; var z; }
-class C { var x; var y; }
-class D { var x; }
-class E { var x; }
-class F { var x; }
-class G { var x; var y; }
-class H { var x; var y; }
-class I { var x; }
-class J { var x; }
-class K { var x; var y; }
-class L { var x; }
-
-var r;
-
-buildGraph() {
-  r = new R();
-  var a = new A();
-  var b = new B();
-  var c = new C();
-  var d = new D();
-  var e = new E();
-  var f = new F();
-  var g = new G();
-  var h = new H();
-  var i = new I();
-  var j = new J();
-  var k = new K();
-  var l = new L();
-
-  r.x = a; r.y = b; r.z = c;
-  a.x = d;
-  b.x = a; b.y = d; b.z = e;
-  c.x = f; c.y = g;
-  d.x = l;
-  e.x = h;
-  f.x = i;
-  g.x = i; g.y = j;
-  h.x = e; h.y = k;
-  i.x = k;
-  j.x = i;
-  k.x = i; k.y = r;
-  l.x = h;
-}
-
-var tests = [
-(Isolate isolate) async {
-  final rootLib = await isolate.rootLibrary.load();
-  final raw = await isolate.fetchHeapSnapshot(false).last;
-  final snapshot = new HeapSnapshot();
-  await snapshot.loadProgress(isolate, raw).last;
-
-  node(String className) {
-    var cls = rootLib.classes.singleWhere((cls) => cls.name == className);
-    return snapshot.graph.vertices.singleWhere((v) => v.vmCid == cls.vmCid);
-  }
-
-  expect(node('I').dominator, equals(node('R')));
-  expect(node('K').dominator, equals(node('R')));
-  expect(node('C').dominator, equals(node('R')));
-  expect(node('H').dominator, equals(node('R')));
-  expect(node('E').dominator, equals(node('R')));
-  expect(node('A').dominator, equals(node('R')));
-  expect(node('D').dominator, equals(node('R')));
-  expect(node('B').dominator, equals(node('R')));
-
-  expect(node('F').dominator, equals(node('C')));
-  expect(node('G').dominator, equals(node('C')));
-  expect(node('J').dominator, equals(node('G')));
-  expect(node('L').dominator, equals(node('D')));
-
-  expect(node('R'), isNotNull);  // The field.
-},
-];
-
-main(args) => runIsolateTests(args, tests, testeeBefore: buildGraph);
diff --git a/runtime/observatory/tests/service/dominator_tree_user_test.dart b/runtime/observatory/tests/service/dominator_tree_user_test.dart
new file mode 100644
index 0000000..c312dd0
--- /dev/null
+++ b/runtime/observatory/tests/service/dominator_tree_user_test.dart
@@ -0,0 +1,90 @@
+// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--error_on_bad_type --error_on_bad_override
+
+import 'package:observatory/heap_snapshot.dart';
+import 'package:observatory/models.dart' as M;
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'test_helper.dart';
+
+// small example from [Lenguaer & Tarjan 1979]
+class R { var x; var y; var z; }
+class A { var x; }
+class B { var x; var y; var z; }
+class C { var x; var y; }
+class D { var x; }
+class E { var x; }
+class F { var x; }
+class G { var x; var y; }
+class H { var x; var y; }
+class I { var x; }
+class J { var x; }
+class K { var x; var y; }
+class L { var x; }
+
+var r;
+
+buildGraph() {
+  r = new R();
+  var a = new A();
+  var b = new B();
+  var c = new C();
+  var d = new D();
+  var e = new E();
+  var f = new F();
+  var g = new G();
+  var h = new H();
+  var i = new I();
+  var j = new J();
+  var k = new K();
+  var l = new L();
+
+  r.x = a; r.y = b; r.z = c;
+  a.x = d;
+  b.x = a; b.y = d; b.z = e;
+  c.x = f; c.y = g;
+  d.x = l;
+  e.x = h;
+  f.x = i;
+  g.x = i; g.y = j;
+  h.x = e; h.y = k;
+  i.x = k;
+  j.x = i;
+  k.x = i; k.y = r;
+  l.x = h;
+}
+
+var tests = [
+(Isolate isolate) async {
+  final rootLib = await isolate.rootLibrary.load();
+  final raw =
+      await isolate.fetchHeapSnapshot(M.HeapSnapshotRoots.user, false).last;
+  final snapshot = new HeapSnapshot();
+  await snapshot.loadProgress(isolate, raw).last;
+
+  node(String className) {
+    var cls = rootLib.classes.singleWhere((cls) => cls.name == className);
+    return snapshot.graph.vertices.singleWhere((v) => v.vmCid == cls.vmCid);
+  }
+
+  expect(node('I').dominator, equals(node('R')));
+  expect(node('K').dominator, equals(node('R')));
+  expect(node('C').dominator, equals(node('R')));
+  expect(node('H').dominator, equals(node('R')));
+  expect(node('E').dominator, equals(node('R')));
+  expect(node('A').dominator, equals(node('R')));
+  expect(node('D').dominator, equals(node('R')));
+  expect(node('B').dominator, equals(node('R')));
+
+  expect(node('F').dominator, equals(node('C')));
+  expect(node('G').dominator, equals(node('C')));
+  expect(node('J').dominator, equals(node('G')));
+  expect(node('L').dominator, equals(node('D')));
+
+  expect(node('R'), isNotNull);  // The field.
+},
+];
+
+main(args) => runIsolateTests(args, tests, testeeBefore: buildGraph);
diff --git a/runtime/observatory/tests/service/dominator_tree_vm_test.dart b/runtime/observatory/tests/service/dominator_tree_vm_test.dart
new file mode 100644
index 0000000..ceee90a
--- /dev/null
+++ b/runtime/observatory/tests/service/dominator_tree_vm_test.dart
@@ -0,0 +1,90 @@
+// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--error_on_bad_type --error_on_bad_override
+
+import 'package:observatory/heap_snapshot.dart';
+import 'package:observatory/models.dart' as M;
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'test_helper.dart';
+
+// small example from [Lenguaer & Tarjan 1979]
+class R { var x; var y; var z; }
+class A { var x; }
+class B { var x; var y; var z; }
+class C { var x; var y; }
+class D { var x; }
+class E { var x; }
+class F { var x; }
+class G { var x; var y; }
+class H { var x; var y; }
+class I { var x; }
+class J { var x; }
+class K { var x; var y; }
+class L { var x; }
+
+var r;
+
+buildGraph() {
+  r = new R();
+  var a = new A();
+  var b = new B();
+  var c = new C();
+  var d = new D();
+  var e = new E();
+  var f = new F();
+  var g = new G();
+  var h = new H();
+  var i = new I();
+  var j = new J();
+  var k = new K();
+  var l = new L();
+
+  r.x = a; r.y = b; r.z = c;
+  a.x = d;
+  b.x = a; b.y = d; b.z = e;
+  c.x = f; c.y = g;
+  d.x = l;
+  e.x = h;
+  f.x = i;
+  g.x = i; g.y = j;
+  h.x = e; h.y = k;
+  i.x = k;
+  j.x = i;
+  k.x = i; k.y = r;
+  l.x = h;
+}
+
+var tests = [
+(Isolate isolate) async {
+  final rootLib = await isolate.rootLibrary.load();
+  final raw =
+      await isolate.fetchHeapSnapshot(M.HeapSnapshotRoots.vm, false).last;
+  final snapshot = new HeapSnapshot();
+  await snapshot.loadProgress(isolate, raw).last;
+
+  node(String className) {
+    var cls = rootLib.classes.singleWhere((cls) => cls.name == className);
+    return snapshot.graph.vertices.singleWhere((v) => v.vmCid == cls.vmCid);
+  }
+
+  expect(node('I').dominator, equals(node('R')));
+  expect(node('K').dominator, equals(node('R')));
+  expect(node('C').dominator, equals(node('R')));
+  expect(node('H').dominator, equals(node('R')));
+  expect(node('E').dominator, equals(node('R')));
+  expect(node('A').dominator, equals(node('R')));
+  expect(node('D').dominator, equals(node('R')));
+  expect(node('B').dominator, equals(node('R')));
+
+  expect(node('F').dominator, equals(node('C')));
+  expect(node('G').dominator, equals(node('C')));
+  expect(node('J').dominator, equals(node('G')));
+  expect(node('L').dominator, equals(node('D')));
+
+  expect(node('R'), isNotNull);  // The field.
+},
+];
+
+main(args) => runIsolateTests(args, tests, testeeBefore: buildGraph);
diff --git a/runtime/observatory/tests/service/get_allocation_samples_test.dart b/runtime/observatory/tests/service/get_allocation_samples_test.dart
index d26c75f..bf4e199 100644
--- a/runtime/observatory/tests/service/get_allocation_samples_test.dart
+++ b/runtime/observatory/tests/service/get_allocation_samples_test.dart
@@ -67,8 +67,8 @@
     cpuProfile.buildFunctionCallerAndCallees();
     var tree = cpuProfile.loadCodeTree(M.ProfileTreeDirection.exclusive);
     var node = tree.root;
-    var expected =
-        ['Root', 'DRT_AllocateObject', 'test', 'test', '_Closure.call'];
+    var expected = ['Root', 'DRT_AllocateObject', '[Stub] Allocate Foo',
+                    'test', 'test', '_Closure.call'];
     for (var i = 0; i < expected.length; i++) {
       expect(node.profileCode.code.name, equals(expected[i]));
       // Depth first traversal.
diff --git a/runtime/observatory/tests/service/graph_test.dart b/runtime/observatory/tests/service/graph_test.dart
deleted file mode 100644
index 85556ba..0000000
--- a/runtime/observatory/tests/service/graph_test.dart
+++ /dev/null
@@ -1,101 +0,0 @@
-// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--error_on_bad_type --error_on_bad_override
-
-import 'package:observatory/heap_snapshot.dart';
-import 'package:observatory/object_graph.dart';
-import 'package:observatory/service_io.dart';
-import 'package:unittest/unittest.dart';
-import 'test_helper.dart';
-
-class Foo {
-  Object left;
-  Object right;
-}
-Foo r;
-
-List lst;
-
-void script() {
-  // Create 3 instances of Foo, with out-degrees
-  // 0 (for b), 1 (for a), and 2 (for staticFoo).
-  r = new Foo();
-  var a = new Foo();
-  var b = new Foo();
-  r.left = a;
-  r.right = b;
-  a.left = b;
-
-  lst = new List(2);
-  lst[0] = lst;  // Self-loop.
-  // Larger than any other fixed-size list in a fresh heap.
-  lst[1] = new List(123456);
-}
-
-int fooId;
-
-var tests = [
-
-(Isolate isolate) async {
-  Library lib = await isolate.rootLibrary.load();
-  expect(lib.classes.length, equals(1));
-  Class fooClass = lib.classes.first;
-  fooId = fooClass.vmCid;
-
-  RawHeapSnapshot raw = await isolate.fetchHeapSnapshot(false).last;
-  HeapSnapshot snapshot = new HeapSnapshot();
-  await snapshot.loadProgress(isolate, raw).last;
-  ObjectGraph graph = snapshot.graph;
-
-  expect(fooId, isNotNull);
-  Iterable<ObjectVertex> foos = graph.vertices.where(
-      (ObjectVertex obj) => obj.vmCid == fooId);
-  expect(foos.length, equals(3));
-  expect(foos.where((obj) => obj.successors.length == 0).length,
-         equals(1));
-  expect(foos.where((obj) => obj.successors.length == 1).length,
-         equals(1));
-  expect(foos.where((obj) => obj.successors.length == 2).length,
-         equals(1));
-
-  ObjectVertex bVertex = foos.where(
-      (ObjectVertex obj) => obj.successors.length == 0).first;
-  ObjectVertex aVertex = foos.where(
-      (ObjectVertex obj) => obj.successors.length == 1).first;
-  ObjectVertex rVertex = foos.where(
-      (ObjectVertex obj) => obj.successors.length == 2).first;
-
-  // TODO(koda): Check actual byte sizes.
-
-  expect(aVertex.retainedSize, equals(aVertex.shallowSize));
-  expect(bVertex.retainedSize, equals(bVertex.shallowSize));
-  expect(rVertex.retainedSize, equals(aVertex.shallowSize +
-                                      bVertex.shallowSize +
-                                      rVertex.shallowSize));
-
-  Library corelib =
-      isolate.libraries.singleWhere((lib) => lib.uri == 'dart:core');
-  await corelib.load();
-  Class _List =
-      corelib.classes.singleWhere((cls) => cls.vmName.startsWith('_List'));
-  int kArrayCid = _List.vmCid;
-  // startsWith to ignore the private mangling
-  List<ObjectVertex> lists = new List.from(graph.vertices.where(
-      (ObjectVertex obj) => obj.vmCid == kArrayCid));
-  expect(lists.length >= 2, isTrue);
-  // Order by decreasing retained size.
-  lists.sort((u, v) => v.retainedSize - u.retainedSize);
-  ObjectVertex first = lists[0];
-  ObjectVertex second = lists[1];
-  // Check that the short list retains more than the long list inside.
-  expect(first.successors.length,
-         equals(2 + second.successors.length));
-  // ... and specifically, that it retains exactly itself + the long one.
-  expect(first.retainedSize,
-         equals(first.shallowSize + second.shallowSize));
-},
-
-];
-
-main(args) => runIsolateTests(args, tests, testeeBefore: script);
diff --git a/runtime/observatory/tests/service/issue_27238_test.dart b/runtime/observatory/tests/service/issue_27238_test.dart
index 052b107..77302ae 100644
--- a/runtime/observatory/tests/service/issue_27238_test.dart
+++ b/runtime/observatory/tests/service/issue_27238_test.dart
@@ -3,17 +3,16 @@
 // BSD-style license that can be found in the LICENSE file.
 // VMOptions=--error_on_bad_type --error_on_bad_override  --verbose_debug
 
-import 'package:observatory/service_io.dart';
 import 'service_test_common.dart';
 import 'dart:async';
 import 'test_helper.dart';
 import 'dart:developer';
 
-const int LINE_A = 20;
-const int LINE_B = 23;
-const int LINE_C = 24;
-const int LINE_D = 26;
-const int LINE_E = 27;
+const int LINE_A = 19;
+const int LINE_B = 22;
+const int LINE_C = 23;
+const int LINE_D = 25;
+const int LINE_E = 26;
 
 testMain() async {
   debugger();
@@ -33,6 +32,7 @@
   smartNext,
   hasStoppedAtBreakpoint,
   smartNext,
+  hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_B),
   smartNext,
   hasStoppedAtBreakpoint,
diff --git a/runtime/observatory/tests/service/issue_27287_test.dart b/runtime/observatory/tests/service/issue_27287_test.dart
index 58633b33..85d3e97 100644
--- a/runtime/observatory/tests/service/issue_27287_test.dart
+++ b/runtime/observatory/tests/service/issue_27287_test.dart
@@ -3,14 +3,12 @@
 // BSD-style license that can be found in the LICENSE file.
 // VMOptions=--error_on_bad_type --error_on_bad_override  --verbose_debug
 
-import 'package:observatory/service_io.dart';
 import 'service_test_common.dart';
-import 'dart:async';
 import 'test_helper.dart';
 import 'dart:developer';
 
-const int LINE_A = 19;
-const int LINE_B = 20;
+const int LINE_A = 17;
+const int LINE_B = 18;
 
 var libVariable;
 
diff --git a/runtime/observatory/tests/service/local_variable_declaration_test.dart b/runtime/observatory/tests/service/local_variable_declaration_test.dart
new file mode 100644
index 0000000..3425bab
--- /dev/null
+++ b/runtime/observatory/tests/service/local_variable_declaration_test.dart
@@ -0,0 +1,101 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--error_on_bad_type --error_on_bad_override  --verbose_debug
+
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'service_test_common.dart';
+import 'test_helper.dart';
+import 'dart:developer';
+
+testParameters(int jjjj, int oooo, [int hhhh, int nnnn]) {
+  debugger();
+}
+
+testMain() {
+  int xxx, yyyy, zzzzz;
+  for (int i = 0; i < 1; i++) {
+    var foo = () {
+    };
+    debugger();
+  }
+  var bar = () {
+    print(xxx);
+    print(yyyy);
+    debugger();
+  };
+  bar();
+  testParameters(0, 0);
+}
+
+var tests = [
+  hasStoppedAtBreakpoint,
+  stoppedInFunction('testMain'),
+  (Isolate isolate) async {
+    var stack = await isolate.getStack();
+    expect(stack.type, equals('Stack'));
+    expect(stack['frames'].length, greaterThanOrEqualTo(1));
+    // Grab the top frame.
+    Frame frame = stack['frames'][0];
+    // Grab the script.
+    Script script = frame.location.script;
+    await script.load();
+
+    // Ensure that the token at each declaration position is the name of the
+    // variable.
+    for (var variable in frame.variables) {
+      final int declarationTokenPos = variable['declarationTokenPos'];
+      final String name = variable['name'];
+      final String token = script.getToken(declarationTokenPos);
+      expect(name, token);
+    }
+  },
+  resumeIsolate,
+  hasStoppedAtBreakpoint,
+  // We have stopped in the anonymous closure assigned to bar. Verify that
+  // variables captured in the context have valid declaration positions.
+  (Isolate isolate) async  {
+    var stack = await isolate.getStack();
+    expect(stack.type, equals('Stack'));
+    expect(stack['frames'].length, greaterThanOrEqualTo(1));
+    // Grab the top frame.
+    Frame frame = stack['frames'][0];
+    // Grab the script.
+    Script script = frame.location.script;
+    await script.load();
+    print(frame);
+    expect(frame.variables.length, greaterThanOrEqualTo(1));
+    for (var variable in frame.variables) {
+      final int declarationTokenPos = variable['declarationTokenPos'];
+      final String name = variable['name'];
+      final String token = script.getToken(declarationTokenPos);
+      expect(name, token);
+    }
+  },
+  resumeIsolate,
+  hasStoppedAtBreakpoint,
+  stoppedInFunction('testParameters'),
+  (Isolate isolate) async {
+    var stack = await isolate.getStack();
+    expect(stack.type, equals('Stack'));
+    expect(stack['frames'].length, greaterThanOrEqualTo(1));
+    // Grab the top frame.
+    Frame frame = stack['frames'][0];
+    // Grab the script.
+    Script script = frame.location.script;
+    await script.load();
+
+    // Ensure that the token at each declaration position is the name of the
+    // variable.
+    expect(frame.variables.length, greaterThanOrEqualTo(1));
+    for (var variable in frame.variables) {
+      final int declarationTokenPos = variable['declarationTokenPos'];
+      final String name = variable['name'];
+      final String token = script.getToken(declarationTokenPos);
+      expect(name, token);
+    }
+  }
+];
+
+main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain);
diff --git a/runtime/observatory/tests/service/object_graph_stack_reference_test.dart b/runtime/observatory/tests/service/object_graph_stack_reference_test.dart
new file mode 100644
index 0000000..9fc88ce
--- /dev/null
+++ b/runtime/observatory/tests/service/object_graph_stack_reference_test.dart
@@ -0,0 +1,60 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--error_on_bad_type --error_on_bad_override
+
+import 'dart:developer';
+
+import 'test_helper.dart';
+import 'service_test_common.dart';
+
+import 'package:observatory/heap_snapshot.dart';
+import 'package:observatory/models.dart' as M;
+import 'package:observatory/object_graph.dart';
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+
+int arrayLength = 1024 * 1024;
+int minArraySize = arrayLength * 4;
+
+void script() {
+  var stackSlot = new List(arrayLength);
+  debugger();
+  print(stackSlot);  // Prevent optimizing away the stack slot.
+}
+
+checkForStackReferent(Isolate isolate) async {
+  Library corelib =
+      isolate.libraries.singleWhere((lib) => lib.uri == 'dart:core');
+  await corelib.load();
+  Class _List =
+      corelib.classes.singleWhere((cls) => cls.vmName.startsWith('_List'));
+  int kArrayCid = _List.vmCid;
+
+  RawHeapSnapshot raw =
+      await isolate.fetchHeapSnapshot(M.HeapSnapshotRoots.user, false).last;
+  HeapSnapshot snapshot = new HeapSnapshot();
+  await snapshot.loadProgress(isolate, raw).last;
+  ObjectGraph graph = snapshot.graph;
+
+  var root = graph.root;
+  var stack = graph.root.dominatorTreeChildren()
+      .singleWhere((child) => child.isStack);
+  expect(stack.retainedSize, greaterThanOrEqualTo(minArraySize));
+
+  bool foundBigArray = false;
+  for (var stackReferent in stack.dominatorTreeChildren()) {
+    if (stackReferent.vmCid == kArrayCid &&
+        stackReferent.shallowSize >= minArraySize) {
+      foundBigArray = true;
+    }
+  }
+}
+
+var tests = [
+  hasStoppedAtBreakpoint,
+  checkForStackReferent,
+  resumeIsolate,
+];
+
+main(args) => runIsolateTests(args, tests, testeeConcurrent: script);
diff --git a/runtime/observatory/tests/service/object_graph_user_test.dart b/runtime/observatory/tests/service/object_graph_user_test.dart
new file mode 100644
index 0000000..c51976a
--- /dev/null
+++ b/runtime/observatory/tests/service/object_graph_user_test.dart
@@ -0,0 +1,103 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--error_on_bad_type --error_on_bad_override
+
+import 'package:observatory/heap_snapshot.dart';
+import 'package:observatory/models.dart' as M;
+import 'package:observatory/object_graph.dart';
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'test_helper.dart';
+
+class Foo {
+  Object left;
+  Object right;
+}
+Foo r;
+
+List lst;
+
+void script() {
+  // Create 3 instances of Foo, with out-degrees
+  // 0 (for b), 1 (for a), and 2 (for staticFoo).
+  r = new Foo();
+  var a = new Foo();
+  var b = new Foo();
+  r.left = a;
+  r.right = b;
+  a.left = b;
+
+  lst = new List(2);
+  lst[0] = lst;  // Self-loop.
+  // Larger than any other fixed-size list in a fresh heap.
+  lst[1] = new List(123456);
+}
+
+int fooId;
+
+var tests = [
+
+(Isolate isolate) async {
+  Library lib = await isolate.rootLibrary.load();
+  expect(lib.classes.length, equals(1));
+  Class fooClass = lib.classes.first;
+  fooId = fooClass.vmCid;
+
+  RawHeapSnapshot raw =
+      await isolate.fetchHeapSnapshot(M.HeapSnapshotRoots.user, false).last;
+  HeapSnapshot snapshot = new HeapSnapshot();
+  await snapshot.loadProgress(isolate, raw).last;
+  ObjectGraph graph = snapshot.graph;
+
+  expect(fooId, isNotNull);
+  Iterable<ObjectVertex> foos = graph.vertices.where(
+      (ObjectVertex obj) => obj.vmCid == fooId);
+  expect(foos.length, equals(3));
+  expect(foos.where((obj) => obj.successors.length == 0).length,
+         equals(1));
+  expect(foos.where((obj) => obj.successors.length == 1).length,
+         equals(1));
+  expect(foos.where((obj) => obj.successors.length == 2).length,
+         equals(1));
+
+  ObjectVertex bVertex = foos.where(
+      (ObjectVertex obj) => obj.successors.length == 0).first;
+  ObjectVertex aVertex = foos.where(
+      (ObjectVertex obj) => obj.successors.length == 1).first;
+  ObjectVertex rVertex = foos.where(
+      (ObjectVertex obj) => obj.successors.length == 2).first;
+
+  // TODO(koda): Check actual byte sizes.
+
+  expect(aVertex.retainedSize, equals(aVertex.shallowSize));
+  expect(bVertex.retainedSize, equals(bVertex.shallowSize));
+  expect(rVertex.retainedSize, equals(aVertex.shallowSize +
+                                      bVertex.shallowSize +
+                                      rVertex.shallowSize));
+
+  Library corelib =
+      isolate.libraries.singleWhere((lib) => lib.uri == 'dart:core');
+  await corelib.load();
+  Class _List =
+      corelib.classes.singleWhere((cls) => cls.vmName.startsWith('_List'));
+  int kArrayCid = _List.vmCid;
+  // startsWith to ignore the private mangling
+  List<ObjectVertex> lists = new List.from(graph.vertices.where(
+      (ObjectVertex obj) => obj.vmCid == kArrayCid));
+  expect(lists.length >= 2, isTrue);
+  // Order by decreasing retained size.
+  lists.sort((u, v) => v.retainedSize - u.retainedSize);
+  ObjectVertex first = lists[0];
+  ObjectVertex second = lists[1];
+  // Check that the short list retains more than the long list inside.
+  expect(first.successors.length,
+         equals(2 + second.successors.length));
+  // ... and specifically, that it retains exactly itself + the long one.
+  expect(first.retainedSize,
+         equals(first.shallowSize + second.shallowSize));
+},
+
+];
+
+main(args) => runIsolateTests(args, tests, testeeBefore: script);
diff --git a/runtime/observatory/tests/service/object_graph_vm_test.dart b/runtime/observatory/tests/service/object_graph_vm_test.dart
new file mode 100644
index 0000000..eae1679
--- /dev/null
+++ b/runtime/observatory/tests/service/object_graph_vm_test.dart
@@ -0,0 +1,103 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--error_on_bad_type --error_on_bad_override
+
+import 'package:observatory/heap_snapshot.dart';
+import 'package:observatory/models.dart' as M;
+import 'package:observatory/object_graph.dart';
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'test_helper.dart';
+
+class Foo {
+  Object left;
+  Object right;
+}
+Foo r;
+
+List lst;
+
+void script() {
+  // Create 3 instances of Foo, with out-degrees
+  // 0 (for b), 1 (for a), and 2 (for staticFoo).
+  r = new Foo();
+  var a = new Foo();
+  var b = new Foo();
+  r.left = a;
+  r.right = b;
+  a.left = b;
+
+  lst = new List(2);
+  lst[0] = lst;  // Self-loop.
+  // Larger than any other fixed-size list in a fresh heap.
+  lst[1] = new List(123456);
+}
+
+int fooId;
+
+var tests = [
+
+(Isolate isolate) async {
+  Library lib = await isolate.rootLibrary.load();
+  expect(lib.classes.length, equals(1));
+  Class fooClass = lib.classes.first;
+  fooId = fooClass.vmCid;
+
+  RawHeapSnapshot raw =
+      await isolate.fetchHeapSnapshot(M.HeapSnapshotRoots.vm, false).last;
+  HeapSnapshot snapshot = new HeapSnapshot();
+  await snapshot.loadProgress(isolate, raw).last;
+  ObjectGraph graph = snapshot.graph;
+
+  expect(fooId, isNotNull);
+  Iterable<ObjectVertex> foos = graph.vertices.where(
+      (ObjectVertex obj) => obj.vmCid == fooId);
+  expect(foos.length, equals(3));
+  expect(foos.where((obj) => obj.successors.length == 0).length,
+         equals(1));
+  expect(foos.where((obj) => obj.successors.length == 1).length,
+         equals(1));
+  expect(foos.where((obj) => obj.successors.length == 2).length,
+         equals(1));
+
+  ObjectVertex bVertex = foos.where(
+      (ObjectVertex obj) => obj.successors.length == 0).first;
+  ObjectVertex aVertex = foos.where(
+      (ObjectVertex obj) => obj.successors.length == 1).first;
+  ObjectVertex rVertex = foos.where(
+      (ObjectVertex obj) => obj.successors.length == 2).first;
+
+  // TODO(koda): Check actual byte sizes.
+
+  expect(aVertex.retainedSize, equals(aVertex.shallowSize));
+  expect(bVertex.retainedSize, equals(bVertex.shallowSize));
+  expect(rVertex.retainedSize, equals(aVertex.shallowSize +
+                                      bVertex.shallowSize +
+                                      rVertex.shallowSize));
+
+  Library corelib =
+      isolate.libraries.singleWhere((lib) => lib.uri == 'dart:core');
+  await corelib.load();
+  Class _List =
+      corelib.classes.singleWhere((cls) => cls.vmName.startsWith('_List'));
+  int kArrayCid = _List.vmCid;
+  // startsWith to ignore the private mangling
+  List<ObjectVertex> lists = new List.from(graph.vertices.where(
+      (ObjectVertex obj) => obj.vmCid == kArrayCid));
+  expect(lists.length >= 2, isTrue);
+  // Order by decreasing retained size.
+  lists.sort((u, v) => v.retainedSize - u.retainedSize);
+  ObjectVertex first = lists[0];
+  ObjectVertex second = lists[1];
+  // Check that the short list retains more than the long list inside.
+  expect(first.successors.length,
+         equals(2 + second.successors.length));
+  // ... and specifically, that it retains exactly itself + the long one.
+  expect(first.retainedSize,
+         equals(first.shallowSize + second.shallowSize));
+},
+
+];
+
+main(args) => runIsolateTests(args, tests, testeeBefore: script);
diff --git a/runtime/observatory/tests/service/reload_sources_test.dart b/runtime/observatory/tests/service/reload_sources_test.dart
new file mode 100644
index 0000000..64f5eac
--- /dev/null
+++ b/runtime/observatory/tests/service/reload_sources_test.dart
@@ -0,0 +1,42 @@
+// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--error_on_bad_type --error_on_bad_override
+
+import 'test_helper.dart';
+import 'dart:developer';
+import 'service_test_common.dart';
+
+testMain() {
+  debugger();  // Stop here.
+  print('1');
+  while (true) {
+  }
+}
+
+var tests = [
+  // Stopped at 'debugger' statement.
+  hasStoppedAtBreakpoint,
+  // Reload sources and request to pause post reload. The pause request will be
+  // ignored because we are already paused at a breakpoint.
+  reloadSources(true),
+  // Ensure that we are still stopped at a breakpoint.
+  hasStoppedAtBreakpoint,
+  // Resume the isolate into the while loop.
+  resumeIsolate,
+  // Reload sources and request to pause post reload. The pause request will
+  // be respected because we are not already paused.
+  reloadSources(true),
+  // Ensure that we are paused post reload request.
+  hasStoppedPostRequest,
+  // Resume the isolate.
+  resumeIsolate,
+  // Verify that it is running.
+  isolateIsRunning,
+  // Reload sources and do not request to pause post reload.
+  reloadSources(false),
+  // Verify that it is running.
+  isolateIsRunning,
+];
+
+main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain);
diff --git a/runtime/observatory/tests/service/service.status b/runtime/observatory/tests/service/service.status
index 0c6e7dc..ccbcbcc 100644
--- a/runtime/observatory/tests/service/service.status
+++ b/runtime/observatory/tests/service/service.status
@@ -7,6 +7,9 @@
 gc_test: Pass, RuntimeError # Issue 26490
 pause_on_start_and_exit_test: Pass, RuntimeError # Issue 26470
 pause_on_start_then_step_test: Pass, RuntimeError # Issue 26470
+get_allocation_samples_test: Pass, RuntimeError # Inconsistent stack trace
+# Reload is slow on the bots
+reload_sources_test: Pass, Slow
 
 [ ($compiler == none || $compiler == precompiler) && ($runtime == vm || $runtime == dart_precompiled) ]
 evaluate_activation_test/instance: RuntimeError # http://dartbug.com/20047
@@ -38,16 +41,21 @@
 *: Skip # Issue 24651
 
 [ $runtime == vm ]
-coverage_test: Pass, Slow
 developer_extension_test: Pass, Fail # Issue 27225
 
-# Service protocol is not supported in product mode.
-[ $mode == product ]
-*: SkipByDesign
-
-# Service protocol is not supported when running a full application snapshot.
 [ $runtime == dart_app ]
-*: SkipByDesign
+address_mapper_test: CompileTimeError # Issue 27806
+capture_stdio_test: CompileTimeError # Issue 27806
+complex_reload_test: RuntimeError # Issue 27806
+debugger_location_second_test: RuntimeError # Issue 27806
+dev_fs_spawn_test: RuntimeError # Issue 27806
+developer_extension_test: RuntimeError # Issue 27806
+evaluate_activation_test/instance: RuntimeError # Issue 27806
+evaluate_activation_test/scope: RuntimeError # Issue 27806
+get_object_rpc_test: RuntimeError # Issue 27806
+get_source_report_test: RuntimeError # Issue 27806
+set_name_rpc_test: RuntimeError # Issue 27806
+vm_restart_test: CompileTimeError # Issue 27806
 
 [ $compiler == dart2analyzer ]
 evaluate_activation_in_method_class_test: CompileTimeError # Issue 24478
@@ -63,3 +71,9 @@
 
 [ $system == windows ]
 dev_fs_weird_char_test: Skip # Windows disallows question mark in paths
+dev_fs_http_put_weird_char_test: Skip # Windows disallows carriage returns in paths
+complex_reload_test: Skip # Issue 27861
+
+# Service protocol is not supported in product mode.
+[ $mode == product ]
+*: SkipByDesign
diff --git a/runtime/observatory/tests/service/service_test_common.dart b/runtime/observatory/tests/service/service_test_common.dart
index 935d426..bf1d013 100644
--- a/runtime/observatory/tests/service/service_test_common.dart
+++ b/runtime/observatory/tests/service/service_test_common.dart
@@ -144,6 +144,8 @@
       return event is M.PauseExitEvent;
     case ServiceEvent.kPauseStart:
       return event is M.PauseStartEvent;
+    case ServiceEvent.kPausePostRequest:
+      return event is M.PausePostRequestEvent;
     default:
       return false;
   }
@@ -155,7 +157,7 @@
   isolate.vm.getEventStream(VM.kDebugStream).then((stream) {
     var subscription;
     subscription = stream.listen((ServiceEvent event) {
-        if (event.kind == kind) {
+        if ((isolate == event.isolate) && (event.kind == kind)) {
           if (completer != null) {
             // Reload to update isolate.pauseEvent.
             print('Paused with $kind');
@@ -188,6 +190,10 @@
   return hasPausedFor(isolate, ServiceEvent.kPauseBreakpoint);
 }
 
+Future<Isolate> hasStoppedPostRequest(Isolate isolate) {
+  return hasPausedFor(isolate, ServiceEvent.kPausePostRequest);
+}
+
 Future<Isolate> hasStoppedWithUnhandledException(Isolate isolate) {
   return hasPausedFor(isolate, ServiceEvent.kPauseException);
 }
@@ -200,6 +206,16 @@
   return hasPausedFor(isolate, ServiceEvent.kPauseStart);
 }
 
+IsolateTest reloadSources([bool pause = false]) {
+    return (Isolate isolate) async {
+      Map<String, dynamic> params = <String, dynamic>{ };
+      if (pause == true) {
+        params['pause'] = pause;
+      }
+      return isolate.invokeRpc('reloadSources', params);
+    };
+}
+
 // Currying is your friend.
 IsolateTest setBreakpointAtLine(int line) {
   return (Isolate isolate) async {
@@ -333,6 +349,11 @@
 }
 
 
+Future isolateIsRunning(Isolate isolate) async {
+  await isolate.reload();
+  expect(isolate.running, true);
+}
+
 Future<Class> getClassFromRootLib(Isolate isolate, String className) async {
   Library rootLib = await isolate.rootLibrary.load();
   for (var i = 0; i < rootLib.classes.length; i++) {
diff --git a/runtime/observatory/tests/service/step_test.dart b/runtime/observatory/tests/service/step_test.dart
new file mode 100644
index 0000000..47009dc
--- /dev/null
+++ b/runtime/observatory/tests/service/step_test.dart
@@ -0,0 +1,38 @@
+import 'dart:async';
+import 'test_helper.dart';
+import 'service_test_common.dart';
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+
+const int LINE_A = 10;
+
+code() {
+  var x = {}; // LINE_A
+}
+
+Future<Isolate> stepThroughProgram(Isolate isolate) async {
+  Completer completer = new Completer();
+  int pauseEventsSeen = 0;
+
+  await subscribeToStream(isolate.vm, VM.kDebugStream,
+      (ServiceEvent event) async {
+    if (event.kind == ServiceEvent.kPauseBreakpoint) {
+      // We are paused: Step further.
+      pauseEventsSeen++;
+      isolate.stepInto();
+    } else if (event.kind == ServiceEvent.kPauseExit) {
+      // We are at the exit: The test is done.
+      expect(pauseEventsSeen > 20, true,
+          reason: "Saw only $pauseEventsSeen pause events.");
+      await cancelStreamSubscription(VM.kDebugStream);
+      completer.complete();
+    }
+  });
+  isolate.resume();
+  return completer.future;
+}
+
+var tests = [hasPausedAtStart, setBreakpointAtLine(LINE_A), stepThroughProgram];
+
+main(args) => runIsolateTestsSynchronous(args, tests,
+    testeeConcurrent: code, pause_on_start: true, pause_on_exit: true);
diff --git a/runtime/observatory/tests/service/test_helper.dart b/runtime/observatory/tests/service/test_helper.dart
index 63b8fc2..a722876 100644
--- a/runtime/observatory/tests/service/test_helper.dart
+++ b/runtime/observatory/tests/service/test_helper.dart
@@ -91,25 +91,32 @@
                                 bool pause_on_exit,
                                 bool pause_on_unhandled_exceptions,
                                 bool trace_service,
-                                bool trace_compiler) {
+                                bool trace_compiler,
+                                bool testeeControlsServer,
+                                bool useAuthToken) {
     assert(pause_on_start != null);
     assert(pause_on_exit != null);
     assert(pause_on_unhandled_exceptions != null);
     assert(trace_service != null);
     assert(trace_compiler != null);
+    assert(testeeControlsServer != null);
+    assert(useAuthToken != null);
 
     if (_shouldLaunchSkyShell()) {
       return _spawnSkyProcess(pause_on_start,
                               pause_on_exit,
                               pause_on_unhandled_exceptions,
                               trace_service,
-                              trace_compiler);
+                              trace_compiler,
+                              testeeControlsServer);
     } else {
       return _spawnDartProcess(pause_on_start,
                                pause_on_exit,
                                pause_on_unhandled_exceptions,
                                trace_service,
-                               trace_compiler);
+                               trace_compiler,
+                               testeeControlsServer,
+                               useAuthToken);
     }
   }
 
@@ -117,7 +124,9 @@
                                     bool pause_on_exit,
                                     bool pause_on_unhandled_exceptions,
                                     bool trace_service,
-                                    bool trace_compiler) {
+                                    bool trace_compiler,
+                                    bool testeeControlsServer,
+                                    bool useAuthToken) {
     assert(!_shouldLaunchSkyShell());
 
     String dartExecutable = Platform.executable;
@@ -141,17 +150,25 @@
     }
 
     fullArgs.addAll(Platform.executableArguments);
-    fullArgs.add('--enable-vm-service:0');
+    if (!testeeControlsServer) {
+      fullArgs.add('--enable-vm-service:0');
+    }
     fullArgs.addAll(args);
 
-    return _spawnCommon(dartExecutable, fullArgs);
+    return _spawnCommon(
+        dartExecutable,
+        fullArgs,
+        <String, String>{
+          'DART_SERVICE_USE_AUTH': '$useAuthToken'
+        });
   }
 
   Future<Process> _spawnSkyProcess(bool pause_on_start,
                                    bool pause_on_exit,
                                    bool pause_on_unhandled_exceptions,
                                    bool trace_service,
-                                   bool trace_compiler) {
+                                   bool trace_compiler,
+                                   bool testeeControlsServer) {
     assert(_shouldLaunchSkyShell());
 
     String dartExecutable = _skyShellPath();
@@ -179,52 +196,64 @@
     dartFlags.add('--enable_mirrors=true');
 
     fullArgs.addAll(Platform.executableArguments);
-    fullArgs.add('--observatory-port=0');
+    if (!testeeControlsServer) {
+      fullArgs.add('--observatory-port=0');
+    }
     fullArgs.add('--dart-flags=${dartFlags.join(' ')}');
     fullArgs.addAll(args);
 
-    return _spawnCommon(dartExecutable, fullArgs);
+    return _spawnCommon(dartExecutable, fullArgs, <String, String>{});
   }
 
-  Future<Process> _spawnCommon(String executable, List<String> arguments) {
+  Future<Process> _spawnCommon(String executable,
+                               List<String> arguments,
+                               Map<String, String> dartEnvironment) {
     var environment = _TESTEE_SPAWN_ENV;
     var bashEnvironment = new StringBuffer();
     environment.forEach((k, v) => bashEnvironment.write("$k=$v "));
+    if (dartEnvironment != null) {
+      dartEnvironment.forEach((k, v) {
+        arguments.insert(0, '-D$k=$v');
+      });
+    }
     print('** Launching $bashEnvironment$executable ${arguments.join(' ')}');
     return Process.start(executable, arguments, environment: environment);
   }
 
-  Future<int> launch(bool pause_on_start,
+  Future<Uri> launch(bool pause_on_start,
                      bool pause_on_exit,
                      bool pause_on_unhandled_exceptions,
                      bool trace_service,
-                     bool trace_compiler) {
+                     bool trace_compiler,
+                     bool testeeControlsServer,
+                     bool useAuthToken) {
     return _spawnProcess(pause_on_start,
                   pause_on_exit,
                   pause_on_unhandled_exceptions,
                   trace_service,
-                  trace_compiler).then((p) {
-      Completer completer = new Completer();
+                  trace_compiler,
+                  testeeControlsServer,
+                  useAuthToken).then((p) {
+      Completer<Uri> completer = new Completer<Uri>();
       process = p;
-      var portNumber;
+      Uri uri;
       var blank;
       var first = true;
       process.stdout.transform(UTF8.decoder)
                     .transform(new LineSplitter()).listen((line) {
-        if (line.startsWith('Observatory listening on http://')) {
-          RegExp portExp = new RegExp(r"\d+.\d+.\d+.\d+:(\d+)");
-          var port = portExp.firstMatch(line).group(1);
-          portNumber = int.parse(port);
+        const kObservatoryListening = 'Observatory listening on ';
+        if (line.startsWith(kObservatoryListening)) {
+          uri = Uri.parse(line.substring(kObservatoryListening.length));
         }
         if (pause_on_start || line == '') {
           // Received blank line.
           blank = true;
         }
-        if (portNumber != null && blank == true && first == true) {
-          completer.complete(portNumber);
+        if ((uri != null) && (blank == true) && (first == true)) {
+          completer.complete(uri);
           // Stop repeat completions.
           first = false;
-          print('** Signaled to run test queries on $portNumber');
+          print('** Signaled to run test queries on $uri');
         }
         print('>testee>out> $line');
       });
@@ -250,62 +279,11 @@
   }
 }
 
-// A tester runner that doesn't spawn a process but instead connects to
-// an already running flutter application running on a device. Assumes
-// port 8100. This is only useful for debugging.
-class _FlutterDeviceServiceTesterRunner {
-  void run({List<String> mainArgs,
-            List<VMTest> vmTests,
-            List<IsolateTest> isolateTests,
-            bool pause_on_start: false,
-            bool pause_on_exit: false,
-            bool trace_service: false,
-            bool trace_compiler: false,
-            bool verbose_vm: false,
-            bool pause_on_unhandled_exceptions: false}) {
-    var port = 8100;
-    serviceWebsocketAddress = 'ws://localhost:$port/ws';
-    serviceHttpAddress = 'http://localhost:$port';
-    var name = Platform.script.pathSegments.last;
-    Chain.capture(() async {
-      var vm =
-          new WebSocketVM(new WebSocketVMTarget(serviceWebsocketAddress));
-      print('Loading VM...');
-      await vm.load();
-      print('Done loading VM');
-
-      // Run vm tests.
-      if (vmTests != null) {
-        var testIndex = 1;
-        var totalTests = vmTests.length;
-        for (var test in vmTests) {
-          vm.verbose = verbose_vm;
-          print('Running $name [$testIndex/$totalTests]');
-          testIndex++;
-          await test(vm);
-        }
-      }
-
-      // Run isolate tests.
-      if (isolateTests != null) {
-        var isolate = await vm.isolates.first.load();
-        var testIndex = 1;
-        var totalTests = isolateTests.length;
-        for (var test in isolateTests) {
-          vm.verbose = verbose_vm;
-          print('Running $name [$testIndex/$totalTests]');
-          testIndex++;
-          await test(isolate);
-        }
-      }
-    }, onError: (error, stackTrace) {
-      print('Unexpected exception in service tests: $error\n$stackTrace');
-    });
-  }
-}
-
-void suppressWarning() {
-  new _FlutterDeviceServiceTesterRunner();
+void setupAddresses(Uri serverAddress) {
+  serviceWebsocketAddress =
+      'ws://${serverAddress.authority}${serverAddress.path}ws';
+  serviceHttpAddress =
+      'http://${serverAddress.authority}${serverAddress.path}';
 }
 
 class _ServiceTesterRunner {
@@ -317,19 +295,22 @@
             bool trace_service: false,
             bool trace_compiler: false,
             bool verbose_vm: false,
-            bool pause_on_unhandled_exceptions: false}) {
+            bool pause_on_unhandled_exceptions: false,
+            bool testeeControlsServer: false,
+            bool useAuthToken: false}) {
     var process = new _ServiceTesteeLauncher();
     process.launch(pause_on_start, pause_on_exit,
                    pause_on_unhandled_exceptions,
-                   trace_service, trace_compiler).then((port) async {
+                   trace_service, trace_compiler,
+                   testeeControlsServer,
+                   useAuthToken).then((Uri serverAddress) async {
       if (mainArgs.contains("--gdb")) {
         var pid = process.process.pid;
         var wait = new Duration(seconds: 10);
         print("Testee has pid $pid, waiting $wait before continuing");
         sleep(wait);
       }
-      serviceWebsocketAddress = 'ws://localhost:$port/ws';
-      serviceHttpAddress = 'http://localhost:$port';
+      setupAddresses(serverAddress);
       var name = Platform.script.pathSegments.last;
       Chain.capture(() async {
         var vm =
@@ -386,7 +367,9 @@
                         bool trace_service: false,
                         bool trace_compiler: false,
                         bool verbose_vm: false,
-                        bool pause_on_unhandled_exceptions: false}) async {
+                        bool pause_on_unhandled_exceptions: false,
+                        bool testeeControlsServer: false,
+                        bool useAuthToken: false}) async {
   assert(!pause_on_start || testeeBefore == null);
   if (_isTestee()) {
     new _ServiceTesteeRunner().run(testeeBefore: testeeBefore,
@@ -402,7 +385,9 @@
         trace_service: trace_service,
         trace_compiler: trace_compiler,
         verbose_vm: verbose_vm,
-        pause_on_unhandled_exceptions: pause_on_unhandled_exceptions);
+        pause_on_unhandled_exceptions: pause_on_unhandled_exceptions,
+        testeeControlsServer: testeeControlsServer,
+        useAuthToken: useAuthToken);
   }
 }
 
diff --git a/runtime/platform/address_sanitizer.h b/runtime/platform/address_sanitizer.h
index 37346fc..ec8baf7 100644
--- a/runtime/platform/address_sanitizer.h
+++ b/runtime/platform/address_sanitizer.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef PLATFORM_ADDRESS_SANITIZER_H_
-#define PLATFORM_ADDRESS_SANITIZER_H_
+#ifndef RUNTIME_PLATFORM_ADDRESS_SANITIZER_H_
+#define RUNTIME_PLATFORM_ADDRESS_SANITIZER_H_
 
 #include "platform/globals.h"
 
@@ -11,13 +11,17 @@
 // told about areas where the VM does the equivalent of a long-jump.
 #if defined(__has_feature)
 #if __has_feature(address_sanitizer)
-extern "C" void __asan_unpoison_memory_region(void *, size_t);
+extern "C" void __asan_unpoison_memory_region(void*, size_t);
 #define ASAN_UNPOISON(ptr, len) __asan_unpoison_memory_region(ptr, len)
 #else  // __has_feature(address_sanitizer)
-#define ASAN_UNPOISON(ptr, len) do {} while (false && (ptr) == 0 && (len) == 0)
+#define ASAN_UNPOISON(ptr, len)                                                \
+  do {                                                                         \
+  } while (false && (ptr) == 0 && (len) == 0)
 #endif  // __has_feature(address_sanitizer)
-#else  // defined(__has_feature)
-#define ASAN_UNPOISON(ptr, len) do {} while (false && (ptr) == 0 && (len) == 0)
+#else   // defined(__has_feature)
+#define ASAN_UNPOISON(ptr, len)                                                \
+  do {                                                                         \
+  } while (false && (ptr) == 0 && (len) == 0)
 #endif  // defined(__has_feature)
 
-#endif  // PLATFORM_ADDRESS_SANITIZER_H_
+#endif  // RUNTIME_PLATFORM_ADDRESS_SANITIZER_H_
diff --git a/runtime/platform/assert.cc b/runtime/platform/assert.cc
index 000546a..7929b27 100644
--- a/runtime/platform/assert.cc
+++ b/runtime/platform/assert.cc
@@ -20,6 +20,7 @@
 
   // Print the file and line number into the buffer.
   char buffer[4 * KB];
+  MSAN_UNPOISON(buffer, sizeof(buffer));
   intptr_t file_and_line_length =
       snprintf(buffer, sizeof(buffer), "%s: %d: error: ", file, line_);
 
@@ -27,9 +28,7 @@
   va_list arguments;
   va_start(arguments, format);
   vsnprintf(buffer + file_and_line_length,
-            sizeof(buffer) - file_and_line_length,
-            format,
-            arguments);
+            sizeof(buffer) - file_and_line_length, format, arguments);
   va_end(arguments);
 
   // Print the buffer on stderr and/or syslog.
@@ -39,7 +38,7 @@
   // until the program is exiting before producing a non-zero exit
   // code through abort.
   if (kind_ == ASSERT) {
-    NOT_IN_PRODUCT(Profiler::DumpStackTrace(true /* native_stack_trace */));
+    NOT_IN_PRODUCT(Profiler::DumpStackTrace());
     OS::Abort();
   }
   failed_ = true;
diff --git a/runtime/platform/assert.h b/runtime/platform/assert.h
index 0e8969c..02e0e8f 100644
--- a/runtime/platform/assert.h
+++ b/runtime/platform/assert.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef PLATFORM_ASSERT_H_
-#define PLATFORM_ASSERT_H_
+#ifndef RUNTIME_PLATFORM_ASSERT_H_
+#define RUNTIME_PLATFORM_ASSERT_H_
 
 // TODO(5411406): include sstream for now, once we have a Utils::toString()
 // implemented for all the primitive types we can replace the usage of
@@ -14,6 +14,7 @@
 #endif
 
 #include "platform/globals.h"
+#include "platform/memory_sanitizer.h"
 
 #if !defined(DEBUG) && !defined(NDEBUG)
 #error neither DEBUG nor NDEBUG defined
@@ -25,51 +26,48 @@
 
 class DynamicAssertionHelper {
  public:
-  enum Kind {
-    ASSERT,
-    EXPECT
-  };
+  enum Kind { ASSERT, EXPECT };
 
   DynamicAssertionHelper(const char* file, int line, Kind kind)
-      : file_(file), line_(line), kind_(kind) { }
+      : file_(file), line_(line), kind_(kind) {}
 
   void Fail(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
 
   static bool failed() { return failed_; }
 
 #if defined(TESTING)
-  template<typename E, typename A>
+  template <typename E, typename A>
   void Equals(const E& expected, const A& actual);
 
-  template<typename E, typename A>
+  template <typename E, typename A>
   void NotEquals(const E& not_expected, const A& actual);
 
-  template<typename E, typename A, typename T>
+  template <typename E, typename A, typename T>
   void FloatEquals(const E& expected, const A& actual, const T& tol);
 
-  template<typename E, typename A>
+  template <typename E, typename A>
   void StringEquals(const E& expected, const A& actual);
 
-  template<typename E, typename A>
+  template <typename E, typename A>
   void IsSubstring(const E& needle, const A& haystack);
 
-  template<typename E, typename A>
+  template <typename E, typename A>
   void IsNotSubstring(const E& needle, const A& haystack);
 
-  template<typename E, typename A>
+  template <typename E, typename A>
   void LessThan(const E& left, const A& right);
 
-  template<typename E, typename A>
+  template <typename E, typename A>
   void LessEqual(const E& left, const A& right);
 
-  template<typename E, typename A>
+  template <typename E, typename A>
   void GreaterThan(const E& left, const A& right);
 
-  template<typename E, typename A>
+  template <typename E, typename A>
   void GreaterEqual(const E& left, const A& right);
 #endif
 
-  template<typename T>
+  template <typename T>
   T NotNull(const T p);
 
  private:
@@ -83,24 +81,24 @@
 };
 
 
-class Assert: public DynamicAssertionHelper {
+class Assert : public DynamicAssertionHelper {
  public:
   Assert(const char* file, int line)
-      : DynamicAssertionHelper(file, line, ASSERT) { }
+      : DynamicAssertionHelper(file, line, ASSERT) {}
 };
 
 
-class Expect: public DynamicAssertionHelper {
+class Expect : public DynamicAssertionHelper {
  public:
   Expect(const char* file, int line)
-      : DynamicAssertionHelper(file, line, EXPECT) { }
+      : DynamicAssertionHelper(file, line, EXPECT) {}
 };
 
 
 #if defined(TESTING)
 // Only allow the expensive (with respect to code size) assertions
 // in testing code.
-template<typename E, typename A>
+template <typename E, typename A>
 void DynamicAssertionHelper::Equals(const E& expected, const A& actual) {
   if (actual == expected) return;
   std::ostringstream ess, ass;
@@ -111,9 +109,8 @@
 }
 
 
-template<typename E, typename A>
-void DynamicAssertionHelper::NotEquals(const E& not_expected,
-                                       const A& actual) {
+template <typename E, typename A>
+void DynamicAssertionHelper::NotEquals(const E& not_expected, const A& actual) {
   if (actual != not_expected) return;
   std::ostringstream ness;
   ness << not_expected;
@@ -122,7 +119,7 @@
 }
 
 
-template<typename E, typename A, typename T>
+template <typename E, typename A, typename T>
 void DynamicAssertionHelper::FloatEquals(const E& expected,
                                          const A& actual,
                                          const T& tol) {
@@ -134,15 +131,14 @@
   ass << actual;
   tolss << tol;
   std::string es = ess.str(), as = ass.str(), tols = tolss.str();
-  Fail("expected: <%s> but was: <%s> (tolerance: <%s>)",
-       es.c_str(),
-       as.c_str(),
+  Fail("expected: <%s> but was: <%s> (tolerance: <%s>)", es.c_str(), as.c_str(),
        tols.c_str());
 }
 
 
-template<typename E, typename A>
-void DynamicAssertionHelper::StringEquals(const E& expected, const A& actual) {
+template <typename E, typename A>
+NO_SANITIZE_MEMORY void DynamicAssertionHelper::StringEquals(const E& expected,
+                                                             const A& actual) {
   std::ostringstream ess, ass;
   ess << expected;
   ass << actual;
@@ -152,32 +148,34 @@
 }
 
 
-template<typename E, typename A>
-void DynamicAssertionHelper::IsSubstring(const E& needle, const A& haystack) {
+template <typename E, typename A>
+NO_SANITIZE_MEMORY void DynamicAssertionHelper::IsSubstring(const E& needle,
+                                                            const A& haystack) {
   std::ostringstream ess, ass;
   ess << needle;
   ass << haystack;
   std::string es = ess.str(), as = ass.str();
   if (as.find(es) != std::string::npos) return;
-  Fail("expected <\"%s\"> to be a substring of <\"%s\">",
-       es.c_str(), as.c_str());
+  Fail("expected <\"%s\"> to be a substring of <\"%s\">", es.c_str(),
+       as.c_str());
 }
 
 
-template<typename E, typename A>
-void DynamicAssertionHelper::IsNotSubstring(const E& needle,
-                                            const A& haystack) {
+template <typename E, typename A>
+NO_SANITIZE_MEMORY void DynamicAssertionHelper::IsNotSubstring(
+    const E& needle,
+    const A& haystack) {
   std::ostringstream ess, ass;
   ess << needle;
   ass << haystack;
   std::string es = ess.str(), as = ass.str();
   if (as.find(es) == std::string::npos) return;
-  Fail("expected <\"%s\"> to not be a substring of <\"%s\">",
-       es.c_str(), as.c_str());
+  Fail("expected <\"%s\"> to not be a substring of <\"%s\">", es.c_str(),
+       as.c_str());
 }
 
 
-template<typename E, typename A>
+template <typename E, typename A>
 void DynamicAssertionHelper::LessThan(const E& left, const A& right) {
   if (left < right) return;
   std::ostringstream ess, ass;
@@ -188,7 +186,7 @@
 }
 
 
-template<typename E, typename A>
+template <typename E, typename A>
 void DynamicAssertionHelper::LessEqual(const E& left, const A& right) {
   if (left <= right) return;
   std::ostringstream ess, ass;
@@ -199,7 +197,7 @@
 }
 
 
-template<typename E, typename A>
+template <typename E, typename A>
 void DynamicAssertionHelper::GreaterThan(const E& left, const A& right) {
   if (left > right) return;
   std::ostringstream ess, ass;
@@ -210,7 +208,7 @@
 }
 
 
-template<typename E, typename A>
+template <typename E, typename A>
 void DynamicAssertionHelper::GreaterEqual(const E& left, const A& right) {
   if (left >= right) return;
   std::ostringstream ess, ass;
@@ -222,7 +220,7 @@
 #endif
 
 
-template<typename T>
+template <typename T>
 T DynamicAssertionHelper::NotNull(const T p) {
   if (p != NULL) return p;
   Fail("expected: not NULL, found NULL");
@@ -232,11 +230,9 @@
 }  // namespace dart
 
 
-#define FATAL(error)                                                           \
-  dart::Assert(__FILE__, __LINE__).Fail("%s", error)
+#define FATAL(error) dart::Assert(__FILE__, __LINE__).Fail("%s", error)
 
-#define FATAL1(format, p1)                                                     \
-  dart::Assert(__FILE__, __LINE__).Fail(format, (p1))
+#define FATAL1(format, p1) dart::Assert(__FILE__, __LINE__).Fail(format, (p1))
 
 #define FATAL2(format, p1, p2)                                                 \
   dart::Assert(__FILE__, __LINE__).Fail(format, (p1), (p2))
@@ -244,11 +240,11 @@
 #define FATAL3(format, p1, p2, p3)                                             \
   dart::Assert(__FILE__, __LINE__).Fail(format, (p1), (p2), (p3))
 
-#define UNIMPLEMENTED()                                                        \
-  FATAL("unimplemented code")
+#define UNIMPLEMENTED() FATAL("unimplemented code")
 
-#define UNREACHABLE()                                                          \
-  FATAL("unreachable code")
+#define UNREACHABLE() FATAL("unreachable code")
+
+#define OUT_OF_MEMORY() FATAL("Out of memory.")
 
 
 #if defined(DEBUG)
@@ -268,15 +264,16 @@
 
 // Returns 'ptr'; useful for initializer lists:
 //   class Foo { Foo(int* ptr) : ptr_(ASSERT_NOTNULL(ptr)) ...
-#define ASSERT_NOTNULL(ptr)                                                    \
-  dart::Assert(__FILE__, __LINE__).NotNull((ptr))
+#define ASSERT_NOTNULL(ptr) dart::Assert(__FILE__, __LINE__).NotNull((ptr))
 
 #else  // if defined(DEBUG)
 
 // In order to avoid variable unused warnings for code that only uses
 // a variable in an ASSERT or EXPECT, we make sure to use the macro
 // argument.
-#define ASSERT(condition) do {} while (false && (condition))
+#define ASSERT(condition)                                                      \
+  do {                                                                         \
+  } while (false && (condition))
 
 #define DEBUG_ASSERT(cond)
 
@@ -303,8 +300,7 @@
 //
 
 template <bool>
-struct CompileAssert {
-};
+struct CompileAssert {};
 // Macro to concatenate two tokens. The helper is need to proper expansion
 // in case an argument is a macro itself.
 #if !defined(COMPILE_ASSERT)
@@ -312,8 +308,8 @@
 #define COMPILE_ASSERT_JOIN_HELPER(a, b) a##b
 #define COMPILE_ASSERT(expr)                                                   \
   DART_UNUSED typedef CompileAssert<(static_cast<bool>(expr))>                 \
-  COMPILE_ASSERT_JOIN(CompileAssertTypeDef, __LINE__)[static_cast<bool>(expr)  \
-  ? 1 : -1]
+      COMPILE_ASSERT_JOIN(CompileAssertTypeDef,                                \
+                          __LINE__)[static_cast<bool>(expr) ? 1 : -1]
 #endif  // !defined(COMPILE_ASSERT)
 
 #if defined(TESTING)
@@ -358,18 +354,15 @@
 #define EXPECT_GE(left, right)                                                 \
   dart::Expect(__FILE__, __LINE__).GreaterEqual((left), (right))
 
-#define EXPECT_NOTNULL(ptr)                                                    \
-  dart::Expect(__FILE__, __LINE__).NotNull((ptr))
+#define EXPECT_NOTNULL(ptr) dart::Expect(__FILE__, __LINE__).NotNull((ptr))
 
-#define FAIL(error)                                                            \
-  dart::Expect(__FILE__, __LINE__).Fail("%s", error)
+#define FAIL(error) dart::Expect(__FILE__, __LINE__).Fail("%s", error)
 
-#define FAIL1(format, p1)                                                      \
-  dart::Expect(__FILE__, __LINE__).Fail(format, (p1))
+#define FAIL1(format, p1) dart::Expect(__FILE__, __LINE__).Fail(format, (p1))
 
 #define FAIL2(format, p1, p2)                                                  \
   dart::Expect(__FILE__, __LINE__).Fail(format, (p1), (p2))
 
 #endif  // defined(TESTING)
 
-#endif  // PLATFORM_ASSERT_H_
+#endif  // RUNTIME_PLATFORM_ASSERT_H_
diff --git a/runtime/platform/c99_support_win.h b/runtime/platform/c99_support_win.h
index c01c248..b7b625b 100644
--- a/runtime/platform/c99_support_win.h
+++ b/runtime/platform/c99_support_win.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef PLATFORM_C99_SUPPORT_WIN_H_
-#define PLATFORM_C99_SUPPORT_WIN_H_
+#ifndef RUNTIME_PLATFORM_C99_SUPPORT_WIN_H_
+#define RUNTIME_PLATFORM_C99_SUPPORT_WIN_H_
 
 #if defined(_MSC_VER) && (_MSC_VER < 1800)
 
@@ -21,11 +21,10 @@
 
 #ifndef va_copy
 #define va_copy(dst, src) (memmove(&(dst), &(src), sizeof(dst)))
-#endif  /* va_copy */
+#endif /* va_copy */
 
 
-#define NAN \
-    *reinterpret_cast<const double*>(&kQuietNaNMask)
+#define NAN *reinterpret_cast<const double*>(&kQuietNaNMask)
 
 namespace std {
 
@@ -79,4 +78,4 @@
 
 #endif
 
-#endif  // PLATFORM_C99_SUPPORT_WIN_H_
+#endif  // RUNTIME_PLATFORM_C99_SUPPORT_WIN_H_
diff --git a/runtime/platform/floating_point.h b/runtime/platform/floating_point.h
index 7adaa73..0d29a70 100644
--- a/runtime/platform/floating_point.h
+++ b/runtime/platform/floating_point.h
@@ -2,10 +2,14 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef PLATFORM_FLOATING_POINT_H_
-#define PLATFORM_FLOATING_POINT_H_
+#ifndef RUNTIME_PLATFORM_FLOATING_POINT_H_
+#define RUNTIME_PLATFORM_FLOATING_POINT_H_
 
-inline double fmod_ieee(double x, double y) { return fmod(x, y); }
-inline double atan2_ieee(double y, double x) { return atan2(y, x); }
+inline double fmod_ieee(double x, double y) {
+  return fmod(x, y);
+}
+inline double atan2_ieee(double y, double x) {
+  return atan2(y, x);
+}
 
-#endif  // PLATFORM_FLOATING_POINT_H_
+#endif  // RUNTIME_PLATFORM_FLOATING_POINT_H_
diff --git a/runtime/platform/floating_point_win.cc b/runtime/platform/floating_point_win.cc
index 009da2a..8863ec5 100644
--- a/runtime/platform/floating_point_win.cc
+++ b/runtime/platform/floating_point_win.cc
@@ -5,6 +5,8 @@
 #include "platform/globals.h"
 #if defined(TARGET_OS_WINDOWS)
 
+#include "platform/floating_point_win.h"
+
 #include <limits>  // NOLINT
 
 // Taken from third_party/v8/src/platform-win32.cc
@@ -36,9 +38,8 @@
     // Same is with index_y.
     int index_x = (cls_x & _FPCLASS_PINF) != 0 ? 0 : 1;
     int index_y = (cls_y & _FPCLASS_PINF) != 0 ? 0 : 1;
-    static double atans_at_infinities[2][2] =
-      { { atan2(1.,  1.), atan2(1.,  -1.) },
-        { atan2(-1., 1.), atan2(-1., -1.) } };
+    static double atans_at_infinities[2][2] = {
+        {atan2(1., 1.), atan2(1., -1.)}, {atan2(-1., 1.), atan2(-1., -1.)}};
     return atans_at_infinities[index_x][index_y];
   } else {
     return atan2(x, y);
diff --git a/runtime/platform/floating_point_win.h b/runtime/platform/floating_point_win.h
index a97051a..8fab8ae 100644
--- a/runtime/platform/floating_point_win.h
+++ b/runtime/platform/floating_point_win.h
@@ -2,10 +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.
 
-#ifndef PLATFORM_FLOATING_POINT_WIN_H_
-#define PLATFORM_FLOATING_POINT_WIN_H_
+#ifndef RUNTIME_PLATFORM_FLOATING_POINT_WIN_H_
+#define RUNTIME_PLATFORM_FLOATING_POINT_WIN_H_
 
 double atan2_ieee(double x, double y);
 double fmod_ieee(double x, double y);
 
-#endif  // PLATFORM_FLOATING_POINT_WIN_H_
+#endif  // RUNTIME_PLATFORM_FLOATING_POINT_WIN_H_
diff --git a/runtime/platform/globals.h b/runtime/platform/globals.h
index 114c47d..101200b 100644
--- a/runtime/platform/globals.h
+++ b/runtime/platform/globals.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef PLATFORM_GLOBALS_H_
-#define PLATFORM_GLOBALS_H_
+#ifndef RUNTIME_PLATFORM_GLOBALS_H_
+#define RUNTIME_PLATFORM_GLOBALS_H_
 
 // __STDC_FORMAT_MACROS has to be defined before including <inttypes.h> to
 // enable platform independent printf format specifiers.
@@ -128,20 +128,24 @@
 
 #if defined(PRODUCT)
 #define NOT_IN_PRODUCT(code)
-#define DEBUG_ONLY(code)
 #else  // defined(PRODUCT)
 #define NOT_IN_PRODUCT(code) code
+#endif  // defined(PRODUCT)
+
 #if defined(DEBUG)
 #define DEBUG_ONLY(code) code
 #else  // defined(DEBUG)
 #define DEBUG_ONLY(code)
 #endif  // defined(DEBUG)
-#endif  // defined(PRODUCT)
 
 #if defined(DART_PRECOMPILED_RUNTIME) && defined(DART_PRECOMPILER)
 #error DART_PRECOMPILED_RUNTIME and DART_PRECOMPILER are mutually exclusive
 #endif  // defined(DART_PRECOMPILED_RUNTIME) && defined(DART_PRECOMPILER)
 
+#if defined(DART_PRECOMPILED_RUNTIME) && defined(DART_NOSNAPSHOT)
+#error DART_PRECOMPILED_RUNTIME and DART_NOSNAPSHOT are mutually exclusive
+#endif  // defined(DART_PRECOMPILED_RUNTIME) && defined(DART_NOSNAPSHOT)
+
 #if defined(DART_PRECOMPILED_RUNTIME)
 #define NOT_IN_PRECOMPILED(code)
 #else
@@ -195,9 +199,7 @@
     v[0] = double_storage[0];
     v[1] = double_storage[1];
   }
-  void writeTo(simd128_value_t* v) {
-    *v = *this;
-  }
+  void writeTo(simd128_value_t* v) { *v = *this; }
 };
 
 // Processor architecture detection.  For more info on what's defined, see:
@@ -228,18 +230,17 @@
 typedef struct {
   union {
     uint32_t u;
-    float    f;
+    float f;
   } data_[4];
 } simd_value_t;
 typedef simd_value_t fpu_register_t;
-#define simd_value_safe_load(addr)                                             \
-  (*reinterpret_cast<simd_value_t *>(addr))
+#define simd_value_safe_load(addr) (*reinterpret_cast<simd_value_t*>(addr))
 #define simd_value_safe_store(addr, value)                                     \
   do {                                                                         \
-    reinterpret_cast<simd_value_t *>(addr)->data_[0] = value.data_[0];         \
-    reinterpret_cast<simd_value_t *>(addr)->data_[1] = value.data_[1];         \
-    reinterpret_cast<simd_value_t *>(addr)->data_[2] = value.data_[2];         \
-    reinterpret_cast<simd_value_t *>(addr)->data_[3] = value.data_[3];         \
+    reinterpret_cast<simd_value_t*>(addr)->data_[0] = value.data_[0];          \
+    reinterpret_cast<simd_value_t*>(addr)->data_[1] = value.data_[1];          \
+    reinterpret_cast<simd_value_t*>(addr)->data_[2] = value.data_[2];          \
+    reinterpret_cast<simd_value_t*>(addr)->data_[3] = value.data_[3];          \
   } while (0)
 
 #elif defined(__MIPSEL__)
@@ -298,6 +299,14 @@
 #error Automatic compiler detection failed.
 #endif
 
+#ifdef _MSC_VER
+#define DART_PRETTY_FUNCTION __FUNCSIG__
+#elif __GNUC__
+#define DART_PRETTY_FUNCTION __PRETTY_FUNCTION__
+#else
+#error Automatic compiler detection failed.
+#endif
+
 #if !defined(TARGET_ARCH_MIPS)
 #if !defined(TARGET_ARCH_ARM)
 #if !defined(TARGET_ARCH_X64)
@@ -327,14 +336,12 @@
 
 // Verify that host and target architectures match, we cannot
 // have a 64 bit Dart VM generating 32 bit code or vice-versa.
-#if defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM64)
+#if defined(TARGET_ARCH_X64) || defined(TARGET_ARCH_ARM64)
 #if !defined(ARCH_IS_64_BIT)
 #error Mismatched Host/Target architectures.
 #endif
-#elif defined(TARGET_ARCH_IA32) ||                                             \
-      defined(TARGET_ARCH_ARM) ||                                              \
-      defined(TARGET_ARCH_MIPS)
+#elif defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_ARM) ||                 \
+    defined(TARGET_ARCH_MIPS)
 #if !defined(ARCH_IS_32_BIT)
 #error Mismatched Host/Target architectures.
 #endif
@@ -342,9 +349,9 @@
 
 // Determine whether we will be using the simulator.
 #if defined(TARGET_ARCH_IA32)
-  // No simulator used.
+// No simulator used.
 #elif defined(TARGET_ARCH_X64)
-  // No simulator used.
+// No simulator used.
 #elif defined(TARGET_ARCH_ARM)
 #if !defined(HOST_ARCH_ARM)
 #define USING_SIMULATOR 1
@@ -421,7 +428,7 @@
 // Usage: instead of writing 0x1234567890123456ULL
 //      write DART_2PART_UINT64_C(0x12345678,90123456);
 #define DART_2PART_UINT64_C(a, b)                                              \
-                 (((static_cast<uint64_t>(a) << 32) + 0x##b##u))
+  (((static_cast<uint64_t>(a) << 32) + 0x##b##u))
 
 // Integer constants.
 const int32_t kMinInt32 = 0x80000000;
@@ -449,11 +456,11 @@
 // Byte sizes.
 const int kWordSize = sizeof(word);
 const int kDoubleSize = sizeof(double);  // NOLINT
-const int kFloatSize = sizeof(float);  // NOLINT
+const int kFloatSize = sizeof(float);    // NOLINT
 const int kQuadSize = 4 * kFloatSize;
 const int kSimd128Size = sizeof(simd128_value_t);  // NOLINT
-const int kInt32Size = sizeof(int32_t);  // NOLINT
-const int kInt16Size = sizeof(int16_t);  // NOLINT
+const int kInt32Size = sizeof(int32_t);            // NOLINT
+const int kInt16Size = sizeof(int16_t);            // NOLINT
 #ifdef ARCH_IS_32_BIT
 const int kWordSizeLog2 = 2;
 const uword kUwordMax = kMaxUint32;
@@ -502,13 +509,13 @@
 // Time constants.
 const int kMillisecondsPerSecond = 1000;
 const int kMicrosecondsPerMillisecond = 1000;
-const int kMicrosecondsPerSecond = (kMicrosecondsPerMillisecond *
-                                    kMillisecondsPerSecond);
+const int kMicrosecondsPerSecond =
+    (kMicrosecondsPerMillisecond * kMillisecondsPerSecond);
 const int kNanosecondsPerMicrosecond = 1000;
-const int kNanosecondsPerMillisecond = (kNanosecondsPerMicrosecond *
-                                        kMicrosecondsPerMillisecond);
-const int kNanosecondsPerSecond = (kNanosecondsPerMicrosecond *
-                                   kMicrosecondsPerSecond);
+const int kNanosecondsPerMillisecond =
+    (kNanosecondsPerMicrosecond * kMicrosecondsPerMillisecond);
+const int kNanosecondsPerSecond =
+    (kNanosecondsPerMicrosecond * kMicrosecondsPerSecond);
 
 // Helpers to scale micro second times to human understandable values.
 inline double MicrosecondsToSeconds(int64_t micros) {
@@ -522,7 +529,7 @@
 // This should be used in the private: declarations for a class.
 #if !defined(DISALLOW_COPY_AND_ASSIGN)
 #define DISALLOW_COPY_AND_ASSIGN(TypeName)                                     \
-private:                                                                       \
+ private:                                                                      \
   TypeName(const TypeName&);                                                   \
   void operator=(const TypeName&)
 #endif  // !defined(DISALLOW_COPY_AND_ASSIGN)
@@ -534,7 +541,7 @@
 // containing only static methods.
 #if !defined(DISALLOW_IMPLICIT_CONSTRUCTORS)
 #define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName)                               \
-private:                                                                       \
+ private:                                                                      \
   TypeName();                                                                  \
   DISALLOW_COPY_AND_ASSIGN(TypeName)
 #endif  // !defined(DISALLOW_IMPLICIT_CONSTRUCTORS)
@@ -545,19 +552,20 @@
 // platform/assert.h.
 #if !defined(DISALLOW_ALLOCATION)
 #define DISALLOW_ALLOCATION()                                                  \
-public:                                                                        \
+ public:                                                                       \
   void operator delete(void* pointer) {                                        \
     fprintf(stderr, "unreachable code\n");                                     \
     abort();                                                                   \
   }                                                                            \
-private:                                                                       \
+                                                                               \
+ private:                                                                      \
   void* operator new(size_t size);
 #endif  // !defined(DISALLOW_ALLOCATION)
 
 // The USE(x) template is used to silence C++ compiler warnings issued
 // for unused variables.
 template <typename T>
-static inline void USE(T) { }
+static inline void USE(T) {}
 
 
 // Use implicit_cast as a safe version of static_cast or const_cast
@@ -577,15 +585,15 @@
 // implicit_cast would have been part of the C++ standard library,
 // but the proposal was submitted too late.  It will probably make
 // its way into the language in the future.
-template<typename To, typename From>
-inline To implicit_cast(From const &f) {
+template <typename To, typename From>
+inline To implicit_cast(From const& f) {
   return f;
 }
 
 
 // Use like this: down_cast<T*>(foo);
-template<typename To, typename From>  // use like this: down_cast<T*>(foo);
-inline To down_cast(From* f) {  // so we only accept pointers
+template <typename To, typename From>  // use like this: down_cast<T*>(foo);
+inline To down_cast(From* f) {         // so we only accept pointers
   // Ensures that To is a sub-type of From *.  This test is here only
   // for compile-time type checking, and has no overhead in an
   // optimized build at run-time, as it will be optimized away completely.
@@ -639,12 +647,11 @@
 // optimizations of GCC 4.4. Basically, GCC mindlessly relies on
 // obscure details in the C++ standard that make reinterpret_cast
 // virtually useless.
-template<class D, class S>
+template <class D, class S>
 inline D bit_copy(const S& source) {
   D destination;
   // This use of memcpy is safe: source and destination cannot overlap.
-  memcpy(&destination,
-         reinterpret_cast<const void*>(&source),
+  memcpy(&destination, reinterpret_cast<const void*>(&source),
          sizeof(destination));
   return destination;
 }
@@ -683,7 +690,7 @@
 // N.B.: As the GCC manual states, "[s]ince non-static C++ methods
 // have an implicit 'this' argument, the arguments of such methods
 // should be counted from two, not one."
-#define PRINTF_ATTRIBUTE(string_index, first_to_check) \
+#define PRINTF_ATTRIBUTE(string_index, first_to_check)                         \
   __attribute__((__format__(__printf__, string_index, first_to_check)))
 #else
 #define PRINTF_ATTRIBUTE(string_index, first_to_check)
@@ -705,4 +712,4 @@
 
 }  // namespace dart
 
-#endif  // PLATFORM_GLOBALS_H_
+#endif  // RUNTIME_PLATFORM_GLOBALS_H_
diff --git a/runtime/platform/hashmap.cc b/runtime/platform/hashmap.cc
index 34f7ea1..4611533 100644
--- a/runtime/platform/hashmap.cc
+++ b/runtime/platform/hashmap.cc
@@ -166,9 +166,7 @@
   ASSERT(dart::Utils::IsPowerOfTwo(capacity));
   map_ = new Entry[capacity];
   if (map_ == NULL) {
-    // TODO(sgjesse): Handle out of memory.
-    FATAL("Cannot allocate memory for hashmap");
-    return;
+    OUT_OF_MEMORY();
   }
   capacity_ = capacity;
   occupancy_ = 0;
diff --git a/runtime/platform/hashmap.h b/runtime/platform/hashmap.h
index 185c75f..1fd1235 100644
--- a/runtime/platform/hashmap.h
+++ b/runtime/platform/hashmap.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef PLATFORM_HASHMAP_H_
-#define PLATFORM_HASHMAP_H_
+#ifndef RUNTIME_PLATFORM_HASHMAP_H_
+#define RUNTIME_PLATFORM_HASHMAP_H_
 
 #include "platform/globals.h"
 
@@ -11,9 +11,9 @@
 
 class HashMap {
  public:
-  typedef bool (*MatchFun) (void* key1, void* key2);
+  typedef bool (*MatchFun)(void* key1, void* key2);
 
-  typedef void (*ClearFun) (void* value);
+  typedef void (*ClearFun)(void* value);
 
   // initial_capacity is the size of the initial hash map;
   // it must be a power of 2 (and thus must not be 0).
@@ -21,9 +21,7 @@
 
   ~HashMap();
 
-  static bool SamePointerValue(void* key1, void* key2) {
-    return key1 == key2;
-  }
+  static bool SamePointerValue(void* key1, void* key2) { return key1 == key2; }
 
   static uint32_t StringHash(char* key) {
     uint32_t hash_ = 0;
@@ -105,4 +103,4 @@
 
 }  // namespace dart
 
-#endif  // PLATFORM_HASHMAP_H_
+#endif  // RUNTIME_PLATFORM_HASHMAP_H_
diff --git a/runtime/platform/inttypes_support_win.h b/runtime/platform/inttypes_support_win.h
index 34d83a4..06d4053 100644
--- a/runtime/platform/inttypes_support_win.h
+++ b/runtime/platform/inttypes_support_win.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef PLATFORM_INTTYPES_SUPPORT_WIN_H_
-#define PLATFORM_INTTYPES_SUPPORT_WIN_H_
+#ifndef RUNTIME_PLATFORM_INTTYPES_SUPPORT_WIN_H_
+#define RUNTIME_PLATFORM_INTTYPES_SUPPORT_WIN_H_
 
 typedef signed __int8 int8_t;
 typedef signed __int16 int16_t;
@@ -24,4 +24,4 @@
 #define PRIu64 "I64u"
 #define PRIx64 "I64x"
 
-#endif  // PLATFORM_INTTYPES_SUPPORT_WIN_H_
+#endif  // RUNTIME_PLATFORM_INTTYPES_SUPPORT_WIN_H_
diff --git a/runtime/platform/math.h b/runtime/platform/math.h
index 0dc34008..1edf3e3 100644
--- a/runtime/platform/math.h
+++ b/runtime/platform/math.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef PLATFORM_MATH_H_
-#define PLATFORM_MATH_H_
+#ifndef RUNTIME_PLATFORM_MATH_H_
+#define RUNTIME_PLATFORM_MATH_H_
 
 // We must take these math functions from the C++ header file as long as we
 // are using the STL. Otherwise the Android build will break due to confusion
@@ -20,4 +20,4 @@
 #include <math.h>
 #endif
 
-#endif  // PLATFORM_MATH_H_
+#endif  // RUNTIME_PLATFORM_MATH_H_
diff --git a/runtime/platform/memory_sanitizer.h b/runtime/platform/memory_sanitizer.h
index b9bd059..27cb25d 100644
--- a/runtime/platform/memory_sanitizer.h
+++ b/runtime/platform/memory_sanitizer.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef PLATFORM_MEMORY_SANITIZER_H_
-#define PLATFORM_MEMORY_SANITIZER_H_
+#ifndef RUNTIME_PLATFORM_MEMORY_SANITIZER_H_
+#define RUNTIME_PLATFORM_MEMORY_SANITIZER_H_
 
 #include "platform/globals.h"
 
@@ -11,13 +11,20 @@
 // told about areas that are initialized by generated code.
 #if defined(__has_feature)
 #if __has_feature(memory_sanitizer)
-extern "C" void __msan_unpoison(void *, size_t);
+extern "C" void __msan_unpoison(void*, size_t);
 #define MSAN_UNPOISON(ptr, len) __msan_unpoison(ptr, len)
+#define NO_SANITIZE_MEMORY __attribute__((no_sanitize_memory))
 #else  // __has_feature(memory_sanitizer)
-#define MSAN_UNPOISON(ptr, len) do {} while (false && (ptr) == 0 && (len) == 0)
+#define MSAN_UNPOISON(ptr, len)                                                \
+  do {                                                                         \
+  } while (false && (ptr) == 0 && (len) == 0)
+#define NO_SANITIZE_MEMORY
 #endif  // __has_feature(memory_sanitizer)
-#else  // defined(__has_feature)
-#define MSAN_UNPOISON(ptr, len) do {} while (false && (ptr) == 0 && (len) == 0)
+#else   // defined(__has_feature)
+#define MSAN_UNPOISON(ptr, len)                                                \
+  do {                                                                         \
+  } while (false && (ptr) == 0 && (len) == 0)
+#define NO_SANITIZE_MEMORY
 #endif  // defined(__has_feature)
 
-#endif  // PLATFORM_MEMORY_SANITIZER_H_
+#endif  // RUNTIME_PLATFORM_MEMORY_SANITIZER_H_
diff --git a/runtime/platform/signal_blocker.h b/runtime/platform/signal_blocker.h
index 45d09aa..2afe49f 100644
--- a/runtime/platform/signal_blocker.h
+++ b/runtime/platform/signal_blocker.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef PLATFORM_SIGNAL_BLOCKER_H_
-#define PLATFORM_SIGNAL_BLOCKER_H_
+#ifndef RUNTIME_PLATFORM_SIGNAL_BLOCKER_H_
+#define RUNTIME_PLATFORM_SIGNAL_BLOCKER_H_
 
 #include "platform/globals.h"
 #include "platform/assert.h"
@@ -57,52 +57,60 @@
 // errors (type long int changed to intptr_t and do/while split on
 // separate lines with body in {}s) and to also block signals.
 #define TEMP_FAILURE_RETRY(expression)                                         \
-    ({ ThreadSignalBlocker tsb(SIGPROF);                                       \
-       intptr_t __result;                                                      \
-       do {                                                                    \
-         __result = (expression);                                              \
-       } while ((__result == -1L) && (errno == EINTR));                        \
-       __result; })
+  ({                                                                           \
+    ThreadSignalBlocker tsb(SIGPROF);                                          \
+    intptr_t __result;                                                         \
+    do {                                                                       \
+      __result = (expression);                                                 \
+    } while ((__result == -1L) && (errno == EINTR));                           \
+    __result;                                                                  \
+  })
 
 // This is a version of TEMP_FAILURE_RETRY which does not use the value
 // returned from the expression.
 #define VOID_TEMP_FAILURE_RETRY(expression)                                    \
-    (static_cast<void>(TEMP_FAILURE_RETRY(expression)))
+  (static_cast<void>(TEMP_FAILURE_RETRY(expression)))
 
 // This macro can be used to insert checks that a call is made, that
 // was expected to not return EINTR, but did it anyway.
 #define NO_RETRY_EXPECTED(expression)                                          \
-    ({ intptr_t __result = (expression);                                       \
-       if (__result == -1L && errno == EINTR) {                                \
-         FATAL("Unexpected EINTR errno");                                      \
-       }                                                                       \
-       __result; })
+  ({                                                                           \
+    intptr_t __result = (expression);                                          \
+    if (__result == -1L && errno == EINTR) {                                   \
+      FATAL("Unexpected EINTR errno");                                         \
+    }                                                                          \
+    __result;                                                                  \
+  })
 
 #define VOID_NO_RETRY_EXPECTED(expression)                                     \
-    (static_cast<void>(NO_RETRY_EXPECTED(expression)))
+  (static_cast<void>(NO_RETRY_EXPECTED(expression)))
 
 // Define to check in debug mode, if a signal is currently being blocked.
 #define CHECK_IS_BLOCKING(signal)                                              \
-    ({ sigset_t signal_mask;                                                   \
-       int __r = pthread_sigmask(SIG_BLOCK, NULL, &signal_mask);               \
-       USE(__r);                                                               \
-       ASSERT(__r == 0);                                                       \
-       sigismember(&signal_mask, signal); })                                   \
+  ({                                                                           \
+    sigset_t signal_mask;                                                      \
+    int __r = pthread_sigmask(SIG_BLOCK, NULL, &signal_mask);                  \
+    USE(__r);                                                                  \
+    ASSERT(__r == 0);                                                          \
+    sigismember(&signal_mask, signal);                                         \
+  })
 
 
 // Versions of the above, that does not enter a signal blocking scope. Use only
 // when a signal blocking scope is entered manually.
 #define TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(expression)                       \
-    ({ intptr_t __result;                                                      \
-       ASSERT(CHECK_IS_BLOCKING(SIGPROF));                                     \
-       do {                                                                    \
-         __result = (expression);                                              \
-       } while ((__result == -1L) && (errno == EINTR));                        \
-       __result; })
+  ({                                                                           \
+    intptr_t __result;                                                         \
+    ASSERT(CHECK_IS_BLOCKING(SIGPROF));                                        \
+    do {                                                                       \
+      __result = (expression);                                                 \
+    } while ((__result == -1L) && (errno == EINTR));                           \
+    __result;                                                                  \
+  })
 
 #define VOID_TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(expression)                  \
-    (static_cast<void>(TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(expression)))
+  (static_cast<void>(TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(expression)))
 
 }  // namespace dart
 
-#endif  // PLATFORM_SIGNAL_BLOCKER_H_
+#endif  // RUNTIME_PLATFORM_SIGNAL_BLOCKER_H_
diff --git a/runtime/platform/text_buffer.cc b/runtime/platform/text_buffer.cc
index 44152e6..b44ed69 100644
--- a/runtime/platform/text_buffer.cc
+++ b/runtime/platform/text_buffer.cc
@@ -15,6 +15,9 @@
 TextBuffer::TextBuffer(intptr_t buf_size) {
   ASSERT(buf_size > 0);
   buf_ = reinterpret_cast<char*>(malloc(buf_size));
+  if (buf_ == NULL) {
+    OUT_OF_MEMORY();
+  }
   buf_size_ = buf_size;
   Clear();
 }
@@ -49,8 +52,7 @@
 }
 
 
-void TextBuffer::AddRaw(const uint8_t* buffer,
-                        intptr_t buffer_length) {
+void TextBuffer::AddRaw(const uint8_t* buffer, intptr_t buffer_length) {
   EnsureCapacity(buffer_length);
   memmove(&buf_[msg_len_], buffer, buffer_length);
   msg_len_ += buffer_length;
@@ -152,7 +154,9 @@
     // the debugger front-end.
     intptr_t new_size = buf_size_ + len + kBufferSpareCapacity;
     char* new_buf = reinterpret_cast<char*>(realloc(buf_, new_size));
-    ASSERT(new_buf != NULL);
+    if (new_buf == NULL) {
+      OUT_OF_MEMORY();
+    }
     buf_ = new_buf;
     buf_size_ = new_size;
   }
diff --git a/runtime/platform/text_buffer.h b/runtime/platform/text_buffer.h
index 973ca7e..a9b5326 100644
--- a/runtime/platform/text_buffer.h
+++ b/runtime/platform/text_buffer.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef PLATFORM_TEXT_BUFFER_H_
-#define PLATFORM_TEXT_BUFFER_H_
+#ifndef RUNTIME_PLATFORM_TEXT_BUFFER_H_
+#define RUNTIME_PLATFORM_TEXT_BUFFER_H_
 
 #include "vm/allocation.h"
 #include "vm/globals.h"
@@ -24,8 +24,7 @@
   void EscapeAndAddCodeUnit(uint32_t cu);
   void AddString(const char* s);
   void AddEscapedString(const char* s);
-  void AddRaw(const uint8_t* buffer,
-              intptr_t buffer_length);
+  void AddRaw(const uint8_t* buffer, intptr_t buffer_length);
 
   void Clear();
 
@@ -45,4 +44,4 @@
 
 }  // namespace dart
 
-#endif  // PLATFORM_TEXT_BUFFER_H_
+#endif  // RUNTIME_PLATFORM_TEXT_BUFFER_H_
diff --git a/runtime/platform/utils.cc b/runtime/platform/utils.cc
index 7778390..0dde3c7 100644
--- a/runtime/platform/utils.cc
+++ b/runtime/platform/utils.cc
@@ -39,11 +39,26 @@
   uint64_t x = static_cast<uint64_t>((v > 0) ? v : -v);
   uint64_t t;
   int r = 0;
-  if ((t = x >> 32) != 0) { x = t; r += 32; }
-  if ((t = x >> 16) != 0) { x = t; r += 16; }
-  if ((t = x >> 8) != 0) { x = t; r += 8; }
-  if ((t = x >> 4) != 0) { x = t; r += 4; }
-  if ((t = x >> 2) != 0) { x = t; r += 2; }
+  if ((t = x >> 32) != 0) {
+    x = t;
+    r += 32;
+  }
+  if ((t = x >> 16) != 0) {
+    x = t;
+    r += 16;
+  }
+  if ((t = x >> 8) != 0) {
+    x = t;
+    r += 8;
+  }
+  if ((t = x >> 4) != 0) {
+    x = t;
+    r += 4;
+  }
+  if ((t = x >> 2) != 0) {
+    x = t;
+    r += 2;
+  }
   if (x > 1) r += 1;
   return r;
 }
diff --git a/runtime/platform/utils.h b/runtime/platform/utils.h
index 65bc14f..911cf50 100644
--- a/runtime/platform/utils.h
+++ b/runtime/platform/utils.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef PLATFORM_UTILS_H_
-#define PLATFORM_UTILS_H_
+#ifndef RUNTIME_PLATFORM_UTILS_H_
+#define RUNTIME_PLATFORM_UTILS_H_
 
 #include "platform/assert.h"
 #include "platform/globals.h"
@@ -12,28 +12,28 @@
 
 class Utils {
  public:
-  template<typename T>
+  template <typename T>
   static inline T Minimum(T x, T y) {
     return x < y ? x : y;
   }
 
-  template<typename T>
+  template <typename T>
   static inline T Maximum(T x, T y) {
     return x > y ? x : y;
   }
 
-  template<typename T>
+  template <typename T>
   static inline T Abs(T x) {
     if (x < 0) return -x;
     return x;
   }
 
-  template<typename T>
+  template <typename T>
   static inline bool IsPowerOfTwo(T x) {
     return ((x & (x - 1)) == 0) && (x != 0);
   }
 
-  template<typename T>
+  template <typename T>
   static inline int ShiftForPowerOfTwo(T x) {
     ASSERT(IsPowerOfTwo(x));
     int num_shifts = 0;
@@ -44,34 +44,34 @@
     return num_shifts;
   }
 
-  template<typename T>
+  template <typename T>
   static inline bool IsAligned(T x, intptr_t n) {
     ASSERT(IsPowerOfTwo(n));
     return (x & (n - 1)) == 0;
   }
 
-  template<typename T>
+  template <typename T>
   static inline bool IsAligned(T* x, intptr_t n) {
     return IsAligned(reinterpret_cast<uword>(x), n);
   }
 
-  template<typename T>
+  template <typename T>
   static inline T RoundDown(T x, intptr_t n) {
     ASSERT(IsPowerOfTwo(n));
     return (x & -n);
   }
 
-  template<typename T>
+  template <typename T>
   static inline T* RoundDown(T* x, intptr_t n) {
     return reinterpret_cast<T*>(RoundDown(reinterpret_cast<uword>(x), n));
   }
 
-  template<typename T>
+  template <typename T>
   static inline T RoundUp(T x, intptr_t n) {
     return RoundDown(x + n - 1, n);
   }
 
-  template<typename T>
+  template <typename T>
   static inline T* RoundUp(T* x, intptr_t n) {
     return reinterpret_cast<T*>(RoundUp(reinterpret_cast<uword>(x), n));
   }
@@ -97,7 +97,7 @@
   static uint32_t WordHash(intptr_t key);
 
   // Check whether an N-bit two's-complement representation can hold value.
-  template<typename T>
+  template <typename T>
   static inline bool IsInt(int N, T value) {
     ASSERT((0 < N) &&
            (static_cast<unsigned int>(N) < (kBitsPerByte * sizeof(value))));
@@ -105,7 +105,7 @@
     return (-limit <= value) && (value < limit);
   }
 
-  template<typename T>
+  template <typename T>
   static inline bool IsUint(int N, T value) {
     ASSERT((0 < N) &&
            (static_cast<unsigned int>(N) < (kBitsPerByte * sizeof(value))));
@@ -115,7 +115,7 @@
 
   // Check whether the magnitude of value fits in N bits, i.e., whether an
   // (N+1)-bit sign-magnitude representation can hold value.
-  template<typename T>
+  template <typename T>
   static inline bool IsAbsoluteUint(int N, T value) {
     ASSERT((0 < N) &&
            (static_cast<unsigned int>(N) < (kBitsPerByte * sizeof(value))));
@@ -143,14 +143,11 @@
     return (static_cast<int64_t>(high) << 32) | (low & 0x0ffffffffLL);
   }
 
-  static bool IsDecimalDigit(char c) {
-    return ('0' <= c) && (c <= '9');
-  }
+  static bool IsDecimalDigit(char c) { return ('0' <= c) && (c <= '9'); }
 
   static bool IsHexDigit(char c) {
-    return IsDecimalDigit(c)
-          || (('A' <= c) && (c <= 'F'))
-          || (('a' <= c) && (c <= 'f'));
+    return IsDecimalDigit(c) || (('A' <= c) && (c <= 'F')) ||
+           (('a' <= c) && (c <= 'f'));
   }
 
   static int HexDigitToInt(char c) {
@@ -172,9 +169,7 @@
   static inline bool RangeCheck(intptr_t offset,
                                 intptr_t count,
                                 intptr_t length) {
-    return offset >= 0 &&
-           count >= 0 &&
-           length >= 0 &&
+    return offset >= 0 && count >= 0 && length >= 0 &&
            count <= (length - offset);
   }
 
@@ -227,4 +222,4 @@
 #error Unknown target os.
 #endif
 
-#endif  // PLATFORM_UTILS_H_
+#endif  // RUNTIME_PLATFORM_UTILS_H_
diff --git a/runtime/platform/utils_android.h b/runtime/platform/utils_android.h
index 7709442..4bd2a38 100644
--- a/runtime/platform/utils_android.h
+++ b/runtime/platform/utils_android.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef PLATFORM_UTILS_ANDROID_H_
-#define PLATFORM_UTILS_ANDROID_H_
+#ifndef RUNTIME_PLATFORM_UTILS_ANDROID_H_
+#define RUNTIME_PLATFORM_UTILS_ANDROID_H_
 
 #include <endian.h>  // NOLINT
 
@@ -69,4 +69,4 @@
 
 }  // namespace dart
 
-#endif  // PLATFORM_UTILS_ANDROID_H_
+#endif  // RUNTIME_PLATFORM_UTILS_ANDROID_H_
diff --git a/runtime/platform/utils_fuchsia.h b/runtime/platform/utils_fuchsia.h
index 4e8c4e9..4143daf 100644
--- a/runtime/platform/utils_fuchsia.h
+++ b/runtime/platform/utils_fuchsia.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef PLATFORM_UTILS_FUCHSIA_H_
-#define PLATFORM_UTILS_FUCHSIA_H_
+#ifndef RUNTIME_PLATFORM_UTILS_FUCHSIA_H_
+#define RUNTIME_PLATFORM_UTILS_FUCHSIA_H_
 
 #include <endian.h>
 
@@ -62,10 +62,12 @@
 
 
 inline char* Utils::StrError(int err, char* buffer, size_t bufsize) {
-  snprintf(buffer, bufsize, "errno = %d", err);
+  if (strerror_r(err, buffer, bufsize) != 0) {
+    snprintf(buffer, bufsize, "%s", "strerror_r failed");
+  }
   return buffer;
 }
 
 }  // namespace dart
 
-#endif  // PLATFORM_UTILS_FUCHSIA_H_
+#endif  // RUNTIME_PLATFORM_UTILS_FUCHSIA_H_
diff --git a/runtime/platform/utils_linux.h b/runtime/platform/utils_linux.h
index bb9594f..b5214fd 100644
--- a/runtime/platform/utils_linux.h
+++ b/runtime/platform/utils_linux.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef PLATFORM_UTILS_LINUX_H_
-#define PLATFORM_UTILS_LINUX_H_
+#ifndef RUNTIME_PLATFORM_UTILS_LINUX_H_
+#define RUNTIME_PLATFORM_UTILS_LINUX_H_
 
 #include <endian.h>  // NOLINT
 
@@ -62,8 +62,8 @@
 
 
 inline char* Utils::StrError(int err, char* buffer, size_t bufsize) {
-#if !defined(__GLIBC__) ||                                              \
-((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE)
+#if !defined(__GLIBC__) ||                                                     \
+    ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE)
   // Use the XSI version.
   if (strerror_r(err, buffer, bufsize) != 0) {
     snprintf(buffer, bufsize, "%s", "strerror_r failed");
@@ -77,4 +77,4 @@
 
 }  // namespace dart
 
-#endif  // PLATFORM_UTILS_LINUX_H_
+#endif  // RUNTIME_PLATFORM_UTILS_LINUX_H_
diff --git a/runtime/platform/utils_macos.h b/runtime/platform/utils_macos.h
index 7c2a966..2a8e39f 100644
--- a/runtime/platform/utils_macos.h
+++ b/runtime/platform/utils_macos.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef PLATFORM_UTILS_MACOS_H_
-#define PLATFORM_UTILS_MACOS_H_
+#ifndef RUNTIME_PLATFORM_UTILS_MACOS_H_
+#define RUNTIME_PLATFORM_UTILS_MACOS_H_
 
 #include <libkern/OSByteOrder.h>  // NOLINT
 
@@ -69,4 +69,4 @@
 
 }  // namespace dart
 
-#endif  // PLATFORM_UTILS_MACOS_H_
+#endif  // RUNTIME_PLATFORM_UTILS_MACOS_H_
diff --git a/runtime/platform/utils_win.h b/runtime/platform/utils_win.h
index 7d7b96e..92b7f98 100644
--- a/runtime/platform/utils_win.h
+++ b/runtime/platform/utils_win.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef PLATFORM_UTILS_WIN_H_
-#define PLATFORM_UTILS_WIN_H_
+#ifndef RUNTIME_PLATFORM_UTILS_WIN_H_
+#define RUNTIME_PLATFORM_UTILS_WIN_H_
 
 #include <intrin.h>
 #include <stdlib.h>
@@ -67,4 +67,4 @@
 
 }  // namespace dart
 
-#endif  // PLATFORM_UTILS_WIN_H_
+#endif  // RUNTIME_PLATFORM_UTILS_WIN_H_
diff --git a/runtime/tests/vm/dart/hello_fuchsia_test.dart b/runtime/tests/vm/dart/hello_fuchsia_test.dart
index 501ffe7..35f2cef3 100644
--- a/runtime/tests/vm/dart/hello_fuchsia_test.dart
+++ b/runtime/tests/vm/dart/hello_fuchsia_test.dart
@@ -2,6 +2,412 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-main() {
+import "dart:async";
+import "dart:io";
+
+testAddressParse() async {
+  print(new InternetAddress("1.0.2.3").rawAddress);
+  print(new InternetAddress("1.0.2.3").type);
+
+  print(new InternetAddress("::1").rawAddress);
+  print(new InternetAddress("::1").type);
+
+  try {
+    print(new InternetAddress("localhost"));
+  } catch (e) {
+    print(e);
+  }
+}
+
+testSimpleBind() async {
+  var s = await RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0);
+  print("port = ${s.port}");
+  await s.close();
+}
+
+testSimpleConnect() async {
+  var server = await RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0);
+  print("server port = ${server.port}");
+  server.listen((socket) {
+    print("listen socket port = ${socket.port}");
+    socket.close();
+  });
+  var socket = await RawSocket.connect("127.0.0.1", server.port);
+  print("socket port = ${socket.port}");
+  if (socket.remoteAddress.address != "127.0.0.1" ||
+      socket.remoteAddress.type != InternetAddressType.IP_V4) {
+    throw "Bad remote address ${socket.remoteAddress}";
+  }
+  if (socket.remotePort is! int) {
+    throw "Bad remote port ${socket.remotePort}";
+  }
+  await server.close();
+  await socket.close();
+}
+
+testSimpleReadWriteClose() async {
+  // This test creates a server and a client connects. The client then
+  // writes and the server echos. When the client finishes fully reading the
+  // echo, it closes the socket. When the server receives the close event, it
+  // closes its end of the socket too.
+
+  const messageSize = 1000;
+  int serverReadCount = 0;
+  int clientReadCount = 0;
+
+  List<int> createTestData() {
+    return new List<int>.generate(messageSize, (index) => index & 0xff);
+  }
+
+  void verifyTestData(List<int> data) {
+    assert(messageSize == data.length);
+    List<int> expected = createTestData();
+    for (int i = 0; i < messageSize; i++) {
+      assert(expected[i] == data[i]);
+    }
+  }
+
+  var server = await RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0);
+  server.listen((client) {
+    int bytesRead = 0;
+    int bytesWritten = 0;
+    bool closedEventReceived = false;
+    List<int> data = new List<int>(messageSize);
+    bool doneReading = false;
+
+    client.writeEventsEnabled = false;
+    client.listen((event) {
+      switch (event) {
+        case RawSocketEvent.READ:
+          if (doneReading) {
+            break;
+          }
+          print("client READ event bytesRead = $bytesRead");
+          assert(bytesWritten == 0);
+          assert(client.available() > 0);
+          var buffer = client.read(200);
+          print("client READ event: read ${buffer.length} more bytes");
+          data.setRange(bytesRead, bytesRead + buffer.length, buffer);
+          bytesRead += buffer.length;
+          if (bytesRead == data.length) {
+            verifyTestData(data);
+            print("client READ event. Done reading, enabling writes");
+            client.writeEventsEnabled = true;
+            doneReading = true;
+          }
+          break;
+        case RawSocketEvent.WRITE:
+          assert(!client.writeEventsEnabled);
+          bytesWritten += client.write(
+              data, bytesWritten, data.length - bytesWritten);
+          print("client WRITE event: $bytesWritten written");
+          if (bytesWritten < data.length) {
+            client.writeEventsEnabled = true;
+          }
+          if (bytesWritten == data.length) {
+            print("client WRITE event: done writing.");
+          }
+          break;
+        case RawSocketEvent.READ_CLOSED:
+          print("client READ_CLOSED event");
+          client.close();
+          server.close();
+          break;
+        case RawSocketEvent.CLOSED:
+          assert(!closedEventReceived);
+          print("client CLOSED event");
+          closedEventReceived = true;
+          break;
+        default: throw "Unexpected event $event";
+      }
+    },
+    onError: (e) { print("client ERROR $e"); },
+    onDone: () {assert(closedEventReceived);});
+  });
+
+  {
+    var completer = new Completer();
+    var socket = await RawSocket.connect("127.0.0.1", server.port);
+    int bytesRead = 0;
+    int bytesWritten = 0;
+    bool closedEventReceived = false;
+    List<int> data = createTestData();
+
+    socket.listen((event) {
+      switch (event) {
+        case RawSocketEvent.READ:
+          assert(socket.available() > 0);
+          print("server READ event: ${bytesRead} read");
+          var buffer = socket.read();
+          print("server READ event: read ${buffer.length} more bytes");
+          data.setRange(bytesRead, bytesRead + buffer.length, buffer);
+          bytesRead += buffer.length;
+          if (bytesRead == messageSize) {
+            print("server READ event: done reading");
+            socket.close();
+          }
+          break;
+        case RawSocketEvent.WRITE:
+          assert(bytesRead == 0);
+          assert(!socket.writeEventsEnabled);
+          bytesWritten += socket.write(
+              data, bytesWritten, data.length - bytesWritten);
+          print("server WRITE event: ${bytesWritten} written");
+          if (bytesWritten < data.length) {
+            socket.writeEventsEnabled = true;
+          } else {
+            print("server WRITE event: done writing");
+            data = new List<int>(messageSize);
+          }
+          break;
+        case RawSocketEvent.READ_CLOSED:
+          print("server READ_CLOSED event");
+          verifyTestData(data);
+          socket.close();
+          break;
+        case RawSocketEvent.CLOSED:
+          assert(!closedEventReceived);
+          print("server CLOSED event");
+          closedEventReceived = true;
+          break;
+        default: throw "Unexpected event $event";
+      }
+    },
+    onError: (e) { print("server ERROR $e"); },
+    onDone: () {
+      assert(closedEventReceived);
+      completer.complete(null);
+    });
+
+    return completer.future;
+  }
+}
+
+testSimpleReadWriteShutdown({bool dropReads}) async {
+  // This test creates a server and a client connects. The client then
+  // writes and the server echos. When the server has finished its
+  // echo it half-closes. When the client gets the close event is
+  // closes fully.
+
+  const messageSize = 1000;
+  int serverReadCount = 0;
+  int clientReadCount = 0;
+
+  List<int> createTestData() {
+    return new List<int>.generate(messageSize, (index) => index & 0xff);
+  }
+
+  void verifyTestData(List<int> data) {
+    assert(messageSize == data.length);
+    List<int> expected = createTestData();
+    for (int i = 0; i < messageSize; i++) {
+      assert(expected[i] == data[i]);
+    }
+  }
+
+  var server = await RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0);
+  server.listen((client) {
+    int bytesRead = 0;
+    int bytesWritten = 0;
+    bool closedEventReceived = false;
+    List<int> data = new List<int>(messageSize);
+    bool doneReading = false;
+
+    client.writeEventsEnabled = false;
+    client.listen((event) {
+      switch (event) {
+        case RawSocketEvent.READ:
+          if (doneReading) {
+            break;
+          }
+          if (dropReads) {
+            if (serverReadCount != 10) {
+              serverReadCount++;
+              break;
+            } else {
+              serverReadCount = 0;
+            }
+          }
+          print("client READ event bytesRead = $bytesRead");
+          assert(bytesWritten == 0);
+          assert(client.available() > 0);
+          var buffer = client.read(200);
+          print("client READ event: read ${buffer.length} more bytes");
+          data.setRange(bytesRead, bytesRead + buffer.length, buffer);
+          bytesRead += buffer.length;
+          if (bytesRead == data.length) {
+            verifyTestData(data);
+            print("client READ event. Done reading, enabling writes");
+            client.writeEventsEnabled = true;
+            doneReading = true;
+          }
+          break;
+        case RawSocketEvent.WRITE:
+          assert(!client.writeEventsEnabled);
+          bytesWritten += client.write(
+              data, bytesWritten, data.length - bytesWritten);
+          print("client WRITE event: $bytesWritten written");
+          if (bytesWritten < data.length) {
+            client.writeEventsEnabled = true;
+          }
+          if (bytesWritten == data.length) {
+            print("client WRITE event: done writing.");
+            client.shutdown(SocketDirection.SEND);
+          }
+          break;
+        case RawSocketEvent.READ_CLOSED:
+          print("client READ_CLOSED event");
+          server.close();
+          break;
+        case RawSocketEvent.CLOSED:
+          assert(!closedEventReceived);
+          print("client CLOSED event");
+          closedEventReceived = true;
+          break;
+        default: throw "Unexpected event $event";
+      }
+    },
+    onDone: () {assert(closedEventReceived);});
+  });
+
+  {
+    var completer = new Completer();
+    var socket = await RawSocket.connect("127.0.0.1", server.port);
+    int bytesRead = 0;
+    int bytesWritten = 0;
+    bool closedEventReceived = false;
+    List<int> data = createTestData();
+
+    socket.listen((event) {
+      switch (event) {
+        case RawSocketEvent.READ:
+          assert(socket.available() > 0);
+          if (dropReads) {
+            if (clientReadCount != 10) {
+              clientReadCount++;
+              break;
+            } else {
+              clientReadCount = 0;
+            }
+          }
+          print("server READ event: ${bytesRead} read");
+          var buffer = socket.read();
+          print("server READ event: read ${buffer.length} more bytes");
+          data.setRange(bytesRead, bytesRead + buffer.length, buffer);
+          bytesRead += buffer.length;
+          break;
+        case RawSocketEvent.WRITE:
+          assert(bytesRead == 0);
+          assert(!socket.writeEventsEnabled);
+          bytesWritten += socket.write(
+              data, bytesWritten, data.length - bytesWritten);
+          print("server WRITE event: ${bytesWritten} written");
+          if (bytesWritten < data.length) {
+            socket.writeEventsEnabled = true;
+          } else {
+            print("server WRITE event: done writing");
+            data = new List<int>(messageSize);
+          }
+          break;
+        case RawSocketEvent.READ_CLOSED:
+          print("server READ_CLOSED event");
+          verifyTestData(data);
+          socket.close();
+          break;
+        case RawSocketEvent.CLOSED:
+          assert(!closedEventReceived);
+          print("server CLOSED event");
+          closedEventReceived = true;
+          break;
+        default: throw "Unexpected event $event";
+      }
+    },
+    onDone: () {
+      assert(closedEventReceived);
+      completer.complete(null);
+    });
+
+    return completer.future;
+  }
+}
+
+Future testGoogleHttp(SecurityContext context, String outcome) async {
+  var client = new HttpClient(context: context);
+  try {
+    // First, check if the lookup works.
+    var address = await InternetAddress.lookup('www.google.com');
+    print(address);
+    var request = await client.getUrl(Uri.parse('http://www.google.com/'));
+    request.followRedirects = false;
+    var response = await request.close();
+    assert('pass' == outcome);
+    try { await response.drain(); } catch (e) {
+      print('drain failed: $e');
+    }
+  } catch (e) {
+    // Lookup failed or connection failed.  Don't report a failure.
+    print("SocketException: $e");
+  } finally {
+    client.close();
+  }
+}
+
+Future testGoogleHttps(SecurityContext context, String outcome) async {
+  // If this isn't reasonable, the certificate will be rejected.
+  print(new DateTime.now());
+
+  var client = new HttpClient(context: context);
+  // We need to use an external server that is backed by a
+  // built-in root certificate authority.
+  try {
+    // First, check if the lookup works.
+    var address = await InternetAddress.lookup('www.google.com');
+    print(address);
+    var request = await client.getUrl(Uri.parse('https://www.google.com/'));
+    request.followRedirects = false;
+    var response = await request.close();
+    assert('pass' == outcome);
+    try { await response.drain(); } catch (e) {
+      print('drain failed: $e');
+    }
+  } catch (e) {
+    // Lookup failed or connection failed.  Don't report a failure.
+    print("SocketException: $e");
+  } finally {
+    client.close();
+  }
+}
+
+main() async {
   print("Hello, Fuchsia!");
+
+  print("testAddressParse");
+  await testAddressParse();
+  print("testAddressParse done");
+
+  print("testSimpleBind");
+  await testSimpleBind();
+  print("testSimpleBind done");
+
+  print("testSimpleConnect");
+  await testSimpleConnect();
+  print("testSimpleConnect done");
+
+  print("testSimpleReadWriteClose");
+  await testSimpleReadWriteClose();
+  print("testSimpleReadWriteClose done");
+
+  print("testSimpleReadWriteShutdown");
+  await testSimpleReadWriteShutdown(dropReads: false);
+  print("testSimpleReadWriteShutdown done");
+
+  print("testGoogleHttp");
+  await testGoogleHttp(null, 'pass');
+  print("testGoogleHttp done");
+
+  print("testGoogleHttps");
+  await testGoogleHttps(null, 'pass');
+  print("testGoogleHttps done");
+
+  print("Goodbyte, Fuchsia!");
 }
diff --git a/runtime/tests/vm/vm.status b/runtime/tests/vm/vm.status
index 61d2bac..dd5b600 100644
--- a/runtime/tests/vm/vm.status
+++ b/runtime/tests/vm/vm.status
@@ -22,6 +22,8 @@
 
 cc/SNPrint_BadArgs: Skip
 
+cc/Profiler_InliningIntervalBoundry: Skip # Differences in ia32, debug, release
+
 # Flaky on buildbot. Issue 5133 and 10409.
 cc/Sleep: Pass, Fail
 
@@ -46,8 +48,59 @@
 cc/Dart2JSCompilerStats: Skip
 cc/CorelibCompilerStats: Skip
 
+# Profiler is completely disabled in SIMDBC builds.
+# On the simluator stack traces produced by the Profiler do not match
+# up with the real Dart stack trace and hence we don't get correct
+# symbol names.
 [ $arch == simarm || $arch == simarmv6 || $arch == simarmv5te || $arch == simarm64 || $arch == simmips || $arch == simdbc  || $arch == simdbc64 ]
 cc/Service_Profile: Skip
+cc/Profiler_AllocationSampleTest: Skip
+cc/Profiler_ArrayAllocation: Skip
+cc/Profiler_BasicSourcePosition: Skip
+cc/Profiler_BasicSourcePositionOptimized: Skip
+cc/Profiler_BinaryOperatorSourcePosition: Skip
+cc/Profiler_BinaryOperatorSourcePositionOptimized: Skip
+cc/Profiler_ChainedSamples: Skip
+cc/Profiler_ClosureAllocation: Skip
+cc/Profiler_CodeTicks: Skip
+cc/Profiler_ContextAllocation: Skip
+cc/Profiler_FunctionInline: Skip
+cc/Profiler_FunctionTicks: Skip
+cc/Profiler_InliningIntervalBoundry: Skip
+cc/Profiler_IntrinsicAllocation: Skip
+cc/Profiler_SampleBufferIterateTest: Skip
+cc/Profiler_SampleBufferWrapTest: Skip
+cc/Profiler_SourcePosition: Skip
+cc/Profiler_SourcePositionOptimized: Skip
+cc/Profiler_StringAllocation: Skip
+cc/Profiler_StringInterpolation: Skip
+cc/Profiler_ToggleRecordAllocation: Skip
+cc/Profiler_TrivialRecordAllocation: Skip
+cc/Profiler_TypedArrayAllocation: Skip
+cc/Profiler_GetSourceReport: Skip
+
+# Following tests are failing in a weird way on macos/ia32/debug builds
+# need to investigate.
+[ $runtime == vm && $mode == debug && $arch == ia32 && $system == macos ]
+cc/Profiler_TrivialRecordAllocation: Skip
+cc/Profiler_ToggleRecordAllocation: Skip
+cc/Profiler_FunctionTicks: Skip
+cc/Profiler_CodeTicks: Skip
+cc/Profiler_IntrinsicAllocation: Skip
+cc/Profiler_ArrayAllocation: Skip
+cc/Profiler_ContextAllocation: Skip
+cc/Profiler_ClosureAllocation: Skip
+cc/Profiler_TypedArrayAllocation: Skip
+cc/Profiler_StringAllocation: Skip
+cc/Profiler_StringInterpolation: Skip
+cc/Profiler_BasicSourcePosition: Skip
+cc/Profiler_BasicSourcePositionOptimized: Skip
+cc/Profiler_ChainedSamples: Skip
+cc/Profiler_FunctionInline: Skip
+cc/Profiler_SourcePosition: Skip
+cc/Profiler_SourcePositionOptimized: Skip
+cc/Profiler_BinaryOperatorSourcePosition: Skip
+cc/Profiler_BinaryOperatorSourcePositionOptimized: Skip
 
 [ $compiler == dart2js ]
 dart/redirection_type_shuffling_test: Skip # Depends on lazy enforcement of type bounds
@@ -84,6 +137,7 @@
 dart/snapshot_version_test: SkipByDesign  # Spawns processes
 dart/spawn_infinite_loop_test: Skip  # VM shutdown test
 dart/spawn_shutdown_test: Skip  # VM Shutdown test
+dart/hello_fuchsia_test: SkipByDesign # This is a test for fuchsia OS
 
 [ ($runtime == vm || $runtime == dart_precompiled) && $mode == debug && $builder_tag == asan ]
 cc/Dart2JSCompileAll: SkipSlow  # Timeout.
@@ -115,33 +169,7 @@
 cc/String_ScrubName: Fail,OK  # Expects exact type name.
 cc/GetFunctionNames: Fail,OK  # Expects exact type name.
 
-[ $arch == simdbc || $arch == simdbc64 ]
-# TODO(vegorov) Profiler is completely disabled in SIMDBC builds.
-cc/Profiler_AllocationSampleTest: Skip
-cc/Profiler_ArrayAllocation: Skip
-cc/Profiler_BasicSourcePosition: Skip
-cc/Profiler_BasicSourcePositionOptimized: Skip
-cc/Profiler_BinaryOperatorSourcePosition: Skip
-cc/Profiler_BinaryOperatorSourcePositionOptimized: Skip
-cc/Profiler_ChainedSamples: Skip
-cc/Profiler_ClosureAllocation: Skip
-cc/Profiler_CodeTicks: Skip
-cc/Profiler_ContextAllocation: Skip
-cc/Profiler_FunctionInline: Skip
-cc/Profiler_FunctionTicks: Skip
-cc/Profiler_InliningIntervalBoundry: Skip
-cc/Profiler_IntrinsicAllocation: Skip
-cc/Profiler_SampleBufferIterateTest: Skip
-cc/Profiler_SampleBufferWrapTest: Skip
-cc/Profiler_SourcePosition: Skip
-cc/Profiler_SourcePositionOptimized: Skip
-cc/Profiler_StringAllocation: Skip
-cc/Profiler_StringInterpolation: Skip
-cc/Profiler_ToggleRecordAllocation: Skip
-cc/Profiler_TrivialRecordAllocation: Skip
-cc/Profiler_TypedArrayAllocation: Skip
-cc/Profiler_GetSourceReport: Skip
-
+[ $arch == simdbc  || $arch == simdbc64 ]
 # TODO(vegorov) These tests don't seem to work if FLAG_interpret_irregexp
 # is switched on by default because they attempt to call regexp functions
 # directly instead of going through JSSyntaxRegExp_ExecuteMatch.
diff --git a/runtime/third_party/double-conversion/src/BUILD.gn b/runtime/third_party/double-conversion/src/BUILD.gn
index 5aaa53b..7888623 100644
--- a/runtime/third_party/double-conversion/src/BUILD.gn
+++ b/runtime/third_party/double-conversion/src/BUILD.gn
@@ -2,14 +2,13 @@
 # for details. All rights reserved. Use of this source code is governed by a
 # BSD-style license that can be found in the LICENSE file.
 
-
 static_library("libdouble_conversion") {
-  configs += [ "../../..:dart_config", ]
+  configs += [ "../../..:dart_config" ]
   sources = [
-    "bignum.cc",
-    "bignum.h",
     "bignum-dtoa.cc",
     "bignum-dtoa.h",
+    "bignum.cc",
+    "bignum.h",
     "cached-powers.cc",
     "cached-powers.h",
     "diy-fp.cc",
@@ -25,8 +24,5 @@
     "strtod.h",
     "utils.h",
   ]
-  include_dirs = [
-    ".",
-  ]
+  include_dirs = [ "." ]
 }
-
diff --git a/runtime/tools/concatenate_patches.py b/runtime/tools/concatenate_patches.py
new file mode 100755
index 0000000..1653066
--- /dev/null
+++ b/runtime/tools/concatenate_patches.py
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+from optparse import OptionParser
+
+def writePatch(output_file_name, input_file_names):
+  dart_file_names = filter(lambda name: name.endswith('.dart'),
+                           input_file_names)
+  with open(output_file_name, 'w') as output_file:
+    for dart_file_name in dart_file_names:
+      with open(dart_file_name, 'r') as dart_file:
+        output_file.write(dart_file.read())
+
+
+def main():
+  parser = OptionParser()
+  parser.add_option('--output', action='store', type='string',
+                    help='output file path')
+  (options, args) = parser.parse_args()
+  if not options.output:
+    parser.error('missing --output option\n')
+  if len(args) == 0:
+    parser.error('no input files given\n')
+  writePatch(options.output, args)
+
+
+if __name__ == '__main__':
+  main()
diff --git a/runtime/tools/gyp/runtime-configurations.gypi b/runtime/tools/gyp/runtime-configurations.gypi
index 0b993ca..95168b0 100644
--- a/runtime/tools/gyp/runtime-configurations.gypi
+++ b/runtime/tools/gyp/runtime-configurations.gypi
@@ -10,6 +10,7 @@
     'dart_io_support%': 0,
     'dart_io_secure_socket%': 1,
     'asan%': 0,
+    'msan%': 0,
     # Intel VTune related variables.
     'dart_vtune_support%': 0,
     'conditions': [
diff --git a/runtime/vm/BUILD.gn b/runtime/vm/BUILD.gn
index 2f0a5ed..9bbc3a4 100644
--- a/runtime/vm/BUILD.gn
+++ b/runtime/vm/BUILD.gn
@@ -2,285 +2,530 @@
 # for details. All rights reserved. Use of this source code is governed by a
 # BSD-style license that can be found in the LICENSE file.
 
-config("libdart_vm_config") {
-  # TODO(zra, jamesr): This check can go away after some problems with the
-  # fuchsia toolchain definition are fixed.
-  if (!defined(is_fuchsia) || !is_fuchsia) {
-    libs = [ "dl" ]
+import("../../build/executable_suffix.gni")
+import("../../build/prebuilt_dart_sdk.gni")
+import("gypi_contents.gni")
 
+config("libdart_vm_config") {
+  if (defined(is_fuchsia) && is_fuchsia) {
+    libs = [ "magenta" ]
+  } else if (is_win) {
+    libs = [
+      "advapi32.lib",
+      "shell32.lib",
+      "dbghelp.lib",
+    ]
+  } else {
+    libs = [ "dl" ]
     if (!is_android) {
       libs += [ "pthread" ]
-
-      if (is_linux) {
-        libs += [ "rt" ]
-      }
     }
-  } else {
-    libs = [
-      "magenta",
-      "runtime",
-    ]
+    if (is_linux) {
+      libs += [ "rt" ]
+    }
   }
 }
 
-
 static_library("libdart_platform") {
-  configs += ["..:dart_config",
-              "..:dart_maybe_product_config"]
-  public_configs = [":libdart_vm_config"]
-
-  platform_headers_gypi =
-      exec_script("../../tools/gypi_to_gn.py",
-                  [rebase_path("../platform/platform_headers.gypi")],
-                  "scope",
-                  ["../platform/platform_headers.gypi"])
-  platform_headers =
-      rebase_path(platform_headers_gypi.sources, ".", "../platform")
-
-  platform_sources_gypi =
-      exec_script("../../tools/gypi_to_gn.py",
-                  [rebase_path("../platform/platform_sources.gypi")],
-                  "scope",
-                  ["../platform/platform_sources.gypi"])
-  platform_sources =
-      rebase_path(platform_sources_gypi.sources, ".", "../platform")
-
-  sources = platform_headers + platform_sources
-  include_dirs = [
-    "..",
+  configs += [
+    "..:dart_config",
+    "..:dart_maybe_product_config",
   ]
+  public_configs = [ ":libdart_vm_config" ]
+
+  sources = rebase_path(processed_gypis.platform_sources, ".", "../platform")
+
+  include_dirs = [ ".." ]
 }
 
-
-vm_sources_list = exec_script("../../tools/gypi_to_gn.py",
-                              [rebase_path("vm_sources.gypi")],
-                              "scope",
-                              ["vm_sources.gypi"])
-
+vm_sources_list = processed_gypis.vm_sources
 
 static_library("libdart_vm") {
-  configs += ["..:dart_config",
-              "..:dart_maybe_product_config",
-              "..:dart_maybe_precompiled_runtime_config"]
-  public_configs = [":libdart_vm_config"]
-  set_sources_assignment_filter(["*_test.cc", "*_test.h"])
-  sources = vm_sources_list.sources
-  include_dirs = [
-    "..",
+  configs += [
+    "..:dart_config",
+    "..:dart_maybe_product_config",
+    "..:dart_maybe_precompiled_runtime_config",
   ]
+  public_configs = [ ":libdart_vm_config" ]
+  set_sources_assignment_filter([
+                                  "*_test.cc",
+                                  "*_test.h",
+                                ])
+  sources = vm_sources_list
+  include_dirs = [ ".." ]
 }
 
+static_library("libdart_vm_noopt") {
+  configs += [
+    "..:dart_config",
+    "..:dart_maybe_product_config",
+    "..:dart_precompiler_config",
+    "..:dart_maybe_precompiled_runtime_config",
+  ]
+  public_configs = [ ":libdart_vm_config" ]
+  set_sources_assignment_filter([
+                                  "*_test.cc",
+                                  "*_test.h",
+                                ])
+  sources = vm_sources_list
+  include_dirs = [ ".." ]
+}
 
 static_library("libdart_vm_precompiled_runtime") {
-  configs += ["..:dart_config",
-              "..:dart_maybe_product_config",
-              "..:dart_precompiled_runtime_config"]
-  public_configs = [":libdart_vm_config"]
-  set_sources_assignment_filter(["*_test.cc", "*_test.h"])
-  sources = vm_sources_list.sources
-  include_dirs = [
-    "..",
+  configs += [
+    "..:dart_config",
+    "..:dart_maybe_product_config",
+    "..:dart_precompiled_runtime_config",
   ]
+  public_configs = [ ":libdart_vm_config" ]
+  set_sources_assignment_filter([
+                                  "*_test.cc",
+                                  "*_test.h",
+                                ])
+  sources = vm_sources_list
+  include_dirs = [ ".." ]
 }
 
-
 static_library("libdart_vm_nosnapshot") {
-  configs += ["..:dart_config",
-              "..:dart_maybe_product_config",
-              "..:dart_maybe_precompiled_runtime_config",
-              "..:dart_no_snapshot_config",]
-  public_configs = [":libdart_vm_config"]
-  set_sources_assignment_filter(["*_test.cc", "*_test.h"])
-  sources = vm_sources_list.sources
-  include_dirs = [
-    "..",
+  configs += [
+    "..:dart_config",
+    "..:dart_maybe_product_config",
+    "..:dart_no_snapshot_config",
   ]
+  public_configs = [ ":libdart_vm_config" ]
+  set_sources_assignment_filter([
+                                  "*_test.cc",
+                                  "*_test.h",
+                                ])
+  sources = vm_sources_list
+  include_dirs = [ ".." ]
 }
 
-
-static_library("libdart_vm_nosnapshot_precompiled_runtime") {
-  configs += ["..:dart_config",
-              "..:dart_maybe_product_config",
-              "..:dart_precompiled_runtime_config",
-              "..:dart_no_snapshot_config",]
-  public_configs = [":libdart_vm_config"]
-  set_sources_assignment_filter(["*_test.cc", "*_test.h"])
-  sources = vm_sources_list.sources
-  include_dirs = [
-    "..",
-  ]
-}
-
-
 static_library("libdart_vm_nosnapshot_with_precompiler") {
-  configs += ["..:dart_config",
-              "..:dart_maybe_product_config",
-              "..:dart_precompiler_config",
-              "..:dart_no_snapshot_config",]
-  public_configs = [":libdart_vm_config"]
-  set_sources_assignment_filter(["*_test.cc", "*_test.h"])
-  sources = vm_sources_list.sources
-  include_dirs = [
-    "..",
+  configs += [
+    "..:dart_config",
+    "..:dart_maybe_product_config",
+    "..:dart_precompiler_config",
+    "..:dart_no_snapshot_config",
   ]
+  public_configs = [ ":libdart_vm_config" ]
+  set_sources_assignment_filter([
+                                  "*_test.cc",
+                                  "*_test.h",
+                                ])
+  sources = vm_sources_list
+  include_dirs = [ ".." ]
 }
 
+template("process_library_source") {
+  assert(defined(invoker.libsources), "Need libsources in $target_name")
+  assert(defined(invoker.output), "Need output in $target_name")
+  action(target_name) {
+    visibility = [ ":*" ]  # Only targets in this file can see this.
+    libsources = invoker.libsources
+
+    script = invoker.script
+    inputs = invoker.inputs + libsources
+    outputs = [
+      invoker.output,
+    ]
+    args = invoker.args + rebase_path(libsources, root_build_dir)
+  }
+}
 
 template("generate_library_source") {
   assert(defined(invoker.libname), "Need libname in $target_name")
-  assert(defined(invoker.filename), "Need a filename in $target_name")
+  assert(defined(invoker.libsources), "Need libsources in $target_name")
   assert(defined(invoker.kind), "Need kind in $target_name")
   assert(defined(invoker.output), "Need output in $target_name")
-  assert(defined(invoker.path), "Need path in $target_name")
-  action(target_name) {
-    visibility = [ ":*" ]  # Only targets in this file can see this.
+
+  process_library_source(target_name) {
     libname = invoker.libname
-    filename = invoker.filename
+    libsources = invoker.libsources
     kind = invoker.kind
-    path = invoker.path
-
-    lib_sources_gypi =
-        exec_script("../../tools/gypi_to_gn.py",
-                    [rebase_path("${path}/${filename}_sources.gypi")],
-                    "scope",
-                    ["${path}/${filename}_sources.gypi"])
-    lib_sources =
-        rebase_path(lib_sources_gypi.sources, ".", path)
-
     script = "../tools/gen_library_src_paths.py"
     inputs = [
-      "../tools/gen_library_src_paths.py",
       "../lib/libgen_in.cc",
     ]
-    inputs += lib_sources
-    outputs = [ invoker.output, ]
+    output = invoker.output
     args = [
-      "--output", rebase_path(invoker.output, root_build_dir),
-      "--input_cc", rebase_path("../lib/libgen_in.cc", root_build_dir),
-      "--include", "vm/bootstrap.h",
-      "--var_name", "dart::Bootstrap::${libname}_${kind}_paths_",
-      "--library_name", "dart:${libname}",] +
-      rebase_path(lib_sources, root_build_dir)
+      "--output",
+      rebase_path(invoker.output, root_build_dir),
+      "--input_cc",
+      rebase_path("../lib/libgen_in.cc", root_build_dir),
+      "--include",
+      "vm/bootstrap.h",
+      "--var_name",
+      "dart::Bootstrap::${libname}_${kind}_paths_",
+      "--library_name",
+      "dart:${libname}",
+    ]
   }
 }
 
-
-# This templates expects invoker.sources to be a list of pairs of strings.
-# The pairs of strings mean the following.
-# library name, file name
-# e.g. for the "internal" library named "dart:_internal",
-# with sources listed at sdk/lib/internal/internal_sources.gypi and
-# lib/internal_sources.gypi, we have: ["_internal", "internal"]
+# This templates expects invoker.sources to be a list of lists.
+# The lists contain the following information about each library:
+#   library name (string)
+#   library sources (list of strings)
+#   library source base path (string)
+#   filename (string)
+#   do_patch (boolean)
+#
+# If do_patch is true, the lists additionally contains
+#   patch sources (list of strings)
+#   patch source base path (string)
 #
 # The template iterates over the list, and generates generate_library_source
 # actions for each. After that, it generates targets to compile the generated
-# sources to make libdart_lib_nosnapshot and libdart_lib.
+# sources to make libdart_lib_*.
 template("generate_core_libraries") {
   assert(defined(invoker.sources), "Need sources in $target_name")
+  assert(defined(invoker.allsources), "Need allsources in $target_name")
   liboutputs = []
-  libsources = []
   libdeps = []
   foreach(lib, invoker.sources) {
     libname = lib[0]
-    filename = lib[1]
-    do_patch = lib[2]
-    source_path = lib[3]
+    filename = lib[3]
+    do_patch = lib[4]
     generate_library_source("generate_${filename}_cc_file") {
       libname = libname
-      filename = filename
+      libsources = rebase_path(lib[1], ".", lib[2])
       kind = "source"
-      path = source_path
       output = "$target_gen_dir/${filename}_gen.cc"
     }
     if (do_patch) {
-      patch_path = lib[4]
       generate_library_source("generate_${filename}_patch_cc_file") {
         libname = libname
-        filename = filename
+        libsources = rebase_path(lib[5], ".", lib[6])
         kind = "patch"
-        path = patch_path
         output = "$target_gen_dir/${filename}_patch_gen.cc"
       }
     }
-    lib_sources_gypi = {}
-    lib_sources_gypi =
-        exec_script("../../tools/gypi_to_gn.py",
-                    [rebase_path("../lib/${filename}_sources.gypi")],
-                    "scope",
-                    ["../lib/${filename}_sources.gypi"])
-    libsources += rebase_path(lib_sources_gypi.sources, ".", "../lib")
-    liboutputs += ["$target_gen_dir/${filename}_gen.cc"]
-    libdeps += [":generate_${filename}_cc_file"]
+
+    liboutputs += [ "$target_gen_dir/${filename}_gen.cc" ]
+    libdeps += [ ":generate_${filename}_cc_file" ]
     if (do_patch) {
-      liboutputs += ["$target_gen_dir/${filename}_patch_gen.cc"]
-      libdeps += [":generate_${filename}_patch_cc_file"]
+      liboutputs += [ "$target_gen_dir/${filename}_patch_gen.cc" ]
+      libdeps += [ ":generate_${filename}_patch_cc_file" ]
     }
   }
 
+  all_libsources = rebase_path(invoker.allsources, ".", "../lib")
+
   static_library("libdart_lib_nosnapshot") {
-    configs += ["..:dart_config",
-                "..:dart_maybe_product_config",
-                "..:dart_maybe_precompiled_runtime_config"]
-    deps = libdeps
-    sources = libsources + ["bootstrap.cc"] + liboutputs
-    include_dirs = [
-      "..",
+    configs += [
+      "..:dart_config",
+      "..:dart_maybe_product_config",
+      "..:dart_maybe_precompiled_runtime_config",
     ]
-  }
-  static_library("libdart_lib_nosnapshot_precompiled_runtime") {
-    configs += ["..:dart_config",
-                "..:dart_maybe_product_config",
-                "..:dart_precompiled_runtime_config"]
     deps = libdeps
-    sources = libsources + ["bootstrap.cc"] + liboutputs
-    include_dirs = [
-      "..",
-    ]
+    sources = all_libsources + [ "bootstrap.cc" ] + liboutputs
+    include_dirs = [ ".." ]
   }
   static_library("libdart_lib_nosnapshot_with_precompiler") {
-    configs += ["..:dart_config",
-                "..:dart_maybe_product_config",
-                "..:dart_precompiler_config" ]
-    deps = libdeps
-    sources = libsources + [ "bootstrap.cc"] + liboutputs
-    include_dirs = [
-      "..",
+    configs += [
+      "..:dart_config",
+      "..:dart_maybe_product_config",
+      "..:dart_precompiler_config",
     ]
+    deps = libdeps
+    sources = all_libsources + [ "bootstrap.cc" ] + liboutputs
+    include_dirs = [ ".." ]
   }
   static_library("libdart_lib") {
-    configs += ["..:dart_config",
-                "..:dart_maybe_product_config",
-                "..:dart_maybe_precompiled_runtime_config"]
-    sources = libsources + [ "bootstrap_nocore.cc"]
-    include_dirs = [
-      "..",
+    configs += [
+      "..:dart_config",
+      "..:dart_maybe_product_config",
+      "..:dart_maybe_precompiled_runtime_config",
     ]
+    sources = all_libsources + [ "bootstrap_nocore.cc" ]
+    include_dirs = [ ".." ]
   }
   static_library("libdart_lib_precompiled_runtime") {
-    configs += ["..:dart_config",
-                "..:dart_maybe_product_config",
-                "..:dart_precompiled_runtime_config"]
-    sources = libsources + [ "bootstrap_nocore.cc"]
-    include_dirs = [
-      "..",
+    configs += [
+      "..:dart_config",
+      "..:dart_maybe_product_config",
+      "..:dart_precompiled_runtime_config",
+    ]
+    sources = all_libsources + [ "bootstrap_nocore.cc" ]
+    include_dirs = [ ".." ]
+  }
+}
+
+generate_core_libraries("core_libraries") {
+  sources = [
+    [
+      "async",
+      processed_gypis.async_sdk_sources,
+      "../../sdk/lib/async",
+      "async",
+      true,
+      processed_gypis.async_runtime_sources,
+      "../lib",
+    ],
+    [
+      "core",
+      processed_gypis.core_sdk_sources,
+      "../../sdk/lib/core",
+      "core",
+      true,
+      processed_gypis.core_runtime_sources,
+      "../lib",
+    ],
+    [
+      "collection",
+      processed_gypis.collection_sdk_sources,
+      "../../sdk/lib/collection",
+      "collection",
+      true,
+      processed_gypis.collection_runtime_sources,
+      "../lib",
+    ],
+    [
+      "convert",
+      processed_gypis.convert_sdk_sources,
+      "../../sdk/lib/convert",
+      "convert",
+      true,
+      processed_gypis.convert_runtime_sources,
+      "../lib",
+    ],
+    [
+      "developer",
+      processed_gypis.developer_sdk_sources,
+      "../../sdk/lib/developer",
+      "developer",
+      true,
+      processed_gypis.developer_runtime_sources,
+      "../lib",
+    ],
+    [
+      "_internal",
+      processed_gypis.internal_sdk_sources,
+      "../../sdk/lib/internal",
+      "internal",
+      true,
+      processed_gypis.internal_runtime_sources,
+      "../lib",
+    ],
+    [
+      "isolate",
+      processed_gypis.isolate_sdk_sources,
+      "../../sdk/lib/isolate",
+      "isolate",
+      true,
+      processed_gypis.isolate_runtime_sources,
+      "../lib",
+    ],
+    [
+      "math",
+      processed_gypis.math_sdk_sources,
+      "../../sdk/lib/math",
+      "math",
+      true,
+      processed_gypis.math_runtime_sources,
+      "../lib",
+    ],
+    [
+      "mirrors",
+      processed_gypis.mirrors_sdk_sources,
+      "../../sdk/lib/mirrors",
+      "mirrors",
+      true,
+      processed_gypis.mirrors_runtime_sources,
+      "../lib",
+    ],
+    [
+      "profiler",
+      processed_gypis.profiler_sdk_sources,
+      "../../sdk/lib/profiler",
+      "profiler",
+      false,
+    ],
+    [
+      "typed_data",
+      processed_gypis.typed_data_runtime_sources,
+      "../lib",
+      "typed_data",
+      false,
+    ],
+    [
+      "_vmservice",
+      processed_gypis.vmservice_sdk_sources,
+      "../../sdk/lib/vmservice",
+      "vmservice",
+      true,
+      processed_gypis.vmservice_runtime_sources,
+      "../lib",
+    ],
+  ]
+  allsources = processed_gypis.allsources
+}
+
+template("concatenate_patch") {
+  assert(defined(invoker.libsources), "Need a sources in $target_name")
+  assert(defined(invoker.output), "Need an output in $target_name")
+
+  process_library_source(target_name) {
+    libsources = invoker.libsources
+    inputs = []
+    output = invoker.output
+    script = "../tools/concatenate_patches.py"
+    args = [
+      "--output",
+      rebase_path(output, root_build_dir),
     ]
   }
 }
 
+if (!defined(is_fuchsia) || !is_fuchsia) {
+  template("generate_patched_sdk") {
+    assert(defined(invoker.libraries), "Need libraries in $target_name")
 
-generate_core_libraries("core_libraries") {
-  sources = [
-    ["async", "async", true, "../../sdk/lib/async", "../lib"],
-    ["core", "core", true, "../../sdk/lib/core", "../lib"],
-    ["collection", "collection", true, "../../sdk/lib/collection", "../lib"],
-    ["convert", "convert", true, "../../sdk/lib/convert", "../lib"],
-    ["developer", "developer", true, "../../sdk/lib/developer", "../lib"],
-    ["_internal", "internal", true, "../../sdk/lib/internal", "../lib"],
-    ["isolate", "isolate", true, "../../sdk/lib/isolate", "../lib"],
-    ["math", "math", true, "../../sdk/lib/math", "../lib"],
-    ["mirrors", "mirrors", true, "../../sdk/lib/mirrors", "../lib"],
-    ["profiler", "profiler", false, "../../sdk/lib/profiler"],
-    ["typed_data", "typed_data", false, "../lib"],
-    ["_vmservice", "vmservice", true, "../../sdk/lib/vmservice", "../lib"],
-  ]
+    concatenation_target_names = []
+    concatenation_files = []
+
+    # Concatenate vm library patches.
+    foreach(library, invoker.libraries) {
+      name = library[0]
+
+      target_output = "$target_gen_dir/patches/${name}_patch.dart"
+      concatenate_patch("concatenate_${name}_patch") {
+        libsources = rebase_path(library[1], ".", library[2])
+        output = target_output
+      }
+      concatenation_target_names += [ ":concatenate_${name}_patch" ]
+      concatenation_files += [ target_output ]
+    }
+
+    # Build the patched sdk out of the concatenated patches and the special
+    # libraries.
+    action(target_name) {
+      deps = concatenation_target_names
+      if (!prebuilt_dart_exe_works) {
+        deps += [ "../bin:dart_bootstrap($host_toolchain)" ]
+      }
+
+      patches_dir = "$target_gen_dir/patches"
+      patched_sdk_dir = "$root_out_dir/patched_sdk"
+
+      script = "../../tools/patch_sdk.py"
+
+      # We list all files which make up the sdk (modulo patches) and get them back
+      # as a GN list object.
+      shared_sdk_sources = exec_script("../../tools/list_dart_files.py",
+                                       [ "../../sdk/lib" ],
+                                       "list lines")
+
+      # We list the `patch_sdk.dart` tool here because the [script] (which is
+      # implicitly an input) will call it.
+      inputs = [
+        "../../tools/patch_sdk.dart",
+      ]
+
+      # Files below are not patches, they will not be in [concatenation_files] but
+      # the `patch_sdk.dart` script will copy them into the patched sdk.
+      inputs += [
+        "../lib/typed_data.dart",
+        "../bin/builtin.dart",
+        "../bin/vmservice/vmservice_io.dart",
+        "../bin/vmservice/loader.dart",
+        "../bin/vmservice/server.dart",
+      ]
+
+      # Add all the normal sdk sources.
+      inputs += shared_sdk_sources
+
+      # Add all the concatenated patch files.
+      inputs += concatenation_files
+
+      outputs = [
+        # Instead of listing all outputs we list a single well-known one.
+        "${patched_sdk_dir}/lib/core/core.dart",
+      ]
+
+      args = []
+      if (!prebuilt_dart_exe_works) {
+        dart_out_dir = get_label_info("../bin:dart_bootstrap($host_toolchain)",
+                                      "root_out_dir")
+        dart_bootstrap =
+            rebase_path("$dart_out_dir/dart_bootstrap$executable_suffix")
+        args += [
+          "--dart-executable",
+          dart_bootstrap,
+        ]
+      }
+      args += [
+        "vm",
+        rebase_path("../../sdk"),
+        rebase_path(patches_dir, root_build_dir),
+        rebase_path(patched_sdk_dir, root_build_dir),
+      ]
+    }
+  }
+
+  generate_patched_sdk("patched_sdk") {
+    libraries = [
+      [
+        "async",
+        processed_gypis.async_runtime_sources,
+        "../lib",
+      ],
+      [
+        "collection",
+        processed_gypis.collection_runtime_sources,
+        "../lib",
+      ],
+      [
+        "convert",
+        processed_gypis.convert_runtime_sources,
+        "../lib",
+      ],
+      [
+        "core",
+        processed_gypis.core_runtime_sources,
+        "../lib",
+      ],
+      [
+        "developer",
+        processed_gypis.developer_runtime_sources,
+        "../lib",
+      ],
+      [
+        "internal",
+        processed_gypis.internal_runtime_sources,
+        "../lib",
+      ],
+      [
+        "isolate",
+        processed_gypis.isolate_runtime_sources,
+        "../lib",
+      ],
+      [
+        "math",
+        processed_gypis.math_runtime_sources,
+        "../lib",
+      ],
+      [
+        "mirrors",
+        processed_gypis.mirrors_runtime_sources,
+        "../lib",
+      ],
+      [
+        "profiler",
+        processed_gypis.profiler_runtime_sources,
+        "../lib",
+      ],
+      [
+        "vmservice",
+        processed_gypis.vmservice_runtime_sources,
+        "../lib",
+      ],
+      [
+        "io",
+        processed_gypis.bin_io_sources,
+        "../bin",
+      ],
+    ]
+  }
 }
diff --git a/runtime/vm/allocation.h b/runtime/vm/allocation.h
index af9a74a..16c7075 100644
--- a/runtime/vm/allocation.h
+++ b/runtime/vm/allocation.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_ALLOCATION_H_
-#define VM_ALLOCATION_H_
+#ifndef RUNTIME_VM_ALLOCATION_H_
+#define RUNTIME_VM_ALLOCATION_H_
 
 #include "platform/assert.h"
 #include "vm/base_isolate.h"
@@ -21,8 +21,8 @@
 // program control flow.
 class ValueObject {
  public:
-  ValueObject() { }
-  ~ValueObject() { }
+  ValueObject() {}
+  ~ValueObject() {}
 
  private:
   DISALLOW_ALLOCATION();
@@ -79,7 +79,7 @@
 // goes out of scope to reclaim memory.
 class ZoneAllocated {
  public:
-  ZoneAllocated() { }
+  ZoneAllocated() {}
 
   // Implicitly allocate the object in the current zone.
   void* operator new(uword size);
@@ -102,7 +102,6 @@
 };
 
 
-
 // Within a NoSafepointScope, the thread must not reach any safepoint. Used
 // around code that manipulates raw object pointers directly without handles.
 #if defined(DEBUG)
@@ -110,13 +109,15 @@
  public:
   NoSafepointScope();
   ~NoSafepointScope();
+
  private:
   DISALLOW_COPY_AND_ASSIGN(NoSafepointScope);
 };
-#else  // defined(DEBUG)
+#else   // defined(DEBUG)
 class NoSafepointScope : public ValueObject {
  public:
   NoSafepointScope() {}
+
  private:
   DISALLOW_COPY_AND_ASSIGN(NoSafepointScope);
 };
@@ -124,4 +125,4 @@
 
 }  // namespace dart
 
-#endif  // VM_ALLOCATION_H_
+#endif  // RUNTIME_VM_ALLOCATION_H_
diff --git a/runtime/vm/allocation_test.cc b/runtime/vm/allocation_test.cc
index 63b91f6..146f7f6 100644
--- a/runtime/vm/allocation_test.cc
+++ b/runtime/vm/allocation_test.cc
@@ -88,9 +88,8 @@
   TestValueObject stacked(ptr);
   EXPECT_EQ(2, *ptr);
   *ptr = 3;
-  const Error& error =
-      Error::Handle(LanguageError::New(
-          String::Handle(String::New("StackAllocatedLongJump"))));
+  const Error& error = Error::Handle(LanguageError::New(
+      String::Handle(String::New("StackAllocatedLongJump"))));
   jump->Jump(1, error);
   UNREACHABLE();
 }
@@ -135,9 +134,8 @@
   TestStackedStackResource stacked(ptr);
   EXPECT_EQ(4, *ptr);
   *ptr = 5;
-  const Error& error =
-      Error::Handle(LanguageError::New(
-          String::Handle(String::New("StackedStackResourceLongJump"))));
+  const Error& error = Error::Handle(LanguageError::New(
+      String::Handle(String::New("StackedStackResourceLongJump"))));
   jump->Jump(1, error);
   UNREACHABLE();
 }
diff --git a/runtime/vm/aot_optimizer.cc b/runtime/vm/aot_optimizer.cc
index 208a224..0013157 100644
--- a/runtime/vm/aot_optimizer.cc
+++ b/runtime/vm/aot_optimizer.cc
@@ -29,7 +29,9 @@
 
 namespace dart {
 
-DEFINE_FLAG(int, max_exhaustive_polymorphic_checks, 5,
+DEFINE_FLAG(int,
+            max_exhaustive_polymorphic_checks,
+            5,
             "If a call receiver is known to be of at most this many classes, "
             "generate exhaustive class tests instead of a megamorphic call");
 
@@ -54,6 +56,44 @@
 }
 
 
+// Returns named function that is a unique dynamic target, i.e.,
+// - the target is identified by its name alone, since it occurs only once.
+// - target's class has no subclasses, and neither is subclassed, i.e.,
+//   the receiver type can be only the function's class.
+// Returns Function::null() if there is no unique dynamic target for
+// given 'fname'. 'fname' must be a symbol.
+static void GetUniqueDynamicTarget(Isolate* isolate,
+                                   const String& fname,
+                                   Object* function) {
+  UniqueFunctionsSet functions_set(
+      isolate->object_store()->unique_dynamic_targets());
+  ASSERT(fname.IsSymbol());
+  *function = functions_set.GetOrNull(fname);
+  ASSERT(functions_set.Release().raw() ==
+         isolate->object_store()->unique_dynamic_targets());
+}
+
+
+AotOptimizer::AotOptimizer(Precompiler* precompiler,
+                           FlowGraph* flow_graph,
+                           bool use_speculative_inlining,
+                           GrowableArray<intptr_t>* inlining_black_list)
+    : FlowGraphVisitor(flow_graph->reverse_postorder()),
+      precompiler_(precompiler),
+      flow_graph_(flow_graph),
+      use_speculative_inlining_(use_speculative_inlining),
+      inlining_black_list_(inlining_black_list),
+      has_unique_no_such_method_(false) {
+  ASSERT(!use_speculative_inlining || (inlining_black_list != NULL));
+  Function& target_function = Function::Handle();
+  if (isolate()->object_store()->unique_dynamic_targets() != Array::null()) {
+    GetUniqueDynamicTarget(isolate(), Symbols::NoSuchMethod(),
+                           &target_function);
+    has_unique_no_such_method_ = !target_function.IsNull();
+  }
+}
+
+
 // Optimize instance calls using ICData.
 void AotOptimizer::ApplyICData() {
   VisitBlocks();
@@ -63,22 +103,20 @@
 void AotOptimizer::PopulateWithICData() {
   ASSERT(current_iterator_ == NULL);
   for (BlockIterator block_it = flow_graph_->reverse_postorder_iterator();
-       !block_it.Done();
-       block_it.Advance()) {
+       !block_it.Done(); block_it.Advance()) {
     ForwardInstructionIterator it(block_it.Current());
     for (; !it.Done(); it.Advance()) {
       Instruction* instr = it.Current();
       if (instr->IsInstanceCall()) {
         InstanceCallInstr* call = instr->AsInstanceCall();
         if (!call->HasICData()) {
-          const Array& arguments_descriptor =
-              Array::Handle(zone(),
-                  ArgumentsDescriptor::New(call->ArgumentCount(),
-                                           call->argument_names()));
-          const ICData& ic_data = ICData::ZoneHandle(zone(), ICData::New(
-              function(), call->function_name(),
-              arguments_descriptor, call->deopt_id(),
-              call->checked_argument_count(), false));
+          const Array& arguments_descriptor = Array::Handle(
+              zone(), ArgumentsDescriptor::New(call->ArgumentCount(),
+                                               call->argument_names()));
+          const ICData& ic_data = ICData::ZoneHandle(
+              zone(), ICData::New(function(), call->function_name(),
+                                  arguments_descriptor, call->deopt_id(),
+                                  call->checked_argument_count(), false));
           call->set_ic_data(&ic_data);
         }
       }
@@ -88,6 +126,41 @@
 }
 
 
+bool AotOptimizer::RecognizeRuntimeTypeGetter(InstanceCallInstr* call) {
+  if ((precompiler_ == NULL) || !precompiler_->get_runtime_type_is_unique()) {
+    return false;
+  }
+
+  if (call->function_name().raw() != Symbols::GetRuntimeType().raw()) {
+    return false;
+  }
+
+  // There is only a single function Object.get:runtimeType that can be invoked
+  // by this call. Convert dynamic invocation to a static one.
+  const Class& cls = Class::Handle(Z, I->object_store()->object_class());
+  const Array& args_desc_array = Array::Handle(
+      Z,
+      ArgumentsDescriptor::New(call->ArgumentCount(), call->argument_names()));
+  ArgumentsDescriptor args_desc(args_desc_array);
+  const Function& function =
+      Function::Handle(Z, Resolver::ResolveDynamicForReceiverClass(
+                              cls, call->function_name(), args_desc));
+  ASSERT(!function.IsNull());
+
+  ZoneGrowableArray<PushArgumentInstr*>* args =
+      new (Z) ZoneGrowableArray<PushArgumentInstr*>(call->ArgumentCount());
+  for (intptr_t i = 0; i < call->ArgumentCount(); i++) {
+    args->Add(call->PushArgumentAt(i));
+  }
+  StaticCallInstr* static_call = new (Z) StaticCallInstr(
+      call->token_pos(), Function::ZoneHandle(Z, function.raw()),
+      call->argument_names(), args, call->deopt_id());
+  static_call->set_result_cid(kTypeCid);
+  call->ReplaceWith(static_call, current_iterator());
+  return true;
+}
+
+
 // Optimize instance calls using cid.  This is called after optimizer
 // converted instance calls to instructions. Any remaining
 // instance calls are either megamorphic calls, cannot be optimized or
@@ -97,8 +170,7 @@
 void AotOptimizer::ApplyClassIds() {
   ASSERT(current_iterator_ == NULL);
   for (BlockIterator block_it = flow_graph_->reverse_postorder_iterator();
-       !block_it.Done();
-       block_it.Advance()) {
+       !block_it.Done(); block_it.Advance()) {
     ForwardInstructionIterator it(block_it.Current());
     current_iterator_ = &it;
     for (; !it.Done(); it.Advance()) {
@@ -123,24 +195,6 @@
 }
 
 
-// Returns named function that is a unique dynamic target, i.e.,
-// - the target is identified by its name alone, since it occurs only once.
-// - target's class has no subclasses, and neither is subclassed, i.e.,
-//   the receiver type can be only the function's class.
-// Returns Function::null() if there is no unique dynamic target for
-// given 'fname'. 'fname' must be a symbol.
-static void GetUniqueDynamicTarget(Isolate* isolate,
-                                   const String& fname,
-                                   Object* function) {
-  UniqueFunctionsSet functions_set(
-      isolate->object_store()->unique_dynamic_targets());
-  ASSERT(fname.IsSymbol());
-  *function = functions_set.GetOrNull(fname);
-  ASSERT(functions_set.Release().raw() ==
-      isolate->object_store()->unique_dynamic_targets());
-}
-
-
 bool AotOptimizer::TryCreateICData(InstanceCallInstr* call) {
   ASSERT(call->HasICData());
   if (call->ic_data()->NumberOfUsedChecks() > 0) {
@@ -155,12 +209,16 @@
   }
 
   const Token::Kind op_kind = call->token_kind();
-  if (Token::IsRelationalOperator(op_kind) ||
-      Token::IsEqualityOperator(op_kind) ||
-      Token::IsBinaryOperator(op_kind)) {
-    // Guess cid: if one of the inputs is a number assume that the other
-    // is a number of same type.
-    if (FLAG_guess_icdata_cid) {
+  if (FLAG_guess_icdata_cid) {
+    if (Token::IsBinaryBitwiseOperator(op_kind)) {
+      class_ids[0] = kSmiCid;
+      class_ids[1] = kSmiCid;
+    }
+    if (Token::IsRelationalOperator(op_kind) ||
+        Token::IsEqualityOperator(op_kind) ||
+        Token::IsBinaryOperator(op_kind)) {
+      // Guess cid: if one of the inputs is a number assume that the other
+      // is a number of same type.
       const intptr_t cid_0 = class_ids[0];
       const intptr_t cid_1 = class_ids[1];
       if ((cid_0 == kDynamicCid) && (IsNumberCid(cid_1))) {
@@ -181,23 +239,21 @@
   }
 
   if (all_cids_known) {
-    const Class& receiver_class = Class::Handle(Z,
-        isolate()->class_table()->At(class_ids[0]));
+    const Class& receiver_class =
+        Class::Handle(Z, isolate()->class_table()->At(class_ids[0]));
     if (!receiver_class.is_finalized()) {
       // Do not eagerly finalize classes. ResolveDynamicForReceiverClass can
       // cause class finalization, since callee's receiver class may not be
       // finalized yet.
       return false;
     }
-    const Array& args_desc_array = Array::Handle(Z,
-        ArgumentsDescriptor::New(call->ArgumentCount(),
-                                 call->argument_names()));
+    const Array& args_desc_array =
+        Array::Handle(Z, ArgumentsDescriptor::New(call->ArgumentCount(),
+                                                  call->argument_names()));
     ArgumentsDescriptor args_desc(args_desc_array);
-    const Function& function = Function::Handle(Z,
-        Resolver::ResolveDynamicForReceiverClass(
-            receiver_class,
-            call->function_name(),
-            args_desc));
+    const Function& function = Function::Handle(
+        Z, Resolver::ResolveDynamicForReceiverClass(
+               receiver_class, call->function_name(), args_desc));
     if (function.IsNull()) {
       return false;
     }
@@ -206,8 +262,8 @@
     // since it is attached to the assembly instruction itself.
     // TODO(srdjan): Prevent modification of ICData object that is
     // referenced in assembly code.
-    const ICData& ic_data = ICData::ZoneHandle(Z,
-        ICData::NewFrom(*call->ic_data(), class_ids.length()));
+    const ICData& ic_data = ICData::ZoneHandle(
+        Z, ICData::NewFrom(*call->ic_data(), class_ids.length()));
     if (class_ids.length() > 1) {
       ic_data.AddCheck(class_ids, function);
     } else {
@@ -227,12 +283,29 @@
         !target_function.HasOptionalNamedParameters() &&
         target_function.AreValidArgumentCounts(call->ArgumentCount(), 0,
                                                /* error_message = */ NULL)) {
-      const intptr_t cid = Class::Handle(Z, target_function.Owner()).id();
-      const ICData& ic_data = ICData::ZoneHandle(Z,
-          ICData::NewFrom(*call->ic_data(), 1));
-      ic_data.AddReceiverCheck(cid, target_function);
-      call->set_ic_data(&ic_data);
-      return true;
+      const Class& cls = Class::Handle(Z, target_function.Owner());
+      if (!CHA::IsImplemented(cls) && !CHA::HasSubclasses(cls)) {
+        const ICData& ic_data =
+            ICData::ZoneHandle(Z, ICData::NewFrom(*call->ic_data(), 1));
+        ic_data.AddReceiverCheck(cls.id(), target_function);
+        call->set_ic_data(&ic_data);
+        if (has_unique_no_such_method_) {
+          call->set_has_unique_selector(true);
+          // Add redefinition of the receiver to prevent code motion across
+          // this call.
+          RedefinitionInstr* redefinition =
+              new (Z) RedefinitionInstr(new (Z) Value(call->ArgumentAt(0)));
+          redefinition->set_ssa_temp_index(flow_graph_->alloc_ssa_temp_index());
+          redefinition->InsertAfter(call);
+          // Replace all uses of the receiver dominated by this call.
+          FlowGraph::RenameDominatedUses(call->ArgumentAt(0), redefinition,
+                                         redefinition);
+          if (!redefinition->HasUses()) {
+            redefinition->RemoveFromGraph();
+          }
+        }
+        return true;
+      }
     }
   }
 
@@ -253,12 +326,11 @@
   // TODO(fschneider): Try looking up the function on the class if it is
   // not found in the ICData.
   if (!function.IsNull()) {
-    const ICData& new_ic_data = ICData::ZoneHandle(Z, ICData::New(
-        Function::Handle(Z, ic_data.Owner()),
-        String::Handle(Z, ic_data.target_name()),
-        Object::empty_array(),  // Dummy argument descriptor.
-        ic_data.deopt_id(),
-        ic_data.NumArgsTested(), false));
+    const ICData& new_ic_data = ICData::ZoneHandle(
+        Z, ICData::New(Function::Handle(Z, ic_data.Owner()),
+                       String::Handle(Z, ic_data.target_name()),
+                       Object::empty_array(),  // Dummy argument descriptor.
+                       ic_data.deopt_id(), ic_data.NumArgsTested(), false));
     new_ic_data.SetDeoptReasons(ic_data.DeoptReasons());
     new_ic_data.AddReceiverCheck(cid, function);
     return new_ic_data;
@@ -328,19 +400,19 @@
 
 
 static bool HasOnlyOneSmi(const ICData& ic_data) {
-  return (ic_data.NumberOfUsedChecks() == 1)
-      && ic_data.HasReceiverClassId(kSmiCid);
+  return (ic_data.NumberOfUsedChecks() == 1) &&
+         ic_data.HasReceiverClassId(kSmiCid);
 }
 
 
 static bool HasOnlySmiOrMint(const ICData& ic_data) {
   if (ic_data.NumberOfUsedChecks() == 1) {
-    return ic_data.HasReceiverClassId(kSmiCid)
-        || ic_data.HasReceiverClassId(kMintCid);
+    return ic_data.HasReceiverClassId(kSmiCid) ||
+           ic_data.HasReceiverClassId(kMintCid);
   }
-  return (ic_data.NumberOfUsedChecks() == 2)
-      && ic_data.HasReceiverClassId(kSmiCid)
-      && ic_data.HasReceiverClassId(kMintCid);
+  return (ic_data.NumberOfUsedChecks() == 2) &&
+         ic_data.HasReceiverClassId(kSmiCid) &&
+         ic_data.HasReceiverClassId(kMintCid);
 }
 
 
@@ -383,8 +455,8 @@
 
 
 static bool HasOnlyOneDouble(const ICData& ic_data) {
-  return (ic_data.NumberOfUsedChecks() == 1)
-      && ic_data.HasReceiverClassId(kDoubleCid);
+  return (ic_data.NumberOfUsedChecks() == 1) &&
+         ic_data.HasReceiverClassId(kDoubleCid);
 }
 
 
@@ -404,8 +476,7 @@
 }
 
 
-void AotOptimizer::ReplaceCall(Definition* call,
-                               Definition* replacement) {
+void AotOptimizer::ReplaceCall(Definition* call, Definition* replacement) {
   // Remove the original push arguments.
   for (intptr_t i = 0; i < call->ArgumentCount(); ++i) {
     PushArgumentInstr* push = call->PushArgumentAt(i);
@@ -422,11 +493,9 @@
                                Instruction* insert_before) {
   if (to_check->Type()->ToCid() != kSmiCid) {
     InsertBefore(insert_before,
-                 new(Z) CheckSmiInstr(new(Z) Value(to_check),
-                                      deopt_id,
-                                      insert_before->token_pos()),
-                 deopt_environment,
-                 FlowGraph::kEffect);
+                 new (Z) CheckSmiInstr(new (Z) Value(to_check), deopt_id,
+                                       insert_before->token_pos()),
+                 deopt_environment, FlowGraph::kEffect);
   }
 }
 
@@ -437,12 +506,10 @@
                                          TokenPosition token_pos) {
   if ((unary_checks.NumberOfUsedChecks() == 1) &&
       unary_checks.HasReceiverClassId(kSmiCid)) {
-    return new(Z) CheckSmiInstr(new(Z) Value(to_check),
-                                deopt_id,
-                                token_pos);
+    return new (Z) CheckSmiInstr(new (Z) Value(to_check), deopt_id, token_pos);
   }
-  return new(Z) CheckClassInstr(
-      new(Z) Value(to_check), deopt_id, unary_checks, token_pos);
+  return new (Z) CheckClassInstr(new (Z) Value(to_check), deopt_id,
+                                 unary_checks, token_pos);
 }
 
 
@@ -452,8 +519,8 @@
                                  Environment* deopt_environment,
                                  Instruction* insert_before) {
   // Type propagation has not run yet, we cannot eliminate the check.
-  Instruction* check = GetCheckClass(
-      to_check, unary_checks, deopt_id, insert_before->token_pos());
+  Instruction* check = GetCheckClass(to_check, unary_checks, deopt_id,
+                                     insert_before->token_pos());
   InsertBefore(insert_before, check, deopt_environment, FlowGraph::kEffect);
 }
 
@@ -461,9 +528,7 @@
 void AotOptimizer::AddReceiverCheck(InstanceCallInstr* call) {
   AddCheckClass(call->ArgumentAt(0),
                 ICData::ZoneHandle(Z, call->ic_data()->AsUnaryClassChecks()),
-                call->deopt_id(),
-                call->env(),
-                call);
+                call->deopt_id(), call->env(), call);
 }
 
 
@@ -541,12 +606,12 @@
       ASSERT(str.Length() == 1);
       ConstantInstr* char_code_left = flow_graph()->GetConstant(
           Smi::ZoneHandle(Z, Smi::New(static_cast<intptr_t>(str.CharAt(0)))));
-      left_val = new(Z) Value(char_code_left);
+      left_val = new (Z) Value(char_code_left);
     } else if (left->IsOneByteStringFromCharCode()) {
       // Use input of string-from-charcode as left value.
       OneByteStringFromCharCodeInstr* instr =
           left->AsOneByteStringFromCharCode();
-      left_val = new(Z) Value(instr->char_code()->definition());
+      left_val = new (Z) Value(instr->char_code()->definition());
       to_remove_left = instr;
     } else {
       // IsLengthOneString(left) should have been false.
@@ -559,32 +624,24 @@
       // Skip string-from-char-code, and use its input as right value.
       OneByteStringFromCharCodeInstr* right_instr =
           right->AsOneByteStringFromCharCode();
-      right_val = new(Z) Value(right_instr->char_code()->definition());
+      right_val = new (Z) Value(right_instr->char_code()->definition());
       to_remove_right = right_instr;
     } else {
       const ICData& unary_checks_1 =
           ICData::ZoneHandle(Z, call->ic_data()->AsUnaryClassChecksForArgNr(1));
-      AddCheckClass(right,
-                    unary_checks_1,
-                    call->deopt_id(),
-                    call->env(),
-                    call);
+      AddCheckClass(right, unary_checks_1, call->deopt_id(), call->env(), call);
       // String-to-char-code instructions returns -1 (illegal charcode) if
       // string is not of length one.
-      StringToCharCodeInstr* char_code_right =
-          new(Z) StringToCharCodeInstr(new(Z) Value(right), kOneByteStringCid);
+      StringToCharCodeInstr* char_code_right = new (Z)
+          StringToCharCodeInstr(new (Z) Value(right), kOneByteStringCid);
       InsertBefore(call, char_code_right, call->env(), FlowGraph::kValue);
-      right_val = new(Z) Value(char_code_right);
+      right_val = new (Z) Value(char_code_right);
     }
 
     // Comparing char-codes instead of strings.
     EqualityCompareInstr* comp =
-        new(Z) EqualityCompareInstr(call->token_pos(),
-                                    op_kind,
-                                    left_val,
-                                    right_val,
-                                    kSmiCid,
-                                    call->deopt_id());
+        new (Z) EqualityCompareInstr(call->token_pos(), op_kind, left_val,
+                                     right_val, kSmiCid, call->deopt_id());
     ReplaceCall(call, comp);
 
     // Remove dead instructions.
@@ -604,7 +661,58 @@
 }
 
 
-static bool SmiFitsInDouble() { return kSmiBits < 53; }
+static bool SmiFitsInDouble() {
+  return kSmiBits < 53;
+}
+
+
+static bool IsGetRuntimeType(Definition* defn) {
+  StaticCallInstr* call = defn->AsStaticCall();
+  return (call != NULL) && (call->function().recognized_kind() ==
+                            MethodRecognizer::kObjectRuntimeType);
+}
+
+
+// Recognize a.runtimeType == b.runtimeType and fold it into
+// Object._haveSameRuntimeType(a, b).
+// Note: this optimization is not speculative.
+bool AotOptimizer::TryReplaceWithHaveSameRuntimeType(InstanceCallInstr* call) {
+  const ICData& ic_data = *call->ic_data();
+  ASSERT(ic_data.NumArgsTested() == 2);
+
+  ASSERT(call->ArgumentCount() == 2);
+  Definition* left = call->ArgumentAt(0);
+  Definition* right = call->ArgumentAt(1);
+
+  if (IsGetRuntimeType(left) && left->input_use_list()->IsSingleUse() &&
+      IsGetRuntimeType(right) && right->input_use_list()->IsSingleUse()) {
+    const Class& cls = Class::Handle(Z, I->object_store()->object_class());
+    const Function& have_same_runtime_type = Function::ZoneHandle(
+        Z,
+        cls.LookupStaticFunctionAllowPrivate(Symbols::HaveSameRuntimeType()));
+    ASSERT(!have_same_runtime_type.IsNull());
+
+    ZoneGrowableArray<PushArgumentInstr*>* args =
+        new (Z) ZoneGrowableArray<PushArgumentInstr*>(2);
+    PushArgumentInstr* arg =
+        new (Z) PushArgumentInstr(new (Z) Value(left->ArgumentAt(0)));
+    InsertBefore(call, arg, NULL, FlowGraph::kEffect);
+    args->Add(arg);
+    arg = new (Z) PushArgumentInstr(new (Z) Value(right->ArgumentAt(0)));
+    InsertBefore(call, arg, NULL, FlowGraph::kEffect);
+    args->Add(arg);
+    StaticCallInstr* static_call =
+        new (Z) StaticCallInstr(call->token_pos(), have_same_runtime_type,
+                                Object::null_array(),  // argument_names
+                                args, call->deopt_id());
+    static_call->set_result_cid(kBoolCid);
+    ReplaceCall(call, static_call);
+    return true;
+  }
+
+  return false;
+}
+
 
 bool AotOptimizer::TryReplaceWithEqualityOp(InstanceCallInstr* call,
                                             Token::Kind op_kind) {
@@ -617,24 +725,16 @@
 
   intptr_t cid = kIllegalCid;
   if (HasOnlyTwoOf(ic_data, kOneByteStringCid)) {
-    if (TryStringLengthOneEquality(call, op_kind)) {
-      return true;
-    } else {
-      return false;
-    }
+    return TryStringLengthOneEquality(call, op_kind);
   } else if (HasOnlyTwoOf(ic_data, kSmiCid)) {
     InsertBefore(call,
-                 new(Z) CheckSmiInstr(new(Z) Value(left),
-                                      call->deopt_id(),
-                                      call->token_pos()),
-                 call->env(),
-                 FlowGraph::kEffect);
+                 new (Z) CheckSmiInstr(new (Z) Value(left), call->deopt_id(),
+                                       call->token_pos()),
+                 call->env(), FlowGraph::kEffect);
     InsertBefore(call,
-                 new(Z) CheckSmiInstr(new(Z) Value(right),
-                                      call->deopt_id(),
-                                      call->token_pos()),
-                 call->env(),
-                 FlowGraph::kEffect);
+                 new (Z) CheckSmiInstr(new (Z) Value(right), call->deopt_id(),
+                                       call->token_pos()),
+                 call->env(), FlowGraph::kEffect);
     cid = kSmiCid;
   } else if (HasTwoMintOrSmi(ic_data) &&
              FlowGraphCompiler::SupportsUnboxedMints()) {
@@ -649,13 +749,10 @@
         // call.
         return false;
       } else {
-        InsertBefore(call,
-                     new(Z) CheckEitherNonSmiInstr(
-                         new(Z) Value(left),
-                         new(Z) Value(right),
-                         call->deopt_id()),
-                     call->env(),
-                     FlowGraph::kEffect);
+        InsertBefore(call, new (Z) CheckEitherNonSmiInstr(new (Z) Value(left),
+                                                          new (Z) Value(right),
+                                                          call->deopt_id()),
+                     call->env(), FlowGraph::kEffect);
         cid = kDoubleCid;
       }
     }
@@ -666,37 +763,28 @@
     GrowableArray<intptr_t> smi_or_null(2);
     smi_or_null.Add(kSmiCid);
     smi_or_null.Add(kNullCid);
-    if (ICDataHasOnlyReceiverArgumentClassIds(ic_data,
-                                              smi_or_null,
+    if (ICDataHasOnlyReceiverArgumentClassIds(ic_data, smi_or_null,
                                               smi_or_null)) {
       const ICData& unary_checks_0 =
           ICData::ZoneHandle(Z, call->ic_data()->AsUnaryClassChecks());
-      AddCheckClass(left,
-                    unary_checks_0,
-                    call->deopt_id(),
-                    call->env(),
-                    call);
+      AddCheckClass(left, unary_checks_0, call->deopt_id(), call->env(), call);
 
       const ICData& unary_checks_1 =
           ICData::ZoneHandle(Z, call->ic_data()->AsUnaryClassChecksForArgNr(1));
-      AddCheckClass(right,
-                    unary_checks_1,
-                    call->deopt_id(),
-                    call->env(),
-                    call);
+      AddCheckClass(right, unary_checks_1, call->deopt_id(), call->env(), call);
       cid = kSmiCid;
     } else {
       // Shortcut for equality with null.
+      // TODO(vegorov): this optimization is not speculative and should
+      // be hoisted out of this function.
       ConstantInstr* right_const = right->AsConstant();
       ConstantInstr* left_const = left->AsConstant();
       if ((right_const != NULL && right_const->value().IsNull()) ||
           (left_const != NULL && left_const->value().IsNull())) {
-        StrictCompareInstr* comp =
-            new(Z) StrictCompareInstr(call->token_pos(),
-                                      Token::kEQ_STRICT,
-                                      new(Z) Value(left),
-                                      new(Z) Value(right),
-                                      false);  // No number check.
+        StrictCompareInstr* comp = new (Z)
+            StrictCompareInstr(call->token_pos(), Token::kEQ_STRICT,
+                               new (Z) Value(left), new (Z) Value(right),
+                               false);  // No number check.
         ReplaceCall(call, comp);
         return true;
       }
@@ -704,12 +792,9 @@
     }
   }
   ASSERT(cid != kIllegalCid);
-  EqualityCompareInstr* comp = new(Z) EqualityCompareInstr(call->token_pos(),
-                                                           op_kind,
-                                                           new(Z) Value(left),
-                                                           new(Z) Value(right),
-                                                           cid,
-                                                           call->deopt_id());
+  EqualityCompareInstr* comp = new (Z)
+      EqualityCompareInstr(call->token_pos(), op_kind, new (Z) Value(left),
+                           new (Z) Value(right), cid, call->deopt_id());
   ReplaceCall(call, comp);
   return true;
 }
@@ -727,17 +812,13 @@
   intptr_t cid = kIllegalCid;
   if (HasOnlyTwoOf(ic_data, kSmiCid)) {
     InsertBefore(call,
-                 new(Z) CheckSmiInstr(new(Z) Value(left),
-                                      call->deopt_id(),
-                                      call->token_pos()),
-                 call->env(),
-                 FlowGraph::kEffect);
+                 new (Z) CheckSmiInstr(new (Z) Value(left), call->deopt_id(),
+                                       call->token_pos()),
+                 call->env(), FlowGraph::kEffect);
     InsertBefore(call,
-                 new(Z) CheckSmiInstr(new(Z) Value(right),
-                                      call->deopt_id(),
-                                      call->token_pos()),
-                 call->env(),
-                 FlowGraph::kEffect);
+                 new (Z) CheckSmiInstr(new (Z) Value(right), call->deopt_id(),
+                                       call->token_pos()),
+                 call->env(), FlowGraph::kEffect);
     cid = kSmiCid;
   } else if (HasTwoMintOrSmi(ic_data) &&
              FlowGraphCompiler::SupportsUnboxedMints()) {
@@ -752,13 +833,10 @@
         // call.
         return false;
       } else {
-        InsertBefore(call,
-                     new(Z) CheckEitherNonSmiInstr(
-                         new(Z) Value(left),
-                         new(Z) Value(right),
-                         call->deopt_id()),
-                     call->env(),
-                     FlowGraph::kEffect);
+        InsertBefore(call, new (Z) CheckEitherNonSmiInstr(new (Z) Value(left),
+                                                          new (Z) Value(right),
+                                                          call->deopt_id()),
+                     call->env(), FlowGraph::kEffect);
         cid = kDoubleCid;
       }
     }
@@ -766,12 +844,9 @@
     return false;
   }
   ASSERT(cid != kIllegalCid);
-  RelationalOpInstr* comp = new(Z) RelationalOpInstr(call->token_pos(),
-                                                     op_kind,
-                                                     new(Z) Value(left),
-                                                     new(Z) Value(right),
-                                                     cid,
-                                                     call->deopt_id());
+  RelationalOpInstr* comp =
+      new (Z) RelationalOpInstr(call->token_pos(), op_kind, new (Z) Value(left),
+                                new (Z) Value(right), cid, call->deopt_id());
   ReplaceCall(call, comp);
   return true;
 }
@@ -790,8 +865,8 @@
         // Don't generate smi code if the IC data is marked because
         // of an overflow.
         operands_type = ic_data.HasDeoptReason(ICData::kDeoptBinarySmiOp)
-            ? kMintCid
-            : kSmiCid;
+                            ? kMintCid
+                            : kSmiCid;
       } else if (HasTwoMintOrSmi(ic_data) &&
                  FlowGraphCompiler::SupportsUnboxedMints()) {
         // Don't generate mint code if the IC data is marked because of an
@@ -847,11 +922,11 @@
           return false;
         }
         operands_type = ic_data.HasDeoptReason(ICData::kDeoptBinarySmiOp)
-            ? kMintCid
-            : kSmiCid;
+                            ? kMintCid
+                            : kSmiCid;
       } else if (HasTwoMintOrSmi(ic_data) &&
-                 HasOnlyOneSmi(ICData::Handle(Z,
-                     ic_data.AsUnaryClassChecksForArgNr(1)))) {
+                 HasOnlyOneSmi(ICData::Handle(
+                     Z, ic_data.AsUnaryClassChecksForArgNr(1)))) {
         // Don't generate mint code if the IC data is marked because of an
         // overflow.
         if (ic_data.HasDeoptReason(ICData::kDeoptBinaryMintOp)) {
@@ -890,34 +965,25 @@
     // binary operation with two smis is a smi not a double, except '/' which
     // returns a double for two smis.
     if (op_kind != Token::kDIV) {
-      InsertBefore(call,
-                   new(Z) CheckEitherNonSmiInstr(
-                       new(Z) Value(left),
-                       new(Z) Value(right),
-                       call->deopt_id()),
-                   call->env(),
-                   FlowGraph::kEffect);
+      InsertBefore(call, new (Z) CheckEitherNonSmiInstr(new (Z) Value(left),
+                                                        new (Z) Value(right),
+                                                        call->deopt_id()),
+                   call->env(), FlowGraph::kEffect);
     }
 
-    BinaryDoubleOpInstr* double_bin_op =
-        new(Z) BinaryDoubleOpInstr(op_kind,
-                                   new(Z) Value(left),
-                                   new(Z) Value(right),
-                                   call->deopt_id(), call->token_pos());
+    BinaryDoubleOpInstr* double_bin_op = new (Z)
+        BinaryDoubleOpInstr(op_kind, new (Z) Value(left), new (Z) Value(right),
+                            call->deopt_id(), call->token_pos());
     ReplaceCall(call, double_bin_op);
   } else if (operands_type == kMintCid) {
     if (!FlowGraphCompiler::SupportsUnboxedMints()) return false;
     if ((op_kind == Token::kSHR) || (op_kind == Token::kSHL)) {
-      ShiftMintOpInstr* shift_op =
-          new(Z) ShiftMintOpInstr(
-              op_kind, new(Z) Value(left), new(Z) Value(right),
-              call->deopt_id());
+      ShiftMintOpInstr* shift_op = new (Z) ShiftMintOpInstr(
+          op_kind, new (Z) Value(left), new (Z) Value(right), call->deopt_id());
       ReplaceCall(call, shift_op);
     } else {
-      BinaryMintOpInstr* bin_op =
-          new(Z) BinaryMintOpInstr(
-              op_kind, new(Z) Value(left), new(Z) Value(right),
-              call->deopt_id());
+      BinaryMintOpInstr* bin_op = new (Z) BinaryMintOpInstr(
+          op_kind, new (Z) Value(left), new (Z) Value(right), call->deopt_id());
       ReplaceCall(call, bin_op);
     }
   } else if (operands_type == kFloat32x4Cid) {
@@ -934,19 +1000,14 @@
         // Insert smi check and attach a copy of the original environment
         // because the smi operation can still deoptimize.
         InsertBefore(call,
-                     new(Z) CheckSmiInstr(new(Z) Value(left),
-                                          call->deopt_id(),
-                                          call->token_pos()),
-                     call->env(),
-                     FlowGraph::kEffect);
-        ConstantInstr* constant =
-            flow_graph()->GetConstant(Smi::Handle(Z,
-                Smi::New(Smi::Cast(obj).Value() - 1)));
+                     new (Z) CheckSmiInstr(new (Z) Value(left),
+                                           call->deopt_id(), call->token_pos()),
+                     call->env(), FlowGraph::kEffect);
+        ConstantInstr* constant = flow_graph()->GetConstant(
+            Smi::Handle(Z, Smi::New(Smi::Cast(obj).Value() - 1)));
         BinarySmiOpInstr* bin_op =
-            new(Z) BinarySmiOpInstr(Token::kBIT_AND,
-                                    new(Z) Value(left),
-                                    new(Z) Value(constant),
-                                    call->deopt_id());
+            new (Z) BinarySmiOpInstr(Token::kBIT_AND, new (Z) Value(left),
+                                     new (Z) Value(constant), call->deopt_id());
         ReplaceCall(call, bin_op);
         return true;
       }
@@ -955,11 +1016,8 @@
     // environment because the smi operation can still deoptimize.
     AddCheckSmi(left, call->deopt_id(), call->env(), call);
     AddCheckSmi(right, call->deopt_id(), call->env(), call);
-    BinarySmiOpInstr* bin_op =
-        new(Z) BinarySmiOpInstr(op_kind,
-                                new(Z) Value(left),
-                                new(Z) Value(right),
-                                call->deopt_id());
+    BinarySmiOpInstr* bin_op = new (Z) BinarySmiOpInstr(
+        op_kind, new (Z) Value(left), new (Z) Value(right), call->deopt_id());
     ReplaceCall(call, bin_op);
   } else {
     ASSERT(operands_type == kSmiCid);
@@ -974,12 +1032,8 @@
       left = right;
       right = temp;
     }
-    BinarySmiOpInstr* bin_op =
-        new(Z) BinarySmiOpInstr(
-            op_kind,
-            new(Z) Value(left),
-            new(Z) Value(right),
-            call->deopt_id());
+    BinarySmiOpInstr* bin_op = new (Z) BinarySmiOpInstr(
+        op_kind, new (Z) Value(left), new (Z) Value(right), call->deopt_id());
     ReplaceCall(call, bin_op);
   }
   return true;
@@ -993,24 +1047,21 @@
   Definition* unary_op = NULL;
   if (HasOnlyOneSmi(*call->ic_data())) {
     InsertBefore(call,
-                 new(Z) CheckSmiInstr(new(Z) Value(input),
-                                      call->deopt_id(),
-                                      call->token_pos()),
-                 call->env(),
-                 FlowGraph::kEffect);
-    unary_op = new(Z) UnarySmiOpInstr(
-        op_kind, new(Z) Value(input), call->deopt_id());
+                 new (Z) CheckSmiInstr(new (Z) Value(input), call->deopt_id(),
+                                       call->token_pos()),
+                 call->env(), FlowGraph::kEffect);
+    unary_op = new (Z)
+        UnarySmiOpInstr(op_kind, new (Z) Value(input), call->deopt_id());
   } else if ((op_kind == Token::kBIT_NOT) &&
              HasOnlySmiOrMint(*call->ic_data()) &&
              FlowGraphCompiler::SupportsUnboxedMints()) {
-    unary_op = new(Z) UnaryMintOpInstr(
-        op_kind, new(Z) Value(input), call->deopt_id());
+    unary_op = new (Z)
+        UnaryMintOpInstr(op_kind, new (Z) Value(input), call->deopt_id());
   } else if (HasOnlyOneDouble(*call->ic_data()) &&
-             (op_kind == Token::kNEGATE) &&
-             CanUnboxDouble()) {
+             (op_kind == Token::kNEGATE) && CanUnboxDouble()) {
     AddReceiverCheck(call);
-    unary_op = new(Z) UnaryDoubleOpInstr(
-        Token::kNEGATE, new(Z) Value(input), call->deopt_id());
+    unary_op = new (Z) UnaryDoubleOpInstr(Token::kNEGATE, new (Z) Value(input),
+                                          call->deopt_id());
   } else {
     return false;
   }
@@ -1021,8 +1072,7 @@
 
 
 // Using field class
-RawField* AotOptimizer::GetField(intptr_t class_id,
-                                 const String& field_name) {
+RawField* AotOptimizer::GetField(intptr_t class_id, const String& field_name) {
   Class& cls = Class::Handle(Z, isolate()->class_table()->At(class_id));
   Field& field = Field::Handle(Z);
   while (!cls.IsNull()) {
@@ -1046,19 +1096,16 @@
   // Inline implicit instance getter.
   const String& field_name =
       String::Handle(Z, Field::NameFromGetter(call->function_name()));
-  const Field& field =
-      Field::ZoneHandle(Z, GetField(class_ids[0], field_name));
+  const Field& field = Field::ZoneHandle(Z, GetField(class_ids[0], field_name));
   ASSERT(!field.IsNull());
 
-  if (flow_graph()->InstanceCallNeedsClassCheck(
-          call, RawFunction::kImplicitGetter)) {
+  if (flow_graph()->InstanceCallNeedsClassCheck(call,
+                                                RawFunction::kImplicitGetter)) {
     return false;
   }
-  LoadFieldInstr* load = new(Z) LoadFieldInstr(
-      new(Z) Value(call->ArgumentAt(0)),
-      &field,
-      AbstractType::ZoneHandle(Z, field.type()),
-      call->token_pos());
+  LoadFieldInstr* load = new (Z) LoadFieldInstr(
+      new (Z) Value(call->ArgumentAt(0)), &field,
+      AbstractType::ZoneHandle(Z, field.type()), call->token_pos());
   load->set_is_immutable(field.is_final());
 
   // Discard the environment from the original instruction because the load
@@ -1068,9 +1115,7 @@
 
   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()) {
+    for (Value::Iterator it(load->input_use_list()); !it.Done(); it.Advance()) {
       it.Current()->SetReachingType(NULL);
     }
   }
@@ -1087,24 +1132,16 @@
   Definition* left = call->ArgumentAt(0);
   Definition* right = call->ArgumentAt(1);
   // Type check left.
-  AddCheckClass(left,
-                ICData::ZoneHandle(
-                    Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
-                call->deopt_id(),
-                call->env(),
-                call);
+  AddCheckClass(left, ICData::ZoneHandle(
+                          Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
+                call->deopt_id(), call->env(), call);
   // Type check right.
-  AddCheckClass(right,
-                ICData::ZoneHandle(
-                    Z, call->ic_data()->AsUnaryClassChecksForArgNr(1)),
-                call->deopt_id(),
-                call->env(),
-                call);
+  AddCheckClass(right, ICData::ZoneHandle(
+                           Z, call->ic_data()->AsUnaryClassChecksForArgNr(1)),
+                call->deopt_id(), call->env(), call);
   // Replace call.
-  BinaryFloat32x4OpInstr* float32x4_bin_op =
-      new(Z) BinaryFloat32x4OpInstr(
-          op_kind, new(Z) Value(left), new(Z) Value(right),
-          call->deopt_id());
+  BinaryFloat32x4OpInstr* float32x4_bin_op = new (Z) BinaryFloat32x4OpInstr(
+      op_kind, new (Z) Value(left), new (Z) Value(right), call->deopt_id());
   ReplaceCall(call, float32x4_bin_op);
 
   return true;
@@ -1120,24 +1157,16 @@
   Definition* left = call->ArgumentAt(0);
   Definition* right = call->ArgumentAt(1);
   // Type check left.
-  AddCheckClass(left,
-                ICData::ZoneHandle(
-                    Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
-                call->deopt_id(),
-                call->env(),
-                call);
+  AddCheckClass(left, ICData::ZoneHandle(
+                          Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
+                call->deopt_id(), call->env(), call);
   // Type check right.
-  AddCheckClass(right,
-                ICData::ZoneHandle(Z,
-                    call->ic_data()->AsUnaryClassChecksForArgNr(1)),
-                call->deopt_id(),
-                call->env(),
-                call);
+  AddCheckClass(right, ICData::ZoneHandle(
+                           Z, call->ic_data()->AsUnaryClassChecksForArgNr(1)),
+                call->deopt_id(), call->env(), call);
   // Replace call.
-  BinaryInt32x4OpInstr* int32x4_bin_op =
-      new(Z) BinaryInt32x4OpInstr(
-          op_kind, new(Z) Value(left), new(Z) Value(right),
-          call->deopt_id());
+  BinaryInt32x4OpInstr* int32x4_bin_op = new (Z) BinaryInt32x4OpInstr(
+      op_kind, new (Z) Value(left), new (Z) Value(right), call->deopt_id());
   ReplaceCall(call, int32x4_bin_op);
   return true;
 }
@@ -1152,24 +1181,16 @@
   Definition* left = call->ArgumentAt(0);
   Definition* right = call->ArgumentAt(1);
   // Type check left.
-  AddCheckClass(left,
-                ICData::ZoneHandle(
-                    call->ic_data()->AsUnaryClassChecksForArgNr(0)),
-                call->deopt_id(),
-                call->env(),
-                call);
+  AddCheckClass(
+      left, ICData::ZoneHandle(call->ic_data()->AsUnaryClassChecksForArgNr(0)),
+      call->deopt_id(), call->env(), call);
   // Type check right.
-  AddCheckClass(right,
-                ICData::ZoneHandle(
-                    call->ic_data()->AsUnaryClassChecksForArgNr(1)),
-                call->deopt_id(),
-                call->env(),
-                call);
+  AddCheckClass(
+      right, ICData::ZoneHandle(call->ic_data()->AsUnaryClassChecksForArgNr(1)),
+      call->deopt_id(), call->env(), call);
   // Replace call.
-  BinaryFloat64x2OpInstr* float64x2_bin_op =
-      new(Z) BinaryFloat64x2OpInstr(
-          op_kind, new(Z) Value(left), new(Z) Value(right),
-          call->deopt_id());
+  BinaryFloat64x2OpInstr* float64x2_bin_op = new (Z) BinaryFloat64x2OpInstr(
+      op_kind, new (Z) Value(left), new (Z) Value(right), call->deopt_id());
   ReplaceCall(call, float64x2_bin_op);
   return true;
 }
@@ -1205,15 +1226,12 @@
     MethodRecognizer::Kind recognized_kind) {
   AddReceiverCheck(call);
   ZoneGrowableArray<Value*>* args =
-      new(Z) ZoneGrowableArray<Value*>(call->ArgumentCount());
+      new (Z) ZoneGrowableArray<Value*>(call->ArgumentCount());
   for (intptr_t i = 0; i < call->ArgumentCount(); i++) {
-    args->Add(new(Z) Value(call->ArgumentAt(i)));
+    args->Add(new (Z) Value(call->ArgumentAt(i)));
   }
-  InvokeMathCFunctionInstr* invoke =
-      new(Z) InvokeMathCFunctionInstr(args,
-                                      call->deopt_id(),
-                                      recognized_kind,
-                                      call->token_pos());
+  InvokeMathCFunctionInstr* invoke = new (Z) InvokeMathCFunctionInstr(
+      args, call->deopt_id(), recognized_kind, call->token_pos());
   ReplaceCall(call, invoke);
 }
 
@@ -1238,15 +1256,14 @@
     if (class_ids[0] == kSmiCid) {
       AddReceiverCheck(call);
       ReplaceCall(call,
-                  new(Z) SmiToDoubleInstr(
-                      new(Z) Value(call->ArgumentAt(0)),
-                      call->token_pos()));
+                  new (Z) SmiToDoubleInstr(new (Z) Value(call->ArgumentAt(0)),
+                                           call->token_pos()));
       return true;
     } else if ((class_ids[0] == kMintCid) && CanConvertUnboxedMintToDouble()) {
       AddReceiverCheck(call);
       ReplaceCall(call,
-                  new(Z) MintToDoubleInstr(new(Z) Value(call->ArgumentAt(0)),
-                                           call->deopt_id()));
+                  new (Z) MintToDoubleInstr(new (Z) Value(call->ArgumentAt(0)),
+                                            call->deopt_id()));
       return true;
     }
   }
@@ -1264,12 +1281,11 @@
         Definition* d2i_instr = NULL;
         if (ic_data.HasDeoptReason(ICData::kDeoptDoubleToSmi)) {
           // Do not repeatedly deoptimize because result didn't fit into Smi.
-          d2i_instr =  new(Z) DoubleToIntegerInstr(
-              new(Z) Value(input), call);
+          d2i_instr = new (Z) DoubleToIntegerInstr(new (Z) Value(input), call);
         } else {
           // Optimistically assume result fits into Smi.
-          d2i_instr = new(Z) DoubleToSmiInstr(
-              new(Z) Value(input), call->deopt_id());
+          d2i_instr =
+              new (Z) DoubleToSmiInstr(new (Z) Value(input), call->deopt_id());
         }
         ReplaceCall(call, d2i_instr);
         return true;
@@ -1286,8 +1302,8 @@
         } else {
           AddReceiverCheck(call);
           DoubleToDoubleInstr* d2d_instr =
-              new(Z) DoubleToDoubleInstr(new(Z) Value(call->ArgumentAt(0)),
-                                         recognized_kind, call->deopt_id());
+              new (Z) DoubleToDoubleInstr(new (Z) Value(call->ArgumentAt(0)),
+                                          recognized_kind, call->deopt_id());
           ReplaceCall(call, d2d_instr);
         }
         return true;
@@ -1328,7 +1344,7 @@
     const TypeArguments& type_arguments =
         TypeArguments::Handle(Z, type.arguments());
     const bool is_raw_type = type_arguments.IsNull() ||
-        type_arguments.IsRaw(from_index, num_type_params);
+                             type_arguments.IsRaw(from_index, num_type_params);
     if (!is_raw_type) {
       // Unknown result.
       return Bool::null();
@@ -1345,13 +1361,9 @@
     if (cls.NumTypeArguments() > 0) {
       return Bool::null();
     }
-    const bool is_subtype = cls.IsSubtypeOf(
-        TypeArguments::Handle(Z),
-        type_class,
-        TypeArguments::Handle(Z),
-        NULL,
-        NULL,
-        Heap::kOld);
+    const bool is_subtype =
+        cls.IsSubtypeOf(TypeArguments::Handle(Z), type_class,
+                        TypeArguments::Handle(Z), NULL, NULL, Heap::kOld);
     results->Add(cls.id());
     results->Add(is_subtype);
     if (prev.IsNull()) {
@@ -1362,7 +1374,7 @@
       }
     }
   }
-  return results_differ ?  Bool::null() : prev.raw();
+  return results_differ ? Bool::null() : prev.raw();
 }
 
 
@@ -1385,7 +1397,8 @@
   if (!type_class.IsPrivate()) {
     if (isolate()->all_classes_finalized()) {
       if (FLAG_trace_cha) {
-        THR_Print("  **(CHA) Typecheck as class equality since no "
+        THR_Print(
+            "  **(CHA) Typecheck as class equality since no "
             "subclasses: %s\n",
             type_class.ToCString());
       }
@@ -1403,7 +1416,7 @@
     const TypeArguments& type_arguments =
         TypeArguments::Handle(type.arguments());
     const bool is_raw_type = type_arguments.IsNull() ||
-        type_arguments.IsRaw(from_index, num_type_params);
+                             type_arguments.IsRaw(from_index, num_type_params);
     return is_raw_type;
   }
   return true;
@@ -1439,12 +1452,9 @@
   if ((*results)[0] != kSmiCid) {
     const Class& cls = Class::Handle(class_table.At(kSmiCid));
     const Class& type_class = Class::Handle(type.type_class());
-    const bool smi_is_subtype = cls.IsSubtypeOf(TypeArguments::Handle(),
-                                                type_class,
-                                                TypeArguments::Handle(),
-                                                NULL,
-                                                NULL,
-                                                Heap::kOld);
+    const bool smi_is_subtype =
+        cls.IsSubtypeOf(TypeArguments::Handle(), type_class,
+                        TypeArguments::Handle(), NULL, NULL, Heap::kOld);
     results->Add((*results)[results->length() - 2]);
     results->Add((*results)[results->length() - 2]);
     for (intptr_t i = results->length() - 3; i > 1; --i) {
@@ -1511,30 +1521,31 @@
       } else {
         UNIMPLEMENTED();
       }
-      negate = Bool::Cast(call->ArgumentAt(1)->OriginalDefinition()
-                          ->AsConstant()->value()).value();
+      negate =
+          Bool::Cast(
+              call->ArgumentAt(1)->OriginalDefinition()->AsConstant()->value())
+              .value();
     }
   } else {
     type_args = call->ArgumentAt(1);
     type = AbstractType::Cast(call->ArgumentAt(2)->AsConstant()->value()).raw();
-    negate = Bool::Cast(call->ArgumentAt(3)->OriginalDefinition()
-        ->AsConstant()->value()).value();
+    negate =
+        Bool::Cast(
+            call->ArgumentAt(3)->OriginalDefinition()->AsConstant()->value())
+            .value();
   }
 
   if (TypeCheckAsClassEquality(type)) {
-    LoadClassIdInstr* left_cid = new(Z) LoadClassIdInstr(new(Z) Value(left));
+    LoadClassIdInstr* left_cid = new (Z) LoadClassIdInstr(new (Z) Value(left));
     InsertBefore(call, left_cid, NULL, FlowGraph::kValue);
     const intptr_t type_cid = Class::Handle(Z, type.type_class()).id();
     ConstantInstr* cid =
         flow_graph()->GetConstant(Smi::Handle(Z, Smi::New(type_cid)));
 
-    StrictCompareInstr* check_cid =
-        new(Z) StrictCompareInstr(
-            call->token_pos(),
-            negate ? Token::kNE_STRICT : Token::kEQ_STRICT,
-            new(Z) Value(left_cid),
-            new(Z) Value(cid),
-            false);  // No number check.
+    StrictCompareInstr* check_cid = new (Z) StrictCompareInstr(
+        call->token_pos(), negate ? Token::kNE_STRICT : Token::kEQ_STRICT,
+        new (Z) Value(left_cid), new (Z) Value(cid),
+        false);  // No number check.
     ReplaceCall(call, check_cid);
     return;
   }
@@ -1546,7 +1557,7 @@
     // left.instanceof(type) =>
     //     _classRangeCheck(left.cid, lower_limit, upper_limit)
 
-    LoadClassIdInstr* left_cid = new(Z) LoadClassIdInstr(new(Z) Value(left));
+    LoadClassIdInstr* left_cid = new (Z) LoadClassIdInstr(new (Z) Value(left));
     InsertBefore(call, left_cid, NULL, FlowGraph::kValue);
     ConstantInstr* lower_cid =
         flow_graph()->GetConstant(Smi::Handle(Z, Smi::New(lower_limit)));
@@ -1554,7 +1565,7 @@
         flow_graph()->GetConstant(Smi::Handle(Z, Smi::New(upper_limit)));
 
     ZoneGrowableArray<PushArgumentInstr*>* args =
-        new(Z) ZoneGrowableArray<PushArgumentInstr*>(3);
+        new (Z) ZoneGrowableArray<PushArgumentInstr*>(3);
     PushArgumentInstr* arg = new (Z) PushArgumentInstr(new (Z) Value(left_cid));
     InsertBefore(call, arg, NULL, FlowGraph::kEffect);
     args->Add(arg);
@@ -1569,17 +1580,15 @@
         Library::Handle(Z, Library::InternalLibrary());
     const String& target_name = negate ? Symbols::_classRangeCheckNegative()
                                        : Symbols::_classRangeCheck();
-    const Function& target = Function::ZoneHandle(Z,
-        dart_internal.LookupFunctionAllowPrivate(target_name));
+    const Function& target = Function::ZoneHandle(
+        Z, dart_internal.LookupFunctionAllowPrivate(target_name));
     ASSERT(!target.IsNull());
     ASSERT(target.IsRecognized() && target.always_inline());
 
-    StaticCallInstr* new_call = new (Z) StaticCallInstr(
-        call->token_pos(),
-        target,
-        Object::null_array(),  // argument_names
-        args,
-        call->deopt_id());
+    StaticCallInstr* new_call =
+        new (Z) StaticCallInstr(call->token_pos(), target,
+                                Object::null_array(),  // argument_names
+                                args, call->deopt_id());
     ReplaceCall(call, new_call);
     return;
   }
@@ -1589,7 +1598,7 @@
   if ((unary_checks.NumberOfChecks() > 0) &&
       (unary_checks.NumberOfChecks() <= FLAG_max_polymorphic_checks)) {
     ZoneGrowableArray<intptr_t>* results =
-        new(Z) ZoneGrowableArray<intptr_t>(unary_checks.NumberOfChecks() * 2);
+        new (Z) ZoneGrowableArray<intptr_t>(unary_checks.NumberOfChecks() * 2);
     InstanceOfAsBool(unary_checks, type, results);
     if (results->length() == unary_checks.NumberOfChecks() * 2) {
       const bool can_deopt = TryExpandTestCidsResult(results, type);
@@ -1597,25 +1606,19 @@
         // Guard against repeated speculative inlining.
         return;
       }
-      TestCidsInstr* test_cids = new(Z) TestCidsInstr(
-          call->token_pos(),
-          negate ? Token::kISNOT : Token::kIS,
-          new(Z) Value(left),
-          *results,
-          can_deopt ? call->deopt_id() : Thread::kNoDeoptId);
+      TestCidsInstr* test_cids = new (Z)
+          TestCidsInstr(call->token_pos(), negate ? Token::kISNOT : Token::kIS,
+                        new (Z) Value(left), *results,
+                        can_deopt ? call->deopt_id() : Thread::kNoDeoptId);
       // Remove type.
       ReplaceCall(call, test_cids);
       return;
     }
   }
 
-  InstanceOfInstr* instance_of =
-      new(Z) InstanceOfInstr(call->token_pos(),
-                             new(Z) Value(left),
-                             new(Z) Value(type_args),
-                             type,
-                             negate,
-                             call->deopt_id());
+  InstanceOfInstr* instance_of = new (Z)
+      InstanceOfInstr(call->token_pos(), new (Z) Value(left),
+                      new (Z) Value(type_args), type, negate, call->deopt_id());
   ReplaceCall(call, instance_of);
 }
 
@@ -1633,9 +1636,9 @@
   if ((unary_checks.NumberOfChecks() > 0) &&
       (unary_checks.NumberOfChecks() <= FLAG_max_polymorphic_checks)) {
     ZoneGrowableArray<intptr_t>* results =
-        new(Z) ZoneGrowableArray<intptr_t>(unary_checks.NumberOfChecks() * 2);
-    const Bool& as_bool = Bool::ZoneHandle(Z,
-        InstanceOfAsBool(unary_checks, type, results));
+        new (Z) ZoneGrowableArray<intptr_t>(unary_checks.NumberOfChecks() * 2);
+    const Bool& as_bool =
+        Bool::ZoneHandle(Z, InstanceOfAsBool(unary_checks, type, results));
     if (as_bool.raw() == Bool::True().raw()) {
       // Guard against repeated speculative inlining.
       if (!IsAllowedForInlining(call->deopt_id())) {
@@ -1655,13 +1658,9 @@
       return;
     }
   }
-  AssertAssignableInstr* assert_as =
-      new(Z) AssertAssignableInstr(call->token_pos(),
-                                   new(Z) Value(left),
-                                   new(Z) Value(type_args),
-                                   type,
-                                   Symbols::InTypeCast(),
-                                   call->deopt_id());
+  AssertAssignableInstr* assert_as = new (Z) AssertAssignableInstr(
+      call->token_pos(), new (Z) Value(left), new (Z) Value(type_args), type,
+      Symbols::InTypeCast(), call->deopt_id());
   ReplaceCall(call, assert_as);
 }
 
@@ -1702,8 +1701,7 @@
 
   const ICData& unary_checks =
       ICData::Handle(Z, call->ic_data()->AsUnaryClassChecks());
-  if ((unary_checks.NumberOfChecks() > 0) &&
-      (op_kind == Token::kSET) &&
+  if ((unary_checks.NumberOfChecks() > 0) && (op_kind == Token::kSET) &&
       TryInlineInstanceSetter(call, unary_checks)) {
     return true;
   }
@@ -1734,6 +1732,14 @@
     return;
   }
 
+  if (RecognizeRuntimeTypeGetter(instr)) {
+    return;
+  }
+
+  if ((op_kind == Token::kEQ) && TryReplaceWithHaveSameRuntimeType(instr)) {
+    return;
+  }
+
   const ICData& unary_checks =
       ICData::ZoneHandle(Z, instr->ic_data()->AsUnaryClassChecks());
   if (IsAllowedForInlining(instr->deopt_id()) &&
@@ -1772,8 +1778,7 @@
   if (has_one_target) {
     // Check if the single target is a polymorphic target, if it is,
     // we don't have one target.
-    const Function& target =
-        Function::Handle(Z, unary_checks.GetTargetAt(0));
+    const Function& target = Function::Handle(Z, unary_checks.GetTargetAt(0));
     const bool polymorphic_target = MethodRecognizer::PolymorphicTarget(target);
     has_one_target = !polymorphic_target;
   }
@@ -1781,12 +1786,11 @@
   if (has_one_target) {
     RawFunction::Kind function_kind =
         Function::Handle(Z, unary_checks.GetTargetAt(0)).kind();
-    if (!flow_graph()->InstanceCallNeedsClassCheck(
-            instr, function_kind)) {
+    if (!flow_graph()->InstanceCallNeedsClassCheck(instr, function_kind)) {
       PolymorphicInstanceCallInstr* call =
-          new(Z) PolymorphicInstanceCallInstr(instr, unary_checks,
-                                              /* with_checks = */ false,
-                                              /* complete = */ true);
+          new (Z) PolymorphicInstanceCallInstr(instr, unary_checks,
+                                               /* with_checks = */ false,
+                                               /* complete = */ true);
       instr->ReplaceWith(call, current_iterator());
       return;
     }
@@ -1796,7 +1800,21 @@
     case Token::kLT:
     case Token::kLTE:
     case Token::kGT:
-    case Token::kGTE:
+    case Token::kGTE: {
+      if (HasOnlyTwoOf(*instr->ic_data(), kSmiCid) ||
+          HasLikelySmiOperand(instr)) {
+        Definition* left = instr->ArgumentAt(0);
+        Definition* right = instr->ArgumentAt(1);
+        CheckedSmiComparisonInstr* smi_op = new (Z)
+            CheckedSmiComparisonInstr(instr->token_kind(), new (Z) Value(left),
+                                      new (Z) Value(right), instr);
+        ReplaceCall(instr, smi_op);
+        return;
+      }
+      break;
+    }
+    case Token::kSHL:
+    case Token::kSHR:
     case Token::kBIT_OR:
     case Token::kBIT_XOR:
     case Token::kBIT_AND:
@@ -1808,10 +1826,8 @@
         Definition* left = instr->ArgumentAt(0);
         Definition* right = instr->ArgumentAt(1);
         CheckedSmiOpInstr* smi_op =
-            new(Z) CheckedSmiOpInstr(instr->token_kind(),
-                                     new(Z) Value(left),
-                                     new(Z) Value(right),
-                                     instr);
+            new (Z) CheckedSmiOpInstr(instr->token_kind(), new (Z) Value(left),
+                                      new (Z) Value(right), instr);
 
         ReplaceCall(instr, smi_op);
         return;
@@ -1826,31 +1842,26 @@
   const intptr_t receiver_cid =
       instr->PushArgumentAt(0)->value()->Type()->ToCid();
   if (receiver_cid != kDynamicCid) {
-    const Class& receiver_class = Class::Handle(Z,
-        isolate()->class_table()->At(receiver_cid));
+    const Class& receiver_class =
+        Class::Handle(Z, isolate()->class_table()->At(receiver_cid));
 
-    const Array& args_desc_array = Array::Handle(Z,
-        ArgumentsDescriptor::New(instr->ArgumentCount(),
-                                 instr->argument_names()));
+    const Array& args_desc_array =
+        Array::Handle(Z, ArgumentsDescriptor::New(instr->ArgumentCount(),
+                                                  instr->argument_names()));
     ArgumentsDescriptor args_desc(args_desc_array);
-    const Function& function = Function::Handle(Z,
-        Resolver::ResolveDynamicForReceiverClass(
-            receiver_class,
-            instr->function_name(),
-            args_desc));
+    const Function& function = Function::Handle(
+        Z, Resolver::ResolveDynamicForReceiverClass(
+               receiver_class, instr->function_name(), args_desc));
     if (!function.IsNull()) {
       const ICData& ic_data = ICData::Handle(
-          ICData::New(flow_graph_->function(),
-                      instr->function_name(),
-                      args_desc_array,
-                      Thread::kNoDeoptId,
-                      /* args_tested = */ 1,
-                      false));
+          ICData::New(flow_graph_->function(), instr->function_name(),
+                      args_desc_array, Thread::kNoDeoptId,
+                      /* args_tested = */ 1, false));
       ic_data.AddReceiverCheck(receiver_class.id(), function);
       PolymorphicInstanceCallInstr* call =
-          new(Z) PolymorphicInstanceCallInstr(instr, ic_data,
-                                              /* with_checks = */ false,
-                                              /* complete = */ true);
+          new (Z) PolymorphicInstanceCallInstr(instr, ic_data,
+                                               /* with_checks = */ false,
+                                               /* complete = */ true);
       instr->ReplaceWith(call, current_iterator());
       return;
     }
@@ -1873,9 +1884,9 @@
       Function& single_target = Function::Handle(Z);
       ICData& ic_data = ICData::Handle(Z);
 
-      const Array& args_desc_array = Array::Handle(Z,
-          ArgumentsDescriptor::New(instr->ArgumentCount(),
-                                   instr->argument_names()));
+      const Array& args_desc_array =
+          Array::Handle(Z, ArgumentsDescriptor::New(instr->ArgumentCount(),
+                                                    instr->argument_names()));
       ArgumentsDescriptor args_desc(args_desc_array);
 
       Function& target = Function::Handle(Z);
@@ -1884,9 +1895,7 @@
         const intptr_t cid = class_ids[i];
         cls = isolate()->class_table()->At(cid);
         target = Resolver::ResolveDynamicForReceiverClass(
-            cls,
-            instr->function_name(),
-            args_desc);
+            cls, instr->function_name(), args_desc);
 
         if (target.IsNull()) {
           // Can't resolve the target. It might be a noSuchMethod,
@@ -1913,10 +1922,8 @@
 
           // Create an ICData and map all previously seen classes (< i) to
           // the computed single_target.
-          ic_data = ICData::New(function,
-                                instr->function_name(),
-                                args_desc_array,
-                                Thread::kNoDeoptId,
+          ic_data = ICData::New(function, instr->function_name(),
+                                args_desc_array, Thread::kNoDeoptId,
                                 /* args_tested = */ 1, false);
           for (intptr_t j = 0; j < i; j++) {
             ic_data.AddReceiverCheck(class_ids[j], single_target);
@@ -1936,12 +1943,9 @@
         if ((op_kind == Token::kGET) || (op_kind == Token::kSET)) {
           // Create fake IC data with the resolved target.
           const ICData& ic_data = ICData::Handle(
-              ICData::New(flow_graph_->function(),
-                          instr->function_name(),
-                          args_desc_array,
-                          Thread::kNoDeoptId,
-                          /* args_tested = */ 1,
-                          false));
+              ICData::New(flow_graph_->function(), instr->function_name(),
+                          args_desc_array, Thread::kNoDeoptId,
+                          /* args_tested = */ 1, false));
           cls = single_target.Owner();
           ic_data.AddReceiverCheck(cls.id(), single_target);
           instr->set_ic_data(&ic_data);
@@ -1953,26 +1957,22 @@
 
         // We have computed that there is only a single target for this call
         // within the whole hierarchy. Replace InstanceCall with StaticCall.
-        ZoneGrowableArray<PushArgumentInstr*>* args =
-            new (Z) ZoneGrowableArray<PushArgumentInstr*>(
-                instr->ArgumentCount());
+        ZoneGrowableArray<PushArgumentInstr*>* args = new (Z)
+            ZoneGrowableArray<PushArgumentInstr*>(instr->ArgumentCount());
         for (intptr_t i = 0; i < instr->ArgumentCount(); i++) {
           args->Add(instr->PushArgumentAt(i));
         }
         StaticCallInstr* call = new (Z) StaticCallInstr(
-            instr->token_pos(),
-            Function::ZoneHandle(Z, single_target.raw()),
-            instr->argument_names(),
-            args,
-            instr->deopt_id());
+            instr->token_pos(), Function::ZoneHandle(Z, single_target.raw()),
+            instr->argument_names(), args, instr->deopt_id());
         instr->ReplaceWith(call, current_iterator());
         return;
       } else if ((ic_data.raw() != ICData::null()) &&
                  (ic_data.NumberOfChecks() > 0)) {
         PolymorphicInstanceCallInstr* call =
-            new(Z) PolymorphicInstanceCallInstr(instr, ic_data,
-                                                /* with_checks = */ true,
-                                                /* complete = */ true);
+            new (Z) PolymorphicInstanceCallInstr(instr, ic_data,
+                                                 /* with_checks = */ true,
+                                                 /* complete = */ true);
         instr->ReplaceWith(call, current_iterator());
         return;
       }
@@ -1986,15 +1986,40 @@
     // OK to use checks with PolymorphicInstanceCallInstr since no
     // deoptimization is allowed.
     PolymorphicInstanceCallInstr* call =
-        new(Z) PolymorphicInstanceCallInstr(instr, unary_checks,
-                                            /* with_checks = */ true,
-                                            /* complete = */ false);
+        new (Z) PolymorphicInstanceCallInstr(instr, unary_checks,
+                                             /* with_checks = */ true,
+                                             /* complete = */ false);
     instr->ReplaceWith(call, current_iterator());
     return;
   }
 }
 
 
+void AotOptimizer::VisitPolymorphicInstanceCall(
+    PolymorphicInstanceCallInstr* call) {
+  if (call->with_checks()) {
+    const intptr_t receiver_cid =
+        call->PushArgumentAt(0)->value()->Type()->ToCid();
+    if (receiver_cid != kDynamicCid) {
+      const Class& receiver_class =
+          Class::Handle(Z, isolate()->class_table()->At(receiver_cid));
+
+      const Array& args_desc_array = Array::Handle(
+          Z, ArgumentsDescriptor::New(call->ArgumentCount(),
+                                      call->instance_call()->argument_names()));
+      ArgumentsDescriptor args_desc(args_desc_array);
+      const Function& function = Function::Handle(
+          Z, Resolver::ResolveDynamicForReceiverClass(
+                 receiver_class, call->instance_call()->function_name(),
+                 args_desc));
+      if (!function.IsNull()) {
+        call->set_with_checks(false);
+      }
+    }
+  }
+}
+
+
 void AotOptimizer::VisitStaticCall(StaticCallInstr* call) {
   if (!IsAllowedForInlining(call->deopt_id())) {
     // Inlining disabled after a speculative inlining attempt.
@@ -2031,37 +2056,27 @@
     case MethodRecognizer::kMathMax: {
       // We can handle only monomorphic min/max call sites with both arguments
       // being either doubles or smis.
-      if (CanUnboxDouble() &&
-          call->HasICData() &&
+      if (CanUnboxDouble() && call->HasICData() &&
           (call->ic_data()->NumberOfChecks() == 1)) {
         const ICData& ic_data = *call->ic_data();
         intptr_t result_cid = kIllegalCid;
-        if (ICDataHasReceiverArgumentClassIds(ic_data,
-                                              kDoubleCid, kDoubleCid)) {
+        if (ICDataHasReceiverArgumentClassIds(ic_data, kDoubleCid,
+                                              kDoubleCid)) {
           result_cid = kDoubleCid;
-        } else if (ICDataHasReceiverArgumentClassIds(ic_data,
-                                                     kSmiCid, kSmiCid)) {
+        } else if (ICDataHasReceiverArgumentClassIds(ic_data, kSmiCid,
+                                                     kSmiCid)) {
           result_cid = kSmiCid;
         }
         if (result_cid != kIllegalCid) {
-          MathMinMaxInstr* min_max = new(Z) MathMinMaxInstr(
-              recognized_kind,
-              new(Z) Value(call->ArgumentAt(0)),
-              new(Z) Value(call->ArgumentAt(1)),
-              call->deopt_id(),
-              result_cid);
+          MathMinMaxInstr* min_max = new (Z) MathMinMaxInstr(
+              recognized_kind, new (Z) Value(call->ArgumentAt(0)),
+              new (Z) Value(call->ArgumentAt(1)), call->deopt_id(), result_cid);
           const ICData& unary_checks =
               ICData::ZoneHandle(Z, ic_data.AsUnaryClassChecks());
-          AddCheckClass(min_max->left()->definition(),
-                        unary_checks,
-                        call->deopt_id(),
-                        call->env(),
-                        call);
-          AddCheckClass(min_max->right()->definition(),
-                        unary_checks,
-                        call->deopt_id(),
-                        call->env(),
-                        call);
+          AddCheckClass(min_max->left()->definition(), unary_checks,
+                        call->deopt_id(), call->env(), call);
+          AddCheckClass(min_max->right()->definition(), unary_checks,
+                        call->deopt_id(), call->env(), call);
           ReplaceCall(call, min_max);
         }
       }
@@ -2074,15 +2089,13 @@
           if (ArgIsAlways(kSmiCid, ic_data, 1)) {
             Definition* arg = call->ArgumentAt(1);
             AddCheckSmi(arg, call->deopt_id(), call->env(), call);
-            ReplaceCall(call,
-                        new(Z) SmiToDoubleInstr(new(Z) Value(arg),
-                                                call->token_pos()));
+            ReplaceCall(call, new (Z) SmiToDoubleInstr(new (Z) Value(arg),
+                                                       call->token_pos()));
           } else if (ArgIsAlways(kMintCid, ic_data, 1) &&
                      CanConvertUnboxedMintToDouble()) {
             Definition* arg = call->ArgumentAt(1);
-            ReplaceCall(call,
-                        new(Z) MintToDoubleInstr(new(Z) Value(arg),
-                                                 call->deopt_id()));
+            ReplaceCall(call, new (Z) MintToDoubleInstr(new (Z) Value(arg),
+                                                        call->deopt_id()));
           }
         }
       }
@@ -2095,10 +2108,9 @@
 
 
 void AotOptimizer::VisitLoadCodeUnits(LoadCodeUnitsInstr* instr) {
-  // TODO(zerny): Use kUnboxedUint32 once it is fully supported/optimized.
+// TODO(zerny): Use kUnboxedUint32 once it is fully supported/optimized.
 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_ARM)
-  if (!instr->can_pack_into_smi())
-    instr->set_representation(kUnboxedMint);
+  if (!instr->can_pack_into_smi()) instr->set_representation(kUnboxedMint);
 #endif
 }
 
@@ -2106,7 +2118,7 @@
 bool AotOptimizer::TryInlineInstanceSetter(InstanceCallInstr* instr,
                                            const ICData& unary_ic_data) {
   ASSERT((unary_ic_data.NumberOfChecks() > 0) &&
-      (unary_ic_data.NumArgsTested() == 1));
+         (unary_ic_data.NumArgsTested() == 1));
   if (I->type_checks()) {
     // Checked mode setters are inlined like normal methods by conventional
     // inlining.
@@ -2133,22 +2145,19 @@
   // Inline implicit instance setter.
   const String& field_name =
       String::Handle(Z, Field::NameFromSetter(instr->function_name()));
-  const Field& field =
-      Field::ZoneHandle(Z, GetField(class_id, field_name));
+  const Field& field = Field::ZoneHandle(Z, GetField(class_id, field_name));
   ASSERT(!field.IsNull());
 
-  if (flow_graph()->InstanceCallNeedsClassCheck(
-          instr, RawFunction::kImplicitSetter)) {
+  if (flow_graph()->InstanceCallNeedsClassCheck(instr,
+                                                RawFunction::kImplicitSetter)) {
     return false;
   }
 
   // Field guard was detached.
-  StoreInstanceFieldInstr* store = new(Z) StoreInstanceFieldInstr(
-      field,
-      new(Z) Value(instr->ArgumentAt(0)),
-      new(Z) Value(instr->ArgumentAt(1)),
-      kEmitStoreBarrier,
-      instr->token_pos());
+  StoreInstanceFieldInstr* store = new (Z)
+      StoreInstanceFieldInstr(field, new (Z) Value(instr->ArgumentAt(0)),
+                              new (Z) Value(instr->ArgumentAt(1)),
+                              kEmitStoreBarrier, instr->token_pos());
 
   // No unboxed stores in precompiled code.
   ASSERT(!store->IsUnboxedStore());
@@ -2163,19 +2172,17 @@
 
 void AotOptimizer::ReplaceArrayBoundChecks() {
   for (BlockIterator block_it = flow_graph_->reverse_postorder_iterator();
-       !block_it.Done();
-       block_it.Advance()) {
+       !block_it.Done(); block_it.Advance()) {
     ForwardInstructionIterator it(block_it.Current());
     current_iterator_ = &it;
     for (; !it.Done(); it.Advance()) {
       CheckArrayBoundInstr* check = it.Current()->AsCheckArrayBound();
       if (check != NULL) {
-        GenericCheckBoundInstr* new_check = new(Z) GenericCheckBoundInstr(
-            new(Z) Value(check->length()->definition()),
-            new(Z) Value(check->index()->definition()),
-            check->deopt_id());
-        flow_graph_->InsertBefore(check, new_check,
-                                  check->env(), FlowGraph::kEffect);
+        GenericCheckBoundInstr* new_check = new (Z) GenericCheckBoundInstr(
+            new (Z) Value(check->length()->definition()),
+            new (Z) Value(check->index()->definition()), check->deopt_id());
+        flow_graph_->InsertBefore(check, new_check, check->env(),
+                                  FlowGraph::kEffect);
         current_iterator()->RemoveCurrentFromGraph();
       }
     }
diff --git a/runtime/vm/aot_optimizer.h b/runtime/vm/aot_optimizer.h
index f35536c..16e879e 100644
--- a/runtime/vm/aot_optimizer.h
+++ b/runtime/vm/aot_optimizer.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_AOT_OPTIMIZER_H_
-#define VM_AOT_OPTIMIZER_H_
+#ifndef RUNTIME_VM_AOT_OPTIMIZER_H_
+#define RUNTIME_VM_AOT_OPTIMIZER_H_
 
 #include "vm/intermediate_language.h"
 #include "vm/flow_graph.h"
@@ -11,22 +11,19 @@
 namespace dart {
 
 class CSEInstructionMap;
-template <typename T> class GrowableArray;
+template <typename T>
+class GrowableArray;
 class ParsedFunction;
+class Precompiler;
 class RawBool;
 
 class AotOptimizer : public FlowGraphVisitor {
  public:
-  AotOptimizer(
-      FlowGraph* flow_graph,
-      bool use_speculative_inlining,
-      GrowableArray<intptr_t>* inlining_black_list)
-      : FlowGraphVisitor(flow_graph->reverse_postorder()),
-        flow_graph_(flow_graph),
-        use_speculative_inlining_(use_speculative_inlining),
-        inlining_black_list_(inlining_black_list) {
-    ASSERT(!use_speculative_inlining || (inlining_black_list != NULL));
-  }
+  AotOptimizer(Precompiler* precompiler,
+               FlowGraph* flow_graph,
+               bool use_speculative_inlining,
+               GrowableArray<intptr_t>* inlining_black_list);
+
   virtual ~AotOptimizer() {}
 
   FlowGraph* flow_graph() const { return flow_graph_; }
@@ -45,6 +42,8 @@
 
   virtual void VisitStaticCall(StaticCallInstr* instr);
   virtual void VisitInstanceCall(InstanceCallInstr* instr);
+  virtual void VisitPolymorphicInstanceCall(
+      PolymorphicInstanceCallInstr* instr);
   virtual void VisitLoadCodeUnits(LoadCodeUnitsInstr* instr);
 
   void InsertBefore(Instruction* next,
@@ -106,15 +105,15 @@
 
   void ReplaceCall(Definition* call, Definition* replacement);
 
+  bool RecognizeRuntimeTypeGetter(InstanceCallInstr* call);
+  bool TryReplaceWithHaveSameRuntimeType(InstanceCallInstr* call);
+
   bool InstanceCallNeedsClassCheck(InstanceCallInstr* call,
                                    RawFunction::Kind kind) const;
 
-  bool InlineFloat32x4BinaryOp(InstanceCallInstr* call,
-                               Token::Kind op_kind);
-  bool InlineInt32x4BinaryOp(InstanceCallInstr* call,
-                              Token::Kind op_kind);
-  bool InlineFloat64x2BinaryOp(InstanceCallInstr* call,
-                               Token::Kind op_kind);
+  bool InlineFloat32x4BinaryOp(InstanceCallInstr* call, Token::Kind op_kind);
+  bool InlineInt32x4BinaryOp(InstanceCallInstr* call, Token::Kind op_kind);
+  bool InlineFloat64x2BinaryOp(InstanceCallInstr* call, Token::Kind op_kind);
   bool InlineImplicitInstanceGetter(InstanceCallInstr* call);
 
   RawBool* InstanceOfAsBool(const ICData& ic_data,
@@ -136,16 +135,19 @@
 
   bool IsAllowedForInlining(intptr_t deopt_id);
 
+  Precompiler* precompiler_;
   FlowGraph* flow_graph_;
 
   const bool use_speculative_inlining_;
 
   GrowableArray<intptr_t>* inlining_black_list_;
 
+  bool has_unique_no_such_method_;
+
   DISALLOW_COPY_AND_ASSIGN(AotOptimizer);
 };
 
 
 }  // namespace dart
 
-#endif  // VM_AOT_OPTIMIZER_H_
+#endif  // RUNTIME_VM_AOT_OPTIMIZER_H_
diff --git a/runtime/vm/assembler.cc b/runtime/vm/assembler.cc
index 8bb29ca..4edcedd 100644
--- a/runtime/vm/assembler.cc
+++ b/runtime/vm/assembler.cc
@@ -13,13 +13,19 @@
 
 namespace dart {
 
-DEFINE_FLAG(bool, check_code_pointer, false,
+DEFINE_FLAG(bool,
+            check_code_pointer,
+            false,
             "Verify instructions offset in code object."
             "NOTE: This breaks the profiler.");
-DEFINE_FLAG(bool, code_comments, false,
+DEFINE_FLAG(bool,
+            code_comments,
+            false,
             "Include comments into code and disassembly");
 #if defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS)
-DEFINE_FLAG(bool, use_far_branches, false,
+DEFINE_FLAG(bool,
+            use_far_branches,
+            false,
             "Enable far branches for ARM and MIPS");
 #endif
 
@@ -82,8 +88,7 @@
 }
 
 
-AssemblerBuffer::~AssemblerBuffer() {
-}
+AssemblerBuffer::~AssemblerBuffer() {}
 
 
 void AssemblerBuffer::ProcessFixups(const MemoryRegion& region) {
@@ -120,8 +125,7 @@
   // Allocate the new data area and copy contents of the old one to it.
   uword new_contents = NewContents(new_capacity);
   memmove(reinterpret_cast<void*>(new_contents),
-          reinterpret_cast<void*>(contents_),
-          old_size);
+          reinterpret_cast<void*>(contents_), old_size);
 
   // Compute the relocation delta and switch to the new contents area.
   intptr_t delta = new_contents - contents_;
@@ -141,8 +145,7 @@
  public:
   PatchCodeWithHandle(ZoneGrowableArray<intptr_t>* pointer_offsets,
                       const Object& object)
-      : pointer_offsets_(pointer_offsets), object_(object) {
-  }
+      : pointer_offsets_(pointer_offsets), object_(object) {}
 
   void Process(const MemoryRegion& region, intptr_t position) {
     // Patch the handle into the code. Once the instructions are installed into
@@ -218,9 +221,9 @@
     OS::VSNPrint(buffer, sizeof(buffer), format, args);
     va_end(args);
 
-    comments_.Add(new CodeComment(buffer_.GetPosition(),
-                                  String::ZoneHandle(String::New(buffer,
-                                                                 Heap::kOld))));
+    comments_.Add(
+        new CodeComment(buffer_.GetPosition(),
+                        String::ZoneHandle(String::New(buffer, Heap::kOld))));
   }
 }
 
@@ -304,9 +307,9 @@
 
 intptr_t ObjectPoolWrapper::FindNativeEntry(const ExternalLabel* label,
                                             Patchability patchable) {
-  return FindObject(ObjectPoolWrapperEntry(label->address(),
-                                           ObjectPool::kNativeEntry),
-                    patchable);
+  return FindObject(
+      ObjectPoolWrapperEntry(label->address(), ObjectPool::kNativeEntry),
+      patchable);
 }
 
 
diff --git a/runtime/vm/assembler.h b/runtime/vm/assembler.h
index 36279fb..87d3a1e 100644
--- a/runtime/vm/assembler.h
+++ b/runtime/vm/assembler.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_ASSEMBLER_H_
-#define VM_ASSEMBLER_H_
+#ifndef RUNTIME_VM_ASSEMBLER_H_
+#define RUNTIME_VM_ASSEMBLER_H_
 
 #include "platform/assert.h"
 #include "vm/allocation.h"
@@ -14,8 +14,7 @@
 
 namespace dart {
 
-#if defined(TARGET_ARCH_ARM) ||                                                \
-    defined(TARGET_ARCH_ARM64) ||                                              \
+#if defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_ARM64) ||                  \
     defined(TARGET_ARCH_MIPS)
 DECLARE_FLAG(bool, use_far_branches);
 #endif
@@ -78,29 +77,31 @@
   ~AssemblerBuffer();
 
   // Basic support for emitting, loading, and storing.
-  template<typename T> void Emit(T value) {
+  template <typename T>
+  void Emit(T value) {
     ASSERT(HasEnsuredCapacity());
     *reinterpret_cast<T*>(cursor_) = value;
     cursor_ += sizeof(T);
   }
 
-  template<typename T> void Remit() {
+  template <typename T>
+  void Remit() {
     ASSERT(Size() >= static_cast<intptr_t>(sizeof(T)));
     cursor_ -= sizeof(T);
   }
 
   // Return address to code at |position| bytes.
-  uword Address(intptr_t position) {
-    return contents_ + position;
-  }
+  uword Address(intptr_t position) { return contents_ + position; }
 
-  template<typename T> T Load(intptr_t position) {
+  template <typename T>
+  T Load(intptr_t position) {
     ASSERT(position >= 0 &&
            position <= (Size() - static_cast<intptr_t>(sizeof(T))));
     return *reinterpret_cast<T*>(contents_ + position);
   }
 
-  template<typename T> void Store(intptr_t position, T value) {
+  template <typename T>
+  void Store(intptr_t position, T value) {
     ASSERT(position >= 0 &&
            position <= (Size() - static_cast<intptr_t>(sizeof(T))));
     *reinterpret_cast<T*>(contents_ + position) = value;
@@ -135,13 +136,13 @@
   // and apply all fixups.
   void FinalizeInstructions(const MemoryRegion& region);
 
-  // To emit an instruction to the assembler buffer, the EnsureCapacity helper
-  // must be used to guarantee that the underlying data area is big enough to
-  // hold the emitted instruction. Usage:
-  //
-  //     AssemblerBuffer buffer;
-  //     AssemblerBuffer::EnsureCapacity ensured(&buffer);
-  //     ... emit bytes for single instruction ...
+// To emit an instruction to the assembler buffer, the EnsureCapacity helper
+// must be used to guarantee that the underlying data area is big enough to
+// hold the emitted instruction. Usage:
+//
+//     AssemblerBuffer buffer;
+//     AssemblerBuffer::EnsureCapacity ensured(&buffer);
+//     ... emit bytes for single instruction ...
 
 #if defined(DEBUG)
   class EnsureCapacity : public ValueObject {
@@ -215,14 +216,13 @@
 
 
 struct ObjectPoolWrapperEntry {
-  ObjectPoolWrapperEntry()
-    : raw_value_(), type_(), equivalence_() { }
+  ObjectPoolWrapperEntry() : raw_value_(), type_(), equivalence_() {}
   explicit ObjectPoolWrapperEntry(const Object* obj)
-    : obj_(obj), type_(ObjectPool::kTaggedObject), equivalence_(obj) { }
+      : obj_(obj), type_(ObjectPool::kTaggedObject), equivalence_(obj) {}
   explicit ObjectPoolWrapperEntry(const Object* obj, const Object* eqv)
-    : obj_(obj), type_(ObjectPool::kTaggedObject), equivalence_(eqv) { }
+      : obj_(obj), type_(ObjectPool::kTaggedObject), equivalence_(eqv) {}
   ObjectPoolWrapperEntry(uword value, ObjectPool::EntryType info)
-    : raw_value_(value), type_(info), equivalence_() { }
+      : raw_value_(value), type_(info), equivalence_() {}
 
   union {
     const Object* obj_;
@@ -243,8 +243,9 @@
 
   static const intptr_t kNoIndex = -1;
 
-  ObjIndexPair() : key_(static_cast<uword>(NULL), ObjectPool::kTaggedObject),
-                   value_(kNoIndex) { }
+  ObjIndexPair()
+      : key_(static_cast<uword>(NULL), ObjectPool::kTaggedObject),
+        value_(kNoIndex) {}
 
   ObjIndexPair(Key key, Value value) : value_(value) {
     key_.type_ = key.type_;
@@ -298,17 +299,14 @@
 
 class ObjectPoolWrapper : public ValueObject {
  public:
-  intptr_t AddObject(const Object& obj,
-                     Patchability patchable = kNotPatchable);
+  intptr_t AddObject(const Object& obj, Patchability patchable = kNotPatchable);
   intptr_t AddImmediate(uword imm);
 
   intptr_t FindObject(const Object& obj,
                       Patchability patchable = kNotPatchable);
-  intptr_t FindObject(const Object& obj,
-                      const Object& equivalence);
+  intptr_t FindObject(const Object& obj, const Object& equivalence);
   intptr_t FindImmediate(uword imm);
-  intptr_t FindNativeEntry(const ExternalLabel* label,
-                           Patchability patchable);
+  intptr_t FindNativeEntry(const ExternalLabel* label, Patchability patchable);
 
   RawObjectPool* MakeObjectPool();
 
@@ -324,10 +322,7 @@
 };
 
 
-enum RestorePP {
-  kRestoreCallerPP,
-  kKeepCalleePP
-};
+enum RestorePP { kRestoreCallerPP, kKeepCalleePP };
 
 }  // namespace dart
 
@@ -348,4 +343,4 @@
 #error Unknown architecture.
 #endif
 
-#endif  // VM_ASSEMBLER_H_
+#endif  // RUNTIME_VM_ASSEMBLER_H_
diff --git a/runtime/vm/assembler_arm.cc b/runtime/vm/assembler_arm.cc
index e768806..3618bce 100644
--- a/runtime/vm/assembler_arm.cc
+++ b/runtime/vm/assembler_arm.cc
@@ -14,7 +14,7 @@
 #include "vm/stub_code.h"
 
 // An extra check since we are assuming the existence of /proc/cpuinfo below.
-#if !defined(USING_SIMULATOR) && !defined(__linux__) && !defined(ANDROID) && \
+#if !defined(USING_SIMULATOR) && !defined(__linux__) && !defined(ANDROID) &&   \
     !TARGET_OS_IOS
 #error ARM cross-compile only supported on Linux
 #endif
@@ -28,8 +28,8 @@
   if (kind_ == Immediate) {
     uint32_t offset = encoding_ & kOffset12Mask;
     ASSERT(offset < 256);
-    return (encoding_ & ~kOffset12Mask) | B22 |
-           ((offset & 0xf0) << 4) | (offset & 0xf);
+    return (encoding_ & ~kOffset12Mask) | B22 | ((offset & 0xf0) << 4) |
+           (offset & 0xf);
   }
   ASSERT(kind_ == IndexRegister);
   return encoding_;
@@ -39,9 +39,9 @@
 uint32_t Address::vencoding() const {
   ASSERT(kind_ == Immediate);
   uint32_t offset = encoding_ & kOffset12Mask;
-  ASSERT(offset < (1 << 10));  // In the range 0 to +1020.
+  ASSERT(offset < (1 << 10));           // In the range 0 to +1020.
   ASSERT(Utils::IsAligned(offset, 4));  // Multiple of 4.
-  int mode = encoding_ & ((8|4|1) << 21);
+  int mode = encoding_ & ((8 | 4 | 1) << 21);
   ASSERT((mode == Offset) || (mode == NegOffset));
   uint32_t vencoding = (encoding_ & (0xf << kRnShift)) | (offset >> 2);
   if (mode == Offset) {
@@ -80,10 +80,8 @@
   int32_t encoding = static_cast<int32_t>(cond) << kConditionShift |
                      type << kTypeShift |
                      static_cast<int32_t>(opcode) << kOpcodeShift |
-                     set_cc << kSShift |
-                     static_cast<int32_t>(rn) << kRnShift |
-                     static_cast<int32_t>(rd) << kRdShift |
-                     o.encoding();
+                     set_cc << kSShift | static_cast<int32_t>(rn) << kRnShift |
+                     static_cast<int32_t>(rd) << kRdShift | o.encoding();
   Emit(encoding);
 }
 
@@ -91,8 +89,7 @@
 void Assembler::EmitType5(Condition cond, int32_t offset, bool link) {
   ASSERT(cond != kNoCondition);
   int32_t encoding = static_cast<int32_t>(cond) << kConditionShift |
-                     5 << kTypeShift |
-                     (link ? 1 : 0) << kLinkShift;
+                     5 << kTypeShift | (link ? 1 : 0) << kLinkShift;
   Emit(Assembler::EncodeBranchOffset(offset, encoding));
 }
 
@@ -106,12 +103,10 @@
   ASSERT(cond != kNoCondition);
   ASSERT(!ad.has_writeback() || (ad.rn() != rd));  // Unpredictable.
 
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B26 | (ad.kind() == Address::Immediate ? 0 : B25) |
-                     (load ? L : 0) |
-                     (byte ? B : 0) |
-                     (static_cast<int32_t>(rd) << kRdShift) |
-                     ad.encoding();
+  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | B26 |
+                     (ad.kind() == Address::Immediate ? 0 : B25) |
+                     (load ? L : 0) | (byte ? B : 0) |
+                     (static_cast<int32_t>(rd) << kRdShift) | ad.encoding();
   Emit(encoding);
 }
 
@@ -122,10 +117,8 @@
                                       Address ad) {
   ASSERT(rd != kNoRegister);
   ASSERT(cond != kNoCondition);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     mode |
-                     (static_cast<int32_t>(rd) << kRdShift) |
-                     ad.encoding3();
+  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | mode |
+                     (static_cast<int32_t>(rd) << kRdShift) | ad.encoding3();
   Emit(encoding);
 }
 
@@ -137,12 +130,9 @@
                                RegList regs) {
   ASSERT(base != kNoRegister);
   ASSERT(cond != kNoCondition);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B27 |
-                     am |
-                     (load ? L : 0) |
-                     (static_cast<int32_t>(base) << kRnShift) |
-                     regs;
+  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | B27 |
+                     am | (load ? L : 0) |
+                     (static_cast<int32_t>(base) << kRnShift) | regs;
   Emit(encoding);
 }
 
@@ -154,12 +144,11 @@
                                    Operand o) {
   ASSERT(cond != kNoCondition);
   ASSERT(o.type() == 1);
-  int32_t encoding = static_cast<int32_t>(cond) << kConditionShift |
-                     static_cast<int32_t>(MOV) << kOpcodeShift |
-                     static_cast<int32_t>(rd) << kRdShift |
-                     o.encoding() << kShiftImmShift |
-                     static_cast<int32_t>(opcode) << kShiftShift |
-                     static_cast<int32_t>(rm);
+  int32_t encoding =
+      static_cast<int32_t>(cond) << kConditionShift |
+      static_cast<int32_t>(MOV) << kOpcodeShift |
+      static_cast<int32_t>(rd) << kRdShift | o.encoding() << kShiftImmShift |
+      static_cast<int32_t>(opcode) << kShiftShift | static_cast<int32_t>(rm);
   Emit(encoding);
 }
 
@@ -175,8 +164,7 @@
                      static_cast<int32_t>(MOV) << kOpcodeShift |
                      static_cast<int32_t>(rd) << kRdShift |
                      o.encoding() << kShiftRegisterShift |
-                     static_cast<int32_t>(opcode) << kShiftShift |
-                     B4 |
+                     static_cast<int32_t>(opcode) << kShiftShift | B4 |
                      static_cast<int32_t>(rm);
   Emit(encoding);
 }
@@ -311,18 +299,18 @@
   ASSERT(cond != kNoCondition);
   ASSERT(rd != PC);
   ASSERT(rm != PC);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B24 | B22 | B21 | (0xf << 16) |
-                     (static_cast<int32_t>(rd) << kRdShift) |
-                     (0xf << 8) | B4 | static_cast<int32_t>(rm);
+  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | B24 |
+                     B22 | B21 | (0xf << 16) |
+                     (static_cast<int32_t>(rd) << kRdShift) | (0xf << 8) | B4 |
+                     static_cast<int32_t>(rm);
   Emit(encoding);
 }
 
 
 void Assembler::movw(Register rd, uint16_t imm16, Condition cond) {
   ASSERT(cond != kNoCondition);
-  int32_t encoding = static_cast<int32_t>(cond) << kConditionShift |
-                     B25 | B24 | ((imm16 >> 12) << 16) |
+  int32_t encoding = static_cast<int32_t>(cond) << kConditionShift | B25 | B24 |
+                     ((imm16 >> 12) << 16) |
                      static_cast<int32_t>(rd) << kRdShift | (imm16 & 0xfff);
   Emit(encoding);
 }
@@ -330,28 +318,29 @@
 
 void Assembler::movt(Register rd, uint16_t imm16, Condition cond) {
   ASSERT(cond != kNoCondition);
-  int32_t encoding = static_cast<int32_t>(cond) << kConditionShift |
-                     B25 | B24 | B22 | ((imm16 >> 12) << 16) |
+  int32_t encoding = static_cast<int32_t>(cond) << kConditionShift | B25 | B24 |
+                     B22 | ((imm16 >> 12) << 16) |
                      static_cast<int32_t>(rd) << kRdShift | (imm16 & 0xfff);
   Emit(encoding);
 }
 
 
-void Assembler::EmitMulOp(Condition cond, int32_t opcode,
-                          Register rd, Register rn,
-                          Register rm, Register rs) {
+void Assembler::EmitMulOp(Condition cond,
+                          int32_t opcode,
+                          Register rd,
+                          Register rn,
+                          Register rm,
+                          Register rs) {
   ASSERT(rd != kNoRegister);
   ASSERT(rn != kNoRegister);
   ASSERT(rm != kNoRegister);
   ASSERT(rs != kNoRegister);
   ASSERT(cond != kNoCondition);
-  int32_t encoding = opcode |
-      (static_cast<int32_t>(cond) << kConditionShift) |
-      (static_cast<int32_t>(rn) << kRnShift) |
-      (static_cast<int32_t>(rd) << kRdShift) |
-      (static_cast<int32_t>(rs) << kRsShift) |
-      B7 | B4 |
-      (static_cast<int32_t>(rm) << kRmShift);
+  int32_t encoding = opcode | (static_cast<int32_t>(cond) << kConditionShift) |
+                     (static_cast<int32_t>(rn) << kRnShift) |
+                     (static_cast<int32_t>(rd) << kRdShift) |
+                     (static_cast<int32_t>(rs) << kRsShift) | B7 | B4 |
+                     (static_cast<int32_t>(rm) << kRmShift);
   Emit(encoding);
 }
 
@@ -368,16 +357,22 @@
 }
 
 
-void Assembler::mla(Register rd, Register rn,
-                    Register rm, Register ra, Condition cond) {
+void Assembler::mla(Register rd,
+                    Register rn,
+                    Register rm,
+                    Register ra,
+                    Condition cond) {
   // rd <- ra + rn * rm.
   // Assembler registers rd, rn, rm, ra are encoded as rn, rm, rs, rd.
   EmitMulOp(cond, B21, ra, rd, rn, rm);
 }
 
 
-void Assembler::mls(Register rd, Register rn,
-                    Register rm, Register ra, Condition cond) {
+void Assembler::mls(Register rd,
+                    Register rn,
+                    Register rm,
+                    Register ra,
+                    Condition cond) {
   // rd <- ra - rn * rm.
   if (TargetCPUFeatures::arm_version() == ARMv7) {
     // Assembler registers rd, rn, rm, ra are encoded as rn, rm, rs, rd.
@@ -389,29 +384,40 @@
 }
 
 
-void Assembler::smull(Register rd_lo, Register rd_hi,
-                      Register rn, Register rm, Condition cond) {
+void Assembler::smull(Register rd_lo,
+                      Register rd_hi,
+                      Register rn,
+                      Register rm,
+                      Condition cond) {
   // Assembler registers rd_lo, rd_hi, rn, rm are encoded as rd, rn, rm, rs.
   EmitMulOp(cond, B23 | B22, rd_lo, rd_hi, rn, rm);
 }
 
 
-void Assembler::umull(Register rd_lo, Register rd_hi,
-                      Register rn, Register rm, Condition cond) {
+void Assembler::umull(Register rd_lo,
+                      Register rd_hi,
+                      Register rn,
+                      Register rm,
+                      Condition cond) {
   // Assembler registers rd_lo, rd_hi, rn, rm are encoded as rd, rn, rm, rs.
   EmitMulOp(cond, B23, rd_lo, rd_hi, rn, rm);
 }
 
 
-void Assembler::umlal(Register rd_lo, Register rd_hi,
-                      Register rn, Register rm, Condition cond) {
+void Assembler::umlal(Register rd_lo,
+                      Register rd_hi,
+                      Register rn,
+                      Register rm,
+                      Condition cond) {
   // Assembler registers rd_lo, rd_hi, rn, rm are encoded as rd, rn, rm, rs.
   EmitMulOp(cond, B23 | B21, rd_lo, rd_hi, rn, rm);
 }
 
 
-void Assembler::umaal(Register rd_lo, Register rd_hi,
-                      Register rn, Register rm) {
+void Assembler::umaal(Register rd_lo,
+                      Register rd_hi,
+                      Register rn,
+                      Register rm) {
   ASSERT(rd_lo != IP);
   ASSERT(rd_hi != IP);
   ASSERT(rn != IP);
@@ -428,19 +434,20 @@
 }
 
 
-void Assembler::EmitDivOp(Condition cond, int32_t opcode,
-                          Register rd, Register rn, Register rm) {
+void Assembler::EmitDivOp(Condition cond,
+                          int32_t opcode,
+                          Register rd,
+                          Register rn,
+                          Register rm) {
   ASSERT(TargetCPUFeatures::integer_division_supported());
   ASSERT(rd != kNoRegister);
   ASSERT(rn != kNoRegister);
   ASSERT(rm != kNoRegister);
   ASSERT(cond != kNoCondition);
-  int32_t encoding = opcode |
-    (static_cast<int32_t>(cond) << kConditionShift) |
-    (static_cast<int32_t>(rn) << kDivRnShift) |
-    (static_cast<int32_t>(rd) << kDivRdShift) |
-    B26 | B25 | B24 | B20 | B4 |
-    (static_cast<int32_t>(rm) << kDivRmShift);
+  int32_t encoding = opcode | (static_cast<int32_t>(cond) << kConditionShift) |
+                     (static_cast<int32_t>(rn) << kDivRnShift) |
+                     (static_cast<int32_t>(rd) << kDivRdShift) | B26 | B25 |
+                     B24 | B20 | B4 | (static_cast<int32_t>(rm) << kDivRmShift);
   Emit(encoding);
 }
 
@@ -451,7 +458,7 @@
 
 
 void Assembler::udiv(Register rd, Register rn, Register rm, Condition cond) {
-  EmitDivOp(cond, B21 , rd, rn, rm);
+  EmitDivOp(cond, B21, rd, rn, rm);
 }
 
 
@@ -495,7 +502,10 @@
 }
 
 
-void Assembler::ldrd(Register rd, Register rd2, Register rn, int32_t offset,
+void Assembler::ldrd(Register rd,
+                     Register rd2,
+                     Register rn,
+                     int32_t offset,
                      Condition cond) {
   ASSERT((rd % 2) == 0);
   ASSERT(rd2 == rd + 1);
@@ -508,7 +518,10 @@
 }
 
 
-void Assembler::strd(Register rd, Register rd2, Register rn, int32_t offset,
+void Assembler::strd(Register rd,
+                     Register rd2,
+                     Register rn,
+                     int32_t offset,
                      Condition cond) {
   ASSERT((rd % 2) == 0);
   ASSERT(rd2 == rd + 1);
@@ -521,14 +534,18 @@
 }
 
 
-void Assembler::ldm(BlockAddressMode am, Register base, RegList regs,
+void Assembler::ldm(BlockAddressMode am,
+                    Register base,
+                    RegList regs,
                     Condition cond) {
   ASSERT(regs != 0);
   EmitMultiMemOp(cond, am, true, base, regs);
 }
 
 
-void Assembler::stm(BlockAddressMode am, Register base, RegList regs,
+void Assembler::stm(BlockAddressMode am,
+                    Register base,
+                    RegList regs,
                     Condition cond) {
   ASSERT(regs != 0);
   EmitMultiMemOp(cond, am, false, base, regs);
@@ -540,13 +557,10 @@
   ASSERT(rn != kNoRegister);
   ASSERT(rt != kNoRegister);
   ASSERT(cond != kNoCondition);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B24 |
-                     B23 |
-                     L   |
-                     (static_cast<int32_t>(rn) << kLdExRnShift) |
-                     (static_cast<int32_t>(rt) << kLdExRtShift) |
-                     B11 | B10 | B9 | B8 | B7 | B4 | B3 | B2 | B1 | B0;
+  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | B24 |
+                     B23 | L | (static_cast<int32_t>(rn) << kLdExRnShift) |
+                     (static_cast<int32_t>(rt) << kLdExRtShift) | B11 | B10 |
+                     B9 | B8 | B7 | B4 | B3 | B2 | B1 | B0;
   Emit(encoding);
 }
 
@@ -557,12 +571,10 @@
   ASSERT(rd != kNoRegister);
   ASSERT(rt != kNoRegister);
   ASSERT(cond != kNoCondition);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B24 |
-                     B23 |
-                     (static_cast<int32_t>(rn) << kStrExRnShift) |
-                     (static_cast<int32_t>(rd) << kStrExRdShift) |
-                     B11 | B10 | B9 | B8 | B7 | B4 |
+  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | B24 |
+                     B23 | (static_cast<int32_t>(rn) << kStrExRnShift) |
+                     (static_cast<int32_t>(rd) << kStrExRdShift) | B11 | B10 |
+                     B9 | B8 | B7 | B4 |
                      (static_cast<int32_t>(rt) << kStrExRtShift);
   Emit(encoding);
 }
@@ -570,16 +582,16 @@
 
 void Assembler::clrex() {
   ASSERT(TargetCPUFeatures::arm_version() != ARMv5TE);
-  int32_t encoding = (kSpecialCondition << kConditionShift) |
-                     B26 | B24 | B22 | B21 | B20 | (0xff << 12) | B4 | 0xf;
+  int32_t encoding = (kSpecialCondition << kConditionShift) | B26 | B24 | B22 |
+                     B21 | B20 | (0xff << 12) | B4 | 0xf;
   Emit(encoding);
 }
 
 
 void Assembler::nop(Condition cond) {
   ASSERT(cond != kNoCondition);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B25 | B24 | B21 | (0xf << 12);
+  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | B25 |
+                     B24 | B21 | (0xf << 12);
   Emit(encoding);
 }
 
@@ -591,11 +603,10 @@
   ASSERT(rt != SP);
   ASSERT(rt != PC);
   ASSERT(cond != kNoCondition);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B27 | B26 | B25 |
-                     ((static_cast<int32_t>(sn) >> 1)*B16) |
-                     (static_cast<int32_t>(rt)*B12) | B11 | B9 |
-                     ((static_cast<int32_t>(sn) & 1)*B7) | B4;
+  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | B27 |
+                     B26 | B25 | ((static_cast<int32_t>(sn) >> 1) * B16) |
+                     (static_cast<int32_t>(rt) * B12) | B11 | B9 |
+                     ((static_cast<int32_t>(sn) & 1) * B7) | B4;
   Emit(encoding);
 }
 
@@ -607,16 +618,17 @@
   ASSERT(rt != SP);
   ASSERT(rt != PC);
   ASSERT(cond != kNoCondition);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B27 | B26 | B25 | B20 |
-                     ((static_cast<int32_t>(sn) >> 1)*B16) |
-                     (static_cast<int32_t>(rt)*B12) | B11 | B9 |
-                     ((static_cast<int32_t>(sn) & 1)*B7) | B4;
+  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | B27 |
+                     B26 | B25 | B20 | ((static_cast<int32_t>(sn) >> 1) * B16) |
+                     (static_cast<int32_t>(rt) * B12) | B11 | B9 |
+                     ((static_cast<int32_t>(sn) & 1) * B7) | B4;
   Emit(encoding);
 }
 
 
-void Assembler::vmovsrr(SRegister sm, Register rt, Register rt2,
+void Assembler::vmovsrr(SRegister sm,
+                        Register rt,
+                        Register rt2,
                         Condition cond) {
   ASSERT(TargetCPUFeatures::vfp_supported());
   ASSERT(sm != kNoSRegister);
@@ -628,17 +640,18 @@
   ASSERT(rt2 != SP);
   ASSERT(rt2 != PC);
   ASSERT(cond != kNoCondition);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B27 | B26 | B22 |
-                     (static_cast<int32_t>(rt2)*B16) |
-                     (static_cast<int32_t>(rt)*B12) | B11 | B9 |
-                     ((static_cast<int32_t>(sm) & 1)*B5) | B4 |
+  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | B27 |
+                     B26 | B22 | (static_cast<int32_t>(rt2) * B16) |
+                     (static_cast<int32_t>(rt) * B12) | B11 | B9 |
+                     ((static_cast<int32_t>(sm) & 1) * B5) | B4 |
                      (static_cast<int32_t>(sm) >> 1);
   Emit(encoding);
 }
 
 
-void Assembler::vmovrrs(Register rt, Register rt2, SRegister sm,
+void Assembler::vmovrrs(Register rt,
+                        Register rt2,
+                        SRegister sm,
                         Condition cond) {
   ASSERT(TargetCPUFeatures::vfp_supported());
   ASSERT(sm != kNoSRegister);
@@ -651,11 +664,10 @@
   ASSERT(rt2 != PC);
   ASSERT(rt != rt2);
   ASSERT(cond != kNoCondition);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B27 | B26 | B22 | B20 |
-                     (static_cast<int32_t>(rt2)*B16) |
-                     (static_cast<int32_t>(rt)*B12) | B11 | B9 |
-                     ((static_cast<int32_t>(sm) & 1)*B5) | B4 |
+  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | B27 |
+                     B26 | B22 | B20 | (static_cast<int32_t>(rt2) * B16) |
+                     (static_cast<int32_t>(rt) * B12) | B11 | B9 |
+                     ((static_cast<int32_t>(sm) & 1) * B5) | B4 |
                      (static_cast<int32_t>(sm) >> 1);
   Emit(encoding);
 }
@@ -669,17 +681,17 @@
   ASSERT(rt != PC);
   ASSERT(dn != kNoDRegister);
   ASSERT(cond != kNoCondition);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B27 | B26 | B25 |
-                     (i*B21) |
-                     (static_cast<int32_t>(rt)*B12) | B11 | B9 | B8 |
-                     ((static_cast<int32_t>(dn) >> 4)*B7) |
-                     ((static_cast<int32_t>(dn) & 0xf)*B16) | B4;
+  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | B27 |
+                     B26 | B25 | (i * B21) | (static_cast<int32_t>(rt) * B12) |
+                     B11 | B9 | B8 | ((static_cast<int32_t>(dn) >> 4) * B7) |
+                     ((static_cast<int32_t>(dn) & 0xf) * B16) | B4;
   Emit(encoding);
 }
 
 
-void Assembler::vmovdrr(DRegister dm, Register rt, Register rt2,
+void Assembler::vmovdrr(DRegister dm,
+                        Register rt,
+                        Register rt2,
                         Condition cond) {
   ASSERT(TargetCPUFeatures::vfp_supported());
   ASSERT(dm != kNoDRegister);
@@ -690,17 +702,18 @@
   ASSERT(rt2 != SP);
   ASSERT(rt2 != PC);
   ASSERT(cond != kNoCondition);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B27 | B26 | B22 |
-                     (static_cast<int32_t>(rt2)*B16) |
-                     (static_cast<int32_t>(rt)*B12) | B11 | B9 | B8 |
-                     ((static_cast<int32_t>(dm) >> 4)*B5) | B4 |
+  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | B27 |
+                     B26 | B22 | (static_cast<int32_t>(rt2) * B16) |
+                     (static_cast<int32_t>(rt) * B12) | B11 | B9 | B8 |
+                     ((static_cast<int32_t>(dm) >> 4) * B5) | B4 |
                      (static_cast<int32_t>(dm) & 0xf);
   Emit(encoding);
 }
 
 
-void Assembler::vmovrrd(Register rt, Register rt2, DRegister dm,
+void Assembler::vmovrrd(Register rt,
+                        Register rt2,
+                        DRegister dm,
                         Condition cond) {
   ASSERT(TargetCPUFeatures::vfp_supported());
   ASSERT(dm != kNoDRegister);
@@ -712,11 +725,10 @@
   ASSERT(rt2 != PC);
   ASSERT(rt != rt2);
   ASSERT(cond != kNoCondition);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B27 | B26 | B22 | B20 |
-                     (static_cast<int32_t>(rt2)*B16) |
-                     (static_cast<int32_t>(rt)*B12) | B11 | B9 | B8 |
-                     ((static_cast<int32_t>(dm) >> 4)*B5) | B4 |
+  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | B27 |
+                     B26 | B22 | B20 | (static_cast<int32_t>(rt2) * B16) |
+                     (static_cast<int32_t>(rt) * B12) | B11 | B9 | B8 |
+                     ((static_cast<int32_t>(dm) >> 4) * B5) | B4 |
                      (static_cast<int32_t>(dm) & 0xf);
   Emit(encoding);
 }
@@ -726,11 +738,10 @@
   ASSERT(TargetCPUFeatures::vfp_supported());
   ASSERT(sd != kNoSRegister);
   ASSERT(cond != kNoCondition);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B27 | B26 | B24 | B20 |
-                     ((static_cast<int32_t>(sd) & 1)*B22) |
-                     ((static_cast<int32_t>(sd) >> 1)*B12) |
-                     B11 | B9 | ad.vencoding();
+  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | B27 |
+                     B26 | B24 | B20 | ((static_cast<int32_t>(sd) & 1) * B22) |
+                     ((static_cast<int32_t>(sd) >> 1) * B12) | B11 | B9 |
+                     ad.vencoding();
   Emit(encoding);
 }
 
@@ -740,11 +751,10 @@
   ASSERT(static_cast<Register>(ad.encoding_ & (0xf << kRnShift)) != PC);
   ASSERT(sd != kNoSRegister);
   ASSERT(cond != kNoCondition);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B27 | B26 | B24 |
-                     ((static_cast<int32_t>(sd) & 1)*B22) |
-                     ((static_cast<int32_t>(sd) >> 1)*B12) |
-                     B11 | B9 | ad.vencoding();
+  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | B27 |
+                     B26 | B24 | ((static_cast<int32_t>(sd) & 1) * B22) |
+                     ((static_cast<int32_t>(sd) >> 1) * B12) | B11 | B9 |
+                     ad.vencoding();
   Emit(encoding);
 }
 
@@ -753,11 +763,10 @@
   ASSERT(TargetCPUFeatures::vfp_supported());
   ASSERT(dd != kNoDRegister);
   ASSERT(cond != kNoCondition);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B27 | B26 | B24 | B20 |
-                     ((static_cast<int32_t>(dd) >> 4)*B22) |
-                     ((static_cast<int32_t>(dd) & 0xf)*B12) |
-                     B11 | B9 | B8 | ad.vencoding();
+  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | B27 |
+                     B26 | B24 | B20 | ((static_cast<int32_t>(dd) >> 4) * B22) |
+                     ((static_cast<int32_t>(dd) & 0xf) * B12) | B11 | B9 | B8 |
+                     ad.vencoding();
   Emit(encoding);
 }
 
@@ -767,44 +776,40 @@
   ASSERT(static_cast<Register>(ad.encoding_ & (0xf << kRnShift)) != PC);
   ASSERT(dd != kNoDRegister);
   ASSERT(cond != kNoCondition);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B27 | B26 | B24 |
-                     ((static_cast<int32_t>(dd) >> 4)*B22) |
-                     ((static_cast<int32_t>(dd) & 0xf)*B12) |
-                     B11 | B9 | B8 | ad.vencoding();
+  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | B27 |
+                     B26 | B24 | ((static_cast<int32_t>(dd) >> 4) * B22) |
+                     ((static_cast<int32_t>(dd) & 0xf) * B12) | B11 | B9 | B8 |
+                     ad.vencoding();
   Emit(encoding);
 }
 
 void Assembler::EmitMultiVSMemOp(Condition cond,
-                                BlockAddressMode am,
-                                bool load,
-                                Register base,
-                                SRegister start,
-                                uint32_t count) {
+                                 BlockAddressMode am,
+                                 bool load,
+                                 Register base,
+                                 SRegister start,
+                                 uint32_t count) {
   ASSERT(TargetCPUFeatures::vfp_supported());
   ASSERT(base != kNoRegister);
   ASSERT(cond != kNoCondition);
   ASSERT(start != kNoSRegister);
   ASSERT(static_cast<int32_t>(start) + count <= kNumberOfSRegisters);
 
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B27 | B26 | B11 | B9 |
-                     am |
-                     (load ? L : 0) |
+  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | B27 |
+                     B26 | B11 | B9 | am | (load ? L : 0) |
                      (static_cast<int32_t>(base) << kRnShift) |
                      ((static_cast<int32_t>(start) & 0x1) ? D : 0) |
-                     ((static_cast<int32_t>(start) >> 1) << 12) |
-                     count;
+                     ((static_cast<int32_t>(start) >> 1) << 12) | count;
   Emit(encoding);
 }
 
 
 void Assembler::EmitMultiVDMemOp(Condition cond,
-                                BlockAddressMode am,
-                                bool load,
-                                Register base,
-                                DRegister start,
-                                int32_t count) {
+                                 BlockAddressMode am,
+                                 bool load,
+                                 Register base,
+                                 DRegister start,
+                                 int32_t count) {
   ASSERT(TargetCPUFeatures::vfp_supported());
   ASSERT(base != kNoRegister);
   ASSERT(cond != kNoCondition);
@@ -812,36 +817,42 @@
   ASSERT(static_cast<int32_t>(start) + count <= kNumberOfDRegisters);
   const int armv5te = TargetCPUFeatures::arm_version() == ARMv5TE ? 1 : 0;
 
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B27 | B26 | B11 | B9 | B8 |
-                     am |
-                     (load ? L : 0) |
-                     (static_cast<int32_t>(base) << kRnShift) |
-                     ((static_cast<int32_t>(start) & 0x10) ? D : 0) |
-                     ((static_cast<int32_t>(start) & 0xf) << 12) |
-                     (count << 1) | armv5te;
+  int32_t encoding =
+      (static_cast<int32_t>(cond) << kConditionShift) | B27 | B26 | B11 | B9 |
+      B8 | am | (load ? L : 0) | (static_cast<int32_t>(base) << kRnShift) |
+      ((static_cast<int32_t>(start) & 0x10) ? D : 0) |
+      ((static_cast<int32_t>(start) & 0xf) << 12) | (count << 1) | armv5te;
   Emit(encoding);
 }
 
 
-void Assembler::vldms(BlockAddressMode am, Register base,
-                      SRegister first, SRegister last, Condition cond) {
+void Assembler::vldms(BlockAddressMode am,
+                      Register base,
+                      SRegister first,
+                      SRegister last,
+                      Condition cond) {
   ASSERT((am == IA) || (am == IA_W) || (am == DB_W));
   ASSERT(last > first);
   EmitMultiVSMemOp(cond, am, true, base, first, last - first + 1);
 }
 
 
-void Assembler::vstms(BlockAddressMode am, Register base,
-                      SRegister first, SRegister last, Condition cond) {
+void Assembler::vstms(BlockAddressMode am,
+                      Register base,
+                      SRegister first,
+                      SRegister last,
+                      Condition cond) {
   ASSERT((am == IA) || (am == IA_W) || (am == DB_W));
   ASSERT(last > first);
   EmitMultiVSMemOp(cond, am, false, base, first, last - first + 1);
 }
 
 
-void Assembler::vldmd(BlockAddressMode am, Register base,
-                      DRegister first, intptr_t count, Condition cond) {
+void Assembler::vldmd(BlockAddressMode am,
+                      Register base,
+                      DRegister first,
+                      intptr_t count,
+                      Condition cond) {
   ASSERT((am == IA) || (am == IA_W) || (am == DB_W));
   ASSERT(count <= 16);
   ASSERT(first + count <= kNumberOfDRegisters);
@@ -849,8 +860,11 @@
 }
 
 
-void Assembler::vstmd(BlockAddressMode am, Register base,
-                      DRegister first, intptr_t count, Condition cond) {
+void Assembler::vstmd(BlockAddressMode am,
+                      Register base,
+                      DRegister first,
+                      intptr_t count,
+                      Condition cond) {
   ASSERT((am == IA) || (am == IA_W) || (am == DB_W));
   ASSERT(count <= 16);
   ASSERT(first + count <= kNumberOfDRegisters);
@@ -858,40 +872,44 @@
 }
 
 
-void Assembler::EmitVFPsss(Condition cond, int32_t opcode,
-                           SRegister sd, SRegister sn, SRegister sm) {
+void Assembler::EmitVFPsss(Condition cond,
+                           int32_t opcode,
+                           SRegister sd,
+                           SRegister sn,
+                           SRegister sm) {
   ASSERT(TargetCPUFeatures::vfp_supported());
   ASSERT(sd != kNoSRegister);
   ASSERT(sn != kNoSRegister);
   ASSERT(sm != kNoSRegister);
   ASSERT(cond != kNoCondition);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B27 | B26 | B25 | B11 | B9 | opcode |
-                     ((static_cast<int32_t>(sd) & 1)*B22) |
-                     ((static_cast<int32_t>(sn) >> 1)*B16) |
-                     ((static_cast<int32_t>(sd) >> 1)*B12) |
-                     ((static_cast<int32_t>(sn) & 1)*B7) |
-                     ((static_cast<int32_t>(sm) & 1)*B5) |
-                     (static_cast<int32_t>(sm) >> 1);
+  int32_t encoding =
+      (static_cast<int32_t>(cond) << kConditionShift) | B27 | B26 | B25 | B11 |
+      B9 | opcode | ((static_cast<int32_t>(sd) & 1) * B22) |
+      ((static_cast<int32_t>(sn) >> 1) * B16) |
+      ((static_cast<int32_t>(sd) >> 1) * B12) |
+      ((static_cast<int32_t>(sn) & 1) * B7) |
+      ((static_cast<int32_t>(sm) & 1) * B5) | (static_cast<int32_t>(sm) >> 1);
   Emit(encoding);
 }
 
 
-void Assembler::EmitVFPddd(Condition cond, int32_t opcode,
-                           DRegister dd, DRegister dn, DRegister dm) {
+void Assembler::EmitVFPddd(Condition cond,
+                           int32_t opcode,
+                           DRegister dd,
+                           DRegister dn,
+                           DRegister dm) {
   ASSERT(TargetCPUFeatures::vfp_supported());
   ASSERT(dd != kNoDRegister);
   ASSERT(dn != kNoDRegister);
   ASSERT(dm != kNoDRegister);
   ASSERT(cond != kNoCondition);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B27 | B26 | B25 | B11 | B9 | B8 | opcode |
-                     ((static_cast<int32_t>(dd) >> 4)*B22) |
-                     ((static_cast<int32_t>(dn) & 0xf)*B16) |
-                     ((static_cast<int32_t>(dd) & 0xf)*B12) |
-                     ((static_cast<int32_t>(dn) >> 4)*B7) |
-                     ((static_cast<int32_t>(dm) >> 4)*B5) |
-                     (static_cast<int32_t>(dm) & 0xf);
+  int32_t encoding =
+      (static_cast<int32_t>(cond) << kConditionShift) | B27 | B26 | B25 | B11 |
+      B9 | B8 | opcode | ((static_cast<int32_t>(dd) >> 4) * B22) |
+      ((static_cast<int32_t>(dn) & 0xf) * B16) |
+      ((static_cast<int32_t>(dd) & 0xf) * B12) |
+      ((static_cast<int32_t>(dn) >> 4) * B7) |
+      ((static_cast<int32_t>(dm) >> 4) * B5) | (static_cast<int32_t>(dm) & 0xf);
   Emit(encoding);
 }
 
@@ -913,11 +931,11 @@
   uint32_t imm32 = bit_cast<uint32_t, float>(s_imm);
   if (((imm32 & ((1 << 19) - 1)) == 0) &&
       ((((imm32 >> 25) & ((1 << 6) - 1)) == (1 << 5)) ||
-       (((imm32 >> 25) & ((1 << 6) - 1)) == ((1 << 5) -1)))) {
+       (((imm32 >> 25) & ((1 << 6) - 1)) == ((1 << 5) - 1)))) {
     uint8_t imm8 = ((imm32 >> 31) << 7) | (((imm32 >> 29) & 1) << 6) |
-        ((imm32 >> 19) & ((1 << 6) -1));
-    EmitVFPsss(cond, B23 | B21 | B20 | ((imm8 >> 4)*B16) | (imm8 & 0xf),
-               sd, S0, S0);
+                   ((imm32 >> 19) & ((1 << 6) - 1));
+    EmitVFPsss(cond, B23 | B21 | B20 | ((imm8 >> 4) * B16) | (imm8 & 0xf), sd,
+               S0, S0);
     return true;
   }
   return false;
@@ -931,10 +949,10 @@
   uint64_t imm64 = bit_cast<uint64_t, double>(d_imm);
   if (((imm64 & ((1LL << 48) - 1)) == 0) &&
       ((((imm64 >> 54) & ((1 << 9) - 1)) == (1 << 8)) ||
-       (((imm64 >> 54) & ((1 << 9) - 1)) == ((1 << 8) -1)))) {
+       (((imm64 >> 54) & ((1 << 9) - 1)) == ((1 << 8) - 1)))) {
     uint8_t imm8 = ((imm64 >> 63) << 7) | (((imm64 >> 61) & 1) << 6) |
-        ((imm64 >> 48) & ((1 << 6) -1));
-    EmitVFPddd(cond, B23 | B21 | B20 | ((imm8 >> 4)*B16) | B8 | (imm8 & 0xf),
+                   ((imm64 >> 48) & ((1 << 6) - 1));
+    EmitVFPddd(cond, B23 | B21 | B20 | ((imm8 >> 4) * B16) | B8 | (imm8 & 0xf),
                dd, D0, D0);
     return true;
   }
@@ -942,73 +960,97 @@
 }
 
 
-void Assembler::vadds(SRegister sd, SRegister sn, SRegister sm,
+void Assembler::vadds(SRegister sd,
+                      SRegister sn,
+                      SRegister sm,
                       Condition cond) {
   EmitVFPsss(cond, B21 | B20, sd, sn, sm);
 }
 
 
-void Assembler::vaddd(DRegister dd, DRegister dn, DRegister dm,
+void Assembler::vaddd(DRegister dd,
+                      DRegister dn,
+                      DRegister dm,
                       Condition cond) {
   EmitVFPddd(cond, B21 | B20, dd, dn, dm);
 }
 
 
-void Assembler::vsubs(SRegister sd, SRegister sn, SRegister sm,
+void Assembler::vsubs(SRegister sd,
+                      SRegister sn,
+                      SRegister sm,
                       Condition cond) {
   EmitVFPsss(cond, B21 | B20 | B6, sd, sn, sm);
 }
 
 
-void Assembler::vsubd(DRegister dd, DRegister dn, DRegister dm,
+void Assembler::vsubd(DRegister dd,
+                      DRegister dn,
+                      DRegister dm,
                       Condition cond) {
   EmitVFPddd(cond, B21 | B20 | B6, dd, dn, dm);
 }
 
 
-void Assembler::vmuls(SRegister sd, SRegister sn, SRegister sm,
+void Assembler::vmuls(SRegister sd,
+                      SRegister sn,
+                      SRegister sm,
                       Condition cond) {
   EmitVFPsss(cond, B21, sd, sn, sm);
 }
 
 
-void Assembler::vmuld(DRegister dd, DRegister dn, DRegister dm,
+void Assembler::vmuld(DRegister dd,
+                      DRegister dn,
+                      DRegister dm,
                       Condition cond) {
   EmitVFPddd(cond, B21, dd, dn, dm);
 }
 
 
-void Assembler::vmlas(SRegister sd, SRegister sn, SRegister sm,
+void Assembler::vmlas(SRegister sd,
+                      SRegister sn,
+                      SRegister sm,
                       Condition cond) {
   EmitVFPsss(cond, 0, sd, sn, sm);
 }
 
 
-void Assembler::vmlad(DRegister dd, DRegister dn, DRegister dm,
+void Assembler::vmlad(DRegister dd,
+                      DRegister dn,
+                      DRegister dm,
                       Condition cond) {
   EmitVFPddd(cond, 0, dd, dn, dm);
 }
 
 
-void Assembler::vmlss(SRegister sd, SRegister sn, SRegister sm,
+void Assembler::vmlss(SRegister sd,
+                      SRegister sn,
+                      SRegister sm,
                       Condition cond) {
   EmitVFPsss(cond, B6, sd, sn, sm);
 }
 
 
-void Assembler::vmlsd(DRegister dd, DRegister dn, DRegister dm,
+void Assembler::vmlsd(DRegister dd,
+                      DRegister dn,
+                      DRegister dm,
                       Condition cond) {
   EmitVFPddd(cond, B6, dd, dn, dm);
 }
 
 
-void Assembler::vdivs(SRegister sd, SRegister sn, SRegister sm,
+void Assembler::vdivs(SRegister sd,
+                      SRegister sn,
+                      SRegister sm,
                       Condition cond) {
   EmitVFPsss(cond, B23, sd, sn, sm);
 }
 
 
-void Assembler::vdivd(DRegister dd, DRegister dn, DRegister dm,
+void Assembler::vdivd(DRegister dd,
+                      DRegister dn,
+                      DRegister dm,
                       Condition cond) {
   EmitVFPddd(cond, B23, dd, dn, dm);
 }
@@ -1043,34 +1085,36 @@
 }
 
 
-void Assembler::EmitVFPsd(Condition cond, int32_t opcode,
-                          SRegister sd, DRegister dm) {
+void Assembler::EmitVFPsd(Condition cond,
+                          int32_t opcode,
+                          SRegister sd,
+                          DRegister dm) {
   ASSERT(TargetCPUFeatures::vfp_supported());
   ASSERT(sd != kNoSRegister);
   ASSERT(dm != kNoDRegister);
   ASSERT(cond != kNoCondition);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B27 | B26 | B25 | B11 | B9 | opcode |
-                     ((static_cast<int32_t>(sd) & 1)*B22) |
-                     ((static_cast<int32_t>(sd) >> 1)*B12) |
-                     ((static_cast<int32_t>(dm) >> 4)*B5) |
-                     (static_cast<int32_t>(dm) & 0xf);
+  int32_t encoding =
+      (static_cast<int32_t>(cond) << kConditionShift) | B27 | B26 | B25 | B11 |
+      B9 | opcode | ((static_cast<int32_t>(sd) & 1) * B22) |
+      ((static_cast<int32_t>(sd) >> 1) * B12) |
+      ((static_cast<int32_t>(dm) >> 4) * B5) | (static_cast<int32_t>(dm) & 0xf);
   Emit(encoding);
 }
 
 
-void Assembler::EmitVFPds(Condition cond, int32_t opcode,
-                          DRegister dd, SRegister sm) {
+void Assembler::EmitVFPds(Condition cond,
+                          int32_t opcode,
+                          DRegister dd,
+                          SRegister sm) {
   ASSERT(TargetCPUFeatures::vfp_supported());
   ASSERT(dd != kNoDRegister);
   ASSERT(sm != kNoSRegister);
   ASSERT(cond != kNoCondition);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B27 | B26 | B25 | B11 | B9 | opcode |
-                     ((static_cast<int32_t>(dd) >> 4)*B22) |
-                     ((static_cast<int32_t>(dd) & 0xf)*B12) |
-                     ((static_cast<int32_t>(sm) & 1)*B5) |
-                     (static_cast<int32_t>(sm) >> 1);
+  int32_t encoding =
+      (static_cast<int32_t>(cond) << kConditionShift) | B27 | B26 | B25 | B11 |
+      B9 | opcode | ((static_cast<int32_t>(dd) >> 4) * B22) |
+      ((static_cast<int32_t>(dd) & 0xf) * B12) |
+      ((static_cast<int32_t>(sm) & 1) * B5) | (static_cast<int32_t>(sm) >> 1);
   Emit(encoding);
 }
 
@@ -1148,10 +1192,9 @@
 void Assembler::vmrs(Register rd, Condition cond) {
   ASSERT(TargetCPUFeatures::vfp_supported());
   ASSERT(cond != kNoCondition);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B27 | B26 | B25 | B23 | B22 | B21 | B20 | B16 |
-                     (static_cast<int32_t>(rd)*B12) |
-                     B11 | B9 | B4;
+  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | B27 |
+                     B26 | B25 | B23 | B22 | B21 | B20 | B16 |
+                     (static_cast<int32_t>(rd) * B12) | B11 | B9 | B4;
   Emit(encoding);
 }
 
@@ -1187,38 +1230,40 @@
 }
 
 
-void Assembler::EmitSIMDqqq(int32_t opcode, OperandSize size,
-                            QRegister qd, QRegister qn, QRegister qm) {
+void Assembler::EmitSIMDqqq(int32_t opcode,
+                            OperandSize size,
+                            QRegister qd,
+                            QRegister qn,
+                            QRegister qm) {
   ASSERT(TargetCPUFeatures::neon_supported());
   int sz = ShiftOfOperandSize(size);
   int32_t encoding =
-      (static_cast<int32_t>(kSpecialCondition) << kConditionShift) |
-      B25 | B6 |
+      (static_cast<int32_t>(kSpecialCondition) << kConditionShift) | B25 | B6 |
       opcode | ((sz & 0x3) * B20) |
-      ((static_cast<int32_t>(qd * 2) >> 4)*B22) |
-      ((static_cast<int32_t>(qn * 2) & 0xf)*B16) |
-      ((static_cast<int32_t>(qd * 2) & 0xf)*B12) |
-      ((static_cast<int32_t>(qn * 2) >> 4)*B7) |
-      ((static_cast<int32_t>(qm * 2) >> 4)*B5) |
+      ((static_cast<int32_t>(qd * 2) >> 4) * B22) |
+      ((static_cast<int32_t>(qn * 2) & 0xf) * B16) |
+      ((static_cast<int32_t>(qd * 2) & 0xf) * B12) |
+      ((static_cast<int32_t>(qn * 2) >> 4) * B7) |
+      ((static_cast<int32_t>(qm * 2) >> 4) * B5) |
       (static_cast<int32_t>(qm * 2) & 0xf);
   Emit(encoding);
 }
 
 
-void Assembler::EmitSIMDddd(int32_t opcode, OperandSize size,
-                            DRegister dd, DRegister dn, DRegister dm) {
+void Assembler::EmitSIMDddd(int32_t opcode,
+                            OperandSize size,
+                            DRegister dd,
+                            DRegister dn,
+                            DRegister dm) {
   ASSERT(TargetCPUFeatures::neon_supported());
   int sz = ShiftOfOperandSize(size);
   int32_t encoding =
-      (static_cast<int32_t>(kSpecialCondition) << kConditionShift) |
-      B25 |
-      opcode | ((sz & 0x3) * B20) |
-      ((static_cast<int32_t>(dd) >> 4)*B22) |
-      ((static_cast<int32_t>(dn) & 0xf)*B16) |
-      ((static_cast<int32_t>(dd) & 0xf)*B12) |
-      ((static_cast<int32_t>(dn) >> 4)*B7) |
-      ((static_cast<int32_t>(dm) >> 4)*B5) |
-      (static_cast<int32_t>(dm) & 0xf);
+      (static_cast<int32_t>(kSpecialCondition) << kConditionShift) | B25 |
+      opcode | ((sz & 0x3) * B20) | ((static_cast<int32_t>(dd) >> 4) * B22) |
+      ((static_cast<int32_t>(dn) & 0xf) * B16) |
+      ((static_cast<int32_t>(dd) & 0xf) * B12) |
+      ((static_cast<int32_t>(dn) >> 4) * B7) |
+      ((static_cast<int32_t>(dm) >> 4) * B5) | (static_cast<int32_t>(dm) & 0xf);
   Emit(encoding);
 }
 
@@ -1229,7 +1274,9 @@
 
 
 void Assembler::vaddqi(OperandSize sz,
-                       QRegister qd, QRegister qn, QRegister qm) {
+                       QRegister qd,
+                       QRegister qn,
+                       QRegister qm) {
   EmitSIMDqqq(B11, sz, qd, qn, qm);
 }
 
@@ -1240,7 +1287,9 @@
 
 
 void Assembler::vsubqi(OperandSize sz,
-                       QRegister qd, QRegister qn, QRegister qm) {
+                       QRegister qd,
+                       QRegister qn,
+                       QRegister qm) {
   EmitSIMDqqq(B24 | B11, sz, qd, qn, qm);
 }
 
@@ -1251,7 +1300,9 @@
 
 
 void Assembler::vmulqi(OperandSize sz,
-                       QRegister qd, QRegister qn, QRegister qm) {
+                       QRegister qd,
+                       QRegister qn,
+                       QRegister qm) {
   EmitSIMDqqq(B11 | B8 | B4, sz, qd, qn, qm);
 }
 
@@ -1262,13 +1313,17 @@
 
 
 void Assembler::vshlqi(OperandSize sz,
-                       QRegister qd, QRegister qm, QRegister qn) {
+                       QRegister qd,
+                       QRegister qm,
+                       QRegister qn) {
   EmitSIMDqqq(B25 | B10, sz, qd, qn, qm);
 }
 
 
 void Assembler::vshlqu(OperandSize sz,
-                       QRegister qd, QRegister qm, QRegister qn) {
+                       QRegister qd,
+                       QRegister qm,
+                       QRegister qn) {
   EmitSIMDqqq(B25 | B24 | B10, sz, qd, qn, qm);
 }
 
@@ -1309,8 +1364,8 @@
 
 
 void Assembler::vabsqs(QRegister qd, QRegister qm) {
-  EmitSIMDqqq(B24 | B23 | B21 | B20 | B19 | B16 | B10 | B9 | B8, kSWord,
-              qd, Q0, qm);
+  EmitSIMDqqq(B24 | B23 | B21 | B20 | B19 | B16 | B10 | B9 | B8, kSWord, qd, Q0,
+              qm);
 }
 
 
@@ -1321,8 +1376,8 @@
 
 
 void Assembler::vrecpeqs(QRegister qd, QRegister qm) {
-  EmitSIMDqqq(B24 | B23 | B21 | B20 | B19 | B17 | B16 | B10 | B8, kSWord,
-              qd, Q0, qm);
+  EmitSIMDqqq(B24 | B23 | B21 | B20 | B19 | B17 | B16 | B10 | B8, kSWord, qd,
+              Q0, qm);
 }
 
 
@@ -1332,8 +1387,8 @@
 
 
 void Assembler::vrsqrteqs(QRegister qd, QRegister qm) {
-  EmitSIMDqqq(B24 | B23 | B21 | B20 | B19 | B17 | B16 | B10 | B8 | B7,
-              kSWord, qd, Q0, qm);
+  EmitSIMDqqq(B24 | B23 | B21 | B20 | B19 | B17 | B16 | B10 | B8 | B7, kSWord,
+              qd, Q0, qm);
 }
 
 
@@ -1365,15 +1420,12 @@
       code = 4 | (idx << 3);
       break;
     }
-    default: {
-      break;
-    }
+    default: { break; }
   }
 
   EmitSIMDddd(B24 | B23 | B11 | B10 | B6, kWordPair,
               static_cast<DRegister>(qd * 2),
-              static_cast<DRegister>(code & 0xf),
-              dm);
+              static_cast<DRegister>(code & 0xf), dm);
 }
 
 
@@ -1389,7 +1441,9 @@
 
 
 void Assembler::vceqqi(OperandSize sz,
-                      QRegister qd, QRegister qn, QRegister qm) {
+                       QRegister qd,
+                       QRegister qn,
+                       QRegister qm) {
   EmitSIMDqqq(B24 | B11 | B4, sz, qd, qn, qm);
 }
 
@@ -1400,13 +1454,17 @@
 
 
 void Assembler::vcgeqi(OperandSize sz,
-                      QRegister qd, QRegister qn, QRegister qm) {
+                       QRegister qd,
+                       QRegister qn,
+                       QRegister qm) {
   EmitSIMDqqq(B9 | B8 | B4, sz, qd, qn, qm);
 }
 
 
 void Assembler::vcugeqi(OperandSize sz,
-                      QRegister qd, QRegister qn, QRegister qm) {
+                        QRegister qd,
+                        QRegister qn,
+                        QRegister qm) {
   EmitSIMDqqq(B24 | B9 | B8 | B4, sz, qd, qn, qm);
 }
 
@@ -1417,13 +1475,17 @@
 
 
 void Assembler::vcgtqi(OperandSize sz,
-                      QRegister qd, QRegister qn, QRegister qm) {
+                       QRegister qd,
+                       QRegister qn,
+                       QRegister qm) {
   EmitSIMDqqq(B9 | B8, sz, qd, qn, qm);
 }
 
 
 void Assembler::vcugtqi(OperandSize sz,
-                      QRegister qd, QRegister qn, QRegister qm) {
+                        QRegister qd,
+                        QRegister qn,
+                        QRegister qm) {
   EmitSIMDqqq(B24 | B9 | B8, sz, qd, qn, qm);
 }
 
@@ -1451,8 +1513,8 @@
 void Assembler::bx(Register rm, Condition cond) {
   ASSERT(rm != kNoRegister);
   ASSERT(cond != kNoCondition);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B24 | B21 | (0xfff << 8) | B4 |
+  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | B24 |
+                     B21 | (0xfff << 8) | B4 |
                      (static_cast<int32_t>(rm) << kRmShift);
   Emit(encoding);
 }
@@ -1461,8 +1523,8 @@
 void Assembler::blx(Register rm, Condition cond) {
   ASSERT(rm != kNoRegister);
   ASSERT(cond != kNoCondition);
-  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
-                     B24 | B21 | (0xfff << 8) | B5 | B4 |
+  int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | B24 |
+                     B21 | (0xfff << 8) | B5 | B4 |
                      (static_cast<int32_t>(rm) << kRmShift);
   Emit(encoding);
 }
@@ -1530,7 +1592,7 @@
   Bind(&cid_ok);
 
   const intptr_t offset = CodeSize() + Instr::kPCReadOffset +
-      Instructions::HeaderSize() - kHeapObjectTag;
+                          Instructions::HeaderSize() - kHeapObjectTag;
   mov(R0, Operand(PC));
   AddImmediate(R0, R0, -offset);
   ldr(IP, FieldAddress(CODE_REG, Code::saved_instructions_offset()));
@@ -1595,8 +1657,8 @@
     // Make sure that class CallPattern is able to decode this load from the
     // object pool.
     const int32_t offset = ObjectPool::element_offset(
-       is_unique ? object_pool_wrapper_.AddObject(object)
-                 : object_pool_wrapper_.FindObject(object));
+        is_unique ? object_pool_wrapper_.AddObject(object)
+                  : object_pool_wrapper_.FindObject(object));
     LoadWordFromPoolOffset(rd, offset - kHeapObjectTag, pp, cond);
   } else {
     UNREACHABLE();
@@ -1700,9 +1762,11 @@
 
 Register AllocateRegister(RegList* used) {
   const RegList free = ~*used;
-  return (free == 0) ?
-      kNoRegister :
-      UseRegister(static_cast<Register>(Utils::CountTrailingZeros(free)), used);
+  return (free == 0)
+             ? kNoRegister
+             : UseRegister(
+                   static_cast<Register>(Utils::CountTrailingZeros(free)),
+                   used);
 }
 
 
@@ -1741,8 +1805,8 @@
                                       bool can_value_be_smi) {
   int32_t ignored = 0;
   if (Address::CanHoldStoreOffset(kWord, offset - kHeapObjectTag, &ignored)) {
-    StoreIntoObject(
-        object, FieldAddress(object, offset), value, can_value_be_smi);
+    StoreIntoObject(object, FieldAddress(object, offset), value,
+                    can_value_be_smi);
   } else {
     AddImmediate(IP, object, offset - kHeapObjectTag);
     StoreIntoObject(object, Address(IP), value, can_value_be_smi);
@@ -1845,7 +1909,7 @@
   intptr_t current_offset = begin_offset;
   while (current_offset + kWordSize < end_offset) {
     strd(value_even, value_odd, base, current_offset);
-    current_offset += 2*kWordSize;
+    current_offset += 2 * kWordSize;
   }
   while (current_offset < end_offset) {
     str(value_even, Address(base, current_offset));
@@ -1877,8 +1941,8 @@
 void Assembler::LoadClassId(Register result, Register object, Condition cond) {
   ASSERT(RawObject::kClassIdTagPos == 16);
   ASSERT(RawObject::kClassIdTagSize == 16);
-  const intptr_t class_id_offset = Object::tags_offset() +
-      RawObject::kClassIdTagPos / kBitsPerByte;
+  const intptr_t class_id_offset =
+      Object::tags_offset() + RawObject::kClassIdTagPos / kBitsPerByte;
   ldrh(result, FieldAddress(object, class_id_offset), cond);
 }
 
@@ -1933,8 +1997,7 @@
 
   if (!CanEncodeBranchOffset(offset)) {
     ASSERT(!use_far_branches());
-    Thread::Current()->long_jump_base()->Jump(
-        1, Object::branch_offset_error());
+    Thread::Current()->long_jump_base()->Jump(1, Object::branch_offset_error());
   }
 
   // Properly preserve only the bits supported in the instruction.
@@ -1960,8 +2023,10 @@
 }
 
 
-static int32_t DecodeARMv6LoadImmediate(int32_t mov, int32_t or1,
-                                        int32_t or2, int32_t or3) {
+static int32_t DecodeARMv6LoadImmediate(int32_t mov,
+                                        int32_t or1,
+                                        int32_t or2,
+                                        int32_t or3) {
   int32_t offset = 0;
   offset |= (mov & 0xff) << 24;
   offset |= (or1 & 0xff) << 16;
@@ -1988,10 +2053,10 @@
  private:
   void ProcessARMv6(const MemoryRegion& region, intptr_t position) {
     const int32_t mov = region.Load<int32_t>(position);
-    const int32_t or1 = region.Load<int32_t>(position + 1*Instr::kInstrSize);
-    const int32_t or2 = region.Load<int32_t>(position + 2*Instr::kInstrSize);
-    const int32_t or3 = region.Load<int32_t>(position + 3*Instr::kInstrSize);
-    const int32_t bx = region.Load<int32_t>(position + 4*Instr::kInstrSize);
+    const int32_t or1 = region.Load<int32_t>(position + 1 * Instr::kInstrSize);
+    const int32_t or2 = region.Load<int32_t>(position + 2 * Instr::kInstrSize);
+    const int32_t or3 = region.Load<int32_t>(position + 3 * Instr::kInstrSize);
+    const int32_t bx = region.Load<int32_t>(position + 4 * Instr::kInstrSize);
 
     if (((mov & 0xffffff00) == 0xe3a0c400) &&  // mov IP, (byte3 rot 4)
         ((or1 & 0xffffff00) == 0xe38cc800) &&  // orr IP, IP, (byte2 rot 8)
@@ -2018,10 +2083,8 @@
     // If the offset loading instructions aren't there, we must have replaced
     // the far branch with a near one, and so these instructions
     // should be NOPs.
-    ASSERT((or1 == Instr::kNopInstruction) &&
-           (or2 == Instr::kNopInstruction) &&
-           (or3 == Instr::kNopInstruction) &&
-           (bx == Instr::kNopInstruction));
+    ASSERT((or1 == Instr::kNopInstruction) && (or2 == Instr::kNopInstruction) &&
+           (or3 == Instr::kNopInstruction) && (bx == Instr::kNopInstruction));
   }
 
 
@@ -2031,7 +2094,7 @@
     const int32_t bx = region.Load<int32_t>(position + 2 * Instr::kInstrSize);
 
     if (((movt & 0xfff0f000) == 0xe340c000) &&  // movt IP, high
-        ((movw & 0xfff0f000) == 0xe300c000)) {   // movw IP, low
+        ((movw & 0xfff0f000) == 0xe300c000)) {  // movw IP, low
       const int32_t offset = DecodeARMv7LoadImmediate(movt, movw);
       const int32_t dest = region.start() + offset;
       const uint16_t dest_high = Utils::High16Bits(dest);
@@ -2049,8 +2112,7 @@
     // If the offset loading instructions aren't there, we must have replaced
     // the far branch with a near one, and so these instructions
     // should be NOPs.
-    ASSERT((movt == Instr::kNopInstruction) &&
-           (bx == Instr::kNopInstruction));
+    ASSERT((movt == Instr::kNopInstruction) && (bx == Instr::kNopInstruction));
   }
 
   virtual bool IsPointerOffset() const { return false; }
@@ -2100,8 +2162,7 @@
       // Far branches are enabled and we can't encode the branch offset.
 
       // Grab instructions that load the offset.
-      const int32_t mov =
-          buffer_.Load<int32_t>(position);
+      const int32_t mov = buffer_.Load<int32_t>(position);
       const int32_t or1 =
           buffer_.Load<int32_t>(position + 1 * Instr::kInstrSize);
       const int32_t or2 =
@@ -2129,8 +2190,7 @@
       label->position_ = DecodeARMv6LoadImmediate(mov, or1, or2, or3);
     } else if (use_far_branches() && CanEncodeBranchOffset(dest)) {
       // Grab instructions that load the offset, and the branch.
-      const int32_t mov =
-          buffer_.Load<int32_t>(position);
+      const int32_t mov = buffer_.Load<int32_t>(position);
       const int32_t or1 =
           buffer_.Load<int32_t>(position + 1 * Instr::kInstrSize);
       const int32_t or2 =
@@ -2151,13 +2211,13 @@
       // Write the encoded branch instruction followed by two nops.
       buffer_.Store<int32_t>(position, encoded);
       buffer_.Store<int32_t>(position + 1 * Instr::kInstrSize,
-          Instr::kNopInstruction);
+                             Instr::kNopInstruction);
       buffer_.Store<int32_t>(position + 2 * Instr::kInstrSize,
-          Instr::kNopInstruction);
+                             Instr::kNopInstruction);
       buffer_.Store<int32_t>(position + 3 * Instr::kInstrSize,
-          Instr::kNopInstruction);
+                             Instr::kNopInstruction);
       buffer_.Store<int32_t>(position + 4 * Instr::kInstrSize,
-          Instr::kNopInstruction);
+                             Instr::kNopInstruction);
 
       label->position_ = DecodeARMv6LoadImmediate(mov, or1, or2, or3);
     } else {
@@ -2220,12 +2280,11 @@
       const int32_t encoded = EncodeBranchOffset(dest, new_branch);
 
       // Write the encoded branch instruction followed by two nops.
-      buffer_.Store<int32_t>(position + 0 * Instr::kInstrSize,
-          encoded);
+      buffer_.Store<int32_t>(position + 0 * Instr::kInstrSize, encoded);
       buffer_.Store<int32_t>(position + 1 * Instr::kInstrSize,
-          Instr::kNopInstruction);
+                             Instr::kNopInstruction);
       buffer_.Store<int32_t>(position + 2 * Instr::kInstrSize,
-          Instr::kNopInstruction);
+                             Instr::kNopInstruction);
 
       label->position_ = DecodeARMv7LoadImmediate(movt, movw);
     } else {
@@ -2368,8 +2427,9 @@
 }
 
 
-bool Address::CanHoldImmediateOffset(
-    bool is_load, intptr_t cid, int64_t offset) {
+bool Address::CanHoldImmediateOffset(bool is_load,
+                                     intptr_t cid,
+                                     int64_t offset) {
   int32_t offset_mask = 0;
   if (is_load) {
     return CanHoldLoadOffset(OperandSizeFor(cid), offset, &offset_mask);
@@ -2406,7 +2466,9 @@
 }
 
 
-void Assembler::Lsl(Register rd, Register rm, const Operand& shift_imm,
+void Assembler::Lsl(Register rd,
+                    Register rm,
+                    const Operand& shift_imm,
                     Condition cond) {
   ASSERT(shift_imm.type() == 1);
   ASSERT(shift_imm.encoding() != 0);  // Do not use Lsl if no shift is wanted.
@@ -2419,7 +2481,9 @@
 }
 
 
-void Assembler::Lsr(Register rd, Register rm, const Operand& shift_imm,
+void Assembler::Lsr(Register rd,
+                    Register rm,
+                    const Operand& shift_imm,
                     Condition cond) {
   ASSERT(shift_imm.type() == 1);
   uint32_t shift = shift_imm.encoding();
@@ -2436,7 +2500,9 @@
 }
 
 
-void Assembler::Asr(Register rd, Register rm, const Operand& shift_imm,
+void Assembler::Asr(Register rd,
+                    Register rm,
+                    const Operand& shift_imm,
                     Condition cond) {
   ASSERT(shift_imm.type() == 1);
   uint32_t shift = shift_imm.encoding();
@@ -2448,7 +2514,9 @@
 }
 
 
-void Assembler::Asrs(Register rd, Register rm, const Operand& shift_imm,
+void Assembler::Asrs(Register rd,
+                     Register rm,
+                     const Operand& shift_imm,
                      Condition cond) {
   ASSERT(shift_imm.type() == 1);
   uint32_t shift = shift_imm.encoding();
@@ -2465,7 +2533,9 @@
 }
 
 
-void Assembler::Ror(Register rd, Register rm, const Operand& shift_imm,
+void Assembler::Ror(Register rd,
+                    Register rm,
+                    const Operand& shift_imm,
                     Condition cond) {
   ASSERT(shift_imm.type() == 1);
   ASSERT(shift_imm.encoding() != 0);  // Use Rrx instruction.
@@ -2510,9 +2580,9 @@
   vrsqrteqs(qd, qm);
   // 2 Newton-Raphson steps. xn+1 = xn * (3 - Q1*xn^2) / 2.
   // First step.
-  vmulqs(QTMP, qd, qd);  // QTMP <- xn^2
+  vmulqs(QTMP, qd, qd);       // QTMP <- xn^2
   vrsqrtsqs(QTMP, qm, QTMP);  // QTMP <- (3 - Q1*QTMP) / 2.
-  vmulqs(qd, qd, QTMP);  // xn+1 <- xn * QTMP
+  vmulqs(qd, qd, QTMP);       // xn+1 <- xn * QTMP
   // Second step.
   vmulqs(QTMP, qd, qd);
   vrsqrtsqs(QTMP, qm, QTMP);
@@ -2625,8 +2695,9 @@
 }
 
 
-void Assembler::LoadPatchableImmediate(
-    Register rd, int32_t value, Condition cond) {
+void Assembler::LoadPatchableImmediate(Register rd,
+                                       int32_t value,
+                                       Condition cond) {
   const ARMVersion version = TargetCPUFeatures::arm_version();
   if ((version == ARMv5TE) || (version == ARMv6)) {
     // This sequence is patched in a few places, and should remain fixed.
@@ -2648,8 +2719,9 @@
 }
 
 
-void Assembler::LoadDecodableImmediate(
-    Register rd, int32_t value, Condition cond) {
+void Assembler::LoadDecodableImmediate(Register rd,
+                                       int32_t value,
+                                       Condition cond) {
   const ARMVersion version = TargetCPUFeatures::arm_version();
   if ((version == ARMv5TE) || (version == ARMv6)) {
     if (constant_pool_allowed()) {
@@ -2842,6 +2914,7 @@
   vldmd(IA, IP, first, count);
 }
 
+
 void Assembler::StoreMultipleDToOffset(DRegister first,
                                        intptr_t count,
                                        Register base,
@@ -2852,78 +2925,93 @@
 }
 
 
-void Assembler::CopyDoubleField(
-    Register dst, Register src, Register tmp1, Register tmp2, DRegister dtmp) {
+void Assembler::CopyDoubleField(Register dst,
+                                Register src,
+                                Register tmp1,
+                                Register tmp2,
+                                DRegister dtmp) {
   if (TargetCPUFeatures::vfp_supported()) {
     LoadDFromOffset(dtmp, src, Double::value_offset() - kHeapObjectTag);
     StoreDToOffset(dtmp, dst, Double::value_offset() - kHeapObjectTag);
   } else {
-    LoadFromOffset(kWord, tmp1, src,
-        Double::value_offset() - kHeapObjectTag);
+    LoadFromOffset(kWord, tmp1, src, Double::value_offset() - kHeapObjectTag);
     LoadFromOffset(kWord, tmp2, src,
-        Double::value_offset() + kWordSize - kHeapObjectTag);
-    StoreToOffset(kWord, tmp1, dst,
-        Double::value_offset() - kHeapObjectTag);
+                   Double::value_offset() + kWordSize - kHeapObjectTag);
+    StoreToOffset(kWord, tmp1, dst, Double::value_offset() - kHeapObjectTag);
     StoreToOffset(kWord, tmp2, dst,
-        Double::value_offset() + kWordSize - kHeapObjectTag);
+                  Double::value_offset() + kWordSize - kHeapObjectTag);
   }
 }
 
 
-void Assembler::CopyFloat32x4Field(
-    Register dst, Register src, Register tmp1, Register tmp2, DRegister dtmp) {
+void Assembler::CopyFloat32x4Field(Register dst,
+                                   Register src,
+                                   Register tmp1,
+                                   Register tmp2,
+                                   DRegister dtmp) {
   if (TargetCPUFeatures::neon_supported()) {
     LoadMultipleDFromOffset(dtmp, 2, src,
-        Float32x4::value_offset() - kHeapObjectTag);
+                            Float32x4::value_offset() - kHeapObjectTag);
     StoreMultipleDToOffset(dtmp, 2, dst,
-        Float32x4::value_offset() - kHeapObjectTag);
+                           Float32x4::value_offset() - kHeapObjectTag);
   } else {
-    LoadFromOffset(kWord, tmp1, src,
+    LoadFromOffset(
+        kWord, tmp1, src,
         (Float32x4::value_offset() + 0 * kWordSize) - kHeapObjectTag);
-    LoadFromOffset(kWord, tmp2, src,
+    LoadFromOffset(
+        kWord, tmp2, src,
         (Float32x4::value_offset() + 1 * kWordSize) - kHeapObjectTag);
     StoreToOffset(kWord, tmp1, dst,
-        (Float32x4::value_offset() + 0 * kWordSize) - kHeapObjectTag);
+                  (Float32x4::value_offset() + 0 * kWordSize) - kHeapObjectTag);
     StoreToOffset(kWord, tmp2, dst,
-        (Float32x4::value_offset() + 1 * kWordSize) - kHeapObjectTag);
+                  (Float32x4::value_offset() + 1 * kWordSize) - kHeapObjectTag);
 
-    LoadFromOffset(kWord, tmp1, src,
+    LoadFromOffset(
+        kWord, tmp1, src,
         (Float32x4::value_offset() + 2 * kWordSize) - kHeapObjectTag);
-    LoadFromOffset(kWord, tmp2, src,
+    LoadFromOffset(
+        kWord, tmp2, src,
         (Float32x4::value_offset() + 3 * kWordSize) - kHeapObjectTag);
     StoreToOffset(kWord, tmp1, dst,
-        (Float32x4::value_offset() + 2 * kWordSize) - kHeapObjectTag);
+                  (Float32x4::value_offset() + 2 * kWordSize) - kHeapObjectTag);
     StoreToOffset(kWord, tmp2, dst,
-        (Float32x4::value_offset() + 3 * kWordSize) - kHeapObjectTag);
+                  (Float32x4::value_offset() + 3 * kWordSize) - kHeapObjectTag);
   }
 }
 
 
-void Assembler::CopyFloat64x2Field(
-    Register dst, Register src, Register tmp1, Register tmp2, DRegister dtmp) {
+void Assembler::CopyFloat64x2Field(Register dst,
+                                   Register src,
+                                   Register tmp1,
+                                   Register tmp2,
+                                   DRegister dtmp) {
   if (TargetCPUFeatures::neon_supported()) {
     LoadMultipleDFromOffset(dtmp, 2, src,
-        Float64x2::value_offset() - kHeapObjectTag);
+                            Float64x2::value_offset() - kHeapObjectTag);
     StoreMultipleDToOffset(dtmp, 2, dst,
-        Float64x2::value_offset() - kHeapObjectTag);
+                           Float64x2::value_offset() - kHeapObjectTag);
   } else {
-    LoadFromOffset(kWord, tmp1, src,
+    LoadFromOffset(
+        kWord, tmp1, src,
         (Float64x2::value_offset() + 0 * kWordSize) - kHeapObjectTag);
-    LoadFromOffset(kWord, tmp2, src,
+    LoadFromOffset(
+        kWord, tmp2, src,
         (Float64x2::value_offset() + 1 * kWordSize) - kHeapObjectTag);
     StoreToOffset(kWord, tmp1, dst,
-        (Float64x2::value_offset() + 0 * kWordSize) - kHeapObjectTag);
+                  (Float64x2::value_offset() + 0 * kWordSize) - kHeapObjectTag);
     StoreToOffset(kWord, tmp2, dst,
-        (Float64x2::value_offset() + 1 * kWordSize) - kHeapObjectTag);
+                  (Float64x2::value_offset() + 1 * kWordSize) - kHeapObjectTag);
 
-    LoadFromOffset(kWord, tmp1, src,
+    LoadFromOffset(
+        kWord, tmp1, src,
         (Float64x2::value_offset() + 2 * kWordSize) - kHeapObjectTag);
-    LoadFromOffset(kWord, tmp2, src,
+    LoadFromOffset(
+        kWord, tmp2, src,
         (Float64x2::value_offset() + 3 * kWordSize) - kHeapObjectTag);
     StoreToOffset(kWord, tmp1, dst,
-        (Float64x2::value_offset() + 2 * kWordSize) - kHeapObjectTag);
+                  (Float64x2::value_offset() + 2 * kWordSize) - kHeapObjectTag);
     StoreToOffset(kWord, tmp2, dst,
-        (Float64x2::value_offset() + 3 * kWordSize) - kHeapObjectTag);
+                  (Float64x2::value_offset() + 3 * kWordSize) - kHeapObjectTag);
   }
 }
 
@@ -2933,7 +3021,9 @@
 }
 
 
-void Assembler::AddImmediate(Register rd, Register rn, int32_t value,
+void Assembler::AddImmediate(Register rd,
+                             Register rn,
+                             int32_t value,
                              Condition cond) {
   if (value == 0) {
     if (rd != rn) {
@@ -2965,7 +3055,9 @@
 }
 
 
-void Assembler::AddImmediateSetFlags(Register rd, Register rn, int32_t value,
+void Assembler::AddImmediateSetFlags(Register rd,
+                                     Register rn,
+                                     int32_t value,
                                      Condition cond) {
   Operand o;
   if (Operand::CanHold(value, &o)) {
@@ -2991,8 +3083,10 @@
 }
 
 
-void Assembler::SubImmediateSetFlags(Register rd, Register rn, int32_t value,
-                                    Condition cond) {
+void Assembler::SubImmediateSetFlags(Register rd,
+                                     Register rn,
+                                     int32_t value,
+                                     Condition cond) {
   Operand o;
   if (Operand::CanHold(value, &o)) {
     // Handles value == kMinInt32.
@@ -3017,7 +3111,9 @@
 }
 
 
-void Assembler::AndImmediate(Register rd, Register rs, int32_t imm,
+void Assembler::AndImmediate(Register rd,
+                             Register rs,
+                             int32_t imm,
                              Condition cond) {
   Operand o;
   if (Operand::CanHold(imm, &o)) {
@@ -3051,8 +3147,11 @@
   }
 }
 
-void Assembler::IntegerDivide(Register result, Register left, Register right,
-                              DRegister tmpl, DRegister tmpr) {
+void Assembler::IntegerDivide(Register result,
+                              Register left,
+                              Register right,
+                              DRegister tmpl,
+                              DRegister tmpr) {
   ASSERT(tmpl != tmpr);
   if (TargetCPUFeatures::integer_division_supported()) {
     sdiv(result, left, right);
@@ -3150,8 +3249,9 @@
   // and ensure proper alignment of the stack frame.
   // We need to restore it before restoring registers.
   const intptr_t kPushedFpuRegisterSize =
-      TargetCPUFeatures::vfp_supported() ?
-      kDartVolatileFpuRegCount * kFpuRegisterSize : 0;
+      TargetCPUFeatures::vfp_supported()
+          ? kDartVolatileFpuRegCount * kFpuRegisterSize
+          : 0;
 
   COMPILE_ASSERT(PP < FP);
   COMPILE_ASSERT((kDartVolatileCpuRegs & (1 << PP)) == 0);
@@ -3239,17 +3339,10 @@
 }
 
 
-void Assembler::NoMonomorphicCheckedEntry() {
-  buffer_.Reset();
-  bkpt(0);
-  bkpt(0);
-  bkpt(0);
-  ASSERT(CodeSize() == Instructions::kCheckedEntryOffset);
-}
-
-
 // R0 receiver, R9 guarded cid as Smi
 void Assembler::MonomorphicCheckedEntry() {
+  ASSERT(has_single_entry_point_);
+  has_single_entry_point_ = false;
 #if defined(TESTING) || defined(DEBUG)
   bool saved_use_far_branches = use_far_branches();
   set_use_far_branches(false);
@@ -3257,8 +3350,7 @@
 
   Label miss;
   Bind(&miss);
-  ldr(CODE_REG, Address(THR, Thread::monomorphic_miss_stub_offset()));
-  ldr(IP, FieldAddress(CODE_REG, Code::entry_point_offset()));
+  ldr(IP, Address(THR, Thread::monomorphic_miss_entry_offset()));
   bx(IP);
 
   Comment("MonomorphicCheckedEntry");
@@ -3289,8 +3381,7 @@
 }
 
 
-void Assembler::LoadAllocationStatsAddress(Register dest,
-                                           intptr_t cid) {
+void Assembler::LoadAllocationStatsAddress(Register dest, intptr_t cid) {
   ASSERT(dest != kNoRegister);
   ASSERT(dest != TMP);
   ASSERT(cid > 0);
@@ -3309,9 +3400,10 @@
   ASSERT(stats_addr_reg != kNoRegister);
   ASSERT(stats_addr_reg != TMP);
   ASSERT(cid > 0);
-  const uword count_field_offset = (space == Heap::kNew) ?
-    ClassHeapStats::allocated_since_gc_new_space_offset() :
-    ClassHeapStats::allocated_since_gc_old_space_offset();
+  const uword count_field_offset =
+      (space == Heap::kNew)
+          ? ClassHeapStats::allocated_since_gc_new_space_offset()
+          : ClassHeapStats::allocated_since_gc_old_space_offset();
   const Address& count_address = Address(stats_addr_reg, count_field_offset);
   ldr(TMP, count_address);
   AddImmediate(TMP, 1);
@@ -3324,12 +3416,14 @@
                                                  Heap::Space space) {
   ASSERT(stats_addr_reg != kNoRegister);
   ASSERT(stats_addr_reg != TMP);
-  const uword count_field_offset = (space == Heap::kNew) ?
-    ClassHeapStats::allocated_since_gc_new_space_offset() :
-    ClassHeapStats::allocated_since_gc_old_space_offset();
-  const uword size_field_offset = (space == Heap::kNew) ?
-    ClassHeapStats::allocated_size_since_gc_new_space_offset() :
-    ClassHeapStats::allocated_size_since_gc_old_space_offset();
+  const uword count_field_offset =
+      (space == Heap::kNew)
+          ? ClassHeapStats::allocated_since_gc_new_space_offset()
+          : ClassHeapStats::allocated_since_gc_old_space_offset();
+  const uword size_field_offset =
+      (space == Heap::kNew)
+          ? ClassHeapStats::allocated_size_since_gc_new_space_offset()
+          : ClassHeapStats::allocated_size_since_gc_old_space_offset();
   const Address& count_address = Address(stats_addr_reg, count_field_offset);
   const Address& size_address = Address(stats_addr_reg, size_field_offset);
   ldr(TMP, count_address);
@@ -3355,8 +3449,7 @@
     // If this allocation is traced, program will jump to failure path
     // (i.e. the allocation stub) which will allocate the object and trace the
     // allocation call site.
-    NOT_IN_PRODUCT(
-      MaybeTraceAllocation(cls.id(), temp_reg, failure));
+    NOT_IN_PRODUCT(MaybeTraceAllocation(cls.id(), temp_reg, failure));
     Heap::Space space = Heap::kNew;
     ldr(temp_reg, Address(THR, Thread::heap_offset()));
     ldr(instance_reg, Address(temp_reg, Heap::TopOffset(space)));
@@ -3469,8 +3562,8 @@
                                              Register temp) {
   const int64_t offset_base =
       (is_external ? 0 : (Instance::DataOffsetFor(cid) - kHeapObjectTag));
-  const int64_t offset = offset_base +
-      static_cast<int64_t>(index) * index_scale;
+  const int64_t offset =
+      offset_base + static_cast<int64_t>(index) * index_scale;
   ASSERT(Utils::IsInt(32, offset));
 
   if (Address::CanHoldImmediateOffset(is_load, cid, offset)) {
@@ -3483,6 +3576,22 @@
 }
 
 
+void Assembler::LoadElementAddressForIntIndex(Register address,
+                                              bool is_load,
+                                              bool is_external,
+                                              intptr_t cid,
+                                              intptr_t index_scale,
+                                              Register array,
+                                              intptr_t index) {
+  const int64_t offset_base =
+      (is_external ? 0 : (Instance::DataOffsetFor(cid) - kHeapObjectTag));
+  const int64_t offset =
+      offset_base + static_cast<int64_t>(index) * index_scale;
+  ASSERT(Utils::IsInt(32, offset));
+  AddImmediate(address, array, offset);
+}
+
+
 Address Assembler::ElementAddressForRegIndex(bool is_load,
                                              bool is_external,
                                              intptr_t cid,
@@ -3497,8 +3606,8 @@
   ASSERT(array != IP);
   ASSERT(index != IP);
   const Register base = is_load ? IP : index;
-  if ((offset != 0) ||
-      (size == kSWord) || (size == kDWord) || (size == kRegList)) {
+  if ((offset != 0) || (size == kSWord) || (size == kDWord) ||
+      (size == kRegList)) {
     if (shift < 0) {
       ASSERT(shift == -1);
       add(base, array, Operand(index, ASR, 1));
@@ -3514,12 +3623,8 @@
     }
   }
   int32_t offset_mask = 0;
-  if ((is_load && !Address::CanHoldLoadOffset(size,
-                                              offset,
-                                              &offset_mask)) ||
-      (!is_load && !Address::CanHoldStoreOffset(size,
-                                                offset,
-                                                &offset_mask))) {
+  if ((is_load && !Address::CanHoldLoadOffset(size, offset, &offset_mask)) ||
+      (!is_load && !Address::CanHoldStoreOffset(size, offset, &offset_mask))) {
     AddImmediate(base, offset & ~offset_mask);
     offset = offset & offset_mask;
   }
@@ -3527,9 +3632,84 @@
 }
 
 
+void Assembler::LoadElementAddressForRegIndex(Register address,
+                                              bool is_load,
+                                              bool is_external,
+                                              intptr_t cid,
+                                              intptr_t index_scale,
+                                              Register array,
+                                              Register index) {
+  // Note that index is expected smi-tagged, (i.e, LSL 1) for all arrays.
+  const intptr_t shift = Utils::ShiftForPowerOfTwo(index_scale) - kSmiTagShift;
+  int32_t offset =
+      is_external ? 0 : (Instance::DataOffsetFor(cid) - kHeapObjectTag);
+  if (shift < 0) {
+    ASSERT(shift == -1);
+    add(address, array, Operand(index, ASR, 1));
+  } else {
+    add(address, array, Operand(index, LSL, shift));
+  }
+  if (offset != 0) {
+    AddImmediate(address, offset);
+  }
+}
+
+
+void Assembler::LoadHalfWordUnaligned(Register dst,
+                                      Register addr,
+                                      Register tmp) {
+  ASSERT(dst != addr);
+  ldrb(dst, Address(addr, 0));
+  ldrsb(tmp, Address(addr, 1));
+  orr(dst, dst, Operand(tmp, LSL, 8));
+}
+
+
+void Assembler::LoadHalfWordUnsignedUnaligned(Register dst,
+                                              Register addr,
+                                              Register tmp) {
+  ASSERT(dst != addr);
+  ldrb(dst, Address(addr, 0));
+  ldrb(tmp, Address(addr, 1));
+  orr(dst, dst, Operand(tmp, LSL, 8));
+}
+
+
+void Assembler::StoreHalfWordUnaligned(Register src,
+                                       Register addr,
+                                       Register tmp) {
+  strb(src, Address(addr, 0));
+  Lsr(tmp, src, Operand(8));
+  strb(tmp, Address(addr, 1));
+}
+
+
+void Assembler::LoadWordUnaligned(Register dst, Register addr, Register tmp) {
+  ASSERT(dst != addr);
+  ldrb(dst, Address(addr, 0));
+  ldrb(tmp, Address(addr, 1));
+  orr(dst, dst, Operand(tmp, LSL, 8));
+  ldrb(tmp, Address(addr, 2));
+  orr(dst, dst, Operand(tmp, LSL, 16));
+  ldrb(tmp, Address(addr, 3));
+  orr(dst, dst, Operand(tmp, LSL, 24));
+}
+
+
+void Assembler::StoreWordUnaligned(Register src, Register addr, Register tmp) {
+  strb(src, Address(addr, 0));
+  Lsr(tmp, src, Operand(8));
+  strb(tmp, Address(addr, 1));
+  Lsr(tmp, src, Operand(16));
+  strb(tmp, Address(addr, 2));
+  Lsr(tmp, src, Operand(24));
+  strb(tmp, Address(addr, 3));
+}
+
+
 static const char* cpu_reg_names[kNumberOfCpuRegisters] = {
-  "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
-  "r8", "ctx", "pp", "fp", "ip", "sp", "lr", "pc",
+    "r0", "r1",  "r2", "r3", "r4", "r5", "r6", "r7",
+    "r8", "ctx", "pp", "fp", "ip", "sp", "lr", "pc",
 };
 
 
@@ -3540,9 +3720,9 @@
 
 
 static const char* fpu_reg_names[kNumberOfFpuRegisters] = {
-  "q0", "q1", "q2", "q3", "q4", "q5", "q6", "q7",
+    "q0", "q1", "q2",  "q3",  "q4",  "q5",  "q6",  "q7",
 #if defined(VFPv3_D32)
-  "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15",
+    "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15",
 #endif
 };
 
diff --git a/runtime/vm/assembler_arm.h b/runtime/vm/assembler_arm.h
index 3afce46..049d769 100644
--- a/runtime/vm/assembler_arm.h
+++ b/runtime/vm/assembler_arm.h
@@ -2,10 +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.
 
-#ifndef VM_ASSEMBLER_ARM_H_
-#define VM_ASSEMBLER_ARM_H_
+#ifndef RUNTIME_VM_ASSEMBLER_ARM_H_
+#define RUNTIME_VM_ASSEMBLER_ARM_H_
 
-#ifndef VM_ASSEMBLER_H_
+#ifndef RUNTIME_VM_ASSEMBLER_H_
 #error Do not include assembler_arm.h directly; use assembler.h instead.
 #endif
 
@@ -26,17 +26,17 @@
 
 // Instruction encoding bits.
 enum {
-  H   = 1 << 5,   // halfword (or byte)
-  L   = 1 << 20,  // load (or store)
-  S   = 1 << 20,  // set condition code (or leave unchanged)
-  W   = 1 << 21,  // writeback base register (or leave unchanged)
-  A   = 1 << 21,  // accumulate in multiply instruction (or not)
-  B   = 1 << 22,  // unsigned byte (or word)
-  D   = 1 << 22,  // high/lo bit of start of s/d register range
-  N   = 1 << 22,  // long (or short)
-  U   = 1 << 23,  // positive (or negative) offset/index
-  P   = 1 << 24,  // offset/pre-indexed addressing (or post-indexed addressing)
-  I   = 1 << 25,  // immediate shifter operand (or not)
+  H = 1 << 5,   // halfword (or byte)
+  L = 1 << 20,  // load (or store)
+  S = 1 << 20,  // set condition code (or leave unchanged)
+  W = 1 << 21,  // writeback base register (or leave unchanged)
+  A = 1 << 21,  // accumulate in multiply instruction (or not)
+  B = 1 << 22,  // unsigned byte (or word)
+  D = 1 << 22,  // high/lo bit of start of s/d register range
+  N = 1 << 22,  // long (or short)
+  U = 1 << 23,  // positive (or negative) offset/index
+  P = 1 << 24,  // offset/pre-indexed addressing (or post-indexed addressing)
+  I = 1 << 25,  // immediate shifter operand (or not)
 
   B0 = 1,
   B1 = 1 << 1,
@@ -68,7 +68,7 @@
 
 class Label : public ValueObject {
  public:
-  Label() : position_(0) { }
+  Label() : position_(0) {}
 
   ~Label() {
     // Assert if label is being destroyed with unresolved branches pending.
@@ -89,9 +89,7 @@
  private:
   intptr_t position_;
 
-  void Reinitialize() {
-    position_ = 0;
-  }
+  void Reinitialize() { position_ = 0; }
 
   void BindTo(intptr_t position) {
     ASSERT(!IsBound());
@@ -114,11 +112,11 @@
 class Operand : public ValueObject {
  public:
   // Data-processing operands - Uninitialized.
-  Operand() : type_(-1), encoding_(-1) { }
+  Operand() : type_(-1), encoding_(-1) {}
 
   // Data-processing operands - Copy constructor.
   Operand(const Operand& other)
-      : ValueObject(), type_(other.type_), encoding_(other.encoding_) { }
+      : ValueObject(), type_(other.type_), encoding_(other.encoding_) {}
 
   // Data-processing operands - Assignment operator.
   Operand& operator=(const Operand& other) {
@@ -173,7 +171,7 @@
     }
     // Note that immediate must be unsigned for the test to work correctly.
     for (int rot = 0; rot < 16; rot++) {
-      uint32_t imm8 = (immediate << 2*rot) | (immediate >> (32 - 2*rot));
+      uint32_t imm8 = (immediate << 2 * rot) | (immediate >> (32 - 2 * rot));
       if (imm8 < (1 << kImmed8Bits)) {
         o->type_ = 1;
         o->encoding_ = (rot << kRotateShift) | (imm8 << kImmed8Shift);
@@ -221,14 +219,14 @@
 // Load/store multiple addressing mode.
 enum BlockAddressMode {
   // bit encoding P U W
-  DA           = (0|0|0) << 21,  // decrement after
-  IA           = (0|4|0) << 21,  // increment after
-  DB           = (8|0|0) << 21,  // decrement before
-  IB           = (8|4|0) << 21,  // increment before
-  DA_W         = (0|0|1) << 21,  // decrement after with writeback to base
-  IA_W         = (0|4|1) << 21,  // increment after with writeback to base
-  DB_W         = (8|0|1) << 21,  // decrement before with writeback to base
-  IB_W         = (8|4|1) << 21   // increment before with writeback to base
+  DA = (0 | 0 | 0) << 21,    // decrement after
+  IA = (0 | 4 | 0) << 21,    // increment after
+  DB = (8 | 0 | 0) << 21,    // decrement before
+  IB = (8 | 4 | 0) << 21,    // increment before
+  DA_W = (0 | 0 | 1) << 21,  // decrement after with writeback to base
+  IA_W = (0 | 4 | 1) << 21,  // increment after with writeback to base
+  DB_W = (8 | 0 | 1) << 21,  // decrement before with writeback to base
+  IB_W = (8 | 4 | 1) << 21   // increment before with writeback to base
 };
 
 
@@ -242,19 +240,18 @@
 
   // Memory operand addressing mode
   enum Mode {
-    kModeMask    = (8|4|1) << 21,
+    kModeMask = (8 | 4 | 1) << 21,
     // bit encoding P U W
-    Offset       = (8|4|0) << 21,  // offset (w/o writeback to base)
-    PreIndex     = (8|4|1) << 21,  // pre-indexed addressing with writeback
-    PostIndex    = (0|4|0) << 21,  // post-indexed addressing with writeback
-    NegOffset    = (8|0|0) << 21,  // negative offset (w/o writeback to base)
-    NegPreIndex  = (8|0|1) << 21,  // negative pre-indexed with writeback
-    NegPostIndex = (0|0|0) << 21   // negative post-indexed with writeback
+    Offset = (8 | 4 | 0) << 21,       // offset (w/o writeback to base)
+    PreIndex = (8 | 4 | 1) << 21,     // pre-indexed addressing with writeback
+    PostIndex = (0 | 4 | 0) << 21,    // post-indexed addressing with writeback
+    NegOffset = (8 | 0 | 0) << 21,    // negative offset (w/o writeback to base)
+    NegPreIndex = (8 | 0 | 1) << 21,  // negative pre-indexed with writeback
+    NegPostIndex = (0 | 0 | 0) << 21  // negative post-indexed with writeback
   };
 
   Address(const Address& other)
-      : ValueObject(), encoding_(other.encoding_), kind_(other.kind_) {
-  }
+      : ValueObject(), encoding_(other.encoding_), kind_(other.kind_) {}
 
   Address& operator=(const Address& other) {
     encoding_ = other.encoding_;
@@ -281,8 +278,11 @@
   // shifted register case below should be used.
   Address(Register rn, Register r, Mode am);
 
-  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) {
     Operand o(rm, shift, shift_imm);
 
     if ((shift == LSL) && (shift_imm == 0)) {
@@ -314,9 +314,9 @@
   }
 
   Register rm() const {
-    return ((kind() == IndexRegister) || (kind() == ScaledIndexRegister)) ?
-        Instr::At(reinterpret_cast<uword>(&encoding_))->RmField() :
-        kNoRegister;
+    return ((kind() == IndexRegister) || (kind() == ScaledIndexRegister))
+               ? Instr::At(reinterpret_cast<uword>(&encoding_))->RmField()
+               : kNoRegister;
   }
 
   Mode mode() const { return static_cast<Mode>(encoding() & kModeMask); }
@@ -347,12 +347,12 @@
 class FieldAddress : public Address {
  public:
   FieldAddress(Register base, int32_t disp)
-      : Address(base, disp - kHeapObjectTag) { }
+      : Address(base, disp - kHeapObjectTag) {}
 
   // This addressing mode does not exist.
   FieldAddress(Register base, Register r);
 
-  FieldAddress(const FieldAddress& other) : Address(other) { }
+  FieldAddress(const FieldAddress& other) : Address(other) {}
 
   FieldAddress& operator=(const FieldAddress& other) {
     Address::operator=(other);
@@ -366,13 +366,12 @@
   explicit Assembler(bool use_far_branches = false)
       : buffer_(),
         prologue_offset_(-1),
+        has_single_entry_point_(true),
         use_far_branches_(use_far_branches),
         comments_(),
-        constant_pool_allowed_(false) {
-    MonomorphicCheckedEntry();
-  }
+        constant_pool_allowed_(false) {}
 
-  ~Assembler() { }
+  ~Assembler() {}
 
   void PopRegister(Register r) { Pop(r); }
 
@@ -382,6 +381,7 @@
   // Misc. functionality
   intptr_t CodeSize() const { return buffer_.Size(); }
   intptr_t prologue_offset() const { return prologue_offset_; }
+  bool has_single_entry_point() const { return has_single_entry_point_; }
 
   // Count the fixups that produce a pointer offset, without processing
   // the fixups.  On ARM there are no pointers in code.
@@ -405,9 +405,7 @@
 #if defined(TESTING) || defined(DEBUG)
   // Used in unit tests and to ensure predictable verification code size in
   // FlowGraphCompiler::EmitEdgeCounter.
-  void set_use_far_branches(bool b) {
-    use_far_branches_ = b;
-  }
+  void set_use_far_branches(bool b) { use_far_branches_ = b; }
 #endif  // TESTING || DEBUG
 
   void FinalizeInstructions(const MemoryRegion& region) {
@@ -482,17 +480,35 @@
   // Multiply instructions.
   void mul(Register rd, Register rn, Register rm, Condition cond = AL);
   void muls(Register rd, Register rn, Register rm, Condition cond = AL);
-  void mla(Register rd, Register rn, Register rm, Register ra,
+  void mla(Register rd,
+           Register rn,
+           Register rm,
+           Register ra,
            Condition cond = AL);
-  void mls(Register rd, Register rn, Register rm, Register ra,
+  void mls(Register rd,
+           Register rn,
+           Register rm,
+           Register ra,
            Condition cond = AL);
-  void smull(Register rd_lo, Register rd_hi, Register rn, Register rm,
+  void smull(Register rd_lo,
+             Register rd_hi,
+             Register rn,
+             Register rm,
              Condition cond = AL);
-  void umull(Register rd_lo, Register rd_hi, Register rn, Register rm,
+  void umull(Register rd_lo,
+             Register rd_hi,
+             Register rn,
+             Register rm,
              Condition cond = AL);
-  void smlal(Register rd_lo, Register rd_hi, Register rn, Register rm,
+  void smlal(Register rd_lo,
+             Register rd_hi,
+             Register rn,
+             Register rm,
              Condition cond = AL);
-  void umlal(Register rd_lo, Register rd_hi, Register rn, Register rm,
+  void umlal(Register rd_lo,
+             Register rd_hi,
+             Register rn,
+             Register rm,
              Condition cond = AL);
 
   // Emulation of this instruction uses IP and the condition codes. Therefore,
@@ -521,15 +537,25 @@
   // we don't use them, and we need to split them up into two instructions for
   // ARMv5TE, so we only support the base + offset mode.
   // rd must be an even register and rd2 must be rd + 1.
-  void ldrd(Register rd, Register rd2, Register rn, int32_t offset,
+  void ldrd(Register rd,
+            Register rd2,
+            Register rn,
+            int32_t offset,
             Condition cond = AL);
-  void strd(Register rd, Register rd2, Register rn, int32_t offset,
+  void strd(Register rd,
+            Register rd2,
+            Register rn,
+            int32_t offset,
             Condition cond = AL);
 
-  void ldm(BlockAddressMode am, Register base,
-           RegList regs, Condition cond = AL);
-  void stm(BlockAddressMode am, Register base,
-           RegList regs, Condition cond = AL);
+  void ldm(BlockAddressMode am,
+           Register base,
+           RegList regs,
+           Condition cond = AL);
+  void stm(BlockAddressMode am,
+           Register base,
+           RegList regs,
+           Condition cond = AL);
 
   void ldrex(Register rd, Register rn, Condition cond = AL);
   void strex(Register rd, Register rt, Register rn, Condition cond = AL);
@@ -543,13 +569,11 @@
 
   static int32_t BkptEncoding(uint16_t imm16) {
     // bkpt requires that the cond field is AL.
-    return (AL << kConditionShift) | B24 | B21 |
-           ((imm16 >> 4) << 8) | B6 | B5 | B4 | (imm16 & 0xf);
+    return (AL << kConditionShift) | B24 | B21 | ((imm16 >> 4) << 8) | B6 | B5 |
+           B4 | (imm16 & 0xf);
   }
 
-  static uword GetBreakInstructionFiller() {
-    return BkptEncoding(0);
-  }
+  static uword GetBreakInstructionFiller() { return BkptEncoding(0); }
 
   // Floating point instructions (VFPv3-D16 and VFPv3-D32 profiles).
   void vmovsr(SRegister sn, Register rt, Condition cond = AL);
@@ -572,15 +596,27 @@
   void vldrd(DRegister dd, Address ad, Condition cond = AL);
   void vstrd(DRegister dd, Address ad, Condition cond = AL);
 
-  void vldms(BlockAddressMode am, Register base,
-             SRegister first, SRegister last, Condition cond = AL);
-  void vstms(BlockAddressMode am, Register base,
-             SRegister first, SRegister last, Condition cond = AL);
+  void vldms(BlockAddressMode am,
+             Register base,
+             SRegister first,
+             SRegister last,
+             Condition cond = AL);
+  void vstms(BlockAddressMode am,
+             Register base,
+             SRegister first,
+             SRegister last,
+             Condition cond = AL);
 
-  void vldmd(BlockAddressMode am, Register base,
-             DRegister first, intptr_t count, Condition cond = AL);
-  void vstmd(BlockAddressMode am, Register base,
-             DRegister first, intptr_t count, Condition cond = AL);
+  void vldmd(BlockAddressMode am,
+             Register base,
+             DRegister first,
+             intptr_t count,
+             Condition cond = AL);
+  void vstmd(BlockAddressMode am,
+             Register base,
+             DRegister first,
+             intptr_t count,
+             Condition cond = AL);
 
   void vadds(SRegister sd, SRegister sn, SRegister sm, Condition cond = AL);
   void vaddd(DRegister dd, DRegister dn, DRegister dm, Condition cond = AL);
@@ -693,11 +729,17 @@
 
   // Add signed immediate value to rd. May clobber IP.
   void AddImmediate(Register rd, int32_t value, Condition cond = AL);
-  void AddImmediate(Register rd, Register rn, int32_t value,
+  void AddImmediate(Register rd,
+                    Register rn,
+                    int32_t value,
                     Condition cond = AL);
-  void AddImmediateSetFlags(Register rd, Register rn, int32_t value,
+  void AddImmediateSetFlags(Register rd,
+                            Register rn,
+                            int32_t value,
                             Condition cond = AL);
-  void SubImmediateSetFlags(Register rd, Register rn, int32_t value,
+  void SubImmediateSetFlags(Register rd,
+                            Register rn,
+                            int32_t value,
                             Condition cond = AL);
   void AndImmediate(Register rd, Register rs, int32_t imm, Condition cond = AL);
 
@@ -712,8 +754,11 @@
   // division is supported. If not, uses the FPU for division with
   // temporary registers tmpl and tmpr. tmpl and tmpr must be different
   // registers.
-  void IntegerDivide(Register result, Register left, Register right,
-                     DRegister tmpl, DRegister tmpr);
+  void IntegerDivide(Register result,
+                     Register left,
+                     Register right,
+                     DRegister tmpl,
+                     DRegister tmpr);
 
   // Load and Store.
   // These three do not clobber IP.
@@ -722,8 +767,10 @@
   void LoadImmediate(Register rd, int32_t value, Condition cond = AL);
   // These two may clobber IP.
   void LoadSImmediate(SRegister sd, float value, Condition cond = AL);
-  void LoadDImmediate(DRegister dd, double value,
-                      Register scratch, Condition cond = AL);
+  void LoadDImmediate(DRegister dd,
+                      double value,
+                      Register scratch,
+                      Condition cond = AL);
 
   void MarkExceptionHandler(Label* label);
 
@@ -746,9 +793,9 @@
   void PushObject(const Object& object);
   void CompareObject(Register rn, const Object& object);
 
-  void StoreIntoObject(Register object,  // Object we are storing into.
+  void StoreIntoObject(Register object,      // Object we are storing into.
                        const Address& dest,  // Where we are storing into.
-                       Register value,  // Value we are storing.
+                       Register value,       // Value we are storing.
                        bool can_value_be_smi = true);
   void StoreIntoObjectOffset(Register object,
                              int32_t offset,
@@ -841,12 +888,21 @@
                               Register base,
                               int32_t offset);
 
-  void CopyDoubleField(Register dst, Register src,
-                       Register tmp1, Register tmp2, DRegister dtmp);
-  void CopyFloat32x4Field(Register dst, Register src,
-                          Register tmp1, Register tmp2, DRegister dtmp);
-  void CopyFloat64x2Field(Register dst, Register src,
-                          Register tmp1, Register tmp2, DRegister dtmp);
+  void CopyDoubleField(Register dst,
+                       Register src,
+                       Register tmp1,
+                       Register tmp2,
+                       DRegister dtmp);
+  void CopyFloat32x4Field(Register dst,
+                          Register src,
+                          Register tmp1,
+                          Register tmp2,
+                          DRegister dtmp);
+  void CopyFloat64x2Field(Register dst,
+                          Register src,
+                          Register tmp1,
+                          Register tmp2,
+                          DRegister dtmp);
 
   void Push(Register rd, Condition cond = AL);
   void Pop(Register rd, Condition cond = AL);
@@ -858,18 +914,28 @@
 
   // Convenience shift instructions. Use mov instruction with shifter operand
   // for variants setting the status flags.
-  void Lsl(Register rd, Register rm, const Operand& shift_imm,
+  void Lsl(Register rd,
+           Register rm,
+           const Operand& shift_imm,
            Condition cond = AL);
   void Lsl(Register rd, Register rm, Register rs, Condition cond = AL);
-  void Lsr(Register rd, Register rm, const Operand& shift_imm,
+  void Lsr(Register rd,
+           Register rm,
+           const Operand& shift_imm,
            Condition cond = AL);
   void Lsr(Register rd, Register rm, Register rs, Condition cond = AL);
-  void Asr(Register rd, Register rm, const Operand& shift_imm,
+  void Asr(Register rd,
+           Register rm,
+           const Operand& shift_imm,
            Condition cond = AL);
   void Asr(Register rd, Register rm, Register rs, Condition cond = AL);
-  void Asrs(Register rd, Register rm, const Operand& shift_imm,
+  void Asrs(Register rd,
+            Register rm,
+            const Operand& shift_imm,
             Condition cond = AL);
-  void Ror(Register rd, Register rm, const Operand& shift_imm,
+  void Ror(Register rd,
+           Register rm,
+           const Operand& shift_imm,
            Condition cond = AL);
   void Ror(Register rd, Register rm, Register rs, Condition cond = AL);
   void Rrx(Register rd, Register rm, Condition cond = AL);
@@ -946,7 +1012,6 @@
   void EnterStubFrame();
   void LeaveStubFrame();
 
-  void NoMonomorphicCheckedEntry();
   void MonomorphicCheckedEntry();
 
   // The register into which the allocation stats table is loaded with
@@ -954,8 +1019,7 @@
   // IncrementAllocationStats(WithSize) as stats_addr_reg to update the
   // allocation stats. These are separate assembler macros so we can
   // avoid a dependent load too nearby the load of the table address.
-  void LoadAllocationStatsAddress(Register dest,
-                                  intptr_t cid);
+  void LoadAllocationStatsAddress(Register dest, intptr_t cid);
   void IncrementAllocationStats(Register stats_addr,
                                 intptr_t cid,
                                 Heap::Space space);
@@ -971,6 +1035,14 @@
                                     intptr_t index,
                                     Register temp);
 
+  void LoadElementAddressForIntIndex(Register address,
+                                     bool is_load,
+                                     bool is_external,
+                                     intptr_t cid,
+                                     intptr_t index_scale,
+                                     Register array,
+                                     intptr_t index);
+
   Address ElementAddressForRegIndex(bool is_load,
                                     bool is_external,
                                     intptr_t cid,
@@ -978,11 +1050,23 @@
                                     Register array,
                                     Register index);
 
+  void LoadElementAddressForRegIndex(Register address,
+                                     bool is_load,
+                                     bool is_external,
+                                     intptr_t cid,
+                                     intptr_t index_scale,
+                                     Register array,
+                                     Register index);
+
+  void LoadHalfWordUnaligned(Register dst, Register addr, Register tmp);
+  void LoadHalfWordUnsignedUnaligned(Register dst, Register addr, Register tmp);
+  void StoreHalfWordUnaligned(Register src, Register addr, Register tmp);
+  void LoadWordUnaligned(Register dst, Register addr, Register tmp);
+  void StoreWordUnaligned(Register src, Register addr, Register tmp);
+
   // If allocation tracing for |cid| is enabled, will jump to |trace| label,
   // which will allocate in the runtime where tracing occurs.
-  void MaybeTraceAllocation(intptr_t cid,
-                            Register temp_reg,
-                            Label* trace);
+  void MaybeTraceAllocation(intptr_t cid, Register temp_reg, Label* trace);
 
   // Inlined allocation of an instance of class 'cls', code has no runtime
   // calls. Jump to 'failure' if the instance cannot be allocated here.
@@ -1009,19 +1093,14 @@
   static bool IsSafe(const Object& object) { return true; }
   static bool IsSafeSmi(const Object& object) { return object.IsSmi(); }
 
-  bool constant_pool_allowed() const {
-    return constant_pool_allowed_;
-  }
-  void set_constant_pool_allowed(bool b) {
-    constant_pool_allowed_ = b;
-  }
+  bool constant_pool_allowed() const { return constant_pool_allowed_; }
+  void set_constant_pool_allowed(bool b) { constant_pool_allowed_ = b; }
 
  private:
   AssemblerBuffer buffer_;  // Contains position independent code.
   ObjectPoolWrapper object_pool_wrapper_;
-
   int32_t prologue_offset_;
-
+  bool has_single_entry_point_;
   bool use_far_branches_;
 
   // If you are thinking of using one or both of these instructions directly,
@@ -1042,7 +1121,7 @@
   class CodeComment : public ZoneAllocated {
    public:
     CodeComment(intptr_t pc_offset, const String& comment)
-        : pc_offset_(pc_offset), comment_(comment) { }
+        : pc_offset_(pc_offset), comment_(comment) {}
 
     intptr_t pc_offset() const { return pc_offset_; }
     const String& comment() const { return comment_; }
@@ -1074,11 +1153,7 @@
 
   void EmitType5(Condition cond, int32_t offset, bool link);
 
-  void EmitMemOp(Condition cond,
-                 bool load,
-                 bool byte,
-                 Register rd,
-                 Address ad);
+  void EmitMemOp(Condition cond, bool load, bool byte, Register rd, Address ad);
 
   void EmitMemOpAddressMode3(Condition cond,
                              int32_t mode,
@@ -1142,21 +1217,21 @@
                   DRegister dn,
                   DRegister dm);
 
-  void EmitVFPsd(Condition cond,
-                 int32_t opcode,
-                 SRegister sd,
-                 DRegister dm);
+  void EmitVFPsd(Condition cond, int32_t opcode, SRegister sd, DRegister dm);
 
-  void EmitVFPds(Condition cond,
-                 int32_t opcode,
-                 DRegister dd,
-                 SRegister sm);
+  void EmitVFPds(Condition cond, int32_t opcode, DRegister dd, SRegister sm);
 
-  void EmitSIMDqqq(int32_t opcode, OperandSize sz,
-                   QRegister qd, QRegister qn, QRegister qm);
+  void EmitSIMDqqq(int32_t opcode,
+                   OperandSize sz,
+                   QRegister qd,
+                   QRegister qn,
+                   QRegister qm);
 
-  void EmitSIMDddd(int32_t opcode, OperandSize sz,
-                   DRegister dd, DRegister dn, DRegister dm);
+  void EmitSIMDddd(int32_t opcode,
+                   OperandSize sz,
+                   DRegister dd,
+                   DRegister dn,
+                   DRegister dm);
 
   void EmitFarBranch(Condition cond, int32_t offset, bool link);
   void EmitBranch(Condition cond, Label* label, bool link);
@@ -1178,4 +1253,4 @@
 
 }  // namespace dart
 
-#endif  // VM_ASSEMBLER_ARM_H_
+#endif  // RUNTIME_VM_ASSEMBLER_ARM_H_
diff --git a/runtime/vm/assembler_arm64.cc b/runtime/vm/assembler_arm64.cc
index 72278e9..8f3dc14 100644
--- a/runtime/vm/assembler_arm64.cc
+++ b/runtime/vm/assembler_arm64.cc
@@ -24,11 +24,10 @@
 Assembler::Assembler(bool use_far_branches)
     : buffer_(),
       prologue_offset_(-1),
+      has_single_entry_point_(true),
       use_far_branches_(use_far_branches),
       comments_(),
-      constant_pool_allowed_(false) {
-  MonomorphicCheckedEntry();
-}
+      constant_pool_allowed_(false) {}
 
 
 void Assembler::InitializeMemoryWithBreakpoints(uword data, intptr_t length) {
@@ -49,10 +48,9 @@
 
 
 static const char* cpu_reg_names[kNumberOfCpuRegisters] = {
-  "r0",  "r1",  "r2",  "r3",  "r4",  "r5",  "r6",  "r7",
-  "r8",  "r9",  "r10", "r11", "r12", "r13", "r14", "r15",
-  "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
-  "r24", "ip0", "ip1", "pp",  "ctx", "fp",  "lr",  "r31",
+    "r0",  "r1",  "r2",  "r3",  "r4",  "r5",  "r6",  "r7",  "r8",  "r9",  "r10",
+    "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19", "r20", "r21",
+    "r22", "r23", "r24", "ip0", "ip1", "pp",  "ctx", "fp",  "lr",  "r31",
 };
 
 
@@ -63,10 +61,9 @@
 
 
 static const char* fpu_reg_names[kNumberOfFpuRegisters] = {
-  "v0",  "v1",  "v2",  "v3",  "v4",  "v5",  "v6",  "v7",
-  "v8",  "v9",  "v10", "v11", "v12", "v13", "v14", "v15",
-  "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23",
-  "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31",
+    "v0",  "v1",  "v2",  "v3",  "v4",  "v5",  "v6",  "v7",  "v8",  "v9",  "v10",
+    "v11", "v12", "v13", "v14", "v15", "v16", "v17", "v18", "v19", "v20", "v21",
+    "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31",
 };
 
 
@@ -136,14 +133,14 @@
       int32_t encoded_guard_branch =
           EncodeImm19BranchOffset(dest, guard_branch);
       const Condition c = DecodeImm19BranchCondition(encoded_guard_branch);
-      encoded_guard_branch = EncodeImm19BranchCondition(
-          InvertCondition(c), encoded_guard_branch);
+      encoded_guard_branch =
+          EncodeImm19BranchCondition(InvertCondition(c), encoded_guard_branch);
 
       // Write back the re-encoded instructions. The far branch becomes a nop.
-      buffer_.Store<int32_t>(
-          position + 0 * Instr::kInstrSize, encoded_guard_branch);
-      buffer_.Store<int32_t>(
-          position + 1 * Instr::kInstrSize, Instr::kNopInstruction);
+      buffer_.Store<int32_t>(position + 0 * Instr::kInstrSize,
+                             encoded_guard_branch);
+      buffer_.Store<int32_t>(position + 1 * Instr::kInstrSize,
+                             Instr::kNopInstruction);
       label->position_ = next;
     } else {
       const int32_t next = buffer_.Load<int32_t>(position);
@@ -184,7 +181,7 @@
 
 static int CountOneBits(uint64_t value, int width) {
   // Mask out unused bits to ensure that they are not counted.
-  value &= (0xffffffffffffffffUL >> (64-width));
+  value &= (0xffffffffffffffffUL >> (64 - width));
 
   value = ((value >> 1) & 0x5555555555555555) + (value & 0x5555555555555555);
   value = ((value >> 2) & 0x3333333333333333) + (value & 0x3333333333333333);
@@ -382,8 +379,7 @@
 }
 
 
-void Assembler::LoadNativeEntry(Register dst,
-                                const ExternalLabel* label) {
+void Assembler::LoadNativeEntry(Register dst, const ExternalLabel* label) {
   const int32_t offset = ObjectPool::element_offset(
       object_pool_wrapper_.FindNativeEntry(label, kNotPatchable));
   LoadWordFromPoolOffset(dst, offset);
@@ -741,8 +737,10 @@
 }
 
 
-void Assembler::LoadFromOffset(
-    Register dest, Register base, int32_t offset, OperandSize sz) {
+void Assembler::LoadFromOffset(Register dest,
+                               Register base,
+                               int32_t offset,
+                               OperandSize sz) {
   if (Address::CanHoldOffset(offset, Address::Offset, sz)) {
     ldr(dest, Address(base, offset, Address::Offset, sz), sz);
   } else {
@@ -775,8 +773,10 @@
 }
 
 
-void Assembler::StoreToOffset(
-    Register src, Register base, int32_t offset, OperandSize sz) {
+void Assembler::StoreToOffset(Register src,
+                              Register base,
+                              int32_t offset,
+                              OperandSize sz) {
   ASSERT(base != TMP2);
   if (Address::CanHoldOffset(offset, Address::Offset, sz)) {
     str(src, Address(base, offset, Address::Offset, sz), sz);
@@ -832,9 +832,9 @@
   vrsqrtes(vd, vn);
   // 2 Newton-Raphson steps. xn+1 = xn * (3 - V1*xn^2) / 2.
   // First step.
-  vmuls(VTMP, vd, vd);  // VTMP <- xn^2
+  vmuls(VTMP, vd, vd);       // VTMP <- xn^2
   vrsqrtss(VTMP, vn, VTMP);  // VTMP <- (3 - V1*VTMP) / 2.
-  vmuls(vd, vd, VTMP);  // xn+1 <- xn * VTMP
+  vmuls(vd, vd, VTMP);       // xn+1 <- xn * VTMP
   // Second step.
   vmuls(VTMP, vd, vd);
   vrsqrtss(VTMP, vn, VTMP);
@@ -842,7 +842,6 @@
 }
 
 
-
 // Store into object.
 // Preserves object and value registers.
 void Assembler::StoreIntoObjectFilterNoSmi(Register object,
@@ -880,8 +879,8 @@
                                       Register value,
                                       bool can_value_be_smi) {
   if (Address::CanHoldOffset(offset - kHeapObjectTag)) {
-    StoreIntoObject(
-        object, FieldAddress(object, offset), value, can_value_be_smi);
+    StoreIntoObject(object, FieldAddress(object, offset), value,
+                    can_value_be_smi);
   } else {
     AddImmediate(TMP, object, offset - kHeapObjectTag);
     StoreIntoObject(object, Address(TMP), value, can_value_be_smi);
@@ -976,8 +975,8 @@
 void Assembler::LoadClassId(Register result, Register object) {
   ASSERT(RawObject::kClassIdTagPos == kBitsPerInt32);
   ASSERT(RawObject::kClassIdTagSize == kBitsPerInt32);
-  const intptr_t class_id_offset = Object::tags_offset() +
-      RawObject::kClassIdTagPos / kBitsPerByte;
+  const intptr_t class_id_offset =
+      Object::tags_offset() + RawObject::kClassIdTagPos / kBitsPerByte;
   LoadFromOffset(result, object, class_id_offset - kHeapObjectTag,
                  kUnsignedWord);
 }
@@ -1238,29 +1237,17 @@
 }
 
 
-void Assembler::NoMonomorphicCheckedEntry() {
-  buffer_.Reset();
-  brk(0);
-  brk(0);
-  brk(0);
-  brk(0);
-  brk(0);
-  brk(0);
-  ASSERT(CodeSize() == Instructions::kCheckedEntryOffset);
-}
-
-
 // R0 receiver, R5 guarded cid as Smi
 void Assembler::MonomorphicCheckedEntry() {
+  ASSERT(has_single_entry_point_);
+  has_single_entry_point_ = false;
   bool saved_use_far_branches = use_far_branches();
   set_use_far_branches(false);
 
   Label immediate, have_cid, miss;
   Bind(&miss);
-  ldr(CODE_REG, Address(THR, Thread::monomorphic_miss_stub_offset()));
-  ldr(IP0, FieldAddress(CODE_REG, Code::entry_point_offset()));
+  ldr(IP0, Address(THR, Thread::monomorphic_miss_entry_offset()));
   br(IP0);
-  brk(0);
 
   Bind(&immediate);
   movz(R4, Immediate(kSmiCid), 0);
@@ -1302,8 +1289,7 @@
 }
 
 
-void Assembler::UpdateAllocationStats(intptr_t cid,
-                                      Heap::Space space) {
+void Assembler::UpdateAllocationStats(intptr_t cid, Heap::Space space) {
   ASSERT(cid > 0);
   intptr_t counter_offset =
       ClassTable::CounterOffsetFor(cid, space == Heap::kNew);
@@ -1323,12 +1309,14 @@
                                               Heap::Space space) {
   ASSERT(cid > 0);
   const uword class_offset = ClassTable::ClassOffsetFor(cid);
-  const uword count_field_offset = (space == Heap::kNew) ?
-    ClassHeapStats::allocated_since_gc_new_space_offset() :
-    ClassHeapStats::allocated_since_gc_old_space_offset();
-  const uword size_field_offset = (space == Heap::kNew) ?
-    ClassHeapStats::allocated_size_since_gc_new_space_offset() :
-    ClassHeapStats::allocated_size_since_gc_old_space_offset();
+  const uword count_field_offset =
+      (space == Heap::kNew)
+          ? ClassHeapStats::allocated_since_gc_new_space_offset()
+          : ClassHeapStats::allocated_since_gc_old_space_offset();
+  const uword size_field_offset =
+      (space == Heap::kNew)
+          ? ClassHeapStats::allocated_size_since_gc_new_space_offset()
+          : ClassHeapStats::allocated_size_since_gc_old_space_offset();
   LoadIsolate(TMP2);
   intptr_t table_offset =
       Isolate::class_table_offset() + ClassTable::TableOffsetFor(cid);
@@ -1372,8 +1360,7 @@
     str(instance_reg, Address(temp_reg, Heap::TopOffset(space)));
 
     ASSERT(instance_size >= kHeapObjectTag);
-    AddImmediate(
-        instance_reg, instance_reg, -instance_size + kHeapObjectTag);
+    AddImmediate(instance_reg, instance_reg, -instance_size + kHeapObjectTag);
     NOT_IN_PRODUCT(UpdateAllocationStats(cls.id(), space));
 
     uword tags = 0;
@@ -1439,7 +1426,8 @@
                                              intptr_t index_scale,
                                              Register array,
                                              intptr_t index) const {
-  const int64_t offset = index * index_scale +
+  const int64_t offset =
+      index * index_scale +
       (is_external ? 0 : (Instance::DataOffsetFor(cid) - kHeapObjectTag));
   ASSERT(Utils::IsInt(32, offset));
   const OperandSize size = Address::OperandSizeFor(cid);
@@ -1448,6 +1436,19 @@
 }
 
 
+void Assembler::LoadElementAddressForIntIndex(Register address,
+                                              bool is_external,
+                                              intptr_t cid,
+                                              intptr_t index_scale,
+                                              Register array,
+                                              intptr_t index) {
+  const int64_t offset =
+      index * index_scale +
+      (is_external ? 0 : (Instance::DataOffsetFor(cid) - kHeapObjectTag));
+  AddImmediate(address, array, offset);
+}
+
+
 Address Assembler::ElementAddressForRegIndex(bool is_load,
                                              bool is_external,
                                              intptr_t cid,
@@ -1474,6 +1475,106 @@
   return Address(base, offset, Address::Offset, size);
 }
 
+
+void Assembler::LoadElementAddressForRegIndex(Register address,
+                                              bool is_load,
+                                              bool is_external,
+                                              intptr_t cid,
+                                              intptr_t index_scale,
+                                              Register array,
+                                              Register index) {
+  // Note that index is expected smi-tagged, (i.e, LSL 1) for all arrays.
+  const intptr_t shift = Utils::ShiftForPowerOfTwo(index_scale) - kSmiTagShift;
+  const int32_t offset =
+      is_external ? 0 : (Instance::DataOffsetFor(cid) - kHeapObjectTag);
+  if (shift == 0) {
+    add(address, array, Operand(index));
+  } else if (shift < 0) {
+    ASSERT(shift == -1);
+    add(address, array, Operand(index, ASR, 1));
+  } else {
+    add(address, array, Operand(index, LSL, shift));
+  }
+  if (offset != 0) {
+    AddImmediate(address, address, offset);
+  }
+}
+
+
+void Assembler::LoadUnaligned(Register dst,
+                              Register addr,
+                              Register tmp,
+                              OperandSize sz) {
+  ASSERT(dst != addr);
+  ldr(dst, Address(addr, 0), kUnsignedByte);
+  if (sz == kHalfword) {
+    ldr(tmp, Address(addr, 1), kByte);
+    orr(dst, dst, Operand(tmp, LSL, 8));
+    return;
+  }
+  ldr(tmp, Address(addr, 1), kUnsignedByte);
+  orr(dst, dst, Operand(tmp, LSL, 8));
+  if (sz == kUnsignedHalfword) {
+    return;
+  }
+  ldr(tmp, Address(addr, 2), kUnsignedByte);
+  orr(dst, dst, Operand(tmp, LSL, 16));
+  if (sz == kWord) {
+    ldr(tmp, Address(addr, 3), kByte);
+    orr(dst, dst, Operand(tmp, LSL, 24));
+    return;
+  }
+  ldr(tmp, Address(addr, 3), kUnsignedByte);
+  orr(dst, dst, Operand(tmp, LSL, 24));
+  if (sz == kUnsignedWord) {
+    return;
+  }
+  ldr(tmp, Address(addr, 4), kUnsignedByte);
+  orr(dst, dst, Operand(tmp, LSL, 32));
+  ldr(tmp, Address(addr, 5), kUnsignedByte);
+  orr(dst, dst, Operand(tmp, LSL, 40));
+  ldr(tmp, Address(addr, 6), kUnsignedByte);
+  orr(dst, dst, Operand(tmp, LSL, 48));
+  ldr(tmp, Address(addr, 7), kUnsignedByte);
+  orr(dst, dst, Operand(tmp, LSL, 56));
+  if (sz == kDoubleWord) {
+    return;
+  }
+  UNIMPLEMENTED();
+}
+
+
+void Assembler::StoreUnaligned(Register src,
+                               Register addr,
+                               Register tmp,
+                               OperandSize sz) {
+  str(src, Address(addr, 0), kUnsignedByte);
+  LsrImmediate(tmp, src, 8);
+  str(tmp, Address(addr, 1), kUnsignedByte);
+  if ((sz == kHalfword) || (sz == kUnsignedHalfword)) {
+    return;
+  }
+  LsrImmediate(tmp, src, 16);
+  str(tmp, Address(addr, 2), kUnsignedByte);
+  LsrImmediate(tmp, src, 24);
+  str(tmp, Address(addr, 3), kUnsignedByte);
+  if ((sz == kWord) || (sz == kUnsignedWord)) {
+    return;
+  }
+  LsrImmediate(tmp, src, 24);
+  str(tmp, Address(addr, 4), kUnsignedByte);
+  LsrImmediate(tmp, src, 32);
+  str(tmp, Address(addr, 5), kUnsignedByte);
+  LsrImmediate(tmp, src, 40);
+  str(tmp, Address(addr, 6), kUnsignedByte);
+  LsrImmediate(tmp, src, 48);
+  str(tmp, Address(addr, 7), kUnsignedByte);
+  if (sz == kDoubleWord) {
+    return;
+  }
+  UNIMPLEMENTED();
+}
+
 }  // namespace dart
 
 #endif  // defined TARGET_ARCH_ARM64
diff --git a/runtime/vm/assembler_arm64.h b/runtime/vm/assembler_arm64.h
index 1f8edfa..f87f76d 100644
--- a/runtime/vm/assembler_arm64.h
+++ b/runtime/vm/assembler_arm64.h
@@ -2,10 +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.
 
-#ifndef VM_ASSEMBLER_ARM64_H_
-#define VM_ASSEMBLER_ARM64_H_
+#ifndef RUNTIME_VM_ASSEMBLER_ARM64_H_
+#define RUNTIME_VM_ASSEMBLER_ARM64_H_
 
-#ifndef VM_ASSEMBLER_H_
+#ifndef RUNTIME_VM_ASSEMBLER_H_
 #error Do not include assembler_arm64.h directly; use assembler.h instead.
 #endif
 
@@ -25,9 +25,9 @@
 
 class Immediate : public ValueObject {
  public:
-  explicit Immediate(int64_t value) : value_(value) { }
+  explicit Immediate(int64_t value) : value_(value) {}
 
-  Immediate(const Immediate& other) : ValueObject(), value_(other.value_) { }
+  Immediate(const Immediate& other) : ValueObject(), value_(other.value_) {}
   Immediate& operator=(const Immediate& other) {
     value_ = other.value_;
     return *this;
@@ -44,7 +44,7 @@
 
 class Label : public ValueObject {
  public:
-  Label() : position_(0) { }
+  Label() : position_(0) {}
 
   ~Label() {
     // Assert if label is being destroyed with unresolved branches pending.
@@ -65,9 +65,7 @@
  private:
   intptr_t position_;
 
-  void Reinitialize() {
-    position_ = 0;
-  }
+  void Reinitialize() { position_ = 0; }
 
   void BindTo(intptr_t position) {
     ASSERT(!IsBound());
@@ -92,8 +90,7 @@
       : ValueObject(),
         encoding_(other.encoding_),
         type_(other.type_),
-        base_(other.base_) {
-  }
+        base_(other.base_) {}
 
   Address& operator=(const Address& other) {
     encoding_ = other.encoding_;
@@ -118,31 +115,26 @@
   // operand size, and assert that offset is aligned accordingly.
   // For the smaller signed imm9 case, the offset is the number of bytes, but
   // is unscaled.
-  Address(Register rn, int32_t offset = 0, AddressType at = Offset,
+  Address(Register rn,
+          int32_t offset = 0,
+          AddressType at = Offset,
           OperandSize sz = kDoubleWord) {
     ASSERT((rn != kNoRegister) && (rn != R31) && (rn != ZR));
     ASSERT(CanHoldOffset(offset, at, sz));
     const Register crn = ConcreteRegister(rn);
     const int32_t scale = Log2OperandSizeBytes(sz);
-    if ((at == Offset) &&
-         Utils::IsUint(12 + scale, offset) &&
+    if ((at == Offset) && Utils::IsUint(12 + scale, offset) &&
         (offset == ((offset >> scale) << scale))) {
-      encoding_ =
-          B24 |
-          ((offset >> scale) << kImm12Shift) |
-          (static_cast<int32_t>(crn) << kRnShift);
-    } else if ((at == Offset) &&
-               Utils::IsInt(9, offset)) {
-      encoding_ =
-          ((offset & 0x1ff) << kImm9Shift) |
-          (static_cast<int32_t>(crn) << kRnShift);
+      encoding_ = B24 | ((offset >> scale) << kImm12Shift) |
+                  (static_cast<int32_t>(crn) << kRnShift);
+    } else if ((at == Offset) && Utils::IsInt(9, offset)) {
+      encoding_ = ((offset & 0x1ff) << kImm9Shift) |
+                  (static_cast<int32_t>(crn) << kRnShift);
     } else if ((at == PreIndex) || (at == PostIndex)) {
       ASSERT(Utils::IsInt(9, offset));
       int32_t idx = (at == PostIndex) ? B10 : (B11 | B10);
-      encoding_ =
-          idx |
-          ((offset & 0x1ff) << kImm9Shift) |
-          (static_cast<int32_t>(crn) << kRnShift);
+      encoding_ = idx | ((offset & 0x1ff) << kImm9Shift) |
+                  (static_cast<int32_t>(crn) << kRnShift);
     } else {
       ASSERT((at == PairOffset) || (at == PairPreIndex) ||
              (at == PairPostIndex));
@@ -150,25 +142,34 @@
              (offset == ((offset >> scale) << scale)));
       int32_t idx = 0;
       switch (at) {
-        case PairPostIndex: idx = B23; break;
-        case PairPreIndex: idx = B24 | B23; break;
-        case PairOffset: idx = B24; break;
-        default: UNREACHABLE(); break;
+        case PairPostIndex:
+          idx = B23;
+          break;
+        case PairPreIndex:
+          idx = B24 | B23;
+          break;
+        case PairOffset:
+          idx = B24;
+          break;
+        default:
+          UNREACHABLE();
+          break;
       }
-      encoding_ =
-        idx |
-        (((offset >> scale) << kImm7Shift) & kImm7Mask) |
-        (static_cast<int32_t>(crn) << kRnShift);
+      encoding_ = idx | (((offset >> scale) << kImm7Shift) & kImm7Mask) |
+                  (static_cast<int32_t>(crn) << kRnShift);
     }
     type_ = at;
     base_ = crn;
   }
 
   // This addressing mode does not exist.
-  Address(Register rn, Register offset, AddressType at,
+  Address(Register rn,
+          Register offset,
+          AddressType at,
           OperandSize sz = kDoubleWord);
 
-  static bool CanHoldOffset(int32_t offset, AddressType at = Offset,
+  static bool CanHoldOffset(int32_t offset,
+                            AddressType at = Offset,
                             OperandSize sz = kDoubleWord) {
     if (at == Offset) {
       // Offset fits in 12 bit unsigned and has right alignment for sz,
@@ -178,8 +179,7 @@
               (offset == ((offset >> scale) << scale))) ||
              (Utils::IsInt(9, offset));
     } else if (at == PCOffset) {
-      return Utils::IsInt(21, offset) &&
-             (offset == ((offset >> 2) << 2));
+      return Utils::IsInt(21, offset) && (offset == ((offset >> 2) << 2));
     } else if ((at == PreIndex) || (at == PostIndex)) {
       return Utils::IsInt(9, offset);
     } else {
@@ -219,8 +219,10 @@
   // Base register rn with offset rm. rm is sign-extended according to ext.
   // If ext is UXTX, rm may be optionally scaled by the
   // Log2OperandSize (specified by the instruction).
-  Address(Register rn, Register rm,
-          Extend ext = UXTX, Scaling scale = Unscaled) {
+  Address(Register rn,
+          Register rm,
+          Extend ext = UXTX,
+          Scaling scale = Unscaled) {
     ASSERT((rn != R31) && (rn != ZR));
     ASSERT((rm != R31) && (rm != CSP));
     // Can only scale when ext = UXTX.
@@ -229,11 +231,9 @@
     const Register crn = ConcreteRegister(rn);
     const Register crm = ConcreteRegister(rm);
     const int32_t s = (scale == Scaled) ? B12 : 0;
-    encoding_ =
-        B21 | B11 | s |
-        (static_cast<int32_t>(crn) << kRnShift) |
-        (static_cast<int32_t>(crm) << kRmShift) |
-        (static_cast<int32_t>(ext) << kExtendTypeShift);
+    encoding_ = B21 | B11 | s | (static_cast<int32_t>(crn) << kRnShift) |
+                (static_cast<int32_t>(crm) << kRmShift) |
+                (static_cast<int32_t>(ext) << kExtendTypeShift);
     type_ = Reg;
     base_ = crn;
   }
@@ -303,12 +303,12 @@
 class FieldAddress : public Address {
  public:
   FieldAddress(Register base, int32_t disp, OperandSize sz = kDoubleWord)
-      : Address(base, disp - kHeapObjectTag, Offset, sz) { }
+      : Address(base, disp - kHeapObjectTag, Offset, sz) {}
 
   // This addressing mode does not exist.
   FieldAddress(Register base, Register disp, OperandSize sz = kDoubleWord);
 
-  FieldAddress(const FieldAddress& other) : Address(other) { }
+  FieldAddress(const FieldAddress& other) : Address(other) {}
 
   FieldAddress& operator=(const FieldAddress& other) {
     Address::operator=(other);
@@ -328,11 +328,11 @@
   };
 
   // Data-processing operand - Uninitialized.
-  Operand() : encoding_(-1), type_(Unknown) { }
+  Operand() : encoding_(-1), type_(Unknown) {}
 
   // Data-processing operands - Copy constructor.
   Operand(const Operand& other)
-      : ValueObject(), encoding_(other.encoding_), type_(other.type_) { }
+      : ValueObject(), encoding_(other.encoding_), type_(other.type_) {}
 
   Operand& operator=(const Operand& other) {
     type_ = other.type_;
@@ -351,10 +351,8 @@
     ASSERT(Utils::IsUint(6, imm));
     ASSERT((rm != R31) && (rm != CSP));
     const Register crm = ConcreteRegister(rm);
-    encoding_ =
-        (imm << kImm6Shift) |
-        (static_cast<int32_t>(crm) << kRmShift) |
-        (static_cast<int32_t>(shift) << kShiftTypeShift);
+    encoding_ = (imm << kImm6Shift) | (static_cast<int32_t>(crm) << kRmShift) |
+                (static_cast<int32_t>(shift) << kShiftTypeShift);
     type_ = Shifted;
   }
 
@@ -365,11 +363,9 @@
     ASSERT(Utils::IsUint(3, imm));
     ASSERT((rm != R31) && (rm != CSP));
     const Register crm = ConcreteRegister(rm);
-    encoding_ =
-        B21 |
-        (static_cast<int32_t>(crm) << kRmShift) |
-        (static_cast<int32_t>(extend) << kExtendTypeShift) |
-        ((imm & 0x7) << kImm3Shift);
+    encoding_ = B21 | (static_cast<int32_t>(crm) << kRmShift) |
+                (static_cast<int32_t>(extend) << kExtendTypeShift) |
+                ((imm & 0x7) << kImm3Shift);
     type_ = Extended;
   }
 
@@ -395,10 +391,9 @@
     ASSERT((n == 1) || (n == 0));
     ASSERT(Utils::IsUint(6, imm_s) && Utils::IsUint(6, imm_r));
     type_ = BitfieldImm;
-    encoding_ =
-      (static_cast<int32_t>(n) << kNShift) |
-      (static_cast<int32_t>(imm_s) << kImmSShift) |
-      (static_cast<int32_t>(imm_r) << kImmRShift);
+    encoding_ = (static_cast<int32_t>(n) << kNShift) |
+                (static_cast<int32_t>(imm_s) << kImmSShift) |
+                (static_cast<int32_t>(imm_r) << kImmRShift);
   }
 
   // Test if a given value can be encoded in the immediate field of a logical
@@ -434,12 +429,8 @@
   }
 
  private:
-  uint32_t encoding() const {
-    return encoding_;
-  }
-  OperandType type() const {
-    return type_;
-  }
+  uint32_t encoding() const { return encoding_; }
+  OperandType type() const { return type_; }
 
   uint32_t encoding_;
   OperandType type_;
@@ -451,11 +442,9 @@
 class Assembler : public ValueObject {
  public:
   explicit Assembler(bool use_far_branches = false);
-  ~Assembler() { }
+  ~Assembler() {}
 
-  void PopRegister(Register r) {
-    Pop(r);
-  }
+  void PopRegister(Register r) { Pop(r); }
 
   void Drop(intptr_t stack_elements) {
     add(SP, SP, Operand(stack_elements * kWordSize));
@@ -467,6 +456,7 @@
   // Misc. functionality
   intptr_t CodeSize() const { return buffer_.Size(); }
   intptr_t prologue_offset() const { return prologue_offset_; }
+  bool has_single_entry_point() const { return has_single_entry_point_; }
 
   // Count the fixups that produce a pointer offset, without processing
   // the fixups.  On ARM64 there are no pointers in code.
@@ -487,9 +477,7 @@
     return FLAG_use_far_branches || use_far_branches_;
   }
 
-  void set_use_far_branches(bool b) {
-    use_far_branches_ = b;
-  }
+  void set_use_far_branches(bool b) { use_far_branches_ = b; }
 
   void FinalizeInstructions(const MemoryRegion& region) {
     buffer_.FinalizeInstructions(region);
@@ -591,9 +579,7 @@
   }
 
   // PC relative immediate add. imm is in bytes.
-  void adr(Register rd, const Immediate& imm) {
-    EmitPCRelOp(ADR, rd, imm);
-  }
+  void adr(Register rd, const Immediate& imm) { EmitPCRelOp(ADR, rd, imm); }
 
   // Logical immediate operations.
   void andi(Register rd, Register rn, const Immediate& imm) {
@@ -799,13 +785,9 @@
   // rn cmp o.
   // For add and sub, to use CSP for rn, o must be of type Operand::Extend.
   // For an unmodified rm in this case, use Operand(rm, UXTX, 0);
-  void cmp(Register rn, Operand o) {
-    subs(ZR, rn, o);
-  }
+  void cmp(Register rn, Operand o) { subs(ZR, rn, o); }
   // rn cmp -o.
-  void cmn(Register rn, Operand o) {
-    adds(ZR, rn, o);
-  }
+  void cmn(Register rn, Operand o) { adds(ZR, rn, o); }
 
   void CompareRegisters(Register rn, Register rm) {
     if (rn == CSP) {
@@ -822,12 +804,8 @@
     EmitConditionalBranch(BCOND, cond, label);
   }
 
-  void b(int32_t offset) {
-    EmitUnconditionalBranchOp(B, offset);
-  }
-  void bl(int32_t offset) {
-    EmitUnconditionalBranchOp(BL, offset);
-  }
+  void b(int32_t offset) { EmitUnconditionalBranchOp(B, offset); }
+  void bl(int32_t offset) { EmitUnconditionalBranchOp(BL, offset); }
 
   void cbz(Label* label, Register rt, OperandSize sz = kDoubleWord) {
     EmitCompareAndBranch(CBZ, rt, label, sz);
@@ -838,20 +816,12 @@
   }
 
   // Branch, link, return.
-  void br(Register rn) {
-    EmitUnconditionalBranchRegOp(BR, rn);
-  }
-  void blr(Register rn) {
-    EmitUnconditionalBranchRegOp(BLR, rn);
-  }
-  void ret(Register rn = R30) {
-    EmitUnconditionalBranchRegOp(RET, rn);
-  }
+  void br(Register rn) { EmitUnconditionalBranchRegOp(BR, rn); }
+  void blr(Register rn) { EmitUnconditionalBranchRegOp(BLR, rn); }
+  void ret(Register rn = R30) { EmitUnconditionalBranchRegOp(RET, rn); }
 
   // Breakpoint.
-  void brk(uint16_t imm) {
-    EmitExceptionGenOp(BRK, imm);
-  }
+  void brk(uint16_t imm) { EmitExceptionGenOp(BRK, imm); }
 
   static uword GetBreakInstructionFiller() {
     const intptr_t encoding = ExceptionGenOpEncoding(BRK, 0);
@@ -903,24 +873,12 @@
     const Register crd = ConcreteRegister(rd);
     EmitFPIntCvtOp(FCVTZDS, crd, static_cast<Register>(vn));
   }
-  void fmovdd(VRegister vd, VRegister vn) {
-    EmitFPOneSourceOp(FMOVDD, vd, vn);
-  }
-  void fabsd(VRegister vd, VRegister vn) {
-    EmitFPOneSourceOp(FABSD, vd, vn);
-  }
-  void fnegd(VRegister vd, VRegister vn) {
-    EmitFPOneSourceOp(FNEGD, vd, vn);
-  }
-  void fsqrtd(VRegister vd, VRegister vn) {
-    EmitFPOneSourceOp(FSQRTD, vd, vn);
-  }
-  void fcvtsd(VRegister vd, VRegister vn) {
-    EmitFPOneSourceOp(FCVTSD, vd, vn);
-  }
-  void fcvtds(VRegister vd, VRegister vn) {
-    EmitFPOneSourceOp(FCVTDS, vd, vn);
-  }
+  void fmovdd(VRegister vd, VRegister vn) { EmitFPOneSourceOp(FMOVDD, vd, vn); }
+  void fabsd(VRegister vd, VRegister vn) { EmitFPOneSourceOp(FABSD, vd, vn); }
+  void fnegd(VRegister vd, VRegister vn) { EmitFPOneSourceOp(FNEGD, vd, vn); }
+  void fsqrtd(VRegister vd, VRegister vn) { EmitFPOneSourceOp(FSQRTD, vd, vn); }
+  void fcvtsd(VRegister vd, VRegister vn) { EmitFPOneSourceOp(FCVTSD, vd, vn); }
+  void fcvtds(VRegister vd, VRegister vn) { EmitFPOneSourceOp(FCVTDS, vd, vn); }
   void fldrq(VRegister vt, Address a) {
     ASSERT(a.type() != Address::PCOffset);
     EmitLoadStoreReg(FLDRQ, static_cast<Register>(vt), a, kByte);
@@ -945,12 +903,8 @@
     ASSERT(a.type() != Address::PCOffset);
     EmitLoadStoreReg(FSTR, static_cast<Register>(vt), a, kSWord);
   }
-  void fcmpd(VRegister vn, VRegister vm) {
-    EmitFPCompareOp(FCMPD, vn, vm);
-  }
-  void fcmpdz(VRegister vn) {
-    EmitFPCompareOp(FCMPZD, vn, V0);
-  }
+  void fcmpd(VRegister vn, VRegister vm) { EmitFPCompareOp(FCMPD, vn, vm); }
+  void fcmpdz(VRegister vn) { EmitFPCompareOp(FCMPZD, vn, V0); }
   void fmuld(VRegister vd, VRegister vn, VRegister vm) {
     EmitFPTwoSourceOp(FMULD, vd, vn, vm);
   }
@@ -1046,27 +1000,13 @@
   void vrsqrtss(VRegister vd, VRegister vn, VRegister vm) {
     EmitSIMDThreeSameOp(VRSQRTSS, vd, vn, vm);
   }
-  void vnot(VRegister vd, VRegister vn) {
-    EmitSIMDTwoRegOp(VNOT, vd, vn);
-  }
-  void vabss(VRegister vd, VRegister vn) {
-    EmitSIMDTwoRegOp(VABSS, vd, vn);
-  }
-  void vabsd(VRegister vd, VRegister vn) {
-    EmitSIMDTwoRegOp(VABSD, vd, vn);
-  }
-  void vnegs(VRegister vd, VRegister vn) {
-    EmitSIMDTwoRegOp(VNEGS, vd, vn);
-  }
-  void vnegd(VRegister vd, VRegister vn) {
-    EmitSIMDTwoRegOp(VNEGD, vd, vn);
-  }
-  void vsqrts(VRegister vd, VRegister vn) {
-    EmitSIMDTwoRegOp(VSQRTS, vd, vn);
-  }
-  void vsqrtd(VRegister vd, VRegister vn) {
-    EmitSIMDTwoRegOp(VSQRTD, vd, vn);
-  }
+  void vnot(VRegister vd, VRegister vn) { EmitSIMDTwoRegOp(VNOT, vd, vn); }
+  void vabss(VRegister vd, VRegister vn) { EmitSIMDTwoRegOp(VABSS, vd, vn); }
+  void vabsd(VRegister vd, VRegister vn) { EmitSIMDTwoRegOp(VABSD, vd, vn); }
+  void vnegs(VRegister vd, VRegister vn) { EmitSIMDTwoRegOp(VNEGS, vd, vn); }
+  void vnegd(VRegister vd, VRegister vn) { EmitSIMDTwoRegOp(VNEGD, vd, vn); }
+  void vsqrts(VRegister vd, VRegister vn) { EmitSIMDTwoRegOp(VSQRTS, vd, vn); }
+  void vsqrtd(VRegister vd, VRegister vn) { EmitSIMDTwoRegOp(VSQRTD, vd, vn); }
   void vrecpes(VRegister vd, VRegister vn) {
     EmitSIMDTwoRegOp(VRECPES, vd, vn);
   }
@@ -1118,21 +1058,11 @@
       orr(rd, ZR, Operand(rn));
     }
   }
-  void vmov(VRegister vd, VRegister vn) {
-    vorr(vd, vn, vn);
-  }
-  void mvn(Register rd, Register rm) {
-    orn(rd, ZR, Operand(rm));
-  }
-  void neg(Register rd, Register rm) {
-    sub(rd, ZR, Operand(rm));
-  }
-  void negs(Register rd, Register rm) {
-    subs(rd, ZR, Operand(rm));
-  }
-  void mul(Register rd, Register rn, Register rm) {
-    madd(rd, rn, rm, ZR);
-  }
+  void vmov(VRegister vd, VRegister vn) { vorr(vd, vn, vn); }
+  void mvn(Register rd, Register rm) { orn(rd, ZR, Operand(rm)); }
+  void neg(Register rd, Register rm) { sub(rd, ZR, Operand(rm)); }
+  void negs(Register rd, Register rm) { subs(rd, ZR, Operand(rm)); }
+  void mul(Register rd, Register rn, Register rm) { madd(rd, rn, rm, ZR); }
   void Push(Register reg) {
     ASSERT(reg != PP);  // Only push PP with TagAndPushPP().
     str(reg, Address(SP, -1 * kWordSize, Address::PreIndex));
@@ -1176,8 +1106,7 @@
     COMPILE_ASSERT(CODE_REG != TMP2);
     // Add the heap object tag back to PP before putting it on the stack.
     add(TMP2, PP, Operand(kHeapObjectTag));
-    stp(TMP2, CODE_REG,
-        Address(SP, -2 * kWordSize, Address::PairPreIndex));
+    stp(TMP2, CODE_REG, Address(SP, -2 * kWordSize, Address::PairPreIndex));
   }
   void PopAndUntagPP() {
     ldr(PP, Address(SP, 1 * kWordSize, Address::PostIndex));
@@ -1185,12 +1114,8 @@
     // The caller of PopAndUntagPP() must explicitly allow use of popped PP.
     set_constant_pool_allowed(false);
   }
-  void tst(Register rn, Operand o) {
-    ands(ZR, rn, o);
-  }
-  void tsti(Register rn, const Immediate& imm) {
-    andis(ZR, rn, imm);
-  }
+  void tst(Register rn, Operand o) { ands(ZR, rn, o); }
+  void tsti(Register rn, const Immediate& imm) { andis(ZR, rn, imm); }
 
   void LslImmediate(Register rd, Register rn, int shift) {
     add(rd, ZR, Operand(rn, LSL, shift));
@@ -1205,15 +1130,11 @@
   void VRecps(VRegister vd, VRegister vn);
   void VRSqrts(VRegister vd, VRegister vn);
 
-  void SmiUntag(Register reg) {
-    AsrImmediate(reg, reg, kSmiTagSize);
-  }
+  void SmiUntag(Register reg) { AsrImmediate(reg, reg, kSmiTagSize); }
   void SmiUntag(Register dst, Register src) {
     AsrImmediate(dst, src, kSmiTagSize);
   }
-  void SmiTag(Register reg) {
-    LslImmediate(reg, reg, kSmiTagSize);
-  }
+  void SmiTag(Register reg) { LslImmediate(reg, reg, kSmiTagSize); }
   void SmiTag(Register dst, Register src) {
     LslImmediate(dst, src, kSmiTagSize);
   }
@@ -1252,9 +1173,13 @@
   void TestImmediate(Register rn, int64_t imm);
   void CompareImmediate(Register rn, int64_t imm);
 
-  void LoadFromOffset(Register dest, Register base, int32_t offset,
+  void LoadFromOffset(Register dest,
+                      Register base,
+                      int32_t offset,
                       OperandSize sz = kDoubleWord);
-  void LoadFieldFromOffset(Register dest, Register base, int32_t offset,
+  void LoadFieldFromOffset(Register dest,
+                           Register base,
+                           int32_t offset,
                            OperandSize sz = kDoubleWord) {
     LoadFromOffset(dest, base, offset - kHeapObjectTag, sz);
   }
@@ -1267,9 +1192,13 @@
     LoadQFromOffset(dest, base, offset - kHeapObjectTag);
   }
 
-  void StoreToOffset(Register src, Register base, int32_t offset,
+  void StoreToOffset(Register src,
+                     Register base,
+                     int32_t offset,
                      OperandSize sz = kDoubleWord);
-  void StoreFieldToOffset(Register src, Register base, int32_t offset,
+  void StoreFieldToOffset(Register src,
+                          Register base,
+                          int32_t offset,
                           OperandSize sz = kDoubleWord) {
     StoreToOffset(src, base, offset - kHeapObjectTag, sz);
   }
@@ -1307,12 +1236,8 @@
   // Object pool, loading from pool, etc.
   void LoadPoolPointer(Register pp = PP);
 
-  bool constant_pool_allowed() const {
-    return constant_pool_allowed_;
-  }
-  void set_constant_pool_allowed(bool b) {
-    constant_pool_allowed_ = b;
-  }
+  bool constant_pool_allowed() const { return constant_pool_allowed_; }
+  void set_constant_pool_allowed(bool b) { constant_pool_allowed_ = b; }
 
   intptr_t FindImmediate(int64_t imm);
   bool CanLoadFromObjectPool(const Object& object) const;
@@ -1363,11 +1288,9 @@
   void EnterStubFrame();
   void LeaveStubFrame();
 
-  void NoMonomorphicCheckedEntry();
   void MonomorphicCheckedEntry();
 
-  void UpdateAllocationStats(intptr_t cid,
-                             Heap::Space space);
+  void UpdateAllocationStats(intptr_t cid, Heap::Space space);
 
   void UpdateAllocationStatsWithSize(intptr_t cid,
                                      Register size_reg,
@@ -1375,9 +1298,7 @@
 
   // If allocation tracing for |cid| is enabled, will jump to |trace| label,
   // which will allocate in the runtime where tracing occurs.
-  void MaybeTraceAllocation(intptr_t cid,
-                            Register temp_reg,
-                            Label* trace);
+  void MaybeTraceAllocation(intptr_t cid, Register temp_reg, Label* trace);
 
   // Inlined allocation of an instance of class 'cls', code has no runtime
   // calls. Jump to 'failure' if the instance cannot be allocated here.
@@ -1401,26 +1322,43 @@
                                     intptr_t index_scale,
                                     Register array,
                                     intptr_t index) const;
+  void LoadElementAddressForIntIndex(Register address,
+                                     bool is_external,
+                                     intptr_t cid,
+                                     intptr_t index_scale,
+                                     Register array,
+                                     intptr_t index);
   Address ElementAddressForRegIndex(bool is_load,
                                     bool is_external,
                                     intptr_t cid,
                                     intptr_t index_scale,
                                     Register array,
                                     Register index);
+  void LoadElementAddressForRegIndex(Register address,
+                                     bool is_load,
+                                     bool is_external,
+                                     intptr_t cid,
+                                     intptr_t index_scale,
+                                     Register array,
+                                     Register index);
+
+  void LoadUnaligned(Register dst, Register addr, Register tmp, OperandSize sz);
+  void StoreUnaligned(Register src,
+                      Register addr,
+                      Register tmp,
+                      OperandSize sz);
 
  private:
   AssemblerBuffer buffer_;  // Contains position independent code.
-
   ObjectPoolWrapper object_pool_wrapper_;
-
   int32_t prologue_offset_;
-
+  bool has_single_entry_point_;
   bool use_far_branches_;
 
   class CodeComment : public ZoneAllocated {
    public:
     CodeComment(intptr_t pc_offset, const String& comment)
-        : pc_offset_(pc_offset), comment_(comment) { }
+        : pc_offset_(pc_offset), comment_(comment) {}
 
     intptr_t pc_offset() const { return pc_offset_; }
     const String& comment() const { return comment_; }
@@ -1441,8 +1379,12 @@
 
   void LoadObjectHelper(Register dst, const Object& obj, bool is_unique);
 
-  void AddSubHelper(OperandSize os, bool set_flags, bool subtract,
-                    Register rd, Register rn, Operand o) {
+  void AddSubHelper(OperandSize os,
+                    bool set_flags,
+                    bool subtract,
+                    Register rd,
+                    Register rn,
+                    Operand o) {
     ASSERT((rd != R31) && (rn != R31));
     const Register crd = ConcreteRegister(rd);
     const Register crn = ConcreteRegister(rn);
@@ -1459,8 +1401,12 @@
     }
   }
 
-  void AddSubWithCarryHelper(OperandSize sz, bool set_flags, bool subtract,
-                             Register rd, Register rn, Register rm) {
+  void AddSubWithCarryHelper(OperandSize sz,
+                             bool set_flags,
+                             bool subtract,
+                             Register rd,
+                             Register rn,
+                             Register rm) {
     ASSERT((rd != R31) && (rn != R31) && (rm != R31));
     ASSERT((rd != CSP) && (rn != CSP) && (rm != CSP));
     const Register crd = ConcreteRegister(rd);
@@ -1469,48 +1415,53 @@
     const int32_t size = (sz == kDoubleWord) ? B31 : 0;
     const int32_t s = set_flags ? B29 : 0;
     const int32_t op = subtract ? SBC : ADC;
-    const int32_t encoding =
-        op | size | s |
-        (static_cast<int32_t>(crd) << kRdShift) |
-        (static_cast<int32_t>(crn) << kRnShift) |
-        (static_cast<int32_t>(crm) << kRmShift);
+    const int32_t encoding = op | size | s |
+                             (static_cast<int32_t>(crd) << kRdShift) |
+                             (static_cast<int32_t>(crn) << kRnShift) |
+                             (static_cast<int32_t>(crm) << kRmShift);
     Emit(encoding);
   }
 
-  void EmitAddSubImmOp(AddSubImmOp op, Register rd, Register rn,
-                       Operand o, OperandSize sz, bool set_flags) {
+  void EmitAddSubImmOp(AddSubImmOp op,
+                       Register rd,
+                       Register rn,
+                       Operand o,
+                       OperandSize sz,
+                       bool set_flags) {
     ASSERT((sz == kDoubleWord) || (sz == kWord) || (sz == kUnsignedWord));
     const int32_t size = (sz == kDoubleWord) ? B31 : 0;
     const int32_t s = set_flags ? B29 : 0;
     const int32_t encoding =
-        op | size | s |
-        (static_cast<int32_t>(rd) << kRdShift) |
-        (static_cast<int32_t>(rn) << kRnShift) |
-        o.encoding();
+        op | size | s | (static_cast<int32_t>(rd) << kRdShift) |
+        (static_cast<int32_t>(rn) << kRnShift) | o.encoding();
     Emit(encoding);
   }
 
-  void EmitLogicalImmOp(LogicalImmOp op, Register rd, Register rn,
-                        Operand o, OperandSize sz) {
+  void EmitLogicalImmOp(LogicalImmOp op,
+                        Register rd,
+                        Register rn,
+                        Operand o,
+                        OperandSize sz) {
     ASSERT((sz == kDoubleWord) || (sz == kWord) || (sz == kUnsignedWord));
     ASSERT((rd != R31) && (rn != R31));
     ASSERT(rn != CSP);
-    ASSERT((op == ANDIS) || (rd != ZR));  // op != ANDIS => rd != ZR.
+    ASSERT((op == ANDIS) || (rd != ZR));   // op != ANDIS => rd != ZR.
     ASSERT((op != ANDIS) || (rd != CSP));  // op == ANDIS => rd != CSP.
     ASSERT(o.type() == Operand::BitfieldImm);
     const int32_t size = (sz == kDoubleWord) ? B31 : 0;
     const Register crd = ConcreteRegister(rd);
     const Register crn = ConcreteRegister(rn);
     const int32_t encoding =
-        op | size |
-        (static_cast<int32_t>(crd) << kRdShift) |
-        (static_cast<int32_t>(crn) << kRnShift) |
-        o.encoding();
+        op | size | (static_cast<int32_t>(crd) << kRdShift) |
+        (static_cast<int32_t>(crn) << kRnShift) | o.encoding();
     Emit(encoding);
   }
 
   void EmitLogicalShiftOp(LogicalShiftOp op,
-                          Register rd, Register rn, Operand o, OperandSize sz) {
+                          Register rd,
+                          Register rn,
+                          Operand o,
+                          OperandSize sz) {
     ASSERT((sz == kDoubleWord) || (sz == kWord) || (sz == kUnsignedWord));
     ASSERT((rd != R31) && (rn != R31));
     ASSERT((rd != CSP) && (rn != CSP));
@@ -1519,32 +1470,31 @@
     const Register crd = ConcreteRegister(rd);
     const Register crn = ConcreteRegister(rn);
     const int32_t encoding =
-        op | size |
-        (static_cast<int32_t>(crd) << kRdShift) |
-        (static_cast<int32_t>(crn) << kRnShift) |
-        o.encoding();
+        op | size | (static_cast<int32_t>(crd) << kRdShift) |
+        (static_cast<int32_t>(crn) << kRnShift) | o.encoding();
     Emit(encoding);
   }
 
   void EmitAddSubShiftExtOp(AddSubShiftExtOp op,
-                            Register rd, Register rn, Operand o,
-                            OperandSize sz, bool set_flags) {
+                            Register rd,
+                            Register rn,
+                            Operand o,
+                            OperandSize sz,
+                            bool set_flags) {
     ASSERT((sz == kDoubleWord) || (sz == kWord) || (sz == kUnsignedWord));
     const int32_t size = (sz == kDoubleWord) ? B31 : 0;
     const int32_t s = set_flags ? B29 : 0;
     const int32_t encoding =
-        op | size | s |
-        (static_cast<int32_t>(rd) << kRdShift) |
-        (static_cast<int32_t>(rn) << kRnShift) |
-        o.encoding();
+        op | size | s | (static_cast<int32_t>(rd) << kRdShift) |
+        (static_cast<int32_t>(rn) << kRnShift) | o.encoding();
     Emit(encoding);
   }
 
   int32_t EncodeImm19BranchOffset(int64_t imm, int32_t instr) {
     if (!CanEncodeImm19BranchOffset(imm)) {
       ASSERT(!use_far_branches());
-      Thread::Current()->long_jump_base()->Jump(
-          1, Object::branch_offset_error());
+      Thread::Current()->long_jump_base()->Jump(1,
+                                                Object::branch_offset_error());
     }
     const int32_t imm32 = static_cast<int32_t>(imm);
     const int32_t off = (((imm32 >> 2) << kImm19Shift) & kImm19Mask);
@@ -1594,7 +1544,9 @@
     return static_cast<int64_t>(off);
   }
 
-  void EmitCompareAndBranchOp(CompareAndBranchOp op, Register rt, int64_t imm,
+  void EmitCompareAndBranchOp(CompareAndBranchOp op,
+                              Register rt,
+                              int64_t imm,
                               OperandSize sz) {
     ASSERT((sz == kDoubleWord) || (sz == kWord) || (sz == kUnsignedWord));
     ASSERT(Utils::IsInt(21, imm) && ((imm & 0x3) == 0));
@@ -1603,19 +1555,16 @@
     const int32_t size = (sz == kDoubleWord) ? B31 : 0;
     const int32_t encoded_offset = EncodeImm19BranchOffset(imm, 0);
     const int32_t encoding =
-        op | size |
-        (static_cast<int32_t>(crt) << kRtShift) |
-        encoded_offset;
+        op | size | (static_cast<int32_t>(crt) << kRtShift) | encoded_offset;
     Emit(encoding);
   }
 
-  void EmitConditionalBranchOp(ConditionalBranchOp op, Condition cond,
+  void EmitConditionalBranchOp(ConditionalBranchOp op,
+                               Condition cond,
                                int64_t imm) {
     const int32_t off = EncodeImm19BranchOffset(imm, 0);
     const int32_t encoding =
-        op |
-        (static_cast<int32_t>(cond) << kCondShift) |
-        off;
+        op | (static_cast<int32_t>(cond) << kCondShift) | off;
     Emit(encoding);
   }
 
@@ -1624,7 +1573,8 @@
     return Utils::IsInt(21, offset);
   }
 
-  void EmitConditionalBranch(ConditionalBranchOp op, Condition cond,
+  void EmitConditionalBranch(ConditionalBranchOp op,
+                             Condition cond,
                              Label* label) {
     if (label->IsBound()) {
       const int64_t dest = label->Position() - buffer_.Size();
@@ -1634,8 +1584,8 @@
           // no need for a guard branch.
           b(dest);
         } else {
-          EmitConditionalBranchOp(
-              op, InvertCondition(cond), 2 * Instr::kInstrSize);
+          EmitConditionalBranchOp(op, InvertCondition(cond),
+                                  2 * Instr::kInstrSize);
           b(dest);
         }
       } else {
@@ -1647,8 +1597,8 @@
         // When cond is AL, this guard branch will be rewritten as a nop when
         // the label is bound. We don't write it as a nop initially because it
         // makes the decoding code in Bind simpler.
-        EmitConditionalBranchOp(
-            op, InvertCondition(cond), 2 * Instr::kInstrSize);
+        EmitConditionalBranchOp(op, InvertCondition(cond),
+                                2 * Instr::kInstrSize);
         b(label->position_);
       } else {
         EmitConditionalBranchOp(op, cond, label->position_);
@@ -1657,22 +1607,24 @@
     }
   }
 
-  void EmitCompareAndBranch(CompareAndBranchOp op, Register rt,
-                            Label* label, OperandSize sz) {
+  void EmitCompareAndBranch(CompareAndBranchOp op,
+                            Register rt,
+                            Label* label,
+                            OperandSize sz) {
     if (label->IsBound()) {
       const int64_t dest = label->Position() - buffer_.Size();
       if (use_far_branches() && !CanEncodeImm19BranchOffset(dest)) {
-          EmitCompareAndBranchOp(
-              op == CBZ ? CBNZ : CBZ, rt, 2 * Instr::kInstrSize, sz);
-          b(dest);
+        EmitCompareAndBranchOp(op == CBZ ? CBNZ : CBZ, rt,
+                               2 * Instr::kInstrSize, sz);
+        b(dest);
       } else {
         EmitCompareAndBranchOp(op, rt, dest, sz);
       }
     } else {
       const int64_t position = buffer_.Size();
       if (use_far_branches()) {
-        EmitCompareAndBranchOp(
-            op == CBZ ? CBNZ : CBZ, rt, 2 * Instr::kInstrSize, sz);
+        EmitCompareAndBranchOp(op == CBZ ? CBNZ : CBZ, rt,
+                               2 * Instr::kInstrSize, sz);
         b(label->position_);
       } else {
         EmitCompareAndBranchOp(op, rt, label->position_, sz);
@@ -1696,8 +1648,7 @@
   void EmitUnconditionalBranchRegOp(UnconditionalBranchRegOp op, Register rn) {
     ASSERT((rn != CSP) && (rn != R31));
     const Register crn = ConcreteRegister(rn);
-    const int32_t encoding =
-        op | (static_cast<int32_t>(crn) << kRnShift);
+    const int32_t encoding = op | (static_cast<int32_t>(crn) << kRnShift);
     Emit(encoding);
   }
 
@@ -1709,21 +1660,26 @@
     Emit(ExceptionGenOpEncoding(op, imm));
   }
 
-  void EmitMoveWideOp(MoveWideOp op, Register rd, const Immediate& imm,
-                      int hw_idx, OperandSize sz) {
+  void EmitMoveWideOp(MoveWideOp op,
+                      Register rd,
+                      const Immediate& imm,
+                      int hw_idx,
+                      OperandSize sz) {
     ASSERT((hw_idx >= 0) && (hw_idx <= 3));
     ASSERT((sz == kDoubleWord) || (sz == kWord) || (sz == kUnsignedWord));
     const int32_t size = (sz == kDoubleWord) ? B31 : 0;
     const int32_t encoding =
-        op | size |
-        (static_cast<int32_t>(rd) << kRdShift) |
+        op | size | (static_cast<int32_t>(rd) << kRdShift) |
         (static_cast<int32_t>(hw_idx) << kHWShift) |
         (static_cast<int32_t>(imm.value() & 0xffff) << kImm16Shift);
     Emit(encoding);
   }
 
-  void EmitLoadStoreExclusive(LoadStoreExclusiveOp op, Register rs, Register rn,
-                              Register rt, OperandSize sz = kDoubleWord) {
+  void EmitLoadStoreExclusive(LoadStoreExclusiveOp op,
+                              Register rs,
+                              Register rn,
+                              Register rt,
+                              OperandSize sz = kDoubleWord) {
     ASSERT(sz == kDoubleWord);
     const int32_t size = B31 | B30;
 
@@ -1732,40 +1688,42 @@
     ASSERT((rt != kNoRegister) && (rt != ZR));
 
     const int32_t encoding =
-        op | size |
-        (static_cast<int32_t>(ConcreteRegister(rs)) << kRsShift) |
+        op | size | (static_cast<int32_t>(ConcreteRegister(rs)) << kRsShift) |
         (static_cast<int32_t>(ConcreteRegister(rn)) << kRnShift) |
         (static_cast<int32_t>(ConcreteRegister(rt)) << kRtShift);
 
     Emit(encoding);
   }
 
-  void EmitLoadStoreReg(LoadStoreRegOp op, Register rt, Address a,
+  void EmitLoadStoreReg(LoadStoreRegOp op,
+                        Register rt,
+                        Address a,
                         OperandSize sz) {
     const Register crt = ConcreteRegister(rt);
     const int32_t size = Log2OperandSizeBytes(sz);
-    const int32_t encoding =
-        op | ((size & 0x3) << kSzShift) |
-        (static_cast<int32_t>(crt) << kRtShift) |
-        a.encoding();
+    const int32_t encoding = op | ((size & 0x3) << kSzShift) |
+                             (static_cast<int32_t>(crt) << kRtShift) |
+                             a.encoding();
     Emit(encoding);
   }
 
-  void EmitLoadRegLiteral(LoadRegLiteralOp op, Register rt, Address a,
+  void EmitLoadRegLiteral(LoadRegLiteralOp op,
+                          Register rt,
+                          Address a,
                           OperandSize sz) {
     ASSERT((sz == kDoubleWord) || (sz == kWord) || (sz == kUnsignedWord));
     ASSERT((rt != CSP) && (rt != R31));
     const Register crt = ConcreteRegister(rt);
     const int32_t size = (sz == kDoubleWord) ? B30 : 0;
     const int32_t encoding =
-        op | size |
-        (static_cast<int32_t>(crt) << kRtShift) |
-        a.encoding();
+        op | size | (static_cast<int32_t>(crt) << kRtShift) | a.encoding();
     Emit(encoding);
   }
 
   void EmitLoadStoreRegPair(LoadStoreRegPairOp op,
-                            Register rt, Register rt2, Address a,
+                            Register rt,
+                            Register rt2,
+                            Address a,
                             OperandSize sz) {
     ASSERT((sz == kDoubleWord) || (sz == kWord) || (sz == kUnsignedWord));
     ASSERT((rt != CSP) && (rt != R31));
@@ -1774,16 +1732,22 @@
     const Register crt2 = ConcreteRegister(rt2);
     int32_t opc = 0;
     switch (sz) {
-      case kDoubleWord: opc = B31; break;
-      case kWord: opc = B30; break;
-      case kUnsignedWord: opc = 0; break;
-      default: UNREACHABLE(); break;
+      case kDoubleWord:
+        opc = B31;
+        break;
+      case kWord:
+        opc = B30;
+        break;
+      case kUnsignedWord:
+        opc = 0;
+        break;
+      default:
+        UNREACHABLE();
+        break;
     }
     const int32_t encoding =
-      opc | op |
-      (static_cast<int32_t>(crt) << kRtShift) |
-      (static_cast<int32_t>(crt2) << kRt2Shift) |
-      a.encoding();
+        opc | op | (static_cast<int32_t>(crt) << kRtShift) |
+        (static_cast<int32_t>(crt2) << kRt2Shift) | a.encoding();
     Emit(encoding);
   }
 
@@ -1794,28 +1758,29 @@
     const int32_t loimm = (imm.value() & 0x3) << 29;
     const int32_t hiimm = ((imm.value() >> 2) << kImm19Shift) & kImm19Mask;
     const int32_t encoding =
-        op | loimm | hiimm |
-        (static_cast<int32_t>(crd) << kRdShift);
+        op | loimm | hiimm | (static_cast<int32_t>(crd) << kRdShift);
     Emit(encoding);
   }
 
   void EmitMiscDP1Source(MiscDP1SourceOp op,
-                         Register rd, Register rn,
+                         Register rd,
+                         Register rn,
                          OperandSize sz) {
     ASSERT((rd != CSP) && (rn != CSP));
     ASSERT((sz == kDoubleWord) || (sz == kWord) || (sz == kUnsignedWord));
     const Register crd = ConcreteRegister(rd);
     const Register crn = ConcreteRegister(rn);
     const int32_t size = (sz == kDoubleWord) ? B31 : 0;
-    const int32_t encoding =
-        op | size |
-        (static_cast<int32_t>(crd) << kRdShift) |
-        (static_cast<int32_t>(crn) << kRnShift);
+    const int32_t encoding = op | size |
+                             (static_cast<int32_t>(crd) << kRdShift) |
+                             (static_cast<int32_t>(crn) << kRnShift);
     Emit(encoding);
   }
 
   void EmitMiscDP2Source(MiscDP2SourceOp op,
-                         Register rd, Register rn, Register rm,
+                         Register rd,
+                         Register rn,
+                         Register rm,
                          OperandSize sz) {
     ASSERT((rd != CSP) && (rn != CSP) && (rm != CSP));
     ASSERT((sz == kDoubleWord) || (sz == kWord) || (sz == kUnsignedWord));
@@ -1823,16 +1788,18 @@
     const Register crn = ConcreteRegister(rn);
     const Register crm = ConcreteRegister(rm);
     const int32_t size = (sz == kDoubleWord) ? B31 : 0;
-    const int32_t encoding =
-        op | size |
-        (static_cast<int32_t>(crd) << kRdShift) |
-        (static_cast<int32_t>(crn) << kRnShift) |
-        (static_cast<int32_t>(crm) << kRmShift);
+    const int32_t encoding = op | size |
+                             (static_cast<int32_t>(crd) << kRdShift) |
+                             (static_cast<int32_t>(crn) << kRnShift) |
+                             (static_cast<int32_t>(crm) << kRmShift);
     Emit(encoding);
   }
 
   void EmitMiscDP3Source(MiscDP3SourceOp op,
-                         Register rd, Register rn, Register rm, Register ra,
+                         Register rd,
+                         Register rn,
+                         Register rm,
+                         Register ra,
                          OperandSize sz) {
     ASSERT((rd != CSP) && (rn != CSP) && (rm != CSP) && (ra != CSP));
     ASSERT((sz == kDoubleWord) || (sz == kWord) || (sz == kUnsignedWord));
@@ -1841,108 +1808,101 @@
     const Register crm = ConcreteRegister(rm);
     const Register cra = ConcreteRegister(ra);
     const int32_t size = (sz == kDoubleWord) ? B31 : 0;
-    const int32_t encoding =
-        op | size |
-        (static_cast<int32_t>(crd) << kRdShift) |
-        (static_cast<int32_t>(crn) << kRnShift) |
-        (static_cast<int32_t>(crm) << kRmShift) |
-        (static_cast<int32_t>(cra) << kRaShift);
+    const int32_t encoding = op | size |
+                             (static_cast<int32_t>(crd) << kRdShift) |
+                             (static_cast<int32_t>(crn) << kRnShift) |
+                             (static_cast<int32_t>(crm) << kRmShift) |
+                             (static_cast<int32_t>(cra) << kRaShift);
     Emit(encoding);
   }
 
   void EmitConditionalSelect(ConditionalSelectOp op,
-                             Register rd, Register rn, Register rm,
-                             Condition cond, OperandSize sz) {
+                             Register rd,
+                             Register rn,
+                             Register rm,
+                             Condition cond,
+                             OperandSize sz) {
     ASSERT((rd != CSP) && (rn != CSP) && (rm != CSP));
     ASSERT((sz == kDoubleWord) || (sz == kWord) || (sz == kUnsignedWord));
     const Register crd = ConcreteRegister(rd);
     const Register crn = ConcreteRegister(rn);
     const Register crm = ConcreteRegister(rm);
     const int32_t size = (sz == kDoubleWord) ? B31 : 0;
-    const int32_t encoding =
-        op | size |
-        (static_cast<int32_t>(crd) << kRdShift) |
-        (static_cast<int32_t>(crn) << kRnShift) |
-        (static_cast<int32_t>(crm) << kRmShift) |
-        (static_cast<int32_t>(cond) << kSelCondShift);
+    const int32_t encoding = op | size |
+                             (static_cast<int32_t>(crd) << kRdShift) |
+                             (static_cast<int32_t>(crn) << kRnShift) |
+                             (static_cast<int32_t>(crm) << kRmShift) |
+                             (static_cast<int32_t>(cond) << kSelCondShift);
     Emit(encoding);
   }
 
   void EmitFPImm(FPImmOp op, VRegister vd, uint8_t imm8) {
     const int32_t encoding =
-        op |
-        (static_cast<int32_t>(vd) << kVdShift) |
-        (imm8 << kImm8Shift);
+        op | (static_cast<int32_t>(vd) << kVdShift) | (imm8 << kImm8Shift);
     Emit(encoding);
   }
 
-  void EmitFPIntCvtOp(FPIntCvtOp op, Register rd, Register rn,
+  void EmitFPIntCvtOp(FPIntCvtOp op,
+                      Register rd,
+                      Register rn,
                       OperandSize sz = kDoubleWord) {
     ASSERT((sz == kDoubleWord) || (sz == kWord));
     const int32_t sfield = (sz == kDoubleWord) ? B31 : 0;
-    const int32_t encoding =
-        op |
-        (static_cast<int32_t>(rd) << kRdShift) |
-        (static_cast<int32_t>(rn) << kRnShift) |
-        sfield;
+    const int32_t encoding = op | (static_cast<int32_t>(rd) << kRdShift) |
+                             (static_cast<int32_t>(rn) << kRnShift) | sfield;
     Emit(encoding);
   }
 
   void EmitFPOneSourceOp(FPOneSourceOp op, VRegister vd, VRegister vn) {
-    const int32_t encoding =
-        op |
-        (static_cast<int32_t>(vd) << kVdShift) |
-        (static_cast<int32_t>(vn) << kVnShift);
+    const int32_t encoding = op | (static_cast<int32_t>(vd) << kVdShift) |
+                             (static_cast<int32_t>(vn) << kVnShift);
     Emit(encoding);
   }
 
   void EmitFPTwoSourceOp(FPTwoSourceOp op,
-                         VRegister vd, VRegister vn, VRegister vm) {
-    const int32_t encoding =
-        op |
-        (static_cast<int32_t>(vd) << kVdShift) |
-        (static_cast<int32_t>(vn) << kVnShift) |
-        (static_cast<int32_t>(vm) << kVmShift);
+                         VRegister vd,
+                         VRegister vn,
+                         VRegister vm) {
+    const int32_t encoding = op | (static_cast<int32_t>(vd) << kVdShift) |
+                             (static_cast<int32_t>(vn) << kVnShift) |
+                             (static_cast<int32_t>(vm) << kVmShift);
     Emit(encoding);
   }
 
   void EmitFPCompareOp(FPCompareOp op, VRegister vn, VRegister vm) {
-    const int32_t encoding =
-        op |
-        (static_cast<int32_t>(vn) << kVnShift) |
-        (static_cast<int32_t>(vm) << kVmShift);
+    const int32_t encoding = op | (static_cast<int32_t>(vn) << kVnShift) |
+                             (static_cast<int32_t>(vm) << kVmShift);
     Emit(encoding);
   }
 
   void EmitSIMDThreeSameOp(SIMDThreeSameOp op,
-                           VRegister vd, VRegister vn, VRegister vm) {
-    const int32_t encoding =
-        op |
-        (static_cast<int32_t>(vd) << kVdShift) |
-        (static_cast<int32_t>(vn) << kVnShift) |
-        (static_cast<int32_t>(vm) << kVmShift);
+                           VRegister vd,
+                           VRegister vn,
+                           VRegister vm) {
+    const int32_t encoding = op | (static_cast<int32_t>(vd) << kVdShift) |
+                             (static_cast<int32_t>(vn) << kVnShift) |
+                             (static_cast<int32_t>(vm) << kVmShift);
     Emit(encoding);
   }
 
-  void EmitSIMDCopyOp(SIMDCopyOp op, VRegister vd, VRegister vn, OperandSize sz,
-                      int32_t idx4, int32_t idx5) {
+  void EmitSIMDCopyOp(SIMDCopyOp op,
+                      VRegister vd,
+                      VRegister vn,
+                      OperandSize sz,
+                      int32_t idx4,
+                      int32_t idx5) {
     const int32_t shift = Log2OperandSizeBytes(sz);
     const int32_t imm5 = ((idx5 << (shift + 1)) | (1 << shift)) & 0x1f;
     const int32_t imm4 = (idx4 << shift) & 0xf;
-    const int32_t encoding =
-        op |
-        (imm5 << kImm5Shift) |
-        (imm4 << kImm4Shift) |
-        (static_cast<int32_t>(vd) << kVdShift) |
-        (static_cast<int32_t>(vn) << kVnShift);
+    const int32_t encoding = op | (imm5 << kImm5Shift) | (imm4 << kImm4Shift) |
+                             (static_cast<int32_t>(vd) << kVdShift) |
+                             (static_cast<int32_t>(vn) << kVnShift);
     Emit(encoding);
   }
 
   void EmitSIMDTwoRegOp(SIMDTwoRegOp op, VRegister vd, VRegister vn) {
-    const int32_t encoding =
-        op |
-        (static_cast<int32_t>(vd) << kVdShift) |
-        (static_cast<int32_t>(vn) << kVnShift);
+    const int32_t encoding = op | (static_cast<int32_t>(vd) << kVdShift) |
+                             (static_cast<int32_t>(vn) << kVnShift);
     Emit(encoding);
   }
 
@@ -1959,4 +1919,4 @@
 
 }  // namespace dart
 
-#endif  // VM_ASSEMBLER_ARM64_H_
+#endif  // RUNTIME_VM_ASSEMBLER_ARM64_H_
diff --git a/runtime/vm/assembler_arm64_test.cc b/runtime/vm/assembler_arm64_test.cc
index 3d95b7c..1bd0644 100644
--- a/runtime/vm/assembler_arm64_test.cc
+++ b/runtime/vm/assembler_arm64_test.cc
@@ -137,8 +137,8 @@
 
 ASSEMBLER_TEST_RUN(Movk0, test) {
   typedef int64_t (*Int64Return)() DART_UNUSED;
-  EXPECT_EQ(
-      42LL | (1LL << 48), EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
+  EXPECT_EQ(42LL | (1LL << 48),
+            EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
 }
 
 
@@ -151,8 +151,8 @@
 
 ASSEMBLER_TEST_RUN(Movk1, test) {
   typedef int64_t (*Int64Return)() DART_UNUSED;
-  EXPECT_EQ(
-      (42LL << 16) | 1, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
+  EXPECT_EQ((42LL << 16) | 1,
+            EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
 }
 
 
@@ -165,8 +165,8 @@
 
 ASSEMBLER_TEST_RUN(Movk2, test) {
   typedef int64_t (*Int64Return)() DART_UNUSED;
-  EXPECT_EQ(
-      (42LL << 32) | 1, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
+  EXPECT_EQ((42LL << 32) | 1,
+            EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
 }
 
 
@@ -179,8 +179,8 @@
 
 ASSEMBLER_TEST_RUN(Movk3, test) {
   typedef int64_t (*Int64Return)() DART_UNUSED;
-  EXPECT_EQ(
-      (42LL << 48) | 1, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
+  EXPECT_EQ((42LL << 48) | 1,
+            EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
 }
 
 
@@ -255,7 +255,7 @@
 
 ASSEMBLER_TEST_GENERATE(AddASRNegReg, assembler) {
   __ movz(R0, Immediate(43), 0);
-  __ movn(R1, Immediate(0), 0);  // R1 <- -1
+  __ movn(R1, Immediate(0), 0);         // R1 <- -1
   __ add(R1, ZR, Operand(R1, LSL, 3));  // R1 <- -8
   __ add(R0, R0, Operand(R1, ASR, 3));  // R0 <- 43 + (-8 >> 3)
   __ ret();
@@ -272,7 +272,7 @@
 ASSEMBLER_TEST_GENERATE(AddExtReg, assembler) {
   __ movz(R0, Immediate(43), 0);
   __ movz(R1, Immediate(0xffff), 0);
-  __ movk(R1, Immediate(0xffff), 1);  // R1 <- -1 (32-bit)
+  __ movk(R1, Immediate(0xffff), 1);     // R1 <- -1 (32-bit)
   __ add(R0, R0, Operand(R1, SXTW, 0));  // R0 <- R0 + (sign extended R1)
   __ ret();
 }
@@ -289,8 +289,8 @@
   __ LoadImmediate(R1, 1);
   __ LoadImmediate(R0, 0);
   __ adds(IP0, R2, Operand(R1));  // c_out = 1.
-  __ adcs(IP0, R2, R0);  // c_in = 1, c_out = 1.
-  __ adc(R0, R0, R0);  // c_in = 1.
+  __ adcs(IP0, R2, R0);           // c_in = 1, c_out = 1.
+  __ adc(R0, R0, R0);             // c_in = 1.
   __ ret();
 }
 
@@ -305,8 +305,8 @@
   __ LoadImmediate(R1, 1);
   __ LoadImmediate(R0, 0);
   __ subs(IP0, R0, Operand(R1));  // c_out = 1.
-  __ sbcs(IP0, R0, R0);  // c_in = 1, c_out = 1.
-  __ sbc(R0, R0, R0);  // c_in = 1.
+  __ sbcs(IP0, R0, R0);           // c_in = 1, c_out = 1.
+  __ sbc(R0, R0, R0);             // c_in = 1.
   __ ret();
 }
 
@@ -323,8 +323,8 @@
   __ LoadImmediate(R2, 0xFFFFFFFFFFFFFFFF);
   __ LoadImmediate(R3, 0x7FFFFFFFFFFFFFFF);
   __ adds(IP0, R2, Operand(R1));  // c_out = 1.
-  __ adcs(IP0, R3, R0);  // c_in = 1, c_out = 1, v = 1.
-  __ csinc(R0, R0, R0, VS);  // R0 = v ? R0 : R0 + 1.
+  __ adcs(IP0, R3, R0);           // c_in = 1, c_out = 1, v = 1.
+  __ csinc(R0, R0, R0, VS);       // R0 = v ? R0 : R0 + 1.
   __ ret();
 }
 
@@ -340,8 +340,8 @@
   __ LoadImmediate(R1, 1);
   __ LoadImmediate(R0, 0);
   __ addsw(IP0, R2, Operand(R1));  // c_out = 1.
-  __ adcsw(IP0, R2, R0);  // c_in = 1, c_out = 1.
-  __ adcw(R0, R0, R0);  // c_in = 1.
+  __ adcsw(IP0, R2, R0);           // c_in = 1, c_out = 1.
+  __ adcw(R0, R0, R0);             // c_in = 1.
   __ ret();
 }
 
@@ -356,8 +356,8 @@
   __ LoadImmediate(R1, 1);
   __ LoadImmediate(R0, 0);
   __ subsw(IP0, R0, Operand(R1));  // c_out = 1.
-  __ sbcsw(IP0, R0, R0);  // c_in = 1, c_out = 1.
-  __ sbcw(R0, R0, R0);  // c_in = 1.
+  __ sbcsw(IP0, R0, R0);           // c_in = 1, c_out = 1.
+  __ sbcw(R0, R0, R0);             // c_in = 1.
   __ ret();
 }
 
@@ -374,8 +374,8 @@
   __ LoadImmediate(R2, 0xFFFFFFFF);
   __ LoadImmediate(R3, 0x7FFFFFFF);
   __ addsw(IP0, R2, Operand(R1));  // c_out = 1.
-  __ adcsw(IP0, R3, R0);  // c_in = 1, c_out = 1, v = 1.
-  __ csinc(R0, R0, R0, VS);  // R0 = v ? R0 : R0 + 1.
+  __ adcsw(IP0, R3, R0);           // c_in = 1, c_out = 1, v = 1.
+  __ csinc(R0, R0, R0, VS);        // R0 = v ? R0 : R0 + 1.
   __ ret();
 }
 
@@ -391,8 +391,8 @@
   __ SetupDartSP();
   __ movz(R0, Immediate(43), 0);
   __ movz(R1, Immediate(42), 0);
-  __ str(R1, Address(SP, -1*kWordSize, Address::PreIndex));
-  __ ldr(R0, Address(SP, 1*kWordSize, Address::PostIndex));
+  __ str(R1, Address(SP, -1 * kWordSize, Address::PreIndex));
+  __ ldr(R0, Address(SP, 1 * kWordSize, Address::PostIndex));
   __ RestoreCSP();
   __ ret();
 }
@@ -427,9 +427,9 @@
   __ movz(R0, Immediate(43), 0);
   __ movz(R1, Immediate(42), 0);
   // Largest negative offset that can fit in the signed 9-bit immediate field.
-  __ str(R1, Address(SP, -32*kWordSize, Address::PreIndex));
+  __ str(R1, Address(SP, -32 * kWordSize, Address::PreIndex));
   // Largest positive kWordSize aligned offset that we can fit.
-  __ ldr(R0, Address(SP, 31*kWordSize, Address::PostIndex));
+  __ ldr(R0, Address(SP, 31 * kWordSize, Address::PostIndex));
   // Correction.
   __ add(SP, SP, Operand(kWordSize));  // Restore SP.
   __ RestoreCSP();
@@ -447,9 +447,9 @@
   __ SetupDartSP();
   __ movz(R0, Immediate(43), 0);
   __ movz(R1, Immediate(42), 0);
-  __ sub(SP, SP, Operand(512*kWordSize));
-  __ str(R1, Address(SP, 512*kWordSize, Address::Offset));
-  __ add(SP, SP, Operand(512*kWordSize));
+  __ sub(SP, SP, Operand(512 * kWordSize));
+  __ str(R1, Address(SP, 512 * kWordSize, Address::Offset));
+  __ add(SP, SP, Operand(512 * kWordSize));
   __ ldr(R0, Address(SP));
   __ RestoreCSP();
   __ ret();
@@ -490,11 +490,11 @@
   __ movz(R0, Immediate(43), 0);
   __ movz(R1, Immediate(42), 0);
   __ movz(R2, Immediate(10), 0);
-  __ sub(SP, SP, Operand(10*kWordSize));
+  __ sub(SP, SP, Operand(10 * kWordSize));
   // Store R1 into SP + R2 * kWordSize.
   __ str(R1, Address(SP, R2, UXTX, Address::Scaled));
   __ ldr(R0, Address(SP, R2, UXTX, Address::Scaled));
-  __ add(SP, SP, Operand(10*kWordSize));
+  __ add(SP, SP, Operand(10 * kWordSize));
   __ RestoreCSP();
   __ ret();
 }
@@ -527,8 +527,8 @@
   __ SetupDartSP();
   __ LoadImmediate(R2, 43);
   __ LoadImmediate(R3, 42);
-  __ stp(R2, R3, Address(SP, -2*kWordSize, Address::PairPreIndex));
-  __ ldp(R0, R1, Address(SP, 2*kWordSize, Address::PairPostIndex));
+  __ stp(R2, R3, Address(SP, -2 * kWordSize, Address::PairPreIndex));
+  __ ldp(R0, R1, Address(SP, 2 * kWordSize, Address::PairPostIndex));
   __ sub(R0, R0, Operand(R1));
   __ RestoreCSP();
   __ ret();
@@ -572,7 +572,7 @@
   __ stxr(TMP, R1, SP);  // IP == 0, success
   __ cmp(TMP, Operand(0));
   __ b(&retry, NE);  // NE if context switch occurred between ldrex and strex.
-  __ Pop(R0);  // 42
+  __ Pop(R0);        // 42
   __ RestoreCSP();
   __ ret();
 }
@@ -591,9 +591,9 @@
   __ movz(R1, Immediate(42), 0);
   __ Push(R0);
   __ ldxr(R0, SP);
-  __ clrex();  // Simulate a context switch.
+  __ clrex();            // Simulate a context switch.
   __ stxr(TMP, R1, SP);  // IP == 1, failure
-  __ Pop(R0);  // 40
+  __ Pop(R0);            // 40
   __ add(R0, R0, Operand(TMP));
   __ RestoreCSP();
   __ ret();
@@ -666,7 +666,7 @@
 
 ASSEMBLER_TEST_GENERATE(OrnRegs, assembler) {
   __ movz(R1, Immediate(32), 0);
-  __ movn(R2, Immediate(0), 0);  // R2 <- 0xffffffffffffffff.
+  __ movn(R2, Immediate(0), 0);       // R2 <- 0xffffffffffffffff.
   __ movk(R2, Immediate(0xffd5), 0);  // R2 <- 0xffffffffffffffe5.
   __ orn(R0, R1, Operand(R2));
   __ ret();
@@ -1396,7 +1396,7 @@
 
 ASSEMBLER_TEST_GENERATE(Udiv_corner, assembler) {
   __ movz(R0, Immediate(0x8000), 3);  // R0 <- 0x8000000000000000
-  __ movn(R1, Immediate(0), 0);  // R1 <- 0xffffffffffffffff
+  __ movn(R1, Immediate(0), 0);       // R1 <- 0xffffffffffffffff
   __ udiv(R2, R0, R1);
   __ mov(R0, R2);
   __ ret();
@@ -1412,7 +1412,7 @@
 
 ASSEMBLER_TEST_GENERATE(Sdiv_corner, assembler) {
   __ movz(R3, Immediate(0x8000), 3);  // R0 <- 0x8000000000000000
-  __ movn(R1, Immediate(0), 0);  // R1 <- 0xffffffffffffffff
+  __ movn(R1, Immediate(0), 0);       // R1 <- 0xffffffffffffffff
   __ sdiv(R2, R3, R1);
   __ mov(R0, R2);
   __ ret();
@@ -1545,8 +1545,8 @@
 
 ASSEMBLER_TEST_GENERATE(Umulh, assembler) {
   __ movz(R1, Immediate(-1), 3);  // 0xffff000000000000
-  __ movz(R2, Immediate(7), 3);  // 0x0007000000000000
-  __ umulh(R0, R1, R2);  // 0x0006fff900000000
+  __ movz(R2, Immediate(7), 3);   // 0x0007000000000000
+  __ umulh(R0, R1, R2);           // 0x0006fff900000000
   __ ret();
 }
 
@@ -1562,7 +1562,7 @@
   __ movn(R1, Immediate(0), 0);  // W1 = 0xffffffff.
   __ movz(R2, Immediate(7), 0);  // W2 = 7.
   __ movz(R3, Immediate(8), 0);  // X3 = 8.
-  __ umaddl(R0, R1, R2, R3);  // X0 = W1*W2 + X3 = 0x700000001.
+  __ umaddl(R0, R1, R2, R3);     // X0 = W1*W2 + X3 = 0x700000001.
   __ ret();
 }
 
@@ -1606,8 +1606,8 @@
 
 ASSEMBLER_TEST_RUN(LoadImmediateMed2, test) {
   typedef int64_t (*Int64Return)() DART_UNUSED;
-  EXPECT_EQ(
-      0x4321f1234123, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
+  EXPECT_EQ(0x4321f1234123,
+            EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
 }
 
 
@@ -1684,6 +1684,163 @@
 }
 
 
+ASSEMBLER_TEST_GENERATE(LoadHalfWordUnaligned, assembler) {
+  __ LoadUnaligned(R1, R0, TMP, kHalfword);
+  __ mov(R0, R1);
+  __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(LoadHalfWordUnaligned, test) {
+  EXPECT(test != NULL);
+  typedef intptr_t (*LoadHalfWordUnaligned)(intptr_t) DART_UNUSED;
+  uint8_t buffer[4] = {
+      0x89, 0xAB, 0xCD, 0xEF,
+  };
+
+  EXPECT_EQ(
+      static_cast<int16_t>(static_cast<uint16_t>(0xAB89)),
+      EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadHalfWordUnaligned, test->entry(),
+                                      reinterpret_cast<intptr_t>(&buffer[0])));
+  EXPECT_EQ(
+      static_cast<int16_t>(static_cast<uint16_t>(0xCDAB)),
+      EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadHalfWordUnaligned, test->entry(),
+                                      reinterpret_cast<intptr_t>(&buffer[1])));
+}
+
+
+ASSEMBLER_TEST_GENERATE(LoadHalfWordUnsignedUnaligned, assembler) {
+  __ LoadUnaligned(R1, R0, TMP, kUnsignedHalfword);
+  __ mov(R0, R1);
+  __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(LoadHalfWordUnsignedUnaligned, test) {
+  EXPECT(test != NULL);
+  typedef intptr_t (*LoadHalfWordUnsignedUnaligned)(intptr_t) DART_UNUSED;
+  uint8_t buffer[4] = {
+      0x89, 0xAB, 0xCD, 0xEF,
+  };
+
+  EXPECT_EQ(0xAB89, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                        LoadHalfWordUnsignedUnaligned, test->entry(),
+                        reinterpret_cast<intptr_t>(&buffer[0])));
+  EXPECT_EQ(0xCDAB, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                        LoadHalfWordUnsignedUnaligned, test->entry(),
+                        reinterpret_cast<intptr_t>(&buffer[1])));
+}
+
+
+ASSEMBLER_TEST_GENERATE(StoreHalfWordUnaligned, assembler) {
+  __ LoadImmediate(R1, 0xABCD);
+  __ StoreUnaligned(R1, R0, TMP, kHalfword);
+  __ mov(R0, R1);
+  __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(StoreHalfWordUnaligned, test) {
+  EXPECT(test != NULL);
+  typedef intptr_t (*StoreHalfWordUnaligned)(intptr_t) DART_UNUSED;
+  uint8_t buffer[4] = {
+      0, 0, 0, 0,
+  };
+
+  EXPECT_EQ(0xABCD, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                        StoreHalfWordUnaligned, test->entry(),
+                        reinterpret_cast<intptr_t>(&buffer[0])));
+  EXPECT_EQ(0xCD, buffer[0]);
+  EXPECT_EQ(0xAB, buffer[1]);
+  EXPECT_EQ(0, buffer[2]);
+
+  EXPECT_EQ(0xABCD, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                        StoreHalfWordUnaligned, test->entry(),
+                        reinterpret_cast<intptr_t>(&buffer[1])));
+  EXPECT_EQ(0xCD, buffer[1]);
+  EXPECT_EQ(0xAB, buffer[2]);
+  EXPECT_EQ(0, buffer[3]);
+}
+
+
+ASSEMBLER_TEST_GENERATE(LoadWordUnaligned, assembler) {
+  __ LoadUnaligned(R1, R0, TMP, kUnsignedWord);
+  __ mov(R0, R1);
+  __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(LoadWordUnaligned, test) {
+  EXPECT(test != NULL);
+  typedef int32_t (*LoadWordUnaligned)(intptr_t) DART_UNUSED;
+  uint8_t buffer[8] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0};
+
+  EXPECT_EQ(
+      static_cast<int32_t>(0x78563412),
+      EXECUTE_TEST_CODE_INT32_INTPTR(LoadWordUnaligned, test->entry(),
+                                     reinterpret_cast<intptr_t>(&buffer[0])));
+  EXPECT_EQ(
+      static_cast<int32_t>(0x9A785634),
+      EXECUTE_TEST_CODE_INT32_INTPTR(LoadWordUnaligned, test->entry(),
+                                     reinterpret_cast<intptr_t>(&buffer[1])));
+  EXPECT_EQ(
+      static_cast<int32_t>(0xBC9A7856),
+      EXECUTE_TEST_CODE_INT32_INTPTR(LoadWordUnaligned, test->entry(),
+                                     reinterpret_cast<intptr_t>(&buffer[2])));
+  EXPECT_EQ(
+      static_cast<int32_t>(0xDEBC9A78),
+      EXECUTE_TEST_CODE_INT32_INTPTR(LoadWordUnaligned, test->entry(),
+                                     reinterpret_cast<intptr_t>(&buffer[3])));
+}
+
+
+ASSEMBLER_TEST_GENERATE(StoreWordUnaligned, assembler) {
+  __ LoadImmediate(R1, 0x12345678);
+  __ StoreUnaligned(R1, R0, TMP, kUnsignedWord);
+  __ mov(R0, R1);
+  __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(StoreWordUnaligned, test) {
+  EXPECT(test != NULL);
+  typedef intptr_t (*StoreWordUnaligned)(intptr_t) DART_UNUSED;
+  uint8_t buffer[8] = {0, 0, 0, 0, 0, 0, 0, 0};
+
+  EXPECT_EQ(0x12345678, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                            StoreWordUnaligned, test->entry(),
+                            reinterpret_cast<intptr_t>(&buffer[0])));
+  EXPECT_EQ(0x78, buffer[0]);
+  EXPECT_EQ(0x56, buffer[1]);
+  EXPECT_EQ(0x34, buffer[2]);
+  EXPECT_EQ(0x12, buffer[3]);
+
+  EXPECT_EQ(0x12345678, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                            StoreWordUnaligned, test->entry(),
+                            reinterpret_cast<intptr_t>(&buffer[1])));
+  EXPECT_EQ(0x78, buffer[1]);
+  EXPECT_EQ(0x56, buffer[2]);
+  EXPECT_EQ(0x34, buffer[3]);
+  EXPECT_EQ(0x12, buffer[4]);
+
+  EXPECT_EQ(0x12345678, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                            StoreWordUnaligned, test->entry(),
+                            reinterpret_cast<intptr_t>(&buffer[2])));
+  EXPECT_EQ(0x78, buffer[2]);
+  EXPECT_EQ(0x56, buffer[3]);
+  EXPECT_EQ(0x34, buffer[4]);
+  EXPECT_EQ(0x12, buffer[5]);
+
+  EXPECT_EQ(0x12345678, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                            StoreWordUnaligned, test->entry(),
+                            reinterpret_cast<intptr_t>(&buffer[3])));
+  EXPECT_EQ(0x78, buffer[3]);
+  EXPECT_EQ(0x56, buffer[4]);
+  EXPECT_EQ(0x34, buffer[5]);
+  EXPECT_EQ(0x12, buffer[6]);
+}
+
+
 static void EnterTestFrame(Assembler* assembler) {
   __ EnterFrame(0);
   __ Push(CODE_REG);
@@ -1923,7 +2080,8 @@
 ASSEMBLER_TEST_RUN(Fmovdi2, test) {
   typedef double (*DoubleReturn)() DART_UNUSED;
   EXPECT_FLOAT_EQ(123412983.1324524315,
-      EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry()), 0.0001f);
+                  EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry()),
+                  0.0001f);
 }
 
 
@@ -1958,8 +2116,8 @@
 ASSEMBLER_TEST_GENERATE(FldrdFstrdPrePostIndex, assembler) {
   __ SetupDartSP();
   __ LoadDImmediate(V1, 42.0);
-  __ fstrd(V1, Address(SP, -1*kWordSize, Address::PreIndex));
-  __ fldrd(V0, Address(SP, 1*kWordSize, Address::PostIndex));
+  __ fstrd(V1, Address(SP, -1 * kWordSize, Address::PreIndex));
+  __ fldrd(V0, Address(SP, 1 * kWordSize, Address::PostIndex));
   __ RestoreCSP();
   __ ret();
 }
@@ -1975,8 +2133,8 @@
   __ SetupDartSP();
   __ LoadDImmediate(V1, 42.0);
   __ fcvtsd(V2, V1);
-  __ fstrs(V2, Address(SP, -1*kWordSize, Address::PreIndex));
-  __ fldrs(V3, Address(SP, 1*kWordSize, Address::PostIndex));
+  __ fstrs(V2, Address(SP, -1 * kWordSize, Address::PreIndex));
+  __ fldrs(V3, Address(SP, 1 * kWordSize, Address::PostIndex));
   __ fcvtds(V0, V3);
   __ RestoreCSP();
   __ ret();
@@ -2200,9 +2358,9 @@
   __ LoadDImmediate(V0, 43.0);
   __ LoadDImmediate(V1, 42.0);
   // Largest negative offset that can fit in the signed 9-bit immediate field.
-  __ fstrd(V1, Address(SP, -32*kWordSize, Address::PreIndex));
+  __ fstrd(V1, Address(SP, -32 * kWordSize, Address::PreIndex));
   // Largest positive kWordSize aligned offset that we can fit.
-  __ fldrd(V0, Address(SP, 31*kWordSize, Address::PostIndex));
+  __ fldrd(V0, Address(SP, 31 * kWordSize, Address::PostIndex));
   // Correction.
   __ add(SP, SP, Operand(kWordSize));  // Restore SP.
   __ RestoreCSP();
@@ -2220,9 +2378,9 @@
   __ SetupDartSP();
   __ LoadDImmediate(V0, 43.0);
   __ LoadDImmediate(V1, 42.0);
-  __ sub(SP, SP, Operand(512*kWordSize));
-  __ fstrd(V1, Address(SP, 512*kWordSize, Address::Offset));
-  __ add(SP, SP, Operand(512*kWordSize));
+  __ sub(SP, SP, Operand(512 * kWordSize));
+  __ fstrd(V1, Address(SP, 512 * kWordSize, Address::Offset));
+  __ add(SP, SP, Operand(512 * kWordSize));
   __ fldrd(V0, Address(SP));
   __ RestoreCSP();
   __ ret();
@@ -2263,11 +2421,11 @@
   __ LoadDImmediate(V0, 43.0);
   __ LoadDImmediate(V1, 42.0);
   __ movz(R2, Immediate(10), 0);
-  __ sub(SP, SP, Operand(10*kWordSize));
+  __ sub(SP, SP, Operand(10 * kWordSize));
   // Store V1 into SP + R2 * kWordSize.
   __ fstrd(V1, Address(SP, R2, UXTX, Address::Scaled));
   __ fldrd(V0, Address(SP, R2, UXTX, Address::Scaled));
-  __ add(SP, SP, Operand(10*kWordSize));
+  __ add(SP, SP, Operand(10 * kWordSize));
   __ RestoreCSP();
   __ ret();
 }
@@ -3393,9 +3551,12 @@
 // This is the same function as in the Simulator.
 static float arm_recip_estimate(float a) {
   // From the ARM Architecture Reference Manual A2-85.
-  if (isinf(a) || (fabs(a) >= exp2f(126))) return 0.0;
-  else if (a == 0.0) return kPosInfinity;
-  else if (isnan(a)) return a;
+  if (isinf(a) || (fabs(a) >= exp2f(126)))
+    return 0.0;
+  else if (a == 0.0)
+    return kPosInfinity;
+  else if (isnan(a))
+    return a;
 
   uint32_t a_bits = bit_cast<uint32_t, float>(a);
   // scaled = '0011 1111 1110' : a<22:0> : Zeros(29)
@@ -3415,7 +3576,7 @@
   // r in units of 1/256 rounded to nearest.
   int32_t s = static_cast<int32_t>(256.0 * r + 0.5);
   double estimate = static_cast<double>(s) / 256.0;
-  ASSERT((estimate >= 1.0) && (estimate <= (511.0/256.0)));
+  ASSERT((estimate >= 1.0) && (estimate <= (511.0 / 256.0)));
 
   // result = sign : result_exp<7:0> : estimate<51:29>
   int32_t result_bits =
@@ -3502,9 +3663,12 @@
 
 static float arm_reciprocal_sqrt_estimate(float a) {
   // From the ARM Architecture Reference Manual A2-87.
-  if (isinf(a) || (fabs(a) >= exp2f(126))) return 0.0;
-  else if (a == 0.0) return kPosInfinity;
-  else if (isnan(a)) return a;
+  if (isinf(a) || (fabs(a) >= exp2f(126)))
+    return 0.0;
+  else if (a == 0.0)
+    return kPosInfinity;
+  else if (isnan(a))
+    return a;
 
   uint32_t a_bits = bit_cast<uint32_t, float>(a);
   uint64_t scaled;
@@ -3542,10 +3706,11 @@
   // r in units of 1/256 rounded to nearest.
   int32_t s = static_cast<int>(256.0 * r + 0.5);
   double estimate = static_cast<double>(s) / 256.0;
-  ASSERT((estimate >= 1.0) && (estimate <= (511.0/256.0)));
+  ASSERT((estimate >= 1.0) && (estimate <= (511.0 / 256.0)));
 
   // result = 0 : result_exp<7:0> : estimate<51:29>
-  int32_t result_bits = ((result_exp & 0xff) << 23) |
+  int32_t result_bits =
+      ((result_exp & 0xff) << 23) |
       ((bit_cast<uint64_t, double>(estimate) >> 29) & 0x7fffff);
   return bit_cast<float, int32_t>(result_bits);
 }
@@ -3571,16 +3736,16 @@
 
 
 ASSEMBLER_TEST_GENERATE(Vrsqrtss, assembler) {
-    __ LoadDImmediate(V1, 5.0);
-    __ LoadDImmediate(V2, 10.0);
+  __ LoadDImmediate(V1, 5.0);
+  __ LoadDImmediate(V2, 10.0);
 
-    __ fcvtsd(V1, V1);
-    __ fcvtsd(V2, V2);
+  __ fcvtsd(V1, V1);
+  __ fcvtsd(V2, V2);
 
-    __ vrsqrtss(V0, V1, V2);
+  __ vrsqrtss(V0, V1, V2);
 
-    __ fcvtds(V0, V0);
-    __ ret();
+  __ fcvtds(V0, V0);
+  __ ret();
 }
 
 
@@ -3588,18 +3753,18 @@
   EXPECT(test != NULL);
   typedef double (*DoubleReturn)() DART_UNUSED;
   double res = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry());
-  EXPECT_FLOAT_EQ((3.0 - 10.0 * 5.0)/2.0, res, 0.0001);
+  EXPECT_FLOAT_EQ((3.0 - 10.0 * 5.0) / 2.0, res, 0.0001);
 }
 
 
 ASSEMBLER_TEST_GENERATE(ReciprocalSqrt, assembler) {
-    __ LoadDImmediate(V1, 147000.0);
-    __ fcvtsd(V1, V1);
+  __ LoadDImmediate(V1, 147000.0);
+  __ fcvtsd(V1, V1);
 
-    __ VRSqrts(V0, V1);
+  __ VRSqrts(V0, V1);
 
-    __ fcvtds(V0, V0);
-    __ ret();
+  __ fcvtds(V0, V0);
+  __ ret();
 }
 
 
@@ -3607,7 +3772,7 @@
   EXPECT(test != NULL);
   typedef double (*DoubleReturn)() DART_UNUSED;
   double res = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry());
-  EXPECT_FLOAT_EQ(1.0/sqrt(147000.0), res, 0.0001);
+  EXPECT_FLOAT_EQ(1.0 / sqrt(147000.0), res, 0.0001);
 }
 
 
@@ -3622,8 +3787,7 @@
   __ Push(THR);
   __ Push(LR);
   __ mov(THR, R2);
-  __ StoreIntoObject(R1,
-                     FieldAddress(R1, GrowableObjectArray::data_offset()),
+  __ StoreIntoObject(R1, FieldAddress(R1, GrowableObjectArray::data_offset()),
                      R0);
   __ Pop(LR);
   __ Pop(THR);
diff --git a/runtime/vm/assembler_arm_test.cc b/runtime/vm/assembler_arm_test.cc
index 7eca350..e424b6a 100644
--- a/runtime/vm/assembler_arm_test.cc
+++ b/runtime/vm/assembler_arm_test.cc
@@ -97,18 +97,175 @@
 }
 
 
+ASSEMBLER_TEST_GENERATE(LoadHalfWordUnaligned, assembler) {
+  __ LoadHalfWordUnaligned(R1, R0, TMP);
+  __ mov(R0, Operand(R1));
+  __ bx(LR);
+}
+
+
+ASSEMBLER_TEST_RUN(LoadHalfWordUnaligned, test) {
+  EXPECT(test != NULL);
+  typedef intptr_t (*LoadHalfWordUnaligned)(intptr_t) DART_UNUSED;
+  uint8_t buffer[4] = {
+      0x89, 0xAB, 0xCD, 0xEF,
+  };
+
+  EXPECT_EQ(
+      static_cast<int16_t>(static_cast<uint16_t>(0xAB89)),
+      EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadHalfWordUnaligned, test->entry(),
+                                      reinterpret_cast<intptr_t>(&buffer[0])));
+  EXPECT_EQ(
+      static_cast<int16_t>(static_cast<uint16_t>(0xCDAB)),
+      EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadHalfWordUnaligned, test->entry(),
+                                      reinterpret_cast<intptr_t>(&buffer[1])));
+}
+
+
+ASSEMBLER_TEST_GENERATE(LoadHalfWordUnsignedUnaligned, assembler) {
+  __ LoadHalfWordUnsignedUnaligned(R1, R0, TMP);
+  __ mov(R0, Operand(R1));
+  __ bx(LR);
+}
+
+
+ASSEMBLER_TEST_RUN(LoadHalfWordUnsignedUnaligned, test) {
+  EXPECT(test != NULL);
+  typedef intptr_t (*LoadHalfWordUnsignedUnaligned)(intptr_t) DART_UNUSED;
+  uint8_t buffer[4] = {
+      0x89, 0xAB, 0xCD, 0xEF,
+  };
+
+  EXPECT_EQ(0xAB89, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                        LoadHalfWordUnsignedUnaligned, test->entry(),
+                        reinterpret_cast<intptr_t>(&buffer[0])));
+  EXPECT_EQ(0xCDAB, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                        LoadHalfWordUnsignedUnaligned, test->entry(),
+                        reinterpret_cast<intptr_t>(&buffer[1])));
+}
+
+
+ASSEMBLER_TEST_GENERATE(StoreHalfWordUnaligned, assembler) {
+  __ LoadImmediate(R1, 0xABCD);
+  __ StoreWordUnaligned(R1, R0, TMP);
+  __ mov(R0, Operand(R1));
+  __ bx(LR);
+}
+
+
+ASSEMBLER_TEST_RUN(StoreHalfWordUnaligned, test) {
+  EXPECT(test != NULL);
+  typedef intptr_t (*StoreHalfWordUnaligned)(intptr_t) DART_UNUSED;
+  uint8_t buffer[4] = {
+      0, 0, 0, 0,
+  };
+
+  EXPECT_EQ(0xABCD, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                        StoreHalfWordUnaligned, test->entry(),
+                        reinterpret_cast<intptr_t>(&buffer[0])));
+  EXPECT_EQ(0xCD, buffer[0]);
+  EXPECT_EQ(0xAB, buffer[1]);
+  EXPECT_EQ(0, buffer[2]);
+
+  EXPECT_EQ(0xABCD, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                        StoreHalfWordUnaligned, test->entry(),
+                        reinterpret_cast<intptr_t>(&buffer[1])));
+  EXPECT_EQ(0xCD, buffer[1]);
+  EXPECT_EQ(0xAB, buffer[2]);
+  EXPECT_EQ(0, buffer[3]);
+}
+
+
+ASSEMBLER_TEST_GENERATE(LoadWordUnaligned, assembler) {
+  __ LoadWordUnaligned(R1, R0, TMP);
+  __ mov(R0, Operand(R1));
+  __ bx(LR);
+}
+
+
+ASSEMBLER_TEST_RUN(LoadWordUnaligned, test) {
+  EXPECT(test != NULL);
+  typedef intptr_t (*LoadWordUnaligned)(intptr_t) DART_UNUSED;
+  uint8_t buffer[8] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0};
+
+  EXPECT_EQ(
+      static_cast<intptr_t>(0x78563412),
+      EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadWordUnaligned, test->entry(),
+                                      reinterpret_cast<intptr_t>(&buffer[0])));
+  EXPECT_EQ(
+      static_cast<intptr_t>(0x9A785634),
+      EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadWordUnaligned, test->entry(),
+                                      reinterpret_cast<intptr_t>(&buffer[1])));
+  EXPECT_EQ(
+      static_cast<intptr_t>(0xBC9A7856),
+      EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadWordUnaligned, test->entry(),
+                                      reinterpret_cast<intptr_t>(&buffer[2])));
+  EXPECT_EQ(
+      static_cast<intptr_t>(0xDEBC9A78),
+      EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadWordUnaligned, test->entry(),
+                                      reinterpret_cast<intptr_t>(&buffer[3])));
+}
+
+
+ASSEMBLER_TEST_GENERATE(StoreWordUnaligned, assembler) {
+  __ LoadImmediate(R1, 0x12345678);
+  __ StoreWordUnaligned(R1, R0, TMP);
+  __ mov(R0, Operand(R1));
+  __ bx(LR);
+}
+
+
+ASSEMBLER_TEST_RUN(StoreWordUnaligned, test) {
+  EXPECT(test != NULL);
+  typedef intptr_t (*StoreWordUnaligned)(intptr_t) DART_UNUSED;
+  uint8_t buffer[8] = {0, 0, 0, 0, 0, 0, 0, 0};
+
+  EXPECT_EQ(0x12345678, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                            StoreWordUnaligned, test->entry(),
+                            reinterpret_cast<intptr_t>(&buffer[0])));
+  EXPECT_EQ(0x78, buffer[0]);
+  EXPECT_EQ(0x56, buffer[1]);
+  EXPECT_EQ(0x34, buffer[2]);
+  EXPECT_EQ(0x12, buffer[3]);
+
+  EXPECT_EQ(0x12345678, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                            StoreWordUnaligned, test->entry(),
+                            reinterpret_cast<intptr_t>(&buffer[1])));
+  EXPECT_EQ(0x78, buffer[1]);
+  EXPECT_EQ(0x56, buffer[2]);
+  EXPECT_EQ(0x34, buffer[3]);
+  EXPECT_EQ(0x12, buffer[4]);
+
+  EXPECT_EQ(0x12345678, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                            StoreWordUnaligned, test->entry(),
+                            reinterpret_cast<intptr_t>(&buffer[2])));
+  EXPECT_EQ(0x78, buffer[2]);
+  EXPECT_EQ(0x56, buffer[3]);
+  EXPECT_EQ(0x34, buffer[4]);
+  EXPECT_EQ(0x12, buffer[5]);
+
+  EXPECT_EQ(0x12345678, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                            StoreWordUnaligned, test->entry(),
+                            reinterpret_cast<intptr_t>(&buffer[3])));
+  EXPECT_EQ(0x78, buffer[3]);
+  EXPECT_EQ(0x56, buffer[4]);
+  EXPECT_EQ(0x34, buffer[5]);
+  EXPECT_EQ(0x12, buffer[6]);
+}
+
+
 ASSEMBLER_TEST_GENERATE(Vmov, assembler) {
   if (TargetCPUFeatures::vfp_supported()) {
     __ mov(R3, Operand(43));
     __ mov(R1, Operand(41));
-    __ vmovsrr(S1, R1, R3);  // S1:S2 = 41:43
-    __ vmovs(S0, S2);  // S0 = S2, S0:S1 == 43:41
-    __ vmovd(D2, D0);  // D2 = D0, S4:S5 == 43:41
-    __ vmovrs(R3, S5);  // R3 = S5, R3 == 41
-    __ vmovrrs(R1, R2, S4);  // R1:R2 = S4:S5, R1:R2 == 43:41
-    __ vmovdrr(D3, R3, R2);  // D3 = R3:R2, S6:S7 == 41:41
-    __ vmovdr(D3, 1, R1);  // D3[1] == S7 = R1, S6:S7 == 41:43
-    __ vmovrrd(R0, R1, D3);  // R0:R1 = D3, R0:R1 == 41:43
+    __ vmovsrr(S1, R1, R3);       // S1:S2 = 41:43
+    __ vmovs(S0, S2);             // S0 = S2, S0:S1 == 43:41
+    __ vmovd(D2, D0);             // D2 = D0, S4:S5 == 43:41
+    __ vmovrs(R3, S5);            // R3 = S5, R3 == 41
+    __ vmovrrs(R1, R2, S4);       // R1:R2 = S4:S5, R1:R2 == 43:41
+    __ vmovdrr(D3, R3, R2);       // D3 = R3:R2, S6:S7 == 41:41
+    __ vmovdr(D3, 1, R1);         // D3[1] == S7 = R1, S6:S7 == 41:43
+    __ vmovrrd(R0, R1, D3);       // R0:R1 = D3, R0:R1 == 41:43
     __ sub(R0, R1, Operand(R0));  // 43-41
   }
   __ bx(LR);
@@ -143,7 +300,7 @@
   if (TargetCPUFeatures::vfp_supported()) {
     typedef float (*SingleVLoadStore)() DART_UNUSED;
     float res = EXECUTE_TEST_CODE_FLOAT(SingleVLoadStore, test->entry());
-    EXPECT_FLOAT_EQ(2*12.3f, res, 0.001f);
+    EXPECT_FLOAT_EQ(2 * 12.3f, res, 0.001f);
   }
 }
 
@@ -172,7 +329,7 @@
   if (TargetCPUFeatures::vfp_supported()) {
     typedef float (*SingleVLoadStore)() DART_UNUSED;
     float res = EXECUTE_TEST_CODE_FLOAT(SingleVLoadStore, test->entry());
-    EXPECT_FLOAT_EQ(2*12.3f, res, 0.001f);
+    EXPECT_FLOAT_EQ(2 * 12.3f, res, 0.001f);
   }
 }
 
@@ -200,7 +357,7 @@
   if (TargetCPUFeatures::vfp_supported()) {
     typedef double (*DoubleVLoadStore)() DART_UNUSED;
     float res = EXECUTE_TEST_CODE_DOUBLE(DoubleVLoadStore, test->entry());
-    EXPECT_FLOAT_EQ(2*12.3f, res, 0.001f);
+    EXPECT_FLOAT_EQ(2 * 12.3f, res, 0.001f);
   }
 }
 
@@ -209,13 +366,13 @@
   if (TargetCPUFeatures::vfp_supported()) {
     __ LoadSImmediate(S0, 12.3f);
     __ LoadSImmediate(S1, 3.4f);
-    __ vnegs(S0, S0);  // -12.3f
-    __ vabss(S0, S0);  // 12.3f
+    __ vnegs(S0, S0);      // -12.3f
+    __ vabss(S0, S0);      // 12.3f
     __ vadds(S0, S0, S1);  // 15.7f
     __ vmuls(S0, S0, S1);  // 53.38f
     __ vsubs(S0, S0, S1);  // 49.98f
     __ vdivs(S0, S0, S1);  // 14.7f
-    __ vsqrts(S0, S0);  // 3.8340579f
+    __ vsqrts(S0, S0);     // 3.8340579f
   }
   __ bx(LR);
 }
@@ -235,13 +392,13 @@
   if (TargetCPUFeatures::vfp_supported()) {
     __ LoadDImmediate(D0, 12.3, R0);
     __ LoadDImmediate(D1, 3.4, R0);
-    __ vnegd(D0, D0);  // -12.3
-    __ vabsd(D0, D0);  // 12.3
+    __ vnegd(D0, D0);      // -12.3
+    __ vabsd(D0, D0);      // 12.3
     __ vaddd(D0, D0, D1);  // 15.7
     __ vmuld(D0, D0, D1);  // 53.38
     __ vsubd(D0, D0, D1);  // 49.98
     __ vdivd(D0, D0, D1);  // 14.7
-    __ vsqrtd(D0, D0);  // 3.8340579
+    __ vsqrtd(D0, D0);     // 3.8340579
   }
   __ bx(LR);
 }
@@ -294,8 +451,8 @@
   EXPECT(test != NULL);
   if (TargetCPUFeatures::vfp_supported()) {
     typedef double (*IntToDoubleConversionCode)() DART_UNUSED;
-    double res = EXECUTE_TEST_CODE_DOUBLE(IntToDoubleConversionCode,
-                                          test->entry());
+    double res =
+        EXECUTE_TEST_CODE_DOUBLE(IntToDoubleConversionCode, test->entry());
     EXPECT_FLOAT_EQ(6.0, res, 0.001);
   }
 }
@@ -321,8 +478,8 @@
   EXPECT(test != NULL);
   if (TargetCPUFeatures::vfp_supported()) {
     typedef double (*LongToDoubleConversionCode)() DART_UNUSED;
-    double res = EXECUTE_TEST_CODE_DOUBLE(LongToDoubleConversionCode,
-                                          test->entry());
+    double res =
+        EXECUTE_TEST_CODE_DOUBLE(LongToDoubleConversionCode, test->entry());
     EXPECT_FLOAT_EQ(60000000000.0, res, 0.001);
   }
 }
@@ -342,8 +499,8 @@
   EXPECT(test != NULL);
   if (TargetCPUFeatures::vfp_supported()) {
     typedef float (*IntToFloatConversionCode)() DART_UNUSED;
-    float res = EXECUTE_TEST_CODE_FLOAT(IntToFloatConversionCode,
-                                        test->entry());
+    float res =
+        EXECUTE_TEST_CODE_FLOAT(IntToFloatConversionCode, test->entry());
     EXPECT_FLOAT_EQ(6.0, res, 0.001);
   }
 }
@@ -362,15 +519,12 @@
   EXPECT(test != NULL);
   if (TargetCPUFeatures::vfp_supported()) {
     typedef int (*FloatToIntConversion)(float arg) DART_UNUSED;
-    EXPECT_EQ(12,
-              EXECUTE_TEST_CODE_INT32_F(FloatToIntConversion, test->entry(),
-                                        12.8f));
-    EXPECT_EQ(INT_MIN,
-              EXECUTE_TEST_CODE_INT32_F(FloatToIntConversion, test->entry(),
-                                        -FLT_MAX));
-    EXPECT_EQ(INT_MAX,
-              EXECUTE_TEST_CODE_INT32_F(FloatToIntConversion, test->entry(),
-                                        FLT_MAX));
+    EXPECT_EQ(12, EXECUTE_TEST_CODE_INT32_F(FloatToIntConversion, test->entry(),
+                                            12.8f));
+    EXPECT_EQ(INT_MIN, EXECUTE_TEST_CODE_INT32_F(FloatToIntConversion,
+                                                 test->entry(), -FLT_MAX));
+    EXPECT_EQ(INT_MAX, EXECUTE_TEST_CODE_INT32_F(FloatToIntConversion,
+                                                 test->entry(), FLT_MAX));
   }
 }
 
@@ -388,15 +542,12 @@
   if (TargetCPUFeatures::vfp_supported()) {
     typedef int (*DoubleToIntConversion)(double arg) DART_UNUSED;
     EXPECT(test != NULL);
-    EXPECT_EQ(12,
-              EXECUTE_TEST_CODE_INT32_D(DoubleToIntConversion, test->entry(),
-                                        12.8));
-    EXPECT_EQ(INT_MIN,
-              EXECUTE_TEST_CODE_INT32_D(DoubleToIntConversion, test->entry(),
-                                        -DBL_MAX));
-    EXPECT_EQ(INT_MAX,
-              EXECUTE_TEST_CODE_INT32_D(DoubleToIntConversion, test->entry(),
-                                        DBL_MAX));
+    EXPECT_EQ(12, EXECUTE_TEST_CODE_INT32_D(DoubleToIntConversion,
+                                            test->entry(), 12.8));
+    EXPECT_EQ(INT_MIN, EXECUTE_TEST_CODE_INT32_D(DoubleToIntConversion,
+                                                 test->entry(), -DBL_MAX));
+    EXPECT_EQ(INT_MAX, EXECUTE_TEST_CODE_INT32_D(DoubleToIntConversion,
+                                                 test->entry(), DBL_MAX));
   }
 }
 
@@ -414,8 +565,8 @@
   if (TargetCPUFeatures::vfp_supported()) {
     typedef double (*FloatToDoubleConversionCode)() DART_UNUSED;
     EXPECT(test != NULL);
-    double res = EXECUTE_TEST_CODE_DOUBLE(FloatToDoubleConversionCode,
-                                          test->entry());
+    double res =
+        EXECUTE_TEST_CODE_DOUBLE(FloatToDoubleConversionCode, test->entry());
     EXPECT_FLOAT_EQ(12.8, res, 0.001);
   }
 }
@@ -434,8 +585,8 @@
   EXPECT(test != NULL);
   if (TargetCPUFeatures::vfp_supported()) {
     typedef float (*DoubleToFloatConversionCode)() DART_UNUSED;
-    float res = EXECUTE_TEST_CODE_FLOAT(DoubleToFloatConversionCode,
-                                        test->entry());
+    float res =
+        EXECUTE_TEST_CODE_FLOAT(DoubleToFloatConversionCode, test->entry());
     EXPECT_FLOAT_EQ(12.8, res, 0.001);
   }
 }
@@ -622,7 +773,7 @@
     __ strex(IP, R1, SP);  // IP == 0, success
     __ tst(IP, Operand(0));
     __ b(&retry, NE);  // NE if context switch occurred between ldrex and strex.
-    __ Pop(R0);  // 42
+    __ Pop(R0);        // 42
   }
   __ bx(LR);
 }
@@ -643,9 +794,9 @@
     __ mov(R1, Operand(42));
     __ Push(R0);
     __ ldrex(R0, SP);
-    __ clrex();  // Simulate a context switch.
+    __ clrex();            // Simulate a context switch.
     __ strex(IP, R1, SP);  // IP == 1, failure
-    __ Pop(R0);  // 40
+    __ Pop(R0);            // 40
     __ add(R0, R0, Operand(IP));
   }
   __ bx(LR);
@@ -701,7 +852,7 @@
   __ mov(R0, Operand(0));
   __ adds(IP, R2, Operand(R1));  // c_out = 1.
   __ adcs(IP, R2, Operand(R0));  // c_in = 1, c_out = 1.
-  __ adc(R0, R0, Operand(R0));  // c_in = 1.
+  __ adc(R0, R0, Operand(R0));   // c_in = 1.
   __ bx(LR);
 }
 
@@ -735,7 +886,7 @@
   __ mov(R0, Operand(0));
   __ subs(IP, R0, Operand(R1));  // c_out = 1.
   __ sbcs(IP, R0, Operand(R0));  // c_in = 1, c_out = 1.
-  __ sbc(R0, R0, Operand(R0));  // c_in = 1.
+  __ sbc(R0, R0, Operand(R0));   // c_in = 1.
   __ bx(LR);
 }
 
@@ -783,7 +934,7 @@
 
 ASSEMBLER_TEST_GENERATE(Orrs, assembler) {
   __ mov(R0, Operand(0));
-  __ tst(R0, Operand(R1));  // Set zero-flag.
+  __ tst(R0, Operand(R1));      // Set zero-flag.
   __ orrs(R0, R0, Operand(1));  // Clear zero-flag.
   __ bx(LR, EQ);
   __ mov(R0, Operand(42));
@@ -824,7 +975,7 @@
     __ vcvtdi(D2, S4);
     __ vdivd(D0, D1, D2);
     __ vcvtid(S0, D0);
-    __ vmovrs(R1, S0);  // r1 = r0/r2
+    __ vmovrs(R1, S0);       // r1 = r0/r2
     __ mls(R0, R1, R2, R0);  // r0 = r0 - r1*r2
   }
   __ bx(LR);
@@ -834,8 +985,8 @@
 ASSEMBLER_TEST_RUN(QuotientRemainder, test) {
   EXPECT(test != NULL);
   if (TargetCPUFeatures::vfp_supported()) {
-    typedef int64_t (*QuotientRemainder)
-        (int64_t dividend, int64_t divisor) DART_UNUSED;
+    typedef int64_t (*QuotientRemainder)(int64_t dividend, int64_t divisor)
+        DART_UNUSED;
     EXPECT_EQ(0x1000400000da8LL,
               EXECUTE_TEST_CODE_INT64_LL(QuotientRemainder, test->entry(),
                                          0x12345678, 0x1234));
@@ -857,8 +1008,8 @@
 
 ASSEMBLER_TEST_RUN(Multiply64To64, test) {
   EXPECT(test != NULL);
-  typedef int64_t (*Multiply64To64)
-      (int64_t operand0, int64_t operand1) DART_UNUSED;
+  typedef int64_t (*Multiply64To64)(int64_t operand0, int64_t operand1)
+      DART_UNUSED;
   EXPECT_EQ(6,
             EXECUTE_TEST_CODE_INT64_LL(Multiply64To64, test->entry(), -3, -2));
 }
@@ -872,8 +1023,8 @@
 
 ASSEMBLER_TEST_RUN(Multiply32To64, test) {
   EXPECT(test != NULL);
-  typedef int64_t (*Multiply32To64)
-      (int64_t operand0, int64_t operand1) DART_UNUSED;
+  typedef int64_t (*Multiply32To64)(int64_t operand0, int64_t operand1)
+      DART_UNUSED;
   EXPECT_EQ(6,
             EXECUTE_TEST_CODE_INT64_LL(Multiply32To64, test->entry(), -3, -2));
 }
@@ -887,8 +1038,8 @@
 
 ASSEMBLER_TEST_RUN(MultiplyAccumAccum32To64, test) {
   EXPECT(test != NULL);
-  typedef int64_t (*MultiplyAccumAccum32To64)
-      (int64_t operand0, int64_t operand1) DART_UNUSED;
+  typedef int64_t (*MultiplyAccumAccum32To64)(int64_t operand0,
+                                              int64_t operand1) DART_UNUSED;
   EXPECT_EQ(3 + 7 + 5 * 11,
             EXECUTE_TEST_CODE_INT64_LL(MultiplyAccumAccum32To64, test->entry(),
                                        (3LL << 32) + 7, (5LL << 32) + 11));
@@ -1149,12 +1300,12 @@
 
 ASSEMBLER_TEST_GENERATE(Ldrd, assembler) {
   __ mov(IP, Operand(SP));
-  __ sub(SP, SP, Operand(kWordSize*30));
+  __ sub(SP, SP, Operand(kWordSize * 30));
   __ strd(R2, R3, SP, 0);
-  __ strd(R0, R1, IP, (-kWordSize*28));
-  __ ldrd(R2, R3, IP, (-kWordSize*28));
+  __ strd(R0, R1, IP, (-kWordSize * 28));
+  __ ldrd(R2, R3, IP, (-kWordSize * 28));
   __ ldrd(R0, R1, SP, 0);
-  __ add(SP, SP, Operand(kWordSize*30));
+  __ add(SP, SP, Operand(kWordSize * 30));
   __ sub(R0, R0, Operand(R2));
   __ add(R1, R1, Operand(R3));
   __ bx(LR);
@@ -1164,8 +1315,9 @@
 ASSEMBLER_TEST_RUN(Ldrd, test) {
   EXPECT(test != NULL);
   typedef int64_t (*Tst)(int64_t r0r1, int64_t r2r3) DART_UNUSED;
-  EXPECT_EQ(0x0000444400002222LL, EXECUTE_TEST_CODE_INT64_LL(
-      Tst, test->entry(), 0x0000111100000000LL, 0x0000333300002222LL));
+  EXPECT_EQ(0x0000444400002222LL,
+            EXECUTE_TEST_CODE_INT64_LL(Tst, test->entry(), 0x0000111100000000LL,
+                                       0x0000333300002222LL));
 }
 
 
@@ -1184,23 +1336,23 @@
   __ str(R2, Address(SP));                 // Should be a free slot.
   __ ldr(R9, Address(SP, 1 * kWordSize));  // R0.  R9 = +1.
   __ ldr(IP, Address(SP, 2 * kWordSize));  // R1.
-  __ sub(R9, R9, Operand(IP));      // -R1. R9 = -6.
+  __ sub(R9, R9, Operand(IP));             // -R1. R9 = -6.
   __ ldr(IP, Address(SP, 3 * kWordSize));  // R2.
-  __ add(R9, R9, Operand(IP));      // +R2. R9 = +5.
+  __ add(R9, R9, Operand(IP));             // +R2. R9 = +5.
   __ ldr(IP, Address(SP, 4 * kWordSize));  // R3.
-  __ sub(R9, R9, Operand(IP));      // -R3. R9 = -26.
+  __ sub(R9, R9, Operand(IP));             // -R3. R9 = -26.
   __ ldm(IB_W, SP, (1 << R0 | 1 << R1 | 1 << R2 | 1 << R3));
   // Same operations again. But this time from the restore registers.
   __ add(R9, R9, Operand(R0));
   __ sub(R9, R9, Operand(R1));
   __ add(R9, R9, Operand(R2));
   __ sub(R0, R9, Operand(R3));  // R0 = result = -52.
-  __ Pop(R1);  // Remove storage slot.
-  __ Pop(R9);  // Restore R9.
-  __ Pop(R9);  // Restore R9.
-  __ Pop(R9);  // Restore R9.
-  __ Pop(R9);  // Restore R9.
-  __ Pop(R9);  // Restore R9.
+  __ Pop(R1);                   // Remove storage slot.
+  __ Pop(R9);                   // Restore R9.
+  __ Pop(R9);                   // Restore R9.
+  __ Pop(R9);                   // Restore R9.
+  __ Pop(R9);                   // Restore R9.
+  __ Pop(R9);                   // Restore R9.
   __ bx(LR);
 }
 
@@ -2979,10 +3131,10 @@
 ASSEMBLER_TEST_GENERATE(Vmvnq, assembler) {
   if (TargetCPUFeatures::neon_supported()) {
     __ LoadImmediate(R1, 42);  // R1 <- 42.
-    __ vmovsr(S2, R1);  // S2 <- R1.
-    __ vmvnq(Q1, Q0);  // Q1 <- ~Q0.
-    __ vmvnq(Q2, Q1);  // Q2 <- ~Q1.
-    __ vmovrs(R0, S10);  // Now R0 should be 42 again.
+    __ vmovsr(S2, R1);         // S2 <- R1.
+    __ vmvnq(Q1, Q0);          // Q1 <- ~Q0.
+    __ vmvnq(Q2, Q1);          // Q2 <- ~Q1.
+    __ vmovrs(R0, S10);        // Now R0 should be 42 again.
   }
   __ bx(LR);
 }
@@ -3517,9 +3669,12 @@
 // This is the same function as in the Simulator.
 static float arm_recip_estimate(float a) {
   // From the ARM Architecture Reference Manual A2-85.
-  if (isinf(a) || (fabs(a) >= exp2f(126))) return 0.0;
-  else if (a == 0.0) return kPosInfinity;
-  else if (isnan(a)) return a;
+  if (isinf(a) || (fabs(a) >= exp2f(126)))
+    return 0.0;
+  else if (a == 0.0)
+    return kPosInfinity;
+  else if (isnan(a))
+    return a;
 
   uint32_t a_bits = bit_cast<uint32_t, float>(a);
   // scaled = '0011 1111 1110' : a<22:0> : Zeros(29)
@@ -3539,7 +3694,7 @@
   // r in units of 1/256 rounded to nearest.
   int32_t s = static_cast<int32_t>(256.0 * r + 0.5);
   double estimate = static_cast<double>(s) / 256.0;
-  ASSERT((estimate >= 1.0) && (estimate <= (511.0/256.0)));
+  ASSERT((estimate >= 1.0) && (estimate <= (511.0 / 256.0)));
 
   // result = sign : result_exp<7:0> : estimate<51:29>
   int32_t result_bits =
@@ -3623,16 +3778,19 @@
   if (TargetCPUFeatures::neon_supported()) {
     typedef float (*Reciprocal)() DART_UNUSED;
     float res = EXECUTE_TEST_CODE_FLOAT(Reciprocal, test->entry());
-    EXPECT_FLOAT_EQ(1.0/147000.0, res, 0.0001f);
+    EXPECT_FLOAT_EQ(1.0 / 147000.0, res, 0.0001f);
   }
 }
 
 
 static float arm_reciprocal_sqrt_estimate(float a) {
   // From the ARM Architecture Reference Manual A2-87.
-  if (isinf(a) || (fabs(a) >= exp2f(126))) return 0.0;
-  else if (a == 0.0) return kPosInfinity;
-  else if (isnan(a)) return a;
+  if (isinf(a) || (fabs(a) >= exp2f(126)))
+    return 0.0;
+  else if (a == 0.0)
+    return kPosInfinity;
+  else if (isnan(a))
+    return a;
 
   uint32_t a_bits = bit_cast<uint32_t, float>(a);
   uint64_t scaled;
@@ -3670,10 +3828,11 @@
   // r in units of 1/256 rounded to nearest.
   int32_t s = static_cast<int>(256.0 * r + 0.5);
   double estimate = static_cast<double>(s) / 256.0;
-  ASSERT((estimate >= 1.0) && (estimate <= (511.0/256.0)));
+  ASSERT((estimate >= 1.0) && (estimate <= (511.0 / 256.0)));
 
   // result = 0 : result_exp<7:0> : estimate<51:29>
-  int32_t result_bits = ((result_exp & 0xff) << 23) |
+  int32_t result_bits =
+      ((result_exp & 0xff) << 23) |
       ((bit_cast<uint64_t, double>(estimate) >> 29) & 0x7fffff);
   return bit_cast<float, int32_t>(result_bits);
 }
@@ -3725,7 +3884,7 @@
   if (TargetCPUFeatures::neon_supported()) {
     typedef float (*Vrsqrtsqs)() DART_UNUSED;
     float res = EXECUTE_TEST_CODE_FLOAT(Vrsqrtsqs, test->entry());
-    EXPECT_FLOAT_EQ((3.0 - 10.0 * 5.0)/2.0, res, 0.0001f);
+    EXPECT_FLOAT_EQ((3.0 - 10.0 * 5.0) / 2.0, res, 0.0001f);
   }
 }
 
@@ -3741,9 +3900,9 @@
     __ vrsqrteqs(Q0, Q1);
     // 2 Newton-Raphson steps. xn+1 = xn * (3 - Q1*xn^2) / 2.
     // First step.
-    __ vmulqs(Q2, Q0, Q0);  // Q2 <- xn^2
+    __ vmulqs(Q2, Q0, Q0);     // Q2 <- xn^2
     __ vrsqrtsqs(Q2, Q1, Q2);  // Q2 <- (3 - Q1*Q2) / 2.
-    __ vmulqs(Q0, Q0, Q2);  // xn+1 <- xn * Q2
+    __ vmulqs(Q0, Q0, Q2);     // xn+1 <- xn * Q2
     // Second step.
     __ vmulqs(Q2, Q0, Q0);
     __ vrsqrtsqs(Q2, Q1, Q2);
@@ -3758,7 +3917,7 @@
   if (TargetCPUFeatures::neon_supported()) {
     typedef float (*ReciprocalSqrt)() DART_UNUSED;
     float res = EXECUTE_TEST_CODE_FLOAT(ReciprocalSqrt, test->entry());
-    EXPECT_FLOAT_EQ(1.0/sqrt(147000.0), res, 0.0001f);
+    EXPECT_FLOAT_EQ(1.0 / sqrt(147000.0), res, 0.0001f);
   }
 }
 
@@ -3774,9 +3933,9 @@
     __ vrsqrteqs(Q0, Q1);
     // 2 Newton-Raphson steps. xn+1 = xn * (3 - Q1*xn^2) / 2.
     // First step.
-    __ vmulqs(Q2, Q0, Q0);  // Q2 <- xn^2
+    __ vmulqs(Q2, Q0, Q0);     // Q2 <- xn^2
     __ vrsqrtsqs(Q2, Q1, Q2);  // Q2 <- (3 - Q1*Q2) / 2.
-    __ vmulqs(Q0, Q0, Q2);  // xn+1 <- xn * Q2
+    __ vmulqs(Q0, Q0, Q2);     // xn+1 <- xn * Q2
     // Second step.
     __ vmulqs(Q2, Q0, Q0);
     __ vrsqrtsqs(Q2, Q1, Q2);
@@ -3817,9 +3976,9 @@
     __ vrsqrteqs(Q0, Q1);
     // 2 Newton-Raphson steps. xn+1 = xn * (3 - Q1*xn^2) / 2.
     // First step.
-    __ vmulqs(Q2, Q0, Q0);  // Q2 <- xn^2
+    __ vmulqs(Q2, Q0, Q0);     // Q2 <- xn^2
     __ vrsqrtsqs(Q2, Q1, Q2);  // Q2 <- (3 - Q1*Q2) / 2.
-    __ vmulqs(Q0, Q0, Q2);  // xn+1 <- xn * Q2
+    __ vmulqs(Q0, Q0, Q2);     // xn+1 <- xn * Q2
     // Second step.
     __ vmulqs(Q2, Q0, Q0);
     __ vrsqrtsqs(Q2, Q1, Q2);
@@ -3954,8 +4113,7 @@
 ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) {
   __ PushList((1 << LR) | (1 << THR));
   __ mov(THR, Operand(R2));
-  __ StoreIntoObject(R1,
-                     FieldAddress(R1, GrowableObjectArray::data_offset()),
+  __ StoreIntoObject(R1, FieldAddress(R1, GrowableObjectArray::data_offset()),
                      R0);
   __ PopList((1 << LR) | (1 << THR));
   __ Ret();
diff --git a/runtime/vm/assembler_dbc.cc b/runtime/vm/assembler_dbc.cc
index f35d1d5..73beb06 100644
--- a/runtime/vm/assembler_dbc.cc
+++ b/runtime/vm/assembler_dbc.cc
@@ -26,11 +26,10 @@
   }
 }
 
-#define DEFINE_EMIT(Name, Signature, Fmt0, Fmt1, Fmt2)  \
-  void Assembler::Name(PARAMS_##Signature) {            \
-    Emit(Bytecode::FENCODE_##Signature(                 \
-        Bytecode::k##Name ENCODE_##Signature));         \
-  }                                                     \
+#define DEFINE_EMIT(Name, Signature, Fmt0, Fmt1, Fmt2)                         \
+  void Assembler::Name(PARAMS_##Signature) {                                   \
+    Emit(Bytecode::FENCODE_##Signature(Bytecode::k##Name ENCODE_##Signature)); \
+  }
 
 
 #define PARAMS_0
@@ -131,8 +130,7 @@
 
 
 intptr_t Assembler::AddConstant(const Object& obj) {
-  return object_pool_wrapper().FindObject(
-      Object::ZoneHandle(obj.raw()));
+  return object_pool_wrapper().FindObject(Object::ZoneHandle(obj.raw()));
 }
 
 
diff --git a/runtime/vm/assembler_dbc.h b/runtime/vm/assembler_dbc.h
index 7e23863..dbe8216 100644
--- a/runtime/vm/assembler_dbc.h
+++ b/runtime/vm/assembler_dbc.h
@@ -2,10 +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.
 
-#ifndef VM_ASSEMBLER_DBC_H_
-#define VM_ASSEMBLER_DBC_H_
+#ifndef RUNTIME_VM_ASSEMBLER_DBC_H_
+#define RUNTIME_VM_ASSEMBLER_DBC_H_
 
-#ifndef VM_ASSEMBLER_H_
+#ifndef RUNTIME_VM_ASSEMBLER_H_
 #error Do not include assembler_dbc.h directly; use assembler.h instead.
 #endif
 
@@ -29,7 +29,7 @@
 
 class Label : public ValueObject {
  public:
-  Label() : position_(0) { }
+  Label() : position_(0) {}
 
   ~Label() {
     // Assert if label is being destroyed with unresolved branches pending.
@@ -50,9 +50,7 @@
  private:
   intptr_t position_;
 
-  void Reinitialize() {
-    position_ = 0;
-  }
+  void Reinitialize() { position_ = 0; }
 
   void BindTo(intptr_t position) {
     ASSERT(!IsBound());
@@ -73,12 +71,9 @@
 
 class Assembler : public ValueObject {
  public:
-  explicit Assembler(bool use_far_branches = false)
-      : buffer_(),
-        comments_() {
-  }
+  explicit Assembler(bool use_far_branches = false) : buffer_(), comments_() {}
 
-  ~Assembler() { }
+  ~Assembler() {}
 
   void Bind(Label* label);
   void Jump(Label* label);
@@ -86,6 +81,7 @@
   // Misc. functionality
   intptr_t CodeSize() const { return buffer_.Size(); }
   intptr_t prologue_offset() const { return 0; }
+  bool has_single_entry_point() const { return true; }
 
   // Count the fixups that produce a pointer offset, without processing
   // the fixups.
@@ -121,20 +117,16 @@
 
   static const char* RegisterName(Register reg);
 
-  static const char* FpuRegisterName(FpuRegister reg) {
-    return "?";
-  }
+  static const char* FpuRegisterName(FpuRegister reg) { return "?"; }
 
-  static uword GetBreakInstructionFiller() {
-    return Bytecode::kTrap;
-  }
+  static uword GetBreakInstructionFiller() { return Bytecode::kTrap; }
 
   static bool IsSafe(const Object& value) { return true; }
   static bool IsSafeSmi(const Object& value) { return false; }
 
-  // Bytecodes.
+// Bytecodes.
 
-#define DECLARE_EMIT(Name, Signature, Fmt0, Fmt1, Fmt2) \
+#define DECLARE_EMIT(Name, Signature, Fmt0, Fmt1, Fmt2)                        \
   void Name(PARAMS_##Signature);
 
 #define PARAMS_0
@@ -175,7 +167,7 @@
   class CodeComment : public ZoneAllocated {
    public:
     CodeComment(intptr_t pc_offset, const String& comment)
-        : pc_offset_(pc_offset), comment_(comment) { }
+        : pc_offset_(pc_offset), comment_(comment) {}
 
     intptr_t pc_offset() const { return pc_offset_; }
     const String& comment() const { return comment_; }
@@ -196,4 +188,4 @@
 
 }  // namespace dart
 
-#endif  // VM_ASSEMBLER_DBC_H_
+#endif  // RUNTIME_VM_ASSEMBLER_DBC_H_
diff --git a/runtime/vm/assembler_dbc_test.cc b/runtime/vm/assembler_dbc_test.cc
index 254f638..a8d2fdf 100644
--- a/runtime/vm/assembler_dbc_test.cc
+++ b/runtime/vm/assembler_dbc_test.cc
@@ -14,22 +14,19 @@
 static RawObject* ExecuteTest(const Code& code) {
   Thread* thread = Thread::Current();
   TransitionToGenerated transition(thread);
-  return Simulator::Current()->Call(
-      code,
-      Array::Handle(ArgumentsDescriptor::New(0)),
-      Array::Handle(Array::New(0)),
-      thread);
+  return Simulator::Current()->Call(code,
+                                    Array::Handle(ArgumentsDescriptor::New(0)),
+                                    Array::Handle(Array::New(0)), thread);
 }
 
 
 #define EXECUTE_TEST_CODE_INTPTR(code)                                         \
-    Smi::Value(Smi::RawCast(ExecuteTest(code)))
+  Smi::Value(Smi::RawCast(ExecuteTest(code)))
 #define EXECUTE_TEST_CODE_BOOL(code)                                           \
-    (Bool::RawCast(ExecuteTest(code)) == Bool::True().raw())
-#define EXECUTE_TEST_CODE_OBJECT(code)                                         \
-    Object::Handle(ExecuteTest(code))
+  (Bool::RawCast(ExecuteTest(code)) == Bool::True().raw())
+#define EXECUTE_TEST_CODE_OBJECT(code) Object::Handle(ExecuteTest(code))
 #define EXECUTE_TEST_CODE_DOUBLE(code)                                         \
-    bit_cast<double, RawObject*>(ExecuteTest(code))
+  bit_cast<double, RawObject*>(ExecuteTest(code))
 
 #define __ assembler->
 
@@ -55,12 +52,11 @@
   const Script& script = Script::Handle();
   const Class& owner_class =
       Class::Handle(CreateDummyClass(class_name, script));
-  const Library& owner_library =
-      Library::Handle(CreateDummyLibrary(lib_name));
+  const Library& owner_library = Library::Handle(CreateDummyLibrary(lib_name));
   owner_class.set_library(owner_library);
   const String& function_name = String::ZoneHandle(Symbols::New(thread, name));
-  return Function::New(function_name, RawFunction::kRegularFunction,
-                       true, false, false, false, false, owner_class,
+  return Function::New(function_name, RawFunction::kRegularFunction, true,
+                       false, false, false, false, owner_class,
                        TokenPosition::kMinSource);
 }
 
@@ -86,11 +82,8 @@
   const Array& dummy_arguments_descriptor =
       Array::Handle(ArgumentsDescriptor::New(2));
   const ICData& ic_data = ICData::Handle(ICData::New(
-      dummy_instance_function,
-      String::Handle(dummy_instance_function.name()),
-      dummy_arguments_descriptor,
-      Thread::kNoDeoptId,
-      2,
+      dummy_instance_function, String::Handle(dummy_instance_function.name()),
+      dummy_arguments_descriptor, Thread::kNoDeoptId, 2,
       /* is_static_call= */ false));
 
   // Wire up the Function in the ICData.
@@ -1736,7 +1729,6 @@
 }
 
 
-
 //  - CheckSmi rA
 //
 //    If FP[rA] is a Smi, then skip the next instruction.
diff --git a/runtime/vm/assembler_ia32.cc b/runtime/vm/assembler_ia32.cc
index bb57905..713365d 100644
--- a/runtime/vm/assembler_ia32.cc
+++ b/runtime/vm/assembler_ia32.cc
@@ -35,8 +35,8 @@
 
 int32_t Assembler::jit_cookie() {
   if (jit_cookie_ == 0) {
-    jit_cookie_ = static_cast<int32_t>(
-        Isolate::Current()->random()->NextUInt32());
+    jit_cookie_ =
+        static_cast<int32_t>(Isolate::Current()->random()->NextUInt32());
   }
   return jit_cookie_;
 }
@@ -666,10 +666,8 @@
     uint32_t b;
     uint32_t c;
     uint32_t d;
-  } float_not_constant =
-      { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
-  xorps(dst,
-    Address::Absolute(reinterpret_cast<uword>(&float_not_constant)));
+  } float_not_constant = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
+  xorps(dst, Address::Absolute(reinterpret_cast<uword>(&float_not_constant)));
 }
 
 
@@ -679,8 +677,7 @@
     uint32_t b;
     uint32_t c;
     uint32_t d;
-  } float_negate_constant =
-      { 0x80000000, 0x80000000, 0x80000000, 0x80000000 };
+  } float_negate_constant = {0x80000000, 0x80000000, 0x80000000, 0x80000000};
   xorps(dst,
         Address::Absolute(reinterpret_cast<uword>(&float_negate_constant)));
 }
@@ -692,8 +689,7 @@
     uint32_t b;
     uint32_t c;
     uint32_t d;
-  } float_absolute_constant =
-      { 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF };
+  } float_absolute_constant = {0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF};
   andps(dst,
         Address::Absolute(reinterpret_cast<uword>(&float_absolute_constant)));
 }
@@ -705,8 +701,7 @@
     uint32_t b;
     uint32_t c;
     uint32_t d;
-  } float_zerow_constant =
-      { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000 };
+  } float_zerow_constant = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000};
   andps(dst, Address::Absolute(reinterpret_cast<uword>(&float_zerow_constant)));
 }
 
@@ -872,8 +867,7 @@
   static const struct ALIGN16 {
     uint64_t a;
     uint64_t b;
-  } double_negate_constant =
-      { 0x8000000000000000LL, 0x8000000000000000LL };
+  } double_negate_constant = {0x8000000000000000LL, 0x8000000000000000LL};
   xorpd(dst,
         Address::Absolute(reinterpret_cast<uword>(&double_negate_constant)));
 }
@@ -910,8 +904,7 @@
   static const struct ALIGN16 {
     uint64_t a;
     uint64_t b;
-  } double_absolute_constant =
-      { 0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFFLL };
+  } double_absolute_constant = {0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFFLL};
   andpd(dst,
         Address::Absolute(reinterpret_cast<uword>(&double_absolute_constant)));
 }
@@ -2252,9 +2245,8 @@
   // Mask out higher, uninteresting bits which were polluted by dest.
   andl(value, Immediate(kObjectAlignment - 1));
   // Compare with the expected bit pattern.
-  cmpl(value, Immediate(
-      (kNewObjectAlignmentOffset >> 1) + kHeapObjectTag +
-      kOldObjectAlignmentOffset + kHeapObjectTag));
+  cmpl(value, Immediate((kNewObjectAlignmentOffset >> 1) + kHeapObjectTag +
+                        kOldObjectAlignmentOffset + kHeapObjectTag));
   j(NOT_ZERO, no_update, Assembler::kNearJump);
 }
 
@@ -2373,8 +2365,7 @@
     uint32_t b;
     uint32_t c;
     uint32_t d;
-  } float_negate_constant =
-      { 0x80000000, 0x00000000, 0x80000000, 0x00000000 };
+  } float_negate_constant = {0x80000000, 0x00000000, 0x80000000, 0x00000000};
   xorps(f, Address::Absolute(reinterpret_cast<uword>(&float_negate_constant)));
 }
 
@@ -2383,8 +2374,7 @@
   static const struct ALIGN16 {
     uint64_t a;
     uint64_t b;
-  } double_negate_constant =
-      {0x8000000000000000LL, 0x8000000000000000LL};
+  } double_negate_constant = {0x8000000000000000LL, 0x8000000000000000LL};
   xorpd(d, Address::Absolute(reinterpret_cast<uword>(&double_negate_constant)));
 }
 
@@ -2393,8 +2383,7 @@
   static const struct ALIGN16 {
     uint64_t a;
     uint64_t b;
-  } double_abs_constant =
-      {0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFFLL};
+  } double_abs_constant = {0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFFLL};
   andpd(reg, Address::Absolute(reinterpret_cast<uword>(&double_abs_constant)));
 }
 
@@ -2438,14 +2427,12 @@
 
 static const intptr_t kNumberOfVolatileCpuRegisters = 3;
 static const Register volatile_cpu_registers[kNumberOfVolatileCpuRegisters] = {
-    EAX, ECX, EDX
-};
+    EAX, ECX, EDX};
 
 
 // XMM0 is used only as a scratch register in the optimized code. No need to
 // save it.
-static const intptr_t kNumberOfVolatileXmmRegisters =
-    kNumberOfXmmRegisters - 1;
+static const intptr_t kNumberOfVolatileXmmRegisters = kNumberOfXmmRegisters - 1;
 
 
 void Assembler::EnterCallRuntimeFrame(intptr_t frame_space) {
@@ -2546,7 +2533,7 @@
   if (bytes_needed) {
     nop(bytes_needed);
   }
-  ASSERT(((offset + buffer_.GetPosition()) & (alignment-1)) == 0);
+  ASSERT(((offset + buffer_.GetPosition()) & (alignment - 1)) == 0);
 }
 
 
@@ -2642,7 +2629,7 @@
     // (i.e. the allocation stub) which will allocate the object and trace the
     // allocation call site.
     NOT_IN_PRODUCT(
-      MaybeTraceAllocation(cls.id(), temp_reg, failure, near_jump));
+        MaybeTraceAllocation(cls.id(), temp_reg, failure, near_jump));
     const intptr_t instance_size = cls.instance_size();
     Heap::Space space = Heap::kNew;
     movl(temp_reg, Address(THR, Thread::heap_offset()));
@@ -2760,7 +2747,7 @@
     pushl(EAX);  // Preserve EAX.
     movl(EAX, Immediate(reinterpret_cast<int32_t>(message)));
     Call(*StubCode::PrintStopMessage_entry());  // Passing message in EAX.
-    popl(EAX);  // Restore EAX.
+    popl(EAX);                                  // Restore EAX.
   } else {
     // Emit the message address as immediate operand in the test instruction.
     testl(EAX, Immediate(reinterpret_cast<int32_t>(message)));
@@ -2837,9 +2824,7 @@
 }
 
 
-void Assembler::EmitGenericShift(int rm,
-                                 Register reg,
-                                 const Immediate& imm) {
+void Assembler::EmitGenericShift(int rm, Register reg, const Immediate& imm) {
   AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   ASSERT(imm.is_int8());
   if (imm.value() == 1) {
@@ -2866,8 +2851,8 @@
 void Assembler::LoadClassId(Register result, Register object) {
   ASSERT(RawObject::kClassIdTagPos == 16);
   ASSERT(RawObject::kClassIdTagSize == 16);
-  const intptr_t class_id_offset = Object::tags_offset() +
-      RawObject::kClassIdTagPos / kBitsPerByte;
+  const intptr_t class_id_offset =
+      Object::tags_offset() + RawObject::kClassIdTagPos / kBitsPerByte;
   movzxw(result, FieldAddress(object, class_id_offset));
 }
 
@@ -2904,8 +2889,8 @@
   ASSERT(kSmiTagShift == 1);
   ASSERT(RawObject::kClassIdTagPos == 16);
   ASSERT(RawObject::kClassIdTagSize == 16);
-  const intptr_t class_id_offset = Object::tags_offset() +
-      RawObject::kClassIdTagPos / kBitsPerByte;
+  const intptr_t class_id_offset =
+      Object::tags_offset() + RawObject::kClassIdTagPos / kBitsPerByte;
 
   // Untag optimistically. Tag bit is shifted into the CARRY.
   SmiUntag(object);
@@ -2950,7 +2935,7 @@
     return Address(array, index * index_scale);
   } else {
     const int64_t disp = static_cast<int64_t>(index) * index_scale +
-        Instance::DataOffsetFor(cid);
+                         Instance::DataOffsetFor(cid);
     ASSERT(Utils::IsInt(32, disp));
     return FieldAddress(array, static_cast<int32_t>(disp));
   }
@@ -2963,11 +2948,16 @@
   // expected to be untagged before accessing.
   ASSERT(kSmiTagShift == 1);
   switch (index_scale) {
-    case 1: return TIMES_1;
-    case 2: return TIMES_1;
-    case 4: return TIMES_2;
-    case 8: return TIMES_4;
-    case 16: return TIMES_8;
+    case 1:
+      return TIMES_1;
+    case 2:
+      return TIMES_1;
+    case 4:
+      return TIMES_2;
+    case 8:
+      return TIMES_4;
+    case 16:
+      return TIMES_8;
     default:
       UNREACHABLE();
       return TIMES_1;
@@ -2976,24 +2966,21 @@
 
 
 Address Assembler::ElementAddressForRegIndex(bool is_external,
-                                            intptr_t cid,
-                                            intptr_t index_scale,
-                                            Register array,
-                                            Register index) {
+                                             intptr_t cid,
+                                             intptr_t index_scale,
+                                             Register array,
+                                             Register index) {
   if (is_external) {
     return Address(array, index, ToScaleFactor(index_scale), 0);
   } else {
-    return FieldAddress(array,
-                        index,
-                        ToScaleFactor(index_scale),
+    return FieldAddress(array, index, ToScaleFactor(index_scale),
                         Instance::DataOffsetFor(cid));
   }
 }
 
 
 static const char* cpu_reg_names[kNumberOfCpuRegisters] = {
-  "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi"
-};
+    "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi"};
 
 
 const char* Assembler::RegisterName(Register reg) {
@@ -3003,8 +2990,7 @@
 
 
 static const char* xmm_reg_names[kNumberOfXmmRegisters] = {
-  "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7"
-};
+    "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7"};
 
 
 const char* Assembler::FpuRegisterName(FpuRegister reg) {
diff --git a/runtime/vm/assembler_ia32.h b/runtime/vm/assembler_ia32.h
index df3d6ff..90214f5 100644
--- a/runtime/vm/assembler_ia32.h
+++ b/runtime/vm/assembler_ia32.h
@@ -2,10 +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.
 
-#ifndef VM_ASSEMBLER_IA32_H_
-#define VM_ASSEMBLER_IA32_H_
+#ifndef RUNTIME_VM_ASSEMBLER_IA32_H_
+#define RUNTIME_VM_ASSEMBLER_IA32_H_
 
-#ifndef VM_ASSEMBLER_H_
+#ifndef RUNTIME_VM_ASSEMBLER_H_
 #error Do not include assembler_ia32.h directly; use assembler.h instead.
 #endif
 
@@ -21,9 +21,9 @@
 
 class Immediate : public ValueObject {
  public:
-  explicit Immediate(int32_t value) : value_(value) { }
+  explicit Immediate(int32_t value) : value_(value) {}
 
-  Immediate(const Immediate& other) : ValueObject(), value_(other.value_) { }
+  Immediate(const Immediate& other) : ValueObject(), value_(other.value_) {}
 
   int32_t value() const { return value_; }
 
@@ -42,13 +42,9 @@
 
 class Operand : public ValueObject {
  public:
-  uint8_t mod() const {
-    return (encoding_at(0) >> 6) & 3;
-  }
+  uint8_t mod() const { return (encoding_at(0) >> 6) & 3; }
 
-  Register rm() const {
-    return static_cast<Register>(encoding_at(0) & 7);
-  }
+  Register rm() const { return static_cast<Register>(encoding_at(0) & 7); }
 
   ScaleFactor scale() const {
     return static_cast<ScaleFactor>((encoding_at(1) >> 6) & 3);
@@ -58,9 +54,7 @@
     return static_cast<Register>((encoding_at(1) >> 3) & 7);
   }
 
-  Register base() const {
-    return static_cast<Register>(encoding_at(1) & 7);
-  }
+  Register base() const { return static_cast<Register>(encoding_at(1) & 7); }
 
   int8_t disp8() const {
     ASSERT(length_ >= 2);
@@ -91,7 +85,7 @@
   }
 
  protected:
-  Operand() : length_(0) { }  // Needed by subclass Address.
+  Operand() : length_(0) {}  // Needed by subclass Address.
 
   void SetModRM(int mod, Register rm) {
     ASSERT((mod & ~3) == 0);
@@ -135,7 +129,7 @@
   // disguise. Used from the assembler to generate better encodings.
   bool IsRegister(Register reg) const {
     return ((encoding_[0] & 0xF8) == 0xC0)  // Addressing mode is register only.
-        && ((encoding_[0] & 0x07) == reg);  // Register codes match.
+           && ((encoding_[0] & 0x07) == reg);  // Register codes match.
   }
 
   friend class Assembler;
@@ -188,7 +182,7 @@
   // This addressing mode does not exist.
   Address(Register base, Register index, ScaleFactor scale, Register r);
 
-  Address(const Address& other) : Operand(other) { }
+  Address(const Address& other) : Operand(other) {}
 
   Address& operator=(const Address& other) {
     Operand::operator=(other);
@@ -203,25 +197,25 @@
   }
 
  private:
-  Address() { }  // Needed by Address::Absolute.
+  Address() {}  // Needed by Address::Absolute.
 };
 
 
 class FieldAddress : public Address {
  public:
   FieldAddress(Register base, int32_t disp)
-      : Address(base, disp - kHeapObjectTag) { }
+      : Address(base, disp - kHeapObjectTag) {}
 
   // This addressing mode does not exist.
   FieldAddress(Register base, Register r);
 
   FieldAddress(Register base, Register index, ScaleFactor scale, int32_t disp)
-      : Address(base, index, scale, disp - kHeapObjectTag) { }
+      : Address(base, index, scale, disp - kHeapObjectTag) {}
 
   // This addressing mode does not exist.
   FieldAddress(Register base, Register index, ScaleFactor scale, Register r);
 
-  FieldAddress(const FieldAddress& other) : Address(other) { }
+  FieldAddress(const FieldAddress& other) : Address(other) {}
 
   FieldAddress& operator=(const FieldAddress& other) {
     Address::operator=(other);
@@ -310,7 +304,7 @@
     // This mode is only needed and implemented for MIPS and ARM.
     ASSERT(!use_far_branches);
   }
-  ~Assembler() { }
+  ~Assembler() {}
 
   static const bool kNearJump = true;
   static const bool kFarJump = false;
@@ -498,9 +492,9 @@
 
   enum RoundingMode {
     kRoundToNearest = 0x0,
-    kRoundDown      = 0x1,
-    kRoundUp        = 0x2,
-    kRoundToZero    = 0x3
+    kRoundDown = 0x1,
+    kRoundUp = 0x2,
+    kRoundToZero = 0x3
   };
   void roundsd(XmmRegister dst, XmmRegister src, RoundingMode mode);
 
@@ -632,9 +626,7 @@
   void int3();
   void hlt();
 
-  static uword GetBreakInstructionFiller() {
-    return 0xCCCCCCCC;
-  }
+  static uword GetBreakInstructionFiller() { return 0xCCCCCCCC; }
 
   void j(Condition condition, Label* label, bool near = kFarJump);
   void j(Condition condition, const ExternalLabel* label);
@@ -675,9 +667,9 @@
   void CompareObject(Register reg, const Object& object);
   void LoadDoubleConstant(XmmRegister dst, double value);
 
-  void StoreIntoObject(Register object,  // Object we are storing into.
+  void StoreIntoObject(Register object,      // Object we are storing into.
                        const Address& dest,  // Where we are storing into.
-                       Register value,  // Value we are storing.
+                       Register value,       // Value we are storing.
                        bool can_value_be_smi = true);
 
   void StoreIntoObjectNoBarrier(Register object,
@@ -759,13 +751,9 @@
   /*
    * Misc. functionality
    */
-  void SmiTag(Register reg) {
-    addl(reg, reg);
-  }
+  void SmiTag(Register reg) { addl(reg, reg); }
 
-  void SmiUntag(Register reg) {
-    sarl(reg, Immediate(kSmiTagSize));
-  }
+  void SmiUntag(Register reg) { sarl(reg, Immediate(kSmiTagSize)); }
 
   void BranchIfNotSmi(Register reg, Label* label) {
     testl(reg, Immediate(kSmiTagMask));
@@ -777,18 +765,15 @@
   void Jump(Label* label) { jmp(label); }
 
   // Address of code at offset.
-  uword CodeAddress(intptr_t offset) {
-    return buffer_.Address(offset);
-  }
+  uword CodeAddress(intptr_t offset) { return buffer_.Address(offset); }
 
   intptr_t CodeSize() const { return buffer_.Size(); }
   intptr_t prologue_offset() const { return prologue_offset_; }
+  bool has_single_entry_point() const { return true; }
 
   // Count the fixups that produce a pointer offset, without processing
   // the fixups.
-  intptr_t CountPointerOffsets() const {
-    return buffer_.CountPointerOffsets();
-  }
+  intptr_t CountPointerOffsets() const { return buffer_.CountPointerOffsets(); }
   const ZoneGrowableArray<intptr_t>& GetPointerOffsets() const {
     return buffer_.pointer_offsets();
   }
@@ -931,9 +916,7 @@
     return !object.IsSmi() || IsSafeSmi(object);
   }
 
-  void set_code_object(const Code& code) {
-    code_ ^= code.raw();
-  }
+  void set_code_object(const Code& code) { code_ ^= code.raw(); }
 
   void PushCodeObject();
 
@@ -941,7 +924,7 @@
   class CodeComment : public ZoneAllocated {
    public:
     CodeComment(intptr_t pc_offset, const String& comment)
-        : pc_offset_(pc_offset), comment_(comment) { }
+        : pc_offset_(pc_offset), comment_(comment) {}
 
     intptr_t pc_offset() const { return pc_offset_; }
     const String& comment() const { return comment_; }
@@ -1025,4 +1008,4 @@
 
 }  // namespace dart
 
-#endif  // VM_ASSEMBLER_IA32_H_
+#endif  // RUNTIME_VM_ASSEMBLER_IA32_H_
diff --git a/runtime/vm/assembler_ia32_test.cc b/runtime/vm/assembler_ia32_test.cc
index 116cc9e..4ea1c65 100644
--- a/runtime/vm/assembler_ia32_test.cc
+++ b/runtime/vm/assembler_ia32_test.cc
@@ -107,8 +107,7 @@
 ASSEMBLER_TEST_GENERATE(JumpAroundCrash, assembler) {
   Label done;
   // Make sure all the condition jumps work.
-  for (Condition condition = OVERFLOW;
-       condition <= GREATER;
+  for (Condition condition = OVERFLOW; condition <= GREATER;
        condition = static_cast<Condition>(condition + 1)) {
     __ j(condition, &done);
   }
@@ -136,8 +135,7 @@
 ASSEMBLER_TEST_GENERATE(NearJumpAroundCrash, assembler) {
   Label done;
   // Make sure all the condition jumps work.
-  for (Condition condition = OVERFLOW;
-       condition <= GREATER;
+  for (Condition condition = OVERFLOW; condition <= GREATER;
        condition = static_cast<Condition>(condition + 1)) {
     __ j(condition, &done, Assembler::kNearJump);
   }
@@ -359,7 +357,7 @@
 ASSEMBLER_TEST_GENERATE(MoveExtend, assembler) {
   __ pushl(EBX);  // preserve EBX.
   __ movl(EDX, Immediate(0x1234ffff));
-  __ movzxb(EAX, DL);  // EAX = 0xff
+  __ movzxb(EAX, DL);   // EAX = 0xff
   __ movsxw(EBX, EDX);  // EBX = -1
   __ movzxw(ECX, EDX);  // ECX = 0xffff
   __ addl(EBX, ECX);
@@ -409,16 +407,16 @@
   __ andl(ECX, EAX);  // 0x740.
   __ pushl(Immediate(0xF6FF));
   __ andl(ECX, Address(ESP, 0));  // 0x640.
-  __ popl(EAX);  // Discard.
+  __ popl(EAX);                   // Discard.
   __ movl(EAX, Immediate(1));
   __ orl(ECX, EAX);  // 0x641.
   __ pushl(Immediate(0x7));
   __ orl(ECX, Address(ESP, 0));  // 0x647.
-  __ popl(EAX);  // Discard.
-  __ xorl(ECX, Immediate(0));  // 0x647.
+  __ popl(EAX);                  // Discard.
+  __ xorl(ECX, Immediate(0));    // 0x647.
   __ pushl(Immediate(0x1C));
   __ xorl(ECX, Address(ESP, 0));  // 0x65B.
-  __ popl(EAX);  // Discard.
+  __ popl(EAX);                   // Discard.
   __ movl(EAX, Address(ESP, kWordSize));
   __ movl(EDX, Immediate(0xB0));
   __ orl(Address(EAX, 0), EDX);
@@ -776,8 +774,9 @@
 
 static int ComputeStackSpaceReservation(int needed, int fixed) {
   return (OS::ActivationFrameAlignment() > 1)
-      ? Utils::RoundUp(needed + fixed, OS::ActivationFrameAlignment()) - fixed
-      : needed;
+             ? Utils::RoundUp(needed + fixed, OS::ActivationFrameAlignment()) -
+                   fixed
+             : needed;
 }
 
 
@@ -880,7 +879,6 @@
 }
 
 
-
 ASSEMBLER_TEST_GENERATE(SingleFPMoves2, assembler) {
   __ pushl(EBX);  // preserve EBX.
   __ pushl(ECX);  // preserve ECX.
@@ -955,10 +953,10 @@
   __ movl(EAX, Immediate(bit_cast<int32_t, float>(3.4f)));
   __ movd(XMM1, EAX);
   __ shufps(XMM1, XMM1, Immediate(0x0));
-  __ addps(XMM0, XMM1);  // 15.7f
-  __ mulps(XMM0, XMM1);  // 53.38f
-  __ subps(XMM0, XMM1);  // 49.98f
-  __ divps(XMM0, XMM1);  // 14.7f
+  __ addps(XMM0, XMM1);                    // 15.7f
+  __ mulps(XMM0, XMM1);                    // 53.38f
+  __ subps(XMM0, XMM1);                    // 49.98f
+  __ divps(XMM0, XMM1);                    // 14.7f
   __ shufps(XMM0, XMM0, Immediate(0x55));  // Copy second lane into all 4 lanes.
   __ pushl(EAX);
   // Copy the low lane at ESP.
@@ -1006,11 +1004,11 @@
   __ movd(XMM0, EAX);
   __ shufps(XMM0, XMM0, Immediate(0x0));
 
-  __ movaps(XMM1, XMM0);  // Copy XMM0
-  __ reciprocalps(XMM1);  // 0.25
-  __ sqrtps(XMM1);  // 0.5
-  __ rsqrtps(XMM0);  // ~0.5
-  __ subps(XMM0, XMM1);  // ~0.0
+  __ movaps(XMM1, XMM0);                   // Copy XMM0
+  __ reciprocalps(XMM1);                   // 0.25
+  __ sqrtps(XMM1);                         // 0.5
+  __ rsqrtps(XMM0);                        // ~0.5
+  __ subps(XMM0, XMM1);                    // ~0.0
   __ shufps(XMM0, XMM0, Immediate(0x00));  // Copy second lane into all 4 lanes.
   __ pushl(EAX);
   // Copy the low lane at ESP.
@@ -1258,15 +1256,13 @@
     uint32_t b;
     uint32_t c;
     uint32_t d;
-  } constant1 =
-      { 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0 };
+  } constant1 = {0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0};
   static const struct ALIGN16 {
     uint32_t a;
     uint32_t b;
     uint32_t c;
     uint32_t d;
-  } constant2 =
-      { 0x0F0F0F0F, 0x0F0F0F0F, 0x0F0F0F0F, 0x0F0F0F0F };
+  } constant2 = {0x0F0F0F0F, 0x0F0F0F0F, 0x0F0F0F0F, 0x0F0F0F0F};
   __ movups(XMM0, Address::Absolute(reinterpret_cast<uword>(&constant1)));
   __ movups(XMM1, Address::Absolute(reinterpret_cast<uword>(&constant2)));
   __ orps(XMM0, XMM1);
@@ -1292,15 +1288,13 @@
     uint32_t b;
     uint32_t c;
     uint32_t d;
-  } constant1 =
-      { 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0 };
+  } constant1 = {0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0};
   static const struct ALIGN16 {
     uint32_t a;
     uint32_t b;
     uint32_t c;
     uint32_t d;
-  } constant2 =
-      { 0x0F0FFF0F, 0x0F0F0F0F, 0x0F0F0F0F, 0x0F0F0F0F };
+  } constant2 = {0x0F0FFF0F, 0x0F0F0F0F, 0x0F0F0F0F, 0x0F0F0F0F};
   __ movups(XMM0, Address::Absolute(reinterpret_cast<uword>(&constant1)));
   __ andps(XMM0, Address::Absolute(reinterpret_cast<uword>(&constant2)));
   // Copy the low lane at ESP.
@@ -1325,8 +1319,7 @@
     uint32_t b;
     uint32_t c;
     uint32_t d;
-  } constant1 =
-      { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
+  } constant1 = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
   __ movups(XMM0, Address::Absolute(reinterpret_cast<uword>(&constant1)));
   __ notps(XMM0);
   // Copy the low lane at ESP.
@@ -1351,13 +1344,13 @@
     float b;
     float c;
     float d;
-  } constant0 = { 1.0, 2.0, 3.0, 4.0 };
+  } constant0 = {1.0, 2.0, 3.0, 4.0};
   static const struct ALIGN16 {
     float a;
     float b;
     float c;
     float d;
-  } constant1 = { 5.0, 6.0, 7.0, 8.0 };
+  } constant1 = {5.0, 6.0, 7.0, 8.0};
   // XMM0 = 1.0f, 2.0f, 3.0f, 4.0f.
   __ movups(XMM0, Address::Absolute(reinterpret_cast<uword>(&constant0)));
   // XMM1 = 5.0f, 6.0f, 7.0f, 8.0f.
@@ -1369,7 +1362,7 @@
   __ movaps(XMM1, XMM0);
   __ shufps(XMM0, XMM0, Immediate(0x00));  // 7.0f.
   __ shufps(XMM1, XMM1, Immediate(0x55));  // 8.0f.
-  __ addss(XMM0, XMM1);  // 15.0f.
+  __ addss(XMM0, XMM1);                    // 15.0f.
   __ pushl(EAX);
   __ movss(Address(ESP, 0), XMM0);
   __ flds(Address(ESP, 0));
@@ -1391,13 +1384,13 @@
     float b;
     float c;
     float d;
-  } constant0 = { 1.0, 2.0, 3.0, 4.0 };
+  } constant0 = {1.0, 2.0, 3.0, 4.0};
   static const struct ALIGN16 {
     float a;
     float b;
     float c;
     float d;
-  } constant1 = { 5.0, 6.0, 7.0, 8.0 };
+  } constant1 = {5.0, 6.0, 7.0, 8.0};
   // XMM0 = 1.0f, 2.0f, 3.0f, 4.0f.
   __ movups(XMM0, Address::Absolute(reinterpret_cast<uword>(&constant0)));
   // XMM1 = 5.0f, 6.0f, 7.0f, 8.0f.
@@ -1409,7 +1402,7 @@
   __ movaps(XMM1, XMM0);
   __ shufps(XMM0, XMM0, Immediate(0xAA));  // 5.0f.
   __ shufps(XMM1, XMM1, Immediate(0xFF));  // 6.0f.
-  __ addss(XMM0, XMM1);  // 11.0f.
+  __ addss(XMM0, XMM1);                    // 11.0f.
   __ pushl(EAX);
   __ movss(Address(ESP, 0), XMM0);
   __ flds(Address(ESP, 0));
@@ -1431,13 +1424,13 @@
     float b;
     float c;
     float d;
-  } constant0 = { 1.0, 2.0, 3.0, 4.0 };
+  } constant0 = {1.0, 2.0, 3.0, 4.0};
   static const struct ALIGN16 {
     float a;
     float b;
     float c;
     float d;
-  } constant1 = { 5.0, 6.0, 7.0, 8.0 };
+  } constant1 = {5.0, 6.0, 7.0, 8.0};
   // XMM0 = 1.0f, 2.0f, 3.0f, 4.0f.
   __ movups(XMM0, Address::Absolute(reinterpret_cast<uword>(&constant0)));
   // XMM1 = 5.0f, 6.0f, 7.0f, 8.0f.
@@ -1470,13 +1463,13 @@
     float b;
     float c;
     float d;
-  } constant0 = { 1.0, 2.0, 3.0, 4.0 };
+  } constant0 = {1.0, 2.0, 3.0, 4.0};
   static const struct ALIGN16 {
     float a;
     float b;
     float c;
     float d;
-  } constant1 = { 5.0, 6.0, 7.0, 8.0 };
+  } constant1 = {5.0, 6.0, 7.0, 8.0};
   // XMM0 = 1.0f, 2.0f, 3.0f, 4.0f.
   __ movups(XMM0, Address::Absolute(reinterpret_cast<uword>(&constant0)));
   // XMM1 = 5.0f, 6.0f, 7.0f, 8.0f.
@@ -1509,13 +1502,13 @@
     float b;
     float c;
     float d;
-  } constant0 = { 1.0, 2.0, 3.0, 4.0 };
+  } constant0 = {1.0, 2.0, 3.0, 4.0};
   static const struct ALIGN16 {
     float a;
     float b;
     float c;
     float d;
-  } constant1 = { 5.0, 6.0, 7.0, 8.0 };
+  } constant1 = {5.0, 6.0, 7.0, 8.0};
   // XMM0 = 1.0f, 2.0f, 3.0f, 4.0f.
   __ movups(XMM0, Address::Absolute(reinterpret_cast<uword>(&constant0)));
   // XMM1 = 5.0f, 6.0f, 7.0f, 8.0f.
@@ -1548,13 +1541,13 @@
     float b;
     float c;
     float d;
-  } constant0 = { 1.0, 2.0, 3.0, 4.0 };
+  } constant0 = {1.0, 2.0, 3.0, 4.0};
   static const struct ALIGN16 {
     float a;
     float b;
     float c;
     float d;
-  } constant1 = { 5.0, 6.0, 7.0, 8.0 };
+  } constant1 = {5.0, 6.0, 7.0, 8.0};
   // XMM0 = 1.0f, 2.0f, 3.0f, 4.0f.
   __ movups(XMM0, Address::Absolute(reinterpret_cast<uword>(&constant0)));
   // XMM1 = 5.0f, 6.0f, 7.0f, 8.0f.
@@ -1585,11 +1578,11 @@
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant0 = { 1.0, 2.0 };
+  } constant0 = {1.0, 2.0};
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant1 = { 3.0, 4.0 };
+  } constant1 = {3.0, 4.0};
   __ movups(XMM0, Address::Absolute(reinterpret_cast<uword>(&constant0)));
   __ movups(XMM1, Address::Absolute(reinterpret_cast<uword>(&constant1)));
   __ addpd(XMM0, XMM1);
@@ -1614,11 +1607,11 @@
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant0 = { 1.0, 2.0 };
+  } constant0 = {1.0, 2.0};
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant1 = { 3.0, 4.0 };
+  } constant1 = {3.0, 4.0};
   __ movups(XMM0, Address::Absolute(reinterpret_cast<uword>(&constant0)));
   __ movups(XMM1, Address::Absolute(reinterpret_cast<uword>(&constant1)));
   __ subpd(XMM0, XMM1);
@@ -1643,7 +1636,7 @@
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant0 = { 1.0, 2.0 };
+  } constant0 = {1.0, 2.0};
   __ movups(XMM0, Address::Absolute(reinterpret_cast<uword>(&constant0)));
   __ negatepd(XMM0);
   __ pushl(EAX);
@@ -1667,7 +1660,7 @@
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant0 = { -1.0, 2.0 };
+  } constant0 = {-1.0, 2.0};
   __ movups(XMM0, Address::Absolute(reinterpret_cast<uword>(&constant0)));
   __ abspd(XMM0);
   __ pushl(EAX);
@@ -1691,11 +1684,11 @@
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant0 = { 3.0, 2.0 };
+  } constant0 = {3.0, 2.0};
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant1 = { 3.0, 4.0 };
+  } constant1 = {3.0, 4.0};
   __ movups(XMM0, Address::Absolute(reinterpret_cast<uword>(&constant0)));
   __ movups(XMM1, Address::Absolute(reinterpret_cast<uword>(&constant1)));
   __ mulpd(XMM0, XMM1);
@@ -1720,11 +1713,11 @@
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant0 = { 9.0, 2.0 };
+  } constant0 = {9.0, 2.0};
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant1 = { 3.0, 4.0 };
+  } constant1 = {3.0, 4.0};
   __ movups(XMM0, Address::Absolute(reinterpret_cast<uword>(&constant0)));
   __ movups(XMM1, Address::Absolute(reinterpret_cast<uword>(&constant1)));
   __ divpd(XMM0, XMM1);
@@ -1749,7 +1742,7 @@
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant0 = { 16.0, 2.0 };
+  } constant0 = {16.0, 2.0};
   __ movups(XMM0, Address::Absolute(reinterpret_cast<uword>(&constant0)));
   __ sqrtpd(XMM0);
   __ pushl(EAX);
@@ -1773,11 +1766,11 @@
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant0 = { 9.0, 2.0 };
+  } constant0 = {9.0, 2.0};
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant1 = { 3.0, 4.0 };
+  } constant1 = {3.0, 4.0};
   __ movups(XMM0, Address::Absolute(reinterpret_cast<uword>(&constant0)));
   __ movups(XMM1, Address::Absolute(reinterpret_cast<uword>(&constant1)));
   __ minpd(XMM0, XMM1);
@@ -1802,11 +1795,11 @@
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant0 = { 9.0, 2.0 };
+  } constant0 = {9.0, 2.0};
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant1 = { 3.0, 4.0 };
+  } constant1 = {3.0, 4.0};
   __ movups(XMM0, Address::Absolute(reinterpret_cast<uword>(&constant0)));
   __ movups(XMM1, Address::Absolute(reinterpret_cast<uword>(&constant1)));
   __ maxpd(XMM0, XMM1);
@@ -1831,7 +1824,7 @@
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant0 = { 2.0, 9.0 };
+  } constant0 = {2.0, 9.0};
   __ movups(XMM0, Address::Absolute(reinterpret_cast<uword>(&constant0)));
   // Splat Y across all lanes.
   __ shufpd(XMM0, XMM0, Immediate(0x33));
@@ -1859,7 +1852,7 @@
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant0 = { 9.0, 2.0 };
+  } constant0 = {9.0, 2.0};
   __ movups(XMM1, Address::Absolute(reinterpret_cast<uword>(&constant0)));
   __ cvtpd2ps(XMM0, XMM1);
   __ pushl(EAX);
@@ -1883,7 +1876,7 @@
     float b;
     float c;
     float d;
-  } constant0 = { 9.0f, 2.0f, 3.0f, 4.0f };
+  } constant0 = {9.0f, 2.0f, 3.0f, 4.0f};
   __ movups(XMM1, Address::Absolute(reinterpret_cast<uword>(&constant0)));
   __ cvtps2pd(XMM0, XMM1);
   __ pushl(EAX);
@@ -2635,7 +2628,7 @@
   a = 4021288948u;
   b = 13;
   res = reinterpret_cast<LongUnsignedMulRegCode>(test->entry())(a, b);
-  mul_res =  static_cast<uint64_t>(a) * static_cast<uint64_t>(b);
+  mul_res = static_cast<uint64_t>(a) * static_cast<uint64_t>(b);
   EXPECT_EQ(mul_res, res);
 }
 
@@ -2658,7 +2651,7 @@
   a = 4294967284u;
   b = 13;
   res = reinterpret_cast<LongUnsignedMulAddressCode>(test->entry())(a, b);
-  mul_res =  static_cast<uint64_t>(a) * static_cast<uint64_t>(b);
+  mul_res = static_cast<uint64_t>(a) * static_cast<uint64_t>(b);
   EXPECT_EQ(mul_res, res);
 }
 
@@ -3084,10 +3077,10 @@
 ASSEMBLER_TEST_RUN(DoubleAbs, test) {
   typedef double (*DoubleAbsCode)(double d);
   double val = -12.45;
-  double res =  reinterpret_cast<DoubleAbsCode>(test->entry())(val);
+  double res = reinterpret_cast<DoubleAbsCode>(test->entry())(val);
   EXPECT_FLOAT_EQ(-val, res, 0.001);
   val = 12.45;
-  res =  reinterpret_cast<DoubleAbsCode>(test->entry())(val);
+  res = reinterpret_cast<DoubleAbsCode>(test->entry())(val);
   EXPECT_FLOAT_EQ(val, res, 0.001);
 }
 
@@ -3153,8 +3146,8 @@
 
 ASSEMBLER_TEST_RUN(ConditionalMovesNoOverflow, test) {
   typedef int (*ConditionalMovesNoOverflowCode)(int i, int j);
-  int res = reinterpret_cast<ConditionalMovesNoOverflowCode>(
-      test->entry())(0x7fffffff, 2);
+  int res = reinterpret_cast<ConditionalMovesNoOverflowCode>(test->entry())(
+      0x7fffffff, 2);
   EXPECT_EQ(1, res);
   res = reinterpret_cast<ConditionalMovesNoOverflowCode>(test->entry())(1, 1);
   EXPECT_EQ(0, res);
@@ -3202,7 +3195,7 @@
 
 
 ASSEMBLER_TEST_GENERATE(ConditionalMovesCompare, assembler) {
-  __ movl(EDX, Immediate(1));  // Greater equal.
+  __ movl(EDX, Immediate(1));   // Greater equal.
   __ movl(ECX, Immediate(-1));  // Less
   __ movl(EAX, Address(ESP, 1 * kWordSize));
   __ cmpl(EAX, Address(ESP, 2 * kWordSize));
@@ -3387,7 +3380,7 @@
   for (int i = 0; i < 10; i++) {
     EXPECT_EQ(from[i], to[i]);
   }
-  delete [] to;
+  delete[] to;
 }
 
 
@@ -3398,8 +3391,7 @@
   __ movl(ECX, Address(ESP, 3 * kWordSize));
   __ movl(THR, Address(ESP, 4 * kWordSize));
   __ pushl(EAX);
-  __ StoreIntoObject(ECX,
-                     FieldAddress(ECX, GrowableObjectArray::data_offset()),
+  __ StoreIntoObject(ECX, FieldAddress(ECX, GrowableObjectArray::data_offset()),
                      EAX);
   __ popl(EAX);
   __ popl(THR);
diff --git a/runtime/vm/assembler_mips.cc b/runtime/vm/assembler_mips.cc
index a85aa08..00ebd25 100644
--- a/runtime/vm/assembler_mips.cc
+++ b/runtime/vm/assembler_mips.cc
@@ -52,8 +52,7 @@
 int32_t Assembler::EncodeBranchOffset(int32_t offset, int32_t instr) {
   if (!CanEncodeBranchOffset(offset)) {
     ASSERT(!use_far_branches());
-    Thread::Current()->long_jump_base()->Jump(
-        1, Object::branch_offset_error());
+    Thread::Current()->long_jump_base()->Jump(1, Object::branch_offset_error());
   }
 
   // Properly preserve only the bits supported in the instruction.
@@ -71,7 +70,7 @@
 
 static int32_t DecodeLoadImmediate(int32_t ori_instr, int32_t lui_instr) {
   return (((lui_instr & kBranchOffsetMask) << 16) |
-           (ori_instr & kBranchOffsetMask));
+          (ori_instr & kBranchOffsetMask));
 }
 
 
@@ -95,8 +94,7 @@
       // Change the offset to the absolute value.
       const int32_t encoded_low =
           EncodeLoadImmediate(dest & kBranchOffsetMask, low);
-      const int32_t encoded_high =
-          EncodeLoadImmediate(dest >> 16, high);
+      const int32_t encoded_high = EncodeLoadImmediate(dest >> 16, high);
 
       region.Store<int32_t>(position, encoded_high);
       region.Store<int32_t>(position + Instr::kInstrSize, encoded_low);
@@ -129,14 +127,22 @@
 
 static Opcode OppositeBranchOpcode(Opcode b) {
   switch (b) {
-    case BEQ: return BNE;
-    case BNE: return BEQ;
-    case BGTZ: return BLEZ;
-    case BLEZ: return BGTZ;
-    case BEQL: return BNEL;
-    case BNEL: return BEQL;
-    case BGTZL: return BLEZL;
-    case BLEZL: return BGTZL;
+    case BEQ:
+      return BNE;
+    case BNE:
+      return BEQ;
+    case BGTZ:
+      return BLEZ;
+    case BLEZ:
+      return BGTZ;
+    case BEQL:
+      return BNEL;
+    case BNEL:
+      return BEQL;
+    case BGTZL:
+      return BLEZL;
+    case BLEZL:
+      return BGTZL;
     default:
       UNREACHABLE();
       break;
@@ -145,7 +151,9 @@
 }
 
 
-void Assembler::EmitFarBranch(Opcode b, Register rs, Register rt,
+void Assembler::EmitFarBranch(Opcode b,
+                              Register rs,
+                              Register rt,
                               int32_t offset) {
   ASSERT(!in_delay_slot_);
   EmitIType(b, rs, rt, 4);
@@ -156,10 +164,14 @@
 
 static RtRegImm OppositeBranchNoLink(RtRegImm b) {
   switch (b) {
-    case BLTZ: return BGEZ;
-    case BGEZ: return BLTZ;
-    case BLTZAL: return BGEZ;
-    case BGEZAL: return BLTZ;
+    case BLTZ:
+      return BGEZ;
+    case BGEZ:
+      return BLTZ;
+    case BLTZAL:
+      return BGEZ;
+    case BGEZAL:
+      return BLTZ;
     default:
       UNREACHABLE();
       break;
@@ -237,7 +249,7 @@
 }
 
 
-void Assembler::EmitFpuBranch(bool kind, Label *label) {
+void Assembler::EmitFpuBranch(bool kind, Label* label) {
   ASSERT(!in_delay_slot_);
   const int32_t b16 = kind ? (1 << 16) : 0;  // Bit 16 set for branch on true.
   if (label->IsBound()) {
@@ -248,10 +260,7 @@
       EmitFarFpuBranch(kind, label->Position());
     } else {
       const uint16_t dest_off = EncodeBranchOffset(dest, 0);
-      Emit(COP1 << kOpcodeShift |
-           COP1_BC << kCop1SubShift |
-           b16 |
-           dest_off);
+      Emit(COP1 << kOpcodeShift | COP1_BC << kCop1SubShift | b16 | dest_off);
     }
   } else {
     const intptr_t position = buffer_.Size();
@@ -260,10 +269,7 @@
       EmitFarFpuBranch(kind, dest_off);
     } else {
       const uint16_t dest_off = EncodeBranchOffset(label->position_, 0);
-      Emit(COP1 << kOpcodeShift |
-           COP1_BC << kCop1SubShift |
-           b16 |
-           dest_off);
+      Emit(COP1 << kOpcodeShift | COP1_BC << kCop1SubShift | b16 | dest_off);
     }
     label->LinkTo(position);
   }
@@ -309,8 +315,7 @@
       dest = buffer_.Size();
       const int32_t encoded_low =
           EncodeLoadImmediate(dest & kBranchOffsetMask, low);
-      const int32_t encoded_high =
-          EncodeLoadImmediate(dest >> 16, high);
+      const int32_t encoded_high = EncodeLoadImmediate(dest >> 16, high);
 
       // Skip the unconditional far jump if the test fails by flipping the
       // sense of the branch instruction.
@@ -334,7 +339,7 @@
       // Clear out the old (far) branch.
       for (int i = 0; i < 5; i++) {
         buffer_.Store<int32_t>(position + i * Instr::kInstrSize,
-            Instr::kNopInstruction);
+                               Instr::kNopInstruction);
       }
 
       // Calculate the new offset.
@@ -377,8 +382,11 @@
 }
 
 
-void Assembler::AdduDetectOverflow(Register rd, Register rs, Register rt,
-                                   Register ro, Register scratch) {
+void Assembler::AdduDetectOverflow(Register rd,
+                                   Register rs,
+                                   Register rt,
+                                   Register ro,
+                                   Register scratch) {
   ASSERT(!in_delay_slot_);
   ASSERT(rd != ro);
   ASSERT(rd != TMP);
@@ -398,14 +406,14 @@
   }
 
   if (rd == rs) {
-    mov(TMP, rs);  // Preserve rs.
-    addu(rd, rs, rt);  // rs is overwritten.
+    mov(TMP, rs);        // Preserve rs.
+    addu(rd, rs, rt);    // rs is overwritten.
     xor_(TMP, rd, TMP);  // Original rs.
     xor_(ro, rd, rt);
     and_(ro, ro, TMP);
   } else if (rd == rt) {
-    mov(TMP, rt);  // Preserve rt.
-    addu(rd, rs, rt);  // rt is overwritten.
+    mov(TMP, rt);        // Preserve rt.
+    addu(rd, rs, rt);    // rt is overwritten.
     xor_(TMP, rd, TMP);  // Original rt.
     xor_(ro, rd, rs);
     and_(ro, ro, TMP);
@@ -418,7 +426,9 @@
 }
 
 
-void Assembler::SubuDetectOverflow(Register rd, Register rs, Register rt,
+void Assembler::SubuDetectOverflow(Register rd,
+                                   Register rs,
+                                   Register rt,
                                    Register ro) {
   ASSERT(!in_delay_slot_);
   ASSERT(rd != ro);
@@ -438,13 +448,13 @@
   }
 
   if (rd == rs) {
-    mov(TMP, rs);  // Preserve left.
-    subu(rd, rs, rt);  // Left is overwritten.
-    xor_(ro, rd, TMP);  // scratch is original left.
+    mov(TMP, rs);        // Preserve left.
+    subu(rd, rs, rt);    // Left is overwritten.
+    xor_(ro, rd, TMP);   // scratch is original left.
     xor_(TMP, TMP, rs);  // scratch is original left.
     and_(ro, TMP, ro);
   } else if (rd == rt) {
-    mov(TMP, rt);  // Preserve right.
+    mov(TMP, rt);      // Preserve right.
     subu(rd, rs, rt);  // Right is overwritten.
     xor_(ro, rd, rs);
     xor_(TMP, rs, TMP);  // Original right.
@@ -473,7 +483,7 @@
   Bind(&cid_ok);
   GetNextPC(CMPRES1, TMP);
   const intptr_t entry_offset = CodeSize() - Instr::kInstrSize +
-      Instructions::HeaderSize() - kHeapObjectTag;
+                                Instructions::HeaderSize() - kHeapObjectTag;
   AddImmediate(CMPRES1, CMPRES1, -entry_offset);
   lw(CMPRES2, FieldAddress(CODE_REG, Code::saved_instructions_offset()));
   BranchEqual(CMPRES1, CMPRES2, &instructions_ok);
@@ -711,8 +721,8 @@
                                       Register value,
                                       bool can_value_be_smi) {
   if (Address::CanHoldOffset(offset - kHeapObjectTag)) {
-    StoreIntoObject(
-        object, FieldAddress(object, offset), value, can_value_be_smi);
+    StoreIntoObject(object, FieldAddress(object, offset), value,
+                    can_value_be_smi);
   } else {
     AddImmediate(TMP, object, offset - kHeapObjectTag);
     StoreIntoObject(object, Address(TMP), value, can_value_be_smi);
@@ -781,8 +791,8 @@
 void Assembler::LoadClassId(Register result, Register object) {
   ASSERT(RawObject::kClassIdTagPos == 16);
   ASSERT(RawObject::kClassIdTagSize == 16);
-  const intptr_t class_id_offset = Object::tags_offset() +
-      RawObject::kClassIdTagPos / kBitsPerByte;
+  const intptr_t class_id_offset =
+      Object::tags_offset() + RawObject::kClassIdTagPos / kBitsPerByte;
   lhu(result, FieldAddress(object, class_id_offset));
 }
 
@@ -860,25 +870,16 @@
 }
 
 
-void Assembler::NoMonomorphicCheckedEntry() {
-  buffer_.Reset();
-  break_(0);
-  break_(0);
-  break_(0);
-  break_(0);
-  ASSERT(CodeSize() == Instructions::kCheckedEntryOffset);
-}
-
-
 // T0 receiver, S5 guarded cid as Smi
 void Assembler::MonomorphicCheckedEntry() {
+  ASSERT(has_single_entry_point_);
+  has_single_entry_point_ = false;
   bool saved_use_far_branches = use_far_branches();
   set_use_far_branches(false);
 
   Label have_cid, miss;
   Bind(&miss);
-  lw(CODE_REG, Address(THR, Thread::monomorphic_miss_stub_offset()));
-  lw(T9, FieldAddress(CODE_REG, Code::entry_point_offset()));
+  lw(T9, Address(THR, Thread::monomorphic_miss_entry_offset()));
   jr(T9);
 
   Comment("MonomorphicCheckedEntry");
@@ -905,7 +906,7 @@
   intptr_t state_offset = ClassTable::StateOffsetFor(cid);
   LoadIsolate(temp_reg);
   intptr_t table_offset =
-    Isolate::class_table_offset() + ClassTable::TableOffsetFor(cid);
+      Isolate::class_table_offset() + ClassTable::TableOffsetFor(cid);
   lw(temp_reg, Address(temp_reg, table_offset));
   AddImmediate(temp_reg, state_offset);
   lw(temp_reg, Address(temp_reg, 0));
@@ -943,12 +944,14 @@
   ASSERT(cid > 0);
   ASSERT(temp_reg != TMP);
   const uword class_offset = ClassTable::ClassOffsetFor(cid);
-  const uword count_field_offset = (space == Heap::kNew) ?
-    ClassHeapStats::allocated_since_gc_new_space_offset() :
-    ClassHeapStats::allocated_since_gc_old_space_offset();
-  const uword size_field_offset = (space == Heap::kNew) ?
-    ClassHeapStats::allocated_size_since_gc_new_space_offset() :
-    ClassHeapStats::allocated_size_since_gc_old_space_offset();
+  const uword count_field_offset =
+      (space == Heap::kNew)
+          ? ClassHeapStats::allocated_since_gc_new_space_offset()
+          : ClassHeapStats::allocated_since_gc_old_space_offset();
+  const uword size_field_offset =
+      (space == Heap::kNew)
+          ? ClassHeapStats::allocated_size_since_gc_new_space_offset()
+          : ClassHeapStats::allocated_size_since_gc_old_space_offset();
   LoadIsolate(temp_reg);
   intptr_t table_offset =
       Isolate::class_table_offset() + ClassTable::TableOffsetFor(cid);
@@ -1146,10 +1149,9 @@
 
 void Assembler::EnterCallRuntimeFrame(intptr_t frame_space) {
   ASSERT(!in_delay_slot_);
-  const intptr_t kPushedRegistersSize =
-      kDartVolatileCpuRegCount * kWordSize +
-      3 * kWordSize +  // PP, FP and RA.
-      kDartVolatileFpuRegCount * kWordSize;
+  const intptr_t kPushedRegistersSize = kDartVolatileCpuRegCount * kWordSize +
+                                        3 * kWordSize +  // PP, FP and RA.
+                                        kDartVolatileFpuRegCount * kWordSize;
 
   SetPrologueOffset();
 
@@ -1192,10 +1194,9 @@
 
 void Assembler::LeaveCallRuntimeFrame() {
   ASSERT(!in_delay_slot_);
-  const intptr_t kPushedRegistersSize =
-      kDartVolatileCpuRegCount * kWordSize +
-      3 * kWordSize +  // FP and RA.
-      kDartVolatileFpuRegCount * kWordSize;
+  const intptr_t kPushedRegistersSize = kDartVolatileCpuRegCount * kWordSize +
+                                        3 * kWordSize +  // FP and RA.
+                                        kDartVolatileFpuRegCount * kWordSize;
 
   Comment("LeaveCallRuntimeFrame");
 
@@ -1230,7 +1231,8 @@
                                              intptr_t index_scale,
                                              Register array,
                                              intptr_t index) const {
-  const int64_t offset = index * index_scale +
+  const int64_t offset =
+      index * index_scale +
       (is_external ? 0 : (Instance::DataOffsetFor(cid) - kHeapObjectTag));
   ASSERT(Utils::IsInt(32, offset));
   ASSERT(Address::CanHoldOffset(offset));
@@ -1238,6 +1240,19 @@
 }
 
 
+void Assembler::LoadElementAddressForIntIndex(Register address,
+                                              bool is_external,
+                                              intptr_t cid,
+                                              intptr_t index_scale,
+                                              Register array,
+                                              intptr_t index) {
+  const int64_t offset =
+      index * index_scale +
+      (is_external ? 0 : (Instance::DataOffsetFor(cid) - kHeapObjectTag));
+  AddImmediate(address, array, offset);
+}
+
+
 Address Assembler::ElementAddressForRegIndex(bool is_load,
                                              bool is_external,
                                              intptr_t cid,
@@ -1266,11 +1281,96 @@
 }
 
 
+void Assembler::LoadElementAddressForRegIndex(Register address,
+                                              bool is_load,
+                                              bool is_external,
+                                              intptr_t cid,
+                                              intptr_t index_scale,
+                                              Register array,
+                                              Register index) {
+  // Note that index is expected smi-tagged, (i.e, LSL 1) for all arrays.
+  const intptr_t shift = Utils::ShiftForPowerOfTwo(index_scale) - kSmiTagShift;
+  const int32_t offset =
+      is_external ? 0 : (Instance::DataOffsetFor(cid) - kHeapObjectTag);
+  if (shift < 0) {
+    ASSERT(shift == -1);
+    sra(address, index, 1);
+    addu(address, array, address);
+  } else if (shift == 0) {
+    addu(address, array, index);
+  } else {
+    sll(address, index, shift);
+    addu(address, array, address);
+  }
+  if (offset != 0) {
+    AddImmediate(address, offset);
+  }
+}
+
+
+void Assembler::LoadHalfWordUnaligned(Register dst,
+                                      Register addr,
+                                      Register tmp) {
+  ASSERT(dst != addr);
+  lbu(dst, Address(addr, 0));
+  lb(tmp, Address(addr, 1));
+  sll(tmp, tmp, 8);
+  or_(dst, dst, tmp);
+}
+
+
+void Assembler::LoadHalfWordUnsignedUnaligned(Register dst,
+                                              Register addr,
+                                              Register tmp) {
+  ASSERT(dst != addr);
+  lbu(dst, Address(addr, 0));
+  lbu(tmp, Address(addr, 1));
+  sll(tmp, tmp, 8);
+  or_(dst, dst, tmp);
+}
+
+
+void Assembler::StoreHalfWordUnaligned(Register src,
+                                       Register addr,
+                                       Register tmp) {
+  sb(src, Address(addr, 0));
+  srl(tmp, src, 8);
+  sb(tmp, Address(addr, 1));
+}
+
+
+void Assembler::LoadWordUnaligned(Register dst, Register addr, Register tmp) {
+  // TODO(rmacnak): LWL + LWR
+  ASSERT(dst != addr);
+  lbu(dst, Address(addr, 0));
+  lbu(tmp, Address(addr, 1));
+  sll(tmp, tmp, 8);
+  or_(dst, dst, tmp);
+  lbu(tmp, Address(addr, 2));
+  sll(tmp, tmp, 16);
+  or_(dst, dst, tmp);
+  lbu(tmp, Address(addr, 3));
+  sll(tmp, tmp, 24);
+  or_(dst, dst, tmp);
+}
+
+
+void Assembler::StoreWordUnaligned(Register src, Register addr, Register tmp) {
+  // TODO(rmacnak): SWL + SWR
+  sb(src, Address(addr, 0));
+  srl(tmp, src, 8);
+  sb(tmp, Address(addr, 1));
+  srl(tmp, src, 16);
+  sb(tmp, Address(addr, 2));
+  srl(tmp, src, 24);
+  sb(tmp, Address(addr, 3));
+}
+
+
 static const char* cpu_reg_names[kNumberOfCpuRegisters] = {
-  "zr", "tmp", "v0", "v1", "a0", "a1", "a2", "a3",
-  "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7",
-  "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
-  "t8", "t9", "k0", "k1", "gp", "sp", "fp", "ra",
+    "zr", "tmp", "v0", "v1", "a0", "a1", "a2", "a3", "t0", "t1", "t2",
+    "t3", "t4",  "t5", "t6", "t7", "s0", "s1", "s2", "s3", "s4", "s5",
+    "s6", "s7",  "t8", "t9", "k0", "k1", "gp", "sp", "fp", "ra",
 };
 
 
@@ -1281,8 +1381,8 @@
 
 
 static const char* fpu_reg_names[kNumberOfFpuRegisters] = {
-  "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7",
-  "d8", "d9", "d10", "d11", "d12", "d13", "d14", "d15",
+    "d0", "d1", "d2",  "d3",  "d4",  "d5",  "d6",  "d7",
+    "d8", "d9", "d10", "d11", "d12", "d13", "d14", "d15",
 };
 
 
diff --git a/runtime/vm/assembler_mips.h b/runtime/vm/assembler_mips.h
index 095fa74..379ebba 100644
--- a/runtime/vm/assembler_mips.h
+++ b/runtime/vm/assembler_mips.h
@@ -2,10 +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.
 
-#ifndef VM_ASSEMBLER_MIPS_H_
-#define VM_ASSEMBLER_MIPS_H_
+#ifndef RUNTIME_VM_ASSEMBLER_MIPS_H_
+#define RUNTIME_VM_ASSEMBLER_MIPS_H_
 
-#ifndef VM_ASSEMBLER_H_
+#ifndef RUNTIME_VM_ASSEMBLER_H_
 #error Do not include assembler_mips.h directly; use assembler.h instead.
 #endif
 
@@ -30,9 +30,9 @@
 
 class Immediate : public ValueObject {
  public:
-  explicit Immediate(int32_t value) : value_(value) { }
+  explicit Immediate(int32_t value) : value_(value) {}
 
-  Immediate(const Immediate& other) : ValueObject(), value_(other.value_) { }
+  Immediate(const Immediate& other) : ValueObject(), value_(other.value_) {}
   Immediate& operator=(const Immediate& other) {
     value_ = other.value_;
     return *this;
@@ -50,13 +50,13 @@
 class Address : public ValueObject {
  public:
   explicit Address(Register base, int32_t offset = 0)
-      : ValueObject(), base_(base), offset_(offset) { }
+      : ValueObject(), base_(base), offset_(offset) {}
 
   // This addressing mode does not exist.
   Address(Register base, Register offset);
 
   Address(const Address& other)
-      : ValueObject(), base_(other.base_), offset_(other.offset_) { }
+      : ValueObject(), base_(other.base_), offset_(other.offset_) {}
   Address& operator=(const Address& other) {
     base_ = other.base_;
     offset_ = other.offset_;
@@ -85,9 +85,9 @@
 class FieldAddress : public Address {
  public:
   FieldAddress(Register base, int32_t disp)
-      : Address(base, disp - kHeapObjectTag) { }
+      : Address(base, disp - kHeapObjectTag) {}
 
-  FieldAddress(const FieldAddress& other) : Address(other) { }
+  FieldAddress(const FieldAddress& other) : Address(other) {}
 
   FieldAddress& operator=(const FieldAddress& other) {
     Address::operator=(other);
@@ -98,7 +98,7 @@
 
 class Label : public ValueObject {
  public:
-  Label() : position_(0) { }
+  Label() : position_(0) {}
 
   ~Label() {
     // Assert if label is being destroyed with unresolved branches pending.
@@ -119,9 +119,7 @@
  private:
   intptr_t position_;
 
-  void Reinitialize() {
-    position_ = 0;
-  }
+  void Reinitialize() { position_ = 0; }
 
   void BindTo(intptr_t position) {
     ASSERT(!IsBound());
@@ -160,8 +158,8 @@
 
   class LeftBits : public BitField<uword, Register, kLeftPos, kLeftSize> {};
   class RightBits : public BitField<uword, Register, kRightPos, kRightSize> {};
-  class RelOpBits :
-      public BitField<uword, RelationOperator, kRelOpPos, kRelOpSize> {};
+  class RelOpBits
+      : public BitField<uword, RelationOperator, kRelOpPos, kRelOpSize> {};
   class ImmBits : public BitField<uword, uint16_t, kImmPos, kImmSize> {};
 
   Register left() const { return LeftBits::decode(bits_); }
@@ -180,10 +178,10 @@
   }
 
   // Uninitialized condition.
-  Condition() : ValueObject(), bits_(0) { }
+  Condition() : ValueObject(), bits_(0) {}
 
   // Copy constructor.
-  Condition(const Condition& other) : ValueObject(), bits_(other.bits_) { }
+  Condition(const Condition& other) : ValueObject(), bits_(other.bits_) {}
 
   // Copy assignment operator.
   Condition& operator=(const Condition& other) {
@@ -239,14 +237,13 @@
   explicit Assembler(bool use_far_branches = false)
       : buffer_(),
         prologue_offset_(-1),
+        has_single_entry_point_(true),
         use_far_branches_(use_far_branches),
         delay_slot_available_(false),
         in_delay_slot_(false),
         comments_(),
-        constant_pool_allowed_(true) {
-    MonomorphicCheckedEntry();
-  }
-  ~Assembler() { }
+        constant_pool_allowed_(true) {}
+  ~Assembler() {}
 
   void PopRegister(Register r) { Pop(r); }
 
@@ -256,12 +253,11 @@
   // Misc. functionality
   intptr_t CodeSize() const { return buffer_.Size(); }
   intptr_t prologue_offset() const { return prologue_offset_; }
+  bool has_single_entry_point() const { return has_single_entry_point_; }
 
   // Count the fixups that produce a pointer offset, without processing
   // the fixups.
-  intptr_t CountPointerOffsets() const {
-    return buffer_.CountPointerOffsets();
-  }
+  intptr_t CountPointerOffsets() const { return buffer_.CountPointerOffsets(); }
 
   const ZoneGrowableArray<intptr_t>& GetPointerOffsets() const {
     return buffer_.pointer_offsets();
@@ -281,9 +277,7 @@
     return FLAG_use_far_branches || use_far_branches_;
   }
 
-  void set_use_far_branches(bool b) {
-    use_far_branches_ = b;
-  }
+  void set_use_far_branches(bool b) { use_far_branches_ = b; }
 
   void EnterFrame();
   void LeaveFrameAndReturn();
@@ -296,7 +290,6 @@
   // the branch delay slot.
   void LeaveStubFrameAndReturn(Register ra = RA);
 
-  void NoMonomorphicCheckedEntry();
   void MonomorphicCheckedEntry();
 
   void UpdateAllocationStats(intptr_t cid,
@@ -309,9 +302,7 @@
                                      Heap::Space space);
 
 
-  void MaybeTraceAllocation(intptr_t cid,
-                            Register temp_reg,
-                            Label* trace);
+  void MaybeTraceAllocation(intptr_t cid, Register temp_reg, Label* trace);
 
   // Inlined allocation of an instance of class 'cls', code has no runtime
   // calls. Jump to 'failure' if the instance cannot be allocated here.
@@ -357,7 +348,7 @@
   Assembler* delay_slot() {
     ASSERT(delay_slot_available_);
     ASSERT(buffer_.Load<int32_t>(buffer_.GetPosition() - sizeof(int32_t)) ==
-        Instr::kNopInstruction);
+           Instr::kNopInstruction);
     buffer_.Remit<int32_t>();
     delay_slot_available_ = false;
     in_delay_slot_ = true;
@@ -394,11 +385,9 @@
   }
 
   // Unconditional branch.
-  void b(Label* l) {
-    beq(R0, R0, l);
-  }
+  void b(Label* l) { beq(R0, R0, l); }
 
-  void bal(Label *l) {
+  void bal(Label* l) {
     ASSERT(!in_delay_slot_);
     EmitRegImmBranch(BGEZAL, R0, l);
     EmitBranchDelayNop();
@@ -508,19 +497,14 @@
 
   static int32_t BreakEncoding(int32_t code) {
     ASSERT(Utils::IsUint(20, code));
-    return SPECIAL << kOpcodeShift |
-           code << kBreakCodeShift |
+    return SPECIAL << kOpcodeShift | code << kBreakCodeShift |
            BREAK << kFunctionShift;
   }
 
 
-  void break_(int32_t code) {
-    Emit(BreakEncoding(code));
-  }
+  void break_(int32_t code) { Emit(BreakEncoding(code)); }
 
-  static uword GetBreakInstructionFiller() {
-    return BreakEncoding(0);
-  }
+  static uword GetBreakInstructionFiller() { return BreakEncoding(0); }
 
   // FPU compare, always false.
   void cfd(DRegister ds, DRegister dt) {
@@ -610,9 +594,7 @@
     EmitFpuRType(COP1, FMT_D, F0, fs, fd, COP1_CVT_S);
   }
 
-  void div(Register rs, Register rt) {
-    EmitRType(SPECIAL, rs, rt, R0, 0, DIV);
-  }
+  void div(Register rs, Register rt) { EmitRType(SPECIAL, rs, rt, R0, 0, DIV); }
 
   void divd(DRegister dd, DRegister ds, DRegister dt) {
     FRegister fd = static_cast<FRegister>(dd * 2);
@@ -638,30 +620,20 @@
     EmitBranchDelayNop();
   }
 
-  void lb(Register rt, const Address& addr) {
-    EmitLoadStore(LB, rt, addr);
-  }
+  void lb(Register rt, const Address& addr) { EmitLoadStore(LB, rt, addr); }
 
-  void lbu(Register rt, const Address& addr) {
-    EmitLoadStore(LBU, rt, addr);
-  }
+  void lbu(Register rt, const Address& addr) { EmitLoadStore(LBU, rt, addr); }
 
   void ldc1(DRegister dt, const Address& addr) {
     FRegister ft = static_cast<FRegister>(dt * 2);
     EmitFpuLoadStore(LDC1, ft, addr);
   }
 
-  void lh(Register rt, const Address& addr) {
-    EmitLoadStore(LH, rt, addr);
-  }
+  void lh(Register rt, const Address& addr) { EmitLoadStore(LH, rt, addr); }
 
-  void lhu(Register rt, const Address& addr) {
-    EmitLoadStore(LHU, rt, addr);
-  }
+  void lhu(Register rt, const Address& addr) { EmitLoadStore(LHU, rt, addr); }
 
-  void ll(Register rt, const Address& addr) {
-    EmitLoadStore(LL, rt, addr);
-  }
+  void ll(Register rt, const Address& addr) { EmitLoadStore(LL, rt, addr); }
 
   void lui(Register rt, const Immediate& imm) {
     ASSERT(Utils::IsUint(kImmBits, imm.value()));
@@ -669,9 +641,7 @@
     EmitIType(LUI, R0, rt, imm_value);
   }
 
-  void lw(Register rt, const Address& addr) {
-    EmitLoadStore(LW, rt, addr);
-  }
+  void lw(Register rt, const Address& addr) { EmitLoadStore(LW, rt, addr); }
 
   void lwc1(FRegister ft, const Address& addr) {
     EmitFpuLoadStore(LWC1, ft, addr);
@@ -686,23 +656,15 @@
   }
 
   void mfc1(Register rt, FRegister fs) {
-    Emit(COP1 << kOpcodeShift |
-         COP1_MF << kCop1SubShift |
-         rt << kRtShift |
+    Emit(COP1 << kOpcodeShift | COP1_MF << kCop1SubShift | rt << kRtShift |
          fs << kFsShift);
   }
 
-  void mfhi(Register rd) {
-    EmitRType(SPECIAL, R0, R0, rd, 0, MFHI);
-  }
+  void mfhi(Register rd) { EmitRType(SPECIAL, R0, R0, rd, 0, MFHI); }
 
-  void mflo(Register rd) {
-    EmitRType(SPECIAL, R0, R0, rd, 0, MFLO);
-  }
+  void mflo(Register rd) { EmitRType(SPECIAL, R0, R0, rd, 0, MFLO); }
 
-  void mov(Register rd, Register rs) {
-    or_(rd, rs, ZR);
-  }
+  void mov(Register rd, Register rs) { or_(rd, rs, ZR); }
 
   void movd(DRegister dd, DRegister ds) {
     FRegister fd = static_cast<FRegister>(dd * 2);
@@ -734,19 +696,13 @@
   }
 
   void mtc1(Register rt, FRegister fs) {
-    Emit(COP1 << kOpcodeShift |
-         COP1_MT << kCop1SubShift |
-         rt << kRtShift |
+    Emit(COP1 << kOpcodeShift | COP1_MT << kCop1SubShift | rt << kRtShift |
          fs << kFsShift);
   }
 
-  void mthi(Register rs) {
-    EmitRType(SPECIAL, rs, R0, R0, 0, MTHI);
-  }
+  void mthi(Register rs) { EmitRType(SPECIAL, rs, R0, R0, 0, MTHI); }
 
-  void mtlo(Register rs) {
-    EmitRType(SPECIAL, rs, R0, R0, 0, MTLO);
-  }
+  void mtlo(Register rs) { EmitRType(SPECIAL, rs, R0, R0, 0, MTLO); }
 
   void muld(DRegister dd, DRegister ds, DRegister dt) {
     FRegister fd = static_cast<FRegister>(dd * 2);
@@ -769,9 +725,7 @@
     EmitFpuRType(COP1, FMT_D, F0, fs, fd, COP1_NEG);
   }
 
-  void nop() {
-    Emit(Instr::kNopInstruction);
-  }
+  void nop() { Emit(Instr::kNopInstruction); }
 
   void nor(Register rd, Register rs, Register rt) {
     EmitRType(SPECIAL, rs, rt, rd, 0, NOR);
@@ -787,23 +741,17 @@
     EmitIType(ORI, rs, rt, imm_value);
   }
 
-  void sb(Register rt, const Address& addr) {
-    EmitLoadStore(SB, rt, addr);
-  }
+  void sb(Register rt, const Address& addr) { EmitLoadStore(SB, rt, addr); }
 
   // rt = 1 on success, 0 on failure.
-  void sc(Register rt, const Address& addr) {
-    EmitLoadStore(SC, rt, addr);
-  }
+  void sc(Register rt, const Address& addr) { EmitLoadStore(SC, rt, addr); }
 
   void sdc1(DRegister dt, const Address& addr) {
     FRegister ft = static_cast<FRegister>(dt * 2);
     EmitFpuLoadStore(SDC1, ft, addr);
   }
 
-  void sh(Register rt, const Address& addr) {
-    EmitLoadStore(SH, rt, addr);
-  }
+  void sh(Register rt, const Address& addr) { EmitLoadStore(SH, rt, addr); }
 
   void sll(Register rd, Register rt, int sa) {
     EmitRType(SPECIAL, R0, rt, rd, sa, SLL);
@@ -869,9 +817,7 @@
     EmitRType(SPECIAL, rs, rt, rd, 0, SUBU);
   }
 
-  void sw(Register rt, const Address& addr) {
-    EmitLoadStore(SW, rt, addr);
-  }
+  void sw(Register rt, const Address& addr) { EmitLoadStore(SW, rt, addr); }
 
   void swc1(FRegister ft, const Address& addr) {
     EmitFpuLoadStore(SWC1, ft, addr);
@@ -895,15 +841,21 @@
   // ro must be different from all the other registers.
   // If rd, rs, and rt are the same register, then a scratch register different
   // from the other registers is needed.
-  void AdduDetectOverflow(Register rd, Register rs, Register rt, Register ro,
+  void AdduDetectOverflow(Register rd,
+                          Register rs,
+                          Register rt,
+                          Register ro,
                           Register scratch = kNoRegister);
 
   // ro must be different from rd and rs.
   // rd and ro must not be TMP.
   // If rd and rs are the same, a scratch register different from the other
   // registers is needed.
-  void AddImmediateDetectOverflow(Register rd, Register rs, int32_t imm,
-                                  Register ro, Register scratch = kNoRegister) {
+  void AddImmediateDetectOverflow(Register rd,
+                                  Register rs,
+                                  int32_t imm,
+                                  Register ro,
+                                  Register scratch = kNoRegister) {
     ASSERT(!in_delay_slot_);
     LoadImmediate(rd, imm);
     AdduDetectOverflow(rd, rs, rd, ro, scratch);
@@ -917,7 +869,9 @@
 
   // ro must be different from rd and rs.
   // None of rd, rs, rt, or ro may be TMP.
-  void SubImmediateDetectOverflow(Register rd, Register rs, int32_t imm,
+  void SubImmediateDetectOverflow(Register rd,
+                                  Register rs,
+                                  int32_t imm,
                                   Register ro) {
     ASSERT(!in_delay_slot_);
     LoadImmediate(rd, imm);
@@ -1087,8 +1041,11 @@
     Register right = cond.right();
     RelationOperator rel_op = cond.rel_op();
     switch (rel_op) {
-      case NV: return;
-      case AL: b(l); return;
+      case NV:
+        return;
+      case AL:
+        b(l);
+        return;
       case EQ:  // fall through.
       case NE: {
         if (left == IMM) {
@@ -1228,9 +1185,7 @@
     }
   }
 
-  void BranchEqual(Register rd, Register rn, Label* l) {
-    beq(rd, rn, l);
-  }
+  void BranchEqual(Register rd, Register rn, Label* l) { beq(rd, rn, l); }
 
   void BranchEqual(Register rd, const Immediate& imm, Label* l) {
     ASSERT(!in_delay_slot_);
@@ -1250,9 +1205,7 @@
     beq(rd, CMPRES2, l);
   }
 
-  void BranchNotEqual(Register rd, Register rn, Label* l) {
-    bne(rd, rn, l);
-  }
+  void BranchNotEqual(Register rd, Register rn, Label* l) { bne(rd, rn, l); }
 
   void BranchNotEqual(Register rd, const Immediate& imm, Label* l) {
     ASSERT(!in_delay_slot_);
@@ -1319,7 +1272,7 @@
   void BranchSignedGreaterEqual(Register rd, Register rs, Label* l) {
     ASSERT(!in_delay_slot_);
     slt(CMPRES2, rd, rs);  // CMPRES2 = rd < rs ? 1 : 0.
-    beq(CMPRES2, ZR, l);  // If CMPRES2 = 0, then rd >= rs.
+    beq(CMPRES2, ZR, l);   // If CMPRES2 = 0, then rd >= rs.
   }
 
   void BranchSignedGreaterEqual(Register rd, const Immediate& imm, Label* l) {
@@ -1456,25 +1409,15 @@
     addiu(SP, SP, Immediate(kWordSize));
   }
 
-  void Ret() {
-    jr(RA);
-  }
+  void Ret() { jr(RA); }
 
-  void SmiTag(Register reg) {
-    sll(reg, reg, kSmiTagSize);
-  }
+  void SmiTag(Register reg) { sll(reg, reg, kSmiTagSize); }
 
-  void SmiTag(Register dst, Register src) {
-    sll(dst, src, kSmiTagSize);
-  }
+  void SmiTag(Register dst, Register src) { sll(dst, src, kSmiTagSize); }
 
-  void SmiUntag(Register reg) {
-    sra(reg, reg, kSmiTagSize);
-  }
+  void SmiUntag(Register reg) { sra(reg, reg, kSmiTagSize); }
 
-  void SmiUntag(Register dst, Register src) {
-    sra(dst, src, kSmiTagSize);
-  }
+  void SmiUntag(Register dst, Register src) { sra(dst, src, kSmiTagSize); }
 
   void BranchIfNotSmi(Register reg, Label* label) {
     andi(CMPRES1, reg, Immediate(kSmiTagMask));
@@ -1558,9 +1501,9 @@
   void LoadClassIdMayBeSmi(Register result, Register object);
   void LoadTaggedClassIdMayBeSmi(Register result, Register object);
 
-  void StoreIntoObject(Register object,  // Object we are storing into.
+  void StoreIntoObject(Register object,      // Object we are storing into.
                        const Address& dest,  // Where we are storing into.
-                       Register value,  // Value we are storing.
+                       Register value,       // Value we are storing.
                        bool can_value_be_smi = true);
   void StoreIntoObjectOffset(Register object,
                              int32_t offset,
@@ -1599,12 +1542,31 @@
                                     intptr_t index_scale,
                                     Register array,
                                     intptr_t index) const;
+  void LoadElementAddressForIntIndex(Register address,
+                                     bool is_external,
+                                     intptr_t cid,
+                                     intptr_t index_scale,
+                                     Register array,
+                                     intptr_t index);
   Address ElementAddressForRegIndex(bool is_load,
                                     bool is_external,
                                     intptr_t cid,
                                     intptr_t index_scale,
                                     Register array,
                                     Register index);
+  void LoadElementAddressForRegIndex(Register address,
+                                     bool is_load,
+                                     bool is_external,
+                                     intptr_t cid,
+                                     intptr_t index_scale,
+                                     Register array,
+                                     Register index);
+
+  void LoadHalfWordUnaligned(Register dst, Register addr, Register tmp);
+  void LoadHalfWordUnsignedUnaligned(Register dst, Register addr, Register tmp);
+  void StoreHalfWordUnaligned(Register src, Register addr, Register tmp);
+  void LoadWordUnaligned(Register dst, Register addr, Register tmp);
+  void StoreWordUnaligned(Register src, Register addr, Register tmp);
 
   static Address VMTagAddress() {
     return Address(THR, Thread::vm_tag_offset());
@@ -1615,19 +1577,15 @@
   static bool IsSafe(const Object& object) { return true; }
   static bool IsSafeSmi(const Object& object) { return object.IsSmi(); }
 
-  bool constant_pool_allowed() const {
-    return constant_pool_allowed_;
-  }
-  void set_constant_pool_allowed(bool b) {
-    constant_pool_allowed_ = b;
-  }
+  bool constant_pool_allowed() const { return constant_pool_allowed_; }
+  void set_constant_pool_allowed(bool b) { constant_pool_allowed_ = b; }
 
  private:
   AssemblerBuffer buffer_;
   ObjectPoolWrapper object_pool_wrapper_;
 
   intptr_t prologue_offset_;
-
+  bool has_single_entry_point_;
   bool use_far_branches_;
   bool delay_slot_available_;
   bool in_delay_slot_;
@@ -1635,7 +1593,7 @@
   class CodeComment : public ZoneAllocated {
    public:
     CodeComment(intptr_t pc_offset, const String& comment)
-        : pc_offset_(pc_offset), comment_(comment) { }
+        : pc_offset_(pc_offset), comment_(comment) {}
 
     intptr_t pc_offset() const { return pc_offset_; }
     const String& comment() const { return comment_; }
@@ -1669,43 +1627,23 @@
 
   // Encode CPU instructions according to the types specified in
   // Figures 4-1, 4-2 and 4-3 in VolI-A.
-  void EmitIType(Opcode opcode,
-                 Register rs,
-                 Register rt,
-                 uint16_t imm) {
-    Emit(opcode << kOpcodeShift |
-         rs << kRsShift |
-         rt << kRtShift |
-         imm);
+  void EmitIType(Opcode opcode, Register rs, Register rt, uint16_t imm) {
+    Emit(opcode << kOpcodeShift | rs << kRsShift | rt << kRtShift | imm);
   }
 
-  void EmitLoadStore(Opcode opcode, Register rt,
-                     const Address &addr) {
-    Emit(opcode << kOpcodeShift |
-         rt << kRtShift |
-         addr.encoding());
+  void EmitLoadStore(Opcode opcode, Register rt, const Address& addr) {
+    Emit(opcode << kOpcodeShift | rt << kRtShift | addr.encoding());
   }
 
-  void EmitFpuLoadStore(Opcode opcode, FRegister ft,
-                        const Address &addr) {
-    Emit(opcode << kOpcodeShift |
-         ft << kFtShift |
-         addr.encoding());
+  void EmitFpuLoadStore(Opcode opcode, FRegister ft, const Address& addr) {
+    Emit(opcode << kOpcodeShift | ft << kFtShift | addr.encoding());
   }
 
-  void EmitRegImmType(Opcode opcode,
-                      Register rs,
-                      RtRegImm code,
-                      uint16_t imm) {
-    Emit(opcode << kOpcodeShift |
-         rs << kRsShift |
-         code << kRtShift |
-         imm);
+  void EmitRegImmType(Opcode opcode, Register rs, RtRegImm code, uint16_t imm) {
+    Emit(opcode << kOpcodeShift | rs << kRsShift | code << kRtShift | imm);
   }
 
-  void EmitJType(Opcode opcode, uint32_t destination) {
-    UNIMPLEMENTED();
-  }
+  void EmitJType(Opcode opcode, uint32_t destination) { UNIMPLEMENTED(); }
 
   void EmitRType(Opcode opcode,
                  Register rs,
@@ -1714,12 +1652,8 @@
                  int sa,
                  SpecialFunction func) {
     ASSERT(Utils::IsUint(5, sa));
-    Emit(opcode << kOpcodeShift |
-         rs << kRsShift |
-         rt << kRtShift |
-         rd << kRdShift |
-         sa << kSaShift |
-         func << kFunctionShift);
+    Emit(opcode << kOpcodeShift | rs << kRsShift | rt << kRtShift |
+         rd << kRdShift | sa << kSaShift | func << kFunctionShift);
   }
 
   void EmitFpuRType(Opcode opcode,
@@ -1728,12 +1662,8 @@
                     FRegister fs,
                     FRegister fd,
                     Cop1Function func) {
-    Emit(opcode << kOpcodeShift |
-         fmt << kFmtShift |
-         ft << kFtShift |
-         fs << kFsShift |
-         fd << kFdShift |
-         func << kCop1FnShift);
+    Emit(opcode << kOpcodeShift | fmt << kFmtShift | ft << kFtShift |
+         fs << kFsShift | fd << kFdShift | func << kCop1FnShift);
   }
 
   int32_t EncodeBranchOffset(int32_t offset, int32_t instr);
@@ -1744,7 +1674,7 @@
   void EmitFarFpuBranch(bool kind, int32_t offset);
   void EmitBranch(Opcode b, Register rs, Register rt, Label* label);
   void EmitRegImmBranch(RtRegImm b, Register rs, Label* label);
-  void EmitFpuBranch(bool kind, Label *label);
+  void EmitFpuBranch(bool kind, Label* label);
 
   void EmitBranchDelayNop() {
     Emit(Instr::kNopInstruction);  // Branch delay NOP.
@@ -1764,4 +1694,4 @@
 
 }  // namespace dart
 
-#endif  // VM_ASSEMBLER_MIPS_H_
+#endif  // RUNTIME_VM_ASSEMBLER_MIPS_H_
diff --git a/runtime/vm/assembler_mips_test.cc b/runtime/vm/assembler_mips_test.cc
index 2a77101..44c633f 100644
--- a/runtime/vm/assembler_mips_test.cc
+++ b/runtime/vm/assembler_mips_test.cc
@@ -320,6 +320,160 @@
 }
 
 
+ASSEMBLER_TEST_GENERATE(LoadHalfWordUnaligned, assembler) {
+  __ LoadHalfWordUnaligned(V0, A0, TMP);
+  __ jr(RA);
+}
+
+
+ASSEMBLER_TEST_RUN(LoadHalfWordUnaligned, test) {
+  EXPECT(test != NULL);
+  typedef intptr_t (*LoadHalfWordUnaligned)(intptr_t) DART_UNUSED;
+  uint8_t buffer[4] = {
+      0x89, 0xAB, 0xCD, 0xEF,
+  };
+
+  EXPECT_EQ(
+      static_cast<int16_t>(static_cast<uint16_t>(0xAB89)),
+      EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadHalfWordUnaligned, test->entry(),
+                                      reinterpret_cast<intptr_t>(&buffer[0])));
+  EXPECT_EQ(
+      static_cast<int16_t>(static_cast<uint16_t>(0xCDAB)),
+      EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadHalfWordUnaligned, test->entry(),
+                                      reinterpret_cast<intptr_t>(&buffer[1])));
+}
+
+
+ASSEMBLER_TEST_GENERATE(LoadHalfWordUnsignedUnaligned, assembler) {
+  __ LoadHalfWordUnsignedUnaligned(V0, A0, TMP);
+  __ jr(RA);
+}
+
+
+ASSEMBLER_TEST_RUN(LoadHalfWordUnsignedUnaligned, test) {
+  EXPECT(test != NULL);
+  typedef intptr_t (*LoadHalfWordUnsignedUnaligned)(intptr_t) DART_UNUSED;
+  uint8_t buffer[4] = {
+      0x89, 0xAB, 0xCD, 0xEF,
+  };
+
+  EXPECT_EQ(0xAB89, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                        LoadHalfWordUnsignedUnaligned, test->entry(),
+                        reinterpret_cast<intptr_t>(&buffer[0])));
+  EXPECT_EQ(0xCDAB, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                        LoadHalfWordUnsignedUnaligned, test->entry(),
+                        reinterpret_cast<intptr_t>(&buffer[1])));
+}
+
+
+ASSEMBLER_TEST_GENERATE(StoreHalfWordUnaligned, assembler) {
+  __ LoadImmediate(A1, 0xABCD);
+  __ StoreWordUnaligned(A1, A0, TMP);
+  __ mov(V0, A1);
+  __ jr(RA);
+}
+
+
+ASSEMBLER_TEST_RUN(StoreHalfWordUnaligned, test) {
+  EXPECT(test != NULL);
+  typedef intptr_t (*StoreHalfWordUnaligned)(intptr_t) DART_UNUSED;
+  uint8_t buffer[4] = {
+      0, 0, 0, 0,
+  };
+
+  EXPECT_EQ(0xABCD, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                        StoreHalfWordUnaligned, test->entry(),
+                        reinterpret_cast<intptr_t>(&buffer[0])));
+  EXPECT_EQ(0xCD, buffer[0]);
+  EXPECT_EQ(0xAB, buffer[1]);
+  EXPECT_EQ(0, buffer[2]);
+
+  EXPECT_EQ(0xABCD, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                        StoreHalfWordUnaligned, test->entry(),
+                        reinterpret_cast<intptr_t>(&buffer[1])));
+  EXPECT_EQ(0xCD, buffer[1]);
+  EXPECT_EQ(0xAB, buffer[2]);
+  EXPECT_EQ(0, buffer[3]);
+}
+
+
+ASSEMBLER_TEST_GENERATE(LoadWordUnaligned, assembler) {
+  __ LoadWordUnaligned(V0, A0, TMP);
+  __ jr(RA);
+}
+
+
+ASSEMBLER_TEST_RUN(LoadWordUnaligned, test) {
+  EXPECT(test != NULL);
+  typedef intptr_t (*LoadWordUnaligned)(intptr_t) DART_UNUSED;
+  uint8_t buffer[8] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0};
+
+  EXPECT_EQ(
+      static_cast<intptr_t>(0x78563412),
+      EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadWordUnaligned, test->entry(),
+                                      reinterpret_cast<intptr_t>(&buffer[0])));
+  EXPECT_EQ(
+      static_cast<intptr_t>(0x9A785634),
+      EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadWordUnaligned, test->entry(),
+                                      reinterpret_cast<intptr_t>(&buffer[1])));
+  EXPECT_EQ(
+      static_cast<intptr_t>(0xBC9A7856),
+      EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadWordUnaligned, test->entry(),
+                                      reinterpret_cast<intptr_t>(&buffer[2])));
+  EXPECT_EQ(
+      static_cast<intptr_t>(0xDEBC9A78),
+      EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadWordUnaligned, test->entry(),
+                                      reinterpret_cast<intptr_t>(&buffer[3])));
+}
+
+
+ASSEMBLER_TEST_GENERATE(StoreWordUnaligned, assembler) {
+  __ LoadImmediate(A1, 0x12345678);
+  __ StoreWordUnaligned(A1, A0, TMP);
+  __ mov(V0, A1);
+  __ jr(RA);
+}
+
+
+ASSEMBLER_TEST_RUN(StoreWordUnaligned, test) {
+  EXPECT(test != NULL);
+  typedef intptr_t (*StoreWordUnaligned)(intptr_t) DART_UNUSED;
+  uint8_t buffer[8] = {0, 0, 0, 0, 0, 0, 0, 0};
+
+  EXPECT_EQ(0x12345678, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                            StoreWordUnaligned, test->entry(),
+                            reinterpret_cast<intptr_t>(&buffer[0])));
+  EXPECT_EQ(0x78, buffer[0]);
+  EXPECT_EQ(0x56, buffer[1]);
+  EXPECT_EQ(0x34, buffer[2]);
+  EXPECT_EQ(0x12, buffer[3]);
+
+  EXPECT_EQ(0x12345678, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                            StoreWordUnaligned, test->entry(),
+                            reinterpret_cast<intptr_t>(&buffer[1])));
+  EXPECT_EQ(0x78, buffer[1]);
+  EXPECT_EQ(0x56, buffer[2]);
+  EXPECT_EQ(0x34, buffer[3]);
+  EXPECT_EQ(0x12, buffer[4]);
+
+  EXPECT_EQ(0x12345678, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                            StoreWordUnaligned, test->entry(),
+                            reinterpret_cast<intptr_t>(&buffer[2])));
+  EXPECT_EQ(0x78, buffer[2]);
+  EXPECT_EQ(0x56, buffer[3]);
+  EXPECT_EQ(0x34, buffer[4]);
+  EXPECT_EQ(0x12, buffer[5]);
+
+  EXPECT_EQ(0x12345678, EXECUTE_TEST_CODE_INTPTR_INTPTR(
+                            StoreWordUnaligned, test->entry(),
+                            reinterpret_cast<intptr_t>(&buffer[3])));
+  EXPECT_EQ(0x78, buffer[3]);
+  EXPECT_EQ(0x56, buffer[4]);
+  EXPECT_EQ(0x34, buffer[5]);
+  EXPECT_EQ(0x12, buffer[6]);
+}
+
+
 ASSEMBLER_TEST_GENERATE(Lui, assembler) {
   __ lui(V0, Immediate(42));
   __ jr(RA);
@@ -636,7 +790,7 @@
 ASSEMBLER_TEST_GENERATE(Slti, assembler) {
   __ LoadImmediate(T1, -2);
   __ slti(A0, T1, Immediate(-1));  // -2 < -1 -> 1.
-  __ slti(A1, T1, Immediate(0));  // -2 < 0 -> 1.
+  __ slti(A1, T1, Immediate(0));   // -2 < 0 -> 1.
   __ and_(V0, A0, A1);
   __ jr(RA);
 }
@@ -652,7 +806,7 @@
   __ LoadImmediate(T1, -1);
   __ LoadImmediate(T2, 0x10000);
   __ sltiu(A0, T1, Immediate(-2));  // 0xffffffffUL < 0xfffffffeUL -> 0.
-  __ sltiu(A1, T1, Immediate(0));  // 0xffffffffUL < 0 -> 0.
+  __ sltiu(A1, T1, Immediate(0));   // 0xffffffffUL < 0 -> 0.
   __ sltiu(A2, T2, Immediate(-2));  // 0x10000UL < 0xfffffffeUL -> 1.
   __ addiu(A2, A2, Immediate(-1));
   __ or_(V0, A0, A1);
@@ -2042,7 +2196,7 @@
 
 
 ASSEMBLER_TEST_GENERATE(Cop1TruncWD_Overflow, assembler) {
-  __ LoadImmediate(D1, 2.0*kMaxInt32);
+  __ LoadImmediate(D1, 2.0 * kMaxInt32);
   __ truncwd(F0, D1);
   __ mfc1(V0, F0);
   __ Ret();
@@ -2057,7 +2211,7 @@
 
 
 ASSEMBLER_TEST_GENERATE(Cop1TruncWD_Underflow, assembler) {
-  __ LoadImmediate(D1, 2.0*kMinInt32);
+  __ LoadImmediate(D1, 2.0 * kMinInt32);
   __ truncwd(F0, D1);
   __ mfc1(V0, F0);
   __ Ret();
@@ -2130,8 +2284,7 @@
   __ sw(THR, Address(SP, 1 * kWordSize));
   __ sw(RA, Address(SP, 0 * kWordSize));
   __ mov(THR, A2);
-  __ StoreIntoObject(A1,
-                     FieldAddress(A1, GrowableObjectArray::data_offset()),
+  __ StoreIntoObject(A1, FieldAddress(A1, GrowableObjectArray::data_offset()),
                      A0);
   __ lw(RA, Address(SP, 0 * kWordSize));
   __ lw(THR, Address(SP, 1 * kWordSize));
@@ -2153,7 +2306,7 @@
   __ sc(T2, Address(SP));  // T1 == 1, success
   __ LoadImmediate(T3, 1);
   __ bne(T2, T3, &retry);  // NE if context switch occurred between ll and sc
-  __ Pop(V0);  // 42
+  __ Pop(V0);              // 42
   __ LeaveFrameAndReturn();
 }
 
diff --git a/runtime/vm/assembler_test.cc b/runtime/vm/assembler_test.cc
index fbbd994..be5b7c3 100644
--- a/runtime/vm/assembler_test.cc
+++ b/runtime/vm/assembler_test.cc
@@ -15,8 +15,8 @@
 
 ASSEMBLER_TEST_RUN(StoreIntoObject, test) {
 #define TEST_CODE(value, growable_array, thread)                               \
-  test->Invoke<void, RawObject*, RawObject*, Thread*>(                         \
-  value, growable_array, thread)
+  test->Invoke<void, RawObject*, RawObject*, Thread*>(value, growable_array,   \
+                                                      thread)
 
   const Array& old_array = Array::Handle(Array::New(3, Heap::kOld));
   const Array& new_array = Array::Handle(Array::New(3, Heap::kNew));
diff --git a/runtime/vm/assembler_x64.cc b/runtime/vm/assembler_x64.cc
index 213b8cb..20541ef 100644
--- a/runtime/vm/assembler_x64.cc
+++ b/runtime/vm/assembler_x64.cc
@@ -24,11 +24,11 @@
 Assembler::Assembler(bool use_far_branches)
     : buffer_(),
       prologue_offset_(-1),
+      has_single_entry_point_(true),
       comments_(),
       constant_pool_allowed_(false) {
   // Far branching mode is only needed and implemented for MIPS and ARM.
   ASSERT(!use_far_branches);
-  MonomorphicCheckedEntry();
 }
 
 
@@ -487,7 +487,6 @@
 }
 
 
-
 void Assembler::movss(XmmRegister dst, const Address& src) {
   ASSERT(dst <= XMM15);
   AssemblerBuffer::EnsureCapacity ensured(&buffer_);
@@ -2792,9 +2791,8 @@
   if (Thread::CanLoadFromThread(object)) {
     movq(dst, Address(THR, Thread::OffsetFromThread(object)));
   } else if (CanLoadFromObjectPool(object)) {
-    const intptr_t idx =
-        is_unique ? object_pool_wrapper_.AddObject(object)
-                  : object_pool_wrapper_.FindObject(object);
+    const intptr_t idx = is_unique ? object_pool_wrapper_.AddObject(object)
+                                   : object_pool_wrapper_.FindObject(object);
     const int32_t offset = ObjectPool::element_offset(idx);
     LoadWordFromPoolOffset(dst, offset - kHeapObjectTag);
   } else {
@@ -2863,12 +2861,11 @@
     cmpq(reg, Address(THR, Thread::OffsetFromThread(object)));
   } else if (CanLoadFromObjectPool(object)) {
     const intptr_t idx = object_pool_wrapper_.FindObject(object, kNotPatchable);
-    const int32_t offset =  ObjectPool::element_offset(idx);
-    cmpq(reg, Address(PP, offset-kHeapObjectTag));
+    const int32_t offset = ObjectPool::element_offset(idx);
+    cmpq(reg, Address(PP, offset - kHeapObjectTag));
   } else {
     ASSERT(object.IsSmi());
-    CompareImmediate(
-        reg, Immediate(reinterpret_cast<int64_t>(object.raw())));
+    CompareImmediate(reg, Immediate(reinterpret_cast<int64_t>(object.raw())));
   }
 }
 
@@ -2932,9 +2929,8 @@
   // Mask out higher, uninteresting bits which were polluted by dest.
   andl(value, Immediate(kObjectAlignment - 1));
   // Compare with the expected bit pattern.
-  cmpl(value, Immediate(
-      (kNewObjectAlignmentOffset >> 1) + kHeapObjectTag +
-      kOldObjectAlignmentOffset + kHeapObjectTag));
+  cmpl(value, Immediate((kNewObjectAlignmentOffset >> 1) + kHeapObjectTag +
+                        kOldObjectAlignmentOffset + kHeapObjectTag));
   j(NOT_ZERO, no_update, Assembler::kNearJump);
 }
 
@@ -3322,22 +3318,13 @@
 }
 
 
-void Assembler::NoMonomorphicCheckedEntry() {
-  buffer_.Reset();
-  for (intptr_t i = 0; i < Instructions::kCheckedEntryOffset; i++) {
-    int3();
-  }
-  ASSERT(CodeSize() == Instructions::kCheckedEntryOffset);
-}
-
-
 // RDI receiver, RBX guarded cid as Smi
 void Assembler::MonomorphicCheckedEntry() {
+  ASSERT(has_single_entry_point_);
+  has_single_entry_point_ = false;
   Label immediate, have_cid, miss;
   Bind(&miss);
-  movq(CODE_REG, Address(THR, Thread::monomorphic_miss_stub_offset()));
-  movq(RCX, FieldAddress(CODE_REG, Code::entry_point_offset()));
-  jmp(RCX);
+  jmp(Address(THR, Thread::monomorphic_miss_entry_offset()));
 
   Bind(&immediate);
   movq(R10, Immediate(kSmiCid));
@@ -3354,6 +3341,7 @@
   Bind(&have_cid);
   cmpq(R10, RBX);
   j(NOT_EQUAL, &miss, Assembler::kNearJump);
+  nop();
 
   // Fall through to unchecked entry.
   ASSERT(CodeSize() == Instructions::kUncheckedEntryOffset);
@@ -3380,8 +3368,7 @@
 }
 
 
-void Assembler::UpdateAllocationStats(intptr_t cid,
-                                      Heap::Space space) {
+void Assembler::UpdateAllocationStats(intptr_t cid, Heap::Space space) {
   ASSERT(cid > 0);
   intptr_t counter_offset =
       ClassTable::CounterOffsetFor(cid, space == Heap::kNew);
@@ -3515,7 +3502,7 @@
   if (bytes_needed) {
     nop(bytes_needed);
   }
-  ASSERT(((offset + buffer_.GetPosition()) & (alignment-1)) == 0);
+  ASSERT(((offset + buffer_.GetPosition()) & (alignment - 1)) == 0);
 }
 
 
@@ -3640,8 +3627,8 @@
   ASSERT(RawObject::kClassIdTagPos == kBitsPerInt32);
   ASSERT(RawObject::kClassIdTagSize == kBitsPerInt32);
   ASSERT(sizeof(classid_t) == sizeof(uint32_t));
-  const intptr_t class_id_offset = Object::tags_offset() +
-      RawObject::kClassIdTagPos / kBitsPerByte;
+  const intptr_t class_id_offset =
+      Object::tags_offset() + RawObject::kClassIdTagPos / kBitsPerByte;
   movl(result, FieldAddress(object, class_id_offset));
 }
 
@@ -3675,8 +3662,8 @@
   ASSERT(RawObject::kClassIdTagPos == kBitsPerInt32);
   ASSERT(RawObject::kClassIdTagSize == kBitsPerInt32);
   ASSERT(sizeof(classid_t) == sizeof(uint32_t));
-  const intptr_t class_id_offset = Object::tags_offset() +
-      RawObject::kClassIdTagPos / kBitsPerByte;
+  const intptr_t class_id_offset =
+      Object::tags_offset() + RawObject::kClassIdTagPos / kBitsPerByte;
 
   // Untag optimistically. Tag bit is shifted into the CARRY.
   SmiUntag(object);
@@ -3724,7 +3711,7 @@
     return Address(array, index * index_scale);
   } else {
     const int64_t disp = static_cast<int64_t>(index) * index_scale +
-        Instance::DataOffsetFor(cid);
+                         Instance::DataOffsetFor(cid);
     ASSERT(Utils::IsInt(32, disp));
     return FieldAddress(array, static_cast<int32_t>(disp));
   }
@@ -3737,11 +3724,16 @@
   // expected to be untagged before accessing.
   ASSERT(kSmiTagShift == 1);
   switch (index_scale) {
-    case 1: return TIMES_1;
-    case 2: return TIMES_1;
-    case 4: return TIMES_2;
-    case 8: return TIMES_4;
-    case 16: return TIMES_8;
+    case 1:
+      return TIMES_1;
+    case 2:
+      return TIMES_1;
+    case 4:
+      return TIMES_2;
+    case 8:
+      return TIMES_4;
+    case 16:
+      return TIMES_8;
     default:
       UNREACHABLE();
       return TIMES_1;
@@ -3757,18 +3749,15 @@
   if (is_external) {
     return Address(array, index, ToScaleFactor(index_scale), 0);
   } else {
-    return FieldAddress(array,
-                        index,
-                        ToScaleFactor(index_scale),
+    return FieldAddress(array, index, ToScaleFactor(index_scale),
                         Instance::DataOffsetFor(cid));
   }
 }
 
 
 static const char* cpu_reg_names[kNumberOfCpuRegisters] = {
-  "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",
-  "r8", "r9", "r10", "r11", "r12", "r13", "thr", "pp"
-};
+    "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",
+    "r8",  "r9",  "r10", "r11", "r12", "r13", "thr", "pp"};
 
 
 const char* Assembler::RegisterName(Register reg) {
@@ -3778,9 +3767,8 @@
 
 
 static const char* xmm_reg_names[kNumberOfXmmRegisters] = {
-  "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7",
-  "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15"
-};
+    "xmm0", "xmm1", "xmm2",  "xmm3",  "xmm4",  "xmm5",  "xmm6",  "xmm7",
+    "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15"};
 
 
 const char* Assembler::FpuRegisterName(FpuRegister reg) {
diff --git a/runtime/vm/assembler_x64.h b/runtime/vm/assembler_x64.h
index 651fcd5..77f3bb9 100644
--- a/runtime/vm/assembler_x64.h
+++ b/runtime/vm/assembler_x64.h
@@ -2,10 +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.
 
-#ifndef VM_ASSEMBLER_X64_H_
-#define VM_ASSEMBLER_X64_H_
+#ifndef RUNTIME_VM_ASSEMBLER_X64_H_
+#define RUNTIME_VM_ASSEMBLER_X64_H_
 
-#ifndef VM_ASSEMBLER_H_
+#ifndef RUNTIME_VM_ASSEMBLER_H_
 #error Do not include assembler_x64.h directly; use assembler.h instead.
 #endif
 
@@ -23,9 +23,9 @@
 
 class Immediate : public ValueObject {
  public:
-  explicit Immediate(int64_t value) : value_(value) { }
+  explicit Immediate(int64_t value) : value_(value) {}
 
-  Immediate(const Immediate& other) : ValueObject(), value_(other.value_) { }
+  Immediate(const Immediate& other) : ValueObject(), value_(other.value_) {}
 
   int64_t value() const { return value_; }
 
@@ -45,13 +45,9 @@
 
 class Operand : public ValueObject {
  public:
-  uint8_t rex() const {
-    return rex_;
-  }
+  uint8_t rex() const { return rex_; }
 
-  uint8_t mod() const {
-    return (encoding_at(0) >> 6) & 3;
-  }
+  uint8_t mod() const { return (encoding_at(0) >> 6) & 3; }
 
   Register rm() const {
     int rm_rex = (rex_ & REX_B) << 3;
@@ -104,7 +100,7 @@
   }
 
  protected:
-  Operand() : length_(0), rex_(REX_NONE) { }  // Needed by subclass Address.
+  Operand() : length_(0), rex_(REX_NONE) {}  // Needed by subclass Address.
 
   void SetModRM(int mod, Register rm) {
     ASSERT((mod & ~3) == 0);
@@ -155,8 +151,8 @@
   // disguise. Used from the assembler to generate better encodings.
   bool IsRegister(Register reg) const {
     return ((reg > 7 ? 1 : 0) == (rex_ & REX_B))  // REX.B match.
-        && ((encoding_at(0) & 0xF8) == 0xC0)  // Addressing mode is register.
-        && ((encoding_at(0) & 0x07) == reg);  // Register codes match.
+           && ((encoding_at(0) & 0xF8) == 0xC0)  // Addressing mode is register.
+           && ((encoding_at(0) & 0x07) == reg);  // Register codes match.
   }
 
   friend class Assembler;
@@ -218,7 +214,7 @@
   // This addressing mode does not exist.
   Address(Register base, Register index, ScaleFactor scale, Register r);
 
-  Address(const Address& other) : Operand(other) { }
+  Address(const Address& other) : Operand(other) {}
 
   Address& operator=(const Address& other) {
     Operand::operator=(other);
@@ -246,7 +242,7 @@
   }
 
   struct RIPRelativeDisp {
-    explicit RIPRelativeDisp(int32_t disp) : disp_(disp) { }
+    explicit RIPRelativeDisp(int32_t disp) : disp_(disp) {}
     const int32_t disp_;
   };
 
@@ -260,18 +256,18 @@
 class FieldAddress : public Address {
  public:
   FieldAddress(Register base, int32_t disp)
-      : Address(base, disp - kHeapObjectTag) { }
+      : Address(base, disp - kHeapObjectTag) {}
 
   // This addressing mode does not exist.
   FieldAddress(Register base, Register r);
 
   FieldAddress(Register base, Register index, ScaleFactor scale, int32_t disp)
-      : Address(base, index, scale, disp - kHeapObjectTag) { }
+      : Address(base, index, scale, disp - kHeapObjectTag) {}
 
   // This addressing mode does not exist.
   FieldAddress(Register base, Register index, ScaleFactor scale, Register r);
 
-  FieldAddress(const FieldAddress& other) : Address(other) { }
+  FieldAddress(const FieldAddress& other) : Address(other) {}
 
   FieldAddress& operator=(const FieldAddress& other) {
     Address::operator=(other);
@@ -353,7 +349,7 @@
  public:
   explicit Assembler(bool use_far_branches = false);
 
-  ~Assembler() { }
+  ~Assembler() {}
 
   static const bool kNearJump = true;
   static const bool kFarJump = false;
@@ -503,9 +499,9 @@
 
   enum RoundingMode {
     kRoundToNearest = 0x0,
-    kRoundDown      = 0x1,
-    kRoundUp        = 0x2,
-    kRoundToZero    = 0x3
+    kRoundDown = 0x1,
+    kRoundUp = 0x2,
+    kRoundToZero = 0x3
   };
   void roundsd(XmmRegister dst, XmmRegister src, RoundingMode mode);
 
@@ -682,9 +678,7 @@
   void int3();
   void hlt();
 
-  static uword GetBreakInstructionFiller() {
-    return 0xCCCCCCCCCCCCCCCC;
-  }
+  static uword GetBreakInstructionFiller() { return 0xCCCCCCCCCCCCCCCC; }
 
   void j(Condition condition, Label* label, bool near = kFarJump);
 
@@ -749,12 +743,8 @@
 
   void Drop(intptr_t stack_elements, Register tmp = TMP);
 
-  bool constant_pool_allowed() const {
-    return constant_pool_allowed_;
-  }
-  void set_constant_pool_allowed(bool b) {
-    constant_pool_allowed_ = b;
-  }
+  bool constant_pool_allowed() const { return constant_pool_allowed_; }
+  void set_constant_pool_allowed(bool b) { constant_pool_allowed_ = b; }
 
   void LoadImmediate(Register reg, const Immediate& imm);
   void LoadIsolate(Register dst);
@@ -783,9 +773,9 @@
   void CompareObject(Register reg, const Object& object);
 
   // Destroys value.
-  void StoreIntoObject(Register object,  // Object we are storing into.
+  void StoreIntoObject(Register object,      // Object we are storing into.
                        const Address& dest,  // Where we are storing into.
-                       Register value,  // Value we are storing.
+                       Register value,       // Value we are storing.
                        bool can_value_be_smi = true);
 
   void StoreIntoObjectNoBarrier(Register object,
@@ -853,13 +843,9 @@
   /*
    * Misc. functionality.
    */
-  void SmiTag(Register reg) {
-    addq(reg, reg);
-  }
+  void SmiTag(Register reg) { addq(reg, reg); }
 
-  void SmiUntag(Register reg) {
-    sarq(reg, Immediate(kSmiTagSize));
-  }
+  void SmiUntag(Register reg) { sarq(reg, Immediate(kSmiTagSize)); }
 
   void BranchIfNotSmi(Register reg, Label* label) {
     testq(reg, Immediate(kSmiTagMask));
@@ -876,18 +862,15 @@
   const Code::Comments& GetCodeComments() const;
 
   // Address of code at offset.
-  uword CodeAddress(intptr_t offset) {
-    return buffer_.Address(offset);
-  }
+  uword CodeAddress(intptr_t offset) { return buffer_.Address(offset); }
 
   intptr_t CodeSize() const { return buffer_.Size(); }
   intptr_t prologue_offset() const { return prologue_offset_; }
+  bool has_single_entry_point() const { return has_single_entry_point_; }
 
   // Count the fixups that produce a pointer offset, without processing
   // the fixups.
-  intptr_t CountPointerOffsets() const {
-    return buffer_.CountPointerOffsets();
-  }
+  intptr_t CountPointerOffsets() const { return buffer_.CountPointerOffsets(); }
 
   const ZoneGrowableArray<intptr_t>& GetPointerOffsets() const {
     return buffer_.pointer_offsets();
@@ -949,12 +932,9 @@
   void EnterStubFrame();
   void LeaveStubFrame();
 
-  void RawEntry() { buffer_.Reset(); }
-  void NoMonomorphicCheckedEntry();
   void MonomorphicCheckedEntry();
 
-  void UpdateAllocationStats(intptr_t cid,
-                             Heap::Space space);
+  void UpdateAllocationStats(intptr_t cid, Heap::Space space);
 
   void UpdateAllocationStatsWithSize(intptr_t cid,
                                      Register size_reg,
@@ -965,9 +945,7 @@
 
   // If allocation tracing for |cid| is enabled, will jump to |trace| label,
   // which will allocate in the runtime where tracing occurs.
-  void MaybeTraceAllocation(intptr_t cid,
-                            Label* trace,
-                            bool near_jump);
+  void MaybeTraceAllocation(intptr_t cid, Label* trace, bool near_jump);
 
   // Inlined allocation of an instance of class 'cls', code has no runtime
   // calls. Jump to 'failure' if the instance cannot be allocated here.
@@ -1025,11 +1003,12 @@
   ObjectPoolWrapper object_pool_wrapper_;
 
   intptr_t prologue_offset_;
+  bool has_single_entry_point_;
 
   class CodeComment : public ZoneAllocated {
    public:
     CodeComment(intptr_t pc_offset, const String& comment)
-        : pc_offset_(pc_offset), comment_(comment) { }
+        : pc_offset_(pc_offset), comment_(comment) {}
 
     intptr_t pc_offset() const { return pc_offset_; }
     const String& comment() const { return comment_; }
@@ -1146,18 +1125,14 @@
 }
 
 
-inline void Assembler::EmitREX_RB(XmmRegister reg,
-                                  Register base,
-                                  uint8_t rex) {
+inline void Assembler::EmitREX_RB(XmmRegister reg, Register base, uint8_t rex) {
   if (reg > 7) rex |= REX_R;
   if (base > 7) rex |= REX_B;
   if (rex != REX_NONE) EmitUint8(REX_PREFIX | rex);
 }
 
 
-inline void Assembler::EmitREX_RB(Register reg,
-                                  XmmRegister base,
-                                  uint8_t rex) {
+inline void Assembler::EmitREX_RB(Register reg, XmmRegister base, uint8_t rex) {
   if (reg > 7) rex |= REX_R;
   if (base > 7) rex |= REX_B;
   if (rex != REX_NONE) EmitUint8(REX_PREFIX | rex);
@@ -1175,4 +1150,4 @@
 
 }  // namespace dart
 
-#endif  // VM_ASSEMBLER_X64_H_
+#endif  // RUNTIME_VM_ASSEMBLER_X64_H_
diff --git a/runtime/vm/assembler_x64_test.cc b/runtime/vm/assembler_x64_test.cc
index 8a3c373..8816dd0 100644
--- a/runtime/vm/assembler_x64_test.cc
+++ b/runtime/vm/assembler_x64_test.cc
@@ -233,8 +233,7 @@
 ASSEMBLER_TEST_GENERATE(JumpAroundCrash, assembler) {
   Label done;
   // Make sure all the condition jumps work.
-  for (Condition condition = OVERFLOW;
-       condition <= GREATER;
+  for (Condition condition = OVERFLOW; condition <= GREATER;
        condition = static_cast<Condition>(condition + 1)) {
     __ j(condition, &done);
   }
@@ -413,8 +412,8 @@
 ASSEMBLER_TEST_GENERATE(UnsignedMultiply, assembler) {
   __ movl(RAX, Immediate(-1));  // RAX = 0xFFFFFFFF
   __ movl(RCX, Immediate(16));  // RCX = 0x10
-  __ mull(RCX);  // RDX:RAX = RAX * RCX = 0x0FFFFFFFF0
-  __ movq(RAX, RDX);  // Return high32(0x0FFFFFFFF0) == 0x0F
+  __ mull(RCX);                 // RDX:RAX = RAX * RCX = 0x0FFFFFFFF0
+  __ movq(RAX, RDX);            // Return high32(0x0FFFFFFFF0) == 0x0F
   __ ret();
 }
 
@@ -534,8 +533,8 @@
 ASSEMBLER_TEST_GENERATE(UnsignedMultiplyLong, assembler) {
   __ movq(RAX, Immediate(-1));  // RAX = 0xFFFFFFFFFFFFFFFF
   __ movq(RCX, Immediate(16));  // RCX = 0x10
-  __ mulq(RCX);  // RDX:RAX = RAX * RCX = 0x0FFFFFFFFFFFFFFFF0
-  __ movq(RAX, RDX);  // Return high64(0x0FFFFFFFFFFFFFFFF0) == 0x0F
+  __ mulq(RCX);                 // RDX:RAX = RAX * RCX = 0x0FFFFFFFFFFFFFFFF0
+  __ movq(RAX, RDX);            // Return high64(0x0FFFFFFFFFFFFFFFF0) == 0x0F
   __ ret();
 }
 
@@ -801,8 +800,8 @@
   __ pushq(CallingConventions::kArg1Reg);
   __ movl(RAX, Address(RSP, 0));  // left low.
   __ movl(RDX, Address(RSP, 4));  // left high.
-  __ addl(RAX, Immediate(12));  // right low immediate.
-  __ adcl(RDX, Immediate(11));  // right high immediate.
+  __ addl(RAX, Immediate(12));    // right low immediate.
+  __ adcl(RDX, Immediate(11));    // right high immediate.
   // Result is in RAX/RDX.
   __ movl(Address(RSP, 0), RAX);  // result low.
   __ movl(Address(RSP, 4), RDX);  // result high.
@@ -826,9 +825,9 @@
 ASSEMBLER_TEST_GENERATE(LongAddAddress, assembler) {
   __ pushq(CallingConventions::kArg2Reg);
   __ pushq(CallingConventions::kArg1Reg);
-  __ movl(RAX, Address(RSP, 0));  // left low.
-  __ movl(RDX, Address(RSP, 4));  // left high.
-  __ addl(RAX, Address(RSP, 8));  // low.
+  __ movl(RAX, Address(RSP, 0));   // left low.
+  __ movl(RDX, Address(RSP, 4));   // left high.
+  __ addl(RAX, Address(RSP, 8));   // low.
   __ adcl(RDX, Address(RSP, 12));  // high.
   // Result is in RAX/RDX.
   __ movl(Address(RSP, 0), RAX);  // result low.
@@ -887,8 +886,8 @@
   __ pushq(CallingConventions::kArg1Reg);
   __ movl(RAX, Address(RSP, 0));  // left low.
   __ movl(RDX, Address(RSP, 4));  // left high.
-  __ subl(RAX, Immediate(12));  // right low immediate.
-  __ sbbl(RDX, Immediate(11));  // right high immediate.
+  __ subl(RAX, Immediate(12));    // right low immediate.
+  __ sbbl(RDX, Immediate(11));    // right high immediate.
   // Result is in RAX/RDX.
   __ movl(Address(RSP, 0), RAX);  // result low.
   __ movl(Address(RSP, 4), RDX);  // result high.
@@ -912,9 +911,9 @@
 ASSEMBLER_TEST_GENERATE(LongSubAddress, assembler) {
   __ pushq(CallingConventions::kArg2Reg);
   __ pushq(CallingConventions::kArg1Reg);
-  __ movl(RAX, Address(RSP, 0));  // left low.
-  __ movl(RDX, Address(RSP, 4));  // left high.
-  __ subl(RAX, Address(RSP, 8));  // low.
+  __ movl(RAX, Address(RSP, 0));   // left low.
+  __ movl(RDX, Address(RSP, 4));   // left high.
+  __ subl(RAX, Address(RSP, 8));   // low.
   __ sbbl(RDX, Address(RSP, 12));  // high.
   // Result is in RAX/RDX.
   __ movl(Address(RSP, 0), RAX);  // result low.
@@ -964,9 +963,9 @@
 
 ASSEMBLER_TEST_GENERATE(AddImmediate, assembler) {
   __ movq(R10, CallingConventions::kArg1Reg);  // al.
-  __ addq(R10, Immediate(13));  // bl.
+  __ addq(R10, Immediate(13));                 // bl.
   __ movq(RAX, CallingConventions::kArg2Reg);  // ah.
-  __ adcq(RAX, Immediate(14));  // bh.
+  __ adcq(RAX, Immediate(14));                 // bh.
   // RAX = high64(ah:al + bh:bl).
   __ ret();
 }
@@ -1040,9 +1039,9 @@
 
 ASSEMBLER_TEST_GENERATE(SubImmediate, assembler) {
   __ movq(R10, CallingConventions::kArg1Reg);  // al.
-  __ subq(R10, Immediate(12));  // bl.
+  __ subq(R10, Immediate(12));                 // bl.
   __ movq(RAX, CallingConventions::kArg2Reg);  // ah.
-  __ sbbq(RAX, Immediate(11));  // bh.
+  __ sbbq(RAX, Immediate(11));                 // bh.
   // RAX = high64(ah:al - bh:bl).
   __ ret();
 }
@@ -1811,8 +1810,9 @@
 
 static int ComputeStackSpaceReservation(int needed, int fixed) {
   return (OS::ActivationFrameAlignment() > 1)
-      ? Utils::RoundUp(needed + fixed, OS::ActivationFrameAlignment()) - fixed
-      : needed;
+             ? Utils::RoundUp(needed + fixed, OS::ActivationFrameAlignment()) -
+                   fixed
+             : needed;
 }
 
 
@@ -1972,11 +1972,11 @@
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant0 = { 1.0, 2.0 };
+  } constant0 = {1.0, 2.0};
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant1 = { 3.0, 4.0 };
+  } constant1 = {3.0, 4.0};
   __ movq(RAX, Immediate(reinterpret_cast<uword>(&constant0)));
   __ movups(XMM10, Address(RAX, 0));
   __ movq(RAX, Immediate(reinterpret_cast<uword>(&constant1)));
@@ -1998,11 +1998,11 @@
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant0 = { 1.0, 2.0 };
+  } constant0 = {1.0, 2.0};
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant1 = { 3.0, 4.0 };
+  } constant1 = {3.0, 4.0};
   __ movq(RAX, Immediate(reinterpret_cast<uword>(&constant0)));
   __ movups(XMM10, Address(RAX, 0));
   __ movq(RAX, Immediate(reinterpret_cast<uword>(&constant1)));
@@ -2046,7 +2046,7 @@
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant0 = { 1.0, 2.0 };
+  } constant0 = {1.0, 2.0};
   EnterTestFrame(assembler);
   __ movq(RAX, Immediate(reinterpret_cast<uword>(&constant0)));
   __ movups(XMM10, Address(RAX, 0));
@@ -2067,7 +2067,7 @@
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant0 = { -1.0, 2.0 };
+  } constant0 = {-1.0, 2.0};
   EnterTestFrame(assembler);
   __ movq(RAX, Immediate(reinterpret_cast<uword>(&constant0)));
   __ movups(XMM10, Address(RAX, 0));
@@ -2088,11 +2088,11 @@
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant0 = { 3.0, 2.0 };
+  } constant0 = {3.0, 2.0};
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant1 = { 3.0, 4.0 };
+  } constant1 = {3.0, 4.0};
   __ movq(RAX, Immediate(reinterpret_cast<uword>(&constant0)));
   __ movups(XMM10, Address(RAX, 0));
   __ movq(RAX, Immediate(reinterpret_cast<uword>(&constant1)));
@@ -2114,11 +2114,11 @@
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant0 = { 9.0, 2.0 };
+  } constant0 = {9.0, 2.0};
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant1 = { 3.0, 4.0 };
+  } constant1 = {3.0, 4.0};
   __ movq(RAX, Immediate(reinterpret_cast<uword>(&constant0)));
   __ movups(XMM10, Address(RAX, 0));
   __ movq(RAX, Immediate(reinterpret_cast<uword>(&constant1)));
@@ -2140,7 +2140,7 @@
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant0 = { 16.0, 2.0 };
+  } constant0 = {16.0, 2.0};
   __ movq(RAX, Immediate(reinterpret_cast<uword>(&constant0)));
   __ movups(XMM10, Address(RAX, 0));
   __ sqrtpd(XMM10);
@@ -2160,11 +2160,11 @@
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant0 = { 9.0, 2.0 };
+  } constant0 = {9.0, 2.0};
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant1 = { 3.0, 4.0 };
+  } constant1 = {3.0, 4.0};
   __ movq(RAX, Immediate(reinterpret_cast<uword>(&constant0)));
   __ movups(XMM10, Address(RAX, 0));
   __ movq(RAX, Immediate(reinterpret_cast<uword>(&constant1)));
@@ -2186,11 +2186,11 @@
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant0 = { 9.0, 2.0 };
+  } constant0 = {9.0, 2.0};
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant1 = { 3.0, 4.0 };
+  } constant1 = {3.0, 4.0};
   __ movq(RAX, Immediate(reinterpret_cast<uword>(&constant0)));
   __ movups(XMM10, Address(RAX, 0));
   __ movq(RAX, Immediate(reinterpret_cast<uword>(&constant1)));
@@ -2212,7 +2212,7 @@
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant0 = { 2.0, 9.0 };
+  } constant0 = {2.0, 9.0};
   __ movq(RAX, Immediate(reinterpret_cast<uword>(&constant0)));
   __ movups(XMM10, Address(RAX, 0));
   // Splat Y across all lanes.
@@ -2236,7 +2236,7 @@
   static const struct ALIGN16 {
     double a;
     double b;
-  } constant0 = { 9.0, 2.0 };
+  } constant0 = {9.0, 2.0};
   __ movq(RAX, Immediate(reinterpret_cast<uword>(&constant0)));
   __ movups(XMM11, Address(RAX, 0));
   __ cvtpd2ps(XMM10, XMM11);
@@ -2258,7 +2258,7 @@
     float b;
     float c;
     float d;
-  } constant0 = { 9.0f, 2.0f, 3.0f, 4.0f };
+  } constant0 = {9.0f, 2.0f, 3.0f, 4.0f};
   __ movq(RAX, Immediate(reinterpret_cast<uword>(&constant0)));
   __ movups(XMM11, Address(RAX, 0));
   __ cvtps2pd(XMM10, XMM11);
@@ -2387,11 +2387,11 @@
   __ movd(XMM0, RAX);
   __ shufps(XMM0, XMM0, Immediate(0x0));
 
-  __ movaps(XMM11, XMM0);  // Copy XMM0
-  __ reciprocalps(XMM11);  // 0.25
-  __ sqrtps(XMM11);  // 0.5
-  __ rsqrtps(XMM0);  // ~0.5
-  __ subps(XMM0, XMM11);  // ~0.0
+  __ movaps(XMM11, XMM0);                  // Copy XMM0
+  __ reciprocalps(XMM11);                  // 0.25
+  __ sqrtps(XMM11);                        // 0.5
+  __ rsqrtps(XMM0);                        // ~0.5
+  __ subps(XMM0, XMM11);                   // ~0.0
   __ shufps(XMM0, XMM0, Immediate(0x00));  // Copy second lane into all 4 lanes.
   __ ret();
 }
@@ -2600,15 +2600,13 @@
     uint32_t b;
     uint32_t c;
     uint32_t d;
-  } constant1 =
-      { 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0 };
+  } constant1 = {0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0};
   static const struct ALIGN16 {
     uint32_t a;
     uint32_t b;
     uint32_t c;
     uint32_t d;
-  } constant2 =
-      { 0x0F0F0F0F, 0x0F0F0F0F, 0x0F0F0F0F, 0x0F0F0F0F };
+  } constant2 = {0x0F0F0F0F, 0x0F0F0F0F, 0x0F0F0F0F, 0x0F0F0F0F};
   __ movq(RAX, Immediate(reinterpret_cast<intptr_t>(&constant1)));
   __ movups(XMM0, Address(RAX, 0));
   __ movq(RAX, Immediate(reinterpret_cast<intptr_t>(&constant2)));
@@ -2634,15 +2632,13 @@
     uint32_t b;
     uint32_t c;
     uint32_t d;
-  } constant1 =
-      { 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0 };
+  } constant1 = {0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0};
   static const struct ALIGN16 {
     uint32_t a;
     uint32_t b;
     uint32_t c;
     uint32_t d;
-  } constant2 =
-      { 0x0F0FFF0F, 0x0F0F0F0F, 0x0F0F0F0F, 0x0F0F0F0F };
+  } constant2 = {0x0F0FFF0F, 0x0F0F0F0F, 0x0F0F0F0F, 0x0F0F0F0F};
   __ movq(RAX, Immediate(reinterpret_cast<intptr_t>(&constant1)));
   __ movups(XMM0, Address(RAX, 0));
   __ movq(RAX, Immediate(reinterpret_cast<intptr_t>(&constant2)));
@@ -2667,8 +2663,7 @@
     uint32_t b;
     uint32_t c;
     uint32_t d;
-  } constant1 =
-      { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
+  } constant1 = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
   EnterTestFrame(assembler);
   __ LoadImmediate(RAX, Immediate(reinterpret_cast<intptr_t>(&constant1)));
   __ movups(XMM9, Address(RAX, 0));
@@ -2694,13 +2689,13 @@
     float b;
     float c;
     float d;
-  } constant0 = { 1.0, 2.0, 3.0, 4.0 };
+  } constant0 = {1.0, 2.0, 3.0, 4.0};
   static const struct ALIGN16 {
     float a;
     float b;
     float c;
     float d;
-  } constant1 = { 5.0, 6.0, 7.0, 8.0 };
+  } constant1 = {5.0, 6.0, 7.0, 8.0};
   // XMM9 = 1.0f, 2.0f, 3.0f, 4.0f.
   __ movq(RAX, Immediate(reinterpret_cast<intptr_t>(&constant0)));
   __ movups(XMM9, Address(RAX, 0));
@@ -2714,7 +2709,7 @@
   __ movaps(XMM1, XMM9);
   __ shufps(XMM9, XMM9, Immediate(0x00));  // 7.0f.
   __ shufps(XMM1, XMM1, Immediate(0x55));  // 8.0f.
-  __ addss(XMM9, XMM1);  // 15.0f.
+  __ addss(XMM9, XMM1);                    // 15.0f.
   __ movaps(XMM0, XMM9);
   __ ret();
 }
@@ -2733,13 +2728,13 @@
     float b;
     float c;
     float d;
-  } constant0 = { 1.0, 2.0, 3.0, 4.0 };
+  } constant0 = {1.0, 2.0, 3.0, 4.0};
   static const struct ALIGN16 {
     float a;
     float b;
     float c;
     float d;
-  } constant1 = { 5.0, 6.0, 7.0, 8.0 };
+  } constant1 = {5.0, 6.0, 7.0, 8.0};
   // XMM9 = 1.0f, 2.0f, 3.0f, 4.0f.
   __ movq(RAX, Immediate(reinterpret_cast<intptr_t>(&constant0)));
   __ movups(XMM9, Address(RAX, 0));
@@ -2753,7 +2748,7 @@
   __ movaps(XMM1, XMM9);
   __ shufps(XMM9, XMM9, Immediate(0xAA));  // 5.0f.
   __ shufps(XMM1, XMM1, Immediate(0xFF));  // 6.0f.
-  __ addss(XMM9, XMM1);  // 11.0f.
+  __ addss(XMM9, XMM1);                    // 11.0f.
   __ movaps(XMM0, XMM9);
   __ ret();
 }
@@ -2772,13 +2767,13 @@
     float b;
     float c;
     float d;
-  } constant0 = { 1.0, 2.0, 3.0, 4.0 };
+  } constant0 = {1.0, 2.0, 3.0, 4.0};
   static const struct ALIGN16 {
     float a;
     float b;
     float c;
     float d;
-  } constant1 = { 5.0, 6.0, 7.0, 8.0 };
+  } constant1 = {5.0, 6.0, 7.0, 8.0};
   // XMM9 = 1.0f, 2.0f, 3.0f, 4.0f.
   __ movq(RAX, Immediate(reinterpret_cast<intptr_t>(&constant0)));
   __ movups(XMM9, Address(RAX, 0));
@@ -2810,13 +2805,13 @@
     float b;
     float c;
     float d;
-  } constant0 = { 1.0, 2.0, 3.0, 4.0 };
+  } constant0 = {1.0, 2.0, 3.0, 4.0};
   static const struct ALIGN16 {
     float a;
     float b;
     float c;
     float d;
-  } constant1 = { 5.0, 6.0, 7.0, 8.0 };
+  } constant1 = {5.0, 6.0, 7.0, 8.0};
   // XMM9 = 1.0f, 2.0f, 3.0f, 4.0f.
   __ movq(RAX, Immediate(reinterpret_cast<intptr_t>(&constant0)));
   __ movups(XMM9, Address(RAX, 0));
@@ -2848,13 +2843,13 @@
     float b;
     float c;
     float d;
-  } constant0 = { 1.0, 2.0, 3.0, 4.0 };
+  } constant0 = {1.0, 2.0, 3.0, 4.0};
   static const struct ALIGN16 {
     float a;
     float b;
     float c;
     float d;
-  } constant1 = { 5.0, 6.0, 7.0, 8.0 };
+  } constant1 = {5.0, 6.0, 7.0, 8.0};
   // XMM9 = 1.0f, 2.0f, 3.0f, 4.0f.
   __ movq(RAX, Immediate(reinterpret_cast<intptr_t>(&constant0)));
   __ movups(XMM9, Address(RAX, 0));
@@ -2886,13 +2881,13 @@
     float b;
     float c;
     float d;
-  } constant0 = { 1.0, 2.0, 3.0, 4.0 };
+  } constant0 = {1.0, 2.0, 3.0, 4.0};
   static const struct ALIGN16 {
     float a;
     float b;
     float c;
     float d;
-  } constant1 = { 5.0, 6.0, 7.0, 8.0 };
+  } constant1 = {5.0, 6.0, 7.0, 8.0};
   // XMM9 = 1.0f, 2.0f, 3.0f, 4.0f.
   __ movq(RAX, Immediate(reinterpret_cast<intptr_t>(&constant0)));
   __ movups(XMM9, Address(RAX, 0));
@@ -2975,8 +2970,8 @@
 
 ASSEMBLER_TEST_RUN(DoubleFPMoves, test) {
   typedef double (*DoubleFPMovesCode)();
-  EXPECT_FLOAT_EQ(1024.67,
-                  reinterpret_cast<DoubleFPMovesCode>(test->entry())(), 0.001);
+  EXPECT_FLOAT_EQ(1024.67, reinterpret_cast<DoubleFPMovesCode>(test->entry())(),
+                  0.001);
 }
 
 
@@ -2994,12 +2989,12 @@
   __ divsd(XMM8, XMM12);  // 14.7
   __ sqrtsd(XMM8, XMM8);  // 3.834
   __ movsd(XMM1, Address(RSP, 0));
-  __ addsd(XMM0, XMM1);  // 15.7
-  __ mulsd(XMM0, XMM1);  // 53.38
-  __ subsd(XMM0, XMM1);  // 49.98
-  __ divsd(XMM0, XMM1);  // 14.7
+  __ addsd(XMM0, XMM1);   // 15.7
+  __ mulsd(XMM0, XMM1);   // 53.38
+  __ subsd(XMM0, XMM1);   // 49.98
+  __ divsd(XMM0, XMM1);   // 14.7
   __ sqrtsd(XMM0, XMM0);  // 3.834057902
-  __ addsd(XMM0, XMM8);  // 7.6681
+  __ addsd(XMM0, XMM8);   // 7.6681
   __ popq(RAX);
   __ ret();
 }
@@ -3035,7 +3030,7 @@
   __ movq(RDX, Immediate(12LL << 32));
   __ cvtsi2sdq(XMM0, RDX);
   __ movsd(XMM15, XMM0);  // Move to high register
-  __ addsd(XMM0, XMM0);  // Stomp XMM0
+  __ addsd(XMM0, XMM0);   // Stomp XMM0
   __ movsd(XMM0, XMM15);  // Move back to XMM0
   __ ret();
 }
@@ -3113,8 +3108,6 @@
 
 
 ASSEMBLER_TEST_GENERATE(TestNop, assembler) {
-  __ RawEntry();
-
   __ nop(1);
   __ nop(2);
   __ nop(3);
@@ -3136,8 +3129,6 @@
 
 
 ASSEMBLER_TEST_GENERATE(TestAlign0, assembler) {
-  __ RawEntry();
-
   __ Align(4, 0);
   __ movq(RAX, Immediate(assembler->CodeSize()));  // Return code size.
   __ ret();
@@ -3152,8 +3143,6 @@
 
 
 ASSEMBLER_TEST_GENERATE(TestAlign1, assembler) {
-  __ RawEntry();
-
   __ nop(1);
   __ Align(4, 0);
   __ movq(RAX, Immediate(assembler->CodeSize()));  // Return code size.
@@ -3169,8 +3158,6 @@
 
 
 ASSEMBLER_TEST_GENERATE(TestAlign1Offset1, assembler) {
-  __ RawEntry();
-
   __ nop(1);
   __ Align(4, 1);
   __ movq(RAX, Immediate(assembler->CodeSize()));  // Return code size.
@@ -3186,8 +3173,6 @@
 
 
 ASSEMBLER_TEST_GENERATE(TestAlignLarge, assembler) {
-  __ RawEntry();
-
   __ nop(1);
   __ Align(16, 0);
   __ movq(RAX, Immediate(assembler->CodeSize()));  // Return code size.
@@ -3445,7 +3430,7 @@
 
 ASSEMBLER_TEST_RUN(DoubleAbs, test) {
   double val = -12.45;
-  double res =  test->InvokeWithCodeAndThread<double, double>(val);
+  double res = test->InvokeWithCodeAndThread<double, double>(val);
   EXPECT_FLOAT_EQ(-val, res, 0.001);
   val = 12.45;
   res = test->InvokeWithCodeAndThread<double, double>(val);
@@ -3489,9 +3474,9 @@
 ASSEMBLER_TEST_GENERATE(TestRepMovsBytes, assembler) {
   __ pushq(RSI);
   __ pushq(RDI);
-  __ pushq(CallingConventions::kArg1Reg);  // from.
-  __ pushq(CallingConventions::kArg2Reg);  // to.
-  __ pushq(CallingConventions::kArg3Reg);  // count.
+  __ pushq(CallingConventions::kArg1Reg);     // from.
+  __ pushq(CallingConventions::kArg2Reg);     // to.
+  __ pushq(CallingConventions::kArg3Reg);     // count.
   __ movq(RSI, Address(RSP, 2 * kWordSize));  // from.
   __ movq(RDI, Address(RSP, 1 * kWordSize));  // to.
   __ movq(RCX, Address(RSP, 0 * kWordSize));  // count.
@@ -3515,13 +3500,13 @@
   for (int i = 0; i < 10; i++) {
     EXPECT_EQ(from[i], to[i]);
   }
-  delete [] to;
+  delete[] to;
 }
 
 
 ASSEMBLER_TEST_GENERATE(ConditionalMovesCompare, assembler) {
   __ cmpq(CallingConventions::kArg1Reg, CallingConventions::kArg2Reg);
-  __ movq(RDX, Immediate(1));  // Greater equal.
+  __ movq(RDX, Immediate(1));   // Greater equal.
   __ movq(RCX, Immediate(-1));  // Less
   __ cmovlessq(RAX, RCX);
   __ cmovgeq(RAX, RDX);
@@ -3592,8 +3577,8 @@
 
 ASSEMBLER_TEST_RUN(ConditionalMovesNoOverflow, test) {
   typedef int (*ConditionalMovesNoOverflowCode)(int64_t i, int64_t j);
-  int res = reinterpret_cast<ConditionalMovesNoOverflowCode>(
-      test->entry())(0x7fffffffffffffff, 2);
+  int res = reinterpret_cast<ConditionalMovesNoOverflowCode>(test->entry())(
+      0x7fffffffffffffff, 2);
   EXPECT_EQ(1, res);
   res = reinterpret_cast<ConditionalMovesNoOverflowCode>(test->entry())(1, 1);
   EXPECT_EQ(0, res);
diff --git a/runtime/vm/ast.cc b/runtime/vm/ast.cc
index 2ba8dc1..69fb0d3 100644
--- a/runtime/vm/ast.cc
+++ b/runtime/vm/ast.cc
@@ -14,18 +14,16 @@
 namespace dart {
 
 #define DEFINE_VISIT_FUNCTION(BaseName)                                        \
-void BaseName##Node::Visit(AstNodeVisitor* visitor) {                          \
-  visitor->Visit##BaseName##Node(this);                                        \
-}
+  void BaseName##Node::Visit(AstNodeVisitor* visitor) {                        \
+    visitor->Visit##BaseName##Node(this);                                      \
+  }
 
 FOR_EACH_NODE(DEFINE_VISIT_FUNCTION)
 #undef DEFINE_VISIT_FUNCTION
 
 
 #define DEFINE_NAME_FUNCTION(BaseName)                                         \
-const char* BaseName##Node::Name() const {                                     \
-  return #BaseName;                                                            \
-}
+  const char* BaseName##Node::Name() const { return #BaseName; }
 
 FOR_EACH_NODE(DEFINE_NAME_FUNCTION)
 #undef DEFINE_NAME_FUNCTION
@@ -46,8 +44,7 @@
 // array.
 class AstNodeCollector : public AstNodeVisitor {
  public:
-  explicit AstNodeCollector(GrowableArray<AstNode*>* nodes)
-    : nodes_(nodes) { }
+  explicit AstNodeCollector(GrowableArray<AstNode*>* nodes) : nodes_(nodes) {}
 
 #define DEFINE_VISITOR_FUNCTION(BaseName)                                      \
   virtual void Visit##BaseName##Node(BaseName##Node* node) {                   \
@@ -55,7 +52,7 @@
     node->VisitChildren(this);                                                 \
   }
 
-FOR_EACH_NODE(DEFINE_VISITOR_FUNCTION)
+  FOR_EACH_NODE(DEFINE_VISITOR_FUNCTION)
 #undef DEFINE_VISITOR_FUNCTION
 
  private:
@@ -85,8 +82,7 @@
 }
 
 
-void PrimaryNode::VisitChildren(AstNodeVisitor* visitor) const {
-}
+void PrimaryNode::VisitChildren(AstNodeVisitor* visitor) const {}
 
 
 void ArgumentListNode::VisitChildren(AstNodeVisitor* visitor) const {
@@ -97,10 +93,7 @@
 
 
 LetNode::LetNode(TokenPosition token_pos)
-  : AstNode(token_pos),
-    vars_(1),
-    initializers_(1),
-    nodes_(1) { }
+    : AstNode(token_pos), vars_(1), initializers_(1), nodes_(1) {}
 
 
 LocalVariable* LetNode::AddInitializer(AstNode* node) {
@@ -108,10 +101,10 @@
   Zone* zone = thread->zone();
   initializers_.Add(node);
   char name[64];
-  OS::SNPrint(name, sizeof(name), ":lt%s_%" Pd "",
-      token_pos().ToCString(), vars_.length());
+  OS::SNPrint(name, sizeof(name), ":lt%s_%" Pd "", token_pos().ToCString(),
+              vars_.length());
   LocalVariable* temp_var =
-      new LocalVariable(token_pos(),
+      new LocalVariable(TokenPosition::kNoSource, token_pos(),
                         String::ZoneHandle(zone, Symbols::New(thread, name)),
                         Object::dynamic_type());
   vars_.Add(temp_var);
@@ -232,10 +225,9 @@
 
 
 bool ComparisonNode::IsKindValid() const {
-  return Token::IsRelationalOperator(kind_)
-      || Token::IsEqualityOperator(kind_)
-      || Token::IsTypeTestOperator(kind_)
-      || Token::IsTypeCastOperator(kind_);
+  return Token::IsRelationalOperator(kind_) ||
+         Token::IsEqualityOperator(kind_) || Token::IsTypeTestOperator(kind_) ||
+         Token::IsTypeCastOperator(kind_);
 }
 
 
@@ -255,7 +247,7 @@
     case Token::kEQ_STRICT:
     case Token::kNE_STRICT:
       return this->left()->IsPotentiallyConst() &&
-          this->right()->IsPotentiallyConst();
+             this->right()->IsPotentiallyConst();
     default:
       return false;
   }
@@ -285,14 +277,10 @@
     case Token::kNE:
       // The comparison is a compile time const if both operands are either a
       // number, string, or boolean value (but not necessarily the same type).
-      if ((left_val->IsNumber() ||
-          left_val->IsString() ||
-          left_val->IsBool() ||
-          left_val->IsNull()) &&
-          (right_val->IsNumber() ||
-          right_val->IsString() ||
-          right_val->IsBool() ||
-          right_val->IsNull())) {
+      if ((left_val->IsNumber() || left_val->IsString() || left_val->IsBool() ||
+           left_val->IsNull()) &&
+          (right_val->IsNumber() || right_val->IsString() ||
+           right_val->IsBool() || right_val->IsNull())) {
         return &Bool::False();
       }
       return NULL;
@@ -308,7 +296,6 @@
 }
 
 
-
 bool BinaryOpNode::IsKindValid() const {
   switch (kind_) {
     case Token::kADD:
@@ -349,7 +336,7 @@
           this->right()->AsLiteralNode()->literal().IsNull()) {
         return false;
       }
-      // Fall-through intentional.
+    // Fall-through intentional.
     case Token::kADD:
     case Token::kSUB:
     case Token::kMUL:
@@ -363,7 +350,7 @@
     case Token::kSHR:
     case Token::kIFNULL:
       return this->left()->IsPotentiallyConst() &&
-          this->right()->IsPotentiallyConst();
+             this->right()->IsPotentiallyConst();
     default:
       UNREACHABLE();
       return false;
@@ -389,7 +376,7 @@
       if (left_val->IsString()) {
         return right_val->IsString() ? left_val : NULL;
       }
-      // Fall-through intentional.
+    // Fall-through intentional.
     case Token::kSUB:
     case Token::kMUL:
     case Token::kDIV:
@@ -401,8 +388,7 @@
         } else if (right_val->IsNumber()) {
           return right_val;
         }
-      } else if (left_val->IsNumber() &&
-                 right_val->IsNumber()) {
+      } else if (left_val->IsNumber() && right_val->IsNumber()) {
         return left_val;
       }
       return NULL;
@@ -411,8 +397,7 @@
     case Token::kBIT_AND:
     case Token::kSHL:
     case Token::kSHR:
-      if (left_val->IsInteger() &&
-          right_val->IsInteger()) {
+      if (left_val->IsInteger() && right_val->IsInteger()) {
         return right_val;
       }
       return NULL;
@@ -487,15 +472,14 @@
 
 bool ConditionalExprNode::IsPotentiallyConst() const {
   return this->condition()->IsPotentiallyConst() &&
-    this->true_expr()->IsPotentiallyConst() &&
-    this->false_expr()->IsPotentiallyConst();
+         this->true_expr()->IsPotentiallyConst() &&
+         this->false_expr()->IsPotentiallyConst();
 }
 
 
 const Instance* ConditionalExprNode::EvalConstExpr() const {
   const Instance* cond = this->condition()->EvalConstExpr();
-  if ((cond != NULL) &&
-      cond->IsBool() &&
+  if ((cond != NULL) && cond->IsBool() &&
       (this->true_expr()->EvalConstExpr() != NULL) &&
       (this->false_expr()->EvalConstExpr() != NULL)) {
     return cond;
@@ -513,8 +497,7 @@
 
 
 const Instance* ClosureNode::EvalConstExpr() const {
-  if (!is_deferred_reference_ &&
-      function().IsImplicitStaticClosureFunction()) {
+  if (!is_deferred_reference_ && function().IsImplicitStaticClosureFunction()) {
     // Return a value that represents an instance. Only the type is relevant.
     return &Instance::Handle();
   }
@@ -527,11 +510,9 @@
     // This is an implicit closure node created because a static getter was not
     // found. Change the getter into a setter. If it does not exist,
     // noSuchMethod will be called.
-    return new StaticSetterNode(token_pos(),
-                                receiver(),
+    return new StaticSetterNode(token_pos(), receiver(),
                                 Class::ZoneHandle(function().Owner()),
-                                String::ZoneHandle(function().name()),
-                                rhs);
+                                String::ZoneHandle(function().name()), rhs);
   }
   return NULL;
 }
@@ -578,30 +559,24 @@
     return NULL;
   }
   if (Isolate::Current()->type_checks()) {
-    rhs = new AssignableNode(
-        field().token_pos(),
-        rhs,
-        AbstractType::ZoneHandle(field().type()),
-        String::ZoneHandle(field().name()));
+    rhs = new AssignableNode(field().token_pos(), rhs,
+                             AbstractType::ZoneHandle(field().type()),
+                             String::ZoneHandle(field().name()));
   }
-  return new StoreStaticFieldNode(
-      token_pos(), Field::ZoneHandle(field().Original()), rhs);
+  return new StoreStaticFieldNode(token_pos(),
+                                  Field::ZoneHandle(field().Original()), rhs);
 }
 
 
 AstNode* InstanceGetterNode::MakeAssignmentNode(AstNode* rhs) {
-  return new InstanceSetterNode(token_pos(),
-                                receiver(),
-                                field_name(),
-                                rhs,
+  return new InstanceSetterNode(token_pos(), receiver(), field_name(), rhs,
                                 is_conditional());
 }
 
 
 bool InstanceGetterNode::IsPotentiallyConst() const {
-  return field_name().Equals(Symbols::Length()) &&
-    !is_conditional() &&
-    receiver()->IsPotentiallyConst();
+  return field_name().Equals(Symbols::Length()) && !is_conditional() &&
+         receiver()->IsPotentiallyConst();
 }
 
 
@@ -617,8 +592,8 @@
 
 
 AstNode* LoadIndexedNode::MakeAssignmentNode(AstNode* rhs) {
-  return new StoreIndexedNode(token_pos(), array(), index_expr(),
-                              rhs, super_class());
+  return new StoreIndexedNode(token_pos(), array(), index_expr(), rhs,
+                              super_class());
 }
 
 
@@ -637,16 +612,10 @@
     if (setter.IsNull() || setter.is_abstract()) {
       // No instance setter found in super class chain,
       // noSuchMethod will be called at runtime.
-      return new StaticSetterNode(token_pos(),
-                                  receiver(),
-                                  cls(),
-                                  field_name_,
+      return new StaticSetterNode(token_pos(), receiver(), cls(), field_name_,
                                   rhs);
     }
-    return new StaticSetterNode(token_pos(),
-                                receiver(),
-                                field_name_,
-                                setter,
+    return new StaticSetterNode(token_pos(), receiver(), field_name_, setter,
                                 rhs);
   }
 
@@ -667,8 +636,7 @@
       const Field& field = Field::ZoneHandle(zone, Field::Cast(obj).raw());
       if (!field.is_final()) {
         if (isolate->type_checks()) {
-          rhs = new AssignableNode(field.token_pos(),
-                                   rhs,
+          rhs = new AssignableNode(field.token_pos(), rhs,
                                    AbstractType::ZoneHandle(zone, field.type()),
                                    field_name_);
         }
@@ -678,15 +646,15 @@
 
     // No field found in prefix. Look for a setter function.
     const String& setter_name =
-         String::Handle(zone, Field::LookupSetterSymbol(field_name_));
+        String::Handle(zone, Field::LookupSetterSymbol(field_name_));
     if (!setter_name.IsNull()) {
       obj = prefix.LookupObject(setter_name);
       if (obj.IsFunction()) {
         const Function& setter =
             Function::ZoneHandle(zone, Function::Cast(obj).raw());
         ASSERT(setter.is_static() && setter.IsSetterFunction());
-        return new StaticSetterNode(
-            token_pos(), NULL, field_name_, setter, rhs);
+        return new StaticSetterNode(token_pos(), NULL, field_name_, setter,
+                                    rhs);
       }
     }
 
@@ -702,8 +670,7 @@
       const Field& field = Field::ZoneHandle(zone, Field::Cast(obj).raw());
       if (!field.is_final()) {
         if (isolate->type_checks()) {
-          rhs = new AssignableNode(field.token_pos(),
-                                   rhs,
+          rhs = new AssignableNode(field.token_pos(), rhs,
                                    AbstractType::ZoneHandle(zone, field.type()),
                                    field_name_);
         }
@@ -720,8 +687,8 @@
         const Function& setter =
             Function::ZoneHandle(zone, Function::Cast(obj).raw());
         ASSERT(setter.is_static() && setter.IsSetterFunction());
-        return
-            new StaticSetterNode(token_pos(), NULL, field_name_, setter, rhs);
+        return new StaticSetterNode(token_pos(), NULL, field_name_, setter,
+                                    rhs);
       }
     }
 
@@ -739,8 +706,8 @@
   // Access to a lazily initialized static field that has not yet been
   // initialized is compiled to a static implicit getter.
   // A setter may not exist for such a field.
-  const Field& field = Field::ZoneHandle(zone,
-                                         cls().LookupStaticField(field_name_));
+  const Field& field =
+      Field::ZoneHandle(zone, cls().LookupStaticField(field_name_));
   if (!field.IsNull()) {
     if (field.is_final()) {
       // Attempting to assign to a final variable will cause a NoSuchMethodError
@@ -758,11 +725,9 @@
            (getter.kind() == RawFunction::kImplicitStaticFinalGetter));
 #endif
     if (isolate->type_checks()) {
-      rhs = new AssignableNode(
-          field.token_pos(),
-          rhs,
-          AbstractType::ZoneHandle(zone, field.type()),
-          String::ZoneHandle(zone, field.name()));
+      rhs = new AssignableNode(field.token_pos(), rhs,
+                               AbstractType::ZoneHandle(zone, field.type()),
+                               String::ZoneHandle(zone, field.name()));
     }
     return new StoreStaticFieldNode(token_pos(), field, rhs);
   }
diff --git a/runtime/vm/ast.h b/runtime/vm/ast.h
index cd25dc7..ef26563 100644
--- a/runtime/vm/ast.h
+++ b/runtime/vm/ast.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_AST_H_
-#define VM_AST_H_
+#ifndef RUNTIME_VM_AST_H_
+#define RUNTIME_VM_AST_H_
 
 #include "platform/assert.h"
 #include "vm/allocation.h"
@@ -64,7 +64,7 @@
   V(TryCatch)                                                                  \
   V(Throw)                                                                     \
   V(InlinedFinally)                                                            \
-  V(StringInterpolate)                                                         \
+  V(StringInterpolate)
 
 
 #define FORWARD_DECLARATION(BaseName) class BaseName##Node;
@@ -79,7 +79,7 @@
   virtual ~AstNodeVisitor() {}
 
 #define DEFINE_VISITOR_FUNCTION(BaseName)                                      \
-  virtual void Visit##BaseName##Node(BaseName##Node* node) { }
+  virtual void Visit##BaseName##Node(BaseName##Node* node) {}
 
   FOR_EACH_NODE(DEFINE_VISITOR_FUNCTION)
 #undef DEFINE_VISITOR_FUNCTION
@@ -97,12 +97,11 @@
 
 class AstNode : public ZoneAllocated {
  public:
-  explicit AstNode(TokenPosition token_pos)
-      : token_pos_(token_pos) {
+  explicit AstNode(TokenPosition token_pos) : token_pos_(token_pos) {
     ASSERT(!token_pos_.IsClassifying() ||
            (token_pos_ == TokenPosition::kMethodExtractor));
   }
-  virtual ~AstNode() { }
+  virtual ~AstNode() {}
 
   TokenPosition token_pos() const { return token_pos_; }
 
@@ -126,9 +125,7 @@
   }
 
   // Return NULL if 'unary_op_kind' can't be applied.
-  virtual AstNode* ApplyUnaryOp(Token::Kind unary_op_kind) {
-    return NULL;
-  }
+  virtual AstNode* ApplyUnaryOp(Token::Kind unary_op_kind) { return NULL; }
 
   // Returns true if this node can be a compile-time constant, assuming
   // that all nodes it depends on are also compile-time constants of
@@ -171,17 +168,15 @@
             LocalVariable* outer_saved_try_ctx,
             LocalVariable* outer_async_saved_try_ctx,
             LocalScope* scope)
-    : AstNode(token_pos),
-      expr_(expr),
-      saved_try_ctx_(saved_try_ctx),
-      async_saved_try_ctx_(async_saved_try_ctx),
-      outer_saved_try_ctx_(outer_saved_try_ctx),
-      outer_async_saved_try_ctx_(outer_async_saved_try_ctx),
-      scope_(scope) { }
+      : AstNode(token_pos),
+        expr_(expr),
+        saved_try_ctx_(saved_try_ctx),
+        async_saved_try_ctx_(async_saved_try_ctx),
+        outer_saved_try_ctx_(outer_saved_try_ctx),
+        outer_async_saved_try_ctx_(outer_async_saved_try_ctx),
+        scope_(scope) {}
 
-  void VisitChildren(AstNodeVisitor* visitor) const {
-    expr_->Visit(visitor);
-  }
+  void VisitChildren(AstNodeVisitor* visitor) const { expr_->Visit(visitor); }
 
   AstNode* expr() const { return expr_; }
   LocalVariable* saved_try_ctx() const { return saved_try_ctx_; }
@@ -220,15 +215,15 @@
   AwaitMarkerNode(LocalScope* async_scope,
                   LocalScope* await_scope,
                   TokenPosition token_pos)
-    : AstNode(token_pos),
-      async_scope_(async_scope),
-      await_scope_(await_scope) {
+      : AstNode(token_pos),
+        async_scope_(async_scope),
+        await_scope_(await_scope) {
     ASSERT(async_scope != NULL);
     ASSERT(await_scope != NULL);
     await_scope->CaptureLocalVariables(async_scope);
   }
 
-  void VisitChildren(AstNodeVisitor* visitor) const { }
+  void VisitChildren(AstNodeVisitor* visitor) const {}
 
   LocalScope* async_scope() const { return async_scope_; }
   LocalScope* await_scope() const { return await_scope_; }
@@ -246,11 +241,7 @@
 class SequenceNode : public AstNode {
  public:
   SequenceNode(TokenPosition token_pos, LocalScope* scope)
-    : AstNode(token_pos),
-      scope_(scope),
-      nodes_(4),
-      label_(NULL) {
-  }
+      : AstNode(token_pos), scope_(scope), nodes_(4), label_(NULL) {}
 
   LocalScope* scope() const { return scope_; }
 
@@ -280,11 +271,9 @@
 
 class CloneContextNode : public AstNode {
  public:
-  explicit CloneContextNode(TokenPosition token_pos)
-    : AstNode(token_pos) {
-  }
+  explicit CloneContextNode(TokenPosition token_pos) : AstNode(token_pos) {}
 
-  virtual void VisitChildren(AstNodeVisitor* visitor) const { }
+  virtual void VisitChildren(AstNodeVisitor* visitor) const {}
 
   DECLARE_COMMON_NODE_FUNCTIONS(CloneContextNode);
 
@@ -296,23 +285,16 @@
 class ArgumentListNode : public AstNode {
  public:
   explicit ArgumentListNode(TokenPosition token_pos)
-     : AstNode(token_pos),
-       nodes_(4),
-       names_(Array::ZoneHandle()) {
-  }
+      : AstNode(token_pos), nodes_(4), names_(Array::ZoneHandle()) {}
 
   void VisitChildren(AstNodeVisitor* visitor) const;
 
-  void Add(AstNode* node) {
-    nodes_.Add(node);
-  }
+  void Add(AstNode* node) { nodes_.Add(node); }
   intptr_t length() const { return nodes_.length(); }
   AstNode* NodeAt(intptr_t index) const { return nodes_[index]; }
   void SetNodeAt(intptr_t index, AstNode* node) { nodes_[index] = node; }
   const Array& names() const { return names_; }
-  void set_names(const Array& names) {
-    names_ = names.raw();
-  }
+  void set_names(const Array& names) { names_ = names.raw(); }
   const GrowableArray<AstNode*>& nodes() const { return nodes_; }
 
   DECLARE_COMMON_NODE_FUNCTIONS(ArgumentListNode);
@@ -341,9 +323,7 @@
 
   void AddNode(AstNode* node) { nodes_.Add(node); }
 
-  intptr_t num_temps() const {
-    return vars_.length();
-  }
+  intptr_t num_temps() const { return vars_.length(); }
 
   void VisitChildren(AstNodeVisitor* visitor) const;
 
@@ -361,17 +341,13 @@
 class ArrayNode : public AstNode {
  public:
   ArrayNode(TokenPosition token_pos, const AbstractType& type)
-      : AstNode(token_pos),
-        type_(type),
-        elements_() {
+      : AstNode(token_pos), type_(type), elements_() {
     CheckFields();
   }
   ArrayNode(TokenPosition token_pos,
             const AbstractType& type,
             const GrowableArray<AstNode*>& elements)
-      : AstNode(token_pos),
-        type_(type),
-        elements_(elements.length()) {
+      : AstNode(token_pos), type_(type), elements_(elements.length()) {
     CheckFields();
     for (intptr_t i = 0; i < elements.length(); i++) {
       elements_.Add(elements[i]);
@@ -412,7 +388,7 @@
 class StringInterpolateNode : public AstNode {
  public:
   StringInterpolateNode(TokenPosition token_pos, ArrayNode* value)
-      : AstNode(token_pos), value_(value) { }
+      : AstNode(token_pos), value_(value) {}
 
   virtual void VisitChildren(AstNodeVisitor* visitor) const {
     value_->Visit(visitor);
@@ -450,11 +426,9 @@
   const Instance& literal() const { return literal_; }
 
   virtual bool IsPotentiallyConst() const;
-  virtual const Instance* EvalConstExpr() const {
-    return &literal();
-  }
+  virtual const Instance* EvalConstExpr() const { return &literal(); }
 
-  virtual void VisitChildren(AstNodeVisitor* visitor) const { }
+  virtual void VisitChildren(AstNodeVisitor* visitor) const {}
 
   virtual AstNode* ApplyUnaryOp(Token::Kind unary_op_kind);
 
@@ -475,8 +449,7 @@
     ASSERT(!type_.IsNull());
     ASSERT(type_.IsFinalized());
     // A wellformed literal Type must be canonical.
-    ASSERT(!type_.IsType() ||
-           type_.IsMalformedOrMalbounded() ||
+    ASSERT(!type_.IsType() || type_.IsMalformedOrMalbounded() ||
            type_.IsCanonical());
   }
 
@@ -491,7 +464,7 @@
     return &type();
   }
 
-  virtual void VisitChildren(AstNodeVisitor* visitor) const { }
+  virtual void VisitChildren(AstNodeVisitor* visitor) const {}
 
   DECLARE_COMMON_NODE_FUNCTIONS(TypeNode);
 
@@ -591,9 +564,7 @@
 class PrimaryNode : public AstNode {
  public:
   PrimaryNode(TokenPosition token_pos, const Object& primary)
-      : AstNode(token_pos),
-        primary_(primary),
-        is_deferred_reference_(false) {
+      : AstNode(token_pos), primary_(primary), is_deferred_reference_(false) {
     ASSERT(primary_.IsNotTemporaryScopedHandle());
   }
 
@@ -629,21 +600,16 @@
 // In synchronous functions, return nodes are always of type'kRegular'
 class ReturnNode : public AstNode {
  public:
-  enum ReturnType {
-    kRegular,
-    kContinuation,
-    kContinuationTarget
-  };
+  enum ReturnType { kRegular, kContinuation, kContinuationTarget };
 
   // Return from a void function returns the null object.
   explicit ReturnNode(TokenPosition token_pos)
       : AstNode(token_pos),
         value_(new LiteralNode(token_pos, Instance::ZoneHandle())),
         inlined_finally_list_(),
-        return_type_(kRegular) { }
+        return_type_(kRegular) {}
   // Return from a non-void function.
-  ReturnNode(TokenPosition token_pos,
-             AstNode* value)
+  ReturnNode(TokenPosition token_pos, AstNode* value)
       : AstNode(token_pos),
         value_(value),
         inlined_finally_list_(),
@@ -693,7 +659,7 @@
                  Token::Kind kind,
                  AstNode* left,
                  AstNode* right)
-  : AstNode(token_pos), kind_(kind), left_(left), right_(right) {
+      : AstNode(token_pos), kind_(kind), left_(left), right_(right) {
     ASSERT(left_ != NULL);
     ASSERT(right_ != NULL);
     ASSERT(IsKindValid());
@@ -775,9 +741,7 @@
   static AstNode* UnaryOpOrLiteral(TokenPosition token_pos,
                                    Token::Kind kind,
                                    AstNode* operand);
-  UnaryOpNode(TokenPosition token_pos,
-              Token::Kind kind,
-              AstNode* operand)
+  UnaryOpNode(TokenPosition token_pos, Token::Kind kind, AstNode* operand)
       : AstNode(token_pos), kind_(kind), operand_(operand) {
     ASSERT(operand_ != NULL);
     ASSERT(IsKindValid());
@@ -816,9 +780,9 @@
         condition_(condition),
         true_expr_(true_expr),
         false_expr_(false_expr) {
-      ASSERT(condition_ != NULL);
-      ASSERT(true_expr_ != NULL);
-      ASSERT(false_expr_ != NULL);
+    ASSERT(condition_ != NULL);
+    ASSERT(true_expr_ != NULL);
+    ASSERT(false_expr_ != NULL);
   }
 
   AstNode* condition() const { return condition_; }
@@ -864,7 +828,7 @@
         condition_(condition),
         true_branch_(true_branch),
         false_branch_(false_branch) {
-      ASSERT(condition_ != NULL);
+    ASSERT(condition_ != NULL);
   }
 
   AstNode* condition() const { return condition_; }
@@ -898,12 +862,12 @@
            bool contains_default,
            LocalVariable* switch_expr_value,
            SequenceNode* statements)
-    : AstNode(token_pos),
-      label_(label),
-      case_expressions_(case_expressions),
-      contains_default_(contains_default),
-      switch_expr_value_(switch_expr_value),
-      statements_(statements) {
+      : AstNode(token_pos),
+        label_(label),
+        case_expressions_(case_expressions),
+        contains_default_(contains_default),
+        switch_expr_value_(switch_expr_value),
+        statements_(statements) {
     // label may be NULL.
     ASSERT(case_expressions_ != NULL);
     ASSERT(switch_expr_value_ != NULL);
@@ -936,12 +900,8 @@
 
 class SwitchNode : public AstNode {
  public:
-  SwitchNode(TokenPosition token_pos,
-             SourceLabel* label,
-             SequenceNode* body)
-    : AstNode(token_pos),
-      label_(label),
-      body_(body) {
+  SwitchNode(TokenPosition token_pos, SourceLabel* label, SequenceNode* body)
+      : AstNode(token_pos), label_(label), body_(body) {
     ASSERT(label_ != NULL);
     ASSERT(body_ != NULL);
   }
@@ -970,11 +930,11 @@
             AstNode* condition,
             SequenceNode* condition_preamble,
             SequenceNode* body)
-    : AstNode(token_pos),
-      label_(label),
-      condition_(condition),
-      condition_preamble_(condition_preamble),
-      body_(body) {
+      : AstNode(token_pos),
+        label_(label),
+        condition_(condition),
+        condition_preamble_(condition_preamble),
+        body_(body) {
     ASSERT(label_ != NULL);
     ASSERT(condition_ != NULL);
     ASSERT(body_ != NULL);
@@ -1011,10 +971,7 @@
               SourceLabel* label,
               AstNode* condition,
               SequenceNode* body)
-    : AstNode(token_pos),
-      label_(label),
-      condition_(condition),
-      body_(body) {
+      : AstNode(token_pos), label_(label), condition_(condition), body_(body) {
     ASSERT(label_ != NULL);
     ASSERT(condition_ != NULL);
     ASSERT(body_ != NULL);
@@ -1050,13 +1007,13 @@
           SequenceNode* condition_preamble,
           SequenceNode* increment,
           SequenceNode* body)
-    : AstNode(token_pos),
-      label_(label),
-      initializer_(initializer),
-      condition_(condition),
-      condition_preamble_(condition_preamble),
-      increment_(increment),
-      body_(body) {
+      : AstNode(token_pos),
+        label_(label),
+        initializer_(initializer),
+        condition_(condition),
+        condition_preamble_(condition_preamble),
+        increment_(increment),
+        body_(body) {
     ASSERT(label_ != NULL);
     ASSERT(initializer_ != NULL);
     ASSERT(increment_ != NULL);
@@ -1099,13 +1056,11 @@
 
 class JumpNode : public AstNode {
  public:
-  JumpNode(TokenPosition token_pos,
-           Token::Kind kind,
-           SourceLabel* label)
-    : AstNode(token_pos),
-      kind_(kind),
-      label_(label),
-      inlined_finally_list_() {
+  JumpNode(TokenPosition token_pos, Token::Kind kind, SourceLabel* label)
+      : AstNode(token_pos),
+        kind_(kind),
+        label_(label),
+        inlined_finally_list_() {
     ASSERT(label_ != NULL);
     ASSERT(kind_ == Token::kBREAK || kind_ == Token::kCONTINUE);
   }
@@ -1125,7 +1080,7 @@
 
   const char* TokenName() const;
 
-  virtual void VisitChildren(AstNodeVisitor* visitor) const { }
+  virtual void VisitChildren(AstNodeVisitor* visitor) const {}
 
   DECLARE_COMMON_NODE_FUNCTIONS(JumpNode);
 
@@ -1141,14 +1096,13 @@
 class StopNode : public AstNode {
  public:
   StopNode(TokenPosition token_pos, const char* message)
-      : AstNode(token_pos),
-        message_(message) {
+      : AstNode(token_pos), message_(message) {
     ASSERT(message != NULL);
   }
 
   const char* message() const { return message_; }
 
-  virtual void VisitChildren(AstNodeVisitor* visitor) const { }
+  virtual void VisitChildren(AstNodeVisitor* visitor) const {}
 
   DECLARE_COMMON_NODE_FUNCTIONS(StopNode);
 
@@ -1168,7 +1122,7 @@
 
   const LocalVariable& local() const { return local_; }
 
-  virtual void VisitChildren(AstNodeVisitor* visitor) const { }
+  virtual void VisitChildren(AstNodeVisitor* visitor) const {}
 
   virtual const Instance* EvalConstExpr() const;
   virtual bool IsPotentiallyConst() const;
@@ -1188,7 +1142,7 @@
   StoreLocalNode(TokenPosition token_pos,
                  const LocalVariable* local,
                  AstNode* value)
-      : AstNode(token_pos),  local_(*local), value_(value) {
+      : AstNode(token_pos), local_(*local), value_(value) {
     ASSERT(local != NULL);
     ASSERT(value_ != NULL);
   }
@@ -1215,8 +1169,7 @@
   LoadInstanceFieldNode(TokenPosition token_pos,
                         AstNode* instance,
                         const Field& field)
-      : AstNode(token_pos), instance_(instance),
-        field_(*MayCloneField(field)) {
+      : AstNode(token_pos), instance_(instance), field_(*MayCloneField(field)) {
     ASSERT(instance_ != NULL);
     ASSERT(field_.IsZoneHandle());
   }
@@ -1290,19 +1243,17 @@
   void set_is_deferred(bool value) { is_deferred_reference_ = value; }
   bool is_deferred_reference() const { return is_deferred_reference_; }
 
-  virtual void VisitChildren(AstNodeVisitor* visitor) const { }
+  virtual void VisitChildren(AstNodeVisitor* visitor) const {}
 
   virtual AstNode* MakeAssignmentNode(AstNode* rhs);
 
-  virtual bool IsPotentiallyConst() const {
-    return field_.is_const();
-  }
+  virtual bool IsPotentiallyConst() const { return field_.is_const(); }
 
   virtual const Instance* EvalConstExpr() const {
     ASSERT(field_.is_static());
     return !is_deferred_reference_ && field_.is_const()
-        ? &Instance::ZoneHandle(field_.StaticValue())
-        : NULL;
+               ? &Instance::ZoneHandle(field_.StaticValue())
+               : NULL;
   }
 
   DECLARE_COMMON_NODE_FUNCTIONS(LoadStaticFieldNode);
@@ -1320,9 +1271,7 @@
   StoreStaticFieldNode(TokenPosition token_pos,
                        const Field& field,
                        AstNode* value)
-      : AstNode(token_pos),
-        field_(*MayCloneField(field)),
-        value_(value) {
+      : AstNode(token_pos), field_(*MayCloneField(field)), value_(value) {
     ASSERT(field_.IsZoneHandle());
     ASSERT(value_ != NULL);
   }
@@ -1388,11 +1337,11 @@
                    AstNode* index,
                    AstNode* value,
                    const Class& super_class)
-    : AstNode(token_pos),
-      array_(array),
-      index_expr_(index),
-      value_(value),
-      super_class_(super_class) {
+      : AstNode(token_pos),
+        array_(array),
+        index_expr_(index),
+        value_(value),
+        super_class_(super_class) {
     ASSERT(array_ != NULL);
     ASSERT(index_expr_ != NULL);
     ASSERT(value_ != NULL);
@@ -1544,14 +1493,13 @@
 class InitStaticFieldNode : public AstNode {
  public:
   InitStaticFieldNode(TokenPosition token_pos, const Field& field)
-      : AstNode(token_pos),
-        field_(*MayCloneField(field)) {
+      : AstNode(token_pos), field_(*MayCloneField(field)) {
     ASSERT(field_.IsZoneHandle());
   }
 
   const Field& field() const { return field_; }
 
-  virtual void VisitChildren(AstNodeVisitor* visitor) const { }
+  virtual void VisitChildren(AstNodeVisitor* visitor) const {}
 
   DECLARE_COMMON_NODE_FUNCTIONS(InitStaticFieldNode);
 
@@ -1598,7 +1546,7 @@
   bool is_super_getter() const { return receiver_ != NULL; }
   void set_is_deferred(bool value) { is_deferred_reference_ = value; }
 
-  virtual void VisitChildren(AstNodeVisitor* visitor) const { }
+  virtual void VisitChildren(AstNodeVisitor* visitor) const {}
 
   virtual AstNode* MakeAssignmentNode(AstNode* rhs);
 
@@ -1644,12 +1592,12 @@
                    const Class& cls,
                    const String& field_name,
                    AstNode* value)
-  : AstNode(token_pos),
-  receiver_(receiver),
-  cls_(cls),
-  field_name_(field_name),
-  function_(Function::ZoneHandle()),
-  value_(value) {
+      : AstNode(token_pos),
+        receiver_(receiver),
+        cls_(cls),
+        field_name_(field_name),
+        function_(Function::ZoneHandle()),
+        value_(value) {
     ASSERT(cls_.IsZoneHandle());
     ASSERT(field_name_.IsZoneHandle());
     ASSERT(value_ != NULL);
@@ -1686,9 +1634,7 @@
   StaticCallNode(TokenPosition token_pos,
                  const Function& function,
                  ArgumentListNode* arguments)
-      : AstNode(token_pos),
-        function_(function),
-        arguments_(arguments) {
+      : AstNode(token_pos), function_(function), arguments_(arguments) {
     ASSERT(function_.IsZoneHandle());
     ASSERT(arguments_ != NULL);
   }
@@ -1717,9 +1663,7 @@
   ClosureCallNode(TokenPosition token_pos,
                   AstNode* closure,
                   ArgumentListNode* arguments)
-      : AstNode(token_pos),
-        closure_(closure),
-        arguments_(arguments) {
+      : AstNode(token_pos), closure_(closure), arguments_(arguments) {
     ASSERT(closure_ != NULL);
     ASSERT(arguments_ != NULL);
   }
@@ -1783,9 +1727,7 @@
     ASSERT(arguments_ != NULL);
   }
 
-  const TypeArguments& type_arguments() const {
-    return type_arguments_;
-  }
+  const TypeArguments& type_arguments() const { return type_arguments_; }
   const Function& constructor() const { return constructor_; }
   ArgumentListNode* arguments() const { return arguments_; }
 
@@ -1830,7 +1772,7 @@
 
   bool link_lazily() const { return link_lazily_; }
 
-  virtual void VisitChildren(AstNodeVisitor* visitor) const { }
+  virtual void VisitChildren(AstNodeVisitor* visitor) const {}
 
   DECLARE_COMMON_NODE_FUNCTIONS(NativeBodyNode);
 
@@ -1881,10 +1823,10 @@
   const LocalVariable& exception_var() const { return exception_var_; }
   const LocalVariable& stacktrace_var() const { return stacktrace_var_; }
   const LocalVariable& rethrow_exception_var() const {
-      return rethrow_exception_var_;
+    return rethrow_exception_var_;
   }
   const LocalVariable& rethrow_stacktrace_var() const {
-      return rethrow_stacktrace_var_;
+    return rethrow_stacktrace_var_;
   }
   intptr_t catch_handler_index() const { return catch_handler_index_; }
   bool needs_stacktrace() const { return needs_stacktrace_; }
@@ -2026,4 +1968,4 @@
 
 #undef DECLARE_COMMON_NODE_FUNCTIONS
 
-#endif  // VM_AST_H_
+#endif  // RUNTIME_VM_AST_H_
diff --git a/runtime/vm/ast_printer.cc b/runtime/vm/ast_printer.cc
index 6b47267..e196109 100644
--- a/runtime/vm/ast_printer.cc
+++ b/runtime/vm/ast_printer.cc
@@ -15,11 +15,10 @@
 namespace dart {
 
 AstPrinter::AstPrinter(bool log)
-    : indent_(0),
-      logger_(log ? Log::Current() : Log::NoOpLog()) { }
+    : indent_(0), logger_(log ? Log::Current() : Log::NoOpLog()) {}
 
 
-AstPrinter::~AstPrinter() { }
+AstPrinter::~AstPrinter() {}
 
 
 void AstPrinter::VisitGenericAstNode(AstNode* node) {
@@ -34,14 +33,11 @@
   LocalScope* scope = node->scope();
   logger_->Print("(%s (scope \"%p\"", node->Name(), scope);
   if (scope != NULL) {
-    logger_->Print(" (%s-%s) loop %d",
-              scope->begin_token_pos().ToCString(),
-              scope->end_token_pos().ToCString(),
-              scope->loop_level());
+    logger_->Print(" (%s-%s) loop %d", scope->begin_token_pos().ToCString(),
+                   scope->end_token_pos().ToCString(), scope->loop_level());
     if (scope->HasContextLevel()) {
-      logger_->Print(" context %d captures %d",
-                scope->context_level(),
-                scope->num_context_variables());
+      logger_->Print(" context %d captures %d", scope->context_level(),
+                     scope->num_context_variables());
     } else {
       ASSERT(scope->num_context_variables() == 0);
     }
@@ -93,15 +89,12 @@
 
 void AstPrinter::VisitGenericLocalNode(AstNode* node,
                                        const LocalVariable& var) {
-  logger_->Print("(%s %s%s \"%s\"",
-            node->Name(),
-            var.is_final() ? "final " : "",
-            String::Handle(var.type().Name()).ToCString(),
-            var.name().ToCString());
+  logger_->Print(
+      "(%s %s%s \"%s\"", node->Name(), var.is_final() ? "final " : "",
+      String::Handle(var.type().Name()).ToCString(), var.name().ToCString());
   if (var.HasIndex()) {
     if (var.is_captured()) {
-      logger_->Print(" (context %d %d)",
-                     var.owner()->context_level(),
+      logger_->Print(" (context %d %d)", var.owner()->context_level(),
                      var.index());
     } else {
       logger_->Print(" (stack %d)", var.index());
@@ -124,12 +117,10 @@
 
 
 void AstPrinter::VisitGenericFieldNode(AstNode* node, const Field& field) {
-  logger_->Print("(%s %s%s \"%s\" ",
-            node->Name(),
-            field.is_final() ? "final " : "",
-            String::Handle(AbstractType::Handle(field.type()).Name()).
-                ToCString(),
-            String::Handle(field.name()).ToCString());
+  logger_->Print(
+      "(%s %s%s \"%s\" ", node->Name(), field.is_final() ? "final " : "",
+      String::Handle(AbstractType::Handle(field.type()).Name()).ToCString(),
+      String::Handle(field.name()).ToCString());
   node->VisitChildren(this);
   logger_->Print(")");
 }
@@ -178,19 +169,16 @@
 
 void AstPrinter::VisitTypeNode(TypeNode* node) {
   const AbstractType& type = node->type();
-  logger_->Print("(%s \"%s\")",
-            node->Name(),
-            String::Handle(type.Name()).ToCString());
+  logger_->Print("(%s \"%s\")", node->Name(),
+                 String::Handle(type.Name()).ToCString());
 }
 
 
 void AstPrinter::VisitAssignableNode(AssignableNode* node) {
   const AbstractType& type = node->type();
   const String& dst_name = node->dst_name();
-  logger_->Print("(%s (type \"%s\") (of \"%s\") ",
-            node->Name(),
-            String::Handle(type.Name()).ToCString(),
-            dst_name.ToCString());
+  logger_->Print("(%s (type \"%s\") (of \"%s\") ", node->Name(),
+                 String::Handle(type.Name()).ToCString(), dst_name.ToCString());
   node->VisitChildren(this);
   logger_->Print(")");
 }
@@ -204,17 +192,14 @@
 
 
 void AstPrinter::VisitAwaitMarkerNode(AwaitMarkerNode* node) {
-  logger_->Print("(%s (async_scope \"%p\" await_scope \"%p\"))",
-            node->Name(),
-            node->async_scope(),
-            node->await_scope());
+  logger_->Print("(%s (async_scope \"%p\" await_scope \"%p\"))", node->Name(),
+                 node->async_scope(), node->await_scope());
 }
 
 
 void AstPrinter::VisitPrimaryNode(PrimaryNode* node) {
-  logger_->Print("(*****%s***** \"%s\")",
-            node->Name(),
-            node->primary().ToCString());
+  logger_->Print("(*****%s***** \"%s\")", node->Name(),
+                 node->primary().ToCString());
 }
 
 
@@ -296,18 +281,14 @@
 
 
 void AstPrinter::VisitJumpNode(JumpNode* node) {
-  logger_->Print("(%s %s %s (scope \"%p\"))",
-            node->Name(),
-            node->TokenName(),
-            node->label()->name().ToCString(),
-            node->label()->owner());
+  logger_->Print("(%s %s %s (scope \"%p\"))", node->Name(), node->TokenName(),
+                 node->label()->name().ToCString(), node->label()->owner());
 }
 
 
 void AstPrinter::VisitInstanceCallNode(InstanceCallNode* node) {
-  logger_->Print("(%s \"%s\" ",
-            node->Name(),
-            node->function_name().ToCString());
+  logger_->Print("(%s \"%s\" ", node->Name(),
+                 node->function_name().ToCString());
   node->VisitChildren(this);
   logger_->Print(")");
 }
@@ -356,27 +337,22 @@
 
 
 void AstPrinter::VisitInitStaticFieldNode(InitStaticFieldNode* node) {
-  logger_->Print("(%s \"%s\")",
-            node->Name(),
-            String::Handle(node->field().name()).ToCString());
+  logger_->Print("(%s \"%s\")", node->Name(),
+                 String::Handle(node->field().name()).ToCString());
 }
 
 
 void AstPrinter::VisitStaticGetterNode(StaticGetterNode* node) {
   String& class_name = String::Handle(node->cls().Name());
-  logger_->Print("(%s \"%s.%s\")",
-            node->Name(),
-            class_name.ToCString(),
-            node->field_name().ToCString());
+  logger_->Print("(%s \"%s.%s\")", node->Name(), class_name.ToCString(),
+                 node->field_name().ToCString());
 }
 
 
 void AstPrinter::VisitStaticSetterNode(StaticSetterNode* node) {
   String& class_name = String::Handle(node->cls().Name());
-  logger_->Print("(%s \"%s.%s\" ",
-            node->Name(),
-            class_name.ToCString(),
-            node->field_name().ToCString());
+  logger_->Print("(%s \"%s.%s\" ", node->Name(), class_name.ToCString(),
+                 node->field_name().ToCString());
   node->VisitChildren(this);
   logger_->Print(")");
 }
@@ -397,10 +373,10 @@
 
 
 void AstPrinter::VisitNativeBodyNode(NativeBodyNode* node) {
-  logger_->Print("(%s \"%s\" (%" Pd " args))",
-            node->Name(),
-            node->native_c_function_name().ToCString(),
-            NativeArguments::ParameterCountForResolution(node->function()));
+  logger_->Print(
+      "(%s \"%s\" (%" Pd " args))", node->Name(),
+      node->native_c_function_name().ToCString(),
+      NativeArguments::ParameterCountForResolution(node->function()));
 }
 
 
@@ -458,10 +434,9 @@
   ASSERT(scope != NULL);
   ASSERT(var != NULL);
   IndentN(indent);
-  logger_->Print("(%s%s '%s'",
-            var->is_final() ? "final " : "",
-            String::Handle(var->type().Name()).ToCString(),
-            var->name().ToCString());
+  logger_->Print("(%s%s '%s'", var->is_final() ? "final " : "",
+                 String::Handle(var->type().Name()).ToCString(),
+                 var->name().ToCString());
   if (var->owner() != scope) {
     logger_->Print(" alias");
   }
@@ -473,9 +448,8 @@
   } else if (var->owner()->function_level() != 0) {
     logger_->Print(" lev %d", var->owner()->function_level());
   }
-  logger_->Print(" valid %s-%s)\n",
-            var->token_pos().ToCString(),
-            scope->end_token_pos().ToCString());
+  logger_->Print(" valid %s-%s)\n", var->token_pos().ToCString(),
+                 scope->end_token_pos().ToCString());
 }
 
 
@@ -492,9 +466,8 @@
     IndentN(indent);
     logger_->Print("{scope %p ", child);
     if (child->HasContextLevel()) {
-      logger_->Print("ctx %d numctxvar %d ",
-                child->context_level(),
-                child->num_context_variables());
+      logger_->Print("ctx %d numctxvar %d ", child->context_level(),
+                     child->num_context_variables());
     }
     logger_->Print("llev %d\n", child->loop_level());
     PrintLocalScope(child, 0, indent + kScopeIndent);
@@ -515,9 +488,8 @@
   const char* function_name = function.ToFullyQualifiedCString();
   logger_->Print("Scope for function '%s'\n{scope %p ", function_name, scope);
   if (scope->HasContextLevel()) {
-    logger_->Print("ctx %d numctxvar %d ",
-              scope->context_level(),
-              scope->num_context_variables());
+    logger_->Print("ctx %d numctxvar %d ", scope->context_level(),
+                   scope->num_context_variables());
   }
   logger_->Print("llev %d\n", scope->loop_level());
   const int num_fixed_params = function.num_fixed_parameters();
@@ -530,10 +502,9 @@
     LocalVariable* param = scope->VariableAt(pos);
     ASSERT(param->owner() == scope);  // No aliases should precede parameters.
     IndentN(indent);
-    logger_->Print("(param %s%s '%s'",
-              param->is_final() ? "final " : "",
-              String::Handle(param->type().Name()).ToCString(),
-              param->name().ToCString());
+    logger_->Print("(param %s%s '%s'", param->is_final() ? "final " : "",
+                   String::Handle(param->type().Name()).ToCString(),
+                   param->name().ToCString());
     // Print the default value if the parameter is optional.
     if (pos >= num_fixed_params && pos < num_params) {
       const Instance& default_parameter_value =
@@ -546,9 +517,8 @@
         logger_->Print(" ctx %d", param->owner()->context_level());
       }
     }
-    logger_->Print(" valid %s-%s)\n",
-              param->token_pos().ToCString(),
-              scope->end_token_pos().ToCString());
+    logger_->Print(" valid %s-%s)\n", param->token_pos().ToCString(),
+                   scope->end_token_pos().ToCString());
     pos++;
   }
   // Visit remaining non-parameter variables and children scopes.
diff --git a/runtime/vm/ast_printer.h b/runtime/vm/ast_printer.h
index b5ee0bd..f89d9bc 100644
--- a/runtime/vm/ast_printer.h
+++ b/runtime/vm/ast_printer.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_AST_PRINTER_H_
-#define VM_AST_PRINTER_H_
+#ifndef RUNTIME_VM_AST_PRINTER_H_
+#define RUNTIME_VM_AST_PRINTER_H_
 
 #include "vm/ast.h"
 #include "vm/growable_array.h"
@@ -52,4 +52,4 @@
 
 }  // namespace dart
 
-#endif  // VM_AST_PRINTER_H_
+#endif  // RUNTIME_VM_AST_PRINTER_H_
diff --git a/runtime/vm/ast_printer_test.cc b/runtime/vm/ast_printer_test.cc
index 888fdda..5ea05a4 100644
--- a/runtime/vm/ast_printer_test.cc
+++ b/runtime/vm/ast_printer_test.cc
@@ -16,10 +16,9 @@
 
 TEST_CASE(AstPrinter) {
   const TokenPosition kPos = TokenPosition::kNoSource;
-  LocalVariable* v =
-      new LocalVariable(kPos,
-                        String::ZoneHandle(Symbols::New(thread, "wurscht")),
-                        Type::ZoneHandle(Type::DynamicType()));
+  LocalVariable* v = new LocalVariable(
+      kPos, kPos, String::ZoneHandle(Symbols::New(thread, "wurscht")),
+      Type::ZoneHandle(Type::DynamicType()));
   v->set_index(5);
   AstPrinter ast_printer;
   LoadLocalNode* ll = new LoadLocalNode(kPos, v);
@@ -32,10 +31,9 @@
 
   ast_printer.PrintNode(new ReturnNode(kPos));
 
-  ast_printer.PrintNode(new BinaryOpNode(kPos,
-                        Token::kADD,
-                        new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(3))),
-                        new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(5)))));
+  ast_printer.PrintNode(new BinaryOpNode(
+      kPos, Token::kADD, new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(3))),
+      new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(5)))));
   ast_printer.PrintNode(new UnaryOpNode(kPos, Token::kNEGATE, ll));
 }
 
diff --git a/runtime/vm/ast_test.cc b/runtime/vm/ast_test.cc
index 90513c2..0de9984 100644
--- a/runtime/vm/ast_test.cc
+++ b/runtime/vm/ast_test.cc
@@ -13,10 +13,10 @@
 namespace dart {
 
 TEST_CASE(Ast) {
-  LocalVariable* v = new LocalVariable(
-      TokenPosition::kNoSource,
-      String::ZoneHandle(Symbols::New(thread, "v")),
-      Type::ZoneHandle(Type::DynamicType()));
+  LocalVariable* v =
+      new LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource,
+                        String::ZoneHandle(Symbols::New(thread, "v")),
+                        Type::ZoneHandle(Type::DynamicType()));
   AstNode* ll = new LoadLocalNode(TokenPosition::kNoSource, v);
   EXPECT(ll->IsLoadLocalNode());
   EXPECT(!ll->IsLiteralNode());
@@ -25,10 +25,10 @@
   v->set_index(1);
   EXPECT_EQ(1, v->index());
 
-  LocalVariable* p = new LocalVariable(
-      TokenPosition::kNoSource,
-      String::ZoneHandle(Symbols::New(thread, "p")),
-      Type::ZoneHandle(Type::DynamicType()));
+  LocalVariable* p =
+      new LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource,
+                        String::ZoneHandle(Symbols::New(thread, "p")),
+                        Type::ZoneHandle(Type::DynamicType()));
   EXPECT(!p->HasIndex());
   p->set_index(-1);
   EXPECT(p->HasIndex());
@@ -37,8 +37,8 @@
   ReturnNode* r = new ReturnNode(TokenPosition::kNoSource, lln);
   EXPECT_EQ(lln, r->value());
 
-  LiteralNode* l = new LiteralNode(TokenPosition::kNoSource,
-                                   Smi::ZoneHandle(Smi::New(3)));
+  LiteralNode* l =
+      new LiteralNode(TokenPosition::kNoSource, Smi::ZoneHandle(Smi::New(3)));
   EXPECT(l->literal().IsSmi());
   EXPECT_EQ(Smi::New(3), l->literal().raw());
 
@@ -48,17 +48,15 @@
   EXPECT_EQ(l, b->left());
   EXPECT_EQ(lln, b->right());
 
-  UnaryOpNode* u =
-      new UnaryOpNode(TokenPosition::kNoSource, Token::kNEGATE, b);
+  UnaryOpNode* u = new UnaryOpNode(TokenPosition::kNoSource, Token::kNEGATE, b);
   EXPECT_EQ(Token::kNEGATE, u->kind());
   EXPECT_EQ(b, u->operand());
 
   SequenceNode* sequence_node =
       new SequenceNode(TokenPosition(1), new LocalScope(NULL, 0, 0));
   LiteralNode* literal_node =
-      new LiteralNode(TokenPosition(2),  Smi::ZoneHandle(Smi::New(3)));
-  ReturnNode* return_node =
-      new ReturnNode(TokenPosition(3), literal_node);
+      new LiteralNode(TokenPosition(2), Smi::ZoneHandle(Smi::New(3)));
+  ReturnNode* return_node = new ReturnNode(TokenPosition(3), literal_node);
   sequence_node->Add(return_node);
   GrowableArray<AstNode*> nodes;
   sequence_node->CollectAllNodes(&nodes);
diff --git a/runtime/vm/ast_transformer.cc b/runtime/vm/ast_transformer.cc
index 28861ef..974259e 100644
--- a/runtime/vm/ast_transformer.cc
+++ b/runtime/vm/ast_transformer.cc
@@ -44,9 +44,9 @@
   V(While)
 
 #define DEFINE_UNREACHABLE(BaseName)                                           \
-void AwaitTransformer::Visit##BaseName##Node(BaseName##Node* node) {           \
-  UNREACHABLE();                                                               \
-}
+  void AwaitTransformer::Visit##BaseName##Node(BaseName##Node* node) {         \
+    UNREACHABLE();                                                             \
+  }
 
 FOR_EACH_UNREACHABLE_NODE(DEFINE_UNREACHABLE)
 #undef DEFINE_UNREACHABLE
@@ -76,8 +76,9 @@
   LocalVariable* await_tmp = async_temp_scope_->LocalLookupVariable(symbol);
   if (await_tmp == NULL) {
     // We need a new temp variable; add it to the function's top scope.
-    await_tmp = new(Z) LocalVariable(
-        TokenPosition::kNoSource, symbol, Object::dynamic_type());
+    await_tmp = new (Z)
+        LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource,
+                      symbol, Object::dynamic_type());
     async_temp_scope_->AddVariable(await_tmp);
     // After adding it to the top scope, we can look it up from the preamble.
     // The following call includes an ASSERT check.
@@ -100,7 +101,7 @@
     TokenPosition token_pos) {
   LocalVariable* tmp_var = EnsureCurrentTempVar();
   ASSERT(token_pos.IsSynthetic() || token_pos.IsNoSource());
-  preamble_->Add(new(Z) StoreLocalNode(token_pos, tmp_var, node));
+  preamble_->Add(new (Z) StoreLocalNode(token_pos, tmp_var, node));
   NextTempVar();
   return tmp_var;
 }
@@ -108,7 +109,7 @@
 
 LoadLocalNode* AwaitTransformer::MakeName(AstNode* node) {
   LocalVariable* temp = AddNewTempVarToPreamble(node, ST(node->token_pos()));
-  return new(Z) LoadLocalNode(ST(node->token_pos()), temp);
+  return new (Z) LoadLocalNode(ST(node->token_pos()), temp);
 }
 
 
@@ -118,7 +119,7 @@
 
 
 void AwaitTransformer::VisitTypeNode(TypeNode* node) {
-  result_ = new(Z) TypeNode(node->token_pos(), node->type());
+  result_ = new (Z) TypeNode(node->token_pos(), node->type());
 }
 
 
@@ -135,25 +136,25 @@
   //   :await_temp_var_(X+1) = :result_param;
 
   const TokenPosition token_pos = ST(node->token_pos());
-  LocalVariable* async_op = GetVariableInScope(
-      preamble_->scope(), Symbols::AsyncOperation());
-  LocalVariable* async_then_callback = GetVariableInScope(
-      preamble_->scope(), Symbols::AsyncThenCallback());
+  LocalVariable* async_op =
+      GetVariableInScope(preamble_->scope(), Symbols::AsyncOperation());
+  LocalVariable* async_then_callback =
+      GetVariableInScope(preamble_->scope(), Symbols::AsyncThenCallback());
   LocalVariable* async_catch_error_callback = GetVariableInScope(
       preamble_->scope(), Symbols::AsyncCatchErrorCallback());
-  LocalVariable* result_param = GetVariableInScope(
-      preamble_->scope(), Symbols::AsyncOperationParam());
+  LocalVariable* result_param =
+      GetVariableInScope(preamble_->scope(), Symbols::AsyncOperationParam());
   LocalVariable* error_param = GetVariableInScope(
       preamble_->scope(), Symbols::AsyncOperationErrorParam());
   LocalVariable* stack_trace_param = GetVariableInScope(
       preamble_->scope(), Symbols::AsyncOperationStackTraceParam());
 
   AstNode* transformed_expr = Transform(node->expr());
-  LocalVariable* await_temp = AddNewTempVarToPreamble(transformed_expr,
-                                                      ST(node->token_pos()));
+  LocalVariable* await_temp =
+      AddNewTempVarToPreamble(transformed_expr, ST(node->token_pos()));
 
   AwaitMarkerNode* await_marker =
-      new(Z) AwaitMarkerNode(async_temp_scope_, node->scope(), token_pos);
+      new (Z) AwaitMarkerNode(async_temp_scope_, node->scope(), token_pos);
   preamble_->Add(await_marker);
 
   // :result_param = _awaitHelper(
@@ -163,22 +164,19 @@
       Z, async_lib.LookupFunctionAllowPrivate(Symbols::AsyncAwaitHelper()));
   ASSERT(!async_await_helper.IsNull());
   ArgumentListNode* async_await_helper_args =
-      new(Z) ArgumentListNode(token_pos);
+      new (Z) ArgumentListNode(token_pos);
+  async_await_helper_args->Add(new (Z) LoadLocalNode(token_pos, await_temp));
   async_await_helper_args->Add(
-      new(Z) LoadLocalNode(token_pos, await_temp));
+      new (Z) LoadLocalNode(token_pos, async_then_callback));
   async_await_helper_args->Add(
-      new(Z) LoadLocalNode(token_pos, async_then_callback));
-  async_await_helper_args->Add(
-      new(Z) LoadLocalNode(token_pos, async_catch_error_callback));
-  StaticCallNode* await_helper_call = new(Z) StaticCallNode(
-      node->token_pos(),
-      async_await_helper,
-      async_await_helper_args);
+      new (Z) LoadLocalNode(token_pos, async_catch_error_callback));
+  StaticCallNode* await_helper_call = new (Z) StaticCallNode(
+      node->token_pos(), async_await_helper, async_await_helper_args);
 
-  preamble_->Add(new(Z) StoreLocalNode(
-      token_pos, result_param, await_helper_call));
+  preamble_->Add(
+      new (Z) StoreLocalNode(token_pos, result_param, await_helper_call));
 
-  ReturnNode* continuation_return = new(Z) ReturnNode(token_pos);
+  ReturnNode* continuation_return = new (Z) ReturnNode(token_pos);
   continuation_return->set_return_type(ReturnNode::kContinuationTarget);
   preamble_->Add(continuation_return);
 
@@ -186,17 +184,13 @@
   // restoring the saved try context that lives on the stack and possibly the
   // saved try context of the outer try block.
   if (node->saved_try_ctx() != NULL) {
-    preamble_->Add(new(Z) StoreLocalNode(
-        token_pos,
-        node->saved_try_ctx(),
-        new(Z) LoadLocalNode(token_pos,
-                             node->async_saved_try_ctx())));
+    preamble_->Add(new (Z) StoreLocalNode(
+        token_pos, node->saved_try_ctx(),
+        new (Z) LoadLocalNode(token_pos, node->async_saved_try_ctx())));
     if (node->outer_saved_try_ctx() != NULL) {
-      preamble_->Add(new(Z) StoreLocalNode(
-          token_pos,
-          node->outer_saved_try_ctx(),
-          new(Z) LoadLocalNode(token_pos,
-                               node->outer_async_saved_try_ctx())));
+      preamble_->Add(new (Z) StoreLocalNode(
+          token_pos, node->outer_saved_try_ctx(),
+          new (Z) LoadLocalNode(token_pos, node->outer_async_saved_try_ctx())));
     }
   } else {
     ASSERT(node->outer_saved_try_ctx() == NULL);
@@ -204,33 +198,24 @@
 
   // Load the async_op variable. It is unused, but the observatory uses it
   // to determine if a breakpoint is inside an asynchronous function.
-  LoadLocalNode* load_async_op = new(Z) LoadLocalNode(token_pos, async_op);
+  LoadLocalNode* load_async_op = new (Z) LoadLocalNode(token_pos, async_op);
   preamble_->Add(load_async_op);
 
-  LoadLocalNode* load_error_param = new(Z) LoadLocalNode(
-      token_pos, error_param);
-  LoadLocalNode* load_stack_trace_param = new(Z) LoadLocalNode(
-      token_pos, stack_trace_param);
-  SequenceNode* error_ne_null_branch = new(Z) SequenceNode(
-      token_pos, ChainNewScope(preamble_->scope()));
-  error_ne_null_branch->Add(new(Z) ThrowNode(
-      token_pos,
-      load_error_param,
-      load_stack_trace_param));
-  preamble_->Add(new(Z) IfNode(
-      token_pos,
-      new(Z) ComparisonNode(
-          token_pos,
-          Token::kNE,
-          load_error_param,
-          new(Z) LiteralNode(token_pos,
-                              Object::null_instance())),
-          error_ne_null_branch,
-          NULL));
+  LoadLocalNode* load_error_param =
+      new (Z) LoadLocalNode(token_pos, error_param);
+  LoadLocalNode* load_stack_trace_param =
+      new (Z) LoadLocalNode(token_pos, stack_trace_param);
+  SequenceNode* error_ne_null_branch =
+      new (Z) SequenceNode(token_pos, ChainNewScope(preamble_->scope()));
+  error_ne_null_branch->Add(
+      new (Z) ThrowNode(token_pos, load_error_param, load_stack_trace_param));
+  preamble_->Add(new (Z) IfNode(
+      token_pos, new (Z) ComparisonNode(
+                     token_pos, Token::kNE, load_error_param,
+                     new (Z) LiteralNode(token_pos, Object::null_instance())),
+      error_ne_null_branch, NULL));
 
-  LocalVariable* result = AddNewTempVarToPreamble(new(Z) LoadLocalNode(
-      token_pos, result_param), ST(node->token_pos()));
-  result_ = new(Z) LoadLocalNode(token_pos, result);
+  result_ = MakeName(new (Z) LoadLocalNode(token_pos, result_param));
 }
 
 
@@ -254,31 +239,28 @@
                                          AstNode* right) {
   ASSERT(logical_op == Token::kAND || logical_op == Token::kOR);
   AstNode* result = NULL;
-  const Token::Kind compare_logical_op = (logical_op == Token::kAND) ?
-      Token::kEQ : Token::kNE;
-  SequenceNode* eval = new(Z) SequenceNode(
-      ST(new_left->token_pos()), ChainNewScope(preamble_->scope()));
+  const Token::Kind compare_logical_op =
+      (logical_op == Token::kAND) ? Token::kEQ : Token::kNE;
+  SequenceNode* eval = new (Z) SequenceNode(ST(new_left->token_pos()),
+                                            ChainNewScope(preamble_->scope()));
   SequenceNode* saved_preamble = preamble_;
   preamble_ = eval;
   result = Transform(right);
   preamble_ = saved_preamble;
-  IfNode* right_body = new(Z) IfNode(
-      ST(new_left->token_pos()),
-      new(Z) ComparisonNode(
-          ST(new_left->token_pos()),
-          compare_logical_op,
-          new_left,
-          new(Z) LiteralNode(ST(new_left->token_pos()), Bool::True())),
-      eval,
-      NULL);
+  IfNode* right_body = new (Z)
+      IfNode(ST(new_left->token_pos()),
+             new (Z) ComparisonNode(
+                 ST(new_left->token_pos()), compare_logical_op, new_left,
+                 new (Z) LiteralNode(ST(new_left->token_pos()), Bool::True())),
+             eval, NULL);
   preamble_->Add(right_body);
   return result;
 }
 
 
 LocalScope* AwaitTransformer::ChainNewScope(LocalScope* parent) {
-  return new(Z) LocalScope(
-      parent, parent->function_level(), parent->loop_level());
+  return new (Z)
+      LocalScope(parent, parent->function_level(), parent->loop_level());
 }
 
 
@@ -291,28 +273,23 @@
   } else {
     new_right = Transform(node->right());
   }
-  result_ = MakeName(new(Z) BinaryOpNode(node->token_pos(),
-      node->kind(),
-      new_left,
-      new_right));
+  result_ = MakeName(new (Z) BinaryOpNode(node->token_pos(), node->kind(),
+                                          new_left, new_right));
 }
 
 
 void AwaitTransformer::VisitComparisonNode(ComparisonNode* node) {
   AstNode* new_left = Transform(node->left());
   AstNode* new_right = Transform(node->right());
-  result_ = MakeName(new(Z) ComparisonNode(node->token_pos(),
-      node->kind(),
-      new_left,
-      new_right));
+  result_ = MakeName(new (Z) ComparisonNode(node->token_pos(), node->kind(),
+                                            new_left, new_right));
 }
 
 
 void AwaitTransformer::VisitUnaryOpNode(UnaryOpNode* node) {
   AstNode* new_operand = Transform(node->operand());
-  result_ = MakeName(new(Z) UnaryOpNode(node->token_pos(),
-      node->kind(),
-      new_operand));
+  result_ = MakeName(
+      new (Z) UnaryOpNode(node->token_pos(), node->kind(), new_operand));
 }
 
 
@@ -320,30 +297,26 @@
 //
 void AwaitTransformer::VisitConditionalExprNode(ConditionalExprNode* node) {
   AstNode* new_condition = Transform(node->condition());
-  SequenceNode* new_true = new(Z) SequenceNode(
+  SequenceNode* new_true = new (Z) SequenceNode(
       ST(node->true_expr()->token_pos()), ChainNewScope(preamble_->scope()));
   SequenceNode* saved_preamble = preamble_;
   preamble_ = new_true;
   AstNode* new_true_result = Transform(node->true_expr());
-  SequenceNode* new_false = new(Z) SequenceNode(
+  SequenceNode* new_false = new (Z) SequenceNode(
       ST(node->false_expr()->token_pos()), ChainNewScope(preamble_->scope()));
   preamble_ = new_false;
   AstNode* new_false_result = Transform(node->false_expr());
   preamble_ = saved_preamble;
-  IfNode* new_if = new(Z) IfNode(ST(node->token_pos()),
-                                 new_condition,
-                                 new_true,
-                                 new_false);
+  IfNode* new_if =
+      new (Z) IfNode(ST(node->token_pos()), new_condition, new_true, new_false);
   preamble_->Add(new_if);
-  result_ = MakeName(new(Z) ConditionalExprNode(ST(node->token_pos()),
-      new_condition,
-      new_true_result,
-      new_false_result));
+  result_ = MakeName(new (Z) ConditionalExprNode(
+      ST(node->token_pos()), new_condition, new_true_result, new_false_result));
 }
 
 
 void AwaitTransformer::VisitArgumentListNode(ArgumentListNode* node) {
-  ArgumentListNode* new_args = new(Z) ArgumentListNode(node->token_pos());
+  ArgumentListNode* new_args = new (Z) ArgumentListNode(node->token_pos());
   for (intptr_t i = 0; i < node->length(); i++) {
     new_args->Add(Transform(node->NodeAt(i)));
   }
@@ -357,14 +330,14 @@
   for (intptr_t i = 0; i < node->length(); i++) {
     new_elements.Add(Transform(node->ElementAt(i)));
   }
-  result_ = new(Z) ArrayNode(node->token_pos(), node->type(), new_elements);
+  result_ = new (Z) ArrayNode(node->token_pos(), node->type(), new_elements);
 }
 
 
 void AwaitTransformer::VisitStringInterpolateNode(StringInterpolateNode* node) {
   ArrayNode* new_value = Transform(node->value())->AsArrayNode();
-  result_ = MakeName(new(Z) StringInterpolateNode(node->token_pos(),
-      new_value));
+  result_ =
+      MakeName(new (Z) StringInterpolateNode(node->token_pos(), new_value));
 }
 
 
@@ -373,10 +346,8 @@
   if (new_receiver != NULL) {
     new_receiver = Transform(new_receiver);
   }
-  result_ = MakeName(new(Z) ClosureNode(node->token_pos(),
-      node->function(),
-      new_receiver,
-      node->scope()));
+  result_ = MakeName(new (Z) ClosureNode(node->token_pos(), node->function(),
+                                         new_receiver, node->scope()));
 }
 
 
@@ -384,39 +355,34 @@
   AstNode* new_receiver = Transform(node->receiver());
   ArgumentListNode* new_args =
       Transform(node->arguments())->AsArgumentListNode();
-  result_ = MakeName(new(Z) InstanceCallNode(node->token_pos(),
-      new_receiver,
-      node->function_name(),
-      new_args,
-      node->is_conditional()));
+  result_ = MakeName(new (Z) InstanceCallNode(node->token_pos(), new_receiver,
+                                              node->function_name(), new_args,
+                                              node->is_conditional()));
 }
 
 
 void AwaitTransformer::VisitStaticCallNode(StaticCallNode* node) {
   ArgumentListNode* new_args =
       Transform(node->arguments())->AsArgumentListNode();
-  result_ = MakeName(new(Z) StaticCallNode(node->token_pos(),
-      node->function(),
-      new_args));
+  result_ = MakeName(
+      new (Z) StaticCallNode(node->token_pos(), node->function(), new_args));
 }
 
 
 void AwaitTransformer::VisitConstructorCallNode(ConstructorCallNode* node) {
   ArgumentListNode* new_args =
       Transform(node->arguments())->AsArgumentListNode();
-  result_ = MakeName(new(Z) ConstructorCallNode(node->token_pos(),
-      node->type_arguments(),
-      node->constructor(),
-      new_args));
+  result_ = MakeName(
+      new (Z) ConstructorCallNode(node->token_pos(), node->type_arguments(),
+                                  node->constructor(), new_args));
 }
 
 
 void AwaitTransformer::VisitInstanceGetterNode(InstanceGetterNode* node) {
   AstNode* new_receiver = Transform(node->receiver());
-  result_ = MakeName(new(Z) InstanceGetterNode(node->token_pos(),
-      new_receiver,
-      node->field_name(),
-      node->is_conditional()));
+  result_ = MakeName(new (Z) InstanceGetterNode(node->token_pos(), new_receiver,
+                                                node->field_name(),
+                                                node->is_conditional()));
 }
 
 
@@ -426,11 +392,9 @@
     new_receiver = Transform(new_receiver);
   }
   AstNode* new_value = Transform(node->value());
-  result_ = MakeName(new(Z) InstanceSetterNode(node->token_pos(),
-      new_receiver,
-      node->field_name(),
-      new_value,
-      node->is_conditional()));
+  result_ = MakeName(new (Z) InstanceSetterNode(node->token_pos(), new_receiver,
+                                                node->field_name(), new_value,
+                                                node->is_conditional()));
 }
 
 
@@ -439,11 +403,8 @@
   if (new_receiver != NULL) {
     new_receiver = Transform(new_receiver);
   }
-  StaticGetterNode* new_getter =
-      new(Z) StaticGetterNode(node->token_pos(),
-                              new_receiver,
-                              node->cls(),
-                              node->field_name());
+  StaticGetterNode* new_getter = new (Z) StaticGetterNode(
+      node->token_pos(), new_receiver, node->cls(), node->field_name());
   new_getter->set_owner(node->owner());
   result_ = MakeName(new_getter);
 }
@@ -457,16 +418,11 @@
   AstNode* new_value = Transform(node->value());
   StaticSetterNode* new_setter =
       node->function().IsNull()
-      ? new(Z) StaticSetterNode(node->token_pos(),
-                                new_receiver,
-                                node->cls(),
-                                node->field_name(),
-                                new_value)
-      : new(Z) StaticSetterNode(node->token_pos(),
-                                new_receiver,
-                                node->field_name(),
-                                node->function(),
-                                new_value);
+          ? new (Z) StaticSetterNode(node->token_pos(), new_receiver,
+                                     node->cls(), node->field_name(), new_value)
+          : new (Z) StaticSetterNode(node->token_pos(), new_receiver,
+                                     node->field_name(), node->function(),
+                                     new_value);
 
   result_ = MakeName(new_setter);
 }
@@ -479,9 +435,8 @@
 
 void AwaitTransformer::VisitStoreLocalNode(StoreLocalNode* node) {
   AstNode* new_value = Transform(node->value());
-  result_ = MakeName(new(Z) StoreLocalNode(node->token_pos(),
-      &node->local(),
-      new_value));
+  result_ = MakeName(
+      new (Z) StoreLocalNode(node->token_pos(), &node->local(), new_value));
 }
 
 
@@ -492,8 +447,8 @@
 
 void AwaitTransformer::VisitStoreStaticFieldNode(StoreStaticFieldNode* node) {
   AstNode* new_value = Transform(node->value());
-  result_ = MakeName(new(Z) StoreStaticFieldNode(node->token_pos(),
-      Field::ZoneHandle(Z, node->field().Original()),
+  result_ = MakeName(new (Z) StoreStaticFieldNode(
+      node->token_pos(), Field::ZoneHandle(Z, node->field().Original()),
       new_value));
 }
 
@@ -501,10 +456,8 @@
 void AwaitTransformer::VisitLoadIndexedNode(LoadIndexedNode* node) {
   AstNode* new_array = Transform(node->array());
   AstNode* new_index = Transform(node->index_expr());
-  result_ = MakeName(new(Z) LoadIndexedNode(node->token_pos(),
-      new_array,
-      new_index,
-      node->super_class()));
+  result_ = MakeName(new (Z) LoadIndexedNode(node->token_pos(), new_array,
+                                             new_index, node->super_class()));
 }
 
 
@@ -512,20 +465,15 @@
   AstNode* new_array = Transform(node->array());
   AstNode* new_index = Transform(node->index_expr());
   AstNode* new_value = Transform(node->value());
-  result_ = MakeName(new(Z) StoreIndexedNode(node->token_pos(),
-      new_array,
-      new_index,
-      new_value,
-      node->super_class()));
+  result_ = MakeName(new (Z) StoreIndexedNode(
+      node->token_pos(), new_array, new_index, new_value, node->super_class()));
 }
 
 
 void AwaitTransformer::VisitAssignableNode(AssignableNode* node) {
   AstNode* new_expr = Transform(node->expr());
-  result_ = MakeName(new(Z) AssignableNode(node->token_pos(),
-      new_expr,
-      node->type(),
-      node->dst_name()));
+  result_ = MakeName(new (Z) AssignableNode(node->token_pos(), new_expr,
+                                            node->type(), node->dst_name()));
 }
 
 
@@ -538,9 +486,8 @@
   for (intptr_t i = 0; i < node->num_temps(); i++) {
     async_temp_scope_->AddVariable(node->TempAt(i));
     AstNode* new_init_val = Transform(node->InitializerAt(i));
-    preamble_->Add(new(Z) StoreLocalNode(node->token_pos(),
-                                         node->TempAt(i),
-                                         new_init_val));
+    preamble_->Add(new (Z) StoreLocalNode(node->token_pos(), node->TempAt(i),
+                                          new_init_val));
   }
 
   // Add all expressions but the last to the preamble. We must do
@@ -562,9 +509,8 @@
 
 void AwaitTransformer::VisitThrowNode(ThrowNode* node) {
   AstNode* new_exception = Transform(node->exception());
-  result_ = MakeName(new(Z) ThrowNode(node->token_pos(),
-      new_exception,
-      node->stacktrace()));
+  result_ = MakeName(
+      new (Z) ThrowNode(node->token_pos(), new_exception, node->stacktrace()));
 }
 
 }  // namespace dart
diff --git a/runtime/vm/ast_transformer.h b/runtime/vm/ast_transformer.h
index e189afd..917919f 100644
--- a/runtime/vm/ast_transformer.h
+++ b/runtime/vm/ast_transformer.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_AST_TRANSFORMER_H_
-#define VM_AST_TRANSFORMER_H_
+#ifndef RUNTIME_VM_AST_TRANSFORMER_H_
+#define RUNTIME_VM_AST_TRANSFORMER_H_
 
 #include "platform/assert.h"
 #include "vm/ast.h"
@@ -77,4 +77,4 @@
 
 }  // namespace dart
 
-#endif  // VM_AST_TRANSFORMER_H_
+#endif  // RUNTIME_VM_AST_TRANSFORMER_H_
diff --git a/runtime/vm/atomic.h b/runtime/vm/atomic.h
index e16eee1..c66c2cf 100644
--- a/runtime/vm/atomic.h
+++ b/runtime/vm/atomic.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_ATOMIC_H_
-#define VM_ATOMIC_H_
+#ifndef RUNTIME_VM_ATOMIC_H_
+#define RUNTIME_VM_ATOMIC_H_
 
 #include "platform/globals.h"
 
@@ -48,8 +48,9 @@
   //
   // NOTE: OK to use with memory locations that are accessed by generated code
   static uword CompareAndSwapWord(uword* ptr, uword old_value, uword new_value);
-  static uint32_t CompareAndSwapUint32(
-      uint32_t* ptr, uint32_t old_value, uint32_t new_value);
+  static uint32_t CompareAndSwapUint32(uint32_t* ptr,
+                                       uint32_t old_value,
+                                       uint32_t new_value);
 
   // Performs a load of a word from 'ptr', but without any guarantees about
   // memory order (i.e., no load barriers/fences).
@@ -86,4 +87,4 @@
 #error Unknown target os.
 #endif
 
-#endif  // VM_ATOMIC_H_
+#endif  // RUNTIME_VM_ATOMIC_H_
diff --git a/runtime/vm/atomic_android.h b/runtime/vm/atomic_android.h
index aa2b623..f0731ab 100644
--- a/runtime/vm/atomic_android.h
+++ b/runtime/vm/atomic_android.h
@@ -2,10 +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.
 
-#ifndef VM_ATOMIC_ANDROID_H_
-#define VM_ATOMIC_ANDROID_H_
+#ifndef RUNTIME_VM_ATOMIC_ANDROID_H_
+#define RUNTIME_VM_ATOMIC_ANDROID_H_
 
-#if !defined VM_ATOMIC_H_
+#if !defined RUNTIME_VM_ATOMIC_H_
 #error Do not include atomic_android.h directly. Use atomic.h instead.
 #endif
 
@@ -68,4 +68,4 @@
 
 }  // namespace dart
 
-#endif  // VM_ATOMIC_ANDROID_H_
+#endif  // RUNTIME_VM_ATOMIC_ANDROID_H_
diff --git a/runtime/vm/atomic_fuchsia.h b/runtime/vm/atomic_fuchsia.h
index c44c080..e85899f 100644
--- a/runtime/vm/atomic_fuchsia.h
+++ b/runtime/vm/atomic_fuchsia.h
@@ -2,10 +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.
 
-#ifndef VM_ATOMIC_FUCHSIA_H_
-#define VM_ATOMIC_FUCHSIA_H_
+#ifndef RUNTIME_VM_ATOMIC_FUCHSIA_H_
+#define RUNTIME_VM_ATOMIC_FUCHSIA_H_
 
-#if !defined VM_ATOMIC_H_
+#if !defined RUNTIME_VM_ATOMIC_H_
 #error Do not include atomic_fuchsia.h directly. Use atomic.h instead.
 #endif
 
@@ -67,4 +67,4 @@
 
 }  // namespace dart
 
-#endif  // VM_ATOMIC_FUCHSIA_H_
+#endif  // RUNTIME_VM_ATOMIC_FUCHSIA_H_
diff --git a/runtime/vm/atomic_linux.h b/runtime/vm/atomic_linux.h
index 350bced..c4ee910 100644
--- a/runtime/vm/atomic_linux.h
+++ b/runtime/vm/atomic_linux.h
@@ -2,10 +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.
 
-#ifndef VM_ATOMIC_LINUX_H_
-#define VM_ATOMIC_LINUX_H_
+#ifndef RUNTIME_VM_ATOMIC_LINUX_H_
+#define RUNTIME_VM_ATOMIC_LINUX_H_
 
-#if !defined VM_ATOMIC_H_
+#if !defined RUNTIME_VM_ATOMIC_H_
 #error Do not include atomic_linux.h directly. Use atomic.h instead.
 #endif
 
@@ -73,4 +73,4 @@
 
 }  // namespace dart
 
-#endif  // VM_ATOMIC_LINUX_H_
+#endif  // RUNTIME_VM_ATOMIC_LINUX_H_
diff --git a/runtime/vm/atomic_macos.h b/runtime/vm/atomic_macos.h
index cdd57d4..e1c701f 100644
--- a/runtime/vm/atomic_macos.h
+++ b/runtime/vm/atomic_macos.h
@@ -2,10 +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.
 
-#ifndef VM_ATOMIC_MACOS_H_
-#define VM_ATOMIC_MACOS_H_
+#ifndef RUNTIME_VM_ATOMIC_MACOS_H_
+#define RUNTIME_VM_ATOMIC_MACOS_H_
 
-#if !defined VM_ATOMIC_H_
+#if !defined RUNTIME_VM_ATOMIC_H_
 #error Do not include atomic_macos.h directly. Use atomic.h instead.
 #endif
 
@@ -68,4 +68,4 @@
 
 }  // namespace dart
 
-#endif  // VM_ATOMIC_MACOS_H_
+#endif  // RUNTIME_VM_ATOMIC_MACOS_H_
diff --git a/runtime/vm/atomic_simulator.h b/runtime/vm/atomic_simulator.h
index 78e7f88..83bd623 100644
--- a/runtime/vm/atomic_simulator.h
+++ b/runtime/vm/atomic_simulator.h
@@ -2,10 +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.
 
-#ifndef VM_ATOMIC_SIMULATOR_H_
-#define VM_ATOMIC_SIMULATOR_H_
+#ifndef RUNTIME_VM_ATOMIC_SIMULATOR_H_
+#define RUNTIME_VM_ATOMIC_SIMULATOR_H_
 
-#if !defined VM_ATOMIC_H_
+#if !defined RUNTIME_VM_ATOMIC_H_
 #error Do not include atomic_simulator.h directly. Use atomic.h instead.
 #endif
 
@@ -29,4 +29,4 @@
 
 }  // namespace dart
 
-#endif  // VM_ATOMIC_SIMULATOR_H_
+#endif  // RUNTIME_VM_ATOMIC_SIMULATOR_H_
diff --git a/runtime/vm/atomic_test.cc b/runtime/vm/atomic_test.cc
index 262a328..3a95a64 100644
--- a/runtime/vm/atomic_test.cc
+++ b/runtime/vm/atomic_test.cc
@@ -65,8 +65,8 @@
 TEST_CASE(CompareAndSwapWord) {
   uword old_value = 42;
   uword new_value = 100;
-  uword result = AtomicOperations::CompareAndSwapWord(
-      &old_value, old_value, new_value);
+  uword result =
+      AtomicOperations::CompareAndSwapWord(&old_value, old_value, new_value);
   EXPECT_EQ(static_cast<uword>(42), result);
 }
 
@@ -74,8 +74,8 @@
 TEST_CASE(CompareAndSwapUint32) {
   uint32_t old_value = 42;
   uint32_t new_value = 100;
-  uint32_t result = AtomicOperations::CompareAndSwapUint32(
-      &old_value, old_value, new_value);
+  uint32_t result =
+      AtomicOperations::CompareAndSwapUint32(&old_value, old_value, new_value);
   EXPECT_EQ(static_cast<uint32_t>(42), result);
 }
 
diff --git a/runtime/vm/atomic_win.h b/runtime/vm/atomic_win.h
index 2f8ee20..398ed43 100644
--- a/runtime/vm/atomic_win.h
+++ b/runtime/vm/atomic_win.h
@@ -2,10 +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.
 
-#ifndef VM_ATOMIC_WIN_H_
-#define VM_ATOMIC_WIN_H_
+#ifndef RUNTIME_VM_ATOMIC_WIN_H_
+#define RUNTIME_VM_ATOMIC_WIN_H_
 
-#if !defined VM_ATOMIC_H_
+#if !defined RUNTIME_VM_ATOMIC_H_
 #error Do not include atomic_win.h directly. Use atomic.h instead.
 #endif
 
@@ -18,10 +18,12 @@
 inline uintptr_t AtomicOperations::FetchAndIncrement(uintptr_t* p) {
 #if defined(HOST_ARCH_X64)
   return static_cast<uintptr_t>(
-      InterlockedIncrement64(reinterpret_cast<LONGLONG*>(p))) - 1;
+             InterlockedIncrement64(reinterpret_cast<LONGLONG*>(p))) -
+         1;
 #elif defined(HOST_ARCH_IA32)
   return static_cast<uintptr_t>(
-      InterlockedIncrement(reinterpret_cast<LONG*>(p))) - 1;
+             InterlockedIncrement(reinterpret_cast<LONG*>(p))) -
+         1;
 #else
 #error Unsupported host architecture.
 #endif
@@ -31,10 +33,12 @@
 inline intptr_t AtomicOperations::FetchAndIncrement(intptr_t* p) {
 #if defined(HOST_ARCH_X64)
   return static_cast<intptr_t>(
-      InterlockedIncrement64(reinterpret_cast<LONGLONG*>(p))) - 1;
+             InterlockedIncrement64(reinterpret_cast<LONGLONG*>(p))) -
+         1;
 #elif defined(HOST_ARCH_IA32)
   return static_cast<intptr_t>(
-      InterlockedIncrement(reinterpret_cast<LONG*>(p))) - 1;
+             InterlockedIncrement(reinterpret_cast<LONG*>(p))) -
+         1;
 #else
 #error Unsupported host architecture.
 #endif
@@ -46,8 +50,7 @@
   InterlockedExchangeAdd64(reinterpret_cast<LONGLONG*>(p),
                            static_cast<LONGLONG>(value));
 #elif defined(HOST_ARCH_IA32)
-  InterlockedExchangeAdd(reinterpret_cast<LONG*>(p),
-                         static_cast<LONG>(value));
+  InterlockedExchangeAdd(reinterpret_cast<LONG*>(p), static_cast<LONG>(value));
 #else
 #error Unsupported host architecture.
 #endif
@@ -67,10 +70,12 @@
 inline uintptr_t AtomicOperations::FetchAndDecrement(uintptr_t* p) {
 #if defined(HOST_ARCH_X64)
   return static_cast<uintptr_t>(
-      InterlockedDecrement64(reinterpret_cast<LONGLONG*>(p))) + 1;
+             InterlockedDecrement64(reinterpret_cast<LONGLONG*>(p))) +
+         1;
 #elif defined(HOST_ARCH_IA32)
   return static_cast<uintptr_t>(
-      InterlockedDecrement(reinterpret_cast<LONG*>(p))) + 1;
+             InterlockedDecrement(reinterpret_cast<LONG*>(p))) +
+         1;
 #else
 #error Unsupported host architecture.
 #endif
@@ -80,10 +85,12 @@
 inline intptr_t AtomicOperations::FetchAndDecrement(intptr_t* p) {
 #if defined(HOST_ARCH_X64)
   return static_cast<intptr_t>(
-      InterlockedDecrement64(reinterpret_cast<LONGLONG*>(p))) + 1;
+             InterlockedDecrement64(reinterpret_cast<LONGLONG*>(p))) +
+         1;
 #elif defined(HOST_ARCH_IA32)
   return static_cast<intptr_t>(
-      InterlockedDecrement(reinterpret_cast<LONG*>(p))) + 1;
+             InterlockedDecrement(reinterpret_cast<LONG*>(p))) +
+         1;
 #else
 #error Unsupported host architecture.
 #endif
@@ -95,8 +102,7 @@
   InterlockedExchangeAdd64(reinterpret_cast<LONGLONG*>(p),
                            static_cast<LONGLONG>(-value));
 #elif defined(HOST_ARCH_IA32)
-  InterlockedExchangeAdd(reinterpret_cast<LONG*>(p),
-                         static_cast<LONG>(-value));
+  InterlockedExchangeAdd(reinterpret_cast<LONG*>(p), static_cast<LONG>(-value));
 #else
 #error Unsupported host architecture.
 #endif
@@ -108,15 +114,13 @@
                                                   uword old_value,
                                                   uword new_value) {
 #if defined(HOST_ARCH_X64)
-  return static_cast<uword>(
-      InterlockedCompareExchange64(reinterpret_cast<LONGLONG*>(ptr),
-                                   static_cast<LONGLONG>(new_value),
-                                   static_cast<LONGLONG>(old_value)));
+  return static_cast<uword>(InterlockedCompareExchange64(
+      reinterpret_cast<LONGLONG*>(ptr), static_cast<LONGLONG>(new_value),
+      static_cast<LONGLONG>(old_value)));
 #elif defined(HOST_ARCH_IA32)
-  return static_cast<uword>(
-      InterlockedCompareExchange(reinterpret_cast<LONG*>(ptr),
-                                 static_cast<LONG>(new_value),
-                                 static_cast<LONG>(old_value)));
+  return static_cast<uword>(InterlockedCompareExchange(
+      reinterpret_cast<LONG*>(ptr), static_cast<LONG>(new_value),
+      static_cast<LONG>(old_value)));
 #else
 #error Unsupported host architecture.
 #endif
@@ -125,10 +129,9 @@
                                                        uint32_t old_value,
                                                        uint32_t new_value) {
 #if (defined(HOST_ARCH_X64) || defined(HOST_ARCH_IA32))
-  return static_cast<uint32_t>(
-      InterlockedCompareExchange(reinterpret_cast<LONG*>(ptr),
-                                 static_cast<LONG>(new_value),
-                                 static_cast<LONG>(old_value)));
+  return static_cast<uint32_t>(InterlockedCompareExchange(
+      reinterpret_cast<LONG*>(ptr), static_cast<LONG>(new_value),
+      static_cast<LONG>(old_value)));
 #else
 #error Unsupported host architecture.
 #endif
@@ -137,4 +140,4 @@
 
 }  // namespace dart
 
-#endif  // VM_ATOMIC_WIN_H_
+#endif  // RUNTIME_VM_ATOMIC_WIN_H_
diff --git a/runtime/vm/base_isolate.h b/runtime/vm/base_isolate.h
index b2cc7fc..5449880 100644
--- a/runtime/vm/base_isolate.h
+++ b/runtime/vm/base_isolate.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_BASE_ISOLATE_H_
-#define VM_BASE_ISOLATE_H_
+#ifndef RUNTIME_VM_BASE_ISOLATE_H_
+#define RUNTIME_VM_BASE_ISOLATE_H_
 
 #include "platform/assert.h"
 #include "vm/globals.h"
@@ -31,9 +31,7 @@
 #endif
 
  protected:
-  BaseIsolate()
-      : mutator_thread_(NULL) {
-  }
+  BaseIsolate() : mutator_thread_(NULL) {}
 
   ~BaseIsolate() {
     // Do not delete stack resources: top_resource_ and current_zone_.
@@ -47,4 +45,4 @@
 
 }  // namespace dart
 
-#endif  // VM_BASE_ISOLATE_H_
+#endif  // RUNTIME_VM_BASE_ISOLATE_H_
diff --git a/runtime/vm/become.cc b/runtime/vm/become.cc
index 5424805..0fddef2 100644
--- a/runtime/vm/become.cc
+++ b/runtime/vm/become.cc
@@ -62,8 +62,8 @@
   const intptr_t size_before = before_obj->Size();
 
   uword corpse_addr = reinterpret_cast<uword>(before_obj) - kHeapObjectTag;
-  ForwardingCorpse* forwarder = ForwardingCorpse::AsForwarder(corpse_addr,
-                                                              size_before);
+  ForwardingCorpse* forwarder =
+      ForwardingCorpse::AsForwarder(corpse_addr, size_before);
   forwarder->set_target(after_obj);
   if (!IsForwardingObject(before_obj)) {
     FATAL("become: ForwardObjectTo failure.");
@@ -79,7 +79,7 @@
 class ForwardPointersVisitor : public ObjectPointerVisitor {
  public:
   explicit ForwardPointersVisitor(Isolate* isolate)
-      : ObjectPointerVisitor(isolate), visiting_object_(NULL), count_(0) { }
+      : ObjectPointerVisitor(isolate), visiting_object_(NULL), count_(0) {}
 
   virtual void VisitPointers(RawObject** first, RawObject** last) {
     for (RawObject** p = first; p <= last; p++) {
@@ -111,7 +111,7 @@
 class ForwardHeapPointersVisitor : public ObjectVisitor {
  public:
   explicit ForwardHeapPointersVisitor(ForwardPointersVisitor* pointer_visitor)
-      : pointer_visitor_(pointer_visitor) { }
+      : pointer_visitor_(pointer_visitor) {}
 
   virtual void VisitObject(RawObject* obj) {
     pointer_visitor_->VisitingObject(obj);
@@ -128,7 +128,7 @@
 class ForwardHeapPointersHandleVisitor : public HandleVisitor {
  public:
   ForwardHeapPointersHandleVisitor()
-      : HandleVisitor(Thread::Current()), count_(0) { }
+      : HandleVisitor(Thread::Current()), count_(0) {}
 
   virtual void VisitHandle(uword addr) {
     FinalizablePersistentHandle* handle =
@@ -173,8 +173,8 @@
 #else
 class WritableCodeLiteralsScope : public ValueObject {
  public:
-  explicit WritableCodeLiteralsScope(Heap* heap) { }
-  ~WritableCodeLiteralsScope() { }
+  explicit WritableCodeLiteralsScope(Heap* heap) {}
+  ~WritableCodeLiteralsScope() {}
 };
 #endif
 
@@ -291,7 +291,7 @@
 
 #if !defined(PRODUCT)
     tds.SetNumArguments(2);
-    tds.FormatArgument(0, "Remapped objects", "%" Pd,  before.Length());
+    tds.FormatArgument(0, "Remapped objects", "%" Pd, before.Length());
     tds.FormatArgument(1, "Remapped references", "%" Pd,
                        pointer_visitor.count() + handle_visitor.count());
 #endif
diff --git a/runtime/vm/become.h b/runtime/vm/become.h
index 12ab764..1784d22 100644
--- a/runtime/vm/become.h
+++ b/runtime/vm/become.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_BECOME_H_
-#define VM_BECOME_H_
+#ifndef RUNTIME_VM_BECOME_H_
+#define RUNTIME_VM_BECOME_H_
 
 #include "vm/allocation.h"
 #include "vm/raw_object.h"
@@ -22,12 +22,8 @@
 // representation as a FreeListElement.
 class ForwardingCorpse {
  public:
-  RawObject* target() const {
-    return target_;
-  }
-  void set_target(RawObject* target) {
-    target_ = target;
-  }
+  RawObject* target() const { return target_; }
+  void set_target(RawObject* target) { target_ = target; }
 
   intptr_t Size() {
     intptr_t size = RawObject::SizeTag::decode(tags_);
@@ -42,7 +38,7 @@
   // Used to allocate class for forwarding corpses in Object::InitOnce.
   class FakeInstance {
    public:
-    FakeInstance() { }
+    FakeInstance() {}
     static cpp_vtable vtable() { return 0; }
     static intptr_t InstanceSize() { return 0; }
     static intptr_t NextFieldOffset() { return -kWordSize; }
@@ -92,4 +88,4 @@
 
 }  // namespace dart
 
-#endif  // VM_BECOME_H_
+#endif  // RUNTIME_VM_BECOME_H_
diff --git a/runtime/vm/benchmark_test.cc b/runtime/vm/benchmark_test.cc
index 0dcfa2b..db3bfc4 100644
--- a/runtime/vm/benchmark_test.cc
+++ b/runtime/vm/benchmark_test.cc
@@ -32,20 +32,14 @@
 static char* ComputeDart2JSPath(const char* arg) {
   char buffer[2048];
   char* dart2js_path = strdup(File::GetCanonicalPath(arg));
-  const char* compiler_path =
-      "%s%spkg%scompiler%slib%scompiler.dart";
+  const char* compiler_path = "%s%spkg%scompiler%slib%scompiler.dart";
   const char* path_separator = File::PathSeparator();
   ASSERT(path_separator != NULL && strlen(path_separator) == 1);
   char* ptr = strrchr(dart2js_path, *path_separator);
   while (ptr != NULL) {
     *ptr = '\0';
-    OS::SNPrint(buffer, 2048, compiler_path,
-                dart2js_path,
-                path_separator,
-                path_separator,
-                path_separator,
-                path_separator,
-                path_separator);
+    OS::SNPrint(buffer, 2048, compiler_path, dart2js_path, path_separator,
+                path_separator, path_separator, path_separator, path_separator);
     if (File::Exists(buffer)) {
       break;
     }
@@ -59,8 +53,7 @@
 }
 
 
-static void func(Dart_NativeArguments args) {
-}
+static void func(Dart_NativeArguments args) {}
 
 
 static Dart_NativeFunction NativeResolver(Dart_Handle name,
@@ -85,8 +78,8 @@
       strdup(File::GetCanonicalPath(Benchmark::Executable()));
   const char* packages_path = "%s%s..%spackages";
   const char* path_separator = File::PathSeparator();
-  OS::SNPrint(buffer, 2048, packages_path,
-              executable_path, path_separator, path_separator);
+  OS::SNPrint(buffer, 2048, packages_path, executable_path, path_separator,
+              path_separator);
   result = bin::DartUtils::SetupPackageRoot(buffer, NULL);
   DART_CHECK_VALID(result);
 }
@@ -163,11 +156,10 @@
   char* script = NULL;
   if (dart_root != NULL) {
     HANDLESCOPE(thread);
-    script = OS::SCreate(NULL,
-        "import '%s/pkg/compiler/lib/compiler.dart';", dart_root);
+    script = OS::SCreate(NULL, "import '%s/pkg/compiler/lib/compiler.dart';",
+                         dart_root);
     Dart_Handle lib = TestCase::LoadTestScript(
-        script,
-        reinterpret_cast<Dart_NativeEntryResolver>(NativeResolver));
+        script, reinterpret_cast<Dart_NativeEntryResolver>(NativeResolver));
     EXPECT_VALID(lib);
   } else {
     Dart_Handle lib = TestCase::LoadTestScript(
@@ -301,14 +293,12 @@
       "}\n";
 
   Dart_Handle lib = TestCase::LoadTestScript(
-      kScriptChars,
-      reinterpret_cast<Dart_NativeEntryResolver>(bm_uda_lookup),
-      USER_TEST_URI,
-      false);
+      kScriptChars, reinterpret_cast<Dart_NativeEntryResolver>(bm_uda_lookup),
+      USER_TEST_URI, false);
 
   // Create a native wrapper class with native fields.
-  Dart_Handle result = Dart_CreateNativeWrapperClass(
-      lib, NewString("NativeFieldsWrapper"), 1);
+  Dart_Handle result =
+      Dart_CreateNativeWrapperClass(lib, NewString("NativeFieldsWrapper"), 1);
   EXPECT_VALID(result);
   result = Dart_FinalizeLoading(false);
   EXPECT_VALID(result);
@@ -338,7 +328,7 @@
   Dart_EnterScope();
 
   // Create strings.
-  uint8_t data8[] = { 'o', 'n', 'e', 0xFF };
+  uint8_t data8[] = {'o', 'n', 'e', 0xFF};
   int external_peer_data = 123;
   intptr_t char_size;
   intptr_t str_len;
@@ -353,9 +343,7 @@
     EXPECT_VALID(external_string);
     EXPECT(Dart_IsExternalString(external_string));
     void* external_peer = NULL;
-    EXPECT_VALID(Dart_StringGetProperties(external_string,
-                                          &char_size,
-                                          &str_len,
+    EXPECT_VALID(Dart_StringGetProperties(external_string, &char_size, &str_len,
                                           &external_peer));
     EXPECT_EQ(1, char_size);
     EXPECT_EQ(4, str_len);
@@ -377,11 +365,10 @@
   char* script = NULL;
   if (dart_root != NULL) {
     HANDLESCOPE(thread);
-    script = OS::SCreate(NULL,
-        "import '%s/pkg/compiler/lib/compiler.dart';", dart_root);
+    script = OS::SCreate(NULL, "import '%s/pkg/compiler/lib/compiler.dart';",
+                         dart_root);
     Dart_Handle lib = TestCase::LoadTestScript(
-        script,
-        reinterpret_cast<Dart_NativeEntryResolver>(NativeResolver));
+        script, reinterpret_cast<Dart_NativeEntryResolver>(NativeResolver));
     EXPECT_VALID(lib);
   } else {
     Dart_Handle lib = TestCase::LoadTestScript(
@@ -498,8 +485,9 @@
 }
 
 
-static uint8_t* malloc_allocator(
-    uint8_t* ptr, intptr_t old_size, intptr_t new_size) {
+static uint8_t* malloc_allocator(uint8_t* ptr,
+                                 intptr_t old_size,
+                                 intptr_t new_size) {
   return reinterpret_cast<uint8_t*>(realloc(ptr, new_size));
 }
 
@@ -525,10 +513,8 @@
   Api::CheckAndFinalizePendingClasses(thread);
 
   // Write snapshot with object content.
-  FullSnapshotWriter writer(Snapshot::kCore,
-                            &vm_isolate_snapshot_buffer,
-                            &isolate_snapshot_buffer,
-                            &malloc_allocator,
+  FullSnapshotWriter writer(Snapshot::kCore, &vm_isolate_snapshot_buffer,
+                            &isolate_snapshot_buffer, &malloc_allocator,
                             NULL /* instructions_writer */);
   writer.WriteFullSnapshot();
   const Snapshot* snapshot = Snapshot::SetupFromBuffer(isolate_snapshot_buffer);
@@ -561,10 +547,8 @@
   Api::CheckAndFinalizePendingClasses(thread);
 
   // Write snapshot with object content.
-  FullSnapshotWriter writer(Snapshot::kCore,
-                            &vm_isolate_snapshot_buffer,
-                            &isolate_snapshot_buffer,
-                            &malloc_allocator,
+  FullSnapshotWriter writer(Snapshot::kCore, &vm_isolate_snapshot_buffer,
+                            &isolate_snapshot_buffer, &malloc_allocator,
                             NULL /* instructions_writer */);
   writer.WriteFullSnapshot();
   const Snapshot* snapshot = Snapshot::SetupFromBuffer(isolate_snapshot_buffer);
@@ -613,8 +597,9 @@
 
 
 static uint8_t message_buffer[64];
-static uint8_t* message_allocator(
-    uint8_t* ptr, intptr_t old_size, intptr_t new_size) {
+static uint8_t* message_allocator(uint8_t* ptr,
+                                  intptr_t old_size,
+                                  intptr_t new_size) {
   return message_buffer;
 }
 
@@ -632,9 +617,7 @@
     intptr_t buffer_len = writer.BytesWritten();
 
     // Read object back from the snapshot.
-    MessageSnapshotReader reader(buffer,
-                                 buffer_len,
-                                 thread);
+    MessageSnapshotReader reader(buffer, buffer_len, thread);
     reader.ReadObject();
   }
   timer.Stop();
@@ -656,9 +639,7 @@
     intptr_t buffer_len = writer.BytesWritten();
 
     // Read object back from the snapshot.
-    MessageSnapshotReader reader(buffer,
-                                 buffer_len,
-                                 thread);
+    MessageSnapshotReader reader(buffer, buffer_len, thread);
     reader.ReadObject();
   }
   timer.Stop();
@@ -683,9 +664,7 @@
     intptr_t buffer_len = writer.BytesWritten();
 
     // Read object back from the snapshot.
-    MessageSnapshotReader reader(buffer,
-                                 buffer_len,
-                                 thread);
+    MessageSnapshotReader reader(buffer, buffer_len, thread);
     reader.ReadObject();
     free(buffer);
   }
@@ -719,9 +698,7 @@
     intptr_t buffer_len = writer.BytesWritten();
 
     // Read object back from the snapshot.
-    MessageSnapshotReader reader(buffer,
-                                 buffer_len,
-                                 thread);
+    MessageSnapshotReader reader(buffer, buffer_len, thread);
     reader.ReadObject();
     free(buffer);
   }
diff --git a/runtime/vm/benchmark_test.h b/runtime/vm/benchmark_test.h
index ab572e4..b51c64c 100644
--- a/runtime/vm/benchmark_test.h
+++ b/runtime/vm/benchmark_test.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_BENCHMARK_TEST_H_
-#define VM_BENCHMARK_TEST_H_
+#ifndef RUNTIME_VM_BENCHMARK_TEST_H_
+#define RUNTIME_VM_BENCHMARK_TEST_H_
 
 #include "include/dart_api.h"
 
@@ -34,7 +34,8 @@
 #define BENCHMARK_HELPER(name, kind)                                           \
   void Dart_Benchmark##name(Benchmark* benchmark);                             \
   static Benchmark kRegister##name(Dart_Benchmark##name, #name, kind);         \
-  static void Dart_BenchmarkHelper##name(Benchmark* benchmark, Thread* thread);\
+  static void Dart_BenchmarkHelper##name(Benchmark* benchmark,                 \
+                                         Thread* thread);                      \
   void Dart_Benchmark##name(Benchmark* benchmark) {                            \
     FLAG_old_gen_growth_space_ratio = 100;                                     \
     BenchmarkIsolateScope __isolate__(benchmark);                              \
@@ -48,7 +49,7 @@
 
 #define BENCHMARK(name) BENCHMARK_HELPER(name, "RunTime")
 #define BENCHMARK_SIZE(name) BENCHMARK_HELPER(name, "CodeSize")
-#define BENCHMARK_MEMORY(name) BENCHMARK_HELPER(name, "Memory")
+#define BENCHMARK_MEMORY(name) BENCHMARK_HELPER(name, "MemoryUse")
 
 inline Dart_Handle NewString(const char* str) {
   return Dart_NewStringFromCString(str);
@@ -57,15 +58,15 @@
 
 class Benchmark {
  public:
-  typedef void (RunEntry)(Benchmark* benchmark);
+  typedef void(RunEntry)(Benchmark* benchmark);
 
-  Benchmark(RunEntry* run, const char* name, const char* score_kind) :
-      run_(run),
-      name_(name),
-      score_kind_(score_kind),
-      score_(0),
-      isolate_(NULL),
-      next_(NULL) {
+  Benchmark(RunEntry* run, const char* name, const char* score_kind)
+      : run_(run),
+        name_(name),
+        score_kind_(score_kind),
+        score_(0),
+        isolate_(NULL),
+        next_(NULL) {
     if (first_ == NULL) {
       first_ = this;
     } else {
@@ -128,4 +129,4 @@
 
 }  // namespace dart
 
-#endif  // VM_BENCHMARK_TEST_H_
+#endif  // RUNTIME_VM_BENCHMARK_TEST_H_
diff --git a/runtime/vm/bigint_test.cc b/runtime/vm/bigint_test.cc
index 967e036..22300f4 100644
--- a/runtime/vm/bigint_test.cc
+++ b/runtime/vm/bigint_test.cc
@@ -9,12 +9,6 @@
 
 namespace dart {
 
-static uword ZoneAllocator(intptr_t size) {
-  Zone* zone = Thread::Current()->zone();
-  return zone->AllocUnsafe(size);
-}
-
-
 TEST_CASE(BigintSmi) {
   {
     const Smi& smi = Smi::Handle(Smi::New(5));
@@ -159,8 +153,7 @@
   EXPECT_EQ(4.1909428413307135e+24, bigint.AsDoubleValue());
 
   // Reduced precision.
-  bigint = Bigint::NewFromCString(
-      "9876543210987654321098765432109876543210");
+  bigint = Bigint::NewFromCString("9876543210987654321098765432109876543210");
   EXPECT_EQ(9.8765432109876546e+39, bigint.AsDoubleValue());
 
   bigint = Bigint::NewFromCString(
@@ -175,7 +168,7 @@
       "12345678901234567890123456789012345678901234567890"
       "12345678901234567890123456789012345678901234567890");
   double zero = 0.0;
-  EXPECT_EQ(1.0/zero, bigint.AsDoubleValue());
+  EXPECT_EQ(1.0 / zero, bigint.AsDoubleValue());
 
   bigint = Bigint::NewFromCString(
       "17976931348623157081452742373170435679807056752584"
@@ -195,7 +188,7 @@
       "29520850057688381506823424628814739131105408272371"
       "63350510684586298239947245938479716304835356329624"
       "224137216");
-  EXPECT_EQ(1.0/zero, bigint.AsDoubleValue());
+  EXPECT_EQ(1.0 / zero, bigint.AsDoubleValue());
 
   bigint = Bigint::NewFromCString(
       "17976931348623158079372897140530341507993413271003"
@@ -205,7 +198,7 @@
       "57302700698555713669596228429148198608349364752927"
       "19074168444365510704342711559699508093042880177904"
       "174497792");
-  EXPECT_EQ(1.0/zero, bigint.AsDoubleValue());
+  EXPECT_EQ(1.0 / zero, bigint.AsDoubleValue());
 
   bigint = Bigint::NewFromCString(
       "17976931348623158079372897140530341507993413271003"
@@ -224,17 +217,18 @@
   EXPECT_EQ(1.0000000000000001e+23, bigint.AsDoubleValue());
 
   // Same but shifted 64 bits to the left.
-  bigint = Bigint::NewFromCString(
-      "1844674407370955161600000000000000000000000");
+  bigint =
+      Bigint::NewFromCString("1844674407370955161600000000000000000000000");
   EXPECT_EQ(1.844674407370955e+42, bigint.AsDoubleValue());
 
-  bigint = Bigint::NewFromCString(
-      "1844674407370955161600000000000000000000001");
+  bigint =
+      Bigint::NewFromCString("1844674407370955161600000000000000000000001");
   EXPECT_EQ(1.8446744073709553e+42, bigint.AsDoubleValue());
 }
 
 
 TEST_CASE(BigintHexStrings) {
+  Zone* zone = Thread::Current()->zone();
   {
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString("0x0"));
     EXPECT(bigint.FitsIntoSmi());
@@ -255,41 +249,41 @@
 
   {
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString("0x123"));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ("0x123", str);
   }
 
   {
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString("0xaBcEf"));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ("0xABCEF", str);
   }
 
   {
     const char* in = "0x123456789";
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString(in));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ(in, str);
   }
 
   {
     const char* in = "0xFFFFFFF";
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString(in));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ(in, str);
   }
 
   {
     const char* in = "0x10000000";
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString(in));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ(in, str);
   }
 
   {
     const char* in = "0x123456789ABCDEF01234567890ABCDEF0123456789ABCDEF0";
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString(in));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ(in, str);
   }
 
@@ -301,27 +295,27 @@
 
   {
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString("-0x123"));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ("-0x123", str);
   }
 
   {
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString("-0xaBcEf"));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ("-0xABCEF", str);
   }
 
   {
     const char* in = "-0x123456789";
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString(in));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ(in, str);
   }
 
   {
     const char* in = "-0x123456789ABCDEF01234567890ABCDEF0123456789ABCDEF0";
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString(in));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ(in, str);
   }
 
@@ -332,135 +326,135 @@
   }
 
   {
-    const Bigint& bigint = Bigint::Handle(
-        Bigint::NewFromCString("0x000000123"));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const Bigint& bigint =
+        Bigint::Handle(Bigint::NewFromCString("0x000000123"));
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ("0x123", str);
   }
 
   {
-    const Bigint& bigint = Bigint::Handle(
-        Bigint::NewFromCString("0x0000aBcEf"));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const Bigint& bigint =
+        Bigint::Handle(Bigint::NewFromCString("0x0000aBcEf"));
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ("0xABCEF", str);
   }
 
   {
     const char* in = "0x00000000000000000000000000000000000000000000123456789";
-    const char* out =                                            "0x123456789";
+    const char* out = "0x123456789";
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString(in));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ(out, str);
   }
 
   {
     const char* in = "0x00000123456789ABCDEF01234567890ABCDEF0123456789ABCDEF0";
-    const char* out =     "0x123456789ABCDEF01234567890ABCDEF0123456789ABCDEF0";
+    const char* out = "0x123456789ABCDEF01234567890ABCDEF0123456789ABCDEF0";
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString(in));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ(out, str);
   }
 
   {
-    const Bigint& bigint = Bigint::Handle(
-        Bigint::NewFromCString("-0x00000123"));
+    const Bigint& bigint =
+        Bigint::Handle(Bigint::NewFromCString("-0x00000123"));
     EXPECT(bigint.FitsIntoSmi());
     EXPECT_EQ(-0x123, bigint.AsInt64Value());
   }
 
   {
-    const Bigint& bigint = Bigint::Handle(
-        Bigint::NewFromCString("-0x00000123"));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const Bigint& bigint =
+        Bigint::Handle(Bigint::NewFromCString("-0x00000123"));
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ("-0x123", str);
   }
 
   {
-    const Bigint& bigint = Bigint::Handle(
-        Bigint::NewFromCString("-0x000aBcEf"));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const Bigint& bigint =
+        Bigint::Handle(Bigint::NewFromCString("-0x000aBcEf"));
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ("-0xABCEF", str);
   }
 
   {
     const char* in = "-0x00000000000000000000000000000000000000000000123456789";
-    const char* out =                                            "-0x123456789";
+    const char* out = "-0x123456789";
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString(in));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ(out, str);
   }
 
   {
     const char* in = "-0x0000123456789ABCDEF01234567890ABCDEF0123456789ABCDEF0";
-    const char* out =    "-0x123456789ABCDEF01234567890ABCDEF0123456789ABCDEF0";
+    const char* out = "-0x123456789ABCDEF01234567890ABCDEF0123456789ABCDEF0";
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString(in));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ(out, str);
   }
   {
     const char* test = "12345678901234567890";
     const char* out = "0xAB54A98CEB1F0AD2";
-    const Bigint& bigint = Bigint::Handle(
-        Bigint::NewFromCString(test));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString(test));
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ(out, str);
   }
   {
     const char* test = "-12345678901234567890";
     const char* out = "-0xAB54A98CEB1F0AD2";
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString(test));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ(out, str);
   }
 }
 
 
 TEST_CASE(BigintDecStrings) {
+  Zone* zone = Thread::Current()->zone();
   {
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString("0x0"));
-    const char* str = bigint.ToDecCString(&ZoneAllocator);
+    const char* str = bigint.ToDecCString(zone);
     EXPECT_STREQ("0", str);
   }
 
   {
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString("0x123"));
-    const char* str = bigint.ToDecCString(&ZoneAllocator);
+    const char* str = bigint.ToDecCString(zone);
     EXPECT_STREQ("291", str);
   }
 
   {
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString("0xaBcEf"));
-    const char* str = bigint.ToDecCString(&ZoneAllocator);
+    const char* str = bigint.ToDecCString(zone);
     EXPECT_STREQ("703727", str);
   }
 
   {
     const char* in = "0x123456789";
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString(in));
-    const char* str = bigint.ToDecCString(&ZoneAllocator);
+    const char* str = bigint.ToDecCString(zone);
     EXPECT_STREQ("4886718345", str);
   }
 
   {
     const char* in = "0xFFFFFFF";
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString(in));
-    const char* str = bigint.ToDecCString(&ZoneAllocator);
+    const char* str = bigint.ToDecCString(zone);
     EXPECT_STREQ("268435455", str);
   }
 
   {
     const char* in = "0x10000000";
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString(in));
-    const char* str = bigint.ToDecCString(&ZoneAllocator);
+    const char* str = bigint.ToDecCString(zone);
     EXPECT_STREQ("268435456", str);
   }
 
   {
     const char* in = "0x123456789ABCDEF01234567890ABCDEF0123456789ABCDEF0";
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString(in));
-    const char* str = bigint.ToDecCString(&ZoneAllocator);
+    const char* str = bigint.ToDecCString(zone);
     EXPECT_STREQ("7141946863373290020600059860922167424469804758405880798960",
-        str);
+                 str);
   }
 
   {
@@ -471,29 +465,29 @@
 
   {
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString("-0x123"));
-    const char* str = bigint.ToDecCString(&ZoneAllocator);
+    const char* str = bigint.ToDecCString(zone);
     EXPECT_STREQ("-291", str);
   }
 
   {
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString("-0xaBcEf"));
-    const char* str = bigint.ToDecCString(&ZoneAllocator);
+    const char* str = bigint.ToDecCString(zone);
     EXPECT_STREQ("-703727", str);
   }
 
   {
     const char* in = "-0x123456789";
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString(in));
-    const char* str = bigint.ToDecCString(&ZoneAllocator);
+    const char* str = bigint.ToDecCString(zone);
     EXPECT_STREQ("-4886718345", str);
   }
 
   {
     const char* in = "-0x123456789ABCDEF01234567890ABCDEF0123456789ABCDEF0";
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString(in));
-    const char* str = bigint.ToDecCString(&ZoneAllocator);
+    const char* str = bigint.ToDecCString(zone);
     EXPECT_STREQ("-7141946863373290020600059860922167424469804758405880798960",
-        str);
+                 str);
   }
 
   {
@@ -503,16 +497,16 @@
   }
 
   {
-    const Bigint& bigint = Bigint::Handle(
-        Bigint::NewFromCString("0x000000123"));
-    const char* str = bigint.ToDecCString(&ZoneAllocator);
+    const Bigint& bigint =
+        Bigint::Handle(Bigint::NewFromCString("0x000000123"));
+    const char* str = bigint.ToDecCString(zone);
     EXPECT_STREQ("291", str);
   }
 
   {
     const Bigint& bigint = Bigint::Handle(
         Bigint::NewFromCString("100000000000000000000000000000000"));
-    const char* str = bigint.ToDecCString(&ZoneAllocator);
+    const char* str = bigint.ToDecCString(zone);
     EXPECT_STREQ("100000000000000000000000000000000", str);
   }
 }
@@ -590,6 +584,7 @@
 
 
 TEST_CASE(BigintDecimalStrings) {
+  Zone* zone = Thread::Current()->zone();
   {
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString("0"));
     EXPECT(bigint.FitsIntoSmi());
@@ -604,20 +599,20 @@
 
   {
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString("703710"));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ("0xABCDE", str);
   }
 
   {
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString("11259375"));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ("0xABCDEF", str);
   }
 
   {
     const Bigint& bigint =
         Bigint::Handle(Bigint::NewFromCString("1311768467463790320"));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ("0x123456789ABCDEF0", str);
   }
 
@@ -635,20 +630,20 @@
 
   {
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString("-703710"));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ("-0xABCDE", str);
   }
 
   {
     const Bigint& bigint = Bigint::Handle(Bigint::NewFromCString("-11259375"));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ("-0xABCDEF", str);
   }
 
   {
-    const Bigint& bigint = Bigint::Handle(
-        Bigint::NewFromCString("-1311768467463790320"));
-    const char* str = bigint.ToHexCString(&ZoneAllocator);
+    const Bigint& bigint =
+        Bigint::Handle(Bigint::NewFromCString("-1311768467463790320"));
+    const char* str = bigint.ToHexCString(zone);
     EXPECT_STREQ("-0x123456789ABCDEF0", str);
   }
 }
diff --git a/runtime/vm/bit_set.h b/runtime/vm/bit_set.h
index a60f668..4e716c1 100644
--- a/runtime/vm/bit_set.h
+++ b/runtime/vm/bit_set.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_BIT_SET_H_
-#define VM_BIT_SET_H_
+#ifndef RUNTIME_VM_BIT_SET_H_
+#define RUNTIME_VM_BIT_SET_H_
 
 #include "platform/utils.h"
 #include "vm/globals.h"
@@ -12,12 +12,10 @@
 
 // Just like its namesake in the STL, a BitSet object contains a fixed
 // length sequence of bits.
-template<intptr_t N>
+template <intptr_t N>
 class BitSet {
  public:
-  BitSet() {
-    Reset();
-  }
+  BitSet() { Reset(); }
 
   void Set(intptr_t i, bool value) {
     ASSERT(i >= 0);
@@ -85,13 +83,9 @@
     }
   }
 
-  void Reset() {
-    memset(data_, 0, sizeof(data_));
-  }
+  void Reset() { memset(data_, 0, sizeof(data_)); }
 
-  intptr_t Size() const {
-    return N;
-  }
+  intptr_t Size() const { return N; }
 
  private:
   static const int kLengthInWords = 1 + ((N - 1) / kBitsPerWord);
@@ -100,4 +94,4 @@
 
 }  // namespace dart
 
-#endif  // VM_BIT_SET_H_
+#endif  // RUNTIME_VM_BIT_SET_H_
diff --git a/runtime/vm/bit_set_test.cc b/runtime/vm/bit_set_test.cc
index 426ed4f5..432d086 100644
--- a/runtime/vm/bit_set_test.cc
+++ b/runtime/vm/bit_set_test.cc
@@ -8,7 +8,7 @@
 
 namespace dart {
 
-template<intptr_t Size>
+template <intptr_t Size>
 void TestBitSet() {
   BitSet<Size> set;
   EXPECT_EQ(-1, set.Last());
diff --git a/runtime/vm/bit_vector.h b/runtime/vm/bit_vector.h
index 9afa05f..b04c6ec 100644
--- a/runtime/vm/bit_vector.h
+++ b/runtime/vm/bit_vector.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_BIT_VECTOR_H_
-#define VM_BIT_VECTOR_H_
+#ifndef RUNTIME_VM_BIT_VECTOR_H_
+#define RUNTIME_VM_BIT_VECTOR_H_
 
 #include "vm/allocation.h"
 #include "vm/isolate.h"
@@ -25,7 +25,7 @@
       ASSERT(target->data_length_ > 0);
       Advance();
     }
-    ~Iterator() { }
+    ~Iterator() {}
 
     bool Done() const { return word_index_ >= target_->data_length_; }
     void Advance();
@@ -118,4 +118,4 @@
 
 }  // namespace dart
 
-#endif  // VM_BIT_VECTOR_H_
+#endif  // RUNTIME_VM_BIT_VECTOR_H_
diff --git a/runtime/vm/bit_vector_test.cc b/runtime/vm/bit_vector_test.cc
index d2b7d1a..bcf0c91 100644
--- a/runtime/vm/bit_vector_test.cc
+++ b/runtime/vm/bit_vector_test.cc
@@ -11,11 +11,13 @@
 #define Z (thread->zone())
 
 TEST_CASE(BitVector) {
-  { BitVector* v = new BitVector(Z, 15);
+  {
+    BitVector* v = new BitVector(Z, 15);
     v->Add(1);
     EXPECT_EQ(true, v->Contains(1));
     EXPECT_EQ(false, v->Contains(0));
-    { BitVector::Iterator iter(v);
+    {
+      BitVector::Iterator iter(v);
       EXPECT_EQ(1, iter.Current());
       iter.Advance();
       EXPECT(iter.Done());
@@ -24,7 +26,8 @@
     v->Add(1);
     EXPECT_EQ(true, v->Contains(0));
     EXPECT_EQ(true, v->Contains(1));
-    { BitVector::Iterator iter(v);
+    {
+      BitVector::Iterator iter(v);
       EXPECT_EQ(0, iter.Current());
       iter.Advance();
       EXPECT_EQ(1, iter.Current());
@@ -33,7 +36,8 @@
     }
   }
 
-  { BitVector* v = new BitVector(Z, 128);
+  {
+    BitVector* v = new BitVector(Z, 128);
     v->Add(49);
     v->Add(62);
     v->Add(63);
@@ -55,7 +59,8 @@
     EXPECT(iter.Done());
   }
 
-  { BitVector* a = new BitVector(Z, 128);
+  {
+    BitVector* a = new BitVector(Z, 128);
     BitVector* b = new BitVector(Z, 128);
     BitVector* c = new BitVector(Z, 128);
     b->Add(0);
@@ -86,7 +91,8 @@
     EXPECT_EQ(false, a->Contains(96));
   }
 
-  { BitVector* a = new BitVector(Z, 34);
+  {
+    BitVector* a = new BitVector(Z, 34);
     BitVector* b = new BitVector(Z, 34);
     a->SetAll();
     b->Add(0);
@@ -97,7 +103,8 @@
     EXPECT_EQ(true, a->Equals(*b));
   }
 
-  { BitVector* a = new BitVector(Z, 2);
+  {
+    BitVector* a = new BitVector(Z, 2);
     BitVector* b = new BitVector(Z, 2);
     a->SetAll();
     a->Remove(0);
@@ -105,7 +112,8 @@
     EXPECT_EQ(true, a->Equals(*b));
   }
 
-  { BitVector* a = new BitVector(Z, 128);
+  {
+    BitVector* a = new BitVector(Z, 128);
     BitVector* b = new BitVector(Z, 128);
     b->Add(0);
     b->Add(32);
diff --git a/runtime/vm/bitfield.h b/runtime/vm/bitfield.h
index 42a121a..e17ffcf 100644
--- a/runtime/vm/bitfield.h
+++ b/runtime/vm/bitfield.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_BITFIELD_H_
-#define VM_BITFIELD_H_
+#ifndef RUNTIME_VM_BITFIELD_H_
+#define RUNTIME_VM_BITFIELD_H_
 
 namespace dart {
 
@@ -11,7 +11,7 @@
 
 // BitField is a template for encoding and decoding a value of type T
 // inside a storage of type S.
-template<typename S, typename T, int position, int size>
+template <typename S, typename T, int position, int size>
 class BitField {
  public:
   static const intptr_t kNextBit = position + size;
@@ -22,26 +22,18 @@
   }
 
   // Returns a S mask of the bit field.
-  static S mask() {
-    return (kUwordOne << size) - 1;
-  }
+  static S mask() { return (kUwordOne << size) - 1; }
 
   // Returns a S mask of the bit field which can be applied directly to
   // to the raw unshifted bits.
-  static S mask_in_place() {
-    return ((kUwordOne << size) - 1) << position;
-  }
+  static S mask_in_place() { return ((kUwordOne << size) - 1) << position; }
 
   // Returns the shift count needed to right-shift the bit field to
   // the least-significant bits.
-  static int shift() {
-    return position;
-  }
+  static int shift() { return position; }
 
   // Returns the size of the bit field.
-  static int bitsize() {
-    return size;
-  }
+  static int bitsize() { return size; }
 
   // Returns an S with the bit field value encoded.
   static S encode(T value) {
@@ -60,11 +52,10 @@
   // will be changed.
   static S update(T value, S original) {
     ASSERT(is_valid(value));
-    return (static_cast<S>(value) << position) |
-        (~mask_in_place() & original);
+    return (static_cast<S>(value) << position) | (~mask_in_place() & original);
   }
 };
 
 }  // namespace dart
 
-#endif  // VM_BITFIELD_H_
+#endif  // RUNTIME_VM_BITFIELD_H_
diff --git a/runtime/vm/bitmap.cc b/runtime/vm/bitmap.cc
index ae091ae..f4d35b4 100644
--- a/runtime/vm/bitmap.cc
+++ b/runtime/vm/bitmap.cc
@@ -54,8 +54,7 @@
       data_size_in_bytes_ =
           Utils::RoundUp(byte_offset + 1, kIncrementSizeInBytes);
       ASSERT(data_size_in_bytes_ > 0);
-      data_ = Thread::Current()->zone()->Alloc<uint8_t>(
-          data_size_in_bytes_);
+      data_ = Thread::Current()->zone()->Alloc<uint8_t>(data_size_in_bytes_);
       ASSERT(data_ != NULL);
       memmove(data_, old_data, old_size);
       memset(&data_[old_size], 0, (data_size_in_bytes_ - old_size));
@@ -98,8 +97,10 @@
 
 void BitmapBuilder::SetBit(intptr_t bit_offset, bool value) {
   if (!InRange(bit_offset)) {
-    FATAL1("Fatal error in BitmapBuilder::SetBit :"
-           " invalid bit_offset, %" Pd "\n", bit_offset);
+    FATAL1(
+        "Fatal error in BitmapBuilder::SetBit :"
+        " invalid bit_offset, %" Pd "\n",
+        bit_offset);
   }
   intptr_t byte_offset = bit_offset >> kBitsPerByteLog2;
   ASSERT(byte_offset < data_size_in_bytes_);
diff --git a/runtime/vm/bitmap.h b/runtime/vm/bitmap.h
index 507167e..657bd24 100644
--- a/runtime/vm/bitmap.h
+++ b/runtime/vm/bitmap.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_BITMAP_H_
-#define VM_BITMAP_H_
+#ifndef RUNTIME_VM_BITMAP_H_
+#define RUNTIME_VM_BITMAP_H_
 
 #include "vm/allocation.h"
 #include "vm/isolate.h"
@@ -24,8 +24,7 @@
   BitmapBuilder()
       : length_(0),
         data_size_in_bytes_(kInitialSizeInBytes),
-        data_(Thread::Current()->zone()->Alloc<uint8_t>(
-            kInitialSizeInBytes)) {
+        data_(Thread::Current()->zone()->Alloc<uint8_t>(kInitialSizeInBytes)) {
     memset(data_, 0, kInitialSizeInBytes);
   }
 
@@ -55,8 +54,10 @@
 
   bool InRange(intptr_t offset) const {
     if (offset < 0) {
-      FATAL1("Fatal error in BitmapBuilder::InRange :"
-             " invalid bit_offset, %" Pd "\n", offset);
+      FATAL1(
+          "Fatal error in BitmapBuilder::InRange :"
+          " invalid bit_offset, %" Pd "\n",
+          offset);
     }
     return (offset < length_);
   }
@@ -77,4 +78,4 @@
 
 }  // namespace dart
 
-#endif  // VM_BITMAP_H_
+#endif  // RUNTIME_VM_BITMAP_H_
diff --git a/runtime/vm/block_scheduler.cc b/runtime/vm/block_scheduler.cc
index d792551..7411fcc 100644
--- a/runtime/vm/block_scheduler.cc
+++ b/runtime/vm/block_scheduler.cc
@@ -40,8 +40,7 @@
   } else {
     GotoInstr* jump = block->last_instruction()->AsGoto();
     if (jump != NULL) {
-      intptr_t count =
-          GetEdgeCount(edge_counters, block->preorder_number());
+      intptr_t count = GetEdgeCount(edge_counters, block->preorder_number());
       if ((count >= 0) && (entry_count != 0)) {
         double weight =
             static_cast<double>(count) / static_cast<double>(entry_count);
@@ -57,12 +56,13 @@
     return;
   }
 
-  const Array& ic_data_array = Array::Handle(flow_graph()->zone(),
-      flow_graph()->parsed_function().function().ic_data_array());
+  const Array& ic_data_array =
+      Array::Handle(flow_graph()->zone(),
+                    flow_graph()->parsed_function().function().ic_data_array());
   if (Compiler::IsBackgroundCompilation() && ic_data_array.IsNull()) {
     // Deferred loading cleared ic_data_array.
-    Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId,
-        "BlockScheduler: ICData array cleared");
+    Compiler::AbortBackgroundCompilation(
+        Thread::kNoDeoptId, "BlockScheduler: ICData array cleared");
   }
   if (ic_data_array.IsNull()) {
     ASSERT(Isolate::Current()->HasAttemptedReload());
@@ -77,8 +77,7 @@
   flow_graph()->graph_entry()->set_entry_count(entry_count);
 
   for (BlockIterator it = flow_graph()->reverse_postorder_iterator();
-       !it.Done();
-       it.Advance()) {
+       !it.Done(); it.Advance()) {
     BlockEntryInstr* block = it.Current();
     Instruction* last = block->last_instruction();
     for (intptr_t i = 0; i < last->SuccessorCount(); ++i) {
@@ -92,7 +91,7 @@
 // A weighted control-flow graph edge.
 struct Edge {
   Edge(BlockEntryInstr* source, BlockEntryInstr* target, double weight)
-      : source(source), target(target), weight(weight) { }
+      : source(source), target(target), weight(weight) {}
 
   static int LowestWeightFirst(const Edge* a, const Edge* b);
 
@@ -104,7 +103,7 @@
 
 // A linked list node in a chain of blocks.
 struct Link : public ZoneAllocated {
-  Link(BlockEntryInstr* block, Link* next) : block(block), next(next) { }
+  Link(BlockEntryInstr* block, Link* next) : block(block), next(next) {}
 
   BlockEntryInstr* block;
   Link* next;
@@ -115,7 +114,7 @@
 // a length to support adding a shorter chain's links to a longer chain.
 struct Chain : public ZoneAllocated {
   explicit Chain(BlockEntryInstr* block)
-      : first(new Link(block, NULL)), last(first), length(1) { }
+      : first(new Link(block, NULL)), last(first), length(1) {}
 
   Link* first;
   Link* last;
@@ -168,8 +167,7 @@
   // shared ones).  Find(n) is simply chains[n].
   GrowableArray<Chain*> chains(block_count);
 
-  for (BlockIterator it = flow_graph()->postorder_iterator();
-       !it.Done();
+  for (BlockIterator it = flow_graph()->postorder_iterator(); !it.Done();
        it.Advance()) {
     BlockEntryInstr* block = it.Current();
     chains.Add(new Chain(block));
diff --git a/runtime/vm/block_scheduler.h b/runtime/vm/block_scheduler.h
index 911bb14..8a5cada 100644
--- a/runtime/vm/block_scheduler.h
+++ b/runtime/vm/block_scheduler.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_BLOCK_SCHEDULER_H_
-#define VM_BLOCK_SCHEDULER_H_
+#ifndef RUNTIME_VM_BLOCK_SCHEDULER_H_
+#define RUNTIME_VM_BLOCK_SCHEDULER_H_
 
 #include "vm/allocation.h"
 
@@ -13,7 +13,7 @@
 
 class BlockScheduler : public ValueObject {
  public:
-  explicit BlockScheduler(FlowGraph* flow_graph) : flow_graph_(flow_graph) { }
+  explicit BlockScheduler(FlowGraph* flow_graph) : flow_graph_(flow_graph) {}
 
   FlowGraph* flow_graph() const { return flow_graph_; }
 
@@ -27,4 +27,4 @@
 
 }  // namespace dart
 
-#endif  // VM_BLOCK_SCHEDULER_H_
+#endif  // RUNTIME_VM_BLOCK_SCHEDULER_H_
diff --git a/runtime/vm/boolfield.h b/runtime/vm/boolfield.h
index 64117f2..fe20f5b 100644
--- a/runtime/vm/boolfield.h
+++ b/runtime/vm/boolfield.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_BOOLFIELD_H_
-#define VM_BOOLFIELD_H_
+#ifndef RUNTIME_VM_BOOLFIELD_H_
+#define RUNTIME_VM_BOOLFIELD_H_
 
 #include "vm/globals.h"
 
@@ -11,7 +11,7 @@
 
 // BoolField is a template for encoding and decoding a bit inside an
 // unsigned machine word.
-template<int position>
+template <int position>
 class BoolField {
  public:
   // Returns a uword with the bool value encoded.
@@ -38,4 +38,4 @@
 
 }  // namespace dart
 
-#endif  // VM_BOOLFIELD_H_
+#endif  // RUNTIME_VM_BOOLFIELD_H_
diff --git a/runtime/vm/bootstrap.cc b/runtime/vm/bootstrap.cc
index ed97340..0dc6e7c 100644
--- a/runtime/vm/bootstrap.cc
+++ b/runtime/vm/bootstrap.cc
@@ -10,24 +10,29 @@
 #include "vm/class_finalizer.h"
 #include "vm/compiler.h"
 #include "vm/dart_api_impl.h"
+#if !defined(DART_PRECOMPILED_RUNTIME)
+#include "vm/kernel.h"
+#include "vm/kernel_reader.h"
+#endif
 #include "vm/object.h"
 #include "vm/object_store.h"
 #include "vm/symbols.h"
 
 namespace dart {
 
-#define INIT_LIBRARY(index, name, source, patch)                               \
-  { index,                                                                     \
-    "dart:"#name, source,                                                      \
-    "dart:"#name"-patch", patch }                                              \
+DEFINE_FLAG(bool,
+            use_corelib_source_files,
+            kDefaultCorelibSourceFlag,
+            "Attempt to use source files directly when loading in the core "
+            "libraries during the bootstrap process");
 
-typedef struct {
-  ObjectStore::BootstrapLibraryId index_;
-  const char* uri_;
-  const char** source_paths_;
-  const char* patch_uri_;
-  const char** patch_paths_;
-} bootstrap_lib_props;
+struct BootstrapLibProps {
+  ObjectStore::BootstrapLibraryId index;
+  const char* uri;
+  const char** source_paths;
+  const char* patch_uri;
+  const char** patch_paths;
+};
 
 
 enum {
@@ -38,81 +43,31 @@
 };
 
 
-static bootstrap_lib_props bootstrap_libraries[] = {
-  INIT_LIBRARY(ObjectStore::kCore,
-               core,
-               Bootstrap::core_source_paths_,
-               Bootstrap::core_patch_paths_),
-  INIT_LIBRARY(ObjectStore::kAsync,
-               async,
-               Bootstrap::async_source_paths_,
-               Bootstrap::async_patch_paths_),
-  INIT_LIBRARY(ObjectStore::kConvert,
-               convert,
-               Bootstrap::convert_source_paths_,
-               Bootstrap::convert_patch_paths_),
-  INIT_LIBRARY(ObjectStore::kCollection,
-               collection,
-               Bootstrap::collection_source_paths_,
-               Bootstrap::collection_patch_paths_),
-  INIT_LIBRARY(ObjectStore::kDeveloper,
-               developer,
-               Bootstrap::developer_source_paths_,
-               Bootstrap::developer_patch_paths_),
-  INIT_LIBRARY(ObjectStore::kInternal,
-               _internal,
-               Bootstrap::_internal_source_paths_,
-               Bootstrap::_internal_patch_paths_),
-  INIT_LIBRARY(ObjectStore::kIsolate,
-               isolate,
-               Bootstrap::isolate_source_paths_,
-               Bootstrap::isolate_patch_paths_),
-  INIT_LIBRARY(ObjectStore::kMath,
-               math,
-               Bootstrap::math_source_paths_,
-               Bootstrap::math_patch_paths_),
-  INIT_LIBRARY(ObjectStore::kMirrors,
-               mirrors,
-               Bootstrap::mirrors_source_paths_,
-               Bootstrap::mirrors_patch_paths_),
-  INIT_LIBRARY(ObjectStore::kProfiler,
-               profiler,
-               Bootstrap::profiler_source_paths_,
-               NULL),
-  INIT_LIBRARY(ObjectStore::kTypedData,
-               typed_data,
-               Bootstrap::typed_data_source_paths_,
-               NULL),
-  INIT_LIBRARY(ObjectStore::kVMService,
-               _vmservice,
-               Bootstrap::_vmservice_source_paths_,
-               Bootstrap::_vmservice_patch_paths_),
-  { ObjectStore::kNone, NULL, NULL, NULL, NULL }
-};
+const char** Bootstrap::profiler_patch_paths_ = NULL;
+const char** Bootstrap::typed_data_patch_paths_ = NULL;
 
 
-static RawString* GetLibrarySource(const Library& lib,
-                                   const String& uri,
-                                   bool patch) {
-  // First check if this is a valid bootstrap library and find it's index
-  // in the 'bootstrap_libraries' table above.
-  intptr_t index;
-  const String& lib_uri = String::Handle(lib.url());
-  for (index = 0;
-       bootstrap_libraries[index].index_ != ObjectStore::kNone;
-       ++index) {
-    if (lib_uri.Equals(bootstrap_libraries[index].uri_)) {
-      break;
-    }
-  }
-  if (bootstrap_libraries[index].index_ == ObjectStore::kNone) {
-    return String::null();  // Library is not a bootstrap library.
-  }
+#define MAKE_PROPERTIES(CamelName, name)                                       \
+  {ObjectStore::k##CamelName, "dart:" #name, Bootstrap::name##_source_paths_,  \
+   "dart:" #name "-patch", Bootstrap::name##_patch_paths_},
+
+static const BootstrapLibProps bootstrap_libraries[] = {
+    FOR_EACH_BOOTSTRAP_LIBRARY(MAKE_PROPERTIES)};
+
+#undef MAKE_PROPERTIES
+
+
+static const intptr_t kBootstrapLibraryCount = ARRAY_SIZE(bootstrap_libraries);
+
+
+static RawString* GetLibrarySourceByIndex(intptr_t index,
+                                          const String& uri,
+                                          bool patch) {
+  ASSERT(index >= 0 && index < kBootstrapLibraryCount);
 
   // Try to read the source using the path specified for the uri.
-  const char** source_paths = patch ?
-      bootstrap_libraries[index].patch_paths_ :
-      bootstrap_libraries[index].source_paths_;
+  const char** source_paths = patch ? bootstrap_libraries[index].patch_paths
+                                    : bootstrap_libraries[index].source_paths;
   if (source_paths == NULL) {
     return String::null();  // No path mapping information exists for library.
   }
@@ -132,15 +87,20 @@
   const uint8_t* utf8_array = NULL;
   intptr_t file_length = -1;
 
-  Dart_FileOpenCallback file_open = Dart::file_open_callback();
-  Dart_FileReadCallback file_read = Dart::file_read_callback();
-  Dart_FileCloseCallback file_close = Dart::file_close_callback();
-  if ((file_open != NULL) && (file_read != NULL) && (file_close != NULL)) {
-    // Try to open and read the file.
-    void* stream = (*file_open)(source_path, false);
-    if (stream != NULL) {
-      (*file_read)(&utf8_array, &file_length, stream);
-      (*file_close)(stream);
+  // If flag to use the core library files directly is specified then try
+  // to read the file and extract it's contents otherwise just use the
+  // source data that has been backed into the binary.
+  if (FLAG_use_corelib_source_files) {
+    Dart_FileOpenCallback file_open = Dart::file_open_callback();
+    Dart_FileReadCallback file_read = Dart::file_read_callback();
+    Dart_FileCloseCallback file_close = Dart::file_close_callback();
+    if ((file_open != NULL) && (file_read != NULL) && (file_close != NULL)) {
+      // Try to open and read the file.
+      void* stream = (*file_open)(source_path, false);
+      if (stream != NULL) {
+        (*file_read)(&utf8_array, &file_length, stream);
+        (*file_close)(stream);
+      }
     }
   }
   if (file_length == -1) {
@@ -157,6 +117,26 @@
 }
 
 
+static RawString* GetLibrarySource(const Library& lib,
+                                   const String& uri,
+                                   bool patch) {
+  // First check if this is a valid bootstrap library and find its index in
+  // the 'bootstrap_libraries' table above.
+  intptr_t index;
+  const String& lib_uri = String::Handle(lib.url());
+  for (index = 0; index < kBootstrapLibraryCount; ++index) {
+    if (lib_uri.Equals(bootstrap_libraries[index].uri)) {
+      break;
+    }
+  }
+  if (index == kBootstrapLibraryCount) {
+    return String::null();  // The library is not a bootstrap library.
+  }
+
+  return GetLibrarySourceByIndex(index, uri, patch);
+}
+
+
 static RawError* Compile(const Library& library, const Script& script) {
   bool update_lib_status = (script.kind() == RawScript::kScriptTag ||
                             script.kind() == RawScript::kLibraryTag);
@@ -181,8 +161,8 @@
                                   const Library& lib,
                                   const String& uri) {
   Zone* zone = thread->zone();
-  const String& part_source = String::Handle(
-      zone, GetLibrarySource(lib, uri, false));
+  const String& part_source =
+      String::Handle(zone, GetLibrarySource(lib, uri, false));
   const String& lib_uri = String::Handle(zone, lib.url());
   if (part_source.IsNull()) {
     return Api::NewError("Unable to read part file '%s' of library '%s'",
@@ -240,10 +220,15 @@
 }
 
 
-static RawError* LoadPatchFiles(Zone* zone,
+static RawError* LoadPatchFiles(Thread* thread,
                                 const Library& lib,
-                                const String& patch_uri,
-                                const char** patch_files) {
+                                intptr_t index) {
+  const char** patch_files = bootstrap_libraries[index].patch_paths;
+  if (patch_files == NULL) return Error::null();
+
+  Zone* zone = thread->zone();
+  String& patch_uri = String::Handle(
+      zone, Symbols::New(thread, bootstrap_libraries[index].patch_uri));
   String& patch_file_uri = String::Handle(zone);
   String& source = String::Handle(zone);
   Script& script = Script::Handle(zone);
@@ -253,7 +238,7 @@
   strings.SetAt(1, Symbols::Slash());
   for (intptr_t j = 0; patch_files[j] != NULL; j += kPathsEntryLength) {
     patch_file_uri = String::New(patch_files[j + kPathsUriOffset]);
-    source = GetLibrarySource(lib, patch_file_uri, true);
+    source = GetLibrarySourceByIndex(index, patch_file_uri, true);
     if (source.IsNull()) {
       const String& message = String::Handle(
           String::NewFormatted("Unable to find dart patch source for %s",
@@ -273,61 +258,49 @@
 }
 
 
-RawError* Bootstrap::LoadandCompileScripts() {
-  Thread* thread = Thread::Current();
+static void Finish(Thread* thread, bool from_kernel) {
+  Bootstrap::SetupNativeResolver();
+  if (!ClassFinalizer::ProcessPendingClasses(from_kernel)) {
+    FATAL("Error in class finalization during bootstrapping.");
+  }
+
+  // Eagerly compile the _Closure class as it is the class of all closure
+  // instances. This allows us to just finalize function types without going
+  // through the hoops of trying to compile their scope class.
+  ObjectStore* object_store = thread->isolate()->object_store();
+  Class& cls = Class::Handle(thread->zone(), object_store->closure_class());
+  Compiler::CompileClass(cls);
+  // Eagerly compile Bool class, bool constants are used from within compiler.
+  cls = object_store->bool_class();
+  Compiler::CompileClass(cls);
+}
+
+
+static RawError* BootstrapFromSource(Thread* thread) {
   Isolate* isolate = thread->isolate();
   Zone* zone = thread->zone();
   String& uri = String::Handle(zone);
-  String& patch_uri = String::Handle(zone);
   String& source = String::Handle(zone);
   Script& script = Script::Handle(zone);
   Library& lib = Library::Handle(zone);
   Error& error = Error::Handle(zone);
-  Dart_LibraryTagHandler saved_tag_handler = isolate->library_tag_handler();
 
   // Set the library tag handler for the isolate to the bootstrap
   // library tag handler so that we can load all the bootstrap libraries.
+  Dart_LibraryTagHandler saved_tag_handler = isolate->library_tag_handler();
   isolate->set_library_tag_handler(BootstrapLibraryTagHandler);
 
-  HANDLESCOPE(thread);
-
-  // Create library objects for all the bootstrap libraries.
-  for (intptr_t i = 0;
-       bootstrap_libraries[i].index_ != ObjectStore::kNone;
-       ++i) {
-#ifdef PRODUCT
-    if (bootstrap_libraries[i].index_ == ObjectStore::kMirrors) {
-      continue;
-    }
-#endif  // !PRODUCT
-    uri = Symbols::New(thread, bootstrap_libraries[i].uri_);
-    lib = Library::LookupLibrary(thread, uri);
-    if (lib.IsNull()) {
-      lib = Library::NewLibraryHelper(uri, false);
-      lib.SetLoadRequested();
-      lib.Register(thread);
-    }
-    isolate->object_store()->set_bootstrap_library(
-        bootstrap_libraries[i].index_, lib);
-  }
-
   // Load, compile and patch bootstrap libraries.
-  for (intptr_t i = 0;
-       bootstrap_libraries[i].index_ != ObjectStore::kNone;
-       ++i) {
-#ifdef PRODUCT
-    if (bootstrap_libraries[i].index_ == ObjectStore::kMirrors) {
-      continue;
-    }
-#endif  // PRODUCT
-    uri = Symbols::New(thread, bootstrap_libraries[i].uri_);
-    lib = Library::LookupLibrary(thread, uri);
+  for (intptr_t i = 0; i < kBootstrapLibraryCount; ++i) {
+    ObjectStore::BootstrapLibraryId id = bootstrap_libraries[i].index;
+    uri = Symbols::New(thread, bootstrap_libraries[i].uri);
+    lib = isolate->object_store()->bootstrap_library(id);
     ASSERT(!lib.IsNull());
-    source = GetLibrarySource(lib, uri, false);
+    ASSERT(lib.raw() == Library::LookupLibrary(thread, uri));
+    source = GetLibrarySourceByIndex(i, uri, false);
     if (source.IsNull()) {
-      const String& message = String::Handle(
-          String::NewFormatted("Unable to find dart source for %s",
-                               uri.ToCString()));
+      const String& message = String::Handle(String::NewFormatted(
+          "Unable to find dart source for %s", uri.ToCString()));
       error ^= ApiError::New(message);
       break;
     }
@@ -337,36 +310,93 @@
       break;
     }
     // If a patch exists, load and patch the script.
-    if (bootstrap_libraries[i].patch_paths_ != NULL) {
-      patch_uri = Symbols::New(thread, bootstrap_libraries[i].patch_uri_);
-      error = LoadPatchFiles(zone,
-                             lib,
-                             patch_uri,
-                             bootstrap_libraries[i].patch_paths_);
-      if (!error.IsNull()) {
-        break;
-      }
+    error = LoadPatchFiles(thread, lib, i);
+    if (!error.IsNull()) {
+      break;
     }
   }
+
   if (error.IsNull()) {
-    SetupNativeResolver();
-    ClassFinalizer::ProcessPendingClasses();
-
-    // Eagerly compile the _Closure class as it is the class of all closure
-    // instances. This allows us to just finalize function types
-    // without going through the hoops of trying to compile their scope class.
-    Class& cls =
-        Class::Handle(zone, isolate->object_store()->closure_class());
-    Compiler::CompileClass(cls);
-    // Eagerly compile Bool class, bool constants are used from within compiler.
-    cls = isolate->object_store()->bool_class();
-    Compiler::CompileClass(cls);
+    Finish(thread, /*from_kernel=*/false);
   }
-
   // Restore the library tag handler for the isolate.
   isolate->set_library_tag_handler(saved_tag_handler);
 
   return error.raw();
 }
 
+
+#if !defined(DART_PRECOMPILED_RUNTIME)
+static RawError* BootstrapFromKernel(Thread* thread, kernel::Program* program) {
+  Zone* zone = thread->zone();
+  kernel::KernelReader reader(program);
+
+  Isolate* isolate = thread->isolate();
+  // Mark the already-pending classes.  This mark bit will be used to avoid
+  // adding classes to the list more than once.
+  GrowableObjectArray& pending_classes = GrowableObjectArray::Handle(
+      zone, isolate->object_store()->pending_classes());
+  dart::Class& pending = dart::Class::Handle(zone);
+  for (intptr_t i = 0; i < pending_classes.Length(); ++i) {
+    pending ^= pending_classes.At(i);
+    pending.set_is_marked_for_parsing();
+  }
+
+  Library& library = Library::Handle(zone);
+  String& dart_name = String::Handle(zone);
+  String& kernel_name = String::Handle(zone);
+  for (intptr_t i = 0; i < kBootstrapLibraryCount; ++i) {
+    ObjectStore::BootstrapLibraryId id = bootstrap_libraries[i].index;
+    library = isolate->object_store()->bootstrap_library(id);
+    dart_name = library.url();
+    for (intptr_t j = 0; j < program->libraries().length(); ++j) {
+      kernel::Library* kernel_library = program->libraries()[j];
+      kernel::String* uri = kernel_library->import_uri();
+      kernel_name = Symbols::FromUTF8(thread, uri->buffer(), uri->size());
+      if (kernel_name.Equals(dart_name)) {
+        reader.ReadLibrary(kernel_library);
+        library.SetLoaded();
+        break;
+      }
+    }
+  }
+
+  Finish(thread, /*from_kernel=*/true);
+  return Error::null();
+}
+#else
+static RawError* BootstrapFromKernel(Thread* thread, kernel::Program* program) {
+  UNREACHABLE();
+  return Error::null();
+}
+#endif
+
+
+RawError* Bootstrap::DoBootstrapping(kernel::Program* kernel_program) {
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
+  Zone* zone = thread->zone();
+  String& uri = String::Handle(zone);
+  Library& lib = Library::Handle(zone);
+
+  HANDLESCOPE(thread);
+
+  // Ensure there are library objects for all the bootstrap libraries.
+  for (intptr_t i = 0; i < kBootstrapLibraryCount; ++i) {
+    ObjectStore::BootstrapLibraryId id = bootstrap_libraries[i].index;
+    uri = Symbols::New(thread, bootstrap_libraries[i].uri);
+    lib = isolate->object_store()->bootstrap_library(id);
+    ASSERT(lib.raw() == Library::LookupLibrary(thread, uri));
+    if (lib.IsNull()) {
+      lib = Library::NewLibraryHelper(uri, false);
+      lib.SetLoadRequested();
+      lib.Register(thread);
+      isolate->object_store()->set_bootstrap_library(id, lib);
+    }
+  }
+
+  return (kernel_program == NULL) ? BootstrapFromSource(thread)
+                                  : BootstrapFromKernel(thread, kernel_program);
+}
+
 }  // namespace dart
diff --git a/runtime/vm/bootstrap.h b/runtime/vm/bootstrap.h
index eb238ed..15f454b 100644
--- a/runtime/vm/bootstrap.h
+++ b/runtime/vm/bootstrap.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_BOOTSTRAP_H_
-#define VM_BOOTSTRAP_H_
+#ifndef RUNTIME_VM_BOOTSTRAP_H_
+#define RUNTIME_VM_BOOTSTRAP_H_
 
 #include "include/dart_api.h"
 #include "vm/allocation.h"
@@ -12,10 +12,20 @@
 
 // Forward declarations.
 class RawError;
+namespace kernel {
+class Program;
+}
 
 class Bootstrap : public AllStatic {
  public:
-  static RawError* LoadandCompileScripts();
+  // Compile the bootstrap libraries, either from sources or a Kernel program.
+  // If program is NULL, compile from sources or source paths linked into
+  // the VM.  If it is non-NULL it represents the Kernel program to use for
+  // bootstrapping.
+  // The caller of this function is responsible for managing the kernel
+  // program's memory.
+  static RawError* DoBootstrapping(kernel::Program* program);
+
   static void SetupNativeResolver();
   static bool IsBootstapResolver(Dart_NativeEntryResolver resolver);
 
@@ -45,11 +55,13 @@
   static const char* isolate_patch_paths_[];
   static const char* math_patch_paths_[];
   static const char* mirrors_patch_paths_[];
-  static const char* profiler_patch_paths_[];
-  static const char* typed_data_patch_paths_[];
   static const char* _vmservice_patch_paths_[];
+
+  // NULL patch paths for libraries that do not have patch files.
+  static const char** profiler_patch_paths_;
+  static const char** typed_data_patch_paths_;
 };
 
 }  // namespace dart
 
-#endif  // VM_BOOTSTRAP_H_
+#endif  // RUNTIME_VM_BOOTSTRAP_H_
diff --git a/runtime/vm/bootstrap_natives.cc b/runtime/vm/bootstrap_natives.cc
index 7e1ea34..ef4b92f 100644
--- a/runtime/vm/bootstrap_natives.cc
+++ b/runtime/vm/bootstrap_natives.cc
@@ -16,7 +16,7 @@
 
 // Helper macros for declaring and defining native entries.
 #define REGISTER_NATIVE_ENTRY(name, count)                                     \
-  { ""#name, BootstrapNatives::DN_##name, count },
+  {"" #name, BootstrapNatives::DN_##name, count},
 
 
 // List all native functions implemented in the vm or core bootstrap dart
@@ -26,10 +26,9 @@
   const char* name_;
   Dart_NativeFunction function_;
   int argument_count_;
-} BootStrapEntries[] = {
-  BOOTSTRAP_NATIVE_LIST(REGISTER_NATIVE_ENTRY)
+} BootStrapEntries[] = {BOOTSTRAP_NATIVE_LIST(REGISTER_NATIVE_ENTRY)
 #ifndef PRODUCT
-  MIRRORS_BOOTSTRAP_NATIVE_LIST(REGISTER_NATIVE_ENTRY)
+                            MIRRORS_BOOTSTRAP_NATIVE_LIST(REGISTER_NATIVE_ENTRY)
 #endif  // !PRODUCT
 };
 
@@ -76,8 +75,7 @@
       reinterpret_cast<Dart_NativeEntryResolver>(BootstrapNatives::Lookup);
 
   Dart_NativeEntrySymbol symbol_resolver =
-      reinterpret_cast<Dart_NativeEntrySymbol>(
-          BootstrapNatives::Symbol);
+      reinterpret_cast<Dart_NativeEntrySymbol>(BootstrapNatives::Symbol);
 
   library = Library::AsyncLibrary();
   ASSERT(!library.IsNull());
@@ -119,11 +117,12 @@
   library.set_native_entry_resolver(resolver);
   library.set_native_entry_symbol_resolver(symbol_resolver);
 
-NOT_IN_PRODUCT(
+#if !defined(PRODUCT)
   library = Library::MirrorsLibrary();
   ASSERT(!library.IsNull());
   library.set_native_entry_resolver(resolver);
-  library.set_native_entry_symbol_resolver(symbol_resolver));
+  library.set_native_entry_symbol_resolver(symbol_resolver);
+#endif  // !defined(PRODUCT)
 
   library = Library::ProfilerLibrary();
   ASSERT(!library.IsNull());
diff --git a/runtime/vm/bootstrap_natives.h b/runtime/vm/bootstrap_natives.h
index d7cb2b2..2086186 100644
--- a/runtime/vm/bootstrap_natives.h
+++ b/runtime/vm/bootstrap_natives.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_BOOTSTRAP_NATIVES_H_
-#define VM_BOOTSTRAP_NATIVES_H_
+#ifndef RUNTIME_VM_BOOTSTRAP_NATIVES_H_
+#define RUNTIME_VM_BOOTSTRAP_NATIVES_H_
 
 #include "vm/native_entry.h"
 
@@ -20,6 +20,7 @@
   V(Object_toString, 1)                                                        \
   V(Object_noSuchMethod, 6)                                                    \
   V(Object_runtimeType, 1)                                                     \
+  V(Object_haveSameRuntimeType, 2)                                             \
   V(Object_instanceOf, 4)                                                      \
   V(Object_simpleInstanceOf, 2)                                                \
   V(Object_instanceOfNum, 2)                                                   \
@@ -70,11 +71,16 @@
   V(Bigint_getDigits, 1)                                                       \
   V(Bigint_allocate, 4)                                                        \
   V(Developer_debugger, 2)                                                     \
+  V(Developer_getIsolateIDFromSendPort, 1)                                     \
+  V(Developer_getServerInfo, 1)                                                \
+  V(Developer_getServiceMajorVersion, 0)                                       \
+  V(Developer_getServiceMinorVersion, 0)                                       \
   V(Developer_inspect, 1)                                                      \
   V(Developer_lookupExtension, 1)                                              \
   V(Developer_registerExtension, 2)                                            \
   V(Developer_log, 8)                                                          \
   V(Developer_postEvent, 2)                                                    \
+  V(Developer_webServerControl, 2)                                             \
   V(Double_getIsNegative, 1)                                                   \
   V(Double_getIsInfinite, 1)                                                   \
   V(Double_getIsNaN, 1)                                                        \
@@ -107,6 +113,7 @@
   V(RegExp_getIsCaseSensitive, 1)                                              \
   V(RegExp_getGroupCount, 1)                                                   \
   V(RegExp_ExecuteMatch, 3)                                                    \
+  V(RegExp_ExecuteMatchSticky, 3)                                              \
   V(List_allocate, 2)                                                          \
   V(List_getIndexed, 2)                                                        \
   V(List_setIndexed, 3)                                                        \
@@ -341,6 +348,7 @@
   V(UserTag_makeCurrent, 1)                                                    \
   V(Profiler_getCurrentTag, 0)                                                 \
   V(ClassID_getID, 1)                                                          \
+  V(ClassID_byName, 1)                                                         \
   V(VMService_SendIsolateServiceMessage, 2)                                    \
   V(VMService_SendRootServiceMessage, 1)                                       \
   V(VMService_SendObjectRootServiceMessage, 1)                                 \
@@ -351,7 +359,7 @@
   V(VMService_CancelStream, 1)                                                 \
   V(VMService_RequestAssets, 0)                                                \
   V(VMService_DecodeAssets, 1)                                                 \
-  V(VMService_spawnUriNotify, 2)                                               \
+  V(VMService_spawnUriNotify, 2)
 
 // List of bootstrap native entry points used in the dart:mirror library.
 #define MIRRORS_BOOTSTRAP_NATIVE_LIST(V)                                       \
@@ -403,7 +411,7 @@
   V(ParameterMirror_type, 3)                                                   \
   V(TypedefMirror_referent, 1)                                                 \
   V(TypedefMirror_declaration, 1)                                              \
-  V(VariableMirror_type, 2)                                                    \
+  V(VariableMirror_type, 2)
 
 class BootstrapNatives : public AllStatic {
  public:
@@ -426,4 +434,4 @@
 
 }  // namespace dart
 
-#endif  // VM_BOOTSTRAP_NATIVES_H_
+#endif  // RUNTIME_VM_BOOTSTRAP_NATIVES_H_
diff --git a/runtime/vm/bootstrap_nocore.cc b/runtime/vm/bootstrap_nocore.cc
index d2aa1e3..74367a1 100644
--- a/runtime/vm/bootstrap_nocore.cc
+++ b/runtime/vm/bootstrap_nocore.cc
@@ -6,14 +6,123 @@
 
 #include "include/dart_api.h"
 
+#if !defined(DART_PRECOMPILED_RUNTIME)
+#include "vm/class_finalizer.h"
+#include "vm/compiler.h"
+#include "vm/kernel_reader.h"
+#endif
 #include "vm/object.h"
+#if !defined(DART_PRECOMPILED_RUNTIME)
+#include "vm/object_store.h"
+#endif
 
 namespace dart {
 
+#if !defined(DART_PRECOMPILED_RUNTIME)
+#define MAKE_PROPERTIES(CamelName, name)                                       \
+  {ObjectStore::k##CamelName, "dart:" #name},
 
-RawError* Bootstrap::LoadandCompileScripts() {
+
+struct BootstrapLibProps {
+  ObjectStore::BootstrapLibraryId index;
+  const char* uri;
+};
+
+
+static BootstrapLibProps bootstrap_libraries[] = {
+    FOR_EACH_BOOTSTRAP_LIBRARY(MAKE_PROPERTIES)};
+
+
+#undef MAKE_PROPERTIES
+
+
+static const intptr_t bootstrap_library_count = ARRAY_SIZE(bootstrap_libraries);
+
+
+void Finish(Thread* thread, bool from_kernel) {
+  Bootstrap::SetupNativeResolver();
+  ClassFinalizer::ProcessPendingClasses(from_kernel);
+
+  // Eagerly compile the _Closure class as it is the class of all closure
+  // instances. This allows us to just finalize function types without going
+  // through the hoops of trying to compile their scope class.
+  ObjectStore* object_store = thread->isolate()->object_store();
+  Class& cls = Class::Handle(thread->zone(), object_store->closure_class());
+  Compiler::CompileClass(cls);
+  // Eagerly compile Bool class, bool constants are used from within compiler.
+  cls = object_store->bool_class();
+  Compiler::CompileClass(cls);
+}
+
+
+RawError* BootstrapFromKernel(Thread* thread, kernel::Program* program) {
+  Zone* zone = thread->zone();
+  kernel::KernelReader reader(program);
+  Isolate* isolate = thread->isolate();
+  // Mark the already-pending classes.  This mark bit will be used to avoid
+  // adding classes to the list more than once.
+  GrowableObjectArray& pending_classes = GrowableObjectArray::Handle(
+      zone, isolate->object_store()->pending_classes());
+  dart::Class& pending = dart::Class::Handle(zone);
+  for (intptr_t i = 0; i < pending_classes.Length(); ++i) {
+    pending ^= pending_classes.At(i);
+    pending.set_is_marked_for_parsing();
+  }
+
+  Library& library = Library::Handle(zone);
+  String& dart_name = String::Handle(zone);
+  String& kernel_name = String::Handle(zone);
+  for (intptr_t i = 0; i < bootstrap_library_count; ++i) {
+    ObjectStore::BootstrapLibraryId id = bootstrap_libraries[i].index;
+    library = isolate->object_store()->bootstrap_library(id);
+    dart_name = library.url();
+    for (intptr_t j = 0; j < program->libraries().length(); ++j) {
+      kernel::Library* kernel_library = program->libraries()[j];
+      kernel::String* uri = kernel_library->import_uri();
+      kernel_name = Symbols::FromUTF8(thread, uri->buffer(), uri->size());
+      if (kernel_name.Equals(dart_name)) {
+        reader.ReadLibrary(kernel_library);
+        library.SetLoaded();
+        break;
+      }
+    }
+  }
+
+  Finish(thread, /*from_kernel=*/true);
+  return Error::null();
+}
+
+
+RawError* Bootstrap::DoBootstrapping(kernel::Program* program) {
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
+  Zone* zone = thread->zone();
+  String& uri = String::Handle(zone);
+  Library& lib = Library::Handle(zone);
+
+  HANDLESCOPE(thread);
+
+  // Ensure there are library objects for all the bootstrap libraries.
+  for (intptr_t i = 0; i < bootstrap_library_count; ++i) {
+    ObjectStore::BootstrapLibraryId id = bootstrap_libraries[i].index;
+    uri = Symbols::New(thread, bootstrap_libraries[i].uri);
+    lib = isolate->object_store()->bootstrap_library(id);
+    ASSERT(lib.raw() == Library::LookupLibrary(thread, uri));
+    if (lib.IsNull()) {
+      lib = Library::NewLibraryHelper(uri, false);
+      lib.SetLoadRequested();
+      lib.Register(thread);
+      isolate->object_store()->set_bootstrap_library(id, lib);
+    }
+  }
+
+  return BootstrapFromKernel(thread, program);
+}
+#else
+RawError* Bootstrap::DoBootstrapping(kernel::Program* program) {
   UNREACHABLE();
   return Error::null();
 }
+#endif  // !defined(DART_PRECOMPILED_RUNTIME)
 
 }  // namespace dart
diff --git a/runtime/vm/branch_optimizer.cc b/runtime/vm/branch_optimizer.cc
index b34baf7..62fdb47 100644
--- a/runtime/vm/branch_optimizer.cc
+++ b/runtime/vm/branch_optimizer.cc
@@ -18,8 +18,7 @@
   }
 
   BlockEntryInstr* block = phi->block();
-  for (Value* env_use = phi->env_use_list();
-       env_use != NULL;
+  for (Value* env_use = phi->env_use_list(); env_use != NULL;
        env_use = env_use->next_use()) {
     if ((env_use->instruction() != block) &&
         (env_use->instruction() != use->instruction())) {
@@ -44,17 +43,20 @@
   BranchInstr* branch = block->last_instruction()->AsBranch();
   ASSERT(branch != NULL);
   ComparisonInstr* comparison = branch->comparison();
+  if (comparison->InputCount() != 2) {
+    return false;
+  }
+  if (comparison->CanDeoptimize() || comparison->MayThrow()) {
+    return false;
+  }
   Value* left = comparison->left();
   PhiInstr* phi = left->definition()->AsPhi();
   Value* right = comparison->right();
   ConstantInstr* constant =
       (right == NULL) ? NULL : right->definition()->AsConstant();
-  return (phi != NULL) &&
-      (constant != NULL) &&
-      (phi->GetBlock() == block) &&
-      PhiHasSingleUse(phi, left) &&
-      (block->next() == branch) &&
-      (block->phis()->length() == 1);
+  return (phi != NULL) && (constant != NULL) && (phi->GetBlock() == block) &&
+         PhiHasSingleUse(phi, left) && (block->next() == branch) &&
+         (block->phis()->length() == 1);
 }
 
 
@@ -64,7 +66,7 @@
   // so the former true and false targets become joins of the control flows
   // from all the duplicated branches.
   JoinEntryInstr* join =
-      new(zone) JoinEntryInstr(target->block_id(), target->try_index());
+      new (zone) JoinEntryInstr(target->block_id(), target->try_index());
   join->InheritDeoptTarget(zone, target);
   join->LinkTo(target->next());
   join->set_last_instruction(target->last_instruction());
@@ -80,7 +82,7 @@
   ComparisonInstr* comparison = branch->comparison();
   ComparisonInstr* new_comparison =
       comparison->CopyWithNewOperands(new_left, new_right);
-  BranchInstr* new_branch = new(zone) BranchInstr(new_comparison);
+  BranchInstr* new_branch = new (zone) BranchInstr(new_comparison);
   new_branch->set_is_checked(branch->is_checked());
   return new_branch;
 }
@@ -128,10 +130,8 @@
       // worklist.
       BranchInstr* branch = block->last_instruction()->AsBranch();
       ASSERT(branch != NULL);
-      JoinEntryInstr* join_true =
-          ToJoinEntry(zone, branch->true_successor());
-      JoinEntryInstr* join_false =
-          ToJoinEntry(zone, branch->false_successor());
+      JoinEntryInstr* join_true = ToJoinEntry(zone, branch->true_successor());
+      JoinEntryInstr* join_false = ToJoinEntry(zone, branch->false_successor());
 
       ComparisonInstr* comparison = branch->comparison();
       PhiInstr* phi = comparison->left()->definition()->AsPhi();
@@ -146,7 +146,7 @@
         // Replace the goto in each predecessor with a rewritten branch,
         // rewritten to use the corresponding phi input instead of the phi.
         Value* new_left = phi->InputAt(i)->Copy(zone);
-        Value* new_right = new(zone) Value(constant);
+        Value* new_right = new (zone) Value(constant);
         BranchInstr* new_branch =
             CloneBranch(zone, branch, new_left, new_right);
         if (branch->env() == NULL) {
@@ -160,8 +160,7 @@
           new_branch->comparison()->SetDeoptId(*comparison);
           // The phi can be used in the branch's environment.  Rename such
           // uses.
-          for (Environment::DeepIterator it(new_branch->env());
-               !it.Done();
+          for (Environment::DeepIterator it(new_branch->env()); !it.Done();
                it.Advance()) {
             Value* use = it.CurrentValue();
             if (use->definition() == phi) {
@@ -185,22 +184,20 @@
 
         // Connect the branch to the true and false joins, via empty target
         // blocks.
-        TargetEntryInstr* true_target =
-            new(zone) TargetEntryInstr(flow_graph->max_block_id() + 1,
-                                          block->try_index());
+        TargetEntryInstr* true_target = new (zone) TargetEntryInstr(
+            flow_graph->max_block_id() + 1, block->try_index());
         true_target->InheritDeoptTarget(zone, join_true);
-        TargetEntryInstr* false_target =
-            new(zone) TargetEntryInstr(flow_graph->max_block_id() + 2,
-                                          block->try_index());
+        TargetEntryInstr* false_target = new (zone) TargetEntryInstr(
+            flow_graph->max_block_id() + 2, block->try_index());
         false_target->InheritDeoptTarget(zone, join_false);
         flow_graph->set_max_block_id(flow_graph->max_block_id() + 2);
         *new_branch->true_successor_address() = true_target;
         *new_branch->false_successor_address() = false_target;
-        GotoInstr* goto_true = new(zone) GotoInstr(join_true);
+        GotoInstr* goto_true = new (zone) GotoInstr(join_true);
         goto_true->InheritDeoptTarget(zone, join_true);
         true_target->LinkTo(goto_true);
         true_target->set_last_instruction(goto_true);
-        GotoInstr* goto_false = new(zone) GotoInstr(join_false);
+        GotoInstr* goto_false = new (zone) GotoInstr(join_false);
         goto_false->InheritDeoptTarget(zone, join_false);
         false_target->LinkTo(goto_false);
         false_target->set_last_instruction(goto_false);
@@ -225,8 +222,9 @@
 
 static bool IsTrivialBlock(BlockEntryInstr* block, Definition* defn) {
   return (block->IsTargetEntry() && (block->PredecessorCount() == 1)) &&
-    ((block->next() == block->last_instruction()) ||
-     ((block->next() == defn) && (defn->next() == block->last_instruction())));
+         ((block->next() == block->last_instruction()) ||
+          ((block->next() == defn) &&
+           (defn->next() == block->last_instruction())));
 }
 
 
@@ -273,10 +271,8 @@
     // Ba:
     //   v3 = IfThenElse(COMP ? v1 : v2)
     //
-    if ((join != NULL) &&
-        (join->phis() != NULL) &&
-        (join->phis()->length() == 1) &&
-        (block->PredecessorCount() == 2)) {
+    if ((join != NULL) && (join->phis() != NULL) &&
+        (join->phis()->length() == 1) && (block->PredecessorCount() == 2)) {
       BlockEntryInstr* pred1 = block->PredecessorAt(0);
       BlockEntryInstr* pred2 = block->PredecessorAt(1);
 
@@ -298,17 +294,11 @@
           Value* if_true = (pred1 == branch->true_successor()) ? v1 : v2;
           Value* if_false = (pred2 == branch->true_successor()) ? v1 : v2;
 
-          ComparisonInstr* new_comparison =
-              comparison->CopyWithNewOperands(
-                  comparison->left()->Copy(zone),
-                  comparison->right()->Copy(zone));
-          IfThenElseInstr* if_then_else = new(zone) IfThenElseInstr(
-              new_comparison,
-              if_true->Copy(zone),
-              if_false->Copy(zone));
-          flow_graph->InsertBefore(branch,
-                                   if_then_else,
-                                   NULL,
+          ComparisonInstr* new_comparison = comparison->CopyWithNewOperands(
+              comparison->left()->Copy(zone), comparison->right()->Copy(zone));
+          IfThenElseInstr* if_then_else = new (zone) IfThenElseInstr(
+              new_comparison, if_true->Copy(zone), if_false->Copy(zone));
+          flow_graph->InsertBefore(branch, if_then_else, NULL,
                                    FlowGraph::kValue);
 
           phi->ReplaceUsesWith(if_then_else);
diff --git a/runtime/vm/branch_optimizer.h b/runtime/vm/branch_optimizer.h
index 2e2b135..5758a7c 100644
--- a/runtime/vm/branch_optimizer.h
+++ b/runtime/vm/branch_optimizer.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_BRANCH_OPTIMIZER_H_
-#define VM_BRANCH_OPTIMIZER_H_
+#ifndef RUNTIME_VM_BRANCH_OPTIMIZER_H_
+#define RUNTIME_VM_BRANCH_OPTIMIZER_H_
 
 #include "vm/allocation.h"
 
@@ -26,8 +26,7 @@
   // Replace a target entry instruction with a join entry instruction.  Does
   // not update the original target's predecessors to point to the new block
   // and does not replace the target in already computed block order lists.
-  static JoinEntryInstr* ToJoinEntry(Zone* zone,
-                                     TargetEntryInstr* target);
+  static JoinEntryInstr* ToJoinEntry(Zone* zone, TargetEntryInstr* target);
 
  private:
   // Match an instance of the pattern to rewrite.  See the implementation
@@ -53,4 +52,4 @@
 
 }  // namespace dart
 
-#endif  // VM_BRANCH_OPTIMIZER_H_
+#endif  // RUNTIME_VM_BRANCH_OPTIMIZER_H_
diff --git a/runtime/vm/cha.cc b/runtime/vm/cha.cc
index 6a0a16d..83a2bc5 100644
--- a/runtime/vm/cha.cc
+++ b/runtime/vm/cha.cc
@@ -18,10 +18,8 @@
       return;
     }
   }
-  GuardedClassInfo info = {
-    &Class::ZoneHandle(thread_->zone(), cls.raw()),
-    subclass_count
-  };
+  GuardedClassInfo info = {&Class::ZoneHandle(thread_->zone(), cls.raw()),
+                           subclass_count};
   guarded_classes_.Add(info);
   return;
 }
@@ -62,7 +60,7 @@
 
 
 bool CHA::ConcreteSubclasses(const Class& cls,
-                             GrowableArray<intptr_t> *class_ids) {
+                             GrowableArray<intptr_t>* class_ids) {
   if (cls.InVMHeap()) return false;
   if (cls.IsObjectClass()) return false;
 
@@ -161,7 +159,7 @@
     }
 
     if (direct_subclass.LookupDynamicFunction(function_name) !=
-            Function::null()) {
+        Function::null()) {
       return true;
     }
 
diff --git a/runtime/vm/cha.h b/runtime/vm/cha.h
index 7aa7774..63072d2 100644
--- a/runtime/vm/cha.h
+++ b/runtime/vm/cha.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_CHA_H_
-#define VM_CHA_H_
+#ifndef RUNTIME_VM_CHA_H_
+#define RUNTIME_VM_CHA_H_
 
 #include "vm/allocation.h"
 #include "vm/growable_array.h"
@@ -13,7 +13,8 @@
 
 class Class;
 class Function;
-template <typename T> class ZoneGrowableArray;
+template <typename T>
+class ZoneGrowableArray;
 class String;
 
 class CHA : public StackResource {
@@ -38,7 +39,7 @@
   // Collect the concrete subclasses of 'cls' into 'class_ids'. Return true if
   // the result is valid (may be invalid because we don't track the subclasses
   // of classes allocated in the VM isolate or class Object).
-  bool ConcreteSubclasses(const Class& cls, GrowableArray<intptr_t> *class_ids);
+  bool ConcreteSubclasses(const Class& cls, GrowableArray<intptr_t>* class_ids);
 
   // Return true if the class is implemented by some other class.
   static bool IsImplemented(const Class& cls);
@@ -85,4 +86,4 @@
 
 }  // namespace dart
 
-#endif  // VM_CHA_H_
+#endif  // RUNTIME_VM_CHA_H_
diff --git a/runtime/vm/cha_test.cc b/runtime/vm/cha_test.cc
index 107c233..873840c 100644
--- a/runtime/vm/cha_test.cc
+++ b/runtime/vm/cha_test.cc
@@ -34,20 +34,20 @@
   const Library& lib = Library::Handle(Library::LookupLibrary(thread, name));
   EXPECT(!lib.IsNull());
 
-  const Class& class_a = Class::Handle(
-      lib.LookupClass(String::Handle(Symbols::New(thread, "A"))));
+  const Class& class_a =
+      Class::Handle(lib.LookupClass(String::Handle(Symbols::New(thread, "A"))));
   EXPECT(!class_a.IsNull());
 
-  const Class& class_b = Class::Handle(
-      lib.LookupClass(String::Handle(Symbols::New(thread, "B"))));
+  const Class& class_b =
+      Class::Handle(lib.LookupClass(String::Handle(Symbols::New(thread, "B"))));
   EXPECT(!class_b.IsNull());
 
-  const Class& class_c = Class::Handle(
-      lib.LookupClass(String::Handle(Symbols::New(thread, "C"))));
+  const Class& class_c =
+      Class::Handle(lib.LookupClass(String::Handle(Symbols::New(thread, "C"))));
   EXPECT(!class_c.IsNull());
 
-  const Class& class_d = Class::Handle(
-      lib.LookupClass(String::Handle(Symbols::New(thread, "D"))));
+  const Class& class_d =
+      Class::Handle(lib.LookupClass(String::Handle(Symbols::New(thread, "D"))));
   EXPECT(!class_d.IsNull());
 
   const String& function_foo_name = String::Handle(String::New("foo"));
diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc
index 8d9c266..f13d562 100644
--- a/runtime/vm/class_finalizer.cc
+++ b/runtime/vm/class_finalizer.cc
@@ -78,7 +78,8 @@
 // Use array instead of set since we expect very few subclassed classes
 // to occur.
 static void CollectFinalizedSuperClasses(
-    const Class& cls_, GrowableArray<intptr_t>* finalized_super_classes) {
+    const Class& cls_,
+    GrowableArray<intptr_t>* finalized_super_classes) {
   Class& cls = Class::Handle(cls_.raw());
   AbstractType& super_type = Type::Handle();
   super_type = cls.super_type();
@@ -93,8 +94,8 @@
 }
 
 
-static void CollectImmediateSuperInterfaces(
-    const Class& cls, GrowableArray<intptr_t>* cids) {
+static void CollectImmediateSuperInterfaces(const Class& cls,
+                                            GrowableArray<intptr_t>* cids) {
   const Array& interfaces = Array::Handle(cls.interfaces());
   Class& ifc = Class::Handle();
   AbstractType& type = AbstractType::Handle();
@@ -117,7 +118,7 @@
 // Processing ObjectStore::pending_classes_ occurs:
 // a) when bootstrap process completes (VerifyBootstrapClasses).
 // b) after the user classes are loaded (dart_api).
-bool ClassFinalizer::ProcessPendingClasses() {
+bool ClassFinalizer::ProcessPendingClasses(bool from_kernel) {
   Thread* thread = Thread::Current();
   NOT_IN_PRODUCT(TimelineDurationScope tds(thread, Timeline::GetIsolateStream(),
                                            "ProcessPendingClasses"));
@@ -149,6 +150,12 @@
     for (intptr_t i = 0; i < class_array.Length(); i++) {
       cls ^= class_array.At(i);
       FinalizeTypesInClass(cls);
+      // Classes compiled from Dart sources are finalized more lazily, classes
+      // compiled from Kernel binaries can be finalized now (and should be,
+      // since we will not revisit them).
+      if (from_kernel) {
+        FinalizeClass(cls);
+      }
     }
     if (FLAG_print_classes) {
       for (intptr_t i = 0; i < class_array.Length(); i++) {
@@ -172,8 +179,8 @@
 
 // Adds all interfaces of cls into 'collected'. Duplicate entries may occur.
 // No cycles are allowed.
-void ClassFinalizer::CollectInterfaces(
-    const Class& cls, GrowableArray<const Class*>* collected) {
+void ClassFinalizer::CollectInterfaces(const Class& cls,
+                                       GrowableArray<const Class*>* collected) {
   Zone* zone = Thread::Current()->zone();
   const Array& interface_array = Array::Handle(zone, cls.interfaces());
   AbstractType& interface = AbstractType::Handle(zone);
@@ -187,7 +194,7 @@
 }
 
 
-#if defined(DART_NO_SNAPSHOT)
+#if !defined(DART_PRECOMPILED_RUNTIME)
 void ClassFinalizer::VerifyBootstrapClasses() {
   if (FLAG_trace_class_finalization) {
     OS::Print("VerifyBootstrapClasses START.\n");
@@ -253,7 +260,7 @@
   }
   Isolate::Current()->heap()->Verify();
 }
-#endif  // defined(DART_NO_SNAPSHOT).
+#endif  // !defined(DART_PRECOMPILED_RUNTIME)
 
 
 static bool IsLoaded(const Type& type) {
@@ -262,34 +269,43 @@
   }
   const UnresolvedClass& unresolved_class =
       UnresolvedClass::Handle(type.unresolved_class());
-  const LibraryPrefix& prefix =
-      LibraryPrefix::Handle(unresolved_class.library_prefix());
-  return prefix.IsNull() || prefix.is_loaded();
+  const Object& prefix =
+      Object::Handle(unresolved_class.library_or_library_prefix());
+  if (prefix.IsNull()) {
+    return true;
+  } else if (prefix.IsLibraryPrefix()) {
+    return LibraryPrefix::Cast(prefix).is_loaded();
+  } else {
+    return true;
+  }
 }
 
 
 // Resolve unresolved_class in the library of cls, or return null.
 RawClass* ClassFinalizer::ResolveClass(
-      const Class& cls,
-      const UnresolvedClass& unresolved_class) {
+    const Class& cls,
+    const UnresolvedClass& unresolved_class) {
   const String& class_name = String::Handle(unresolved_class.ident());
   Library& lib = Library::Handle();
   Class& resolved_class = Class::Handle();
-  if (unresolved_class.library_prefix() == LibraryPrefix::null()) {
+  if (unresolved_class.library_or_library_prefix() == Object::null()) {
     lib = cls.library();
     ASSERT(!lib.IsNull());
     resolved_class = lib.LookupClass(class_name);
   } else {
-    LibraryPrefix& lib_prefix = LibraryPrefix::Handle();
-    lib_prefix = unresolved_class.library_prefix();
-    ASSERT(!lib_prefix.IsNull());
-    resolved_class = lib_prefix.LookupClass(class_name);
+    const Object& prefix =
+        Object::Handle(unresolved_class.library_or_library_prefix());
+
+    if (prefix.IsLibraryPrefix()) {
+      resolved_class = LibraryPrefix::Cast(prefix).LookupClass(class_name);
+    } else {
+      resolved_class = Library::Cast(prefix).LookupClass(class_name);
+    }
   }
   return resolved_class.raw();
 }
 
 
-
 void ClassFinalizer::ResolveRedirectingFactory(const Class& cls,
                                                const Function& factory) {
   const Function& target = Function::Handle(factory.RedirectionTarget());
@@ -354,19 +370,18 @@
   ASSERT(!type.IsTypeParameter());  // Resolved in parser.
   if (type.IsDynamicType()) {
     // Replace the type with a malformed type and compile a throw when called.
-    type = NewFinalizedMalformedType(
-        Error::Handle(),  // No previous error.
-        Script::Handle(cls.script()),
-        factory.token_pos(),
-        "factory may not redirect to 'dynamic'");
+    type = NewFinalizedMalformedType(Error::Handle(),  // No previous error.
+                                     Script::Handle(cls.script()),
+                                     factory.token_pos(),
+                                     "factory may not redirect to 'dynamic'");
     factory.SetRedirectionType(type);
     ASSERT(factory.RedirectionTarget() == Function::null());
     return;
   }
   const Class& target_class = Class::Handle(type.type_class());
   String& target_class_name = String::Handle(target_class.Name());
-  String& target_name = String::Handle(
-      String::Concat(target_class_name, Symbols::Dot()));
+  String& target_name =
+      String::Handle(String::Concat(target_class_name, Symbols::Dot()));
   const String& identifier = String::Handle(factory.RedirectionIdentifier());
   if (!identifier.IsNull()) {
     target_name = String::Concat(target_name, identifier);
@@ -383,11 +398,9 @@
     // Replace the type with a malformed type and compile a throw when called.
     type = NewFinalizedMalformedType(
         Error::Handle(),  // No previous error.
-        Script::Handle(target_class.script()),
-        factory.token_pos(),
+        Script::Handle(target_class.script()), factory.token_pos(),
         "class '%s' has no constructor or factory named '%s'",
-        target_class_name.ToCString(),
-        user_visible_target_name.ToCString());
+        target_class_name.ToCString(), user_visible_target_name.ToCString());
     factory.SetRedirectionType(type);
     ASSERT(factory.RedirectionTarget() == Function::null());
     return;
@@ -441,8 +454,8 @@
     if (!target_type.IsInstantiated()) {
       const TypeArguments& type_args = TypeArguments::Handle(type.arguments());
       Error& bound_error = Error::Handle();
-      target_type ^= target_type.InstantiateFrom(
-          type_args, &bound_error, NULL, NULL, Heap::kOld);
+      target_type ^= target_type.InstantiateFrom(type_args, &bound_error, NULL,
+                                                 NULL, Heap::kOld);
       if (bound_error.IsNull()) {
         target_type ^= FinalizeType(cls, target_type, kCanonicalize);
       } else {
@@ -484,13 +497,11 @@
     type_class = ResolveClass(cls, unresolved_class);
     if (type_class.IsNull()) {
       // The type class could not be resolved. The type is malformed.
-      FinalizeMalformedType(
-          Error::Handle(),  // No previous error.
-          Script::Handle(cls.script()),
-          type,
-          "cannot resolve class '%s' from '%s'",
-          String::Handle(unresolved_class.Name()).ToCString(),
-          String::Handle(cls.Name()).ToCString());
+      FinalizeMalformedType(Error::Handle(),  // No previous error.
+                            Script::Handle(cls.script()), type,
+                            "cannot resolve class '%s' from '%s'",
+                            String::Handle(unresolved_class.Name()).ToCString(),
+                            String::Handle(cls.Name()).ToCString());
       return;
     }
     // Replace unresolved class with resolved type class.
@@ -499,8 +510,7 @@
   // Promote the type to a function type in case its type class is a typedef.
   // Note that the type may already be a function type if it was parsed as a
   // formal parameter function type.
-  if (!type.IsFunctionType() &&
-      type_class.IsTypedefClass() &&
+  if (!type.IsFunctionType() && type_class.IsTypedefClass() &&
       !type.IsMalformedOrMalbounded()) {
     type.set_signature(Function::Handle(type_class.signature_function()));
   }
@@ -549,9 +559,8 @@
 }
 
 
-void ClassFinalizer::FinalizeTypeParameters(
-    const Class& cls,
-    PendingTypes* pending_types) {
+void ClassFinalizer::FinalizeTypeParameters(const Class& cls,
+                                            PendingTypes* pending_types) {
   if (FLAG_trace_type_finalization) {
     THR_Print("Finalizing type parameters of '%s'\n",
               String::Handle(cls.Name()).ToCString());
@@ -569,8 +578,8 @@
     const intptr_t num_types = type_parameters.Length();
     for (intptr_t i = 0; i < num_types; i++) {
       type_parameter ^= type_parameters.TypeAt(i);
-      type_parameter ^= FinalizeType(
-          cls, type_parameter, kFinalize, pending_types);
+      type_parameter ^=
+          FinalizeType(cls, type_parameter, kFinalize, pending_types);
       type_parameters.SetTypeAt(i, type_parameter);
     }
   }
@@ -593,8 +602,7 @@
   Zone* zone = Thread::Current()->zone();
   if (FLAG_trace_type_finalization) {
     THR_Print("Checking recursive type '%s': %s\n",
-              String::Handle(type.Name()).ToCString(),
-              type.ToCString());
+              String::Handle(type.Name()).ToCString(), type.ToCString());
   }
   const Class& type_cls = Class::Handle(zone, type.type_class());
   const TypeArguments& arguments =
@@ -626,19 +634,17 @@
                 String::Handle(pending_type.Name()).ToCString(),
                 pending_type.ToCString());
     }
-    if ((pending_type.raw() != type.raw()) &&
-        pending_type.IsType() &&
+    if ((pending_type.raw() != type.raw()) && pending_type.IsType() &&
         (pending_type.type_class() == type_cls.raw())) {
       pending_arguments = pending_type.arguments();
-      if (!pending_arguments.IsSubvectorEquivalent(arguments,
-                                                   first_type_param,
+      if (!pending_arguments.IsSubvectorEquivalent(arguments, first_type_param,
                                                    num_type_params) &&
           !pending_arguments.IsSubvectorInstantiated(first_type_param,
                                                      num_type_params)) {
         // Reject the non-contractive recursive type.
         const String& type_name = String::Handle(zone, type.Name());
-        ReportError(cls, type.token_pos(),
-                    "illegal recursive type '%s'", type_name.ToCString());
+        ReportError(cls, type.token_pos(), "illegal recursive type '%s'",
+                    type_name.ToCString());
       }
     }
   }
@@ -710,8 +716,7 @@
       // Copy the parsed type arguments at the correct offset in the full type
       // argument vector.
       const intptr_t offset = num_type_arguments - num_type_parameters;
-      AbstractType& type_arg =
-          AbstractType::Handle(zone, Type::DynamicType());
+      AbstractType& type_arg = AbstractType::Handle(zone, Type::DynamicType());
       // Leave the temporary type arguments at indices [0..offset[ as null.
       for (intptr_t i = 0; i < num_type_parameters; i++) {
         // If no type parameters were provided, a raw type is desired, so we
@@ -745,8 +750,8 @@
       if (offset > 0) {
         TrailPtr instantiation_trail = new Trail(zone, 4);
         Error& bound_error = Error::Handle(zone);
-        FinalizeTypeArguments(type_class, full_arguments, offset,
-                              &bound_error, pending_types, instantiation_trail);
+        FinalizeTypeArguments(type_class, full_arguments, offset, &bound_error,
+                              pending_types, instantiation_trail);
       }
       if (full_arguments.IsRaw(0, num_type_arguments)) {
         // The parameterized_type is raw. Set its argument vector to null, which
@@ -809,13 +814,12 @@
 // same time. Canonicalization happens when pending types are processed.
 // The trail is required to correctly instantiate a recursive type argument
 // of the super type.
-void ClassFinalizer::FinalizeTypeArguments(
-    const Class& cls,
-    const TypeArguments& arguments,
-    intptr_t num_uninitialized_arguments,
-    Error* bound_error,
-    PendingTypes* pending_types,
-    TrailPtr instantiation_trail) {
+void ClassFinalizer::FinalizeTypeArguments(const Class& cls,
+                                           const TypeArguments& arguments,
+                                           intptr_t num_uninitialized_arguments,
+                                           Error* bound_error,
+                                           PendingTypes* pending_types,
+                                           TrailPtr instantiation_trail) {
   ASSERT(arguments.Length() >= cls.NumTypeArguments());
   if (!cls.is_type_finalized()) {
     FinalizeTypeParameters(cls, pending_types);
@@ -829,12 +833,11 @@
     ASSERT(num_super_type_args ==
            (cls.NumTypeArguments() - cls.NumOwnTypeArguments()));
     if (!super_type.IsFinalized() && !super_type.IsBeingFinalized()) {
-      super_type ^= FinalizeType(
-          cls, super_type, kFinalize, pending_types);
+      super_type ^= FinalizeType(cls, super_type, kFinalize, pending_types);
       cls.set_super_type(super_type);
     }
-    TypeArguments& super_type_args = TypeArguments::Handle(
-        super_type.arguments());
+    TypeArguments& super_type_args =
+        TypeArguments::Handle(super_type.arguments());
     // Offset of super type's type parameters in cls' type argument vector.
     const intptr_t super_offset = num_super_type_args - num_super_type_params;
     AbstractType& super_type_arg = AbstractType::Handle(Type::DynamicType());
@@ -854,8 +857,8 @@
             super_type_args.SetTypeAt(i, super_type_arg);
           } else {
             if (!super_type_arg.IsFinalized()) {
-              super_type_arg ^= FinalizeType(
-                  cls, super_type_arg, kFinalize, pending_types);
+              super_type_arg ^=
+                  FinalizeType(cls, super_type_arg, kFinalize, pending_types);
               super_type_args.SetTypeAt(i, super_type_arg);
               // Note that super_type_arg may still not be finalized here, in
               // which case it is a TypeRef to a legal recursive type.
@@ -865,13 +868,13 @@
         // Instantiate super_type_arg with the current argument vector.
         if (!super_type_arg.IsInstantiated()) {
           if (FLAG_trace_type_finalization && super_type_arg.IsTypeRef()) {
-            AbstractType& ref_type = AbstractType::Handle(
-                TypeRef::Cast(super_type_arg).type());
-            THR_Print("Instantiating TypeRef '%s': '%s'\n"
-                      "  instantiator: '%s'\n",
-                      String::Handle(super_type_arg.Name()).ToCString(),
-                      ref_type.ToCString(),
-                      arguments.ToCString());
+            AbstractType& ref_type =
+                AbstractType::Handle(TypeRef::Cast(super_type_arg).type());
+            THR_Print(
+                "Instantiating TypeRef '%s': '%s'\n"
+                "  instantiator: '%s'\n",
+                String::Handle(super_type_arg.Name()).ToCString(),
+                ref_type.ToCString(), arguments.ToCString());
           }
           Error& error = Error::Handle();
           super_type_arg = super_type_arg.InstantiateFrom(
@@ -897,20 +900,17 @@
             pending_types->Add(super_type_arg);
             const Class& cls = Class::Handle(super_type_arg.type_class());
             FinalizeTypeArguments(
-                cls,
-                TypeArguments::Handle(super_type_arg.arguments()),
-                cls.NumTypeArguments() - cls.NumTypeParameters(),
-                bound_error,
-                pending_types,
-                instantiation_trail);
+                cls, TypeArguments::Handle(super_type_arg.arguments()),
+                cls.NumTypeArguments() - cls.NumTypeParameters(), bound_error,
+                pending_types, instantiation_trail);
             Type::Cast(super_type_arg).SetIsFinalized();
           }
         }
       }
       arguments.SetTypeAt(i, super_type_arg);
     }
-    FinalizeTypeArguments(super_class, arguments, super_offset,
-                          bound_error, pending_types, instantiation_trail);
+    FinalizeTypeArguments(super_class, arguments, super_offset, bound_error,
+                          pending_types, instantiation_trail);
   }
 }
 
@@ -1000,8 +1000,8 @@
         if (type_arg.IsTypeParameter()) {
           const Class& type_arg_cls = Class::Handle(
               TypeParameter::Cast(type_arg).parameterized_class());
-          AbstractType& bound = AbstractType::Handle(
-              TypeParameter::Cast(type_arg).bound());
+          AbstractType& bound =
+              AbstractType::Handle(TypeParameter::Cast(type_arg).bound());
           if (!bound.IsFinalized() && !bound.IsBeingFinalized()) {
             bound = FinalizeType(type_arg_cls, bound, kCanonicalize);
             TypeParameter::Cast(type_arg).set_bound(bound);
@@ -1009,8 +1009,8 @@
         }
         // This may be called only if type needs to be finalized, therefore
         // seems OK to allocate finalized types in old space.
-        if (!type_param.CheckBound(type_arg, instantiated_bound,
-                                   &error, NULL, Heap::kOld) &&
+        if (!type_param.CheckBound(type_arg, instantiated_bound, &error, NULL,
+                                   Heap::kOld) &&
             error.IsNull()) {
           // The bound cannot be checked at compile time; postpone to run time.
           type_arg = BoundedType::New(type_arg, instantiated_bound, type_param);
@@ -1056,11 +1056,9 @@
     if (!bound_error.IsNull()) {
       // No compile-time error during finalization.
       const String& type_name = String::Handle(zone, type.UserVisibleName());
-      FinalizeMalboundedType(bound_error,
-                             Script::Handle(zone, cls.script()),
-                             type,
-                             "type '%s' has an out of bound type argument",
-                             type_name.ToCString());
+      FinalizeMalboundedType(
+          bound_error, Script::Handle(zone, cls.script()), type,
+          "type '%s' has an out of bound type argument", type_name.ToCString());
       if (FLAG_trace_type_finalization) {
         THR_Print("Marking type '%s' as malbounded: %s\n",
                   String::Handle(zone, type.Name()).ToCString(),
@@ -1070,27 +1068,23 @@
   }
   if (FLAG_trace_type_finalization) {
     THR_Print("Done checking bounds of type '%s': %s\n",
-              String::Handle(zone, type.Name()).ToCString(),
-              type.ToCString());
+              String::Handle(zone, type.Name()).ToCString(), type.ToCString());
   }
 }
 
 
-RawAbstractType* ClassFinalizer::FinalizeType(
-    const Class& cls,
-    const AbstractType& type,
-    FinalizationKind finalization,
-    PendingTypes* pending_types) {
+RawAbstractType* ClassFinalizer::FinalizeType(const Class& cls,
+                                              const AbstractType& type,
+                                              FinalizationKind finalization,
+                                              PendingTypes* pending_types) {
   // Only the 'root' type of the graph can be canonicalized, after all depending
   // types have been bound checked.
   ASSERT((pending_types == NULL) || (finalization < kCanonicalize));
   if (type.IsFinalized()) {
     // Ensure type is canonical if canonicalization is requested, unless type is
     // malformed.
-    if ((finalization >= kCanonicalize) &&
-        !type.IsMalformed() &&
-        !type.IsCanonical() &&
-        type.IsType()) {
+    if ((finalization >= kCanonicalize) && !type.IsMalformed() &&
+        !type.IsCanonical() && type.IsType()) {
       CheckTypeBounds(cls, type);
       return type.Canonicalize();
     }
@@ -1199,8 +1193,7 @@
   if (FLAG_trace_type_finalization) {
     THR_Print("Done finalizing type '%s' with %" Pd " type args: %s\n",
               String::Handle(zone, type.Name()).ToCString(),
-              num_expanded_type_arguments,
-              type.ToCString());
+              num_expanded_type_arguments, type.ToCString());
   }
 
   if (finalization >= kCanonicalize) {
@@ -1297,8 +1290,7 @@
   super_class = cls.SuperClass();
   while (!super_class.IsNull()) {
     function = super_class.LookupFunction(name);
-    if (!function.IsNull() &&
-        !function.is_static() &&
+    if (!function.IsNull() && !function.is_static() &&
         !function.IsMethodExtractor()) {
       return super_class.raw();
     }
@@ -1397,9 +1389,7 @@
         ReportError(cls, field.token_pos(),
                     "static field '%s' of class '%s' conflicts with "
                     "instance member '%s' of super class '%s'",
-                    name.ToCString(),
-                    class_name.ToCString(),
-                    name.ToCString(),
+                    name.ToCString(), class_name.ToCString(), name.ToCString(),
                     super_cls_name.ToCString());
       }
       // An implicit setter is not generated for a static field, therefore, we
@@ -1413,9 +1403,7 @@
         ReportError(cls, field.token_pos(),
                     "static field '%s' of class '%s' conflicts with "
                     "instance setter '%s=' of super class '%s'",
-                    name.ToCString(),
-                    class_name.ToCString(),
-                    name.ToCString(),
+                    name.ToCString(), class_name.ToCString(), name.ToCString(),
                     super_cls_name.ToCString());
       }
 
@@ -1429,14 +1417,11 @@
         ReportError(cls, field.token_pos(),
                     "field '%s' of class '%s' conflicts with method '%s' "
                     "of super class '%s'",
-                    name.ToCString(),
-                    class_name.ToCString(),
-                    name.ToCString(),
+                    name.ToCString(), class_name.ToCString(), name.ToCString(),
                     super_cls_name.ToCString());
       }
     }
-    if (field.is_static() &&
-        (field.StaticValue() != Object::null()) &&
+    if (field.is_static() && (field.StaticValue() != Object::null()) &&
         (field.StaticValue() != Object::sentinel().raw())) {
       // The parser does not preset the value if the type is a type parameter or
       // is parameterized unless the value is null.
@@ -1446,25 +1431,22 @@
       } else {
         ASSERT(type.IsInstantiated());
       }
-      const Instance& const_value =
-          Instance::Handle(zone, field.StaticValue());
+      const Instance& const_value = Instance::Handle(zone, field.StaticValue());
       if (!error.IsNull() ||
           (!type.IsDynamicType() &&
-           !const_value.IsInstanceOf(type,
-                                     Object::null_type_arguments(),
+           !const_value.IsInstanceOf(type, Object::null_type_arguments(),
                                      &error))) {
         if (Isolate::Current()->error_on_bad_type()) {
-          const AbstractType& const_value_type = AbstractType::Handle(
-              zone, const_value.GetType());
-          const String& const_value_type_name = String::Handle(
-              zone, const_value_type.UserVisibleName());
-          const String& type_name = String::Handle(
-              zone, type.UserVisibleName());
+          const AbstractType& const_value_type =
+              AbstractType::Handle(zone, const_value.GetType(Heap::kNew));
+          const String& const_value_type_name =
+              String::Handle(zone, const_value_type.UserVisibleName());
+          const String& type_name =
+              String::Handle(zone, type.UserVisibleName());
           ReportErrors(error, cls, field.token_pos(),
                        "error initializing static %s field '%s': "
                        "type '%s' is not a subtype of type '%s'",
-                       field.is_const() ? "const" : "final",
-                       name.ToCString(),
+                       field.is_const() ? "const" : "final", name.ToCString(),
                        const_value_type_name.ToCString(),
                        type_name.ToCString());
         } else {
@@ -1477,18 +1459,16 @@
           // we create an implicit static final getter and reset the field value
           // to the sentinel value.
           const Function& getter = Function::Handle(
-              zone,
-              Function::New(getter_name,
-                            RawFunction::kImplicitStaticFinalGetter,
-                            /* is_static = */ true,
-                            /* is_const = */ field.is_const(),
-                            /* is_abstract = */ false,
-                            /* is_external = */ false,
-                            /* is_native = */ false,
-                            cls,
-                            field.token_pos()));
+              zone, Function::New(
+                        getter_name, RawFunction::kImplicitStaticFinalGetter,
+                        /* is_static = */ true,
+                        /* is_const = */ field.is_const(),
+                        /* is_abstract = */ false,
+                        /* is_external = */ false,
+                        /* is_native = */ false, cls, field.token_pos()));
           getter.set_result_type(type);
           getter.set_is_debuggable(false);
+          getter.set_kernel_function(field.kernel_field());
           cls.AddFunction(getter);
           field.SetStaticValue(Object::sentinel(), true);
         }
@@ -1517,8 +1497,8 @@
     FinalizeSignature(cls, function);
     name = function.name();
     // Report signature conflicts only.
-    if (Isolate::Current()->error_on_bad_override() &&
-        !function.is_static() && !function.IsGenerativeConstructor()) {
+    if (Isolate::Current()->error_on_bad_override() && !function.is_static() &&
+        !function.IsGenerativeConstructor()) {
       // A constructor cannot override anything.
       for (intptr_t i = 0; i < interfaces.length(); i++) {
         const Class* super_class = interfaces.At(i);
@@ -1535,8 +1515,7 @@
           ReportErrors(error, cls, function.token_pos(),
                        "class '%s' overrides method '%s' of super "
                        "class '%s' with incompatible parameters",
-                       class_name.ToCString(),
-                       name.ToCString(),
+                       class_name.ToCString(), name.ToCString(),
                        super_cls_name.ToCString());
         }
       }
@@ -1551,10 +1530,8 @@
           ReportError(cls, function.token_pos(),
                       "static setter '%s=' of class '%s' conflicts with "
                       "instance setter '%s=' of super class '%s'",
-                      name.ToCString(),
-                      class_name.ToCString(),
-                      name.ToCString(),
-                      super_cls_name.ToCString());
+                      name.ToCString(), class_name.ToCString(),
+                      name.ToCString(), super_cls_name.ToCString());
         }
       }
       continue;
@@ -1570,15 +1547,15 @@
       if (!super_class.IsNull()) {
         const String& class_name = String::Handle(zone, cls.Name());
         const String& super_cls_name = String::Handle(zone, super_class.Name());
-        ReportError(cls, function.token_pos(),
-                    "static %s '%s' of class '%s' conflicts with "
-                    "instance member '%s' of super class '%s'",
-                    (function.IsGetterFunction() ||
-                     function.IsImplicitGetterFunction()) ? "getter" : "method",
-                    name.ToCString(),
-                    class_name.ToCString(),
-                    name.ToCString(),
-                    super_cls_name.ToCString());
+        ReportError(
+            cls, function.token_pos(),
+            "static %s '%s' of class '%s' conflicts with "
+            "instance member '%s' of super class '%s'",
+            (function.IsGetterFunction() || function.IsImplicitGetterFunction())
+                ? "getter"
+                : "method",
+            name.ToCString(), class_name.ToCString(), name.ToCString(),
+            super_cls_name.ToCString());
       }
       if (function.IsRedirectingFactory()) {
         // The function may be a still unresolved redirecting factory. Do not
@@ -1601,9 +1578,7 @@
         ReportError(cls, function.token_pos(),
                     "getter '%s' of class '%s' conflicts with "
                     "method '%s' of super class '%s'",
-                    name.ToCString(),
-                    class_name.ToCString(),
-                    name.ToCString(),
+                    name.ToCString(), class_name.ToCString(), name.ToCString(),
                     super_cls_name.ToCString());
       }
     } else if (!function.IsSetterFunction() &&
@@ -1617,9 +1592,7 @@
         ReportError(cls, function.token_pos(),
                     "method '%s' of class '%s' conflicts with "
                     "getter '%s' of super class '%s'",
-                    name.ToCString(),
-                    class_name.ToCString(),
-                    name.ToCString(),
+                    name.ToCString(), class_name.ToCString(), name.ToCString(),
                     super_cls_name.ToCString());
       }
     }
@@ -1649,8 +1622,8 @@
   ASSERT(mixin_app_class.type_parameters() == TypeArguments::null());
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
-  const AbstractType& super_type = AbstractType::Handle(zone,
-      mixin_app_class.super_type());
+  const AbstractType& super_type =
+      AbstractType::Handle(zone, mixin_app_class.super_type());
   ASSERT(super_type.IsResolved());
   const Class& super_class = Class::Handle(zone, super_type.type_class());
   const intptr_t num_super_type_params = super_class.NumTypeParameters();
@@ -1686,7 +1659,8 @@
       }
     }
 
-    const TypeArguments& cloned_type_params = TypeArguments::Handle(zone,
+    const TypeArguments& cloned_type_params = TypeArguments::Handle(
+        zone,
         TypeArguments::New((share_type_params ? 0 : num_super_type_params) +
                            num_mixin_type_params));
     TypeParameter& param = TypeParameter::Handle(zone);
@@ -1702,8 +1676,8 @@
     if (!share_type_params && (num_super_type_params > 0)) {
       const TypeArguments& super_type_params =
           TypeArguments::Handle(zone, super_class.type_parameters());
-      const TypeArguments& super_type_args = TypeArguments::Handle(zone,
-          TypeArguments::New(num_super_type_params));
+      const TypeArguments& super_type_args = TypeArguments::Handle(
+          zone, TypeArguments::New(num_super_type_params));
       // The cloned super class type parameters do not need to repeat their
       // bounds, since the bound checks will be performed at the super class
       // level. As a consequence, if this mixin application is used itself as a
@@ -1716,14 +1690,11 @@
       for (intptr_t i = 0; i < num_super_type_params; i++) {
         param ^= super_type_params.TypeAt(i);
         param_name = param.name();
-        param_name = Symbols::FromConcat(thread,
-                                         param_name, Symbols::Backtick());
-        cloned_param = TypeParameter::New(mixin_app_class,
-                                          null_function,
-                                          cloned_index,
-                                          param_name,
-                                          param_bound,
-                                          param.token_pos());
+        param_name =
+            Symbols::FromConcat(thread, param_name, Symbols::Backtick());
+        cloned_param =
+            TypeParameter::New(mixin_app_class, null_function, cloned_index,
+                               param_name, param_bound, param.token_pos());
         cloned_type_params.SetTypeAt(cloned_index, cloned_param);
         // Change the type arguments of the super type to refer to the
         // cloned type parameters of the mixin application class.
@@ -1746,8 +1717,8 @@
           TypeArguments::Handle(zone, mixin_class.type_parameters());
       const intptr_t offset =
           mixin_class.NumTypeArguments() - mixin_class.NumTypeParameters();
-      const TypeArguments& mixin_type_args = TypeArguments::Handle(zone,
-          TypeArguments::New(num_mixin_type_params));
+      const TypeArguments& mixin_type_args = TypeArguments::Handle(
+          zone, TypeArguments::New(num_mixin_type_params));
       instantiator ^= TypeArguments::New(offset + num_mixin_type_params);
       bool has_uninstantiated_bounds = false;
       for (intptr_t i = 0; i < num_mixin_type_params; i++) {
@@ -1757,12 +1728,10 @@
         if (!param_bound.IsInstantiated()) {
           has_uninstantiated_bounds = true;
         }
-        cloned_param = TypeParameter::New(mixin_app_class,
-                                          null_function,
-                                          cloned_index,  // Unfinalized index.
-                                          param_name,
-                                          param_bound,
-                                          param.token_pos());
+        cloned_param =
+            TypeParameter::New(mixin_app_class, null_function,
+                               cloned_index,  // Unfinalized index.
+                               param_name, param_bound, param.token_pos());
         cloned_type_params.SetTypeAt(cloned_index, cloned_param);
         mixin_type_args.SetTypeAt(i, cloned_param);  // Unfinalized length.
         instantiator.SetTypeAt(offset + i, cloned_param);  // Finalized length.
@@ -1785,8 +1754,7 @@
           param_bound = param.bound();
           if (!param_bound.IsInstantiated()) {
             // Make sure the bound is finalized before instantiating it.
-            if (!param_bound.IsFinalized() &&
-                !param_bound.IsBeingFinalized()) {
+            if (!param_bound.IsFinalized() && !param_bound.IsBeingFinalized()) {
               param_bound =
                   FinalizeType(mixin_app_class, param_bound, kCanonicalize);
               param.set_bound(param_bound);  // In case part of recursive type.
@@ -1902,34 +1870,34 @@
   // The mixin type may or may not be finalized yet.
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
-  AbstractType& super_type = AbstractType::Handle(zone,
-                                                  mixin_app_class.super_type());
+  AbstractType& super_type =
+      AbstractType::Handle(zone, mixin_app_class.super_type());
   const Type& mixin_type = Type::Handle(zone, mixin_app_class.mixin());
   const Class& mixin_class = Class::Handle(zone, mixin_type.type_class());
   ASSERT(mixin_class.is_mixin_app_alias());
-  const Class& aliased_mixin_app_class = Class::Handle(zone,
-      mixin_class.SuperClass());
+  const Class& aliased_mixin_app_class =
+      Class::Handle(zone, mixin_class.SuperClass());
   // Note that the super class of aliased_mixin_app_class can itself be a
   // mixin application class (this happens if the alias is mixing more than one
   // type). Instead of trying to recursively insert yet another class as the
   // super class of this inserted class, we apply the composition rules of the
   // spec and only mixin the members of aliased_mixin_app_class, not those of
   // its super class. In other words, we only mixin the last mixin of the alias.
-  const Type& aliased_mixin_type = Type::Handle(zone,
-      aliased_mixin_app_class.mixin());
+  const Type& aliased_mixin_type =
+      Type::Handle(zone, aliased_mixin_app_class.mixin());
   // The name of the inserted mixin application class is the name of mixin
   // class name with a backtick added.
   String& inserted_class_name = String::Handle(zone, mixin_app_class.Name());
-  inserted_class_name = String::Concat(inserted_class_name,
-                                       Symbols::Backtick());
+  inserted_class_name =
+      String::Concat(inserted_class_name, Symbols::Backtick());
   const Library& library = Library::Handle(zone, mixin_app_class.library());
-  Class& inserted_class = Class::Handle(zone,
-      library.LookupLocalClass(inserted_class_name));
+  Class& inserted_class =
+      Class::Handle(zone, library.LookupLocalClass(inserted_class_name));
   if (inserted_class.IsNull()) {
     inserted_class_name = Symbols::New(thread, inserted_class_name);
     const Script& script = Script::Handle(zone, mixin_app_class.script());
-    inserted_class = Class::New(
-        library, inserted_class_name, script, mixin_app_class.token_pos());
+    inserted_class = Class::New(library, inserted_class_name, script,
+                                mixin_app_class.token_pos());
     inserted_class.set_is_synthesized_class();
     library.AddClass(inserted_class);
 
@@ -1952,10 +1920,10 @@
     // After FinalizeTypesInClass, if the mixin type and interface type are
     // generic, their type arguments will refer to the type parameters of
     // inserted_class.
-    const Type& inserted_class_mixin_type = Type::Handle(zone,
-        Type::New(Class::Handle(zone, aliased_mixin_type.type_class()),
-                  Object::null_type_arguments(),
-                  aliased_mixin_type.token_pos()));
+    const Type& inserted_class_mixin_type = Type::Handle(
+        zone, Type::New(Class::Handle(zone, aliased_mixin_type.type_class()),
+                        Object::null_type_arguments(),
+                        aliased_mixin_type.token_pos()));
     inserted_class.set_mixin(inserted_class_mixin_type);
     // Add the mixin type to the list of interfaces that the mixin application
     // class implements. This is necessary so that cycle check work at
@@ -1995,8 +1963,8 @@
   // will finalize mixin_class_super_type.
   // The aliased_mixin_type does not need to be finalized, but only resolved.
   ASSERT(aliased_mixin_type.IsResolved());
-  const Class& aliased_mixin_type_class = Class::Handle(zone,
-      aliased_mixin_type.type_class());
+  const Class& aliased_mixin_type_class =
+      Class::Handle(zone, aliased_mixin_type.type_class());
   FinalizeTypesInClass(mixin_class);
   const intptr_t num_aliased_mixin_type_params =
       aliased_mixin_type_class.NumTypeParameters();
@@ -2032,15 +2000,15 @@
           // BoundedType objects, so no bound error may occur.
           ASSERT(bound_error.IsNull());
           upper_bound = BoundedType::Cast(type).bound();
-          upper_bound = upper_bound.InstantiateFrom(
-              instantiator, &bound_error, NULL, NULL, Heap::kOld);
+          upper_bound = upper_bound.InstantiateFrom(instantiator, &bound_error,
+                                                    NULL, NULL, Heap::kOld);
           ASSERT(bound_error.IsNull());
           type_parameter = BoundedType::Cast(type).type_parameter();
           // The type parameter that declared the bound does not change.
           type = BoundedType::New(bounded_type, upper_bound, type_parameter);
         } else {
-          type = type.InstantiateFrom(
-              instantiator, &bound_error, NULL, NULL, Heap::kOld);
+          type = type.InstantiateFrom(instantiator, &bound_error, NULL, NULL,
+                                      Heap::kOld);
           ASSERT(bound_error.IsNull());
         }
       }
@@ -2066,8 +2034,7 @@
       new_super_type_args.SetTypeAt(num_super_type_params + i, type);
     }
   }
-  super_type = Type::New(inserted_class,
-                         new_super_type_args,
+  super_type = Type::New(inserted_class, new_super_type_args,
                          mixin_app_class.token_pos());
   mixin_app_class.set_super_type(super_type);
 
@@ -2076,18 +2043,18 @@
   ASSERT(!mixin_app_class.is_type_finalized());
   ASSERT(!mixin_app_class.is_mixin_type_applied());
   if (FLAG_trace_class_finalization) {
-    THR_Print("Inserting class '%s' %s\n"
-              "  as super type '%s' with %" Pd " type args: %s\n"
-              "  of mixin application alias '%s' %s\n",
-              String::Handle(inserted_class.Name()).ToCString(),
-              TypeArguments::Handle(
-                  inserted_class.type_parameters()).ToCString(),
-              String::Handle(zone, super_type.Name()).ToCString(),
-              num_super_type_params + num_aliased_mixin_type_params,
-              super_type.ToCString(),
-              String::Handle(mixin_app_class.Name()).ToCString(),
-              TypeArguments::Handle(
-                  mixin_app_class.type_parameters()).ToCString());
+    THR_Print(
+        "Inserting class '%s' %s\n"
+        "  as super type '%s' with %" Pd
+        " type args: %s\n"
+        "  of mixin application alias '%s' %s\n",
+        String::Handle(inserted_class.Name()).ToCString(),
+        TypeArguments::Handle(inserted_class.type_parameters()).ToCString(),
+        String::Handle(zone, super_type.Name()).ToCString(),
+        num_super_type_params + num_aliased_mixin_type_params,
+        super_type.ToCString(),
+        String::Handle(mixin_app_class.Name()).ToCString(),
+        TypeArguments::Handle(mixin_app_class.type_parameters()).ToCString());
   }
 }
 
@@ -2127,12 +2094,12 @@
   ResolveSuperTypeAndInterfaces(mixin_app_class, &visited_interfaces);
 
   if (FLAG_trace_class_finalization) {
-    THR_Print("Done applying mixin type '%s' to class '%s' %s extending '%s'\n",
-              String::Handle(mixin_type.Name()).ToCString(),
-              String::Handle(mixin_app_class.Name()).ToCString(),
-              TypeArguments::Handle(
-                  mixin_app_class.type_parameters()).ToCString(),
-              AbstractType::Handle(mixin_app_class.super_type()).ToCString());
+    THR_Print(
+        "Done applying mixin type '%s' to class '%s' %s extending '%s'\n",
+        String::Handle(mixin_type.Name()).ToCString(),
+        String::Handle(mixin_app_class.Name()).ToCString(),
+        TypeArguments::Handle(mixin_app_class.type_parameters()).ToCString(),
+        AbstractType::Handle(mixin_app_class.super_type()).ToCString());
   }
   // Mark the application class as having been applied its mixin type in order
   // to avoid cycles while finalizing its mixin type.
@@ -2169,13 +2136,12 @@
       // Build constructor name from mixin application class name
       // and name of cloned super class constructor.
       const String& ctor_name = String::Handle(Z, func.name());
-      String& clone_name = String::Handle(Z,
-          String::SubString(ctor_name, super_name.Length()));
+      String& clone_name =
+          String::Handle(Z, String::SubString(ctor_name, super_name.Length()));
       clone_name = Symbols::FromConcat(T, mixin_name, clone_name);
 
       if (FLAG_trace_class_finalization) {
-        THR_Print("Cloning constructor '%s' as '%s'\n",
-                  ctor_name.ToCString(),
+        THR_Print("Cloning constructor '%s' as '%s'\n", ctor_name.ToCString(),
                   clone_name.ToCString());
       }
 
@@ -2185,16 +2151,13 @@
       const PatchClass& owner =
           PatchClass::Handle(Z, PatchClass::New(mixin_app, mixin_cls));
 
-      const Function& clone = Function::Handle(Z,
-          Function::New(clone_name,
-                        func.kind(),
-                        func.is_static(),
-                        false,  // Not const.
-                        false,  // Not abstract.
-                        false,  // Not external.
-                        false,  // Not native.
-                        owner,
-                        mixin_cls.token_pos()));
+      const Function& clone = Function::Handle(
+          Z, Function::New(clone_name, func.kind(), func.is_static(),
+                           false,  // Not const.
+                           false,  // Not abstract.
+                           false,  // Not external.
+                           false,  // Not native.
+                           owner, mixin_cls.token_pos()));
       clone.set_num_fixed_parameters(func.num_fixed_parameters());
       clone.SetNumOptionalParameters(func.NumOptionalParameters(),
                                      func.HasOptionalPositionalParameters());
@@ -2236,20 +2199,32 @@
 
   if (FLAG_trace_class_finalization) {
     THR_Print("Applying mixin members of %s to %s at pos %s\n",
-              mixin_cls.ToCString(),
-              cls.ToCString(),
+              mixin_cls.ToCString(), cls.ToCString(),
               cls.token_pos().ToCString());
   }
 
   const GrowableObjectArray& cloned_funcs =
       GrowableObjectArray::Handle(zone, GrowableObjectArray::New());
 
-  CreateForwardingConstructors(cls, mixin_cls, cloned_funcs);
-
   Array& functions = Array::Handle(zone);
   Function& func = Function::Handle(zone);
+
   // The parser creates the mixin application class with no functions.
-  ASSERT((functions = cls.functions(), functions.Length() == 0));
+  // But the Kernel frontend will generate mixin classes with only
+  // constructors inside them, which forward to the base class constructors.
+  //
+  // => We generate the constructors if they are not already there.
+  functions = cls.functions();
+  if (functions.Length() == 0) {
+    CreateForwardingConstructors(cls, mixin_cls, cloned_funcs);
+  } else {
+    for (intptr_t i = 0; i < functions.Length(); i++) {
+      func ^= functions.At(i);
+      ASSERT(func.kernel_function() != 0);
+      cloned_funcs.Add(func);
+    }
+  }
+
   // Now clone the functions from the mixin class.
   functions = mixin_cls.functions();
   const intptr_t num_functions = functions.Length();
@@ -2259,13 +2234,12 @@
       // A mixin class must not have explicit constructors.
       if (!func.IsImplicitConstructor()) {
         const Script& script = Script::Handle(cls.script());
-        const Error& error = Error::Handle(
-            LanguageError::NewFormatted(Error::Handle(),
-                script, func.token_pos(), Report::AtLocation,
-                Report::kError, Heap::kNew,
-                "constructor '%s' is illegal in mixin class %s",
-                String::Handle(func.UserVisibleName()).ToCString(),
-                String::Handle(zone, mixin_cls.Name()).ToCString()));
+        const Error& error = Error::Handle(LanguageError::NewFormatted(
+            Error::Handle(), script, func.token_pos(), Report::AtLocation,
+            Report::kError, Heap::kNew,
+            "constructor '%s' is illegal in mixin class %s",
+            String::Handle(func.UserVisibleName()).ToCString(),
+            String::Handle(zone, mixin_cls.Name()).ToCString()));
 
         ReportErrors(error, cls, cls.token_pos(),
                      "mixin class '%s' must not have constructors",
@@ -2273,10 +2247,8 @@
       }
       continue;  // Skip the implicit constructor.
     }
-    if (!func.is_static() &&
-        !func.IsMethodExtractor() &&
-        !func.IsNoSuchMethodDispatcher() &&
-        !func.IsInvokeFieldDispatcher()) {
+    if (!func.is_static() && !func.IsMethodExtractor() &&
+        !func.IsNoSuchMethodDispatcher() && !func.IsInvokeFieldDispatcher()) {
       func = func.Clone(cls);
       cloned_funcs.Add(func);
     }
@@ -2304,8 +2276,7 @@
 
   if (FLAG_trace_class_finalization) {
     THR_Print("Done applying mixin members of %s to %s\n",
-              mixin_cls.ToCString(),
-              cls.ToCString());
+              mixin_cls.ToCString(), cls.ToCString());
   }
 }
 
@@ -2368,8 +2339,7 @@
     if (!IsTypedefCycleFree(cls, type, &visited_aliases)) {
       const String& name = String::Handle(cls.Name());
       ReportError(cls, cls.token_pos(),
-                  "typedef '%s' illegally refers to itself",
-                  name.ToCString());
+                  "typedef '%s' illegally refers to itself", name.ToCString());
     }
     cls.set_is_type_finalized();
 
@@ -2444,8 +2414,20 @@
     // if the class is being refinalized because a patch is being applied
     // after the class has been finalized then it is ok for the class to have
     // functions.
-    ASSERT((Array::Handle(cls.functions()).Length() == 0) ||
-           cls.is_refinalize_after_patch());
+    //
+    // TODO(kmillikin): This ASSERT will fail when bootstrapping from Kernel
+    // because classes are first created, methods are added, and then classes
+    // are finalized.  It is not easy to finalize classes earlier because not
+    // all bootstrap classes have been created yet.  It would be possible to
+    // create all classes, delay adding methods, finalize the classes, and then
+    // reprocess all classes to add methods, but that seems unnecessary.
+    // Marking the bootstrap classes as is_refinalize_after_patch seems cute but
+    // it causes other things to fail by violating their assumptions.  Reenable
+    // this ASSERT if it's important, remove it if it's just a sanity check and
+    // not required for correctness.
+    //
+    // ASSERT((Array::Handle(cls.functions()).Length() == 0) ||
+    //        cls.is_refinalize_after_patch());
   }
 }
 
@@ -2497,8 +2479,7 @@
   }
   // Every class should have at least a constructor, unless it is a top level
   // class or a typedef class.
-  ASSERT(cls.IsTopLevel() ||
-         cls.IsTypedefClass() ||
+  ASSERT(cls.IsTopLevel() || cls.IsTypedefClass() ||
          (Array::Handle(cls.functions()).Length() > 0));
   // Resolve and finalize all member types.
   ResolveAndFinalizeMemberTypes(cls);
@@ -2530,26 +2511,40 @@
   const Field& index_field =
       Field::Handle(zone, enum_cls.LookupInstanceField(Symbols::Index()));
   ASSERT(!index_field.IsNull());
-  const Field& name_field = Field::Handle(zone,
-        enum_cls.LookupInstanceFieldAllowPrivate(Symbols::_name()));
+  const Field& name_field = Field::Handle(
+      zone, enum_cls.LookupInstanceFieldAllowPrivate(Symbols::_name()));
   ASSERT(!name_field.IsNull());
   const Field& values_field =
       Field::Handle(zone, enum_cls.LookupStaticField(Symbols::Values()));
   ASSERT(!values_field.IsNull());
   ASSERT(Instance::Handle(zone, values_field.StaticValue()).IsArray());
-  Array& values_list = Array::Handle(
-      zone, Array::RawCast(values_field.StaticValue()));
-
-  const Array& fields = Array::Handle(zone, enum_cls.fields());
-  Field& field = Field::Handle(zone);
-  Instance& ordinal_value = Instance::Handle(zone);
-  Instance& enum_value = Instance::Handle(zone);
-
+  Array& values_list =
+      Array::Handle(zone, Array::RawCast(values_field.StaticValue()));
   const String& enum_name = String::Handle(enum_cls.ScrubbedName());
   const String& name_prefix =
       String::Handle(String::Concat(enum_name, Symbols::Dot()));
 
+  Field& field = Field::Handle(zone);
+  Instance& ordinal_value = Instance::Handle(zone);
+  Instance& enum_value = Instance::Handle(zone);
+
   String& enum_ident = String::Handle();
+
+  enum_ident =
+      Symbols::FromConcat(thread, Symbols::_DeletedEnumPrefix(), enum_name);
+  enum_value = Instance::New(enum_cls, Heap::kOld);
+  enum_value.SetField(index_field, Smi::Handle(zone, Smi::New(-1)));
+  enum_value.SetField(name_field, enum_ident);
+  const char* error_msg = NULL;
+  enum_value = enum_value.CheckAndCanonicalize(thread, &error_msg);
+  ASSERT(!enum_value.IsNull());
+  ASSERT(enum_value.IsCanonical());
+  field = enum_cls.LookupStaticField(Symbols::_DeletedEnumSentinel());
+  ASSERT(!field.IsNull());
+  field.SetStaticValue(enum_value, true);
+  field.RecordStore(enum_value);
+
+  const Array& fields = Array::Handle(zone, enum_cls.fields());
   for (intptr_t i = 0; i < fields.Length(); i++) {
     field = Field::RawCast(fields.At(i));
     if (!field.is_static()) continue;
@@ -2570,7 +2565,6 @@
     enum_value = Instance::New(enum_cls, Heap::kOld);
     enum_value.SetField(index_field, ordinal_value);
     enum_value.SetField(name_field, enum_ident);
-    const char* error_msg = "";
     enum_value = enum_value.CheckAndCanonicalize(thread, &error_msg);
     ASSERT(!enum_value.IsNull());
     ASSERT(enum_value.IsCanonical());
@@ -2581,7 +2575,6 @@
     values_list.SetAt(ord, enum_value);
   }
   values_list.MakeImmutable();
-  const char* error_msg = NULL;
   values_list ^= values_list.CheckAndCanonicalize(thread, &error_msg);
   ASSERT(!values_list.IsNull());
 }
@@ -2592,8 +2585,8 @@
   Class& test2 = Class::Handle(cls.SuperClass());
   // A finalized class has been checked for cycles.
   // Using the hare and tortoise algorithm for locating cycles.
-  while (!test1.is_type_finalized() &&
-         !test2.IsNull() && !test2.is_type_finalized()) {
+  while (!test1.is_type_finalized() && !test2.IsNull() &&
+         !test2.is_type_finalized()) {
     if (test1.raw() == test2.raw()) {
       // Found a cycle.
       return false;
@@ -2626,8 +2619,7 @@
       // function used in a formal parameter type of the typedef signature, but
       // not the typedef signature function itself, thus not qualifying as an
       // illegal self reference.
-      if (!scope_class.is_type_finalized() &&
-          scope_class.IsTypedefClass() &&
+      if (!scope_class.is_type_finalized() && scope_class.IsTypedefClass() &&
           (scope_class.signature_function() == signature_function.raw())) {
         checking_typedef = true;
         const intptr_t scope_class_id = scope_class.id();
@@ -2775,20 +2767,24 @@
     ReportError(Error::Handle(zone, mixin_super_type.error()));
   }
   if (mixin_super_type.IsDynamicType()) {
-    ReportError(cls, cls.token_pos(),
-                "class '%s' may not extend 'dynamic'",
+    ReportError(cls, cls.token_pos(), "class '%s' may not extend 'dynamic'",
                 String::Handle(zone, cls.Name()).ToCString());
   }
   // The super type may have a BoundedType as type argument, but cannot be
   // a BoundedType itself.
   CollectTypeArguments(cls, Type::Cast(mixin_super_type), type_args);
   AbstractType& mixin_type = AbstractType::Handle(zone);
-  Class& mixin_type_class = Class::Handle(zone);
   Class& mixin_app_class = Class::Handle(zone);
+  Class& mixin_super_type_class = Class::Handle(zone);
+  Class& mixin_type_class = Class::Handle(zone);
+  Library& mixin_super_type_library = Library::Handle(zone);
+  Library& mixin_type_library = Library::Handle(zone);
   String& mixin_app_class_name = String::Handle(zone);
   String& mixin_type_class_name = String::Handle(zone);
   AbstractType& super_type_arg = AbstractType::Handle(zone);
   AbstractType& mixin_type_arg = AbstractType::Handle(zone);
+  Type& generic_mixin_type = Type::Handle(zone);
+  Array& interfaces = Array::Handle(zone);
   const intptr_t depth = mixin_app_type.Depth();
   for (intptr_t i = 0; i < depth; i++) {
     mixin_type = mixin_app_type.MixinTypeAt(i);
@@ -2796,6 +2792,13 @@
     ResolveType(cls, mixin_type);
     ASSERT(mixin_type.HasResolvedTypeClass());  // Even if malformed.
     ASSERT(mixin_type.IsType());
+    if (mixin_type.IsMalformedOrMalbounded()) {
+      ReportError(Error::Handle(zone, mixin_type.error()));
+    }
+    if (mixin_type.IsDynamicType()) {
+      ReportError(cls, cls.token_pos(), "class '%s' may not mixin 'dynamic'",
+                  String::Handle(zone, cls.Name()).ToCString());
+    }
     const intptr_t num_super_type_args = type_args.Length();
     CollectTypeArguments(cls, Type::Cast(mixin_type), type_args);
 
@@ -2804,7 +2807,7 @@
     // thereby allowing for further optimizations, such as instantiator vector
     // reuse or sharing of type arguments with the super class.
     bool share_type_params = (num_super_type_args > 0) &&
-        (type_args.Length() == 2*num_super_type_args);
+                             (type_args.Length() == 2 * num_super_type_args);
     if (share_type_params) {
       for (intptr_t i = 0; i < num_super_type_args; i++) {
         super_type_arg ^= type_args.At(i);
@@ -2821,38 +2824,52 @@
     }
 
     // The name of the mixin application class is a combination of
-    // the super class name and mixin class name.
+    // the super class name and mixin class name, as well as their respective
+    // library private keys if their library is different than the library of
+    // the mixin application class.
+    // Note that appending the library url would break naming conventions (e.g.
+    // no period in the class name).
     mixin_app_class_name = mixin_super_type.ClassName();
-    mixin_app_class_name = String::Concat(mixin_app_class_name,
-                                          Symbols::Ampersand());
+    mixin_super_type_class = mixin_super_type.type_class();
+    mixin_super_type_library = mixin_super_type_class.library();
+    if (mixin_super_type_library.raw() != library.raw()) {
+      mixin_app_class_name = String::Concat(
+          mixin_app_class_name,
+          String::Handle(zone, mixin_super_type_library.private_key()));
+    }
+    mixin_app_class_name =
+        String::Concat(mixin_app_class_name, Symbols::Ampersand());
     // If the type parameters are shared between the super type and the mixin
     // type, use two ampersand symbols, so that the class has a different name
     // and is not reused in a context where this optimization is not possible.
     if (share_type_params) {
-      mixin_app_class_name = String::Concat(mixin_app_class_name,
-                                            Symbols::Ampersand());
+      mixin_app_class_name =
+          String::Concat(mixin_app_class_name, Symbols::Ampersand());
     }
     mixin_type_class_name = mixin_type.ClassName();
-    mixin_app_class_name = String::Concat(mixin_app_class_name,
-                                          mixin_type_class_name);
+    mixin_type_class = mixin_type.type_class();
+    mixin_type_library = mixin_type_class.library();
+    if (mixin_type_library.raw() != library.raw()) {
+      mixin_type_class_name = String::Concat(
+          mixin_type_class_name,
+          String::Handle(zone, mixin_type_library.private_key()));
+    }
+    mixin_app_class_name =
+        String::Concat(mixin_app_class_name, mixin_type_class_name);
     mixin_app_class = library.LookupLocalClass(mixin_app_class_name);
     if (mixin_app_class.IsNull()) {
       mixin_app_class_name = Symbols::New(thread, mixin_app_class_name);
-      mixin_app_class = Class::New(library,
-                                   mixin_app_class_name,
-                                   script,
+      mixin_app_class = Class::New(library, mixin_app_class_name, script,
                                    mixin_type.token_pos());
       mixin_app_class.set_super_type(mixin_super_type);
-      mixin_type_class = mixin_type.type_class();
-      const Type& generic_mixin_type = Type::Handle(zone,
-          Type::New(mixin_type_class,
-                    Object::null_type_arguments(),
-                    mixin_type.token_pos()));
+      generic_mixin_type =
+          Type::New(mixin_type_class, Object::null_type_arguments(),
+                    mixin_type.token_pos());
       mixin_app_class.set_mixin(generic_mixin_type);
       // Add the mixin type to the list of interfaces that the mixin application
       // class implements. This is necessary so that cycle check work at
       // compile time (type arguments are ignored by that check).
-      const Array& interfaces = Array::Handle(zone, Array::New(1));
+      interfaces = Array::New(1);
       interfaces.SetAt(0, generic_mixin_type);
       ASSERT(mixin_app_class.interfaces() == Object::empty_array().raw());
       mixin_app_class.set_interfaces(interfaces);
@@ -2870,8 +2887,7 @@
     // This mixin application class becomes the type class of the super type of
     // the next mixin application class. It is however too early to provide the
     // correct super type arguments. We use the raw type for now.
-    mixin_super_type = Type::New(mixin_app_class,
-                                 Object::null_type_arguments(),
+    mixin_super_type = Type::New(mixin_app_class, Object::null_type_arguments(),
                                  mixin_type.token_pos());
   }
   TypeArguments& mixin_app_args = TypeArguments::Handle(zone);
@@ -2905,7 +2921,8 @@
 // graph. If we visit an interface a second time on a given path,
 // we found a loop.
 void ClassFinalizer::ResolveSuperTypeAndInterfaces(
-    const Class& cls, GrowableArray<intptr_t>* visited) {
+    const Class& cls,
+    GrowableArray<intptr_t>* visited) {
   if (cls.is_cycle_free()) {
     return;
   }
@@ -2919,8 +2936,7 @@
     if ((*visited)[i] == cls_index) {
       // We have already visited class 'cls'. We found a cycle.
       const String& class_name = String::Handle(zone, cls.Name());
-      ReportError(cls, cls.token_pos(),
-                  "cyclic reference found for class '%s'",
+      ReportError(cls, cls.token_pos(), "cyclic reference found for class '%s'",
                   class_name.ToCString());
     }
   }
@@ -2960,8 +2976,7 @@
     ReportError(Error::Handle(zone, super_type.error()));
   }
   if (super_type.IsDynamicType()) {
-    ReportError(cls, cls.token_pos(),
-                "class '%s' may not extend 'dynamic'",
+    ReportError(cls, cls.token_pos(), "class '%s' may not extend 'dynamic'",
                 String::Handle(zone, cls.Name()).ToCString());
   }
   interface_class = super_type.type_class();
@@ -2969,12 +2984,10 @@
     ReportError(cls, cls.token_pos(),
                 "class '%s' may not extend function type alias '%s'",
                 String::Handle(zone, cls.Name()).ToCString(),
-                String::Handle(zone,
-                               super_type.UserVisibleName()).ToCString());
+                String::Handle(zone, super_type.UserVisibleName()).ToCString());
   }
   if (interface_class.is_enum_class()) {
-    ReportError(cls, cls.token_pos(),
-                "class '%s' may not extend enum '%s'",
+    ReportError(cls, cls.token_pos(), "class '%s' may not extend enum '%s'",
                 String::Handle(zone, cls.Name()).ToCString(),
                 String::Handle(zone, interface_class.Name()).ToCString());
   }
@@ -3001,10 +3014,10 @@
       case kImmutableArrayCid:
       case kGrowableObjectArrayCid:
 #define DO_NOT_EXTEND_TYPED_DATA_CLASSES(clazz)                                \
-      case kTypedData##clazz##Cid:                                             \
-      case kTypedData##clazz##ViewCid:                                         \
-      case kExternalTypedData##clazz##Cid:
-      CLASS_LIST_TYPED_DATA(DO_NOT_EXTEND_TYPED_DATA_CLASSES)
+  case kTypedData##clazz##Cid:                                                 \
+  case kTypedData##clazz##ViewCid:                                             \
+  case kExternalTypedData##clazz##Cid:
+        CLASS_LIST_TYPED_DATA(DO_NOT_EXTEND_TYPED_DATA_CLASSES)
 #undef DO_NOT_EXTEND_TYPED_DATA_CLASSES
       case kByteDataViewCid:
       case kWeakPropertyCid:
@@ -3012,8 +3025,7 @@
         break;
       default: {
         // Special case: classes for which we don't have a known class id.
-        if (super_type.IsDoubleType() ||
-            super_type.IsIntType() ||
+        if (super_type.IsDoubleType() || super_type.IsIntType() ||
             super_type.IsStringType()) {
           is_error = true;
         }
@@ -3021,10 +3033,9 @@
       }
     }
     if (is_error) {
-      const String& interface_name = String::Handle(zone,
-                                                    interface_class.Name());
-      ReportError(cls, cls.token_pos(),
-                  "'%s' is not allowed to extend '%s'",
+      const String& interface_name =
+          String::Handle(zone, interface_class.Name());
+      ReportError(cls, cls.token_pos(), "'%s' is not allowed to extend '%s'",
                   String::Handle(zone, cls.Name()).ToCString(),
                   interface_name.ToCString());
     }
@@ -3047,15 +3058,15 @@
     }
     interface_class = interface.type_class();
     if (interface_class.IsTypedefClass()) {
-      const String& interface_name = String::Handle(zone,
-                                                    interface_class.Name());
+      const String& interface_name =
+          String::Handle(zone, interface_class.Name());
       ReportError(cls, cls.token_pos(),
                   "function type alias '%s' may not be used as interface",
                   interface_name.ToCString());
     }
     if (interface_class.is_enum_class()) {
-      const String& interface_name = String::Handle(zone,
-                                                    interface_class.Name());
+      const String& interface_name =
+          String::Handle(zone, interface_class.Name());
       ReportError(cls, cls.token_pos(),
                   "enum '%s' may not be used as interface",
                   interface_name.ToCString());
@@ -3063,18 +3074,14 @@
     // Verify that unless cls belongs to core lib, it cannot extend, implement,
     // or mixin any of Null, bool, num, int, double, String, dynamic.
     if (!cls_belongs_to_core_lib) {
-      if (interface.IsBoolType() ||
-          interface.IsNullType() ||
-          interface.IsNumberType() ||
-          interface.IsIntType() ||
-          interface.IsDoubleType() ||
-          interface.IsStringType() ||
+      if (interface.IsBoolType() || interface.IsNullType() ||
+          interface.IsNumberType() || interface.IsIntType() ||
+          interface.IsDoubleType() || interface.IsStringType() ||
           interface.IsDynamicType()) {
-        const String& interface_name = String::Handle(zone,
-                                                      interface_class.Name());
+        const String& interface_name =
+            String::Handle(zone, interface_class.Name());
         if (cls.IsMixinApplication()) {
-          ReportError(cls, cls.token_pos(),
-                      "illegal mixin of '%s'",
+          ReportError(cls, cls.token_pos(), "illegal mixin of '%s'",
                       interface_name.ToCString());
         } else {
           ReportError(cls, cls.token_pos(),
@@ -3121,8 +3128,7 @@
   THR_Print("class '%s'", class_name.ToCString());
   const Library& library = Library::Handle(cls.library());
   if (!library.IsNull()) {
-    THR_Print(" library '%s%s':\n",
-              String::Handle(library.url()).ToCString(),
+    THR_Print(" library '%s%s':\n", String::Handle(library.url()).ToCString(),
               String::Handle(library.private_key()).ToCString());
   } else {
     THR_Print(" (null library):\n");
@@ -3167,11 +3173,9 @@
                                        const Type& type,
                                        const char* format,
                                        va_list args) {
-  LanguageError& error = LanguageError::Handle(
-      LanguageError::NewFormattedV(
-          prev_error, script, type.token_pos(), Report::AtLocation,
-          Report::kMalformedType, Heap::kOld,
-          format, args));
+  LanguageError& error = LanguageError::Handle(LanguageError::NewFormattedV(
+      prev_error, script, type.token_pos(), Report::AtLocation,
+      Report::kMalformedType, Heap::kOld, format, args));
   if (Isolate::Current()->error_on_bad_type()) {
     ReportError(error);
   }
@@ -3194,13 +3198,13 @@
 RawType* ClassFinalizer::NewFinalizedMalformedType(const Error& prev_error,
                                                    const Script& script,
                                                    TokenPosition type_pos,
-                                                   const char* format, ...) {
+                                                   const char* format,
+                                                   ...) {
   va_list args;
   va_start(args, format);
-  const UnresolvedClass& unresolved_class = UnresolvedClass::Handle(
-      UnresolvedClass::New(LibraryPrefix::Handle(),
-                           Symbols::Empty(),
-                           type_pos));
+  const UnresolvedClass& unresolved_class =
+      UnresolvedClass::Handle(UnresolvedClass::New(LibraryPrefix::Handle(),
+                                                   Symbols::Empty(), type_pos));
   const Type& type = Type::Handle(
       Type::New(unresolved_class, TypeArguments::Handle(), type_pos));
   MarkTypeMalformed(prev_error, script, type, format, args);
@@ -3214,7 +3218,8 @@
 void ClassFinalizer::FinalizeMalformedType(const Error& prev_error,
                                            const Script& script,
                                            const Type& type,
-                                           const char* format, ...) {
+                                           const char* format,
+                                           ...) {
   va_list args;
   va_start(args, format);
   MarkTypeMalformed(prev_error, script, type, format, args);
@@ -3225,14 +3230,13 @@
 void ClassFinalizer::FinalizeMalboundedType(const Error& prev_error,
                                             const Script& script,
                                             const AbstractType& type,
-                                            const char* format, ...) {
+                                            const char* format,
+                                            ...) {
   va_list args;
   va_start(args, format);
-  LanguageError& error = LanguageError::Handle(
-      LanguageError::NewFormattedV(
-          prev_error, script, type.token_pos(), Report::AtLocation,
-          Report::kMalboundedType, Heap::kOld,
-          format, args));
+  LanguageError& error = LanguageError::Handle(LanguageError::NewFormattedV(
+      prev_error, script, type.token_pos(), Report::AtLocation,
+      Report::kMalboundedType, Heap::kOld, format, args));
   va_end(args);
   if (Isolate::Current()->error_on_bad_type()) {
     ReportError(error);
@@ -3254,7 +3258,8 @@
 void ClassFinalizer::ReportErrors(const Error& prev_error,
                                   const Class& cls,
                                   TokenPosition token_pos,
-                                  const char* format, ...) {
+                                  const char* format,
+                                  ...) {
   va_list args;
   va_start(args, format);
   const Script& script = Script::Handle(cls.script());
@@ -3266,12 +3271,13 @@
 
 void ClassFinalizer::ReportError(const Class& cls,
                                  TokenPosition token_pos,
-                                 const char* format, ...) {
+                                 const char* format,
+                                 ...) {
   va_list args;
   va_start(args, format);
   const Script& script = Script::Handle(cls.script());
-  Report::MessageV(Report::kError,
-                   script, token_pos, Report::AtLocation, format, args);
+  Report::MessageV(Report::kError, script, token_pos, Report::AtLocation,
+                   format, args);
   va_end(args);
   UNREACHABLE();
 }
@@ -3292,8 +3298,7 @@
 
   // First verify field offsets of all the TypedDataView classes.
   for (intptr_t cid = kTypedDataInt8ArrayViewCid;
-       cid <= kTypedDataFloat32x4ArrayViewCid;
-       cid++) {
+       cid <= kTypedDataFloat32x4ArrayViewCid; cid++) {
     cls = class_table.At(cid);  // Get the TypedDataView class.
     error = cls.EnsureIsFinalized(thread);
     ASSERT(error.IsNull());
diff --git a/runtime/vm/class_finalizer.h b/runtime/vm/class_finalizer.h
index 81850f6..f30f7a5 100644
--- a/runtime/vm/class_finalizer.h
+++ b/runtime/vm/class_finalizer.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_CLASS_FINALIZER_H_
-#define VM_CLASS_FINALIZER_H_
+#ifndef RUNTIME_VM_CLASS_FINALIZER_H_
+#define RUNTIME_VM_CLASS_FINALIZER_H_
 
 #include "vm/allocation.h"
 #include "vm/growable_array.h"
@@ -19,22 +19,21 @@
 
   // Modes for type resolution and finalization. The ordering is relevant.
   enum FinalizationKind {
-    kIgnore,                   // Type is ignored and replaced by dynamic.
-    kDoNotResolve,             // Type resolution is postponed.
-    kResolveTypeParameters,    // Resolve type parameters only.
-    kFinalize,                 // Type resolution and finalization are required.
-    kCanonicalize,             // Same as kFinalize, but with canonicalization.
-    kCanonicalizeWellFormed    // Error-free resolution, finalization, and
-                               // canonicalization are required.
+    kIgnore,                 // Type is ignored and replaced by dynamic.
+    kDoNotResolve,           // Type resolution is postponed.
+    kResolveTypeParameters,  // Resolve type parameters only.
+    kFinalize,               // Type resolution and finalization are required.
+    kCanonicalize,           // Same as kFinalize, but with canonicalization.
+    kCanonicalizeWellFormed  // Error-free resolution, finalization, and
+                             // canonicalization are required.
   };
 
   // Finalize given type while parsing class cls.
   // Also canonicalize type if applicable.
-  static RawAbstractType* FinalizeType(
-      const Class& cls,
-      const AbstractType& type,
-      FinalizationKind finalization,
-      PendingTypes* pending_types = NULL);
+  static RawAbstractType* FinalizeType(const Class& cls,
+                                       const AbstractType& type,
+                                       FinalizationKind finalization,
+                                       PendingTypes* pending_types = NULL);
 
   // Allocate, finalize, and return a new malformed type as if it was declared
   // in class cls at the given token position.
@@ -43,8 +42,8 @@
   static RawType* NewFinalizedMalformedType(const Error& prev_error,
                                             const Script& script,
                                             TokenPosition type_pos,
-                                            const char* format, ...)
-       PRINTF_ATTRIBUTE(4, 5);
+                                            const char* format,
+                                            ...) PRINTF_ATTRIBUTE(4, 5);
 
   // Mark the given type as malformed.
   // If not null, prepend prev_error to the error message built from the format
@@ -52,8 +51,8 @@
   static void FinalizeMalformedType(const Error& prev_error,
                                     const Script& script,
                                     const Type& type,
-                                    const char* format, ...)
-       PRINTF_ATTRIBUTE(4, 5);
+                                    const char* format,
+                                    ...) PRINTF_ATTRIBUTE(4, 5);
 
   // Mark the given type as malbounded.
   // If not null, prepend prev_error to the error message built from the format
@@ -61,8 +60,8 @@
   static void FinalizeMalboundedType(const Error& prev_error,
                                      const Script& script,
                                      const AbstractType& type,
-                                     const char* format, ...)
-       PRINTF_ATTRIBUTE(4, 5);
+                                     const char* format,
+                                     ...) PRINTF_ATTRIBUTE(4, 5);
 
   // Return false if we still have classes pending to be finalized.
   static bool AllClassesFinalized();
@@ -71,7 +70,7 @@
   // failed. The function returns true if the processing was successful.
   // If processing fails, an error message is set in the sticky error field
   // in the object store.
-  static bool ProcessPendingClasses();
+  static bool ProcessPendingClasses(bool from_kernel = false);
 
   // Finalize the types appearing in the declaration of class 'cls', i.e. its
   // type parameters and their upper bounds, its super type and interfaces.
@@ -82,11 +81,11 @@
   // Finalize the class including its fields and functions.
   static void FinalizeClass(const Class& cls);
 
-#if defined(DART_NO_SNAPSHOT)
+#if !defined(DART_PRECOMPILED_RUNTIME)
   // Verify that the classes have been properly prefinalized. This is
   // needed during bootstrapping where the classes have been preloaded.
   static void VerifyBootstrapClasses();
-#endif  // defined(DART_NO_SNAPSHOT).
+#endif  // !defined(DART_PRECOMPILED_RUNTIME)
 
   // Resolve the class of the type, but not the type's type arguments.
   // May promote the type to function type by setting its signature field.
@@ -156,8 +155,8 @@
   static void FinalizeSignature(const Class& cls, const Function& function);
   static void ResolveAndFinalizeMemberTypes(const Class& cls);
   static void PrintClassInformation(const Class& cls);
-  static void CollectInterfaces(
-      const Class& cls, GrowableArray<const Class*>* collected);
+  static void CollectInterfaces(const Class& cls,
+                                GrowableArray<const Class*>* collected);
 
   static void MarkTypeMalformed(const Error& prev_error,
                                 const Script& script,
@@ -167,11 +166,13 @@
   static void ReportError(const Error& error);
   static void ReportError(const Class& cls,
                           TokenPosition token_pos,
-                          const char* format, ...) PRINTF_ATTRIBUTE(3, 4);
+                          const char* format,
+                          ...) PRINTF_ATTRIBUTE(3, 4);
   static void ReportErrors(const Error& prev_error,
                            const Class& cls,
                            TokenPosition token_pos,
-                           const char* format, ...) PRINTF_ATTRIBUTE(4, 5);
+                           const char* format,
+                           ...) PRINTF_ATTRIBUTE(4, 5);
 
   // Verify implicit offsets recorded in the VM for direct access to fields of
   // Dart instances (e.g: _TypedListView, _ByteDataView).
@@ -180,4 +181,4 @@
 
 }  // namespace dart
 
-#endif  // VM_CLASS_FINALIZER_H_
+#endif  // RUNTIME_VM_CLASS_FINALIZER_H_
diff --git a/runtime/vm/class_finalizer_test.cc b/runtime/vm/class_finalizer_test.cc
index 8de73e5..d2acc4a 100644
--- a/runtime/vm/class_finalizer_test.cc
+++ b/runtime/vm/class_finalizer_test.cc
@@ -11,12 +11,11 @@
 
 
 static RawClass* CreateTestClass(const char* name) {
-  const String& class_name = String::Handle(Symbols::New(Thread::Current(),
-                                                         name));
+  const String& class_name =
+      String::Handle(Symbols::New(Thread::Current(), name));
   const Script& script = Script::Handle();
-  const Class& cls = Class::Handle(
-      Class::New(Library::Handle(), class_name, script,
-                 TokenPosition::kNoSource));
+  const Class& cls = Class::Handle(Class::New(
+      Library::Handle(), class_name, script, TokenPosition::kNoSource));
   cls.set_interfaces(Object::empty_array());
   cls.SetFunctions(Object::empty_array());
   cls.SetFields(Object::empty_array());
@@ -95,15 +94,13 @@
   lib.AddClass(rhb);
   lib.AddClass(sbb);
   const String& superclass_name = String::Handle(sbb.Name());
-  const UnresolvedClass& unresolved = UnresolvedClass::Handle(
-      UnresolvedClass::New(LibraryPrefix::Handle(),
-                           superclass_name,
-                           TokenPosition::kNoSource));
+  const UnresolvedClass& unresolved =
+      UnresolvedClass::Handle(UnresolvedClass::New(
+          LibraryPrefix::Handle(), superclass_name, TokenPosition::kNoSource));
   const TypeArguments& type_arguments = TypeArguments::Handle();
-  rhb.set_super_type(Type::Handle(
-      Type::New(Object::Handle(unresolved.raw()),
-                type_arguments,
-                TokenPosition::kNoSource)));
+  rhb.set_super_type(
+      Type::Handle(Type::New(Object::Handle(unresolved.raw()), type_arguments,
+                             TokenPosition::kNoSource)));
   EXPECT(ClassFinalizer::ProcessPendingClasses());
 }
 
diff --git a/runtime/vm/class_table.cc b/runtime/vm/class_table.cc
index 989bf9c..4ceeb60 100644
--- a/runtime/vm/class_table.cc
+++ b/runtime/vm/class_table.cc
@@ -18,7 +18,9 @@
 DEFINE_FLAG(bool, print_class_table, false, "Print initial class table.");
 
 ClassTable::ClassTable()
-    : top_(kNumPredefinedCids), capacity_(0), table_(NULL),
+    : top_(kNumPredefinedCids),
+      capacity_(0),
+      table_(NULL),
       old_tables_(new MallocGrowableArray<RawClass**>()) {
   NOT_IN_PRODUCT(class_heap_stats_table_ = NULL);
   NOT_IN_PRODUCT(predefined_class_heap_stats_table_ = NULL);
@@ -50,7 +52,7 @@
   }
 #ifndef PRODUCT
   predefined_class_heap_stats_table_ = reinterpret_cast<ClassHeapStats*>(
-        calloc(kNumPredefinedCids, sizeof(ClassHeapStats)));  // NOLINT
+      calloc(kNumPredefinedCids, sizeof(ClassHeapStats)));  // NOLINT
   for (intptr_t i = 0; i < kNumPredefinedCids; i++) {
     predefined_class_heap_stats_table_[i].Initialize();
   }
@@ -122,8 +124,8 @@
     // Add the vtable for this predefined class into the static vtable registry
     // if it has not been setup yet.
     cpp_vtable cls_vtable = cls.handle_vtable();
-    AtomicOperations::CompareAndSwapWord(
-        &(Object::builtin_vtables_[index]), 0, cls_vtable);
+    AtomicOperations::CompareAndSwapWord(&(Object::builtin_vtables_[index]), 0,
+                                         cls_vtable);
     ASSERT(Object::builtin_vtables_[index] == cls_vtable);
   } else {
     if (top_ == capacity_) {
@@ -436,10 +438,8 @@
 
 
 ClassHeapStats* ClassTable::StatsWithUpdatedSize(intptr_t cid) {
-  if (!HasValidClassAt(cid) ||
-      (cid == kFreeListElement) ||
-      (cid == kForwardingCorpse) ||
-      (cid == kSmiCid)) {
+  if (!HasValidClassAt(cid) || (cid == kFreeListElement) ||
+      (cid == kForwardingCorpse) || (cid == kSmiCid)) {
     return NULL;
   }
   Class& cls = Class::Handle(At(cid));
@@ -487,16 +487,15 @@
 
 
 ClassHeapStats** ClassTable::TableAddressFor(intptr_t cid) {
-  return (cid < kNumPredefinedCids)
-      ? &predefined_class_heap_stats_table_
-      : &class_heap_stats_table_;
+  return (cid < kNumPredefinedCids) ? &predefined_class_heap_stats_table_
+                                    : &class_heap_stats_table_;
 }
 
 
 intptr_t ClassTable::TableOffsetFor(intptr_t cid) {
   return (cid < kNumPredefinedCids)
-      ? OFFSET_OF(ClassTable, predefined_class_heap_stats_table_)
-      : OFFSET_OF(ClassTable, class_heap_stats_table_);
+             ? OFFSET_OF(ClassTable, predefined_class_heap_stats_table_)
+             : OFFSET_OF(ClassTable, class_heap_stats_table_);
 }
 
 
@@ -507,9 +506,9 @@
 
 intptr_t ClassTable::CounterOffsetFor(intptr_t cid, bool is_new_space) {
   const intptr_t class_offset = ClassOffsetFor(cid);
-  const intptr_t count_field_offset = is_new_space
-      ? ClassHeapStats::allocated_since_gc_new_space_offset()
-      : ClassHeapStats::allocated_since_gc_old_space_offset();
+  const intptr_t count_field_offset =
+      is_new_space ? ClassHeapStats::allocated_since_gc_new_space_offset()
+                   : ClassHeapStats::allocated_since_gc_old_space_offset();
   return class_offset + count_field_offset;
 }
 
@@ -521,9 +520,9 @@
 
 intptr_t ClassTable::SizeOffsetFor(intptr_t cid, bool is_new_space) {
   const uword class_offset = ClassOffsetFor(cid);
-  const uword size_field_offset = is_new_space
-      ? ClassHeapStats::allocated_size_since_gc_new_space_offset()
-      : ClassHeapStats::allocated_size_since_gc_old_space_offset();
+  const uword size_field_offset =
+      is_new_space ? ClassHeapStats::allocated_size_since_gc_new_space_offset()
+                   : ClassHeapStats::allocated_size_since_gc_old_space_offset();
   return class_offset + size_field_offset;
 }
 
@@ -540,25 +539,18 @@
   obj.AddProperty("type", "AllocationProfile");
   if (isolate->last_allocationprofile_accumulator_reset_timestamp() != 0) {
     obj.AddPropertyF(
-        "dateLastAccumulatorReset",
-        "%" Pd64 "",
+        "dateLastAccumulatorReset", "%" Pd64 "",
         isolate->last_allocationprofile_accumulator_reset_timestamp());
   }
   if (isolate->last_allocationprofile_gc_timestamp() != 0) {
-    obj.AddPropertyF(
-        "dateLastServiceGC",
-        "%" Pd64 "",
-        isolate->last_allocationprofile_gc_timestamp());
+    obj.AddPropertyF("dateLastServiceGC", "%" Pd64 "",
+                     isolate->last_allocationprofile_gc_timestamp());
   }
 
   {
     JSONObject heaps(&obj, "heaps");
-    {
-      heap->PrintToJSONObject(Heap::kNew, &heaps);
-    }
-    {
-      heap->PrintToJSONObject(Heap::kOld, &heaps);
-    }
+    { heap->PrintToJSONObject(Heap::kNew, &heaps); }
+    { heap->PrintToJSONObject(Heap::kOld, &heaps); }
   }
   {
     JSONArray arr(&obj, "members");
diff --git a/runtime/vm/class_table.h b/runtime/vm/class_table.h
index 1ab7da1..b1721ed 100644
--- a/runtime/vm/class_table.h
+++ b/runtime/vm/class_table.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_CLASS_TABLE_H_
-#define VM_CLASS_TABLE_H_
+#ifndef RUNTIME_VM_CLASS_TABLE_H_
+#define RUNTIME_VM_CLASS_TABLE_H_
 
 #include "platform/assert.h"
 #include "vm/bitfield.h"
@@ -16,12 +16,13 @@
 class JSONArray;
 class JSONObject;
 class JSONStream;
-template<typename T> class MallocGrowableArray;
+template <typename T>
+class MallocGrowableArray;
 class ObjectPointerVisitor;
 class RawClass;
 
 #ifndef PRODUCT
-template<typename T>
+template <typename T>
 class AllocStats {
  public:
   T new_count;
@@ -104,12 +105,8 @@
     return OFFSET_OF(ClassHeapStats, recent) +
            OFFSET_OF(AllocStats<intptr_t>, old_size);
   }
-  static intptr_t state_offset() {
-    return OFFSET_OF(ClassHeapStats, state_);
-  }
-  static intptr_t TraceAllocationMask() {
-    return (1 << kTraceAllocationBit);
-  }
+  static intptr_t state_offset() { return OFFSET_OF(ClassHeapStats, state_); }
+  static intptr_t TraceAllocationMask() { return (1 << kTraceAllocationBit); }
 
   void Initialize();
   void ResetAtNewGC();
@@ -122,9 +119,7 @@
 #endif
   void Verify();
 
-  bool trace_allocation() const {
-    return TraceAllocationBit::decode(state_);
-  }
+  bool trace_allocation() const { return TraceAllocationBit::decode(state_); }
 
   void set_trace_allocation(bool trace_allocation) {
     state_ = TraceAllocationBit::update(trace_allocation, state_);
@@ -135,8 +130,8 @@
     kTraceAllocationBit = 0,
   };
 
-  class TraceAllocationBit :
-      public BitField<intptr_t, bool, kTraceAllocationBit, 1> {};
+  class TraceAllocationBit
+      : public BitField<intptr_t, bool, kTraceAllocationBit, 1> {};
 
   // Recent old at start of last new GC (used to compute promoted_*).
   intptr_t old_pre_new_gc_count_;
@@ -160,9 +155,7 @@
     return table_[index];
   }
 
-  void SetAt(intptr_t index, RawClass* raw_cls) {
-    table_[index] = raw_cls;
-  }
+  void SetAt(intptr_t index, RawClass* raw_cls) { table_[index] = raw_cls; }
 
   bool IsValidIndex(intptr_t index) const {
     return (index > 0) && (index < top_);
@@ -202,9 +195,7 @@
   void Print();
 
   // Used by the generated code.
-  static intptr_t table_offset() {
-    return OFFSET_OF(ClassTable, table_);
-  }
+  static intptr_t table_offset() { return OFFSET_OF(ClassTable, table_); }
 
   // Used by the generated code.
   static intptr_t ClassOffsetFor(intptr_t cid);
@@ -280,4 +271,4 @@
 
 }  // namespace dart
 
-#endif  // VM_CLASS_TABLE_H_
+#endif  // RUNTIME_VM_CLASS_TABLE_H_
diff --git a/runtime/vm/clustered_snapshot.cc b/runtime/vm/clustered_snapshot.cc
index 3b1f79e..e561a54 100644
--- a/runtime/vm/clustered_snapshot.cc
+++ b/runtime/vm/clustered_snapshot.cc
@@ -25,10 +25,10 @@
 
 static RawObject* AllocateUninitialized(PageSpace* old_space, intptr_t size) {
   ASSERT(Utils::IsAligned(size, kObjectAlignment));
-  uword address = old_space->TryAllocateDataBumpLocked(size,
-                                                       PageSpace::kForceGrowth);
+  uword address =
+      old_space->TryAllocateDataBumpLocked(size, PageSpace::kForceGrowth);
   if (address == 0) {
-    FATAL("Out of memory");
+    OUT_OF_MEMORY();
   }
   return reinterpret_cast<RawObject*>(address + kHeapObjectTag);
 }
@@ -52,9 +52,9 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class ClassSerializationCluster : public SerializationCluster {
  public:
-  explicit ClassSerializationCluster(intptr_t num_cids) :
-      predefined_(kNumPredefinedCids), objects_(num_cids) { }
-  virtual ~ClassSerializationCluster() { }
+  explicit ClassSerializationCluster(intptr_t num_cids)
+      : predefined_(kNumPredefinedCids), objects_(num_cids) {}
+  virtual ~ClassSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawClass* cls = Class::RawCast(object);
@@ -134,8 +134,8 @@
 
 class ClassDeserializationCluster : public DeserializationCluster {
  public:
-  ClassDeserializationCluster() { }
-  virtual ~ClassDeserializationCluster() { }
+  ClassDeserializationCluster() {}
+  virtual ~ClassDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     predefined_start_index_ = d->next_index();
@@ -154,8 +154,7 @@
     start_index_ = d->next_index();
     count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         Class::InstanceSize()));
+      d->AssignRef(AllocateUninitialized(old_space, Class::InstanceSize()));
     }
     stop_index_ = d->next_index();
   }
@@ -165,8 +164,7 @@
     bool is_vm_object = d->isolate() == Dart::vm_isolate();
     ClassTable* table = d->isolate()->class_table();
 
-    for (intptr_t id = predefined_start_index_;
-         id < predefined_stop_index_;
+    for (intptr_t id = predefined_start_index_; id < predefined_stop_index_;
          id++) {
       RawClass* cls = reinterpret_cast<RawClass*>(d->Ref(id));
       RawObject** from = cls->from();
@@ -228,12 +226,11 @@
   }
 
   void PostLoad(const Array& refs, Snapshot::Kind kind, Zone* zone) {
-    NOT_IN_PRODUCT(TimelineDurationScope tds(Thread::Current(),
-        Timeline::GetIsolateStream(), "PostLoadClass"));
+    NOT_IN_PRODUCT(TimelineDurationScope tds(
+        Thread::Current(), Timeline::GetIsolateStream(), "PostLoadClass"));
 
     Class& cls = Class::Handle(zone);
-    for (intptr_t i = predefined_start_index_;
-         i < predefined_stop_index_;
+    for (intptr_t i = predefined_start_index_; i < predefined_stop_index_;
          i++) {
       cls ^= refs.At(i);
       cls.RehashConstants(zone);
@@ -253,8 +250,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class UnresolvedClassSerializationCluster : public SerializationCluster {
  public:
-  UnresolvedClassSerializationCluster() { }
-  virtual ~UnresolvedClassSerializationCluster() { }
+  UnresolvedClassSerializationCluster() {}
+  virtual ~UnresolvedClassSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawUnresolvedClass* cls = UnresolvedClass::RawCast(object);
@@ -299,16 +296,16 @@
 
 class UnresolvedClassDeserializationCluster : public DeserializationCluster {
  public:
-  UnresolvedClassDeserializationCluster() { }
-  virtual ~UnresolvedClassDeserializationCluster() { }
+  UnresolvedClassDeserializationCluster() {}
+  virtual ~UnresolvedClassDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
     PageSpace* old_space = d->heap()->old_space();
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         UnresolvedClass::InstanceSize()));
+      d->AssignRef(
+          AllocateUninitialized(old_space, UnresolvedClass::InstanceSize()));
     }
     stop_index_ = d->next_index();
   }
@@ -336,8 +333,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class TypeArgumentsSerializationCluster : public SerializationCluster {
  public:
-  TypeArgumentsSerializationCluster() { }
-  virtual ~TypeArgumentsSerializationCluster() { }
+  TypeArgumentsSerializationCluster() {}
+  virtual ~TypeArgumentsSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawTypeArguments* type_args = TypeArguments::RawCast(object);
@@ -386,8 +383,8 @@
 
 class TypeArgumentsDeserializationCluster : public DeserializationCluster {
  public:
-  TypeArgumentsDeserializationCluster() { }
-  virtual ~TypeArgumentsDeserializationCluster() { }
+  TypeArgumentsDeserializationCluster() {}
+  virtual ~TypeArgumentsDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
@@ -428,8 +425,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class PatchClassSerializationCluster : public SerializationCluster {
  public:
-  PatchClassSerializationCluster() { }
-  virtual ~PatchClassSerializationCluster() { }
+  PatchClassSerializationCluster() {}
+  virtual ~PatchClassSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawPatchClass* cls = PatchClass::RawCast(object);
@@ -472,16 +469,16 @@
 
 class PatchClassDeserializationCluster : public DeserializationCluster {
  public:
-  PatchClassDeserializationCluster() { }
-  virtual ~PatchClassDeserializationCluster() { }
+  PatchClassDeserializationCluster() {}
+  virtual ~PatchClassDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
     PageSpace* old_space = d->heap()->old_space();
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         PatchClass::InstanceSize()));
+      d->AssignRef(
+          AllocateUninitialized(old_space, PatchClass::InstanceSize()));
     }
     stop_index_ = d->next_index();
   }
@@ -506,8 +503,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class FunctionSerializationCluster : public SerializationCluster {
  public:
-  FunctionSerializationCluster() { }
-  virtual ~FunctionSerializationCluster() { }
+  FunctionSerializationCluster() {}
+  virtual ~FunctionSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawFunction* func = Function::RawCast(object);
@@ -522,6 +519,7 @@
       s->Push(func->ptr()->code_);
     } else if (s->kind() == Snapshot::kAppWithJIT) {
       NOT_IN_PRECOMPILED(s->Push(func->ptr()->unoptimized_code_));
+      s->Push(func->ptr()->code_);
       s->Push(func->ptr()->ic_data_array_);
     }
   }
@@ -550,6 +548,7 @@
         s->WriteRef(func->ptr()->code_);
       } else if (s->kind() == Snapshot::kAppWithJIT) {
         NOT_IN_PRECOMPILED(s->WriteRef(func->ptr()->unoptimized_code_));
+        s->WriteRef(func->ptr()->code_);
         s->WriteRef(func->ptr()->ic_data_array_);
       }
 
@@ -564,7 +563,7 @@
       s->Write<uint32_t>(func->ptr()->kind_tag_);
       if (kind == Snapshot::kAppNoJIT) {
         // Omit fields used to support de/reoptimization.
-      } else {
+      } else if (!Snapshot::IncludesCode(kind)) {
 #if !defined(DART_PRECOMPILED_RUNTIME)
         bool is_optimized = Code::IsOptimized(func->ptr()->code_);
         if (is_optimized) {
@@ -572,9 +571,6 @@
         } else {
           s->Write<int32_t>(0);
         }
-        s->Write<int8_t>(func->ptr()->deoptimization_counter_);
-        s->Write<uint16_t>(func->ptr()->optimized_instruction_count_);
-        s->Write<uint16_t>(func->ptr()->optimized_call_site_count_);
 #endif
       }
     }
@@ -588,16 +584,15 @@
 
 class FunctionDeserializationCluster : public DeserializationCluster {
  public:
-  FunctionDeserializationCluster() { }
-  virtual ~FunctionDeserializationCluster() { }
+  FunctionDeserializationCluster() {}
+  virtual ~FunctionDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
     PageSpace* old_space = d->heap()->old_space();
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         Function::InstanceSize()));
+      d->AssignRef(AllocateUninitialized(old_space, Function::InstanceSize()));
     }
     stop_index_ = d->next_index();
   }
@@ -623,7 +618,8 @@
         func->ptr()->code_ = reinterpret_cast<RawCode*>(d->ReadRef());
       } else if (kind == Snapshot::kAppWithJIT) {
         NOT_IN_PRECOMPILED(func->ptr()->unoptimized_code_ =
-            reinterpret_cast<RawCode*>(d->ReadRef()));
+                               reinterpret_cast<RawCode*>(d->ReadRef()));
+        func->ptr()->code_ = reinterpret_cast<RawCode*>(d->ReadRef());
         func->ptr()->ic_data_array_ = reinterpret_cast<RawArray*>(d->ReadRef());
       }
 
@@ -644,18 +640,22 @@
         // Omit fields used to support de/reoptimization.
       } else {
 #if !defined(DART_PRECOMPILED_RUNTIME)
-        func->ptr()->usage_counter_ = d->Read<int32_t>();
-        func->ptr()->deoptimization_counter_ = d->Read<int8_t>();
-        func->ptr()->optimized_instruction_count_ = d->Read<uint16_t>();
-        func->ptr()->optimized_call_site_count_ = d->Read<uint16_t>();
+        if (Snapshot::IncludesCode(kind)) {
+          func->ptr()->usage_counter_ = 0;
+        } else {
+          func->ptr()->usage_counter_ = d->Read<int32_t>();
+        }
+        func->ptr()->deoptimization_counter_ = 0;
+        func->ptr()->optimized_instruction_count_ = 0;
+        func->ptr()->optimized_call_site_count_ = 0;
 #endif
       }
     }
   }
 
   void PostLoad(const Array& refs, Snapshot::Kind kind, Zone* zone) {
-    NOT_IN_PRODUCT(TimelineDurationScope tds(Thread::Current(),
-        Timeline::GetIsolateStream(), "PostLoadFunction"));
+    NOT_IN_PRODUCT(TimelineDurationScope tds(
+        Thread::Current(), Timeline::GetIsolateStream(), "PostLoadFunction"));
 
     if (kind == Snapshot::kAppNoJIT) {
       Function& func = Function::Handle(zone);
@@ -671,8 +671,8 @@
       Code& code = Code::Handle(zone);
       for (intptr_t i = start_index_; i < stop_index_; i++) {
         func ^= refs.At(i);
-        code ^= func.unoptimized_code();
-        if (!code.IsNull()) {
+        code ^= func.CurrentCode();
+        if (func.HasCode() && !code.IsDisabled()) {
           func.SetInstructions(code);
           func.set_was_compiled(true);
         } else {
@@ -696,8 +696,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class ClosureDataSerializationCluster : public SerializationCluster {
  public:
-  ClosureDataSerializationCluster() { }
-  virtual ~ClosureDataSerializationCluster() { }
+  ClosureDataSerializationCluster() {}
+  virtual ~ClosureDataSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawClosureData* data = ClosureData::RawCast(object);
@@ -742,16 +742,16 @@
 
 class ClosureDataDeserializationCluster : public DeserializationCluster {
  public:
-  ClosureDataDeserializationCluster() { }
-  virtual ~ClosureDataDeserializationCluster() { }
+  ClosureDataDeserializationCluster() {}
+  virtual ~ClosureDataDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
     PageSpace* old_space = d->heap()->old_space();
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         ClosureData::InstanceSize()));
+      d->AssignRef(
+          AllocateUninitialized(old_space, ClosureData::InstanceSize()));
     }
     stop_index_ = d->next_index();
   }
@@ -762,8 +762,7 @@
     for (intptr_t id = start_index_; id < stop_index_; id++) {
       RawClosureData* data = reinterpret_cast<RawClosureData*>(d->Ref(id));
       Deserializer::InitializeHeader(data, kClosureDataCid,
-                                     ClosureData::InstanceSize(),
-                                     is_vm_object);
+                                     ClosureData::InstanceSize(), is_vm_object);
       if (d->kind() == Snapshot::kAppNoJIT) {
         data->ptr()->context_scope_ = ContextScope::null();
       } else {
@@ -781,8 +780,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class RedirectionDataSerializationCluster : public SerializationCluster {
  public:
-  RedirectionDataSerializationCluster() { }
-  virtual ~RedirectionDataSerializationCluster() { }
+  RedirectionDataSerializationCluster() {}
+  virtual ~RedirectionDataSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawRedirectionData* data = RedirectionData::RawCast(object);
@@ -825,16 +824,16 @@
 
 class RedirectionDataDeserializationCluster : public DeserializationCluster {
  public:
-  RedirectionDataDeserializationCluster() { }
-  virtual ~RedirectionDataDeserializationCluster() { }
+  RedirectionDataDeserializationCluster() {}
+  virtual ~RedirectionDataDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
     PageSpace* old_space = d->heap()->old_space();
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         RedirectionData::InstanceSize()));
+      d->AssignRef(
+          AllocateUninitialized(old_space, RedirectionData::InstanceSize()));
     }
     stop_index_ = d->next_index();
   }
@@ -861,8 +860,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class FieldSerializationCluster : public SerializationCluster {
  public:
-  FieldSerializationCluster() { }
-  virtual ~FieldSerializationCluster() { }
+  FieldSerializationCluster() {}
+  virtual ~FieldSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawField* field = Field::RawCast(object);
@@ -899,6 +898,9 @@
       // Write out the guarded list length.
       s->Push(field->ptr()->guarded_list_length_);
     }
+    if (kind == Snapshot::kAppWithJIT) {
+      s->Push(field->ptr()->dependent_code_);
+    }
   }
 
   void WriteAlloc(Serializer* s) {
@@ -946,6 +948,9 @@
         // Write out the guarded list length.
         s->WriteRef(field->ptr()->guarded_list_length_);
       }
+      if (kind == Snapshot::kAppWithJIT) {
+        s->WriteRef(field->ptr()->dependent_code_);
+      }
 
       if (kind != Snapshot::kAppNoJIT) {
         s->WriteTokenPosition(field->ptr()->token_pos_);
@@ -964,8 +969,8 @@
 
 class FieldDeserializationCluster : public DeserializationCluster {
  public:
-  FieldDeserializationCluster() { }
-  virtual ~FieldDeserializationCluster() { }
+  FieldDeserializationCluster() {}
+  virtual ~FieldDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
@@ -983,8 +988,8 @@
 
     for (intptr_t id = start_index_; id < stop_index_; id++) {
       RawField* field = reinterpret_cast<RawField*>(d->Ref(id));
-      Deserializer::InitializeHeader(field, kFieldCid,
-                                     Field::InstanceSize(), is_vm_object);
+      Deserializer::InitializeHeader(field, kFieldCid, Field::InstanceSize(),
+                                     is_vm_object);
       RawObject** from = field->from();
       RawObject** to_snapshot = field->to_snapshot(kind);
       RawObject** to = field->to();
@@ -1005,8 +1010,8 @@
   }
 
   void PostLoad(const Array& refs, Snapshot::Kind kind, Zone* zone) {
-    NOT_IN_PRODUCT(TimelineDurationScope tds(Thread::Current(),
-        Timeline::GetIsolateStream(), "PostLoadField"));
+    NOT_IN_PRODUCT(TimelineDurationScope tds(
+        Thread::Current(), Timeline::GetIsolateStream(), "PostLoadField"));
 
     Field& field = Field::Handle(zone);
     if (!FLAG_use_field_guards) {
@@ -1031,8 +1036,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class LiteralTokenSerializationCluster : public SerializationCluster {
  public:
-  LiteralTokenSerializationCluster() { }
-  virtual ~LiteralTokenSerializationCluster() { }
+  LiteralTokenSerializationCluster() {}
+  virtual ~LiteralTokenSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawLiteralToken* token = LiteralToken::RawCast(object);
@@ -1076,16 +1081,16 @@
 
 class LiteralTokenDeserializationCluster : public DeserializationCluster {
  public:
-  LiteralTokenDeserializationCluster() { }
-  virtual ~LiteralTokenDeserializationCluster() { }
+  LiteralTokenDeserializationCluster() {}
+  virtual ~LiteralTokenDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
     PageSpace* old_space = d->heap()->old_space();
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         LiteralToken::InstanceSize()));
+      d->AssignRef(
+          AllocateUninitialized(old_space, LiteralToken::InstanceSize()));
     }
     stop_index_ = d->next_index();
   }
@@ -1095,9 +1100,8 @@
 
     for (intptr_t id = start_index_; id < stop_index_; id++) {
       RawLiteralToken* token = reinterpret_cast<RawLiteralToken*>(d->Ref(id));
-      Deserializer::InitializeHeader(token, kLiteralTokenCid,
-                                     LiteralToken::InstanceSize(),
-                                     is_vm_object);
+      Deserializer::InitializeHeader(
+          token, kLiteralTokenCid, LiteralToken::InstanceSize(), is_vm_object);
       RawObject** from = token->from();
       RawObject** to = token->to();
       for (RawObject** p = from; p <= to; p++) {
@@ -1112,8 +1116,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class TokenStreamSerializationCluster : public SerializationCluster {
  public:
-  TokenStreamSerializationCluster() { }
-  virtual ~TokenStreamSerializationCluster() { }
+  TokenStreamSerializationCluster() {}
+  virtual ~TokenStreamSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawTokenStream* stream = TokenStream::RawCast(object);
@@ -1156,16 +1160,16 @@
 
 class TokenStreamDeserializationCluster : public DeserializationCluster {
  public:
-  TokenStreamDeserializationCluster() { }
-  virtual ~TokenStreamDeserializationCluster() { }
+  TokenStreamDeserializationCluster() {}
+  virtual ~TokenStreamDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
     PageSpace* old_space = d->heap()->old_space();
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         TokenStream::InstanceSize()));
+      d->AssignRef(
+          AllocateUninitialized(old_space, TokenStream::InstanceSize()));
     }
     stop_index_ = d->next_index();
   }
@@ -1190,8 +1194,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class ScriptSerializationCluster : public SerializationCluster {
  public:
-  ScriptSerializationCluster() { }
-  virtual ~ScriptSerializationCluster() { }
+  ScriptSerializationCluster() {}
+  virtual ~ScriptSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawScript* script = Script::RawCast(object);
@@ -1239,8 +1243,8 @@
 
 class ScriptDeserializationCluster : public DeserializationCluster {
  public:
-  ScriptDeserializationCluster() { }
-  virtual ~ScriptDeserializationCluster() { }
+  ScriptDeserializationCluster() {}
+  virtual ~ScriptDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
@@ -1258,8 +1262,8 @@
 
     for (intptr_t id = start_index_; id < stop_index_; id++) {
       RawScript* script = reinterpret_cast<RawScript*>(d->Ref(id));
-      Deserializer::InitializeHeader(script, kScriptCid,
-                                     Script::InstanceSize(), is_vm_object);
+      Deserializer::InitializeHeader(script, kScriptCid, Script::InstanceSize(),
+                                     is_vm_object);
       RawObject** from = script->from();
       RawObject** to_snapshot = script->to_snapshot(kind);
       RawObject** to = script->to();
@@ -1282,8 +1286,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class LibrarySerializationCluster : public SerializationCluster {
  public:
-  LibrarySerializationCluster() { }
-  virtual ~LibrarySerializationCluster() { }
+  LibrarySerializationCluster() {}
+  virtual ~LibrarySerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawLibrary* lib = Library::RawCast(object);
@@ -1333,8 +1337,8 @@
 
 class LibraryDeserializationCluster : public DeserializationCluster {
  public:
-  LibraryDeserializationCluster() { }
-  virtual ~LibraryDeserializationCluster() { }
+  LibraryDeserializationCluster() {}
+  virtual ~LibraryDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
@@ -1351,8 +1355,8 @@
 
     for (intptr_t id = start_index_; id < stop_index_; id++) {
       RawLibrary* lib = reinterpret_cast<RawLibrary*>(d->Ref(id));
-      Deserializer::InitializeHeader(lib, kLibraryCid,
-                                     Library::InstanceSize(), is_vm_object);
+      Deserializer::InitializeHeader(lib, kLibraryCid, Library::InstanceSize(),
+                                     is_vm_object);
       RawObject** from = lib->from();
       RawObject** to_snapshot = lib->to_snapshot();
       RawObject** to = lib->to();
@@ -1379,8 +1383,8 @@
     // TODO(rmacnak): This is surprisingly slow, roughly 20% of deserialization
     // time for the JIT. Maybe make the lookups happy with a null?
 
-    NOT_IN_PRODUCT(TimelineDurationScope tds(Thread::Current(),
-        Timeline::GetIsolateStream(), "PostLoadLibrary"));
+    NOT_IN_PRODUCT(TimelineDurationScope tds(
+        Thread::Current(), Timeline::GetIsolateStream(), "PostLoadLibrary"));
 
     Library& lib = Library::Handle(zone);
     for (intptr_t i = start_index_; i < stop_index_; i++) {
@@ -1395,8 +1399,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class NamespaceSerializationCluster : public SerializationCluster {
  public:
-  NamespaceSerializationCluster() { }
-  virtual ~NamespaceSerializationCluster() { }
+  NamespaceSerializationCluster() {}
+  virtual ~NamespaceSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawNamespace* ns = Namespace::RawCast(object);
@@ -1439,8 +1443,8 @@
 
 class NamespaceDeserializationCluster : public DeserializationCluster {
  public:
-  NamespaceDeserializationCluster() { }
-  virtual ~NamespaceDeserializationCluster() { }
+  NamespaceDeserializationCluster() {}
+  virtual ~NamespaceDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
@@ -1472,8 +1476,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class CodeSerializationCluster : public SerializationCluster {
  public:
-  CodeSerializationCluster() { }
-  virtual ~CodeSerializationCluster() { }
+  CodeSerializationCluster() {}
+  virtual ~CodeSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawCode* code = Code::RawCast(object);
@@ -1484,6 +1488,13 @@
     s->Push(code->ptr()->exception_handlers_);
     s->Push(code->ptr()->pc_descriptors_);
     s->Push(code->ptr()->stackmaps_);
+
+    if (s->kind() == Snapshot::kAppWithJIT) {
+      s->Push(code->ptr()->deopt_info_array_);
+      s->Push(code->ptr()->static_calls_target_table_);
+      NOT_IN_PRODUCT(s->Push(code->ptr()->inlined_metadata_));
+      NOT_IN_PRODUCT(s->Push(code->ptr()->return_address_metadata_));
+    }
   }
 
   void WriteAlloc(Serializer* s) {
@@ -1509,23 +1520,21 @@
       }
       if (kind == Snapshot::kAppNoJIT) {
         // No disabled code in precompilation.
-        NOT_IN_PRECOMPILED(ASSERT(
-            code->ptr()->instructions_ == code->ptr()->active_instructions_));
-      } else {
-        ASSERT(kind == Snapshot::kAppWithJIT);
-        // We never include optimized code in JIT precompilation. Deoptimization
-        // requires code patching and we cannot patch code that is shared
-        // between isolates and should not mutate memory allocated by the
-        // embedder.
-        bool is_optimized = Code::PtrOffBits::decode(code->ptr()->state_bits_);
-        if (is_optimized) {
-          FATAL("Cannot include optimized code in a JIT snapshot");
-        }
+        NOT_IN_PRECOMPILED(ASSERT(code->ptr()->instructions_ ==
+                                  code->ptr()->active_instructions_));
       }
 
       RawInstructions* instr = code->ptr()->instructions_;
       int32_t text_offset = s->GetTextOffset(instr, code);
       s->Write<int32_t>(text_offset);
+      if (s->kind() == Snapshot::kAppWithJIT) {
+        // TODO(rmacnak): Fix references to disabled code before serializing.
+        if (code->ptr()->active_instructions_ != code->ptr()->instructions_) {
+          instr = code->ptr()->active_instructions_;
+          text_offset = s->GetTextOffset(instr, code);
+        }
+        s->Write<int32_t>(text_offset);
+      }
 
       s->WriteRef(code->ptr()->object_pool_);
       s->WriteRef(code->ptr()->owner_);
@@ -1533,6 +1542,13 @@
       s->WriteRef(code->ptr()->pc_descriptors_);
       s->WriteRef(code->ptr()->stackmaps_);
 
+      if (s->kind() == Snapshot::kAppWithJIT) {
+        s->WriteRef(code->ptr()->deopt_info_array_);
+        s->WriteRef(code->ptr()->static_calls_target_table_);
+        NOT_IN_PRODUCT(s->WriteRef(code->ptr()->inlined_metadata_));
+        NOT_IN_PRODUCT(s->WriteRef(code->ptr()->return_address_metadata_));
+      }
+
       s->Write<int32_t>(code->ptr()->state_bits_);
     }
   }
@@ -1545,8 +1561,8 @@
 
 class CodeDeserializationCluster : public DeserializationCluster {
  public:
-  CodeDeserializationCluster() { }
-  virtual ~CodeDeserializationCluster() { }
+  CodeDeserializationCluster() {}
+  virtual ~CodeDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
@@ -1563,8 +1579,8 @@
 
     for (intptr_t id = start_index_; id < stop_index_; id++) {
       RawCode* code = reinterpret_cast<RawCode*>(d->Ref(id));
-      Deserializer::InitializeHeader(code, kCodeCid,
-                                     Code::InstanceSize(0), is_vm_object);
+      Deserializer::InitializeHeader(code, kCodeCid, Code::InstanceSize(0),
+                                     is_vm_object);
 
       int32_t text_offset = d->Read<int32_t>();
       RawInstructions* instr = reinterpret_cast<RawInstructions*>(
@@ -1575,6 +1591,19 @@
           Instructions::CheckedEntryPoint(instr);
       NOT_IN_PRECOMPILED(code->ptr()->active_instructions_ = instr);
       code->ptr()->instructions_ = instr;
+
+#if !defined(DART_PRECOMPILED_RUNTIME)
+      if (d->kind() == Snapshot::kAppWithJIT) {
+        int32_t text_offset = d->Read<int32_t>();
+        RawInstructions* instr = reinterpret_cast<RawInstructions*>(
+            d->GetInstructionsAt(text_offset) + kHeapObjectTag);
+        code->ptr()->active_instructions_ = instr;
+        code->ptr()->entry_point_ = Instructions::UncheckedEntryPoint(instr);
+        code->ptr()->checked_entry_point_ =
+            Instructions::CheckedEntryPoint(instr);
+      }
+#endif  // !DART_PRECOMPILED_RUNTIME
+
       code->ptr()->object_pool_ =
           reinterpret_cast<RawObjectPool*>(d->ReadRef());
       code->ptr()->owner_ = d->ReadRef();
@@ -1582,25 +1611,37 @@
           reinterpret_cast<RawExceptionHandlers*>(d->ReadRef());
       code->ptr()->pc_descriptors_ =
           reinterpret_cast<RawPcDescriptors*>(d->ReadRef());
-      code->ptr()->stackmaps_ =
-          reinterpret_cast<RawArray*>(d->ReadRef());
+      code->ptr()->stackmaps_ = reinterpret_cast<RawArray*>(d->ReadRef());
 
 #if !defined(DART_PRECOMPILED_RUNTIME)
-      code->ptr()->deopt_info_array_ = Array::null();
-      code->ptr()->static_calls_target_table_ = Array::null();
+      if (d->kind() == Snapshot::kAppWithJIT) {
+        code->ptr()->deopt_info_array_ =
+            reinterpret_cast<RawArray*>(d->ReadRef());
+        code->ptr()->static_calls_target_table_ =
+            reinterpret_cast<RawArray*>(d->ReadRef());
+#if defined(PRODUCT)
+        code->ptr()->inlined_metadata_ = Array::null();
+        code->ptr()->return_address_metadata_ = Object::null();
+#else
+        code->ptr()->inlined_metadata_ =
+            reinterpret_cast<RawArray*>(d->ReadRef());
+        code->ptr()->return_address_metadata_ = d->ReadRef();
+#endif
+      } else {
+        code->ptr()->deopt_info_array_ = Array::null();
+        code->ptr()->static_calls_target_table_ = Array::null();
+        code->ptr()->inlined_metadata_ = Array::null();
+        code->ptr()->return_address_metadata_ = Object::null();
+      }
+
       code->ptr()->var_descriptors_ = LocalVarDescriptors::null();
-      code->ptr()->inlined_metadata_ = Array::null();
       code->ptr()->code_source_map_ = CodeSourceMap::null();
       code->ptr()->comments_ = Array::null();
-      code->ptr()->return_address_metadata_ = Object::null();
 
       code->ptr()->compile_timestamp_ = 0;
-#endif
+#endif  // !DART_PRECOMPILED_RUNTIME
+
       code->ptr()->state_bits_ = d->Read<int32_t>();
-#if !defined(DART_PRECOMPILED_RUNTIME)
-      code->ptr()->lazy_deopt_return_pc_offset_ = -1;
-      code->ptr()->lazy_deopt_throw_pc_offset_ = -1;
-#endif
     }
   }
 };
@@ -1609,8 +1650,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class ObjectPoolSerializationCluster : public SerializationCluster {
  public:
-  ObjectPoolSerializationCluster() { }
-  virtual ~ObjectPoolSerializationCluster() { }
+  ObjectPoolSerializationCluster() {}
+  virtual ~ObjectPoolSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawObjectPool* pool = ObjectPool::RawCast(object);
@@ -1666,22 +1707,22 @@
               break;
             }
 #endif
-          s->WriteRef(entry.raw_obj_);
-          break;
-        }
-        case ObjectPool::kImmediate: {
-          s->Write<intptr_t>(entry.raw_value_);
-          break;
-        }
-        case ObjectPool::kNativeEntry: {
-          // Write nothing. Will initialize with the lazy link entry.
+            s->WriteRef(entry.raw_obj_);
+            break;
+          }
+          case ObjectPool::kImmediate: {
+            s->Write<intptr_t>(entry.raw_value_);
+            break;
+          }
+          case ObjectPool::kNativeEntry: {
+// Write nothing. Will initialize with the lazy link entry.
 #if defined(TARGET_ARCH_DBC)
-          UNREACHABLE();   // DBC does not support lazy native call linking.
+            UNREACHABLE();  // DBC does not support lazy native call linking.
 #endif
-          break;
-        }
-        default:
-          UNREACHABLE();
+            break;
+          }
+          default:
+            UNREACHABLE();
         }
       }
     }
@@ -1695,8 +1736,8 @@
 
 class ObjectPoolDeserializationCluster : public DeserializationCluster {
  public:
-  ObjectPoolDeserializationCluster() { }
-  virtual ~ObjectPoolDeserializationCluster() { }
+  ObjectPoolDeserializationCluster() {}
+  virtual ~ObjectPoolDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
@@ -1704,8 +1745,8 @@
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
       intptr_t length = d->Read<int32_t>();
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         ObjectPool::InstanceSize(length)));
+      d->AssignRef(
+          AllocateUninitialized(old_space, ObjectPool::InstanceSize(length)));
     }
     stop_index_ = d->next_index();
   }
@@ -1722,9 +1763,8 @@
                                      is_vm_object);
       info_array->ptr()->length_ = Smi::New(length);
       RawObjectPool* pool = reinterpret_cast<RawObjectPool*>(d->Ref(id + 0));
-      Deserializer::InitializeHeader(pool, kObjectPoolCid,
-                                     ObjectPool::InstanceSize(length),
-                                     is_vm_object);
+      Deserializer::InitializeHeader(
+          pool, kObjectPoolCid, ObjectPool::InstanceSize(length), is_vm_object);
       pool->ptr()->length_ = length;
       pool->ptr()->info_array_ = info_array;
       for (intptr_t j = 0; j < length; j++) {
@@ -1762,8 +1802,8 @@
 // PcDescriptor, Stackmap, OneByteString, TwoByteString
 class RODataSerializationCluster : public SerializationCluster {
  public:
-  explicit RODataSerializationCluster(intptr_t cid) : cid_(cid) { }
-  virtual ~RODataSerializationCluster() { }
+  explicit RODataSerializationCluster(intptr_t cid) : cid_(cid) {}
+  virtual ~RODataSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     objects_.Add(object);
@@ -1773,8 +1813,8 @@
     if (cid_ == kOneByteStringCid) {
       RawOneByteString* str = static_cast<RawOneByteString*>(object);
       if (str->ptr()->hash_ == Smi::New(0)) {
-        intptr_t hash = String::Hash(str->ptr()->data(),
-                                     Smi::Value(str->ptr()->length_));
+        intptr_t hash =
+            String::Hash(str->ptr()->data(), Smi::Value(str->ptr()->length_));
         str->ptr()->hash_ = Smi::New(hash);
       }
       ASSERT(str->ptr()->hash_ != Smi::New(0));
@@ -1814,8 +1854,8 @@
 
 class RODataDeserializationCluster : public DeserializationCluster {
  public:
-  RODataDeserializationCluster() { }
-  virtual ~RODataDeserializationCluster() { }
+  RODataDeserializationCluster() {}
+  virtual ~RODataDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     intptr_t count = d->Read<int32_t>();
@@ -1834,8 +1874,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class ExceptionHandlersSerializationCluster : public SerializationCluster {
  public:
-  ExceptionHandlersSerializationCluster() { }
-  virtual ~ExceptionHandlersSerializationCluster() { }
+  ExceptionHandlersSerializationCluster() {}
+  virtual ~ExceptionHandlersSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawExceptionHandlers* handlers = ExceptionHandlers::RawCast(object);
@@ -1879,8 +1919,8 @@
 
 class ExceptionHandlersDeserializationCluster : public DeserializationCluster {
  public:
-  ExceptionHandlersDeserializationCluster() { }
-  virtual ~ExceptionHandlersDeserializationCluster() { }
+  ExceptionHandlersDeserializationCluster() {}
+  virtual ~ExceptionHandlersDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
@@ -1888,8 +1928,8 @@
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
       intptr_t length = d->Read<int32_t>();
-      d->AssignRef(AllocateUninitialized(old_space,
-          ExceptionHandlers::InstanceSize(length)));
+      d->AssignRef(AllocateUninitialized(
+          old_space, ExceptionHandlers::InstanceSize(length)));
     }
     stop_index_ = d->next_index();
   }
@@ -1919,8 +1959,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class ContextSerializationCluster : public SerializationCluster {
  public:
-  ContextSerializationCluster() { }
-  virtual ~ContextSerializationCluster() { }
+  ContextSerializationCluster() {}
+  virtual ~ContextSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawContext* context = Context::RawCast(object);
@@ -1966,8 +2006,8 @@
 
 class ContextDeserializationCluster : public DeserializationCluster {
  public:
-  ContextDeserializationCluster() { }
-  virtual ~ContextDeserializationCluster() { }
+  ContextDeserializationCluster() {}
+  virtual ~ContextDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
@@ -1975,8 +2015,8 @@
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
       intptr_t length = d->Read<int32_t>();
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         Context::InstanceSize(length)));
+      d->AssignRef(
+          AllocateUninitialized(old_space, Context::InstanceSize(length)));
     }
     stop_index_ = d->next_index();
   }
@@ -1987,9 +2027,8 @@
     for (intptr_t id = start_index_; id < stop_index_; id++) {
       RawContext* context = reinterpret_cast<RawContext*>(d->Ref(id));
       intptr_t length = d->Read<int32_t>();
-      Deserializer::InitializeHeader(context, kContextCid,
-                                     Context::InstanceSize(length),
-                                     is_vm_object);
+      Deserializer::InitializeHeader(
+          context, kContextCid, Context::InstanceSize(length), is_vm_object);
       context->ptr()->num_variables_ = length;
       context->ptr()->parent_ = reinterpret_cast<RawContext*>(d->ReadRef());
       for (intptr_t j = 0; j < length; j++) {
@@ -2003,8 +2042,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class ContextScopeSerializationCluster : public SerializationCluster {
  public:
-  ContextScopeSerializationCluster() { }
-  virtual ~ContextScopeSerializationCluster() { }
+  ContextScopeSerializationCluster() {}
+  virtual ~ContextScopeSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawContextScope* scope = ContextScope::RawCast(object);
@@ -2053,8 +2092,8 @@
 
 class ContextScopeDeserializationCluster : public DeserializationCluster {
  public:
-  ContextScopeDeserializationCluster() { }
-  virtual ~ContextScopeDeserializationCluster() { }
+  ContextScopeDeserializationCluster() {}
+  virtual ~ContextScopeDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
@@ -2062,8 +2101,8 @@
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
       intptr_t length = d->Read<int32_t>();
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         ContextScope::InstanceSize(length)));
+      d->AssignRef(
+          AllocateUninitialized(old_space, ContextScope::InstanceSize(length)));
     }
     stop_index_ = d->next_index();
   }
@@ -2092,8 +2131,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class UnlinkedCallSerializationCluster : public SerializationCluster {
  public:
-  UnlinkedCallSerializationCluster() { }
-  virtual ~UnlinkedCallSerializationCluster() { }
+  UnlinkedCallSerializationCluster() {}
+  virtual ~UnlinkedCallSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawUnlinkedCall* unlinked = UnlinkedCall::RawCast(object);
@@ -2136,16 +2175,16 @@
 
 class UnlinkedCallDeserializationCluster : public DeserializationCluster {
  public:
-  UnlinkedCallDeserializationCluster() { }
-  virtual ~UnlinkedCallDeserializationCluster() { }
+  UnlinkedCallDeserializationCluster() {}
+  virtual ~UnlinkedCallDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
     PageSpace* old_space = d->heap()->old_space();
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         UnlinkedCall::InstanceSize()));
+      d->AssignRef(
+          AllocateUninitialized(old_space, UnlinkedCall::InstanceSize()));
     }
     stop_index_ = d->next_index();
   }
@@ -2172,8 +2211,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class ICDataSerializationCluster : public SerializationCluster {
  public:
-  ICDataSerializationCluster() { }
-  virtual ~ICDataSerializationCluster() { }
+  ICDataSerializationCluster() {}
+  virtual ~ICDataSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawICData* ic = ICData::RawCast(object);
@@ -2224,8 +2263,8 @@
 
 class ICDataDeserializationCluster : public DeserializationCluster {
  public:
-  ICDataDeserializationCluster() { }
-  virtual ~ICDataDeserializationCluster() { }
+  ICDataDeserializationCluster() {}
+  virtual ~ICDataDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
@@ -2243,8 +2282,8 @@
 
     for (intptr_t id = start_index_; id < stop_index_; id++) {
       RawICData* ic = reinterpret_cast<RawICData*>(d->Ref(id));
-      Deserializer::InitializeHeader(ic, kICDataCid,
-                                     ICData::InstanceSize(), is_vm_object);
+      Deserializer::InitializeHeader(ic, kICDataCid, ICData::InstanceSize(),
+                                     is_vm_object);
       RawObject** from = ic->from();
       RawObject** to_snapshot = ic->to_snapshot(kind);
       RawObject** to = ic->to();
@@ -2267,8 +2306,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class MegamorphicCacheSerializationCluster : public SerializationCluster {
  public:
-  MegamorphicCacheSerializationCluster() { }
-  virtual ~MegamorphicCacheSerializationCluster() { }
+  MegamorphicCacheSerializationCluster() {}
+  virtual ~MegamorphicCacheSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawMegamorphicCache* cache = MegamorphicCache::RawCast(object);
@@ -2312,16 +2351,16 @@
 
 class MegamorphicCacheDeserializationCluster : public DeserializationCluster {
  public:
-  MegamorphicCacheDeserializationCluster() { }
-  virtual ~MegamorphicCacheDeserializationCluster() { }
+  MegamorphicCacheDeserializationCluster() {}
+  virtual ~MegamorphicCacheDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
     PageSpace* old_space = d->heap()->old_space();
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         MegamorphicCache::InstanceSize()));
+      d->AssignRef(
+          AllocateUninitialized(old_space, MegamorphicCache::InstanceSize()));
     }
     stop_index_ = d->next_index();
   }
@@ -2331,7 +2370,7 @@
 
     for (intptr_t id = start_index_; id < stop_index_; id++) {
       RawMegamorphicCache* cache =
-            reinterpret_cast<RawMegamorphicCache*>(d->Ref(id));
+          reinterpret_cast<RawMegamorphicCache*>(d->Ref(id));
       Deserializer::InitializeHeader(cache, kMegamorphicCacheCid,
                                      MegamorphicCache::InstanceSize(),
                                      is_vm_object);
@@ -2349,8 +2388,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class SubtypeTestCacheSerializationCluster : public SerializationCluster {
  public:
-  SubtypeTestCacheSerializationCluster() { }
-  virtual ~SubtypeTestCacheSerializationCluster() { }
+  SubtypeTestCacheSerializationCluster() {}
+  virtual ~SubtypeTestCacheSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawSubtypeTestCache* cache = SubtypeTestCache::RawCast(object);
@@ -2384,16 +2423,16 @@
 
 class SubtypeTestCacheDeserializationCluster : public DeserializationCluster {
  public:
-  SubtypeTestCacheDeserializationCluster() { }
-  virtual ~SubtypeTestCacheDeserializationCluster() { }
+  SubtypeTestCacheDeserializationCluster() {}
+  virtual ~SubtypeTestCacheDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
     PageSpace* old_space = d->heap()->old_space();
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         SubtypeTestCache::InstanceSize()));
+      d->AssignRef(
+          AllocateUninitialized(old_space, SubtypeTestCache::InstanceSize()));
     }
     stop_index_ = d->next_index();
   }
@@ -2416,8 +2455,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class LanguageErrorSerializationCluster : public SerializationCluster {
  public:
-  LanguageErrorSerializationCluster() { }
-  virtual ~LanguageErrorSerializationCluster() { }
+  LanguageErrorSerializationCluster() {}
+  virtual ~LanguageErrorSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawLanguageError* error = LanguageError::RawCast(object);
@@ -2463,16 +2502,16 @@
 
 class LanguageErrorDeserializationCluster : public DeserializationCluster {
  public:
-  LanguageErrorDeserializationCluster() { }
-  virtual ~LanguageErrorDeserializationCluster() { }
+  LanguageErrorDeserializationCluster() {}
+  virtual ~LanguageErrorDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
     PageSpace* old_space = d->heap()->old_space();
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         LanguageError::InstanceSize()));
+      d->AssignRef(
+          AllocateUninitialized(old_space, LanguageError::InstanceSize()));
     }
     stop_index_ = d->next_index();
   }
@@ -2501,8 +2540,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class UnhandledExceptionSerializationCluster : public SerializationCluster {
  public:
-  UnhandledExceptionSerializationCluster() { }
-  virtual ~UnhandledExceptionSerializationCluster() { }
+  UnhandledExceptionSerializationCluster() {}
+  virtual ~UnhandledExceptionSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawUnhandledException* exception = UnhandledException::RawCast(object);
@@ -2545,16 +2584,16 @@
 
 class UnhandledExceptionDeserializationCluster : public DeserializationCluster {
  public:
-  UnhandledExceptionDeserializationCluster() { }
-  virtual ~UnhandledExceptionDeserializationCluster() { }
+  UnhandledExceptionDeserializationCluster() {}
+  virtual ~UnhandledExceptionDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
     PageSpace* old_space = d->heap()->old_space();
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         UnhandledException::InstanceSize()));
+      d->AssignRef(
+          AllocateUninitialized(old_space, UnhandledException::InstanceSize()));
     }
     stop_index_ = d->next_index();
   }
@@ -2588,7 +2627,7 @@
     ASSERT(next_field_offset_in_words_ > 0);
     ASSERT(instance_size_in_words_ > 0);
   }
-  virtual ~InstanceSerializationCluster() { }
+  virtual ~InstanceSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawInstance* instance = Instance::RawCast(object);
@@ -2645,8 +2684,8 @@
 
 class InstanceDeserializationCluster : public DeserializationCluster {
  public:
-  explicit InstanceDeserializationCluster(intptr_t cid) : cid_(cid) { }
-  virtual ~InstanceDeserializationCluster() { }
+  explicit InstanceDeserializationCluster(intptr_t cid) : cid_(cid) {}
+  virtual ~InstanceDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
@@ -2671,8 +2710,7 @@
     for (intptr_t id = start_index_; id < stop_index_; id++) {
       RawInstance* instance = reinterpret_cast<RawInstance*>(d->Ref(id));
       bool is_canonical = d->Read<bool>();
-      Deserializer::InitializeHeader(instance, cid_,
-                                     instance_size,
+      Deserializer::InitializeHeader(instance, cid_, instance_size,
                                      is_vm_object, is_canonical);
       intptr_t offset = Instance::NextFieldOffset();
       while (offset < next_field_offset) {
@@ -2701,8 +2739,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class LibraryPrefixSerializationCluster : public SerializationCluster {
  public:
-  LibraryPrefixSerializationCluster() { }
-  virtual ~LibraryPrefixSerializationCluster() { }
+  LibraryPrefixSerializationCluster() {}
+  virtual ~LibraryPrefixSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawLibraryPrefix* prefix = LibraryPrefix::RawCast(object);
@@ -2736,7 +2774,6 @@
       }
       s->Write<uint16_t>(prefix->ptr()->num_imports_);
       s->Write<bool>(prefix->ptr()->is_deferred_load_);
-      s->Write<bool>(prefix->ptr()->is_loaded_);
     }
   }
 
@@ -2748,16 +2785,16 @@
 
 class LibraryPrefixDeserializationCluster : public DeserializationCluster {
  public:
-  LibraryPrefixDeserializationCluster() { }
-  virtual ~LibraryPrefixDeserializationCluster() { }
+  LibraryPrefixDeserializationCluster() {}
+  virtual ~LibraryPrefixDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
     PageSpace* old_space = d->heap()->old_space();
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         LibraryPrefix::InstanceSize()));
+      d->AssignRef(
+          AllocateUninitialized(old_space, LibraryPrefix::InstanceSize()));
     }
     stop_index_ = d->next_index();
   }
@@ -2778,7 +2815,7 @@
       }
       prefix->ptr()->num_imports_ = d->Read<uint16_t>();
       prefix->ptr()->is_deferred_load_ = d->Read<bool>();
-      prefix->ptr()->is_loaded_ = d->Read<bool>();
+      prefix->ptr()->is_loaded_ = !prefix->ptr()->is_deferred_load_;
     }
   }
 };
@@ -2787,8 +2824,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class TypeSerializationCluster : public SerializationCluster {
  public:
-  TypeSerializationCluster() { }
-  virtual ~TypeSerializationCluster() { }
+  TypeSerializationCluster() {}
+  virtual ~TypeSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawType* type = Type::RawCast(object);
@@ -2865,8 +2902,8 @@
 
 class TypeDeserializationCluster : public DeserializationCluster {
  public:
-  TypeDeserializationCluster() { }
-  virtual ~TypeDeserializationCluster() { }
+  TypeDeserializationCluster() {}
+  virtual ~TypeDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     canonical_start_index_ = d->next_index();
@@ -2888,12 +2925,11 @@
   void ReadFill(Deserializer* d) {
     bool is_vm_object = d->isolate() == Dart::vm_isolate();
 
-    for (intptr_t id = canonical_start_index_;
-         id < canonical_stop_index_;
+    for (intptr_t id = canonical_start_index_; id < canonical_stop_index_;
          id++) {
       RawType* type = reinterpret_cast<RawType*>(d->Ref(id));
-      Deserializer::InitializeHeader(type, kTypeCid,
-                                     Type::InstanceSize(), is_vm_object, true);
+      Deserializer::InitializeHeader(type, kTypeCid, Type::InstanceSize(),
+                                     is_vm_object, true);
       RawObject** from = type->from();
       RawObject** to = type->to();
       for (RawObject** p = from; p <= to; p++) {
@@ -2905,8 +2941,8 @@
 
     for (intptr_t id = start_index_; id < stop_index_; id++) {
       RawType* type = reinterpret_cast<RawType*>(d->Ref(id));
-      Deserializer::InitializeHeader(type, kTypeCid,
-                                     Type::InstanceSize(), is_vm_object);
+      Deserializer::InitializeHeader(type, kTypeCid, Type::InstanceSize(),
+                                     is_vm_object);
       RawObject** from = type->from();
       RawObject** to = type->to();
       for (RawObject** p = from; p <= to; p++) {
@@ -2926,8 +2962,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class TypeRefSerializationCluster : public SerializationCluster {
  public:
-  TypeRefSerializationCluster() { }
-  virtual ~TypeRefSerializationCluster() { }
+  TypeRefSerializationCluster() {}
+  virtual ~TypeRefSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawTypeRef* type = TypeRef::RawCast(object);
@@ -2970,8 +3006,8 @@
 
 class TypeRefDeserializationCluster : public DeserializationCluster {
  public:
-  TypeRefDeserializationCluster() { }
-  virtual ~TypeRefDeserializationCluster() { }
+  TypeRefDeserializationCluster() {}
+  virtual ~TypeRefDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
@@ -2988,8 +3024,8 @@
 
     for (intptr_t id = start_index_; id < stop_index_; id++) {
       RawTypeRef* type = reinterpret_cast<RawTypeRef*>(d->Ref(id));
-      Deserializer::InitializeHeader(type, kTypeRefCid,
-                                     TypeRef::InstanceSize(), is_vm_object);
+      Deserializer::InitializeHeader(type, kTypeRefCid, TypeRef::InstanceSize(),
+                                     is_vm_object);
       RawObject** from = type->from();
       RawObject** to = type->to();
       for (RawObject** p = from; p <= to; p++) {
@@ -3003,8 +3039,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class TypeParameterSerializationCluster : public SerializationCluster {
  public:
-  TypeParameterSerializationCluster() { }
-  virtual ~TypeParameterSerializationCluster() { }
+  TypeParameterSerializationCluster() {}
+  virtual ~TypeParameterSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawTypeParameter* type = TypeParameter::RawCast(object);
@@ -3053,16 +3089,16 @@
 
 class TypeParameterDeserializationCluster : public DeserializationCluster {
  public:
-  TypeParameterDeserializationCluster() { }
-  virtual ~TypeParameterDeserializationCluster() { }
+  TypeParameterDeserializationCluster() {}
+  virtual ~TypeParameterDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
     PageSpace* old_space = d->heap()->old_space();
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         TypeParameter::InstanceSize()));
+      d->AssignRef(
+          AllocateUninitialized(old_space, TypeParameter::InstanceSize()));
     }
     stop_index_ = d->next_index();
   }
@@ -3072,9 +3108,8 @@
 
     for (intptr_t id = start_index_; id < stop_index_; id++) {
       RawTypeParameter* type = reinterpret_cast<RawTypeParameter*>(d->Ref(id));
-      Deserializer::InitializeHeader(type, kTypeParameterCid,
-                                     TypeParameter::InstanceSize(),
-                                     is_vm_object);
+      Deserializer::InitializeHeader(
+          type, kTypeParameterCid, TypeParameter::InstanceSize(), is_vm_object);
       RawObject** from = type->from();
       RawObject** to = type->to();
       for (RawObject** p = from; p <= to; p++) {
@@ -3093,8 +3128,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class BoundedTypeSerializationCluster : public SerializationCluster {
  public:
-  BoundedTypeSerializationCluster() { }
-  virtual ~BoundedTypeSerializationCluster() { }
+  BoundedTypeSerializationCluster() {}
+  virtual ~BoundedTypeSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawBoundedType* type = BoundedType::RawCast(object);
@@ -3137,16 +3172,16 @@
 
 class BoundedTypeDeserializationCluster : public DeserializationCluster {
  public:
-  BoundedTypeDeserializationCluster() { }
-  virtual ~BoundedTypeDeserializationCluster() { }
+  BoundedTypeDeserializationCluster() {}
+  virtual ~BoundedTypeDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
     PageSpace* old_space = d->heap()->old_space();
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         BoundedType::InstanceSize()));
+      d->AssignRef(
+          AllocateUninitialized(old_space, BoundedType::InstanceSize()));
     }
     stop_index_ = d->next_index();
   }
@@ -3171,8 +3206,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class ClosureSerializationCluster : public SerializationCluster {
  public:
-  ClosureSerializationCluster() { }
-  virtual ~ClosureSerializationCluster() { }
+  ClosureSerializationCluster() {}
+  virtual ~ClosureSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawClosure* closure = Closure::RawCast(object);
@@ -3216,8 +3251,8 @@
 
 class ClosureDeserializationCluster : public DeserializationCluster {
  public:
-  ClosureDeserializationCluster() { }
-  virtual ~ClosureDeserializationCluster() { }
+  ClosureDeserializationCluster() {}
+  virtual ~ClosureDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
@@ -3236,8 +3271,8 @@
       RawClosure* closure = reinterpret_cast<RawClosure*>(d->Ref(id));
       bool is_canonical = d->Read<bool>();
       Deserializer::InitializeHeader(closure, kClosureCid,
-                                     Closure::InstanceSize(),
-                                     is_vm_object, is_canonical);
+                                     Closure::InstanceSize(), is_vm_object,
+                                     is_canonical);
       RawObject** from = closure->from();
       RawObject** to = closure->to();
       for (RawObject** p = from; p <= to; p++) {
@@ -3251,8 +3286,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class MintSerializationCluster : public SerializationCluster {
  public:
-  MintSerializationCluster() { }
-  virtual ~MintSerializationCluster() { }
+  MintSerializationCluster() {}
+  virtual ~MintSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     if (!object->IsHeapObject()) {
@@ -3282,7 +3317,7 @@
     }
   }
 
-  void WriteFill(Serializer* s) { }
+  void WriteFill(Serializer* s) {}
 
  private:
   GrowableArray<RawSmi*> smis_;
@@ -3293,8 +3328,8 @@
 
 class MintDeserializationCluster : public DeserializationCluster {
  public:
-  MintDeserializationCluster() { }
-  virtual ~MintDeserializationCluster() { }
+  MintDeserializationCluster() {}
+  virtual ~MintDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     PageSpace* old_space = d->heap()->old_space();
@@ -3310,8 +3345,7 @@
       } else {
         RawMint* mint = static_cast<RawMint*>(
             AllocateUninitialized(old_space, Mint::InstanceSize()));
-        Deserializer::InitializeHeader(mint, kMintCid,
-                                       Mint::InstanceSize(),
+        Deserializer::InitializeHeader(mint, kMintCid, Mint::InstanceSize(),
                                        is_vm_object, is_canonical);
         mint->ptr()->value_ = value;
         d->AssignRef(mint);
@@ -3320,11 +3354,11 @@
     stop_index_ = d->next_index();
   }
 
-  void ReadFill(Deserializer* d) { }
+  void ReadFill(Deserializer* d) {}
 
   void PostLoad(const Array& refs, Snapshot::Kind kind, Zone* zone) {
-    NOT_IN_PRODUCT(TimelineDurationScope tds(Thread::Current(),
-        Timeline::GetIsolateStream(), "PostLoadMint"));
+    NOT_IN_PRODUCT(TimelineDurationScope tds(
+        Thread::Current(), Timeline::GetIsolateStream(), "PostLoadMint"));
 
     const GrowableObjectArray& new_constants =
         GrowableObjectArray::Handle(zone, GrowableObjectArray::New());
@@ -3337,8 +3371,8 @@
     }
     const Array& constants_array =
         Array::Handle(zone, Array::MakeArray(new_constants));
-    const Class& mint_cls = Class::Handle(zone,
-        Isolate::Current()->object_store()->mint_class());
+    const Class& mint_cls =
+        Class::Handle(zone, Isolate::Current()->object_store()->mint_class());
     mint_cls.set_constants(constants_array);
   }
 };
@@ -3347,8 +3381,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class BigintSerializationCluster : public SerializationCluster {
  public:
-  BigintSerializationCluster() { }
-  virtual ~BigintSerializationCluster() { }
+  BigintSerializationCluster() {}
+  virtual ~BigintSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawBigint* bigint = Bigint::RawCast(object);
@@ -3392,8 +3426,8 @@
 
 class BigintDeserializationCluster : public DeserializationCluster {
  public:
-  BigintDeserializationCluster() { }
-  virtual ~BigintDeserializationCluster() { }
+  BigintDeserializationCluster() {}
+  virtual ~BigintDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
@@ -3411,8 +3445,7 @@
     for (intptr_t id = start_index_; id < stop_index_; id++) {
       RawBigint* bigint = reinterpret_cast<RawBigint*>(d->Ref(id));
       bool is_canonical = d->Read<bool>();
-      Deserializer::InitializeHeader(bigint, kBigintCid,
-                                     Bigint::InstanceSize(),
+      Deserializer::InitializeHeader(bigint, kBigintCid, Bigint::InstanceSize(),
                                      is_vm_object, is_canonical);
       RawObject** from = bigint->from();
       RawObject** to = bigint->to();
@@ -3427,8 +3460,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class DoubleSerializationCluster : public SerializationCluster {
  public:
-  DoubleSerializationCluster() { }
-  virtual ~DoubleSerializationCluster() { }
+  DoubleSerializationCluster() {}
+  virtual ~DoubleSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawDouble* dbl = Double::RawCast(object);
@@ -3462,8 +3495,8 @@
 
 class DoubleDeserializationCluster : public DeserializationCluster {
  public:
-  DoubleDeserializationCluster() { }
-  virtual ~DoubleDeserializationCluster() { }
+  DoubleDeserializationCluster() {}
+  virtual ~DoubleDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
@@ -3481,8 +3514,7 @@
     for (intptr_t id = start_index_; id < stop_index_; id++) {
       RawDouble* dbl = reinterpret_cast<RawDouble*>(d->Ref(id));
       bool is_canonical = d->Read<bool>();
-      Deserializer::InitializeHeader(dbl, kDoubleCid,
-                                     Double::InstanceSize(),
+      Deserializer::InitializeHeader(dbl, kDoubleCid, Double::InstanceSize(),
                                      is_vm_object, is_canonical);
       dbl->ptr()->value_ = d->Read<double>();
     }
@@ -3493,8 +3525,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class GrowableObjectArraySerializationCluster : public SerializationCluster {
  public:
-  GrowableObjectArraySerializationCluster() { }
-  virtual ~GrowableObjectArraySerializationCluster() { }
+  GrowableObjectArraySerializationCluster() {}
+  virtual ~GrowableObjectArraySerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawGrowableObjectArray* array = GrowableObjectArray::RawCast(object);
@@ -3539,8 +3571,8 @@
 class GrowableObjectArrayDeserializationCluster
     : public DeserializationCluster {
  public:
-  GrowableObjectArrayDeserializationCluster() { }
-  virtual ~GrowableObjectArrayDeserializationCluster() { }
+  GrowableObjectArrayDeserializationCluster() {}
+  virtual ~GrowableObjectArrayDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
@@ -3576,8 +3608,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class TypedDataSerializationCluster : public SerializationCluster {
  public:
-  explicit TypedDataSerializationCluster(intptr_t cid) : cid_(cid) { }
-  virtual ~TypedDataSerializationCluster() { }
+  explicit TypedDataSerializationCluster(intptr_t cid) : cid_(cid) {}
+  virtual ~TypedDataSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawTypedData* data = TypedData::RawCast(object);
@@ -3618,8 +3650,8 @@
 
 class TypedDataDeserializationCluster : public DeserializationCluster {
  public:
-  explicit TypedDataDeserializationCluster(intptr_t cid) : cid_(cid) { }
-  virtual ~TypedDataDeserializationCluster() { }
+  explicit TypedDataDeserializationCluster(intptr_t cid) : cid_(cid) {}
+  virtual ~TypedDataDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
@@ -3628,8 +3660,8 @@
     intptr_t element_size = TypedData::ElementSizeInBytes(cid_);
     for (intptr_t i = 0; i < count; i++) {
       intptr_t length = d->Read<int32_t>();
-      d->AssignRef(AllocateUninitialized(old_space,
-          TypedData::InstanceSize(length * element_size)));
+      d->AssignRef(AllocateUninitialized(
+          old_space, TypedData::InstanceSize(length * element_size)));
     }
     stop_index_ = d->next_index();
   }
@@ -3660,8 +3692,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class ExternalTypedDataSerializationCluster : public SerializationCluster {
  public:
-  explicit ExternalTypedDataSerializationCluster(intptr_t cid) : cid_(cid) { }
-  virtual ~ExternalTypedDataSerializationCluster() { }
+  explicit ExternalTypedDataSerializationCluster(intptr_t cid) : cid_(cid) {}
+  virtual ~ExternalTypedDataSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawExternalTypedData* data = ExternalTypedData::RawCast(object);
@@ -3700,16 +3732,16 @@
 
 class ExternalTypedDataDeserializationCluster : public DeserializationCluster {
  public:
-  explicit ExternalTypedDataDeserializationCluster(intptr_t cid) : cid_(cid) { }
-  virtual ~ExternalTypedDataDeserializationCluster() { }
+  explicit ExternalTypedDataDeserializationCluster(intptr_t cid) : cid_(cid) {}
+  virtual ~ExternalTypedDataDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
     PageSpace* old_space = d->heap()->old_space();
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         ExternalTypedData::InstanceSize()));
+      d->AssignRef(
+          AllocateUninitialized(old_space, ExternalTypedData::InstanceSize()));
     }
     stop_index_ = d->next_index();
   }
@@ -3722,9 +3754,8 @@
       RawExternalTypedData* data =
           reinterpret_cast<RawExternalTypedData*>(d->Ref(id));
       intptr_t length = d->Read<int32_t>();
-      Deserializer::InitializeHeader(data, cid_,
-                                     ExternalTypedData::InstanceSize(),
-                                     is_vm_object);
+      Deserializer::InitializeHeader(
+          data, cid_, ExternalTypedData::InstanceSize(), is_vm_object);
       data->ptr()->length_ = Smi::New(length);
       data->ptr()->data_ = const_cast<uint8_t*>(d->CurrentBufferAddress());
       d->Advance(length * element_size);
@@ -3740,8 +3771,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class StacktraceSerializationCluster : public SerializationCluster {
  public:
-  StacktraceSerializationCluster() { }
-  virtual ~StacktraceSerializationCluster() { }
+  StacktraceSerializationCluster() {}
+  virtual ~StacktraceSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawStacktrace* trace = Stacktrace::RawCast(object);
@@ -3784,16 +3815,16 @@
 
 class StacktraceDeserializationCluster : public DeserializationCluster {
  public:
-  StacktraceDeserializationCluster() { }
-  virtual ~StacktraceDeserializationCluster() { }
+  StacktraceDeserializationCluster() {}
+  virtual ~StacktraceDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
     PageSpace* old_space = d->heap()->old_space();
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         Stacktrace::InstanceSize()));
+      d->AssignRef(
+          AllocateUninitialized(old_space, Stacktrace::InstanceSize()));
     }
     stop_index_ = d->next_index();
   }
@@ -3818,8 +3849,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class RegExpSerializationCluster : public SerializationCluster {
  public:
-  RegExpSerializationCluster() { }
-  virtual ~RegExpSerializationCluster() { }
+  RegExpSerializationCluster() {}
+  virtual ~RegExpSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawRegExp* regexp = RegExp::RawCast(object);
@@ -3865,16 +3896,15 @@
 
 class RegExpDeserializationCluster : public DeserializationCluster {
  public:
-  RegExpDeserializationCluster() { }
-  virtual ~RegExpDeserializationCluster() { }
+  RegExpDeserializationCluster() {}
+  virtual ~RegExpDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
     PageSpace* old_space = d->heap()->old_space();
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         RegExp::InstanceSize()));
+      d->AssignRef(AllocateUninitialized(old_space, RegExp::InstanceSize()));
     }
     stop_index_ = d->next_index();
   }
@@ -3884,8 +3914,8 @@
 
     for (intptr_t id = start_index_; id < stop_index_; id++) {
       RawRegExp* regexp = reinterpret_cast<RawRegExp*>(d->Ref(id));
-      Deserializer::InitializeHeader(regexp, kRegExpCid,
-                                     RegExp::InstanceSize(), is_vm_object);
+      Deserializer::InitializeHeader(regexp, kRegExpCid, RegExp::InstanceSize(),
+                                     is_vm_object);
       RawObject** from = regexp->from();
       RawObject** to = regexp->to();
       for (RawObject** p = from; p <= to; p++) {
@@ -3900,10 +3930,90 @@
 
 
 #if !defined(DART_PRECOMPILED_RUNTIME)
+class WeakPropertySerializationCluster : public SerializationCluster {
+ public:
+  WeakPropertySerializationCluster() {}
+  virtual ~WeakPropertySerializationCluster() {}
+
+  void Trace(Serializer* s, RawObject* object) {
+    RawWeakProperty* property = WeakProperty::RawCast(object);
+    objects_.Add(property);
+
+    RawObject** from = property->from();
+    RawObject** to = property->to();
+    for (RawObject** p = from; p <= to; p++) {
+      s->Push(*p);
+    }
+  }
+
+  void WriteAlloc(Serializer* s) {
+    s->WriteCid(kWeakPropertyCid);
+    intptr_t count = objects_.length();
+    s->Write<int32_t>(count);
+    for (intptr_t i = 0; i < count; i++) {
+      RawWeakProperty* property = objects_[i];
+      s->AssignRef(property);
+    }
+  }
+
+  void WriteFill(Serializer* s) {
+    intptr_t count = objects_.length();
+    for (intptr_t i = 0; i < count; i++) {
+      RawWeakProperty* property = objects_[i];
+      RawObject** from = property->from();
+      RawObject** to = property->to();
+      for (RawObject** p = from; p <= to; p++) {
+        s->WriteRef(*p);
+      }
+    }
+  }
+
+ private:
+  GrowableArray<RawWeakProperty*> objects_;
+};
+#endif  // !DART_PRECOMPILED_RUNTIME
+
+
+class WeakPropertyDeserializationCluster : public DeserializationCluster {
+ public:
+  WeakPropertyDeserializationCluster() {}
+  virtual ~WeakPropertyDeserializationCluster() {}
+
+  void ReadAlloc(Deserializer* d) {
+    start_index_ = d->next_index();
+    PageSpace* old_space = d->heap()->old_space();
+    intptr_t count = d->Read<int32_t>();
+    for (intptr_t i = 0; i < count; i++) {
+      d->AssignRef(
+          AllocateUninitialized(old_space, WeakProperty::InstanceSize()));
+    }
+    stop_index_ = d->next_index();
+  }
+
+  void ReadFill(Deserializer* d) {
+    bool is_vm_object = d->isolate() == Dart::vm_isolate();
+
+    for (intptr_t id = start_index_; id < stop_index_; id++) {
+      RawWeakProperty* property =
+          reinterpret_cast<RawWeakProperty*>(d->Ref(id));
+      Deserializer::InitializeHeader(property, kWeakPropertyCid,
+                                     WeakProperty::InstanceSize(),
+                                     is_vm_object);
+      RawObject** from = property->from();
+      RawObject** to = property->to();
+      for (RawObject** p = from; p <= to; p++) {
+        *p = d->ReadRef();
+      }
+    }
+  }
+};
+
+
+#if !defined(DART_PRECOMPILED_RUNTIME)
 class LinkedHashMapSerializationCluster : public SerializationCluster {
  public:
-  LinkedHashMapSerializationCluster() { }
-  virtual ~LinkedHashMapSerializationCluster() { }
+  LinkedHashMapSerializationCluster() {}
+  virtual ~LinkedHashMapSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawLinkedHashMap* map = LinkedHashMap::RawCast(object);
@@ -3970,16 +4080,16 @@
 
 class LinkedHashMapDeserializationCluster : public DeserializationCluster {
  public:
-  LinkedHashMapDeserializationCluster() { }
-  virtual ~LinkedHashMapDeserializationCluster() { }
+  LinkedHashMapDeserializationCluster() {}
+  virtual ~LinkedHashMapDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
     PageSpace* old_space = d->heap()->old_space();
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         LinkedHashMap::InstanceSize()));
+      d->AssignRef(
+          AllocateUninitialized(old_space, LinkedHashMap::InstanceSize()));
     }
     stop_index_ = d->next_index();
   }
@@ -4030,8 +4140,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class ArraySerializationCluster : public SerializationCluster {
  public:
-  explicit ArraySerializationCluster(intptr_t cid) : cid_(cid) { }
-  virtual ~ArraySerializationCluster() { }
+  explicit ArraySerializationCluster(intptr_t cid) : cid_(cid) {}
+  virtual ~ArraySerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawArray* array = Array::RawCast(object);
@@ -4079,8 +4189,8 @@
 
 class ArrayDeserializationCluster : public DeserializationCluster {
  public:
-  explicit ArrayDeserializationCluster(intptr_t cid) : cid_(cid) { }
-  virtual ~ArrayDeserializationCluster() { }
+  explicit ArrayDeserializationCluster(intptr_t cid) : cid_(cid) {}
+  virtual ~ArrayDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
@@ -4088,8 +4198,8 @@
     intptr_t count = d->Read<int32_t>();
     for (intptr_t i = 0; i < count; i++) {
       intptr_t length = d->Read<int32_t>();
-      d->AssignRef(AllocateUninitialized(old_space,
-                                         Array::InstanceSize(length)));
+      d->AssignRef(
+          AllocateUninitialized(old_space, Array::InstanceSize(length)));
     }
     stop_index_ = d->next_index();
   }
@@ -4101,8 +4211,7 @@
       RawArray* array = reinterpret_cast<RawArray*>(d->Ref(id));
       intptr_t length = d->Read<int32_t>();
       bool is_canonical = d->Read<bool>();
-      Deserializer::InitializeHeader(array, cid_,
-                                     Array::InstanceSize(length),
+      Deserializer::InitializeHeader(array, cid_, Array::InstanceSize(length),
                                      is_vm_object, is_canonical);
       array->ptr()->type_arguments_ =
           reinterpret_cast<RawTypeArguments*>(d->ReadRef());
@@ -4121,8 +4230,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class OneByteStringSerializationCluster : public SerializationCluster {
  public:
-  OneByteStringSerializationCluster() { }
-  virtual ~OneByteStringSerializationCluster() { }
+  OneByteStringSerializationCluster() {}
+  virtual ~OneByteStringSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawOneByteString* str = reinterpret_cast<RawOneByteString*>(object);
@@ -4162,8 +4271,8 @@
 
 class OneByteStringDeserializationCluster : public DeserializationCluster {
  public:
-  OneByteStringDeserializationCluster() { }
-  virtual ~OneByteStringDeserializationCluster() { }
+  OneByteStringDeserializationCluster() {}
+  virtual ~OneByteStringDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
@@ -4200,8 +4309,8 @@
 #if !defined(DART_PRECOMPILED_RUNTIME)
 class TwoByteStringSerializationCluster : public SerializationCluster {
  public:
-  TwoByteStringSerializationCluster() { }
-  virtual ~TwoByteStringSerializationCluster() { }
+  TwoByteStringSerializationCluster() {}
+  virtual ~TwoByteStringSerializationCluster() {}
 
   void Trace(Serializer* s, RawObject* object) {
     RawTwoByteString* str = reinterpret_cast<RawTwoByteString*>(object);
@@ -4241,8 +4350,8 @@
 
 class TwoByteStringDeserializationCluster : public DeserializationCluster {
  public:
-  TwoByteStringDeserializationCluster() { }
-  virtual ~TwoByteStringDeserializationCluster() { }
+  TwoByteStringDeserializationCluster() {}
+  virtual ~TwoByteStringDeserializationCluster() {}
 
   void ReadAlloc(Deserializer* d) {
     start_index_ = d->next_index();
@@ -4260,8 +4369,7 @@
     bool is_vm_object = d->isolate() == Dart::vm_isolate();
 
     for (intptr_t id = start_index_; id < stop_index_; id++) {
-      RawTwoByteString* str =
-          reinterpret_cast<RawTwoByteString*>(d->Ref(id));
+      RawTwoByteString* str = reinterpret_cast<RawTwoByteString*>(d->Ref(id));
       intptr_t length = d->Read<int32_t>();
       bool is_canonical = d->Read<bool>();
       Deserializer::InitializeHeader(str, kTwoByteStringCid,
@@ -4313,8 +4421,7 @@
   return NULL;
 #else
   Zone* Z = zone_;
-  if ((cid >= kNumPredefinedCids) ||
-      (cid == kInstanceCid) ||
+  if ((cid >= kNumPredefinedCids) || (cid == kInstanceCid) ||
       RawObject::IsTypedDataViewClassId(cid)) {
     Push(isolate()->class_table()->At(cid));
     return new (Z) InstanceSerializationCluster(cid);
@@ -4327,33 +4434,50 @@
   }
 
   switch (cid) {
-    case kClassCid: return new (Z) ClassSerializationCluster(num_cids_);
+    case kClassCid:
+      return new (Z) ClassSerializationCluster(num_cids_);
     case kUnresolvedClassCid:
       return new (Z) UnresolvedClassSerializationCluster();
-    case kTypeArgumentsCid: return new (Z) TypeArgumentsSerializationCluster();
-    case kPatchClassCid: return new (Z) PatchClassSerializationCluster();
-    case kFunctionCid: return new (Z) FunctionSerializationCluster();
-    case kClosureDataCid: return new (Z) ClosureDataSerializationCluster();
+    case kTypeArgumentsCid:
+      return new (Z) TypeArgumentsSerializationCluster();
+    case kPatchClassCid:
+      return new (Z) PatchClassSerializationCluster();
+    case kFunctionCid:
+      return new (Z) FunctionSerializationCluster();
+    case kClosureDataCid:
+      return new (Z) ClosureDataSerializationCluster();
     case kRedirectionDataCid:
       return new (Z) RedirectionDataSerializationCluster();
-    case kFieldCid: return new (Z) FieldSerializationCluster();
-    case kLiteralTokenCid: return new (Z) LiteralTokenSerializationCluster();
-    case kTokenStreamCid: return new (Z) TokenStreamSerializationCluster();
-    case kScriptCid: return new (Z) ScriptSerializationCluster();
-    case kLibraryCid: return new (Z) LibrarySerializationCluster();
-    case kNamespaceCid: return new (Z) NamespaceSerializationCluster();
-    case kCodeCid: return new (Z) CodeSerializationCluster();
-    case kObjectPoolCid: return new (Z) ObjectPoolSerializationCluster();
+    case kFieldCid:
+      return new (Z) FieldSerializationCluster();
+    case kLiteralTokenCid:
+      return new (Z) LiteralTokenSerializationCluster();
+    case kTokenStreamCid:
+      return new (Z) TokenStreamSerializationCluster();
+    case kScriptCid:
+      return new (Z) ScriptSerializationCluster();
+    case kLibraryCid:
+      return new (Z) LibrarySerializationCluster();
+    case kNamespaceCid:
+      return new (Z) NamespaceSerializationCluster();
+    case kCodeCid:
+      return new (Z) CodeSerializationCluster();
+    case kObjectPoolCid:
+      return new (Z) ObjectPoolSerializationCluster();
     case kPcDescriptorsCid:
       return new (Z) RODataSerializationCluster(kPcDescriptorsCid);
     case kStackmapCid:
       return new (Z) RODataSerializationCluster(kStackmapCid);
     case kExceptionHandlersCid:
       return new (Z) ExceptionHandlersSerializationCluster();
-    case kContextCid: return new (Z) ContextSerializationCluster();
-    case kContextScopeCid: return new (Z) ContextScopeSerializationCluster();
-    case kUnlinkedCallCid: return new (Z) UnlinkedCallSerializationCluster();
-    case kICDataCid: return new (Z) ICDataSerializationCluster();
+    case kContextCid:
+      return new (Z) ContextSerializationCluster();
+    case kContextScopeCid:
+      return new (Z) ContextScopeSerializationCluster();
+    case kUnlinkedCallCid:
+      return new (Z) UnlinkedCallSerializationCluster();
+    case kICDataCid:
+      return new (Z) ICDataSerializationCluster();
     case kMegamorphicCacheCid:
       return new (Z) MegamorphicCacheSerializationCluster();
     case kSubtypeTestCacheCid:
@@ -4362,20 +4486,34 @@
       return new (Z) LanguageErrorSerializationCluster();
     case kUnhandledExceptionCid:
       return new (Z) UnhandledExceptionSerializationCluster();
-    case kLibraryPrefixCid: return new (Z) LibraryPrefixSerializationCluster();
-    case kTypeCid: return new (Z) TypeSerializationCluster();
-    case kTypeRefCid: return new (Z) TypeRefSerializationCluster();
-    case kTypeParameterCid: return new (Z) TypeParameterSerializationCluster();
-    case kBoundedTypeCid: return new (Z) BoundedTypeSerializationCluster();
-    case kClosureCid: return new (Z) ClosureSerializationCluster();
-    case kMintCid: return new (Z) MintSerializationCluster();
-    case kBigintCid: return new (Z) BigintSerializationCluster();
-    case kDoubleCid: return new (Z) DoubleSerializationCluster();
+    case kLibraryPrefixCid:
+      return new (Z) LibraryPrefixSerializationCluster();
+    case kTypeCid:
+      return new (Z) TypeSerializationCluster();
+    case kTypeRefCid:
+      return new (Z) TypeRefSerializationCluster();
+    case kTypeParameterCid:
+      return new (Z) TypeParameterSerializationCluster();
+    case kBoundedTypeCid:
+      return new (Z) BoundedTypeSerializationCluster();
+    case kClosureCid:
+      return new (Z) ClosureSerializationCluster();
+    case kMintCid:
+      return new (Z) MintSerializationCluster();
+    case kBigintCid:
+      return new (Z) BigintSerializationCluster();
+    case kDoubleCid:
+      return new (Z) DoubleSerializationCluster();
     case kGrowableObjectArrayCid:
       return new (Z) GrowableObjectArraySerializationCluster();
-    case kStacktraceCid: return new (Z) StacktraceSerializationCluster();
-    case kRegExpCid: return new (Z) RegExpSerializationCluster();
-    case kLinkedHashMapCid: return new (Z) LinkedHashMapSerializationCluster();
+    case kStacktraceCid:
+      return new (Z) StacktraceSerializationCluster();
+    case kRegExpCid:
+      return new (Z) RegExpSerializationCluster();
+    case kWeakPropertyCid:
+      return new (Z) WeakPropertySerializationCluster();
+    case kLinkedHashMapCid:
+      return new (Z) LinkedHashMapSerializationCluster();
     case kArrayCid:
       return new (Z) ArraySerializationCluster(kArrayCid);
     case kImmutableArrayCid:
@@ -4394,7 +4532,8 @@
         return new (Z) TwoByteStringSerializationCluster();
       }
     }
-    default: break;
+    default:
+      break;
   }
 
   FATAL1("No cluster defined for cid %" Pd, cid);
@@ -4637,8 +4776,7 @@
   intptr_t cid = ReadCid();
 
   Zone* Z = zone_;
-  if ((cid >= kNumPredefinedCids) ||
-      (cid == kInstanceCid) ||
+  if ((cid >= kNumPredefinedCids) || (cid == kInstanceCid) ||
       RawObject::IsTypedDataViewClassId(cid)) {
     return new (Z) InstanceDeserializationCluster(cid);
   }
@@ -4650,33 +4788,49 @@
   }
 
   switch (cid) {
-    case kClassCid: return new (Z) ClassDeserializationCluster();
+    case kClassCid:
+      return new (Z) ClassDeserializationCluster();
     case kUnresolvedClassCid:
       return new (Z) UnresolvedClassDeserializationCluster();
     case kTypeArgumentsCid:
       return new (Z) TypeArgumentsDeserializationCluster();
-    case kPatchClassCid: return new (Z) PatchClassDeserializationCluster();
-    case kFunctionCid: return new (Z) FunctionDeserializationCluster();
-    case kClosureDataCid: return new (Z) ClosureDataDeserializationCluster();
+    case kPatchClassCid:
+      return new (Z) PatchClassDeserializationCluster();
+    case kFunctionCid:
+      return new (Z) FunctionDeserializationCluster();
+    case kClosureDataCid:
+      return new (Z) ClosureDataDeserializationCluster();
     case kRedirectionDataCid:
       return new (Z) RedirectionDataDeserializationCluster();
-    case kFieldCid: return new (Z) FieldDeserializationCluster();
-    case kLiteralTokenCid: return new (Z) LiteralTokenDeserializationCluster();
-    case kTokenStreamCid: return new (Z) TokenStreamDeserializationCluster();
-    case kScriptCid: return new (Z) ScriptDeserializationCluster();
-    case kLibraryCid: return new (Z) LibraryDeserializationCluster();
-    case kNamespaceCid: return new (Z) NamespaceDeserializationCluster();
-    case kCodeCid: return new (Z) CodeDeserializationCluster();
-    case kObjectPoolCid: return new (Z) ObjectPoolDeserializationCluster();
+    case kFieldCid:
+      return new (Z) FieldDeserializationCluster();
+    case kLiteralTokenCid:
+      return new (Z) LiteralTokenDeserializationCluster();
+    case kTokenStreamCid:
+      return new (Z) TokenStreamDeserializationCluster();
+    case kScriptCid:
+      return new (Z) ScriptDeserializationCluster();
+    case kLibraryCid:
+      return new (Z) LibraryDeserializationCluster();
+    case kNamespaceCid:
+      return new (Z) NamespaceDeserializationCluster();
+    case kCodeCid:
+      return new (Z) CodeDeserializationCluster();
+    case kObjectPoolCid:
+      return new (Z) ObjectPoolDeserializationCluster();
     case kPcDescriptorsCid:
     case kStackmapCid:
       return new (Z) RODataDeserializationCluster();
     case kExceptionHandlersCid:
       return new (Z) ExceptionHandlersDeserializationCluster();
-    case kContextCid: return new (Z) ContextDeserializationCluster();
-    case kContextScopeCid: return new (Z) ContextScopeDeserializationCluster();
-    case kUnlinkedCallCid: return new (Z) UnlinkedCallDeserializationCluster();
-    case kICDataCid: return new (Z) ICDataDeserializationCluster();
+    case kContextCid:
+      return new (Z) ContextDeserializationCluster();
+    case kContextScopeCid:
+      return new (Z) ContextScopeDeserializationCluster();
+    case kUnlinkedCallCid:
+      return new (Z) UnlinkedCallDeserializationCluster();
+    case kICDataCid:
+      return new (Z) ICDataDeserializationCluster();
     case kMegamorphicCacheCid:
       return new (Z) MegamorphicCacheDeserializationCluster();
     case kSubtypeTestCacheCid:
@@ -4687,19 +4841,30 @@
       return new (Z) UnhandledExceptionDeserializationCluster();
     case kLibraryPrefixCid:
       return new (Z) LibraryPrefixDeserializationCluster();
-    case kTypeCid: return new (Z) TypeDeserializationCluster();
-    case kTypeRefCid: return new (Z) TypeRefDeserializationCluster();
+    case kTypeCid:
+      return new (Z) TypeDeserializationCluster();
+    case kTypeRefCid:
+      return new (Z) TypeRefDeserializationCluster();
     case kTypeParameterCid:
       return new (Z) TypeParameterDeserializationCluster();
-    case kBoundedTypeCid: return new (Z) BoundedTypeDeserializationCluster();
-    case kClosureCid: return new (Z) ClosureDeserializationCluster();
-    case kMintCid: return new (Z) MintDeserializationCluster();
-    case kBigintCid: return new (Z) BigintDeserializationCluster();
-    case kDoubleCid: return new (Z) DoubleDeserializationCluster();
+    case kBoundedTypeCid:
+      return new (Z) BoundedTypeDeserializationCluster();
+    case kClosureCid:
+      return new (Z) ClosureDeserializationCluster();
+    case kMintCid:
+      return new (Z) MintDeserializationCluster();
+    case kBigintCid:
+      return new (Z) BigintDeserializationCluster();
+    case kDoubleCid:
+      return new (Z) DoubleDeserializationCluster();
     case kGrowableObjectArrayCid:
       return new (Z) GrowableObjectArrayDeserializationCluster();
-    case kStacktraceCid: return new (Z) StacktraceDeserializationCluster();
-    case kRegExpCid: return new (Z) RegExpDeserializationCluster();
+    case kStacktraceCid:
+      return new (Z) StacktraceDeserializationCluster();
+    case kRegExpCid:
+      return new (Z) RegExpDeserializationCluster();
+    case kWeakPropertyCid:
+      return new (Z) WeakPropertyDeserializationCluster();
     case kLinkedHashMapCid:
       return new (Z) LinkedHashMapDeserializationCluster();
     case kArrayCid:
@@ -4720,7 +4885,8 @@
         return new (Z) TwoByteStringDeserializationCluster();
       }
     }
-    default: break;
+    default:
+      break;
   }
   FATAL1("No cluster defined for cid %" Pd, cid);
   return NULL;
@@ -4737,8 +4903,7 @@
   if (PendingBytes() < version_len) {
     const intptr_t kMessageBufferSize = 128;
     char message_buffer[kMessageBufferSize];
-    OS::SNPrint(message_buffer,
-                kMessageBufferSize,
+    OS::SNPrint(message_buffer, kMessageBufferSize,
                 "No full snapshot version found, expected '%s'",
                 expected_version);
     // This can also fail while bringing up the VM isolate, so make sure to
@@ -4753,11 +4918,9 @@
     const intptr_t kMessageBufferSize = 256;
     char message_buffer[kMessageBufferSize];
     char* actual_version = OS::StrNDup(version, version_len);
-    OS::SNPrint(message_buffer,
-                kMessageBufferSize,
+    OS::SNPrint(message_buffer, kMessageBufferSize,
                 "Wrong %s snapshot version, expected '%s' found '%s'",
-                (Snapshot::IsFull(kind_)) ? "full" : "script",
-                expected_version,
+                (Snapshot::IsFull(kind_)) ? "full" : "script", expected_version,
                 actual_version);
     free(actual_version);
     // This can also fail while bringing up the VM isolate, so make sure to
@@ -4778,13 +4941,11 @@
       strncmp(features, expected_features, expected_len)) {
     const intptr_t kMessageBufferSize = 256;
     char message_buffer[kMessageBufferSize];
-    char* actual_features = OS::StrNDup(features, buffer_len < 128 ? buffer_len
-                                                                   : 128);
-    OS::SNPrint(message_buffer,
-                kMessageBufferSize,
+    char* actual_features =
+        OS::StrNDup(features, buffer_len < 128 ? buffer_len : 128);
+    OS::SNPrint(message_buffer, kMessageBufferSize,
                 "Wrong features in snapshot, expected '%s' found '%s'",
-                expected_features,
-                actual_features);
+                expected_features, actual_features);
     free(const_cast<char*>(expected_features));
     free(actual_features);
     // This can also fail while bringing up the VM isolate, so make sure to
@@ -4811,8 +4972,8 @@
   // TODO(rmacnak): Verify num of base objects.
 
   {
-    NOT_IN_PRODUCT(TimelineDurationScope tds(thread(),
-        Timeline::GetIsolateStream(), "ReadAlloc"));
+    NOT_IN_PRODUCT(TimelineDurationScope tds(
+        thread(), Timeline::GetIsolateStream(), "ReadAlloc"));
     for (intptr_t i = 0; i < num_clusters_; i++) {
       clusters_[i] = ReadCluster();
       clusters_[i]->ReadAlloc(this);
@@ -4827,8 +4988,8 @@
   ASSERT((next_ref_index_ - 1) == num_objects_);
 
   {
-    NOT_IN_PRODUCT(TimelineDurationScope tds(thread(),
-        Timeline::GetIsolateStream(), "ReadFill"));
+    NOT_IN_PRODUCT(TimelineDurationScope tds(
+        thread(), Timeline::GetIsolateStream(), "ReadFill"));
     for (intptr_t i = 0; i < num_clusters_; i++) {
       clusters_[i]->ReadFill(this);
 #if defined(DEBUG)
@@ -4843,11 +5004,9 @@
  public:
   HeapLocker(Thread* thread, PageSpace* page_space)
       : StackResource(thread), page_space_(page_space) {
-        page_space_->AcquireDataLock();
+    page_space_->AcquireDataLock();
   }
-  ~HeapLocker() {
-    page_space_->ReleaseDataLock();
-  }
+  ~HeapLocker() { page_space_->ReleaseDataLock(); }
 
  private:
   PageSpace* page_space_;
@@ -4972,8 +5131,8 @@
 #endif
 
   {
-    NOT_IN_PRODUCT(TimelineDurationScope tds(thread(),
-        Timeline::GetIsolateStream(), "PostLoad"));
+    NOT_IN_PRODUCT(TimelineDurationScope tds(
+        thread(), Timeline::GetIsolateStream(), "PostLoad"));
     for (intptr_t i = 0; i < num_clusters_; i++) {
       clusters_[i]->PostLoad(refs, kind_, zone_);
     }
@@ -4990,15 +5149,15 @@
 // they will be shared across all isolates.
 class SnapshotTokenStreamVisitor : public ObjectVisitor {
  public:
-  explicit SnapshotTokenStreamVisitor(Thread* thread) :
-      objHandle_(Object::Handle(thread->zone())),
-      count_(0),
-      token_streams_(NULL) {}
+  explicit SnapshotTokenStreamVisitor(Thread* thread)
+      : objHandle_(Object::Handle(thread->zone())),
+        count_(0),
+        token_streams_(NULL) {}
 
-  SnapshotTokenStreamVisitor(Thread* thread, const Array* token_streams) :
-      objHandle_(Object::Handle(thread->zone())),
-      count_(0),
-      token_streams_(token_streams) {}
+  SnapshotTokenStreamVisitor(Thread* thread, const Array* token_streams)
+      : objHandle_(Object::Handle(thread->zone())),
+        count_(0),
+        token_streams_(token_streams) {}
 
   void VisitObject(RawObject* obj) {
     if (obj->IsTokenStream()) {
@@ -5052,8 +5211,8 @@
   ASSERT(isolate()->background_compiler() == NULL);
 
   if (vm_isolate_snapshot_buffer != NULL) {
-    NOT_IN_PRODUCT(TimelineDurationScope tds(thread(),
-        Timeline::GetIsolateStream(), "PrepareNewVMIsolate"));
+    NOT_IN_PRODUCT(TimelineDurationScope tds(
+        thread(), Timeline::GetIsolateStream(), "PrepareNewVMIsolate"));
 
     // Collect all the token stream objects into an array so that we can write
     // it out as part of the VM isolate snapshot. We first count the number of
@@ -5096,16 +5255,12 @@
 
 
 intptr_t FullSnapshotWriter::WriteVmIsolateSnapshot() {
-  NOT_IN_PRODUCT(TimelineDurationScope tds(thread(),
-      Timeline::GetIsolateStream(), "WriteVmIsolateSnapshot"));
+  NOT_IN_PRODUCT(TimelineDurationScope tds(
+      thread(), Timeline::GetIsolateStream(), "WriteVmIsolateSnapshot"));
 
   ASSERT(vm_isolate_snapshot_buffer_ != NULL);
-  Serializer serializer(thread(),
-                        kind_,
-                        vm_isolate_snapshot_buffer_,
-                        alloc_,
-                        kInitialSize,
-                        instructions_writer_);
+  Serializer serializer(thread(), kind_, vm_isolate_snapshot_buffer_, alloc_,
+                        kInitialSize, instructions_writer_);
 
   serializer.ReserveHeader();
   serializer.WriteVersionAndFeatures();
@@ -5115,8 +5270,8 @@
    * - all the token streams
    * - the stub code (precompiled snapshots only)
    **/
-  intptr_t num_objects = serializer.WriteVMSnapshot(new_vm_symbol_table_,
-                                                    token_streams_);
+  intptr_t num_objects =
+      serializer.WriteVMSnapshot(new_vm_symbol_table_, token_streams_);
   serializer.FillHeader(serializer.kind());
 
   vm_isolate_snapshot_size_ = serializer.bytes_written();
@@ -5124,17 +5279,12 @@
 }
 
 
-void FullSnapshotWriter::WriteIsolateFullSnapshot(
-    intptr_t num_base_objects) {
-  NOT_IN_PRODUCT(TimelineDurationScope tds(thread(),
-      Timeline::GetIsolateStream(), "WriteIsolateFullSnapshot"));
+void FullSnapshotWriter::WriteIsolateFullSnapshot(intptr_t num_base_objects) {
+  NOT_IN_PRODUCT(TimelineDurationScope tds(
+      thread(), Timeline::GetIsolateStream(), "WriteIsolateFullSnapshot"));
 
-  Serializer serializer(thread(),
-                        kind_,
-                        isolate_snapshot_buffer_,
-                        alloc_,
-                        kInitialSize,
-                        instructions_writer_);
+  Serializer serializer(thread(), kind_, isolate_snapshot_buffer_, alloc_,
+                        kInitialSize, instructions_writer_);
   ObjectStore* object_store = isolate()->object_store();
   ASSERT(object_store != NULL);
 
@@ -5158,31 +5308,36 @@
 
   WriteIsolateFullSnapshot(num_base_objects);
 
-  if (Snapshot::IncludesCode(kind_)) {
-    instructions_writer_->Write();
-
+  if (FLAG_print_snapshot_sizes) {
     OS::Print("VMIsolate(CodeSize): %" Pd "\n", VmIsolateSnapshotSize());
     OS::Print("Isolate(CodeSize): %" Pd "\n", IsolateSnapshotSize());
-    OS::Print("ReadOnlyData(CodeSize): %" Pd "\n",
-              instructions_writer_->data_size());
-    OS::Print("Instructions(CodeSize): %" Pd "\n",
-              instructions_writer_->text_size());
-    intptr_t total = VmIsolateSnapshotSize() +
-                     IsolateSnapshotSize() +
-                     instructions_writer_->data_size() +
-                     instructions_writer_->text_size();
-    OS::Print("Total(CodeSize): %" Pd "\n", total);
+  }
+  intptr_t total_size = VmIsolateSnapshotSize() + IsolateSnapshotSize();
+
+  if (Snapshot::IncludesCode(kind_)) {
+    instructions_writer_->Write(
+        *vm_isolate_snapshot_buffer_, vm_isolate_snapshot_size_,
+        *isolate_snapshot_buffer_, isolate_snapshot_size_);
+
+    if (FLAG_print_snapshot_sizes) {
+      OS::Print("ReadOnlyData(CodeSize): %" Pd "\n",
+                instructions_writer_->data_size());
+      OS::Print("Instructions(CodeSize): %" Pd "\n",
+                instructions_writer_->text_size());
+    }
+    total_size +=
+        instructions_writer_->data_size() + instructions_writer_->text_size();
+  }
+
+  if (FLAG_print_snapshot_sizes) {
+    OS::Print("Total(CodeSize): %" Pd "\n", total_size);
   }
 }
 
 
 RawApiError* IsolateSnapshotReader::ReadFullSnapshot() {
-  Deserializer deserializer(thread_,
-                            kind_,
-                            buffer_,
-                            size_,
-                            instructions_buffer_,
-                            data_buffer_);
+  Deserializer deserializer(thread_, kind_, buffer_, size_,
+                            instructions_buffer_, data_buffer_);
 
   RawApiError* error = deserializer.VerifyVersionAndFeatures();
   if (error != ApiError::null()) {
@@ -5196,12 +5351,8 @@
 
 
 RawApiError* VmIsolateSnapshotReader::ReadVmIsolateSnapshot() {
-  Deserializer deserializer(thread_,
-                            kind_,
-                            buffer_,
-                            size_,
-                            instructions_buffer_,
-                            data_buffer_);
+  Deserializer deserializer(thread_, kind_, buffer_, size_,
+                            instructions_buffer_, data_buffer_);
 
   RawApiError* error = deserializer.VerifyVersionAndFeatures();
   if (error != ApiError::null()) {
diff --git a/runtime/vm/clustered_snapshot.h b/runtime/vm/clustered_snapshot.h
index aae4e82..21fc29c 100644
--- a/runtime/vm/clustered_snapshot.h
+++ b/runtime/vm/clustered_snapshot.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_CLUSTERED_SNAPSHOT_H_
-#define VM_CLUSTERED_SNAPSHOT_H_
+#ifndef RUNTIME_VM_CLUSTERED_SNAPSHOT_H_
+#define RUNTIME_VM_CLUSTERED_SNAPSHOT_H_
 
 #include "platform/assert.h"
 #include "vm/allocation.h"
@@ -46,7 +46,7 @@
 
 class SerializationCluster : public ZoneAllocated {
  public:
-  virtual ~SerializationCluster() { }
+  virtual ~SerializationCluster() {}
 
   // Add [object] to the cluster and push its outgoing references.
   virtual void Trace(Serializer* serializer, RawObject* object) = 0;
@@ -63,8 +63,8 @@
 
 class DeserializationCluster : public ZoneAllocated {
  public:
-  DeserializationCluster() : start_index_(-1), stop_index_(-1) { }
-  virtual ~DeserializationCluster() { }
+  DeserializationCluster() : start_index_(-1), stop_index_(-1) {}
+  virtual ~DeserializationCluster() {}
 
   // Allocate memory for all objects in the cluster and write their addresses
   // into the ref array. Do not touch this memory.
@@ -75,7 +75,7 @@
 
   // Complete any action that requires the full graph to be deserialized, such
   // as rehashing.
-  virtual void PostLoad(const Array& refs, Snapshot::Kind kind, Zone* zone) { }
+  virtual void PostLoad(const Array& refs, Snapshot::Kind kind, Zone* zone) {}
 
  protected:
   // The range of the ref array that belongs to this cluster.
@@ -86,7 +86,7 @@
 
 class SmiObjectIdPair {
  public:
-  SmiObjectIdPair() : smi_(NULL), id_(0) { }
+  SmiObjectIdPair() : smi_(NULL), id_(0) {}
   RawSmi* smi_;
   intptr_t id_;
 
@@ -186,9 +186,7 @@
     }
   }
 
-  void AddUntracedRef() {
-    num_written_objects_++;
-  }
+  void AddUntracedRef() { num_written_objects_++; }
 
   void Trace(RawObject* object);
 
@@ -314,25 +312,17 @@
     return ReadStream::Raw<sizeof(T), T>::Read(&stream_);
   }
 
-  void ReadBytes(uint8_t* addr, intptr_t len) {
-    stream_.ReadBytes(addr, len);
-  }
+  void ReadBytes(uint8_t* addr, intptr_t len) { stream_.ReadBytes(addr, len); }
 
   const uint8_t* CurrentBufferAddress() const {
     return stream_.AddressOfCurrentPosition();
   }
 
-  void Advance(intptr_t value) {
-    stream_.Advance(value);
-  }
+  void Advance(intptr_t value) { stream_.Advance(value); }
 
-  intptr_t PendingBytes() const {
-    return stream_.PendingBytes();
-  }
+  intptr_t PendingBytes() const { return stream_.PendingBytes(); }
 
-  void AddBaseObject(RawObject* base_object) {
-    AssignRef(base_object);
-  }
+  void AddBaseObject(RawObject* base_object) { AssignRef(base_object); }
 
   void AssignRef(RawObject* object) {
     ASSERT(next_ref_index_ <= num_objects_);
@@ -407,9 +397,7 @@
     return vm_isolate_snapshot_buffer_;
   }
 
-  uint8_t** isolate_snapshot_buffer() const {
-    return isolate_snapshot_buffer_;
-  }
+  uint8_t** isolate_snapshot_buffer() const { return isolate_snapshot_buffer_; }
 
   Thread* thread() const { return thread_; }
   Zone* zone() const { return thread_->zone(); }
@@ -419,12 +407,8 @@
   // Writes a full snapshot of the Isolate.
   void WriteFullSnapshot();
 
-  intptr_t VmIsolateSnapshotSize() const {
-    return vm_isolate_snapshot_size_;
-  }
-  intptr_t IsolateSnapshotSize() const {
-    return isolate_snapshot_size_;
-  }
+  intptr_t VmIsolateSnapshotSize() const { return vm_isolate_snapshot_size_; }
+  intptr_t IsolateSnapshotSize() const { return isolate_snapshot_size_; }
 
  private:
   // Writes a snapshot of the VM Isolate.
@@ -457,17 +441,17 @@
                           intptr_t size,
                           const uint8_t* instructions_buffer,
                           const uint8_t* data_buffer,
-                          Thread* thread) :
-      kind_(kind),
-      thread_(thread),
-      buffer_(buffer),
-      size_(size),
-      instructions_buffer_(instructions_buffer),
-      data_buffer_(data_buffer) {
+                          Thread* thread)
+      : kind_(kind),
+        thread_(thread),
+        buffer_(buffer),
+        size_(size),
+        instructions_buffer_(instructions_buffer),
+        data_buffer_(data_buffer) {
     thread->isolate()->set_compilation_allowed(kind != Snapshot::kAppNoJIT);
   }
 
-  ~VmIsolateSnapshotReader() { }
+  ~VmIsolateSnapshotReader() {}
 
   RawApiError* ReadVmIsolateSnapshot();
 
@@ -490,13 +474,13 @@
                         intptr_t size,
                         const uint8_t* instructions_buffer,
                         const uint8_t* data_buffer,
-                        Thread* thread) :
-      kind_(kind),
-      thread_(thread),
-      buffer_(buffer),
-      size_(size),
-      instructions_buffer_(instructions_buffer),
-      data_buffer_(data_buffer) {
+                        Thread* thread)
+      : kind_(kind),
+        thread_(thread),
+        buffer_(buffer),
+        size_(size),
+        instructions_buffer_(instructions_buffer),
+        data_buffer_(data_buffer) {
     thread->isolate()->set_compilation_allowed(kind != Snapshot::kAppNoJIT);
   }
 
@@ -517,4 +501,4 @@
 
 }  // namespace dart
 
-#endif  // VM_CLUSTERED_SNAPSHOT_H_
+#endif  // RUNTIME_VM_CLUSTERED_SNAPSHOT_H_
diff --git a/runtime/vm/code_descriptors.cc b/runtime/vm/code_descriptors.cc
index b7b4326..ece0fd8 100644
--- a/runtime/vm/code_descriptors.cc
+++ b/runtime/vm/code_descriptors.cc
@@ -41,7 +41,6 @@
 }
 
 
-
 void CodeSourceMapBuilder::AddEntry(intptr_t pc_offset,
                                     TokenPosition token_pos) {
   // Require pc offset to monotonically increase.
@@ -119,19 +118,13 @@
       // Check it is uninitialized.
       ASSERT((list_[i].outer_try_index == -1) &&
              (list_[i].pc_offset == ExceptionHandlers::kInvalidPcOffset));
-      handlers.SetHandlerInfo(i,
-                              list_[i].outer_try_index,
-                              list_[i].pc_offset,
-                              list_[i].needs_stacktrace,
-                              has_catch_all);
+      handlers.SetHandlerInfo(i, list_[i].outer_try_index, list_[i].pc_offset,
+                              list_[i].needs_stacktrace, has_catch_all);
       handlers.SetHandledTypes(i, Array::empty_array());
     } else {
       const bool has_catch_all = ContainsDynamic(*list_[i].handler_types);
-      handlers.SetHandlerInfo(i,
-                              list_[i].outer_try_index,
-                              list_[i].pc_offset,
-                              list_[i].needs_stacktrace,
-                              has_catch_all);
+      handlers.SetHandlerInfo(i, list_[i].outer_try_index, list_[i].pc_offset,
+                              list_[i].needs_stacktrace, has_catch_all);
       handlers.SetHandledTypes(i, *list_[i].handler_types);
     }
   }
diff --git a/runtime/vm/code_descriptors.h b/runtime/vm/code_descriptors.h
index c5eeda7..58f1af7 100644
--- a/runtime/vm/code_descriptors.h
+++ b/runtime/vm/code_descriptors.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_CODE_DESCRIPTORS_H_
-#define VM_CODE_DESCRIPTORS_H_
+#ifndef RUNTIME_VM_CODE_DESCRIPTORS_H_
+#define RUNTIME_VM_CODE_DESCRIPTORS_H_
 
 #include "vm/ast.h"
 #include "vm/code_generator.h"
@@ -16,12 +16,12 @@
 class DescriptorList : public ZoneAllocated {
  public:
   explicit DescriptorList(intptr_t initial_capacity)
-    : encoded_data_(initial_capacity),
-      prev_pc_offset(0),
-      prev_deopt_id(0),
-      prev_token_pos(0) {}
+      : encoded_data_(initial_capacity),
+        prev_pc_offset(0),
+        prev_deopt_id(0),
+        prev_token_pos(0) {}
 
-  ~DescriptorList() { }
+  ~DescriptorList() {}
 
   void AddDescriptor(RawPcDescriptors::Kind kind,
                      intptr_t pc_offset,
@@ -45,11 +45,9 @@
 class CodeSourceMapBuilder : public ZoneAllocated {
  public:
   explicit CodeSourceMapBuilder(intptr_t initial_capacity = 64)
-    : encoded_data_(initial_capacity),
-      prev_pc_offset(0),
-      prev_token_pos(0) {}
+      : encoded_data_(initial_capacity), prev_pc_offset(0), prev_token_pos(0) {}
 
-  ~CodeSourceMapBuilder() { }
+  ~CodeSourceMapBuilder() {}
 
   void AddEntry(intptr_t pc_offset, TokenPosition token_pos);
 
@@ -70,8 +68,8 @@
   StackmapTableBuilder()
       : stack_map_(Stackmap::ZoneHandle()),
         list_(GrowableObjectArray::ZoneHandle(
-            GrowableObjectArray::New(Heap::kOld))) { }
-  ~StackmapTableBuilder() { }
+            GrowableObjectArray::New(Heap::kOld))) {}
+  ~StackmapTableBuilder() {}
 
   void AddEntry(intptr_t pc_offset,
                 BitmapBuilder* bitmap,
@@ -94,17 +92,15 @@
 class ExceptionHandlerList : public ZoneAllocated {
  public:
   struct HandlerDesc {
-    intptr_t outer_try_index;  // Try block in which this try block is nested.
-    intptr_t pc_offset;        // Handler PC offset value.
-    const Array* handler_types;   // Catch clause guards.
+    intptr_t outer_try_index;    // Try block in which this try block is nested.
+    intptr_t pc_offset;          // Handler PC offset value.
+    const Array* handler_types;  // Catch clause guards.
     bool needs_stacktrace;
   };
 
   ExceptionHandlerList() : list_() {}
 
-  intptr_t Length() const {
-    return list_.length();
-  }
+  intptr_t Length() const { return list_.length(); }
 
   void AddPlaceHolder() {
     struct HandlerDesc data;
@@ -165,4 +161,4 @@
 
 }  // namespace dart
 
-#endif  // VM_CODE_DESCRIPTORS_H_
+#endif  // RUNTIME_VM_CODE_DESCRIPTORS_H_
diff --git a/runtime/vm/code_descriptors_test.cc b/runtime/vm/code_descriptors_test.cc
index 99b5b57..ec481fb 100644
--- a/runtime/vm/code_descriptors_test.cc
+++ b/runtime/vm/code_descriptors_test.cc
@@ -56,7 +56,7 @@
     stack_bitmap->SetLength(kStackSlotCount);
     EXPECT_EQ(kStackSlotCount, stack_bitmap->Length());
 
-    bool expectation0[kStackSlotCount] = { true };
+    bool expectation0[kStackSlotCount] = {true};
     for (intptr_t i = 0; i < kStackSlotCount; ++i) {
       EXPECT_EQ(expectation0[i], stack_bitmap->Get(i));
     }
@@ -73,7 +73,7 @@
     stack_bitmap->SetLength(kStackSlotCount);
     EXPECT_EQ(kStackSlotCount, stack_bitmap->Length());
 
-    bool expectation1[kStackSlotCount] = { true, false, true };
+    bool expectation1[kStackSlotCount] = {true, false, true};
     for (intptr_t i = 0; i < kStackSlotCount; ++i) {
       EXPECT_EQ(expectation1[i], stack_bitmap->Get(i));
     }
@@ -91,8 +91,7 @@
     stack_bitmap->SetLength(kStackSlotCount);
     EXPECT_EQ(kStackSlotCount, stack_bitmap->Length());
 
-    bool expectation2[kStackSlotCount] =
-        { true, false, true, true, true, true };
+    bool expectation2[kStackSlotCount] = {true, false, true, true, true, true};
     for (intptr_t i = 0; i < kStackSlotCount; ++i) {
       EXPECT_EQ(expectation2[i], stack_bitmap->Get(i));
     }
@@ -112,9 +111,8 @@
     stack_bitmap->SetLength(kStackSlotCount);
     EXPECT_EQ(kStackSlotCount, stack_bitmap->Length());
 
-    bool expectation3[kStackSlotCount] =
-        { true, false, true, true, true, true, false, false,
-          false, false, true };
+    bool expectation3[kStackSlotCount] = {
+        true, false, true, true, true, true, false, false, false, false, true};
     for (intptr_t i = 0; i < kStackSlotCount; ++i) {
       EXPECT_EQ(expectation3[i], stack_bitmap->Get(i));
     }
@@ -220,8 +218,8 @@
   const String& name = String::Handle(String::New(TestCase::url()));
   const Library& lib = Library::Handle(Library::LookupLibrary(thread, name));
   EXPECT(!lib.IsNull());
-  Class& cls = Class::Handle(
-      lib.LookupClass(String::Handle(Symbols::New(thread, "A"))));
+  Class& cls =
+      Class::Handle(lib.LookupClass(String::Handle(Symbols::New(thread, "A"))));
   EXPECT(!cls.IsNull());
 
   // Now compile the two functions 'A.foo' and 'A.moo'
@@ -244,17 +242,16 @@
   BitmapBuilder* stack_bitmap = new BitmapBuilder();
   EXPECT(stack_bitmap != NULL);
   stack_bitmap->Set(0, false);  // var i.
-  stack_bitmap->Set(1, true);  // var s1.
+  stack_bitmap->Set(1, true);   // var s1.
   stack_bitmap->Set(2, false);  // var k.
-  stack_bitmap->Set(3, true);  // var s2.
-  stack_bitmap->Set(4, true);  // var s3.
+  stack_bitmap->Set(3, true);   // var s2.
+  stack_bitmap->Set(4, true);   // var s3.
   const Code& code = Code::Handle(function_foo.unoptimized_code());
   // Search for the pc of the call to 'func'.
   const PcDescriptors& descriptors =
       PcDescriptors::Handle(code.pc_descriptors());
   int call_count = 0;
-  PcDescriptors::Iterator iter(descriptors,
-                               RawPcDescriptors::kUnoptStaticCall);
+  PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kUnoptStaticCall);
   while (iter.MoveNext()) {
     stackmap_table_builder->AddEntry(iter.PcOffset(), stack_bitmap, 0);
     ++call_count;
@@ -279,22 +276,22 @@
   DescriptorList* descriptors = new DescriptorList(64);
   ASSERT(descriptors != NULL);
   const intptr_t token_positions[] = {
-    kMinInt32,
-    5,
-    13,
-    13,
-    13,
-    13,
-    31,
-    23,
-    23,
-    23,
-    33,
-    33,
-    5,
-    5,
-    TokenPosition::kMinSourcePos,
-    TokenPosition::kMaxSourcePos,
+      kMinInt32,
+      5,
+      13,
+      13,
+      13,
+      13,
+      31,
+      23,
+      23,
+      23,
+      33,
+      33,
+      5,
+      5,
+      TokenPosition::kMinSourcePos,
+      TokenPosition::kMaxSourcePos,
   };
   const intptr_t num_token_positions =
       sizeof(token_positions) / sizeof(token_positions[0]);
@@ -314,8 +311,8 @@
   intptr_t i = 0;
   while (it.MoveNext()) {
     if (token_positions[i] != it.TokenPos().value()) {
-      OS::Print("[%" Pd "]: Expected: %" Pd " != %" Pd "\n",
-                i, token_positions[i], it.TokenPos().value());
+      OS::Print("[%" Pd "]: Expected: %" Pd " != %" Pd "\n", i,
+                token_positions[i], it.TokenPos().value());
     }
     EXPECT(token_positions[i] == it.TokenPos().value());
     i++;
@@ -325,22 +322,22 @@
 
 TEST_CASE(CodeSourceMap_TokenPositions) {
   const intptr_t token_positions[] = {
-    kMinInt32,
-    5,
-    13,
-    13,
-    13,
-    13,
-    31,
-    23,
-    23,
-    23,
-    33,
-    33,
-    5,
-    5,
-    TokenPosition::kMinSourcePos,
-    TokenPosition::kMaxSourcePos,
+      kMinInt32,
+      5,
+      13,
+      13,
+      13,
+      13,
+      31,
+      23,
+      23,
+      23,
+      33,
+      33,
+      5,
+      5,
+      TokenPosition::kMinSourcePos,
+      TokenPosition::kMaxSourcePos,
   };
   const intptr_t num_token_positions =
       sizeof(token_positions) / sizeof(token_positions[0]);
@@ -362,8 +359,8 @@
   while (it.MoveNext()) {
     EXPECT(it.PcOffset() == i);
     if (token_positions[i] != it.TokenPos().value()) {
-      OS::Print("[%" Pd "]: Expected: %" Pd " != %" Pd "\n",
-                i, token_positions[i], it.TokenPos().value());
+      OS::Print("[%" Pd "]: Expected: %" Pd " != %" Pd "\n", i,
+                token_positions[i], it.TokenPos().value());
     }
     EXPECT(token_positions[i] == it.TokenPos().value());
     i++;
diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc
index 6bfbdb8..4a35895 100644
--- a/runtime/vm/code_generator.cc
+++ b/runtime/vm/code_generator.cc
@@ -28,20 +28,34 @@
 
 namespace dart {
 
-DEFINE_FLAG(int, max_subtype_cache_entries, 100,
+DEFINE_FLAG(
+    int,
+    max_subtype_cache_entries,
+    100,
     "Maximum number of subtype cache entries (number of checks cached).");
-DEFINE_FLAG(int, regexp_optimization_counter_threshold, 1000,
+DEFINE_FLAG(
+    int,
+    regexp_optimization_counter_threshold,
+    1000,
     "RegExp's usage-counter value before it is optimized, -1 means never");
-DEFINE_FLAG(int, reoptimization_counter_threshold, 4000,
-    "Counter threshold before a function gets reoptimized.");
+DEFINE_FLAG(int,
+            reoptimization_counter_threshold,
+            4000,
+            "Counter threshold before a function gets reoptimized.");
 DEFINE_FLAG(bool, trace_deoptimization, false, "Trace deoptimization");
-DEFINE_FLAG(bool, trace_deoptimization_verbose, false,
-    "Trace deoptimization verbose");
+DEFINE_FLAG(bool,
+            trace_deoptimization_verbose,
+            false,
+            "Trace deoptimization verbose");
 DEFINE_FLAG(bool, trace_ic, false, "Trace IC handling");
-DEFINE_FLAG(bool, trace_ic_miss_in_optimized, false,
-    "Trace IC miss in optimized code");
-DEFINE_FLAG(bool, trace_optimized_ic_calls, false,
-    "Trace IC calls in optimized code.");
+DEFINE_FLAG(bool,
+            trace_ic_miss_in_optimized,
+            false,
+            "Trace IC miss in optimized code");
+DEFINE_FLAG(bool,
+            trace_optimized_ic_calls,
+            false,
+            "Trace IC calls in optimized code.");
 DEFINE_FLAG(bool, trace_patching, false, "Trace patching of code.");
 DEFINE_FLAG(bool, trace_runtime_calls, false, "Trace runtime calls");
 DEFINE_FLAG(bool, trace_type_checks, false, "Trace runtime type checks.");
@@ -54,11 +68,17 @@
 
 DEFINE_FLAG(bool, trace_osr, false, "Trace attempts at on-stack replacement.");
 
-DEFINE_FLAG(int, stacktrace_every, 0,
+DEFINE_FLAG(int,
+            stacktrace_every,
+            0,
             "Compute debugger stacktrace on every N stack overflow checks");
-DEFINE_FLAG(charp, stacktrace_filter, NULL,
+DEFINE_FLAG(charp,
+            stacktrace_filter,
+            NULL,
             "Compute stacktrace in named function on stack overflow checks");
-DEFINE_FLAG(charp, deoptimize_filter, NULL,
+DEFINE_FLAG(charp,
+            deoptimize_filter,
+            NULL,
             "Deoptimize in named function on stack overflow checks");
 
 DECLARE_FLAG(int, reload_every);
@@ -66,7 +86,9 @@
 DECLARE_FLAG(bool, reload_every_back_off);
 
 #ifdef DEBUG
-DEFINE_FLAG(charp, gc_at_instance_allocation, NULL,
+DEFINE_FLAG(charp,
+            gc_at_instance_allocation,
+            NULL,
             "Perform a GC before allocation of instances of "
             "the specified class");
 #endif
@@ -76,8 +98,8 @@
   const String& function_name = String::Handle(function.name());
   const String& class_name =
       String::Handle(Class::Handle(function.Owner()).Name());
-  OS::PrintErr("> Entering '%s.%s'\n",
-      class_name.ToCString(), function_name.ToCString());
+  OS::PrintErr("> Entering '%s.%s'\n", class_name.ToCString(),
+               function_name.ToCString());
 }
 
 
@@ -86,8 +108,8 @@
   const String& function_name = String::Handle(function.name());
   const String& class_name =
       String::Handle(Class::Handle(function.Owner()).Name());
-  OS::PrintErr("< Exiting '%s.%s'\n",
-      class_name.ToCString(), function_name.ToCString());
+  OS::PrintErr("< Exiting '%s.%s'\n", class_name.ToCString(),
+               function_name.ToCString());
 }
 
 
@@ -225,11 +247,11 @@
   if (!bound_error.IsNull()) {
     // Throw a dynamic type error.
     const TokenPosition location = GetCallerLocation();
-    String& bound_error_message =  String::Handle(
-        zone, String::New(bound_error.ToErrorCString()));
-    Exceptions::CreateAndThrowTypeError(
-        location, AbstractType::Handle(zone), AbstractType::Handle(zone),
-        Symbols::Empty(), bound_error_message);
+    String& bound_error_message =
+        String::Handle(zone, String::New(bound_error.ToErrorCString()));
+    Exceptions::CreateAndThrowTypeError(location, AbstractType::Handle(zone),
+                                        AbstractType::Handle(zone),
+                                        Symbols::Empty(), bound_error_message);
     UNREACHABLE();
   }
   if (type.IsTypeRef()) {
@@ -258,14 +280,13 @@
   ASSERT(instantiator.IsNull() || !type_arguments.IsUninstantiatedIdentity());
   if (isolate->type_checks()) {
     Error& bound_error = Error::Handle(zone);
-    type_arguments =
-        type_arguments.InstantiateAndCanonicalizeFrom(instantiator,
-                                                      &bound_error);
+    type_arguments = type_arguments.InstantiateAndCanonicalizeFrom(
+        instantiator, &bound_error);
     if (!bound_error.IsNull()) {
       // Throw a dynamic type error.
       const TokenPosition location = GetCallerLocation();
-      String& bound_error_message =  String::Handle(
-          zone, String::New(bound_error.ToErrorCString()));
+      String& bound_error_message =
+          String::Handle(zone, String::New(bound_error.ToErrorCString()));
       Exceptions::CreateAndThrowTypeError(
           location, AbstractType::Handle(zone), AbstractType::Handle(zone),
           Symbols::Empty(), bound_error_message);
@@ -308,46 +329,42 @@
 
 
 // Helper routine for tracing a type check.
-static void PrintTypeCheck(
-    const char* message,
-    const Instance& instance,
-    const AbstractType& type,
-    const TypeArguments& instantiator_type_arguments,
-    const Bool& result) {
+static void PrintTypeCheck(const char* message,
+                           const Instance& instance,
+                           const AbstractType& type,
+                           const TypeArguments& instantiator_type_arguments,
+                           const Bool& result) {
   DartFrameIterator iterator;
   StackFrame* caller_frame = iterator.NextFrame();
   ASSERT(caller_frame != NULL);
 
-  const AbstractType& instance_type = AbstractType::Handle(instance.GetType());
+  const AbstractType& instance_type =
+      AbstractType::Handle(instance.GetType(Heap::kNew));
   ASSERT(instance_type.IsInstantiated());
   if (type.IsInstantiated()) {
-    OS::PrintErr("%s: '%s' %" Pd " %s '%s' %" Pd " (pc: %#" Px ").\n",
-                 message,
+    OS::PrintErr("%s: '%s' %" Pd " %s '%s' %" Pd " (pc: %#" Px ").\n", message,
                  String::Handle(instance_type.Name()).ToCString(),
                  Class::Handle(instance_type.type_class()).id(),
                  (result.raw() == Bool::True().raw()) ? "is" : "is !",
                  String::Handle(type.Name()).ToCString(),
-                 Class::Handle(type.type_class()).id(),
-                 caller_frame->pc());
+                 Class::Handle(type.type_class()).id(), caller_frame->pc());
   } else {
     // Instantiate type before printing.
     Error& bound_error = Error::Handle();
-    const AbstractType& instantiated_type = AbstractType::Handle(
-        type.InstantiateFrom(instantiator_type_arguments, &bound_error,
-                             NULL, NULL, Heap::kOld));
+    const AbstractType& instantiated_type =
+        AbstractType::Handle(type.InstantiateFrom(
+            instantiator_type_arguments, &bound_error, NULL, NULL, Heap::kOld));
     OS::PrintErr("%s: '%s' %s '%s' instantiated from '%s' (pc: %#" Px ").\n",
-                 message,
-                 String::Handle(instance_type.Name()).ToCString(),
+                 message, String::Handle(instance_type.Name()).ToCString(),
                  (result.raw() == Bool::True().raw()) ? "is" : "is !",
                  String::Handle(instantiated_type.Name()).ToCString(),
-                 String::Handle(type.Name()).ToCString(),
-                 caller_frame->pc());
+                 String::Handle(type.Name()).ToCString(), caller_frame->pc());
     if (!bound_error.IsNull()) {
       OS::Print("  bound error: %s\n", bound_error.ToErrorCString());
     }
   }
-  const Function& function = Function::Handle(
-      caller_frame->LookupDartFunction());
+  const Function& function =
+      Function::Handle(caller_frame->LookupDartFunction());
   OS::PrintErr(" -> Function %s\n", function.ToFullyQualifiedCString());
 }
 
@@ -406,12 +423,9 @@
   TypeArguments& last_instantiator_type_arguments = TypeArguments::Handle();
   Bool& last_result = Bool::Handle();
   for (intptr_t i = 0; i < len; ++i) {
-    new_cache.GetCheck(
-        i,
-        &last_instance_class_id_or_function,
-        &last_instance_type_arguments,
-        &last_instantiator_type_arguments,
-        &last_result);
+    new_cache.GetCheck(i, &last_instance_class_id_or_function,
+                       &last_instance_type_arguments,
+                       &last_instantiator_type_arguments, &last_result);
     if ((last_instance_class_id_or_function.raw() ==
          instance_class_id_or_function.raw()) &&
         (last_instance_type_arguments.raw() == instance_type_arguments.raw()) &&
@@ -419,46 +433,41 @@
          instantiator_type_arguments.raw())) {
       OS::PrintErr("  Error in test cache %p ix: %" Pd ",", new_cache.raw(), i);
       PrintTypeCheck(" duplicate cache entry", instance, type,
-          instantiator_type_arguments, result);
+                     instantiator_type_arguments, result);
       UNREACHABLE();
       return;
     }
   }
 #endif
-  new_cache.AddCheck(instance_class_id_or_function,
-                     instance_type_arguments,
-                     instantiator_type_arguments,
-                     result);
+  new_cache.AddCheck(instance_class_id_or_function, instance_type_arguments,
+                     instantiator_type_arguments, result);
   if (FLAG_trace_type_checks) {
     AbstractType& test_type = AbstractType::Handle(type.raw());
     if (!test_type.IsInstantiated()) {
       Error& bound_error = Error::Handle();
       test_type = type.InstantiateFrom(instantiator_type_arguments,
-                                       &bound_error,
-                                       NULL, NULL, Heap::kNew);
+                                       &bound_error, NULL, NULL, Heap::kNew);
       ASSERT(bound_error.IsNull());  // Malbounded types are not optimized.
     }
-    OS::PrintErr("  Updated test cache %p ix: %" Pd " with "
+    OS::PrintErr(
+        "  Updated test cache %p ix: %" Pd
+        " with "
         "(cid-or-fun: %p, type-args: %p, instantiator: %p, result: %s)\n"
-        "    instance  [class: (%p '%s' cid: %" Pd "),    type-args: %p %s]\n"
+        "    instance  [class: (%p '%s' cid: %" Pd
+        "),    type-args: %p %s]\n"
         "    test-type [class: (%p '%s' cid: %" Pd "), in-type-args: %p %s]\n",
-        new_cache.raw(),
-        len,
+        new_cache.raw(), len,
 
-        instance_class_id_or_function.raw(),
-        instance_type_arguments.raw(),
-        instantiator_type_arguments.raw(),
-        result.ToCString(),
+        instance_class_id_or_function.raw(), instance_type_arguments.raw(),
+        instantiator_type_arguments.raw(), result.ToCString(),
 
-        instance_class.raw(),
-        String::Handle(instance_class.Name()).ToCString(),
-        instance_class.id(),
-        instance_type_arguments.raw(),
+        instance_class.raw(), String::Handle(instance_class.Name()).ToCString(),
+        instance_class.id(), instance_type_arguments.raw(),
         instance_type_arguments.ToCString(),
 
         test_type.type_class(),
-        String::Handle(Class::Handle(test_type.type_class()).Name()).
-            ToCString(),
+        String::Handle(Class::Handle(test_type.type_class()).Name())
+            .ToCString(),
         Class::Handle(test_type.type_class()).id(),
         instantiator_type_arguments.raw(),
         instantiator_type_arguments.ToCString());
@@ -482,30 +491,28 @@
   const SubtypeTestCache& cache =
       SubtypeTestCache::CheckedHandle(zone, arguments.ArgAt(3));
   ASSERT(type.IsFinalized());
-  ASSERT(!type.IsMalformed());  // Already checked in code generator.
-  ASSERT(!type.IsMalbounded());  // Already checked in code generator.
+  ASSERT(!type.IsMalformed());    // Already checked in code generator.
+  ASSERT(!type.IsMalbounded());   // Already checked in code generator.
   ASSERT(!type.IsDynamicType());  // No need to check assignment.
   Error& bound_error = Error::Handle(zone);
-  const Bool& result =
-      Bool::Get(instance.IsInstanceOf(type,
-                                      instantiator_type_arguments,
-                                      &bound_error));
+  const Bool& result = Bool::Get(
+      instance.IsInstanceOf(type, instantiator_type_arguments, &bound_error));
   if (FLAG_trace_type_checks) {
-    PrintTypeCheck("InstanceOf",
-        instance, type, instantiator_type_arguments, result);
+    PrintTypeCheck("InstanceOf", instance, type, instantiator_type_arguments,
+                   result);
   }
   if (!result.value() && !bound_error.IsNull()) {
     // Throw a dynamic type error only if the instanceof test fails.
     const TokenPosition location = GetCallerLocation();
-    String& bound_error_message =  String::Handle(
-        zone, String::New(bound_error.ToErrorCString()));
-    Exceptions::CreateAndThrowTypeError(
-        location, AbstractType::Handle(zone), AbstractType::Handle(zone),
-        Symbols::Empty(), bound_error_message);
+    String& bound_error_message =
+        String::Handle(zone, String::New(bound_error.ToErrorCString()));
+    Exceptions::CreateAndThrowTypeError(location, AbstractType::Handle(zone),
+                                        AbstractType::Handle(zone),
+                                        Symbols::Empty(), bound_error_message);
     UNREACHABLE();
   }
-  UpdateTypeTestCache(
-      instance, type, instantiator_type_arguments, result, cache);
+  UpdateTypeTestCache(instance, type, instantiator_type_arguments, result,
+                      cache);
   arguments.SetReturn(result);
 }
 
@@ -528,42 +535,41 @@
   const String& dst_name = String::CheckedHandle(zone, arguments.ArgAt(3));
   const SubtypeTestCache& cache =
       SubtypeTestCache::CheckedHandle(zone, arguments.ArgAt(4));
-  ASSERT(!dst_type.IsMalformed());  // Already checked in code generator.
-  ASSERT(!dst_type.IsMalbounded());  // Already checked in code generator.
+  ASSERT(!dst_type.IsMalformed());    // Already checked in code generator.
+  ASSERT(!dst_type.IsMalbounded());   // Already checked in code generator.
   ASSERT(!dst_type.IsDynamicType());  // No need to check assignment.
-  ASSERT(!src_instance.IsNull());  // Already checked in inlined code.
+  ASSERT(!src_instance.IsNull());     // Already checked in inlined code.
 
   Error& bound_error = Error::Handle(zone);
   const bool is_instance_of = src_instance.IsInstanceOf(
       dst_type, instantiator_type_arguments, &bound_error);
 
   if (FLAG_trace_type_checks) {
-    PrintTypeCheck("TypeCheck",
-                   src_instance, dst_type, instantiator_type_arguments,
-                   Bool::Get(is_instance_of));
+    PrintTypeCheck("TypeCheck", src_instance, dst_type,
+                   instantiator_type_arguments, Bool::Get(is_instance_of));
   }
   if (!is_instance_of) {
     // Throw a dynamic type error.
     const TokenPosition location = GetCallerLocation();
     const AbstractType& src_type =
-        AbstractType::Handle(zone, src_instance.GetType());
+        AbstractType::Handle(zone, src_instance.GetType(Heap::kNew));
     if (!dst_type.IsInstantiated()) {
       // Instantiate dst_type before reporting the error.
       dst_type = dst_type.InstantiateFrom(instantiator_type_arguments, NULL,
                                           NULL, NULL, Heap::kNew);
       // Note that instantiated dst_type may be malbounded.
     }
-    String& bound_error_message =  String::Handle(zone);
+    String& bound_error_message = String::Handle(zone);
     if (!bound_error.IsNull()) {
       ASSERT(isolate->type_checks());
       bound_error_message = String::New(bound_error.ToErrorCString());
     }
-    Exceptions::CreateAndThrowTypeError(location, src_type, dst_type,
-                                        dst_name, bound_error_message);
+    Exceptions::CreateAndThrowTypeError(location, src_type, dst_type, dst_name,
+                                        bound_error_message);
     UNREACHABLE();
   }
-  UpdateTypeTestCache(
-      src_instance, dst_type, instantiator_type_arguments, Bool::True(), cache);
+  UpdateTypeTestCache(src_instance, dst_type, instantiator_type_arguments,
+                      Bool::True(), cache);
   arguments.SetReturn(src_instance);
 }
 
@@ -580,8 +586,11 @@
 
   if (src_instance.IsNull()) {
     const Array& args = Array::Handle(zone, Array::New(4));
-    args.SetAt(0, String::Handle(zone,
-        String::New("Failed assertion: boolean expression must not be null")));
+    args.SetAt(
+        0, String::Handle(
+               zone,
+               String::New(
+                   "Failed assertion: boolean expression must not be null")));
 
     // No source code for this assertion, set url to null.
     args.SetAt(1, String::Handle(zone, String::null()));
@@ -595,7 +604,7 @@
   ASSERT(!src_instance.IsBool());
   const Type& bool_interface = Type::Handle(Type::BoolType());
   const AbstractType& src_type =
-      AbstractType::Handle(zone, src_instance.GetType());
+      AbstractType::Handle(zone, src_instance.GetType(Heap::kNew));
   const String& no_bound_error = String::Handle(zone);
   Exceptions::CreateAndThrowTypeError(location, src_type, bool_interface,
                                       Symbols::BooleanExpression(),
@@ -616,23 +625,21 @@
   const AbstractType& dst_type =
       AbstractType::CheckedHandle(zone, arguments.ArgAt(2));
   const AbstractType& src_type =
-      AbstractType::Handle(zone, src_value.GetType());
-  Exceptions::CreateAndThrowTypeError(
-      location, src_type, dst_type, dst_name, String::Handle(zone));
+      AbstractType::Handle(zone, src_value.GetType(Heap::kNew));
+  Exceptions::CreateAndThrowTypeError(location, src_type, dst_type, dst_name,
+                                      String::Handle(zone));
   UNREACHABLE();
 }
 
 
 DEFINE_RUNTIME_ENTRY(Throw, 1) {
-  const Instance& exception =
-      Instance::CheckedHandle(zone, arguments.ArgAt(0));
+  const Instance& exception = Instance::CheckedHandle(zone, arguments.ArgAt(0));
   Exceptions::Throw(thread, exception);
 }
 
 
 DEFINE_RUNTIME_ENTRY(ReThrow, 2) {
-  const Instance& exception =
-      Instance::CheckedHandle(zone, arguments.ArgAt(0));
+  const Instance& exception = Instance::CheckedHandle(zone, arguments.ArgAt(0));
   const Instance& stacktrace =
       Instance::CheckedHandle(zone, arguments.ArgAt(1));
   Exceptions::ReThrow(thread, exception, stacktrace);
@@ -662,17 +669,15 @@
   // target.
   ASSERT(target_code.raw() !=
          CodePatcher::GetStaticCallTargetAt(caller_frame->pc(), caller_code));
-  CodePatcher::PatchStaticCallAt(caller_frame->pc(),
-                                 caller_code,
-                                 target_code);
+  CodePatcher::PatchStaticCallAt(caller_frame->pc(), caller_code, target_code);
   caller_code.SetStaticCallTargetCodeAt(caller_frame->pc(), target_code);
   if (FLAG_trace_patching) {
-    THR_Print("PatchStaticCall: patching caller pc %#" Px ""
-        " to '%s' new entry point %#" Px " (%s)\n",
-        caller_frame->pc(),
-        target_function.ToFullyQualifiedCString(),
-        target_code.UncheckedEntryPoint(),
-        target_code.is_optimized() ? "optimized" : "unoptimized");
+    THR_Print("PatchStaticCall: patching caller pc %#" Px
+              ""
+              " to '%s' new entry point %#" Px " (%s)\n",
+              caller_frame->pc(), target_function.ToFullyQualifiedCString(),
+              target_code.UncheckedEntryPoint(),
+              target_code.is_optimized() ? "optimized" : "unoptimized");
   }
   arguments.SetReturn(target_code);
 }
@@ -752,24 +757,21 @@
   const int kNumArguments = 1;
   ArgumentsDescriptor args_desc(
       Array::Handle(ArgumentsDescriptor::New(kNumArguments)));
-  const Function& getter = Function::Handle(
-      Resolver::ResolveDynamicForReceiverClass(receiver_class,
-                                               getter_name,
-                                               args_desc));
+  const Function& getter =
+      Function::Handle(Resolver::ResolveDynamicForReceiverClass(
+          receiver_class, getter_name, args_desc));
   if (getter.IsNull() || getter.IsMethodExtractor()) {
     return false;
   }
   const Function& target_function =
       Function::Handle(receiver_class.GetInvocationDispatcher(
-          target_name,
-          arguments_descriptor,
-          RawFunction::kInvokeFieldDispatcher,
-          FLAG_lazy_dispatchers));
+          target_name, arguments_descriptor,
+          RawFunction::kInvokeFieldDispatcher, FLAG_lazy_dispatchers));
   ASSERT(!target_function.IsNull() || !FLAG_lazy_dispatchers);
   if (FLAG_trace_ic) {
-    OS::PrintErr("InvokeField IC miss: adding <%s> id:%" Pd " -> <%s>\n",
-        Class::Handle(receiver.clazz()).ToCString(),
-        receiver.GetClassId(),
+    OS::PrintErr(
+        "InvokeField IC miss: adding <%s> id:%" Pd " -> <%s>\n",
+        Class::Handle(receiver.clazz()).ToCString(), receiver.GetClassId(),
         target_function.IsNull() ? "null" : target_function.ToCString());
   }
   *result = target_function.raw();
@@ -778,29 +780,23 @@
 
 
 // Handle other invocations (implicit closures, noSuchMethod).
-RawFunction* InlineCacheMissHelper(
-    const Instance& receiver,
-    const Array& args_descriptor,
-    const String& target_name) {
+RawFunction* InlineCacheMissHelper(const Instance& receiver,
+                                   const Array& args_descriptor,
+                                   const String& target_name) {
   const Class& receiver_class = Class::Handle(receiver.clazz());
 
   Function& result = Function::Handle();
-  if (!ResolveCallThroughGetter(receiver,
-                                receiver_class,
-                                target_name,
-                                args_descriptor,
-                                &result)) {
+  if (!ResolveCallThroughGetter(receiver, receiver_class, target_name,
+                                args_descriptor, &result)) {
     ArgumentsDescriptor desc(args_descriptor);
     const Function& target_function =
         Function::Handle(receiver_class.GetInvocationDispatcher(
-            target_name,
-            args_descriptor,
-            RawFunction::kNoSuchMethodDispatcher,
+            target_name, args_descriptor, RawFunction::kNoSuchMethodDispatcher,
             FLAG_lazy_dispatchers));
     if (FLAG_trace_ic) {
-      OS::PrintErr("NoSuchMethod IC miss: adding <%s> id:%" Pd " -> <%s>\n",
-          Class::Handle(receiver.clazz()).ToCString(),
-          receiver.GetClassId(),
+      OS::PrintErr(
+          "NoSuchMethod IC miss: adding <%s> id:%" Pd " -> <%s>\n",
+          Class::Handle(receiver.clazz()).ToCString(), receiver.GetClassId(),
           target_function.IsNull() ? "null" : target_function.ToCString());
     }
     result = target_function.raw();
@@ -821,12 +817,11 @@
   bool result = receiver.IsInstanceOf(type, checked_type_arguments, &error);
   ASSERT(error.IsNull());
   ObjectStore* store = Isolate::Current()->object_store();
-  const Function& target
-      = Function::Handle(result
-                         ? store->simple_instance_of_true_function()
-                         : store->simple_instance_of_false_function());
+  const Function& target =
+      Function::Handle(result ? store->simple_instance_of_true_function()
+                              : store->simple_instance_of_false_function());
   ASSERT(!target.IsNull());
-  return target.raw();;
+  return target.raw();
 }
 
 
@@ -834,8 +829,8 @@
     const GrowableArray<const Instance*>& args,
     const ICData& ic_data) {
   const Instance& receiver = *args[0];
-  ArgumentsDescriptor
-      arguments_descriptor(Array::Handle(ic_data.arguments_descriptor()));
+  ArgumentsDescriptor arguments_descriptor(
+      Array::Handle(ic_data.arguments_descriptor()));
   String& function_name = String::Handle(ic_data.target_name());
   ASSERT(function_name.IsSymbol());
 
@@ -846,8 +841,8 @@
   if (target_function.raw() == store->simple_instance_of_function()) {
     // Replace the target function with constant function.
     const AbstractType& type = AbstractType::Cast(*args[1]);
-    target_function
-        = ComputeTypeCheckTarget(receiver, type, arguments_descriptor);
+    target_function =
+        ComputeTypeCheckTarget(receiver, type, arguments_descriptor);
   }
   if (target_function.IsNull()) {
     if (FLAG_trace_ic) {
@@ -858,9 +853,8 @@
     const Array& args_descriptor =
         Array::Handle(ic_data.arguments_descriptor());
     const String& target_name = String::Handle(ic_data.target_name());
-    target_function = InlineCacheMissHelper(receiver,
-                                            args_descriptor,
-                                            target_name);
+    target_function =
+        InlineCacheMissHelper(receiver, args_descriptor, target_name);
   }
   if (target_function.IsNull()) {
     ASSERT(!FLAG_lazy_dispatchers);
@@ -884,18 +878,17 @@
       const Code& caller = Code::Handle(Code::LookupCode(caller_frame->pc()));
       if (caller.is_optimized()) {
         OS::PrintErr("IC miss in optimized code; call %s -> %s\n",
-            Function::Handle(caller.function()).ToCString(),
-            target_function.ToCString());
+                     Function::Handle(caller.function()).ToCString(),
+                     target_function.ToCString());
       }
     }
     if (FLAG_trace_ic) {
-      OS::PrintErr("InlineCacheMissHandler %" Pd " call at %#" Px "' "
+      OS::PrintErr("InlineCacheMissHandler %" Pd " call at %#" Px
+                   "' "
                    "adding <%s> id:%" Pd " -> <%s>\n",
-          args.length(),
-          caller_frame->pc(),
-          Class::Handle(receiver.clazz()).ToCString(),
-          receiver.GetClassId(),
-          target_function.ToCString());
+                   args.length(), caller_frame->pc(),
+                   Class::Handle(receiver.clazz()).ToCString(),
+                   receiver.GetClassId(), target_function.ToCString());
     }
   }
   return target_function.raw();
@@ -970,8 +963,8 @@
   ASSERT(ic_data.NumberOfChecks() == 1);
   const Function& target = Function::Handle(ic_data.GetTargetAt(0));
   if (!target.HasCode()) {
-    const Error& error = Error::Handle(Compiler::CompileFunction(thread,
-                                                                 target));
+    const Error& error =
+        Error::Handle(Compiler::CompileFunction(thread, target));
     if (!error.IsNull()) {
       Exceptions::PropagateError(error);
     }
@@ -982,8 +975,7 @@
     DartFrameIterator iterator;
     StackFrame* caller_frame = iterator.NextFrame();
     ASSERT(caller_frame != NULL);
-    OS::PrintErr("StaticCallMissHandler at %#" Px
-                 " target %s (%" Pd ")\n",
+    OS::PrintErr("StaticCallMissHandler at %#" Px " target %s (%" Pd ")\n",
                  caller_frame->pc(), target.ToCString(), arg.GetClassId());
   }
   arguments.SetReturn(target);
@@ -1003,8 +995,8 @@
   ASSERT(ic_data.NumberOfChecks() > 0);
   const Function& target = Function::Handle(ic_data.GetTargetAt(0));
   if (!target.HasCode()) {
-    const Error& error = Error::Handle(Compiler::CompileFunction(thread,
-                                                                 target));
+    const Error& error =
+        Error::Handle(Compiler::CompileFunction(thread, target));
     if (!error.IsNull()) {
       Exceptions::PropagateError(error);
     }
@@ -1018,8 +1010,8 @@
     DartFrameIterator iterator;
     StackFrame* caller_frame = iterator.NextFrame();
     ASSERT(caller_frame != NULL);
-    OS::PrintErr("StaticCallMissHandler at %#" Px
-                 " target %s (%" Pd ", %" Pd ")\n",
+    OS::PrintErr("StaticCallMissHandler at %#" Px " target %s (%" Pd ", %" Pd
+                 ")\n",
                  caller_frame->pc(), target.ToCString(), cids[0], cids[1]);
   }
   arguments.SetReturn(target);
@@ -1041,8 +1033,8 @@
     cls = table->At(cid);
     if (cls.is_abstract()) continue;
     if (!cls.is_allocated()) continue;
-    other_target = Resolver::ResolveDynamicAnyArgs(zone, cls, name,
-                                                   false /* allow_add */);
+    other_target =
+        Resolver::ResolveDynamicAnyArgs(zone, cls, name, false /* allow_add */);
     if (other_target.raw() != target.raw()) {
       return false;
     }
@@ -1070,8 +1062,8 @@
       Function::Handle(zone, caller_frame->LookupDartFunction());
 
   SingleTargetCache& cache = SingleTargetCache::Handle(zone);
-  cache ^= CodePatcher::GetSwitchableCallDataAt(caller_frame->pc(),
-                                                caller_code);
+  cache ^=
+      CodePatcher::GetSwitchableCallDataAt(caller_frame->pc(), caller_code);
   Code& old_target_code = Code::Handle(zone, cache.target());
   Function& old_target = Function::Handle(zone);
   old_target ^= old_target_code.owner();
@@ -1079,23 +1071,18 @@
   // We lost the original ICData when we patched to the monomorphic case.
   const String& name = String::Handle(zone, old_target.name());
   ASSERT(!old_target.HasOptionalParameters());
-  const Array& descriptor = Array::Handle(zone,
-      ArgumentsDescriptor::New(old_target.num_fixed_parameters()));
+  const Array& descriptor = Array::Handle(
+      zone, ArgumentsDescriptor::New(old_target.num_fixed_parameters()));
   const ICData& ic_data =
-      ICData::Handle(zone, ICData::New(caller_function,
-                                       name,
-                                       descriptor,
-                                       Thread::kNoDeoptId,
-                                       1, /* args_tested */
+      ICData::Handle(zone, ICData::New(caller_function, name, descriptor,
+                                       Thread::kNoDeoptId, 1, /* args_tested */
                                        false /* static_call */));
 
   // Maybe add the new target.
   Class& cls = Class::Handle(zone, receiver.clazz());
   ArgumentsDescriptor args_desc(descriptor);
-  Function& target_function = Function::Handle(zone,
-      Resolver::ResolveDynamicForReceiverClass(cls,
-                                               name,
-                                               args_desc));
+  Function& target_function = Function::Handle(
+      zone, Resolver::ResolveDynamicForReceiverClass(cls, name, args_desc));
   if (target_function.IsNull()) {
     target_function = InlineCacheMissHelper(receiver, descriptor, name);
   }
@@ -1134,9 +1121,7 @@
   const Code& stub =
       Code::Handle(zone, StubCode::ICCallThroughCode_entry()->code());
   ASSERT(!Isolate::Current()->compilation_allowed());
-  CodePatcher::PatchSwitchableCallAt(caller_frame->pc(),
-                                     caller_code,
-                                     ic_data,
+  CodePatcher::PatchSwitchableCallAt(caller_frame->pc(), caller_code, ic_data,
                                      stub);
 
   // Return the ICData. The single target stub will jump to continue in the
@@ -1158,27 +1143,21 @@
   DartFrameIterator iterator;
   StackFrame* caller_frame = iterator.NextFrame();
   ASSERT(caller_frame->IsDartFrame());
-  const Code& caller_code =
-      Code::Handle(zone, caller_frame->LookupDartCode());
+  const Code& caller_code = Code::Handle(zone, caller_frame->LookupDartCode());
   const Function& caller_function =
       Function::Handle(zone, caller_frame->LookupDartFunction());
 
   const String& name = String::Handle(zone, unlinked.target_name());
   const Array& descriptor = Array::Handle(zone, unlinked.args_descriptor());
   const ICData& ic_data =
-      ICData::Handle(zone, ICData::New(caller_function,
-                                       name,
-                                       descriptor,
-                                       Thread::kNoDeoptId,
-                                       1, /* args_tested */
+      ICData::Handle(zone, ICData::New(caller_function, name, descriptor,
+                                       Thread::kNoDeoptId, 1, /* args_tested */
                                        false /* static_call */));
 
   Class& cls = Class::Handle(zone, receiver.clazz());
   ArgumentsDescriptor args_desc(descriptor);
-  Function& target_function = Function::Handle(zone,
-      Resolver::ResolveDynamicForReceiverClass(cls,
-                                               name,
-                                               args_desc));
+  Function& target_function = Function::Handle(
+      zone, Resolver::ResolveDynamicForReceiverClass(cls, name, args_desc));
   if (target_function.IsNull()) {
     target_function = InlineCacheMissHelper(receiver, descriptor, name);
   }
@@ -1188,12 +1167,10 @@
     ic_data.AddReceiverCheck(receiver.GetClassId(), target_function);
   }
 
-  if (!target_function.IsNull() &&
-      !target_function.HasOptionalParameters()) {
+  if (!target_function.IsNull() && !target_function.HasOptionalParameters()) {
     // Patch to monomorphic call.
     ASSERT(target_function.HasCode());
-    const Code& target_code =
-        Code::Handle(zone, target_function.CurrentCode());
+    const Code& target_code = Code::Handle(zone, target_function.CurrentCode());
     const Smi& expected_cid =
         Smi::Handle(zone, Smi::New(receiver.GetClassId()));
     CodePatcher::PatchSwitchableCallAt(caller_frame->pc(), caller_code,
@@ -1209,9 +1186,7 @@
   const Code& stub =
       Code::Handle(zone, StubCode::ICCallThroughCode_entry()->code());
   ASSERT(!Isolate::Current()->compilation_allowed());
-  CodePatcher::PatchSwitchableCallAt(caller_frame->pc(),
-                                     caller_code,
-                                     ic_data,
+  CodePatcher::PatchSwitchableCallAt(caller_frame->pc(), caller_code, ic_data,
                                      stub);
 
   // Return the ICData. The miss stub will jump to continue in the IC lookup
@@ -1239,25 +1214,21 @@
       Function::Handle(zone, caller_frame->LookupDartFunction());
 
   Smi& old_expected_cid = Smi::Handle(zone);
-  old_expected_cid ^= CodePatcher::GetSwitchableCallDataAt(caller_frame->pc(),
-                                                          caller_code);
-  const Code& old_target_code =
-      Code::Handle(CodePatcher::GetSwitchableCallTargetAt(caller_frame->pc(),
-                                                          caller_code));
+  old_expected_cid ^=
+      CodePatcher::GetSwitchableCallDataAt(caller_frame->pc(), caller_code);
+  const Code& old_target_code = Code::Handle(
+      CodePatcher::GetSwitchableCallTargetAt(caller_frame->pc(), caller_code));
   Function& old_target = Function::Handle(zone);
   old_target ^= old_target_code.owner();
 
   // We lost the original ICData when we patched to the monomorphic case.
   const String& name = String::Handle(zone, old_target.name());
   ASSERT(!old_target.HasOptionalParameters());
-  const Array& descriptor = Array::Handle(zone,
-      ArgumentsDescriptor::New(old_target.num_fixed_parameters()));
+  const Array& descriptor = Array::Handle(
+      zone, ArgumentsDescriptor::New(old_target.num_fixed_parameters()));
   const ICData& ic_data =
-      ICData::Handle(zone, ICData::New(caller_function,
-                                       name,
-                                       descriptor,
-                                       Thread::kNoDeoptId,
-                                       1, /* args_tested */
+      ICData::Handle(zone, ICData::New(caller_function, name, descriptor,
+                                       Thread::kNoDeoptId, 1, /* args_tested */
                                        false /* static_call */));
 
   // Add the first target.
@@ -1266,10 +1237,8 @@
   // Maybe add the new target.
   Class& cls = Class::Handle(zone, receiver.clazz());
   ArgumentsDescriptor args_desc(descriptor);
-  Function& target_function = Function::Handle(zone,
-      Resolver::ResolveDynamicForReceiverClass(cls,
-                                               name,
-                                               args_desc));
+  Function& target_function = Function::Handle(
+      zone, Resolver::ResolveDynamicForReceiverClass(cls, name, args_desc));
   if (target_function.IsNull()) {
     target_function = InlineCacheMissHelper(receiver, descriptor, name);
   }
@@ -1297,11 +1266,9 @@
       cache.set_entry_point(code.UncheckedEntryPoint());
       cache.set_lower_limit(lower);
       cache.set_upper_limit(upper);
-      const Code& stub = Code::Handle(zone,
-          StubCode::SingleTargetCall_entry()->code());
-      CodePatcher::PatchSwitchableCallAt(caller_frame->pc(),
-                                         caller_code,
-                                         cache,
+      const Code& stub =
+          Code::Handle(zone, StubCode::SingleTargetCall_entry()->code());
+      CodePatcher::PatchSwitchableCallAt(caller_frame->pc(), caller_code, cache,
                                          stub);
       // Return the ICData. The miss stub will jump to continue in the IC call
       // stub.
@@ -1314,9 +1281,7 @@
   const Code& stub =
       Code::Handle(zone, StubCode::ICCallThroughCode_entry()->code());
   ASSERT(!Isolate::Current()->compilation_allowed());
-  CodePatcher::PatchSwitchableCallAt(caller_frame->pc(),
-                                     caller_code,
-                                     ic_data,
+  CodePatcher::PatchSwitchableCallAt(caller_frame->pc(), caller_code, ic_data,
                                      stub);
 
   // Return the ICData. The miss stub will jump to continue in the IC lookup
@@ -1354,10 +1319,8 @@
   }
 
   ArgumentsDescriptor args_desc(descriptor);
-  Function& target_function = Function::Handle(zone,
-      Resolver::ResolveDynamicForReceiverClass(cls,
-                                               name,
-                                               args_desc));
+  Function& target_function = Function::Handle(
+      zone, Resolver::ResolveDynamicForReceiverClass(cls, name, args_desc));
   if (target_function.IsNull()) {
     target_function = InlineCacheMissHelper(receiver, descriptor, name);
   }
@@ -1382,7 +1345,7 @@
 
       if (!target_function.HasCode()) {
         const Error& error =
-          Error::Handle(Compiler::CompileFunction(thread, target_function));
+            Error::Handle(Compiler::CompileFunction(thread, target_function));
         if (!error.IsNull()) {
           Exceptions::PropagateError(error);
         }
@@ -1406,8 +1369,8 @@
       ic_data.AddReceiverCheck(receiver.GetClassId(), target_function);
       if (ic_data.NumberOfChecks() > FLAG_max_polymorphic_checks) {
         // Switch to megamorphic call.
-        const MegamorphicCache& cache = MegamorphicCache::Handle(zone,
-            MegamorphicCacheTable::Lookup(isolate, name, descriptor));
+        const MegamorphicCache& cache = MegamorphicCache::Handle(
+            zone, MegamorphicCacheTable::Lookup(isolate, name, descriptor));
         DartFrameIterator iterator;
         StackFrame* miss_function_frame = iterator.NextFrame();
         ASSERT(miss_function_frame->IsDartFrame());
@@ -1457,26 +1420,24 @@
   Class& cls = Class::Handle(zone, receiver.clazz());
   Function& function = Function::Handle(zone);
 
-  // Dart distinguishes getters and regular methods and allows their calls
-  // to mix with conversions, and its selectors are independent of arity. So do
-  // a zigzagged lookup to see if this call failed because of an arity mismatch,
-  // need for conversion, or there really is no such method.
+// Dart distinguishes getters and regular methods and allows their calls
+// to mix with conversions, and its selectors are independent of arity. So do
+// a zigzagged lookup to see if this call failed because of an arity mismatch,
+// need for conversion, or there really is no such method.
 
 #define NO_SUCH_METHOD()                                                       \
-  const Object& result = Object::Handle(zone,                                  \
-      DartEntry::InvokeNoSuchMethod(receiver,                                  \
-                                    target_name,                               \
-                                    orig_arguments,                            \
-                                    orig_arguments_desc));                     \
+  const Object& result = Object::Handle(                                       \
+      zone, DartEntry::InvokeNoSuchMethod(                                     \
+                receiver, target_name, orig_arguments, orig_arguments_desc));  \
   CheckResultError(result);                                                    \
-  arguments.SetReturn(result);                                                 \
+  arguments.SetReturn(result);
 
 #define CLOSURIZE(some_function)                                               \
   const Function& closure_function =                                           \
       Function::Handle(zone, some_function.ImplicitClosureFunction());         \
-  const Object& result =                                                       \
-      Object::Handle(zone, closure_function.ImplicitInstanceClosure(receiver));\
-  arguments.SetReturn(result);                                                 \
+  const Object& result = Object::Handle(                                       \
+      zone, closure_function.ImplicitInstanceClosure(receiver));               \
+  arguments.SetReturn(result);
 
   const bool is_getter = Field::IsGetterName(target_name);
   if (is_getter) {
@@ -1536,9 +1497,8 @@
       // Special case: closures are implemented with a call getter instead of a
       // call method and with lazy dispatchers the field-invocation-dispatcher
       // would perform the closure call.
-      const Object& result =
-        Object::Handle(zone, DartEntry::InvokeClosure(orig_arguments,
-                                                      orig_arguments_desc));
+      const Object& result = Object::Handle(
+          zone, DartEntry::InvokeClosure(orig_arguments, orig_arguments_desc));
       CheckResultError(result);
       arguments.SetReturn(result);
       return;
@@ -1557,16 +1517,15 @@
       if (!function.IsNull()) {
         const Array& getter_arguments = Array::Handle(Array::New(1));
         getter_arguments.SetAt(0, receiver);
-        const Object& getter_result =
-          Object::Handle(zone, DartEntry::InvokeFunction(function,
-                                                         getter_arguments));
+        const Object& getter_result = Object::Handle(
+            zone, DartEntry::InvokeFunction(function, getter_arguments));
         CheckResultError(getter_result);
         ASSERT(getter_result.IsNull() || getter_result.IsInstance());
 
         orig_arguments.SetAt(0, getter_result);
-        const Object& call_result =
-          Object::Handle(zone, DartEntry::InvokeClosure(orig_arguments,
-                                                        orig_arguments_desc));
+        const Object& call_result = Object::Handle(
+            zone,
+            DartEntry::InvokeClosure(orig_arguments, orig_arguments_desc));
         CheckResultError(call_result);
         arguments.SetReturn(call_result);
         return;
@@ -1582,7 +1541,6 @@
 }
 
 
-
 // Invoke appropriate noSuchMethod function.
 // Arg0: receiver (closure object)
 // Arg1: arguments descriptor array.
@@ -1598,11 +1556,8 @@
   const Function& function = Function::Handle(receiver.function());
   const String& original_function_name =
       String::Handle(function.QualifiedUserVisibleName());
-  const Object& result = Object::Handle(
-      DartEntry::InvokeNoSuchMethod(receiver,
-                                    original_function_name,
-                                    orig_arguments,
-                                    orig_arguments_desc));
+  const Object& result = Object::Handle(DartEntry::InvokeNoSuchMethod(
+      receiver, original_function_name, orig_arguments, orig_arguments_desc));
   CheckResultError(result);
   arguments.SetReturn(result);
 }
@@ -1638,29 +1593,24 @@
   bool do_reload = false;
   const intptr_t isolate_reload_every =
       isolate->reload_every_n_stack_overflow_checks();
-  if ((FLAG_deoptimize_every > 0) ||
-      (FLAG_stacktrace_every > 0) ||
+  if ((FLAG_deoptimize_every > 0) || (FLAG_stacktrace_every > 0) ||
       (isolate_reload_every > 0)) {
     // TODO(turnidge): To make --deoptimize_every and
     // --stacktrace-every faster we could move this increment/test to
     // the generated code.
     int32_t count = thread->IncrementAndGetStackOverflowCount();
-    if (FLAG_deoptimize_every > 0 &&
-        (count % FLAG_deoptimize_every) == 0) {
+    if (FLAG_deoptimize_every > 0 && (count % FLAG_deoptimize_every) == 0) {
       do_deopt = true;
     }
-    if (FLAG_stacktrace_every > 0 &&
-        (count % FLAG_stacktrace_every) == 0) {
+    if (FLAG_stacktrace_every > 0 && (count % FLAG_stacktrace_every) == 0) {
       do_stacktrace = true;
     }
-    if ((isolate_reload_every > 0) &&
-        (count % isolate_reload_every) == 0) {
+    if ((isolate_reload_every > 0) && (count % isolate_reload_every) == 0) {
       do_reload = isolate->CanReload();
     }
   }
-  if ((FLAG_deoptimize_filter != NULL) ||
-      (FLAG_stacktrace_filter != NULL) ||
-       FLAG_reload_every_optimized) {
+  if ((FLAG_deoptimize_filter != NULL) || (FLAG_stacktrace_filter != NULL) ||
+      FLAG_reload_every_optimized) {
     DartFrameIterator iterator;
     StackFrame* frame = iterator.NextFrame();
     ASSERT(frame != NULL);
@@ -1674,8 +1624,7 @@
       // Don't do the reload if we aren't inside optimized code.
       do_reload = false;
     }
-    if (code.is_optimized() &&
-        FLAG_deoptimize_filter != NULL &&
+    if (code.is_optimized() && FLAG_deoptimize_filter != NULL &&
         strstr(function_name, FLAG_deoptimize_filter) != NULL) {
       OS::PrintErr("*** Forcing deoptimization (%s)\n",
                    function.ToFullyQualifiedCString());
@@ -1725,10 +1674,10 @@
 #endif
       // Variable locations and number are unknown when precompiling.
       const int num_vars =
-         FLAG_precompiled_runtime ? 0 : frame->NumLocalVariables();
+          FLAG_precompiled_runtime ? 0 : frame->NumLocalVariables();
       TokenPosition unused = TokenPosition::kNoSource;
       for (intptr_t v = 0; v < num_vars; v++) {
-        frame->VariableAt(v, &var_name, &unused, &unused, &var_value);
+        frame->VariableAt(v, &var_name, &unused, &unused, &unused, &var_value);
       }
     }
     FLAG_stacktrace_every = saved_stacktrace_every;
@@ -1775,8 +1724,7 @@
     ASSERT(osr_id != Compiler::kNoOSRDeoptId);
     if (FLAG_trace_osr) {
       OS::Print("Attempting OSR for %s at id=%" Pd ", count=%" Pd "\n",
-                function.ToFullyQualifiedCString(),
-                osr_id,
+                function.ToFullyQualifiedCString(), osr_id,
                 function.usage_counter());
     }
 
@@ -1784,8 +1732,8 @@
     // Since the code is referenced from the frame and the ZoneHandle,
     // it cannot have been removed from the function.
     ASSERT(!original_code.IsNull());
-    const Error& error = Error::Handle(Compiler::CompileOptimizedFunction(
-        thread, function, osr_id));
+    const Error& error = Error::Handle(
+        Compiler::CompileOptimizedFunction(thread, function, osr_id));
     if (!error.IsNull()) {
       Exceptions::PropagateError(error);
     }
@@ -1814,12 +1762,9 @@
   StackFrame* frame = iterator.NextFrame();
   ASSERT(frame != NULL);
   OS::PrintErr("IC call @%#" Px ": ICData: %p cnt:%" Pd " nchecks: %" Pd
-      " %s\n",
-      frame->pc(),
-      ic_data.raw(),
-      function.usage_counter(),
-      ic_data.NumberOfChecks(),
-      function.ToFullyQualifiedCString());
+               " %s\n",
+               frame->pc(), ic_data.raw(), function.usage_counter(),
+               ic_data.NumberOfChecks(), function.ToFullyQualifiedCString());
 }
 
 
@@ -1828,8 +1773,7 @@
 // Returns the Code object where to continue execution.
 DEFINE_RUNTIME_ENTRY(OptimizeInvokedFunction, 1) {
 #if !defined(DART_PRECOMPILED_RUNTIME)
-  const Function& function = Function::CheckedHandle(zone,
-                                                     arguments.ArgAt(0));
+  const Function& function = Function::CheckedHandle(zone, arguments.ArgAt(0));
   ASSERT(!function.IsNull());
   ASSERT(function.HasCode());
 
@@ -1864,7 +1808,7 @@
         ASSERT(isolate->background_compiler() != NULL);
         isolate->background_compiler()->CompileOptimized(function);
         // Continue in the same code.
-        arguments.SetReturn(Code::Handle(zone, function.CurrentCode()));
+        arguments.SetReturn(function);
         return;
       }
     }
@@ -1886,7 +1830,7 @@
     const Code& optimized_code = Code::Handle(zone, function.CurrentCode());
     ASSERT(!optimized_code.IsNull());
   }
-  arguments.SetReturn(Code::Handle(zone, function.CurrentCode()));
+  arguments.SetReturn(function);
 #else
   UNREACHABLE();
 #endif  // !DART_PRECOMPILED_RUNTIME
@@ -1914,27 +1858,26 @@
   const Function& target_function = Function::Handle(
       zone, caller_code.GetStaticCallTargetFunctionAt(frame->pc()));
   if (!target_function.HasCode()) {
-    const Error& error = Error::Handle(
-        zone, Compiler::CompileFunction(thread, target_function));
+    const Error& error =
+        Error::Handle(zone, Compiler::CompileFunction(thread, target_function));
     if (!error.IsNull()) {
       Exceptions::PropagateError(error);
     }
   }
   ASSERT(target_function.HasCode());
 
-  const Code& current_target_code = Code::Handle(
-      zone, target_function.CurrentCode());
-  CodePatcher::PatchStaticCallAt(frame->pc(),
-                                 caller_code,
-                                 current_target_code);
+  const Code& current_target_code =
+      Code::Handle(zone, target_function.CurrentCode());
+  CodePatcher::PatchStaticCallAt(frame->pc(), caller_code, current_target_code);
   caller_code.SetStaticCallTargetCodeAt(frame->pc(), current_target_code);
   if (FLAG_trace_patching) {
-    OS::PrintErr("FixCallersTarget: caller %#" Px " "
+    OS::PrintErr("FixCallersTarget: caller %#" Px
+                 " "
                  "target '%s' -> %#" Px "\n",
-                 frame->pc(),
-                 target_function.ToFullyQualifiedCString(),
+                 frame->pc(), target_function.ToFullyQualifiedCString(),
                  current_target_code.UncheckedEntryPoint());
   }
+  ASSERT(!current_target_code.IsDisabled());
   arguments.SetReturn(current_target_code);
 }
 
@@ -1966,16 +1909,14 @@
     alloc_stub = StubCode::GetAllocationStubForClass(alloc_class);
     ASSERT(!alloc_stub.IsDisabled());
   }
-  CodePatcher::PatchStaticCallAt(frame->pc(),
-                                 caller_code,
-                                 alloc_stub);
+  CodePatcher::PatchStaticCallAt(frame->pc(), caller_code, alloc_stub);
   caller_code.SetStubCallTargetCodeAt(frame->pc(), alloc_stub);
   if (FLAG_trace_patching) {
-    OS::PrintErr("FixAllocationStubTarget: caller %#" Px " alloc-class %s "
-        " -> %#" Px "\n",
-        frame->pc(),
-        alloc_class.ToCString(),
-        alloc_stub.UncheckedEntryPoint());
+    OS::PrintErr("FixAllocationStubTarget: caller %#" Px
+                 " alloc-class %s "
+                 " -> %#" Px "\n",
+                 frame->pc(), alloc_class.ToCString(),
+                 alloc_stub.UncheckedEntryPoint());
   }
   arguments.SetReturn(alloc_stub);
 #else
@@ -1986,8 +1927,10 @@
 
 const char* DeoptReasonToCString(ICData::DeoptReasonId deopt_reason) {
   switch (deopt_reason) {
-#define DEOPT_REASON_TO_TEXT(name) case ICData::kDeopt##name: return #name;
-DEOPT_REASONS(DEOPT_REASON_TO_TEXT)
+#define DEOPT_REASON_TO_TEXT(name)                                             \
+  case ICData::kDeopt##name:                                                   \
+    return #name;
+    DEOPT_REASONS(DEOPT_REASON_TO_TEXT)
 #undef DEOPT_REASON_TO_TEXT
     default:
       UNREACHABLE();
@@ -1996,15 +1939,10 @@
 }
 
 
-void DeoptimizeAt(const Code& optimized_code, uword pc) {
+void DeoptimizeAt(const Code& optimized_code, StackFrame* frame) {
   ASSERT(optimized_code.is_optimized());
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
-  ICData::DeoptReasonId deopt_reason = ICData::kDeoptUnknown;
-  uint32_t deopt_flags = 0;
-  const TypedData& deopt_info = TypedData::Handle(zone,
-      optimized_code.GetDeoptInfoAtPc(pc, &deopt_reason, &deopt_flags));
-  ASSERT(!deopt_info.IsNull());
   const Function& function = Function::Handle(zone, optimized_code.function());
   const Error& error =
       Error::Handle(zone, Compiler::EnsureUnoptimizedCode(thread, function));
@@ -2018,24 +1956,17 @@
   if (function.HasOptimizedCode()) {
     function.SwitchToUnoptimizedCode();
   }
-  // Patch call site (lazy deoptimization is quite rare, patching it twice
-  // is not a performance issue).
-  uword lazy_deopt_jump_return = optimized_code.GetLazyDeoptReturnPc();
-  uword lazy_deopt_jump_throw = optimized_code.GetLazyDeoptThrowPc();
-#if !defined(TARGET_ARCH_DBC)
-  ASSERT(lazy_deopt_jump_return != 0);
-  ASSERT(lazy_deopt_jump_throw != 0);
-#endif
+
+#if defined(TARGET_ARCH_DBC)
   const Instructions& instrs =
       Instructions::Handle(zone, optimized_code.instructions());
   {
-    WritableInstructionsScope writable(instrs.PayloadStart(), instrs.size());
-    CodePatcher::InsertDeoptimizationCallAt(pc, lazy_deopt_jump_return);
+    WritableInstructionsScope writable(instrs.PayloadStart(), instrs.Size());
+    CodePatcher::InsertDeoptimizationCallAt(frame->pc());
     if (FLAG_trace_patching) {
       const String& name = String::Handle(function.name());
-      OS::PrintErr(
-          "InsertDeoptimizationCallAt: 0x%" Px " to 0x%" Px " for %s\n",
-          pc, lazy_deopt_jump_return, name.ToCString());
+      OS::PrintErr("InsertDeoptimizationCallAt: 0x%" Px " for %s\n",
+                   frame->pc(), name.ToCString());
     }
     const ExceptionHandlers& handlers =
         ExceptionHandlers::Handle(zone, optimized_code.exception_handlers());
@@ -2043,12 +1974,38 @@
     for (intptr_t i = 0; i < handlers.num_entries(); ++i) {
       handlers.GetHandlerInfo(i, &info);
       const uword patch_pc = instrs.PayloadStart() + info.handler_pc_offset;
-      CodePatcher::InsertDeoptimizationCallAt(patch_pc, lazy_deopt_jump_throw);
+      CodePatcher::InsertDeoptimizationCallAt(patch_pc);
       if (FLAG_trace_patching) {
         OS::PrintErr("  at handler 0x%" Px "\n", patch_pc);
       }
     }
   }
+#else  // !DBC
+  if (frame->IsMarkedForLazyDeopt()) {
+    // Deopt already scheduled.
+    if (FLAG_trace_deoptimization) {
+      THR_Print("Lazy deopt already scheduled for fp=%" Pp "\n", frame->fp());
+    }
+  } else {
+    uword deopt_pc = frame->pc();
+    ASSERT(optimized_code.ContainsInstructionAt(deopt_pc));
+
+#if defined(DEBUG)
+    ValidateFrames();
+#endif
+
+    // N.B.: Update the pending deopt table before updating the frame. The
+    // profiler may attempt a stack walk in between.
+    thread->isolate()->AddPendingDeopt(frame->fp(), deopt_pc);
+    frame->MarkForLazyDeopt();
+
+    if (FLAG_trace_deoptimization) {
+      THR_Print("Lazy deopt scheduled for fp=%" Pp ", pc=%" Pp "\n",
+                frame->fp(), deopt_pc);
+    }
+  }
+#endif  // !DBC
+
   // Mark code as dead (do not GC its embedded objects).
   optimized_code.set_is_alive(false);
 }
@@ -2063,7 +2020,7 @@
   while (frame != NULL) {
     optimized_code = frame->LookupDartCode();
     if (optimized_code.is_optimized()) {
-      DeoptimizeAt(optimized_code, frame->pc());
+      DeoptimizeAt(optimized_code, frame);
     }
     frame = iterator.NextFrame();
   }
@@ -2110,7 +2067,8 @@
 // The calling code must be optimized, but its function may not have
 // have optimized code if the code is OSR code, or if the code was invalidated
 // through class loading/finalization or field guard.
-DEFINE_LEAF_RUNTIME_ENTRY(intptr_t, DeoptimizeCopyFrame,
+DEFINE_LEAF_RUNTIME_ENTRY(intptr_t,
+                          DeoptimizeCopyFrame,
                           2,
                           uword saved_registers_address,
                           uword is_lazy_deopt) {
@@ -2121,10 +2079,10 @@
   HANDLESCOPE(thread);
 
   // All registers have been saved below last-fp as if they were locals.
-  const uword last_fp = saved_registers_address
-                        + (kNumberOfSavedCpuRegisters * kWordSize)
-                        + (kNumberOfSavedFpuRegisters * kFpuRegisterSize)
-                        - ((kFirstLocalSlotFromFp + 1) * kWordSize);
+  const uword last_fp = saved_registers_address +
+                        (kNumberOfSavedCpuRegisters * kWordSize) +
+                        (kNumberOfSavedFpuRegisters * kFpuRegisterSize) -
+                        ((kFirstLocalSlotFromFp + 1) * kWordSize);
 
   // Get optimized code and frame that need to be deoptimized.
   DartFrameIterator iterator(last_fp);
@@ -2139,25 +2097,42 @@
   if (FLAG_trace_deoptimization) {
     const Function& function = Function::Handle(optimized_code.function());
     THR_Print("== Deoptimizing code for '%s', %s, %s\n",
-       function.ToFullyQualifiedCString(),
-       deoptimizing_code ? "code & frame" : "frame",
-       is_lazy_deopt ? "lazy-deopt" : "");
+              function.ToFullyQualifiedCString(),
+              deoptimizing_code ? "code & frame" : "frame",
+              is_lazy_deopt ? "lazy-deopt" : "");
   }
 
+#if !defined(TARGET_ARCH_DBC)
+  if (is_lazy_deopt) {
+    uword deopt_pc = isolate->FindPendingDeopt(caller_frame->fp());
+    if (FLAG_trace_deoptimization) {
+      THR_Print("Lazy deopt fp=%" Pp " pc=%" Pp "\n", caller_frame->fp(),
+                deopt_pc);
+    }
+
+    // N.B.: Update frame before updating pending deopt table. The profiler
+    // may attempt a stack walk in between.
+    caller_frame->set_pc(deopt_pc);
+    ASSERT(caller_frame->pc() == deopt_pc);
+    ASSERT(optimized_code.ContainsInstructionAt(caller_frame->pc()));
+    isolate->ClearPendingDeoptsAtOrBelow(caller_frame->fp());
+  } else {
+    if (FLAG_trace_deoptimization) {
+      THR_Print("Eager deopt fp=%" Pp " pc=%" Pp "\n", caller_frame->fp(),
+                caller_frame->pc());
+    }
+  }
+#endif  // !DBC
+
   // Copy the saved registers from the stack.
   fpu_register_t* fpu_registers;
   intptr_t* cpu_registers;
   CopySavedRegisters(saved_registers_address, &fpu_registers, &cpu_registers);
 
   // Create the DeoptContext.
-  DeoptContext* deopt_context =
-      new DeoptContext(caller_frame,
-                       optimized_code,
-                       DeoptContext::kDestIsOriginalFrame,
-                       fpu_registers,
-                       cpu_registers,
-                       is_lazy_deopt != 0,
-                       deoptimizing_code);
+  DeoptContext* deopt_context = new DeoptContext(
+      caller_frame, optimized_code, DeoptContext::kDestIsOriginalFrame,
+      fpu_registers, cpu_registers, is_lazy_deopt != 0, deoptimizing_code);
   isolate->set_deopt_context(deopt_context);
 
   // Stack size (FP - SP) in bytes.
@@ -2204,6 +2179,7 @@
 
   deopt_context->set_dest_frame(caller_frame);
   deopt_context->FillDestFrame();
+
 #else
   UNREACHABLE();
 #endif  // !DART_PRECOMPILED_RUNTIME
@@ -2222,11 +2198,7 @@
   {
     // We may rendezvous for a safepoint at entry or GC from the allocations
     // below. Check the stack is walkable.
-    StackFrameIterator frames_iterator(StackFrameIterator::kValidateFrames);
-    StackFrame* frame = frames_iterator.NextFrame();
-    while (frame != NULL) {
-      frame = frames_iterator.NextFrame();
-    }
+    ValidateFrames();
   }
 #endif
   DeoptContext* deopt_context = isolate->deopt_context();
diff --git a/runtime/vm/code_generator.h b/runtime/vm/code_generator.h
index 62e8e23..65b8ca1 100644
--- a/runtime/vm/code_generator.h
+++ b/runtime/vm/code_generator.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_CODE_GENERATOR_H_
-#define VM_CODE_GENERATOR_H_
+#ifndef RUNTIME_VM_CODE_GENERATOR_H_
+#define RUNTIME_VM_CODE_GENERATOR_H_
 
 #include "vm/globals.h"
 #include "vm/runtime_entry.h"
@@ -11,13 +11,14 @@
 namespace dart {
 
 class Array;
-template <typename T> class GrowableArray;
+template <typename T>
+class GrowableArray;
 class ICData;
 class Instance;
 
 const char* DeoptReasonToCString(ICData::DeoptReasonId deopt_reason);
 
-void DeoptimizeAt(const Code& optimized_code, uword pc);
+void DeoptimizeAt(const Code& optimized_code, StackFrame* frame);
 void DeoptimizeFunctionsOnStack();
 
 double DartModulo(double a, double b);
@@ -25,4 +26,4 @@
 
 }  // namespace dart
 
-#endif  // VM_CODE_GENERATOR_H_
+#endif  // RUNTIME_VM_CODE_GENERATOR_H_
diff --git a/runtime/vm/code_generator_test.cc b/runtime/vm/code_generator_test.cc
index 54a9174..609debf 100644
--- a/runtime/vm/code_generator_test.cc
+++ b/runtime/vm/code_generator_test.cc
@@ -47,10 +47,10 @@
 
 // Helper to allocate and return a LocalVariable.
 static LocalVariable* NewTestLocalVariable(const char* name) {
-  const String& variable_name = String::ZoneHandle(
-      Symbols::New(Thread::Current(), name));
+  const String& variable_name =
+      String::ZoneHandle(Symbols::New(Thread::Current(), name));
   const Type& variable_type = Type::ZoneHandle(Type::DynamicType());
-  return new LocalVariable(kPos, variable_name, variable_type);
+  return new LocalVariable(kPos, kPos, variable_name, variable_type);
 }
 
 
@@ -73,8 +73,8 @@
   SequenceNode* node_seq = test->node_sequence();
   ArgumentListNode* arguments = new ArgumentListNode(kPos);
   arguments->Add(new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(3))));
-  node_seq->Add(new ReturnNode(kPos,
-                               new StaticCallNode(kPos, function, arguments)));
+  node_seq->Add(
+      new ReturnNode(kPos, new StaticCallNode(kPos, function, arguments)));
 }
 CODEGEN_TEST2_RUN(StaticCallReturnParameterCodegen,
                   ReturnParameterCodegen,
@@ -96,10 +96,9 @@
   const Function& function = test->function();
   function.set_num_fixed_parameters(num_params);
   ASSERT(!function.HasOptionalParameters());
-  BinaryOpNode* add = new BinaryOpNode(kPos,
-                                       Token::kADD,
-                                       new LoadLocalNode(kPos, param1),
-                                       new LoadLocalNode(kPos, param2));
+  BinaryOpNode* add =
+      new BinaryOpNode(kPos, Token::kADD, new LoadLocalNode(kPos, param1),
+                       new LoadLocalNode(kPos, param2));
   node_seq->Add(new StoreLocalNode(kPos, sum, add));
   node_seq->Add(new ReturnNode(kPos, new LoadLocalNode(kPos, sum)));
 }
@@ -111,12 +110,10 @@
   ArgumentListNode* arguments = new ArgumentListNode(kPos);
   arguments->Add(new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(3))));
   arguments->Add(new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(2))));
-  node_seq->Add(new ReturnNode(kPos,
-                               new StaticCallNode(kPos, function, arguments)));
+  node_seq->Add(
+      new ReturnNode(kPos, new StaticCallNode(kPos, function, arguments)));
 }
-CODEGEN_TEST2_RUN(StaticCallSmiParamSumCodegen,
-                  SmiParamSumCodegen,
-                  Smi::New(5))
+CODEGEN_TEST2_RUN(StaticCallSmiParamSumCodegen, SmiParamSumCodegen, Smi::New(5))
 
 
 CODEGEN_TEST_GENERATE(SmiAddCodegen, test) {
@@ -221,16 +218,16 @@
   lib.Register(thread);
   Library& core_lib = Library::Handle(zone, Library::CoreLibrary());
   ASSERT(!core_lib.IsNull());
-  const Namespace& core_ns = Namespace::Handle(zone,
-      Namespace::New(core_lib, Array::Handle(zone), Array::Handle(zone)));
+  const Namespace& core_ns = Namespace::Handle(
+      zone, Namespace::New(core_lib, Array::Handle(zone), Array::Handle(zone)));
   lib.AddImport(core_ns);
   return lib;
 }
 
 
 static RawClass* LookupClass(const Library& lib, const char* name) {
-  const String& cls_name = String::ZoneHandle(Symbols::New(Thread::Current(),
-                                                           name));
+  const String& cls_name =
+      String::ZoneHandle(Symbols::New(Thread::Current(), name));
   return lib.LookupClass(cls_name);
 }
 
@@ -244,9 +241,8 @@
 
   String& url = String::Handle(String::New("dart-test:CompileScript"));
   String& source = String::Handle(String::New(kScriptChars));
-  Script& script = Script::Handle(Script::New(url,
-                                              source,
-                                              RawScript::kScriptTag));
+  Script& script =
+      Script::Handle(Script::New(url, source, RawScript::kScriptTag));
   Library& lib = MakeTestLibrary("TestLib");
   EXPECT(CompilerTest::TestCompileScript(lib, script));
   EXPECT(ClassFinalizer::ProcessPendingClasses());
@@ -291,9 +287,8 @@
 
   String& url = String::Handle(String::New("dart-test:CompileScript"));
   String& source = String::Handle(String::New(kScriptChars));
-  Script& script = Script::Handle(Script::New(url,
-                                              source,
-                                              RawScript::kScriptTag));
+  Script& script =
+      Script::Handle(Script::New(url, source, RawScript::kScriptTag));
   Library& lib = MakeTestLibrary("TestLib");
   EXPECT(CompilerTest::TestCompileScript(lib, script));
   EXPECT(ClassFinalizer::ProcessPendingClasses());
@@ -306,16 +301,14 @@
   EXPECT(!constructor.IsNull());
 
   // The unit test creates an instance of class A and calls function 'bar'.
-  String& function_bar_name = String::ZoneHandle(Symbols::New(Thread::Current(),
-                                                              "bar"));
+  String& function_bar_name =
+      String::ZoneHandle(Symbols::New(Thread::Current(), "bar"));
   ArgumentListNode* no_arguments = new ArgumentListNode(kPos);
   const TypeArguments& no_type_arguments = TypeArguments::ZoneHandle();
   InstanceCallNode* call_bar = new InstanceCallNode(
-      kPos,
-      new ConstructorCallNode(
-          kPos, no_type_arguments, constructor, no_arguments),
-      function_bar_name,
-      no_arguments);
+      kPos, new ConstructorCallNode(kPos, no_type_arguments, constructor,
+                                    no_arguments),
+      function_bar_name, no_arguments);
 
   test->node_sequence()->Add(new ReturnNode(kPos, call_bar));
 }
@@ -332,9 +325,8 @@
 
   String& url = String::Handle(String::New("dart-test:CompileScript"));
   String& source = String::Handle(String::New(kScriptChars));
-  Script& script = Script::Handle(Script::New(url,
-                                              source,
-                                              RawScript::kScriptTag));
+  Script& script =
+      Script::Handle(Script::New(url, source, RawScript::kScriptTag));
   Library& lib = MakeTestLibrary("TestLib");
   EXPECT(CompilerTest::TestCompileScript(lib, script));
   EXPECT(ClassFinalizer::ProcessPendingClasses());
@@ -348,8 +340,9 @@
 
   const TypeArguments& no_type_arguments = TypeArguments::ZoneHandle();
   ArgumentListNode* no_arguments = new ArgumentListNode(kPos);
-  test->node_sequence()->Add(new ReturnNode(kPos, new ConstructorCallNode(
-      kPos, no_type_arguments, constructor, no_arguments)));
+  test->node_sequence()->Add(
+      new ReturnNode(kPos, new ConstructorCallNode(kPos, no_type_arguments,
+                                                   constructor, no_arguments)));
 }
 
 
@@ -357,7 +350,7 @@
   const Object& result = Object::Handle(
       DartEntry::InvokeFunction(function, Object::empty_array()));
   EXPECT(!result.IsError());
-  const GrowableObjectArray& libs =  GrowableObjectArray::Handle(
+  const GrowableObjectArray& libs = GrowableObjectArray::Handle(
       Isolate::Current()->object_store()->libraries());
   ASSERT(!libs.IsNull());
   // App lib is the last one that was loaded.
@@ -365,9 +358,8 @@
   Library& app_lib = Library::Handle();
   app_lib ^= libs.At(num_libs - 1);
   ASSERT(!app_lib.IsNull());
-  const Class& cls = Class::Handle(
-      app_lib.LookupClass(String::Handle(Symbols::New(Thread::Current(),
-                                                      "A"))));
+  const Class& cls = Class::Handle(app_lib.LookupClass(
+      String::Handle(Symbols::New(Thread::Current(), "A"))));
   EXPECT_EQ(cls.raw(), result.clazz());
 }
 
diff --git a/runtime/vm/code_observers.h b/runtime/vm/code_observers.h
index 1ce8135..1718d39 100644
--- a/runtime/vm/code_observers.h
+++ b/runtime/vm/code_observers.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_CODE_OBSERVERS_H_
-#define VM_CODE_OBSERVERS_H_
+#ifndef RUNTIME_VM_CODE_OBSERVERS_H_
+#define RUNTIME_VM_CODE_OBSERVERS_H_
 
 #include "vm/globals.h"
 #include "vm/allocation.h"
@@ -18,9 +18,9 @@
 // debuggers to map address ranges to function names.
 class CodeObserver {
  public:
-  CodeObserver() { }
+  CodeObserver() {}
 
-  virtual ~CodeObserver() { }
+  virtual ~CodeObserver() {}
 
   // Returns true if this observer is active and should be notified
   // about newly created code objects.
@@ -57,9 +57,7 @@
 
   static void DeleteAll();
 
-  static Mutex* mutex() {
-    return mutex_;
-  }
+  static Mutex* mutex() { return mutex_; }
 
  private:
   static Mutex* mutex_;
@@ -71,4 +69,4 @@
 
 }  // namespace dart
 
-#endif  // VM_CODE_OBSERVERS_H_
+#endif  // RUNTIME_VM_CODE_OBSERVERS_H_
diff --git a/runtime/vm/code_patcher.cc b/runtime/vm/code_patcher.cc
index c62be00..0c46d74 100644
--- a/runtime/vm/code_patcher.cc
+++ b/runtime/vm/code_patcher.cc
@@ -17,8 +17,7 @@
                                                      intptr_t size)
     : address_(address), size_(size) {
   if (FLAG_write_protect_code) {
-    bool status = VirtualMemory::Protect(reinterpret_cast<void*>(address),
-                                         size,
+    bool status = VirtualMemory::Protect(reinterpret_cast<void*>(address), size,
                                          VirtualMemory::kReadWrite);
     ASSERT(status);
   }
@@ -28,8 +27,7 @@
 WritableInstructionsScope::~WritableInstructionsScope() {
   if (FLAG_write_protect_code) {
     bool status = VirtualMemory::Protect(reinterpret_cast<void*>(address_),
-                                         size_,
-                                         VirtualMemory::kReadExecute);
+                                         size_, VirtualMemory::kReadExecute);
     ASSERT(status);
   }
 }
diff --git a/runtime/vm/code_patcher.h b/runtime/vm/code_patcher.h
index bde916f..ec90721 100644
--- a/runtime/vm/code_patcher.h
+++ b/runtime/vm/code_patcher.h
@@ -3,8 +3,8 @@
 // BSD-style license that can be found in the LICENSE file.
 // Class for patching compiled code.
 
-#ifndef VM_CODE_PATCHER_H_
-#define VM_CODE_PATCHER_H_
+#ifndef RUNTIME_VM_CODE_PATCHER_H_
+#define RUNTIME_VM_CODE_PATCHER_H_
 
 #include "vm/allocation.h"
 #include "vm/native_entry.h"
@@ -68,7 +68,7 @@
 
   static intptr_t InstanceCallSizeInBytes();
 
-  static void InsertDeoptimizationCallAt(uword start, uword target);
+  static void InsertDeoptimizationCallAt(uword start);
 
   static void PatchPoolPointerCallAt(uword return_address,
                                      const Code& code,
@@ -95,4 +95,4 @@
 
 }  // namespace dart
 
-#endif  // VM_CODE_PATCHER_H_
+#endif  // RUNTIME_VM_CODE_PATCHER_H_
diff --git a/runtime/vm/code_patcher_arm.cc b/runtime/vm/code_patcher_arm.cc
index 62775bf..70507f8 100644
--- a/runtime/vm/code_patcher_arm.cc
+++ b/runtime/vm/code_patcher_arm.cc
@@ -30,10 +30,8 @@
 }
 
 
-void CodePatcher::InsertDeoptimizationCallAt(uword start, uword target) {
-  // The inserted call should not overlap the lazy deopt jump code.
-  ASSERT(start + CallPattern::DeoptCallPatternLengthInBytes() <= target);
-  CallPattern::InsertDeoptCallAt(start, target);
+void CodePatcher::InsertDeoptimizationCallAt(uword start) {
+  UNREACHABLE();
 }
 
 
@@ -56,8 +54,9 @@
 }
 
 
-RawFunction* CodePatcher::GetUnoptimizedStaticCallAt(
-    uword return_address, const Code& code, ICData* ic_data_result) {
+RawFunction* CodePatcher::GetUnoptimizedStaticCallAt(uword return_address,
+                                                     const Code& code,
+                                                     ICData* ic_data_result) {
   ASSERT(code.ContainsInstructionAt(return_address));
   CallPattern static_call(return_address, code);
   ICData& ic_data = ICData::Handle();
@@ -108,8 +107,8 @@
 
 
 RawCode* CodePatcher::GetNativeCallAt(uword return_address,
-                                     const Code& code,
-                                     NativeFunction* target) {
+                                      const Code& code,
+                                      NativeFunction* target) {
   ASSERT(code.ContainsInstructionAt(return_address));
   NativeCallPattern call(return_address, code);
   *target = call.native_function();
diff --git a/runtime/vm/code_patcher_arm64.cc b/runtime/vm/code_patcher_arm64.cc
index 76b959b..b64b21d 100644
--- a/runtime/vm/code_patcher_arm64.cc
+++ b/runtime/vm/code_patcher_arm64.cc
@@ -15,17 +15,14 @@
 class PoolPointerCall : public ValueObject {
  public:
   PoolPointerCall(uword pc, const Code& code)
-      : end_(pc),
-        object_pool_(ObjectPool::Handle(code.GetObjectPool())) {
+      : end_(pc), object_pool_(ObjectPool::Handle(code.GetObjectPool())) {
     // Last instruction: blr ip0.
     ASSERT(*(reinterpret_cast<uint32_t*>(end_) - 1) == 0xd63f0200);
-    InstructionPattern::DecodeLoadWordFromPool(
-        end_ - 2 * Instr::kInstrSize, &reg_, &index_);
+    InstructionPattern::DecodeLoadWordFromPool(end_ - 2 * Instr::kInstrSize,
+                                               &reg_, &index_);
   }
 
-  intptr_t pp_index() const {
-    return index_;
-  }
+  intptr_t pp_index() const { return index_; }
 
   RawCode* Target() const {
     return reinterpret_cast<RawCode*>(object_pool_.ObjectAt(pp_index()));
@@ -70,10 +67,8 @@
 }
 
 
-void CodePatcher::InsertDeoptimizationCallAt(uword start, uword target) {
-  // The inserted call should not overlap the lazy deopt jump code.
-  ASSERT(start + CallPattern::kDeoptCallLengthInBytes <= target);
-  CallPattern::InsertDeoptCallAt(start, target);
+void CodePatcher::InsertDeoptimizationCallAt(uword start) {
+  UNREACHABLE();
 }
 
 
@@ -96,8 +91,9 @@
 }
 
 
-RawFunction* CodePatcher::GetUnoptimizedStaticCallAt(
-    uword return_address, const Code& code, ICData* ic_data_result) {
+RawFunction* CodePatcher::GetUnoptimizedStaticCallAt(uword return_address,
+                                                     const Code& code,
+                                                     ICData* ic_data_result) {
   ASSERT(code.ContainsInstructionAt(return_address));
   CallPattern static_call(return_address, code);
   ICData& ic_data = ICData::Handle();
diff --git a/runtime/vm/code_patcher_arm64_test.cc b/runtime/vm/code_patcher_arm64_test.cc
index af3417f..ce077b6 100644
--- a/runtime/vm/code_patcher_arm64_test.cc
+++ b/runtime/vm/code_patcher_arm64_test.cc
@@ -26,22 +26,17 @@
   const Script& script = Script::Handle();
   const Class& owner_class = Class::Handle(Class::New(
       Library::Handle(), class_name, script, TokenPosition::kNoSource));
-  const String& function_name = String::Handle(Symbols::New(thread,
-                                                            "callerFunction"));
-  const Function& function = Function::Handle(
-      Function::New(function_name, RawFunction::kRegularFunction,
-                    true, false, false, false, false, owner_class,
-                    TokenPosition::kNoSource));
+  const String& function_name =
+      String::Handle(Symbols::New(thread, "callerFunction"));
+  const Function& function = Function::Handle(Function::New(
+      function_name, RawFunction::kRegularFunction, true, false, false, false,
+      false, owner_class, TokenPosition::kNoSource));
 
   const String& target_name = String::Handle(String::New("targetFunction"));
   const Array& args_descriptor =
       Array::Handle(ArgumentsDescriptor::New(1, Object::null_array()));
-  const ICData& ic_data = ICData::ZoneHandle(ICData::New(function,
-                                                         target_name,
-                                                         args_descriptor,
-                                                         15,
-                                                         1,
-                                                         false));
+  const ICData& ic_data = ICData::ZoneHandle(
+      ICData::New(function, target_name, args_descriptor, 15, 1, false));
 
   // Code accessing pp is generated, but not executed. Uninitialized pp is OK.
   __ set_constant_pool_allowed(true);
@@ -58,7 +53,7 @@
   ICData& ic_data = ICData::Handle();
   CodePatcher::GetInstanceCallAt(return_address, test->code(), &ic_data);
   EXPECT_STREQ("targetFunction",
-      String::Handle(ic_data.target_name()).ToCString());
+               String::Handle(ic_data.target_name()).ToCString());
   EXPECT_EQ(1, ic_data.NumArgsTested());
   EXPECT_EQ(0, ic_data.NumberOfChecks());
 }
diff --git a/runtime/vm/code_patcher_arm_test.cc b/runtime/vm/code_patcher_arm_test.cc
index f63c546..c3dce93 100644
--- a/runtime/vm/code_patcher_arm_test.cc
+++ b/runtime/vm/code_patcher_arm_test.cc
@@ -26,22 +26,17 @@
   const Script& script = Script::Handle();
   const Class& owner_class = Class::Handle(Class::New(
       Library::Handle(), class_name, script, TokenPosition::kNoSource));
-  const String& function_name = String::Handle(Symbols::New(thread,
-                                                            "callerFunction"));
-  const Function& function = Function::Handle(
-      Function::New(function_name, RawFunction::kRegularFunction,
-                    true, false, false, false, false, owner_class,
-                    TokenPosition::kNoSource));
+  const String& function_name =
+      String::Handle(Symbols::New(thread, "callerFunction"));
+  const Function& function = Function::Handle(Function::New(
+      function_name, RawFunction::kRegularFunction, true, false, false, false,
+      false, owner_class, TokenPosition::kNoSource));
 
   const String& target_name = String::Handle(String::New("targetFunction"));
   const Array& args_descriptor =
       Array::Handle(ArgumentsDescriptor::New(1, Object::null_array()));
-  const ICData& ic_data = ICData::ZoneHandle(ICData::New(function,
-                                                         target_name,
-                                                         args_descriptor,
-                                                         15,
-                                                         1,
-                                                         false));
+  const ICData& ic_data = ICData::ZoneHandle(
+      ICData::New(function, target_name, args_descriptor, 15, 1, false));
 
   // Code accessing pp is generated, but not executed. Uninitialized pp is OK.
   __ set_constant_pool_allowed(true);
@@ -58,7 +53,7 @@
   ICData& ic_data = ICData::Handle();
   CodePatcher::GetInstanceCallAt(return_address, test->code(), &ic_data);
   EXPECT_STREQ("targetFunction",
-      String::Handle(ic_data.target_name()).ToCString());
+               String::Handle(ic_data.target_name()).ToCString());
   EXPECT_EQ(1, ic_data.NumArgsTested());
   EXPECT_EQ(0, ic_data.NumberOfChecks());
 }
diff --git a/runtime/vm/code_patcher_dbc.cc b/runtime/vm/code_patcher_dbc.cc
index 327b27f..60cc9d6 100644
--- a/runtime/vm/code_patcher_dbc.cc
+++ b/runtime/vm/code_patcher_dbc.cc
@@ -30,9 +30,8 @@
 }
 
 
-void CodePatcher::InsertDeoptimizationCallAt(uword start, uword target) {
-  ASSERT(target == 0);  // Always 0 on DBC.
-  CallPattern::InsertDeoptCallAt(start, target);
+void CodePatcher::InsertDeoptimizationCallAt(uword start) {
+  CallPattern::InsertDeoptCallAt(start);
 }
 
 
@@ -54,8 +53,9 @@
 }
 
 
-RawFunction* CodePatcher::GetUnoptimizedStaticCallAt(
-    uword return_address, const Code& code, ICData* ic_data_result) {
+RawFunction* CodePatcher::GetUnoptimizedStaticCallAt(uword return_address,
+                                                     const Code& code,
+                                                     ICData* ic_data_result) {
   ASSERT(code.ContainsInstructionAt(return_address));
   CallPattern static_call(return_address, code);
   ICData& ic_data = ICData::Handle();
@@ -106,8 +106,8 @@
 
 
 RawCode* CodePatcher::GetNativeCallAt(uword return_address,
-                                     const Code& code,
-                                     NativeFunction* target) {
+                                      const Code& code,
+                                      NativeFunction* target) {
   ASSERT(code.ContainsInstructionAt(return_address));
   NativeCallPattern call(return_address, code);
   *target = call.native_function();
diff --git a/runtime/vm/code_patcher_ia32.cc b/runtime/vm/code_patcher_ia32.cc
index db04cdf..d0b0a3e 100644
--- a/runtime/vm/code_patcher_ia32.cc
+++ b/runtime/vm/code_patcher_ia32.cc
@@ -44,13 +44,9 @@
            (code_bytes[2 * kMovInstructionSize] == 0xFF);
   }
 
-  uword return_address() const {
-    return start_ + kPatternSize;
-  }
+  uword return_address() const { return start_ + kPatternSize; }
 
-  uword call_address() const {
-    return start_ + 2 * kMovInstructionSize;
-  }
+  uword call_address() const { return start_ + 2 * kMovInstructionSize; }
 
  protected:
   uword start_;
@@ -62,8 +58,7 @@
 
 class NativeCall : public UnoptimizedCall {
  public:
-  explicit NativeCall(uword return_address) : UnoptimizedCall(return_address) {
-  }
+  explicit NativeCall(uword return_address) : UnoptimizedCall(return_address) {}
 
   NativeFunction native_function() const {
     return *reinterpret_cast<NativeFunction*>(start_ + 1);
@@ -145,12 +140,10 @@
 
  private:
   uword return_address() const {
-    return start_ + kMovInstructionSize +  kCallInstructionSize;
+    return start_ + kMovInstructionSize + kCallInstructionSize;
   }
 
-  uword call_address() const {
-    return start_ + kMovInstructionSize;
-  }
+  uword call_address() const { return start_ + kMovInstructionSize; }
 
   uword start_;
 
@@ -170,25 +163,21 @@
                                     const Code& code,
                                     const Code& new_target) {
   const Instructions& instrs = Instructions::Handle(code.instructions());
-  WritableInstructionsScope writable(instrs.PayloadStart(), instrs.size());
+  WritableInstructionsScope writable(instrs.PayloadStart(), instrs.Size());
   ASSERT(code.ContainsInstructionAt(return_address));
   StaticCall call(return_address);
   call.set_target(new_target);
 }
 
 
-void CodePatcher::InsertDeoptimizationCallAt(uword start, uword target) {
-  // The inserted call should not overlap the lazy deopt jump code.
-  ASSERT(start + CallPattern::pattern_length_in_bytes() <= target);
-  *reinterpret_cast<uint8_t*>(start) = 0xE8;
-  CallPattern call(start);
-  call.SetTargetAddress(target);
-  CPU::FlushICache(start, CallPattern::pattern_length_in_bytes());
+void CodePatcher::InsertDeoptimizationCallAt(uword start) {
+  UNREACHABLE();
 }
 
 
-RawCode* CodePatcher::GetInstanceCallAt(
-    uword return_address, const Code& code, ICData* ic_data) {
+RawCode* CodePatcher::GetInstanceCallAt(uword return_address,
+                                        const Code& code,
+                                        ICData* ic_data) {
   ASSERT(code.ContainsInstructionAt(return_address));
   InstanceCall call(return_address);
   if (ic_data != NULL) {
@@ -198,8 +187,9 @@
 }
 
 
-RawFunction* CodePatcher::GetUnoptimizedStaticCallAt(
-    uword return_address, const Code& code, ICData* ic_data_result) {
+RawFunction* CodePatcher::GetUnoptimizedStaticCallAt(uword return_address,
+                                                     const Code& code,
+                                                     ICData* ic_data_result) {
   ASSERT(code.ContainsInstructionAt(return_address));
   UnoptimizedStaticCall static_call(return_address);
   ICData& ic_data = ICData::Handle();
@@ -252,7 +242,6 @@
 }
 
 
-
 intptr_t CodePatcher::InstanceCallSizeInBytes() {
   return InstanceCall::kPatternSize;
 }
diff --git a/runtime/vm/code_patcher_ia32_test.cc b/runtime/vm/code_patcher_ia32_test.cc
index e7a6fab..b3cf0cf 100644
--- a/runtime/vm/code_patcher_ia32_test.cc
+++ b/runtime/vm/code_patcher_ia32_test.cc
@@ -26,22 +26,17 @@
   const Script& script = Script::Handle();
   const Class& owner_class = Class::Handle(Class::New(
       Library::Handle(), class_name, script, TokenPosition::kNoSource));
-  const String& function_name = String::Handle(Symbols::New(thread,
-                                                            "callerFunction"));
-  const Function& function = Function::Handle(
-      Function::New(function_name, RawFunction::kRegularFunction,
-                    true, false, false, false, false, owner_class,
-                    TokenPosition::kNoSource));
+  const String& function_name =
+      String::Handle(Symbols::New(thread, "callerFunction"));
+  const Function& function = Function::Handle(Function::New(
+      function_name, RawFunction::kRegularFunction, true, false, false, false,
+      false, owner_class, TokenPosition::kNoSource));
 
   const String& target_name = String::Handle(String::New("targetFunction"));
   const Array& args_descriptor =
       Array::Handle(ArgumentsDescriptor::New(1, Object::null_array()));
-  const ICData& ic_data = ICData::ZoneHandle(ICData::New(function,
-                                                         target_name,
-                                                         args_descriptor,
-                                                         15,
-                                                         1,
-                                                         false));
+  const ICData& ic_data = ICData::ZoneHandle(
+      ICData::New(function, target_name, args_descriptor, 15, 1, false));
 
   __ LoadObject(ECX, ic_data);
   __ Call(*StubCode::OneArgCheckInlineCache_entry());
@@ -54,7 +49,7 @@
   ICData& ic_data = ICData::Handle();
   CodePatcher::GetInstanceCallAt(return_address, test->code(), &ic_data);
   EXPECT_STREQ("targetFunction",
-      String::Handle(ic_data.target_name()).ToCString());
+               String::Handle(ic_data.target_name()).ToCString());
   EXPECT_EQ(1, ic_data.NumArgsTested());
   EXPECT_EQ(0, ic_data.NumberOfChecks());
 }
diff --git a/runtime/vm/code_patcher_mips.cc b/runtime/vm/code_patcher_mips.cc
index a4d0433..a6dab70 100644
--- a/runtime/vm/code_patcher_mips.cc
+++ b/runtime/vm/code_patcher_mips.cc
@@ -29,10 +29,8 @@
 }
 
 
-void CodePatcher::InsertDeoptimizationCallAt(uword start, uword target) {
-  // The inserted call should not overlap the lazy deopt jump code.
-  ASSERT(start + CallPattern::kDeoptCallLengthInBytes <= target);
-  CallPattern::InsertDeoptCallAt(start, target);
+void CodePatcher::InsertDeoptimizationCallAt(uword start) {
+  UNREACHABLE();
 }
 
 
@@ -55,8 +53,9 @@
 }
 
 
-RawFunction* CodePatcher::GetUnoptimizedStaticCallAt(
-    uword return_address, const Code& code, ICData* ic_data_result) {
+RawFunction* CodePatcher::GetUnoptimizedStaticCallAt(uword return_address,
+                                                     const Code& code,
+                                                     ICData* ic_data_result) {
   ASSERT(code.ContainsInstructionAt(return_address));
   CallPattern static_call(return_address, code);
   ICData& ic_data = ICData::Handle();
diff --git a/runtime/vm/code_patcher_mips_test.cc b/runtime/vm/code_patcher_mips_test.cc
index 8e07b77..61bba69 100644
--- a/runtime/vm/code_patcher_mips_test.cc
+++ b/runtime/vm/code_patcher_mips_test.cc
@@ -26,22 +26,17 @@
   const Script& script = Script::Handle();
   const Class& owner_class = Class::Handle(Class::New(
       Library::Handle(), class_name, script, TokenPosition::kNoSource));
-  const String& function_name = String::Handle(Symbols::New(thread,
-                                                            "callerFunction"));
-  const Function& function = Function::Handle(
-      Function::New(function_name, RawFunction::kRegularFunction,
-                    true, false, false, false, false, owner_class,
-                    TokenPosition::kNoSource));
+  const String& function_name =
+      String::Handle(Symbols::New(thread, "callerFunction"));
+  const Function& function = Function::Handle(Function::New(
+      function_name, RawFunction::kRegularFunction, true, false, false, false,
+      false, owner_class, TokenPosition::kNoSource));
 
   const String& target_name = String::Handle(String::New("targetFunction"));
   const Array& args_descriptor =
       Array::Handle(ArgumentsDescriptor::New(1, Object::null_array()));
-  const ICData& ic_data = ICData::ZoneHandle(ICData::New(function,
-                                                         target_name,
-                                                         args_descriptor,
-                                                         15,
-                                                         1,
-                                                         false));
+  const ICData& ic_data = ICData::ZoneHandle(
+      ICData::New(function, target_name, args_descriptor, 15, 1, false));
 
   __ LoadObject(S5, ic_data);
   __ BranchLinkPatchable(*StubCode::OneArgCheckInlineCache_entry());
@@ -55,7 +50,7 @@
   ICData& ic_data = ICData::Handle();
   CodePatcher::GetInstanceCallAt(return_address, test->code(), &ic_data);
   EXPECT_STREQ("targetFunction",
-      String::Handle(ic_data.target_name()).ToCString());
+               String::Handle(ic_data.target_name()).ToCString());
   EXPECT_EQ(1, ic_data.NumArgsTested());
   EXPECT_EQ(0, ic_data.NumberOfChecks());
 }
diff --git a/runtime/vm/code_patcher_x64.cc b/runtime/vm/code_patcher_x64.cc
index 0e18f6f..4b79751 100644
--- a/runtime/vm/code_patcher_x64.cc
+++ b/runtime/vm/code_patcher_x64.cc
@@ -54,21 +54,17 @@
 
   bool IsValid() const {
     static int16_t pattern[kCallPatternSize] = {
-      0x49, 0x8b, 0x9f, -1, -1, -1, -1,  // movq RBX, [PP + offs]
-      0x4d, 0x8b, 0xa7, -1, -1, -1, -1,  // movq CR, [PP + offs]
-      0x4d, 0x8b, 0x5c, 0x24, 0x07,      // movq TMP, [CR + entry_point_offs]
-      0x41, 0xff, 0xd3                   // callq TMP
+        0x49, 0x8b, 0x9f, -1,   -1,   -1, -1,  // movq RBX, [PP + offs]
+        0x4d, 0x8b, 0xa7, -1,   -1,   -1, -1,  // movq CR, [PP + offs]
+        0x4d, 0x8b, 0x5c, 0x24, 0x07,  // movq TMP, [CR + entry_point_offs]
+        0x41, 0xff, 0xd3               // callq TMP
     };
     return MatchesPattern(start_, pattern, kCallPatternSize);
   }
 
-  intptr_t argument_index() const {
-    return IndexFromPPLoad(start_ + 3);
-  }
+  intptr_t argument_index() const { return IndexFromPPLoad(start_ + 3); }
 
-  RawObject* ic_data() const {
-    return object_pool_.ObjectAt(argument_index());
-  }
+  RawObject* ic_data() const { return object_pool_.ObjectAt(argument_index()); }
 
   RawCode* target() const {
     intptr_t index = IndexFromPPLoad(start_ + 10);
@@ -95,8 +91,7 @@
 class NativeCall : public UnoptimizedCall {
  public:
   NativeCall(uword return_address, const Code& code)
-      : UnoptimizedCall(return_address, code) {
-  }
+      : UnoptimizedCall(return_address, code) {}
 
   NativeFunction native_function() const {
     return reinterpret_cast<NativeFunction>(
@@ -104,8 +99,7 @@
   }
 
   void set_native_function(NativeFunction func) const {
-    object_pool_.SetRawValueAt(argument_index(),
-        reinterpret_cast<uword>(func));
+    object_pool_.SetRawValueAt(argument_index(), reinterpret_cast<uword>(func));
   }
 
  private:
@@ -159,16 +153,14 @@
 
   bool IsValid() const {
     static int16_t pattern[kCallPatternSize] = {
-      0x4d, 0x8b, 0xa7,   -1,   -1, -1, -1,  // movq CR, [PP + offs]
-      0x4d, 0x8b, 0x5c, 0x24, 0x07,          // movq TMP, [CR + entry_point_off]
-      0x41, 0xff, 0xd3                       // callq TMP
+        0x4d, 0x8b, 0xa7, -1,   -1,   -1, -1,  // movq CR, [PP + offs]
+        0x4d, 0x8b, 0x5c, 0x24, 0x07,  // movq TMP, [CR + entry_point_off]
+        0x41, 0xff, 0xd3               // callq TMP
     };
     return MatchesPattern(start_, pattern, kCallPatternSize);
   }
 
-  intptr_t pp_index() const {
-    return IndexFromPPLoad(start_ + 3);
-  }
+  intptr_t pp_index() const { return IndexFromPPLoad(start_ + 3); }
 
   RawCode* Target() const {
     Code& code = Code::Handle();
@@ -207,25 +199,19 @@
 
   bool IsValid() const {
     static int16_t pattern[kCallPatternSize] = {
-      0x49, 0x8b, 0x9f, -1, -1, -1, -1,  // movq rbx, [PP + cache_offs]
-      0x4d, 0x8b, 0xa7, -1, -1, -1, -1,  // movq r12, [PP + code_offs]
-      0x49, 0x8b, 0x4c, 0x24, 0x0f,      // movq rcx, [r12 + entrypoint_off]
-      0xff, 0xd1,                        // call rcx
+        0x4d, 0x8b, 0xa7, -1,   -1,   -1, -1,  // movq r12, [PP + code_offs]
+        0x49, 0x8b, 0x4c, 0x24, 0x0f,  // movq rcx, [r12 + entrypoint_off]
+        0x49, 0x8b, 0x9f, -1,   -1,   -1, -1,  // movq rbx, [PP + cache_offs]
+        0xff, 0xd1,                            // call rcx
     };
     ASSERT(ARRAY_SIZE(pattern) == kCallPatternSize);
     return MatchesPattern(start_, pattern, kCallPatternSize);
   }
 
-  intptr_t data_index() const {
-    return IndexFromPPLoad(start_ + 3);
-  }
-  intptr_t target_index() const {
-    return IndexFromPPLoad(start_ + 10);
-  }
+  intptr_t data_index() const { return IndexFromPPLoad(start_ + 15); }
+  intptr_t target_index() const { return IndexFromPPLoad(start_ + 3); }
 
-  RawObject* data() const {
-    return object_pool_.ObjectAt(data_index());
-  }
+  RawObject* data() const { return object_pool_.ObjectAt(data_index()); }
   RawCode* target() const {
     return reinterpret_cast<RawCode*>(object_pool_.ObjectAt(target_index()));
   }
@@ -251,7 +237,6 @@
 };
 
 
-
 RawCode* CodePatcher::GetStaticCallTargetAt(uword return_address,
                                             const Code& code) {
   ASSERT(code.ContainsInstructionAt(return_address));
@@ -293,18 +278,14 @@
 }
 
 
-void CodePatcher::InsertDeoptimizationCallAt(uword start, uword target) {
-  // The inserted call should not overlap the lazy deopt jump code.
-  ASSERT(start + ShortCallPattern::pattern_length_in_bytes() <= target);
-  *reinterpret_cast<uint8_t*>(start) = 0xE8;
-  ShortCallPattern call(start);
-  call.SetTargetAddress(target);
-  CPU::FlushICache(start, ShortCallPattern::pattern_length_in_bytes());
+void CodePatcher::InsertDeoptimizationCallAt(uword start) {
+  UNREACHABLE();
 }
 
 
-RawFunction* CodePatcher::GetUnoptimizedStaticCallAt(
-    uword return_address, const Code& code, ICData* ic_data_result) {
+RawFunction* CodePatcher::GetUnoptimizedStaticCallAt(uword return_address,
+                                                     const Code& code,
+                                                     ICData* ic_data_result) {
   ASSERT(code.ContainsInstructionAt(return_address));
   UnoptimizedStaticCall static_call(return_address, code);
   ICData& ic_data = ICData::Handle();
diff --git a/runtime/vm/code_patcher_x64_test.cc b/runtime/vm/code_patcher_x64_test.cc
index c6e88c2..c82dc7e 100644
--- a/runtime/vm/code_patcher_x64_test.cc
+++ b/runtime/vm/code_patcher_x64_test.cc
@@ -26,21 +26,17 @@
   const Script& script = Script::Handle();
   const Class& owner_class = Class::Handle(Class::New(
       Library::Handle(), class_name, script, TokenPosition::kNoSource));
-  const String& function_name = String::Handle(Symbols::New(thread,
-                                                            "callerFunction"));
-  const Function& function = Function::Handle(
-      Function::New(function_name, RawFunction::kRegularFunction,
-                    true, false, false, false, false, owner_class,
-                    TokenPosition::kNoSource));
+  const String& function_name =
+      String::Handle(Symbols::New(thread, "callerFunction"));
+  const Function& function = Function::Handle(Function::New(
+      function_name, RawFunction::kRegularFunction, true, false, false, false,
+      false, owner_class, TokenPosition::kNoSource));
 
   const String& target_name = String::Handle(String::New("targetFunction"));
   const Array& args_descriptor =
       Array::Handle(ArgumentsDescriptor::New(1, Object::null_array()));
-  const ICData& ic_data = ICData::ZoneHandle(ICData::New(function,
-                                                         target_name,
-                                                         args_descriptor,
-                                                         15,
-                                                         1, false));
+  const ICData& ic_data = ICData::ZoneHandle(
+      ICData::New(function, target_name, args_descriptor, 15, 1, false));
 
   // Code accessing pp is generated, but not executed. Uninitialized pp is OK.
   __ set_constant_pool_allowed(true);
@@ -56,7 +52,7 @@
   ICData& ic_data = ICData::Handle();
   CodePatcher::GetInstanceCallAt(return_address, test->code(), &ic_data);
   EXPECT_STREQ("targetFunction",
-      String::Handle(ic_data.target_name()).ToCString());
+               String::Handle(ic_data.target_name()).ToCString());
   EXPECT_EQ(1, ic_data.NumArgsTested());
   EXPECT_EQ(0, ic_data.NumberOfChecks());
 }
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index 3972b33..5c5628f 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -16,6 +16,8 @@
 #include "vm/dart_entry.h"
 #include "vm/debugger.h"
 #include "vm/deopt_instructions.h"
+#include "vm/kernel.h"
+#include "vm/kernel_to_il.h"
 #include "vm/disassembler.h"
 #include "vm/exceptions.h"
 #include "vm/flags.h"
@@ -45,37 +47,63 @@
 
 namespace dart {
 
-DEFINE_FLAG(bool, allocation_sinking, true,
-    "Attempt to sink temporary allocations to side exits");
-DEFINE_FLAG(bool, common_subexpression_elimination, true,
-    "Do common subexpression elimination.");
-DEFINE_FLAG(bool, constant_propagation, true,
+DEFINE_FLAG(bool,
+            allocation_sinking,
+            true,
+            "Attempt to sink temporary allocations to side exits");
+DEFINE_FLAG(bool,
+            common_subexpression_elimination,
+            true,
+            "Do common subexpression elimination.");
+DEFINE_FLAG(
+    bool,
+    constant_propagation,
+    true,
     "Do conditional constant propagation/unreachable code elimination.");
-DEFINE_FLAG(int, max_deoptimization_counter_threshold, 16,
+DEFINE_FLAG(
+    int,
+    max_deoptimization_counter_threshold,
+    16,
     "How many times we allow deoptimization before we disallow optimization.");
-DEFINE_FLAG(bool, loop_invariant_code_motion, true,
-    "Do loop invariant code motion.");
+DEFINE_FLAG(bool,
+            loop_invariant_code_motion,
+            true,
+            "Do loop invariant code motion.");
 DEFINE_FLAG(charp, optimization_filter, NULL, "Optimize only named function");
 DEFINE_FLAG(bool, print_flow_graph, false, "Print the IR flow graph.");
-DEFINE_FLAG(bool, print_flow_graph_optimized, false,
-    "Print the IR flow graph when optimizing.");
-DEFINE_FLAG(bool, print_ic_data_map, false,
-    "Print the deopt-id to ICData map in optimizing compiler.");
+DEFINE_FLAG(bool,
+            print_flow_graph_optimized,
+            false,
+            "Print the IR flow graph when optimizing.");
+DEFINE_FLAG(bool,
+            print_ic_data_map,
+            false,
+            "Print the deopt-id to ICData map in optimizing compiler.");
 DEFINE_FLAG(bool, print_code_source_map, false, "Print code source map.");
 DEFINE_FLAG(bool, range_analysis, true, "Enable range analysis");
-DEFINE_FLAG(bool, stress_test_background_compilation, false,
-    "Keep background compiler running all the time");
-DEFINE_FLAG(bool, stop_on_excessive_deoptimization, false,
-    "Debugging: stops program if deoptimizing same function too often");
+DEFINE_FLAG(bool,
+            stress_test_background_compilation,
+            false,
+            "Keep background compiler running all the time");
+DEFINE_FLAG(bool,
+            stop_on_excessive_deoptimization,
+            false,
+            "Debugging: stops program if deoptimizing same function too often");
 DEFINE_FLAG(bool, trace_compiler, false, "Trace compiler operations.");
-DEFINE_FLAG(bool, trace_failed_optimization_attempts, false,
-    "Traces all failed optimization attempts");
-DEFINE_FLAG(bool, trace_optimizing_compiler, false,
-    "Trace only optimizing compiler operations.");
+DEFINE_FLAG(bool,
+            trace_failed_optimization_attempts,
+            false,
+            "Traces all failed optimization attempts");
+DEFINE_FLAG(bool,
+            trace_optimizing_compiler,
+            false,
+            "Trace only optimizing compiler operations.");
 DEFINE_FLAG(bool, trace_bailout, false, "Print bailout from ssa compiler.");
 DEFINE_FLAG(bool, use_inlining, true, "Enable call-site inlining");
-DEFINE_FLAG(bool, verify_compiler, false,
-    "Enable compiler verification assertions");
+DEFINE_FLAG(bool,
+            verify_compiler,
+            false,
+            "Enable compiler verification assertions");
 
 DECLARE_FLAG(bool, huge_method_cutoff_in_code_size);
 DECLARE_FLAG(bool, trace_failed_optimization_attempts);
@@ -84,9 +112,20 @@
 
 #ifndef DART_PRECOMPILED_RUNTIME
 
+
+bool UseKernelFrontEndFor(ParsedFunction* parsed_function) {
+  const Function& function = parsed_function->function();
+  return (function.kernel_function() != NULL) ||
+         (function.kind() == RawFunction::kNoSuchMethodDispatcher) ||
+         (function.kind() == RawFunction::kInvokeFieldDispatcher);
+}
+
+
 void DartCompilationPipeline::ParseFunction(ParsedFunction* parsed_function) {
-  Parser::ParseFunction(parsed_function);
-  parsed_function->AllocateVariables();
+  if (!UseKernelFrontEndFor(parsed_function)) {
+    Parser::ParseFunction(parsed_function);
+    parsed_function->AllocateVariables();
+  }
 }
 
 
@@ -95,9 +134,16 @@
     ParsedFunction* parsed_function,
     const ZoneGrowableArray<const ICData*>& ic_data_array,
     intptr_t osr_id) {
-  // Build the flow graph.
-  FlowGraphBuilder builder(*parsed_function,
-                           ic_data_array,
+  if (UseKernelFrontEndFor(parsed_function)) {
+    kernel::TreeNode* node = static_cast<kernel::TreeNode*>(
+        parsed_function->function().kernel_function());
+    kernel::FlowGraphBuilder builder(node, parsed_function, ic_data_array, NULL,
+                                     osr_id);
+    FlowGraph* graph = builder.BuildGraph();
+    ASSERT(graph != NULL);
+    return graph;
+  }
+  FlowGraphBuilder builder(*parsed_function, ic_data_array,
                            NULL,  // NULL = not inlining.
                            osr_id);
 
@@ -105,7 +151,7 @@
 }
 
 
-void DartCompilationPipeline::FinalizeCompilation(FlowGraph* flow_graph) { }
+void DartCompilationPipeline::FinalizeCompilation(FlowGraph* flow_graph) {}
 
 
 void IrregexpCompilationPipeline::ParseFunction(
@@ -121,24 +167,20 @@
     const ZoneGrowableArray<const ICData*>& ic_data_array,
     intptr_t osr_id) {
   // Compile to the dart IR.
-  RegExpEngine::CompilationResult result =
-      RegExpEngine::CompileIR(parsed_function->regexp_compile_data(),
-                              parsed_function,
-                              ic_data_array);
+  RegExpEngine::CompilationResult result = RegExpEngine::CompileIR(
+      parsed_function->regexp_compile_data(), parsed_function, ic_data_array);
   backtrack_goto_ = result.backtrack_goto;
 
   // Allocate variables now that we know the number of locals.
   parsed_function->AllocateIrregexpVariables(result.num_stack_locals);
 
   // Build the flow graph.
-  FlowGraphBuilder builder(*parsed_function,
-                           ic_data_array,
+  FlowGraphBuilder builder(*parsed_function, ic_data_array,
                            NULL,  // NULL = not inlining.
                            osr_id);
 
-  return new(zone) FlowGraph(*parsed_function,
-                             result.graph_entry,
-                             result.num_blocks);
+  return new (zone)
+      FlowGraph(*parsed_function, result.graph_entry, result.num_blocks);
 }
 
 
@@ -150,9 +192,9 @@
 CompilationPipeline* CompilationPipeline::New(Zone* zone,
                                               const Function& function) {
   if (function.IsIrregexpFunction()) {
-    return new(zone) IrregexpCompilationPipeline();
+    return new (zone) IrregexpCompilationPipeline();
   } else {
-    return new(zone) DartCompilationPipeline();
+    return new (zone) DartCompilationPipeline();
   }
 }
 
@@ -190,7 +232,7 @@
     if (FLAG_trace_failed_optimization_attempts ||
         FLAG_stop_on_excessive_deoptimization) {
       THR_Print("Too many deoptimizations: %s\n",
-          function.ToFullyQualifiedCString());
+                function.ToFullyQualifiedCString());
       if (FLAG_stop_on_excessive_deoptimization) {
         FATAL("Stop on excessive deoptimization");
       }
@@ -331,8 +373,8 @@
   // compile it. Just finalize it directly.
   if (cls.IsTypedefClass()) {
 #if defined(DEBUG)
-    const Class& closure_cls = Class::Handle(
-        Isolate::Current()->object_store()->closure_class());
+    const Class& closure_cls =
+        Class::Handle(Isolate::Current()->object_store()->closure_class());
     ASSERT(closure_cls.is_finalized());
 #endif
     LongJumpScope jump;
@@ -350,16 +392,15 @@
 
   Thread* const thread = Thread::Current();
   StackZone zone(thread);
-NOT_IN_PRODUCT(
+#if !defined(PRODUCT)
   VMTagScope tagScope(thread, VMTag::kCompileClassTagId);
-  TimelineDurationScope tds(thread,
-                            Timeline::GetCompilerStream(),
+  TimelineDurationScope tds(thread, Timeline::GetCompilerStream(),
                             "CompileClass");
   if (tds.enabled()) {
     tds.SetNumArguments(1);
     tds.CopyArgument(0, "class", cls.ToCString());
   }
-)  // !PRODUCT
+#endif  // !defined(PRODUCT)
 
   // We remember all the classes that are being compiled in these lists. This
   // also allows us to reset the marked_for_parsing state in case we see an
@@ -391,7 +432,7 @@
     }
 
     // Parse all the classes that have been added above.
-    for (intptr_t i = (parse_list.length() - 1); i >=0 ; i--) {
+    for (intptr_t i = (parse_list.length() - 1); i >= 0; i--) {
       const Class& parse_class = parse_list.At(i);
       ASSERT(!parse_class.IsNull());
       Parser::ParseClass(parse_class);
@@ -405,13 +446,13 @@
     }
 
     // Finalize these classes.
-    for (intptr_t i = (parse_list.length() - 1); i >=0 ; i--) {
+    for (intptr_t i = (parse_list.length() - 1); i >= 0; i--) {
       const Class& parse_class = parse_list.At(i);
       ASSERT(!parse_class.IsNull());
       ClassFinalizer::FinalizeClass(parse_class);
       parse_class.reset_is_marked_for_parsing();
     }
-    for (intptr_t i = (patch_list.length() - 1); i >=0 ; i--) {
+    for (intptr_t i = (patch_list.length() - 1); i >= 0; i--) {
       const Class& parse_class = patch_list.At(i);
       ASSERT(!parse_class.IsNull());
       ClassFinalizer::FinalizeClass(parse_class);
@@ -453,8 +494,7 @@
         osr_id_(osr_id),
         thread_(Thread::Current()),
         loading_invalidation_gen_at_start_(
-            isolate()->loading_invalidation_gen()) {
-  }
+            isolate()->loading_invalidation_gen()) {}
 
   bool Compile(CompilationPipeline* pipeline);
 
@@ -499,8 +539,8 @@
            deopt_info_array.Length() * sizeof(uword));
   // Allocates instruction object. Since this occurs only at safepoint,
   // there can be no concurrent access to the instruction page.
-  const Code& code = Code::Handle(
-      Code::FinalizeCode(function, assembler, optimized()));
+  const Code& code =
+      Code::Handle(Code::FinalizeCode(function, assembler, optimized()));
   code.set_is_optimized(optimized());
   code.set_owner(function);
   if (!function.IsOptimizable()) {
@@ -510,8 +550,7 @@
   }
 
   const Array& intervals = graph_compiler->inlined_code_intervals();
-  INC_STAT(thread(), total_code_size,
-           intervals.Length() * sizeof(uword));
+  INC_STAT(thread(), total_code_size, intervals.Length() * sizeof(uword));
   code.SetInlinedIntervals(intervals);
 
   const Array& inlined_id_array =
@@ -540,18 +579,17 @@
   graph_compiler->FinalizeExceptionHandlers(code);
   graph_compiler->FinalizeStaticCallTargetsTable(code);
 
-NOT_IN_PRODUCT(
+#if !defined(PRODUCT)
   // Set the code source map after setting the inlined information because
   // we use the inlined information when printing.
-  const CodeSourceMap& code_source_map =
-      CodeSourceMap::Handle(
-          zone,
-          graph_compiler->code_source_map_builder()->Finalize());
+  const CodeSourceMap& code_source_map = CodeSourceMap::Handle(
+      zone, graph_compiler->code_source_map_builder()->Finalize());
   code.set_code_source_map(code_source_map);
   if (FLAG_print_code_source_map) {
     CodeSourceMap::Dump(code_source_map, code, function);
   }
-);
+#endif  // !defined(PRODUCT)
+
   if (optimized()) {
     bool code_was_installed = false;
     // Installs code while at safepoint.
@@ -654,8 +692,8 @@
   ASSERT(Compiler::IsBackgroundCompilation());
   if (!isolate()->background_compiler()->is_running()) {
     // The background compiler is being stopped.
-    Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId,
-        "Background compilation is being stopped");
+    Compiler::AbortBackgroundCompilation(
+        Thread::kNoDeoptId, "Background compilation is being stopped");
   }
 }
 
@@ -671,8 +709,8 @@
   }
   bool is_compiled = false;
   Zone* const zone = thread()->zone();
-  NOT_IN_PRODUCT(
-      TimelineStream* compiler_timeline = Timeline::GetCompilerStream());
+  NOT_IN_PRODUCT(TimelineStream* compiler_timeline =
+                     Timeline::GetCompilerStream());
   CSTAT_TIMER_SCOPE(thread(), codegen_timer);
   HANDLESCOPE(thread());
 
@@ -704,7 +742,7 @@
       {
         CSTAT_TIMER_SCOPE(thread(), graphbuilder_timer);
         ZoneGrowableArray<const ICData*>* ic_data_array =
-            new(zone) ZoneGrowableArray<const ICData*>();
+            new (zone) ZoneGrowableArray<const ICData*>();
         if (optimized()) {
           // Extract type feedback before the graph is built, as the graph
           // builder uses it to attach it to nodes.
@@ -713,7 +751,7 @@
           // already reached the limit.
           ASSERT(Compiler::IsBackgroundCompilation() ||
                  (function.deoptimization_counter() <
-                     FLAG_max_deoptimization_counter_threshold));
+                  FLAG_max_deoptimization_counter_threshold));
 
           // 'Freeze' ICData in background compilation so that it does not
           // change while compiling.
@@ -722,8 +760,8 @@
 
           if (Compiler::IsBackgroundCompilation() &&
               (function.ic_data_array() == Array::null())) {
-            Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId,
-                "RestoreICDataMap: ICData array cleared.");
+            Compiler::AbortBackgroundCompilation(
+                Thread::kNoDeoptId, "RestoreICDataMap: ICData array cleared.");
           }
           if (FLAG_print_ic_data_map) {
             for (intptr_t i = 0; i < ic_data_array->length(); i++) {
@@ -735,13 +773,10 @@
           }
         }
 
-        NOT_IN_PRODUCT(TimelineDurationScope tds(thread(),
-                                                 compiler_timeline,
-                                                 "BuildFlowGraph");)
-        flow_graph = pipeline->BuildFlowGraph(zone,
-                                              parsed_function(),
-                                              *ic_data_array,
-                                              osr_id());
+        NOT_IN_PRODUCT(TimelineDurationScope tds(thread(), compiler_timeline,
+                                                 "BuildFlowGraph"));
+        flow_graph = pipeline->BuildFlowGraph(zone, parsed_function(),
+                                              *ic_data_array, osr_id());
       }
 
       const bool print_flow_graph =
@@ -767,8 +802,7 @@
       }
 
       if (optimized()) {
-        NOT_IN_PRODUCT(TimelineDurationScope tds(thread(),
-                                                 compiler_timeline,
+        NOT_IN_PRODUCT(TimelineDurationScope tds(thread(), compiler_timeline,
                                                  "ComputeSSA"));
         CSTAT_TIMER_SCOPE(thread(), ssa_timer);
         // Transform to SSA (virtual register 0 and no inlining arguments).
@@ -790,8 +824,7 @@
       // have non-generic type feedback attached to them that can
       // potentially affect optimizations.
       if (optimized()) {
-        NOT_IN_PRODUCT(TimelineDurationScope tds(thread(),
-                                                 compiler_timeline,
+        NOT_IN_PRODUCT(TimelineDurationScope tds(thread(), compiler_timeline,
                                                  "OptimizationPasses"));
         inline_id_to_function.Add(&function);
         // We do not add the token position now because we don't know the
@@ -817,8 +850,7 @@
 
         // Inlining (mutates the flow graph)
         if (FLAG_use_inlining) {
-          NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(),
-                                                    compiler_timeline,
+          NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(), compiler_timeline,
                                                     "Inlining"));
           CSTAT_TIMER_SCOPE(thread(), graphinliner_timer);
           // Propagate types to create more inlining opportunities.
@@ -829,12 +861,11 @@
           optimizer.ApplyClassIds();
           DEBUG_ASSERT(flow_graph->VerifyUseLists());
 
-          FlowGraphInliner inliner(flow_graph,
-                                   &inline_id_to_function,
-                                   &inline_id_to_token_pos,
-                                   &caller_inline_id,
+          FlowGraphInliner inliner(flow_graph, &inline_id_to_function,
+                                   &inline_id_to_token_pos, &caller_inline_id,
                                    use_speculative_inlining,
-                                   NULL);
+                                   /*inlining_black_list=*/NULL,
+                                   /*precompiler=*/NULL);
           inliner.Inline();
           // Use lists are maintained and validated by the inliner.
           DEBUG_ASSERT(flow_graph->VerifyUseLists());
@@ -845,8 +876,7 @@
         DEBUG_ASSERT(flow_graph->VerifyUseLists());
 
         {
-          NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(),
-                                                    compiler_timeline,
+          NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(), compiler_timeline,
                                                     "ApplyClassIds"));
           // Use propagated class-ids to optimize further.
           optimizer.ApplyClassIds();
@@ -867,8 +897,7 @@
         DEBUG_ASSERT(flow_graph->VerifyUseLists());
 
         {
-          NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(),
-                                                    compiler_timeline,
+          NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(), compiler_timeline,
                                                     "BranchSimplifier"));
           BranchSimplifier::Simplify(flow_graph);
           DEBUG_ASSERT(flow_graph->VerifyUseLists());
@@ -878,10 +907,9 @@
         }
 
         if (FLAG_constant_propagation) {
-          NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(),
-                                                    compiler_timeline,
+          NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(), compiler_timeline,
                                                     "ConstantPropagation");
-          ConstantPropagator::Optimize(flow_graph));
+                         ConstantPropagator::Optimize(flow_graph));
           DEBUG_ASSERT(flow_graph->VerifyUseLists());
           // A canonicalization pass to remove e.g. smi checks on smi constants.
           flow_graph->Canonicalize();
@@ -907,8 +935,7 @@
         DEBUG_ASSERT(flow_graph->VerifyUseLists());
 
         {
-          NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(),
-                                                    compiler_timeline,
+          NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(), compiler_timeline,
                                                     "SelectRepresentations"));
           // Where beneficial convert Smi operations into Int32 operations.
           // Only meanigful for 32bit platforms right now.
@@ -961,15 +988,13 @@
         DEBUG_ASSERT(flow_graph->VerifyUseLists());
 
         {
-          NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(),
-                                                    compiler_timeline,
+          NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(), compiler_timeline,
                                                     "DeadStoreElimination"));
           DeadStoreElimination::Optimize(flow_graph);
         }
 
         if (FLAG_range_analysis) {
-          NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(),
-                                                    compiler_timeline,
+          NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(), compiler_timeline,
                                                     "RangeAnalysis"));
           // Propagate types after store-load-forwarding. Some phis may have
           // become smi phis that can be processed by range analysis.
@@ -1013,8 +1038,7 @@
         flow_graph->EliminateEnvironments();
 
         {
-          NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(),
-                                                    compiler_timeline,
+          NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(), compiler_timeline,
                                                     "EliminateDeadPhis"));
           DeadCodeElimination::EliminateDeadPhis(flow_graph);
           DEBUG_ASSERT(flow_graph->VerifyUseLists());
@@ -1028,7 +1052,7 @@
         // the deoptimization path.
         AllocationSinking* sinking = NULL;
         if (FLAG_allocation_sinking &&
-            (flow_graph->graph_entry()->SuccessorCount()  == 1)) {
+            (flow_graph->graph_entry()->SuccessorCount() == 1)) {
           NOT_IN_PRODUCT(TimelineDurationScope tds2(
               thread(), compiler_timeline, "AllocationSinking::Optimize"));
           // TODO(fschneider): Support allocation sinking with try-catch.
@@ -1044,8 +1068,7 @@
         DEBUG_ASSERT(flow_graph->VerifyUseLists());
 
         {
-          NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(),
-                                                    compiler_timeline,
+          NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(), compiler_timeline,
                                                     "SelectRepresentations"));
           // Ensure that all phis inserted by optimization passes have
           // consistent representations.
@@ -1078,8 +1101,7 @@
         FlowGraphInliner::CollectGraphInfo(flow_graph, true);
 
         {
-          NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(),
-                                                    compiler_timeline,
+          NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(), compiler_timeline,
                                                     "AllocateRegisters"));
           // Perform register allocation on the SSA graph.
           FlowGraphAllocator allocator(*flow_graph);
@@ -1099,22 +1121,18 @@
 
       ASSERT(inline_id_to_function.length() == caller_inline_id.length());
       Assembler assembler(use_far_branches);
-      FlowGraphCompiler graph_compiler(&assembler, flow_graph,
-                                       *parsed_function(), optimized(),
-                                       inline_id_to_function,
-                                       inline_id_to_token_pos,
-                                       caller_inline_id);
+      FlowGraphCompiler graph_compiler(
+          &assembler, flow_graph, *parsed_function(), optimized(),
+          inline_id_to_function, inline_id_to_token_pos, caller_inline_id);
       {
         CSTAT_TIMER_SCOPE(thread(), graphcompiler_timer);
-        NOT_IN_PRODUCT(TimelineDurationScope tds(thread(),
-                                                 compiler_timeline,
+        NOT_IN_PRODUCT(TimelineDurationScope tds(thread(), compiler_timeline,
                                                  "CompileGraph"));
         graph_compiler.CompileGraph();
         pipeline->FinalizeCompilation(flow_graph);
       }
       {
-        NOT_IN_PRODUCT(TimelineDurationScope tds(thread(),
-                                                 compiler_timeline,
+        NOT_IN_PRODUCT(TimelineDurationScope tds(thread(), compiler_timeline,
                                                  "FinalizeCompilation"));
         if (thread()->IsMutatorThread()) {
           FinalizeCompilation(&assembler, &graph_compiler, flow_graph);
@@ -1187,7 +1205,7 @@
 }
 
 
-DEBUG_ONLY(
+#if defined(DEBUG)
 // Verifies that the inliner is always in the list of inlined functions.
 // If this fails run with --trace-inlining-intervals to get more information.
 static void CheckInliningIntervals(const Function& function) {
@@ -1205,7 +1223,7 @@
            function.raw());
   }
 }
-)
+#endif  // defined(DEBUG)
 
 static RawError* CompileFunctionHelper(CompilationPipeline* pipeline,
                                        const Function& function,
@@ -1220,23 +1238,21 @@
     StackZone stack_zone(thread);
     Zone* const zone = stack_zone.GetZone();
     const bool trace_compiler =
-        FLAG_trace_compiler ||
-        (FLAG_trace_optimizing_compiler && optimized);
+        FLAG_trace_compiler || (FLAG_trace_optimizing_compiler && optimized);
     Timer per_compile_timer(trace_compiler, "Compilation time");
     per_compile_timer.Start();
 
-    ParsedFunction* parsed_function = new(zone) ParsedFunction(
-        thread, Function::ZoneHandle(zone, function.raw()));
+    ParsedFunction* parsed_function = new (zone)
+        ParsedFunction(thread, Function::ZoneHandle(zone, function.raw()));
     if (trace_compiler) {
-      const intptr_t token_size = function.end_token_pos().Pos() -
-                                  function.token_pos().Pos();
+      const intptr_t token_size =
+          function.end_token_pos().Pos() - function.token_pos().Pos();
       THR_Print("Compiling %s%sfunction %s: '%s' @ token %s, size %" Pd "\n",
                 (osr_id == Compiler::kNoOSRDeoptId ? "" : "osr "),
                 (optimized ? "optimized " : ""),
                 (Compiler::IsBackgroundCompilation() ? "(background)" : ""),
                 function.ToFullyQualifiedCString(),
-                function.token_pos().ToCString(),
-                token_size);
+                function.token_pos().ToCString(), token_size);
     }
     INC_STAT(thread, num_functions_compiled, 1);
     if (optimized) {
@@ -1250,8 +1266,7 @@
       const int64_t num_tokens_before = STAT_VALUE(thread, num_tokens_consumed);
       pipeline->ParseFunction(parsed_function);
       const int64_t num_tokens_after = STAT_VALUE(thread, num_tokens_consumed);
-      INC_STAT(thread,
-               num_func_tokens_compiled,
+      INC_STAT(thread, num_func_tokens_compiled,
                num_tokens_after - num_tokens_before);
     }
 
@@ -1259,11 +1274,12 @@
 
     if (Compiler::IsBackgroundCompilation()) {
       if (isolate->IsTopLevelParsing() ||
-              (loading_invalidation_gen_at_start !=
-               isolate->loading_invalidation_gen())) {
+          (loading_invalidation_gen_at_start !=
+           isolate->loading_invalidation_gen())) {
         // Loading occured while parsing. We need to abort here because state
         // changed while compiling.
-        Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId,
+        Compiler::AbortBackgroundCompilation(
+            Thread::kNoDeoptId,
             "Invalidated state during parsing because of script loading");
       }
     }
@@ -1280,7 +1296,7 @@
           // state change during compilation.
           if (FLAG_trace_compiler) {
             THR_Print("Aborted background compilation: %s\n",
-                function.ToFullyQualifiedCString());
+                      function.ToFullyQualifiedCString());
           }
           {
             // If it was a bailout, then disable optimization.
@@ -1342,8 +1358,7 @@
 
     if (FLAG_disassemble && FlowGraphPrinter::ShouldPrint(function)) {
       Disassembler::DisassembleCode(function, optimized);
-    } else if (FLAG_disassemble_optimized &&
-               optimized &&
+    } else if (FLAG_disassemble_optimized && optimized &&
                FlowGraphPrinter::ShouldPrint(function)) {
       Disassembler::DisassembleCode(function, true);
     }
@@ -1362,7 +1377,7 @@
       // Exit compilation, retry it later.
       if (FLAG_trace_bailout) {
         THR_Print("Aborted background compilation: %s\n",
-            function.ToFullyQualifiedCString());
+                  function.ToFullyQualifiedCString());
       }
       return Error::null();
     }
@@ -1387,26 +1402,24 @@
     StackZone stack_zone(thread);
     Zone* const zone = stack_zone.GetZone();
     const bool trace_compiler =
-        FLAG_trace_compiler ||
-        (FLAG_trace_optimizing_compiler && optimized);
+        FLAG_trace_compiler || (FLAG_trace_optimizing_compiler && optimized);
 
     if (trace_compiler) {
-      const intptr_t token_size = function.end_token_pos().Pos() -
-                                  function.token_pos().Pos();
+      const intptr_t token_size =
+          function.end_token_pos().Pos() - function.token_pos().Pos();
       THR_Print("Parsing %s%sfunction %s: '%s' @ token %s, size %" Pd "\n",
                 (osr_id == Compiler::kNoOSRDeoptId ? "" : "osr "),
                 (optimized ? "optimized " : ""),
                 (Compiler::IsBackgroundCompilation() ? "(background)" : ""),
                 function.ToFullyQualifiedCString(),
-                function.token_pos().ToCString(),
-                token_size);
+                function.token_pos().ToCString(), token_size);
     }
-    ParsedFunction* parsed_function = new(zone) ParsedFunction(
-        thread, Function::ZoneHandle(zone, function.raw()));
+    ParsedFunction* parsed_function = new (zone)
+        ParsedFunction(thread, Function::ZoneHandle(zone, function.raw()));
     pipeline->ParseFunction(parsed_function);
-    // For now we just walk thru the AST nodes and in DEBUG mode we print
-    // them otherwise just skip through them, this will be need to be
-    // wired to generate the IR format.
+// For now we just walk thru the AST nodes and in DEBUG mode we print
+// them otherwise just skip through them, this will be need to be
+// wired to generate the IR format.
 #if !defined(PRODUCT)
 #if defined(DEBUG)
     AstPrinter ast_printer(true);
@@ -1434,18 +1447,20 @@
 }
 
 
-RawError* Compiler::CompileFunction(Thread* thread,
-                                    const Function& function) {
+RawError* Compiler::CompileFunction(Thread* thread, const Function& function) {
 #ifdef DART_PRECOMPILER
   if (FLAG_precompiled_mode) {
-    return Precompiler::CompileFunction(thread, thread->zone(), function);
+    return Precompiler::CompileFunction(
+        /* precompiler = */ NULL, thread, thread->zone(), function);
   }
 #endif
+
   Isolate* isolate = thread->isolate();
-NOT_IN_PRODUCT(
+
+#if !defined(PRODUCT)
   VMTagScope tagScope(thread, VMTag::kCompileUnoptimizedTagId);
   TIMELINE_FUNCTION_COMPILATION_DURATION(thread, "CompileFunction", function);
-)  // !PRODUCT
+#endif  // !defined(PRODUCT)
 
   if (!isolate->compilation_allowed()) {
     FATAL3("Precompilation missed function %s (%s, %s)\n",
@@ -1457,20 +1472,17 @@
   CompilationPipeline* pipeline =
       CompilationPipeline::New(thread->zone(), function);
 
-  return CompileFunctionHelper(pipeline,
-                               function,
-                               /* optimized = */ false,
-                               kNoOSRDeoptId);
+  return CompileFunctionHelper(pipeline, function,
+                               /* optimized = */ false, kNoOSRDeoptId);
 }
 
 
-RawError* Compiler::ParseFunction(Thread* thread,
-                                  const Function& function) {
+RawError* Compiler::ParseFunction(Thread* thread, const Function& function) {
   Isolate* isolate = thread->isolate();
-NOT_IN_PRODUCT(
+#if !defined(PRODUCT)
   VMTagScope tagScope(thread, VMTag::kCompileUnoptimizedTagId);
   TIMELINE_FUNCTION_COMPILATION_DURATION(thread, "ParseFunction", function);
-)  // !PRODUCT
+#endif  // !defined(PRODUCT)
 
   if (!isolate->compilation_allowed()) {
     FATAL3("Precompilation missed function %s (%s, %s)\n",
@@ -1482,10 +1494,8 @@
   CompilationPipeline* pipeline =
       CompilationPipeline::New(thread->zone(), function);
 
-  return ParseFunctionHelper(pipeline,
-                             function,
-                             /* optimized = */ false,
-                             kNoOSRDeoptId);
+  return ParseFunctionHelper(pipeline, function,
+                             /* optimized = */ false, kNoOSRDeoptId);
 }
 
 
@@ -1501,9 +1511,7 @@
   CompilationPipeline* pipeline =
       CompilationPipeline::New(thread->zone(), function);
   const Error& error = Error::Handle(
-      CompileFunctionHelper(pipeline,
-                            function,
-                            false,  /* not optimized */
+      CompileFunctionHelper(pipeline, function, false, /* not optimized */
                             kNoOSRDeoptId));
   if (!error.IsNull()) {
     return error.raw();
@@ -1525,7 +1533,7 @@
 RawError* Compiler::CompileOptimizedFunction(Thread* thread,
                                              const Function& function,
                                              intptr_t osr_id) {
-NOT_IN_PRODUCT(
+#if !defined(PRODUCT)
   VMTagScope tagScope(thread, VMTag::kCompileOptimizedTagId);
   const char* event_name;
   if (osr_id != kNoOSRDeoptId) {
@@ -1536,26 +1544,22 @@
     event_name = "CompileFunctionOptimized";
   }
   TIMELINE_FUNCTION_COMPILATION_DURATION(thread, event_name, function);
-)  // !PRODUCT
+#endif  // !defined(PRODUCT)
 
   // If we are in the optimizing in the mutator/Dart thread, then
   // this is either an OSR compilation or background compilation is
   // not currently allowed.
-  ASSERT(!thread->IsMutatorThread() ||
-         (osr_id != kNoOSRDeoptId) ||
+  ASSERT(!thread->IsMutatorThread() || (osr_id != kNoOSRDeoptId) ||
          !FLAG_background_compilation || BackgroundCompiler::IsDisabled());
   CompilationPipeline* pipeline =
       CompilationPipeline::New(thread->zone(), function);
-  return CompileFunctionHelper(pipeline,
-                               function,
-                               true,  /* optimized */
+  return CompileFunctionHelper(pipeline, function, true, /* optimized */
                                osr_id);
 }
 
 
 // This is only used from unit tests.
-RawError* Compiler::CompileParsedFunction(
-    ParsedFunction* parsed_function) {
+RawError* Compiler::CompileParsedFunction(ParsedFunction* parsed_function) {
   LongJumpScope jump;
   if (setjmp(*jump.Set()) == 0) {
     // Non-optimized code generator.
@@ -1620,8 +1624,7 @@
   for (int i = 0; i < functions.Length(); i++) {
     func ^= functions.At(i);
     ASSERT(!func.IsNull());
-    if (!func.HasCode() &&
-        !func.is_abstract() &&
+    if (!func.HasCode() && !func.is_abstract() &&
         !func.IsRedirectingFactory()) {
       if ((cls.is_mixin_app_alias() || cls.IsMixinApplication()) &&
           func.HasOptionalParameters()) {
@@ -1694,28 +1697,36 @@
     ASSERT(!field.HasPrecompiledInitializer());
     Function& initializer = Function::Handle(thread->zone());
     {
-      NOT_IN_PRODUCT(
-        VMTagScope tagScope(thread, VMTag::kCompileUnoptimizedTagId);
-        TimelineDurationScope tds(thread, Timeline::GetCompilerStream(),
-                                  "CompileStaticInitializer");
-        if (tds.enabled()) {
-          tds.SetNumArguments(1);
-          tds.CopyArgument(0, "field", field.ToCString());
-        }
-      )
+#if !defined(PRODUCT)
+      VMTagScope tagScope(thread, VMTag::kCompileUnoptimizedTagId);
+      TimelineDurationScope tds(thread, Timeline::GetCompilerStream(),
+                                "CompileStaticInitializer");
+      if (tds.enabled()) {
+        tds.SetNumArguments(1);
+        tds.CopyArgument(0, "field", field.ToCString());
+      }
+#endif  // !defined(PRODUCT)
 
-      StackZone zone(thread);
-      ParsedFunction* parsed_function =
-          Parser::ParseStaticFieldInitializer(field);
+      StackZone stack_zone(thread);
+      Zone* zone = stack_zone.GetZone();
+      ParsedFunction* parsed_function;
 
-      parsed_function->AllocateVariables();
+      // Create a one-time-use function to evaluate the initializer and invoke
+      // it immediately.
+      if (field.kernel_field() != NULL) {
+        parsed_function = kernel::ParseStaticFieldInitializer(zone, field);
+      } else {
+        parsed_function = Parser::ParseStaticFieldInitializer(field);
+        parsed_function->AllocateVariables();
+      }
+
       // Non-optimized code generator.
       DartCompilationPipeline pipeline;
       CompileParsedFunctionHelper helper(parsed_function, false, kNoOSRDeoptId);
       helper.Compile(&pipeline);
       initializer = parsed_function->function().raw();
-      Code::Handle(initializer.unoptimized_code()).set_var_descriptors(
-          Object::empty_var_descriptors());
+      Code::Handle(initializer.unoptimized_code())
+          .set_var_descriptors(Object::empty_var_descriptors());
     }
     // Invoke the function to evaluate the expression.
     return DartEntry::InvokeFunction(initializer, Object::empty_array());
@@ -1731,7 +1742,6 @@
 }
 
 
-
 RawObject* Compiler::ExecuteOnce(SequenceNode* fragment) {
 #ifdef DART_PRECOMPILER
   if (FLAG_precompiled_mode) {
@@ -1764,7 +1774,7 @@
     const Function& func = Function::ZoneHandle(Function::New(
         String::Handle(Symbols::New(thread, kEvalConst)),
         RawFunction::kRegularFunction,
-        true,  // static function
+        true,   // static function
         false,  // not const function
         false,  // not abstract
         false,  // not external
@@ -1785,16 +1795,15 @@
     ParsedFunction* parsed_function = new ParsedFunction(thread, func);
     parsed_function->SetNodeSequence(fragment);
     fragment->scope()->AddVariable(parsed_function->EnsureExpressionTemp());
-    fragment->scope()->AddVariable(
-        parsed_function->current_context_var());
+    fragment->scope()->AddVariable(parsed_function->current_context_var());
     parsed_function->AllocateVariables();
 
     // Non-optimized code generator.
     DartCompilationPipeline pipeline;
     CompileParsedFunctionHelper helper(parsed_function, false, kNoOSRDeoptId);
     helper.Compile(&pipeline);
-    Code::Handle(func.unoptimized_code()).set_var_descriptors(
-        Object::empty_var_descriptors());
+    Code::Handle(func.unoptimized_code())
+        .set_var_descriptors(Object::empty_var_descriptors());
 
     const Object& result = PassiveObject::Handle(
         DartEntry::InvokeFunction(func, Object::empty_array()));
@@ -1814,7 +1823,7 @@
   if (FLAG_trace_compiler) {
     THR_Print("ABORT background compilation: %s\n", msg);
   }
-NOT_IN_PRODUCT(
+#if !defined(PRODUCT)
   TimelineStream* stream = Timeline::GetCompilerStream();
   ASSERT(stream != NULL);
   TimelineEvent* event = stream->StartEvent();
@@ -1824,7 +1833,7 @@
     event->CopyArgument(0, "reason", msg);
     event->Complete();
   }
-)  // !PRODUCT
+#endif  // !defined(PRODUCT)
   ASSERT(Compiler::IsBackgroundCompilation());
   Thread::Current()->long_jump_base()->Jump(
       deopt_id, Object::background_compilation_error());
@@ -1835,9 +1844,7 @@
 class QueueElement {
  public:
   explicit QueueElement(const Function& function)
-      : next_(NULL),
-        function_(function.raw()) {
-  }
+      : next_(NULL), function_(function.raw()) {}
 
   virtual ~QueueElement() {
     next_ = NULL;
@@ -1868,9 +1875,7 @@
 class BackgroundCompilationQueue {
  public:
   BackgroundCompilationQueue() : first_(NULL), last_(NULL) {}
-  virtual ~BackgroundCompilationQueue() {
-    Clear();
-  }
+  virtual ~BackgroundCompilationQueue() { Clear(); }
 
   void VisitObjectPointers(ObjectPointerVisitor* visitor) {
     ASSERT(visitor != NULL);
@@ -1897,9 +1902,7 @@
     ASSERT(first_ != NULL && last_ != NULL);
   }
 
-  QueueElement* Peek() const {
-    return first_;
-  }
+  QueueElement* Peek() const { return first_; }
 
   RawFunction* PeekFunction() const {
     QueueElement* e = Peek();
@@ -1948,8 +1951,11 @@
 
 
 BackgroundCompiler::BackgroundCompiler(Isolate* isolate)
-    : isolate_(isolate), running_(true), done_(new bool()),
-      queue_monitor_(new Monitor()), done_monitor_(new Monitor()),
+    : isolate_(isolate),
+      running_(true),
+      done_(new bool()),
+      queue_monitor_(new Monitor()),
+      done_monitor_(new Monitor()),
       function_queue_(new BackgroundCompilationQueue()) {
   *done_ = false;
 }
@@ -1978,14 +1984,14 @@
       Zone* zone = stack_zone.GetZone();
       HANDLESCOPE(thread);
       Function& function = Function::Handle(zone);
-      { MonitorLocker ml(queue_monitor_);
+      {
+        MonitorLocker ml(queue_monitor_);
         function = function_queue()->PeekFunction();
       }
       while (running_ && !function.IsNull() && !isolate_->IsTopLevelParsing()) {
         // Check that we have aggregated and cleared the stats.
         ASSERT(thread->compiler_stats()->IsCleared());
-        Compiler::CompileOptimizedFunction(thread,
-                                           function,
+        Compiler::CompileOptimizedFunction(thread, function,
                                            Compiler::kNoOSRDeoptId);
 #ifndef PRODUCT
         Isolate* isolate = thread->isolate();
@@ -1994,7 +2000,8 @@
 #endif  // PRODUCT
 
         QueueElement* qelem = NULL;
-        { MonitorLocker ml(queue_monitor_);
+        {
+          MonitorLocker ml(queue_monitor_);
           if (function_queue()->IsEmpty()) {
             // We are shutting down, queue was cleared.
             function = Function::null();
@@ -2002,7 +2009,7 @@
             qelem = function_queue()->Remove();
             const Function& old = Function::Handle(qelem->Function());
             if ((!old.HasOptimizedCode() && old.IsOptimizable()) ||
-                 FLAG_stress_test_background_compilation) {
+                FLAG_stress_test_background_compilation) {
               if (Compiler::CanOptimizeFunction(thread, old)) {
                 QueueElement* repeat_qelem = new QueueElement(old);
                 function_queue()->Add(repeat_qelem);
@@ -2020,8 +2027,8 @@
     {
       // Wait to be notified when the work queue is not empty.
       MonitorLocker ml(queue_monitor_);
-      while ((function_queue()->IsEmpty() || isolate_->IsTopLevelParsing())
-              && running_) {
+      while ((function_queue()->IsEmpty() || isolate_->IsTopLevelParsing()) &&
+             running_) {
         ml.Wait();
       }
     }
@@ -2079,7 +2086,7 @@
     function_queue->Clear();
     // 'task' will be deleted by thread pool.
     task = NULL;
-    ml.Notify();   // Stop waiting for the queue.
+    ml.Notify();  // Stop waiting for the queue.
   }
 
   {
@@ -2135,11 +2142,10 @@
   ASSERT(thread->IsMutatorThread());
   // Finalize NoSuchMethodError, _Mint; occasionally needed in optimized
   // compilation.
-  Class& cls = Class::Handle(thread->zone(),
-      Library::LookupCoreClass(Symbols::NoSuchMethodError()));
+  Class& cls = Class::Handle(
+      thread->zone(), Library::LookupCoreClass(Symbols::NoSuchMethodError()));
   ASSERT(!cls.IsNull());
-  Error& error = Error::Handle(thread->zone(),
-      cls.EnsureIsFinalized(thread));
+  Error& error = Error::Handle(thread->zone(), cls.EnsureIsFinalized(thread));
   ASSERT(error.IsNull());
   cls = Library::LookupCoreClass(Symbols::_Mint());
   ASSERT(!cls.IsNull());
@@ -2165,6 +2171,12 @@
 #else  // DART_PRECOMPILED_RUNTIME
 
 
+bool UseKernelFrontEndFor(ParsedFunction* parsed_function) {
+  UNREACHABLE();
+  return false;
+}
+
+
 CompilationPipeline* CompilationPipeline::New(Zone* zone,
                                               const Function& function) {
   UNREACHABLE();
@@ -2204,15 +2216,13 @@
 }
 
 
-RawError* Compiler::CompileFunction(Thread* thread,
-                                    const Function& function) {
+RawError* Compiler::CompileFunction(Thread* thread, const Function& function) {
   UNREACHABLE();
   return Error::null();
 }
 
 
-RawError* Compiler::ParseFunction(Thread* thread,
-                                  const Function& function) {
+RawError* Compiler::ParseFunction(Thread* thread, const Function& function) {
   UNREACHABLE();
   return Error::null();
 }
@@ -2233,8 +2243,7 @@
 }
 
 
-RawError* Compiler::CompileParsedFunction(
-    ParsedFunction* parsed_function) {
+RawError* Compiler::CompileParsedFunction(ParsedFunction* parsed_function) {
   UNREACHABLE();
   return Error::null();
 }
diff --git a/runtime/vm/compiler.h b/runtime/vm/compiler.h
index 4ec478f..e278a57 100644
--- a/runtime/vm/compiler.h
+++ b/runtime/vm/compiler.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_COMPILER_H_
-#define VM_COMPILER_H_
+#ifndef RUNTIME_VM_COMPILER_H_
+#define RUNTIME_VM_COMPILER_H_
 
 #include "vm/allocation.h"
 #include "vm/growable_array.h"
@@ -27,6 +27,7 @@
 class Script;
 class SequenceNode;
 
+bool UseKernelFrontEndFor(ParsedFunction* parsed_function);
 
 class CompilationPipeline : public ZoneAllocated {
  public:
@@ -39,7 +40,7 @@
       const ZoneGrowableArray<const ICData*>& ic_data_array,
       intptr_t osr_id) = 0;
   virtual void FinalizeCompilation(FlowGraph* flow_graph) = 0;
-  virtual ~CompilationPipeline() { }
+  virtual ~CompilationPipeline() {}
 };
 
 
@@ -59,7 +60,7 @@
 
 class IrregexpCompilationPipeline : public CompilationPipeline {
  public:
-  IrregexpCompilationPipeline() : backtrack_goto_(NULL) { }
+  IrregexpCompilationPipeline() : backtrack_goto_(NULL) {}
 
   virtual void ParseFunction(ParsedFunction* parsed_function);
 
@@ -111,10 +112,9 @@
   // Returns Error::null() if there is no compilation error.
   // If 'result_code' is not NULL, then the generated code is returned but
   // not installed.
-  static RawError* CompileOptimizedFunction(
-      Thread* thread,
-      const Function& function,
-      intptr_t osr_id = kNoOSRDeoptId);
+  static RawError* CompileOptimizedFunction(Thread* thread,
+                                            const Function& function,
+                                            intptr_t osr_id = kNoOSRDeoptId);
 
   // Generates code for given parsed function (without parsing it again) and
   // sets its code field.
@@ -189,8 +189,8 @@
   virtual void Run();
 
   Isolate* isolate_;
-  bool running_;       // While true, will try to read queue and compile.
-  bool* done_;         // True if the thread is done.
+  bool running_;            // While true, will try to read queue and compile.
+  bool* done_;              // True if the thread is done.
   Monitor* queue_monitor_;  // Controls access to the queue.
   Monitor* done_monitor_;   // Notify/wait that the thread is done.
 
@@ -201,4 +201,4 @@
 
 }  // namespace dart
 
-#endif  // VM_COMPILER_H_
+#endif  // RUNTIME_VM_COMPILER_H_
diff --git a/runtime/vm/compiler_stats.cc b/runtime/vm/compiler_stats.cc
index 38afef2..6448c44 100644
--- a/runtime/vm/compiler_stats.cc
+++ b/runtime/vm/compiler_stats.cc
@@ -14,16 +14,16 @@
 namespace dart {
 
 DEFINE_FLAG(bool, compiler_stats, false, "Compiler stat counters.");
-DEFINE_FLAG(bool, compiler_benchmark, false,
+DEFINE_FLAG(bool,
+            compiler_benchmark,
+            false,
             "Compiler stat counters for benchmark.");
 
 
 class TokenStreamVisitor : public ObjectVisitor {
  public:
   explicit TokenStreamVisitor(CompilerStats* compiler_stats)
-      : obj_(Object::Handle()),
-        stats_(compiler_stats) {
-  }
+      : obj_(Object::Handle()), stats_(compiler_stats) {}
 
   void VisitObject(RawObject* raw_obj) {
     if (raw_obj->IsPseudoObject()) {
@@ -31,10 +31,9 @@
     }
     obj_ = raw_obj;
     if (obj_.GetClassId() == TokenStream::kClassId) {
-      TokenStream::Iterator tkit(Thread::Current()->zone(),
-                                 TokenStream::Cast(obj_),
-                                 TokenPosition::kMinSource,
-                                 TokenStream::Iterator::kNoNewlines);
+      TokenStream::Iterator tkit(
+          Thread::Current()->zone(), TokenStream::Cast(obj_),
+          TokenPosition::kMinSource, TokenStream::Iterator::kNoNewlines);
       Token::Kind kind = tkit.CurrentTokenKind();
       while (kind != Token::kEOS) {
         ++stats_->num_tokens_total;
@@ -52,16 +51,14 @@
 
 CompilerStats::CompilerStats(Isolate* isolate)
     : isolate_(isolate),
-#define INITIALIZE_TIMER(timer_name, description)                              \
-      timer_name(true, description),
-STAT_TIMERS(INITIALIZE_TIMER)
+#define INITIALIZE_TIMER(timer_name, description) timer_name(true, description),
+      STAT_TIMERS(INITIALIZE_TIMER)
 #undef INITIALIZE_TIMER
 
-#define INITIALIZE_COUNTERS(counter_name)                                      \
-      counter_name(0),
-STAT_COUNTERS(INITIALIZE_COUNTERS)
+#define INITIALIZE_COUNTERS(counter_name) counter_name(0),
+          STAT_COUNTERS(INITIALIZE_COUNTERS)
 #undef INITIALIZE_COUNTERS
-      text(NULL),
+              text(NULL),
       use_benchmark_output(false) {
 }
 
@@ -71,8 +68,7 @@
 
 // Used to aggregate stats. Must be atomic.
 void CompilerStats::Add(const CompilerStats& other) {
-#define ADD_TOTAL(timer_name, literal)                                         \
-  timer_name.AddTotal(other.timer_name);
+#define ADD_TOTAL(timer_name, literal) timer_name.AddTotal(other.timer_name);
 
   STAT_TIMERS(ADD_TOTAL)
 #undef ADD_TOTAL
@@ -86,14 +82,12 @@
 
 
 void CompilerStats::Clear() {
-#define CLEAR_TIMER(timer_name, literal)                                       \
-  timer_name.Reset();
+#define CLEAR_TIMER(timer_name, literal) timer_name.Reset();
 
   STAT_TIMERS(CLEAR_TIMER)
 #undef CLEAR_TIMER
 
-#define CLEAR_COUNTER(counter_name)                                            \
-  counter_name = 0;
+#define CLEAR_COUNTER(counter_name) counter_name = 0;
 
   STAT_COUNTERS(CLEAR_COUNTER)
 #undef CLEAR_COUNTER
@@ -191,8 +185,10 @@
 
   log.Print("CompilerSpeed: %" Pd64 " tokens/ms\n", compile_speed);
   log.Print("CodeSize: %" Pd64 " KB\n", total_code_size / 1024);
-  int64_t code_density = total_instr_size > 0 ?
-      (num_func_tokens_compiled * 1024) / total_instr_size : 0;
+  int64_t code_density =
+      total_instr_size > 0
+          ? (num_func_tokens_compiled * 1024) / total_instr_size
+          : 0;
 
   log.Print("CodeDensity: %" Pd64 " tokens/KB\n", code_density);
   log.Print("InstrSize: %" Pd64 " KB\n", total_instr_size / 1024);
@@ -221,8 +217,9 @@
   log.Print("Source length:           %" Pd64 " characters\n", src_length);
   log.Print("Number of source tokens: %" Pd64 "\n", num_tokens_scanned);
 
-  int64_t num_local_functions = GrowableObjectArray::Handle(
-      isolate_->object_store()->closure_functions()).Length();
+  int64_t num_local_functions =
+      GrowableObjectArray::Handle(isolate_->object_store()->closure_functions())
+          .Length();
 
   log.Print("==== Parser stats:\n");
   log.Print("Total tokens consumed:   %" Pd64 "\n", num_tokens_consumed);
@@ -246,8 +243,7 @@
   int64_t parse_speed =
       parse_usecs > 0 ? 1000 * num_tokens_consumed / parse_usecs : 0;
   log.Print("Parser time:             %" Pd64 " ms\n", parse_usecs / 1000);
-  log.Print("Parser speed:            %" Pd64 " tokens/ms\n",
-             parse_speed);
+  log.Print("Parser speed:            %" Pd64 " tokens/ms\n", parse_speed);
 
   int64_t codegen_usecs = codegen_timer.TotalElapsedTime();
 
@@ -292,20 +288,21 @@
 
   log.Print("==== Compiled code stats:\n");
   int64_t compile_usecs = scan_usecs + parse_usecs + codegen_usecs;
-  int64_t compile_speed = compile_usecs > 0 ?
-      (1000 * num_func_tokens_compiled / compile_usecs) : 0;
+  int64_t compile_speed =
+      compile_usecs > 0 ? (1000 * num_func_tokens_compiled / compile_usecs) : 0;
   log.Print("Functions parsed:        %" Pd64 "\n", num_functions_parsed);
   log.Print("Functions compiled:      %" Pd64 "\n", num_functions_compiled);
   log.Print("  optimized:             %" Pd64 "\n", num_functions_optimized);
   log.Print("Compiler time:           %" Pd64 " ms\n", compile_usecs / 1000);
   log.Print("Tokens compiled:         %" Pd64 "\n", num_func_tokens_compiled);
   log.Print("Compilation speed:       %" Pd64 " tokens/ms\n", compile_speed);
-  int64_t code_density = total_instr_size > 0 ?
-      (num_func_tokens_compiled * 1024) / total_instr_size : 0;
+  int64_t code_density =
+      total_instr_size > 0
+          ? (num_func_tokens_compiled * 1024) / total_instr_size
+          : 0;
   log.Print("Code density:            %" Pd64 " tokens per KB\n", code_density);
   log.Print("Code size:               %" Pd64 " KB\n", total_code_size / 1024);
-  log.Print("  Instr size:            %" Pd64 " KB\n",
-            total_instr_size / 1024);
+  log.Print("  Instr size:            %" Pd64 " KB\n", total_instr_size / 1024);
   log.Print("  Pc Desc size:          %" Pd64 " KB\n", pc_desc_size / 1024);
   log.Print("  VarDesc size:          %" Pd64 " KB\n", vardesc_size / 1024);
   log.Flush();
diff --git a/runtime/vm/compiler_stats.h b/runtime/vm/compiler_stats.h
index 98143a3..6575133 100644
--- a/runtime/vm/compiler_stats.h
+++ b/runtime/vm/compiler_stats.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_COMPILER_STATS_H_
-#define VM_COMPILER_STATS_H_
+#ifndef RUNTIME_VM_COMPILER_STATS_H_
+#define RUNTIME_VM_COMPILER_STATS_H_
 
 #include "vm/allocation.h"
 #include "vm/atomic.h"
@@ -32,7 +32,7 @@
   V(graphinliner_subst_timer, "inliner substitution timer")                    \
   V(graphoptimizer_timer, "flow graph optimizer timer")                        \
   V(graphcompiler_timer, "flow graph compiler timer")                          \
-  V(codefinalizer_timer, "code finalization timer")                            \
+  V(codefinalizer_timer, "code finalization timer")
 
 
 #define STAT_COUNTERS(V)                                                       \
@@ -54,23 +54,23 @@
   V(total_code_size)                                                           \
   V(total_instr_size)                                                          \
   V(pc_desc_size)                                                              \
-  V(vardesc_size)                                                              \
+  V(vardesc_size)
 
 class CompilerStats {
  public:
   explicit CompilerStats(Isolate* isolate);
-  ~CompilerStats() { }
+  ~CompilerStats() {}
 
   Isolate* isolate_;
 
   // We could use STAT_TIMERS and STAT_COUNTERS to declare fields, but then
   // we would be losing the comments.
-  Timer parser_timer;         // Cumulative runtime of parser.
-  Timer scanner_timer;        // Cumulative runtime of scanner.
-  Timer codegen_timer;        // Cumulative runtime of code generator.
-  Timer graphbuilder_timer;   // Included in codegen_timer.
-  Timer ssa_timer;            // Included in codegen_timer.
-  Timer graphinliner_timer;   // Included in codegen_timer.
+  Timer parser_timer;              // Cumulative runtime of parser.
+  Timer scanner_timer;             // Cumulative runtime of scanner.
+  Timer codegen_timer;             // Cumulative runtime of code generator.
+  Timer graphbuilder_timer;        // Included in codegen_timer.
+  Timer ssa_timer;                 // Included in codegen_timer.
+  Timer graphinliner_timer;        // Included in codegen_timer.
   Timer graphinliner_parse_timer;  // Included in codegen_timer.
   Timer graphinliner_build_timer;  // Included in codegen_timer.
   Timer graphinliner_ssa_timer;    // Included in codegen_timer.
@@ -81,7 +81,7 @@
   Timer graphcompiler_timer;   // Included in codegen_timer.
   Timer codefinalizer_timer;   // Included in codegen_timer.
 
-  int64_t num_tokens_total;    // Isolate + VM isolate
+  int64_t num_tokens_total;  // Isolate + VM isolate
   int64_t num_tokens_scanned;
   int64_t num_tokens_consumed;
   int64_t num_cached_consts;
@@ -90,16 +90,16 @@
 
   int64_t num_classes_parsed;
   int64_t num_class_tokens;
-  int64_t num_functions_parsed;      // Num parsed functions.
-  int64_t num_functions_compiled;    // Num unoptimized compilations.
-  int64_t num_functions_optimized;   // Num optimized compilations.
+  int64_t num_functions_parsed;     // Num parsed functions.
+  int64_t num_functions_compiled;   // Num unoptimized compilations.
+  int64_t num_functions_optimized;  // Num optimized compilations.
   int64_t num_func_tokens_compiled;
   int64_t num_implicit_final_getters;
   int64_t num_method_extractors;
 
-  int64_t src_length;          // Total number of characters in source.
-  int64_t total_code_size;     // Bytes allocated for code and meta info.
-  int64_t total_instr_size;    // Total size of generated code in bytes.
+  int64_t src_length;        // Total number of characters in source.
+  int64_t total_code_size;   // Bytes allocated for code and meta info.
+  int64_t total_instr_size;  // Total size of generated code in bytes.
   int64_t pc_desc_size;
   int64_t vardesc_size;
   char* text;
@@ -125,21 +125,23 @@
 // other thread.
 #define INC_STAT(thread, counter, incr)                                        \
   if (FLAG_support_compiler_stats && FLAG_compiler_stats) {                    \
-    AtomicOperations::IncrementInt64By(                                        \
-        &(thread)->compiler_stats()->counter, (incr));                         \
+    AtomicOperations::IncrementInt64By(&(thread)->compiler_stats()->counter,   \
+                                       (incr));                                \
   }
 
 #define STAT_VALUE(thread, counter)                                            \
-  ((FLAG_support_compiler_stats && FLAG_compiler_stats) ?                      \
-      (thread)->compiler_stats()->counter : 0)
+  ((FLAG_support_compiler_stats && FLAG_compiler_stats)                        \
+       ? (thread)->compiler_stats()->counter                                   \
+       : 0)
 
 #define CSTAT_TIMER_SCOPE(thr, t)                                              \
-  TimerScope timer(FLAG_support_compiler_stats && FLAG_compiler_stats,         \
-      (FLAG_support_compiler_stats && FLAG_compiler_stats) ?                   \
-      &((thr)->compiler_stats()->t) : NULL,                                    \
-      thr);
+  TimerScope timer(FLAG_support_compiler_stats&& FLAG_compiler_stats,          \
+                   (FLAG_support_compiler_stats && FLAG_compiler_stats)        \
+                       ? &((thr)->compiler_stats()->t)                         \
+                       : NULL,                                                 \
+                   thr);
 
 
 }  // namespace dart
 
-#endif  // VM_COMPILER_STATS_H_
+#endif  // RUNTIME_VM_COMPILER_STATS_H_
diff --git a/runtime/vm/compiler_test.cc b/runtime/vm/compiler_test.cc
index f2e138c..5225c53 100644
--- a/runtime/vm/compiler_test.cc
+++ b/runtime/vm/compiler_test.cc
@@ -22,9 +22,8 @@
       "}\n";
   String& url = String::Handle(String::New("dart-test:CompileScript"));
   String& source = String::Handle(String::New(kScriptChars));
-  Script& script = Script::Handle(Script::New(url,
-                                              source,
-                                              RawScript::kScriptTag));
+  Script& script =
+      Script::Handle(Script::New(url, source, RawScript::kScriptTag));
   Library& lib = Library::Handle(Library::CoreLibrary());
   EXPECT(CompilerTest::TestCompileScript(lib, script));
 }
@@ -32,22 +31,21 @@
 
 VM_TEST_CASE(CompileFunction) {
   const char* kScriptChars =
-            "class A {\n"
-            "  static foo() { return 42; }\n"
-            "  static moo() {\n"
-            "    // A.foo();\n"
-            "  }\n"
-            "}\n";
+      "class A {\n"
+      "  static foo() { return 42; }\n"
+      "  static moo() {\n"
+      "    // A.foo();\n"
+      "  }\n"
+      "}\n";
   String& url = String::Handle(String::New("dart-test:CompileFunction"));
   String& source = String::Handle(String::New(kScriptChars));
-  Script& script = Script::Handle(Script::New(url,
-                                              source,
-                                              RawScript::kScriptTag));
+  Script& script =
+      Script::Handle(Script::New(url, source, RawScript::kScriptTag));
   Library& lib = Library::Handle(Library::CoreLibrary());
   EXPECT(CompilerTest::TestCompileScript(lib, script));
   EXPECT(ClassFinalizer::ProcessPendingClasses());
-  Class& cls = Class::Handle(
-      lib.LookupClass(String::Handle(Symbols::New(thread, "A"))));
+  Class& cls =
+      Class::Handle(lib.LookupClass(String::Handle(Symbols::New(thread, "A"))));
   EXPECT(!cls.IsNull());
   String& function_foo_name = String::Handle(String::New("foo"));
   Function& function_foo =
@@ -74,20 +72,19 @@
 VM_TEST_CASE(CompileFunctionOnHelperThread) {
   // Create a simple function and compile it without optimization.
   const char* kScriptChars =
-            "class A {\n"
-            "  static foo() { return 42; }\n"
-            "}\n";
+      "class A {\n"
+      "  static foo() { return 42; }\n"
+      "}\n";
   String& url =
       String::Handle(String::New("dart-test:CompileFunctionOnHelperThread"));
   String& source = String::Handle(String::New(kScriptChars));
-  Script& script = Script::Handle(Script::New(url,
-                                              source,
-                                              RawScript::kScriptTag));
+  Script& script =
+      Script::Handle(Script::New(url, source, RawScript::kScriptTag));
   Library& lib = Library::Handle(Library::CoreLibrary());
   EXPECT(CompilerTest::TestCompileScript(lib, script));
   EXPECT(ClassFinalizer::ProcessPendingClasses());
-  Class& cls = Class::Handle(
-      lib.LookupClass(String::Handle(Symbols::New(thread, "A"))));
+  Class& cls =
+      Class::Handle(lib.LookupClass(String::Handle(Symbols::New(thread, "A"))));
   EXPECT(!cls.IsNull());
   String& function_foo_name = String::Handle(String::New("foo"));
   Function& func =
@@ -115,13 +112,13 @@
 
 TEST_CASE(RegenerateAllocStubs) {
   const char* kScriptChars =
-            "class A {\n"
-            "}\n"
-            "unOpt() => new A(); \n"
-            "optIt() => new A(); \n"
-            "A main() {\n"
-            "  return unOpt();\n"
-            "}\n";
+      "class A {\n"
+      "}\n"
+      "unOpt() => new A(); \n"
+      "optIt() => new A(); \n"
+      "A main() {\n"
+      "  return unOpt();\n"
+      "}\n";
 
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
   Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
@@ -133,8 +130,8 @@
   EXPECT(!cls.IsNull());
 
   Zone* zone = thread->zone();
-  const Code& stub = Code::Handle(zone,
-                                  StubCode::GetAllocationStubForClass(cls));
+  const Code& stub =
+      Code::Handle(zone, StubCode::GetAllocationStubForClass(cls));
   Class& owner = Class::Handle();
   owner ^= stub.owner();
   owner.DisableAllocationStub();
@@ -163,7 +160,7 @@
 
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
   Dart_Handle obj_handle =
-      Dart_Invoke(lib, Dart_NewStringFromCString("makeObj"), 0,  NULL);
+      Dart_Invoke(lib, Dart_NewStringFromCString("makeObj"), 0, NULL);
   EXPECT(!Dart_IsNull(obj_handle));
   EXPECT(!Dart_IsError(obj_handle));
   TransitionNativeToVM transition(thread);
@@ -175,10 +172,8 @@
   expr_text = String::New("apa + ' ${calc(10)}' + dot");
   Object& val = Object::Handle();
   const Class& receiver_cls = Class::Handle(obj.clazz());
-  val = Instance::Cast(obj).Evaluate(receiver_cls,
-                                     expr_text,
-                                     Array::empty_array(),
-                                     Array::empty_array());
+  val = Instance::Cast(obj).Evaluate(
+      receiver_cls, expr_text, Array::empty_array(), Array::empty_array());
   EXPECT(!val.IsNull());
   EXPECT(!val.IsError());
   EXPECT(val.IsString());
@@ -189,8 +184,8 @@
 VM_TEST_CASE(EvalExpressionWithLazyCompile) {
   Library& lib = Library::Handle(Library::CoreLibrary());
 
-  const String& expression = String::Handle(String::New(
-      "(){ return (){ return (){ return 3 + 4; }(); }(); }()"));
+  const String& expression = String::Handle(
+      String::New("(){ return (){ return (){ return 3 + 4; }(); }(); }()"));
   Object& val = Object::Handle();
   val = lib.Evaluate(expression, Array::empty_array(), Array::empty_array());
 
diff --git a/runtime/vm/constant_propagator.cc b/runtime/vm/constant_propagator.cc
index 1f5290d..9d2bc11 100644
--- a/runtime/vm/constant_propagator.cc
+++ b/runtime/vm/constant_propagator.cc
@@ -16,8 +16,10 @@
 namespace dart {
 
 DEFINE_FLAG(bool, remove_redundant_phis, true, "Remove redundant phis.");
-DEFINE_FLAG(bool, trace_constant_propagation, false,
-    "Print constant propagation and useless code elimination.");
+DEFINE_FLAG(bool,
+            trace_constant_propagation,
+            false,
+            "Print constant propagation and useless code elimination.");
 
 // Quick access to the current zone and isolate.
 #define I (isolate())
@@ -31,10 +33,8 @@
       graph_(graph),
       unknown_(Object::unknown_constant()),
       non_constant_(Object::non_constant()),
-      reachable_(new(Z) BitVector(
-          Z, graph->preorder().length())),
-      marked_phis_(new(Z) BitVector(
-          Z, graph->max_virtual_register_number())),
+      reachable_(new (Z) BitVector(Z, graph->preorder().length())),
+      marked_phis_(new (Z) BitVector(Z, graph->max_virtual_register_number())),
       block_worklist_(),
       definition_worklist_(graph, 10) {}
 
@@ -235,40 +235,40 @@
 // Analysis of non-definition instructions.  They do not have values so they
 // cannot have constant values.
 void ConstantPropagator::VisitCheckStackOverflow(
-    CheckStackOverflowInstr* instr) { }
+    CheckStackOverflowInstr* instr) {}
 
 
-void ConstantPropagator::VisitCheckClass(CheckClassInstr* instr) { }
+void ConstantPropagator::VisitCheckClass(CheckClassInstr* instr) {}
 
 
-void ConstantPropagator::VisitCheckClassId(CheckClassIdInstr* instr) { }
+void ConstantPropagator::VisitCheckClassId(CheckClassIdInstr* instr) {}
 
 
-void ConstantPropagator::VisitGuardFieldClass(GuardFieldClassInstr* instr) { }
+void ConstantPropagator::VisitGuardFieldClass(GuardFieldClassInstr* instr) {}
 
 
-void ConstantPropagator::VisitGuardFieldLength(GuardFieldLengthInstr* instr) { }
+void ConstantPropagator::VisitGuardFieldLength(GuardFieldLengthInstr* instr) {}
 
 
-void ConstantPropagator::VisitCheckSmi(CheckSmiInstr* instr) { }
+void ConstantPropagator::VisitCheckSmi(CheckSmiInstr* instr) {}
 
 
 void ConstantPropagator::VisitGenericCheckBound(GenericCheckBoundInstr* instr) {
 }
 
 
-void ConstantPropagator::VisitCheckEitherNonSmi(
-    CheckEitherNonSmiInstr* instr) { }
+void ConstantPropagator::VisitCheckEitherNonSmi(CheckEitherNonSmiInstr* instr) {
+}
 
 
-void ConstantPropagator::VisitCheckArrayBound(CheckArrayBoundInstr* instr) { }
+void ConstantPropagator::VisitCheckArrayBound(CheckArrayBoundInstr* instr) {}
 
 
 void ConstantPropagator::VisitDeoptimize(DeoptimizeInstr* instr) {
   // TODO(vegorov) remove all code after DeoptimizeInstr as dead.
 }
 
-void ConstantPropagator::VisitGrowRegExpStack(GrowRegExpStackInstr* instr) { }
+void ConstantPropagator::VisitGrowRegExpStack(GrowRegExpStackInstr* instr) {}
 
 Definition* ConstantPropagator::UnwrapPhi(Definition* defn) {
   if (defn->IsPhi()) {
@@ -309,8 +309,7 @@
   for (intptr_t pred_idx = 0; pred_idx < instr->InputCount(); ++pred_idx) {
     if (reachable_->Contains(
             block->PredecessorAt(pred_idx)->preorder_number())) {
-      Join(&value,
-           instr->InputAt(pred_idx)->definition()->constant_value());
+      Join(&value, instr->InputAt(pred_idx)->definition()->constant_value());
     }
   }
   if (!SetValue(instr, value) &&
@@ -326,8 +325,7 @@
   // are guaranteed to fold away code paths that correspond to non-matching
   // class ids. Otherwise LICM might potentially hoist incorrect code.
   const Object& value = instr->value()->definition()->constant_value();
-  if (IsConstant(value) &&
-      !Field::IsExternalizableCid(value.GetClassId())) {
+  if (IsConstant(value) && !Field::IsExternalizableCid(value.GetClassId())) {
     SetValue(instr, value);
   } else {
     SetValue(instr, non_constant_);
@@ -428,9 +426,8 @@
     ASSERT(!value.IsNull());
     ASSERT(value.IsBool());
     bool result = Bool::Cast(value).value();
-    SetValue(instr,
-             Smi::Handle(Z, Smi::New(
-                 result ? instr->if_true() : instr->if_false())));
+    SetValue(instr, Smi::Handle(Z, Smi::New(result ? instr->if_true()
+                                                   : instr->if_false())));
   }
 }
 
@@ -493,12 +490,18 @@
                             const Integer& right) {
   const int result = left.CompareWith(right);
   switch (kind) {
-    case Token::kEQ: return (result == 0);
-    case Token::kNE: return (result != 0);
-    case Token::kLT: return (result < 0);
-    case Token::kGT: return (result > 0);
-    case Token::kLTE: return (result <= 0);
-    case Token::kGTE: return (result >= 0);
+    case Token::kEQ:
+      return (result == 0);
+    case Token::kNE:
+      return (result != 0);
+    case Token::kLT:
+      return (result < 0);
+    case Token::kGT:
+      return (result > 0);
+    case Token::kLTE:
+      return (result <= 0);
+    case Token::kGTE:
+      return (result >= 0);
     default:
       UNREACHABLE();
       return false;
@@ -515,8 +518,8 @@
     SetValue(instr, non_constant_);
   } else if (IsConstant(left) && IsConstant(right)) {
     // BitOp does not work on Bigints.
-    if (left.IsInteger() && right.IsInteger() &&
-        !left.IsBigint() && !right.IsBigint()) {
+    if (left.IsInteger() && right.IsInteger() && !left.IsBigint() &&
+        !right.IsBigint()) {
       const bool result = CompareIntegers(
           instr->kind(),
           Integer::Handle(Z, Integer::Cast(left).BitOp(Token::kBIT_AND,
@@ -563,8 +566,7 @@
     SetValue(instr, non_constant_);
   } else if (IsConstant(left) && IsConstant(right)) {
     if (left.IsInteger() && right.IsInteger()) {
-      const bool result = CompareIntegers(instr->kind(),
-                                          Integer::Cast(left),
+      const bool result = CompareIntegers(instr->kind(), Integer::Cast(left),
                                           Integer::Cast(right));
       SetValue(instr, Bool::Get(result));
     } else if (left.IsString() && right.IsString()) {
@@ -584,8 +586,7 @@
     SetValue(instr, non_constant_);
   } else if (IsConstant(left) && IsConstant(right)) {
     if (left.IsInteger() && right.IsInteger()) {
-      const bool result = CompareIntegers(instr->kind(),
-                                          Integer::Cast(left),
+      const bool result = CompareIntegers(instr->kind(), Integer::Cast(left),
                                           Integer::Cast(right));
       SetValue(instr, Bool::Get(result));
     } else if (left.IsDouble() && right.IsDouble()) {
@@ -661,8 +662,9 @@
       if (array_obj.IsString()) {
         const String& str = String::Cast(array_obj);
         if (str.Length() > index) {
-          SetValue(instr, Smi::Handle(Z,
-              Smi::New(static_cast<intptr_t>(str.CharAt(index)))));
+          SetValue(instr,
+                   Smi::Handle(
+                       Z, Smi::New(static_cast<intptr_t>(str.CharAt(index)))));
           return;
         }
       } else if (array_obj.IsArray()) {
@@ -764,13 +766,12 @@
       if (instr->instantiator_type_arguments()->BindsToConstantNull()) {
         const TypeArguments& checked_type_arguments = TypeArguments::Handle();
         Error& bound_error = Error::Handle();
-        bool is_instance = instance.IsInstanceOf(checked_type,
-                                                 checked_type_arguments,
-                                                 &bound_error);
+        bool is_instance = instance.IsInstanceOf(
+            checked_type, checked_type_arguments, &bound_error);
         // Can only have bound error with generics.
         ASSERT(bound_error.IsNull());
-        SetValue(instr, Bool::Get(instr->negate_result()
-                                  ? !is_instance : is_instance));
+        SetValue(instr, Bool::Get(instr->negate_result() ? !is_instance
+                                                         : is_instance));
         return;
       }
     }
@@ -817,8 +818,10 @@
   Value* instance = instr->instance();
   if ((instr->recognized_kind() == MethodRecognizer::kObjectArrayLength) &&
       instance->definition()->OriginalDefinition()->IsCreateArray()) {
-    Value* num_elements = instance->definition()->OriginalDefinition()
-        ->AsCreateArray()->num_elements();
+    Value* num_elements = instance->definition()
+                              ->OriginalDefinition()
+                              ->AsCreateArray()
+                              ->num_elements();
     if (num_elements->BindsToConstant() &&
         num_elements->BoundConstant().IsSmi()) {
       intptr_t length = Smi::Cast(num_elements->BoundConstant()).Value();
@@ -833,18 +836,21 @@
         instance->definition()->OriginalDefinition()->AsConstant();
     if (constant != NULL) {
       if (constant->value().IsString()) {
-        SetValue(instr, Smi::ZoneHandle(Z,
-            Smi::New(String::Cast(constant->value()).Length())));
+        SetValue(instr,
+                 Smi::ZoneHandle(
+                     Z, Smi::New(String::Cast(constant->value()).Length())));
         return;
       }
       if (constant->value().IsArray()) {
-        SetValue(instr, Smi::ZoneHandle(Z,
-            Smi::New(Array::Cast(constant->value()).Length())));
+        SetValue(instr,
+                 Smi::ZoneHandle(
+                     Z, Smi::New(Array::Cast(constant->value()).Length())));
         return;
       }
       if (constant->value().IsTypedData()) {
-        SetValue(instr, Smi::ZoneHandle(Z,
-            Smi::New(TypedData::Cast(constant->value()).Length())));
+        SetValue(instr,
+                 Smi::ZoneHandle(
+                     Z, Smi::New(TypedData::Cast(constant->value()).Length())));
         return;
       }
     }
@@ -854,8 +860,7 @@
 
 
 void ConstantPropagator::VisitInstantiateType(InstantiateTypeInstr* instr) {
-  const Object& object =
-      instr->instantiator()->definition()->constant_value();
+  const Object& object = instr->instantiator()->definition()->constant_value();
   if (IsNonConstant(object)) {
     SetValue(instr, non_constant_);
     return;
@@ -876,16 +881,14 @@
 
 void ConstantPropagator::VisitInstantiateTypeArguments(
     InstantiateTypeArgumentsInstr* instr) {
-  const Object& object =
-      instr->instantiator()->definition()->constant_value();
+  const Object& object = instr->instantiator()->definition()->constant_value();
   if (IsNonConstant(object)) {
     SetValue(instr, non_constant_);
     return;
   }
   if (IsConstant(object)) {
     const intptr_t len = instr->type_arguments().Length();
-    if (instr->type_arguments().IsRawInstantiatedRaw(len) &&
-        object.IsNull()) {
+    if (instr->type_arguments().IsRawInstantiatedRaw(len) && object.IsNull()) {
       SetValue(instr, object);
       return;
     }
@@ -941,6 +944,12 @@
 }
 
 
+void ConstantPropagator::VisitCheckedSmiComparison(
+    CheckedSmiComparisonInstr* instr) {
+  SetValue(instr, non_constant_);
+}
+
+
 void ConstantPropagator::VisitBinarySmiOp(BinarySmiOpInstr* instr) {
   VisitBinaryIntegerOp(instr);
 }
@@ -987,8 +996,7 @@
   const Object& value = unary_op->value()->definition()->constant_value();
   if (IsConstant(value) && value.IsInteger()) {
     const Integer& value_int = Integer::Cast(value);
-    const Integer& result =
-        Integer::Handle(Z, unary_op->Evaluate(value_int));
+    const Integer& result = Integer::Handle(Z, unary_op->Evaluate(value_int));
     if (!result.IsNull()) {
       SetValue(unary_op, Integer::ZoneHandle(Z, result.raw()));
       return;
@@ -1023,8 +1031,9 @@
 void ConstantPropagator::VisitSmiToDouble(SmiToDoubleInstr* instr) {
   const Object& value = instr->value()->definition()->constant_value();
   if (IsConstant(value) && value.IsInteger()) {
-    SetValue(instr, Double::Handle(Z,
-        Double::New(Integer::Cast(value).AsDoubleValue(), Heap::kOld)));
+    SetValue(instr,
+             Double::Handle(Z, Double::New(Integer::Cast(value).AsDoubleValue(),
+                                           Heap::kOld)));
   } else if (!IsUnknown(value)) {
     SetValue(instr, non_constant_);
   }
@@ -1034,8 +1043,9 @@
 void ConstantPropagator::VisitMintToDouble(MintToDoubleInstr* instr) {
   const Object& value = instr->value()->definition()->constant_value();
   if (IsConstant(value) && value.IsInteger()) {
-    SetValue(instr, Double::Handle(Z,
-        Double::New(Integer::Cast(value).AsDoubleValue(), Heap::kOld)));
+    SetValue(instr,
+             Double::Handle(Z, Double::New(Integer::Cast(value).AsDoubleValue(),
+                                           Heap::kOld)));
   } else if (!IsUnknown(value)) {
     SetValue(instr, non_constant_);
   }
@@ -1045,8 +1055,9 @@
 void ConstantPropagator::VisitInt32ToDouble(Int32ToDoubleInstr* instr) {
   const Object& value = instr->value()->definition()->constant_value();
   if (IsConstant(value) && value.IsInteger()) {
-    SetValue(instr, Double::Handle(Z,
-        Double::New(Integer::Cast(value).AsDoubleValue(), Heap::kOld)));
+    SetValue(instr,
+             Double::Handle(Z, Double::New(Integer::Cast(value).AsDoubleValue(),
+                                           Heap::kOld)));
   } else if (!IsUnknown(value)) {
     SetValue(instr, non_constant_);
   }
@@ -1134,8 +1145,7 @@
 }
 
 
-void ConstantPropagator::VisitBinaryDoubleOp(
-    BinaryDoubleOpInstr* instr) {
+void ConstantPropagator::VisitBinaryDoubleOp(BinaryDoubleOpInstr* instr) {
   const Object& left = instr->left()->definition()->constant_value();
   const Object& right = instr->right()->definition()->constant_value();
   if (IsNonConstant(left) || IsNonConstant(right)) {
@@ -1168,8 +1178,33 @@
 }
 
 
-void ConstantPropagator::VisitBinaryFloat32x4Op(
-    BinaryFloat32x4OpInstr* instr) {
+void ConstantPropagator::VisitDoubleTestOp(DoubleTestOpInstr* instr) {
+  const Object& value = instr->value()->definition()->constant_value();
+  const bool is_negated = instr->kind() != Token::kEQ;
+  if (value.IsInteger()) {
+    SetValue(instr, is_negated ? Bool::True() : Bool::False());
+  } else if (IsIntegerOrDouble(value)) {
+    switch (instr->op_kind()) {
+      case MethodRecognizer::kDouble_getIsNaN: {
+        const bool is_nan = isnan(ToDouble(value));
+        SetValue(instr, Bool::Get(is_negated ? !is_nan : is_nan));
+        break;
+      }
+      case MethodRecognizer::kDouble_getIsInfinite: {
+        const bool is_inf = isinf(ToDouble(value));
+        SetValue(instr, Bool::Get(is_negated ? !is_inf : is_inf));
+        break;
+      }
+      default:
+        UNREACHABLE();
+    }
+  } else {
+    SetValue(instr, non_constant_);
+  }
+}
+
+
+void ConstantPropagator::VisitBinaryFloat32x4Op(BinaryFloat32x4OpInstr* instr) {
   const Object& left = instr->left()->definition()->constant_value();
   const Object& right = instr->right()->definition()->constant_value();
   if (IsNonConstant(left) || IsNonConstant(right)) {
@@ -1316,14 +1351,12 @@
 }
 
 
-void ConstantPropagator::VisitFloat64x2Zero(
-    Float64x2ZeroInstr* instr) {
+void ConstantPropagator::VisitFloat64x2Zero(Float64x2ZeroInstr* instr) {
   SetValue(instr, non_constant_);
 }
 
 
-void ConstantPropagator::VisitFloat64x2Splat(
-    Float64x2SplatInstr* instr) {
+void ConstantPropagator::VisitFloat64x2Splat(Float64x2SplatInstr* instr) {
   SetValue(instr, non_constant_);
 }
 
@@ -1370,7 +1403,7 @@
 
 
 void ConstantPropagator::VisitCaseInsensitiveCompareUC16(
-    CaseInsensitiveCompareUC16Instr *instr) {
+    CaseInsensitiveCompareUC16Instr* instr) {
   SetValue(instr, non_constant_);
 }
 
@@ -1457,17 +1490,16 @@
 
 static bool IsEmptyBlock(BlockEntryInstr* block) {
   return block->next()->IsGoto() &&
-      (!block->IsJoinEntry() || (block->AsJoinEntry()->phis() == NULL)) &&
-      !block->IsIndirectEntry();
+         (!block->IsJoinEntry() || (block->AsJoinEntry()->phis() == NULL)) &&
+         !block->IsIndirectEntry();
 }
 
 
 // Traverses a chain of empty blocks and returns the first reachable non-empty
 // block that is not dominated by the start block. The empty blocks are added
 // to the supplied bit vector.
-static BlockEntryInstr* FindFirstNonEmptySuccessor(
-    TargetEntryInstr* block,
-    BitVector* empty_blocks) {
+static BlockEntryInstr* FindFirstNonEmptySuccessor(TargetEntryInstr* block,
+                                                   BitVector* empty_blocks) {
   BlockEntryInstr* current = block;
   while (IsEmptyBlock(current) && block->Dominates(current)) {
     ASSERT(!block->IsJoinEntry() || (block->AsJoinEntry()->phis() == NULL));
@@ -1482,11 +1514,8 @@
   // Canonicalize branches that have no side-effects and where true- and
   // false-targets are the same.
   bool changed = false;
-  BitVector* empty_blocks = new(Z) BitVector(Z,
-      graph_->preorder().length());
-  for (BlockIterator b = graph_->postorder_iterator();
-       !b.Done();
-       b.Advance()) {
+  BitVector* empty_blocks = new (Z) BitVector(Z, graph_->preorder().length());
+  for (BlockIterator b = graph_->postorder_iterator(); !b.Done(); b.Advance()) {
     BlockEntryInstr* block = b.Current();
     BranchInstr* branch = block->last_instruction()->AsBranch();
     empty_blocks->Clear();
@@ -1501,7 +1530,7 @@
         // Drop the comparison, which does not have side effects
         JoinEntryInstr* join = if_true->AsJoinEntry();
         if (join->phis() == NULL) {
-          GotoInstr* jump = new(Z) GotoInstr(if_true->AsJoinEntry());
+          GotoInstr* jump = new (Z) GotoInstr(if_true->AsJoinEntry());
           jump->InheritDeoptTarget(Z, branch);
 
           Instruction* previous = branch->previous();
@@ -1547,8 +1576,7 @@
   // instructions, previous pointers, predecessors, etc. after eliminating
   // unreachable code.  We do not maintain those properties during the
   // transformation.
-  for (BlockIterator b = graph_->reverse_postorder_iterator();
-       !b.Done();
+  for (BlockIterator b = graph_->reverse_postorder_iterator(); !b.Done();
        b.Advance()) {
     BlockEntryInstr* block = b.Current();
     if (!reachable_->Contains(block->preorder_number())) {
@@ -1617,18 +1645,14 @@
       // Replace constant-valued instructions without observable side
       // effects.  Do this for smis only to avoid having to copy other
       // objects into the heap's old generation.
-      if ((defn != NULL) &&
-          IsConstant(defn->constant_value()) &&
+      if ((defn != NULL) && IsConstant(defn->constant_value()) &&
           (defn->constant_value().IsSmi() || defn->constant_value().IsOld()) &&
-          !defn->IsConstant() &&
-          !defn->IsPushArgument() &&
-          !defn->IsStoreIndexed() &&
-          !defn->IsStoreInstanceField() &&
+          !defn->IsConstant() && !defn->IsPushArgument() &&
+          !defn->IsStoreIndexed() && !defn->IsStoreInstanceField() &&
           !defn->IsStoreStaticField()) {
         if (FLAG_trace_constant_propagation &&
             FlowGraphPrinter::ShouldPrint(graph_->function())) {
-          THR_Print("Constant v%" Pd " = %s\n",
-                    defn->ssa_temp_index(),
+          THR_Print("Constant v%" Pd " = %s\n", defn->ssa_temp_index(),
                     defn->constant_value().ToCString());
         }
         ConstantInstr* constant = graph_->GetConstant(defn->constant_value());
@@ -1649,16 +1673,16 @@
         ASSERT(reachable_->Contains(if_false->preorder_number()));
         ASSERT(if_false->parallel_move() == NULL);
         ASSERT(if_false->loop_info() == NULL);
-        join = new(Z) JoinEntryInstr(if_false->block_id(),
-                                     if_false->try_index());
+        join =
+            new (Z) JoinEntryInstr(if_false->block_id(), if_false->try_index());
         join->InheritDeoptTarget(Z, if_false);
         if_false->UnuseAllInputs();
         next = if_false->next();
       } else if (!reachable_->Contains(if_false->preorder_number())) {
         ASSERT(if_true->parallel_move() == NULL);
         ASSERT(if_true->loop_info() == NULL);
-        join = new(Z) JoinEntryInstr(if_true->block_id(),
-                                     if_true->try_index());
+        join =
+            new (Z) JoinEntryInstr(if_true->block_id(), if_true->try_index());
         join->InheritDeoptTarget(Z, if_true);
         if_true->UnuseAllInputs();
         next = if_true->next();
@@ -1669,7 +1693,7 @@
         // Drop the comparison, which does not have side effects as long
         // as it is a strict compare (the only one we can determine is
         // constant with the current analysis).
-        GotoInstr* jump = new(Z) GotoInstr(join);
+        GotoInstr* jump = new (Z) GotoInstr(join);
         jump->InheritDeoptTarget(Z, branch);
 
         Instruction* previous = branch->previous();
diff --git a/runtime/vm/constant_propagator.h b/runtime/vm/constant_propagator.h
index 024cbef..23f5fe9 100644
--- a/runtime/vm/constant_propagator.h
+++ b/runtime/vm/constant_propagator.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_CONSTANT_PROPAGATOR_H_
-#define VM_CONSTANT_PROPAGATOR_H_
+#ifndef RUNTIME_VM_CONSTANT_PROPAGATOR_H_
+#define RUNTIME_VM_CONSTANT_PROPAGATOR_H_
 
 #include "vm/intermediate_language.h"
 #include "vm/flow_graph.h"
@@ -49,9 +49,7 @@
   // first one.
   void Join(Object* left, const Object& right);
 
-  bool IsUnknown(const Object& value) {
-    return value.raw() == unknown_.raw();
-  }
+  bool IsUnknown(const Object& value) { return value.raw() == unknown_.raw(); }
   bool IsNonConstant(const Object& value) {
     return value.raw() == non_constant_.raw();
   }
@@ -90,4 +88,4 @@
 
 }  // namespace dart
 
-#endif  // VM_CONSTANT_PROPAGATOR_H_
+#endif  // RUNTIME_VM_CONSTANT_PROPAGATOR_H_
diff --git a/runtime/vm/constants_arm.h b/runtime/vm/constants_arm.h
index f544a77..c4213ad 100644
--- a/runtime/vm/constants_arm.h
+++ b/runtime/vm/constants_arm.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_CONSTANTS_ARM_H_
-#define VM_CONSTANTS_ARM_H_
+#ifndef RUNTIME_VM_CONSTANTS_ARM_H_
+#define RUNTIME_VM_CONSTANTS_ARM_H_
 
 #include "platform/globals.h"
 #include "platform/assert.h"
@@ -61,16 +61,16 @@
 
 
 enum Register {
-  R0  =  0,
-  R1  =  1,
-  R2  =  2,
-  R3  =  3,
-  R4  =  4,
-  R5  =  5,  // PP
-  R6  =  6,  // CTX
-  R7  =  7,  // iOS FP
-  R8  =  8,
-  R9  =  9,
+  R0 = 0,
+  R1 = 1,
+  R2 = 2,
+  R3 = 3,
+  R4 = 4,
+  R5 = 5,  // PP
+  R6 = 6,  // CTX
+  R7 = 7,  // iOS FP
+  R8 = 8,
+  R9 = 9,
   R10 = 10,  // THR
   R11 = 11,  // Linux FP
   R12 = 12,  // IP aka TMP
@@ -80,36 +80,36 @@
   kNumberOfCpuRegisters = 16,
   kNoRegister = -1,  // Signals an illegal register.
 
-  // Aliases.
+// Aliases.
 #if defined(TARGET_ABI_IOS)
-  FP   = R7,
+  FP = R7,
   NOTFP = R11,
 #elif defined(TARGET_ABI_EABI)
-  FP   = R11,
+  FP = R11,
   NOTFP = R7,
 #else
 #error Unknown ABI
 #endif
-  IP  = R12,
-  SP  = R13,
-  LR  = R14,
-  PC  = R15,
+  IP = R12,
+  SP = R13,
+  LR = R14,
+  PC = R15,
 };
 
 
 // Values for single-precision floating point registers.
 enum SRegister {
   kNoSRegister = -1,
-  S0  =  0,
-  S1  =  1,
-  S2  =  2,
-  S3  =  3,
-  S4  =  4,
-  S5  =  5,
-  S6  =  6,
-  S7  =  7,
-  S8  =  8,
-  S9  =  9,
+  S0 = 0,
+  S1 = 1,
+  S2 = 2,
+  S3 = 3,
+  S4 = 4,
+  S5 = 5,
+  S6 = 6,
+  S7 = 7,
+  S8 = 8,
+  S9 = 9,
   S10 = 10,
   S11 = 11,
   S12 = 12,
@@ -139,16 +139,16 @@
 // Values for double-precision floating point registers.
 enum DRegister {
   kNoDRegister = -1,
-  D0  =  0,
-  D1  =  1,
-  D2  =  2,
-  D3  =  3,
-  D4  =  4,
-  D5  =  5,
-  D6  =  6,
-  D7  =  7,
-  D8  =  8,
-  D9  =  9,
+  D0 = 0,
+  D1 = 1,
+  D2 = 2,
+  D3 = 3,
+  D4 = 4,
+  D5 = 5,
+  D6 = 6,
+  D7 = 7,
+  D8 = 8,
+  D9 = 9,
   D10 = 10,
   D11 = 11,
   D12 = 12,
@@ -201,18 +201,18 @@
 
 enum QRegister {
   kNoQRegister = -1,
-  Q0  =  0,
-  Q1  =  1,
-  Q2  =  2,
-  Q3  =  3,
-  Q4  =  4,
-  Q5  =  5,
-  Q6  =  6,
-  Q7  =  7,
+  Q0 = 0,
+  Q1 = 1,
+  Q2 = 2,
+  Q3 = 3,
+  Q4 = 4,
+  Q5 = 5,
+  Q6 = 6,
+  Q7 = 7,
 #if defined(VFPv3_D16)
   kNumberOfQRegisters = 8,
-  Q8  = kNoQRegister,
-  Q9  = kNoQRegister,
+  Q8 = kNoQRegister,
+  Q9 = kNoQRegister,
   Q10 = kNoQRegister,
   Q11 = kNoQRegister,
   Q12 = kNoQRegister,
@@ -220,8 +220,8 @@
   Q14 = kNoQRegister,
   Q15 = kNoQRegister,
 #else
-  Q8  =  8,
-  Q9  =  9,
+  Q8 = 8,
+  Q9 = 9,
   Q10 = 10,
   Q11 = 11,
   Q12 = 12,
@@ -260,7 +260,7 @@
 
 
 // Register aliases for floating point scratch registers.
-const QRegister QTMP = Q7;  // Overlaps with DTMP, STMP.
+const QRegister QTMP = Q7;                     // Overlaps with DTMP, STMP.
 const DRegister DTMP = EvenDRegisterOf(QTMP);  // Overlaps with STMP.
 const SRegister STMP = EvenSRegisterOf(DTMP);
 
@@ -272,10 +272,10 @@
 const FpuRegister kNoFpuRegister = kNoQRegister;
 
 // Register aliases.
-const Register TMP = IP;  // Used as scratch register by assembler.
+const Register TMP = IP;            // Used as scratch register by assembler.
 const Register TMP2 = kNoRegister;  // There is no second assembler temporary.
-const Register CTX = R6;  // Location of current context at method entry.
-const Register PP = R5;  // Caches object pool pointer in generated code.
+const Register CTX = R6;    // Location of current context at method entry.
+const Register PP = R5;     // Caches object pool pointer in generated code.
 const Register SPREG = SP;  // Stack pointer register.
 const Register FPREG = FP;  // Frame pointer register.
 const Register LRREG = LR;  // Link register.
@@ -307,13 +307,12 @@
     (1 << R0) | (1 << R1) | (1 << R2) | (1 << R3);
 #if defined(TARGET_ABI_IOS)
 const RegList kAbiPreservedCpuRegs =
-    (1 << R4)  | (1 << R5) | (1 << R6) | (1 << R8) |
-    (1 << R10) | (1 << R11);
+    (1 << R4) | (1 << R5) | (1 << R6) | (1 << R8) | (1 << R10) | (1 << R11);
 const int kAbiPreservedCpuRegCount = 6;
 #elif defined(TARGET_ABI_EABI)
-const RegList kAbiPreservedCpuRegs =
-    (1 << R4) | (1 << R5) | (1 << R6) | (1 << R7) |
-    (1 << R8) | (1 << R9) | (1 << R10);
+const RegList kAbiPreservedCpuRegs = (1 << R4) | (1 << R5) | (1 << R6) |
+                                     (1 << R7) | (1 << R8) | (1 << R9) |
+                                     (1 << R10);
 const int kAbiPreservedCpuRegCount = 7;
 #else
 #error Unknown ABI
@@ -322,13 +321,8 @@
 const QRegister kAbiLastPreservedFpuReg = Q7;
 const int kAbiPreservedFpuRegCount = 4;
 
-const RegList kReservedCpuRegisters =
-    (1 << SPREG) |
-    (1 << FPREG) |
-    (1 << TMP)   |
-    (1 << PP)    |
-    (1 << THR)   |
-    (1 << PC);
+const RegList kReservedCpuRegisters = (1 << SPREG) | (1 << FPREG) | (1 << TMP) |
+                                      (1 << PP) | (1 << THR) | (1 << PC);
 // CPU registers available to Dart allocator.
 const RegList kDartAvailableCpuRegs =
     kAllCpuRegistersList & ~kReservedCpuRegisters;
@@ -348,21 +342,21 @@
 // Values for the condition field as defined in section A3.2.
 enum Condition {
   kNoCondition = -1,
-  EQ =  0,  // equal
-  NE =  1,  // not equal
-  CS =  2,  // carry set/unsigned higher or same
-  CC =  3,  // carry clear/unsigned lower
-  MI =  4,  // minus/negative
-  PL =  5,  // plus/positive or zero
-  VS =  6,  // overflow
-  VC =  7,  // no overflow
-  HI =  8,  // unsigned higher
-  LS =  9,  // unsigned lower or same
-  GE = 10,  // signed greater than or equal
-  LT = 11,  // signed less than
-  GT = 12,  // signed greater than
-  LE = 13,  // signed less than or equal
-  AL = 14,  // always (unconditional)
+  EQ = 0,                  // equal
+  NE = 1,                  // not equal
+  CS = 2,                  // carry set/unsigned higher or same
+  CC = 3,                  // carry clear/unsigned lower
+  MI = 4,                  // minus/negative
+  PL = 5,                  // plus/positive or zero
+  VS = 6,                  // overflow
+  VC = 7,                  // no overflow
+  HI = 8,                  // unsigned higher
+  LS = 9,                  // unsigned lower or same
+  GE = 10,                 // signed greater than or equal
+  LT = 11,                 // signed less than
+  GT = 12,                 // signed greater than
+  LE = 13,                 // signed less than or equal
+  AL = 14,                 // always (unconditional)
   kSpecialCondition = 15,  // special condition (refer to section A3.2.1)
   kMaxCondition = 16,
 };
@@ -372,16 +366,16 @@
 // as defined in section A3.4
 enum Opcode {
   kNoOperand = -1,
-  AND =  0,  // Logical AND
-  EOR =  1,  // Logical Exclusive OR
-  SUB =  2,  // Subtract
-  RSB =  3,  // Reverse Subtract
-  ADD =  4,  // Add
-  ADC =  5,  // Add with Carry
-  SBC =  6,  // Subtract with Carry
-  RSC =  7,  // Reverse Subtract with Carry
-  TST =  8,  // Test
-  TEQ =  9,  // Test Equivalence
+  AND = 0,   // Logical AND
+  EOR = 1,   // Logical Exclusive OR
+  SUB = 2,   // Subtract
+  RSB = 3,   // Reverse Subtract
+  ADD = 4,   // Add
+  ADC = 5,   // Add with Carry
+  SBC = 6,   // Subtract with Carry
+  RSC = 7,   // Reverse Subtract with Carry
+  TST = 8,   // Test
+  TEQ = 9,   // Test Equivalence
   CMP = 10,  // Compare
   CMN = 11,  // Compare Negated
   ORR = 12,  // Logical (inclusive) OR
@@ -495,17 +489,13 @@
 //
 class Instr {
  public:
-  enum {
-    kInstrSize = 4,
-    kInstrSizeLog2 = 2,
-    kPCReadOffset = 8
-  };
+  enum { kInstrSize = 4, kInstrSizeLog2 = 2, kPCReadOffset = 8 };
 
   static const int32_t kNopInstruction =  // nop
       ((AL << kConditionShift) | (0x32 << 20) | (0xf << 12));
 
-  static const int32_t kBreakPointCode = 0xdeb0;  // For breakpoint.
-  static const int32_t kStopMessageCode = 0xdeb1;  // For Stop(message).
+  static const int32_t kBreakPointCode = 0xdeb0;      // For breakpoint.
+  static const int32_t kStopMessageCode = 0xdeb1;     // For Stop(message).
   static const int32_t kSimulatorBreakCode = 0xdeb2;  // For breakpoint in sim.
   static const int32_t kSimulatorRedirectCode = 0xca11;  // For redirection.
 
@@ -535,9 +525,7 @@
   }
 
   // Read one particular bit out of the instruction bits.
-  inline int Bit(int nr) const {
-    return (InstructionBits() >> nr) & 1;
-  }
+  inline int Bit(int nr) const { return (InstructionBits() >> nr) & 1; }
 
   // Read a bit field out of the instruction bits.
   inline int Bits(int shift, int count) const {
@@ -553,10 +541,12 @@
   }
   inline int TypeField() const { return Bits(kTypeShift, kTypeBits); }
 
-  inline Register RnField() const { return static_cast<Register>(
-                                        Bits(kRnShift, kRnBits)); }
-  inline Register RdField() const { return static_cast<Register>(
-                                        Bits(kRdShift, kRdBits)); }
+  inline Register RnField() const {
+    return static_cast<Register>(Bits(kRnShift, kRnBits));
+  }
+  inline Register RdField() const {
+    return static_cast<Register>(Bits(kRdShift, kRdBits));
+  }
 
   // Fields used in Data processing instructions
   inline Opcode OpcodeField() const {
@@ -567,27 +557,30 @@
   inline Register RmField() const {
     return static_cast<Register>(Bits(kRmShift, kRmBits));
   }
-  inline Shift ShiftField() const { return static_cast<Shift>(
-                                        Bits(kShiftShift, kShiftBits)); }
+  inline Shift ShiftField() const {
+    return static_cast<Shift>(Bits(kShiftShift, kShiftBits));
+  }
   inline int RegShiftField() const { return Bit(4); }
   inline Register RsField() const {
     return static_cast<Register>(Bits(kRsShift, kRsBits));
   }
-  inline int ShiftAmountField() const { return Bits(kShiftImmShift,
-                                                    kShiftImmBits); }
+  inline int ShiftAmountField() const {
+    return Bits(kShiftImmShift, kShiftImmBits);
+  }
   // with immediate
   inline int RotateField() const { return Bits(kRotateShift, kRotateBits); }
   inline int Immed8Field() const { return Bits(kImmed8Shift, kImmed8Bits); }
 
   // Fields used in Load/Store instructions
   inline int PUField() const { return Bits(23, 2); }
-  inline int  BField() const { return Bit(22); }
-  inline int  WField() const { return Bit(21); }
-  inline int  LField() const { return Bit(20); }
+  inline int BField() const { return Bit(22); }
+  inline int WField() const { return Bit(21); }
+  inline int LField() const { return Bit(20); }
   // with register uses same fields as Data processing instructions above
   // with immediate
-  inline int Offset12Field() const { return Bits(kOffset12Shift,
-                                                 kOffset12Bits); }
+  inline int Offset12Field() const {
+    return Bits(kOffset12Shift, kOffset12Bits);
+  }
   // multiple
   inline int RlistField() const { return Bits(0, 16); }
   // extra loads and stores
@@ -622,8 +615,8 @@
 
   // Field used in VFP double immediate move instruction
   inline double ImmDoubleField() const {
-    uint64_t imm64 = (Bit(19)*(1LL << 63)) | (((1LL << 8) - Bit(18)) << 54) |
-                     (Bits(16, 2)*(1LL << 52)) | (Bits(0, 4)*(1LL << 48));
+    uint64_t imm64 = (Bit(19) * (1LL << 63)) | (((1LL << 8) - Bit(18)) << 54) |
+                     (Bits(16, 2) * (1LL << 52)) | (Bits(0, 4) * (1LL << 48));
     return bit_cast<double, uint64_t>(imm64);
   }
 
@@ -644,9 +637,9 @@
     ASSERT(ConditionField() != kSpecialCondition);
     ASSERT(Bits(26, 2) == 0);  // Type 0 or 1.
     return ((Bits(20, 5) & 0x19) != 0x10) &&
-      ((Bit(25) == 1) ||  // Data processing immediate.
-       (Bit(4) == 0) ||  // Data processing register.
-       (Bit(7) == 0));  // Data processing register-shifted register.
+           ((Bit(25) == 1) ||  // Data processing immediate.
+            (Bit(4) == 0) ||   // Data processing register.
+            (Bit(7) == 0));    // Data processing register-shifted register.
   }
 
   // Tests for special encodings of type 0 instructions (extra loads and stores,
@@ -706,8 +699,8 @@
   inline bool IsDivision() const {
     ASSERT(ConditionField() != kSpecialCondition);
     ASSERT(TypeField() == 3);
-    return ((Bit(4) == 1) && (Bits(5, 3) == 0) &&
-            (Bit(20) == 1) && (Bits(22, 3) == 4));
+    return ((Bit(4) == 1) && (Bits(5, 3) == 0) && (Bit(20) == 1) &&
+            (Bits(22, 3) == 4));
   }
 
   // Test for VFP data processing or single transfer instructions of type 7.
@@ -753,12 +746,12 @@
   }
 
   // Special accessors that test for existence of a value.
-  inline bool HasS()    const { return SField() == 1; }
-  inline bool HasB()    const { return BField() == 1; }
-  inline bool HasW()    const { return WField() == 1; }
-  inline bool HasL()    const { return LField() == 1; }
+  inline bool HasS() const { return SField() == 1; }
+  inline bool HasB() const { return BField() == 1; }
+  inline bool HasW() const { return WField() == 1; }
+  inline bool HasL() const { return LField() == 1; }
   inline bool HasSign() const { return SignField() == 1; }
-  inline bool HasH()    const { return HField() == 1; }
+  inline bool HasH() const { return HField() == 1; }
   inline bool HasLink() const { return LinkField() == 1; }
 
   // Instructions are read out of a code stream. The only way to get a
@@ -774,4 +767,4 @@
 
 }  // namespace dart
 
-#endif  // VM_CONSTANTS_ARM_H_
+#endif  // RUNTIME_VM_CONSTANTS_ARM_H_
diff --git a/runtime/vm/constants_arm64.h b/runtime/vm/constants_arm64.h
index e855b0f..542fd52 100644
--- a/runtime/vm/constants_arm64.h
+++ b/runtime/vm/constants_arm64.h
@@ -2,24 +2,24 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_CONSTANTS_ARM64_H_
-#define VM_CONSTANTS_ARM64_H_
+#ifndef RUNTIME_VM_CONSTANTS_ARM64_H_
+#define RUNTIME_VM_CONSTANTS_ARM64_H_
 
 #include "platform/assert.h"
 
 namespace dart {
 
 enum Register {
-  R0  =  0,
-  R1  =  1,
-  R2  =  2,
-  R3  =  3,
-  R4  =  4,
-  R5  =  5,
-  R6  =  6,
-  R7  =  7,
-  R8  =  8,
-  R9  =  9,
+  R0 = 0,
+  R1 = 1,
+  R2 = 2,
+  R3 = 3,
+  R4 = 4,
+  R5 = 5,
+  R6 = 6,
+  R7 = 7,
+  R8 = 8,
+  R9 = 9,
   R10 = 10,
   R11 = 11,
   R12 = 12,
@@ -60,16 +60,16 @@
 
 
 enum VRegister {
-  V0  =  0,
-  V1  =  1,
-  V2  =  2,
-  V3  =  3,
-  V4  =  4,
-  V5  =  5,
-  V6  =  6,
-  V7  =  7,
-  V8  =  8,
-  V9  =  9,
+  V0 = 0,
+  V1 = 1,
+  V2 = 2,
+  V3 = 3,
+  V4 = 4,
+  V5 = 5,
+  V6 = 6,
+  V7 = 7,
+  V8 = 8,
+  V9 = 9,
   V10 = 10,
   V11 = 11,
   V12 = 12,
@@ -109,14 +109,14 @@
 const Register TMP = R16;  // Used as scratch register by assembler.
 const Register TMP2 = R17;
 const Register CTX = R28;  // Location of current context at method entry.
-const Register PP = R27;  // Caches object pool pointer in generated code.
+const Register PP = R27;   // Caches object pool pointer in generated code.
 const Register CODE_REG = R24;
-const Register FPREG = FP;  // Frame pointer register.
-const Register SPREG = R15;  // Stack pointer register.
-const Register LRREG = LR;  // Link register.
-const Register ICREG = R5;  // IC data register.
+const Register FPREG = FP;          // Frame pointer register.
+const Register SPREG = R15;         // Stack pointer register.
+const Register LRREG = LR;          // Link register.
+const Register ICREG = R5;          // IC data register.
 const Register ARGS_DESC_REG = R4;  // Arguments descriptor register.
-const Register THR = R26;  // Caches current thread in generated code.
+const Register THR = R26;           // Caches current thread in generated code.
 const Register CALLEE_SAVED_TEMP = R19;
 const Register CALLEE_SAVED_TEMP2 = R20;
 
@@ -140,13 +140,12 @@
 
 
 // C++ ABI call registers.
-const RegList kAbiArgumentCpuRegs =
-    (1 << R0) | (1 << R1) | (1 << R2) | (1 << R3) |
-    (1 << R4) | (1 << R5) | (1 << R6) | (1 << R7);
+const RegList kAbiArgumentCpuRegs = (1 << R0) | (1 << R1) | (1 << R2) |
+                                    (1 << R3) | (1 << R4) | (1 << R5) |
+                                    (1 << R6) | (1 << R7);
 const RegList kAbiPreservedCpuRegs =
-    (1 << R19) | (1 << R20) | (1 << R21) | (1 << R22) |
-    (1 << R23) | (1 << R24) | (1 << R25) | (1 << R26) |
-    (1 << R27) | (1 << R28);
+    (1 << R19) | (1 << R20) | (1 << R21) | (1 << R22) | (1 << R23) |
+    (1 << R24) | (1 << R25) | (1 << R26) | (1 << R27) | (1 << R28);
 const Register kAbiFirstPreservedCpuReg = R19;
 const Register kAbiLastPreservedCpuReg = R28;
 const int kAbiPreservedCpuRegCount = 10;
@@ -156,16 +155,10 @@
 
 const intptr_t kReservedCpuRegisters =
     (1 << SPREG) |  // Dart SP
-    (1 << FPREG) |
-    (1 << TMP)   |
-    (1 << TMP2)  |
-    (1 << PP)    |
-    (1 << THR)   |
-    (1 << LR)    |
-    (1 << R31)   |  // C++ SP
-    (1 << CTX)   |
-    (1 << R18);     // iOS platform register.
-                    // TODO(rmacnak): Only reserve on Mac & iOS.
+    (1 << FPREG) | (1 << TMP) | (1 << TMP2) | (1 << PP) | (1 << THR) |
+    (1 << LR) | (1 << R31) |  // C++ SP
+    (1 << CTX) | (1 << R18);  // iOS platform register.
+                              // TODO(rmacnak): Only reserve on Mac & iOS.
 // CPU registers available to Dart allocator.
 const RegList kDartAvailableCpuRegs =
     kAllCpuRegistersList & ~kReservedCpuRegisters;
@@ -184,16 +177,16 @@
 // Values for the condition field as defined in section A3.2.
 enum Condition {
   kNoCondition = -1,
-  EQ =  0,  // equal
-  NE =  1,  // not equal
-  CS =  2,  // carry set/unsigned higher or same
-  CC =  3,  // carry clear/unsigned lower
-  MI =  4,  // minus/negative
-  PL =  5,  // plus/positive or zero
-  VS =  6,  // overflow
-  VC =  7,  // no overflow
-  HI =  8,  // unsigned higher
-  LS =  9,  // unsigned lower or same
+  EQ = 0,   // equal
+  NE = 1,   // not equal
+  CS = 2,   // carry set/unsigned higher or same
+  CC = 3,   // carry clear/unsigned lower
+  MI = 4,   // minus/negative
+  PL = 5,   // plus/positive or zero
+  VS = 6,   // overflow
+  VC = 7,   // no overflow
+  HI = 8,   // unsigned higher
+  LS = 9,   // unsigned lower or same
   GE = 10,  // signed greater than or equal
   LT = 11,  // signed less than
   GT = 12,  // signed greater than
@@ -209,14 +202,38 @@
 }
 
 enum Bits {
-  B0  =  (1 << 0), B1  =  (1 << 1), B2  =  (1 << 2), B3  =  (1 << 3),
-  B4  =  (1 << 4), B5  =  (1 << 5), B6  =  (1 << 6), B7  =  (1 << 7),
-  B8  =  (1 << 8), B9  =  (1 << 9), B10 = (1 << 10), B11 = (1 << 11),
-  B12 = (1 << 12), B13 = (1 << 13), B14 = (1 << 14), B15 = (1 << 15),
-  B16 = (1 << 16), B17 = (1 << 17), B18 = (1 << 18), B19 = (1 << 19),
-  B20 = (1 << 20), B21 = (1 << 21), B22 = (1 << 22), B23 = (1 << 23),
-  B24 = (1 << 24), B25 = (1 << 25), B26 = (1 << 26), B27 = (1 << 27),
-  B28 = (1 << 28), B29 = (1 << 29), B30 = (1 << 30), B31 = (1 << 31),
+  B0 = (1 << 0),
+  B1 = (1 << 1),
+  B2 = (1 << 2),
+  B3 = (1 << 3),
+  B4 = (1 << 4),
+  B5 = (1 << 5),
+  B6 = (1 << 6),
+  B7 = (1 << 7),
+  B8 = (1 << 8),
+  B9 = (1 << 9),
+  B10 = (1 << 10),
+  B11 = (1 << 11),
+  B12 = (1 << 12),
+  B13 = (1 << 13),
+  B14 = (1 << 14),
+  B15 = (1 << 15),
+  B16 = (1 << 16),
+  B17 = (1 << 17),
+  B18 = (1 << 18),
+  B19 = (1 << 19),
+  B20 = (1 << 20),
+  B21 = (1 << 21),
+  B22 = (1 << 22),
+  B23 = (1 << 23),
+  B24 = (1 << 24),
+  B25 = (1 << 25),
+  B26 = (1 << 26),
+  B27 = (1 << 27),
+  B28 = (1 << 28),
+  B29 = (1 << 29),
+  B30 = (1 << 30),
+  B31 = (1 << 31),
 };
 
 enum OperandSize {
@@ -331,8 +348,11 @@
   SystemMask = 0xffc00000,
   SystemFixed = CompareBranchFixed | B31 | B30 | B24,
   HINT = SystemFixed | B17 | B16 | B13 | B4 | B3 | B2 | B1 | B0,
-  CLREX = SystemFixed | B17 | B16 | B13 | B12 | B11 | B10 | B9 | B8 |
-      B6 | B4 | B3 | B2 | B1 | B0,
+  CLREX = SystemFixed | B17 | B16 | B13 | B12 | B11 | B10 | B9 | B8 | B6 | B4 |
+          B3 |
+          B2 |
+          B1 |
+          B0,
 };
 
 // C3.2.5
@@ -554,8 +574,8 @@
   VABSD = SIMDTwoRegFixed | B30 | B23 | B22 | B15 | B14 | B13 | B12,
   VNEGD = SIMDTwoRegFixed | B30 | B29 | B23 | B22 | B15 | B14 | B13 | B12,
   VSQRTS = SIMDTwoRegFixed | B30 | B29 | B23 | B16 | B15 | B14 | B13 | B12,
-  VSQRTD = SIMDTwoRegFixed | B30 | B29 | B23 | B22
-                           | B16 | B15 | B14 | B13 | B12,
+  VSQRTD =
+      SIMDTwoRegFixed | B30 | B29 | B23 | B22 | B16 | B15 | B14 | B13 | B12,
   VRECPES = SIMDTwoRegFixed | B30 | B23 | B16 | B15 | B14 | B12,
   VRSQRTES = SIMDTwoRegFixed | B30 | B29 | B23 | B16 | B15 | B14 | B12,
 };
@@ -605,48 +625,48 @@
   FMOVRD = FPIntCvtFixed | B22 | B18 | B17,
   FMOVDR = FPIntCvtFixed | B22 | B18 | B17 | B16,
   FCVTZDS = FPIntCvtFixed | B22 | B20 | B19,
-  SCVTFD = FPIntCvtFixed |  B22 | B17,
+  SCVTFD = FPIntCvtFixed | B22 | B17,
 };
 
 
 #define APPLY_OP_LIST(_V)                                                      \
-_V(DPImmediate)                                                                \
-_V(CompareBranch)                                                              \
-_V(LoadStore)                                                                  \
-_V(DPRegister)                                                                 \
-_V(DPSimd1)                                                                    \
-_V(DPSimd2)                                                                    \
-_V(FP)                                                                         \
-_V(CompareAndBranch)                                                           \
-_V(ConditionalBranch)                                                          \
-_V(ExceptionGen)                                                               \
-_V(System)                                                                     \
-_V(TestAndBranch)                                                              \
-_V(UnconditionalBranch)                                                        \
-_V(UnconditionalBranchReg)                                                     \
-_V(LoadStoreReg)                                                               \
-_V(LoadStoreRegPair)                                                           \
-_V(LoadRegLiteral)                                                             \
-_V(LoadStoreExclusive)                                                         \
-_V(AddSubImm)                                                                  \
-_V(LogicalImm)                                                                 \
-_V(MoveWide)                                                                   \
-_V(PCRel)                                                                      \
-_V(AddSubShiftExt)                                                             \
-_V(AddSubWithCarry)                                                            \
-_V(ConditionalSelect)                                                          \
-_V(MiscDP1Source)                                                              \
-_V(MiscDP2Source)                                                              \
-_V(MiscDP3Source)                                                              \
-_V(LogicalShift)                                                               \
-_V(SIMDCopy)                                                                   \
-_V(SIMDThreeSame)                                                              \
-_V(SIMDTwoReg)                                                                 \
-_V(FPCompare)                                                                  \
-_V(FPOneSource)                                                                \
-_V(FPTwoSource)                                                                \
-_V(FPImm)                                                                      \
-_V(FPIntCvt)                                                                   \
+  _V(DPImmediate)                                                              \
+  _V(CompareBranch)                                                            \
+  _V(LoadStore)                                                                \
+  _V(DPRegister)                                                               \
+  _V(DPSimd1)                                                                  \
+  _V(DPSimd2)                                                                  \
+  _V(FP)                                                                       \
+  _V(CompareAndBranch)                                                         \
+  _V(ConditionalBranch)                                                        \
+  _V(ExceptionGen)                                                             \
+  _V(System)                                                                   \
+  _V(TestAndBranch)                                                            \
+  _V(UnconditionalBranch)                                                      \
+  _V(UnconditionalBranchReg)                                                   \
+  _V(LoadStoreReg)                                                             \
+  _V(LoadStoreRegPair)                                                         \
+  _V(LoadRegLiteral)                                                           \
+  _V(LoadStoreExclusive)                                                       \
+  _V(AddSubImm)                                                                \
+  _V(LogicalImm)                                                               \
+  _V(MoveWide)                                                                 \
+  _V(PCRel)                                                                    \
+  _V(AddSubShiftExt)                                                           \
+  _V(AddSubWithCarry)                                                          \
+  _V(ConditionalSelect)                                                        \
+  _V(MiscDP1Source)                                                            \
+  _V(MiscDP2Source)                                                            \
+  _V(MiscDP3Source)                                                            \
+  _V(LogicalShift)                                                             \
+  _V(SIMDCopy)                                                                 \
+  _V(SIMDThreeSame)                                                            \
+  _V(SIMDTwoReg)                                                               \
+  _V(FPCompare)                                                                \
+  _V(FPOneSource)                                                              \
+  _V(FPTwoSource)                                                              \
+  _V(FPImm)                                                                    \
+  _V(FPIntCvt)
 
 
 enum Shift {
@@ -785,16 +805,18 @@
 
 
 // Helper functions for decoding logical immediates.
-static inline uint64_t RotateRight(
-    uint64_t value, uint8_t rotate, uint8_t width) {
+static inline uint64_t RotateRight(uint64_t value,
+                                   uint8_t rotate,
+                                   uint8_t width) {
   ASSERT(width <= 64);
   rotate &= 63;
   return ((value & ((1UL << rotate) - 1UL)) << (width - rotate)) |
          (value >> rotate);
 }
 
-static inline uint64_t RepeatBitsAcrossReg(
-    uint8_t reg_size, uint64_t value, uint8_t width) {
+static inline uint64_t RepeatBitsAcrossReg(uint8_t reg_size,
+                                           uint64_t value,
+                                           uint8_t width) {
   ASSERT((width == 2) || (width == 4) || (width == 8) || (width == 16) ||
          (width == 32));
   ASSERT((reg_size == kWRegSizeInBits) || (reg_size == kXRegSizeInBits));
@@ -818,17 +840,13 @@
 //
 class Instr {
  public:
-  enum {
-    kInstrSize = 4,
-    kInstrSizeLog2 = 2,
-    kPCReadOffset = 8
-  };
+  enum { kInstrSize = 4, kInstrSizeLog2 = 2, kPCReadOffset = 8 };
 
   static const int32_t kNopInstruction = HINT;  // hint #0 === nop.
 
   // Reserved brk and hlt instruction codes.
-  static const int32_t kBreakPointCode = 0xdeb0;  // For breakpoint.
-  static const int32_t kStopMessageCode = 0xdeb1;  // For Stop(message).
+  static const int32_t kBreakPointCode = 0xdeb0;      // For breakpoint.
+  static const int32_t kStopMessageCode = 0xdeb1;     // For Stop(message).
   static const int32_t kSimulatorBreakCode = 0xdeb2;  // For breakpoint in sim.
   static const int32_t kSimulatorRedirectCode = 0xca11;  // For redirection.
 
@@ -847,9 +865,7 @@
       HLT | (kSimulatorRedirectCode << kImm16Shift);
 
   // Read one particular bit out of the instruction bits.
-  inline int Bit(int nr) const {
-    return (InstructionBits() >> nr) & 1;
-  }
+  inline int Bit(int nr) const { return (InstructionBits() >> nr) & 1; }
 
   // Read a bit field out of the instruction bits.
   inline int Bits(int shift, int count) const {
@@ -866,23 +882,22 @@
     *reinterpret_cast<int32_t*>(this) = value;
   }
 
-  inline void SetMoveWideBits(
-      MoveWideOp op, Register rd, uint16_t imm, int hw, OperandSize sz) {
+  inline void SetMoveWideBits(MoveWideOp op,
+                              Register rd,
+                              uint16_t imm,
+                              int hw,
+                              OperandSize sz) {
     ASSERT((hw >= 0) && (hw <= 3));
     ASSERT((sz == kDoubleWord) || (sz == kWord));
     const int32_t size = (sz == kDoubleWord) ? B31 : 0;
-    SetInstructionBits(
-        op | size |
-        (static_cast<int32_t>(rd) << kRdShift) |
-        (static_cast<int32_t>(hw) << kHWShift) |
-        (static_cast<int32_t>(imm) << kImm16Shift));
+    SetInstructionBits(op | size | (static_cast<int32_t>(rd) << kRdShift) |
+                       (static_cast<int32_t>(hw) << kHWShift) |
+                       (static_cast<int32_t>(imm) << kImm16Shift));
   }
 
-  inline void SetUnconditionalBranchRegBits(
-      UnconditionalBranchRegOp op, Register rn) {
-    SetInstructionBits(
-        op |
-        (static_cast<int32_t>(rn) << kRnShift));
+  inline void SetUnconditionalBranchRegBits(UnconditionalBranchRegOp op,
+                                            Register rn) {
+    SetInstructionBits(op | (static_cast<int32_t>(rn) << kRnShift));
   }
 
   inline void SetImm12Bits(int32_t orig, int32_t imm12) {
@@ -894,29 +909,40 @@
   inline int SField() const { return Bit(kSShift); }
   inline int SFField() const { return Bit(kSFShift); }
   inline int SzField() const { return Bits(kSzShift, kSzBits); }
-  inline Register RdField() const { return static_cast<Register>(
-                                        Bits(kRdShift, kRdBits)); }
-  inline Register RnField() const { return static_cast<Register>(
-                                        Bits(kRnShift, kRnBits)); }
-  inline Register RaField() const { return static_cast<Register>(
-                                        Bits(kRaShift, kRaBits)); }
-  inline Register RmField() const { return static_cast<Register>(
-                                        Bits(kRmShift, kRmBits)); }
-  inline Register RtField() const { return static_cast<Register>(
-                                        Bits(kRtShift, kRtBits)); }
-  inline Register Rt2Field() const { return static_cast<Register>(
-                                        Bits(kRt2Shift, kRt2Bits)); }
-  inline Register RsField() const { return static_cast<Register>(
-                                        Bits(kRsShift, kRsBits)); }
+  inline Register RdField() const {
+    return static_cast<Register>(Bits(kRdShift, kRdBits));
+  }
+  inline Register RnField() const {
+    return static_cast<Register>(Bits(kRnShift, kRnBits));
+  }
+  inline Register RaField() const {
+    return static_cast<Register>(Bits(kRaShift, kRaBits));
+  }
+  inline Register RmField() const {
+    return static_cast<Register>(Bits(kRmShift, kRmBits));
+  }
+  inline Register RtField() const {
+    return static_cast<Register>(Bits(kRtShift, kRtBits));
+  }
+  inline Register Rt2Field() const {
+    return static_cast<Register>(Bits(kRt2Shift, kRt2Bits));
+  }
+  inline Register RsField() const {
+    return static_cast<Register>(Bits(kRsShift, kRsBits));
+  }
 
-  inline VRegister VdField() const { return static_cast<VRegister>(
-                                        Bits(kVdShift, kVdBits)); }
-  inline VRegister VnField() const { return static_cast<VRegister>(
-                                        Bits(kVnShift, kVnBits)); }
-  inline VRegister VmField() const { return static_cast<VRegister>(
-                                        Bits(kVmShift, kVmBits)); }
-  inline VRegister VtField() const { return static_cast<VRegister>(
-                                        Bits(kVtShift, kVtBits)); }
+  inline VRegister VdField() const {
+    return static_cast<VRegister>(Bits(kVdShift, kVdBits));
+  }
+  inline VRegister VnField() const {
+    return static_cast<VRegister>(Bits(kVnShift, kVnBits));
+  }
+  inline VRegister VmField() const {
+    return static_cast<VRegister>(Bits(kVmShift, kVmBits));
+  }
+  inline VRegister VtField() const {
+    return static_cast<VRegister>(Bits(kVtShift, kVtBits));
+  }
 
   // Immediates
   inline int Imm3Field() const { return Bits(kImm3Shift, kImm3Bits); }
@@ -924,16 +950,19 @@
   inline int Imm7Field() const { return Bits(kImm7Shift, kImm7Bits); }
   // Sign-extended Imm7Field()
   inline int64_t SImm7Field() const {
-      return (static_cast<int32_t>(Imm7Field()) << 25) >> 25; }
+    return (static_cast<int32_t>(Imm7Field()) << 25) >> 25;
+  }
   inline int Imm8Field() const { return Bits(kImm8Shift, kImm8Bits); }
   inline int Imm9Field() const { return Bits(kImm9Shift, kImm9Bits); }
   // Sign-extended Imm9Field()
   inline int64_t SImm9Field() const {
-      return (static_cast<int32_t>(Imm9Field()) << 23) >> 23; }
+    return (static_cast<int32_t>(Imm9Field()) << 23) >> 23;
+  }
 
   inline int Imm12Field() const { return Bits(kImm12Shift, kImm12Bits); }
   inline int Imm12ShiftField() const {
-    return Bits(kImm12ShiftShift, kImm12ShiftBits); }
+    return Bits(kImm12ShiftShift, kImm12ShiftBits);
+  }
 
   inline int Imm16Field() const { return Bits(kImm16Shift, kImm16Bits); }
   inline int HWField() const { return Bits(kHWShift, kHWBits); }
@@ -943,13 +972,16 @@
 
   inline int Imm14Field() const { return Bits(kImm14Shift, kImm14Bits); }
   inline int64_t SImm14Field() const {
-      return (static_cast<int32_t>(Imm14Field()) << 18) >> 18; }
+    return (static_cast<int32_t>(Imm14Field()) << 18) >> 18;
+  }
   inline int Imm19Field() const { return Bits(kImm19Shift, kImm19Bits); }
   inline int64_t SImm19Field() const {
-      return (static_cast<int32_t>(Imm19Field()) << 13) >> 13; }
+    return (static_cast<int32_t>(Imm19Field()) << 13) >> 13;
+  }
   inline int Imm26Field() const { return Bits(kImm26Shift, kImm26Bits); }
   inline int64_t SImm26Field() const {
-      return (static_cast<int32_t>(Imm26Field()) << 6) >> 6; }
+    return (static_cast<int32_t>(Imm26Field()) << 6) >> 6;
+  }
 
   inline Condition ConditionField() const {
     return static_cast<Condition>(Bits(kCondShift, kCondBits));
@@ -966,18 +998,21 @@
     return !IsLogicalShiftOp() && (Bit(kAddShiftExtendShift) == 1);
   }
   inline Shift ShiftTypeField() const {
-      return static_cast<Shift>(Bits(kShiftTypeShift, kShiftTypeBits)); }
+    return static_cast<Shift>(Bits(kShiftTypeShift, kShiftTypeBits));
+  }
   inline Extend ExtendTypeField() const {
-      return static_cast<Extend>(Bits(kExtendTypeShift, kExtendTypeBits)); }
+    return static_cast<Extend>(Bits(kExtendTypeShift, kExtendTypeBits));
+  }
   inline int ShiftAmountField() const { return Imm6Field(); }
   inline int ExtShiftAmountField() const { return Imm3Field(); }
 
-  // Instruction identification.
-  #define IS_OP(op)                                                            \
-    inline bool Is##op##Op() const {                                           \
-      return ((InstructionBits() & op##Mask) == (op##Fixed & op##Mask)); }
+// Instruction identification.
+#define IS_OP(op)                                                              \
+  inline bool Is##op##Op() const {                                             \
+    return ((InstructionBits() & op##Mask) == (op##Fixed & op##Mask));         \
+  }
   APPLY_OP_LIST(IS_OP)
-  #undef IS_OP
+#undef IS_OP
 
   inline bool HasS() const { return (SField() == 1); }
 
@@ -1016,8 +1051,7 @@
     //  Add/sub (immediate).
     //  Add/sub (extended).
     // Otherwise, r31 is ZR.
-    if (IsLoadStoreOp() ||
-        IsAddSubImmOp() ||
+    if (IsLoadStoreOp() || IsAddSubImmOp() ||
         (IsAddSubShiftExtOp() && IsExtend())) {
       return R31IsSP;
     }
@@ -1028,8 +1062,7 @@
   // indicate a failure case. Specifically, where the constraints on imm_s are
   // not met.
   uint64_t ImmLogical() {
-    const uint8_t reg_size =
-        SFField() == 1 ? kXRegSizeInBits : kWRegSizeInBits;
+    const uint8_t reg_size = SFField() == 1 ? kXRegSizeInBits : kWRegSizeInBits;
     const int64_t n = NField();
     const int64_t imm_s = ImmSField();
     const int64_t imm_r = ImmRField();
@@ -1067,9 +1100,8 @@
             return 0;
           }
           uint64_t bits = (1UL << ((imm_s & mask) + 1)) - 1;
-          return RepeatBitsAcrossReg(reg_size,
-                                     RotateRight(bits, imm_r & mask, width),
-                                     width);
+          return RepeatBitsAcrossReg(
+              reg_size, RotateRight(bits, imm_r & mask, width), width);
         }
       }
     }
@@ -1078,16 +1110,11 @@
   }
 
   static int64_t VFPExpandImm(uint8_t imm8) {
-    const int64_t sign =
-        static_cast<int64_t>((imm8 & 0x80) >> 7) << 63;
-    const int64_t hi_exp =
-        static_cast<int64_t>(!((imm8 & 0x40) >> 6)) << 62;
-    const int64_t mid_exp =
-        (((imm8 & 0x40) >> 6) == 0) ? 0 : (0xffLL << 54);
-    const int64_t low_exp =
-        static_cast<int64_t>((imm8 & 0x30) >> 4) << 52;
-    const int64_t frac =
-        static_cast<int64_t>(imm8 & 0x0f) << 48;
+    const int64_t sign = static_cast<int64_t>((imm8 & 0x80) >> 7) << 63;
+    const int64_t hi_exp = static_cast<int64_t>(!((imm8 & 0x40) >> 6)) << 62;
+    const int64_t mid_exp = (((imm8 & 0x40) >> 6) == 0) ? 0 : (0xffLL << 54);
+    const int64_t low_exp = static_cast<int64_t>((imm8 & 0x30) >> 4) << 52;
+    const int64_t frac = static_cast<int64_t>(imm8 & 0x0f) << 48;
     return sign | hi_exp | mid_exp | low_exp | frac;
   }
 
@@ -1104,4 +1131,4 @@
 
 }  // namespace dart
 
-#endif  // VM_CONSTANTS_ARM64_H_
+#endif  // RUNTIME_VM_CONSTANTS_ARM64_H_
diff --git a/runtime/vm/constants_dbc.h b/runtime/vm/constants_dbc.h
index 44398aa..cf14318 100644
--- a/runtime/vm/constants_dbc.h
+++ b/runtime/vm/constants_dbc.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_CONSTANTS_DBC_H_
-#define VM_CONSTANTS_DBC_H_
+#ifndef RUNTIME_VM_CONSTANTS_DBC_H_
+#define RUNTIME_VM_CONSTANTS_DBC_H_
 
 #include "platform/globals.h"
 #include "platform/assert.h"
@@ -12,6 +12,7 @@
 
 namespace dart {
 
+// clang-format off
 // List of Dart Bytecode instructions.
 //
 // INTERPRETER STATE
@@ -230,6 +231,16 @@
 //    Convert the unboxed float or double in FP[rD] as indicated, and store the
 //    result in FP[rA].
 //
+//  - DoubleIsNaN rA, rD
+//
+//    If the unboxed double in FP[rD] is a NaN, then writes Bool::True().raw()
+//    into FP[rA], and Bool::False().raw() otherwise.
+//
+//  - DoubleIsInfinite rA, rD
+//
+//    If the unboxed double in FP[rD] is + or - infinity, then
+//    writes Bool::True().raw() into FP[rA], and Bool::False().raw() otherwise.
+//
 //  - BitOr, BitAnd, BitXor rA, rB, rC
 //
 //    FP[rA] <- FP[rB] op FP[rC]. These instructions expect their operands to be
@@ -396,6 +407,12 @@
 //
 //    Store value FP[rC] into object FP[rA] at offset (in words) B.
 //
+//  - StoreFieldExt rA, rD
+//
+//    Store value FP[rD] into object FP[rA] at offset (in words)
+//    stored in the following Nop instruction. Used to access fields with
+//    large offsets.
+//
 //  - StoreFieldTOS D
 //
 //    Store value SP[0] into object SP[-1] at offset (in words) D.
@@ -404,6 +421,12 @@
 //
 //    Load value at offset (in words) C from object FP[rB] into FP[rA].
 //
+//  - LoadFieldExt rA, rD
+//
+//    Load value from object FP[rD] at offset (in words) stored in the
+//    following Nop instruction into FP[rA]. Used to access fields with
+//    large offsets.
+//
 //  - LoadUntagged rA, rB, C
 //
 //    Like LoadField, but assumes that FP[rB] is untagged.
@@ -514,10 +537,16 @@
 //    (A = 1) a subtype of SP[-1] using SubtypeTestCache SP[0], with result
 //    placed at top of stack.
 //
-//  - AssertAssignable D
+//  - AssertAssignable A, D
 //
 //    Assert that SP[-3] is assignable to variable named SP[0] of type
 //    SP[-1] with type arguments SP[-2] using SubtypeTestCache PP[D].
+//    If A is 1, then the instance may be a Smi.
+//
+//  - BadTypeError
+//
+//    If SP[-3] is non-null, throws a BadType error by calling into the runtime.
+//    Assumes that the stack is arranged the same as for AssertAssignable.
 //
 //  - AssertBoolean A
 //
@@ -701,6 +730,8 @@
   V(DCeil,                         A_D, reg, reg, ___) \
   V(DoubleToFloat,                 A_D, reg, reg, ___) \
   V(FloatToDouble,                 A_D, reg, reg, ___) \
+  V(DoubleIsNaN,                     A, reg, ___, ___) \
+  V(DoubleIsInfinite,                A, reg, ___, ___) \
   V(StoreStaticTOS,                  D, lit, ___, ___) \
   V(PushStatic,                      D, lit, ___, ___) \
   V(InitStaticTOS,                   0, ___, ___, ___) \
@@ -729,7 +760,7 @@
   V(IfEqNull,                        A, reg, ___, ___) \
   V(IfNeNull,                        A, reg, ___, ___) \
   V(CreateArrayTOS,                  0, ___, ___, ___) \
-  V(CreateArrayOpt,              A_B_C, reg, reg, ___) \
+  V(CreateArrayOpt,              A_B_C, reg, reg, reg) \
   V(Allocate,                        D, lit, ___, ___) \
   V(AllocateT,                       0, ___, ___, ___) \
   V(AllocateOpt,                   A_D, reg, lit, ___) \
@@ -758,8 +789,10 @@
   V(LoadIndexedOneByteString,    A_B_C, reg, reg, reg) \
   V(LoadIndexedTwoByteString,    A_B_C, reg, reg, reg) \
   V(StoreField,                  A_B_C, reg, num, reg) \
+  V(StoreFieldExt,                 A_D, reg, reg, ___) \
   V(StoreFieldTOS,                   D, num, ___, ___) \
   V(LoadField,                   A_B_C, reg, reg, num) \
+  V(LoadFieldExt,                  A_D, reg, reg, ___) \
   V(LoadUntagged,                A_B_C, reg, reg, num) \
   V(LoadFieldTOS,                    D, num, ___, ___) \
   V(BooleanNegateTOS,                0, ___, ___, ___) \
@@ -777,7 +810,8 @@
   V(InstantiateType,                 D, lit, ___, ___) \
   V(InstantiateTypeArgumentsTOS,   A_D, num, lit, ___) \
   V(InstanceOf,                      A, num, ___, ___) \
-  V(AssertAssignable,                D, num, lit, ___) \
+  V(BadTypeError,                    0, ___, ___, ___) \
+  V(AssertAssignable,              A_D, num, lit, ___) \
   V(AssertBoolean,                   A, num, ___, ___) \
   V(TestSmi,                       A_D, reg, reg, ___) \
   V(TestCids,                      A_D, reg, num, ___) \
@@ -785,11 +819,13 @@
   V(CheckEitherNonSmi,             A_D, reg, reg, ___) \
   V(CheckClassId,                  A_D, reg, num, ___) \
   V(CheckDenseSwitch,              A_D, reg, num, ___) \
-  V(CheckCids,                   A_B_C, reg, num, ___) \
+  V(CheckCids,                   A_B_C, reg, num, num) \
   V(CheckStack,                      0, ___, ___, ___) \
   V(DebugStep,                       0, ___, ___, ___) \
   V(DebugBreak,                      A, num, ___, ___) \
-  V(Deopt,                         A_D, num, num, ___) \
+  V(Deopt,                         A_D, num, num, ___)
+
+// clang-format on
 
 typedef uint32_t Instr;
 
@@ -797,7 +833,7 @@
  public:
   enum Opcode {
 #define DECLARE_BYTECODE(name, encoding, op1, op2, op3) k##name,
-BYTECODES_LIST(DECLARE_BYTECODE)
+    BYTECODES_LIST(DECLARE_BYTECODE)
 #undef DECLARE_BYTECODE
   };
 
@@ -835,9 +871,7 @@
     return op | (x << kAShift);
   }
 
-  static Instr Encode(Opcode op) {
-    return op;
-  }
+  static Instr Encode(Opcode op) { return op; }
 
   DART_FORCE_INLINE static uint8_t DecodeA(Instr bc) {
     return (bc >> kAShift) & kAMask;
@@ -933,4 +967,4 @@
 
 }  // namespace dart
 
-#endif  // VM_CONSTANTS_DBC_H_
+#endif  // RUNTIME_VM_CONSTANTS_DBC_H_
diff --git a/runtime/vm/constants_ia32.h b/runtime/vm/constants_ia32.h
index adf988a..ca449d8 100644
--- a/runtime/vm/constants_ia32.h
+++ b/runtime/vm/constants_ia32.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_CONSTANTS_IA32_H_
-#define VM_CONSTANTS_IA32_H_
+#ifndef RUNTIME_VM_CONSTANTS_IA32_H_
+#define RUNTIME_VM_CONSTANTS_IA32_H_
 
 #include "platform/assert.h"
 
@@ -58,16 +58,16 @@
 
 
 // Register aliases.
-const Register TMP = kNoRegister;  // No scratch register used by assembler.
+const Register TMP = kNoRegister;   // No scratch register used by assembler.
 const Register TMP2 = kNoRegister;  // No second assembler scratch register.
 const Register CTX = EDI;  // Location of current context at method entry.
 const Register CODE_REG = EDI;
-const Register PP = kNoRegister;  // No object pool pointer.
-const Register SPREG = ESP;  // Stack pointer register.
-const Register FPREG = EBP;  // Frame pointer register.
-const Register ICREG = ECX;  // IC data register.
+const Register PP = kNoRegister;     // No object pool pointer.
+const Register SPREG = ESP;          // Stack pointer register.
+const Register FPREG = EBP;          // Frame pointer register.
+const Register ICREG = ECX;          // IC data register.
 const Register ARGS_DESC_REG = EDX;  // Arguments descriptor register.
-const Register THR = ESI;  // Caches current thread in generated code.
+const Register THR = ESI;            // Caches current thread in generated code.
 const Register CALLEE_SAVED_TEMP = EBX;
 const Register CALLEE_SAVED_TEMP2 = EDI;
 
@@ -83,10 +83,7 @@
 typedef uint32_t RegList;
 const RegList kAllCpuRegistersList = 0xFF;
 
-const intptr_t kReservedCpuRegisters =
-    (1 << SPREG) |
-    (1 << FPREG) |
-    (1 << THR);
+const intptr_t kReservedCpuRegisters = (1 << SPREG) | (1 << FPREG) | (1 << THR);
 // CPU registers available to Dart allocator.
 const RegList kDartAvailableCpuRegs =
     kAllCpuRegistersList & ~kReservedCpuRegisters;
@@ -103,29 +100,29 @@
 
 
 enum Condition {
-  OVERFLOW      =  0,
-  NO_OVERFLOW   =  1,
-  BELOW         =  2,
-  ABOVE_EQUAL   =  3,
-  EQUAL         =  4,
-  NOT_EQUAL     =  5,
-  BELOW_EQUAL   =  6,
-  ABOVE         =  7,
-  SIGN          =  8,
-  NOT_SIGN      =  9,
-  PARITY_EVEN   = 10,
-  PARITY_ODD    = 11,
-  LESS          = 12,
+  OVERFLOW = 0,
+  NO_OVERFLOW = 1,
+  BELOW = 2,
+  ABOVE_EQUAL = 3,
+  EQUAL = 4,
+  NOT_EQUAL = 5,
+  BELOW_EQUAL = 6,
+  ABOVE = 7,
+  SIGN = 8,
+  NOT_SIGN = 9,
+  PARITY_EVEN = 10,
+  PARITY_ODD = 11,
+  LESS = 12,
   GREATER_EQUAL = 13,
-  LESS_EQUAL    = 14,
-  GREATER       = 15,
+  LESS_EQUAL = 14,
+  GREATER = 15,
 
-  ZERO          = EQUAL,
-  NOT_ZERO      = NOT_EQUAL,
-  NEGATIVE      = SIGN,
-  POSITIVE      = NOT_SIGN,
-  CARRY         = BELOW,
-  NOT_CARRY     = ABOVE_EQUAL
+  ZERO = EQUAL,
+  NOT_ZERO = NOT_EQUAL,
+  NEGATIVE = SIGN,
+  POSITIVE = NOT_SIGN,
+  CARRY = BELOW,
+  NOT_CARRY = ABOVE_EQUAL
 };
 
 
@@ -160,4 +157,4 @@
 
 }  // namespace dart
 
-#endif  // VM_CONSTANTS_IA32_H_
+#endif  // RUNTIME_VM_CONSTANTS_IA32_H_
diff --git a/runtime/vm/constants_mips.h b/runtime/vm/constants_mips.h
index 9a79f53..355681d 100644
--- a/runtime/vm/constants_mips.h
+++ b/runtime/vm/constants_mips.h
@@ -2,24 +2,24 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_CONSTANTS_MIPS_H_
-#define VM_CONSTANTS_MIPS_H_
+#ifndef RUNTIME_VM_CONSTANTS_MIPS_H_
+#define RUNTIME_VM_CONSTANTS_MIPS_H_
 
 #include "platform/assert.h"
 
 namespace dart {
 
 enum Register {
-  R0  =  0,
-  R1  =  1,  // AT aka TMP
-  R2  =  2,
-  R3  =  3,
-  R4  =  4,
-  R5  =  5,
-  R6  =  6,
-  R7  =  7,
-  R8  =  8,
-  R9  =  9,
+  R0 = 0,
+  R1 = 1,  // AT aka TMP
+  R2 = 2,
+  R3 = 3,
+  R4 = 4,
+  R5 = 5,
+  R6 = 6,
+  R7 = 7,
+  R8 = 8,
+  R9 = 9,
   R10 = 10,
   R11 = 11,
   R12 = 12,
@@ -93,16 +93,16 @@
 // Values for floating point registers.
 // Double-precision values use register pairs.
 enum FRegister {
-  F0  =  0,
-  F1  =  1,
-  F2  =  2,
-  F3  =  3,
-  F4  =  4,
-  F5  =  5,
-  F6  =  6,
-  F7  =  7,
-  F8  =  8,
-  F9  =  9,
+  F0 = 0,
+  F1 = 1,
+  F2 = 2,
+  F3 = 3,
+  F4 = 4,
+  F5 = 5,
+  F6 = 6,
+  F7 = 7,
+  F8 = 8,
+  F9 = 9,
   F10 = 10,
   F11 = 11,
   F12 = 12,
@@ -135,16 +135,16 @@
 // convert to the single precision registers when needed in the mips-specific
 // code.
 enum DRegister {
-  D0  =  0,  // Function return value 1.
-  D1  =  1,  // Function return value 2.
-  D2  =  2,  // Not preserved.
-  D3  =  3,  // Not preserved.
-  D4  =  4,  // Not preserved.
-  D5  =  5,  // Not preserved.
-  D6  =  6,  // Argument 1.
-  D7  =  7,  // Argument 2.
-  D8  =  8,  // Not preserved.
-  D9  =  9,  // Not preserved.
+  D0 = 0,    // Function return value 1.
+  D1 = 1,    // Function return value 2.
+  D2 = 2,    // Not preserved.
+  D3 = 3,    // Not preserved.
+  D4 = 4,    // Not preserved.
+  D5 = 5,    // Not preserved.
+  D6 = 6,    // Argument 1.
+  D7 = 7,    // Argument 2.
+  D8 = 8,    // Not preserved.
+  D9 = 9,    // Not preserved.
   D10 = 10,  // Preserved.
   D11 = 11,  // Preserved.
   D12 = 12,  // Preserved.
@@ -175,11 +175,11 @@
 
 
 // Register aliases.
-const Register TMP = AT;  // Used as scratch register by assembler.
+const Register TMP = AT;            // Used as scratch register by assembler.
 const Register TMP2 = kNoRegister;  // No second assembler scratch register.
 const Register CTX = S6;  // Location of current context at method entry.
 const Register CODE_REG = S6;
-const Register PP = S7;  // Caches object pool pointer in generated code.
+const Register PP = S7;     // Caches object pool pointer in generated code.
 const Register SPREG = SP;  // Stack pointer register.
 const Register FPREG = FP;  // Frame pointer register.
 const Register LRREG = RA;  // Link register.
@@ -209,9 +209,9 @@
 
 const RegList kAbiArgumentCpuRegs =
     (1 << A0) | (1 << A1) | (1 << A2) | (1 << A3);
-const RegList kAbiPreservedCpuRegs =
-    (1 << S0) | (1 << S1) | (1 << S2) | (1 << S3) |
-    (1 << S4) | (1 << S5) | (1 << S6) | (1 << S7);
+const RegList kAbiPreservedCpuRegs = (1 << S0) | (1 << S1) | (1 << S2) |
+                                     (1 << S3) | (1 << S4) | (1 << S5) |
+                                     (1 << S6) | (1 << S7);
 const int kAbiPreservedCpuRegCount = 8;
 
 // FPU registers 20 - 31 are preserved across calls.
@@ -221,19 +221,9 @@
 const int kAbiPreservedFpuRegCount = 12;
 
 const RegList kReservedCpuRegisters =
-    (1 << SPREG)   |
-    (1 << FPREG)   |
-    (1 << TMP)     |
-    (1 << PP)      |
-    (1 << THR)     |
-    (1 << CTX)     |
-    (1 << ZR)      |
-    (1 << CMPRES1) |
-    (1 << CMPRES2) |
-    (1 << K0)      |
-    (1 << K1)      |
-    (1 << GP)      |
-    (1 << RA);
+    (1 << SPREG) | (1 << FPREG) | (1 << TMP) | (1 << PP) | (1 << THR) |
+    (1 << CTX) | (1 << ZR) | (1 << CMPRES1) | (1 << CMPRES2) | (1 << K0) |
+    (1 << K1) | (1 << GP) | (1 << RA);
 // CPU registers available to Dart allocator.
 const RegList kDartAvailableCpuRegs =
     kAllCpuRegistersList & ~kReservedCpuRegisters;
@@ -254,14 +244,14 @@
 // code, type Condition (see assembler_mips.h) represents a pair of operands and
 // a relation operator between them.
 enum RelationOperator {
-  AL,  // always
-  NV,  // never
-  EQ,  // equal
-  NE,  // not equal
-  GT,  // greater than
-  GE,  // greater equal
-  LT,  // less than
-  LE,  // less equal
+  AL,   // always
+  NV,   // never
+  EQ,   // equal
+  NE,   // not equal
+  GT,   // greater than
+  GE,   // greater equal
+  LT,   // less than
+  LE,   // less equal
   UGT,  // unsigned greater than
   UGE,  // unsigned greater equal
   ULT,  // unsigned less than
@@ -479,8 +469,8 @@
   static const int32_t kNopInstruction = 0;
 
   // Reserved break instruction codes.
-  static const int32_t kBreakPointCode = 0xdeb0;  // For breakpoint.
-  static const int32_t kStopMessageCode = 0xdeb1;  // For Stop(message).
+  static const int32_t kBreakPointCode = 0xdeb0;      // For breakpoint.
+  static const int32_t kStopMessageCode = 0xdeb1;     // For Stop(message).
   static const int32_t kSimulatorBreakCode = 0xdeb2;  // For breakpoint in sim.
   static const int32_t kSimulatorRedirectCode = 0xca11;  // For redirection.
 
@@ -511,29 +501,24 @@
     *reinterpret_cast<int32_t*>(this) = value;
   }
 
-  inline void SetImmInstrBits(Opcode op, Register rs, Register rt,
+  inline void SetImmInstrBits(Opcode op,
+                              Register rs,
+                              Register rt,
                               uint16_t imm) {
-    SetInstructionBits(
-        op << kOpcodeShift |
-        rs << kRsShift |
-        rt << kRtShift |
-        imm << kImmShift);
+    SetInstructionBits(op << kOpcodeShift | rs << kRsShift | rt << kRtShift |
+                       imm << kImmShift);
   }
 
   inline void SetSpecialInstrBits(SpecialFunction f,
-                                  Register rs, Register rt, Register rd) {
-    SetInstructionBits(
-        SPECIAL << kOpcodeShift |
-        f << kFunctionShift |
-        rs << kRsShift |
-        rt << kRtShift |
-        rd << kRdShift);
+                                  Register rs,
+                                  Register rt,
+                                  Register rd) {
+    SetInstructionBits(SPECIAL << kOpcodeShift | f << kFunctionShift |
+                       rs << kRsShift | rt << kRtShift | rd << kRdShift);
   }
 
   // Read one particular bit out of the instruction bits.
-  inline int32_t Bit(int nr) const {
-    return (InstructionBits() >> nr) & 1;
-  }
+  inline int32_t Bit(int nr) const { return (InstructionBits() >> nr) & 1; }
 
   // Read a bit field out of the instruction bits.
   inline int32_t Bits(int shift, int count) const {
@@ -575,13 +560,9 @@
     return static_cast<FRegister>(Bits(kFdShift, kFdBits));
   }
 
-  inline int SaField() const {
-    return Bits(kSaShift, kSaBits);
-  }
+  inline int SaField() const { return Bits(kSaShift, kSaBits); }
 
-  inline int32_t UImmField() const {
-    return Bits(kImmShift, kImmBits);
-  }
+  inline int32_t UImmField() const { return Bits(kImmShift, kImmBits); }
 
   inline int32_t SImmField() const {
     // Sign-extend the imm field.
@@ -626,9 +607,7 @@
     return static_cast<Format>(Bits(kFmtShift, kFmtBits));
   }
 
-  inline int32_t FpuCCField() const {
-    return Bits(kFpuCCShift, kFpuCCBits);
-  }
+  inline int32_t FpuCCField() const { return Bits(kFpuCCShift, kFpuCCBits); }
 
   // Instructions are read out of a code stream. The only way to get a
   // reference to an instruction is to convert a pc. There is no way
@@ -637,17 +616,20 @@
   static Instr* At(uword pc) { return reinterpret_cast<Instr*>(pc); }
 
 #if defined(DEBUG)
-  inline void AssertIsImmInstr(Opcode op, Register rs, Register rt,
-                              int32_t imm) {
+  inline void AssertIsImmInstr(Opcode op,
+                               Register rs,
+                               Register rt,
+                               int32_t imm) {
     ASSERT((OpcodeField() == op) && (RsField() == rs) && (RtField() == rt) &&
            (SImmField() == imm));
   }
 
-  inline void AssertIsSpecialInstr(SpecialFunction f, Register rs, Register rt,
+  inline void AssertIsSpecialInstr(SpecialFunction f,
+                                   Register rs,
+                                   Register rt,
                                    Register rd) {
     ASSERT((OpcodeField() == SPECIAL) && (FunctionField() == f) &&
-           (RsField() == rs) && (RtField() == rt) &&
-           (RdField() == rd));
+           (RsField() == rs) && (RtField() == rt) && (RdField() == rd));
   }
 #endif  // defined(DEBUG)
 
@@ -658,4 +640,4 @@
 
 }  // namespace dart
 
-#endif  // VM_CONSTANTS_MIPS_H_
+#endif  // RUNTIME_VM_CONSTANTS_MIPS_H_
diff --git a/runtime/vm/constants_x64.h b/runtime/vm/constants_x64.h
index 72c4710..3c24e0b 100644
--- a/runtime/vm/constants_x64.h
+++ b/runtime/vm/constants_x64.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_CONSTANTS_X64_H_
-#define VM_CONSTANTS_X64_H_
+#ifndef RUNTIME_VM_CONSTANTS_X64_H_
+#define RUNTIME_VM_CONSTANTS_X64_H_
 
 namespace dart {
 
@@ -16,8 +16,8 @@
   RBP = 5,
   RSI = 6,
   RDI = 7,
-  R8  = 8,
-  R9  = 9,
+  R8 = 8,
+  R9 = 9,
   R10 = 10,
   R11 = 11,
   R12 = 12,
@@ -72,11 +72,11 @@
 
 
 enum RexBits {
-  REX_NONE   = 0,
-  REX_B      = 1 << 0,
-  REX_X      = 1 << 1,
-  REX_R      = 1 << 2,
-  REX_W      = 1 << 3,
+  REX_NONE = 0,
+  REX_B = 1 << 0,
+  REX_X = 1 << 1,
+  REX_R = 1 << 2,
+  REX_W = 1 << 3,
   REX_PREFIX = 1 << 6
 };
 
@@ -87,9 +87,9 @@
 const Register CTX = R12;  // Location of current context at method entry.
 // Caches object pool pointer in generated code.
 const Register PP = R15;
-const Register SPREG = RSP;  // Stack pointer register.
-const Register FPREG = RBP;  // Frame pointer register.
-const Register ICREG = RBX;  // IC data register.
+const Register SPREG = RSP;          // Stack pointer register.
+const Register FPREG = RBP;          // Frame pointer register.
+const Register ICREG = RBX;          // IC data register.
 const Register ARGS_DESC_REG = R10;  // Arguments descriptor register.
 const Register CODE_REG = R12;
 const Register THR = R14;  // Caches current thread in generated code.
@@ -108,11 +108,7 @@
 const RegList kAllCpuRegistersList = 0xFFFF;
 
 const RegList kReservedCpuRegisters =
-    (1 << SPREG) |
-    (1 << FPREG) |
-    (1 << TMP)   |
-    (1 << PP)    |
-    (1 << THR);
+    (1 << SPREG) | (1 << FPREG) | (1 << TMP) | (1 << PP) | (1 << THR);
 // CPU registers available to Dart allocator.
 const RegList kDartAvailableCpuRegs =
     kAllCpuRegistersList & ~kReservedCpuRegisters;
@@ -129,29 +125,29 @@
 
 
 enum Condition {
-  OVERFLOW      =  0,
-  NO_OVERFLOW   =  1,
-  BELOW         =  2,
-  ABOVE_EQUAL   =  3,
-  EQUAL         =  4,
-  NOT_EQUAL     =  5,
-  BELOW_EQUAL   =  6,
-  ABOVE         =  7,
-  SIGN          =  8,
-  NOT_SIGN      =  9,
-  PARITY_EVEN   = 10,
-  PARITY_ODD    = 11,
-  LESS          = 12,
+  OVERFLOW = 0,
+  NO_OVERFLOW = 1,
+  BELOW = 2,
+  ABOVE_EQUAL = 3,
+  EQUAL = 4,
+  NOT_EQUAL = 5,
+  BELOW_EQUAL = 6,
+  ABOVE = 7,
+  SIGN = 8,
+  NOT_SIGN = 9,
+  PARITY_EVEN = 10,
+  PARITY_ODD = 11,
+  LESS = 12,
   GREATER_EQUAL = 13,
-  LESS_EQUAL    = 14,
-  GREATER       = 15,
+  LESS_EQUAL = 14,
+  GREATER = 15,
 
-  ZERO          = EQUAL,
-  NOT_ZERO      = NOT_EQUAL,
-  NEGATIVE      = SIGN,
-  POSITIVE      = NOT_SIGN,
-  CARRY         = BELOW,
-  NOT_CARRY     = ABOVE_EQUAL
+  ZERO = EQUAL,
+  NOT_ZERO = NOT_EQUAL,
+  NEGATIVE = SIGN,
+  POSITIVE = NOT_SIGN,
+  CARRY = BELOW,
+  NOT_CARRY = ABOVE_EQUAL
 };
 
 #define R(reg) (1 << (reg))
@@ -193,14 +189,14 @@
   static const Register kArg6Reg = R9;
   static const intptr_t kShadowSpaceBytes = 0;
 
-  static const intptr_t kVolatileCpuRegisters =
-      R(RAX) | R(RCX) | R(RDX) | R(RSI) | R(RDI) |
-      R(R8) | R(R9) | R(R10) | R(R11);
+  static const intptr_t kVolatileCpuRegisters = R(RAX) | R(RCX) | R(RDX) |
+                                                R(RSI) | R(RDI) | R(R8) |
+                                                R(R9) | R(R10) | R(R11);
 
   static const intptr_t kVolatileXmmRegisters =
-      R(XMM0) | R(XMM1) | R(XMM2) | R(XMM3) | R(XMM4) |
-      R(XMM5) | R(XMM6) | R(XMM7) | R(XMM8) | R(XMM9) |
-      R(XMM10) | R(XMM11) | R(XMM12) | R(XMM13) | R(XMM14) | R(XMM15);
+      R(XMM0) | R(XMM1) | R(XMM2) | R(XMM3) | R(XMM4) | R(XMM5) | R(XMM6) |
+      R(XMM7) | R(XMM8) | R(XMM9) | R(XMM10) | R(XMM11) | R(XMM12) | R(XMM13) |
+      R(XMM14) | R(XMM15);
 
   static const intptr_t kCalleeSaveCpuRegisters =
       R(RBX) | R(R12) | R(R13) | R(R14) | R(R15);
@@ -242,4 +238,4 @@
 
 }  // namespace dart
 
-#endif  // VM_CONSTANTS_X64_H_
+#endif  // RUNTIME_VM_CONSTANTS_X64_H_
diff --git a/runtime/vm/cpu.h b/runtime/vm/cpu.h
index 3b93489..cdd0c25 100644
--- a/runtime/vm/cpu.h
+++ b/runtime/vm/cpu.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_CPU_H_
-#define VM_CPU_H_
+#ifndef RUNTIME_VM_CPU_H_
+#define RUNTIME_VM_CPU_H_
 
 #include "vm/globals.h"
 #include "vm/allocation.h"
@@ -39,4 +39,4 @@
 #error Unknown architecture.
 #endif
 
-#endif  // VM_CPU_H_
+#endif  // RUNTIME_VM_CPU_H_
diff --git a/runtime/vm/cpu_arm.cc b/runtime/vm/cpu_arm.cc
index edaea94..e5a1dd9 100644
--- a/runtime/vm/cpu_arm.cc
+++ b/runtime/vm/cpu_arm.cc
@@ -5,8 +5,10 @@
 #include "vm/globals.h"
 #if defined(TARGET_ARCH_ARM)
 
-#include "vm/assembler.h"
 #include "vm/cpu.h"
+#include "vm/cpu_arm.h"
+
+#include "vm/assembler.h"
 #include "vm/cpuinfo.h"
 #include "vm/heap.h"
 #include "vm/isolate.h"
@@ -14,8 +16,8 @@
 #include "vm/simulator.h"
 
 #if !defined(USING_SIMULATOR)
-#include <sys/syscall.h>  /* NOLINT */
-#include <unistd.h>  /* NOLINT */
+#include <sys/syscall.h> /* NOLINT */
+#include <unistd.h>      /* NOLINT */
 #endif
 
 // ARM version differences.
@@ -59,17 +61,23 @@
 #if defined(TARGET_ARCH_ARM_5TE)
 DEFINE_FLAG(bool, use_vfp, false, "Use vfp instructions if supported");
 DEFINE_FLAG(bool, use_neon, false, "Use neon instructions if supported");
-DEFINE_FLAG(bool, use_integer_division, false,
+DEFINE_FLAG(bool,
+            use_integer_division,
+            false,
             "Use integer division instruction if supported");
 #elif defined(TARGET_ARCH_ARM_6)
 DEFINE_FLAG(bool, use_vfp, true, "Use vfp instructions if supported");
 DEFINE_FLAG(bool, use_neon, false, "Use neon instructions if supported");
-DEFINE_FLAG(bool, use_integer_division, false,
+DEFINE_FLAG(bool,
+            use_integer_division,
+            false,
             "Use integer division instruction if supported");
 #else
 DEFINE_FLAG(bool, use_vfp, true, "Use vfp instructions if supported");
 DEFINE_FLAG(bool, use_neon, true, "Use neon instructions if supported");
-DEFINE_FLAG(bool, use_integer_division, true,
+DEFINE_FLAG(bool,
+            use_integer_division,
+            true,
             "Use integer division instruction if supported");
 #endif
 
@@ -93,19 +101,19 @@
     return;
   }
 
-  // ARM recommends using the gcc intrinsic __clear_cache on Linux, and the
-  // library call cacheflush from unistd.h on Android:
-  // blogs.arm.com/software-enablement/141-caches-and-self-modifying-code/
-  #if defined(__linux__) && !defined(ANDROID)
-    extern void __clear_cache(char*, char*);
-    char* beg = reinterpret_cast<char*>(start);
-    char* end = reinterpret_cast<char*>(start + size);
-    ::__clear_cache(beg, end);
-  #elif defined(ANDROID)
-    cacheflush(start, start + size, 0);
-  #else
-    #error FlushICache only tested/supported on Linux and Android
-  #endif
+// ARM recommends using the gcc intrinsic __clear_cache on Linux, and the
+// library call cacheflush from unistd.h on Android:
+// blogs.arm.com/software-enablement/141-caches-and-self-modifying-code/
+#if defined(__linux__) && !defined(ANDROID)
+  extern void __clear_cache(char*, char*);
+  char* beg = reinterpret_cast<char*>(start);
+  char* end = reinterpret_cast<char*>(start + size);
+  ::__clear_cache(beg, end);
+#elif defined(ANDROID)
+  cacheflush(start, start + size, 0);
+#else
+#error FlushICache only tested/supported on Linux and Android
+#endif
 #endif
 }
 
@@ -113,9 +121,9 @@
 const char* CPU::Id() {
   return
 #if defined(USING_SIMULATOR)
-  "sim"
+      "sim"
 #endif  // defined(USING_SIMULATOR)
-  "arm";
+      "arm";
 }
 
 
@@ -159,7 +167,9 @@
   // Check for ARMv5TE, ARMv6, ARMv7, or aarch64.
   // It can be in either the Processor or Model information fields.
   if (CpuInfo::FieldContains(kCpuInfoProcessor, "aarch64") ||
-      CpuInfo::FieldContains(kCpuInfoModel, "aarch64")) {
+      CpuInfo::FieldContains(kCpuInfoModel, "aarch64") ||
+      CpuInfo::FieldContains(kCpuInfoArchitecture, "8") ||
+      CpuInfo::FieldContains(kCpuInfoArchitecture, "AArch64")) {
     // pretend that this arm64 cpu is really an ARMv7
     arm_version_ = ARMv7;
     is_arm64 = true;
@@ -197,24 +207,27 @@
   // - Qualcomm Krait CPUs (QCT APQ8064) in Nexus 4 and 7 incorrectly report
   //   that they lack integer division.
   // - Marvell Armada 370/XP incorrectly reports that it has integer division.
+  // - Qualcomm Snapdragon 820/821 CPUs (MSM 8996 and MSM8996pro) in Xiaomi MI5
+  // and Pixel lack integer division even though ARMv8 requires it in A32.
   bool is_krait = CpuInfo::FieldContains(kCpuInfoHardware, "QCT APQ8064");
   bool is_armada_370xp =
       CpuInfo::FieldContains(kCpuInfoHardware, "Marvell Armada 370/XP");
+  bool is_snapdragon = CpuInfo::FieldContains(kCpuInfoHardware, "MSM8996");
   if (is_krait) {
     integer_division_supported_ = FLAG_use_integer_division;
-  } else if (!is_armada_370xp) {
+  } else if (is_armada_370xp || is_snapdragon) {
+    integer_division_supported_ = false;
+  } else {
     integer_division_supported_ =
         (CpuInfo::FieldContains(kCpuInfoFeatures, "idiva") || is_arm64) &&
         FLAG_use_integer_division;
-  } else {
-    integer_division_supported_ = false;
   }
   neon_supported_ =
       (CpuInfo::FieldContains(kCpuInfoFeatures, "neon") || is_arm64) &&
       FLAG_use_vfp && FLAG_use_neon;
 
-  // Use the cross-compiler's predefined macros to determine whether we should
-  // use the hard or soft float ABI.
+// Use the cross-compiler's predefined macros to determine whether we should
+// use the hard or soft float ABI.
 #if defined(__ARM_PCS_VFP)
   hardfp_supported_ = true;
 #else
diff --git a/runtime/vm/cpu_arm.h b/runtime/vm/cpu_arm.h
index e1dd907..8e7c4aad 100644
--- a/runtime/vm/cpu_arm.h
+++ b/runtime/vm/cpu_arm.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_CPU_ARM_H_
-#define VM_CPU_ARM_H_
+#ifndef RUNTIME_VM_CPU_ARM_H_
+#define RUNTIME_VM_CPU_ARM_H_
 
 #include "vm/allocation.h"
 #include "vm/simulator.h"
@@ -25,7 +25,7 @@
   ARMvUnknown,
 };
 
-class HostCPUFeatures: public AllStatic {
+class HostCPUFeatures : public AllStatic {
  public:
   static void InitOnce();
   static void Cleanup();
@@ -92,36 +92,20 @@
 
 class TargetCPUFeatures : public AllStatic {
  public:
-  static void InitOnce() {
-    HostCPUFeatures::InitOnce();
-  }
-  static void Cleanup() {
-    HostCPUFeatures::Cleanup();
-  }
-  static bool double_truncate_round_supported() {
-    return false;
-  }
+  static void InitOnce() { HostCPUFeatures::InitOnce(); }
+  static void Cleanup() { HostCPUFeatures::Cleanup(); }
+  static bool double_truncate_round_supported() { return false; }
   static bool integer_division_supported() {
     return HostCPUFeatures::integer_division_supported();
   }
-  static bool vfp_supported() {
-    return HostCPUFeatures::vfp_supported();
-  }
+  static bool vfp_supported() { return HostCPUFeatures::vfp_supported(); }
   static bool can_divide() {
     return integer_division_supported() || vfp_supported();
   }
-  static bool neon_supported() {
-    return HostCPUFeatures::neon_supported();
-  }
-  static bool hardfp_supported() {
-    return HostCPUFeatures::hardfp_supported();
-  }
-  static const char* hardware() {
-    return HostCPUFeatures::hardware();
-  }
-  static ARMVersion arm_version() {
-    return HostCPUFeatures::arm_version();
-  }
+  static bool neon_supported() { return HostCPUFeatures::neon_supported(); }
+  static bool hardfp_supported() { return HostCPUFeatures::hardfp_supported(); }
+  static const char* hardware() { return HostCPUFeatures::hardware(); }
+  static ARMVersion arm_version() { return HostCPUFeatures::arm_version(); }
   static intptr_t store_pc_read_offset() {
     return HostCPUFeatures::store_pc_read_offset();
   }
@@ -129,4 +113,4 @@
 
 }  // namespace dart
 
-#endif  // VM_CPU_ARM_H_
+#endif  // RUNTIME_VM_CPU_ARM_H_
diff --git a/runtime/vm/cpu_arm64.cc b/runtime/vm/cpu_arm64.cc
index e612cce..a5e3049 100644
--- a/runtime/vm/cpu_arm64.cc
+++ b/runtime/vm/cpu_arm64.cc
@@ -12,8 +12,8 @@
 #include "vm/simulator.h"
 
 #if !defined(USING_SIMULATOR)
-#include <sys/syscall.h>  /* NOLINT */
-#include <unistd.h>  /* NOLINT */
+#include <sys/syscall.h> /* NOLINT */
+#include <unistd.h>      /* NOLINT */
 #endif
 
 namespace dart {
@@ -30,18 +30,17 @@
     return;
   }
 
-  // ARM recommends using the gcc intrinsic __clear_cache on Linux and Android.
-  // blogs.arm.com/software-enablement/141-caches-and-self-modifying-code/
-  #if defined(TARGET_OS_ANDROID) || \
-      defined(TARGET_OS_FUCHSIA) || \
-      defined(TARGET_OS_LINUX)
-    extern void __clear_cache(char*, char*);
-    char* beg = reinterpret_cast<char*>(start);
-    char* end = reinterpret_cast<char*>(start + size);
-    ::__clear_cache(beg, end);
-  #else
-    #error FlushICache only tested/supported on Android, Fuchsia, and Linux
-  #endif
+// ARM recommends using the gcc intrinsic __clear_cache on Linux and Android.
+// blogs.arm.com/software-enablement/141-caches-and-self-modifying-code/
+#if defined(TARGET_OS_ANDROID) || defined(TARGET_OS_FUCHSIA) ||                \
+    defined(TARGET_OS_LINUX)
+  extern void __clear_cache(char*, char*);
+  char* beg = reinterpret_cast<char*>(start);
+  char* end = reinterpret_cast<char*>(start + size);
+  ::__clear_cache(beg, end);
+#else
+#error FlushICache only tested/supported on Android, Fuchsia, and Linux
+#endif
 
 #endif
 }
@@ -50,9 +49,9 @@
 const char* CPU::Id() {
   return
 #if defined(USING_SIMULATOR)
-  "sim"
+      "sim"
 #endif  // !defined(HOST_ARCH_ARM64)
-  "arm64";
+      "arm64";
 }
 
 
diff --git a/runtime/vm/cpu_arm64.h b/runtime/vm/cpu_arm64.h
index 884981b..df920d3 100644
--- a/runtime/vm/cpu_arm64.h
+++ b/runtime/vm/cpu_arm64.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_CPU_ARM64_H_
-#define VM_CPU_ARM64_H_
+#ifndef RUNTIME_VM_CPU_ARM64_H_
+#define RUNTIME_VM_CPU_ARM64_H_
 
 #include "vm/allocation.h"
 #include "vm/simulator.h"
@@ -18,7 +18,7 @@
 // additionally mock the options needed for the target architecture so that
 // they may be altered for testing.
 
-class HostCPUFeatures: public AllStatic {
+class HostCPUFeatures : public AllStatic {
  public:
   static void InitOnce();
   static void Cleanup();
@@ -36,20 +36,12 @@
 
 class TargetCPUFeatures : public AllStatic {
  public:
-  static void InitOnce() {
-    HostCPUFeatures::InitOnce();
-  }
-  static void Cleanup() {
-    HostCPUFeatures::Cleanup();
-  }
-  static const char* hardware() {
-    return HostCPUFeatures::hardware();
-  }
-  static bool double_truncate_round_supported() {
-    return false;
-  }
+  static void InitOnce() { HostCPUFeatures::InitOnce(); }
+  static void Cleanup() { HostCPUFeatures::Cleanup(); }
+  static const char* hardware() { return HostCPUFeatures::hardware(); }
+  static bool double_truncate_round_supported() { return false; }
 };
 
 }  // namespace dart
 
-#endif  // VM_CPU_ARM64_H_
+#endif  // RUNTIME_VM_CPU_ARM64_H_
diff --git a/runtime/vm/cpu_dbc.h b/runtime/vm/cpu_dbc.h
index 486acdb..a5cf4ee 100644
--- a/runtime/vm/cpu_dbc.h
+++ b/runtime/vm/cpu_dbc.h
@@ -2,15 +2,15 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_CPU_DBC_H_
-#define VM_CPU_DBC_H_
+#ifndef RUNTIME_VM_CPU_DBC_H_
+#define RUNTIME_VM_CPU_DBC_H_
 
 #include "vm/allocation.h"
 #include "vm/simulator.h"
 
 namespace dart {
 
-class HostCPUFeatures: public AllStatic {
+class HostCPUFeatures : public AllStatic {
  public:
   static void InitOnce();
   static void Cleanup();
@@ -29,22 +29,14 @@
 
 class TargetCPUFeatures : public AllStatic {
  public:
-  static void InitOnce() {
-    HostCPUFeatures::InitOnce();
-  }
-  static void Cleanup() {
-    HostCPUFeatures::Cleanup();
-  }
+  static void InitOnce() { HostCPUFeatures::InitOnce(); }
+  static void Cleanup() { HostCPUFeatures::Cleanup(); }
 
-  static const char* hardware() {
-    return CPU::Id();
-  }
+  static const char* hardware() { return CPU::Id(); }
 
-  static bool double_truncate_round_supported() {
-    return true;
-  }
+  static bool double_truncate_round_supported() { return true; }
 };
 
 }  // namespace dart
 
-#endif  // VM_CPU_DBC_H_
+#endif  // RUNTIME_VM_CPU_DBC_H_
diff --git a/runtime/vm/cpu_ia32.cc b/runtime/vm/cpu_ia32.cc
index 5445b48..a5f02c2 100644
--- a/runtime/vm/cpu_ia32.cc
+++ b/runtime/vm/cpu_ia32.cc
@@ -6,6 +6,7 @@
 #if defined(TARGET_ARCH_IA32)
 
 #include "vm/cpu.h"
+#include "vm/cpu_ia32.h"
 
 #include "vm/assembler.h"
 #include "vm/constants_ia32.h"
@@ -40,9 +41,8 @@
 
   hardware_ = CpuInfo::GetCpuModel();
   sse2_supported_ = CpuInfo::FieldContains(kCpuInfoFeatures, "sse2");
-  sse4_1_supported_ =
-      CpuInfo::FieldContains(kCpuInfoFeatures, "sse4_1") ||
-      CpuInfo::FieldContains(kCpuInfoFeatures, "sse4.1");
+  sse4_1_supported_ = CpuInfo::FieldContains(kCpuInfoFeatures, "sse4_1") ||
+                      CpuInfo::FieldContains(kCpuInfoFeatures, "sse4.1");
 
 #if defined(DEBUG)
   initialized_ = true;
diff --git a/runtime/vm/cpu_ia32.h b/runtime/vm/cpu_ia32.h
index 66f4724..3c8d7af 100644
--- a/runtime/vm/cpu_ia32.h
+++ b/runtime/vm/cpu_ia32.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_CPU_IA32_H_
-#define VM_CPU_IA32_H_
+#ifndef RUNTIME_VM_CPU_IA32_H_
+#define RUNTIME_VM_CPU_IA32_H_
 
 #include "vm/allocation.h"
 #include "vm/flags.h"
@@ -42,26 +42,14 @@
 
 class TargetCPUFeatures : public AllStatic {
  public:
-  static void InitOnce() {
-    HostCPUFeatures::InitOnce();
-  }
-  static void Cleanup() {
-    HostCPUFeatures::Cleanup();
-  }
-  static const char* hardware() {
-    return HostCPUFeatures::hardware();
-  }
-  static bool sse2_supported() {
-    return HostCPUFeatures::sse2_supported();
-  }
-  static bool sse4_1_supported() {
-    return HostCPUFeatures::sse4_1_supported();
-  }
-  static bool double_truncate_round_supported() {
-    return sse4_1_supported();
-  }
+  static void InitOnce() { HostCPUFeatures::InitOnce(); }
+  static void Cleanup() { HostCPUFeatures::Cleanup(); }
+  static const char* hardware() { return HostCPUFeatures::hardware(); }
+  static bool sse2_supported() { return HostCPUFeatures::sse2_supported(); }
+  static bool sse4_1_supported() { return HostCPUFeatures::sse4_1_supported(); }
+  static bool double_truncate_round_supported() { return sse4_1_supported(); }
 };
 
 }  // namespace dart
 
-#endif  // VM_CPU_IA32_H_
+#endif  // RUNTIME_VM_CPU_IA32_H_
diff --git a/runtime/vm/cpu_mips.cc b/runtime/vm/cpu_mips.cc
index 5b97d32..902f59c 100644
--- a/runtime/vm/cpu_mips.cc
+++ b/runtime/vm/cpu_mips.cc
@@ -3,17 +3,18 @@
 // BSD-style license that can be found in the LICENSE file.
 
 #include "vm/globals.h"
-
 #if defined(TARGET_ARCH_MIPS)
 
 #include "vm/cpu.h"
+#include "vm/cpu_mips.h"
+
 #include "vm/cpuinfo.h"
 #include "vm/simulator.h"
 
 #if !defined(USING_SIMULATOR)
 #include <asm/cachectl.h> /* NOLINT */
 #include <sys/syscall.h>  /* NOLINT */
-#include <unistd.h>  /* NOLINT */
+#include <unistd.h>       /* NOLINT */
 #endif
 
 namespace dart {
@@ -24,9 +25,9 @@
   // See http://www.linux-mips.org/wiki/Cacheflush_Syscall.
   res = syscall(__NR_cacheflush, start, size, ICACHE);
   ASSERT(res == 0);
-#else  // defined(HOST_ARCH_MIPS)
-  // When running in simulated mode we do not need to flush the ICache because
-  // we are not running on the actual hardware.
+#else   // defined(HOST_ARCH_MIPS)
+// When running in simulated mode we do not need to flush the ICache because
+// we are not running on the actual hardware.
 #endif  // defined(HOST_ARCH_MIPS)
 }
 
@@ -34,9 +35,9 @@
 const char* CPU::Id() {
   return
 #if defined(USING_SIMULATOR)
-  "sim"
+      "sim"
 #endif  // !defined(HOST_ARCH_MIPS)
-  "mips";
+      "mips";
 }
 
 
@@ -54,8 +55,8 @@
   // Has a floating point unit.
   ASSERT(CpuInfo::FieldContains(kCpuInfoModel, "FPU"));
 
-  // We want to know the ISA version, but on MIPS, CpuInfo can't tell us, so
-  // we use the same ISA version that Dart's C++ compiler targeted.
+// We want to know the ISA version, but on MIPS, CpuInfo can't tell us, so
+// we use the same ISA version that Dart's C++ compiler targeted.
 #if defined(_MIPS_ARCH_MIPS32R2)
   mips_version_ = MIPS32r2;
 #elif defined(_MIPS_ARCH_MIPS32)
diff --git a/runtime/vm/cpu_mips.h b/runtime/vm/cpu_mips.h
index d511522..8af35b8 100644
--- a/runtime/vm/cpu_mips.h
+++ b/runtime/vm/cpu_mips.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_CPU_MIPS_H_
-#define VM_CPU_MIPS_H_
+#ifndef RUNTIME_VM_CPU_MIPS_H_
+#define RUNTIME_VM_CPU_MIPS_H_
 
 #include "vm/allocation.h"
 
@@ -23,7 +23,7 @@
   MIPSvUnknown,
 };
 
-class HostCPUFeatures: public AllStatic {
+class HostCPUFeatures : public AllStatic {
  public:
   static void InitOnce();
   static void Cleanup();
@@ -46,23 +46,13 @@
 
 class TargetCPUFeatures : public AllStatic {
  public:
-  static void InitOnce() {
-    HostCPUFeatures::InitOnce();
-  }
-  static void Cleanup() {
-    HostCPUFeatures::Cleanup();
-  }
-  static const char* hardware() {
-    return HostCPUFeatures::hardware();
-  }
-  static bool double_truncate_round_supported() {
-    return false;
-  }
-  static MIPSVersion mips_version() {
-    return HostCPUFeatures::mips_version();
-  }
+  static void InitOnce() { HostCPUFeatures::InitOnce(); }
+  static void Cleanup() { HostCPUFeatures::Cleanup(); }
+  static const char* hardware() { return HostCPUFeatures::hardware(); }
+  static bool double_truncate_round_supported() { return false; }
+  static MIPSVersion mips_version() { return HostCPUFeatures::mips_version(); }
 };
 
 }  // namespace dart
 
-#endif  // VM_CPU_MIPS_H_
+#endif  // RUNTIME_VM_CPU_MIPS_H_
diff --git a/runtime/vm/cpu_test.cc b/runtime/vm/cpu_test.cc
index 7ffbe6f..3b13c0f 100644
--- a/runtime/vm/cpu_test.cc
+++ b/runtime/vm/cpu_test.cc
@@ -17,19 +17,19 @@
 #elif defined(TARGET_ARCH_ARM)
 #if defined(HOST_ARCH_ARM)
   EXPECT_STREQ("arm", CPU::Id());
-#else  // defined(HOST_ARCH_ARM)
+#else   // defined(HOST_ARCH_ARM)
   EXPECT_STREQ("simarm", CPU::Id());
 #endif  // defined(HOST_ARCH_ARM)
 #elif defined(TARGET_ARCH_ARM64)
 #if defined(HOST_ARCH_ARM64)
   EXPECT_STREQ("arm64", CPU::Id());
-#else  // defined(HOST_ARCH_ARM64)
+#else   // defined(HOST_ARCH_ARM64)
   EXPECT_STREQ("simarm64", CPU::Id());
 #endif  // defined(HOST_ARCH_ARM64)
 #elif defined(TARGET_ARCH_MIPS)
 #if defined(HOST_ARCH_MIPS)
   EXPECT_STREQ("mips", CPU::Id());
-#else  // defined(HOST_ARCH_MIPS)
+#else   // defined(HOST_ARCH_MIPS)
   EXPECT_STREQ("simmips", CPU::Id());
 #endif  // defined(HOST_ARCH_MIPS)
 #elif defined(TARGET_ARCH_DBC)
diff --git a/runtime/vm/cpu_x64.cc b/runtime/vm/cpu_x64.cc
index 073ce84..72b3478 100644
--- a/runtime/vm/cpu_x64.cc
+++ b/runtime/vm/cpu_x64.cc
@@ -3,10 +3,10 @@
 // BSD-style license that can be found in the LICENSE file.
 
 #include "vm/globals.h"
-
 #if defined(TARGET_ARCH_X64)
 
 #include "vm/cpu.h"
+#include "vm/cpu_x64.h"
 
 #include "vm/assembler.h"
 #include "vm/constants_x64.h"
@@ -40,9 +40,8 @@
 void HostCPUFeatures::InitOnce() {
   CpuInfo::InitOnce();
   hardware_ = CpuInfo::GetCpuModel();
-  sse4_1_supported_ =
-      CpuInfo::FieldContains(kCpuInfoFeatures, "sse4_1") ||
-      CpuInfo::FieldContains(kCpuInfoFeatures, "sse4.1");
+  sse4_1_supported_ = CpuInfo::FieldContains(kCpuInfoFeatures, "sse4_1") ||
+                      CpuInfo::FieldContains(kCpuInfoFeatures, "sse4.1");
 
 #if defined(DEBUG)
   initialized_ = true;
diff --git a/runtime/vm/cpu_x64.h b/runtime/vm/cpu_x64.h
index 579650a..3e70fce 100644
--- a/runtime/vm/cpu_x64.h
+++ b/runtime/vm/cpu_x64.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_CPU_X64_H_
-#define VM_CPU_X64_H_
+#ifndef RUNTIME_VM_CPU_X64_H_
+#define RUNTIME_VM_CPU_X64_H_
 
 #include "vm/allocation.h"
 #include "vm/flags.h"
@@ -42,26 +42,14 @@
 
 class TargetCPUFeatures : public AllStatic {
  public:
-  static void InitOnce() {
-    HostCPUFeatures::InitOnce();
-  }
-  static void Cleanup() {
-    HostCPUFeatures::Cleanup();
-  }
-  static const char* hardware() {
-    return HostCPUFeatures::hardware();
-  }
-  static bool sse2_supported() {
-    return HostCPUFeatures::sse2_supported();
-  }
-  static bool sse4_1_supported() {
-    return HostCPUFeatures::sse4_1_supported();
-  }
-  static bool double_truncate_round_supported() {
-    return false;
-  }
+  static void InitOnce() { HostCPUFeatures::InitOnce(); }
+  static void Cleanup() { HostCPUFeatures::Cleanup(); }
+  static const char* hardware() { return HostCPUFeatures::hardware(); }
+  static bool sse2_supported() { return HostCPUFeatures::sse2_supported(); }
+  static bool sse4_1_supported() { return HostCPUFeatures::sse4_1_supported(); }
+  static bool double_truncate_round_supported() { return false; }
 };
 
 }  // namespace dart
 
-#endif  // VM_CPU_X64_H_
+#endif  // RUNTIME_VM_CPU_X64_H_
diff --git a/runtime/vm/cpuid.h b/runtime/vm/cpuid.h
index b33812e..63b317b 100644
--- a/runtime/vm/cpuid.h
+++ b/runtime/vm/cpuid.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_CPUID_H_
-#define VM_CPUID_H_
+#ifndef RUNTIME_VM_CPUID_H_
+#define RUNTIME_VM_CPUID_H_
 
 #include "vm/globals.h"
 #if !defined(TARGET_OS_MACOS)
@@ -45,4 +45,4 @@
 }  // namespace dart
 
 #endif  // !defined(TARGET_OS_MACOS)
-#endif  // VM_CPUID_H_
+#endif  // RUNTIME_VM_CPUID_H_
diff --git a/runtime/vm/cpuinfo.h b/runtime/vm/cpuinfo.h
index 95b6ec3..89e2432 100644
--- a/runtime/vm/cpuinfo.h
+++ b/runtime/vm/cpuinfo.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_CPUINFO_H_
-#define VM_CPUINFO_H_
+#ifndef RUNTIME_VM_CPUINFO_H_
+#define RUNTIME_VM_CPUINFO_H_
 
 #include "platform/assert.h"
 #include "vm/allocation.h"
@@ -16,7 +16,8 @@
   kCpuInfoModel = 1,
   kCpuInfoHardware = 2,
   kCpuInfoFeatures = 3,
-  kCpuInfoMax = 4,
+  kCpuInfoArchitecture = 4,
+  kCpuInfoMax = 5,
 };
 
 // For Intel architectures, the method to use to get CPU information.
@@ -72,4 +73,4 @@
 
 }  // namespace dart
 
-#endif  // VM_CPUINFO_H_
+#endif  // RUNTIME_VM_CPUINFO_H_
diff --git a/runtime/vm/cpuinfo_android.cc b/runtime/vm/cpuinfo_android.cc
index 1e4229c..077de16 100644
--- a/runtime/vm/cpuinfo_android.cc
+++ b/runtime/vm/cpuinfo_android.cc
@@ -25,16 +25,19 @@
   fields_[kCpuInfoModel] = "model name";
   fields_[kCpuInfoHardware] = "model name";
   fields_[kCpuInfoFeatures] = "flags";
+  fields_[kCpuInfoArchitecture] = "CPU architecture";
 #elif defined(HOST_ARCH_ARM) || defined(HOST_ARCH_ARM64)
   fields_[kCpuInfoProcessor] = "Processor";
   fields_[kCpuInfoModel] = "model name";
   fields_[kCpuInfoHardware] = "Hardware";
   fields_[kCpuInfoFeatures] = "Features";
+  fields_[kCpuInfoArchitecture] = "CPU architecture";
 #elif defined(HOST_ARCH_MIPS)
   fields_[kCpuInfoProcessor] = "system type";
   fields_[kCpuInfoModel] = "cpu model";
   fields_[kCpuInfoHardware] = "cpu model";
   fields_[kCpuInfoFeatures] = "ASEs implemented";
+  fields_[kCpuInfoArchitecture] = "CPU architecture";
 #else
 #error Unrecognized target architecture
 #endif
diff --git a/runtime/vm/cpuinfo_fuchsia.cc b/runtime/vm/cpuinfo_fuchsia.cc
index ad9e990..a46f842 100644
--- a/runtime/vm/cpuinfo_fuchsia.cc
+++ b/runtime/vm/cpuinfo_fuchsia.cc
@@ -16,7 +16,7 @@
 const char* CpuInfo::fields_[kCpuInfoMax] = {0};
 
 void CpuInfo::InitOnce() {
-  // TODO(zra): Add support for HOST_ARCH_ARM64
+// TODO(zra): Add support for HOST_ARCH_ARM64
 #if defined(HOST_ARCH_IA32) || defined(HOST_ARCH_X64)
   method_ = kCpuInfoCpuId;
 
@@ -27,6 +27,7 @@
   fields_[kCpuInfoModel] = "Hardware";
   fields_[kCpuInfoHardware] = "Hardware";
   fields_[kCpuInfoFeatures] = "Features";
+  fields_[kCpuInfoArchitecture] = "CPU architecture";
 #endif
 }
 
diff --git a/runtime/vm/cpuinfo_linux.cc b/runtime/vm/cpuinfo_linux.cc
index 8d76233..6f47be0 100644
--- a/runtime/vm/cpuinfo_linux.cc
+++ b/runtime/vm/cpuinfo_linux.cc
@@ -26,6 +26,7 @@
   fields_[kCpuInfoModel] = "model name";
   fields_[kCpuInfoHardware] = "model name";
   fields_[kCpuInfoFeatures] = "flags";
+  fields_[kCpuInfoArchitecture] = "CPU architecture";
   method_ = kCpuInfoCpuId;
   CpuId::InitOnce();
 #elif defined(HOST_ARCH_ARM)
@@ -33,6 +34,7 @@
   fields_[kCpuInfoModel] = "model name";
   fields_[kCpuInfoHardware] = "Hardware";
   fields_[kCpuInfoFeatures] = "Features";
+  fields_[kCpuInfoArchitecture] = "CPU architecture";
   method_ = kCpuInfoSystem;
   ProcCpuInfo::InitOnce();
 #elif defined(HOST_ARCH_ARM64)
@@ -40,6 +42,7 @@
   fields_[kCpuInfoModel] = "CPU implementer";
   fields_[kCpuInfoHardware] = "CPU implementer";
   fields_[kCpuInfoFeatures] = "Features";
+  fields_[kCpuInfoArchitecture] = "CPU architecture";
   method_ = kCpuInfoSystem;
   ProcCpuInfo::InitOnce();
 #elif defined(HOST_ARCH_MIPS)
@@ -47,6 +50,7 @@
   fields_[kCpuInfoModel] = "cpu model";
   fields_[kCpuInfoHardware] = "cpu model";
   fields_[kCpuInfoFeatures] = "ASEs implemented";
+  fields_[kCpuInfoArchitecture] = "CPU architecture";
   method_ = kCpuInfoSystem;
   ProcCpuInfo::InitOnce();
 #else
diff --git a/runtime/vm/cpuinfo_macos.cc b/runtime/vm/cpuinfo_macos.cc
index eef06d9..f878a5b 100644
--- a/runtime/vm/cpuinfo_macos.cc
+++ b/runtime/vm/cpuinfo_macos.cc
@@ -7,8 +7,8 @@
 
 #include "vm/cpuinfo.h"
 
-#include <errno.h>  // NOLINT
-#include <sys/types.h>  // NOLINT
+#include <errno.h>       // NOLINT
+#include <sys/types.h>   // NOLINT
 #include <sys/sysctl.h>  // NOLINT
 
 #include "platform/assert.h"
@@ -25,6 +25,7 @@
   fields_[kCpuInfoModel] = "machdep.cpu.brand_string";
   fields_[kCpuInfoHardware] = "machdep.cpu.brand_string";
   fields_[kCpuInfoFeatures] = "machdep.cpu.features";
+  fields_[kCpuInfoArchitecture] = NULL;
 }
 
 
diff --git a/runtime/vm/cpuinfo_win.cc b/runtime/vm/cpuinfo_win.cc
index 1570af7..6f18a35 100644
--- a/runtime/vm/cpuinfo_win.cc
+++ b/runtime/vm/cpuinfo_win.cc
@@ -29,6 +29,7 @@
   fields_[kCpuInfoModel] = "Hardware";
   fields_[kCpuInfoHardware] = "Hardware";
   fields_[kCpuInfoFeatures] = "Features";
+  fields_[kCpuInfoArchitecture] = NULL;
 }
 
 
diff --git a/runtime/vm/custom_isolate_test.cc b/runtime/vm/custom_isolate_test.cc
index 1f55a8e..cf4c8fa 100644
--- a/runtime/vm/custom_isolate_test.cc
+++ b/runtime/vm/custom_isolate_test.cc
@@ -99,9 +99,7 @@
 // A simple event queue for our test.
 class EventQueue {
  public:
-  EventQueue() {
-    head_ = NULL;
-  }
+  EventQueue() { head_ = NULL; }
 
   void Add(Event* event) {
     if (head_ == NULL) {
@@ -163,6 +161,7 @@
       : Event(isolate), main_(main) {}
 
   virtual void Process();
+
  private:
   const char* main_;
 };
@@ -193,8 +192,7 @@
  public:
   explicit MessageEvent(Dart_Isolate isolate) : Event(isolate) {}
 
-  ~MessageEvent() {
-  }
+  ~MessageEvent() {}
 
   virtual void Process();
 };
@@ -289,8 +287,8 @@
   // Reload all the test classes here.
   //
   // TODO(turnidge): Use the create isolate callback instead?
-  Dart_Handle lib = TestCase::LoadTestScript(kCustomIsolateScriptChars,
-                                             NativeLookup);
+  Dart_Handle lib =
+      TestCase::LoadTestScript(kCustomIsolateScriptChars, NativeLookup);
   EXPECT_VALID(lib);
 
   Dart_Handle main_send_port = Dart_GetField(lib, NewString("mainSendPort"));
@@ -323,10 +321,6 @@
   FLAG_verify_handles = true;
 #ifdef DEBUG
   FLAG_verify_on_transition = true;
-  // Cannot verify heap while running compilation in background. Issue #26149.
-  FLAG_background_compilation = false;
-  // Issue #26150.
-  FLAG_use_osr = false;
 #endif
   event_queue = new EventQueue();
 
@@ -337,8 +331,8 @@
   Dart_Handle result;
 
   // Create a test library.
-  Dart_Handle lib = TestCase::LoadTestScript(kCustomIsolateScriptChars,
-                                             NativeLookup);
+  Dart_Handle lib =
+      TestCase::LoadTestScript(kCustomIsolateScriptChars, NativeLookup);
   EXPECT_VALID(lib);
 
   // Run main.
diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc
index 05d8d14..07547de 100644
--- a/runtime/vm/dart.cc
+++ b/runtime/vm/dart.cc
@@ -39,8 +39,7 @@
 
 DECLARE_FLAG(bool, print_class_table);
 DECLARE_FLAG(bool, trace_time_all);
-DEFINE_FLAG(bool, keep_code, false,
-            "Keep deoptimized code for profiling.");
+DEFINE_FLAG(bool, keep_code, false, "Keep deoptimized code for profiling.");
 DEFINE_FLAG(bool, trace_shutdown, false, "Trace VM shutdown on stderr");
 
 Isolate* Dart::vm_isolate_ = NULL;
@@ -71,7 +70,7 @@
 // have unintended consequences.
 class ReadOnlyHandles {
  public:
-  ReadOnlyHandles() { }
+  ReadOnlyHandles() {}
 
  private:
   VMHandles handles_;
@@ -86,36 +85,36 @@
 #define CHECK_OFFSET(expr, offset)                                             \
   if ((expr) != (offset)) {                                                    \
     FATAL2("%s == %" Pd, #expr, (expr));                                       \
-  }                                                                            \
+  }
 
 #if defined(TARGET_ARCH_ARM)
   // These offsets are embedded in precompiled instructions. We need simarm
   // (compiler) and arm (runtime) to agree.
   CHECK_OFFSET(Heap::TopOffset(Heap::kNew), 8);
-  CHECK_OFFSET(Isolate::heap_offset(), 8);
   CHECK_OFFSET(Thread::stack_limit_offset(), 4);
   CHECK_OFFSET(Thread::object_null_offset(), 36);
   CHECK_OFFSET(SingleTargetCache::upper_limit_offset(), 14);
+  CHECK_OFFSET(Isolate::object_store_offset(), 28);
   NOT_IN_PRODUCT(CHECK_OFFSET(sizeof(ClassHeapStats), 120));
 #endif
 #if defined(TARGET_ARCH_MIPS)
   // These offsets are embedded in precompiled instructions. We need simmips
   // (compiler) and mips (runtime) to agree.
   CHECK_OFFSET(Heap::TopOffset(Heap::kNew), 8);
-  CHECK_OFFSET(Isolate::heap_offset(), 8);
   CHECK_OFFSET(Thread::stack_limit_offset(), 4);
   CHECK_OFFSET(Thread::object_null_offset(), 36);
   CHECK_OFFSET(SingleTargetCache::upper_limit_offset(), 14);
+  CHECK_OFFSET(Isolate::object_store_offset(), 28);
   NOT_IN_PRODUCT(CHECK_OFFSET(sizeof(ClassHeapStats), 120));
 #endif
 #if defined(TARGET_ARCH_ARM64)
   // These offsets are embedded in precompiled instructions. We need simarm64
   // (compiler) and arm64 (runtime) to agree.
   CHECK_OFFSET(Heap::TopOffset(Heap::kNew), 8);
-  CHECK_OFFSET(Isolate::heap_offset(), 16);
   CHECK_OFFSET(Thread::stack_limit_offset(), 8);
   CHECK_OFFSET(Thread::object_null_offset(), 72);
   CHECK_OFFSET(SingleTargetCache::upper_limit_offset(), 28);
+  CHECK_OFFSET(Isolate::object_store_offset(), 56);
   NOT_IN_PRODUCT(CHECK_OFFSET(sizeof(ClassHeapStats), 208));
 #endif
 #undef CHECK_OFFSET
@@ -148,8 +147,8 @@
   if (FLAG_support_timeline) {
     Timeline::InitOnce();
   }
-  NOT_IN_PRODUCT(TimelineDurationScope tds(Timeline::GetVMStream(),
-                                           "Dart::InitOnce"));
+  NOT_IN_PRODUCT(
+      TimelineDurationScope tds(Timeline::GetVMStream(), "Dart::InitOnce"));
   Isolate::InitOnce();
   PortMap::InitOnce();
   FreeListElement::InitOnce();
@@ -241,24 +240,23 @@
       } else {
         return strdup("Invalid vm isolate snapshot seen");
       }
-      VmIsolateSnapshotReader reader(snapshot->kind(),
-                                     snapshot->content(),
-                                     snapshot->length(),
-                                     instructions_snapshot,
-                                     data_snapshot,
-                                     T);
+      VmIsolateSnapshotReader reader(snapshot->kind(), snapshot->content(),
+                                     snapshot->length(), instructions_snapshot,
+                                     data_snapshot, T);
       const Error& error = Error::Handle(reader.ReadVmIsolateSnapshot());
       if (!error.IsNull()) {
         // Must copy before leaving the zone.
         return strdup(error.ToErrorCString());
       }
-      NOT_IN_PRODUCT(if (tds.enabled()) {
+#if !defined(PRODUCT)
+      if (tds.enabled()) {
         tds.SetNumArguments(2);
         tds.FormatArgument(0, "snapshotSize", "%" Pd, snapshot->length());
-        tds.FormatArgument(1, "heapSize", "%" Pd64,
-                           vm_isolate_->heap()->UsedInWords(Heap::kOld) *
-                           kWordSize);
-      });
+        tds.FormatArgument(
+            1, "heapSize", "%" Pd64,
+            vm_isolate_->heap()->UsedInWords(Heap::kOld) * kWordSize);
+      }
+#endif  // !defined(PRODUCT)
       if (FLAG_trace_isolates) {
         OS::Print("Size of vm isolate snapshot = %" Pd "\n",
                   snapshot->length());
@@ -273,6 +271,8 @@
     } else {
 #if defined(DART_PRECOMPILED_RUNTIME)
       return strdup("Precompiled runtime requires a precompiled snapshot");
+#elif !defined(DART_NO_SNAPSHOT)
+      return strdup("Missing vm isolate snapshot");
 #else
       snapshot_kind_ = Snapshot::kNone;
       StubCode::InitOnce();
@@ -353,8 +353,7 @@
   }
 
   if (FLAG_trace_shutdown) {
-    OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Starting shutdown\n",
-                 timestamp());
+    OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Starting shutdown\n", timestamp());
   }
 
   if (FLAG_profiler) {
@@ -461,8 +460,7 @@
   OSThread::SetCurrent(NULL);
   delete os_thread;
   if (FLAG_trace_shutdown) {
-    OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Deleted os_thread\n",
-                 timestamp());
+    OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Deleted os_thread\n", timestamp());
   }
 
   if (FLAG_trace_shutdown) {
@@ -493,76 +491,85 @@
 }
 
 
-RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) {
+RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer,
+                                  intptr_t snapshot_length,
+                                  kernel::Program* kernel_program,
+                                  void* data) {
   // Initialize the new isolate.
   Thread* T = Thread::Current();
   Isolate* I = T->isolate();
-  NOT_IN_PRODUCT(
-    TimelineDurationScope tds(T,
-                              Timeline::GetIsolateStream(),
-                              "InitializeIsolate");
-    tds.SetNumArguments(1);
-    tds.CopyArgument(0, "isolateName", I->name());
-  )
+  NOT_IN_PRODUCT(TimelineDurationScope tds(T, Timeline::GetIsolateStream(),
+                                           "InitializeIsolate");
+                 tds.SetNumArguments(1);
+                 tds.CopyArgument(0, "isolateName", I->name());)
   ASSERT(I != NULL);
   StackZone zone(T);
   HandleScope handle_scope(T);
   {
-    NOT_IN_PRODUCT(TimelineDurationScope tds(T,
-        Timeline::GetIsolateStream(), "ObjectStore::Init"));
+    NOT_IN_PRODUCT(TimelineDurationScope tds(T, Timeline::GetIsolateStream(),
+                                             "ObjectStore::Init"));
     ObjectStore::Init(I);
   }
 
-  const Error& error = Error::Handle(Object::Init(I));
+  Error& error = Error::Handle(T->zone());
+  error = Object::Init(I, kernel_program);
   if (!error.IsNull()) {
     return error.raw();
   }
-  if (snapshot_buffer != NULL) {
+  if ((snapshot_buffer != NULL) && kernel_program == NULL) {
     // Read the snapshot and setup the initial state.
-    NOT_IN_PRODUCT(TimelineDurationScope tds(T,
-        Timeline::GetIsolateStream(), "IsolateSnapshotReader"));
+    NOT_IN_PRODUCT(TimelineDurationScope tds(T, Timeline::GetIsolateStream(),
+                                             "IsolateSnapshotReader"));
     // TODO(turnidge): Remove once length is not part of the snapshot.
     const Snapshot* snapshot = Snapshot::SetupFromBuffer(snapshot_buffer);
     if (snapshot == NULL) {
+      const String& message = String::Handle(String::New("Invalid snapshot"));
+      return ApiError::New(message);
+    }
+    if (snapshot->kind() != snapshot_kind_) {
       const String& message = String::Handle(
-          String::New("Invalid snapshot."));
+          String::NewFormatted("Invalid snapshot kind: got '%s', expected '%s'",
+                               Snapshot::KindToCString(snapshot->kind()),
+                               Snapshot::KindToCString(snapshot_kind_)));
       return ApiError::New(message);
     }
     ASSERT(Snapshot::IsFull(snapshot->kind()));
-    ASSERT(snapshot->kind() == snapshot_kind_);
     if (FLAG_trace_isolates) {
       OS::Print("Size of isolate snapshot = %" Pd "\n", snapshot->length());
     }
-    IsolateSnapshotReader reader(snapshot->kind(),
-                                 snapshot->content(),
-                                 snapshot->length(),
-                                 Dart::instructions_snapshot_buffer(),
-                                 Dart::data_snapshot_buffer(),
-                                 T);
+    IsolateSnapshotReader reader(
+        snapshot->kind(), snapshot->content(), snapshot->length(),
+        Dart::instructions_snapshot_buffer(), Dart::data_snapshot_buffer(), T);
     const Error& error = Error::Handle(reader.ReadFullSnapshot());
     if (!error.IsNull()) {
       return error.raw();
     }
-    NOT_IN_PRODUCT(if (tds.enabled()) {
+#if !defined(PRODUCT)
+    if (tds.enabled()) {
       tds.SetNumArguments(2);
       tds.FormatArgument(0, "snapshotSize", "%" Pd, snapshot->length());
       tds.FormatArgument(1, "heapSize", "%" Pd64,
                          I->heap()->UsedInWords(Heap::kOld) * kWordSize);
-    });
+    }
+#endif  // !defined(PRODUCT)
     if (FLAG_trace_isolates) {
       I->heap()->PrintSizes();
       MegamorphicCacheTable::PrintSizes(I);
     }
   } else {
-    ASSERT(snapshot_kind_ == Snapshot::kNone);
+    if ((snapshot_kind_ != Snapshot::kNone) && kernel_program == NULL) {
+      const String& message =
+          String::Handle(String::New("Missing isolate snapshot"));
+      return ApiError::New(message);
+    }
   }
 
   Object::VerifyBuiltinVtables();
   DEBUG_ONLY(I->heap()->Verify(kForbidMarked));
 
   {
-    NOT_IN_PRODUCT(TimelineDurationScope tds(T,
-        Timeline::GetIsolateStream(), "StubCode::Init"));
+    NOT_IN_PRODUCT(TimelineDurationScope tds(T, Timeline::GetIsolateStream(),
+                                             "StubCode::Init"));
     StubCode::Init(I);
   }
 
@@ -578,7 +585,7 @@
       Code::Handle(I->object_store()->megamorphic_miss_code());
   I->set_ic_miss_code(miss_code);
 
-  if (snapshot_buffer == NULL) {
+  if ((snapshot_buffer == NULL) || (kernel_program != NULL)) {
     const Error& error = Error::Handle(I->object_store()->PreallocateObjects());
     if (!error.IsNull()) {
       return error.raw();
@@ -596,8 +603,7 @@
   if (!ServiceIsolate::IsServiceIsolate(I)) {
     I->message_handler()->set_should_pause_on_start(
         FLAG_pause_isolates_on_start);
-    I->message_handler()->set_should_pause_on_exit(
-        FLAG_pause_isolates_on_exit);
+    I->message_handler()->set_should_pause_on_exit(FLAG_pause_isolates_on_exit);
   }
   ServiceIsolate::SendIsolateStartupMessage();
   if (FLAG_support_debugger) {
@@ -620,7 +626,7 @@
 const char* Dart::FeaturesString(Snapshot::Kind kind) {
   TextBuffer buffer(64);
 
-  // Different fields are included for DEBUG/RELEASE/PRODUCT.
+// Different fields are included for DEBUG/RELEASE/PRODUCT.
 #if defined(DEBUG)
   buffer.AddString("debug");
 #elif defined(PRODUCT)
@@ -635,7 +641,7 @@
     buffer.AddString(FLAG_enable_type_checks ? " type-checks"
                                              : " no-type-checks");
 
-    // Generated code must match the host architecture and ABI.
+// Generated code must match the host architecture and ABI.
 #if defined(TARGET_ARCH_ARM)
 #if defined(TARGET_ABI_IOS)
     buffer.AddString(" arm-ios");
diff --git a/runtime/vm/dart.h b/runtime/vm/dart.h
index 10ffea3..9af4ed9 100644
--- a/runtime/vm/dart.h
+++ b/runtime/vm/dart.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_DART_H_
-#define VM_DART_H_
+#ifndef RUNTIME_VM_DART_H_
+#define RUNTIME_VM_DART_H_
 
 #include "include/dart_api.h"
 #include "vm/allocation.h"
@@ -18,27 +18,37 @@
 class RawError;
 class ReadOnlyHandles;
 class ThreadPool;
+namespace kernel {
+class Program;
+}
 
 class Dart : public AllStatic {
  public:
-  static char* InitOnce(
-      const uint8_t* vm_isolate_snapshot,
-      const uint8_t* instructions_snapshot,
-      const uint8_t* data_snapshot,
-      Dart_IsolateCreateCallback create,
-      Dart_IsolateShutdownCallback shutdown,
-      Dart_ThreadExitCallback thread_exit,
-      Dart_FileOpenCallback file_open,
-      Dart_FileReadCallback file_read,
-      Dart_FileWriteCallback file_write,
-      Dart_FileCloseCallback file_close,
-      Dart_EntropySource entropy_source,
-      Dart_GetVMServiceAssetsArchive get_service_assets);
+  static char* InitOnce(const uint8_t* vm_isolate_snapshot,
+                        const uint8_t* instructions_snapshot,
+                        const uint8_t* data_snapshot,
+                        Dart_IsolateCreateCallback create,
+                        Dart_IsolateShutdownCallback shutdown,
+                        Dart_ThreadExitCallback thread_exit,
+                        Dart_FileOpenCallback file_open,
+                        Dart_FileReadCallback file_read,
+                        Dart_FileWriteCallback file_write,
+                        Dart_FileCloseCallback file_close,
+                        Dart_EntropySource entropy_source,
+                        Dart_GetVMServiceAssetsArchive get_service_assets);
   static const char* Cleanup();
 
   static Isolate* CreateIsolate(const char* name_prefix,
                                 const Dart_IsolateFlags& api_flags);
-  static RawError* InitializeIsolate(const uint8_t* snapshot, void* data);
+
+  // Initialize an isolate, either from a snapshot, from a Kernel binary, or
+  // from SDK library sources.  If the snapshot_buffer is non-NULL,
+  // initialize from a snapshot or a Kernel binary depending on the value of
+  // from_kernel.  Otherwise, initialize from sources.
+  static RawError* InitializeIsolate(const uint8_t* snapshot_buffer,
+                                     intptr_t snapshot_length,
+                                     kernel::Program* kernel_program,
+                                     void* data);
   static void RunShutdownCallback();
   static void ShutdownIsolate(Isolate* isolate);
   static void ShutdownIsolate();
@@ -63,18 +73,14 @@
 
   static const char* FeaturesString(Snapshot::Kind kind);
 
-  static Snapshot::Kind snapshot_kind() {
-    return snapshot_kind_;
-  }
+  static Snapshot::Kind snapshot_kind() { return snapshot_kind_; }
   static const uint8_t* instructions_snapshot_buffer() {
     return instructions_snapshot_buffer_;
   }
   static void set_instructions_snapshot_buffer(const uint8_t* buffer) {
     instructions_snapshot_buffer_ = buffer;
   }
-  static const uint8_t* data_snapshot_buffer() {
-    return data_snapshot_buffer_;
-  }
+  static const uint8_t* data_snapshot_buffer() { return data_snapshot_buffer_; }
   static void set_data_snapshot_buffer(const uint8_t* buffer) {
     data_snapshot_buffer_ = buffer;
   }
@@ -137,4 +143,4 @@
 
 }  // namespace dart
 
-#endif  // VM_DART_H_
+#endif  // RUNTIME_VM_DART_H_
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index f6f3ab8..2e739e1 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -17,6 +17,9 @@
 #include "vm/dart_api_state.h"
 #include "vm/dart_entry.h"
 #include "vm/debugger.h"
+#if !defined(DART_PRECOMPILED_RUNTIME)
+#include "vm/kernel_reader.h"
+#endif
 #include "vm/exceptions.h"
 #include "vm/flags.h"
 #include "vm/growable_array.h"
@@ -57,12 +60,18 @@
 DECLARE_FLAG(bool, print_class_table);
 DECLARE_FLAG(bool, verify_handles);
 #if defined(DART_NO_SNAPSHOT)
-DEFINE_FLAG(bool, check_function_fingerprints, true,
+DEFINE_FLAG(bool,
+            check_function_fingerprints,
+            true,
             "Check function fingerprints");
 #endif  // defined(DART_NO_SNAPSHOT).
-DEFINE_FLAG(bool, verify_acquired_data, false,
+DEFINE_FLAG(bool,
+            verify_acquired_data,
+            false,
             "Verify correct API acquire/release of typed data.");
-DEFINE_FLAG(bool, support_externalizable_strings, false,
+DEFINE_FLAG(bool,
+            support_externalizable_strings,
+            false,
             "Support Dart_MakeExternalString.");
 
 
@@ -83,17 +92,19 @@
 
 #ifndef PRODUCT
 #define API_TIMELINE_DURATION                                                  \
-  TimelineDurationScope tds(Thread::Current(),                                 \
-                            Timeline::GetAPIStream(),                          \
+  TimelineDurationScope tds(Thread::Current(), Timeline::GetAPIStream(),       \
                             CURRENT_FUNC)
 
 #define API_TIMELINE_BEGIN_END                                                 \
-  TimelineBeginEndScope tbes(Thread::Current(),                                \
-                             Timeline::GetAPIStream(),                         \
+  TimelineBeginEndScope tbes(Thread::Current(), Timeline::GetAPIStream(),      \
                              CURRENT_FUNC)
 #else
-#define API_TIMELINE_DURATION do { } while (false)
-#define API_TIMELINE_BEGIN_END do { } while (false)
+#define API_TIMELINE_DURATION                                                  \
+  do {                                                                         \
+  } while (false)
+#define API_TIMELINE_BEGIN_END                                                 \
+  do {                                                                         \
+  } while (false)
 #endif  // !PRODUCT
 
 #if defined(DEBUG)
@@ -102,10 +113,10 @@
 // or not. An assertion is raised if a type is not canonicalized.
 class FunctionVisitor : public ObjectVisitor {
  public:
-  explicit FunctionVisitor(Thread* thread) :
-      classHandle_(Class::Handle(thread->zone())),
-      funcHandle_(Function::Handle(thread->zone())),
-      typeHandle_(AbstractType::Handle(thread->zone())) {}
+  explicit FunctionVisitor(Thread* thread)
+      : classHandle_(Class::Handle(thread->zone())),
+        funcHandle_(Function::Handle(thread->zone())),
+        typeHandle_(AbstractType::Handle(thread->zone())) {}
 
   void VisitObject(RawObject* obj) {
     if (obj->IsFunction()) {
@@ -114,19 +125,15 @@
       // Verify that the result type of a function is canonical or a
       // TypeParameter.
       typeHandle_ ^= funcHandle_.result_type();
-      ASSERT(typeHandle_.IsMalformed() ||
-             !typeHandle_.IsResolved() ||
-             typeHandle_.IsTypeParameter() ||
-             typeHandle_.IsCanonical());
+      ASSERT(typeHandle_.IsMalformed() || !typeHandle_.IsResolved() ||
+             typeHandle_.IsTypeParameter() || typeHandle_.IsCanonical());
       // Verify that the types in the function signature are all canonical or
       // a TypeParameter.
       const intptr_t num_parameters = funcHandle_.NumParameters();
       for (intptr_t i = 0; i < num_parameters; i++) {
         typeHandle_ = funcHandle_.ParameterTypeAt(i);
-        ASSERT(typeHandle_.IsMalformed() ||
-               !typeHandle_.IsResolved() ||
-               typeHandle_.IsTypeParameter() ||
-               typeHandle_.IsCanonical());
+        ASSERT(typeHandle_.IsMalformed() || !typeHandle_.IsResolved() ||
+               typeHandle_.IsTypeParameter() || typeHandle_.IsCanonical());
       }
     }
   }
@@ -148,12 +155,9 @@
     const Instance& instance = Instance::Cast(obj);
     const Class& obj_class = Class::Handle(zone, obj.clazz());
     Error& malformed_type_error = Error::Handle(zone);
-    if (obj_class.IsSubtypeOf(Object::null_type_arguments(),
-                              list_class,
+    if (obj_class.IsSubtypeOf(Object::null_type_arguments(), list_class,
                               Object::null_type_arguments(),
-                              &malformed_type_error,
-                              NULL,
-                              Heap::kNew)) {
+                              &malformed_type_error, NULL, Heap::kNew)) {
       ASSERT(malformed_type_error.IsNull());  // Type is a raw List.
       return instance.raw();
     }
@@ -170,12 +174,9 @@
     const Instance& instance = Instance::Cast(obj);
     const Class& obj_class = Class::Handle(zone, obj.clazz());
     Error& malformed_type_error = Error::Handle(zone);
-    if (obj_class.IsSubtypeOf(Object::null_type_arguments(),
-                              map_class,
+    if (obj_class.IsSubtypeOf(Object::null_type_arguments(), map_class,
                               Object::null_type_arguments(),
-                              &malformed_type_error,
-                              NULL,
-                              Heap::kNew)) {
+                              &malformed_type_error, NULL, Heap::kNew)) {
       ASSERT(malformed_type_error.IsNull());  // Type is a raw Map.
       return instance.raw();
     }
@@ -304,9 +305,7 @@
                                              intptr_t* field_values,
                                              const char* current_func) {
   ASSERT(field_values != NULL);
-  if (Api::GetNativeFieldsOfArgument(arguments,
-                                     arg_index,
-                                     num_fields,
+  if (Api::GetNativeFieldsOfArgument(arguments, arg_index, num_fields,
                                      field_values)) {
     return Api::Success();
   }
@@ -322,15 +321,16 @@
   // We did not succeed in extracting the native fields report the
   // appropriate error.
   if (!obj.IsInstance()) {
-    return Api::NewError("%s expects argument at index '%d' to be of"
-                         " type Instance.", current_func, arg_index);
+    return Api::NewError(
+        "%s expects argument at index '%d' to be of"
+        " type Instance.",
+        current_func, arg_index);
   }
   const Instance& instance = Instance::Cast(obj);
   int field_count = instance.NumNativeFields();
   ASSERT(num_fields != field_count);
-  return Api::NewError(
-      "%s: expected %d 'num_fields' but was passed in %d.",
-      current_func, field_count, num_fields);
+  return Api::NewError("%s: expected %d 'num_fields' but was passed in %d.",
+                       current_func, field_count, num_fields);
 }
 
 
@@ -346,13 +346,12 @@
 }
 
 
-static RawObject* Send0Arg(const Instance& receiver,
-                           const String& selector) {
+static RawObject* Send0Arg(const Instance& receiver, const String& selector) {
   const intptr_t kNumArgs = 1;
   ArgumentsDescriptor args_desc(
       Array::Handle(ArgumentsDescriptor::New(kNumArgs)));
-  const Function& function = Function::Handle(
-      Resolver::ResolveDynamic(receiver, selector, args_desc));
+  const Function& function =
+      Function::Handle(Resolver::ResolveDynamic(receiver, selector, args_desc));
   if (function.IsNull()) {
     return ApiError::New(String::Handle(String::New("")));
   }
@@ -368,8 +367,8 @@
   const intptr_t kNumArgs = 2;
   ArgumentsDescriptor args_desc(
       Array::Handle(ArgumentsDescriptor::New(kNumArgs)));
-  const Function& function = Function::Handle(
-      Resolver::ResolveDynamic(receiver, selector, args_desc));
+  const Function& function =
+      Function::Handle(Resolver::ResolveDynamic(receiver, selector, args_desc));
   if (function.IsNull()) {
     return ApiError::New(String::Handle(String::New("")));
   }
@@ -428,25 +427,22 @@
   Thread* thread = Thread::Current();
   ASSERT(thread->IsMutatorThread());
   ASSERT(thread->isolate() != NULL);
-  ASSERT(!FLAG_verify_handles ||
-         thread->IsValidLocalHandle(object) ||
+  ASSERT(!FLAG_verify_handles || thread->IsValidLocalHandle(object) ||
          Dart::IsReadOnlyApiHandle(object));
   ASSERT(FinalizablePersistentHandle::raw_offset() == 0 &&
-         PersistentHandle::raw_offset() == 0 &&
-         LocalHandle::raw_offset() == 0);
+         PersistentHandle::raw_offset() == 0 && LocalHandle::raw_offset() == 0);
 #endif
   return (reinterpret_cast<LocalHandle*>(object))->raw();
 }
 
 
 #define DEFINE_UNWRAP(type)                                                    \
-  const type& Api::Unwrap##type##Handle(Zone* zone,                            \
-                                        Dart_Handle dart_handle) {             \
+  const type& Api::Unwrap##type##Handle(Zone* zone, Dart_Handle dart_handle) { \
     const Object& obj = Object::Handle(zone, Api::UnwrapHandle(dart_handle));  \
     if (obj.Is##type()) {                                                      \
       return type::Cast(obj);                                                  \
     }                                                                          \
-    return type::Handle(zone  );                                               \
+    return type::Handle(zone);                                                 \
   }
 CLASS_LIST_FOR_HANDLES(DEFINE_UNWRAP)
 #undef DEFINE_UNWRAP
@@ -464,7 +460,8 @@
 
 
 const Instance& Api::UnwrapInstanceHandle(
-    const ReusableObjectHandleScope& reuse, Dart_Handle dart_handle) {
+    const ReusableObjectHandleScope& reuse,
+    Dart_Handle dart_handle) {
   Object& ref = reuse.Handle();
   ref = Api::UnwrapHandle(dart_handle);
   if (ref.IsInstance()) {
@@ -638,15 +635,15 @@
   NoSafepointScope no_safepoint_scope;
   RawObject* raw_obj = arguments->NativeArgAt(arg_index);
   if (raw_obj->IsHeapObject()) {
-      intptr_t cid = raw_obj->GetClassId();
-      if (cid == kBoolCid) {
-        *value = (raw_obj == Object::bool_true().raw());
-        return true;
-      }
-      if (cid == kNullCid) {
-        *value = false;
-        return true;
-      }
+    intptr_t cid = raw_obj->GetClassId();
+    if (cid == kBoolCid) {
+      *value = (raw_obj == Object::bool_true().raw());
+      return true;
+    }
+    if (cid == kNullCid) {
+      *value = false;
+      return true;
+    }
   }
   return false;
 }
@@ -709,8 +706,7 @@
       } else if (num_fields == Smi::Value(native_fields->ptr()->length_)) {
         intptr_t* native_values =
             bit_cast<intptr_t*, uint8_t*>(native_fields->ptr()->data());
-        memmove(field_values,
-                native_values,
+        memmove(field_values, native_values,
                 (num_fields * sizeof(field_values[0])));
       }
       return true;
@@ -743,7 +739,8 @@
 
 
 void FinalizablePersistentHandle::Finalize(
-    Isolate* isolate, FinalizablePersistentHandle* handle) {
+    Isolate* isolate,
+    FinalizablePersistentHandle* handle) {
   if (!handle->raw()->IsHeapObject()) {
     return;  // Free handle.
   }
@@ -876,8 +873,7 @@
 DART_EXPORT Dart_Handle Dart_PropagateError(Dart_Handle handle) {
   Thread* thread = Thread::Current();
   TransitionNativeToVM transition(thread);
-  const Object& obj = Object::Handle(thread->zone(),
-                                     Api::UnwrapHandle(handle));
+  const Object& obj = Object::Handle(thread->zone(), Api::UnwrapHandle(handle));
   if (!obj.IsError()) {
     return Api::NewError(
         "%s expects argument 'handle' to be an error handle.  "
@@ -913,8 +909,8 @@
                                          int line,
                                          const char* handle,
                                          const char* message) {
-  fprintf(stderr, "%s:%d: error handle: '%s':\n    '%s'\n",
-          file, line, handle, message);
+  fprintf(stderr, "%s:%d: error handle: '%s':\n    '%s'\n", file, line, handle,
+          message);
   OS::Abort();
 }
 
@@ -962,8 +958,8 @@
   }
 
   const Library& libcore = Library::Handle(Z, Library::CoreLibrary());
-  const String& function_name = String::Handle(Z,
-                                               String::New("identityHashCode"));
+  const String& function_name =
+      String::Handle(Z, String::New("identityHashCode"));
   const Function& function =
       Function::Handle(Z, libcore.LookupFunctionAllowPrivate(function_name));
   if (function.IsNull()) {
@@ -995,8 +991,8 @@
 }
 
 
-DART_EXPORT Dart_Handle Dart_HandleFromPersistent(
-    Dart_PersistentHandle object) {
+DART_EXPORT Dart_Handle
+Dart_HandleFromPersistent(Dart_PersistentHandle object) {
   Thread* thread = Thread::Current();
   Isolate* isolate = thread->isolate();
   CHECK_ISOLATE(isolate);
@@ -1008,8 +1004,8 @@
 }
 
 
-DART_EXPORT Dart_Handle Dart_HandleFromWeakPersistent(
-    Dart_WeakPersistentHandle object) {
+DART_EXPORT Dart_Handle
+Dart_HandleFromWeakPersistent(Dart_WeakPersistentHandle object) {
   Thread* thread = Thread::Current();
   Isolate* isolate = thread->isolate();
   CHECK_ISOLATE(isolate);
@@ -1060,31 +1056,25 @@
     return NULL;
   }
   FinalizablePersistentHandle* finalizable_ref =
-      FinalizablePersistentHandle::New(thread->isolate(),
-                                       ref,
-                                       peer,
-                                       callback,
+      FinalizablePersistentHandle::New(thread->isolate(), ref, peer, callback,
                                        external_allocation_size);
   return finalizable_ref->apiHandle();
 }
 
 
-DART_EXPORT Dart_WeakPersistentHandle Dart_NewWeakPersistentHandle(
-    Dart_Handle object,
-    void* peer,
-    intptr_t external_allocation_size,
-    Dart_WeakPersistentHandleFinalizer callback) {
+DART_EXPORT Dart_WeakPersistentHandle
+Dart_NewWeakPersistentHandle(Dart_Handle object,
+                             void* peer,
+                             intptr_t external_allocation_size,
+                             Dart_WeakPersistentHandleFinalizer callback) {
   Thread* thread = Thread::Current();
   CHECK_ISOLATE(thread->isolate());
   if (callback == NULL) {
     return NULL;
   }
   TransitionNativeToVM transition(thread);
-  return AllocateFinalizableHandle(thread,
-                                   object,
-                                   peer,
-                                   external_allocation_size,
-                                   callback);
+  return AllocateFinalizableHandle(thread, object, peer,
+                                   external_allocation_size, callback);
 }
 
 
@@ -1120,9 +1110,9 @@
 
 // --- Garbage Collection Callbacks --
 
-DART_EXPORT Dart_Handle Dart_SetGcCallbacks(
-    Dart_GcPrologueCallback prologue_callback,
-    Dart_GcEpilogueCallback epilogue_callback) {
+DART_EXPORT Dart_Handle
+Dart_SetGcCallbacks(Dart_GcPrologueCallback prologue_callback,
+                    Dart_GcEpilogueCallback epilogue_callback) {
   Thread* thread = Thread::Current();
   Isolate* isolate = thread->isolate();
   CHECK_ISOLATE(isolate);
@@ -1169,27 +1159,23 @@
 
 DART_EXPORT char* Dart_Initialize(Dart_InitializeParams* params) {
   if (params == NULL) {
-    return strdup("Dart_Initialize: "
-                  "Dart_InitializeParams is null.");
+    return strdup(
+        "Dart_Initialize: "
+        "Dart_InitializeParams is null.");
   }
 
   if (params->version != DART_INITIALIZE_PARAMS_CURRENT_VERSION) {
-    return strdup("Dart_Initialize: "
-                  "Invalid Dart_InitializeParams version.");
+    return strdup(
+        "Dart_Initialize: "
+        "Invalid Dart_InitializeParams version.");
   }
 
   return Dart::InitOnce(params->vm_isolate_snapshot,
-                        params->instructions_snapshot,
-                        params->data_snapshot,
-                        params->create,
-                        params->shutdown,
-                        params->thread_exit,
-                        params->file_open,
-                        params->file_read,
-                        params->file_write,
-                        params->file_close,
-                        params->entropy_source,
-                        params->get_service_assets);
+                        params->instructions_snapshot, params->data_snapshot,
+                        params->create, params->shutdown, params->thread_exit,
+                        params->file_open, params->file_read,
+                        params->file_write, params->file_close,
+                        params->entropy_source, params->get_service_assets);
 }
 
 
@@ -1215,8 +1201,7 @@
 
 // --- Isolates ---
 
-static char* BuildIsolateName(const char* script_uri,
-                              const char* main) {
+static char* BuildIsolateName(const char* script_uri, const char* main) {
   if (script_uri == NULL) {
     // Just use the main as the name.
     if (main == NULL) {
@@ -1251,12 +1236,14 @@
 }
 
 
-DART_EXPORT Dart_Isolate Dart_CreateIsolate(const char* script_uri,
-                                            const char* main,
-                                            const uint8_t* snapshot,
-                                            Dart_IsolateFlags* flags,
-                                            void* callback_data,
-                                            char** error) {
+static Dart_Isolate CreateIsolate(const char* script_uri,
+                                  const char* main,
+                                  const uint8_t* snapshot_buffer,
+                                  intptr_t snapshot_length,
+                                  kernel::Program* kernel_program,
+                                  Dart_IsolateFlags* flags,
+                                  void* callback_data,
+                                  char** error) {
   CHECK_NO_ISOLATE(Isolate::Current());
   char* isolate_name = BuildIsolateName(script_uri, main);
 
@@ -1280,14 +1267,15 @@
     // bootstrap library files which call out to a tag handler that may create
     // Api Handles when an error is encountered.
     Dart_EnterScope();
-    const Error& error_obj =
-        Error::Handle(Z, Dart::InitializeIsolate(snapshot, callback_data));
+    const Error& error_obj = Error::Handle(
+        Z, Dart::InitializeIsolate(snapshot_buffer, snapshot_length,
+                                   kernel_program, callback_data));
     if (error_obj.IsNull()) {
-  #if defined(DART_NO_SNAPSHOT) && !defined(PRODUCT)
-      if (FLAG_check_function_fingerprints) {
+#if defined(DART_NO_SNAPSHOT) && !defined(PRODUCT)
+      if (FLAG_check_function_fingerprints && kernel_program == NULL) {
         Library::CheckFunctionFingerprints();
       }
-  #endif  // defined(DART_NO_SNAPSHOT) && !defined(PRODUCT).
+#endif  // defined(DART_NO_SNAPSHOT) && !defined(PRODUCT).
       // We exit the API scope entered above.
       Dart_ExitScope();
       // A Thread structure has been associated to the thread, we do the
@@ -1307,6 +1295,29 @@
 }
 
 
+DART_EXPORT Dart_Isolate Dart_CreateIsolate(const char* script_uri,
+                                            const char* main,
+                                            const uint8_t* snapshot_buffer,
+                                            Dart_IsolateFlags* flags,
+                                            void* callback_data,
+                                            char** error) {
+  return CreateIsolate(script_uri, main, snapshot_buffer, -1, NULL, flags,
+                       callback_data, error);
+}
+
+
+DART_EXPORT Dart_Isolate Dart_CreateIsolateFromKernel(const char* script_uri,
+                                                      const char* main,
+                                                      void* kernel_program,
+                                                      Dart_IsolateFlags* flags,
+                                                      void* callback_data,
+                                                      char** error) {
+  return CreateIsolate(script_uri, main, NULL, -1,
+                       reinterpret_cast<kernel::Program*>(kernel_program),
+                       flags, callback_data, error);
+}
+
+
 DART_EXPORT void Dart_ShutdownIsolate() {
   Thread* T = Thread::Current();
   Isolate* I = T->isolate();
@@ -1363,9 +1374,10 @@
   // TODO(16615): Validate isolate parameter.
   Isolate* iso = reinterpret_cast<Isolate*>(isolate);
   if (!Thread::EnterIsolate(iso)) {
-    FATAL("Unable to Enter Isolate : "
-          "Multiple mutators entering an isolate / "
-          "Dart VM is shutting down");
+    FATAL(
+        "Unable to Enter Isolate : "
+        "Multiple mutators entering an isolate / "
+        "Dart VM is shutting down");
   }
   // A Thread structure has been associated to the thread, we do the
   // safepoint transition explicity here instead of using the
@@ -1478,10 +1490,9 @@
   }
   if (!::Dart_IsUnhandledExceptionError(error) && !::Dart_IsNull(error)) {
     FATAL1("%s expects the error to be an unhandled exception error or null.",
-            CURRENT_FUNC);
+           CURRENT_FUNC);
   }
-  isolate->SetStickyError(
-      Api::UnwrapErrorHandle(Z, error).raw());
+  isolate->SetStickyError(Api::UnwrapErrorHandle(Z, error).raw());
 }
 
 
@@ -1500,8 +1511,7 @@
   CHECK_ISOLATE(I);
   NoSafepointScope no_safepoint_scope;
   if (I->sticky_error() != Error::null()) {
-    Dart_Handle error =
-        Api::NewHandle(T, I->sticky_error());
+    Dart_Handle error = Api::NewHandle(T, I->sticky_error());
     return error;
   }
   return Dart_Null();
@@ -1525,16 +1535,17 @@
 static uint8_t* ApiReallocate(uint8_t* ptr,
                               intptr_t old_size,
                               intptr_t new_size) {
-  return Api::TopScope(Thread::Current())->zone()->Realloc<uint8_t>(
-      ptr, old_size, new_size);
+  return Api::TopScope(Thread::Current())
+      ->zone()
+      ->Realloc<uint8_t>(ptr, old_size, new_size);
 }
 
 
-DART_EXPORT Dart_Handle Dart_CreateSnapshot(
-    uint8_t** vm_isolate_snapshot_buffer,
-    intptr_t* vm_isolate_snapshot_size,
-    uint8_t** isolate_snapshot_buffer,
-    intptr_t* isolate_snapshot_size) {
+DART_EXPORT Dart_Handle
+Dart_CreateSnapshot(uint8_t** vm_isolate_snapshot_buffer,
+                    intptr_t* vm_isolate_snapshot_size,
+                    uint8_t** isolate_snapshot_buffer,
+                    intptr_t* isolate_snapshot_size) {
   DARTSCOPE(Thread::Current());
   API_TIMELINE_DURATION;
   Isolate* I = T->isolate();
@@ -1542,8 +1553,7 @@
     return Api::NewError(
         "Creating full snapshots requires --load_deferred_eagerly");
   }
-  if (vm_isolate_snapshot_buffer != NULL &&
-      vm_isolate_snapshot_size == NULL) {
+  if (vm_isolate_snapshot_buffer != NULL && vm_isolate_snapshot_size == NULL) {
     RETURN_NULL_ERROR(vm_isolate_snapshot_size);
   }
   if (isolate_snapshot_buffer == NULL) {
@@ -1565,10 +1575,8 @@
   I->heap()->IterateObjects(&check_canonical);
 #endif  // #if defined(DEBUG)
 
-  FullSnapshotWriter writer(Snapshot::kCore,
-                            vm_isolate_snapshot_buffer,
-                            isolate_snapshot_buffer,
-                            ApiReallocate,
+  FullSnapshotWriter writer(Snapshot::kCore, vm_isolate_snapshot_buffer,
+                            isolate_snapshot_buffer, ApiReallocate,
                             NULL /* instructions_writer */);
   writer.WriteFullSnapshot();
   *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize();
@@ -1630,7 +1638,7 @@
 
 DART_EXPORT void Dart_InterruptIsolate(Dart_Isolate isolate) {
   if (isolate == NULL) {
-    FATAL1("%s expects argument 'isolate' to be non-null.",  CURRENT_FUNC);
+    FATAL1("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC);
   }
   // TODO(16615): Validate isolate parameter.
   TransitionNativeToVM transition(Thread::Current());
@@ -1643,7 +1651,7 @@
   CHECK_NO_ISOLATE(Isolate::Current());
   API_TIMELINE_DURATION;
   if (isolate == NULL) {
-    FATAL1("%s expects argument 'isolate' to be non-null.",  CURRENT_FUNC);
+    FATAL1("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC);
   }
   // TODO(16615): Validate isolate parameter.
   Isolate* iso = reinterpret_cast<Isolate*>(isolate);
@@ -1707,17 +1715,15 @@
     RunLoopData data;
     data.monitor = &monitor;
     data.done = false;
-    I->message_handler()->Run(
-        Dart::thread_pool(),
-        NULL, RunLoopDone, reinterpret_cast<uword>(&data));
+    I->message_handler()->Run(Dart::thread_pool(), NULL, RunLoopDone,
+                              reinterpret_cast<uword>(&data));
     while (!data.done) {
       ml.Wait();
     }
   }
   ::Dart_EnterIsolate(Api::CastIsolate(I));
   if (I->sticky_error() != Object::null()) {
-    Dart_Handle error =
-        Api::NewHandle(Thread::Current(), I->sticky_error());
+    Dart_Handle error = Api::NewHandle(Thread::Current(), I->sticky_error());
     I->clear_sticky_error();
     return error;
   }
@@ -1809,8 +1815,8 @@
   // Smis and null can be sent without serialization.
   RawObject* raw_obj = Api::UnwrapHandle(handle);
   if (ApiObjectConverter::CanConvert(raw_obj)) {
-    return PortMap::PostMessage(new Message(
-        port_id, raw_obj, Message::kNormalPriority));
+    return PortMap::PostMessage(
+        new Message(port_id, raw_obj, Message::kNormalPriority));
   }
 
   const Object& object = Object::Handle(Z, raw_obj);
@@ -1818,8 +1824,8 @@
   MessageWriter writer(&data, &allocator, false);
   writer.WriteMessage(object);
   intptr_t len = writer.BytesWritten();
-  return PortMap::PostMessage(new Message(
-      port_id, data, len, Message::kNormalPriority));
+  return PortMap::PostMessage(
+      new Message(port_id, data, len, Message::kNormalPriority));
 }
 
 
@@ -1827,8 +1833,7 @@
   DARTSCOPE(Thread::Current());
   CHECK_CALLBACK_STATE(T);
   if (port_id == ILLEGAL_PORT) {
-    return Api::NewError("%s: illegal port_id %" Pd64 ".",
-                         CURRENT_FUNC,
+    return Api::NewError("%s: illegal port_id %" Pd64 ".", CURRENT_FUNC,
                          port_id);
   }
   return Api::NewHandle(T, SendPort::New(port_id));
@@ -1872,8 +1877,7 @@
                                   thread->top_exit_frame_info());
     ASSERT(new_scope != NULL);
   } else {
-    new_scope->Reinit(thread,
-                      thread->api_top_scope(),
+    new_scope->Reinit(thread, thread->api_top_scope(),
                       thread->top_exit_frame_info());
     thread->set_api_reusable_scope(NULL);
   }
@@ -1932,14 +1936,14 @@
 }
 
 
-DART_EXPORT Dart_Handle Dart_ObjectEquals(Dart_Handle obj1, Dart_Handle obj2,
+DART_EXPORT Dart_Handle Dart_ObjectEquals(Dart_Handle obj1,
+                                          Dart_Handle obj2,
                                           bool* value) {
   DARTSCOPE(Thread::Current());
   CHECK_CALLBACK_STATE(T);
   const Instance& expected =
       Instance::CheckedHandle(Z, Api::UnwrapHandle(obj1));
-  const Instance& actual =
-      Instance::CheckedHandle(Z, Api::UnwrapHandle(obj2));
+  const Instance& actual = Instance::CheckedHandle(Z, Api::UnwrapHandle(obj2));
   const Object& result =
       Object::Handle(Z, DartLibraryCalls::Equals(expected, actual));
   if (result.IsBool()) {
@@ -1982,8 +1986,7 @@
   }
   CHECK_CALLBACK_STATE(T);
   Error& malformed_type_error = Error::Handle(Z);
-  *value = instance.IsInstanceOf(type_obj,
-                                 Object::null_type_arguments(),
+  *value = instance.IsInstanceOf(type_obj, Object::null_type_arguments(),
                                  &malformed_type_error);
   ASSERT(malformed_type_error.IsNull());  // Type was created from a class.
   return Api::Success();
@@ -2107,12 +2110,9 @@
     ASSERT(!future_class.IsNull());
     const Class& obj_class = Class::Handle(Z, obj.clazz());
     Error& malformed_type_error = Error::Handle(Z);
-    bool is_future = obj_class.IsSubtypeOf(Object::null_type_arguments(),
-                                           future_class,
-                                           Object::null_type_arguments(),
-                                           &malformed_type_error,
-                                           NULL,
-                                           Heap::kNew);
+    bool is_future = obj_class.IsSubtypeOf(
+        Object::null_type_arguments(), future_class,
+        Object::null_type_arguments(), &malformed_type_error, NULL, Heap::kNew);
     ASSERT(malformed_type_error.IsNull());  // Type is a raw Future.
     return is_future;
   }
@@ -2134,7 +2134,7 @@
     RETURN_TYPE_ERROR(Z, instance, Instance);
   }
   const AbstractType& type =
-      AbstractType::Handle(Instance::Cast(obj).GetType());
+      AbstractType::Handle(Instance::Cast(obj).GetType(Heap::kNew));
   return Api::NewHandle(T, type.Canonicalize());
 }
 
@@ -2294,11 +2294,6 @@
 }
 
 
-static uword BigintAllocate(intptr_t size) {
-  return Api::TopScope(Thread::Current())->zone()->AllocUnsafe(size);
-}
-
-
 DART_EXPORT Dart_Handle Dart_IntegerToHexCString(Dart_Handle integer,
                                                  const char** value) {
   API_TIMELINE_DURATION;
@@ -2307,12 +2302,13 @@
   if (int_obj.IsNull()) {
     RETURN_TYPE_ERROR(Z, integer, Integer);
   }
+  Zone* scope_zone = Api::TopScope(Thread::Current())->zone();
   if (int_obj.IsSmi() || int_obj.IsMint()) {
-    const Bigint& bigint = Bigint::Handle(Z,
-        Bigint::NewFromInt64(int_obj.AsInt64Value()));
-    *value = bigint.ToHexCString(BigintAllocate);
+    const Bigint& bigint =
+        Bigint::Handle(Z, Bigint::NewFromInt64(int_obj.AsInt64Value()));
+    *value = bigint.ToHexCString(scope_zone);
   } else {
-    *value = Bigint::Cast(int_obj).ToHexCString(BigintAllocate);
+    *value = Bigint::Cast(int_obj).ToHexCString(scope_zone);
   }
   return Api::Success();
 }
@@ -2439,11 +2435,11 @@
 }
 
 
-DART_EXPORT Dart_Handle Dart_NewExternalLatin1String(
-    const uint8_t* latin1_array,
-    intptr_t length,
-    void* peer,
-    Dart_PeerFinalizer cback) {
+DART_EXPORT Dart_Handle
+Dart_NewExternalLatin1String(const uint8_t* latin1_array,
+                             intptr_t length,
+                             void* peer,
+                             Dart_PeerFinalizer cback) {
   API_TIMELINE_DURATION;
   DARTSCOPE(Thread::Current());
   if (latin1_array == NULL && length != 0) {
@@ -2451,11 +2447,9 @@
   }
   CHECK_LENGTH(length, String::kMaxElements);
   CHECK_CALLBACK_STATE(T);
-  return Api::NewHandle(T, String::NewExternal(latin1_array,
-                                               length,
-                                               peer,
-                                               cback,
-                                               SpaceForExternal(T, length)));
+  return Api::NewHandle(T,
+                        String::NewExternal(latin1_array, length, peer, cback,
+                                            SpaceForExternal(T, length)));
 }
 
 
@@ -2470,10 +2464,7 @@
   CHECK_LENGTH(length, String::kMaxElements);
   CHECK_CALLBACK_STATE(T);
   intptr_t bytes = length * sizeof(*utf16_array);
-  return Api::NewHandle(T, String::NewExternal(utf16_array,
-                                               length,
-                                               peer,
-                                               cback,
+  return Api::NewHandle(T, String::NewExternal(utf16_array, length, peer, cback,
                                                SpaceForExternal(T, bytes)));
 }
 
@@ -2599,8 +2590,9 @@
                                                 Dart_PeerFinalizer cback) {
   DARTSCOPE(Thread::Current());
   if (!FLAG_support_externalizable_strings) {
-    return Api::NewError("Dart_MakeExternalString with "
-                         "--support_externalizable_strings=false");
+    return Api::NewError(
+        "Dart_MakeExternalString with "
+        "--support_externalizable_strings=false");
   }
   const String& str_obj = Api::UnwrapStringHandle(Z, str);
   if (str_obj.IsExternal()) {
@@ -2614,10 +2606,11 @@
   }
   intptr_t str_size = (str_obj.Length() * str_obj.CharSize());
   if ((external_size < str_size) || (external_size > String::kMaxElements)) {
-    return Api::NewError("Dart_MakeExternalString "
-                         "expects argument external_size to be in the range"
-                         "[%" Pd "..%" Pd "].",
-                         str_size, String::kMaxElements);
+    return Api::NewError(
+        "Dart_MakeExternalString "
+        "expects argument external_size to be in the range"
+        "[%" Pd "..%" Pd "].",
+        str_size, String::kMaxElements);
   }
   if (str_obj.InVMHeap()) {
     // Since the string object is read only we do not externalize
@@ -2644,8 +2637,8 @@
     }
     return str;
   }
-  return Api::NewHandle(T, str_obj.MakeExternal(array, external_size,
-                                                peer, cback));
+  return Api::NewHandle(
+      T, str_obj.MakeExternal(array, external_size, peer, cback));
 }
 
 
@@ -2687,7 +2680,7 @@
   type& array = type::Handle(zone);                                            \
   array ^= obj.raw();                                                          \
   *len = array.Length();                                                       \
-  return Api::Success();                                                       \
+  return Api::Success();
 
 
 DART_EXPORT Dart_Handle Dart_ListLength(Dart_Handle list, intptr_t* len) {
@@ -2729,7 +2722,7 @@
   const Array& args = Array::Handle(Z, Array::New(kNumArgs));
   args.SetAt(0, instance);  // Set up the receiver as the first argument.
   const Object& retval =
-    Object::Handle(Z, DartEntry::InvokeFunction(function, args));
+      Object::Handle(Z, DartEntry::InvokeFunction(function, args));
   if (retval.IsSmi()) {
     *len = Smi::Cast(retval).Value();
     return Api::Success();
@@ -2750,8 +2743,9 @@
         }
       }
     }
-    return Api::NewError("Length of List object is greater than the "
-                         "maximum value that 'len' parameter can hold");
+    return Api::NewError(
+        "Length of List object is greater than the "
+        "maximum value that 'len' parameter can hold");
   } else if (retval.IsError()) {
     return Api::NewHandle(T, retval.raw());
   } else {
@@ -2765,7 +2759,7 @@
   if ((index >= 0) && (index < array_obj.Length())) {                          \
     return Api::NewHandle(thread, array_obj.At(index));                        \
   }                                                                            \
-  return Api::NewError("Invalid index passed in to access list element");      \
+  return Api::NewError("Invalid index passed in to access list element");
 
 
 DART_EXPORT Dart_Handle Dart_ListGetAt(Dart_Handle list, intptr_t index) {
@@ -2782,10 +2776,9 @@
     // Check and handle a dart object that implements the List interface.
     const Instance& instance = Instance::Handle(Z, GetListInstance(Z, obj));
     if (!instance.IsNull()) {
-      return Api::NewHandle(T, Send1Arg(
-          instance,
-          Symbols::IndexToken(),
-          Instance::Handle(Z, Integer::New(index))));
+      return Api::NewHandle(T,
+                            Send1Arg(instance, Symbols::IndexToken(),
+                                     Instance::Handle(Z, Integer::New(index))));
     }
     return Api::NewError("Object does not implement the 'List' interface");
   }
@@ -2800,7 +2793,7 @@
     }                                                                          \
     return Api::Success();                                                     \
   }                                                                            \
-  return Api::NewError("Invalid offset/length passed in to access list");      \
+  return Api::NewError("Invalid offset/length passed in to access list");
 
 
 DART_EXPORT Dart_Handle Dart_ListGetRange(Dart_Handle list,
@@ -2826,10 +2819,9 @@
       const intptr_t kNumArgs = 2;
       ArgumentsDescriptor args_desc(
           Array::Handle(ArgumentsDescriptor::New(kNumArgs)));
-      const Function& function = Function::Handle(Z,
-          Resolver::ResolveDynamic(instance,
-                                   Symbols::AssignIndexToken(),
-                                   args_desc));
+      const Function& function = Function::Handle(
+          Z, Resolver::ResolveDynamic(instance, Symbols::AssignIndexToken(),
+                                      args_desc));
       if (!function.IsNull()) {
         const Array& args = Array::Handle(Array::New(kNumArgs));
         args.SetAt(0, instance);
@@ -2837,10 +2829,9 @@
         for (intptr_t i = 0; i < length; ++i) {
           index = Integer::New(i);
           args.SetAt(1, index);
-          Dart_Handle value = Api::NewHandle(
-              T, DartEntry::InvokeFunction(function, args));
-          if (::Dart_IsError(value))
-            return value;
+          Dart_Handle value =
+              Api::NewHandle(T, DartEntry::InvokeFunction(function, args));
+          if (::Dart_IsError(value)) return value;
           result[i] = value;
         }
         return Api::Success();
@@ -2861,7 +2852,7 @@
     array.SetAt(index, value_obj);                                             \
     return Api::Success();                                                     \
   }                                                                            \
-  return Api::NewError("Invalid index passed in to set list element");         \
+  return Api::NewError("Invalid index passed in to set list element");
 
 
 DART_EXPORT Dart_Handle Dart_ListSetAt(Dart_Handle list,
@@ -2886,10 +2877,9 @@
       const intptr_t kNumArgs = 3;
       ArgumentsDescriptor args_desc(
           Array::Handle(ArgumentsDescriptor::New(kNumArgs)));
-      const Function& function = Function::Handle(Z,
-          Resolver::ResolveDynamic(instance,
-                                   Symbols::AssignIndexToken(),
-                                   args_desc));
+      const Function& function = Function::Handle(
+          Z, Resolver::ResolveDynamic(instance, Symbols::AssignIndexToken(),
+                                      args_desc));
       if (!function.IsNull()) {
         const Integer& index_obj = Integer::Handle(Z, Integer::New(index));
         const Object& value_obj = Object::Handle(Z, Api::UnwrapHandle(value));
@@ -2900,8 +2890,7 @@
         args.SetAt(0, instance);
         args.SetAt(1, index_obj);
         args.SetAt(2, value_obj);
-        return Api::NewHandle(
-            T, DartEntry::InvokeFunction(function, args));
+        return Api::NewHandle(T, DartEntry::InvokeFunction(function, args));
       }
     }
     return Api::NewError("Object does not implement the 'List' interface");
@@ -2922,16 +2911,15 @@
   // Lookup the class ArgumentError in dart:core.
   const String& lib_url = String::Handle(String::New("dart:core"));
   const String& class_name = String::Handle(String::New("ArgumentError"));
-  const Library& lib = Library::Handle(zone,
-      Library::LookupLibrary(thread, lib_url));
+  const Library& lib =
+      Library::Handle(zone, Library::LookupLibrary(thread, lib_url));
   if (lib.IsNull()) {
-    const String& message = String::Handle(
-        String::NewFormatted("%s: library '%s' not found.",
-                             CURRENT_FUNC, lib_url.ToCString()));
+    const String& message = String::Handle(String::NewFormatted(
+        "%s: library '%s' not found.", CURRENT_FUNC, lib_url.ToCString()));
     return ApiError::New(message);
   }
-  const Class& cls = Class::Handle(
-      zone, lib.LookupClassAllowPrivate(class_name));
+  const Class& cls =
+      Class::Handle(zone, lib.LookupClassAllowPrivate(class_name));
   ASSERT(!cls.IsNull());
   Object& result = Object::Handle(zone);
   String& dot_name = String::Handle(String::New("."));
@@ -2960,7 +2948,7 @@
     // There are no dart frames on the stack so it would be illegal to
     // throw an exception here.
     const String& message = String::Handle(
-            String::New("No Dart frames on stack, cannot throw exception"));
+        String::New("No Dart frames on stack, cannot throw exception"));
     return ApiError::New(message);
   }
   // Unwind all the API scopes till the exit frame before throwing an
@@ -2973,8 +2961,8 @@
     saved_exception = &Instance::Handle(raw_exception);
   }
   Exceptions::Throw(thread, *saved_exception);
-  const String& message = String::Handle(
-          String::New("Exception was not thrown, internal error"));
+  const String& message =
+      String::Handle(String::New("Exception was not thrown, internal error"));
   return ApiError::New(message);
 }
 
@@ -2988,7 +2976,6 @@
       if (!element.IsInteger()) {                                              \
         return Api::NewHandle(                                                 \
             T, ThrowArgumentError("List contains non-int elements"));          \
-                                                                               \
       }                                                                        \
       const Integer& integer = Integer::Cast(element);                         \
       native_array[i] = static_cast<uint8_t>(integer.AsInt64Value() & 0xff);   \
@@ -2996,17 +2983,16 @@
     }                                                                          \
     return Api::Success();                                                     \
   }                                                                            \
-  return Api::NewError("Invalid length passed in to access array elements");   \
+  return Api::NewError("Invalid length passed in to access array elements");
 
-template<typename T>
+template <typename T>
 static Dart_Handle CopyBytes(const T& array,
                              intptr_t offset,
                              uint8_t* native_array,
                              intptr_t length) {
   ASSERT(array.ElementSizeInBytes() == 1);
   NoSafepointScope no_safepoint;
-  memmove(native_array,
-          reinterpret_cast<uint8_t*>(array.DataAddr(offset)),
+  memmove(native_array, reinterpret_cast<uint8_t*>(array.DataAddr(offset)),
           length);
   return Api::Success();
 }
@@ -3063,8 +3049,8 @@
     GET_LIST_ELEMENT_AS_BYTES(Array, obj, native_array, offset, length);
   }
   if (obj.IsGrowableObjectArray()) {
-    GET_LIST_ELEMENT_AS_BYTES(
-        GrowableObjectArray, obj, native_array, offset, length);
+    GET_LIST_ELEMENT_AS_BYTES(GrowableObjectArray, obj, native_array, offset,
+                              length);
   }
   if (obj.IsError()) {
     return list;
@@ -3072,13 +3058,13 @@
   CHECK_CALLBACK_STATE(T);
 
   // Check and handle a dart object that implements the List interface.
-  const Instance& instance =
-      Instance::Handle(Z, GetListInstance(Z, obj));
+  const Instance& instance = Instance::Handle(Z, GetListInstance(Z, obj));
   if (!instance.IsNull()) {
     const int kNumArgs = 2;
     ArgumentsDescriptor args_desc(
         Array::Handle(ArgumentsDescriptor::New(kNumArgs)));
-    const Function& function = Function::Handle(Z,
+    const Function& function = Function::Handle(
+        Z,
         Resolver::ResolveDynamic(instance, Symbols::IndexToken(), args_desc));
     if (!function.IsNull()) {
       Object& result = Object::Handle(Z);
@@ -3094,8 +3080,10 @@
           return Api::NewHandle(T, result.raw());
         }
         if (!result.IsInteger()) {
-          return Api::NewError("%s expects the argument 'list' to be "
-                               "a List of int", CURRENT_FUNC);
+          return Api::NewError(
+              "%s expects the argument 'list' to be "
+              "a List of int",
+              CURRENT_FUNC);
         }
         const Integer& integer_result = Integer::Cast(result);
         ASSERT(integer_result.AsInt64Value() <= 0xff);
@@ -3121,7 +3109,7 @@
     }                                                                          \
     return Api::Success();                                                     \
   }                                                                            \
-  return Api::NewError("Invalid length passed in to set array elements");      \
+  return Api::NewError("Invalid length passed in to set array elements");
 
 
 DART_EXPORT Dart_Handle Dart_ListSetAsBytes(Dart_Handle list,
@@ -3136,8 +3124,7 @@
       if (Utils::RangeCheck(offset, length, array.Length())) {
         NoSafepointScope no_safepoint;
         memmove(reinterpret_cast<uint8_t*>(array.DataAddr(offset)),
-                native_array,
-                length);
+                native_array, length);
         return Api::Success();
       }
       return Api::NewError("Invalid length passed in to access list elements");
@@ -3149,8 +3136,8 @@
     SET_LIST_ELEMENT_AS_BYTES(Array, obj, native_array, offset, length);
   }
   if (obj.IsGrowableObjectArray()) {
-    SET_LIST_ELEMENT_AS_BYTES(
-        GrowableObjectArray, obj, native_array, offset, length);
+    SET_LIST_ELEMENT_AS_BYTES(GrowableObjectArray, obj, native_array, offset,
+                              length);
   }
   if (obj.IsError()) {
     return list;
@@ -3163,10 +3150,9 @@
     const int kNumArgs = 3;
     ArgumentsDescriptor args_desc(
         Array::Handle(ArgumentsDescriptor::New(kNumArgs)));
-    const Function& function = Function::Handle(Z,
-        Resolver::ResolveDynamic(instance,
-                                 Symbols::AssignIndexToken(),
-                                 args_desc));
+    const Function& function = Function::Handle(
+        Z, Resolver::ResolveDynamic(instance, Symbols::AssignIndexToken(),
+                                    args_desc));
     if (!function.IsNull()) {
       Integer& indexobj = Integer::Handle(Z);
       Integer& valueobj = Integer::Handle(Z);
@@ -3177,8 +3163,8 @@
         valueobj = Integer::New(native_array[i]);
         args.SetAt(1, indexobj);
         args.SetAt(2, valueobj);
-        const Object& result = Object::Handle(Z,
-            DartEntry::InvokeFunction(function, args));
+        const Object& result =
+            Object::Handle(Z, DartEntry::InvokeFunction(function, args));
         if (result.IsError()) {
           return Api::NewHandle(T, result.raw());
         }
@@ -3219,10 +3205,9 @@
     if (!(key_obj.IsInstance() || key_obj.IsNull())) {
       return Api::NewError("Key is not an instance");
     }
-    return Api::NewHandle(T, Send1Arg(
-       instance,
-       String::Handle(Z, String::New("containsKey")),
-       Instance::Cast(key_obj)));
+    return Api::NewHandle(
+        T, Send1Arg(instance, String::Handle(Z, String::New("containsKey")),
+                    Instance::Cast(key_obj)));
   }
   return Api::NewError("Object does not implement the 'Map' interface");
 }
@@ -3234,14 +3219,13 @@
   Object& obj = Object::Handle(Z, Api::UnwrapHandle(map));
   Instance& instance = Instance::Handle(Z, GetMapInstance(Z, obj));
   if (!instance.IsNull()) {
-    const Object& iterator = Object::Handle(Send0Arg(
-        instance, String::Handle(Z, String::New("get:keys"))));
+    const Object& iterator = Object::Handle(
+        Send0Arg(instance, String::Handle(Z, String::New("get:keys"))));
     if (!iterator.IsInstance()) {
       return Api::NewHandle(T, iterator.raw());
     }
-    return Api::NewHandle(T, Send0Arg(
-        Instance::Cast(iterator),
-        String::Handle(String::New("toList"))));
+    return Api::NewHandle(T, Send0Arg(Instance::Cast(iterator),
+                                      String::Handle(String::New("toList"))));
   }
   return Api::NewError("Object does not implement the 'Map' interface");
 }
@@ -3253,67 +3237,67 @@
 static Dart_TypedData_Type GetType(intptr_t class_id) {
   Dart_TypedData_Type type;
   switch (class_id) {
-    case kByteDataViewCid :
+    case kByteDataViewCid:
       type = Dart_TypedData_kByteData;
       break;
-    case kTypedDataInt8ArrayCid :
-    case kTypedDataInt8ArrayViewCid :
-    case kExternalTypedDataInt8ArrayCid :
+    case kTypedDataInt8ArrayCid:
+    case kTypedDataInt8ArrayViewCid:
+    case kExternalTypedDataInt8ArrayCid:
       type = Dart_TypedData_kInt8;
       break;
-    case kTypedDataUint8ArrayCid :
-    case kTypedDataUint8ArrayViewCid :
-    case kExternalTypedDataUint8ArrayCid :
+    case kTypedDataUint8ArrayCid:
+    case kTypedDataUint8ArrayViewCid:
+    case kExternalTypedDataUint8ArrayCid:
       type = Dart_TypedData_kUint8;
       break;
-    case kTypedDataUint8ClampedArrayCid :
-    case kTypedDataUint8ClampedArrayViewCid :
-    case kExternalTypedDataUint8ClampedArrayCid :
+    case kTypedDataUint8ClampedArrayCid:
+    case kTypedDataUint8ClampedArrayViewCid:
+    case kExternalTypedDataUint8ClampedArrayCid:
       type = Dart_TypedData_kUint8Clamped;
       break;
-    case kTypedDataInt16ArrayCid :
-    case kTypedDataInt16ArrayViewCid :
-    case kExternalTypedDataInt16ArrayCid :
+    case kTypedDataInt16ArrayCid:
+    case kTypedDataInt16ArrayViewCid:
+    case kExternalTypedDataInt16ArrayCid:
       type = Dart_TypedData_kInt16;
       break;
-    case kTypedDataUint16ArrayCid :
-    case kTypedDataUint16ArrayViewCid :
-    case kExternalTypedDataUint16ArrayCid :
+    case kTypedDataUint16ArrayCid:
+    case kTypedDataUint16ArrayViewCid:
+    case kExternalTypedDataUint16ArrayCid:
       type = Dart_TypedData_kUint16;
       break;
-    case kTypedDataInt32ArrayCid :
-    case kTypedDataInt32ArrayViewCid :
-    case kExternalTypedDataInt32ArrayCid :
+    case kTypedDataInt32ArrayCid:
+    case kTypedDataInt32ArrayViewCid:
+    case kExternalTypedDataInt32ArrayCid:
       type = Dart_TypedData_kInt32;
       break;
-    case kTypedDataUint32ArrayCid :
-    case kTypedDataUint32ArrayViewCid :
-    case kExternalTypedDataUint32ArrayCid :
+    case kTypedDataUint32ArrayCid:
+    case kTypedDataUint32ArrayViewCid:
+    case kExternalTypedDataUint32ArrayCid:
       type = Dart_TypedData_kUint32;
       break;
-    case kTypedDataInt64ArrayCid :
-    case kTypedDataInt64ArrayViewCid :
-    case kExternalTypedDataInt64ArrayCid :
+    case kTypedDataInt64ArrayCid:
+    case kTypedDataInt64ArrayViewCid:
+    case kExternalTypedDataInt64ArrayCid:
       type = Dart_TypedData_kInt64;
       break;
-    case kTypedDataUint64ArrayCid :
-    case kTypedDataUint64ArrayViewCid :
-    case kExternalTypedDataUint64ArrayCid :
+    case kTypedDataUint64ArrayCid:
+    case kTypedDataUint64ArrayViewCid:
+    case kExternalTypedDataUint64ArrayCid:
       type = Dart_TypedData_kUint64;
       break;
-    case kTypedDataFloat32ArrayCid :
-    case kTypedDataFloat32ArrayViewCid :
-    case kExternalTypedDataFloat32ArrayCid :
+    case kTypedDataFloat32ArrayCid:
+    case kTypedDataFloat32ArrayViewCid:
+    case kExternalTypedDataFloat32ArrayCid:
       type = Dart_TypedData_kFloat32;
       break;
-    case kTypedDataFloat64ArrayCid :
-    case kTypedDataFloat64ArrayViewCid :
-    case kExternalTypedDataFloat64ArrayCid :
+    case kTypedDataFloat64ArrayCid:
+    case kTypedDataFloat64ArrayViewCid:
+    case kExternalTypedDataFloat64ArrayCid:
       type = Dart_TypedData_kFloat64;
       break;
-    case kTypedDataFloat32x4ArrayCid :
-    case kTypedDataFloat32x4ArrayViewCid :
-    case kExternalTypedDataFloat32x4ArrayCid :
+    case kTypedDataFloat32x4ArrayCid:
+    case kTypedDataFloat32x4ArrayViewCid:
+    case kExternalTypedDataFloat32x4ArrayCid:
       type = Dart_TypedData_kFloat32x4;
       break;
     default:
@@ -3335,8 +3319,8 @@
 }
 
 
-DART_EXPORT Dart_TypedData_Type Dart_GetTypeOfExternalTypedData(
-    Dart_Handle object) {
+DART_EXPORT Dart_TypedData_Type
+Dart_GetTypeOfExternalTypedData(Dart_Handle object) {
   API_TIMELINE_DURATION;
   intptr_t class_id = Api::ClassId(object);
   if (RawObject::IsExternalTypedDataClassId(class_id)) {
@@ -3366,11 +3350,8 @@
   const Class& cls = Class::Handle(
       thread->zone(), lib.LookupClassAllowPrivate(Symbols::ByteData()));
   ASSERT(!cls.IsNull());
-  return ResolveConstructor(CURRENT_FUNC,
-                            cls,
-                            Symbols::ByteData(),
-                            constructor_name,
-                            num_args);
+  return ResolveConstructor(CURRENT_FUNC, cls, Symbols::ByteData(),
+                            constructor_name, num_args);
 }
 
 
@@ -3397,31 +3378,29 @@
 }
 
 
-static Dart_Handle NewTypedData(Thread* thread,
-                                intptr_t cid,
-                                intptr_t length) {
+static Dart_Handle NewTypedData(Thread* thread, intptr_t cid, intptr_t length) {
   CHECK_LENGTH(length, TypedData::MaxElements(cid));
   return Api::NewHandle(thread, TypedData::New(cid, length));
 }
 
 
-static Dart_Handle NewExternalTypedData(
-    Thread* thread, intptr_t cid, void* data, intptr_t length) {
+static Dart_Handle NewExternalTypedData(Thread* thread,
+                                        intptr_t cid,
+                                        void* data,
+                                        intptr_t length) {
   CHECK_LENGTH(length, ExternalTypedData::MaxElements(cid));
   Zone* zone = thread->zone();
   intptr_t bytes = length * ExternalTypedData::ElementSizeInBytes(cid);
   const ExternalTypedData& result = ExternalTypedData::Handle(
-      zone,
-      ExternalTypedData::New(cid,
-                             reinterpret_cast<uint8_t*>(data),
-                             length,
-                             SpaceForExternal(thread, bytes)));
+      zone, ExternalTypedData::New(cid, reinterpret_cast<uint8_t*>(data),
+                                   length, SpaceForExternal(thread, bytes)));
   return Api::NewHandle(thread, result.raw());
 }
 
 
-static Dart_Handle NewExternalByteData(
-    Thread* thread, void* data, intptr_t length) {
+static Dart_Handle NewExternalByteData(Thread* thread,
+                                       void* data,
+                                       intptr_t length) {
   Zone* zone = thread->zone();
   Dart_Handle ext_data = NewExternalTypedData(
       thread, kExternalTypedDataUint8ArrayCid, data, length);
@@ -3461,29 +3440,29 @@
   DARTSCOPE(Thread::Current());
   CHECK_CALLBACK_STATE(T);
   switch (type) {
-    case Dart_TypedData_kByteData :
+    case Dart_TypedData_kByteData:
       return NewByteData(T, length);
-    case Dart_TypedData_kInt8 :
+    case Dart_TypedData_kInt8:
       return NewTypedData(T, kTypedDataInt8ArrayCid, length);
-    case Dart_TypedData_kUint8 :
+    case Dart_TypedData_kUint8:
       return NewTypedData(T, kTypedDataUint8ArrayCid, length);
-    case Dart_TypedData_kUint8Clamped :
+    case Dart_TypedData_kUint8Clamped:
       return NewTypedData(T, kTypedDataUint8ClampedArrayCid, length);
-    case Dart_TypedData_kInt16 :
+    case Dart_TypedData_kInt16:
       return NewTypedData(T, kTypedDataInt16ArrayCid, length);
-    case Dart_TypedData_kUint16 :
+    case Dart_TypedData_kUint16:
       return NewTypedData(T, kTypedDataUint16ArrayCid, length);
-    case Dart_TypedData_kInt32 :
+    case Dart_TypedData_kInt32:
       return NewTypedData(T, kTypedDataInt32ArrayCid, length);
-    case Dart_TypedData_kUint32 :
+    case Dart_TypedData_kUint32:
       return NewTypedData(T, kTypedDataUint32ArrayCid, length);
-    case Dart_TypedData_kInt64 :
+    case Dart_TypedData_kInt64:
       return NewTypedData(T, kTypedDataInt64ArrayCid, length);
-    case Dart_TypedData_kUint64 :
+    case Dart_TypedData_kUint64:
       return NewTypedData(T, kTypedDataUint64ArrayCid, length);
-    case Dart_TypedData_kFloat32 :
-      return NewTypedData(T, kTypedDataFloat32ArrayCid,  length);
-    case Dart_TypedData_kFloat64 :
+    case Dart_TypedData_kFloat32:
+      return NewTypedData(T, kTypedDataFloat32ArrayCid, length);
+    case Dart_TypedData_kFloat64:
       return NewTypedData(T, kTypedDataFloat64ArrayCid, length);
     case Dart_TypedData_kFloat32x4:
       return NewTypedData(T, kTypedDataFloat32x4ArrayCid, length);
@@ -3496,10 +3475,9 @@
 }
 
 
-DART_EXPORT Dart_Handle Dart_NewExternalTypedData(
-    Dart_TypedData_Type type,
-    void* data,
-    intptr_t length) {
+DART_EXPORT Dart_Handle Dart_NewExternalTypedData(Dart_TypedData_Type type,
+                                                  void* data,
+                                                  intptr_t length) {
   DARTSCOPE(Thread::Current());
   if (data == NULL && length != 0) {
     RETURN_NULL_ERROR(data);
@@ -3509,44 +3487,46 @@
     case Dart_TypedData_kByteData:
       return NewExternalByteData(T, data, length);
     case Dart_TypedData_kInt8:
-      return NewExternalTypedData(
-          T, kExternalTypedDataInt8ArrayCid, data, length);
+      return NewExternalTypedData(T, kExternalTypedDataInt8ArrayCid, data,
+                                  length);
     case Dart_TypedData_kUint8:
-      return NewExternalTypedData(
-          T, kExternalTypedDataUint8ArrayCid, data, length);
+      return NewExternalTypedData(T, kExternalTypedDataUint8ArrayCid, data,
+                                  length);
     case Dart_TypedData_kUint8Clamped:
-      return NewExternalTypedData(
-          T, kExternalTypedDataUint8ClampedArrayCid, data, length);
+      return NewExternalTypedData(T, kExternalTypedDataUint8ClampedArrayCid,
+                                  data, length);
     case Dart_TypedData_kInt16:
-      return NewExternalTypedData(
-          T, kExternalTypedDataInt16ArrayCid, data, length);
+      return NewExternalTypedData(T, kExternalTypedDataInt16ArrayCid, data,
+                                  length);
     case Dart_TypedData_kUint16:
-      return NewExternalTypedData(
-          T, kExternalTypedDataUint16ArrayCid, data, length);
+      return NewExternalTypedData(T, kExternalTypedDataUint16ArrayCid, data,
+                                  length);
     case Dart_TypedData_kInt32:
-      return NewExternalTypedData(
-          T, kExternalTypedDataInt32ArrayCid, data, length);
+      return NewExternalTypedData(T, kExternalTypedDataInt32ArrayCid, data,
+                                  length);
     case Dart_TypedData_kUint32:
-      return NewExternalTypedData(
-          T, kExternalTypedDataUint32ArrayCid, data, length);
+      return NewExternalTypedData(T, kExternalTypedDataUint32ArrayCid, data,
+                                  length);
     case Dart_TypedData_kInt64:
-      return NewExternalTypedData(
-          T, kExternalTypedDataInt64ArrayCid, data, length);
+      return NewExternalTypedData(T, kExternalTypedDataInt64ArrayCid, data,
+                                  length);
     case Dart_TypedData_kUint64:
-      return NewExternalTypedData(
-          T, kExternalTypedDataUint64ArrayCid, data, length);
+      return NewExternalTypedData(T, kExternalTypedDataUint64ArrayCid, data,
+                                  length);
     case Dart_TypedData_kFloat32:
-      return NewExternalTypedData(
-          T, kExternalTypedDataFloat32ArrayCid, data, length);
+      return NewExternalTypedData(T, kExternalTypedDataFloat32ArrayCid, data,
+                                  length);
     case Dart_TypedData_kFloat64:
-      return NewExternalTypedData(
-          T, kExternalTypedDataFloat64ArrayCid, data, length);
+      return NewExternalTypedData(T, kExternalTypedDataFloat64ArrayCid, data,
+                                  length);
     case Dart_TypedData_kFloat32x4:
-      return NewExternalTypedData(
-          T, kExternalTypedDataFloat32x4ArrayCid, data, length);
+      return NewExternalTypedData(T, kExternalTypedDataFloat32x4ArrayCid, data,
+                                  length);
     default:
-      return Api::NewError("%s expects argument 'type' to be of"
-                           " 'external TypedData'", CURRENT_FUNC);
+      return Api::NewError(
+          "%s expects argument 'type' to be of"
+          " 'external TypedData'",
+          CURRENT_FUNC);
   }
   UNREACHABLE();
   return Api::Null();
@@ -3560,13 +3540,10 @@
   const Library& lib =
       Library::Handle(thread->isolate()->object_store()->typed_data_library());
   ASSERT(!lib.IsNull());
-  const Class& cls = Class::Handle(
-      thread->zone(), lib.LookupClassAllowPrivate(class_name));
+  const Class& cls =
+      Class::Handle(thread->zone(), lib.LookupClassAllowPrivate(class_name));
   ASSERT(!cls.IsNull());
-  return ResolveConstructor(CURRENT_FUNC,
-                            cls,
-                            class_name,
-                            constructor_name,
+  return ResolveConstructor(CURRENT_FUNC, cls, class_name, constructor_name,
                             num_args);
 }
 
@@ -3580,10 +3557,8 @@
     RETURN_TYPE_ERROR(Z, typed_data, 'TypedData');
   }
   Object& result = Object::Handle(Z);
-  result = GetByteBufferConstructor(T,
-                                    Symbols::ByteBuffer(),
-                                    Symbols::ByteBufferDot_New(),
-                                    1);
+  result = GetByteBufferConstructor(T, Symbols::ByteBuffer(),
+                                    Symbols::ByteBufferDot_New(), 1);
   ASSERT(!result.IsNull());
   ASSERT(result.IsFunction());
   const Function& factory = Function::Cast(result);
@@ -3791,12 +3766,9 @@
       // the lookup, it can be confusing to the user to figure out
       // what's going on.  Be a little more explicit for these error
       // messages.
-      const String& message = String::Handle(
-          String::NewFormatted(
-              "%s: could not find factory '%s' in class '%s'.",
-              current_func,
-              constr_name.ToCString(),
-              lookup_class_name.ToCString()));
+      const String& message = String::Handle(String::NewFormatted(
+          "%s: could not find factory '%s' in class '%s'.", current_func,
+          constr_name.ToCString(), lookup_class_name.ToCString()));
       return ApiError::New(message);
     } else {
       const String& message = String::Handle(
@@ -3807,15 +3779,12 @@
   }
   int extra_args = 1;
   String& error_message = String::Handle();
-  if (!constructor.AreValidArgumentCounts(num_args + extra_args,
-                                          0,
+  if (!constructor.AreValidArgumentCounts(num_args + extra_args, 0,
                                           &error_message)) {
-    const String& message = String::Handle(
-        String::NewFormatted("%s: wrong argument count for "
-                             "constructor '%s': %s.",
-                             current_func,
-                             constr_name.ToCString(),
-                             error_message.ToCString()));
+    const String& message = String::Handle(String::NewFormatted(
+        "%s: wrong argument count for "
+        "constructor '%s': %s.",
+        current_func, constr_name.ToCString(), error_message.ToCString()));
     return ApiError::New(message);
   }
   return constructor.raw();
@@ -3868,11 +3837,8 @@
   // Resolve the constructor.
   String& constr_name =
       String::Handle(String::Concat(base_constructor_name, dot_name));
-  result = ResolveConstructor("Dart_New",
-                              cls,
-                              base_constructor_name,
-                              constr_name,
-                              number_of_arguments);
+  result = ResolveConstructor("Dart_New", cls, base_constructor_name,
+                              constr_name, number_of_arguments);
   if (result.IsError()) {
     return Api::NewHandle(T, result.raw());
   }
@@ -3894,9 +3860,8 @@
       // The type arguments of the redirection type are instantiated from the
       // type arguments of the type argument.
       Error& bound_error = Error::Handle();
-      redirect_type ^= redirect_type.InstantiateFrom(type_arguments,
-                                                     &bound_error,
-                                                     NULL, NULL, Heap::kNew);
+      redirect_type ^= redirect_type.InstantiateFrom(
+          type_arguments, &bound_error, NULL, NULL, Heap::kNew);
       if (!bound_error.IsNull()) {
         return Api::NewHandle(T, bound_error.raw());
       }
@@ -3944,8 +3909,8 @@
         return Api::NewHandle(T, argument.raw());
       } else {
         return Api::NewError(
-            "%s expects arguments[%d] to be an Instance handle.",
-            CURRENT_FUNC, i);
+            "%s expects arguments[%d] to be an Instance handle.", CURRENT_FUNC,
+            i);
       }
     }
     args.SetAt(arg_index++, argument);
@@ -4018,10 +3983,10 @@
 }
 
 
-DART_EXPORT Dart_Handle Dart_AllocateWithNativeFields(
-    Dart_Handle type,
-    intptr_t num_native_fields,
-    const intptr_t* native_fields) {
+DART_EXPORT Dart_Handle
+Dart_AllocateWithNativeFields(Dart_Handle type,
+                              intptr_t num_native_fields,
+                              const intptr_t* native_fields) {
   DARTSCOPE(Thread::Current());
   CHECK_CALLBACK_STATE(T);
 
@@ -4072,8 +4037,8 @@
         return Api::NewHandle(thread, arg.raw());
       } else {
         return Api::NewError(
-            "%s expects arguments[%d] to be an Instance handle.",
-            "Dart_Invoke", i);
+            "%s expects arguments[%d] to be an Instance handle.", "Dart_Invoke",
+            i);
       }
     }
     args->SetAt((i + extra_args), arg);
@@ -4107,7 +4072,8 @@
 
   // Construct name of the constructor to invoke.
   const String& constructor_name = Api::UnwrapStringHandle(Z, name);
-  const AbstractType& type_obj = AbstractType::Handle(Z, instance.GetType());
+  const AbstractType& type_obj =
+      AbstractType::Handle(Z, instance.GetType(Heap::kNew));
   const Class& cls = Class::Handle(Z, type_obj.type_class());
   const String& class_name = String::Handle(Z, cls.Name());
   const Array& strings = Array::Handle(Z, Array::New(3));
@@ -4124,10 +4090,8 @@
   const Function& constructor =
       Function::Handle(Z, cls.LookupFunctionAllowPrivate(dot_name));
   const int extra_args = 1;
-  if (!constructor.IsNull() &&
-      constructor.IsGenerativeConstructor() &&
-      constructor.AreValidArgumentCounts(number_of_arguments + extra_args,
-                                         0,
+  if (!constructor.IsNull() && constructor.IsGenerativeConstructor() &&
+      constructor.AreValidArgumentCounts(number_of_arguments + extra_args, 0,
                                          NULL)) {
     // Create the argument list.
     // Constructors get the uninitialized object.
@@ -4140,12 +4104,12 @@
     }
     Dart_Handle result;
     Array& args = Array::Handle(Z);
-    result = SetupArguments(
-        T, number_of_arguments, arguments, extra_args, &args);
+    result =
+        SetupArguments(T, number_of_arguments, arguments, extra_args, &args);
     if (!::Dart_IsError(result)) {
       args.SetAt(0, instance);
-      const Object& retval = Object::Handle(Z,
-          DartEntry::InvokeFunction(constructor, args));
+      const Object& retval =
+          Object::Handle(Z, DartEntry::InvokeFunction(constructor, args));
       if (retval.IsError()) {
         result = Api::NewHandle(T, retval.raw());
       } else {
@@ -4154,9 +4118,8 @@
     }
     return result;
   }
-  return Api::NewError(
-      "%s expects argument 'name' to be a valid constructor.",
-      CURRENT_FUNC);
+  return Api::NewError("%s expects argument 'name' to be a valid constructor.",
+                       CURRENT_FUNC);
 }
 
 
@@ -4191,27 +4154,23 @@
     }
 
     const Class& cls = Class::Handle(Z, Type::Cast(obj).type_class());
-    const Function& function = Function::Handle(Z,
-        Resolver::ResolveStaticAllowPrivate(cls,
-                                            function_name,
-                                            number_of_arguments,
-                                            Object::empty_array()));
+    const Function& function = Function::Handle(
+        Z, Resolver::ResolveStaticAllowPrivate(
+               cls, function_name, number_of_arguments, Object::empty_array()));
     if (function.IsNull()) {
       const String& cls_name = String::Handle(Z, cls.Name());
       return Api::NewError("%s: did not find static method '%s.%s'.",
-                           CURRENT_FUNC,
-                           cls_name.ToCString(),
+                           CURRENT_FUNC, cls_name.ToCString(),
                            function_name.ToCString());
     }
-    NOT_IN_PRODUCT(if (tds.enabled()) {
+#if !defined(PRODUCT)
+    if (tds.enabled()) {
       const String& cls_name = String::Handle(Z, cls.Name());
       tds.SetNumArguments(1);
-      tds.FormatArgument(0,
-                         "name",
-                         "%s.%s",
-                         cls_name.ToCString(),
+      tds.FormatArgument(0, "name", "%s.%s", cls_name.ToCString(),
                          function_name.ToCString());
-    });
+    }
+#endif  // !defined(PRODUCT)
     // Setup args and check for malformed arguments in the arguments list.
     result = SetupArguments(T, number_of_arguments, arguments, 0, &args);
     if (!::Dart_IsError(result)) {
@@ -4226,38 +4185,31 @@
     instance ^= obj.raw();
     ArgumentsDescriptor args_desc(
         Array::Handle(Z, ArgumentsDescriptor::New(number_of_arguments + 1)));
-    const Function& function = Function::Handle(Z,
-        Resolver::ResolveDynamic(instance, function_name, args_desc));
+    const Function& function = Function::Handle(
+        Z, Resolver::ResolveDynamic(instance, function_name, args_desc));
     if (function.IsNull()) {
       // Setup args and check for malformed arguments in the arguments list.
-      result = SetupArguments(T,
-                              number_of_arguments,
-                              arguments,
-                              1,
-                              &args);
+      result = SetupArguments(T, number_of_arguments, arguments, 1, &args);
       if (!::Dart_IsError(result)) {
         args.SetAt(0, instance);
         const Array& args_descriptor =
-          Array::Handle(Z, ArgumentsDescriptor::New(args.Length()));
-        result = Api::NewHandle(T,
-                                DartEntry::InvokeNoSuchMethod(instance,
-                                                              function_name,
-                                                              args,
-                                                              args_descriptor));
+            Array::Handle(Z, ArgumentsDescriptor::New(args.Length()));
+        result = Api::NewHandle(
+            T, DartEntry::InvokeNoSuchMethod(instance, function_name, args,
+                                             args_descriptor));
       }
       return result;
     }
-    NOT_IN_PRODUCT(if (tds.enabled()) {
+#if !defined(PRODUCT)
+    if (tds.enabled()) {
       const Class& cls = Class::Handle(Z, instance.clazz());
       ASSERT(!cls.IsNull());
       const String& cls_name = String::Handle(Z, cls.Name());
       tds.SetNumArguments(1);
-      tds.FormatArgument(0,
-                         "name",
-                         "%s.%s",
-                         cls_name.ToCString(),
+      tds.FormatArgument(0, "name", "%s.%s", cls_name.ToCString(),
                          function_name.ToCString());
-    });
+    }
+#endif  // !defined(PRODUCT)
     // Setup args and check for malformed arguments in the arguments list.
     result = SetupArguments(T, number_of_arguments, arguments, 1, &args);
     if (!::Dart_IsError(result)) {
@@ -4271,38 +4223,33 @@
 
     // Check that the library is loaded.
     if (!lib.Loaded()) {
-      return Api::NewError(
-          "%s expects library argument 'target' to be loaded.",
-          CURRENT_FUNC);
+      return Api::NewError("%s expects library argument 'target' to be loaded.",
+                           CURRENT_FUNC);
     }
 
     const Function& function =
         Function::Handle(Z, lib.LookupFunctionAllowPrivate(function_name));
     if (function.IsNull()) {
       return Api::NewError("%s: did not find top-level function '%s'.",
-                           CURRENT_FUNC,
-                           function_name.ToCString());
+                           CURRENT_FUNC, function_name.ToCString());
     }
 
-    NOT_IN_PRODUCT(if (tds.enabled()) {
+#if !defined(PRODUCT)
+    if (tds.enabled()) {
       const String& lib_name = String::Handle(Z, lib.url());
       tds.SetNumArguments(1);
-      tds.FormatArgument(0,
-                         "name",
-                         "%s.%s",
-                         lib_name.ToCString(),
+      tds.FormatArgument(0, "name", "%s.%s", lib_name.ToCString(),
                          function_name.ToCString());
-    });
+    }
+#endif  // !defined(PRODUCT)
 
     // LookupFunctionAllowPrivate does not check argument arity, so we
     // do it here.
     String& error_message = String::Handle(Z);
-    if (!function.AreValidArgumentCounts(number_of_arguments,
-                                         0,
+    if (!function.AreValidArgumentCounts(number_of_arguments, 0,
                                          &error_message)) {
       return Api::NewError("%s: wrong argument count for function '%s': %s.",
-                           CURRENT_FUNC,
-                           function_name.ToCString(),
+                           CURRENT_FUNC, function_name.ToCString(),
                            error_message.ToCString());
     }
     // Setup args and check for malformed arguments in the arguments list.
@@ -4384,14 +4331,14 @@
       getter = cls.LookupStaticFunctionAllowPrivate(getter_name);
     }
 
-    NOT_IN_PRODUCT(if (tds.enabled()) {
+#if !defined(PRODUCT)
+    if (tds.enabled()) {
       const String& cls_name = String::Handle(cls.Name());
       tds.SetNumArguments(1);
-      tds.FormatArgument(0,
-                         "name",
-                         "%s.%s",
-                         cls_name.ToCString(), field_name.ToCString());
-    });
+      tds.FormatArgument(0, "name", "%s.%s", cls_name.ToCString(),
+                         field_name.ToCString());
+    }
+#endif  // !defined(PRODUCT)
 
     if (!getter.IsNull()) {
       // Invoke the getter and return the result.
@@ -4400,8 +4347,8 @@
     } else if (!field.IsNull()) {
       return Api::NewHandle(T, field.StaticValue());
     } else {
-      return Api::NewError("%s: did not find static field '%s'.",
-                           CURRENT_FUNC, field_name.ToCString());
+      return Api::NewError("%s: did not find static field '%s'.", CURRENT_FUNC,
+                           field_name.ToCString());
     }
 
   } else if (obj.IsInstance()) {
@@ -4419,14 +4366,14 @@
       cls = cls.SuperClass();
     }
 
-    NOT_IN_PRODUCT(if (tds.enabled()) {
+#if !defined(PRODUCT)
+    if (tds.enabled()) {
       const String& cls_name = String::Handle(cls.Name());
       tds.SetNumArguments(1);
-      tds.FormatArgument(0,
-                         "name",
-                         "%s.%s",
-                         cls_name.ToCString(), field_name.ToCString());
-    });
+      tds.FormatArgument(0, "name", "%s.%s", cls_name.ToCString(),
+                         field_name.ToCString());
+    }
+#endif  // !defined(PRODUCT)
 
     // Invoke the getter and return the result.
     const int kNumArgs = 1;
@@ -4435,10 +4382,9 @@
     if (getter.IsNull()) {
       const Array& args_descriptor =
           Array::Handle(Z, ArgumentsDescriptor::New(args.Length()));
-      return Api::NewHandle(T, DartEntry::InvokeNoSuchMethod(instance,
-                                                             getter_name,
-                                                             args,
-                                                             args_descriptor));
+      return Api::NewHandle(
+          T, DartEntry::InvokeNoSuchMethod(instance, getter_name, args,
+                                           args_descriptor));
     }
     return Api::NewHandle(T, DartEntry::InvokeFunction(getter, args));
 
@@ -4462,19 +4408,19 @@
     } else if (!field.IsNull() && field.IsUninitialized()) {
       // A field was found.  Check for a getter in the field's owner classs.
       const Class& cls = Class::Handle(Z, field.Owner());
-      const String& getter_name = String::Handle(Z,
-          Field::GetterName(field_name));
+      const String& getter_name =
+          String::Handle(Z, Field::GetterName(field_name));
       getter = cls.LookupStaticFunctionAllowPrivate(getter_name);
     }
 
-    NOT_IN_PRODUCT(if (tds.enabled()) {
+#if !defined(PRODUCT)
+    if (tds.enabled()) {
       const String& lib_name = String::Handle(lib.url());
       tds.SetNumArguments(1);
-      tds.FormatArgument(0,
-                         "name",
-                         "%s.%s",
-                         lib_name.ToCString(), field_name.ToCString());
-    });
+      tds.FormatArgument(0, "name", "%s.%s", lib_name.ToCString(),
+                         field_name.ToCString());
+    }
+#endif  // !defined(PRODUCT)
 
     if (!getter.IsNull()) {
       // Invoke the getter and return the result.
@@ -4488,7 +4434,7 @@
                          CURRENT_FUNC, field_name.ToCString());
 
   } else if (obj.IsError()) {
-      return container;
+    return container;
   } else {
     return Api::NewError(
         "%s expects argument 'container' to be an object, type, or library.",
@@ -4545,8 +4491,8 @@
       const int kNumArgs = 1;
       const Array& args = Array::Handle(Z, Array::New(kNumArgs));
       args.SetAt(0, value_instance);
-      const Object& result = Object::Handle(Z,
-          DartEntry::InvokeFunction(setter, args));
+      const Object& result =
+          Object::Handle(Z, DartEntry::InvokeFunction(setter, args));
       if (result.IsError()) {
         return Api::NewHandle(T, result.raw());
       } else {
@@ -4554,15 +4500,15 @@
       }
     } else if (!field.IsNull()) {
       if (field.is_final()) {
-        return Api::NewError("%s: cannot set final field '%s'.",
-                             CURRENT_FUNC, field_name.ToCString());
+        return Api::NewError("%s: cannot set final field '%s'.", CURRENT_FUNC,
+                             field_name.ToCString());
       } else {
         field.SetStaticValue(value_instance);
         return Api::Success();
       }
     } else {
-      return Api::NewError("%s: did not find static field '%s'.",
-                           CURRENT_FUNC, field_name.ToCString());
+      return Api::NewError("%s: did not find static field '%s'.", CURRENT_FUNC,
+                           field_name.ToCString());
     }
 
   } else if (obj.IsInstance()) {
@@ -4575,8 +4521,8 @@
     while (!cls.IsNull()) {
       field = cls.LookupInstanceFieldAllowPrivate(field_name);
       if (!field.IsNull() && field.is_final()) {
-        return Api::NewError("%s: cannot set final field '%s'.",
-                             CURRENT_FUNC, field_name.ToCString());
+        return Api::NewError("%s: cannot set final field '%s'.", CURRENT_FUNC,
+                             field_name.ToCString());
       }
       setter = cls.LookupDynamicFunctionAllowPrivate(setter_name);
       if (!setter.IsNull()) {
@@ -4593,10 +4539,9 @@
     if (setter.IsNull()) {
       const Array& args_descriptor =
           Array::Handle(Z, ArgumentsDescriptor::New(args.Length()));
-      return Api::NewHandle(T, DartEntry::InvokeNoSuchMethod(instance,
-                                                             setter_name,
-                                                             args,
-                                                             args_descriptor));
+      return Api::NewHandle(
+          T, DartEntry::InvokeNoSuchMethod(instance, setter_name, args,
+                                           args_descriptor));
     }
     return Api::NewHandle(T, DartEntry::InvokeFunction(setter, args));
 
@@ -4749,8 +4694,8 @@
   CHECK_CALLBACK_STATE(T);
 
   String& cls_symbol = String::Handle(Z, Symbols::New(T, cls_name));
-  const Class& cls = Class::Handle(Z,
-      Class::NewNativeWrapper(lib, cls_symbol, field_count));
+  const Class& cls =
+      Class::Handle(Z, Class::NewNativeWrapper(lib, cls_symbol, field_count));
   if (cls.IsNull()) {
     return Api::NewError(
         "Unable to create native wrapper class : already exists");
@@ -4831,28 +4776,29 @@
   }
   for (int i = 0; i < num_arguments; i++) {
     Dart_NativeArgument_Descriptor desc = argument_descriptors[i];
-    Dart_NativeArgument_Type arg_type = static_cast<Dart_NativeArgument_Type>(
-        desc.type);
+    Dart_NativeArgument_Type arg_type =
+        static_cast<Dart_NativeArgument_Type>(desc.type);
     int arg_index = desc.index;
     ASSERT(arg_index >= 0 && arg_index < arguments->NativeArgCount());
     Dart_NativeArgument_Value* native_value = &(arg_values[i]);
     switch (arg_type) {
       case Dart_NativeArgument_kBool:
-        if (!Api::GetNativeBooleanArgument(arguments,
-                                           arg_index,
+        if (!Api::GetNativeBooleanArgument(arguments, arg_index,
                                            &(native_value->as_bool))) {
-          return Api::NewError("%s: expects argument at index %d to be of"
-                               " type Boolean.", CURRENT_FUNC, i);
+          return Api::NewError(
+              "%s: expects argument at index %d to be of"
+              " type Boolean.",
+              CURRENT_FUNC, i);
         }
         break;
 
       case Dart_NativeArgument_kInt32: {
         int64_t value = 0;
-        if (!GetNativeIntegerArgument(arguments,
-                                      arg_index,
-                                      &value)) {
-          return Api::NewError("%s: expects argument at index %d to be of"
-                               " type Integer.", CURRENT_FUNC, i);
+        if (!GetNativeIntegerArgument(arguments, arg_index, &value)) {
+          return Api::NewError(
+              "%s: expects argument at index %d to be of"
+              " type Integer.",
+              CURRENT_FUNC, i);
         }
         if (value < INT_MIN || value > INT_MAX) {
           return Api::NewError("%s: argument value at index %d is out of range",
@@ -4864,11 +4810,11 @@
 
       case Dart_NativeArgument_kUint32: {
         int64_t value = 0;
-        if (!GetNativeIntegerArgument(arguments,
-                                      arg_index,
-                                      &value)) {
-          return Api::NewError("%s: expects argument at index %d to be of"
-                               " type Integer.", CURRENT_FUNC, i);
+        if (!GetNativeIntegerArgument(arguments, arg_index, &value)) {
+          return Api::NewError(
+              "%s: expects argument at index %d to be of"
+              " type Integer.",
+              CURRENT_FUNC, i);
         }
         if (value < 0 || value > UINT_MAX) {
           return Api::NewError("%s: argument value at index %d is out of range",
@@ -4880,11 +4826,11 @@
 
       case Dart_NativeArgument_kInt64: {
         int64_t value = 0;
-        if (!GetNativeIntegerArgument(arguments,
-                                      arg_index,
-                                      &value)) {
-          return Api::NewError("%s: expects argument at index %d to be of"
-                               " type Integer.", CURRENT_FUNC, i);
+        if (!GetNativeIntegerArgument(arguments, arg_index, &value)) {
+          return Api::NewError(
+              "%s: expects argument at index %d to be of"
+              " type Integer.",
+              CURRENT_FUNC, i);
         }
         native_value->as_int64 = value;
         break;
@@ -4892,42 +4838,41 @@
 
       case Dart_NativeArgument_kUint64: {
         uint64_t value = 0;
-        if (!GetNativeUnsignedIntegerArgument(arguments,
-                                              arg_index,
-                                              &value)) {
-          return Api::NewError("%s: expects argument at index %d to be of"
-                               " type Integer.", CURRENT_FUNC, i);
+        if (!GetNativeUnsignedIntegerArgument(arguments, arg_index, &value)) {
+          return Api::NewError(
+              "%s: expects argument at index %d to be of"
+              " type Integer.",
+              CURRENT_FUNC, i);
         }
         native_value->as_uint64 = value;
         break;
       }
 
       case Dart_NativeArgument_kDouble:
-        if (!GetNativeDoubleArgument(arguments,
-                                     arg_index,
+        if (!GetNativeDoubleArgument(arguments, arg_index,
                                      &(native_value->as_double))) {
-          return Api::NewError("%s: expects argument at index %d to be of"
-                               " type Double.", CURRENT_FUNC, i);
+          return Api::NewError(
+              "%s: expects argument at index %d to be of"
+              " type Double.",
+              CURRENT_FUNC, i);
         }
         break;
 
       case Dart_NativeArgument_kString:
-        if (!GetNativeStringArgument(arguments,
-                                     arg_index,
+        if (!GetNativeStringArgument(arguments, arg_index,
                                      &(native_value->as_string.dart_str),
                                      &(native_value->as_string.peer))) {
-          return Api::NewError("%s: expects argument at index %d to be of"
-                               " type String.", CURRENT_FUNC, i);
+          return Api::NewError(
+              "%s: expects argument at index %d to be of"
+              " type String.",
+              CURRENT_FUNC, i);
         }
         break;
 
       case Dart_NativeArgument_kNativeFields: {
         Dart_Handle result = GetNativeFieldsOfArgument(
-            arguments,
-            arg_index,
-            native_value->as_native_fields.num_fields,
-            native_value->as_native_fields.values,
-            CURRENT_FUNC);
+            arguments, arg_index, native_value->as_native_fields.num_fields,
+            native_value->as_native_fields.values, CURRENT_FUNC);
         if (result != Api::Success()) {
           return result;
         }
@@ -4943,8 +4888,8 @@
       }
 
       default:
-        return Api::NewError("%s: invalid argument type %d.",
-                             CURRENT_FUNC, arg_type);
+        return Api::NewError("%s: invalid argument type %d.", CURRENT_FUNC,
+                             arg_type);
     }
   }
   return Api::Success();
@@ -4959,8 +4904,7 @@
         "%s: argument 'index' out of range. Expected 0..%d but saw %d.",
         CURRENT_FUNC, arguments->NativeArgCount() - 1, index);
   }
-  return Api::NewHandle(arguments->thread(),
-                        arguments->NativeArgAt(index));
+  return Api::NewHandle(arguments->thread(), arguments->NativeArgAt(index));
 }
 
 
@@ -4970,11 +4914,11 @@
 }
 
 
-DART_EXPORT Dart_Handle Dart_GetNativeFieldsOfArgument(
-    Dart_NativeArguments args,
-    int arg_index,
-    int num_fields,
-    intptr_t* field_values) {
+DART_EXPORT Dart_Handle
+Dart_GetNativeFieldsOfArgument(Dart_NativeArguments args,
+                               int arg_index,
+                               int num_fields,
+                               intptr_t* field_values) {
   NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args);
   if ((arg_index < 0) || (arg_index >= arguments->NativeArgCount())) {
     return Api::NewError(
@@ -4984,11 +4928,8 @@
   if (field_values == NULL) {
     RETURN_NULL_ERROR(field_values);
   }
-  return GetNativeFieldsOfArgument(arguments,
-                                   arg_index,
-                                   num_fields,
-                                   field_values,
-                                   CURRENT_FUNC);
+  return GetNativeFieldsOfArgument(arguments, arg_index, num_fields,
+                                   field_values, CURRENT_FUNC);
 }
 
 
@@ -5002,8 +4943,10 @@
   if (Api::GetNativeReceiver(arguments, value)) {
     return Api::Success();
   }
-  return Api::NewError("%s expects receiver argument to be non-null and of"
-                       " type Instance.", CURRENT_FUNC);
+  return Api::NewError(
+      "%s expects receiver argument to be non-null and of"
+      " type Instance.",
+      CURRENT_FUNC);
 }
 
 
@@ -5013,8 +4956,10 @@
   NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args);
   Dart_Handle result = Api::Null();
   if (!GetNativeStringArgument(arguments, arg_index, &result, peer)) {
-    return Api::NewError("%s expects argument at %d to be of"
-                         " type String.", CURRENT_FUNC, arg_index);
+    return Api::NewError(
+        "%s expects argument at %d to be of"
+        " type String.",
+        CURRENT_FUNC, arg_index);
   }
   return result;
 }
@@ -5030,8 +4975,10 @@
         CURRENT_FUNC, arguments->NativeArgCount() - 1, index);
   }
   if (!GetNativeIntegerArgument(arguments, index, value)) {
-    return Api::NewError("%s: expects argument at %d to be of"
-                         " type Integer.", CURRENT_FUNC, index);
+    return Api::NewError(
+        "%s: expects argument at %d to be of"
+        " type Integer.",
+        CURRENT_FUNC, index);
   }
   return Api::Success();
 }
@@ -5064,8 +5011,10 @@
         CURRENT_FUNC, arguments->NativeArgCount() - 1, index);
   }
   if (!GetNativeDoubleArgument(arguments, index, value)) {
-    return Api::NewError("%s: expects argument at %d to be of"
-                         " type Double.", CURRENT_FUNC, index);
+    return Api::NewError(
+        "%s: expects argument at %d to be of"
+        " type Double.",
+        CURRENT_FUNC, index);
   }
   return Api::Success();
 }
@@ -5075,8 +5024,7 @@
                                      Dart_Handle retval) {
   NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args);
   ASSERT(arguments->thread()->isolate() == Isolate::Current());
-  if ((retval != Api::Null()) &&
-      !Api::IsInstance(retval) &&
+  if ((retval != Api::Null()) && !Api::IsInstance(retval) &&
       !Api::IsError(retval)) {
     // Print the current stack trace to make the problematic caller
     // easier to find.
@@ -5084,8 +5032,10 @@
     OS::PrintErr("=== Current Trace:\n%s===\n", stacktrace.ToCString());
 
     const Object& ret_obj = Object::Handle(Api::UnwrapHandle(retval));
-    FATAL1("Return value check failed: saw '%s' expected a dart Instance or "
-           "an Error.", ret_obj.ToCString());
+    FATAL1(
+        "Return value check failed: saw '%s' expected a dart Instance or "
+        "an Error.",
+        ret_obj.ToCString());
   }
   ASSERT(retval != 0);
   Api::SetReturnValue(arguments, retval);
@@ -5142,7 +5092,7 @@
         }
       }
     }
-    // Check for default VM provided values. If it was not overriden on the
+    // Check for default VM provided values. If it was not overridden on the
     // command line.
     if (Symbols::DartIsVM().Equals(name)) {
       return Symbols::True().raw();
@@ -5163,8 +5113,8 @@
     if (::Dart_IsString(response)) {
       result ^= Api::UnwrapHandle(response);
     } else if (::Dart_IsError(response)) {
-      const Object& error = Object::Handle(
-          thread->zone(), Api::UnwrapHandle(response));
+      const Object& error =
+          Object::Handle(thread->zone(), Api::UnwrapHandle(response));
       Exceptions::ThrowArgumentError(
           String::Handle(String::New(Error::Cast(error).ToErrorCString())));
     } else if (!::Dart_IsNull(response)) {
@@ -5177,8 +5127,8 @@
 }
 
 
-DART_EXPORT Dart_Handle Dart_SetEnvironmentCallback(
-    Dart_EnvironmentCallback callback) {
+DART_EXPORT Dart_Handle
+Dart_SetEnvironmentCallback(Dart_EnvironmentCallback callback) {
   Isolate* isolate = Isolate::Current();
   CHECK_ISOLATE(isolate);
   isolate->set_environment_callback(callback);
@@ -5220,8 +5170,8 @@
 
 // --- Scripts and Libraries ---
 
-DART_EXPORT Dart_Handle Dart_SetLibraryTagHandler(
-    Dart_LibraryTagHandler handler) {
+DART_EXPORT Dart_Handle
+Dart_SetLibraryTagHandler(Dart_LibraryTagHandler handler) {
   Isolate* isolate = Isolate::Current();
   CHECK_ISOLATE(isolate);
   isolate->set_library_tag_handler(handler);
@@ -5246,8 +5196,8 @@
 
   const char* resolved_uri;
   if (!ResolveUri(uri.ToCString(), base_uri.ToCString(), &resolved_uri)) {
-    return Api::NewError("%s: Unable to canonicalize uri '%s'.",
-                         CURRENT_FUNC, uri.ToCString());
+    return Api::NewError("%s: Unable to canonicalize uri '%s'.", CURRENT_FUNC,
+                         uri.ToCString());
   }
   return Api::NewHandle(T, String::New(resolved_uri));
 }
@@ -5349,12 +5299,16 @@
 
   const Snapshot* snapshot = Snapshot::SetupFromBuffer(buffer);
   if (snapshot == NULL) {
-    return Api::NewError("%s expects parameter 'buffer' to be a script type"
-                         " snapshot with a valid length.", CURRENT_FUNC);
+    return Api::NewError(
+        "%s expects parameter 'buffer' to be a script type"
+        " snapshot with a valid length.",
+        CURRENT_FUNC);
   }
   if (snapshot->kind() != Snapshot::kScript) {
-    return Api::NewError("%s expects parameter 'buffer' to be a script type"
-                         " snapshot.", CURRENT_FUNC);
+    return Api::NewError(
+        "%s expects parameter 'buffer' to be a script type"
+        " snapshot.",
+        CURRENT_FUNC);
   }
   if (snapshot->length() != buffer_len) {
     return Api::NewError("%s: 'buffer_len' of %" Pd " is not equal to %" Pd
@@ -5371,20 +5325,22 @@
   CHECK_COMPILATION_ALLOWED(I);
 
   ASSERT(snapshot->kind() == Snapshot::kScript);
-  NOT_IN_PRODUCT(TimelineDurationScope tds2(T,
-      Timeline::GetIsolateStream(), "ScriptSnapshotReader"));
+  NOT_IN_PRODUCT(TimelineDurationScope tds2(T, Timeline::GetIsolateStream(),
+                                            "ScriptSnapshotReader"));
 
   ScriptSnapshotReader reader(snapshot->content(), snapshot->length(), T);
   const Object& tmp = Object::Handle(Z, reader.ReadScriptSnapshot());
   if (tmp.IsError()) {
     return Api::NewHandle(T, tmp.raw());
   }
-  NOT_IN_PRODUCT(if (tds2.enabled()) {
+#if !defined(PRODUCT)
+  if (tds2.enabled()) {
     tds2.SetNumArguments(2);
     tds2.FormatArgument(0, "snapshotSize", "%" Pd, snapshot->length());
     tds2.FormatArgument(1, "heapSize", "%" Pd64,
                         I->heap()->UsedInWords(Heap::kOld) * kWordSize);
-  });
+  }
+#endif  // !defined(PRODUCT)
   library ^= tmp.raw();
   library.set_debuggable(true);
   I->object_store()->set_root_library(library);
@@ -5392,6 +5348,58 @@
 }
 
 
+DART_EXPORT void* Dart_ReadKernelBinary(const uint8_t* buffer,
+                                        intptr_t buffer_len) {
+  API_TIMELINE_DURATION;
+
+#if defined(DART_PRECOMPILED_RUNTIME)
+  UNREACHABLE();
+  return NULL;
+#else
+  kernel::Program* program =
+      ReadPrecompiledKernelFromBuffer(buffer, buffer_len);
+  return program;
+#endif
+}
+
+
+DART_EXPORT Dart_Handle Dart_LoadKernel(void* kernel_program) {
+  API_TIMELINE_DURATION;
+  DARTSCOPE(Thread::Current());
+  StackZone zone(T);
+
+#if defined(DART_PRECOMPILED_RUNTIME)
+  return Api::NewError("%s: Can't load Kernel files from precompiled runtime.",
+                       CURRENT_FUNC);
+#else
+  Isolate* I = T->isolate();
+
+  Library& library = Library::Handle(Z, I->object_store()->root_library());
+  if (!library.IsNull()) {
+    const String& library_url = String::Handle(Z, library.url());
+    return Api::NewError("%s: A script has already been loaded from '%s'.",
+                         CURRENT_FUNC, library_url.ToCString());
+  }
+  CHECK_CALLBACK_STATE(T);
+  CHECK_COMPILATION_ALLOWED(I);
+
+  // NOTE: Now the VM owns the [kernel_program] memory!  Currently we do not
+  // free it because (similar to the token stream) it will be used to repeatedly
+  // run the `kernel::FlowGraphBuilder()`.
+  kernel::KernelReader reader(
+      reinterpret_cast<kernel::Program*>(kernel_program));
+  const Object& tmp = reader.ReadProgram();
+  if (tmp.IsError()) {
+    return Api::NewHandle(T, tmp.raw());
+  }
+  library ^= tmp.raw();
+  library.set_debuggable(false);
+  I->object_store()->set_root_library(library);
+  return Api::NewHandle(T, library.raw());
+#endif
+}
+
+
 DART_EXPORT Dart_Handle Dart_RootLibrary() {
   Thread* thread = Thread::Current();
   Isolate* isolate = thread->isolate();
@@ -5447,9 +5455,8 @@
     RETURN_TYPE_ERROR(Z, library, Library);
   }
   if (!lib.Loaded()) {
-    return Api::NewError(
-        "%s expects library argument 'library' to be loaded.",
-        CURRENT_FUNC);
+    return Api::NewError("%s expects library argument 'library' to be loaded.",
+                         CURRENT_FUNC);
   }
   const String& name_str = Api::UnwrapStringHandle(Z, class_name);
   if (name_str.IsNull()) {
@@ -5463,8 +5470,10 @@
   }
   if (cls.NumTypeArguments() == 0) {
     if (number_of_type_arguments != 0) {
-      return Api::NewError("Invalid number of type arguments specified, "
-                           "got %" Pd " expected 0", number_of_type_arguments);
+      return Api::NewError(
+          "Invalid number of type arguments specified, "
+          "got %" Pd " expected 0",
+          number_of_type_arguments);
     }
     return Api::NewHandle(T, Type::NewNonParameterizedType(cls));
   }
@@ -5475,20 +5484,20 @@
       RETURN_NULL_ERROR(type_arguments);
     }
     if (num_expected_type_arguments != number_of_type_arguments) {
-      return Api::NewError("Invalid number of type arguments specified, "
-                           "got %" Pd " expected %" Pd,
-                           number_of_type_arguments,
-                           num_expected_type_arguments);
+      return Api::NewError(
+          "Invalid number of type arguments specified, "
+          "got %" Pd " expected %" Pd,
+          number_of_type_arguments, num_expected_type_arguments);
     }
     const Array& array = Api::UnwrapArrayHandle(Z, *type_arguments);
     if (array.IsNull()) {
       RETURN_TYPE_ERROR(Z, *type_arguments, Array);
     }
     if (array.Length() != num_expected_type_arguments) {
-      return Api::NewError("Invalid type arguments specified, expected an "
-                           "array of len %" Pd " but got an array of len %" Pd,
-                           number_of_type_arguments,
-                           array.Length());
+      return Api::NewError(
+          "Invalid type arguments specified, expected an "
+          "array of len %" Pd " but got an array of len %" Pd,
+          number_of_type_arguments, array.Length());
     }
     // Set up the type arguments array.
     type_args_obj ^= TypeArguments::New(num_expected_type_arguments);
@@ -5500,8 +5509,8 @@
   }
 
   // Construct the type object, canonicalize it and return.
-  Type& instantiated_type = Type::Handle(
-      Type::New(cls, type_args_obj, TokenPosition::kNoSource));
+  Type& instantiated_type =
+      Type::Handle(Type::New(cls, type_args_obj, TokenPosition::kNoSource));
   instantiated_type ^= ClassFinalizer::FinalizeType(
       cls, instantiated_type, ClassFinalizer::kCanonicalize);
   return Api::NewHandle(T, instantiated_type.raw());
@@ -5520,17 +5529,37 @@
 }
 
 
+DART_EXPORT Dart_Handle Dart_GetLoadedLibraries() {
+  DARTSCOPE(Thread::Current());
+  Isolate* I = T->isolate();
+
+  const GrowableObjectArray& libs =
+      GrowableObjectArray::Handle(Z, I->object_store()->libraries());
+  int num_libs = libs.Length();
+
+  // Create new list and populate with the loaded libraries.
+  Library& lib = Library::Handle();
+  const Array& library_list = Array::Handle(Z, Array::New(num_libs));
+  for (int i = 0; i < num_libs; i++) {
+    lib ^= libs.At(i);
+    ASSERT(!lib.IsNull());
+    library_list.SetAt(i, lib);
+  }
+  return Api::NewHandle(T, library_list.raw());
+}
+
+
 DART_EXPORT Dart_Handle Dart_LookupLibrary(Dart_Handle url) {
   DARTSCOPE(Thread::Current());
   const String& url_str = Api::UnwrapStringHandle(Z, url);
   if (url_str.IsNull()) {
     RETURN_TYPE_ERROR(Z, url, String);
   }
-  const Library& library = Library::Handle(Z,
-      Library::LookupLibrary(T, url_str));
+  const Library& library =
+      Library::Handle(Z, Library::LookupLibrary(T, url_str));
   if (library.IsNull()) {
-    return Api::NewError("%s: library '%s' not found.",
-                         CURRENT_FUNC, url_str.ToCString());
+    return Api::NewError("%s: library '%s' not found.", CURRENT_FUNC,
+                         url_str.ToCString());
   } else {
     return Api::NewHandle(T, library.raw());
   }
@@ -5554,7 +5583,7 @@
 
   const GrowableObjectArray& pending_deferred_loads =
       GrowableObjectArray::Handle(Z,
-          I->object_store()->pending_deferred_loads());
+                                  I->object_store()->pending_deferred_loads());
   for (intptr_t i = 0; i < pending_deferred_loads.Length(); i++) {
     if (pending_deferred_loads.At(i) == lib.raw()) {
       lib.SetLoadError(err);
@@ -5605,9 +5634,8 @@
   if (library.IsNull()) {
     library = Library::New(url_str);
     library.Register(T);
-  } else if (library.LoadInProgress() ||
-      library.Loaded() ||
-      library.LoadFailed()) {
+  } else if (library.LoadInProgress() || library.Loaded() ||
+             library.LoadFailed()) {
     // The source for this library has either been loaded or is in the
     // process of loading.  Return an error.
     return Api::NewError("%s: library '%s' has already been loaded.",
@@ -5650,9 +5678,8 @@
     RETURN_TYPE_ERROR(Z, import, Library);
   }
   const Object& prefix_object = Object::Handle(Z, Api::UnwrapHandle(prefix));
-  const String& prefix_vm = prefix_object.IsNull()
-      ? Symbols::Empty()
-      : String::Cast(prefix_object);
+  const String& prefix_vm =
+      prefix_object.IsNull() ? Symbols::Empty() : String::Cast(prefix_object);
   if (prefix_vm.IsNull()) {
     RETURN_TYPE_ERROR(Z, prefix, String);
   }
@@ -5660,8 +5687,8 @@
   CHECK_COMPILATION_ALLOWED(I);
 
   const String& prefix_symbol = String::Handle(Z, Symbols::New(T, prefix_vm));
-  const Namespace& import_ns = Namespace::Handle(Z,
-      Namespace::New(import_vm, Object::null_array(), Object::null_array()));
+  const Namespace& import_ns = Namespace::Handle(
+      Z, Namespace::New(import_vm, Object::null_array(), Object::null_array()));
   if (prefix_vm.Length() == 0) {
     library_vm.AddImport(import_ns);
   } else {
@@ -5679,6 +5706,42 @@
 }
 
 
+DART_EXPORT Dart_Handle Dart_GetImportsOfScheme(Dart_Handle scheme) {
+  DARTSCOPE(Thread::Current());
+  Isolate* I = T->isolate();
+  const String& scheme_vm = Api::UnwrapStringHandle(Z, scheme);
+  if (scheme_vm.IsNull()) {
+    RETURN_TYPE_ERROR(Z, scheme, String);
+  }
+
+  const GrowableObjectArray& libraries =
+      GrowableObjectArray::Handle(Z, I->object_store()->libraries());
+  const GrowableObjectArray& result =
+      GrowableObjectArray::Handle(Z, GrowableObjectArray::New());
+  Library& importer = Library::Handle(Z);
+  Array& imports = Array::Handle(Z);
+  Namespace& ns = Namespace::Handle(Z);
+  Library& importee = Library::Handle(Z);
+  String& importee_uri = String::Handle(Z);
+  for (intptr_t i = 0; i < libraries.Length(); i++) {
+    importer ^= libraries.At(i);
+    imports = importer.imports();
+    for (intptr_t j = 0; j < imports.Length(); j++) {
+      ns ^= imports.At(j);
+      if (ns.IsNull()) continue;
+      importee = ns.library();
+      importee_uri = importee.url();
+      if (importee_uri.StartsWith(scheme_vm)) {
+        result.Add(importer);
+        result.Add(importee);
+      }
+    }
+  }
+
+  return Api::NewHandle(T, Array::MakeArray(result));
+}
+
+
 DART_EXPORT Dart_Handle Dart_LoadSource(Dart_Handle library,
                                         Dart_Handle url,
                                         Dart_Handle resolved_url,
@@ -5753,9 +5816,8 @@
 
   NoHeapGrowthControlScope no_growth_control;
 
-  const Script& script =
-      Script::Handle(Z, Script::New(url_str, url_str, source_str,
-                                    RawScript::kPatchTag));
+  const Script& script = Script::Handle(
+      Z, Script::New(url_str, url_str, source_str, RawScript::kPatchTag));
   Dart_Handle result;
   CompileSource(T, lib, script, &result);
   return result;
@@ -5792,21 +5854,23 @@
     I->debugger()->NotifyDoneLoading();
   }
 
+#if !defined(PRODUCT)
   if (FLAG_enable_mirrors) {
     // Notify mirrors that MirrorSystem.libraries needs to be recomputed.
     const Library& libmirrors = Library::Handle(Z, Library::MirrorsLibrary());
-    const Field& dirty_bit = Field::Handle(Z,
-        libmirrors.LookupLocalField(String::Handle(String::New("dirty"))));
+    const Field& dirty_bit = Field::Handle(
+        Z, libmirrors.LookupLocalField(String::Handle(String::New("dirty"))));
     ASSERT(!dirty_bit.IsNull() && dirty_bit.is_static());
     dirty_bit.SetStaticValue(Bool::True());
   }
+#endif
 
   if (complete_futures) {
     const Library& corelib = Library::Handle(Z, Library::CoreLibrary());
     const String& function_name =
         String::Handle(Z, String::New("_completeDeferredLoads"));
-    const Function& function = Function::Handle(Z,
-        corelib.LookupFunctionAllowPrivate(function_name));
+    const Function& function =
+        Function::Handle(Z, corelib.LookupFunctionAllowPrivate(function_name));
     ASSERT(!function.IsNull());
     const Array& args = Array::empty_array();
 
@@ -5821,10 +5885,10 @@
 }
 
 
-DART_EXPORT Dart_Handle Dart_SetNativeResolver(
-    Dart_Handle library,
-    Dart_NativeEntryResolver resolver,
-    Dart_NativeEntrySymbol symbol) {
+DART_EXPORT Dart_Handle
+Dart_SetNativeResolver(Dart_Handle library,
+                       Dart_NativeEntryResolver resolver,
+                       Dart_NativeEntrySymbol symbol) {
   DARTSCOPE(Thread::Current());
   const Library& lib = Api::UnwrapLibraryHandle(Z, library);
   if (lib.IsNull()) {
@@ -5836,6 +5900,38 @@
 }
 
 
+DART_EXPORT Dart_Handle
+Dart_GetNativeResolver(Dart_Handle library,
+                       Dart_NativeEntryResolver* resolver) {
+  if (resolver == NULL) {
+    RETURN_NULL_ERROR(resolver);
+  }
+  *resolver = NULL;
+  DARTSCOPE(Thread::Current());
+  const Library& lib = Api::UnwrapLibraryHandle(Z, library);
+  if (lib.IsNull()) {
+    RETURN_TYPE_ERROR(Z, library, Library);
+  }
+  *resolver = lib.native_entry_resolver();
+  return Api::Success();
+}
+
+
+DART_EXPORT Dart_Handle Dart_GetNativeSymbol(Dart_Handle library,
+                                             Dart_NativeEntrySymbol* resolver) {
+  if (resolver == NULL) {
+    RETURN_NULL_ERROR(resolver);
+  }
+  *resolver = NULL;
+  DARTSCOPE(Thread::Current());
+  const Library& lib = Api::UnwrapLibraryHandle(Z, library);
+  if (lib.IsNull()) {
+    RETURN_TYPE_ERROR(Z, library, Library);
+  }
+  *resolver = lib.native_entry_symbol_resolver();
+  return Api::Success();
+}
+
 // --- Peer support ---
 
 DART_EXPORT Dart_Handle Dart_GetPeer(Dart_Handle object, void** peer) {
@@ -5931,8 +6027,8 @@
 }
 
 
-DART_EXPORT Dart_Handle Dart_SetFileModifiedCallback(
-    Dart_FileModifiedCallback file_mod_callback) {
+DART_EXPORT Dart_Handle
+Dart_SetFileModifiedCallback(Dart_FileModifiedCallback file_mod_callback) {
   return Api::Success();
 }
 
@@ -5964,7 +6060,7 @@
                                     const char** argument_values) {
   return;
 }
-#else  // defined(PRODUCT)
+#else   // defined(PRODUCT)
 DART_EXPORT void Dart_RegisterIsolateServiceRequestCallback(
     const char* name,
     Dart_ServiceRequestCallback callback,
@@ -6043,14 +6139,13 @@
     return Api::NewError("%s expects argument 'bytes_length' to be >= 0.",
                          CURRENT_FUNC);
   }
-  Service::SendEmbedderEvent(I, stream_id, event_kind,
-                             bytes, bytes_length);
+  Service::SendEmbedderEvent(I, stream_id, event_kind, bytes, bytes_length);
   return Api::Success();
 }
 
 
-DART_EXPORT Dart_Handle Dart_SetFileModifiedCallback(
-    Dart_FileModifiedCallback file_modified_callback) {
+DART_EXPORT Dart_Handle
+Dart_SetFileModifiedCallback(Dart_FileModifiedCallback file_modified_callback) {
   if (!FLAG_support_service) {
     return Api::Success();
   }
@@ -6080,8 +6175,7 @@
   const bool api_enabled = (stream_mask & DART_TIMELINE_STREAM_API) != 0;
   const bool compiler_enabled =
       (stream_mask & DART_TIMELINE_STREAM_COMPILER) != 0;
-  const bool dart_enabled =
-      (stream_mask & DART_TIMELINE_STREAM_DART) != 0;
+  const bool dart_enabled = (stream_mask & DART_TIMELINE_STREAM_DART) != 0;
   const bool debugger_enabled =
       (stream_mask & DART_TIMELINE_STREAM_DEBUGGER) != 0;
   const bool embedder_enabled =
@@ -6089,8 +6183,7 @@
   const bool gc_enabled = (stream_mask & DART_TIMELINE_STREAM_GC) != 0;
   const bool isolate_enabled =
       (stream_mask & DART_TIMELINE_STREAM_ISOLATE) != 0;
-  const bool vm_enabled =
-      (stream_mask & DART_TIMELINE_STREAM_VM) != 0;
+  const bool vm_enabled = (stream_mask & DART_TIMELINE_STREAM_VM) != 0;
   Timeline::SetStreamAPIEnabled(api_enabled);
   Timeline::SetStreamCompilerEnabled(compiler_enabled);
   Timeline::SetStreamDartEnabled(dart_enabled);
@@ -6106,11 +6199,7 @@
                                   void* user_data,
                                   const char* stream_name) {
   // Start stream.
-  consumer(Dart_StreamConsumer_kStart,
-           stream_name,
-           NULL,
-           0,
-           user_data);
+  consumer(Dart_StreamConsumer_kStart, stream_name, NULL, 0, user_data);
 }
 
 
@@ -6118,11 +6207,7 @@
                                    void* user_data,
                                    const char* stream_name) {
   // Finish stream.
-  consumer(Dart_StreamConsumer_kFinish,
-           stream_name,
-           NULL,
-           0,
-           user_data);
+  consumer(Dart_StreamConsumer_kFinish, stream_name, NULL, 0, user_data);
 }
 
 
@@ -6138,20 +6223,16 @@
   intptr_t cursor = 0;
   intptr_t remaining = output_length;
   while (remaining >= kDataSize) {
-    consumer(Dart_StreamConsumer_kData,
-             stream_name,
-             reinterpret_cast<const uint8_t*>(&output[cursor]),
-             kDataSize,
+    consumer(Dart_StreamConsumer_kData, stream_name,
+             reinterpret_cast<const uint8_t*>(&output[cursor]), kDataSize,
              user_data);
     cursor += kDataSize;
     remaining -= kDataSize;
   }
   if (remaining > 0) {
     ASSERT(remaining < kDataSize);
-    consumer(Dart_StreamConsumer_kData,
-             stream_name,
-             reinterpret_cast<const uint8_t*>(&output[cursor]),
-             remaining,
+    consumer(Dart_StreamConsumer_kData, stream_name,
+             reinterpret_cast<const uint8_t*>(&output[cursor]), remaining,
              user_data);
     cursor += remaining;
     remaining -= remaining;
@@ -6184,11 +6265,7 @@
   // We are skipping the '['.
   output_length -= 1;
 
-  DataStreamToConsumer(consumer,
-                       user_data,
-                       start,
-                       output_length,
-                       "timeline");
+  DataStreamToConsumer(consumer, user_data, start, output_length, "timeline");
 
   // We stole the JSONStream's output buffer, free it.
   free(output);
@@ -6265,28 +6342,28 @@
   switch (type) {
     case Dart_Timeline_Event_Begin:
       event->Begin(label, timestamp0);
-    break;
+      break;
     case Dart_Timeline_Event_End:
       event->End(label, timestamp0);
-    break;
+      break;
     case Dart_Timeline_Event_Instant:
       event->Instant(label, timestamp0);
-    break;
+      break;
     case Dart_Timeline_Event_Duration:
       event->Duration(label, timestamp0, timestamp1_or_async_id);
-    break;
+      break;
     case Dart_Timeline_Event_Async_Begin:
       event->AsyncBegin(label, timestamp1_or_async_id, timestamp0);
-    break;
+      break;
     case Dart_Timeline_Event_Async_End:
       event->AsyncEnd(label, timestamp1_or_async_id, timestamp0);
-    break;
+      break;
     case Dart_Timeline_Event_Async_Instant:
       event->AsyncInstant(label, timestamp1_or_async_id, timestamp0);
-    break;
+      break;
     case Dart_Timeline_Event_Counter:
       event->Counter(label, timestamp0);
-    break;
+      break;
     default:
       FATAL("Unknown Dart_Timeline_Event_Type");
   }
@@ -6314,44 +6391,39 @@
 // excluded from dart and dart_precompiled_runtime.
 #if !defined(DART_PRECOMPILER)
 
-DART_EXPORT Dart_Handle Dart_Precompile(
-    Dart_QualifiedFunctionName entry_points[],
-    bool reset_fields) {
-  UNREACHABLE();
+DART_EXPORT Dart_Handle
+Dart_Precompile(Dart_QualifiedFunctionName entry_points[], bool reset_fields) {
+  return Api::NewError(
+      "This VM was built without support for AOT compilation.");
+}
+
+
+DART_EXPORT Dart_Handle
+Dart_CreatePrecompiledSnapshotAssembly(uint8_t** assembly_buffer,
+                                       intptr_t* assembly_size) {
+  return Api::NewError(
+      "This VM was built without support for AOT compilation.");
   return 0;
 }
 
 
-DART_EXPORT Dart_Handle Dart_CreatePrecompiledSnapshotAssembly(
-    uint8_t** vm_isolate_snapshot_buffer,
-    intptr_t* vm_isolate_snapshot_size,
-    uint8_t** isolate_snapshot_buffer,
-    intptr_t* isolate_snapshot_size,
-    uint8_t** assembly_buffer,
-    intptr_t* assembly_size) {
-  UNREACHABLE();
-  return 0;
-}
-
-
-DART_EXPORT Dart_Handle Dart_CreatePrecompiledSnapshotBlob(
-    uint8_t** vm_isolate_snapshot_buffer,
-    intptr_t* vm_isolate_snapshot_size,
-    uint8_t** isolate_snapshot_buffer,
-    intptr_t* isolate_snapshot_size,
-    uint8_t** instructions_blob_buffer,
-    intptr_t* instructions_blob_size,
-    uint8_t** rodata_blob_buffer,
-    intptr_t* rodata_blob_size) {
-  UNREACHABLE();
-  return 0;
+DART_EXPORT Dart_Handle
+Dart_CreatePrecompiledSnapshotBlob(uint8_t** vm_isolate_snapshot_buffer,
+                                   intptr_t* vm_isolate_snapshot_size,
+                                   uint8_t** isolate_snapshot_buffer,
+                                   intptr_t* isolate_snapshot_size,
+                                   uint8_t** instructions_blob_buffer,
+                                   intptr_t* instructions_blob_size,
+                                   uint8_t** rodata_blob_buffer,
+                                   intptr_t* rodata_blob_size) {
+  return Api::NewError(
+      "This VM was built without support for AOT compilation.");
 }
 
 #else  // DART_PRECOMPILER
 
-DART_EXPORT Dart_Handle Dart_Precompile(
-    Dart_QualifiedFunctionName entry_points[],
-    bool reset_fields) {
+DART_EXPORT Dart_Handle
+Dart_Precompile(Dart_QualifiedFunctionName entry_points[], bool reset_fields) {
 #if defined(TARGET_ARCH_IA32)
   return Api::NewError("Precompilation is not supported on IA32.");
 #elif defined(TARGET_ARCH_DBC)
@@ -6367,8 +6439,8 @@
     return result;
   }
   CHECK_CALLBACK_STATE(T);
-  const Error& error = Error::Handle(Precompiler::CompileAll(entry_points,
-                                                             reset_fields));
+  const Error& error =
+      Error::Handle(Precompiler::CompileAll(entry_points, reset_fields));
   if (!error.IsNull()) {
     return Api::NewHandle(T, error.raw());
   }
@@ -6377,13 +6449,9 @@
 }
 
 
-DART_EXPORT Dart_Handle Dart_CreatePrecompiledSnapshotAssembly(
-    uint8_t** vm_isolate_snapshot_buffer,
-    intptr_t* vm_isolate_snapshot_size,
-    uint8_t** isolate_snapshot_buffer,
-    intptr_t* isolate_snapshot_size,
-    uint8_t** assembly_buffer,
-    intptr_t* assembly_size) {
+DART_EXPORT Dart_Handle
+Dart_CreatePrecompiledSnapshotAssembly(uint8_t** assembly_buffer,
+                                       intptr_t* assembly_size) {
 #if defined(TARGET_ARCH_IA32)
   return Api::NewError("Precompilation is not supported on IA32.");
 #elif defined(TARGET_ARCH_DBC)
@@ -6393,22 +6461,11 @@
   DARTSCOPE(Thread::Current());
   Isolate* I = T->isolate();
   if (I->compilation_allowed()) {
-    return Api::NewError("Isolate is not precompiled. "
-                         "Did you forget to call Dart_Precompile?");
+    return Api::NewError(
+        "Isolate is not precompiled. "
+        "Did you forget to call Dart_Precompile?");
   }
   ASSERT(FLAG_load_deferred_eagerly);
-  if (vm_isolate_snapshot_buffer == NULL) {
-    RETURN_NULL_ERROR(vm_isolate_snapshot_buffer);
-  }
-  if (vm_isolate_snapshot_size == NULL) {
-    RETURN_NULL_ERROR(vm_isolate_snapshot_size);
-  }
-  if (isolate_snapshot_buffer == NULL) {
-    RETURN_NULL_ERROR(isolate_snapshot_buffer);
-  }
-  if (isolate_snapshot_size == NULL) {
-    RETURN_NULL_ERROR(isolate_snapshot_size);
-  }
   if (assembly_buffer == NULL) {
     RETURN_NULL_ERROR(assembly_buffer);
   }
@@ -6418,18 +6475,15 @@
 
   NOT_IN_PRODUCT(TimelineDurationScope tds2(T, Timeline::GetIsolateStream(),
                                             "WriteAppAOTSnapshot"));
-  AssemblyInstructionsWriter instructions_writer(assembly_buffer,
-                                                 ApiReallocate,
+  AssemblyInstructionsWriter instructions_writer(assembly_buffer, ApiReallocate,
                                                  2 * MB /* initial_size */);
-  FullSnapshotWriter writer(Snapshot::kAppNoJIT,
-                            vm_isolate_snapshot_buffer,
-                            isolate_snapshot_buffer,
-                            ApiReallocate,
+  uint8_t* vm_isolate_snapshot_buffer = NULL;
+  uint8_t* isolate_snapshot_buffer = NULL;
+  FullSnapshotWriter writer(Snapshot::kAppNoJIT, &vm_isolate_snapshot_buffer,
+                            &isolate_snapshot_buffer, ApiReallocate,
                             &instructions_writer);
 
   writer.WriteFullSnapshot();
-  *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize();
-  *isolate_snapshot_size = writer.IsolateSnapshotSize();
   *assembly_size = instructions_writer.AssemblySize();
 
   return Api::Success();
@@ -6437,15 +6491,15 @@
 }
 
 
-DART_EXPORT Dart_Handle Dart_CreatePrecompiledSnapshotBlob(
-    uint8_t** vm_isolate_snapshot_buffer,
-    intptr_t* vm_isolate_snapshot_size,
-    uint8_t** isolate_snapshot_buffer,
-    intptr_t* isolate_snapshot_size,
-    uint8_t** instructions_blob_buffer,
-    intptr_t* instructions_blob_size,
-    uint8_t** rodata_blob_buffer,
-    intptr_t* rodata_blob_size) {
+DART_EXPORT Dart_Handle
+Dart_CreatePrecompiledSnapshotBlob(uint8_t** vm_isolate_snapshot_buffer,
+                                   intptr_t* vm_isolate_snapshot_size,
+                                   uint8_t** isolate_snapshot_buffer,
+                                   intptr_t* isolate_snapshot_size,
+                                   uint8_t** instructions_blob_buffer,
+                                   intptr_t* instructions_blob_size,
+                                   uint8_t** rodata_blob_buffer,
+                                   intptr_t* rodata_blob_size) {
 #if defined(TARGET_ARCH_IA32)
   return Api::NewError("Precompilation is not supported on IA32.");
 #elif defined(TARGET_ARCH_DBC)
@@ -6455,8 +6509,9 @@
   DARTSCOPE(Thread::Current());
   Isolate* I = T->isolate();
   if (I->compilation_allowed()) {
-    return Api::NewError("Isolate is not precompiled. "
-                         "Did you forget to call Dart_Precompile?");
+    return Api::NewError(
+        "Isolate is not precompiled. "
+        "Did you forget to call Dart_Precompile?");
   }
   ASSERT(FLAG_load_deferred_eagerly);
   if (vm_isolate_snapshot_buffer == NULL) {
@@ -6487,13 +6542,10 @@
   NOT_IN_PRODUCT(TimelineDurationScope tds2(T, Timeline::GetIsolateStream(),
                                             "WriteAppAOTSnapshot"));
   BlobInstructionsWriter instructions_writer(instructions_blob_buffer,
-                                             rodata_blob_buffer,
-                                             ApiReallocate,
+                                             rodata_blob_buffer, ApiReallocate,
                                              2 * MB /* initial_size */);
-  FullSnapshotWriter writer(Snapshot::kAppNoJIT,
-                            vm_isolate_snapshot_buffer,
-                            isolate_snapshot_buffer,
-                            ApiReallocate,
+  FullSnapshotWriter writer(Snapshot::kAppNoJIT, vm_isolate_snapshot_buffer,
+                            isolate_snapshot_buffer, ApiReallocate,
                             &instructions_writer);
 
   writer.WriteFullSnapshot();
@@ -6540,15 +6592,15 @@
 }
 
 
-DART_EXPORT Dart_Handle Dart_CreateAppJITSnapshot(
-    uint8_t** vm_isolate_snapshot_buffer,
-    intptr_t* vm_isolate_snapshot_size,
-    uint8_t** isolate_snapshot_buffer,
-    intptr_t* isolate_snapshot_size,
-    uint8_t** instructions_blob_buffer,
-    intptr_t* instructions_blob_size,
-    uint8_t** rodata_blob_buffer,
-    intptr_t* rodata_blob_size) {
+DART_EXPORT Dart_Handle
+Dart_CreateAppJITSnapshot(uint8_t** vm_isolate_snapshot_buffer,
+                          intptr_t* vm_isolate_snapshot_size,
+                          uint8_t** isolate_snapshot_buffer,
+                          intptr_t* isolate_snapshot_size,
+                          uint8_t** instructions_blob_buffer,
+                          intptr_t* instructions_blob_size,
+                          uint8_t** rodata_blob_buffer,
+                          intptr_t* rodata_blob_size) {
 #if defined(TARGET_ARCH_IA32)
   return Api::NewError("Snapshots with code are not supported on IA32.");
 #elif defined(TARGET_ARCH_DBC)
@@ -6595,13 +6647,10 @@
   NOT_IN_PRODUCT(TimelineDurationScope tds2(T, Timeline::GetIsolateStream(),
                                             "WriteAppJITSnapshot"));
   BlobInstructionsWriter instructions_writer(instructions_blob_buffer,
-                                             rodata_blob_buffer,
-                                             ApiReallocate,
+                                             rodata_blob_buffer, ApiReallocate,
                                              2 * MB /* initial_size */);
-  FullSnapshotWriter writer(Snapshot::kAppWithJIT,
-                            vm_isolate_snapshot_buffer,
-                            isolate_snapshot_buffer,
-                            ApiReallocate,
+  FullSnapshotWriter writer(Snapshot::kAppWithJIT, vm_isolate_snapshot_buffer,
+                            isolate_snapshot_buffer, ApiReallocate,
                             &instructions_writer);
   writer.WriteFullSnapshot();
   *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize();
@@ -6614,11 +6663,6 @@
 }
 
 
-DART_EXPORT bool Dart_IsRunningPrecompiledCode() {
-  return Snapshot::IncludesCode(Dart::snapshot_kind());
-}
-
-
 DART_EXPORT bool Dart_IsPrecompiledRuntime() {
 #if defined(DART_PRECOMPILED_RUNTIME)
   return true;
@@ -6627,4 +6671,11 @@
 #endif
 }
 
+
+DART_EXPORT void Dart_DumpNativeStackTrace(void* context) {
+#ifndef PRODUCT
+  Profiler::DumpStackTrace(context);
+#endif
+}
+
 }  // namespace dart
diff --git a/runtime/vm/dart_api_impl.h b/runtime/vm/dart_api_impl.h
index f536e0b..f597ca2 100644
--- a/runtime/vm/dart_api_impl.h
+++ b/runtime/vm/dart_api_impl.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_DART_API_IMPL_H_
-#define VM_DART_API_IMPL_H_
+#ifndef RUNTIME_VM_DART_API_IMPL_H_
+#define RUNTIME_VM_DART_API_IMPL_H_
 
 #include "vm/allocation.h"
 #include "vm/native_arguments.h"
@@ -27,9 +27,10 @@
 #define CHECK_ISOLATE(isolate)                                                 \
   do {                                                                         \
     if ((isolate) == NULL) {                                                   \
-      FATAL1("%s expects there to be a current isolate. Did you "              \
-             "forget to call Dart_CreateIsolate or Dart_EnterIsolate?",        \
-             CURRENT_FUNC);                                                    \
+      FATAL1(                                                                  \
+          "%s expects there to be a current isolate. Did you "                 \
+          "forget to call Dart_CreateIsolate or Dart_EnterIsolate?",           \
+          CURRENT_FUNC);                                                       \
     }                                                                          \
   } while (0)
 
@@ -37,8 +38,10 @@
 #define CHECK_NO_ISOLATE(isolate)                                              \
   do {                                                                         \
     if ((isolate) != NULL) {                                                   \
-      FATAL1("%s expects there to be no current isolate. Did you "             \
-             "forget to call Dart_ExitIsolate?", CURRENT_FUNC);                \
+      FATAL1(                                                                  \
+          "%s expects there to be no current isolate. Did you "                \
+          "forget to call Dart_ExitIsolate?",                                  \
+          CURRENT_FUNC);                                                       \
     }                                                                          \
   } while (0)
 
@@ -49,10 +52,12 @@
     Isolate* tmpI = tmpT->isolate();                                           \
     CHECK_ISOLATE(tmpI);                                                       \
     if (tmpT->api_top_scope() == NULL) {                                       \
-      FATAL1("%s expects to find a current scope. Did you forget to call "     \
-           "Dart_EnterScope?", CURRENT_FUNC);                                  \
+      FATAL1(                                                                  \
+          "%s expects to find a current scope. Did you forget to call "        \
+          "Dart_EnterScope?",                                                  \
+          CURRENT_FUNC);                                                       \
     }                                                                          \
-  } while (0);                                                                 \
+  } while (0);
 
 #define DARTSCOPE(thread)                                                      \
   Thread* T = (thread);                                                        \
@@ -101,9 +106,7 @@
     explicit Scope(Thread* thread) : StackResource(thread) {
       Dart_EnterScope();
     }
-    ~Scope() {
-      Dart_ExitScope();
-    }
+    ~Scope() { Dart_ExitScope(); }
 
    private:
     DISALLOW_COPY_AND_ASSIGN(Scope);
@@ -115,24 +118,25 @@
   // Unwraps the raw object from the handle.
   static RawObject* UnwrapHandle(Dart_Handle object);
 
-  // Unwraps a raw Type from the handle.  The handle will be null if
-  // the object was not of the requested Type.
+// Unwraps a raw Type from the handle.  The handle will be null if
+// the object was not of the requested Type.
 #define DECLARE_UNWRAP(Type)                                                   \
-  static const Type& Unwrap##Type##Handle(Zone* zone,                          \
-                                          Dart_Handle object);
+  static const Type& Unwrap##Type##Handle(Zone* zone, Dart_Handle object);
   CLASS_LIST_FOR_HANDLES(DECLARE_UNWRAP)
 #undef DECLARE_UNWRAP
 
   // Unwraps the raw object from the handle using a reused handle.
   static const String& UnwrapStringHandle(
-      const ReusableObjectHandleScope& reused, Dart_Handle object);
+      const ReusableObjectHandleScope& reused,
+      Dart_Handle object);
   static const Instance& UnwrapInstanceHandle(
-      const ReusableObjectHandleScope& reused, Dart_Handle object);
+      const ReusableObjectHandleScope& reused,
+      Dart_Handle object);
 
   // Returns an Error handle if isolate is in an inconsistent state
   // or there was an error while finalizing classes.
   // Returns a Success handle when no error condition exists.
-  static Dart_Handle CheckAndFinalizePendingClasses(Thread *thread);
+  static Dart_Handle CheckAndFinalizePendingClasses(Thread* thread);
 
   // Casts the internal Isolate* type to the external Dart_Isolate type.
   static Dart_Isolate CastIsolate(Isolate* isolate);
@@ -187,24 +191,16 @@
   static Dart_Handle NewError(const char* format, ...) PRINTF_ATTRIBUTE(1, 2);
 
   // Gets a handle to Null.
-  static Dart_Handle Null() {
-    return null_handle_;
-  }
+  static Dart_Handle Null() { return null_handle_; }
 
   // Gets a handle to True.
-  static Dart_Handle True() {
-    return true_handle_;
-  }
+  static Dart_Handle True() { return true_handle_; }
 
   // Gets a handle to False.
-  static Dart_Handle False() {
-    return false_handle_;
-  }
+  static Dart_Handle False() { return false_handle_; }
 
   // Gets a handle to EmptyString.
-  static Dart_Handle EmptyString() {
-    return empty_string_handle_;
-  }
+  static Dart_Handle EmptyString() { return empty_string_handle_; }
 
   // Retrieves the top ApiLocalScope.
   static ApiLocalScope* TopScope(Thread* thread);
@@ -279,28 +275,26 @@
 };
 
 // Start a scope in which no Dart API call backs are allowed.
-#define START_NO_CALLBACK_SCOPE(thread)                                        \
-  thread->IncrementNoCallbackScopeDepth()
+#define START_NO_CALLBACK_SCOPE(thread) thread->IncrementNoCallbackScopeDepth()
 
 // End a no Dart API call backs Scope.
-#define END_NO_CALLBACK_SCOPE(thread)                                          \
-  thread->DecrementNoCallbackScopeDepth()
+#define END_NO_CALLBACK_SCOPE(thread) thread->DecrementNoCallbackScopeDepth()
 
 #define CHECK_CALLBACK_STATE(thread)                                           \
   if (thread->no_callback_scope_depth() != 0) {                                \
     return reinterpret_cast<Dart_Handle>(                                      \
         Api::AcquiredError(thread->isolate()));                                \
-  }                                                                            \
+  }
 
 #define CHECK_COMPILATION_ALLOWED(isolate)                                     \
   if (!isolate->compilation_allowed()) {                                       \
     return Api::NewError("%s: Cannot load after Dart_Precompile",              \
                          CURRENT_FUNC);                                        \
-  }                                                                            \
+  }
 
-#define ASSERT_CALLBACK_STATE(thread)                                         \
+#define ASSERT_CALLBACK_STATE(thread)                                          \
   ASSERT(thread->no_callback_scope_depth() == 0)
 
 }  // namespace dart.
 
-#endif  // VM_DART_API_IMPL_H_
+#endif  // RUNTIME_VM_DART_API_IMPL_H_
diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc
index d2016a4..7ee03f7 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -37,10 +37,7 @@
 
   Dart_Handle instance = Dart_True();
   Dart_Handle error = Api::NewError("myerror");
-  Dart_Handle exception = Dart_Invoke(lib,
-                                      NewString("testMain"),
-                                      0,
-                                      NULL);
+  Dart_Handle exception = Dart_Invoke(lib, NewString("testMain"), 0, NULL);
 
   EXPECT_VALID(instance);
   EXPECT(Dart_IsError(error));
@@ -97,8 +94,8 @@
   Dart_ActivationFrame frame;
   result = Dart_GetActivationFrame(stacktrace, 0, &frame);
   EXPECT_VALID(result);
-  result = Dart_ActivationFrameInfo(
-      frame, &function_name, &script_url, &line_number, &column_number);
+  result = Dart_ActivationFrameInfo(frame, &function_name, &script_url,
+                                    &line_number, &column_number);
   EXPECT_VALID(result);
   Dart_StringToCString(function_name, &cstr);
   EXPECT_STREQ("bar", cstr);
@@ -109,8 +106,8 @@
 
   result = Dart_GetActivationFrame(stacktrace, 1, &frame);
   EXPECT_VALID(result);
-  result = Dart_ActivationFrameInfo(
-      frame, &function_name, &script_url, &line_number, &column_number);
+  result = Dart_ActivationFrameInfo(frame, &function_name, &script_url,
+                                    &line_number, &column_number);
   EXPECT_VALID(result);
   Dart_StringToCString(function_name, &cstr);
   EXPECT_STREQ("foo", cstr);
@@ -121,8 +118,8 @@
 
   result = Dart_GetActivationFrame(stacktrace, 2, &frame);
   EXPECT_VALID(result);
-  result = Dart_ActivationFrameInfo(
-      frame, &function_name, &script_url, &line_number, &column_number);
+  result = Dart_ActivationFrameInfo(frame, &function_name, &script_url,
+                                    &line_number, &column_number);
   EXPECT_VALID(result);
   Dart_StringToCString(function_name, &cstr);
   EXPECT_STREQ("testMain", cstr);
@@ -171,8 +168,8 @@
   Dart_ActivationFrame frame;
   result = Dart_GetActivationFrame(stacktrace, 0, &frame);
   EXPECT_VALID(result);
-  result = Dart_ActivationFrameInfo(
-      frame, &function_name, &script_url, &line_number, &column_number);
+  result = Dart_ActivationFrameInfo(frame, &function_name, &script_url,
+                                    &line_number, &column_number);
   EXPECT_VALID(result);
   Dart_StringToCString(function_name, &cstr);
   EXPECT_STREQ("foo", cstr);
@@ -182,13 +179,12 @@
   EXPECT_EQ(20, column_number);
 
   // Middle frames positioned at the recursive call.
-  for (intptr_t frame_index = 1;
-       frame_index < (frame_count - 1);
+  for (intptr_t frame_index = 1; frame_index < (frame_count - 1);
        frame_index++) {
     result = Dart_GetActivationFrame(stacktrace, frame_index, &frame);
     EXPECT_VALID(result);
-    result = Dart_ActivationFrameInfo(
-        frame, &function_name, &script_url, &line_number, &column_number);
+    result = Dart_ActivationFrameInfo(frame, &function_name, &script_url,
+                                      &line_number, &column_number);
     EXPECT_VALID(result);
     Dart_StringToCString(function_name, &cstr);
     EXPECT_STREQ("foo", cstr);
@@ -201,8 +197,8 @@
   // Bottom frame positioned at testMain().
   result = Dart_GetActivationFrame(stacktrace, frame_count - 1, &frame);
   EXPECT_VALID(result);
-  result = Dart_ActivationFrameInfo(
-      frame, &function_name, &script_url, &line_number, &column_number);
+  result = Dart_ActivationFrameInfo(frame, &function_name, &script_url,
+                                    &line_number, &column_number);
   EXPECT_VALID(result);
   Dart_StringToCString(function_name, &cstr);
   EXPECT_STREQ("testMain", cstr);
@@ -250,8 +246,8 @@
   Dart_ActivationFrame frame;
   result = Dart_GetActivationFrame(stacktrace, 0, &frame);
   EXPECT_VALID(result);
-  result = Dart_ActivationFrameInfo(
-      frame, &function_name, &script_url, &line_number, &column_number);
+  result = Dart_ActivationFrameInfo(frame, &function_name, &script_url,
+                                    &line_number, &column_number);
   EXPECT_VALID(result);
   Dart_StringToCString(function_name, &cstr);
   EXPECT_STREQ("C.foo", cstr);
@@ -311,8 +307,8 @@
   Dart_ActivationFrame frame;
   result = Dart_GetActivationFrame(stacktrace, 0, &frame);
   EXPECT_VALID(result);
-  result = Dart_ActivationFrameInfo(
-      frame, &function_name, &script_url, &line_number, &column_number);
+  result = Dart_ActivationFrameInfo(frame, &function_name, &script_url,
+                                    &line_number, &column_number);
   EXPECT_VALID(result);
   Dart_StringToCString(function_name, &cstr);
   EXPECT_STREQ("inspectStack", cstr);
@@ -324,8 +320,8 @@
   // Second frame is foo() positioned at call to inspectStack().
   result = Dart_GetActivationFrame(stacktrace, 1, &frame);
   EXPECT_VALID(result);
-  result = Dart_ActivationFrameInfo(
-      frame, &function_name, &script_url, &line_number, &column_number);
+  result = Dart_ActivationFrameInfo(frame, &function_name, &script_url,
+                                    &line_number, &column_number);
   EXPECT_VALID(result);
   Dart_StringToCString(function_name, &cstr);
   EXPECT_STREQ("foo", cstr);
@@ -335,13 +331,12 @@
   EXPECT_EQ(20, column_number);
 
   // Middle frames positioned at the recursive call.
-  for (intptr_t frame_index = 2;
-       frame_index < (frame_count - 1);
+  for (intptr_t frame_index = 2; frame_index < (frame_count - 1);
        frame_index++) {
     result = Dart_GetActivationFrame(stacktrace, frame_index, &frame);
     EXPECT_VALID(result);
-    result = Dart_ActivationFrameInfo(
-        frame, &function_name, &script_url, &line_number, &column_number);
+    result = Dart_ActivationFrameInfo(frame, &function_name, &script_url,
+                                      &line_number, &column_number);
     EXPECT_VALID(result);
     Dart_StringToCString(function_name, &cstr);
     EXPECT_STREQ("foo", cstr);
@@ -354,8 +349,8 @@
   // Bottom frame positioned at testMain().
   result = Dart_GetActivationFrame(stacktrace, frame_count - 1, &frame);
   EXPECT_VALID(result);
-  result = Dart_ActivationFrameInfo(
-      frame, &function_name, &script_url, &line_number, &column_number);
+  result = Dart_ActivationFrameInfo(frame, &function_name, &script_url,
+                                    &line_number, &column_number);
   EXPECT_VALID(result);
   Dart_StringToCString(function_name, &cstr);
   EXPECT_STREQ("testMain", cstr);
@@ -376,7 +371,9 @@
 
 
 static Dart_NativeFunction CurrentStackTraceNativeLookup(
-    Dart_Handle name, int argument_count, bool* auto_setup_scope) {
+    Dart_Handle name,
+    int argument_count,
+    bool* auto_setup_scope) {
   ASSERT(auto_setup_scope != NULL);
   *auto_setup_scope = true;
   return reinterpret_cast<Dart_NativeFunction>(&CurrentStackTraceNative);
@@ -389,8 +386,8 @@
       "foo(n) => n == 1 ? inspectStack() : foo(n-1);\n"
       "testMain() => foo(50);\n";
 
-  Dart_Handle lib = TestCase::LoadTestScript(kScriptChars,
-                                             &CurrentStackTraceNativeLookup);
+  Dart_Handle lib =
+      TestCase::LoadTestScript(kScriptChars, &CurrentStackTraceNativeLookup);
   Dart_Handle result = Dart_Invoke(lib, NewString("testMain"), 0, NULL);
   EXPECT_VALID(result);
   EXPECT(Dart_IsInteger(result));
@@ -461,8 +458,7 @@
   // Test with an API Error.
   const char* kApiError = "Api Error Exception Test.";
   Dart_Handle api_error = Api::NewHandle(
-      thread,
-      ApiError::New(String::Handle(String::New(kApiError))));
+      thread, ApiError::New(String::Handle(String::New(kApiError))));
   Dart_Handle exception_error = Dart_NewUnhandledExceptionError(api_error);
   EXPECT(!Dart_IsApiError(exception_error));
   EXPECT(Dart_IsUnhandledExceptionError(exception_error));
@@ -473,8 +469,7 @@
 
   // Test with a Compilation Error.
   const char* kCompileError = "CompileError Exception Test.";
-  const String& compile_message =
-      String::Handle(String::New(kCompileError));
+  const String& compile_message = String::Handle(String::New(kCompileError));
   Dart_Handle compile_error =
       Api::NewHandle(thread, LanguageError::New(compile_message));
   exception_error = Dart_NewUnhandledExceptionError(compile_error);
@@ -534,7 +529,9 @@
 
 
 static Dart_NativeFunction PropagateError_native_lookup(
-    Dart_Handle name, int argument_count, bool* auto_setup_scope) {
+    Dart_Handle name,
+    int argument_count,
+    bool* auto_setup_scope) {
   ASSERT(auto_setup_scope != NULL);
   *auto_setup_scope = true;
   return reinterpret_cast<Dart_NativeFunction>(&PropagateErrorNative);
@@ -560,8 +557,8 @@
       "void Func2() {\n"
       "  nativeFunc(() => throwException());\n"
       "}\n";
-  Dart_Handle lib = TestCase::LoadTestScript(
-      kScriptChars, &PropagateError_native_lookup);
+  Dart_Handle lib =
+      TestCase::LoadTestScript(kScriptChars, &PropagateError_native_lookup);
   Dart_Handle result;
 
   // Use Dart_PropagateError to propagate the error.
@@ -1046,7 +1043,7 @@
 
 
 TEST_CASE(IsString) {
-  uint8_t latin1[] = { 'o', 'n', 'e', 0xC2, 0xA2 };
+  uint8_t latin1[] = {'o', 'n', 'e', 0xC2, 0xA2};
 
   Dart_Handle latin1str = Dart_NewStringFromUTF8(latin1, ARRAY_SIZE(latin1));
   EXPECT_VALID(latin1str);
@@ -1059,15 +1056,13 @@
   intptr_t char_size;
   intptr_t str_len;
   void* peer;
-  EXPECT_VALID(Dart_StringGetProperties(latin1str,
-                                        &char_size,
-                                        &str_len,
-                                        &peer));
+  EXPECT_VALID(
+      Dart_StringGetProperties(latin1str, &char_size, &str_len, &peer));
   EXPECT_EQ(1, char_size);
   EXPECT_EQ(4, str_len);
   EXPECT(!peer);
 
-  uint8_t data8[] = { 'o', 'n', 'e', 0x7F };
+  uint8_t data8[] = {'o', 'n', 'e', 0x7F};
 
   Dart_Handle str8 = Dart_NewStringFromUTF8(data8, ARRAY_SIZE(data8));
   EXPECT_VALID(str8);
@@ -1085,48 +1080,39 @@
     EXPECT_EQ(data8[i], latin1_array[i]);
   }
 
-  Dart_Handle ext8 = Dart_NewExternalLatin1String(data8, ARRAY_SIZE(data8),
-                                                  data8, NULL);
+  Dart_Handle ext8 =
+      Dart_NewExternalLatin1String(data8, ARRAY_SIZE(data8), data8, NULL);
   EXPECT_VALID(ext8);
   EXPECT(Dart_IsString(ext8));
   EXPECT(Dart_IsExternalString(ext8));
-  EXPECT_VALID(Dart_StringGetProperties(ext8,
-                                        &char_size,
-                                        &str_len,
-                                        &peer));
+  EXPECT_VALID(Dart_StringGetProperties(ext8, &char_size, &str_len, &peer));
   EXPECT_EQ(1, char_size);
   EXPECT_EQ(4, str_len);
   EXPECT_EQ(data8, peer);
 
-  uint16_t data16[] = { 't', 'w', 'o', 0xFFFF };
+  uint16_t data16[] = {'t', 'w', 'o', 0xFFFF};
 
   Dart_Handle str16 = Dart_NewStringFromUTF16(data16, ARRAY_SIZE(data16));
   EXPECT_VALID(str16);
   EXPECT(Dart_IsString(str16));
   EXPECT(!Dart_IsStringLatin1(str16));
   EXPECT(!Dart_IsExternalString(str16));
-  EXPECT_VALID(Dart_StringGetProperties(str16,
-                                        &char_size,
-                                        &str_len,
-                                        &peer));
+  EXPECT_VALID(Dart_StringGetProperties(str16, &char_size, &str_len, &peer));
   EXPECT_EQ(2, char_size);
   EXPECT_EQ(4, str_len);
   EXPECT(!peer);
 
-  Dart_Handle ext16 = Dart_NewExternalUTF16String(data16, ARRAY_SIZE(data16),
-                                                  data16, NULL);
+  Dart_Handle ext16 =
+      Dart_NewExternalUTF16String(data16, ARRAY_SIZE(data16), data16, NULL);
   EXPECT_VALID(ext16);
   EXPECT(Dart_IsString(ext16));
   EXPECT(Dart_IsExternalString(ext16));
-  EXPECT_VALID(Dart_StringGetProperties(ext16,
-                                        &char_size,
-                                        &str_len,
-                                        &peer));
+  EXPECT_VALID(Dart_StringGetProperties(ext16, &char_size, &str_len, &peer));
   EXPECT_EQ(2, char_size);
   EXPECT_EQ(4, str_len);
   EXPECT_EQ(data16, peer);
 
-  int32_t data32[] = { 'f', 'o', 'u', 'r', 0x10FFFF };
+  int32_t data32[] = {'f', 'o', 'u', 'r', 0x10FFFF};
 
   Dart_Handle str32 = Dart_NewStringFromUTF32(data32, ARRAY_SIZE(data32));
   EXPECT_VALID(str32);
@@ -1145,14 +1131,14 @@
   Dart_Handle null_str = NewString(null);
   EXPECT(Dart_IsError(null_str));
 
-  uint8_t data[] = { 0xE4, 0xBA, 0x8c };  // U+4E8C.
+  uint8_t data[] = {0xE4, 0xBA, 0x8c};  // U+4E8C.
   Dart_Handle utf8_str = Dart_NewStringFromUTF8(data, ARRAY_SIZE(data));
   EXPECT_VALID(utf8_str);
   EXPECT(Dart_IsString(utf8_str));
 
-  uint8_t invalid[] = { 0xE4, 0xBA };  // underflow.
-  Dart_Handle invalid_str = Dart_NewStringFromUTF8(invalid,
-                                                   ARRAY_SIZE(invalid));
+  uint8_t invalid[] = {0xE4, 0xBA};  // underflow.
+  Dart_Handle invalid_str =
+      Dart_NewStringFromUTF8(invalid, ARRAY_SIZE(invalid));
   EXPECT(Dart_IsError(invalid_str));
 }
 
@@ -1192,8 +1178,8 @@
   EXPECT_VALID(reversed);  // This is also allowed.
   uint8_t* utf8_encoded_reversed = NULL;
   intptr_t utf8_length_reversed = 0;
-  result = Dart_StringToUTF8(reversed,
-      &utf8_encoded_reversed, &utf8_length_reversed);
+  result = Dart_StringToUTF8(reversed, &utf8_encoded_reversed,
+                             &utf8_length_reversed);
   EXPECT_VALID(result);
   EXPECT_EQ(6, utf8_length_reversed);
   uint8_t expected[6] = {237, 180, 158, 237, 160, 180};
@@ -1237,20 +1223,14 @@
   {
     Dart_EnterScope();
 
-    uint8_t data8[] = { 'h', 'e', 'l', 'l', 'o' };
+    uint8_t data8[] = {'h', 'e', 'l', 'l', 'o'};
     Dart_Handle obj8 = Dart_NewExternalLatin1String(
-        data8,
-        ARRAY_SIZE(data8),
-        &peer8,
-        ExternalStringCallbackFinalizer);
+        data8, ARRAY_SIZE(data8), &peer8, ExternalStringCallbackFinalizer);
     EXPECT_VALID(obj8);
 
-    uint16_t data16[] = { 'h', 'e', 'l', 'l', 'o' };
+    uint16_t data16[] = {'h', 'e', 'l', 'l', 'o'};
     Dart_Handle obj16 = Dart_NewExternalUTF16String(
-        data16,
-        ARRAY_SIZE(data16),
-        &peer16,
-        ExternalStringCallbackFinalizer);
+        data16, ARRAY_SIZE(data16), &peer16, ExternalStringCallbackFinalizer);
     EXPECT_VALID(obj16);
 
     Dart_ExitScope();
@@ -1275,32 +1255,24 @@
 TEST_CASE(ExternalStringPretenure) {
   {
     Dart_EnterScope();
-    static const uint8_t big_data8[16*MB] = {0, };
+    static const uint8_t big_data8[16 * MB] = {
+        0,
+    };
     Dart_Handle big8 = Dart_NewExternalLatin1String(
-        big_data8,
-        ARRAY_SIZE(big_data8),
-        NULL,
-        NULL);
+        big_data8, ARRAY_SIZE(big_data8), NULL, NULL);
     EXPECT_VALID(big8);
-    static const uint16_t big_data16[16*MB/2] = {0, };
+    static const uint16_t big_data16[16 * MB / 2] = {
+        0,
+    };
     Dart_Handle big16 = Dart_NewExternalUTF16String(
-        big_data16,
-        ARRAY_SIZE(big_data16),
-        NULL,
-        NULL);
+        big_data16, ARRAY_SIZE(big_data16), NULL, NULL);
     static const uint8_t small_data8[] = {'f', 'o', 'o'};
     Dart_Handle small8 = Dart_NewExternalLatin1String(
-        small_data8,
-        ARRAY_SIZE(small_data8),
-        NULL,
-        NULL);
+        small_data8, ARRAY_SIZE(small_data8), NULL, NULL);
     EXPECT_VALID(small8);
     static const uint16_t small_data16[] = {'b', 'a', 'r'};
     Dart_Handle small16 = Dart_NewExternalUTF16String(
-        small_data16,
-        ARRAY_SIZE(small_data16),
-        NULL,
-        NULL);
+        small_data16, ARRAY_SIZE(small_data16), NULL, NULL);
     EXPECT_VALID(small16);
     {
       CHECK_API_SCOPE(thread);
@@ -1323,19 +1295,15 @@
 TEST_CASE(ExternalTypedDataPretenure) {
   {
     Dart_EnterScope();
-    static const int kBigLength = 16*MB/8;
+    static const int kBigLength = 16 * MB / 8;
     int64_t* big_data = new int64_t[kBigLength]();
-    Dart_Handle big = Dart_NewExternalTypedData(
-        Dart_TypedData_kInt64,
-        big_data,
-        kBigLength);
+    Dart_Handle big =
+        Dart_NewExternalTypedData(Dart_TypedData_kInt64, big_data, kBigLength);
     EXPECT_VALID(big);
-    static const int kSmallLength = 16*KB/8;
+    static const int kSmallLength = 16 * KB / 8;
     int64_t* small_data = new int64_t[kSmallLength]();
-    Dart_Handle small = Dart_NewExternalTypedData(
-        Dart_TypedData_kInt64,
-        small_data,
-        kSmallLength);
+    Dart_Handle small = Dart_NewExternalTypedData(Dart_TypedData_kInt64,
+                                                  small_data, kSmallLength);
     EXPECT_VALID(small);
     {
       CHECK_API_SCOPE(thread);
@@ -1476,8 +1444,8 @@
   result = Dart_ListGetRange(list_access_test_obj, 8, 4, values);
   EXPECT(Dart_IsError(result));
 
-  result = Dart_ListGetRange(
-      list_access_test_obj, kRangeOffset, kRangeLength, values);
+  result = Dart_ListGetRange(list_access_test_obj, kRangeOffset, kRangeLength,
+                             values);
   EXPECT_VALID(result);
 
   result = Dart_IntegerToInt64(values[0], &value);
@@ -1679,14 +1647,12 @@
 
 
 TEST_CASE(TypedDataAccess) {
-  EXPECT_EQ(Dart_TypedData_kInvalid,
-            Dart_GetTypeOfTypedData(Dart_True()));
+  EXPECT_EQ(Dart_TypedData_kInvalid, Dart_GetTypeOfTypedData(Dart_True()));
   EXPECT_EQ(Dart_TypedData_kInvalid,
             Dart_GetTypeOfExternalTypedData(Dart_False()));
   Dart_Handle byte_array1 = Dart_NewTypedData(Dart_TypedData_kUint8, 10);
   EXPECT_VALID(byte_array1);
-  EXPECT_EQ(Dart_TypedData_kUint8,
-            Dart_GetTypeOfTypedData(byte_array1));
+  EXPECT_EQ(Dart_TypedData_kUint8, Dart_GetTypeOfTypedData(byte_array1));
   EXPECT_EQ(Dart_TypedData_kInvalid,
             Dart_GetTypeOfExternalTypedData(byte_array1));
   EXPECT(Dart_IsList(byte_array1));
@@ -1739,7 +1705,7 @@
     EXPECT(is_equal);
   }
 
-  uint8_t data[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+  uint8_t data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
   for (intptr_t i = 0; i < 10; ++i) {
     EXPECT_VALID(Dart_ListSetAt(byte_array1, i, Dart_NewInteger(10 - i)));
   }
@@ -1856,15 +1822,15 @@
 
 
 static const intptr_t kExtLength = 16;
-static int8_t data[kExtLength] = { 0x41, 0x42, 0x41, 0x42,
-                                   0x41, 0x42, 0x41, 0x42,
-                                   0x41, 0x42, 0x41, 0x42,
-                                   0x41, 0x42, 0x41, 0x42, };
+static int8_t data[kExtLength] = {
+    0x41, 0x42, 0x41, 0x42, 0x41, 0x42, 0x41, 0x42,
+    0x41, 0x42, 0x41, 0x42, 0x41, 0x42, 0x41, 0x42,
+};
 
 static void ExternalByteDataNativeFunction(Dart_NativeArguments args) {
   Dart_EnterScope();
-  Dart_Handle external_byte_data = Dart_NewExternalTypedData(
-      Dart_TypedData_kByteData, data, 16);
+  Dart_Handle external_byte_data =
+      Dart_NewExternalTypedData(Dart_TypedData_kByteData, data, 16);
   EXPECT_VALID(external_byte_data);
   EXPECT_EQ(Dart_TypedData_kByteData,
             Dart_GetTypeOfTypedData(external_byte_data));
@@ -1874,7 +1840,9 @@
 
 
 static Dart_NativeFunction ExternalByteDataNativeResolver(
-    Dart_Handle name, int arg_count, bool* auto_setup_scope) {
+    Dart_Handle name,
+    int arg_count,
+    bool* auto_setup_scope) {
   ASSERT(auto_setup_scope != NULL);
   *auto_setup_scope = true;
   return &ExternalByteDataNativeFunction;
@@ -1913,18 +1881,17 @@
   // Create a test library and Load up a test script in it.
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
 
-  Dart_Handle result = Dart_SetNativeResolver(lib,
-                                              &ExternalByteDataNativeResolver,
-                                              NULL);
+  Dart_Handle result =
+      Dart_SetNativeResolver(lib, &ExternalByteDataNativeResolver, NULL);
   EXPECT_VALID(result);
 
   // Invoke 'main' function.
   result = Dart_Invoke(lib, NewString("main"), 0, NULL);
   EXPECT_VALID(result);
 
-  for (intptr_t i = 0; i < kExtLength; i+=2) {
+  for (intptr_t i = 0; i < kExtLength; i += 2) {
     EXPECT_EQ(0x24, data[i]);
-    EXPECT_EQ(0x28, data[i+1]);
+    EXPECT_EQ(0x28, data[i + 1]);
   }
 }
 
@@ -1933,15 +1900,15 @@
 
 
 static const intptr_t kOptExtLength = 16;
-static int8_t opt_data[kOptExtLength] = { 0x01, 0x02, 0x03, 0x04,
-                                          0x05, 0x06, 0x07, 0x08,
-                                          0x09, 0x0a, 0x0b, 0x0c,
-                                          0x0d, 0x0e, 0x0f, 0x10, };
+static int8_t opt_data[kOptExtLength] = {
+    0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
+    0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
+};
 
 static void OptExternalByteDataNativeFunction(Dart_NativeArguments args) {
   Dart_EnterScope();
-  Dart_Handle external_byte_data = Dart_NewExternalTypedData(
-      Dart_TypedData_kByteData, opt_data, 16);
+  Dart_Handle external_byte_data =
+      Dart_NewExternalTypedData(Dart_TypedData_kByteData, opt_data, 16);
   EXPECT_VALID(external_byte_data);
   EXPECT_EQ(Dart_TypedData_kByteData,
             Dart_GetTypeOfTypedData(external_byte_data));
@@ -1951,7 +1918,9 @@
 
 
 static Dart_NativeFunction OptExternalByteDataNativeResolver(
-    Dart_Handle name, int arg_count, bool* auto_setup_scope) {
+    Dart_Handle name,
+    int arg_count,
+    bool* auto_setup_scope) {
   ASSERT(auto_setup_scope != NULL);
   *auto_setup_scope = true;
   return &OptExternalByteDataNativeFunction;
@@ -1987,8 +1956,8 @@
   // Create a test library and Load up a test script in it.
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
 
-  Dart_Handle result = Dart_SetNativeResolver(
-      lib, &OptExternalByteDataNativeResolver, NULL);
+  Dart_Handle result =
+      Dart_SetNativeResolver(lib, &OptExternalByteDataNativeResolver, NULL);
   EXPECT_VALID(result);
 
   // Invoke 'main' function.
@@ -2009,30 +1978,37 @@
   EXPECT_VALID(byte_array);
   Dart_Handle result;
   result = Dart_TypedDataAcquireData(byte_array, NULL, NULL, NULL);
-  EXPECT_ERROR(result, "Dart_TypedDataAcquireData expects argument 'type'"
-                       " to be non-null.");
+  EXPECT_ERROR(result,
+               "Dart_TypedDataAcquireData expects argument 'type'"
+               " to be non-null.");
   Dart_TypedData_Type type;
   result = Dart_TypedDataAcquireData(byte_array, &type, NULL, NULL);
-  EXPECT_ERROR(result, "Dart_TypedDataAcquireData expects argument 'data'"
-                       " to be non-null.");
+  EXPECT_ERROR(result,
+               "Dart_TypedDataAcquireData expects argument 'data'"
+               " to be non-null.");
   void* data;
   result = Dart_TypedDataAcquireData(byte_array, &type, &data, NULL);
-  EXPECT_ERROR(result, "Dart_TypedDataAcquireData expects argument 'len'"
-                       " to be non-null.");
+  EXPECT_ERROR(result,
+               "Dart_TypedDataAcquireData expects argument 'len'"
+               " to be non-null.");
   intptr_t len;
   result = Dart_TypedDataAcquireData(Dart_Null(), &type, &data, &len);
-  EXPECT_ERROR(result, "Dart_TypedDataAcquireData expects argument 'object'"
-                       " to be non-null.");
+  EXPECT_ERROR(result,
+               "Dart_TypedDataAcquireData expects argument 'object'"
+               " to be non-null.");
   result = Dart_TypedDataAcquireData(str, &type, &data, &len);
-  EXPECT_ERROR(result, "Dart_TypedDataAcquireData expects argument 'object'"
-                       " to be of type 'TypedData'.");
+  EXPECT_ERROR(result,
+               "Dart_TypedDataAcquireData expects argument 'object'"
+               " to be of type 'TypedData'.");
 
   result = Dart_TypedDataReleaseData(Dart_Null());
-  EXPECT_ERROR(result, "Dart_TypedDataReleaseData expects argument 'object'"
-                       " to be non-null.");
+  EXPECT_ERROR(result,
+               "Dart_TypedDataReleaseData expects argument 'object'"
+               " to be non-null.");
   result = Dart_TypedDataReleaseData(str);
-  EXPECT_ERROR(result, "Dart_TypedDataReleaseData expects argument 'object'"
-                       " to be of type 'TypedData'.");
+  EXPECT_ERROR(result,
+               "Dart_TypedDataReleaseData expects argument 'object'"
+               " to be of type 'TypedData'.");
 }
 
 
@@ -2134,11 +2110,11 @@
   TestDirectAccess(lib, list_access_test_obj, Dart_TypedData_kInt8, false);
 
   // Test with an external typed data object.
-  uint8_t data[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+  uint8_t data[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
   intptr_t data_length = ARRAY_SIZE(data);
   Dart_Handle ext_list_access_test_obj;
-  ext_list_access_test_obj = Dart_NewExternalTypedData(Dart_TypedData_kUint8,
-                                                       data, data_length);
+  ext_list_access_test_obj =
+      Dart_NewExternalTypedData(Dart_TypedData_kUint8, data, data_length);
   EXPECT_VALID(ext_list_access_test_obj);
   TestDirectAccess(lib, ext_list_access_test_obj, Dart_TypedData_kUint8, true);
 }
@@ -2316,28 +2292,28 @@
 
 
 TEST_CASE(ExternalTypedDataAccess) {
-  uint8_t data[] = { 0, 11, 22, 33, 44, 55, 66, 77 };
+  uint8_t data[] = {0, 11, 22, 33, 44, 55, 66, 77};
   intptr_t data_length = ARRAY_SIZE(data);
 
-  Dart_Handle obj = Dart_NewExternalTypedData(
-      Dart_TypedData_kUint8, data, data_length);
+  Dart_Handle obj =
+      Dart_NewExternalTypedData(Dart_TypedData_kUint8, data, data_length);
   ExternalTypedDataAccessTests(obj, Dart_TypedData_kUint8, data, data_length);
 }
 
 
 TEST_CASE(ExternalClampedTypedDataAccess) {
-  uint8_t data[] = { 0, 11, 22, 33, 44, 55, 66, 77 };
+  uint8_t data[] = {0, 11, 22, 33, 44, 55, 66, 77};
   intptr_t data_length = ARRAY_SIZE(data);
 
-  Dart_Handle obj = Dart_NewExternalTypedData(
-      Dart_TypedData_kUint8Clamped, data, data_length);
-  ExternalTypedDataAccessTests(obj, Dart_TypedData_kUint8Clamped,
-                               data, data_length);
+  Dart_Handle obj = Dart_NewExternalTypedData(Dart_TypedData_kUint8Clamped,
+                                              data, data_length);
+  ExternalTypedDataAccessTests(obj, Dart_TypedData_kUint8Clamped, data,
+                               data_length);
 }
 
 
 TEST_CASE(ExternalUint8ClampedArrayAccess) {
-    const char* kScriptChars =
+  const char* kScriptChars =
       "testClamped(List a) {\n"
       "  if (a[1] != 11) return false;\n"
       "  a[1] = 3;\n"
@@ -2349,7 +2325,7 @@
       "  return true;\n"
       "}\n";
 
-  uint8_t data[] = { 0, 11, 22, 33, 44, 55, 66, 77 };
+  uint8_t data[] = {0, 11, 22, 33, 44, 55, 66, 77};
   intptr_t data_length = ARRAY_SIZE(data);
   Dart_Handle obj = Dart_NewExternalTypedData(Dart_TypedData_kUint8Clamped,
                                               data, data_length);
@@ -2373,8 +2349,7 @@
 
 static void NopCallback(void* isolate_callback_data,
                         Dart_WeakPersistentHandle handle,
-                        void* peer) {
-}
+                        void* peer) {}
 
 
 static void UnreachedCallback(void* isolate_callback_data,
@@ -2395,13 +2370,11 @@
   int peer = 0;
   {
     Dart_EnterScope();
-    uint8_t data[] = { 1, 2, 3, 4 };
-    Dart_Handle obj = Dart_NewExternalTypedData(
-        Dart_TypedData_kUint8,
-        data,
-        ARRAY_SIZE(data));
-    Dart_NewWeakPersistentHandle(
-        obj, &peer, sizeof(data), ExternalTypedDataFinalizer);
+    uint8_t data[] = {1, 2, 3, 4};
+    Dart_Handle obj = Dart_NewExternalTypedData(Dart_TypedData_kUint8, data,
+                                                ARRAY_SIZE(data));
+    Dart_NewWeakPersistentHandle(obj, &peer, sizeof(data),
+                                 ExternalTypedDataFinalizer);
     EXPECT_VALID(obj);
     Dart_ExitScope();
   }
@@ -2468,7 +2441,7 @@
 
 
 TEST_CASE(Float32x4List) {
-    const char* kScriptChars =
+  const char* kScriptChars =
       "import 'dart:typed_data';\n"
       "Float32x4List float32x4() {\n"
       "  return new Float32x4List(10);\n"
@@ -2485,18 +2458,18 @@
   CheckFloat32x4Data(obj);
 
   int peer = 0;
-  float data[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
-                   0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
-                   0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
-                   0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
+  float data[] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+                  0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+                  0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+                  0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
   // Push a scope so that we can collect the local handle created as part of
   // Dart_NewExternalTypedData.
   Dart_EnterScope();
   {
-    Dart_Handle lcl = Dart_NewExternalTypedData(
-        Dart_TypedData_kFloat32x4, data, 10);
-    Dart_NewWeakPersistentHandle(
-        lcl, &peer, sizeof(data), ExternalTypedDataFinalizer);
+    Dart_Handle lcl =
+        Dart_NewExternalTypedData(Dart_TypedData_kFloat32x4, data, 10);
+    Dart_NewWeakPersistentHandle(lcl, &peer, sizeof(data),
+                                 ExternalTypedDataFinalizer);
     CheckFloat32x4Data(lcl);
   }
   Dart_ExitScope();
@@ -2693,12 +2666,12 @@
 
 TEST_CASE(WeakPersistentHandle) {
   Dart_Handle local_new_ref = Dart_Null();
-  weak_new_ref = Dart_NewWeakPersistentHandle(
-      local_new_ref, NULL, 0, WeakPersistentHandleCallback);
+  weak_new_ref = Dart_NewWeakPersistentHandle(local_new_ref, NULL, 0,
+                                              WeakPersistentHandleCallback);
 
   Dart_Handle local_old_ref = Dart_Null();
-  weak_old_ref = Dart_NewWeakPersistentHandle(
-      local_old_ref, NULL, 0, WeakPersistentHandleCallback);
+  weak_old_ref = Dart_NewWeakPersistentHandle(local_old_ref, NULL, 0,
+                                              WeakPersistentHandleCallback);
 
   {
     Dart_EnterScope();
@@ -2717,17 +2690,13 @@
     }
 
     // Create a weak ref to the new space object.
-    weak_new_ref = Dart_NewWeakPersistentHandle(new_ref,
-                                                NULL,
-                                                0,
+    weak_new_ref = Dart_NewWeakPersistentHandle(new_ref, NULL, 0,
                                                 WeakPersistentHandleCallback);
     EXPECT_VALID(AsHandle(weak_new_ref));
     EXPECT(!Dart_IsNull(AsHandle(weak_new_ref)));
 
     // Create a weak ref to the old space object.
-    weak_old_ref = Dart_NewWeakPersistentHandle(old_ref,
-                                                NULL,
-                                                0,
+    weak_old_ref = Dart_NewWeakPersistentHandle(old_ref, NULL, 0,
                                                 WeakPersistentHandleCallback);
     EXPECT_VALID(AsHandle(weak_old_ref));
     EXPECT(!Dart_IsNull(AsHandle(weak_old_ref)));
@@ -2822,15 +2791,15 @@
   // NULL callback.
   Dart_Handle obj1 = NewString("new string");
   EXPECT_VALID(obj1);
-  Dart_WeakPersistentHandle ref1 = Dart_NewWeakPersistentHandle(
-      obj1, NULL, 0, NULL);
+  Dart_WeakPersistentHandle ref1 =
+      Dart_NewWeakPersistentHandle(obj1, NULL, 0, NULL);
   EXPECT_EQ(ref1, static_cast<void*>(NULL));
 
   // Immediate object.
   Dart_Handle obj2 = Dart_NewInteger(0);
   EXPECT_VALID(obj2);
-  Dart_WeakPersistentHandle ref2 = Dart_NewWeakPersistentHandle(
-      obj2, NULL, 0, WeakPersistentHandleCallback);
+  Dart_WeakPersistentHandle ref2 =
+      Dart_NewWeakPersistentHandle(obj2, NULL, 0, WeakPersistentHandleCallback);
   EXPECT_EQ(ref2, static_cast<void*>(NULL));
 
   Dart_ExitScope();
@@ -2900,9 +2869,7 @@
   Dart_EnterScope();
   Dart_Handle ref = Dart_True();
   int peer = 1234;
-  Dart_NewWeakPersistentHandle(ref,
-                               &peer,
-                               0,
+  Dart_NewWeakPersistentHandle(ref, &peer, 0,
                                WeakPersistentHandlePeerFinalizer);
   Dart_ExitScope();
   Dart_ShutdownIsolate();
@@ -2920,9 +2887,7 @@
     Dart_EnterScope();
     Dart_Handle obj = NewString("weakly referenced string");
     EXPECT_VALID(obj);
-    weak1 = Dart_NewWeakPersistentHandle(obj,
-                                         NULL,
-                                         kWeak1ExternalSize,
+    weak1 = Dart_NewWeakPersistentHandle(obj, NULL, kWeak1ExternalSize,
                                          NopCallback);
     EXPECT_VALID(AsHandle(weak1));
     Dart_ExitScope();
@@ -2935,9 +2900,7 @@
     Dart_Handle obj = NewString("strongly referenced string");
     EXPECT_VALID(obj);
     strong_ref = Dart_NewPersistentHandle(obj);
-    weak2 = Dart_NewWeakPersistentHandle(obj,
-                                         NULL,
-                                         kWeak2ExternalSize,
+    weak2 = Dart_NewWeakPersistentHandle(obj, NULL, kWeak2ExternalSize,
                                          NopCallback);
     EXPECT_VALID(AsHandle(strong_ref));
     Dart_ExitScope();
@@ -2978,16 +2941,14 @@
     Dart_Handle obj = NewString("weakly referenced string");
     EXPECT_VALID(obj);
     // Triggers a scavenge immediately, since kWeak1ExternalSize is above limit.
-    weak1 = Dart_NewWeakPersistentHandle(obj,
-                                         NULL,
-                                         kWeak1ExternalSize,
+    weak1 = Dart_NewWeakPersistentHandle(obj, NULL, kWeak1ExternalSize,
                                          NopCallback);
     EXPECT_VALID(AsHandle(weak1));
     // ... but the object is still alive and not yet promoted, so external size
     // in new space is still above the limit. Thus, even the following tiny
     // external allocation will trigger another scavenge.
     Dart_WeakPersistentHandle trigger =
-      Dart_NewWeakPersistentHandle(obj, NULL, 1, NopCallback);
+        Dart_NewWeakPersistentHandle(obj, NULL, 1, NopCallback);
     EXPECT_VALID(AsHandle(trigger));
     Dart_DeleteWeakPersistentHandle(isolate, trigger);
     // After the two scavenges above, 'obj' should now be promoted, hence its
@@ -3026,9 +2987,7 @@
     Dart_EnterScope();
     Dart_Handle dead = Api::NewHandle(thread, String::New("dead", Heap::kOld));
     EXPECT_VALID(dead);
-    weak = Dart_NewWeakPersistentHandle(dead,
-                                        NULL,
-                                        kSmallExternalSize,
+    weak = Dart_NewWeakPersistentHandle(dead, NULL, kSmallExternalSize,
                                         NopCallback);
     EXPECT_VALID(AsHandle(weak));
     Dart_ExitScope();
@@ -3037,10 +2996,7 @@
             isolate->heap()->ExternalInWords(Heap::kOld) * kWordSize);
   // Large enough to trigger GC in old space. Not actually allocated.
   const intptr_t kHugeExternalSize = (kWordSize == 4) ? 513 * MB : 1025 * MB;
-  Dart_NewWeakPersistentHandle(live,
-                               NULL,
-                               kHugeExternalSize,
-                               NopCallback);
+  Dart_NewWeakPersistentHandle(live, NULL, kHugeExternalSize, NopCallback);
   // Expect small garbage to be collected.
   EXPECT_EQ(kHugeExternalSize,
             isolate->heap()->ExternalInWords(Heap::kOld) * kWordSize);
@@ -3059,13 +3015,13 @@
     Dart_EnterScope();
     Dart_Handle dart_true = Dart_True();  // VM heap object.
     EXPECT_VALID(dart_true);
-    weak1 = Dart_NewWeakPersistentHandle(
-        dart_true, NULL, kWeak1ExternalSize, UnreachedCallback);
+    weak1 = Dart_NewWeakPersistentHandle(dart_true, NULL, kWeak1ExternalSize,
+                                         UnreachedCallback);
     EXPECT_VALID(AsHandle(weak1));
     Dart_Handle zero = Dart_False();  // VM heap object.
     EXPECT_VALID(zero);
-    weak2 = Dart_NewWeakPersistentHandle(
-        zero, NULL, kWeak2ExternalSize, UnreachedCallback);
+    weak2 = Dart_NewWeakPersistentHandle(zero, NULL, kWeak2ExternalSize,
+                                         UnreachedCallback);
     EXPECT_VALID(AsHandle(weak2));
     // Both should be charged to old space.
     EXPECT(heap->ExternalInWords(Heap::kOld) ==
@@ -3111,8 +3067,8 @@
     CHECK_API_SCOPE(thread);
     HANDLESCOPE(thread);
 
-    Dart_Handle local = Api::NewHandle(
-        thread, String::New("strongly reachable", Heap::kOld));
+    Dart_Handle local =
+        Api::NewHandle(thread, String::New("strongly reachable", Heap::kOld));
     strong = Dart_NewPersistentHandle(local);
     strong_weak = Dart_NewWeakPersistentHandle(local, NULL, 0, NopCallback);
 
@@ -3178,8 +3134,8 @@
     CHECK_API_SCOPE(thread);
     HANDLESCOPE(thread);
 
-    Dart_Handle local = Api::NewHandle(
-        thread, String::New("strongly reachable", Heap::kOld));
+    Dart_Handle local =
+        Api::NewHandle(thread, String::New("strongly reachable", Heap::kOld));
     strong = Dart_NewPersistentHandle(local);
     strong_weak = Dart_NewWeakPersistentHandle(local, NULL, 0, NopCallback);
 
@@ -3250,8 +3206,7 @@
 static int global_epilogue_callback_status;
 
 
-static void EpilogueCallbackNOP() {
-}
+static void EpilogueCallbackNOP() {}
 
 
 static void EpilogueCallbackTimes4() {
@@ -3268,16 +3223,16 @@
   // GC callback addition testing.
 
   // Add GC callbacks.
-  EXPECT_VALID(Dart_SetGcCallbacks(&PrologueCallbackTimes2,
-                                   &EpilogueCallbackTimes4));
+  EXPECT_VALID(
+      Dart_SetGcCallbacks(&PrologueCallbackTimes2, &EpilogueCallbackTimes4));
 
   // Add the same callbacks again.  This is an error.
-  EXPECT(Dart_IsError(Dart_SetGcCallbacks(&PrologueCallbackTimes2,
-                                          &EpilogueCallbackTimes4)));
+  EXPECT(Dart_IsError(
+      Dart_SetGcCallbacks(&PrologueCallbackTimes2, &EpilogueCallbackTimes4)));
 
   // Add another callback. This is an error.
-  EXPECT(Dart_IsError(Dart_SetGcCallbacks(&PrologueCallbackTimes3,
-                                          &EpilogueCallbackTimes5)));
+  EXPECT(Dart_IsError(
+      Dart_SetGcCallbacks(&PrologueCallbackTimes3, &EpilogueCallbackTimes5)));
 
   // GC callback removal testing.
 
@@ -3287,8 +3242,8 @@
   // Remove GC callbacks whennone exist.  This is an error.
   EXPECT(Dart_IsError(Dart_SetGcCallbacks(NULL, NULL)));
 
-  EXPECT_VALID(Dart_SetGcCallbacks(&PrologueCallbackTimes2,
-                                   &EpilogueCallbackTimes4));
+  EXPECT_VALID(
+      Dart_SetGcCallbacks(&PrologueCallbackTimes2, &EpilogueCallbackTimes4));
   EXPECT(Dart_IsError(Dart_SetGcCallbacks(&PrologueCallbackTimes2, NULL)));
   EXPECT(Dart_IsError(Dart_SetGcCallbacks(NULL, &EpilogueCallbackTimes4)));
 }
@@ -3296,8 +3251,8 @@
 
 TEST_CASE(SingleGarbageCollectionCallback) {
   // Add a prologue callback.
-  EXPECT_VALID(Dart_SetGcCallbacks(&PrologueCallbackTimes2,
-                                   &EpilogueCallbackNOP));
+  EXPECT_VALID(
+      Dart_SetGcCallbacks(&PrologueCallbackTimes2, &EpilogueCallbackNOP));
 
   {
     TransitionNativeToVM transition(thread);
@@ -3318,13 +3273,12 @@
     EXPECT_EQ(6, global_prologue_callback_status);
     EXPECT_EQ(7, global_epilogue_callback_status);
 
-  // Garbage collect old space ignoring callbacks.  This should invoke
-  // the prologue callback.  The prologue status value should change.
+    // Garbage collect old space ignoring callbacks.  This should invoke
+    // the prologue callback.  The prologue status value should change.
     global_prologue_callback_status = 3;
     global_epilogue_callback_status = 7;
-    Isolate::Current()->heap()->CollectGarbage(Heap::kOld,
-                                               Heap::kIgnoreApiCallbacks,
-                                               Heap::kGCTestCase);
+    Isolate::Current()->heap()->CollectGarbage(
+        Heap::kOld, Heap::kIgnoreApiCallbacks, Heap::kGCTestCase);
     EXPECT_EQ(3, global_prologue_callback_status);
     EXPECT_EQ(7, global_epilogue_callback_status);
 
@@ -3345,8 +3299,8 @@
 
   // Add an epilogue callback.
   EXPECT_VALID(Dart_SetGcCallbacks(NULL, NULL));
-  EXPECT_VALID(Dart_SetGcCallbacks(&PrologueCallbackTimes2,
-                                   &EpilogueCallbackTimes4));
+  EXPECT_VALID(
+      Dart_SetGcCallbacks(&PrologueCallbackTimes2, &EpilogueCallbackTimes4));
 
   {
     TransitionNativeToVM transition(thread);
@@ -3376,9 +3330,8 @@
 
     // Garbage collect old space again without invoking callbacks.
     // Nothing should change.
-    Isolate::Current()->heap()->CollectGarbage(Heap::kOld,
-                                               Heap::kIgnoreApiCallbacks,
-                                               Heap::kGCTestCase);
+    Isolate::Current()->heap()->CollectGarbage(
+        Heap::kOld, Heap::kIgnoreApiCallbacks, Heap::kGCTestCase);
     EXPECT_EQ(6, global_prologue_callback_status);
     EXPECT_EQ(28, global_epilogue_callback_status);
 
@@ -3543,8 +3496,7 @@
   char* err;
   Dart_Isolate isolate =
       Dart_CreateIsolate(NULL, NULL, bin::isolate_snapshot_buffer, NULL,
-                         reinterpret_cast<void*>(mydata),
-                         &err);
+                         reinterpret_cast<void*>(mydata), &err);
   EXPECT(isolate != NULL);
   EXPECT_EQ(mydata, reinterpret_cast<intptr_t>(Dart_CurrentIsolateData()));
   EXPECT_EQ(mydata, reinterpret_cast<intptr_t>(Dart_IsolateData(isolate)));
@@ -3573,10 +3525,8 @@
   api_flags.enable_error_on_bad_override = true;
 
   char* err;
-  Dart_Isolate isolate = Dart_CreateIsolate(NULL, NULL,
-                                            bin::isolate_snapshot_buffer,
-                                            &api_flags,
-                                            NULL, &err);
+  Dart_Isolate isolate = Dart_CreateIsolate(
+      NULL, NULL, bin::isolate_snapshot_buffer, &api_flags, NULL, &err);
   if (isolate == NULL) {
     OS::Print("Creation of isolate failed '%s'\n", err);
     free(err);
@@ -3594,8 +3544,9 @@
     result = Dart_FinalizeLoading(false);
     EXPECT_VALID(result);
     result = Dart_Invoke(lib, NewString("bad1"), 0, NULL);
-    EXPECT_ERROR(result, "Unhandled exception:\n"
-        "type 'String' is not a subtype of type 'int' of 'foo'");
+    EXPECT_ERROR(result,
+                 "Unhandled exception:\n"
+                 "type 'String' is not a subtype of type 'int' of 'foo'");
 
     result = Dart_Invoke(lib, NewString("good1"), 0, NULL);
     EXPECT_VALID(result);
@@ -3616,8 +3567,7 @@
 }
 
 
-static void MyMessageNotifyCallback(Dart_Isolate dest_isolate) {
-}
+static void MyMessageNotifyCallback(Dart_Isolate dest_isolate) {}
 
 
 UNIT_TEST_CASE(SetMessageCallbacks) {
@@ -3630,8 +3580,7 @@
 
 
 TEST_CASE(SetStickyError) {
-    const char* kScriptChars =
-      "main() => throw 'HI';";
+  const char* kScriptChars = "main() => throw 'HI';";
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
   Dart_Handle retobj = Dart_Invoke(lib, NewString("main"), 0, NULL);
   EXPECT(Dart_IsError(retobj));
@@ -3670,7 +3619,7 @@
       "Type getMyClass1Type() { return new MyClass1().runtimeType; }\n"
       "Type getMyClass2Type() { return new MyClass2().runtimeType; }\n";
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
-  bool instanceof = false;
+  bool instanceOf = false;
 
   // First get the type objects of these non parameterized types.
   Dart_Handle type0 = Dart_GetType(lib, NewString("MyClass0"), 0, NULL);
@@ -3689,16 +3638,16 @@
   // MyClass0 type.
   Dart_Handle type0_obj = Dart_Invoke(lib, NewString("getMyClass0"), 0, NULL);
   EXPECT_VALID(type0_obj);
-  EXPECT_VALID(Dart_ObjectIsType(type0_obj, type0, &instanceof));
-  EXPECT(instanceof);
-  EXPECT_VALID(Dart_ObjectIsType(type0_obj, type1, &instanceof));
-  EXPECT(!instanceof);
-  EXPECT_VALID(Dart_ObjectIsType(type0_obj, type2, &instanceof));
-  EXPECT(!instanceof);
-  EXPECT_VALID(Dart_ObjectIsType(type0_obj, type3, &instanceof));
-  EXPECT(!instanceof);
-  EXPECT_VALID(Dart_ObjectIsType(type0_obj, type4, &instanceof));
-  EXPECT(!instanceof);
+  EXPECT_VALID(Dart_ObjectIsType(type0_obj, type0, &instanceOf));
+  EXPECT(instanceOf);
+  EXPECT_VALID(Dart_ObjectIsType(type0_obj, type1, &instanceOf));
+  EXPECT(!instanceOf);
+  EXPECT_VALID(Dart_ObjectIsType(type0_obj, type2, &instanceOf));
+  EXPECT(!instanceOf);
+  EXPECT_VALID(Dart_ObjectIsType(type0_obj, type3, &instanceOf));
+  EXPECT(!instanceOf);
+  EXPECT_VALID(Dart_ObjectIsType(type0_obj, type4, &instanceOf));
+  EXPECT(!instanceOf);
   type0_obj = Dart_Invoke(lib, NewString("getMyClass0Type"), 0, NULL);
   EXPECT_VALID(type0_obj);
   EXPECT(Dart_IdentityEquals(type0, type0_obj));
@@ -3706,16 +3655,16 @@
   // MyClass1 type.
   Dart_Handle type1_obj = Dart_Invoke(lib, NewString("getMyClass1"), 0, NULL);
   EXPECT_VALID(type1_obj);
-  EXPECT_VALID(Dart_ObjectIsType(type1_obj, type1, &instanceof));
-  EXPECT(instanceof);
-  EXPECT_VALID(Dart_ObjectIsType(type1_obj, type0, &instanceof));
-  EXPECT(!instanceof);
-  EXPECT_VALID(Dart_ObjectIsType(type1_obj, type2, &instanceof));
-  EXPECT(!instanceof);
-  EXPECT_VALID(Dart_ObjectIsType(type1_obj, type3, &instanceof));
-  EXPECT(instanceof);
-  EXPECT_VALID(Dart_ObjectIsType(type1_obj, type4, &instanceof));
-  EXPECT(instanceof);
+  EXPECT_VALID(Dart_ObjectIsType(type1_obj, type1, &instanceOf));
+  EXPECT(instanceOf);
+  EXPECT_VALID(Dart_ObjectIsType(type1_obj, type0, &instanceOf));
+  EXPECT(!instanceOf);
+  EXPECT_VALID(Dart_ObjectIsType(type1_obj, type2, &instanceOf));
+  EXPECT(!instanceOf);
+  EXPECT_VALID(Dart_ObjectIsType(type1_obj, type3, &instanceOf));
+  EXPECT(instanceOf);
+  EXPECT_VALID(Dart_ObjectIsType(type1_obj, type4, &instanceOf));
+  EXPECT(instanceOf);
   type1_obj = Dart_Invoke(lib, NewString("getMyClass1Type"), 0, NULL);
   EXPECT_VALID(type1_obj);
   EXPECT(Dart_IdentityEquals(type1, type1_obj));
@@ -3723,16 +3672,16 @@
   // MyClass2 type.
   Dart_Handle type2_obj = Dart_Invoke(lib, NewString("getMyClass2"), 0, NULL);
   EXPECT_VALID(type2_obj);
-  EXPECT_VALID(Dart_ObjectIsType(type2_obj, type2, &instanceof));
-  EXPECT(instanceof);
-  EXPECT_VALID(Dart_ObjectIsType(type2_obj, type0, &instanceof));
-  EXPECT(!instanceof);
-  EXPECT_VALID(Dart_ObjectIsType(type2_obj, type1, &instanceof));
-  EXPECT(!instanceof);
-  EXPECT_VALID(Dart_ObjectIsType(type2_obj, type3, &instanceof));
-  EXPECT(instanceof);
-  EXPECT_VALID(Dart_ObjectIsType(type2_obj, type4, &instanceof));
-  EXPECT(instanceof);
+  EXPECT_VALID(Dart_ObjectIsType(type2_obj, type2, &instanceOf));
+  EXPECT(instanceOf);
+  EXPECT_VALID(Dart_ObjectIsType(type2_obj, type0, &instanceOf));
+  EXPECT(!instanceOf);
+  EXPECT_VALID(Dart_ObjectIsType(type2_obj, type1, &instanceOf));
+  EXPECT(!instanceOf);
+  EXPECT_VALID(Dart_ObjectIsType(type2_obj, type3, &instanceOf));
+  EXPECT(instanceOf);
+  EXPECT_VALID(Dart_ObjectIsType(type2_obj, type4, &instanceOf));
+  EXPECT(instanceOf);
   type2_obj = Dart_Invoke(lib, NewString("getMyClass2Type"), 0, NULL);
   EXPECT_VALID(type2_obj);
   EXPECT(Dart_IdentityEquals(type2, type2_obj));
@@ -3771,7 +3720,7 @@
       "  return new MyClass1<List<int>, List<double>>().runtimeType;\n"
       "}\n";
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
-  bool instanceof = false;
+  bool instanceOf = false;
 
   // First get type objects of some of the basic types used in the test.
   Dart_Handle int_type = Dart_GetType(lib, NewString("int"), 0, NULL);
@@ -3782,10 +3731,8 @@
   EXPECT_VALID(list_type);
   Dart_Handle type_args = Dart_NewList(1);
   EXPECT_VALID(Dart_ListSetAt(type_args, 0, int_type));
-  Dart_Handle list_int_type = Dart_GetType(lib,
-                                           NewString("List"),
-                                           1,
-                                           &type_args);
+  Dart_Handle list_int_type =
+      Dart_GetType(lib, NewString("List"), 1, &type_args);
   EXPECT_VALID(list_int_type);
 
   // Now instantiate MyClass0 and MyClass1 types with the same type arguments
@@ -3793,19 +3740,15 @@
   type_args = Dart_NewList(2);
   EXPECT_VALID(Dart_ListSetAt(type_args, 0, int_type));
   EXPECT_VALID(Dart_ListSetAt(type_args, 1, double_type));
-  Dart_Handle myclass0_type = Dart_GetType(lib,
-                                           NewString("MyClass0"),
-                                           2,
-                                           &type_args);
+  Dart_Handle myclass0_type =
+      Dart_GetType(lib, NewString("MyClass0"), 2, &type_args);
   EXPECT_VALID(myclass0_type);
 
   type_args = Dart_NewList(2);
   EXPECT_VALID(Dart_ListSetAt(type_args, 0, list_int_type));
   EXPECT_VALID(Dart_ListSetAt(type_args, 1, list_type));
-  Dart_Handle myclass1_type = Dart_GetType(lib,
-                                           NewString("MyClass1"),
-                                           2,
-                                           &type_args);
+  Dart_Handle myclass1_type =
+      Dart_GetType(lib, NewString("MyClass1"), 2, &type_args);
   EXPECT_VALID(myclass1_type);
 
   // Now create objects of the type and validate the object type matches
@@ -3814,8 +3757,8 @@
   // MyClass0<int, double> type.
   Dart_Handle type0_obj = Dart_Invoke(lib, NewString("getMyClass0"), 0, NULL);
   EXPECT_VALID(type0_obj);
-  EXPECT_VALID(Dart_ObjectIsType(type0_obj, myclass0_type, &instanceof));
-  EXPECT(instanceof);
+  EXPECT_VALID(Dart_ObjectIsType(type0_obj, myclass0_type, &instanceOf));
+  EXPECT(instanceOf);
   type0_obj = Dart_Invoke(lib, NewString("getMyClass0Type"), 0, NULL);
   EXPECT_VALID(type0_obj);
   EXPECT(Dart_IdentityEquals(type0_obj, myclass0_type));
@@ -3823,8 +3766,8 @@
   // MyClass1<List<int>, List> type.
   Dart_Handle type1_obj = Dart_Invoke(lib, NewString("getMyClass1"), 0, NULL);
   EXPECT_VALID(type1_obj);
-  EXPECT_VALID(Dart_ObjectIsType(type1_obj, myclass1_type, &instanceof));
-  EXPECT(instanceof);
+  EXPECT_VALID(Dart_ObjectIsType(type1_obj, myclass1_type, &instanceOf));
+  EXPECT(instanceOf);
   type1_obj = Dart_Invoke(lib, NewString("getMyClass1Type"), 0, NULL);
   EXPECT_VALID(type1_obj);
   EXPECT(Dart_IdentityEquals(type1_obj, myclass1_type));
@@ -3832,8 +3775,8 @@
   // MyClass0<double, int> type.
   type0_obj = Dart_Invoke(lib, NewString("getMyClass0_1"), 0, NULL);
   EXPECT_VALID(type0_obj);
-  EXPECT_VALID(Dart_ObjectIsType(type0_obj, myclass0_type, &instanceof));
-  EXPECT(!instanceof);
+  EXPECT_VALID(Dart_ObjectIsType(type0_obj, myclass0_type, &instanceOf));
+  EXPECT(!instanceOf);
   type0_obj = Dart_Invoke(lib, NewString("getMyClass0_1Type"), 0, NULL);
   EXPECT_VALID(type0_obj);
   EXPECT(!Dart_IdentityEquals(type0_obj, myclass0_type));
@@ -3841,8 +3784,8 @@
   // MyClass1<List<int>, List<double>> type.
   type1_obj = Dart_Invoke(lib, NewString("getMyClass1_1"), 0, NULL);
   EXPECT_VALID(type1_obj);
-  EXPECT_VALID(Dart_ObjectIsType(type1_obj, myclass1_type, &instanceof));
-  EXPECT(instanceof);
+  EXPECT_VALID(Dart_ObjectIsType(type1_obj, myclass1_type, &instanceOf));
+  EXPECT(instanceOf);
   type1_obj = Dart_Invoke(lib, NewString("getMyClass1_1Type"), 0, NULL);
   EXPECT_VALID(type1_obj);
   EXPECT(!Dart_IdentityEquals(type1_obj, myclass1_type));
@@ -3887,8 +3830,7 @@
 }
 
 
-static void TestFieldNotFound(Dart_Handle container,
-                              Dart_Handle name) {
+static void TestFieldNotFound(Dart_Handle container, Dart_Handle name) {
   EXPECT(Dart_IsError(Dart_GetField(container, name)));
   EXPECT(Dart_IsError(Dart_SetField(container, name, Dart_Null())));
 }
@@ -4147,8 +4089,7 @@
 
 
 TEST_CASE(SetField_FunnyValue) {
-  const char* kScriptChars =
-      "var top;\n";
+  const char* kScriptChars = "var top;\n";
 
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
   Dart_Handle name = NewString("top");
@@ -4213,14 +4154,12 @@
   const int kNumNativeFields = 4;
 
   // Create a test library.
-  Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL,
-                                             USER_TEST_URI, false);
+  Dart_Handle lib =
+      TestCase::LoadTestScript(kScriptChars, NULL, USER_TEST_URI, false);
 
   // Create a native wrapper class with native fields.
-  result = Dart_CreateNativeWrapperClass(
-      lib,
-      NewString("NativeFieldsWrapper"),
-      kNumNativeFields);
+  result = Dart_CreateNativeWrapperClass(lib, NewString("NativeFieldsWrapper"),
+                                         kNumNativeFields);
   EXPECT_VALID(result);
   result = Dart_FinalizeLoading(false);
   EXPECT_VALID(result);
@@ -4242,9 +4181,9 @@
   // We check to make sure the instance size computed by the VM matches
   // our expectations.
   intptr_t header_size = sizeof(RawObject);
-  EXPECT_EQ(Utils::RoundUp(((1 + 2) * kWordSize) + header_size,
-                           kObjectAlignment),
-            cls.instance_size());
+  EXPECT_EQ(
+      Utils::RoundUp(((1 + 2) * kWordSize) + header_size, kObjectAlignment),
+      cls.instance_size());
   EXPECT_EQ(kNumNativeFields, cls.num_native_fields());
 }
 
@@ -4264,8 +4203,8 @@
       "}\n";
   Dart_Handle result;
   // Create a test library and Load up a test script in it.
-  Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL,
-                                             USER_TEST_URI, false);
+  Dart_Handle lib =
+      TestCase::LoadTestScript(kScriptChars, NULL, USER_TEST_URI, false);
 
   // Invoke a function which returns an object of type NativeFields.
   result = Dart_Invoke(lib, NewString("testMain"), 0, NULL);
@@ -4295,8 +4234,7 @@
   const int kNumNativeFields = 2;
 
   // Load up a test script in the test library.
-  Dart_Handle lib = TestCase::LoadTestScript(kScriptChars,
-                                             native_field_lookup);
+  Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, native_field_lookup);
 
   // Invoke a function which returns an object of type NativeFields.
   result = Dart_Invoke(lib, NewString("testMain"), 0, NULL);
@@ -4313,9 +4251,9 @@
   // We check to make sure the instance size computed by the VM matches
   // our expectations.
   intptr_t header_size = sizeof(RawObject);
-  EXPECT_EQ(Utils::RoundUp(((1 + 2) * kWordSize) + header_size,
-                           kObjectAlignment),
-            cls.instance_size());
+  EXPECT_EQ(
+      Utils::RoundUp(((1 + 2) * kWordSize) + header_size, kObjectAlignment),
+      cls.instance_size());
   EXPECT_EQ(kNumNativeFields, cls.num_native_fields());
 }
 
@@ -4369,16 +4307,12 @@
 
 void TestNativeFieldsAccess_access(Dart_NativeArguments args) {
   intptr_t field_values[kTestNumNativeFields];
-  Dart_Handle result = Dart_GetNativeFieldsOfArgument(args,
-                                                      0,
-                                                      kTestNumNativeFields,
-                                                      field_values);
+  Dart_Handle result = Dart_GetNativeFieldsOfArgument(
+      args, 0, kTestNumNativeFields, field_values);
   EXPECT_VALID(result);
   EXPECT_EQ(kNativeField1Value, field_values[0]);
   EXPECT_EQ(kNativeField2Value, field_values[1]);
-  result = Dart_GetNativeFieldsOfArgument(args,
-                                          1,
-                                          kTestNumNativeFields,
+  result = Dart_GetNativeFieldsOfArgument(args, 1, kTestNumNativeFields,
                                           field_values);
   EXPECT_VALID(result);
   EXPECT_EQ(0, field_values[0]);
@@ -4428,8 +4362,8 @@
       "}\n";
 
   // Load up a test script in the test library.
-  Dart_Handle lib = TestCase::LoadTestScript(kScriptChars,
-                                             TestNativeFieldsAccess_lookup);
+  Dart_Handle lib =
+      TestCase::LoadTestScript(kScriptChars, TestNativeFieldsAccess_lookup);
 
   // Invoke a function which returns an object of type NativeFields.
   Dart_Handle result = Dart_Invoke(lib, NewString("testMain"), 0, NULL);
@@ -4483,13 +4417,9 @@
   EXPECT_VALID(result);
   result = Dart_IntegerToInt64(result, &value);
   EXPECT_EQ(20, value);
-  result = Dart_SetField(retobj,
-                         NewString("fld2"),
-                         Dart_NewInteger(40));
+  result = Dart_SetField(retobj, NewString("fld2"), Dart_NewInteger(40));
   EXPECT(Dart_IsError(result));
-  result = Dart_SetField(retobj,
-                         NewString("fld1"),
-                         Dart_NewInteger(40));
+  result = Dart_SetField(retobj, NewString("fld1"), Dart_NewInteger(40));
   EXPECT_VALID(result);
   result = Dart_GetField(retobj, NewString("fld1"));
   EXPECT_VALID(result);
@@ -4564,16 +4494,12 @@
   const int kNumNativeFields = 4;
 
   // Create a test library.
-  Dart_Handle lib = TestCase::LoadTestScript(kScriptChars,
-                                             native_field_lookup,
-                                             USER_TEST_URI,
-                                             false);
+  Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, native_field_lookup,
+                                             USER_TEST_URI, false);
 
   // Create a native wrapper class with native fields.
   Dart_Handle result = Dart_CreateNativeWrapperClass(
-      lib,
-      NewString("NativeFieldsWrapper"),
-      kNumNativeFields);
+      lib, NewString("NativeFieldsWrapper"), kNumNativeFields);
   EXPECT_VALID(result);
   result = Dart_FinalizeLoading(false);
   EXPECT_VALID(result);
@@ -4617,8 +4543,7 @@
       "  return obj;\n"
       "}\n";
   // Load up a test script in the test library.
-  Dart_Handle lib = TestCase::LoadTestScript(kScriptChars,
-                                             native_field_lookup);
+  Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, native_field_lookup);
 
   // Invoke a function which returns an object of type NativeFields.
   Dart_Handle retobj = Dart_Invoke(lib, NewString("testMain"), 0, NULL);
@@ -4770,9 +4695,7 @@
   EXPECT_EQ(11, value);
 
   // Overwrite fld2
-  result = Dart_SetField(type,
-                         NewString("fld2"),
-                         Dart_NewInteger(13));
+  result = Dart_SetField(type, NewString("fld2"), Dart_NewInteger(13));
   EXPECT_VALID(result);
 
   // We now get the new value for fld2, not the initializer
@@ -4871,9 +4794,9 @@
   // Allocate and Invoke the unnamed constructor passing in Dart_Null.
   Dart_Handle result = Dart_New(type, Dart_Null(), 0, NULL);
   EXPECT_VALID(result);
-  bool instanceof = false;
-  EXPECT_VALID(Dart_ObjectIsType(result, type, &instanceof));
-  EXPECT(instanceof);
+  bool instanceOf = false;
+  EXPECT_VALID(Dart_ObjectIsType(result, type, &instanceOf));
+  EXPECT(instanceOf);
   int64_t int_value = 0;
   Dart_Handle foo = Dart_GetField(result, NewString("foo"));
   EXPECT_VALID(Dart_IntegerToInt64(foo, &int_value));
@@ -4882,18 +4805,18 @@
   // Allocate without a constructor.
   Dart_Handle obj = Dart_Allocate(type);
   EXPECT_VALID(obj);
-  instanceof = false;
-  EXPECT_VALID(Dart_ObjectIsType(obj, type, &instanceof));
-  EXPECT(instanceof);
+  instanceOf = false;
+  EXPECT_VALID(Dart_ObjectIsType(obj, type, &instanceOf));
+  EXPECT(instanceOf);
   foo = Dart_GetField(obj, NewString("foo"));
   EXPECT(Dart_IsNull(foo));
 
   // Allocate and Invoke the unnamed constructor passing in an empty string.
   result = Dart_New(type, Dart_EmptyString(), 0, NULL);
   EXPECT_VALID(result);
-  instanceof = false;
-  EXPECT_VALID(Dart_ObjectIsType(result, type, &instanceof));
-  EXPECT(instanceof);
+  instanceOf = false;
+  EXPECT_VALID(Dart_ObjectIsType(result, type, &instanceOf));
+  EXPECT(instanceOf);
   int_value = 0;
   foo = Dart_GetField(result, NewString("foo"));
   EXPECT_VALID(Dart_IntegerToInt64(foo, &int_value));
@@ -4902,9 +4825,9 @@
   // Allocate object and invoke the unnamed constructor with an empty string.
   obj = Dart_Allocate(type);
   EXPECT_VALID(obj);
-  instanceof = false;
-  EXPECT_VALID(Dart_ObjectIsType(obj, type, &instanceof));
-  EXPECT(instanceof);
+  instanceOf = false;
+  EXPECT_VALID(Dart_ObjectIsType(obj, type, &instanceOf));
+  EXPECT(instanceOf);
   // Use the empty string to invoke the unnamed constructor.
   result = Dart_InvokeConstructor(obj, Dart_EmptyString(), 0, NULL);
   EXPECT_VALID(result);
@@ -4923,8 +4846,8 @@
   // Invoke a named constructor.
   result = Dart_New(type, NewString("named"), 1, args);
   EXPECT_VALID(result);
-  EXPECT_VALID(Dart_ObjectIsType(result, type, &instanceof));
-  EXPECT(instanceof);
+  EXPECT_VALID(Dart_ObjectIsType(result, type, &instanceOf));
+  EXPECT(instanceOf);
   int_value = 0;
   foo = Dart_GetField(result, NewString("foo"));
   EXPECT_VALID(Dart_IntegerToInt64(foo, &int_value));
@@ -4933,9 +4856,9 @@
   // Allocate object and invoke a named constructor.
   obj = Dart_Allocate(type);
   EXPECT_VALID(obj);
-  instanceof = false;
-  EXPECT_VALID(Dart_ObjectIsType(obj, type, &instanceof));
-  EXPECT(instanceof);
+  instanceOf = false;
+  EXPECT_VALID(Dart_ObjectIsType(obj, type, &instanceOf));
+  EXPECT(instanceOf);
   result = Dart_InvokeConstructor(obj, NewString("named"), 1, args);
   EXPECT_VALID(result);
   int_value = 0;
@@ -4946,8 +4869,8 @@
   // Invoke a hidden named constructor.
   result = Dart_New(type, NewString("_hidden"), 1, args);
   EXPECT_VALID(result);
-  EXPECT_VALID(Dart_ObjectIsType(result, type, &instanceof));
-  EXPECT(instanceof);
+  EXPECT_VALID(Dart_ObjectIsType(result, type, &instanceOf));
+  EXPECT(instanceOf);
   int_value = 0;
   foo = Dart_GetField(result, NewString("foo"));
   EXPECT_VALID(Dart_IntegerToInt64(foo, &int_value));
@@ -4956,9 +4879,9 @@
   // Allocate object and invoke a hidden named constructor.
   obj = Dart_Allocate(type);
   EXPECT_VALID(obj);
-  instanceof = false;
-  EXPECT_VALID(Dart_ObjectIsType(obj, type, &instanceof));
-  EXPECT(instanceof);
+  instanceOf = false;
+  EXPECT_VALID(Dart_ObjectIsType(obj, type, &instanceOf));
+  EXPECT(instanceOf);
   result = Dart_InvokeConstructor(obj, NewString("_hidden"), 1, args);
   EXPECT_VALID(result);
   int_value = 0;
@@ -4969,17 +4892,17 @@
   // Allocate object and Invoke a constructor which throws an exception.
   obj = Dart_Allocate(type);
   EXPECT_VALID(obj);
-  instanceof = false;
-  EXPECT_VALID(Dart_ObjectIsType(obj, type, &instanceof));
-  EXPECT(instanceof);
+  instanceOf = false;
+  EXPECT_VALID(Dart_ObjectIsType(obj, type, &instanceOf));
+  EXPECT(instanceOf);
   result = Dart_InvokeConstructor(obj, NewString("exception"), 1, args);
   EXPECT_ERROR(result, "ConstructorDeath");
 
   // Invoke a factory constructor.
   result = Dart_New(type, NewString("multiply"), 1, args);
   EXPECT_VALID(result);
-  EXPECT_VALID(Dart_ObjectIsType(result, type, &instanceof));
-  EXPECT(instanceof);
+  EXPECT_VALID(Dart_ObjectIsType(result, type, &instanceOf));
+  EXPECT(instanceOf);
   int_value = 0;
   foo = Dart_GetField(result, NewString("foo"));
   EXPECT_VALID(Dart_IntegerToInt64(foo, &int_value));
@@ -5033,8 +4956,8 @@
   // Invoke two-hop redirecting factory constructor.
   result = Dart_New(intf, NewString("named"), 1, args);
   EXPECT_VALID(result);
-  EXPECT_VALID(Dart_ObjectIsType(result, type, &instanceof));
-  EXPECT(instanceof);
+  EXPECT_VALID(Dart_ObjectIsType(result, type, &instanceOf));
+  EXPECT(instanceOf);
   int_value = 0;
   foo = Dart_GetField(result, NewString("foo"));
   EXPECT_VALID(Dart_IntegerToInt64(foo, &int_value));
@@ -5043,8 +4966,8 @@
   // Invoke one-hop redirecting factory constructor.
   result = Dart_New(intf, NewString("multiply"), 1, args);
   EXPECT_VALID(result);
-  EXPECT_VALID(Dart_ObjectIsType(result, type, &instanceof));
-  EXPECT(instanceof);
+  EXPECT_VALID(Dart_ObjectIsType(result, type, &instanceOf));
+  EXPECT(instanceOf);
   int_value = 0;
   foo = Dart_GetField(result, NewString("foo"));
   EXPECT_VALID(Dart_IntegerToInt64(foo, &int_value));
@@ -5052,14 +4975,13 @@
 
   // Invoke a constructor that is missing in the interface.
   result = Dart_New(intf, Dart_Null(), 0, NULL);
-  EXPECT_ERROR(result,
-               "Dart_New: could not find constructor 'MyInterface.'.");
+  EXPECT_ERROR(result, "Dart_New: could not find constructor 'MyInterface.'.");
 
   // Invoke abstract constructor that is present in the interface.
   result = Dart_New(intf, NewString("notfound"), 1, args);
   EXPECT_VALID(result);
-  EXPECT_VALID(Dart_ObjectIsType(result, type, &instanceof));
-  EXPECT(!instanceof);
+  EXPECT_VALID(Dart_ObjectIsType(result, type, &instanceOf));
+  EXPECT(!instanceOf);
 }
 
 
@@ -5237,8 +5159,7 @@
 
 
 TEST_CASE(Invoke_FunnyArgs) {
-  const char* kScriptChars =
-      "test(arg) => 'hello $arg';\n";
+  const char* kScriptChars = "test(arg) => 'hello $arg';\n";
 
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
   Dart_Handle func_name = NewString("test");
@@ -5260,8 +5181,7 @@
   EXPECT_STREQ("hello null", str);
 
   // Pass an error handle as the target.  The error is propagated.
-  result = Dart_Invoke(Api::NewError("myerror"),
-                       func_name, 1, args);
+  result = Dart_Invoke(Api::NewError("myerror"), func_name, 1, args);
   EXPECT(Dart_IsError(result));
   EXPECT_STREQ("myerror", Dart_GetError(result));
 
@@ -5286,10 +5206,7 @@
 
 
 TEST_CASE(Invoke_Null) {
-  Dart_Handle result = Dart_Invoke(Dart_Null(),
-                                   NewString("toString"),
-                                   0,
-                                   NULL);
+  Dart_Handle result = Dart_Invoke(Dart_Null(), NewString("toString"), 0, NULL);
   EXPECT_VALID(result);
   EXPECT(Dart_IsString(result));
 
@@ -5298,10 +5215,7 @@
   EXPECT_STREQ("null", value);
 
   Dart_Handle function_name = NewString("NoNoNo");
-  result = Dart_Invoke(Dart_Null(),
-                       function_name,
-                       0,
-                       NULL);
+  result = Dart_Invoke(Dart_Null(), function_name, 0, NULL);
   EXPECT(Dart_IsError(result));
   EXPECT(Dart_ErrorHasException(result));
 }
@@ -5495,16 +5409,14 @@
 
 
 TEST_CASE(ThrowException) {
-  const char* kScriptChars =
-      "int test() native \"ThrowException_native\";";
+  const char* kScriptChars = "int test() native \"ThrowException_native\";";
   Dart_Handle result;
   intptr_t size = thread->ZoneSizeInBytes();
   Dart_EnterScope();  // Start a Dart API scope for invoking API functions.
 
   // Load up a test script which extends the native wrapper class.
   Dart_Handle lib = TestCase::LoadTestScript(
-      kScriptChars,
-      reinterpret_cast<Dart_NativeEntryResolver>(native_lookup));
+      kScriptChars, reinterpret_cast<Dart_NativeEntryResolver>(native_lookup));
 
   // Throwing an exception here should result in an error.
   result = Dart_ThrowException(NewString("This doesn't work"));
@@ -5531,14 +5443,11 @@
 
   // Allocate without a constructor.
   const int num_native_fields = 2;
-  const intptr_t native_fields[] = {
-    kNativeArgumentNativeField1Value,
-    kNativeArgumentNativeField2Value
-  };
+  const intptr_t native_fields[] = {kNativeArgumentNativeField1Value,
+                                    kNativeArgumentNativeField2Value};
   // Allocate and Setup native fields.
-  Dart_Handle obj = Dart_AllocateWithNativeFields(type,
-                                                  num_native_fields,
-                                                  native_fields);
+  Dart_Handle obj =
+      Dart_AllocateWithNativeFields(type, num_native_fields, native_fields);
   EXPECT_VALID(obj);
 
   kNativeArgumentNativeField1Value *= 2;
@@ -5556,25 +5465,23 @@
     intptr_t native_fields1[kNumNativeFields];
     intptr_t native_fields2[kNumNativeFields];
     const Dart_NativeArgument_Descriptor arg_descriptors[9] = {
-      { Dart_NativeArgument_kNativeFields, 0 },
-      { Dart_NativeArgument_kInt32, 1 },
-      { Dart_NativeArgument_kUint64, 2 },
-      { Dart_NativeArgument_kBool, 3 },
-      { Dart_NativeArgument_kDouble, 4 },
-      { Dart_NativeArgument_kString, 5 },
-      { Dart_NativeArgument_kString, 6 },
-      { Dart_NativeArgument_kNativeFields, 7 },
-      { Dart_NativeArgument_kInstance, 7 },
+        {Dart_NativeArgument_kNativeFields, 0},
+        {Dart_NativeArgument_kInt32, 1},
+        {Dart_NativeArgument_kUint64, 2},
+        {Dart_NativeArgument_kBool, 3},
+        {Dart_NativeArgument_kDouble, 4},
+        {Dart_NativeArgument_kString, 5},
+        {Dart_NativeArgument_kString, 6},
+        {Dart_NativeArgument_kNativeFields, 7},
+        {Dart_NativeArgument_kInstance, 7},
     };
     Dart_NativeArgument_Value arg_values[9];
     arg_values[0].as_native_fields.num_fields = kNumNativeFields;
     arg_values[0].as_native_fields.values = native_fields1;
     arg_values[7].as_native_fields.num_fields = kNumNativeFields;
     arg_values[7].as_native_fields.values = native_fields2;
-    Dart_Handle result = Dart_GetNativeArguments(args,
-                                                 9,
-                                                 arg_descriptors,
-                                                 arg_values);
+    Dart_Handle result =
+        Dart_GetNativeArguments(args, 9, arg_descriptors, arg_values);
     EXPECT_VALID(result);
 
     EXPECT(arg_values[0].as_native_fields.values[0] == 30);
@@ -5604,48 +5511,44 @@
     EXPECT_VALID(arg_values[8].as_instance);
     EXPECT(Dart_IsInstance(arg_values[8].as_instance));
     int field_count = 0;
-    EXPECT_VALID(Dart_GetNativeInstanceFieldCount(
-        arg_values[8].as_instance, &field_count));
+    EXPECT_VALID(Dart_GetNativeInstanceFieldCount(arg_values[8].as_instance,
+                                                  &field_count));
     EXPECT(field_count == 2);
   }
 
   // Test with an invalid descriptor set (invalid type).
   {
     const Dart_NativeArgument_Descriptor arg_descriptors[8] = {
-      { Dart_NativeArgument_kInt32, 1 },
-      { Dart_NativeArgument_kUint64, 2 },
-      { Dart_NativeArgument_kString, 3 },
-      { Dart_NativeArgument_kDouble, 4 },
-      { Dart_NativeArgument_kString, 5 },
-      { Dart_NativeArgument_kString, 6 },
-      { Dart_NativeArgument_kNativeFields, 0 },
-      { Dart_NativeArgument_kNativeFields, 7 },
+        {Dart_NativeArgument_kInt32, 1},
+        {Dart_NativeArgument_kUint64, 2},
+        {Dart_NativeArgument_kString, 3},
+        {Dart_NativeArgument_kDouble, 4},
+        {Dart_NativeArgument_kString, 5},
+        {Dart_NativeArgument_kString, 6},
+        {Dart_NativeArgument_kNativeFields, 0},
+        {Dart_NativeArgument_kNativeFields, 7},
     };
     Dart_NativeArgument_Value arg_values[8];
-    Dart_Handle result = Dart_GetNativeArguments(args,
-                                                 8,
-                                                 arg_descriptors,
-                                                 arg_values);
+    Dart_Handle result =
+        Dart_GetNativeArguments(args, 8, arg_descriptors, arg_values);
     EXPECT(Dart_IsError(result));
   }
 
   // Test with an invalid range error.
   {
     const Dart_NativeArgument_Descriptor arg_descriptors[8] = {
-      { Dart_NativeArgument_kInt32, 2 },
-      { Dart_NativeArgument_kUint64, 2 },
-      { Dart_NativeArgument_kBool, 3 },
-      { Dart_NativeArgument_kDouble, 4 },
-      { Dart_NativeArgument_kString, 5 },
-      { Dart_NativeArgument_kString, 6 },
-      { Dart_NativeArgument_kNativeFields, 0 },
-      { Dart_NativeArgument_kNativeFields, 7 },
+        {Dart_NativeArgument_kInt32, 2},
+        {Dart_NativeArgument_kUint64, 2},
+        {Dart_NativeArgument_kBool, 3},
+        {Dart_NativeArgument_kDouble, 4},
+        {Dart_NativeArgument_kString, 5},
+        {Dart_NativeArgument_kString, 6},
+        {Dart_NativeArgument_kNativeFields, 0},
+        {Dart_NativeArgument_kNativeFields, 7},
     };
     Dart_NativeArgument_Value arg_values[8];
-    Dart_Handle result = Dart_GetNativeArguments(args,
-                                                 8,
-                                                 arg_descriptors,
-                                                 arg_values);
+    Dart_Handle result =
+        Dart_GetNativeArguments(args, 8, arg_descriptors, arg_values);
     EXPECT(Dart_IsError(result));
   }
 
@@ -5712,11 +5615,8 @@
   EXPECT_VALID(Dart_StringStorageSize(ascii_str, &size));
   uint8_t ext_ascii_str[10];
   Dart_Handle extstr = Dart_MakeExternalString(
-      ascii_str,
-      ext_ascii_str,
-      size,
-      reinterpret_cast<void*>(&native_arg_str_peer),
-      NULL);
+      ascii_str, ext_ascii_str, size,
+      reinterpret_cast<void*>(&native_arg_str_peer), NULL);
 
   Dart_Handle args[1];
   args[0] = extstr;
@@ -5756,8 +5656,7 @@
       "}";
 
   Dart_Handle lib = TestCase::LoadTestScript(
-      kScriptChars,
-      reinterpret_cast<Dart_NativeEntryResolver>(gnac_lookup));
+      kScriptChars, reinterpret_cast<Dart_NativeEntryResolver>(gnac_lookup));
 
   Dart_Handle result = Dart_Invoke(lib, NewString("testMain"), 0, NULL);
   EXPECT_VALID(result);
@@ -5859,8 +5758,7 @@
   EXPECT(!is_instance);
 
   // Check that primitives are not instances of InstanceOfTest class.
-  result = Dart_ObjectIsType(NewString("a string"), otherType,
-                             &is_instance);
+  result = Dart_ObjectIsType(NewString("a string"), otherType, &is_instance);
   EXPECT_VALID(result);
   EXPECT(!is_instance);
 
@@ -5873,10 +5771,7 @@
   EXPECT(!is_instance);
 
   // Check that null is not an instance of InstanceOfTest class.
-  Dart_Handle null = Dart_Invoke(otherType,
-                                 NewString("returnNull"),
-                                 0,
-                                 NULL);
+  Dart_Handle null = Dart_Invoke(otherType, NewString("returnNull"), 0, NULL);
   EXPECT_VALID(null);
 
   result = Dart_ObjectIsType(null, otherType, &is_instance);
@@ -5966,9 +5861,10 @@
   // Further calls to LoadScript are errors.
   result = Dart_LoadScript(url, Dart_Null(), source, 0, 0);
   EXPECT(Dart_IsError(result));
-  EXPECT_STREQ("Dart_LoadScript: "
-               "A script has already been loaded from 'test-lib'.",
-               Dart_GetError(result));
+  EXPECT_STREQ(
+      "Dart_LoadScript: "
+      "A script has already been loaded from 'test-lib'.",
+      Dart_GetError(result));
 }
 
 
@@ -6068,8 +5964,7 @@
 
 
 TEST_CASE(LoadScript_CompileError) {
-  const char* kScriptChars =
-      ")";
+  const char* kScriptChars = ")";
   Dart_Handle url = NewString(TestCase::url());
   Dart_Handle source = NewString(kScriptChars);
   Dart_Handle result = Dart_SetLibraryTagHandler(import_library_handler);
@@ -6128,8 +6023,7 @@
 
 
 TEST_CASE(LibraryName) {
-  const char* kLibrary1Chars =
-      "library library1_name;";
+  const char* kLibrary1Chars = "library library1_name;";
   Dart_Handle url = NewString("library1_url");
   Dart_Handle source = NewString(kLibrary1Chars);
   Dart_Handle lib = Dart_LoadLibrary(url, Dart_Null(), source, 0, 0);
@@ -6164,8 +6058,7 @@
 
 
 TEST_CASE(LibraryId) {
-  const char* kLibrary1Chars =
-      "library library1_name;";
+  const char* kLibrary1Chars = "library library1_name;";
   Dart_Handle url = NewString("library1_url");
   Dart_Handle source = NewString(kLibrary1Chars);
   Dart_Handle lib = Dart_LoadLibrary(url, Dart_Null(), source, 0, 0);
@@ -6204,8 +6097,7 @@
 
 
 TEST_CASE(LibraryUrl) {
-  const char* kLibrary1Chars =
-      "library library1_name;";
+  const char* kLibrary1Chars = "library library1_name;";
   Dart_Handle url = NewString("library1_url");
   Dart_Handle source = NewString(kLibrary1Chars);
   Dart_Handle lib = Dart_LoadLibrary(url, Dart_Null(), source, 0, 0);
@@ -6348,10 +6240,8 @@
 
 
 TEST_CASE(LibraryImportLibrary) {
-  const char* kLibrary1Chars =
-      "library library1_name;";
-  const char* kLibrary2Chars =
-      "library library2_name;";
+  const char* kLibrary1Chars = "library library1_name;";
+  const char* kLibrary2Chars = "library library2_name;";
   Dart_Handle error = Dart_NewApiError("incoming error");
   Dart_Handle result;
 
@@ -6373,9 +6263,10 @@
 
   result = Dart_LibraryImportLibrary(Dart_True(), lib2, Dart_Null());
   EXPECT(Dart_IsError(result));
-  EXPECT_STREQ("Dart_LibraryImportLibrary expects argument 'library' to be of "
-               "type Library.",
-               Dart_GetError(result));
+  EXPECT_STREQ(
+      "Dart_LibraryImportLibrary expects argument 'library' to be of "
+      "type Library.",
+      Dart_GetError(result));
 
   result = Dart_LibraryImportLibrary(error, lib2, Dart_Null());
   EXPECT(Dart_IsError(result));
@@ -6389,9 +6280,10 @@
 
   result = Dart_LibraryImportLibrary(lib1, Dart_True(), Dart_Null());
   EXPECT(Dart_IsError(result));
-  EXPECT_STREQ("Dart_LibraryImportLibrary expects argument 'import' to be of "
-               "type Library.",
-               Dart_GetError(result));
+  EXPECT_STREQ(
+      "Dart_LibraryImportLibrary expects argument 'import' to be of "
+      "type Library.",
+      Dart_GetError(result));
 
   result = Dart_LibraryImportLibrary(lib1, error, Dart_Null());
   EXPECT(Dart_IsError(result));
@@ -6444,10 +6336,8 @@
 }
 
 
-
 TEST_CASE(LoadLibrary) {
-  const char* kLibrary1Chars =
-      "library library1_name;";
+  const char* kLibrary1Chars = "library library1_name;";
   Dart_Handle error = Dart_NewApiError("incoming error");
   Dart_Handle result;
 
@@ -6520,12 +6410,9 @@
 
 
 TEST_CASE(LoadSource) {
-  const char* kLibrary1Chars =
-      "library library1_name;";
-  const char* kSourceChars =
-      "part of library1_name;\n// Something innocuous";
-  const char* kBadSourceChars =
-      ")";
+  const char* kLibrary1Chars = "library library1_name;";
+  const char* kSourceChars = "part of library1_name;\n// Something innocuous";
+  const char* kBadSourceChars = ")";
   Dart_Handle error = Dart_NewApiError("incoming error");
   Dart_Handle result;
 
@@ -6663,13 +6550,11 @@
 
 
 TEST_CASE(LoadPatch) {
-  const char* kLibrary1Chars =
-      "library library1_name;";
+  const char* kLibrary1Chars = "library library1_name;";
   const char* kSourceChars =
       "part of library1_name;\n"
       "external int foo();";
-  const char* kPatchChars =
-      "@patch int foo() => 42;";
+  const char* kPatchChars = "@patch int foo() => 42;";
 
   // Load up a library.
   Dart_Handle url = NewString("library1_url");
@@ -6704,18 +6589,17 @@
   // This tests the sort of APIs with intentional signature mismatches we need
   // for typed Dart-JavaScript interop where we emulated JavaScript semantics
   // for optional arguments.
-  const char* kLibrary1Chars =
-      "library library1_name;";
+  const char* kLibrary1Chars = "library library1_name;";
   const char* kSourceChars =
       "part of library1_name;\n"
       "external int foo([int x]);\n"
-      "class Foo {\n"
+      "class Foo<T extends Foo> {\n"
       "  external static int addDefault10([int x, int y]);\n"
       "}";
   const char* kPatchChars =
       "const _UNDEFINED = const Object();\n"
       "@patch foo([x=_UNDEFINED]) => identical(x, _UNDEFINED) ? 42 : x;\n"
-      "@patch class Foo {\n"
+      "@patch class Foo<T> {\n"
       "  static addDefault10([x=_UNDEFINED, y=_UNDEFINED]) {\n"
       "    if (identical(x, _UNDEFINED)) x = 10;\n"
       "    if (identical(y, _UNDEFINED)) y = 10;\n"
@@ -6834,84 +6718,80 @@
 
 TEST_CASE(ParsePatchLibrary) {
   const char* kLibraryChars =
-  "library patched_library;\n"
-  "class A {\n"
-  "  final fvalue;\n"
-  "  var _f;\n"
-  "  callFunc(x, y) => x(y);\n"
-  "  external void method(var value);\n"
-  "  get field => _field;\n"
-  "}\n"
-  "class B {\n"
-  "  var val;\n"
-  "  external B.named(x);\n"
-  "  external B(v);\n"
-  "}\n"
-  "class C {\n"
-  "  external int method();\n"
-  "}\n"
-  "\n"
-  "external int unpatched();\n"
-  "external int topLevel(var value);\n"
-  "external int topLevel2(var value);\n"
-  "external int get topLevelGetter;\n"
-  "external void set topLevelSetter(int value);\n";
+      "library patched_library;\n"
+      "class A {\n"
+      "  final fvalue;\n"
+      "  var _f;\n"
+      "  callFunc(x, y) => x(y);\n"
+      "  external void method(var value);\n"
+      "  get field => _field;\n"
+      "}\n"
+      "class B {\n"
+      "  var val;\n"
+      "  external B.named(x);\n"
+      "  external B(v);\n"
+      "}\n"
+      "class C {\n"
+      "  external int method();\n"
+      "}\n"
+      "\n"
+      "external int unpatched();\n"
+      "external int topLevel(var value);\n"
+      "external int topLevel2(var value);\n"
+      "external int get topLevelGetter;\n"
+      "external void set topLevelSetter(int value);\n";
 
   const char* kPatchChars =
-  "@patch class A {\n"
-  "  var _g;\n"
-  "  A() : fvalue = 13;\n"
-  "  get _field => _g;\n"
-  "  @patch void method(var value) {\n"
-  "    int closeYourEyes(var eggs) { return eggs * -1; }\n"
-  "    value = callFunc(closeYourEyes, value);\n"
-  "    _g = value * 5;\n"
-  "  }\n"
-  "}\n"
-  "@patch class B {\n"
-  "  B._internal(x) : val = x;\n"
-  "  @patch factory B.named(x) { return new B._internal(x); }\n"
-  "  @patch factory B(v) native \"const_B_factory\";\n"
-  "}\n"
-  "var _topLevelValue = -1;\n"
-  "@patch int topLevel(var value) => value * value;\n"
-  "@patch int set topLevelSetter(value) { _topLevelValue = value; }\n"
-  "@patch int get topLevelGetter => 2 * _topLevelValue;\n"
-  // Allow top level methods named patch.
-  "patch(x) => x*3;\n"
-  ;  // NOLINT
+      "@patch class A {\n"
+      "  var _g;\n"
+      "  A() : fvalue = 13;\n"
+      "  get _field => _g;\n"
+      "  @patch void method(var value) {\n"
+      "    int closeYourEyes(var eggs) { return eggs * -1; }\n"
+      "    value = callFunc(closeYourEyes, value);\n"
+      "    _g = value * 5;\n"
+      "  }\n"
+      "}\n"
+      "@patch class B {\n"
+      "  B._internal(x) : val = x;\n"
+      "  @patch factory B.named(x) { return new B._internal(x); }\n"
+      "  @patch factory B(v) native \"const_B_factory\";\n"
+      "}\n"
+      "var _topLevelValue = -1;\n"
+      "@patch int topLevel(var value) => value * value;\n"
+      "@patch int set topLevelSetter(value) { _topLevelValue = value; }\n"
+      "@patch int get topLevelGetter => 2 * _topLevelValue;\n"
+      // Allow top level methods named patch.
+      "patch(x) => x*3;\n";  // NOLINT
 
   const char* kPatchClassOnlyChars =
-  "@patch class C {\n"
-  "  @patch int method() {\n"
-  "    return 42;\n"
-  "  }\n"
-  "}\n"
-  ;  // NOLINT
+      "@patch class C {\n"
+      "  @patch int method() {\n"
+      "    return 42;\n"
+      "  }\n"
+      "}\n";  // NOLINT
 
-  const char* kPatchNoClassChars =
-  "@patch topLevel2(x) => x * 2;\n";
+  const char* kPatchNoClassChars = "@patch topLevel2(x) => x * 2;\n";
 
   const char* kScriptChars =
-  "import 'theLibrary';\n"
-  "e1() => unpatched();\n"
-  "m1() => topLevel(2);\n"
-  "m2() {\n"
-  "  topLevelSetter = 20;\n"
-  "  return topLevelGetter;\n"
-  "}\n"
-  "m3() => patch(7);\n"
-  "m4() {\n"
-  "  var a = new A();\n"
-  "  a.method(5);\n"
-  "  return a.field;\n"
-  "}\n"
-  "m5() => new B(3);\n"
-  "m6() {\n"
-  "  var b = new B.named(8);\n"
-  "  return b.val;\n"
-  "}\n"
-  ;  // NOLINT
+      "import 'theLibrary';\n"
+      "e1() => unpatched();\n"
+      "m1() => topLevel(2);\n"
+      "m2() {\n"
+      "  topLevelSetter = 20;\n"
+      "  return topLevelGetter;\n"
+      "}\n"
+      "m3() => patch(7);\n"
+      "m4() {\n"
+      "  var a = new A();\n"
+      "  a.method(5);\n"
+      "  return a.field;\n"
+      "}\n"
+      "m5() => new B(3);\n"
+      "m6() {\n"
+      "  var b = new B.named(8);\n"
+      "  return b.val;\n"
+      "}\n";  // NOLINT
 
   bin::Builtin::SetNativeResolver(bin::Builtin::kBuiltinLibrary);
   bin::Builtin::SetNativeResolver(bin::Builtin::kIOLibrary);
@@ -6924,12 +6804,10 @@
   result = Dart_LoadLibrary(url, Dart_Null(), source, 0, 0);
   EXPECT_VALID(result);
 
-  const char* patchNames[] = { "main library patch",
-                               "patch class only",
-                               "patch no class" };
-  const char* patches[] = { kPatchChars,
-                            kPatchClassOnlyChars,
-                            kPatchNoClassChars };
+  const char* patchNames[] = {"main library patch", "patch class only",
+                              "patch no class"};
+  const char* patches[] = {kPatchChars, kPatchClassOnlyChars,
+                           kPatchNoClassChars};
   const String& lib_url = String::Handle(String::New("theLibrary"));
 
   const Library& lib = Library::Handle(Library::LookupLibrary(thread, lib_url));
@@ -6937,8 +6815,8 @@
   for (int i = 0; i < 3; i++) {
     const String& patch_url = String::Handle(String::New(patchNames[i]));
     const String& patch_source = String::Handle(String::New(patches[i]));
-    const Script& patch_script = Script::Handle(Script::New(
-        patch_url, patch_source, RawScript::kPatchTag));
+    const Script& patch_script = Script::Handle(
+        Script::New(patch_url, patch_source, RawScript::kPatchTag));
 
     const Error& err = Error::Handle(lib.Patch(patch_script));
     if (!err.IsNull()) {
@@ -7072,9 +6950,10 @@
 
   result = Dart_SetNativeResolver(Dart_True(), &MyNativeResolver1, NULL);
   EXPECT(Dart_IsError(result));
-  EXPECT_STREQ("Dart_SetNativeResolver expects argument 'library' to be of "
-               "type Library.",
-               Dart_GetError(result));
+  EXPECT_STREQ(
+      "Dart_SetNativeResolver expects argument 'library' to be of "
+      "type Library.",
+      Dart_GetError(result));
 
   result = Dart_SetNativeResolver(error, &MyNativeResolver1, NULL);
   EXPECT(Dart_IsError(result));
@@ -7267,8 +7146,7 @@
 }
 
 
-void NewNativePort_send123(Dart_Port dest_port_id,
-                           Dart_CObject *message) {
+void NewNativePort_send123(Dart_Port dest_port_id, Dart_CObject* message) {
   // Gets a send port message.
   EXPECT_NOTNULL(message);
   EXPECT_EQ(Dart_CObject_kArray, message->type);
@@ -7279,13 +7157,12 @@
       reinterpret_cast<Dart_CObject*>(Dart_ScopeAllocate(sizeof(Dart_CObject)));
   response->type = Dart_CObject_kInt32;
   response->value.as_int32 = 123;
-  Dart_PostCObject(
-      message->value.as_array.values[0]->value.as_send_port.id, response);
+  Dart_PostCObject(message->value.as_array.values[0]->value.as_send_port.id,
+                   response);
 }
 
 
-void NewNativePort_send321(Dart_Port dest_port_id,
-                           Dart_CObject* message) {
+void NewNativePort_send321(Dart_Port dest_port_id, Dart_CObject* message) {
   // Gets a null message.
   EXPECT_NOTNULL(message);
   EXPECT_EQ(Dart_CObject_kArray, message->type);
@@ -7296,8 +7173,8 @@
       reinterpret_cast<Dart_CObject*>(Dart_ScopeAllocate(sizeof(Dart_CObject)));
   response->type = Dart_CObject_kInt32;
   response->value.as_int32 = 321;
-  Dart_PostCObject(
-      message->value.as_array.values[0]->value.as_send_port.id, response);
+  Dart_PostCObject(message->value.as_array.values[0]->value.as_send_port.id,
+                   response);
 }
 
 
@@ -7351,8 +7228,7 @@
   // Test first port.
   Dart_Handle dart_args[1];
   dart_args[0] = send_port1;
-  Dart_Handle result =
-      Dart_Invoke(lib, NewString("callPort"), 1, dart_args);
+  Dart_Handle result = Dart_Invoke(lib, NewString("callPort"), 1, dart_args);
   EXPECT_VALID(result);
   result = Dart_RunLoop();
   EXPECT(Dart_IsError(result));
@@ -7377,15 +7253,15 @@
 
 
 void NewNativePort_sendInteger123(Dart_Port dest_port_id,
-                                  Dart_CObject *message) {
+                                  Dart_CObject* message) {
   // Gets a send port message.
   EXPECT_NOTNULL(message);
   EXPECT_EQ(Dart_CObject_kArray, message->type);
   EXPECT_EQ(Dart_CObject_kSendPort, message->value.as_array.values[0]->type);
 
   // Post integer value.
-  Dart_PostInteger(
-      message->value.as_array.values[0]->value.as_send_port.id, 123);
+  Dart_PostInteger(message->value.as_array.values[0]->value.as_send_port.id,
+                   123);
 }
 
 
@@ -7397,8 +7273,8 @@
   EXPECT_EQ(Dart_CObject_kSendPort, message->value.as_array.values[0]->type);
 
   // Post integer value.
-  Dart_PostInteger(
-      message->value.as_array.values[0]->value.as_send_port.id, 321);
+  Dart_PostInteger(message->value.as_array.values[0]->value.as_send_port.id,
+                   321);
 }
 
 
@@ -7430,8 +7306,7 @@
   // Test first port.
   Dart_Handle dart_args[1];
   dart_args[0] = send_port1;
-  Dart_Handle result =
-      Dart_Invoke(lib, NewString("callPort"), 1, dart_args);
+  Dart_Handle result = Dart_Invoke(lib, NewString("callPort"), 1, dart_args);
   EXPECT_VALID(result);
   result = Dart_RunLoop();
   EXPECT(Dart_IsError(result));
@@ -7456,14 +7331,14 @@
 
 
 void NewNativePort_nativeReceiveNull(Dart_Port dest_port_id,
-                                     Dart_CObject *message) {
+                                     Dart_CObject* message) {
   EXPECT_NOTNULL(message);
 
   if ((message->type == Dart_CObject_kArray) &&
       (message->value.as_array.values[0]->type == Dart_CObject_kSendPort)) {
     // Post integer value.
-    Dart_PostInteger(
-        message->value.as_array.values[0]->value.as_send_port.id, 123);
+    Dart_PostInteger(message->value.as_array.values[0]->value.as_send_port.id,
+                     123);
   } else {
     EXPECT_EQ(message->type, Dart_CObject_kNull);
   }
@@ -7494,8 +7369,7 @@
   // Test first port.
   Dart_Handle dart_args[1];
   dart_args[0] = send_port1;
-  Dart_Handle result =
-      Dart_Invoke(lib, NewString("callPort"), 1, dart_args);
+  Dart_Handle result = Dart_Invoke(lib, NewString("callPort"), 1, dart_args);
   EXPECT_VALID(result);
   result = Dart_RunLoop();
   EXPECT(Dart_IsError(result));
@@ -7510,14 +7384,14 @@
 
 
 void NewNativePort_nativeReceiveInteger(Dart_Port dest_port_id,
-                                        Dart_CObject *message) {
+                                        Dart_CObject* message) {
   EXPECT_NOTNULL(message);
 
   if ((message->type == Dart_CObject_kArray) &&
       (message->value.as_array.values[0]->type == Dart_CObject_kSendPort)) {
     // Post integer value.
-    Dart_PostInteger(
-        message->value.as_array.values[0]->value.as_send_port.id, 123);
+    Dart_PostInteger(message->value.as_array.values[0]->value.as_send_port.id,
+                     123);
   } else {
     EXPECT_EQ(message->type, Dart_CObject_kInt32);
     EXPECT_EQ(message->value.as_int32, 321);
@@ -7549,8 +7423,7 @@
   // Test first port.
   Dart_Handle dart_args[1];
   dart_args[0] = send_port1;
-  Dart_Handle result =
-      Dart_Invoke(lib, NewString("callPort"), 1, dart_args);
+  Dart_Handle result = Dart_Invoke(lib, NewString("callPort"), 1, dart_args);
   EXPECT_VALID(result);
   result = Dart_RunLoop();
   EXPECT(Dart_IsError(result));
@@ -7614,8 +7487,8 @@
 static void RunLoopTest(bool throw_exception) {
   Dart_IsolateCreateCallback saved = Isolate::CreateCallback();
   Isolate::SetCreateCallback(RunLoopTestCallback);
-  Dart_Isolate isolate = RunLoopTestCallback(
-      NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+  Dart_Isolate isolate =
+      RunLoopTestCallback(NULL, NULL, NULL, NULL, NULL, NULL, NULL);
 
   Dart_EnterIsolate(isolate);
   Dart_EnterScope();
@@ -7671,7 +7544,9 @@
 
 
 static Dart_NativeFunction IsolateInterruptTestNativeLookup(
-    Dart_Handle name, int argument_count, bool* auto_setup_scope) {
+    Dart_Handle name,
+    int argument_count,
+    bool* auto_setup_scope) {
   ASSERT(auto_setup_scope != NULL);
   *auto_setup_scope = false;
   return reinterpret_cast<Dart_NativeFunction>(&MarkMainEntered);
@@ -7695,10 +7570,8 @@
   {
     MonitorLocker ml(sync);
     char* error = NULL;
-    shared_isolate = Dart_CreateIsolate(NULL, NULL,
-                                        bin::isolate_snapshot_buffer,
-                                        NULL,
-                                        NULL, &error);
+    shared_isolate = Dart_CreateIsolate(
+        NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL, &error);
     EXPECT(shared_isolate != NULL);
     Dart_EnterScope();
     Dart_Handle url = NewString(TestCase::url());
@@ -7719,8 +7592,7 @@
   Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
   EXPECT(Dart_IsError(result));
   EXPECT(Dart_ErrorHasException(result));
-  EXPECT_SUBSTRING("Unhandled exception:\nfoo\n",
-                   Dart_GetError(result));
+  EXPECT_SUBSTRING("Unhandled exception:\nfoo\n", Dart_GetError(result));
 
   Dart_ExitScope();
   Dart_ShutdownIsolate();
@@ -7749,10 +7621,8 @@
 
   // Create an isolate.
   char* err;
-  Dart_Isolate isolate = Dart_CreateIsolate(NULL, NULL,
-                                            bin::isolate_snapshot_buffer,
-                                            NULL,
-                                            my_data, &err);
+  Dart_Isolate isolate = Dart_CreateIsolate(
+      NULL, NULL, bin::isolate_snapshot_buffer, NULL, my_data, &err);
   if (isolate == NULL) {
     OS::Print("Creation of isolate failed '%s'\n", err);
     free(err);
@@ -7780,7 +7650,7 @@
   EXPECT_VALID(arg1);
   Dart_Handle arg2 = Dart_NewInteger(9);
   EXPECT_VALID(arg2);
-  Dart_Handle dart_args[2] = { arg1, arg2 };
+  Dart_Handle dart_args[2] = {arg1, arg2};
   Dart_Handle result = Dart_Invoke(lib, NewString("add"), 2, dart_args);
   EXPECT_VALID(result);
   result = Dart_IntegerToInt64(result, &add_result);
@@ -7800,10 +7670,8 @@
 
   // Create an isolate.
   char* err;
-  Dart_Isolate isolate = Dart_CreateIsolate(NULL, NULL,
-                                            bin::isolate_snapshot_buffer,
-                                            NULL,
-                                            NULL, &err);
+  Dart_Isolate isolate = Dart_CreateIsolate(
+      NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL, &err);
   if (isolate == NULL) {
     OS::Print("Creation of isolate failed '%s'\n", err);
     free(err);
@@ -7868,9 +7736,7 @@
   int64_t value = 0;
   EXPECT_VALID(Dart_IntegerToInt64(arg1, &value));
   int64_t integer_value = 0;
-  Dart_Handle result = Dart_GetNativeIntegerArgument(args,
-                                                     1,
-                                                     &integer_value);
+  Dart_Handle result = Dart_GetNativeIntegerArgument(args, 1, &integer_value);
   EXPECT_VALID(result);
   EXPECT_EQ(value, integer_value);
   double double_value;
@@ -7902,9 +7768,8 @@
   Dart_Handle arg1 = Dart_GetNativeArgument(args, 1);
   Dart_Handle arg2 = Dart_GetNativeArgument(args, 2);
   Dart_Handle arg3 = Dart_GetNativeArgument(args, 3);
-  Dart_SetReturnValue(args, Dart_NewInteger(GetValue(arg1) +
-                                            GetValue(arg2) +
-                                            GetValue(arg3)));
+  Dart_SetReturnValue(
+      args, Dart_NewInteger(GetValue(arg1) + GetValue(arg2) + GetValue(arg3)));
   Dart_ExitScope();
 }
 
@@ -8051,15 +7916,16 @@
   Dart_Handle arg1 = Dart_GetNativeArgument(args, 0);
   Dart_Handle arg2 = Dart_GetNativeArgument(args, 1);
   Dart_Handle arg3 = Dart_GetNativeArgument(args, 2);
-  Dart_SetReturnValue(args, Dart_NewInteger(GetValue(arg1) +
-                                            GetValue(arg2) +
-                                            GetValue(arg3)));
+  Dart_SetReturnValue(
+      args, Dart_NewInteger(GetValue(arg1) + GetValue(arg2) + GetValue(arg3)));
   Dart_ExitScope();
 }
 
 
 static Dart_NativeFunction MyStaticNativeClosureResolver(
-    Dart_Handle name, int arg_count, bool* auto_setup_scope) {
+    Dart_Handle name,
+    int arg_count,
+    bool* auto_setup_scope) {
   ASSERT(auto_setup_scope != NULL);
   *auto_setup_scope = false;
   const Object& obj = Object::Handle(Api::UnwrapHandle(name));
@@ -8092,9 +7958,9 @@
       "  static int foo1() native \"StaticNativeFoo1\";\n"
       "  static int foo2(int i) native \"StaticNativeFoo2\";\n"
       "  static int foo3([int k = 10000, int l = 1])"
-            " native \"StaticNativeFoo3\";\n"
+      " native \"StaticNativeFoo3\";\n"
       "  static int foo4(int i, [int j = 10, int k = 1])"
-            " native \"StaticNativeFoo4\";\n"
+      " native \"StaticNativeFoo4\";\n"
       "  int bar1() { var func = foo1; return func(); }\n"
       "  int bar2(int i) { var func = foo2; return func(i); }\n"
       "  int bar30() { var func = foo3; return func(); }\n"
@@ -8170,20 +8036,22 @@
 
   EXPECT_ERROR(Dart_NewList(-1),
                "expects argument 'length' to be in the range");
-  EXPECT_ERROR(Dart_NewList(Array::kMaxElements+1),
+  EXPECT_ERROR(Dart_NewList(Array::kMaxElements + 1),
                "expects argument 'length' to be in the range");
   EXPECT_ERROR(Dart_NewStringFromUTF8(chars8, -1),
                "expects argument 'length' to be in the range");
-  EXPECT_ERROR(Dart_NewStringFromUTF8(chars8, OneByteString::kMaxElements+1),
+  EXPECT_ERROR(Dart_NewStringFromUTF8(chars8, OneByteString::kMaxElements + 1),
                "expects argument 'length' to be in the range");
   EXPECT_ERROR(Dart_NewStringFromUTF16(chars16, -1),
                "expects argument 'length' to be in the range");
-  EXPECT_ERROR(Dart_NewStringFromUTF16(chars16, TwoByteString::kMaxElements+1),
-               "expects argument 'length' to be in the range");
+  EXPECT_ERROR(
+      Dart_NewStringFromUTF16(chars16, TwoByteString::kMaxElements + 1),
+      "expects argument 'length' to be in the range");
   EXPECT_ERROR(Dart_NewStringFromUTF32(chars32, -1),
                "expects argument 'length' to be in the range");
-  EXPECT_ERROR(Dart_NewStringFromUTF32(chars32, TwoByteString::kMaxElements+1),
-               "expects argument 'length' to be in the range");
+  EXPECT_ERROR(
+      Dart_NewStringFromUTF32(chars32, TwoByteString::kMaxElements + 1),
+      "expects argument 'length' to be in the range");
 }
 
 
@@ -8649,39 +8517,26 @@
     Dart_EnterScope();
 
     // First test some negative conditions.
-    uint8_t data8[] = { 'h', 'e', 'l', 'l', 'o' };
+    uint8_t data8[] = {'h', 'e', 'l', 'l', 'o'};
     const char* err = "string";
     Dart_Handle err_str = NewString(err);
-    Dart_Handle ext_err_str = Dart_NewExternalLatin1String(
-        data8, ARRAY_SIZE(data8), NULL, NULL);
-    Dart_Handle result = Dart_MakeExternalString(Dart_Null(),
-                                                 data8,
-                                                 ARRAY_SIZE(data8),
-                                                 NULL,
-                                                 NULL);
+    Dart_Handle ext_err_str =
+        Dart_NewExternalLatin1String(data8, ARRAY_SIZE(data8), NULL, NULL);
+    Dart_Handle result = Dart_MakeExternalString(Dart_Null(), data8,
+                                                 ARRAY_SIZE(data8), NULL, NULL);
     EXPECT(Dart_IsError(result));  // Null string object passed in.
-    result = Dart_MakeExternalString(err_str,
-                                     NULL,
-                                     ARRAY_SIZE(data8),
-                                     NULL,
-                                     NULL);
+    result =
+        Dart_MakeExternalString(err_str, NULL, ARRAY_SIZE(data8), NULL, NULL);
     EXPECT(Dart_IsError(result));  // Null array pointer passed in.
-    result = Dart_MakeExternalString(err_str,
-                                     data8,
-                                     1,
-                                     NULL,
-                                     NULL);
+    result = Dart_MakeExternalString(err_str, data8, 1, NULL, NULL);
     EXPECT(Dart_IsError(result));  // Invalid length passed in.
 
     const intptr_t kLength = 10;
     intptr_t size = 0;
 
     // Test with an external string.
-    result = Dart_MakeExternalString(ext_err_str,
-                                     data8,
-                                     ARRAY_SIZE(data8),
-                                     NULL,
-                                     NULL);
+    result = Dart_MakeExternalString(ext_err_str, data8, ARRAY_SIZE(data8),
+                                     NULL, NULL);
     EXPECT(Dart_IsString(result));
     EXPECT(Dart_IsExternalString(result));
 
@@ -8690,11 +8545,8 @@
     EXPECT(Dart_IsString(empty_str));
     EXPECT(!Dart_IsExternalString(empty_str));
     uint8_t ext_empty_str[kLength];
-    Dart_Handle str = Dart_MakeExternalString(empty_str,
-                                              ext_empty_str,
-                                              kLength,
-                                              NULL,
-                                              NULL);
+    Dart_Handle str =
+        Dart_MakeExternalString(empty_str, ext_empty_str, kLength, NULL, NULL);
     EXPECT(Dart_IsString(str));
     EXPECT(Dart_IsString(empty_str));
     EXPECT(Dart_IsStringLatin1(str));
@@ -8706,16 +8558,13 @@
 
     // Test with single character canonical string, it should not become
     // external string but the peer should be setup for it.
-    Dart_Handle canonical_str = Api::NewHandle(thread, Symbols::New(thread,
-                                                                    "*"));
+    Dart_Handle canonical_str =
+        Api::NewHandle(thread, Symbols::New(thread, "*"));
     EXPECT(Dart_IsString(canonical_str));
     EXPECT(!Dart_IsExternalString(canonical_str));
     uint8_t ext_canonical_str[kLength];
-    str = Dart_MakeExternalString(canonical_str,
-                                  ext_canonical_str,
-                                  kLength,
-                                  &canonical_str_peer,
-                                  MakeExternalCback);
+    str = Dart_MakeExternalString(canonical_str, ext_canonical_str, kLength,
+                                  &canonical_str_peer, MakeExternalCback);
     EXPECT(Dart_IsString(str));
     EXPECT(!Dart_IsExternalString(canonical_str));
     EXPECT_EQ(canonical_str, str);
@@ -8740,10 +8589,7 @@
 
     uint8_t ext_ascii_str[kLength];
     EXPECT_VALID(Dart_StringStorageSize(ascii_str, &size));
-    str = Dart_MakeExternalString(ascii_str,
-                                  ext_ascii_str,
-                                  size,
-                                  &peer8,
+    str = Dart_MakeExternalString(ascii_str, ext_ascii_str, size, &peer8,
                                   MakeExternalCback);
     EXPECT(Dart_IsString(str));
     EXPECT(Dart_IsString(ascii_str));
@@ -8760,7 +8606,7 @@
       EXPECT_EQ(ascii[i], ext_ascii_str[i]);
     }
 
-    uint8_t data[] = { 0xE4, 0xBA, 0x8c };  // U+4E8C.
+    uint8_t data[] = {0xE4, 0xBA, 0x8c};  // U+4E8C.
     expected_length = 1;
     Dart_Handle utf16_str = Dart_NewStringFromUTF8(data, ARRAY_SIZE(data));
     EXPECT_VALID(utf16_str);
@@ -8773,10 +8619,7 @@
     // Test with a two byte string.
     uint16_t ext_utf16_str[kLength];
     EXPECT_VALID(Dart_StringStorageSize(utf16_str, &size));
-    str = Dart_MakeExternalString(utf16_str,
-                                  ext_utf16_str,
-                                  size,
-                                  &peer16,
+    str = Dart_MakeExternalString(utf16_str, ext_utf16_str, size, &peer16,
                                   MakeExternalCback);
     EXPECT(Dart_IsString(str));
     EXPECT(Dart_IsString(utf16_str));
@@ -8797,8 +8640,8 @@
     // Test with a symbol (hash value should be preserved on externalization).
     const char* symbol_ascii = "?unseen";
     expected_length = strlen(symbol_ascii);
-    Dart_Handle symbol_str = Api::NewHandle(thread,
-        Symbols::New(thread, symbol_ascii, expected_length));
+    Dart_Handle symbol_str = Api::NewHandle(
+        thread, Symbols::New(thread, symbol_ascii, expected_length));
     EXPECT_VALID(symbol_str);
     EXPECT(Dart_IsString(symbol_str));
     EXPECT(Dart_IsStringLatin1(symbol_str));
@@ -8809,10 +8652,7 @@
 
     uint8_t ext_symbol_ascii[kLength];
     EXPECT_VALID(Dart_StringStorageSize(symbol_str, &size));
-    str = Dart_MakeExternalString(symbol_str,
-                                  ext_symbol_ascii,
-                                  size,
-                                  &peer8,
+    str = Dart_MakeExternalString(symbol_str, ext_symbol_ascii, size, &peer8,
                                   MakeExternalCback);
     EXPECT(Api::UnwrapStringHandle(zone, str).HasHash());
     EXPECT(Api::UnwrapStringHandle(zone, str).Hash() ==
@@ -8860,18 +8700,12 @@
       "}\n";
 
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
-  Dart_Handle result = Dart_Invoke(lib,
-                                   NewString("testMain"),
-                                   0,
-                                   NULL);
+  Dart_Handle result = Dart_Invoke(lib, NewString("testMain"), 0, NULL);
   const char* expected_str = "constant string";
   const intptr_t kExpectedLen = 15;
   uint8_t ext_str[kExpectedLen];
-  Dart_Handle str = Dart_MakeExternalString(result,
-                                            ext_str,
-                                            kExpectedLen,
-                                            NULL,
-                                            NULL);
+  Dart_Handle str =
+      Dart_MakeExternalString(result, ext_str, kExpectedLen, NULL, NULL);
 
   EXPECT(Dart_IsExternalString(str));
   for (intptr_t i = 0; i < kExpectedLen; i++) {
@@ -8945,12 +8779,8 @@
   EXPECT_VALID(Dart_StringStorageSize(str_arg, &arg_size));
   EXPECT_EQ(size, arg_size);
   char* str_data = new char[size];
-  Dart_Handle result =
-      Dart_MakeExternalString(str,
-                              str_data,
-                              size,
-                              str_data,
-                              &ExternalStringDeoptimize_Finalize);
+  Dart_Handle result = Dart_MakeExternalString(
+      str, str_data, size, str_data, &ExternalStringDeoptimize_Finalize);
   EXPECT_VALID(result);
   EXPECT(Dart_IsExternalString(result));
   Dart_ExitScope();
@@ -8958,7 +8788,9 @@
 
 
 static Dart_NativeFunction ExternalStringDeoptimize_native_lookup(
-    Dart_Handle name, int argument_count, bool* auto_setup_scope) {
+    Dart_Handle name,
+    int argument_count,
+    bool* auto_setup_scope) {
   ASSERT(auto_setup_scope != NULL);
   *auto_setup_scope = true;
   return reinterpret_cast<Dart_NativeFunction>(&A_change_str_native);
@@ -8995,13 +8827,9 @@
       "}\n"
       "change_str(String s) native 'A_change_str';\n"
       "";
-  Dart_Handle lib =
-      TestCase::LoadTestScript(kScriptChars,
-                               &ExternalStringDeoptimize_native_lookup);
-  Dart_Handle result = Dart_Invoke(lib,
-                                   NewString("main"),
-                                   0,
-                                   NULL);
+  Dart_Handle lib = TestCase::LoadTestScript(
+      kScriptChars, &ExternalStringDeoptimize_native_lookup);
+  Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
   int64_t value = 0;
   result = Dart_IntegerToInt64(result, &value);
   EXPECT_VALID(result);
@@ -9035,13 +8863,9 @@
       "  var y = sum_chars(str, true);\n"
       "  return x + y;\n"
       "}\n";
-  Dart_Handle lib =
-      TestCase::LoadTestScript(kScriptChars,
-                               &ExternalStringDeoptimize_native_lookup);
-  Dart_Handle result = Dart_Invoke(lib,
-                                   NewString("main"),
-                                   0,
-                                   NULL);
+  Dart_Handle lib = TestCase::LoadTestScript(
+      kScriptChars, &ExternalStringDeoptimize_native_lookup);
+  Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
   int64_t value = 0;
   result = Dart_IntegerToInt64(result, &value);
   EXPECT_VALID(result);
@@ -9075,13 +8899,9 @@
       "  A.change_str(strA);\n"
       "  return compareA('AA' + 'AA');\n"
       "}\n";
-  Dart_Handle lib =
-      TestCase::LoadTestScript(kScriptChars,
-                               &ExternalStringDeoptimize_native_lookup);
-  Dart_Handle result = Dart_Invoke(lib,
-                                   NewString("main"),
-                                   0,
-                                   NULL);
+  Dart_Handle lib = TestCase::LoadTestScript(
+      kScriptChars, &ExternalStringDeoptimize_native_lookup);
+  Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
   EXPECT_VALID(result);
   bool value = false;
   result = Dart_BooleanValue(result, &value);
@@ -9110,13 +8930,9 @@
       "  var result = double_char0(externalA);\n"
       "  return result == 130;\n"
       "}\n";
-  Dart_Handle lib =
-      TestCase::LoadTestScript(kScriptChars,
-                               &ExternalStringDeoptimize_native_lookup);
-  Dart_Handle result = Dart_Invoke(lib,
-                                   NewString("main"),
-                                   0,
-                                   NULL);
+  Dart_Handle lib = TestCase::LoadTestScript(
+      kScriptChars, &ExternalStringDeoptimize_native_lookup);
+  Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
   EXPECT_VALID(result);
   bool value = false;
   result = Dart_BooleanValue(result, &value);
@@ -9156,13 +8972,9 @@
       "  shouldExternalize = true;\n"
       "  return compareA('AA' + 'AA');\n"
       "}\n";
-  Dart_Handle lib =
-      TestCase::LoadTestScript(kScriptChars,
-                               &ExternalStringDeoptimize_native_lookup);
-  Dart_Handle result = Dart_Invoke(lib,
-                                   NewString("main"),
-                                   0,
-                                   NULL);
+  Dart_Handle lib = TestCase::LoadTestScript(
+      kScriptChars, &ExternalStringDeoptimize_native_lookup);
+  Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
   EXPECT_VALID(result);
   bool value = false;
   result = Dart_BooleanValue(result, &value);
@@ -9197,13 +9009,9 @@
       "  A.change_str(G.f);"
       "  return compareA('AA' + 'AA');\n"
       "}\n";
-  Dart_Handle lib =
-      TestCase::LoadTestScript(kScriptChars,
-                               &ExternalStringDeoptimize_native_lookup);
-  Dart_Handle result = Dart_Invoke(lib,
-                                   NewString("main"),
-                                   0,
-                                   NULL);
+  Dart_Handle lib = TestCase::LoadTestScript(
+      kScriptChars, &ExternalStringDeoptimize_native_lookup);
+  Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
   EXPECT_VALID(result);
   bool value = false;
   result = Dart_BooleanValue(result, &value);
@@ -9232,13 +9040,9 @@
       "  var y = double.parse(externalTwoByteString);\n"
       "  return ((x + y) * 10).toInt();\n"
       "}\n";
-  Dart_Handle lib =
-      TestCase::LoadTestScript(kScriptChars,
-                               &ExternalStringDeoptimize_native_lookup);
-  Dart_Handle result = Dart_Invoke(lib,
-                                   NewString("main"),
-                                   0,
-                                   NULL);
+  Dart_Handle lib = TestCase::LoadTestScript(
+      kScriptChars, &ExternalStringDeoptimize_native_lookup);
+  Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
   int64_t value = 0;
   result = Dart_IntegerToInt64(result, &value);
   EXPECT_VALID(result);
@@ -9266,13 +9070,9 @@
       "  var y = double.parse(externalTwoByteString);\n"
       "  return ((x + y) * 10).toInt();\n"
       "}\n";
-  Dart_Handle lib =
-      TestCase::LoadTestScript(kScriptChars,
-                               &ExternalStringDeoptimize_native_lookup);
-  Dart_Handle result = Dart_Invoke(lib,
-                                   NewString("main"),
-                                   0,
-                                   NULL);
+  Dart_Handle lib = TestCase::LoadTestScript(
+      kScriptChars, &ExternalStringDeoptimize_native_lookup);
+  Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
   int64_t value = 0;
   result = Dart_IntegerToInt64(result, &value);
   EXPECT_VALID(result);
@@ -9288,22 +9088,18 @@
       "  var str = 'Hello World';\n"
       "  return str.indexOf(pattern);\n"
       "}\n";
-  Dart_Handle lib =
-      TestCase::LoadTestScript(kScriptChars, NULL);
+  Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
 
-  uint8_t data8[] = { 'W' };
-  Dart_Handle ext8 = Dart_NewExternalLatin1String(data8, ARRAY_SIZE(data8),
-                                                  data8, NULL);
+  uint8_t data8[] = {'W'};
+  Dart_Handle ext8 =
+      Dart_NewExternalLatin1String(data8, ARRAY_SIZE(data8), data8, NULL);
   EXPECT_VALID(ext8);
   EXPECT(Dart_IsString(ext8));
   EXPECT(Dart_IsExternalString(ext8));
 
   Dart_Handle dart_args[1];
   dart_args[0] = ext8;
-  Dart_Handle result = Dart_Invoke(lib,
-                                   NewString("main"),
-                                   1,
-                                   dart_args);
+  Dart_Handle result = Dart_Invoke(lib, NewString("main"), 1, dart_args);
   int64_t value = 0;
   result = Dart_IntegerToInt64(result, &value);
   EXPECT_VALID(result);
@@ -9313,20 +9109,19 @@
 
 TEST_CASE(StringFromExternalTypedData) {
   const char* kScriptChars =
-    "test(external) {\n"
-    "  var str1 = new String.fromCharCodes(external);\n"
-    "  var str2 = new String.fromCharCodes(new List.from(external));\n"
-    "  if (str2 != str1) throw 'FAIL';\n"
-    "  return str1;\n"
-    "}\n"
-    "testView8(external) {\n"
-    "  return test(external.buffer.asUint8List());\n"
-    "}\n"
-    "testView16(external) {\n"
-    "  return test(external.buffer.asUint16List());\n"
-    "}\n";
-  Dart_Handle lib =
-      TestCase::LoadTestScript(kScriptChars, NULL);
+      "test(external) {\n"
+      "  var str1 = new String.fromCharCodes(external);\n"
+      "  var str2 = new String.fromCharCodes(new List.from(external));\n"
+      "  if (str2 != str1) throw 'FAIL';\n"
+      "  return str1;\n"
+      "}\n"
+      "testView8(external) {\n"
+      "  return test(external.buffer.asUint8List());\n"
+      "}\n"
+      "testView16(external) {\n"
+      "  return test(external.buffer.asUint16List());\n"
+      "}\n";
+  Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
 
   {
     uint8_t data[64];
@@ -9334,22 +9129,16 @@
       data[i] = i * 4;
     }
     // LATIN-1 in external Uint8List.
-    Dart_Handle external = Dart_NewExternalTypedData(
-        Dart_TypedData_kUint8, data, 64);
+    Dart_Handle external =
+        Dart_NewExternalTypedData(Dart_TypedData_kUint8, data, 64);
     EXPECT_VALID(external);
     Dart_Handle dart_args[1];
     dart_args[0] = external;
-    Dart_Handle result = Dart_Invoke(lib,
-                                     NewString("test"),
-                                     1,
-                                     dart_args);
+    Dart_Handle result = Dart_Invoke(lib, NewString("test"), 1, dart_args);
     EXPECT_VALID(result);
     EXPECT(Dart_IsString(result));
 
-    result = Dart_Invoke(lib,
-                         NewString("testView8"),
-                         1,
-                         dart_args);
+    result = Dart_Invoke(lib, NewString("testView8"), 1, dart_args);
     EXPECT_VALID(result);
     EXPECT(Dart_IsString(result));
   }
@@ -9360,22 +9149,16 @@
       data[i] = i * 4;
     }
     // LATIN-1 in external Uint16List.
-    Dart_Handle external = Dart_NewExternalTypedData(
-        Dart_TypedData_kUint16, data, 64);
+    Dart_Handle external =
+        Dart_NewExternalTypedData(Dart_TypedData_kUint16, data, 64);
     EXPECT_VALID(external);
     Dart_Handle dart_args[1];
     dart_args[0] = external;
-    Dart_Handle result = Dart_Invoke(lib,
-                                     NewString("test"),
-                                     1,
-                                     dart_args);
+    Dart_Handle result = Dart_Invoke(lib, NewString("test"), 1, dart_args);
     EXPECT_VALID(result);
     EXPECT(Dart_IsString(result));
 
-    result = Dart_Invoke(lib,
-                         NewString("testView16"),
-                         1,
-                         dart_args);
+    result = Dart_Invoke(lib, NewString("testView16"), 1, dart_args);
     EXPECT_VALID(result);
     EXPECT(Dart_IsString(result));
   }
@@ -9386,22 +9169,16 @@
       data[i] = 0x2000 + i * 4;
     }
     // Non-LATIN-1 in external Uint16List.
-    Dart_Handle external = Dart_NewExternalTypedData(
-        Dart_TypedData_kUint16, data, 64);
+    Dart_Handle external =
+        Dart_NewExternalTypedData(Dart_TypedData_kUint16, data, 64);
     EXPECT_VALID(external);
     Dart_Handle dart_args[1];
     dart_args[0] = external;
-    Dart_Handle result = Dart_Invoke(lib,
-                                     NewString("test"),
-                                     1,
-                                     dart_args);
+    Dart_Handle result = Dart_Invoke(lib, NewString("test"), 1, dart_args);
     EXPECT_VALID(result);
     EXPECT(Dart_IsString(result));
 
-    result = Dart_Invoke(lib,
-                         NewString("testView16"),
-                         1,
-                         dart_args);
+    result = Dart_Invoke(lib, NewString("testView16"), 1, dart_args);
     EXPECT_VALID(result);
     EXPECT(Dart_IsString(result));
   }
@@ -9418,11 +9195,8 @@
   // Make sure it is enabled.
   stream->set_enabled(true);
   // Add a duration event.
-  Dart_TimelineEvent("testDurationEvent",
-                     0,
-                     1,
-                     Dart_Timeline_Event_Duration,
-                     0, NULL, NULL);
+  Dart_TimelineEvent("testDurationEvent", 0, 1, Dart_Timeline_Event_Duration, 0,
+                     NULL, NULL);
   // Check that it is in the output.
   TimelineEventRecorder* recorder = Timeline::recorder();
   Timeline::ReclaimCachedBlocksFromThreads();
@@ -9439,11 +9213,8 @@
   TimelineStream* stream = Timeline::GetEmbedderStream();
   // Make sure it is enabled.
   stream->set_enabled(true);
-  Dart_TimelineEvent("testInstantEvent",
-                     0,
-                     1,
-                     Dart_Timeline_Event_Instant,
-                     0, NULL, NULL);
+  Dart_TimelineEvent("testInstantEvent", 0, 1, Dart_Timeline_Event_Instant, 0,
+                     NULL, NULL);
   // Check that it is in the output.
   TimelineEventRecorder* recorder = Timeline::recorder();
   Timeline::ReclaimCachedBlocksFromThreads();
@@ -9460,11 +9231,8 @@
   // Make sure it is disabled.
   stream->set_enabled(false);
   int64_t async_id = 99;
-  Dart_TimelineEvent("testAsyncEvent",
-                     0,
-                     async_id,
-                     Dart_Timeline_Event_Async_Begin,
-                     0, NULL, NULL);
+  Dart_TimelineEvent("testAsyncEvent", 0, async_id,
+                     Dart_Timeline_Event_Async_Begin, 0, NULL, NULL);
   // Check that testAsync is not in the output.
   TimelineEventRecorder* recorder = Timeline::recorder();
   Timeline::ReclaimCachedBlocksFromThreads();
@@ -9482,11 +9250,8 @@
   // Make sure it is enabled.
   stream->set_enabled(true);
   int64_t async_id = 99;
-  Dart_TimelineEvent("testAsyncEvent",
-                     0,
-                     async_id,
-                     Dart_Timeline_Event_Async_Begin,
-                     0, NULL, NULL);
+  Dart_TimelineEvent("testAsyncEvent", 0, async_id,
+                     Dart_Timeline_Event_Async_Begin, 0, NULL, NULL);
 
   // Check that it is in the output.
   TimelineEventRecorder* recorder = Timeline::recorder();
@@ -9525,9 +9290,7 @@
   data->buffer = reinterpret_cast<uint8_t*>(
       realloc(data->buffer, data->buffer_length + buffer_length));
   // Copy new data.
-  memmove(&data->buffer[data->buffer_length],
-          buffer,
-          buffer_length);
+  memmove(&data->buffer[data->buffer_length], buffer, buffer_length);
   // Update length.
   data->buffer_length += buffer_length;
 }
@@ -9535,11 +9298,10 @@
 
 TEST_CASE(Timeline_Dart_TimelineGetTrace) {
   const char* kScriptChars =
-    "foo() => 'a';\n"
-    "main() => foo();\n";
+      "foo() => 'a';\n"
+      "main() => foo();\n";
 
-  Dart_Handle lib =
-      TestCase::LoadTestScript(kScriptChars, NULL);
+  Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
 
   const char* buffer = NULL;
   intptr_t buffer_length = 0;
@@ -9550,10 +9312,7 @@
 
   // Invoke main, which will be compiled resulting in a compiler event in
   // the timeline.
-  Dart_Handle result = Dart_Invoke(lib,
-                                   NewString("main"),
-                                   0,
-                                   NULL);
+  Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
   EXPECT_VALID(result);
 
   // Grab the trace.
@@ -9583,15 +9342,14 @@
 
 TEST_CASE(Timeline_Dart_TimelineGetTraceOnlyDartEvents) {
   const char* kScriptChars =
-    "import 'dart:developer';\n"
-    ""
-    "main() {\n"
-    "  Timeline.startSync('DART_NAME');\n"
-    "  Timeline.finishSync();\n"
-    "}\n";
+      "import 'dart:developer';\n"
+      ""
+      "main() {\n"
+      "  Timeline.startSync('DART_NAME');\n"
+      "  Timeline.finishSync();\n"
+      "}\n";
 
-  Dart_Handle lib =
-      TestCase::LoadTestScript(kScriptChars, NULL);
+  Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
 
   const char* buffer = NULL;
   intptr_t buffer_length = 0;
@@ -9601,10 +9359,7 @@
   Dart_GlobalTimelineSetRecordedStreams(DART_TIMELINE_STREAM_DART);
 
   // Invoke main, which will add a new timeline event from Dart.
-  Dart_Handle result = Dart_Invoke(lib,
-                                   NewString("main"),
-                                   0,
-                                   NULL);
+  Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
   EXPECT_VALID(result);
 
   // Grab the trace.
@@ -9635,15 +9390,14 @@
 
 TEST_CASE(Timeline_Dart_TimelineGetTraceWithDartEvents) {
   const char* kScriptChars =
-    "import 'dart:developer';\n"
-    "\n"
-    "main() {\n"
-    "  Timeline.startSync('DART_NAME');\n"
-    "  Timeline.finishSync();\n"
-    "}\n";
+      "import 'dart:developer';\n"
+      "\n"
+      "main() {\n"
+      "  Timeline.startSync('DART_NAME');\n"
+      "  Timeline.finishSync();\n"
+      "}\n";
 
-  Dart_Handle lib =
-      TestCase::LoadTestScript(kScriptChars, NULL);
+  Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
 
   const char* buffer = NULL;
   intptr_t buffer_length = 0;
@@ -9654,10 +9408,7 @@
 
   // Invoke main, which will be compiled resulting in a compiler event in
   // the timeline.
-  Dart_Handle result = Dart_Invoke(lib,
-                                   NewString("main"),
-                                   0,
-                                   NULL);
+  Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
   EXPECT_VALID(result);
 
   // Grab the trace.
@@ -9688,11 +9439,10 @@
 
 TEST_CASE(Timeline_Dart_TimelineGetTraceGlobalOverride) {
   const char* kScriptChars =
-    "foo() => 'a';\n"
-    "main() => foo();\n";
+      "foo() => 'a';\n"
+      "main() => foo();\n";
 
-  Dart_Handle lib =
-      TestCase::LoadTestScript(kScriptChars, NULL);
+  Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
 
   const char* buffer = NULL;
   intptr_t buffer_length = 0;
@@ -9703,10 +9453,7 @@
 
   // Invoke main, which will be compiled resulting in a compiler event in
   // the timeline.
-  Dart_Handle result = Dart_Invoke(lib,
-                                   NewString("main"),
-                                   0,
-                                   NULL);
+  Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
   EXPECT_VALID(result);
 
   // Grab the trace.
@@ -9734,21 +9481,17 @@
 }
 
 
-static const char* arg_names[] = {
-  "arg0"
-};
+static const char* arg_names[] = {"arg0"};
 
 
-static const char* arg_values[] = {
-  "value0"
-};
+static const char* arg_values[] = {"value0"};
 
 
 TEST_CASE(Timeline_Dart_GlobalTimelineGetTrace) {
   const char* kScriptChars =
-    "bar() => 'z';\n"
-    "foo() => 'a';\n"
-    "main() => foo();\n";
+      "bar() => 'z';\n"
+      "foo() => 'a';\n"
+      "main() => foo();\n";
 
   // Enable all streams.
   Dart_GlobalTimelineSetRecordedStreams(DART_TIMELINE_STREAM_ALL |
@@ -9756,37 +9499,24 @@
   Dart_Handle lib;
   {
     // Add something to the VM stream.
-    TimelineDurationScope tds(Timeline::GetVMStream(),
-                              "TestVMDuration");
+    TimelineDurationScope tds(Timeline::GetVMStream(), "TestVMDuration");
     lib = TestCase::LoadTestScript(kScriptChars, NULL);
   }
 
   {
     // Add something to the embedder stream.
-    Dart_TimelineEvent("TRACE_EVENT",
-                       Dart_TimelineGetMicros(),
-                       0,
-                       Dart_Timeline_Event_Begin,
-                       1,
-                       &arg_names[0],
+    Dart_TimelineEvent("TRACE_EVENT", Dart_TimelineGetMicros(), 0,
+                       Dart_Timeline_Event_Begin, 1, &arg_names[0],
                        &arg_values[0]);
     // Add counter to the embedder stream.
-    Dart_TimelineEvent("COUNTER_EVENT",
-                       Dart_TimelineGetMicros(),
-                       0,
-                       Dart_Timeline_Event_Counter,
-                       0,
-                       NULL,
-                       NULL);
+    Dart_TimelineEvent("COUNTER_EVENT", Dart_TimelineGetMicros(), 0,
+                       Dart_Timeline_Event_Counter, 0, NULL, NULL);
     Dart_SetThreadName("CUSTOM THREAD NAME");
   }
 
   // Invoke main, which will be compiled resulting in a compiler event in
   // the timeline.
-  Dart_Handle result = Dart_Invoke(lib,
-                                   NewString("main"),
-                                   0,
-                                   NULL);
+  Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
   EXPECT_VALID(result);
 
   const char* buffer = NULL;
@@ -9836,14 +9566,10 @@
   // in the resulting trace.
   {
     // Add something to the VM stream.
-    TimelineDurationScope tds(Timeline::GetVMStream(),
-                              "TestVMDuration2");
+    TimelineDurationScope tds(Timeline::GetVMStream(), "TestVMDuration2");
     // Invoke bar, which will be compiled resulting in a compiler event in
     // the timeline.
-    result = Dart_Invoke(lib,
-                         NewString("bar"),
-                         0,
-                         NULL);
+    result = Dart_Invoke(lib, NewString("bar"), 0, NULL);
   }
 
   // Grab the global trace.
@@ -9882,10 +9608,7 @@
 class GlobalTimelineThreadData {
  public:
   GlobalTimelineThreadData()
-      : monitor_(new Monitor()),
-        data_(new AppendData()),
-        running_(true) {
-  }
+      : monitor_(new Monitor()), data_(new AppendData()), running_(true) {}
 
   ~GlobalTimelineThreadData() {
     delete monitor_;
@@ -9935,9 +9658,9 @@
 // Thread object.
 TEST_CASE(Timeline_Dart_GlobalTimelineGetTrace_Threaded) {
   const char* kScriptChars =
-    "bar() => 'z';\n"
-    "foo() => 'a';\n"
-    "main() => foo();\n";
+      "bar() => 'z';\n"
+      "foo() => 'a';\n"
+      "main() => foo();\n";
 
   // Enable all streams.
   Dart_GlobalTimelineSetRecordedStreams(DART_TIMELINE_STREAM_ALL |
@@ -9945,8 +9668,7 @@
   Dart_Handle lib;
   {
     // Add something to the VM stream.
-    TimelineDurationScope tds(Timeline::GetVMStream(),
-                              "TestVMDuration");
+    TimelineDurationScope tds(Timeline::GetVMStream(), "TestVMDuration");
     lib = TestCase::LoadTestScript(kScriptChars, NULL);
   }
 
@@ -9960,8 +9682,8 @@
 
   // Run Dart_GlobalTimelineGetTrace on a fresh thread.
   GlobalTimelineThreadData data;
-  int err = OSThread::Start("Timeline test thread",
-      GlobalTimelineThread, reinterpret_cast<uword>(&data));
+  int err = OSThread::Start("Timeline test thread", GlobalTimelineThread,
+                            reinterpret_cast<uword>(&data));
   EXPECT(err == 0);
   {
     MonitorLocker ml(data.monitor());
@@ -9992,8 +9714,7 @@
   // in the resulting trace.
   {
     // Add something to the VM stream.
-    TimelineDurationScope tds(Timeline::GetVMStream(),
-                              "TestVMDuration2");
+    TimelineDurationScope tds(Timeline::GetVMStream(), "TestVMDuration2");
     // Invoke bar, which will be compiled resulting in a compiler event in
     // the timeline.
     result = Dart_Invoke(lib, NewString("bar"), 0, NULL);
@@ -10001,8 +9722,8 @@
 
   // Grab the global trace.
   GlobalTimelineThreadData data2;
-  err = OSThread::Start("Timeline test thread",
-      GlobalTimelineThread, reinterpret_cast<uword>(&data2));
+  err = OSThread::Start("Timeline test thread", GlobalTimelineThread,
+                        reinterpret_cast<uword>(&data2));
   EXPECT(err == 0);
   {
     MonitorLocker ml(data2.monitor());
@@ -10081,10 +9802,7 @@
       "}\n";
 
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars1, NULL);
-  Dart_Handle result = Dart_Invoke(lib,
-                                   NewString("main"),
-                                   0,
-                                   NULL);
+  Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
   EXPECT_VALID(result);
   Dart_Handle url = NewString("test-lib-patch");
   Dart_Handle source = NewString(kScriptChars2);
@@ -10092,15 +9810,9 @@
   EXPECT_VALID(result);
   result = Dart_FinalizeLoading(false);
   EXPECT_VALID(result);
-  result = Dart_Invoke(lib,
-                       NewString("foozoo"),
-                       0,
-                       NULL);
+  result = Dart_Invoke(lib, NewString("foozoo"), 0, NULL);
   EXPECT_VALID(result);
-  result = Dart_Invoke(lib,
-                       NewString("foomoo"),
-                       0,
-                       NULL);
+  result = Dart_Invoke(lib, NewString("foomoo"), 0, NULL);
   EXPECT_VALID(result);
 }
 
@@ -10121,10 +9833,7 @@
       "}\n";
 
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars1, NULL);
-  Dart_Handle result = Dart_Invoke(lib,
-                                   NewString("main"),
-                                   0,
-                                   NULL);
+  Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
   EXPECT_VALID(result);
   Dart_Handle url = NewString("test-lib-patch");
   Dart_Handle source = NewString(kScriptChars2);
@@ -10134,10 +9843,7 @@
   EXPECT_VALID(result);
   result = Dart_FinalizeLoading(false);
   EXPECT_VALID(result);
-  result = Dart_Invoke(lib,
-                       NewString("foozoo"),
-                       0,
-                       NULL);
+  result = Dart_Invoke(lib, NewString("foozoo"), 0, NULL);
   EXPECT(Dart_IsError(result));
 }
 
@@ -10157,10 +9863,7 @@
       "}\n";
 
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars1, NULL);
-  Dart_Handle result = Dart_Invoke(lib,
-                                   NewString("main"),
-                                   0,
-                                   NULL);
+  Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
   EXPECT_VALID(result);
   Dart_Handle url = NewString("test-lib-patch");
   Dart_Handle source = NewString(kScriptChars2);
@@ -10170,10 +9873,7 @@
   EXPECT_VALID(result);
   result = Dart_FinalizeLoading(false);
   EXPECT_VALID(result);
-  result = Dart_Invoke(lib,
-                       NewString("foozoo"),
-                       0,
-                       NULL);
+  result = Dart_Invoke(lib, NewString("foozoo"), 0, NULL);
   EXPECT(Dart_IsError(result));
   OS::Print("Patched class executed\n");
 }
@@ -10194,16 +9894,10 @@
       "}\n";
 
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars1, NULL);
-  Dart_Handle result = Dart_Invoke(lib,
-                                   NewString("main"),
-                                   0,
-                                   NULL);
+  Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
   // We invoke the foozoo method to ensure that code for 'zoo' is generated
   // which throws NoSuchMethod.
-  result = Dart_Invoke(lib,
-                       NewString("foozoo"),
-                       0,
-                       NULL);
+  result = Dart_Invoke(lib, NewString("foozoo"), 0, NULL);
   EXPECT(Dart_IsError(result));
   Dart_Handle url = NewString("test-lib-patch");
   Dart_Handle source = NewString(kScriptChars2);
@@ -10213,10 +9907,7 @@
   EXPECT_VALID(result);
   result = Dart_FinalizeLoading(false);
   EXPECT_VALID(result);
-  result = Dart_Invoke(lib,
-                       NewString("foozoo"),
-                       0,
-                       NULL);
+  result = Dart_Invoke(lib, NewString("foozoo"), 0, NULL);
   EXPECT(Dart_IsError(result));
 }
 
diff --git a/runtime/vm/dart_api_message.cc b/runtime/vm/dart_api_message.cc
index 18fee76..4d3687f3 100644
--- a/runtime/vm/dart_api_message.cc
+++ b/runtime/vm/dart_api_message.cc
@@ -17,8 +17,7 @@
       zone_(NULL),
       backward_references_(kNumInitialReferences),
       vm_isolate_references_(kNumInitialReferences),
-      vm_symbol_references_(NULL) {
-}
+      vm_symbol_references_(NULL) {}
 
 
 ApiMessageReader::ApiMessageReader(Message* msg)
@@ -28,8 +27,7 @@
       zone_(NULL),
       backward_references_(kNumInitialReferences),
       vm_isolate_references_(kNumInitialReferences),
-      vm_symbol_references_(NULL) {
-}
+      vm_symbol_references_(NULL) {}
 
 
 void ApiMessageReader::Init() {
@@ -60,7 +58,7 @@
         reinterpret_cast<const RawObject*>(CurrentBufferAddress());
     ASSERT(ApiObjectConverter::CanConvert(raw_obj));
     Dart_CObject* cobj =
-      reinterpret_cast<Dart_CObject*>(allocator(sizeof(Dart_CObject)));
+        reinterpret_cast<Dart_CObject*>(allocator(sizeof(Dart_CObject)));
     ApiObjectConverter::Convert(raw_obj, cobj);
     return cobj;
   }
@@ -143,9 +141,8 @@
   // Allocate a Dart_CObject structure followed by an array of chars
   // for the string content. The pointer to the string content is set
   // up to this area.
-  Dart_CObject* value =
-      reinterpret_cast<Dart_CObject*>(
-          allocator(sizeof(Dart_CObject) + length + 1));
+  Dart_CObject* value = reinterpret_cast<Dart_CObject*>(
+      allocator(sizeof(Dart_CObject) + length + 1));
   ASSERT(value != NULL);
   value->value.as_string = reinterpret_cast<char*>(value) + sizeof(*value);
   value->type = Dart_CObject_kString;
@@ -179,14 +176,14 @@
 
 
 Dart_CObject* ApiMessageReader::AllocateDartCObjectTypedData(
-    Dart_TypedData_Type type, intptr_t length) {
+    Dart_TypedData_Type type,
+    intptr_t length) {
   // Allocate a Dart_CObject structure followed by an array of bytes
   // for the byte array content. The pointer to the byte array content
   // is set up to this area.
   intptr_t length_in_bytes = GetTypedDataSizeInBytes(type) * length;
-  Dart_CObject* value =
-      reinterpret_cast<Dart_CObject*>(
-          allocator(sizeof(Dart_CObject) + length_in_bytes));
+  Dart_CObject* value = reinterpret_cast<Dart_CObject*>(
+      allocator(sizeof(Dart_CObject) + length_in_bytes));
   ASSERT(value != NULL);
   value->type = Dart_CObject_kTypedData;
   value->value.as_typed_data.type = type;
@@ -205,9 +202,8 @@
   // Allocate a Dart_CObject structure followed by an array of
   // pointers to Dart_CObject structures. The pointer to the array
   // content is set up to this area.
-  Dart_CObject* value =
-      reinterpret_cast<Dart_CObject*>(
-          allocator(sizeof(Dart_CObject) + length * sizeof(value)));
+  Dart_CObject* value = reinterpret_cast<Dart_CObject*>(
+      allocator(sizeof(Dart_CObject) + length * sizeof(value)));
   ASSERT(value != NULL);
   value->type = Dart_CObject_kArray;
   value->value.as_array.length = length;
@@ -261,9 +257,8 @@
 
 Dart_CObject_Internal* ApiMessageReader::AllocateDartCObjectInternal(
     Dart_CObject_Internal::Type type) {
-  Dart_CObject_Internal* value =
-      reinterpret_cast<Dart_CObject_Internal*>(
-          allocator(sizeof(Dart_CObject_Internal)));
+  Dart_CObject_Internal* value = reinterpret_cast<Dart_CObject_Internal*>(
+      allocator(sizeof(Dart_CObject_Internal)));
   ASSERT(value != NULL);
   value->type = static_cast<Dart_CObject_Type>(type);
   return value;
@@ -293,25 +288,24 @@
     const char* name;
     Dart_TypedData_Type type;
   } view_class_names[] = {
-    { "_Int8ArrayView", Dart_TypedData_kInt8 },
-    { "_Uint8ArrayView", Dart_TypedData_kUint8 },
-    { "_Uint8ClampedArrayView", Dart_TypedData_kUint8Clamped },
-    { "_Int16ArrayView", Dart_TypedData_kInt16 },
-    { "_Uint16ArrayView", Dart_TypedData_kUint16 },
-    { "_Int32ArrayView", Dart_TypedData_kInt32 },
-    { "_Uint32ArrayView", Dart_TypedData_kUint32 },
-    { "_Int64ArrayView", Dart_TypedData_kInt64 },
-    { "_Uint64ArrayView", Dart_TypedData_kUint64 },
-    { "_ByteDataView", Dart_TypedData_kUint8 },
-    { "_Float32ArrayView", Dart_TypedData_kFloat32 },
-    { "_Float64ArrayView", Dart_TypedData_kFloat64 },
-    { NULL, Dart_TypedData_kInvalid },
+      {"_Int8ArrayView", Dart_TypedData_kInt8},
+      {"_Uint8ArrayView", Dart_TypedData_kUint8},
+      {"_Uint8ClampedArrayView", Dart_TypedData_kUint8Clamped},
+      {"_Int16ArrayView", Dart_TypedData_kInt16},
+      {"_Uint16ArrayView", Dart_TypedData_kUint16},
+      {"_Int32ArrayView", Dart_TypedData_kInt32},
+      {"_Uint32ArrayView", Dart_TypedData_kUint32},
+      {"_Int64ArrayView", Dart_TypedData_kInt64},
+      {"_Uint64ArrayView", Dart_TypedData_kUint64},
+      {"_ByteDataView", Dart_TypedData_kUint8},
+      {"_Float32ArrayView", Dart_TypedData_kFloat32},
+      {"_Float64ArrayView", Dart_TypedData_kFloat64},
+      {NULL, Dart_TypedData_kInvalid},
   };
 
   int i = 0;
   while (view_class_names[i].name != NULL) {
-    if (strncmp(view_class_names[i].name,
-                class_name,
+    if (strncmp(view_class_names[i].name, class_name,
                 strlen(view_class_names[i].name)) == 0) {
       return view_class_names[i].type;
     }
@@ -342,9 +336,8 @@
       ASSERT(object->cls->type ==
              static_cast<Dart_CObject_Type>(Dart_CObject_Internal::kClass));
     }
-    ASSERT(object->type ==
-           static_cast<Dart_CObject_Type>(
-               Dart_CObject_Internal::kUninitialized));
+    ASSERT(object->type == static_cast<Dart_CObject_Type>(
+                               Dart_CObject_Internal::kUninitialized));
 
     char* library_uri =
         object->cls->internal.as_class.library_url->value.as_string;
@@ -373,8 +366,7 @@
         object->type = Dart_CObject_kTypedData;
         object->value.as_typed_data.type = type;
         object->value.as_typed_data.length =
-            object->internal.as_view.length *
-            GetTypedDataSizeInBytes(type);
+            object->internal.as_view.length * GetTypedDataSizeInBytes(type);
         object->value.as_typed_data.values =
             buffer->value.as_typed_data.values +
             object->internal.as_view.offset_in_bytes;
@@ -428,8 +420,7 @@
   if (vm_symbol_references_ == NULL) {
     intptr_t size =
         (sizeof(*vm_symbol_references_) * Symbols::kMaxPredefinedId);
-    vm_symbol_references_ =
-        reinterpret_cast<Dart_CObject**>(allocator(size));
+    vm_symbol_references_ = reinterpret_cast<Dart_CObject**>(allocator(size));
     memset(vm_symbol_references_, 0, size);
   }
 
@@ -628,7 +619,7 @@
       Dart_CObject* digits = ReadObjectImpl();
       ASSERT(digits->type == Dart_CObject_kTypedData);
       ASSERT(digits->value.as_typed_data.type == Dart_TypedData_kUint32);
-      ASSERT(digits->value.as_typed_data.length >= 4*used);
+      ASSERT(digits->value.as_typed_data.length >= 4 * used);
       // Update the bigint object.
       object->value.as_bigint.neg = neg;
       object->value.as_bigint.used = used;
@@ -642,7 +633,7 @@
     }
     case kOneByteStringCid: {
       intptr_t len = ReadSmiValue();
-      uint8_t *latin1 =
+      uint8_t* latin1 =
           reinterpret_cast<uint8_t*>(allocator(len * sizeof(uint8_t)));
       intptr_t utf8_len = 0;
       for (intptr_t i = 0; i < len; i++) {
@@ -661,8 +652,8 @@
     }
     case kTwoByteStringCid: {
       intptr_t len = ReadSmiValue();
-      uint16_t *utf16 = reinterpret_cast<uint16_t*>(
-          allocator(len * sizeof(uint16_t)));
+      uint16_t* utf16 =
+          reinterpret_cast<uint16_t*>(allocator(len * sizeof(uint16_t)));
       intptr_t utf8_len = 0;
       // Read all the UTF-16 code units.
       for (intptr_t i = 0; i < len; i++) {
@@ -709,24 +700,23 @@
     }
 
 #define READ_TYPED_DATA_HEADER(type)                                           \
-      intptr_t len = ReadSmiValue();                                           \
-      Dart_CObject* object =                                                   \
-          AllocateDartCObjectTypedData(Dart_TypedData_k##type, len);           \
-      AddBackRef(object_id, object, kIsDeserialized);                          \
+  intptr_t len = ReadSmiValue();                                               \
+  Dart_CObject* object =                                                       \
+      AllocateDartCObjectTypedData(Dart_TypedData_k##type, len);               \
+  AddBackRef(object_id, object, kIsDeserialized);
 
 
 #define READ_TYPED_DATA(type, ctype)                                           \
-    {                                                                          \
-      READ_TYPED_DATA_HEADER(type);                                            \
-      if (len > 0) {                                                           \
-        ctype* p =                                                             \
-            reinterpret_cast<ctype*>(object->value.as_typed_data.values);      \
-        for (intptr_t i = 0; i < len; i++) {                                   \
-          p[i] = Read<ctype>();                                                \
-        }                                                                      \
+  {                                                                            \
+    READ_TYPED_DATA_HEADER(type);                                              \
+    if (len > 0) {                                                             \
+      ctype* p = reinterpret_cast<ctype*>(object->value.as_typed_data.values); \
+      for (intptr_t i = 0; i < len; i++) {                                     \
+        p[i] = Read<ctype>();                                                  \
       }                                                                        \
-      return object;                                                           \
     }                                                                          \
+    return object;                                                             \
+  }
 
     case kTypedDataInt8ArrayCid:
     case kExternalTypedDataInt8ArrayCid: {
@@ -829,10 +819,8 @@
 
 
 Dart_CObject* ApiMessageReader::ReadIndexedObject(intptr_t object_id) {
-  if (object_id == kDynamicType ||
-      object_id == kDoubleType ||
-      object_id == kIntType ||
-      object_id == kBoolType ||
+  if (object_id == kDynamicType || object_id == kDoubleType ||
+      object_id == kIntType || object_id == kBoolType ||
       object_id == kStringType) {
     // Always return dynamic type (this is only a marker).
     return &dynamic_type_marker;
@@ -905,7 +893,7 @@
 }
 
 
-void ApiMessageWriter::WriteMessage(intptr_t field_count, intptr_t *data) {
+void ApiMessageWriter::WriteMessage(intptr_t field_count, intptr_t* data) {
   // Write out the serialization header value for this object.
   WriteInlinedObjectHeader(kMaxPredefinedObjectIds);
 
@@ -939,8 +927,8 @@
 
 void ApiMessageWriter::UnmarkCObject(Dart_CObject* object) {
   ASSERT(IsCObjectMarked(object));
-  object->type = static_cast<Dart_CObject_Type>(
-      object->type & kDartCObjectTypeMask);
+  object->type =
+      static_cast<Dart_CObject_Type>(object->type & kDartCObjectTypeMask);
 }
 
 
@@ -1053,8 +1041,7 @@
   Dart_CObject_Type type = object->type;
   if (type == Dart_CObject_kArray) {
     const intptr_t array_length = object->value.as_array.length;
-    if (array_length < 0 ||
-        array_length > Array::kMaxElements) {
+    if (array_length < 0 || array_length > Array::kMaxElements) {
       return false;
     }
 
@@ -1088,8 +1075,7 @@
   Dart_CObject_Type type = object->type;
   if (type == Dart_CObject_kArray) {
     const intptr_t array_length = object->value.as_array.length;
-    if (array_length < 0 ||
-        array_length > Array::kMaxElements) {
+    if (array_length < 0 || array_length > Array::kMaxElements) {
       return false;
     }
     // Write out the serialization header value for this object.
@@ -1113,8 +1099,7 @@
       static_cast<Dart_CObject_Type>(object->type & kDartCObjectTypeMask);
   ASSERT(type == Dart_CObject_kArray);
   const intptr_t array_length = object->value.as_array.length;
-  if (array_length < 0 ||
-      array_length > Array::kMaxElements) {
+  if (array_length < 0 || array_length > Array::kMaxElements) {
     return false;
   }
 
@@ -1203,10 +1188,8 @@
       if (type == Utf8::kLatin1) {
         uint8_t* latin1_str =
             reinterpret_cast<uint8_t*>(::malloc(len * sizeof(uint8_t)));
-        bool success = Utf8::DecodeToLatin1(utf8_str,
-                                            utf8_len,
-                                            latin1_str,
-                                            len);
+        bool success =
+            Utf8::DecodeToLatin1(utf8_str, utf8_len, latin1_str, len);
         ASSERT(success);
         for (intptr_t i = 0; i < len; i++) {
           Write<uint8_t>(latin1_str[i]);
@@ -1245,8 +1228,7 @@
       }
 
       intptr_t len = object->value.as_typed_data.length;
-      if (len < 0 ||
-          len > TypedData::MaxElements(class_id)) {
+      if (len < 0 || len > TypedData::MaxElements(class_id)) {
         return false;
       }
 
@@ -1288,8 +1270,8 @@
       WriteTags(0);
       intptr_t length = object->value.as_external_typed_data.length;
       if (length < 0 ||
-          length > ExternalTypedData::MaxElements(
-              kExternalTypedDataUint8ArrayCid)) {
+          length >
+              ExternalTypedData::MaxElements(kExternalTypedDataUint8ArrayCid)) {
         return false;
       }
       uint8_t* data = object->value.as_external_typed_data.data;
diff --git a/runtime/vm/dart_api_message.h b/runtime/vm/dart_api_message.h
index bb1efa2..8e2747a 100644
--- a/runtime/vm/dart_api_message.h
+++ b/runtime/vm/dart_api_message.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_DART_API_MESSAGE_H_
-#define VM_DART_API_MESSAGE_H_
+#ifndef RUNTIME_VM_DART_API_MESSAGE_H_
+#define RUNTIME_VM_DART_API_MESSAGE_H_
 
 #include "include/dart_native_api.h"
 #include "platform/utils.h"
@@ -50,7 +50,7 @@
   // the enclosing ApiNativeScope.
   ApiMessageReader(const uint8_t* buffer, intptr_t length);
   explicit ApiMessageReader(Message* message);
-  ~ApiMessageReader() { }
+  ~ApiMessageReader() {}
 
   Dart_CObject* ReadMessage();
 
@@ -93,8 +93,8 @@
   // Allocates a Dart_CObject object for string data.
   Dart_CObject* AllocateDartCObjectString(intptr_t length);
   // Allocates a C Dart_CObject object for a typed data.
-  Dart_CObject* AllocateDartCObjectTypedData(
-      Dart_TypedData_Type type, intptr_t length);
+  Dart_CObject* AllocateDartCObjectTypedData(Dart_TypedData_Type type,
+                                             intptr_t length);
   // Allocates a C array of Dart_CObject objects.
   Dart_CObject* AllocateDartCObjectArray(intptr_t length);
   // Allocate a C Dart_CObject object for a VM isolate object.
@@ -137,8 +137,7 @@
   }
 
   Dart_CObject* CreateDartCObjectString(RawObject* raw);
-  Dart_CObject* GetCanonicalMintObject(Dart_CObject_Type type,
-                                       int64_t value64);
+  Dart_CObject* GetCanonicalMintObject(Dart_CObject_Type type, int64_t value64);
 
   uint8_t* allocator(intptr_t size) {
     return zone_->Realloc<uint8_t>(NULL, 0, size);
@@ -160,16 +159,16 @@
   static const intptr_t kInitialSize = 512;
   ApiMessageWriter(uint8_t** buffer, ReAlloc alloc)
       : BaseWriter(buffer, alloc, kInitialSize),
-        object_id_(0), forward_list_(NULL),
-        forward_list_length_(0), forward_id_(0) {
+        object_id_(0),
+        forward_list_(NULL),
+        forward_list_length_(0),
+        forward_id_(0) {
     ASSERT(kDartCObjectTypeMask >= Dart_CObject_kNumberOfTypes - 1);
   }
-  ~ApiMessageWriter() {
-    ::free(forward_list_);
-  }
+  ~ApiMessageWriter() { ::free(forward_list_); }
 
   // Writes a message of integers.
-  void WriteMessage(intptr_t field_count, intptr_t *data);
+  void WriteMessage(intptr_t field_count, intptr_t* data);
 
   // Writes a message with a single object.
   bool WriteCMessage(Dart_CObject* object);
@@ -250,4 +249,4 @@
 
 }  // namespace dart
 
-#endif  // VM_DART_API_MESSAGE_H_
+#endif  // RUNTIME_VM_DART_API_MESSAGE_H_
diff --git a/runtime/vm/dart_api_state.cc b/runtime/vm/dart_api_state.cc
index 6d0967d..2d1d827 100644
--- a/runtime/vm/dart_api_state.cc
+++ b/runtime/vm/dart_api_state.cc
@@ -15,9 +15,8 @@
 namespace dart {
 
 BackgroundFinalizer::BackgroundFinalizer(Isolate* isolate,
-                                         FinalizationQueue* queue) :
-    isolate_(isolate),
-    queue_(queue) {
+                                         FinalizationQueue* queue)
+    : isolate_(isolate), queue_(queue) {
   ASSERT(FLAG_background_finalization);
   PageSpace* old_space = isolate->heap()->old_space();
   MonitorLocker ml(old_space->tasks_lock());
@@ -26,8 +25,7 @@
 
 
 void BackgroundFinalizer::Run() {
-  bool result = Thread::EnterIsolateAsHelper(isolate_,
-                                             Thread::kFinalizerTask);
+  bool result = Thread::EnterIsolateAsHelper(isolate_, Thread::kFinalizerTask);
   ASSERT(result);
 
   {
diff --git a/runtime/vm/dart_api_state.h b/runtime/vm/dart_api_state.h
index f687fb2..1bff38c 100644
--- a/runtime/vm/dart_api_state.h
+++ b/runtime/vm/dart_api_state.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_DART_API_STATE_H_
-#define VM_DART_API_STATE_H_
+#ifndef RUNTIME_VM_DART_API_STATE_H_
+#define RUNTIME_VM_DART_API_STATE_H_
 
 #include "include/dart_api.h"
 
@@ -32,7 +32,7 @@
 class BackgroundFinalizer : public ThreadPool::Task {
  public:
   BackgroundFinalizer(Isolate* isolate, FinalizationQueue* queue);
-  virtual ~BackgroundFinalizer() { }
+  virtual ~BackgroundFinalizer() {}
 
   void Run();
 
@@ -88,7 +88,9 @@
   // 'ElementType'.  Checks for integer overflow when performing the
   // size computation.
   template <class ElementType>
-  ElementType* Alloc(intptr_t len) { return zone_.Alloc<ElementType>(len); }
+  ElementType* Alloc(intptr_t len) {
+    return zone_.Alloc<ElementType>(len);
+  }
 
   // Allocates an array sized to hold 'len' elements of type
   // 'ElementType'.  The new array is initialized from the memory of
@@ -133,7 +135,8 @@
  private:
   Zone zone_;
 
-  template<typename T> friend class ApiGrowableArray;
+  template <typename T>
+  friend class ApiGrowableArray;
   DISALLOW_COPY_AND_ASSIGN(ApiZone);
 };
 
@@ -148,13 +151,11 @@
   void set_raw(RawObject* raw) { raw_ = raw; }
   static intptr_t raw_offset() { return OFFSET_OF(LocalHandle, raw_); }
 
-  Dart_Handle apiHandle() {
-    return reinterpret_cast<Dart_Handle>(this);
-  }
+  Dart_Handle apiHandle() { return reinterpret_cast<Dart_Handle>(this); }
 
  private:
-  LocalHandle() { }
-  ~LocalHandle() { }
+  LocalHandle() {}
+  ~LocalHandle() {}
 
   RawObject* raw_;
   DISALLOW_ALLOCATION();  // Allocated through AllocateHandle methods.
@@ -188,21 +189,17 @@
  private:
   friend class PersistentHandles;
 
-  PersistentHandle() { }
-  ~PersistentHandle() { }
+  PersistentHandle() {}
+  ~PersistentHandle() {}
 
   // Overload the raw_ field as a next pointer when adding freed
   // handles to the free list.
-  PersistentHandle* Next() {
-    return reinterpret_cast<PersistentHandle*>(raw_);
-  }
+  PersistentHandle* Next() { return reinterpret_cast<PersistentHandle*>(raw_); }
   void SetNext(PersistentHandle* free_list) {
     raw_ = reinterpret_cast<RawObject*>(free_list);
     ASSERT(!raw_->IsHeapObject());
   }
-  void FreeHandle(PersistentHandle* free_list) {
-    SetNext(free_list);
-  }
+  void FreeHandle(PersistentHandle* free_list) { SetNext(free_list); }
 
   RawObject* raw_;
   DISALLOW_ALLOCATION();  // Allocated through AllocateHandle methods.
@@ -293,19 +290,16 @@
                                                   kExternalSizeBitsSize> {};
   // This bit of external_data_ is true if the referent was created in new
   // space and UpdateRelocated has not yet detected any promotion.
-  class ExternalNewSpaceBit :
-      public BitField<uword, bool, kExternalNewSpaceBit, 1> {};
-  class QueuedForFinalizationBit :
-      public BitField<uword, bool, kQueuedForFinalizationBit, 1> {};
+  class ExternalNewSpaceBit
+      : public BitField<uword, bool, kExternalNewSpaceBit, 1> {};
+  class QueuedForFinalizationBit
+      : public BitField<uword, bool, kQueuedForFinalizationBit, 1> {};
 
   friend class FinalizablePersistentHandles;
 
   FinalizablePersistentHandle()
-      : raw_(NULL),
-        peer_(NULL),
-        external_data_(0),
-        callback_(NULL) { }
-  ~FinalizablePersistentHandle() { }
+      : raw_(NULL), peer_(NULL), external_data_(0), callback_(NULL) {}
+  ~FinalizablePersistentHandle() {}
 
   static void Finalize(Isolate* isolate, FinalizablePersistentHandle* handle);
 
@@ -348,8 +342,8 @@
   void set_external_size(intptr_t size) {
     intptr_t size_in_words = Utils::RoundUp(size, kObjectAlignment) / kWordSize;
     ASSERT(ExternalSizeInWordsBits::is_valid(size_in_words));
-    external_data_ = ExternalSizeInWordsBits::update(size_in_words,
-                                                     external_data_);
+    external_data_ =
+        ExternalSizeInWordsBits::update(size_in_words, external_data_);
   }
 
   bool is_queued_for_finalization() const {
@@ -374,8 +368,8 @@
   // Returns the space to charge for the external size.
   Heap::Space SpaceForExternal() const {
     // Non-heap and VM-heap objects count as old space here.
-    return (raw_->IsHeapObject() && raw_->IsNewObject()) ?
-           Heap::kNew : Heap::kOld;
+    return (raw_->IsHeapObject() && raw_->IsNewObject()) ? Heap::kNew
+                                                         : Heap::kOld;
   }
 
   friend class BackgroundFinalizer;
@@ -398,9 +392,10 @@
                              kLocalHandlesPerChunk,
                              kOffsetOfRawPtrInLocalHandle> {
  public:
-  LocalHandles() : Handles<kLocalHandleSizeInWords,
-                           kLocalHandlesPerChunk,
-                           kOffsetOfRawPtrInLocalHandle>() {
+  LocalHandles()
+      : Handles<kLocalHandleSizeInWords,
+                kLocalHandlesPerChunk,
+                kOffsetOfRawPtrInLocalHandle>() {
     if (FLAG_trace_handles) {
       OS::PrintErr("*** Starting a new Local handle block 0x%" Px "\n",
                    reinterpret_cast<intptr_t>(this));
@@ -409,8 +404,7 @@
   ~LocalHandles() {
     if (FLAG_trace_handles) {
       OS::PrintErr("***   Handle Counts for 0x(%" Px "):Scoped = %d\n",
-                   reinterpret_cast<intptr_t>(this),
-                   CountHandles());
+                   reinterpret_cast<intptr_t>(this), CountHandles());
       OS::PrintErr("*** Deleting Local handle block 0x%" Px "\n",
                    reinterpret_cast<intptr_t>(this));
     }
@@ -419,15 +413,13 @@
 
   // Visit all object pointers stored in the various handles.
   void VisitObjectPointers(ObjectPointerVisitor* visitor) {
-    Handles<kLocalHandleSizeInWords,
-            kLocalHandlesPerChunk,
+    Handles<kLocalHandleSizeInWords, kLocalHandlesPerChunk,
             kOffsetOfRawPtrInLocalHandle>::VisitObjectPointers(visitor);
   }
 
   // Reset the local handles block for reuse.
   void Reset() {
-    Handles<kLocalHandleSizeInWords,
-            kLocalHandlesPerChunk,
+    Handles<kLocalHandleSizeInWords, kLocalHandlesPerChunk,
             kOffsetOfRawPtrInLocalHandle>::Reset();
   }
 
@@ -444,9 +436,7 @@
   }
 
   // Returns a count of active handles (used for testing purposes).
-  int CountHandles() const {
-    return CountScopedHandles();
-  }
+  int CountHandles() const { return CountScopedHandles(); }
 
  private:
   DISALLOW_COPY_AND_ASSIGN(LocalHandles);
@@ -462,9 +452,10 @@
                                   kPersistentHandlesPerChunk,
                                   kOffsetOfRawPtrInPersistentHandle> {
  public:
-  PersistentHandles() : Handles<kPersistentHandleSizeInWords,
-                                kPersistentHandlesPerChunk,
-                                kOffsetOfRawPtrInPersistentHandle>(),
+  PersistentHandles()
+      : Handles<kPersistentHandleSizeInWords,
+                kPersistentHandlesPerChunk,
+                kOffsetOfRawPtrInPersistentHandle>(),
         free_list_(NULL) {
     if (FLAG_trace_handles) {
       OS::PrintErr("*** Starting a new Persistent handle block 0x%" Px "\n",
@@ -475,8 +466,7 @@
     free_list_ = NULL;
     if (FLAG_trace_handles) {
       OS::PrintErr("***   Handle Counts for 0x(%" Px "):Scoped = %d\n",
-                   reinterpret_cast<intptr_t>(this),
-                   CountHandles());
+                   reinterpret_cast<intptr_t>(this), CountHandles());
       OS::PrintErr("*** Deleting Persistent handle block 0x%" Px "\n",
                    reinterpret_cast<intptr_t>(this));
     }
@@ -488,15 +478,13 @@
 
   // Visit all object pointers stored in the various handles.
   void VisitObjectPointers(ObjectPointerVisitor* visitor) {
-    Handles<kPersistentHandleSizeInWords,
-            kPersistentHandlesPerChunk,
+    Handles<kPersistentHandleSizeInWords, kPersistentHandlesPerChunk,
             kOffsetOfRawPtrInPersistentHandle>::VisitObjectPointers(visitor);
   }
 
   // Visit all the handles.
   void Visit(HandleVisitor* visitor) {
-    Handles<kPersistentHandleSizeInWords,
-            kPersistentHandlesPerChunk,
+    Handles<kPersistentHandleSizeInWords, kPersistentHandlesPerChunk,
             kOffsetOfRawPtrInPersistentHandle>::Visit(visitor);
   }
 
@@ -525,9 +513,7 @@
   }
 
   // Returns a count of active handles (used for testing purposes).
-  int CountHandles() const {
-    return CountScopedHandles();
-  }
+  int CountHandles() const { return CountScopedHandles(); }
 
  private:
   PersistentHandle* free_list_;
@@ -537,7 +523,7 @@
 
 // Finalizable persistent handles repository structure.
 static const int kFinalizablePersistentHandleSizeInWords =
-     sizeof(FinalizablePersistentHandle) / kWordSize;
+    sizeof(FinalizablePersistentHandle) / kWordSize;
 static const int kFinalizablePersistentHandlesPerChunk = 64;
 static const int kOffsetOfRawPtrInFinalizablePersistentHandle = 0;
 class FinalizablePersistentHandles
@@ -549,7 +535,8 @@
       : Handles<kFinalizablePersistentHandleSizeInWords,
                 kFinalizablePersistentHandlesPerChunk,
                 kOffsetOfRawPtrInFinalizablePersistentHandle>(),
-      free_list_(NULL), mutex_(new Mutex()) { }
+        free_list_(NULL),
+        mutex_(new Mutex()) {}
   ~FinalizablePersistentHandles() {
     free_list_ = NULL;
     delete mutex_;
@@ -564,16 +551,15 @@
   void VisitHandles(HandleVisitor* visitor) {
     Handles<kFinalizablePersistentHandleSizeInWords,
             kFinalizablePersistentHandlesPerChunk,
-            kOffsetOfRawPtrInFinalizablePersistentHandle>::Visit(
-                visitor);
+            kOffsetOfRawPtrInFinalizablePersistentHandle>::Visit(visitor);
   }
 
   // Visit all object pointers stored in the various handles.
   void VisitObjectPointers(ObjectPointerVisitor* visitor) {
     Handles<kFinalizablePersistentHandleSizeInWords,
             kFinalizablePersistentHandlesPerChunk,
-            kOffsetOfRawPtrInFinalizablePersistentHandle>::VisitObjectPointers(
-                visitor);
+            kOffsetOfRawPtrInFinalizablePersistentHandle>::
+        VisitObjectPointers(visitor);
   }
 
   // Allocates a persistent handle, these have to be destroyed explicitly
@@ -590,8 +576,8 @@
       }
     }
 
-    handle = reinterpret_cast<FinalizablePersistentHandle*>(
-          AllocateScopedHandle());
+    handle =
+        reinterpret_cast<FinalizablePersistentHandle*>(AllocateScopedHandle());
     handle->Clear();
     return handle;
   }
@@ -609,9 +595,7 @@
   }
 
   // Returns a count of active handles (used for testing purposes).
-  int CountHandles() const {
-    return CountScopedHandles();
-  }
+  int CountHandles() const { return CountScopedHandles(); }
 
  private:
   FinalizablePersistentHandle* free_list_;
@@ -624,11 +608,9 @@
 // These local scopes manage handles and memory allocated in the scope.
 class ApiLocalScope {
  public:
-  ApiLocalScope(ApiLocalScope* previous, uword stack_marker) :
-      previous_(previous), stack_marker_(stack_marker) { }
-  ~ApiLocalScope() {
-    previous_ = NULL;
-  }
+  ApiLocalScope(ApiLocalScope* previous, uword stack_marker)
+      : previous_(previous), stack_marker_(stack_marker) {}
+  ~ApiLocalScope() { previous_ = NULL; }
 
   // Reinit the ApiLocalScope to new values.
   void Reinit(Thread* thread, ApiLocalScope* previous, uword stack_marker) {
@@ -668,7 +650,7 @@
     // Currently no support for nesting native scopes.
     ASSERT(Current() == NULL);
     OSThread::SetThreadLocal(Api::api_native_key_,
-                                reinterpret_cast<uword>(this));
+                             reinterpret_cast<uword>(this));
   }
 
   ~ApiNativeScope() {
@@ -697,16 +679,14 @@
 // picks the zone from the current isolate if in an isolate
 // environment. When outside an isolate environment it picks the zone
 // from the current native scope.
-template<typename T>
+template <typename T>
 class ApiGrowableArray : public BaseGrowableArray<T, ValueObject> {
  public:
   explicit ApiGrowableArray(int initial_capacity)
-      : BaseGrowableArray<T, ValueObject>(
-          initial_capacity,
-          ApiNativeScope::Current()->zone()) {}
+      : BaseGrowableArray<T, ValueObject>(initial_capacity,
+                                          ApiNativeScope::Current()->zone()) {}
   ApiGrowableArray()
-      : BaseGrowableArray<T, ValueObject>(
-          ApiNativeScope::Current()->zone()) {}
+      : BaseGrowableArray<T, ValueObject>(ApiNativeScope::Current()->zone()) {}
   ApiGrowableArray(intptr_t initial_capacity, Zone* zone)
       : BaseGrowableArray<T, ValueObject>(initial_capacity, zone) {}
 };
@@ -717,12 +697,13 @@
 // basis and destroyed when the isolate is shutdown.
 class ApiState {
  public:
-  ApiState() : persistent_handles_(),
-               weak_persistent_handles_(),
-               null_(NULL),
-               true_(NULL),
-               false_(NULL),
-               acquired_error_(NULL) {}
+  ApiState()
+      : persistent_handles_(),
+        weak_persistent_handles_(),
+        null_(NULL),
+        true_(NULL),
+        false_(NULL),
+        acquired_error_(NULL) {}
   ~ApiState() {
     if (null_ != NULL) {
       persistent_handles().FreeHandle(null_);
@@ -826,4 +807,4 @@
 
 }  // namespace dart
 
-#endif  // VM_DART_API_STATE_H_
+#endif  // RUNTIME_VM_DART_API_STATE_H_
diff --git a/runtime/vm/dart_entry.cc b/runtime/vm/dart_entry.cc
index f78dc3c..3346bef 100644
--- a/runtime/vm/dart_entry.cc
+++ b/runtime/vm/dart_entry.cc
@@ -71,8 +71,7 @@
 class SuspendLongJumpScope : public StackResource {
  public:
   explicit SuspendLongJumpScope(Thread* thread)
-      : StackResource(thread),
-        saved_long_jump_base_(thread->long_jump_base()) {
+      : StackResource(thread), saved_long_jump_base_(thread->long_jump_base()) {
     thread->set_long_jump_base(NULL);
   }
 
@@ -96,13 +95,13 @@
   Zone* zone = thread->zone();
   ASSERT(thread->IsMutatorThread());
   if (!function.HasCode()) {
-    const Error& error = Error::Handle(
-        zone, Compiler::CompileFunction(thread, function));
+    const Error& error =
+        Error::Handle(zone, Compiler::CompileFunction(thread, function));
     if (!error.IsNull()) {
       return error.raw();
     }
   }
-  // Now Call the invoke stub which will invoke the dart function.
+// Now Call the invoke stub which will invoke the dart function.
 #if !defined(TARGET_ARCH_DBC)
   invokestub entrypoint = reinterpret_cast<invokestub>(
       StubCode::InvokeDartCode_entry()->EntryPoint());
@@ -114,22 +113,16 @@
   SuspendLongJumpScope suspend_long_jump_scope(thread);
   TransitionToGenerated transition(thread);
 #if defined(TARGET_ARCH_DBC)
-  return Simulator::Current()->Call(code,
-                                    arguments_descriptor,
-                                    arguments,
+  return Simulator::Current()->Call(code, arguments_descriptor, arguments,
                                     thread);
 #elif defined(USING_SIMULATOR)
   return bit_copy<RawObject*, int64_t>(Simulator::Current()->Call(
-      reinterpret_cast<intptr_t>(entrypoint),
-      reinterpret_cast<intptr_t>(&code),
+      reinterpret_cast<intptr_t>(entrypoint), reinterpret_cast<intptr_t>(&code),
       reinterpret_cast<intptr_t>(&arguments_descriptor),
       reinterpret_cast<intptr_t>(&arguments),
       reinterpret_cast<intptr_t>(thread)));
 #else
-  return entrypoint(code,
-                    arguments_descriptor,
-                    arguments,
-                    thread);
+  return entrypoint(code, arguments_descriptor, arguments, thread);
 #endif
 }
 
@@ -155,8 +148,7 @@
     // Only invoke the function if its arguments are compatible.
     const ArgumentsDescriptor args_desc(arguments_descriptor);
     if (function.AreValidArgumentCounts(args_desc.Count(),
-                                        args_desc.NamedCount(),
-                                        NULL)) {
+                                        args_desc.NamedCount(), NULL)) {
       // The closure or non-closure object (receiver) is passed as implicit
       // first argument. It is already included in the arguments array.
       return InvokeFunction(function, arguments, arguments_descriptor);
@@ -184,15 +176,14 @@
 
         if (c_stack_pos < c_stack_limit) {
           const Instance& exception =
-            Instance::Handle(zone, isolate->object_store()->stack_overflow());
+              Instance::Handle(zone, isolate->object_store()->stack_overflow());
           return UnhandledException::New(exception, Stacktrace::Handle(zone));
         }
 
         const Array& getter_arguments = Array::Handle(zone, Array::New(1));
         getter_arguments.SetAt(0, instance);
-        const Object& getter_result =
-              Object::Handle(zone, DartEntry::InvokeFunction(function,
-                                                       getter_arguments));
+        const Object& getter_result = Object::Handle(
+            zone, DartEntry::InvokeFunction(function, getter_arguments));
         if (getter_result.IsError()) {
           return getter_result.raw();
         }
@@ -202,8 +193,8 @@
         // This otherwise unnecessary handle is used to prevent clang from
         // doing tail call elimination, which would make the stack overflow
         // check above ineffective.
-        Object& result = Object::Handle(zone,
-            InvokeClosure(arguments, arguments_descriptor));
+        Object& result = Object::Handle(
+            zone, InvokeClosure(arguments, arguments_descriptor));
         return result.raw();
       }
       cls = cls.SuperClass();
@@ -211,9 +202,7 @@
   }
 
   // No compatible method or getter so invoke noSuchMethod.
-  return InvokeNoSuchMethod(instance,
-                            Symbols::Call(),
-                            arguments,
+  return InvokeNoSuchMethod(instance, Symbols::Call(), arguments,
                             arguments_descriptor);
 }
 
@@ -226,9 +215,8 @@
   // Allocate an Invocation object.
   const Library& core_lib = Library::Handle(Library::CoreLibrary());
 
-  Class& invocation_mirror_class = Class::Handle(
-      core_lib.LookupClass(
-          String::Handle(core_lib.PrivateName(Symbols::InvocationMirror()))));
+  Class& invocation_mirror_class = Class::Handle(core_lib.LookupClass(
+      String::Handle(core_lib.PrivateName(Symbols::InvocationMirror()))));
   ASSERT(!invocation_mirror_class.IsNull());
   const String& function_name =
       String::Handle(core_lib.PrivateName(Symbols::AllocateInvocationMirror()));
@@ -241,8 +229,8 @@
   allocation_args.SetAt(1, arguments_descriptor);
   allocation_args.SetAt(2, arguments);
   allocation_args.SetAt(3, Bool::False());  // Not a super invocation.
-  const Object& invocation_mirror = Object::Handle(
-      InvokeFunction(allocation_function, allocation_args));
+  const Object& invocation_mirror =
+      Object::Handle(InvokeFunction(allocation_function, allocation_args));
   if (invocation_mirror.IsError()) {
     Exceptions::PropagateError(Error::Cast(invocation_mirror));
     UNREACHABLE();
@@ -253,9 +241,7 @@
   ArgumentsDescriptor args_desc(
       Array::Handle(ArgumentsDescriptor::New(kNumArguments)));
   Function& function = Function::Handle(
-      Resolver::ResolveDynamic(receiver,
-                               Symbols::NoSuchMethod(),
-                               args_desc));
+      Resolver::ResolveDynamic(receiver, Symbols::NoSuchMethod(), args_desc));
   if (function.IsNull()) {
     ASSERT(!FLAG_lazy_dispatchers);
     // If noSuchMethod(invocation) is not found, call Object::noSuchMethod.
@@ -263,8 +249,7 @@
     function ^= Resolver::ResolveDynamicForReceiverClass(
         Class::Handle(thread->zone(),
                       thread->isolate()->object_store()->object_class()),
-        Symbols::NoSuchMethod(),
-        args_desc);
+        Symbols::NoSuchMethod(), args_desc);
   }
   ASSERT(!function.IsNull());
   const Array& args = Array::Handle(Array::New(kNumArguments));
@@ -274,9 +259,7 @@
 }
 
 
-ArgumentsDescriptor::ArgumentsDescriptor(const Array& array)
-    : array_(array) {
-}
+ArgumentsDescriptor::ArgumentsDescriptor(const Array& array) : array_(array) {}
 
 
 intptr_t ArgumentsDescriptor::Count() const {
@@ -290,15 +273,21 @@
 
 
 RawString* ArgumentsDescriptor::NameAt(intptr_t index) const {
-  const intptr_t offset = kFirstNamedEntryIndex +
-                          (index * kNamedEntrySize) +
-                          kNameOffset;
+  const intptr_t offset =
+      kFirstNamedEntryIndex + (index * kNamedEntrySize) + kNameOffset;
   String& result = String::Handle();
   result ^= array_.At(offset);
   return result.raw();
 }
 
 
+intptr_t ArgumentsDescriptor::PositionAt(intptr_t index) const {
+  const intptr_t offset =
+      kFirstNamedEntryIndex + (index * kNamedEntrySize) + kPositionOffset;
+  return Smi::Value(Smi::RawCast(array_.At(offset)));
+}
+
+
 bool ArgumentsDescriptor::MatchesNameAt(intptr_t index,
                                         const String& other) const {
   return NameAt(index) == other.raw();
@@ -336,8 +325,8 @@
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
   const intptr_t descriptor_len = LengthFor(num_named_args);
-  Array& descriptor = Array::Handle(
-      zone, Array::New(descriptor_len, Heap::kOld));
+  Array& descriptor =
+      Array::Handle(zone, Array::New(descriptor_len, Heap::kOld));
 
   // Set total number of passed arguments.
   descriptor.SetAt(kCountIndex, Smi::Handle(Smi::New(num_arguments)));
@@ -396,8 +385,8 @@
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
   const intptr_t descriptor_len = LengthFor(0);
-  Array& descriptor = Array::Handle(
-      zone, Array::New(descriptor_len, Heap::kOld));
+  Array& descriptor =
+      Array::Handle(zone, Array::New(descriptor_len, Heap::kOld));
   const Smi& arg_count = Smi::Handle(zone, Smi::New(num_arguments));
 
   // Set total number of passed arguments.
@@ -436,7 +425,7 @@
   const int kNumExtraArgs = 1;  // implicit rcvr arg.
   const Instance& exception_object = Instance::Handle(Instance::New(cls));
   const Array& constructor_arguments =
-    Array::Handle(Array::New(arguments.Length() + kNumExtraArgs));
+      Array::Handle(Array::New(arguments.Length() + kNumExtraArgs));
   constructor_arguments.SetAt(0, exception_object);
   Object& obj = Object::Handle();
   for (intptr_t i = 0; i < arguments.Length(); i++) {
@@ -444,14 +433,13 @@
     constructor_arguments.SetAt((i + kNumExtraArgs), obj);
   }
 
-  const String& function_name = String::Handle(
-      String::Concat(class_name, constructor_name));
+  const String& function_name =
+      String::Handle(String::Concat(class_name, constructor_name));
   const Function& constructor =
       Function::Handle(cls.LookupConstructorAllowPrivate(function_name));
   ASSERT(!constructor.IsNull());
-  const Object& retval =
-    Object::Handle(DartEntry::InvokeFunction(constructor,
-                                             constructor_arguments));
+  const Object& retval = Object::Handle(
+      DartEntry::InvokeFunction(constructor, constructor_arguments));
   ASSERT(retval.IsNull() || retval.IsError());
   if (retval.IsError()) {
     return retval.raw();
@@ -465,14 +453,12 @@
   ArgumentsDescriptor args_desc(
       Array::Handle(ArgumentsDescriptor::New(kNumArguments)));
   const Function& function = Function::Handle(
-      Resolver::ResolveDynamic(receiver,
-                               Symbols::toString(),
-                               args_desc));
+      Resolver::ResolveDynamic(receiver, Symbols::toString(), args_desc));
   ASSERT(!function.IsNull());
   const Array& args = Array::Handle(Array::New(kNumArguments));
   args.SetAt(0, receiver);
-  const Object& result = Object::Handle(DartEntry::InvokeFunction(function,
-                                                                  args));
+  const Object& result =
+      Object::Handle(DartEntry::InvokeFunction(function, args));
   ASSERT(result.IsInstance() || result.IsError());
   return result.raw();
 }
@@ -483,14 +469,12 @@
   ArgumentsDescriptor args_desc(
       Array::Handle(ArgumentsDescriptor::New(kNumArguments)));
   const Function& function = Function::Handle(
-      Resolver::ResolveDynamic(receiver,
-                               Symbols::hashCode(),
-                               args_desc));
+      Resolver::ResolveDynamic(receiver, Symbols::hashCode(), args_desc));
   ASSERT(!function.IsNull());
   const Array& args = Array::Handle(Array::New(kNumArguments));
   args.SetAt(0, receiver);
-  const Object& result = Object::Handle(DartEntry::InvokeFunction(function,
-                                                                  args));
+  const Object& result =
+      Object::Handle(DartEntry::InvokeFunction(function, args));
   ASSERT(result.IsInstance() || result.IsError());
   return result.raw();
 }
@@ -502,16 +486,14 @@
   ArgumentsDescriptor args_desc(
       Array::Handle(ArgumentsDescriptor::New(kNumArguments)));
   const Function& function = Function::Handle(
-      Resolver::ResolveDynamic(left,
-                               Symbols::EqualOperator(),
-                               args_desc));
+      Resolver::ResolveDynamic(left, Symbols::EqualOperator(), args_desc));
   ASSERT(!function.IsNull());
 
   const Array& args = Array::Handle(Array::New(kNumArguments));
   args.SetAt(0, left);
   args.SetAt(1, right);
-  const Object& result = Object::Handle(DartEntry::InvokeFunction(function,
-                                                                  args));
+  const Object& result =
+      Object::Handle(DartEntry::InvokeFunction(function, args));
   ASSERT(result.IsInstance() || result.IsError());
   return result.raw();
 }
@@ -519,8 +501,8 @@
 
 RawObject* DartLibraryCalls::LookupHandler(Dart_Port port_id) {
   Thread* thread = Thread::Current();
-  Function& function = Function::Handle(thread->zone(),
-      thread->isolate()->object_store()->lookup_port_handler());
+  Function& function = Function::Handle(
+      thread->zone(), thread->isolate()->object_store()->lookup_port_handler());
   const int kNumArguments = 1;
   if (function.IsNull()) {
     Library& isolate_lib = Library::Handle(Library::IsolateLibrary());
@@ -529,11 +511,8 @@
         String::Handle(isolate_lib.PrivateName(Symbols::_RawReceivePortImpl()));
     const String& function_name =
         String::Handle(isolate_lib.PrivateName(Symbols::_lookupHandler()));
-    function = Resolver::ResolveStatic(isolate_lib,
-                                       class_name,
-                                       function_name,
-                                       kNumArguments,
-                                       Object::empty_array());
+    function = Resolver::ResolveStatic(isolate_lib, class_name, function_name,
+                                       kNumArguments, Object::empty_array());
     ASSERT(!function.IsNull());
     thread->isolate()->object_store()->set_lookup_port_handler(function);
   }
@@ -550,21 +529,18 @@
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
   Isolate* isolate = thread->isolate();
-  Function& function = Function::Handle(zone,
-      isolate->object_store()->handle_message_function());
+  Function& function = Function::Handle(
+      zone, isolate->object_store()->handle_message_function());
   const int kNumArguments = 2;
   if (function.IsNull()) {
     Library& isolate_lib = Library::Handle(zone, Library::IsolateLibrary());
     ASSERT(!isolate_lib.IsNull());
-    const String& class_name = String::Handle(zone,
-        isolate_lib.PrivateName(Symbols::_RawReceivePortImpl()));
-    const String& function_name = String::Handle(zone,
-        isolate_lib.PrivateName(Symbols::_handleMessage()));
-    function = Resolver::ResolveStatic(isolate_lib,
-                                       class_name,
-                                       function_name,
-                                       kNumArguments,
-                                       Object::empty_array());
+    const String& class_name = String::Handle(
+        zone, isolate_lib.PrivateName(Symbols::_RawReceivePortImpl()));
+    const String& function_name = String::Handle(
+        zone, isolate_lib.PrivateName(Symbols::_handleMessage()));
+    function = Resolver::ResolveStatic(isolate_lib, class_name, function_name,
+                                       kNumArguments, Object::empty_array());
     ASSERT(!function.IsNull());
     isolate->object_store()->set_handle_message_function(function);
   }
@@ -577,8 +553,8 @@
     // at the first location the user is interested in.
     isolate->debugger()->SetSingleStep();
   }
-  const Object& result = Object::Handle(zone,
-      DartEntry::InvokeFunction(function, args));
+  const Object& result =
+      Object::Handle(zone, DartEntry::InvokeFunction(function, args));
   ASSERT(result.IsNull() || result.IsError());
   return result.raw();
 }
@@ -588,11 +564,11 @@
   Zone* zone = Thread::Current()->zone();
   Library& isolate_lib = Library::Handle(zone, Library::IsolateLibrary());
   ASSERT(!isolate_lib.IsNull());
-  Function& function = Function::Handle(zone,
-      isolate_lib.LookupFunctionAllowPrivate(
-          Symbols::_runPendingImmediateCallback()));
-  const Object& result = Object::Handle(zone,
-      DartEntry::InvokeFunction(function, Object::empty_array()));
+  Function& function =
+      Function::Handle(zone, isolate_lib.LookupFunctionAllowPrivate(
+                                 Symbols::_runPendingImmediateCallback()));
+  const Object& result = Object::Handle(
+      zone, DartEntry::InvokeFunction(function, Object::empty_array()));
   ASSERT(result.IsNull() || result.IsError());
   return result.raw();
 }
@@ -605,16 +581,14 @@
   ArgumentsDescriptor args_desc(
       Array::Handle(ArgumentsDescriptor::New(kNumArguments)));
   const Function& function = Function::Handle(
-      Resolver::ResolveDynamic(map,
-                               Symbols::AssignIndexToken(),
-                               args_desc));
+      Resolver::ResolveDynamic(map, Symbols::AssignIndexToken(), args_desc));
   ASSERT(!function.IsNull());
   const Array& args = Array::Handle(Array::New(kNumArguments));
   args.SetAt(0, map);
   args.SetAt(1, key);
   args.SetAt(2, value);
-  const Object& result = Object::Handle(DartEntry::InvokeFunction(function,
-                                                                  args));
+  const Object& result =
+      Object::Handle(DartEntry::InvokeFunction(function, args));
   return result.raw();
 }
 
diff --git a/runtime/vm/dart_entry.h b/runtime/vm/dart_entry.h
index e52961b..2a52eec 100644
--- a/runtime/vm/dart_entry.h
+++ b/runtime/vm/dart_entry.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_DART_ENTRY_H_
-#define VM_DART_ENTRY_H_
+#ifndef RUNTIME_VM_DART_ENTRY_H_
+#define RUNTIME_VM_DART_ENTRY_H_
 
 #include "vm/allocation.h"
 #include "vm/growable_array.h"
@@ -37,6 +37,7 @@
   intptr_t PositionalCount() const;
   intptr_t NamedCount() const { return Count() - PositionalCount(); }
   RawString* NameAt(intptr_t i) const;
+  intptr_t PositionAt(intptr_t i) const;
   bool MatchesNameAt(intptr_t i, const String& other) const;
 
   // Generated code support.
@@ -50,8 +51,7 @@
   // Allocate and return an arguments descriptor.  The first
   // (count - optional_arguments_names.Length()) arguments are
   // positional and the remaining ones are named optional arguments.
-  static RawArray* New(intptr_t count,
-                       const Array& optional_arguments_names);
+  static RawArray* New(intptr_t count, const Array& optional_arguments_names);
 
   // Allocate and return an arguments descriptor that has no optional
   // arguments. All arguments are positional.
@@ -60,9 +60,7 @@
   // Initialize the preallocated fixed length arguments descriptors cache.
   static void InitOnce();
 
-  enum {
-    kCachedDescriptorCount = 32
-  };
+  enum { kCachedDescriptorCount = 32 };
 
  private:
   // Absolute indexes into the array.
@@ -88,15 +86,11 @@
 
   // Used by Simulator to parse argument descriptors.
   static intptr_t name_index(intptr_t index) {
-    return kFirstNamedEntryIndex +
-           (index * kNamedEntrySize) +
-           kNameOffset;
+    return kFirstNamedEntryIndex + (index * kNamedEntrySize) + kNameOffset;
   }
 
   static intptr_t position_index(intptr_t index) {
-    return kFirstNamedEntryIndex +
-           (index * kNamedEntrySize) +
-           kPositionOffset;
+    return kFirstNamedEntryIndex + (index * kNamedEntrySize) + kPositionOffset;
   }
 
   const Array& array_;
@@ -194,4 +188,4 @@
 
 }  // namespace dart
 
-#endif  // VM_DART_ENTRY_H_
+#endif  // RUNTIME_VM_DART_ENTRY_H_
diff --git a/runtime/vm/dart_entry_test.cc b/runtime/vm/dart_entry_test.cc
index d075819..eb694cf 100644
--- a/runtime/vm/dart_entry_test.cc
+++ b/runtime/vm/dart_entry_test.cc
@@ -23,14 +23,13 @@
       "}\n";
   String& url = String::Handle(String::New("dart-test:DartEntry"));
   String& source = String::Handle(String::New(kScriptChars));
-  Script& script = Script::Handle(Script::New(url,
-                                              source,
-                                              RawScript::kScriptTag));
+  Script& script =
+      Script::Handle(Script::New(url, source, RawScript::kScriptTag));
   Library& lib = Library::Handle(Library::CoreLibrary());
   EXPECT_EQ(true, CompilerTest::TestCompileScript(lib, script));
   EXPECT(ClassFinalizer::ProcessPendingClasses());
-  Class& cls = Class::Handle(
-      lib.LookupClass(String::Handle(Symbols::New(thread, "A"))));
+  Class& cls =
+      Class::Handle(lib.LookupClass(String::Handle(Symbols::New(thread, "A"))));
   EXPECT(!cls.IsNull());  // No ambiguity error expected.
   String& name = String::Handle(String::New("foo"));
   Function& function = Function::Handle(cls.LookupStaticFunction(name));
@@ -51,14 +50,13 @@
       "}\n";
   String& url = String::Handle(String::New("dart-test:DartEntry"));
   String& source = String::Handle(String::New(kScriptChars));
-  Script& script = Script::Handle(Script::New(url,
-                                              source,
-                                              RawScript::kScriptTag));
+  Script& script =
+      Script::Handle(Script::New(url, source, RawScript::kScriptTag));
   Library& lib = Library::Handle(Library::CoreLibrary());
   EXPECT_EQ(true, CompilerTest::TestCompileScript(lib, script));
   EXPECT(ClassFinalizer::ProcessPendingClasses());
-  Class& cls = Class::Handle(
-      lib.LookupClass(String::Handle(Symbols::New(thread, "A"))));
+  Class& cls =
+      Class::Handle(lib.LookupClass(String::Handle(Symbols::New(thread, "A"))));
   EXPECT(!cls.IsNull());  // No ambiguity error expected.
   String& name = String::Handle(String::New("foo"));
   Function& function = Function::Handle(cls.LookupStaticFunction(name));
@@ -77,14 +75,13 @@
       "}\n";
   String& url = String::Handle(String::New("dart-test:DartEntry"));
   String& source = String::Handle(String::New(kScriptChars));
-  Script& script = Script::Handle(Script::New(url,
-                                              source,
-                                              RawScript::kScriptTag));
+  Script& script =
+      Script::Handle(Script::New(url, source, RawScript::kScriptTag));
   Library& lib = Library::Handle(Library::CoreLibrary());
   EXPECT_EQ(true, CompilerTest::TestCompileScript(lib, script));
   EXPECT(ClassFinalizer::ProcessPendingClasses());
-  Class& cls = Class::Handle(
-      lib.LookupClass(String::Handle(Symbols::New(thread, "A"))));
+  Class& cls =
+      Class::Handle(lib.LookupClass(String::Handle(Symbols::New(thread, "A"))));
   EXPECT(!cls.IsNull());  // No ambiguity error expected.
 
   // Invoke the constructor.
@@ -93,7 +90,7 @@
   constructor_arguments.SetAt(0, instance);
   String& constructor_name = String::Handle(Symbols::New(thread, "A."));
   Function& constructor =
-    Function::Handle(cls.LookupConstructor(constructor_name));
+      Function::Handle(cls.LookupConstructor(constructor_name));
   ASSERT(!constructor.IsNull());
   DartEntry::InvokeFunction(constructor, constructor_arguments);
 
@@ -103,8 +100,8 @@
   EXPECT(!function.IsNull());
   const Array& args = Array::Handle(Array::New(1));
   args.SetAt(0, instance);
-  const Object& retval = Object::Handle(DartEntry::InvokeFunction(function,
-                                                                  args));
+  const Object& retval =
+      Object::Handle(DartEntry::InvokeFunction(function, args));
   EXPECT(retval.IsError());
   EXPECT_SUBSTRING("++++", Error::Cast(retval).ToErrorCString());
 }
diff --git a/runtime/vm/datastream.h b/runtime/vm/datastream.h
index 58452a0..3b714b7 100644
--- a/runtime/vm/datastream.h
+++ b/runtime/vm/datastream.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_DATASTREAM_H_
-#define VM_DATASTREAM_H_
+#ifndef RUNTIME_VM_DATASTREAM_H_
+#define RUNTIME_VM_DATASTREAM_H_
 
 #include "platform/assert.h"
 #include "platform/utils.h"
@@ -27,9 +27,8 @@
 // Stream for reading various types from a buffer.
 class ReadStream : public ValueObject {
  public:
-  ReadStream(const uint8_t* buffer, intptr_t size) : buffer_(buffer),
-                                                     current_(buffer),
-                                                     end_(buffer + size)  {}
+  ReadStream(const uint8_t* buffer, intptr_t size)
+      : buffer_(buffer), current_(buffer), end_(buffer + size) {}
 
   void SetStream(const uint8_t* buffer, intptr_t size) {
     buffer_ = buffer;
@@ -37,39 +36,31 @@
     end_ = buffer + size;
   }
 
-  template<int N, typename T>
-  class Raw { };
+  template <int N, typename T>
+  class Raw {};
 
-  template<typename T>
+  template <typename T>
   class Raw<1, T> {
    public:
-    static T Read(ReadStream* st) {
-      return bit_cast<T>(st->ReadByte());
-    }
+    static T Read(ReadStream* st) { return bit_cast<T>(st->ReadByte()); }
   };
 
-  template<typename T>
+  template <typename T>
   class Raw<2, T> {
    public:
-    static T Read(ReadStream* st) {
-      return bit_cast<T>(st->Read16());
-    }
+    static T Read(ReadStream* st) { return bit_cast<T>(st->Read16()); }
   };
 
-  template<typename T>
+  template <typename T>
   class Raw<4, T> {
    public:
-    static T Read(ReadStream* st) {
-      return bit_cast<T>(st->Read32());
-    }
+    static T Read(ReadStream* st) { return bit_cast<T>(st->Read32()); }
   };
 
-  template<typename T>
+  template <typename T>
   class Raw<8, T> {
    public:
-    static T Read(ReadStream* st) {
-      return bit_cast<T>(st->Read64());
-    }
+    static T Read(ReadStream* st) { return bit_cast<T>(st->Read64()); }
   };
 
   // Reads 'len' bytes from the stream.
@@ -79,9 +70,7 @@
     current_ += len;
   }
 
-  intptr_t ReadUnsigned() {
-    return Read<intptr_t>(kEndUnsignedByteMarker);
-  }
+  intptr_t ReadUnsigned() { return Read<intptr_t>(kEndUnsignedByteMarker); }
 
   intptr_t Position() const { return current_ - buffer_; }
 
@@ -90,9 +79,7 @@
     current_ = buffer_ + value;
   }
 
-  const uint8_t* AddressOfCurrentPosition() const {
-    return current_;
-  }
+  const uint8_t* AddressOfCurrentPosition() const { return current_; }
 
   void Advance(intptr_t value) {
     ASSERT((end_ - current_) > value);
@@ -105,24 +92,18 @@
   }
 
  private:
-  template<typename T>
+  template <typename T>
   T Read() {
     return Read<T>(kEndByteMarker);
   }
 
-  int16_t Read16() {
-    return Read16(kEndByteMarker);
-  }
+  int16_t Read16() { return Read16(kEndByteMarker); }
 
-  int32_t Read32() {
-    return Read32(kEndByteMarker);
-  }
+  int32_t Read32() { return Read32(kEndByteMarker); }
 
-  int64_t Read64() {
-    return Read64(kEndByteMarker);
-  }
+  int64_t Read64() { return Read64(kEndByteMarker); }
 
-  template<typename T>
+  template <typename T>
   T Read(uint8_t end_byte_marker) {
     const uint8_t* c = current_;
     ASSERT(c < end_);
@@ -309,18 +290,16 @@
 // Stream for writing various types into a buffer.
 class WriteStream : public ValueObject {
  public:
-  WriteStream(uint8_t** buffer, ReAlloc alloc, intptr_t initial_size) :
-      buffer_(buffer),
-      end_(NULL),
-      current_(NULL),
-      current_size_(0),
-      alloc_(alloc),
-      initial_size_(initial_size) {
+  WriteStream(uint8_t** buffer, ReAlloc alloc, intptr_t initial_size)
+      : buffer_(buffer),
+        end_(NULL),
+        current_(NULL),
+        current_size_(0),
+        alloc_(alloc),
+        initial_size_(initial_size) {
     ASSERT(buffer != NULL);
     ASSERT(alloc != NULL);
-    *buffer_ = reinterpret_cast<uint8_t*>(alloc_(NULL,
-                                                 0,
-                                                 initial_size_));
+    *buffer_ = reinterpret_cast<uint8_t*>(alloc_(NULL, 0, initial_size_));
     if (*buffer_ == NULL) {
       Exceptions::ThrowOOM();
     }
@@ -334,10 +313,10 @@
 
   void set_current(uint8_t* value) { current_ = value; }
 
-  template<int N, typename T>
-  class Raw { };
+  template <int N, typename T>
+  class Raw {};
 
-  template<typename T>
+  template <typename T>
   class Raw<1, T> {
    public:
     static void Write(WriteStream* st, T value) {
@@ -345,7 +324,7 @@
     }
   };
 
-  template<typename T>
+  template <typename T>
   class Raw<2, T> {
    public:
     static void Write(WriteStream* st, T value) {
@@ -353,7 +332,7 @@
     }
   };
 
-  template<typename T>
+  template <typename T>
   class Raw<4, T> {
    public:
     static void Write(WriteStream* st, T value) {
@@ -361,7 +340,7 @@
     }
   };
 
-  template<typename T>
+  template <typename T>
   class Raw<8, T> {
    public:
     static void Write(WriteStream* st, T value) {
@@ -404,11 +383,10 @@
   }
 
  private:
-  template<typename T>
+  template <typename T>
   void Write(T value) {
     T v = value;
-    while (v < kMinDataPerByte ||
-           v > kMaxDataPerByte) {
+    while (v < kMinDataPerByte || v > kMaxDataPerByte) {
       WriteByte(static_cast<uint8_t>(v & kByteMask));
       v = v >> kDataBitsPerByte;
     }
@@ -431,9 +409,8 @@
     }
     intptr_t new_size = current_size_ + increment_size;
     ASSERT(new_size > current_size_);
-    *buffer_ = reinterpret_cast<uint8_t*>(alloc_(*buffer_,
-                                                 current_size_,
-                                                 new_size));
+    *buffer_ =
+        reinterpret_cast<uint8_t*>(alloc_(*buffer_, current_size_, new_size));
     if (*buffer_ == NULL) {
       Exceptions::ThrowOOM();
     }
@@ -459,8 +436,8 @@
     // Print.
     va_list print_args;
     va_copy(print_args, args);
-    OS::VSNPrint(reinterpret_cast<char*>(current_),
-                 len + 1, format, print_args);
+    OS::VSNPrint(reinterpret_cast<char*>(current_), len + 1, format,
+                 print_args);
     va_end(print_args);
     current_ += len;  // Not len + 1 to swallow the terminating NUL.
   }
@@ -478,4 +455,4 @@
 
 }  // namespace dart
 
-#endif  // VM_DATASTREAM_H_
+#endif  // RUNTIME_VM_DATASTREAM_H_
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc
index 51c6721..3cdf810 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -34,12 +34,18 @@
 
 namespace dart {
 
-DEFINE_FLAG(bool, show_invisible_frames, false,
+DEFINE_FLAG(bool,
+            show_invisible_frames,
+            false,
             "Show invisible frames in debugger stack traces");
-DEFINE_FLAG(bool, trace_debugger_stacktrace, false,
+DEFINE_FLAG(bool,
+            trace_debugger_stacktrace,
+            false,
             "Trace debugger stacktrace collection");
 DEFINE_FLAG(bool, verbose_debug, false, "Verbose debugger messages");
-DEFINE_FLAG(bool, steal_breakpoints, false,
+DEFINE_FLAG(bool,
+            steal_breakpoints,
+            false,
             "Intercept breakpoints and other pause events before they "
             "are sent to the embedder and use a generic VM breakpoint "
             "handler instead.  This handler dispatches breakpoints to "
@@ -58,9 +64,7 @@
   explicit RemoteObjectCache(intptr_t initial_size);
   intptr_t AddObject(const Object& obj);
   RawObject* GetObj(intptr_t obj_id) const;
-  bool IsValidId(intptr_t obj_id) const {
-    return obj_id < objs_->Length();
-  }
+  bool IsValidId(intptr_t obj_id) const { return obj_id < objs_->Length(); }
 
  private:
   GrowableObjectArray* objs_;
@@ -205,7 +209,7 @@
 
   Breakpoint* bpt = conditions_;
   while (bpt != NULL) {
-    bpt -> VisitObjectPointers(visitor);
+    bpt->VisitObjectPointers(visitor);
     bpt = bpt->next();
   }
 }
@@ -237,14 +241,15 @@
 }
 
 
-ActivationFrame::ActivationFrame(
-    uword pc,
-    uword fp,
-    uword sp,
-    const Code& code,
-    const Array& deopt_frame,
-    intptr_t deopt_frame_offset)
-    : pc_(pc), fp_(fp), sp_(sp),
+ActivationFrame::ActivationFrame(uword pc,
+                                 uword fp,
+                                 uword sp,
+                                 const Code& code,
+                                 const Array& deopt_frame,
+                                 intptr_t deopt_frame_offset)
+    : pc_(pc),
+      fp_(fp),
+      sp_(sp),
       ctx_(Context::ZoneHandle()),
       code_(Code::ZoneHandle(code.raw())),
       function_(Function::ZoneHandle(code.function())),
@@ -259,8 +264,7 @@
       vars_initialized_(false),
       var_descriptors_(LocalVarDescriptors::ZoneHandle()),
       desc_indices_(8),
-      pc_desc_(PcDescriptors::ZoneHandle()) {
-}
+      pc_desc_(PcDescriptors::ZoneHandle()) {}
 
 
 bool Debugger::NeedsIsolateEvents() {
@@ -273,8 +277,7 @@
 bool Debugger::NeedsDebugEvents() {
   ASSERT(isolate_ != Dart::vm_isolate() &&
          !ServiceIsolate::IsServiceIsolateDescendant(isolate_));
-  return (FLAG_warn_on_pause_with_no_debugger ||
-          (event_handler_ != NULL) ||
+  return (FLAG_warn_on_pause_with_no_debugger || (event_handler_ != NULL) ||
           Service::debug_stream.enabled());
 }
 
@@ -292,12 +295,22 @@
 
 
 RawError* Debugger::PauseInterrupted() {
+  return PauseRequest(ServiceEvent::kPauseInterrupted);
+}
+
+
+RawError* Debugger::PausePostRequest() {
+  return PauseRequest(ServiceEvent::kPausePostRequest);
+}
+
+
+RawError* Debugger::PauseRequest(ServiceEvent::EventKind kind) {
   if (ignore_breakpoints_ || IsPaused()) {
     // We don't let the isolate get interrupted if we are already
     // paused or ignoring breakpoints.
     return Error::null();
   }
-  ServiceEvent event(isolate_, ServiceEvent::kPauseInterrupted);
+  ServiceEvent event(isolate_, kind);
   DebuggerStackTrace* trace = CollectStackTrace();
   if (trace->Length() > 0) {
     event.set_top_frame(trace->FrameAt(0));
@@ -397,10 +410,9 @@
   Class& func_class = Class::Handle(func.Owner());
   String& class_name = String::Handle(func_class.Name());
 
-  return OS::SCreate(Thread::Current()->zone(),
-    "%s%s%s", func_class.IsTopLevel() ? "" : class_name.ToCString(),
-              func_class.IsTopLevel() ? "" : ".",
-              func_name.ToCString());
+  return OS::SCreate(Thread::Current()->zone(), "%s%s%s",
+                     func_class.IsTopLevel() ? "" : class_name.ToCString(),
+                     func_class.IsTopLevel() ? "" : ".", func_name.ToCString());
 }
 
 
@@ -574,17 +586,19 @@
 
 void ActivationFrame::GetVarDescriptors() {
   if (var_descriptors_.IsNull()) {
-    if (code().is_optimized()) {
+    Code& unoptimized_code = Code::Handle(function().unoptimized_code());
+    if (unoptimized_code.IsNull()) {
       Thread* thread = Thread::Current();
       Zone* zone = thread->zone();
-      const Error& error = Error::Handle(zone,
-          Compiler::EnsureUnoptimizedCode(thread, function()));
+      const Error& error = Error::Handle(
+          zone, Compiler::EnsureUnoptimizedCode(thread, function()));
       if (!error.IsNull()) {
         Exceptions::PropagateError(error);
       }
+      unoptimized_code ^= function().unoptimized_code();
     }
-    var_descriptors_ =
-        Code::Handle(function().unoptimized_code()).GetLocalVarDescriptors();
+    ASSERT(!unoptimized_code.IsNull());
+    var_descriptors_ = unoptimized_code.GetLocalVarDescriptors();
     ASSERT(!var_descriptors_.IsNull());
   }
 }
@@ -649,7 +663,7 @@
     if (kind == RawLocalVarDescriptors::kSavedCurrentContext) {
       if (FLAG_trace_debugger_stacktrace) {
         OS::PrintErr("\tFound saved current ctx at index %d\n",
-            var_info.index());
+                     var_info.index());
       }
       ctx_ ^= GetStackVar(var_info.index());
       return ctx_;
@@ -685,9 +699,7 @@
   Array& handled_types = Array::Handle();
   AbstractType& type = Type::Handle();
   const TypeArguments& no_instantiator = TypeArguments::Handle();
-  for (intptr_t frame_index = 0;
-       frame_index < Length();
-       frame_index++) {
+  for (intptr_t frame_index = 0; frame_index < Length(); frame_index++) {
     ActivationFrame* frame = FrameAt(frame_index);
     intptr_t try_index = frame->TryIndex();
     if (try_index < 0) continue;
@@ -814,8 +826,8 @@
     // can be in a number of places in the caller's frame depending on how many
     // were actually supplied at the call site, but they are copied to a fixed
     // place in the callee's frame.
-    return GetVariableValue(LocalVarAddress(fp(),
-                                            (kFirstLocalSlotFromFp - index)));
+    return GetVariableValue(
+        LocalVarAddress(fp(), (kFirstLocalSlotFromFp - index)));
   } else {
     intptr_t reverse_index = num_parameters - index;
     return GetVariableValue(ParamAddress(fp(), reverse_index));
@@ -838,40 +850,43 @@
 }
 
 
-void ActivationFrame::PrintContextMismatchError(
-    intptr_t ctx_slot,
-    intptr_t frame_ctx_level,
-    intptr_t var_ctx_level) {
-  OS::PrintErr("-------------------------\n"
-               "Encountered context mismatch\n"
-               "\tctx_slot: %" Pd "\n"
-               "\tframe_ctx_level: %" Pd "\n"
-               "\tvar_ctx_level: %" Pd "\n\n",
-               ctx_slot,
-               frame_ctx_level,
-               var_ctx_level);
+void ActivationFrame::PrintContextMismatchError(intptr_t ctx_slot,
+                                                intptr_t frame_ctx_level,
+                                                intptr_t var_ctx_level) {
+  OS::PrintErr(
+      "-------------------------\n"
+      "Encountered context mismatch\n"
+      "\tctx_slot: %" Pd
+      "\n"
+      "\tframe_ctx_level: %" Pd
+      "\n"
+      "\tvar_ctx_level: %" Pd "\n\n",
+      ctx_slot, frame_ctx_level, var_ctx_level);
 
-  OS::PrintErr("-------------------------\n"
-               "Current frame:\n%s\n",
-               this->ToCString());
+  OS::PrintErr(
+      "-------------------------\n"
+      "Current frame:\n%s\n",
+      this->ToCString());
 
-  OS::PrintErr("-------------------------\n"
-               "Context contents:\n");
+  OS::PrintErr(
+      "-------------------------\n"
+      "Context contents:\n");
   const Context& ctx = GetSavedCurrentContext();
   ctx.Dump(8);
 
-  OS::PrintErr("-------------------------\n"
-               "Debugger stack trace...\n\n");
-  DebuggerStackTrace* stack =
-      Isolate::Current()->debugger()->StackTrace();
+  OS::PrintErr(
+      "-------------------------\n"
+      "Debugger stack trace...\n\n");
+  DebuggerStackTrace* stack = Isolate::Current()->debugger()->StackTrace();
   intptr_t num_frames = stack->Length();
   for (intptr_t i = 0; i < num_frames; i++) {
     ActivationFrame* frame = stack->FrameAt(i);
     OS::PrintErr("#%04" Pd " %s", i, frame->ToCString());
   }
 
-  OS::PrintErr("-------------------------\n"
-               "All frames...\n\n");
+  OS::PrintErr(
+      "-------------------------\n"
+      "All frames...\n\n");
   StackFrameIterator iterator(false);
   StackFrame* frame = iterator.NextFrame();
   intptr_t num = 0;
@@ -884,8 +899,9 @@
 
 void ActivationFrame::VariableAt(intptr_t i,
                                  String* name,
-                                 TokenPosition* token_pos,
-                                 TokenPosition* end_pos,
+                                 TokenPosition* declaration_token_pos,
+                                 TokenPosition* visible_start_token_pos,
+                                 TokenPosition* visible_end_token_pos,
                                  Object* value) {
   GetDescIndices();
   ASSERT(i < desc_indices_.length());
@@ -896,10 +912,12 @@
 
   RawLocalVarDescriptors::VarInfo var_info;
   var_descriptors_.GetInfo(desc_index, &var_info);
-  ASSERT(token_pos != NULL);
-  *token_pos = var_info.begin_pos;
-  ASSERT(end_pos != NULL);
-  *end_pos = var_info.end_pos;
+  ASSERT(declaration_token_pos != NULL);
+  *declaration_token_pos = var_info.declaration_pos;
+  ASSERT(visible_start_token_pos != NULL);
+  *visible_start_token_pos = var_info.begin_pos;
+  ASSERT(visible_end_token_pos != NULL);
+  *visible_end_token_pos = var_info.end_pos;
   ASSERT(value != NULL);
   const int8_t kind = var_info.kind();
   if (kind == RawLocalVarDescriptors::kStackVar) {
@@ -921,8 +939,7 @@
 
   intptr_t level_diff = frame_ctx_level - var_ctx_level;
   if (level_diff == 0) {
-    if ((ctx_slot < 0) ||
-        (ctx_slot >= ctx.num_variables())) {
+    if ((ctx_slot < 0) || (ctx_slot >= ctx.num_variables())) {
       PrintContextMismatchError(ctx_slot, frame_ctx_level, var_ctx_level);
     }
     ASSERT((ctx_slot >= 0) && (ctx_slot < ctx.num_variables()));
@@ -934,8 +951,7 @@
       level_diff--;
       var_ctx = var_ctx.parent();
     }
-    if (var_ctx.IsNull() ||
-        (ctx_slot < 0) ||
+    if (var_ctx.IsNull() || (ctx_slot < 0) ||
         (ctx_slot >= var_ctx.num_variables())) {
       PrintContextMismatchError(ctx_slot, frame_ctx_level, var_ctx_level);
     }
@@ -954,7 +970,7 @@
   const Array& list = Array::Handle(Array::New(2 * num_variables));
   for (intptr_t i = 0; i < num_variables; i++) {
     TokenPosition ignore;
-    VariableAt(i, &var_name, &ignore, &ignore, &value);
+    VariableAt(i, &var_name, &ignore, &ignore, &ignore, &value);
     list.SetAt(2 * i, var_name);
     list.SetAt((2 * i) + 1, value);
   }
@@ -969,7 +985,7 @@
   Instance& value = Instance::Handle();
   for (intptr_t i = 0; i < num_variables; i++) {
     TokenPosition ignore;
-    VariableAt(i, &var_name, &ignore, &ignore, &value);
+    VariableAt(i, &var_name, &ignore, &ignore, &ignore, &value);
     if (var_name.Equals(Symbols::This())) {
       return value.raw();
     }
@@ -999,7 +1015,7 @@
   intptr_t num_variables = desc_indices_.length();
   for (intptr_t i = 0; i < num_variables; i++) {
     TokenPosition ignore;
-    VariableAt(i, &name, &ignore, &ignore, &value);
+    VariableAt(i, &name, &ignore, &ignore, &ignore, &value);
     if (!name.Equals(Symbols::This()) && !IsSyntheticVariableName(name)) {
       if (IsPrivateVariableName(name)) {
         name = String::ScrubName(name);
@@ -1011,8 +1027,7 @@
 
   if (function().is_static()) {
     const Class& cls = Class::Handle(function().Owner());
-    return cls.Evaluate(expr,
-                        Array::Handle(Array::MakeArray(param_names)),
+    return cls.Evaluate(expr, Array::Handle(Array::MakeArray(param_names)),
                         Array::Handle(Array::MakeArray(param_values)));
   } else {
     const Object& receiver = Object::Handle(GetReceiver());
@@ -1022,8 +1037,7 @@
       return Object::null();
     }
     const Instance& inst = Instance::Cast(receiver);
-    return inst.Evaluate(method_cls,
-                         expr,
+    return inst.Evaluate(method_cls, expr,
                          Array::Handle(Array::MakeArray(param_names)),
                          Array::Handle(Array::MakeArray(param_values)));
   }
@@ -1036,24 +1050,21 @@
   const String& url = String::Handle(SourceUrl());
   intptr_t line = LineNumber();
   const char* func_name = Debugger::QualifiedFunctionName(function());
-  return Thread::Current()->zone()->
-      PrintToString("[ Frame pc(0x%" Px ") fp(0x%" Px ") sp(0x%" Px ")\n"
-                    "\tfunction = %s\n"
-                    "\turl = %s\n"
-                    "\tline = %" Pd "\n"
-                    "\tcontext = %s\n"
-                    "\tcontext level = %" Pd " ]\n",
-                    pc(), fp(), sp(),
-                    func_name,
-                    url.ToCString(),
-                    line,
-                    ctx_.ToCString(),
-                    ContextLevel());
+  return Thread::Current()->zone()->PrintToString(
+      "[ Frame pc(0x%" Px ") fp(0x%" Px ") sp(0x%" Px
+      ")\n"
+      "\tfunction = %s\n"
+      "\turl = %s\n"
+      "\tline = %" Pd
+      "\n"
+      "\tcontext = %s\n"
+      "\tcontext level = %" Pd " ]\n",
+      pc(), fp(), sp(), func_name, url.ToCString(), line, ctx_.ToCString(),
+      ContextLevel());
 }
 
 
-void ActivationFrame::PrintToJSONObject(JSONObject* jsobj,
-                                        bool full) {
+void ActivationFrame::PrintToJSONObject(JSONObject* jsobj, bool full) {
   const Script& script = Script::Handle(SourceScript());
   jsobj->AddProperty("type", "Frame");
   TokenPosition pos = TokenPos();
@@ -1075,27 +1086,29 @@
     for (intptr_t v = 0; v < num_vars; v++) {
       String& var_name = String::Handle();
       Instance& var_value = Instance::Handle();
-      TokenPosition token_pos;
-      TokenPosition end_token_pos;
-      VariableAt(v, &var_name, &token_pos, &end_token_pos, &var_value);
+      TokenPosition declaration_token_pos;
+      TokenPosition visible_start_token_pos;
+      TokenPosition visible_end_token_pos;
+      VariableAt(v, &var_name, &declaration_token_pos, &visible_start_token_pos,
+                 &visible_end_token_pos, &var_value);
       if (var_name.raw() != Symbols::AsyncOperation().raw()) {
         JSONObject jsvar(&jsvars);
         jsvar.AddProperty("type", "BoundVariable");
         var_name = String::ScrubName(var_name);
         jsvar.AddProperty("name", var_name.ToCString());
         jsvar.AddProperty("value", var_value, !full);
-        // TODO(turnidge): Do we really want to provide this on every
-        // stack dump?  Should be associated with the function object, I
-        // think, and not the stack frame.
-        jsvar.AddProperty("_tokenPos", token_pos);
-        jsvar.AddProperty("_endTokenPos", end_token_pos);
+        // Where was the variable declared?
+        jsvar.AddProperty("declarationTokenPos", declaration_token_pos);
+        // When the variable becomes visible to the scope.
+        jsvar.AddProperty("scopeStartTokenPos", visible_start_token_pos);
+        // When the variable stops being visible to the scope.
+        jsvar.AddProperty("scopeEndTokenPos", visible_end_token_pos);
       }
     }
   }
 }
 
 
-
 void DebuggerStackTrace::AddActivation(ActivationFrame* frame) {
   if (FLAG_show_invisible_frames || frame->function().is_visible()) {
     trace_.Add(frame);
@@ -1103,9 +1116,9 @@
 }
 
 
-const uint8_t kSafepointKind = RawPcDescriptors::kIcCall
-                             | RawPcDescriptors::kUnoptStaticCall
-                             | RawPcDescriptors::kRuntimeCall;
+const uint8_t kSafepointKind = RawPcDescriptors::kIcCall |
+                               RawPcDescriptors::kUnoptStaticCall |
+                               RawPcDescriptors::kRuntimeCall;
 
 
 CodeBreakpoint::CodeBreakpoint(const Code& code,
@@ -1126,7 +1139,7 @@
       saved_value_(Bytecode::kTrap),
       saved_value_fastsmi_(Bytecode::kTrap)
 #endif
-    {
+{
   ASSERT(!code.IsNull());
   ASSERT(token_pos_.IsReal());
   ASSERT(pc_ != 0);
@@ -1137,7 +1150,7 @@
 CodeBreakpoint::~CodeBreakpoint() {
   // Make sure we don't leave patched code behind.
   ASSERT(!IsEnabled());
-  // Poison the data so we catch use after free errors.
+// Poison the data so we catch use after free errors.
 #ifdef DEBUG
   code_ = Code::null();
   pc_ = 0ul;
@@ -1192,8 +1205,8 @@
 
 
 RemoteObjectCache::RemoteObjectCache(intptr_t initial_size) {
-  objs_ = &GrowableObjectArray::ZoneHandle(
-              GrowableObjectArray::New(initial_size));
+  objs_ =
+      &GrowableObjectArray::ZoneHandle(GrowableObjectArray::New(initial_size));
 }
 
 
@@ -1231,8 +1244,7 @@
       stepping_fp_(0),
       skip_next_step_(false),
       synthetic_async_breakpoint_(NULL),
-      exc_pause_info_(kNoPauseOnExceptions) {
-}
+      exc_pause_info_(kNoPauseOnExceptions) {}
 
 
 Debugger::~Debugger() {
@@ -1277,9 +1289,8 @@
 }
 
 
-static RawFunction* ResolveLibraryFunction(
-                        const Library& library,
-                        const String& fname) {
+static RawFunction* ResolveLibraryFunction(const Library& library,
+                                           const String& fname) {
   ASSERT(!library.IsNull());
   const Object& object = Object::Handle(library.ResolveName(fname));
   if (!object.IsNull() && object.IsFunction()) {
@@ -1405,9 +1416,8 @@
                                             const Array& deopt_frame,
                                             intptr_t deopt_frame_offset) {
   ASSERT(code.ContainsInstructionAt(pc));
-  ActivationFrame* activation =
-      new ActivationFrame(pc, frame->fp(), frame->sp(), code,
-                          deopt_frame, deopt_frame_offset);
+  ActivationFrame* activation = new ActivationFrame(
+      pc, frame->fp(), frame->sp(), code, deopt_frame, deopt_frame_offset);
   if (FLAG_trace_debugger_stacktrace) {
     const Context& ctx = activation->GetSavedCurrentContext();
     OS::PrintErr("\tUsing saved context: %s\n", ctx.ToCString());
@@ -1426,18 +1436,14 @@
   Isolate* isolate = thread->isolate();
   // Create the DeoptContext for this deoptimization.
   DeoptContext* deopt_context =
-      new DeoptContext(frame, code,
-                       DeoptContext::kDestIsAllocated,
-                       NULL,
-                       NULL,
-                       true,
-                       false /* deoptimizing_code */);
+      new DeoptContext(frame, code, DeoptContext::kDestIsAllocated, NULL, NULL,
+                       true, false /* deoptimizing_code */);
   isolate->set_deopt_context(deopt_context);
 
   deopt_context->FillDestFrame();
   deopt_context->MaterializeDeferredObjects();
-  const Array& dest_frame = Array::Handle(thread->zone(),
-                                          deopt_context->DestFrameAsArray());
+  const Array& dest_frame =
+      Array::Handle(thread->zone(), deopt_context->DestFrameAsArray());
 
   isolate->set_deopt_context(NULL);
   delete deopt_context;
@@ -1456,8 +1462,7 @@
   Code& inlined_code = Code::Handle(zone);
   Array& deopt_frame = Array::Handle(zone);
 
-  for (StackFrame* frame = iterator.NextFrame();
-       frame != NULL;
+  for (StackFrame* frame = iterator.NextFrame(); frame != NULL;
        frame = iterator.NextFrame()) {
     ASSERT(frame->IsValid());
     if (FLAG_trace_debugger_stacktrace) {
@@ -1468,8 +1473,7 @@
       code = frame->LookupDartCode();
       if (code.is_optimized() && !FLAG_precompiled_runtime) {
         deopt_frame = DeoptimizeToArray(thread, frame, code);
-        for (InlinedFunctionsIterator it(code, frame->pc());
-             !it.Done();
+        for (InlinedFunctionsIterator it(code, frame->pc()); !it.Done();
              it.Advance()) {
           inlined_code = it.code();
           if (FLAG_trace_debugger_stacktrace) {
@@ -1480,20 +1484,13 @@
                          function.ToFullyQualifiedCString());
           }
           intptr_t deopt_frame_offset = it.GetDeoptFpOffset();
-          stack_trace->AddActivation(CollectDartFrame(isolate,
-                                                      it.pc(),
-                                                      frame,
-                                                      inlined_code,
-                                                      deopt_frame,
+          stack_trace->AddActivation(CollectDartFrame(isolate, it.pc(), frame,
+                                                      inlined_code, deopt_frame,
                                                       deopt_frame_offset));
         }
       } else {
-        stack_trace->AddActivation(CollectDartFrame(isolate,
-                                                    frame->pc(),
-                                                    frame,
-                                                    code,
-                                                    Object::null_array(),
-                                                    0));
+        stack_trace->AddActivation(CollectDartFrame(
+            isolate, frame->pc(), frame, code, Object::null_array(), 0));
       }
     }
   }
@@ -1508,9 +1505,8 @@
     frame = iterator.NextFrame();
   }
   Code& code = Code::Handle(frame->LookupDartCode());
-  ActivationFrame* activation =
-      new ActivationFrame(frame->pc(), frame->fp(), frame->sp(), code,
-                          Object::null_array(), 0);
+  ActivationFrame* activation = new ActivationFrame(
+      frame->pc(), frame->fp(), frame->sp(), code, Object::null_array(), 0);
   return activation;
 }
 
@@ -1556,12 +1552,12 @@
           ASSERT(pc < (code.PayloadStart() + code.Size()));
 
           ActivationFrame* activation = new ActivationFrame(
-            pc, fp, sp, code, deopt_frame, deopt_frame_offset);
+              pc, fp, sp, code, deopt_frame, deopt_frame_offset);
           stack_trace->AddActivation(activation);
         }
       } else {
         ActivationFrame* activation = new ActivationFrame(
-          pc, fp, sp, code, deopt_frame, deopt_frame_offset);
+            pc, fp, sp, code, deopt_frame, deopt_frame_offset);
         stack_trace->AddActivation(activation);
       }
     }
@@ -1610,8 +1606,7 @@
   // by the debugger to evaluate variables values, when we see a nested
   // breakpoint or exception event, or if the debugger is not
   // interested in exception events.
-  if (ignore_breakpoints_ ||
-      IsPaused() ||
+  if (ignore_breakpoints_ || IsPaused() ||
       (exc_pause_info_ == kNoPauseOnExceptions)) {
     return;
   }
@@ -1634,9 +1629,7 @@
 static TokenPosition LastTokenOnLine(Zone* zone,
                                      const TokenStream& tokens,
                                      TokenPosition pos) {
-  TokenStream::Iterator iter(zone,
-                             tokens,
-                             pos,
+  TokenStream::Iterator iter(zone, tokens, pos,
                              TokenStream::Iterator::kAllTokens);
   ASSERT(iter.IsValid());
   TokenPosition last_pos = pos;
@@ -1705,11 +1698,10 @@
 // algorithm, which would be simpler.  I believe that it only needs
 // two passes to support the recursive try-the-whole-function case.
 // Rewrite this later, once there are more tests in place.
-TokenPosition Debugger::ResolveBreakpointPos(
-    const Function& func,
-    TokenPosition requested_token_pos,
-    TokenPosition last_token_pos,
-    intptr_t requested_column) {
+TokenPosition Debugger::ResolveBreakpointPos(const Function& func,
+                                             TokenPosition requested_token_pos,
+                                             TokenPosition last_token_pos,
+                                             intptr_t requested_column) {
   ASSERT(func.HasCode());
   ASSERT(!func.HasOptimizedCode());
 
@@ -1733,8 +1725,7 @@
   PcDescriptors::Iterator iter(desc, kSafepointKind);
   while (iter.MoveNext()) {
     const TokenPosition pos = iter.TokenPos();
-    if ((!pos.IsReal()) ||
-        (pos < requested_token_pos) ||
+    if ((!pos.IsReal()) || (pos < requested_token_pos) ||
         (pos > last_token_pos)) {
       // Token is not in the target range.
       continue;
@@ -1780,9 +1771,7 @@
     PcDescriptors::Iterator iter(desc, kSafepointKind);
     while (iter.MoveNext()) {
       const TokenPosition pos = iter.TokenPos();
-      if (!pos.IsReal() ||
-          (pos < begin_pos) ||
-          (pos > end_of_line_pos)) {
+      if (!pos.IsReal() || (pos < begin_pos) || (pos > end_of_line_pos)) {
         // Token is not on same line as best fit.
         continue;
       }
@@ -1847,8 +1836,8 @@
   CodeBreakpoint* code_bpt = GetCodeBreakpoint(lowest_pc);
   if (code_bpt == NULL) {
     // No code breakpoint for this code exists; create one.
-    code_bpt = new CodeBreakpoint(code, loc->token_pos_,
-                                  lowest_pc, lowest_kind);
+    code_bpt =
+        new CodeBreakpoint(code, loc->token_pos_, lowest_pc, lowest_kind);
     RegisterCodeBreakpoint(code_bpt);
   }
   code_bpt->set_bpt_location(loc);
@@ -1873,9 +1862,9 @@
   for (intptr_t pos = 0; pos < num_closures; pos++) {
     function ^= closures.At(pos);
     ASSERT(!function.IsNull());
-    if ((function.token_pos() == start_pos)
-        && (function.end_token_pos() == end_pos)
-        && (function.script() == script.raw())) {
+    if ((function.token_pos() == start_pos) &&
+        (function.end_token_pos() == end_pos) &&
+        (function.script() == script.raw())) {
       if (function.HasCode() && function.is_debuggable()) {
         function_list->Add(function);
       }
@@ -1911,9 +1900,9 @@
           ASSERT(!function.IsNull());
           // Check token position first to avoid unnecessary calls
           // to script() which allocates handles.
-          if ((function.token_pos() == start_pos)
-              && (function.end_token_pos() == end_pos)
-              && (function.script() == script.raw())) {
+          if ((function.token_pos() == start_pos) &&
+              (function.end_token_pos() == end_pos) &&
+              (function.script() == script.raw())) {
             if (function.HasCode() && function.is_debuggable()) {
               function_list->Add(function);
             }
@@ -2019,9 +2008,7 @@
   // function we found.
   GrowableObjectArray& functions =
       GrowableObjectArray::Handle(GrowableObjectArray::New());
-  FindCompiledFunctions(script,
-                        func.token_pos(),
-                        func.end_token_pos(),
+  FindCompiledFunctions(script, func.token_pos(), func.end_token_pos(),
                         &functions);
 
   if (functions.Length() > 0) {
@@ -2054,10 +2041,10 @@
         intptr_t line_number;
         intptr_t column_number;
         script.GetTokenLocation(breakpoint_pos, &line_number, &column_number);
-        OS::Print("Resolved BP for "
-                  "function '%s' at line %" Pd " col %" Pd "\n",
-                  func.ToFullyQualifiedCString(),
-                  line_number, column_number);
+        OS::Print(
+            "Resolved BP for "
+            "function '%s' at line %" Pd " col %" Pd "\n",
+            func.ToFullyQualifiedCString(), line_number, column_number);
       }
       return bpt;
     }
@@ -2068,10 +2055,10 @@
     intptr_t line_number;
     intptr_t column_number;
     script.GetTokenLocation(token_pos, &line_number, &column_number);
-    OS::Print("Registering pending breakpoint for "
-              "uncompiled function '%s' at line %" Pd " col %" Pd "\n",
-              func.ToFullyQualifiedCString(),
-              line_number, column_number);
+    OS::Print(
+        "Registering pending breakpoint for "
+        "uncompiled function '%s' at line %" Pd " col %" Pd "\n",
+        func.ToFullyQualifiedCString(), line_number, column_number);
   }
   BreakpointLocation* bpt =
       GetBreakpointLocation(script, token_pos, requested_column);
@@ -2121,11 +2108,9 @@
     return NULL;
   }
   const Script& script = Script::Handle(target_function.script());
-  BreakpointLocation* bpt_location =
-      SetBreakpoint(script,
-                    target_function.token_pos(),
-                    target_function.end_token_pos(),
-                    -1, -1 /* no requested line/col */);
+  BreakpointLocation* bpt_location = SetBreakpoint(
+      script, target_function.token_pos(), target_function.end_token_pos(), -1,
+      -1 /* no requested line/col */);
   if (single_shot) {
     return bpt_location->AddSingleShot(this);
   } else {
@@ -2134,17 +2119,15 @@
 }
 
 
-Breakpoint* Debugger::SetBreakpointAtActivation(
-    const Instance& closure, bool for_over_await) {
+Breakpoint* Debugger::SetBreakpointAtActivation(const Instance& closure,
+                                                bool for_over_await) {
   if (!closure.IsClosure()) {
     return NULL;
   }
   const Function& func = Function::Handle(Closure::Cast(closure).function());
   const Script& script = Script::Handle(func.script());
-  BreakpointLocation* bpt_location = SetBreakpoint(script,
-                                                   func.token_pos(),
-                                                   func.end_token_pos(),
-                                                   -1, -1 /* no line/col */);
+  BreakpointLocation* bpt_location = SetBreakpoint(
+      script, func.token_pos(), func.end_token_pos(), -1, -1 /* no line/col */);
   return bpt_location->AddPerClosure(this, closure, for_over_await);
 }
 
@@ -2196,9 +2179,8 @@
   // Dart_SetBreakpoint instead.
   ASSERT(Thread::Current()->execution_state() == Thread::kThreadInVM);
 
-  BreakpointLocation* loc = BreakpointLocationAtLineCol(script_url,
-                                                        line_number,
-                                                        column_number);
+  BreakpointLocation* loc =
+      BreakpointLocationAtLineCol(script_url, line_number, column_number);
   if (loc != NULL) {
     return loc->AddRepeated(this);
   }
@@ -2216,7 +2198,7 @@
   const GrowableObjectArray& libs =
       GrowableObjectArray::Handle(isolate_->object_store()->libraries());
   const GrowableObjectArray& scripts =
-    GrowableObjectArray::Handle(zone, GrowableObjectArray::New());
+      GrowableObjectArray::Handle(zone, GrowableObjectArray::New());
   for (intptr_t i = 0; i < libs.Length(); i++) {
     lib ^= libs.At(i);
     script = lib.LookupScript(script_url);
@@ -2227,14 +2209,13 @@
   if (scripts.Length() == 0) {
     // No script found with given url. Create a latent breakpoint which
     // will be set if the url is loaded later.
-    BreakpointLocation* latent_bpt = GetLatentBreakpoint(script_url,
-                                                         line_number,
-                                                         column_number);
+    BreakpointLocation* latent_bpt =
+        GetLatentBreakpoint(script_url, line_number, column_number);
     if (FLAG_verbose_debug) {
-      OS::Print("Set latent breakpoint in url '%s' at "
-                "line %" Pd " col %" Pd "\n",
-                script_url.ToCString(),
-                line_number, column_number);
+      OS::Print(
+          "Set latent breakpoint in url '%s' at "
+          "line %" Pd " col %" Pd "\n",
+          script_url.ToCString(), line_number, column_number);
     }
     return latent_bpt;
   }
@@ -2257,8 +2238,8 @@
   } else if (!last_token_idx.IsReal()) {
     // Line does not contain any tokens.
     if (FLAG_verbose_debug) {
-      OS::Print("No executable code at line %" Pd " in '%s'\n",
-                line_number, script_url.ToCString());
+      OS::Print("No executable code at line %" Pd " in '%s'\n", line_number,
+                script_url.ToCString());
     }
     return NULL;
   }
@@ -2266,13 +2247,13 @@
   BreakpointLocation* bpt = NULL;
   ASSERT(first_token_idx <= last_token_idx);
   while ((bpt == NULL) && (first_token_idx <= last_token_idx)) {
-    bpt = SetBreakpoint(script, first_token_idx, last_token_idx,
-                        line_number, column_number);
+    bpt = SetBreakpoint(script, first_token_idx, last_token_idx, line_number,
+                        column_number);
     first_token_idx.Next();
   }
   if ((bpt == NULL) && FLAG_verbose_debug) {
-    OS::Print("No executable code at line %" Pd " in '%s'\n",
-                line_number, script_url.ToCString());
+    OS::Print("No executable code at line %" Pd " in '%s'\n", line_number,
+              script_url.ToCString());
   }
   return bpt;
 }
@@ -2522,8 +2503,7 @@
   {
     Thread* thread = Thread::Current();
     DisableThreadInterruptsScope dtis(thread);
-    TimelineDurationScope tds(thread,
-                              Timeline::GetDebuggerStream(),
+    TimelineDurationScope tds(thread, Timeline::GetDebuggerStream(),
                               "Debugger Pause");
 
     // Send the pause event.
@@ -2540,10 +2520,8 @@
     }
 
     // Notify the service that we have resumed.
-    const Error& error =
-        Error::Handle(Thread::Current()->sticky_error());
-    ASSERT(error.IsNull() ||
-           error.IsUnwindError() ||
+    const Error& error = Error::Handle(Thread::Current()->sticky_error());
+    ASSERT(error.IsNull() || error.IsUnwindError() ||
            error.IsUnhandledException());
 
     // Only send a resume event when the isolate is not unwinding.
@@ -2555,7 +2533,7 @@
   }
 
   pause_event_ = NULL;
-  obj_cache_ = NULL;    // Zone allocated
+  obj_cache_ = NULL;  // Zone allocated
 }
 
 
@@ -2619,14 +2597,13 @@
 }
 
 
-void Debugger::SignalPausedEvent(ActivationFrame* top_frame,
-                                 Breakpoint* bpt) {
+void Debugger::SignalPausedEvent(ActivationFrame* top_frame, Breakpoint* bpt) {
   resume_action_ = kContinue;
   stepping_fp_ = 0;
   isolate_->set_single_step(false);
   ASSERT(!IsPaused());
   ASSERT(obj_cache_ == NULL);
-  if ((bpt != NULL) && bpt->IsSingleShot())  {
+  if ((bpt != NULL) && bpt->IsSingleShot()) {
     RemoveBreakpoint(bpt->id());
     bpt = NULL;
   }
@@ -2802,11 +2779,11 @@
 
     // Hit a synthetic async breakpoint.
     if (FLAG_verbose_debug) {
-      OS::Print(">>> hit synthetic breakpoint at %s:%" Pd " "
+      OS::Print(">>> hit synthetic breakpoint at %s:%" Pd
+                " "
                 "(token %s) (address %#" Px ")\n",
                 String::Handle(cbpt->SourceUrl()).ToCString(),
-                cbpt->LineNumber(),
-                cbpt->token_pos().ToCString(),
+                cbpt->LineNumber(), cbpt->token_pos().ToCString(),
                 top_frame->pc());
     }
 
@@ -2825,13 +2802,12 @@
   }
 
   if (FLAG_verbose_debug) {
-    OS::Print(">>> hit %s breakpoint at %s:%" Pd " "
+    OS::Print(">>> hit %s breakpoint at %s:%" Pd
+              " "
               "(token %s) (address %#" Px ")\n",
               cbpt->IsInternal() ? "internal" : "user",
-              String::Handle(cbpt->SourceUrl()).ToCString(),
-              cbpt->LineNumber(),
-              cbpt->token_pos().ToCString(),
-              top_frame->pc());
+              String::Handle(cbpt->SourceUrl()).ToCString(), cbpt->LineNumber(),
+              cbpt->token_pos().ToCString(), top_frame->pc());
   }
 
   ASSERT(stack_trace_ == NULL);
@@ -2905,9 +2881,8 @@
                                             TokenPosition token_pos) {
   Zone* zone = Thread::Current()->zone();
   const Script& outer_origin = Script::Handle(zone, function.script());
-  const GrowableObjectArray& closures =
-     GrowableObjectArray::Handle(zone,
-         Isolate::Current()->object_store()->closure_functions());
+  const GrowableObjectArray& closures = GrowableObjectArray::Handle(
+      zone, Isolate::Current()->object_store()->closure_functions());
   const intptr_t num_closures = closures.Length();
   Function& closure = Function::Handle(zone);
   Function& best_fit = Function::Handle(zone);
@@ -2940,9 +2915,8 @@
   // need to be set in the newly compiled function.
   Zone* zone = Thread::Current()->zone();
   Script& script = Script::Handle(zone);
-  for (BreakpointLocation* loc = breakpoint_locations_;
-      loc != NULL;
-      loc = loc->next()) {
+  for (BreakpointLocation* loc = breakpoint_locations_; loc != NULL;
+       loc = loc->next()) {
     script = loc->script();
     if (FunctionContains(func, script, loc->token_pos())) {
       Function& inner_function = Function::Handle(zone);
@@ -2983,16 +2957,15 @@
         Breakpoint* bpt = loc->breakpoints();
         while (bpt != NULL) {
           if (FLAG_verbose_debug) {
-            OS::Print("Resolved BP %" Pd " to pos %s, "
-                      "line %" Pd " col %" Pd ", "
+            OS::Print("Resolved BP %" Pd
+                      " to pos %s, "
+                      "line %" Pd " col %" Pd
+                      ", "
                       "function '%s' (requested range %s-%s, "
                       "requested col %" Pd ")\n",
-                      bpt->id(),
-                      loc->token_pos().ToCString(),
-                      loc->LineNumber(),
-                      loc->ColumnNumber(),
-                      func.ToFullyQualifiedCString(),
-                      requested_pos.ToCString(),
+                      bpt->id(), loc->token_pos().ToCString(),
+                      loc->LineNumber(), loc->ColumnNumber(),
+                      func.ToFullyQualifiedCString(), requested_pos.ToCString(),
                       requested_end_pos.ToCString(),
                       loc->requested_column_number());
           }
@@ -3004,11 +2977,10 @@
       if (FLAG_verbose_debug) {
         Breakpoint* bpt = loc->breakpoints();
         while (bpt != NULL) {
-          OS::Print("Setting breakpoint %" Pd " at line %" Pd " col %" Pd ""
+          OS::Print("Setting breakpoint %" Pd " at line %" Pd " col %" Pd
+                    ""
                     " for %s '%s'\n",
-                    bpt->id(),
-                    loc->LineNumber(),
-                    loc->ColumnNumber(),
+                    bpt->id(), loc->LineNumber(), loc->ColumnNumber(),
                     func.IsClosureFunction() ? "closure" : "function",
                     String::Handle(func.name()).ToCString());
           bpt = bpt->next();
@@ -3063,11 +3035,10 @@
           Breakpoint* bpt = matched_loc->breakpoints();
           while (bpt != NULL) {
             if (FLAG_verbose_debug) {
-              OS::Print("No code found at line %" Pd ": "
+              OS::Print("No code found at line %" Pd
+                        ": "
                         "dropping latent breakpoint %" Pd " in '%s'\n",
-                        line_number,
-                        bpt->id(),
-                        url.ToCString());
+                        line_number, bpt->id(), url.ToCString());
             }
             Breakpoint* prev = bpt;
             bpt = bpt->next();
@@ -3085,8 +3056,7 @@
             // Create and register a new source breakpoint for the
             // latent breakpoint.
             BreakpointLocation* unresolved_loc =
-                new BreakpointLocation(script,
-                                       first_token_pos, last_token_pos,
+                new BreakpointLocation(script, first_token_pos, last_token_pos,
                                        line_number, column_number);
             RegisterBreakpointLocation(unresolved_loc);
 
@@ -3097,11 +3067,10 @@
             while (bpt != NULL) {
               bpt->set_bpt_location(unresolved_loc);
               if (FLAG_verbose_debug) {
-                OS::Print("Converted latent breakpoint "
-                          "%" Pd " in '%s' at line %" Pd " col %" Pd "\n",
-                          bpt->id(),
-                          url.ToCString(),
-                          line_number, column_number);
+                OS::Print(
+                    "Converted latent breakpoint "
+                    "%" Pd " in '%s' at line %" Pd " col %" Pd "\n",
+                    bpt->id(), url.ToCString(), line_number, column_number);
               }
               bpt = bpt->next();
             }
@@ -3126,10 +3095,10 @@
       if (FLAG_verbose_debug) {
         Breakpoint* bpt = loc->breakpoints();
         while (bpt != NULL) {
-          OS::Print("No match found for latent breakpoint id "
-                    "%" Pd " with url '%s'\n",
-                    bpt->id(),
-                    url.ToCString());
+          OS::Print(
+              "No match found for latent breakpoint id "
+              "%" Pd " with url '%s'\n",
+              bpt->id(), url.ToCString());
           bpt = bpt->next();
         }
       }
@@ -3267,8 +3236,7 @@
                                                     intptr_t requested_column) {
   BreakpointLocation* bpt = breakpoint_locations_;
   while (bpt != NULL) {
-    if ((bpt->script_ == script.raw()) &&
-        (bpt->token_pos_ == token_pos) &&
+    if ((bpt->script_ == script.raw()) && (bpt->token_pos_ == token_pos) &&
         (bpt->requested_column_number_ == requested_column)) {
       return bpt;
     }
@@ -3301,8 +3269,7 @@
   String& bpt_url = String::Handle();
   while (bpt != NULL) {
     bpt_url = bpt->url();
-    if (bpt_url.Equals(url) &&
-        (bpt->requested_line_number() == line) &&
+    if (bpt_url.Equals(url) && (bpt->requested_line_number() == line) &&
         (bpt->requested_column_number() == column)) {
       return bpt;
     }
diff --git a/runtime/vm/debugger.h b/runtime/vm/debugger.h
index e78e839..7319c8e 100644
--- a/runtime/vm/debugger.h
+++ b/runtime/vm/debugger.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_DEBUGGER_H_
-#define VM_DEBUGGER_H_
+#ifndef RUNTIME_VM_DEBUGGER_H_
+#define RUNTIME_VM_DEBUGGER_H_
 
 #include "include/dart_tools_api.h"
 
@@ -27,12 +27,12 @@
 class Breakpoint {
  public:
   Breakpoint(intptr_t id, BreakpointLocation* bpt_location)
-    : id_(id),
-      kind_(Breakpoint::kNone),
-      next_(NULL),
-      closure_(Instance::null()),
-      bpt_location_(bpt_location),
-      is_synthetic_async_(false) {}
+      : id_(id),
+        kind_(Breakpoint::kNone),
+        next_(NULL),
+        closure_(Instance::null()),
+        bpt_location_(bpt_location),
+        is_synthetic_async_(false) {}
 
   intptr_t id() const { return id_; }
   Breakpoint* next() const { return next_; }
@@ -66,9 +66,7 @@
   void set_is_synthetic_async(bool is_synthetic_async) {
     is_synthetic_async_ = is_synthetic_async;
   }
-  bool is_synthetic_async() const {
-    return is_synthetic_async_;
-  }
+  bool is_synthetic_async() const { return is_synthetic_async_; }
 
   void PrintJSON(JSONStream* stream);
 
@@ -247,8 +245,12 @@
 // on the call stack.
 class ActivationFrame : public ZoneAllocated {
  public:
-  ActivationFrame(uword pc, uword fp, uword sp, const Code& code,
-                  const Array& deopt_frame, intptr_t deopt_frame_offset);
+  ActivationFrame(uword pc,
+                  uword fp,
+                  uword sp,
+                  const Code& code,
+                  const Array& deopt_frame,
+                  intptr_t deopt_frame_offset);
 
   uword pc() const { return pc_; }
   uword fp() const { return fp_; }
@@ -285,8 +287,9 @@
 
   void VariableAt(intptr_t i,
                   String* name,
-                  TokenPosition* token_pos,
-                  TokenPosition* end_pos,
+                  TokenPosition* declaration_token_pos,
+                  TokenPosition* visible_start_token_pos,
+                  TokenPosition* visible_end_token_pos,
                   Object* value);
 
   RawArray* GetLocalVariables();
@@ -351,14 +354,11 @@
 // Array of function activations on the call stack.
 class DebuggerStackTrace : public ZoneAllocated {
  public:
-  explicit DebuggerStackTrace(int capacity)
-      : trace_(capacity) { }
+  explicit DebuggerStackTrace(int capacity) : trace_(capacity) {}
 
   intptr_t Length() const { return trace_.length(); }
 
-  ActivationFrame* FrameAt(int i) const {
-    return trace_[i];
-  }
+  ActivationFrame* FrameAt(int i) const { return trace_[i]; }
 
   ActivationFrame* GetHandlerFrame(const Instance& exc_obj) const;
 
@@ -483,8 +483,7 @@
   RawObject* GetInstanceField(const Class& cls,
                               const String& field_name,
                               const Instance& object);
-  RawObject* GetStaticField(const Class& cls,
-                            const String& field_name);
+  RawObject* GetStaticField(const Class& cls, const String& field_name);
 
   // Pause execution for a breakpoint.  Called from generated code.
   RawError* PauseBreakpoint();
@@ -495,6 +494,9 @@
   // Pause execution due to isolate interrupt.
   RawError* PauseInterrupted();
 
+  // Pause after a reload request.
+  RawError* PausePostRequest();
+
   // Pause execution due to an uncaught exception.
   void PauseException(const Instance& exc);
 
@@ -512,12 +514,9 @@
   intptr_t limitBreakpointId() { return next_id_; }
 
  private:
-  enum ResumeAction {
-    kContinue,
-    kStepOver,
-    kStepOut,
-    kSingleStep
-  };
+  enum ResumeAction { kContinue, kStepOver, kStepOut, kSingleStep };
+
+  RawError* PauseRequest(ServiceEvent::EventKind kind);
 
   bool NeedsIsolateEvents();
   bool NeedsDebugEvents();
@@ -534,9 +533,9 @@
   RawFunction* FindInnermostClosure(const Function& function,
                                     TokenPosition token_pos);
   TokenPosition ResolveBreakpointPos(const Function& func,
-                                       TokenPosition requested_token_pos,
-                                       TokenPosition last_token_pos,
-                                       intptr_t requested_column);
+                                     TokenPosition requested_token_pos,
+                                     TokenPosition last_token_pos,
+                                     intptr_t requested_column);
   void DeoptimizeWorld();
   BreakpointLocation* SetBreakpoint(const Script& script,
                                     TokenPosition token_pos,
@@ -553,8 +552,7 @@
   BreakpointLocation* GetBreakpointLocation(const Script& script,
                                             TokenPosition token_pos,
                                             intptr_t requested_column);
-  void MakeCodeBreakpointAt(const Function& func,
-                            BreakpointLocation* bpt);
+  void MakeCodeBreakpointAt(const Function& func, BreakpointLocation* bpt);
   // Returns NULL if no breakpoint exists for the given address.
   CodeBreakpoint* GetCodeBreakpoint(uword breakpoint_address);
 
@@ -571,8 +569,7 @@
                                      StackFrame* frame,
                                      const Code& code);
   static DebuggerStackTrace* CollectStackTrace();
-  void SignalPausedEvent(ActivationFrame* top_frame,
-                         Breakpoint* bpt);
+  void SignalPausedEvent(ActivationFrame* top_frame, Breakpoint* bpt);
 
   intptr_t nextId() { return next_id_++; }
 
@@ -649,4 +646,4 @@
 
 }  // namespace dart
 
-#endif  // VM_DEBUGGER_H_
+#endif  // RUNTIME_VM_DEBUGGER_H_
diff --git a/runtime/vm/debugger_api_impl.cc b/runtime/vm/debugger_api_impl.cc
index 18fb194..71610d2 100644
--- a/runtime/vm/debugger_api_impl.cc
+++ b/runtime/vm/debugger_api_impl.cc
@@ -76,16 +76,15 @@
   Isolate* I = T->isolate();
   CHECK_DEBUGGER(I);
   if (!I->debugger()->IsValidObjectId(obj_id)) {
-    return Api::NewError("%s: object id %" Pd " is invalid",
-                         CURRENT_FUNC, obj_id);
+    return Api::NewError("%s: object id %" Pd " is invalid", CURRENT_FUNC,
+                         obj_id);
   }
   return Api::NewHandle(T, I->debugger()->GetCachedObject(obj_id));
 }
 
 
-DART_EXPORT Dart_Handle Dart_StackTraceLength(
-                            Dart_StackTrace trace,
-                            intptr_t* length) {
+DART_EXPORT Dart_Handle Dart_StackTraceLength(Dart_StackTrace trace,
+                                              intptr_t* length) {
   DARTSCOPE(Thread::Current());
   CHECK_NOT_NULL(length);
   CHECK_AND_CAST(DebuggerStackTrace, stack_trace, trace);
@@ -94,10 +93,9 @@
 }
 
 
-DART_EXPORT Dart_Handle Dart_GetActivationFrame(
-                            Dart_StackTrace trace,
-                            int frame_index,
-                            Dart_ActivationFrame* frame) {
+DART_EXPORT Dart_Handle Dart_GetActivationFrame(Dart_StackTrace trace,
+                                                int frame_index,
+                                                Dart_ActivationFrame* frame) {
   DARTSCOPE(Thread::Current());
   CHECK_NOT_NULL(frame);
   CHECK_AND_CAST(DebuggerStackTrace, stack_trace, trace);
@@ -105,8 +103,8 @@
     return Api::NewError("argument 'frame_index' is out of range for %s",
                          CURRENT_FUNC);
   }
-  *frame = reinterpret_cast<Dart_ActivationFrame>(
-       stack_trace->FrameAt(frame_index));
+  *frame =
+      reinterpret_cast<Dart_ActivationFrame>(stack_trace->FrameAt(frame_index));
   return Api::Success();
 }
 
@@ -141,8 +139,7 @@
              event->kind() == ServiceEvent::kBreakpointResolved) {
     Breakpoint* bpt = event->breakpoint();
     ASSERT(bpt != NULL);
-    if (bp_resolved_handler != NULL &&
-        bpt->bpt_location()->IsResolved() &&
+    if (bp_resolved_handler != NULL && bpt->bpt_location()->IsResolved() &&
         !bpt->IsSingleShot()) {
       Dart_CodeLocation location;
       Zone* zone = thread->zone();
@@ -159,10 +156,9 @@
     // Ignore.
   } else if (event->kind() == ServiceEvent::kPauseException) {
     if (exc_thrown_handler != NULL) {
-      Dart_Handle exception =
-          Api::NewHandle(thread, event->exception()->raw());
+      Dart_Handle exception = Api::NewHandle(thread, event->exception()->raw());
       Dart_StackTrace trace =
-      reinterpret_cast<Dart_StackTrace>(isolate->debugger()->StackTrace());
+          reinterpret_cast<Dart_StackTrace>(isolate->debugger()->StackTrace());
       (*exc_thrown_handler)(isolate_id, exception, trace);
     }
   } else if (event->kind() == ServiceEvent::kIsolateStart) {
@@ -177,6 +173,8 @@
     if (isolate_event_handler != NULL) {
       (*isolate_event_handler)(event->isolate_id(), kShutdown);
     }
+  } else if (event->kind() == ServiceEvent::kPausePostRequest) {
+    // Ignore.
   } else {
     UNIMPLEMENTED();
   }
@@ -191,14 +189,14 @@
 
 
 DART_EXPORT void Dart_SetBreakpointResolvedHandler(
-                            Dart_BreakpointResolvedHandler handler) {
+    Dart_BreakpointResolvedHandler handler) {
   bp_resolved_handler = handler;
   Debugger::SetEventHandler(DebuggerEventHandler);
 }
 
 
 DART_EXPORT void Dart_SetExceptionThrownHandler(
-                            Dart_ExceptionThrownHandler handler) {
+    Dart_ExceptionThrownHandler handler) {
   exc_thrown_handler = handler;
   Debugger::SetEventHandler(DebuggerEventHandler);
 }
@@ -210,8 +208,8 @@
 }
 
 
-DART_EXPORT Dart_Handle Dart_SetExceptionPauseInfo(
-                            Dart_ExceptionPauseInfo pause_info) {
+DART_EXPORT Dart_Handle
+Dart_SetExceptionPauseInfo(Dart_ExceptionPauseInfo pause_info) {
   DARTSCOPE(Thread::Current());
   Isolate* I = T->isolate();
   CHECK_DEBUGGER(I);
@@ -235,8 +233,8 @@
   Isolate* I = T->isolate();
   CHECK_DEBUGGER(I);
   CHECK_NOT_NULL(trace);
-  *trace = reinterpret_cast<Dart_StackTrace>(
-      I->debugger()->CurrentStackTrace());
+  *trace =
+      reinterpret_cast<Dart_StackTrace>(I->debugger()->CurrentStackTrace());
   return Api::Success();
 }
 
@@ -256,22 +254,23 @@
     } else {
       Isolate* I = T->isolate();
       *trace = reinterpret_cast<Dart_StackTrace>(
-        I->debugger()->StackTraceFrom(dart_stacktrace));
+          I->debugger()->StackTraceFrom(dart_stacktrace));
     }
     return Api::Success();
   } else {
-    return Api::NewError("Can only get stacktraces from error handles or "
-                         "instances of Error.");
+    return Api::NewError(
+        "Can only get stacktraces from error handles or "
+        "instances of Error.");
   }
 }
 
 
-DART_EXPORT Dart_Handle Dart_ActivationFrameInfo(
-                            Dart_ActivationFrame activation_frame,
-                            Dart_Handle* function_name,
-                            Dart_Handle* script_url,
-                            intptr_t* line_number,
-                            intptr_t* column_number) {
+DART_EXPORT Dart_Handle
+Dart_ActivationFrameInfo(Dart_ActivationFrame activation_frame,
+                         Dart_Handle* function_name,
+                         Dart_Handle* script_url,
+                         intptr_t* line_number,
+                         intptr_t* column_number) {
   DARTSCOPE(Thread::Current());
   CHECK_AND_CAST(ActivationFrame, frame, activation_frame);
   if (function_name != NULL) {
@@ -290,11 +289,11 @@
 }
 
 
-DART_EXPORT Dart_Handle Dart_ActivationFrameGetLocation(
-                            Dart_ActivationFrame activation_frame,
-                            Dart_Handle* function_name,
-                            Dart_Handle* function,
-                            Dart_CodeLocation* location) {
+DART_EXPORT Dart_Handle
+Dart_ActivationFrameGetLocation(Dart_ActivationFrame activation_frame,
+                                Dart_Handle* function_name,
+                                Dart_Handle* function,
+                                Dart_CodeLocation* location) {
   // TODO(hausner): Implement a way to recognize when there
   // is no source code for the code in the frame.
   DARTSCOPE(Thread::Current());
@@ -315,9 +314,9 @@
   return Api::Success();
 }
 
-DART_EXPORT Dart_Handle Dart_ActivationFrameGetFramePointer(
-                            Dart_ActivationFrame activation_frame,
-                            uintptr_t* frame_pointer) {
+DART_EXPORT Dart_Handle
+Dart_ActivationFrameGetFramePointer(Dart_ActivationFrame activation_frame,
+                                    uintptr_t* frame_pointer) {
   DARTSCOPE(Thread::Current());
   CHECK_AND_CAST(ActivationFrame, frame, activation_frame);
 
@@ -340,25 +339,23 @@
 }
 
 
-DART_EXPORT Dart_Handle Dart_GetLocalVariables(
-                            Dart_ActivationFrame activation_frame) {
+DART_EXPORT Dart_Handle
+Dart_GetLocalVariables(Dart_ActivationFrame activation_frame) {
   DARTSCOPE(Thread::Current());
   CHECK_AND_CAST(ActivationFrame, frame, activation_frame);
   return Api::NewHandle(T, frame->GetLocalVariables());
 }
 
 
-DART_EXPORT Dart_Handle Dart_SetBreakpoint(
-                            Dart_Handle script_url_in,
-                            intptr_t line_number) {
+DART_EXPORT Dart_Handle Dart_SetBreakpoint(Dart_Handle script_url_in,
+                                           intptr_t line_number) {
   DARTSCOPE(Thread::Current());
   Isolate* I = T->isolate();
   CHECK_DEBUGGER(I);
   UNWRAP_AND_CHECK_PARAM(String, script_url, script_url_in);
 
   Debugger* debugger = I->debugger();
-  Breakpoint* bpt =
-      debugger->SetBreakpointAtLine(script_url, line_number);
+  Breakpoint* bpt = debugger->SetBreakpointAtLine(script_url, line_number);
   if (bpt == NULL) {
     return Api::NewError("%s: could not set breakpoint at line %" Pd " in '%s'",
                          CURRENT_FUNC, line_number, script_url.ToCString());
@@ -376,7 +373,7 @@
   Breakpoint* bpt = debugger->GetBreakpointById(bp_id);
   if (bpt == NULL) {
     return Api::NewError("%s: breakpoint with id %" Pd " does not exist",
-                           CURRENT_FUNC, bp_id);
+                         CURRENT_FUNC, bp_id);
   }
   return Api::NewHandle(T, bpt->bpt_location()->url());
 }
@@ -401,10 +398,10 @@
 }
 
 
-DART_EXPORT Dart_Handle Dart_SetBreakpointAtEntry(
-                            Dart_Handle library_in,
-                            Dart_Handle class_name_in,
-                            Dart_Handle function_name_in) {
+DART_EXPORT Dart_Handle
+Dart_SetBreakpointAtEntry(Dart_Handle library_in,
+                          Dart_Handle class_name_in,
+                          Dart_Handle function_name_in) {
   DARTSCOPE(Thread::Current());
   Isolate* I = T->isolate();
   CHECK_DEBUGGER(I);
@@ -415,8 +412,7 @@
   // Ensure that the library is loaded.
   if (!library.Loaded()) {
     return Api::NewError(
-        "%s expects library argument 'library_in' to be loaded.",
-        CURRENT_FUNC);
+        "%s expects library argument 'library_in' to be loaded.", CURRENT_FUNC);
   }
 
   // Resolve the breakpoint target function.
@@ -425,11 +421,9 @@
       debugger->ResolveFunction(library, class_name, function_name));
   if (bp_target.IsNull()) {
     const bool toplevel = class_name.Length() == 0;
-    return Api::NewError("%s: could not find function '%s%s%s'",
-                         CURRENT_FUNC,
+    return Api::NewError("%s: could not find function '%s%s%s'", CURRENT_FUNC,
                          toplevel ? "" : class_name.ToCString(),
-                         toplevel ? "" : ".",
-                         function_name.ToCString());
+                         toplevel ? "" : ".", function_name.ToCString());
   }
 
   Breakpoint* bpt = debugger->SetBreakpointAtEntry(bp_target, false);
@@ -442,10 +436,9 @@
 }
 
 
-DART_EXPORT Dart_Handle Dart_OneTimeBreakAtEntry(
-                            Dart_Handle library_in,
-                            Dart_Handle class_name_in,
-                            Dart_Handle function_name_in) {
+DART_EXPORT Dart_Handle Dart_OneTimeBreakAtEntry(Dart_Handle library_in,
+                                                 Dart_Handle class_name_in,
+                                                 Dart_Handle function_name_in) {
   DARTSCOPE(Thread::Current());
   Isolate* I = T->isolate();
   CHECK_DEBUGGER(I);
@@ -456,8 +449,7 @@
   // Ensure that the library is loaded.
   if (!library.Loaded()) {
     return Api::NewError(
-        "%s expects library argument 'library_in' to be loaded.",
-        CURRENT_FUNC);
+        "%s expects library argument 'library_in' to be loaded.", CURRENT_FUNC);
   }
 
   // Resolve the breakpoint target function.
@@ -466,15 +458,13 @@
       debugger->ResolveFunction(library, class_name, function_name));
   if (bp_target.IsNull()) {
     const bool toplevel = class_name.Length() == 0;
-    return Api::NewError("%s: could not find function '%s%s%s'",
-                         CURRENT_FUNC,
+    return Api::NewError("%s: could not find function '%s%s%s'", CURRENT_FUNC,
                          toplevel ? "" : class_name.ToCString(),
-                         toplevel ? "" : ".",
-                         function_name.ToCString());
+                         toplevel ? "" : ".", function_name.ToCString());
   }
 
-  const Error& error = Error::Handle(Z,
-      debugger->OneTimeBreakAtEntry(bp_target));
+  const Error& error =
+      Error::Handle(Z, debugger->OneTimeBreakAtEntry(bp_target));
   if (!error.IsNull()) {
     return Api::NewHandle(T, error.raw());
   }
@@ -545,11 +535,10 @@
   DARTSCOPE(Thread::Current());
   Isolate* I = T->isolate();
   CHECK_DEBUGGER(I);
-  const Library& lib =
-      Library::Handle(Z, Library::GetLibrary(library_id));
+  const Library& lib = Library::Handle(Z, Library::GetLibrary(library_id));
   if (lib.IsNull()) {
-    return Api::NewError("%s: %" Pd " is not a valid library id",
-                         CURRENT_FUNC, library_id);
+    return Api::NewError("%s: %" Pd " is not a valid library id", CURRENT_FUNC,
+                         library_id);
   }
   return Api::NewHandle(T, I->debugger()->GetLibraryFields(lib));
 }
@@ -562,16 +551,16 @@
 
   const Library& lib = Library::Handle(Z, Library::GetLibrary(library_id));
   if (lib.IsNull()) {
-    return Api::NewError("%s: %" Pd " is not a valid library id",
-                         CURRENT_FUNC, library_id);
+    return Api::NewError("%s: %" Pd " is not a valid library id", CURRENT_FUNC,
+                         library_id);
   }
   return Api::NewHandle(T, I->debugger()->GetGlobalFields(lib));
 }
 
 
-DART_EXPORT Dart_Handle Dart_ActivationFrameEvaluate(
-                            Dart_ActivationFrame activation_frame,
-                            Dart_Handle expr_in) {
+DART_EXPORT Dart_Handle
+Dart_ActivationFrameEvaluate(Dart_ActivationFrame activation_frame,
+                             Dart_Handle expr_in) {
   DARTSCOPE(Thread::Current());
   CHECK_DEBUGGER(T->isolate());
   CHECK_AND_CAST(ActivationFrame, frame, activation_frame);
@@ -595,26 +584,22 @@
   // Type extends Instance, must check first.
   if (target.IsType()) {
     const Class& cls = Class::Handle(Z, Type::Cast(target).type_class());
-    return Api::NewHandle(T, cls.Evaluate(expr,
-                                          Array::empty_array(),
-                                          Array::empty_array()));
+    return Api::NewHandle(
+        T, cls.Evaluate(expr, Array::empty_array(), Array::empty_array()));
   } else if (target.IsInstance()) {
     const Instance& inst = Instance::Cast(target);
     const Class& receiver_cls = Class::Handle(Z, inst.clazz());
-    return Api::NewHandle(T, inst.Evaluate(receiver_cls,
-                                           expr,
-                                           Array::empty_array(),
-                                           Array::empty_array()));
+    return Api::NewHandle(
+        T, inst.Evaluate(receiver_cls, expr, Array::empty_array(),
+                         Array::empty_array()));
   } else if (target.IsLibrary()) {
     const Library& lib = Library::Cast(target);
-    return Api::NewHandle(T, lib.Evaluate(expr,
-                                          Array::empty_array(),
-                                          Array::empty_array()));
+    return Api::NewHandle(
+        T, lib.Evaluate(expr, Array::empty_array(), Array::empty_array()));
   } else if (target.IsClass()) {
     const Class& cls = Class::Cast(target);
-    return Api::NewHandle(T, cls.Evaluate(expr,
-                                          Array::empty_array(),
-                                          Array::empty_array()));
+    return Api::NewHandle(
+        T, cls.Evaluate(expr, Array::empty_array(), Array::empty_array()));
   }
   return Api::NewError("%s: unsupported target type", CURRENT_FUNC);
 }
@@ -623,7 +608,7 @@
 DART_EXPORT Dart_Handle Dart_GetObjClass(Dart_Handle object_in) {
   DARTSCOPE(Thread::Current());
   UNWRAP_AND_CHECK_PARAM(Instance, obj, object_in);
-  return Api::NewHandle(T, obj.GetType());
+  return Api::NewHandle(T, obj.GetType(Heap::kNew));
 }
 
 
@@ -641,8 +626,8 @@
   DARTSCOPE(Thread::Current());
   Isolate* I = T->isolate();
   if (!I->class_table()->IsValidIndex(class_id)) {
-    return Api::NewError("%s: %" Pd " is not a valid class id",
-                         CURRENT_FUNC, class_id);
+    return Api::NewError("%s: %" Pd " is not a valid class id", CURRENT_FUNC,
+                         class_id);
   }
   return Api::NewHandle(T, I->class_table()->At(class_id));
 }
@@ -694,11 +679,10 @@
 }
 
 
-DART_EXPORT Dart_Handle Dart_GetClosureInfo(
-                            Dart_Handle closure,
-                            Dart_Handle* name,
-                            Dart_Handle* signature,
-                            Dart_CodeLocation* location) {
+DART_EXPORT Dart_Handle Dart_GetClosureInfo(Dart_Handle closure,
+                                            Dart_Handle* name,
+                                            Dart_Handle* signature,
+                                            Dart_CodeLocation* location) {
   DARTSCOPE(Thread::Current());
   UNWRAP_AND_CHECK_PARAM(Instance, instance, closure);
   CHECK_NOT_NULL(location);
@@ -737,18 +721,17 @@
 }
 
 
-DART_EXPORT Dart_Handle Dart_GetClassInfo(
-                            intptr_t cls_id,
-                            Dart_Handle* class_name,
-                            intptr_t* library_id,
-                            intptr_t* super_class_id,
-                            Dart_Handle* static_fields) {
+DART_EXPORT Dart_Handle Dart_GetClassInfo(intptr_t cls_id,
+                                          Dart_Handle* class_name,
+                                          intptr_t* library_id,
+                                          intptr_t* super_class_id,
+                                          Dart_Handle* static_fields) {
   DARTSCOPE(Thread::Current());
   Isolate* I = T->isolate();
   CHECK_DEBUGGER(I);
   if (!I->class_table()->IsValidIndex(cls_id)) {
-    return Api::NewError("%s: %" Pd " is not a valid class id",
-                         CURRENT_FUNC, cls_id);
+    return Api::NewError("%s: %" Pd " is not a valid class id", CURRENT_FUNC,
+                         cls_id);
   }
   Class& cls = Class::Handle(Z, I->class_table()->At(cls_id));
   if (class_name != NULL) {
@@ -766,21 +749,19 @@
     }
   }
   if (static_fields != NULL) {
-    *static_fields =
-        Api::NewHandle(T, I->debugger()->GetStaticFields(cls));
+    *static_fields = Api::NewHandle(T, I->debugger()->GetStaticFields(cls));
   }
   return Api::Success();
 }
 
 
-DART_EXPORT Dart_Handle Dart_ScriptGetSource(
-                            intptr_t library_id,
-                            Dart_Handle script_url_in) {
+DART_EXPORT Dart_Handle Dart_ScriptGetSource(intptr_t library_id,
+                                             Dart_Handle script_url_in) {
   DARTSCOPE(Thread::Current());
   const Library& lib = Library::Handle(Library::GetLibrary(library_id));
   if (lib.IsNull()) {
-    return Api::NewError("%s: %" Pd " is not a valid library id",
-                         CURRENT_FUNC, library_id);
+    return Api::NewError("%s: %" Pd " is not a valid library id", CURRENT_FUNC,
+                         library_id);
   }
   UNWRAP_AND_CHECK_PARAM(String, script_url, script_url_in);
   const Script& script = Script::Handle(lib.LookupScript(script_url));
@@ -793,14 +774,13 @@
 }
 
 
-DART_EXPORT Dart_Handle Dart_ScriptGetTokenInfo(
-                            intptr_t library_id,
-                            Dart_Handle script_url_in) {
+DART_EXPORT Dart_Handle Dart_ScriptGetTokenInfo(intptr_t library_id,
+                                                Dart_Handle script_url_in) {
   DARTSCOPE(Thread::Current());
   const Library& lib = Library::Handle(Library::GetLibrary(library_id));
   if (lib.IsNull()) {
-    return Api::NewError("%s: %" Pd " is not a valid library id",
-                         CURRENT_FUNC, library_id);
+    return Api::NewError("%s: %" Pd " is not a valid library id", CURRENT_FUNC,
+                         library_id);
   }
   UNWRAP_AND_CHECK_PARAM(String, script_url, script_url_in);
   const Script& script = Script::Handle(lib.LookupScript(script_url));
@@ -822,11 +802,11 @@
   UNWRAP_AND_CHECK_PARAM(String, library_url, library_url_in);
   UNWRAP_AND_CHECK_PARAM(String, script_url, script_url_in);
 
-  const Library& library = Library::Handle(Z,
-      Library::LookupLibrary(T, library_url));
+  const Library& library =
+      Library::Handle(Z, Library::LookupLibrary(T, library_url));
   if (library.IsNull()) {
-    return Api::NewError("%s: library '%s' not found",
-                         CURRENT_FUNC, library_url.ToCString());
+    return Api::NewError("%s: library '%s' not found", CURRENT_FUNC,
+                         library_url.ToCString());
   }
 
   const Script& script = Script::Handle(Z, library.LookupScript(script_url));
@@ -844,11 +824,11 @@
   DARTSCOPE(Thread::Current());
   UNWRAP_AND_CHECK_PARAM(String, library_url, library_url_in);
 
-  const Library& library = Library::Handle(Z,
-      Library::LookupLibrary(T, library_url));
+  const Library& library =
+      Library::Handle(Z, Library::LookupLibrary(T, library_url));
   if (library.IsNull()) {
-    return Api::NewError("%s: library '%s' not found",
-                         CURRENT_FUNC, library_url.ToCString());
+    return Api::NewError("%s: library '%s' not found", CURRENT_FUNC,
+                         library_url.ToCString());
   }
   const Array& loaded_scripts = Array::Handle(Z, library.LoadedScripts());
   ASSERT(!loaded_scripts.IsNull());
@@ -874,7 +854,7 @@
   int num_libs = libs.Length();
 
   // Create new list and populate with the url of loaded libraries.
-  Library &lib = Library::Handle();
+  Library& lib = Library::Handle();
   const Array& library_id_list = Array::Handle(Z, Array::New(num_libs));
   for (int i = 0; i < num_libs; i++) {
     lib ^= libs.At(i);
@@ -890,8 +870,8 @@
   DARTSCOPE(Thread::Current());
   const Library& lib = Library::Handle(Z, Library::GetLibrary(library_id));
   if (lib.IsNull()) {
-    return Api::NewError("%s: %" Pd " is not a valid library id",
-                         CURRENT_FUNC, library_id);
+    return Api::NewError("%s: %" Pd " is not a valid library id", CURRENT_FUNC,
+                         library_id);
   }
   return Api::NewHandle(T, lib.raw());
 }
@@ -916,8 +896,8 @@
   DARTSCOPE(Thread::Current());
   const Library& lib = Library::Handle(Library::GetLibrary(library_id));
   if (lib.IsNull()) {
-    return Api::NewError("%s: %" Pd " is not a valid library id",
-                         CURRENT_FUNC, library_id);
+    return Api::NewError("%s: %" Pd " is not a valid library id", CURRENT_FUNC,
+                         library_id);
   }
   const GrowableObjectArray& import_list =
       GrowableObjectArray::Handle(GrowableObjectArray::New(8));
@@ -953,8 +933,8 @@
   DARTSCOPE(Thread::Current());
   const Library& lib = Library::Handle(Z, Library::GetLibrary(library_id));
   if (lib.IsNull()) {
-    return Api::NewError("%s: %" Pd " is not a valid library id",
-                         CURRENT_FUNC, library_id);
+    return Api::NewError("%s: %" Pd " is not a valid library id", CURRENT_FUNC,
+                         library_id);
   }
   return Api::NewHandle(T, lib.url());
 }
@@ -966,8 +946,8 @@
   CHECK_NOT_NULL(is_debuggable);
   const Library& lib = Library::Handle(Library::GetLibrary(library_id));
   if (lib.IsNull()) {
-    return Api::NewError("%s: %" Pd " is not a valid library id",
-                         CURRENT_FUNC, library_id);
+    return Api::NewError("%s: %" Pd " is not a valid library id", CURRENT_FUNC,
+                         library_id);
   }
   *is_debuggable = lib.IsDebuggable();
   return Api::Success();
@@ -979,8 +959,8 @@
   DARTSCOPE(Thread::Current());
   const Library& lib = Library::Handle(Z, Library::GetLibrary(library_id));
   if (lib.IsNull()) {
-    return Api::NewError("%s: %" Pd " is not a valid library id",
-                         CURRENT_FUNC, library_id);
+    return Api::NewError("%s: %" Pd " is not a valid library id", CURRENT_FUNC,
+                         library_id);
   }
   lib.set_debuggable(is_debuggable);
   return Api::Success();
diff --git a/runtime/vm/debugger_api_impl_test.cc b/runtime/vm/debugger_api_impl_test.cc
index a41d10b..e48ab54 100644
--- a/runtime/vm/debugger_api_impl_test.cc
+++ b/runtime/vm/debugger_api_impl_test.cc
@@ -16,7 +16,7 @@
 #ifndef PRODUCT
 
 static bool breakpoint_hit = false;
-static int  breakpoint_hit_counter = 0;
+static int breakpoint_hit_counter = 0;
 static Dart_Handle script_lib = NULL;
 
 static const bool verbose = true;
@@ -31,9 +31,8 @@
   ASSERT(script_lib != NULL);
   ASSERT(!Dart_IsError(script_lib));
   ASSERT(Dart_IsLibrary(script_lib));
-  Dart_Handle res = Dart_SetBreakpointAtEntry(script_lib,
-                        NewString(cname),
-                        NewString(fname));
+  Dart_Handle res =
+      Dart_SetBreakpointAtEntry(script_lib, NewString(cname), NewString(fname));
   EXPECT(Dart_IsInteger(res));
 }
 
@@ -104,8 +103,8 @@
   Dart_Handle url;
   intptr_t line_number = 0;
   intptr_t library_id = 0;
-  res = Dart_ActivationFrameInfo(
-            frame, &func_name, &url, &line_number, &library_id);
+  res = Dart_ActivationFrameInfo(frame, &func_name, &url, &line_number,
+                                 &library_id);
   EXPECT_TRUE(res);
   OS::SNPrint(info_str, sizeof(info_str), "function %s (%s:%" Pd ")",
               ToCString(func_name), ToCString(url), line_number);
@@ -389,10 +388,9 @@
 
   for (intptr_t frame_index = 0; frame_index < trace_len; frame_index++) {
     EXPECT_VALID(Dart_GetActivationFrame(trace, frame_index, &frame));
-    EXPECT_VALID(Dart_ActivationFrameInfo(frame, &func_name,
-                                          NULL, NULL, NULL));
-    int pos = OS::SNPrint(buffer, buffer_size, "[%" Pd "] %s { ",
-                          frame_index, ToCString(func_name));
+    EXPECT_VALID(Dart_ActivationFrameInfo(frame, &func_name, NULL, NULL, NULL));
+    int pos = OS::SNPrint(buffer, buffer_size, "[%" Pd "] %s { ", frame_index,
+                          ToCString(func_name));
     buffer += pos;
     buffer_size -= pos;
 
@@ -415,8 +413,7 @@
       const char* value_cstr = NULL;
       EXPECT_VALID(Dart_StringToCString(name, &name_cstr));
       EXPECT_VALID(Dart_StringToCString(value_str, &value_cstr));
-      pos = OS::SNPrint(buffer, buffer_size, "%s = %s ",
-                        name_cstr, value_cstr);
+      pos = OS::SNPrint(buffer, buffer_size, "%s = %s ", name_cstr, value_cstr);
       buffer += pos;
       buffer_size -= pos;
     }
@@ -493,22 +490,24 @@
   dart_args[1] = Dart_NewInteger(kLowThreshold);
   EXPECT_VALID(Dart_Invoke(script_lib, NewString("test"), 2, dart_args));
   if (optimize) {
-    EXPECT_STREQ("[0] breakpointNow { }\n"
-                 "[1] helper { a = 5 b = 99 stop = <optimized out> }\n"
-                 "[2] anotherMiddleMan { one = <optimized out> "
-                 "two = <optimized out> stop = <optimized out> }\n"
-                 "[3] middleMan { x = 5 limit = 100 stop = true value = 24255"
-                 " i = 99 }\n"
-                 "[4] test { stop = true limit = 100 }\n",
-                 stack_buffer);
+    EXPECT_STREQ(
+        "[0] breakpointNow { }\n"
+        "[1] helper { a = 5 b = 99 stop = <optimized out> }\n"
+        "[2] anotherMiddleMan { one = <optimized out> "
+        "two = <optimized out> stop = <optimized out> }\n"
+        "[3] middleMan { x = 5 limit = 100 stop = true value = 24255"
+        " i = 99 }\n"
+        "[4] test { stop = true limit = 100 }\n",
+        stack_buffer);
   } else {
-    EXPECT_STREQ("[0] breakpointNow { }\n"
-                 "[1] helper { a = 5 b = 99 stop = true }\n"
-                 "[2] anotherMiddleMan { one = 5 two = 99 stop = true }\n"
-                 "[3] middleMan { x = 5 limit = 100 stop = true value = 24255"
-                 " i = 99 }\n"
-                 "[4] test { stop = true limit = 100 }\n",
-                 stack_buffer);
+    EXPECT_STREQ(
+        "[0] breakpointNow { }\n"
+        "[1] helper { a = 5 b = 99 stop = true }\n"
+        "[2] anotherMiddleMan { one = 5 two = 99 stop = true }\n"
+        "[3] middleMan { x = 5 limit = 100 stop = true value = 24255"
+        " i = 99 }\n"
+        "[4] test { stop = true limit = 100 }\n",
+        stack_buffer);
   }
 
   FLAG_optimization_counter_threshold = saved_threshold;
@@ -587,26 +586,28 @@
   dart_args[1] = Dart_NewInteger(kLowThreshold);
   EXPECT_VALID(Dart_Invoke(script_lib, NewString("test"), 2, dart_args));
   if (optimize) {
-    EXPECT_STREQ("[0] breakpointNow { }\n"
-                 "[1] helper { a = 50 b = 99 stop = <optimized out> }\n"
-                 "[2] <anonymous closure> { x = 5 i = 99 stop = true"
-                 " value = <optimized out> }\n"
-                 "[3] anotherMiddleMan { func = <optimized out> }\n"
-                 "[4] middleMan { x = 5 limit = 100 stop = true"
-                 " value = 242550 i = 99 }\n"
-                 "[5] test { stop = true limit = 100 }\n",
-                 stack_buffer);
+    EXPECT_STREQ(
+        "[0] breakpointNow { }\n"
+        "[1] helper { a = 50 b = 99 stop = <optimized out> }\n"
+        "[2] <anonymous closure> { x = 5 i = 99 stop = true"
+        " value = <optimized out> }\n"
+        "[3] anotherMiddleMan { func = <optimized out> }\n"
+        "[4] middleMan { x = 5 limit = 100 stop = true"
+        " value = 242550 i = 99 }\n"
+        "[5] test { stop = true limit = 100 }\n",
+        stack_buffer);
   } else {
-    EXPECT_STREQ("[0] breakpointNow { }\n"
-                 "[1] helper { a = 50 b = 99 stop = true }\n"
-                 "[2] <anonymous closure> { x = 5 i = 99 stop = true"
-                 " value = 10 }\n"
-                 "[3] anotherMiddleMan {"
-                 " func = Closure: (dynamic) => dynamic }\n"
-                 "[4] middleMan { x = 5 limit = 100 stop = true"
-                 " value = 242550 i = 99 }\n"
-                 "[5] test { stop = true limit = 100 }\n",
-                 stack_buffer);
+    EXPECT_STREQ(
+        "[0] breakpointNow { }\n"
+        "[1] helper { a = 50 b = 99 stop = true }\n"
+        "[2] <anonymous closure> { x = 5 i = 99 stop = true"
+        " value = 10 }\n"
+        "[3] anotherMiddleMan {"
+        " func = Closure: (dynamic) => dynamic }\n"
+        "[4] middleMan { x = 5 limit = 100 stop = true"
+        " value = 242550 i = 99 }\n"
+        "[5] test { stop = true limit = 100 }\n",
+        stack_buffer);
   }
 
   FLAG_optimization_counter_threshold = saved_threshold;
@@ -691,22 +692,22 @@
 }
 
 static const char* step_into_expected_bpts[] = {
-    "main",        // entry
-    "main",        // call foo
-      "foo",       // entry
-      "foo",       // call f1
-        "f1",      // entry
-        "f1",      // return
-      "foo",       // call initializer
-      "foo",       // call kvmk
-        "X.kvmk",  // entry
-        "X.kvmk",  // call
-          "f2",    // entry
-          "f2",    // return
-        "X.kvmk",  // call +
-        "X.kvmk",  // return
-      "foo",       // return
-    "main"         // return
+    "main",    // entry
+    "main",    // call foo
+    "foo",     // entry
+    "foo",     // call f1
+    "f1",      // entry
+    "f1",      // return
+    "foo",     // call initializer
+    "foo",     // call kvmk
+    "X.kvmk",  // entry
+    "X.kvmk",  // call
+    "f2",      // entry
+    "f2",      // return
+    "X.kvmk",  // call +
+    "X.kvmk",  // return
+    "foo",     // return
+    "main"     // return
 };
 
 void TestStepIntoHandler(Dart_IsolateId isolate_id,
@@ -785,8 +786,8 @@
   Dart_StackTrace trace;
   Dart_GetStackTrace(&trace);
   if (verbose) {
-    OS::Print(">>> Breakpoint nr. %d in %s <<<\n",
-              breakpoint_hit_counter, BreakpointInfo(trace));
+    OS::Print(">>> Breakpoint nr. %d in %s <<<\n", breakpoint_hit_counter,
+              BreakpointInfo(trace));
     PrintStackTrace(trace);
   }
   breakpoint_hit = true;
@@ -867,8 +868,8 @@
                            const Dart_CodeLocation& location) {
   Dart_StackTrace trace;
   Dart_GetStackTrace(&trace);
-  const char* expected_bpts[] = {
-      "moo", "moo", "foo", "moo", "moo", "foo", "moo", "moo", "foo", "main"};
+  const char* expected_bpts[] = {"moo", "moo", "foo", "moo", "moo",
+                                 "foo", "moo", "moo", "foo", "main"};
   const intptr_t expected_bpts_length = ARRAY_SIZE(expected_bpts);
   intptr_t trace_len;
   Dart_Handle res = Dart_StackTraceLength(trace, &trace_len);
@@ -1086,17 +1087,15 @@
       "}                               \n";
 
   LoadScript(kScriptChars);
-  Dart_Handle result = Dart_SetNativeResolver(script_lib,
-                                              &NoopNativeResolver,
-                                              NULL);
+  Dart_Handle result =
+      Dart_SetNativeResolver(script_lib, &NoopNativeResolver, NULL);
   EXPECT_VALID(result);
   Dart_SetPausedEventHandler(&TestBreakpointHandlerWithVerify);
 
   Dart_Handle script_url = NewString(TestCase::url());
 
   const intptr_t num_breakpoints = 9;
-  intptr_t breakpoint_lines[num_breakpoints] =
-      {5, 6, 7, 8, 9, 10, 11, 12, 13};
+  intptr_t breakpoint_lines[num_breakpoints] = {5, 6, 7, 8, 9, 10, 11, 12, 13};
 
   for (intptr_t i = 0; i < num_breakpoints; i++) {
     result = Dart_SetBreakpoint(script_url, breakpoint_lines[i]);
@@ -1202,14 +1201,12 @@
   struct {
     const char* field_name;
     const char* field_value;
-  } expected[] = {
-    // Expected values at first breakpoint.
-    { "bla", "yada yada yada"},
-    { "u", "null" },
-    // Expected values at second breakpoint.
-    { "bla", "silence is golden" },
-    { "u", "442" }
-  };
+  } expected[] = {// Expected values at first breakpoint.
+                  {"bla", "yada yada yada"},
+                  {"u", "null"},
+                  // Expected values at second breakpoint.
+                  {"bla", "silence is golden"},
+                  {"u", "442"}};
   ASSERT(breakpoint_hit_counter < 2);
   int expected_idx = breakpoint_hit_counter * expected_num_fields;
   breakpoint_hit_counter++;
@@ -1248,19 +1245,19 @@
 
 TEST_CASE(Debug_InspectStaticField) {
   const char* kScriptChars =
-    " class A {                                 \n"
-    "   static var bla = 'yada yada yada';      \n"
-    "   static var u;                           \n"
-    " }                                         \n"
-    "                                           \n"
-    " debugBreak() { }                          \n"
-    " main() {                                  \n"
-    "   var a = new A();                        \n"
-    "   debugBreak();                           \n"
-    "   A.u = 442;                              \n"
-    "   A.bla = 'silence is golden';            \n"
-    "   debugBreak();                           \n"
-    " }                                         \n";
+      " class A {                                 \n"
+      "   static var bla = 'yada yada yada';      \n"
+      "   static var u;                           \n"
+      " }                                         \n"
+      "                                           \n"
+      " debugBreak() { }                          \n"
+      " main() {                                  \n"
+      "   var a = new A();                        \n"
+      "   debugBreak();                           \n"
+      "   A.u = 442;                              \n"
+      "   A.bla = 'silence is golden';            \n"
+      "   debugBreak();                           \n"
+      " }                                         \n";
 
   LoadScript(kScriptChars);
   Dart_SetPausedEventHandler(&InspectStaticFieldHandler);
@@ -1274,18 +1271,18 @@
 
 TEST_CASE(Debug_InspectObject) {
   const char* kScriptChars =
-    " class A {                                 \n"
-    "   var a_field = 'a';                      \n"
-    "   static var bla = 'yada yada yada';      \n"
-    "   static var error = unresolvedName();    \n"
-    "   var d = 42.1;                           \n"
-    " }                                         \n"
-    " class B extends A {                       \n"
-    "   var oneDay = const Duration(hours: 24); \n"
-    "   static var bla = 'blah blah';           \n"
-    " }                                         \n"
-    " get_b() { return new B(); }               \n"
-    " get_int() { return 666; }                 \n";
+      " class A {                                 \n"
+      "   var a_field = 'a';                      \n"
+      "   static var bla = 'yada yada yada';      \n"
+      "   static var error = unresolvedName();    \n"
+      "   var d = 42.1;                           \n"
+      " }                                         \n"
+      " class B extends A {                       \n"
+      "   var oneDay = const Duration(hours: 24); \n"
+      "   static var bla = 'blah blah';           \n"
+      " }                                         \n"
+      " get_b() { return new B(); }               \n"
+      " get_int() { return 666; }                 \n";
 
   // Number of instance fields in an object of class B.
   const intptr_t kNumObjectFields = 3;
@@ -1528,9 +1525,8 @@
   Dart_EnterScope();
   LoadScript(kScriptChars);
 
-  Dart_Handle result = Dart_SetNativeResolver(script_lib,
-                                              &InterruptNativeResolver,
-                                              NULL);
+  Dart_Handle result =
+      Dart_SetNativeResolver(script_lib, &InterruptNativeResolver, NULL);
   EXPECT_VALID(result);
 
   Dart_Handle retval = Invoke("main");
@@ -1590,18 +1586,14 @@
 
 
 static void StackTraceDump1BreakpointHandler(
-                Dart_IsolateId isolate_id,
-                intptr_t bp_id,
-                const Dart_CodeLocation& location) {
+    Dart_IsolateId isolate_id,
+    intptr_t bp_id,
+    const Dart_CodeLocation& location) {
   Dart_StackTrace trace;
   Dart_GetStackTrace(&trace);
   const int kStackTraceLen = 4;
   static const char* expected_trace[kStackTraceLen] = {
-    "local_to_main",
-    "Test.local1_to_func1",
-    "Test.func1",
-    "main"
-  };
+      "local_to_main", "Test.local1_to_func1", "Test.func1", "main"};
 
   intptr_t trace_len;
   Dart_Handle res = Dart_StackTraceLength(trace, &trace_len);
@@ -1672,15 +1664,11 @@
   Dart_ListSetAt(frame3_locals, 12, NewString("main_local"));
   Dart_ListSetAt(frame3_locals, 13, Dart_Null());
 
-  Dart_Handle expected_locals[] = {
-    frame0_locals,
-    frame1_locals,
-    frame2_locals,
-    frame3_locals
-  };
+  Dart_Handle expected_locals[] = {frame0_locals, frame1_locals, frame2_locals,
+                                   frame3_locals};
   breakpoint_hit_counter++;
-  VerifyStackTrace(trace, expected_trace, expected_locals,
-                   kStackTraceLen, true);
+  VerifyStackTrace(trace, expected_trace, expected_locals, kStackTraceLen,
+                   true);
 }
 
 
@@ -1751,12 +1739,8 @@
                                             Dart_StackTrace trace) {
   const int kStackTraceLen = 5;
   static const char* expected_trace[kStackTraceLen] = {
-    "Object._noSuchMethod",
-    "Object.noSuchMethod",
-    "Test.local1_to_func1",
-    "Test.func1",
-    "main"
-  };
+      "Object._noSuchMethod", "Object.noSuchMethod", "Test.local1_to_func1",
+      "Test.func1", "main"};
 
   intptr_t trace_len;
   Dart_Handle res = Dart_StackTraceLength(trace, &trace_len);
@@ -1838,16 +1822,11 @@
   Dart_ListSetAt(frame4_locals, 10, NewString("func1"));
   Dart_ListSetAt(frame4_locals, 11, Dart_Null());
 
-  Dart_Handle expected_locals[] = {
-    frame0_locals,
-    frame1_locals,
-    frame2_locals,
-    frame3_locals,
-    frame4_locals
-  };
+  Dart_Handle expected_locals[] = {frame0_locals, frame1_locals, frame2_locals,
+                                   frame3_locals, frame4_locals};
   breakpoint_hit_counter++;
-  VerifyStackTrace(trace, expected_trace, expected_locals,
-                   kStackTraceLen, true);
+  VerifyStackTrace(trace, expected_trace, expected_locals, kStackTraceLen,
+                   true);
 }
 
 
@@ -2028,7 +2007,7 @@
   closure = Dart_EvaluateExpr(script_lib, NewString("(x) => l.length + x"));
   EXPECT_VALID(closure);
   EXPECT(Dart_IsClosure(closure));
-  Dart_Handle args[1] = { Dart_NewInteger(1) };
+  Dart_Handle args[1] = {Dart_NewInteger(1)};
   len = Dart_InvokeClosure(closure, 1, args);
   EXPECT_VALID(len);
   EXPECT(Dart_IsNumber(len));
@@ -2077,8 +2056,8 @@
   Dart_SetExceptionPauseInfo(kPauseOnAllExceptions);
   breakpoint_hit_counter = 0;
 
-  Dart_Handle result = Dart_EvaluateExpr(script_lib, NewString(
-      "() { var p = new Point(3, 4); throw p; } ())"));
+  Dart_Handle result = Dart_EvaluateExpr(
+      script_lib, NewString("() { var p = new Point(3, 4); throw p; } ())"));
   EXPECT(Dart_IsError(result));
   EXPECT_EQ(1, breakpoint_hit_counter);
 }
@@ -2206,26 +2185,20 @@
   Dart_Handle Test1_type = Dart_GetType(script_lib, Test1_name, 0, NULL);
   Dart_Handle type_args = Dart_NewList(1);
   Dart_ListSetAt(type_args, 0, int_type);
-  Dart_Handle Test2_int_type = Dart_GetType(script_lib,
-                                            Test2_name,
-                                            1,
-                                            &type_args);
+  Dart_Handle Test2_int_type =
+      Dart_GetType(script_lib, Test2_name, 1, &type_args);
   Dart_Handle Test3_type = Dart_GetType(script_lib, Test3_name, 0, NULL);
   type_args = Dart_NewList(2);
   Dart_ListSetAt(type_args, 0, int_type);
   Dart_ListSetAt(type_args, 1, Test_type);
-  Dart_Handle Test4_int_type = Dart_GetType(script_lib,
-                                            Test4_name,
-                                            2,
-                                            &type_args);
+  Dart_Handle Test4_int_type =
+      Dart_GetType(script_lib, Test4_name, 2, &type_args);
   type_args = Dart_NewList(3);
   Dart_ListSetAt(type_args, 0, int_type);
   Dart_ListSetAt(type_args, 1, Test_type);
   Dart_ListSetAt(type_args, 2, int_type);
-  Dart_Handle Test5_int_type = Dart_GetType(script_lib,
-                                            Test5_name,
-                                            3,
-                                            &type_args);
+  Dart_Handle Test5_int_type =
+      Dart_GetType(script_lib, Test5_name, 3, &type_args);
   {
     Dart_Handle super_type = Dart_GetSupertype(object_type);
     EXPECT(super_type == Dart_Null());
@@ -2257,9 +2230,10 @@
   {
     Dart_Handle set_type = Dart_GetType(core_lib, set_name, 0, NULL);
     Dart_Handle super_type = Dart_GetSupertype(set_type);
+    Dart_Handle super2_type = Dart_GetSupertype(super_type);
     Dart_Handle iterable_type = Dart_GetType(core_lib, iterable_name, 0, NULL);
     const Type& expected_type = Api::UnwrapTypeHandle(zone, iterable_type);
-    const Type& actual_type = Api::UnwrapTypeHandle(zone, super_type);
+    const Type& actual_type = Api::UnwrapTypeHandle(zone, super2_type);
     EXPECT(expected_type.raw() == actual_type.raw());
   }
   {
diff --git a/runtime/vm/debugger_arm.cc b/runtime/vm/debugger_arm.cc
index 1705b30..c14eb71 100644
--- a/runtime/vm/debugger_arm.cc
+++ b/runtime/vm/debugger_arm.cc
@@ -57,7 +57,7 @@
   is_enabled_ = false;
 }
 
-#endif   // !PRODUCT
+#endif  // !PRODUCT
 
 }  // namespace dart
 
diff --git a/runtime/vm/debugger_arm64.cc b/runtime/vm/debugger_arm64.cc
index b8ab73c..842d1a2 100644
--- a/runtime/vm/debugger_arm64.cc
+++ b/runtime/vm/debugger_arm64.cc
@@ -36,7 +36,7 @@
       UNREACHABLE();
   }
   const Code& code = Code::Handle(code_);
-  saved_value_ =  CodePatcher::GetStaticCallTargetAt(pc_, code);
+  saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code);
   CodePatcher::PatchPoolPointerCallAt(pc_, code, stub_target);
   is_enabled_ = true;
 }
@@ -49,8 +49,8 @@
     case RawPcDescriptors::kIcCall:
     case RawPcDescriptors::kUnoptStaticCall:
     case RawPcDescriptors::kRuntimeCall: {
-      CodePatcher::PatchPoolPointerCallAt(
-          pc_, code, Code::Handle(saved_value_));
+      CodePatcher::PatchPoolPointerCallAt(pc_, code,
+                                          Code::Handle(saved_value_));
       break;
     }
     default:
diff --git a/runtime/vm/debugger_dbc.cc b/runtime/vm/debugger_dbc.cc
index ac21678..8304677 100644
--- a/runtime/vm/debugger_dbc.cc
+++ b/runtime/vm/debugger_dbc.cc
@@ -35,7 +35,7 @@
   const Code& code = Code::Handle(code_);
   const Instructions& instrs = Instructions::Handle(code.instructions());
   {
-    WritableInstructionsScope writable(instrs.PayloadStart(), instrs.size());
+    WritableInstructionsScope writable(instrs.PayloadStart(), instrs.Size());
     saved_value_ = *CallInstructionFromReturnAddress(pc_);
     switch (breakpoint_kind_) {
       case RawPcDescriptors::kIcCall:
@@ -43,11 +43,8 @@
         // DebugBreak has an A operand matching the call it replaces.
         // This ensures that Return instructions continue to work - as they
         // look at calls to figure out how many arguments to drop.
-        *CallInstructionFromReturnAddress(pc_) =
-            Bytecode::Encode(Bytecode::kDebugBreak,
-                             Bytecode::DecodeArgc(saved_value_),
-                             0,
-                             0);
+        *CallInstructionFromReturnAddress(pc_) = Bytecode::Encode(
+            Bytecode::kDebugBreak, Bytecode::DecodeArgc(saved_value_), 0, 0);
         break;
       }
 
@@ -80,7 +77,7 @@
   const Code& code = Code::Handle(code_);
   const Instructions& instrs = Instructions::Handle(code.instructions());
   {
-    WritableInstructionsScope writable(instrs.PayloadStart(), instrs.size());
+    WritableInstructionsScope writable(instrs.PayloadStart(), instrs.Size());
     switch (breakpoint_kind_) {
       case RawPcDescriptors::kIcCall:
       case RawPcDescriptors::kUnoptStaticCall:
diff --git a/runtime/vm/debugger_ia32.cc b/runtime/vm/debugger_ia32.cc
index c900f75..83cd02d 100644
--- a/runtime/vm/debugger_ia32.cc
+++ b/runtime/vm/debugger_ia32.cc
@@ -30,7 +30,7 @@
   const Instructions& instrs = Instructions::Handle(code.instructions());
   Code& stub_target = Code::Handle();
   {
-    WritableInstructionsScope writable(instrs.PayloadStart(), instrs.size());
+    WritableInstructionsScope writable(instrs.PayloadStart(), instrs.Size());
     switch (breakpoint_kind_) {
       case RawPcDescriptors::kIcCall:
       case RawPcDescriptors::kUnoptStaticCall: {
@@ -57,7 +57,7 @@
   const Code& code = Code::Handle(code_);
   const Instructions& instrs = Instructions::Handle(code.instructions());
   {
-    WritableInstructionsScope writable(instrs.PayloadStart(), instrs.size());
+    WritableInstructionsScope writable(instrs.PayloadStart(), instrs.Size());
     switch (breakpoint_kind_) {
       case RawPcDescriptors::kIcCall:
       case RawPcDescriptors::kUnoptStaticCall:
diff --git a/runtime/vm/debugger_test.cc b/runtime/vm/debugger_test.cc
index 8b8b84e..6096965 100644
--- a/runtime/vm/debugger_test.cc
+++ b/runtime/vm/debugger_test.cc
@@ -76,14 +76,16 @@
         "\"breakpointNumber\":2,\"resolved\":false,"
         "\"location\":{\"type\":\"UnresolvedSourceLocation\","
         "\"script\":{\"type\":\"@Script\",\"fixedId\":true,"
-        "\"id\":\"libraries\\/%" Pd "\\/scripts\\/test-lib\\/0\","
+        "\"id\":\"libraries\\/%" Pd
+        "\\/scripts\\/test-lib\\/0\","
         "\"uri\":\"test-lib\","
         "\"_kind\":\"script\"},\"line\":3}},"
         "{\"type\":\"Breakpoint\",\"fixedId\":true,\"id\":\"breakpoints\\/1\","
         "\"breakpointNumber\":1,\"resolved\":false,"
         "\"location\":{\"type\":\"UnresolvedSourceLocation\","
         "\"script\":{\"type\":\"@Script\",\"fixedId\":true,"
-        "\"id\":\"libraries\\/%" Pd "\\/scripts\\/test-lib\\/0\","
+        "\"id\":\"libraries\\/%" Pd
+        "\\/scripts\\/test-lib\\/0\","
         "\"uri\":\"test-lib\","
         "\"_kind\":\"script\"},\"line\":2}}]",
         vmlib.index(), vmlib.index());
diff --git a/runtime/vm/debugger_x64.cc b/runtime/vm/debugger_x64.cc
index 7da5fc7..58c45c96 100644
--- a/runtime/vm/debugger_x64.cc
+++ b/runtime/vm/debugger_x64.cc
@@ -37,7 +37,7 @@
       UNREACHABLE();
   }
   const Code& code = Code::Handle(code_);
-  saved_value_ =  CodePatcher::GetStaticCallTargetAt(pc_, code);
+  saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code);
   CodePatcher::PatchPoolPointerCallAt(pc_, code, stub_target);
   is_enabled_ = true;
 }
@@ -50,8 +50,8 @@
     case RawPcDescriptors::kIcCall:
     case RawPcDescriptors::kUnoptStaticCall:
     case RawPcDescriptors::kRuntimeCall: {
-      CodePatcher::PatchPoolPointerCallAt(
-          pc_, code, Code::Handle(saved_value_));
+      CodePatcher::PatchPoolPointerCallAt(pc_, code,
+                                          Code::Handle(saved_value_));
       break;
     }
     default:
diff --git a/runtime/vm/deferred_objects.cc b/runtime/vm/deferred_objects.cc
index d3f89c7..f21716a 100644
--- a/runtime/vm/deferred_objects.cc
+++ b/runtime/vm/deferred_objects.cc
@@ -94,8 +94,7 @@
     const Class& cls = Class::Handle(Isolate::Current()->class_table()->At(
         Object::Handle(obj->object()).GetClassId()));
     OS::PrintErr("writing instance of class %s ref at %" Px ".\n",
-                 cls.ToCString(),
-                 reinterpret_cast<uword>(slot()));
+                 cls.ToCString(), reinterpret_cast<uword>(slot()));
   }
 }
 
@@ -105,21 +104,21 @@
   Zone* zone = deopt_context->zone();
   Function& function = Function::Handle(zone);
   function ^= deopt_context->ObjectAt(index_);
-  const Error& error = Error::Handle(zone,
-      Compiler::EnsureUnoptimizedCode(thread, function));
+  const Error& error =
+      Error::Handle(zone, Compiler::EnsureUnoptimizedCode(thread, function));
   if (!error.IsNull()) {
     Exceptions::PropagateError(error);
   }
   const Code& code = Code::Handle(zone, function.unoptimized_code());
-  // Check that deopt_id exists.
-  // TODO(vegorov): verify after deoptimization targets as well.
+// Check that deopt_id exists.
+// TODO(vegorov): verify after deoptimization targets as well.
 #ifdef DEBUG
   ASSERT(Thread::IsDeoptAfter(deopt_id_) ||
          (code.GetPcForDeoptId(deopt_id_, RawPcDescriptors::kDeopt) != 0));
 #endif
 
-  uword continue_at_pc = code.GetPcForDeoptId(deopt_id_,
-                                              RawPcDescriptors::kDeopt);
+  uword continue_at_pc =
+      code.GetPcForDeoptId(deopt_id_, RawPcDescriptors::kDeopt);
   ASSERT(continue_at_pc != 0);
   uword* dest_addr = reinterpret_cast<uword*>(slot());
   *dest_addr = continue_at_pc;
@@ -162,8 +161,8 @@
   Function& function = Function::Handle(zone);
   function ^= deopt_context->ObjectAt(index_);
   ASSERT(!function.IsNull());
-  const Error& error = Error::Handle(zone,
-      Compiler::EnsureUnoptimizedCode(thread, function));
+  const Error& error =
+      Error::Handle(zone, Compiler::EnsureUnoptimizedCode(thread, function));
   if (!error.IsNull()) {
     Exceptions::PropagateError(error);
   }
@@ -174,8 +173,8 @@
 
   if (FLAG_trace_deoptimization_verbose) {
     THR_Print("materializing pc marker at 0x%" Px ": %s, %s\n",
-        reinterpret_cast<uword>(slot()), code.ToCString(),
-        function.ToCString());
+              reinterpret_cast<uword>(slot()), code.ToCString(),
+              function.ToCString());
   }
 
   // Increment the deoptimization counter. This effectively increments each
@@ -185,8 +184,8 @@
   }
   if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) {
     THR_Print("Deoptimizing '%s' (count %d)\n",
-        function.ToFullyQualifiedCString(),
-        function.deoptimization_counter());
+              function.ToFullyQualifiedCString(),
+              function.deoptimization_counter());
   }
   // Clear invocation counter so that hopefully the function gets reoptimized
   // only after more feedback has been collected.
@@ -203,8 +202,8 @@
   Function& function = Function::Handle(zone);
   function ^= deopt_context->ObjectAt(index_);
   ASSERT(!function.IsNull());
-  const Error& error = Error::Handle(zone,
-      Compiler::EnsureUnoptimizedCode(thread, function));
+  const Error& error =
+      Error::Handle(zone, Compiler::EnsureUnoptimizedCode(thread, function));
   if (!error.IsNull()) {
     Exceptions::PropagateError(error);
   }
@@ -240,19 +239,16 @@
   if (cls.raw() == Object::context_class()) {
     intptr_t num_variables = Smi::Cast(Object::Handle(GetLength())).Value();
     if (FLAG_trace_deoptimization_verbose) {
-      OS::PrintErr(
-          "materializing context of length %" Pd " (%" Px ", %" Pd " vars)\n",
-          num_variables,
-          reinterpret_cast<uword>(args_),
-          field_count_);
+      OS::PrintErr("materializing context of length %" Pd " (%" Px ", %" Pd
+                   " vars)\n",
+                   num_variables, reinterpret_cast<uword>(args_), field_count_);
     }
     object_ = &Context::ZoneHandle(Context::New(num_variables));
 
   } else {
     if (FLAG_trace_deoptimization_verbose) {
       OS::PrintErr("materializing instance of %s (%" Px ", %" Pd " fields)\n",
-                   cls.ToCString(),
-                   reinterpret_cast<uword>(args_),
+                   cls.ToCString(), reinterpret_cast<uword>(args_),
                    field_count_);
     }
 
@@ -289,8 +285,7 @@
         context.set_parent(parent);
         if (FLAG_trace_deoptimization_verbose) {
           OS::PrintErr("    ctx@parent (offset %" Pd ") <- %s\n",
-                       offset.Value(),
-                       value.ToCString());
+                       offset.Value(), value.ToCString());
         }
       } else {
         intptr_t context_index = ToContextIndex(offset.Value());
@@ -298,9 +293,7 @@
         context.SetAt(context_index, value);
         if (FLAG_trace_deoptimization_verbose) {
           OS::PrintErr("    ctx@%" Pd " (offset %" Pd ") <- %s\n",
-                       context_index,
-                       offset.Value(),
-                       value.ToCString());
+                       context_index, offset.Value(), value.ToCString());
         }
       }
     }
@@ -322,8 +315,7 @@
         closure.SetTypeArguments(arguments);
         if (FLAG_trace_deoptimization_verbose) {
           OS::PrintErr("    closure@type_arguments (offset %" Pd ") <- %s\n",
-                       offset.Value(),
-                       value.ToCString());
+                       offset.Value(), value.ToCString());
         }
       } else if (offset.Value() == Closure::function_offset()) {
         Function& function = Function::Handle();
@@ -331,8 +323,7 @@
         closure.set_function(function);
         if (FLAG_trace_deoptimization_verbose) {
           OS::PrintErr("    closure@function (offset %" Pd ") <- %s\n",
-                       offset.Value(),
-                       value.ToCString());
+                       offset.Value(), value.ToCString());
         }
       } else {
         ASSERT(offset.Value() == Closure::context_offset());
@@ -341,8 +332,7 @@
         closure.set_context(context);
         if (FLAG_trace_deoptimization_verbose) {
           OS::PrintErr("    closure@context (offset %" Pd ") <- %s\n",
-                       offset.Value(),
-                       value.ToCString());
+                       offset.Value(), value.ToCString());
         }
       }
     }
@@ -370,8 +360,7 @@
         obj.SetFieldAtOffset(offset.Value(), value);
         if (FLAG_trace_deoptimization_verbose) {
           OS::PrintErr("    null Field @ offset(%" Pd ") <- %s\n",
-                       offset.Value(),
-                       value.ToCString());
+                       offset.Value(), value.ToCString());
         }
       }
     }
diff --git a/runtime/vm/deferred_objects.h b/runtime/vm/deferred_objects.h
index de2262c..eb817af 100644
--- a/runtime/vm/deferred_objects.h
+++ b/runtime/vm/deferred_objects.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_DEFERRED_OBJECTS_H_
-#define VM_DEFERRED_OBJECTS_H_
+#ifndef RUNTIME_VM_DEFERRED_OBJECTS_H_
+#define RUNTIME_VM_DEFERRED_OBJECTS_H_
 
 #include "platform/globals.h"
 
@@ -22,8 +22,8 @@
 class DeferredSlot {
  public:
   DeferredSlot(RawObject** slot, DeferredSlot* next)
-      : slot_(slot), next_(next) { }
-  virtual ~DeferredSlot() { }
+      : slot_(slot), next_(next) {}
+  virtual ~DeferredSlot() {}
 
   RawObject** slot() const { return slot_; }
   DeferredSlot* next() const { return next_; }
@@ -41,7 +41,7 @@
 class DeferredDouble : public DeferredSlot {
  public:
   DeferredDouble(double value, RawObject** slot, DeferredSlot* next)
-      : DeferredSlot(slot, next), value_(value) { }
+      : DeferredSlot(slot, next), value_(value) {}
 
   virtual void Materialize(DeoptContext* deopt_context);
 
@@ -57,7 +57,7 @@
 class DeferredMint : public DeferredSlot {
  public:
   DeferredMint(int64_t value, RawObject** slot, DeferredSlot* next)
-      : DeferredSlot(slot, next), value_(value) { }
+      : DeferredSlot(slot, next), value_(value) {}
 
   virtual void Materialize(DeoptContext* deopt_context);
 
@@ -72,9 +72,8 @@
 
 class DeferredFloat32x4 : public DeferredSlot {
  public:
-  DeferredFloat32x4(simd128_value_t value, RawObject** slot,
-                    DeferredSlot* next)
-      : DeferredSlot(slot, next), value_(value) { }
+  DeferredFloat32x4(simd128_value_t value, RawObject** slot, DeferredSlot* next)
+      : DeferredSlot(slot, next), value_(value) {}
 
   virtual void Materialize(DeoptContext* deopt_context);
 
@@ -89,9 +88,8 @@
 
 class DeferredFloat64x2 : public DeferredSlot {
  public:
-  DeferredFloat64x2(simd128_value_t value, RawObject** slot,
-                    DeferredSlot* next)
-      : DeferredSlot(slot, next), value_(value) { }
+  DeferredFloat64x2(simd128_value_t value, RawObject** slot, DeferredSlot* next)
+      : DeferredSlot(slot, next), value_(value) {}
 
   virtual void Materialize(DeoptContext* deopt_context);
 
@@ -106,9 +104,8 @@
 
 class DeferredInt32x4 : public DeferredSlot {
  public:
-  DeferredInt32x4(simd128_value_t value, RawObject** slot,
-                   DeferredSlot* next)
-      : DeferredSlot(slot, next), value_(value) { }
+  DeferredInt32x4(simd128_value_t value, RawObject** slot, DeferredSlot* next)
+      : DeferredSlot(slot, next), value_(value) {}
 
   virtual void Materialize(DeoptContext* deopt_context);
 
@@ -127,7 +124,7 @@
 class DeferredObjectRef : public DeferredSlot {
  public:
   DeferredObjectRef(intptr_t index, RawObject** slot, DeferredSlot* next)
-      : DeferredSlot(slot, next), index_(index) { }
+      : DeferredSlot(slot, next), index_(index) {}
 
   virtual void Materialize(DeoptContext* deopt_context);
 
@@ -146,7 +143,7 @@
                   intptr_t deopt_id,
                   RawObject** slot,
                   DeferredSlot* next)
-      : DeferredSlot(slot, next), index_(index), deopt_id_(deopt_id) { }
+      : DeferredSlot(slot, next), index_(index), deopt_id_(deopt_id) {}
 
   virtual void Materialize(DeoptContext* deopt_context);
 
@@ -163,7 +160,7 @@
 class DeferredPcMarker : public DeferredSlot {
  public:
   DeferredPcMarker(intptr_t index, RawObject** slot, DeferredSlot* next)
-      : DeferredSlot(slot, next), index_(index) { }
+      : DeferredSlot(slot, next), index_(index) {}
 
   virtual void Materialize(DeoptContext* deopt_context);
 
@@ -179,7 +176,7 @@
 class DeferredPp : public DeferredSlot {
  public:
   DeferredPp(intptr_t index, RawObject** slot, DeferredSlot* next)
-      : DeferredSlot(slot, next), index_(index) { }
+      : DeferredSlot(slot, next), index_(index) {}
 
   virtual void Materialize(DeoptContext* deopt_context);
 
@@ -201,7 +198,7 @@
   DeferredObject(intptr_t field_count, intptr_t* args)
       : field_count_(field_count),
         args_(reinterpret_cast<RawObject**>(args)),
-        object_(NULL) { }
+        object_(NULL) {}
 
   intptr_t ArgumentCount() const {
     return kFieldsStartIndex + kFieldEntrySize * field_count_;
@@ -239,13 +236,9 @@
 #endif
   }
 
-  RawObject* GetClass() const {
-    return GetArg(kClassIndex);
-  }
+  RawObject* GetClass() const { return GetArg(kClassIndex); }
 
-  RawObject* GetLength() const {
-    return GetArg(kLengthIndex);
-  }
+  RawObject* GetLength() const { return GetArg(kLengthIndex); }
 
   RawObject* GetFieldOffset(intptr_t index) const {
     return GetArg(kFieldsStartIndex + kFieldEntrySize * index + kOffsetIndex);
@@ -271,4 +264,4 @@
 
 }  // namespace dart
 
-#endif  // VM_DEFERRED_OBJECTS_H_
+#endif  // RUNTIME_VM_DEFERRED_OBJECTS_H_
diff --git a/runtime/vm/deopt_instructions.cc b/runtime/vm/deopt_instructions.cc
index 18aa1a1..31f08cd 100644
--- a/runtime/vm/deopt_instructions.cc
+++ b/runtime/vm/deopt_instructions.cc
@@ -17,7 +17,9 @@
 
 namespace dart {
 
-DEFINE_FLAG(bool, compress_deopt_info, true,
+DEFINE_FLAG(bool,
+            compress_deopt_info,
+            true,
             "Compress the size of the deoptimization info for optimized code.");
 DECLARE_FLAG(bool, trace_deoptimization);
 DECLARE_FLAG(bool, trace_deoptimization_verbose);
@@ -70,11 +72,11 @@
   num_args_ =
       function.HasOptionalParameters() ? 0 : function.num_fixed_parameters();
 
-  // The fixed size section of the (fake) Dart frame called via a stub by the
-  // optimized function contains FP, PP (ARM and MIPS only), PC-marker and
-  // return-address. This section is copied as well, so that its contained
-  // values can be updated before returning to the deoptimized function.
-  // Note: on DBC stack grows upwards unlike on all other architectures.
+// The fixed size section of the (fake) Dart frame called via a stub by the
+// optimized function contains FP, PP (ARM and MIPS only), PC-marker and
+// return-address. This section is copied as well, so that its contained
+// values can be updated before returning to the deoptimized function.
+// Note: on DBC stack grows upwards unlike on all other architectures.
 #if defined(TARGET_ARCH_DBC)
   ASSERT(frame->sp() >= frame->fp());
   const intptr_t frame_size = (frame->sp() - frame->fp()) / kWordSize;
@@ -83,12 +85,11 @@
   const intptr_t frame_size = (frame->fp() - frame->sp()) / kWordSize;
 #endif
 
-  source_frame_size_ =
-      + kDartFrameFixedSize  // For saved values below sp.
-      + frame_size  // For frame size incl. sp.
-      + 1  // For fp.
-      + kParamEndSlotFromFp  // For saved values above fp.
-      + num_args_;  // For arguments.
+  source_frame_size_ = +kDartFrameFixedSize   // For saved values below sp.
+                       + frame_size           // For frame size incl. sp.
+                       + 1                    // For fp.
+                       + kParamEndSlotFromFp  // For saved values above fp.
+                       + num_args_;           // For arguments.
 
   source_frame_ = FrameBase(frame);
 
@@ -123,11 +124,10 @@
 
   if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) {
     THR_Print(
-        "Deoptimizing (reason %d '%s') at pc %#" Px " '%s' (count %d)\n",
-        deopt_reason(),
-        DeoptReasonToCString(deopt_reason()),
-        frame->pc(),
-        function.ToFullyQualifiedCString(),
+        "Deoptimizing (reason %d '%s') at "
+        "pc=%" Pp " fp=%" Pp " '%s' (count %d)\n",
+        deopt_reason(), DeoptReasonToCString(deopt_reason()), frame->pc(),
+        frame->fp(), function.ToFullyQualifiedCString(),
         function.deoptimization_counter());
   }
 }
@@ -170,8 +170,7 @@
       const int counter = function.deoptimization_counter();
       TimelineEvent* timeline_event = compiler_stream->StartEvent();
       if (timeline_event != NULL) {
-        timeline_event->Duration("Deoptimize",
-                                 deopt_start_micros_,
+        timeline_event->Duration("Deoptimize", deopt_start_micros_,
                                  OS::GetCurrentMonotonicMicros());
         timeline_event->SetNumArguments(3);
         timeline_event->CopyArgument(0, "function", function_name.ToCString());
@@ -201,9 +200,7 @@
 
 
 intptr_t DeoptContext::DestStackAdjustment() const {
-  return dest_frame_size_
-         - kDartFrameFixedSize
-         - num_args_
+  return dest_frame_size_ - kDartFrameFixedSize - num_args_
 #if !defined(TARGET_ARCH_DBC)
          - 1  // For fp.
 #endif
@@ -217,7 +214,7 @@
                        kParamEndSlotFromFp];
 #else
   return source_frame_[num_args_ + kDartFrameFixedSize +
-      kSavedCallerFpSlotFromFp];
+                       kSavedCallerFpSlotFromFp];
 #endif
 }
 
@@ -239,7 +236,7 @@
   return source_frame_[source_frame_size_ - num_args_ + kSavedPcSlotFromSp];
 #else
   return source_frame_[num_args_ + kDartFrameFixedSize +
-      kSavedCallerPcSlotFromFp];
+                       kSavedCallerPcSlotFromFp];
 #endif
 }
 
@@ -317,8 +314,7 @@
       DeoptInfo::NumMaterializations(deopt_instructions);
   PrepareForDeferredMaterialization(num_materializations);
   for (intptr_t from_index = 0, to_index = kDartFrameFixedSize;
-       from_index < num_materializations;
-       from_index++) {
+       from_index < num_materializations; from_index++) {
     const intptr_t field_count =
         DeoptInstr::GetFieldCount(deopt_instructions[from_index]);
     intptr_t* args = GetDestFrameAddressAt(to_index);
@@ -328,8 +324,7 @@
   }
 
   // Populate stack frames.
-  for (intptr_t to_index = frame_size - 1, from_index = len - 1;
-       to_index >= 0;
+  for (intptr_t to_index = frame_size - 1, from_index = len - 1; to_index >= 0;
        to_index--, from_index--) {
     intptr_t* to_addr = GetDestFrameAddressAt(to_index);
     DeoptInstr* instr = deopt_instructions[from_index];
@@ -343,11 +338,8 @@
   if (FLAG_trace_deoptimization_verbose) {
     for (intptr_t i = 0; i < frame_size; i++) {
       intptr_t* to_addr = GetDestFrameAddressAt(i);
-      OS::PrintErr("*%" Pd ". [%p] 0x%" Px " [%s]\n",
-                   i,
-                   to_addr,
-                   *to_addr,
-                   deopt_instructions[i + (len - frame_size)]->ToCString());
+      THR_Print("*%" Pd ". [%p] 0x%" Px " [%s]\n", i, to_addr, *to_addr,
+                deopt_instructions[i + (len - frame_size)]->ToCString());
     }
   }
 }
@@ -398,12 +390,12 @@
     intptr_t line, column;
     script.GetTokenLocation(token_pos, &line, &column);
     String& line_string = String::Handle(script.GetLine(line));
-    OS::PrintErr("  Function: %s\n", top_function.ToFullyQualifiedCString());
+    THR_Print("  Function: %s\n", top_function.ToFullyQualifiedCString());
     char line_buffer[80];
-    OS::SNPrint(line_buffer, sizeof(line_buffer), "  Line %" Pd ": '%s'",
-                line, line_string.ToCString());
-    OS::PrintErr("%s\n", line_buffer);
-    OS::PrintErr("  Deopt args: %" Pd "\n", deopt_arg_count);
+    OS::SNPrint(line_buffer, sizeof(line_buffer), "  Line %" Pd ": '%s'", line,
+                line_string.ToCString());
+    THR_Print("%s\n", line_buffer);
+    THR_Print("  Deopt args: %" Pd "\n", deopt_arg_count);
   }
 
   return deopt_arg_count;
@@ -412,8 +404,7 @@
 
 RawArray* DeoptContext::DestFrameAsArray() {
   ASSERT(dest_frame_ != NULL && dest_frame_is_allocated_);
-  const Array& dest_array =
-      Array::Handle(zone(), Array::New(dest_frame_size_));
+  const Array& dest_array = Array::Handle(zone(), Array::New(dest_frame_size_));
   PassiveObject& obj = PassiveObject::Handle(zone());
   for (intptr_t i = 0; i < dest_frame_size_; i++) {
     obj = reinterpret_cast<RawObject*>(dest_frame_[i]);
@@ -435,12 +426,11 @@
 
   explicit DeoptRetAddressInstr(intptr_t source_index)
       : object_table_index_(ObjectTableIndex::decode(source_index)),
-        deopt_id_(DeoptId::decode(source_index)) {
-  }
+        deopt_id_(DeoptId::decode(source_index)) {}
 
   virtual intptr_t source_index() const {
     return ObjectTableIndex::encode(object_table_index_) |
-        DeoptId::encode(deopt_id_);
+           DeoptId::encode(deopt_id_);
   }
 
   virtual DeoptInstr::Kind kind() const { return kRetAddress; }
@@ -452,8 +442,8 @@
 
   void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) {
     *dest_addr = Smi::RawValue(0);
-    deopt_context->DeferRetAddrMaterialization(
-        object_table_index_, deopt_id_, dest_addr);
+    deopt_context->DeferRetAddrMaterialization(object_table_index_, deopt_id_,
+                                               dest_addr);
   }
 
   intptr_t object_table_index() const { return object_table_index_; }
@@ -461,10 +451,10 @@
 
  private:
   static const intptr_t kFieldWidth = kBitsPerWord / 2;
-  class ObjectTableIndex :
-      public BitField<intptr_t, intptr_t, 0, kFieldWidth> { };
-  class DeoptId :
-      public BitField<intptr_t, intptr_t, kFieldWidth, kFieldWidth> { };
+  class ObjectTableIndex : public BitField<intptr_t, intptr_t, 0, kFieldWidth> {
+  };
+  class DeoptId
+      : public BitField<intptr_t, intptr_t, kFieldWidth, kFieldWidth> {};
 
   const intptr_t object_table_index_;
   const intptr_t deopt_id_;
@@ -485,8 +475,8 @@
   virtual DeoptInstr::Kind kind() const { return kConstant; }
 
   virtual const char* ArgumentsToCString() const {
-    return Thread::Current()->zone()->PrintToString(
-        "%" Pd "", object_table_index_);
+    return Thread::Current()->zone()->PrintToString("%" Pd "",
+                                                    object_table_index_);
   }
 
   void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) {
@@ -508,20 +498,16 @@
 // first argument) and accounts for saved return address, frame
 // pointer, pool pointer and pc marker.
 // Deoptimization instruction moving a CPU register.
-class DeoptWordInstr: public DeoptInstr {
+class DeoptWordInstr : public DeoptInstr {
  public:
-  explicit DeoptWordInstr(intptr_t source_index)
-      : source_(source_index) {}
+  explicit DeoptWordInstr(intptr_t source_index) : source_(source_index) {}
 
-  explicit DeoptWordInstr(const CpuRegisterSource& source)
-      : source_(source) {}
+  explicit DeoptWordInstr(const CpuRegisterSource& source) : source_(source) {}
 
   virtual intptr_t source_index() const { return source_.source_index(); }
   virtual DeoptInstr::Kind kind() const { return kWord; }
 
-  virtual const char* ArgumentsToCString() const {
-    return source_.ToCString();
-  }
+  virtual const char* ArgumentsToCString() const { return source_.ToCString(); }
 
   void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) {
     *dest_addr = source_.Value<intptr_t>(deopt_context);
@@ -534,9 +520,9 @@
 };
 
 
-class DeoptIntegerInstrBase: public DeoptInstr {
+class DeoptIntegerInstrBase : public DeoptInstr {
  public:
-  DeoptIntegerInstrBase() { }
+  DeoptIntegerInstrBase() {}
 
   void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) {
     const int64_t value = GetValue(deopt_context);
@@ -556,13 +542,12 @@
 };
 
 
-class DeoptMintPairInstr: public DeoptIntegerInstrBase {
+class DeoptMintPairInstr : public DeoptIntegerInstrBase {
  public:
   explicit DeoptMintPairInstr(intptr_t source_index)
       : DeoptIntegerInstrBase(),
         lo_(LoRegister::decode(source_index)),
-        hi_(HiRegister::decode(source_index)) {
-  }
+        hi_(HiRegister::decode(source_index)) {}
 
   DeoptMintPairInstr(const CpuRegisterSource& lo, const CpuRegisterSource& hi)
       : DeoptIntegerInstrBase(), lo_(lo), hi_(hi) {}
@@ -574,22 +559,20 @@
   virtual DeoptInstr::Kind kind() const { return kMintPair; }
 
   virtual const char* ArgumentsToCString() const {
-    return Thread::Current()->zone()->PrintToString(
-        "%s,%s",
-        lo_.ToCString(),
-        hi_.ToCString());
+    return Thread::Current()->zone()->PrintToString("%s,%s", lo_.ToCString(),
+                                                    hi_.ToCString());
   }
 
   virtual int64_t GetValue(DeoptContext* deopt_context) {
-    return Utils::LowHighTo64Bits(
-        lo_.Value<uint32_t>(deopt_context), hi_.Value<int32_t>(deopt_context));
+    return Utils::LowHighTo64Bits(lo_.Value<uint32_t>(deopt_context),
+                                  hi_.Value<int32_t>(deopt_context));
   }
 
  private:
   static const intptr_t kFieldWidth = kBitsPerWord / 2;
-  class LoRegister : public BitField<intptr_t, intptr_t, 0, kFieldWidth> { };
-  class HiRegister :
-      public BitField<intptr_t, intptr_t, kFieldWidth, kFieldWidth> { };
+  class LoRegister : public BitField<intptr_t, intptr_t, 0, kFieldWidth> {};
+  class HiRegister
+      : public BitField<intptr_t, intptr_t, kFieldWidth, kFieldWidth> {};
 
   const CpuRegisterSource lo_;
   const CpuRegisterSource hi_;
@@ -598,23 +581,19 @@
 };
 
 
-template<DeoptInstr::Kind K, typename T>
+template <DeoptInstr::Kind K, typename T>
 class DeoptIntInstr : public DeoptIntegerInstrBase {
  public:
   explicit DeoptIntInstr(intptr_t source_index)
-      : DeoptIntegerInstrBase(), source_(source_index) {
-  }
+      : DeoptIntegerInstrBase(), source_(source_index) {}
 
   explicit DeoptIntInstr(const CpuRegisterSource& source)
-      : DeoptIntegerInstrBase(), source_(source) {
-  }
+      : DeoptIntegerInstrBase(), source_(source) {}
 
   virtual intptr_t source_index() const { return source_.source_index(); }
   virtual DeoptInstr::Kind kind() const { return K; }
 
-  virtual const char* ArgumentsToCString() const {
-    return source_.ToCString();
-  }
+  virtual const char* ArgumentsToCString() const { return source_.ToCString(); }
 
   virtual int64_t GetValue(DeoptContext* deopt_context) {
     return static_cast<int64_t>(source_.Value<T>(deopt_context));
@@ -632,23 +611,17 @@
 typedef DeoptIntInstr<DeoptInstr::kMint, int64_t> DeoptMintInstr;
 
 
-template<DeoptInstr::Kind K,
-         typename Type,
-         typename RawObjectType>
-class DeoptFpuInstr: public DeoptInstr {
+template <DeoptInstr::Kind K, typename Type, typename RawObjectType>
+class DeoptFpuInstr : public DeoptInstr {
  public:
-  explicit DeoptFpuInstr(intptr_t source_index)
-      : source_(source_index) {}
+  explicit DeoptFpuInstr(intptr_t source_index) : source_(source_index) {}
 
-  explicit DeoptFpuInstr(const FpuRegisterSource& source)
-      : source_(source) {}
+  explicit DeoptFpuInstr(const FpuRegisterSource& source) : source_(source) {}
 
   virtual intptr_t source_index() const { return source_.source_index(); }
   virtual DeoptInstr::Kind kind() const { return K; }
 
-  virtual const char* ArgumentsToCString() const {
-    return source_.ToCString();
-  }
+  virtual const char* ArgumentsToCString() const { return source_.ToCString(); }
 
   void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) {
     *dest_addr = Smi::RawValue(0);
@@ -688,17 +661,18 @@
   virtual DeoptInstr::Kind kind() const { return kPcMarker; }
 
   virtual const char* ArgumentsToCString() const {
-    return Thread::Current()->zone()->PrintToString(
-        "%" Pd "", object_table_index_);
+    return Thread::Current()->zone()->PrintToString("%" Pd "",
+                                                    object_table_index_);
   }
 
   void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) {
     Function& function = Function::Handle(deopt_context->zone());
     function ^= deopt_context->ObjectAt(object_table_index_);
     if (function.IsNull()) {
-      *reinterpret_cast<RawObject**>(dest_addr) = deopt_context->is_lazy_deopt()
-          ? StubCode::DeoptimizeLazyFromReturn_entry()->code()
-          : StubCode::Deoptimize_entry()->code();
+      *reinterpret_cast<RawObject**>(dest_addr) =
+          deopt_context->is_lazy_deopt()
+              ? StubCode::DeoptimizeLazyFromReturn_entry()->code()
+              : StubCode::Deoptimize_entry()->code();
       return;
     }
 
@@ -732,14 +706,14 @@
   virtual DeoptInstr::Kind kind() const { return kPp; }
 
   virtual const char* ArgumentsToCString() const {
-    return Thread::Current()->zone()->PrintToString(
-        "%" Pd "", object_table_index_);
+    return Thread::Current()->zone()->PrintToString("%" Pd "",
+                                                    object_table_index_);
   }
 
   void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) {
     *dest_addr = Smi::RawValue(0);
-    deopt_context->DeferPpMaterialization(object_table_index_,
-        reinterpret_cast<RawObject**>(dest_addr));
+    deopt_context->DeferPpMaterialization(
+        object_table_index_, reinterpret_cast<RawObject**>(dest_addr));
   }
 
  private:
@@ -759,8 +733,8 @@
 
   void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) {
     *dest_addr = deopt_context->GetCallerFp();
-    deopt_context->SetCallerFp(reinterpret_cast<intptr_t>(
-        dest_addr - kSavedCallerFpSlotFromFp));
+    deopt_context->SetCallerFp(
+        reinterpret_cast<intptr_t>(dest_addr - kSavedCallerFpSlotFromFp));
   }
 
  private:
@@ -807,8 +781,7 @@
 // stack slot.
 class DeoptMaterializedObjectRefInstr : public DeoptInstr {
  public:
-  explicit DeoptMaterializedObjectRefInstr(intptr_t index)
-      : index_(index) {
+  explicit DeoptMaterializedObjectRefInstr(intptr_t index) : index_(index) {
     ASSERT(index >= 0);
   }
 
@@ -816,14 +789,12 @@
   virtual DeoptInstr::Kind kind() const { return kMaterializedObjectRef; }
 
   virtual const char* ArgumentsToCString() const {
-    return Thread::Current()->zone()->PrintToString(
-        "#%" Pd "", index_);
+    return Thread::Current()->zone()->PrintToString("#%" Pd "", index_);
   }
 
   void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) {
     *reinterpret_cast<RawSmi**>(dest_addr) = Smi::New(0);
-    deopt_context->DeferMaterializedObjectRef(
-        index_, dest_addr);
+    deopt_context->DeferMaterializedObjectRef(index_, dest_addr);
   }
 
  private:
@@ -847,8 +818,7 @@
   virtual DeoptInstr::Kind kind() const { return kMaterializeObject; }
 
   virtual const char* ArgumentsToCString() const {
-    return Thread::Current()->zone()->PrintToString(
-        "%" Pd "", field_count_);
+    return Thread::Current()->zone()->PrintToString("%" Pd "", field_count_);
   }
 
   void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) {
@@ -878,8 +848,8 @@
   Function& function = Function::Handle(zone);
   function ^= object_table.ObjectAt(ret_address_instr->object_table_index());
   ASSERT(code != NULL);
-  const Error& error = Error::Handle(zone,
-      Compiler::EnsureUnoptimizedCode(thread, function));
+  const Error& error =
+      Error::Handle(zone, Compiler::EnsureUnoptimizedCode(thread, function));
   if (!error.IsNull()) {
     Exceptions::PropagateError(error);
   }
@@ -984,11 +954,11 @@
  public:
   // Construct the root node representing the implicit "shared" terminator
   // at the end of each deopt info.
-  TrieNode() : instruction_(NULL), info_number_(-1), children_(16) { }
+  TrieNode() : instruction_(NULL), info_number_(-1), children_(16) {}
 
   // Construct a node representing a written instruction.
   TrieNode(DeoptInstr* instruction, intptr_t info_number)
-      : instruction_(instruction), info_number_(info_number), children_(4) { }
+      : instruction_(instruction), info_number_(info_number), children_(4) {}
 
   intptr_t info_number() const { return info_number_; }
 
@@ -1006,7 +976,7 @@
 
  private:
   const DeoptInstr* instruction_;  // Instruction that was written.
-  const intptr_t info_number_;  // Index of the deopt info it was written to.
+  const intptr_t info_number_;     // Index of the deopt info it was written to.
 
   GrowableArray<TrieNode*> children_;
 };
@@ -1019,11 +989,10 @@
       instructions_(),
       num_args_(num_args),
       assembler_(assembler),
-      trie_root_(new(zone) TrieNode()),
+      trie_root_(new (zone) TrieNode()),
       current_info_number_(0),
       frame_start_(-1),
-      materializations_() {
-}
+      materializations_() {}
 
 
 intptr_t DeoptInfoBuilder::FindOrAddObjectInTable(const Object& obj) const {
@@ -1033,9 +1002,9 @@
 
 intptr_t DeoptInfoBuilder::CalculateStackIndex(
     const Location& source_loc) const {
-  return source_loc.stack_index() < 0 ?
-            source_loc.stack_index() + num_args_ :
-            source_loc.stack_index() + num_args_ + kDartFrameFixedSize;
+  return source_loc.stack_index() < 0
+             ? source_loc.stack_index() + num_args_
+             : source_loc.stack_index() + num_args_ + kDartFrameFixedSize;
 }
 
 
@@ -1044,15 +1013,15 @@
     return CpuRegisterSource(CpuRegisterSource::kRegister, loc.reg());
   } else {
     ASSERT(loc.IsStackSlot());
-    return CpuRegisterSource(
-        CpuRegisterSource::kStackSlot, CalculateStackIndex(loc));
+    return CpuRegisterSource(CpuRegisterSource::kStackSlot,
+                             CalculateStackIndex(loc));
   }
 }
 
 
 FpuRegisterSource DeoptInfoBuilder::ToFpuRegisterSource(
-  const Location& loc,
-  Location::Kind stack_slot_kind) {
+    const Location& loc,
+    Location::Kind stack_slot_kind) {
   if (loc.IsFpuRegister()) {
     return FpuRegisterSource(FpuRegisterSource::kRegister, loc.fpu_reg());
 #if defined(TARGET_ARCH_DBC)
@@ -1063,8 +1032,8 @@
     ASSERT((stack_slot_kind == Location::kQuadStackSlot) ||
            (stack_slot_kind == Location::kDoubleStackSlot));
     ASSERT(loc.kind() == stack_slot_kind);
-    return FpuRegisterSource(
-        FpuRegisterSource::kStackSlot, CalculateStackIndex(loc));
+    return FpuRegisterSource(FpuRegisterSource::kStackSlot,
+                             CalculateStackIndex(loc));
   }
 }
 
@@ -1073,8 +1042,8 @@
                                         intptr_t dest_index) {
   const intptr_t object_table_index = FindOrAddObjectInTable(function);
   ASSERT(dest_index == FrameSize());
-  instructions_.Add(
-      new(zone()) DeoptRetAddressInstr(object_table_index, deopt_id));
+  instructions_.Add(new (zone())
+                        DeoptRetAddressInstr(object_table_index, deopt_id));
 }
 
 
@@ -1082,15 +1051,14 @@
                                    intptr_t dest_index) {
   intptr_t object_table_index = FindOrAddObjectInTable(function);
   ASSERT(dest_index == FrameSize());
-  instructions_.Add(new(zone()) DeoptPcMarkerInstr(object_table_index));
+  instructions_.Add(new (zone()) DeoptPcMarkerInstr(object_table_index));
 }
 
 
-void DeoptInfoBuilder::AddPp(const Function& function,
-                             intptr_t dest_index) {
+void DeoptInfoBuilder::AddPp(const Function& function, intptr_t dest_index) {
   intptr_t object_table_index = FindOrAddObjectInTable(function);
   ASSERT(dest_index == FrameSize());
-  instructions_.Add(new(zone()) DeoptPpInstr(object_table_index));
+  instructions_.Add(new (zone()) DeoptPpInstr(object_table_index));
 }
 
 
@@ -1100,55 +1068,55 @@
   DeoptInstr* deopt_instr = NULL;
   if (source_loc.IsConstant()) {
     intptr_t object_table_index = FindOrAddObjectInTable(source_loc.constant());
-    deopt_instr = new(zone()) DeoptConstantInstr(object_table_index);
+    deopt_instr = new (zone()) DeoptConstantInstr(object_table_index);
   } else if (source_loc.IsInvalid() &&
              value->definition()->IsMaterializeObject()) {
-    const intptr_t index = FindMaterialization(
-        value->definition()->AsMaterializeObject());
+    const intptr_t index =
+        FindMaterialization(value->definition()->AsMaterializeObject());
     ASSERT(index >= 0);
-    deopt_instr = new(zone()) DeoptMaterializedObjectRefInstr(index);
+    deopt_instr = new (zone()) DeoptMaterializedObjectRefInstr(index);
   } else {
     ASSERT(!source_loc.IsInvalid());
     switch (value->definition()->representation()) {
       case kTagged:
-        deopt_instr = new(zone()) DeoptWordInstr(
-          ToCpuRegisterSource(source_loc));
+        deopt_instr =
+            new (zone()) DeoptWordInstr(ToCpuRegisterSource(source_loc));
         break;
       case kUnboxedMint: {
         if (source_loc.IsPairLocation()) {
           PairLocation* pair = source_loc.AsPairLocation();
-          deopt_instr = new(zone()) DeoptMintPairInstr(
-              ToCpuRegisterSource(pair->At(0)),
-              ToCpuRegisterSource(pair->At(1)));
+          deopt_instr =
+              new (zone()) DeoptMintPairInstr(ToCpuRegisterSource(pair->At(0)),
+                                              ToCpuRegisterSource(pair->At(1)));
         } else {
           ASSERT(!source_loc.IsPairLocation());
-          deopt_instr = new(zone()) DeoptMintInstr(
-              ToCpuRegisterSource(source_loc));
+          deopt_instr =
+              new (zone()) DeoptMintInstr(ToCpuRegisterSource(source_loc));
         }
         break;
       }
       case kUnboxedInt32:
-        deopt_instr = new(zone()) DeoptInt32Instr(
-            ToCpuRegisterSource(source_loc));
+        deopt_instr =
+            new (zone()) DeoptInt32Instr(ToCpuRegisterSource(source_loc));
         break;
       case kUnboxedUint32:
-        deopt_instr = new(zone()) DeoptUint32Instr(
-            ToCpuRegisterSource(source_loc));
+        deopt_instr =
+            new (zone()) DeoptUint32Instr(ToCpuRegisterSource(source_loc));
         break;
       case kUnboxedDouble:
-        deopt_instr = new(zone()) DeoptDoubleInstr(
+        deopt_instr = new (zone()) DeoptDoubleInstr(
             ToFpuRegisterSource(source_loc, Location::kDoubleStackSlot));
         break;
       case kUnboxedFloat32x4:
-        deopt_instr = new(zone()) DeoptFloat32x4Instr(
+        deopt_instr = new (zone()) DeoptFloat32x4Instr(
             ToFpuRegisterSource(source_loc, Location::kQuadStackSlot));
         break;
       case kUnboxedFloat64x2:
-        deopt_instr = new(zone()) DeoptFloat64x2Instr(
+        deopt_instr = new (zone()) DeoptFloat64x2Instr(
             ToFpuRegisterSource(source_loc, Location::kQuadStackSlot));
         break;
       case kUnboxedInt32x4:
-        deopt_instr = new(zone()) DeoptInt32x4Instr(
+        deopt_instr = new (zone()) DeoptInt32x4Instr(
             ToFpuRegisterSource(source_loc, Location::kQuadStackSlot));
         break;
       default:
@@ -1164,26 +1132,26 @@
 
 void DeoptInfoBuilder::AddCallerFp(intptr_t dest_index) {
   ASSERT(dest_index == FrameSize());
-  instructions_.Add(new(zone()) DeoptCallerFpInstr());
+  instructions_.Add(new (zone()) DeoptCallerFpInstr());
 }
 
 
 void DeoptInfoBuilder::AddCallerPp(intptr_t dest_index) {
   ASSERT(dest_index == FrameSize());
-  instructions_.Add(new(zone()) DeoptCallerPpInstr());
+  instructions_.Add(new (zone()) DeoptCallerPpInstr());
 }
 
 
 void DeoptInfoBuilder::AddCallerPc(intptr_t dest_index) {
   ASSERT(dest_index == FrameSize());
-  instructions_.Add(new(zone()) DeoptCallerPcInstr());
+  instructions_.Add(new (zone()) DeoptCallerPcInstr());
 }
 
 
 void DeoptInfoBuilder::AddConstant(const Object& obj, intptr_t dest_index) {
   ASSERT(dest_index == FrameSize());
   intptr_t object_table_index = FindOrAddObjectInTable(obj);
-  instructions_.Add(new(zone()) DeoptConstantInstr(object_table_index));
+  instructions_.Add(new (zone()) DeoptConstantInstr(object_table_index));
 }
 
 
@@ -1204,12 +1172,11 @@
     }
   }
 
-  instructions_.Add(
-      new(zone()) DeoptMaterializeObjectInstr(non_null_fields));
+  instructions_.Add(new (zone()) DeoptMaterializeObjectInstr(non_null_fields));
 
   for (intptr_t i = 0; i < mat->InputCount(); i++) {
-    MaterializeObjectInstr* nested_mat = mat->InputAt(i)->definition()->
-        AsMaterializeObject();
+    MaterializeObjectInstr* nested_mat =
+        mat->InputAt(i)->definition()->AsMaterializeObject();
     if (nested_mat != NULL) {
       AddMaterialization(nested_mat);
     }
@@ -1251,8 +1218,7 @@
 static uint8_t* ZoneReAlloc(uint8_t* ptr,
                             intptr_t old_size,
                             intptr_t new_size) {
-  return Thread::Current()->zone()->Realloc<uint8_t>(
-      ptr, old_size, new_size);
+  return Thread::Current()->zone()->Realloc<uint8_t>(ptr, old_size, new_size);
 }
 
 
@@ -1301,22 +1267,21 @@
     Writer::Write(&stream, instr->kind());
     Writer::Write(&stream, instr->source_index());
 
-    TrieNode* child = new(zone()) TrieNode(instr, current_info_number_);
+    TrieNode* child = new (zone()) TrieNode(instr, current_info_number_);
     node->AddChild(child);
     node = child;
   }
 
-  const TypedData& deopt_info = TypedData::Handle(zone(), TypedData::New(
-      kTypedDataUint8ArrayCid, stream.bytes_written(), Heap::kOld));
+  const TypedData& deopt_info = TypedData::Handle(
+      zone(), TypedData::New(kTypedDataUint8ArrayCid, stream.bytes_written(),
+                             Heap::kOld));
   {
     NoSafepointScope no_safepoint;
-    memmove(deopt_info.DataAddr(0),
-            stream.buffer(),
-            stream.bytes_written());
+    memmove(deopt_info.DataAddr(0), stream.buffer(), stream.bytes_written());
   }
 
-  ASSERT(DeoptInfo::VerifyDecompression(
-      instructions_, deopt_table, deopt_info));
+  ASSERT(
+      DeoptInfo::VerifyDecompression(instructions_, deopt_table, deopt_info));
   instructions_.Clear();
   materializations_.Clear();
   frame_start_ = -1;
diff --git a/runtime/vm/deopt_instructions.h b/runtime/vm/deopt_instructions.h
index 09e01b4..01a6974 100644
--- a/runtime/vm/deopt_instructions.h
+++ b/runtime/vm/deopt_instructions.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_DEOPT_INSTRUCTIONS_H_
-#define VM_DEOPT_INSTRUCTIONS_H_
+#ifndef RUNTIME_VM_DEOPT_INSTRUCTIONS_H_
+#define RUNTIME_VM_DEOPT_INSTRUCTIONS_H_
 
 #include "vm/allocation.h"
 #include "vm/assembler.h"
@@ -29,8 +29,8 @@
 class DeoptContext {
  public:
   enum DestFrameOptions {
-    kDestIsOriginalFrame,   // Replace the original frame with deopt frame.
-    kDestIsAllocated        // Write deopt frame to a buffer.
+    kDestIsOriginalFrame,  // Replace the original frame with deopt frame.
+    kDestIsAllocated       // Write deopt frame to a buffer.
   };
 
   // If 'deoptimizing_code' is false, only frame is being deoptimized.
@@ -116,8 +116,8 @@
 #if !defined(TARGET_ARCH_DBC)
     // SP of the deoptimization frame is the lowest slot because
     // stack is growing downwards.
-    return reinterpret_cast<intptr_t*>(
-      frame->sp() - (kDartFrameFixedSize * kWordSize));
+    return reinterpret_cast<intptr_t*>(frame->sp() -
+                                       (kDartFrameFixedSize * kWordSize));
 #else
     // First argument is the lowest slot because stack is growing upwards.
     return reinterpret_cast<intptr_t*>(
@@ -163,61 +163,44 @@
 
   void DeferMaterializedObjectRef(intptr_t idx, intptr_t* slot) {
     deferred_slots_ = new DeferredObjectRef(
-        idx,
-        reinterpret_cast<RawObject**>(slot),
-        deferred_slots_);
+        idx, reinterpret_cast<RawObject**>(slot), deferred_slots_);
   }
 
   void DeferMaterialization(double value, RawDouble** slot) {
     deferred_slots_ = new DeferredDouble(
-        value,
-        reinterpret_cast<RawObject**>(slot),
-        deferred_slots_);
+        value, reinterpret_cast<RawObject**>(slot), deferred_slots_);
   }
 
   void DeferMintMaterialization(int64_t value, RawMint** slot) {
     deferred_slots_ = new DeferredMint(
-        value,
-        reinterpret_cast<RawObject**>(slot),
-        deferred_slots_);
+        value, reinterpret_cast<RawObject**>(slot), deferred_slots_);
   }
 
   void DeferMaterialization(simd128_value_t value, RawFloat32x4** slot) {
     deferred_slots_ = new DeferredFloat32x4(
-        value,
-        reinterpret_cast<RawObject**>(slot),
-        deferred_slots_);
+        value, reinterpret_cast<RawObject**>(slot), deferred_slots_);
   }
 
   void DeferMaterialization(simd128_value_t value, RawFloat64x2** slot) {
     deferred_slots_ = new DeferredFloat64x2(
-        value,
-        reinterpret_cast<RawObject**>(slot),
-        deferred_slots_);
+        value, reinterpret_cast<RawObject**>(slot), deferred_slots_);
   }
 
   void DeferMaterialization(simd128_value_t value, RawInt32x4** slot) {
     deferred_slots_ = new DeferredInt32x4(
-        value,
-        reinterpret_cast<RawObject**>(slot),
-        deferred_slots_);
+        value, reinterpret_cast<RawObject**>(slot), deferred_slots_);
   }
 
   void DeferRetAddrMaterialization(intptr_t index,
                                    intptr_t deopt_id,
                                    intptr_t* slot) {
     deferred_slots_ = new DeferredRetAddr(
-        index,
-        deopt_id,
-        reinterpret_cast<RawObject**>(slot),
-        deferred_slots_);
+        index, deopt_id, reinterpret_cast<RawObject**>(slot), deferred_slots_);
   }
 
   void DeferPcMarkerMaterialization(intptr_t index, intptr_t* slot) {
     deferred_slots_ = new DeferredPcMarker(
-        index,
-        reinterpret_cast<RawObject**>(slot),
-        deferred_slots_);
+        index, reinterpret_cast<RawObject**>(slot), deferred_slots_);
   }
 
   void DeferPpMaterialization(intptr_t index, RawObject** slot) {
@@ -257,9 +240,7 @@
     deferred_objects_[idx] = object;
   }
 
-  intptr_t DeferredObjectsCount() const {
-    return deferred_objects_count_;
-  }
+  intptr_t DeferredObjectsCount() const { return deferred_objects_count_; }
 
   RawCode* code_;
   RawObjectPool* object_pool_;
@@ -291,7 +272,6 @@
 };
 
 
-
 // Represents one deopt instruction, e.g, setup return address, store object,
 // store register, etc. The target is defined by instruction's position in
 // the deopt-info array.
@@ -363,9 +343,7 @@
 
   virtual intptr_t source_index() const = 0;
 
-  virtual const char* ArgumentsToCString() const {
-    return NULL;
-  }
+  virtual const char* ArgumentsToCString() const { return NULL; }
 
  private:
   static const char* KindToCString(Kind kind);
@@ -378,17 +356,17 @@
 // the DeoptContext as the specified type.
 // It calls different method depending on which kind of register (cpu/fpu) and
 // destination types are specified.
-template<typename RegisterType, typename DestinationType>
+template <typename RegisterType, typename DestinationType>
 struct RegisterReader;
 
-template<typename T>
+template <typename T>
 struct RegisterReader<Register, T> {
   static intptr_t Read(DeoptContext* context, Register reg) {
     return context->RegisterValue(reg);
   }
 };
 
-template<>
+template <>
 struct RegisterReader<FpuRegister, double> {
   static double Read(DeoptContext* context, FpuRegister reg) {
     return context->FpuRegisterValue(reg);
@@ -396,7 +374,7 @@
 };
 
 
-template<>
+template <>
 struct RegisterReader<FpuRegister, simd128_value_t> {
   static simd128_value_t Read(DeoptContext* context, FpuRegister reg) {
     return context->FpuRegisterValueAsSimd128(reg);
@@ -407,7 +385,7 @@
 // Class that encapsulates reading and writing of values that were either in
 // the registers in the optimized code or were spilled from those registers
 // to the stack.
-template<typename RegisterType>
+template <typename RegisterType>
 class RegisterSource {
  public:
   enum Kind {
@@ -418,20 +396,19 @@
   };
 
   explicit RegisterSource(intptr_t source_index)
-      : source_index_(source_index) { }
+      : source_index_(source_index) {}
 
   RegisterSource(Kind kind, intptr_t index)
-      : source_index_(KindField::encode(kind) | RawIndexField::encode(index)) {
-  }
+      : source_index_(KindField::encode(kind) | RawIndexField::encode(index)) {}
 
-  template<typename T>
+  template <typename T>
   T Value(DeoptContext* context) const {
     if (is_register()) {
-      return static_cast<T>(RegisterReader<RegisterType, T>::Read(
-        context, reg()));
+      return static_cast<T>(
+          RegisterReader<RegisterType, T>::Read(context, reg()));
     } else {
-      return *reinterpret_cast<T*>(context->GetSourceFrameAddressAt(
-          raw_index()));
+      return *reinterpret_cast<T*>(
+          context->GetSourceFrameAddressAt(raw_index()));
     }
   }
 
@@ -441,15 +418,14 @@
     if (is_register()) {
       return Name(reg());
     } else {
-      return Thread::Current()->zone()->PrintToString(
-          "s%" Pd "", raw_index());
+      return Thread::Current()->zone()->PrintToString("s%" Pd "", raw_index());
     }
   }
 
  private:
-  class KindField : public BitField<intptr_t, intptr_t, 0, 1> { };
-  class RawIndexField :
-      public BitField<intptr_t, intptr_t, 1, kBitsPerWord - 1> { };
+  class KindField : public BitField<intptr_t, intptr_t, 0, 1> {};
+  class RawIndexField
+      : public BitField<intptr_t, intptr_t, 1, kBitsPerWord - 1> {};
 
   bool is_register() const {
     return KindField::decode(source_index_) == kRegister;
@@ -458,9 +434,7 @@
 
   RegisterType reg() const { return static_cast<RegisterType>(raw_index()); }
 
-  static const char* Name(Register reg) {
-    return Assembler::RegisterName(reg);
-  }
+  static const char* Name(Register reg) { return Assembler::RegisterName(reg); }
 
   static const char* Name(FpuRegister fpu_reg) {
     return Assembler::FpuRegisterName(fpu_reg);
@@ -525,8 +499,9 @@
   class TrieNode;
 
   CpuRegisterSource ToCpuRegisterSource(const Location& loc);
-  FpuRegisterSource ToFpuRegisterSource(const Location& loc,
-                                      Location::Kind expected_stack_slot_kind);
+  FpuRegisterSource ToFpuRegisterSource(
+      const Location& loc,
+      Location::Kind expected_stack_slot_kind);
 
   intptr_t FindOrAddObjectInTable(const Object& obj) const;
   intptr_t FindMaterialization(MaterializeObjectInstr* mat) const;
@@ -591,13 +566,11 @@
 
   static RawSmi* EncodeReasonAndFlags(ICData::DeoptReasonId reason,
                                       uint32_t flags) {
-    return Smi::New(ReasonField::encode(reason) |
-                    FlagsField::encode(flags));
+    return Smi::New(ReasonField::encode(reason) | FlagsField::encode(flags));
   }
 
-  class ReasonField :
-      public BitField<intptr_t, ICData::DeoptReasonId, 0, 8> { };
-  class FlagsField : public BitField<intptr_t, uint32_t, 8, 8> { };
+  class ReasonField : public BitField<intptr_t, ICData::DeoptReasonId, 0, 8> {};
+  class FlagsField : public BitField<intptr_t, uint32_t, 8, 8> {};
 
  private:
   static const intptr_t kEntrySize = 3;
@@ -605,4 +578,4 @@
 
 }  // namespace dart
 
-#endif  // VM_DEOPT_INSTRUCTIONS_H_
+#endif  // RUNTIME_VM_DEOPT_INSTRUCTIONS_H_
diff --git a/runtime/vm/disassembler.cc b/runtime/vm/disassembler.cc
index 1b62540..235fcfe 100644
--- a/runtime/vm/disassembler.cc
+++ b/runtime/vm/disassembler.cc
@@ -81,7 +81,7 @@
   va_start(args, format);
   intptr_t len = OS::VSNPrint(NULL, 0, format, args);
   va_end(args);
-  char* p = reinterpret_cast<char*>(malloc(len+1));
+  char* p = reinterpret_cast<char*>(malloc(len + 1));
   va_start(args, format);
   intptr_t len2 = OS::VSNPrint(p, len, format, args);
   va_end(args);
@@ -146,31 +146,25 @@
     }
     int instruction_length;
     Object* object;
-    DecodeInstruction(hex_buffer,
-                      sizeof(hex_buffer),
-                      human_buffer,
-                      sizeof(human_buffer),
-                      &instruction_length, code, &object, pc);
-    formatter->ConsumeInstruction(code,
-                                  hex_buffer,
-                                  sizeof(hex_buffer),
-                                  human_buffer,
-                                  sizeof(human_buffer),
-                                  object,
+    DecodeInstruction(hex_buffer, sizeof(hex_buffer), human_buffer,
+                      sizeof(human_buffer), &instruction_length, code, &object,
+                      pc);
+    formatter->ConsumeInstruction(code, hex_buffer, sizeof(hex_buffer),
+                                  human_buffer, sizeof(human_buffer), object,
                                   pc);
     pc += instruction_length;
   }
 }
 
 
-void Disassembler::DisassembleCodeHelper(
-    const char* function_fullname, const Code& code, bool optimized) {
+void Disassembler::DisassembleCodeHelper(const char* function_fullname,
+                                         const Code& code,
+                                         bool optimized) {
   LocalVarDescriptors& var_descriptors = LocalVarDescriptors::Handle();
   if (FLAG_print_variable_descriptors) {
     var_descriptors = code.GetLocalVarDescriptors();
   }
-  THR_Print("Code for %sfunction '%s' {\n",
-            optimized ? "optimized " : "",
+  THR_Print("Code for %sfunction '%s' {\n", optimized ? "optimized " : "",
             function_fullname);
   code.Disassemble();
   THR_Print("}\n");
@@ -182,8 +176,8 @@
   for (intptr_t i = code.pointer_offsets_length() - 1; i >= 0; i--) {
     const uword addr = code.GetPointerOffsetAt(i) + code.PayloadStart();
     obj = *reinterpret_cast<RawObject**>(addr);
-    THR_Print(" %d : %#" Px " '%s'\n",
-              code.GetPointerOffsetAt(i), addr, obj.ToCString());
+    THR_Print(" %d : %#" Px " '%s'\n", code.GetPointerOffsetAt(i), addr,
+              obj.ToCString());
   }
   THR_Print("}\n");
 #else
@@ -212,12 +206,10 @@
       const intptr_t reason =
           DeoptTable::ReasonField::decode(reason_and_flags.Value());
       ASSERT((0 <= reason) && (reason < ICData::kDeoptNumReasons));
-      THR_Print("%4" Pd ": 0x%" Px "  %s  (%s)\n",
-                i,
-                start + offset.Value(),
-                DeoptInfo::ToCString(deopt_table, info),
-                DeoptReasonToCString(
-                    static_cast<ICData::DeoptReasonId>(reason)));
+      THR_Print(
+          "%4" Pd ": 0x%" Px "  %s  (%s)\n", i, start + offset.Value(),
+          DeoptInfo::ToCString(deopt_table, info),
+          DeoptReasonToCString(static_cast<ICData::DeoptReasonId>(reason)));
     }
     THR_Print("}\n");
   }
@@ -234,8 +226,7 @@
   THR_Print("}\n");
 
   if (FLAG_print_variable_descriptors) {
-    THR_Print("Variable Descriptors for function '%s' {\n",
-              function_fullname);
+    THR_Print("Variable Descriptors for function '%s' {\n", function_fullname);
     intptr_t var_desc_length =
         var_descriptors.IsNull() ? 0 : var_descriptors.Length();
     String& var_name = String::Handle();
@@ -249,17 +240,17 @@
       } else {
         if (kind == RawLocalVarDescriptors::kContextLevel) {
           THR_Print("  context level %d scope %d", var_info.index(),
-              var_info.scope_id);
+                    var_info.scope_id);
         } else if (kind == RawLocalVarDescriptors::kStackVar) {
-          THR_Print("  stack var '%s' offset %d",
-            var_name.ToCString(), var_info.index());
+          THR_Print("  stack var '%s' offset %d", var_name.ToCString(),
+                    var_info.index());
         } else {
           ASSERT(kind == RawLocalVarDescriptors::kContextVar);
           THR_Print("  context var '%s' level %d offset %d",
-              var_name.ToCString(), var_info.scope_id, var_info.index());
+                    var_name.ToCString(), var_info.scope_id, var_info.index());
         }
         THR_Print(" (valid %s-%s)\n", var_info.begin_pos.ToCString(),
-                                      var_info.end_pos.ToCString());
+                  var_info.end_pos.ToCString());
       }
     }
     THR_Print("}\n");
@@ -267,7 +258,7 @@
 
   THR_Print("Exception Handlers for function '%s' {\n", function_fullname);
   const ExceptionHandlers& handlers =
-        ExceptionHandlers::Handle(code.exception_handlers());
+      ExceptionHandlers::Handle(code.exception_handlers());
   THR_Print("%s}\n", handlers.ToCString());
 
   {
@@ -277,7 +268,7 @@
     Function& function = Function::Handle();
     Code& code = Code::Handle();
     for (intptr_t i = 0; i < table.Length();
-        i += Code::kSCallTableEntryLength) {
+         i += Code::kSCallTableEntryLength) {
       offset ^= table.At(i + Code::kSCallTableOffsetEntry);
       function ^= table.At(i + Code::kSCallTableFunctionEntry);
       code ^= table.At(i + Code::kSCallTableCodeEntry);
@@ -285,21 +276,15 @@
         Class& cls = Class::Handle();
         cls ^= code.owner();
         if (cls.IsNull()) {
-          THR_Print("  0x%" Px ": %s, %p\n",
-              start + offset.Value(),
-              code.Name(),
-              code.raw());
+          THR_Print("  0x%" Px ": %s, %p\n", start + offset.Value(),
+                    code.Name(), code.raw());
         } else {
           THR_Print("  0x%" Px ": allocation stub for %s, %p\n",
-              start + offset.Value(),
-              cls.ToCString(),
-              code.raw());
+                    start + offset.Value(), cls.ToCString(), code.raw());
         }
       } else {
-        THR_Print("  0x%" Px ": %s, %p\n",
-            start + offset.Value(),
-            function.ToFullyQualifiedCString(),
-            code.raw());
+        THR_Print("  0x%" Px ": %s, %p\n", start + offset.Value(),
+                  function.ToFullyQualifiedCString(), code.raw());
       }
     }
     THR_Print("}\n");
@@ -317,8 +302,8 @@
 }
 
 
-void Disassembler::DisassembleCodeUnoptimized(
-    const Function& function, bool optimized) {
+void Disassembler::DisassembleCodeUnoptimized(const Function& function,
+                                              bool optimized) {
   const char* function_fullname = function.ToFullyQualifiedCString();
   const Code& code = Code::Handle(function.unoptimized_code());
   DisassembleCodeHelper(function_fullname, code, optimized);
diff --git a/runtime/vm/disassembler.h b/runtime/vm/disassembler.h
index 7adb12a..283f16e 100644
--- a/runtime/vm/disassembler.h
+++ b/runtime/vm/disassembler.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_DISASSEMBLER_H_
-#define VM_DISASSEMBLER_H_
+#ifndef RUNTIME_VM_DISASSEMBLER_H_
+#define RUNTIME_VM_DISASSEMBLER_H_
 
 #include "vm/allocation.h"
 #include "vm/assembler.h"
@@ -20,8 +20,8 @@
 // disassembled instructions in any desired form.
 class DisassemblyFormatter {
  public:
-  DisassemblyFormatter() { }
-  virtual ~DisassemblyFormatter() { }
+  DisassemblyFormatter() {}
+  virtual ~DisassemblyFormatter() {}
 
   // Consume the decoded instruction at the given pc.
   virtual void ConsumeInstruction(const Code& code,
@@ -41,8 +41,8 @@
 // to stdout.
 class DisassembleToStdout : public DisassemblyFormatter {
  public:
-  DisassembleToStdout() : DisassemblyFormatter() { }
-  ~DisassembleToStdout() { }
+  DisassembleToStdout() : DisassemblyFormatter() {}
+  ~DisassembleToStdout() {}
 
   virtual void ConsumeInstruction(const Code& code,
                                   char* hex_buffer,
@@ -64,8 +64,8 @@
 class DisassembleToJSONStream : public DisassemblyFormatter {
  public:
   explicit DisassembleToJSONStream(const JSONArray& jsarr)
-      : DisassemblyFormatter(), jsarr_(jsarr) { }
-  ~DisassembleToJSONStream() { }
+      : DisassemblyFormatter(), jsarr_(jsarr) {}
+  ~DisassembleToJSONStream() {}
 
   virtual void ConsumeInstruction(const Code& code,
                                   char* hex_buffer,
@@ -101,9 +101,7 @@
     Disassemble(start, end, formatter, Code::Handle());
   }
 
-  static void Disassemble(uword start,
-                          uword end,
-                          const Code& code) {
+  static void Disassemble(uword start, uword end, const Code& code) {
     DisassembleToStdout stdout_formatter;
     LogBlock lb;
     Disassemble(start, end, &stdout_formatter, code);
@@ -119,18 +117,23 @@
   // Writes a hexadecimal representation into the hex_buffer and a
   // human-readable representation into the human_buffer.
   // Writes the length of the decoded instruction in bytes in out_instr_len.
-  static void DecodeInstruction(char* hex_buffer, intptr_t hex_size,
-                                char* human_buffer, intptr_t human_size,
-                                int* out_instr_len, const Code& code,
-                                Object** object, uword pc);
+  static void DecodeInstruction(char* hex_buffer,
+                                intptr_t hex_size,
+                                char* human_buffer,
+                                intptr_t human_size,
+                                int* out_instr_len,
+                                const Code& code,
+                                Object** object,
+                                uword pc);
 
   static void DisassembleCode(const Function& function, bool optimized);
-  static void DisassembleCodeUnoptimized(
-      const Function& function, bool optimized);
+  static void DisassembleCodeUnoptimized(const Function& function,
+                                         bool optimized);
 
  private:
-  static void DisassembleCodeHelper(
-      const char* function_fullname, const Code& code, bool optimized);
+  static void DisassembleCodeHelper(const char* function_fullname,
+                                    const Code& code,
+                                    bool optimized);
 
   static const int kHexadecimalBufferSize = 32;
   static const int kUserReadableBufferSize = 256;
@@ -138,4 +141,4 @@
 
 }  // namespace dart
 
-#endif  // VM_DISASSEMBLER_H_
+#endif  // RUNTIME_VM_DISASSEMBLER_H_
diff --git a/runtime/vm/disassembler_arm.cc b/runtime/vm/disassembler_arm.cc
index 6419c08..8c6d5fd 100644
--- a/runtime/vm/disassembler_arm.cc
+++ b/runtime/vm/disassembler_arm.cc
@@ -17,9 +17,7 @@
 class ARMDecoder : public ValueObject {
  public:
   ARMDecoder(char* buffer, size_t buffer_size)
-      : buffer_(buffer),
-        buffer_size_(buffer_size),
-        buffer_pos_(0) {
+      : buffer_(buffer), buffer_size_(buffer_size), buffer_pos_(0) {
     buffer_[buffer_pos_] = '\0';
   }
 
@@ -71,9 +69,9 @@
   char* current_position_in_buffer() { return buffer_ + buffer_pos_; }
   size_t remaining_size_in_buffer() { return buffer_size_ - buffer_pos_; }
 
-  char* buffer_;  // Decode instructions into this buffer.
+  char* buffer_;        // Decode instructions into this buffer.
   size_t buffer_size_;  // The size of the character buffer.
-  size_t buffer_pos_;  // Current character position in buffer.
+  size_t buffer_pos_;   // Current character position in buffer.
 
   DISALLOW_ALLOCATION();
   DISALLOW_COPY_AND_ASSIGN(ARMDecoder);
@@ -81,7 +79,7 @@
 
 
 // Support for assertions in the ARMDecoder formatting functions.
-#define STRING_STARTS_WITH(string, compare_string) \
+#define STRING_STARTS_WITH(string, compare_string)                             \
   (strncmp(string, compare_string, strlen(compare_string)) == 0)
 
 
@@ -99,8 +97,8 @@
 // These condition names are defined in a way to match the native disassembler
 // formatting. See for example the command "objdump -d <binary file>".
 static const char* cond_names[kMaxCondition] = {
-  "eq", "ne", "cs" , "cc" , "mi" , "pl" , "vs" , "vc" ,
-  "hi", "ls", "ge", "lt", "gt", "le", "", "invalid",
+    "eq", "ne", "cs", "cc", "mi", "pl", "vs", "vc",
+    "hi", "ls", "ge", "lt", "gt", "le", "",   "invalid",
 };
 
 
@@ -115,11 +113,11 @@
 // See for example the command "objdump -d <binary file>".
 static const char* reg_names[kNumberOfCpuRegisters] = {
 #if defined(TARGET_ABI_IOS)
-  "r0", "r1", "r2", "r3", "r4", "pp", "r6", "fp",
-  "r8", "r9", "thr", "r11", "ip", "sp", "lr", "pc",
+    "r0", "r1", "r2",  "r3",  "r4", "pp", "r6", "fp",
+    "r8", "r9", "thr", "r11", "ip", "sp", "lr", "pc",
 #elif defined(TARGET_ABI_EABI)
-  "r0", "r1", "r2", "r3", "r4", "pp", "r6", "r7",
-  "r8", "r9", "thr", "fp", "ip", "sp", "lr", "pc",
+    "r0", "r1", "r2",  "r3", "r4", "pp", "r6", "r7",
+    "r8", "r9", "thr", "fp", "ip", "sp", "lr", "pc",
 #else
 #error Unknown ABI
 #endif
@@ -138,8 +136,7 @@
   ASSERT(0 <= reg);
   ASSERT(reg < kNumberOfSRegisters);
   buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                             remaining_size_in_buffer(),
-                             "s%d", reg);
+                             remaining_size_in_buffer(), "s%d", reg);
 }
 
 
@@ -147,8 +144,7 @@
   ASSERT(0 <= reg);
   ASSERT(reg < kNumberOfDRegisters);
   buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                             remaining_size_in_buffer(),
-                             "d%d", reg);
+                             remaining_size_in_buffer(), "d%d", reg);
 }
 
 
@@ -156,16 +152,13 @@
   ASSERT(0 <= reg);
   ASSERT(reg < kNumberOfQRegisters);
   buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                             remaining_size_in_buffer(),
-                             "q%d", reg);
+                             remaining_size_in_buffer(), "q%d", reg);
 }
 
 
 // These shift names are defined in a way to match the native disassembler
 // formatting. See for example the command "objdump -d <binary file>".
-static const char* shift_names[kMaxShift] = {
-  "lsl", "lsr", "asr", "ror"
-};
+static const char* shift_names[kMaxShift] = {"lsl", "lsr", "asr", "ror"};
 
 
 // Print the register shift operands for the instruction. Generally used for
@@ -189,18 +182,15 @@
     } else if (((shift == LSR) || (shift == ASR)) && (shift_amount == 0)) {
       shift_amount = 32;
     }
-    buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                               remaining_size_in_buffer(),
-                               ", %s #%d",
-                               shift_names[shift],
-                               shift_amount);
+    buffer_pos_ +=
+        OS::SNPrint(current_position_in_buffer(), remaining_size_in_buffer(),
+                    ", %s #%d", shift_names[shift], shift_amount);
   } else {
     // by register
     int rs = instr->RsField();
-    buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                               remaining_size_in_buffer(),
-                              ", %s ",
-                              shift_names[shift]);
+    buffer_pos_ +=
+        OS::SNPrint(current_position_in_buffer(), remaining_size_in_buffer(),
+                    ", %s ", shift_names[shift]);
     PrintRegister(rs);
   }
 }
@@ -213,9 +203,7 @@
   int immed8 = instr->Immed8Field();
   int imm = (immed8 >> rotate) | (immed8 << (32 - rotate));
   buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                             remaining_size_in_buffer(),
-                             "#%d",
-                             imm);
+                             remaining_size_in_buffer(), "#%d", imm);
 }
 
 
@@ -437,10 +425,9 @@
         ASSERT(STRING_STARTS_WITH(format, "dest"));
         int off = (instr->SImmed24Field() << 2) + 8;
         uword destination = reinterpret_cast<uword>(instr) + off;
-        buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   "%#" Px "",
-                                   destination);
+        buffer_pos_ +=
+            OS::SNPrint(current_position_in_buffer(),
+                        remaining_size_in_buffer(), "%#" Px "", destination);
         return 4;
       } else {
         return FormatDRegister(instr, format);
@@ -454,15 +441,13 @@
       if (format[3] == 'f') {
         ASSERT(STRING_STARTS_WITH(format, "immf"));
         buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   "%f",
+                                   remaining_size_in_buffer(), "%f",
                                    instr->ImmFloatField());
         return 4;
       } else if (format[3] == 'd') {
         ASSERT(STRING_STARTS_WITH(format, "immd"));
         buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   "%g",
+                                   remaining_size_in_buffer(), "%g",
                                    instr->ImmDoubleField());
         return 4;
       } else if (format[3] == '1') {
@@ -474,13 +459,14 @@
           ASSERT(STRING_STARTS_WITH(format, "imm4_vdup"));
           int32_t idx = -1;
           int32_t imm4 = instr->Bits(16, 4);
-          if ((imm4 & 1) != 0) idx = imm4 >> 1;
-          else if ((imm4 & 2) != 0) idx = imm4 >> 2;
-          else if ((imm4 & 4) != 0) idx = imm4 >> 3;
+          if ((imm4 & 1) != 0)
+            idx = imm4 >> 1;
+          else if ((imm4 & 2) != 0)
+            idx = imm4 >> 2;
+          else if ((imm4 & 4) != 0)
+            idx = imm4 >> 3;
           buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                     remaining_size_in_buffer(),
-                                     "%d",
-                                     idx);
+                                     remaining_size_in_buffer(), "%d", idx);
           return 9;
         } else {
           ASSERT(STRING_STARTS_WITH(format, "imm4_12"));
@@ -488,9 +474,7 @@
         }
       }
       buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                 remaining_size_in_buffer(),
-                                 "0x%x",
-                                 immed16);
+                                 remaining_size_in_buffer(), "0x%x", immed16);
       return 7;
     }
     case 'l': {  // 'l: branch and link
@@ -515,15 +499,13 @@
         if (format[4] == '0') {
           // 'off10: 10-bit offset for VFP load and store instructions
           buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                     remaining_size_in_buffer(),
-                                     "%d",
+                                     remaining_size_in_buffer(), "%d",
                                      instr->Bits(0, 8) << 2);
         } else {
           // 'off12: 12-bit offset for load and store instructions.
           ASSERT(STRING_STARTS_WITH(format, "off12"));
           buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                     remaining_size_in_buffer(),
-                                     "%d",
+                                     remaining_size_in_buffer(), "%d",
                                      instr->Offset12Field());
         }
         return 5;
@@ -532,9 +514,7 @@
       ASSERT(STRING_STARTS_WITH(format, "off8"));
       int offs8 = (instr->ImmedHField() << 4) | instr->ImmedLField();
       buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                 remaining_size_in_buffer(),
-                                 "%d",
-                                 offs8);
+                                 remaining_size_in_buffer(), "%d", offs8);
       return 4;
     }
     case 'p': {  // 'pu: P and U bits for load and store instructions.
@@ -546,7 +526,7 @@
       return FormatRegister(instr, format);
     }
     case 's': {
-      if (format[1] == 'h') {  // 'shift_op or 'shift_rm
+      if (format[1] == 'h') {    // 'shift_op or 'shift_rm
         if (format[6] == 'o') {  // 'shift_op
           ASSERT(STRING_STARTS_WITH(format, "shift_op"));
           if (instr->TypeField() == 0) {
@@ -563,26 +543,33 @@
         }
       } else if (format[1] == 'v') {  // 'svc
         ASSERT(STRING_STARTS_WITH(format, "svc"));
-        buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   "0x%x",
-                                   instr->SvcField());
+        buffer_pos_ +=
+            OS::SNPrint(current_position_in_buffer(),
+                        remaining_size_in_buffer(), "0x%x", instr->SvcField());
         return 3;
       } else if (format[1] == 'z') {
         // 'sz: Size field of SIMD instructions.
         int sz = instr->Bits(20, 2);
         char const* sz_str;
         switch (sz) {
-          case 0: sz_str = "b"; break;
-          case 1: sz_str = "h"; break;
-          case 2: sz_str = "w"; break;
-          case 3: sz_str = "l"; break;
-          default: sz_str = "?"; break;
+          case 0:
+            sz_str = "b";
+            break;
+          case 1:
+            sz_str = "h";
+            break;
+          case 2:
+            sz_str = "w";
+            break;
+          case 3:
+            sz_str = "l";
+            break;
+          default:
+            sz_str = "?";
+            break;
         }
         buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   "%s",
-                                   sz_str);
+                                   remaining_size_in_buffer(), "%s", sz_str);
         return 2;
       } else if (format[1] == ' ') {
         // 's: S field of data processing instructions.
@@ -598,9 +585,7 @@
       ASSERT(STRING_STARTS_WITH(format, "target"));
       int off = (instr->SImmed24Field() << 2) + 8;
       buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                 remaining_size_in_buffer(),
-                                 "%+d",
-                                 off);
+                                 remaining_size_in_buffer(), "%+d", off);
       return 6;
     }
     case 'u': {  // 'u: signed or unsigned multiplies.
@@ -654,7 +639,7 @@
     }
     cur = *format++;
   }
-  buffer_[buffer_pos_]  = '\0';
+  buffer_[buffer_pos_] = '\0';
 }
 
 
@@ -695,13 +680,12 @@
             if (instr->BkptField() == Instr::kStopMessageCode) {
               const char* message = *reinterpret_cast<const char**>(
                   reinterpret_cast<intptr_t>(instr) - Instr::kInstrSize);
-              buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                         remaining_size_in_buffer(),
-                                         " ; \"%s\"",
-                                         message);
+              buffer_pos_ +=
+                  OS::SNPrint(current_position_in_buffer(),
+                              remaining_size_in_buffer(), " ; \"%s\"", message);
             }
           } else {
-             // Format(instr, "smc'cond");
+            // Format(instr, "smc'cond");
             Unknown(instr);  // Not used.
           }
           break;
@@ -1064,7 +1048,7 @@
         Format(instr, "vmovdrr'cond 'dm, 'rd, 'rn");
       }
     }
-  } else if (instr-> IsVFPLoadStore()) {
+  } else if (instr->IsVFPLoadStore()) {
     if (instr->Bit(8) == 0) {
       if (instr->Bit(20) == 1) {  // vldrs
         if (instr->Bit(23) == 1) {
@@ -1095,13 +1079,13 @@
       }
     }
   } else if (instr->IsVFPMultipleLoadStore()) {
-    if (instr->HasL()) {  // vldm
+    if (instr->HasL()) {    // vldm
       if (instr->Bit(8)) {  // vldmd
         Format(instr, "vldmd'cond'pu 'rn'w, 'dlist");
       } else {  // vldms
         Format(instr, "vldms'cond'pu 'rn'w, 'slist");
       }
-    } else {  // vstm
+    } else {                // vstm
       if (instr->Bit(8)) {  // vstmd
         Format(instr, "vstmd'cond'pu 'rn'w, 'dlist");
       } else {  // vstms
@@ -1174,7 +1158,7 @@
           }
           break;
         }
-        case 0xb: {  // Other VFP data-processing instructions
+        case 0xb: {                  // Other VFP data-processing instructions
           if (instr->Bit(6) == 0) {  // vmov immediate
             if (instr->Bit(8) == 0) {
               Format(instr, "vmovs'cond 'sd, #'immf");
@@ -1234,8 +1218,8 @@
               }
               break;
             }
-            case 4:  // vcmp, vcmpe
-            case 5: {  // vcmp #0.0, vcmpe #0.0
+            case 4:                      // vcmp, vcmpe
+            case 5: {                    // vcmp #0.0, vcmpe #0.0
               if (instr->Bit(7) == 1) {  // vcmpe
                 Unknown(instr);
               } else {
@@ -1301,9 +1285,9 @@
               }
               break;
             }
-            case 2:  // vcvtb, vcvtt
-            case 3:  // vcvtb, vcvtt
-            case 9:  // undefined
+            case 2:   // vcvtb, vcvtt
+            case 3:   // vcvtb, vcvtt
+            case 9:   // undefined
             case 10:  // vcvt between floating-point and fixed-point
             case 11:  // vcvt between floating-point and fixed-point
             case 14:  // vcvt between floating-point and fixed-point
@@ -1313,8 +1297,7 @@
               break;
             }
           }
-        }
-        break;
+        } break;
       }
     } else {
       // 8, 16, or 32-bit Transfer between ARM Core and VFP
@@ -1532,10 +1515,14 @@
 }
 
 
-void Disassembler::DecodeInstruction(char* hex_buffer, intptr_t hex_size,
-                                     char* human_buffer, intptr_t human_size,
-                                     int* out_instr_size, const Code& code,
-                                     Object** object, uword pc) {
+void Disassembler::DecodeInstruction(char* hex_buffer,
+                                     intptr_t hex_size,
+                                     char* human_buffer,
+                                     intptr_t human_size,
+                                     int* out_instr_size,
+                                     const Code& code,
+                                     Object** object,
+                                     uword pc) {
   ARMDecoder decoder(human_buffer, human_size);
   decoder.InstructionDecode(pc);
   int32_t instruction_bits = Instr::At(pc)->InstructionBits();
diff --git a/runtime/vm/disassembler_arm64.cc b/runtime/vm/disassembler_arm64.cc
index 6bbc3c7..448fda3 100644
--- a/runtime/vm/disassembler_arm64.cc
+++ b/runtime/vm/disassembler_arm64.cc
@@ -16,9 +16,7 @@
 class ARM64Decoder : public ValueObject {
  public:
   ARM64Decoder(char* buffer, size_t buffer_size)
-      : buffer_(buffer),
-        buffer_size_(buffer_size),
-        buffer_pos_(0) {
+      : buffer_(buffer), buffer_size_(buffer_size), buffer_pos_(0) {
     buffer_[buffer_pos_] = '\0';
   }
 
@@ -43,16 +41,15 @@
 
   // Handle formatting of instructions and their options.
   int FormatRegister(Instr* instr, const char* option);
-  int FormatVRegister(Instr*instr, const char* option);
+  int FormatVRegister(Instr* instr, const char* option);
   int FormatOption(Instr* instr, const char* format);
   void Format(Instr* instr, const char* format);
   void Unknown(Instr* instr);
 
-  // Decode instructions.
-  #define DECODE_OP(op)                                                        \
-    void Decode##op(Instr* instr);
+// Decode instructions.
+#define DECODE_OP(op) void Decode##op(Instr* instr);
   APPLY_OP_LIST(DECODE_OP)
-  #undef DECODE_OP
+#undef DECODE_OP
 
 
   // Convenience functions.
@@ -60,9 +57,9 @@
   char* current_position_in_buffer() { return buffer_ + buffer_pos_; }
   size_t remaining_size_in_buffer() { return buffer_size_ - buffer_pos_; }
 
-  char* buffer_;  // Decode instructions into this buffer.
+  char* buffer_;        // Decode instructions into this buffer.
   size_t buffer_size_;  // The size of the character buffer.
-  size_t buffer_pos_;  // Current character position in buffer.
+  size_t buffer_pos_;   // Current character position in buffer.
 
   DISALLOW_ALLOCATION();
   DISALLOW_COPY_AND_ASSIGN(ARM64Decoder);
@@ -70,7 +67,7 @@
 
 
 // Support for assertions in the ARM64Decoder formatting functions.
-#define STRING_STARTS_WITH(string, compare_string) \
+#define STRING_STARTS_WITH(string, compare_string)                             \
   (strncmp(string, compare_string, strlen(compare_string)) == 0)
 
 
@@ -89,10 +86,9 @@
 // formatting, except for register aliases ctx (r9), pp (r10) and sp (r19).
 // See for example the command "objdump -d <binary file>".
 static const char* reg_names[kNumberOfCpuRegisters] = {
-  "r0",  "r1",  "r2",  "r3",  "r4",  "r5",  "r6",  "r7",
-  "r8",  "r9",  "r10", "r11", "r12", "r13", "r14", "r15",
-  "ip0", "ip1", "r18", "sp",  "r20", "r21", "r22", "r23",
-  "r24", "r25", "thr", "pp",  "ctx", "fp",  "lr",  "r31",
+    "r0",  "r1",  "r2",  "r3",  "r4",  "r5",  "r6",  "r7",  "r8", "r9",  "r10",
+    "r11", "r12", "r13", "r14", "r15", "ip0", "ip1", "r18", "sp", "r20", "r21",
+    "r22", "r23", "r24", "r25", "thr", "pp",  "ctx", "fp",  "lr", "r31",
 };
 
 
@@ -113,29 +109,25 @@
   ASSERT(0 <= reg);
   ASSERT(reg < kNumberOfVRegisters);
   buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                             remaining_size_in_buffer(),
-                             "v%d", reg);
+                             remaining_size_in_buffer(), "v%d", reg);
 }
 
 
 // These shift names are defined in a way to match the native disassembler
 // formatting. See for example the command "objdump -d <binary file>".
-static const char* shift_names[kMaxShift] = {
-  "lsl", "lsr", "asr", "ror"
-};
+static const char* shift_names[kMaxShift] = {"lsl", "lsr", "asr", "ror"};
 
 
 static const char* extend_names[kMaxExtend] = {
-  "uxtb", "uxth", "uxtw", "uxtx",
-  "sxtb", "sxth", "sxtw", "sxtx",
+    "uxtb", "uxth", "uxtw", "uxtx", "sxtb", "sxth", "sxtw", "sxtx",
 };
 
 
 // These condition names are defined in a way to match the native disassembler
 // formatting. See for example the command "objdump -d <binary file>".
 static const char* cond_names[kMaxCondition] = {
-  "eq", "ne", "cs" , "cc" , "mi" , "pl" , "vs" , "vc" ,
-  "hi", "ls", "ge", "lt", "gt", "le", "", "invalid",
+    "eq", "ne", "cs", "cc", "mi", "pl", "vs", "vc",
+    "hi", "ls", "ge", "lt", "gt", "le", "",   "invalid",
 };
 
 
@@ -172,25 +164,21 @@
     } else if (((shift == LSR) || (shift == ASR)) && (shift_amount == 0)) {
       shift_amount = 32;
     }
-    buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                               remaining_size_in_buffer(),
-                               " %s #%d",
-                               shift_names[shift],
-                               shift_amount);
+    buffer_pos_ +=
+        OS::SNPrint(current_position_in_buffer(), remaining_size_in_buffer(),
+                    " %s #%d", shift_names[shift], shift_amount);
   } else {
     ASSERT(instr->IsExtend());
     // by register
-    buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                               remaining_size_in_buffer(),
-                               " %s",
-                               extend_names[extend]);
+    buffer_pos_ +=
+        OS::SNPrint(current_position_in_buffer(), remaining_size_in_buffer(),
+                    " %s", extend_names[extend]);
     if (((instr->SFField() == 1) && (extend == UXTX)) ||
         ((instr->SFField() == 0) && (extend == UXTW))) {
       // Shift amount.
-      buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                 remaining_size_in_buffer(),
-                                 " %d",
-                                 extend_shift_amount);
+      buffer_pos_ +=
+          OS::SNPrint(current_position_in_buffer(), remaining_size_in_buffer(),
+                      " %d", extend_shift_amount);
     }
   }
 }
@@ -207,9 +195,7 @@
     PrintRegister(rn, R31IsSP);
     if (off != 0) {
       buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                 remaining_size_in_buffer(),
-                                 ", #%d",
-                                 off);
+                                 remaining_size_in_buffer(), ", #%d", off);
     }
     Print("]");
   } else {
@@ -220,9 +206,7 @@
         Print("[");
         PrintRegister(rn, R31IsSP);
         buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   ", #%d",
-                                   imm9);
+                                   remaining_size_in_buffer(), ", #%d", imm9);
         Print("]");
         break;
       }
@@ -233,9 +217,7 @@
         PrintRegister(rn, R31IsSP);
         Print("]");
         buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   ", #%d !",
-                                   imm9);
+                                   remaining_size_in_buffer(), ", #%d !", imm9);
         break;
       }
       case 2: {
@@ -246,10 +228,9 @@
         PrintRegister(rn, R31IsSP);
         Print(", ");
         PrintRegister(rm, R31IsZR);
-        buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   " %s",
-                                   extend_names[ext]);
+        buffer_pos_ +=
+            OS::SNPrint(current_position_in_buffer(),
+                        remaining_size_in_buffer(), " %s", extend_names[ext]);
         if (s == 1) {
           Print(" scaled");
         }
@@ -262,15 +243,11 @@
         Print("[");
         PrintRegister(rn, R31IsSP);
         buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   ", #%d",
-                                   imm9);
+                                   remaining_size_in_buffer(), ", #%d", imm9);
         Print("] !");
         break;
       }
-      default: {
-        Print("???");
-      }
+      default: { Print("???"); }
     }
   }
 }
@@ -285,24 +262,20 @@
   switch (instr->Bits(23, 3)) {
     case 1:
       // rn + (imm7 << (2 + B31)), post-index, writeback.
-      buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                 remaining_size_in_buffer(),
-                                 "], #%d !",
-                                 offset);
+      buffer_pos_ +=
+          OS::SNPrint(current_position_in_buffer(), remaining_size_in_buffer(),
+                      "], #%d !", offset);
       break;
     case 2:
       // rn + (imm7 << (2 + B31)), pre-index, no writeback.
       buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                 remaining_size_in_buffer(),
-                                 ", #%d ]",
-                                 offset);
+                                 remaining_size_in_buffer(), ", #%d ]", offset);
       break;
     case 3:
       // rn + (imm7 << (2 + B31)), pre-index, writeback.
-      buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                 remaining_size_in_buffer(),
-                                 ", #%d ]!",
-                                 offset);
+      buffer_pos_ +=
+          OS::SNPrint(current_position_in_buffer(), remaining_size_in_buffer(),
+                      ", #%d ]!", offset);
       break;
     default:
       Print(", ???]");
@@ -381,17 +354,13 @@
         ASSERT(STRING_STARTS_WITH(format, "bitimm"));
         const uint64_t imm = instr->ImmLogical();
         buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   "0x%" Px64,
-                                   imm);
+                                   remaining_size_in_buffer(), "0x%" Px64, imm);
         return 6;
       } else {
         ASSERT(STRING_STARTS_WITH(format, "bitpos"));
         int bitpos = instr->Bits(19, 4) | (instr->Bit(31) << 5);
         buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   "#%d",
-                                   bitpos);
+                                   remaining_size_in_buffer(), "#%d", bitpos);
         return 6;
       }
     }
@@ -410,9 +379,7 @@
           typ = "d";
         }
         buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   "%s",
-                                   typ);
+                                   remaining_size_in_buffer(), "%s", typ);
         return 3;
       } else {
         ASSERT(STRING_STARTS_WITH(format, "cond"));
@@ -425,52 +392,55 @@
         ASSERT(STRING_STARTS_WITH(format, "dest26"));
         int64_t off = instr->SImm26Field() << 2;
         uword destination = reinterpret_cast<uword>(instr) + off;
-        buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   "%#" Px "",
-                                   destination);
+        buffer_pos_ +=
+            OS::SNPrint(current_position_in_buffer(),
+                        remaining_size_in_buffer(), "%#" Px "", destination);
       } else {
         if (format[5] == '4') {
           ASSERT(STRING_STARTS_WITH(format, "dest14"));
           int64_t off = instr->SImm14Field() << 2;
           uword destination = reinterpret_cast<uword>(instr) + off;
-          buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                     remaining_size_in_buffer(),
-                                     "%#" Px "",
-                                     destination);
+          buffer_pos_ +=
+              OS::SNPrint(current_position_in_buffer(),
+                          remaining_size_in_buffer(), "%#" Px "", destination);
         } else {
           ASSERT(STRING_STARTS_WITH(format, "dest19"));
           int64_t off = instr->SImm19Field() << 2;
           uword destination = reinterpret_cast<uword>(instr) + off;
-          buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                     remaining_size_in_buffer(),
-                                     "%#" Px "",
-                                     destination);
+          buffer_pos_ +=
+              OS::SNPrint(current_position_in_buffer(),
+                          remaining_size_in_buffer(), "%#" Px "", destination);
         }
       }
       return 6;
     }
     case 'f': {
       ASSERT(STRING_STARTS_WITH(format, "fsz"));
-        const int sz = instr->SzField();
-        char const* sz_str;
-        switch (sz) {
-          case 0:
-            if (instr->Bit(23) == 1) {
-              sz_str = "q";
-            } else {
-              sz_str = "b";
-            }
-            break;
-          case 1: sz_str = "h"; break;
-          case 2: sz_str = "s"; break;
-          case 3: sz_str = "d"; break;
-          default: sz_str = "?"; break;
-        }
-        buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   "%s",
-                                   sz_str);
+      const int sz = instr->SzField();
+      char const* sz_str;
+      switch (sz) {
+        case 0:
+          if (instr->Bit(23) == 1) {
+            sz_str = "q";
+          } else {
+            sz_str = "b";
+          }
+          break;
+        case 1:
+          sz_str = "h";
+          break;
+        case 2:
+          sz_str = "s";
+          break;
+        case 3:
+          sz_str = "d";
+          break;
+        default:
+          sz_str = "?";
+          break;
+      }
+      buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
+                                 remaining_size_in_buffer(), "%s", sz_str);
       return 3;
     }
     case 'h': {
@@ -478,9 +448,7 @@
       const int shift = instr->HWField() << 4;
       if (shift != 0) {
         buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   "lsl %d",
-                                   shift);
+                                   remaining_size_in_buffer(), "lsl %d", shift);
       }
       return 2;
     }
@@ -509,9 +477,7 @@
           idx = imm >> (shift + 3);
         }
         buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   "[%d]",
-                                   idx);
+                                   remaining_size_in_buffer(), "[%d]", idx);
         return 4;
       } else if (format[3] == '1') {
         uint64_t imm;
@@ -533,18 +499,14 @@
           imm = instr->Imm16Field();
         }
         buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   "0x%" Px64,
-                                   imm);
+                                   remaining_size_in_buffer(), "0x%" Px64, imm);
         return ret;
       } else {
         ASSERT(STRING_STARTS_WITH(format, "immd"));
-        double dimm = bit_cast<double, int64_t>(
-            Instr::VFPExpandImm(instr->Imm8Field()));
+        double dimm =
+            bit_cast<double, int64_t>(Instr::VFPExpandImm(instr->Imm8Field()));
         buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   "%f",
-                                   dimm);
+                                   remaining_size_in_buffer(), "%f", dimm);
         return 4;
       }
     }
@@ -562,19 +524,17 @@
           const int64_t off = (immhi << 2) | immlo;
           const int64_t pc = reinterpret_cast<int64_t>(instr);
           const int64_t dest = pc + off;
-          buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                     remaining_size_in_buffer(),
-                                     "0x%" Px64,
-                                     dest);
+          buffer_pos_ +=
+              OS::SNPrint(current_position_in_buffer(),
+                          remaining_size_in_buffer(), "0x%" Px64, dest);
         } else {
           ASSERT(STRING_STARTS_WITH(format, "pcldr"));
           const int64_t off = instr->SImm19Field() << 2;
           const int64_t pc = reinterpret_cast<int64_t>(instr);
           const int64_t dest = pc + off;
-          buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                     remaining_size_in_buffer(),
-                                     "0x%" Px64,
-                                     dest);
+          buffer_pos_ +=
+              OS::SNPrint(current_position_in_buffer(),
+                          remaining_size_in_buffer(), "0x%" Px64, dest);
         }
         return 5;
       } else {
@@ -592,21 +552,31 @@
         char const* sz_str = NULL;
         if (instr->Bits(14, 2) == 3) {
           switch (instr->Bit(22)) {
-            case 0: sz_str = "s"; break;
-            case 1: sz_str = "d"; break;
-            default: UNREACHABLE(); break;
+            case 0:
+              sz_str = "s";
+              break;
+            case 1:
+              sz_str = "d";
+              break;
+            default:
+              UNREACHABLE();
+              break;
           }
         } else {
           switch (instr->Bit(22)) {
-            case 0: sz_str = "w"; break;
-            case 1: sz_str = "x"; break;
-            default: UNREACHABLE(); break;
+            case 0:
+              sz_str = "w";
+              break;
+            case 1:
+              sz_str = "x";
+              break;
+            default:
+              UNREACHABLE();
+              break;
           }
         }
         buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   "%s",
-                                   sz_str);
+                                   remaining_size_in_buffer(), "%s", sz_str);
         return 3;
       } else {
         return FormatVRegister(instr, format);
@@ -632,16 +602,24 @@
         const int sz = instr->SzField();
         char const* sz_str;
         switch (sz) {
-          case 0: sz_str = "b"; break;
-          case 1: sz_str = "h"; break;
-          case 2: sz_str = "w"; break;
-          case 3: sz_str = "x"; break;
-          default: sz_str = "?"; break;
+          case 0:
+            sz_str = "b";
+            break;
+          case 1:
+            sz_str = "h";
+            break;
+          case 2:
+            sz_str = "w";
+            break;
+          case 3:
+            sz_str = "x";
+            break;
+          default:
+            sz_str = "?";
+            break;
         }
         buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   "%s",
-                                   sz_str);
+                                   remaining_size_in_buffer(), "%s", sz_str);
         return 2;
       } else if (format[1] == ' ') {
         if (instr->HasS()) {
@@ -675,7 +653,7 @@
     }
     cur = *format++;
   }
-  buffer_[buffer_pos_]  = '\0';
+  buffer_[buffer_pos_] = '\0';
 }
 
 
@@ -748,9 +726,7 @@
 
 
 void ARM64Decoder::DecodeLoadStoreExclusive(Instr* instr) {
-  if ((instr->Bit(23) != 0) ||
-      (instr->Bit(21) != 0) ||
-      (instr->Bit(15) != 0)) {
+  if ((instr->Bit(23) != 0) || (instr->Bit(21) != 0) || (instr->Bit(15) != 0)) {
     Unknown(instr);
   }
   const int32_t size = instr->Bits(30, 2);
@@ -859,10 +835,9 @@
     if (instr->Imm16Field() == Instr::kStopMessageCode) {
       const char* message = *reinterpret_cast<const char**>(
           reinterpret_cast<intptr_t>(instr) - 2 * Instr::kInstrSize);
-      buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                 remaining_size_in_buffer(),
-                                 " ; \"%s\"",
-                                 message);
+      buffer_pos_ +=
+          OS::SNPrint(current_position_in_buffer(), remaining_size_in_buffer(),
+                      " ; \"%s\"", message);
     }
   } else if ((instr->Bits(0, 2) == 0) && (instr->Bits(2, 3) == 0) &&
              (instr->Bits(21, 3) == 2)) {
@@ -1187,7 +1162,7 @@
     } else {
       Format(instr, "vmovrd 'rd, 'vn'idx5");
     }
-  } else if ((Q == 1)  && (op == 0) && (imm4 == 0)) {
+  } else if ((Q == 1) && (op == 0) && (imm4 == 0)) {
     Format(instr, "vdup'csz 'vd, 'vn'idx5");
   } else if ((Q == 1) && (op == 0) && (imm4 == 3)) {
     Format(instr, "vins'csz 'vd'idx5, 'rn");
@@ -1487,10 +1462,14 @@
 }
 
 
-void Disassembler::DecodeInstruction(char* hex_buffer, intptr_t hex_size,
-                                     char* human_buffer, intptr_t human_size,
-                                     int* out_instr_size, const Code& code,
-                                     Object** object, uword pc) {
+void Disassembler::DecodeInstruction(char* hex_buffer,
+                                     intptr_t hex_size,
+                                     char* human_buffer,
+                                     intptr_t human_size,
+                                     int* out_instr_size,
+                                     const Code& code,
+                                     Object** object,
+                                     uword pc) {
   ARM64Decoder decoder(human_buffer, human_size);
   decoder.InstructionDecode(pc);
   int32_t instruction_bits = Instr::At(pc)->InstructionBits();
diff --git a/runtime/vm/disassembler_dbc.cc b/runtime/vm/disassembler_dbc.cc
index a2095a0..3759bb9 100644
--- a/runtime/vm/disassembler_dbc.cc
+++ b/runtime/vm/disassembler_dbc.cc
@@ -195,9 +195,9 @@
 }
 
 
-#define BYTECODE_FORMATTER(name, encoding, op1, op2, op3)                     \
-  static void Format##name(char* buf, intptr_t size, uword pc, uint32_t op) { \
-    Format##encoding(buf, size, pc, op, Fmt##op1, Fmt##op2, Fmt##op3);        \
+#define BYTECODE_FORMATTER(name, encoding, op1, op2, op3)                      \
+  static void Format##name(char* buf, intptr_t size, uword pc, uint32_t op) {  \
+    Format##encoding(buf, size, pc, op, Fmt##op1, Fmt##op2, Fmt##op3);         \
   }
 BYTECODES_LIST(BYTECODE_FORMATTER)
 #undef BYTECODE_FORMATTER
diff --git a/runtime/vm/disassembler_ia32.cc b/runtime/vm/disassembler_ia32.cc
index d0252d3..004ed60 100644
--- a/runtime/vm/disassembler_ia32.cc
+++ b/runtime/vm/disassembler_ia32.cc
@@ -18,11 +18,7 @@
 #ifndef PRODUCT
 
 // Tables used for decoding of x86 instructions.
-enum OperandOrder {
-  UNSET_OP_ORDER = 0,
-  REG_OPER_OP_ORDER,
-  OPER_REG_OP_ORDER
-};
+enum OperandOrder { UNSET_OP_ORDER = 0, REG_OPER_OP_ORDER, OPER_REG_OP_ORDER };
 
 
 struct ByteMnemonic {
@@ -33,89 +29,60 @@
 
 
 static ByteMnemonic two_operands_instr[] = {
-  {0x01, "add", OPER_REG_OP_ORDER},
-  {0x03, "add", REG_OPER_OP_ORDER},
-  {0x09, "or", OPER_REG_OP_ORDER},
-  {0x0B, "or", REG_OPER_OP_ORDER},
-  {0x11, "adc", OPER_REG_OP_ORDER},
-  {0x13, "adc", REG_OPER_OP_ORDER},
-  {0x19, "sbb", OPER_REG_OP_ORDER},
-  {0x1B, "sbb", REG_OPER_OP_ORDER},
-  {0x21, "and", OPER_REG_OP_ORDER},
-  {0x23, "and", REG_OPER_OP_ORDER},
-  {0x29, "sub", OPER_REG_OP_ORDER},
-  {0x2B, "sub", REG_OPER_OP_ORDER},
-  {0x31, "xor", OPER_REG_OP_ORDER},
-  {0x33, "xor", REG_OPER_OP_ORDER},
-  {0x39, "cmp", OPER_REG_OP_ORDER},
-  {0x3B, "cmp", REG_OPER_OP_ORDER},
-  {0x85, "test", REG_OPER_OP_ORDER},
-  {0x87, "xchg", REG_OPER_OP_ORDER},
-  {0x8A, "mov_b", REG_OPER_OP_ORDER},
-  {0x8B, "mov", REG_OPER_OP_ORDER},
-  {0x8D, "lea", REG_OPER_OP_ORDER},
-  {-1, "", UNSET_OP_ORDER}
-};
+    {0x01, "add", OPER_REG_OP_ORDER},   {0x03, "add", REG_OPER_OP_ORDER},
+    {0x09, "or", OPER_REG_OP_ORDER},    {0x0B, "or", REG_OPER_OP_ORDER},
+    {0x11, "adc", OPER_REG_OP_ORDER},   {0x13, "adc", REG_OPER_OP_ORDER},
+    {0x19, "sbb", OPER_REG_OP_ORDER},   {0x1B, "sbb", REG_OPER_OP_ORDER},
+    {0x21, "and", OPER_REG_OP_ORDER},   {0x23, "and", REG_OPER_OP_ORDER},
+    {0x29, "sub", OPER_REG_OP_ORDER},   {0x2B, "sub", REG_OPER_OP_ORDER},
+    {0x31, "xor", OPER_REG_OP_ORDER},   {0x33, "xor", REG_OPER_OP_ORDER},
+    {0x39, "cmp", OPER_REG_OP_ORDER},   {0x3B, "cmp", REG_OPER_OP_ORDER},
+    {0x85, "test", REG_OPER_OP_ORDER},  {0x87, "xchg", REG_OPER_OP_ORDER},
+    {0x8A, "mov_b", REG_OPER_OP_ORDER}, {0x8B, "mov", REG_OPER_OP_ORDER},
+    {0x8D, "lea", REG_OPER_OP_ORDER},   {-1, "", UNSET_OP_ORDER}};
 
 
 static ByteMnemonic zero_operands_instr[] = {
-  {0xC3, "ret", UNSET_OP_ORDER},
-  {0xC9, "leave", UNSET_OP_ORDER},
-  {0x90, "nop", UNSET_OP_ORDER},
-  {0xF4, "hlt", UNSET_OP_ORDER},
-  {0xCC, "int3", UNSET_OP_ORDER},
-  {0x60, "pushad", UNSET_OP_ORDER},
-  {0x61, "popad", UNSET_OP_ORDER},
-  {0x9C, "pushfd", UNSET_OP_ORDER},
-  {0x9D, "popfd", UNSET_OP_ORDER},
-  {0x9E, "sahf", UNSET_OP_ORDER},
-  {0x99, "cdq", UNSET_OP_ORDER},
-  {0x9B, "fwait", UNSET_OP_ORDER},
-  {-1, "", UNSET_OP_ORDER}
-};
+    {0xC3, "ret", UNSET_OP_ORDER},   {0xC9, "leave", UNSET_OP_ORDER},
+    {0x90, "nop", UNSET_OP_ORDER},   {0xF4, "hlt", UNSET_OP_ORDER},
+    {0xCC, "int3", UNSET_OP_ORDER},  {0x60, "pushad", UNSET_OP_ORDER},
+    {0x61, "popad", UNSET_OP_ORDER}, {0x9C, "pushfd", UNSET_OP_ORDER},
+    {0x9D, "popfd", UNSET_OP_ORDER}, {0x9E, "sahf", UNSET_OP_ORDER},
+    {0x99, "cdq", UNSET_OP_ORDER},   {0x9B, "fwait", UNSET_OP_ORDER},
+    {-1, "", UNSET_OP_ORDER}};
 
 
-static ByteMnemonic call_jump_instr[] = {
-  {0xE8, "call", UNSET_OP_ORDER},
-  {0xE9, "jmp", UNSET_OP_ORDER},
-  {-1, "", UNSET_OP_ORDER}
-};
+static ByteMnemonic call_jump_instr[] = {{0xE8, "call", UNSET_OP_ORDER},
+                                         {0xE9, "jmp", UNSET_OP_ORDER},
+                                         {-1, "", UNSET_OP_ORDER}};
 
 
 static ByteMnemonic short_immediate_instr[] = {
-  {0x05, "add", UNSET_OP_ORDER},
-  {0x0D, "or", UNSET_OP_ORDER},
-  {0x15, "adc", UNSET_OP_ORDER},
-  {0x25, "and", UNSET_OP_ORDER},
-  {0x2D, "sub", UNSET_OP_ORDER},
-  {0x35, "xor", UNSET_OP_ORDER},
-  {0x3D, "cmp", UNSET_OP_ORDER},
-  {-1, "", UNSET_OP_ORDER}
-};
+    {0x05, "add", UNSET_OP_ORDER}, {0x0D, "or", UNSET_OP_ORDER},
+    {0x15, "adc", UNSET_OP_ORDER}, {0x25, "and", UNSET_OP_ORDER},
+    {0x2D, "sub", UNSET_OP_ORDER}, {0x35, "xor", UNSET_OP_ORDER},
+    {0x3D, "cmp", UNSET_OP_ORDER}, {-1, "", UNSET_OP_ORDER}};
 
 
 static const char* jump_conditional_mnem[] = {
-  /*0*/ "jo", "jno", "jc", "jnc",
-  /*4*/ "jz", "jnz", "jna", "ja",
-  /*8*/ "js", "jns", "jpe", "jpo",
-  /*12*/ "jl", "jnl", "jng", "jg"
-};
+    /*0*/ "jo",  "jno", "jc",  "jnc",
+    /*4*/ "jz",  "jnz", "jna", "ja",
+    /*8*/ "js",  "jns", "jpe", "jpo",
+    /*12*/ "jl", "jnl", "jng", "jg"};
 
 
 static const char* set_conditional_mnem[] = {
-  /*0*/ "seto", "setno", "setc", "setnc",
-  /*4*/ "setz", "setnz", "setna", "seta",
-  /*8*/ "sets", "setns", "setpe", "setpo",
-  /*12*/ "setl", "setnl", "setng", "setg"
-};
+    /*0*/ "seto",  "setno", "setc",  "setnc",
+    /*4*/ "setz",  "setnz", "setna", "seta",
+    /*8*/ "sets",  "setns", "setpe", "setpo",
+    /*12*/ "setl", "setnl", "setng", "setg"};
 
 
 static const char* conditional_move_mnem[] = {
-  /*0*/ "cmovo", "cmovno", "cmovc", "cmovnc",
-  /*4*/ "cmovz", "cmovnz", "cmovna", "cmova",
-  /*8*/ "cmovs", "cmovns", "cmovpe", "cmovpo",
-  /*12*/ "cmovl", "cmovnl", "cmovng", "cmovg"
-};
+    /*0*/ "cmovo",  "cmovno", "cmovc",  "cmovnc",
+    /*4*/ "cmovz",  "cmovnz", "cmovna", "cmova",
+    /*8*/ "cmovs",  "cmovns", "cmovpe", "cmovpo",
+    /*12*/ "cmovl", "cmovnl", "cmovng", "cmovg"};
 
 
 enum InstructionType {
@@ -228,43 +195,78 @@
 // Returns NULL if the instruction is not handled here.
 static const char* F0Mnem(uint8_t f0byte) {
   switch (f0byte) {
-    case 0x12: return "movhlps";
-    case 0x14: return "unpcklps";
-    case 0x15: return "unpckhps";
-    case 0x16: return "movlhps";
-    case 0xA2: return "cpuid";
-    case 0x31: return "rdtsc";
-    case 0xBE: return "movsx_b";
-    case 0xBF: return "movsx_w";
-    case 0xB6: return "movzx_b";
-    case 0xB7: return "movzx_w";
-    case 0xAF: return "imul";
+    case 0x12:
+      return "movhlps";
+    case 0x14:
+      return "unpcklps";
+    case 0x15:
+      return "unpckhps";
+    case 0x16:
+      return "movlhps";
+    case 0xA2:
+      return "cpuid";
+    case 0x31:
+      return "rdtsc";
+    case 0xBE:
+      return "movsx_b";
+    case 0xBF:
+      return "movsx_w";
+    case 0xB6:
+      return "movzx_b";
+    case 0xB7:
+      return "movzx_w";
+    case 0xAF:
+      return "imul";
     case 0xA4:  // Fall through.
-    case 0xA5: return "shld";
+    case 0xA5:
+      return "shld";
     case 0xAC:  // Fall through.
-    case 0xAD: return "shrd";
-    case 0xA3: return "bt";
-    case 0xAB: return "bts";
-    case 0xBD: return "bsr";
-    case 0xB1: return "cmpxchg";
-    case 0x50: return "movmskps";
-    case 0x51: return "sqrtps";
-    case 0x52: return "rqstps";
-    case 0x53: return "rcpps";
-    case 0x54: return "andps";
-    case 0x56: return "orps";
-    case 0x57: return "xorps";
-    case 0x58: return "addps";
-    case 0x59: return "mulps";
-    case 0x5A: return "cvtps2pd";
-    case 0x5C: return "subps";
-    case 0x5D: return "minps";
-    case 0x5E: return "divps";
-    case 0x5F: return "maxps";
-    case 0x28: return "movaps";
-    case 0x10: return "movups";
-    case 0x11: return "movups";
-    default: return NULL;
+    case 0xAD:
+      return "shrd";
+    case 0xA3:
+      return "bt";
+    case 0xAB:
+      return "bts";
+    case 0xBD:
+      return "bsr";
+    case 0xB1:
+      return "cmpxchg";
+    case 0x50:
+      return "movmskps";
+    case 0x51:
+      return "sqrtps";
+    case 0x52:
+      return "rqstps";
+    case 0x53:
+      return "rcpps";
+    case 0x54:
+      return "andps";
+    case 0x56:
+      return "orps";
+    case 0x57:
+      return "xorps";
+    case 0x58:
+      return "addps";
+    case 0x59:
+      return "mulps";
+    case 0x5A:
+      return "cvtps2pd";
+    case 0x5C:
+      return "subps";
+    case 0x5D:
+      return "minps";
+    case 0x5E:
+      return "divps";
+    case 0x5F:
+      return "maxps";
+    case 0x28:
+      return "movaps";
+    case 0x10:
+      return "movups";
+    case 0x11:
+      return "movups";
+    default:
+      return NULL;
   }
 }
 
@@ -287,12 +289,11 @@
 
 
 static bool IsTwoXmmRegInstruction(uint8_t f0byte) {
-  return f0byte == 0x28 || f0byte == 0x11 || f0byte == 0x12 ||
-         f0byte == 0x14 || f0byte == 0x15 || f0byte == 0x16 ||
-         f0byte == 0x51 || f0byte == 0x52 || f0byte == 0x53 ||
-         f0byte == 0x54 || f0byte == 0x56 || f0byte == 0x58 ||
-         f0byte == 0x59 || f0byte == 0x5C || f0byte == 0x5D ||
-         f0byte == 0x5E || f0byte == 0x5F || f0byte == 0x5A;
+  return f0byte == 0x28 || f0byte == 0x11 || f0byte == 0x12 || f0byte == 0x14 ||
+         f0byte == 0x15 || f0byte == 0x16 || f0byte == 0x51 || f0byte == 0x52 ||
+         f0byte == 0x53 || f0byte == 0x54 || f0byte == 0x56 || f0byte == 0x58 ||
+         f0byte == 0x59 || f0byte == 0x5C || f0byte == 0x5D || f0byte == 0x5E ||
+         f0byte == 0x5F || f0byte == 0x5A;
 }
 
 
@@ -300,9 +301,7 @@
 class X86Decoder : public ValueObject {
  public:
   X86Decoder(char* buffer, intptr_t buffer_size)
-      : buffer_(buffer),
-        buffer_size_(buffer_size),
-        buffer_pos_(0) {
+      : buffer_(buffer), buffer_size_(buffer_size), buffer_pos_(0) {
     buffer_[buffer_pos_] = '\0';
   }
 
@@ -386,9 +385,9 @@
   char* current_position_in_buffer() { return buffer_ + buffer_pos_; }
   intptr_t remaining_size_in_buffer() { return buffer_size_ - buffer_pos_; }
 
-  char* buffer_;  // Decode instructions into this buffer.
+  char* buffer_;          // Decode instructions into this buffer.
   intptr_t buffer_size_;  // The size of the buffer_.
-  intptr_t buffer_pos_;  // Current character position in the buffer_.
+  intptr_t buffer_pos_;   // Current character position in the buffer_.
 
   DISALLOW_COPY_AND_ASSIGN(X86Decoder);
 };
@@ -421,19 +420,16 @@
 
 
 static const int kMaxCPURegisters = 8;
-static const char* cpu_regs[kMaxCPURegisters] = {
-  "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi"
-};
+static const char* cpu_regs[kMaxCPURegisters] = {"eax", "ecx", "edx", "ebx",
+                                                 "esp", "ebp", "esi", "edi"};
 
 static const int kMaxByteCPURegisters = 8;
 static const char* byte_cpu_regs[kMaxByteCPURegisters] = {
-  "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh"
-};
+    "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh"};
 
 static const int kMaxXmmRegisters = 8;
 static const char* xmm_regs[kMaxXmmRegisters] = {
-  "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7"
-};
+    "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7"};
 
 void X86Decoder::PrintCPURegister(int reg) {
   ASSERT(0 <= reg);
@@ -459,8 +455,7 @@
   ASSERT(0 <= comparison);
   ASSERT(comparison < 8);
   static const char* comparisons[8] = {
-    "eq", "lt", "le", "unordered", "not eq", "not lt", "not le", "ordered"
-  };
+      "eq", "lt", "le", "unordered", "not eq", "not lt", "not le", "ordered"};
   Print(comparisons[comparison]);
 }
 
@@ -487,7 +482,7 @@
   switch (mod) {
     case 0:
       if (rm == ebp) {
-        int32_t disp = *reinterpret_cast<int32_t*>(modrmp+1);
+        int32_t disp = *reinterpret_cast<int32_t*>(modrmp + 1);
         Print("[");
         PrintHex(disp);
         Print("]");
@@ -514,7 +509,7 @@
             Print("+");
           }
           PrintHex(disp);
-           Print("]");
+          Print("]");
           return 6;
         } else if (index != esp && base != ebp) {
           // [base+index*scale]
@@ -543,9 +538,8 @@
         uint8_t sib = *(modrmp + 1);
         int scale, index, base;
         GetSib(sib, &scale, &index, &base);
-        int disp = (mod == 2) ?
-                   *reinterpret_cast<int32_t*>(modrmp + 2) :
-                   *reinterpret_cast<int8_t*>(modrmp + 2);
+        int disp = (mod == 2) ? *reinterpret_cast<int32_t*>(modrmp + 2)
+                              : *reinterpret_cast<int8_t*>(modrmp + 2);
         if (index == base && index == rm /*esp*/ && scale == 0 /*times_1*/) {
           Print("[");
           PrintCPURegister(rm);
@@ -576,9 +570,8 @@
         return mod == 2 ? 6 : 3;
       } else {
         // No sib.
-        int disp = (mod == 2) ?
-                   *reinterpret_cast<int32_t*>(modrmp + 1) :
-                   *reinterpret_cast<int8_t*>(modrmp + 1);
+        int disp = (mod == 2) ? *reinterpret_cast<int32_t*>(modrmp + 1)
+                              : *reinterpret_cast<int8_t*>(modrmp + 1);
         Print("[");
         PrintCPURegister(rm);
         if (disp < 0) {
@@ -652,24 +645,41 @@
 
 int X86Decoder::PrintImmediateOp(uint8_t* data, bool size_override) {
   bool sign_extension_bit = (*data & 0x02) != 0;
-  uint8_t modrm = *(data+1);
+  uint8_t modrm = *(data + 1);
   int mod, regop, rm;
   GetModRm(modrm, &mod, &regop, &rm);
   const char* mnem = "Imm???";
   switch (regop) {
-    case 0: mnem = "add"; break;
-    case 1: mnem = "or"; break;
-    case 2: mnem = "adc"; break;
-    case 3: mnem = "sbb"; break;
-    case 4: mnem = "and"; break;
-    case 5: mnem = "sub"; break;
-    case 6: mnem = "xor"; break;
-    case 7: mnem = "cmp"; break;
-    default: UNIMPLEMENTED();
+    case 0:
+      mnem = "add";
+      break;
+    case 1:
+      mnem = "or";
+      break;
+    case 2:
+      mnem = "adc";
+      break;
+    case 3:
+      mnem = "sbb";
+      break;
+    case 4:
+      mnem = "and";
+      break;
+    case 5:
+      mnem = "sub";
+      break;
+    case 6:
+      mnem = "xor";
+      break;
+    case 7:
+      mnem = "cmp";
+      break;
+    default:
+      UNIMPLEMENTED();
   }
   Print(mnem);
   Print(" ");
-  int count = PrintRightOperand(data+1);
+  int count = PrintRightOperand(data + 1);
   Print(",");
   if (size_override) {
     PrintHex(*reinterpret_cast<int16_t*>(data + 1 + count));
@@ -698,7 +708,7 @@
 // Returns number of bytes used, including *data.
 int X86Decoder::JumpShort(uint8_t* data) {
   ASSERT(*data == 0xEB);
-  uint8_t b = *(data+1);
+  uint8_t b = *(data + 1);
   uword dest = reinterpret_cast<uword>(data) + static_cast<int8_t>(b) + 2;
   Print("jmp ");
   PrintAddress(dest);
@@ -709,9 +719,9 @@
 // Returns number of bytes used, including *data.
 int X86Decoder::JumpConditional(uint8_t* data, const char* comment) {
   ASSERT(*data == 0x0F);
-  uint8_t cond = *(data+1) & 0x0F;
-  uword dest = reinterpret_cast<uword>(data) +
-               *reinterpret_cast<int32_t*>(data+2) + 6;
+  uint8_t cond = *(data + 1) & 0x0F;
+  uword dest =
+      reinterpret_cast<uword>(data) + *reinterpret_cast<int32_t*>(data + 2) + 6;
   const char* mnem = jump_conditional_mnem[cond];
   Print(mnem);
   Print(" ");
@@ -727,7 +737,7 @@
 // Returns number of bytes used, including *data.
 int X86Decoder::JumpConditionalShort(uint8_t* data, const char* comment) {
   uint8_t cond = *data & 0x0F;
-  uint8_t b = *(data+1);
+  uint8_t b = *(data + 1);
   uword dest = reinterpret_cast<uword>(data) + static_cast<int8_t>(b) + 2;
   const char* mnem = jump_conditional_mnem[cond];
   Print(mnem);
@@ -744,11 +754,11 @@
 // Returns number of bytes used, including *data.
 int X86Decoder::SetCC(uint8_t* data) {
   ASSERT(*data == 0x0F);
-  uint8_t cond = *(data+1) & 0x0F;
+  uint8_t cond = *(data + 1) & 0x0F;
   const char* mnem = set_conditional_mnem[cond];
   Print(mnem);
   Print(" ");
-  PrintRightByteOperand(data+2);
+  PrintRightByteOperand(data + 2);
   return 3;  // includes 0x0F
 }
 
@@ -767,31 +777,40 @@
   uint8_t op = *data;
   ASSERT(op == 0xD1 || op == 0xD3 || op == 0xC1);
   int mod, regop, rm;
-  GetModRm(*(data+1), &mod, &regop, &rm);
+  GetModRm(*(data + 1), &mod, &regop, &rm);
   int num_bytes = 1;
   const char* mnem = NULL;
   switch (regop) {
-    case 2: mnem = "rcl"; break;
-    case 4: mnem = "shl"; break;
-    case 5: mnem = "shr"; break;
-    case 7: mnem = "sar"; break;
-    default: UNIMPLEMENTED();
+    case 2:
+      mnem = "rcl";
+      break;
+    case 4:
+      mnem = "shl";
+      break;
+    case 5:
+      mnem = "shr";
+      break;
+    case 7:
+      mnem = "sar";
+      break;
+    default:
+      UNIMPLEMENTED();
   }
   ASSERT(mnem != NULL);
   Print(mnem);
   Print(" ");
 
   if (op == 0xD1) {
-    num_bytes += PrintRightOperand(data+1);
+    num_bytes += PrintRightOperand(data + 1);
     Print(", 1");
   } else if (op == 0xC1) {
-    num_bytes += PrintRightOperand(data+1);
+    num_bytes += PrintRightOperand(data + 1);
     Print(", ");
-    PrintInt(*(data+2));
+    PrintInt(*(data + 2));
     num_bytes++;
   } else {
     ASSERT(op == 0xD3);
-    num_bytes += PrintRightOperand(data+1);
+    num_bytes += PrintRightOperand(data + 1);
     Print(", cl");
   }
   return num_bytes;
@@ -799,8 +818,8 @@
 
 
 uint8_t* X86Decoder::F3Instruction(uint8_t* data) {
-  if (*(data+1) == 0x0F) {
-    uint8_t b2 = *(data+2);
+  if (*(data + 1) == 0x0F) {
+    uint8_t b2 = *(data + 2);
     switch (b2) {
       case 0x2C: {
         data += 3;
@@ -861,14 +880,29 @@
         GetModRm(*data, &mod, &regop, &rm);
         const char* mnem = "?? 0xF3";
         switch (b2) {
-          case 0x51: mnem = "sqrtss"; break;
-          case 0x58: mnem = "addss"; break;
-          case 0x59: mnem = "mulss"; break;
-          case 0x5A: mnem = "cvtss2sd"; break;
-          case 0x5C: mnem = "subss"; break;
-          case 0x5E: mnem = "divss"; break;
-          case 0xE6: mnem = "cvtdq2pd"; break;
-          default: UNIMPLEMENTED();
+          case 0x51:
+            mnem = "sqrtss";
+            break;
+          case 0x58:
+            mnem = "addss";
+            break;
+          case 0x59:
+            mnem = "mulss";
+            break;
+          case 0x5A:
+            mnem = "cvtss2sd";
+            break;
+          case 0x5C:
+            mnem = "subss";
+            break;
+          case 0x5E:
+            mnem = "divss";
+            break;
+          case 0xE6:
+            mnem = "cvtdq2pd";
+            break;
+          default:
+            UNIMPLEMENTED();
         }
         Print(mnem);
         Print(" ");
@@ -890,7 +924,7 @@
       default:
         UNIMPLEMENTED();
     }
-  } else if (*(data+1) == 0xA4) {
+  } else if (*(data + 1) == 0xA4) {
     Print("rep_movsb");
     data += 2;
   } else {
@@ -903,26 +937,39 @@
 // Returns number of bytes used, including *data.
 int X86Decoder::F7Instruction(uint8_t* data) {
   ASSERT(*data == 0xF7);
-  uint8_t modrm = *(data+1);
+  uint8_t modrm = *(data + 1);
   int mod, regop, rm;
   GetModRm(modrm, &mod, &regop, &rm);
   if (mod == 3 && regop != 0) {
     const char* mnem = NULL;
     switch (regop) {
-      case 2: mnem = "not"; break;
-      case 3: mnem = "neg"; break;
-      case 4: mnem = "mul"; break;
-      case 5: mnem = "imul"; break;
-      case 6: mnem = "div"; break;
-      case 7: mnem = "idiv"; break;
-      default: UNIMPLEMENTED();
+      case 2:
+        mnem = "not";
+        break;
+      case 3:
+        mnem = "neg";
+        break;
+      case 4:
+        mnem = "mul";
+        break;
+      case 5:
+        mnem = "imul";
+        break;
+      case 6:
+        mnem = "div";
+        break;
+      case 7:
+        mnem = "idiv";
+        break;
+      default:
+        UNIMPLEMENTED();
     }
     Print(mnem);
     Print(" ");
     PrintCPURegister(rm);
     return 2;
   } else if (mod == 3 && regop == eax) {
-    int32_t imm = *reinterpret_cast<int32_t*>(data+2);
+    int32_t imm = *reinterpret_cast<int32_t*>(data + 2);
     Print("test ");
     PrintCPURegister(rm);
     Print(",");
@@ -930,11 +977,11 @@
     return 6;
   } else if (regop == eax) {
     Print("test ");
-    int count = PrintRightOperand(data+1);
-    int32_t imm = *reinterpret_cast<int32_t*>(data+1+count);
+    int count = PrintRightOperand(data + 1);
+    int32_t imm = *reinterpret_cast<int32_t*>(data + 1 + count);
     Print(",");
     PrintHex(imm);
-    return 1+count+4 /*int32_t*/;
+    return 1 + count + 4 /*int32_t*/;
   } else if (regop == 5) {
     Print("imul ");
     int count = PrintRightOperand(data + 1);
@@ -957,18 +1004,42 @@
   if (b1 == 0xD9) {
     const char* mnem = NULL;
     switch (b2) {
-      case 0xE0: mnem = "fchs"; break;
-      case 0xE1: mnem = "fabs"; break;
-      case 0xE4: mnem = "ftst"; break;
-      case 0xE8: mnem = "fld1"; break;
-      case 0xEE: mnem = "fldz"; break;
-      case 0xF2: mnem = "fptan"; break;
-      case 0xF5: mnem = "fprem1"; break;
-      case 0xF8: mnem = "fprem"; break;
-      case 0xF7: mnem = "fincstp"; break;
-      case 0xFB: mnem = "fsincos"; break;
-      case 0xFE: mnem = "fsin"; break;
-      case 0xFF: mnem = "fcos"; break;
+      case 0xE0:
+        mnem = "fchs";
+        break;
+      case 0xE1:
+        mnem = "fabs";
+        break;
+      case 0xE4:
+        mnem = "ftst";
+        break;
+      case 0xE8:
+        mnem = "fld1";
+        break;
+      case 0xEE:
+        mnem = "fldz";
+        break;
+      case 0xF2:
+        mnem = "fptan";
+        break;
+      case 0xF5:
+        mnem = "fprem1";
+        break;
+      case 0xF8:
+        mnem = "fprem";
+        break;
+      case 0xF7:
+        mnem = "fincstp";
+        break;
+      case 0xFB:
+        mnem = "fsincos";
+        break;
+      case 0xFE:
+        mnem = "fsin";
+        break;
+      case 0xFF:
+        mnem = "fcos";
+        break;
     }
     if (mnem != NULL) {
       Print(mnem);
@@ -979,14 +1050,23 @@
       return 2;
     } else {
       int mod, regop, rm;
-      GetModRm(*(data+1), &mod, &regop, &rm);
+      GetModRm(*(data + 1), &mod, &regop, &rm);
       const char* mnem = "? FPU 0xD9";
       switch (regop) {
-        case 0: mnem = "fld_s"; break;
-        case 3: mnem = "fstp_s"; break;
-        case 5: mnem = "fldcw"; break;
-        case 7: mnem = "fnstcw"; break;
-        default: UNIMPLEMENTED();
+        case 0:
+          mnem = "fld_s";
+          break;
+        case 3:
+          mnem = "fstp_s";
+          break;
+        case 5:
+          mnem = "fldcw";
+          break;
+        case 7:
+          mnem = "fnstcw";
+          break;
+        default:
+          UNIMPLEMENTED();
       }
       Print(mnem);
       Print(" ");
@@ -1000,12 +1080,17 @@
       return 2;
     } else {
       int mod, regop, rm;
-      GetModRm(*(data+1), &mod, &regop, &rm);
+      GetModRm(*(data + 1), &mod, &regop, &rm);
       const char* mnem = "? FPU 0xDD";
       switch (regop) {
-        case 0: mnem = "fld_d"; break;
-        case 3: mnem = "fstp_d"; break;
-       default: UNIMPLEMENTED();
+        case 0:
+          mnem = "fld_d";
+          break;
+        case 3:
+          mnem = "fstp_d";
+          break;
+        default:
+          UNIMPLEMENTED();
       }
       Print(mnem);
       Print(" ");
@@ -1014,13 +1099,20 @@
     }
   } else if (b1 == 0xDB) {
     int mod, regop, rm;
-    GetModRm(*(data+1), &mod, &regop, &rm);
+    GetModRm(*(data + 1), &mod, &regop, &rm);
     const char* mnem = "? FPU 0xDB";
     switch (regop) {
-      case 0: mnem = "fild_s"; break;
-      case 2: mnem = "fist_s"; break;
-      case 3: mnem = "fistp_s"; break;
-      default: UNIMPLEMENTED();
+      case 0:
+        mnem = "fild_s";
+        break;
+      case 2:
+        mnem = "fist_s";
+        break;
+      case 3:
+        mnem = "fistp_s";
+        break;
+      default:
+        UNIMPLEMENTED();
     }
     Print(mnem);
     Print(" ");
@@ -1032,12 +1124,17 @@
       return 2;
     }
     int mod, regop, rm;
-    GetModRm(*(data+1), &mod, &regop, &rm);
+    GetModRm(*(data + 1), &mod, &regop, &rm);
     const char* mnem = "? FPU 0xDF";
     switch (regop) {
-      case 5: mnem = "fild_d"; break;
-      case 7: mnem = "fistp_d"; break;
-      default: UNIMPLEMENTED();
+      case 5:
+        mnem = "fild_d";
+        break;
+      case 7:
+        mnem = "fistp_d";
+        break;
+      default:
+        UNIMPLEMENTED();
     }
     Print(mnem);
     Print(" ");
@@ -1051,11 +1148,20 @@
     }
     const char* mnem = "FP0xDC";
     switch (b2 & 0xF8) {
-      case 0xC0: mnem = "fadd"; break;
-      case 0xE8: mnem = "fsub"; break;
-      case 0xC8: mnem = "fmul"; break;
-      case 0xF8: mnem = "fdiv"; break;
-      default: UNIMPLEMENTED();
+      case 0xC0:
+        mnem = "fadd";
+        break;
+      case 0xE8:
+        mnem = "fsub";
+        break;
+      case 0xC8:
+        mnem = "fmul";
+        break;
+      case 0xF8:
+        mnem = "fdiv";
+        break;
+      default:
+        UNIMPLEMENTED();
     }
     Print(mnem);
     Print(is_pop ? "p" : "");
@@ -1072,7 +1178,8 @@
 }
 
 
-uint8_t* X86Decoder::SSEInstruction(uint8_t prefix, uint8_t primary,
+uint8_t* X86Decoder::SSEInstruction(uint8_t prefix,
+                                    uint8_t primary,
                                     uint8_t* data) {
   ASSERT(prefix == 0x0F);
   int mod, regop, rm;
@@ -1104,36 +1211,33 @@
 
 
 int X86Decoder::BitwisePDInstruction(uint8_t* data) {
-  const char* mnem = (*data == 0x57)
-      ? "xorpd"
-      : (*data == 0x56)
-        ? "orpd"
-        : "andpd";
+  const char* mnem =
+      (*data == 0x57) ? "xorpd" : (*data == 0x56) ? "orpd" : "andpd";
   int mod, regop, rm;
-  GetModRm(*(data+1), &mod, &regop, &rm);
+  GetModRm(*(data + 1), &mod, &regop, &rm);
   Print(mnem);
   Print(" ");
   PrintXmmRegister(regop);
   Print(",");
-  return 1 + PrintRightXmmOperand(data+1);
+  return 1 + PrintRightXmmOperand(data + 1);
 }
 
 
 int X86Decoder::Packed660F38Instruction(uint8_t* data) {
-  if (*(data+1) == 0x25) {
+  if (*(data + 1) == 0x25) {
     Print("pmovsxdq ");
     int mod, regop, rm;
-    GetModRm(*(data+2), &mod, &regop, &rm);
+    GetModRm(*(data + 2), &mod, &regop, &rm);
     PrintXmmRegister(regop);
     Print(",");
-    return 2 + PrintRightXmmOperand(data+2);
-  } else if (*(data+1) == 0x29) {
+    return 2 + PrintRightXmmOperand(data + 2);
+  } else if (*(data + 1) == 0x29) {
     Print("pcmpeqq ");
     int mod, regop, rm;
-    GetModRm(*(data+2), &mod, &regop, &rm);
+    GetModRm(*(data + 2), &mod, &regop, &rm);
     PrintXmmRegister(regop);
     Print(",");
-    return 2 + PrintRightXmmOperand(data+2);
+    return 2 + PrintRightXmmOperand(data + 2);
   }
   UNREACHABLE();
   return 1;
@@ -1196,10 +1300,9 @@
       return true;
 
     case MOVE_REG_INSTR: {
-      uword addr = *reinterpret_cast<uword*>(*data+1);
+      uword addr = *reinterpret_cast<uword*>(*data + 1);
       Print("mov ");
-      PrintCPURegister(**data & 0x07),
-      Print(",");
+      PrintCPURegister(**data & 0x07), Print(",");
       PrintAddress(addr);
       (*data) += 5;
       return true;
@@ -1207,7 +1310,7 @@
 
     case CALL_JUMP_INSTR: {
       uword addr = reinterpret_cast<uword>(*data) +
-                   *reinterpret_cast<uword*>(*data+1) + 5;
+                   *reinterpret_cast<uword*>(*data + 1) + 5;
       Print(idesc.mnem);
       Print(" ");
       PrintAddress(addr);
@@ -1216,7 +1319,7 @@
     }
 
     case SHORT_IMMEDIATE_INSTR: {
-      uword addr = *reinterpret_cast<uword*>(*data+1);
+      uword addr = *reinterpret_cast<uword*>(*data + 1);
       Print(idesc.mnem);
       Print(" eax, ");
       PrintAddress(addr);
@@ -1247,16 +1350,16 @@
     switch (*data) {
       case 0xC2:
         Print("ret ");
-        PrintHex(*reinterpret_cast<uint16_t*>(data+1));
+        PrintHex(*reinterpret_cast<uint16_t*>(data + 1));
         data += 3;
         break;
 
       case 0x69:  // fall through
-      case 0x6B:
-      { int mod, regop, rm;
-        GetModRm(*(data+1), &mod, &regop, &rm);
+      case 0x6B: {
+        int mod, regop, rm;
+        GetModRm(*(data + 1), &mod, &regop, &rm);
         int32_t imm =
-        *data == 0x6B ? *(data+2) : *reinterpret_cast<int32_t*>(data+2);
+            *data == 0x6B ? *(data + 2) : *reinterpret_cast<int32_t*>(data + 2);
         Print("imul ");
         PrintCPURegister(regop);
         Print(",");
@@ -1264,17 +1367,16 @@
         Print(",");
         PrintHex(imm);
         data += 2 + (*data == 0x6B ? 1 : 4);
-      }
-        break;
+      } break;
 
-      case 0xF6:
-      { int mod, regop, rm;
-        GetModRm(*(data+1), &mod, &regop, &rm);
+      case 0xF6: {
+        int mod, regop, rm;
+        GetModRm(*(data + 1), &mod, &regop, &rm);
         if ((mod == 3) && (regop == eax)) {
           Print("test_b ");
           PrintCPURegister(rm);
           Print(",");
-          PrintHex(*(data+2));
+          PrintHex(*(data + 2));
           data += 3;
         } else {
           data++;
@@ -1285,16 +1387,15 @@
           PrintHex(imm);
           data++;
         }
-      }
-        break;
+      } break;
 
       case 0x81:  // fall through
       case 0x83:  // 0x81 with sign extension bit set
         data += PrintImmediateOp(data);
         break;
 
-      case 0x0F:
-      { uint8_t f0byte = *(data+1);
+      case 0x0F: {
+        uint8_t f0byte = *(data + 1);
         const char* f0mnem = F0Mnem(f0byte);
         if (f0byte == 0xA2 || f0byte == 0x31) {
           Print(f0mnem);
@@ -1331,30 +1432,24 @@
           PrintXmmRegister(rm);
           data++;
         } else if (f0byte == 0x1F) {
-          if (*(data+2) == 0x00) {
+          if (*(data + 2) == 0x00) {
             Print("nop");
             data += 3;
-          } else if (*(data+2) == 0x40 && *(data+3) == 0x00) {
+          } else if (*(data + 2) == 0x40 && *(data + 3) == 0x00) {
             Print("nop");
             data += 4;
-          } else if (*(data+2) == 0x44 &&
-                     *(data+3) == 0x00 &&
-                     *(data+4) == 0x00) {
+          } else if (*(data + 2) == 0x44 && *(data + 3) == 0x00 &&
+                     *(data + 4) == 0x00) {
             Print("nop");
             data += 5;
-          } else if (*(data+2) == 0x80 &&
-                     *(data+3) == 0x00 &&
-                     *(data+4) == 0x00 &&
-                     *(data+5) == 0x00 &&
-                     *(data+6) == 0x00) {
+          } else if (*(data + 2) == 0x80 && *(data + 3) == 0x00 &&
+                     *(data + 4) == 0x00 && *(data + 5) == 0x00 &&
+                     *(data + 6) == 0x00) {
             Print("nop");
             data += 7;
-          } else if (*(data+2) == 0x84 &&
-                     *(data+3) == 0x00 &&
-                     *(data+4) == 0x00 &&
-                     *(data+5) == 0x00 &&
-                     *(data+6) == 0x00 &&
-                     *(data+7) == 0x00) {
+          } else if (*(data + 2) == 0x84 && *(data + 3) == 0x00 &&
+                     *(data + 4) == 0x00 && *(data + 5) == 0x00 &&
+                     *(data + 6) == 0x00 && *(data + 7) == 0x00) {
             Print("nop");
             data += 8;
           } else {
@@ -1410,42 +1505,51 @@
             UNIMPLEMENTED();
           }
         }
-      }
-        break;
+      } break;
 
-      case 0x8F:
-      { data++;
+      case 0x8F: {
+        data++;
         int mod, regop, rm;
         GetModRm(*data, &mod, &regop, &rm);
         if (regop == eax) {
           Print("pop ");
           data += PrintRightOperand(data);
         }
-      }
-        break;
+      } break;
 
-      case 0xFF:
-      { data++;
+      case 0xFF: {
+        data++;
         int mod, regop, rm;
         GetModRm(*data, &mod, &regop, &rm);
         const char* mnem = NULL;
         switch (regop) {
-          case esi: mnem = "push"; break;
-          case eax: mnem = "inc"; break;
-          case ecx: mnem = "dec"; break;
-          case edx: mnem = "call"; break;
-          case esp: mnem = "jmp"; break;
-          default: mnem = "??? 0xFF";
+          case esi:
+            mnem = "push";
+            break;
+          case eax:
+            mnem = "inc";
+            break;
+          case ecx:
+            mnem = "dec";
+            break;
+          case edx:
+            mnem = "call";
+            break;
+          case esp:
+            mnem = "jmp";
+            break;
+          default:
+            mnem = "??? 0xFF";
         }
         Print(mnem);
         Print(" ");
         data += PrintRightOperand(data);
-      }
-        break;
+      } break;
 
       case 0xC7:  // imm32, fall through
       case 0xC6:  // imm8
-      { bool is_byte = *data == 0xC6;
+      {
+        bool is_byte = *data == 0xC6;
         data++;
         Print(is_byte ? "mov_b" : "mov");
         Print(" ");
@@ -1454,23 +1558,22 @@
         Print(",");
         PrintHex(imm);
         data += is_byte ? 1 : 4;
-      }
-        break;
+      } break;
 
-      case 0x80:
-      { data++;
+      case 0x80: {
+        data++;
         Print("cmpb ");
         data += PrintRightOperand(data);
         int32_t imm = *data;
         Print(",");
         PrintHex(imm);
         data++;
-      }
-        break;
+      } break;
 
       case 0x88:  // 8bit, fall through
       case 0x89:  // 32bit
-      { bool is_byte = *data == 0x88;
+      {
+        bool is_byte = *data == 0x88;
         int mod, regop, rm;
         data++;
         GetModRm(*data, &mod, &regop, &rm);
@@ -1479,8 +1582,7 @@
         data += PrintRightOperand(data);
         Print(",");
         PrintCPURegister(regop);
-      }
-        break;
+      } break;
 
       case 0x66:  // prefix
         data++;
@@ -1525,10 +1627,8 @@
             PrintXmmRegister(regop);
           } else if (*data == 0x57 || *data == 0x56 || *data == 0x54) {
             data += BitwisePDInstruction(data);
-          } else if (*data == 0x1F &&
-                     *(data+1) == 0x44 &&
-                     *(data+2) == 0x00 &&
-                     *(data+3) == 0x00) {
+          } else if (*data == 0x1F && *(data + 1) == 0x44 &&
+                     *(data + 2) == 0x00 && *(data + 3) == 0x00) {
             data += 4;
             Print("nop");
           } else if (*data == 0x50) {
@@ -1539,7 +1639,7 @@
             PrintCPURegister(regop);
             Print(",");
             data += PrintRightXmmOperand(data);
-          } else if (*data == 0x3A && *(data+1) == 0x16) {
+          } else if (*data == 0x3A && *(data + 1) == 0x16) {
             Print("pextrd ");
             data += 2;
             int mod, regop, rm;
@@ -1548,13 +1648,13 @@
             Print(",");
             PrintXmmRegister(regop);
             Print(",");
-            PrintHex(*(data+1));
+            PrintHex(*(data + 1));
             data += 2;
           } else if (*data == 0x38) {
             data += Packed660F38Instruction(data);
           } else if (*data == 0xEF) {
             int mod, regop, rm;
-            GetModRm(*(data+1), &mod, &regop, &rm);
+            GetModRm(*(data + 1), &mod, &regop, &rm);
             Print("pxor ");
             PrintXmmRegister(regop);
             Print(",");
@@ -1578,7 +1678,7 @@
             }
           } else if (*data == 0x14) {
             int mod, regop, rm;
-            GetModRm(*(data+1), &mod, &regop, &rm);
+            GetModRm(*(data + 1), &mod, &regop, &rm);
             Print("unpcklpd ");
             PrintXmmRegister(regop);
             Print(",");
@@ -1586,7 +1686,7 @@
             data += 2;
           } else if (*data == 0x15) {
             int mod, regop, rm;
-            GetModRm(*(data+1), &mod, &regop, &rm);
+            GetModRm(*(data + 1), &mod, &regop, &rm);
             Print("unpckhpd ");
             PrintXmmRegister(regop);
             Print(",");
@@ -1598,7 +1698,7 @@
                      (*data == 0x51) || (*data == 0x5A)) {
             const char* mnemonic = PackedDoubleMnemonic(*data);
             int mod, regop, rm;
-            GetModRm(*(data+1), &mod, &regop, &rm);
+            GetModRm(*(data + 1), &mod, &regop, &rm);
             Print(mnemonic);
             PrintXmmRegister(regop);
             Print(",");
@@ -1646,8 +1746,8 @@
         }
         break;
 
-      case 0xFE:
-      { data++;
+      case 0xFE: {
+        data++;
         int mod, regop, rm;
         GetModRm(*data, &mod, &regop, &rm);
         if (mod == 3 && regop == ecx) {
@@ -1657,12 +1757,11 @@
           UNIMPLEMENTED();
         }
         data++;
-      }
-        break;
+      } break;
 
       case 0x68:
         Print("push ");
-        PrintHex(*reinterpret_cast<int32_t*>(data+1));
+        PrintHex(*reinterpret_cast<int32_t*>(data + 1));
         data += 5;
         break;
 
@@ -1674,13 +1773,13 @@
 
       case 0xA8:
         Print("test al,");
-        PrintHex(*reinterpret_cast<uint8_t*>(data+1));
+        PrintHex(*reinterpret_cast<uint8_t*>(data + 1));
         data += 2;
         break;
 
       case 0xA9:
         Print("test eax,");
-        PrintHex(*reinterpret_cast<int32_t*>(data+1));
+        PrintHex(*reinterpret_cast<int32_t*>(data + 1));
         CheckPrintStop(data);
         data += 5;
         break;
@@ -1709,8 +1808,8 @@
         data = F3Instruction(data);
         break;
       case 0xF2: {
-        if (*(data+1) == 0x0F) {
-          uint8_t b2 = *(data+2);
+        if (*(data + 1) == 0x0F) {
+          uint8_t b2 = *(data + 2);
           if (b2 == 0x11) {
             Print("movsd ");
             data += 3;
@@ -1730,16 +1829,35 @@
           } else {
             const char* mnem = "? 0xF2";
             switch (b2) {
-              case 0x2A: mnem = "cvtsi2sd"; break;
-              case 0x2C: mnem = "cvttsd2si"; break;
-              case 0x2D: mnem = "cvtsd2i"; break;
-              case 0x51: mnem = "sqrtsd"; break;
-              case 0x58: mnem = "addsd"; break;
-              case 0x59: mnem = "mulsd"; break;
-              case 0x5A: mnem = "cvtsd2ss"; break;
-              case 0x5C: mnem = "subsd"; break;
-              case 0x5E: mnem = "divsd"; break;
-              default: UNIMPLEMENTED();
+              case 0x2A:
+                mnem = "cvtsi2sd";
+                break;
+              case 0x2C:
+                mnem = "cvttsd2si";
+                break;
+              case 0x2D:
+                mnem = "cvtsd2i";
+                break;
+              case 0x51:
+                mnem = "sqrtsd";
+                break;
+              case 0x58:
+                mnem = "addsd";
+                break;
+              case 0x59:
+                mnem = "mulsd";
+                break;
+              case 0x5A:
+                mnem = "cvtsd2ss";
+                break;
+              case 0x5C:
+                mnem = "subsd";
+                break;
+              case 0x5E:
+                mnem = "divsd";
+                break;
+              default:
+                UNIMPLEMENTED();
             }
             data += 3;
             int mod, regop, rm;
@@ -1791,10 +1909,14 @@
 }  // NOLINT
 
 
-void Disassembler::DecodeInstruction(char* hex_buffer, intptr_t hex_size,
-                                     char* human_buffer, intptr_t human_size,
-                                     int* out_instr_len, const Code& code,
-                                     Object** object, uword pc) {
+void Disassembler::DecodeInstruction(char* hex_buffer,
+                                     intptr_t hex_size,
+                                     char* human_buffer,
+                                     intptr_t human_size,
+                                     int* out_instr_len,
+                                     const Code& code,
+                                     Object** object,
+                                     uword pc) {
   ASSERT(hex_size > 0);
   ASSERT(human_size > 0);
   X86Decoder decoder(human_buffer, human_size);
diff --git a/runtime/vm/disassembler_mips.cc b/runtime/vm/disassembler_mips.cc
index 49fbb33..23244b3 100644
--- a/runtime/vm/disassembler_mips.cc
+++ b/runtime/vm/disassembler_mips.cc
@@ -16,9 +16,7 @@
 class MIPSDecoder : public ValueObject {
  public:
   MIPSDecoder(char* buffer, size_t buffer_size)
-      : buffer_(buffer),
-        buffer_size_(buffer_size),
-        buffer_pos_(0) {
+      : buffer_(buffer), buffer_size_(buffer_size), buffer_pos_(0) {
     buffer_[buffer_pos_] = '\0';
   }
 
@@ -53,9 +51,9 @@
   char* current_position_in_buffer() { return buffer_ + buffer_pos_; }
   size_t remaining_size_in_buffer() { return buffer_size_ - buffer_pos_; }
 
-  char* buffer_;  // Decode instructions into this buffer.
+  char* buffer_;        // Decode instructions into this buffer.
   size_t buffer_size_;  // The size of the character buffer.
-  size_t buffer_pos_;  // Current character position in buffer.
+  size_t buffer_pos_;   // Current character position in buffer.
 
   DISALLOW_ALLOCATION();
   DISALLOW_COPY_AND_ASSIGN(MIPSDecoder);
@@ -63,7 +61,7 @@
 
 
 // Support for assertions in the MIPSDecoder formatting functions.
-#define STRING_STARTS_WITH(string, compare_string) \
+#define STRING_STARTS_WITH(string, compare_string)                             \
   (strncmp(string, compare_string, strlen(compare_string)) == 0)
 
 
@@ -79,18 +77,16 @@
 
 
 static const char* reg_names[kNumberOfCpuRegisters] = {
-  "zr", "at", "v0", "v1" , "a0", "a1", "a2", "a3",
-  "t0", "t1", "t2", "t3" , "t4", "t5", "t6", "t7",
-  "s0", "s1", "s2", "thr", "s4", "s5", "s6", "pp",
-  "t8", "t9", "k0", "k1" , "gp", "sp", "fp", "ra",
+    "zr", "at", "v0", "v1", "a0", "a1", "a2", "a3", "t0",  "t1", "t2",
+    "t3", "t4", "t5", "t6", "t7", "s0", "s1", "s2", "thr", "s4", "s5",
+    "s6", "pp", "t8", "t9", "k0", "k1", "gp", "sp", "fp",  "ra",
 };
 
 
 static const char* freg_names[kNumberOfFRegisters] = {
-  "f0" , "f1" , "f2" , "f3" , "f4" , "f5" , "f6" , "f7" ,
-  "f8" , "f9" , "f10", "f11", "f12", "f13", "f14", "f15",
-  "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",
-  "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",
+    "f0",  "f1",  "f2",  "f3",  "f4",  "f5",  "f6",  "f7",  "f8",  "f9",  "f10",
+    "f11", "f12", "f13", "f14", "f15", "f16", "f17", "f18", "f19", "f20", "f21",
+    "f22", "f23", "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",
 };
 
 
@@ -152,7 +148,7 @@
 }
 
 
-void MIPSDecoder::PrintFormat(Instr *instr) {
+void MIPSDecoder::PrintFormat(Instr* instr) {
   switch (instr->FormatField()) {
     case FMT_S: {
       Print("s");
@@ -191,10 +187,9 @@
   switch (format[0]) {
     case 'c': {
       ASSERT(STRING_STARTS_WITH(format, "code"));
-      buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                remaining_size_in_buffer(),
-                                "0x%x",
-                                 instr->BreakCodeField());
+      buffer_pos_ +=
+          OS::SNPrint(current_position_in_buffer(), remaining_size_in_buffer(),
+                      "0x%x", instr->BreakCodeField());
       return 4;
     }
     case 'h': {
@@ -203,12 +198,10 @@
         // The high bit of the SA field is the only one that means something for
         // JALR and JR. TODO(zra): Fill in the other cases for PREF if needed.
         buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   ".hb");
+                                   remaining_size_in_buffer(), ".hb");
       } else if (instr->SaField() != 0) {
         buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                           remaining_size_in_buffer(),
-                           ".unknown");
+                                   remaining_size_in_buffer(), ".unknown");
       }
       return 4;
     }
@@ -217,10 +210,9 @@
       int off = instr->SImmField() << 2;
       uword destination =
           reinterpret_cast<uword>(instr) + off + Instr::kInstrSize;
-      buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                 remaining_size_in_buffer(),
-                                 "%#" Px "",
-                                 destination);
+      buffer_pos_ +=
+          OS::SNPrint(current_position_in_buffer(), remaining_size_in_buffer(),
+                      "%#" Px "", destination);
       return 4;
     }
     case 'i': {
@@ -228,16 +220,12 @@
       if (format[3] == 'u') {
         int32_t imm = instr->UImmField();
         buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   "0x%x",
-                                   imm);
+                                   remaining_size_in_buffer(), "0x%x", imm);
       } else {
         ASSERT(STRING_STARTS_WITH(format, "imms"));
         int32_t imm = instr->SImmField();
         buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   "%d",
-                                   imm);
+                                   remaining_size_in_buffer(), "%d", imm);
       }
       return 4;
     }
@@ -255,15 +243,12 @@
     }
     case 's': {
       ASSERT(STRING_STARTS_WITH(format, "sa"));
-      buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                 remaining_size_in_buffer(),
-                                 "%d",
-                                 instr->SaField());
+      buffer_pos_ +=
+          OS::SNPrint(current_position_in_buffer(), remaining_size_in_buffer(),
+                      "%d", instr->SaField());
       return 2;
     }
-    default: {
-      UNREACHABLE();
-    }
+    default: { UNREACHABLE(); }
   }
   UNREACHABLE();
   return -1;
@@ -283,7 +268,7 @@
     }
     cur = *format++;
   }
-  buffer_[buffer_pos_]  = '\0';
+  buffer_[buffer_pos_] = '\0';
 }
 
 
@@ -310,10 +295,9 @@
       if (instr->BreakCodeField() == Instr::kStopMessageCode) {
         const char* message = *reinterpret_cast<const char**>(
             reinterpret_cast<intptr_t>(instr) - Instr::kInstrSize);
-        buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
-                                   remaining_size_in_buffer(),
-                                   " ; \"%s\"",
-                                   message);
+        buffer_pos_ +=
+            OS::SNPrint(current_position_in_buffer(),
+                        remaining_size_in_buffer(), " ; \"%s\"", message);
       }
       break;
     }
@@ -390,8 +374,7 @@
       break;
     }
     case SLL: {
-      if ((instr->RdField() == R0) &&
-          (instr->RtField() == R0) &&
+      if ((instr->RdField() == R0) && (instr->RtField() == R0) &&
           (instr->SaField() == 0)) {
         Format(instr, "nop");
       } else {
@@ -777,10 +760,14 @@
 }
 
 
-void Disassembler::DecodeInstruction(char* hex_buffer, intptr_t hex_size,
-                                     char* human_buffer, intptr_t human_size,
-                                     int* out_instr_len, const Code& code,
-                                     Object** object, uword pc) {
+void Disassembler::DecodeInstruction(char* hex_buffer,
+                                     intptr_t hex_size,
+                                     char* human_buffer,
+                                     intptr_t human_size,
+                                     int* out_instr_len,
+                                     const Code& code,
+                                     Object** object,
+                                     uword pc) {
   MIPSDecoder decoder(human_buffer, human_size);
   Instr* instr = Instr::At(pc);
   decoder.InstructionDecode(instr);
diff --git a/runtime/vm/disassembler_x64.cc b/runtime/vm/disassembler_x64.cc
index f389415..fe384dc 100644
--- a/runtime/vm/disassembler_x64.cc
+++ b/runtime/vm/disassembler_x64.cc
@@ -40,97 +40,79 @@
 
 
 static const ByteMnemonic two_operands_instr[] = {
-  { 0x00, BYTE_OPER_REG_OP_ORDER, "add" },
-  { 0x01, OPER_REG_OP_ORDER,      "add" },
-  { 0x02, BYTE_REG_OPER_OP_ORDER, "add" },
-  { 0x03, REG_OPER_OP_ORDER,      "add" },
-  { 0x08, BYTE_OPER_REG_OP_ORDER, "or" },
-  { 0x09, OPER_REG_OP_ORDER,      "or" },
-  { 0x0A, BYTE_REG_OPER_OP_ORDER, "or" },
-  { 0x0B, REG_OPER_OP_ORDER,      "or" },
-  { 0x10, BYTE_OPER_REG_OP_ORDER, "adc" },
-  { 0x11, OPER_REG_OP_ORDER,      "adc" },
-  { 0x12, BYTE_REG_OPER_OP_ORDER, "adc" },
-  { 0x13, REG_OPER_OP_ORDER,      "adc" },
-  { 0x18, BYTE_OPER_REG_OP_ORDER, "sbb" },
-  { 0x19, OPER_REG_OP_ORDER,      "sbb" },
-  { 0x1A, BYTE_REG_OPER_OP_ORDER, "sbb" },
-  { 0x1B, REG_OPER_OP_ORDER,      "sbb" },
-  { 0x20, BYTE_OPER_REG_OP_ORDER, "and" },
-  { 0x21, OPER_REG_OP_ORDER,      "and" },
-  { 0x22, BYTE_REG_OPER_OP_ORDER, "and" },
-  { 0x23, REG_OPER_OP_ORDER,      "and" },
-  { 0x28, BYTE_OPER_REG_OP_ORDER, "sub" },
-  { 0x29, OPER_REG_OP_ORDER,      "sub" },
-  { 0x2A, BYTE_REG_OPER_OP_ORDER, "sub" },
-  { 0x2B, REG_OPER_OP_ORDER,      "sub" },
-  { 0x30, BYTE_OPER_REG_OP_ORDER, "xor" },
-  { 0x31, OPER_REG_OP_ORDER,      "xor" },
-  { 0x32, BYTE_REG_OPER_OP_ORDER, "xor" },
-  { 0x33, REG_OPER_OP_ORDER,      "xor" },
-  { 0x38, BYTE_OPER_REG_OP_ORDER, "cmp" },
-  { 0x39, OPER_REG_OP_ORDER,      "cmp" },
-  { 0x3A, BYTE_REG_OPER_OP_ORDER, "cmp" },
-  { 0x3B, REG_OPER_OP_ORDER,      "cmp" },
-  { 0x63, REG_OPER_OP_ORDER,      "movsxd" },
-  { 0x84, BYTE_REG_OPER_OP_ORDER, "test" },
-  { 0x85, REG_OPER_OP_ORDER,      "test" },
-  { 0x86, BYTE_REG_OPER_OP_ORDER, "xchg" },
-  { 0x87, REG_OPER_OP_ORDER,      "xchg" },
-  { 0x88, BYTE_OPER_REG_OP_ORDER, "mov" },
-  { 0x89, OPER_REG_OP_ORDER,      "mov" },
-  { 0x8A, BYTE_REG_OPER_OP_ORDER, "mov" },
-  { 0x8B, REG_OPER_OP_ORDER,      "mov" },
-  { 0x8D, REG_OPER_OP_ORDER,      "lea" },
-  { -1, UNSET_OP_ORDER, "" }
-};
+    {0x00, BYTE_OPER_REG_OP_ORDER, "add"},
+    {0x01, OPER_REG_OP_ORDER, "add"},
+    {0x02, BYTE_REG_OPER_OP_ORDER, "add"},
+    {0x03, REG_OPER_OP_ORDER, "add"},
+    {0x08, BYTE_OPER_REG_OP_ORDER, "or"},
+    {0x09, OPER_REG_OP_ORDER, "or"},
+    {0x0A, BYTE_REG_OPER_OP_ORDER, "or"},
+    {0x0B, REG_OPER_OP_ORDER, "or"},
+    {0x10, BYTE_OPER_REG_OP_ORDER, "adc"},
+    {0x11, OPER_REG_OP_ORDER, "adc"},
+    {0x12, BYTE_REG_OPER_OP_ORDER, "adc"},
+    {0x13, REG_OPER_OP_ORDER, "adc"},
+    {0x18, BYTE_OPER_REG_OP_ORDER, "sbb"},
+    {0x19, OPER_REG_OP_ORDER, "sbb"},
+    {0x1A, BYTE_REG_OPER_OP_ORDER, "sbb"},
+    {0x1B, REG_OPER_OP_ORDER, "sbb"},
+    {0x20, BYTE_OPER_REG_OP_ORDER, "and"},
+    {0x21, OPER_REG_OP_ORDER, "and"},
+    {0x22, BYTE_REG_OPER_OP_ORDER, "and"},
+    {0x23, REG_OPER_OP_ORDER, "and"},
+    {0x28, BYTE_OPER_REG_OP_ORDER, "sub"},
+    {0x29, OPER_REG_OP_ORDER, "sub"},
+    {0x2A, BYTE_REG_OPER_OP_ORDER, "sub"},
+    {0x2B, REG_OPER_OP_ORDER, "sub"},
+    {0x30, BYTE_OPER_REG_OP_ORDER, "xor"},
+    {0x31, OPER_REG_OP_ORDER, "xor"},
+    {0x32, BYTE_REG_OPER_OP_ORDER, "xor"},
+    {0x33, REG_OPER_OP_ORDER, "xor"},
+    {0x38, BYTE_OPER_REG_OP_ORDER, "cmp"},
+    {0x39, OPER_REG_OP_ORDER, "cmp"},
+    {0x3A, BYTE_REG_OPER_OP_ORDER, "cmp"},
+    {0x3B, REG_OPER_OP_ORDER, "cmp"},
+    {0x63, REG_OPER_OP_ORDER, "movsxd"},
+    {0x84, BYTE_REG_OPER_OP_ORDER, "test"},
+    {0x85, REG_OPER_OP_ORDER, "test"},
+    {0x86, BYTE_REG_OPER_OP_ORDER, "xchg"},
+    {0x87, REG_OPER_OP_ORDER, "xchg"},
+    {0x88, BYTE_OPER_REG_OP_ORDER, "mov"},
+    {0x89, OPER_REG_OP_ORDER, "mov"},
+    {0x8A, BYTE_REG_OPER_OP_ORDER, "mov"},
+    {0x8B, REG_OPER_OP_ORDER, "mov"},
+    {0x8D, REG_OPER_OP_ORDER, "lea"},
+    {-1, UNSET_OP_ORDER, ""}};
 
 
 static const ByteMnemonic zero_operands_instr[] = {
-  { 0xC3, UNSET_OP_ORDER, "ret" },
-  { 0xC9, UNSET_OP_ORDER, "leave" },
-  { 0xF4, UNSET_OP_ORDER, "hlt" },
-  { 0xFC, UNSET_OP_ORDER, "cld" },
-  { 0xCC, UNSET_OP_ORDER, "int3" },
-  { 0x60, UNSET_OP_ORDER, "pushad" },
-  { 0x61, UNSET_OP_ORDER, "popad" },
-  { 0x9C, UNSET_OP_ORDER, "pushfd" },
-  { 0x9D, UNSET_OP_ORDER, "popfd" },
-  { 0x9E, UNSET_OP_ORDER, "sahf" },
-  { 0x99, UNSET_OP_ORDER, "cdq" },
-  { 0x9B, UNSET_OP_ORDER, "fwait" },
-  { 0xA4, UNSET_OP_ORDER, "movs" },
-  { 0xA5, UNSET_OP_ORDER, "movs" },
-  { 0xA6, UNSET_OP_ORDER, "cmps" },
-  { 0xA7, UNSET_OP_ORDER, "cmps" },
-  { -1, UNSET_OP_ORDER, "" }
-};
+    {0xC3, UNSET_OP_ORDER, "ret"},   {0xC9, UNSET_OP_ORDER, "leave"},
+    {0xF4, UNSET_OP_ORDER, "hlt"},   {0xFC, UNSET_OP_ORDER, "cld"},
+    {0xCC, UNSET_OP_ORDER, "int3"},  {0x60, UNSET_OP_ORDER, "pushad"},
+    {0x61, UNSET_OP_ORDER, "popad"}, {0x9C, UNSET_OP_ORDER, "pushfd"},
+    {0x9D, UNSET_OP_ORDER, "popfd"}, {0x9E, UNSET_OP_ORDER, "sahf"},
+    {0x99, UNSET_OP_ORDER, "cdq"},   {0x9B, UNSET_OP_ORDER, "fwait"},
+    {0xA4, UNSET_OP_ORDER, "movs"},  {0xA5, UNSET_OP_ORDER, "movs"},
+    {0xA6, UNSET_OP_ORDER, "cmps"},  {0xA7, UNSET_OP_ORDER, "cmps"},
+    {-1, UNSET_OP_ORDER, ""}};
 
 
-static const ByteMnemonic call_jump_instr[] = {
-  { 0xE8, UNSET_OP_ORDER, "call" },
-  { 0xE9, UNSET_OP_ORDER, "jmp" },
-  { -1, UNSET_OP_ORDER, "" }
-};
+static const ByteMnemonic call_jump_instr[] = {{0xE8, UNSET_OP_ORDER, "call"},
+                                               {0xE9, UNSET_OP_ORDER, "jmp"},
+                                               {-1, UNSET_OP_ORDER, ""}};
 
 
 static const ByteMnemonic short_immediate_instr[] = {
-  { 0x05, UNSET_OP_ORDER, "add" },
-  { 0x0D, UNSET_OP_ORDER, "or" },
-  { 0x15, UNSET_OP_ORDER, "adc" },
-  { 0x1D, UNSET_OP_ORDER, "sbb" },
-  { 0x25, UNSET_OP_ORDER, "and" },
-  { 0x2D, UNSET_OP_ORDER, "sub" },
-  { 0x35, UNSET_OP_ORDER, "xor" },
-  { 0x3D, UNSET_OP_ORDER, "cmp" },
-  { -1, UNSET_OP_ORDER, "" }
-};
+    {0x05, UNSET_OP_ORDER, "add"}, {0x0D, UNSET_OP_ORDER, "or"},
+    {0x15, UNSET_OP_ORDER, "adc"}, {0x1D, UNSET_OP_ORDER, "sbb"},
+    {0x25, UNSET_OP_ORDER, "and"}, {0x2D, UNSET_OP_ORDER, "sub"},
+    {0x35, UNSET_OP_ORDER, "xor"}, {0x3D, UNSET_OP_ORDER, "cmp"},
+    {-1, UNSET_OP_ORDER, ""}};
 
 
 static const char* const conditional_code_suffix[] = {
-  "o", "no", "c", "nc", "z", "nz", "na", "a",
-  "s", "ns", "pe", "po", "l", "ge", "le", "g"
-};
+    "o", "no", "c",  "nc", "z", "nz", "na", "a",
+    "s", "ns", "pe", "po", "l", "ge", "le", "g"};
 
 
 enum InstructionType {
@@ -167,9 +149,7 @@
 class InstructionTable : public ValueObject {
  public:
   InstructionTable();
-  const InstructionDesc& Get(uint8_t x) const {
-    return instructions_[x];
-  }
+  const InstructionDesc& Get(uint8_t x) const { return instructions_[x]; }
 
  private:
   InstructionDesc instructions_[256];
@@ -249,7 +229,7 @@
   for (uint8_t b = 0x70; b <= 0x7F; b++) {
     InstructionDesc* id = &instructions_[b];
     ASSERT(NO_INSTR == id->type);  // Information not already entered
-    id->mnem = NULL;  // Computed depending on condition code.
+    id->mnem = NULL;               // Computed depending on condition code.
     id->type = JUMP_CONDITIONAL_SHORT_INSTR;
   }
 }
@@ -259,23 +239,22 @@
 
 
 static InstructionDesc cmov_instructions[16] = {
-  {"cmovo", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovno", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovc", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovnc", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovz", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovnz", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovna", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmova", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovs", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovns", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovpe", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovpo", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovl", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovge", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovle", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovg", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false}
-};
+    {"cmovo", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
+    {"cmovno", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
+    {"cmovc", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
+    {"cmovnc", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
+    {"cmovz", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
+    {"cmovnz", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
+    {"cmovna", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
+    {"cmova", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
+    {"cmovs", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
+    {"cmovns", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
+    {"cmovpe", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
+    {"cmovpo", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
+    {"cmovl", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
+    {"cmovge", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
+    {"cmovle", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
+    {"cmovg", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false}};
 
 
 //-------------------------------------------------
@@ -284,9 +263,8 @@
 
 static const int kMaxXmmRegisters = 16;
 static const char* xmm_regs[kMaxXmmRegisters] = {
-  "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7",
-  "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15"
-};
+    "xmm0", "xmm1", "xmm2",  "xmm3",  "xmm4",  "xmm5",  "xmm6",  "xmm7",
+    "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15"};
 
 class DisassemblerX64 : public ValueObject {
  public:
@@ -301,8 +279,7 @@
     buffer_[buffer_pos_] = '\0';
   }
 
-  virtual ~DisassemblerX64() {
-  }
+  virtual ~DisassemblerX64() {}
 
   int InstructionDecode(uword pc);
 
@@ -339,24 +316,16 @@
     return DOUBLEWORD_SIZE;
   }
 
-  char operand_size_code() {
-    return "bwlq"[operand_size()];
-  }
+  char operand_size_code() { return "bwlq"[operand_size()]; }
 
   // Disassembler helper functions.
-  void get_modrm(uint8_t data,
-                 int* mod,
-                 int* regop,
-                 int* rm) {
+  void get_modrm(uint8_t data, int* mod, int* regop, int* rm) {
     *mod = (data >> 6) & 3;
     *regop = ((data & 0x38) >> 3) | (rex_r() ? 8 : 0);
     *rm = (data & 7) | (rex_b() ? 8 : 0);
   }
 
-  void get_sib(uint8_t data,
-               int* scale,
-               int* index,
-               int* base) {
+  void get_sib(uint8_t data, int* scale, int* index, int* base) {
     *scale = (data >> 6) & 3;
     *index = ((data >> 3) & 7) | (rex_x() ? 8 : 0);
     *base = (data & 7) | (rex_b() ? 8 : 0);
@@ -378,9 +347,7 @@
   void Print(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
   void PrintAddress(uint8_t* addr);
 
-  int PrintOperands(const char* mnem,
-                    OperandType op_order,
-                    uint8_t* data);
+  int PrintOperands(const char* mnem, OperandType op_order, uint8_t* data);
 
   typedef const char* (DisassemblerX64::*RegisterNameMapping)(int reg) const;
 
@@ -408,13 +375,11 @@
 
   bool DecodeInstructionType(uint8_t** data);
 
-  void UnimplementedInstruction() {
-    Print("'Unimplemented Instruction'");
-  }
+  void UnimplementedInstruction() { Print("'Unimplemented Instruction'"); }
 
-  char* buffer_;  // Decode instructions into this buffer.
+  char* buffer_;          // Decode instructions into this buffer.
   intptr_t buffer_size_;  // The size of the buffer_.
-  intptr_t buffer_pos_;  // Current character position in the buffer_.
+  intptr_t buffer_pos_;   // Current character position in the buffer_.
 
   // Prefixes parsed
   uint8_t rex_;
@@ -451,8 +416,8 @@
     RegisterNameMapping direct_register_name) {
   int mod, regop, rm;
   get_modrm(*modrmp, &mod, &regop, &rm);
-  RegisterNameMapping register_name = (mod == 3) ? direct_register_name :
-      &DisassemblerX64::NameOfCPURegister;
+  RegisterNameMapping register_name =
+      (mod == 3) ? direct_register_name : &DisassemblerX64::NameOfCPURegister;
   switch (mod) {
     case 0:
       if ((rm & 7) == 5) {
@@ -478,9 +443,7 @@
           return 6;
         } else if (index != 4 && base != 5) {
           // [base+index*scale]
-          Print("[%s+%s*%d]",
-                NameOfCPURegister(base),
-                NameOfCPURegister(index),
+          Print("[%s+%s*%d]", NameOfCPURegister(base), NameOfCPURegister(index),
                 1 << scale);
           return 2;
         } else {
@@ -504,9 +467,7 @@
           Print("[%s", NameOfCPURegister(base));
           PrintDisp(disp, "]");
         } else {
-          Print("[%s+%s*%d",
-                NameOfCPURegister(base),
-                NameOfCPURegister(index),
+          Print("[%s+%s*%d", NameOfCPURegister(base), NameOfCPURegister(index),
                 1 << scale);
           PrintDisp(disp, "]");
         }
@@ -578,8 +539,6 @@
 }
 
 
-
-
 // Returns number of bytes used by machine instruction, including *data byte.
 // Writes immediate instructions to 'tmp_buffer_'.
 int DisassemblerX64::PrintImmediateOp(uint8_t* data) {
@@ -652,10 +611,7 @@
       default:
         UnimplementedInstruction();
     }
-    Print("%s%c %s",
-          mnem,
-          operand_size_code(),
-          NameOfCPURegister(rm));
+    Print("%s%c %s", mnem, operand_size_code(), NameOfCPURegister(rm));
     return 2;
   } else if (regop == 0) {
     Print("test%c ", operand_size_code());
@@ -720,11 +676,8 @@
     imm8 = *(data + 2);
     num_bytes = 3;
   }
-  Print("%s%c %s,",
-        mnem,
-        operand_size_code(),
-        byte_size_operand_ ? NameOfByteCPURegister(rm)
-                           : NameOfCPURegister(rm));
+  Print("%s%c %s,", mnem, operand_size_code(),
+        byte_size_operand_ ? NameOfByteCPURegister(rm) : NameOfCPURegister(rm));
   if (op == 0xD2) {
     Print("cl");
   } else {
@@ -735,8 +688,7 @@
 
 
 int DisassemblerX64::PrintRightOperand(uint8_t* modrmp) {
-  return PrintRightOperandHelper(modrmp,
-                                 &DisassemblerX64::NameOfCPURegister);
+  return PrintRightOperandHelper(modrmp, &DisassemblerX64::NameOfCPURegister);
 }
 
 
@@ -747,8 +699,7 @@
 
 
 int DisassemblerX64::PrintRightXMMOperand(uint8_t* modrmp) {
-  return PrintRightOperandHelper(modrmp,
-                                 &DisassemblerX64::NameOfXMMRegister);
+  return PrintRightOperandHelper(modrmp, &DisassemblerX64::NameOfXMMRegister);
 }
 
 
@@ -761,9 +712,8 @@
   int mod, regop, rm;
   get_modrm(modrm, &mod, &regop, &rm);
   int advance = 0;
-  const char* register_name =
-      byte_size_operand_ ? NameOfByteCPURegister(regop)
-                         : NameOfCPURegister(regop);
+  const char* register_name = byte_size_operand_ ? NameOfByteCPURegister(regop)
+                                                 : NameOfCPURegister(regop);
   switch (op_order) {
     case REG_OPER_OP_ORDER: {
       Print("%s%c %s,", mnem, operand_size_code(), register_name);
@@ -842,12 +792,12 @@
 int DisassemblerX64::FPUInstruction(uint8_t* data) {
   uint8_t escape_opcode = *data;
   ASSERT(0xD8 == (escape_opcode & 0xF8));
-  uint8_t modrm_byte = *(data+1);
+  uint8_t modrm_byte = *(data + 1);
 
   if (modrm_byte >= 0xC0) {
     return RegisterFPUInstruction(escape_opcode, modrm_byte);
   } else {
-    return MemoryFPUInstruction(escape_opcode, modrm_byte, data+1);
+    return MemoryFPUInstruction(escape_opcode, modrm_byte, data + 1);
   }
 }
 
@@ -858,38 +808,69 @@
   const char* mnem = "?";
   int regop = (modrm_byte >> 3) & 0x7;  // reg/op field of modrm byte.
   switch (escape_opcode) {
-    case 0xD9: switch (regop) {
-        case 0: mnem = "fld_s"; break;
-        case 3: mnem = "fstp_s"; break;
-        case 7: mnem = "fstcw"; break;
-        default: UnimplementedInstruction();
+    case 0xD9:
+      switch (regop) {
+        case 0:
+          mnem = "fld_s";
+          break;
+        case 3:
+          mnem = "fstp_s";
+          break;
+        case 7:
+          mnem = "fstcw";
+          break;
+        default:
+          UnimplementedInstruction();
       }
       break;
 
-    case 0xDB: switch (regop) {
-        case 0: mnem = "fild_s"; break;
-        case 1: mnem = "fisttp_s"; break;
-        case 2: mnem = "fist_s"; break;
-        case 3: mnem = "fistp_s"; break;
-        default: UnimplementedInstruction();
+    case 0xDB:
+      switch (regop) {
+        case 0:
+          mnem = "fild_s";
+          break;
+        case 1:
+          mnem = "fisttp_s";
+          break;
+        case 2:
+          mnem = "fist_s";
+          break;
+        case 3:
+          mnem = "fistp_s";
+          break;
+        default:
+          UnimplementedInstruction();
       }
       break;
 
-    case 0xDD: switch (regop) {
-        case 0: mnem = "fld_d"; break;
-        case 3: mnem = "fstp_d"; break;
-        default: UnimplementedInstruction();
+    case 0xDD:
+      switch (regop) {
+        case 0:
+          mnem = "fld_d";
+          break;
+        case 3:
+          mnem = "fstp_d";
+          break;
+        default:
+          UnimplementedInstruction();
       }
       break;
 
-    case 0xDF: switch (regop) {
-        case 5: mnem = "fild_d"; break;
-        case 7: mnem = "fistp_d"; break;
-        default: UnimplementedInstruction();
+    case 0xDF:
+      switch (regop) {
+        case 5:
+          mnem = "fild_d";
+          break;
+        case 7:
+          mnem = "fistp_d";
+          break;
+        default:
+          UnimplementedInstruction();
       }
       break;
 
-    default: UnimplementedInstruction();
+    default:
+      UnimplementedInstruction();
   }
   Print("%s ", mnem);
   int count = PrintRightOperand(modrm_start);
@@ -918,24 +899,59 @@
           break;
         default:
           switch (modrm_byte) {
-            case 0xE0: mnem = "fchs"; break;
-            case 0xE1: mnem = "fabs"; break;
-            case 0xE3: mnem = "fninit"; break;
-            case 0xE4: mnem = "ftst"; break;
-            case 0xE8: mnem = "fld1"; break;
-            case 0xEB: mnem = "fldpi"; break;
-            case 0xED: mnem = "fldln2"; break;
-            case 0xEE: mnem = "fldz"; break;
-            case 0xF0: mnem = "f2xm1"; break;
-            case 0xF1: mnem = "fyl2x"; break;
-            case 0xF2: mnem = "fptan"; break;
-            case 0xF5: mnem = "fprem1"; break;
-            case 0xF7: mnem = "fincstp"; break;
-            case 0xF8: mnem = "fprem"; break;
-            case 0xFD: mnem = "fscale"; break;
-            case 0xFE: mnem = "fsin"; break;
-            case 0xFF: mnem = "fcos"; break;
-            default: UnimplementedInstruction();
+            case 0xE0:
+              mnem = "fchs";
+              break;
+            case 0xE1:
+              mnem = "fabs";
+              break;
+            case 0xE3:
+              mnem = "fninit";
+              break;
+            case 0xE4:
+              mnem = "ftst";
+              break;
+            case 0xE8:
+              mnem = "fld1";
+              break;
+            case 0xEB:
+              mnem = "fldpi";
+              break;
+            case 0xED:
+              mnem = "fldln2";
+              break;
+            case 0xEE:
+              mnem = "fldz";
+              break;
+            case 0xF0:
+              mnem = "f2xm1";
+              break;
+            case 0xF1:
+              mnem = "fyl2x";
+              break;
+            case 0xF2:
+              mnem = "fptan";
+              break;
+            case 0xF5:
+              mnem = "fprem1";
+              break;
+            case 0xF7:
+              mnem = "fincstp";
+              break;
+            case 0xF8:
+              mnem = "fprem";
+              break;
+            case 0xFD:
+              mnem = "fscale";
+              break;
+            case 0xFE:
+              mnem = "fsin";
+              break;
+            case 0xFF:
+              mnem = "fcos";
+              break;
+            default:
+              UnimplementedInstruction();
           }
       }
       break;
@@ -952,7 +968,7 @@
       if ((modrm_byte & 0xF8) == 0xE8) {
         mnem = "fucomi";
         has_register = true;
-      } else if (modrm_byte  == 0xE2) {
+      } else if (modrm_byte == 0xE2) {
         mnem = "fclex";
       } else {
         UnimplementedInstruction();
@@ -962,34 +978,57 @@
     case 0xDC:
       has_register = true;
       switch (modrm_byte & 0xF8) {
-        case 0xC0: mnem = "fadd"; break;
-        case 0xE8: mnem = "fsub"; break;
-        case 0xC8: mnem = "fmul"; break;
-        case 0xF8: mnem = "fdiv"; break;
-        default: UnimplementedInstruction();
+        case 0xC0:
+          mnem = "fadd";
+          break;
+        case 0xE8:
+          mnem = "fsub";
+          break;
+        case 0xC8:
+          mnem = "fmul";
+          break;
+        case 0xF8:
+          mnem = "fdiv";
+          break;
+        default:
+          UnimplementedInstruction();
       }
       break;
 
     case 0xDD:
       has_register = true;
       switch (modrm_byte & 0xF8) {
-        case 0xC0: mnem = "ffree"; break;
-        case 0xD8: mnem = "fstp"; break;
-        default: UnimplementedInstruction();
+        case 0xC0:
+          mnem = "ffree";
+          break;
+        case 0xD8:
+          mnem = "fstp";
+          break;
+        default:
+          UnimplementedInstruction();
       }
       break;
 
     case 0xDE:
-      if (modrm_byte  == 0xD9) {
+      if (modrm_byte == 0xD9) {
         mnem = "fcompp";
       } else {
         has_register = true;
         switch (modrm_byte & 0xF8) {
-          case 0xC0: mnem = "faddp"; break;
-          case 0xE8: mnem = "fsubp"; break;
-          case 0xC8: mnem = "fmulp"; break;
-          case 0xF8: mnem = "fdivp"; break;
-          default: UnimplementedInstruction();
+          case 0xC0:
+            mnem = "faddp";
+            break;
+          case 0xE8:
+            mnem = "fsubp";
+            break;
+          case 0xC8:
+            mnem = "fmulp";
+            break;
+          case 0xF8:
+            mnem = "fdivp";
+            break;
+          default:
+            UnimplementedInstruction();
         }
       }
       break;
@@ -1003,7 +1042,8 @@
       }
       break;
 
-    default: UnimplementedInstruction();
+    default:
+      UnimplementedInstruction();
   }
 
   if (has_register) {
@@ -1068,16 +1108,12 @@
       break;
 
     case REGISTER_INSTR:
-      Print("%s%c %s",
-            idesc.mnem,
-            operand_size_code(),
+      Print("%s%c %s", idesc.mnem, operand_size_code(),
             NameOfCPURegister(base_reg(current & 0x07)));
       (*data)++;
       break;
     case PUSHPOP_INSTR:
-      Print("%s %s",
-            idesc.mnem,
-            NameOfCPURegister(base_reg(current & 0x07)));
+      Print("%s %s", idesc.mnem, NameOfCPURegister(base_reg(current & 0x07)));
       (*data)++;
       break;
     case MOVE_REG_INSTR: {
@@ -1101,8 +1137,7 @@
         default:
           UNREACHABLE();
       }
-      Print("mov%c %s,",
-            operand_size_code(),
+      Print("mov%c %s,", operand_size_code(),
             NameOfCPURegister(base_reg(current & 0x07)));
       PrintAddress(addr);
       break;
@@ -1164,7 +1199,7 @@
         current += 1;
       } else if (third_byte == 0x0b) {
         get_modrm(*current, &mod, &regop, &rm);
-         // roundsd xmm, xmm/m64, imm8
+        // roundsd xmm, xmm/m64, imm8
         Print("roundsd %s, ", NameOfCPURegister(regop));
         current += PrintRightOperand(current);
         Print(", %d", (*current) & 3);
@@ -1193,17 +1228,13 @@
         current += PrintRightXMMOperand(current);
         Print(", %s", NameOfXMMRegister(regop));
       } else if (opcode == 0x6E) {
-        Print("mov%c %s,",
-              rex_w() ? 'q' : 'd',
-              NameOfXMMRegister(regop));
+        Print("mov%c %s,", rex_w() ? 'q' : 'd', NameOfXMMRegister(regop));
         current += PrintRightOperand(current);
       } else if (opcode == 0x6F) {
-        Print("movdqa %s,",
-              NameOfXMMRegister(regop));
+        Print("movdqa %s,", NameOfXMMRegister(regop));
         current += PrintRightXMMOperand(current);
       } else if (opcode == 0x7E) {
-        Print("mov%c ",
-              rex_w() ? 'q' : 'd');
+        Print("mov%c ", rex_w() ? 'q' : 'd');
         current += PrintRightOperand(current);
         Print(", %s", NameOfXMMRegister(regop));
       } else if (opcode == 0x7F) {
@@ -1225,9 +1256,9 @@
           mnemonic = "unpckhpd";
         } else if (opcode == 0x54) {
           mnemonic = "andpd";
-        } else  if (opcode == 0x56) {
+        } else if (opcode == 0x56) {
           mnemonic = "orpd";
-        } else  if (opcode == 0x57) {
+        } else if (opcode == 0x57) {
           mnemonic = "xorpd";
         } else if (opcode == 0x2E) {
           mnemonic = "ucomisd";
@@ -1286,15 +1317,13 @@
       // Convert with truncation scalar double-precision FP to integer.
       int mod, regop, rm;
       get_modrm(*current, &mod, &regop, &rm);
-      Print("cvttsd2si%c %s,",
-          operand_size_code(), NameOfCPURegister(regop));
+      Print("cvttsd2si%c %s,", operand_size_code(), NameOfCPURegister(regop));
       current += PrintRightXMMOperand(current);
     } else if (opcode == 0x2D) {
       // CVTSD2SI: Convert scalar double-precision FP to integer.
       int mod, regop, rm;
       get_modrm(*current, &mod, &regop, &rm);
-      Print("cvtsd2si%c %s,",
-          operand_size_code(), NameOfCPURegister(regop));
+      Print("cvtsd2si%c %s,", operand_size_code(), NameOfCPURegister(regop));
       current += PrintRightXMMOperand(current);
     } else if ((opcode & 0xF8) == 0x58 || opcode == 0x51) {
       // XMM arithmetic. Mnemonic was retrieved at the start of this function.
@@ -1330,8 +1359,7 @@
       // Convert with truncation scalar single-precision FP to dword integer.
       int mod, regop, rm;
       get_modrm(*current, &mod, &regop, &rm);
-      Print("cvttss2si%c %s,",
-            operand_size_code(), NameOfCPURegister(regop));
+      Print("cvttss2si%c %s,", operand_size_code(), NameOfCPURegister(regop));
       current += PrintRightXMMOperand(current);
     } else if (opcode == 0x5A) {
       // CVTSS2SD:
@@ -1418,24 +1446,59 @@
              opcode == 0x5E || opcode == 0x5F) {
     const char* mnemonic = NULL;
     switch (opcode) {
-      case 0x12: mnemonic = "movhlps"; break;
-      case 0x14: mnemonic = "unpcklps"; break;
-      case 0x15: mnemonic = "unpckhps"; break;
-      case 0x16: mnemonic = "movlhps"; break;
-      case 0x51: mnemonic = "sqrtps"; break;
-      case 0x52: mnemonic = "rsqrtps"; break;
-      case 0x53: mnemonic = "rcpps"; break;
-      case 0x54: mnemonic = "andps"; break;
-      case 0x56: mnemonic = "orps"; break;
-      case 0x57: mnemonic = "xorps"; break;
-      case 0x58: mnemonic = "addps"; break;
-      case 0x59: mnemonic = "mulps"; break;
-      case 0x5A: mnemonic = "cvtsd2ss"; break;
-      case 0x5C: mnemonic = "subps"; break;
-      case 0x5D: mnemonic = "minps"; break;
-      case 0x5E: mnemonic = "divps"; break;
-      case 0x5F: mnemonic = "maxps"; break;
-      default: UNREACHABLE();
+      case 0x12:
+        mnemonic = "movhlps";
+        break;
+      case 0x14:
+        mnemonic = "unpcklps";
+        break;
+      case 0x15:
+        mnemonic = "unpckhps";
+        break;
+      case 0x16:
+        mnemonic = "movlhps";
+        break;
+      case 0x51:
+        mnemonic = "sqrtps";
+        break;
+      case 0x52:
+        mnemonic = "rsqrtps";
+        break;
+      case 0x53:
+        mnemonic = "rcpps";
+        break;
+      case 0x54:
+        mnemonic = "andps";
+        break;
+      case 0x56:
+        mnemonic = "orps";
+        break;
+      case 0x57:
+        mnemonic = "xorps";
+        break;
+      case 0x58:
+        mnemonic = "addps";
+        break;
+      case 0x59:
+        mnemonic = "mulps";
+        break;
+      case 0x5A:
+        mnemonic = "cvtsd2ss";
+        break;
+      case 0x5C:
+        mnemonic = "subps";
+        break;
+      case 0x5D:
+        mnemonic = "minps";
+        break;
+      case 0x5E:
+        mnemonic = "divps";
+        break;
+      case 0x5F:
+        mnemonic = "maxps";
+        break;
+      default:
+        UNREACHABLE();
     }
     int mod, regop, rm;
     get_modrm(*current, &mod, &regop, &rm);
@@ -1562,9 +1625,7 @@
         break;
 
       case 0xC8:
-        Print("enter %d, %d",
-              *reinterpret_cast<uint16_t*>(data + 1),
-              data[3]);
+        Print("enter %d, %d", *reinterpret_cast<uint16_t*>(data + 1), data[3]);
         data += 4;
         break;
 
@@ -1572,11 +1633,9 @@
       case 0x6B: {
         int mod, regop, rm;
         get_modrm(*(data + 1), &mod, &regop, &rm);
-        int32_t imm = *data == 0x6B ? *(data + 2)
-            : *reinterpret_cast<int32_t*>(data + 2);
-        Print("imul%c %s,%s,",
-              operand_size_code(),
-              NameOfCPURegister(regop),
+        int32_t imm =
+            *data == 0x6B ? *(data + 2) : *reinterpret_cast<int32_t*>(data + 2);
+        Print("imul%c %s,%s,", operand_size_code(), NameOfCPURegister(regop),
               NameOfCPURegister(rm));
         PrintImmediateValue(imm);
         data += 2 + (*data == 0x6B ? 1 : 4);
@@ -1600,8 +1659,7 @@
           Print("pop ");
           data += PrintRightOperand(data);
         }
-      }
-        break;
+      } break;
 
       case 0xFF: {
         data++;
@@ -1633,8 +1691,7 @@
           Print("%s ", mnem);
         }
         data += PrintRightOperand(data);
-      }
-        break;
+      } break;
 
       case 0xC7:  // imm32, fall through
       case 0xC6:  // imm8
@@ -1656,8 +1713,7 @@
           PrintImmediateValue(imm);
           data += 4;
         }
-      }
-        break;
+      } break;
 
       case 0x80: {
         data++;
@@ -1667,8 +1723,7 @@
         Print(",");
         PrintImmediateValue(imm);
         data++;
-      }
-        break;
+      } break;
 
       case 0x88:  // 8bit, fall through
       case 0x89:  // 32bit
@@ -1686,8 +1741,7 @@
           data += PrintRightOperand(data);
           Print(",%s", NameOfCPURegister(regop));
         }
-      }
-        break;
+      } break;
 
       case 0x90:
       case 0x91:
@@ -1704,8 +1758,7 @@
           Print("xchg%c rax, %s", operand_size_code(), NameOfCPURegister(reg));
         }
         data++;
-      }
-        break;
+      } break;
       case 0xB0:
       case 0xB1:
       case 0xB2:
@@ -1764,22 +1817,19 @@
       case 0xA3:
         switch (operand_size()) {
           case DOUBLEWORD_SIZE: {
-            PrintAddress(
-                reinterpret_cast<uint8_t*>(
-                    *reinterpret_cast<int32_t*>(data + 1)));
+            PrintAddress(reinterpret_cast<uint8_t*>(
+                *reinterpret_cast<int32_t*>(data + 1)));
             if (*data == 0xA1) {  // Opcode 0xA1
               Print("movzxlq rax,(");
-              PrintAddress(
-                  reinterpret_cast<uint8_t*>(
-                      *reinterpret_cast<int32_t*>(data + 1)));
+              PrintAddress(reinterpret_cast<uint8_t*>(
+                  *reinterpret_cast<int32_t*>(data + 1)));
               Print(")");
             } else {  // Opcode 0xA3
               Print("movzxlq (");
-              PrintAddress(
-                  reinterpret_cast<uint8_t*>(
-                      *reinterpret_cast<int32_t*>(data + 1)));
+              PrintAddress(reinterpret_cast<uint8_t*>(
+                  *reinterpret_cast<int32_t*>(data + 1)));
               Print("),rax");
-           }
+            }
             data += 5;
             break;
           }
@@ -1878,10 +1928,14 @@
 }
 
 
-void Disassembler::DecodeInstruction(char* hex_buffer, intptr_t hex_size,
-                                     char* human_buffer, intptr_t human_size,
-                                     int* out_instr_len, const Code& code,
-                                     Object** object, uword pc) {
+void Disassembler::DecodeInstruction(char* hex_buffer,
+                                     intptr_t hex_size,
+                                     char* human_buffer,
+                                     intptr_t human_size,
+                                     int* out_instr_len,
+                                     const Code& code,
+                                     Object** object,
+                                     uword pc) {
   ASSERT(hex_size > 0);
   ASSERT(human_size > 0);
   DisassemblerX64 decoder(human_buffer, human_size);
diff --git a/runtime/vm/double_conversion.cc b/runtime/vm/double_conversion.cc
index cb3c047..4490d5f 100644
--- a/runtime/vm/double_conversion.cc
+++ b/runtime/vm/double_conversion.cc
@@ -34,16 +34,14 @@
   static const int kConversionFlags =
       double_conversion::DoubleToStringConverter::EMIT_POSITIVE_EXPONENT_SIGN |
       double_conversion::DoubleToStringConverter::EMIT_TRAILING_DECIMAL_POINT |
-     double_conversion::DoubleToStringConverter::EMIT_TRAILING_ZERO_AFTER_POINT;
+      double_conversion::DoubleToStringConverter::
+          EMIT_TRAILING_ZERO_AFTER_POINT;
 
   const double_conversion::DoubleToStringConverter converter(
-      kConversionFlags,
-      kDoubleToStringCommonInfinitySymbol,
-      kDoubleToStringCommonNaNSymbol,
-      kDoubleToStringCommonExponentChar,
-      kDecimalLow,
-      kDecimalHigh,
-      0, 0);  // Last two values are ignored in shortest mode.
+      kConversionFlags, kDoubleToStringCommonInfinitySymbol,
+      kDoubleToStringCommonNaNSymbol, kDoubleToStringCommonExponentChar,
+      kDecimalLow, kDecimalHigh, 0,
+      0);  // Last two values are ignored in shortest mode.
 
   double_conversion::StringBuilder builder(buffer, buffer_size);
   bool status = converter.ToShortest(d, &builder);
@@ -80,11 +78,9 @@
          fraction_digits <= kMaxFractionDigits);
 
   const double_conversion::DoubleToStringConverter converter(
-      kConversionFlags,
-      kDoubleToStringCommonInfinitySymbol,
-      kDoubleToStringCommonNaNSymbol,
-      kDoubleToStringCommonExponentChar,
-      0, 0, 0, 0);  // Last four values are ignored in fixed mode.
+      kConversionFlags, kDoubleToStringCommonInfinitySymbol,
+      kDoubleToStringCommonNaNSymbol, kDoubleToStringCommonExponentChar, 0, 0,
+      0, 0);  // Last four values are ignored in fixed mode.
 
   char* buffer = Thread::Current()->zone()->Alloc<char>(kBufferSize);
   buffer[kBufferSize - 1] = '\0';
@@ -113,11 +109,9 @@
          fraction_digits <= kMaxFractionDigits);
 
   const double_conversion::DoubleToStringConverter converter(
-      kConversionFlags,
-      kDoubleToStringCommonInfinitySymbol,
-      kDoubleToStringCommonNaNSymbol,
-      kDoubleToStringCommonExponentChar,
-      0, 0, 0, 0);  // Last four values are ignored in exponential mode.
+      kConversionFlags, kDoubleToStringCommonInfinitySymbol,
+      kDoubleToStringCommonNaNSymbol, kDoubleToStringCommonExponentChar, 0, 0,
+      0, 0);  // Last four values are ignored in exponential mode.
 
   char* buffer = Thread::Current()->zone()->Alloc<char>(kBufferSize);
   buffer[kBufferSize - 1] = '\0';
@@ -145,18 +139,16 @@
   // plus the \0.
   // Note that padding and exponent are exclusive. We still add them up.
   ASSERT(kBufferSize >= 1 + 1 + 1 + kMaxLeadingPaddingZeroes +
-         kMaxTrailingPaddingZeroes + kMaxPrecisionDigits + 1 + 1 + 3 + 1);
+                            kMaxTrailingPaddingZeroes + kMaxPrecisionDigits +
+                            1 + 1 + 3 + 1);
 
   ASSERT(kMinPrecisionDigits <= precision && precision <= kMaxPrecisionDigits);
 
   const double_conversion::DoubleToStringConverter converter(
-      kConversionFlags,
-      kDoubleToStringCommonInfinitySymbol,
-      kDoubleToStringCommonNaNSymbol,
-      kDoubleToStringCommonExponentChar,
-      0, 0,  // Ignored in precision mode.
-      kMaxLeadingPaddingZeroes,
-      kMaxTrailingPaddingZeroes);
+      kConversionFlags, kDoubleToStringCommonInfinitySymbol,
+      kDoubleToStringCommonNaNSymbol, kDoubleToStringCommonExponentChar, 0,
+      0,  // Ignored in precision mode.
+      kMaxLeadingPaddingZeroes, kMaxTrailingPaddingZeroes);
 
   char* buffer = Thread::Current()->zone()->Alloc<char>(kBufferSize);
   buffer[kBufferSize - 1] = '\0';
@@ -173,16 +165,12 @@
   }
 
   double_conversion::StringToDoubleConverter converter(
-    double_conversion::StringToDoubleConverter::NO_FLAGS,
-    0.0,
-    0.0,
-    kDoubleToStringCommonInfinitySymbol,
-    kDoubleToStringCommonNaNSymbol);
+      double_conversion::StringToDoubleConverter::NO_FLAGS, 0.0, 0.0,
+      kDoubleToStringCommonInfinitySymbol, kDoubleToStringCommonNaNSymbol);
 
   int parsed_count = 0;
-  *result = converter.StringToDouble(str,
-                                     static_cast<int>(length),
-                                     &parsed_count);
+  *result =
+      converter.StringToDouble(str, static_cast<int>(length), &parsed_count);
   return (parsed_count == length);
 }
 
diff --git a/runtime/vm/double_conversion.h b/runtime/vm/double_conversion.h
index ded82a4..dd6e213 100644
--- a/runtime/vm/double_conversion.h
+++ b/runtime/vm/double_conversion.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_DOUBLE_CONVERSION_H_
-#define VM_DOUBLE_CONVERSION_H_
+#ifndef RUNTIME_VM_DOUBLE_CONVERSION_H_
+#define RUNTIME_VM_DOUBLE_CONVERSION_H_
 
 #include "vm/globals.h"
 #include "vm/object.h"
@@ -19,4 +19,4 @@
 
 }  // namespace dart
 
-#endif  // VM_DOUBLE_CONVERSION_H_
+#endif  // RUNTIME_VM_DOUBLE_CONVERSION_H_
diff --git a/runtime/vm/double_internals.h b/runtime/vm/double_internals.h
index 4e54475..87125be 100644
--- a/runtime/vm/double_internals.h
+++ b/runtime/vm/double_internals.h
@@ -2,15 +2,17 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_DOUBLE_INTERNALS_H_
-#define VM_DOUBLE_INTERNALS_H_
+#ifndef RUNTIME_VM_DOUBLE_INTERNALS_H_
+#define RUNTIME_VM_DOUBLE_INTERNALS_H_
 
 #include "platform/utils.h"
 
 namespace dart {
 
 // We assume that doubles and uint64_t have the same endianness.
-static uint64_t double_to_uint64(double d) { return bit_cast<uint64_t>(d); }
+static uint64_t double_to_uint64(double d) {
+  return bit_cast<uint64_t>(d);
+}
 
 // Helper functions for doubles.
 class DoubleInternals {
@@ -20,9 +22,7 @@
   explicit DoubleInternals(double d) : d64_(double_to_uint64(d)) {}
 
   // Returns the double's bit as uint64.
-  uint64_t AsUint64() const {
-    return d64_;
-  }
+  uint64_t AsUint64() const { return d64_; }
 
   int Exponent() const {
     if (IsDenormal()) return kDenormalExponent;
@@ -58,7 +58,7 @@
 
   int Sign() const {
     uint64_t d64 = AsUint64();
-    return (d64 & kSignMask) == 0? 1: -1;
+    return (d64 & kSignMask) == 0 ? 1 : -1;
   }
 
  private:
@@ -77,4 +77,4 @@
 
 }  // namespace dart
 
-#endif  // VM_DOUBLE_INTERNALS_H_
+#endif  // RUNTIME_VM_DOUBLE_INTERNALS_H_
diff --git a/runtime/vm/exceptions.cc b/runtime/vm/exceptions.cc
index 7c9d71d..71eb55a 100644
--- a/runtime/vm/exceptions.cc
+++ b/runtime/vm/exceptions.cc
@@ -21,14 +21,17 @@
 
 namespace dart {
 
-DEFINE_FLAG(bool, print_stacktrace_at_throw, false,
+DECLARE_FLAG(bool, trace_deoptimization);
+DEFINE_FLAG(bool,
+            print_stacktrace_at_throw,
+            false,
             "Prints a stack trace everytime a throw occurs.");
 
 
 class StacktraceBuilder : public ValueObject {
  public:
-  StacktraceBuilder() { }
-  virtual ~StacktraceBuilder() { }
+  StacktraceBuilder() {}
+  virtual ~StacktraceBuilder() {}
 
   virtual void AddFrame(const Code& code, const Smi& offset) = 0;
 };
@@ -38,10 +41,10 @@
  public:
   explicit RegularStacktraceBuilder(Zone* zone)
       : code_list_(
-          GrowableObjectArray::Handle(zone, GrowableObjectArray::New())),
+            GrowableObjectArray::Handle(zone, GrowableObjectArray::New())),
         pc_offset_list_(
-          GrowableObjectArray::Handle(zone, GrowableObjectArray::New())) { }
-  ~RegularStacktraceBuilder() { }
+            GrowableObjectArray::Handle(zone, GrowableObjectArray::New())) {}
+  ~RegularStacktraceBuilder() {}
 
   const GrowableObjectArray& code_list() const { return code_list_; }
   const GrowableObjectArray& pc_offset_list() const { return pc_offset_list_; }
@@ -62,13 +65,13 @@
 class PreallocatedStacktraceBuilder : public StacktraceBuilder {
  public:
   explicit PreallocatedStacktraceBuilder(const Instance& stacktrace)
-  : stacktrace_(Stacktrace::Cast(stacktrace)),
+      : stacktrace_(Stacktrace::Cast(stacktrace)),
         cur_index_(0),
         dropped_frames_(0) {
     ASSERT(stacktrace_.raw() ==
            Isolate::Current()->object_store()->preallocated_stack_trace());
   }
-  ~PreallocatedStacktraceBuilder() { }
+  ~PreallocatedStacktraceBuilder() {}
 
   virtual void AddFrame(const Code& code, const Smi& offset);
 
@@ -128,6 +131,7 @@
   while (frame != NULL) {
     if (frame->IsDartFrame()) {
       code = frame->LookupDartCode();
+      ASSERT(code.ContainsInstructionAt(frame->pc()));
       offset = Smi::New(frame->pc() - code.PayloadStart());
       builder->AddFrame(code, offset);
     }
@@ -154,10 +158,8 @@
   uword temp_handler_pc = kUwordMax;
   while (!frame->IsEntryFrame()) {
     if (frame->IsDartFrame()) {
-      if (frame->FindExceptionHandler(thread,
-                                      &temp_handler_pc,
-                                      needs_stacktrace,
-                                      &is_catch_all)) {
+      if (frame->FindExceptionHandler(thread, &temp_handler_pc,
+                                      needs_stacktrace, &is_catch_all)) {
         if (!handler_pc_set) {
           handler_pc_set = true;
           *handler_pc = temp_handler_pc;
@@ -202,18 +204,91 @@
 }
 
 
+static uword RemapExceptionPCForDeopt(Thread* thread,
+                                      uword program_counter,
+                                      uword frame_pointer) {
+#if !defined(TARGET_ARCH_DBC)
+  MallocGrowableArray<PendingLazyDeopt>* pending_deopts =
+      thread->isolate()->pending_deopts();
+  if (pending_deopts->length() > 0) {
+    // Check if the target frame is scheduled for lazy deopt.
+    for (intptr_t i = 0; i < pending_deopts->length(); i++) {
+      if ((*pending_deopts)[i].fp() == frame_pointer) {
+        // Deopt should now resume in the catch handler instead of after the
+        // call.
+        (*pending_deopts)[i].set_pc(program_counter);
+
+        // Jump to the deopt stub instead of the catch handler.
+        program_counter =
+            StubCode::DeoptimizeLazyFromThrow_entry()->EntryPoint();
+        if (FLAG_trace_deoptimization) {
+          THR_Print("Throwing to frame scheduled for lazy deopt fp=%" Pp "\n",
+                    frame_pointer);
+        }
+        break;
+      }
+    }
+
+    // We may be jumping over frames scheduled for lazy deopt. Remove these
+    // frames from the pending deopt table, but only after unmarking them so
+    // any stack walk that happens before the stack is unwound will still work.
+    {
+      DartFrameIterator frames(thread);
+      StackFrame* frame = frames.NextFrame();
+      while ((frame != NULL) && (frame->fp() < frame_pointer)) {
+        if (frame->IsMarkedForLazyDeopt()) {
+          frame->UnmarkForLazyDeopt();
+        }
+        frame = frames.NextFrame();
+      }
+    }
+
+#if defined(DEBUG)
+    ValidateFrames();
+#endif
+
+    for (intptr_t i = 0; i < pending_deopts->length(); i++) {
+      if ((*pending_deopts)[i].fp() < frame_pointer) {
+        if (FLAG_trace_deoptimization) {
+          THR_Print(
+              "Lazy deopt skipped due to throw for "
+              "fp=%" Pp ", pc=%" Pp "\n",
+              (*pending_deopts)[i].fp(), (*pending_deopts)[i].pc());
+        }
+        pending_deopts->RemoveAt(i);
+      }
+    }
+
+#if defined(DEBUG)
+    ValidateFrames();
+#endif
+  }
+#endif  // !DBC
+  return program_counter;
+}
+
+
 static void JumpToExceptionHandler(Thread* thread,
                                    uword program_counter,
                                    uword stack_pointer,
                                    uword frame_pointer,
                                    const Object& exception_object,
                                    const Object& stacktrace_object) {
-  // The no_gc StackResource is unwound through the tear down of
-  // stack resources below.
-  NoSafepointScope no_safepoint;
-  RawObject* raw_exception = exception_object.raw();
-  RawObject* raw_stacktrace = stacktrace_object.raw();
+  uword remapped_pc =
+      RemapExceptionPCForDeopt(thread, program_counter, frame_pointer);
+  thread->set_active_exception(exception_object);
+  thread->set_active_stacktrace(stacktrace_object);
+  thread->set_resume_pc(remapped_pc);
+  uword run_exception_pc = StubCode::RunExceptionHandler_entry()->EntryPoint();
+  Exceptions::JumpToFrame(thread, run_exception_pc, stack_pointer,
+                          frame_pointer);
+}
 
+
+void Exceptions::JumpToFrame(Thread* thread,
+                             uword program_counter,
+                             uword stack_pointer,
+                             uword frame_pointer) {
 #if defined(USING_SIMULATOR)
   // Unwinding of the C++ frames and destroying of their stack resources is done
   // by the simulator, because the target stack_pointer is a simulated stack
@@ -223,8 +298,8 @@
   // exception object in the kExceptionObjectReg register and the stacktrace
   // object (may be raw null) in the kStackTraceObjectReg register.
 
-  Simulator::Current()->Longjmp(program_counter, stack_pointer, frame_pointer,
-                                raw_exception, raw_stacktrace, thread);
+  Simulator::Current()->JumpToFrame(program_counter, stack_pointer,
+                                    frame_pointer, thread);
 #else
   // Prepare for unwinding frames by destroying all the stack resources
   // in the previous frames.
@@ -233,18 +308,16 @@
   // Call a stub to set up the exception object in kExceptionObjectReg,
   // to set up the stacktrace object in kStackTraceObjectReg, and to
   // continue execution at the given pc in the given frame.
-  typedef void (*ExcpHandler)(uword, uword, uword, RawObject*, RawObject*,
-                              Thread*);
+  typedef void (*ExcpHandler)(uword, uword, uword, Thread*);
   ExcpHandler func = reinterpret_cast<ExcpHandler>(
-      StubCode::JumpToExceptionHandler_entry()->EntryPoint());
+      StubCode::JumpToFrame_entry()->EntryPoint());
 
   // Unpoison the stack before we tear it down in the generated stub code.
   uword current_sp = Thread::GetCurrentStackPointer() - 1024;
   ASAN_UNPOISON(reinterpret_cast<void*>(current_sp),
                 stack_pointer - current_sp);
 
-  func(program_counter, stack_pointer, frame_pointer,
-       raw_exception, raw_stacktrace, thread);
+  func(program_counter, stack_pointer, frame_pointer, thread);
 #endif
   UNREACHABLE();
 }
@@ -258,8 +331,8 @@
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
   Isolate* isolate = thread->isolate();
-  Class& error_class = Class::Handle(zone,
-                                     isolate->object_store()->error_class());
+  Class& error_class =
+      Class::Handle(zone, isolate->object_store()->error_class());
   if (error_class.IsNull()) {
     const Library& core_lib = Library::Handle(zone, Library::CoreLibrary());
     error_class = core_lib.LookupClass(Symbols::Error());
@@ -289,10 +362,10 @@
   BuildStackTrace(&frame_builder);
 
   // Create arrays for code and pc_offset tuples of each frame.
-  const Array& full_code_array = Array::Handle(zone,
-      Array::MakeArray(frame_builder.code_list()));
-  const Array& full_pc_offset_array = Array::Handle(zone,
-      Array::MakeArray(frame_builder.pc_offset_list()));
+  const Array& full_code_array =
+      Array::Handle(zone, Array::MakeArray(frame_builder.code_list()));
+  const Array& full_pc_offset_array =
+      Array::Handle(zone, Array::MakeArray(frame_builder.pc_offset_list()));
   const Stacktrace& full_stacktrace = Stacktrace::Handle(
       Stacktrace::New(full_code_array, full_pc_offset_array));
   return full_stacktrace.raw();
@@ -308,8 +381,8 @@
   bool use_preallocated_stacktrace = false;
   Instance& exception = Instance::Handle(zone, incoming_exception.raw());
   if (exception.IsNull()) {
-    exception ^= Exceptions::Create(Exceptions::kNullThrown,
-                                    Object::empty_array());
+    exception ^=
+        Exceptions::Create(Exceptions::kNullThrown, Object::empty_array());
   } else if (exception.raw() == isolate->object_store()->out_of_memory() ||
              exception.raw() == isolate->object_store()->stack_overflow()) {
     use_preallocated_stacktrace = true;
@@ -320,14 +393,11 @@
   Instance& stacktrace = Instance::Handle(zone);
   bool handler_exists = false;
   bool handler_needs_stacktrace = false;
+  // Find the exception handler and determine if the handler needs a
+  // stacktrace.
+  handler_exists = FindExceptionHandler(thread, &handler_pc, &handler_sp,
+                                        &handler_fp, &handler_needs_stacktrace);
   if (use_preallocated_stacktrace) {
-    stacktrace ^= isolate->object_store()->preallocated_stack_trace();
-    PreallocatedStacktraceBuilder frame_builder(stacktrace);
-    handler_exists = FindExceptionHandler(thread,
-                                          &handler_pc,
-                                          &handler_sp,
-                                          &handler_fp,
-                                          &handler_needs_stacktrace);
     if (handler_pc == 0) {
       // No Dart frame.
       ASSERT(incoming_exception.raw() ==
@@ -337,39 +407,33 @@
       thread->long_jump_base()->Jump(1, error);
       UNREACHABLE();
     }
+    stacktrace ^= isolate->object_store()->preallocated_stack_trace();
+    PreallocatedStacktraceBuilder frame_builder(stacktrace);
     if (handler_needs_stacktrace) {
       BuildStackTrace(&frame_builder);
     }
   } else {
-    // Get stacktrace field of class Error. This is needed to determine whether
-    // we have a subclass of Error which carries around its stack trace.
-    const Field& stacktrace_field =
-        Field::Handle(zone, LookupStacktraceField(exception));
-
-    // Find the exception handler and determine if the handler needs a
-    // stacktrace.
-    handler_exists = FindExceptionHandler(thread,
-                                          &handler_pc,
-                                          &handler_sp,
-                                          &handler_fp,
-                                          &handler_needs_stacktrace);
     if (!existing_stacktrace.IsNull()) {
       // If we have an existing stack trace then this better be a rethrow. The
       // reverse is not necessarily true (e.g. Dart_PropagateError can cause
       // a rethrow being called without an existing stacktrace.)
       ASSERT(is_rethrow);
-      ASSERT(stacktrace_field.IsNull() ||
-             (exception.GetField(stacktrace_field) != Object::null()));
       stacktrace = existing_stacktrace.raw();
-    } else if (!stacktrace_field.IsNull() || handler_needs_stacktrace) {
-      // Collect the stacktrace if needed.
-      ASSERT(existing_stacktrace.IsNull());
-      stacktrace = Exceptions::CurrentStacktrace();
-      // If we have an Error object, then set its stackTrace field only if it
-      // not yet initialized.
-      if (!stacktrace_field.IsNull() &&
-          (exception.GetField(stacktrace_field) == Object::null())) {
-        exception.SetField(stacktrace_field, stacktrace);
+    } else {
+      // Get stacktrace field of class Error to determine whether we have a
+      // subclass of Error which carries around its stack trace.
+      const Field& stacktrace_field =
+          Field::Handle(zone, LookupStacktraceField(exception));
+      if (!stacktrace_field.IsNull() || handler_needs_stacktrace) {
+        // Collect the stacktrace if needed.
+        ASSERT(existing_stacktrace.IsNull());
+        stacktrace = Exceptions::CurrentStacktrace();
+        // If we have an Error object, then set its stackTrace field only if it
+        // not yet initialized.
+        if (!stacktrace_field.IsNull() &&
+            (exception.GetField(stacktrace_field) == Object::null())) {
+          exception.SetField(stacktrace_field, stacktrace);
+        }
       }
     }
   }
@@ -385,12 +449,8 @@
   }
   if (handler_exists) {
     // Found a dart handler for the exception, jump to it.
-    JumpToExceptionHandler(thread,
-                           handler_pc,
-                           handler_sp,
-                           handler_fp,
-                           exception,
-                           stacktrace);
+    JumpToExceptionHandler(thread, handler_pc, handler_sp, handler_fp,
+                           exception, stacktrace);
   } else {
     // No dart exception handler found in this invocation sequence,
     // so we create an unhandled exception object and return to the
@@ -402,12 +462,8 @@
     const UnhandledException& unhandled_exception = UnhandledException::Handle(
         zone, UnhandledException::New(exception, stacktrace));
     stacktrace = Stacktrace::null();
-    JumpToExceptionHandler(thread,
-                           handler_pc,
-                           handler_sp,
-                           handler_fp,
-                           unhandled_exception,
-                           stacktrace);
+    JumpToExceptionHandler(thread, handler_pc, handler_sp, handler_fp,
+                           unhandled_exception, stacktrace);
   }
   UNREACHABLE();
 }
@@ -432,8 +488,8 @@
 RawInstance* Exceptions::NewInstance(const char* class_name) {
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
-  const String& cls_name = String::Handle(zone,
-                                          Symbols::New(thread, class_name));
+  const String& cls_name =
+      String::Handle(zone, Symbols::New(thread, class_name));
   const Library& core_lib = Library::Handle(Library::CoreLibrary());
   // No ambiguity error expected: passing NULL.
   Class& cls = Class::Handle(core_lib.LookupClass(cls_name));
@@ -456,16 +512,21 @@
 
   ExceptionType exception_type =
       (bound_error_msg.IsNull() &&
-       (dst_name.raw() == Symbols::InTypeCast().raw())) ? kCast : kType;
+       (dst_name.raw() == Symbols::InTypeCast().raw()))
+          ? kCast
+          : kType;
 
   DartFrameIterator iterator;
   const Script& script = Script::Handle(zone, GetCallerScript(&iterator));
-  intptr_t line;
+  intptr_t line = -1;
   intptr_t column = -1;
-  if (script.HasSource()) {
-    script.GetTokenLocation(location, &line, &column);
-  } else {
-    script.GetTokenLocation(location, &line, NULL);
+  ASSERT(!script.IsNull());
+  if (location.IsReal()) {
+    if (script.HasSource() || script.kind() == RawScript::kKernelTag) {
+      script.GetTokenLocation(location, &line, &column);
+    } else {
+      script.GetTokenLocation(location, &line, NULL);
+    }
   }
   // Initialize '_url', '_line', and '_column' arguments.
   args.SetAt(0, String::Handle(zone, script.url()));
@@ -473,8 +534,8 @@
   args.SetAt(2, Smi::Handle(zone, Smi::New(column)));
 
   // Construct '_errorMsg'.
-  const GrowableObjectArray& pieces = GrowableObjectArray::Handle(zone,
-      GrowableObjectArray::New(20));
+  const GrowableObjectArray& pieces =
+      GrowableObjectArray::Handle(zone, GrowableObjectArray::New(20));
 
   // Print bound error first, if any.
   if (!bound_error_msg.IsNull() && (bound_error_msg.Length() > 0)) {
@@ -559,10 +620,11 @@
     }
   }
   // Null object is a valid exception object.
-  ThrowExceptionHelper(thread, exception,
-      Stacktrace::Handle(thread->zone()), false);
+  ThrowExceptionHelper(thread, exception, Stacktrace::Handle(thread->zone()),
+                       false);
 }
 
+
 void Exceptions::ReThrow(Thread* thread,
                          const Instance& exception,
                          const Instance& stacktrace) {
@@ -737,10 +799,8 @@
       break;
   }
 
-  return DartLibraryCalls::InstanceCreate(library,
-                                          *class_name,
-                                          *constructor_name,
-                                          arguments);
+  return DartLibraryCalls::InstanceCreate(library, *class_name,
+                                          *constructor_name, arguments);
 }
 
 
diff --git a/runtime/vm/exceptions.h b/runtime/vm/exceptions.h
index e85f100..c3fc408 100644
--- a/runtime/vm/exceptions.h
+++ b/runtime/vm/exceptions.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_EXCEPTIONS_H_
-#define VM_EXCEPTIONS_H_
+#ifndef RUNTIME_VM_EXCEPTIONS_H_
+#define RUNTIME_VM_EXCEPTIONS_H_
 
 #include "vm/allocation.h"
 #include "vm/token_position.h"
@@ -80,10 +80,15 @@
   // otherwise returns a RawError.
   static RawObject* Create(ExceptionType type, const Array& arguments);
 
+  static void JumpToFrame(Thread* thread,
+                          uword program_counter,
+                          uword stack_pointer,
+                          uword frame_pointer);
+
  private:
   DISALLOW_COPY_AND_ASSIGN(Exceptions);
 };
 
 }  // namespace dart
 
-#endif  // VM_EXCEPTIONS_H_
+#endif  // RUNTIME_VM_EXCEPTIONS_H_
diff --git a/runtime/vm/exceptions_test.cc b/runtime/vm/exceptions_test.cc
index 355bc01..5fbfaa2 100644
--- a/runtime/vm/exceptions_test.cc
+++ b/runtime/vm/exceptions_test.cc
@@ -11,8 +11,7 @@
 
 
 #define FUNCTION_NAME(name) UnhandledExcp_##name
-#define REGISTER_FUNCTION(name, count)                                         \
-  { ""#name, FUNCTION_NAME(name), count },
+#define REGISTER_FUNCTION(name, count) {"" #name, FUNCTION_NAME(name), count},
 
 
 void FUNCTION_NAME(Unhandled_equals)(Dart_NativeArguments args) {
@@ -20,8 +19,8 @@
   const Instance& expected = Instance::CheckedHandle(arguments->NativeArgAt(0));
   const Instance& actual = Instance::CheckedHandle(arguments->NativeArgAt(1));
   if (!expected.CanonicalizeEquals(actual)) {
-    OS::Print("expected: '%s' actual: '%s'\n",
-        expected.ToCString(), actual.ToCString());
+    OS::Print("expected: '%s' actual: '%s'\n", expected.ToCString(),
+              actual.ToCString());
     FATAL("Unhandled_equals fails.\n");
   }
 }
@@ -30,10 +29,7 @@
 void FUNCTION_NAME(Unhandled_invoke)(Dart_NativeArguments args) {
   // Invoke the specified entry point.
   Dart_Handle cls = Dart_GetClass(TestCase::lib(), NewString("Second"));
-  Dart_Handle result = Dart_Invoke(cls,
-                                   NewString("method2"),
-                                   0,
-                                   NULL);
+  Dart_Handle result = Dart_Invoke(cls, NewString("method2"), 0, NULL);
   ASSERT(Dart_IsError(result));
   ASSERT(Dart_ErrorHasException(result));
   return;
@@ -43,10 +39,7 @@
 void FUNCTION_NAME(Unhandled_invoke2)(Dart_NativeArguments args) {
   // Invoke the specified entry point.
   Dart_Handle cls = Dart_GetClass(TestCase::lib(), NewString("Second"));
-  Dart_Handle result = Dart_Invoke(cls,
-                                   NewString("method2"),
-                                   0,
-                                   NULL);
+  Dart_Handle result = Dart_Invoke(cls, NewString("method2"), 0, NULL);
   ASSERT(Dart_IsError(result));
   ASSERT(Dart_ErrorHasException(result));
   Dart_Handle exception = Dart_ErrorGetException(result);
@@ -63,16 +56,14 @@
 #define UNHANDLED_NATIVE_LIST(V)                                               \
   V(Unhandled_equals, 2)                                                       \
   V(Unhandled_invoke, 0)                                                       \
-  V(Unhandled_invoke2, 0)                                                      \
+  V(Unhandled_invoke2, 0)
 
 
 static struct NativeEntries {
   const char* name_;
   Dart_NativeFunction function_;
   int argument_count_;
-} BuiltinEntries[] = {
-  UNHANDLED_NATIVE_LIST(REGISTER_FUNCTION)
-};
+} BuiltinEntries[] = {UNHANDLED_NATIVE_LIST(REGISTER_FUNCTION)};
 
 
 static Dart_NativeFunction native_lookup(Dart_Handle name,
@@ -127,8 +118,7 @@
       "  UnhandledExceptions.equals(3, Second.method3(1));\n"
       "}";
   Dart_Handle lib = TestCase::LoadTestScript(
-      kScriptChars,
-      reinterpret_cast<Dart_NativeEntryResolver>(native_lookup));
+      kScriptChars, reinterpret_cast<Dart_NativeEntryResolver>(native_lookup));
   EXPECT_VALID(Dart_Invoke(lib, NewString("testMain"), 0, NULL));
 }
 
diff --git a/runtime/vm/find_code_object_test.cc b/runtime/vm/find_code_object_test.cc
index 75ffa2b..a47129e 100644
--- a/runtime/vm/find_code_object_test.cc
+++ b/runtime/vm/find_code_object_test.cc
@@ -48,13 +48,10 @@
   // Load up class A with 1024 functions.
   int written = OS::SNPrint(scriptChars, kScriptSize, "class A {");
   for (int i = 0; i < kNumFunctions; i++) {
-    OS::SNPrint(buffer,
-                256,
+    OS::SNPrint(buffer, 256,
                 "static foo%d([int i=1,int j=2,int k=3]){return i+j+k;}", i);
-    written += OS::SNPrint((scriptChars + written),
-                           (kScriptSize - written),
-                           "%s",
-                           buffer);
+    written += OS::SNPrint((scriptChars + written), (kScriptSize - written),
+                           "%s", buffer);
   }
   OS::SNPrint((scriptChars + written), (kScriptSize - written), "}");
   source = String::New(scriptChars);
@@ -78,32 +75,23 @@
   written = OS::SNPrint(scriptChars, kScriptSize, "class B {");
   // Create one large function.
   OS::SNPrint(buffer, sizeof(buffer), "static moo0([var i=1]) { ");
-  written += OS::SNPrint((scriptChars + written),
-                         (kScriptSize - written),
-                         "%s",
+  written += OS::SNPrint((scriptChars + written), (kScriptSize - written), "%s",
                          buffer);
   // Generate a large function so that the code for this function when
   // compiled will reside in a large page.
   for (int i = 0; i < kLoopCount; i++) {
     OS::SNPrint(buffer, sizeof(buffer), "i = i+i;");
-    written += OS::SNPrint((scriptChars + written),
-                           (kScriptSize - written),
-                           "%s",
-                           buffer);
+    written += OS::SNPrint((scriptChars + written), (kScriptSize - written),
+                           "%s", buffer);
   }
   OS::SNPrint(buffer, sizeof(buffer), "return i; }");
-  written += OS::SNPrint((scriptChars + written),
-                         (kScriptSize - written),
-                         "%s",
+  written += OS::SNPrint((scriptChars + written), (kScriptSize - written), "%s",
                          buffer);
   for (int i = 1; i < kNumFunctions; i++) {
-    OS::SNPrint(buffer,
-                256,
+    OS::SNPrint(buffer, 256,
                 "static moo%d([int i=1,int j=2,int k=3]){return i+j+k;}", i);
-    written += OS::SNPrint((scriptChars + written),
-                           (kScriptSize - written),
-                           "%s",
-                           buffer);
+    written += OS::SNPrint((scriptChars + written), (kScriptSize - written),
+                           "%s", buffer);
   }
   OS::SNPrint((scriptChars + written), (kScriptSize - written), "}");
   url = String::New("dart-test:FindCodeObject");
diff --git a/runtime/vm/flag_list.h b/runtime/vm/flag_list.h
index 3a54ca8..c59746e 100644
--- a/runtime/vm/flag_list.h
+++ b/runtime/vm/flag_list.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_FLAG_LIST_H_
-#define VM_FLAG_LIST_H_
+#ifndef RUNTIME_VM_FLAG_LIST_H_
+#define RUNTIME_VM_FLAG_LIST_H_
 
 // Don't use USING_DBC outside of this file.
 #if defined(TARGET_ARCH_DBC)
@@ -41,162 +41,127 @@
 //   D(name, type, default_value, comment)
 //   C(name, precompiled_value, product_value, type, default_value, comment)
 #define FLAG_LIST(P, R, D, C)                                                  \
-P(background_compilation, bool, USING_MULTICORE,                               \
-  "Run optimizing compilation in background")                                  \
-R(background_compilation_stop_alot, false, bool, false,                        \
-  "Stress test system: stop background compiler often.")                       \
-P(background_finalization, bool, USING_MULTICORE,                              \
-  "Run weak handle finalizers in background")                                  \
-R(break_at_isolate_spawn, false, bool, false,                                  \
-  "Insert a one-time breakpoint at the entrypoint for all spawned isolates")   \
-C(collect_code, false, true, bool, true,                                       \
-  "Attempt to GC infrequently used code.")                                     \
-P(collect_dynamic_function_names, bool, true,                                  \
-  "Collects all dynamic function names to identify unique targets")            \
-R(concurrent_sweep, USING_MULTICORE, bool, USING_MULTICORE,                    \
-  "Concurrent sweep for old generation.")                                      \
-R(dedup_instructions, true, bool, false,                                       \
-  "Canonicalize instructions when precompiling.")                              \
-C(deoptimize_alot, false, false, bool, false,                                  \
-  "Deoptimizes we are about to return to Dart code from native entries.")      \
-C(deoptimize_every, 0, 0, int, 0,                                              \
-  "Deoptimize on every N stack overflow checks")                               \
-R(disable_alloc_stubs_after_gc, false, bool, false,                            \
-  "Stress testing flag.")                                                      \
-R(disassemble, false, bool, false,                                             \
-  "Disassemble dart code.")                                                    \
-R(disassemble_optimized, false, bool, false,                                   \
-  "Disassemble optimized code.")                                               \
-R(dump_megamorphic_stats, false, bool, false,                                  \
-  "Dump megamorphic cache statistics")                                         \
-R(dump_symbol_stats, false, bool, false,                                       \
-  "Dump symbol table statistics")                                              \
-R(enable_asserts, false, bool, false,                                          \
-  "Enable assert statements.")                                                 \
-C(enable_mirrors, false, false, bool, true,                                    \
-  "Disable to make importing dart:mirrors an error.")                          \
-R(enable_type_checks, false, bool, false,                                      \
-  "Enable type checks.")                                                       \
-R(error_on_bad_override, false, bool, false,                                   \
-  "Report error for bad overrides.")                                           \
-R(error_on_bad_type, false, bool, false,                                       \
-  "Report error for malformed types.")                                         \
-P(external_max_size, int, (kWordSize <= 4) ? 512 : 1024,                       \
-  "Max total size of external allocations in MB, or 0 for unlimited,"          \
-  "e.g: --external_max_size=1024 allows up to 1024MB of externals")            \
-P(fields_may_be_reset, bool, false,                                            \
-  "Don't optimize away static field initialization")                           \
-C(force_clone_compiler_objects, false, false, bool, false,                     \
-  "Force cloning of objects needed in compiler (ICData and Field).")           \
-R(gc_at_alloc, false, bool, false,                                             \
-  "GC at every allocation.")                                                   \
-P(getter_setter_ratio, int, 13,                                                \
-  "Ratio of getter/setter usage used for double field unboxing heuristics")    \
-P(guess_icdata_cid, bool, true,                                                \
-  "Artificially create type feedback for arithmetic etc. operations")          \
-P(huge_method_cutoff_in_tokens, int, 20000,                                    \
-  "Huge method cutoff in tokens: Disables optimizations for huge methods.")    \
-P(interpret_irregexp, bool, USING_DBC,                                         \
-  "Use irregexp bytecode interpreter")                                         \
-P(lazy_dispatchers, bool, true,                                                \
-  "Generate dispatchers lazily")                                               \
-P(link_natives_lazily, bool, false,                                            \
-  "Link native calls lazily")                                                  \
-C(load_deferred_eagerly, true, true, bool, false,                              \
-  "Load deferred libraries eagerly.")                                          \
-R(log_marker_tasks, false, bool, false,                                        \
-  "Log debugging information for old gen GC marking tasks.")                   \
-R(marker_tasks, USING_MULTICORE ? 2 : 0, int, USING_MULTICORE ? 2 : 0,         \
-  "The number of tasks to spawn during old gen GC marking (0 means "           \
-  "perform all marking on main thread).")                                      \
-P(max_polymorphic_checks, int, 4,                                              \
-  "Maximum number of polymorphic check, otherwise it is megamorphic.")         \
-P(max_equality_polymorphic_checks, int, 32,                                    \
-  "Maximum number of polymorphic checks in equality operator,")                \
-P(merge_sin_cos, bool, false,                                                  \
-  "Merge sin/cos into sincos")                                                 \
-P(new_gen_ext_limit, int, 64,                                                  \
-  "maximum total external size (MB) in new gen before triggering GC")          \
-P(new_gen_semi_max_size, int, (kWordSize <= 4) ? 16 : 32,                      \
-  "Max size of new gen semi space in MB")                                      \
-P(optimization_counter_threshold, int, 30000,                                  \
-  "Function's usage-counter value before it is optimized, -1 means never")     \
-P(old_gen_heap_size, int, (kWordSize <= 4) ? 1536 : 0,                         \
-  "Max size of old gen heap size in MB, or 0 for unlimited,"                   \
-  "e.g: --old_gen_heap_size=1024 allows up to 1024MB old gen heap")            \
-R(pause_isolates_on_start, false, bool, false,                                 \
-  "Pause isolates before starting.")                                           \
-R(pause_isolates_on_exit, false, bool, false,                                  \
-  "Pause isolates exiting.")                                                   \
-R(pause_isolates_on_unhandled_exceptions, false, bool, false,                  \
-  "Pause isolates on unhandled exceptions.")                                   \
-P(polymorphic_with_deopt, bool, true,                                          \
-  "Polymorphic calls with deoptimization / megamorphic call")                  \
-P(precompiled_mode, bool, false,                                               \
-  "Precompilation compiler mode")                                              \
-C(precompiled_runtime, true, false, bool, false,                               \
-  "Precompiled runtime mode")                                                  \
-R(print_ssa_liveranges, false, bool, false,                                    \
-  "Print live ranges after allocation.")                                       \
-C(print_stop_message, false, false, bool, false,                               \
-  "Print stop message.")                                                       \
-D(print_variable_descriptors, bool, false,                                     \
-  "Print variable descriptors in disassembly.")                                \
-R(profiler, false, bool, !USING_DBC && !USING_FUCHSIA,                         \
-  "Enable the profiler.")                                                      \
-P(reorder_basic_blocks, bool, true,                                            \
-  "Reorder basic blocks")                                                      \
-R(support_ast_printer, false, bool, true,                                      \
-  "Support the AST printer.")                                                  \
-R(support_compiler_stats, false, bool, true,                                   \
-  "Support compiler stats.")                                                   \
-C(support_debugger, false, false, bool, true,                                  \
-  "Support the debugger.")                                                     \
-R(support_disassembler, false, bool, true,                                     \
-  "Support the disassembler.")                                                 \
-R(support_il_printer, false, bool, true,                                       \
-  "Support the IL printer.")                                                   \
-C(support_reload, false, false, bool, true,                                    \
-  "Support isolate reload.")                                                   \
-R(support_service, false, bool, true,                                          \
-  "Support the service protocol.")                                             \
-R(support_timeline, false, bool, true,                                         \
-  "Support timeline.")                                                         \
-D(trace_cha, bool, false,                                                      \
-  "Trace CHA operations")                                                      \
-D(trace_field_guards, bool, false,                                             \
-  "Trace changes in field's cids.")                                            \
-D(trace_isolates, bool, false,                                                 \
-  "Trace isolate creation and shut down.")                                     \
-D(trace_handles, bool, false,                                                  \
-  "Traces allocation of handles.")                                             \
-D(trace_optimization, bool, false,                                             \
-  "Print optimization details.");                                              \
-R(trace_profiler, false, bool, false,                                          \
-  "Profiler trace")                                                            \
-D(trace_profiler_verbose, bool, false,                                         \
-  "Verbose profiler trace")                                                    \
-D(trace_ssa_allocator, bool, false,                                            \
-  "Trace register allocation over SSA.")                                       \
-D(trace_zones, bool, false,                                                    \
-  "Traces allocation sizes in the zone.")                                      \
-P(truncating_left_shift, bool, true,                                           \
-  "Optimize left shift to truncate if possible")                               \
-P(use_cha_deopt, bool, true,                                                   \
-  "Use class hierarchy analysis even if it can cause deoptimization.")         \
-P(use_field_guards, bool, !USING_DBC,                                          \
-  "Use field guards and track field types")                                    \
-C(use_osr, false, true, bool, true,                                            \
-  "Use OSR")                                                                   \
-P(verbose_gc, bool, false,                                                     \
-  "Enables verbose GC.")                                                       \
-P(verbose_gc_hdr, int, 40,                                                     \
-  "Print verbose GC header interval.")                                         \
-R(verify_after_gc, false, bool, false,                                         \
-  "Enables heap verification after GC.")                                       \
-R(verify_before_gc, false, bool, false,                                        \
-  "Enables heap verification before GC.")                                      \
-D(verify_on_transition, bool, false,                                           \
-  "Verify on dart <==> VM.")                                                   \
+  P(background_compilation, bool, USING_MULTICORE,                             \
+    "Run optimizing compilation in background")                                \
+  R(background_compilation_stop_alot, false, bool, false,                      \
+    "Stress test system: stop background compiler often.")                     \
+  P(background_finalization, bool, USING_MULTICORE,                            \
+    "Run weak handle finalizers in background")                                \
+  R(break_at_isolate_spawn, false, bool, false,                                \
+    "Insert a one-time breakpoint at the entrypoint for all spawned isolates") \
+  C(collect_code, false, true, bool, true,                                     \
+    "Attempt to GC infrequently used code.")                                   \
+  P(collect_dynamic_function_names, bool, true,                                \
+    "Collects all dynamic function names to identify unique targets")          \
+  R(concurrent_sweep, USING_MULTICORE, bool, USING_MULTICORE,                  \
+    "Concurrent sweep for old generation.")                                    \
+  R(dedup_instructions, true, bool, false,                                     \
+    "Canonicalize instructions when precompiling.")                            \
+  C(deoptimize_alot, false, false, bool, false,                                \
+    "Deoptimizes we are about to return to Dart code from native entries.")    \
+  C(deoptimize_every, 0, 0, int, 0,                                            \
+    "Deoptimize on every N stack overflow checks")                             \
+  R(disable_alloc_stubs_after_gc, false, bool, false, "Stress testing flag.")  \
+  R(disassemble, false, bool, false, "Disassemble dart code.")                 \
+  R(disassemble_optimized, false, bool, false, "Disassemble optimized code.")  \
+  R(dump_megamorphic_stats, false, bool, false,                                \
+    "Dump megamorphic cache statistics")                                       \
+  R(dump_symbol_stats, false, bool, false, "Dump symbol table statistics")     \
+  R(enable_asserts, false, bool, false, "Enable assert statements.")           \
+  C(enable_mirrors, false, false, bool, true,                                  \
+    "Disable to make importing dart:mirrors an error.")                        \
+  R(enable_type_checks, false, bool, false, "Enable type checks.")             \
+  R(error_on_bad_override, false, bool, false,                                 \
+    "Report error for bad overrides.")                                         \
+  R(error_on_bad_type, false, bool, false,                                     \
+    "Report error for malformed types.")                                       \
+  P(external_max_size, int, (kWordSize <= 4) ? 512 : 1024,                     \
+    "Max total size of external allocations in MB, or 0 for unlimited,"        \
+    "e.g: --external_max_size=1024 allows up to 1024MB of externals")          \
+  P(fields_may_be_reset, bool, false,                                          \
+    "Don't optimize away static field initialization")                         \
+  C(force_clone_compiler_objects, false, false, bool, false,                   \
+    "Force cloning of objects needed in compiler (ICData and Field).")         \
+  R(gc_at_alloc, false, bool, false, "GC at every allocation.")                \
+  P(getter_setter_ratio, int, 13,                                              \
+    "Ratio of getter/setter usage used for double field unboxing heuristics")  \
+  P(guess_icdata_cid, bool, true,                                              \
+    "Artificially create type feedback for arithmetic etc. operations")        \
+  P(huge_method_cutoff_in_tokens, int, 20000,                                  \
+    "Huge method cutoff in tokens: Disables optimizations for huge methods.")  \
+  P(interpret_irregexp, bool, USING_DBC, "Use irregexp bytecode interpreter")  \
+  P(lazy_dispatchers, bool, true, "Generate dispatchers lazily")               \
+  P(link_natives_lazily, bool, false, "Link native calls lazily")              \
+  C(load_deferred_eagerly, true, true, bool, false,                            \
+    "Load deferred libraries eagerly.")                                        \
+  R(log_marker_tasks, false, bool, false,                                      \
+    "Log debugging information for old gen GC marking tasks.")                 \
+  R(marker_tasks, USING_MULTICORE ? 2 : 0, int, USING_MULTICORE ? 2 : 0,       \
+    "The number of tasks to spawn during old gen GC marking (0 means "         \
+    "perform all marking on main thread).")                                    \
+  P(max_polymorphic_checks, int, 4,                                            \
+    "Maximum number of polymorphic check, otherwise it is megamorphic.")       \
+  P(max_equality_polymorphic_checks, int, 32,                                  \
+    "Maximum number of polymorphic checks in equality operator,")              \
+  P(merge_sin_cos, bool, false, "Merge sin/cos into sincos")                   \
+  P(new_gen_ext_limit, int, 64,                                                \
+    "maximum total external size (MB) in new gen before triggering GC")        \
+  P(new_gen_semi_max_size, int, (kWordSize <= 4) ? 16 : 32,                    \
+    "Max size of new gen semi space in MB")                                    \
+  P(optimization_counter_threshold, int, 30000,                                \
+    "Function's usage-counter value before it is optimized, -1 means never")   \
+  P(old_gen_heap_size, int, (kWordSize <= 4) ? 1536 : 0,                       \
+    "Max size of old gen heap size in MB, or 0 for unlimited,"                 \
+    "e.g: --old_gen_heap_size=1024 allows up to 1024MB old gen heap")          \
+  R(pause_isolates_on_start, false, bool, false,                               \
+    "Pause isolates before starting.")                                         \
+  R(pause_isolates_on_exit, false, bool, false, "Pause isolates exiting.")     \
+  R(pause_isolates_on_unhandled_exceptions, false, bool, false,                \
+    "Pause isolates on unhandled exceptions.")                                 \
+  P(polymorphic_with_deopt, bool, true,                                        \
+    "Polymorphic calls with deoptimization / megamorphic call")                \
+  P(precompiled_mode, bool, false, "Precompilation compiler mode")             \
+  C(precompiled_runtime, true, false, bool, false, "Precompiled runtime mode") \
+  P(print_snapshot_sizes, bool, false, "Print sizes of generated snapshots.")  \
+  R(print_ssa_liveranges, false, bool, false,                                  \
+    "Print live ranges after allocation.")                                     \
+  C(print_stop_message, false, false, bool, false, "Print stop message.")      \
+  D(print_variable_descriptors, bool, false,                                   \
+    "Print variable descriptors in disassembly.")                              \
+  R(profiler, false, bool, !USING_DBC && !USING_FUCHSIA,                       \
+    "Enable the profiler.")                                                    \
+  P(reorder_basic_blocks, bool, true, "Reorder basic blocks")                  \
+  R(support_ast_printer, false, bool, true, "Support the AST printer.")        \
+  R(support_compiler_stats, false, bool, true, "Support compiler stats.")      \
+  C(support_debugger, false, false, bool, true, "Support the debugger.")       \
+  R(support_disassembler, false, bool, true, "Support the disassembler.")      \
+  R(support_il_printer, false, bool, true, "Support the IL printer.")          \
+  C(support_reload, false, false, bool, true, "Support isolate reload.")       \
+  R(support_service, false, bool, true, "Support the service protocol.")       \
+  R(support_timeline, false, bool, true, "Support timeline.")                  \
+  D(trace_cha, bool, false, "Trace CHA operations")                            \
+  D(trace_field_guards, bool, false, "Trace changes in field's cids.")         \
+  D(trace_isolates, bool, false, "Trace isolate creation and shut down.")      \
+  D(trace_handles, bool, false, "Traces allocation of handles.")               \
+  D(trace_kernel_binary, bool, false, "Trace Kernel reader/writer.")           \
+  D(trace_optimization, bool, false, "Print optimization details.")            \
+  R(trace_profiler, false, bool, false, "Profiler trace")                      \
+  D(trace_profiler_verbose, bool, false, "Verbose profiler trace")             \
+  D(trace_ssa_allocator, bool, false, "Trace register allocation over SSA.")   \
+  D(trace_zones, bool, false, "Traces allocation sizes in the zone.")          \
+  P(truncating_left_shift, bool, true,                                         \
+    "Optimize left shift to truncate if possible")                             \
+  P(use_cha_deopt, bool, true,                                                 \
+    "Use class hierarchy analysis even if it can cause deoptimization.")       \
+  P(use_field_guards, bool, !USING_DBC,                                        \
+    "Use field guards and track field types")                                  \
+  C(use_osr, false, true, bool, true, "Use OSR")                               \
+  P(verbose_gc, bool, false, "Enables verbose GC.")                            \
+  P(verbose_gc_hdr, int, 40, "Print verbose GC header interval.")              \
+  R(verify_after_gc, false, bool, false,                                       \
+    "Enables heap verification after GC.")                                     \
+  R(verify_before_gc, false, bool, false,                                      \
+    "Enables heap verification before GC.")                                    \
+  D(verify_on_transition, bool, false, "Verify on dart <==> VM.")
 
-#endif  // VM_FLAG_LIST_H_
+#endif  // RUNTIME_VM_FLAG_LIST_H_
diff --git a/runtime/vm/flags.cc b/runtime/vm/flags.cc
index 8c5a9d8..dad1410 100644
--- a/runtime/vm/flags.cc
+++ b/runtime/vm/flags.cc
@@ -11,21 +11,19 @@
 namespace dart {
 
 DEFINE_FLAG(bool, print_flags, false, "Print flags as they are being parsed.");
-DEFINE_FLAG(bool, ignore_unrecognized_flags, false,
-    "Ignore unrecognized flags.");
+DEFINE_FLAG(bool,
+            ignore_unrecognized_flags,
+            false,
+            "Ignore unrecognized flags.");
 
-#define PRODUCT_FLAG_MARCO(name, type, default_value, comment) \
-  type FLAG_##name = Flags::Register_##type(&FLAG_##name,                      \
-                                            #name,                             \
-                                            default_value,                     \
-                                            comment);
+#define PRODUCT_FLAG_MARCO(name, type, default_value, comment)                 \
+  type FLAG_##name =                                                           \
+      Flags::Register_##type(&FLAG_##name, #name, default_value, comment);
 
 #if defined(DEBUG)
-#define DEBUG_FLAG_MARCO(name, type, default_value, comment) \
-  type FLAG_##name = Flags::Register_##type(&FLAG_##name,                      \
-                                            #name,                             \
-                                            default_value,                     \
-                                            comment);
+#define DEBUG_FLAG_MARCO(name, type, default_value, comment)                   \
+  type FLAG_##name =                                                           \
+      Flags::Register_##type(&FLAG_##name, #name, default_value, comment);
 #else  // defined(DEBUG)
 #define DEBUG_FLAG_MARCO(name, type, default_value, comment)
 #endif  // defined(DEBUG)
@@ -46,26 +44,20 @@
 
 #elif defined(DART_PRECOMPILED_RUNTIME)  // !PRODUCT
 #define RELEASE_FLAG_MARCO(name, product_value, type, default_value, comment)  \
-  type FLAG_##name = Flags::Register_##type(&FLAG_##name,                      \
-                                            #name,                             \
-                                            default_value,                     \
-                                            comment);
+  type FLAG_##name =                                                           \
+      Flags::Register_##type(&FLAG_##name, #name, default_value, comment);
 // Nothing to be done for the precompilation flag definitions.
 #define PRECOMPILE_FLAG_MARCO(name, pre_value, product_value, type,            \
                               default_value, comment)
 
 #else  // !PRODUCT && !PRECOMPILED
 #define RELEASE_FLAG_MARCO(name, product_value, type, default_value, comment)  \
-  type FLAG_##name = Flags::Register_##type(&FLAG_##name,                      \
-                                            #name,                             \
-                                            default_value,                     \
-                                            comment);
+  type FLAG_##name =                                                           \
+      Flags::Register_##type(&FLAG_##name, #name, default_value, comment);
 #define PRECOMPILE_FLAG_MARCO(name, pre_value, product_value, type,            \
                               default_value, comment)                          \
-  type FLAG_##name = Flags::Register_##type(&FLAG_##name,                      \
-                                            #name,                             \
-                                            default_value,                     \
-                                            comment);
+  type FLAG_##name =                                                           \
+      Flags::Register_##type(&FLAG_##name, #name, default_value, comment);
 #endif
 
 
@@ -90,21 +82,12 @@
 
 class Flag {
  public:
-  enum FlagType {
-    kBoolean,
-    kInteger,
-    kUint64,
-    kString,
-    kFunc,
-    kNumFlagTypes
-  };
+  enum FlagType { kBoolean, kInteger, kUint64, kString, kFunc, kNumFlagTypes };
 
   Flag(const char* name, const char* comment, void* addr, FlagType type)
-      : name_(name), comment_(comment), addr_(addr), type_(type) {
-  }
+      : name_(name), comment_(comment), addr_(addr), type_(type) {}
   Flag(const char* name, const char* comment, FlagHandler handler)
-      : name_(name), comment_(comment), handler_(handler), type_(kFunc) {
-  }
+      : name_(name), comment_(comment), handler_(handler), type_(kFunc) {}
 
   void Print() {
     if (IsUnrecognized()) {
@@ -113,8 +96,8 @@
     }
     switch (type_) {
       case kBoolean: {
-        OS::Print("%s: %s (%s)\n",
-            name_, *this->bool_ptr_ ? "true" : "false", comment_);
+        OS::Print("%s: %s (%s)\n", name_, *this->bool_ptr_ ? "true" : "false",
+                  comment_);
         break;
       }
       case kInteger: {
@@ -175,10 +158,8 @@
 
 bool Flags::IsSet(const char* name) {
   Flag* flag = Lookup(name);
-  return (flag != NULL) &&
-         (flag->type_ == Flag::kBoolean) &&
-         (flag->bool_ptr_ != NULL) &&
-         (*flag->bool_ptr_ == true);
+  return (flag != NULL) && (flag->type_ == Flag::kBoolean) &&
+         (flag->bool_ptr_ != NULL) && (*flag->bool_ptr_ == true);
 }
 
 
@@ -194,7 +175,7 @@
       for (intptr_t i = 0; i < num_flags_; i++) {
         new_flags[i] = flags_[i];
       }
-      delete [] flags_;
+      delete[] flags_;
       flags_ = new_flags;
       capacity_ = new_capacity;
     }
@@ -412,8 +393,8 @@
 
 
 int Flags::CompareFlagNames(const void* left, const void* right) {
-  const Flag* left_flag = *reinterpret_cast<const Flag* const *>(left);
-  const Flag* right_flag = *reinterpret_cast<const Flag* const *>(right);
+  const Flag* left_flag = *reinterpret_cast<const Flag* const*>(left);
+  const Flag* right_flag = *reinterpret_cast<const Flag* const*>(right);
   return strcmp(left_flag->name_, right_flag->name_);
 }
 
@@ -463,9 +444,7 @@
   return true;
 }
 
-bool Flags::SetFlag(const char* name,
-                    const char* value,
-                    const char** error) {
+bool Flags::SetFlag(const char* name, const char* value, const char** error) {
   Flag* flag = Lookup(name);
   if (flag == NULL) {
     *error = "Cannot set flag: flag not found";
diff --git a/runtime/vm/flags.h b/runtime/vm/flags.h
index b30299c..f5cb8f3 100644
--- a/runtime/vm/flags.h
+++ b/runtime/vm/flags.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_FLAGS_H_
-#define VM_FLAGS_H_
+#ifndef RUNTIME_VM_FLAGS_H_
+#define RUNTIME_VM_FLAGS_H_
 
 #include "platform/assert.h"
 #include "vm/flag_list.h"
@@ -11,14 +11,11 @@
 
 typedef const char* charp;
 
-#define DECLARE_FLAG(type, name)                                               \
-  extern type FLAG_##name
+#define DECLARE_FLAG(type, name) extern type FLAG_##name
 
 #define DEFINE_FLAG(type, name, default_value, comment)                        \
-  type FLAG_##name = Flags::Register_##type(&FLAG_##name,                      \
-                                            #name,                             \
-                                            default_value,                     \
-                                            comment);
+  type FLAG_##name =                                                           \
+      Flags::Register_##type(&FLAG_##name, #name, default_value, comment);
 
 #define DEFINE_FLAG_HANDLER(handler, name, comment)                            \
   bool DUMMY_##name = Flags::Register_func(handler, #name, comment);
@@ -71,9 +68,7 @@
   static void PrintJSON(JSONStream* js);
 #endif  // !PRODUCT
 
-  static bool SetFlag(const char* name,
-                      const char* value,
-                      const char** error);
+  static bool SetFlag(const char* name, const char* value, const char** error);
 
  private:
   static Flag** flags_;
@@ -103,7 +98,7 @@
   DISALLOW_IMPLICIT_CONSTRUCTORS(Flags);
 };
 
-#define PRODUCT_FLAG_MARCO(name, type, default_value, comment) \
+#define PRODUCT_FLAG_MARCO(name, type, default_value, comment)                 \
   extern type FLAG_##name;
 
 #if defined(DEBUG)
@@ -157,4 +152,4 @@
 
 }  // namespace dart
 
-#endif  // VM_FLAGS_H_
+#endif  // RUNTIME_VM_FLAGS_H_
diff --git a/runtime/vm/flow_graph.cc b/runtime/vm/flow_graph.cc
index f513b30..4eb78fa 100644
--- a/runtime/vm/flow_graph.cc
+++ b/runtime/vm/flow_graph.cc
@@ -26,36 +26,34 @@
 FlowGraph::FlowGraph(const ParsedFunction& parsed_function,
                      GraphEntryInstr* graph_entry,
                      intptr_t max_block_id)
-  : thread_(Thread::Current()),
-    parent_(),
-    current_ssa_temp_index_(0),
-    max_block_id_(max_block_id),
-    parsed_function_(parsed_function),
-    num_copied_params_(parsed_function.num_copied_params()),
-    num_non_copied_params_(parsed_function.num_non_copied_params()),
-    graph_entry_(graph_entry),
-    preorder_(),
-    postorder_(),
-    reverse_postorder_(),
-    optimized_block_order_(),
-    constant_null_(NULL),
-    constant_dead_(NULL),
-    constant_empty_context_(NULL),
-    block_effects_(NULL),
-    licm_allowed_(true),
-    loop_headers_(NULL),
-    loop_invariant_loads_(NULL),
-    deferred_prefixes_(parsed_function.deferred_prefixes()),
-    captured_parameters_(new(zone()) BitVector(zone(), variable_count())),
-    inlining_id_(-1) {
+    : thread_(Thread::Current()),
+      parent_(),
+      current_ssa_temp_index_(0),
+      max_block_id_(max_block_id),
+      parsed_function_(parsed_function),
+      num_copied_params_(parsed_function.num_copied_params()),
+      num_non_copied_params_(parsed_function.num_non_copied_params()),
+      graph_entry_(graph_entry),
+      preorder_(),
+      postorder_(),
+      reverse_postorder_(),
+      optimized_block_order_(),
+      constant_null_(NULL),
+      constant_dead_(NULL),
+      constant_empty_context_(NULL),
+      block_effects_(NULL),
+      licm_allowed_(true),
+      loop_headers_(NULL),
+      loop_invariant_loads_(NULL),
+      deferred_prefixes_(parsed_function.deferred_prefixes()),
+      captured_parameters_(new (zone()) BitVector(zone(), variable_count())),
+      inlining_id_(-1) {
   DiscoverBlocks();
 }
 
 
-void FlowGraph::EnsureSSATempIndex(Definition* defn,
-                                   Definition* replacement) {
-  if ((replacement->ssa_temp_index() == -1) &&
-      (defn->ssa_temp_index() != -1)) {
+void FlowGraph::EnsureSSATempIndex(Definition* defn, Definition* replacement) {
+  if ((replacement->ssa_temp_index() == -1) && (defn->ssa_temp_index() != -1)) {
     AllocateSSAIndexes(replacement);
   }
 }
@@ -84,6 +82,14 @@
       THR_Print("Removing v%" Pd ".\n", current_defn->ssa_temp_index());
     }
   }
+  if (current->ArgumentCount() != 0) {
+    // This is a call instruction. Must remove original push arguments.
+    for (intptr_t i = 0; i < current->ArgumentCount(); ++i) {
+      PushArgumentInstr* push = current->PushArgumentAt(i);
+      push->ReplaceUsesWith(push->value()->definition());
+      push->RemoveFromGraph();
+    }
+  }
   iterator->RemoveCurrentFromGraph();
 }
 
@@ -92,7 +98,7 @@
     ZoneGrowableArray<const LibraryPrefix*>* from) {
   ZoneGrowableArray<const LibraryPrefix*>* to = deferred_prefixes();
   for (intptr_t i = 0; i < from->length(); i++) {
-    const  LibraryPrefix* prefix = (*from)[i];
+    const LibraryPrefix* prefix = (*from)[i];
     for (intptr_t j = 0; j < to->length(); j++) {
       if ((*to)[j]->raw() == prefix->raw()) {
         return;
@@ -105,17 +111,14 @@
 
 bool FlowGraph::ShouldReorderBlocks(const Function& function,
                                     bool is_optimized) {
-  return is_optimized
-      && FLAG_reorder_basic_blocks
-      && !function.is_intrinsic();
+  return is_optimized && FLAG_reorder_basic_blocks && !function.is_intrinsic();
 }
 
 
 GrowableArray<BlockEntryInstr*>* FlowGraph::CodegenBlockOrder(
     bool is_optimized) {
-  return ShouldReorderBlocks(function(), is_optimized)
-      ? &optimized_block_order_
-      : &reverse_postorder_;
+  return ShouldReorderBlocks(function(), is_optimized) ? &optimized_block_order_
+                                                       : &reverse_postorder_;
 }
 
 
@@ -123,8 +126,8 @@
   ConstantInstr* constant = constant_instr_pool_.LookupValue(object);
   if (constant == NULL) {
     // Otherwise, allocate and add it to the pool.
-    constant = new(zone()) ConstantInstr(
-        Object::ZoneHandle(zone(), object.raw()));
+    constant =
+        new (zone()) ConstantInstr(Object::ZoneHandle(zone(), object.raw()));
     constant->set_ssa_temp_index(alloc_ssa_temp_index());
 
     AddToInitialDefinitions(constant);
@@ -187,8 +190,8 @@
 class BlockTraversalState {
  public:
   explicit BlockTraversalState(BlockEntryInstr* block)
-    : block_(block),
-      next_successor_ix_(block->last_instruction()->SuccessorCount() - 1) { }
+      : block_(block),
+        next_successor_ix_(block->last_instruction()->SuccessorCount() - 1) {}
 
   bool HasNextSuccessor() const { return next_successor_ix_ >= 0; }
   BlockEntryInstr* NextSuccessor() {
@@ -219,7 +222,7 @@
   graph_entry_->DiscoverBlock(NULL, &preorder_, &parent_);
   block_stack.Add(BlockTraversalState(graph_entry_));
   while (!block_stack.is_empty()) {
-    BlockTraversalState &state = block_stack.Last();
+    BlockTraversalState& state = block_stack.Last();
     BlockEntryInstr* block = state.block();
     if (state.HasNextSuccessor()) {
       // Process successors one-by-one.
@@ -253,9 +256,8 @@
 
 void FlowGraph::MergeBlocks() {
   bool changed = false;
-  BitVector* merged = new(zone()) BitVector(zone(), postorder().length());
-  for (BlockIterator block_it = reverse_postorder_iterator();
-       !block_it.Done();
+  BitVector* merged = new (zone()) BitVector(zone(), postorder().length());
+  for (BlockIterator block_it = reverse_postorder_iterator(); !block_it.Done();
        block_it.Advance()) {
     BlockEntryInstr* block = block_it.Current();
     if (block->IsGraphEntry()) continue;
@@ -263,8 +265,7 @@
 
     Instruction* last = block->last_instruction();
     BlockEntryInstr* successor = NULL;
-    while ((!last->IsIndirectGoto()) &&
-           (last->SuccessorCount() == 1) &&
+    while ((!last->IsIndirectGoto()) && (last->SuccessorCount() == 1) &&
            (!last->SuccessorAt(0)->IsIndirectEntry()) &&
            (last->SuccessorAt(0)->PredecessorCount() == 1) &&
            (block->try_index() == last->SuccessorAt(0)->try_index())) {
@@ -280,8 +281,7 @@
       merged->Add(successor->postorder_number());
       changed = true;
       if (FLAG_trace_optimization) {
-        OS::Print("Merged blocks B%" Pd " and B%" Pd "\n",
-                  block->block_id(),
+        OS::Print("Merged blocks B%" Pd " and B%" Pd "\n", block->block_id(),
                   successor->block_id());
       }
     }
@@ -313,8 +313,7 @@
   for (intptr_t i = 0; i < instr->InputCount(); ++i) {
     Value* use = instr->InputAt(i);
     ASSERT(use->definition() != NULL);
-    ASSERT((use->definition() != instr) ||
-           use->definition()->IsPhi() ||
+    ASSERT((use->definition() != instr) || use->definition()->IsPhi() ||
            use->definition()->IsMaterializeObject());
     ASSERT(use->instruction() == instr);
     ASSERT(use->use_index() == i);
@@ -373,7 +372,8 @@
 }
 
 void FlowGraph::ComputeIsReceiverRecursive(
-    PhiInstr* phi, GrowableArray<PhiInstr*>* unmark) const {
+    PhiInstr* phi,
+    GrowableArray<PhiInstr*>* unmark) const {
   if (phi->is_receiver() != PhiInstr::kUnknownReceiver) return;
   phi->set_is_receiver(PhiInstr::kReceiver);
   for (intptr_t i = 0; i < phi->InputCount(); ++i) {
@@ -428,7 +428,7 @@
 
 
 // Use CHA to determine if the call needs a class check: if the callee's
-// receiver is the same as the caller's receiver and there are no overriden
+// receiver is the same as the caller's receiver and there are no overridden
 // callee functions, then no class check is needed.
 bool FlowGraph::InstanceCallNeedsClassCheck(InstanceCallInstr* call,
                                             RawFunction::Kind kind) const {
@@ -440,14 +440,17 @@
   Definition* callee_receiver = call->ArgumentAt(0);
   ASSERT(callee_receiver != NULL);
   if (function().IsDynamicFunction() && IsReceiver(callee_receiver)) {
-    const String& name = (kind == RawFunction::kMethodExtractor)
-        ? String::Handle(zone(), Field::NameFromGetter(call->function_name()))
-        : call->function_name();
+    const String& name =
+        (kind == RawFunction::kMethodExtractor)
+            ? String::Handle(zone(),
+                             Field::NameFromGetter(call->function_name()))
+            : call->function_name();
     const Class& cls = Class::Handle(zone(), function().Owner());
     intptr_t subclass_count = 0;
     if (!thread()->cha()->HasOverride(cls, name, &subclass_count)) {
       if (FLAG_trace_cha) {
-        THR_Print("  **(CHA) Instance call needs no check, "
+        THR_Print(
+            "  **(CHA) Instance call needs no check, "
             "no overrides of '%s' '%s'\n",
             name.ToCString(), cls.ToCString());
       }
@@ -459,7 +462,6 @@
 }
 
 
-
 bool FlowGraph::VerifyUseLists() {
   // Verify the initial definitions.
   for (intptr_t i = 0; i < graph_entry_->initial_definitions()->length(); ++i) {
@@ -486,15 +488,14 @@
 
 
 LivenessAnalysis::LivenessAnalysis(
-  intptr_t variable_count,
-  const GrowableArray<BlockEntryInstr*>& postorder)
+    intptr_t variable_count,
+    const GrowableArray<BlockEntryInstr*>& postorder)
     : zone_(Thread::Current()->zone()),
       variable_count_(variable_count),
       postorder_(postorder),
       live_out_(postorder.length()),
       kill_(postorder.length()),
-      live_in_(postorder.length()) {
-}
+      live_in_(postorder.length()) {}
 
 
 bool LivenessAnalysis::UpdateLiveOut(const BlockEntryInstr& block) {
@@ -545,9 +546,9 @@
 void LivenessAnalysis::Analyze() {
   const intptr_t block_count = postorder_.length();
   for (intptr_t i = 0; i < block_count; i++) {
-    live_out_.Add(new(zone()) BitVector(zone(), variable_count_));
-    kill_.Add(new(zone()) BitVector(zone(), variable_count_));
-    live_in_.Add(new(zone()) BitVector(zone(), variable_count_));
+    live_out_.Add(new (zone()) BitVector(zone(), variable_count_));
+    kill_.Add(new (zone()) BitVector(zone(), variable_count_));
+    live_in_.Add(new (zone()) BitVector(zone(), variable_count_));
   }
 
   ComputeInitialSets();
@@ -591,7 +592,7 @@
       : LivenessAnalysis(flow_graph->variable_count(), flow_graph->postorder()),
         flow_graph_(flow_graph),
         num_non_copied_params_(flow_graph->num_non_copied_params()),
-        assigned_vars_() { }
+        assigned_vars_() {}
 
   // For every block (in preorder) compute and return set of variables that
   // have new assigned values flowing out of that block.
@@ -664,7 +665,7 @@
 void VariableLivenessAnalysis::ComputeInitialSets() {
   const intptr_t block_count = postorder_.length();
 
-  BitVector* last_loads = new(zone()) BitVector(zone(), variable_count_);
+  BitVector* last_loads = new (zone()) BitVector(zone(), variable_count_);
   for (intptr_t i = 0; i < block_count; i++) {
     BlockEntryInstr* block = postorder_[i];
 
@@ -735,10 +736,8 @@
 
   GrowableArray<PhiInstr*> live_phis;
 
-  InsertPhis(preorder_,
-             variable_liveness.ComputeAssignedVars(),
-             dominance_frontier,
-             &live_phis);
+  InsertPhis(preorder_, variable_liveness.ComputeAssignedVars(),
+             dominance_frontier, &live_phis);
 
 
   // Rename uses to reference inserted phis where appropriate.
@@ -772,8 +771,8 @@
 
   // All arrays are maps between preorder basic-block numbers.
   intptr_t size = parent_.length();
-  GrowableArray<intptr_t> idom(size);  // Immediate dominator.
-  GrowableArray<intptr_t> semi(size);  // Semidominator.
+  GrowableArray<intptr_t> idom(size);   // Immediate dominator.
+  GrowableArray<intptr_t> semi(size);   // Semidominator.
   GrowableArray<intptr_t> label(size);  // Label for link-eval forest.
 
   // 1. First pass: compute semidominators as in Lengauer-Tarjan.
@@ -790,7 +789,7 @@
     idom.Add(parent_[i]);
     semi.Add(i);
     label.Add(i);
-    dominance_frontier->Add(new(zone()) BitVector(zone(), size));
+    dominance_frontier->Add(new (zone()) BitVector(zone(), size));
   }
 
   // Loop over the blocks in reverse preorder (not including the graph
@@ -869,11 +868,10 @@
 }
 
 
-void FlowGraph::InsertPhis(
-    const GrowableArray<BlockEntryInstr*>& preorder,
-    const GrowableArray<BitVector*>& assigned_vars,
-    const GrowableArray<BitVector*>& dom_frontier,
-    GrowableArray<PhiInstr*>* live_phis) {
+void FlowGraph::InsertPhis(const GrowableArray<BlockEntryInstr*>& preorder,
+                           const GrowableArray<BitVector*>& assigned_vars,
+                           const GrowableArray<BitVector*>& dom_frontier,
+                           GrowableArray<PhiInstr*>* live_phis) {
   const intptr_t block_count = preorder.length();
   // Map preorder block number to the highest variable index that has a phi
   // in that block.  Use it to avoid inserting multiple phis for the same
@@ -893,8 +891,8 @@
   // Insert phis for each variable in turn.
   GrowableArray<BlockEntryInstr*> worklist;
   for (intptr_t var_index = 0; var_index < variable_count(); ++var_index) {
-    const bool always_live = !FLAG_prune_dead_locals ||
-        (var_index == CurrentContextEnvIndex());
+    const bool always_live =
+        !FLAG_prune_dead_locals || (var_index == CurrentContextEnvIndex());
     // Add to the worklist each block containing an assignment.
     for (intptr_t block_index = 0; block_index < block_count; ++block_index) {
       if (assigned_vars[block_index]->Contains(var_index)) {
@@ -907,14 +905,13 @@
       BlockEntryInstr* current = worklist.RemoveLast();
       // Ensure a phi for each block in the dominance frontier of current.
       for (BitVector::Iterator it(dom_frontier[current->preorder_number()]);
-           !it.Done();
-           it.Advance()) {
+           !it.Done(); it.Advance()) {
         int index = it.Current();
         if (has_already[index] < var_index) {
           BlockEntryInstr* block = preorder[index];
           ASSERT(block->IsJoinEntry());
-          PhiInstr* phi = block->AsJoinEntry()->InsertPhi(var_index,
-                                                          variable_count());
+          PhiInstr* phi =
+              block->AsJoinEntry()->InsertPhi(var_index, variable_count());
           if (always_live) {
             phi->mark_alive();
             live_phis->Add(phi);
@@ -942,8 +939,8 @@
   // Add global constants to the initial definitions.
   constant_null_ = GetConstant(Object::ZoneHandle());
   constant_dead_ = GetConstant(Symbols::OptimizedOut());
-  constant_empty_context_ = GetConstant(Context::Handle(
-      isolate()->object_store()->empty_context()));
+  constant_empty_context_ =
+      GetConstant(Context::Handle(isolate()->object_store()->empty_context()));
 
   // Add parameters to the initial definitions and renaming environment.
   if (inlining_parameters != NULL) {
@@ -960,7 +957,7 @@
     // are unknown and so treated like parameters.
     intptr_t count = IsCompiledForOsr() ? variable_count() : parameter_count();
     for (intptr_t i = 0; i < count; ++i) {
-      ParameterInstr* param = new(zone()) ParameterInstr(i, entry);
+      ParameterInstr* param = new (zone()) ParameterInstr(i, entry);
       param->set_ssa_temp_index(alloc_ssa_temp_index());  // New SSA temp.
       AddToInitialDefinitions(param);
       env.Add(param);
@@ -999,13 +996,10 @@
 void FlowGraph::AttachEnvironment(Instruction* instr,
                                   GrowableArray<Definition*>* env) {
   Environment* deopt_env =
-      Environment::From(zone(),
-                        *env,
-                        num_non_copied_params_,
-                        parsed_function_);
+      Environment::From(zone(), *env, num_non_copied_params_, parsed_function_);
   if (instr->IsClosureCall()) {
-    deopt_env = deopt_env->DeepCopy(zone(),
-                                    deopt_env->Length() - instr->InputCount());
+    deopt_env =
+        deopt_env->DeepCopy(zone(), deopt_env->Length() - instr->InputCount());
   }
   instr->SetEnvironment(deopt_env);
   for (Environment::DeepIterator it(deopt_env); !it.Done(); it.Advance()) {
@@ -1046,7 +1040,7 @@
   } else if (block_entry->IsCatchBlockEntry()) {
     // Add real definitions for all locals and parameters.
     for (intptr_t i = 0; i < env->length(); ++i) {
-      ParameterInstr* param = new(zone()) ParameterInstr(i, block_entry);
+      ParameterInstr* param = new (zone()) ParameterInstr(i, block_entry);
       param->set_ssa_temp_index(alloc_ssa_temp_index());  // New SSA temp.
       (*env)[i] = param;
       block_entry->AsCatchBlockEntry()->initial_definitions()->Add(param);
@@ -1059,8 +1053,7 @@
   for (intptr_t i = 0; i < variable_count(); i++) {
     // TODO(fschneider): Make sure that live_in always contains the
     // CurrentContext variable to avoid the special case here.
-    if (FLAG_prune_dead_locals &&
-        !live_in->Contains(i) &&
+    if (FLAG_prune_dead_locals && !live_in->Contains(i) &&
         (i != CurrentContextEnvIndex())) {
       (*env)[i] = constant_dead();
     }
@@ -1091,10 +1084,8 @@
       Definition* reaching_defn = env->RemoveLast();
       Definition* input_defn = v->definition();
       if (input_defn != reaching_defn) {
-        ASSERT(input_defn->IsLoadLocal() ||
-               input_defn->IsStoreLocal() ||
-               input_defn->IsDropTemps() ||
-               input_defn->IsConstant());
+        ASSERT(input_defn->IsLoadLocal() || input_defn->IsStoreLocal() ||
+               input_defn->IsDropTemps() || input_defn->IsConstant());
         // Assert we are not referencing nulls in the initial environment.
         ASSERT(reaching_defn->ssa_temp_index() != -1);
         v->set_definition(reaching_defn);
@@ -1115,9 +1106,7 @@
       StoreLocalInstr* store = definition->AsStoreLocal();
       DropTempsInstr* drop = definition->AsDropTemps();
       ConstantInstr* constant = definition->AsConstant();
-      if ((load != NULL) ||
-          (store != NULL) ||
-          (drop != NULL) ||
+      if ((load != NULL) || (store != NULL) || (drop != NULL) ||
           (constant != NULL)) {
         Definition* result = NULL;
         if (store != NULL) {
@@ -1165,8 +1154,9 @@
           }
           ASSERT((drop->value() != NULL) || !drop->HasTemp());
         } else {
-          ASSERT(definition->HasTemp());
-          result = GetConstant(constant->value());
+          if (definition->HasTemp()) {
+            result = GetConstant(constant->value());
+          }
         }
         // Update expression stack or remove from graph.
         if (definition->HasTemp()) {
@@ -1212,7 +1202,7 @@
         PhiInstr* phi = (*successor->phis())[i];
         if (phi != NULL) {
           // Rename input operand.
-          Value* use = new(zone()) Value((*env)[i]);
+          Value* use = new (zone()) Value((*env)[i]);
           phi->SetInputAt(pred_index, use);
         }
       }
@@ -1230,14 +1220,11 @@
       if (join == NULL) continue;
       for (PhiIterator phi_it(join); !phi_it.Done(); phi_it.Advance()) {
         PhiInstr* phi = phi_it.Current();
-        if (phi == NULL ||
-            phi->is_alive() ||
-            (phi->input_use_list() != NULL) ||
+        if (phi == NULL || phi->is_alive() || (phi->input_use_list() != NULL) ||
             (phi->env_use_list() == NULL)) {
           continue;
         }
-        for (Value::Iterator it(phi->env_use_list());
-             !it.Done();
+        for (Value::Iterator it(phi->env_use_list()); !it.Done();
              it.Advance()) {
           Value* use = it.Current();
           if (use->instruction()->MayThrow() &&
@@ -1272,12 +1259,10 @@
 
 void FlowGraph::RemoveRedefinitions() {
   // Remove redefinition instructions inserted to inhibit hoisting.
-  for (BlockIterator block_it = reverse_postorder_iterator();
-       !block_it.Done();
+  for (BlockIterator block_it = reverse_postorder_iterator(); !block_it.Done();
        block_it.Advance()) {
     for (ForwardInstructionIterator instr_it(block_it.Current());
-         !instr_it.Done();
-         instr_it.Advance()) {
+         !instr_it.Done(); instr_it.Advance()) {
       RedefinitionInstr* redefinition = instr_it.Current()->AsRedefinition();
       if (redefinition != NULL) {
         Definition* original;
@@ -1297,7 +1282,7 @@
 // Design & Implementation" (Muchnick) p192.
 BitVector* FlowGraph::FindLoop(BlockEntryInstr* m, BlockEntryInstr* n) const {
   GrowableArray<BlockEntryInstr*> stack;
-  BitVector* loop = new(zone()) BitVector(zone(), preorder_.length());
+  BitVector* loop = new (zone()) BitVector(zone(), preorder_.length());
 
   loop->Add(n->preorder_number());
   if (n != m) {
@@ -1321,11 +1306,9 @@
 
 ZoneGrowableArray<BlockEntryInstr*>* FlowGraph::ComputeLoops() const {
   ZoneGrowableArray<BlockEntryInstr*>* loop_headers =
-      new(zone()) ZoneGrowableArray<BlockEntryInstr*>();
+      new (zone()) ZoneGrowableArray<BlockEntryInstr*>();
 
-  for (BlockIterator it = postorder_iterator();
-       !it.Done();
-       it.Advance()) {
+  for (BlockIterator it = postorder_iterator(); !it.Done(); it.Advance()) {
     BlockEntryInstr* block = it.Current();
     for (intptr_t i = 0; i < block->PredecessorCount(); ++i) {
       BlockEntryInstr* pred = block->PredecessorAt(i);
@@ -1356,8 +1339,7 @@
     for (intptr_t i = 0; i < loop_headers->length(); ++i) {
       BlockEntryInstr* header = (*loop_headers)[i];
       OS::Print("Loop header B%" Pd "\n", header->block_id());
-      for (BitVector::Iterator it(header->loop_info());
-           !it.Done();
+      for (BitVector::Iterator it(header->loop_info()); !it.Done();
            it.Advance()) {
         OS::Print("  B%" Pd "\n", preorder_[it.Current()]->block_id());
       }
@@ -1371,8 +1353,7 @@
   intptr_t size = 0;
   // Iterate each block, skipping the graph entry.
   for (intptr_t i = 1; i < preorder_.length(); ++i) {
-    for (ForwardInstructionIterator it(preorder_[i]);
-         !it.Done();
+    for (ForwardInstructionIterator it(preorder_[i]); !it.Done();
          it.Advance()) {
       ++size;
     }
@@ -1382,7 +1363,7 @@
 
 
 void FlowGraph::ComputeBlockEffects() {
-  block_effects_ = new(zone()) BlockEffects(this);
+  block_effects_ = new (zone()) BlockEffects(this);
 }
 
 
@@ -1394,7 +1375,7 @@
   const intptr_t block_count = flow_graph->postorder().length();
 
   // Set of blocks that contain side-effects.
-  BitVector* kill = new(zone) BitVector(zone, block_count);
+  BitVector* kill = new (zone) BitVector(zone, block_count);
 
   // Per block available-after sets. Block A is available after the block B if
   // and only if A is either equal to B or A is available at B and B contains no
@@ -1403,16 +1384,13 @@
   GrowableArray<BitVector*> available_after(block_count);
 
   // Discover all blocks with side-effects.
-  for (BlockIterator it = flow_graph->postorder_iterator();
-       !it.Done();
+  for (BlockIterator it = flow_graph->postorder_iterator(); !it.Done();
        it.Advance()) {
     available_at_.Add(NULL);
     available_after.Add(NULL);
 
     BlockEntryInstr* block = it.Current();
-    for (ForwardInstructionIterator it(block);
-         !it.Done();
-         it.Advance()) {
+    for (ForwardInstructionIterator it(block); !it.Done(); it.Advance()) {
       if (!it.Current()->Effects().IsNone()) {
         kill->Add(block->postorder_number());
         break;
@@ -1420,7 +1398,7 @@
     }
   }
 
-  BitVector* temp = new(zone) BitVector(zone, block_count);
+  BitVector* temp = new (zone) BitVector(zone, block_count);
 
   // Recompute available-at based on predecessors' available-after until the fix
   // point is reached.
@@ -1429,8 +1407,7 @@
     changed = false;
 
     for (BlockIterator it = flow_graph->reverse_postorder_iterator();
-         !it.Done();
-         it.Advance()) {
+         !it.Done(); it.Advance()) {
       BlockEntryInstr* block = it.Current();
       const intptr_t block_num = block->postorder_number();
 
@@ -1453,9 +1430,8 @@
         // Available-at changed: update it and recompute available-after.
         if (available_at_[block_num] == NULL) {
           current = available_at_[block_num] =
-              new(zone) BitVector(zone, block_count);
-          available_after[block_num] =
-              new(zone) BitVector(zone, block_count);
+              new (zone) BitVector(zone, block_count);
+          available_after[block_num] = new (zone) BitVector(zone, block_count);
           // Block is always available after itself.
           available_after[block_num]->Add(block_num);
         }
@@ -1475,14 +1451,14 @@
 bool BlockEffects::IsAvailableAt(Instruction* instr,
                                  BlockEntryInstr* block) const {
   return (instr->Dependencies().IsNone()) ||
-      IsSideEffectFreePath(instr->GetBlock(), block);
+         IsSideEffectFreePath(instr->GetBlock(), block);
 }
 
 
 bool BlockEffects::CanBeMovedTo(Instruction* instr,
                                 BlockEntryInstr* block) const {
   return (instr->Dependencies().IsNone()) ||
-      IsSideEffectFreePath(block, instr->GetBlock());
+         IsSideEffectFreePath(block, instr->GetBlock());
 }
 
 
@@ -1503,13 +1479,12 @@
   if (from_rep == to_rep || to_rep == kNoRepresentation) {
     return;
   }
-  InsertConversion(from_rep, to_rep, use, /*is_environment_use=*/ false);
+  InsertConversion(from_rep, to_rep, use, /*is_environment_use=*/false);
 }
 
 
 static bool IsUnboxedInteger(Representation rep) {
-  return (rep == kUnboxedInt32) ||
-         (rep == kUnboxedUint32) ||
+  return (rep == kUnboxedInt32) || (rep == kUnboxedUint32) ||
          (rep == kUnboxedMint);
 }
 
@@ -1548,24 +1523,24 @@
 
   Definition* converted = NULL;
   if (IsUnboxedInteger(from) && IsUnboxedInteger(to)) {
-    const intptr_t deopt_id = (to == kUnboxedInt32) && (deopt_target != NULL) ?
-      deopt_target->DeoptimizationTarget() : Thread::kNoDeoptId;
-    converted = new(Z) UnboxedIntConverterInstr(from,
-                                                to,
-                                                use->CopyWithType(),
-                                                deopt_id);
+    const intptr_t deopt_id = (to == kUnboxedInt32) && (deopt_target != NULL)
+                                  ? deopt_target->DeoptimizationTarget()
+                                  : Thread::kNoDeoptId;
+    converted = new (Z)
+        UnboxedIntConverterInstr(from, to, use->CopyWithType(), deopt_id);
   } else if ((from == kUnboxedInt32) && (to == kUnboxedDouble)) {
     converted = new Int32ToDoubleInstr(use->CopyWithType());
-  } else if ((from == kUnboxedMint) &&
-             (to == kUnboxedDouble) &&
+  } else if ((from == kUnboxedMint) && (to == kUnboxedDouble) &&
              CanConvertUnboxedMintToDouble()) {
-    const intptr_t deopt_id = (deopt_target != NULL) ?
-        deopt_target->DeoptimizationTarget() : Thread::kNoDeoptId;
+    const intptr_t deopt_id = (deopt_target != NULL)
+                                  ? deopt_target->DeoptimizationTarget()
+                                  : Thread::kNoDeoptId;
     ASSERT(CanUnboxDouble());
     converted = new MintToDoubleInstr(use->CopyWithType(), deopt_id);
   } else if ((from == kTagged) && Boxing::Supports(to)) {
-    const intptr_t deopt_id = (deopt_target != NULL) ?
-        deopt_target->DeoptimizationTarget() : Thread::kNoDeoptId;
+    const intptr_t deopt_id = (deopt_target != NULL)
+                                  ? deopt_target->DeoptimizationTarget()
+                                  : Thread::kNoDeoptId;
     converted = UnboxInstr::Create(to, use->CopyWithType(), deopt_id);
   } else if ((to == kTagged) && Boxing::Supports(from)) {
     converted = BoxInstr::Create(from, use->CopyWithType());
@@ -1574,14 +1549,15 @@
     // Insert two "dummy" conversion instructions with the correct
     // "from" and "to" representation. The inserted instructions will
     // trigger a deoptimization if executed. See #12417 for a discussion.
-    const intptr_t deopt_id = (deopt_target != NULL) ?
-        deopt_target->DeoptimizationTarget() : Thread::kNoDeoptId;
+    const intptr_t deopt_id = (deopt_target != NULL)
+                                  ? deopt_target->DeoptimizationTarget()
+                                  : Thread::kNoDeoptId;
     ASSERT(Boxing::Supports(from));
     ASSERT(Boxing::Supports(to));
     Definition* boxed = BoxInstr::Create(from, use->CopyWithType());
     use->BindTo(boxed);
     InsertBefore(insert_before, boxed, NULL, FlowGraph::kValue);
-    converted = UnboxInstr::Create(to, new(Z) Value(boxed), deopt_id);
+    converted = UnboxInstr::Create(to, new (Z) Value(boxed), deopt_id);
   }
   ASSERT(converted != NULL);
   InsertBefore(insert_before, converted, use->instruction()->env(),
@@ -1605,23 +1581,19 @@
   if (from_rep == to_rep) {
     return;
   }
-  InsertConversion(from_rep, to_rep, use, /*is_environment_use=*/ true);
+  InsertConversion(from_rep, to_rep, use, /*is_environment_use=*/true);
 }
 
 
 void FlowGraph::InsertConversionsFor(Definition* def) {
   const Representation from_rep = def->representation();
 
-  for (Value::Iterator it(def->input_use_list());
-       !it.Done();
-       it.Advance()) {
+  for (Value::Iterator it(def->input_use_list()); !it.Done(); it.Advance()) {
     ConvertUse(it.Current(), from_rep);
   }
 
   if (graph_entry()->SuccessorCount() > 1) {
-    for (Value::Iterator it(def->env_use_list());
-         !it.Done();
-         it.Advance()) {
+    for (Value::Iterator it(def->env_use_list()); !it.Done(); it.Advance()) {
       Value* use = it.Current();
       if (use->instruction()->MayThrow() &&
           use->instruction()->GetBlock()->InsideTryBlock()) {
@@ -1660,9 +1632,7 @@
       break;
   }
 
-  if ((kSmiBits < 32) &&
-      (unboxed == kTagged) &&
-      phi->Type()->IsInt() &&
+  if ((kSmiBits < 32) && (unboxed == kTagged) && phi->Type()->IsInt() &&
       RangeUtils::Fits(phi->range(), RangeBoundary::kRangeBoundaryInt64)) {
     // On 32-bit platforms conservatively unbox phis that:
     //   - are proven to be of type Int;
@@ -1687,15 +1657,14 @@
       // We checked inputs. Check if phi is used in at least one unbox
       // operation.
       bool has_unboxed_use = false;
-      for (Value* use = phi->input_use_list();
-           use != NULL;
+      for (Value* use = phi->input_use_list(); use != NULL;
            use = use->next_use()) {
         Instruction* instr = use->instruction();
         if (instr->IsUnbox()) {
           has_unboxed_use = true;
           break;
         } else if (IsUnboxedInteger(
-            instr->RequiredInputRepresentation(use->use_index()))) {
+                       instr->RequiredInputRepresentation(use->use_index()))) {
           has_unboxed_use = true;
           break;
         }
@@ -1709,7 +1678,8 @@
     if (should_unbox) {
       unboxed =
           RangeUtils::Fits(phi->range(), RangeBoundary::kRangeBoundaryInt32)
-          ? kUnboxedInt32 : kUnboxedMint;
+              ? kUnboxedInt32
+              : kUnboxedMint;
     }
   }
 
@@ -1720,8 +1690,7 @@
 void FlowGraph::SelectRepresentations() {
   // Conservatively unbox all phis that were proven to be of Double,
   // Float32x4, or Int32x4 type.
-  for (BlockIterator block_it = reverse_postorder_iterator();
-       !block_it.Done();
+  for (BlockIterator block_it = reverse_postorder_iterator(); !block_it.Done();
        block_it.Advance()) {
     JoinEntryInstr* join_entry = block_it.Current()->AsJoinEntry();
     if (join_entry != NULL) {
@@ -1734,14 +1703,12 @@
 
   // Process all instructions and insert conversions where needed.
   // Visit incoming parameters and constants.
-  for (intptr_t i = 0;
-       i < graph_entry()->initial_definitions()->length();
+  for (intptr_t i = 0; i < graph_entry()->initial_definitions()->length();
        i++) {
     InsertConversionsFor((*graph_entry()->initial_definitions())[i]);
   }
 
-  for (BlockIterator block_it = reverse_postorder_iterator();
-       !block_it.Done();
+  for (BlockIterator block_it = reverse_postorder_iterator(); !block_it.Done();
        block_it.Advance()) {
     BlockEntryInstr* entry = block_it.Current();
     JoinEntryInstr* join_entry = entry->AsJoinEntry();
@@ -1755,8 +1722,7 @@
     }
     CatchBlockEntryInstr* catch_entry = entry->AsCatchBlockEntry();
     if (catch_entry != NULL) {
-      for (intptr_t i = 0;
-           i < catch_entry->initial_definitions()->length();
+      for (intptr_t i = 0; i < catch_entry->initial_definitions()->length();
            i++) {
         InsertConversionsFor((*catch_entry->initial_definitions())[i]);
       }
@@ -1775,8 +1741,7 @@
 // Smi widening pass is only meaningful on platforms where Smi
 // is smaller than 32bit. For now only support it on ARM and ia32.
 static bool CanBeWidened(BinarySmiOpInstr* smi_op) {
-  return BinaryInt32OpInstr::IsSupported(smi_op->op_kind(),
-                                         smi_op->left(),
+  return BinaryInt32OpInstr::IsSupported(smi_op->op_kind(), smi_op->left(),
                                          smi_op->right());
 }
 
@@ -1802,17 +1767,13 @@
 
   // Step 1. Collect all instructions that potentially benefit from widening of
   // their operands (or their result) into int32 range.
-  for (BlockIterator block_it = reverse_postorder_iterator();
-       !block_it.Done();
+  for (BlockIterator block_it = reverse_postorder_iterator(); !block_it.Done();
        block_it.Advance()) {
     for (ForwardInstructionIterator instr_it(block_it.Current());
-         !instr_it.Done();
-         instr_it.Advance()) {
+         !instr_it.Done(); instr_it.Advance()) {
       BinarySmiOpInstr* smi_op = instr_it.Current()->AsBinarySmiOp();
-      if ((smi_op != NULL) &&
-          smi_op->HasSSATemp() &&
-          BenefitsFromWidening(smi_op) &&
-          CanBeWidened(smi_op)) {
+      if ((smi_op != NULL) && smi_op->HasSSATemp() &&
+          BenefitsFromWidening(smi_op) && CanBeWidened(smi_op)) {
         candidates.Add(smi_op);
       }
     }
@@ -1836,8 +1797,7 @@
 
   for (intptr_t loop_id = 0; loop_id < loop_headers.length(); ++loop_id) {
     for (BitVector::Iterator loop_it(loop_headers[loop_id]->loop_info());
-         !loop_it.Done();
-         loop_it.Advance()) {
+         !loop_it.Done(); loop_it.Advance()) {
       loops[loop_it.Current()] = loop_id;
     }
   }
@@ -1850,8 +1810,7 @@
 
   // BitVector containing SSA indexes of all processed definitions. Used to skip
   // those candidates that belong to dependency graph of another candidate.
-  BitVector* processed =
-      new(Z) BitVector(Z, current_ssa_temp_index());
+  BitVector* processed = new (Z) BitVector(Z, current_ssa_temp_index());
 
   // Worklist used to collect dependency graph.
   DefinitionWorklist worklist(this, candidates.length());
@@ -1890,8 +1849,7 @@
       // Process all inputs.
       for (intptr_t k = 0; k < defn->InputCount(); k++) {
         Definition* input = defn->InputAt(k)->definition();
-        if (input->IsBinarySmiOp() &&
-            CanBeWidened(input->AsBinarySmiOp())) {
+        if (input->IsBinarySmiOp() && CanBeWidened(input->AsBinarySmiOp())) {
           worklist.Add(input);
         } else if (input->IsPhi() && (input->Type()->ToCid() == kSmiCid)) {
           worklist.Add(input);
@@ -1916,8 +1874,7 @@
       }
 
       // Process all uses.
-      for (Value* use = defn->input_use_list();
-           use != NULL;
+      for (Value* use = defn->input_use_list(); use != NULL;
            use = use->next_use()) {
         Instruction* instr = use->instruction();
         Definition* use_defn = instr->AsDefinition();
@@ -1927,8 +1884,7 @@
           if (!instr->IsReturn() && !instr->IsPushArgument()) {
             gain--;
             if (FLAG_support_il_printer && FLAG_trace_smi_widening) {
-              THR_Print("v [%" Pd "] (u) %s\n",
-                        gain,
+              THR_Print("v [%" Pd "] (u) %s\n", gain,
                         use->instruction()->ToCString());
             }
           }
@@ -1945,15 +1901,13 @@
           // sign extension operation.
           gain++;
           if (FLAG_support_il_printer && FLAG_trace_smi_widening) {
-            THR_Print("^ [%" Pd "] (u) %s\n",
-                      gain,
+            THR_Print("^ [%" Pd "] (u) %s\n", gain,
                       use->instruction()->ToCString());
           }
         } else if (defn_loop == loops[instr->GetBlock()->preorder_number()]) {
           gain--;
           if (FLAG_support_il_printer && FLAG_trace_smi_widening) {
-            THR_Print("v [%" Pd "] (u) %s\n",
-                      gain,
+            THR_Print("v [%" Pd "] (u) %s\n", gain,
                       use->instruction()->ToCString());
           }
         }
@@ -1975,11 +1929,9 @@
 
         if (defn->IsBinarySmiOp()) {
           BinarySmiOpInstr* smi_op = defn->AsBinarySmiOp();
-          BinaryInt32OpInstr* int32_op = new(Z) BinaryInt32OpInstr(
-            smi_op->op_kind(),
-            smi_op->left()->CopyWithType(),
-            smi_op->right()->CopyWithType(),
-            smi_op->DeoptimizationTarget());
+          BinaryInt32OpInstr* int32_op = new (Z) BinaryInt32OpInstr(
+              smi_op->op_kind(), smi_op->left()->CopyWithType(),
+              smi_op->right()->CopyWithType(), smi_op->DeoptimizationTarget());
 
           smi_op->ReplaceWith(int32_op, NULL);
         } else if (defn->IsPhi()) {
@@ -2005,8 +1957,7 @@
   // that can deoptimize.
 
   disallow_licm();
-  for (BlockIterator block_it = reverse_postorder_iterator();
-       !block_it.Done();
+  for (BlockIterator block_it = reverse_postorder_iterator(); !block_it.Done();
        block_it.Advance()) {
     BlockEntryInstr* block = block_it.Current();
     if (!block->IsCatchBlockEntry()) {
@@ -2014,7 +1965,10 @@
     }
     for (ForwardInstructionIterator it(block); !it.Done(); it.Advance()) {
       Instruction* current = it.Current();
-      if (!current->CanDeoptimize()) {
+      if (!current->CanDeoptimize() &&
+          (!current->MayThrow() || !current->GetBlock()->InsideTryBlock())) {
+        // Instructions that can throw need an environment for optimized
+        // try-catch.
         // TODO(srdjan): --source-lines needs deopt environments to get at
         // the code for this instruction, however, leaving the environment
         // changes code.
@@ -2028,11 +1982,9 @@
 bool FlowGraph::Canonicalize() {
   bool changed = false;
 
-  for (BlockIterator block_it = reverse_postorder_iterator();
-       !block_it.Done();
+  for (BlockIterator block_it = reverse_postorder_iterator(); !block_it.Done();
        block_it.Advance()) {
-    for (ForwardInstructionIterator it(block_it.Current());
-         !it.Done();
+    for (ForwardInstructionIterator it(block_it.Current()); !it.Done();
          it.Advance()) {
       Instruction* current = it.Current();
       if (current->HasUnmatchedInputRepresentations()) {
@@ -2063,8 +2015,7 @@
   if (!FLAG_truncating_left_shift) return;
   GrowableArray<BinarySmiOpInstr*> div_mod_merge;
   GrowableArray<InvokeMathCFunctionInstr*> sin_cos_merge;
-  for (BlockIterator block_it = reverse_postorder_iterator();
-       !block_it.Done();
+  for (BlockIterator block_it = reverse_postorder_iterator(); !block_it.Done();
        block_it.Advance()) {
     // Merging only per basic-block.
     div_mod_merge.Clear();
@@ -2074,9 +2025,7 @@
       if (it.Current()->IsBinarySmiOp()) {
         BinarySmiOpInstr* binop = it.Current()->AsBinarySmiOp();
         if (binop->op_kind() == Token::kBIT_AND) {
-          OptimizeLeftShiftBitAndSmiOp(&it,
-                                       binop,
-                                       binop->left()->definition(),
+          OptimizeLeftShiftBitAndSmiOp(&it, binop, binop->left()->definition(),
                                        binop->right()->definition());
         } else if ((binop->op_kind() == Token::kTRUNCDIV) ||
                    (binop->op_kind() == Token::kMOD)) {
@@ -2087,8 +2036,7 @@
       } else if (it.Current()->IsBinaryMintOp()) {
         BinaryMintOpInstr* mintop = it.Current()->AsBinaryMintOp();
         if (mintop->op_kind() == Token::kBIT_AND) {
-          OptimizeLeftShiftBitAndSmiOp(&it,
-                                       mintop,
+          OptimizeLeftShiftBitAndSmiOp(&it, mintop,
                                        mintop->left()->definition(),
                                        mintop->right()->definition());
         }
@@ -2109,6 +2057,46 @@
 }
 
 
+// Returns true if use is dominated by the given instruction.
+// Note: uses that occur at instruction itself are not dominated by it.
+static bool IsDominatedUse(Instruction* dom, Value* use) {
+  BlockEntryInstr* dom_block = dom->GetBlock();
+
+  Instruction* instr = use->instruction();
+
+  PhiInstr* phi = instr->AsPhi();
+  if (phi != NULL) {
+    return dom_block->Dominates(phi->block()->PredecessorAt(use->use_index()));
+  }
+
+  BlockEntryInstr* use_block = instr->GetBlock();
+  if (use_block == dom_block) {
+    // Fast path for the case of block entry.
+    if (dom_block == dom) return true;
+
+    for (Instruction* curr = dom->next(); curr != NULL; curr = curr->next()) {
+      if (curr == instr) return true;
+    }
+
+    return false;
+  }
+
+  return dom_block->Dominates(use_block);
+}
+
+
+void FlowGraph::RenameDominatedUses(Definition* def,
+                                    Instruction* dom,
+                                    Definition* other) {
+  for (Value::Iterator it(def->input_use_list()); !it.Done(); it.Advance()) {
+    Value* use = it.Current();
+    if (IsDominatedUse(dom, use)) {
+      use->BindTo(other);
+    }
+  }
+}
+
+
 static bool IsPositiveOrZeroSmiConst(Definition* d) {
   ConstantInstr* const_instr = d->AsConstant();
   if ((const_instr != NULL) && (const_instr->value().IsSmi())) {
@@ -2156,10 +2144,8 @@
   ASSERT(bit_and_instr->IsBinarySmiOp() || bit_and_instr->IsBinaryMintOp());
   if (bit_and_instr->IsBinaryMintOp()) {
     // Replace Mint op with Smi op.
-    BinarySmiOpInstr* smi_op = new(Z) BinarySmiOpInstr(
-        Token::kBIT_AND,
-        new(Z) Value(left_instr),
-        new(Z) Value(right_instr),
+    BinarySmiOpInstr* smi_op = new (Z) BinarySmiOpInstr(
+        Token::kBIT_AND, new (Z) Value(left_instr), new (Z) Value(right_instr),
         Thread::kNoDeoptId);  // BIT_AND cannot deoptimize.
     bit_and_instr->ReplaceWith(smi_op, current_iterator);
   }
@@ -2198,38 +2184,34 @@
     ASSERT((curr_instr->op_kind() == Token::kTRUNCDIV) ||
            (curr_instr->op_kind() == Token::kMOD));
     // Check if there is kMOD/kTRUNDIV binop with same inputs.
-    const Token::Kind other_kind = (curr_instr->op_kind() == Token::kTRUNCDIV) ?
-        Token::kMOD : Token::kTRUNCDIV;
+    const Token::Kind other_kind = (curr_instr->op_kind() == Token::kTRUNCDIV)
+                                       ? Token::kMOD
+                                       : Token::kTRUNCDIV;
     Definition* left_def = curr_instr->left()->definition();
     Definition* right_def = curr_instr->right()->definition();
     for (intptr_t k = i + 1; k < merge_candidates->length(); k++) {
       BinarySmiOpInstr* other_binop = (*merge_candidates)[k];
       // 'other_binop' can be NULL if it was already merged.
-      if ((other_binop != NULL) &&
-          (other_binop->op_kind() == other_kind) &&
+      if ((other_binop != NULL) && (other_binop->op_kind() == other_kind) &&
           (other_binop->left()->definition() == left_def) &&
           (other_binop->right()->definition() == right_def)) {
         (*merge_candidates)[k] = NULL;  // Clear it.
         ASSERT(curr_instr->HasUses());
         AppendExtractNthOutputForMerged(
-            curr_instr,
-            MergedMathInstr::OutputIndexOf(curr_instr->op_kind()),
+            curr_instr, MergedMathInstr::OutputIndexOf(curr_instr->op_kind()),
             kTagged, kSmiCid);
         ASSERT(other_binop->HasUses());
         AppendExtractNthOutputForMerged(
-            other_binop,
-            MergedMathInstr::OutputIndexOf(other_binop->op_kind()),
+            other_binop, MergedMathInstr::OutputIndexOf(other_binop->op_kind()),
             kTagged, kSmiCid);
 
-        ZoneGrowableArray<Value*>* args = new(Z) ZoneGrowableArray<Value*>(2);
-        args->Add(new(Z) Value(curr_instr->left()->definition()));
-        args->Add(new(Z) Value(curr_instr->right()->definition()));
+        ZoneGrowableArray<Value*>* args = new (Z) ZoneGrowableArray<Value*>(2);
+        args->Add(new (Z) Value(curr_instr->left()->definition()));
+        args->Add(new (Z) Value(curr_instr->right()->definition()));
 
         // Replace with TruncDivMod.
-        MergedMathInstr* div_mod = new(Z) MergedMathInstr(
-            args,
-            curr_instr->deopt_id(),
-            MergedMathInstr::kTruncDivMod);
+        MergedMathInstr* div_mod = new (Z) MergedMathInstr(
+            args, curr_instr->deopt_id(), MergedMathInstr::kTruncDivMod);
         curr_instr->ReplaceWith(div_mod, NULL);
         other_binop->ReplaceUsesWith(div_mod);
         other_binop->RemoveFromGraph();
@@ -2265,8 +2247,8 @@
            (kind == MethodRecognizer::kMathCos));
     // Check if there is sin/cos binop with same inputs.
     const MethodRecognizer::Kind other_kind =
-        (kind == MethodRecognizer::kMathSin)
-        ? MethodRecognizer::kMathCos : MethodRecognizer::kMathSin;
+        (kind == MethodRecognizer::kMathSin) ? MethodRecognizer::kMathCos
+                                             : MethodRecognizer::kMathSin;
     Definition* def = curr_instr->InputAt(0)->definition();
     for (intptr_t k = i + 1; k < merge_candidates->length(); k++) {
       InvokeMathCFunctionInstr* other_op = (*merge_candidates)[k];
@@ -2280,16 +2262,13 @@
                                         kUnboxedDouble, kDoubleCid);
         ASSERT(other_op->HasUses());
         AppendExtractNthOutputForMerged(
-            other_op,
-            MergedMathInstr::OutputIndexOf(other_kind),
+            other_op, MergedMathInstr::OutputIndexOf(other_kind),
             kUnboxedDouble, kDoubleCid);
-        ZoneGrowableArray<Value*>* args = new(Z) ZoneGrowableArray<Value*>(1);
-        args->Add(new(Z) Value(curr_instr->InputAt(0)->definition()));
+        ZoneGrowableArray<Value*>* args = new (Z) ZoneGrowableArray<Value*>(1);
+        args->Add(new (Z) Value(curr_instr->InputAt(0)->definition()));
         // Replace with SinCos.
-        MergedMathInstr* sin_cos =
-            new(Z) MergedMathInstr(args,
-                                   curr_instr->DeoptimizationTarget(),
-                                   MergedMathInstr::kSinCos);
+        MergedMathInstr* sin_cos = new (Z) MergedMathInstr(
+            args, curr_instr->DeoptimizationTarget(), MergedMathInstr::kSinCos);
         curr_instr->ReplaceWith(sin_cos, NULL);
         other_op->ReplaceUsesWith(sin_cos);
         other_op->RemoveFromGraph();
@@ -2308,12 +2287,10 @@
                                                 Representation rep,
                                                 intptr_t cid) {
   ExtractNthOutputInstr* extract =
-      new(Z) ExtractNthOutputInstr(new(Z) Value(instr), index, rep, cid);
+      new (Z) ExtractNthOutputInstr(new (Z) Value(instr), index, rep, cid);
   instr->ReplaceUsesWith(extract);
   InsertAfter(instr, extract, NULL, FlowGraph::kValue);
 }
 
 
-
-
 }  // namespace dart
diff --git a/runtime/vm/flow_graph.h b/runtime/vm/flow_graph.h
index e4a0a3c..544dfac 100644
--- a/runtime/vm/flow_graph.h
+++ b/runtime/vm/flow_graph.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_FLOW_GRAPH_H_
-#define VM_FLOW_GRAPH_H_
+#ifndef RUNTIME_VM_FLOW_GRAPH_H_
+#define RUNTIME_VM_FLOW_GRAPH_H_
 
 #include "vm/bit_vector.h"
 #include "vm/growable_array.h"
@@ -22,12 +22,12 @@
 class BlockIterator : public ValueObject {
  public:
   explicit BlockIterator(const GrowableArray<BlockEntryInstr*>& block_order)
-      : block_order_(block_order), current_(0) { }
+      : block_order_(block_order), current_(0) {}
 
   BlockIterator(const BlockIterator& other)
       : ValueObject(),
         block_order_(other.block_order_),
-        current_(other.current_) { }
+        current_(other.current_) {}
 
   void Advance() {
     ASSERT(!Done());
@@ -49,22 +49,17 @@
   typedef const Object& Key;
   typedef ConstantInstr* Pair;
 
-  static Key KeyOf(Pair kv) {
-    return kv->value();
-  }
+  static Key KeyOf(Pair kv) { return kv->value(); }
 
-  static Value ValueOf(Pair kv) {
-    return kv;
-  }
+  static Value ValueOf(Pair kv) { return kv; }
 
   static inline intptr_t Hashcode(Key key) {
     if (key.IsSmi()) {
       return Smi::Cast(key).Value();
     }
     if (key.IsDouble()) {
-      return static_cast<intptr_t>(
-          bit_cast<int32_t, float>(
-              static_cast<float>(Double::Cast(key).value())));
+      return static_cast<intptr_t>(bit_cast<int32_t, float>(
+          static_cast<float>(Double::Cast(key).value())));
     }
     if (key.IsMint()) {
       return static_cast<intptr_t>(Mint::Cast(key).value());
@@ -89,12 +84,8 @@
             intptr_t max_block_id);
 
   // Function properties.
-  const ParsedFunction& parsed_function() const {
-    return parsed_function_;
-  }
-  const Function& function() const {
-    return parsed_function_.function();
-  }
+  const ParsedFunction& parsed_function() const { return parsed_function_; }
+  const Function& function() const { return parsed_function_.function(); }
   intptr_t parameter_count() const {
     return num_copied_params_ + num_non_copied_params_;
   }
@@ -104,15 +95,9 @@
   intptr_t num_stack_locals() const {
     return parsed_function_.num_stack_locals();
   }
-  intptr_t num_copied_params() const {
-    return num_copied_params_;
-  }
-  intptr_t num_non_copied_params() const {
-    return num_non_copied_params_;
-  }
-  bool IsIrregexpFunction() const {
-    return function().IsIrregexpFunction();
-  }
+  intptr_t num_copied_params() const { return num_copied_params_; }
+  intptr_t num_non_copied_params() const { return num_non_copied_params_; }
+  bool IsIrregexpFunction() const { return function().IsIrregexpFunction(); }
 
   LocalVariable* CurrentContextVar() const {
     return parsed_function().current_context_var();
@@ -124,9 +109,7 @@
   }
 
   // Flow graph orders.
-  const GrowableArray<BlockEntryInstr*>& preorder() const {
-    return preorder_;
-  }
+  const GrowableArray<BlockEntryInstr*>& preorder() const { return preorder_; }
   const GrowableArray<BlockEntryInstr*>& postorder() const {
     return postorder_;
   }
@@ -170,17 +153,11 @@
   void set_max_block_id(intptr_t id) { max_block_id_ = id; }
   intptr_t allocate_block_id() { return ++max_block_id_; }
 
-  GraphEntryInstr* graph_entry() const {
-    return graph_entry_;
-  }
+  GraphEntryInstr* graph_entry() const { return graph_entry_; }
 
-  ConstantInstr* constant_null() const {
-    return constant_null_;
-  }
+  ConstantInstr* constant_null() const { return constant_null_; }
 
-  ConstantInstr* constant_dead() const {
-    return constant_dead_;
-  }
+  ConstantInstr* constant_dead() const { return constant_dead_; }
 
   ConstantInstr* constant_empty_context() const {
     return constant_empty_context_;
@@ -286,9 +263,7 @@
     return deferred_prefixes_;
   }
 
-  BitVector* captured_parameters() const {
-    return captured_parameters_;
-  }
+  BitVector* captured_parameters() const { return captured_parameters_; }
 
   intptr_t inlining_id() const { return inlining_id_; }
   void set_inlining_id(intptr_t value) { inlining_id_ = value; }
@@ -310,6 +285,12 @@
   // Merge instructions (only per basic-block).
   void TryOptimizePatterns();
 
+  // Replaces uses that are dominated by dom of 'def' with 'other'.
+  // Note: uses that occur at instruction dom itself are not dominated by it.
+  static void RenameDominatedUses(Definition* def,
+                                  Instruction* dom,
+                                  Definition* other);
+
  private:
   friend class IfConverter;
   friend class BranchSimplifier;
@@ -319,28 +300,25 @@
   // SSA transformation methods and fields.
   void ComputeDominators(GrowableArray<BitVector*>* dominance_frontier);
 
-  void CompressPath(
-      intptr_t start_index,
-      intptr_t current_index,
-      GrowableArray<intptr_t>* parent,
-      GrowableArray<intptr_t>* label);
+  void CompressPath(intptr_t start_index,
+                    intptr_t current_index,
+                    GrowableArray<intptr_t>* parent,
+                    GrowableArray<intptr_t>* label);
 
   void Rename(GrowableArray<PhiInstr*>* live_phis,
               VariableLivenessAnalysis* variable_liveness,
               ZoneGrowableArray<Definition*>* inlining_parameters);
-  void RenameRecursive(
-      BlockEntryInstr* block_entry,
-      GrowableArray<Definition*>* env,
-      GrowableArray<PhiInstr*>* live_phis,
-      VariableLivenessAnalysis* variable_liveness);
+  void RenameRecursive(BlockEntryInstr* block_entry,
+                       GrowableArray<Definition*>* env,
+                       GrowableArray<PhiInstr*>* live_phis,
+                       VariableLivenessAnalysis* variable_liveness);
 
   void AttachEnvironment(Instruction* instr, GrowableArray<Definition*>* env);
 
-  void InsertPhis(
-      const GrowableArray<BlockEntryInstr*>& preorder,
-      const GrowableArray<BitVector*>& assigned_vars,
-      const GrowableArray<BitVector*>& dom_frontier,
-      GrowableArray<PhiInstr*>* live_phis);
+  void InsertPhis(const GrowableArray<BlockEntryInstr*>& preorder,
+                  const GrowableArray<BitVector*>& assigned_vars,
+                  const GrowableArray<BitVector*>& dom_frontier,
+                  GrowableArray<PhiInstr*>* live_phis);
 
   void RemoveDeadPhis(GrowableArray<PhiInstr*>* live_phis);
 
@@ -376,8 +354,10 @@
   void TryMergeMathUnary(
       GrowableArray<InvokeMathCFunctionInstr*>* merge_candidates);
 
-  void AppendExtractNthOutputForMerged(Definition* instr, intptr_t ix,
-                                       Representation rep, intptr_t cid);
+  void AppendExtractNthOutputForMerged(Definition* instr,
+                                       intptr_t ix,
+                                       Representation rep,
+                                       intptr_t cid);
 
   Thread* thread_;
 
@@ -422,7 +402,7 @@
 
   void Analyze();
 
-  virtual ~LivenessAnalysis() { }
+  virtual ~LivenessAnalysis() {}
 
   BitVector* GetLiveInSetAt(intptr_t postorder_number) const {
     return live_in_[postorder_number];
@@ -520,13 +500,10 @@
 
 class DefinitionWorklist : public ValueObject {
  public:
-  DefinitionWorklist(FlowGraph* flow_graph,
-                     intptr_t initial_capacity)
+  DefinitionWorklist(FlowGraph* flow_graph, intptr_t initial_capacity)
       : defs_(initial_capacity),
-        contains_vector_(
-            new BitVector(flow_graph->zone(),
-                          flow_graph->current_ssa_temp_index())) {
-  }
+        contains_vector_(new BitVector(flow_graph->zone(),
+                                       flow_graph->current_ssa_temp_index())) {}
 
   void Add(Definition* defn) {
     if (!Contains(defn)) {
@@ -537,12 +514,10 @@
 
   bool Contains(Definition* defn) const {
     return (defn->ssa_temp_index() >= 0) &&
-        contains_vector_->Contains(defn->ssa_temp_index());
+           contains_vector_->Contains(defn->ssa_temp_index());
   }
 
-  bool IsEmpty() const {
-    return defs_.is_empty();
-  }
+  bool IsEmpty() const { return defs_.is_empty(); }
 
   Definition* RemoveLast() {
     Definition* defn = defs_.RemoveLast();
@@ -566,4 +541,4 @@
 
 }  // namespace dart
 
-#endif  // VM_FLOW_GRAPH_H_
+#endif  // RUNTIME_VM_FLOW_GRAPH_H_
diff --git a/runtime/vm/flow_graph_allocator.cc b/runtime/vm/flow_graph_allocator.cc
index 7b62e37..9010074 100644
--- a/runtime/vm/flow_graph_allocator.cc
+++ b/runtime/vm/flow_graph_allocator.cc
@@ -11,6 +11,7 @@
 #include "vm/flow_graph_compiler.h"
 #include "vm/log.h"
 #include "vm/parser.h"
+#include "vm/stack_frame.h"
 
 namespace dart {
 
@@ -68,23 +69,23 @@
 
 FlowGraphAllocator::FlowGraphAllocator(const FlowGraph& flow_graph,
                                        bool intrinsic_mode)
-  : flow_graph_(flow_graph),
-    reaching_defs_(flow_graph),
-    value_representations_(flow_graph.max_virtual_register_number()),
-    block_order_(flow_graph.reverse_postorder()),
-    postorder_(flow_graph.postorder()),
-    liveness_(flow_graph),
-    vreg_count_(flow_graph.max_virtual_register_number()),
-    live_ranges_(flow_graph.max_virtual_register_number()),
-    cpu_regs_(),
-    fpu_regs_(),
-    blocked_cpu_registers_(),
-    blocked_fpu_registers_(),
-    number_of_registers_(0),
-    registers_(),
-    blocked_registers_(),
-    cpu_spill_slot_count_(0),
-    intrinsic_mode_(intrinsic_mode) {
+    : flow_graph_(flow_graph),
+      reaching_defs_(flow_graph),
+      value_representations_(flow_graph.max_virtual_register_number()),
+      block_order_(flow_graph.reverse_postorder()),
+      postorder_(flow_graph.postorder()),
+      liveness_(flow_graph),
+      vreg_count_(flow_graph.max_virtual_register_number()),
+      live_ranges_(flow_graph.max_virtual_register_number()),
+      cpu_regs_(),
+      fpu_regs_(),
+      blocked_cpu_registers_(),
+      blocked_fpu_registers_(),
+      number_of_registers_(0),
+      registers_(),
+      blocked_registers_(),
+      cpu_spill_slot_count_(0),
+      intrinsic_mode_(intrinsic_mode) {
   for (intptr_t i = 0; i < vreg_count_; i++) {
     live_ranges_.Add(NULL);
   }
@@ -195,8 +196,7 @@
       // Add non-argument uses from the deoptimization environment (pushed
       // arguments are not allocated by the register allocator).
       if (current->env() != NULL) {
-        for (Environment::DeepIterator env_it(current->env());
-             !env_it.Done();
+        for (Environment::DeepIterator env_it(current->env()); !env_it.Done();
              env_it.Advance()) {
           Definition* defn = env_it.CurrentValue()->definition();
           if (defn->IsMaterializeObject()) {
@@ -248,8 +248,7 @@
     } else if (block->IsCatchBlockEntry()) {
       // Process initial definitions.
       CatchBlockEntryInstr* catch_entry = block->AsCatchBlockEntry();
-      for (intptr_t i = 0;
-           i < catch_entry->initial_definitions()->length();
+      for (intptr_t i = 0; i < catch_entry->initial_definitions()->length();
            i++) {
         Definition* def = (*catch_entry->initial_definitions())[i];
         const intptr_t vreg = def->ssa_temp_index();
@@ -274,8 +273,7 @@
   ASSERT((first_use_interval_->start_ <= pos) &&
          (pos <= first_use_interval_->end_));
   if (uses_ != NULL) {
-    if ((uses_->pos() == pos) &&
-        (uses_->location_slot() == location_slot)) {
+    if ((uses_->pos() == pos) && (uses_->location_slot() == location_slot)) {
       return uses_;
     } else if (uses_->pos() < pos) {
       // If an instruction at position P is using the same value both as
@@ -442,8 +440,8 @@
   if (loc.IsRegister()) {
     BlockRegisterLocation(loc, from, to, blocked_cpu_registers_, cpu_regs_);
 #if defined(TARGET_ARCH_DBC)
-    last_used_register_ = Utils::Maximum(last_used_register_,
-                                         loc.register_code());
+    last_used_register_ =
+        Utils::Maximum(last_used_register_, loc.register_code());
 #endif
   } else if (loc.IsFpuRegister()) {
     BlockRegisterLocation(loc, from, to, blocked_fpu_registers_, fpu_regs_);
@@ -458,9 +456,8 @@
     return;
   }
 
-  THR_Print("  live range v%" Pd " [%" Pd ", %" Pd ") in ", vreg(),
-                                                            Start(),
-                                                            End());
+  THR_Print("  live range v%" Pd " [%" Pd ", %" Pd ") in ", vreg(), Start(),
+            End());
   assigned_location().Print();
   if (spill_slot_.HasStackIndex()) {
     intptr_t stack_slot = spill_slot_.stack_index();
@@ -477,11 +474,9 @@
   }
 
   UsePosition* use_pos = uses_;
-  for (UseInterval* interval = first_use_interval_;
-       interval != NULL;
+  for (UseInterval* interval = first_use_interval_; interval != NULL;
        interval = interval->next()) {
-    THR_Print("    use interval [%" Pd ", %" Pd ")\n",
-              interval->start(),
+    THR_Print("    use interval [%" Pd ", %" Pd ")\n", interval->start(),
               interval->end());
     while ((use_pos != NULL) && (use_pos->pos() <= interval->end())) {
       THR_Print("      use at %" Pd "", use_pos->pos());
@@ -559,8 +554,7 @@
     // For every SSA value that is live out of this block, create an interval
     // that covers the whole block.  It will be shortened if we encounter a
     // definition of this value in this block.
-    for (BitVector::Iterator it(liveness_.GetLiveOutSetAt(i));
-         !it.Done();
+    for (BitVector::Iterator it(liveness_.GetLiveOutSetAt(i)); !it.Done();
          it.Advance()) {
       LiveRange* range = GetLiveRange(it.Current());
       range->AddUseInterval(block->start_pos(), block->end_pos());
@@ -568,21 +562,20 @@
 
     BlockInfo* loop_header = block_info->loop_header();
     if ((loop_header != NULL) && (loop_header->last_block() == block)) {
-      current_interference_set = new(zone) BitVector(
-          zone, flow_graph_.max_virtual_register_number());
+      current_interference_set =
+          new (zone) BitVector(zone, flow_graph_.max_virtual_register_number());
       ASSERT(loop_header->backedge_interference() == NULL);
       // All values flowing into the loop header are live at the back-edge and
       // can interfere with phi moves.
       current_interference_set->AddAll(
           liveness_.GetLiveInSet(loop_header->entry()));
-      loop_header->set_backedge_interference(
-          current_interference_set);
+      loop_header->set_backedge_interference(current_interference_set);
     }
 
     // Connect outgoing phi-moves that were created in NumberInstructions
     // and find last instruction that contributes to liveness.
-    Instruction* current = ConnectOutgoingPhiMoves(block,
-                                                   current_interference_set);
+    Instruction* current =
+        ConnectOutgoingPhiMoves(block, current_interference_set);
 
     // Now process all instructions in reverse order.
     while (current != block) {
@@ -597,8 +590,7 @@
     // Check if any values live into the loop can be spilled for free.
     if (block_info->is_loop_header()) {
       current_interference_set = NULL;
-      for (BitVector::Iterator it(liveness_.GetLiveInSetAt(i));
-           !it.Done();
+      for (BitVector::Iterator it(liveness_.GetLiveInSetAt(i)); !it.Done();
            it.Advance()) {
         LiveRange* range = GetLiveRange(it.Current());
         if (HasOnlyUnconstrainedUsesInLoop(range, block_info)) {
@@ -612,15 +604,10 @@
     } else if (block->IsCatchBlockEntry()) {
       // Process initial definitions.
       CatchBlockEntryInstr* catch_entry = block->AsCatchBlockEntry();
-#if defined(TARGET_ARCH_DBC)
-      // TODO(vegorov) support try-catch/finally for DBC.
-      flow_graph_.parsed_function().Bailout("FlowGraphAllocator", "Catch");
-#endif
 
       ProcessEnvironmentUses(catch_entry, catch_entry);  // For lazy deopt
 
-      for (intptr_t i = 0;
-           i < catch_entry->initial_definitions()->length();
+      for (intptr_t i = 0; i < catch_entry->initial_definitions()->length();
            i++) {
         Definition* defn = (*catch_entry->initial_definitions())[i];
         LiveRange* range = GetLiveRange(defn->ssa_temp_index());
@@ -631,11 +618,18 @@
       // block start to until the end of the instruction so that they are
       // preserved.
       intptr_t start = catch_entry->start_pos();
-      BlockLocation(Location::RegisterLocation(kExceptionObjectReg),
-                    start,
+#if !defined(TARGET_ARCH_DBC)
+      const Register exception_reg = kExceptionObjectReg;
+      const Register stacktrace_reg = kStackTraceObjectReg;
+#else
+      const intptr_t exception_reg =
+          LocalVarIndex(0, catch_entry->exception_var().index());
+      const intptr_t stacktrace_reg =
+          LocalVarIndex(0, catch_entry->stacktrace_var().index());
+#endif
+      BlockLocation(Location::RegisterLocation(exception_reg), start,
                     ToInstructionEnd(start));
-      BlockLocation(Location::RegisterLocation(kStackTraceObjectReg),
-                    start,
+      BlockLocation(Location::RegisterLocation(stacktrace_reg), start,
                     ToInstructionEnd(start));
     }
   }
@@ -654,9 +648,51 @@
 }
 
 
+void FlowGraphAllocator::SplitInitialDefinitionAt(LiveRange* range,
+                                                  intptr_t pos) {
+  if (range->End() > pos) {
+    LiveRange* tail = range->SplitAt(pos);
+    CompleteRange(tail, Location::kRegister);
+  }
+}
+
+
 void FlowGraphAllocator::ProcessInitialDefinition(Definition* defn,
                                                   LiveRange* range,
                                                   BlockEntryInstr* block) {
+#if defined(TARGET_ARCH_DBC)
+  if (block->IsCatchBlockEntry()) {
+    if (defn->IsParameter()) {
+      ParameterInstr* param = defn->AsParameter();
+      intptr_t slot_index = param->index();
+      AssignSafepoints(defn, range);
+      range->finger()->Initialize(range);
+      slot_index = kNumberOfCpuRegisters - 1 - slot_index;
+      range->set_assigned_location(Location::RegisterLocation(slot_index));
+      SplitInitialDefinitionAt(range, block->lifetime_position() + 2);
+      ConvertAllUses(range);
+      BlockLocation(Location::RegisterLocation(slot_index), 0, kMaxPosition);
+    } else {
+      ConstantInstr* constant = defn->AsConstant();
+      ASSERT(constant != NULL);
+      range->set_assigned_location(Location::Constant(constant));
+      range->set_spill_slot(Location::Constant(constant));
+      AssignSafepoints(defn, range);
+      range->finger()->Initialize(range);
+      UsePosition* use =
+          range->finger()->FirstRegisterBeneficialUse(block->start_pos());
+      if (use != NULL) {
+        LiveRange* tail = SplitBetween(range, block->start_pos(), use->pos());
+        // Parameters and constants are tagged, so allocated to CPU registers.
+        ASSERT(constant->representation() == kTagged);
+        CompleteRange(tail, Location::kRegister);
+      }
+      ConvertAllUses(range);
+    }
+    return;
+  }
+#endif
+
   // Save the range end because it may change below.
   intptr_t range_end = range->End();
   if (defn->IsParameter()) {
@@ -679,18 +715,14 @@
       AssignSafepoints(defn, range);
       range->finger()->Initialize(range);
       range->set_assigned_location(Location::RegisterLocation(slot_index));
-      if (range->End() > kNormalEntryPos) {
-        LiveRange* tail = range->SplitAt(kNormalEntryPos);
-        CompleteRange(tail, Location::kRegister);
-      }
+      SplitInitialDefinitionAt(range, kNormalEntryPos);
       ConvertAllUses(range);
       return;
     }
 #endif  // defined(TARGET_ARCH_DBC)
-    range->set_assigned_location(Location::StackSlot(slot_index,
-                                                     param->base_reg()));
-    range->set_spill_slot(Location::StackSlot(slot_index,
-                                              param->base_reg()));
+    range->set_assigned_location(
+        Location::StackSlot(slot_index, param->base_reg()));
+    range->set_spill_slot(Location::StackSlot(slot_index, param->base_reg()));
 
   } else if (defn->IsCurrentContext()) {
 #if !defined(TARGET_ARCH_DBC)
@@ -719,8 +751,7 @@
   UsePosition* use =
       range->finger()->FirstRegisterBeneficialUse(block->start_pos());
   if (use != NULL) {
-    LiveRange* tail =
-        SplitBetween(range, block->start_pos(), use->pos());
+    LiveRange* tail = SplitBetween(range, block->start_pos(), use->pos());
     // Parameters and constants are tagged, so allocated to CPU registers.
     CompleteRange(tail, Location::kRegister);
   }
@@ -796,7 +827,8 @@
 //
 
 Instruction* FlowGraphAllocator::ConnectOutgoingPhiMoves(
-    BlockEntryInstr* block, BitVector* interfere_at_backedge) {
+    BlockEntryInstr* block,
+    BitVector* interfere_at_backedge) {
   Instruction* last = block->last_instruction();
 
   GotoInstr* goto_instr = last->AsGoto();
@@ -843,8 +875,7 @@
 
     range->AddUseInterval(block->start_pos(), pos);
     range->AddHintedUse(
-        pos,
-        move->src_slot(),
+        pos, move->src_slot(),
         GetLiveRange(phi->ssa_temp_index())->assigned_location_slot());
     move->set_src(Location::PrefersRegister());
 
@@ -856,11 +887,9 @@
         interfere_at_backedge->Add(vreg);
       }
       range->AddUseInterval(block->start_pos(), pos);
-      range->AddHintedUse(
-          pos,
-          move->src_slot(),
-          GetLiveRange(ToSecondPairVreg(
-              phi->ssa_temp_index()))->assigned_location_slot());
+      range->AddHintedUse(pos, move->src_slot(),
+                          GetLiveRange(ToSecondPairVreg(phi->ssa_temp_index()))
+                              ->assigned_location_slot());
       move->set_src(Location::PrefersRegister());
     }
   }
@@ -998,7 +1027,7 @@
         {
           // Second live range.
           LiveRange* range =
-            GetLiveRange(ToSecondPairVreg(def->ssa_temp_index()));
+              GetLiveRange(ToSecondPairVreg(def->ssa_temp_index()));
           range->AddUseInterval(block_start_pos, use_pos);
           range->AddUse(use_pos, location_pair->SlotAt(1));
         }
@@ -1057,8 +1086,8 @@
       }
     } else if (def->IsMaterializeObject()) {
       locations[i] = Location::NoLocation();
-      ProcessMaterializationUses(
-          block, block_start_pos, use_pos, def->AsMaterializeObject());
+      ProcessMaterializationUses(block, block_start_pos, use_pos,
+                                 def->AsMaterializeObject());
     } else {
       locations[i] = Location::Any();
       LiveRange* range = GetLiveRange(def->ssa_temp_index());
@@ -1091,8 +1120,7 @@
     if (live_registers != NULL) {
       live_registers->Add(*in_ref, range->representation());
     }
-    MoveOperands* move =
-        AddMoveAt(pos - 1, *in_ref, Location::Any());
+    MoveOperands* move = AddMoveAt(pos - 1, *in_ref, Location::Any());
     BlockLocation(*in_ref, pos - 1, pos + 1);
     range->AddUseInterval(block->start_pos(), pos - 1);
     range->AddHintedUse(pos - 1, move->src_slot(), in_ref);
@@ -1104,8 +1132,7 @@
       //                 i  i'
       //      value    --*
       //      temp       [--)
-      MoveOperands* move = AddMoveAt(pos,
-                                     Location::RequiresRegister(),
+      MoveOperands* move = AddMoveAt(pos, Location::RequiresRegister(),
                                      Location::PrefersRegister());
 
       // Add uses to the live range of the input.
@@ -1150,8 +1177,8 @@
   ASSERT(def != NULL);
   ASSERT(block != NULL);
 
-  LiveRange* range = vreg >= 0 ?
-      GetLiveRange(vreg) : MakeLiveRangeForTemporary();
+  LiveRange* range =
+      vreg >= 0 ? GetLiveRange(vreg) : MakeLiveRangeForTemporary();
 
   // Process output and finalize its liverange.
   if (out->IsMachineRegister()) {
@@ -1203,9 +1230,8 @@
            in_ref->Equals(Location::RequiresFpuRegister()));
     *out = *in_ref;
     // Create move that will copy value between input and output.
-    MoveOperands* move = AddMoveAt(pos,
-                                   Location::RequiresRegister(),
-                                   Location::Any());
+    MoveOperands* move =
+        AddMoveAt(pos, Location::RequiresRegister(), Location::Any());
 
     // Add uses to the live range of the input.
     LiveRange* input_range = GetLiveRange(input_vreg);
@@ -1219,8 +1245,7 @@
     range->AddUse(pos, move->dest_slot());
     range->AddUse(pos, in_ref);
 
-    if ((interference_set != NULL) &&
-        (range->vreg() >= 0) &&
+    if ((interference_set != NULL) && (range->vreg() >= 0) &&
         interference_set->Contains(range->vreg())) {
       interference_set->Add(input->ssa_temp_index());
     }
@@ -1255,8 +1280,9 @@
   Definition* def = current->AsDefinition();
   if ((def != NULL) && (def->AsConstant() != NULL)) {
     ASSERT(!def->HasPairRepresentation());
-    LiveRange* range = (def->ssa_temp_index() != -1) ?
-        GetLiveRange(def->ssa_temp_index()) : NULL;
+    LiveRange* range = (def->ssa_temp_index() != -1)
+                           ? GetLiveRange(def->ssa_temp_index())
+                           : NULL;
 
     // Drop definitions of constants that have no uses.
     if ((range == NULL) || (range->first_use() == NULL)) {
@@ -1322,8 +1348,7 @@
   // they will be processed together at the very end.
   {
     for (intptr_t j = output_same_as_first_input ? 1 : 0;
-         j < locs->input_count();
-         j++) {
+         j < locs->input_count(); j++) {
       // Determine if we are dealing with a value pair, and if so, whether
       // the location is the first register or second register.
       Value* input = current->InputAt(j);
@@ -1338,8 +1363,8 @@
         const intptr_t vreg = input->definition()->ssa_temp_index();
         // Each element of the pair is assigned it's own virtual register number
         // and is allocated its own LiveRange.
-        ProcessOneInput(block, pos, pair->SlotAt(0),
-                        input, vreg, live_registers);
+        ProcessOneInput(block, pos, pair->SlotAt(0), input, vreg,
+                        live_registers);
         ProcessOneInput(block, pos, pair->SlotAt(1), input,
                         ToSecondPairVreg(vreg), live_registers);
       } else {
@@ -1372,9 +1397,9 @@
     }
   }
 
-  // Block all allocatable registers for calls.
-  // Note that on DBC registers are always essentially spilled so
-  // we don't need to block anything.
+// Block all allocatable registers for calls.
+// Note that on DBC registers are always essentially spilled so
+// we don't need to block anything.
 #if !defined(TARGET_ARCH_DBC)
   if (locs->always_calls()) {
     // Expected shape of live range:
@@ -1384,15 +1409,13 @@
     //
     // The stack bitmap describes the position i.
     for (intptr_t reg = 0; reg < kNumberOfCpuRegisters; reg++) {
-      BlockLocation(Location::RegisterLocation(static_cast<Register>(reg)),
-                    pos,
+      BlockLocation(Location::RegisterLocation(static_cast<Register>(reg)), pos,
                     pos + 1);
     }
 
     for (intptr_t reg = 0; reg < kNumberOfFpuRegisters; reg++) {
       BlockLocation(
-          Location::FpuRegisterLocation(static_cast<FpuRegister>(reg)),
-          pos,
+          Location::FpuRegisterLocation(static_cast<FpuRegister>(reg)), pos,
           pos + 1);
     }
 
@@ -1453,54 +1476,44 @@
       ASSERT(input->HasPairRepresentation());
       // Each element of the pair is assigned it's own virtual register number
       // and is allocated its own LiveRange.
-      ProcessOneOutput(block, pos,  // BlockEntry, seq.
-                       pair->SlotAt(0), def,  // (output) Location, Definition.
+      ProcessOneOutput(block, pos,             // BlockEntry, seq.
+                       pair->SlotAt(0), def,   // (output) Location, Definition.
                        def->ssa_temp_index(),  // (output) virtual register.
-                       true,  // output mapped to first input.
+                       true,                   // output mapped to first input.
                        in_pair->SlotAt(0), input,  // (input) Location, Def.
-                       input->ssa_temp_index(),  // (input) virtual register.
+                       input->ssa_temp_index(),    // (input) virtual register.
                        interference_set);
-      ProcessOneOutput(block, pos,
-                       pair->SlotAt(1), def,
-                       ToSecondPairVreg(def->ssa_temp_index()),
-                       true,
-                       in_pair->SlotAt(1), input,
-                       ToSecondPairVreg(input->ssa_temp_index()),
-                       interference_set);
+      ProcessOneOutput(
+          block, pos, pair->SlotAt(1), def,
+          ToSecondPairVreg(def->ssa_temp_index()), true, in_pair->SlotAt(1),
+          input, ToSecondPairVreg(input->ssa_temp_index()), interference_set);
     } else {
       // Each element of the pair is assigned it's own virtual register number
       // and is allocated its own LiveRange.
-      ProcessOneOutput(block, pos,
-                       pair->SlotAt(0), def,
-                       def->ssa_temp_index(),
-                       false,            // output is not mapped to first input.
-                       NULL, NULL, -1,   // First input not needed.
+      ProcessOneOutput(block, pos, pair->SlotAt(0), def, def->ssa_temp_index(),
+                       false,           // output is not mapped to first input.
+                       NULL, NULL, -1,  // First input not needed.
                        interference_set);
-      ProcessOneOutput(block, pos,
-                       pair->SlotAt(1), def,
-                       ToSecondPairVreg(def->ssa_temp_index()),
-                       false,
-                       NULL, NULL, -1,
-                       interference_set);
+      ProcessOneOutput(block, pos, pair->SlotAt(1), def,
+                       ToSecondPairVreg(def->ssa_temp_index()), false, NULL,
+                       NULL, -1, interference_set);
     }
   } else {
     if (output_same_as_first_input) {
       Location* in_ref = locs->in_slot(0);
       Definition* input = current->InputAt(0)->definition();
       ASSERT(!in_ref->IsPairLocation());
-      ProcessOneOutput(block, pos,  // BlockEntry, Instruction, seq.
-                       out, def,  // (output) Location, Definition.
+      ProcessOneOutput(block, pos,             // BlockEntry, Instruction, seq.
+                       out, def,               // (output) Location, Definition.
                        def->ssa_temp_index(),  // (output) virtual register.
-                       true,  // output mapped to first input.
-                       in_ref, input,  // (input) Location, Def.
+                       true,                   // output mapped to first input.
+                       in_ref, input,          // (input) Location, Def.
                        input->ssa_temp_index(),  // (input) virtual register.
                        interference_set);
     } else {
-      ProcessOneOutput(block, pos,
-                       out, def,
-                       def->ssa_temp_index(),
-                       false,            // output is not mapped to first input.
-                       NULL, NULL, -1,   // First input not needed.
+      ProcessOneOutput(block, pos, out, def, def->ssa_temp_index(),
+                       false,           // output is not mapped to first input.
+                       NULL, NULL, -1,  // First input not needed.
                        interference_set);
     }
   }
@@ -1621,7 +1634,7 @@
         if (!successor_info->is_loop_header() &&
             ((current_loop == NULL) ||
              (current_loop->entry()->postorder_number() >
-                  successor_info->entry()->postorder_number()))) {
+              successor_info->entry()->postorder_number()))) {
           ASSERT(successor_info != current_loop);
 
           successor_info->mark_loop_header();
@@ -1672,7 +1685,8 @@
 
 bool AllocationFinger::Advance(const intptr_t start) {
   UseInterval* a = first_pending_use_interval_;
-  while (a != NULL && a->end() <= start) a = a->next();
+  while (a != NULL && a->end() <= start)
+    a = a->next();
   first_pending_use_interval_ = a;
   return (first_pending_use_interval_ == NULL);
 }
@@ -1700,12 +1714,11 @@
 
 UsePosition* AllocationFinger::FirstRegisterUse(intptr_t after) {
   for (UsePosition* use = FirstUseAfter(first_register_use_, after);
-       use != NULL;
-       use = use->next()) {
+       use != NULL; use = use->next()) {
     Location* loc = use->location_slot();
     if (loc->IsUnallocated() &&
         ((loc->policy() == Location::kRequiresRegister) ||
-        (loc->policy() == Location::kRequiresFpuRegister))) {
+         (loc->policy() == Location::kRequiresFpuRegister))) {
       first_register_use_ = use;
       return use;
     }
@@ -1716,8 +1729,7 @@
 
 UsePosition* AllocationFinger::FirstRegisterBeneficialUse(intptr_t after) {
   for (UsePosition* use = FirstUseAfter(first_register_beneficial_use_, after);
-       use != NULL;
-       use = use->next()) {
+       use != NULL; use = use->next()) {
     Location* loc = use->location_slot();
     if (loc->IsUnallocated() && loc->IsRegisterBeneficial()) {
       first_register_beneficial_use_ = use;
@@ -1777,7 +1789,7 @@
 }
 
 
-template<typename PositionType>
+template <typename PositionType>
 PositionType* SplitListOfPositions(PositionType** head,
                                    intptr_t split_pos,
                                    bool split_at_start) {
@@ -1830,9 +1842,8 @@
 
   UseInterval* first_after_split = interval;
   if (!split_at_start && interval->Contains(split_pos)) {
-    first_after_split = new UseInterval(split_pos,
-                                        interval->end(),
-                                        interval->next());
+    first_after_split =
+        new UseInterval(split_pos, interval->end(), interval->next());
     interval->end_ = split_pos;
     interval->next_ = first_after_split;
     last_before_split = interval;
@@ -1849,15 +1860,12 @@
   SafepointPosition* first_safepoint_after_split =
       SplitListOfPositions(&first_safepoint_, split_pos, split_at_start);
 
-  UseInterval* last_use_interval = (last_before_split == last_use_interval_) ?
-    first_after_split : last_use_interval_;
-  next_sibling_ = new LiveRange(vreg(),
-                                representation(),
-                                first_use_after_split,
-                                first_after_split,
-                                last_use_interval,
-                                first_safepoint_after_split,
-                                next_sibling_);
+  UseInterval* last_use_interval = (last_before_split == last_use_interval_)
+                                       ? first_after_split
+                                       : last_use_interval_;
+  next_sibling_ = new LiveRange(vreg(), representation(), first_use_after_split,
+                                first_after_split, last_use_interval,
+                                first_safepoint_after_split, next_sibling_);
 
   TRACE_ALLOC(THR_Print("  split sibling [%" Pd ", %" Pd ")\n",
                         next_sibling_->Start(), next_sibling_->End()));
@@ -1876,8 +1884,8 @@
 LiveRange* FlowGraphAllocator::SplitBetween(LiveRange* range,
                                             intptr_t from,
                                             intptr_t to) {
-  TRACE_ALLOC(THR_Print("split v%" Pd " [%" Pd ", %" Pd
-                        ") between [%" Pd ", %" Pd ")\n",
+  TRACE_ALLOC(THR_Print("split v%" Pd " [%" Pd ", %" Pd ") between [%" Pd
+                        ", %" Pd ")\n",
                         range->vreg(), range->Start(), range->End(), from, to));
 
   intptr_t split_pos = kIllegalPosition;
@@ -1948,8 +1956,8 @@
         RangeHasOnlyUnconstrainedUsesInLoop(range, loop_header->loop_id())) {
       ASSERT(loop_header->entry()->start_pos() <= from);
       from = loop_header->entry()->start_pos();
-      TRACE_ALLOC(THR_Print("  moved spill position to loop header %" Pd "\n",
-                            from));
+      TRACE_ALLOC(
+          THR_Print("  moved spill position to loop header %" Pd "\n", from));
     }
   }
 
@@ -1985,11 +1993,11 @@
   // double and quad spill slots as it complicates disambiguation during
   // parallel move resolution.
   const bool need_quad = (register_kind_ == Location::kFpuRegister) &&
-      ((range->representation() == kUnboxedFloat32x4) ||
-       (range->representation() == kUnboxedInt32x4)   ||
-       (range->representation() == kUnboxedFloat64x2));
+                         ((range->representation() == kUnboxedFloat32x4) ||
+                          (range->representation() == kUnboxedInt32x4) ||
+                          (range->representation() == kUnboxedFloat64x2));
   const bool need_untagged = (register_kind_ == Location::kRegister) &&
-      ((range->representation() == kUntagged));
+                             ((range->representation() == kUntagged));
 
   // Search for a free spill slot among allocated: the value in it should be
   // dead and its type should match (e.g. it should not be a part of the quad if
@@ -1997,8 +2005,8 @@
   // For CPU registers we need to take reserved slots for try-catch into
   // account.
   intptr_t idx = register_kind_ == Location::kRegister
-      ? flow_graph_.graph_entry()->fixed_slot_count()
-      : 0;
+                     ? flow_graph_.graph_entry()->fixed_slot_count()
+                     : 0;
   for (; idx < spill_slots_.length(); idx++) {
     if ((need_quad == quad_spill_slots_[idx]) &&
         (need_untagged == untagged_spill_slots_[idx]) &&
@@ -2036,8 +2044,8 @@
     // We use the index of the slot with the lowest 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 = cpu_spill_slot_count_ +
-        idx * kDoubleSpillFactor + (kDoubleSpillFactor - 1);
+    const intptr_t slot_idx = cpu_spill_slot_count_ + idx * kDoubleSpillFactor +
+                              (kDoubleSpillFactor - 1);
 
     Location location;
     if ((range->representation() == kUnboxedFloat32x4) ||
@@ -2062,8 +2070,7 @@
 
   while (range != NULL) {
     for (SafepointPosition* safepoint = range->first_safepoint();
-         safepoint != NULL;
-         safepoint = safepoint->next()) {
+         safepoint != NULL; safepoint = safepoint->next()) {
       // Mark the stack slot as having an object.
       safepoint->locs()->SetStackBit(stack_index);
     }
@@ -2086,7 +2093,8 @@
 
 
 intptr_t FlowGraphAllocator::FirstIntersectionWithAllocated(
-    intptr_t reg, LiveRange* unallocated) {
+    intptr_t reg,
+    LiveRange* unallocated) {
   intptr_t intersection = kMaxPosition;
   for (intptr_t i = 0; i < registers_[reg]->length(); i++) {
     LiveRange* allocated = (*registers_[reg])[i];
@@ -2097,8 +2105,7 @@
     if (allocated_head->start() >= intersection) continue;
 
     const intptr_t pos = FirstIntersection(
-        unallocated->finger()->first_pending_use_interval(),
-        allocated_head);
+        unallocated->finger()->first_pending_use_interval(), allocated_head);
     if (pos < intersection) intersection = pos;
   }
   return intersection;
@@ -2108,8 +2115,8 @@
 void ReachingDefs::AddPhi(PhiInstr* phi) {
   if (phi->reaching_defs() == NULL) {
     Zone* zone = flow_graph_.zone();
-    phi->set_reaching_defs(new(zone) BitVector(
-        zone, flow_graph_.max_virtual_register_number()));
+    phi->set_reaching_defs(
+        new (zone) BitVector(zone, flow_graph_.max_virtual_register_number()));
 
     // Compute initial set reaching defs set.
     bool depends_on_phi = false;
@@ -2184,15 +2191,13 @@
   Location hint = unallocated->finger()->FirstHint();
   if (hint.IsMachineRegister()) {
     if (!blocked_registers_[hint.register_code()]) {
-      free_until = FirstIntersectionWithAllocated(hint.register_code(),
-                                                  unallocated);
+      free_until =
+          FirstIntersectionWithAllocated(hint.register_code(), unallocated);
       candidate = hint.register_code();
     }
 
     TRACE_ALLOC(THR_Print("found hint %s for v%" Pd ": free until %" Pd "\n",
-                          hint.Name(),
-                          unallocated->vreg(),
-                          free_until));
+                          hint.Name(), unallocated->vreg(), free_until));
   } else {
     for (intptr_t reg = 0; reg < NumberOfRegisters(); ++reg) {
       if (!blocked_registers_[reg] && (registers_[reg]->length() == 0)) {
@@ -2225,8 +2230,7 @@
   // searching for a candidate that does not interfere with phis on the back
   // edge.
   BlockInfo* loop_header = BlockInfoAt(unallocated->Start())->loop_header();
-  if ((unallocated->vreg() >= 0) &&
-      (loop_header != NULL) &&
+  if ((unallocated->vreg() >= 0) && (loop_header != NULL) &&
       (free_until >= loop_header->last_block()->end_pos()) &&
       loop_header->backedge_interference()->Contains(unallocated->vreg())) {
     GrowableArray<bool> used_on_backedge(number_of_registers_);
@@ -2234,8 +2238,7 @@
       used_on_backedge.Add(false);
     }
 
-    for (PhiIterator it(loop_header->entry()->AsJoinEntry());
-         !it.Done();
+    for (PhiIterator it(loop_header->entry()->AsJoinEntry()); !it.Done();
          it.Advance()) {
       PhiInstr* phi = it.Current();
       ASSERT(phi->is_alive());
@@ -2261,16 +2264,15 @@
     }
 
     if (used_on_backedge[candidate]) {
-      TRACE_ALLOC(THR_Print(
-          "considering %s for v%" Pd ": has interference on the back edge"
-          " {loop [%" Pd ", %" Pd ")}\n",
-          MakeRegisterLocation(candidate).Name(),
-          unallocated->vreg(),
-          loop_header->entry()->start_pos(),
-          loop_header->last_block()->end_pos()));
+      TRACE_ALLOC(THR_Print("considering %s for v%" Pd
+                            ": has interference on the back edge"
+                            " {loop [%" Pd ", %" Pd ")}\n",
+                            MakeRegisterLocation(candidate).Name(),
+                            unallocated->vreg(),
+                            loop_header->entry()->start_pos(),
+                            loop_header->last_block()->end_pos()));
       for (intptr_t reg = 0; reg < NumberOfRegisters(); ++reg) {
-        if (blocked_registers_[reg] ||
-            (reg == candidate) ||
+        if (blocked_registers_[reg] || (reg == candidate) ||
             used_on_backedge[reg]) {
           continue;
         }
@@ -2282,8 +2284,7 @@
           free_until = intersection;
           TRACE_ALLOC(THR_Print(
               "found %s for v%" Pd " with no interference on the back edge\n",
-              MakeRegisterLocation(candidate).Name(),
-              candidate));
+              MakeRegisterLocation(candidate).Name(), candidate));
           break;
         }
       }
@@ -2387,8 +2388,7 @@
   }
 
   const intptr_t register_use_pos =
-      (register_use != NULL) ? register_use->pos()
-                             : unallocated->Start();
+      (register_use != NULL) ? register_use->pos() : unallocated->Start();
   if (free_until < register_use_pos) {
     // Can't acquire free register. Spill until we really need one.
     ASSERT(unallocated->Start() < ToInstructionStart(register_use_pos));
@@ -2406,9 +2406,8 @@
   if (blocked_at < unallocated->End()) {
     // Register is blocked before the end of the live range.  Split the range
     // at latest at blocked_at position.
-    LiveRange* tail = SplitBetween(unallocated,
-                                   unallocated->Start(),
-                                   blocked_at + 1);
+    LiveRange* tail =
+        SplitBetween(unallocated, unallocated->Start(), blocked_at + 1);
     AddToUnallocated(tail);
   }
 
@@ -2437,8 +2436,7 @@
         return false;
       }
 
-      UsePosition* use =
-          allocated->finger()->FirstInterferingUse(start);
+      UsePosition* use = allocated->finger()->FirstInterferingUse(start);
       if ((use != NULL) && ((ToInstructionStart(use->pos()) - start) <= 1)) {
         // This register is blocked by interval that is used
         // as register in the current instruction and can't
@@ -2446,8 +2444,7 @@
         return false;
       }
 
-      const intptr_t use_pos = (use != NULL) ? use->pos()
-                                             : allocated->End();
+      const intptr_t use_pos = (use != NULL) ? use->pos() : allocated->End();
 
       if (use_pos < free_until) free_until = use_pos;
     } else {
@@ -2516,8 +2513,7 @@
   UseInterval* first_unallocated =
       unallocated->finger()->first_pending_use_interval();
   const intptr_t intersection = FirstIntersection(
-      allocated->finger()->first_pending_use_interval(),
-      first_unallocated);
+      allocated->finger()->first_pending_use_interval(), first_unallocated);
   if (intersection == kMaxPosition) return false;
 
   const intptr_t spill_position = first_unallocated->start();
@@ -2595,8 +2591,7 @@
   // code.
   if (loc.IsMachineRegister()) {
     for (SafepointPosition* safepoint = range->first_safepoint();
-         safepoint != NULL;
-         safepoint = safepoint->next()) {
+         safepoint != NULL; safepoint = safepoint->next()) {
 #if !defined(TARGET_ARCH_DBC)
       if (!safepoint->locs()->always_calls()) {
         ASSERT(safepoint->locs()->can_call());
@@ -2634,8 +2629,7 @@
 bool LiveRange::Contains(intptr_t pos) const {
   if (!CanCover(pos)) return false;
 
-  for (UseInterval* interval = first_use_interval_;
-       interval != NULL;
+  for (UseInterval* interval = first_use_interval_; interval != NULL;
        interval = interval->next()) {
     if (interval->Contains(pos)) {
       return true;
@@ -2646,8 +2640,7 @@
 }
 
 
-void FlowGraphAllocator::AssignSafepoints(Definition* defn,
-                                          LiveRange* range) {
+void FlowGraphAllocator::AssignSafepoints(Definition* defn, LiveRange* range) {
   for (intptr_t i = safepoints_.length() - 1; i >= 0; i--) {
     Instruction* safepoint_instr = safepoints_[i];
     if (safepoint_instr == defn) {
@@ -2769,8 +2762,7 @@
     const intptr_t start = range->Start();
     TRACE_ALLOC(THR_Print("Processing live range for v%" Pd " "
                           "starting at %" Pd "\n",
-                          range->vreg(),
-                          start));
+                          range->vreg(), start));
 
     // TODO(vegorov): eagerly spill liveranges without register uses.
     AdvanceActiveIntervals(start);
@@ -2797,8 +2789,7 @@
 
 bool FlowGraphAllocator::TargetLocationIsSpillSlot(LiveRange* range,
                                                    Location target) {
-  if (target.IsStackSlot() ||
-      target.IsDoubleStackSlot() ||
+  if (target.IsStackSlot() || target.IsDoubleStackSlot() ||
       target.IsConstant()) {
     ASSERT(GetLiveRange(range->vreg())->spill_slot().Equals(target));
     return true;
@@ -2811,8 +2802,7 @@
                                               BlockEntryInstr* source_block,
                                               BlockEntryInstr* target_block) {
   TRACE_ALLOC(THR_Print("Connect v%" Pd " on the edge B%" Pd " -> B%" Pd "\n",
-                        parent->vreg(),
-                        source_block->block_id(),
+                        parent->vreg(), source_block->block_id(),
                         target_block->block_id()));
   if (parent->next_sibling() == NULL) {
     // Nothing to connect. The whole range was allocated to the same location.
@@ -2855,12 +2845,9 @@
 
   TRACE_ALLOC(THR_Print("connecting v%" Pd " between [%" Pd ", %" Pd ") {%s} "
                         "to [%" Pd ", %" Pd ") {%s}\n",
-                        parent->vreg(),
-                        source_cover->Start(),
-                        source_cover->End(),
-                        source.Name(),
-                        target_cover->Start(),
-                        target_cover->End(),
+                        parent->vreg(), source_cover->Start(),
+                        source_cover->End(), source.Name(),
+                        target_cover->Start(), target_cover->End(),
                         target.Name()));
 
   // Siblings were allocated to the same register.
@@ -2890,19 +2877,18 @@
 
     while (range->next_sibling() != NULL) {
       LiveRange* sibling = range->next_sibling();
-      TRACE_ALLOC(THR_Print("connecting [%" Pd ", %" Pd ") [",
-                            range->Start(), range->End()));
+      TRACE_ALLOC(THR_Print("connecting [%" Pd ", %" Pd ") [", range->Start(),
+                            range->End()));
       TRACE_ALLOC(range->assigned_location().Print());
-      TRACE_ALLOC(THR_Print("] to [%" Pd ", %" Pd ") [",
-                            sibling->Start(), sibling->End()));
+      TRACE_ALLOC(THR_Print("] to [%" Pd ", %" Pd ") [", sibling->Start(),
+                            sibling->End()));
       TRACE_ALLOC(sibling->assigned_location().Print());
       TRACE_ALLOC(THR_Print("]\n"));
       if ((range->End() == sibling->Start()) &&
           !TargetLocationIsSpillSlot(range, sibling->assigned_location()) &&
           !range->assigned_location().Equals(sibling->assigned_location()) &&
           !IsBlockEntry(range->End())) {
-        AddMoveAt(sibling->Start(),
-                  sibling->assigned_location(),
+        AddMoveAt(sibling->Start(), sibling->assigned_location(),
                   range->assigned_location());
       }
       range = sibling;
@@ -2931,8 +2917,7 @@
         range->assigned_location().IsConstant()) {
       ASSERT(range->assigned_location().Equals(range->spill_slot()));
     } else {
-      AddMoveAt(range->Start() + 1,
-                range->spill_slot(),
+      AddMoveAt(range->Start() + 1, range->spill_slot(),
                 range->assigned_location());
     }
   }
@@ -2961,16 +2946,14 @@
     ASSERT(!def->HasPairRepresentation());
   }
 
-  for (BlockIterator it = flow_graph_.reverse_postorder_iterator();
-       !it.Done();
+  for (BlockIterator it = flow_graph_.reverse_postorder_iterator(); !it.Done();
        it.Advance()) {
     BlockEntryInstr* block = it.Current();
 
     // Catch entry.
     if (block->IsCatchBlockEntry()) {
       CatchBlockEntryInstr* catch_entry = block->AsCatchBlockEntry();
-      for (intptr_t i = 0;
-           i < catch_entry->initial_definitions()->length();
+      for (intptr_t i = 0; i < catch_entry->initial_definitions()->length();
            ++i) {
         Definition* def = (*catch_entry->initial_definitions())[i];
         ASSERT(!def->HasPairRepresentation());
@@ -2993,8 +2976,7 @@
       }
     }
     // Normal instructions.
-    for (ForwardInstructionIterator instr_it(block);
-         !instr_it.Done();
+    for (ForwardInstructionIterator instr_it(block); !instr_it.Done();
          instr_it.Advance()) {
       Definition* def = instr_it.Current()->AsDefinition();
       if ((def != NULL) && (def->ssa_temp_index() >= 0)) {
@@ -3002,8 +2984,8 @@
         value_representations_[vreg] =
             RepresentationForRange(def->representation());
         if (def->HasPairRepresentation()) {
-         value_representations_[ToSecondPairVreg(vreg)] =
-            RepresentationForRange(def->representation());
+          value_representations_[ToSecondPairVreg(vreg)] =
+              RepresentationForRange(def->representation());
         }
       }
     }
@@ -3044,11 +3026,8 @@
     THR_Print("----------------------------------------------\n");
   }
 
-  PrepareForAllocation(Location::kRegister,
-                       kNumberOfCpuRegisters,
-                       unallocated_cpu_,
-                       cpu_regs_,
-                       blocked_cpu_registers_);
+  PrepareForAllocation(Location::kRegister, kNumberOfCpuRegisters,
+                       unallocated_cpu_, cpu_regs_, blocked_cpu_registers_);
   AllocateUnallocatedRanges();
 #if defined(TARGET_ARCH_DBC)
   const intptr_t last_used_cpu_register = last_used_register_;
@@ -3060,11 +3039,8 @@
   quad_spill_slots_.Clear();
   untagged_spill_slots_.Clear();
 
-  PrepareForAllocation(Location::kFpuRegister,
-                       kNumberOfFpuRegisters,
-                       unallocated_xmm_,
-                       fpu_regs_,
-                       blocked_fpu_registers_);
+  PrepareForAllocation(Location::kFpuRegister, kNumberOfFpuRegisters,
+                       unallocated_xmm_, fpu_regs_, blocked_fpu_registers_);
 #if defined(TARGET_ARCH_DBC)
   // For DBC all registers should have been allocated in the first pass.
   ASSERT(unallocated_.is_empty());
@@ -3093,9 +3069,9 @@
   // introducing a separate field. It has roughly the same meaning:
   // number of used registers determines how big of a frame to reserve for
   // this function on DBC stack.
-  entry->set_spill_slot_count(Utils::Maximum((last_used_cpu_register + 1) +
-                                             (last_used_fpu_register + 1),
-                                             flow_graph_.num_copied_params()));
+  entry->set_spill_slot_count(Utils::Maximum(
+      (last_used_cpu_register + 1) + (last_used_fpu_register + 1),
+      flow_graph_.num_copied_params()));
 #endif
 
   if (FLAG_print_ssa_liveranges) {
diff --git a/runtime/vm/flow_graph_allocator.h b/runtime/vm/flow_graph_allocator.h
index 7df1a6a..a1d7242 100644
--- a/runtime/vm/flow_graph_allocator.h
+++ b/runtime/vm/flow_graph_allocator.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_FLOW_GRAPH_ALLOCATOR_H_
-#define VM_FLOW_GRAPH_ALLOCATOR_H_
+#ifndef RUNTIME_VM_FLOW_GRAPH_ALLOCATOR_H_
+#define RUNTIME_VM_FLOW_GRAPH_ALLOCATOR_H_
 
 #include "vm/flow_graph.h"
 #include "vm/growable_array.h"
@@ -22,8 +22,7 @@
 class ReachingDefs : public ValueObject {
  public:
   explicit ReachingDefs(const FlowGraph& flow_graph)
-      : flow_graph_(flow_graph),
-        phis_(10) { }
+      : flow_graph_(flow_graph), phis_(10) {}
 
   BitVector* Get(PhiInstr* phi);
 
@@ -41,7 +40,7 @@
   explicit SSALivenessAnalysis(const FlowGraph& flow_graph)
       : LivenessAnalysis(flow_graph.max_virtual_register_number(),
                          flow_graph.postorder()),
-        graph_entry_(flow_graph.graph_entry()) { }
+        graph_entry_(flow_graph.graph_entry()) {}
 
  private:
   // Compute initial values for live-out, kill and live-in sets.
@@ -214,8 +213,7 @@
 
   // Find first intersection between unallocated live range and
   // live ranges currently allocated to the given register.
-  intptr_t FirstIntersectionWithAllocated(intptr_t reg,
-                                          LiveRange* unallocated);
+  intptr_t FirstIntersectionWithAllocated(intptr_t reg, LiveRange* unallocated);
 
   bool UpdateFreeUntil(intptr_t reg,
                        LiveRange* unallocated,
@@ -248,6 +246,8 @@
     return Location::MachineRegisterLocation(register_kind_, reg);
   }
 
+  void SplitInitialDefinitionAt(LiveRange* range, intptr_t pos);
+
   void PrintLiveRanges();
 
   const FlowGraph& flow_graph_;
@@ -343,11 +343,10 @@
 class BlockInfo : public ZoneAllocated {
  public:
   explicit BlockInfo(BlockEntryInstr* entry)
-    : entry_(entry),
-      loop_(NULL),
-      is_loop_header_(false),
-      backedge_interference_(NULL) {
-  }
+      : entry_(entry),
+        loop_(NULL),
+        is_loop_header_(false),
+        backedge_interference_(NULL) {}
 
   BlockEntryInstr* entry() const { return entry_; }
 
@@ -377,16 +376,12 @@
   }
 
   BlockEntryInstr* last_block() const { return last_block_; }
-  void set_last_block(BlockEntryInstr* last_block) {
-    last_block_ = last_block;
-  }
+  void set_last_block(BlockEntryInstr* last_block) { last_block_ = last_block; }
 
   intptr_t loop_id() const { return loop_id_; }
   void set_loop_id(intptr_t loop_id) { loop_id_ = loop_id; }
 
-  BitVector* backedge_interference() const {
-    return backedge_interference_;
-  }
+  BitVector* backedge_interference() const { return backedge_interference_; }
 
   void set_backedge_interference(BitVector* backedge_interference) {
     backedge_interference_ = backedge_interference;
@@ -428,13 +423,9 @@
     return *hint_;
   }
 
-  void set_hint(Location* hint) {
-    hint_ = hint;
-  }
+  void set_hint(Location* hint) { hint_ = hint; }
 
-  bool HasHint() const {
-    return (hint_ != NULL) && !hint_->IsUnallocated();
-  }
+  bool HasHint() const { return (hint_ != NULL) && !hint_->IsUnallocated(); }
 
 
   void set_next(UsePosition* next) { next_ = next; }
@@ -462,9 +453,7 @@
 class UseInterval : public ZoneAllocated {
  public:
   UseInterval(intptr_t start, intptr_t end, UseInterval* next)
-      : start_(start),
-        end_(end),
-        next_(next) { }
+      : start_(start), end_(end), next_(next) {}
 
   void Print();
 
@@ -499,8 +488,7 @@
       : first_pending_use_interval_(NULL),
         first_register_use_(NULL),
         first_register_beneficial_use_(NULL),
-        first_hinted_use_(NULL) {
-  }
+        first_hinted_use_(NULL) {}
 
   void Initialize(LiveRange* range);
   void UpdateAfterSplit(intptr_t first_use_after_split_pos);
@@ -527,9 +515,8 @@
 
 class SafepointPosition : public ZoneAllocated {
  public:
-  SafepointPosition(intptr_t pos,
-                    LocationSummary* locs)
-      : pos_(pos), locs_(locs), next_(NULL) { }
+  SafepointPosition(intptr_t pos, LocationSummary* locs)
+      : pos_(pos), locs_(locs), next_(NULL) {}
 
   void set_next(SafepointPosition* next) { next_ = next; }
   SafepointPosition* next() const { return next_; }
@@ -550,20 +537,19 @@
 class LiveRange : public ZoneAllocated {
  public:
   explicit LiveRange(intptr_t vreg, Representation rep)
-    : vreg_(vreg),
-      representation_(rep),
-      assigned_location_(),
-      spill_slot_(),
-      uses_(NULL),
-      first_use_interval_(NULL),
-      last_use_interval_(NULL),
-      first_safepoint_(NULL),
-      last_safepoint_(NULL),
-      next_sibling_(NULL),
-      has_only_any_uses_in_loops_(0),
-      is_loop_phi_(false),
-      finger_() {
-  }
+      : vreg_(vreg),
+        representation_(rep),
+        assigned_location_(),
+        spill_slot_(),
+        uses_(NULL),
+        first_use_interval_(NULL),
+        last_use_interval_(NULL),
+        first_safepoint_(NULL),
+        last_safepoint_(NULL),
+        next_sibling_(NULL),
+        has_only_any_uses_in_loops_(0),
+        is_loop_phi_(false),
+        finger_() {}
 
   intptr_t vreg() const { return vreg_; }
   Representation representation() const { return representation_; }
@@ -585,9 +571,7 @@
     assigned_location_ = location;
   }
 
-  void set_spill_slot(Location spill_slot) {
-    spill_slot_ = spill_slot;
-  }
+  void set_spill_slot(Location spill_slot) { spill_slot_ = spill_slot; }
 
   void DefineAt(intptr_t pos);
 
@@ -612,9 +596,7 @@
   // True if the range contains the given position.
   bool Contains(intptr_t pos) const;
 
-  Location spill_slot() const {
-    return spill_slot_;
-  }
+  Location spill_slot() const { return spill_slot_; }
 
   bool HasOnlyUnconstrainedUsesInLoop(intptr_t loop_id) const {
     if (loop_id < kBitsPerWord) {
@@ -631,9 +613,7 @@
   }
 
   bool is_loop_phi() const { return is_loop_phi_; }
-  void mark_loop_phi() {
-    is_loop_phi_ = true;
-  }
+  void mark_loop_phi() { is_loop_phi_ = true; }
 
  private:
   LiveRange(intptr_t vreg,
@@ -643,19 +623,18 @@
             UseInterval* last_use_interval,
             SafepointPosition* first_safepoint,
             LiveRange* next_sibling)
-    : vreg_(vreg),
-      representation_(rep),
-      assigned_location_(),
-      uses_(uses),
-      first_use_interval_(first_use_interval),
-      last_use_interval_(last_use_interval),
-      first_safepoint_(first_safepoint),
-      last_safepoint_(NULL),
-      next_sibling_(next_sibling),
-      has_only_any_uses_in_loops_(0),
-      is_loop_phi_(false),
-      finger_() {
-  }
+      : vreg_(vreg),
+        representation_(rep),
+        assigned_location_(),
+        uses_(uses),
+        first_use_interval_(first_use_interval),
+        last_use_interval_(last_use_interval),
+        first_safepoint_(first_safepoint),
+        last_safepoint_(NULL),
+        next_sibling_(next_sibling),
+        has_only_any_uses_in_loops_(0),
+        is_loop_phi_(false),
+        finger_() {}
 
   const intptr_t vreg_;
   Representation representation_;
@@ -682,4 +661,4 @@
 
 }  // namespace dart
 
-#endif  // VM_FLOW_GRAPH_ALLOCATOR_H_
+#endif  // RUNTIME_VM_FLOW_GRAPH_ALLOCATOR_H_
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index ffdf3de..e3963d9 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -32,11 +32,15 @@
 
 namespace dart {
 
-DEFINE_FLAG(bool, eliminate_type_checks, true,
+DEFINE_FLAG(bool,
+            eliminate_type_checks,
+            true,
             "Eliminate type checks when allowed by static type analysis.");
 DEFINE_FLAG(bool, print_ast, false, "Print abstract syntax tree.");
 DEFINE_FLAG(bool, print_scopes, false, "Print scopes of local variables.");
-DEFINE_FLAG(bool, trace_type_check_elimination, false,
+DEFINE_FLAG(bool,
+            trace_type_check_elimination,
+            false,
             "Trace type check elimination at compile time.");
 
 DECLARE_FLAG(bool, profile_vm);
@@ -53,13 +57,13 @@
 
 // TODO(srdjan): Allow compiler to add constants as they are encountered in
 // the compilation.
-const double kCommonDoubleConstants[] =
-    {-1.0, -0.5, -0.1, 0.0, 0.1, 0.5, 1.0, 2.0, 4.0, 5.0,
-     10.0, 20.0, 30.0, 64.0, 255.0, NAN,
-     // From dart:math
-     2.718281828459045, 2.302585092994046, 0.6931471805599453,
-     1.4426950408889634, 0.4342944819032518, 3.1415926535897932,
-     0.7071067811865476, 1.4142135623730951};
+const double kCommonDoubleConstants[] = {
+    -1.0, -0.5, -0.1, 0.0, 0.1, 0.5, 1.0, 2.0, 4.0, 5.0, 10.0, 20.0, 30.0, 64.0,
+    255.0, NAN,
+    // From dart:math
+    2.718281828459045, 2.302585092994046, 0.6931471805599453,
+    1.4426950408889634, 0.4342944819032518, 3.1415926535897932,
+    0.7071067811865476, 1.4142135623730951};
 
 uword FlowGraphBuilder::FindDoubleConstant(double value) {
   intptr_t len = sizeof(kCommonDoubleConstants) / sizeof(double);  // NOLINT
@@ -73,18 +77,16 @@
 
 
 #define RECOGNIZE_FACTORY(test_factory_symbol, cid, fp)                        \
-  { Symbols::k##test_factory_symbol##Id, cid,                                  \
-    fp, #test_factory_symbol ", " #cid },
+  {Symbols::k##test_factory_symbol##Id, cid, fp,                               \
+   #test_factory_symbol ", " #cid},  // NOLINT
 
 static struct {
   intptr_t symbold_id;
   intptr_t cid;
   intptr_t finger_print;
   const char* name;
-} factory_recognizer_list[] = {
-  RECOGNIZED_LIST_FACTORY_LIST(RECOGNIZE_FACTORY)
-  { Symbols::kIllegal, -1, -1, NULL }
-};
+} factory_recognizer_list[] = {RECOGNIZED_LIST_FACTORY_LIST(RECOGNIZE_FACTORY){
+    Symbols::kIllegal, -1, -1, NULL}};
 
 #undef RECOGNIZE_FACTORY
 
@@ -96,8 +98,7 @@
          (lib.raw() == Library::TypedDataLibrary()));
   const String& factory_name = String::Handle(factory.name());
   for (intptr_t i = 0;
-       factory_recognizer_list[i].symbold_id != Symbols::kIllegal;
-       i++) {
+       factory_recognizer_list[i].symbold_id != Symbols::kIllegal; i++) {
     if (String::EqualsIgnoringPrivateKey(
             factory_name,
             Symbols::Symbol(factory_recognizer_list[i].symbold_id))) {
@@ -173,9 +174,8 @@
 JoinEntryInstr* NestedStatement::BreakTargetFor(SourceLabel* label) {
   if (label != label_) return NULL;
   if (break_target_ == NULL) {
-    break_target_ =
-        new(owner()->zone()) JoinEntryInstr(owner()->AllocateBlockId(),
-                                            try_index());
+    break_target_ = new (owner()->zone())
+        JoinEntryInstr(owner()->AllocateBlockId(), try_index());
   }
   return break_target_;
 }
@@ -201,8 +201,8 @@
 
 intptr_t NestedBlock::ContextLevel() const {
   return ((scope_ == NULL) || (scope_->num_context_variables() == 0))
-      ? NestedStatement::ContextLevel()
-      : scope_->context_level();
+             ? NestedStatement::ContextLevel()
+             : scope_->context_level();
 }
 
 
@@ -210,7 +210,7 @@
 class NestedContextAdjustment : public NestedStatement {
  public:
   NestedContextAdjustment(FlowGraphBuilder* owner, intptr_t context_level)
-      : NestedStatement(owner, NULL), context_level_(context_level) { }
+      : NestedStatement(owner, NULL), context_level_(context_level) {}
 
   virtual intptr_t ContextLevel() const { return context_level_; }
 
@@ -233,9 +233,7 @@
     owner->IncrementLoopDepth();
   }
 
-  virtual ~NestedLoop() {
-    owner()->DecrementLoopDepth();
-  }
+  virtual ~NestedLoop() { owner()->DecrementLoopDepth(); }
 
   JoinEntryInstr* continue_target() const { return continue_target_; }
 
@@ -249,9 +247,8 @@
 JoinEntryInstr* NestedLoop::ContinueTargetFor(SourceLabel* label) {
   if (label != this->label()) return NULL;
   if (continue_target_ == NULL) {
-    continue_target_ =
-        new(owner()->zone()) JoinEntryInstr(owner()->AllocateBlockId(),
-                                            try_index());
+    continue_target_ = new (owner()->zone())
+        JoinEntryInstr(owner()->AllocateBlockId(), try_index());
   }
   return continue_target_;
 }
@@ -293,9 +290,8 @@
   for (intptr_t i = 0; i < case_labels_.length(); ++i) {
     if (label != case_labels_[i]) continue;
     if (case_targets_[i] == NULL) {
-      case_targets_[i] =
-          new(owner()->zone()) JoinEntryInstr(owner()->AllocateBlockId(),
-                                              try_index());
+      case_targets_[i] = new (owner()->zone())
+          JoinEntryInstr(owner()->AllocateBlockId(), try_index());
     }
     return case_targets_[i];
   }
@@ -307,27 +303,28 @@
     const ParsedFunction& parsed_function,
     const ZoneGrowableArray<const ICData*>& ic_data_array,
     InlineExitCollector* exit_collector,
-    intptr_t osr_id) :
-        parsed_function_(parsed_function),
-        ic_data_array_(ic_data_array),
-        num_copied_params_(parsed_function.num_copied_params()),
-        // All parameters are copied if any parameter is.
-        num_non_copied_params_((num_copied_params_ == 0)
-            ? parsed_function.function().num_fixed_parameters()
-            : 0),
-        num_stack_locals_(parsed_function.num_stack_locals()),
-        exit_collector_(exit_collector),
-        last_used_block_id_(0),  // 0 is used for the graph entry.
-        try_index_(CatchClauseNode::kInvalidTryIndex),
-        catch_try_index_(CatchClauseNode::kInvalidTryIndex),
-        loop_depth_(0),
-        graph_entry_(NULL),
-        temp_count_(0),
-        args_pushed_(0),
-        nesting_stack_(NULL),
-        osr_id_(osr_id),
-        jump_count_(0),
-        await_joins_(new(Z) ZoneGrowableArray<JoinEntryInstr*>()) { }
+    intptr_t osr_id)
+    : parsed_function_(parsed_function),
+      ic_data_array_(ic_data_array),
+      num_copied_params_(parsed_function.num_copied_params()),
+      // All parameters are copied if any parameter is.
+      num_non_copied_params_(
+          (num_copied_params_ == 0)
+              ? parsed_function.function().num_fixed_parameters()
+              : 0),
+      num_stack_locals_(parsed_function.num_stack_locals()),
+      exit_collector_(exit_collector),
+      last_used_block_id_(0),  // 0 is used for the graph entry.
+      try_index_(CatchClauseNode::kInvalidTryIndex),
+      catch_try_index_(CatchClauseNode::kInvalidTryIndex),
+      loop_depth_(0),
+      graph_entry_(NULL),
+      temp_count_(0),
+      args_pushed_(0),
+      nesting_stack_(NULL),
+      osr_id_(osr_id),
+      jump_count_(0),
+      await_joins_(new (Z) ZoneGrowableArray<JoinEntryInstr*>()) {}
 
 
 void FlowGraphBuilder::AddCatchEntry(CatchBlockEntryInstr* entry) {
@@ -349,11 +346,11 @@
   // Attach the outer environment on each instruction in the callee graph.
   ASSERT(call_->env() != NULL);
   // Scale the edge weights by the call count for the inlined function.
-  double scale_factor = static_cast<double>(call_->CallCount())
-      / static_cast<double>(caller_graph_->graph_entry()->entry_count());
+  double scale_factor =
+      static_cast<double>(call_->CallCount()) /
+      static_cast<double>(caller_graph_->graph_entry()->entry_count());
   for (BlockIterator block_it = callee_graph->postorder_iterator();
-       !block_it.Done();
-       block_it.Advance()) {
+       !block_it.Done(); block_it.Advance()) {
     BlockEntryInstr* block = block_it.Current();
     if (block->IsTargetEntry()) {
       block->AsTargetEntry()->adjust_edge_weight(scale_factor);
@@ -381,7 +378,7 @@
 
 
 void InlineExitCollector::AddExit(ReturnInstr* exit) {
-  Data data = { NULL, exit };
+  Data data = {NULL, exit};
   exits_.Add(data);
 }
 
@@ -405,8 +402,7 @@
   int j = 0;
   for (int i = 0; i < exits_.length(); ++i) {
     BlockEntryInstr* block = exits_[i].exit_return->GetBlock();
-    if ((block != NULL) &&
-        (0 <= block->postorder_number()) &&
+    if ((block != NULL) && (0 <= block->postorder_number()) &&
         (block->postorder_number() < postorder.length()) &&
         (postorder[block->postorder_number()] == block)) {
       if (i != j) {
@@ -446,8 +442,7 @@
     // Create a join of the returns.
     intptr_t join_id = caller_graph_->max_block_id() + 1;
     caller_graph_->set_max_block_id(join_id);
-    JoinEntryInstr* join =
-        new(Z) JoinEntryInstr(join_id, try_index);
+    JoinEntryInstr* join = new (Z) JoinEntryInstr(join_id, try_index);
 
     // The dominator set of the join is the intersection of the dominator
     // sets of all the predecessors.  If we keep the dominator sets ordered
@@ -465,7 +460,7 @@
     GrowableArray<BlockEntryInstr*> join_dominators;
     for (intptr_t i = 0; i < num_exits; ++i) {
       // Add the control-flow edge.
-      GotoInstr* goto_instr = new(Z) GotoInstr(join);
+      GotoInstr* goto_instr = new (Z) GotoInstr(join);
       goto_instr->InheritDeoptTarget(zone(), ReturnAt(i));
       LastInstructionAt(i)->LinkTo(goto_instr);
       ExitBlockAt(i)->set_last_instruction(LastInstructionAt(i)->next());
@@ -511,7 +506,7 @@
     // If the call has uses, create a phi of the returns.
     if (call_->HasUses()) {
       // Add a phi of the return values.
-      PhiInstr* phi = new(Z) PhiInstr(join, num_exits);
+      PhiInstr* phi = new (Z) PhiInstr(join, num_exits);
       caller_graph_->AllocateSSAIndexes(phi);
       phi->mark_alive();
       for (intptr_t i = 0; i < num_exits; ++i) {
@@ -550,21 +545,17 @@
     // The true successor is the inlined body, the false successor
     // goes to the rest of the caller graph. It is removed as unreachable code
     // by the constant propagation.
-    TargetEntryInstr* false_block =
-        new(Z) TargetEntryInstr(caller_graph_->allocate_block_id(),
-                                call_block->try_index());
+    TargetEntryInstr* false_block = new (Z) TargetEntryInstr(
+        caller_graph_->allocate_block_id(), call_block->try_index());
     false_block->InheritDeoptTargetAfter(caller_graph_, call_, NULL);
     false_block->LinkTo(call_->next());
     call_block->ReplaceAsPredecessorWith(false_block);
 
     ConstantInstr* true_const = caller_graph_->GetConstant(Bool::True());
-    BranchInstr* branch =
-        new(Z) BranchInstr(
-            new(Z) StrictCompareInstr(TokenPosition::kNoSource,
-                                      Token::kEQ_STRICT,
-                                      new(Z) Value(true_const),
-                                      new(Z) Value(true_const),
-                                      false));  // No number check.
+    BranchInstr* branch = new (Z) BranchInstr(new (Z) StrictCompareInstr(
+        TokenPosition::kNoSource, Token::kEQ_STRICT, new (Z) Value(true_const),
+        new (Z) Value(true_const),
+        false));  // No number check.
     branch->InheritDeoptTarget(zone(), call_);
     *branch->true_successor_address() = callee_entry;
     *branch->false_successor_address() = false_block;
@@ -581,9 +572,8 @@
     call_block->AddDominatedBlock(false_block);
 
   } else {
-    Definition* callee_result = JoinReturns(&callee_exit,
-                                            &callee_last_instruction,
-                                            call_block->try_index());
+    Definition* callee_result = JoinReturns(
+        &callee_exit, &callee_last_instruction, call_block->try_index());
     if (callee_result != NULL) {
       call_->ReplaceUsesWith(callee_result);
     }
@@ -675,7 +665,7 @@
     exit()->LinkTo(definition);
   }
   exit_ = definition;
-  return new(Z) Value(definition);
+  return new (Z) Value(definition);
 }
 
 
@@ -707,10 +697,9 @@
 }
 
 
-void EffectGraphVisitor::AddReturnExit(TokenPosition token_pos,
-                                       Value* value) {
+void EffectGraphVisitor::AddReturnExit(TokenPosition token_pos, Value* value) {
   ASSERT(is_open());
-  ReturnInstr* return_instr = new(Z) ReturnInstr(token_pos, value);
+  ReturnInstr* return_instr = new (Z) ReturnInstr(token_pos, value);
   AddInstruction(return_instr);
   InlineExitCollector* exit_collector = owner()->exit_collector();
   if (exit_collector != NULL) {
@@ -723,7 +712,7 @@
 void EffectGraphVisitor::Goto(JoinEntryInstr* join) {
   ASSERT(is_open());
   if (is_empty()) {
-    entry_ = new(Z) GotoInstr(join);
+    entry_ = new (Z) GotoInstr(join);
   } else {
     exit()->Goto(join);
   }
@@ -772,8 +761,8 @@
   } else if (false_exit == NULL) {
     exit_ = true_exit;
   } else {
-    JoinEntryInstr* join =
-        new(Z) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
+    JoinEntryInstr* join = new (Z)
+        JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
     true_exit->Goto(join);
     false_exit->Goto(join);
     exit_ = join;
@@ -803,10 +792,10 @@
     Append(test_preamble_fragment);
     Append(test_fragment);
   } else {
-    JoinEntryInstr* join =
-        new(Z) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
+    JoinEntryInstr* join = new (Z)
+        JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
     CheckStackOverflowInstr* check =
-        new(Z) CheckStackOverflowInstr(token_pos, owner()->loop_depth());
+        new (Z) CheckStackOverflowInstr(token_pos, owner()->loop_depth());
     join->LinkTo(check);
     if (!test_preamble_fragment.is_empty()) {
       check->LinkTo(test_preamble_fragment.entry());
@@ -826,7 +815,7 @@
 
 PushArgumentInstr* EffectGraphVisitor::PushArgument(Value* value) {
   owner_->add_args_pushed(1);
-  PushArgumentInstr* result = new(Z) PushArgumentInstr(value);
+  PushArgumentInstr* result = new (Z) PushArgumentInstr(value);
   AddInstruction(result);
   return result;
 }
@@ -837,15 +826,14 @@
                                                TokenPosition token_pos) {
   ASSERT(!local.is_captured());
   ASSERT(!token_pos.IsClassifying());
-  return new(Z) StoreLocalInstr(local, value, ST(token_pos));
+  return new (Z) StoreLocalInstr(local, value, ST(token_pos));
 }
 
 
 Definition* EffectGraphVisitor::BuildStoreExprTemp(Value* value,
                                                    TokenPosition token_pos) {
   return BuildStoreTemp(*owner()->parsed_function().expression_temp_var(),
-                        value,
-                        token_pos);
+                        value, token_pos);
 }
 
 
@@ -861,26 +849,22 @@
                                                 TokenPosition token_pos) {
   if (local.is_captured()) {
     LocalVariable* tmp_var = EnterTempLocalScope(value);
-    intptr_t delta =
-        owner()->context_level() - local.owner()->context_level();
+    intptr_t delta = owner()->context_level() - local.owner()->context_level();
     ASSERT(delta >= 0);
     Value* context = Bind(BuildCurrentContext(token_pos));
     while (delta-- > 0) {
-      context = Bind(new(Z) LoadFieldInstr(
-          context, Context::parent_offset(), Type::ZoneHandle(Z, Type::null()),
-          token_pos));
+      context = Bind(new (Z) LoadFieldInstr(context, Context::parent_offset(),
+                                            Type::ZoneHandle(Z, Type::null()),
+                                            token_pos));
     }
-    Value* tmp_val = Bind(new(Z) LoadLocalInstr(*tmp_var, token_pos));
-    StoreInstanceFieldInstr* store =
-        new(Z) StoreInstanceFieldInstr(Context::variable_offset(local.index()),
-                                       context,
-                                       tmp_val,
-                                       kEmitStoreBarrier,
-                                       token_pos);
+    Value* tmp_val = Bind(new (Z) LoadLocalInstr(*tmp_var, token_pos));
+    StoreInstanceFieldInstr* store = new (Z)
+        StoreInstanceFieldInstr(Context::variable_offset(local.index()),
+                                context, tmp_val, kEmitStoreBarrier, token_pos);
     Do(store);
     return ExitTempLocalScope(value);
   } else {
-    return new(Z) StoreLocalInstr(local, value, token_pos);
+    return new (Z) StoreLocalInstr(local, value, token_pos);
   }
 }
 
@@ -888,34 +872,30 @@
 Definition* EffectGraphVisitor::BuildLoadLocal(const LocalVariable& local,
                                                TokenPosition token_pos) {
   if (local.IsConst()) {
-    return new(Z) ConstantInstr(*local.ConstValue(), token_pos);
+    return new (Z) ConstantInstr(*local.ConstValue(), token_pos);
   } else if (local.is_captured()) {
-    intptr_t delta =
-        owner()->context_level() - local.owner()->context_level();
+    intptr_t delta = owner()->context_level() - local.owner()->context_level();
     ASSERT(delta >= 0);
     Value* context = Bind(BuildCurrentContext(token_pos));
     while (delta-- > 0) {
-      context = Bind(new(Z) LoadFieldInstr(
-          context, Context::parent_offset(), Type::ZoneHandle(Z, Type::null()),
-          token_pos));
+      context = Bind(new (Z) LoadFieldInstr(context, Context::parent_offset(),
+                                            Type::ZoneHandle(Z, Type::null()),
+                                            token_pos));
     }
-    LoadFieldInstr* load = new(Z) LoadFieldInstr(
-        context,
-        Context::variable_offset(local.index()),
-        local.type(),
-        token_pos);
+    LoadFieldInstr* load =
+        new (Z) LoadFieldInstr(context, Context::variable_offset(local.index()),
+                               local.type(), token_pos);
     load->set_is_immutable(local.is_final());
     return load;
   } else {
-    return new(Z) LoadLocalInstr(local, token_pos);
+    return new (Z) LoadLocalInstr(local, token_pos);
   }
 }
 
 
 // Stores current context into the 'variable'
-void EffectGraphVisitor::BuildSaveContext(
-    const LocalVariable& variable,
-    TokenPosition token_pos) {
+void EffectGraphVisitor::BuildSaveContext(const LocalVariable& variable,
+                                          TokenPosition token_pos) {
   ASSERT(token_pos.IsSynthetic() || token_pos.IsNoSource());
   Value* context = Bind(BuildCurrentContext(token_pos));
   Do(BuildStoreLocal(variable, context, token_pos));
@@ -923,25 +903,23 @@
 
 
 // Loads context saved in 'context_variable' into the current context.
-void EffectGraphVisitor::BuildRestoreContext(
-    const LocalVariable& variable,
-    TokenPosition token_pos) {
+void EffectGraphVisitor::BuildRestoreContext(const LocalVariable& variable,
+                                             TokenPosition token_pos) {
   Value* load_saved_context = Bind(BuildLoadLocal(variable, token_pos));
   Do(BuildStoreContext(load_saved_context, token_pos));
 }
 
 
-Definition* EffectGraphVisitor::BuildStoreContext(
-    Value* value, TokenPosition token_pos) {
-  return new(Z) StoreLocalInstr(
+Definition* EffectGraphVisitor::BuildStoreContext(Value* value,
+                                                  TokenPosition token_pos) {
+  return new (Z) StoreLocalInstr(
       *owner()->parsed_function().current_context_var(), value, token_pos);
 }
 
 
 Definition* EffectGraphVisitor::BuildCurrentContext(TokenPosition token_pos) {
-  return new(Z) LoadLocalInstr(
-      *owner()->parsed_function().current_context_var(),
-      token_pos);
+  return new (Z) LoadLocalInstr(
+      *owner()->parsed_function().current_context_var(), token_pos);
 }
 
 
@@ -950,9 +928,8 @@
     JoinEntryInstr* join) const {
   ASSERT(!branches.is_empty());
   for (intptr_t i = 0; i < branches.length(); i++) {
-    TargetEntryInstr* target =
-        new(Z) TargetEntryInstr(owner()->AllocateBlockId(),
-                                owner()->try_index());
+    TargetEntryInstr* target = new (Z)
+        TargetEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
     *(branches[i]) = target;
     target->Goto(join);
   }
@@ -974,15 +951,14 @@
   ASSERT(!branches.is_empty());
 
   if (branches.length() == 1) {
-    TargetEntryInstr* target =
-        new(Z) TargetEntryInstr(owner()->AllocateBlockId(),
-                                owner()->try_index());
+    TargetEntryInstr* target = new (Z)
+        TargetEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
     *(branches[0]) = target;
     return target;
   }
 
   JoinEntryInstr* join =
-      new(Z) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
+      new (Z) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
   ConnectBranchesTo(branches, join);
   return join;
 }
@@ -1001,16 +977,13 @@
 void TestGraphVisitor::ReturnValue(Value* value) {
   Isolate* isolate = Isolate::Current();
   if (isolate->type_checks() || isolate->asserts()) {
-    value = Bind(new(Z) AssertBooleanInstr(condition_token_pos(), value));
+    value = Bind(new (Z) AssertBooleanInstr(condition_token_pos(), value));
   }
-  Value* constant_true = Bind(new(Z) ConstantInstr(Bool::True()));
-  StrictCompareInstr* comp =
-      new(Z) StrictCompareInstr(condition_token_pos(),
-                                Token::kEQ_STRICT,
-                                value,
-                                constant_true,
-                                false);  // No number check.
-  BranchInstr* branch = new(Z) BranchInstr(comp);
+  Value* constant_true = Bind(new (Z) ConstantInstr(Bool::True()));
+  StrictCompareInstr* comp = new (Z) StrictCompareInstr(
+      condition_token_pos(), Token::kEQ_STRICT, value, constant_true,
+      false);  // No number check.
+  BranchInstr* branch = new (Z) BranchInstr(comp);
   AddInstruction(branch);
   CloseFragment();
 
@@ -1023,18 +996,17 @@
   BranchInstr* branch;
   if (Token::IsStrictEqualityOperator(comp->kind())) {
     ASSERT(comp->IsStrictCompare());
-    branch = new(Z) BranchInstr(comp);
+    branch = new (Z) BranchInstr(comp);
   } else if (Token::IsEqualityOperator(comp->kind()) &&
              (comp->left()->BindsToConstantNull() ||
               comp->right()->BindsToConstantNull())) {
-    branch = new(Z) BranchInstr(new(Z) StrictCompareInstr(
+    branch = new (Z) BranchInstr(new (Z) StrictCompareInstr(
         comp->token_pos(),
         (comp->kind() == Token::kEQ) ? Token::kEQ_STRICT : Token::kNE_STRICT,
-        comp->left(),
-        comp->right(),
+        comp->left(), comp->right(),
         false));  // No number check.
   } else {
-    branch = new(Z) BranchInstr(comp);
+    branch = new (Z) BranchInstr(comp);
     branch->set_is_checked(Isolate::Current()->type_checks());
   }
   AddInstruction(branch);
@@ -1046,14 +1018,11 @@
 
 void TestGraphVisitor::MergeBranchWithNegate(BooleanNegateInstr* neg) {
   ASSERT(!Isolate::Current()->type_checks());
-  Value* constant_true = Bind(new(Z) ConstantInstr(Bool::True()));
-  StrictCompareInstr* comp =
-      new(Z) StrictCompareInstr(condition_token_pos(),
-                             Token::kNE_STRICT,
-                             neg->value(),
-                             constant_true,
-                             false);  // No number check.
-  BranchInstr* branch = new(Z) BranchInstr(comp);
+  Value* constant_true = Bind(new (Z) ConstantInstr(Bool::True()));
+  StrictCompareInstr* comp = new (Z) StrictCompareInstr(
+      condition_token_pos(), Token::kNE_STRICT, neg->value(), constant_true,
+      false);  // No number check.
+  BranchInstr* branch = new (Z) BranchInstr(comp);
   AddInstruction(branch);
   CloseFragment();
   true_successor_addresses_.Add(branch->true_successor_address());
@@ -1135,11 +1104,10 @@
   // No debugger check is done in native functions or for return
   // statements for which there is no associated source position.
   const Function& function = owner()->function();
-  if (FLAG_support_debugger &&
-      node->token_pos().IsDebugPause() &&
+  if (FLAG_support_debugger && node->token_pos().IsDebugPause() &&
       !function.is_native()) {
-    AddInstruction(new(Z) DebugStepCheckInstr(node->token_pos(),
-                                              RawPcDescriptors::kRuntimeCall));
+    AddInstruction(new (Z) DebugStepCheckInstr(node->token_pos(),
+                                               RawPcDescriptors::kRuntimeCall));
   }
 
   NestedContextAdjustment context_adjustment(owner(), owner()->context_level());
@@ -1163,8 +1131,8 @@
   if (Isolate::Current()->type_checks()) {
     const bool is_implicit_dynamic_getter =
         (!function.is_static() &&
-        ((function.kind() == RawFunction::kImplicitGetter) ||
-         (function.kind() == RawFunction::kImplicitStaticFinalGetter)));
+         ((function.kind() == RawFunction::kImplicitGetter) ||
+          (function.kind() == RawFunction::kImplicitStaticFinalGetter)));
     // Implicit getters do not need a type check at return, unless they compute
     // the initial value of a static field.
     // The body of a constructor cannot modify the type of the
@@ -1173,10 +1141,9 @@
     if (!is_implicit_dynamic_getter && !function.IsGenerativeConstructor()) {
       const AbstractType& dst_type =
           AbstractType::ZoneHandle(Z, function.result_type());
-      return_value = BuildAssignableValue(node->value()->token_pos(),
-                                          return_value,
-                                          dst_type,
-                                          Symbols::FunctionResult());
+      return_value =
+          BuildAssignableValue(node->value()->token_pos(), return_value,
+                               dst_type, Symbols::FunctionResult());
     }
   }
 
@@ -1198,19 +1165,14 @@
         node->scope()->LookupVariable(Symbols::AsyncCompleter(), false);
     ASSERT(rcv_var != NULL && rcv_var->is_captured());
     ZoneGrowableArray<PushArgumentInstr*>* arguments =
-        new(Z) ZoneGrowableArray<PushArgumentInstr*>(2);
+        new (Z) ZoneGrowableArray<PushArgumentInstr*>(2);
     Value* rcv_value = Bind(BuildLoadLocal(*rcv_var, node->token_pos()));
     arguments->Add(PushArgument(rcv_value));
     Value* returned_value = Bind(BuildLoadExprTemp(node->token_pos()));
     arguments->Add(PushArgument(returned_value));
-    InstanceCallInstr* call = new(Z) InstanceCallInstr(
-        node->token_pos(),
-        Symbols::CompleterComplete(),
-        Token::kILLEGAL,
-        arguments,
-        Object::null_array(),
-        1,
-        owner()->ic_data_array());
+    InstanceCallInstr* call = new (Z) InstanceCallInstr(
+        node->token_pos(), Symbols::CompleterComplete(), Token::kILLEGAL,
+        arguments, Object::null_array(), 1, owner()->ic_data_array());
     Do(call);
 
     // Rebind the return value for the actual return call to be null.
@@ -1225,12 +1187,11 @@
 
   AddReturnExit(node->token_pos(), return_value);
 
-  if ((function.IsAsyncClosure() ||
-      function.IsSyncGenClosure() ||
-      function.IsAsyncGenClosure()) &&
+  if ((function.IsAsyncClosure() || function.IsSyncGenClosure() ||
+       function.IsAsyncGenClosure()) &&
       (node->return_type() == ReturnNode::kContinuationTarget)) {
-    JoinEntryInstr* const join = new(Z) JoinEntryInstr(
-        owner()->AllocateBlockId(), owner()->try_index());
+    JoinEntryInstr* const join = new (Z)
+        JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
     owner()->await_joins()->Add(join);
     exit_ = join;
   }
@@ -1239,7 +1200,7 @@
 
 // <Expression> ::= Literal { literal: Instance }
 void EffectGraphVisitor::VisitLiteralNode(LiteralNode* node) {
-  ReturnDefinition(new(Z) ConstantInstr(node->literal(), node->token_pos()));
+  ReturnDefinition(new (Z) ConstantInstr(node->literal(), node->token_pos()));
 }
 
 
@@ -1256,13 +1217,13 @@
   // Type may be malbounded, but not malformed.
   ASSERT(type.IsFinalized() && !type.IsMalformed());
   if (type.IsInstantiated()) {
-    ReturnDefinition(new(Z) ConstantInstr(type));
+    ReturnDefinition(new (Z) ConstantInstr(type));
   } else {
-    const Class& instantiator_class = Class::ZoneHandle(
-        Z, owner()->function().Owner());
+    const Class& instantiator_class =
+        Class::ZoneHandle(Z, owner()->function().Owner());
     Value* instantiator_value = BuildInstantiatorTypeArguments(
         node->token_pos(), instantiator_class, NULL);
-    ReturnDefinition(new(Z) InstantiateTypeInstr(
+    ReturnDefinition(new (Z) InstantiateTypeInstr(
         node->token_pos(), type, instantiator_class, instantiator_value));
   }
 }
@@ -1303,12 +1264,8 @@
 
   const bool eliminated = value->Type()->IsAssignableTo(dst_type);
   if (FLAG_trace_type_check_elimination) {
-    FlowGraphPrinter::PrintTypeCheck(owner()->parsed_function(),
-                                     token_pos,
-                                     value,
-                                     dst_type,
-                                     dst_name,
-                                     eliminated);
+    FlowGraphPrinter::PrintTypeCheck(owner()->parsed_function(), token_pos,
+                                     value, dst_type, dst_name, eliminated);
   }
   return eliminated;
 }
@@ -1321,15 +1278,12 @@
   ValueGraphVisitor for_value(owner());
   node->expr()->Visit(&for_value);
   Append(for_value);
-  if (CanSkipTypeCheck(node->expr()->token_pos(),
-                       for_value.value(),
-                       node->type(),
-                       node->dst_name())) {
+  if (CanSkipTypeCheck(node->expr()->token_pos(), for_value.value(),
+                       node->type(), node->dst_name())) {
     ReturnValue(for_value.value());
   } else {
     ReturnDefinition(BuildAssertAssignable(node->expr()->token_pos(),
-                                           for_value.value(),
-                                           node->type(),
+                                           for_value.value(), node->type(),
                                            node->dst_name()));
   }
 }
@@ -1339,10 +1293,8 @@
   ValueGraphVisitor for_value(owner());
   node->expr()->Visit(&for_value);
   Append(for_value);
-  ReturnValue(BuildAssignableValue(node->expr()->token_pos(),
-                                   for_value.value(),
-                                   node->type(),
-                                   node->dst_name()));
+  ReturnValue(BuildAssignableValue(node->expr()->token_pos(), for_value.value(),
+                                   node->type(), node->dst_name()));
 }
 
 
@@ -1362,8 +1314,8 @@
       ValueGraphVisitor for_right(owner());
       node->right()->Visit(&for_right);
       Value* right_value = for_right.value();
-      for_right.Do(new(Z) AssertBooleanInstr(node->right()->token_pos(),
-                                             right_value));
+      for_right.Do(
+          new (Z) AssertBooleanInstr(node->right()->token_pos(), right_value));
       if (node->kind() == Token::kAND) {
         Join(for_left, for_right, empty);
       } else {
@@ -1392,18 +1344,14 @@
   PushArgumentInstr* push_right = PushArgument(for_right_value.value());
 
   ZoneGrowableArray<PushArgumentInstr*>* arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>(2);
+      new (Z) ZoneGrowableArray<PushArgumentInstr*>(2);
   arguments->Add(push_left);
   arguments->Add(push_right);
   const String& name = Symbols::Token(node->kind());
   const intptr_t kNumArgsChecked = 2;
-  InstanceCallInstr* call = new(Z) InstanceCallInstr(node->token_pos(),
-                                                     name,
-                                                     node->kind(),
-                                                     arguments,
-                                                     Object::null_array(),
-                                                     kNumArgsChecked,
-                                                     owner()->ic_data_array());
+  InstanceCallInstr* call = new (Z) InstanceCallInstr(
+      node->token_pos(), name, node->kind(), arguments, Object::null_array(),
+      kNumArgsChecked, owner()->ic_data_array());
   ReturnDefinition(call);
 }
 
@@ -1426,29 +1374,25 @@
     Value* right_value = for_right.value();
     Isolate* isolate = Isolate::Current();
     if (isolate->type_checks() || isolate->asserts()) {
-      right_value =
-          for_right.Bind(new(Z) AssertBooleanInstr(node->right()->token_pos(),
-                                                   right_value));
+      right_value = for_right.Bind(
+          new (Z) AssertBooleanInstr(node->right()->token_pos(), right_value));
     }
-    Value* constant_true = for_right.Bind(new(Z) ConstantInstr(Bool::True()));
-    Value* compare =
-        for_right.Bind(new(Z) StrictCompareInstr(node->token_pos(),
-                                                 Token::kEQ_STRICT,
-                                                 right_value,
-                                                 constant_true,
-                                                 false));  // No number check.
+    Value* constant_true = for_right.Bind(new (Z) ConstantInstr(Bool::True()));
+    Value* compare = for_right.Bind(new (Z) StrictCompareInstr(
+        node->token_pos(), Token::kEQ_STRICT, right_value, constant_true,
+        false));  // No number check.
     for_right.Do(BuildStoreExprTemp(compare, node->token_pos()));
 
     if (node->kind() == Token::kAND) {
       ValueGraphVisitor for_false(owner());
       Value* constant_false =
-          for_false.Bind(new(Z) ConstantInstr(Bool::False()));
+          for_false.Bind(new (Z) ConstantInstr(Bool::False()));
       for_false.Do(BuildStoreExprTemp(constant_false, node->token_pos()));
       Join(for_test, for_right, for_false);
     } else {
       ASSERT(node->kind() == Token::kOR);
       ValueGraphVisitor for_true(owner());
-      Value* constant_true = for_true.Bind(new(Z) ConstantInstr(Bool::True()));
+      Value* constant_true = for_true.Bind(new (Z) ConstantInstr(Bool::True()));
       for_true.Do(BuildStoreExprTemp(constant_true, node->token_pos()));
       Join(for_test, for_true, for_right);
     }
@@ -1463,8 +1407,8 @@
 void EffectGraphVisitor::BuildTypecheckPushArguments(
     TokenPosition token_pos,
     PushArgumentInstr** push_instantiator_type_arguments_result) {
-  const Class& instantiator_class = Class::Handle(
-      Z, owner()->function().Owner());
+  const Class& instantiator_class =
+      Class::Handle(Z, owner()->function().Owner());
   // Since called only when type tested against is not instantiated.
   ASSERT(instantiator_class.IsGeneric());
   Value* instantiator_type_arguments = NULL;
@@ -1482,14 +1426,13 @@
 }
 
 
-
 void EffectGraphVisitor::BuildTypecheckArguments(
     TokenPosition token_pos,
     Value** instantiator_type_arguments_result) {
   Value* instantiator = NULL;
   Value* instantiator_type_arguments = NULL;
-  const Class& instantiator_class = Class::Handle(
-      Z, owner()->function().Owner());
+  const Class& instantiator_class =
+      Class::Handle(Z, owner()->function().Owner());
   // Since called only when type tested against is not instantiated.
   ASSERT(instantiator_class.IsGeneric());
   instantiator = BuildInstantiator(token_pos);
@@ -1506,8 +1449,8 @@
 
 
 Value* EffectGraphVisitor::BuildNullValue(TokenPosition token_pos) {
-  return Bind(new(Z) ConstantInstr(Object::ZoneHandle(Z, Object::null()),
-                                   token_pos));
+  return Bind(
+      new (Z) ConstantInstr(Object::ZoneHandle(Z, Object::null()), token_pos));
 }
 
 
@@ -1526,12 +1469,9 @@
   }
 
   const intptr_t deopt_id = Thread::Current()->GetNextDeoptId();
-  return new(Z) AssertAssignableInstr(token_pos,
-                                      value,
-                                      instantiator_type_arguments,
-                                      dst_type,
-                                      dst_name,
-                                      deopt_id);
+  return new (Z)
+      AssertAssignableInstr(token_pos, value, instantiator_type_arguments,
+                            dst_type, dst_name, deopt_id);
 }
 
 
@@ -1546,6 +1486,7 @@
   return Bind(BuildAssertAssignable(token_pos, value, dst_type, dst_name));
 }
 
+
 static bool simpleInstanceOfType(const AbstractType& type) {
   // Bail if the type is still uninstantiated at compile time.
   if (!type.IsInstantiated()) return false;
@@ -1576,7 +1517,7 @@
     EffectGraphVisitor for_left_value(owner());
     node->left()->Visit(&for_left_value);
     Append(for_left_value);
-    ReturnDefinition(new(Z) ConstantInstr(Bool::Get(!negate_result)));
+    ReturnDefinition(new (Z) ConstantInstr(Bool::Get(!negate_result)));
     return;
   }
   ValueGraphVisitor for_left_value(owner());
@@ -1600,20 +1541,17 @@
     ASSERT(!method_name.IsNull());
     PushArgumentInstr* push_left = PushArgument(for_left_value.value());
     ZoneGrowableArray<PushArgumentInstr*>* arguments =
-        new(Z) ZoneGrowableArray<PushArgumentInstr*>(2);
+        new (Z) ZoneGrowableArray<PushArgumentInstr*>(2);
     arguments->Add(push_left);
     const Bool& negate = Bool::Get(node->kind() == Token::kISNOT);
-    Value* negate_arg = Bind(new(Z) ConstantInstr(negate));
+    Value* negate_arg = Bind(new (Z) ConstantInstr(negate));
     arguments->Add(PushArgument(negate_arg));
     const intptr_t kNumArgsChecked = 1;
-    InstanceCallInstr* call = new(Z) InstanceCallInstr(
-        node->token_pos(),
-        Library::PrivateCoreLibName(method_name),
-        node->kind(),
-        arguments,
+    InstanceCallInstr* call = new (Z) InstanceCallInstr(
+        node->token_pos(), Library::PrivateCoreLibName(method_name),
+        node->kind(), arguments,
         Object::null_array(),  // No argument names.
-        kNumArgsChecked,
-        owner()->ic_data_array());
+        kNumArgsChecked, owner()->ic_data_array());
     ReturnDefinition(call);
     return;
   }
@@ -1624,21 +1562,19 @@
   if (simpleInstanceOfType(type)) {
     ASSERT(!node->right()->AsTypeNode()->type().IsNull());
     ZoneGrowableArray<PushArgumentInstr*>* arguments =
-        new(Z) ZoneGrowableArray<PushArgumentInstr*>(2);
+        new (Z) ZoneGrowableArray<PushArgumentInstr*>(2);
     arguments->Add(push_left);
-    Value* type_const = Bind(new(Z) ConstantInstr(type));
+    Value* type_const = Bind(new (Z) ConstantInstr(type));
     arguments->Add(PushArgument(type_const));
     const intptr_t kNumArgsChecked = 2;
-    Definition* result = new(Z) InstanceCallInstr(
+    Definition* result = new (Z) InstanceCallInstr(
         node->token_pos(),
-        Library::PrivateCoreLibName(Symbols::_simpleInstanceOf()),
-        node->kind(),
+        Library::PrivateCoreLibName(Symbols::_simpleInstanceOf()), node->kind(),
         arguments,
         Object::null_array(),  // No argument names.
-        kNumArgsChecked,
-        owner()->ic_data_array());
+        kNumArgsChecked, owner()->ic_data_array());
     if (negate_result) {
-      result = new(Z) BooleanNegateInstr(Bind(result));
+      result = new (Z) BooleanNegateInstr(Bind(result));
     }
     ReturnDefinition(result);
     return;
@@ -1651,24 +1587,21 @@
     BuildTypecheckPushArguments(node->token_pos(), &push_type_args);
   }
   ZoneGrowableArray<PushArgumentInstr*>* arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>(4);
+      new (Z) ZoneGrowableArray<PushArgumentInstr*>(4);
   arguments->Add(push_left);
   arguments->Add(push_type_args);
   ASSERT(!node->right()->AsTypeNode()->type().IsNull());
-  Value* type_const = Bind(new(Z) ConstantInstr(type));
+  Value* type_const = Bind(new (Z) ConstantInstr(type));
   arguments->Add(PushArgument(type_const));
   const Bool& negate = Bool::Get(node->kind() == Token::kISNOT);
-  Value* negate_arg = Bind(new(Z) ConstantInstr(negate));
+  Value* negate_arg = Bind(new (Z) ConstantInstr(negate));
   arguments->Add(PushArgument(negate_arg));
   const intptr_t kNumArgsChecked = 1;
-  InstanceCallInstr* call = new(Z) InstanceCallInstr(
-      node->token_pos(),
-      Library::PrivateCoreLibName(Symbols::_instanceOf()),
-      node->kind(),
-      arguments,
+  InstanceCallInstr* call = new (Z) InstanceCallInstr(
+      node->token_pos(), Library::PrivateCoreLibName(Symbols::_instanceOf()),
+      node->kind(), arguments,
       Object::null_array(),  // No argument names.
-      kNumArgsChecked,
-      owner()->ic_data_array());
+      kNumArgsChecked, owner()->ic_data_array());
   ReturnDefinition(call);
 }
 
@@ -1681,9 +1614,7 @@
   ValueGraphVisitor for_value(owner());
   node->left()->Visit(&for_value);
   Append(for_value);
-  if (CanSkipTypeCheck(node->token_pos(),
-                       for_value.value(),
-                       type,
+  if (CanSkipTypeCheck(node->token_pos(), for_value.value(), type,
                        Symbols::InTypeCast())) {
     ReturnValue(for_value.value());
     return;
@@ -1696,20 +1627,17 @@
     BuildTypecheckPushArguments(node->token_pos(), &push_type_args);
   }
   ZoneGrowableArray<PushArgumentInstr*>* arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>(3);
+      new (Z) ZoneGrowableArray<PushArgumentInstr*>(3);
   arguments->Add(push_left);
   arguments->Add(push_type_args);
-  Value* type_arg = Bind(new(Z) ConstantInstr(type));
+  Value* type_arg = Bind(new (Z) ConstantInstr(type));
   arguments->Add(PushArgument(type_arg));
   const intptr_t kNumArgsChecked = 1;
-  InstanceCallInstr* call = new(Z) InstanceCallInstr(
-      node->token_pos(),
-      Library::PrivateCoreLibName(Symbols::_as()),
-      node->kind(),
-      arguments,
+  InstanceCallInstr* call = new (Z) InstanceCallInstr(
+      node->token_pos(), Library::PrivateCoreLibName(Symbols::_as()),
+      node->kind(), arguments,
       Object::null_array(),  // No argument names.
-      kNumArgsChecked,
-      owner()->ic_data_array());
+      kNumArgsChecked, owner()->ic_data_array());
   ReturnDefinition(call);
 }
 
@@ -1725,11 +1653,9 @@
   ValueGraphVisitor for_right_value(owner());
   right->Visit(&for_right_value);
   Append(for_right_value);
-  StrictCompareInstr* comp = new(Z) StrictCompareInstr(token_pos,
-                                                       kind,
-                                                       for_left_value.value(),
-                                                       for_right_value.value(),
-                                                       true);  // Number check.
+  StrictCompareInstr* comp = new (Z) StrictCompareInstr(
+      token_pos, kind, for_left_value.value(), for_right_value.value(),
+      true);  // Number check.
   return comp;
 }
 
@@ -1762,15 +1688,14 @@
         ((right_lit != NULL) && right_lit->literal().IsNull())) {
       Token::Kind kind =
           (node->kind() == Token::kEQ) ? Token::kEQ_STRICT : Token::kNE_STRICT;
-      StrictCompareInstr* compare =
-          BuildStrictCompare(node->left(), node->right(),
-                             kind, node->token_pos());
+      StrictCompareInstr* compare = BuildStrictCompare(
+          node->left(), node->right(), kind, node->token_pos());
       ReturnDefinition(compare);
       return;
     }
 
     ZoneGrowableArray<PushArgumentInstr*>* arguments =
-        new(Z) ZoneGrowableArray<PushArgumentInstr*>(2);
+        new (Z) ZoneGrowableArray<PushArgumentInstr*>(2);
 
     ValueGraphVisitor for_left_value(owner());
     node->left()->Visit(&for_left_value);
@@ -1785,29 +1710,26 @@
     arguments->Add(push_right);
 
     const intptr_t kNumArgsChecked = 2;
-    Definition* result = new(Z) InstanceCallInstr(
-        node->token_pos(),
-        Symbols::EqualOperator(),
-        Token::kEQ,  // Result is negated later for kNE.
-        arguments,
-        Object::null_array(),
-        kNumArgsChecked,
-        owner()->ic_data_array());
+    Definition* result = new (Z)
+        InstanceCallInstr(node->token_pos(), Symbols::EqualOperator(),
+                          Token::kEQ,  // Result is negated later for kNE.
+                          arguments, Object::null_array(), kNumArgsChecked,
+                          owner()->ic_data_array());
     if (node->kind() == Token::kNE) {
       Isolate* isolate = Isolate::Current();
       if (isolate->type_checks() || isolate->asserts()) {
         Value* value = Bind(result);
-        result = new(Z) AssertBooleanInstr(node->token_pos(), value);
+        result = new (Z) AssertBooleanInstr(node->token_pos(), value);
       }
       Value* value = Bind(result);
-      result = new(Z) BooleanNegateInstr(value);
+      result = new (Z) BooleanNegateInstr(value);
     }
     ReturnDefinition(result);
     return;
   }
 
   ZoneGrowableArray<PushArgumentInstr*>* arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>(2);
+      new (Z) ZoneGrowableArray<PushArgumentInstr*>(2);
 
   ValueGraphVisitor for_left_value(owner());
   node->left()->Visit(&for_left_value);
@@ -1822,14 +1744,9 @@
   arguments->Add(push_right);
 
   ASSERT(Token::IsRelationalOperator(node->kind()));
-  InstanceCallInstr* comp = new(Z) InstanceCallInstr(
-      node->token_pos(),
-      Symbols::Token(node->kind()),
-      node->kind(),
-      arguments,
-      Object::null_array(),
-      2,
-      owner()->ic_data_array());
+  InstanceCallInstr* comp = new (Z) InstanceCallInstr(
+      node->token_pos(), Symbols::Token(node->kind()), node->kind(), arguments,
+      Object::null_array(), 2, owner()->ic_data_array());
   ReturnDefinition(comp);
 }
 
@@ -1844,9 +1761,9 @@
     Isolate* isolate = Isolate::Current();
     if (isolate->type_checks() || isolate->asserts()) {
       value =
-          Bind(new(Z) AssertBooleanInstr(node->operand()->token_pos(), value));
+          Bind(new (Z) AssertBooleanInstr(node->operand()->token_pos(), value));
     }
-    BooleanNegateInstr* negate = new(Z) BooleanNegateInstr(value);
+    BooleanNegateInstr* negate = new (Z) BooleanNegateInstr(value);
     ReturnDefinition(negate);
     return;
   }
@@ -1856,16 +1773,11 @@
   Append(for_value);
   PushArgumentInstr* push_value = PushArgument(for_value.value());
   ZoneGrowableArray<PushArgumentInstr*>* arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>(1);
+      new (Z) ZoneGrowableArray<PushArgumentInstr*>(1);
   arguments->Add(push_value);
-  InstanceCallInstr* call = new(Z) InstanceCallInstr(
-      node->token_pos(),
-      Symbols::Token(node->kind()),
-      node->kind(),
-      arguments,
-      Object::null_array(),
-      1,
-      owner()->ic_data_array());
+  InstanceCallInstr* call = new (Z) InstanceCallInstr(
+      node->token_pos(), Symbols::Token(node->kind()), node->kind(), arguments,
+      Object::null_array(), 1, owner()->ic_data_array());
   ReturnDefinition(call);
 }
 
@@ -1891,14 +1803,14 @@
   ValueGraphVisitor for_true(owner());
   node->true_expr()->Visit(&for_true);
   ASSERT(for_true.is_open());
-  for_true.Do(BuildStoreExprTemp(for_true.value(),
-                                 node->true_expr()->token_pos()));
+  for_true.Do(
+      BuildStoreExprTemp(for_true.value(), node->true_expr()->token_pos()));
 
   ValueGraphVisitor for_false(owner());
   node->false_expr()->Visit(&for_false);
   ASSERT(for_false.is_open());
-  for_false.Do(BuildStoreExprTemp(for_false.value(),
-                                  node->false_expr()->token_pos()));
+  for_false.Do(
+      BuildStoreExprTemp(for_false.value(), node->false_expr()->token_pos()));
 
   Join(for_test, for_true, for_false);
   ReturnDefinition(BuildLoadExprTemp(node->token_pos()));
@@ -1963,8 +1875,8 @@
   // Compute the start of the statements fragment.
   JoinEntryInstr* statement_start = NULL;
   if (node->label() == NULL) {
-    statement_start = new(Z) JoinEntryInstr(owner()->AllocateBlockId(),
-                                            owner()->try_index());
+    statement_start = new (Z)
+        JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
   } else {
     // The case nodes are nested inside a SequenceNode that is the body of a
     // SwitchNode.  The SwitchNode on the nesting stack contains the
@@ -2015,8 +1927,8 @@
       exit_instruction = statement_exit;
     } else {
       if (statement_exit != NULL) {
-        JoinEntryInstr* join = new(Z) JoinEntryInstr(owner()->AllocateBlockId(),
-                                                     owner()->try_index());
+        JoinEntryInstr* join = new (Z)
+            JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
         statement_exit->Goto(join);
         next_target->Goto(join);
         exit_instruction = join;
@@ -2099,19 +2011,18 @@
 
   // Tie do-while loop (test is after the body).
   JoinEntryInstr* body_entry_join =
-      new(Z) JoinEntryInstr(owner()->AllocateBlockId(),
-                            owner()->try_index());
+      new (Z) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
   Goto(body_entry_join);
   Instruction* body_exit = AppendFragment(body_entry_join, for_body);
 
   JoinEntryInstr* join = nested_loop.continue_target();
   if ((body_exit != NULL) || (join != NULL)) {
     if (join == NULL) {
-      join = new(Z) JoinEntryInstr(owner()->AllocateBlockId(),
-                                   owner()->try_index());
+      join = new (Z)
+          JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
     }
-    CheckStackOverflowInstr* check = new(Z) CheckStackOverflowInstr(
-        node->token_pos(), owner()->loop_depth());
+    CheckStackOverflowInstr* check = new (Z)
+        CheckStackOverflowInstr(node->token_pos(), owner()->loop_depth());
     join->LinkTo(check);
     check->LinkTo(for_test.entry());
     if (body_exit != NULL) {
@@ -2159,8 +2070,8 @@
   // Join the loop body and increment and then tie the loop.
   JoinEntryInstr* continue_join = nested_loop.continue_target();
   if ((continue_join != NULL) || for_body.is_open()) {
-    JoinEntryInstr* loop_entry =
-        new(Z) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
+    JoinEntryInstr* loop_entry = new (Z)
+        JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
     if (continue_join != NULL) {
       if (for_body.is_open()) for_body.Goto(continue_join);
       Instruction* current = AppendFragment(continue_join, for_increment);
@@ -2176,9 +2087,8 @@
     // check must match the position of the increment expression, so that
     // the context level (if any) matches the that of the increment
     // expression.
-    AddInstruction(
-        new(Z) CheckStackOverflowInstr(node->increment()->token_pos(),
-                                       owner()->loop_depth()));
+    AddInstruction(new (Z) CheckStackOverflowInstr(
+        node->increment()->token_pos(), owner()->loop_depth()));
   }
 
   if (node->condition() == NULL) {
@@ -2229,8 +2139,8 @@
   NestedStatement* current = owner()->nesting_stack();
   while (current != NULL) {
     jump_target = (node->kind() == Token::kBREAK)
-        ? current->BreakTargetFor(node->label())
-        : current->ContinueTargetFor(node->label());
+                      ? current->BreakTargetFor(node->label())
+                      : current->ContinueTargetFor(node->label());
     if (jump_target != NULL) break;
     current = current->outer();
   }
@@ -2257,10 +2167,10 @@
   ASSERT(node->token_pos().IsSynthetic() || node->token_pos().IsNoSource());
   ASSERT(node->async_scope() != NULL);
   ASSERT(node->await_scope() != NULL);
-  LocalVariable* jump_var = node->async_scope()->LookupVariable(
-      Symbols::AwaitJumpVar(), false);
-  LocalVariable* ctx_var = node->async_scope()->LookupVariable(
-      Symbols::AwaitContextVar(), false);
+  LocalVariable* jump_var =
+      node->async_scope()->LookupVariable(Symbols::AwaitJumpVar(), false);
+  LocalVariable* ctx_var =
+      node->async_scope()->LookupVariable(Symbols::AwaitContextVar(), false);
   ASSERT((jump_var != NULL) && jump_var->is_captured());
   ASSERT((ctx_var != NULL) && ctx_var->is_captured());
   const intptr_t jump_count = owner()->next_await_counter();
@@ -2269,7 +2179,7 @@
   // state.
   ASSERT(jump_count == owner()->await_joins()->length());
   // Store the counter in :await_jump_var.
-  Value* jump_val = Bind(new(Z) ConstantInstr(
+  Value* jump_val = Bind(new (Z) ConstantInstr(
       Smi::ZoneHandle(Z, Smi::New(jump_count)), node->token_pos()));
   Do(BuildStoreLocal(*jump_var, jump_val, node->token_pos()));
   // Save the current context for resuming.
@@ -2278,11 +2188,9 @@
 
 
 intptr_t EffectGraphVisitor::GetCurrentTempLocalIndex() const {
-  return kFirstLocalSlotFromFp
-      - owner()->num_stack_locals()
-      - owner()->num_copied_params()
-      - owner()->args_pushed()
-      - owner()->temp_count() + 1;
+  return kFirstLocalSlotFromFp - owner()->num_stack_locals() -
+         owner()->num_copied_params() - owner()->args_pushed() -
+         owner()->temp_count() + 1;
 }
 
 
@@ -2291,17 +2199,17 @@
   intptr_t index = GetCurrentTempLocalIndex();
   char name[64];
   OS::SNPrint(name, 64, ":tmp_local%" Pd, index);
-  LocalVariable*  var =
-      new(Z) LocalVariable(TokenPosition::kNoSource,
-                           String::ZoneHandle(Z, Symbols::New(T, name)),
-                           *value->Type()->ToAbstractType());
+  LocalVariable* var =
+      new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource,
+                            String::ZoneHandle(Z, Symbols::New(T, name)),
+                            *value->Type()->ToAbstractType());
   var->set_index(index);
   return var;
 }
 
 
 Definition* EffectGraphVisitor::ExitTempLocalScope(Value* value) {
-  return new(Z) DropTempsInstr(0, value);
+  return new (Z) DropTempsInstr(0, value);
 }
 
 
@@ -2331,7 +2239,7 @@
   intptr_t num_temps = node->num_temps();
   if (num_temps > 0) {
     owner()->DeallocateTemps(num_temps);
-    Do(new(Z) DropTempsInstr(num_temps, NULL));
+    Do(new (Z) DropTempsInstr(num_temps, NULL));
   }
 }
 
@@ -2354,7 +2262,7 @@
   intptr_t num_temps = node->num_temps();
   if (num_temps > 0) {
     owner()->DeallocateTemps(num_temps);
-    ReturnDefinition(new(Z) DropTempsInstr(num_temps, result_value));
+    ReturnDefinition(new (Z) DropTempsInstr(num_temps, result_value));
   } else {
     ReturnValue(result_value);
   }
@@ -2364,35 +2272,33 @@
 void EffectGraphVisitor::VisitArrayNode(ArrayNode* node) {
   const TypeArguments& type_args =
       TypeArguments::ZoneHandle(Z, node->type().arguments());
-  Value* element_type = BuildInstantiatedTypeArguments(node->token_pos(),
-                                                       type_args);
+  Value* element_type =
+      BuildInstantiatedTypeArguments(node->token_pos(), type_args);
   Value* num_elements =
-      Bind(new(Z) ConstantInstr(Smi::ZoneHandle(Z, Smi::New(node->length()))));
-  CreateArrayInstr* create = new(Z) CreateArrayInstr(node->token_pos(),
-                                                     element_type,
-                                                     num_elements);
+      Bind(new (Z) ConstantInstr(Smi::ZoneHandle(Z, Smi::New(node->length()))));
+  CreateArrayInstr* create =
+      new (Z) CreateArrayInstr(node->token_pos(), element_type, num_elements);
   Value* array_val = Bind(create);
 
-  { LocalVariable* tmp_var = EnterTempLocalScope(array_val);
+  {
+    LocalVariable* tmp_var = EnterTempLocalScope(array_val);
     const intptr_t class_id = kArrayCid;
     const intptr_t deopt_id = Thread::kNoDeoptId;
     for (int i = 0; i < node->length(); ++i) {
-      Value* array = Bind(new(Z) LoadLocalInstr(*tmp_var, node->token_pos()));
-      Value* index =
-          Bind(new(Z) ConstantInstr(Smi::ZoneHandle(Z, Smi::New(i)),
-                                    node->token_pos()));
+      Value* array = Bind(new (Z) LoadLocalInstr(*tmp_var, node->token_pos()));
+      Value* index = Bind(new (Z) ConstantInstr(Smi::ZoneHandle(Z, Smi::New(i)),
+                                                node->token_pos()));
       ValueGraphVisitor for_value(owner());
       node->ElementAt(i)->Visit(&for_value);
       Append(for_value);
       // No store barrier needed for constants.
       const StoreBarrierType emit_store_barrier =
-          for_value.value()->BindsToConstant()
-              ? kNoStoreBarrier
-              : kEmitStoreBarrier;
+          for_value.value()->BindsToConstant() ? kNoStoreBarrier
+                                               : kEmitStoreBarrier;
       const intptr_t index_scale = Instance::ElementSizeFor(class_id);
-      StoreIndexedInstr* store = new(Z) StoreIndexedInstr(
-          array, index, for_value.value(), emit_store_barrier,
-          index_scale, class_id, deopt_id, node->token_pos());
+      StoreIndexedInstr* store = new (Z) StoreIndexedInstr(
+          array, index, for_value.value(), emit_store_barrier, index_scale,
+          class_id, kAlignedAccess, deopt_id, node->token_pos());
       Do(store);
     }
     ReturnDefinition(ExitTempLocalScope(array_val));
@@ -2406,7 +2312,7 @@
   ArrayNode* arguments = node->value();
   if (arguments->length() == 1) {
     ZoneGrowableArray<PushArgumentInstr*>* values =
-        new(Z) ZoneGrowableArray<PushArgumentInstr*>(1);
+        new (Z) ZoneGrowableArray<PushArgumentInstr*>(1);
     arguments->ElementAt(0)->Visit(&for_argument);
     Append(for_argument);
     PushArgumentInstr* push_arg = PushArgument(for_argument.value());
@@ -2417,25 +2323,19 @@
         Class::Handle(Library::LookupCoreClass(Symbols::StringBase()));
     ASSERT(!cls.IsNull());
     const Function& function = Function::ZoneHandle(
-        Z,
-        Resolver::ResolveStatic(
-            cls,
-            Library::PrivateCoreLibName(Symbols::InterpolateSingle()),
-            kNumberOfArguments,
-            kNoArgumentNames));
+        Z, Resolver::ResolveStatic(
+               cls, Library::PrivateCoreLibName(Symbols::InterpolateSingle()),
+               kNumberOfArguments, kNoArgumentNames));
     StaticCallInstr* call =
-        new(Z) StaticCallInstr(node->token_pos(),
-                               function,
-                               kNoArgumentNames,
-                               values,
-                               owner()->ic_data_array());
+        new (Z) StaticCallInstr(node->token_pos(), function, kNoArgumentNames,
+                                values, owner()->ic_data_array());
     ReturnDefinition(call);
     return;
   }
   arguments->Visit(&for_argument);
   Append(for_argument);
   StringInterpolateInstr* instr =
-      new(Z) StringInterpolateInstr(for_argument.value(), node->token_pos());
+      new (Z) StringInterpolateInstr(for_argument.value(), node->token_pos());
   ReturnDefinition(instr);
 }
 
@@ -2445,7 +2345,7 @@
   if (function.IsImplicitStaticClosureFunction()) {
     const Instance& closure =
         Instance::ZoneHandle(Z, function.ImplicitStaticClosure());
-    ReturnDefinition(new(Z) ConstantInstr(closure));
+    ReturnDefinition(new (Z) ConstantInstr(closure));
     return;
   }
 
@@ -2469,8 +2369,8 @@
     // same closure, do not add a second one. We compare token position,
     // and parent function to detect duplicates.
     const Function& parent = Function::Handle(function.parent_function());
-    const Function& found_func = Function::Handle(Z,
-        isolate()->LookupClosureFunction(parent, function.token_pos()));
+    const Function& found_func = Function::Handle(
+        Z, isolate()->LookupClosureFunction(parent, function.token_pos()));
     if (found_func.IsNull()) {
       isolate()->AddClosureFunction(function);
     }
@@ -2482,84 +2382,73 @@
   const Class& closure_class =
       Class::ZoneHandle(Z, isolate()->object_store()->closure_class());
   ZoneGrowableArray<PushArgumentInstr*>* no_arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>(0);
-  AllocateObjectInstr* alloc = new(Z) AllocateObjectInstr(node->token_pos(),
-                                                          closure_class,
-                                                          no_arguments);
+      new (Z) ZoneGrowableArray<PushArgumentInstr*>(0);
+  AllocateObjectInstr* alloc = new (Z)
+      AllocateObjectInstr(node->token_pos(), closure_class, no_arguments);
   alloc->set_closure_function(function);
 
   Value* closure_val = Bind(alloc);
-  { LocalVariable* closure_tmp_var = EnterTempLocalScope(closure_val);
+  {
+    LocalVariable* closure_tmp_var = EnterTempLocalScope(closure_val);
     // Store type arguments if scope class is generic.
     const Type& function_type = Type::ZoneHandle(Z, function.SignatureType());
     const Class& scope_cls = Class::ZoneHandle(Z, function_type.type_class());
     if (scope_cls.IsGeneric()) {
       ASSERT(function.Owner() == scope_cls.raw());
-      Value* closure_tmp_val = Bind(new(Z) LoadLocalInstr(*closure_tmp_var,
-                                                          node->token_pos()));
-      const Class& instantiator_class = Class::Handle(
-          Z, owner()->function().Owner());
-      Value* type_arguments = BuildInstantiatorTypeArguments(node->token_pos(),
-                                                             instantiator_class,
-                                                             NULL);
-      Do(new(Z) StoreInstanceFieldInstr(Closure::type_arguments_offset(),
-                                        closure_tmp_val,
-                                        type_arguments,
-                                        kEmitStoreBarrier,
-                                        node->token_pos()));
+      Value* closure_tmp_val =
+          Bind(new (Z) LoadLocalInstr(*closure_tmp_var, node->token_pos()));
+      const Class& instantiator_class =
+          Class::Handle(Z, owner()->function().Owner());
+      Value* type_arguments = BuildInstantiatorTypeArguments(
+          node->token_pos(), instantiator_class, NULL);
+      Do(new (Z) StoreInstanceFieldInstr(Closure::type_arguments_offset(),
+                                         closure_tmp_val, type_arguments,
+                                         kEmitStoreBarrier, node->token_pos()));
     }
 
     // Store function.
     Value* closure_tmp_val =
-        Bind(new(Z) LoadLocalInstr(*closure_tmp_var, node->token_pos()));
+        Bind(new (Z) LoadLocalInstr(*closure_tmp_var, node->token_pos()));
     Value* func_val =
-        Bind(new(Z) ConstantInstr(Function::ZoneHandle(Z, function.raw())));
-    Do(new(Z) StoreInstanceFieldInstr(Closure::function_offset(),
-                                      closure_tmp_val,
-                                      func_val,
-                                      kEmitStoreBarrier,
-                                      node->token_pos()));
+        Bind(new (Z) ConstantInstr(Function::ZoneHandle(Z, function.raw())));
+    Do(new (Z) StoreInstanceFieldInstr(Closure::function_offset(),
+                                       closure_tmp_val, func_val,
+                                       kEmitStoreBarrier, node->token_pos()));
     if (is_implicit) {
       // Create new context containing the receiver.
       const intptr_t kNumContextVariables = 1;  // The receiver.
-      Value* allocated_context =
-          Bind(new(Z) AllocateContextInstr(node->token_pos(),
-                                           kNumContextVariables));
-      { LocalVariable* context_tmp_var = EnterTempLocalScope(allocated_context);
+      Value* allocated_context = Bind(new (Z) AllocateContextInstr(
+          node->token_pos(), kNumContextVariables));
+      {
+        LocalVariable* context_tmp_var = EnterTempLocalScope(allocated_context);
         // Store receiver in context.
         Value* context_tmp_val =
-            Bind(new(Z) LoadLocalInstr(*context_tmp_var, node->token_pos()));
+            Bind(new (Z) LoadLocalInstr(*context_tmp_var, node->token_pos()));
         ValueGraphVisitor for_receiver(owner());
         node->receiver()->Visit(&for_receiver);
         Append(for_receiver);
         Value* receiver = for_receiver.value();
-        Do(new(Z) StoreInstanceFieldInstr(Context::variable_offset(0),
-                                          context_tmp_val,
-                                          receiver,
-                                          kEmitStoreBarrier,
-                                          node->token_pos()));
+        Do(new (Z) StoreInstanceFieldInstr(
+            Context::variable_offset(0), context_tmp_val, receiver,
+            kEmitStoreBarrier, node->token_pos()));
         // Store new context in closure.
         closure_tmp_val =
-            Bind(new(Z) LoadLocalInstr(*closure_tmp_var, node->token_pos()));
+            Bind(new (Z) LoadLocalInstr(*closure_tmp_var, node->token_pos()));
         context_tmp_val =
-            Bind(new(Z) LoadLocalInstr(*context_tmp_var, node->token_pos()));
-        Do(new(Z) StoreInstanceFieldInstr(Closure::context_offset(),
-                                          closure_tmp_val,
-                                          context_tmp_val,
-                                          kEmitStoreBarrier,
-                                          node->token_pos()));
+            Bind(new (Z) LoadLocalInstr(*context_tmp_var, node->token_pos()));
+        Do(new (Z) StoreInstanceFieldInstr(
+            Closure::context_offset(), closure_tmp_val, context_tmp_val,
+            kEmitStoreBarrier, node->token_pos()));
         Do(ExitTempLocalScope(allocated_context));
       }
     } else {
       // Store current context in closure.
-      closure_tmp_val = Bind(
-          new(Z) LoadLocalInstr(*closure_tmp_var, node->token_pos()));
+      closure_tmp_val =
+          Bind(new (Z) LoadLocalInstr(*closure_tmp_var, node->token_pos()));
       Value* context = Bind(BuildCurrentContext(node->token_pos()));
-      Do(new(Z) StoreInstanceFieldInstr(Closure::context_offset(),
-                                        closure_tmp_val,
-                                        context,
-                                        kEmitStoreBarrier,
-                                        node->token_pos()));
+      Do(new (Z) StoreInstanceFieldInstr(Closure::context_offset(),
+                                         closure_tmp_val, context,
+                                         kEmitStoreBarrier, node->token_pos()));
     }
     ReturnDefinition(ExitTempLocalScope(closure_val));
   }
@@ -2582,15 +2471,12 @@
 void EffectGraphVisitor::BuildInstanceCallConditional(InstanceCallNode* node) {
   const TokenPosition token_pos = node->token_pos();
   LocalVariable* temp_var = owner()->parsed_function().expression_temp_var();
-  LoadLocalNode* load_temp = new(Z) LoadLocalNode(token_pos, temp_var);
+  LoadLocalNode* load_temp = new (Z) LoadLocalNode(token_pos, temp_var);
 
   LiteralNode* null_constant =
-      new(Z) LiteralNode(ST(token_pos), Object::null_instance());
-  ComparisonNode* check_is_null =
-      new(Z) ComparisonNode(ST(token_pos),
-                            Token::kEQ,
-                            load_temp,
-                            null_constant);
+      new (Z) LiteralNode(ST(token_pos), Object::null_instance());
+  ComparisonNode* check_is_null = new (Z)
+      ComparisonNode(ST(token_pos), Token::kEQ, load_temp, null_constant);
   TestGraphVisitor for_test(owner(), ST(token_pos));
   check_is_null->Visit(&for_test);
 
@@ -2598,16 +2484,13 @@
   EffectGraphVisitor for_false(owner());
 
   StoreLocalNode* store_null =
-      new(Z) StoreLocalNode(ST(token_pos), temp_var, null_constant);
+      new (Z) StoreLocalNode(ST(token_pos), temp_var, null_constant);
   store_null->Visit(&for_true);
 
-  InstanceCallNode* call =
-      new(Z) InstanceCallNode(token_pos,
-                              load_temp,
-                              node->function_name(),
-                              node->arguments());
+  InstanceCallNode* call = new (Z) InstanceCallNode(
+      token_pos, load_temp, node->function_name(), node->arguments());
   StoreLocalNode* store_result =
-      new(Z) StoreLocalNode(ST(token_pos), temp_var, call);
+      new (Z) StoreLocalNode(ST(token_pos), temp_var, call);
   store_result->Visit(&for_false);
 
   Join(for_test, for_true, for_false);
@@ -2637,20 +2520,14 @@
     BuildInstanceCallConditional(node);
   } else {
     PushArgumentInstr* push_receiver = PushArgument(for_receiver.value());
-    ZoneGrowableArray<PushArgumentInstr*>* arguments =
-        new(Z) ZoneGrowableArray<PushArgumentInstr*>(
-            node->arguments()->length() + 1);
+    ZoneGrowableArray<PushArgumentInstr*>* arguments = new (Z)
+        ZoneGrowableArray<PushArgumentInstr*>(node->arguments()->length() + 1);
     arguments->Add(push_receiver);
 
     BuildPushArguments(*node->arguments(), arguments);
-    InstanceCallInstr* call = new(Z) InstanceCallInstr(
-        node->token_pos(),
-        node->function_name(),
-        Token::kILLEGAL,
-        arguments,
-        node->arguments()->names(),
-        1,
-        owner()->ic_data_array());
+    InstanceCallInstr* call = new (Z) InstanceCallInstr(
+        node->token_pos(), node->function_name(), Token::kILLEGAL, arguments,
+        node->arguments()->names(), 1, owner()->ic_data_array());
     ReturnDefinition(call);
   }
 }
@@ -2659,15 +2536,12 @@
 // <Expression> ::= StaticCall { function: Function
 //                               arguments: <ArgumentList> }
 void EffectGraphVisitor::VisitStaticCallNode(StaticCallNode* node) {
-  ZoneGrowableArray<PushArgumentInstr*>* arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>(node->arguments()->length());
+  ZoneGrowableArray<PushArgumentInstr*>* arguments = new (Z)
+      ZoneGrowableArray<PushArgumentInstr*>(node->arguments()->length());
   BuildPushArguments(*node->arguments(), arguments);
-  StaticCallInstr* call =
-      new(Z) StaticCallInstr(node->token_pos(),
-                             node->function(),
-                             node->arguments()->names(),
-                             arguments,
-                             owner()->ic_data_array());
+  StaticCallInstr* call = new (Z) StaticCallInstr(
+      node->token_pos(), node->function(), node->arguments()->names(),
+      arguments, owner()->ic_data_array());
   if (node->function().recognized_kind() != MethodRecognizer::kUnknown) {
     call->set_result_cid(MethodRecognizer::ResultCid(node->function()));
   }
@@ -2675,8 +2549,8 @@
 }
 
 
-void EffectGraphVisitor::BuildClosureCall(
-    ClosureCallNode* node, bool result_needed) {
+void EffectGraphVisitor::BuildClosureCall(ClosureCallNode* node,
+                                          bool result_needed) {
   ValueGraphVisitor for_closure(owner());
   node->closure()->Visit(&for_closure);
   Append(for_closure);
@@ -2684,27 +2558,26 @@
   Value* closure_value = for_closure.value();
   LocalVariable* tmp_var = EnterTempLocalScope(closure_value);
 
-  ZoneGrowableArray<PushArgumentInstr*>* arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>(node->arguments()->length());
-  Value* closure_val = Bind(new(Z) LoadLocalInstr(*tmp_var, node->token_pos()));
+  ZoneGrowableArray<PushArgumentInstr*>* arguments = new (Z)
+      ZoneGrowableArray<PushArgumentInstr*>(node->arguments()->length());
+  Value* closure_val =
+      Bind(new (Z) LoadLocalInstr(*tmp_var, node->token_pos()));
   PushArgumentInstr* push_closure = PushArgument(closure_val);
   arguments->Add(push_closure);
   BuildPushArguments(*node->arguments(), arguments);
 
-  closure_val = Bind(new(Z) LoadLocalInstr(*tmp_var, node->token_pos()));
-  LoadFieldInstr* function_load = new(Z) LoadFieldInstr(
-      closure_val,
-      Closure::function_offset(),
-      AbstractType::ZoneHandle(Z, AbstractType::null()),
-      node->token_pos());
+  closure_val = Bind(new (Z) LoadLocalInstr(*tmp_var, node->token_pos()));
+  LoadFieldInstr* function_load = new (Z) LoadFieldInstr(
+      closure_val, Closure::function_offset(),
+      AbstractType::ZoneHandle(Z, AbstractType::null()), node->token_pos());
   function_load->set_is_immutable(true);
   Value* function_val = Bind(function_load);
 
   Definition* closure_call =
-      new(Z) ClosureCallInstr(function_val, node, arguments);
+      new (Z) ClosureCallInstr(function_val, node, arguments);
   if (result_needed) {
     Value* result = Bind(closure_call);
-    Do(new(Z) StoreLocalInstr(*tmp_var, result, ST(node->token_pos())));
+    Do(new (Z) StoreLocalInstr(*tmp_var, result, ST(node->token_pos())));
   } else {
     Do(closure_call);
   }
@@ -2723,15 +2596,15 @@
 
 
 void EffectGraphVisitor::VisitInitStaticFieldNode(InitStaticFieldNode* node) {
-  Value* field = Bind(new(Z) ConstantInstr(
-      Field::ZoneHandle(Z, node->field().Original())));
-  AddInstruction(new(Z) InitStaticFieldInstr(field, node->field()));
+  Value* field = Bind(
+      new (Z) ConstantInstr(Field::ZoneHandle(Z, node->field().Original())));
+  AddInstruction(new (Z) InitStaticFieldInstr(field, node->field()));
 }
 
 
 void EffectGraphVisitor::VisitCloneContextNode(CloneContextNode* node) {
   Value* context = Bind(BuildCurrentContext(node->token_pos()));
-  Value* clone = Bind(new(Z) CloneContextInstr(node->token_pos(), context));
+  Value* clone = Bind(new (Z) CloneContextInstr(node->token_pos(), context));
   Do(BuildStoreContext(clone, node->token_pos()));
 }
 
@@ -2740,18 +2613,16 @@
   const Class& cls = Class::ZoneHandle(Z, node->constructor().Owner());
   const bool cls_is_parameterized = cls.NumTypeArguments() > 0;
 
-  ZoneGrowableArray<PushArgumentInstr*>* allocate_arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>(
-          cls_is_parameterized ? 1 : 0);
+  ZoneGrowableArray<PushArgumentInstr*>* allocate_arguments = new (Z)
+      ZoneGrowableArray<PushArgumentInstr*>(cls_is_parameterized ? 1 : 0);
   if (cls_is_parameterized) {
     Value* type_args = BuildInstantiatedTypeArguments(node->token_pos(),
                                                       node->type_arguments());
     allocate_arguments->Add(PushArgument(type_args));
   }
 
-  Definition* allocation = new(Z) AllocateObjectInstr(
-      node->token_pos(),
-      Class::ZoneHandle(Z, node->constructor().Owner()),
+  Definition* allocation = new (Z) AllocateObjectInstr(
+      node->token_pos(), Class::ZoneHandle(Z, node->constructor().Owner()),
       allocate_arguments);
 
   return Bind(allocation);
@@ -2761,17 +2632,14 @@
 void EffectGraphVisitor::BuildConstructorCall(
     ConstructorCallNode* node,
     PushArgumentInstr* push_alloc_value) {
-
   ZoneGrowableArray<PushArgumentInstr*>* arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>(2);
+      new (Z) ZoneGrowableArray<PushArgumentInstr*>(2);
   arguments->Add(push_alloc_value);
 
   BuildPushArguments(*node->arguments(), arguments);
-  Do(new(Z) StaticCallInstr(node->token_pos(),
-                            node->constructor(),
-                            node->arguments()->names(),
-                            arguments,
-                            owner()->ic_data_array()));
+  Do(new (Z) StaticCallInstr(node->token_pos(), node->constructor(),
+                             node->arguments()->names(), arguments,
+                             owner()->ic_data_array()));
 }
 
 
@@ -2795,26 +2663,23 @@
     }
     return FactoryRecognizer::ResultCid(function);
   }
-  return kDynamicCid;   // Not a known list constructor.
+  return kDynamicCid;  // Not a known list constructor.
 }
 
 
 void EffectGraphVisitor::VisitConstructorCallNode(ConstructorCallNode* node) {
   if (node->constructor().IsFactory()) {
     ZoneGrowableArray<PushArgumentInstr*>* arguments =
-        new(Z) ZoneGrowableArray<PushArgumentInstr*>();
-    PushArgumentInstr* push_type_arguments = PushArgument(
-        BuildInstantiatedTypeArguments(node->token_pos(),
-                                       node->type_arguments()));
+        new (Z) ZoneGrowableArray<PushArgumentInstr*>();
+    PushArgumentInstr* push_type_arguments =
+        PushArgument(BuildInstantiatedTypeArguments(node->token_pos(),
+                                                    node->type_arguments()));
     arguments->Add(push_type_arguments);
     ASSERT(arguments->length() == 1);
     BuildPushArguments(*node->arguments(), arguments);
-    StaticCallInstr* call =
-        new(Z) StaticCallInstr(node->token_pos(),
-                               node->constructor(),
-                               node->arguments()->names(),
-                               arguments,
-                               owner()->ic_data_array());
+    StaticCallInstr* call = new (Z) StaticCallInstr(
+        node->token_pos(), node->constructor(), node->arguments()->names(),
+        arguments, owner()->ic_data_array());
     const intptr_t result_cid = GetResultCidOfListFactory(node);
     if (result_cid != kDynamicCid) {
       call->set_result_cid(result_cid);
@@ -2869,15 +2734,14 @@
     TypeArguments& type_arguments =
         TypeArguments::ZoneHandle(Z, TypeArguments::null());
     // Type is temporary. Only its type arguments are preserved.
-    Type& type = Type::Handle(
-        Z,
-        Type::New(instantiator_class, type_arguments, token_pos, Heap::kNew));
-    type ^= ClassFinalizer::FinalizeType(
-        instantiator_class, type, ClassFinalizer::kFinalize);
+    Type& type = Type::Handle(Z, Type::New(instantiator_class, type_arguments,
+                                           token_pos, Heap::kNew));
+    type ^= ClassFinalizer::FinalizeType(instantiator_class, type,
+                                         ClassFinalizer::kFinalize);
     ASSERT(!type.IsMalformedOrMalbounded());
     type_arguments = type.arguments();
     type_arguments = type_arguments.Canonicalize();
-    return Bind(new(Z) ConstantInstr(type_arguments));
+    return Bind(new (Z) ConstantInstr(type_arguments));
   }
   Function& outer_function = Function::Handle(Z, owner()->function().raw());
   while (outer_function.IsLocalFunction()) {
@@ -2886,8 +2750,7 @@
   if (outer_function.IsFactory()) {
     // No instantiator for factories.
     ASSERT(instantiator == NULL);
-    LocalVariable* instantiator_var =
-        owner()->parsed_function().instantiator();
+    LocalVariable* instantiator_var = owner()->parsed_function().instantiator();
     ASSERT(instantiator_var != NULL);
     return Bind(BuildLoadLocal(*instantiator_var, token_pos));
   }
@@ -2902,9 +2765,8 @@
       instantiator_class.type_arguments_field_offset();
   ASSERT(type_arguments_field_offset != Class::kNoTypeArguments);
 
-  return Bind(new(Z) LoadFieldInstr(
-      instantiator,
-      type_arguments_field_offset,
+  return Bind(new (Z) LoadFieldInstr(
+      instantiator, type_arguments_field_offset,
       Type::ZoneHandle(Z, Type::null()),  // Not an instance, no type.
       token_pos));
 }
@@ -2914,11 +2776,11 @@
     TokenPosition token_pos,
     const TypeArguments& type_arguments) {
   if (type_arguments.IsNull() || type_arguments.IsInstantiated()) {
-    return Bind(new(Z) ConstantInstr(type_arguments));
+    return Bind(new (Z) ConstantInstr(type_arguments));
   }
   // The type arguments are uninstantiated.
-  const Class& instantiator_class = Class::ZoneHandle(
-      Z, owner()->function().Owner());
+  const Class& instantiator_class =
+      Class::ZoneHandle(Z, owner()->function().Owner());
   Value* instantiator_value =
       BuildInstantiatorTypeArguments(token_pos, instantiator_class, NULL);
   const bool use_instantiator_type_args =
@@ -2927,10 +2789,8 @@
   if (use_instantiator_type_args) {
     return instantiator_value;
   } else {
-    return Bind(new(Z) InstantiateTypeArgumentsInstr(token_pos,
-                                                  type_arguments,
-                                                  instantiator_class,
-                                                  instantiator_value));
+    return Bind(new (Z) InstantiateTypeArgumentsInstr(
+        token_pos, type_arguments, instantiator_class, instantiator_value));
   }
 }
 
@@ -2950,9 +2810,10 @@
   //   tn       <- LoadLocal(temp)
 
   Value* allocate = BuildObjectAllocation(node);
-  { LocalVariable* tmp_var = EnterTempLocalScope(allocate);
+  {
+    LocalVariable* tmp_var = EnterTempLocalScope(allocate);
     Value* allocated_tmp =
-        Bind(new(Z) LoadLocalInstr(*tmp_var, node->token_pos()));
+        Bind(new (Z) LoadLocalInstr(*tmp_var, node->token_pos()));
     PushArgumentInstr* push_allocated_value = PushArgument(allocated_tmp);
     BuildConstructorCall(node, push_allocated_value);
     ReturnDefinition(ExitTempLocalScope(allocate));
@@ -2960,20 +2821,16 @@
 }
 
 
-
 void EffectGraphVisitor::BuildInstanceGetterConditional(
     InstanceGetterNode* node) {
   const TokenPosition token_pos = node->token_pos();
   LocalVariable* temp_var = owner()->parsed_function().expression_temp_var();
-  LoadLocalNode* load_temp = new(Z) LoadLocalNode(token_pos, temp_var);
+  LoadLocalNode* load_temp = new (Z) LoadLocalNode(token_pos, temp_var);
 
   LiteralNode* null_constant =
-      new(Z) LiteralNode(ST(token_pos), Object::null_instance());
-  ComparisonNode* check_is_null =
-      new(Z) ComparisonNode(ST(token_pos),
-                            Token::kEQ,
-                            load_temp,
-                            null_constant);
+      new (Z) LiteralNode(ST(token_pos), Object::null_instance());
+  ComparisonNode* check_is_null = new (Z)
+      ComparisonNode(ST(token_pos), Token::kEQ, load_temp, null_constant);
   TestGraphVisitor for_test(owner(), ST(token_pos));
   check_is_null->Visit(&for_test);
 
@@ -2981,14 +2838,13 @@
   EffectGraphVisitor for_false(owner());
 
   StoreLocalNode* store_null =
-      new(Z) StoreLocalNode(ST(token_pos), temp_var, null_constant);
+      new (Z) StoreLocalNode(ST(token_pos), temp_var, null_constant);
   store_null->Visit(&for_true);
 
-  InstanceGetterNode* getter = new(Z) InstanceGetterNode(token_pos,
-                                                         load_temp,
-                                                         node->field_name());
+  InstanceGetterNode* getter =
+      new (Z) InstanceGetterNode(token_pos, load_temp, node->field_name());
   StoreLocalNode* store_getter =
-      new(Z) StoreLocalNode(ST(token_pos), temp_var, getter);
+      new (Z) StoreLocalNode(ST(token_pos), temp_var, getter);
   store_getter->Visit(&for_false);
 
   Join(for_test, for_true, for_false);
@@ -3019,17 +2875,13 @@
   } else {
     PushArgumentInstr* push_receiver = PushArgument(for_receiver.value());
     ZoneGrowableArray<PushArgumentInstr*>* arguments =
-        new(Z) ZoneGrowableArray<PushArgumentInstr*>(1);
+        new (Z) ZoneGrowableArray<PushArgumentInstr*>(1);
     arguments->Add(push_receiver);
     const String& name =
         String::ZoneHandle(Z, Field::GetterSymbol(node->field_name()));
-    InstanceCallInstr* call = new(Z) InstanceCallInstr(
-        node->token_pos(),
-        name,
-        Token::kGET,
-        arguments, Object::null_array(),
-        1,
-        owner()->ic_data_array());
+    InstanceCallInstr* call = new (Z)
+        InstanceCallInstr(node->token_pos(), name, Token::kGET, arguments,
+                          Object::null_array(), 1, owner()->ic_data_array());
     ReturnDefinition(call);
   }
 }
@@ -3067,43 +2919,32 @@
     Do(BuildStoreExprTemp(for_receiver.value(), token_pos));
 
     LocalVariable* temp_var = owner()->parsed_function().expression_temp_var();
-    LoadLocalNode* load_temp =
-        new(Z) LoadLocalNode(ST(token_pos), temp_var);
+    LoadLocalNode* load_temp = new (Z) LoadLocalNode(ST(token_pos), temp_var);
     LiteralNode* null_constant =
-        new(Z) LiteralNode(ST(token_pos), Object::null_instance());
-    ComparisonNode* check_is_null =
-        new(Z) ComparisonNode(ST(token_pos),
-                              Token::kEQ,
-                              load_temp,
-                              null_constant);
+        new (Z) LiteralNode(ST(token_pos), Object::null_instance());
+    ComparisonNode* check_is_null = new (Z)
+        ComparisonNode(ST(token_pos), Token::kEQ, load_temp, null_constant);
     TestGraphVisitor for_test(owner(), ST(token_pos));
     check_is_null->Visit(&for_test);
 
     EffectGraphVisitor for_true(owner());
     EffectGraphVisitor for_false(owner());
 
-    InstanceSetterNode* setter =
-        new(Z) InstanceSetterNode(token_pos,
-                                  load_temp,
-                                  node->field_name(),
-                                  node->value());
+    InstanceSetterNode* setter = new (Z) InstanceSetterNode(
+        token_pos, load_temp, node->field_name(), node->value());
     setter->Visit(&for_false);
     Join(for_test, for_true, for_false);
     return;
   }
   ZoneGrowableArray<PushArgumentInstr*>* arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>(2);
+      new (Z) ZoneGrowableArray<PushArgumentInstr*>(2);
   BuildInstanceSetterArguments(node, arguments, kResultNotNeeded);
   const String& name =
       String::ZoneHandle(Z, Field::SetterSymbol(node->field_name()));
   const intptr_t kNumArgsChecked = 1;  // Do not check value type.
-  InstanceCallInstr* call = new(Z) InstanceCallInstr(token_pos,
-                                                     name,
-                                                     Token::kSET,
-                                                     arguments,
-                                                     Object::null_array(),
-                                                     kNumArgsChecked,
-                                                     owner()->ic_data_array());
+  InstanceCallInstr* call = new (Z) InstanceCallInstr(
+      token_pos, name, Token::kSET, arguments, Object::null_array(),
+      kNumArgsChecked, owner()->ic_data_array());
   ReturnDefinition(call);
 }
 
@@ -3117,15 +2958,11 @@
     Do(BuildStoreExprTemp(for_receiver.value(), token_pos));
 
     LocalVariable* temp_var = owner()->parsed_function().expression_temp_var();
-    LoadLocalNode* load_temp =
-        new(Z) LoadLocalNode(ST(token_pos), temp_var);
+    LoadLocalNode* load_temp = new (Z) LoadLocalNode(ST(token_pos), temp_var);
     LiteralNode* null_constant =
-        new(Z) LiteralNode(ST(token_pos), Object::null_instance());
-    ComparisonNode* check_is_null =
-        new(Z) ComparisonNode(ST(token_pos),
-                              Token::kEQ,
-                              load_temp,
-                              null_constant);
+        new (Z) LiteralNode(ST(token_pos), Object::null_instance());
+    ComparisonNode* check_is_null = new (Z)
+        ComparisonNode(ST(token_pos), Token::kEQ, load_temp, null_constant);
     TestGraphVisitor for_test(owner(), ST(token_pos));
     check_is_null->Visit(&for_test);
 
@@ -3134,11 +2971,8 @@
     for_true.Do(BuildStoreExprTemp(for_true.value(), token_pos));
 
     ValueGraphVisitor for_false(owner());
-    InstanceSetterNode* setter =
-        new(Z) InstanceSetterNode(token_pos,
-                                  load_temp,
-                                  node->field_name(),
-                                  node->value());
+    InstanceSetterNode* setter = new (Z) InstanceSetterNode(
+        token_pos, load_temp, node->field_name(), node->value());
     setter->Visit(&for_false);
     for_false.Do(BuildStoreExprTemp(for_false.value(), token_pos));
 
@@ -3147,18 +2981,14 @@
     return;
   }
   ZoneGrowableArray<PushArgumentInstr*>* arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>(2);
+      new (Z) ZoneGrowableArray<PushArgumentInstr*>(2);
   BuildInstanceSetterArguments(node, arguments, kResultNeeded);
   const String& name =
       String::ZoneHandle(Z, Field::SetterSymbol(node->field_name()));
   const intptr_t kNumArgsChecked = 1;  // Do not check value type.
-  Do(new(Z) InstanceCallInstr(token_pos,
-                              name,
-                              Token::kSET,
-                              arguments,
-                              Object::null_array(),
-                              kNumArgsChecked,
-                              owner()->ic_data_array()));
+  Do(new (Z) InstanceCallInstr(token_pos, name, Token::kSET, arguments,
+                               Object::null_array(), kNumArgsChecked,
+                               owner()->ic_data_array()));
   ReturnDefinition(BuildLoadExprTemp(token_pos));
 }
 
@@ -3167,24 +2997,21 @@
   const String& getter_name =
       String::ZoneHandle(Z, Field::GetterSymbol(node->field_name()));
   ZoneGrowableArray<PushArgumentInstr*>* arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>();
+      new (Z) ZoneGrowableArray<PushArgumentInstr*>();
   Function& getter_function = Function::ZoneHandle(Z, Function::null());
   if (node->is_super_getter()) {
     // Statically resolved instance getter, i.e. "super getter".
     ASSERT(node->receiver() != NULL);
-    getter_function = Resolver::ResolveDynamicAnyArgs(Z,
-        node->cls(), getter_name);
+    getter_function =
+        Resolver::ResolveDynamicAnyArgs(Z, node->cls(), getter_name);
     if (getter_function.IsNull()) {
       // Resolve and call noSuchMethod.
-      ArgumentListNode* arguments = new(Z) ArgumentListNode(node->token_pos());
+      ArgumentListNode* arguments = new (Z) ArgumentListNode(node->token_pos());
       arguments->Add(node->receiver());
-      StaticCallInstr* call =
-          BuildStaticNoSuchMethodCall(node->cls(),
-                                      node->receiver(),
-                                      getter_name,
-                                      arguments,
-                                      false,  // Don't save last argument.
-                                      true);  // Super invocation.
+      StaticCallInstr* call = BuildStaticNoSuchMethodCall(
+          node->cls(), node->receiver(), getter_name, arguments,
+          false,  // Don't save last argument.
+          true);  // Super invocation.
       ReturnDefinition(call);
       return;
     } else {
@@ -3212,26 +3039,21 @@
 
       // Throw a NoSuchMethodError.
       StaticCallInstr* call = BuildThrowNoSuchMethodError(
-          node->token_pos(),
-          node->cls(),
-          getter_name,
+          node->token_pos(), node->cls(), getter_name,
           NULL,  // No Arguments to getter.
-          InvocationMirror::EncodeType(
-              node->cls().IsTopLevel() ?
-                  InvocationMirror::kTopLevel :
-                  InvocationMirror::kStatic,
-              InvocationMirror::kGetter));
+          InvocationMirror::EncodeType(node->cls().IsTopLevel()
+                                           ? InvocationMirror::kTopLevel
+                                           : InvocationMirror::kStatic,
+                                       InvocationMirror::kGetter));
       ReturnDefinition(call);
       return;
     }
   }
   ASSERT(!getter_function.IsNull());
-  StaticCallInstr* call = new(Z) StaticCallInstr(
-      node->token_pos(),
-      getter_function,
-      Object::null_array(),  // No names
-      arguments,
-      owner()->ic_data_array());
+  StaticCallInstr* call =
+      new (Z) StaticCallInstr(node->token_pos(), getter_function,
+                              Object::null_array(),  // No names
+                              arguments, owner()->ic_data_array());
   ReturnDefinition(call);
 }
 
@@ -3241,7 +3063,7 @@
   const String& setter_name =
       String::ZoneHandle(Z, Field::SetterSymbol(node->field_name()));
   ZoneGrowableArray<PushArgumentInstr*>* arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>(1);
+      new (Z) ZoneGrowableArray<PushArgumentInstr*>(1);
   const TokenPosition token_pos = node->token_pos();
   // A super setter is an instance setter whose setter function is
   // resolved at compile time (in the caller instance getter's super class).
@@ -3253,30 +3075,24 @@
     if (is_super_setter) {
       ASSERT(node->receiver() != NULL);
       // Resolve and call noSuchMethod.
-      ArgumentListNode* arguments = new(Z) ArgumentListNode(token_pos);
+      ArgumentListNode* arguments = new (Z) ArgumentListNode(token_pos);
       arguments->Add(node->receiver());
       arguments->Add(node->value());
       call = BuildStaticNoSuchMethodCall(
-          node->cls(),
-          node->receiver(),
-          setter_name,
-          arguments,
+          node->cls(), node->receiver(), setter_name, arguments,
           result_is_needed,  // Save last arg if result is needed.
-          true);  // Super invocation.
+          true);             // Super invocation.
     } else {
       // Throw a NoSuchMethodError.
-      ArgumentListNode* arguments = new(Z) ArgumentListNode(token_pos);
+      ArgumentListNode* arguments = new (Z) ArgumentListNode(token_pos);
       arguments->Add(node->value());
       call = BuildThrowNoSuchMethodError(
-          token_pos,
-          node->cls(),
-          setter_name,
+          token_pos, node->cls(), setter_name,
           arguments,  // Argument is the value passed to the setter.
-          InvocationMirror::EncodeType(
-            node->cls().IsTopLevel() ?
-                InvocationMirror::kTopLevel :
-                InvocationMirror::kStatic,
-            InvocationMirror::kSetter));
+          InvocationMirror::EncodeType(node->cls().IsTopLevel()
+                                           ? InvocationMirror::kTopLevel
+                                           : InvocationMirror::kStatic,
+                                       InvocationMirror::kSetter));
     }
   } else {
     if (is_super_setter) {
@@ -3297,11 +3113,9 @@
     }
     arguments->Add(PushArgument(value));
 
-    call = new(Z) StaticCallInstr(token_pos,
-                                  setter_function,
-                                  Object::null_array(),  // No names.
-                                  arguments,
-                                  owner()->ic_data_array());
+    call = new (Z) StaticCallInstr(token_pos, setter_function,
+                                   Object::null_array(),  // No names.
+                                   arguments, owner()->ic_data_array());
   }
   if (result_is_needed) {
     Do(call);
@@ -3341,11 +3155,11 @@
 }
 
 
-LoadLocalInstr* EffectGraphVisitor::BuildLoadThisVar(
-    LocalScope* scope, TokenPosition token_pos) {
+LoadLocalInstr* EffectGraphVisitor::BuildLoadThisVar(LocalScope* scope,
+                                                     TokenPosition token_pos) {
   LocalVariable* receiver_var = scope->LookupVariable(Symbols::This(),
                                                       true);  // Test only.
-  return new(Z) LoadLocalInstr(*receiver_var, token_pos);
+  return new (Z) LoadLocalInstr(*receiver_var, token_pos);
 }
 
 
@@ -3356,10 +3170,8 @@
     const Type& type,
     intptr_t class_id) {
   Value* receiver = Bind(BuildLoadThisVar(node->scope(), node->token_pos()));
-  LoadFieldInstr* load = new(Z) LoadFieldInstr(receiver,
-                                               offset,
-                                               type,
-                                               node->token_pos());
+  LoadFieldInstr* load =
+      new (Z) LoadFieldInstr(receiver, offset, type, node->token_pos());
   load->set_result_cid(class_id);
   load->set_recognized_kind(kind);
   return load;
@@ -3373,15 +3185,11 @@
   Value* receiver = Bind(BuildLoadThisVar(node->scope(), node->token_pos()));
   LocalVariable* value_var =
       node->scope()->LookupVariable(Symbols::Value(), true);
-  Value* value = Bind(new(Z) LoadLocalInstr(*value_var, node->token_pos()));
-  StoreInstanceFieldInstr* store = new(Z) StoreInstanceFieldInstr(
-      offset,
-      receiver,
-      value,
-      emit_store_barrier,
-      node->token_pos());
+  Value* value = Bind(new (Z) LoadLocalInstr(*value_var, node->token_pos()));
+  StoreInstanceFieldInstr* store = new (Z) StoreInstanceFieldInstr(
+      offset, receiver, value, emit_store_barrier, node->token_pos());
   Do(store);
-  return new(Z) ConstantInstr(Object::ZoneHandle(Z, Object::null()));
+  return new (Z) ConstantInstr(Object::ZoneHandle(Z, Object::null()));
 }
 
 
@@ -3396,15 +3204,11 @@
         LocalVariable* other_var =
             node->scope()->LookupVariable(Symbols::Other(),
                                           true);  // Test only.
-        Value* other = Bind(new(Z) LoadLocalInstr(*other_var, token_pos));
+        Value* other = Bind(new (Z) LoadLocalInstr(*other_var, token_pos));
         // Receiver is not a number because numbers override equality.
         const bool kNoNumberCheck = false;
-        StrictCompareInstr* compare =
-            new(Z) StrictCompareInstr(token_pos,
-                                      Token::kEQ_STRICT,
-                                      receiver,
-                                      other,
-                                      kNoNumberCheck);
+        StrictCompareInstr* compare = new (Z) StrictCompareInstr(
+            token_pos, Token::kEQ_STRICT, receiver, other, kNoNumberCheck);
         return ReturnDefinition(compare);
       }
       case MethodRecognizer::kStringBaseLength:
@@ -3421,102 +3225,90 @@
           return ReturnDefinition(load);
         }
         ASSERT(kind == MethodRecognizer::kStringBaseIsEmpty);
-        Value* zero_val = Bind(new(Z) ConstantInstr(
-            Smi::ZoneHandle(Z, Smi::New(0))));
+        Value* zero_val =
+            Bind(new (Z) ConstantInstr(Smi::ZoneHandle(Z, Smi::New(0))));
         Value* load_val = Bind(load);
-        StrictCompareInstr* compare =
-            new(Z) StrictCompareInstr(token_pos,
-                                      Token::kEQ_STRICT,
-                                      load_val,
-                                      zero_val,
-                                      false);  // No number check.
+        StrictCompareInstr* compare = new (Z)
+            StrictCompareInstr(token_pos, Token::kEQ_STRICT, load_val, zero_val,
+                               false);  // No number check.
         return ReturnDefinition(compare);
       }
       case MethodRecognizer::kGrowableArrayLength:
       case MethodRecognizer::kObjectArrayLength:
       case MethodRecognizer::kImmutableArrayLength:
       case MethodRecognizer::kTypedDataLength: {
-        LoadFieldInstr* load = BuildNativeGetter(
-            node, kind, OffsetForLengthGetter(kind),
-            Type::ZoneHandle(Z, Type::SmiType()), kSmiCid);
+        LoadFieldInstr* load =
+            BuildNativeGetter(node, kind, OffsetForLengthGetter(kind),
+                              Type::ZoneHandle(Z, Type::SmiType()), kSmiCid);
         load->set_is_immutable(kind != MethodRecognizer::kGrowableArrayLength);
         return ReturnDefinition(load);
       }
       case MethodRecognizer::kClassIDgetID: {
         LocalVariable* value_var =
             node->scope()->LookupVariable(Symbols::Value(), true);
-        Value* value = Bind(new(Z) LoadLocalInstr(*value_var, token_pos));
-        LoadClassIdInstr* load = new(Z) LoadClassIdInstr(value);
+        Value* value = Bind(new (Z) LoadLocalInstr(*value_var, token_pos));
+        LoadClassIdInstr* load = new (Z) LoadClassIdInstr(value);
         return ReturnDefinition(load);
       }
       case MethodRecognizer::kGrowableArrayCapacity: {
         Value* receiver = Bind(BuildLoadThisVar(node->scope(), token_pos));
-        LoadFieldInstr* data_load = new(Z) LoadFieldInstr(
-            receiver,
-            Array::data_offset(),
-            Object::dynamic_type(),
-            node->token_pos());
+        LoadFieldInstr* data_load =
+            new (Z) LoadFieldInstr(receiver, Array::data_offset(),
+                                   Object::dynamic_type(), node->token_pos());
         data_load->set_result_cid(kArrayCid);
         Value* data = Bind(data_load);
-        LoadFieldInstr* length_load = new(Z) LoadFieldInstr(
-            data,
-            Array::length_offset(),
-            Type::ZoneHandle(Z, Type::SmiType()),
+        LoadFieldInstr* length_load = new (Z) LoadFieldInstr(
+            data, Array::length_offset(), Type::ZoneHandle(Z, Type::SmiType()),
             node->token_pos());
         length_load->set_result_cid(kSmiCid);
         length_load->set_recognized_kind(MethodRecognizer::kObjectArrayLength);
         return ReturnDefinition(length_load);
       }
       case MethodRecognizer::kObjectArrayAllocate: {
-        LocalVariable* type_args_parameter =
-            node->scope()->LookupVariable(Symbols::TypeArgumentsParameter(),
-                                          true);
+        LocalVariable* type_args_parameter = node->scope()->LookupVariable(
+            Symbols::TypeArgumentsParameter(), true);
         Value* element_type =
-            Bind(new(Z) LoadLocalInstr(*type_args_parameter, token_pos));
+            Bind(new (Z) LoadLocalInstr(*type_args_parameter, token_pos));
         LocalVariable* length_parameter =
             node->scope()->LookupVariable(Symbols::Length(), true);
         Value* length =
-            Bind(new(Z) LoadLocalInstr(*length_parameter, token_pos));
+            Bind(new (Z) LoadLocalInstr(*length_parameter, token_pos));
         CreateArrayInstr* create_array =
             new CreateArrayInstr(token_pos, element_type, length);
         return ReturnDefinition(create_array);
       }
       case MethodRecognizer::kBigint_getDigits: {
         return ReturnDefinition(BuildNativeGetter(
-            node, kind, Bigint::digits_offset(),
-            Object::dynamic_type(),
+            node, kind, Bigint::digits_offset(), Object::dynamic_type(),
             kTypedDataUint32ArrayCid));
       }
       case MethodRecognizer::kBigint_getUsed: {
-        return ReturnDefinition(BuildNativeGetter(
-            node, kind, Bigint::used_offset(),
-            Type::ZoneHandle(Z, Type::SmiType()), kSmiCid));
+        return ReturnDefinition(
+            BuildNativeGetter(node, kind, Bigint::used_offset(),
+                              Type::ZoneHandle(Z, Type::SmiType()), kSmiCid));
       }
       case MethodRecognizer::kLinkedHashMap_getIndex: {
-        return ReturnDefinition(BuildNativeGetter(
-            node, kind, LinkedHashMap::index_offset(),
-            Object::dynamic_type(),
-            kDynamicCid));
+        return ReturnDefinition(
+            BuildNativeGetter(node, kind, LinkedHashMap::index_offset(),
+                              Object::dynamic_type(), kDynamicCid));
       }
       case MethodRecognizer::kLinkedHashMap_setIndex: {
         return ReturnDefinition(DoNativeSetterStoreValue(
             node, LinkedHashMap::index_offset(), kEmitStoreBarrier));
       }
       case MethodRecognizer::kLinkedHashMap_getData: {
-        return ReturnDefinition(BuildNativeGetter(
-            node, kind, LinkedHashMap::data_offset(),
-            Object::dynamic_type(),
-            kArrayCid));
+        return ReturnDefinition(
+            BuildNativeGetter(node, kind, LinkedHashMap::data_offset(),
+                              Object::dynamic_type(), kArrayCid));
       }
       case MethodRecognizer::kLinkedHashMap_setData: {
         return ReturnDefinition(DoNativeSetterStoreValue(
             node, LinkedHashMap::data_offset(), kEmitStoreBarrier));
       }
       case MethodRecognizer::kLinkedHashMap_getHashMask: {
-        return ReturnDefinition(BuildNativeGetter(
-            node, kind, LinkedHashMap::hash_mask_offset(),
-            Type::ZoneHandle(Z, Type::SmiType()),
-            kSmiCid));
+        return ReturnDefinition(
+            BuildNativeGetter(node, kind, LinkedHashMap::hash_mask_offset(),
+                              Type::ZoneHandle(Z, Type::SmiType()), kSmiCid));
       }
       case MethodRecognizer::kLinkedHashMap_setHashMask: {
         // Smi field; no barrier needed.
@@ -3524,10 +3316,9 @@
             node, LinkedHashMap::hash_mask_offset(), kNoStoreBarrier));
       }
       case MethodRecognizer::kLinkedHashMap_getUsedData: {
-        return ReturnDefinition(BuildNativeGetter(
-            node, kind, LinkedHashMap::used_data_offset(),
-            Type::ZoneHandle(Z, Type::SmiType()),
-            kSmiCid));
+        return ReturnDefinition(
+            BuildNativeGetter(node, kind, LinkedHashMap::used_data_offset(),
+                              Type::ZoneHandle(Z, Type::SmiType()), kSmiCid));
       }
       case MethodRecognizer::kLinkedHashMap_setUsedData: {
         // Smi field; no barrier needed.
@@ -3535,10 +3326,9 @@
             node, LinkedHashMap::used_data_offset(), kNoStoreBarrier));
       }
       case MethodRecognizer::kLinkedHashMap_getDeletedKeys: {
-        return ReturnDefinition(BuildNativeGetter(
-            node, kind, LinkedHashMap::deleted_keys_offset(),
-            Type::ZoneHandle(Z, Type::SmiType()),
-            kSmiCid));
+        return ReturnDefinition(
+            BuildNativeGetter(node, kind, LinkedHashMap::deleted_keys_offset(),
+                              Type::ZoneHandle(Z, Type::SmiType()), kSmiCid));
       }
       case MethodRecognizer::kLinkedHashMap_setDeletedKeys: {
         // Smi field; no barrier needed.
@@ -3546,16 +3336,16 @@
             node, LinkedHashMap::deleted_keys_offset(), kNoStoreBarrier));
       }
       case MethodRecognizer::kBigint_getNeg: {
-        return ReturnDefinition(BuildNativeGetter(
-            node, kind, Bigint::neg_offset(),
-            Type::ZoneHandle(Z, Type::BoolType()), kBoolCid));
+        return ReturnDefinition(
+            BuildNativeGetter(node, kind, Bigint::neg_offset(),
+                              Type::ZoneHandle(Z, Type::BoolType()), kBoolCid));
       }
       default:
         break;
     }
   }
   InlineBailout("EffectGraphVisitor::VisitNativeBodyNode");
-  NativeCallInstr* native_call = new(Z) NativeCallInstr(node);
+  NativeCallInstr* native_call = new (Z) NativeCallInstr(node);
   ReturnDefinition(native_call);
 }
 
@@ -3594,9 +3384,8 @@
          (rhs->IsLoadLocalNode() &&
           !rhs->AsLoadLocalNode()->local().IsInternal()) ||
          rhs->IsClosureNode()) &&
-        !node->local().IsInternal() &&
-        node->token_pos().IsDebugPause()) {
-      AddInstruction(new(Z) DebugStepCheckInstr(
+        !node->local().IsInternal() && node->token_pos().IsDebugPause()) {
+      AddInstruction(new (Z) DebugStepCheckInstr(
           node->token_pos(), RawPcDescriptors::kRuntimeCall));
     }
   }
@@ -3606,14 +3395,12 @@
   Append(for_value);
   Value* store_value = for_value.value();
   if (Isolate::Current()->type_checks()) {
-    store_value = BuildAssignableValue(node->value()->token_pos(),
-                                       store_value,
-                                       node->local().type(),
-                                       node->local().name());
+    store_value =
+        BuildAssignableValue(node->value()->token_pos(), store_value,
+                             node->local().type(), node->local().name());
   }
-  Definition* store = BuildStoreLocal(node->local(),
-                                      store_value,
-                                      node->token_pos());
+  Definition* store =
+      BuildStoreLocal(node->local(), store_value, node->token_pos());
   ReturnDefinition(store);
 }
 
@@ -3623,11 +3410,9 @@
   ValueGraphVisitor for_instance(owner());
   node->instance()->Visit(&for_instance);
   Append(for_instance);
-  LoadFieldInstr* load = new(Z) LoadFieldInstr(
-      for_instance.value(),
-      &node->field(),
-      AbstractType::ZoneHandle(Z, node->field().type()),
-      node->token_pos());
+  LoadFieldInstr* load = new (Z) LoadFieldInstr(
+      for_instance.value(), &node->field(),
+      AbstractType::ZoneHandle(Z, node->field().type()), node->token_pos());
   if (node->field().guarded_cid() != kIllegalCid) {
     if (!node->field().is_nullable() ||
         (node->field().guarded_cid() == kNullCid)) {
@@ -3653,33 +3438,24 @@
     const AbstractType& type =
         AbstractType::ZoneHandle(Z, node->field().type());
     const String& dst_name = String::ZoneHandle(Z, node->field().name());
-    store_value = BuildAssignableValue(node->value()->token_pos(),
-                                       store_value,
-                                       type,
-                                       dst_name);
+    store_value = BuildAssignableValue(node->value()->token_pos(), store_value,
+                                       type, dst_name);
   }
 
   if (FLAG_use_field_guards) {
     store_value = Bind(BuildStoreExprTemp(store_value, token_pos));
-    GuardFieldClassInstr* guard_field_class =
-        new(Z) GuardFieldClassInstr(store_value,
-                                    node->field(),
-                                    thread()->GetNextDeoptId());
+    GuardFieldClassInstr* guard_field_class = new (Z) GuardFieldClassInstr(
+        store_value, node->field(), thread()->GetNextDeoptId());
     AddInstruction(guard_field_class);
     store_value = Bind(BuildLoadExprTemp(token_pos));
-    GuardFieldLengthInstr* guard_field_length =
-        new(Z) GuardFieldLengthInstr(store_value,
-                                     node->field(),
-                                     thread()->GetNextDeoptId());
+    GuardFieldLengthInstr* guard_field_length = new (Z) GuardFieldLengthInstr(
+        store_value, node->field(), thread()->GetNextDeoptId());
     AddInstruction(guard_field_length);
     store_value = Bind(BuildLoadExprTemp(token_pos));
   }
-  StoreInstanceFieldInstr* store =
-      new(Z) StoreInstanceFieldInstr(node->field(),
-                                     for_instance.value(),
-                                     store_value,
-                                     kEmitStoreBarrier,
-                                     token_pos);
+  StoreInstanceFieldInstr* store = new (Z)
+      StoreInstanceFieldInstr(node->field(), for_instance.value(), store_value,
+                              kEmitStoreBarrier, token_pos);
   // Maybe initializing unboxed store.
   store->set_is_initialization(node->is_initializer());
   ReturnDefinition(store);
@@ -3690,16 +3466,15 @@
   const TokenPosition token_pos = node->token_pos();
   if (node->field().is_const()) {
     ASSERT(node->field().StaticValue() != Object::sentinel().raw());
-    ASSERT(node->field().StaticValue() !=
-           Object::transition_sentinel().raw());
-    Definition* result = new(Z) ConstantInstr(
+    ASSERT(node->field().StaticValue() != Object::transition_sentinel().raw());
+    Definition* result = new (Z) ConstantInstr(
         Instance::ZoneHandle(Z, node->field().StaticValue()), token_pos);
     return ReturnDefinition(result);
   }
-  Value* field_value = Bind(new(Z) ConstantInstr(
+  Value* field_value = Bind(new (Z) ConstantInstr(
       Field::ZoneHandle(Z, node->field().Original()), token_pos));
   LoadStaticFieldInstr* load =
-      new(Z) LoadStaticFieldInstr(field_value, token_pos);
+      new (Z) LoadStaticFieldInstr(field_value, token_pos);
   ReturnDefinition(load);
 }
 
@@ -3716,11 +3491,10 @@
     if (rhs->IsAssignableNode()) {
       rhs = rhs->AsAssignableNode()->expr();
     }
-    if ((rhs->IsLiteralNode() ||
-         rhs->IsLoadLocalNode() ||
+    if ((rhs->IsLiteralNode() || rhs->IsLoadLocalNode() ||
          rhs->IsClosureNode()) &&
-         node->token_pos().IsDebugPause()) {
-      AddInstruction(new(Z) DebugStepCheckInstr(
+        node->token_pos().IsDebugPause()) {
+      AddInstruction(new (Z) DebugStepCheckInstr(
           node->token_pos(), RawPcDescriptors::kRuntimeCall));
     }
   }
@@ -3735,7 +3509,7 @@
     store_value = for_value.value();
   }
   StoreStaticFieldInstr* store =
-      new(Z) StoreStaticFieldInstr(node->field(), store_value, token_pos);
+      new (Z) StoreStaticFieldInstr(node->field(), store_value, token_pos);
 
   if (result_is_needed) {
     Do(store);
@@ -3762,27 +3536,25 @@
   Function* super_function = NULL;
   if (node->IsSuperLoad()) {
     // Resolve the load indexed operator in the super class.
-    super_function = &Function::ZoneHandle(Z, Resolver::ResolveDynamicAnyArgs(Z,
-        node->super_class(), Symbols::IndexToken()));
+    super_function = &Function::ZoneHandle(
+        Z, Resolver::ResolveDynamicAnyArgs(Z, node->super_class(),
+                                           Symbols::IndexToken()));
     if (super_function->IsNull()) {
       // Could not resolve super operator. Generate call noSuchMethod() of the
       // super class instead.
-      ArgumentListNode* arguments = new(Z) ArgumentListNode(node->token_pos());
+      ArgumentListNode* arguments = new (Z) ArgumentListNode(node->token_pos());
       arguments->Add(node->array());
       arguments->Add(node->index_expr());
-      StaticCallInstr* call =
-          BuildStaticNoSuchMethodCall(node->super_class(),
-                                      node->array(),
-                                      Symbols::IndexToken(),
-                                      arguments,
-                                      false,  // Don't save last arg.
-                                      true);  // Super invocation.
+      StaticCallInstr* call = BuildStaticNoSuchMethodCall(
+          node->super_class(), node->array(), Symbols::IndexToken(), arguments,
+          false,  // Don't save last arg.
+          true);  // Super invocation.
       ReturnDefinition(call);
       return;
     }
   }
   ZoneGrowableArray<PushArgumentInstr*>* arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>(2);
+      new (Z) ZoneGrowableArray<PushArgumentInstr*>(2);
   ValueGraphVisitor for_array(owner());
   node->array()->Visit(&for_array);
   Append(for_array);
@@ -3795,51 +3567,42 @@
 
   if (super_function != NULL) {
     // Generate static call to super operator.
-    StaticCallInstr* load = new(Z) StaticCallInstr(node->token_pos(),
-                                                   *super_function,
-                                                   Object::null_array(),
-                                                   arguments,
-                                                   owner()->ic_data_array());
+    StaticCallInstr* load = new (Z) StaticCallInstr(
+        node->token_pos(), *super_function, Object::null_array(), arguments,
+        owner()->ic_data_array());
     ReturnDefinition(load);
   } else {
     // Generate dynamic call to index operator.
     const intptr_t checked_argument_count = 1;
-    InstanceCallInstr* load = new(Z) InstanceCallInstr(
-        node->token_pos(),
-        Symbols::IndexToken(),
-        Token::kINDEX,
-        arguments,
-        Object::null_array(),
-        checked_argument_count,
-        owner()->ic_data_array());
+    InstanceCallInstr* load = new (Z) InstanceCallInstr(
+        node->token_pos(), Symbols::IndexToken(), Token::kINDEX, arguments,
+        Object::null_array(), checked_argument_count, owner()->ic_data_array());
     ReturnDefinition(load);
   }
 }
 
 
-Definition* EffectGraphVisitor::BuildStoreIndexedValues(
-    StoreIndexedNode* node,
-    bool result_is_needed) {
+Definition* EffectGraphVisitor::BuildStoreIndexedValues(StoreIndexedNode* node,
+                                                        bool result_is_needed) {
   Function* super_function = NULL;
   const TokenPosition token_pos = node->token_pos();
   if (node->IsSuperStore()) {
     // Resolve the store indexed operator in the super class.
-    super_function = &Function::ZoneHandle(Z, Resolver::ResolveDynamicAnyArgs(Z,
-        node->super_class(), Symbols::AssignIndexToken()));
+    super_function = &Function::ZoneHandle(
+        Z, Resolver::ResolveDynamicAnyArgs(Z, node->super_class(),
+                                           Symbols::AssignIndexToken()));
     if (super_function->IsNull()) {
       // Could not resolve super operator. Generate call noSuchMethod() of the
       // super class instead.
-      ArgumentListNode* arguments = new(Z) ArgumentListNode(token_pos);
+      ArgumentListNode* arguments = new (Z) ArgumentListNode(token_pos);
       arguments->Add(node->array());
       arguments->Add(node->index_expr());
       arguments->Add(node->value());
       StaticCallInstr* call = BuildStaticNoSuchMethodCall(
-          node->super_class(),
-          node->array(),
-          Symbols::AssignIndexToken(),
+          node->super_class(), node->array(), Symbols::AssignIndexToken(),
           arguments,
           result_is_needed,  // Save last arg if result is needed.
-          true);  // Super invocation.
+          true);             // Super invocation.
       if (result_is_needed) {
         Do(call);
         // BuildStaticNoSuchMethodCall stores the value in expression_temp.
@@ -3851,7 +3614,7 @@
   }
 
   ZoneGrowableArray<PushArgumentInstr*>* arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>(3);
+      new (Z) ZoneGrowableArray<PushArgumentInstr*>(3);
   ValueGraphVisitor for_array(owner());
   node->array()->Visit(&for_array);
   Append(for_array);
@@ -3876,12 +3639,9 @@
   if (super_function != NULL) {
     // Generate static call to super operator []=.
 
-    StaticCallInstr* store =
-        new(Z) StaticCallInstr(token_pos,
-                               *super_function,
-                               Object::null_array(),
-                               arguments,
-                               owner()->ic_data_array());
+    StaticCallInstr* store = new (Z)
+        StaticCallInstr(token_pos, *super_function, Object::null_array(),
+                        arguments, owner()->ic_data_array());
     if (result_is_needed) {
       Do(store);
       return BuildLoadExprTemp(token_pos);
@@ -3891,14 +3651,9 @@
   } else {
     // Generate dynamic call to operator []=.
     const intptr_t checked_argument_count = 2;  // Do not check for value type.
-    InstanceCallInstr* store =
-        new(Z) InstanceCallInstr(token_pos,
-                                 Symbols::AssignIndexToken(),
-                                 Token::kASSIGN_INDEX,
-                                 arguments,
-                                 Object::null_array(),
-                                 checked_argument_count,
-                                 owner()->ic_data_array());
+    InstanceCallInstr* store = new (Z) InstanceCallInstr(
+        token_pos, Symbols::AssignIndexToken(), Token::kASSIGN_INDEX, arguments,
+        Object::null_array(), checked_argument_count, owner()->ic_data_array());
     if (result_is_needed) {
       Do(store);
       return BuildLoadExprTemp(token_pos);
@@ -3920,8 +3675,8 @@
 
 
 bool EffectGraphVisitor::HasContextScope() const {
-  const ContextScope& context_scope = ContextScope::Handle(
-      owner()->function().context_scope());
+  const ContextScope& context_scope =
+      ContextScope::Handle(owner()->function().context_scope());
   return !context_scope.IsNull() && (context_scope.num_variables() > 0);
 }
 
@@ -3932,12 +3687,10 @@
   if (n > 0) {
     Value* context = Bind(BuildCurrentContext(token_pos));
     while (n-- > 0) {
-      context = Bind(
-          new(Z) LoadFieldInstr(context,
-                                Context::parent_offset(),
-                                // Not an instance, no type.
-                                Type::ZoneHandle(Z, Type::null()),
-                                token_pos));
+      context = Bind(new (Z) LoadFieldInstr(context, Context::parent_offset(),
+                                            // Not an instance, no type.
+                                            Type::ZoneHandle(Z, Type::null()),
+                                            token_pos));
     }
     Do(BuildStoreContext(context, token_pos));
   }
@@ -3989,26 +3742,23 @@
     // The local scope declares variables that are captured.
     // Allocate and chain a new context (Except don't chain when at the function
     // entry if the function does not capture any variables from outer scopes).
-    Value* allocated_context =
-        Bind(new(Z) AllocateContextInstr(node->token_pos(),
-                                         num_context_variables));
-    { LocalVariable* tmp_var = EnterTempLocalScope(allocated_context);
+    Value* allocated_context = Bind(
+        new (Z) AllocateContextInstr(node->token_pos(), num_context_variables));
+    {
+      LocalVariable* tmp_var = EnterTempLocalScope(allocated_context);
       if (!is_top_level_sequence || HasContextScope()) {
         ASSERT(is_top_level_sequence ||
                (nested_block.ContextLevel() ==
                 nested_block.outer()->ContextLevel() + 1));
-        Value* tmp_val = Bind(
-            new(Z) LoadLocalInstr(*tmp_var, node->token_pos()));
+        Value* tmp_val =
+            Bind(new (Z) LoadLocalInstr(*tmp_var, node->token_pos()));
         Value* parent_context = Bind(BuildCurrentContext(node->token_pos()));
-        Do(new(Z) StoreInstanceFieldInstr(Context::parent_offset(),
-                                          tmp_val,
-                                          parent_context,
-                                          kEmitStoreBarrier,
-                                          node->token_pos()));
+        Do(new (Z) StoreInstanceFieldInstr(Context::parent_offset(), tmp_val,
+                                           parent_context, kEmitStoreBarrier,
+                                           node->token_pos()));
       }
-      Do(BuildStoreContext(
-          Bind(ExitTempLocalScope(allocated_context)),
-          node->token_pos()));
+      Do(BuildStoreContext(Bind(ExitTempLocalScope(allocated_context)),
+                           node->token_pos()));
     }
 
     // If this node_sequence is the body of the function being compiled, copy
@@ -4016,18 +3766,20 @@
     if (is_top_level_sequence) {
       ASSERT(scope->context_level() == 1);
       const int num_params = function.NumParameters();
-      int param_frame_index = (num_params == function.num_fixed_parameters()) ?
-          (kParamEndSlotFromFp + num_params) : kFirstLocalSlotFromFp;
+      int param_frame_index = (num_params == function.num_fixed_parameters())
+                                  ? (kParamEndSlotFromFp + num_params)
+                                  : kFirstLocalSlotFromFp;
       for (int pos = 0; pos < num_params; param_frame_index--, pos++) {
         const LocalVariable& parameter = *scope->VariableAt(pos);
         ASSERT(parameter.owner() == scope);
         if (parameter.is_captured()) {
           // Create a temporary local describing the original position.
           const String& temp_name = Symbols::TempParam();
-          LocalVariable* temp_local = new(Z) LocalVariable(
-              TokenPosition::kNoSource,  // Token index.
-              temp_name,
-              Object::dynamic_type());  // Type.
+          LocalVariable* temp_local =
+              new (Z) LocalVariable(TokenPosition::kNoSource,  // Token index.
+                                    TokenPosition::kNoSource,  // Token index.
+                                    temp_name,
+                                    Object::dynamic_type());  // Type.
           temp_local->set_index(param_frame_index);
 
           // Mark this local as captured parameter so that the optimizer
@@ -4042,18 +3794,16 @@
           // Write NULL to the source location to detect buggy accesses and
           // allow GC of passed value if it gets overwritten by a new value in
           // the function.
-          Value* null_constant = Bind(new(Z) ConstantInstr(
-              Object::ZoneHandle(Z, Object::null())));
-          Do(BuildStoreLocal(*temp_local,
-                             null_constant,
+          Value* null_constant = Bind(
+              new (Z) ConstantInstr(Object::ZoneHandle(Z, Object::null())));
+          Do(BuildStoreLocal(*temp_local, null_constant,
                              ST(node->token_pos())));
         }
       }
     }
   }
 
-  if (FLAG_support_debugger &&
-      is_top_level_sequence &&
+  if (FLAG_support_debugger && is_top_level_sequence &&
       function.is_debuggable()) {
     // Place a debug check at method entry to ensure breaking on a method always
     // happens, even if there are no assignments/calls/runtimecalls in the first
@@ -4071,8 +3821,8 @@
       check_pos = node->token_pos();
       ASSERT(check_pos.IsDebugPause());
     }
-    AddInstruction(new(Z) DebugStepCheckInstr(check_pos,
-                                              RawPcDescriptors::kRuntimeCall));
+    AddInstruction(
+        new (Z) DebugStepCheckInstr(check_pos, RawPcDescriptors::kRuntimeCall));
   }
 
   // This check may be deleted if the generated code is leaf.
@@ -4083,7 +3833,7 @@
     if (!function.IsImplicitGetterFunction() &&
         !function.IsImplicitSetterFunction()) {
       CheckStackOverflowInstr* check =
-          new(Z) CheckStackOverflowInstr(node->token_pos(), 0);
+          new (Z) CheckStackOverflowInstr(node->token_pos(), 0);
       // If we are inlining don't actually attach the stack check. We must still
       // create the stack check in order to allocate a deopt id.
       if (!owner()->IsInlining()) {
@@ -4095,8 +3845,7 @@
   if (Isolate::Current()->type_checks() && is_top_level_sequence) {
     const int num_params = function.NumParameters();
     int pos = 0;
-    if (function.IsFactory() ||
-        function.IsDynamicFunction() ||
+    if (function.IsFactory() || function.IsDynamicFunction() ||
         function.IsGenerativeConstructor()) {
       // Skip type checking of type arguments for factory functions.
       // Skip type checking of receiver for instance functions and constructors.
@@ -4105,16 +3854,12 @@
     while (pos < num_params) {
       const LocalVariable& parameter = *scope->VariableAt(pos);
       ASSERT(parameter.owner() == scope);
-      if (!CanSkipTypeCheck(parameter.token_pos(),
-                            NULL,
-                            parameter.type(),
+      if (!CanSkipTypeCheck(parameter.token_pos(), NULL, parameter.type(),
                             parameter.name())) {
         Value* parameter_value =
             Bind(BuildLoadLocal(parameter, parameter.token_pos()));
-        Do(BuildAssertAssignable(parameter.token_pos(),
-                                 parameter_value,
-                                 parameter.type(),
-                                 parameter.name()));
+        Do(BuildAssertAssignable(parameter.token_pos(), parameter_value,
+                                 parameter.type(), parameter.name()));
       }
       pos++;
     }
@@ -4126,11 +3871,10 @@
   // The preamble is generated after visiting the body.
   GotoInstr* preamble_start = NULL;
   if (is_top_level_sequence &&
-      (function.IsAsyncClosure() ||
-          function.IsSyncGenClosure() ||
-          function.IsAsyncGenClosure())) {
-    JoinEntryInstr* preamble_end = new(Z) JoinEntryInstr(
-        owner()->AllocateBlockId(), owner()->try_index());
+      (function.IsAsyncClosure() || function.IsSyncGenClosure() ||
+       function.IsAsyncGenClosure())) {
+    JoinEntryInstr* preamble_end = new (Z)
+        JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
     ASSERT(exit() != NULL);
     exit()->Goto(preamble_end);
     ASSERT(exit()->next()->IsGoto());
@@ -4154,14 +3898,13 @@
   // After generating the CFG for the body we can create the preamble
   // because we know exactly how many continuation states we need.
   if (is_top_level_sequence &&
-      (function.IsAsyncClosure() ||
-          function.IsSyncGenClosure() ||
-          function.IsAsyncGenClosure())) {
+      (function.IsAsyncClosure() || function.IsSyncGenClosure() ||
+       function.IsAsyncGenClosure())) {
     ASSERT(preamble_start != NULL);
     // We are at the top level. Fetch the corresponding scope.
     LocalScope* top_scope = node->scope();
-    LocalVariable* jump_var = top_scope->LookupVariable(
-        Symbols::AwaitJumpVar(), false);
+    LocalVariable* jump_var =
+        top_scope->LookupVariable(Symbols::AwaitJumpVar(), false);
     ASSERT(jump_var != NULL && jump_var->is_captured());
     Instruction* saved_entry = entry_;
     Instruction* saved_exit = exit_;
@@ -4169,27 +3912,24 @@
     exit_ = NULL;
 
     LoadLocalNode* load_jump_count =
-        new(Z) LoadLocalNode(node->token_pos(), jump_var);
+        new (Z) LoadLocalNode(node->token_pos(), jump_var);
     ComparisonNode* check_jump_count;
     const intptr_t num_await_states = owner()->await_joins()->length();
 
-    LocalVariable* old_context = top_scope->LookupVariable(
-        Symbols::AwaitContextVar(), false);
+    LocalVariable* old_context =
+        top_scope->LookupVariable(Symbols::AwaitContextVar(), false);
     for (intptr_t i = 0; i < num_await_states; i++) {
-      check_jump_count = new(Z) ComparisonNode(
-          ST(node->token_pos()),
-          Token::kEQ,
-          load_jump_count,
-          new(Z) LiteralNode(
-              ST(node->token_pos()), Smi::ZoneHandle(Z, Smi::New(i))));
+      check_jump_count = new (Z)
+          ComparisonNode(ST(node->token_pos()), Token::kEQ, load_jump_count,
+                         new (Z) LiteralNode(ST(node->token_pos()),
+                                             Smi::ZoneHandle(Z, Smi::New(i))));
       TestGraphVisitor for_test(owner(), ST(node->token_pos()));
       check_jump_count->Visit(&for_test);
       EffectGraphVisitor for_true(owner());
       EffectGraphVisitor for_false(owner());
 
       // Build async jump or sync yield jump.
-      ASSERT(function.IsAsyncClosure() ||
-             function.IsAsyncGenClosure() ||
+      ASSERT(function.IsAsyncClosure() || function.IsAsyncGenClosure() ||
              function.IsSyncGenClosure());
 
       // Restore the saved continuation context, i.e. the context that was
@@ -4218,8 +3958,7 @@
     exit_ = saved_exit;
   }
 
-  if (is_open() &&
-      (num_context_variables > 0) &&
+  if (is_open() && (num_context_variables > 0) &&
       (!is_top_level_sequence || HasContextScope())) {
     UnchainContexts(1);
   }
@@ -4276,15 +4015,14 @@
   node->try_block()->Visit(&for_try);
 
   if (for_try.is_open()) {
-    JoinEntryInstr* after_try =
-        new(Z) JoinEntryInstr(owner()->AllocateBlockId(),
-                              original_handler_index);
+    JoinEntryInstr* after_try = new (Z)
+        JoinEntryInstr(owner()->AllocateBlockId(), original_handler_index);
     for_try.Goto(after_try);
     for_try.exit_ = after_try;
   }
 
   JoinEntryInstr* try_entry =
-      new(Z) JoinEntryInstr(owner()->AllocateBlockId(), try_handler_index);
+      new (Z) JoinEntryInstr(owner()->AllocateBlockId(), try_handler_index);
 
   Goto(try_entry);
   AppendFragment(try_entry, for_try);
@@ -4296,8 +4034,8 @@
   // If there is a finally block, it is the handler for code in the catch
   // block.
   const intptr_t catch_handler_index = (finally_block == NULL)
-      ? original_handler_index
-      : catch_block->catch_handler_index();
+                                           ? original_handler_index
+                                           : catch_block->catch_handler_index();
 
   const intptr_t prev_catch_try_index = owner()->catch_try_index();
 
@@ -4313,22 +4051,17 @@
   ASSERT(!catch_block->exception_var().is_captured());
   ASSERT(!catch_block->stacktrace_var().is_captured());
 
-  CatchBlockEntryInstr* catch_entry =
-      new(Z) CatchBlockEntryInstr(owner()->AllocateBlockId(),
-                                  catch_handler_index,
-                                  owner()->graph_entry(),
-                                  catch_block->handler_types(),
-                                  try_handler_index,
-                                  catch_block->exception_var(),
-                                  catch_block->stacktrace_var(),
-                                  catch_block->needs_stacktrace(),
-                                  Thread::Current()->GetNextDeoptId());
+  CatchBlockEntryInstr* catch_entry = new (Z) CatchBlockEntryInstr(
+      owner()->AllocateBlockId(), catch_handler_index, owner()->graph_entry(),
+      catch_block->handler_types(), try_handler_index,
+      catch_block->exception_var(), catch_block->stacktrace_var(),
+      catch_block->needs_stacktrace(), Thread::Current()->GetNextDeoptId());
   owner()->AddCatchEntry(catch_entry);
   AppendFragment(catch_entry, for_catch);
 
   if (for_catch.is_open()) {
-    JoinEntryInstr* join = new(Z) JoinEntryInstr(owner()->AllocateBlockId(),
-                                                 original_handler_index);
+    JoinEntryInstr* join = new (Z)
+        JoinEntryInstr(owner()->AllocateBlockId(), original_handler_index);
     for_catch.Goto(join);
     if (is_open()) Goto(join);
     exit_ = join;
@@ -4353,23 +4086,18 @@
           catch_block->rethrow_stacktrace_var(), finally_block->token_pos()));
       for_finally.PushArgument(stacktrace);
       for_finally.AddInstruction(
-          new(Z) ReThrowInstr(catch_block->token_pos(), catch_handler_index));
+          new (Z) ReThrowInstr(catch_block->token_pos(), catch_handler_index));
       for_finally.CloseFragment();
     }
     ASSERT(!for_finally.is_open());
 
     const Array& types = Array::ZoneHandle(Z, Array::New(1, Heap::kOld));
     types.SetAt(0, Object::dynamic_type());
-    CatchBlockEntryInstr* finally_entry =
-        new(Z) CatchBlockEntryInstr(owner()->AllocateBlockId(),
-                                    original_handler_index,
-                                    owner()->graph_entry(),
-                                    types,
-                                    catch_handler_index,
-                                    catch_block->exception_var(),
-                                    catch_block->stacktrace_var(),
-                                    catch_block->needs_stacktrace(),
-                                    Thread::Current()->GetNextDeoptId());
+    CatchBlockEntryInstr* finally_entry = new (Z) CatchBlockEntryInstr(
+        owner()->AllocateBlockId(), original_handler_index,
+        owner()->graph_entry(), types, catch_handler_index,
+        catch_block->exception_var(), catch_block->stacktrace_var(),
+        catch_block->needs_stacktrace(), Thread::Current()->GetNextDeoptId());
     owner()->AddCatchEntry(finally_entry);
     AppendFragment(finally_entry, for_finally);
   }
@@ -4397,39 +4125,30 @@
   if (save_last_arg) {
     temp = owner()->parsed_function().expression_temp_var();
   }
-  ArgumentListNode* args =
-      Parser::BuildNoSuchMethodArguments(args_pos,
-                                         method_name,
-                                         *method_arguments,
-                                         temp,
-                                         is_super_invocation);
+  ArgumentListNode* args = Parser::BuildNoSuchMethodArguments(
+      args_pos, method_name, *method_arguments, temp, is_super_invocation);
   // Make sure we resolve to a compatible noSuchMethod, otherwise call
   // noSuchMethod of class Object.
   const int kNumArguments = 2;
   ArgumentsDescriptor args_desc(
       Array::ZoneHandle(Z, ArgumentsDescriptor::New(kNumArguments)));
-  Function& no_such_method_func = Function::ZoneHandle(Z,
-      Resolver::ResolveDynamicForReceiverClass(target_class,
-                                               Symbols::NoSuchMethod(),
-                                               args_desc));
+  Function& no_such_method_func = Function::ZoneHandle(
+      Z, Resolver::ResolveDynamicForReceiverClass(
+             target_class, Symbols::NoSuchMethod(), args_desc));
   if (no_such_method_func.IsNull()) {
     const Class& object_class =
         Class::ZoneHandle(Z, isolate()->object_store()->object_class());
-    no_such_method_func =
-        Resolver::ResolveDynamicForReceiverClass(object_class,
-                                                 Symbols::NoSuchMethod(),
-                                                 args_desc);
+    no_such_method_func = Resolver::ResolveDynamicForReceiverClass(
+        object_class, Symbols::NoSuchMethod(), args_desc);
   }
   // We are guaranteed to find noSuchMethod of class Object.
   ASSERT(!no_such_method_func.IsNull());
   ZoneGrowableArray<PushArgumentInstr*>* push_arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>(2);
+      new (Z) ZoneGrowableArray<PushArgumentInstr*>(2);
   BuildPushArguments(*args, push_arguments);
-  return new(Z) StaticCallInstr(args_pos,
-                                no_such_method_func,
-                                Object::null_array(),
-                                push_arguments,
-                                owner()->ic_data_array());
+  return new (Z)
+      StaticCallInstr(args_pos, no_such_method_func, Object::null_array(),
+                      push_arguments, owner()->ic_data_array());
 }
 
 
@@ -4440,43 +4159,41 @@
     ArgumentListNode* function_arguments,
     int invocation_type) {
   ZoneGrowableArray<PushArgumentInstr*>* arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>();
+      new (Z) ZoneGrowableArray<PushArgumentInstr*>();
   // Object receiver, actually a class literal of the unresolved method's owner.
   AbstractType& type = Type::ZoneHandle(
       Z,
-      Type::New(function_class,
-                TypeArguments::Handle(Z, TypeArguments::null()),
-                token_pos,
-                Heap::kOld));
-  type ^= ClassFinalizer::FinalizeType(
-      function_class, type, ClassFinalizer::kCanonicalize);
-  Value* receiver_value = Bind(new(Z) ConstantInstr(type));
+      Type::New(function_class, TypeArguments::Handle(Z, TypeArguments::null()),
+                token_pos, Heap::kOld));
+  type ^= ClassFinalizer::FinalizeType(function_class, type,
+                                       ClassFinalizer::kCanonicalize);
+  Value* receiver_value = Bind(new (Z) ConstantInstr(type));
   arguments->Add(PushArgument(receiver_value));
   // String memberName.
   const String& member_name =
       String::ZoneHandle(Z, Symbols::New(T, function_name));
-  Value* member_name_value = Bind(new(Z) ConstantInstr(member_name));
+  Value* member_name_value = Bind(new (Z) ConstantInstr(member_name));
   arguments->Add(PushArgument(member_name_value));
   // Smi invocation_type.
-  Value* invocation_type_value = Bind(new(Z) ConstantInstr(
-      Smi::ZoneHandle(Z, Smi::New(invocation_type))));
+  Value* invocation_type_value = Bind(
+      new (Z) ConstantInstr(Smi::ZoneHandle(Z, Smi::New(invocation_type))));
   arguments->Add(PushArgument(invocation_type_value));
   // List arguments.
   if (function_arguments == NULL) {
-    Value* arguments_value = Bind(
-        new(Z) ConstantInstr(Array::ZoneHandle(Z, Array::null())));
+    Value* arguments_value =
+        Bind(new (Z) ConstantInstr(Array::ZoneHandle(Z, Array::null())));
     arguments->Add(PushArgument(arguments_value));
   } else {
     ValueGraphVisitor array_val(owner());
     ArrayNode* array =
-        new(Z) ArrayNode(token_pos, Type::ZoneHandle(Z, Type::ArrayType()),
-                      function_arguments->nodes());
+        new (Z) ArrayNode(token_pos, Type::ZoneHandle(Z, Type::ArrayType()),
+                          function_arguments->nodes());
     array->Visit(&array_val);
     Append(array_val);
     arguments->Add(PushArgument(array_val.value()));
   }
   // List argumentNames.
-  ConstantInstr* cinstr = new(Z) ConstantInstr(
+  ConstantInstr* cinstr = new (Z) ConstantInstr(
       (function_arguments == NULL) ? Array::ZoneHandle(Z, Array::null())
                                    : function_arguments->names());
   Value* argument_names_value = Bind(cinstr);
@@ -4484,25 +4201,21 @@
 
   // List existingArgumentNames.
   Value* existing_argument_names_value =
-      Bind(new(Z) ConstantInstr(Array::ZoneHandle(Z, Array::null())));
+      Bind(new (Z) ConstantInstr(Array::ZoneHandle(Z, Array::null())));
   arguments->Add(PushArgument(existing_argument_names_value));
   // Resolve and call NoSuchMethodError._throwNew.
   const Library& core_lib = Library::Handle(Z, Library::CoreLibrary());
-  const Class& cls = Class::Handle(
-      Z, core_lib.LookupClass(Symbols::NoSuchMethodError()));
+  const Class& cls =
+      Class::Handle(Z, core_lib.LookupClass(Symbols::NoSuchMethodError()));
   ASSERT(!cls.IsNull());
   const Function& func = Function::ZoneHandle(
-      Z,
-      Resolver::ResolveStatic(cls,
-                              Library::PrivateCoreLibName(Symbols::ThrowNew()),
-                              arguments->length(),
-                              Object::null_array()));
+      Z, Resolver::ResolveStatic(
+             cls, Library::PrivateCoreLibName(Symbols::ThrowNew()),
+             arguments->length(), Object::null_array()));
   ASSERT(!func.IsNull());
-  return new(Z) StaticCallInstr(token_pos,
-                                func,
-                                Object::null_array(),  // No names.
-                                arguments,
-                                owner()->ic_data_array());
+  return new (Z) StaticCallInstr(token_pos, func,
+                                 Object::null_array(),  // No names.
+                                 arguments, owner()->ic_data_array());
 }
 
 
@@ -4511,7 +4224,7 @@
     if (node->exception()->IsLiteralNode() ||
         node->exception()->IsLoadLocalNode() ||
         node->exception()->IsClosureNode()) {
-      AddInstruction(new(Z) DebugStepCheckInstr(
+      AddInstruction(new (Z) DebugStepCheckInstr(
           node->token_pos(), RawPcDescriptors::kRuntimeCall));
     }
   }
@@ -4521,13 +4234,13 @@
   PushArgument(for_exception.value());
   Instruction* instr = NULL;
   if (node->stacktrace() == NULL) {
-    instr = new(Z) ThrowInstr(node->token_pos());
+    instr = new (Z) ThrowInstr(node->token_pos());
   } else {
     ValueGraphVisitor for_stack_trace(owner());
     node->stacktrace()->Visit(&for_stack_trace);
     Append(for_stack_trace);
     PushArgument(for_stack_trace.value());
-    instr = new(Z) ReThrowInstr(node->token_pos(), owner()->catch_try_index());
+    instr = new (Z) ReThrowInstr(node->token_pos(), owner()->catch_try_index());
   }
   AddInstruction(instr);
 }
@@ -4544,8 +4257,8 @@
 // so that the fragment is not closed in the middle of an expression.
 void ValueGraphVisitor::VisitThrowNode(ThrowNode* node) {
   BuildThrowNode(node);
-  ReturnDefinition(new(Z) ConstantInstr(
-      Instance::ZoneHandle(Z, Instance::null())));
+  ReturnDefinition(
+      new (Z) ConstantInstr(Instance::ZoneHandle(Z, Instance::null())));
 }
 
 
@@ -4567,7 +4280,7 @@
   // context variable.
 
   JoinEntryInstr* finally_entry =
-      new(Z) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
+      new (Z) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
   EffectGraphVisitor for_finally_block(owner());
   for_finally_block.AdjustContextLevel(node->finally_block()->scope());
   node->finally_block()->Visit(&for_finally_block);
@@ -4577,8 +4290,8 @@
   }
 
   if (for_finally_block.is_open()) {
-    JoinEntryInstr* after_finally =
-        new(Z) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
+    JoinEntryInstr* after_finally = new (Z)
+        JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
     for_finally_block.Goto(after_finally);
     for_finally_block.exit_ = after_finally;
   }
@@ -4590,13 +4303,12 @@
 
 
 void EffectGraphVisitor::VisitStopNode(StopNode* node) {
-  AddInstruction(new(Z) StopInstr(node->message()));
+  AddInstruction(new (Z) StopInstr(node->message()));
 }
 
 
 FlowGraph* FlowGraphBuilder::BuildGraph() {
-  VMTagScope tagScope(thread(),
-                      VMTag::kCompileFlowGraphBuilderTagId,
+  VMTagScope tagScope(thread(), VMTag::kCompileFlowGraphBuilderTagId,
                       FLAG_profile_vm);
   if (FLAG_support_ast_printer && FLAG_print_ast) {
     // Print the function ast before IL generation.
@@ -4607,11 +4319,10 @@
     AstPrinter ast_printer;
     ast_printer.PrintFunctionScope(parsed_function());
   }
-  TargetEntryInstr* normal_entry =
-      new(Z) TargetEntryInstr(AllocateBlockId(),
-                              CatchClauseNode::kInvalidTryIndex);
+  TargetEntryInstr* normal_entry = new (Z)
+      TargetEntryInstr(AllocateBlockId(), CatchClauseNode::kInvalidTryIndex);
   graph_entry_ =
-      new(Z) GraphEntryInstr(parsed_function(), normal_entry, osr_id_);
+      new (Z) GraphEntryInstr(parsed_function(), normal_entry, osr_id_);
   EffectGraphVisitor for_effect(this);
   parsed_function().node_sequence()->Visit(&for_effect);
   AppendFragment(normal_entry, for_effect);
@@ -4626,16 +4337,16 @@
   }
 
   FlowGraph* graph =
-      new(Z) FlowGraph(parsed_function(), graph_entry_, last_used_block_id_);
+      new (Z) FlowGraph(parsed_function(), graph_entry_, last_used_block_id_);
   return graph;
 }
 
 
 void FlowGraphBuilder::PruneUnreachable() {
   ASSERT(osr_id_ != Compiler::kNoOSRDeoptId);
-  BitVector* block_marks = new(Z) BitVector(Z, last_used_block_id_ + 1);
-  bool found = graph_entry_->PruneUnreachable(this, graph_entry_, NULL, osr_id_,
-                                              block_marks);
+  BitVector* block_marks = new (Z) BitVector(Z, last_used_block_id_ + 1);
+  bool found =
+      graph_entry_->PruneUnreachable(graph_entry_, NULL, osr_id_, block_marks);
   ASSERT(found);
 }
 
diff --git a/runtime/vm/flow_graph_builder.h b/runtime/vm/flow_graph_builder.h
index 870773b..8db4aae 100644
--- a/runtime/vm/flow_graph_builder.h
+++ b/runtime/vm/flow_graph_builder.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_FLOW_GRAPH_BUILDER_H_
-#define VM_FLOW_GRAPH_BUILDER_H_
+#ifndef RUNTIME_VM_FLOW_GRAPH_BUILDER_H_
+#define RUNTIME_VM_FLOW_GRAPH_BUILDER_H_
 
 #include "platform/assert.h"
 #include "platform/globals.h"
@@ -30,10 +30,10 @@
 
 // A class to collect the exits from an inlined function during graph
 // construction so they can be plugged into the caller's flow graph.
-class InlineExitCollector: public ZoneAllocated {
+class InlineExitCollector : public ZoneAllocated {
  public:
   InlineExitCollector(FlowGraph* caller_graph, Definition* call)
-      : caller_graph_(caller_graph), call_(call), exits_(4) { }
+      : caller_graph_(caller_graph), call_(call), exits_(4) {}
 
   void AddExit(ReturnInstr* exit);
 
@@ -70,13 +70,9 @@
     return ReturnAt(i)->previous();
   }
 
-  Value* ValueAt(intptr_t i) const {
-    return ReturnAt(i)->value();
-  }
+  Value* ValueAt(intptr_t i) const { return ReturnAt(i)->value(); }
 
-  ReturnInstr* ReturnAt(intptr_t i) const {
-    return exits_[i].exit_return;
-  }
+  ReturnInstr* ReturnAt(intptr_t i) const { return exits_[i].exit_return; }
 
   static int LowestBlockIdFirst(const Data* a, const Data* b);
   void SortExits();
@@ -140,19 +136,11 @@
 
   void AddCatchEntry(CatchBlockEntryInstr* entry);
 
-  GraphEntryInstr* graph_entry() const {
-    return graph_entry_;
-  }
+  GraphEntryInstr* graph_entry() const { return graph_entry_; }
 
-  intptr_t num_copied_params() const {
-    return num_copied_params_;
-  }
-  intptr_t num_non_copied_params() const {
-    return num_non_copied_params_;
-  }
-  intptr_t num_stack_locals() const {
-    return num_stack_locals_;
-  }
+  intptr_t num_copied_params() const { return num_copied_params_; }
+  intptr_t num_non_copied_params() const { return num_non_copied_params_; }
+  intptr_t num_stack_locals() const { return num_stack_locals_; }
 
   bool IsInlining() const { return (exit_collector_ != NULL); }
   InlineExitCollector* exit_collector() const { return exit_collector_; }
@@ -241,9 +229,7 @@
 class EffectGraphVisitor : public AstNodeVisitor {
  public:
   explicit EffectGraphVisitor(FlowGraphBuilder* owner)
-      : owner_(owner),
-        entry_(NULL),
-        exit_(NULL) { }
+      : owner_(owner), entry_(NULL), exit_(NULL) {}
 
 #define DECLARE_VISIT(BaseName)                                                \
   virtual void Visit##BaseName##Node(BaseName##Node* node);
@@ -309,19 +295,16 @@
                               TokenPosition token_pos);
   Definition* BuildLoadLocal(const LocalVariable& local,
                              TokenPosition token_pos);
-  LoadLocalInstr* BuildLoadThisVar(LocalScope* scope,
-                                   TokenPosition token_pos);
-  LoadFieldInstr* BuildNativeGetter(
-      NativeBodyNode* node,
-      MethodRecognizer::Kind kind,
-      intptr_t offset,
-      const Type& type,
-      intptr_t class_id);
+  LoadLocalInstr* BuildLoadThisVar(LocalScope* scope, TokenPosition token_pos);
+  LoadFieldInstr* BuildNativeGetter(NativeBodyNode* node,
+                                    MethodRecognizer::Kind kind,
+                                    intptr_t offset,
+                                    const Type& type,
+                                    intptr_t class_id);
   // Assumes setter parameter is named 'value'. Returns null constant.
-  ConstantInstr* DoNativeSetterStoreValue(
-      NativeBodyNode* node,
-      intptr_t offset,
-      StoreBarrierType emit_store_barrier);
+  ConstantInstr* DoNativeSetterStoreValue(NativeBodyNode* node,
+                                          intptr_t offset,
+                                          StoreBarrierType emit_store_barrier);
 
   // Helpers for translating parts of the AST.
   void BuildPushArguments(const ArgumentListNode& node,
@@ -330,9 +313,8 @@
   // Creates an instantiated type argument vector used in preparation of an
   // allocation call.
   // May be called only if allocating an object of a parameterized class.
-  Value* BuildInstantiatedTypeArguments(
-      TokenPosition token_pos,
-      const TypeArguments& type_arguments);
+  Value* BuildInstantiatedTypeArguments(TokenPosition token_pos,
+                                        const TypeArguments& type_arguments);
 
   void BuildTypecheckPushArguments(
       TokenPosition token_pos,
@@ -394,8 +376,7 @@
   void BuildConstructorCall(ConstructorCallNode* node,
                             PushArgumentInstr* alloc_value);
 
-  void BuildSaveContext(const LocalVariable& variable,
-                        TokenPosition token_pos);
+  void BuildSaveContext(const LocalVariable& variable, TokenPosition token_pos);
   void BuildRestoreContext(const LocalVariable& variable,
                            TokenPosition token_pos);
 
@@ -452,9 +433,7 @@
   friend class TempLocalScope;  // For ReturnDefinition.
 
   // Helper to drop the result value.
-  virtual void ReturnValue(Value* value) {
-    Do(new DropTempsInstr(0, value));
-  }
+  virtual void ReturnValue(Value* value) { Do(new DropTempsInstr(0, value)); }
 
   // Specify a definition of the final result.  Adds the definition to
   // the graph, but normally overridden in subclasses.
@@ -483,7 +462,7 @@
 class ValueGraphVisitor : public EffectGraphVisitor {
  public:
   explicit ValueGraphVisitor(FlowGraphBuilder* owner)
-      : EffectGraphVisitor(owner), value_(NULL) { }
+      : EffectGraphVisitor(owner), value_(NULL) {}
 
   // Visit functions overridden by this class.
   virtual void VisitAssignableNode(AssignableNode* node);
@@ -540,12 +519,11 @@
 // condition of the test is of type bool.
 class TestGraphVisitor : public ValueGraphVisitor {
  public:
-  TestGraphVisitor(FlowGraphBuilder* owner,
-                   TokenPosition condition_token_pos)
+  TestGraphVisitor(FlowGraphBuilder* owner, TokenPosition condition_token_pos)
       : ValueGraphVisitor(owner),
         true_successor_addresses_(1),
         false_successor_addresses_(1),
-        condition_token_pos_(condition_token_pos) { }
+        condition_token_pos_(condition_token_pos) {}
 
   void IfFalseGoto(JoinEntryInstr* join) const;
   void IfTrueGoto(JoinEntryInstr* join) const;
@@ -570,11 +548,10 @@
   void MergeBranchWithNegate(BooleanNegateInstr* comp);
 
   BlockEntryInstr* CreateSuccessorFor(
-    const GrowableArray<TargetEntryInstr**>& branches) const;
+      const GrowableArray<TargetEntryInstr**>& branches) const;
 
-  void ConnectBranchesTo(
-    const GrowableArray<TargetEntryInstr**>& branches,
-    JoinEntryInstr* join) const;
+  void ConnectBranchesTo(const GrowableArray<TargetEntryInstr**>& branches,
+                         JoinEntryInstr* join) const;
 
   // Output parameters.
   GrowableArray<TargetEntryInstr**> true_successor_addresses_;
@@ -585,4 +562,4 @@
 
 }  // namespace dart
 
-#endif  // VM_FLOW_GRAPH_BUILDER_H_
+#endif  // RUNTIME_VM_FLOW_GRAPH_BUILDER_H_
diff --git a/runtime/vm/flow_graph_builder_test.cc b/runtime/vm/flow_graph_builder_test.cc
index 10f93cb..9de7a0c 100644
--- a/runtime/vm/flow_graph_builder_test.cc
+++ b/runtime/vm/flow_graph_builder_test.cc
@@ -24,8 +24,7 @@
 
 class SourcePositionTest : public ValueObject {
  public:
-  SourcePositionTest(Thread* thread,
-                     const char* script)
+  SourcePositionTest(Thread* thread, const char* script)
       : thread_(thread),
         isolate_(thread->isolate()),
         script_(script),
@@ -40,8 +39,8 @@
     EXPECT_VALID(lib);
     root_lib_ ^= Api::UnwrapHandle(lib);
     EXPECT(!root_lib_.IsNull());
-    root_script_ ^= root_lib_.LookupScript(
-        String::Handle(String::New(USER_TEST_URI)));
+    root_script_ ^=
+        root_lib_.LookupScript(String::Handle(String::New(USER_TEST_URI)));
     EXPECT(!root_script_.IsNull());
   }
 
@@ -57,15 +56,12 @@
         Function::Handle(GetFunction(root_lib_, function_name));
     ZoneGrowableArray<const ICData*>* ic_data_array =
         new ZoneGrowableArray<const ICData*>();
-    ParsedFunction* parsed_function = new ParsedFunction(
-        thread_, Function::ZoneHandle(function.raw()));
+    ParsedFunction* parsed_function =
+        new ParsedFunction(thread_, Function::ZoneHandle(function.raw()));
     Parser::ParseFunction(parsed_function);
     parsed_function->AllocateVariables();
-    FlowGraphBuilder builder(
-        *parsed_function,
-        *ic_data_array,
-        NULL,
-        Compiler::kNoOSRDeoptId);
+    FlowGraphBuilder builder(*parsed_function, *ic_data_array, NULL,
+                             Compiler::kNoOSRDeoptId);
     graph_ = builder.BuildGraph();
     EXPECT(graph_ != NULL);
     blocks_ = graph_->CodegenBlockOrder(optimized);
@@ -98,9 +94,7 @@
   }
 
   // Expect to find an instance call at |line| and |column|.
-  void InstanceCallAt(const char* needle,
-                      intptr_t line,
-                      intptr_t column = -1) {
+  void InstanceCallAt(const char* needle, intptr_t line, intptr_t column = -1) {
     ZoneGrowableArray<Instruction*>* instructions =
         FindInstructionsAt(line, column);
     intptr_t count = 0;
@@ -119,9 +113,7 @@
 
   // Expect to find at least one static call at |line| and |column|. The
   // static call will have |needle| in its |ToCString| representation.
-  void StaticCallAt(const char* needle,
-                    intptr_t line,
-                    intptr_t column = -1) {
+  void StaticCallAt(const char* needle, intptr_t line, intptr_t column = -1) {
     ZoneGrowableArray<Instruction*>* instructions =
         FindInstructionsAt(line, column);
     intptr_t count = 0;
@@ -196,20 +188,13 @@
     }
     intptr_t token_line = -1;
     intptr_t token_column = -1;
-    root_script_.GetTokenLocation(token_pos,
-                                  &token_line,
-                                  &token_column,
-                                  NULL);
+    root_script_.GetTokenLocation(token_pos, &token_line, &token_column, NULL);
     if (synthetic) {
-      THR_Print("      *%02d:%02d -- %s\n",
-                static_cast<int>(token_line),
-                static_cast<int>(token_column),
-                instr->ToCString());
+      THR_Print("      *%02d:%02d -- %s\n", static_cast<int>(token_line),
+                static_cast<int>(token_column), instr->ToCString());
     } else {
-      THR_Print("       %02d:%02d -- %s\n",
-                static_cast<int>(token_line),
-                static_cast<int>(token_column),
-                instr->ToCString());
+      THR_Print("       %02d:%02d -- %s\n", static_cast<int>(token_line),
+                static_cast<int>(token_column), instr->ToCString());
     }
   }
 
@@ -222,8 +207,8 @@
     return instructions->At(0);
   }
 
-  ZoneGrowableArray<Instruction*>* FindInstructionsAt(
-      intptr_t line, intptr_t column) {
+  ZoneGrowableArray<Instruction*>* FindInstructionsAt(intptr_t line,
+                                                      intptr_t column) {
     ZoneGrowableArray<Instruction*>* instructions =
         new ZoneGrowableArray<Instruction*>();
     for (intptr_t i = 0; i < blocks_->length(); i++) {
@@ -239,9 +224,7 @@
         }
         intptr_t token_line = -1;
         intptr_t token_column = -1;
-        root_script_.GetTokenLocation(token_pos,
-                                      &token_line,
-                                      &token_column,
+        root_script_.GetTokenLocation(token_pos, &token_line, &token_column,
                                       NULL);
         if (token_line == line) {
           if ((column < 0) || (column == token_column)) {
@@ -269,15 +252,15 @@
   }
 
   RawFunction* GetFunction(const Library& lib, const char* name) {
-    const Function& result = Function::Handle(lib.LookupFunctionAllowPrivate(
-        String::Handle(String::New(name))));
+    const Function& result = Function::Handle(
+        lib.LookupFunctionAllowPrivate(String::Handle(String::New(name))));
     EXPECT(!result.IsNull());
     return result.raw();
   }
 
   RawFunction* GetFunction(const Class& cls, const char* name) {
-    const Function& result = Function::Handle(cls.LookupFunctionAllowPrivate(
-        String::Handle(String::New(name))));
+    const Function& result = Function::Handle(
+        cls.LookupFunctionAllowPrivate(String::Handle(String::New(name))));
     EXPECT(!result.IsNull());
     return result.raw();
   }
@@ -656,22 +639,22 @@
   spt.FuzzyInstructionMatchAt("StoreLocal(:switch_expr", 4, 11);
 
   spt.FuzzyInstructionMatchAt("Constant(#1", 5, 10);
-  spt.FuzzyInstructionMatchAt("LoadLocal(:switch_expr", 5, 5);   // 'c'
-  spt.InstanceCallAt(5, 10, Token::kEQ);                         // '1'
+  spt.FuzzyInstructionMatchAt("LoadLocal(:switch_expr", 5, 5);  // 'c'
+  spt.InstanceCallAt(5, 10, Token::kEQ);                        // '1'
 
-  spt.FuzzyInstructionMatchAt("Constant(#3", 5, 20);             // '3'
+  spt.FuzzyInstructionMatchAt("Constant(#3", 5, 20);  // '3'
   spt.FuzzyInstructionMatchAt("DebugStepCheck", 5, 13);
   spt.FuzzyInstructionMatchAt("Return", 5, 13);
 
   spt.FuzzyInstructionMatchAt("Constant(#2", 6, 10);
-  spt.FuzzyInstructionMatchAt("LoadLocal(:switch_expr", 6, 5);   // 'c'
-  spt.InstanceCallAt(6, 10, Token::kEQ);                         // '2'
+  spt.FuzzyInstructionMatchAt("LoadLocal(:switch_expr", 6, 5);  // 'c'
+  spt.InstanceCallAt(6, 10, Token::kEQ);                        // '2'
 
-  spt.FuzzyInstructionMatchAt("Constant(#4", 6, 20);             // '4'
+  spt.FuzzyInstructionMatchAt("Constant(#4", 6, 20);  // '4'
   spt.FuzzyInstructionMatchAt("DebugStepCheck", 6, 13);
   spt.FuzzyInstructionMatchAt("Return", 6, 13);
 
-  spt.FuzzyInstructionMatchAt("Constant(#5", 7, 21);             // '5'
+  spt.FuzzyInstructionMatchAt("Constant(#5", 7, 21);  // '5'
   spt.FuzzyInstructionMatchAt("DebugStepCheck", 7, 14);
   spt.FuzzyInstructionMatchAt("Return", 7, 14);
 
@@ -700,32 +683,32 @@
   spt.FuzzyInstructionMatchAt("DebugStepCheck", 3, 5);
   spt.FuzzyInstructionMatchAt("CheckStackOverflow", 3, 5);
 
-  spt.FuzzyInstructionMatchAt("LoadLocal(:current_context", 4, 3);     // 't'
+  spt.FuzzyInstructionMatchAt("LoadLocal(:current_context", 4, 3);  // 't'
   spt.FuzzyInstructionMatchAt("StoreLocal(:saved_try_context", 4, 3);
 
-  spt.FuzzyInstructionMatchAt("Constant(#A", 5, 11);                   // 'A'
-  spt.FuzzyInstructionMatchAt("Throw", 5, 5);                          // 't'
+  spt.FuzzyInstructionMatchAt("Constant(#A", 5, 11);  // 'A'
+  spt.FuzzyInstructionMatchAt("Throw", 5, 5);         // 't'
 
-  spt.FuzzyInstructionMatchAt("LoadLocal(:saved_try_context", 6, 5);   // 'c'
-  spt.FuzzyInstructionMatchAt("StoreLocal(:current_context", 6, 5);    // 'c'
-  spt.FuzzyInstructionMatchAt("LoadLocal(:exception_var", 6, 5);       // 'c'
-  spt.FuzzyInstructionMatchAt("StoreLocal(e", 6, 5);                   // 'c'
+  spt.FuzzyInstructionMatchAt("LoadLocal(:saved_try_context", 6, 5);  // 'c'
+  spt.FuzzyInstructionMatchAt("StoreLocal(:current_context", 6, 5);   // 'c'
+  spt.FuzzyInstructionMatchAt("LoadLocal(:exception_var", 6, 5);      // 'c'
+  spt.FuzzyInstructionMatchAt("StoreLocal(e", 6, 5);                  // 'c'
 
-  spt.FuzzyInstructionMatchAt("LoadLocal(e", 7, 11);                   // 'e'
+  spt.FuzzyInstructionMatchAt("LoadLocal(e", 7, 11);  // 'e'
 
-  spt.FuzzyInstructionMatchAt("StaticCall", 7, 5);                     // 'p'
+  spt.FuzzyInstructionMatchAt("StaticCall", 7, 5);  // 'p'
 
-  spt.FuzzyInstructionMatchAt("Constant(#77", 8, 12);                  // '7'
-  spt.FuzzyInstructionMatchAt("StoreLocal(:finally_ret_val", 8, 5);    // 'r'
+  spt.FuzzyInstructionMatchAt("Constant(#77", 8, 12);                // '7'
+  spt.FuzzyInstructionMatchAt("StoreLocal(:finally_ret_val", 8, 5);  // 'r'
 
-  spt.FuzzyInstructionMatchAt("Constant(#99", 10, 12);                 // '9'
-  spt.FuzzyInstructionMatchAt("Return", 10, 5);                        // 'r'
+  spt.FuzzyInstructionMatchAt("Constant(#99", 10, 12);  // '9'
+  spt.FuzzyInstructionMatchAt("Return", 10, 5);         // 'r'
 
   spt.FuzzyInstructionMatchAt("LoadLocal(:saved_try_context", 9, 13);  // '{'
   spt.FuzzyInstructionMatchAt("StoreLocal(:current_context", 9, 13);   // '{'
 
-  spt.FuzzyInstructionMatchAt("Constant(#99", 10, 12);                 // '9'
-  spt.FuzzyInstructionMatchAt("Return", 10, 5);                        // 'r'
+  spt.FuzzyInstructionMatchAt("Constant(#99", 10, 12);  // '9'
+  spt.FuzzyInstructionMatchAt("Return", 10, 5);         // 'r'
 
   spt.EnsureSourcePositions();
 }
@@ -746,14 +729,14 @@
 
   SourcePositionTest spt(thread, kScript);
   spt.BuildGraphFor("main");
-  spt.FuzzyInstructionMatchAt("AllocateObject(A)", 6, 15);       // 'A'
-  spt.FuzzyInstructionMatchAt("StaticCall", 6, 15);              // 'A'
-  spt.FuzzyInstructionMatchAt("StoreLocal(z", 6, 9);             // '='
-  spt.InstanceCallAt("set:x", 7, 5);                             // 'x'
-  spt.InstanceCallAt("get:x", 8, 11);                            // 'x'
-  spt.InstanceCallAt("set:y", 8, 5);                             // 'y'
+  spt.FuzzyInstructionMatchAt("AllocateObject(A)", 6, 15);  // 'A'
+  spt.FuzzyInstructionMatchAt("StaticCall", 6, 15);         // 'A'
+  spt.FuzzyInstructionMatchAt("StoreLocal(z", 6, 9);        // '='
+  spt.InstanceCallAt("set:x", 7, 5);                        // 'x'
+  spt.InstanceCallAt("get:x", 8, 11);                       // 'x'
+  spt.InstanceCallAt("set:y", 8, 5);                        // 'y'
 
-  spt.InstanceCallAt("get:y", 9, 12);                            // 'y'
+  spt.InstanceCallAt("get:y", 9, 12);  // 'y'
   spt.FuzzyInstructionMatchAt("DebugStepCheck", 9, 3);
   spt.FuzzyInstructionMatchAt("Return", 9, 3);
 
@@ -808,4 +791,3 @@
 }
 
 }  // namespace dart
-
diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc
index 46a54562..c6b6663 100644
--- a/runtime/vm/flow_graph_compiler.cc
+++ b/runtime/vm/flow_graph_compiler.cc
@@ -30,19 +30,33 @@
 
 namespace dart {
 
-DEFINE_FLAG(bool, enable_simd_inline, true,
-    "Enable inlining of SIMD related method calls.");
-DEFINE_FLAG(bool, inline_smi_string_hashcode, true,
+DEFINE_FLAG(bool,
+            enable_simd_inline,
+            true,
+            "Enable inlining of SIMD related method calls.");
+DEFINE_FLAG(
+    bool,
+    inline_smi_string_hashcode,
+    true,
     "Inline hashcode for Smi and one-byte strings in case of megamorphic call");
-DEFINE_FLAG(int, inline_smi_string_hashcode_ratio, 50,
+DEFINE_FLAG(
+    int,
+    inline_smi_string_hashcode_ratio,
+    50,
     "Minimal hotness (0..100) of one-byte-string before inlining its hashcode");
-DEFINE_FLAG(int, min_optimization_counter_threshold, 5000,
-    "The minimum invocation count for a function.");
-DEFINE_FLAG(int, optimization_counter_scale, 2000,
-    "The scale of invocation count, by size of the function.");
+DEFINE_FLAG(int,
+            min_optimization_counter_threshold,
+            5000,
+            "The minimum invocation count for a function.");
+DEFINE_FLAG(int,
+            optimization_counter_scale,
+            2000,
+            "The scale of invocation count, by size of the function.");
 DEFINE_FLAG(bool, source_lines, false, "Emit source line as assembly comment.");
-DEFINE_FLAG(bool, trace_inlining_intervals, false,
-    "Inlining interval diagnostics");
+DEFINE_FLAG(bool,
+            trace_inlining_intervals,
+            false,
+            "Inlining interval diagnostics");
 
 DECLARE_FLAG(bool, code_comments);
 DECLARE_FLAG(charp, deoptimize_filter);
@@ -70,6 +84,7 @@
     FATAL("Precompilation not supported on IA32");
 #endif
 
+#if !defined(DART_PRECOMPILED_RUNTIME)
     // Flags affecting compilation only:
     // There is no counter feedback in precompilation, so ignore the counter
     // when making inlining decisions.
@@ -79,10 +94,11 @@
     FLAG_inlining_size_threshold = 5;
     FLAG_inline_getters_setters_smaller_than = 5;
     FLAG_inlining_callee_size_threshold = 20;
-    FLAG_inlining_depth_threshold = 2;
+    FLAG_inlining_depth_threshold = 4;
     FLAG_inlining_caller_size_threshold = 1000;
     FLAG_inlining_constant_arguments_max_size_threshold = 100;
     FLAG_inlining_constant_arguments_min_size_threshold = 30;
+#endif
 
     FLAG_background_compilation = false;
     FLAG_fields_may_be_reset = true;
@@ -164,7 +180,7 @@
 // TODO(srdjan): Add check and code if Smi class is hot.
 bool FlowGraphCompiler::ShouldInlineSmiStringHashCode(const ICData& ic_data) {
   if (!FLAG_inline_smi_string_hashcode ||
-     (ic_data.target_name() != Symbols::hashCode().raw())) {
+      (ic_data.target_name() != Symbols::hashCode().raw())) {
     return false;
   }
   // Precompiled code has no ICData, optimistically inline it.
@@ -192,59 +208,55 @@
     const GrowableArray<const Function*>& inline_id_to_function,
     const GrowableArray<TokenPosition>& inline_id_to_token_pos,
     const GrowableArray<intptr_t>& caller_inline_id)
-      : thread_(Thread::Current()),
-        zone_(Thread::Current()->zone()),
-        assembler_(assembler),
-        parsed_function_(parsed_function),
-        flow_graph_(*flow_graph),
-        block_order_(*flow_graph->CodegenBlockOrder(is_optimizing)),
-        current_block_(NULL),
-        exception_handlers_list_(NULL),
-        pc_descriptors_list_(NULL),
-        stackmap_table_builder_(NULL),
-        code_source_map_builder_(NULL),
-        saved_code_size_(0),
-        block_info_(block_order_.length()),
-        deopt_infos_(),
-        static_calls_target_table_(),
-        is_optimizing_(is_optimizing),
-        may_reoptimize_(false),
-        intrinsic_mode_(false),
-        double_class_(Class::ZoneHandle(
-            isolate()->object_store()->double_class())),
-        mint_class_(Class::ZoneHandle(
-            isolate()->object_store()->mint_class())),
-        float32x4_class_(Class::ZoneHandle(
-            isolate()->object_store()->float32x4_class())),
-        float64x2_class_(Class::ZoneHandle(
-            isolate()->object_store()->float64x2_class())),
-        int32x4_class_(Class::ZoneHandle(
-            isolate()->object_store()->int32x4_class())),
-        list_class_(Class::ZoneHandle(
-            Library::Handle(Library::CoreLibrary()).
-                LookupClass(Symbols::List()))),
-        parallel_move_resolver_(this),
-        pending_deoptimization_env_(NULL),
-        lazy_deopt_return_pc_offset_(Code::kInvalidPc),
-        lazy_deopt_throw_pc_offset_(Code::kInvalidPc),
-        deopt_id_to_ic_data_(NULL),
-        edge_counters_array_(Array::ZoneHandle()),
-        inlined_code_intervals_(Array::ZoneHandle(Object::empty_array().raw())),
-        inline_id_to_function_(inline_id_to_function),
-        inline_id_to_token_pos_(inline_id_to_token_pos),
-        caller_inline_id_(caller_inline_id) {
+    : thread_(Thread::Current()),
+      zone_(Thread::Current()->zone()),
+      assembler_(assembler),
+      parsed_function_(parsed_function),
+      flow_graph_(*flow_graph),
+      block_order_(*flow_graph->CodegenBlockOrder(is_optimizing)),
+      current_block_(NULL),
+      exception_handlers_list_(NULL),
+      pc_descriptors_list_(NULL),
+      stackmap_table_builder_(NULL),
+      code_source_map_builder_(NULL),
+      saved_code_size_(0),
+      block_info_(block_order_.length()),
+      deopt_infos_(),
+      static_calls_target_table_(),
+      is_optimizing_(is_optimizing),
+      may_reoptimize_(false),
+      intrinsic_mode_(false),
+      double_class_(
+          Class::ZoneHandle(isolate()->object_store()->double_class())),
+      mint_class_(Class::ZoneHandle(isolate()->object_store()->mint_class())),
+      float32x4_class_(
+          Class::ZoneHandle(isolate()->object_store()->float32x4_class())),
+      float64x2_class_(
+          Class::ZoneHandle(isolate()->object_store()->float64x2_class())),
+      int32x4_class_(
+          Class::ZoneHandle(isolate()->object_store()->int32x4_class())),
+      list_class_(Class::ZoneHandle(Library::Handle(Library::CoreLibrary())
+                                        .LookupClass(Symbols::List()))),
+      parallel_move_resolver_(this),
+      pending_deoptimization_env_(NULL),
+      deopt_id_to_ic_data_(NULL),
+      edge_counters_array_(Array::ZoneHandle()),
+      inlined_code_intervals_(Array::ZoneHandle(Object::empty_array().raw())),
+      inline_id_to_function_(inline_id_to_function),
+      inline_id_to_token_pos_(inline_id_to_token_pos),
+      caller_inline_id_(caller_inline_id) {
   ASSERT(flow_graph->parsed_function().function().raw() ==
          parsed_function.function().raw());
   if (!is_optimizing) {
     const intptr_t len = thread()->deopt_id();
-    deopt_id_to_ic_data_ = new(zone()) ZoneGrowableArray<const ICData*>(len);
+    deopt_id_to_ic_data_ = new (zone()) ZoneGrowableArray<const ICData*>(len);
     deopt_id_to_ic_data_->SetLength(len);
     for (intptr_t i = 0; i < len; i++) {
       (*deopt_id_to_ic_data_)[i] = NULL;
     }
     // TODO(fschneider): Abstract iteration into ICDataArrayIterator.
-    const Array& old_saved_ic_data = Array::Handle(zone(),
-        flow_graph->function().ic_data_array());
+    const Array& old_saved_ic_data =
+        Array::Handle(zone(), flow_graph->function().ic_data_array());
     const intptr_t saved_len =
         old_saved_ic_data.IsNull() ? 0 : old_saved_ic_data.Length();
     for (intptr_t i = 1; i < saved_len; i++) {
@@ -259,16 +271,12 @@
 
 
 bool FlowGraphCompiler::IsUnboxedField(const Field& field) {
-  bool valid_class = (SupportsUnboxedDoubles() &&
-                      (field.guarded_cid() == kDoubleCid)) ||
-                     (SupportsUnboxedSimd128() &&
-                      (field.guarded_cid() == kFloat32x4Cid)) ||
-                     (SupportsUnboxedSimd128() &&
-                      (field.guarded_cid() == kFloat64x2Cid));
-  return field.is_unboxing_candidate()
-      && !field.is_final()
-      && !field.is_nullable()
-      && valid_class;
+  bool valid_class =
+      (SupportsUnboxedDoubles() && (field.guarded_cid() == kDoubleCid)) ||
+      (SupportsUnboxedSimd128() && (field.guarded_cid() == kFloat32x4Cid)) ||
+      (SupportsUnboxedSimd128() && (field.guarded_cid() == kFloat64x2Cid));
+  return field.is_unboxing_candidate() && !field.is_final() &&
+         !field.is_nullable() && valid_class;
 }
 
 
@@ -280,8 +288,8 @@
 
 
 void FlowGraphCompiler::InitCompiler() {
-  pc_descriptors_list_ = new(zone()) DescriptorList(64);
-  exception_handlers_list_ = new(zone()) ExceptionHandlerList();
+  pc_descriptors_list_ = new (zone()) DescriptorList(64);
+  exception_handlers_list_ = new (zone()) ExceptionHandlerList();
   block_info_.Clear();
   // Conservative detection of leaf routines used to remove the stack check
   // on function entry.
@@ -290,7 +298,7 @@
   // indicating a non-leaf routine and calls without IC data indicating
   // possible reoptimization.
   for (int i = 0; i < block_order_.length(); ++i) {
-    block_info_.Add(new(zone()) BlockInfo());
+    block_info_.Add(new (zone()) BlockInfo());
     if (is_optimizing() && !flow_graph().IsCompiledForOsr()) {
       BlockEntryInstr* entry = block_order_[i];
       for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) {
@@ -306,8 +314,7 @@
         if ((ic_data != NULL) && (ic_data->NumberOfUsedChecks() == 0)) {
           may_reoptimize_ = true;
         }
-        if (is_leaf &&
-            !current->IsCheckStackOverflow() &&
+        if (is_leaf && !current->IsCheckStackOverflow() &&
             !current->IsParallelMove()) {
           // Note that we do not care if the code contains instructions that
           // can deoptimize.
@@ -354,8 +361,7 @@
 
 
 bool FlowGraphCompiler::ForceSlowPathForStackOverflow() const {
-  if ((FLAG_stacktrace_every > 0) ||
-      (FLAG_deoptimize_every > 0) ||
+  if ((FLAG_stacktrace_every > 0) || (FLAG_deoptimize_every > 0) ||
       (isolate()->reload_every_n_stack_overflow_checks() > 0)) {
     return true;
   }
@@ -364,8 +370,7 @@
              FLAG_stacktrace_filter) != NULL) {
     return true;
   }
-  if (is_optimizing() &&
-      FLAG_deoptimize_filter != NULL &&
+  if (is_optimizing() && FLAG_deoptimize_filter != NULL &&
       strstr(parsed_function().function().ToFullyQualifiedCString(),
              FLAG_deoptimize_filter) != NULL) {
     return true;
@@ -375,8 +380,7 @@
 
 
 static bool IsEmptyBlock(BlockEntryInstr* block) {
-  return !block->IsCatchBlockEntry() &&
-         !block->HasNonRedundantParallelMove() &&
+  return !block->IsCatchBlockEntry() && !block->HasNonRedundantParallelMove() &&
          block->next()->IsGoto() &&
          !block->next()->AsGoto()->HasNonRedundantParallelMove() &&
          !block->IsIndirectEntry();
@@ -437,12 +441,11 @@
       // Instructions that can be deoptimization targets need to record kDeopt
       // PcDescriptor corresponding to their deopt id. GotoInstr records its
       // own so that it can control the placement.
-      AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                           instr->deopt_id(),
+      AddCurrentDescriptor(RawPcDescriptors::kDeopt, instr->deopt_id(),
                            instr->token_pos());
     }
     AllocateRegistersLocally(instr);
-  } else if (instr->MayThrow()  &&
+  } else if (instr->MayThrow() &&
              (CurrentTryIndex() != CatchClauseNode::kInvalidTryIndex)) {
     // Optimized try-block: Sync locals to fixed stack locations.
     EmitTrySync(instr, CurrentTryIndex());
@@ -450,7 +453,6 @@
 }
 
 
-
 void FlowGraphCompiler::EmitSourceLine(Instruction* instr) {
   if (!instr->token_pos().IsReal() || (instr->env() == NULL)) {
     return;
@@ -461,10 +463,9 @@
   intptr_t column_nr;
   script.GetTokenLocation(instr->token_pos(), &line_nr, &column_nr);
   const String& line = String::Handle(zone(), script.GetLine(line_nr));
-  assembler()->Comment("Line %" Pd " in '%s':\n           %s",
-      line_nr,
-      instr->env()->function().ToFullyQualifiedCString(),
-      line.ToCString());
+  assembler()->Comment("Line %" Pd " in '%s':\n           %s", line_nr,
+                       instr->env()->function().ToFullyQualifiedCString(),
+                       line.ToCString());
 }
 
 
@@ -475,10 +476,9 @@
   if (Assembler::EmittingComments()) {
     for (intptr_t loop_id = 0; loop_id < loop_headers.length(); ++loop_id) {
       for (BitVector::Iterator loop_it(loop_headers[loop_id]->loop_info());
-           !loop_it.Done();
-           loop_it.Advance()) {
+           !loop_it.Done(); loop_it.Advance()) {
         if (loop_it.Current() == block.preorder_number()) {
-           assembler->Comment("  Loop %" Pd "", loop_id);
+          assembler->Comment("  Loop %" Pd "", loop_id);
         }
       }
     }
@@ -496,8 +496,8 @@
   IntervalStruct(intptr_t s, TokenPosition tp, intptr_t id)
       : start(s), pos(tp), inlining_id(id) {}
   void Dump() {
-    THR_Print("start: 0x%" Px " iid: %" Pd " pos: %s",
-              start, inlining_id, pos.ToCString());
+    THR_Print("start: 0x%" Px " iid: %" Pd " pos: %s", start, inlining_id,
+              pos.ToCString());
   }
 };
 
@@ -564,8 +564,8 @@
           }
         }
       }
-      if (FLAG_code_comments ||
-          FLAG_disassemble || FLAG_disassemble_optimized) {
+      if (FLAG_code_comments || FLAG_disassemble ||
+          FLAG_disassemble_optimized) {
         if (FLAG_source_lines) {
           EmitSourceLine(instr);
         }
@@ -611,8 +611,8 @@
             *inline_id_to_function_.At(intervals[i].inlining_id);
         intervals[i].Dump();
         THR_Print(" parent iid %" Pd " %s\n",
-            caller_inline_id_[intervals[i].inlining_id],
-            function.ToQualifiedCString());
+                  caller_inline_id_[intervals[i].inlining_id],
+                  function.ToQualifiedCString());
       }
 
       const intptr_t id = intervals[i].inlining_id;
@@ -630,8 +630,8 @@
     LogBlock lb;
     THR_Print("Intervals:\n");
     for (intptr_t cc = 0; cc < caller_inline_id_.length(); cc++) {
-      THR_Print("  iid: %" Pd " caller iid: %" Pd "\n",
-          cc, caller_inline_id_[cc]);
+      THR_Print("  iid: %" Pd " caller iid: %" Pd "\n", cc,
+                caller_inline_id_[cc]);
     }
     Smi& temp = Smi::Handle();
     for (intptr_t i = 0; i < inlined_code_intervals_.Length();
@@ -666,14 +666,23 @@
   // Parameters first.
   intptr_t i = 0;
   const intptr_t num_non_copied_params = flow_graph().num_non_copied_params();
-  ParallelMoveInstr* move_instr = new(zone()) ParallelMoveInstr();
+  ParallelMoveInstr* move_instr = new (zone()) ParallelMoveInstr();
   for (; i < num_non_copied_params; ++i) {
     // Don't sync captured parameters. They are not in the environment.
     if (flow_graph().captured_parameters()->Contains(i)) continue;
     if ((*idefs)[i]->IsConstant()) continue;  // Common constants
     Location src = env->LocationAt(i);
+#if defined(TARGET_ARCH_DBC)
+    intptr_t dest_index = kNumberOfCpuRegisters - 1 - i;
+    Location dest = Location::RegisterLocation(dest_index);
+    // Update safepoint bitmap to indicate that the target location
+    // now contains a pointer. With DBC parameters are copied into
+    // the locals area.
+    instr->locs()->SetStackBit(dest_index);
+#else
     intptr_t dest_index = i - num_non_copied_params;
     Location dest = Location::StackSlot(dest_index);
+#endif
     move_instr->AddMove(dest, src);
   }
 
@@ -689,8 +698,13 @@
     Location src = env->LocationAt(i);
     ASSERT(!src.IsFpuRegister());
     ASSERT(!src.IsDoubleStackSlot());
+#if defined(TARGET_ARCH_DBC)
+    intptr_t dest_index = kNumberOfCpuRegisters - 1 - i;
+    Location dest = Location::RegisterLocation(dest_index);
+#else
     intptr_t dest_index = i - num_non_copied_params;
     Location dest = Location::StackSlot(dest_index);
+#endif
     move_instr->AddMove(dest, src);
     // Update safepoint bitmap to indicate that the target location
     // now contains a pointer.
@@ -705,20 +719,18 @@
     return flow_graph_.graph_entry()->spill_slot_count();
   } else {
     return parsed_function_.num_stack_locals() +
-        parsed_function_.num_copied_params();
+           parsed_function_.num_copied_params();
   }
 }
 
 
-Label* FlowGraphCompiler::GetJumpLabel(
-    BlockEntryInstr* block_entry) const {
+Label* FlowGraphCompiler::GetJumpLabel(BlockEntryInstr* block_entry) const {
   const intptr_t block_index = block_entry->postorder_number();
   return block_info_[block_index]->jump_label();
 }
 
 
-bool FlowGraphCompiler::WasCompacted(
-    BlockEntryInstr* block_entry) const {
+bool FlowGraphCompiler::WasCompacted(BlockEntryInstr* block_entry) const {
   const intptr_t block_index = block_entry->postorder_number();
   return block_info_[block_index]->WasCompacted();
 }
@@ -739,7 +751,7 @@
   Label* true_label = GetJumpLabel(branch->true_successor());
   Label* false_label = GetJumpLabel(branch->false_successor());
   Label* fall_through = NextNonEmptyLabel();
-  BranchLabels result = { true_label, false_label, fall_through };
+  BranchLabels result = {true_label, false_label, fall_through};
   return result;
 }
 
@@ -768,11 +780,8 @@
                                             intptr_t pc_offset,
                                             const Array& handler_types,
                                             bool needs_stacktrace) {
-  exception_handlers_list_->AddHandler(try_index,
-                                       outer_try_index,
-                                       pc_offset,
-                                       handler_types,
-                                       needs_stacktrace);
+  exception_handlers_list_->AddHandler(try_index, outer_try_index, pc_offset,
+                                       handler_types, needs_stacktrace);
 }
 
 
@@ -787,25 +796,22 @@
                                              TokenPosition token_pos) {
   // When running with optimizations disabled, don't emit deopt-descriptors.
   if (!CanOptimize() && (kind == RawPcDescriptors::kDeopt)) return;
-  pc_descriptors_list()->AddDescriptor(kind,
-                                       assembler()->CodeSize(),
-                                       deopt_id,
-                                       token_pos,
-                                       CurrentTryIndex());
+  pc_descriptors_list()->AddDescriptor(kind, assembler()->CodeSize(), deopt_id,
+                                       token_pos, CurrentTryIndex());
 }
 
 
 void FlowGraphCompiler::AddStaticCallTarget(const Function& func) {
   ASSERT(func.IsZoneHandle());
   static_calls_target_table_.Add(
-      new(zone()) StaticCallsStruct(assembler()->CodeSize(), &func, NULL));
+      new (zone()) StaticCallsStruct(assembler()->CodeSize(), &func, NULL));
 }
 
 
 void FlowGraphCompiler::AddStubCallTarget(const Code& code) {
   ASSERT(code.IsZoneHandle());
   static_calls_target_table_.Add(
-      new(zone()) StaticCallsStruct(assembler()->CodeSize(), NULL, &code));
+      new (zone()) StaticCallsStruct(assembler()->CodeSize(), NULL, &code));
 }
 
 
@@ -813,10 +819,9 @@
   ASSERT(is_optimizing());
   ASSERT(!intrinsic_mode());
   CompilerDeoptInfo* info =
-      new(zone()) CompilerDeoptInfo(deopt_id,
-                                    ICData::kDeoptAtCall,
-                                    0,  // No flags.
-                                    pending_deoptimization_env_);
+      new (zone()) CompilerDeoptInfo(deopt_id, ICData::kDeoptAtCall,
+                                     0,  // No flags.
+                                     pending_deoptimization_env_);
   info->set_pc_offset(assembler()->CodeSize());
   deopt_infos_.Add(info);
 }
@@ -829,30 +834,36 @@
 void FlowGraphCompiler::RecordSafepoint(LocationSummary* locs,
                                         intptr_t slow_path_argument_count) {
   if (is_optimizing() || locs->live_registers()->HasUntaggedValues()) {
-    const intptr_t spill_area_size = is_optimizing() ?
-        flow_graph_.graph_entry()->spill_slot_count() : 0;
+    const intptr_t spill_area_size =
+        is_optimizing() ? flow_graph_.graph_entry()->spill_slot_count() : 0;
 
     RegisterSet* registers = locs->live_registers();
     ASSERT(registers != NULL);
-    const intptr_t kFpuRegisterSpillFactor =
-            kFpuRegisterSize / kWordSize;
-    const intptr_t live_registers_size = registers->CpuRegisterCount() +
+    const intptr_t kFpuRegisterSpillFactor = kFpuRegisterSize / kWordSize;
+    const intptr_t live_registers_size =
+        registers->CpuRegisterCount() +
         (registers->FpuRegisterCount() * kFpuRegisterSpillFactor);
 
     BitmapBuilder* bitmap = locs->stack_bitmap();
 
-    // An instruction may have two safepoints in deferred code. The
-    // call to RecordSafepoint has the side-effect of appending the live
-    // registers to the bitmap. This is why the second call to RecordSafepoint
-    // with the same instruction (and same location summary) sees a bitmap that
-    // is larger that StackSize(). It will never be larger than StackSize() +
-    // live_registers_size.
+// An instruction may have two safepoints in deferred code. The
+// call to RecordSafepoint has the side-effect of appending the live
+// registers to the bitmap. This is why the second call to RecordSafepoint
+// with the same instruction (and same location summary) sees a bitmap that
+// is larger that StackSize(). It will never be larger than StackSize() +
+// live_registers_size.
+// The first safepoint will grow the bitmap to be the size of
+// spill_area_size but the second safepoint will truncate the bitmap and
+// append the live registers to it again. The bitmap produced by both calls
+// will be the same.
+#if !defined(TARGET_ARCH_DBC)
     ASSERT(bitmap->Length() <= (spill_area_size + live_registers_size));
-    // The first safepoint will grow the bitmap to be the size of
-    // spill_area_size but the second safepoint will truncate the bitmap and
-    // append the live registers to it again. The bitmap produced by both calls
-    // will be the same.
     bitmap->SetLength(spill_area_size);
+#else
+    if (bitmap->Length() <= (spill_area_size + live_registers_size)) {
+      bitmap->SetLength(Utils::Maximum(bitmap->Length(), spill_area_size));
+    }
+#endif
 
     // Mark the bits in the stack map in the same order we push registers in
     // slow path code (see FlowGraphCompiler::SaveLiveRegisters).
@@ -895,8 +906,7 @@
     // The slow path area Outside the spill area contains are live registers
     // and pushed arguments for calls inside the slow path.
     intptr_t slow_path_bit_count = bitmap->Length() - spill_area_size;
-    stackmap_table_builder()->AddEntry(assembler()->CodeSize(),
-                                       bitmap,
+    stackmap_table_builder()->AddEntry(assembler()->CodeSize(), bitmap,
                                        slow_path_bit_count);
   }
 }
@@ -951,8 +961,8 @@
   for (Environment::DeepIterator it(env); !it.Done(); it.Advance()) {
     Location loc = it.CurrentLocation();
     Value* value = it.CurrentValue();
-    it.SetCurrentLocation(loc.RemapForSlowPath(
-        value->definition(), cpu_reg_slots, fpu_reg_slots));
+    it.SetCurrentLocation(loc.RemapForSlowPath(value->definition(),
+                                               cpu_reg_slots, fpu_reg_slots));
   }
 
   return env;
@@ -979,11 +989,8 @@
   }
 
   ASSERT(is_optimizing_);
-  CompilerDeoptInfoWithStub* stub =
-      new(zone()) CompilerDeoptInfoWithStub(deopt_id,
-                                            reason,
-                                            flags,
-                                            pending_deoptimization_env_);
+  CompilerDeoptInfoWithStub* stub = new (zone()) CompilerDeoptInfoWithStub(
+      deopt_id, reason, flags, pending_deoptimization_env_);
   deopt_infos_.Add(stub);
   return stub->entry_label();
 }
@@ -997,15 +1004,11 @@
   ASSERT(!intrinsic_mode());
   // The pending deoptimization environment may be changed after this deopt is
   // emitted, so we need to make a copy.
-  Environment* env_copy =
-      pending_deoptimization_env_->DeepCopy(zone());
+  Environment* env_copy = pending_deoptimization_env_->DeepCopy(zone());
   CompilerDeoptInfo* info =
-      new(zone()) CompilerDeoptInfo(deopt_id,
-                                    reason,
-                                    flags,
-                                    env_copy);
+      new (zone()) CompilerDeoptInfo(deopt_id, reason, flags, env_copy);
   deopt_infos_.Add(info);
-  assembler()->Deopt(0, /*is_eager =*/ 1);
+  assembler()->Deopt(0, /*is_eager =*/1);
   info->set_pc_offset(assembler()->CodeSize());
 }
 #endif  // defined(TARGET_ARCH_DBC)
@@ -1019,7 +1022,7 @@
   if (FLAG_compiler_stats) {
     Thread* thread = Thread::Current();
     INC_STAT(thread, total_code_size,
-        ExceptionHandlers::InstanceSize(handlers.num_entries()));
+             ExceptionHandlers::InstanceSize(handlers.num_entries()));
     INC_STAT(thread, total_code_size, handlers.num_entries() * sizeof(uword));
   }
 }
@@ -1031,8 +1034,6 @@
       pc_descriptors_list_->FinalizePcDescriptors(code.PayloadStart()));
   if (!is_optimizing_) descriptors.Verify(parsed_function_.function());
   code.set_pc_descriptors(descriptors);
-  code.set_lazy_deopt_return_pc_offset(lazy_deopt_return_pc_offset_);
-  code.set_lazy_deopt_throw_pc_offset(lazy_deopt_throw_pc_offset_);
 }
 
 
@@ -1061,8 +1062,7 @@
       offset = Smi::New(deopt_infos_[i]->pc_offset());
       info = deopt_infos_[i]->CreateDeoptInfo(this, &builder, array);
       reason_and_flags = DeoptTable::EncodeReasonAndFlags(
-          deopt_infos_[i]->reason(),
-          deopt_infos_[i]->flags());
+          deopt_infos_[i]->reason(), deopt_infos_[i]->flags());
       DeoptTable::SetEntry(array, i, offset, info, reason_and_flags);
     }
     return array.raw();
@@ -1110,9 +1110,10 @@
 
 void FlowGraphCompiler::FinalizeStaticCallTargetsTable(const Code& code) {
   ASSERT(code.static_calls_target_table() == Array::null());
-  const Array& targets = Array::Handle(zone(), Array::New(
-      (static_calls_target_table_.length() * Code::kSCallTableEntryLength),
-      Heap::kOld));
+  const Array& targets =
+      Array::Handle(zone(), Array::New((static_calls_target_table_.length() *
+                                        Code::kSCallTableEntryLength),
+                                       Heap::kOld));
   Smi& smi_offset = Smi::Handle(zone());
   for (intptr_t i = 0; i < static_calls_target_table_.length(); i++) {
     const intptr_t target_ix = Code::kSCallTableEntryLength * i;
@@ -1120,16 +1121,15 @@
     targets.SetAt(target_ix + Code::kSCallTableOffsetEntry, smi_offset);
     if (static_calls_target_table_[i]->function != NULL) {
       targets.SetAt(target_ix + Code::kSCallTableFunctionEntry,
-          *static_calls_target_table_[i]->function);
+                    *static_calls_target_table_[i]->function);
     }
     if (static_calls_target_table_[i]->code != NULL) {
       targets.SetAt(target_ix + Code::kSCallTableCodeEntry,
-          *static_calls_target_table_[i]->code);
+                    *static_calls_target_table_[i]->code);
     }
   }
   code.set_static_calls_target_table(targets);
-  INC_STAT(Thread::Current(),
-           total_code_size,
+  INC_STAT(Thread::Current(), total_code_size,
            targets.Length() * sizeof(uword));
 }
 
@@ -1139,38 +1139,36 @@
   // Intrinsification skips arguments checks, therefore disable if in checked
   // mode.
   if (FLAG_intrinsify && !isolate()->type_checks()) {
+    const Class& owner = Class::Handle(parsed_function().function().Owner());
+    String& name = String::Handle(parsed_function().function().name());
+
     if (parsed_function().function().kind() == RawFunction::kImplicitGetter) {
-      // An implicit getter must have a specific AST structure.
-      const SequenceNode& sequence_node = *parsed_function().node_sequence();
-      ASSERT(sequence_node.length() == 1);
-      ASSERT(sequence_node.NodeAt(0)->IsReturnNode());
-      const ReturnNode& return_node = *sequence_node.NodeAt(0)->AsReturnNode();
-      ASSERT(return_node.value()->IsLoadInstanceFieldNode());
-      const LoadInstanceFieldNode& load_node =
-          *return_node.value()->AsLoadInstanceFieldNode();
+      // TODO(27590) Store Field object inside RawFunction::data_ if possible.
+      name = Field::NameFromGetter(name);
+      const Field& field = Field::Handle(owner.LookupFieldAllowPrivate(name));
+      ASSERT(!field.IsNull());
+
       // Only intrinsify getter if the field cannot contain a mutable double.
       // Reading from a mutable double box requires allocating a fresh double.
-      if (FLAG_precompiled_mode ||
-          !IsPotentialUnboxedField(load_node.field())) {
-        GenerateInlinedGetter(load_node.field().Offset());
+      if (field.is_instance() &&
+          (FLAG_precompiled_mode || !IsPotentialUnboxedField(field))) {
+        GenerateInlinedGetter(field.Offset());
         return !FLAG_use_field_guards;
       }
       return false;
     }
     if (parsed_function().function().kind() == RawFunction::kImplicitSetter) {
-      // An implicit setter must have a specific AST structure.
-      // Sequence node has one store node and one return NULL node.
-      const SequenceNode& sequence_node = *parsed_function().node_sequence();
-      ASSERT(sequence_node.length() == 2);
-      ASSERT(sequence_node.NodeAt(0)->IsStoreInstanceFieldNode());
-      ASSERT(sequence_node.NodeAt(1)->IsReturnNode());
-      const StoreInstanceFieldNode& store_node =
-          *sequence_node.NodeAt(0)->AsStoreInstanceFieldNode();
-      if (FLAG_precompiled_mode ||
-          (store_node.field().guarded_cid() == kDynamicCid)) {
-        GenerateInlinedSetter(store_node.field().Offset());
+      // TODO(27590) Store Field object inside RawFunction::data_ if possible.
+      name = Field::NameFromSetter(name);
+      const Field& field = Field::Handle(owner.LookupFieldAllowPrivate(name));
+      ASSERT(!field.IsNull());
+
+      if (field.is_instance() &&
+          (FLAG_precompiled_mode || field.guarded_cid() == kDynamicCid)) {
+        GenerateInlinedSetter(field.Offset());
         return !FLAG_use_field_guards;
       }
+      return false;
     }
   }
 
@@ -1194,17 +1192,16 @@
 // DBC is very different from other architectures in how it performs instance
 // and static calls because it does not use stubs.
 #if !defined(TARGET_ARCH_DBC)
-void FlowGraphCompiler::GenerateInstanceCall(
-    intptr_t deopt_id,
-    TokenPosition token_pos,
-    intptr_t argument_count,
-    LocationSummary* locs,
-    const ICData& ic_data_in) {
+void FlowGraphCompiler::GenerateInstanceCall(intptr_t deopt_id,
+                                             TokenPosition token_pos,
+                                             intptr_t argument_count,
+                                             LocationSummary* locs,
+                                             const ICData& ic_data_in) {
   ICData& ic_data = ICData::ZoneHandle(ic_data_in.Original());
   if (FLAG_precompiled_mode) {
     ic_data = ic_data.AsUnaryClassChecks();
-    EmitSwitchableInstanceCall(ic_data, argument_count,
-                               deopt_id, token_pos, locs);
+    EmitSwitchableInstanceCall(ic_data, argument_count, deopt_id, token_pos,
+                               locs);
     return;
   }
   ASSERT(!ic_data.IsNull());
@@ -1230,22 +1227,19 @@
   }
 
   if (is_optimizing()) {
-    EmitMegamorphicInstanceCall(ic_data_in, argument_count,
-                                deopt_id, token_pos, locs,
-                                CatchClauseNode::kInvalidTryIndex);
+    EmitMegamorphicInstanceCall(ic_data_in, argument_count, deopt_id, token_pos,
+                                locs, CatchClauseNode::kInvalidTryIndex);
     return;
   }
 
   switch (ic_data.NumArgsTested()) {
     case 1:
-      EmitInstanceCall(
-          *StubCode::OneArgCheckInlineCache_entry(), ic_data, argument_count,
-          deopt_id, token_pos, locs);
+      EmitInstanceCall(*StubCode::OneArgCheckInlineCache_entry(), ic_data,
+                       argument_count, deopt_id, token_pos, locs);
       break;
     case 2:
-      EmitInstanceCall(
-          *StubCode::TwoArgsCheckInlineCache_entry(), ic_data, argument_count,
-          deopt_id, token_pos, locs);
+      EmitInstanceCall(*StubCode::TwoArgsCheckInlineCache_entry(), ic_data,
+                       argument_count, deopt_id, token_pos, locs);
       break;
     default:
       UNIMPLEMENTED();
@@ -1261,21 +1255,21 @@
                                            LocationSummary* locs,
                                            const ICData& ic_data_in) {
   const ICData& ic_data = ICData::ZoneHandle(ic_data_in.Original());
-  const Array& arguments_descriptor = Array::ZoneHandle(
-      ic_data.IsNull() ? ArgumentsDescriptor::New(argument_count,
-                                                  argument_names)
-                       : ic_data.arguments_descriptor());
+  const Array& arguments_descriptor =
+      Array::ZoneHandle(ic_data.IsNull() ? ArgumentsDescriptor::New(
+                                               argument_count, argument_names)
+                                         : ic_data.arguments_descriptor());
   if (is_optimizing()) {
-    EmitOptimizedStaticCall(function, arguments_descriptor,
-                            argument_count, deopt_id, token_pos, locs);
+    EmitOptimizedStaticCall(function, arguments_descriptor, argument_count,
+                            deopt_id, token_pos, locs);
   } else {
     ICData& call_ic_data = ICData::ZoneHandle(ic_data.raw());
     if (call_ic_data.IsNull()) {
       const intptr_t kNumArgsChecked = 0;
-      call_ic_data = GetOrAddStaticCallICData(deopt_id,
-                                              function,
-                                              arguments_descriptor,
-                                              kNumArgsChecked)->raw();
+      call_ic_data =
+          GetOrAddStaticCallICData(deopt_id, function, arguments_descriptor,
+                                   kNumArgsChecked)
+              ->raw();
     }
     EmitUnoptimizedStaticCall(argument_count, deopt_id, token_pos, locs,
                               call_ic_data);
@@ -1347,9 +1341,9 @@
 bool FlowGraphCompiler::NeedsEdgeCounter(TargetEntryInstr* block) {
   // Only emit an edge counter if there is not goto at the end of the block,
   // except for the entry block.
-  return (FLAG_reorder_basic_blocks
-      && (!block->last_instruction()->IsGoto()
-          || (block == flow_graph().graph_entry()->normal_entry())));
+  return (FLAG_reorder_basic_blocks &&
+          (!block->last_instruction()->IsGoto() ||
+           (block == flow_graph().graph_entry()->normal_entry())));
 }
 
 
@@ -1369,11 +1363,10 @@
 
 void FlowGraphCompiler::AllocateRegistersLocally(Instruction* instr) {
   ASSERT(!is_optimizing());
-  instr->InitializeLocationSummary(zone(),
-                                   false);  // Not optimizing.
+  instr->InitializeLocationSummary(zone(), false);  // Not optimizing.
 
-  // No need to allocate registers based on LocationSummary on DBC as in
-  // unoptimized mode it's a stack based bytecode just like IR itself.
+// No need to allocate registers based on LocationSummary on DBC as in
+// unoptimized mode it's a stack based bytecode just like IR itself.
 #if !defined(TARGET_ARCH_DBC)
   LocationSummary* locs = instr->locs();
 
@@ -1439,8 +1432,7 @@
     Location loc = locs->temp(i);
     if (loc.IsUnallocated()) {
       ASSERT(loc.policy() == Location::kRequiresRegister);
-      loc = Location::RegisterLocation(
-        AllocateFreeRegister(blocked_registers));
+      loc = Location::RegisterLocation(AllocateFreeRegister(blocked_registers));
       locs->set_temp(i, loc);
     }
   }
@@ -1452,8 +1444,8 @@
       case Location::kPrefersRegister:
       case Location::kRequiresRegister:
       case Location::kWritableRegister:
-        result_location = Location::RegisterLocation(
-            AllocateFreeRegister(blocked_registers));
+        result_location =
+            Location::RegisterLocation(AllocateFreeRegister(blocked_registers));
         break;
       case Location::kSameAsFirstInput:
         result_location = locs->in(0);
@@ -1640,19 +1632,15 @@
 
 
 ParallelMoveResolver::ScratchFpuRegisterScope::ScratchFpuRegisterScope(
-    ParallelMoveResolver* resolver, FpuRegister blocked)
-    : resolver_(resolver),
-      reg_(kNoFpuRegister),
-      spilled_(false) {
+    ParallelMoveResolver* resolver,
+    FpuRegister blocked)
+    : resolver_(resolver), reg_(kNoFpuRegister), spilled_(false) {
   COMPILE_ASSERT(FpuTMP != kNoFpuRegister);
-  uword blocked_mask = ((blocked != kNoFpuRegister) ? 1 << blocked : 0)
-                     | 1 << FpuTMP;
-  reg_ = static_cast<FpuRegister>(
-      resolver_->AllocateScratchRegister(Location::kFpuRegister,
-                                         blocked_mask,
-                                         0,
-                                         kNumberOfFpuRegisters - 1,
-                                         &spilled_));
+  uword blocked_mask =
+      ((blocked != kNoFpuRegister) ? 1 << blocked : 0) | 1 << FpuTMP;
+  reg_ = static_cast<FpuRegister>(resolver_->AllocateScratchRegister(
+      Location::kFpuRegister, blocked_mask, 0, kNumberOfFpuRegisters - 1,
+      &spilled_));
 
   if (spilled_) {
     resolver->SpillFpuScratch(reg_);
@@ -1668,10 +1656,9 @@
 
 
 ParallelMoveResolver::ScratchRegisterScope::ScratchRegisterScope(
-    ParallelMoveResolver* resolver, Register blocked)
-    : resolver_(resolver),
-      reg_(kNoRegister),
-      spilled_(false) {
+    ParallelMoveResolver* resolver,
+    Register blocked)
+    : resolver_(resolver), reg_(kNoRegister), spilled_(false) {
   uword blocked_mask = RegMaskBit(blocked) | kReservedCpuRegisters;
   if (resolver->compiler_->intrinsic_mode()) {
     // Block additional registers that must be preserved for intrinsics.
@@ -1683,11 +1670,8 @@
 #endif
   }
   reg_ = static_cast<Register>(
-      resolver_->AllocateScratchRegister(Location::kRegister,
-                                         blocked_mask,
-                                         0,
-                                         kNumberOfCpuRegisters - 1,
-                                         &spilled_));
+      resolver_->AllocateScratchRegister(Location::kRegister, blocked_mask, 0,
+                                         kNumberOfCpuRegisters - 1, &spilled_));
 
   if (spilled_) {
     resolver->SpillScratch(reg_);
@@ -1742,9 +1726,10 @@
     ASSERT(!res->is_static_call());
     return res;
   }
-  const ICData& ic_data = ICData::ZoneHandle(zone(), ICData::New(
-      parsed_function().function(), target_name,
-      arguments_descriptor, deopt_id, num_args_tested, false));
+  const ICData& ic_data =
+      ICData::ZoneHandle(zone(), ICData::New(parsed_function().function(),
+                                             target_name, arguments_descriptor,
+                                             deopt_id, num_args_tested, false));
 #if defined(TAG_IC_DATA)
   ic_data.set_tag(Instruction::kInstanceCall);
 #endif
@@ -1770,9 +1755,11 @@
     ASSERT(res->is_static_call());
     return res;
   }
-  const ICData& ic_data = ICData::ZoneHandle(zone(), ICData::New(
-      parsed_function().function(), String::Handle(zone(), target.name()),
-      arguments_descriptor, deopt_id, num_args_tested, true));
+  const ICData& ic_data = ICData::ZoneHandle(
+      zone(),
+      ICData::New(parsed_function().function(),
+                  String::Handle(zone(), target.name()), arguments_descriptor,
+                  deopt_id, num_args_tested, true));
   ic_data.AddTarget(target);
 #if defined(TAG_IC_DATA)
   ic_data.set_tag(Instruction::kStaticCall);
@@ -1794,7 +1781,7 @@
     const intptr_t basic_blocks = flow_graph().preorder().length();
     ASSERT(basic_blocks > 0);
     threshold = FLAG_optimization_counter_scale * basic_blocks +
-        FLAG_min_optimization_counter_threshold;
+                FLAG_min_optimization_counter_threshold;
     if (threshold > FLAG_optimization_counter_threshold) {
       threshold = FLAG_optimization_counter_threshold;
     }
@@ -1826,8 +1813,8 @@
   if (inline_id_to_function_.length() == 0) {
     return Object::empty_array().raw();
   }
-  const Array& res = Array::Handle(
-      Array::New(inline_id_to_function_.length(), Heap::kOld));
+  const Array& res =
+      Array::Handle(Array::New(inline_id_to_function_.length(), Heap::kOld));
   for (intptr_t i = 0; i < inline_id_to_function_.length(); i++) {
     res.SetAt(i, *inline_id_to_function_[i]);
   }
@@ -1839,8 +1826,8 @@
   if (inline_id_to_token_pos_.length() == 0) {
     return Object::empty_array().raw();
   }
-  const Array& res = Array::Handle(zone(),
-      Array::New(inline_id_to_token_pos_.length(), Heap::kOld));
+  const Array& res = Array::Handle(
+      zone(), Array::New(inline_id_to_token_pos_.length(), Heap::kOld));
   Smi& smi = Smi::Handle(zone());
   for (intptr_t i = 0; i < inline_id_to_token_pos_.length(); i++) {
     smi = Smi::New(inline_id_to_token_pos_[i].value());
@@ -1854,8 +1841,8 @@
   if (caller_inline_id_.length() == 0) {
     return Object::empty_array().raw();
   }
-  const Array& res = Array::Handle(
-      Array::New(caller_inline_id_.length(), Heap::kOld));
+  const Array& res =
+      Array::Handle(Array::New(caller_inline_id_.length(), Heap::kOld));
   Smi& smi = Smi::Handle();
   for (intptr_t i = 0; i < caller_inline_id_.length(); i++) {
     smi = Smi::New(caller_inline_id_[i]);
@@ -1866,16 +1853,16 @@
 
 
 void FlowGraphCompiler::BeginCodeSourceRange() {
-NOT_IN_PRODUCT(
+#if !defined(PRODUCT)
   // Remember how many bytes of code we emitted so far. This function
   // is called before we call into an instruction's EmitNativeCode.
   saved_code_size_ = assembler()->CodeSize();
-);
+#endif  // !defined(PRODUCT)
 }
 
 
 bool FlowGraphCompiler::EndCodeSourceRange(TokenPosition token_pos) {
-NOT_IN_PRODUCT(
+#if !defined(PRODUCT)
   // This function is called after each instructions' EmitNativeCode.
   if (saved_code_size_ < assembler()->CodeSize()) {
     // We emitted more code, now associate the emitted code chunk with
@@ -1884,7 +1871,7 @@
     BeginCodeSourceRange();
     return true;
   }
-);
+#endif  // !defined(PRODUCT)
   return false;
 }
 
@@ -1892,17 +1879,16 @@
 #if !defined(TARGET_ARCH_DBC)
 // DBC emits calls very differently from other architectures due to its
 // interpreted nature.
-void FlowGraphCompiler::EmitPolymorphicInstanceCall(
-    const ICData& ic_data,
-    intptr_t argument_count,
-    const Array& argument_names,
-    intptr_t deopt_id,
-    TokenPosition token_pos,
-    LocationSummary* locs,
-    bool complete) {
+void FlowGraphCompiler::EmitPolymorphicInstanceCall(const ICData& ic_data,
+                                                    intptr_t argument_count,
+                                                    const Array& argument_names,
+                                                    intptr_t deopt_id,
+                                                    TokenPosition token_pos,
+                                                    LocationSummary* locs,
+                                                    bool complete) {
   if (FLAG_polymorphic_with_deopt) {
-    Label* deopt = AddDeoptStub(deopt_id,
-                                ICData::kDeoptPolymorphicInstanceCallTestFail);
+    Label* deopt =
+        AddDeoptStub(deopt_id, ICData::kDeoptPolymorphicInstanceCallTestFail);
     Label ok;
     EmitTestAndCall(ic_data, argument_count, argument_names,
                     deopt,  // No cid match.
@@ -1913,25 +1899,13 @@
     if (complete) {
       Label ok;
       EmitTestAndCall(ic_data, argument_count, argument_names,
-                      NULL,                      // No cid match.
-                      &ok,                       // Found cid.
+                      NULL,  // No cid match.
+                      &ok,   // Found cid.
                       deopt_id, token_pos, locs, true);
       assembler()->Bind(&ok);
     } else {
-      // Instead of deoptimizing, do a megamorphic call when no matching
-      // cid found.
-      Label ok;
-      MegamorphicSlowPath* slow_path =
-        new MegamorphicSlowPath(ic_data, argument_count, deopt_id,
-                                token_pos, locs, CurrentTryIndex());
-      AddSlowPathCode(slow_path);
-      EmitTestAndCall(ic_data, argument_count, argument_names,
-                      slow_path->entry_label(),  // No cid match.
-                      &ok,                       // Found cid.
-                      deopt_id, token_pos, locs, false);
-
-      assembler()->Bind(slow_path->exit_label());
-      assembler()->Bind(&ok);
+      EmitSwitchableInstanceCall(ic_data, argument_count, deopt_id, token_pos,
+                                 locs);
     }
   }
 }
@@ -1951,7 +1925,7 @@
 
     case Instruction::kDropTemps:
       FrameStatePop(instr->locs()->input_count() +
-          instr->AsDropTemps()->num_temps());
+                    instr->AsDropTemps()->num_temps());
       break;
 
     default:
@@ -1971,8 +1945,7 @@
 
 void FlowGraphCompiler::FrameStatePush(Definition* defn) {
   Representation rep = defn->representation();
-  if ((rep == kUnboxedDouble) ||
-      (rep == kUnboxedFloat64x2) ||
+  if ((rep == kUnboxedDouble) || (rep == kUnboxedFloat64x2) ||
       (rep == kUnboxedFloat32x4)) {
     // LoadField instruction lies about its representation in the unoptimized
     // code because Definition::representation() can't depend on the type of
@@ -1990,8 +1963,8 @@
 
 void FlowGraphCompiler::FrameStatePop(intptr_t count) {
   ASSERT(!is_optimizing());
-  frame_state_.TruncateTo(Utils::Maximum(static_cast<intptr_t>(0),
-      frame_state_.length() - count));
+  frame_state_.TruncateTo(
+      Utils::Maximum(static_cast<intptr_t>(0), frame_state_.length() - count));
 }
 
 
diff --git a/runtime/vm/flow_graph_compiler.h b/runtime/vm/flow_graph_compiler.h
index 796c1f2..afdb4cb 100644
--- a/runtime/vm/flow_graph_compiler.h
+++ b/runtime/vm/flow_graph_compiler.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_FLOW_GRAPH_COMPILER_H_
-#define VM_FLOW_GRAPH_COMPILER_H_
+#ifndef RUNTIME_VM_FLOW_GRAPH_COMPILER_H_
+#define RUNTIME_VM_FLOW_GRAPH_COMPILER_H_
 
 #include "vm/allocation.h"
 #include "vm/assembler.h"
@@ -19,7 +19,8 @@
 class FlowGraph;
 class FlowGraphCompiler;
 class Function;
-template <typename T> class GrowableArray;
+template <typename T>
+class GrowableArray;
 class ParsedFunction;
 
 
@@ -124,7 +125,7 @@
         deopt_env_(deopt_env) {
     ASSERT(deopt_env != NULL);
   }
-  virtual ~CompilerDeoptInfo() { }
+  virtual ~CompilerDeoptInfo() {}
 
   RawTypedData* CreateDeoptInfo(FlowGraphCompiler* compiler,
                                 DeoptInfoBuilder* builder,
@@ -175,11 +176,12 @@
 
   const char* Name() const {
     const char* kFormat = "Deopt stub for id %d, reason: %s";
-    const intptr_t len = OS::SNPrint(NULL, 0, kFormat,
-        deopt_id(), DeoptReasonToCString(reason())) + 1;
+    const intptr_t len = OS::SNPrint(NULL, 0, kFormat, deopt_id(),
+                                     DeoptReasonToCString(reason())) +
+                         1;
     char* chars = Thread::Current()->zone()->Alloc<char>(len);
-    OS::SNPrint(chars, len, kFormat,
-        deopt_id(), DeoptReasonToCString(reason()));
+    OS::SNPrint(chars, len, kFormat, deopt_id(),
+                DeoptReasonToCString(reason()));
     return chars;
   }
 
@@ -192,8 +194,8 @@
 
 class SlowPathCode : public ZoneAllocated {
  public:
-  SlowPathCode() : entry_label_(), exit_label_() { }
-  virtual ~SlowPathCode() { }
+  SlowPathCode() : entry_label_(), exit_label_() {}
+  virtual ~SlowPathCode() {}
 
   Label* entry_label() { return &entry_label_; }
   Label* exit_label() { return &exit_label_; }
@@ -213,44 +215,11 @@
 };
 
 
-class MegamorphicSlowPath : public SlowPathCode {
- public:
-  MegamorphicSlowPath(const ICData& ic_data,
-                      intptr_t argument_count,
-                      intptr_t deopt_id,
-                      TokenPosition token_pos,
-                      LocationSummary* locs,
-                      intptr_t try_index)
-    : SlowPathCode(),
-      ic_data_(ic_data),
-      argument_count_(argument_count),
-      deopt_id_(deopt_id),
-      token_pos_(token_pos),
-      locs_(locs),
-      try_index_(try_index) {}
-  virtual ~MegamorphicSlowPath() {}
-
- private:
-  virtual void EmitNativeCode(FlowGraphCompiler* comp);
-
-  const ICData& ic_data_;
-  intptr_t argument_count_;
-  intptr_t deopt_id_;
-  TokenPosition token_pos_;
-  LocationSummary* locs_;
-  const intptr_t try_index_;  // For try/catch ranges.
-
-  DISALLOW_COPY_AND_ASSIGN(MegamorphicSlowPath);
-};
-
-
 struct CidTarget {
   intptr_t cid;
   Function* target;
   intptr_t count;
-  CidTarget(intptr_t cid_arg,
-            Function* target_arg,
-            intptr_t count_arg)
+  CidTarget(intptr_t cid_arg, Function* target_arg, intptr_t count_arg)
       : cid(cid_arg), target(target_arg), count(count_arg) {}
 };
 
@@ -276,9 +245,7 @@
     Label* next_nonempty_label() const { return next_nonempty_label_; }
     void set_next_nonempty_label(Label* label) { next_nonempty_label_ = label; }
 
-    bool WasCompacted() const {
-      return jump_label_ != &block_label_;
-    }
+    bool WasCompacted() const { return jump_label_ != &block_label_; }
 
     // Block compaction is recursive.  Block info for already-compacted
     // blocks is marked so as to avoid cycles in the graph.
@@ -295,14 +262,13 @@
   };
 
  public:
-  FlowGraphCompiler(
-      Assembler* assembler,
-      FlowGraph* flow_graph,
-      const ParsedFunction& parsed_function,
-      bool is_optimizing,
-      const GrowableArray<const Function*>& inline_id_to_function,
-      const GrowableArray<TokenPosition>& inline_id_to_token_pos,
-      const GrowableArray<intptr_t>& caller_inline_id);
+  FlowGraphCompiler(Assembler* assembler,
+                    FlowGraph* flow_graph,
+                    const ParsedFunction& parsed_function,
+                    bool is_optimizing,
+                    const GrowableArray<const Function*>& inline_id_to_function,
+                    const GrowableArray<TokenPosition>& inline_id_to_token_pos,
+                    const GrowableArray<intptr_t>& caller_inline_id);
 
   ~FlowGraphCompiler();
 
@@ -325,13 +291,9 @@
 
   const FlowGraph& flow_graph() const { return flow_graph_; }
 
-  DescriptorList* pc_descriptors_list() const {
-    return pc_descriptors_list_;
-  }
+  DescriptorList* pc_descriptors_list() const { return pc_descriptors_list_; }
   BlockEntryInstr* current_block() const { return current_block_; }
-  void set_current_block(BlockEntryInstr* value) {
-    current_block_ = value;
-  }
+  void set_current_block(BlockEntryInstr* value) { current_block_ = value; }
   static bool CanOptimize();
   bool CanOptimizeFunction() const;
   bool CanOSRFunction() const;
@@ -341,9 +303,7 @@
   void ExitIntrinsicMode();
   bool intrinsic_mode() const { return intrinsic_mode_; }
 
-  Label* intrinsic_slow_path_label() {
-    return &intrinsic_slow_path_label_;
-  }
+  Label* intrinsic_slow_path_label() { return &intrinsic_slow_path_label_; }
 
   bool ForceSlowPathForStackOverflow() const;
 
@@ -372,8 +332,8 @@
                                 const String& dst_name,
                                 LocationSummary* locs);
 
-  // DBC emits calls very differently from all other architectures due to its
-  // interpreted nature.
+// DBC emits calls very differently from all other architectures due to its
+// interpreted nature.
 #if !defined(TARGET_ARCH_DBC)
   void GenerateRuntimeCall(TokenPosition token_pos,
                            intptr_t deopt_id,
@@ -386,6 +346,11 @@
                     RawPcDescriptors::Kind kind,
                     LocationSummary* locs);
 
+  void GeneratePatchableCall(TokenPosition token_pos,
+                             const StubEntry& stub_entry,
+                             RawPcDescriptors::Kind kind,
+                             LocationSummary* locs);
+
   void GenerateDartCall(intptr_t deopt_id,
                         TokenPosition token_pos,
                         const StubEntry& stub_entry,
@@ -425,8 +390,7 @@
   void GenerateStringTypeCheck(Register kClassIdReg,
                                Label* is_instance_lbl,
                                Label* is_not_instance_lbl);
-  void GenerateListTypeCheck(Register kClassIdReg,
-                             Label* is_instance_lbl);
+  void GenerateListTypeCheck(Register kClassIdReg, Label* is_instance_lbl);
 
   void EmitOptimizedInstanceCall(const StubEntry& stub_entry,
                                  const ICData& ic_data,
@@ -451,14 +415,13 @@
                                    bool complete);
 
   // Pass a value for try-index where block is not available (e.g. slow path).
-  void EmitMegamorphicInstanceCall(
-      const ICData& ic_data,
-      intptr_t argument_count,
-      intptr_t deopt_id,
-      TokenPosition token_pos,
-      LocationSummary* locs,
-      intptr_t try_index,
-      intptr_t slow_path_argument_count = 0);
+  void EmitMegamorphicInstanceCall(const ICData& ic_data,
+                                   intptr_t argument_count,
+                                   intptr_t deopt_id,
+                                   TokenPosition token_pos,
+                                   LocationSummary* locs,
+                                   intptr_t try_index,
+                                   intptr_t slow_path_argument_count = 0);
 
   void EmitSwitchableInstanceCall(const ICData& ic_data,
                                   intptr_t argument_count,
@@ -602,9 +565,7 @@
     return inlined_code_intervals_;
   }
 
-  RawArray* edge_counters_array() const {
-    return edge_counters_array_.raw();
-  }
+  RawArray* edge_counters_array() const { return edge_counters_array_.raw(); }
 
   RawArray* InliningIdToFunction() const;
   RawArray* InliningIdToTokenPos() const;
@@ -622,6 +583,10 @@
   bool EndCodeSourceRange(TokenPosition token_pos);
 
 #if defined(TARGET_ARCH_DBC)
+  void RecordAfterCallHelper(TokenPosition token_pos,
+                             intptr_t deopt_id,
+                             intptr_t argument_count,
+                             LocationSummary* locs);
   void RecordAfterCall(Instruction* instr);
 #endif
 
@@ -655,8 +620,8 @@
                                  LocationSummary* locs,
                                  const ICData& ic_data);
 
-  // DBC handles type tests differently from all other architectures due
-  // to its interpreted nature.
+// DBC handles type tests differently from all other architectures due
+// to its interpreted nature.
 #if !defined(TARGET_ARCH_DBC)
   // Type checking helper methods.
   void CheckClassIds(Register class_id_reg,
@@ -741,9 +706,9 @@
     return stackmap_table_builder_;
   }
 
-  // TODO(vegorov) re-enable frame state tracking on DBC. It is
-  // currently disabled because it relies on LocationSummaries and
-  // we don't use them during unoptimized compilation on DBC.
+// TODO(vegorov) re-enable frame state tracking on DBC. It is
+// currently disabled because it relies on LocationSummaries and
+// we don't use them during unoptimized compilation on DBC.
 #if defined(DEBUG) && !defined(TARGET_ARCH_DBC)
   void FrameStateUpdateWith(Instruction* instr);
   void FrameStatePush(Definition* defn);
@@ -819,9 +784,6 @@
   // In future AddDeoptStub should be moved out of the instruction template.
   Environment* pending_deoptimization_env_;
 
-  intptr_t lazy_deopt_return_pc_offset_;
-  intptr_t lazy_deopt_throw_pc_offset_;
-
   ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data_;
 
   Array& edge_counters_array_;
@@ -836,4 +798,4 @@
 
 }  // namespace dart
 
-#endif  // VM_FLOW_GRAPH_COMPILER_H_
+#endif  // RUNTIME_VM_FLOW_GRAPH_COMPILER_H_
diff --git a/runtime/vm/flow_graph_compiler_arm.cc b/runtime/vm/flow_graph_compiler_arm.cc
index 0b7fd3d..4e61306 100644
--- a/runtime/vm/flow_graph_compiler_arm.cc
+++ b/runtime/vm/flow_graph_compiler_arm.cc
@@ -29,18 +29,6 @@
 DECLARE_FLAG(bool, enable_simd_inline);
 
 
-void MegamorphicSlowPath::EmitNativeCode(FlowGraphCompiler* compiler) {
-  Assembler* assembler = compiler->assembler();
-#define __ assembler->
-  __ Bind(entry_label());
-  __ Comment("MegamorphicSlowPath");
-  compiler->EmitMegamorphicInstanceCall(ic_data_, argument_count_, deopt_id_,
-                                        token_pos_, locs_, try_index_);
-  __ b(exit_label());
-#undef __
-}
-
-
 FlowGraphCompiler::~FlowGraphCompiler() {
   // BlockInfos are zone-allocated, so their destructors are not called.
   // Verify the labels explicitly here.
@@ -130,8 +118,7 @@
 
   // For the innermost environment, set outgoing arguments and the locals.
   for (intptr_t i = current->Length() - 1;
-       i >= current->fixed_parameter_count();
-       i--) {
+       i >= current->fixed_parameter_count(); i--) {
     builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++);
   }
 
@@ -144,26 +131,21 @@
 
     // For any outer environment the deopt id is that of the call instruction
     // which is recorded in the outer environment.
-    builder->AddReturnAddress(
-        current->function(),
-        Thread::ToDeoptAfter(current->deopt_id()),
-        slot_ix++);
+    builder->AddReturnAddress(current->function(),
+                              Thread::ToDeoptAfter(current->deopt_id()),
+                              slot_ix++);
 
     // The values of outgoing arguments can be changed from the inlined call so
     // we must read them from the previous environment.
     for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) {
-      builder->AddCopy(previous->ValueAt(i),
-                       previous->LocationAt(i),
+      builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i),
                        slot_ix++);
     }
 
     // Set the locals, note that outgoing arguments are not in the environment.
     for (intptr_t i = current->Length() - 1;
-         i >= current->fixed_parameter_count();
-         i--) {
-      builder->AddCopy(current->ValueAt(i),
-                       current->LocationAt(i),
-                       slot_ix++);
+         i >= current->fixed_parameter_count(); i--) {
+      builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++);
     }
 
     // Iterate on the outer environment.
@@ -300,7 +282,7 @@
     const TypeArguments& type_arguments =
         TypeArguments::ZoneHandle(zone(), type.arguments());
     const bool is_raw_type = type_arguments.IsNull() ||
-        type_arguments.IsRaw(from_index, num_type_params);
+                             type_arguments.IsRaw(from_index, num_type_params);
     if (is_raw_type) {
       const Register kClassIdReg = R2;
       // dynamic type argument, check only classes.
@@ -316,8 +298,8 @@
     }
     // If one type argument only, check if type argument is Object or dynamic.
     if (type_arguments.Length() == 1) {
-      const AbstractType& tp_argument = AbstractType::ZoneHandle(
-          zone(), type_arguments.TypeAt(0));
+      const AbstractType& tp_argument =
+          AbstractType::ZoneHandle(zone(), type_arguments.TypeAt(0));
       ASSERT(!tp_argument.IsMalformed());
       if (tp_argument.IsType()) {
         ASSERT(tp_argument.HasResolvedTypeClass());
@@ -335,12 +317,9 @@
   const Register kTypeArgumentsReg = kNoRegister;
   const Register kTempReg = kNoRegister;
   // R0: instance (must be preserved).
-  return GenerateCallSubtypeTestStub(kTestTypeTwoArgs,
-                                     kInstanceReg,
-                                     kTypeArgumentsReg,
-                                     kTempReg,
-                                     is_instance_lbl,
-                                     is_not_instance_lbl);
+  return GenerateCallSubtypeTestStub(kTestTypeTwoArgs, kInstanceReg,
+                                     kTypeArgumentsReg, kTempReg,
+                                     is_instance_lbl, is_not_instance_lbl);
 }
 
 
@@ -379,11 +358,8 @@
   __ tst(kInstanceReg, Operand(kSmiTagMask));
   // If instance is Smi, check directly.
   const Class& smi_class = Class::Handle(zone(), Smi::Class());
-  if (smi_class.IsSubtypeOf(TypeArguments::Handle(zone()),
-                            type_class,
-                            TypeArguments::Handle(zone()),
-                            NULL,
-                            NULL,
+  if (smi_class.IsSubtypeOf(TypeArguments::Handle(zone()), type_class,
+                            TypeArguments::Handle(zone()), NULL, NULL,
                             Heap::kOld)) {
     __ b(is_instance_lbl, EQ);
   } else {
@@ -403,8 +379,8 @@
   // Custom checking for numbers (Smi, Mint, Bigint and Double).
   // Note that instance is not Smi (checked above).
   if (type.IsNumberType() || type.IsIntType() || type.IsDoubleType()) {
-    GenerateNumberTypeCheck(
-        kClassIdReg, type, is_instance_lbl, is_not_instance_lbl);
+    GenerateNumberTypeCheck(kClassIdReg, type, is_instance_lbl,
+                            is_not_instance_lbl);
     return false;
   }
   if (type.IsStringType()) {
@@ -451,12 +427,9 @@
 
   const Register kTypeArgumentsReg = kNoRegister;
   const Register kTempReg = kNoRegister;
-  return GenerateCallSubtypeTestStub(kTestTypeOneArg,
-                                     kInstanceReg,
-                                     kTypeArgumentsReg,
-                                     kTempReg,
-                                     is_instance_lbl,
-                                     is_not_instance_lbl);
+  return GenerateCallSubtypeTestStub(kTestTypeOneArg, kInstanceReg,
+                                     kTypeArgumentsReg, kTempReg,
+                                     is_instance_lbl, is_not_instance_lbl);
 }
 
 
@@ -479,7 +452,7 @@
     __ CompareObject(R1, Object::null_object());
     __ b(is_instance_lbl, EQ);
     __ ldr(R2,
-        FieldAddress(R1, TypeArguments::type_at_offset(type_param.index())));
+           FieldAddress(R1, TypeArguments::type_at_offset(type_param.index())));
     // R2: concrete type of type.
     // Check if type argument is dynamic.
     __ CompareObject(R2, Object::dynamic_type());
@@ -505,14 +478,10 @@
     const Register kInstanceReg = R0;
     const Register kTypeArgumentsReg = R1;
     const Register kTempReg = kNoRegister;
-    const SubtypeTestCache& type_test_cache =
-        SubtypeTestCache::ZoneHandle(zone(),
-            GenerateCallSubtypeTestStub(kTestTypeThreeArgs,
-                                        kInstanceReg,
-                                        kTypeArgumentsReg,
-                                        kTempReg,
-                                        is_instance_lbl,
-                                        is_not_instance_lbl));
+    const SubtypeTestCache& type_test_cache = SubtypeTestCache::ZoneHandle(
+        zone(), GenerateCallSubtypeTestStub(
+                    kTestTypeThreeArgs, kInstanceReg, kTypeArgumentsReg,
+                    kTempReg, is_instance_lbl, is_not_instance_lbl));
     __ Bind(&fall_through);
     return type_test_cache.raw();
   }
@@ -525,12 +494,9 @@
     // Uninstantiated type class is known at compile time, but the type
     // arguments are determined at runtime by the instantiator.
     const Register kTempReg = kNoRegister;
-    return GenerateCallSubtypeTestStub(kTestTypeThreeArgs,
-                                       kInstanceReg,
-                                       kTypeArgumentsReg,
-                                       kTempReg,
-                                       is_instance_lbl,
-                                       is_not_instance_lbl);
+    return GenerateCallSubtypeTestStub(kTestTypeThreeArgs, kInstanceReg,
+                                       kTypeArgumentsReg, kTempReg,
+                                       is_instance_lbl, is_not_instance_lbl);
   }
   return SubtypeTestCache::null();
 }
@@ -562,17 +528,12 @@
     // function type) of a non-parameterized class or with a raw dst type of
     // a parameterized class.
     if (type.IsFunctionType() || (type_class.NumTypeArguments() > 0)) {
-      return GenerateInstantiatedTypeWithArgumentsTest(token_pos,
-                                                       type,
-                                                       is_instance_lbl,
-                                                       is_not_instance_lbl);
+      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);
+    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.
@@ -582,9 +543,7 @@
       return SubtypeTestCache::null();
     }
   }
-  return GenerateUninstantiatedTypeTest(token_pos,
-                                        type,
-                                        is_instance_lbl,
+  return GenerateUninstantiatedTypeTest(token_pos, type, is_instance_lbl,
                                         is_not_instance_lbl);
 }
 
@@ -626,8 +585,8 @@
 
   // Generate inline instanceof test.
   SubtypeTestCache& test_cache = SubtypeTestCache::ZoneHandle(zone());
-  test_cache = GenerateInlineInstanceof(token_pos, type,
-                                        &is_instance, &is_not_instance);
+  test_cache =
+      GenerateInlineInstanceof(token_pos, type, &is_instance, &is_not_instance);
 
   // test_cache is null if there is no fall-through.
   Label done;
@@ -636,8 +595,8 @@
     // Load instantiator type arguments (R1).
     __ ldr(R1, Address(SP, 0 * kWordSize));
     __ PushObject(Object::null_object());  // Make room for the result.
-    __ Push(R0);  // Push the instance.
-    __ PushObject(type);  // Push the type.
+    __ Push(R0);                           // Push the instance.
+    __ PushObject(type);                   // Push the type.
     __ Push(R1);  // Push instantiator type arguments (R1).
     __ LoadUniqueObject(R0, test_cache);
     __ Push(R0);
@@ -700,13 +659,10 @@
   // Generate throw new TypeError() if the type is malformed or malbounded.
   if (dst_type.IsMalformedOrMalbounded()) {
     __ PushObject(Object::null_object());  // Make room for the result.
-    __ Push(R0);  // Push the source object.
-    __ PushObject(dst_name);  // Push the name of the destination.
-    __ PushObject(dst_type);  // Push the type of the destination.
-    GenerateRuntimeCall(token_pos,
-                        deopt_id,
-                        kBadTypeErrorRuntimeEntry,
-                        3,
+    __ Push(R0);                           // Push the source object.
+    __ PushObject(dst_name);               // Push the name of the destination.
+    __ PushObject(dst_type);               // Push the type of the destination.
+    GenerateRuntimeCall(token_pos, deopt_id, kBadTypeErrorRuntimeEntry, 3,
                         locs);
     // We should never return here.
     __ bkpt(0);
@@ -719,16 +675,16 @@
 
   // Generate inline type check, linking to runtime call if not assignable.
   SubtypeTestCache& test_cache = SubtypeTestCache::ZoneHandle(zone());
-  test_cache = GenerateInlineInstanceof(token_pos, dst_type,
-                                        &is_assignable, &runtime_call);
+  test_cache = GenerateInlineInstanceof(token_pos, dst_type, &is_assignable,
+                                        &runtime_call);
 
   __ Bind(&runtime_call);
   // Load instantiator type arguments (R1).
   __ ldr(R1, Address(SP, 0 * kWordSize));
   __ PushObject(Object::null_object());  // Make room for the result.
-  __ Push(R0);  // Push the source object.
-  __ PushObject(dst_type);  // Push the type of the destination.
-  __ Push(R1);  // Push instantiator type arguments (R1).
+  __ Push(R0);                           // Push the source object.
+  __ PushObject(dst_type);               // Push the type of the destination.
+  __ Push(R1);              // Push instantiator type arguments (R1).
   __ PushObject(dst_name);  // Push the name of the destination.
   __ LoadUniqueObject(R0, test_cache);
   __ Push(R0);
@@ -817,9 +773,9 @@
   // Copy or initialize optional named arguments.
   Label all_arguments_processed;
 #ifdef DEBUG
-    const bool check_correct_named_args = true;
+  const bool check_correct_named_args = true;
 #else
-    const bool check_correct_named_args = function.IsClosureFunction();
+  const bool check_correct_named_args = function.IsClosureFunction();
 #endif
   if (num_opt_named_params > 0) {
     // Start by alphabetically sorting the names of the optional parameters.
@@ -842,16 +798,13 @@
     }
     // Generate code handling each optional parameter in alphabetical order.
     __ ldr(NOTFP, FieldAddress(R4, ArgumentsDescriptor::count_offset()));
-    __ ldr(R6,
-           FieldAddress(R4, ArgumentsDescriptor::positional_count_offset()));
-    __ SmiUntag(R6);
     // Let NOTFP point to the first passed argument, i.e. to
     // fp[kParamEndSlotFromFp + num_args - 0]; num_args (NOTFP) is Smi.
     __ add(NOTFP, FP, Operand(NOTFP, LSL, 1));
     __ AddImmediate(NOTFP, NOTFP, kParamEndSlotFromFp * kWordSize);
     // Let R8 point to the entry of the first named argument.
-    __ add(R8, R4, Operand(
-        ArgumentsDescriptor::first_named_entry_offset() - kHeapObjectTag));
+    __ add(R8, R4, Operand(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];
@@ -990,8 +943,7 @@
 
 void FlowGraphCompiler::EmitFrameEntry() {
   const Function& function = parsed_function().function();
-  if (CanOptimizeFunction() &&
-      function.IsOptimizable() &&
+  if (CanOptimizeFunction() && function.IsOptimizable() &&
       (!is_optimizing() || may_reoptimize())) {
     __ Comment("Invocation Count Check");
     const Register function_reg = R8;
@@ -1001,14 +953,12 @@
     // Load function object from object pool.
     __ LoadFunctionFromCalleePool(function_reg, function, new_pp);
 
-    __ ldr(R3, FieldAddress(function_reg,
-                            Function::usage_counter_offset()));
+    __ ldr(R3, FieldAddress(function_reg, Function::usage_counter_offset()));
     // Reoptimization of an optimized function is triggered by counting in
     // IC stubs, but not at the entry of the function.
     if (!is_optimizing()) {
       __ add(R3, R3, Operand(1));
-      __ str(R3, FieldAddress(function_reg,
-                              Function::usage_counter_offset()));
+      __ str(R3, FieldAddress(function_reg, Function::usage_counter_offset()));
     }
     __ CompareImmediate(R3, GetOptimizationThreshold());
     ASSERT(function_reg == R8);
@@ -1016,9 +966,8 @@
   }
   __ Comment("Enter frame");
   if (flow_graph().IsCompiledForOsr()) {
-    intptr_t extra_slots = StackSize()
-        - flow_graph().num_stack_locals()
-        - flow_graph().num_copied_params();
+    intptr_t extra_slots = StackSize() - flow_graph().num_stack_locals() -
+                           flow_graph().num_copied_params();
     ASSERT(extra_slots >= 0);
     __ EnterOsrFrame(extra_slots * kWordSize);
   } else {
@@ -1037,6 +986,13 @@
 //   R4: arguments descriptor array.
 void FlowGraphCompiler::CompileGraph() {
   InitCompiler();
+  const Function& function = parsed_function().function();
+
+#ifdef DART_PRECOMPILER
+  if (function.IsDynamicFunction()) {
+    __ MonomorphicCheckedEntry();
+  }
+#endif  // DART_PRECOMPILER
 
   if (TryIntrinsify()) {
     // Skip regular code generation.
@@ -1046,8 +1002,6 @@
   EmitFrameEntry();
   ASSERT(assembler()->constant_pool_allowed());
 
-  const Function& function = parsed_function().function();
-
   const int num_fixed_params = function.num_fixed_parameters();
   const int num_copied_params = parsed_function().num_copied_params();
   const int num_locals = parsed_function().num_stack_locals();
@@ -1066,8 +1020,8 @@
       __ ldr(R0, FieldAddress(R4, ArgumentsDescriptor::count_offset()));
       __ CompareImmediate(R0, Smi::RawValue(num_fixed_params));
       __ b(&wrong_num_arguments, NE);
-      __ ldr(R1, FieldAddress(R4,
-                              ArgumentsDescriptor::positional_count_offset()));
+      __ ldr(R1,
+             FieldAddress(R4, ArgumentsDescriptor::positional_count_offset()));
       __ cmp(R0, Operand(R1));
       __ b(&correct_num_arguments, EQ);
       __ Bind(&wrong_num_arguments);
@@ -1124,21 +1078,6 @@
   __ bkpt(0);
   ASSERT(assembler()->constant_pool_allowed());
   GenerateDeferredCode();
-
-  BeginCodeSourceRange();
-  if (is_optimizing() && !FLAG_precompiled_mode) {
-    // Leave enough space for patching in case of lazy deoptimization.
-    for (intptr_t i = 0;
-         i < CallPattern::DeoptCallPatternLengthInInstructions();
-         ++i) {
-      __ nop();
-    }
-    lazy_deopt_return_pc_offset_ = assembler()->CodeSize();
-    __ Branch(*StubCode::DeoptimizeLazyFromReturn_entry());
-    lazy_deopt_throw_pc_offset_ = assembler()->CodeSize();
-    __ Branch(*StubCode::DeoptimizeLazyFromThrow_entry());
-  }
-  EndCodeSourceRange(TokenPosition::kDartCodeEpilogue);
 }
 
 
@@ -1146,6 +1085,16 @@
                                      const StubEntry& stub_entry,
                                      RawPcDescriptors::Kind kind,
                                      LocationSummary* locs) {
+  __ BranchLink(stub_entry);
+  AddCurrentDescriptor(kind, Thread::kNoDeoptId, token_pos);
+  RecordSafepoint(locs);
+}
+
+
+void FlowGraphCompiler::GeneratePatchableCall(TokenPosition token_pos,
+                                              const StubEntry& stub_entry,
+                                              RawPcDescriptors::Kind kind,
+                                              LocationSummary* locs) {
   __ BranchLinkPatchable(stub_entry);
   AddCurrentDescriptor(kind, Thread::kNoDeoptId, token_pos);
   RecordSafepoint(locs);
@@ -1168,8 +1117,7 @@
   } else {
     // Add deoptimization continuation point after the call and before the
     // arguments are removed.
-    AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-        deopt_id_after, token_pos);
+    AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
   }
 }
 
@@ -1196,8 +1144,7 @@
   } else {
     // Add deoptimization continuation point after the call and before the
     // arguments are removed.
-    AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-        deopt_id_after, token_pos);
+    AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
   }
   AddStaticCallTarget(target);
 }
@@ -1220,9 +1167,7 @@
     } else {
       // Add deoptimization continuation point after the call and before the
       // arguments are removed.
-      AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                           deopt_id_after,
-                           token_pos);
+      AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
     }
   }
 }
@@ -1251,13 +1196,12 @@
 }
 
 
-void FlowGraphCompiler::EmitOptimizedInstanceCall(
-    const StubEntry& stub_entry,
-    const ICData& ic_data,
-    intptr_t argument_count,
-    intptr_t deopt_id,
-    TokenPosition token_pos,
-    LocationSummary* locs) {
+void FlowGraphCompiler::EmitOptimizedInstanceCall(const StubEntry& stub_entry,
+                                                  const ICData& ic_data,
+                                                  intptr_t argument_count,
+                                                  intptr_t deopt_id,
+                                                  TokenPosition token_pos,
+                                                  LocationSummary* locs) {
   ASSERT(Array::Handle(zone(), ic_data.arguments_descriptor()).Length() > 0);
   // Each ICData propagated from unoptimized to optimized code contains the
   // function that corresponds to the Dart function of that IC call. Due
@@ -1268,10 +1212,7 @@
 
   __ LoadObject(R8, parsed_function().function());
   __ LoadUniqueObject(R9, ic_data);
-  GenerateDartCall(deopt_id,
-                   token_pos,
-                   stub_entry,
-                   RawPcDescriptors::kIcCall,
+  GenerateDartCall(deopt_id, token_pos, stub_entry, RawPcDescriptors::kIcCall,
                    locs);
   __ Drop(argument_count);
 }
@@ -1285,10 +1226,7 @@
                                          LocationSummary* locs) {
   ASSERT(Array::Handle(zone(), ic_data.arguments_descriptor()).Length() > 0);
   __ LoadUniqueObject(R9, ic_data);
-  GenerateDartCall(deopt_id,
-                   token_pos,
-                   stub_entry,
-                   RawPcDescriptors::kIcCall,
+  GenerateDartCall(deopt_id, token_pos, stub_entry, RawPcDescriptors::kIcCall,
                    locs);
   __ Drop(argument_count);
 }
@@ -1306,7 +1244,8 @@
   const Array& arguments_descriptor =
       Array::ZoneHandle(zone(), ic_data.arguments_descriptor());
   ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0));
-  const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(),
+  const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(
+      zone(),
       MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor));
 
   __ Comment("MegamorphicCall");
@@ -1328,7 +1267,7 @@
     ASSERT(Smi::New(0) == 0);
     __ cmp(R0, Operand(0));
 
-    __ b(&done, NE);  // Return if already computed.
+    __ b(&done, NE);          // Return if already computed.
     __ mov(R0, Operand(R9));  // Restore receiver in R0.
 
     __ Bind(&megamorphic_call);
@@ -1347,43 +1286,39 @@
     if (try_index == CatchClauseNode::kInvalidTryIndex) {
       try_index = CurrentTryIndex();
     }
-    pc_descriptors_list()->AddDescriptor(RawPcDescriptors::kOther,
-                                         assembler()->CodeSize(),
-                                         Thread::kNoDeoptId,
-                                         token_pos,
-                                         try_index);
+    pc_descriptors_list()->AddDescriptor(
+        RawPcDescriptors::kOther, assembler()->CodeSize(), Thread::kNoDeoptId,
+        token_pos, try_index);
   } else if (is_optimizing()) {
-    AddCurrentDescriptor(RawPcDescriptors::kOther,
-                         Thread::kNoDeoptId, token_pos);
+    AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId,
+                         token_pos);
     AddDeoptIndexAtCall(deopt_id_after);
   } else {
-    AddCurrentDescriptor(RawPcDescriptors::kOther,
-        Thread::kNoDeoptId, token_pos);
+    AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId,
+                         token_pos);
     // Add deoptimization continuation point after the call and before the
     // arguments are removed.
-    AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-        deopt_id_after, token_pos);
+    AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
   }
   __ Drop(argument_count);
 }
 
 
-void FlowGraphCompiler::EmitSwitchableInstanceCall(
-    const ICData& ic_data,
-    intptr_t argument_count,
-    intptr_t deopt_id,
-    TokenPosition token_pos,
-    LocationSummary* locs) {
+void FlowGraphCompiler::EmitSwitchableInstanceCall(const ICData& ic_data,
+                                                   intptr_t argument_count,
+                                                   intptr_t deopt_id,
+                                                   TokenPosition token_pos,
+                                                   LocationSummary* locs) {
   ASSERT(ic_data.NumArgsTested() == 1);
-  const Code& initial_stub = Code::ZoneHandle(
-      StubCode::ICCallThroughFunction_entry()->code());
+  const Code& initial_stub =
+      Code::ZoneHandle(StubCode::ICCallThroughFunction_entry()->code());
 
   __ Comment("SwitchableCall");
 
   __ LoadFromOffset(kWord, R0, SP, (argument_count - 1) * kWordSize);
-  __ LoadUniqueObject(R9, ic_data);
   __ LoadUniqueObject(CODE_REG, initial_stub);
   __ ldr(LR, FieldAddress(CODE_REG, Code::checked_entry_point_offset()));
+  __ LoadUniqueObject(R9, ic_data);
   __ blx(LR);
 
   AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, token_pos);
@@ -1394,27 +1329,22 @@
   } else {
     // Add deoptimization continuation point after the call and before the
     // arguments are removed.
-    AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-        deopt_id_after, token_pos);
+    AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
   }
   __ Drop(argument_count);
 }
 
 
-void FlowGraphCompiler::EmitUnoptimizedStaticCall(
-    intptr_t argument_count,
-    intptr_t deopt_id,
-    TokenPosition token_pos,
-    LocationSummary* locs,
-    const ICData& ic_data) {
+void FlowGraphCompiler::EmitUnoptimizedStaticCall(intptr_t argument_count,
+                                                  intptr_t deopt_id,
+                                                  TokenPosition token_pos,
+                                                  LocationSummary* locs,
+                                                  const ICData& ic_data) {
   const StubEntry* stub_entry =
       StubCode::UnoptimizedStaticCallEntry(ic_data.NumArgsTested());
   __ LoadObject(R9, ic_data);
-  GenerateDartCall(deopt_id,
-                   token_pos,
-                   *stub_entry,
-                   RawPcDescriptors::kUnoptStaticCall,
-                   locs);
+  GenerateDartCall(deopt_id, token_pos, *stub_entry,
+                   RawPcDescriptors::kUnoptStaticCall, locs);
   __ Drop(argument_count);
 }
 
@@ -1434,12 +1364,9 @@
   }
   // 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.
-  GenerateStaticDartCall(deopt_id,
-                         token_pos,
+  GenerateStaticDartCall(deopt_id, token_pos,
                          *StubCode::CallStaticFunction_entry(),
-                         RawPcDescriptors::kOther,
-                         locs,
-                         function);
+                         RawPcDescriptors::kOther, locs, function);
   __ Drop(argument_count);
 }
 
@@ -1461,12 +1388,11 @@
           *StubCode::UnoptimizedIdenticalWithNumberCheck_entry());
     }
     if (token_pos.IsReal()) {
-      AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
-                           Thread::kNoDeoptId,
+      AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, Thread::kNoDeoptId,
                            token_pos);
     }
     // Stub returns result in flags (result of a cmp, we need Z computed).
-    __ Drop(1);  // Discard constant.
+    __ Drop(1);   // Discard constant.
     __ Pop(reg);  // Restore 'reg'.
   } else {
     __ CompareObject(reg, obj);
@@ -1491,8 +1417,7 @@
           *StubCode::UnoptimizedIdenticalWithNumberCheck_entry());
     }
     if (token_pos.IsReal()) {
-      AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
-                           Thread::kNoDeoptId,
+      AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, Thread::kNoDeoptId,
                            token_pos);
     }
     // Stub returns result in flags (result of a cmp, we need Z computed).
@@ -1609,9 +1534,8 @@
                                         bool complete) {
   ASSERT(is_optimizing());
   __ Comment("EmitTestAndCall");
-  const Array& arguments_descriptor =
-      Array::ZoneHandle(zone(), ArgumentsDescriptor::New(argument_count,
-                                                         argument_names));
+  const Array& arguments_descriptor = Array::ZoneHandle(
+      zone(), ArgumentsDescriptor::New(argument_count, argument_names));
 
   // Load receiver into R0.
   __ LoadFromOffset(kWord, R0, SP, (argument_count - 1) * kWordSize);
@@ -1633,14 +1557,11 @@
     }
     // 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.
-    const Function& function = Function::ZoneHandle(
-        zone(), ic_data.GetTargetAt(0));
-    GenerateStaticDartCall(deopt_id,
-                           token_index,
+    const Function& function =
+        Function::ZoneHandle(zone(), ic_data.GetTargetAt(0));
+    GenerateStaticDartCall(deopt_id, token_index,
                            *StubCode::CallStaticFunction_entry(),
-                           RawPcDescriptors::kOther,
-                           locs,
-                           function);
+                           RawPcDescriptors::kOther, locs, function);
     __ Drop(argument_count);
     if (kNumChecks > 1) {
       __ b(match_found);
@@ -1686,12 +1607,9 @@
     // 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.
     const Function& function = *sorted[i].target;
-    GenerateStaticDartCall(deopt_id,
-                           token_index,
+    GenerateStaticDartCall(deopt_id, token_index,
                            *StubCode::CallStaticFunction_entry(),
-                           RawPcDescriptors::kOther,
-                           locs,
-                           function);
+                           RawPcDescriptors::kOther, locs, function);
     __ Drop(argument_count);
     if (!kIsLastCheck) {
       __ b(match_found);
@@ -1716,14 +1634,14 @@
     } else {
       ASSERT(destination.IsStackSlot());
       const intptr_t dest_offset = destination.ToStackSlotOffset();
-      __ StoreToOffset(
-          kWord, source.reg(), destination.base_reg(), dest_offset);
+      __ StoreToOffset(kWord, source.reg(), destination.base_reg(),
+                       dest_offset);
     }
   } else if (source.IsStackSlot()) {
     if (destination.IsRegister()) {
       const intptr_t source_offset = source.ToStackSlotOffset();
-      __ LoadFromOffset(
-          kWord, destination.reg(), source.base_reg(), source_offset);
+      __ LoadFromOffset(kWord, destination.reg(), source.base_reg(),
+                        source_offset);
     } else {
       ASSERT(destination.IsStackSlot());
       const intptr_t source_offset = source.ToStackSlotOffset();
@@ -1750,8 +1668,8 @@
         ASSERT(destination.IsQuadStackSlot());
         const intptr_t dest_offset = destination.ToStackSlotOffset();
         const DRegister dsrc0 = EvenDRegisterOf(source.fpu_reg());
-        __ StoreMultipleDToOffset(
-            dsrc0, 2, destination.base_reg(), dest_offset);
+        __ StoreMultipleDToOffset(dsrc0, 2, destination.base_reg(),
+                                  dest_offset);
       }
     }
   } else if (source.IsDoubleStackSlot()) {
@@ -1838,11 +1756,10 @@
     __ mov(source.reg(), Operand(destination.reg()));
     __ mov(destination.reg(), Operand(IP));
   } else if (source.IsRegister() && destination.IsStackSlot()) {
-    Exchange(source.reg(),
-             destination.base_reg(), destination.ToStackSlotOffset());
+    Exchange(source.reg(), destination.base_reg(),
+             destination.ToStackSlotOffset());
   } else if (source.IsStackSlot() && destination.IsRegister()) {
-    Exchange(destination.reg(),
-             source.base_reg(), source.ToStackSlotOffset());
+    Exchange(destination.reg(), source.base_reg(), source.ToStackSlotOffset());
   } else if (source.IsStackSlot() && destination.IsStackSlot()) {
     Exchange(source.base_reg(), source.ToStackSlotOffset(),
              destination.base_reg(), destination.ToStackSlotOffset());
@@ -1861,21 +1778,18 @@
       __ vmovd(dst, DTMP);
     }
   } else if (source.IsFpuRegister() || destination.IsFpuRegister()) {
-    ASSERT(destination.IsDoubleStackSlot() ||
-           destination.IsQuadStackSlot() ||
-           source.IsDoubleStackSlot() ||
-           source.IsQuadStackSlot());
-    bool double_width = destination.IsDoubleStackSlot() ||
-                        source.IsDoubleStackSlot();
-    QRegister qreg = source.IsFpuRegister() ? source.fpu_reg()
-                                            : destination.fpu_reg();
+    ASSERT(destination.IsDoubleStackSlot() || destination.IsQuadStackSlot() ||
+           source.IsDoubleStackSlot() || source.IsQuadStackSlot());
+    bool double_width =
+        destination.IsDoubleStackSlot() || source.IsDoubleStackSlot();
+    QRegister qreg =
+        source.IsFpuRegister() ? source.fpu_reg() : destination.fpu_reg();
     DRegister reg = EvenDRegisterOf(qreg);
-    Register base_reg = source.IsFpuRegister()
-        ? destination.base_reg()
-        : source.base_reg();
+    Register base_reg =
+        source.IsFpuRegister() ? destination.base_reg() : source.base_reg();
     const intptr_t slot_offset = source.IsFpuRegister()
-        ? destination.ToStackSlotOffset()
-        : source.ToStackSlotOffset();
+                                     ? destination.ToStackSlotOffset()
+                                     : source.ToStackSlotOffset();
 
     if (double_width) {
       __ LoadDFromOffset(DTMP, base_reg, slot_offset);
@@ -1905,8 +1819,8 @@
     __ LoadMultipleDFromOffset(DTMP, 2, source.base_reg(), source_offset);
     __ LoadMultipleDFromOffset(scratch, 2, destination.base_reg(), dest_offset);
     __ StoreMultipleDToOffset(DTMP, 2, destination.base_reg(), dest_offset);
-    __ StoreMultipleDToOffset(
-        scratch, 2, destination.base_reg(), source_offset);
+    __ StoreMultipleDToOffset(scratch, 2, destination.base_reg(),
+                              source_offset);
   } else {
     UNREACHABLE();
   }
diff --git a/runtime/vm/flow_graph_compiler_arm64.cc b/runtime/vm/flow_graph_compiler_arm64.cc
index 10ff57f..85c0a76f 100644
--- a/runtime/vm/flow_graph_compiler_arm64.cc
+++ b/runtime/vm/flow_graph_compiler_arm64.cc
@@ -27,18 +27,6 @@
 DECLARE_FLAG(bool, enable_simd_inline);
 
 
-void MegamorphicSlowPath::EmitNativeCode(FlowGraphCompiler* compiler) {
-  Assembler* assembler = compiler->assembler();
-#define __ assembler->
-  __ Bind(entry_label());
-  __ Comment("MegamorphicSlowPath");
-  compiler->EmitMegamorphicInstanceCall(ic_data_, argument_count_, deopt_id_,
-                                        token_pos_, locs_, try_index_);
-  __ b(exit_label());
-#undef __
-}
-
-
 FlowGraphCompiler::~FlowGraphCompiler() {
   // BlockInfos are zone-allocated, so their destructors are not called.
   // Verify the labels explicitly here.
@@ -128,8 +116,7 @@
 
   // For the innermost environment, set outgoing arguments and the locals.
   for (intptr_t i = current->Length() - 1;
-       i >= current->fixed_parameter_count();
-       i--) {
+       i >= current->fixed_parameter_count(); i--) {
     builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++);
   }
 
@@ -142,26 +129,21 @@
 
     // For any outer environment the deopt id is that of the call instruction
     // which is recorded in the outer environment.
-    builder->AddReturnAddress(
-        current->function(),
-        Thread::ToDeoptAfter(current->deopt_id()),
-        slot_ix++);
+    builder->AddReturnAddress(current->function(),
+                              Thread::ToDeoptAfter(current->deopt_id()),
+                              slot_ix++);
 
     // The values of outgoing arguments can be changed from the inlined call so
     // we must read them from the previous environment.
     for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) {
-      builder->AddCopy(previous->ValueAt(i),
-                       previous->LocationAt(i),
+      builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i),
                        slot_ix++);
     }
 
     // Set the locals, note that outgoing arguments are not in the environment.
     for (intptr_t i = current->Length() - 1;
-         i >= current->fixed_parameter_count();
-         i--) {
-      builder->AddCopy(current->ValueAt(i),
-                       current->LocationAt(i),
-                       slot_ix++);
+         i >= current->fixed_parameter_count(); i--) {
+      builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++);
     }
 
     // Iterate on the outer environment.
@@ -293,7 +275,7 @@
     const TypeArguments& type_arguments =
         TypeArguments::ZoneHandle(zone(), type.arguments());
     const bool is_raw_type = type_arguments.IsNull() ||
-        type_arguments.IsRaw(from_index, num_type_params);
+                             type_arguments.IsRaw(from_index, num_type_params);
     if (is_raw_type) {
       const Register kClassIdReg = R2;
       // dynamic type argument, check only classes.
@@ -309,8 +291,8 @@
     }
     // If one type argument only, check if type argument is Object or dynamic.
     if (type_arguments.Length() == 1) {
-      const AbstractType& tp_argument = AbstractType::ZoneHandle(
-          zone(), type_arguments.TypeAt(0));
+      const AbstractType& tp_argument =
+          AbstractType::ZoneHandle(zone(), type_arguments.TypeAt(0));
       ASSERT(!tp_argument.IsMalformed());
       if (tp_argument.IsType()) {
         ASSERT(tp_argument.HasResolvedTypeClass());
@@ -328,12 +310,9 @@
   const Register kTypeArgumentsReg = kNoRegister;
   const Register kTempReg = kNoRegister;
   // R0: instance (must be preserved).
-  return GenerateCallSubtypeTestStub(kTestTypeTwoArgs,
-                                     kInstanceReg,
-                                     kTypeArgumentsReg,
-                                     kTempReg,
-                                     is_instance_lbl,
-                                     is_not_instance_lbl);
+  return GenerateCallSubtypeTestStub(kTestTypeTwoArgs, kInstanceReg,
+                                     kTypeArgumentsReg, kTempReg,
+                                     is_instance_lbl, is_not_instance_lbl);
 }
 
 
@@ -372,11 +351,8 @@
   __ tsti(kInstanceReg, Immediate(kSmiTagMask));
   // If instance is Smi, check directly.
   const Class& smi_class = Class::Handle(zone(), Smi::Class());
-  if (smi_class.IsSubtypeOf(TypeArguments::Handle(zone()),
-                            type_class,
-                            TypeArguments::Handle(zone()),
-                            NULL,
-                            NULL,
+  if (smi_class.IsSubtypeOf(TypeArguments::Handle(zone()), type_class,
+                            TypeArguments::Handle(zone()), NULL, NULL,
                             Heap::kOld)) {
     __ b(is_instance_lbl, EQ);
   } else {
@@ -396,8 +372,8 @@
   // Custom checking for numbers (Smi, Mint, Bigint and Double).
   // Note that instance is not Smi (checked above).
   if (type.IsNumberType() || type.IsIntType() || type.IsDoubleType()) {
-    GenerateNumberTypeCheck(
-        kClassIdReg, type, is_instance_lbl, is_not_instance_lbl);
+    GenerateNumberTypeCheck(kClassIdReg, type, is_instance_lbl,
+                            is_not_instance_lbl);
     return false;
   }
   if (type.IsStringType()) {
@@ -444,12 +420,9 @@
 
   const Register kTypeArgumentsReg = kNoRegister;
   const Register kTempReg = kNoRegister;
-  return GenerateCallSubtypeTestStub(kTestTypeOneArg,
-                                     kInstanceReg,
-                                     kTypeArgumentsReg,
-                                     kTempReg,
-                                     is_instance_lbl,
-                                     is_not_instance_lbl);
+  return GenerateCallSubtypeTestStub(kTestTypeOneArg, kInstanceReg,
+                                     kTypeArgumentsReg, kTempReg,
+                                     is_instance_lbl, is_not_instance_lbl);
 }
 
 
@@ -471,8 +444,8 @@
     // Check if type arguments are null, i.e. equivalent to vector of dynamic.
     __ CompareObject(R1, Object::null_object());
     __ b(is_instance_lbl, EQ);
-    __ LoadFieldFromOffset(
-        R2, R1, TypeArguments::type_at_offset(type_param.index()));
+    __ LoadFieldFromOffset(R2, R1,
+                           TypeArguments::type_at_offset(type_param.index()));
     // R2: concrete type of type.
     // Check if type argument is dynamic.
     __ CompareObject(R2, Object::dynamic_type());
@@ -498,14 +471,10 @@
     const Register kInstanceReg = R0;
     const Register kTypeArgumentsReg = R1;
     const Register kTempReg = kNoRegister;
-    const SubtypeTestCache& type_test_cache =
-        SubtypeTestCache::ZoneHandle(zone(),
-            GenerateCallSubtypeTestStub(kTestTypeThreeArgs,
-                                        kInstanceReg,
-                                        kTypeArgumentsReg,
-                                        kTempReg,
-                                        is_instance_lbl,
-                                        is_not_instance_lbl));
+    const SubtypeTestCache& type_test_cache = SubtypeTestCache::ZoneHandle(
+        zone(), GenerateCallSubtypeTestStub(
+                    kTestTypeThreeArgs, kInstanceReg, kTypeArgumentsReg,
+                    kTempReg, is_instance_lbl, is_not_instance_lbl));
     __ Bind(&fall_through);
     return type_test_cache.raw();
   }
@@ -518,12 +487,9 @@
     // Uninstantiated type class is known at compile time, but the type
     // arguments are determined at runtime by the instantiator.
     const Register kTempReg = kNoRegister;
-    return GenerateCallSubtypeTestStub(kTestTypeThreeArgs,
-                                       kInstanceReg,
-                                       kTypeArgumentsReg,
-                                       kTempReg,
-                                       is_instance_lbl,
-                                       is_not_instance_lbl);
+    return GenerateCallSubtypeTestStub(kTestTypeThreeArgs, kInstanceReg,
+                                       kTypeArgumentsReg, kTempReg,
+                                       is_instance_lbl, is_not_instance_lbl);
   }
   return SubtypeTestCache::null();
 }
@@ -555,17 +521,12 @@
     // function type) of a non-parameterized class or with a raw dst type of
     // a parameterized class.
     if (type.IsFunctionType() || (type_class.NumTypeArguments() > 0)) {
-      return GenerateInstantiatedTypeWithArgumentsTest(token_pos,
-                                                       type,
-                                                       is_instance_lbl,
-                                                       is_not_instance_lbl);
+      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);
+    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.
@@ -575,9 +536,7 @@
       return SubtypeTestCache::null();
     }
   }
-  return GenerateUninstantiatedTypeTest(token_pos,
-                                        type,
-                                        is_instance_lbl,
+  return GenerateUninstantiatedTypeTest(token_pos, type, is_instance_lbl,
                                         is_not_instance_lbl);
 }
 
@@ -619,8 +578,8 @@
 
   // Generate inline instanceof test.
   SubtypeTestCache& test_cache = SubtypeTestCache::ZoneHandle(zone());
-  test_cache = GenerateInlineInstanceof(token_pos, type,
-                                        &is_instance, &is_not_instance);
+  test_cache =
+      GenerateInlineInstanceof(token_pos, type, &is_instance, &is_not_instance);
 
   // test_cache is null if there is no fall-through.
   Label done;
@@ -629,8 +588,8 @@
     // Load instantiator (R2) and its type arguments (R1).
     __ ldr(R1, Address(SP, 0 * kWordSize));
     __ PushObject(Object::null_object());  // Make room for the result.
-    __ Push(R0);  // Push the instance.
-    __ PushObject(type);  // Push the type.
+    __ Push(R0);                           // Push the instance.
+    __ PushObject(type);                   // Push the type.
     __ Push(R1);  // Push instantiator type arguments (R1).
     __ LoadUniqueObject(R0, test_cache);
     __ Push(R0);
@@ -693,13 +652,10 @@
   // Generate throw new TypeError() if the type is malformed or malbounded.
   if (dst_type.IsMalformedOrMalbounded()) {
     __ PushObject(Object::null_object());  // Make room for the result.
-    __ Push(R0);  // Push the source object.
-    __ PushObject(dst_name);  // Push the name of the destination.
-    __ PushObject(dst_type);  // Push the type of the destination.
-    GenerateRuntimeCall(token_pos,
-                        deopt_id,
-                        kBadTypeErrorRuntimeEntry,
-                        3,
+    __ Push(R0);                           // Push the source object.
+    __ PushObject(dst_name);               // Push the name of the destination.
+    __ PushObject(dst_type);               // Push the type of the destination.
+    GenerateRuntimeCall(token_pos, deopt_id, kBadTypeErrorRuntimeEntry, 3,
                         locs);
     // We should never return here.
     __ brk(0);
@@ -712,15 +668,15 @@
 
   // Generate inline type check, linking to runtime call if not assignable.
   SubtypeTestCache& test_cache = SubtypeTestCache::ZoneHandle(zone());
-  test_cache = GenerateInlineInstanceof(token_pos, dst_type,
-                                        &is_assignable, &runtime_call);
+  test_cache = GenerateInlineInstanceof(token_pos, dst_type, &is_assignable,
+                                        &runtime_call);
 
   __ Bind(&runtime_call);
   __ ldr(R1, Address(SP));  // Load instantiator type arguments (R1).
   __ PushObject(Object::null_object());  // Make room for the result.
-  __ Push(R0);  // Push the source object.
-  __ PushObject(dst_type);  // Push the type of the destination.
-  __ Push(R1);  // Push instantiator type arguments (R1).
+  __ Push(R0);                           // Push the source object.
+  __ PushObject(dst_type);               // Push the type of the destination.
+  __ Push(R1);              // Push instantiator type arguments (R1).
   __ PushObject(dst_name);  // Push the name of the destination.
   __ LoadUniqueObject(R0, test_cache);
   __ Push(R0);
@@ -766,8 +722,8 @@
   const int min_num_pos_args = num_fixed_params;
   const int max_num_pos_args = num_fixed_params + num_opt_pos_params;
 
-  __ LoadFieldFromOffset(
-      R8, R4, ArgumentsDescriptor::positional_count_offset());
+  __ LoadFieldFromOffset(R8, R4,
+                         ArgumentsDescriptor::positional_count_offset());
   // Check that min_num_pos_args <= num_pos_args.
   Label wrong_num_arguments;
   __ CompareImmediate(R8, Smi::RawValue(min_num_pos_args));
@@ -810,9 +766,9 @@
   // Copy or initialize optional named arguments.
   Label all_arguments_processed;
 #ifdef DEBUG
-    const bool check_correct_named_args = true;
+  const bool check_correct_named_args = true;
 #else
-    const bool check_correct_named_args = function.IsClosureFunction();
+  const bool check_correct_named_args = function.IsClosureFunction();
 #endif
   if (num_opt_named_params > 0) {
     // Start by alphabetically sorting the names of the optional parameters.
@@ -835,16 +791,13 @@
     }
     // Generate code handling each optional parameter in alphabetical order.
     __ LoadFieldFromOffset(R7, R4, ArgumentsDescriptor::count_offset());
-    __ LoadFieldFromOffset(
-        R8, R4, ArgumentsDescriptor::positional_count_offset());
-    __ SmiUntag(R8);
     // Let R7 point to the first passed argument, i.e. to
     // fp[kParamEndSlotFromFp + num_args - 0]; num_args (R7) is Smi.
     __ add(R7, FP, Operand(R7, LSL, 2));
     __ AddImmediate(R7, R7, kParamEndSlotFromFp * kWordSize);
     // Let R6 point to the entry of the first named argument.
-    __ add(R6, R4, Operand(
-        ArgumentsDescriptor::first_named_entry_offset() - kHeapObjectTag));
+    __ add(R6, R4, Operand(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];
@@ -889,8 +842,8 @@
     }
   } else {
     ASSERT(num_opt_pos_params > 0);
-    __ LoadFieldFromOffset(
-        R8, R4, ArgumentsDescriptor::positional_count_offset());
+    __ LoadFieldFromOffset(R8, R4,
+                           ArgumentsDescriptor::positional_count_offset());
     __ SmiUntag(R8);
     for (int i = 0; i < num_opt_pos_params; i++) {
       Label next_parameter;
@@ -980,8 +933,7 @@
 void FlowGraphCompiler::EmitFrameEntry() {
   const Function& function = parsed_function().function();
   Register new_pp = kNoRegister;
-  if (CanOptimizeFunction() &&
-      function.IsOptimizable() &&
+  if (CanOptimizeFunction() && function.IsOptimizable() &&
       (!is_optimizing() || may_reoptimize())) {
     __ Comment("Invocation Count Check");
     const Register function_reg = R6;
@@ -993,14 +945,14 @@
     // Load function object using the callee's pool pointer.
     __ LoadFunctionFromCalleePool(function_reg, function, new_pp);
 
-    __ LoadFieldFromOffset(
-        R7, function_reg, Function::usage_counter_offset(), kWord);
+    __ LoadFieldFromOffset(R7, function_reg, Function::usage_counter_offset(),
+                           kWord);
     // Reoptimization of an optimized function is triggered by counting in
     // IC stubs, but not at the entry of the function.
     if (!is_optimizing()) {
       __ add(R7, R7, Operand(1));
-      __ StoreFieldToOffset(
-          R7, function_reg, Function::usage_counter_offset(), kWord);
+      __ StoreFieldToOffset(R7, function_reg, Function::usage_counter_offset(),
+                            kWord);
     }
     __ CompareImmediate(R7, GetOptimizationThreshold());
     ASSERT(function_reg == R6);
@@ -1011,9 +963,8 @@
   }
   __ Comment("Enter frame");
   if (flow_graph().IsCompiledForOsr()) {
-    intptr_t extra_slots = StackSize()
-        - flow_graph().num_stack_locals()
-        - flow_graph().num_copied_params();
+    intptr_t extra_slots = StackSize() - flow_graph().num_stack_locals() -
+                           flow_graph().num_copied_params();
     ASSERT(extra_slots >= 0);
     __ EnterOsrFrame(extra_slots * kWordSize, new_pp);
   } else {
@@ -1032,6 +983,13 @@
 //   R4: arguments descriptor array.
 void FlowGraphCompiler::CompileGraph() {
   InitCompiler();
+  const Function& function = parsed_function().function();
+
+#ifdef DART_PRECOMPILER
+  if (function.IsDynamicFunction()) {
+    __ MonomorphicCheckedEntry();
+  }
+#endif  // DART_PRECOMPILER
 
   if (TryIntrinsify()) {
     // Skip regular code generation.
@@ -1041,8 +999,6 @@
   EmitFrameEntry();
   ASSERT(assembler()->constant_pool_allowed());
 
-  const Function& function = parsed_function().function();
-
   const int num_fixed_params = function.num_fixed_parameters();
   const int num_copied_params = parsed_function().num_copied_params();
   const int num_locals = parsed_function().num_stack_locals();
@@ -1062,7 +1018,7 @@
       __ CompareImmediate(R0, Smi::RawValue(num_fixed_params));
       __ b(&wrong_num_arguments, NE);
       __ LoadFieldFromOffset(R1, R4,
-            ArgumentsDescriptor::positional_count_offset());
+                             ArgumentsDescriptor::positional_count_offset());
       __ CompareRegisters(R0, R1);
       __ b(&correct_num_arguments, EQ);
       __ Bind(&wrong_num_arguments);
@@ -1118,21 +1074,6 @@
   __ brk(0);
   ASSERT(assembler()->constant_pool_allowed());
   GenerateDeferredCode();
-
-  BeginCodeSourceRange();
-  if (is_optimizing() && !FLAG_precompiled_mode) {
-    // Leave enough space for patching in case of lazy deoptimization.
-    for (intptr_t i = 0;
-      i < CallPattern::kDeoptCallLengthInInstructions;
-      ++i) {
-      __ orr(R0, ZR, Operand(R0));  // nop
-    }
-    lazy_deopt_return_pc_offset_ = assembler()->CodeSize();
-    __ BranchPatchable(*StubCode::DeoptimizeLazyFromReturn_entry());
-    lazy_deopt_throw_pc_offset_ = assembler()->CodeSize();
-    __ BranchPatchable(*StubCode::DeoptimizeLazyFromThrow_entry());
-  }
-  EndCodeSourceRange(TokenPosition::kDartCodeEpilogue);
 }
 
 
@@ -1140,6 +1081,16 @@
                                      const StubEntry& stub_entry,
                                      RawPcDescriptors::Kind kind,
                                      LocationSummary* locs) {
+  __ BranchLink(stub_entry);
+  AddCurrentDescriptor(kind, Thread::kNoDeoptId, token_pos);
+  RecordSafepoint(locs);
+}
+
+
+void FlowGraphCompiler::GeneratePatchableCall(TokenPosition token_pos,
+                                              const StubEntry& stub_entry,
+                                              RawPcDescriptors::Kind kind,
+                                              LocationSummary* locs) {
   __ BranchLinkPatchable(stub_entry);
   AddCurrentDescriptor(kind, Thread::kNoDeoptId, token_pos);
   RecordSafepoint(locs);
@@ -1234,13 +1185,12 @@
 }
 
 
-void FlowGraphCompiler::EmitOptimizedInstanceCall(
-    const StubEntry& stub_entry,
-    const ICData& ic_data,
-    intptr_t argument_count,
-    intptr_t deopt_id,
-    TokenPosition token_pos,
-    LocationSummary* locs) {
+void FlowGraphCompiler::EmitOptimizedInstanceCall(const StubEntry& stub_entry,
+                                                  const ICData& ic_data,
+                                                  intptr_t argument_count,
+                                                  intptr_t deopt_id,
+                                                  TokenPosition token_pos,
+                                                  LocationSummary* locs) {
   ASSERT(Array::Handle(zone(), ic_data.arguments_descriptor()).Length() > 0);
   // Each ICData propagated from unoptimized to optimized code contains the
   // function that corresponds to the Dart function of that IC call. Due
@@ -1251,10 +1201,7 @@
 
   __ LoadObject(R6, parsed_function().function());
   __ LoadUniqueObject(R5, ic_data);
-  GenerateDartCall(deopt_id,
-                   token_pos,
-                   stub_entry,
-                   RawPcDescriptors::kIcCall,
+  GenerateDartCall(deopt_id, token_pos, stub_entry, RawPcDescriptors::kIcCall,
                    locs);
   __ Drop(argument_count);
 }
@@ -1268,10 +1215,7 @@
                                          LocationSummary* locs) {
   ASSERT(Array::Handle(zone(), ic_data.arguments_descriptor()).Length() > 0);
   __ LoadUniqueObject(R5, ic_data);
-  GenerateDartCall(deopt_id,
-                   token_pos,
-                   stub_entry,
-                   RawPcDescriptors::kIcCall,
+  GenerateDartCall(deopt_id, token_pos, stub_entry, RawPcDescriptors::kIcCall,
                    locs);
   __ Drop(argument_count);
 }
@@ -1289,7 +1233,8 @@
   const Array& arguments_descriptor =
       Array::ZoneHandle(zone(), ic_data.arguments_descriptor());
   ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0));
-  const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(),
+  const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(
+      zone(),
       MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor));
 
   __ Comment("MegamorphicCall");
@@ -1329,18 +1274,16 @@
     if (try_index == CatchClauseNode::kInvalidTryIndex) {
       try_index = CurrentTryIndex();
     }
-    pc_descriptors_list()->AddDescriptor(RawPcDescriptors::kOther,
-                                         assembler()->CodeSize(),
-                                         Thread::kNoDeoptId,
-                                         token_pos,
-                                         try_index);
+    pc_descriptors_list()->AddDescriptor(
+        RawPcDescriptors::kOther, assembler()->CodeSize(), Thread::kNoDeoptId,
+        token_pos, try_index);
   } else if (is_optimizing()) {
-    AddCurrentDescriptor(RawPcDescriptors::kOther,
-        Thread::kNoDeoptId, token_pos);
+    AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId,
+                         token_pos);
     AddDeoptIndexAtCall(deopt_id_after);
   } else {
-    AddCurrentDescriptor(RawPcDescriptors::kOther,
-        Thread::kNoDeoptId, token_pos);
+    AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId,
+                         token_pos);
     // Add deoptimization continuation point after the call and before the
     // arguments are removed.
     AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
@@ -1349,25 +1292,23 @@
 }
 
 
-void FlowGraphCompiler::EmitSwitchableInstanceCall(
-    const ICData& ic_data,
-    intptr_t argument_count,
-    intptr_t deopt_id,
-    TokenPosition token_pos,
-    LocationSummary* locs) {
+void FlowGraphCompiler::EmitSwitchableInstanceCall(const ICData& ic_data,
+                                                   intptr_t argument_count,
+                                                   intptr_t deopt_id,
+                                                   TokenPosition token_pos,
+                                                   LocationSummary* locs) {
   ASSERT(ic_data.NumArgsTested() == 1);
-  const Code& initial_stub = Code::ZoneHandle(
-      StubCode::ICCallThroughFunction_entry()->code());
+  const Code& initial_stub =
+      Code::ZoneHandle(StubCode::ICCallThroughFunction_entry()->code());
   __ Comment("SwitchableCall");
 
   __ LoadFromOffset(R0, SP, (argument_count - 1) * kWordSize);
-  __ LoadUniqueObject(R5, ic_data);
   __ LoadUniqueObject(CODE_REG, initial_stub);
   __ ldr(TMP, FieldAddress(CODE_REG, Code::checked_entry_point_offset()));
+  __ LoadUniqueObject(R5, ic_data);
   __ blr(TMP);
 
-  AddCurrentDescriptor(RawPcDescriptors::kOther,
-      Thread::kNoDeoptId, token_pos);
+  AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, token_pos);
   RecordSafepoint(locs);
   const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
   if (is_optimizing()) {
@@ -1381,20 +1322,16 @@
 }
 
 
-void FlowGraphCompiler::EmitUnoptimizedStaticCall(
-    intptr_t argument_count,
-    intptr_t deopt_id,
-    TokenPosition token_pos,
-    LocationSummary* locs,
-    const ICData& ic_data) {
+void FlowGraphCompiler::EmitUnoptimizedStaticCall(intptr_t argument_count,
+                                                  intptr_t deopt_id,
+                                                  TokenPosition token_pos,
+                                                  LocationSummary* locs,
+                                                  const ICData& ic_data) {
   const StubEntry* stub_entry =
       StubCode::UnoptimizedStaticCallEntry(ic_data.NumArgsTested());
   __ LoadObject(R5, ic_data);
-  GenerateDartCall(deopt_id,
-                   token_pos,
-                   *stub_entry,
-                   RawPcDescriptors::kUnoptStaticCall,
-                   locs);
+  GenerateDartCall(deopt_id, token_pos, *stub_entry,
+                   RawPcDescriptors::kUnoptStaticCall, locs);
   __ Drop(argument_count);
 }
 
@@ -1414,12 +1351,9 @@
   }
   // 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.
-  GenerateStaticDartCall(deopt_id,
-                         token_pos,
+  GenerateStaticDartCall(deopt_id, token_pos,
                          *StubCode::CallStaticFunction_entry(),
-                         RawPcDescriptors::kOther,
-                         locs,
-                         function);
+                         RawPcDescriptors::kOther, locs, function);
   __ Drop(argument_count);
 }
 
@@ -1441,12 +1375,11 @@
           *StubCode::UnoptimizedIdenticalWithNumberCheck_entry());
     }
     if (token_pos.IsReal()) {
-      AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
-                           Thread::kNoDeoptId,
+      AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, Thread::kNoDeoptId,
                            token_pos);
     }
     // Stub returns result in flags (result of a cmp, we need Z computed).
-    __ Drop(1);  // Discard constant.
+    __ Drop(1);   // Discard constant.
     __ Pop(reg);  // Restore 'reg'.
   } else {
     __ CompareObject(reg, obj);
@@ -1471,8 +1404,7 @@
           *StubCode::UnoptimizedIdenticalWithNumberCheck_entry());
     }
     if (token_pos.IsReal()) {
-      AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
-                           Thread::kNoDeoptId,
+      AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, Thread::kNoDeoptId,
                            token_pos);
     }
     // Stub returns result in flags (result of a cmp, we need Z computed).
@@ -1565,9 +1497,8 @@
   ASSERT(is_optimizing());
 
   __ Comment("EmitTestAndCall");
-  const Array& arguments_descriptor =
-      Array::ZoneHandle(zone(), ArgumentsDescriptor::New(argument_count,
-                                                         argument_names));
+  const Array& arguments_descriptor = Array::ZoneHandle(
+      zone(), ArgumentsDescriptor::New(argument_count, argument_names));
 
   // Load receiver into R0.
   __ LoadFromOffset(R0, SP, (argument_count - 1) * kWordSize);
@@ -1589,14 +1520,11 @@
     }
     // 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.
-    const Function& function = Function::ZoneHandle(
-        zone(), ic_data.GetTargetAt(0));
-    GenerateStaticDartCall(deopt_id,
-                           token_index,
+    const Function& function =
+        Function::ZoneHandle(zone(), ic_data.GetTargetAt(0));
+    GenerateStaticDartCall(deopt_id, token_index,
                            *StubCode::CallStaticFunction_entry(),
-                           RawPcDescriptors::kOther,
-                           locs,
-                           function);
+                           RawPcDescriptors::kOther, locs, function);
     __ Drop(argument_count);
     if (kNumChecks > 1) {
       __ b(match_found);
@@ -1642,12 +1570,9 @@
     // 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.
     const Function& function = *sorted[i].target;
-    GenerateStaticDartCall(deopt_id,
-                           token_index,
+    GenerateStaticDartCall(deopt_id, token_index,
                            *StubCode::CallStaticFunction_entry(),
-                           RawPcDescriptors::kOther,
-                           locs,
-                           function);
+                           RawPcDescriptors::kOther, locs, function);
     __ Drop(argument_count);
     if (!kIsLastCheck) {
       __ b(match_found);
@@ -1677,8 +1602,7 @@
   } else if (source.IsStackSlot()) {
     if (destination.IsRegister()) {
       const intptr_t source_offset = source.ToStackSlotOffset();
-      __ LoadFromOffset(
-          destination.reg(), source.base_reg(), source_offset);
+      __ LoadFromOffset(destination.reg(), source.base_reg(), source_offset);
     } else {
       ASSERT(destination.IsStackSlot());
       const intptr_t source_offset = source.ToStackSlotOffset();
@@ -1698,8 +1622,8 @@
       } else {
         ASSERT(destination.IsQuadStackSlot());
         const intptr_t dest_offset = destination.ToStackSlotOffset();
-        __ StoreQToOffset(
-            source.fpu_reg(), destination.base_reg(), dest_offset);
+        __ StoreQToOffset(source.fpu_reg(), destination.base_reg(),
+                          dest_offset);
       }
     }
   } else if (source.IsDoubleStackSlot()) {
@@ -1717,8 +1641,8 @@
   } else if (source.IsQuadStackSlot()) {
     if (destination.IsFpuRegister()) {
       const intptr_t source_offset = source.ToStackSlotOffset();
-      __ LoadQFromOffset(
-          destination.fpu_reg(), source.base_reg(), source_offset);
+      __ LoadQFromOffset(destination.fpu_reg(), source.base_reg(),
+                         source_offset);
     } else {
       ASSERT(destination.IsQuadStackSlot());
       const intptr_t source_offset = source.ToStackSlotOffset();
@@ -1787,11 +1711,10 @@
     __ mov(source.reg(), destination.reg());
     __ mov(destination.reg(), TMP);
   } else if (source.IsRegister() && destination.IsStackSlot()) {
-    Exchange(source.reg(),
-             destination.base_reg(), destination.ToStackSlotOffset());
+    Exchange(source.reg(), destination.base_reg(),
+             destination.ToStackSlotOffset());
   } else if (source.IsStackSlot() && destination.IsRegister()) {
-    Exchange(destination.reg(),
-             source.base_reg(), source.ToStackSlotOffset());
+    Exchange(destination.reg(), source.base_reg(), source.ToStackSlotOffset());
   } else if (source.IsStackSlot() && destination.IsStackSlot()) {
     Exchange(source.base_reg(), source.ToStackSlotOffset(),
              destination.base_reg(), destination.ToStackSlotOffset());
@@ -1802,20 +1725,17 @@
     __ vmov(src, dst);
     __ vmov(dst, VTMP);
   } else if (source.IsFpuRegister() || destination.IsFpuRegister()) {
-    ASSERT(destination.IsDoubleStackSlot() ||
-           destination.IsQuadStackSlot() ||
-           source.IsDoubleStackSlot() ||
-           source.IsQuadStackSlot());
-    bool double_width = destination.IsDoubleStackSlot() ||
-                        source.IsDoubleStackSlot();
-    VRegister reg = source.IsFpuRegister() ? source.fpu_reg()
-                                           : destination.fpu_reg();
-    Register base_reg = source.IsFpuRegister()
-        ? destination.base_reg()
-        : source.base_reg();
+    ASSERT(destination.IsDoubleStackSlot() || destination.IsQuadStackSlot() ||
+           source.IsDoubleStackSlot() || source.IsQuadStackSlot());
+    bool double_width =
+        destination.IsDoubleStackSlot() || source.IsDoubleStackSlot();
+    VRegister reg =
+        source.IsFpuRegister() ? source.fpu_reg() : destination.fpu_reg();
+    Register base_reg =
+        source.IsFpuRegister() ? destination.base_reg() : source.base_reg();
     const intptr_t slot_offset = source.IsFpuRegister()
-        ? destination.ToStackSlotOffset()
-        : source.ToStackSlotOffset();
+                                     ? destination.ToStackSlotOffset()
+                                     : source.ToStackSlotOffset();
 
     if (double_width) {
       __ LoadDFromOffset(VTMP, base_reg, slot_offset);
diff --git a/runtime/vm/flow_graph_compiler_dbc.cc b/runtime/vm/flow_graph_compiler_dbc.cc
index 69dd8ad..745fcf9 100644
--- a/runtime/vm/flow_graph_compiler_dbc.cc
+++ b/runtime/vm/flow_graph_compiler_dbc.cc
@@ -29,11 +29,6 @@
 DECLARE_FLAG(bool, enable_simd_inline);
 DECLARE_FLAG(charp, optimization_filter);
 
-void MegamorphicSlowPath::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
-}
-
-
 FlowGraphCompiler::~FlowGraphCompiler() {
   // BlockInfos are zone-allocated, so their destructors are not called.
   // Verify the labels explicitly here.
@@ -125,8 +120,7 @@
 
   // For the innermost environment, set outgoing arguments and the locals.
   for (intptr_t i = current->Length() - 1;
-       i >= current->fixed_parameter_count();
-       i--) {
+       i >= current->fixed_parameter_count(); i--) {
     builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++);
   }
 
@@ -137,10 +131,9 @@
   while (current != NULL) {
     // For any outer environment the deopt id is that of the call instruction
     // which is recorded in the outer environment.
-    builder->AddReturnAddress(
-        current->function(),
-        Thread::ToDeoptAfter(current->deopt_id()),
-        slot_ix++);
+    builder->AddReturnAddress(current->function(),
+                              Thread::ToDeoptAfter(current->deopt_id()),
+                              slot_ix++);
 
     builder->AddPcMarker(previous->function(), slot_ix++);
     builder->AddConstant(previous->function(), slot_ix++);
@@ -148,18 +141,14 @@
     // The values of outgoing arguments can be changed from the inlined call so
     // we must read them from the previous environment.
     for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) {
-      builder->AddCopy(previous->ValueAt(i),
-                       previous->LocationAt(i),
+      builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i),
                        slot_ix++);
     }
 
     // Set the locals, note that outgoing arguments are not in the environment.
     for (intptr_t i = current->Length() - 1;
-         i >= current->fixed_parameter_count();
-         i--) {
-      builder->AddCopy(current->ValueAt(i),
-                       current->LocationAt(i),
-                       slot_ix++);
+         i >= current->fixed_parameter_count(); i--) {
+      builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++);
     }
 
     builder->AddCallerFp(slot_ix++);
@@ -187,29 +176,37 @@
 }
 
 
-void FlowGraphCompiler::RecordAfterCall(Instruction* instr) {
-  RecordSafepoint(instr->locs());
+void FlowGraphCompiler::RecordAfterCallHelper(TokenPosition token_pos,
+                                              intptr_t deopt_id,
+                                              intptr_t argument_count,
+                                              LocationSummary* locs) {
+  RecordSafepoint(locs);
   // Marks either the continuation point in unoptimized code or the
   // deoptimization point in optimized code, after call.
-  const intptr_t deopt_id_after = Thread::ToDeoptAfter(instr->deopt_id());
+  const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
   if (is_optimizing()) {
     // Return/ReturnTOS instruction drops incoming arguments so
     // we have to drop outgoing arguments from the innermost environment.
     // On all other architectures caller drops outgoing arguments itself
     // hence the difference.
-    pending_deoptimization_env_->DropArguments(instr->ArgumentCount());
+    pending_deoptimization_env_->DropArguments(argument_count);
     AddDeoptIndexAtCall(deopt_id_after);
+    // This descriptor is needed for exception handling in optimized code.
+    AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id_after, token_pos);
   } else {
     // Add deoptimization continuation point after the call and before the
     // arguments are removed.
-    // In optimized code this descriptor is needed for exception handling.
-    AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                         deopt_id_after,
-                         instr->token_pos());
+    AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
   }
 }
 
 
+void FlowGraphCompiler::RecordAfterCall(Instruction* instr) {
+  RecordAfterCallHelper(instr->token_pos(), instr->deopt_id(),
+                        instr->ArgumentCount(), instr->locs());
+}
+
+
 void CompilerDeoptInfoWithStub::GenerateCode(FlowGraphCompiler* compiler,
                                              intptr_t stub_ix) {
   UNREACHABLE();
@@ -227,6 +224,9 @@
   SubtypeTestCache& test_cache = SubtypeTestCache::Handle();
   if (!dst_type.IsVoidType() && dst_type.IsInstantiated()) {
     test_cache = SubtypeTestCache::New();
+  } else if (!dst_type.IsInstantiated() &&
+             (dst_type.IsTypeParameter() || dst_type.IsType())) {
+    test_cache = SubtypeTestCache::New();
   }
 
   if (is_optimizing()) {
@@ -235,7 +235,23 @@
   }
   __ PushConstant(dst_type);
   __ PushConstant(dst_name);
-  __ AssertAssignable(__ AddConstant(test_cache));
+
+  if (dst_type.IsMalformedOrMalbounded()) {
+    __ BadTypeError();
+  } else {
+    bool may_be_smi = false;
+    if (!dst_type.IsVoidType() && dst_type.IsInstantiated()) {
+      const Class& type_class = Class::Handle(zone(), dst_type.type_class());
+      if (type_class.NumTypeArguments() == 0) {
+        const Class& smi_class = Class::Handle(zone(), Smi::Class());
+        may_be_smi = smi_class.IsSubtypeOf(
+            TypeArguments::Handle(zone()), type_class,
+            TypeArguments::Handle(zone()), NULL, NULL, Heap::kOld);
+      }
+    }
+    __ AssertAssignable(may_be_smi ? 1 : 0, __ AddConstant(test_cache));
+  }
+
   if (is_optimizing()) {
     // Register allocator does not think that our first input (also used as
     // output) needs to be kept alive across the call because that is how code
@@ -246,8 +262,8 @@
     // visits it.
     locs->SetStackBit(locs->out(0).reg());
   }
-  RecordSafepoint(locs);
   AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id, token_pos);
+  RecordAfterCallHelper(token_pos, deopt_id, 0, locs);
   if (is_optimizing()) {
     // Assert assignable keeps the instance on the stack as the result,
     // all other arguments are popped.
@@ -260,14 +276,12 @@
 void FlowGraphCompiler::EmitInstructionEpilogue(Instruction* instr) {
   if (!is_optimizing()) {
     Definition* defn = instr->AsDefinition();
-    if ((defn != NULL) &&
-        (defn->tag() != Instruction::kPushArgument) &&
+    if ((defn != NULL) && (defn->tag() != Instruction::kPushArgument) &&
         (defn->tag() != Instruction::kStoreIndexed) &&
         (defn->tag() != Instruction::kStoreStaticField) &&
         (defn->tag() != Instruction::kStoreLocal) &&
         (defn->tag() != Instruction::kStoreInstanceField) &&
-        (defn->tag() != Instruction::kDropTemps) &&
-        !defn->HasTemp()) {
+        (defn->tag() != Instruction::kDropTemps) && !defn->HasTemp()) {
       __ Drop1();
     }
   }
@@ -276,7 +290,13 @@
 
 void FlowGraphCompiler::GenerateInlinedGetter(intptr_t offset) {
   __ Move(0, -(1 + kParamEndSlotFromFp));
-  __ LoadField(0, 0, offset / kWordSize);
+  ASSERT(offset % kWordSize == 0);
+  if (Utils::IsInt(8, offset / kWordSize)) {
+    __ LoadField(0, 0, offset / kWordSize);
+  } else {
+    __ LoadFieldExt(0, 0);
+    __ Nop(offset / kWordSize);
+  }
   __ Return(0);
 }
 
@@ -284,7 +304,13 @@
 void FlowGraphCompiler::GenerateInlinedSetter(intptr_t offset) {
   __ Move(0, -(2 + kParamEndSlotFromFp));
   __ Move(1, -(1 + kParamEndSlotFromFp));
-  __ StoreField(0, offset / kWordSize, 1);
+  ASSERT(offset % kWordSize == 0);
+  if (Utils::IsInt(8, offset / kWordSize)) {
+    __ StoreField(0, offset / kWordSize, 1);
+  } else {
+    __ StoreFieldExt(0, 1);
+    __ Nop(offset / kWordSize);
+  }
   __ LoadConstant(0, Object::Handle());
   __ Return(0);
 }
@@ -297,21 +323,19 @@
   const int num_opt_named_params = function.NumOptionalNamedParameters();
   const int num_params =
       num_fixed_params + num_opt_pos_params + num_opt_named_params;
-  const bool has_optional_params = (num_opt_pos_params != 0) ||
-      (num_opt_named_params != 0);
+  const bool has_optional_params =
+      (num_opt_pos_params != 0) || (num_opt_named_params != 0);
   const int num_locals = parsed_function().num_stack_locals();
   const intptr_t context_index =
       -parsed_function().current_context_var()->index() - 1;
 
-  if (CanOptimizeFunction() &&
-      function.IsOptimizable() &&
+  if (CanOptimizeFunction() && function.IsOptimizable() &&
       (!is_optimizing() || may_reoptimize())) {
     __ HotCheck(!is_optimizing(), GetOptimizationThreshold());
   }
 
   if (has_optional_params) {
-    __ EntryOptional(num_fixed_params,
-                     num_opt_pos_params,
+    __ EntryOptional(num_fixed_params, num_opt_pos_params,
                      num_opt_named_params);
   } else if (!is_optimizing()) {
     __ Entry(num_fixed_params, num_locals, context_index);
@@ -361,17 +385,17 @@
   if (has_optional_params) {
     if (!is_optimizing()) {
       ASSERT(num_locals > 0);  // There is always at least context_var.
-      __ Frame(num_locals);  // Reserve space for locals.
+      __ Frame(num_locals);    // Reserve space for locals.
     } else if (flow_graph_.graph_entry()->spill_slot_count() >
-                   flow_graph_.num_copied_params()) {
+               flow_graph_.num_copied_params()) {
       __ Frame(flow_graph_.graph_entry()->spill_slot_count() -
-          flow_graph_.num_copied_params());
+               flow_graph_.num_copied_params());
     }
   }
 
   if (function.IsClosureFunction()) {
-    Register reg = is_optimizing() ? flow_graph_.num_copied_params()
-                                   : context_index;
+    Register reg =
+        is_optimizing() ? flow_graph_.num_copied_params() : context_index;
     Register closure_reg = reg;
     LocalScope* scope = parsed_function().node_sequence()->scope();
     LocalVariable* local = scope->VariableAt(0);
@@ -383,7 +407,7 @@
     __ LoadField(reg, closure_reg, Closure::context_offset() / kWordSize);
   } else if (has_optional_params && !is_optimizing()) {
     __ LoadConstant(context_index,
-        Object::Handle(isolate()->object_store()->empty_context()));
+                    Object::Handle(isolate()->object_store()->empty_context()));
   }
 }
 
diff --git a/runtime/vm/flow_graph_compiler_ia32.cc b/runtime/vm/flow_graph_compiler_ia32.cc
index 6d823d1..fbc891e 100644
--- a/runtime/vm/flow_graph_compiler_ia32.cc
+++ b/runtime/vm/flow_graph_compiler_ia32.cc
@@ -31,18 +31,6 @@
 DECLARE_FLAG(bool, enable_simd_inline);
 
 
-void MegamorphicSlowPath::EmitNativeCode(FlowGraphCompiler* compiler) {
-  Assembler* assembler = compiler->assembler();
-#define __ assembler->
-  __ Bind(entry_label());
-  __ Comment("MegamorphicSlowPath");
-  compiler->EmitMegamorphicInstanceCall(ic_data_, argument_count_, deopt_id_,
-                                        token_pos_, locs_, try_index_);
-  __ jmp(exit_label());
-#undef __
-}
-
-
 FlowGraphCompiler::~FlowGraphCompiler() {
   // BlockInfos are zone-allocated, so their destructors are not called.
   // Verify the labels explicitly here.
@@ -129,8 +117,7 @@
 
   // For the innermost environment, set outgoing arguments and the locals.
   for (intptr_t i = current->Length() - 1;
-       i >= current->fixed_parameter_count();
-       i--) {
+       i >= current->fixed_parameter_count(); i--) {
     builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++);
   }
 
@@ -142,26 +129,21 @@
   while (current != NULL) {
     // For any outer environment the deopt id is that of the call instruction
     // which is recorded in the outer environment.
-    builder->AddReturnAddress(
-        current->function(),
-        Thread::ToDeoptAfter(current->deopt_id()),
-        slot_ix++);
+    builder->AddReturnAddress(current->function(),
+                              Thread::ToDeoptAfter(current->deopt_id()),
+                              slot_ix++);
 
     // The values of outgoing arguments can be changed from the inlined call so
     // we must read them from the previous environment.
     for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) {
-      builder->AddCopy(previous->ValueAt(i),
-                       previous->LocationAt(i),
+      builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i),
                        slot_ix++);
     }
 
     // Set the locals, note that outgoing arguments are not in the environment.
     for (intptr_t i = current->Length() - 1;
-         i >= current->fixed_parameter_count();
-         i--) {
-      builder->AddCopy(current->ValueAt(i),
-                       current->LocationAt(i),
-                       slot_ix++);
+         i >= current->fixed_parameter_count(); i--) {
+      builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++);
     }
 
     builder->AddPcMarker(current->function(), slot_ix++);
@@ -239,7 +221,7 @@
   const Immediate& raw_null =
       Immediate(reinterpret_cast<intptr_t>(Object::null()));
   __ LoadObject(temp_reg, type_test_cache);
-  __ pushl(temp_reg);  // Subtype test cache.
+  __ pushl(temp_reg);      // Subtype test cache.
   __ pushl(instance_reg);  // Instance.
   if (test_kind == kTestTypeOneArg) {
     ASSERT(type_arguments_reg == kNoRegister);
@@ -260,7 +242,7 @@
   ASSERT(temp_reg != ECX);
   __ popl(instance_reg);  // Discard.
   __ popl(instance_reg);  // Restore receiver.
-  __ popl(temp_reg);  // Discard.
+  __ popl(temp_reg);      // Discard.
   GenerateBoolToJump(ECX, is_instance_lbl, is_not_instance_lbl);
   return type_test_cache.raw();
 }
@@ -302,7 +284,7 @@
     const TypeArguments& type_arguments =
         TypeArguments::ZoneHandle(zone(), type.arguments());
     const bool is_raw_type = type_arguments.IsNull() ||
-        type_arguments.IsRaw(from_index, num_type_params);
+                             type_arguments.IsRaw(from_index, num_type_params);
     if (is_raw_type) {
       const Register kClassIdReg = ECX;
       // dynamic type argument, check only classes.
@@ -318,8 +300,8 @@
     }
     // If one type argument only, check if type argument is Object or dynamic.
     if (type_arguments.Length() == 1) {
-      const AbstractType& tp_argument = AbstractType::ZoneHandle(
-          zone(), type_arguments.TypeAt(0));
+      const AbstractType& tp_argument =
+          AbstractType::ZoneHandle(zone(), type_arguments.TypeAt(0));
       ASSERT(!tp_argument.IsMalformed());
       if (tp_argument.IsType()) {
         ASSERT(tp_argument.HasResolvedTypeClass());
@@ -336,12 +318,9 @@
   // Regular subtype test cache involving instance's type arguments.
   const Register kTypeArgumentsReg = kNoRegister;
   const Register kTempReg = EDI;
-  return GenerateCallSubtypeTestStub(kTestTypeTwoArgs,
-                                     kInstanceReg,
-                                     kTypeArgumentsReg,
-                                     kTempReg,
-                                     is_instance_lbl,
-                                     is_not_instance_lbl);
+  return GenerateCallSubtypeTestStub(kTestTypeTwoArgs, kInstanceReg,
+                                     kTypeArgumentsReg, kTempReg,
+                                     is_instance_lbl, is_not_instance_lbl);
 }
 
 
@@ -380,11 +359,8 @@
   __ testl(kInstanceReg, Immediate(kSmiTagMask));
   // If instance is Smi, check directly.
   const Class& smi_class = Class::Handle(zone(), Smi::Class());
-  if (smi_class.IsSubtypeOf(TypeArguments::Handle(zone()),
-                            type_class,
-                            TypeArguments::Handle(zone()),
-                            NULL,
-                            NULL,
+  if (smi_class.IsSubtypeOf(TypeArguments::Handle(zone()), type_class,
+                            TypeArguments::Handle(zone()), NULL, NULL,
                             Heap::kOld)) {
     __ j(ZERO, is_instance_lbl);
   } else {
@@ -404,8 +380,8 @@
   // Custom checking for numbers (Smi, Mint, Bigint and Double).
   // Note that instance is not Smi (checked above).
   if (type.IsNumberType() || type.IsIntType() || type.IsDoubleType()) {
-    GenerateNumberTypeCheck(
-        kClassIdReg, type, is_instance_lbl, is_not_instance_lbl);
+    GenerateNumberTypeCheck(kClassIdReg, type, is_instance_lbl,
+                            is_not_instance_lbl);
     return false;
   }
   if (type.IsStringType()) {
@@ -452,12 +428,9 @@
 
   const Register kTypeArgumentsReg = kNoRegister;
   const Register kTempReg = EDI;
-  return GenerateCallSubtypeTestStub(kTestTypeOneArg,
-                                     kInstanceReg,
-                                     kTypeArgumentsReg,
-                                     kTempReg,
-                                     is_instance_lbl,
-                                     is_not_instance_lbl);
+  return GenerateCallSubtypeTestStub(kTestTypeOneArg, kInstanceReg,
+                                     kTypeArgumentsReg, kTempReg,
+                                     is_instance_lbl, is_not_instance_lbl);
 }
 
 
@@ -482,23 +455,23 @@
     // Check if type arguments are null, i.e. equivalent to vector of dynamic.
     __ cmpl(EDX, raw_null);
     __ j(EQUAL, is_instance_lbl);
-    __ movl(EDI,
-        FieldAddress(EDX, TypeArguments::type_at_offset(type_param.index())));
+    __ movl(EDI, FieldAddress(
+                     EDX, TypeArguments::type_at_offset(type_param.index())));
     // EDI: concrete type of type.
     // Check if type argument is dynamic.
     __ CompareObject(EDI, Object::dynamic_type());
-    __ j(EQUAL,  is_instance_lbl);
+    __ j(EQUAL, is_instance_lbl);
     __ CompareObject(EDI, Type::ZoneHandle(zone(), Type::ObjectType()));
-    __ j(EQUAL,  is_instance_lbl);
+    __ j(EQUAL, is_instance_lbl);
 
     // For Smi check quickly against int and num interfaces.
     Label not_smi;
     __ testl(EAX, Immediate(kSmiTagMask));  // Value is Smi?
     __ j(NOT_ZERO, &not_smi, Assembler::kNearJump);
     __ CompareObject(EDI, Type::ZoneHandle(zone(), Type::IntType()));
-    __ j(EQUAL,  is_instance_lbl);
+    __ j(EQUAL, is_instance_lbl);
     __ CompareObject(EDI, Type::ZoneHandle(zone(), Type::Number()));
-    __ j(EQUAL,  is_instance_lbl);
+    __ j(EQUAL, is_instance_lbl);
     // Smi must be handled in runtime.
     Label fall_through;
     __ jmp(&fall_through);
@@ -509,14 +482,10 @@
     const Register kInstanceReg = EAX;
     const Register kTypeArgumentsReg = EDX;
     const Register kTempReg = EDI;
-    const SubtypeTestCache& type_test_cache =
-        SubtypeTestCache::ZoneHandle(zone(),
-            GenerateCallSubtypeTestStub(kTestTypeThreeArgs,
-                                        kInstanceReg,
-                                        kTypeArgumentsReg,
-                                        kTempReg,
-                                        is_instance_lbl,
-                                        is_not_instance_lbl));
+    const SubtypeTestCache& type_test_cache = SubtypeTestCache::ZoneHandle(
+        zone(), GenerateCallSubtypeTestStub(
+                    kTestTypeThreeArgs, kInstanceReg, kTypeArgumentsReg,
+                    kTempReg, is_instance_lbl, is_not_instance_lbl));
     __ Bind(&fall_through);
     return type_test_cache.raw();
   }
@@ -529,12 +498,9 @@
     // Uninstantiated type class is known at compile time, but the type
     // arguments are determined at runtime by the instantiator.
     const Register kTempReg = EDI;
-    return GenerateCallSubtypeTestStub(kTestTypeThreeArgs,
-                                       kInstanceReg,
-                                       kTypeArgumentsReg,
-                                       kTempReg,
-                                       is_instance_lbl,
-                                       is_not_instance_lbl);
+    return GenerateCallSubtypeTestStub(kTestTypeThreeArgs, kInstanceReg,
+                                       kTypeArgumentsReg, kTempReg,
+                                       is_instance_lbl, is_not_instance_lbl);
   }
   return SubtypeTestCache::null();
 }
@@ -566,17 +532,12 @@
     // function type) of a non-parameterized class or with a raw dst type of
     // a parameterized class.
     if (type.IsFunctionType() || (type_class.NumTypeArguments() > 0)) {
-      return GenerateInstantiatedTypeWithArgumentsTest(token_pos,
-                                                       type,
-                                                       is_instance_lbl,
-                                                       is_not_instance_lbl);
+      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);
+    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.
@@ -586,9 +547,7 @@
       return SubtypeTestCache::null();
     }
   }
-  return GenerateUninstantiatedTypeTest(token_pos,
-                                        type,
-                                        is_instance_lbl,
+  return GenerateUninstantiatedTypeTest(token_pos, type, is_instance_lbl,
                                         is_not_instance_lbl);
 }
 
@@ -631,25 +590,21 @@
 
   // Generate inline instanceof test.
   SubtypeTestCache& test_cache = SubtypeTestCache::ZoneHandle(zone());
-  test_cache = GenerateInlineInstanceof(token_pos, type,
-                                        &is_instance, &is_not_instance);
+  test_cache =
+      GenerateInlineInstanceof(token_pos, type, &is_instance, &is_not_instance);
 
   // test_cache is null if there is no fall-through.
   Label done;
   if (!test_cache.IsNull()) {
     // Generate runtime call.
-    __ movl(EDX, Address(ESP, 0));  // Get instantiator type arguments.
+    __ movl(EDX, Address(ESP, 0));         // Get instantiator type arguments.
     __ PushObject(Object::null_object());  // Make room for the result.
-    __ pushl(EAX);  // Push the instance.
-    __ PushObject(type);  // Push the type.
-    __ pushl(EDX);  // Instantiator type arguments.
+    __ pushl(EAX);                         // Push the instance.
+    __ PushObject(type);                   // Push the type.
+    __ pushl(EDX);                         // Instantiator type arguments.
     __ LoadObject(EAX, test_cache);
     __ pushl(EAX);
-    GenerateRuntimeCall(token_pos,
-                        deopt_id,
-                        kInstanceofRuntimeEntry,
-                        4,
-                        locs);
+    GenerateRuntimeCall(token_pos, deopt_id, kInstanceofRuntimeEntry, 4, locs);
     // Pop the parameters supplied to the runtime entry. The result of the
     // instanceof runtime call will be left as the result of the operation.
     __ Drop(4);
@@ -708,34 +663,31 @@
   // Generate throw new TypeError() if the type is malformed or malbounded.
   if (dst_type.IsMalformedOrMalbounded()) {
     __ PushObject(Object::null_object());  // Make room for the result.
-    __ pushl(EAX);  // Push the source object.
-    __ PushObject(dst_name);  // Push the name of the destination.
-    __ PushObject(dst_type);  // Push the type of the destination.
-    GenerateRuntimeCall(token_pos,
-                        deopt_id,
-                        kBadTypeErrorRuntimeEntry,
-                        3,
+    __ pushl(EAX);                         // Push the source object.
+    __ PushObject(dst_name);               // Push the name of the destination.
+    __ PushObject(dst_type);               // Push the type of the destination.
+    GenerateRuntimeCall(token_pos, deopt_id, kBadTypeErrorRuntimeEntry, 3,
                         locs);
     // We should never return here.
     __ int3();
 
     __ Bind(&is_assignable);  // For a null object.
-    __ popl(EDX);  // Remove pushed instantiator type arguments.
+    __ popl(EDX);             // Remove pushed instantiator type arguments.
     return;
   }
 
   // Generate inline type check, linking to runtime call if not assignable.
   SubtypeTestCache& test_cache = SubtypeTestCache::ZoneHandle(zone());
-  test_cache = GenerateInlineInstanceof(token_pos, dst_type,
-                                        &is_assignable, &runtime_call);
+  test_cache = GenerateInlineInstanceof(token_pos, dst_type, &is_assignable,
+                                        &runtime_call);
 
   __ Bind(&runtime_call);
-  __ movl(EDX, Address(ESP, 0));  // Get instantiator type arguments.
+  __ movl(EDX, Address(ESP, 0));         // Get instantiator type arguments.
   __ PushObject(Object::null_object());  // Make room for the result.
-  __ pushl(EAX);  // Push the source object.
-  __ PushObject(dst_type);  // Push the type of the destination.
-  __ pushl(EDX);  // Instantiator type arguments.
-  __ PushObject(dst_name);  // Push the name of the destination.
+  __ pushl(EAX);                         // Push the source object.
+  __ PushObject(dst_type);               // Push the type of the destination.
+  __ pushl(EDX);                         // Instantiator type arguments.
+  __ PushObject(dst_name);               // Push the name of the destination.
   __ LoadObject(EAX, test_cache);
   __ pushl(EAX);
   GenerateRuntimeCall(token_pos, deopt_id, kTypeCheckRuntimeEntry, 5, locs);
@@ -804,8 +756,8 @@
   // Let EBX point to the last passed positional argument, i.e. to
   // fp[kParamEndSlotFromFp + num_args - (num_pos_args - 1)].
   __ subl(EBX, ECX);
-  __ leal(EBX, Address(EBP, EBX, TIMES_2,
-                       (kParamEndSlotFromFp + 1) * kWordSize));
+  __ leal(EBX,
+          Address(EBP, EBX, TIMES_2, (kParamEndSlotFromFp + 1) * kWordSize));
 
   // Let EDI point to the last copied positional argument, i.e. to
   // fp[kFirstLocalSlotFromFp - (num_pos_args - 1)].
@@ -832,9 +784,9 @@
       Immediate(reinterpret_cast<intptr_t>(Object::null()));
   Label all_arguments_processed;
 #ifdef DEBUG
-    const bool check_correct_named_args = true;
+  const bool check_correct_named_args = true;
 #else
-    const bool check_correct_named_args = function.IsClosureFunction();
+  const bool check_correct_named_args = function.IsClosureFunction();
 #endif
   if (num_opt_named_params > 0) {
     // Start by alphabetically sorting the names of the optional parameters.
@@ -857,13 +809,9 @@
     }
     // Generate code handling each optional parameter in alphabetical order.
     __ movl(EBX, FieldAddress(EDX, ArgumentsDescriptor::count_offset()));
-    __ movl(ECX,
-            FieldAddress(EDX, ArgumentsDescriptor::positional_count_offset()));
-    __ SmiUntag(ECX);
     // Let EBX point to the first passed argument, i.e. to
     // fp[kParamEndSlotFromFp + num_args - 0]; num_args (EBX) is Smi.
-    __ leal(EBX,
-            Address(EBP, EBX, TIMES_2, kParamEndSlotFromFp * kWordSize));
+    __ leal(EBX, Address(EBP, EBX, TIMES_2, kParamEndSlotFromFp * kWordSize));
     // Let EDI point to the entry of the first named argument.
     __ leal(EDI,
             FieldAddress(EDX, ArgumentsDescriptor::first_named_entry_offset()));
@@ -963,8 +911,8 @@
   __ SmiUntag(ECX);
   Label null_args_loop, null_args_loop_condition;
   __ jmp(&null_args_loop_condition, Assembler::kNearJump);
-  const Address original_argument_addr(
-      EBP, ECX, TIMES_4, (kParamEndSlotFromFp + 1) * kWordSize);
+  const Address original_argument_addr(EBP, ECX, TIMES_4,
+                                       (kParamEndSlotFromFp + 1) * kWordSize);
   __ Bind(&null_args_loop);
   __ movl(original_argument_addr, raw_null);
   __ Bind(&null_args_loop_condition);
@@ -1004,8 +952,7 @@
 // needs to be updated to match.
 void FlowGraphCompiler::EmitFrameEntry() {
   const Function& function = parsed_function().function();
-  if (CanOptimizeFunction() &&
-      function.IsOptimizable() &&
+  if (CanOptimizeFunction() && function.IsOptimizable() &&
       (!is_optimizing() || may_reoptimize())) {
     __ Comment("Invocation Count Check");
     const Register function_reg = EBX;
@@ -1023,9 +970,8 @@
   }
   __ Comment("Enter frame");
   if (flow_graph().IsCompiledForOsr()) {
-    intptr_t extra_slots = StackSize()
-        - flow_graph().num_stack_locals()
-        - flow_graph().num_copied_params();
+    intptr_t extra_slots = StackSize() - flow_graph().num_stack_locals() -
+                           flow_graph().num_copied_params();
     ASSERT(extra_slots >= 0);
     __ EnterOsrFrame(extra_slots * kWordSize);
   } else {
@@ -1065,9 +1011,8 @@
       __ movl(EAX, FieldAddress(EDX, ArgumentsDescriptor::count_offset()));
       __ cmpl(EAX, Immediate(Smi::RawValue(num_fixed_params)));
       __ j(NOT_EQUAL, &wrong_num_arguments, Assembler::kNearJump);
-      __ cmpl(EAX,
-              FieldAddress(EDX,
-                           ArgumentsDescriptor::positional_count_offset()));
+      __ cmpl(EAX, FieldAddress(
+                       EDX, ArgumentsDescriptor::positional_count_offset()));
       __ j(EQUAL, &correct_num_arguments, Assembler::kNearJump);
 
       __ Bind(&wrong_num_arguments);
@@ -1135,17 +1080,6 @@
 
   __ int3();
   GenerateDeferredCode();
-
-  BeginCodeSourceRange();
-  if (is_optimizing() && !FLAG_precompiled_mode) {
-    // Leave enough space for patching in case of lazy deoptimization.
-    __ nop(CallPattern::pattern_length_in_bytes());
-    lazy_deopt_return_pc_offset_ = assembler()->CodeSize();
-    __ Jmp(*StubCode::DeoptimizeLazyFromReturn_entry());
-    lazy_deopt_throw_pc_offset_ = assembler()->CodeSize();
-    __ Jmp(*StubCode::DeoptimizeLazyFromThrow_entry());
-  }
-  EndCodeSourceRange(TokenPosition::kDartCodeEpilogue);
 }
 
 
@@ -1203,20 +1137,16 @@
 }
 
 
-void FlowGraphCompiler::EmitUnoptimizedStaticCall(
-    intptr_t argument_count,
-    intptr_t deopt_id,
-    TokenPosition token_pos,
-    LocationSummary* locs,
-    const ICData& ic_data) {
+void FlowGraphCompiler::EmitUnoptimizedStaticCall(intptr_t argument_count,
+                                                  intptr_t deopt_id,
+                                                  TokenPosition token_pos,
+                                                  LocationSummary* locs,
+                                                  const ICData& ic_data) {
   const StubEntry& stub_entry =
       *StubCode::UnoptimizedStaticCallEntry(ic_data.NumArgsTested());
   __ LoadObject(ECX, ic_data);
-  GenerateDartCall(deopt_id,
-                   token_pos,
-                   stub_entry,
-                   RawPcDescriptors::kUnoptStaticCall,
-                   locs);
+  GenerateDartCall(deopt_id, token_pos, stub_entry,
+                   RawPcDescriptors::kUnoptStaticCall, locs);
   __ Drop(argument_count);
 }
 
@@ -1234,13 +1164,12 @@
 }
 
 
-void FlowGraphCompiler::EmitOptimizedInstanceCall(
-    const StubEntry& stub_entry,
-    const ICData& ic_data,
-    intptr_t argument_count,
-    intptr_t deopt_id,
-    TokenPosition token_pos,
-    LocationSummary* locs) {
+void FlowGraphCompiler::EmitOptimizedInstanceCall(const StubEntry& stub_entry,
+                                                  const ICData& ic_data,
+                                                  intptr_t argument_count,
+                                                  intptr_t deopt_id,
+                                                  TokenPosition token_pos,
+                                                  LocationSummary* locs) {
   ASSERT(Array::Handle(ic_data.arguments_descriptor()).Length() > 0);
   // Each ICData propagated from unoptimized to optimized code contains the
   // function that corresponds to the Dart function of that IC call. Due
@@ -1250,10 +1179,7 @@
   // Pass the function explicitly, it is used in IC stub.
   __ LoadObject(EBX, parsed_function().function());
   __ LoadObject(ECX, ic_data);
-  GenerateDartCall(deopt_id,
-                   token_pos,
-                   stub_entry,
-                   RawPcDescriptors::kIcCall,
+  GenerateDartCall(deopt_id, token_pos, stub_entry, RawPcDescriptors::kIcCall,
                    locs);
   __ Drop(argument_count);
 }
@@ -1267,10 +1193,7 @@
                                          LocationSummary* locs) {
   ASSERT(Array::Handle(ic_data.arguments_descriptor()).Length() > 0);
   __ LoadObject(ECX, ic_data);
-  GenerateDartCall(deopt_id,
-                   token_pos,
-                   stub_entry,
-                   RawPcDescriptors::kIcCall,
+  GenerateDartCall(deopt_id, token_pos, stub_entry, RawPcDescriptors::kIcCall,
                    locs);
   __ Drop(argument_count);
 }
@@ -1288,7 +1211,8 @@
   const Array& arguments_descriptor =
       Array::ZoneHandle(zone(), ic_data.arguments_descriptor());
   ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0));
-  const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(),
+  const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(
+      zone(),
       MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor));
 
   __ Comment("MegamorphicCall");
@@ -1316,8 +1240,7 @@
   __ call(EBX);
 
   __ Bind(&done);
-  AddCurrentDescriptor(RawPcDescriptors::kOther,
-      Thread::kNoDeoptId, token_pos);
+  AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, token_pos);
   RecordSafepoint(locs, slow_path_argument_count);
   const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
   // Precompilation not implemented on ia32 platform.
@@ -1333,12 +1256,11 @@
 }
 
 
-void FlowGraphCompiler::EmitSwitchableInstanceCall(
-    const ICData& ic_data,
-    intptr_t argument_count,
-    intptr_t deopt_id,
-    TokenPosition token_pos,
-    LocationSummary* locs) {
+void FlowGraphCompiler::EmitSwitchableInstanceCall(const ICData& ic_data,
+                                                   intptr_t argument_count,
+                                                   intptr_t deopt_id,
+                                                   TokenPosition token_pos,
+                                                   LocationSummary* locs) {
   // Only generated with precompilation.
   UNREACHABLE();
 }
@@ -1358,11 +1280,8 @@
   }
   // 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::CallStaticFunction_entry(),
-                   RawPcDescriptors::kOther,
-                   locs);
+  GenerateDartCall(deopt_id, token_pos, *StubCode::CallStaticFunction_entry(),
+                   RawPcDescriptors::kOther, locs);
   AddStaticCallTarget(function);
   __ Drop(argument_count);
 }
@@ -1391,15 +1310,14 @@
       __ Call(*StubCode::UnoptimizedIdenticalWithNumberCheck_entry());
     }
     if (token_pos.IsReal()) {
-      AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
-                           Thread::kNoDeoptId,
+      AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, Thread::kNoDeoptId,
                            token_pos);
     }
     // Stub returns result in flags (result of a cmpl, we need ZF computed).
     __ popl(reg);  // Discard constant.
     __ popl(reg);  // Restore 'reg'.
   } else {
-  __ CompareObject(reg, obj);
+    __ CompareObject(reg, obj);
   }
   return EQUAL;
 }
@@ -1419,8 +1337,7 @@
       __ Call(*StubCode::UnoptimizedIdenticalWithNumberCheck_entry());
     }
     if (token_pos.IsReal()) {
-      AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
-                           Thread::kNoDeoptId,
+      AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, Thread::kNoDeoptId,
                            token_pos);
     }
     // Stub returns result in flags (result of a cmpl, we need ZF computed).
@@ -1521,9 +1438,8 @@
   ASSERT(is_optimizing());
   ASSERT(!complete);
   __ Comment("EmitTestAndCall");
-  const Array& arguments_descriptor =
-      Array::ZoneHandle(zone(), ArgumentsDescriptor::New(argument_count,
-                                                         argument_names));
+  const Array& arguments_descriptor = Array::ZoneHandle(
+      zone(), ArgumentsDescriptor::New(argument_count, argument_names));
   // Load receiver into EAX.
   __ movl(EAX, Address(ESP, (argument_count - 1) * kWordSize));
   __ LoadObject(EDX, arguments_descriptor);
@@ -1544,13 +1460,11 @@
     }
     // 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_index,
+    GenerateDartCall(deopt_id, token_index,
                      *StubCode::CallStaticFunction_entry(),
-                     RawPcDescriptors::kOther,
-                     locs);
-    const Function& function = Function::ZoneHandle(
-        zone(), ic_data.GetTargetAt(0));
+                     RawPcDescriptors::kOther, locs);
+    const Function& function =
+        Function::ZoneHandle(zone(), ic_data.GetTargetAt(0));
     AddStaticCallTarget(function);
     __ Drop(argument_count);
     if (kNumChecks > 1) {
@@ -1587,11 +1501,9 @@
     }
     // 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_index,
+    GenerateDartCall(deopt_id, token_index,
                      *StubCode::CallStaticFunction_entry(),
-                     RawPcDescriptors::kOther,
-                     locs);
+                     RawPcDescriptors::kOther, locs);
     const Function& function = *sorted[i].target;
     AddStaticCallTarget(function);
     __ Drop(argument_count);
@@ -1663,7 +1575,8 @@
       if (constant.IsSmi() && (Smi::Cast(constant).Value() == 0)) {
         __ xorl(destination.reg(), destination.reg());
       } else if (constant.IsSmi() &&
-          (source.constant_instruction()->representation() == kUnboxedInt32)) {
+                 (source.constant_instruction()->representation() ==
+                  kUnboxedInt32)) {
         __ movl(destination.reg(), Immediate(Smi::Cast(constant).Value()));
       } else {
         __ LoadObjectSafely(destination.reg(), constant);
@@ -1675,7 +1588,7 @@
         __ pushl(EAX);
         __ LoadObject(EAX, constant);
         __ movsd(destination.fpu_reg(),
-            FieldAddress(EAX, Double::value_offset()));
+                 FieldAddress(EAX, Double::value_offset()));
         __ popl(EAX);
       } else if (Utils::DoublesBitEqual(constant.value(), 0.0)) {
         __ xorps(destination.fpu_reg(), destination.fpu_reg());
@@ -1731,17 +1644,15 @@
     __ movaps(source.fpu_reg(), destination.fpu_reg());
     __ movaps(destination.fpu_reg(), XMM0);
   } else if (source.IsFpuRegister() || destination.IsFpuRegister()) {
-    ASSERT(destination.IsDoubleStackSlot() ||
-           destination.IsQuadStackSlot() ||
-           source.IsDoubleStackSlot() ||
-           source.IsQuadStackSlot());
-    bool double_width = destination.IsDoubleStackSlot() ||
-                        source.IsDoubleStackSlot();
-    XmmRegister reg = source.IsFpuRegister() ? source.fpu_reg()
-                                             : destination.fpu_reg();
+    ASSERT(destination.IsDoubleStackSlot() || destination.IsQuadStackSlot() ||
+           source.IsDoubleStackSlot() || source.IsQuadStackSlot());
+    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();
+                                      ? destination.ToStackSlotAddress()
+                                      : source.ToStackSlotAddress();
 
     if (double_width) {
       __ movsd(XMM0, slot_address);
diff --git a/runtime/vm/flow_graph_compiler_mips.cc b/runtime/vm/flow_graph_compiler_mips.cc
index 07117a2..fddc901 100644
--- a/runtime/vm/flow_graph_compiler_mips.cc
+++ b/runtime/vm/flow_graph_compiler_mips.cc
@@ -25,18 +25,6 @@
 DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization.");
 
 
-void MegamorphicSlowPath::EmitNativeCode(FlowGraphCompiler* compiler) {
-  Assembler* assembler = compiler->assembler();
-#define __ assembler->
-  __ Bind(entry_label());
-  __ Comment("MegamorphicSlowPath");
-  compiler->EmitMegamorphicInstanceCall(ic_data_, argument_count_, deopt_id_,
-                                        token_pos_, locs_, try_index_);
-  __ b(exit_label());
-#undef __
-}
-
-
 FlowGraphCompiler::~FlowGraphCompiler() {
   // BlockInfos are zone-allocated, so their destructors are not called.
   // Verify the labels explicitly here.
@@ -128,8 +116,7 @@
 
   // For the innermost environment, set outgoing arguments and the locals.
   for (intptr_t i = current->Length() - 1;
-       i >= current->fixed_parameter_count();
-       i--) {
+       i >= current->fixed_parameter_count(); i--) {
     builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++);
   }
 
@@ -142,26 +129,21 @@
 
     // For any outer environment the deopt id is that of the call instruction
     // which is recorded in the outer environment.
-    builder->AddReturnAddress(
-        current->function(),
-        Thread::ToDeoptAfter(current->deopt_id()),
-        slot_ix++);
+    builder->AddReturnAddress(current->function(),
+                              Thread::ToDeoptAfter(current->deopt_id()),
+                              slot_ix++);
 
     // The values of outgoing arguments can be changed from the inlined call so
     // we must read them from the previous environment.
     for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) {
-      builder->AddCopy(previous->ValueAt(i),
-                       previous->LocationAt(i),
+      builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i),
                        slot_ix++);
     }
 
     // Set the locals, note that outgoing arguments are not in the environment.
     for (intptr_t i = current->Length() - 1;
-         i >= current->fixed_parameter_count();
-         i--) {
-      builder->AddCopy(current->ValueAt(i),
-                       current->LocationAt(i),
-                       slot_ix++);
+         i >= current->fixed_parameter_count(); i--) {
+      builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++);
     }
 
     // Iterate on the outer environment.
@@ -293,7 +275,7 @@
     const TypeArguments& type_arguments =
         TypeArguments::ZoneHandle(zone(), type.arguments());
     const bool is_raw_type = type_arguments.IsNull() ||
-        type_arguments.IsRaw(from_index, num_type_params);
+                             type_arguments.IsRaw(from_index, num_type_params);
     if (is_raw_type) {
       const Register kClassIdReg = T0;
       // dynamic type argument, check only classes.
@@ -308,8 +290,8 @@
     }
     // If one type argument only, check if type argument is Object or dynamic.
     if (type_arguments.Length() == 1) {
-      const AbstractType& tp_argument = AbstractType::ZoneHandle(zone(),
-          type_arguments.TypeAt(0));
+      const AbstractType& tp_argument =
+          AbstractType::ZoneHandle(zone(), type_arguments.TypeAt(0));
       ASSERT(!tp_argument.IsMalformed());
       if (tp_argument.IsType()) {
         ASSERT(tp_argument.HasResolvedTypeClass());
@@ -327,12 +309,9 @@
   const Register kTypeArgumentsReg = kNoRegister;
   const Register kTempReg = kNoRegister;
   // A0: instance (must be preserved).
-  return GenerateCallSubtypeTestStub(kTestTypeTwoArgs,
-                                     kInstanceReg,
-                                     kTypeArgumentsReg,
-                                     kTempReg,
-                                     is_instance_lbl,
-                                     is_not_instance_lbl);
+  return GenerateCallSubtypeTestStub(kTestTypeTwoArgs, kInstanceReg,
+                                     kTypeArgumentsReg, kTempReg,
+                                     is_instance_lbl, is_not_instance_lbl);
 }
 
 
@@ -371,11 +350,8 @@
   __ andi(T0, A0, Immediate(kSmiTagMask));
   // If instance is Smi, check directly.
   const Class& smi_class = Class::Handle(zone(), Smi::Class());
-  if (smi_class.IsSubtypeOf(TypeArguments::Handle(zone()),
-                            type_class,
-                            TypeArguments::Handle(zone()),
-                            NULL,
-                            NULL,
+  if (smi_class.IsSubtypeOf(TypeArguments::Handle(zone()), type_class,
+                            TypeArguments::Handle(zone()), NULL, NULL,
                             Heap::kOld)) {
     __ beq(T0, ZR, is_instance_lbl);
   } else {
@@ -394,8 +370,8 @@
   // Custom checking for numbers (Smi, Mint, Bigint and Double).
   // Note that instance is not Smi (checked above).
   if (type.IsNumberType() || type.IsIntType() || type.IsDoubleType()) {
-    GenerateNumberTypeCheck(
-        kClassIdReg, type, is_instance_lbl, is_not_instance_lbl);
+    GenerateNumberTypeCheck(kClassIdReg, type, is_instance_lbl,
+                            is_not_instance_lbl);
     return false;
   }
   if (type.IsStringType()) {
@@ -409,7 +385,7 @@
   }
   // Compare if the classes are equal.
   if (!type_class.is_abstract()) {
-  __ BranchEqual(kClassIdReg, Immediate(type_class.id()), is_instance_lbl);
+    __ BranchEqual(kClassIdReg, Immediate(type_class.id()), is_instance_lbl);
   }
   // Otherwise fallthrough.
   return true;
@@ -440,12 +416,9 @@
 
   const Register kTypeArgumentsReg = kNoRegister;
   const Register kTempReg = kNoRegister;
-  return GenerateCallSubtypeTestStub(kTestTypeOneArg,
-                                     kInstanceReg,
-                                     kTypeArgumentsReg,
-                                     kTempReg,
-                                     is_instance_lbl,
-                                     is_not_instance_lbl);
+  return GenerateCallSubtypeTestStub(kTestTypeOneArg, kInstanceReg,
+                                     kTypeArgumentsReg, kTempReg,
+                                     is_instance_lbl, is_not_instance_lbl);
 }
 
 
@@ -468,22 +441,21 @@
     __ LoadObject(T7, Object::null_object());
     __ beq(A1, T7, is_instance_lbl);
     __ lw(T2,
-        FieldAddress(A1, TypeArguments::type_at_offset(type_param.index())));
+          FieldAddress(A1, TypeArguments::type_at_offset(type_param.index())));
     // R2: concrete type of type.
     // Check if type argument is dynamic.
-    __ BranchEqual(T2,
-        Object::dynamic_type(), is_instance_lbl);
-    __ BranchEqual(T2,
-        Type::ZoneHandle(zone(), Type::ObjectType()), is_instance_lbl);
+    __ BranchEqual(T2, Object::dynamic_type(), is_instance_lbl);
+    __ BranchEqual(T2, Type::ZoneHandle(zone(), Type::ObjectType()),
+                   is_instance_lbl);
 
     // For Smi check quickly against int and num interfaces.
     Label not_smi;
     __ andi(CMPRES1, A0, Immediate(kSmiTagMask));
     __ bne(CMPRES1, ZR, &not_smi);  // Value is Smi?
-    __ BranchEqual(T2,
-        Type::ZoneHandle(zone(), Type::IntType()), is_instance_lbl);
-    __ BranchEqual(T2,
-        Type::ZoneHandle(zone(), Type::Number()), is_instance_lbl);
+    __ BranchEqual(T2, Type::ZoneHandle(zone(), Type::IntType()),
+                   is_instance_lbl);
+    __ BranchEqual(T2, Type::ZoneHandle(zone(), Type::Number()),
+                   is_instance_lbl);
     // Smi must be handled in runtime.
     Label fall_through;
     __ b(&fall_through);
@@ -494,14 +466,10 @@
     const Register kInstanceReg = A0;
     const Register kTypeArgumentsReg = A1;
     const Register kTempReg = kNoRegister;
-    const SubtypeTestCache& type_test_cache =
-        SubtypeTestCache::ZoneHandle(zone(),
-            GenerateCallSubtypeTestStub(kTestTypeThreeArgs,
-                                        kInstanceReg,
-                                        kTypeArgumentsReg,
-                                        kTempReg,
-                                        is_instance_lbl,
-                                        is_not_instance_lbl));
+    const SubtypeTestCache& type_test_cache = SubtypeTestCache::ZoneHandle(
+        zone(), GenerateCallSubtypeTestStub(
+                    kTestTypeThreeArgs, kInstanceReg, kTypeArgumentsReg,
+                    kTempReg, is_instance_lbl, is_not_instance_lbl));
     __ Bind(&fall_through);
     return type_test_cache.raw();
   }
@@ -514,12 +482,9 @@
     // Uninstantiated type class is known at compile time, but the type
     // arguments are determined at runtime by the instantiator.
     const Register kTempReg = kNoRegister;
-    return GenerateCallSubtypeTestStub(kTestTypeThreeArgs,
-                                       kInstanceReg,
-                                       kTypeArgumentsReg,
-                                       kTempReg,
-                                       is_instance_lbl,
-                                       is_not_instance_lbl);
+    return GenerateCallSubtypeTestStub(kTestTypeThreeArgs, kInstanceReg,
+                                       kTypeArgumentsReg, kTempReg,
+                                       is_instance_lbl, is_not_instance_lbl);
   }
   return SubtypeTestCache::null();
 }
@@ -551,17 +516,12 @@
     // function type) of a non-parameterized class or with a raw dst type of
     // a parameterized class.
     if (type.IsFunctionType() || (type_class.NumTypeArguments() > 0)) {
-      return GenerateInstantiatedTypeWithArgumentsTest(token_pos,
-                                                       type,
-                                                       is_instance_lbl,
-                                                       is_not_instance_lbl);
+      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);
+    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.
@@ -571,9 +531,7 @@
       return SubtypeTestCache::null();
     }
   }
-  return GenerateUninstantiatedTypeTest(token_pos,
-                                        type,
-                                        is_instance_lbl,
+  return GenerateUninstantiatedTypeTest(token_pos, type, is_instance_lbl,
                                         is_not_instance_lbl);
 }
 
@@ -611,13 +569,13 @@
     // time, since an uninstantiated type at compile time could be Object or
     // dynamic at run time.
     __ BranchEqual(A0, Object::null_object(),
-        type.IsNullType() ? &is_instance : &is_not_instance);
+                   type.IsNullType() ? &is_instance : &is_not_instance);
   }
 
   // Generate inline instanceof test.
   SubtypeTestCache& test_cache = SubtypeTestCache::ZoneHandle(zone());
-  test_cache = GenerateInlineInstanceof(token_pos, type,
-                                        &is_instance, &is_not_instance);
+  test_cache =
+      GenerateInlineInstanceof(token_pos, type, &is_instance, &is_not_instance);
 
   // test_cache is null if there is no fall-through.
   Label done;
@@ -629,10 +587,10 @@
     __ addiu(SP, SP, Immediate(-5 * kWordSize));
     __ LoadObject(TMP, Object::null_object());
     __ sw(TMP, Address(SP, 4 * kWordSize));  // Make room for the result.
-    __ sw(A0, Address(SP, 3 * kWordSize));  // Push the instance.
+    __ sw(A0, Address(SP, 3 * kWordSize));   // Push the instance.
     __ LoadObject(TMP, type);
     __ sw(TMP, Address(SP, 2 * kWordSize));  // Push the type.
-    __ sw(A1, Address(SP, 1 * kWordSize));  // Push type arguments.
+    __ sw(A1, Address(SP, 1 * kWordSize));   // Push type arguments.
     __ LoadUniqueObject(A0, test_cache);
     __ sw(A0, Address(SP, 0 * kWordSize));
     GenerateRuntimeCall(token_pos, deopt_id, kInstanceofRuntimeEntry, 4, locs);
@@ -700,16 +658,13 @@
     __ addiu(SP, SP, Immediate(-4 * kWordSize));
     __ LoadObject(TMP, Object::null_object());
     __ sw(TMP, Address(SP, 3 * kWordSize));  // Make room for the result.
-    __ sw(A0, Address(SP, 2 * kWordSize));  // Push the source object.
+    __ sw(A0, Address(SP, 2 * kWordSize));   // Push the source object.
     __ LoadObject(TMP, dst_name);
     __ sw(TMP, Address(SP, 1 * kWordSize));  // Push the destination name.
     __ LoadObject(TMP, dst_type);
     __ sw(TMP, Address(SP, 0 * kWordSize));  // Push the destination type.
 
-    GenerateRuntimeCall(token_pos,
-                        deopt_id,
-                        kBadTypeErrorRuntimeEntry,
-                        3,
+    GenerateRuntimeCall(token_pos, deopt_id, kBadTypeErrorRuntimeEntry, 3,
                         locs);
     // We should never return here.
     __ break_(0);
@@ -723,8 +678,8 @@
 
   // Generate inline type check, linking to runtime call if not assignable.
   SubtypeTestCache& test_cache = SubtypeTestCache::ZoneHandle(zone());
-  test_cache = GenerateInlineInstanceof(token_pos, dst_type,
-                                        &is_assignable, &runtime_call);
+  test_cache = GenerateInlineInstanceof(token_pos, dst_type, &is_assignable,
+                                        &runtime_call);
 
   __ Bind(&runtime_call);
   // Load instantiator type arguments (A1).
@@ -733,10 +688,10 @@
   __ addiu(SP, SP, Immediate(-6 * kWordSize));
   __ LoadObject(TMP, Object::null_object());
   __ sw(TMP, Address(SP, 5 * kWordSize));  // Make room for the result.
-  __ sw(A0, Address(SP, 4 * kWordSize));  // Push the source object.
+  __ sw(A0, Address(SP, 4 * kWordSize));   // Push the source object.
   __ LoadObject(TMP, dst_type);
   __ sw(TMP, Address(SP, 3 * kWordSize));  // Push the type of the destination.
-  __ sw(A1, Address(SP, 2 * kWordSize));  // Push type arguments.
+  __ sw(A1, Address(SP, 2 * kWordSize));   // Push type arguments.
   __ LoadObject(TMP, dst_name);
   __ sw(TMP, Address(SP, 1 * kWordSize));  // Push the name of the destination.
   __ LoadUniqueObject(T0, test_cache);
@@ -827,9 +782,9 @@
   // Copy or initialize optional named arguments.
   Label all_arguments_processed;
 #ifdef DEBUG
-    const bool check_correct_named_args = true;
+  const bool check_correct_named_args = true;
 #else
-    const bool check_correct_named_args = function.IsClosureFunction();
+  const bool check_correct_named_args = function.IsClosureFunction();
 #endif
   if (num_opt_named_params > 0) {
     __ Comment("There are named parameters");
@@ -853,16 +808,14 @@
     }
     // 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[kParamEndSlotFromFp + num_args - 0]; num_args (T1) is Smi.
     __ sll(T3, T1, 1);
     __ addu(T1, FP, T3);
     __ AddImmediate(T1, kParamEndSlotFromFp * kWordSize);
     // Let T0 point to the entry of the first named argument.
-    __ AddImmediate(T0, S4,
-        ArgumentsDescriptor::first_named_entry_offset() - kHeapObjectTag);
+    __ AddImmediate(T0, S4, 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];
@@ -908,8 +861,7 @@
   } else {
     ASSERT(num_opt_pos_params > 0);
     __ Comment("There are optional positional parameters");
-    __ lw(T2,
-          FieldAddress(S4, ArgumentsDescriptor::positional_count_offset()));
+    __ lw(T2, FieldAddress(S4, ArgumentsDescriptor::positional_count_offset()));
     __ SmiUntag(T2);
     for (int i = 0; i < num_opt_pos_params; i++) {
       Label next_parameter;
@@ -1002,8 +954,7 @@
 
 void FlowGraphCompiler::EmitFrameEntry() {
   const Function& function = parsed_function().function();
-  if (CanOptimizeFunction() &&
-      function.IsOptimizable() &&
+  if (CanOptimizeFunction() && function.IsOptimizable() &&
       (!is_optimizing() || may_reoptimize())) {
     __ Comment("Invocation Count Check");
     const Register function_reg = T0;
@@ -1023,8 +974,8 @@
 
     // Skip Branch if T1 is less than the threshold.
     Label dont_branch;
-    __ BranchSignedLess(
-        T1, Immediate(GetOptimizationThreshold()), &dont_branch);
+    __ BranchSignedLess(T1, Immediate(GetOptimizationThreshold()),
+                        &dont_branch);
 
     ASSERT(function_reg == T0);
     __ Branch(*StubCode::OptimizeFunction_entry(), new_pp);
@@ -1033,9 +984,8 @@
   }
   __ Comment("Enter frame");
   if (flow_graph().IsCompiledForOsr()) {
-    intptr_t extra_slots = StackSize()
-        - flow_graph().num_stack_locals()
-        - flow_graph().num_copied_params();
+    intptr_t extra_slots = StackSize() - flow_graph().num_stack_locals() -
+                           flow_graph().num_copied_params();
     ASSERT(extra_slots >= 0);
     __ EnterOsrFrame(extra_slots * kWordSize);
   } else {
@@ -1054,6 +1004,13 @@
 //   S4: arguments descriptor array.
 void FlowGraphCompiler::CompileGraph() {
   InitCompiler();
+  const Function& function = parsed_function().function();
+
+#ifdef DART_PRECOMPILER
+  if (function.IsDynamicFunction()) {
+    __ MonomorphicCheckedEntry();
+  }
+#endif  // DART_PRECOMPILER
 
   if (TryIntrinsify()) {
     // Skip regular code generation.
@@ -1061,8 +1018,7 @@
   }
 
   EmitFrameEntry();
-
-  const Function& function = parsed_function().function();
+  ASSERT(assembler()->constant_pool_allowed());
 
   const int num_fixed_params = function.num_fixed_parameters();
   const int num_copied_params = parsed_function().num_copied_params();
@@ -1083,8 +1039,8 @@
       __ BranchNotEqual(T0, Immediate(Smi::RawValue(num_fixed_params)),
                         &wrong_num_arguments);
 
-      __ lw(T1, FieldAddress(S4,
-                             ArgumentsDescriptor::positional_count_offset()));
+      __ lw(T1,
+            FieldAddress(S4, ArgumentsDescriptor::positional_count_offset()));
       __ beq(T0, T1, &correct_num_arguments);
       __ Bind(&wrong_num_arguments);
       __ LeaveDartFrame(kKeepCalleePP);  // Arguments are still on the stack.
@@ -1138,21 +1094,6 @@
 
   __ break_(0);
   GenerateDeferredCode();
-
-  BeginCodeSourceRange();
-  if (is_optimizing() && !FLAG_precompiled_mode) {
-    // Leave enough space for patching in case of lazy deoptimization.
-    for (intptr_t i = 0;
-      i < CallPattern::kDeoptCallLengthInInstructions;
-      ++i) {
-      __ nop();
-    }
-    lazy_deopt_return_pc_offset_ = assembler()->CodeSize();
-    __ Branch(*StubCode::DeoptimizeLazyFromReturn_entry());
-    lazy_deopt_throw_pc_offset_ = assembler()->CodeSize();
-    __ Branch(*StubCode::DeoptimizeLazyFromThrow_entry());
-  }
-  EndCodeSourceRange(TokenPosition::kDartCodeEpilogue);
 }
 
 
@@ -1160,6 +1101,16 @@
                                      const StubEntry& stub_entry,
                                      RawPcDescriptors::Kind kind,
                                      LocationSummary* locs) {
+  __ BranchLink(stub_entry);
+  AddCurrentDescriptor(kind, Thread::kNoDeoptId, token_pos);
+  RecordSafepoint(locs);
+}
+
+
+void FlowGraphCompiler::GeneratePatchableCall(TokenPosition token_pos,
+                                              const StubEntry& stub_entry,
+                                              RawPcDescriptors::Kind kind,
+                                              LocationSummary* locs) {
   __ BranchLinkPatchable(stub_entry);
   AddCurrentDescriptor(kind, Thread::kNoDeoptId, token_pos);
   RecordSafepoint(locs);
@@ -1182,9 +1133,7 @@
   } else {
     // Add deoptimization continuation point after the call and before the
     // arguments are removed.
-    AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                         deopt_id_after,
-                         token_pos);
+    AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
   }
 }
 
@@ -1211,9 +1160,7 @@
   } else {
     // Add deoptimization continuation point after the call and before the
     // arguments are removed.
-    AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                         deopt_id_after,
-                         token_pos);
+    AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
   }
   AddStaticCallTarget(target);
 }
@@ -1236,9 +1183,7 @@
     } else {
       // Add deoptimization continuation point after the call and before the
       // arguments are removed.
-      AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                           deopt_id_after,
-                           token_pos);
+      AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
     }
   }
 }
@@ -1259,13 +1204,12 @@
 }
 
 
-void FlowGraphCompiler::EmitOptimizedInstanceCall(
-    const StubEntry& stub_entry,
-    const ICData& ic_data,
-    intptr_t argument_count,
-    intptr_t deopt_id,
-    TokenPosition token_pos,
-    LocationSummary* locs) {
+void FlowGraphCompiler::EmitOptimizedInstanceCall(const StubEntry& stub_entry,
+                                                  const ICData& ic_data,
+                                                  intptr_t argument_count,
+                                                  intptr_t deopt_id,
+                                                  TokenPosition token_pos,
+                                                  LocationSummary* locs) {
   ASSERT(Array::Handle(zone(), ic_data.arguments_descriptor()).Length() > 0);
   // Each ICData propagated from unoptimized to optimized code contains the
   // function that corresponds to the Dart function of that IC call. Due
@@ -1276,10 +1220,7 @@
   __ Comment("OptimizedInstanceCall");
   __ LoadObject(T0, parsed_function().function());
   __ LoadUniqueObject(S5, ic_data);
-  GenerateDartCall(deopt_id,
-                   token_pos,
-                   stub_entry,
-                   RawPcDescriptors::kIcCall,
+  GenerateDartCall(deopt_id, token_pos, stub_entry, RawPcDescriptors::kIcCall,
                    locs);
   __ Drop(argument_count);
 }
@@ -1294,10 +1235,7 @@
   ASSERT(Array::Handle(zone(), ic_data.arguments_descriptor()).Length() > 0);
   __ Comment("InstanceCall");
   __ LoadUniqueObject(S5, ic_data);
-  GenerateDartCall(deopt_id,
-                   token_pos,
-                   stub_entry,
-                   RawPcDescriptors::kIcCall,
+  GenerateDartCall(deopt_id, token_pos, stub_entry, RawPcDescriptors::kIcCall,
                    locs);
   __ Comment("InstanceCall return");
   __ Drop(argument_count);
@@ -1316,7 +1254,8 @@
   const Array& arguments_descriptor =
       Array::ZoneHandle(zone(), ic_data.arguments_descriptor());
   ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0));
-  const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(),
+  const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(
+      zone(),
       MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor));
 
   __ Comment("MegamorphicCall");
@@ -1327,12 +1266,11 @@
     Label megamorphic_call;
     __ Comment("Inlined get:hashCode for Smi and OneByteString");
     __ andi(CMPRES1, T0, Immediate(kSmiTagMask));
-    __ beq(CMPRES1, ZR, &done);  // Is Smi.
+    __ beq(CMPRES1, ZR, &done);    // Is Smi.
     __ delay_slot()->mov(V0, T0);  // Move Smi hashcode to V0.
 
     __ LoadClassId(CMPRES1, T0);  // Class ID check.
-    __ BranchNotEqual(
-        CMPRES1, Immediate(kOneByteStringCid), &megamorphic_call);
+    __ BranchNotEqual(CMPRES1, Immediate(kOneByteStringCid), &megamorphic_call);
 
     __ lw(V0, FieldAddress(T0, String::hash_offset()));
     __ bne(V0, ZR, &done);
@@ -1353,18 +1291,16 @@
     if (try_index == CatchClauseNode::kInvalidTryIndex) {
       try_index = CurrentTryIndex();
     }
-    pc_descriptors_list()->AddDescriptor(RawPcDescriptors::kOther,
-                                         assembler()->CodeSize(),
-                                         Thread::kNoDeoptId,
-                                         token_pos,
-                                         try_index);
+    pc_descriptors_list()->AddDescriptor(
+        RawPcDescriptors::kOther, assembler()->CodeSize(), Thread::kNoDeoptId,
+        token_pos, try_index);
   } else if (is_optimizing()) {
-    AddCurrentDescriptor(RawPcDescriptors::kOther,
-        Thread::kNoDeoptId, token_pos);
+    AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId,
+                         token_pos);
     AddDeoptIndexAtCall(deopt_id_after);
   } else {
-    AddCurrentDescriptor(RawPcDescriptors::kOther,
-        Thread::kNoDeoptId, token_pos);
+    AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId,
+                         token_pos);
     // Add deoptimization continuation point after the call and before the
     // arguments are removed.
     AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
@@ -1373,25 +1309,23 @@
 }
 
 
-void FlowGraphCompiler::EmitSwitchableInstanceCall(
-    const ICData& ic_data,
-    intptr_t argument_count,
-    intptr_t deopt_id,
-    TokenPosition token_pos,
-    LocationSummary* locs) {
+void FlowGraphCompiler::EmitSwitchableInstanceCall(const ICData& ic_data,
+                                                   intptr_t argument_count,
+                                                   intptr_t deopt_id,
+                                                   TokenPosition token_pos,
+                                                   LocationSummary* locs) {
   ASSERT(ic_data.NumArgsTested() == 1);
-  const Code& initial_stub = Code::ZoneHandle(
-      StubCode::ICCallThroughFunction_entry()->code());
+  const Code& initial_stub =
+      Code::ZoneHandle(StubCode::ICCallThroughFunction_entry()->code());
 
   __ Comment("SwitchableCall");
   __ lw(T0, Address(SP, (argument_count - 1) * kWordSize));
-  __ LoadUniqueObject(S5, ic_data);
   __ LoadUniqueObject(CODE_REG, initial_stub);
   __ lw(T9, FieldAddress(CODE_REG, Code::checked_entry_point_offset()));
+  __ LoadUniqueObject(S5, ic_data);
   __ jalr(T9);
 
-  AddCurrentDescriptor(RawPcDescriptors::kOther,
-      Thread::kNoDeoptId, token_pos);
+  AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, token_pos);
   RecordSafepoint(locs);
   const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
   if (is_optimizing()) {
@@ -1405,20 +1339,16 @@
 }
 
 
-void FlowGraphCompiler::EmitUnoptimizedStaticCall(
-    intptr_t argument_count,
-    intptr_t deopt_id,
-    TokenPosition token_pos,
-    LocationSummary* locs,
-    const ICData& ic_data) {
+void FlowGraphCompiler::EmitUnoptimizedStaticCall(intptr_t argument_count,
+                                                  intptr_t deopt_id,
+                                                  TokenPosition token_pos,
+                                                  LocationSummary* locs,
+                                                  const ICData& ic_data) {
   const StubEntry* stub_entry =
       StubCode::UnoptimizedStaticCallEntry(ic_data.NumArgsTested());
   __ LoadObject(S5, ic_data);
-  GenerateDartCall(deopt_id,
-                   token_pos,
-                   *stub_entry,
-                   RawPcDescriptors::kUnoptStaticCall,
-                   locs);
+  GenerateDartCall(deopt_id, token_pos, *stub_entry,
+                   RawPcDescriptors::kUnoptStaticCall, locs);
   __ Drop(argument_count);
 }
 
@@ -1439,12 +1369,9 @@
   }
   // 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.
-  GenerateStaticDartCall(deopt_id,
-                         token_pos,
+  GenerateStaticDartCall(deopt_id, token_pos,
                          *StubCode::CallStaticFunction_entry(),
-                         RawPcDescriptors::kOther,
-                         locs,
-                         function);
+                         RawPcDescriptors::kOther, locs, function);
   __ Drop(argument_count);
 }
 
@@ -1471,13 +1398,12 @@
           *StubCode::UnoptimizedIdenticalWithNumberCheck_entry());
     }
     if (token_pos.IsReal()) {
-      AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
-                           Thread::kNoDeoptId,
+      AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, Thread::kNoDeoptId,
                            token_pos);
     }
     __ Comment("EqualityRegConstCompare return");
     // Stub returns result in CMPRES1 (if it is 0, then reg and obj are equal).
-    __ lw(reg, Address(SP, 1 * kWordSize));  // Restore 'reg'.
+    __ lw(reg, Address(SP, 1 * kWordSize));      // Restore 'reg'.
     __ addiu(SP, SP, Immediate(2 * kWordSize));  // Discard constant.
     return Condition(CMPRES1, ZR, EQ);
   } else {
@@ -1506,8 +1432,7 @@
           *StubCode::UnoptimizedIdenticalWithNumberCheck_entry());
     }
     if (token_pos.IsReal()) {
-      AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
-                           Thread::kNoDeoptId,
+      AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, Thread::kNoDeoptId,
                            token_pos);
     }
     __ Comment("EqualityRegRegCompare return");
@@ -1630,9 +1555,8 @@
                                         bool complete) {
   ASSERT(is_optimizing());
   __ Comment("EmitTestAndCall");
-  const Array& arguments_descriptor =
-      Array::ZoneHandle(zone(), ArgumentsDescriptor::New(argument_count,
-                                                         argument_names));
+  const Array& arguments_descriptor = Array::ZoneHandle(
+      zone(), ArgumentsDescriptor::New(argument_count, argument_names));
 
   // Load receiver into T0.
   __ LoadFromOffset(T0, SP, (argument_count - 1) * kWordSize);
@@ -1654,14 +1578,11 @@
     }
     // 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.
-    const Function& function = Function::ZoneHandle(
-        zone(), ic_data.GetTargetAt(0));
-    GenerateStaticDartCall(deopt_id,
-                           token_index,
+    const Function& function =
+        Function::ZoneHandle(zone(), ic_data.GetTargetAt(0));
+    GenerateStaticDartCall(deopt_id, token_index,
                            *StubCode::CallStaticFunction_entry(),
-                           RawPcDescriptors::kOther,
-                           locs,
-                           function);
+                           RawPcDescriptors::kOther, locs, function);
     __ Drop(argument_count);
     if (kNumChecks > 1) {
       __ b(match_found);
@@ -1705,12 +1626,9 @@
     // 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.
     const Function& function = *sorted[i].target;
-    GenerateStaticDartCall(deopt_id,
-                           token_index,
+    GenerateStaticDartCall(deopt_id, token_index,
                            *StubCode::CallStaticFunction_entry(),
-                           RawPcDescriptors::kOther,
-                           locs,
-                           function);
+                           RawPcDescriptors::kOther, locs, function);
     __ Drop(argument_count);
     if (!kIsLastCheck) {
       __ b(match_found);
@@ -1786,7 +1704,7 @@
     } else if (destination.IsFpuRegister()) {
       __ LoadObject(TMP, constant);
       __ LoadDFromOffset(destination.fpu_reg(), TMP,
-          Double::value_offset() - kHeapObjectTag);
+                         Double::value_offset() - kHeapObjectTag);
     } else if (destination.IsDoubleStackSlot()) {
       const intptr_t dest_offset = destination.ToStackSlotOffset();
       __ LoadObject(TMP, constant);
@@ -1822,11 +1740,10 @@
     __ mov(source.reg(), destination.reg());
     __ mov(destination.reg(), TMP);
   } else if (source.IsRegister() && destination.IsStackSlot()) {
-    Exchange(source.reg(),
-             destination.base_reg(), destination.ToStackSlotOffset());
+    Exchange(source.reg(), destination.base_reg(),
+             destination.ToStackSlotOffset());
   } else if (source.IsStackSlot() && destination.IsRegister()) {
-    Exchange(destination.reg(),
-             source.base_reg(), source.ToStackSlotOffset());
+    Exchange(destination.reg(), source.base_reg(), source.ToStackSlotOffset());
   } else if (source.IsStackSlot() && destination.IsStackSlot()) {
     Exchange(source.base_reg(), source.ToStackSlotOffset(),
              destination.base_reg(), destination.ToStackSlotOffset());
@@ -1838,14 +1755,13 @@
     __ movd(dst, DTMP);
   } else if (source.IsFpuRegister() || destination.IsFpuRegister()) {
     ASSERT(destination.IsDoubleStackSlot() || source.IsDoubleStackSlot());
-    DRegister reg = source.IsFpuRegister() ? source.fpu_reg()
-                                           : destination.fpu_reg();
-    Register base_reg = source.IsFpuRegister()
-        ? destination.base_reg()
-        : source.base_reg();
+    DRegister reg =
+        source.IsFpuRegister() ? source.fpu_reg() : destination.fpu_reg();
+    Register base_reg =
+        source.IsFpuRegister() ? destination.base_reg() : source.base_reg();
     const intptr_t slot_offset = source.IsFpuRegister()
-        ? destination.ToStackSlotOffset()
-        : source.ToStackSlotOffset();
+                                     ? destination.ToStackSlotOffset()
+                                     : source.ToStackSlotOffset();
     __ LoadDFromOffset(DTMP, base_reg, slot_offset);
     __ StoreDToOffset(reg, base_reg, slot_offset);
     __ movd(reg, DTMP);
diff --git a/runtime/vm/flow_graph_compiler_x64.cc b/runtime/vm/flow_graph_compiler_x64.cc
index 67223b5..0944b5e 100644
--- a/runtime/vm/flow_graph_compiler_x64.cc
+++ b/runtime/vm/flow_graph_compiler_x64.cc
@@ -27,18 +27,6 @@
 DECLARE_FLAG(bool, enable_simd_inline);
 
 
-void MegamorphicSlowPath::EmitNativeCode(FlowGraphCompiler* compiler) {
-  Assembler* assembler = compiler->assembler();
-#define __ assembler->
-  __ Bind(entry_label());
-  __ Comment("MegamorphicSlowPath");
-  compiler->EmitMegamorphicInstanceCall(ic_data_, argument_count_, deopt_id_,
-                                        token_pos_, locs_, try_index_);
-  __ jmp(exit_label());
-#undef __
-}
-
-
 FlowGraphCompiler::~FlowGraphCompiler() {
   // BlockInfos are zone-allocated, so their destructors are not called.
   // Verify the labels explicitly here.
@@ -64,7 +52,6 @@
 }
 
 
-
 bool FlowGraphCompiler::SupportsSinCos() {
   return true;
 }
@@ -128,8 +115,7 @@
 
   // For the innermost environment, set outgoing arguments and the locals.
   for (intptr_t i = current->Length() - 1;
-       i >= current->fixed_parameter_count();
-       i--) {
+       i >= current->fixed_parameter_count(); i--) {
     builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++);
   }
 
@@ -142,26 +128,21 @@
 
     // For any outer environment the deopt id is that of the call instruction
     // which is recorded in the outer environment.
-    builder->AddReturnAddress(
-        current->function(),
-        Thread::ToDeoptAfter(current->deopt_id()),
-        slot_ix++);
+    builder->AddReturnAddress(current->function(),
+                              Thread::ToDeoptAfter(current->deopt_id()),
+                              slot_ix++);
 
     // The values of outgoing arguments can be changed from the inlined call so
     // we must read them from the previous environment.
     for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) {
-      builder->AddCopy(previous->ValueAt(i),
-                       previous->LocationAt(i),
+      builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i),
                        slot_ix++);
     }
 
     // Set the locals, note that outgoing arguments are not in the environment.
     for (intptr_t i = current->Length() - 1;
-         i >= current->fixed_parameter_count();
-         i--) {
-      builder->AddCopy(current->ValueAt(i),
-                       current->LocationAt(i),
-                       slot_ix++);
+         i >= current->fixed_parameter_count(); i--) {
+      builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++);
     }
 
     // Iterate on the outer environment.
@@ -236,7 +217,7 @@
   const SubtypeTestCache& type_test_cache =
       SubtypeTestCache::ZoneHandle(zone(), SubtypeTestCache::New());
   __ LoadUniqueObject(temp_reg, type_test_cache);
-  __ pushq(temp_reg);  // Subtype test cache.
+  __ pushq(temp_reg);      // Subtype test cache.
   __ pushq(instance_reg);  // Instance.
   if (test_kind == kTestTypeOneArg) {
     ASSERT(type_arguments_reg == kNoRegister);
@@ -257,7 +238,7 @@
   ASSERT(temp_reg != RCX);
   __ popq(instance_reg);  // Discard.
   __ popq(instance_reg);  // Restore receiver.
-  __ popq(temp_reg);  // Discard.
+  __ popq(temp_reg);      // Discard.
   GenerateBoolToJump(RCX, is_instance_lbl, is_not_instance_lbl);
   return type_test_cache.raw();
 }
@@ -299,7 +280,7 @@
     const TypeArguments& type_arguments =
         TypeArguments::ZoneHandle(zone(), type.arguments());
     const bool is_raw_type = type_arguments.IsNull() ||
-        type_arguments.IsRaw(from_index, num_type_params);
+                             type_arguments.IsRaw(from_index, num_type_params);
     if (is_raw_type) {
       const Register kClassIdReg = R10;
       // dynamic type argument, check only classes.
@@ -315,8 +296,8 @@
     }
     // If one type argument only, check if type argument is Object or dynamic.
     if (type_arguments.Length() == 1) {
-      const AbstractType& tp_argument = AbstractType::ZoneHandle(zone(),
-          type_arguments.TypeAt(0));
+      const AbstractType& tp_argument =
+          AbstractType::ZoneHandle(zone(), type_arguments.TypeAt(0));
       ASSERT(!tp_argument.IsMalformed());
       if (tp_argument.IsType()) {
         ASSERT(tp_argument.HasResolvedTypeClass());
@@ -333,12 +314,9 @@
   // Regular subtype test cache involving instance's type arguments.
   const Register kTypeArgumentsReg = kNoRegister;
   const Register kTempReg = R10;
-  return GenerateCallSubtypeTestStub(kTestTypeTwoArgs,
-                                     kInstanceReg,
-                                     kTypeArgumentsReg,
-                                     kTempReg,
-                                     is_instance_lbl,
-                                     is_not_instance_lbl);
+  return GenerateCallSubtypeTestStub(kTestTypeTwoArgs, kInstanceReg,
+                                     kTypeArgumentsReg, kTempReg,
+                                     is_instance_lbl, is_not_instance_lbl);
 }
 
 
@@ -377,11 +355,8 @@
   __ testq(kInstanceReg, Immediate(kSmiTagMask));
   // If instance is Smi, check directly.
   const Class& smi_class = Class::Handle(zone(), Smi::Class());
-  if (smi_class.IsSubtypeOf(TypeArguments::Handle(zone()),
-                            type_class,
-                            TypeArguments::Handle(zone()),
-                            NULL,
-                            NULL,
+  if (smi_class.IsSubtypeOf(TypeArguments::Handle(zone()), type_class,
+                            TypeArguments::Handle(zone()), NULL, NULL,
                             Heap::kOld)) {
     __ j(ZERO, is_instance_lbl);
   } else {
@@ -401,8 +376,8 @@
   // Custom checking for numbers (Smi, Mint, Bigint and Double).
   // Note that instance is not Smi (checked above).
   if (type.IsNumberType() || type.IsIntType() || type.IsDoubleType()) {
-    GenerateNumberTypeCheck(
-        kClassIdReg, type, is_instance_lbl, is_not_instance_lbl);
+    GenerateNumberTypeCheck(kClassIdReg, type, is_instance_lbl,
+                            is_not_instance_lbl);
     return false;
   }
   if (type.IsStringType()) {
@@ -449,12 +424,9 @@
 
   const Register kTypeArgumentsReg = kNoRegister;
   const Register kTempReg = R10;
-  return GenerateCallSubtypeTestStub(kTestTypeOneArg,
-                                     kInstanceReg,
-                                     kTypeArgumentsReg,
-                                     kTempReg,
-                                     is_instance_lbl,
-                                     is_not_instance_lbl);
+  return GenerateCallSubtypeTestStub(kTestTypeOneArg, kInstanceReg,
+                                     kTypeArgumentsReg, kTempReg,
+                                     is_instance_lbl, is_not_instance_lbl);
 }
 
 
@@ -477,24 +449,24 @@
     // Check if type arguments are null, i.e. equivalent to vector of dynamic.
     __ CompareObject(RDX, Object::null_object());
     __ j(EQUAL, is_instance_lbl);
-    __ movq(RDI,
-        FieldAddress(RDX, TypeArguments::type_at_offset(type_param.index())));
+    __ movq(RDI, FieldAddress(
+                     RDX, TypeArguments::type_at_offset(type_param.index())));
     // RDI: Concrete type of type.
     // Check if type argument is dynamic.
     __ CompareObject(RDI, Object::dynamic_type());
-    __ j(EQUAL,  is_instance_lbl);
+    __ j(EQUAL, is_instance_lbl);
     const Type& object_type = Type::ZoneHandle(zone(), Type::ObjectType());
     __ CompareObject(RDI, object_type);
-    __ j(EQUAL,  is_instance_lbl);
+    __ j(EQUAL, is_instance_lbl);
 
     // For Smi check quickly against int and num interfaces.
     Label not_smi;
     __ testq(RAX, Immediate(kSmiTagMask));  // Value is Smi?
     __ j(NOT_ZERO, &not_smi, Assembler::kNearJump);
     __ CompareObject(RDI, Type::ZoneHandle(zone(), Type::IntType()));
-    __ j(EQUAL,  is_instance_lbl);
+    __ j(EQUAL, is_instance_lbl);
     __ CompareObject(RDI, Type::ZoneHandle(zone(), Type::Number()));
-    __ j(EQUAL,  is_instance_lbl);
+    __ j(EQUAL, is_instance_lbl);
     // Smi must be handled in runtime.
     Label fall_through;
     __ jmp(&fall_through);
@@ -505,14 +477,10 @@
     const Register kInstanceReg = RAX;
     const Register kTypeArgumentsReg = RDX;
     const Register kTempReg = R10;
-    const SubtypeTestCache& type_test_cache =
-        SubtypeTestCache::ZoneHandle(zone(),
-            GenerateCallSubtypeTestStub(kTestTypeThreeArgs,
-                                        kInstanceReg,
-                                        kTypeArgumentsReg,
-                                        kTempReg,
-                                        is_instance_lbl,
-                                        is_not_instance_lbl));
+    const SubtypeTestCache& type_test_cache = SubtypeTestCache::ZoneHandle(
+        zone(), GenerateCallSubtypeTestStub(
+                    kTestTypeThreeArgs, kInstanceReg, kTypeArgumentsReg,
+                    kTempReg, is_instance_lbl, is_not_instance_lbl));
     __ Bind(&fall_through);
     return type_test_cache.raw();
   }
@@ -525,12 +493,9 @@
     // Uninstantiated type class is known at compile time, but the type
     // arguments are determined at runtime by the instantiator.
     const Register kTempReg = R10;
-    return GenerateCallSubtypeTestStub(kTestTypeThreeArgs,
-                                       kInstanceReg,
-                                       kTypeArgumentsReg,
-                                       kTempReg,
-                                       is_instance_lbl,
-                                       is_not_instance_lbl);
+    return GenerateCallSubtypeTestStub(kTestTypeThreeArgs, kInstanceReg,
+                                       kTypeArgumentsReg, kTempReg,
+                                       is_instance_lbl, is_not_instance_lbl);
   }
   return SubtypeTestCache::null();
 }
@@ -562,29 +527,22 @@
     // function type) of a non-parameterized class or with a raw dst type of
     // a parameterized class.
     if (type.IsFunctionType() || (type_class.NumTypeArguments() > 0)) {
-      return GenerateInstantiatedTypeWithArgumentsTest(token_pos,
-                                                       type,
-                                                       is_instance_lbl,
-                                                       is_not_instance_lbl);
+      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);
+    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);
+          token_pos, type_class, is_instance_lbl, is_not_instance_lbl);
     } else {
       return SubtypeTestCache::null();
     }
   }
-  return GenerateUninstantiatedTypeTest(token_pos,
-                                        type,
-                                        is_instance_lbl,
+  return GenerateUninstantiatedTypeTest(token_pos, type, is_instance_lbl,
                                         is_not_instance_lbl);
 }
 
@@ -625,25 +583,21 @@
 
   // Generate inline instanceof test.
   SubtypeTestCache& test_cache = SubtypeTestCache::ZoneHandle(zone());
-  test_cache = GenerateInlineInstanceof(token_pos, type,
-                                        &is_instance, &is_not_instance);
+  test_cache =
+      GenerateInlineInstanceof(token_pos, type, &is_instance, &is_not_instance);
 
   // test_cache is null if there is no fall-through.
   Label done;
   if (!test_cache.IsNull()) {
     // Generate runtime call.
-    __ movq(RDX, Address(RSP, 0));  // Get instantiator type arguments.
+    __ movq(RDX, Address(RSP, 0));         // Get instantiator type arguments.
     __ PushObject(Object::null_object());  // Make room for the result.
-    __ pushq(RAX);  // Push the instance.
-    __ PushObject(type);  // Push the type.
-    __ pushq(RDX);  // Instantiator type arguments.
+    __ pushq(RAX);                         // Push the instance.
+    __ PushObject(type);                   // Push the type.
+    __ pushq(RDX);                         // Instantiator type arguments.
     __ LoadUniqueObject(RAX, test_cache);
     __ pushq(RAX);
-    GenerateRuntimeCall(token_pos,
-                        deopt_id,
-                        kInstanceofRuntimeEntry,
-                        4,
-                        locs);
+    GenerateRuntimeCall(token_pos, deopt_id, kInstanceofRuntimeEntry, 4, locs);
     // Pop the parameters supplied to the runtime entry. The result of the
     // instanceof runtime call will be left as the result of the operation.
     __ Drop(4);
@@ -700,34 +654,31 @@
   // Generate throw new TypeError() if the type is malformed or malbounded.
   if (dst_type.IsMalformedOrMalbounded()) {
     __ PushObject(Object::null_object());  // Make room for the result.
-    __ pushq(RAX);  // Push the source object.
-    __ PushObject(dst_name);  // Push the name of the destination.
-    __ PushObject(dst_type);  // Push the type of the destination.
-    GenerateRuntimeCall(token_pos,
-                        deopt_id,
-                        kBadTypeErrorRuntimeEntry,
-                        3,
+    __ pushq(RAX);                         // Push the source object.
+    __ PushObject(dst_name);               // Push the name of the destination.
+    __ PushObject(dst_type);               // Push the type of the destination.
+    GenerateRuntimeCall(token_pos, deopt_id, kBadTypeErrorRuntimeEntry, 3,
                         locs);
     // We should never return here.
     __ int3();
 
     __ Bind(&is_assignable);  // For a null object.
-    __ popq(RDX);  // Remove pushed instantiator type arguments.
+    __ popq(RDX);             // Remove pushed instantiator type arguments.
     return;
   }
 
   // Generate inline type check, linking to runtime call if not assignable.
   SubtypeTestCache& test_cache = SubtypeTestCache::ZoneHandle(zone());
-  test_cache = GenerateInlineInstanceof(token_pos, dst_type,
-                                        &is_assignable, &runtime_call);
+  test_cache = GenerateInlineInstanceof(token_pos, dst_type, &is_assignable,
+                                        &runtime_call);
 
   __ Bind(&runtime_call);
-  __ movq(RDX, Address(RSP, 0));  // Get instantiator type arguments.
+  __ movq(RDX, Address(RSP, 0));         // Get instantiator type arguments.
   __ PushObject(Object::null_object());  // Make room for the result.
-  __ pushq(RAX);  // Push the source object.
-  __ PushObject(dst_type);  // Push the type of the destination.
-  __ pushq(RDX);  // Instantiator type arguments.
-  __ PushObject(dst_name);  // Push the name of the destination.
+  __ pushq(RAX);                         // Push the source object.
+  __ PushObject(dst_type);               // Push the type of the destination.
+  __ pushq(RDX);                         // Instantiator type arguments.
+  __ PushObject(dst_name);               // Push the name of the destination.
   __ LoadUniqueObject(RAX, test_cache);
   __ pushq(RAX);
   GenerateRuntimeCall(token_pos, deopt_id, kTypeCheckRuntimeEntry, 5, locs);
@@ -796,8 +747,8 @@
   // Let RBX point to the last passed positional argument, i.e. to
   // fp[kParamEndSlotFromFp + num_args - (num_pos_args - 1)].
   __ subq(RBX, RCX);
-  __ leaq(RBX, Address(RBP, RBX, TIMES_4,
-                       (kParamEndSlotFromFp + 1) * kWordSize));
+  __ leaq(RBX,
+          Address(RBP, RBX, TIMES_4, (kParamEndSlotFromFp + 1) * kWordSize));
 
   // Let RDI point to the last copied positional argument, i.e. to
   // fp[kFirstLocalSlotFromFp - (num_pos_args - 1)].
@@ -824,9 +775,9 @@
   // Copy or initialize optional named arguments.
   Label all_arguments_processed;
 #ifdef DEBUG
-    const bool check_correct_named_args = true;
+  const bool check_correct_named_args = true;
 #else
-    const bool check_correct_named_args = function.IsClosureFunction();
+  const bool check_correct_named_args = function.IsClosureFunction();
 #endif
   if (num_opt_named_params > 0) {
     // Start by alphabetically sorting the names of the optional parameters.
@@ -849,13 +800,9 @@
     }
     // Generate code handling each optional parameter in alphabetical order.
     __ movq(RBX, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
-    __ movq(RCX,
-            FieldAddress(R10, ArgumentsDescriptor::positional_count_offset()));
-    __ SmiUntag(RCX);
     // Let RBX point to the first passed argument, i.e. to
     // fp[kParamEndSlotFromFp + num_args]; num_args (RBX) is Smi.
-    __ leaq(RBX,
-            Address(RBP, RBX, TIMES_4, kParamEndSlotFromFp * kWordSize));
+    __ leaq(RBX, Address(RBP, RBX, TIMES_4, kParamEndSlotFromFp * kWordSize));
     // Let RDI point to the entry of the first named argument.
     __ leaq(RDI,
             FieldAddress(R10, ArgumentsDescriptor::first_named_entry_offset()));
@@ -873,8 +820,7 @@
       __ movq(RAX, Address(RDI, ArgumentsDescriptor::position_offset()));
       // RAX is arg_pos as Smi.
       // Point to next named entry.
-      __ AddImmediate(
-          RDI, Immediate(ArgumentsDescriptor::named_entry_size()));
+      __ AddImmediate(RDI, Immediate(ArgumentsDescriptor::named_entry_size()));
       __ negq(RAX);
       Address argument_addr(RBX, RAX, TIMES_4, 0);  // RAX is a negative Smi.
       __ movq(RAX, argument_addr);
@@ -958,8 +904,8 @@
   __ LoadObject(R12, Object::null_object());
   Label null_args_loop, null_args_loop_condition;
   __ jmp(&null_args_loop_condition, Assembler::kNearJump);
-  const Address original_argument_addr(
-      RBP, RCX, TIMES_8, (kParamEndSlotFromFp + 1) * kWordSize);
+  const Address original_argument_addr(RBP, RCX, TIMES_8,
+                                       (kParamEndSlotFromFp + 1) * kWordSize);
   __ Bind(&null_args_loop);
   __ movq(original_argument_addr, R12);
   __ Bind(&null_args_loop_condition);
@@ -996,21 +942,17 @@
 // NOTE: If the entry code shape changes, ReturnAddressLocator in profiler.cc
 // needs to be updated to match.
 void FlowGraphCompiler::EmitFrameEntry() {
-  const Function& function = parsed_function().function();
-  // Load pool pointer.
-
   if (flow_graph().IsCompiledForOsr()) {
-    intptr_t extra_slots = StackSize()
-        - flow_graph().num_stack_locals()
-        - flow_graph().num_copied_params();
+    intptr_t extra_slots = StackSize() - flow_graph().num_stack_locals() -
+                           flow_graph().num_copied_params();
     ASSERT(extra_slots >= 0);
     __ EnterOsrFrame(extra_slots * kWordSize);
   } else {
     const Register new_pp = R13;
     __ LoadPoolPointer(new_pp);
 
-    if (CanOptimizeFunction() &&
-        function.IsOptimizable() &&
+    const Function& function = parsed_function().function();
+    if (CanOptimizeFunction() && function.IsOptimizable() &&
         (!is_optimizing() || may_reoptimize())) {
       __ Comment("Invocation Count Check");
       const Register function_reg = RDI;
@@ -1022,13 +964,10 @@
       if (!is_optimizing()) {
         __ incl(FieldAddress(function_reg, Function::usage_counter_offset()));
       }
-      __ cmpl(
-          FieldAddress(function_reg, Function::usage_counter_offset()),
-          Immediate(GetOptimizationThreshold()));
+      __ cmpl(FieldAddress(function_reg, Function::usage_counter_offset()),
+              Immediate(GetOptimizationThreshold()));
       ASSERT(function_reg == RDI);
-      __ J(GREATER_EQUAL,
-           *StubCode::OptimizeFunction_entry(),
-           new_pp);
+      __ J(GREATER_EQUAL, *StubCode::OptimizeFunction_entry(), new_pp);
     }
     ASSERT(StackSize() >= 0);
     __ Comment("Enter frame");
@@ -1039,6 +978,13 @@
 
 void FlowGraphCompiler::CompileGraph() {
   InitCompiler();
+  const Function& function = parsed_function().function();
+
+#ifdef DART_PRECOMPILER
+  if (function.IsDynamicFunction()) {
+    __ MonomorphicCheckedEntry();
+  }
+#endif  // DART_PRECOMPILER
 
   if (TryIntrinsify()) {
     // Skip regular code generation.
@@ -1048,8 +994,6 @@
   EmitFrameEntry();
   ASSERT(assembler()->constant_pool_allowed());
 
-  const Function& function = parsed_function().function();
-
   const int num_fixed_params = function.num_fixed_parameters();
   const int num_copied_params = parsed_function().num_copied_params();
   const int num_locals = parsed_function().num_stack_locals();
@@ -1068,9 +1012,8 @@
       __ movq(RAX, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
       __ CompareImmediate(RAX, Immediate(Smi::RawValue(num_fixed_params)));
       __ j(NOT_EQUAL, &wrong_num_arguments, Assembler::kNearJump);
-      __ cmpq(RAX,
-              FieldAddress(R10,
-                           ArgumentsDescriptor::positional_count_offset()));
+      __ cmpq(RAX, FieldAddress(
+                       R10, ArgumentsDescriptor::positional_count_offset()));
       __ j(EQUAL, &correct_num_arguments, Assembler::kNearJump);
 
       __ Bind(&wrong_num_arguments);
@@ -1118,8 +1061,8 @@
         } else {
           const Context& empty_context = Context::ZoneHandle(
               zone(), isolate()->object_store()->empty_context());
-          __ StoreObject(
-              Address(RBP, (slot_base - i) * kWordSize), empty_context);
+          __ StoreObject(Address(RBP, (slot_base - i) * kWordSize),
+                         empty_context);
         }
       } else {
         ASSERT(num_locals > 1);
@@ -1135,19 +1078,6 @@
   __ int3();
   ASSERT(assembler()->constant_pool_allowed());
   GenerateDeferredCode();
-  // Emit function patching code. This will be swapped with the first 13 bytes
-  // at entry point.
-
-  BeginCodeSourceRange();
-  if (is_optimizing() && !FLAG_precompiled_mode) {
-    // Leave enough space for patching in case of lazy deoptimization.
-    __ nop(ShortCallPattern::pattern_length_in_bytes());
-    lazy_deopt_return_pc_offset_ = assembler()->CodeSize();
-    __ Jmp(*StubCode::DeoptimizeLazyFromReturn_entry(), PP);
-    lazy_deopt_throw_pc_offset_ = assembler()->CodeSize();
-    __ Jmp(*StubCode::DeoptimizeLazyFromThrow_entry(), PP);
-  }
-  EndCodeSourceRange(TokenPosition::kDartCodeEpilogue);
 }
 
 
@@ -1161,6 +1091,16 @@
 }
 
 
+void FlowGraphCompiler::GeneratePatchableCall(TokenPosition token_pos,
+                                              const StubEntry& stub_entry,
+                                              RawPcDescriptors::Kind kind,
+                                              LocationSummary* locs) {
+  __ CallPatchable(stub_entry);
+  AddCurrentDescriptor(kind, Thread::kNoDeoptId, token_pos);
+  RecordSafepoint(locs);
+}
+
+
 void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id,
                                          TokenPosition token_pos,
                                          const StubEntry& stub_entry,
@@ -1233,20 +1173,16 @@
 }
 
 
-void FlowGraphCompiler::EmitUnoptimizedStaticCall(
-    intptr_t argument_count,
-    intptr_t deopt_id,
-    TokenPosition token_pos,
-    LocationSummary* locs,
-    const ICData& ic_data) {
+void FlowGraphCompiler::EmitUnoptimizedStaticCall(intptr_t argument_count,
+                                                  intptr_t deopt_id,
+                                                  TokenPosition token_pos,
+                                                  LocationSummary* locs,
+                                                  const ICData& ic_data) {
   const StubEntry* stub_entry =
       StubCode::UnoptimizedStaticCallEntry(ic_data.NumArgsTested());
   __ LoadObject(RBX, ic_data);
-  GenerateDartCall(deopt_id,
-                   token_pos,
-                   *stub_entry,
-                   RawPcDescriptors::kUnoptStaticCall,
-                   locs);
+  GenerateDartCall(deopt_id, token_pos, *stub_entry,
+                   RawPcDescriptors::kUnoptStaticCall, locs);
   __ Drop(argument_count, RCX);
 }
 
@@ -1265,13 +1201,12 @@
 }
 
 
-void FlowGraphCompiler::EmitOptimizedInstanceCall(
-    const StubEntry& stub_entry,
-    const ICData& ic_data,
-    intptr_t argument_count,
-    intptr_t deopt_id,
-    TokenPosition token_pos,
-    LocationSummary* locs) {
+void FlowGraphCompiler::EmitOptimizedInstanceCall(const StubEntry& stub_entry,
+                                                  const ICData& ic_data,
+                                                  intptr_t argument_count,
+                                                  intptr_t deopt_id,
+                                                  TokenPosition token_pos,
+                                                  LocationSummary* locs) {
   ASSERT(Array::Handle(zone(), ic_data.arguments_descriptor()).Length() > 0);
   // Each ICData propagated from unoptimized to optimized code contains the
   // function that corresponds to the Dart function of that IC call. Due
@@ -1281,10 +1216,7 @@
   // Pass the function explicitly, it is used in IC stub.
   __ LoadObject(RDI, parsed_function().function());
   __ LoadUniqueObject(RBX, ic_data);
-  GenerateDartCall(deopt_id,
-                   token_pos,
-                   stub_entry,
-                   RawPcDescriptors::kIcCall,
+  GenerateDartCall(deopt_id, token_pos, stub_entry, RawPcDescriptors::kIcCall,
                    locs);
   __ Drop(argument_count, RCX);
 }
@@ -1298,10 +1230,7 @@
                                          LocationSummary* locs) {
   ASSERT(Array::Handle(zone(), ic_data.arguments_descriptor()).Length() > 0);
   __ LoadUniqueObject(RBX, ic_data);
-  GenerateDartCall(deopt_id,
-                   token_pos,
-                   stub_entry,
-                   RawPcDescriptors::kIcCall,
+  GenerateDartCall(deopt_id, token_pos, stub_entry, RawPcDescriptors::kIcCall,
                    locs);
   __ Drop(argument_count, RCX);
 }
@@ -1319,7 +1248,8 @@
   const Array& arguments_descriptor =
       Array::ZoneHandle(zone(), ic_data.arguments_descriptor());
   ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0));
-  const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(),
+  const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(
+      zone(),
       MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor));
   __ Comment("MegamorphicCall");
   // Load receiver into RDI.
@@ -1353,18 +1283,16 @@
     if (try_index == CatchClauseNode::kInvalidTryIndex) {
       try_index = CurrentTryIndex();
     }
-    pc_descriptors_list()->AddDescriptor(RawPcDescriptors::kOther,
-                                         assembler()->CodeSize(),
-                                         Thread::kNoDeoptId,
-                                         token_pos,
-                                         try_index);
+    pc_descriptors_list()->AddDescriptor(
+        RawPcDescriptors::kOther, assembler()->CodeSize(), Thread::kNoDeoptId,
+        token_pos, try_index);
   } else if (is_optimizing()) {
-    AddCurrentDescriptor(RawPcDescriptors::kOther,
-        Thread::kNoDeoptId, token_pos);
+    AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId,
+                         token_pos);
     AddDeoptIndexAtCall(deopt_id_after);
   } else {
-    AddCurrentDescriptor(RawPcDescriptors::kOther,
-        Thread::kNoDeoptId, token_pos);
+    AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId,
+                         token_pos);
     // Add deoptimization continuation point after the call and before the
     // arguments are removed.
     AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
@@ -1373,25 +1301,23 @@
 }
 
 
-void FlowGraphCompiler::EmitSwitchableInstanceCall(
-    const ICData& ic_data,
-    intptr_t argument_count,
-    intptr_t deopt_id,
-    TokenPosition token_pos,
-    LocationSummary* locs) {
+void FlowGraphCompiler::EmitSwitchableInstanceCall(const ICData& ic_data,
+                                                   intptr_t argument_count,
+                                                   intptr_t deopt_id,
+                                                   TokenPosition token_pos,
+                                                   LocationSummary* locs) {
   ASSERT(ic_data.NumArgsTested() == 1);
-  const Code& initial_stub = Code::ZoneHandle(
-      StubCode::ICCallThroughFunction_entry()->code());
+  const Code& initial_stub =
+      Code::ZoneHandle(StubCode::ICCallThroughFunction_entry()->code());
 
   __ Comment("SwitchableCall");
   __ movq(RDI, Address(RSP, (argument_count - 1) * kWordSize));
-  __ LoadUniqueObject(RBX, ic_data);
   __ LoadUniqueObject(CODE_REG, initial_stub);
   __ movq(RCX, FieldAddress(CODE_REG, Code::checked_entry_point_offset()));
+  __ LoadUniqueObject(RBX, ic_data);
   __ call(RCX);
 
-  AddCurrentDescriptor(RawPcDescriptors::kOther,
-                       Thread::kNoDeoptId, token_pos);
+  AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, token_pos);
   RecordSafepoint(locs);
   const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
   if (is_optimizing()) {
@@ -1420,12 +1346,9 @@
   }
   // 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.
-  GenerateStaticDartCall(deopt_id,
-                         token_pos,
+  GenerateStaticDartCall(deopt_id, token_pos,
                          *StubCode::CallStaticFunction_entry(),
-                         RawPcDescriptors::kOther,
-                         locs,
-                         function);
+                         RawPcDescriptors::kOther, locs, function);
   __ Drop(argument_count, RCX);
 }
 
@@ -1453,8 +1376,7 @@
       __ CallPatchable(*StubCode::UnoptimizedIdenticalWithNumberCheck_entry());
     }
     if (token_pos.IsReal()) {
-      AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
-                           Thread::kNoDeoptId,
+      AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, Thread::kNoDeoptId,
                            token_pos);
     }
     // Stub returns result in flags (result of a cmpq, we need ZF computed).
@@ -1481,8 +1403,7 @@
       __ CallPatchable(*StubCode::UnoptimizedIdenticalWithNumberCheck_entry());
     }
     if (token_pos.IsReal()) {
-      AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
-                           Thread::kNoDeoptId,
+      AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, Thread::kNoDeoptId,
                            token_pos);
     }
     // Stub returns result in flags (result of a cmpq, we need ZF computed).
@@ -1542,12 +1463,10 @@
   ASSERT(is_optimizing());
 
   __ Comment("EmitTestAndCall");
-  const Array& arguments_descriptor =
-      Array::ZoneHandle(zone(), ArgumentsDescriptor::New(argument_count,
-                                                         argument_names));
+  const Array& arguments_descriptor = Array::ZoneHandle(
+      zone(), ArgumentsDescriptor::New(argument_count, argument_names));
   // Load receiver into RAX.
-  __ movq(RAX,
-      Address(RSP, (argument_count - 1) * kWordSize));
+  __ movq(RAX, Address(RSP, (argument_count - 1) * kWordSize));
   __ LoadObject(R10, arguments_descriptor);
 
   const bool kFirstCheckIsSmi = ic_data.GetReceiverClassIdAt(0) == kSmiCid;
@@ -1566,14 +1485,11 @@
     }
     // 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.
-    const Function& function = Function::ZoneHandle(
-        zone(), ic_data.GetTargetAt(0));
-    GenerateStaticDartCall(deopt_id,
-                           token_index,
+    const Function& function =
+        Function::ZoneHandle(zone(), ic_data.GetTargetAt(0));
+    GenerateStaticDartCall(deopt_id, token_index,
                            *StubCode::CallStaticFunction_entry(),
-                           RawPcDescriptors::kOther,
-                           locs,
-                           function);
+                           RawPcDescriptors::kOther, locs, function);
     __ Drop(argument_count, RCX);
     if (kNumChecks > 1) {
       __ jmp(match_found);
@@ -1619,12 +1535,9 @@
     // 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.
     const Function& function = *sorted[i].target;
-    GenerateStaticDartCall(deopt_id,
-                           token_index,
+    GenerateStaticDartCall(deopt_id, token_index,
                            *StubCode::CallStaticFunction_entry(),
-                           RawPcDescriptors::kOther,
-                           locs,
-                           function);
+                           RawPcDescriptors::kOther, locs, function);
     __ Drop(argument_count, RCX);
     if (!kIsLastCheck) {
       __ jmp(match_found);
@@ -1694,7 +1607,8 @@
       if (constant.IsSmi() && (Smi::Cast(constant).Value() == 0)) {
         __ xorq(destination.reg(), destination.reg());
       } else if (constant.IsSmi() &&
-          (source.constant_instruction()->representation() == kUnboxedInt32)) {
+                 (source.constant_instruction()->representation() ==
+                  kUnboxedInt32)) {
         __ movl(destination.reg(), Immediate(Smi::Cast(constant).Value()));
       } else {
         __ LoadObject(destination.reg(), constant);
@@ -1705,7 +1619,7 @@
       } else {
         __ LoadObject(TMP, constant);
         __ movsd(destination.fpu_reg(),
-            FieldAddress(TMP, Double::value_offset()));
+                 FieldAddress(TMP, Double::value_offset()));
       }
     } else if (destination.IsDoubleStackSlot()) {
       if (Utils::DoublesBitEqual(Double::Cast(constant).value(), 0.0)) {
@@ -1749,17 +1663,15 @@
     __ movaps(source.fpu_reg(), destination.fpu_reg());
     __ movaps(destination.fpu_reg(), XMM0);
   } else if (source.IsFpuRegister() || destination.IsFpuRegister()) {
-    ASSERT(destination.IsDoubleStackSlot() ||
-           destination.IsQuadStackSlot() ||
-           source.IsDoubleStackSlot() ||
-           source.IsQuadStackSlot());
-    bool double_width = destination.IsDoubleStackSlot() ||
-                        source.IsDoubleStackSlot();
-    XmmRegister reg = source.IsFpuRegister() ? source.fpu_reg()
-                                             : destination.fpu_reg();
+    ASSERT(destination.IsDoubleStackSlot() || destination.IsQuadStackSlot() ||
+           source.IsDoubleStackSlot() || source.IsQuadStackSlot());
+    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();
+                               ? destination.ToStackSlotAddress()
+                               : source.ToStackSlotAddress();
 
     if (double_width) {
       __ movsd(XMM0, slot_address);
diff --git a/runtime/vm/flow_graph_inliner.cc b/runtime/vm/flow_graph_inliner.cc
index b42bba5..001535c 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -1,13 +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.
-
+#if !defined(DART_PRECOMPILED_RUNTIME)
 #include "vm/flow_graph_inliner.h"
 
 #include "vm/aot_optimizer.h"
 #include "vm/block_scheduler.h"
 #include "vm/branch_optimizer.h"
 #include "vm/compiler.h"
+#include "vm/kernel.h"
+#include "vm/kernel_to_il.h"
 #include "vm/flags.h"
 #include "vm/flow_graph.h"
 #include "vm/flow_graph_builder.h"
@@ -22,41 +24,71 @@
 
 namespace dart {
 
-DEFINE_FLAG(int, deoptimization_counter_inlining_threshold, 12,
-    "How many times we allow deoptimization before we stop inlining.");
+DEFINE_FLAG(int,
+            deoptimization_counter_inlining_threshold,
+            12,
+            "How many times we allow deoptimization before we stop inlining.");
 DEFINE_FLAG(bool, trace_inlining, false, "Trace inlining");
 DEFINE_FLAG(charp, inlining_filter, NULL, "Inline only in named function");
 
 // Flags for inlining heuristics.
-DEFINE_FLAG(int, inline_getters_setters_smaller_than, 10,
-    "Always inline getters and setters that have fewer instructions");
-DEFINE_FLAG(int, inlining_depth_threshold, 6,
-    "Inline function calls up to threshold nesting depth");
-DEFINE_FLAG(int, inlining_size_threshold, 25,
+DEFINE_FLAG(int,
+            inline_getters_setters_smaller_than,
+            10,
+            "Always inline getters and setters that have fewer instructions");
+DEFINE_FLAG(int,
+            inlining_depth_threshold,
+            6,
+            "Inline function calls up to threshold nesting depth");
+DEFINE_FLAG(
+    int,
+    inlining_size_threshold,
+    25,
     "Always inline functions that have threshold or fewer instructions");
-DEFINE_FLAG(int, inlining_callee_call_sites_threshold, 1,
-    "Always inline functions containing threshold or fewer calls.");
-DEFINE_FLAG(int, inlining_callee_size_threshold, 80,
-    "Do not inline callees larger than threshold");
-DEFINE_FLAG(int, inlining_caller_size_threshold, 50000,
-    "Stop inlining once caller reaches the threshold.");
-DEFINE_FLAG(int, inlining_constant_arguments_count, 1,
-    "Inline function calls with sufficient constant arguments "
-    "and up to the increased threshold on instructions");
-DEFINE_FLAG(int, inlining_constant_arguments_max_size_threshold, 200,
+DEFINE_FLAG(int,
+            inlining_callee_call_sites_threshold,
+            1,
+            "Always inline functions containing threshold or fewer calls.");
+DEFINE_FLAG(int,
+            inlining_callee_size_threshold,
+            80,
+            "Do not inline callees larger than threshold");
+DEFINE_FLAG(int,
+            inlining_caller_size_threshold,
+            50000,
+            "Stop inlining once caller reaches the threshold.");
+DEFINE_FLAG(int,
+            inlining_constant_arguments_count,
+            1,
+            "Inline function calls with sufficient constant arguments "
+            "and up to the increased threshold on instructions");
+DEFINE_FLAG(
+    int,
+    inlining_constant_arguments_max_size_threshold,
+    200,
     "Do not inline callees larger than threshold if constant arguments");
-DEFINE_FLAG(int, inlining_constant_arguments_min_size_threshold, 60,
-    "Inline function calls with sufficient constant arguments "
-    "and up to the increased threshold on instructions");
-DEFINE_FLAG(int, inlining_hotness, 10,
-    "Inline only hotter calls, in percents (0 .. 100); "
-    "default 10%: calls above-equal 10% of max-count are inlined.");
-DEFINE_FLAG(int, inlining_recursion_depth_threshold, 1,
-    "Inline recursive function calls up to threshold recursion depth.");
-DEFINE_FLAG(int, max_inlined_per_depth, 500,
-    "Max. number of inlined calls per depth");
+DEFINE_FLAG(int,
+            inlining_constant_arguments_min_size_threshold,
+            60,
+            "Inline function calls with sufficient constant arguments "
+            "and up to the increased threshold on instructions");
+DEFINE_FLAG(int,
+            inlining_hotness,
+            10,
+            "Inline only hotter calls, in percents (0 .. 100); "
+            "default 10%: calls above-equal 10% of max-count are inlined.");
+DEFINE_FLAG(int,
+            inlining_recursion_depth_threshold,
+            1,
+            "Inline recursive function calls up to threshold recursion depth.");
+DEFINE_FLAG(int,
+            max_inlined_per_depth,
+            500,
+            "Max. number of inlined calls per depth");
 DEFINE_FLAG(bool, print_inlining_tree, false, "Print inlining tree");
-DEFINE_FLAG(bool, enable_inlining_annotations, false,
+DEFINE_FLAG(bool,
+            enable_inlining_annotations,
+            false,
             "Enable inlining annotations");
 
 DECLARE_FLAG(bool, compiler_stats);
@@ -78,10 +110,10 @@
 #define PRINT_INLINING_TREE(comment, caller, target, instance_call)            \
   do {                                                                         \
     if (FLAG_print_inlining_tree) {                                            \
-      inlined_info_.Add(InlinedInfo(                                           \
-          caller, target, inlining_depth_, instance_call, comment));           \
-      }                                                                        \
-  } while (false)                                                              \
+      inlined_info_.Add(InlinedInfo(caller, target, inlining_depth_,           \
+                                    instance_call, comment));                  \
+    }                                                                          \
+  } while (false)
 
 
 // Test if a call is recursive by looking in the deoptimization environment.
@@ -108,8 +140,7 @@
 struct NamedArgument {
   String* name;
   Value* value;
-  NamedArgument(String* name, Value* value)
-    : name(name), value(value) { }
+  NamedArgument(String* name, Value* value) : name(name), value(value) {}
 };
 
 
@@ -117,23 +148,18 @@
 // inlining.
 class GraphInfoCollector : public ValueObject {
  public:
-  GraphInfoCollector()
-      : call_site_count_(0),
-        instruction_count_(0) { }
+  GraphInfoCollector() : call_site_count_(0), instruction_count_(0) {}
 
   void Collect(const FlowGraph& graph) {
     call_site_count_ = 0;
     instruction_count_ = 0;
-    for (BlockIterator block_it = graph.postorder_iterator();
-         !block_it.Done();
+    for (BlockIterator block_it = graph.postorder_iterator(); !block_it.Done();
          block_it.Advance()) {
-      for (ForwardInstructionIterator it(block_it.Current());
-           !it.Done();
+      for (ForwardInstructionIterator it(block_it.Current()); !it.Done();
            it.Advance()) {
         ++instruction_count_;
         Instruction* current = it.Current();
-        if (current->IsStaticCall() ||
-            current->IsClosureCall()) {
+        if (current->IsStaticCall() || current->IsClosureCall()) {
           ++call_site_count_;
           continue;
         }
@@ -187,9 +213,7 @@
 class CallSites : public ValueObject {
  public:
   explicit CallSites(FlowGraph* flow_graph)
-      : static_calls_(),
-        closure_calls_(),
-        instance_calls_() { }
+      : static_calls_(), closure_calls_(), instance_calls_() {}
 
   struct InstanceCallInfo {
     PolymorphicInstanceCallInstr* call;
@@ -197,9 +221,7 @@
     const FlowGraph* caller_graph;
     InstanceCallInfo(PolymorphicInstanceCallInstr* call_arg,
                      FlowGraph* flow_graph)
-        : call(call_arg),
-          ratio(0.0),
-          caller_graph(flow_graph) {}
+        : call(call_arg), ratio(0.0), caller_graph(flow_graph) {}
     const Function& caller() const { return caller_graph->function(); }
   };
 
@@ -208,9 +230,7 @@
     double ratio;
     FlowGraph* caller_graph;
     StaticCallInfo(StaticCallInstr* value, FlowGraph* flow_graph)
-        : call(value),
-          ratio(0.0),
-          caller_graph(flow_graph) {}
+        : call(value), ratio(0.0), caller_graph(flow_graph) {}
     const Function& caller() const { return caller_graph->function(); }
   };
 
@@ -218,8 +238,7 @@
     ClosureCallInstr* call;
     FlowGraph* caller_graph;
     ClosureCallInfo(ClosureCallInstr* value, FlowGraph* flow_graph)
-        : call(value),
-          caller_graph(flow_graph) {}
+        : call(value), caller_graph(flow_graph) {}
     const Function& caller() const { return caller_graph->function(); }
   };
 
@@ -236,14 +255,12 @@
   }
 
   bool HasCalls() const {
-    return !(static_calls_.is_empty() &&
-             closure_calls_.is_empty() &&
+    return !(static_calls_.is_empty() && closure_calls_.is_empty() &&
              instance_calls_.is_empty());
   }
 
   intptr_t NumCalls() const {
-    return instance_calls_.length() +
-           static_calls_.length() +
+    return instance_calls_.length() + static_calls_.length() +
            closure_calls_.length();
   }
 
@@ -264,8 +281,9 @@
     GrowableArray<intptr_t> instance_call_counts(num_instance_calls);
     for (intptr_t i = 0; i < num_instance_calls; ++i) {
       const intptr_t aggregate_count =
-          instance_calls_[i + instance_call_start_ix].
-              call->ic_data().AggregateCount();
+          instance_calls_[i + instance_call_start_ix]
+              .call->ic_data()
+              .AggregateCount();
       instance_call_counts.Add(aggregate_count);
       if (aggregate_count > max_count) max_count = aggregate_count;
     }
@@ -276,9 +294,9 @@
       if (static_calls_[i + static_call_start_ix].call->ic_data() == NULL) {
         aggregate_count = 0;
       } else {
-        aggregate_count =
-            static_calls_[i + static_call_start_ix].
-                call->ic_data()->AggregateCount();
+        aggregate_count = static_calls_[i + static_call_start_ix]
+                              .call->ic_data()
+                              ->AggregateCount();
       }
       static_call_counts.Add(aggregate_count);
       if (aggregate_count > max_count) max_count = aggregate_count;
@@ -286,13 +304,17 @@
 
     // max_count can be 0 if none of the calls was executed.
     for (intptr_t i = 0; i < num_instance_calls; ++i) {
-      const double ratio = (max_count == 0) ?
-          0.0 : static_cast<double>(instance_call_counts[i]) / max_count;
+      const double ratio =
+          (max_count == 0)
+              ? 0.0
+              : static_cast<double>(instance_call_counts[i]) / max_count;
       instance_calls_[i + instance_call_start_ix].ratio = ratio;
     }
     for (intptr_t i = 0; i < num_static_calls; ++i) {
-      const double ratio = (max_count == 0) ?
-          0.0 : static_cast<double>(static_call_counts[i]) / max_count;
+      const double ratio =
+          (max_count == 0)
+              ? 0.0
+              : static_cast<double>(static_call_counts[i]) / max_count;
       static_calls_[i + static_call_start_ix].ratio = ratio;
     }
   }
@@ -302,12 +324,10 @@
       intptr_t depth,
       GrowableArray<InlinedInfo>* inlined_info) {
     const Function* caller = &graph->function();
-    Function& target  = Function::ZoneHandle();
-    for (BlockIterator block_it = graph->postorder_iterator();
-         !block_it.Done();
+    Function& target = Function::ZoneHandle();
+    for (BlockIterator block_it = graph->postorder_iterator(); !block_it.Done();
          block_it.Advance()) {
-      for (ForwardInstructionIterator it(block_it.Current());
-           !it.Done();
+      for (ForwardInstructionIterator it(block_it.Current()); !it.Done();
            it.Advance()) {
         Instruction* current = it.Current();
         Definition* call = NULL;
@@ -324,8 +344,8 @@
           // TODO(srdjan): Add data for closure calls.
         }
         if (call != NULL) {
-          inlined_info->Add(InlinedInfo(
-              caller, &target, depth + 1, call, "Too deep"));
+          inlined_info->Add(
+              InlinedInfo(caller, &target, depth + 1, call, "Too deep"));
         }
       }
     }
@@ -350,11 +370,9 @@
 
     const intptr_t instance_call_start_ix = instance_calls_.length();
     const intptr_t static_call_start_ix = static_calls_.length();
-    for (BlockIterator block_it = graph->postorder_iterator();
-         !block_it.Done();
+    for (BlockIterator block_it = graph->postorder_iterator(); !block_it.Done();
          block_it.Advance()) {
-      for (ForwardInstructionIterator it(block_it.Current());
-           !it.Done();
+      for (ForwardInstructionIterator it(block_it.Current()); !it.Done();
            it.Advance()) {
         Instruction* current = it.Current();
         if (current->IsPolymorphicInstanceCall()) {
@@ -369,11 +387,10 @@
             // not recognized.
             if (FLAG_print_inlining_tree) {
               const Function* caller = &graph->function();
-              const Function* target =
-                  &Function::ZoneHandle(
-                      instance_call->ic_data().GetTargetAt(0));
-              inlined_info->Add(InlinedInfo(
-                  caller, target, depth + 1, instance_call, "Too deep"));
+              const Function* target = &Function::ZoneHandle(
+                  instance_call->ic_data().GetTargetAt(0));
+              inlined_info->Add(InlinedInfo(caller, target, depth + 1,
+                                            instance_call, "Too deep"));
             }
           }
         } else if (current->IsStaticCall()) {
@@ -387,8 +404,8 @@
             if (FLAG_print_inlining_tree) {
               const Function* caller = &graph->function();
               const Function* target = &static_call->function();
-              inlined_info->Add(InlinedInfo(
-                  caller, target, depth + 1, static_call, "Too deep"));
+              inlined_info->Add(InlinedInfo(caller, target, depth + 1,
+                                            static_call, "Too deep"));
             }
           }
         } else if (current->IsClosureCall()) {
@@ -422,7 +439,7 @@
         parameter_stubs(NULL),
         exit_collector(NULL),
         caller(caller),
-        caller_inlining_id_(caller_inlining_id) { }
+        caller_inlining_id_(caller_inlining_id) {}
 
   Definition* call;
   GrowableArray<Value*>* arguments;
@@ -505,7 +522,7 @@
         collected_call_sites_(NULL),
         inlining_call_sites_(NULL),
         function_cache_(),
-        inlined_info_() { }
+        inlined_info_() {}
 
   FlowGraph* caller_graph() const { return caller_graph_; }
 
@@ -562,18 +579,17 @@
     collected_call_sites_ = &sites1;
     inlining_call_sites_ = &sites2;
     // Collect initial call sites.
-    collected_call_sites_->FindCallSites(caller_graph_,
-                                         inlining_depth_,
+    collected_call_sites_->FindCallSites(caller_graph_, inlining_depth_,
                                          &inlined_info_);
     while (collected_call_sites_->HasCalls()) {
-      TRACE_INLINING(THR_Print("  Depth %" Pd " ----------\n",
-                               inlining_depth_));
+      TRACE_INLINING(
+          THR_Print("  Depth %" Pd " ----------\n", inlining_depth_));
       if (collected_call_sites_->NumCalls() > FLAG_max_inlined_per_depth) {
         break;
       }
       if (FLAG_print_inlining_tree) {
-        THR_Print("**Depth % " Pd " calls to inline %" Pd "\n",
-            inlining_depth_, collected_call_sites_->NumCalls());
+        THR_Print("**Depth % " Pd " calls to inline %" Pd "\n", inlining_depth_,
+                  collected_call_sites_->NumCalls());
       }
       // Swap collected and inlining arrays and clear the new collecting array.
       call_sites_temp = collected_call_sites_;
@@ -600,7 +616,7 @@
 
   double GrowthFactor() const {
     return static_cast<double>(inlined_size_) /
-        static_cast<double>(initial_size_);
+           static_cast<double>(initial_size_);
   }
 
   // Helper to create a parameter stub from an actual argument.
@@ -609,9 +625,9 @@
                                   FlowGraph* graph) {
     ConstantInstr* constant = argument->definition()->AsConstant();
     if (constant != NULL) {
-      return new(Z) ConstantInstr(constant->value());
+      return new (Z) ConstantInstr(constant->value());
     } else {
-      ParameterInstr* param = new(Z) ParameterInstr(i, graph->graph_entry());
+      ParameterInstr* param = new (Z) ParameterInstr(i, graph->graph_entry());
       param->UpdateType(*argument->Type());
       return param;
     }
@@ -620,26 +636,24 @@
   bool TryInlining(const Function& function,
                    const Array& argument_names,
                    InlinedCallData* call_data) {
-    TRACE_INLINING(THR_Print("  => %s (deopt count %d)\n",
-                             function.ToCString(),
+    TRACE_INLINING(THR_Print("  => %s (deopt count %d)\n", function.ToCString(),
                              function.deoptimization_counter()));
 
     // Abort if the inlinable bit on the function is low.
     if (!function.CanBeInlined()) {
       TRACE_INLINING(THR_Print("     Bailout: not inlinable\n"));
-      PRINT_INLINING_TREE("Not inlinable",
-          &call_data->caller, &function, call_data->call);
+      PRINT_INLINING_TREE("Not inlinable", &call_data->caller, &function,
+                          call_data->call);
       return false;
     }
 
     // Don't inline any intrinsified functions in precompiled mode
     // to reduce code size and make sure we use the intrinsic code.
-    if (FLAG_precompiled_mode &&
-        function.is_intrinsic() &&
+    if (FLAG_precompiled_mode && function.is_intrinsic() &&
         !inliner_->AlwaysInline(function)) {
       TRACE_INLINING(THR_Print("     Bailout: intrinisic\n"));
-      PRINT_INLINING_TREE("intrinsic",
-          &call_data->caller, &function, call_data->call);
+      PRINT_INLINING_TREE("intrinsic", &call_data->caller, &function,
+                          call_data->call);
       return false;
     }
 
@@ -647,8 +661,8 @@
     // if a function was compiled.
     if (!FLAG_precompiled_mode && !function.was_compiled()) {
       TRACE_INLINING(THR_Print("     Bailout: not compiled yet\n"));
-      PRINT_INLINING_TREE("Not compiled",
-          &call_data->caller, &function, call_data->call);
+      PRINT_INLINING_TREE("Not compiled", &call_data->caller, &function,
+                          call_data->call);
       return false;
     }
 
@@ -656,8 +670,8 @@
     // but we need it for inlining.
     if (!FLAG_precompiled_mode && (function.ic_data_array() == Array::null())) {
       TRACE_INLINING(THR_Print("     Bailout: type feedback cleared\n"));
-      PRINT_INLINING_TREE("Not compiled",
-          &call_data->caller, &function, call_data->call);
+      PRINT_INLINING_TREE("Not compiled", &call_data->caller, &function,
+                          call_data->call);
       return false;
     }
 
@@ -667,7 +681,7 @@
       function.set_is_inlinable(false);
       TRACE_INLINING(THR_Print("     Bailout: deoptimization threshold\n"));
       PRINT_INLINING_TREE("Deoptimization threshold exceeded",
-          &call_data->caller, &function, call_data->call);
+                          &call_data->caller, &function, call_data->call);
       return false;
     }
 
@@ -680,19 +694,18 @@
 
     GrowableArray<Value*>* arguments = call_data->arguments;
     const intptr_t constant_arguments = CountConstants(*arguments);
-    if (!ShouldWeInline(function,
-                        function.optimized_instruction_count(),
+    if (!ShouldWeInline(function, function.optimized_instruction_count(),
                         function.optimized_call_site_count(),
                         constant_arguments)) {
-      TRACE_INLINING(THR_Print("     Bailout: early heuristics with "
-                               "code size:  %" Pd ", "
-                               "call sites: %" Pd ", "
-                               "const args: %" Pd "\n",
-                               function.optimized_instruction_count(),
-                               function.optimized_call_site_count(),
-                               constant_arguments));
-      PRINT_INLINING_TREE("Early heuristic",
-          &call_data->caller, &function, call_data->call);
+      TRACE_INLINING(
+          THR_Print("     Bailout: early heuristics with "
+                    "code size:  %" Pd ", "
+                    "call sites: %" Pd ", "
+                    "const args: %" Pd "\n",
+                    function.optimized_instruction_count(),
+                    function.optimized_call_site_count(), constant_arguments));
+      PRINT_INLINING_TREE("Early heuristic", &call_data->caller, &function,
+                          call_data->call);
       return false;
     }
 
@@ -703,8 +716,8 @@
     if (is_recursive_call &&
         inlining_recursion_depth_ >= FLAG_inlining_recursion_depth_threshold) {
       TRACE_INLINING(THR_Print("     Bailout: recursive function\n"));
-      PRINT_INLINING_TREE("Recursive function",
-          &call_data->caller, &function, call_data->call);
+      PRINT_INLINING_TREE("Recursive function", &call_data->caller, &function,
+                          call_data->call);
       return false;
     }
 
@@ -720,48 +733,60 @@
         // Makes sure no classes are loaded during parsing in background.
         const intptr_t loading_invalidation_gen_at_start =
             isolate->loading_invalidation_gen();
-        // Parse the callee function.
-        bool in_cache;
-        ParsedFunction* parsed_function;
-       {
-          CSTAT_TIMER_SCOPE(thread(), graphinliner_parse_timer);
-          parsed_function = GetParsedFunction(function, &in_cache);
-        }
 
         if (Compiler::IsBackgroundCompilation()) {
           if (isolate->IsTopLevelParsing() ||
-                  (loading_invalidation_gen_at_start !=
-                   isolate->loading_invalidation_gen())) {
+              (loading_invalidation_gen_at_start !=
+               isolate->loading_invalidation_gen())) {
             // Loading occured while parsing. We need to abort here because
             // state changed while compiling.
-            Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId,
-                "Loading occured while parsing in inliner");
+            Compiler::AbortBackgroundCompilation(
+                Thread::kNoDeoptId, "Loading occured while parsing in inliner");
           }
         }
 
         // Load IC data for the callee.
         ZoneGrowableArray<const ICData*>* ic_data_array =
-              new(Z) ZoneGrowableArray<const ICData*>();
+            new (Z) ZoneGrowableArray<const ICData*>();
         const bool clone_ic_data = Compiler::IsBackgroundCompilation();
         function.RestoreICDataMap(ic_data_array, clone_ic_data);
         if (Compiler::IsBackgroundCompilation() &&
             (function.ic_data_array() == Array::null())) {
           Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId,
-              "ICData cleared while inlining");
+                                               "ICData cleared while inlining");
+        }
+
+        // Parse the callee function.
+        bool in_cache;
+        ParsedFunction* parsed_function;
+        {
+          CSTAT_TIMER_SCOPE(thread(), graphinliner_parse_timer);
+          parsed_function = GetParsedFunction(function, &in_cache);
         }
 
         // Build the callee graph.
         InlineExitCollector* exit_collector =
-            new(Z) InlineExitCollector(caller_graph_, call);
-        FlowGraphBuilder builder(*parsed_function,
-                                 *ic_data_array,
-                                 exit_collector,
-                                 Compiler::kNoOSRDeoptId);
-        builder.SetInitialBlockId(caller_graph_->max_block_id());
+            new (Z) InlineExitCollector(caller_graph_, call);
         FlowGraph* callee_graph;
-        {
-          CSTAT_TIMER_SCOPE(thread(), graphinliner_build_timer);
-          callee_graph = builder.BuildGraph();
+        if (UseKernelFrontEndFor(parsed_function)) {
+          kernel::TreeNode* node = static_cast<kernel::TreeNode*>(
+              parsed_function->function().kernel_function());
+
+          kernel::FlowGraphBuilder builder(
+              node, parsed_function, *ic_data_array, exit_collector,
+              Compiler::kNoOSRDeoptId, caller_graph_->max_block_id() + 1);
+          {
+            CSTAT_TIMER_SCOPE(thread(), graphinliner_build_timer);
+            callee_graph = builder.BuildGraph();
+          }
+        } else {
+          FlowGraphBuilder builder(*parsed_function, *ic_data_array,
+                                   exit_collector, Compiler::kNoOSRDeoptId);
+          builder.SetInitialBlockId(caller_graph_->max_block_id());
+          {
+            CSTAT_TIMER_SCOPE(thread(), graphinliner_build_timer);
+            callee_graph = builder.BuildGraph();
+          }
         }
 
         // The parameter stubs are a copy of the actual arguments providing
@@ -769,13 +794,12 @@
         // without linking between the caller and callee graphs.
         // TODO(zerny): Put more information in the stubs, eg, type information.
         ZoneGrowableArray<Definition*>* param_stubs =
-            new(Z) ZoneGrowableArray<Definition*>(
-                function.NumParameters());
+            new (Z) ZoneGrowableArray<Definition*>(function.NumParameters());
 
         // Create a parameter stub for each fixed positional parameter.
         for (intptr_t i = 0; i < function.num_fixed_parameters(); ++i) {
-          param_stubs->Add(CreateParameterStub(i, (*arguments)[i],
-                                               callee_graph));
+          param_stubs->Add(
+              CreateParameterStub(i, (*arguments)[i], callee_graph));
         }
 
         // If the callee has optional parameters, rebuild the argument and stub
@@ -783,15 +807,13 @@
         // parameters.
         if (function.HasOptionalParameters()) {
           TRACE_INLINING(THR_Print("     adjusting for optional parameters\n"));
-          if (!AdjustForOptionalParameters(*parsed_function,
-                                           argument_names,
-                                           arguments,
-                                           param_stubs,
+          if (!AdjustForOptionalParameters(*parsed_function, argument_names,
+                                           arguments, param_stubs,
                                            callee_graph)) {
             function.set_is_inlinable(false);
             TRACE_INLINING(THR_Print("     Bailout: optional arg mismatch\n"));
-            PRINT_INLINING_TREE("Optional arg mismatch",
-                &call_data->caller, &function, call_data->call);
+            PRINT_INLINING_TREE("Optional arg mismatch", &call_data->caller,
+                                &function, call_data->call);
             return false;
           }
         }
@@ -829,7 +851,7 @@
           // Deopt-ids overlap between caller and callee.
           if (FLAG_precompiled_mode) {
 #ifdef DART_PRECOMPILER
-            AotOptimizer optimizer(callee_graph,
+            AotOptimizer optimizer(inliner_->precompiler_, callee_graph,
                                    inliner_->use_speculative_inlining_,
                                    inliner_->inlining_black_list_);
             optimizer.PopulateWithICData();
@@ -901,22 +923,22 @@
             function.set_is_inlinable(false);
           }
           thread()->set_deopt_id(prev_deopt_id);
-          TRACE_INLINING(THR_Print("     Bailout: heuristics with "
-                                   "code size:  %" Pd ", "
-                                   "call sites: %" Pd ", "
-                                   "const args: %" Pd "\n",
-                                   size,
-                                   call_site_count,
-                                   constants_count));
-          PRINT_INLINING_TREE("Heuristic fail",
-              &call_data->caller, &function, call_data->call);
+          TRACE_INLINING(
+              THR_Print("     Bailout: heuristics with "
+                        "code size:  %" Pd ", "
+                        "call sites: %" Pd ", "
+                        "const args: %" Pd "\n",
+                        size, call_site_count, constants_count));
+          PRINT_INLINING_TREE("Heuristic fail", &call_data->caller, &function,
+                              call_data->call);
           return false;
         }
 
         // Inline dispatcher methods regardless of the current depth.
-        const intptr_t depth =
-            (function.IsInvokeFieldDispatcher() ||
-             function.IsNoSuchMethodDispatcher()) ? 0 : inlining_depth_;
+        const intptr_t depth = (function.IsInvokeFieldDispatcher() ||
+                                function.IsNoSuchMethodDispatcher())
+                                   ? 0
+                                   : inlining_depth_;
         collected_call_sites_->FindCallSites(callee_graph, depth,
                                              &inlined_info_);
 
@@ -942,21 +964,21 @@
         const ZoneGrowableArray<const Field*>& callee_guarded_fields =
             *callee_graph->parsed_function().guarded_fields();
         for (intptr_t i = 0; i < callee_guarded_fields.length(); ++i) {
-          caller_graph()->
-              parsed_function().AddToGuardedFields(callee_guarded_fields[i]);
+          caller_graph()->parsed_function().AddToGuardedFields(
+              callee_guarded_fields[i]);
         }
         // When inlined, we add the deferred prefixes of the callee to the
         // caller's list of deferred prefixes.
         caller_graph()->AddToDeferredPrefixes(
             callee_graph->deferred_prefixes());
 
-        FlowGraphInliner::SetInliningId(callee_graph,
+        FlowGraphInliner::SetInliningId(
+            callee_graph,
             inliner_->NextInlineId(callee_graph->function(),
                                    call_data->call->token_pos(),
                                    call_data->caller_inlining_id_));
         TRACE_INLINING(THR_Print("     Success\n"));
-        PRINT_INLINING_TREE(NULL,
-            &call_data->caller, &function, call);
+        PRINT_INLINING_TREE(NULL, &call_data->caller, &function, call);
         return true;
       } else {
         error = thread()->sticky_error();
@@ -965,13 +987,12 @@
         if (error.IsLanguageError() &&
             (LanguageError::Cast(error).kind() == Report::kBailout)) {
           if (error.raw() == Object::background_compilation_error().raw()) {
-             // Fall through to exit the compilation, and retry it later.
+            // Fall through to exit the compilation, and retry it later.
           } else {
             thread()->set_deopt_id(prev_deopt_id);
-            TRACE_INLINING(THR_Print("     Bailout: %s\n",
-                                     error.ToErrorCString()));
-            PRINT_INLINING_TREE("Bailout",
-                &call_data->caller, &function, call);
+            TRACE_INLINING(
+                THR_Print("     Bailout: %s\n", error.ToErrorCString()));
+            PRINT_INLINING_TREE("Bailout", &call_data->caller, &function, call);
             return false;
           }
         } else {
@@ -987,8 +1008,7 @@
     // In background compilation we may abort compilation as the state
     // changes while compiling. Propagate that 'error' and retry compilation
     // later.
-    ASSERT(FLAG_precompiled_mode ||
-           Compiler::IsBackgroundCompilation() ||
+    ASSERT(FLAG_precompiled_mode || Compiler::IsBackgroundCompilation() ||
            error.IsUnhandledException());
     Thread::Current()->long_jump_base()->Jump(1, error);
     UNREACHABLE();
@@ -998,10 +1018,8 @@
   void PrintInlinedInfo(const Function& top) {
     if (inlined_info_.length() > 0) {
       THR_Print("Inlining into: '%s' growth: %f (%" Pd " -> %" Pd ")\n",
-          top.ToFullyQualifiedCString(),
-          GrowthFactor(),
-          initial_size_,
-          inlined_size_);
+                top.ToFullyQualifiedCString(), GrowthFactor(), initial_size_,
+                inlined_size_);
       PrintInlinedInfoFor(top, 1);
     }
   }
@@ -1031,9 +1049,8 @@
         for (int t = 0; t < depth; t++) {
           THR_Print("  ");
         }
-        THR_Print("%" Pd " %s\n",
-            info.call_instr->GetDeoptId(),
-            info.inlined->ToQualifiedCString());
+        THR_Print("%" Pd " %s\n", info.call_instr->GetDeoptId(),
+                  info.inlined->ToQualifiedCString());
         PrintInlinedInfoFor(*info.inlined, depth + 1);
         call_instructions_printed.Add(info.call_instr->GetDeoptId());
       }
@@ -1051,10 +1068,8 @@
         for (int t = 0; t < depth; t++) {
           THR_Print("  ");
         }
-        THR_Print("NO %" Pd " %s - %s\n",
-            info.call_instr->GetDeoptId(),
-            info.inlined->ToQualifiedCString(),
-            info.bailout_reason);
+        THR_Print("NO %" Pd " %s - %s\n", info.call_instr->GetDeoptId(),
+                  info.inlined->ToQualifiedCString(), info.bailout_reason);
         call_instructions_printed.Add(info.call_instr->GetDeoptId());
       }
     }
@@ -1100,14 +1115,12 @@
       CurrentContextInstr* context = (*defns)[i]->AsCurrentContext();
       if ((context != NULL) && context->HasUses()) {
         ASSERT(call->IsClosureCall());
-        LoadFieldInstr* context_load = new(Z) LoadFieldInstr(
-            new Value((*arguments)[0]->definition()),
-            Closure::context_offset(),
+        LoadFieldInstr* context_load = new (Z) LoadFieldInstr(
+            new Value((*arguments)[0]->definition()), Closure::context_offset(),
             AbstractType::ZoneHandle(zone(), AbstractType::null()),
             call_data->call->token_pos());
         context_load->set_is_immutable(true);
-        context_load->set_ssa_temp_index(
-            caller_graph_->alloc_ssa_temp_index());
+        context_load->set_ssa_temp_index(caller_graph_->alloc_ssa_temp_index());
         context_load->InsertBefore(callee_entry->next());
         context->ReplaceUsesWith(context_load);
       }
@@ -1137,9 +1150,11 @@
     }
     *in_cache = false;
     ParsedFunction* parsed_function =
-        new(Z) ParsedFunction(thread(), function);
-    Parser::ParseFunction(parsed_function);
-    parsed_function->AllocateVariables();
+        new (Z) ParsedFunction(thread(), function);
+    if (!UseKernelFrontEndFor(parsed_function)) {
+      Parser::ParseFunction(parsed_function);
+      parsed_function->AllocateVariables();
+    }
     return parsed_function;
   }
 
@@ -1152,13 +1167,12 @@
       const Function& target = call->function();
       if (!inliner_->AlwaysInline(target) &&
           (call_info[call_idx].ratio * 100) < FLAG_inlining_hotness) {
-        TRACE_INLINING(THR_Print(
-            "  => %s (deopt count %d)\n     Bailout: cold %f\n",
-            target.ToCString(),
-            target.deoptimization_counter(),
-            call_info[call_idx].ratio));
-        PRINT_INLINING_TREE("Too cold",
-            &call_info[call_idx].caller(), &call->function(), call);
+        TRACE_INLINING(
+            THR_Print("  => %s (deopt count %d)\n     Bailout: cold %f\n",
+                      target.ToCString(), target.deoptimization_counter(),
+                      call_info[call_idx].ratio));
+        PRINT_INLINING_TREE("Too cold", &call_info[call_idx].caller(),
+                            &call->function(), call);
         continue;
       }
       GrowableArray<Value*> arguments(call->ArgumentCount());
@@ -1177,8 +1191,8 @@
   void InlineClosureCalls() {
     const GrowableArray<CallSites::ClosureCallInfo>& call_info =
         inlining_call_sites_->closure_calls();
-    TRACE_INLINING(THR_Print("  Closure Calls (%" Pd ")\n",
-        call_info.length()));
+    TRACE_INLINING(
+        THR_Print("  Closure Calls (%" Pd ")\n", call_info.length()));
     for (intptr_t call_idx = 0; call_idx < call_info.length(); ++call_idx) {
       ClosureCallInstr* call = call_info[call_idx].call;
       // Find the closure of the callee.
@@ -1192,8 +1206,7 @@
       }
       ConstantInstr* constant =
           call->ArgumentAt(0)->OriginalDefinition()->AsConstant();
-      if ((constant != NULL) &&
-          constant->value().IsClosure()) {
+      if ((constant != NULL) && constant->value().IsClosure()) {
         target ^= Closure::Cast(constant->value()).function();
       }
 
@@ -1208,9 +1221,7 @@
       InlinedCallData call_data(
           call, &arguments, call_info[call_idx].caller(),
           call_info[call_idx].caller_graph->inlining_id());
-      if (TryInlining(target,
-                      call->argument_names(),
-                      &call_data)) {
+      if (TryInlining(target, call->argument_names(), &call_data)) {
         InlineCall(&call_data);
       }
     }
@@ -1226,9 +1237,9 @@
       if (call->with_checks()) {
         // PolymorphicInliner introduces deoptimization paths.
         if (!call->complete() && !FLAG_polymorphic_with_deopt) {
-          TRACE_INLINING(THR_Print(
-              "  => %s\n     Bailout: call with checks\n",
-              call->instance_call()->function_name().ToCString()));
+          TRACE_INLINING(
+              THR_Print("  => %s\n     Bailout: call with checks\n",
+                        call->instance_call()->function_name().ToCString()));
           continue;
         }
         const Function& cl = call_info[call_idx].caller();
@@ -1243,13 +1254,12 @@
       const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0));
       if (!inliner_->AlwaysInline(target) &&
           (call_info[call_idx].ratio * 100) < FLAG_inlining_hotness) {
-        TRACE_INLINING(THR_Print(
-            "  => %s (deopt count %d)\n     Bailout: cold %f\n",
-            target.ToCString(),
-            target.deoptimization_counter(),
-            call_info[call_idx].ratio));
-        PRINT_INLINING_TREE("Too cold",
-            &call_info[call_idx].caller(), &target, call);
+        TRACE_INLINING(
+            THR_Print("  => %s (deopt count %d)\n     Bailout: cold %f\n",
+                      target.ToCString(), target.deoptimization_counter(),
+                      call_info[call_idx].ratio));
+        PRINT_INLINING_TREE("Too cold", &call_info[call_idx].caller(), &target,
+                            call);
         continue;
       }
       GrowableArray<Value*> arguments(call->ArgumentCount());
@@ -1259,8 +1269,7 @@
       InlinedCallData call_data(
           call, &arguments, call_info[call_idx].caller(),
           call_info[call_idx].caller_graph->inlining_id());
-      if (TryInlining(target,
-                      call->instance_call()->argument_names(),
+      if (TryInlining(target, call->instance_call()->argument_names(),
                       &call_data)) {
         InlineCall(&call_data);
       }
@@ -1296,7 +1305,7 @@
       for (intptr_t i = arg_count; i < param_count; ++i) {
         const Instance& object =
             parsed_function.DefaultParameterValueAt(i - fixed_param_count);
-        ConstantInstr* constant = new(Z) ConstantInstr(object);
+        ConstantInstr* constant = new (Z) ConstantInstr(object);
         arguments->Add(NULL);
         param_stubs->Add(constant);
       }
@@ -1385,11 +1394,9 @@
       inlined_variants_(num_variants_),
       non_inlined_variants_(num_variants_),
       inlined_entries_(num_variants_),
-      exit_collector_(new(Z)
-          InlineExitCollector(owner->caller_graph(), call)),
+      exit_collector_(new (Z) InlineExitCollector(owner->caller_graph(), call)),
       caller_function_(caller_function),
-      caller_inlining_id_(caller_inlining_id) {
-}
+      caller_inlining_id_(caller_inlining_id) {}
 
 
 Isolate* PolymorphicInliner::isolate() const {
@@ -1441,7 +1448,7 @@
             new TargetEntryInstr(owner_->caller_graph()->allocate_block_id(),
                                  old_target->try_index());
         new_target->InheritDeoptTarget(zone(), new_join);
-        GotoInstr* new_goto = new(Z) GotoInstr(new_join);
+        GotoInstr* new_goto = new (Z) GotoInstr(new_join);
         new_goto->InheritDeoptTarget(zone(), new_join);
         new_target->LinkTo(new_goto);
         new_target->set_last_instruction(new_goto);
@@ -1476,7 +1483,7 @@
 
 
 bool PolymorphicInliner::TryInliningPoly(intptr_t receiver_cid,
-                                        const Function& target) {
+                                         const Function& target) {
   if ((!FLAG_precompiled_mode ||
        owner_->inliner_->use_speculative_inlining()) &&
       TryInlineRecognizedMethod(receiver_cid, target)) {
@@ -1488,11 +1495,9 @@
   for (int i = 0; i < call_->ArgumentCount(); ++i) {
     arguments.Add(call_->PushArgumentAt(i)->value());
   }
-  InlinedCallData call_data(call_, &arguments,
-                            caller_function_,
+  InlinedCallData call_data(call_, &arguments, caller_function_,
                             caller_inlining_id_);
-  if (!owner_->TryInlining(target,
-                           call_->instance_call()->argument_names(),
+  if (!owner_->TryInlining(target, call_->instance_call()->argument_names(),
                            &call_data)) {
     return false;
   }
@@ -1507,8 +1512,7 @@
   // hoisted above the inlined entry.
   ASSERT(arguments.length() > 0);
   Value* actual = arguments[0];
-  RedefinitionInstr* redefinition = new(Z)
-      RedefinitionInstr(actual->Copy(Z));
+  RedefinitionInstr* redefinition = new (Z) RedefinitionInstr(actual->Copy(Z));
   redefinition->set_ssa_temp_index(
       owner_->caller_graph()->alloc_ssa_temp_index());
   redefinition->UpdateType(CompileType::FromCid(receiver_cid));
@@ -1534,11 +1538,10 @@
     CurrentContextInstr* context = (*defns)[i]->AsCurrentContext();
     if ((context != NULL) && context->HasUses()) {
       ASSERT(call_data.call->IsClosureCall());
-      LoadFieldInstr* context_load = new(Z) LoadFieldInstr(
-          new Value(redefinition),
-          Closure::context_offset(),
-          AbstractType::ZoneHandle(zone(), AbstractType::null()),
-          call_data.call->token_pos());
+      LoadFieldInstr* context_load = new (Z)
+          LoadFieldInstr(new Value(redefinition), Closure::context_offset(),
+                         AbstractType::ZoneHandle(zone(), AbstractType::null()),
+                         call_data.call->token_pos());
       context_load->set_is_immutable(true);
       context_load->set_ssa_temp_index(
           owner_->caller_graph()->alloc_ssa_temp_index());
@@ -1550,8 +1553,7 @@
 }
 
 
-static Instruction* AppendInstruction(Instruction* first,
-                                      Instruction* second) {
+static Instruction* AppendInstruction(Instruction* first, Instruction* second) {
   for (intptr_t i = second->InputCount() - 1; i >= 0; --i) {
     Value* input = second->InputAt(i);
     input->definition()->AddInputUse(input);
@@ -1569,40 +1571,31 @@
   // the inlined body from being hoisted above the inlined entry.
   GrowableArray<Definition*> arguments(call_->ArgumentCount());
   Definition* receiver = call_->ArgumentAt(0);
-    RedefinitionInstr* redefinition =
-        new(Z) RedefinitionInstr(new(Z) Value(receiver));
-    redefinition->set_ssa_temp_index(
-        owner_->caller_graph()->alloc_ssa_temp_index());
+  RedefinitionInstr* redefinition =
+      new (Z) RedefinitionInstr(new (Z) Value(receiver));
+  redefinition->set_ssa_temp_index(
+      owner_->caller_graph()->alloc_ssa_temp_index());
   if (FlowGraphInliner::TryInlineRecognizedMethod(
-          owner_->caller_graph(),
-          receiver_cid,
-          target,
-          call_,
-          redefinition,
+          owner_->caller_graph(), receiver_cid, target, call_, redefinition,
           call_->instance_call()->token_pos(),
-          *call_->instance_call()->ic_data(),
-          &entry, &last)) {
+          *call_->instance_call()->ic_data(), &entry, &last)) {
     // Create a graph fragment.
     redefinition->InsertAfter(entry);
     InlineExitCollector* exit_collector =
-        new(Z) InlineExitCollector(owner_->caller_graph(), call_);
+        new (Z) InlineExitCollector(owner_->caller_graph(), call_);
 
-    ReturnInstr* result =
-        new(Z) ReturnInstr(call_->instance_call()->token_pos(),
-            new(Z) Value(last));
+    ReturnInstr* result = new (Z)
+        ReturnInstr(call_->instance_call()->token_pos(), new (Z) Value(last));
     owner_->caller_graph()->AppendTo(
-        last,
-        result,
+        last, result,
         call_->env(),  // Return can become deoptimization target.
         FlowGraph::kEffect);
     entry->set_last_instruction(result);
     exit_collector->AddExit(result);
     ParsedFunction* temp_parsed_function =
         new ParsedFunction(Thread::Current(), target);
-    GraphEntryInstr* graph_entry =
-        new(Z) GraphEntryInstr(*temp_parsed_function,
-                               entry,
-                               Compiler::kNoOSRDeoptId);
+    GraphEntryInstr* graph_entry = new (Z)
+        GraphEntryInstr(*temp_parsed_function, entry, Compiler::kNoOSRDeoptId);
     // Update polymorphic inliner state.
     inlined_entries_.Add(graph_entry);
     exit_collector_->Union(exit_collector);
@@ -1621,9 +1614,8 @@
 TargetEntryInstr* PolymorphicInliner::BuildDecisionGraph() {
   // Start with a fresh target entry.
   TargetEntryInstr* entry =
-      new(Z) TargetEntryInstr(
-          owner_->caller_graph()->allocate_block_id(),
-          call_->GetBlock()->try_index());
+      new (Z) TargetEntryInstr(owner_->caller_graph()->allocate_block_id(),
+                               call_->GetBlock()->try_index());
   entry->InheritDeoptTarget(zone(), call_);
 
   // This function uses a cursor (a pointer to the 'current' instruction) to
@@ -1636,7 +1628,7 @@
   // There are at least two variants including non-inlined ones, so we have
   // at least one branch on the class id.
   LoadClassIdInstr* load_cid =
-      new(Z) LoadClassIdInstr(new(Z) Value(receiver));
+      new (Z) LoadClassIdInstr(new (Z) Value(receiver));
   load_cid->set_ssa_temp_index(owner_->caller_graph()->alloc_ssa_temp_index());
   cursor = AppendInstruction(cursor, load_cid);
   for (intptr_t i = 0; i < inlined_variants_.length(); ++i) {
@@ -1648,14 +1640,13 @@
       // we know that we have covered all possible classes.
       if (!call_->complete()) {
         RedefinitionInstr* cid_redefinition =
-            new RedefinitionInstr(new(Z) Value(load_cid));
+            new RedefinitionInstr(new (Z) Value(load_cid));
         cid_redefinition->set_ssa_temp_index(
             owner_->caller_graph()->alloc_ssa_temp_index());
         cursor = AppendInstruction(cursor, cid_redefinition);
-        CheckClassIdInstr* check_class_id = new(Z) CheckClassIdInstr(
-            new(Z) Value(cid_redefinition),
-            inlined_variants_[i].cid,
-            call_->deopt_id());
+        CheckClassIdInstr* check_class_id = new (Z)
+            CheckClassIdInstr(new (Z) Value(cid_redefinition),
+                              inlined_variants_[i].cid, call_->deopt_id());
         check_class_id->InheritDeoptTarget(zone(), call_);
         cursor = AppendInstruction(cursor, check_class_id);
       }
@@ -1667,8 +1658,7 @@
       if (callee_entry->IsGraphEntry()) {
         // Unshared.  Graft the normal entry on after the check class
         // instruction.
-        TargetEntryInstr* target =
-            callee_entry->AsGraphEntry()->normal_entry();
+        TargetEntryInstr* target = callee_entry->AsGraphEntry()->normal_entry();
         cursor->LinkTo(target->next());
         target->ReplaceAsPredecessorWith(current_block);
         // Unuse all inputs of the graph entry and the normal entry. They are
@@ -1677,9 +1667,7 @@
         target->UnuseAllInputs();
         // All blocks that were dominated by the normal entry are now
         // dominated by the current block.
-        for (intptr_t j = 0;
-             j < target->dominated_blocks().length();
-             ++j) {
+        for (intptr_t j = 0; j < target->dominated_blocks().length(); ++j) {
           BlockEntryInstr* block = target->dominated_blocks()[j];
           current_block->AddDominatedBlock(block);
         }
@@ -1706,12 +1694,10 @@
       ConstantInstr* cid_constant = new ConstantInstr(cid);
       cid_constant->set_ssa_temp_index(
           owner_->caller_graph()->alloc_ssa_temp_index());
-      StrictCompareInstr* compare =
-          new StrictCompareInstr(call_->instance_call()->token_pos(),
-                                 Token::kEQ_STRICT,
-                                 new Value(load_cid),
-                                 new Value(cid_constant),
-                                 false);  // No number check.
+      StrictCompareInstr* compare = new StrictCompareInstr(
+          call_->instance_call()->token_pos(), Token::kEQ_STRICT,
+          new Value(load_cid), new Value(cid_constant),
+          false);  // No number check.
       BranchInstr* branch = new BranchInstr(compare);
       branch->InheritDeoptTarget(zone(), call_);
       AppendInstruction(AppendInstruction(cursor, cid_constant), branch);
@@ -1732,8 +1718,7 @@
         // Shared inlined body and this is the first entry.  We have already
         // constructed a join and this target jumps to it.
         true_target = callee_entry->AsTargetEntry();
-        BlockEntryInstr* join =
-            true_target->last_instruction()->SuccessorAt(0);
+        BlockEntryInstr* join = true_target->last_instruction()->SuccessorAt(0);
         current_block->AddDominatedBlock(join);
       } else {
         // Shared inlined body and this is a subsequent entry.  We have
@@ -1777,33 +1762,28 @@
       cursor = push;
     }
     const ICData& old_checks = call_->ic_data();
-    const ICData& new_checks = ICData::ZoneHandle(
-        ICData::New(Function::Handle(old_checks.Owner()),
-                    String::Handle(old_checks.target_name()),
-                    Array::Handle(old_checks.arguments_descriptor()),
-                    old_checks.deopt_id(),
-                    1,        // Number of args tested.
-                    false));  // is_static_call
+    const ICData& new_checks = ICData::ZoneHandle(ICData::New(
+        Function::Handle(old_checks.Owner()),
+        String::Handle(old_checks.target_name()),
+        Array::Handle(old_checks.arguments_descriptor()), old_checks.deopt_id(),
+        1,        // Number of args tested.
+        false));  // is_static_call
     for (intptr_t i = 0; i < non_inlined_variants_.length(); ++i) {
       new_checks.AddReceiverCheck(non_inlined_variants_[i].cid,
                                   *non_inlined_variants_[i].target,
                                   non_inlined_variants_[i].count);
     }
     PolymorphicInstanceCallInstr* fallback_call =
-        new PolymorphicInstanceCallInstr(call_->instance_call(),
-                                         new_checks,
+        new PolymorphicInstanceCallInstr(call_->instance_call(), new_checks,
                                          /* with_checks = */ true,
                                          call_->complete());
     fallback_call->set_ssa_temp_index(
         owner_->caller_graph()->alloc_ssa_temp_index());
     fallback_call->InheritDeoptTarget(zone(), call_);
-    ReturnInstr* fallback_return =
-        new ReturnInstr(call_->instance_call()->token_pos(),
-                        new Value(fallback_call));
-    fallback_return->InheritDeoptTargetAfter(
-        owner_->caller_graph(),
-        call_,
-        fallback_call);
+    ReturnInstr* fallback_return = new ReturnInstr(
+        call_->instance_call()->token_pos(), new Value(fallback_call));
+    fallback_return->InheritDeoptTargetAfter(owner_->caller_graph(), call_,
+                                             fallback_call);
     AppendInstruction(AppendInstruction(cursor, fallback_call),
                       fallback_return);
     exit_collector_->AddExit(fallback_return);
@@ -1822,8 +1802,7 @@
 
 void PolymorphicInliner::Inline() {
   // Consider the polymorphic variants in order by frequency.
-  FlowGraphCompiler::SortICDataByCount(call_->ic_data(),
-                                       &variants_,
+  FlowGraphCompiler::SortICDataByCount(call_->ic_data(), &variants_,
                                        /* drop_smi = */ false);
   for (intptr_t var_idx = 0; var_idx < variants_.length(); ++var_idx) {
     const Function& target = *variants_[var_idx].target;
@@ -1878,14 +1857,16 @@
     GrowableArray<TokenPosition>* inline_id_to_token_pos,
     GrowableArray<intptr_t>* caller_inline_id,
     bool use_speculative_inlining,
-    GrowableArray<intptr_t>* inlining_black_list)
+    GrowableArray<intptr_t>* inlining_black_list,
+    Precompiler* precompiler)
     : flow_graph_(flow_graph),
       inline_id_to_function_(inline_id_to_function),
       inline_id_to_token_pos_(inline_id_to_token_pos),
       caller_inline_id_(caller_inline_id),
       trace_inlining_(ShouldTraceInlining(flow_graph)),
       use_speculative_inlining_(use_speculative_inlining),
-      inlining_black_list_(inlining_black_list) {
+      inlining_black_list_(inlining_black_list),
+      precompiler_(precompiler) {
   ASSERT(!use_speculative_inlining || (inlining_black_list != NULL));
 }
 
@@ -1911,10 +1892,8 @@
   ASSERT(flow_graph->inlining_id() < 0);
   flow_graph->set_inlining_id(inlining_id);
   for (BlockIterator block_it = flow_graph->postorder_iterator();
-       !block_it.Done();
-       block_it.Advance()) {
-    for (ForwardInstructionIterator it(block_it.Current());
-         !it.Done();
+       !block_it.Done(); block_it.Advance()) {
+    for (ForwardInstructionIterator it(block_it.Current()); !it.Done();
          it.Advance()) {
       Instruction* current = it.Current();
       // Do not overwrite owner function.
@@ -1939,8 +1918,8 @@
   const char* kAlwaysInlineAnnotation = "AlwaysInline";
   if (FLAG_enable_inlining_annotations &&
       HasAnnotation(function, kAlwaysInlineAnnotation)) {
-    TRACE_INLINING(THR_Print("AlwaysInline annotation for %s\n",
-                             function.ToCString()));
+    TRACE_INLINING(
+        THR_Print("AlwaysInline annotation for %s\n", function.ToCString()));
     return true;
   }
 
@@ -1970,11 +1949,10 @@
 
   TRACE_INLINING(THR_Print("Inlining calls in %s\n", top.ToCString()));
 
-  if (FLAG_support_il_printer &&
-      trace_inlining() &&
+  if (FLAG_support_il_printer && trace_inlining() &&
       (FLAG_print_flow_graph || FLAG_print_flow_graph_optimized)) {
-    THR_Print("Before Inlining of %s\n", flow_graph_->
-              function().ToFullyQualifiedCString());
+    THR_Print("Before Inlining of %s\n",
+              flow_graph_->function().ToFullyQualifiedCString());
     FlowGraphPrinter printer(*flow_graph_);
     printer.PrintBlocks();
   }
@@ -1991,8 +1969,8 @@
       THR_Print("Inlining growth factor: %f\n", inliner.GrowthFactor());
       if (FLAG_support_il_printer &&
           (FLAG_print_flow_graph || FLAG_print_flow_graph_optimized)) {
-        THR_Print("After Inlining of %s\n", flow_graph_->
-                  function().ToFullyQualifiedCString());
+        THR_Print("After Inlining of %s\n",
+                  flow_graph_->function().ToFullyQualifiedCString());
         FlowGraphPrinter printer(*flow_graph_);
         printer.PrintBlocks();
       }
@@ -2055,54 +2033,36 @@
                                        Definition* index,
                                        Instruction** cursor) {
   // Insert array length load and bounds check.
-  LoadFieldInstr* length =
-      new(Z) LoadFieldInstr(
-          new(Z) Value(*array),
-          CheckArrayBoundInstr::LengthOffsetFor(array_cid),
-          Type::ZoneHandle(Z, Type::SmiType()),
-          call->token_pos());
+  LoadFieldInstr* length = new (Z) LoadFieldInstr(
+      new (Z) Value(*array), CheckArrayBoundInstr::LengthOffsetFor(array_cid),
+      Type::ZoneHandle(Z, Type::SmiType()), call->token_pos());
   length->set_is_immutable(
       CheckArrayBoundInstr::IsFixedLengthArrayType(array_cid));
   length->set_result_cid(kSmiCid);
   length->set_recognized_kind(
       LoadFieldInstr::RecognizedKindFromArrayCid(array_cid));
-  *cursor = flow_graph->AppendTo(*cursor,
-                                 length,
-                                 NULL,
-                                 FlowGraph::kValue);
+  *cursor = flow_graph->AppendTo(*cursor, length, NULL, FlowGraph::kValue);
 
-  *cursor = flow_graph->AppendTo(*cursor,
-                                 new(Z) CheckArrayBoundInstr(
-                                     new(Z) Value(length),
-                                     new(Z) Value(index),
-                                     call->deopt_id()),
-                                 call->env(),
-                                 FlowGraph::kEffect);
+  *cursor = flow_graph->AppendTo(
+      *cursor,
+      new (Z) CheckArrayBoundInstr(new (Z) Value(length), new (Z) Value(index),
+                                   call->deopt_id()),
+      call->env(), FlowGraph::kEffect);
 
   if (array_cid == kGrowableObjectArrayCid) {
     // Insert data elements load.
-    LoadFieldInstr* elements =
-        new(Z) LoadFieldInstr(
-            new(Z) Value(*array),
-            GrowableObjectArray::data_offset(),
-            Object::dynamic_type(),
-            call->token_pos());
+    LoadFieldInstr* elements = new (Z) LoadFieldInstr(
+        new (Z) Value(*array), GrowableObjectArray::data_offset(),
+        Object::dynamic_type(), call->token_pos());
     elements->set_result_cid(kArrayCid);
-    *cursor = flow_graph->AppendTo(*cursor,
-                                   elements,
-                                   NULL,
-                                   FlowGraph::kValue);
+    *cursor = flow_graph->AppendTo(*cursor, elements, NULL, FlowGraph::kValue);
     // Load from the data from backing store which is a fixed-length array.
     *array = elements;
     array_cid = kArrayCid;
   } else if (RawObject::IsExternalTypedDataClassId(array_cid)) {
-    LoadUntaggedInstr* elements =
-        new(Z) LoadUntaggedInstr(new(Z) Value(*array),
-                                 ExternalTypedData::data_offset());
-    *cursor = flow_graph->AppendTo(*cursor,
-                                   elements,
-                                   NULL,
-                                   FlowGraph::kValue);
+    LoadUntaggedInstr* elements = new (Z) LoadUntaggedInstr(
+        new (Z) Value(*array), ExternalTypedData::data_offset());
+    *cursor = flow_graph->AppendTo(*cursor, elements, NULL, FlowGraph::kValue);
     *array = elements;
   }
   return array_cid;
@@ -2116,12 +2076,10 @@
                                   TokenPosition token_pos) {
   if ((unary_checks.NumberOfUsedChecks() == 1) &&
       unary_checks.HasReceiverClassId(kSmiCid)) {
-    return new(Z) CheckSmiInstr(new(Z) Value(to_check),
-                                deopt_id,
-                                token_pos);
+    return new (Z) CheckSmiInstr(new (Z) Value(to_check), deopt_id, token_pos);
   }
-  return new(Z) CheckClassInstr(
-      new(Z) Value(to_check), deopt_id, unary_checks, token_pos);
+  return new (Z) CheckClassInstr(new (Z) Value(to_check), deopt_id,
+                                 unary_checks, token_pos);
 }
 
 
@@ -2135,16 +2093,12 @@
 
   Definition* array = receiver;
   Definition* index = call->ArgumentAt(1);
-  *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(),
-                                   call->GetBlock()->try_index());
+  *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+                                    call->GetBlock()->try_index());
   (*entry)->InheritDeoptTarget(Z, call);
   Instruction* cursor = *entry;
 
-  array_cid = PrepareInlineIndexedOp(flow_graph,
-                                     call,
-                                     array_cid,
-                                     &array,
-                                     index,
+  array_cid = PrepareInlineIndexedOp(flow_graph, call, array_cid, &array, index,
                                      &cursor);
 
   intptr_t deopt_id = Thread::kNoDeoptId;
@@ -2156,22 +2110,16 @@
 
   // Array load and return.
   intptr_t index_scale = Instance::ElementSizeFor(array_cid);
-  *last = new(Z) LoadIndexedInstr(new(Z) Value(array),
-                                  new(Z) Value(index),
-                                  index_scale,
-                                  array_cid,
-                                  deopt_id,
-                                  call->token_pos());
+  *last = new (Z)
+      LoadIndexedInstr(new (Z) Value(array), new (Z) Value(index), index_scale,
+                       array_cid, kAlignedAccess, deopt_id, call->token_pos());
   cursor = flow_graph->AppendTo(
-      cursor,
-      *last,
-      deopt_id != Thread::kNoDeoptId ? call->env() : NULL,
+      cursor, *last, deopt_id != Thread::kNoDeoptId ? call->env() : NULL,
       FlowGraph::kValue);
 
   if (array_cid == kTypedDataFloat32ArrayCid) {
-    *last = new(Z) FloatToDoubleInstr(new(Z) Value(*last), deopt_id);
-    flow_graph->AppendTo(cursor,
-                         *last,
+    *last = new (Z) FloatToDoubleInstr(new (Z) Value(*last), deopt_id);
+    flow_graph->AppendTo(cursor, *last,
                          deopt_id != Thread::kNoDeoptId ? call->env() : NULL,
                          FlowGraph::kValue);
   }
@@ -2194,8 +2142,8 @@
   Definition* index = call->ArgumentAt(1);
   Definition* stored_value = call->ArgumentAt(2);
 
-  *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(),
-                                   call->GetBlock()->try_index());
+  *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+                                    call->GetBlock()->try_index());
   (*entry)->InheritDeoptTarget(Z, call);
   Instruction* cursor = *entry;
   if (flow_graph->isolate()->type_checks()) {
@@ -2208,17 +2156,14 @@
     switch (array_cid) {
       case kArrayCid:
       case kGrowableObjectArrayCid: {
-        const Class& instantiator_class =  Class::Handle(Z, target.Owner());
+        const Class& instantiator_class = Class::Handle(Z, target.Owner());
         intptr_t type_arguments_field_offset =
             instantiator_class.type_arguments_field_offset();
-        LoadFieldInstr* load_type_args =
-            new(Z) LoadFieldInstr(new(Z) Value(array),
-                                  type_arguments_field_offset,
-                                  Type::ZoneHandle(Z),  // No type.
-                                  call->token_pos());
-        cursor = flow_graph->AppendTo(cursor,
-                                      load_type_args,
-                                      NULL,
+        LoadFieldInstr* load_type_args = new (Z)
+            LoadFieldInstr(new (Z) Value(array), type_arguments_field_offset,
+                           Type::ZoneHandle(Z),  // No type.
+                           call->token_pos());
+        cursor = flow_graph->AppendTo(cursor, load_type_args, NULL,
                                       FlowGraph::kValue);
 
         type_args = load_type_args;
@@ -2235,7 +2180,7 @@
       case kTypedDataUint32ArrayCid:
       case kTypedDataInt64ArrayCid:
         ASSERT(value_type.IsIntType());
-        // Fall through.
+      // Fall through.
       case kTypedDataFloat32ArrayCid:
       case kTypedDataFloat64ArrayCid: {
         type_args = flow_graph->constant_null();
@@ -2263,93 +2208,62 @@
         // TODO(fschneider): Add support for other array types.
         UNREACHABLE();
     }
-    AssertAssignableInstr* assert_value =
-        new(Z) AssertAssignableInstr(token_pos,
-                                     new(Z) Value(stored_value),
-                                     new(Z) Value(type_args),
-                                     value_type,
-                                     Symbols::Value(),
-                                     call->deopt_id());
-    cursor = flow_graph->AppendTo(cursor,
-                                  assert_value,
-                                  call->env(),
+    AssertAssignableInstr* assert_value = new (Z) AssertAssignableInstr(
+        token_pos, new (Z) Value(stored_value), new (Z) Value(type_args),
+        value_type, Symbols::Value(), call->deopt_id());
+    cursor = flow_graph->AppendTo(cursor, assert_value, call->env(),
                                   FlowGraph::kValue);
   }
 
-  array_cid = PrepareInlineIndexedOp(flow_graph,
-                                     call,
-                                     array_cid,
-                                     &array,
-                                     index,
+  array_cid = PrepareInlineIndexedOp(flow_graph, call, array_cid, &array, index,
                                      &cursor);
 
   // Check if store barrier is needed. Byte arrays don't need a store barrier.
   StoreBarrierType needs_store_barrier =
       (RawObject::IsTypedDataClassId(array_cid) ||
        RawObject::IsTypedDataViewClassId(array_cid) ||
-       RawObject::IsExternalTypedDataClassId(array_cid)) ? kNoStoreBarrier
-                                                         : kEmitStoreBarrier;
+       RawObject::IsExternalTypedDataClassId(array_cid))
+          ? kNoStoreBarrier
+          : kEmitStoreBarrier;
 
   // No need to class check stores to Int32 and Uint32 arrays because
   // we insert unboxing instructions below which include a class check.
   if ((array_cid != kTypedDataUint32ArrayCid) &&
-      (array_cid != kTypedDataInt32ArrayCid) &&
-      !value_check.IsNull()) {
+      (array_cid != kTypedDataInt32ArrayCid) && !value_check.IsNull()) {
     // No store barrier needed because checked value is a smi, an unboxed mint,
     // an unboxed double, an unboxed Float32x4, or unboxed Int32x4.
     needs_store_barrier = kNoStoreBarrier;
-    Instruction* check = GetCheckClass(flow_graph,
-                                       stored_value,
-                                       value_check,
-                                       call->deopt_id(),
-                                       call->token_pos());
-    cursor = flow_graph->AppendTo(cursor,
-                                  check,
-                                  call->env(),
-                                  FlowGraph::kEffect);
+    Instruction* check = GetCheckClass(flow_graph, stored_value, value_check,
+                                       call->deopt_id(), call->token_pos());
+    cursor =
+        flow_graph->AppendTo(cursor, check, call->env(), FlowGraph::kEffect);
   }
 
   if (array_cid == kTypedDataFloat32ArrayCid) {
-    stored_value =
-        new(Z) DoubleToFloatInstr(
-            new(Z) Value(stored_value), call->deopt_id());
-    cursor = flow_graph->AppendTo(cursor,
-                                  stored_value,
-                                  NULL,
-                                  FlowGraph::kValue);
+    stored_value = new (Z)
+        DoubleToFloatInstr(new (Z) Value(stored_value), call->deopt_id());
+    cursor =
+        flow_graph->AppendTo(cursor, stored_value, NULL, FlowGraph::kValue);
   } else if (array_cid == kTypedDataInt32ArrayCid) {
-    stored_value = new(Z) UnboxInt32Instr(
-        UnboxInt32Instr::kTruncate,
-        new(Z) Value(stored_value),
-        call->deopt_id());
-    cursor = flow_graph->AppendTo(cursor,
-                                  stored_value,
-                                  call->env(),
+    stored_value =
+        new (Z) UnboxInt32Instr(UnboxInt32Instr::kTruncate,
+                                new (Z) Value(stored_value), call->deopt_id());
+    cursor = flow_graph->AppendTo(cursor, stored_value, call->env(),
                                   FlowGraph::kValue);
   } else if (array_cid == kTypedDataUint32ArrayCid) {
-    stored_value = new(Z) UnboxUint32Instr(
-        new(Z) Value(stored_value),
-        call->deopt_id());
+    stored_value =
+        new (Z) UnboxUint32Instr(new (Z) Value(stored_value), call->deopt_id());
     ASSERT(stored_value->AsUnboxInteger()->is_truncating());
-    cursor = flow_graph->AppendTo(cursor,
-                                  stored_value,
-                                  call->env(),
+    cursor = flow_graph->AppendTo(cursor, stored_value, call->env(),
                                   FlowGraph::kValue);
   }
 
   const intptr_t index_scale = Instance::ElementSizeFor(array_cid);
-  *last = new(Z) StoreIndexedInstr(new(Z) Value(array),
-                                   new(Z) Value(index),
-                                   new(Z) Value(stored_value),
-                                   needs_store_barrier,
-                                   index_scale,
-                                   array_cid,
-                                   call->deopt_id(),
-                                   call->token_pos());
-  flow_graph->AppendTo(cursor,
-                       *last,
-                       call->env(),
-                       FlowGraph::kEffect);
+  *last = new (Z) StoreIndexedInstr(
+      new (Z) Value(array), new (Z) Value(index), new (Z) Value(stored_value),
+      needs_store_barrier, index_scale, array_cid, kAlignedAccess,
+      call->deopt_id(), call->token_pos());
+  flow_graph->AppendTo(cursor, *last, call->env(), FlowGraph::kEffect);
   return true;
 }
 
@@ -2365,15 +2279,13 @@
   Definition* left = call->ArgumentAt(0);
   Definition* right = call->ArgumentAt(1);
 
-  *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(),
-                                   call->GetBlock()->try_index());
+  *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+                                    call->GetBlock()->try_index());
   (*entry)->InheritDeoptTarget(Z, call);
   // Arguments are checked. No need for class check.
-  BinaryDoubleOpInstr* double_bin_op =
-      new(Z) BinaryDoubleOpInstr(op_kind,
-                                 new(Z) Value(left),
-                                 new(Z) Value(right),
-                                 call->deopt_id(), call->token_pos());
+  BinaryDoubleOpInstr* double_bin_op = new (Z)
+      BinaryDoubleOpInstr(op_kind, new (Z) Value(left), new (Z) Value(right),
+                          call->deopt_id(), call->token_pos());
   flow_graph->AppendTo(*entry, double_bin_op, call->env(), FlowGraph::kValue);
   *last = double_bin_op;
 
@@ -2381,6 +2293,30 @@
 }
 
 
+static bool InlineDoubleTestOp(FlowGraph* flow_graph,
+                               Instruction* call,
+                               MethodRecognizer::Kind kind,
+                               TargetEntryInstr** entry,
+                               Definition** last) {
+  if (!CanUnboxDouble()) {
+    return false;
+  }
+  Definition* d = call->ArgumentAt(0);
+
+  *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+                                    call->GetBlock()->try_index());
+  (*entry)->InheritDeoptTarget(Z, call);
+  // Arguments are checked. No need for class check.
+
+  DoubleTestOpInstr* double_test_op = new (Z) DoubleTestOpInstr(
+      kind, new (Z) Value(d), call->deopt_id(), call->token_pos());
+  flow_graph->AppendTo(*entry, double_test_op, call->env(), FlowGraph::kValue);
+  *last = double_test_op;
+
+  return true;
+}
+
+
 static bool InlineSmiBitAndFromSmi(FlowGraph* flow_graph,
                                    Instruction* call,
                                    TargetEntryInstr** entry,
@@ -2388,15 +2324,13 @@
   Definition* left = call->ArgumentAt(0);
   Definition* right = call->ArgumentAt(1);
 
-  *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(),
-                                   call->GetBlock()->try_index());
+  *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+                                    call->GetBlock()->try_index());
   (*entry)->InheritDeoptTarget(Z, call);
   // Right arguments is known to be smi: other._bitAndFromSmi(this);
   BinarySmiOpInstr* smi_op =
-      new(Z) BinarySmiOpInstr(Token::kBIT_AND,
-                              new(Z) Value(left),
-                              new(Z) Value(right),
-                              call->deopt_id());
+      new (Z) BinarySmiOpInstr(Token::kBIT_AND, new (Z) Value(left),
+                               new (Z) Value(right), call->deopt_id());
   flow_graph->AppendTo(*entry, smi_op, call->env(), FlowGraph::kValue);
   *last = smi_op;
 
@@ -2413,16 +2347,13 @@
   Definition* array = call->ArgumentAt(0);
   Definition* value = call->ArgumentAt(1);
 
-  *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(),
-                                   call->GetBlock()->try_index());
+  *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+                                    call->GetBlock()->try_index());
   (*entry)->InheritDeoptTarget(Z, call);
 
   // This is an internal method, no need to check argument types.
-  StoreInstanceFieldInstr* store = new(Z) StoreInstanceFieldInstr(
-      offset,
-      new(Z) Value(array),
-      new(Z) Value(value),
-      store_barrier_type,
+  StoreInstanceFieldInstr* store = new (Z) StoreInstanceFieldInstr(
+      offset, new (Z) Value(array), new (Z) Value(value), store_barrier_type,
       call->token_pos());
   flow_graph->AppendTo(*entry, store, call->env(), FlowGraph::kEffect);
   *last = store;
@@ -2431,37 +2362,28 @@
 }
 
 
-static void PrepareInlineByteArrayBaseOp(
-    FlowGraph* flow_graph,
-    Instruction* call,
-    intptr_t array_cid,
-    intptr_t view_cid,
-    Definition** array,
-    Definition* byte_index,
-    Instruction** cursor) {
-  LoadFieldInstr* length =
-      new(Z) LoadFieldInstr(
-          new(Z) Value(*array),
-          CheckArrayBoundInstr::LengthOffsetFor(array_cid),
-          Type::ZoneHandle(Z, Type::SmiType()),
-          call->token_pos());
+static void PrepareInlineByteArrayBaseOp(FlowGraph* flow_graph,
+                                         Instruction* call,
+                                         intptr_t array_cid,
+                                         intptr_t view_cid,
+                                         Definition** array,
+                                         Definition* byte_index,
+                                         Instruction** cursor) {
+  LoadFieldInstr* length = new (Z) LoadFieldInstr(
+      new (Z) Value(*array), CheckArrayBoundInstr::LengthOffsetFor(array_cid),
+      Type::ZoneHandle(Z, Type::SmiType()), call->token_pos());
   length->set_is_immutable(true);
   length->set_result_cid(kSmiCid);
   length->set_recognized_kind(
       LoadFieldInstr::RecognizedKindFromArrayCid(array_cid));
-  *cursor = flow_graph->AppendTo(*cursor,
-                                 length,
-                                 NULL,
-                                 FlowGraph::kValue);
+  *cursor = flow_graph->AppendTo(*cursor, length, NULL, FlowGraph::kValue);
 
   intptr_t element_size = Instance::ElementSizeFor(array_cid);
   ConstantInstr* bytes_per_element =
       flow_graph->GetConstant(Smi::Handle(Z, Smi::New(element_size)));
-  BinarySmiOpInstr* len_in_bytes =
-      new(Z) BinarySmiOpInstr(Token::kMUL,
-                              new(Z) Value(length),
-                              new(Z) Value(bytes_per_element),
-                              call->deopt_id());
+  BinarySmiOpInstr* len_in_bytes = new (Z)
+      BinarySmiOpInstr(Token::kMUL, new (Z) Value(length),
+                       new (Z) Value(bytes_per_element), call->deopt_id());
   *cursor = flow_graph->AppendTo(*cursor, len_in_bytes, call->env(),
                                  FlowGraph::kValue);
 
@@ -2471,42 +2393,31 @@
   if (adjustment > 0) {
     ConstantInstr* length_adjustment =
         flow_graph->GetConstant(Smi::Handle(Z, Smi::New(adjustment)));
-    adjusted_length =
-        new(Z) BinarySmiOpInstr(Token::kSUB,
-                                new(Z) Value(len_in_bytes),
-                                new(Z) Value(length_adjustment),
-                                call->deopt_id());
+    adjusted_length = new (Z)
+        BinarySmiOpInstr(Token::kSUB, new (Z) Value(len_in_bytes),
+                         new (Z) Value(length_adjustment), call->deopt_id());
     *cursor = flow_graph->AppendTo(*cursor, adjusted_length, call->env(),
                                    FlowGraph::kValue);
   }
 
   // Check adjusted_length > 0.
-  ConstantInstr* zero =
-      flow_graph->GetConstant(Smi::Handle(Z, Smi::New(0)));
-  *cursor = flow_graph->AppendTo(*cursor,
-                                 new(Z) CheckArrayBoundInstr(
-                                     new(Z) Value(adjusted_length),
-                                     new(Z) Value(zero),
-                                     call->deopt_id()),
-                                 call->env(),
-                                 FlowGraph::kEffect);
+  ConstantInstr* zero = flow_graph->GetConstant(Smi::Handle(Z, Smi::New(0)));
+  *cursor = flow_graph->AppendTo(
+      *cursor,
+      new (Z) CheckArrayBoundInstr(new (Z) Value(adjusted_length),
+                                   new (Z) Value(zero), call->deopt_id()),
+      call->env(), FlowGraph::kEffect);
   // Check 0 <= byte_index < adjusted_length.
-  *cursor = flow_graph->AppendTo(*cursor,
-                                 new(Z) CheckArrayBoundInstr(
-                                     new(Z) Value(adjusted_length),
-                                     new(Z) Value(byte_index),
-                                     call->deopt_id()),
-                                 call->env(),
-                                 FlowGraph::kEffect);
+  *cursor = flow_graph->AppendTo(
+      *cursor,
+      new (Z) CheckArrayBoundInstr(new (Z) Value(adjusted_length),
+                                   new (Z) Value(byte_index), call->deopt_id()),
+      call->env(), FlowGraph::kEffect);
 
   if (RawObject::IsExternalTypedDataClassId(array_cid)) {
-    LoadUntaggedInstr* elements =
-        new(Z) LoadUntaggedInstr(new(Z) Value(*array),
-                                 ExternalTypedData::data_offset());
-    *cursor = flow_graph->AppendTo(*cursor,
-                                   elements,
-                                   NULL,
-                                   FlowGraph::kValue);
+    LoadUntaggedInstr* elements = new (Z) LoadUntaggedInstr(
+        new (Z) Value(*array), ExternalTypedData::data_offset());
+    *cursor = flow_graph->AppendTo(*cursor, elements, NULL, FlowGraph::kValue);
     *array = elements;
   }
 }
@@ -2522,18 +2433,13 @@
   ASSERT(array_cid != kIllegalCid);
   Definition* array = receiver;
   Definition* index = call->ArgumentAt(1);
-  *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(),
-                                   call->GetBlock()->try_index());
+  *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+                                    call->GetBlock()->try_index());
   (*entry)->InheritDeoptTarget(Z, call);
   Instruction* cursor = *entry;
 
-  PrepareInlineByteArrayBaseOp(flow_graph,
-                               call,
-                               array_cid,
-                               view_cid,
-                               &array,
-                               index,
-                               &cursor);
+  PrepareInlineByteArrayBaseOp(flow_graph, call, array_cid, view_cid, &array,
+                               index, &cursor);
 
   intptr_t deopt_id = Thread::kNoDeoptId;
   if ((array_cid == kTypedDataInt32ArrayCid) ||
@@ -2542,22 +2448,16 @@
     deopt_id = (kSmiBits >= 32) ? Thread::kNoDeoptId : call->deopt_id();
   }
 
-  *last = new(Z) LoadIndexedInstr(new(Z) Value(array),
-                                  new(Z) Value(index),
-                                  1,
-                                  view_cid,
-                                  deopt_id,
-                                  call->token_pos());
+  *last = new (Z)
+      LoadIndexedInstr(new (Z) Value(array), new (Z) Value(index), 1, view_cid,
+                       kUnalignedAccess, deopt_id, call->token_pos());
   cursor = flow_graph->AppendTo(
-      cursor,
-      *last,
-      deopt_id != Thread::kNoDeoptId ? call->env() : NULL,
+      cursor, *last, deopt_id != Thread::kNoDeoptId ? call->env() : NULL,
       FlowGraph::kValue);
 
   if (view_cid == kTypedDataFloat32ArrayCid) {
-    *last = new(Z) FloatToDoubleInstr(new(Z) Value(*last), deopt_id);
-    flow_graph->AppendTo(cursor,
-                         *last,
+    *last = new (Z) FloatToDoubleInstr(new (Z) Value(*last), deopt_id);
+    flow_graph->AppendTo(cursor, *last,
                          deopt_id != Thread::kNoDeoptId ? call->env() : NULL,
                          FlowGraph::kValue);
   }
@@ -2576,18 +2476,13 @@
   ASSERT(array_cid != kIllegalCid);
   Definition* array = receiver;
   Definition* index = call->ArgumentAt(1);
-  *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(),
-                                   call->GetBlock()->try_index());
+  *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+                                    call->GetBlock()->try_index());
   (*entry)->InheritDeoptTarget(Z, call);
   Instruction* cursor = *entry;
 
-  PrepareInlineByteArrayBaseOp(flow_graph,
-                               call,
-                               array_cid,
-                               view_cid,
-                               &array,
-                               index,
-                               &cursor);
+  PrepareInlineByteArrayBaseOp(flow_graph, call, array_cid, view_cid, &array,
+                               index, &cursor);
 
   // Extract the instance call so we can use the function_name in the stored
   // value check ICData.
@@ -2609,12 +2504,9 @@
     case kTypedDataInt16ArrayCid:
     case kTypedDataUint16ArrayCid: {
       // Check that value is always smi.
-      value_check = ICData::New(flow_graph->function(),
-                                i_call->function_name(),
+      value_check = ICData::New(flow_graph->function(), i_call->function_name(),
                                 Object::empty_array(),  // Dummy args. descr.
-                                Thread::kNoDeoptId,
-                                1,
-                                false);
+                                Thread::kNoDeoptId, 1, false);
       value_check.AddReceiverCheck(kSmiCid, target);
       break;
     }
@@ -2622,46 +2514,35 @@
     case kTypedDataUint32ArrayCid:
       // On 64-bit platforms assume that stored value is always a smi.
       if (kSmiBits >= 32) {
-        value_check = ICData::New(flow_graph->function(),
-                                  i_call->function_name(),
-                                  Object::empty_array(),  // Dummy args. descr.
-                                  Thread::kNoDeoptId,
-                                  1,
-                                  false);
+        value_check =
+            ICData::New(flow_graph->function(), i_call->function_name(),
+                        Object::empty_array(),  // Dummy args. descr.
+                        Thread::kNoDeoptId, 1, false);
         value_check.AddReceiverCheck(kSmiCid, target);
       }
       break;
     case kTypedDataFloat32ArrayCid:
     case kTypedDataFloat64ArrayCid: {
       // Check that value is always double.
-      value_check = ICData::New(flow_graph->function(),
-                                i_call->function_name(),
+      value_check = ICData::New(flow_graph->function(), i_call->function_name(),
                                 Object::empty_array(),  // Dummy args. descr.
-                                Thread::kNoDeoptId,
-                                1,
-                                false);
+                                Thread::kNoDeoptId, 1, false);
       value_check.AddReceiverCheck(kDoubleCid, target);
       break;
     }
     case kTypedDataInt32x4ArrayCid: {
       // Check that value is always Int32x4.
-      value_check = ICData::New(flow_graph->function(),
-                                i_call->function_name(),
+      value_check = ICData::New(flow_graph->function(), i_call->function_name(),
                                 Object::empty_array(),  // Dummy args. descr.
-                                Thread::kNoDeoptId,
-                                1,
-                                false);
+                                Thread::kNoDeoptId, 1, false);
       value_check.AddReceiverCheck(kInt32x4Cid, target);
       break;
     }
     case kTypedDataFloat32x4ArrayCid: {
       // Check that value is always Float32x4.
-      value_check = ICData::New(flow_graph->function(),
-                                i_call->function_name(),
+      value_check = ICData::New(flow_graph->function(), i_call->function_name(),
                                 Object::empty_array(),  // Dummy args. descr.
-                                Thread::kNoDeoptId,
-                                1,
-                                false);
+                                Thread::kNoDeoptId, 1, false);
       value_check.AddReceiverCheck(kFloat32x4Cid, target);
       break;
     }
@@ -2672,94 +2553,71 @@
 
   Definition* stored_value = call->ArgumentAt(2);
   if (!value_check.IsNull()) {
-    Instruction* check = GetCheckClass(flow_graph,
-                                       stored_value,
-                                       value_check,
-                                       call->deopt_id(),
-                                       call->token_pos());
-    cursor = flow_graph->AppendTo(cursor,
-                                  check,
-                                  call->env(),
-                                  FlowGraph::kEffect);
+    Instruction* check = GetCheckClass(flow_graph, stored_value, value_check,
+                                       call->deopt_id(), call->token_pos());
+    cursor =
+        flow_graph->AppendTo(cursor, check, call->env(), FlowGraph::kEffect);
   }
 
   if (view_cid == kTypedDataFloat32ArrayCid) {
-    stored_value = new(Z) DoubleToFloatInstr(
-        new(Z) Value(stored_value), call->deopt_id());
-    cursor = flow_graph->AppendTo(cursor,
-                                  stored_value,
-                                  NULL,
-                                  FlowGraph::kValue);
+    stored_value = new (Z)
+        DoubleToFloatInstr(new (Z) Value(stored_value), call->deopt_id());
+    cursor =
+        flow_graph->AppendTo(cursor, stored_value, NULL, FlowGraph::kValue);
   } else if (view_cid == kTypedDataInt32ArrayCid) {
-    stored_value = new(Z) UnboxInt32Instr(
-        UnboxInt32Instr::kTruncate,
-        new(Z) Value(stored_value),
-        call->deopt_id());
-    cursor = flow_graph->AppendTo(cursor,
-                                  stored_value,
-                                  call->env(),
+    stored_value =
+        new (Z) UnboxInt32Instr(UnboxInt32Instr::kTruncate,
+                                new (Z) Value(stored_value), call->deopt_id());
+    cursor = flow_graph->AppendTo(cursor, stored_value, call->env(),
                                   FlowGraph::kValue);
   } else if (view_cid == kTypedDataUint32ArrayCid) {
-    stored_value = new(Z) UnboxUint32Instr(
-        new(Z) Value(stored_value),
-        call->deopt_id());
+    stored_value =
+        new (Z) UnboxUint32Instr(new (Z) Value(stored_value), call->deopt_id());
     ASSERT(stored_value->AsUnboxInteger()->is_truncating());
-    cursor = flow_graph->AppendTo(cursor,
-                                  stored_value,
-                                  call->env(),
+    cursor = flow_graph->AppendTo(cursor, stored_value, call->env(),
                                   FlowGraph::kValue);
   }
 
   StoreBarrierType needs_store_barrier = kNoStoreBarrier;
-  *last = new(Z) StoreIndexedInstr(new(Z) Value(array),
-                                   new(Z) Value(index),
-                                   new(Z) Value(stored_value),
-                                   needs_store_barrier,
-                                   1,  // Index scale
-                                   view_cid,
-                                   call->deopt_id(),
-                                   call->token_pos());
+  *last = new (Z) StoreIndexedInstr(
+      new (Z) Value(array), new (Z) Value(index), new (Z) Value(stored_value),
+      needs_store_barrier,
+      1,  // Index scale
+      view_cid, kUnalignedAccess, call->deopt_id(), call->token_pos());
 
-  flow_graph->AppendTo(cursor,
-                       *last,
-                       call->deopt_id() != Thread::kNoDeoptId ?
-                          call->env() : NULL,
-                       FlowGraph::kEffect);
+  flow_graph->AppendTo(
+      cursor, *last,
+      call->deopt_id() != Thread::kNoDeoptId ? call->env() : NULL,
+      FlowGraph::kEffect);
   return true;
 }
 
 
-
 // Returns the LoadIndexedInstr.
-static Definition* PrepareInlineStringIndexOp(
-    FlowGraph* flow_graph,
-    Instruction* call,
-    intptr_t cid,
-    Definition* str,
-    Definition* index,
-    Instruction* cursor) {
+static Definition* PrepareInlineStringIndexOp(FlowGraph* flow_graph,
+                                              Instruction* call,
+                                              intptr_t cid,
+                                              Definition* str,
+                                              Definition* index,
+                                              Instruction* cursor) {
   // Load the length of the string.
   // Treat length loads as mutable (i.e. affected by side effects) to avoid
   // hoisting them since we can't hoist the preceding class-check. This
   // is because of externalization of strings that affects their class-id.
-  LoadFieldInstr* length = new(Z) LoadFieldInstr(
-      new(Z) Value(str),
-      String::length_offset(),
-      Type::ZoneHandle(Z, Type::SmiType()),
-      str->token_pos());
+  LoadFieldInstr* length = new (Z)
+      LoadFieldInstr(new (Z) Value(str), String::length_offset(),
+                     Type::ZoneHandle(Z, Type::SmiType()), str->token_pos());
   length->set_result_cid(kSmiCid);
   length->set_is_immutable(!FLAG_support_externalizable_strings);
   length->set_recognized_kind(MethodRecognizer::kStringBaseLength);
 
   cursor = flow_graph->AppendTo(cursor, length, NULL, FlowGraph::kValue);
   // Bounds check.
-  cursor = flow_graph->AppendTo(cursor,
-                                new(Z) CheckArrayBoundInstr(
-                                    new(Z) Value(length),
-                                    new(Z) Value(index),
-                                    call->deopt_id()),
-                                call->env(),
-                                FlowGraph::kEffect);
+  cursor = flow_graph->AppendTo(
+      cursor,
+      new (Z) CheckArrayBoundInstr(new (Z) Value(length), new (Z) Value(index),
+                                   call->deopt_id()),
+      call->env(), FlowGraph::kEffect);
 
   // For external strings: Load backing store.
   if (cid == kExternalOneByteStringCid) {
@@ -2767,26 +2625,20 @@
                                 ExternalOneByteString::external_data_offset());
     cursor = flow_graph->AppendTo(cursor, str, NULL, FlowGraph::kValue);
     str = new LoadUntaggedInstr(
-        new Value(str),
-        RawExternalOneByteString::ExternalData::data_offset());
+        new Value(str), RawExternalOneByteString::ExternalData::data_offset());
     cursor = flow_graph->AppendTo(cursor, str, NULL, FlowGraph::kValue);
   } else if (cid == kExternalTwoByteStringCid) {
     str = new LoadUntaggedInstr(new Value(str),
                                 ExternalTwoByteString::external_data_offset());
     cursor = flow_graph->AppendTo(cursor, str, NULL, FlowGraph::kValue);
     str = new LoadUntaggedInstr(
-        new Value(str),
-        RawExternalTwoByteString::ExternalData::data_offset());
+        new Value(str), RawExternalTwoByteString::ExternalData::data_offset());
     cursor = flow_graph->AppendTo(cursor, str, NULL, FlowGraph::kValue);
   }
 
-  LoadIndexedInstr* load_indexed = new(Z) LoadIndexedInstr(
-      new(Z) Value(str),
-      new(Z) Value(index),
-      Instance::ElementSizeFor(cid),
-      cid,
-      Thread::kNoDeoptId,
-      call->token_pos());
+  LoadIndexedInstr* load_indexed = new (Z) LoadIndexedInstr(
+      new (Z) Value(str), new (Z) Value(index), Instance::ElementSizeFor(cid),
+      cid, kAlignedAccess, Thread::kNoDeoptId, call->token_pos());
 
   cursor = flow_graph->AppendTo(cursor, load_indexed, NULL, FlowGraph::kValue);
   ASSERT(cursor == load_indexed);
@@ -2794,26 +2646,25 @@
 }
 
 
-static bool InlineStringBaseCharAt(
-    FlowGraph* flow_graph,
-    Instruction* call,
-    intptr_t cid,
-    TargetEntryInstr** entry,
-    Definition** last) {
+static bool InlineStringBaseCharAt(FlowGraph* flow_graph,
+                                   Instruction* call,
+                                   intptr_t cid,
+                                   TargetEntryInstr** entry,
+                                   Definition** last) {
   if ((cid != kOneByteStringCid) && (cid != kExternalOneByteStringCid)) {
     return false;
   }
   Definition* str = call->ArgumentAt(0);
   Definition* index = call->ArgumentAt(1);
 
-  *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(),
-                                   call->GetBlock()->try_index());
+  *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+                                    call->GetBlock()->try_index());
   (*entry)->InheritDeoptTarget(Z, call);
 
   *last = PrepareInlineStringIndexOp(flow_graph, call, cid, str, index, *entry);
 
   OneByteStringFromCharCodeInstr* char_at =
-      new(Z) OneByteStringFromCharCodeInstr(new(Z) Value(*last));
+      new (Z) OneByteStringFromCharCodeInstr(new (Z) Value(*last));
 
   flow_graph->AppendTo(*last, char_at, NULL, FlowGraph::kValue);
   *last = char_at;
@@ -2822,21 +2673,19 @@
 }
 
 
-static bool InlineStringCodeUnitAt(
-    FlowGraph* flow_graph,
-    Instruction* call,
-    intptr_t cid,
-    TargetEntryInstr** entry,
-    Definition** last) {
-  ASSERT((cid == kOneByteStringCid) ||
-         (cid == kTwoByteStringCid) ||
+static bool InlineStringCodeUnitAt(FlowGraph* flow_graph,
+                                   Instruction* call,
+                                   intptr_t cid,
+                                   TargetEntryInstr** entry,
+                                   Definition** last) {
+  ASSERT((cid == kOneByteStringCid) || (cid == kTwoByteStringCid) ||
          (cid == kExternalOneByteStringCid) ||
          (cid == kExternalTwoByteStringCid));
   Definition* str = call->ArgumentAt(0);
   Definition* index = call->ArgumentAt(1);
 
-  *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(),
-                                   call->GetBlock()->try_index());
+  *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+                                    call->GetBlock()->try_index());
   (*entry)->InheritDeoptTarget(Z, call);
 
   *last = PrepareInlineStringIndexOp(flow_graph, call, cid, str, index, *entry);
@@ -2856,23 +2705,16 @@
 
   TargetEntryInstr* entry;
   Definition* last;
-  if (FlowGraphInliner::TryInlineRecognizedMethod(flow_graph,
-                                                  receiver_cid,
-                                                  target,
-                                                  call,
-                                                  call->ArgumentAt(0),
-                                                  call->token_pos(),
-                                                  *call->ic_data(),
-                                                  &entry, &last)) {
+  if (FlowGraphInliner::TryInlineRecognizedMethod(
+          flow_graph, receiver_cid, target, call, call->ArgumentAt(0),
+          call->token_pos(), *call->ic_data(), &entry, &last)) {
     // Insert receiver class check if needed.
     if (MethodRecognizer::PolymorphicTarget(target) ||
         flow_graph->InstanceCallNeedsClassCheck(call, target.kind())) {
       Instruction* check = GetCheckClass(
-          flow_graph,
-          call->ArgumentAt(0),
+          flow_graph, call->ArgumentAt(0),
           ICData::ZoneHandle(Z, call->ic_data()->AsUnaryClassChecks()),
-          call->deopt_id(),
-          call->token_pos());
+          call->deopt_id(), call->token_pos());
       flow_graph->InsertBefore(call, check, call->env(), FlowGraph::kEffect);
     }
 
@@ -2912,14 +2754,9 @@
     StaticCallInstr* call) {
   TargetEntryInstr* entry;
   Definition* last;
-  if (FlowGraphInliner::TryInlineRecognizedMethod(flow_graph,
-                                                  kIllegalCid,
-                                                  call->function(),
-                                                  call,
-                                                  call->ArgumentAt(0),
-                                                  call->token_pos(),
-                                                  *call->ic_data(),
-                                                  &entry, &last)) {
+  if (FlowGraphInliner::TryInlineRecognizedMethod(
+          flow_graph, kIllegalCid, call->function(), call, call->ArgumentAt(0),
+          call->token_pos(), *call->ic_data(), &entry, &last)) {
     // Remove the original push arguments.
     for (intptr_t i = 0; i < call->ArgumentCount(); ++i) {
       PushArgumentInstr* push = call->PushArgumentAt(i);
@@ -2958,8 +2795,8 @@
   if (!ShouldInlineSimd()) {
     return false;
   }
-  *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(),
-                                   call->GetBlock()->try_index());
+  *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+                                    call->GetBlock()->try_index());
   (*entry)->InheritDeoptTarget(Z, call);
   Instruction* cursor = *entry;
   switch (kind) {
@@ -2967,16 +2804,15 @@
     case MethodRecognizer::kFloat32x4ShuffleY:
     case MethodRecognizer::kFloat32x4ShuffleZ:
     case MethodRecognizer::kFloat32x4ShuffleW: {
-      *last = new(Z) Simd32x4ShuffleInstr(kind,
-                                          new(Z) Value(call->ArgumentAt(0)),
-                                          0,  // mask ignored.
-                                          call->deopt_id());
+      *last =
+          new (Z) Simd32x4ShuffleInstr(kind, new (Z) Value(call->ArgumentAt(0)),
+                                       0,  // mask ignored.
+                                       call->deopt_id());
       break;
     }
     case MethodRecognizer::kFloat32x4GetSignMask: {
-      *last = new(Z) Simd32x4GetSignMaskInstr(kind,
-                                              new(Z) Value(call->ArgumentAt(0)),
-                                              call->deopt_id());
+      *last = new (Z) Simd32x4GetSignMaskInstr(
+          kind, new (Z) Value(call->ArgumentAt(0)), call->deopt_id());
       break;
     }
     case MethodRecognizer::kFloat32x4Equal:
@@ -2987,20 +2823,16 @@
     case MethodRecognizer::kFloat32x4NotEqual: {
       Definition* left = call->ArgumentAt(0);
       Definition* right = call->ArgumentAt(1);
-      *last = new(Z) Float32x4ComparisonInstr(kind,
-                                              new(Z) Value(left),
-                                              new(Z) Value(right),
-                                              call->deopt_id());
+      *last = new (Z) Float32x4ComparisonInstr(
+          kind, new (Z) Value(left), new (Z) Value(right), call->deopt_id());
       break;
     }
     case MethodRecognizer::kFloat32x4Min:
     case MethodRecognizer::kFloat32x4Max: {
       Definition* left = call->ArgumentAt(0);
       Definition* right = call->ArgumentAt(1);
-      *last = new(Z) Float32x4MinMaxInstr(kind,
-                                          new(Z) Value(left),
-                                          new(Z) Value(right),
-                                          call->deopt_id());
+      *last = new (Z) Float32x4MinMaxInstr(
+          kind, new (Z) Value(left), new (Z) Value(right), call->deopt_id());
       break;
     }
     case MethodRecognizer::kFloat32x4Scale: {
@@ -3009,19 +2841,16 @@
       // Left and right values are swapped when handed to the instruction,
       // this is done so that the double value is loaded into the output
       // register and can be destroyed.
-      *last = new(Z) Float32x4ScaleInstr(kind,
-                                         new(Z) Value(right),
-                                         new(Z) Value(left),
-                                         call->deopt_id());
+      *last = new (Z) Float32x4ScaleInstr(
+          kind, new (Z) Value(right), new (Z) Value(left), call->deopt_id());
       break;
     }
     case MethodRecognizer::kFloat32x4Sqrt:
     case MethodRecognizer::kFloat32x4ReciprocalSqrt:
     case MethodRecognizer::kFloat32x4Reciprocal: {
       Definition* left = call->ArgumentAt(0);
-      *last = new(Z) Float32x4SqrtInstr(kind,
-                                        new(Z) Value(left),
-                                        call->deopt_id());
+      *last = new (Z)
+          Float32x4SqrtInstr(kind, new (Z) Value(left), call->deopt_id());
       break;
     }
     case MethodRecognizer::kFloat32x4WithX:
@@ -3030,39 +2859,34 @@
     case MethodRecognizer::kFloat32x4WithW: {
       Definition* left = call->ArgumentAt(0);
       Definition* right = call->ArgumentAt(1);
-      *last = new(Z) Float32x4WithInstr(kind,
-                                        new(Z) Value(left),
-                                        new(Z) Value(right),
-                                        call->deopt_id());
+      *last = new (Z) Float32x4WithInstr(
+          kind, new (Z) Value(left), new (Z) Value(right), call->deopt_id());
       break;
     }
     case MethodRecognizer::kFloat32x4Absolute:
     case MethodRecognizer::kFloat32x4Negate: {
       Definition* left = call->ArgumentAt(0);
-      *last = new(Z) Float32x4ZeroArgInstr(kind,
-                                           new(Z) Value(left),
-                                           call->deopt_id());
+      *last = new (Z)
+          Float32x4ZeroArgInstr(kind, new (Z) Value(left), call->deopt_id());
       break;
     }
     case MethodRecognizer::kFloat32x4Clamp: {
       Definition* left = call->ArgumentAt(0);
       Definition* lower = call->ArgumentAt(1);
       Definition* upper = call->ArgumentAt(2);
-      *last = new(Z) Float32x4ClampInstr(
-          new(Z) Value(left),
-          new(Z) Value(lower),
-          new(Z) Value(upper),
-          call->deopt_id());
+      *last =
+          new (Z) Float32x4ClampInstr(new (Z) Value(left), new (Z) Value(lower),
+                                      new (Z) Value(upper), call->deopt_id());
       break;
     }
     default:
       UNREACHABLE();
       return false;
   }
-  flow_graph->AppendTo(cursor, *last,
-                       call->deopt_id() != Thread::kNoDeoptId ?
-                       call->env() : NULL,
-                       FlowGraph::kValue);
+  flow_graph->AppendTo(
+      cursor, *last,
+      call->deopt_id() != Thread::kNoDeoptId ? call->env() : NULL,
+      FlowGraph::kValue);
   return true;
 }
 
@@ -3089,8 +2913,8 @@
   if (!ShouldInlineSimd()) {
     return false;
   }
-  *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(),
-                                   call->GetBlock()->try_index());
+  *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+                                    call->GetBlock()->try_index());
   (*entry)->InheritDeoptTarget(Z, call);
   Instruction* cursor = *entry;
   Definition* mask_definition = call->ArgumentAt(1);
@@ -3098,15 +2922,12 @@
   if (!CheckMask(mask_definition, &mask)) {
     return false;
   }
-  *last = new(Z) Simd32x4ShuffleInstr(
-      kind,
-      new(Z) Value(call->ArgumentAt(0)),
-      mask,
-      call->deopt_id());
-  flow_graph->AppendTo(cursor, *last,
-                       call->deopt_id() != Thread::kNoDeoptId ?
-                       call->env() : NULL,
-                       FlowGraph::kValue);
+  *last = new (Z) Simd32x4ShuffleInstr(kind, new (Z) Value(call->ArgumentAt(0)),
+                                       mask, call->deopt_id());
+  flow_graph->AppendTo(
+      cursor, *last,
+      call->deopt_id() != Thread::kNoDeoptId ? call->env() : NULL,
+      FlowGraph::kValue);
   return true;
 }
 
@@ -3119,8 +2940,8 @@
   if (!ShouldInlineSimd()) {
     return false;
   }
-  *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(),
-                                   call->GetBlock()->try_index());
+  *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+                                    call->GetBlock()->try_index());
   (*entry)->InheritDeoptTarget(Z, call);
   Instruction* cursor = *entry;
   Definition* mask_definition = call->ArgumentAt(2);
@@ -3128,21 +2949,17 @@
   if (!CheckMask(mask_definition, &mask)) {
     return false;
   }
-  *last = new(Z) Simd32x4ShuffleMixInstr(
-      kind,
-      new(Z) Value(call->ArgumentAt(0)),
-      new(Z) Value(call->ArgumentAt(1)),
-      mask,
-      call->deopt_id());
-  flow_graph->AppendTo(cursor, *last,
-                       call->deopt_id() != Thread::kNoDeoptId ?
-                       call->env() : NULL,
-                       FlowGraph::kValue);
+  *last = new (Z) Simd32x4ShuffleMixInstr(
+      kind, new (Z) Value(call->ArgumentAt(0)),
+      new (Z) Value(call->ArgumentAt(1)), mask, call->deopt_id());
+  flow_graph->AppendTo(
+      cursor, *last,
+      call->deopt_id() != Thread::kNoDeoptId ? call->env() : NULL,
+      FlowGraph::kValue);
   return true;
 }
 
 
-
 static bool InlineInt32x4Method(FlowGraph* flow_graph,
                                 Instruction* call,
                                 MethodRecognizer::Kind kind,
@@ -3151,8 +2968,8 @@
   if (!ShouldInlineSimd()) {
     return false;
   }
-  *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(),
-                                   call->GetBlock()->try_index());
+  *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+                                    call->GetBlock()->try_index());
   (*entry)->InheritDeoptTarget(Z, call);
   Instruction* cursor = *entry;
   switch (kind) {
@@ -3160,48 +2977,40 @@
     case MethodRecognizer::kInt32x4GetFlagY:
     case MethodRecognizer::kInt32x4GetFlagZ:
     case MethodRecognizer::kInt32x4GetFlagW: {
-      *last = new(Z) Int32x4GetFlagInstr(
-          kind,
-          new(Z) Value(call->ArgumentAt(0)),
-          call->deopt_id());
+      *last = new (Z) Int32x4GetFlagInstr(
+          kind, new (Z) Value(call->ArgumentAt(0)), call->deopt_id());
       break;
     }
     case MethodRecognizer::kInt32x4GetSignMask: {
-      *last = new(Z) Simd32x4GetSignMaskInstr(
-          kind,
-          new(Z) Value(call->ArgumentAt(0)),
-          call->deopt_id());
+      *last = new (Z) Simd32x4GetSignMaskInstr(
+          kind, new (Z) Value(call->ArgumentAt(0)), call->deopt_id());
       break;
     }
     case MethodRecognizer::kInt32x4Select: {
       Definition* mask = call->ArgumentAt(0);
       Definition* trueValue = call->ArgumentAt(1);
       Definition* falseValue = call->ArgumentAt(2);
-      *last = new(Z) Int32x4SelectInstr(
-          new(Z) Value(mask),
-          new(Z) Value(trueValue),
-          new(Z) Value(falseValue),
-          call->deopt_id());
+      *last = new (Z)
+          Int32x4SelectInstr(new (Z) Value(mask), new (Z) Value(trueValue),
+                             new (Z) Value(falseValue), call->deopt_id());
       break;
     }
     case MethodRecognizer::kInt32x4WithFlagX:
     case MethodRecognizer::kInt32x4WithFlagY:
     case MethodRecognizer::kInt32x4WithFlagZ:
     case MethodRecognizer::kInt32x4WithFlagW: {
-      *last = new(Z) Int32x4SetFlagInstr(
-          kind,
-          new(Z) Value(call->ArgumentAt(0)),
-          new(Z) Value(call->ArgumentAt(1)),
-          call->deopt_id());
+      *last = new (Z) Int32x4SetFlagInstr(
+          kind, new (Z) Value(call->ArgumentAt(0)),
+          new (Z) Value(call->ArgumentAt(1)), call->deopt_id());
       break;
     }
     default:
       return false;
   }
-  flow_graph->AppendTo(cursor, *last,
-                       call->deopt_id() != Thread::kNoDeoptId ?
-                       call->env() : NULL,
-                       FlowGraph::kValue);
+  flow_graph->AppendTo(
+      cursor, *last,
+      call->deopt_id() != Thread::kNoDeoptId ? call->env() : NULL,
+      FlowGraph::kValue);
   return true;
 }
 
@@ -3214,26 +3023,25 @@
   if (!ShouldInlineSimd()) {
     return false;
   }
-  *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(),
-                                   call->GetBlock()->try_index());
+  *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+                                    call->GetBlock()->try_index());
   (*entry)->InheritDeoptTarget(Z, call);
   Instruction* cursor = *entry;
   switch (kind) {
     case MethodRecognizer::kFloat64x2GetX:
     case MethodRecognizer::kFloat64x2GetY: {
-      *last = new(Z) Simd64x2ShuffleInstr(
-          kind,
-          new(Z) Value(call->ArgumentAt(0)),
-          0,  // mask is ignored.
-          call->deopt_id());
+      *last =
+          new (Z) Simd64x2ShuffleInstr(kind, new (Z) Value(call->ArgumentAt(0)),
+                                       0,  // mask is ignored.
+                                       call->deopt_id());
       break;
     }
     case MethodRecognizer::kFloat64x2Negate:
     case MethodRecognizer::kFloat64x2Abs:
     case MethodRecognizer::kFloat64x2Sqrt:
     case MethodRecognizer::kFloat64x2GetSignMask: {
-      *last = new(Z) Float64x2ZeroArgInstr(
-          kind, new(Z) Value(call->ArgumentAt(0)), call->deopt_id());
+      *last = new (Z) Float64x2ZeroArgInstr(
+          kind, new (Z) Value(call->ArgumentAt(0)), call->deopt_id());
       break;
     }
     case MethodRecognizer::kFloat64x2Scale:
@@ -3243,20 +3051,18 @@
     case MethodRecognizer::kFloat64x2Max: {
       Definition* left = call->ArgumentAt(0);
       Definition* right = call->ArgumentAt(1);
-      *last = new(Z) Float64x2OneArgInstr(kind,
-                                          new(Z) Value(left),
-                                          new(Z) Value(right),
-                                          call->deopt_id());
+      *last = new (Z) Float64x2OneArgInstr(
+          kind, new (Z) Value(left), new (Z) Value(right), call->deopt_id());
       break;
     }
     default:
       UNREACHABLE();
       return false;
   }
-  flow_graph->AppendTo(cursor, *last,
-                       call->deopt_id() != Thread::kNoDeoptId ?
-                       call->env() : NULL,
-                       FlowGraph::kValue);
+  flow_graph->AppendTo(
+      cursor, *last,
+      call->deopt_id() != Thread::kNoDeoptId ? call->env() : NULL,
+      FlowGraph::kValue);
   return true;
 }
 
@@ -3269,81 +3075,75 @@
   if (!ShouldInlineSimd()) {
     return false;
   }
-  *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(),
-                                   call->GetBlock()->try_index());
+  *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+                                    call->GetBlock()->try_index());
   (*entry)->InheritDeoptTarget(Z, call);
   Instruction* cursor = *entry;
   switch (kind) {
     case MethodRecognizer::kFloat32x4Zero:
-      *last = new(Z) Float32x4ZeroInstr();
+      *last = new (Z) Float32x4ZeroInstr();
       break;
     case MethodRecognizer::kFloat32x4Splat:
-      *last = new(Z) Float32x4SplatInstr(new(Z) Value(call->ArgumentAt(1)),
-                                         call->deopt_id());
+      *last = new (Z) Float32x4SplatInstr(new (Z) Value(call->ArgumentAt(1)),
+                                          call->deopt_id());
       break;
     case MethodRecognizer::kFloat32x4Constructor:
-      *last = new(Z) Float32x4ConstructorInstr(
-          new(Z) Value(call->ArgumentAt(1)),
-          new(Z) Value(call->ArgumentAt(2)),
-          new(Z) Value(call->ArgumentAt(3)),
-          new(Z) Value(call->ArgumentAt(4)),
-          call->deopt_id());
+      *last = new (Z) Float32x4ConstructorInstr(
+          new (Z) Value(call->ArgumentAt(1)),
+          new (Z) Value(call->ArgumentAt(2)),
+          new (Z) Value(call->ArgumentAt(3)),
+          new (Z) Value(call->ArgumentAt(4)), call->deopt_id());
       break;
     case MethodRecognizer::kFloat32x4FromInt32x4Bits:
-      *last = new(Z) Int32x4ToFloat32x4Instr(new(Z) Value(call->ArgumentAt(1)),
-                                             call->deopt_id());
+      *last = new (Z) Int32x4ToFloat32x4Instr(
+          new (Z) Value(call->ArgumentAt(1)), call->deopt_id());
       break;
-    case  MethodRecognizer::kFloat32x4FromFloat64x2:
-      *last = new(Z) Float64x2ToFloat32x4Instr(
-          new(Z) Value(call->ArgumentAt(1)),
-          call->deopt_id());
+    case MethodRecognizer::kFloat32x4FromFloat64x2:
+      *last = new (Z) Float64x2ToFloat32x4Instr(
+          new (Z) Value(call->ArgumentAt(1)), call->deopt_id());
       break;
     case MethodRecognizer::kFloat64x2Zero:
-      *last = new(Z) Float64x2ZeroInstr();
+      *last = new (Z) Float64x2ZeroInstr();
       break;
     case MethodRecognizer::kFloat64x2Splat:
-      *last = new(Z) Float64x2SplatInstr(new(Z) Value(call->ArgumentAt(1)),
-                                         call->deopt_id());
+      *last = new (Z) Float64x2SplatInstr(new (Z) Value(call->ArgumentAt(1)),
+                                          call->deopt_id());
       break;
     case MethodRecognizer::kFloat64x2Constructor:
-      *last = new(Z) Float64x2ConstructorInstr(
-          new(Z) Value(call->ArgumentAt(1)),
-          new(Z) Value(call->ArgumentAt(2)),
-          call->deopt_id());
+      *last = new (Z) Float64x2ConstructorInstr(
+          new (Z) Value(call->ArgumentAt(1)),
+          new (Z) Value(call->ArgumentAt(2)), call->deopt_id());
       break;
     case MethodRecognizer::kFloat64x2FromFloat32x4:
-      *last = new(Z) Float32x4ToFloat64x2Instr(
-          new(Z) Value(call->ArgumentAt(1)),
-          call->deopt_id());
+      *last = new (Z) Float32x4ToFloat64x2Instr(
+          new (Z) Value(call->ArgumentAt(1)), call->deopt_id());
       break;
     case MethodRecognizer::kInt32x4BoolConstructor:
-      *last = new(Z) Int32x4BoolConstructorInstr(
-          new(Z) Value(call->ArgumentAt(1)),
-          new(Z) Value(call->ArgumentAt(2)),
-          new(Z) Value(call->ArgumentAt(3)),
-          new(Z) Value(call->ArgumentAt(4)),
-          call->deopt_id());
+      *last = new (Z) Int32x4BoolConstructorInstr(
+          new (Z) Value(call->ArgumentAt(1)),
+          new (Z) Value(call->ArgumentAt(2)),
+          new (Z) Value(call->ArgumentAt(3)),
+          new (Z) Value(call->ArgumentAt(4)), call->deopt_id());
       break;
     case MethodRecognizer::kInt32x4Constructor:
-      *last = new(Z) Int32x4ConstructorInstr(
-          new(Z) Value(call->ArgumentAt(1)),
-          new(Z) Value(call->ArgumentAt(2)),
-          new(Z) Value(call->ArgumentAt(3)),
-          new(Z) Value(call->ArgumentAt(4)),
-          call->deopt_id());
+      *last = new (Z) Int32x4ConstructorInstr(
+          new (Z) Value(call->ArgumentAt(1)),
+          new (Z) Value(call->ArgumentAt(2)),
+          new (Z) Value(call->ArgumentAt(3)),
+          new (Z) Value(call->ArgumentAt(4)), call->deopt_id());
       break;
     case MethodRecognizer::kInt32x4FromFloat32x4Bits:
-      *last = new(Z) Float32x4ToInt32x4Instr(new(Z) Value(call->ArgumentAt(1)),
-                                             call->deopt_id());
+      *last = new (Z) Float32x4ToInt32x4Instr(
+          new (Z) Value(call->ArgumentAt(1)), call->deopt_id());
       break;
     default:
       UNREACHABLE();
       return false;
   }
-  flow_graph->AppendTo(cursor, *last,
-                       call->deopt_id() != Thread::kNoDeoptId ?
-                       call->env() : NULL,
-                       FlowGraph::kValue);
+  flow_graph->AppendTo(
+      cursor, *last,
+      call->deopt_id() != Thread::kNoDeoptId ? call->env() : NULL,
+      FlowGraph::kValue);
   return true;
 }
 
@@ -3356,35 +3156,33 @@
   if (!CanUnboxDouble()) {
     return false;
   }
-  *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(),
-                                   call->GetBlock()->try_index());
+  *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+                                    call->GetBlock()->try_index());
   (*entry)->InheritDeoptTarget(Z, call);
   Instruction* cursor = *entry;
 
   switch (kind) {
     case MethodRecognizer::kMathSqrt: {
-      *last = new(Z) MathUnaryInstr(MathUnaryInstr::kSqrt,
-                                    new(Z) Value(call->ArgumentAt(0)),
-                                    call->deopt_id());
+      *last = new (Z)
+          MathUnaryInstr(MathUnaryInstr::kSqrt,
+                         new (Z) Value(call->ArgumentAt(0)), call->deopt_id());
       break;
     }
     default: {
       ZoneGrowableArray<Value*>* args =
-          new(Z) ZoneGrowableArray<Value*>(call->ArgumentCount());
+          new (Z) ZoneGrowableArray<Value*>(call->ArgumentCount());
       for (intptr_t i = 0; i < call->ArgumentCount(); i++) {
-        args->Add(new(Z) Value(call->ArgumentAt(i)));
+        args->Add(new (Z) Value(call->ArgumentAt(i)));
       }
-      *last = new(Z) InvokeMathCFunctionInstr(args,
-                                              call->deopt_id(),
-                                              kind,
-                                              call->token_pos());
+      *last = new (Z) InvokeMathCFunctionInstr(args, call->deopt_id(), kind,
+                                               call->token_pos());
       break;
     }
   }
-  flow_graph->AppendTo(cursor, *last,
-                       call->deopt_id() != Thread::kNoDeoptId ?
-                       call->env() : NULL,
-                       FlowGraph::kValue);
+  flow_graph->AppendTo(
+      cursor, *last,
+      call->deopt_id() != Thread::kNoDeoptId ? call->env() : NULL,
+      FlowGraph::kValue);
   return true;
 }
 
@@ -3494,132 +3292,113 @@
                               token_pos, value_check, entry, last);
     case MethodRecognizer::kByteArrayBaseGetInt8:
       return InlineByteArrayBaseLoad(flow_graph, call, receiver, receiver_cid,
-                                     kTypedDataInt8ArrayCid,
-                                     entry, last);
+                                     kTypedDataInt8ArrayCid, entry, last);
     case MethodRecognizer::kByteArrayBaseGetUint8:
       return InlineByteArrayBaseLoad(flow_graph, call, receiver, receiver_cid,
-                                     kTypedDataUint8ArrayCid,
-                                     entry, last);
+                                     kTypedDataUint8ArrayCid, entry, last);
     case MethodRecognizer::kByteArrayBaseGetInt16:
       return InlineByteArrayBaseLoad(flow_graph, call, receiver, receiver_cid,
-                                     kTypedDataInt16ArrayCid,
-                                     entry, last);
+                                     kTypedDataInt16ArrayCid, entry, last);
     case MethodRecognizer::kByteArrayBaseGetUint16:
       return InlineByteArrayBaseLoad(flow_graph, call, receiver, receiver_cid,
-                                     kTypedDataUint16ArrayCid,
-                                     entry, last);
+                                     kTypedDataUint16ArrayCid, entry, last);
     case MethodRecognizer::kByteArrayBaseGetInt32:
       if (!CanUnboxInt32()) {
         return false;
       }
       return InlineByteArrayBaseLoad(flow_graph, call, receiver, receiver_cid,
-                                     kTypedDataInt32ArrayCid,
-                                     entry, last);
+                                     kTypedDataInt32ArrayCid, entry, last);
     case MethodRecognizer::kByteArrayBaseGetUint32:
       if (!CanUnboxInt32()) {
         return false;
       }
       return InlineByteArrayBaseLoad(flow_graph, call, receiver, receiver_cid,
-                                     kTypedDataUint32ArrayCid,
-                                     entry, last);
+                                     kTypedDataUint32ArrayCid, entry, last);
     case MethodRecognizer::kByteArrayBaseGetFloat32:
       if (!CanUnboxDouble()) {
         return false;
       }
       return InlineByteArrayBaseLoad(flow_graph, call, receiver, receiver_cid,
-                                     kTypedDataFloat32ArrayCid,
-                                     entry, last);
+                                     kTypedDataFloat32ArrayCid, entry, last);
     case MethodRecognizer::kByteArrayBaseGetFloat64:
       if (!CanUnboxDouble()) {
         return false;
       }
       return InlineByteArrayBaseLoad(flow_graph, call, receiver, receiver_cid,
-                                     kTypedDataFloat64ArrayCid,
-                                     entry, last);
+                                     kTypedDataFloat64ArrayCid, entry, last);
     case MethodRecognizer::kByteArrayBaseGetFloat32x4:
       if (!ShouldInlineSimd()) {
         return false;
       }
       return InlineByteArrayBaseLoad(flow_graph, call, receiver, receiver_cid,
-                                     kTypedDataFloat32x4ArrayCid,
-                                     entry, last);
+                                     kTypedDataFloat32x4ArrayCid, entry, last);
     case MethodRecognizer::kByteArrayBaseGetInt32x4:
       if (!ShouldInlineSimd()) {
         return false;
       }
       return InlineByteArrayBaseLoad(flow_graph, call, receiver, receiver_cid,
-                                     kTypedDataInt32x4ArrayCid,
-                                     entry, last);
+                                     kTypedDataInt32x4ArrayCid, entry, last);
     case MethodRecognizer::kByteArrayBaseSetInt8:
       return InlineByteArrayBaseStore(flow_graph, target, call, receiver,
                                       receiver_cid, kTypedDataInt8ArrayCid,
                                       entry, last);
     case MethodRecognizer::kByteArrayBaseSetUint8:
       return InlineByteArrayBaseStore(flow_graph, target, call, receiver,
-                                      receiver_cid,
-                                      kTypedDataUint8ArrayCid,
+                                      receiver_cid, kTypedDataUint8ArrayCid,
                                       entry, last);
     case MethodRecognizer::kByteArrayBaseSetInt16:
       return InlineByteArrayBaseStore(flow_graph, target, call, receiver,
-                                      receiver_cid,
-                                      kTypedDataInt16ArrayCid,
+                                      receiver_cid, kTypedDataInt16ArrayCid,
                                       entry, last);
     case MethodRecognizer::kByteArrayBaseSetUint16:
       return InlineByteArrayBaseStore(flow_graph, target, call, receiver,
-                                      receiver_cid,
-                                      kTypedDataUint16ArrayCid,
+                                      receiver_cid, kTypedDataUint16ArrayCid,
                                       entry, last);
     case MethodRecognizer::kByteArrayBaseSetInt32:
       return InlineByteArrayBaseStore(flow_graph, target, call, receiver,
-                                      receiver_cid,
-                                      kTypedDataInt32ArrayCid,
+                                      receiver_cid, kTypedDataInt32ArrayCid,
                                       entry, last);
     case MethodRecognizer::kByteArrayBaseSetUint32:
       return InlineByteArrayBaseStore(flow_graph, target, call, receiver,
-                                      receiver_cid,
-                                      kTypedDataUint32ArrayCid,
+                                      receiver_cid, kTypedDataUint32ArrayCid,
                                       entry, last);
     case MethodRecognizer::kByteArrayBaseSetFloat32:
       if (!CanUnboxDouble()) {
         return false;
       }
       return InlineByteArrayBaseStore(flow_graph, target, call, receiver,
-                                      receiver_cid,
-                                      kTypedDataFloat32ArrayCid,
+                                      receiver_cid, kTypedDataFloat32ArrayCid,
                                       entry, last);
     case MethodRecognizer::kByteArrayBaseSetFloat64:
       if (!CanUnboxDouble()) {
         return false;
       }
       return InlineByteArrayBaseStore(flow_graph, target, call, receiver,
-                                      receiver_cid,
-                                      kTypedDataFloat64ArrayCid,
+                                      receiver_cid, kTypedDataFloat64ArrayCid,
                                       entry, last);
     case MethodRecognizer::kByteArrayBaseSetFloat32x4:
       if (!ShouldInlineSimd()) {
         return false;
       }
       return InlineByteArrayBaseStore(flow_graph, target, call, receiver,
-                                      receiver_cid,
-                                      kTypedDataFloat32x4ArrayCid,
+                                      receiver_cid, kTypedDataFloat32x4ArrayCid,
                                       entry, last);
     case MethodRecognizer::kByteArrayBaseSetInt32x4:
       if (!ShouldInlineSimd()) {
         return false;
       }
       return InlineByteArrayBaseStore(flow_graph, target, call, receiver,
-                                      receiver_cid,
-                                      kTypedDataInt32x4ArrayCid,
+                                      receiver_cid, kTypedDataInt32x4ArrayCid,
                                       entry, last);
     case MethodRecognizer::kOneByteStringCodeUnitAt:
     case MethodRecognizer::kTwoByteStringCodeUnitAt:
     case MethodRecognizer::kExternalOneByteStringCodeUnitAt:
     case MethodRecognizer::kExternalTwoByteStringCodeUnitAt:
-      return InlineStringCodeUnitAt(
-          flow_graph, call, receiver_cid, entry, last);
+      return InlineStringCodeUnitAt(flow_graph, call, receiver_cid, entry,
+                                    last);
     case MethodRecognizer::kStringBaseCharAt:
-      return InlineStringBaseCharAt(
-          flow_graph, call, receiver_cid, entry, last);
+      return InlineStringBaseCharAt(flow_graph, call, receiver_cid, entry,
+                                    last);
     case MethodRecognizer::kDoubleAdd:
       return InlineDoubleOp(flow_graph, Token::kADD, call, entry, last);
     case MethodRecognizer::kDoubleSub:
@@ -3628,18 +3407,21 @@
       return InlineDoubleOp(flow_graph, Token::kMUL, call, entry, last);
     case MethodRecognizer::kDoubleDiv:
       return InlineDoubleOp(flow_graph, Token::kDIV, call, entry, last);
+    case MethodRecognizer::kDouble_getIsNaN:
+    case MethodRecognizer::kDouble_getIsInfinite:
+      return InlineDoubleTestOp(flow_graph, call, kind, entry, last);
     case MethodRecognizer::kGrowableArraySetData:
       ASSERT(receiver_cid == kGrowableObjectArrayCid);
       ASSERT(ic_data.NumberOfChecks() == 1);
-      return InlineGrowableArraySetter(
-          flow_graph, GrowableObjectArray::data_offset(), kEmitStoreBarrier,
-          call, entry, last);
+      return InlineGrowableArraySetter(flow_graph,
+                                       GrowableObjectArray::data_offset(),
+                                       kEmitStoreBarrier, call, entry, last);
     case MethodRecognizer::kGrowableArraySetLength:
       ASSERT(receiver_cid == kGrowableObjectArrayCid);
       ASSERT(ic_data.NumberOfChecks() == 1);
-      return InlineGrowableArraySetter(
-          flow_graph, GrowableObjectArray::length_offset(), kNoStoreBarrier,
-          call, entry, last);
+      return InlineGrowableArraySetter(flow_graph,
+                                       GrowableObjectArray::length_offset(),
+                                       kNoStoreBarrier, call, entry, last);
     case MethodRecognizer::kSmi_bitAndFromSmi:
       return InlineSmiBitAndFromSmi(flow_graph, call, entry, last);
 
@@ -3727,8 +3509,8 @@
       return InlineMathCFunction(flow_graph, call, kind, entry, last);
 
     case MethodRecognizer::kObjectConstructor: {
-      *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(),
-                                       call->GetBlock()->try_index());
+      *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+                                        call->GetBlock()->try_index());
       (*entry)->InheritDeoptTarget(Z, call);
       ASSERT(!call->HasUses());
       *last = NULL;  // Empty body.
@@ -3736,51 +3518,76 @@
     }
 
     case MethodRecognizer::kObjectArrayAllocate: {
-      Value* num_elements = new(Z) Value(call->ArgumentAt(1));
+      Value* num_elements = new (Z) Value(call->ArgumentAt(1));
       if (num_elements->BindsToConstant() &&
           num_elements->BoundConstant().IsSmi()) {
-        intptr_t length =
-            Smi::Cast(num_elements->BoundConstant()).Value();
+        intptr_t length = Smi::Cast(num_elements->BoundConstant()).Value();
         if (length >= 0 && length <= Array::kMaxElements) {
-          Value* type = new(Z) Value(call->ArgumentAt(0));
-          *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(),
-                                           call->GetBlock()->try_index());
+          Value* type = new (Z) Value(call->ArgumentAt(0));
+          *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+                                            call->GetBlock()->try_index());
           (*entry)->InheritDeoptTarget(Z, call);
           *last =
-              new(Z) CreateArrayInstr(call->token_pos(), type, num_elements);
-          flow_graph->AppendTo(*entry, *last,
-                               call->deopt_id() != Thread::kNoDeoptId ?
-                               call->env() : NULL,
-                               FlowGraph::kValue);
+              new (Z) CreateArrayInstr(call->token_pos(), type, num_elements);
+          flow_graph->AppendTo(
+              *entry, *last,
+              call->deopt_id() != Thread::kNoDeoptId ? call->env() : NULL,
+              FlowGraph::kValue);
           return true;
         }
       }
       return false;
     }
 
+    case MethodRecognizer::kObjectRuntimeType: {
+      Type& type = Type::ZoneHandle(Z);
+      if (RawObject::IsStringClassId(receiver_cid)) {
+        type = Type::StringType();
+      } else if (receiver_cid == kDoubleCid) {
+        type = Type::Double();
+      } else if (RawObject::IsIntegerClassId(receiver_cid)) {
+        type = Type::IntType();
+      } else if (receiver_cid != kClosureCid) {
+        const Class& cls = Class::Handle(
+            Z, flow_graph->isolate()->class_table()->At(receiver_cid));
+        if (!cls.IsGeneric()) {
+          type = cls.CanonicalType();
+        }
+      }
+
+      if (!type.IsNull()) {
+        *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+                                          call->GetBlock()->try_index());
+        (*entry)->InheritDeoptTarget(Z, call);
+        *last = new (Z) ConstantInstr(type);
+        flow_graph->AppendTo(
+            *entry, *last,
+            call->deopt_id() != Thread::kNoDeoptId ? call->env() : NULL,
+            FlowGraph::kValue);
+        return true;
+      }
+      return false;
+    }
+
     case MethodRecognizer::kOneByteStringSetAt: {
       // This is an internal method, no need to check argument types nor
       // range.
-      *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(),
-                                       call->GetBlock()->try_index());
+      *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+                                        call->GetBlock()->try_index());
       (*entry)->InheritDeoptTarget(Z, call);
       Definition* str = call->ArgumentAt(0);
       Definition* index = call->ArgumentAt(1);
       Definition* value = call->ArgumentAt(2);
-      *last = new(Z) StoreIndexedInstr(
-          new(Z) Value(str),
-          new(Z) Value(index),
-          new(Z) Value(value),
-          kNoStoreBarrier,
-          1,  // Index scale
-          kOneByteStringCid,
-          call->deopt_id(),
-          call->token_pos());
-      flow_graph->AppendTo(*entry,
-                           *last,
-                           call->deopt_id() != Thread::kNoDeoptId ?
-                              call->env() : NULL,
-                           FlowGraph::kEffect);
+      *last =
+          new (Z) StoreIndexedInstr(new (Z) Value(str), new (Z) Value(index),
+                                    new (Z) Value(value), kNoStoreBarrier,
+                                    1,  // Index scale
+                                    kOneByteStringCid, kAlignedAccess,
+                                    call->deopt_id(), call->token_pos());
+      flow_graph->AppendTo(
+          *entry, *last,
+          call->deopt_id() != Thread::kNoDeoptId ? call->env() : NULL,
+          FlowGraph::kEffect);
       return true;
     }
 
@@ -3791,3 +3598,4 @@
 
 
 }  // namespace dart
+#endif  // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/flow_graph_inliner.h b/runtime/vm/flow_graph_inliner.h
index 77a903a..ad1b222 100644
--- a/runtime/vm/flow_graph_inliner.h
+++ b/runtime/vm/flow_graph_inliner.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_FLOW_GRAPH_INLINER_H_
-#define VM_FLOW_GRAPH_INLINER_H_
+#ifndef RUNTIME_VM_FLOW_GRAPH_INLINER_H_
+#define RUNTIME_VM_FLOW_GRAPH_INLINER_H_
 
 #include "vm/allocation.h"
 #include "vm/growable_array.h"
@@ -19,6 +19,7 @@
 class Instruction;
 class StaticCallInstr;
 class TargetEntryInstr;
+class Precompiler;
 
 class FlowGraphInliner : ValueObject {
  public:
@@ -27,7 +28,8 @@
                    GrowableArray<TokenPosition>* inline_id_to_token_pos,
                    GrowableArray<intptr_t>* caller_inline_id,
                    bool use_speculative_inlining,
-                   GrowableArray<intptr_t>* inlining_black_list);
+                   GrowableArray<intptr_t>* inlining_black_list,
+                   Precompiler* precompiler);
 
   // The flow graph is destructively updated upon inlining.
   void Inline();
@@ -77,10 +79,11 @@
   const bool trace_inlining_;
   const bool use_speculative_inlining_;
   GrowableArray<intptr_t>* inlining_black_list_;
+  Precompiler* precompiler_;
 
   DISALLOW_COPY_AND_ASSIGN(FlowGraphInliner);
 };
 
 }  // namespace dart
 
-#endif  // VM_FLOW_GRAPH_INLINER_H_
+#endif  // RUNTIME_VM_FLOW_GRAPH_INLINER_H_
diff --git a/runtime/vm/flow_graph_range_analysis.cc b/runtime/vm/flow_graph_range_analysis.cc
index 1e7afbd..b19b4e6 100644
--- a/runtime/vm/flow_graph_range_analysis.cc
+++ b/runtime/vm/flow_graph_range_analysis.cc
@@ -9,11 +9,15 @@
 
 namespace dart {
 
-DEFINE_FLAG(bool, array_bounds_check_elimination, true,
-    "Eliminate redundant bounds checks.");
+DEFINE_FLAG(bool,
+            array_bounds_check_elimination,
+            true,
+            "Eliminate redundant bounds checks.");
 DEFINE_FLAG(bool, trace_range_analysis, false, "Trace range analysis progress");
-DEFINE_FLAG(bool, trace_integer_ir_selection, false,
-    "Print integer IR selection optimization pass.");
+DEFINE_FLAG(bool,
+            trace_integer_ir_selection,
+            false,
+            "Print integer IR selection optimization pass.");
 DECLARE_FLAG(bool, trace_constant_propagation);
 
 // Quick access to the locally defined isolate() and zone() methods.
@@ -81,7 +85,7 @@
         initial_value_(initial_value),
         increment_(increment),
         limit_(limit),
-        bound_(NULL) { }
+        bound_(NULL) {}
 
   PhiInstr* phi() const { return phi_; }
   Definition* initial_value() const { return initial_value_; }
@@ -108,8 +112,7 @@
 static ConstraintInstr* FindBoundingConstraint(PhiInstr* phi,
                                                Definition* defn) {
   ConstraintInstr* limit = NULL;
-  for (ConstraintInstr* constraint = defn->AsConstraint();
-       constraint != NULL;
+  for (ConstraintInstr* constraint = defn->AsConstraint(); constraint != NULL;
        constraint = constraint->value()->definition()->AsConstraint()) {
     if (constraint->target() == NULL) {
       continue;  // Only interested in non-artifical constraints.
@@ -140,25 +143,22 @@
 
   const intptr_t backedge_idx =
       loop_info->Contains(phi->block()->PredecessorAt(0)->preorder_number())
-          ? 0 : 1;
+          ? 0
+          : 1;
 
-  Definition* initial_value =
-      phi->InputAt(1 - backedge_idx)->definition();
+  Definition* initial_value = phi->InputAt(1 - backedge_idx)->definition();
 
   BinarySmiOpInstr* increment =
-      UnwrapConstraint(phi->InputAt(backedge_idx)->definition())->
-          AsBinarySmiOp();
+      UnwrapConstraint(phi->InputAt(backedge_idx)->definition())
+          ->AsBinarySmiOp();
 
-  if ((increment != NULL) &&
-      (increment->op_kind() == Token::kADD) &&
+  if ((increment != NULL) && (increment->op_kind() == Token::kADD) &&
       (UnwrapConstraint(increment->left()->definition()) == phi) &&
       increment->right()->BindsToConstant() &&
       increment->right()->BoundConstant().IsSmi() &&
       (Smi::Cast(increment->right()->BoundConstant()).Value() == 1)) {
     return new InductionVariableInfo(
-        phi,
-        initial_value,
-        increment,
+        phi, initial_value, increment,
         FindBoundingConstraint(phi, increment->left()->definition()));
   }
 
@@ -170,8 +170,7 @@
   GrowableArray<InductionVariableInfo*> loop_variables;
 
   for (BlockIterator block_it = flow_graph_->reverse_postorder_iterator();
-       !block_it.Done();
-       block_it.Advance()) {
+       !block_it.Done(); block_it.Advance()) {
     BlockEntryInstr* block = block_it.Current();
 
     JoinEntryInstr* join = block->AsJoinEntry();
@@ -185,9 +184,8 @@
         if (info != NULL) {
           if (FLAG_support_il_printer && FLAG_trace_range_analysis) {
             THR_Print("Simple loop variable: %s bound <%s>\n",
-                       current->ToCString(),
-                       info->limit() != NULL ?
-                           info->limit()->ToCString() : "?");
+                      current->ToCString(),
+                      info->limit() != NULL ? info->limit()->ToCString() : "?");
           }
 
           loop_variables.Add(info);
@@ -225,15 +223,15 @@
   }
 
   for (BlockIterator block_it = flow_graph_->reverse_postorder_iterator();
-       !block_it.Done();
-       block_it.Advance()) {
+       !block_it.Done(); block_it.Advance()) {
     BlockEntryInstr* block = block_it.Current();
 
 
     if (block->IsGraphEntry() || block->IsCatchBlockEntry()) {
-      const GrowableArray<Definition*>& initial = block->IsGraphEntry()
-          ? *block->AsGraphEntry()->initial_definitions()
-          : *block->AsCatchBlockEntry()->initial_definitions();
+      const GrowableArray<Definition*>& initial =
+          block->IsGraphEntry()
+              ? *block->AsGraphEntry()->initial_definitions()
+              : *block->AsCatchBlockEntry()->initial_definitions();
       for (intptr_t i = 0; i < initial.length(); ++i) {
         Definition* current = initial[i];
         if (IsIntegerDefinition(current)) {
@@ -252,8 +250,7 @@
       }
     }
 
-    for (ForwardInstructionIterator instr_it(block);
-         !instr_it.Done();
+    for (ForwardInstructionIterator instr_it(block); !instr_it.Done();
          instr_it.Advance()) {
       Instruction* current = instr_it.Current();
       Definition* defn = current->AsDefinition();
@@ -274,62 +271,22 @@
 }
 
 
-// Returns true if use is dominated by the given instruction.
-// Note: uses that occur at instruction itself are not dominated by it.
-static bool IsDominatedUse(Instruction* dom, Value* use) {
-  BlockEntryInstr* dom_block = dom->GetBlock();
-
-  Instruction* instr = use->instruction();
-
-  PhiInstr* phi = instr->AsPhi();
-  if (phi != NULL) {
-    return dom_block->Dominates(phi->block()->PredecessorAt(use->use_index()));
-  }
-
-  BlockEntryInstr* use_block = instr->GetBlock();
-  if (use_block == dom_block) {
-    // Fast path for the case of block entry.
-    if (dom_block == dom) return true;
-
-    for (Instruction* curr = dom->next(); curr != NULL; curr = curr->next()) {
-      if (curr == instr) return true;
-    }
-
-    return false;
-  }
-
-  return dom_block->Dominates(use_block);
-}
-
-
-void RangeAnalysis::RenameDominatedUses(Definition* def,
-                                        Instruction* dom,
-                                        Definition* other) {
-  for (Value::Iterator it(def->input_use_list());
-       !it.Done();
-       it.Advance()) {
-    Value* use = it.Current();
-
-    // Skip dead phis.
-    PhiInstr* phi = use->instruction()->AsPhi();
-    ASSERT((phi == NULL) || phi->is_alive());
-    if (IsDominatedUse(dom, use)) {
-      use->BindTo(other);
-    }
-  }
-}
-
-
 // For a comparison operation return an operation for the equivalent flipped
 // comparison: a (op) b === b (op') a.
 static Token::Kind FlipComparison(Token::Kind op) {
   switch (op) {
-    case Token::kEQ: return Token::kEQ;
-    case Token::kNE: return Token::kNE;
-    case Token::kLT: return Token::kGT;
-    case Token::kGT: return Token::kLT;
-    case Token::kLTE: return Token::kGTE;
-    case Token::kGTE: return Token::kLTE;
+    case Token::kEQ:
+      return Token::kEQ;
+    case Token::kNE:
+      return Token::kNE;
+    case Token::kLT:
+      return Token::kGT;
+    case Token::kGT:
+      return Token::kLT;
+    case Token::kLTE:
+      return Token::kGTE;
+    case Token::kGTE:
+      return Token::kLTE;
     default:
       UNREACHABLE();
       return Token::kILLEGAL;
@@ -345,22 +302,22 @@
 Range* RangeAnalysis::ConstraintSmiRange(Token::Kind op, Definition* boundary) {
   switch (op) {
     case Token::kEQ:
-      return new(Z) Range(RangeBoundary::FromDefinition(boundary),
-                          RangeBoundary::FromDefinition(boundary));
+      return new (Z) Range(RangeBoundary::FromDefinition(boundary),
+                           RangeBoundary::FromDefinition(boundary));
     case Token::kNE:
-      return new(Z) Range(Range::Full(RangeBoundary::kRangeBoundarySmi));
+      return new (Z) Range(Range::Full(RangeBoundary::kRangeBoundarySmi));
     case Token::kLT:
-      return new(Z) Range(RangeBoundary::MinSmi(),
-                          RangeBoundary::FromDefinition(boundary, -1));
+      return new (Z) Range(RangeBoundary::MinSmi(),
+                           RangeBoundary::FromDefinition(boundary, -1));
     case Token::kGT:
-      return new(Z) Range(RangeBoundary::FromDefinition(boundary, 1),
-                          RangeBoundary::MaxSmi());
+      return new (Z) Range(RangeBoundary::FromDefinition(boundary, 1),
+                           RangeBoundary::MaxSmi());
     case Token::kLTE:
-      return new(Z) Range(RangeBoundary::MinSmi(),
-                          RangeBoundary::FromDefinition(boundary));
+      return new (Z) Range(RangeBoundary::MinSmi(),
+                           RangeBoundary::FromDefinition(boundary));
     case Token::kGTE:
-      return new(Z) Range(RangeBoundary::FromDefinition(boundary),
-                          RangeBoundary::MaxSmi());
+      return new (Z) Range(RangeBoundary::FromDefinition(boundary),
+                           RangeBoundary::MaxSmi());
     default:
       UNREACHABLE();
       return NULL;
@@ -386,11 +343,10 @@
     constraint = constraint->next()->AsConstraint();
   }
 
-  constraint = new(Z) ConstraintInstr(
-      use->CopyWithType(), constraint_range);
+  constraint = new (Z) ConstraintInstr(use->CopyWithType(), constraint_range);
 
   flow_graph_->InsertAfter(after, constraint, NULL, FlowGraph::kValue);
-  RenameDominatedUses(defn, constraint, constraint);
+  FlowGraph::RenameDominatedUses(defn, constraint, constraint);
   constraints_.Add(constraint);
   return constraint;
 }
@@ -417,21 +373,17 @@
 
     // Constrain definition at the true successor.
     ConstraintInstr* true_constraint =
-        InsertConstraintFor(use,
-                            defn,
-                            ConstraintSmiRange(op_kind, boundary),
+        InsertConstraintFor(use, defn, ConstraintSmiRange(op_kind, boundary),
                             branch->true_successor());
     if (true_constraint != NULL) {
       true_constraint->set_target(branch->true_successor());
     }
 
     // Constrain definition with a negated condition at the false successor.
-    ConstraintInstr* false_constraint =
-        InsertConstraintFor(
-            use,
-            defn,
-            ConstraintSmiRange(Token::NegateComparison(op_kind), boundary),
-            branch->false_successor());
+    ConstraintInstr* false_constraint = InsertConstraintFor(
+        use, defn,
+        ConstraintSmiRange(Token::NegateComparison(op_kind), boundary),
+        branch->false_successor());
     if (false_constraint != NULL) {
       false_constraint->set_target(branch->false_successor());
     }
@@ -444,8 +396,7 @@
 
 
 void RangeAnalysis::InsertConstraintsFor(Definition* defn) {
-  for (Value* use = defn->input_use_list();
-       use != NULL;
+  for (Value* use = defn->input_use_list(); use != NULL;
        use = use->next_use()) {
     if (use->instruction()->IsBranch()) {
       if (ConstrainValueAfterBranch(use, defn)) {
@@ -461,24 +412,21 @@
 }
 
 
-void RangeAnalysis::ConstrainValueAfterCheckArrayBound(
-    Value* use,
-    Definition* defn) {
+void RangeAnalysis::ConstrainValueAfterCheckArrayBound(Value* use,
+                                                       Definition* defn) {
   CheckArrayBoundInstr* check = use->instruction()->AsCheckArrayBound();
   intptr_t use_index = use->use_index();
 
   Range* constraint_range = NULL;
   if (use_index == CheckArrayBoundInstr::kIndexPos) {
     Definition* length = check->length()->definition();
-    constraint_range = new(Z) Range(
-        RangeBoundary::FromConstant(0),
-        RangeBoundary::FromDefinition(length, -1));
+    constraint_range = new (Z) Range(RangeBoundary::FromConstant(0),
+                                     RangeBoundary::FromDefinition(length, -1));
   } else {
     ASSERT(use_index == CheckArrayBoundInstr::kLengthPos);
     Definition* index = check->index()->definition();
-    constraint_range = new(Z) Range(
-        RangeBoundary::FromDefinition(index, 1),
-        RangeBoundary::MaxSmi());
+    constraint_range = new (Z)
+        Range(RangeBoundary::FromDefinition(index, 1), RangeBoundary::MaxSmi());
   }
   InsertConstraintFor(use, defn, constraint_range, check);
 }
@@ -543,17 +491,14 @@
   a = UnwrapConstraint(a);
   b = UnwrapConstraint(b);
   return (a == b) ||
-      (a->AllowsCSE() &&
-       a->Dependencies().IsNone() &&
-       b->AllowsCSE() &&
-       b->Dependencies().IsNone() &&
-       a->Equals(b));
+         (a->AllowsCSE() && a->Dependencies().IsNone() && b->AllowsCSE() &&
+          b->Dependencies().IsNone() && a->Equals(b));
 }
 
 
 static bool DependOnSameSymbol(const RangeBoundary& a, const RangeBoundary& b) {
   return a.IsSymbol() && b.IsSymbol() &&
-      AreEqualDefinitions(a.symbol(), b.symbol());
+         AreEqualDefinitions(a.symbol(), b.symbol());
 }
 
 
@@ -570,8 +515,9 @@
     if (min.LowerBound().Overflowed(size)) {
       return RangeBoundary::MinConstant(size);
     } else if (DependOnSameSymbol(min, new_min)) {
-      return min.offset() <= new_min.offset() ?
-          min : RangeBoundary::MinConstant(size);
+      return min.offset() <= new_min.offset()
+                 ? min
+                 : RangeBoundary::MinConstant(size);
     } else if (min.UpperBound(size) <= new_min.LowerBound(size)) {
       return min;
     }
@@ -580,8 +526,9 @@
   min = Range::ConstantMin(range, size);
   new_min = Range::ConstantMin(new_range, size);
 
-  return (min.ConstantValue() <= new_min.ConstantValue()) ?
-      min : RangeBoundary::MinConstant(size);
+  return (min.ConstantValue() <= new_min.ConstantValue())
+             ? min
+             : RangeBoundary::MinConstant(size);
 }
 
 // Given the current range of a phi and a newly computed range check
@@ -597,8 +544,9 @@
     if (max.UpperBound().Overflowed(size)) {
       return RangeBoundary::MaxConstant(size);
     } else if (DependOnSameSymbol(max, new_max)) {
-      return max.offset() >= new_max.offset() ?
-          max : RangeBoundary::MaxConstant(size);
+      return max.offset() >= new_max.offset()
+                 ? max
+                 : RangeBoundary::MaxConstant(size);
     } else if (max.LowerBound(size) >= new_max.UpperBound(size)) {
       return max;
     }
@@ -607,8 +555,9 @@
   max = Range::ConstantMax(range, size);
   new_max = Range::ConstantMax(new_range, size);
 
-  return (max.ConstantValue() >= new_max.ConstantValue()) ?
-      max : RangeBoundary::MaxConstant(size);
+  return (max.ConstantValue() >= new_max.ConstantValue())
+             ? max
+             : RangeBoundary::MaxConstant(size);
 }
 
 
@@ -650,9 +599,12 @@
 
 char RangeAnalysis::OpPrefix(JoinOperator op) {
   switch (op) {
-    case WIDEN: return 'W';
-    case NARROW: return 'N';
-    case NONE: return 'I';
+    case WIDEN:
+      return 'W';
+    case NARROW:
+      return 'N';
+    case NONE:
+      return 'I';
   }
   UNREACHABLE();
   return ' ';
@@ -695,11 +647,8 @@
     if (!range.Equals(defn->range())) {
 #ifndef PRODUCT
       if (FLAG_support_il_printer && FLAG_trace_range_analysis) {
-        THR_Print("%c [%" Pd "] %s:  %s => %s\n",
-                  OpPrefix(op),
-                  iteration,
-                  defn->ToCString(),
-                  Range::ToCString(defn->range()),
+        THR_Print("%c [%" Pd "] %s:  %s => %s\n", OpPrefix(op), iteration,
+                  defn->ToCString(), Range::ToCString(defn->range()),
                   Range::ToCString(&range));
       }
 #endif  // !PRODUCT
@@ -714,8 +663,7 @@
 
 void RangeAnalysis::CollectDefinitions(BitVector* set) {
   for (BlockIterator block_it = flow_graph_->reverse_postorder_iterator();
-       !block_it.Done();
-       block_it.Advance()) {
+       !block_it.Done(); block_it.Advance()) {
     BlockEntryInstr* block = block_it.Current();
 
     JoinEntryInstr* join = block->AsJoinEntry();
@@ -730,8 +678,7 @@
 
     for (ForwardInstructionIterator it(block); !it.Done(); it.Advance()) {
       Definition* defn = it.Current()->AsDefinition();
-      if ((defn != NULL) &&
-          defn->HasSSATemp() &&
+      if ((defn != NULL) && defn->HasSSATemp() &&
           set->Contains(defn->ssa_temp_index())) {
         definitions_.Add(defn);
       }
@@ -764,8 +711,8 @@
   }
   Zone* zone = flow_graph_->zone();
   // Initialize bitvector for quick filtering of int values.
-  BitVector* set = new(zone) BitVector(zone,
-      flow_graph_->current_ssa_temp_index());
+  BitVector* set =
+      new (zone) BitVector(zone, flow_graph_->current_ssa_temp_index());
   for (intptr_t i = 0; i < values_.length(); i++) {
     set->Add(values_[i]->ssa_temp_index());
   }
@@ -857,9 +804,7 @@
   }
 
   // Clear the list of emitted instructions.
-  void Start() {
-    emitted_.Clear();
-  }
+  void Start() { emitted_.Clear(); }
 
   // Given the floating instruction attempt to schedule it into one of the
   // loop preheaders that dominates given post_dominator instruction.
@@ -868,7 +813,7 @@
   // any loop containing post_dominator).
   // Resulting schedule should be equivalent to one obtained by inserting
   // instructions right before post_dominator and running CSE and LICM passes.
-  template<typename T>
+  template <typename T>
   T* Emit(T* instruction, Instruction* post_dominator) {
     return static_cast<T*>(EmitRecursively(instruction, post_dominator));
   }
@@ -882,10 +827,9 @@
   }
 
  private:
-  typedef DirectChainedHashMap<PointerKeyValueTrait<Instruction> >  Map;
+  typedef DirectChainedHashMap<PointerKeyValueTrait<Instruction> > Map;
 
-  Instruction* EmitRecursively(Instruction* instruction,
-                               Instruction* sink) {
+  Instruction* EmitRecursively(Instruction* instruction, Instruction* sink) {
     // Schedule all unscheduled inputs and unwrap all constrained inputs.
     for (intptr_t i = 0; i < instruction->InputCount(); i++) {
       Definition* defn = instruction->InputAt(i)->definition();
@@ -913,8 +857,7 @@
     // If the instruction is still in the graph (it could have been
     // un-scheduled by a rollback action) and it dominates the sink - use it.
     Instruction* emitted = map_.LookupValue(instruction);
-    if (emitted != NULL &&
-        !emitted->WasEliminated() &&
+    if (emitted != NULL && !emitted->WasEliminated() &&
         sink->IsDominatedBy(emitted)) {
       return emitted;
     }
@@ -955,11 +898,9 @@
 
   void EmitTo(BlockEntryInstr* block, Instruction* instr) {
     GotoInstr* last = block->last_instruction()->AsGoto();
-    flow_graph_->InsertBefore(last,
-                              instr,
-                              last->env(),
-                              instr->IsDefinition() ? FlowGraph::kValue
-                                                    : FlowGraph::kEffect);
+    flow_graph_->InsertBefore(
+        last, instr, last->env(),
+        instr->IsDefinition() ? FlowGraph::kValue : FlowGraph::kEffect);
     instr->CopyDeoptIdFrom(*last);
     instr->env()->set_deopt_id(instr->deopt_id_);
 
@@ -986,11 +927,10 @@
 // operations.
 class BoundsCheckGeneralizer {
  public:
-  BoundsCheckGeneralizer(RangeAnalysis* range_analysis,
-                         FlowGraph* flow_graph)
+  BoundsCheckGeneralizer(RangeAnalysis* range_analysis, FlowGraph* flow_graph)
       : range_analysis_(range_analysis),
         flow_graph_(flow_graph),
-        scheduler_(flow_graph) { }
+        scheduler_(flow_graph) {}
 
   void TryGeneralize(CheckArrayBoundInstr* check,
                      const RangeBoundary& array_length) {
@@ -1026,10 +966,10 @@
     if (!FindNonPositiveSymbols(&non_positive_symbols, upper_bound)) {
 #ifndef PRODUCT
       if (FLAG_support_il_printer && FLAG_trace_range_analysis) {
-        THR_Print("Failed to generalize %s index to %s"
-                  " (can't ensure positivity)\n",
-                  check->ToCString(),
-                  IndexBoundToCString(upper_bound));
+        THR_Print(
+            "Failed to generalize %s index to %s"
+            " (can't ensure positivity)\n",
+            check->ToCString(), IndexBoundToCString(upper_bound));
       }
 #endif  // !PRODUCT
       return;
@@ -1040,32 +980,31 @@
     // symbols are positive.
     GrowableArray<ConstraintInstr*> positive_constraints(
         non_positive_symbols.length());
-    Range* positive_range = new Range(
-        RangeBoundary::FromConstant(0),
-        RangeBoundary::MaxConstant(RangeBoundary::kRangeBoundarySmi));
+    Range* positive_range =
+        new Range(RangeBoundary::FromConstant(0),
+                  RangeBoundary::MaxConstant(RangeBoundary::kRangeBoundarySmi));
     for (intptr_t i = 0; i < non_positive_symbols.length(); i++) {
       Definition* symbol = non_positive_symbols[i];
-      positive_constraints.Add(new ConstraintInstr(
-          new Value(symbol),
-          positive_range));
+      positive_constraints.Add(
+          new ConstraintInstr(new Value(symbol), positive_range));
     }
 
     Definition* lower_bound =
-      ConstructLowerBound(check->index()->definition(), check);
+        ConstructLowerBound(check->index()->definition(), check);
     // No need to simplify lower bound before applying constraints as
     // we are not going to emit it.
     lower_bound = ApplyConstraints(lower_bound, check, &positive_constraints);
     range_analysis_->AssignRangesRecursively(lower_bound);
 
     if (!RangeUtils::IsPositive(lower_bound->range())) {
-      // Can't prove that lower bound is positive even with additional checks
-      // against potentially non-positive symbols. Give up.
+// Can't prove that lower bound is positive even with additional checks
+// against potentially non-positive symbols. Give up.
 #ifndef PRODUCT
       if (FLAG_support_il_printer && FLAG_trace_range_analysis) {
-        THR_Print("Failed to generalize %s index to %s"
-                  " (lower bound is not positive)\n",
-                  check->ToCString(),
-                  IndexBoundToCString(upper_bound));
+        THR_Print(
+            "Failed to generalize %s index to %s"
+            " (lower bound is not positive)\n",
+            check->ToCString(), IndexBoundToCString(upper_bound));
       }
 #endif  // !PRODUCT
       return;
@@ -1073,8 +1012,7 @@
 
 #ifndef PRODUCT
     if (FLAG_support_il_printer && FLAG_trace_range_analysis) {
-      THR_Print("For %s computed index bounds [%s, %s]\n",
-                check->ToCString(),
+      THR_Print("For %s computed index bounds [%s, %s]\n", check->ToCString(),
                 IndexBoundToCString(lower_bound),
                 IndexBoundToCString(upper_bound));
     }
@@ -1088,8 +1026,7 @@
         flow_graph_->GetConstant(Smi::Handle(Smi::New(Smi::kMaxValue)));
     for (intptr_t i = 0; i < non_positive_symbols.length(); i++) {
       CheckArrayBoundInstr* precondition = new CheckArrayBoundInstr(
-          new Value(max_smi),
-          new Value(non_positive_symbols[i]),
+          new Value(max_smi), new Value(non_positive_symbols[i]),
           Thread::kNoDeoptId);
       precondition->mark_generalized();
       precondition = scheduler_.Emit(precondition, check);
@@ -1103,9 +1040,8 @@
     }
 
     CheckArrayBoundInstr* new_check = new CheckArrayBoundInstr(
-          new Value(UnwrapConstraint(check->length()->definition())),
-          new Value(upper_bound),
-          Thread::kNoDeoptId);
+        new Value(UnwrapConstraint(check->length()->definition())),
+        new Value(upper_bound), Thread::kNoDeoptId);
     new_check->mark_generalized();
     if (new_check->IsRedundant(array_length)) {
       if (FLAG_trace_range_analysis) {
@@ -1131,8 +1067,7 @@
   }
 
   static void RemoveGeneralizedCheck(CheckArrayBoundInstr* check) {
-    BinarySmiOpInstr* binary_op =
-        check->index()->definition()->AsBinarySmiOp();
+    BinarySmiOpInstr* binary_op = check->index()->definition()->AsBinarySmiOp();
     if (binary_op != NULL) {
       binary_op->set_can_overflow(false);
     }
@@ -1143,9 +1078,7 @@
   BinarySmiOpInstr* MakeBinaryOp(Token::Kind op_kind,
                                  Definition* left,
                                  Definition* right) {
-    return new BinarySmiOpInstr(op_kind,
-                                new Value(left),
-                                new Value(right),
+    return new BinarySmiOpInstr(op_kind, new Value(left), new Value(right),
                                 Thread::kNoDeoptId);
   }
 
@@ -1167,21 +1100,19 @@
     }
   }
 
-  typedef Definition* (BoundsCheckGeneralizer::*PhiBoundFunc)(
-      PhiInstr*, Instruction*);
+  typedef Definition* (BoundsCheckGeneralizer::*PhiBoundFunc)(PhiInstr*,
+                                                              Instruction*);
 
   // Construct symbolic lower bound for a value at the given point.
   Definition* ConstructLowerBound(Definition* value, Instruction* point) {
     return ConstructBound(&BoundsCheckGeneralizer::InductionVariableLowerBound,
-                          value,
-                          point);
+                          value, point);
   }
 
   // Construct symbolic upper bound for a value at the given point.
   Definition* ConstructUpperBound(Definition* value, Instruction* point) {
     return ConstructBound(&BoundsCheckGeneralizer::InductionVariableUpperBound,
-                          value,
-                          point);
+                          value, point);
   }
 
   // Construct symbolic bound for a value at the given point:
@@ -1212,11 +1143,11 @@
           (bin_op->op_kind() == Token::kSUB)) {
         Definition* new_left =
             ConstructBound(phi_bound_func, bin_op->left()->definition(), point);
-        Definition* new_right = (bin_op->op_kind() != Token::kSUB)
-            ? ConstructBound(phi_bound_func,
-                             bin_op->right()->definition(),
-                             point)
-            : UnwrapConstraint(bin_op->right()->definition());
+        Definition* new_right =
+            (bin_op->op_kind() != Token::kSUB)
+                ? ConstructBound(phi_bound_func, bin_op->right()->definition(),
+                                 point)
+                : UnwrapConstraint(bin_op->right()->definition());
 
         if ((new_left != UnwrapConstraint(bin_op->left()->definition())) ||
             (new_right != UnwrapConstraint(bin_op->right()->definition()))) {
@@ -1228,8 +1159,7 @@
     return value;
   }
 
-  Definition* InductionVariableUpperBound(PhiInstr* phi,
-                                          Instruction* point) {
+  Definition* InductionVariableUpperBound(PhiInstr* phi, Instruction* point) {
     const InductionVariableInfo& info = *phi->induction_variable_info();
     if (info.bound() == phi) {
       if (point->IsDominatedBy(info.limit())) {
@@ -1255,13 +1185,11 @@
         //
         //          y <= y0 + (M - x0)
         //
-        Definition* limit = RangeBoundaryToDefinition(
-            bound_info.limit()->constraint()->max());
-        BinarySmiOpInstr* loop_length =
-            MakeBinaryOp(Token::kSUB,
-                         ConstructUpperBound(limit, point),
-                         ConstructLowerBound(bound_info.initial_value(),
-                                             point));
+        Definition* limit =
+            RangeBoundaryToDefinition(bound_info.limit()->constraint()->max());
+        BinarySmiOpInstr* loop_length = MakeBinaryOp(
+            Token::kSUB, ConstructUpperBound(limit, point),
+            ConstructLowerBound(bound_info.initial_value(), point));
         return MakeBinaryOp(Token::kADD,
                             ConstructUpperBound(info.initial_value(), point),
                             loop_length);
@@ -1271,8 +1199,7 @@
     return phi;
   }
 
-  Definition* InductionVariableLowerBound(PhiInstr* phi,
-                                          Instruction* point) {
+  Definition* InductionVariableLowerBound(PhiInstr* phi, Instruction* point) {
     // Given induction variable
     //
     //          x <- phi(x0, x + 1)
@@ -1396,8 +1323,7 @@
           if (right_changed) binary_op->right()->set_definition(right);
           *defn = binary_op;
         } else {
-          *defn = MakeBinaryOp(binary_op->op_kind(),
-                               UnwrapConstraint(left),
+          *defn = MakeBinaryOp(binary_op->op_kind(), UnwrapConstraint(left),
                                UnwrapConstraint(right));
         }
       }
@@ -1448,7 +1374,7 @@
       }
 
       return FindNonPositiveSymbols(symbols, binary_op->left()->definition()) &&
-        FindNonPositiveSymbols(symbols, binary_op->right()->definition());
+             FindNonPositiveSymbols(symbols, binary_op->right()->definition());
     }
     UNREACHABLE();
     return false;
@@ -1458,8 +1384,7 @@
   // instruction.
   static Definition* FindInnermostConstraint(Definition* defn,
                                              Instruction* post_dominator) {
-    for (Value* use = defn->input_use_list();
-         use != NULL;
+    for (Value* use = defn->input_use_list(); use != NULL;
          use = use->next_use()) {
       ConstraintInstr* constraint = use->instruction()->AsConstraint();
       if ((constraint != NULL) && post_dominator->IsDominatedBy(constraint)) {
@@ -1492,10 +1417,8 @@
     }
 
     for (intptr_t i = 0; i < defn->InputCount(); i++) {
-      defn->InputAt(i)->set_definition(
-          ApplyConstraints(defn->InputAt(i)->definition(),
-                           post_dominator,
-                           constraints));
+      defn->InputAt(i)->set_definition(ApplyConstraints(
+          defn->InputAt(i)->definition(), post_dominator, constraints));
     }
 
     return defn;
@@ -1542,8 +1465,7 @@
     // check earlier, or we're compiling precompiled code (no
     // optimistic hoisting of checks possible)
     const bool try_generalization =
-        function.allows_bounds_check_generalization() &&
-        !FLAG_precompiled_mode;
+        function.allows_bounds_check_generalization() && !FLAG_precompiled_mode;
 
     BoundsCheckGeneralizer generalizer(this, flow_graph_);
 
@@ -1617,17 +1539,14 @@
 static void NarrowBinaryMintOp(BinaryMintOpInstr* mint_op) {
   if (RangeUtils::Fits(mint_op->range(), RangeBoundary::kRangeBoundaryInt32) &&
       RangeUtils::Fits(mint_op->left()->definition()->range(),
-                  RangeBoundary::kRangeBoundaryInt32) &&
+                       RangeBoundary::kRangeBoundaryInt32) &&
       RangeUtils::Fits(mint_op->right()->definition()->range(),
-                  RangeBoundary::kRangeBoundaryInt32) &&
-      BinaryInt32OpInstr::IsSupported(mint_op->op_kind(),
-                                      mint_op->left(),
+                       RangeBoundary::kRangeBoundaryInt32) &&
+      BinaryInt32OpInstr::IsSupported(mint_op->op_kind(), mint_op->left(),
                                       mint_op->right())) {
-    BinaryInt32OpInstr* int32_op =
-        new BinaryInt32OpInstr(mint_op->op_kind(),
-                               mint_op->left()->CopyWithType(),
-                               mint_op->right()->CopyWithType(),
-                               mint_op->DeoptimizationTarget());
+    BinaryInt32OpInstr* int32_op = new BinaryInt32OpInstr(
+        mint_op->op_kind(), mint_op->left()->CopyWithType(),
+        mint_op->right()->CopyWithType(), mint_op->DeoptimizationTarget());
     int32_op->set_range(*mint_op->range());
     int32_op->set_can_overflow(false);
     mint_op->ReplaceWith(int32_op, NULL);
@@ -1638,17 +1557,14 @@
 static void NarrowShiftMintOp(ShiftMintOpInstr* mint_op) {
   if (RangeUtils::Fits(mint_op->range(), RangeBoundary::kRangeBoundaryInt32) &&
       RangeUtils::Fits(mint_op->left()->definition()->range(),
-                  RangeBoundary::kRangeBoundaryInt32) &&
+                       RangeBoundary::kRangeBoundaryInt32) &&
       RangeUtils::Fits(mint_op->right()->definition()->range(),
-                  RangeBoundary::kRangeBoundaryInt32) &&
-      BinaryInt32OpInstr::IsSupported(mint_op->op_kind(),
-                                      mint_op->left(),
+                       RangeBoundary::kRangeBoundaryInt32) &&
+      BinaryInt32OpInstr::IsSupported(mint_op->op_kind(), mint_op->left(),
                                       mint_op->right())) {
-    BinaryInt32OpInstr* int32_op =
-        new BinaryInt32OpInstr(mint_op->op_kind(),
-                               mint_op->left()->CopyWithType(),
-                               mint_op->right()->CopyWithType(),
-                               mint_op->DeoptimizationTarget());
+    BinaryInt32OpInstr* int32_op = new BinaryInt32OpInstr(
+        mint_op->op_kind(), mint_op->left()->CopyWithType(),
+        mint_op->right()->CopyWithType(), mint_op->DeoptimizationTarget());
     int32_op->set_range(*mint_op->range());
     int32_op->set_can_overflow(false);
     mint_op->ReplaceWith(int32_op, NULL);
@@ -1672,7 +1588,7 @@
   ASSERT(flow_graph_ != NULL);
   zone_ = flow_graph_->zone();
   selected_uint32_defs_ =
-      new(zone_) BitVector(zone_, flow_graph_->current_ssa_temp_index());
+      new (zone_) BitVector(zone_, flow_graph_->current_ssa_temp_index());
 }
 
 
@@ -1696,11 +1612,8 @@
   // TODO(johnmccutchan): Consider Smi operations, to avoid unnecessary tagging
   // & untagged of intermediate results.
   // TODO(johnmccutchan): Consider phis.
-  return def->IsBoxInt64() ||
-         def->IsUnboxInt64() ||
-         def->IsBinaryMintOp() ||
-         def->IsShiftMintOp()  ||
-         def->IsUnaryMintOp();
+  return def->IsBoxInt64() || def->IsUnboxInt64() || def->IsBinaryMintOp() ||
+         def->IsShiftMintOp() || def->IsUnaryMintOp();
 }
 
 
@@ -1710,19 +1623,17 @@
   }
 
   for (BlockIterator block_it = flow_graph_->reverse_postorder_iterator();
-       !block_it.Done();
-       block_it.Advance()) {
+       !block_it.Done(); block_it.Advance()) {
     BlockEntryInstr* block = block_it.Current();
 
-    for (ForwardInstructionIterator instr_it(block);
-         !instr_it.Done();
+    for (ForwardInstructionIterator instr_it(block); !instr_it.Done();
          instr_it.Advance()) {
       Instruction* current = instr_it.Current();
       Definition* defn = current->AsDefinition();
       if ((defn != NULL) && defn->HasSSATemp()) {
         if (IsPotentialUint32Definition(defn)) {
           if (FLAG_support_il_printer && FLAG_trace_integer_ir_selection) {
-           THR_Print("Adding %s\n", current->ToCString());
+            THR_Print("Adding %s\n", current->ToCString());
           }
           potential_uint32_defs_.Add(defn);
         }
@@ -1772,13 +1683,10 @@
 
 
 bool IntegerInstructionSelector::AllUsesAreUint32Narrowing(Value* list_head) {
-  for (Value::Iterator it(list_head);
-       !it.Done();
-       it.Advance()) {
+  for (Value::Iterator it(list_head); !it.Done(); it.Advance()) {
     Value* use = it.Current();
     Definition* defn = use->instruction()->AsDefinition();
-    if ((defn == NULL) ||
-        !defn->HasSSATemp() ||
+    if ((defn == NULL) || !defn->HasSSATemp() ||
         !selected_uint32_defs_->Contains(defn->ssa_temp_index())) {
       return false;
     }
@@ -1865,28 +1773,28 @@
     Value* left = op->left()->CopyWithType();
     Value* right = op->right()->CopyWithType();
     intptr_t deopt_id = op->DeoptimizationTarget();
-    return new(Z) BinaryUint32OpInstr(op_kind, left, right, deopt_id);
+    return new (Z) BinaryUint32OpInstr(op_kind, left, right, deopt_id);
   } else if (def->IsBoxInt64()) {
     Value* value = def->AsBoxInt64()->value()->CopyWithType();
-    return new(Z) BoxUint32Instr(value);
+    return new (Z) BoxUint32Instr(value);
   } else if (def->IsUnboxInt64()) {
     UnboxInstr* unbox = def->AsUnboxInt64();
     Value* value = unbox->value()->CopyWithType();
     intptr_t deopt_id = unbox->DeoptimizationTarget();
-    return new(Z) UnboxUint32Instr(value, deopt_id);
+    return new (Z) UnboxUint32Instr(value, deopt_id);
   } else if (def->IsUnaryMintOp()) {
     UnaryMintOpInstr* op = def->AsUnaryMintOp();
     Token::Kind op_kind = op->op_kind();
     Value* value = op->value()->CopyWithType();
     intptr_t deopt_id = op->DeoptimizationTarget();
-    return new(Z) UnaryUint32OpInstr(op_kind, value, deopt_id);
+    return new (Z) UnaryUint32OpInstr(op_kind, value, deopt_id);
   } else if (def->IsShiftMintOp()) {
     ShiftMintOpInstr* op = def->AsShiftMintOp();
     Token::Kind op_kind = op->op_kind();
     Value* left = op->left()->CopyWithType();
     Value* right = op->right()->CopyWithType();
     intptr_t deopt_id = op->DeoptimizationTarget();
-    return new(Z) ShiftUint32OpInstr(op_kind, left, right, deopt_id);
+    return new (Z) ShiftUint32OpInstr(op_kind, left, right, deopt_id);
   }
   UNREACHABLE();
   return NULL;
@@ -1907,7 +1815,7 @@
     ASSERT(replacement != NULL);
     if (FLAG_support_il_printer && FLAG_trace_integer_ir_selection) {
       THR_Print("Replacing %s with %s\n", defn->ToCString(),
-                                          replacement->ToCString());
+                replacement->ToCString());
     }
     if (!Range::IsUnknown(defn->range())) {
       replacement->set_range(*defn->range());
@@ -1932,8 +1840,7 @@
   }
   if (IsConstant()) return *this;
   return Add(Range::ConstantMinSmi(symbol()->range()),
-             RangeBoundary::FromConstant(offset_),
-             NegativeInfinity());
+             RangeBoundary::FromConstant(offset_), NegativeInfinity());
 }
 
 
@@ -1944,8 +1851,7 @@
   if (IsConstant()) return *this;
 
   return Add(Range::ConstantMaxSmi(symbol()->range()),
-             RangeBoundary::FromConstant(offset_),
-             PositiveInfinity());
+             RangeBoundary::FromConstant(offset_), PositiveInfinity());
 }
 
 
@@ -2038,8 +1944,7 @@
   int64_t limit = 64 - shift_count;
   int64_t value = value_boundary.ConstantValue();
 
-  if ((value == 0) ||
-      (shift_count == 0) ||
+  if ((value == 0) || (shift_count == 0) ||
       ((limit > 0) && Utils::IsInt(static_cast<int>(limit), value))) {
     // Result stays in 64 bit range.
     int64_t result = value << shift_count;
@@ -2186,9 +2091,7 @@
     return b;
   }
 
-  if (CanonicalizeForComparison(&a,
-                                &b,
-                                &CanonicalizeMinBoundary,
+  if (CanonicalizeForComparison(&a, &b, &CanonicalizeMinBoundary,
                                 RangeBoundary::NegativeInfinity())) {
     return (a.offset() <= b.offset()) ? a : b;
   }
@@ -2215,9 +2118,7 @@
     return b;
   }
 
-  if (CanonicalizeForComparison(&a,
-                                &b,
-                                &CanonicalizeMaxBoundary,
+  if (CanonicalizeForComparison(&a, &b, &CanonicalizeMaxBoundary,
                                 RangeBoundary::PositiveInfinity())) {
     return (a.offset() >= b.offset()) ? a : b;
   }
@@ -2251,9 +2152,7 @@
     return a;
   }
 
-  if (CanonicalizeForComparison(&a,
-                                &b,
-                                &CanonicalizeMinBoundary,
+  if (CanonicalizeForComparison(&a, &b, &CanonicalizeMinBoundary,
                                 RangeBoundary::NegativeInfinity())) {
     return (a.offset() >= b.offset()) ? a : b;
   }
@@ -2279,9 +2178,7 @@
     return a;
   }
 
-  if (CanonicalizeForComparison(&a,
-                                &b,
-                                &CanonicalizeMaxBoundary,
+  if (CanonicalizeForComparison(&a, &b, &CanonicalizeMaxBoundary,
                                 RangeBoundary::PositiveInfinity())) {
     return (a.offset() <= b.offset()) ? a : b;
   }
@@ -2307,31 +2204,30 @@
 bool Range::OnlyLessThanOrEqualTo(int64_t val) const {
   const RangeBoundary upper_bound = max().UpperBound();
   return !upper_bound.IsPositiveInfinity() &&
-      (upper_bound.ConstantValue() <= val);
+         (upper_bound.ConstantValue() <= val);
 }
 
 
 bool Range::OnlyGreaterThanOrEqualTo(int64_t val) const {
   const RangeBoundary lower_bound = min().LowerBound();
   return !lower_bound.IsNegativeInfinity() &&
-      (lower_bound.ConstantValue() >= val);
+         (lower_bound.ConstantValue() >= val);
 }
 
 
 // Inclusive.
 bool Range::IsWithin(int64_t min_int, int64_t max_int) const {
-  return OnlyGreaterThanOrEqualTo(min_int) &&
-      OnlyLessThanOrEqualTo(max_int);
+  return OnlyGreaterThanOrEqualTo(min_int) && OnlyLessThanOrEqualTo(max_int);
 }
 
 
 bool Range::Overlaps(int64_t min_int, int64_t max_int) const {
   RangeBoundary lower = min().LowerBound();
   RangeBoundary upper = max().UpperBound();
-  const int64_t this_min = lower.IsNegativeInfinity() ?
-      RangeBoundary::kMin : lower.ConstantValue();
-  const int64_t this_max = upper.IsPositiveInfinity() ?
-      RangeBoundary::kMax : upper.ConstantValue();
+  const int64_t this_min =
+      lower.IsNegativeInfinity() ? RangeBoundary::kMin : lower.ConstantValue();
+  const int64_t this_max =
+      upper.IsPositiveInfinity() ? RangeBoundary::kMax : upper.ConstantValue();
   if ((this_min <= min_int) && (min_int <= this_max)) return true;
   if ((this_min <= max_int) && (max_int <= this_max)) return true;
   if ((min_int < this_min) && (max_int > this_max)) return true;
@@ -2378,18 +2274,14 @@
                                      static_cast<int64_t>(0));
 
   *result_min = RangeBoundary::Shl(
-      left_min,
-      left_min.ConstantValue() > 0 ? right_min : right_max,
-      left_min.ConstantValue() > 0
-          ? RangeBoundary::PositiveInfinity()
-          : RangeBoundary::NegativeInfinity());
+      left_min, left_min.ConstantValue() > 0 ? right_min : right_max,
+      left_min.ConstantValue() > 0 ? RangeBoundary::PositiveInfinity()
+                                   : RangeBoundary::NegativeInfinity());
 
   *result_max = RangeBoundary::Shl(
-      left_max,
-      left_max.ConstantValue() > 0 ? right_max : right_min,
-      left_max.ConstantValue() > 0
-          ? RangeBoundary::PositiveInfinity()
-          : RangeBoundary::NegativeInfinity());
+      left_max, left_max.ConstantValue() > 0 ? right_max : right_min,
+      left_max.ConstantValue() > 0 ? RangeBoundary::PositiveInfinity()
+                                   : RangeBoundary::NegativeInfinity());
 }
 
 
@@ -2407,12 +2299,10 @@
                                      static_cast<int64_t>(0));
 
   *result_min = RangeBoundary::Shr(
-      left_min,
-      left_min.ConstantValue() > 0 ? right_max : right_min);
+      left_min, left_min.ConstantValue() > 0 ? right_max : right_min);
 
   *result_max = RangeBoundary::Shr(
-      left_max,
-      left_max.ConstantValue() > 0 ? right_min : right_max);
+      left_max, left_max.ConstantValue() > 0 ? right_min : right_max);
 }
 
 
@@ -2452,18 +2342,17 @@
                       const Range* right_range,
                       RangeBoundary* result_min,
                       RangeBoundary* result_max) {
-  const int bitsize =
-      Utils::Maximum(BitSize(left_range), BitSize(right_range));
+  const int bitsize = Utils::Maximum(BitSize(left_range), BitSize(right_range));
 
   if (left_range->IsPositive() && right_range->IsPositive()) {
     *result_min = RangeBoundary::FromConstant(0);
   } else {
-    *result_min = RangeBoundary::FromConstant(
-        static_cast<int64_t>(-1) << bitsize);
+    *result_min =
+        RangeBoundary::FromConstant(static_cast<int64_t>(-1) << bitsize);
   }
 
-  *result_max = RangeBoundary::FromConstant(
-      (static_cast<uint64_t>(1) << bitsize) - 1);
+  *result_max =
+      RangeBoundary::FromConstant((static_cast<uint64_t>(1) << bitsize) - 1);
 }
 
 
@@ -2486,13 +2375,13 @@
   ASSERT(result_min != NULL);
   ASSERT(result_max != NULL);
 
-  RangeBoundary left_min =
-    IsArrayLength(left_defn) ?
-        RangeBoundary::FromDefinition(left_defn) : left_range->min();
+  RangeBoundary left_min = IsArrayLength(left_defn)
+                               ? RangeBoundary::FromDefinition(left_defn)
+                               : left_range->min();
 
-  RangeBoundary left_max =
-    IsArrayLength(left_defn) ?
-        RangeBoundary::FromDefinition(left_defn) : left_range->max();
+  RangeBoundary left_max = IsArrayLength(left_defn)
+                               ? RangeBoundary::FromDefinition(left_defn)
+                               : left_range->max();
 
   if (!RangeBoundary::SymbolicAdd(left_min, right_range->min(), result_min)) {
     *result_min = RangeBoundary::Add(left_range->min().LowerBound(),
@@ -2517,18 +2406,18 @@
   ASSERT(result_min != NULL);
   ASSERT(result_max != NULL);
 
-  RangeBoundary left_min =
-    IsArrayLength(left_defn) ?
-        RangeBoundary::FromDefinition(left_defn) : left_range->min();
+  RangeBoundary left_min = IsArrayLength(left_defn)
+                               ? RangeBoundary::FromDefinition(left_defn)
+                               : left_range->min();
 
-  RangeBoundary left_max =
-    IsArrayLength(left_defn) ?
-        RangeBoundary::FromDefinition(left_defn) : left_range->max();
+  RangeBoundary left_max = IsArrayLength(left_defn)
+                               ? RangeBoundary::FromDefinition(left_defn)
+                               : left_range->max();
 
   if (!RangeBoundary::SymbolicSub(left_min, right_range->max(), result_min)) {
     *result_min = RangeBoundary::Sub(left_range->min().LowerBound(),
-                              right_range->max().UpperBound(),
-                              RangeBoundary::NegativeInfinity());
+                                     right_range->max().UpperBound(),
+                                     RangeBoundary::NegativeInfinity());
   }
   if (!RangeBoundary::SymbolicSub(left_max, right_range->min(), result_max)) {
     *result_max = RangeBoundary::Sub(left_range->max().UpperBound(),
@@ -2815,17 +2704,15 @@
   const RangeBoundary::RangeSize size = RangeSizeForPhi(this);
   for (intptr_t i = 0; i < InputCount(); i++) {
     Value* input = InputAt(i);
-    Join(range,
-         input->definition(),
-         GetInputRange(analysis, size, input),
+    Join(range, input->definition(), GetInputRange(analysis, size, input),
          size);
   }
 
   BlockEntryInstr* phi_block = GetBlock();
-  range->set_min(EnsureAcyclicSymbol(
-      phi_block, range->min(), RangeBoundary::MinSmi()));
-  range->set_max(EnsureAcyclicSymbol(
-      phi_block, range->max(), RangeBoundary::MaxSmi()));
+  range->set_min(
+      EnsureAcyclicSymbol(phi_block, range->min(), RangeBoundary::MinSmi()));
+  range->set_max(
+      EnsureAcyclicSymbol(phi_block, range->max(), RangeBoundary::MaxSmi()));
 }
 
 
@@ -2889,7 +2776,6 @@
 }
 
 
-
 void LoadIndexedInstr::InferRange(RangeAnalysis* analysis, Range* range) {
   switch (class_id()) {
     case kTypedDataInt8ArrayCid:
@@ -2954,8 +2840,8 @@
 void IfThenElseInstr::InferRange(RangeAnalysis* analysis, Range* range) {
   const intptr_t min = Utils::Minimum(if_true_, if_false_);
   const intptr_t max = Utils::Maximum(if_true_, if_false_);
-  *range = Range(RangeBoundary::FromConstant(min),
-                 RangeBoundary::FromConstant(max));
+  *range =
+      Range(RangeBoundary::FromConstant(min), RangeBoundary::FromConstant(max));
 }
 
 
@@ -2983,10 +2869,7 @@
     return;
   }
 
-  Range::BinaryOp(op_kind(),
-                  left_range,
-                  right_range,
-                  left()->definition(),
+  Range::BinaryOp(op_kind(), left_range, right_range, left()->definition(),
                   range);
   ASSERT(!Range::IsUnknown(range));
 
@@ -3006,29 +2889,25 @@
 void BinarySmiOpInstr::InferRange(RangeAnalysis* analysis, Range* range) {
   // TODO(vegorov) completely remove this once GetSmiRange is eliminated.
   InferRangeHelper(analysis->GetSmiRange(left()),
-                   analysis->GetSmiRange(right()),
-                   range);
+                   analysis->GetSmiRange(right()), range);
 }
 
 
 void BinaryInt32OpInstr::InferRange(RangeAnalysis* analysis, Range* range) {
   InferRangeHelper(analysis->GetSmiRange(left()),
-                   analysis->GetSmiRange(right()),
-                   range);
+                   analysis->GetSmiRange(right()), range);
 }
 
 
 void BinaryMintOpInstr::InferRange(RangeAnalysis* analysis, Range* range) {
   InferRangeHelper(left()->definition()->range(),
-                   right()->definition()->range(),
-                   range);
+                   right()->definition()->range(), range);
 }
 
 
 void ShiftMintOpInstr::InferRange(RangeAnalysis* analysis, Range* range) {
   InferRangeHelper(left()->definition()->range(),
-                   right()->definition()->range(),
-                   range);
+                   right()->definition()->range(), range);
 }
 
 
@@ -3096,11 +2975,9 @@
 
 void UnboxedIntConverterInstr::InferRange(RangeAnalysis* analysis,
                                           Range* range) {
-  ASSERT((from() == kUnboxedInt32) ||
-         (from() == kUnboxedMint) ||
+  ASSERT((from() == kUnboxedInt32) || (from() == kUnboxedMint) ||
          (from() == kUnboxedUint32));
-  ASSERT((to() == kUnboxedInt32) ||
-         (to() == kUnboxedMint) ||
+  ASSERT((to() == kUnboxedInt32) || (to() == kUnboxedMint) ||
          (to() == kUnboxedUint32));
   const Range* value_range = value()->definition()->range();
   if (Range::IsUnknown(value_range)) {
@@ -3109,9 +2986,9 @@
 
   if (to() == kUnboxedUint32) {
     // TODO(vegorov): improve range information for unboxing to Uint32.
-    *range = Range(
-        RangeBoundary::FromConstant(0),
-        RangeBoundary::FromConstant(static_cast<int64_t>(kMaxUint32)));
+    *range =
+        Range(RangeBoundary::FromConstant(0),
+              RangeBoundary::FromConstant(static_cast<int64_t>(kMaxUint32)));
   } else {
     *range = *value_range;
     if (to() == kUnboxedInt32) {
diff --git a/runtime/vm/flow_graph_range_analysis.h b/runtime/vm/flow_graph_range_analysis.h
index 691fff5..8dce8de 100644
--- a/runtime/vm/flow_graph_range_analysis.h
+++ b/runtime/vm/flow_graph_range_analysis.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_FLOW_GRAPH_RANGE_ANALYSIS_H_
-#define VM_FLOW_GRAPH_RANGE_ANALYSIS_H_
+#ifndef RUNTIME_VM_FLOW_GRAPH_RANGE_ANALYSIS_H_
+#define RUNTIME_VM_FLOW_GRAPH_RANGE_ANALYSIS_H_
 
 #include "vm/flow_graph.h"
 #include "vm/intermediate_language.h"
@@ -26,16 +26,16 @@
     kRangeBoundaryInt64,
   };
 
-  RangeBoundary() : kind_(kUnknown), value_(0), offset_(0) { }
+  RangeBoundary() : kind_(kUnknown), value_(0), offset_(0) {}
 
   RangeBoundary(const RangeBoundary& other)
       : ValueObject(),
         kind_(other.kind_),
         value_(other.value_),
-        offset_(other.offset_) { }
+        offset_(other.offset_) {}
 
   explicit RangeBoundary(int64_t val)
-      : kind_(kConstant), value_(val), offset_(0) { }
+      : kind_(kConstant), value_(val), offset_(0) {}
 
   RangeBoundary& operator=(const RangeBoundary& other) {
     kind_ = other.kind_;
@@ -48,9 +48,7 @@
   static const int64_t kMax = kMaxInt64;
 
   // Construct a RangeBoundary for a constant value.
-  static RangeBoundary FromConstant(int64_t val) {
-    return RangeBoundary(val);
-  }
+  static RangeBoundary FromConstant(int64_t val) { return RangeBoundary(val); }
 
   // Construct a RangeBoundary for -inf.
   static RangeBoundary NegativeInfinity() {
@@ -66,24 +64,16 @@
   static RangeBoundary FromDefinition(Definition* defn, int64_t offs = 0);
 
   // Construct a RangeBoundary for the constant MinSmi value.
-  static RangeBoundary MinSmi() {
-    return FromConstant(Smi::kMinValue);
-  }
+  static RangeBoundary MinSmi() { return FromConstant(Smi::kMinValue); }
 
   // Construct a RangeBoundary for the constant MaxSmi value.
-  static RangeBoundary MaxSmi() {
-    return FromConstant(Smi::kMaxValue);
-  }
+  static RangeBoundary MaxSmi() { return FromConstant(Smi::kMaxValue); }
 
   // Construct a RangeBoundary for the constant kMin value.
-  static RangeBoundary MinConstant() {
-    return FromConstant(kMin);
-  }
+  static RangeBoundary MinConstant() { return FromConstant(kMin); }
 
   // Construct a RangeBoundary for the constant kMax value.
-  static RangeBoundary MaxConstant() {
-    return FromConstant(kMax);
-  }
+  static RangeBoundary MaxConstant() { return FromConstant(kMax); }
 
   // Construct a RangeBoundary for the constant kMin value.
   static RangeBoundary MinConstant(RangeSize size) {
@@ -156,9 +146,7 @@
   }
 
   // Returns true if this outside mint range.
-  bool OverflowedMint() const {
-    return IsInfinity();
-  }
+  bool OverflowedMint() const { return IsInfinity(); }
 
   // -/+ infinity are clamped to MinConstant/MaxConstant of the given type.
   RangeBoundary Clamp(RangeSize size) const {
@@ -189,19 +177,17 @@
 
   bool IsMinimumOrBelow(RangeSize size) const {
     return IsNegativeInfinity() ||
-        (IsConstant() &&
-         (ConstantValue() <= RangeBoundary::MinConstant(size).ConstantValue()));
+           (IsConstant() && (ConstantValue() <=
+                             RangeBoundary::MinConstant(size).ConstantValue()));
   }
 
   bool IsMaximumOrAbove(RangeSize size) const {
     return IsPositiveInfinity() ||
-        (IsConstant() &&
-         (ConstantValue() >= RangeBoundary::MaxConstant(size).ConstantValue()));
+           (IsConstant() && (ConstantValue() >=
+                             RangeBoundary::MaxConstant(size).ConstantValue()));
   }
 
-  intptr_t kind() const {
-    return kind_;
-  }
+  intptr_t kind() const { return kind_; }
 
   // Kind tests.
   bool IsUnknown() const { return kind_ == kUnknown; }
@@ -212,9 +198,7 @@
   bool IsInfinity() const {
     return IsNegativeInfinity() || IsPositiveInfinity();
   }
-  bool IsConstantOrInfinity() const {
-    return IsConstant() || IsInfinity();
-  }
+  bool IsConstantOrInfinity() const { return IsConstant() || IsInfinity(); }
 
   // Returns the value of a kConstant RangeBoundary.
   int64_t ConstantValue() const;
@@ -226,9 +210,7 @@
   }
 
   // Offset from symbol.
-  int64_t offset() const {
-    return offset_;
-  }
+  int64_t offset() const { return offset_; }
 
   // Computes the LowerBound of this. Three cases:
   // IsInfinity() -> NegativeInfinity().
@@ -291,17 +273,13 @@
     return LowerBound().Clamp(size).ConstantValue();
   }
 
-  int64_t SmiUpperBound() const {
-    return UpperBound(kRangeBoundarySmi);
-  }
+  int64_t SmiUpperBound() const { return UpperBound(kRangeBoundarySmi); }
 
-  int64_t SmiLowerBound() const {
-    return LowerBound(kRangeBoundarySmi);
-  }
+  int64_t SmiLowerBound() const { return LowerBound(kRangeBoundarySmi); }
 
  private:
   RangeBoundary(Kind kind, int64_t value, int64_t offset)
-      : kind_(kind), value_(value), offset_(offset) { }
+      : kind_(kind), value_(value), offset_(offset) {}
 
   Kind kind_;
   int64_t value_;
@@ -311,16 +289,13 @@
 
 class Range : public ZoneAllocated {
  public:
-  Range() : min_(), max_() { }
+  Range() : min_(), max_() {}
   Range(RangeBoundary min, RangeBoundary max) : min_(min), max_(max) {
     ASSERT(min_.IsUnknown() == max_.IsUnknown());
   }
 
   Range(const Range& other)
-      : ZoneAllocated(),
-        min_(other.min_),
-        max_(other.max_) {
-  }
+      : ZoneAllocated(), min_(other.min_), max_(other.max_) {}
 
   Range& operator=(const Range& other) {
     min_ = other.min_;
@@ -348,18 +323,13 @@
     if (other == NULL) {
       return min_.IsUnknown();
     }
-    return min_.Equals(other->min_) &&
-        max_.Equals(other->max_);
+    return min_.Equals(other->min_) && max_.Equals(other->max_);
   }
 
   const RangeBoundary& min() const { return min_; }
   const RangeBoundary& max() const { return max_; }
-  void set_min(const RangeBoundary& value) {
-    min_ = value;
-  }
-  void set_max(const RangeBoundary& value) {
-    max_ = value;
-  }
+  void set_min(const RangeBoundary& value) { min_ = value; }
+  void set_max(const RangeBoundary& value) { max_ = value; }
 
   static RangeBoundary ConstantMinSmi(const Range* range) {
     return ConstantMin(range, RangeBoundary::kRangeBoundarySmi);
@@ -411,9 +381,7 @@
 
   bool IsUnsatisfiable() const;
 
-  bool IsFinite() const {
-    return !min_.IsInfinity() && !max_.IsInfinity();
-  }
+  bool IsFinite() const { return !min_.IsInfinity() && !max_.IsInfinity(); }
 
   Range Intersect(const Range* other) const {
     return Range(RangeBoundary::IntersectionMin(min(), other->min()),
@@ -488,7 +456,7 @@
 };
 
 
-class RangeUtils : public AllStatic  {
+class RangeUtils : public AllStatic {
  public:
   static bool Fits(Range* range, RangeBoundary::RangeSize size) {
     return !Range::IsUnknown(range) && range->Fits(size);
@@ -510,7 +478,7 @@
   explicit RangeAnalysis(FlowGraph* flow_graph)
       : flow_graph_(flow_graph),
         smi_range_(Range::Full(RangeBoundary::kRangeBoundarySmi)),
-        int64_range_(Range::Full(RangeBoundary::kRangeBoundaryInt64)) { }
+        int64_range_(Range::Full(RangeBoundary::kRangeBoundaryInt64)) {}
 
   // Infer ranges for all values and remove overflow checks from binary smi
   // operations when proven redundant.
@@ -534,11 +502,7 @@
   void AssignRangesRecursively(Definition* defn);
 
  private:
-  enum JoinOperator {
-    NONE,
-    WIDEN,
-    NARROW
-  };
+  enum JoinOperator { NONE, WIDEN, NARROW };
   static char OpPrefix(JoinOperator op);
 
   // Collect all values that were proven to be smi in smi_values_ array and all
@@ -663,4 +627,4 @@
 
 }  // namespace dart
 
-#endif  // VM_FLOW_GRAPH_RANGE_ANALYSIS_H_
+#endif  // RUNTIME_VM_FLOW_GRAPH_RANGE_ANALYSIS_H_
diff --git a/runtime/vm/flow_graph_range_analysis_test.cc b/runtime/vm/flow_graph_range_analysis_test.cc
index 7ebd6b4..a15cea6 100644
--- a/runtime/vm/flow_graph_range_analysis_test.cc
+++ b/runtime/vm/flow_graph_range_analysis_test.cc
@@ -8,18 +8,14 @@
 namespace dart {
 
 TEST_CASE(RangeTests) {
-  Range* zero = new Range(
-      RangeBoundary::FromConstant(0),
-      RangeBoundary::FromConstant(0));
-  Range* positive = new Range(
-      RangeBoundary::FromConstant(0),
-      RangeBoundary::FromConstant(100));
-  Range* negative = new Range(
-      RangeBoundary::FromConstant(-1),
-      RangeBoundary::FromConstant(-100));
-  Range* range_x = new Range(
-      RangeBoundary::FromConstant(-15),
-      RangeBoundary::FromConstant(100));
+  Range* zero =
+      new Range(RangeBoundary::FromConstant(0), RangeBoundary::FromConstant(0));
+  Range* positive = new Range(RangeBoundary::FromConstant(0),
+                              RangeBoundary::FromConstant(100));
+  Range* negative = new Range(RangeBoundary::FromConstant(-1),
+                              RangeBoundary::FromConstant(-100));
+  Range* range_x = new Range(RangeBoundary::FromConstant(-15),
+                             RangeBoundary::FromConstant(100));
   EXPECT(positive->IsPositive());
   EXPECT(zero->Overlaps(0, 0));
   EXPECT(positive->Overlaps(0, 0));
@@ -29,15 +25,14 @@
   EXPECT(!range_x->IsWithin(-15, 99));
   EXPECT(!range_x->IsWithin(-14, 100));
 
-#define TEST_RANGE_OP_(Op, l_min, l_max, r_min, r_max, Clamp, res_min, res_max)\
+#define TEST_RANGE_OP_(Op, l_min, l_max, r_min, r_max, Clamp, res_min,         \
+                       res_max)                                                \
   {                                                                            \
     RangeBoundary min, max;                                                    \
-    Range* left_range = new Range(                                             \
-      RangeBoundary::FromConstant(l_min),                                      \
-      RangeBoundary::FromConstant(l_max));                                     \
-    Range* shift_range = new Range(                                            \
-      RangeBoundary::FromConstant(r_min),                                      \
-      RangeBoundary::FromConstant(r_max));                                     \
+    Range* left_range = new Range(RangeBoundary::FromConstant(l_min),          \
+                                  RangeBoundary::FromConstant(l_max));         \
+    Range* shift_range = new Range(RangeBoundary::FromConstant(r_min),         \
+                                   RangeBoundary::FromConstant(r_max));        \
     Op(left_range, shift_range, &min, &max);                                   \
     min = Clamp(min);                                                          \
     max = Clamp(max);                                                          \
@@ -53,52 +48,44 @@
 
 #define NO_CLAMP(b) (b)
 #define TEST_RANGE_OP(Op, l_min, l_max, r_min, r_max, result_min, result_max)  \
-  TEST_RANGE_OP_(Op, l_min, l_max, r_min, r_max,                               \
-                 NO_CLAMP, result_min, result_max)
+  TEST_RANGE_OP_(Op, l_min, l_max, r_min, r_max, NO_CLAMP, result_min,         \
+                 result_max)
 
 #define CLAMP_TO_SMI(b) (b.Clamp(RangeBoundary::kRangeBoundarySmi))
 #define TEST_RANGE_OP_SMI(Op, l_min, l_max, r_min, r_max, res_min, res_max)    \
-  TEST_RANGE_OP_(Op, l_min, l_max, r_min, r_max,                               \
-                 CLAMP_TO_SMI, res_min, res_max)
+  TEST_RANGE_OP_(Op, l_min, l_max, r_min, r_max, CLAMP_TO_SMI, res_min, res_max)
 
-  TEST_RANGE_OP(Range::Shl, -15, 100, 0, 2,
-                RangeBoundary(-60), RangeBoundary(400));
-  TEST_RANGE_OP(Range::Shl, -15, 100, -2, 2,
-                RangeBoundary(-60), RangeBoundary(400));
-  TEST_RANGE_OP(Range::Shl, -15, -10, 1, 2,
-                RangeBoundary(-60), RangeBoundary(-20));
-  TEST_RANGE_OP(Range::Shl, 5, 10, -2, 2,
-                RangeBoundary(5), RangeBoundary(40));
-  TEST_RANGE_OP(Range::Shl, -15, 100, 0, 64,
-                RangeBoundary::NegativeInfinity(),
+  TEST_RANGE_OP(Range::Shl, -15, 100, 0, 2, RangeBoundary(-60),
+                RangeBoundary(400));
+  TEST_RANGE_OP(Range::Shl, -15, 100, -2, 2, RangeBoundary(-60),
+                RangeBoundary(400));
+  TEST_RANGE_OP(Range::Shl, -15, -10, 1, 2, RangeBoundary(-60),
+                RangeBoundary(-20));
+  TEST_RANGE_OP(Range::Shl, 5, 10, -2, 2, RangeBoundary(5), RangeBoundary(40));
+  TEST_RANGE_OP(Range::Shl, -15, 100, 0, 64, RangeBoundary::NegativeInfinity(),
                 RangeBoundary::PositiveInfinity());
-  TEST_RANGE_OP(Range::Shl, -1, 1, 63, 63,
-                RangeBoundary(kMinInt64),
+  TEST_RANGE_OP(Range::Shl, -1, 1, 63, 63, RangeBoundary(kMinInt64),
                 RangeBoundary::PositiveInfinity());
   if (kBitsPerWord == 64) {
-    TEST_RANGE_OP_SMI(Range::Shl, -1, 1, 62, 62,
-                  RangeBoundary(kSmiMin),
-                  RangeBoundary(kSmiMax));
-    TEST_RANGE_OP_SMI(Range::Shl, -1, 1, 30, 30,
-                  RangeBoundary(-(1 << 30)),
-                  RangeBoundary(1 << 30));
+    TEST_RANGE_OP_SMI(Range::Shl, -1, 1, 62, 62, RangeBoundary(kSmiMin),
+                      RangeBoundary(kSmiMax));
+    TEST_RANGE_OP_SMI(Range::Shl, -1, 1, 30, 30, RangeBoundary(-(1 << 30)),
+                      RangeBoundary(1 << 30));
   } else {
-    TEST_RANGE_OP_SMI(Range::Shl, -1, 1, 30, 30,
-                  RangeBoundary(kSmiMin),
-                  RangeBoundary(kSmiMax));
-    TEST_RANGE_OP_SMI(Range::Shl, -1, 1, 62, 62,
-                  RangeBoundary(kSmiMin),
-                  RangeBoundary(kSmiMax));
+    TEST_RANGE_OP_SMI(Range::Shl, -1, 1, 30, 30, RangeBoundary(kSmiMin),
+                      RangeBoundary(kSmiMax));
+    TEST_RANGE_OP_SMI(Range::Shl, -1, 1, 62, 62, RangeBoundary(kSmiMin),
+                      RangeBoundary(kSmiMax));
   }
-  TEST_RANGE_OP(Range::Shl, 0, 100, 0, 64,
-                RangeBoundary(0), RangeBoundary::PositiveInfinity());
-  TEST_RANGE_OP(Range::Shl, -100, 0, 0, 64,
-                RangeBoundary::NegativeInfinity(), RangeBoundary(0));
+  TEST_RANGE_OP(Range::Shl, 0, 100, 0, 64, RangeBoundary(0),
+                RangeBoundary::PositiveInfinity());
+  TEST_RANGE_OP(Range::Shl, -100, 0, 0, 64, RangeBoundary::NegativeInfinity(),
+                RangeBoundary(0));
 
   TEST_RANGE_OP(Range::Shr, -8, 8, 1, 2, RangeBoundary(-4), RangeBoundary(4));
   TEST_RANGE_OP(Range::Shr, 1, 8, 1, 2, RangeBoundary(0), RangeBoundary(4));
-  TEST_RANGE_OP(Range::Shr, -16, -8, 1, 2,
-                RangeBoundary(-8), RangeBoundary(-2));
+  TEST_RANGE_OP(Range::Shr, -16, -8, 1, 2, RangeBoundary(-8),
+                RangeBoundary(-2));
   TEST_RANGE_OP(Range::Shr, 2, 4, -1, 1, RangeBoundary(1), RangeBoundary(4));
   TEST_RANGE_OP(Range::Shr, kMaxInt64, kMaxInt64, 0, 1,
                 RangeBoundary(kMaxInt64 >> 1), RangeBoundary(kMaxInt64));
@@ -232,10 +219,9 @@
   EXPECT(Range::ConstantAbsMax(&range_i) == 1);
 
   // RangeBOundary.Equals.
-  EXPECT(RangeBoundary::FromConstant(1).Equals(
-      RangeBoundary::FromConstant(1)));
-  EXPECT(!RangeBoundary::FromConstant(2).Equals(
-      RangeBoundary::FromConstant(1)));
+  EXPECT(RangeBoundary::FromConstant(1).Equals(RangeBoundary::FromConstant(1)));
+  EXPECT(
+      !RangeBoundary::FromConstant(2).Equals(RangeBoundary::FromConstant(1)));
   EXPECT(RangeBoundary::PositiveInfinity().Equals(
       RangeBoundary::PositiveInfinity()));
   EXPECT(!RangeBoundary::PositiveInfinity().Equals(
@@ -267,11 +253,7 @@
 
   {
     Range result;
-    Range::BinaryOp(Token::kADD,
-                    range_a,
-                    range_b,
-                    NULL,
-                    &result);
+    Range::BinaryOp(Token::kADD, range_a, range_b, NULL, &result);
     ASSERT(!Range::IsUnknown(&result));
     EXPECT(result.min().IsNegativeInfinity());
     EXPECT(result.max().IsPositiveInfinity());
@@ -280,16 +262,12 @@
   // Test that [5, 10] + [0, 5] = [5, 15].
   Range* range_c = new Range(RangeBoundary::FromConstant(5),
                              RangeBoundary::FromConstant(10));
-  Range* range_d = new Range(RangeBoundary::FromConstant(0),
-                             RangeBoundary::FromConstant(5));
+  Range* range_d =
+      new Range(RangeBoundary::FromConstant(0), RangeBoundary::FromConstant(5));
 
   {
     Range result;
-    Range::BinaryOp(Token::kADD,
-                    range_c,
-                    range_d,
-                    NULL,
-                    &result);
+    Range::BinaryOp(Token::kADD, range_c, range_d, NULL, &result);
     ASSERT(!Range::IsUnknown(&result));
     EXPECT(result.min().ConstantValue() == 5);
     EXPECT(result.max().ConstantValue() == 15);
@@ -302,11 +280,7 @@
                              RangeBoundary::FromConstant(0xf));
   {
     Range result;
-    Range::BinaryOp(Token::kBIT_AND,
-                    range_e,
-                    range_f,
-                    NULL,
-                    &result);
+    Range::BinaryOp(Token::kBIT_AND, range_e, range_f, NULL, &result);
     ASSERT(!Range::IsUnknown(&result));
     EXPECT(result.min().ConstantValue() == 0x0);
     EXPECT(result.max().ConstantValue() == 0xf);
@@ -318,12 +292,10 @@
 #define TEST_RANGE_ADD(l_min, l_max, r_min, r_max, result_min, result_max)     \
   {                                                                            \
     RangeBoundary min, max;                                                    \
-    Range* left_range = new Range(                                             \
-      RangeBoundary::FromConstant(l_min),                                      \
-      RangeBoundary::FromConstant(l_max));                                     \
-    Range* right_range = new Range(                                            \
-      RangeBoundary::FromConstant(r_min),                                      \
-      RangeBoundary::FromConstant(r_max));                                     \
+    Range* left_range = new Range(RangeBoundary::FromConstant(l_min),          \
+                                  RangeBoundary::FromConstant(l_max));         \
+    Range* right_range = new Range(RangeBoundary::FromConstant(r_min),         \
+                                   RangeBoundary::FromConstant(r_max));        \
     EXPECT(left_range->min().ConstantValue() == l_min);                        \
     EXPECT(left_range->max().ConstantValue() == l_max);                        \
     EXPECT(right_range->min().ConstantValue() == r_min);                       \
@@ -341,68 +313,56 @@
 
   // [kMaxInt32, kMaxInt32 + 15] + [10, 20] = [kMaxInt32 + 10, kMaxInt32 + 35].
   TEST_RANGE_ADD(static_cast<int64_t>(kMaxInt32),
-                 static_cast<int64_t>(kMaxInt32) + 15,
-                 static_cast<int64_t>(10),
+                 static_cast<int64_t>(kMaxInt32) + 15, static_cast<int64_t>(10),
                  static_cast<int64_t>(20),
                  RangeBoundary(static_cast<int64_t>(kMaxInt32) + 10),
                  RangeBoundary(static_cast<int64_t>(kMaxInt32) + 35));
 
   // [kMaxInt32 - 15, kMaxInt32 + 15] + [15, -15] = [kMaxInt32, kMaxInt32].
   TEST_RANGE_ADD(static_cast<int64_t>(kMaxInt32) - 15,
-                 static_cast<int64_t>(kMaxInt32) + 15,
-                 static_cast<int64_t>(15),
+                 static_cast<int64_t>(kMaxInt32) + 15, static_cast<int64_t>(15),
                  static_cast<int64_t>(-15),
                  RangeBoundary(static_cast<int64_t>(kMaxInt32)),
                  RangeBoundary(static_cast<int64_t>(kMaxInt32)));
 
   // [kMaxInt32, kMaxInt32 + 15] + [10, kMaxInt64] = [kMaxInt32 + 10, +inf].
   TEST_RANGE_ADD(static_cast<int64_t>(kMaxInt32),
-                 static_cast<int64_t>(kMaxInt32) + 15,
-                 static_cast<int64_t>(10),
+                 static_cast<int64_t>(kMaxInt32) + 15, static_cast<int64_t>(10),
                  static_cast<int64_t>(kMaxInt64),
                  RangeBoundary(static_cast<int64_t>(kMaxInt32) + 10),
                  RangeBoundary::PositiveInfinity());
 
   // [kMinInt64, kMaxInt32 + 15] + [10, 20] = [kMinInt64 + 10, kMaxInt32 + 35].
   TEST_RANGE_ADD(static_cast<int64_t>(kMinInt64),
-                 static_cast<int64_t>(kMaxInt32) + 15,
-                 static_cast<int64_t>(10),
+                 static_cast<int64_t>(kMaxInt32) + 15, static_cast<int64_t>(10),
                  static_cast<int64_t>(20),
                  RangeBoundary(static_cast<int64_t>(kMinInt64) + 10),
                  RangeBoundary(static_cast<int64_t>(kMaxInt32) + 35));
 
   // [0, 0] + [kMinInt64, kMaxInt64] = [kMinInt64, kMaxInt64].
-  TEST_RANGE_ADD(static_cast<int64_t>(0),
-                 static_cast<int64_t>(0),
+  TEST_RANGE_ADD(static_cast<int64_t>(0), static_cast<int64_t>(0),
                  static_cast<int64_t>(kMinInt64),
-                 static_cast<int64_t>(kMaxInt64),
-                 RangeBoundary(kMinInt64),
+                 static_cast<int64_t>(kMaxInt64), RangeBoundary(kMinInt64),
                  RangeBoundary(kMaxInt64));
 
   // Overflows.
 
   // [-1, 1] + [kMinInt64, kMaxInt64] = [-inf, +inf].
-  TEST_RANGE_ADD(static_cast<int64_t>(-1),
-                 static_cast<int64_t>(1),
-                 static_cast<int64_t>(kMinInt64),
-                 static_cast<int64_t>(kMaxInt64),
-                 RangeBoundary::NegativeInfinity(),
-                 RangeBoundary::PositiveInfinity());
+  TEST_RANGE_ADD(
+      static_cast<int64_t>(-1), static_cast<int64_t>(1),
+      static_cast<int64_t>(kMinInt64), static_cast<int64_t>(kMaxInt64),
+      RangeBoundary::NegativeInfinity(), RangeBoundary::PositiveInfinity());
 
   // [kMaxInt64, kMaxInt64] + [kMaxInt64, kMaxInt64] = [-inf, +inf].
-  TEST_RANGE_ADD(static_cast<int64_t>(kMaxInt64),
-                 static_cast<int64_t>(kMaxInt64),
-                 static_cast<int64_t>(kMaxInt64),
-                 static_cast<int64_t>(kMaxInt64),
-                 RangeBoundary::NegativeInfinity(),
-                 RangeBoundary::PositiveInfinity());
+  TEST_RANGE_ADD(
+      static_cast<int64_t>(kMaxInt64), static_cast<int64_t>(kMaxInt64),
+      static_cast<int64_t>(kMaxInt64), static_cast<int64_t>(kMaxInt64),
+      RangeBoundary::NegativeInfinity(), RangeBoundary::PositiveInfinity());
 
   // [kMaxInt64, kMaxInt64] + [1, 1] = [-inf, +inf].
   TEST_RANGE_ADD(static_cast<int64_t>(kMaxInt64),
-                 static_cast<int64_t>(kMaxInt64),
-                 static_cast<int64_t>(1),
-                 static_cast<int64_t>(1),
-                 RangeBoundary::NegativeInfinity(),
+                 static_cast<int64_t>(kMaxInt64), static_cast<int64_t>(1),
+                 static_cast<int64_t>(1), RangeBoundary::NegativeInfinity(),
                  RangeBoundary::PositiveInfinity());
 
 #undef TEST_RANGE_ADD
@@ -413,12 +373,10 @@
 #define TEST_RANGE_SUB(l_min, l_max, r_min, r_max, result_min, result_max)     \
   {                                                                            \
     RangeBoundary min, max;                                                    \
-    Range* left_range = new Range(                                             \
-      RangeBoundary::FromConstant(l_min),                                      \
-      RangeBoundary::FromConstant(l_max));                                     \
-    Range* right_range = new Range(                                            \
-      RangeBoundary::FromConstant(r_min),                                      \
-      RangeBoundary::FromConstant(r_max));                                     \
+    Range* left_range = new Range(RangeBoundary::FromConstant(l_min),          \
+                                  RangeBoundary::FromConstant(l_max));         \
+    Range* right_range = new Range(RangeBoundary::FromConstant(r_min),         \
+                                   RangeBoundary::FromConstant(r_max));        \
     EXPECT(left_range->min().ConstantValue() == l_min);                        \
     EXPECT(left_range->max().ConstantValue() == l_max);                        \
     EXPECT(right_range->min().ConstantValue() == r_min);                       \
@@ -436,34 +394,28 @@
 
   // [kMaxInt32, kMaxInt32 + 15] - [10, 20] = [kMaxInt32 - 20, kMaxInt32 + 5].
   TEST_RANGE_SUB(static_cast<int64_t>(kMaxInt32),
-                 static_cast<int64_t>(kMaxInt32) + 15,
-                 static_cast<int64_t>(10),
+                 static_cast<int64_t>(kMaxInt32) + 15, static_cast<int64_t>(10),
                  static_cast<int64_t>(20),
                  RangeBoundary(static_cast<int64_t>(kMaxInt32) - 20),
                  RangeBoundary(static_cast<int64_t>(kMaxInt32) + 5));
 
   // [kMintInt64, kMintInt64] - [1, 1] = [-inf, +inf].
   TEST_RANGE_SUB(static_cast<int64_t>(kMinInt64),
-                 static_cast<int64_t>(kMinInt64),
-                 static_cast<int64_t>(1),
-                 static_cast<int64_t>(1),
-                 RangeBoundary::NegativeInfinity(),
+                 static_cast<int64_t>(kMinInt64), static_cast<int64_t>(1),
+                 static_cast<int64_t>(1), RangeBoundary::NegativeInfinity(),
                  RangeBoundary::PositiveInfinity());
 
   // [1, 1] - [kMintInt64, kMintInt64] = [-inf, +inf].
-  TEST_RANGE_SUB(static_cast<int64_t>(1),
-                 static_cast<int64_t>(1),
-                 static_cast<int64_t>(kMinInt64),
-                 static_cast<int64_t>(kMinInt64),
-                 RangeBoundary::NegativeInfinity(),
-                 RangeBoundary::PositiveInfinity());
+  TEST_RANGE_SUB(
+      static_cast<int64_t>(1), static_cast<int64_t>(1),
+      static_cast<int64_t>(kMinInt64), static_cast<int64_t>(kMinInt64),
+      RangeBoundary::NegativeInfinity(), RangeBoundary::PositiveInfinity());
 
   // [kMaxInt32 + 10, kMaxInt32 + 20] - [-20, -20] =
   //     [kMaxInt32 + 30, kMaxInt32 + 40].
   TEST_RANGE_SUB(static_cast<int64_t>(kMaxInt32) + 10,
                  static_cast<int64_t>(kMaxInt32) + 20,
-                 static_cast<int64_t>(-20),
-                 static_cast<int64_t>(-20),
+                 static_cast<int64_t>(-20), static_cast<int64_t>(-20),
                  RangeBoundary(static_cast<int64_t>(kMaxInt32) + 30),
                  RangeBoundary(static_cast<int64_t>(kMaxInt32) + 40));
 
@@ -476,12 +428,10 @@
 #define TEST_RANGE_AND(l_min, l_max, r_min, r_max, result_min, result_max)     \
   {                                                                            \
     RangeBoundary min, max;                                                    \
-    Range* left_range = new Range(                                             \
-      RangeBoundary::FromConstant(l_min),                                      \
-      RangeBoundary::FromConstant(l_max));                                     \
-    Range* right_range = new Range(                                            \
-      RangeBoundary::FromConstant(r_min),                                      \
-      RangeBoundary::FromConstant(r_max));                                     \
+    Range* left_range = new Range(RangeBoundary::FromConstant(l_min),          \
+                                  RangeBoundary::FromConstant(l_max));         \
+    Range* right_range = new Range(RangeBoundary::FromConstant(r_min),         \
+                                   RangeBoundary::FromConstant(r_max));        \
     EXPECT(left_range->min().ConstantValue() == l_min);                        \
     EXPECT(left_range->max().ConstantValue() == l_max);                        \
     EXPECT(right_range->min().ConstantValue() == r_min);                       \
@@ -498,44 +448,32 @@
   }
 
   // [0xff, 0xfff] & [0xf, 0xf] = [0x0, 0xf].
-  TEST_RANGE_AND(static_cast<int64_t>(0xff),
-                 static_cast<int64_t>(0xfff),
-                 static_cast<int64_t>(0xf),
-                 static_cast<int64_t>(0xf),
-                 RangeBoundary(0),
-                 RangeBoundary(0xf));
+  TEST_RANGE_AND(static_cast<int64_t>(0xff), static_cast<int64_t>(0xfff),
+                 static_cast<int64_t>(0xf), static_cast<int64_t>(0xf),
+                 RangeBoundary(0), RangeBoundary(0xf));
 
   // [0xffffffff, 0xffffffff] & [0xfffffffff, 0xfffffffff] = [0x0, 0xfffffffff].
-  TEST_RANGE_AND(static_cast<int64_t>(0xffffffff),
-                 static_cast<int64_t>(0xffffffff),
-                 static_cast<int64_t>(0xfffffffff),
-                 static_cast<int64_t>(0xfffffffff),
-                 RangeBoundary(0),
-                 RangeBoundary(static_cast<int64_t>(0xfffffffff)));
+  TEST_RANGE_AND(
+      static_cast<int64_t>(0xffffffff), static_cast<int64_t>(0xffffffff),
+      static_cast<int64_t>(0xfffffffff), static_cast<int64_t>(0xfffffffff),
+      RangeBoundary(0), RangeBoundary(static_cast<int64_t>(0xfffffffff)));
 
   // [0xffffffff, 0xffffffff] & [-20, 20] = [0x0, 0xffffffff].
   TEST_RANGE_AND(static_cast<int64_t>(0xffffffff),
-                 static_cast<int64_t>(0xffffffff),
-                 static_cast<int64_t>(-20),
-                 static_cast<int64_t>(20),
-                 RangeBoundary(0),
+                 static_cast<int64_t>(0xffffffff), static_cast<int64_t>(-20),
+                 static_cast<int64_t>(20), RangeBoundary(0),
                  RangeBoundary(static_cast<int64_t>(0xffffffff)));
 
   // [-20, 20] & [0xffffffff, 0xffffffff] = [0x0, 0xffffffff].
-  TEST_RANGE_AND(static_cast<int64_t>(-20),
-                 static_cast<int64_t>(20),
+  TEST_RANGE_AND(static_cast<int64_t>(-20), static_cast<int64_t>(20),
                  static_cast<int64_t>(0xffffffff),
-                 static_cast<int64_t>(0xffffffff),
-                 RangeBoundary(0),
+                 static_cast<int64_t>(0xffffffff), RangeBoundary(0),
                  RangeBoundary(static_cast<int64_t>(0xffffffff)));
 
   // Test that [-20, 20] & [-20, 20] = [-32, 31].
-  TEST_RANGE_AND(static_cast<int64_t>(-20),
-                 static_cast<int64_t>(20),
-                 static_cast<int64_t>(-20),
-                 static_cast<int64_t>(20),
-                 RangeBoundary(-32),
-                 RangeBoundary(31));
+  TEST_RANGE_AND(static_cast<int64_t>(-20), static_cast<int64_t>(20),
+                 static_cast<int64_t>(-20), static_cast<int64_t>(20),
+                 RangeBoundary(-32), RangeBoundary(31));
 
 #undef TEST_RANGE_AND
 }
@@ -547,77 +485,77 @@
 
   // Constants.
   // MIN(0, 1) == 0
-  EXPECT(RangeBoundary::IntersectionMax(
-      RangeBoundary::FromConstant(0),
-      RangeBoundary::FromConstant(1)).ConstantValue() == 0);
+  EXPECT(RangeBoundary::IntersectionMax(RangeBoundary::FromConstant(0),
+                                        RangeBoundary::FromConstant(1))
+             .ConstantValue() == 0);
   // MIN(0, -1) == -1
-  EXPECT(RangeBoundary::IntersectionMax(
-      RangeBoundary::FromConstant(0),
-      RangeBoundary::FromConstant(-1)).ConstantValue() == -1);
+  EXPECT(RangeBoundary::IntersectionMax(RangeBoundary::FromConstant(0),
+                                        RangeBoundary::FromConstant(-1))
+             .ConstantValue() == -1);
 
   // MIN(1, 0) == 0
-  EXPECT(RangeBoundary::IntersectionMax(
-      RangeBoundary::FromConstant(1),
-      RangeBoundary::FromConstant(0)).ConstantValue() == 0);
+  EXPECT(RangeBoundary::IntersectionMax(RangeBoundary::FromConstant(1),
+                                        RangeBoundary::FromConstant(0))
+             .ConstantValue() == 0);
   // MIN(-1, 0) == -1
-  EXPECT(RangeBoundary::IntersectionMax(
-      RangeBoundary::FromConstant(-1),
-      RangeBoundary::FromConstant(0)).ConstantValue() == -1);
+  EXPECT(RangeBoundary::IntersectionMax(RangeBoundary::FromConstant(-1),
+                                        RangeBoundary::FromConstant(0))
+             .ConstantValue() == -1);
 
   // MAX(0, 1) == 1
-  EXPECT(RangeBoundary::IntersectionMin(
-      RangeBoundary::FromConstant(0),
-      RangeBoundary::FromConstant(1)).ConstantValue() == 1);
+  EXPECT(RangeBoundary::IntersectionMin(RangeBoundary::FromConstant(0),
+                                        RangeBoundary::FromConstant(1))
+             .ConstantValue() == 1);
 
   // MAX(0, -1) == 0
-  EXPECT(RangeBoundary::IntersectionMin(
-      RangeBoundary::FromConstant(0),
-      RangeBoundary::FromConstant(-1)).ConstantValue() == 0);
+  EXPECT(RangeBoundary::IntersectionMin(RangeBoundary::FromConstant(0),
+                                        RangeBoundary::FromConstant(-1))
+             .ConstantValue() == 0);
 
   // MAX(1, 0) == 1
-  EXPECT(RangeBoundary::IntersectionMin(
-      RangeBoundary::FromConstant(1),
-      RangeBoundary::FromConstant(0)).ConstantValue() == 1);
+  EXPECT(RangeBoundary::IntersectionMin(RangeBoundary::FromConstant(1),
+                                        RangeBoundary::FromConstant(0))
+             .ConstantValue() == 1);
   // MAX(-1, 0) == 0
-  EXPECT(RangeBoundary::IntersectionMin(
-      RangeBoundary::FromConstant(-1),
-      RangeBoundary::FromConstant(0)).ConstantValue() == 0);
+  EXPECT(RangeBoundary::IntersectionMin(RangeBoundary::FromConstant(-1),
+                                        RangeBoundary::FromConstant(0))
+             .ConstantValue() == 0);
 
   RangeBoundary n_infinity = RangeBoundary::NegativeInfinity();
   RangeBoundary p_infinity = RangeBoundary::PositiveInfinity();
 
   // Constants vs. infinity.
-  EXPECT(RangeBoundary::IntersectionMin(
-      n_infinity,
-      RangeBoundary::FromConstant(-1)).ConstantValue() == -1);
+  EXPECT(RangeBoundary::IntersectionMin(n_infinity,
+                                        RangeBoundary::FromConstant(-1))
+             .ConstantValue() == -1);
 
-  EXPECT(RangeBoundary::IntersectionMin(
-      RangeBoundary::FromConstant(-1),
-      n_infinity).ConstantValue() == -1);
+  EXPECT(RangeBoundary::IntersectionMin(RangeBoundary::FromConstant(-1),
+                                        n_infinity)
+             .ConstantValue() == -1);
 
-  EXPECT(RangeBoundary::IntersectionMin(
-      RangeBoundary::FromConstant(1),
-      n_infinity).ConstantValue() == 1);
+  EXPECT(
+      RangeBoundary::IntersectionMin(RangeBoundary::FromConstant(1), n_infinity)
+          .ConstantValue() == 1);
 
-  EXPECT(RangeBoundary::IntersectionMin(
-      n_infinity,
-      RangeBoundary::FromConstant(1)).ConstantValue() == 1);
+  EXPECT(
+      RangeBoundary::IntersectionMin(n_infinity, RangeBoundary::FromConstant(1))
+          .ConstantValue() == 1);
 
-  EXPECT(RangeBoundary::IntersectionMax(
-      p_infinity,
-      RangeBoundary::FromConstant(-1)).ConstantValue() == -1);
+  EXPECT(RangeBoundary::IntersectionMax(p_infinity,
+                                        RangeBoundary::FromConstant(-1))
+             .ConstantValue() == -1);
 
-  EXPECT(RangeBoundary::IntersectionMax(
-      RangeBoundary::FromConstant(-1),
-      p_infinity).ConstantValue() == -1);
+  EXPECT(RangeBoundary::IntersectionMax(RangeBoundary::FromConstant(-1),
+                                        p_infinity)
+             .ConstantValue() == -1);
 
-  EXPECT(RangeBoundary::IntersectionMax(
-      RangeBoundary::FromConstant(1),
-      p_infinity).ConstantValue() == 1);
+  EXPECT(
+      RangeBoundary::IntersectionMax(RangeBoundary::FromConstant(1), p_infinity)
+          .ConstantValue() == 1);
 
-  EXPECT(RangeBoundary::IntersectionMax(
-      p_infinity,
-      RangeBoundary::FromConstant(1)).ConstantValue() == 1);
+  EXPECT(
+      RangeBoundary::IntersectionMax(p_infinity, RangeBoundary::FromConstant(1))
+          .ConstantValue() == 1);
 }
 
 
@@ -627,82 +565,66 @@
   const RangeBoundary::RangeSize size = RangeBoundary::kRangeBoundarySmi;
 
   // Constants.
-  EXPECT(RangeBoundary::JoinMax(
-      RangeBoundary::FromConstant(0),
-      RangeBoundary::FromConstant(1),
-      size).ConstantValue() == 1);
-  EXPECT(RangeBoundary::JoinMax(
-      RangeBoundary::FromConstant(0),
-      RangeBoundary::FromConstant(-1),
-      size).ConstantValue() == 0);
-  EXPECT(RangeBoundary::JoinMax(
-      RangeBoundary::FromConstant(1),
-      RangeBoundary::FromConstant(0),
-      size).ConstantValue() == 1);
-  EXPECT(RangeBoundary::JoinMax(
-      RangeBoundary::FromConstant(-1),
-      RangeBoundary::FromConstant(0),
-      size).ConstantValue() == 0);
-  EXPECT(RangeBoundary::JoinMin(
-      RangeBoundary::FromConstant(0),
-      RangeBoundary::FromConstant(1),
-      size).ConstantValue() == 0);
-  EXPECT(RangeBoundary::JoinMin(
-      RangeBoundary::FromConstant(0),
-      RangeBoundary::FromConstant(-1),
-      size).ConstantValue() == -1);
-  EXPECT(RangeBoundary::JoinMin(
-      RangeBoundary::FromConstant(1),
-      RangeBoundary::FromConstant(0),
-      size).ConstantValue() == 0);
-  EXPECT(RangeBoundary::JoinMin(
-      RangeBoundary::FromConstant(-1),
-      RangeBoundary::FromConstant(0),
-      size).ConstantValue() == -1);
+  EXPECT(RangeBoundary::JoinMax(RangeBoundary::FromConstant(0),
+                                RangeBoundary::FromConstant(1), size)
+             .ConstantValue() == 1);
+  EXPECT(RangeBoundary::JoinMax(RangeBoundary::FromConstant(0),
+                                RangeBoundary::FromConstant(-1), size)
+             .ConstantValue() == 0);
+  EXPECT(RangeBoundary::JoinMax(RangeBoundary::FromConstant(1),
+                                RangeBoundary::FromConstant(0), size)
+             .ConstantValue() == 1);
+  EXPECT(RangeBoundary::JoinMax(RangeBoundary::FromConstant(-1),
+                                RangeBoundary::FromConstant(0), size)
+             .ConstantValue() == 0);
+  EXPECT(RangeBoundary::JoinMin(RangeBoundary::FromConstant(0),
+                                RangeBoundary::FromConstant(1), size)
+             .ConstantValue() == 0);
+  EXPECT(RangeBoundary::JoinMin(RangeBoundary::FromConstant(0),
+                                RangeBoundary::FromConstant(-1), size)
+             .ConstantValue() == -1);
+  EXPECT(RangeBoundary::JoinMin(RangeBoundary::FromConstant(1),
+                                RangeBoundary::FromConstant(0), size)
+             .ConstantValue() == 0);
+  EXPECT(RangeBoundary::JoinMin(RangeBoundary::FromConstant(-1),
+                                RangeBoundary::FromConstant(0), size)
+             .ConstantValue() == -1);
 
   RangeBoundary n_infinity = RangeBoundary::NegativeInfinity();
   RangeBoundary p_infinity = RangeBoundary::PositiveInfinity();
 
   // Constants vs. infinity.
-  EXPECT(RangeBoundary::JoinMin(
-      n_infinity,
-      RangeBoundary::FromConstant(-1),
-      size).IsMinimumOrBelow(size));
+  EXPECT(
+      RangeBoundary::JoinMin(n_infinity, RangeBoundary::FromConstant(-1), size)
+          .IsMinimumOrBelow(size));
 
-  EXPECT(RangeBoundary::JoinMin(
-      RangeBoundary::FromConstant(-1),
-      n_infinity,
-      size).IsMinimumOrBelow(size));
+  EXPECT(
+      RangeBoundary::JoinMin(RangeBoundary::FromConstant(-1), n_infinity, size)
+          .IsMinimumOrBelow(size));
 
-  EXPECT(RangeBoundary::JoinMin(
-      RangeBoundary::FromConstant(1),
-      n_infinity,
-      size).IsMinimumOrBelow(size));
+  EXPECT(
+      RangeBoundary::JoinMin(RangeBoundary::FromConstant(1), n_infinity, size)
+          .IsMinimumOrBelow(size));
 
-  EXPECT(RangeBoundary::JoinMin(
-      n_infinity,
-      RangeBoundary::FromConstant(1),
-      size).IsMinimumOrBelow(size));
+  EXPECT(
+      RangeBoundary::JoinMin(n_infinity, RangeBoundary::FromConstant(1), size)
+          .IsMinimumOrBelow(size));
 
-  EXPECT(RangeBoundary::JoinMax(
-      p_infinity,
-      RangeBoundary::FromConstant(-1),
-      size).IsMaximumOrAbove(size));
+  EXPECT(
+      RangeBoundary::JoinMax(p_infinity, RangeBoundary::FromConstant(-1), size)
+          .IsMaximumOrAbove(size));
 
-  EXPECT(RangeBoundary::JoinMax(
-      RangeBoundary::FromConstant(-1),
-      p_infinity,
-      size).IsMaximumOrAbove(size));
+  EXPECT(
+      RangeBoundary::JoinMax(RangeBoundary::FromConstant(-1), p_infinity, size)
+          .IsMaximumOrAbove(size));
 
-  EXPECT(RangeBoundary::JoinMax(
-      RangeBoundary::FromConstant(1),
-      p_infinity,
-      size).IsMaximumOrAbove(size));
+  EXPECT(
+      RangeBoundary::JoinMax(RangeBoundary::FromConstant(1), p_infinity, size)
+          .IsMaximumOrAbove(size));
 
-  EXPECT(RangeBoundary::JoinMax(
-      p_infinity,
-      RangeBoundary::FromConstant(1),
-      size).IsMaximumOrAbove(size));
+  EXPECT(
+      RangeBoundary::JoinMax(p_infinity, RangeBoundary::FromConstant(1), size)
+          .IsMaximumOrAbove(size));
 }
 
 }  // namespace dart
diff --git a/runtime/vm/flow_graph_type_propagator.cc b/runtime/vm/flow_graph_type_propagator.cc
index 2162cfe..9f96d7d 100644
--- a/runtime/vm/flow_graph_type_propagator.cc
+++ b/runtime/vm/flow_graph_type_propagator.cc
@@ -12,7 +12,9 @@
 
 namespace dart {
 
-DEFINE_FLAG(bool, trace_type_propagation, false,
+DEFINE_FLAG(bool,
+            trace_type_propagation,
+            false,
             "Trace flow graph type propagation");
 
 DECLARE_FLAG(bool, propagate_types);
@@ -22,8 +24,7 @@
 #ifndef PRODUCT
   Thread* thread = flow_graph->thread();
   TimelineStream* compiler_timeline = Timeline::GetCompilerStream();
-  TimelineDurationScope tds2(thread,
-                             compiler_timeline,
+  TimelineDurationScope tds2(thread, compiler_timeline,
                              "FlowGraphTypePropagator");
 #endif  // !PRODUCT
   FlowGraphTypePropagator propagator(flow_graph);
@@ -34,11 +35,13 @@
 FlowGraphTypePropagator::FlowGraphTypePropagator(FlowGraph* flow_graph)
     : FlowGraphVisitor(flow_graph->reverse_postorder()),
       flow_graph_(flow_graph),
-      visited_blocks_(new(flow_graph->zone()) BitVector(
-          flow_graph->zone(), flow_graph->reverse_postorder().length())),
+      visited_blocks_(new (flow_graph->zone())
+                          BitVector(flow_graph->zone(),
+                                    flow_graph->reverse_postorder().length())),
       types_(flow_graph->current_ssa_temp_index()),
-      in_worklist_(new(flow_graph->zone()) BitVector(
-          flow_graph->zone(), flow_graph->current_ssa_temp_index())),
+      in_worklist_(new (flow_graph->zone())
+                       BitVector(flow_graph->zone(),
+                                 flow_graph->current_ssa_temp_index())),
       asserts_(NULL),
       collected_asserts_(NULL) {
   for (intptr_t i = 0; i < flow_graph->current_ssa_temp_index(); i++) {
@@ -80,16 +83,14 @@
   while (!worklist_.is_empty()) {
     Definition* def = RemoveLastFromWorklist();
     if (FLAG_support_il_printer && FLAG_trace_type_propagation) {
-      THR_Print("recomputing type of v%" Pd ": %s\n",
-                def->ssa_temp_index(),
+      THR_Print("recomputing type of v%" Pd ": %s\n", def->ssa_temp_index(),
                 def->Type()->ToCString());
     }
     if (def->RecomputeType()) {
       if (FLAG_support_il_printer && FLAG_trace_type_propagation) {
         THR_Print("  ... new type %s\n", def->Type()->ToCString());
       }
-      for (Value::Iterator it(def->input_use_list());
-           !it.Done();
+      for (Value::Iterator it(def->input_use_list()); !it.Done();
            it.Advance()) {
         Instruction* instr = it.Current()->instruction();
 
@@ -216,11 +217,9 @@
   value->SetReachingType(type);
 
   if (FLAG_support_il_printer && FLAG_trace_type_propagation) {
-    THR_Print("reaching type to v%" Pd " for v%" Pd " is %s\n",
-              value->instruction()->IsDefinition() ?
-                  value->instruction()->AsDefinition()->ssa_temp_index() : -1,
-              value->definition()->ssa_temp_index(),
-              type->ToCString());
+    THR_Print("reaching type to %s for v%" Pd " is %s\n",
+              value->instruction()->ToCString(),
+              value->definition()->ssa_temp_index(), type->ToCString());
   }
 }
 
@@ -263,19 +262,32 @@
 }
 
 
+void FlowGraphTypePropagator::VisitInstanceCall(InstanceCallInstr* instr) {
+  if (instr->has_unique_selector()) {
+    SetCid(instr->ArgumentAt(0), instr->ic_data()->GetReceiverClassIdAt(0));
+  }
+}
+
+
+void FlowGraphTypePropagator::VisitPolymorphicInstanceCall(
+    PolymorphicInstanceCallInstr* instr) {
+  if (instr->instance_call()->has_unique_selector()) {
+    SetCid(instr->ArgumentAt(0), instr->ic_data().GetReceiverClassIdAt(0));
+  }
+}
+
+
 void FlowGraphTypePropagator::VisitGuardFieldClass(
     GuardFieldClassInstr* guard) {
   const intptr_t cid = guard->field().guarded_cid();
-  if ((cid == kIllegalCid) ||
-      (cid == kDynamicCid) ||
+  if ((cid == kIllegalCid) || (cid == kDynamicCid) ||
       Field::IsExternalizableCid(cid)) {
     return;
   }
 
   Definition* def = guard->value()->definition();
   CompileType* current = TypeOf(def);
-  if (current->IsNone() ||
-      (current->ToCid() != cid) ||
+  if (current->IsNone() || (current->ToCid() != cid) ||
       (current->is_nullable() && !guard->field().is_nullable())) {
     const bool is_nullable =
         guard->field().is_nullable() && current->is_nullable();
@@ -361,17 +373,14 @@
   if (check->IsCheckSmi()) {
     check_clone =
         new CheckSmiInstr(assert->value()->Copy(zone()),
-                          assert->env()->deopt_id(),
-                          check->token_pos());
+                          assert->env()->deopt_id(), check->token_pos());
     check_clone->AsCheckSmi()->set_licm_hoisted(
         check->AsCheckSmi()->licm_hoisted());
   } else {
     ASSERT(check->IsCheckClass());
-    check_clone =
-        new CheckClassInstr(assert->value()->Copy(zone()),
-                            assert->env()->deopt_id(),
-                            check->AsCheckClass()->unary_checks(),
-                            check->token_pos());
+    check_clone = new CheckClassInstr(
+        assert->value()->Copy(zone()), assert->env()->deopt_id(),
+        check->AsCheckClass()->unary_checks(), check->token_pos());
     check_clone->AsCheckClass()->set_licm_hoisted(
         check->AsCheckClass()->licm_hoisted());
   }
@@ -413,15 +422,15 @@
 
   const AbstractType* compile_type = ToAbstractType();
   const AbstractType* other_compile_type = other->ToAbstractType();
-  if (compile_type->IsMoreSpecificThan(
-          *other_compile_type, NULL, NULL, Heap::kOld)) {
+  if (compile_type->IsMoreSpecificThan(*other_compile_type, NULL, NULL,
+                                       Heap::kOld)) {
     type_ = other_compile_type;
-  } else if (other_compile_type->
-      IsMoreSpecificThan(*compile_type, NULL, NULL, Heap::kOld)) {
-  // Nothing to do.
+  } else if (other_compile_type->IsMoreSpecificThan(*compile_type, NULL, NULL,
+                                                    Heap::kOld)) {
+    // Nothing to do.
   } else {
-  // Can't unify.
-  type_ = &Object::dynamic_type();
+    // Can't unify.
+    type_ = &Object::dynamic_type();
   }
 }
 
@@ -512,7 +521,7 @@
                    thread->isolate()->all_classes_finalized()) {
           if (FLAG_trace_cha) {
             THR_Print("  **(CHA) Compile type not subclassed: %s\n",
-                type_class.ToCString());
+                      type_class.ToCString());
           }
           if (FLAG_use_cha_deopt) {
             cha->AddToGuardedClasses(type_class, /*subclass_count=*/0);
@@ -608,8 +617,8 @@
   // except generative constructors, which return the object being constructed.
   // It is therefore acceptable for void functions to return null.
   if (compile_type.IsNullType()) {
-    *is_instance = is_nullable ||
-        type.IsObjectType() || type.IsDynamicType() || type.IsVoidType();
+    *is_instance = is_nullable || type.IsObjectType() || type.IsDynamicType() ||
+                   type.IsVoidType();
     return true;
   }
 
@@ -664,9 +673,7 @@
   for (intptr_t i = 0; i < InputCount(); i++) {
     if (FLAG_support_il_printer && FLAG_trace_type_propagation) {
       THR_Print("  phi %" Pd " input %" Pd ": v%" Pd " has reaching type %s\n",
-                ssa_temp_index(),
-                i,
-                InputAt(i)->definition()->ssa_temp_index(),
+                ssa_temp_index(), i, InputAt(i)->definition()->ssa_temp_index(),
                 InputAt(i)->Type()->ToCString());
     }
     result.Union(InputAt(i)->Type());
@@ -728,7 +735,8 @@
         return CompileType::FromCid(function.string_specialization_cid());
       case RegExpMacroAssembler::kParamStartOffsetIndex:
         return CompileType::FromCid(kSmiCid);
-      default: UNREACHABLE();
+      default:
+        UNREACHABLE();
     }
     UNREACHABLE();
     return CompileType::Dynamic();
@@ -758,13 +766,14 @@
           if (FLAG_use_cha_deopt ||
               thread->isolate()->all_classes_finalized()) {
             if (FLAG_trace_cha) {
-              THR_Print("  **(CHA) Computing exact type of receiver, "
+              THR_Print(
+                  "  **(CHA) Computing exact type of receiver, "
                   "no subclasses: %s\n",
                   type_class.ToCString());
             }
             if (FLAG_use_cha_deopt) {
-              thread->cha()->AddToGuardedClasses(
-                  type_class, /*subclass_count=*/0);
+              thread->cha()->AddToGuardedClasses(type_class,
+                                                 /*subclass_count=*/0);
             }
             cid = type_class.id();
           }
@@ -795,8 +804,11 @@
   }
 
   if (value().IsInstance()) {
-    return CompileType::Create(cid,
-        AbstractType::ZoneHandle(Instance::Cast(value()).GetType()));
+    // Allocate in old-space since this may be invoked from the
+    // background compiler.
+    return CompileType::Create(
+        cid,
+        AbstractType::ZoneHandle(Instance::Cast(value()).GetType(Heap::kOld)));
   } else {
     // Type info for non-instance objects.
     return CompileType::FromCid(cid);
@@ -868,29 +880,25 @@
 
 
 CompileType CurrentContextInstr::ComputeType() const {
-  return CompileType(CompileType::kNonNullable,
-                     kContextCid,
+  return CompileType(CompileType::kNonNullable, kContextCid,
                      &Object::dynamic_type());
 }
 
 
 CompileType CloneContextInstr::ComputeType() const {
-  return CompileType(CompileType::kNonNullable,
-                     kContextCid,
+  return CompileType(CompileType::kNonNullable, kContextCid,
                      &Object::dynamic_type());
 }
 
 
 CompileType AllocateContextInstr::ComputeType() const {
-  return CompileType(CompileType::kNonNullable,
-                     kContextCid,
+  return CompileType(CompileType::kNonNullable, kContextCid,
                      &Object::dynamic_type());
 }
 
 
 CompileType AllocateUninitializedContextInstr::ComputeType() const {
-  return CompileType(CompileType::kNonNullable,
-                     kContextCid,
+  return CompileType(CompileType::kNonNullable, kContextCid,
                      &Object::dynamic_type());
 }
 
@@ -899,8 +907,8 @@
   if (!HasSingleRecognizedTarget()) return CompileType::Dynamic();
   const Function& target = Function::Handle(ic_data().GetTargetAt(0));
   return (target.recognized_kind() != MethodRecognizer::kUnknown)
-      ? CompileType::FromCid(MethodRecognizer::ResultCid(target))
-      : CompileType::Dynamic();
+             ? CompileType::FromCid(MethodRecognizer::ResultCid(target))
+             : CompileType::Dynamic();
 }
 
 
@@ -914,9 +922,9 @@
     // from the function.
     const AbstractType& result_type =
         AbstractType::ZoneHandle(function().result_type());
-    return CompileType::FromAbstractType(result_type.IsVoidType()
-        ? AbstractType::ZoneHandle(Type::NullType())
-        : result_type);
+    return CompileType::FromAbstractType(
+        result_type.IsVoidType() ? AbstractType::ZoneHandle(Type::NullType())
+                                 : result_type);
   }
 
   return CompileType::Dynamic();
@@ -948,7 +956,7 @@
 
 
 CompileType StringToCharCodeInstr::ComputeType() const {
-    return CompileType::FromCid(kSmiCid);
+  return CompileType::FromCid(kSmiCid);
 }
 
 
@@ -972,8 +980,7 @@
     if (!FLAG_fields_may_be_reset) {
       const Instance& obj = Instance::Handle(field.StaticValue());
       if ((obj.raw() != Object::sentinel().raw()) &&
-          (obj.raw() != Object::transition_sentinel().raw()) &&
-          !obj.IsNull()) {
+          (obj.raw() != Object::transition_sentinel().raw()) && !obj.IsNull()) {
         is_nullable = CompileType::kNonNullable;
         cid = obj.GetClassId();
       }
@@ -998,8 +1005,7 @@
 CompileType AllocateObjectInstr::ComputeType() const {
   if (!closure_function().IsNull()) {
     ASSERT(cls().id() == kClosureCid);
-    return CompileType(CompileType::kNonNullable,
-                       kClosureCid,
+    return CompileType(CompileType::kNonNullable, kClosureCid,
                        &Type::ZoneHandle(closure_function().SignatureType()));
   }
   // TODO(vegorov): Incorporate type arguments into the returned type.
@@ -1029,13 +1035,14 @@
   if (Isolate::Current()->type_checks() &&
       (type().IsFunctionType() ||
        (type().HasResolvedTypeClass() &&
-       !Field::IsExternalizableCid(Class::Handle(type().type_class()).id())))) {
+        !Field::IsExternalizableCid(
+            Class::Handle(type().type_class()).id())))) {
     abstract_type = &type();
   }
 
   if ((field_ != NULL) && (field_->guarded_cid() != kIllegalCid)) {
     bool is_nullable = field_->is_nullable();
-    intptr_t field_cid =  field_->guarded_cid();
+    intptr_t field_cid = field_->guarded_cid();
     if (Field::IsExternalizableCid(field_cid)) {
       // We cannot assume that the type of the value in the field has not
       // changed on the fly.
@@ -1136,6 +1143,11 @@
 }
 
 
+CompileType DoubleTestOpInstr::ComputeType() const {
+  return CompileType::FromCid(kBoolCid);
+}
+
+
 CompileType BinaryFloat32x4OpInstr::ComputeType() const {
   return CompileType::FromCid(kFloat32x4Cid);
 }
diff --git a/runtime/vm/flow_graph_type_propagator.h b/runtime/vm/flow_graph_type_propagator.h
index 7a5e87e..0e23e5e 100644
--- a/runtime/vm/flow_graph_type_propagator.h
+++ b/runtime/vm/flow_graph_type_propagator.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_FLOW_GRAPH_TYPE_PROPAGATOR_H_
-#define VM_FLOW_GRAPH_TYPE_PROPAGATOR_H_
+#ifndef RUNTIME_VM_FLOW_GRAPH_TYPE_PROPAGATOR_H_
+#define RUNTIME_VM_FLOW_GRAPH_TYPE_PROPAGATOR_H_
 
 #include "vm/flow_graph.h"
 #include "vm/intermediate_language.h"
@@ -32,6 +32,9 @@
   virtual void VisitCheckClassId(CheckClassIdInstr* instr);
   virtual void VisitGuardFieldClass(GuardFieldClassInstr* instr);
   virtual void VisitAssertAssignable(AssertAssignableInstr* instr);
+  virtual void VisitInstanceCall(InstanceCallInstr* instr);
+  virtual void VisitPolymorphicInstanceCall(
+      PolymorphicInstanceCallInstr* instr);
 
   // Current reaching type of the definition. Valid only during dominator tree
   // traversal.
@@ -74,13 +77,10 @@
   class RollbackEntry {
    public:
     // Default constructor needed for the container.
-    RollbackEntry()
-        : index_(), type_() {
-    }
+    RollbackEntry() : index_(), type_() {}
 
     RollbackEntry(intptr_t index, CompileType* type)
-        : index_(index), type_(type) {
-    }
+        : index_(index), type_(type) {}
 
     intptr_t index() const { return index_; }
     CompileType* type() const { return type_; }
@@ -95,4 +95,4 @@
 
 }  // namespace dart
 
-#endif  // VM_FLOW_GRAPH_TYPE_PROPAGATOR_H_
+#endif  // RUNTIME_VM_FLOW_GRAPH_TYPE_PROPAGATOR_H_
diff --git a/runtime/vm/freelist.cc b/runtime/vm/freelist.cc
index ceae578..cdb83fa 100644
--- a/runtime/vm/freelist.cc
+++ b/runtime/vm/freelist.cc
@@ -77,10 +77,8 @@
   if ((index != kNumLists) && free_map_.Test(index)) {
     FreeListElement* element = DequeueElement(index);
     if (is_protected) {
-      bool status =
-          VirtualMemory::Protect(reinterpret_cast<void*>(element),
-                                 size,
-                                 VirtualMemory::kReadWrite);
+      bool status = VirtualMemory::Protect(reinterpret_cast<void*>(element),
+                                           size, VirtualMemory::kReadWrite);
       ASSERT(status);
     }
     return reinterpret_cast<uword>(element);
@@ -103,8 +101,7 @@
             size + FreeListElement::HeaderSizeFor(remainder_size);
         bool status =
             VirtualMemory::Protect(reinterpret_cast<void*>(element),
-                                   region_size,
-                                   VirtualMemory::kReadWrite);
+                                   region_size, VirtualMemory::kReadWrite);
         ASSERT(status);
       }
       SplitElementAfterAndEnqueue(element, size, is_protected);
@@ -127,8 +124,7 @@
         // the call to SplitElementAfterAndEnqueue.
         bool status =
             VirtualMemory::Protect(reinterpret_cast<void*>(current),
-                                   region_size,
-                                   VirtualMemory::kReadWrite);
+                                   region_size, VirtualMemory::kReadWrite);
         ASSERT(status);
       }
 
@@ -151,16 +147,14 @@
         if (target_is_protected) {
           bool status =
               VirtualMemory::Protect(reinterpret_cast<void*>(target_address),
-                                     kWordSize,
-                                     VirtualMemory::kReadWrite);
+                                     kWordSize, VirtualMemory::kReadWrite);
           ASSERT(status);
         }
         previous->set_next(current->next());
         if (target_is_protected) {
           bool status =
               VirtualMemory::Protect(reinterpret_cast<void*>(target_address),
-                                     kWordSize,
-                                     VirtualMemory::kReadExecute);
+                                     kWordSize, VirtualMemory::kReadExecute);
           ASSERT(status);
         }
       }
@@ -220,8 +214,8 @@
   FreeListElement* next = free_lists_[index];
   if (next == NULL && index != kNumLists) {
     free_map_.Set(index, true);
-    last_free_small_size_ = Utils::Maximum(last_free_small_size_,
-                                           index << kObjectAlignmentLog2);
+    last_free_small_size_ =
+        Utils::Maximum(last_free_small_size_, index << kObjectAlignmentLog2);
   }
   element->set_next(next);
   free_lists_[index] = element;
@@ -273,13 +267,12 @@
     small_objects += list_length;
     intptr_t list_bytes = list_length * i * kObjectAlignment;
     small_bytes += list_bytes;
-    OS::Print("small %3d [%8d bytes] : "
-              "%8" Pd " objs; %8.1f KB; %8.1f cum KB\n",
-              i,
-              i * kObjectAlignment,
-              list_length,
-              list_bytes / static_cast<double>(KB),
-              small_bytes / static_cast<double>(KB));
+    OS::Print(
+        "small %3d [%8d bytes] : "
+        "%8" Pd " objs; %8.1f KB; %8.1f cum KB\n",
+        i, i * kObjectAlignment, list_length,
+        list_bytes / static_cast<double>(KB),
+        small_bytes / static_cast<double>(KB));
   }
 }
 
@@ -333,11 +326,10 @@
     intptr_t list_length = pair->second();
     intptr_t list_bytes = list_length * size;
     large_bytes += list_bytes;
-    OS::Print("large %3" Pd " [%8" Pd " bytes] : "
+    OS::Print("large %3" Pd " [%8" Pd
+              " bytes] : "
               "%8" Pd " objs; %8.1f KB; %8.1f cum KB\n",
-              size / kObjectAlignment,
-              size,
-              list_length,
+              size / kObjectAlignment, size, list_length,
               list_bytes / static_cast<double>(KB),
               large_bytes / static_cast<double>(KB));
   }
@@ -373,8 +365,7 @@
       !VirtualMemory::InSamePage(remainder_address - 1, remainder_address)) {
     bool status =
         VirtualMemory::Protect(reinterpret_cast<void*>(remainder_address),
-                               remainder_size,
-                               VirtualMemory::kReadExecute);
+                               remainder_size, VirtualMemory::kReadExecute);
     ASSERT(status);
   }
 }
diff --git a/runtime/vm/freelist.h b/runtime/vm/freelist.h
index 975e50c..068c4e2 100644
--- a/runtime/vm/freelist.h
+++ b/runtime/vm/freelist.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_FREELIST_H_
-#define VM_FREELIST_H_
+#ifndef RUNTIME_VM_FREELIST_H_
+#define RUNTIME_VM_FREELIST_H_
 
 #include "platform/assert.h"
 #include "vm/allocation.h"
@@ -22,16 +22,10 @@
 // A FreeListElement never has its header mark bit set.
 class FreeListElement {
  public:
-  FreeListElement* next() const {
-    return next_;
-  }
-  uword next_address() const {
-    return reinterpret_cast<uword>(&next_);
-  }
+  FreeListElement* next() const { return next_; }
+  uword next_address() const { return reinterpret_cast<uword>(&next_); }
 
-  void set_next(FreeListElement* next) {
-    next_ = next;
-  }
+  void set_next(FreeListElement* next) { next_ = next; }
 
   intptr_t Size() {
     intptr_t size = RawObject::SizeTag::decode(tags_);
@@ -48,7 +42,7 @@
   // Used to allocate class for free list elements in Object::InitOnce.
   class FakeInstance {
    public:
-    FakeInstance() { }
+    FakeInstance() {}
     static cpp_vtable vtable() { return 0; }
     static intptr_t InstanceSize() { return 0; }
     static intptr_t NextFieldOffset() { return -kWordSize; }
@@ -134,4 +128,4 @@
 
 }  // namespace dart
 
-#endif  // VM_FREELIST_H_
+#endif  // RUNTIME_VM_FREELIST_H_
diff --git a/runtime/vm/freelist_test.cc b/runtime/vm/freelist_test.cc
index 1945a30..2d0aab9 100644
--- a/runtime/vm/freelist_test.cc
+++ b/runtime/vm/freelist_test.cc
@@ -11,8 +11,7 @@
 static uword Allocate(FreeList* free_list, intptr_t size, bool is_protected) {
   uword result = free_list->TryAllocate(size, is_protected);
   if (result && is_protected) {
-    bool status = VirtualMemory::Protect(reinterpret_cast<void*>(result),
-                                         size,
+    bool status = VirtualMemory::Protect(reinterpret_cast<void*>(result), size,
                                          VirtualMemory::kReadExecute);
     ASSERT(status);
   }
@@ -25,15 +24,13 @@
                  intptr_t size,
                  bool is_protected) {
   if (is_protected) {
-    bool status = VirtualMemory::Protect(reinterpret_cast<void*>(address),
-                                         size,
+    bool status = VirtualMemory::Protect(reinterpret_cast<void*>(address), size,
                                          VirtualMemory::kReadWrite);
     ASSERT(status);
   }
   free_list->Free(address, size);
   if (is_protected) {
-    bool status = VirtualMemory::Protect(reinterpret_cast<void*>(address),
-                                         size,
+    bool status = VirtualMemory::Protect(reinterpret_cast<void*>(address), size,
                                          VirtualMemory::kReadExecute);
     ASSERT(status);
   }
@@ -133,9 +130,7 @@
 
   // Allocate small objects.
   for (intptr_t i = 0; i < blob->size() / kObjectSize; i++) {
-    objects[i] = Allocate(free_list,
-                          kObjectSize,
-                          true);  // is_protected
+    objects[i] = Allocate(free_list, kObjectSize, true);  // is_protected
   }
 
   // All space is occupied. Expect failed allocation.
diff --git a/runtime/vm/gc_marker.cc b/runtime/vm/gc_marker.cc
index ed6d4da..86c5ae3 100644
--- a/runtime/vm/gc_marker.cc
+++ b/runtime/vm/gc_marker.cc
@@ -25,9 +25,7 @@
  public:
   SkippedCodeFunctions() {}
 
-  void Add(RawFunction* func) {
-    skipped_code_functions_.Add(func);
-  }
+  void Add(RawFunction* func) { skipped_code_functions_.Add(func); }
 
   void DetachCode() {
 #if defined(DART_PRECOMPILED_RUNTIME)
@@ -42,9 +40,8 @@
         // If the code wasn't strongly visited through other references
         // after skipping the function's code pointer, then we disconnect the
         // code from the function.
-        func->StorePointer(
-            &(func->ptr()->code_),
-            StubCode::LazyCompile_entry()->code());
+        func->StorePointer(&(func->ptr()->code_),
+                           StubCode::LazyCompile_entry()->code());
         uword entry_point = StubCode::LazyCompile_entry()->EntryPoint();
         func->ptr()->entry_point_ = entry_point;
         if (FLAG_log_code_drop) {
@@ -141,14 +138,14 @@
 };
 
 
-template<bool sync>
+template <bool sync>
 class MarkingVisitorBase : public ObjectPointerVisitor {
  public:
   MarkingVisitorBase(Isolate* isolate,
-                 Heap* heap,
-                 PageSpace* page_space,
-                 MarkingStack* marking_stack,
-                 SkippedCodeFunctions* skipped_code_functions)
+                     Heap* heap,
+                     PageSpace* page_space,
+                     MarkingStack* marking_stack,
+                     SkippedCodeFunctions* skipped_code_functions)
       : ObjectPointerVisitor(isolate),
         thread_(Thread::Current()),
         heap_(heap),
@@ -177,9 +174,7 @@
     return class_stats_count_[class_id];
   }
 
-  intptr_t live_size(intptr_t class_id) {
-    return class_stats_size_[class_id];
-  }
+  intptr_t live_size(intptr_t class_id) { return class_stats_size_[class_id]; }
 
   bool ProcessPendingWeakProperties() {
     bool marked = false;
@@ -250,9 +245,7 @@
     }
   }
 
-  bool visit_function_code() const {
-    return skipped_code_functions_ == NULL;
-  }
+  bool visit_function_code() const { return skipped_code_functions_ == NULL; }
 
   virtual void add_skipped_code_function(RawFunction* func) {
     ASSERT(!visit_function_code());
@@ -272,8 +265,7 @@
   intptr_t ProcessWeakProperty(RawWeakProperty* raw_weak) {
     // The fate of the weak property is determined by its key.
     RawObject* raw_key = raw_weak->ptr()->key_;
-    if (raw_key->IsHeapObject() &&
-        raw_key->IsOldObject() &&
+    if (raw_key->IsHeapObject() && raw_key->IsOldObject() &&
         !raw_key->IsMarked()) {
       // Key was white. Enqueue the weak property.
       EnqueueWeakProperty(raw_weak);
@@ -313,9 +305,9 @@
  private:
   void PushMarked(RawObject* raw_obj) {
     ASSERT(raw_obj->IsHeapObject());
-    ASSERT((FLAG_verify_before_gc || FLAG_verify_before_gc) ?
-           page_space_->Contains(RawObject::ToAddr(raw_obj)) :
-           true);
+    ASSERT((FLAG_verify_before_gc || FLAG_verify_before_gc)
+               ? page_space_->Contains(RawObject::ToAddr(raw_obj))
+               : true);
 
     // Push the marked object on the marking stack.
     ASSERT(raw_obj->IsMarked());
@@ -438,8 +430,8 @@
 
 class MarkingWeakVisitor : public HandleVisitor {
  public:
-  MarkingWeakVisitor(Thread* thread, FinalizationQueue* queue) :
-      HandleVisitor(thread), queue_(queue) { }
+  MarkingWeakVisitor(Thread* thread, FinalizationQueue* queue)
+      : HandleVisitor(thread), queue_(queue) {}
 
   void VisitHandle(uword addr) {
     FinalizablePersistentHandle* handle =
@@ -476,7 +468,8 @@
 
 void GCMarker::IterateRoots(Isolate* isolate,
                             ObjectPointerVisitor* visitor,
-                            intptr_t slice_index, intptr_t num_slices) {
+                            intptr_t slice_index,
+                            intptr_t num_slices) {
   ASSERT(0 <= slice_index && slice_index < num_slices);
   if ((slice_index == 0) || (num_slices <= 1)) {
     isolate->VisitObjectPointers(visitor,
@@ -499,11 +492,9 @@
 
 
 void GCMarker::ProcessWeakTables(PageSpace* page_space) {
-  for (int sel = 0;
-       sel < Heap::kNumWeakSelectors;
-       sel++) {
-    WeakTable* table = heap_->GetWeakTable(
-        Heap::kOld, static_cast<Heap::WeakSelector>(sel));
+  for (int sel = 0; sel < Heap::kNumWeakSelectors; sel++) {
+    WeakTable* table =
+        heap_->GetWeakTable(Heap::kOld, static_cast<Heap::WeakSelector>(sel));
     intptr_t size = table->size();
     for (intptr_t i = 0; i < size; i++) {
       if (table->IsValidEntryAt(i)) {
@@ -520,8 +511,8 @@
 
 class ObjectIdRingClearPointerVisitor : public ObjectPointerVisitor {
  public:
-  explicit ObjectIdRingClearPointerVisitor(Isolate* isolate) :
-      ObjectPointerVisitor(isolate) {}
+  explicit ObjectIdRingClearPointerVisitor(Isolate* isolate)
+      : ObjectPointerVisitor(isolate) {}
 
 
   void VisitPointers(RawObject** first, RawObject** last) {
@@ -571,8 +562,7 @@
         collect_code_(collect_code),
         task_index_(task_index),
         num_tasks_(num_tasks),
-        num_busy_(num_busy) {
-  }
+        num_busy_(num_busy) {}
 
   virtual void Run() {
     bool result =
@@ -584,7 +574,7 @@
       StackZone stack_zone(thread);
       Zone* zone = stack_zone.GetZone();
       SkippedCodeFunctions* skipped_code_functions =
-          collect_code_ ? new(zone) SkippedCodeFunctions() : NULL;
+          collect_code_ ? new (zone) SkippedCodeFunctions() : NULL;
       SyncMarkingVisitor visitor(isolate_, heap_, page_space_, marking_stack_,
                                  skipped_code_functions);
       // Phase 1: Iterate over roots and drain marking stack in tasks.
@@ -648,8 +638,8 @@
 
       // Phase 3: Finalize results from all markers (detach code, etc.).
       if (FLAG_log_marker_tasks) {
-        THR_Print("Task %" Pd " marked %" Pd " bytes.\n",
-                  task_index_, visitor.marked_bytes());
+        THR_Print("Task %" Pd " marked %" Pd " bytes.\n", task_index_,
+                  visitor.marked_bytes());
       }
       marker_->FinalizeResultsFrom(&visitor);
     }
@@ -675,12 +665,12 @@
 };
 
 
-template<class MarkingVisitorType>
+template <class MarkingVisitorType>
 void GCMarker::FinalizeResultsFrom(MarkingVisitorType* visitor) {
-#ifndef PRODUCT
   {
     MutexLocker ml(&stats_mutex_);
     marked_bytes_ += visitor->marked_bytes();
+#ifndef PRODUCT
     // Class heap stats are not themselves thread-safe yet, so we update the
     // stats while holding stats_mutex_.
     ClassTable* table = heap_->isolate()->class_table();
@@ -691,8 +681,8 @@
         table->UpdateLiveOld(i, size, count);
       }
     }
-  }
 #endif  // !PRODUCT
+  }
   visitor->Finalize();
 }
 
@@ -714,7 +704,7 @@
     if (num_tasks == 0) {
       // Mark everything on main thread.
       SkippedCodeFunctions* skipped_code_functions =
-          collect_code ? new(zone) SkippedCodeFunctions() : NULL;
+          collect_code ? new (zone) SkippedCodeFunctions() : NULL;
       UnsyncMarkingVisitor mark(isolate, heap_, page_space, &marking_stack,
                                 skipped_code_functions);
       IterateRoots(isolate, &mark, 0, 1);
@@ -738,8 +728,7 @@
       // All marking done; detach code, etc.
       FinalizeResultsFrom(&mark);
     } else {
-      ThreadBarrier barrier(num_tasks + 1,
-                            heap_->barrier(),
+      ThreadBarrier barrier(num_tasks + 1, heap_->barrier(),
                             heap_->barrier_done());
       // Used to coordinate draining among tasks; all start out as 'busy'.
       uintptr_t num_busy = num_tasks;
@@ -747,8 +736,7 @@
       for (intptr_t i = 0; i < num_tasks; ++i) {
         MarkTask* mark_task =
             new MarkTask(this, isolate, heap_, page_space, &marking_stack,
-                         &barrier, collect_code,
-                         i, num_tasks, &num_busy);
+                         &barrier, collect_code, i, num_tasks, &num_busy);
         ThreadPool* pool = Dart::thread_pool();
         pool->Run(mark_task);
       }
diff --git a/runtime/vm/gc_marker.h b/runtime/vm/gc_marker.h
index f1e473a..ace01c4 100644
--- a/runtime/vm/gc_marker.h
+++ b/runtime/vm/gc_marker.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_GC_MARKER_H_
-#define VM_GC_MARKER_H_
+#ifndef RUNTIME_VM_GC_MARKER_H_
+#define RUNTIME_VM_GC_MARKER_H_
 
 #include "vm/allocation.h"
 #include "vm/os_thread.h"  // Mutex.
@@ -22,9 +22,8 @@
 // of the mark-sweep collection. The marking bit used is defined in RawObject.
 class GCMarker : public ValueObject {
  public:
-  explicit GCMarker(Heap* heap)
-      : heap_(heap), marked_bytes_(0) { }
-  ~GCMarker() { }
+  explicit GCMarker(Heap* heap) : heap_(heap), marked_bytes_(0) {}
+  ~GCMarker() {}
 
   void MarkObjects(Isolate* isolate,
                    PageSpace* page_space,
@@ -38,15 +37,16 @@
   void Epilogue(Isolate* isolate, bool invoke_api_callbacks);
   void IterateRoots(Isolate* isolate,
                     ObjectPointerVisitor* visitor,
-                    intptr_t slice_index, intptr_t num_slices);
+                    intptr_t slice_index,
+                    intptr_t num_slices);
   void IterateWeakRoots(Isolate* isolate, HandleVisitor* visitor);
-  template<class MarkingVisitorType>
+  template <class MarkingVisitorType>
   void IterateWeakReferences(Isolate* isolate, MarkingVisitorType* visitor);
   void ProcessWeakTables(PageSpace* page_space);
   void ProcessObjectIdTable(Isolate* isolate);
 
   // Called by anyone: finalize and accumulate stats from 'visitor'.
-  template<class MarkingVisitorType>
+  template <class MarkingVisitorType>
   void FinalizeResultsFrom(MarkingVisitorType* visitor);
 
   Heap* heap_;
@@ -61,4 +61,4 @@
 
 }  // namespace dart
 
-#endif  // VM_GC_MARKER_H_
+#endif  // RUNTIME_VM_GC_MARKER_H_
diff --git a/runtime/vm/gc_sweeper.cc b/runtime/vm/gc_sweeper.cc
index 40ee3db..f779b49 100644
--- a/runtime/vm/gc_sweeper.cc
+++ b/runtime/vm/gc_sweeper.cc
@@ -114,8 +114,8 @@
   }
 
   virtual void Run() {
-    bool result = Thread::EnterIsolateAsHelper(task_isolate_,
-                                               Thread::kSweeperTask);
+    bool result =
+        Thread::EnterIsolateAsHelper(task_isolate_, Thread::kSweeperTask);
     ASSERT(result);
     {
       Thread* thread = Thread::Current();
@@ -168,11 +168,8 @@
                                 HeapPage* first,
                                 HeapPage* last,
                                 FreeList* freelist) {
-  SweeperTask* task =
-      new SweeperTask(isolate,
-                      isolate->heap()->old_space(),
-                      first, last,
-                      freelist);
+  SweeperTask* task = new SweeperTask(isolate, isolate->heap()->old_space(),
+                                      first, last, freelist);
   ThreadPool* pool = Dart::thread_pool();
   pool->Run(task);
 }
diff --git a/runtime/vm/gc_sweeper.h b/runtime/vm/gc_sweeper.h
index b2b8317..ba9aaef 100644
--- a/runtime/vm/gc_sweeper.h
+++ b/runtime/vm/gc_sweeper.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_GC_SWEEPER_H_
-#define VM_GC_SWEEPER_H_
+#ifndef RUNTIME_VM_GC_SWEEPER_H_
+#define RUNTIME_VM_GC_SWEEPER_H_
 
 #include "vm/globals.h"
 
@@ -43,4 +43,4 @@
 
 }  // namespace dart
 
-#endif  // VM_GC_SWEEPER_H_
+#endif  // RUNTIME_VM_GC_SWEEPER_H_
diff --git a/runtime/vm/globals.h b/runtime/vm/globals.h
index 9fd69e2..39743c5 100644
--- a/runtime/vm/globals.h
+++ b/runtime/vm/globals.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_GLOBALS_H_
-#define VM_GLOBALS_H_
+#ifndef RUNTIME_VM_GLOBALS_H_
+#define RUNTIME_VM_GLOBALS_H_
 
 // This file contains global definitions for the VM library only. Anything that
 // is more globally useful should be added to 'vm/globals.h'.
@@ -25,12 +25,12 @@
 // N=30 (32-bit build) or N=62 (64-bit build).
 const intptr_t kSmiBits = kBitsPerWord - 2;
 const intptr_t kSmiMax = (static_cast<intptr_t>(1) << kSmiBits) - 1;
-const intptr_t kSmiMin =  -(static_cast<intptr_t>(1) << kSmiBits);
+const intptr_t kSmiMin = -(static_cast<intptr_t>(1) << kSmiBits);
 
 // Hard coded from above but for 32-bit architectures.
 const intptr_t kSmiBits32 = kBitsPerInt32 - 2;
 const intptr_t kSmiMax32 = (static_cast<intptr_t>(1) << kSmiBits32) - 1;
-const intptr_t kSmiMin32 =  -(static_cast<intptr_t>(1) << kSmiBits32);
+const intptr_t kSmiMin32 = -(static_cast<intptr_t>(1) << kSmiBits32);
 
 #define kPosInfinity bit_cast<double>(DART_UINT64_C(0x7ff0000000000000))
 #define kNegInfinity bit_cast<double>(DART_UINT64_C(0xfff0000000000000))
@@ -39,9 +39,9 @@
 // size_t which represents the number of elements of the given
 // array. You should only use ARRAY_SIZE on statically allocated
 // arrays.
-#define ARRAY_SIZE(array)                                       \
-  ((sizeof(array) / sizeof(*(array))) /                         \
-  static_cast<intptr_t>(!(sizeof(array) % sizeof(*(array)))))
+#define ARRAY_SIZE(array)                                                      \
+  ((sizeof(array) / sizeof(*(array))) /                                        \
+   static_cast<intptr_t>(!(sizeof(array) % sizeof(*(array)))))  // NOLINT
 
 
 // The expression OFFSET_OF(type, field) computes the byte-offset of
@@ -56,12 +56,14 @@
 const intptr_t kOffsetOfPtr = 32;
 
 #define OFFSET_OF(type, field)                                                 \
-  (reinterpret_cast<intptr_t>(&(reinterpret_cast<type*>(kOffsetOfPtr)->field)) \
-      - kOffsetOfPtr)
+  (reinterpret_cast<intptr_t>(                                                 \
+       &(reinterpret_cast<type*>(kOffsetOfPtr)->field)) -                      \
+   kOffsetOfPtr)  // NOLINT
 
 #define OFFSET_OF_RETURNED_VALUE(type, accessor)                               \
   (reinterpret_cast<intptr_t>(                                                 \
-      (reinterpret_cast<type*>(kOffsetOfPtr)->accessor())) - kOffsetOfPtr)
+       (reinterpret_cast<type*>(kOffsetOfPtr)->accessor())) -                  \
+   kOffsetOfPtr)  // NOLINT
 
 #define OPEN_ARRAY_START(type, align)                                          \
   do {                                                                         \
@@ -98,10 +100,16 @@
 // Macros to get the contents of the fp register.
 #if defined(TARGET_OS_WINDOWS)
 
+// clang-format off
 #if defined(HOST_ARCH_IA32)
-#define COPY_FP_REGISTER(fp) __asm { mov fp, ebp };  // NOLINT
+#define COPY_FP_REGISTER(fp)                                                   \
+  __asm { mov fp, ebp}                                                         \
+  ;  // NOLINT
+// clang-format on
 #elif defined(HOST_ARCH_X64)
-#define COPY_FP_REGISTER(fp) UNIMPLEMENTED();
+// We don't have the asm equivalent to get at the frame pointer on
+// windows x64, return the stack pointer instead.
+#define COPY_FP_REGISTER(fp) fp = Thread::GetCurrentStackPointer();
 #else
 #error Unknown host architecture.
 #endif
@@ -110,19 +118,19 @@
 
 // Assume GCC-like inline syntax is valid.
 #if defined(HOST_ARCH_IA32)
-#define COPY_FP_REGISTER(fp) asm volatile ("movl %%ebp, %0" : "=r" (fp) );
+#define COPY_FP_REGISTER(fp) asm volatile("movl %%ebp, %0" : "=r"(fp));
 #elif defined(HOST_ARCH_X64)
-#define COPY_FP_REGISTER(fp) asm volatile ("movq %%rbp, %0" : "=r" (fp) );
+#define COPY_FP_REGISTER(fp) asm volatile("movq %%rbp, %0" : "=r"(fp));
 #elif defined(HOST_ARCH_ARM)
-#  if defined(TARGET_OS_MAC)
-#define COPY_FP_REGISTER(fp) asm volatile ("mov %0, r7" : "=r" (fp) );
-#  else
-#define COPY_FP_REGISTER(fp) asm volatile ("mov %0, r11" : "=r" (fp) );
-#  endif
+#if defined(TARGET_OS_MAC)
+#define COPY_FP_REGISTER(fp) asm volatile("mov %0, r7" : "=r"(fp));
+#else
+#define COPY_FP_REGISTER(fp) asm volatile("mov %0, r11" : "=r"(fp));
+#endif
 #elif defined(HOST_ARCH_ARM64)
-#define COPY_FP_REGISTER(fp) asm volatile ("mov %0, x29" : "=r" (fp) );
+#define COPY_FP_REGISTER(fp) asm volatile("mov %0, x29" : "=r"(fp));
 #elif defined(HOST_ARCH_MIPS)
-#define COPY_FP_REGISTER(fp) asm volatile ("move %0, $fp" : "=r" (fp) );
+#define COPY_FP_REGISTER(fp) asm volatile("move %0, $fp" : "=r"(fp));
 #else
 #error Unknown host architecture.
 #endif
@@ -130,6 +138,13 @@
 
 #endif  // !defined(TARGET_OS_WINDOWS))
 
+// Default value for flag --use-corelib-source-files.
+#if defined(TARGET_OS_WINDOWS)
+static const bool kDefaultCorelibSourceFlag = true;
+#else
+static const bool kDefaultCorelibSourceFlag = false;
+#endif  // defined(TARGET_OS_WINDOWS)
+
 }  // namespace dart
 
-#endif  // VM_GLOBALS_H_
+#endif  // RUNTIME_VM_GLOBALS_H_
diff --git a/runtime/vm/growable_array.h b/runtime/vm/growable_array.h
index 42b787b..b2d03e0 100644
--- a/runtime/vm/growable_array.h
+++ b/runtime/vm/growable_array.h
@@ -7,8 +7,8 @@
 // - MallocGrowableArray: allocates using malloc/realloc; free is only called
 //   at destruction.
 
-#ifndef VM_GROWABLE_ARRAY_H_
-#define VM_GROWABLE_ARRAY_H_
+#ifndef RUNTIME_VM_GROWABLE_ARRAY_H_
+#define RUNTIME_VM_GROWABLE_ARRAY_H_
 
 #include "platform/utils.h"
 #include "vm/allocation.h"
@@ -17,7 +17,7 @@
 
 namespace dart {
 
-template<typename T, typename B, typename Allocator = Zone>
+template <typename T, typename B, typename Allocator = Zone>
 class BaseGrowableArray : public B {
  public:
   explicit BaseGrowableArray(Allocator* allocator)
@@ -31,9 +31,7 @@
     }
   }
 
-  ~BaseGrowableArray() {
-    allocator_->template Free<T>(data_, capacity_);
-  }
+  ~BaseGrowableArray() { allocator_->template Free<T>(data_, capacity_); }
 
   intptr_t length() const { return length_; }
   T* data() const { return data_; }
@@ -63,9 +61,7 @@
     return data_[index];
   }
 
-  const T& At(intptr_t index) const {
-    return operator[](index);
-  }
+  const T& At(intptr_t index) const { return operator[](index); }
 
   T& Last() const {
     ASSERT(length_ > 0);
@@ -78,9 +74,7 @@
     }
   }
 
-  void Clear() {
-    length_ = 0;
-  }
+  void Clear() { length_ = 0; }
 
   void InsertAt(intptr_t idx, const T& value) {
     Resize(length() + 1);
@@ -140,15 +134,15 @@
 };
 
 
-template<typename T, typename B, typename Allocator>
-inline void BaseGrowableArray<T, B, Allocator>::Sort(
-    int compare(const T*, const T*)) {
+template <typename T, typename B, typename Allocator>
+inline void BaseGrowableArray<T, B, Allocator>::Sort(int compare(const T*,
+                                                                 const T*)) {
   typedef int (*CompareFunction)(const void*, const void*);
   qsort(data_, length_, sizeof(T), reinterpret_cast<CompareFunction>(compare));
 }
 
 
-template<typename T, typename B, typename Allocator>
+template <typename T, typename B, typename Allocator>
 void BaseGrowableArray<T, B, Allocator>::Resize(intptr_t new_length) {
   if (new_length > capacity_) {
     intptr_t new_capacity = Utils::RoundUpToPowerOfTwo(new_length);
@@ -162,7 +156,7 @@
 }
 
 
-template<typename T, typename B, typename Allocator>
+template <typename T, typename B, typename Allocator>
 void BaseGrowableArray<T, B, Allocator>::SetLength(intptr_t new_length) {
   if (new_length > capacity_) {
     T* new_data = allocator_->template Alloc<T>(new_length);
@@ -174,57 +168,51 @@
 }
 
 
-template<typename T>
+template <typename T>
 class GrowableArray : public BaseGrowableArray<T, ValueObject> {
  public:
   GrowableArray(Zone* zone, intptr_t initial_capacity)
-      : BaseGrowableArray<T, ValueObject>(
-          initial_capacity, ASSERT_NOTNULL(zone)) {}
+      : BaseGrowableArray<T, ValueObject>(initial_capacity,
+                                          ASSERT_NOTNULL(zone)) {}
   explicit GrowableArray(intptr_t initial_capacity)
       : BaseGrowableArray<T, ValueObject>(
-          initial_capacity,
-          ASSERT_NOTNULL(Thread::Current()->zone())) {}
+            initial_capacity,
+            ASSERT_NOTNULL(Thread::Current()->zone())) {}
   GrowableArray()
       : BaseGrowableArray<T, ValueObject>(
-          ASSERT_NOTNULL(Thread::Current()->zone())) {}
+            ASSERT_NOTNULL(Thread::Current()->zone())) {}
 };
 
 
-template<typename T>
+template <typename T>
 class ZoneGrowableArray : public BaseGrowableArray<T, ZoneAllocated> {
  public:
   ZoneGrowableArray(Zone* zone, intptr_t initial_capacity)
-      : BaseGrowableArray<T, ZoneAllocated>(
-          initial_capacity, ASSERT_NOTNULL(zone)) {}
+      : BaseGrowableArray<T, ZoneAllocated>(initial_capacity,
+                                            ASSERT_NOTNULL(zone)) {}
   explicit ZoneGrowableArray(intptr_t initial_capacity)
       : BaseGrowableArray<T, ZoneAllocated>(
-          initial_capacity,
-          ASSERT_NOTNULL(Thread::Current()->zone())) {}
+            initial_capacity,
+            ASSERT_NOTNULL(Thread::Current()->zone())) {}
   ZoneGrowableArray()
       : BaseGrowableArray<T, ZoneAllocated>(
-          ASSERT_NOTNULL(Thread::Current()->zone())) {}
+            ASSERT_NOTNULL(Thread::Current()->zone())) {}
 };
 
 
 // T must be a Handle type.
-template<typename T, typename B>
+template <typename T, typename B>
 class BaseGrowableHandlePtrArray : public B {
  public:
   BaseGrowableHandlePtrArray(Zone* zone, intptr_t initial_capacity)
       : zone_(zone), array_(zone, initial_capacity) {}
 
   // Use unique zone handles to store objects.
-  void Add(const T& t) {
-    array_.Add(&T::ZoneHandle(zone_, t.raw()));
-  }
+  void Add(const T& t) { array_.Add(&T::ZoneHandle(zone_, t.raw())); }
 
-  T& operator[](intptr_t index) const {
-    return *array_[index];
-  }
+  T& operator[](intptr_t index) const { return *array_[index]; }
 
-  const T& At(intptr_t index) const {
-    return operator[](index);
-  }
+  const T& At(intptr_t index) const { return operator[](index); }
 
   void SetAt(intptr_t index, const T& t) {
     array_[index] = &T::ZoneHandle(zone_, t.raw());
@@ -242,25 +230,24 @@
 };
 
 
-template<typename T>
-class GrowableHandlePtrArray :
-    public BaseGrowableHandlePtrArray<T, ValueObject> {
+template <typename T>
+class GrowableHandlePtrArray
+    : public BaseGrowableHandlePtrArray<T, ValueObject> {
  public:
   GrowableHandlePtrArray(Zone* zone, intptr_t initial_capacity)
       : BaseGrowableHandlePtrArray<T, ValueObject>(zone, initial_capacity) {}
 };
 
 
-template<typename T>
-class ZoneGrowableHandlePtrArray :
-    public BaseGrowableHandlePtrArray<T, ZoneAllocated> {
+template <typename T>
+class ZoneGrowableHandlePtrArray
+    : public BaseGrowableHandlePtrArray<T, ZoneAllocated> {
  public:
   ZoneGrowableHandlePtrArray(Zone* zone, intptr_t initial_capacity)
       : BaseGrowableHandlePtrArray<T, ZoneAllocated>(zone, initial_capacity) {}
 };
 
 
-
 class Malloc : public AllStatic {
  public:
   template <class T>
@@ -283,15 +270,14 @@
 class EmptyBase {};
 
 
-template<typename T>
+template <typename T>
 class MallocGrowableArray : public BaseGrowableArray<T, EmptyBase, Malloc> {
  public:
   explicit MallocGrowableArray(intptr_t initial_capacity)
       : BaseGrowableArray<T, EmptyBase, Malloc>(initial_capacity, NULL) {}
-  MallocGrowableArray()
-      : BaseGrowableArray<T, EmptyBase, Malloc>(NULL) {}
+  MallocGrowableArray() : BaseGrowableArray<T, EmptyBase, Malloc>(NULL) {}
 };
 
 }  // namespace dart
 
-#endif  // VM_GROWABLE_ARRAY_H_
+#endif  // RUNTIME_VM_GROWABLE_ARRAY_H_
diff --git a/runtime/vm/growable_array_test.cc b/runtime/vm/growable_array_test.cc
index fedb9c8..4a9782d 100644
--- a/runtime/vm/growable_array_test.cc
+++ b/runtime/vm/growable_array_test.cc
@@ -8,7 +8,7 @@
 
 namespace dart {
 
-template<class GrowableArrayInt, class GrowableArrayInt64>
+template <class GrowableArrayInt, class GrowableArrayInt64>
 void TestGrowableArray() {
   GrowableArrayInt g;
   EXPECT_EQ(0, g.length());
@@ -64,14 +64,12 @@
 
 
 TEST_CASE(GrowableArray) {
-  TestGrowableArray<GrowableArray<int>,
-                    GrowableArray<int64_t> >();
+  TestGrowableArray<GrowableArray<int>, GrowableArray<int64_t> >();
 }
 
 
 TEST_CASE(MallocGrowableArray) {
-  TestGrowableArray<MallocGrowableArray<int>,
-                    MallocGrowableArray<int64_t> >();
+  TestGrowableArray<MallocGrowableArray<int>, MallocGrowableArray<int64_t> >();
 }
 
 
diff --git a/runtime/vm/guard_field_test.cc b/runtime/vm/guard_field_test.cc
index 0e0972b..54815b8 100644
--- a/runtime/vm/guard_field_test.cc
+++ b/runtime/vm/guard_field_test.cc
@@ -9,12 +9,13 @@
 
 namespace dart {
 
-RawField* LookupField(Dart_Handle library, const char* class_name,
+RawField* LookupField(Dart_Handle library,
+                      const char* class_name,
                       const char* field_name) {
   RawLibrary* raw_library = Library::RawCast(Api::UnwrapHandle(library));
   Library& lib = Library::ZoneHandle(raw_library);
-  const String& classname = String::Handle(Symbols::New(Thread::Current(),
-                                                        class_name));
+  const String& classname =
+      String::Handle(Symbols::New(Thread::Current(), class_name));
   Class& cls = Class::Handle(lib.LookupClass(classname));
   EXPECT(!cls.IsNull());  // No ambiguity error expected.
 
diff --git a/runtime/vm/gypi_contents.gni b/runtime/vm/gypi_contents.gni
new file mode 100644
index 0000000..403efdf
--- /dev/null
+++ b/runtime/vm/gypi_contents.gni
@@ -0,0 +1,52 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+_core_library_names = [
+  "async",
+  "core",
+  "collection",
+  "convert",
+  "developer",
+  "internal",
+  "isolate",
+  "math",
+  "mirrors",
+  "profiler",
+  "typed_data",
+  "vmservice",
+]
+
+_core_library_gypis = [
+  "../platform/platform_headers.gypi",
+  "../platform/platform_sources.gypi",
+  "../vm/vm_sources.gypi",
+  "../lib/async_sources.gypi",
+  "../lib/core_sources.gypi",
+  "../lib/collection_sources.gypi",
+  "../lib/convert_sources.gypi",
+  "../lib/developer_sources.gypi",
+  "../lib/internal_sources.gypi",
+  "../lib/isolate_sources.gypi",
+  "../lib/math_sources.gypi",
+  "../lib/mirrors_sources.gypi",
+  "../lib/typed_data_sources.gypi",
+  "../lib/vmservice_sources.gypi",
+  "../../sdk/lib/async/async_sources.gypi",
+  "../../sdk/lib/collection/collection_sources.gypi",
+  "../../sdk/lib/convert/convert_sources.gypi",
+  "../../sdk/lib/core/core_sources.gypi",
+  "../../sdk/lib/developer/developer_sources.gypi",
+  "../../sdk/lib/internal/internal_sources.gypi",
+  "../../sdk/lib/isolate/isolate_sources.gypi",
+  "../../sdk/lib/math/math_sources.gypi",
+  "../../sdk/lib/mirrors/mirrors_sources.gypi",
+  "../../sdk/lib/profiler/profiler_sources.gypi",
+  "../../sdk/lib/vmservice/vmservice_sources.gypi",
+  "../bin/io_sources.gypi",
+]
+
+processed_gypis = exec_script("../../tools/process_gypis.py",
+                              _core_library_names,
+                              "scope",
+                              _core_library_gypis)
diff --git a/runtime/vm/handles.cc b/runtime/vm/handles.cc
index bf2697a..f3818d7 100644
--- a/runtime/vm/handles.cc
+++ b/runtime/vm/handles.cc
@@ -21,20 +21,18 @@
 
 
 VMHandles::~VMHandles() {
-    if (FLAG_trace_handles) {
-      OS::PrintErr("***   Handle Counts for 0x(%" Px
-                   "):Zone = %d,Scoped = %d\n",
-                   reinterpret_cast<intptr_t>(this),
-                   CountZoneHandles(), CountScopedHandles());
-      OS::PrintErr("*** Deleting VM handle block 0x%" Px "\n",
-                   reinterpret_cast<intptr_t>(this));
-    }
+  if (FLAG_trace_handles) {
+    OS::PrintErr("***   Handle Counts for 0x(%" Px "):Zone = %d,Scoped = %d\n",
+                 reinterpret_cast<intptr_t>(this), CountZoneHandles(),
+                 CountScopedHandles());
+    OS::PrintErr("*** Deleting VM handle block 0x%" Px "\n",
+                 reinterpret_cast<intptr_t>(this));
+  }
 }
 
 
 void VMHandles::VisitObjectPointers(ObjectPointerVisitor* visitor) {
-  return Handles<kVMHandleSizeInWords,
-                 kVMHandlesPerChunk,
+  return Handles<kVMHandleSizeInWords, kVMHandlesPerChunk,
                  kOffsetOfRawPtr>::VisitObjectPointers(visitor);
 }
 
@@ -49,24 +47,21 @@
 
 uword VMHandles::AllocateHandle(Zone* zone) {
   DEBUG_ASSERT(!IsCurrentApiNativeScope(zone));
-  return Handles<kVMHandleSizeInWords,
-                 kVMHandlesPerChunk,
+  return Handles<kVMHandleSizeInWords, kVMHandlesPerChunk,
                  kOffsetOfRawPtr>::AllocateHandle(zone);
 }
 
 
 uword VMHandles::AllocateZoneHandle(Zone* zone) {
   DEBUG_ASSERT(!IsCurrentApiNativeScope(zone));
-  return Handles<kVMHandleSizeInWords,
-                 kVMHandlesPerChunk,
+  return Handles<kVMHandleSizeInWords, kVMHandlesPerChunk,
                  kOffsetOfRawPtr>::AllocateZoneHandle(zone);
 }
 
 
 bool VMHandles::IsZoneHandle(uword handle) {
-  return Handles<kVMHandleSizeInWords,
-                 kVMHandlesPerChunk,
-                 kOffsetOfRawPtr >::IsZoneHandle(handle);
+  return Handles<kVMHandleSizeInWords, kVMHandlesPerChunk,
+                 kOffsetOfRawPtr>::IsZoneHandle(handle);
 }
 
 
diff --git a/runtime/vm/handles.h b/runtime/vm/handles.h
index aab078c..b96a3bf 100644
--- a/runtime/vm/handles.h
+++ b/runtime/vm/handles.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_HANDLES_H_
-#define VM_HANDLES_H_
+#ifndef RUNTIME_VM_HANDLES_H_
+#define RUNTIME_VM_HANDLES_H_
 
 #include "vm/allocation.h"
 #include "vm/flags.h"
@@ -84,11 +84,8 @@
   Handles()
       : zone_blocks_(NULL),
         first_scoped_block_(NULL),
-        scoped_blocks_(&first_scoped_block_) {
-  }
-  ~Handles() {
-    DeleteAll();
-  }
+        scoped_blocks_(&first_scoped_block_) {}
+  ~Handles() { DeleteAll(); }
 
   // Visit all object pointers stored in the various handles.
   void VisitObjectPointers(ObjectPointerVisitor* visitor);
@@ -148,8 +145,7 @@
   class HandlesBlock {
    public:
     explicit HandlesBlock(HandlesBlock* next)
-        : next_handle_slot_(0),
-          next_block_(next) { }
+        : next_handle_slot_(0), next_block_(next) {}
     ~HandlesBlock();
 
     // Reinitializes handle block for reuse.
@@ -200,7 +196,7 @@
    private:
     uword data_[kHandleSizeInWords * kHandlesPerChunk];  // Handles area.
     intptr_t next_handle_slot_;  // Next slot for allocation in current block.
-    HandlesBlock* next_block_;  // Link to next block of handles.
+    HandlesBlock* next_block_;   // Link to next block of handles.
 
     DISALLOW_COPY_AND_ASSIGN(HandlesBlock);
   };
@@ -231,9 +227,9 @@
   void ZapFreeScopedHandles();
 #endif
 
-  HandlesBlock* zone_blocks_;  // List of zone handles.
+  HandlesBlock* zone_blocks_;        // List of zone handles.
   HandlesBlock first_scoped_block_;  // First block of scoped handles.
-  HandlesBlock* scoped_blocks_;  // List of scoped handles.
+  HandlesBlock* scoped_blocks_;      // List of scoped handles.
 
   friend class HandleScope;
   friend class Dart;
@@ -253,9 +249,8 @@
  public:
   static const int kOffsetOfRawPtrInHandle = kOffsetOfRawPtr;
 
-  VMHandles() : Handles<kVMHandleSizeInWords,
-                        kVMHandlesPerChunk,
-                        kOffsetOfRawPtr>() {
+  VMHandles()
+      : Handles<kVMHandleSizeInWords, kVMHandlesPerChunk, kOffsetOfRawPtr>() {
     if (FLAG_trace_handles) {
       OS::PrintErr("*** Starting a new VM handle block 0x%" Px "\n",
                    reinterpret_cast<intptr_t>(this));
@@ -314,7 +309,7 @@
 
 // Macro to start a new Handle scope.
 #define HANDLESCOPE(thread)                                                    \
-    dart::HandleScope vm_internal_handles_scope_(thread);
+  dart::HandleScope vm_internal_handles_scope_(thread);
 
 
 // The class NoHandleScope is used in critical regions of the virtual machine
@@ -338,12 +333,12 @@
  private:
   DISALLOW_COPY_AND_ASSIGN(NoHandleScope);
 };
-#else  // defined(DEBUG)
+#else   // defined(DEBUG)
 class NoHandleScope : public ValueObject {
  public:
-  explicit NoHandleScope(Thread* thread) { }
-  NoHandleScope() { }
-  ~NoHandleScope() { }
+  explicit NoHandleScope(Thread* thread) {}
+  NoHandleScope() {}
+  ~NoHandleScope() {}
 
  private:
   DISALLOW_COPY_AND_ASSIGN(NoHandleScope);
@@ -352,8 +347,8 @@
 
 // Macro to start a no handles scope in the code.
 #define NOHANDLESCOPE(thread)                                                  \
-    dart::NoHandleScope no_vm_internal_handles_scope_(thread);
+  dart::NoHandleScope no_vm_internal_handles_scope_(thread);
 
 }  // namespace dart
 
-#endif  // VM_HANDLES_H_
+#endif  // RUNTIME_VM_HANDLES_H_
diff --git a/runtime/vm/handles_impl.h b/runtime/vm/handles_impl.h
index bf44e63..3adf2fe 100644
--- a/runtime/vm/handles_impl.h
+++ b/runtime/vm/handles_impl.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_HANDLES_IMPL_H_
-#define VM_HANDLES_IMPL_H_
+#ifndef RUNTIME_VM_HANDLES_IMPL_H_
+#define RUNTIME_VM_HANDLES_IMPL_H_
 
 #include "vm/heap.h"
 #include "vm/thread.h"
@@ -12,10 +12,8 @@
 namespace dart {
 
 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
-void Handles<kHandleSizeInWords,
-             kHandlesPerChunk,
-             kOffsetOfRawPtr>::VisitObjectPointers(
-    ObjectPointerVisitor* visitor) {
+void Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::
+    VisitObjectPointers(ObjectPointerVisitor* visitor) {
   // Visit all zone handles.
   HandlesBlock* block = zone_blocks_;
   while (block != NULL) {
@@ -29,10 +27,8 @@
 
 
 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
-void Handles<kHandleSizeInWords,
-             kHandlesPerChunk,
-             kOffsetOfRawPtr>::VisitScopedHandles(
-    ObjectPointerVisitor* visitor) {
+void Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::
+    VisitScopedHandles(ObjectPointerVisitor* visitor) {
   HandlesBlock* block = &first_scoped_block_;
   do {
     block->VisitObjectPointers(visitor);
@@ -46,9 +42,8 @@
 
 
 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
-void Handles<kHandleSizeInWords,
-             kHandlesPerChunk,
-             kOffsetOfRawPtr>::Visit(HandleVisitor* visitor) {
+void Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::Visit(
+    HandleVisitor* visitor) {
   // Visit all zone handles.
   HandlesBlock* block = zone_blocks_;
   while (block != NULL) {
@@ -66,9 +61,7 @@
 
 
 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
-void Handles<kHandleSizeInWords,
-             kHandlesPerChunk,
-             kOffsetOfRawPtr>::Reset() {
+void Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::Reset() {
   // Delete all the extra zone handle blocks allocated and reinit the first
   // zone block.
   if (zone_blocks_ != NULL) {
@@ -88,9 +81,8 @@
 // allocate a handle in that scope. The function assumes that a
 // current handle scope exists. It asserts for this appropriately.
 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
-uword Handles<kHandleSizeInWords,
-              kHandlesPerChunk,
-              kOffsetOfRawPtr>::AllocateHandle(Zone* zone) {
+uword Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::
+    AllocateHandle(Zone* zone) {
 #if defined(DEBUG)
   Thread* thread = Thread::Current();
   ASSERT(thread->top_handle_scope() != NULL);
@@ -105,9 +97,8 @@
 // The function assumes that 'zone' is the current zone and asserts for
 // this appropriately.
 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
-uword Handles<kHandleSizeInWords,
-              kHandlesPerChunk,
-              kOffsetOfRawPtr>::AllocateZoneHandle(Zone* zone) {
+uword Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::
+    AllocateZoneHandle(Zone* zone) {
 #if defined(DEBUG)
   Thread* thread = Thread::Current();
   ASSERT(thread->zone() == zone);
@@ -123,9 +114,8 @@
 // Figure out the current zone using the current Thread and
 // check if the specified handle has been allocated in this zone.
 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
-bool Handles<kHandleSizeInWords,
-             kHandlesPerChunk,
-             kOffsetOfRawPtr>::IsZoneHandle(uword handle) {
+bool Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::
+    IsZoneHandle(uword handle) {
   // TODO(5411412): Accessing the current thread is a performance problem,
   // consider passing it down as a parameter.
   Thread* thread = Thread::Current();
@@ -138,9 +128,8 @@
 
 
 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
-void Handles<kHandleSizeInWords,
-             kHandlesPerChunk,
-             kOffsetOfRawPtr>::DeleteAll() {
+void Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::
+    DeleteAll() {
   // Delete all the zone allocated handle blocks.
   // GCTrace does not need to trace this call to DeleteHandleBlocks,
   // since the individual zone deletions will be caught
@@ -157,10 +146,8 @@
 
 
 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
-void Handles<kHandleSizeInWords,
-             kHandlesPerChunk,
-             kOffsetOfRawPtr>::DeleteHandleBlocks(
-    HandlesBlock* blocks) {
+void Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::
+    DeleteHandleBlocks(HandlesBlock* blocks) {
   while (blocks != NULL) {
     HandlesBlock* block = blocks;
     blocks = blocks->next_block();
@@ -170,13 +157,12 @@
 
 
 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
-void Handles<kHandleSizeInWords,
-             kHandlesPerChunk,
-             kOffsetOfRawPtr>::SetupNextScopeBlock() {
+void Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::
+    SetupNextScopeBlock() {
   if (FLAG_trace_handles) {
     OS::PrintErr("***   Handle Counts for (0x%" Px "):Zone = %d,Scoped = %d\n",
-                 reinterpret_cast<intptr_t>(this),
-                 CountZoneHandles(), CountScopedHandles());
+                 reinterpret_cast<intptr_t>(this), CountZoneHandles(),
+                 CountScopedHandles());
   }
   if (scoped_blocks_->next_block() == NULL) {
     scoped_blocks_->set_next_block(new HandlesBlock(NULL));
@@ -193,9 +179,8 @@
 // handle blocks to check if the handle is valid, please
 // use this only in ASSERT code for verification purposes.
 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
-bool Handles<kHandleSizeInWords,
-             kHandlesPerChunk,
-             kOffsetOfRawPtr>::IsValidScopedHandle(uword handle) const {
+bool Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::
+    IsValidScopedHandle(uword handle) const {
   const HandlesBlock* iterator = &first_scoped_block_;
   while (iterator != NULL) {
     if (iterator->IsValidHandle(handle)) {
@@ -208,9 +193,8 @@
 
 
 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
-bool Handles<kHandleSizeInWords,
-             kHandlesPerChunk,
-             kOffsetOfRawPtr>::IsValidZoneHandle(uword handle) const {
+bool Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::
+    IsValidZoneHandle(uword handle) const {
   const HandlesBlock* iterator = zone_blocks_;
   while (iterator != NULL) {
     if (iterator->IsValidHandle(handle)) {
@@ -223,13 +207,12 @@
 
 
 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
-void Handles<kHandleSizeInWords,
-             kHandlesPerChunk,
-             kOffsetOfRawPtr>::SetupNextZoneBlock() {
+void Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::
+    SetupNextZoneBlock() {
   if (FLAG_trace_handles) {
     OS::PrintErr("***   Handle Counts for (0x%" Px "):Zone = %d,Scoped = %d\n",
-                 reinterpret_cast<intptr_t>(this),
-                 CountZoneHandles(), CountScopedHandles());
+                 reinterpret_cast<intptr_t>(this), CountZoneHandles(),
+                 CountScopedHandles());
   }
   zone_blocks_ = new HandlesBlock(zone_blocks_);
   ASSERT(zone_blocks_ != NULL);
@@ -238,9 +221,8 @@
 
 #if defined(DEBUG)
 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
-void Handles<kHandleSizeInWords,
-             kHandlesPerChunk,
-             kOffsetOfRawPtr>::VerifyScopedHandleState() {
+void Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::
+    VerifyScopedHandleState() {
   HandlesBlock* block = &first_scoped_block_;
   const intptr_t end_index = (kHandleSizeInWords * kHandlesPerChunk);
   do {
@@ -254,9 +236,8 @@
 
 
 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
-void Handles<kHandleSizeInWords,
-             kHandlesPerChunk,
-             kOffsetOfRawPtr>::ZapFreeScopedHandles() {
+void Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::
+    ZapFreeScopedHandles() {
   HandlesBlock* block = scoped_blocks_;
   while (block != NULL) {
     block->ZapFreeHandles();
@@ -267,9 +248,8 @@
 
 
 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
-int Handles<kHandleSizeInWords,
-            kHandlesPerChunk,
-            kOffsetOfRawPtr>::CountScopedHandles() const {
+int Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::
+    CountScopedHandles() const {
   int count = 0;
   const HandlesBlock* block = &first_scoped_block_;
   do {
@@ -285,9 +265,8 @@
 
 
 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
-int Handles<kHandleSizeInWords,
-            kHandlesPerChunk,
-            kOffsetOfRawPtr>::CountZoneHandles() const {
+int Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::
+    CountZoneHandles() const {
   int count = 0;
   const HandlesBlock* block = zone_blocks_;
   while (block != NULL) {
@@ -299,9 +278,8 @@
 
 
 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
-Handles<kHandleSizeInWords,
-        kHandlesPerChunk,
-        kOffsetOfRawPtr>::HandlesBlock::~HandlesBlock() {
+Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::HandlesBlock::
+    ~HandlesBlock() {
 #if defined(DEBUG)
   ReInit();
 #endif
@@ -309,9 +287,8 @@
 
 
 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
-void Handles<kHandleSizeInWords,
-             kHandlesPerChunk,
-             kOffsetOfRawPtr>::HandlesBlock::ReInit() {
+void Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::
+    HandlesBlock::ReInit() {
   next_handle_slot_ = 0;
   next_block_ = NULL;
 #if defined(DEBUG)
@@ -321,22 +298,19 @@
 
 
 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
-void Handles<kHandleSizeInWords,
-             kHandlesPerChunk,
-             kOffsetOfRawPtr>::HandlesBlock::VisitObjectPointers(
-                 ObjectPointerVisitor* visitor) {
+void Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::
+    HandlesBlock::VisitObjectPointers(ObjectPointerVisitor* visitor) {
   ASSERT(visitor != NULL);
   for (intptr_t i = 0; i < next_handle_slot_; i += kHandleSizeInWords) {
     visitor->VisitPointer(
-        reinterpret_cast<RawObject**>(&data_[i + kOffsetOfRawPtr/kWordSize]));
+        reinterpret_cast<RawObject**>(&data_[i + kOffsetOfRawPtr / kWordSize]));
   }
 }
 
 
 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
-void Handles<kHandleSizeInWords,
-             kHandlesPerChunk,
-             kOffsetOfRawPtr>::HandlesBlock::Visit(HandleVisitor* visitor) {
+void Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::
+    HandlesBlock::Visit(HandleVisitor* visitor) {
   ASSERT(visitor != NULL);
   for (intptr_t i = 0; i < next_handle_slot_; i += kHandleSizeInWords) {
     visitor->VisitHandle(reinterpret_cast<uword>(&data_[i]));
@@ -346,13 +320,11 @@
 
 #if defined(DEBUG)
 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
-void Handles<kHandleSizeInWords,
-             kHandlesPerChunk,
-             kOffsetOfRawPtr>::HandlesBlock::ZapFreeHandles() {
+void Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::
+    HandlesBlock::ZapFreeHandles() {
   // Reinitialize the handle area to some uninitialized value.
   for (intptr_t i = next_handle_slot_;
-       i < (kHandleSizeInWords * kHandlesPerChunk);
-       i++) {
+       i < (kHandleSizeInWords * kHandlesPerChunk); i++) {
     data_[i] = kZapUninitializedWord;
   }
 }
@@ -360,12 +332,11 @@
 
 
 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
-int Handles<kHandleSizeInWords,
-            kHandlesPerChunk,
-            kOffsetOfRawPtr>::HandlesBlock::HandleCount() const {
+int Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::
+    HandlesBlock::HandleCount() const {
   return (next_handle_slot_ / kHandleSizeInWords);
 }
 
 }  // namespace dart
 
-#endif  // VM_HANDLES_IMPL_H_
+#endif  // RUNTIME_VM_HANDLES_IMPL_H_
diff --git a/runtime/vm/hash_map.h b/runtime/vm/hash_map.h
index 64f8790..5aa5343 100644
--- a/runtime/vm/hash_map.h
+++ b/runtime/vm/hash_map.h
@@ -2,15 +2,15 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_HASH_MAP_H_
-#define VM_HASH_MAP_H_
+#ifndef RUNTIME_VM_HASH_MAP_H_
+#define RUNTIME_VM_HASH_MAP_H_
 
 #include "vm/growable_array.h"  // For Malloc, EmptyBase
 #include "vm/zone.h"
 
 namespace dart {
 
-template<typename KeyValueTrait, typename B, typename Allocator = Zone>
+template <typename KeyValueTrait, typename B, typename Allocator = Zone>
 class BaseDirectChainedHashMap : public B {
  public:
   explicit BaseDirectChainedHashMap(Allocator* allocator)
@@ -71,7 +71,7 @@
     intptr_t array_index_;
     intptr_t list_index_;
 
-    template<typename T, typename Bs, typename A>
+    template <typename T, typename Bs, typename A>
     friend class BaseDirectChainedHashMap;
   };
 
@@ -80,7 +80,7 @@
  protected:
   // A linked list of T values.  Stored in arrays.
   struct HashMapListElement {
-    HashMapListElement() : kv(), next(kNil) { }
+    HashMapListElement() : kv(), next(kNil) {}
     typename KeyValueTrait::Pair kv;
     intptr_t next;  // Index in the array of the next list element.
   };
@@ -101,7 +101,7 @@
 
   intptr_t array_size_;
   intptr_t lists_size_;
-  intptr_t count_;  // The number of values stored in the HashMap.
+  intptr_t count_;             // The number of values stored in the HashMap.
   HashMapListElement* array_;  // Primary store - contains the first value
   // with a given hash.  Colliding elements are stored in linked lists.
   HashMapListElement* lists_;  // The linked lists containing hash collisions.
@@ -110,28 +110,28 @@
 };
 
 
-template<typename KeyValueTrait, typename B, typename Allocator>
-BaseDirectChainedHashMap<KeyValueTrait, B, Allocator>::
-    BaseDirectChainedHashMap(const BaseDirectChainedHashMap& other)
-  : B(),
-    array_size_(other.array_size_),
-    lists_size_(other.lists_size_),
-    count_(other.count_),
-    array_(other.allocator_->template Alloc<HashMapListElement>(
-        other.array_size_)),
-    lists_(other.allocator_->template Alloc<HashMapListElement>(
-        other.lists_size_)),
-    free_list_head_(other.free_list_head_),
-    allocator_(other.allocator_) {
+template <typename KeyValueTrait, typename B, typename Allocator>
+BaseDirectChainedHashMap<KeyValueTrait, B, Allocator>::BaseDirectChainedHashMap(
+    const BaseDirectChainedHashMap& other)
+    : B(),
+      array_size_(other.array_size_),
+      lists_size_(other.lists_size_),
+      count_(other.count_),
+      array_(other.allocator_->template Alloc<HashMapListElement>(
+          other.array_size_)),
+      lists_(other.allocator_->template Alloc<HashMapListElement>(
+          other.lists_size_)),
+      free_list_head_(other.free_list_head_),
+      allocator_(other.allocator_) {
   memmove(array_, other.array_, array_size_ * sizeof(HashMapListElement));
   memmove(lists_, other.lists_, lists_size_ * sizeof(HashMapListElement));
 }
 
 
-template<typename KeyValueTrait, typename B, typename Allocator>
+template <typename KeyValueTrait, typename B, typename Allocator>
 typename KeyValueTrait::Pair*
-    BaseDirectChainedHashMap<KeyValueTrait, B, Allocator>::
-        Lookup(typename KeyValueTrait::Key key) const {
+BaseDirectChainedHashMap<KeyValueTrait, B, Allocator>::Lookup(
+    typename KeyValueTrait::Key key) const {
   const typename KeyValueTrait::Value kNoValue =
       KeyValueTrait::ValueOf(typename KeyValueTrait::Pair());
 
@@ -154,10 +154,10 @@
 }
 
 
-template<typename KeyValueTrait, typename B, typename Allocator>
+template <typename KeyValueTrait, typename B, typename Allocator>
 typename KeyValueTrait::Value
-    BaseDirectChainedHashMap<KeyValueTrait, B, Allocator>::
-        LookupValue(typename KeyValueTrait::Key key) const {
+BaseDirectChainedHashMap<KeyValueTrait, B, Allocator>::LookupValue(
+    typename KeyValueTrait::Key key) const {
   const typename KeyValueTrait::Value kNoValue =
       KeyValueTrait::ValueOf(typename KeyValueTrait::Pair());
   typename KeyValueTrait::Pair* pair = Lookup(key);
@@ -165,9 +165,9 @@
 }
 
 
-template<typename KeyValueTrait, typename B, typename Allocator>
+template <typename KeyValueTrait, typename B, typename Allocator>
 typename KeyValueTrait::Pair*
-    BaseDirectChainedHashMap<KeyValueTrait, B, Allocator>::Iterator::Next() {
+BaseDirectChainedHashMap<KeyValueTrait, B, Allocator>::Iterator::Next() {
   const typename KeyValueTrait::Value kNoValue =
       KeyValueTrait::ValueOf(typename KeyValueTrait::Pair());
 
@@ -200,7 +200,7 @@
 }
 
 
-template<typename KeyValueTrait, typename B, typename Allocator>
+template <typename KeyValueTrait, typename B, typename Allocator>
 void BaseDirectChainedHashMap<KeyValueTrait, B, Allocator>::Resize(
     intptr_t new_size) {
   const typename KeyValueTrait::Value kNoValue =
@@ -250,7 +250,7 @@
 }
 
 
-template<typename KeyValueTrait, typename B, typename Allocator>
+template <typename KeyValueTrait, typename B, typename Allocator>
 void BaseDirectChainedHashMap<KeyValueTrait, B, Allocator>::ResizeLists(
     intptr_t new_size) {
   ASSERT(new_size > lists_size_);
@@ -276,9 +276,9 @@
 }
 
 
-template<typename KeyValueTrait, typename B, typename Allocator>
-void BaseDirectChainedHashMap<KeyValueTrait, B, Allocator>::
-    Insert(typename KeyValueTrait::Pair kv) {
+template <typename KeyValueTrait, typename B, typename Allocator>
+void BaseDirectChainedHashMap<KeyValueTrait, B, Allocator>::Insert(
+    typename KeyValueTrait::Pair kv) {
   const typename KeyValueTrait::Value kNoValue =
       KeyValueTrait::ValueOf(typename KeyValueTrait::Pair());
 
@@ -308,16 +308,17 @@
 }
 
 
-template<typename KeyValueTrait>
+template <typename KeyValueTrait>
 class DirectChainedHashMap
     : public BaseDirectChainedHashMap<KeyValueTrait, ValueObject> {
  public:
-  DirectChainedHashMap() : BaseDirectChainedHashMap<KeyValueTrait, ValueObject>(
-          ASSERT_NOTNULL(Thread::Current()->zone())) {}
+  DirectChainedHashMap()
+      : BaseDirectChainedHashMap<KeyValueTrait, ValueObject>(
+            ASSERT_NOTNULL(Thread::Current()->zone())) {}
 };
 
 
-template<typename KeyValueTrait>
+template <typename KeyValueTrait>
 class MallocDirectChainedHashMap
     : public BaseDirectChainedHashMap<KeyValueTrait, EmptyBase, Malloc> {
  public:
@@ -326,32 +327,24 @@
 };
 
 
-template<typename T>
+template <typename T>
 class PointerKeyValueTrait {
  public:
   typedef T* Value;
   typedef T* Key;
   typedef T* Pair;
 
-  static Key KeyOf(Pair kv) {
-    return kv;
-  }
+  static Key KeyOf(Pair kv) { return kv; }
 
-  static Value ValueOf(Pair kv) {
-    return kv;
-  }
+  static Value ValueOf(Pair kv) { return kv; }
 
-  static inline intptr_t Hashcode(Key key) {
-    return key->Hashcode();
-  }
+  static inline intptr_t Hashcode(Key key) { return key->Hashcode(); }
 
-  static inline bool IsKeyEqual(Pair kv, Key key) {
-    return kv->Equals(key);
-  }
+  static inline bool IsKeyEqual(Pair kv, Key key) { return kv->Equals(key); }
 };
 
 
-template<typename T>
+template <typename T>
 class NumbersKeyValueTrait {
  public:
   typedef T Value;
@@ -364,6 +357,27 @@
   static inline bool IsKeyEqual(Pair kv, Key key) { return kv.first() == key; }
 };
 
+
+template <typename K, typename V>
+class RawPointerKeyValueTrait {
+ public:
+  typedef K* Key;
+  typedef V Value;
+
+  struct Pair {
+    Key key;
+    Value value;
+    Pair() : key(NULL), value() {}
+    Pair(const Key key, const Value& value) : key(key), value(value) {}
+    Pair(const Pair& other) : key(other.key), value(other.value) {}
+  };
+
+  static Key KeyOf(Pair kv) { return kv.key; }
+  static Value ValueOf(Pair kv) { return kv.value; }
+  static intptr_t Hashcode(Key key) { return reinterpret_cast<intptr_t>(key); }
+  static bool IsKeyEqual(Pair kv, Key key) { return kv.key == key; }
+};
+
 }  // namespace dart
 
-#endif  // VM_HASH_MAP_H_
+#endif  // RUNTIME_VM_HASH_MAP_H_
diff --git a/runtime/vm/hash_map_test.cc b/runtime/vm/hash_map_test.cc
index 7830b85..b3afdde 100644
--- a/runtime/vm/hash_map_test.cc
+++ b/runtime/vm/hash_map_test.cc
@@ -10,9 +10,10 @@
 
 class TestValue {
  public:
-  explicit TestValue(intptr_t x) : x_(x) { }
+  explicit TestValue(intptr_t x) : x_(x) {}
   intptr_t Hashcode() const { return x_ & 1; }
   bool Equals(TestValue* other) { return x_ == other->x_; }
+
  private:
   intptr_t x_;
 };
diff --git a/runtime/vm/hash_table.h b/runtime/vm/hash_table.h
index f1079b8..05d69fc 100644
--- a/runtime/vm/hash_table.h
+++ b/runtime/vm/hash_table.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_HASH_TABLE_H_
-#define VM_HASH_TABLE_H_
+#ifndef RUNTIME_VM_HASH_TABLE_H_
+#define RUNTIME_VM_HASH_TABLE_H_
 
 #include "platform/assert.h"
 #include "vm/object.h"
@@ -72,7 +72,7 @@
 //    uword Hash(const Key& key) for any number of desired lookup key types.
 //  kPayloadSize: number of components of the payload in each entry.
 //  kMetaDataSize: number of elements reserved (e.g., for iteration order data).
-template<typename KeyTraits, intptr_t kPayloadSize, intptr_t kMetaDataSize>
+template <typename KeyTraits, intptr_t kPayloadSize, intptr_t kMetaDataSize>
 class HashTable : public ValueObject {
  public:
   typedef KeyTraits Traits;
@@ -127,12 +127,12 @@
     data_->SetAt(kOccupiedEntriesIndex, *smi_handle_);
     data_->SetAt(kDeletedEntriesIndex, *smi_handle_);
 
-NOT_IN_PRODUCT(
+#if !defined(PRODUCT)
     data_->SetAt(kNumGrowsIndex, *smi_handle_);
     data_->SetAt(kNumLT5LookupsIndex, *smi_handle_);
     data_->SetAt(kNumLT25LookupsIndex, *smi_handle_);
     data_->SetAt(kNumGT25LookupsIndex, *smi_handle_);
-)  // !PRODUCT
+#endif  // !defined(PRODUCT)
 
     for (intptr_t i = kHeaderSize; i < data_->Length(); ++i) {
       data_->SetAt(i, Object::sentinel());
@@ -140,13 +140,13 @@
   }
 
   // Returns whether 'key' matches any key in the table.
-  template<typename Key>
+  template <typename Key>
   bool ContainsKey(const Key& key) const {
     return FindKey(key) != -1;
   }
 
   // Returns the entry that matches 'key', or -1 if none exists.
-  template<typename Key>
+  template <typename Key>
   intptr_t FindKey(const Key& key) const {
     const intptr_t num_entries = NumEntries();
     ASSERT(NumOccupied() < num_entries);
@@ -179,7 +179,7 @@
   // - an occupied entry matching 'key', and returns true, or
   // - an unused/deleted entry where a matching key may be inserted,
   //   and returns false.
-  template<typename Key>
+  template <typename Key>
   bool FindKeyOrDeletedOrUnused(const Key& key, intptr_t* entry) const {
     const intptr_t num_entries = NumEntries();
     ASSERT(entry != NULL);
@@ -271,23 +271,13 @@
   intptr_t NumUnused() const {
     return NumEntries() - NumOccupied() - NumDeleted();
   }
-  intptr_t NumOccupied() const {
-    return GetSmiValueAt(kOccupiedEntriesIndex);
-  }
-  intptr_t NumDeleted() const {
-    return GetSmiValueAt(kDeletedEntriesIndex);
-  }
-  Object& KeyHandle() const {
-    return *key_handle_;
-  }
-  Smi& SmiHandle() const {
-    return *smi_handle_;
-  }
+  intptr_t NumOccupied() const { return GetSmiValueAt(kOccupiedEntriesIndex); }
+  intptr_t NumDeleted() const { return GetSmiValueAt(kDeletedEntriesIndex); }
+  Object& KeyHandle() const { return *key_handle_; }
+  Smi& SmiHandle() const { return *smi_handle_; }
 
-NOT_IN_PRODUCT(
-  intptr_t NumGrows() const {
-    return GetSmiValueAt(kNumGrowsIndex);
-  }
+#if !defined(PRODUCT)
+  intptr_t NumGrows() const { return GetSmiValueAt(kNumGrowsIndex); }
   intptr_t NumLT5Collisions() const {
     return GetSmiValueAt(kNumLT5LookupsIndex);
   }
@@ -297,9 +287,7 @@
   intptr_t NumGT25Collisions() const {
     return GetSmiValueAt(kNumGT25LookupsIndex);
   }
-  void UpdateGrowth() const {
-    AdjustSmiValueAt(kNumGrowsIndex, 1);
-  }
+  void UpdateGrowth() const { AdjustSmiValueAt(kNumGrowsIndex, 1); }
   void UpdateCollisions(intptr_t collisions) const {
     if (data_->raw()->IsVMHeapObject()) {
       return;
@@ -316,6 +304,7 @@
     if (!KeyTraits::ReportStats()) {
       return;
     }
+    // clang-format off
     OS::Print("Stats for %s table :\n"
               " Size of table = %" Pd ",Number of Occupied entries = %" Pd "\n"
               " Number of Grows = %" Pd "\n"
@@ -326,8 +315,9 @@
               NumEntries(), NumOccupied(),
               NumGrows(),
               NumLT5Collisions(), NumLT25Collisions(), NumGT25Collisions());
+    // clang-format on
   }
-)  // !PRODUCT
+#endif  // !PRODUCT
 
  protected:
   static const intptr_t kOccupiedEntriesIndex = 0;
@@ -389,7 +379,7 @@
 
 
 // Table with unspecified iteration order. No payload overhead or metadata.
-template<typename KeyTraits, intptr_t kUserPayloadSize>
+template <typename KeyTraits, intptr_t kUserPayloadSize>
 class UnorderedHashTable : public HashTable<KeyTraits, kUserPayloadSize, 0> {
  public:
   typedef HashTable<KeyTraits, kUserPayloadSize, 0> BaseTable;
@@ -413,9 +403,7 @@
       }
       return false;
     }
-    intptr_t Current() {
-      return entry_;
-    }
+    intptr_t Current() { return entry_; }
 
    private:
     const UnorderedHashTable* table_;
@@ -429,16 +417,17 @@
 class HashTables : public AllStatic {
  public:
   // Allocates and initializes a table.
-  template<typename Table>
+  template <typename Table>
   static RawArray* New(intptr_t initial_capacity,
                        Heap::Space space = Heap::kNew) {
-    Table table(Thread::Current()->zone(), Array::New(
-        Table::ArrayLengthForNumOccupied(initial_capacity), space));
+    Table table(
+        Thread::Current()->zone(),
+        Array::New(Table::ArrayLengthForNumOccupied(initial_capacity), space));
     table.Initialize();
     return table.Release().raw();
   }
 
-  template<typename Table>
+  template <typename Table>
   static RawArray* New(const Array& array) {
     Table table(Thread::Current()->zone(), array.raw());
     table.Initialize();
@@ -447,7 +436,7 @@
 
   // Clears 'to' and inserts all elements from 'from', in iteration order.
   // The tables must have the same user payload size.
-  template<typename From, typename To>
+  template <typename From, typename To>
   static void Copy(const From& from, const To& to) {
     COMPILE_ASSERT(From::kPayloadSize == To::kPayloadSize);
     to.Initialize();
@@ -469,25 +458,24 @@
     }
   }
 
-  template<typename Table>
+  template <typename Table>
   static void EnsureLoadFactor(double low, double high, const Table& table) {
     double current = (1 + table.NumOccupied() + table.NumDeleted()) /
-        static_cast<double>(table.NumEntries());
+                     static_cast<double>(table.NumEntries());
     if (low <= current && current < high) {
       return;
     }
     double target = (low + high) / 2.0;
     intptr_t new_capacity = (1 + table.NumOccupied()) / target;
-    Table new_table(New<Table>(
-        new_capacity,
-        table.data_->IsOld() ? Heap::kOld : Heap::kNew));
+    Table new_table(New<Table>(new_capacity,
+                               table.data_->IsOld() ? Heap::kOld : Heap::kNew));
     Copy(table, new_table);
     *table.data_ = new_table.Release().raw();
     NOT_IN_PRODUCT(table.UpdateGrowth(); table.PrintStats();)
   }
 
   // Serializes a table by concatenating its entries as an array.
-  template<typename Table>
+  template <typename Table>
   static RawArray* ToArray(const Table& table, bool include_payload) {
     const intptr_t entry_size = include_payload ? (1 + Table::kPayloadSize) : 1;
     Array& result = Array::Handle(Array::New(table.NumOccupied() * entry_size));
@@ -510,7 +498,7 @@
 };
 
 
-template<typename BaseIterTable>
+template <typename BaseIterTable>
 class HashMap : public BaseIterTable {
  public:
   explicit HashMap(RawArray* data)
@@ -518,7 +506,7 @@
   HashMap(Zone* zone, RawArray* data) : BaseIterTable(zone, data) {}
   HashMap(Object* key, Smi* value, Array* data)
       : BaseIterTable(key, value, data) {}
-  template<typename Key>
+  template <typename Key>
   RawObject* GetOrNull(const Key& key, bool* present = NULL) const {
     intptr_t entry = BaseIterTable::FindKey(key);
     if (present != NULL) {
@@ -537,7 +525,7 @@
     return present;
   }
   // Update the value of an existing key. Note that 'key' need not be an Object.
-  template<typename Key>
+  template <typename Key>
   void UpdateValue(const Key& key, const Object& value) const {
     intptr_t entry = BaseIterTable::FindKey(key);
     ASSERT(entry != -1);
@@ -558,7 +546,7 @@
     }
   }
   // Like InsertOrGetValue, but calls NewKey to allocate a key object if needed.
-  template<typename Key>
+  template <typename Key>
   RawObject* InsertNewOrGetValue(const Key& key,
                                  const Object& value_if_absent) const {
     EnsureCapacity();
@@ -574,7 +562,7 @@
     }
   }
 
-  template<typename Key>
+  template <typename Key>
   bool Remove(const Key& key) const {
     intptr_t entry = BaseIterTable::FindKey(key);
     if (entry == -1) {
@@ -585,9 +573,7 @@
     }
   }
 
-  void Clear() const {
-    BaseIterTable::Initialize();
-  }
+  void Clear() const { BaseIterTable::Initialize(); }
 
  protected:
   void EnsureCapacity() const {
@@ -598,7 +584,7 @@
 };
 
 
-template<typename KeyTraits>
+template <typename KeyTraits>
 class UnorderedHashMap : public HashMap<UnorderedHashTable<KeyTraits, 1> > {
  public:
   typedef HashMap<UnorderedHashTable<KeyTraits, 1> > BaseMap;
@@ -610,7 +596,7 @@
 };
 
 
-template<typename BaseIterTable>
+template <typename BaseIterTable>
 class HashSet : public BaseIterTable {
  public:
   explicit HashSet(RawArray* data)
@@ -642,7 +628,7 @@
   }
 
   // Like InsertOrGet, but calls NewKey to allocate a key object if needed.
-  template<typename Key>
+  template <typename Key>
   RawObject* InsertNewOrGet(const Key& key) const {
     EnsureCapacity();
     intptr_t entry = -1;
@@ -656,7 +642,7 @@
     }
   }
 
-  template<typename Key>
+  template <typename Key>
   RawObject* GetOrNull(const Key& key, bool* present = NULL) const {
     intptr_t entry = BaseIterTable::FindKey(key);
     if (present != NULL) {
@@ -665,7 +651,7 @@
     return (entry == -1) ? Object::null() : BaseIterTable::GetKey(entry);
   }
 
-  template<typename Key>
+  template <typename Key>
   bool Remove(const Key& key) const {
     intptr_t entry = BaseIterTable::FindKey(key);
     if (entry == -1) {
@@ -676,9 +662,7 @@
     }
   }
 
-  void Clear() const {
-    BaseIterTable::Initialize();
-  }
+  void Clear() const { BaseIterTable::Initialize(); }
 
  protected:
   void EnsureCapacity() const {
@@ -689,7 +673,7 @@
 };
 
 
-template<typename KeyTraits>
+template <typename KeyTraits>
 class UnorderedHashSet : public HashSet<UnorderedHashTable<KeyTraits, 0> > {
  public:
   typedef HashSet<UnorderedHashTable<KeyTraits, 0> > BaseSet;
@@ -704,4 +688,4 @@
 
 }  // namespace dart
 
-#endif  // VM_HASH_TABLE_H_
+#endif  // RUNTIME_VM_HASH_TABLE_H_
diff --git a/runtime/vm/hash_table_test.cc b/runtime/vm/hash_table_test.cc
index 2d597b1..9c8daca 100644
--- a/runtime/vm/hash_table_test.cc
+++ b/runtime/vm/hash_table_test.cc
@@ -26,23 +26,17 @@
   static bool IsMatch(const char* key, const Object& obj) {
     return String::Cast(obj).Equals(key);
   }
-  static uword Hash(const char* key) {
-    return static_cast<uword>(strlen(key));
-  }
+  static uword Hash(const char* key) { return static_cast<uword>(strlen(key)); }
   static bool IsMatch(const Object& a, const Object& b) {
     return a.IsString() && b.IsString() &&
-        String::Cast(a).Equals(String::Cast(b));
+           String::Cast(a).Equals(String::Cast(b));
   }
-  static uword Hash(const Object& obj) {
-    return String::Cast(obj).Length();
-  }
-  static RawObject* NewKey(const char* key) {
-    return String::New(key);
-  }
+  static uword Hash(const Object& obj) { return String::Cast(obj).Length(); }
+  static RawObject* NewKey(const char* key) { return String::New(key); }
 };
 
 
-template<typename Table>
+template <typename Table>
 void Validate(const Table& table) {
   // Verify consistency of entry state tracking.
   intptr_t num_entries = table.NumEntries();
@@ -135,7 +129,7 @@
 // Checks that 'expected' and 'actual' are equal sets. If 'ordered' is true,
 // it also verifies that their iteration orders match, i.e., that actual's
 // insertion order coincides with lexicographic order.
-template<typename Set>
+template <typename Set>
 void VerifyStringSetsEqual(const std::set<std::string>& expected,
                            const Set& actual,
                            bool ordered) {
@@ -158,15 +152,15 @@
   if (!ordered) {
     std::sort(actual_vec.begin(), actual_vec.end());
   }
-  EXPECT(std::equal(actual_vec.begin(), actual_vec.end(),
-                    expected_vec.begin()));
+  EXPECT(
+      std::equal(actual_vec.begin(), actual_vec.end(), expected_vec.begin()));
 }
 
 
 // Checks that 'expected' and 'actual' are equal maps. If 'ordered' is true,
 // it also verifies that their iteration orders match, i.e., that actual's
 // insertion order coincides with lexicographic order.
-template<typename Map>
+template <typename Map>
 void VerifyStringMapsEqual(const std::map<std::string, int>& expected,
                            const Map& actual,
                            bool ordered) {
@@ -200,7 +194,7 @@
 }
 
 
-template<typename Set>
+template <typename Set>
 void TestSet(intptr_t initial_capacity, bool ordered) {
   std::set<std::string> expected;
   Set actual(HashTables::New<Set>(initial_capacity));
@@ -226,7 +220,7 @@
 }
 
 
-template<typename Map>
+template <typename Map>
 void TestMap(intptr_t initial_capacity, bool ordered) {
   std::map<std::string, int> expected;
   Map actual(HashTables::New<Map>(initial_capacity));
@@ -258,8 +252,7 @@
 
 
 TEST_CASE(Sets) {
-  for (intptr_t initial_capacity = 0;
-       initial_capacity < 32;
+  for (intptr_t initial_capacity = 0; initial_capacity < 32;
        ++initial_capacity) {
     TestSet<UnorderedHashSet<TestTraits> >(initial_capacity, false);
   }
@@ -267,8 +260,7 @@
 
 
 TEST_CASE(Maps) {
-  for (intptr_t initial_capacity = 0;
-       initial_capacity < 32;
+  for (intptr_t initial_capacity = 0; initial_capacity < 32;
        ++initial_capacity) {
     TestMap<UnorderedHashMap<TestTraits> >(initial_capacity, false);
   }
diff --git a/runtime/vm/heap.cc b/runtime/vm/heap.cc
index c3353d2..a6a4daa 100644
--- a/runtime/vm/heap.cc
+++ b/runtime/vm/heap.cc
@@ -38,9 +38,8 @@
       read_only_(false),
       gc_new_space_in_progress_(false),
       gc_old_space_in_progress_(false) {
-  for (int sel = 0;
-       sel < kNumWeakSelectors;
-       sel++) {
+  UpdateGlobalMaxUsed();
+  for (int sel = 0; sel < kNumWeakSelectors; sel++) {
     new_weak_tables_[sel] = new WeakTable();
     old_weak_tables_[sel] = new WeakTable();
   }
@@ -52,9 +51,7 @@
   delete barrier_;
   delete barrier_done_;
 
-  for (int sel = 0;
-       sel < kNumWeakSelectors;
-       sel++) {
+  for (int sel = 0; sel < kNumWeakSelectors; sel++) {
     delete new_weak_tables_[sel];
     delete old_weak_tables_[sel];
   }
@@ -138,8 +135,8 @@
     return addr;
   }
   // Give up allocating this object.
-  OS::PrintErr(
-      "Exhausted heap space, trying to allocate %" Pd " bytes.\n", size);
+  OS::PrintErr("Exhausted heap space, trying to allocate %" Pd " bytes.\n",
+               size);
   return 0;
 }
 
@@ -178,8 +175,7 @@
 }
 
 bool Heap::Contains(uword addr) const {
-  return new_space_.Contains(addr) ||
-      old_space_.Contains(addr);
+  return new_space_.Contains(addr) || old_space_.Contains(addr);
 }
 
 
@@ -302,8 +298,7 @@
 bool Heap::BeginNewSpaceGC(Thread* thread) {
   MonitorLocker ml(&gc_in_progress_monitor_);
   bool start_gc_on_thread = true;
-  while (gc_new_space_in_progress_ ||
-         gc_old_space_in_progress_) {
+  while (gc_new_space_in_progress_ || gc_old_space_in_progress_) {
     start_gc_on_thread = !gc_new_space_in_progress_;
     ml.WaitWithSafepointCheck(thread);
   }
@@ -326,8 +321,7 @@
 bool Heap::BeginOldSpaceGC(Thread* thread) {
   MonitorLocker ml(&gc_in_progress_monitor_);
   bool start_gc_on_thread = true;
-  while (gc_new_space_in_progress_ ||
-         gc_old_space_in_progress_) {
+  while (gc_new_space_in_progress_ || gc_old_space_in_progress_) {
     start_gc_on_thread = !gc_old_space_in_progress_;
     ml.WaitWithSafepointCheck(thread);
   }
@@ -510,9 +504,7 @@
                 intptr_t max_old_gen_words,
                 intptr_t max_external_words) {
   ASSERT(isolate->heap() == NULL);
-  Heap* heap = new Heap(isolate,
-                        max_new_gen_words,
-                        max_old_gen_words,
+  Heap* heap = new Heap(isolate, max_new_gen_words, max_old_gen_words,
                         max_external_words);
   isolate->set_heap(heap);
 }
@@ -527,12 +519,12 @@
 ObjectSet* Heap::CreateAllocatedObjectSet(
     Zone* zone,
     MarkExpectation mark_expectation) const {
-  ObjectSet* allocated_set = new(zone) ObjectSet(zone);
+  ObjectSet* allocated_set = new (zone) ObjectSet(zone);
 
   this->AddRegionsToObjectSet(allocated_set);
   {
-    VerifyObjectVisitor object_visitor(
-        isolate(), allocated_set, mark_expectation);
+    VerifyObjectVisitor object_visitor(isolate(), allocated_set,
+                                       mark_expectation);
     this->VisitObjects(&object_visitor);
   }
 
@@ -540,8 +532,8 @@
   vm_isolate->heap()->AddRegionsToObjectSet(allocated_set);
   {
     // VM isolate heap is premarked.
-    VerifyObjectVisitor vm_object_visitor(
-        isolate(), allocated_set, kRequireMarked);
+    VerifyObjectVisitor vm_object_visitor(isolate(), allocated_set,
+                                          kRequireMarked);
     vm_isolate->heap()->VisitObjects(&vm_object_visitor);
   }
 
@@ -557,8 +549,8 @@
 
 bool Heap::VerifyGC(MarkExpectation mark_expectation) const {
   StackZone stack_zone(Thread::Current());
-  ObjectSet* allocated_set = CreateAllocatedObjectSet(stack_zone.GetZone(),
-                                                      mark_expectation);
+  ObjectSet* allocated_set =
+      CreateAllocatedObjectSet(stack_zone.GetZone(), mark_expectation);
   VerifyPointersVisitor visitor(isolate(), allocated_set);
   VisitObjectPointers(&visitor);
 
@@ -568,12 +560,12 @@
 
 
 void Heap::PrintSizes() const {
-  OS::PrintErr("New space (%" Pd64 "k of %" Pd64 "k) "
-               "Old space (%" Pd64 "k of %" Pd64 "k)\n",
-               (UsedInWords(kNew) / KBInWords),
-               (CapacityInWords(kNew) / KBInWords),
-               (UsedInWords(kOld) / KBInWords),
-               (CapacityInWords(kOld) / KBInWords));
+  OS::PrintErr(
+      "New space (%" Pd64 "k of %" Pd64
+      "k) "
+      "Old space (%" Pd64 "k of %" Pd64 "k)\n",
+      (UsedInWords(kNew) / KBInWords), (CapacityInWords(kNew) / KBInWords),
+      (UsedInWords(kOld) / KBInWords), (CapacityInWords(kOld) / KBInWords));
 }
 
 
@@ -583,14 +575,14 @@
 
 
 int64_t Heap::CapacityInWords(Space space) const {
-  return space == kNew ? new_space_.CapacityInWords() :
-                         old_space_.CapacityInWords();
+  return space == kNew ? new_space_.CapacityInWords()
+                       : old_space_.CapacityInWords();
 }
 
 
 int64_t Heap::ExternalInWords(Space space) const {
-  return space == kNew ? new_space_.ExternalInWords() :
-                         old_space_.ExternalInWords();
+  return space == kNew ? new_space_.ExternalInWords()
+                       : old_space_.ExternalInWords();
 }
 
 
@@ -638,13 +630,13 @@
 
 int64_t Heap::HashCount() const {
   return new_weak_tables_[kHashes]->count() +
-      old_weak_tables_[kHashes]->count();
+         old_weak_tables_[kHashes]->count();
 }
 
 
 int64_t Heap::ObjectIdCount() const {
   return new_weak_tables_[kObjectIds]->count() +
-      old_weak_tables_[kObjectIds]->count();
+         old_weak_tables_[kObjectIds]->count();
 }
 
 
@@ -733,12 +725,14 @@
 
   if ((FLAG_verbose_gc_hdr != 0) &&
       (((stats_.num_ - 1) % FLAG_verbose_gc_hdr) == 0)) {
-    OS::PrintErr("[    GC    |  space  | count | start | gc time | "
-                 "new gen (KB) | old gen (KB) | timers | data ]\n"
-                 "[ (isolate)| (reason)|       |  (s)  |   (ms)  | "
-                 "used,cap,ext | used,cap,ext |  (ms)  |      ]\n");
+    OS::PrintErr(
+        "[    GC    |  space  | count | start | gc time | "
+        "new gen (KB) | old gen (KB) | timers | data ]\n"
+        "[ (isolate)| (reason)|       |  (s)  |   (ms)  | "
+        "used,cap,ext | used,cap,ext |  (ms)  |      ]\n");
   }
 
+  // clang-format off
   const char* space_str = stats_.space_ == kNew ? "Scavenge" : "Mark-Sweep";
   OS::PrintErr(
     "[ GC(%" Pd64 "): %s(%s), "  // GC(isolate), space(reason)
@@ -779,6 +773,7 @@
     stats_.data_[1],
     stats_.data_[2],
     stats_.data_[3]);
+  // clang-format on
 }
 
 
@@ -788,55 +783,31 @@
     return;
   }
   event->SetNumArguments(12);
-  event->FormatArgument(0,
-                        "Before.New.Used (kB)",
-                        "%" Pd "",
+  event->FormatArgument(0, "Before.New.Used (kB)", "%" Pd "",
                         RoundWordsToKB(stats_.before_.new_.used_in_words));
-  event->FormatArgument(1,
-                        "After.New.Used (kB)",
-                        "%" Pd "",
+  event->FormatArgument(1, "After.New.Used (kB)", "%" Pd "",
                         RoundWordsToKB(stats_.after_.new_.used_in_words));
-  event->FormatArgument(2,
-                        "Before.Old.Used (kB)",
-                        "%" Pd "",
+  event->FormatArgument(2, "Before.Old.Used (kB)", "%" Pd "",
                         RoundWordsToKB(stats_.before_.old_.used_in_words));
-  event->FormatArgument(3,
-                        "After.Old.Used (kB)",
-                        "%" Pd "",
+  event->FormatArgument(3, "After.Old.Used (kB)", "%" Pd "",
                         RoundWordsToKB(stats_.after_.old_.used_in_words));
 
-  event->FormatArgument(4,
-                        "Before.New.Capacity (kB)",
-                        "%" Pd "",
+  event->FormatArgument(4, "Before.New.Capacity (kB)", "%" Pd "",
                         RoundWordsToKB(stats_.before_.new_.capacity_in_words));
-  event->FormatArgument(5,
-                        "After.New.Capacity (kB)",
-                        "%" Pd "",
+  event->FormatArgument(5, "After.New.Capacity (kB)", "%" Pd "",
                         RoundWordsToKB(stats_.after_.new_.capacity_in_words));
-  event->FormatArgument(6,
-                        "Before.Old.Capacity (kB)",
-                        "%" Pd "",
+  event->FormatArgument(6, "Before.Old.Capacity (kB)", "%" Pd "",
                         RoundWordsToKB(stats_.before_.old_.capacity_in_words));
-  event->FormatArgument(7,
-                        "After.Old.Capacity (kB)",
-                        "%" Pd "",
+  event->FormatArgument(7, "After.Old.Capacity (kB)", "%" Pd "",
                         RoundWordsToKB(stats_.after_.old_.capacity_in_words));
 
-  event->FormatArgument(8,
-                        "Before.New.External (kB)",
-                        "%" Pd "",
+  event->FormatArgument(8, "Before.New.External (kB)", "%" Pd "",
                         RoundWordsToKB(stats_.before_.new_.external_in_words));
-  event->FormatArgument(9,
-                        "After.New.External (kB)",
-                        "%" Pd "",
+  event->FormatArgument(9, "After.New.External (kB)", "%" Pd "",
                         RoundWordsToKB(stats_.after_.new_.external_in_words));
-  event->FormatArgument(10,
-                        "Before.Old.External (kB)",
-                        "%" Pd "",
+  event->FormatArgument(10, "Before.Old.External (kB)", "%" Pd "",
                         RoundWordsToKB(stats_.before_.old_.external_in_words));
-  event->FormatArgument(11,
-                        "After.Old.External (kB)",
-                        "%" Pd "",
+  event->FormatArgument(11, "After.Old.External (kB)", "%" Pd "",
                         RoundWordsToKB(stats_.after_.old_.external_in_words));
 #endif  // !defined(PRODUCT)
 }
@@ -844,15 +815,15 @@
 
 NoHeapGrowthControlScope::NoHeapGrowthControlScope()
     : StackResource(Thread::Current()) {
-    Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap();
-    current_growth_controller_state_ = heap->GrowthControlState();
-    heap->DisableGrowthControl();
+  Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap();
+  current_growth_controller_state_ = heap->GrowthControlState();
+  heap->DisableGrowthControl();
 }
 
 
 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() {
-    Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap();
-    heap->SetGrowthControlState(current_growth_controller_state_);
+  Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap();
+  heap->SetGrowthControlState(current_growth_controller_state_);
 }
 
 
diff --git a/runtime/vm/heap.h b/runtime/vm/heap.h
index deae0a0..3e05e13 100644
--- a/runtime/vm/heap.h
+++ b/runtime/vm/heap.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_HEAP_H_
-#define VM_HEAP_H_
+#ifndef RUNTIME_VM_HEAP_H_
+#define RUNTIME_VM_HEAP_H_
 
 #include "platform/assert.h"
 #include "vm/allocation.h"
@@ -33,17 +33,9 @@
     kCode,
   };
 
-  enum WeakSelector {
-    kPeers = 0,
-    kHashes,
-    kObjectIds,
-    kNumWeakSelectors
-  };
+  enum WeakSelector { kPeers = 0, kHashes, kObjectIds, kNumWeakSelectors };
 
-  enum ApiCallbacks {
-    kIgnoreApiCallbacks,
-    kInvokeApiCallbacks
-  };
+  enum ApiCallbacks { kIgnoreApiCallbacks, kInvokeApiCallbacks };
 
   enum GCReason {
     kNewSpace,
@@ -211,7 +203,7 @@
     if (space == kNew) {
       return new_weak_tables_[selector];
     }
-    ASSERT(space ==kOld);
+    ASSERT(space == kOld);
     return old_weak_tables_[selector];
   }
   void SetWeakTable(Space space, WeakSelector selector, WeakTable* value) {
@@ -272,13 +264,12 @@
       int64_t micros_;
       SpaceUsage new_;
       SpaceUsage old_;
+
      private:
       DISALLOW_COPY_AND_ASSIGN(Data);
     };
 
-    enum {
-      kDataEntries = 4
-    };
+    enum { kDataEntries = 4 };
 
     Data before_;
     Data after_;
@@ -312,10 +303,12 @@
   bool VerifyGC(MarkExpectation mark_expectation = kForbidMarked) const;
 
   // Helper functions for garbage collection.
-  void CollectNewSpaceGarbage(
-      Thread* thread, ApiCallbacks api_callbacks, GCReason reason);
-  void CollectOldSpaceGarbage(
-      Thread* thread, ApiCallbacks api_callbacks, GCReason reason);
+  void CollectNewSpaceGarbage(Thread* thread,
+                              ApiCallbacks api_callbacks,
+                              GCReason reason);
+  void CollectOldSpaceGarbage(Thread* thread,
+                              ApiCallbacks api_callbacks,
+                              GCReason reason);
 
   // GC stats collection.
   void RecordBeforeGC(Space space, GCReason reason);
@@ -355,10 +348,10 @@
   bool gc_new_space_in_progress_;
   bool gc_old_space_in_progress_;
 
-  friend class Become;  // VisitObjectPointers
+  friend class Become;       // VisitObjectPointers
   friend class Precompiler;  // VisitObjects
   friend class ServiceEvent;
-  friend class PageSpace;  // VerifyGC
+  friend class PageSpace;             // VerifyGC
   friend class IsolateReloadContext;  // VisitObjects
 
   DISALLOW_COPY_AND_ASSIGN(Heap);
@@ -369,6 +362,7 @@
  public:
   HeapIterationScope();
   ~HeapIterationScope();
+
  private:
   NoSafepointScope no_safepoint_scope_;
   PageSpace* old_space_;
@@ -381,6 +375,7 @@
  public:
   NoHeapGrowthControlScope();
   ~NoHeapGrowthControlScope();
+
  private:
   bool current_growth_controller_state_;
   DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope);
@@ -396,4 +391,4 @@
 
 }  // namespace dart
 
-#endif  // VM_HEAP_H_
+#endif  // RUNTIME_VM_HEAP_H_
diff --git a/runtime/vm/heap_test.cc b/runtime/vm/heap_test.cc
index 7454cf4..939225f 100644
--- a/runtime/vm/heap_test.cc
+++ b/runtime/vm/heap_test.cc
@@ -15,9 +15,9 @@
 
 TEST_CASE(OldGC) {
   const char* kScriptChars =
-  "main() {\n"
-  "  return [1, 2, 3];\n"
-  "}\n";
+      "main() {\n"
+      "  return [1, 2, 3];\n"
+      "}\n";
   FLAG_verbose_gc = true;
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
   Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
@@ -35,9 +35,9 @@
 TEST_CASE(OldGC_Unsync) {
   FLAG_marker_tasks = 0;
   const char* kScriptChars =
-  "main() {\n"
-  "  return [1, 2, 3];\n"
-  "}\n";
+      "main() {\n"
+      "  return [1, 2, 3];\n"
+      "}\n";
   FLAG_verbose_gc = true;
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
   Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
@@ -54,9 +54,9 @@
 
 TEST_CASE(LargeSweep) {
   const char* kScriptChars =
-  "main() {\n"
-  "  return new List(8 * 1024 * 1024);\n"
-  "}\n";
+      "main() {\n"
+      "  return new List(8 * 1024 * 1024);\n"
+      "}\n";
   FLAG_verbose_gc = true;
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
   Dart_EnterScope();
@@ -101,15 +101,15 @@
 
 TEST_CASE(ClassHeapStats) {
   const char* kScriptChars =
-  "class A {\n"
-  "  var a;\n"
-  "  var b;\n"
-  "}\n"
-  ""
-  "main() {\n"
-  "  var x = new A();\n"
-  "  return new A();\n"
-  "}\n";
+      "class A {\n"
+      "  var a;\n"
+      "  var b;\n"
+      "}\n"
+      ""
+      "main() {\n"
+      "  var x = new A();\n"
+      "  return new A();\n"
+      "}\n";
   Dart_Handle h_lib = TestCase::LoadTestScript(kScriptChars, NULL);
   Isolate* isolate = Isolate::Current();
   ClassTable* class_table = isolate->class_table();
@@ -126,8 +126,7 @@
   ASSERT(!cls.IsNull());
   intptr_t cid = cls.id();
   ClassHeapStats* class_stats =
-      ClassHeapStatsTestHelper::GetHeapStatsForCid(class_table,
-                                                   cid);
+      ClassHeapStatsTestHelper::GetHeapStatsForCid(class_table, cid);
   // Verify preconditions:
   EXPECT_EQ(0, class_stats->pre_gc.old_count);
   EXPECT_EQ(0, class_stats->post_gc.old_count);
@@ -196,20 +195,19 @@
 
 TEST_CASE(ArrayHeapStats) {
   const char* kScriptChars =
-  "List f(int len) {\n"
-  "  return new List(len);\n"
-  "}\n"
-  ""
-  "main() {\n"
-  "  return f(1234);\n"
-  "}\n";
+      "List f(int len) {\n"
+      "  return new List(len);\n"
+      "}\n"
+      ""
+      "main() {\n"
+      "  return f(1234);\n"
+      "}\n";
   Dart_Handle h_lib = TestCase::LoadTestScript(kScriptChars, NULL);
   Isolate* isolate = Isolate::Current();
   ClassTable* class_table = isolate->class_table();
   intptr_t cid = kArrayCid;
   ClassHeapStats* class_stats =
-      ClassHeapStatsTestHelper::GetHeapStatsForCid(class_table,
-                                                   cid);
+      ClassHeapStatsTestHelper::GetHeapStatsForCid(class_table, cid);
   Dart_EnterScope();
   // Invoke 'main' twice, since initial compilation might trigger extra array
   // allocations.
@@ -242,11 +240,10 @@
     EXPECT_GT(Thread::Current()->no_safepoint_scope_depth(), 0);
 #endif
   }
-  virtual ~FindOnly() { }
+  virtual ~FindOnly() {}
 
-  virtual bool FindObject(RawObject* obj) const {
-    return obj == target_;
-  }
+  virtual bool FindObject(RawObject* obj) const { return obj == target_; }
+
  private:
   RawObject* target_;
 };
@@ -254,8 +251,8 @@
 
 class FindNothing : public FindObjectVisitor {
  public:
-  FindNothing() { }
-  virtual ~FindNothing() { }
+  FindNothing() {}
+  virtual ~FindNothing() {}
   virtual bool FindObject(RawObject* obj) const { return false; }
 };
 
diff --git a/runtime/vm/il_printer.cc b/runtime/vm/il_printer.cc
index d8d18f3..bfee006 100644
--- a/runtime/vm/il_printer.cc
+++ b/runtime/vm/il_printer.cc
@@ -13,11 +13,15 @@
 
 #ifndef PRODUCT
 
-DEFINE_FLAG(bool, display_sorted_ic_data, false,
-    "Calls display a unary, sorted-by count form of ICData");
+DEFINE_FLAG(bool,
+            display_sorted_ic_data,
+            false,
+            "Calls display a unary, sorted-by count form of ICData");
 DEFINE_FLAG(bool, print_environments, false, "Print SSA environments.");
-DEFINE_FLAG(charp, print_flow_graph_filter, NULL,
-    "Print only IR of functions with matching names");
+DEFINE_FLAG(charp,
+            print_flow_graph_filter,
+            NULL,
+            "Print only IR of functions with matching names");
 
 DECLARE_FLAG(bool, trace_inlining_intervals);
 
@@ -32,8 +36,7 @@
 void BufferFormatter::VPrint(const char* format, va_list args) {
   intptr_t available = size_ - position_;
   if (available <= 0) return;
-  intptr_t written =
-      OS::VSNPrint(buffer_ + position_, available, format, args);
+  intptr_t written = OS::VSNPrint(buffer_ + position_, available, format, args);
   if (written >= 0) {
     position_ += (available <= written) ? available : written;
   }
@@ -65,8 +68,8 @@
     const intptr_t token_len = strlen(token);
     if (token[token_len - 1] == '%') {
       if (function_name_len > token_len) {
-        const char* suffix = function_name +
-            (function_name_len - token_len + 1);
+        const char* suffix =
+            function_name + (function_name_len - token_len + 1);
         if (strncmp(suffix, token, token_len - 1) == 0) {
           found = true;
           break;
@@ -154,17 +157,16 @@
                                       const AbstractType& dst_type,
                                       const String& dst_name,
                                       bool eliminated) {
-    const char* compile_type_name = "unknown";
-    if (value != NULL && value->reaching_type_ != NULL) {
-      compile_type_name = value->reaching_type_->ToCString();
-    }
-    THR_Print("%s type check: compile type %s is %s specific than "
-              "type '%s' of '%s'.\n",
-                         eliminated ? "Eliminated" : "Generated",
-                         compile_type_name,
-                         eliminated ? "more" : "not more",
-                         String::Handle(dst_type.Name()).ToCString(),
-                         dst_name.ToCString());
+  const char* compile_type_name = "unknown";
+  if (value != NULL && value->reaching_type_ != NULL) {
+    compile_type_name = value->reaching_type_->ToCString();
+  }
+  THR_Print(
+      "%s type check: compile type %s is %s specific than "
+      "type '%s' of '%s'.\n",
+      eliminated ? "Eliminated" : "Generated", compile_type_name,
+      eliminated ? "more" : "not more",
+      String::Handle(dst_type.Name()).ToCString(), dst_name.ToCString());
 }
 
 
@@ -231,14 +233,13 @@
                                     const ICData& ic_data_orig) {
   const ICData& ic_data =
       ICData::Handle(ic_data_orig.AsUnaryClassChecksSortedByCount());
-  f->Print(" IC[n:%" Pd"; ", ic_data.NumberOfChecks());
+  f->Print(" IC[n:%" Pd "; ", ic_data.NumberOfChecks());
   for (intptr_t i = 0; i < ic_data.NumberOfChecks(); i++) {
     const intptr_t count = ic_data.GetCountAt(i);
     const intptr_t cid = ic_data.GetReceiverClassIdAt(i);
     const Class& cls =
         Class::Handle(Isolate::Current()->class_table()->At(cid));
-    f->Print("%s : %" Pd ", ",
-        String::Handle(cls.Name()).ToCString(), count);
+    f->Print("%s : %" Pd ", ", String::Handle(cls.Name()).ToCString(), count);
   }
   f->Print("]");
 }
@@ -259,7 +260,7 @@
   if (definition.HasSSATemp()) {
     if (definition.HasPairRepresentation()) {
       f->Print("(v%" Pd ", v%" Pd ")", definition.ssa_temp_index(),
-                                       definition.ssa_temp_index() + 1);
+               definition.ssa_temp_index() + 1);
     } else {
       f->Print("v%" Pd "", definition.ssa_temp_index());
     }
@@ -332,8 +333,7 @@
 void Value::PrintTo(BufferFormatter* f) const {
   PrintUse(f, *definition());
 
-  if ((reaching_type_ != NULL) &&
-      (reaching_type_ != definition()->type_)) {
+  if ((reaching_type_ != NULL) && (reaching_type_ != definition()->type_)) {
     f->Print(" ");
     reaching_type_->PrintTo(f);
   }
@@ -423,9 +423,7 @@
 
 void AssertAssignableInstr::PrintOperandsTo(BufferFormatter* f) const {
   value()->PrintTo(f);
-  f->Print(", %s, '%s'",
-           dst_type().ToCString(),
-           dst_name().ToCString());
+  f->Print(", %s, '%s'", dst_type().ToCString(), dst_name().ToCString());
   f->Print(" instantiator_type_arguments(");
   instantiator_type_arguments()->PrintTo(f);
   f->Print(")");
@@ -498,8 +496,8 @@
   left()->PrintTo(f);
   f->Print(" %s [", Token::Str(kind()));
   for (intptr_t i = 0; i < cid_results().length(); i += 2) {
-    f->Print("0x%" Px ":%s ",
-        cid_results()[i], cid_results()[i + 1] == 0 ? "false" : "true");
+    f->Print("0x%" Px ":%s ", cid_results()[i],
+             cid_results()[i + 1] == 0 ? "false" : "true");
   }
   f->Print("] ");
 }
@@ -538,8 +536,7 @@
 
 
 void GuardFieldInstr::PrintOperandsTo(BufferFormatter* f) const {
-  f->Print("%s %s, ",
-           String::Handle(field().name()).ToCString(),
+  f->Print("%s %s, ", String::Handle(field().name()).ToCString(),
            field().GuardedPropertiesAsCString());
   value()->PrintTo(f);
 }
@@ -549,8 +546,7 @@
   if (field().IsNull()) {
     f->Print("{%" Pd "}, ", offset_in_bytes());
   } else {
-    f->Print("%s {%" Pd "}, ",
-             String::Handle(field().name()).ToCString(),
+    f->Print("%s {%" Pd "}, ", String::Handle(field().name()).ToCString(),
              field().Offset());
   }
   instance()->PrintTo(f);
@@ -561,9 +557,7 @@
 
 void IfThenElseInstr::PrintOperandsTo(BufferFormatter* f) const {
   comparison()->PrintOperandsTo(f);
-  f->Print(" ? %" Pd " : %" Pd,
-           if_true_,
-           if_false_);
+  f->Print(" ? %" Pd " : %" Pd, if_true_, if_false_);
 }
 
 
@@ -580,9 +574,8 @@
 
 void InstanceOfInstr::PrintOperandsTo(BufferFormatter* f) const {
   value()->PrintTo(f);
-  f->Print(" %s %s",
-            negate_result() ? "ISNOT" : "IS",
-            String::Handle(type().Name()).ToCString());
+  f->Print(" %s %s", negate_result() ? "ISNOT" : "IS",
+           String::Handle(type().Name()).ToCString());
   f->Print(" type-arg(");
   instantiator_type_arguments()->PrintTo(f);
   f->Print(")");
@@ -629,12 +622,11 @@
     const char* expected = "?";
     if (field()->guarded_cid() != kIllegalCid) {
       const Class& cls = Class::Handle(
-            Isolate::Current()->class_table()->At(field()->guarded_cid()));
+          Isolate::Current()->class_table()->At(field()->guarded_cid()));
       expected = String::Handle(cls.Name()).ToCString();
     }
 
-    f->Print(" [%s %s]",
-             field()->is_nullable() ? "nullable" : "non-nullable",
+    f->Print(" [%s %s]", field()->is_nullable() ? "nullable" : "non-nullable",
              expected);
   }
 
@@ -704,6 +696,15 @@
 }
 
 
+void CheckedSmiComparisonInstr::PrintOperandsTo(BufferFormatter* f) const {
+  f->Print("%s", Token::Str(kind()));
+  f->Print(", ");
+  left()->PrintTo(f);
+  f->Print(", ");
+  right()->PrintTo(f);
+}
+
+
 void BinaryIntegerOpInstr::PrintOperandsTo(BufferFormatter* f) const {
   f->Print("%s", Token::Str(op_kind()));
   if (is_truncating()) {
@@ -726,6 +727,21 @@
 }
 
 
+void DoubleTestOpInstr::PrintOperandsTo(BufferFormatter* f) const {
+  switch (op_kind()) {
+    case MethodRecognizer::kDouble_getIsNaN:
+      f->Print("IsNaN ");
+      break;
+    case MethodRecognizer::kDouble_getIsInfinite:
+      f->Print("IsInfinite ");
+      break;
+    default:
+      UNREACHABLE();
+  }
+  value()->PrintTo(f);
+}
+
+
 void BinaryFloat32x4OpInstr::PrintOperandsTo(BufferFormatter* f) const {
   f->Print("%s, ", Token::Str(op_kind()));
   left()->PrintTo(f);
@@ -967,7 +983,7 @@
   value()->PrintTo(f);
 
   const Class& cls =
-    Class::Handle(Isolate::Current()->class_table()->At(cid()));
+      Class::Handle(Isolate::Current()->class_table()->At(cid()));
   f->Print(", %s", String::Handle(cls.ScrubbedName()).ToCString());
 }
 
@@ -1008,8 +1024,8 @@
 
 void JoinEntryInstr::PrintTo(BufferFormatter* f) const {
   if (try_index() != CatchClauseNode::kInvalidTryIndex) {
-    f->Print("B%" Pd "[join try_idx %" Pd "]:%" Pd " pred(",
-             block_id(), try_index(), GetDeoptId());
+    f->Print("B%" Pd "[join try_idx %" Pd "]:%" Pd " pred(", block_id(),
+             try_index(), GetDeoptId());
   } else {
     f->Print("B%" Pd "[join]:%" Pd " pred(", block_id(), GetDeoptId());
   }
@@ -1058,7 +1074,7 @@
 }
 
 
-static const char *RepresentationToCString(Representation rep) {
+static const char* RepresentationToCString(Representation rep) {
   switch (rep) {
     case kTagged:
       return "tagged";
@@ -1093,8 +1109,8 @@
 
 void PhiInstr::PrintTo(BufferFormatter* f) const {
   if (HasPairRepresentation()) {
-    f->Print("(v%" Pd ", v%" Pd ") <- phi(",
-             ssa_temp_index(), ssa_temp_index() + 1);
+    f->Print("(v%" Pd ", v%" Pd ") <- phi(", ssa_temp_index(),
+             ssa_temp_index() + 1);
   } else {
     f->Print("v%" Pd " <- phi(", ssa_temp_index());
   }
@@ -1113,8 +1129,7 @@
     range_->PrintTo(f);
   }
 
-  if (representation() != kNoRepresentation &&
-      representation() != kTagged) {
+  if (representation() != kNoRepresentation && representation() != kTagged) {
     f->Print(" %s", RepresentationToCString(representation()));
   }
 
@@ -1134,10 +1149,8 @@
 
 
 void UnboxedIntConverterInstr::PrintOperandsTo(BufferFormatter* f) const {
-  f->Print("%s->%s%s, ",
-           RepresentationToCString(from()),
-           RepresentationToCString(to()),
-           is_truncating() ? "[tr]" : "");
+  f->Print("%s->%s%s, ", RepresentationToCString(from()),
+           RepresentationToCString(to()), is_truncating() ? "[tr]" : "");
   Definition::PrintOperandsTo(f);
 }
 
@@ -1154,8 +1167,8 @@
 
 void TargetEntryInstr::PrintTo(BufferFormatter* f) const {
   if (try_index() != CatchClauseNode::kInvalidTryIndex) {
-    f->Print("B%" Pd "[target try_idx %" Pd "]:%" Pd,
-             block_id(), try_index(), GetDeoptId());
+    f->Print("B%" Pd "[target try_idx %" Pd "]:%" Pd, block_id(), try_index(),
+             GetDeoptId());
   } else {
     f->Print("B%" Pd "[target]:%" Pd, block_id(), GetDeoptId());
   }
@@ -1221,9 +1234,8 @@
   f->Print("if ");
   comparison()->PrintTo(f);
 
-  f->Print(" goto (%" Pd ", %" Pd ")",
-            true_successor()->block_id(),
-            false_successor()->block_id());
+  f->Print(" goto (%" Pd ", %" Pd ")", true_successor()->block_id(),
+           false_successor()->block_id());
 }
 
 
diff --git a/runtime/vm/il_printer.h b/runtime/vm/il_printer.h
index b800ab7..7b27a61 100644
--- a/runtime/vm/il_printer.h
+++ b/runtime/vm/il_printer.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_IL_PRINTER_H_
-#define VM_IL_PRINTER_H_
+#ifndef RUNTIME_VM_IL_PRINTER_H_
+#define RUNTIME_VM_IL_PRINTER_H_
 
 #include "vm/flow_graph.h"
 #include "vm/intermediate_language.h"
@@ -13,9 +13,7 @@
 class BufferFormatter : public ValueObject {
  public:
   BufferFormatter(char* buffer, intptr_t size)
-    : position_(0),
-      buffer_(buffer),
-      size_(size) { }
+      : position_(0), buffer_(buffer), size_(size) {}
 
   void VPrint(const char* format, va_list args);
   void Print(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
@@ -37,11 +35,11 @@
  public:
   static const intptr_t kPrintAll = -1;
 
-  FlowGraphPrinter(const FlowGraph& flow_graph,
-                   bool print_locations = false)
+  explicit FlowGraphPrinter(const FlowGraph& flow_graph,
+                            bool print_locations = false)
       : function_(flow_graph.function()),
         block_order_(flow_graph.reverse_postorder()),
-        print_locations_(print_locations) { }
+        print_locations_(print_locations) {}
 
   // Print the instructions in a block terminated by newlines.  Add "goto N"
   // to the end of the block if it ends with an unconditional jump to
@@ -76,4 +74,4 @@
 
 }  // namespace dart
 
-#endif  // VM_IL_PRINTER_H_
+#endif  // RUNTIME_VM_IL_PRINTER_H_
diff --git a/runtime/vm/instructions.h b/runtime/vm/instructions.h
index 2274bec..be8c604 100644
--- a/runtime/vm/instructions.h
+++ b/runtime/vm/instructions.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_INSTRUCTIONS_H_
-#define VM_INSTRUCTIONS_H_
+#ifndef RUNTIME_VM_INSTRUCTIONS_H_
+#define RUNTIME_VM_INSTRUCTIONS_H_
 
 #include "vm/globals.h"
 
@@ -28,10 +28,8 @@
 class Object;
 class Code;
 
-bool DecodeLoadObjectFromPoolOrThread(uword pc,
-                                      const Code& code,
-                                      Object* obj);
+bool DecodeLoadObjectFromPoolOrThread(uword pc, const Code& code, Object* obj);
 
 }  // namespace dart
 
-#endif  // VM_INSTRUCTIONS_H_
+#endif  // RUNTIME_VM_INSTRUCTIONS_H_
diff --git a/runtime/vm/instructions_arm.cc b/runtime/vm/instructions_arm.cc
index 0e5cfb2..8de71db 100644
--- a/runtime/vm/instructions_arm.cc
+++ b/runtime/vm/instructions_arm.cc
@@ -5,10 +5,12 @@
 #include "vm/globals.h"  // Needed here to get TARGET_ARCH_ARM.
 #if defined(TARGET_ARCH_ARM)
 
+#include "vm/instructions.h"
+#include "vm/instructions_arm.h"
+
 #include "vm/assembler.h"
 #include "vm/constants_arm.h"
 #include "vm/cpu.h"
-#include "vm/instructions.h"
 #include "vm/object.h"
 
 namespace dart {
@@ -24,29 +26,12 @@
   ASSERT(*(reinterpret_cast<uword*>(end_) - 1) == 0xe12fff3e);
 
   Register reg;
-  ic_data_load_end_ =
-      InstructionPattern::DecodeLoadWordFromPool(end_ - 2 * Instr::kInstrSize,
-                                                 &reg,
-                                                 &target_code_pool_index_);
+  ic_data_load_end_ = InstructionPattern::DecodeLoadWordFromPool(
+      end_ - 2 * Instr::kInstrSize, &reg, &target_code_pool_index_);
   ASSERT(reg == CODE_REG);
 }
 
 
-int CallPattern::DeoptCallPatternLengthInInstructions() {
-  const ARMVersion version = TargetCPUFeatures::arm_version();
-  if ((version == ARMv5TE) || (version == ARMv6)) {
-    return 5;
-  } else {
-    ASSERT(version == ARMv7);
-    return 3;
-  }
-}
-
-int CallPattern::DeoptCallPatternLengthInBytes() {
-  return DeoptCallPatternLengthInInstructions() * Instr::kInstrSize;
-}
-
-
 NativeCallPattern::NativeCallPattern(uword pc, const Code& code)
     : object_pool_(ObjectPool::Handle(code.GetObjectPool())),
       end_(pc),
@@ -57,13 +42,10 @@
   ASSERT(*(reinterpret_cast<uword*>(end_) - 1) == 0xe12fff3e);
 
   Register reg;
-  uword native_function_load_end =
-      InstructionPattern::DecodeLoadWordFromPool(end_ - 2 * Instr::kInstrSize,
-                                                 &reg,
-                                                 &target_code_pool_index_);
+  uword native_function_load_end = InstructionPattern::DecodeLoadWordFromPool(
+      end_ - 2 * Instr::kInstrSize, &reg, &target_code_pool_index_);
   ASSERT(reg == CODE_REG);
-  InstructionPattern::DecodeLoadWordFromPool(native_function_load_end,
-                                             &reg,
+  InstructionPattern::DecodeLoadWordFromPool(native_function_load_end, &reg,
                                              &native_function_pool_index_);
   ASSERT(reg == R9);
 }
@@ -89,7 +71,7 @@
 
 void NativeCallPattern::set_native_function(NativeFunction func) const {
   object_pool_.SetRawValueAt(native_function_pool_index_,
-      reinterpret_cast<uword>(func));
+                             reinterpret_cast<uword>(func));
 }
 
 
@@ -169,8 +151,10 @@
 }
 
 
-static bool IsLoadWithOffset(int32_t instr, Register base,
-                             intptr_t* offset, Register* dst) {
+static bool IsLoadWithOffset(int32_t instr,
+                             Register base,
+                             intptr_t* offset,
+                             Register* dst) {
   if ((instr & 0xffff0000) == (0xe5900000 | (base << 16))) {
     // ldr reg, [base, #+offset]
     *offset = instr & 0xfff;
@@ -216,9 +200,7 @@
 }
 
 
-bool DecodeLoadObjectFromPoolOrThread(uword pc,
-                                      const Code& code,
-                                      Object* obj) {
+bool DecodeLoadObjectFromPoolOrThread(uword pc, const Code& code, Object* obj) {
   ASSERT(code.ContainsInstructionAt(pc));
 
   int32_t instr = Instr::At(pc)->InstructionBits();
@@ -243,9 +225,7 @@
 RawICData* CallPattern::IcData() {
   if (ic_data_.IsNull()) {
     Register reg;
-    InstructionPattern::DecodeLoadObject(ic_data_load_end_,
-                                         object_pool_,
-                                         &reg,
+    InstructionPattern::DecodeLoadObject(ic_data_load_end_, object_pool_, &reg,
                                          &ic_data_);
     ASSERT(reg == R9);
   }
@@ -264,49 +244,6 @@
 }
 
 
-void CallPattern::InsertDeoptCallAt(uword pc, uword target_address) {
-  const ARMVersion version = TargetCPUFeatures::arm_version();
-  if ((version == ARMv5TE) || (version == ARMv6)) {
-    const uint32_t byte0 = (target_address & 0x000000ff);
-    const uint32_t byte1 = (target_address & 0x0000ff00) >> 8;
-    const uint32_t byte2 = (target_address & 0x00ff0000) >> 16;
-    const uint32_t byte3 = (target_address & 0xff000000) >> 24;
-
-    const uword mov_ip = 0xe3a0c400 | byte3;  // mov ip, (byte3 rot 4)
-    const uword or1_ip = 0xe38cc800 | byte2;  // orr ip, ip, (byte2 rot 8)
-    const uword or2_ip = 0xe38ccc00 | byte1;  // orr ip, ip, (byte1 rot 12)
-    const uword or3_ip = 0xe38cc000 | byte0;  // orr ip, ip, byte0
-    const uword blx_ip = 0xe12fff3c;
-
-    *reinterpret_cast<uword*>(pc + (0 * Instr::kInstrSize)) = mov_ip;
-    *reinterpret_cast<uword*>(pc + (1 * Instr::kInstrSize)) = or1_ip;
-    *reinterpret_cast<uword*>(pc + (2 * Instr::kInstrSize)) = or2_ip;
-    *reinterpret_cast<uword*>(pc + (3 * Instr::kInstrSize)) = or3_ip;
-    *reinterpret_cast<uword*>(pc + (4 * Instr::kInstrSize)) = blx_ip;
-
-    ASSERT(DeoptCallPatternLengthInBytes() == 5 * Instr::kInstrSize);
-    CPU::FlushICache(pc, DeoptCallPatternLengthInBytes());
-  } else {
-    ASSERT(version == ARMv7);
-    const uint16_t target_lo = target_address & 0xffff;
-    const uint16_t target_hi = target_address >> 16;
-
-    const uword movw_ip =
-        0xe300c000 | ((target_lo >> 12) << 16) | (target_lo & 0xfff);
-    const uword movt_ip =
-        0xe340c000 | ((target_hi >> 12) << 16) | (target_hi & 0xfff);
-    const uword blx_ip = 0xe12fff3c;
-
-    *reinterpret_cast<uword*>(pc + (0 * Instr::kInstrSize)) = movw_ip;
-    *reinterpret_cast<uword*>(pc + (1 * Instr::kInstrSize)) = movt_ip;
-    *reinterpret_cast<uword*>(pc + (2 * Instr::kInstrSize)) = blx_ip;
-
-    ASSERT(DeoptCallPatternLengthInBytes() == 3 * Instr::kInstrSize);
-    CPU::FlushICache(pc, DeoptCallPatternLengthInBytes());
-  }
-}
-
-
 SwitchableCallPattern::SwitchableCallPattern(uword pc, const Code& code)
     : object_pool_(ObjectPool::Handle(code.GetObjectPool())),
       data_pool_index_(-1),
@@ -316,15 +253,12 @@
   ASSERT(*(reinterpret_cast<uword*>(pc) - 1) == 0xe12fff3e);
 
   Register reg;
-  uword stub_load_end =
-      InstructionPattern::DecodeLoadWordFromPool(pc - 2 * Instr::kInstrSize,
-                                                 &reg,
-                                                 &target_pool_index_);
-  ASSERT(reg == CODE_REG);
-  InstructionPattern::DecodeLoadWordFromPool(stub_load_end,
-                                             &reg,
-                                             &data_pool_index_);
+  uword data_load_end = InstructionPattern::DecodeLoadWordFromPool(
+      pc - Instr::kInstrSize, &reg, &data_pool_index_);
   ASSERT(reg == R9);
+  InstructionPattern::DecodeLoadWordFromPool(data_load_end - Instr::kInstrSize,
+                                             &reg, &target_pool_index_);
+  ASSERT(reg == CODE_REG);
 }
 
 
@@ -334,8 +268,7 @@
 
 
 RawCode* SwitchableCallPattern::target() const {
-  return reinterpret_cast<RawCode*>(
-      object_pool_.ObjectAt(target_pool_index_));
+  return reinterpret_cast<RawCode*>(object_pool_.ObjectAt(target_pool_index_));
 }
 
 
@@ -351,9 +284,7 @@
 }
 
 
-ReturnPattern::ReturnPattern(uword pc)
-    : pc_(pc) {
-}
+ReturnPattern::ReturnPattern(uword pc) : pc_(pc) {}
 
 
 bool ReturnPattern::IsValid() const {
@@ -361,8 +292,8 @@
   const int32_t B4 = 1 << 4;
   const int32_t B21 = 1 << 21;
   const int32_t B24 = 1 << 24;
-  int32_t instruction = (static_cast<int32_t>(AL) << kConditionShift) |
-                         B24 | B21 | (0xfff << 8) | B4 |
+  int32_t instruction = (static_cast<int32_t>(AL) << kConditionShift) | B24 |
+                        B21 | (0xfff << 8) | B4 |
                         (static_cast<int32_t>(LR) << kRmShift);
   const ARMVersion version = TargetCPUFeatures::arm_version();
   if ((version == ARMv5TE) || (version == ARMv6)) {
diff --git a/runtime/vm/instructions_arm.h b/runtime/vm/instructions_arm.h
index 86d81a7..c4f4811 100644
--- a/runtime/vm/instructions_arm.h
+++ b/runtime/vm/instructions_arm.h
@@ -3,10 +3,10 @@
 // BSD-style license that can be found in the LICENSE file.
 // Classes that describe assembly patterns as used by inline caches.
 
-#ifndef VM_INSTRUCTIONS_ARM_H_
-#define VM_INSTRUCTIONS_ARM_H_
+#ifndef RUNTIME_VM_INSTRUCTIONS_ARM_H_
+#define RUNTIME_VM_INSTRUCTIONS_ARM_H_
 
-#ifndef VM_INSTRUCTIONS_H_
+#ifndef RUNTIME_VM_INSTRUCTIONS_H_
 #error Do not include instructions_arm.h directly; use instructions.h instead.
 #endif
 
@@ -57,13 +57,6 @@
   RawCode* TargetCode() const;
   void SetTargetCode(const Code& code) const;
 
-  // This constant length is only valid for inserted call patterns used for
-  // lazy deoptimization. Regular call pattern may vary in length.
-  static int DeoptCallPatternLengthInBytes();
-  static int DeoptCallPatternLengthInInstructions();
-
-  static void InsertDeoptCallAt(uword pc, uword target_address);
-
  private:
   const ObjectPool& object_pool_;
 
@@ -128,9 +121,7 @@
   // bx_lr = 1.
   static const int kLengthInBytes = 1 * Instr::kInstrSize;
 
-  int pattern_length_in_bytes() const {
-    return kLengthInBytes;
-  }
+  int pattern_length_in_bytes() const { return kLengthInBytes; }
 
   bool IsValid() const;
 
@@ -140,4 +131,4 @@
 
 }  // namespace dart
 
-#endif  // VM_INSTRUCTIONS_ARM_H_
+#endif  // RUNTIME_VM_INSTRUCTIONS_ARM_H_
diff --git a/runtime/vm/instructions_arm64.cc b/runtime/vm/instructions_arm64.cc
index 60ef9bf..b7b26b5 100644
--- a/runtime/vm/instructions_arm64.cc
+++ b/runtime/vm/instructions_arm64.cc
@@ -5,10 +5,12 @@
 #include "vm/globals.h"  // Needed here to get TARGET_ARCH_ARM64.
 #if defined(TARGET_ARCH_ARM64)
 
+#include "vm/instructions.h"
+#include "vm/instructions_arm64.h"
+
 #include "vm/assembler.h"
 #include "vm/constants_arm64.h"
 #include "vm/cpu.h"
-#include "vm/instructions.h"
 #include "vm/object.h"
 
 namespace dart {
@@ -24,10 +26,8 @@
   ASSERT(*(reinterpret_cast<uint32_t*>(end_) - 1) == 0xd63f0200);
 
   Register reg;
-  ic_data_load_end_ =
-      InstructionPattern::DecodeLoadWordFromPool(end_ - 2 * Instr::kInstrSize,
-                                                 &reg,
-                                                 &target_code_pool_index_);
+  ic_data_load_end_ = InstructionPattern::DecodeLoadWordFromPool(
+      end_ - 2 * Instr::kInstrSize, &reg, &target_code_pool_index_);
   ASSERT(reg == CODE_REG);
 }
 
@@ -42,13 +42,10 @@
   ASSERT(*(reinterpret_cast<uint32_t*>(end_) - 1) == 0xd63f0200);
 
   Register reg;
-  uword native_function_load_end =
-      InstructionPattern::DecodeLoadWordFromPool(end_ - 2 * Instr::kInstrSize,
-                                                 &reg,
-                                                 &target_code_pool_index_);
+  uword native_function_load_end = InstructionPattern::DecodeLoadWordFromPool(
+      end_ - 2 * Instr::kInstrSize, &reg, &target_code_pool_index_);
   ASSERT(reg == CODE_REG);
-  InstructionPattern::DecodeLoadWordFromPool(native_function_load_end,
-                                             &reg,
+  InstructionPattern::DecodeLoadWordFromPool(native_function_load_end, &reg,
                                              &native_function_pool_index_);
   ASSERT(reg == R5);
 }
@@ -74,7 +71,7 @@
 
 void NativeCallPattern::set_native_function(NativeFunction func) const {
   object_pool_.SetRawValueAt(native_function_pool_index_,
-      reinterpret_cast<uword>(func));
+                             reinterpret_cast<uword>(func));
 }
 
 
@@ -208,7 +205,7 @@
 
   // Last instruction is always an ldr into a 64-bit X register.
   ASSERT(instr->IsLoadStoreRegOp() && (instr->Bit(22) == 1) &&
-        (instr->Bits(30, 2) == 3));
+         (instr->Bits(30, 2) == 3));
 
   // Grab the destination register from the ldr instruction.
   *reg = instr->RtField();
@@ -259,9 +256,7 @@
 }
 
 
-bool DecodeLoadObjectFromPoolOrThread(uword pc,
-                                      const Code& code,
-                                      Object* obj) {
+bool DecodeLoadObjectFromPoolOrThread(uword pc, const Code& code, Object* obj) {
   ASSERT(code.ContainsInstructionAt(pc));
 
   Instr* instr = Instr::At(pc);
@@ -297,7 +292,7 @@
   Instr* instr = Instr::At(start);
   const int32_t upper12 = offset & 0x00fff000;
   const int32_t lower12 = offset & 0x00000fff;
-  ASSERT((offset & 0xff000000) == 0);  // Can't encode > 24 bits.
+  ASSERT((offset & 0xff000000) == 0);        // Can't encode > 24 bits.
   ASSERT(((lower12 >> 3) << 3) == lower12);  // 8-byte aligned.
   instr->SetImm12Bits(instr->InstructionBits(), lower12 >> 3);
 
@@ -311,9 +306,7 @@
 RawICData* CallPattern::IcData() {
   if (ic_data_.IsNull()) {
     Register reg;
-    InstructionPattern::DecodeLoadObject(ic_data_load_end_,
-                                         object_pool_,
-                                         &reg,
+    InstructionPattern::DecodeLoadObject(ic_data_load_end_, object_pool_, &reg,
                                          &ic_data_);
     ASSERT(reg == R5);
   }
@@ -333,30 +326,6 @@
 }
 
 
-void CallPattern::InsertDeoptCallAt(uword pc, uword target_address) {
-  Instr* movz0 = Instr::At(pc + (0 * Instr::kInstrSize));
-  Instr* movk1 = Instr::At(pc + (1 * Instr::kInstrSize));
-  Instr* movk2 = Instr::At(pc + (2 * Instr::kInstrSize));
-  Instr* movk3 = Instr::At(pc + (3 * Instr::kInstrSize));
-  Instr* blr = Instr::At(pc + (4 * Instr::kInstrSize));
-  const uint32_t w0 = Utils::Low32Bits(target_address);
-  const uint32_t w1 = Utils::High32Bits(target_address);
-  const uint16_t h0 = Utils::Low16Bits(w0);
-  const uint16_t h1 = Utils::High16Bits(w0);
-  const uint16_t h2 = Utils::Low16Bits(w1);
-  const uint16_t h3 = Utils::High16Bits(w1);
-
-  movz0->SetMoveWideBits(MOVZ, IP0, h0, 0, kDoubleWord);
-  movk1->SetMoveWideBits(MOVK, IP0, h1, 1, kDoubleWord);
-  movk2->SetMoveWideBits(MOVK, IP0, h2, 2, kDoubleWord);
-  movk3->SetMoveWideBits(MOVK, IP0, h3, 3, kDoubleWord);
-  blr->SetUnconditionalBranchRegBits(BLR, IP0);
-
-  ASSERT(kDeoptCallLengthInBytes == 5 * Instr::kInstrSize);
-  CPU::FlushICache(pc, kDeoptCallLengthInBytes);
-}
-
-
 SwitchableCallPattern::SwitchableCallPattern(uword pc, const Code& code)
     : object_pool_(ObjectPool::Handle(code.GetObjectPool())),
       data_pool_index_(-1),
@@ -366,15 +335,12 @@
   ASSERT(*(reinterpret_cast<uint32_t*>(pc) - 1) == 0xd63f0200);
 
   Register reg;
-  uword stub_load_end =
-      InstructionPattern::DecodeLoadWordFromPool(pc - 2 * Instr::kInstrSize,
-                                                 &reg,
-                                                 &target_pool_index_);
-  ASSERT(reg == CODE_REG);
-  InstructionPattern::DecodeLoadWordFromPool(stub_load_end,
-                                             &reg,
-                                             &data_pool_index_);
+  uword data_load_end = InstructionPattern::DecodeLoadWordFromPool(
+      pc - Instr::kInstrSize, &reg, &data_pool_index_);
   ASSERT(reg == R5);
+  InstructionPattern::DecodeLoadWordFromPool(data_load_end - Instr::kInstrSize,
+                                             &reg, &target_pool_index_);
+  ASSERT(reg == CODE_REG);
 }
 
 
@@ -384,8 +350,7 @@
 
 
 RawCode* SwitchableCallPattern::target() const {
-  return reinterpret_cast<RawCode*>(
-      object_pool_.ObjectAt(target_pool_index_));
+  return reinterpret_cast<RawCode*>(object_pool_.ObjectAt(target_pool_index_));
 }
 
 
@@ -401,9 +366,7 @@
 }
 
 
-ReturnPattern::ReturnPattern(uword pc)
-    : pc_(pc) {
-}
+ReturnPattern::ReturnPattern(uword pc) : pc_(pc) {}
 
 
 bool ReturnPattern::IsValid() const {
diff --git a/runtime/vm/instructions_arm64.h b/runtime/vm/instructions_arm64.h
index 80de324..01808fc 100644
--- a/runtime/vm/instructions_arm64.h
+++ b/runtime/vm/instructions_arm64.h
@@ -3,10 +3,10 @@
 // BSD-style license that can be found in the LICENSE file.
 // Classes that describe assembly patterns as used by inline caches.
 
-#ifndef VM_INSTRUCTIONS_ARM64_H_
-#define VM_INSTRUCTIONS_ARM64_H_
+#ifndef RUNTIME_VM_INSTRUCTIONS_ARM64_H_
+#define RUNTIME_VM_INSTRUCTIONS_ARM64_H_
 
-#ifndef VM_INSTRUCTIONS_H_
+#ifndef RUNTIME_VM_INSTRUCTIONS_H_
 #error Do not include instructions_arm64.h directly; use instructions.h instead.
 #endif
 
@@ -64,14 +64,6 @@
   RawCode* TargetCode() const;
   void SetTargetCode(const Code& target) const;
 
-  // This constant length is only valid for inserted call patterns used for
-  // lazy deoptimization. Regular call pattern may vary in length.
-  static const int kDeoptCallLengthInInstructions = 5;
-  static const int kDeoptCallLengthInBytes =
-      kDeoptCallLengthInInstructions * Instr::kInstrSize;
-
-  static void InsertDeoptCallAt(uword pc, uword target_address);
-
  private:
   const ObjectPool& object_pool_;
 
@@ -136,9 +128,7 @@
   // bx_lr = 1.
   static const int kLengthInBytes = 1 * Instr::kInstrSize;
 
-  int pattern_length_in_bytes() const {
-    return kLengthInBytes;
-  }
+  int pattern_length_in_bytes() const { return kLengthInBytes; }
 
   bool IsValid() const;
 
@@ -148,4 +138,4 @@
 
 }  // namespace dart
 
-#endif  // VM_INSTRUCTIONS_ARM64_H_
+#endif  // RUNTIME_VM_INSTRUCTIONS_ARM64_H_
diff --git a/runtime/vm/instructions_arm64_test.cc b/runtime/vm/instructions_arm64_test.cc
index 7ad4fb9..648ee17 100644
--- a/runtime/vm/instructions_arm64_test.cc
+++ b/runtime/vm/instructions_arm64_test.cc
@@ -28,10 +28,8 @@
   // in the code, points to the Ret instruction above, i.e. one instruction
   // before the end of the code buffer.
   uword end = test->payload_start() + test->code().Size();
-  CallPattern call(end - Instr::kInstrSize,
-                   test->code());
-  EXPECT_EQ(StubCode::InvokeDartCode_entry()->code(),
-            call.TargetCode());
+  CallPattern call(end - Instr::kInstrSize, test->code());
+  EXPECT_EQ(StubCode::InvokeDartCode_entry()->code(), call.TargetCode());
 }
 
 
diff --git a/runtime/vm/instructions_dbc.cc b/runtime/vm/instructions_dbc.cc
index 7d8dab7..7667a5f 100644
--- a/runtime/vm/instructions_dbc.cc
+++ b/runtime/vm/instructions_dbc.cc
@@ -38,8 +38,9 @@
 }
 
 
-static bool GetLoadedObjectAt(
-    uword pc, const ObjectPool& object_pool, Object* obj) {
+static bool GetLoadedObjectAt(uword pc,
+                              const ObjectPool& object_pool,
+                              Object* obj) {
   Instr instr = Bytecode::At(pc);
   if (HasLoadFromPool(instr)) {
     uint16_t index = Bytecode::DecodeD(instr);
@@ -67,18 +68,6 @@
 }
 
 
-int CallPattern::DeoptCallPatternLengthInInstructions() {
-  UNIMPLEMENTED();
-  return 0;
-}
-
-
-int CallPattern::DeoptCallPatternLengthInBytes() {
-  UNIMPLEMENTED();
-  return 0;
-}
-
-
 NativeCallPattern::NativeCallPattern(uword pc, const Code& code)
     : object_pool_(ObjectPool::Handle(code.GetObjectPool())),
       end_(pc),
@@ -108,7 +97,7 @@
 
 void NativeCallPattern::set_native_function(NativeFunction func) const {
   object_pool_.SetRawValueAt(native_function_pool_index_,
-      reinterpret_cast<uword>(func));
+                             reinterpret_cast<uword>(func));
 }
 
 
@@ -152,9 +141,7 @@
 }
 
 
-bool DecodeLoadObjectFromPoolOrThread(uword pc,
-                                      const Code& code,
-                                      Object* obj) {
+bool DecodeLoadObjectFromPoolOrThread(uword pc, const Code& code, Object* obj) {
   ASSERT(code.ContainsInstructionAt(pc));
   const ObjectPool& pool = ObjectPool::Handle(code.object_pool());
   return GetLoadedObjectAt(pc, pool, obj);
@@ -181,9 +168,10 @@
 }
 
 
-void CallPattern::InsertDeoptCallAt(uword pc, uword target_address) {
-  const uint8_t argc = Bytecode::IsCallOpcode(Bytecode::At(pc)) ?
-      Bytecode::DecodeArgc(Bytecode::At(pc)) : 0;
+void CallPattern::InsertDeoptCallAt(uword pc) {
+  const uint8_t argc = Bytecode::IsCallOpcode(Bytecode::At(pc))
+                           ? Bytecode::DecodeArgc(Bytecode::At(pc))
+                           : 0;
   *reinterpret_cast<Instr*>(pc) = Bytecode::Encode(Bytecode::kDeopt, argc, 0);
 }
 
@@ -202,8 +190,7 @@
 
 
 RawCode* SwitchableCallPattern::target() const {
-  return reinterpret_cast<RawCode*>(
-      object_pool_.ObjectAt(target_pool_index_));
+  return reinterpret_cast<RawCode*>(object_pool_.ObjectAt(target_pool_index_));
 }
 
 
diff --git a/runtime/vm/instructions_dbc.h b/runtime/vm/instructions_dbc.h
index 6db5205..e0ea799 100644
--- a/runtime/vm/instructions_dbc.h
+++ b/runtime/vm/instructions_dbc.h
@@ -3,10 +3,10 @@
 // BSD-style license that can be found in the LICENSE file.
 // Classes that describe assembly patterns as used by inline caches.
 
-#ifndef VM_INSTRUCTIONS_DBC_H_
-#define VM_INSTRUCTIONS_DBC_H_
+#ifndef RUNTIME_VM_INSTRUCTIONS_DBC_H_
+#define RUNTIME_VM_INSTRUCTIONS_DBC_H_
 
-#ifndef VM_INSTRUCTIONS_H_
+#ifndef RUNTIME_VM_INSTRUCTIONS_H_
 #error Do not include instructions_dbc.h directly; use instructions.h instead.
 #endif
 
@@ -57,12 +57,7 @@
   RawCode* TargetCode() const;
   void SetTargetCode(const Code& code) const;
 
-  // This constant length is only valid for inserted call patterns used for
-  // lazy deoptimization. Regular call pattern may vary in length.
-  static int DeoptCallPatternLengthInBytes();
-  static int DeoptCallPatternLengthInInstructions();
-
-  static void InsertDeoptCallAt(uword pc, uword target_address);
+  static void InsertDeoptCallAt(uword pc);
 
  private:
   const ObjectPool& object_pool_;
@@ -140,4 +135,4 @@
 
 }  // namespace dart
 
-#endif  // VM_INSTRUCTIONS_DBC_H_
+#endif  // RUNTIME_VM_INSTRUCTIONS_DBC_H_
diff --git a/runtime/vm/instructions_ia32.cc b/runtime/vm/instructions_ia32.cc
index 2b9f638..d774b99 100644
--- a/runtime/vm/instructions_ia32.cc
+++ b/runtime/vm/instructions_ia32.cc
@@ -5,15 +5,15 @@
 #include "vm/globals.h"  // Needed here to get TARGET_ARCH_IA32.
 #if defined(TARGET_ARCH_IA32)
 
-#include "vm/cpu.h"
 #include "vm/instructions.h"
+#include "vm/instructions_ia32.h"
+
+#include "vm/cpu.h"
 #include "vm/object.h"
 
 namespace dart {
 
-bool DecodeLoadObjectFromPoolOrThread(uword pc,
-                                      const Code& code,
-                                      Object* obj) {
+bool DecodeLoadObjectFromPoolOrThread(uword pc, const Code& code, Object* obj) {
   ASSERT(code.ContainsInstructionAt(pc));
   return false;
 }
diff --git a/runtime/vm/instructions_ia32.h b/runtime/vm/instructions_ia32.h
index 33d648f..d408a5a 100644
--- a/runtime/vm/instructions_ia32.h
+++ b/runtime/vm/instructions_ia32.h
@@ -3,10 +3,10 @@
 // BSD-style license that can be found in the LICENSE file.
 // Classes that describe assembly patterns as used by inline caches.
 
-#ifndef VM_INSTRUCTIONS_IA32_H_
-#define VM_INSTRUCTIONS_IA32_H_
+#ifndef RUNTIME_VM_INSTRUCTIONS_IA32_H_
+#define RUNTIME_VM_INSTRUCTIONS_IA32_H_
 
-#ifndef VM_INSTRUCTIONS_H_
+#ifndef RUNTIME_VM_INSTRUCTIONS_H_
 #error Do not include instructions_ia32.h directly; use instructions.h instead.
 #endif
 
@@ -23,11 +23,10 @@
 
 // Template class for all instruction pattern classes.
 // P has to specify a static pattern and a pattern length method.
-template<class P> class InstructionPattern : public ValueObject {
+template <class P>
+class InstructionPattern : public ValueObject {
  public:
-  explicit InstructionPattern(uword pc) : start_(pc) {
-    ASSERT(pc != 0);
-  }
+  explicit InstructionPattern(uword pc) : start_(pc) { ASSERT(pc != 0); }
 
   // Call to check if the instruction pattern at 'pc' match the instruction.
   // 'P::pattern()' returns the expected byte pattern in form of an integer
@@ -67,9 +66,8 @@
   explicit CallPattern(uword pc) : InstructionPattern(pc) {}
   uword TargetAddress() const {
     ASSERT(this->IsValid());
-    return this->start() +
-        CallPattern::pattern_length_in_bytes() +
-        *reinterpret_cast<uword*>(this->start() + 1);
+    return this->start() + CallPattern::pattern_length_in_bytes() +
+           *reinterpret_cast<uword*>(this->start() + 1);
   }
 
   void SetTargetAddress(uword new_target) const {
@@ -97,7 +95,7 @@
   explicit ReturnPattern(uword pc) : InstructionPattern(pc) {}
 
   static const int* pattern() {
-    static const int kReturnPattern[kLengthInBytes] = { 0xC3 };
+    static const int kReturnPattern[kLengthInBytes] = {0xC3};
     return kReturnPattern;
   }
   static int pattern_length_in_bytes() { return kLengthInBytes; }
@@ -114,7 +112,7 @@
   explicit ProloguePattern(uword pc) : InstructionPattern(pc) {}
 
   static const int* pattern() {
-    static const int kProloguePattern[kLengthInBytes] = { 0x55, 0x89, 0xe5 };
+    static const int kProloguePattern[kLengthInBytes] = {0x55, 0x89, 0xe5};
     return kProloguePattern;
   }
 
@@ -126,13 +124,13 @@
 
 
 // mov ebp, esp
-class SetFramePointerPattern :
-    public InstructionPattern<SetFramePointerPattern> {
+class SetFramePointerPattern
+    : public InstructionPattern<SetFramePointerPattern> {
  public:
   explicit SetFramePointerPattern(uword pc) : InstructionPattern(pc) {}
 
   static const int* pattern() {
-    static const int kFramePointerPattern[kLengthInBytes] = { 0x89, 0xe5 };
+    static const int kFramePointerPattern[kLengthInBytes] = {0x89, 0xe5};
     return kFramePointerPattern;
   }
 
@@ -144,4 +142,4 @@
 
 }  // namespace dart
 
-#endif  // VM_INSTRUCTIONS_IA32_H_
+#endif  // RUNTIME_VM_INSTRUCTIONS_IA32_H_
diff --git a/runtime/vm/instructions_mips.cc b/runtime/vm/instructions_mips.cc
index 70fff9d..3c60538 100644
--- a/runtime/vm/instructions_mips.cc
+++ b/runtime/vm/instructions_mips.cc
@@ -5,9 +5,11 @@
 #include "vm/globals.h"  // Needed here to get TARGET_ARCH_MIPS.
 #if defined(TARGET_ARCH_MIPS)
 
+#include "vm/instructions.h"
+#include "vm/instructions_mips.h"
+
 #include "vm/constants_mips.h"
 #include "vm/cpu.h"
-#include "vm/instructions.h"
 #include "vm/object.h"
 
 namespace dart {
@@ -23,10 +25,8 @@
   ASSERT(*(reinterpret_cast<uword*>(end_) - 2) == 0x0320f809);
   Register reg;
   // The end of the pattern is the instruction after the delay slot of the jalr.
-  ic_data_load_end_ =
-      InstructionPattern::DecodeLoadWordFromPool(end_ - (3 * Instr::kInstrSize),
-                                                 &reg,
-                                                 &target_code_pool_index_);
+  ic_data_load_end_ = InstructionPattern::DecodeLoadWordFromPool(
+      end_ - (3 * Instr::kInstrSize), &reg, &target_code_pool_index_);
   ASSERT(reg == CODE_REG);
 }
 
@@ -121,9 +121,7 @@
 }
 
 
-bool DecodeLoadObjectFromPoolOrThread(uword pc,
-                                      const Code& code,
-                                      Object* obj) {
+bool DecodeLoadObjectFromPoolOrThread(uword pc, const Code& code, Object* obj) {
   ASSERT(code.ContainsInstructionAt(pc));
 
   Instr* instr = Instr::At(pc);
@@ -149,9 +147,7 @@
 RawICData* CallPattern::IcData() {
   if (ic_data_.IsNull()) {
     Register reg;
-    InstructionPattern::DecodeLoadObject(ic_data_load_end_,
-                                         object_pool_,
-                                         &reg,
+    InstructionPattern::DecodeLoadObject(ic_data_load_end_, object_pool_, &reg,
                                          &ic_data_);
     ASSERT(reg == S5);
   }
@@ -181,13 +177,10 @@
   ASSERT(*(reinterpret_cast<uword*>(end_) - 2) == 0x0320f809);
 
   Register reg;
-  uword native_function_load_end =
-      InstructionPattern::DecodeLoadWordFromPool(end_ - 3 * Instr::kInstrSize,
-                                                 &reg,
-                                                 &target_code_pool_index_);
+  uword native_function_load_end = InstructionPattern::DecodeLoadWordFromPool(
+      end_ - 3 * Instr::kInstrSize, &reg, &target_code_pool_index_);
   ASSERT(reg == CODE_REG);
-  InstructionPattern::DecodeLoadWordFromPool(native_function_load_end,
-                                             &reg,
+  InstructionPattern::DecodeLoadWordFromPool(native_function_load_end, &reg,
                                              &native_function_pool_index_);
   ASSERT(reg == T5);
 }
@@ -213,25 +206,7 @@
 
 void NativeCallPattern::set_native_function(NativeFunction func) const {
   object_pool_.SetRawValueAt(native_function_pool_index_,
-      reinterpret_cast<uword>(func));
-}
-
-
-void CallPattern::InsertDeoptCallAt(uword pc, uword target_address) {
-  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));
-  uint16_t target_lo = target_address & 0xffff;
-  uint16_t target_hi = target_address >> 16;
-
-  lui->SetImmInstrBits(LUI, ZR, T9, target_hi);
-  ori->SetImmInstrBits(ORI, T9, T9, target_lo);
-  jr->SetSpecialInstrBits(JALR, T9, ZR, RA);
-  nop->SetInstructionBits(Instr::kNopInstruction);
-
-  ASSERT(kDeoptCallLengthInBytes == 4 * Instr::kInstrSize);
-  CPU::FlushICache(pc, kDeoptCallLengthInBytes);
+                             reinterpret_cast<uword>(func));
 }
 
 
@@ -245,15 +220,12 @@
   ASSERT(*(reinterpret_cast<uword*>(pc) - 2) == 0x0320f809);
 
   Register reg;
-  uword stub_load_end =
-      InstructionPattern::DecodeLoadWordFromPool(pc - 3 * Instr::kInstrSize,
-                                                 &reg,
-                                                 &target_pool_index_);
-  ASSERT(reg == CODE_REG);
-  InstructionPattern::DecodeLoadWordFromPool(stub_load_end,
-                                             &reg,
-                                             &data_pool_index_);
+  uword data_load_end = InstructionPattern::DecodeLoadWordFromPool(
+      pc - 2 * Instr::kInstrSize, &reg, &data_pool_index_);
   ASSERT(reg == S5);
+  InstructionPattern::DecodeLoadWordFromPool(data_load_end - Instr::kInstrSize,
+                                             &reg, &target_pool_index_);
+  ASSERT(reg == CODE_REG);
 }
 
 
@@ -263,8 +235,7 @@
 
 
 RawCode* SwitchableCallPattern::target() const {
-  return reinterpret_cast<RawCode*>(
-      object_pool_.ObjectAt(target_pool_index_));
+  return reinterpret_cast<RawCode*>(object_pool_.ObjectAt(target_pool_index_));
 }
 
 
@@ -280,15 +251,12 @@
 }
 
 
-ReturnPattern::ReturnPattern(uword pc)
-    : pc_(pc) {
-}
+ReturnPattern::ReturnPattern(uword pc) : pc_(pc) {}
 
 
 bool ReturnPattern::IsValid() const {
   Instr* jr = Instr::At(pc_);
-  return (jr->OpcodeField() == SPECIAL) &&
-         (jr->FunctionField() == JR) &&
+  return (jr->OpcodeField() == SPECIAL) && (jr->FunctionField() == JR) &&
          (jr->RsField() == RA);
 }
 
diff --git a/runtime/vm/instructions_mips.h b/runtime/vm/instructions_mips.h
index a5a398f..4223857 100644
--- a/runtime/vm/instructions_mips.h
+++ b/runtime/vm/instructions_mips.h
@@ -3,10 +3,10 @@
 // BSD-style license that can be found in the LICENSE file.
 // Classes that describe assembly patterns as used by inline caches.
 
-#ifndef VM_INSTRUCTIONS_MIPS_H_
-#define VM_INSTRUCTIONS_MIPS_H_
+#ifndef RUNTIME_VM_INSTRUCTIONS_MIPS_H_
+#define RUNTIME_VM_INSTRUCTIONS_MIPS_H_
 
-#ifndef VM_INSTRUCTIONS_H_
+#ifndef RUNTIME_VM_INSTRUCTIONS_H_
 #error Do not include instructions_mips.h directly; use instructions.h instead.
 #endif
 
@@ -57,12 +57,6 @@
   RawCode* TargetCode() const;
   void SetTargetCode(const Code& target) const;
 
-  static const int kDeoptCallLengthInInstructions = 4;
-  static const int kDeoptCallLengthInBytes =
-      kDeoptCallLengthInInstructions * Instr::kInstrSize;
-
-  static void InsertDeoptCallAt(uword pc, uword target_address);
-
  private:
   const ObjectPool& object_pool_;
 
@@ -127,9 +121,7 @@
   // jr(RA) = 1
   static const int kLengthInBytes = 1 * Instr::kInstrSize;
 
-  int pattern_length_in_bytes() const {
-    return kLengthInBytes;
-  }
+  int pattern_length_in_bytes() const { return kLengthInBytes; }
 
   bool IsValid() const;
 
@@ -139,4 +131,4 @@
 
 }  // namespace dart
 
-#endif  // VM_INSTRUCTIONS_MIPS_H_
+#endif  // RUNTIME_VM_INSTRUCTIONS_MIPS_H_
diff --git a/runtime/vm/instructions_x64.cc b/runtime/vm/instructions_x64.cc
index 950fd16..bc0553d 100644
--- a/runtime/vm/instructions_x64.cc
+++ b/runtime/vm/instructions_x64.cc
@@ -5,23 +5,16 @@
 #include "vm/globals.h"  // Needed here to get TARGET_ARCH_X64.
 #if defined(TARGET_ARCH_X64)
 
+#include "vm/instructions.h"
+#include "vm/instructions_x64.h"
+
 #include "vm/cpu.h"
 #include "vm/constants_x64.h"
-#include "vm/instructions.h"
 #include "vm/object.h"
 
 namespace dart {
 
-void ShortCallPattern::SetTargetAddress(uword target) const {
-  ASSERT(IsValid());
-  *reinterpret_cast<uint32_t*>(start() + 1) = target - start() - kLengthInBytes;
-  CPU::FlushICache(start() + 1, kWordSize);
-}
-
-
-bool DecodeLoadObjectFromPoolOrThread(uword pc,
-                                      const Code& code,
-                                      Object* obj) {
+bool DecodeLoadObjectFromPoolOrThread(uword pc, const Code& code, Object* obj) {
   ASSERT(code.ContainsInstructionAt(pc));
 
   uint8_t* bytes = reinterpret_cast<uint8_t*>(pc);
diff --git a/runtime/vm/instructions_x64.h b/runtime/vm/instructions_x64.h
index 8f1c073..56add2e 100644
--- a/runtime/vm/instructions_x64.h
+++ b/runtime/vm/instructions_x64.h
@@ -3,10 +3,10 @@
 // BSD-style license that can be found in the LICENSE file.
 // Classes that describe assembly patterns as used by inline caches.
 
-#ifndef VM_INSTRUCTIONS_X64_H_
-#define VM_INSTRUCTIONS_X64_H_
+#ifndef RUNTIME_VM_INSTRUCTIONS_X64_H_
+#define RUNTIME_VM_INSTRUCTIONS_X64_H_
 
-#ifndef VM_INSTRUCTIONS_H_
+#ifndef RUNTIME_VM_INSTRUCTIONS_H_
 #error Do not include instructions_ia32.h directly; use instructions.h instead.
 #endif
 
@@ -27,11 +27,10 @@
 
 // Template class for all instruction pattern classes.
 // P has to specify a static pattern and a pattern length method.
-template<class P> class InstructionPattern : public ValueObject {
+template <class P>
+class InstructionPattern : public ValueObject {
  public:
-  explicit InstructionPattern(uword pc) : start_(pc) {
-    ASSERT(pc != 0);
-  }
+  explicit InstructionPattern(uword pc) : start_(pc) { ASSERT(pc != 0); }
 
   // Call to check if the instruction pattern at 'pc' match the instruction.
   // 'P::pattern()' returns the expected byte pattern in form of an integer
@@ -66,31 +65,12 @@
 };
 
 
-// 5 byte call instruction.
-class ShortCallPattern : public InstructionPattern<ShortCallPattern> {
- public:
-  explicit ShortCallPattern(uword pc) : InstructionPattern(pc) {}
-
-  void SetTargetAddress(uword new_target) const;
-
-  static int pattern_length_in_bytes() { return kLengthInBytes; }
-  static const int* pattern() {
-    static const int kCallPattern[kLengthInBytes] = {0xE8, -1, -1, -1, -1};
-    return kCallPattern;
-  }
-
- private:
-  static const int kLengthInBytes = 5;
-  DISALLOW_COPY_AND_ASSIGN(ShortCallPattern);
-};
-
-
 class ReturnPattern : public InstructionPattern<ReturnPattern> {
  public:
   explicit ReturnPattern(uword pc) : InstructionPattern(pc) {}
 
   static const int* pattern() {
-    static const int kReturnPattern[kLengthInBytes] = { 0xC3 };
+    static const int kReturnPattern[kLengthInBytes] = {0xC3};
     return kReturnPattern;
   }
 
@@ -108,8 +88,8 @@
   explicit ProloguePattern(uword pc) : InstructionPattern(pc) {}
 
   static const int* pattern() {
-    static const int kProloguePattern[kLengthInBytes] =
-        { 0x55, 0x48, 0x89, 0xe5 };
+    static const int kProloguePattern[kLengthInBytes] = {0x55, 0x48, 0x89,
+                                                         0xe5};
     return kProloguePattern;
   }
 
@@ -121,14 +101,13 @@
 
 
 // mov rbp, rsp
-class SetFramePointerPattern :
-    public InstructionPattern<SetFramePointerPattern> {
+class SetFramePointerPattern
+    : public InstructionPattern<SetFramePointerPattern> {
  public:
   explicit SetFramePointerPattern(uword pc) : InstructionPattern(pc) {}
 
   static const int* pattern() {
-    static const int kFramePointerPattern[kLengthInBytes] =
-        { 0x48, 0x89, 0xe5 };
+    static const int kFramePointerPattern[kLengthInBytes] = {0x48, 0x89, 0xe5};
     return kFramePointerPattern;
   }
 
@@ -140,4 +119,4 @@
 
 }  // namespace dart
 
-#endif  // VM_INSTRUCTIONS_X64_H_
+#endif  // RUNTIME_VM_INSTRUCTIONS_X64_H_
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index ab7c878..49126f9 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -29,12 +29,18 @@
 
 namespace dart {
 
-DEFINE_FLAG(bool, propagate_ic_data, true,
-    "Propagate IC data from unoptimized to optimized IC calls.");
-DEFINE_FLAG(bool, two_args_smi_icd, true,
-    "Generate special IC stubs for two args Smi operations");
-DEFINE_FLAG(bool, unbox_numeric_fields, !USING_DBC,
-    "Support unboxed double and float32x4 fields.");
+DEFINE_FLAG(bool,
+            propagate_ic_data,
+            true,
+            "Propagate IC data from unoptimized to optimized IC calls.");
+DEFINE_FLAG(bool,
+            two_args_smi_icd,
+            true,
+            "Generate special IC stubs for two args Smi operations");
+DEFINE_FLAG(bool,
+            unbox_numeric_fields,
+            !USING_DBC,
+            "Support unboxed double and float32x4 fields.");
 DECLARE_FLAG(bool, eliminate_type_checks);
 DECLARE_FLAG(bool, support_externalizable_strings);
 
@@ -55,8 +61,7 @@
       ssa_temp_index_(-1),
       input_use_list_(NULL),
       env_use_list_(NULL),
-      constant_value_(NULL) {
-}
+      constant_value_(NULL) {}
 
 
 // A value in the constant propagation lattice.
@@ -190,8 +195,7 @@
   const intptr_t len = checks.NumberOfChecks();
   for (intptr_t i = 0; i < len; i++) {
     if (checks.IsUsedAt(i)) {
-      if (Field::IsExternalizableCid(
-              checks.GetReceiverClassIdAt(i))) {
+      if (Field::IsExternalizableCid(checks.GetReceiverClassIdAt(i))) {
         return false;
       }
     }
@@ -202,15 +206,15 @@
 
 EffectSet CheckClassInstr::Dependencies() const {
   // Externalization of strings via the API can change the class-id.
-  return !AreAllChecksImmutable(unary_checks()) ?
-      EffectSet::Externalization() : EffectSet::None();
+  return !AreAllChecksImmutable(unary_checks()) ? EffectSet::Externalization()
+                                                : EffectSet::None();
 }
 
 
 EffectSet CheckClassIdInstr::Dependencies() const {
   // Externalization of strings via the API can change the class-id.
-  return Field::IsExternalizableCid(cid_) ?
-      EffectSet::Externalization() : EffectSet::None();
+  return Field::IsExternalizableCid(cid_) ? EffectSet::Externalization()
+                                          : EffectSet::None();
 }
 
 
@@ -277,16 +281,14 @@
 
 
 bool LoadFieldInstr::IsUnboxedLoad() const {
-  return FLAG_unbox_numeric_fields
-      && (field() != NULL)
-      && FlowGraphCompiler::IsUnboxedField(*field());
+  return FLAG_unbox_numeric_fields && (field() != NULL) &&
+         FlowGraphCompiler::IsUnboxedField(*field());
 }
 
 
 bool LoadFieldInstr::IsPotentialUnboxedLoad() const {
-  return FLAG_unbox_numeric_fields
-      && (field() != NULL)
-      && FlowGraphCompiler::IsPotentialUnboxedField(*field());
+  return FLAG_unbox_numeric_fields && (field() != NULL) &&
+         FlowGraphCompiler::IsPotentialUnboxedField(*field());
 }
 
 
@@ -309,21 +311,19 @@
 
 
 bool StoreInstanceFieldInstr::IsUnboxedStore() const {
-  return FLAG_unbox_numeric_fields
-      && !field().IsNull()
-      && FlowGraphCompiler::IsUnboxedField(field());
+  return FLAG_unbox_numeric_fields && !field().IsNull() &&
+         FlowGraphCompiler::IsUnboxedField(field());
 }
 
 
 bool StoreInstanceFieldInstr::IsPotentialUnboxedStore() const {
-  return FLAG_unbox_numeric_fields
-      && !field().IsNull()
-      && FlowGraphCompiler::IsPotentialUnboxedField(field());
+  return FLAG_unbox_numeric_fields && !field().IsNull() &&
+         FlowGraphCompiler::IsPotentialUnboxedField(field());
 }
 
 
 Representation StoreInstanceFieldInstr::RequiredInputRepresentation(
-  intptr_t index) const {
+    intptr_t index) const {
   ASSERT((index == 0) || (index == 1));
   if ((index == 1) && IsUnboxedStore()) {
     const intptr_t cid = field().UnboxedFieldCid();
@@ -365,7 +365,7 @@
   StrictCompareInstr* other_op = other->AsStrictCompare();
   ASSERT(other_op != NULL);
   return ComparisonInstr::AttributesEqual(other) &&
-    (needs_number_check() == other_op->needs_number_check());
+         (needs_number_check() == other_op->needs_number_check());
 }
 
 
@@ -373,7 +373,7 @@
   MathMinMaxInstr* other_op = other->AsMathMinMax();
   ASSERT(other_op != NULL);
   return (op_kind() == other_op->op_kind()) &&
-      (result_cid() == other_op->result_cid());
+         (result_cid() == other_op->result_cid());
 }
 
 
@@ -381,8 +381,8 @@
   ASSERT(other->tag() == tag());
   BinaryIntegerOpInstr* other_op = other->AsBinaryIntegerOp();
   return (op_kind() == other_op->op_kind()) &&
-      (can_overflow() == other_op->can_overflow()) &&
-      (is_truncating() == other_op->is_truncating());
+         (can_overflow() == other_op->can_overflow()) &&
+         (is_truncating() == other_op->is_truncating());
 }
 
 
@@ -396,10 +396,10 @@
   ASSERT(other_load != NULL);
   if (field() != NULL) {
     return (other_load->field() != NULL) &&
-        (field()->raw() == other_load->field()->raw());
+           (field()->raw() == other_load->field()->raw());
   }
   return (other_load->field() == NULL) &&
-      (offset_in_bytes() == other_load->offset_in_bytes());
+         (offset_in_bytes() == other_load->offset_in_bytes());
 }
 
 
@@ -417,7 +417,8 @@
 
 EffectSet LoadStaticFieldInstr::Dependencies() const {
   return (StaticField().is_final() && !FLAG_fields_may_be_reset)
-      ? EffectSet::None() : EffectSet::All();
+             ? EffectSet::None()
+             : EffectSet::All();
 }
 
 
@@ -439,8 +440,7 @@
 
 
 ConstantInstr::ConstantInstr(const Object& value, TokenPosition token_pos)
-    : value_(value),
-      token_pos_(token_pos) {
+    : value_(value), token_pos_(token_pos) {
   // Check that the value is not an incorrect Integer representation.
   ASSERT(!value.IsBigint() || !Bigint::Cast(value).FitsIntoSmi());
   ASSERT(!value.IsBigint() || !Bigint::Cast(value).FitsIntoInt64());
@@ -502,8 +502,7 @@
       osr_id_(osr_id),
       entry_count_(0),
       spill_slot_count_(0),
-      fixed_slot_count_(0) {
-}
+      fixed_slot_count_(0) {}
 
 
 ConstantInstr* GraphEntryInstr::constant_null() {
@@ -535,9 +534,9 @@
 // ==== Support for visiting flow graphs.
 
 #define DEFINE_ACCEPT(ShortName)                                               \
-void ShortName##Instr::Accept(FlowGraphVisitor* visitor) {                     \
-  visitor->Visit##ShortName(this);                                             \
-}
+  void ShortName##Instr::Accept(FlowGraphVisitor* visitor) {                   \
+    visitor->Visit##ShortName(this);                                           \
+  }
 
 FOR_EACH_INSTRUCTION(DEFINE_ACCEPT)
 
@@ -622,7 +621,8 @@
   // instruction.
   ASSERT(previous() != NULL);
   Instruction* result = previous();
-  while (!result->IsBlockEntry()) result = result->previous();
+  while (!result->IsBlockEntry())
+    result = result->previous();
   return result->AsBlockEntry();
 }
 
@@ -654,8 +654,7 @@
 
 
 bool Value::NeedsStoreBuffer() {
-  if (Type()->IsNull() ||
-      (Type()->ToNullableCid() == kSmiCid) ||
+  if (Type()->IsNull() || (Type()->ToNullableCid() == kSmiCid) ||
       (Type()->ToNullableCid() == kBoolCid)) {
     return false;
   }
@@ -794,12 +793,10 @@
                                           Definition* result) {
   ASSERT(call->env() != NULL);
   deopt_id_ = Thread::ToDeoptAfter(call->deopt_id_);
-  call->env()->DeepCopyAfterTo(flow_graph->zone(),
-                               this,
-                               call->ArgumentCount(),
-                               flow_graph->constant_dead(),
-                               result != NULL ? result
-                                              : flow_graph->constant_dead());
+  call->env()->DeepCopyAfterTo(
+      flow_graph->zone(), this, call->ArgumentCount(),
+      flow_graph->constant_dead(),
+      result != NULL ? result : flow_graph->constant_dead());
   env()->set_deopt_id(deopt_id_);
 }
 
@@ -923,10 +920,9 @@
 
 
 // Base class implementation used for JoinEntry and TargetEntry.
-bool BlockEntryInstr::DiscoverBlock(
-    BlockEntryInstr* predecessor,
-    GrowableArray<BlockEntryInstr*>* preorder,
-    GrowableArray<intptr_t>* parent) {
+bool BlockEntryInstr::DiscoverBlock(BlockEntryInstr* predecessor,
+                                    GrowableArray<BlockEntryInstr*>* preorder,
+                                    GrowableArray<intptr_t>* parent) {
   // If this block has a predecessor (i.e., is not the graph entry) we can
   // assume the preorder array is non-empty.
   ASSERT((predecessor == NULL) || !preorder->is_empty());
@@ -975,8 +971,7 @@
 }
 
 
-bool BlockEntryInstr::PruneUnreachable(FlowGraphBuilder* builder,
-                                       GraphEntryInstr* graph_entry,
+bool BlockEntryInstr::PruneUnreachable(GraphEntryInstr* graph_entry,
                                        Instruction* parent,
                                        intptr_t osr_id,
                                        BitVector* block_marks) {
@@ -1012,10 +1007,7 @@
 
   // Recursively search the successors.
   for (intptr_t i = instr->SuccessorCount() - 1; i >= 0; --i) {
-    if (instr->SuccessorAt(i)->PruneUnreachable(builder,
-                                                graph_entry,
-                                                instr,
-                                                osr_id,
+    if (instr->SuccessorAt(i)->PruneUnreachable(graph_entry, instr, osr_id,
                                                 block_marks)) {
       return true;
     }
@@ -1098,8 +1090,7 @@
       Value* pred_use = phi->InputAt(old_index);
       // Move uses between old and new.
       intptr_t step = (old_index < new_index) ? 1 : -1;
-      for (intptr_t use_idx = old_index;
-           use_idx != new_index;
+      for (intptr_t use_idx = old_index; use_idx != new_index;
            use_idx += step) {
         phi->SetInputAt(use_idx, phi->InputAt(use_idx + step));
       }
@@ -1118,9 +1109,7 @@
     }
   }
   UnuseAllInputs();
-  for (ForwardInstructionIterator it(this);
-       !it.Done();
-       it.Advance()) {
+  for (ForwardInstructionIterator it(this); !it.Done(); it.Advance()) {
     it.Current()->UnuseAllInputs();
   }
 }
@@ -1241,24 +1230,22 @@
 
 
 bool UnboxedIntConverterInstr::CanDeoptimize() const {
-  return (to() == kUnboxedInt32) &&
-      !is_truncating() &&
-      !RangeUtils::Fits(value()->definition()->range(),
-                        RangeBoundary::kRangeBoundaryInt32);
+  return (to() == kUnboxedInt32) && !is_truncating() &&
+         !RangeUtils::Fits(value()->definition()->range(),
+                           RangeBoundary::kRangeBoundaryInt32);
 }
 
 
 bool UnboxInt32Instr::CanDeoptimize() const {
   const intptr_t value_cid = value()->Type()->ToCid();
   if (value_cid == kSmiCid) {
-    return (kSmiBits > 32) &&
-        !is_truncating() &&
-        !RangeUtils::Fits(value()->definition()->range(),
-                          RangeBoundary::kRangeBoundaryInt32);
+    return (kSmiBits > 32) && !is_truncating() &&
+           !RangeUtils::Fits(value()->definition()->range(),
+                             RangeBoundary::kRangeBoundaryInt32);
   } else if (value_cid == kMintCid) {
     return !is_truncating() &&
-        !RangeUtils::Fits(value()->definition()->range(),
-                          RangeBoundary::kRangeBoundaryInt32);
+           !RangeUtils::Fits(value()->definition()->range(),
+                             RangeBoundary::kRangeBoundaryInt32);
   } else if (is_truncating() && value()->definition()->IsBoxInteger()) {
     return false;
   } else if ((kSmiBits < 32) && value()->Type()->IsInt()) {
@@ -1295,7 +1282,7 @@
 
     case Token::kSHL:
       return can_overflow() ||
-          !RangeUtils::IsPositive(right()->definition()->range());
+             !RangeUtils::IsPositive(right()->definition()->range());
 
     case Token::kMOD: {
       UNREACHABLE();
@@ -1319,7 +1306,7 @@
 
     case Token::kSHL:
       return can_overflow() ||
-          !RangeUtils::IsPositive(right()->definition()->range());
+             !RangeUtils::IsPositive(right()->definition()->range());
 
     case Token::kMOD: {
       Range* right_range = this->right()->definition()->range();
@@ -1357,8 +1344,8 @@
 
 
 static int64_t RepresentationMask(Representation r) {
-  return static_cast<int64_t>(
-      static_cast<uint64_t>(-1) >> (64 - RepresentationBits(r)));
+  return static_cast<int64_t>(static_cast<uint64_t>(-1) >>
+                              (64 - RepresentationBits(r)));
 }
 
 
@@ -1405,10 +1392,9 @@
 }
 
 
-static Definition* CanonicalizeCommutativeDoubleArithmetic(
-    Token::Kind op,
-    Value* left,
-    Value* right) {
+static Definition* CanonicalizeCommutativeDoubleArithmetic(Token::Kind op,
+                                                           Value* left,
+                                                           Value* right) {
   int64_t left_value;
   if (!ToIntegerConstant(left, &left_value)) {
     return NULL;
@@ -1444,9 +1430,7 @@
   // Must only be used in Float32 StoreIndexedInstr or FloatToDoubleInstr or
   // Phis introduce by load forwarding.
   ASSERT(env_use_list() == NULL);
-  for (Value* use = input_use_list();
-       use != NULL;
-       use = use->next_use()) {
+  for (Value* use = input_use_list(); use != NULL; use = use->next_use()) {
     ASSERT(use->instruction()->IsPhi() ||
            use->instruction()->IsFloatToDouble() ||
            (use->instruction()->IsStoreIndexed() &&
@@ -1485,10 +1469,9 @@
 
   if ((op_kind() == Token::kMUL) &&
       (left()->definition() == right()->definition())) {
-    MathUnaryInstr* math_unary =
-        new MathUnaryInstr(MathUnaryInstr::kDoubleSquare,
-                           new Value(left()->definition()),
-                           DeoptimizationTarget());
+    MathUnaryInstr* math_unary = new MathUnaryInstr(
+        MathUnaryInstr::kDoubleSquare, new Value(left()->definition()),
+        DeoptimizationTarget());
     flow_graph->InsertBefore(this, math_unary, env(), FlowGraph::kValue);
     return math_unary;
   }
@@ -1497,6 +1480,11 @@
 }
 
 
+Definition* DoubleTestOpInstr::Canonicalize(FlowGraph* flow_graph) {
+  return HasUses() ? this : NULL;
+}
+
+
 static bool IsCommutative(Token::Kind op) {
   switch (op) {
     case Token::kMUL:
@@ -1629,8 +1617,7 @@
 
   switch (op_kind()) {
     case Token::kNEGATE:
-      result = value.ArithmeticOp(Token::kMUL,
-                                  Smi::Handle(zone, Smi::New(-1)),
+      result = value.ArithmeticOp(Token::kMUL, Smi::Handle(zone, Smi::New(-1)),
                                   Heap::kOld);
       break;
 
@@ -1674,7 +1661,7 @@
       if (right.IsSmi() && right.AsInt64Value() == 0) {
         break;  // Will throw.
       }
-      // Fall through.
+    // Fall through.
     case Token::kADD:
     case Token::kSUB:
     case Token::kMUL: {
@@ -1684,9 +1671,8 @@
     case Token::kSHL:
     case Token::kSHR:
       if (left.IsSmi() && right.IsSmi() && (Smi::Cast(right).Value() >= 0)) {
-        result = Smi::Cast(left).ShiftOp(op_kind(),
-                                         Smi::Cast(right),
-                                         Heap::kOld);
+        result =
+            Smi::Cast(left).ShiftOp(op_kind(), Smi::Cast(right), Heap::kOld);
       }
       break;
     case Token::kBIT_AND:
@@ -1725,8 +1711,7 @@
                                                        const Integer& result) {
   Definition* result_defn = flow_graph->GetConstant(result);
   if (representation() != kTagged) {
-    result_defn = UnboxInstr::Create(representation(),
-                                     new Value(result_defn),
+    result_defn = UnboxInstr::Create(representation(), new Value(result_defn),
                                      GetDeoptId());
     flow_graph->InsertBefore(this, result_defn, env(), FlowGraph::kValue);
   }
@@ -1746,26 +1731,40 @@
       case Token::kBIT_AND:
       case Token::kBIT_OR:
       case Token::kBIT_XOR:
-        replacement =
-            new BinarySmiOpInstr(op_kind(),
-                                 new Value(left()->definition()),
-                                 new Value(right()->definition()),
-                                 Thread::kNoDeoptId);
+        replacement = new BinarySmiOpInstr(
+            op_kind(), new Value(left()->definition()),
+            new Value(right()->definition()), Thread::kNoDeoptId);
       default:
         break;
     }
-    if (Token::IsRelationalOperator(op_kind())) {
-      replacement = new RelationalOpInstr(token_pos(), op_kind(),
-                                          new Value(left()->definition()),
-                                          new Value(right()->definition()),
-                                          kSmiCid,
-                                          Thread::kNoDeoptId);
-    } else if (Token::IsEqualityOperator(op_kind())) {
-      replacement = new EqualityCompareInstr(token_pos(), op_kind(),
-                                             new Value(left()->definition()),
-                                             new Value(right()->definition()),
-                                             kSmiCid,
-                                             Thread::kNoDeoptId);
+    if (replacement != NULL) {
+      flow_graph->InsertBefore(this, replacement, env(), FlowGraph::kValue);
+      return replacement;
+    }
+  }
+  return this;
+}
+
+
+ComparisonInstr* CheckedSmiComparisonInstr::CopyWithNewOperands(Value* left,
+                                                                Value* right) {
+  UNREACHABLE();
+  return NULL;
+}
+
+
+Definition* CheckedSmiComparisonInstr::Canonicalize(FlowGraph* flow_graph) {
+  if ((left()->Type()->ToCid() == kSmiCid) &&
+      (right()->Type()->ToCid() == kSmiCid)) {
+    Definition* replacement = NULL;
+    if (Token::IsRelationalOperator(kind())) {
+      replacement = new RelationalOpInstr(
+          token_pos(), kind(), new Value(left()->definition()),
+          new Value(right()->definition()), kSmiCid, Thread::kNoDeoptId);
+    } else if (Token::IsEqualityOperator(kind())) {
+      replacement = new EqualityCompareInstr(
+          token_pos(), kind(), new Value(left()->definition()),
+          new Value(right()->definition()), kSmiCid, Thread::kNoDeoptId);
     }
     if (replacement != NULL) {
       flow_graph->InsertBefore(this, replacement, env(), FlowGraph::kValue);
@@ -1780,20 +1779,17 @@
   // If both operands are constants evaluate this expression. Might
   // occur due to load forwarding after constant propagation pass
   // have already been run.
-  if (left()->BindsToConstant() &&
-      left()->BoundConstant().IsInteger() &&
-      right()->BindsToConstant() &&
-      right()->BoundConstant().IsInteger()) {
-    const Integer& result = Integer::Handle(
-        Evaluate(Integer::Cast(left()->BoundConstant()),
-                 Integer::Cast(right()->BoundConstant())));
+  if (left()->BindsToConstant() && left()->BoundConstant().IsInteger() &&
+      right()->BindsToConstant() && right()->BoundConstant().IsInteger()) {
+    const Integer& result =
+        Integer::Handle(Evaluate(Integer::Cast(left()->BoundConstant()),
+                                 Integer::Cast(right()->BoundConstant())));
     if (!result.IsNull()) {
       return CreateConstantResult(flow_graph, result);
     }
   }
 
-  if (left()->BindsToConstant() &&
-      !right()->BindsToConstant() &&
+  if (left()->BindsToConstant() && !right()->BindsToConstant() &&
       IsCommutative(op_kind())) {
     Value* l = left();
     Value* r = right();
@@ -1831,15 +1827,10 @@
       } else if (rhs == 2) {
         ConstantInstr* constant_1 =
             flow_graph->GetConstant(Smi::Handle(Smi::New(1)));
-        BinaryIntegerOpInstr* shift =
-            BinaryIntegerOpInstr::Make(representation(),
-                                       Token::kSHL,
-                                       left()->CopyWithType(),
-                                       new Value(constant_1),
-                                       GetDeoptId(),
-                                       can_overflow(),
-                                       is_truncating(),
-                                       range());
+        BinaryIntegerOpInstr* shift = BinaryIntegerOpInstr::Make(
+            representation(), Token::kSHL, left()->CopyWithType(),
+            new Value(constant_1), GetDeoptId(), can_overflow(),
+            is_truncating(), range());
         if (shift != NULL) {
           flow_graph->InsertBefore(this, shift, env(), FlowGraph::kValue);
           return shift;
@@ -1870,12 +1861,9 @@
       if (rhs == 0) {
         return left()->definition();
       } else if (rhs == range_mask) {
-        UnaryIntegerOpInstr* bit_not =
-            UnaryIntegerOpInstr::Make(representation(),
-                                      Token::kBIT_NOT,
-                                      left()->CopyWithType(),
-                                      GetDeoptId(),
-                                      range());
+        UnaryIntegerOpInstr* bit_not = UnaryIntegerOpInstr::Make(
+            representation(), Token::kBIT_NOT, left()->CopyWithType(),
+            GetDeoptId(), range());
         if (bit_not != NULL) {
           flow_graph->InsertBefore(this, bit_not, env(), FlowGraph::kValue);
           return bit_not;
@@ -1893,12 +1881,9 @@
       if (rhs == 1) {
         return left()->definition();
       } else if (rhs == -1) {
-        UnaryIntegerOpInstr* negation =
-            UnaryIntegerOpInstr::Make(representation(),
-                                      Token::kNEGATE,
-                                      left()->CopyWithType(),
-                                      GetDeoptId(),
-                                      range());
+        UnaryIntegerOpInstr* negation = UnaryIntegerOpInstr::Make(
+            representation(), Token::kNEGATE, left()->CopyWithType(),
+            GetDeoptId(), range());
         if (negation != NULL) {
           flow_graph->InsertBefore(this, negation, env(), FlowGraph::kValue);
           return negation;
@@ -2072,14 +2057,13 @@
 
   ConstantInstr* constant_type_args =
       instantiator_type_arguments()->definition()->AsConstant();
-  if (constant_type_args != NULL &&
-      !constant_type_args->value().IsNull() &&
+  if (constant_type_args != NULL && !constant_type_args->value().IsNull() &&
       constant_type_args->value().IsTypeArguments()) {
     const TypeArguments& instantiator_type_args =
         TypeArguments::Cast(constant_type_args->value());
     Error& bound_error = Error::Handle();
-    AbstractType& new_dst_type = AbstractType::Handle(
-        dst_type().InstantiateFrom(
+    AbstractType& new_dst_type =
+        AbstractType::Handle(dst_type().InstantiateFrom(
             instantiator_type_args, &bound_error, NULL, NULL, Heap::kOld));
     if (new_dst_type.IsMalformedOrMalbounded() || !bound_error.IsNull()) {
       return this;
@@ -2090,8 +2074,7 @@
     new_dst_type = new_dst_type.Canonicalize();
     set_dst_type(new_dst_type);
 
-    if (new_dst_type.IsDynamicType() ||
-        new_dst_type.IsObjectType() ||
+    if (new_dst_type.IsDynamicType() || new_dst_type.IsObjectType() ||
         (FLAG_eliminate_type_checks &&
          value()->Type()->IsAssignableTo(new_dst_type))) {
       return value()->definition();
@@ -2113,8 +2096,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   return locs;
 }
 
@@ -2195,10 +2178,7 @@
     }
 
     if (replacement != this) {
-      flow_graph->InsertBefore(this,
-                               replacement,
-                               NULL,
-                               FlowGraph::kValue);
+      flow_graph->InsertBefore(this, replacement, NULL, FlowGraph::kValue);
     }
 
     return replacement;
@@ -2223,7 +2203,8 @@
 
     const Object& val = value()->BoundConstant();
     if (val.IsSmi()) {
-      const Double& double_val = Double::ZoneHandle(flow_graph->zone(),
+      const Double& double_val = Double::ZoneHandle(
+          flow_graph->zone(),
           Double::NewCanonical(Smi::Cast(val).AsDoubleValue()));
       uc = new UnboxedConstantInstr(double_val, kUnboxedDouble);
     } else if (val.IsDouble()) {
@@ -2252,11 +2233,10 @@
       return box_defn->value()->definition();
     } else {
       UnboxedIntConverterInstr* converter = new UnboxedIntConverterInstr(
-          from_representation,
-          representation(),
+          from_representation, representation(),
           box_defn->value()->CopyWithType(),
-          (representation() == kUnboxedInt32) ?
-              GetDeoptId() : Thread::kNoDeoptId);
+          (representation() == kUnboxedInt32) ? GetDeoptId()
+                                              : Thread::kNoDeoptId);
       // TODO(vegorov): marking resulting converter as truncating when
       // unboxing can't deoptimize is a workaround for the missing
       // deoptimization environment when we insert converter after
@@ -2285,8 +2265,7 @@
   if ((c != NULL) && c->value().IsSmi()) {
     if (!is_truncating() && (kSmiBits > 32)) {
       // Check that constant fits into 32-bit integer.
-      const int64_t value =
-          static_cast<int64_t>(Smi::Cast(c->value()).Value());
+      const int64_t value = static_cast<int64_t>(Smi::Cast(c->value()).Value());
       if (!Utils::IsInt(32, value)) {
         return this;
       }
@@ -2316,9 +2295,7 @@
     }
 
     UnboxedIntConverterInstr* converter = new UnboxedIntConverterInstr(
-        box_defn->from(),
-        representation(),
-        box_defn->value()->CopyWithType(),
+        box_defn->from(), representation(), box_defn->value()->CopyWithType(),
         (to() == kUnboxedInt32) ? GetDeoptId() : Thread::kNoDeoptId);
     if ((representation() == kUnboxedInt32) && is_truncating()) {
       converter->mark_truncating();
@@ -2328,22 +2305,16 @@
   }
 
   UnboxInt64Instr* unbox_defn = value()->definition()->AsUnboxInt64();
-  if (unbox_defn != NULL &&
-      (from() == kUnboxedMint) &&
-      (to() == kUnboxedInt32) &&
-      unbox_defn->HasOnlyInputUse(value())) {
+  if (unbox_defn != NULL && (from() == kUnboxedMint) &&
+      (to() == kUnboxedInt32) && unbox_defn->HasOnlyInputUse(value())) {
     // TODO(vegorov): there is a duplication of code between UnboxedIntCoverter
     // and code path that unboxes Mint into Int32. We should just schedule
     // these instructions close to each other instead of fusing them.
     Definition* replacement =
         new UnboxInt32Instr(is_truncating() ? UnboxInt32Instr::kTruncate
                                             : UnboxInt32Instr::kNoTruncation,
-                            unbox_defn->value()->CopyWithType(),
-                            GetDeoptId());
-    flow_graph->InsertBefore(this,
-                             replacement,
-                             env(),
-                             FlowGraph::kValue);
+                            unbox_defn->value()->CopyWithType(), GetDeoptId());
+    flow_graph->InsertBefore(this, replacement, env(), FlowGraph::kValue);
     return replacement;
   }
 
@@ -2353,9 +2324,8 @@
 
 Definition* BooleanNegateInstr::Canonicalize(FlowGraph* flow_graph) {
   Definition* defn = value()->definition();
-  if (defn->IsComparison() && defn->HasOnlyUse(value())) {
-    // Comparisons always have a bool result.
-    ASSERT(value()->definition()->Type()->ToCid() == kBoolCid);
+  if (defn->IsComparison() && defn->HasOnlyUse(value()) &&
+      defn->Type()->ToCid() == kBoolCid) {
     defn->AsComparison()->NegateComparison();
     return defn;
   }
@@ -2364,40 +2334,39 @@
 
 
 static bool MayBeBoxableNumber(intptr_t cid) {
-  return (cid == kDynamicCid) ||
-         (cid == kMintCid) ||
-         (cid == kBigintCid) ||
+  return (cid == kDynamicCid) || (cid == kMintCid) || (cid == kBigintCid) ||
          (cid == kDoubleCid);
 }
 
 
 static bool MaybeNumber(CompileType* type) {
-  ASSERT(Type::Handle(Type::Number()).IsMoreSpecificThan(
-             Type::Handle(Type::Number()), NULL, NULL, Heap::kOld));
-  return type->ToAbstractType()->IsDynamicType()
-      || type->ToAbstractType()->IsObjectType()
-      || type->ToAbstractType()->IsTypeParameter()
-      || type->IsMoreSpecificThan(Type::Handle(Type::Number()));
+  ASSERT(Type::Handle(Type::Number())
+             .IsMoreSpecificThan(Type::Handle(Type::Number()), NULL, NULL,
+                                 Heap::kOld));
+  return type->ToAbstractType()->IsDynamicType() ||
+         type->ToAbstractType()->IsObjectType() ||
+         type->ToAbstractType()->IsTypeParameter() ||
+         type->IsMoreSpecificThan(Type::Handle(Type::Number()));
 }
 
 
 // Returns a replacement for a strict comparison and signals if the result has
 // to be negated.
 static Definition* CanonicalizeStrictCompare(StrictCompareInstr* compare,
-                                             bool* negated) {
+                                             bool* negated,
+                                             bool is_branch) {
   // Use propagated cid and type information to eliminate number checks.
   // If one of the inputs is not a boxable number (Mint, Double, Bigint), or
   // is not a subtype of num, no need for number checks.
   if (compare->needs_number_check()) {
     if (!MayBeBoxableNumber(compare->left()->Type()->ToCid()) ||
-        !MayBeBoxableNumber(compare->right()->Type()->ToCid()))  {
+        !MayBeBoxableNumber(compare->right()->Type()->ToCid())) {
       compare->set_needs_number_check(false);
     } else if (!MaybeNumber(compare->left()->Type()) ||
                !MaybeNumber(compare->right()->Type())) {
       compare->set_needs_number_check(false);
     }
   }
-
   *negated = false;
   PassiveObject& constant = PassiveObject::Handle();
   Value* other = NULL;
@@ -2411,34 +2380,29 @@
     return compare;
   }
 
+  const bool can_merge = is_branch || (other->Type()->ToCid() == kBoolCid);
   Definition* other_defn = other->definition();
   Token::Kind kind = compare->kind();
   // Handle e === true.
-  if ((kind == Token::kEQ_STRICT) &&
-      (constant.raw() == Bool::True().raw()) &&
-      (other->Type()->ToCid() == kBoolCid)) {
+  if ((kind == Token::kEQ_STRICT) && (constant.raw() == Bool::True().raw()) &&
+      can_merge) {
     return other_defn;
   }
   // Handle e !== false.
-  if ((kind == Token::kNE_STRICT) &&
-      (constant.raw() == Bool::False().raw()) &&
-      (other->Type()->ToCid() == kBoolCid)) {
+  if ((kind == Token::kNE_STRICT) && (constant.raw() == Bool::False().raw()) &&
+      can_merge) {
     return other_defn;
   }
   // Handle e !== true.
-  if ((kind == Token::kNE_STRICT) &&
-      (constant.raw() == Bool::True().raw()) &&
-      other_defn->IsComparison() &&
-      (other->Type()->ToCid() == kBoolCid) &&
+  if ((kind == Token::kNE_STRICT) && (constant.raw() == Bool::True().raw()) &&
+      other_defn->IsComparison() && can_merge &&
       other_defn->HasOnlyUse(other)) {
     *negated = true;
     return other_defn;
   }
   // Handle e === false.
-  if ((kind == Token::kEQ_STRICT) &&
-      (constant.raw() == Bool::False().raw()) &&
-      other_defn->IsComparison() &&
-      (other->Type()->ToCid() == kBoolCid) &&
+  if ((kind == Token::kEQ_STRICT) && (constant.raw() == Bool::False().raw()) &&
+      other_defn->IsComparison() && can_merge &&
       other_defn->HasOnlyUse(other)) {
     *negated = true;
     return other_defn;
@@ -2448,9 +2412,8 @@
 
 
 static bool BindsToGivenConstant(Value* v, intptr_t expected) {
-  return v->BindsToConstant() &&
-      v->BoundConstant().IsSmi() &&
-      (Smi::Cast(v->BoundConstant()).Value() == expected);
+  return v->BindsToConstant() && v->BoundConstant().IsSmi() &&
+         (Smi::Cast(v->BoundConstant()).Value() == expected);
 }
 
 
@@ -2467,8 +2430,7 @@
 
 
   BinarySmiOpInstr* mask_op = left->definition()->AsBinarySmiOp();
-  if ((mask_op == NULL) ||
-      (mask_op->op_kind() != Token::kBIT_AND) ||
+  if ((mask_op == NULL) || (mask_op->op_kind() != Token::kBIT_AND) ||
       !mask_op->HasOnlyUse(left)) {
     return false;
   }
@@ -2497,14 +2459,13 @@
   // Only handle strict-compares.
   if (comparison()->IsStrictCompare()) {
     bool negated = false;
-    Definition* replacement =
-        CanonicalizeStrictCompare(comparison()->AsStrictCompare(), &negated);
+    Definition* replacement = CanonicalizeStrictCompare(
+        comparison()->AsStrictCompare(), &negated, /* is_branch = */ true);
     if (replacement == comparison()) {
       return this;
     }
     ComparisonInstr* comp = replacement->AsComparison();
-    if ((comp == NULL) ||
-        comp->CanDeoptimize() ||
+    if ((comp == NULL) || comp->CanDeoptimize() ||
         comp->HasUnmatchedInputRepresentations()) {
       return this;
     }
@@ -2537,12 +2498,10 @@
              comparison()->operation_cid() == kSmiCid) {
     BinarySmiOpInstr* bit_and = NULL;
     bool negate = false;
-    if (RecognizeTestPattern(comparison()->left(),
-                             comparison()->right(),
+    if (RecognizeTestPattern(comparison()->left(), comparison()->right(),
                              &negate)) {
       bit_and = comparison()->left()->definition()->AsBinarySmiOp();
-    } else if (RecognizeTestPattern(comparison()->right(),
-                                    comparison()->left(),
+    } else if (RecognizeTestPattern(comparison()->right(), comparison()->left(),
                                     &negate)) {
       bit_and = comparison()->right()->definition()->AsBinarySmiOp();
     }
@@ -2554,8 +2513,7 @@
           comparison()->token_pos(),
           negate ? Token::NegateComparison(comparison()->kind())
                  : comparison()->kind(),
-          bit_and->left()->Copy(zone),
-          bit_and->right()->Copy(zone));
+          bit_and->left()->Copy(zone), bit_and->right()->Copy(zone));
       ASSERT(!CanDeoptimize());
       RemoveEnvironment();
       flow_graph->CopyDeoptTarget(this, bit_and);
@@ -2570,7 +2528,8 @@
 Definition* StrictCompareInstr::Canonicalize(FlowGraph* flow_graph) {
   if (!HasUses()) return NULL;
   bool negated = false;
-  Definition* replacement = CanonicalizeStrictCompare(this, &negated);
+  Definition* replacement = CanonicalizeStrictCompare(this, &negated,
+                                                      /* is_branch = */ false);
   if (negated && replacement->IsComparison()) {
     ASSERT(replacement != this);
     replacement->AsComparison()->NegateComparison();
@@ -2592,8 +2551,7 @@
 Instruction* CheckClassIdInstr::Canonicalize(FlowGraph* flow_graph) {
   if (value()->BindsToConstant()) {
     const Object& constant_value = value()->BoundConstant();
-    if (constant_value.IsSmi() &&
-        Smi::Cast(constant_value).Value() == cid_) {
+    if (constant_value.IsSmi() && Smi::Cast(constant_value).Value() == cid_) {
       return NULL;
     }
   }
@@ -2611,8 +2569,8 @@
   for (intptr_t i = 0; i < data.length(); i += 2) {
     if (data[i] == cid) {
       return (data[i + 1] == true_result)
-          ? flow_graph->GetConstant(Bool::True())
-          : flow_graph->GetConstant(Bool::False());
+                 ? flow_graph->GetConstant(Bool::True())
+                 : flow_graph->GetConstant(Bool::False());
     }
   }
 
@@ -2663,8 +2621,7 @@
       LoadFieldInstr::IsFixedLengthArrayCid(call->Type()->ToCid())) {
     length = call->ArgumentAt(1)->AsConstant();
   }
-  if ((length != NULL) &&
-      length->value().IsSmi() &&
+  if ((length != NULL) && length->value().IsSmi() &&
       Smi::Cast(length->value()).Value() == expected_length) {
     return NULL;  // Expected length matched.
   }
@@ -2674,7 +2631,7 @@
 
 
 Instruction* CheckSmiInstr::Canonicalize(FlowGraph* flow_graph) {
-  return (value()->Type()->ToCid() == kSmiCid) ?  NULL : this;
+  return (value()->Type()->ToCid() == kSmiCid) ? NULL : this;
 }
 
 
@@ -2716,8 +2673,8 @@
                                intptr_t deopt_id) {
   switch (to) {
     case kUnboxedInt32:
-      return new UnboxInt32Instr(
-          UnboxInt32Instr::kNoTruncation, value, deopt_id);
+      return new UnboxInt32Instr(UnboxInt32Instr::kNoTruncation, value,
+                                 deopt_id);
 
     case kUnboxedUint32:
       return new UnboxUint32Instr(value, deopt_id);
@@ -2780,8 +2737,7 @@
 void JoinEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   __ Bind(compiler->GetJumpLabel(this));
   if (!compiler->is_optimizing()) {
-    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                                   GetDeoptId(),
+    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, GetDeoptId(),
                                    TokenPosition::kNoSource);
   }
   if (HasParallelMove()) {
@@ -2811,8 +2767,7 @@
     // The deoptimization descriptor points after the edge counter code for
     // uniformity with ARM and MIPS, where we can reuse pattern matching
     // code that matches backwards from the end of the pattern.
-    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                                   GetDeoptId(),
+    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, GetDeoptId(),
                                    TokenPosition::kNoSource);
   }
   if (HasParallelMove()) {
@@ -2856,7 +2811,8 @@
 
 
 LocationSummary* IndirectEntryInstr::MakeLocationSummary(
-    Zone* zone, bool optimizing) const {
+    Zone* zone,
+    bool optimizing) const {
   return JoinEntryInstr::MakeLocationSummary(zone, optimizing);
 }
 
@@ -2936,7 +2892,8 @@
 
 
 LocationSummary* MaterializeObjectInstr::MakeLocationSummary(
-    Zone* zone, bool optimizing) const {
+    Zone* zone,
+    bool optimizing) const {
   UNREACHABLE();
   return NULL;
 }
@@ -2980,14 +2937,10 @@
 LocationSummary* DropTempsInstr::MakeLocationSummary(Zone* zone,
                                                      bool optimizing) const {
   return (InputCount() == 1)
-      ? LocationSummary::Make(zone,
-                              1,
-                              Location::SameAsFirstInput(),
-                              LocationSummary::kNoCall)
-      : LocationSummary::Make(zone,
-                              0,
-                              Location::NoLocation(),
-                              LocationSummary::kNoCall);
+             ? LocationSummary::Make(zone, 1, Location::SameAsFirstInput(),
+                                     LocationSummary::kNoCall)
+             : LocationSummary::Make(zone, 0, Location::NoLocation(),
+                                     LocationSummary::kNoCall);
 }
 
 
@@ -3017,13 +2970,11 @@
                                        Value* left,
                                        Value* right,
                                        bool needs_number_check)
-    : ComparisonInstr(token_pos,
-                      kind,
-                      left,
-                      right,
-                      Thread::Current()->GetNextDeoptId()),
+    : TemplateComparison(token_pos, kind, Thread::Current()->GetNextDeoptId()),
       needs_number_check_(needs_number_check) {
   ASSERT((kind == Token::kEQ_STRICT) || (kind == Token::kNE_STRICT));
+  SetInputAt(0, left);
+  SetInputAt(1, right);
 }
 
 
@@ -3040,15 +2991,20 @@
     return 0;
   }
   switch (kind) {
-    case Token::kADD: return StubCode::SmiAddInlineCache_entry();
-    case Token::kSUB: return StubCode::SmiSubInlineCache_entry();
-    case Token::kEQ:  return StubCode::SmiEqualInlineCache_entry();
-    default:          return NULL;
+    case Token::kADD:
+      return StubCode::SmiAddInlineCache_entry();
+    case Token::kSUB:
+      return StubCode::SmiSubInlineCache_entry();
+    case Token::kEQ:
+      return StubCode::SmiEqualInlineCache_entry();
+    default:
+      return NULL;
   }
 }
 #else
-static void TryFastPathSmiOp(
-    FlowGraphCompiler* compiler, ICData* call_ic_data, const String& name) {
+static void TryFastPathSmiOp(FlowGraphCompiler* compiler,
+                             ICData* call_ic_data,
+                             const String& name) {
   if (!FLAG_two_args_smi_icd) {
     return;
   }
@@ -3066,7 +3022,7 @@
     }
   } else if (name.raw() == Symbols::LAngleBracket().raw()) {
     if (call_ic_data->AddSmiSmiCheckForFastSmiStubs()) {
-     __ LessThanTOS();
+      __ LessThanTOS();
     }
   } else if (name.raw() == Symbols::RAngleBracket().raw()) {
     if (call_ic_data->AddSmiSmiCheckForFastSmiStubs()) {
@@ -3094,9 +3050,8 @@
   const ICData* call_ic_data = NULL;
   if (!FLAG_propagate_ic_data || !compiler->is_optimizing() ||
       (ic_data() == NULL)) {
-    const Array& arguments_descriptor =
-        Array::Handle(zone, ArgumentsDescriptor::New(ArgumentCount(),
-                                                     argument_names()));
+    const Array& arguments_descriptor = Array::Handle(
+        zone, ArgumentsDescriptor::New(ArgumentCount(), argument_names()));
     call_ic_data = compiler->GetOrAddInstanceCallICData(
         deopt_id(), function_name(), arguments_descriptor,
         checked_argument_count());
@@ -3110,18 +3065,12 @@
     if (ic_data()->NumberOfUsedChecks() > 0) {
       const ICData& unary_ic_data =
           ICData::ZoneHandle(zone, ic_data()->AsUnaryClassChecks());
-      compiler->GenerateInstanceCall(deopt_id(),
-                                     token_pos(),
-                                     ArgumentCount(),
-                                     locs(),
-                                     unary_ic_data);
+      compiler->GenerateInstanceCall(deopt_id(), token_pos(), ArgumentCount(),
+                                     locs(), unary_ic_data);
     } else {
       // Call was not visited yet, use original ICData in order to populate it.
-      compiler->GenerateInstanceCall(deopt_id(),
-                                     token_pos(),
-                                     ArgumentCount(),
-                                     locs(),
-                                     *call_ic_data);
+      compiler->GenerateInstanceCall(deopt_id(), token_pos(), ArgumentCount(),
+                                     locs(), *call_ic_data);
     }
   } else {
     // Unoptimized code.
@@ -3138,11 +3087,8 @@
       compiler->EmitInstanceCall(*stub_entry, *call_ic_data, ArgumentCount(),
                                  deopt_id(), token_pos(), locs());
     } else {
-      compiler->GenerateInstanceCall(deopt_id(),
-                                     token_pos(),
-                                     ArgumentCount(),
-                                     locs(),
-                                     *call_ic_data);
+      compiler->GenerateInstanceCall(deopt_id(), token_pos(), ArgumentCount(),
+                                     locs(), *call_ic_data);
     }
   }
 #else
@@ -3175,8 +3121,7 @@
       UNIMPLEMENTED();
       break;
   }
-  compiler->AddCurrentDescriptor(RawPcDescriptors::kIcCall,
-                                 deopt_id(),
+  compiler->AddCurrentDescriptor(RawPcDescriptors::kIcCall, deopt_id(),
                                  token_pos());
   compiler->RecordAfterCall(this);
 
@@ -3191,9 +3136,8 @@
   if (FLAG_precompiled_mode && with_checks()) return false;
 
   return ic_data().HasOneTarget() &&
-      (MethodRecognizer::RecognizeKind(
-          Function::Handle(ic_data().GetTargetAt(0))) !=
-       MethodRecognizer::kUnknown);
+         (MethodRecognizer::RecognizeKind(Function::Handle(
+              ic_data().GetTargetAt(0))) != MethodRecognizer::kUnknown);
 }
 
 
@@ -3205,27 +3149,82 @@
   if (!with_checks()) {
     ASSERT(ic_data().HasOneTarget());
     const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0));
-    compiler->GenerateStaticCall(deopt_id(),
-                                 instance_call()->token_pos(),
-                                 target,
-                                 instance_call()->ArgumentCount(),
-                                 instance_call()->argument_names(),
-                                 locs(),
+    compiler->GenerateStaticCall(deopt_id(), instance_call()->token_pos(),
+                                 target, instance_call()->ArgumentCount(),
+                                 instance_call()->argument_names(), locs(),
                                  ICData::Handle());
     return;
   }
 
-  compiler->EmitPolymorphicInstanceCall(ic_data(),
-                                        instance_call()->ArgumentCount(),
-                                        instance_call()->argument_names(),
-                                        deopt_id(),
-                                        instance_call()->token_pos(),
-                                        locs(),
-                                        complete());
+  compiler->EmitPolymorphicInstanceCall(
+      ic_data(), instance_call()->ArgumentCount(),
+      instance_call()->argument_names(), deopt_id(),
+      instance_call()->token_pos(), locs(), complete());
 }
 #endif
 
 
+RawType* PolymorphicInstanceCallInstr::ComputeRuntimeType(
+    const ICData& ic_data) {
+  bool is_string = true;
+  bool is_integer = true;
+  bool is_double = true;
+
+  const intptr_t num_checks = ic_data.NumberOfChecks();
+  for (intptr_t i = 0; i < num_checks; i++) {
+    const intptr_t cid = ic_data.GetReceiverClassIdAt(i);
+    is_string = is_string && RawObject::IsStringClassId(cid);
+    is_integer = is_integer && RawObject::IsIntegerClassId(cid);
+    is_double = is_double && (cid == kDoubleCid);
+  }
+
+  if (is_string) {
+    return Type::StringType();
+  } else if (is_integer) {
+    return Type::IntType();
+  } else if (is_double) {
+    return Type::Double();
+  }
+
+  return Type::null();
+}
+
+
+Definition* PolymorphicInstanceCallInstr::Canonicalize(FlowGraph* flow_graph) {
+  if (!HasSingleRecognizedTarget() || with_checks()) {
+    return this;
+  }
+
+  const Function& target = Function::Handle(ic_data().GetTargetAt(0));
+  if (target.recognized_kind() == MethodRecognizer::kObjectRuntimeType) {
+    const AbstractType& type =
+        AbstractType::Handle(ComputeRuntimeType(ic_data()));
+    if (!type.IsNull()) {
+      return flow_graph->GetConstant(type);
+    }
+  }
+
+  return this;
+}
+
+
+Definition* StaticCallInstr::Canonicalize(FlowGraph* flow_graph) {
+  if (!FLAG_precompiled_mode) {
+    return this;
+  }
+
+  if (function().recognized_kind() == MethodRecognizer::kObjectRuntimeType) {
+    if (input_use_list() == NULL) {
+      // This function has only environment uses. In precompiled mode it is
+      // fine to remove it - because we will never deoptimize.
+      return flow_graph->constant_dead();
+    }
+  }
+
+  return this;
+}
+
+
 LocationSummary* StaticCallInstr::MakeLocationSummary(Zone* zone,
                                                       bool optimizing) const {
   return MakeCallSummary(zone);
@@ -3236,9 +3235,8 @@
   const ICData* call_ic_data = NULL;
   if (!FLAG_propagate_ic_data || !compiler->is_optimizing() ||
       (ic_data() == NULL)) {
-    const Array& arguments_descriptor =
-        Array::Handle(ArgumentsDescriptor::New(ArgumentCount(),
-                                               argument_names()));
+    const Array& arguments_descriptor = Array::Handle(
+        ArgumentsDescriptor::New(ArgumentCount(), argument_names()));
     MethodRecognizer::Kind recognized_kind =
         MethodRecognizer::RecognizeKind(function());
     int num_args_checked = 0;
@@ -3251,35 +3249,28 @@
       default:
         break;
     }
-    call_ic_data = compiler->GetOrAddStaticCallICData(deopt_id(),
-                                                      function(),
-                                                      arguments_descriptor,
-                                                      num_args_checked);
+    call_ic_data = compiler->GetOrAddStaticCallICData(
+        deopt_id(), function(), arguments_descriptor, num_args_checked);
   } else {
     call_ic_data = &ICData::ZoneHandle(ic_data()->raw());
   }
 
 #if !defined(TARGET_ARCH_DBC)
-  compiler->GenerateStaticCall(deopt_id(),
-                               token_pos(),
-                               function(),
-                               ArgumentCount(),
-                               argument_names(),
-                               locs(),
+  compiler->GenerateStaticCall(deopt_id(), token_pos(), function(),
+                               ArgumentCount(), argument_names(), locs(),
                                *call_ic_data);
 #else
   const Array& arguments_descriptor =
-      (ic_data() == NULL) ?
-        Array::Handle(ArgumentsDescriptor::New(ArgumentCount(),
-                                               argument_names())) :
-        Array::Handle(ic_data()->arguments_descriptor());
+      (ic_data() == NULL) ? Array::Handle(ArgumentsDescriptor::New(
+                                ArgumentCount(), argument_names()))
+                          : Array::Handle(ic_data()->arguments_descriptor());
   const intptr_t argdesc_kidx = __ AddConstant(arguments_descriptor);
 
   if (compiler->is_optimizing()) {
     __ PushConstant(function());
     __ StaticCall(ArgumentCount(), argdesc_kidx);
-    compiler->AddCurrentDescriptor(RawPcDescriptors::kOther,
-        deopt_id(), token_pos());
+    compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id(),
+                                   token_pos());
     compiler->RecordAfterCall(this);
     __ PopLocal(locs()->out(0).reg());
   } else {
@@ -3287,7 +3278,7 @@
     __ PushConstant(ic_data_kidx);
     __ IndirectStaticCall(ArgumentCount(), argdesc_kidx);
     compiler->AddCurrentDescriptor(RawPcDescriptors::kUnoptStaticCall,
-        deopt_id(), token_pos());
+                                   deopt_id(), token_pos());
     compiler->RecordAfterCall(this);
   }
 #endif  // !defined(TARGET_ARCH_DBC)
@@ -3295,13 +3286,10 @@
 
 
 void AssertAssignableInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  compiler->GenerateAssertAssignable(token_pos(),
-                                     deopt_id(),
-                                     dst_type(),
-                                     dst_name(),
-                                     locs());
+  compiler->GenerateAssertAssignable(token_pos(), deopt_id(), dst_type(),
+                                     dst_name(), locs());
 
-  // DBC does not use LocationSummaries in the same way as other architectures.
+// DBC does not use LocationSummaries in the same way as other architectures.
 #if !defined(TARGET_ARCH_DBC)
   ASSERT(locs()->in(0).reg() == locs()->out(0).reg());
 #endif  // !defined(TARGET_ARCH_DBC)
@@ -3310,7 +3298,7 @@
 
 LocationSummary* DeoptimizeInstr::MakeLocationSummary(Zone* zone,
                                                       bool opt) const {
-  return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
+  return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
 }
 
 
@@ -3328,13 +3316,10 @@
                                intptr_t fixed_parameter_count,
                                const ParsedFunction& parsed_function) {
   Environment* env =
-      new(zone) Environment(definitions.length(),
-                               fixed_parameter_count,
-                               Thread::kNoDeoptId,
-                               parsed_function,
-                               NULL);
+      new (zone) Environment(definitions.length(), fixed_parameter_count,
+                             Thread::kNoDeoptId, parsed_function, NULL);
   for (intptr_t i = 0; i < definitions.length(); ++i) {
-    env->values_.Add(new(zone) Value(definitions[i]));
+    env->values_.Add(new (zone) Value(definitions[i]));
   }
   return env;
 }
@@ -3342,12 +3327,9 @@
 
 Environment* Environment::DeepCopy(Zone* zone, intptr_t length) const {
   ASSERT(length <= values_.length());
-  Environment* copy = new(zone) Environment(
-      length,
-      fixed_parameter_count_,
-      deopt_id_,
-      parsed_function_,
-      (outer_ == NULL) ? NULL : outer_->DeepCopy(zone));
+  Environment* copy = new (zone)
+      Environment(length, fixed_parameter_count_, deopt_id_, parsed_function_,
+                  (outer_ == NULL) ? NULL : outer_->DeepCopy(zone));
   if (locations_ != NULL) {
     Location* new_locations = zone->Alloc<Location>(length);
     copy->set_locations(new_locations);
@@ -3388,9 +3370,9 @@
 
   Environment* copy = DeepCopy(zone, values_.length() - argc);
   for (intptr_t i = 0; i < argc; i++) {
-    copy->values_.Add(new(zone) Value(dead));
+    copy->values_.Add(new (zone) Value(dead));
   }
-  copy->values_.Add(new(zone) Value(result));
+  copy->values_.Add(new (zone) Value(result));
 
   instr->SetEnvironment(copy);
   for (Environment::DeepIterator it(copy); !it.Done(); it.Advance()) {
@@ -3419,52 +3401,43 @@
 }
 
 
+ComparisonInstr* DoubleTestOpInstr::CopyWithNewOperands(Value* new_left,
+                                                        Value* new_right) {
+  UNREACHABLE();
+  return NULL;
+}
+
+
 ComparisonInstr* EqualityCompareInstr::CopyWithNewOperands(Value* new_left,
                                                            Value* new_right) {
-  return new EqualityCompareInstr(token_pos(),
-                                  kind(),
-                                  new_left,
-                                  new_right,
-                                  operation_cid(),
-                                  deopt_id());
+  return new EqualityCompareInstr(token_pos(), kind(), new_left, new_right,
+                                  operation_cid(), deopt_id());
 }
 
 
 ComparisonInstr* RelationalOpInstr::CopyWithNewOperands(Value* new_left,
                                                         Value* new_right) {
-  return new RelationalOpInstr(token_pos(),
-                               kind(),
-                               new_left,
-                               new_right,
-                               operation_cid(),
-                               deopt_id());
+  return new RelationalOpInstr(token_pos(), kind(), new_left, new_right,
+                               operation_cid(), deopt_id());
 }
 
 
 ComparisonInstr* StrictCompareInstr::CopyWithNewOperands(Value* new_left,
                                                          Value* new_right) {
-  return new StrictCompareInstr(token_pos(),
-                                kind(),
-                                new_left,
-                                new_right,
+  return new StrictCompareInstr(token_pos(), kind(), new_left, new_right,
                                 needs_number_check());
 }
 
 
-
 ComparisonInstr* TestSmiInstr::CopyWithNewOperands(Value* new_left,
                                                    Value* new_right) {
   return new TestSmiInstr(token_pos(), kind(), new_left, new_right);
 }
 
 
-
 ComparisonInstr* TestCidsInstr::CopyWithNewOperands(Value* new_left,
                                                     Value* new_right) {
-  return new TestCidsInstr(token_pos(),
-                           kind(),
-                           new_left,
-                           cid_results(),
+  return new TestCidsInstr(token_pos(), kind(), new_left, cid_results(),
                            deopt_id());
 }
 
@@ -3501,8 +3474,8 @@
   if (comparison->IsStrictCompare()) {
     // Strict comparison with number checks calls a stub and is not supported
     // by if-conversion.
-    return is_smi_result
-        && !comparison->AsStrictCompare()->needs_number_check();
+    return is_smi_result &&
+           !comparison->AsStrictCompare()->needs_number_check();
   }
   if (comparison->operation_cid() != kSmiCid) {
     // Non-smi comparisons are not supported by if-conversion.
@@ -3532,8 +3505,9 @@
 
 
 Instruction* CheckArrayBoundInstr::Canonicalize(FlowGraph* flow_graph) {
-  return IsRedundant(RangeBoundary::FromDefinition(length()->definition())) ?
-      NULL : this;
+  return IsRedundant(RangeBoundary::FromDefinition(length()->definition()))
+             ? NULL
+             : this;
 }
 
 
@@ -3567,12 +3541,9 @@
     const Class& cls =
         Class::Handle(Library::LookupCoreClass(Symbols::StringBase()));
     ASSERT(!cls.IsNull());
-    function_ =
-        Resolver::ResolveStatic(
-            cls,
-            Library::PrivateCoreLibName(Symbols::Interpolate()),
-            kNumberOfArguments,
-            kNoArgumentNames);
+    function_ = Resolver::ResolveStatic(
+        cls, Library::PrivateCoreLibName(Symbols::Interpolate()),
+        kNumberOfArguments, kNoArgumentNames);
   }
   ASSERT(!function_.IsNull());
   return function_;
@@ -3611,8 +3582,7 @@
     pieces.Add(Object::null_string());
   }
 
-  for (Value::Iterator it(create_array->input_use_list());
-       !it.Done();
+  for (Value::Iterator it(create_array->input_use_list()); !it.Done();
        it.Advance()) {
     Instruction* curr = it.Current()->instruction();
     if (curr == this) continue;
@@ -3634,10 +3604,10 @@
       } else if (obj.IsSmi()) {
         const char* cstr = obj.ToCString();
         pieces.SetAt(store_index,
-            String::Handle(zone, String::New(cstr, Heap::kOld)));
+                     String::Handle(zone, String::New(cstr, Heap::kOld)));
       } else if (obj.IsBool()) {
-        pieces.SetAt(store_index,
-            Bool::Cast(obj).value() ? Symbols::True() : Symbols::False());
+        pieces.SetAt(store_index, Bool::Cast(obj).value() ? Symbols::True()
+                                                          : Symbols::False());
       } else if (obj.IsNull()) {
         pieces.SetAt(store_index, Symbols::Null());
       } else {
@@ -3648,12 +3618,76 @@
     }
   }
 
-  const String& concatenated = String::ZoneHandle(zone,
-      Symbols::FromConcatAll(thread, pieces));
+  const String& concatenated =
+      String::ZoneHandle(zone, Symbols::FromConcatAll(thread, pieces));
   return flow_graph->GetConstant(concatenated);
 }
 
 
+static AlignmentType StrengthenAlignment(intptr_t cid,
+                                         AlignmentType alignment) {
+  switch (cid) {
+    case kTypedDataInt8ArrayCid:
+    case kTypedDataUint8ArrayCid:
+    case kTypedDataUint8ClampedArrayCid:
+    case kExternalTypedDataUint8ArrayCid:
+    case kExternalTypedDataUint8ClampedArrayCid:
+    case kOneByteStringCid:
+    case kExternalOneByteStringCid:
+      // Don't need to worry about alignment for accessing bytes.
+      return kAlignedAccess;
+    case kTypedDataFloat32ArrayCid:
+    case kTypedDataFloat64ArrayCid:
+    case kTypedDataFloat64x2ArrayCid:
+    case kTypedDataInt32x4ArrayCid:
+    case kTypedDataFloat32x4ArrayCid:
+      // TODO(rmacnak): Investigate alignment requirements of floating point
+      // loads.
+      return kAlignedAccess;
+  }
+
+  return alignment;
+}
+
+
+LoadIndexedInstr::LoadIndexedInstr(Value* array,
+                                   Value* index,
+                                   intptr_t index_scale,
+                                   intptr_t class_id,
+                                   AlignmentType alignment,
+                                   intptr_t deopt_id,
+                                   TokenPosition token_pos)
+    : TemplateDefinition(deopt_id),
+      index_scale_(index_scale),
+      class_id_(class_id),
+      alignment_(StrengthenAlignment(class_id, alignment)),
+      token_pos_(token_pos) {
+  SetInputAt(0, array);
+  SetInputAt(1, index);
+}
+
+
+StoreIndexedInstr::StoreIndexedInstr(Value* array,
+                                     Value* index,
+                                     Value* value,
+                                     StoreBarrierType emit_store_barrier,
+                                     intptr_t index_scale,
+                                     intptr_t class_id,
+                                     AlignmentType alignment,
+                                     intptr_t deopt_id,
+                                     TokenPosition token_pos)
+    : TemplateDefinition(deopt_id),
+      emit_store_barrier_(emit_store_barrier),
+      index_scale_(index_scale),
+      class_id_(class_id),
+      alignment_(StrengthenAlignment(class_id, alignment)),
+      token_pos_(token_pos) {
+  SetInputAt(kArrayPos, array);
+  SetInputAt(kIndexPos, index);
+  SetInputAt(kValuePos, value);
+}
+
+
 InvokeMathCFunctionInstr::InvokeMathCFunctionInstr(
     ZoneGrowableArray<Value*>* inputs,
     intptr_t deopt_id,
@@ -3700,60 +3734,88 @@
 }
 
 // Use expected function signatures to help MSVC compiler resolve overloading.
-typedef double (*UnaryMathCFunction) (double x);
-typedef double (*BinaryMathCFunction) (double x, double y);
+typedef double (*UnaryMathCFunction)(double x);
+typedef double (*BinaryMathCFunction)(double x, double y);
 
-DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcPow, 2, true /* is_float */,
-    reinterpret_cast<RuntimeFunction>(
-        static_cast<BinaryMathCFunction>(&pow)));
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(
+    LibcPow,
+    2,
+    true /* is_float */,
+    reinterpret_cast<RuntimeFunction>(static_cast<BinaryMathCFunction>(&pow)));
 
-DEFINE_RAW_LEAF_RUNTIME_ENTRY(DartModulo, 2, true /* is_float */,
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(
+    DartModulo,
+    2,
+    true /* is_float */,
     reinterpret_cast<RuntimeFunction>(
         static_cast<BinaryMathCFunction>(&DartModulo)));
 
-DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcAtan2, 2, true /* is_float */,
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(
+    LibcAtan2,
+    2,
+    true /* is_float */,
     reinterpret_cast<RuntimeFunction>(
         static_cast<BinaryMathCFunction>(&atan2_ieee)));
 
-DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcFloor, 1, true /* is_float */,
-    reinterpret_cast<RuntimeFunction>(
-        static_cast<UnaryMathCFunction>(&floor)));
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(
+    LibcFloor,
+    1,
+    true /* is_float */,
+    reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&floor)));
 
-DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcCeil, 1, true /* is_float */,
-    reinterpret_cast<RuntimeFunction>(
-        static_cast<UnaryMathCFunction>(&ceil)));
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(
+    LibcCeil,
+    1,
+    true /* is_float */,
+    reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&ceil)));
 
-DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcTrunc, 1, true /* is_float */,
-    reinterpret_cast<RuntimeFunction>(
-        static_cast<UnaryMathCFunction>(&trunc)));
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(
+    LibcTrunc,
+    1,
+    true /* is_float */,
+    reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&trunc)));
 
-DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcRound, 1, true /* is_float */,
-    reinterpret_cast<RuntimeFunction>(
-        static_cast<UnaryMathCFunction>(&round)));
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(
+    LibcRound,
+    1,
+    true /* is_float */,
+    reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&round)));
 
-DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcCos, 1, true /* is_float */,
-    reinterpret_cast<RuntimeFunction>(
-        static_cast<UnaryMathCFunction>(&cos)));
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(
+    LibcCos,
+    1,
+    true /* is_float */,
+    reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&cos)));
 
-DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcSin, 1, true /* is_float */,
-    reinterpret_cast<RuntimeFunction>(
-        static_cast<UnaryMathCFunction>(&sin)));
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(
+    LibcSin,
+    1,
+    true /* is_float */,
+    reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&sin)));
 
-DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcAsin, 1, true /* is_float */,
-    reinterpret_cast<RuntimeFunction>(
-        static_cast<UnaryMathCFunction>(&asin)));
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(
+    LibcAsin,
+    1,
+    true /* is_float */,
+    reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&asin)));
 
-DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcAcos, 1, true /* is_float */,
-    reinterpret_cast<RuntimeFunction>(
-        static_cast<UnaryMathCFunction>(&acos)));
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(
+    LibcAcos,
+    1,
+    true /* is_float */,
+    reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&acos)));
 
-DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcTan, 1, true /* is_float */,
-    reinterpret_cast<RuntimeFunction>(
-        static_cast<UnaryMathCFunction>(&tan)));
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(
+    LibcTan,
+    1,
+    true /* is_float */,
+    reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&tan)));
 
-DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcAtan, 1, true /* is_float */,
-    reinterpret_cast<RuntimeFunction>(
-        static_cast<UnaryMathCFunction>(&atan)));
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(
+    LibcAtan,
+    1,
+    true /* is_float */,
+    reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&atan)));
 
 
 const RuntimeEntry& InvokeMathCFunctionInstr::TargetFunction() const {
@@ -3793,9 +3855,12 @@
 
 const char* MathUnaryInstr::KindToCString(MathUnaryKind kind) {
   switch (kind) {
-    case kIllegal:       return "illegal";
-    case kSqrt:          return "sqrt";
-    case kDoubleSquare:  return "double-square";
+    case kIllegal:
+      return "illegal";
+    case kSqrt:
+      return "sqrt";
+    case kDoubleSquare:
+      return "double-square";
   }
   UNREACHABLE();
   return "";
@@ -3810,9 +3875,7 @@
 MergedMathInstr::MergedMathInstr(ZoneGrowableArray<Value*>* inputs,
                                  intptr_t deopt_id,
                                  MergedMathInstr::Kind kind)
-    : PureDefinition(deopt_id),
-      inputs_(inputs),
-      kind_(kind) {
+    : PureDefinition(deopt_id), inputs_(inputs), kind_(kind) {
   ASSERT(inputs_->length() == InputCountFor(kind_));
   for (intptr_t i = 0; i < inputs_->length(); ++i) {
     ASSERT((*inputs)[i] != NULL);
@@ -3824,18 +3887,26 @@
 
 intptr_t MergedMathInstr::OutputIndexOf(MethodRecognizer::Kind kind) {
   switch (kind) {
-    case MethodRecognizer::kMathSin: return 1;
-    case MethodRecognizer::kMathCos: return 0;
-    default: UNIMPLEMENTED(); return -1;
+    case MethodRecognizer::kMathSin:
+      return 1;
+    case MethodRecognizer::kMathCos:
+      return 0;
+    default:
+      UNIMPLEMENTED();
+      return -1;
   }
 }
 
 
 intptr_t MergedMathInstr::OutputIndexOf(Token::Kind token) {
   switch (token) {
-    case Token::kTRUNCDIV: return 0;
-    case Token::kMOD: return 1;
-    default: UNIMPLEMENTED(); return -1;
+    case Token::kTRUNCDIV:
+      return 0;
+    case Token::kMOD:
+      return 1;
+    default:
+      UNIMPLEMENTED();
+      return -1;
   }
 }
 
@@ -3850,13 +3921,10 @@
   NativeFunction native_function = NativeEntry::ResolveNative(
       library, native_name(), num_params, &auto_setup_scope);
   if (native_function == NULL) {
-    Report::MessageF(Report::kError,
-                     Script::Handle(function().script()),
-                     function().token_pos(),
-                     Report::AtLocation,
+    Report::MessageF(Report::kError, Script::Handle(function().script()),
+                     function().token_pos(), Report::AtLocation,
                      "native function '%s' (%" Pd " arguments) cannot be found",
-                     native_name().ToCString(),
-                     function().NumParameters());
+                     native_name().ToCString(), function().NumParameters());
   }
   set_native_c_function(native_function);
   function().SetIsNativeAutoSetupScope(auto_setup_scope);
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 102f6b8..0aa3af3 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_INTERMEDIATE_LANGUAGE_H_
-#define VM_INTERMEDIATE_LANGUAGE_H_
+#ifndef RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_
+#define RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_
 
 #include "vm/allocation.h"
 #include "vm/ast.h"
@@ -53,18 +53,18 @@
   static const bool kNonNullable = false;
 
   CompileType(bool is_nullable, intptr_t cid, const AbstractType* type)
-      : is_nullable_(is_nullable), cid_(cid), type_(type) { }
+      : is_nullable_(is_nullable), cid_(cid), type_(type) {}
 
   CompileType(const CompileType& other)
       : ValueObject(),
         is_nullable_(other.is_nullable_),
         cid_(other.cid_),
-        type_(other.type_) { }
+        type_(other.type_) {}
 
   CompileType& operator=(const CompileType& other) {
     is_nullable_ = other.is_nullable_;
     cid_ = other.cid_;
-    type_ =  other.type_;
+    type_ = other.type_;
     return *this;
   }
 
@@ -96,8 +96,7 @@
   // given type.
   bool IsAssignableTo(const AbstractType& type) {
     bool is_instance;
-    return CanComputeIsInstanceOf(type, kNullable, &is_instance) &&
-           is_instance;
+    return CanComputeIsInstanceOf(type, kNullable, &is_instance) && is_instance;
   }
 
   // Create a new CompileType representing given combination of class id and
@@ -151,19 +150,16 @@
   // Returns true if this and other types are the same.
   bool IsEqualTo(CompileType* other) {
     return (is_nullable_ == other->is_nullable_) &&
-        (ToNullableCid() == other->ToNullableCid()) &&
-        (ToAbstractType()->Equals(*other->ToAbstractType()));
+           (ToNullableCid() == other->ToNullableCid()) &&
+           (ToAbstractType()->Equals(*other->ToAbstractType()));
   }
 
-  bool IsNone() const {
-    return (cid_ == kIllegalCid) && (type_ == NULL);
-  }
+  bool IsNone() const { return (cid_ == kIllegalCid) && (type_ == NULL); }
 
   bool IsInt() {
-    return !is_nullable() &&
-      ((ToCid() == kSmiCid) ||
-       (ToCid() == kMintCid) ||
-       ((type_ != NULL) && (type_->Equals(Type::Handle(Type::IntType())))));
+    return !is_nullable() && ((ToCid() == kSmiCid) || (ToCid() == kMintCid) ||
+                              ((type_ != NULL) &&
+                               (type_->Equals(Type::Handle(Type::IntType())))));
   }
 
   void PrintTo(BufferFormatter* f) const;
@@ -188,12 +184,10 @@
     return zone_type->ToCompileType();
   }
 
-  CompileType* ToCompileType() {
-    return &type_;
-  }
+  CompileType* ToCompileType() { return &type_; }
 
  protected:
-  explicit ZoneCompileType(const CompileType& type) : type_(type) { }
+  explicit ZoneCompileType(const CompileType& type) : type_(type) {}
 
   CompileType type_;
 };
@@ -203,14 +197,14 @@
 // another compile type.
 class ConstrainedCompileType : public ZoneCompileType {
  public:
-  virtual ~ConstrainedCompileType() { }
+  virtual ~ConstrainedCompileType() {}
 
   // Recompute compile type.
   virtual void Update() = 0;
 
  protected:
   explicit ConstrainedCompileType(const CompileType& type)
-      : ZoneCompileType(type) { }
+      : ZoneCompileType(type) {}
 };
 
 
@@ -221,11 +215,9 @@
 class NotNullConstrainedCompileType : public ConstrainedCompileType {
  public:
   explicit NotNullConstrainedCompileType(CompileType* source)
-      : ConstrainedCompileType(source->CopyNonNullable()), source_(source) { }
+      : ConstrainedCompileType(source->CopyNonNullable()), source_(source) {}
 
-  virtual void Update() {
-    type_ = source_->CopyNonNullable();
-  }
+  virtual void Update() { type_ = source_->CopyNonNullable(); }
 
  private:
   CompileType* source_;
@@ -240,9 +232,7 @@
     kLastEffect = kExternalization
   };
 
-  EffectSet(const EffectSet& other)
-      : ValueObject(), effects_(other.effects_) {
-  }
+  EffectSet(const EffectSet& other) : ValueObject(), effects_(other.effects_) {}
 
   bool IsNone() const { return effects_ == kNoEffects; }
 
@@ -252,14 +242,12 @@
     return EffectSet(kExternalization);
   }
 
-  static EffectSet Externalization() {
-    return EffectSet(kExternalization);
-  }
+  static EffectSet Externalization() { return EffectSet(kExternalization); }
 
   bool ToInt() { return effects_; }
 
  private:
-  explicit EffectSet(intptr_t effects) : effects_(effects) { }
+  explicit EffectSet(intptr_t effects) : effects_(effects) {}
 
   intptr_t effects_;
 };
@@ -279,6 +267,7 @@
       current_ = next_;
       if (next_ != NULL) next_ = next_->next_use();
     }
+
    private:
     Value* current_;
     Value* next_;
@@ -290,7 +279,7 @@
         next_use_(NULL),
         instruction_(NULL),
         use_index_(-1),
-        reaching_type_(NULL) { }
+        reaching_type_(NULL) {}
 
   Definition* definition() const { return definition_; }
   void set_definition(Definition* definition) { definition_ = definition; }
@@ -318,7 +307,7 @@
   inline void BindTo(Definition* definition);
   inline void BindToEnvironment(Definition* definition);
 
-  Value* Copy(Zone* zone) { return new(zone) Value(definition_); }
+  Value* Copy(Zone* zone) { return new (zone) Value(definition_); }
 
   // This function must only be used when the new Value is dominated by
   // the original Value.
@@ -330,9 +319,7 @@
 
   CompileType* Type();
 
-  void SetReachingType(CompileType* type) {
-    reaching_type_ = type;
-  }
+  void SetReachingType(CompileType* type) { reaching_type_ = type; }
 
   void PrintTo(BufferFormatter* f) const;
 
@@ -372,10 +359,10 @@
 
 // An embedded container with N elements of type T.  Used (with partial
 // specialization for N=0) because embedded arrays cannot have size 0.
-template<typename T, intptr_t N>
+template <typename T, intptr_t N>
 class EmbeddedArray {
  public:
-  EmbeddedArray() : elements_() { }
+  EmbeddedArray() : elements_() {}
 
   intptr_t length() const { return N; }
 
@@ -389,20 +376,16 @@
     return elements_[i];
   }
 
-  const T& At(intptr_t i) const {
-    return (*this)[i];
-  }
+  const T& At(intptr_t i) const { return (*this)[i]; }
 
-  void SetAt(intptr_t i, const T& val) {
-    (*this)[i] = val;
-  }
+  void SetAt(intptr_t i, const T& val) { (*this)[i] = val; }
 
  private:
   T elements_[N];
 };
 
 
-template<typename T>
+template <typename T>
 class EmbeddedArray<T, 0> {
  public:
   intptr_t length() const { return 0; }
@@ -477,6 +460,7 @@
   M(AllocateUninitializedContext)                                              \
   M(CloneContext)                                                              \
   M(BinarySmiOp)                                                               \
+  M(CheckedSmiComparison)                                                      \
   M(CheckedSmiOp)                                                              \
   M(BinaryInt32Op)                                                             \
   M(UnarySmiOp)                                                                \
@@ -497,6 +481,7 @@
   M(UnboxedConstant)                                                           \
   M(CheckEitherNonSmi)                                                         \
   M(BinaryDoubleOp)                                                            \
+  M(DoubleTestOp)                                                              \
   M(MathUnary)                                                                 \
   M(MathMinMax)                                                                \
   M(Box)                                                                       \
@@ -570,7 +555,7 @@
   M(UnboxInteger)                                                              \
   M(Comparison)                                                                \
   M(UnaryIntegerOp)                                                            \
-  M(BinaryIntegerOp)                                                           \
+  M(BinaryIntegerOp)
 
 #define FORWARD_DECLARATION(type) class type##Instr;
 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION)
@@ -579,7 +564,7 @@
 
 #define DEFINE_INSTRUCTION_TYPE_CHECK(type)                                    \
   virtual type##Instr* As##type() { return this; }                             \
-  virtual const char* DebugName() const { return #type; }                      \
+  virtual const char* DebugName() const { return #type; }
 
 // Functions required in all concrete instruction classes.
 #define DECLARE_INSTRUCTION_NO_BACKEND(type)                                   \
@@ -588,25 +573,24 @@
   DEFINE_INSTRUCTION_TYPE_CHECK(type)
 
 #define DECLARE_INSTRUCTION_BACKEND()                                          \
-  virtual LocationSummary* MakeLocationSummary(Zone* zone,                     \
-                                               bool optimizing) const;         \
-  virtual void EmitNativeCode(FlowGraphCompiler* compiler);                    \
+  virtual LocationSummary* MakeLocationSummary(Zone* zone, bool optimizing)    \
+      const;                                                                   \
+  virtual void EmitNativeCode(FlowGraphCompiler* compiler);
 
 // Functions required in all concrete instruction classes.
 #define DECLARE_INSTRUCTION(type)                                              \
   DECLARE_INSTRUCTION_NO_BACKEND(type)                                         \
-  DECLARE_INSTRUCTION_BACKEND()                                                \
+  DECLARE_INSTRUCTION_BACKEND()
 
 #ifndef PRODUCT
-#define PRINT_TO_SUPPORT                                                       \
-    virtual void PrintTo(BufferFormatter* f) const;
+#define PRINT_TO_SUPPORT virtual void PrintTo(BufferFormatter* f) const;
 #else
 #define PRINT_TO_SUPPORT
 #endif  // !PRODUCT
 
 #ifndef PRODUCT
 #define PRINT_OPERANDS_TO_SUPPORT                                              \
-    virtual void PrintOperandsTo(BufferFormatter* f) const;
+  virtual void PrintOperandsTo(BufferFormatter* f) const;
 #else
 #define PRINT_OPERANDS_TO_SUPPORT
 #endif  // !PRODUCT
@@ -614,9 +598,7 @@
 class Instruction : public ZoneAllocated {
  public:
 #define DECLARE_TAG(type) k##type,
-  enum Tag {
-    FOR_EACH_INSTRUCTION(DECLARE_TAG)
-  };
+  enum Tag { FOR_EACH_INSTRUCTION(DECLARE_TAG) };
 #undef DECLARE_TAG
 
   explicit Instruction(intptr_t deopt_id = Thread::kNoDeoptId)
@@ -626,9 +608,9 @@
         next_(NULL),
         env_(NULL),
         locs_(NULL),
-        inlining_id_(-1) { }
+        inlining_id_(-1) {}
 
-  virtual ~Instruction() { }
+  virtual ~Instruction() {}
 
   virtual Tag tag() const = 0;
 
@@ -640,9 +622,7 @@
   const ICData* GetICData(
       const ZoneGrowableArray<const ICData*>& ic_data_array) const;
 
-  virtual TokenPosition token_pos() const {
-    return TokenPosition::kNoSource;
-  }
+  virtual TokenPosition token_pos() const { return TokenPosition::kNoSource; }
 
   virtual intptr_t InputCount() const = 0;
   virtual Value* InputAt(intptr_t i) const = 0;
@@ -737,9 +717,9 @@
 #define INSTRUCTION_TYPE_CHECK(Name)                                           \
   DECLARE_INSTRUCTION_TYPE_CHECK(Name, Name##Instr)
 
-DECLARE_INSTRUCTION_TYPE_CHECK(Definition, Definition)
-FOR_EACH_INSTRUCTION(INSTRUCTION_TYPE_CHECK)
-FOR_EACH_ABSTRACT_INSTRUCTION(INSTRUCTION_TYPE_CHECK)
+  DECLARE_INSTRUCTION_TYPE_CHECK(Definition, Definition)
+  FOR_EACH_INSTRUCTION(INSTRUCTION_TYPE_CHECK)
+  FOR_EACH_ABSTRACT_INSTRUCTION(INSTRUCTION_TYPE_CHECK)
 
 #undef INSTRUCTION_TYPE_CHECK
 #undef DECLARE_INSTRUCTION_TYPE_CHECK
@@ -763,18 +743,14 @@
 
   static LocationSummary* MakeCallSummary(Zone* zone);
 
-  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    UNIMPLEMENTED();
-  }
+  virtual void EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); }
 
   Environment* env() const { return env_; }
   void SetEnvironment(Environment* deopt_env);
   void RemoveEnvironment();
 
   intptr_t lifetime_position() const { return lifetime_position_; }
-  void set_lifetime_position(intptr_t pos) {
-    lifetime_position_ = pos;
-  }
+  void set_lifetime_position(intptr_t pos) { lifetime_position_ = pos; }
 
   bool HasUnmatchedInputRepresentations() const;
 
@@ -784,13 +760,9 @@
   }
 
   // Representation of the value produced by this computation.
-  virtual Representation representation() const {
-    return kTagged;
-  }
+  virtual Representation representation() const { return kTagged; }
 
-  bool WasEliminated() const {
-    return next() == NULL;
-  }
+  bool WasEliminated() const { return next() == NULL; }
 
   // Returns deoptimization id that corresponds to the deoptimization target
   // that input operands conversions inserted for this instruction can jump
@@ -818,14 +790,10 @@
   // instruction.
   Instruction* AppendInstruction(Instruction* tail);
 
-  virtual bool AllowsDCE() const {
-    return false;
-  }
+  virtual bool AllowsDCE() const { return false; }
 
   // Returns true if CSE and LICM are allowed for this instruction.
-  virtual bool AllowsCSE() const {
-    return false;
-  }
+  virtual bool AllowsCSE() const { return false; }
 
   // Returns set of effects created by this instruction.
   virtual EffectSet Effects() const = 0;
@@ -874,9 +842,7 @@
     return CanDeoptimize() || CanBecomeDeoptimizationTarget();
   }
 
-  virtual bool CanBecomeDeoptimizationTarget() const {
-    return false;
-  }
+  virtual bool CanBecomeDeoptimizationTarget() const { return false; }
 
   void InheritDeoptTargetAfter(FlowGraph* flow_graph,
                                Definition* call,
@@ -900,20 +866,19 @@
   friend class CatchBlockEntryInstr;  // deopt_id_
 
   // Fetch deopt id without checking if this computation can deoptimize.
-  intptr_t GetDeoptId() const {
-    return deopt_id_;
-  }
+  intptr_t GetDeoptId() const { return deopt_id_; }
 
   void CopyDeoptIdFrom(const Instruction& instr) {
     deopt_id_ = instr.deopt_id_;
   }
 
  private:
+  friend class BranchInstr;      // For RawSetInputAt.
+  friend class IfThenElseInstr;  // For RawSetInputAt.
+
   virtual void RawSetInputAt(intptr_t i, Value* value) = 0;
 
-  enum {
-    kNoPlaceId = -1
-  };
+  enum { kNoPlaceId = -1 };
 
   intptr_t deopt_id_;
   union {
@@ -932,8 +897,7 @@
 
 class PureInstruction : public Instruction {
  public:
-  explicit PureInstruction(intptr_t deopt_id)
-      : Instruction(deopt_id) { }
+  explicit PureInstruction(intptr_t deopt_id) : Instruction(deopt_id) {}
 
   virtual bool AllowsCSE() const { return true; }
   virtual EffectSet Dependencies() const { return EffectSet::None(); }
@@ -956,25 +920,26 @@
 // Types to be used as CSETrait for TemplateInstruction/TemplateDefinition.
 // Pure instructions are those that allow CSE and have no effects and
 // no dependencies.
-template<typename DefaultBase, typename PureBase>
+template <typename DefaultBase, typename PureBase>
 struct Pure {
   typedef PureBase Base;
 };
 
 
-template<typename DefaultBase, typename PureBase>
+template <typename DefaultBase, typename PureBase>
 struct NoCSE {
   typedef DefaultBase Base;
 };
 
 
-template<intptr_t N,
-         typename ThrowsTrait,
-         template<typename Default, typename Pure> class CSETrait = NoCSE>
-class TemplateInstruction: public CSETrait<Instruction, PureInstruction>::Base {
+template <intptr_t N,
+          typename ThrowsTrait,
+          template <typename Default, typename Pure> class CSETrait = NoCSE>
+class TemplateInstruction
+    : public CSETrait<Instruction, PureInstruction>::Base {
  public:
   explicit TemplateInstruction(intptr_t deopt_id = Thread::kNoDeoptId)
-      : CSETrait<Instruction, PureInstruction>::Base(deopt_id), inputs_() { }
+      : CSETrait<Instruction, PureInstruction>::Base(deopt_id), inputs_() {}
 
   virtual intptr_t InputCount() const { return N; }
   virtual Value* InputAt(intptr_t i) const { return inputs_[i]; }
@@ -985,15 +950,13 @@
   EmbeddedArray<Value*, N> inputs_;
 
  private:
-  virtual void RawSetInputAt(intptr_t i, Value* value) {
-    inputs_[i] = value;
-  }
+  virtual void RawSetInputAt(intptr_t i, Value* value) { inputs_[i] = value; }
 };
 
 
 class MoveOperands : public ZoneAllocated {
  public:
-  MoveOperands(Location dest, Location src) : dest_(dest), src_(src) { }
+  MoveOperands(Location dest, Location src) : dest_(dest), src_(src) {}
 
   Location src() const { return src_; }
   Location dest() const { return dest_; }
@@ -1051,7 +1014,7 @@
 
 class ParallelMoveInstr : public TemplateInstruction<0, NoThrow> {
  public:
-  ParallelMoveInstr() : moves_(4) { }
+  ParallelMoveInstr() : moves_(4) {}
 
   DECLARE_INSTRUCTION(ParallelMove)
 
@@ -1088,7 +1051,7 @@
   PRINT_TO_SUPPORT
 
  private:
-  GrowableArray<MoveOperands*> moves_;   // Elements cannot be null.
+  GrowableArray<MoveOperands*> moves_;  // Elements cannot be null.
 
   DISALLOW_COPY_AND_ASSIGN(ParallelMoveInstr);
 };
@@ -1116,7 +1079,7 @@
   // the register allocator.
   void set_start_pos(intptr_t pos) { start_pos_ = pos; }
   intptr_t start_pos() const { return start_pos_; }
-  void  set_end_pos(intptr_t pos) { end_pos_ = pos; }
+  void set_end_pos(intptr_t pos) { end_pos_ = pos; }
   intptr_t end_pos() const { return end_pos_; }
 
   BlockEntryInstr* dominator() const { return dominator_; }
@@ -1137,13 +1100,9 @@
   Instruction* last_instruction() const { return last_instruction_; }
   void set_last_instruction(Instruction* instr) { last_instruction_ = instr; }
 
-  ParallelMoveInstr* parallel_move() const {
-    return parallel_move_;
-  }
+  ParallelMoveInstr* parallel_move() const { return parallel_move_; }
 
-  bool HasParallelMove() const {
-    return parallel_move_ != NULL;
-  }
+  bool HasParallelMove() const { return parallel_move_ != NULL; }
 
   bool HasNonRedundantParallelMove() const {
     return HasParallelMove() && !parallel_move()->IsRedundant();
@@ -1168,15 +1127,13 @@
   // block is recorded in each entry instruction.  Returns true when called the
   // first time on this particular block within one graph traversal, and false
   // on all successive calls.
-  bool DiscoverBlock(
-      BlockEntryInstr* predecessor,
-      GrowableArray<BlockEntryInstr*>* preorder,
-      GrowableArray<intptr_t>* parent);
+  bool DiscoverBlock(BlockEntryInstr* predecessor,
+                     GrowableArray<BlockEntryInstr*>* preorder,
+                     GrowableArray<intptr_t>* parent);
 
   // Perform a depth first search to prune code not reachable from an OSR
   // entry point.
-  bool PruneUnreachable(FlowGraphBuilder* builder,
-                        GraphEntryInstr* graph_entry,
+  bool PruneUnreachable(GraphEntryInstr* graph_entry,
                         Instruction* parent,
                         intptr_t osr_id,
                         BitVector* block_marks);
@@ -1203,9 +1160,7 @@
   virtual bool MayThrow() const { return false; }
 
   intptr_t try_index() const { return try_index_; }
-  void set_try_index(intptr_t index) {
-    try_index_ = index;
-  }
+  void set_try_index(intptr_t index) { try_index_ = index; }
 
   // True for blocks inside a try { } region.
   bool InsideTryBlock() const {
@@ -1213,13 +1168,9 @@
   }
 
   BitVector* loop_info() const { return loop_info_; }
-  void set_loop_info(BitVector* loop_info) {
-    loop_info_ = loop_info;
-  }
+  void set_loop_info(BitVector* loop_info) { loop_info_ = loop_info; }
 
-  virtual BlockEntryInstr* GetBlock() {
-    return this;
-  }
+  virtual BlockEntryInstr* GetBlock() { return this; }
 
   virtual TokenPosition token_pos() const {
     return TokenPosition::kControlFlow;
@@ -1253,8 +1204,7 @@
         last_instruction_(NULL),
         offset_(-1),
         parallel_move_(NULL),
-        loop_info_(NULL) {
-  }
+        loop_info_(NULL) {}
 
  private:
   virtual void RawSetInputAt(intptr_t i, Value* value) { UNREACHABLE(); }
@@ -1390,9 +1340,7 @@
   }
   TargetEntryInstr* normal_entry() const { return normal_entry_; }
 
-  const ParsedFunction& parsed_function() const {
-    return parsed_function_;
-  }
+  const ParsedFunction& parsed_function() const { return parsed_function_; }
 
   const GrowableArray<CatchBlockEntryInstr*>& catch_entries() const {
     return catch_entries_;
@@ -1428,7 +1376,7 @@
   JoinEntryInstr(intptr_t block_id, intptr_t try_index)
       : BlockEntryInstr(block_id, try_index),
         predecessors_(2),  // Two is the assumed to be the common case.
-        phis_(NULL) { }
+        phis_(NULL) {}
 
   DECLARE_INSTRUCTION(JoinEntry)
 
@@ -1476,21 +1424,16 @@
 
 class PhiIterator : public ValueObject {
  public:
-  explicit PhiIterator(JoinEntryInstr* join)
-      : phis_(join->phis()), index_(0) { }
+  explicit PhiIterator(JoinEntryInstr* join) : phis_(join->phis()), index_(0) {}
 
   void Advance() {
     ASSERT(!Done());
     index_++;
   }
 
-  bool Done() const {
-    return (phis_ == NULL) || (index_ >= phis_->length());
-  }
+  bool Done() const { return (phis_ == NULL) || (index_ >= phis_->length()); }
 
-  PhiInstr* Current() const {
-    return (*phis_)[index_];
-  }
+  PhiInstr* Current() const { return (*phis_)[index_]; }
 
  private:
   ZoneGrowableArray<PhiInstr*>* phis_;
@@ -1503,7 +1446,7 @@
   TargetEntryInstr(intptr_t block_id, intptr_t try_index)
       : BlockEntryInstr(block_id, try_index),
         predecessor_(NULL),
-        edge_weight_(0.0) { }
+        edge_weight_(0.0) {}
 
   DECLARE_INSTRUCTION(TargetEntry)
 
@@ -1542,8 +1485,7 @@
   IndirectEntryInstr(intptr_t block_id,
                      intptr_t indirect_id,
                      intptr_t try_index)
-      : JoinEntryInstr(block_id, try_index),
-        indirect_id_(indirect_id) { }
+      : JoinEntryInstr(block_id, try_index), indirect_id_(indirect_id) {}
 
   DECLARE_INSTRUCTION(IndirectEntry)
 
@@ -1566,7 +1508,8 @@
                        const LocalVariable& exception_var,
                        const LocalVariable& stacktrace_var,
                        bool needs_stacktrace,
-                       intptr_t deopt_id)
+                       intptr_t deopt_id,
+                       bool should_restore_closure_context = false)
       : BlockEntryInstr(block_id, try_index),
         graph_entry_(graph_entry),
         predecessor_(NULL),
@@ -1574,7 +1517,8 @@
         catch_try_index_(catch_try_index),
         exception_var_(exception_var),
         stacktrace_var_(stacktrace_var),
-        needs_stacktrace_(needs_stacktrace) {
+        needs_stacktrace_(needs_stacktrace),
+        should_restore_closure_context_(should_restore_closure_context) {
     deopt_id_ = deopt_id;
   }
 
@@ -1597,9 +1541,7 @@
 
   // Returns try index for the try block to which this catch handler
   // corresponds.
-  intptr_t catch_try_index() const {
-    return catch_try_index_;
-  }
+  intptr_t catch_try_index() const { return catch_try_index_; }
   GrowableArray<Definition*>* initial_definitions() {
     return &initial_definitions_;
   }
@@ -1615,6 +1557,12 @@
     predecessor_ = predecessor;
   }
 
+  bool should_restore_closure_context() const {
+    ASSERT(exception_var_.is_captured() == stacktrace_var_.is_captured());
+    ASSERT(!exception_var_.is_captured() || should_restore_closure_context_);
+    return should_restore_closure_context_;
+  }
+
   GraphEntryInstr* graph_entry_;
   BlockEntryInstr* predecessor_;
   const Array& catch_handler_types_;
@@ -1623,6 +1571,7 @@
   const LocalVariable& exception_var_;
   const LocalVariable& stacktrace_var_;
   const bool needs_stacktrace_;
+  const bool should_restore_closure_context_;
 
   DISALLOW_COPY_AND_ASSIGN(CatchBlockEntryInstr);
 };
@@ -1656,8 +1605,7 @@
   }
 
   AliasIdentity(const AliasIdentity& other)
-      : ValueObject(), value_(other.value_) {
-  }
+      : ValueObject(), value_(other.value_) {}
 
   AliasIdentity& operator=(const AliasIdentity& other) {
     value_ = other.value_;
@@ -1665,7 +1613,7 @@
   }
 
  private:
-  explicit AliasIdentity(intptr_t value) : value_(value) { }
+  explicit AliasIdentity(intptr_t value) : value_(value) {}
 
   enum {
     kUnknown = 0,
@@ -1729,23 +1677,17 @@
   inline bool IsMintDefinition();
 
   bool IsInt32Definition() {
-    return IsBinaryInt32Op() ||
-           IsBoxInt32() ||
-           IsUnboxInt32() ||
+    return IsBinaryInt32Op() || IsBoxInt32() || IsUnboxInt32() ||
            IsUnboxedIntConverter();
   }
 
   // Compute compile type for this definition. It is safe to use this
   // approximation even before type propagator was run (e.g. during graph
   // building).
-  virtual CompileType ComputeType() const {
-    return CompileType::Dynamic();
-  }
+  virtual CompileType ComputeType() const { return CompileType::Dynamic(); }
 
   // Update CompileType of the definition. Returns true if the type has changed.
-  virtual bool RecomputeType() {
-    return false;
-  }
+  virtual bool RecomputeType() { return false; }
 
   PRINT_OPERANDS_TO_SUPPORT
   PRINT_TO_SUPPORT
@@ -1823,13 +1765,9 @@
     temp_index_ = reinterpret_cast<intptr_t>(other);
   }
 
-  virtual AliasIdentity Identity() const {
-    return AliasIdentity::Unknown();
-  }
+  virtual AliasIdentity Identity() const { return AliasIdentity::Unknown(); }
 
-  virtual void SetIdentity(AliasIdentity identity) {
-    UNREACHABLE();
-  }
+  virtual void SetIdentity(AliasIdentity identity) { UNREACHABLE(); }
 
   Definition* OriginalDefinition();
 
@@ -1871,8 +1809,7 @@
 
 class PureDefinition : public Definition {
  public:
-  explicit PureDefinition(intptr_t deopt_id)
-      : Definition(deopt_id) { }
+  explicit PureDefinition(intptr_t deopt_id) : Definition(deopt_id) {}
 
   virtual bool AllowsCSE() const { return true; }
   virtual EffectSet Dependencies() const { return EffectSet::None(); }
@@ -1881,13 +1818,13 @@
 };
 
 
-template<intptr_t N,
-         typename ThrowsTrait,
-         template<typename Impure, typename Pure> class CSETrait = NoCSE>
+template <intptr_t N,
+          typename ThrowsTrait,
+          template <typename Impure, typename Pure> class CSETrait = NoCSE>
 class TemplateDefinition : public CSETrait<Definition, PureDefinition>::Base {
  public:
   explicit TemplateDefinition(intptr_t deopt_id = Thread::kNoDeoptId)
-      : CSETrait<Definition, PureDefinition>::Base(deopt_id), inputs_() { }
+      : CSETrait<Definition, PureDefinition>::Base(deopt_id), inputs_() {}
 
   virtual intptr_t InputCount() const { return N; }
   virtual Value* InputAt(intptr_t i) const { return inputs_[i]; }
@@ -1901,9 +1838,7 @@
   friend class BranchInstr;
   friend class IfThenElseInstr;
 
-  virtual void RawSetInputAt(intptr_t i, Value* value) {
-    inputs_[i] = value;
-  }
+  virtual void RawSetInputAt(intptr_t i, Value* value) { inputs_[i] = value; }
 };
 
 
@@ -1920,13 +1855,13 @@
 class PhiInstr : public Definition {
  public:
   PhiInstr(JoinEntryInstr* block, intptr_t num_inputs)
-    : block_(block),
-      inputs_(num_inputs),
-      representation_(kTagged),
-      reaching_defs_(NULL),
-      loop_variable_info_(NULL),
-      is_alive_(false),
-      is_receiver_(kUnknownReceiver) {
+      : block_(block),
+        inputs_(num_inputs),
+        representation_(kTagged),
+        reaching_defs_(NULL),
+        loop_variable_info_(NULL),
+        is_alive_(false),
+        is_receiver_(kUnknownReceiver) {
     for (intptr_t i = 0; i < num_inputs; ++i) {
       inputs_.Add(NULL);
     }
@@ -1956,13 +1891,9 @@
     return representation_;
   }
 
-  virtual Representation representation() const {
-    return representation_;
-  }
+  virtual Representation representation() const { return representation_; }
 
-  virtual void set_representation(Representation r) {
-    representation_ = r;
-  }
+  virtual void set_representation(Representation r) { representation_ = r; }
 
   virtual intptr_t Hashcode() const {
     UNREACHABLE();
@@ -1973,9 +1904,7 @@
 
   virtual void InferRange(RangeAnalysis* analysis, Range* range);
 
-  BitVector* reaching_defs() const {
-    return reaching_defs_;
-  }
+  BitVector* reaching_defs() const { return reaching_defs_; }
 
   void set_reaching_defs(BitVector* reaching_defs) {
     reaching_defs_ = reaching_defs;
@@ -1996,19 +1925,13 @@
 
   PRINT_TO_SUPPORT
 
-  enum ReceiverType {
-    kUnknownReceiver = -1,
-    kNotReceiver = 0,
-    kReceiver = 1
-  };
+  enum ReceiverType { kUnknownReceiver = -1, kNotReceiver = 0, kReceiver = 1 };
 
   ReceiverType is_receiver() const {
     return static_cast<ReceiverType>(is_receiver_);
   }
 
-  void set_is_receiver(ReceiverType is_receiver) {
-    is_receiver_ = is_receiver;
-  }
+  void set_is_receiver(ReceiverType is_receiver) { is_receiver_ = is_receiver; }
 
  private:
   // Direct access to inputs_ in order to resize it due to unreachable
@@ -2034,7 +1957,7 @@
   ParameterInstr(intptr_t index,
                  BlockEntryInstr* block,
                  Register base_reg = FPREG)
-      : index_(index), base_reg_(base_reg), block_(block) { }
+      : index_(index), base_reg_(base_reg), block_(block) {}
 
   DECLARE_INSTRUCTION(Parameter)
 
@@ -2079,9 +2002,7 @@
 
 class PushArgumentInstr : public TemplateDefinition<1, NoThrow> {
  public:
-  explicit PushArgumentInstr(Value* value) {
-    SetInputAt(0, value);
-  }
+  explicit PushArgumentInstr(Value* value) { SetInputAt(0, value); }
 
   DECLARE_INSTRUCTION(PushArgument)
 
@@ -2143,8 +2064,7 @@
  public:
   explicit ThrowInstr(TokenPosition token_pos)
       : TemplateInstruction(Thread::Current()->GetNextDeoptId()),
-        token_pos_(token_pos) {
-  }
+        token_pos_(token_pos) {}
 
   DECLARE_INSTRUCTION(Throw)
 
@@ -2170,8 +2090,7 @@
   ReThrowInstr(TokenPosition token_pos, intptr_t catch_try_index)
       : TemplateInstruction(Thread::Current()->GetNextDeoptId()),
         token_pos_(token_pos),
-        catch_try_index_(catch_try_index) {
-  }
+        catch_try_index_(catch_try_index) {}
 
   DECLARE_INSTRUCTION(ReThrow)
 
@@ -2194,8 +2113,7 @@
 
 class StopInstr : public TemplateInstruction<0, NoThrow> {
  public:
-  explicit StopInstr(const char* message)
-      : message_(message) {
+  explicit StopInstr(const char* message) : message_(message) {
     ASSERT(message != NULL);
   }
 
@@ -2221,12 +2139,11 @@
 class GotoInstr : public TemplateInstruction<0, NoThrow> {
  public:
   explicit GotoInstr(JoinEntryInstr* entry)
-    : TemplateInstruction(Thread::Current()->GetNextDeoptId()),
-      block_(NULL),
-      successor_(entry),
-      edge_weight_(0.0),
-      parallel_move_(NULL) {
-  }
+      : TemplateInstruction(Thread::Current()->GetNextDeoptId()),
+        block_(NULL),
+        successor_(entry),
+        edge_weight_(0.0),
+        parallel_move_(NULL) {}
 
   DECLARE_INSTRUCTION(Goto)
 
@@ -2252,13 +2169,9 @@
 
   virtual EffectSet Effects() const { return EffectSet::None(); }
 
-  ParallelMoveInstr* parallel_move() const {
-    return parallel_move_;
-  }
+  ParallelMoveInstr* parallel_move() const { return parallel_move_; }
 
-  bool HasParallelMove() const {
-    return parallel_move_ != NULL;
-  }
+  bool HasParallelMove() const { return parallel_move_ != NULL; }
 
   bool HasNonRedundantParallelMove() const {
     return HasParallelMove() && !parallel_move()->IsRedundant();
@@ -2302,9 +2215,8 @@
 // to IndirectGoto as an input.
 class IndirectGotoInstr : public TemplateInstruction<1, NoThrow> {
  public:
-  IndirectGotoInstr(TypedData* offsets,
-                    Value* offset_from_start)
-    : offsets_(*offsets) {
+  IndirectGotoInstr(TypedData* offsets, Value* offset_from_start)
+      : offsets_(*offsets) {
     SetInputAt(0, offset_from_start);
   }
 
@@ -2345,10 +2257,10 @@
 };
 
 
-class ComparisonInstr : public TemplateDefinition<2, NoThrow, Pure> {
+class ComparisonInstr : public Definition {
  public:
-  Value* left() const { return inputs_[0]; }
-  Value* right() const { return inputs_[1]; }
+  Value* left() const { return InputAt(0); }
+  Value* right() const { return InputAt(1); }
 
   virtual TokenPosition token_pos() const { return token_pos_; }
   Token::Kind kind() const { return kind_; }
@@ -2361,17 +2273,13 @@
   virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler,
                                        BranchLabels labels) = 0;
 
-  void SetDeoptId(const Instruction& instr) {
-    CopyDeoptIdFrom(instr);
-  }
+  void SetDeoptId(const Instruction& instr) { CopyDeoptIdFrom(instr); }
 
   // Operation class id is computed from collected ICData.
   void set_operation_cid(intptr_t value) { operation_cid_ = value; }
   intptr_t operation_cid() const { return operation_cid_; }
 
-  void NegateComparison() {
-    kind_ = Token::NegateComparison(kind_);
-  }
+  virtual void NegateComparison() { kind_ = Token::NegateComparison(kind_); }
 
   virtual bool CanBecomeDeoptimizationTarget() const { return true; }
   virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); }
@@ -2379,7 +2287,7 @@
   virtual bool AttributesEqual(Instruction* other) const {
     ComparisonInstr* other_comparison = other->AsComparison();
     return kind() == other_comparison->kind() &&
-        (operation_cid() == other_comparison->operation_cid());
+           (operation_cid() == other_comparison->operation_cid());
   }
 
   DEFINE_INSTRUCTION_TYPE_CHECK(Comparison)
@@ -2387,18 +2295,11 @@
  protected:
   ComparisonInstr(TokenPosition token_pos,
                   Token::Kind kind,
-                  Value* left,
-                  Value* right,
                   intptr_t deopt_id = Thread::kNoDeoptId)
-      : TemplateDefinition(deopt_id),
+      : Definition(deopt_id),
         token_pos_(token_pos),
         kind_(kind),
-        operation_cid_(kIllegalCid) {
-    SetInputAt(0, left);
-    if (right != NULL) {
-      SetInputAt(1, right);
-    }
-  }
+        operation_cid_(kIllegalCid) {}
 
  private:
   const TokenPosition token_pos_;
@@ -2409,6 +2310,46 @@
 };
 
 
+class PureComparison : public ComparisonInstr {
+ public:
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+
+ protected:
+  PureComparison(TokenPosition token_pos, Token::Kind kind, intptr_t deopt_id)
+      : ComparisonInstr(token_pos, kind, deopt_id) {}
+};
+
+
+template <intptr_t N,
+          typename ThrowsTrait,
+          template <typename Impure, typename Pure> class CSETrait = NoCSE>
+class TemplateComparison
+    : public CSETrait<ComparisonInstr, PureComparison>::Base {
+ public:
+  TemplateComparison(TokenPosition token_pos,
+                     Token::Kind kind,
+                     intptr_t deopt_id = Thread::kNoDeoptId)
+      : CSETrait<ComparisonInstr, PureComparison>::Base(token_pos,
+                                                        kind,
+                                                        deopt_id),
+        inputs_() {}
+
+  virtual intptr_t InputCount() const { return N; }
+  virtual Value* InputAt(intptr_t i) const { return inputs_[i]; }
+
+  virtual bool MayThrow() const { return ThrowsTrait::kCanThrow; }
+
+ protected:
+  EmbeddedArray<Value*, N> inputs_;
+
+ private:
+  virtual void RawSetInputAt(intptr_t i, Value* value) { inputs_[i] = value; }
+};
+
+
 class BranchInstr : public Instruction {
  public:
   explicit BranchInstr(ComparisonInstr* comparison)
@@ -2445,9 +2386,7 @@
     return comparison()->CanBecomeDeoptimizationTarget();
   }
 
-  virtual EffectSet Effects() const {
-    return comparison()->Effects();
-  }
+  virtual EffectSet Effects() const { return comparison()->Effects(); }
 
   ComparisonInstr* comparison() const { return comparison_; }
   void SetComparison(ComparisonInstr* comp);
@@ -2473,23 +2412,17 @@
   }
 
   // Return compile type constrained by the comparison of this branch.
-  ConstrainedCompileType* constrained_type() const {
-    return constrained_type_;
-  }
+  ConstrainedCompileType* constrained_type() const { 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_;
-  }
+  TargetEntryInstr* constant_target() const { return constant_target_; }
 
   virtual void InheritDeoptTarget(Zone* zone, Instruction* other);
 
-  virtual bool MayThrow() const {
-    return comparison()->MayThrow();
-  }
+  virtual bool MayThrow() const { return comparison()->MayThrow(); }
 
   TargetEntryInstr* true_successor() const { return true_successor_; }
   TargetEntryInstr* false_successor() const { return false_successor_; }
@@ -2521,15 +2454,11 @@
 class DeoptimizeInstr : public TemplateInstruction<0, NoThrow, Pure> {
  public:
   DeoptimizeInstr(ICData::DeoptReasonId deopt_reason, intptr_t deopt_id)
-      : TemplateInstruction(deopt_id),
-        deopt_reason_(deopt_reason) {
-  }
+      : TemplateInstruction(deopt_id), deopt_reason_(deopt_reason) {}
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual bool AttributesEqual(Instruction* other) const {
-    return true;
-  }
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
 
   DECLARE_INSTRUCTION(Deoptimize)
 
@@ -2542,9 +2471,7 @@
 
 class RedefinitionInstr : public TemplateDefinition<1, NoThrow> {
  public:
-  explicit RedefinitionInstr(Value* value) {
-    SetInputAt(0, value);
-  }
+  explicit RedefinitionInstr(Value* value) { SetInputAt(0, value); }
 
   DECLARE_INSTRUCTION(Redefinition)
 
@@ -2565,8 +2492,7 @@
 class ConstraintInstr : public TemplateDefinition<1, NoThrow> {
  public:
   ConstraintInstr(Value* value, Range* constraint)
-      : constraint_(constraint),
-        target_(NULL) {
+      : constraint_(constraint), target_(NULL) {
     SetInputAt(0, value);
   }
 
@@ -2591,12 +2517,8 @@
   // Constraints for branches have their target block stored in order
   // to find the comparison that generated the constraint:
   // target->predecessor->last_instruction->comparison.
-  void set_target(TargetEntryInstr* target) {
-    target_ = target;
-  }
-  TargetEntryInstr* target() const {
-    return target_;
-  }
+  void set_target(TargetEntryInstr* target) { target_ = target; }
+  TargetEntryInstr* target() const { return target_; }
 
   PRINT_OPERANDS_TO_SUPPORT
 
@@ -2646,9 +2568,7 @@
   explicit UnboxedConstantInstr(const Object& value,
                                 Representation representation);
 
-  virtual Representation representation() const {
-    return representation_;
-  }
+  virtual Representation representation() const { return representation_; }
 
   // Either NULL or the address of the unboxed constant.
   uword constant_address() const { return constant_address_; }
@@ -2754,8 +2674,7 @@
 class CurrentContextInstr : public TemplateDefinition<0, NoThrow> {
  public:
   CurrentContextInstr()
-      : TemplateDefinition(Thread::Current()->GetNextDeoptId()) {
-  }
+      : TemplateDefinition(Thread::Current()->GetNextDeoptId()) {}
 
   DECLARE_INSTRUCTION(CurrentContext)
   virtual CompileType ComputeType() const;
@@ -2777,17 +2696,27 @@
                    ClosureCallNode* node,
                    ZoneGrowableArray<PushArgumentInstr*>* arguments)
       : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
-        ast_node_(*node),
+        argument_names_(node->arguments()->names()),
+        token_pos_(node->token_pos()),
+        arguments_(arguments) {
+    SetInputAt(0, function);
+  }
+
+  ClosureCallInstr(Value* function,
+                   ZoneGrowableArray<PushArgumentInstr*>* arguments,
+                   const Array& argument_names,
+                   TokenPosition token_pos)
+      : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
+        argument_names_(argument_names),
+        token_pos_(token_pos),
         arguments_(arguments) {
     SetInputAt(0, function);
   }
 
   DECLARE_INSTRUCTION(ClosureCall)
 
-  const Array& argument_names() const { return ast_node_.arguments()->names(); }
-  virtual TokenPosition token_pos() const {
-    return ast_node_.token_pos();
-  }
+  const Array& argument_names() const { return argument_names_; }
+  virtual TokenPosition token_pos() const { return token_pos_; }
 
   virtual intptr_t ArgumentCount() const { return arguments_->length(); }
   virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const {
@@ -2804,7 +2733,8 @@
   PRINT_OPERANDS_TO_SUPPORT
 
  private:
-  const ClosureCallNode& ast_node_;
+  const Array& argument_names_;
+  TokenPosition token_pos_;
   ZoneGrowableArray<PushArgumentInstr*>* arguments_;
 
   DISALLOW_COPY_AND_ASSIGN(ClosureCallInstr);
@@ -2827,7 +2757,8 @@
         token_kind_(token_kind),
         arguments_(arguments),
         argument_names_(argument_names),
-        checked_argument_count_(checked_argument_count) {
+        checked_argument_count_(checked_argument_count),
+        has_unique_selector_(false) {
     ic_data_ = GetICData(ic_data_array);
     ASSERT(function_name.IsNotTemporaryScopedHandle());
     ASSERT(!arguments->is_empty());
@@ -2838,18 +2769,14 @@
            Token::IsUnaryOperator(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);
+           Token::IsTypeCastOperator(token_kind) || token_kind == Token::kGET ||
+           token_kind == Token::kSET || token_kind == Token::kILLEGAL);
   }
 
   DECLARE_INSTRUCTION(InstanceCall)
 
   const ICData* ic_data() const { return ic_data_; }
-  bool HasICData() const {
-    return (ic_data() != NULL) && !ic_data()->IsNull();
-  }
+  bool HasICData() const { return (ic_data() != NULL) && !ic_data()->IsNull(); }
 
   // ICData can be replaced by optimizer.
   void set_ic_data(const ICData* value) { ic_data_ = value; }
@@ -2864,6 +2791,9 @@
   const Array& argument_names() const { return argument_names_; }
   intptr_t checked_argument_count() const { return checked_argument_count_; }
 
+  bool has_unique_selector() const { return has_unique_selector_; }
+  void set_has_unique_selector(bool b) { has_unique_selector_ = b; }
+
   virtual bool CanDeoptimize() const { return true; }
 
   virtual bool CanBecomeDeoptimizationTarget() const {
@@ -2888,6 +2818,7 @@
   ZoneGrowableArray<PushArgumentInstr*>* const arguments_;
   const Array& argument_names_;
   const intptr_t checked_argument_count_;
+  bool has_unique_selector_;
 
   DISALLOW_COPY_AND_ASSIGN(InstanceCallInstr);
 };
@@ -2910,6 +2841,7 @@
 
   InstanceCallInstr* instance_call() const { return instance_call_; }
   bool with_checks() const { return with_checks_; }
+  void set_with_checks(bool b) { with_checks_ = b; }
   bool complete() const { return complete_; }
   virtual TokenPosition token_pos() const {
     return instance_call_->token_pos();
@@ -2936,19 +2868,23 @@
 
   virtual EffectSet Effects() const { return EffectSet::All(); }
 
+  virtual Definition* Canonicalize(FlowGraph* graph);
+
+  static RawType* ComputeRuntimeType(const ICData& ic_data);
+
   PRINT_OPERANDS_TO_SUPPORT
 
  private:
   InstanceCallInstr* instance_call_;
   const ICData& ic_data_;
-  const bool with_checks_;
+  bool with_checks_;
   const bool complete_;
 
   DISALLOW_COPY_AND_ASSIGN(PolymorphicInstanceCallInstr);
 };
 
 
-class StrictCompareInstr : public ComparisonInstr {
+class StrictCompareInstr : public TemplateComparison<2, NoThrow, Pure> {
  public:
   StrictCompareInstr(TokenPosition token_pos,
                      Token::Kind kind,
@@ -2966,8 +2902,7 @@
 
   virtual Definition* Canonicalize(FlowGraph* flow_graph);
 
-  virtual void EmitBranchCode(FlowGraphCompiler* compiler,
-                              BranchInstr* branch);
+  virtual void EmitBranchCode(FlowGraphCompiler* compiler, BranchInstr* branch);
 
   virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler,
                                        BranchLabels labels);
@@ -2990,14 +2925,16 @@
 
 // Comparison instruction that is equivalent to the (left & right) == 0
 // comparison pattern.
-class TestSmiInstr : public ComparisonInstr {
+class TestSmiInstr : public TemplateComparison<2, NoThrow, Pure> {
  public:
   TestSmiInstr(TokenPosition token_pos,
                Token::Kind kind,
                Value* left,
                Value* right)
-      : ComparisonInstr(token_pos, kind, left, right) {
+      : TemplateComparison(token_pos, kind) {
     ASSERT(kind == Token::kEQ || kind == Token::kNE);
+    SetInputAt(0, left);
+    SetInputAt(1, right);
   }
 
   DECLARE_INSTRUCTION(TestSmi);
@@ -3012,8 +2949,7 @@
     return kTagged;
   }
 
-  virtual void EmitBranchCode(FlowGraphCompiler* compiler,
-                              BranchInstr* branch);
+  virtual void EmitBranchCode(FlowGraphCompiler* compiler, BranchInstr* branch);
 
   virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler,
                                        BranchLabels labels);
@@ -3025,24 +2961,21 @@
 
 // Checks the input value cid against cids stored in a table and returns either
 // a result or deoptimizes.
-// TODO(srdjan): Modify ComparisonInstr to allow 1 or 2 arguments, since
-// TestCidInstr needs only one argument
-class TestCidsInstr : public ComparisonInstr {
+class TestCidsInstr : public TemplateComparison<1, NoThrow, Pure> {
  public:
   TestCidsInstr(TokenPosition token_pos,
                 Token::Kind kind,
                 Value* value,
                 const ZoneGrowableArray<intptr_t>& cid_results,
                 intptr_t deopt_id)
-      : ComparisonInstr(token_pos, kind, value, NULL, deopt_id),
+      : TemplateComparison(token_pos, kind, deopt_id),
         cid_results_(cid_results),
         licm_hoisted_(false) {
     ASSERT((kind == Token::kIS) || (kind == Token::kISNOT));
+    SetInputAt(0, value);
     set_operation_cid(kObjectCid);
   }
 
-  virtual intptr_t InputCount() const { return 1; }
-
   const ZoneGrowableArray<intptr_t>& cid_results() const {
     return cid_results_;
   }
@@ -3065,8 +2998,7 @@
 
   virtual bool AttributesEqual(Instruction* other) const;
 
-  virtual void EmitBranchCode(FlowGraphCompiler* compiler,
-                              BranchInstr* branch);
+  virtual void EmitBranchCode(FlowGraphCompiler* compiler, BranchInstr* branch);
 
   virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler,
                                        BranchLabels labels);
@@ -3082,7 +3014,7 @@
 };
 
 
-class EqualityCompareInstr : public ComparisonInstr {
+class EqualityCompareInstr : public TemplateComparison<2, NoThrow, Pure> {
  public:
   EqualityCompareInstr(TokenPosition token_pos,
                        Token::Kind kind,
@@ -3090,8 +3022,10 @@
                        Value* right,
                        intptr_t cid,
                        intptr_t deopt_id)
-      : ComparisonInstr(token_pos, kind, left, right, deopt_id) {
+      : TemplateComparison(token_pos, kind, deopt_id) {
     ASSERT(Token::IsEqualityOperator(kind));
+    SetInputAt(0, left);
+    SetInputAt(1, right);
     set_operation_cid(cid);
   }
 
@@ -3103,8 +3037,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual void EmitBranchCode(FlowGraphCompiler* compiler,
-                              BranchInstr* branch);
+  virtual void EmitBranchCode(FlowGraphCompiler* compiler, BranchInstr* branch);
 
   virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler,
                                        BranchLabels labels);
@@ -3123,7 +3056,7 @@
 };
 
 
-class RelationalOpInstr : public ComparisonInstr {
+class RelationalOpInstr : public TemplateComparison<2, NoThrow, Pure> {
  public:
   RelationalOpInstr(TokenPosition token_pos,
                     Token::Kind kind,
@@ -3131,8 +3064,10 @@
                     Value* right,
                     intptr_t cid,
                     intptr_t deopt_id)
-      : ComparisonInstr(token_pos, kind, left, right, deopt_id) {
+      : TemplateComparison(token_pos, kind, deopt_id) {
     ASSERT(Token::IsRelationalOperator(kind));
+    SetInputAt(0, left);
+    SetInputAt(1, right);
     set_operation_cid(cid);
   }
 
@@ -3144,8 +3079,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual void EmitBranchCode(FlowGraphCompiler* compiler,
-                              BranchInstr* branch);
+  virtual void EmitBranchCode(FlowGraphCompiler* compiler, BranchInstr* branch);
 
   virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler,
                                        BranchLabels labels);
@@ -3168,9 +3102,7 @@
 // materialization of true and false constants.
 class IfThenElseInstr : public Definition {
  public:
-  IfThenElseInstr(ComparisonInstr* comparison,
-                  Value* if_true,
-                  Value* if_false)
+  IfThenElseInstr(ComparisonInstr* comparison, Value* if_true, Value* if_false)
       : Definition(Thread::Current()->GetNextDeoptId()),
         comparison_(comparison),
         if_true_(Smi::Cast(if_true->BoundConstant()).Value()),
@@ -3192,9 +3124,7 @@
 
   Value* InputAt(intptr_t i) const { return comparison()->InputAt(i); }
 
-  virtual bool CanDeoptimize() const {
-    return comparison()->CanDeoptimize();
-  }
+  virtual bool CanDeoptimize() const { return comparison()->CanDeoptimize(); }
 
   virtual bool CanBecomeDeoptimizationTarget() const {
     return comparison()->CanBecomeDeoptimizationTarget();
@@ -3264,7 +3194,8 @@
         identity_(AliasIdentity::Unknown()) {
     ic_data_ = GetICData(ic_data_array);
     ASSERT(function.IsZoneHandle());
-    ASSERT(argument_names.IsZoneHandle() ||  argument_names.InVMHeap());
+    ASSERT(!function.IsNull());
+    ASSERT(argument_names.IsZoneHandle() || argument_names.InVMHeap());
   }
 
   StaticCallInstr(TokenPosition token_pos,
@@ -3282,17 +3213,17 @@
         is_known_list_constructor_(false),
         identity_(AliasIdentity::Unknown()) {
     ASSERT(function.IsZoneHandle());
-    ASSERT(argument_names.IsZoneHandle() ||  argument_names.InVMHeap());
+    ASSERT(!function.IsNull());
+    ASSERT(argument_names.IsZoneHandle() || argument_names.InVMHeap());
   }
 
   // ICData for static calls carries call count.
   const ICData* ic_data() const { return ic_data_; }
-  bool HasICData() const {
-    return (ic_data() != NULL) && !ic_data()->IsNull();
-  }
+  bool HasICData() const { return (ic_data() != NULL) && !ic_data()->IsNull(); }
 
   DECLARE_INSTRUCTION(StaticCall)
   virtual CompileType ComputeType() const;
+  virtual Definition* Canonicalize(FlowGraph* flow_graph);
 
   // Accessors forwarded to the AST node.
   const Function& function() const { return function_; }
@@ -3325,9 +3256,7 @@
     is_known_list_constructor_ = value;
   }
 
-  bool IsRecognizedFactory() const {
-    return is_known_list_constructor();
-  }
+  bool IsRecognizedFactory() const { return is_known_list_constructor(); }
 
   virtual AliasIdentity Identity() const { return identity_; }
   virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; }
@@ -3353,9 +3282,8 @@
 
 class LoadLocalInstr : public TemplateDefinition<0, NoThrow> {
  public:
-  LoadLocalInstr(const LocalVariable& local,
-                 TokenPosition token_pos)
-      : local_(local), is_last_(false), token_pos_(token_pos) { }
+  LoadLocalInstr(const LocalVariable& local, TokenPosition token_pos)
+      : local_(local), is_last_(false), token_pos_(token_pos) {}
 
   DECLARE_INSTRUCTION(LoadLocal)
   virtual CompileType ComputeType() const;
@@ -3420,16 +3348,12 @@
     return false;
   }
 
-  virtual TokenPosition token_pos() const {
-    return TokenPosition::kTempMove;
-  }
+  virtual TokenPosition token_pos() const { return TokenPosition::kTempMove; }
 
   PRINT_OPERANDS_TO_SUPPORT
 
  private:
-  virtual void RawSetInputAt(intptr_t i, Value* value) {
-    value_ = value;
-  }
+  virtual void RawSetInputAt(intptr_t i, Value* value) { value_ = value; }
 
   const intptr_t num_temps_;
   Value* value_;
@@ -3483,33 +3407,32 @@
 class NativeCallInstr : public TemplateDefinition<0, Throws> {
  public:
   explicit NativeCallInstr(NativeBodyNode* node)
-      : ast_node_(*node),
+      : native_name_(&node->native_c_function_name()),
+        function_(&node->function()),
         native_c_function_(NULL),
-        is_bootstrap_native_(false) { }
+        is_bootstrap_native_(false),
+        link_lazily_(node->link_lazily()),
+        token_pos_(node->token_pos()) {}
+
+  NativeCallInstr(const String* name,
+                  const Function* function,
+                  bool link_lazily,
+                  TokenPosition position)
+      : native_name_(name),
+        function_(function),
+        native_c_function_(NULL),
+        is_bootstrap_native_(false),
+        link_lazily_(link_lazily),
+        token_pos_(position) {}
 
   DECLARE_INSTRUCTION(NativeCall)
 
-  virtual TokenPosition token_pos() const {
-    return ast_node_.token_pos();
-  }
-
-  const Function& function() const { return ast_node_.function(); }
-
-  const String& native_name() const {
-    return ast_node_.native_c_function_name();
-  }
-
-  NativeFunction native_c_function() const {
-    return native_c_function_;
-  }
-
-  bool is_bootstrap_native() const {
-    return is_bootstrap_native_;
-  }
-
-  bool link_lazily() const {
-    return ast_node_.link_lazily();
-  }
+  const String& native_name() const { return *native_name_; }
+  const Function& function() const { return *function_; }
+  NativeFunction native_c_function() const { return native_c_function_; }
+  bool is_bootstrap_native() const { return is_bootstrap_native_; }
+  bool link_lazily() const { return link_lazily_; }
+  virtual TokenPosition token_pos() const { return token_pos_; }
 
   virtual bool CanDeoptimize() const { return false; }
 
@@ -3526,9 +3449,12 @@
 
   void set_is_bootstrap_native(bool value) { is_bootstrap_native_ = value; }
 
-  const NativeBodyNode& ast_node_;
+  const String* native_name_;
+  const Function* function_;
   NativeFunction native_c_function_;
   bool is_bootstrap_native_;
+  bool link_lazily_;
+  const TokenPosition token_pos_;
 
   DISALLOW_COPY_AND_ASSIGN(NativeCallInstr);
 };
@@ -3536,11 +3462,8 @@
 
 class DebugStepCheckInstr : public TemplateInstruction<0, NoThrow> {
  public:
-  DebugStepCheckInstr(TokenPosition token_pos,
-                      RawPcDescriptors::Kind stub_kind)
-      : token_pos_(token_pos),
-        stub_kind_(stub_kind) {
-  }
+  DebugStepCheckInstr(TokenPosition token_pos, RawPcDescriptors::Kind stub_kind)
+      : token_pos_(token_pos), stub_kind_(stub_kind) {}
 
   DECLARE_INSTRUCTION(DebugStepCheck)
 
@@ -3557,10 +3480,7 @@
 };
 
 
-enum StoreBarrierType {
-  kNoStoreBarrier,
-  kEmitStoreBarrier
-};
+enum StoreBarrierType { kNoStoreBarrier, kEmitStoreBarrier };
 
 
 class StoreInstanceFieldInstr : public TemplateDefinition<2, NoThrow> {
@@ -3598,10 +3518,7 @@
 
   void set_is_initialization(bool value) { is_initialization_ = value; }
 
-  enum {
-    kInstancePos = 0,
-    kValuePos = 1
-  };
+  enum { kInstancePos = 0, kValuePos = 1 };
 
   Value* instance() const { return inputs_[kInstancePos]; }
   Value* value() const { return inputs_[kValuePos]; }
@@ -3613,16 +3530,14 @@
   intptr_t offset_in_bytes() const { return offset_in_bytes_; }
 
   bool ShouldEmitStoreBarrier() const {
-    return value()->NeedsStoreBuffer()
-        && (emit_store_barrier_ == kEmitStoreBarrier);
+    return value()->NeedsStoreBuffer() &&
+           (emit_store_barrier_ == kEmitStoreBarrier);
   }
 
   virtual bool CanDeoptimize() const { return false; }
 
   // May require a deoptimization target for input conversions.
-  virtual intptr_t DeoptimizationTarget() const {
-    return GetDeoptId();
-  }
+  virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); }
 
   // Currently CSE/LICM don't operate on any instructions that can be affected
   // by stores/loads. LoadOptimizer handles loads separately. Hence stores
@@ -3660,11 +3575,8 @@
 
 class GuardFieldInstr : public TemplateInstruction<1, NoThrow, Pure> {
  public:
-  GuardFieldInstr(Value* value,
-                  const Field& field,
-                  intptr_t deopt_id)
-    : TemplateInstruction(deopt_id),
-      field_(field) {
+  GuardFieldInstr(Value* value, const Field& field, intptr_t deopt_id)
+      : TemplateInstruction(deopt_id), field_(field) {
     SetInputAt(0, value);
     CheckField(field);
   }
@@ -3690,9 +3602,7 @@
 
 class GuardFieldClassInstr : public GuardFieldInstr {
  public:
-  GuardFieldClassInstr(Value* value,
-                       const Field& field,
-                       intptr_t deopt_id)
+  GuardFieldClassInstr(Value* value, const Field& field, intptr_t deopt_id)
       : GuardFieldInstr(value, field, deopt_id) {
     CheckField(field);
   }
@@ -3710,9 +3620,7 @@
 
 class GuardFieldLengthInstr : public GuardFieldInstr {
  public:
-  GuardFieldLengthInstr(Value* value,
-                       const Field& field,
-                       intptr_t deopt_id)
+  GuardFieldLengthInstr(Value* value, const Field& field, intptr_t deopt_id)
       : GuardFieldInstr(value, field, deopt_id) {
     CheckField(field);
   }
@@ -3766,16 +3674,13 @@
   StoreStaticFieldInstr(const Field& field,
                         Value* value,
                         TokenPosition token_pos)
-      : field_(field),
-        token_pos_(token_pos) {
+      : field_(field), token_pos_(token_pos) {
     ASSERT(field.IsZoneHandle());
     SetInputAt(kValuePos, value);
     CheckField(field);
   }
 
-  enum {
-    kValuePos = 0
-  };
+  enum { kValuePos = 0 };
 
   DECLARE_INSTRUCTION(StoreStaticField)
 
@@ -3807,6 +3712,10 @@
   DISALLOW_COPY_AND_ASSIGN(StoreStaticFieldInstr);
 };
 
+enum AlignmentType {
+  kUnalignedAccess,
+  kAlignedAccess,
+};
 
 class LoadIndexedInstr : public TemplateDefinition<2, NoThrow> {
  public:
@@ -3814,15 +3723,9 @@
                    Value* index,
                    intptr_t index_scale,
                    intptr_t class_id,
+                   AlignmentType alignment,
                    intptr_t deopt_id,
-                   TokenPosition token_pos)
-      : TemplateDefinition(deopt_id),
-        index_scale_(index_scale),
-        class_id_(class_id),
-        token_pos_(token_pos) {
-    SetInputAt(0, array);
-    SetInputAt(1, index);
-  }
+                   TokenPosition token_pos);
 
   TokenPosition token_pos() const { return token_pos_; }
 
@@ -3844,6 +3747,7 @@
   Value* index() const { return inputs_[1]; }
   intptr_t index_scale() const { return index_scale_; }
   intptr_t class_id() const { return class_id_; }
+  bool aligned() const { return alignment_ == kAlignedAccess; }
 
   virtual bool CanDeoptimize() const {
     return GetDeoptId() != Thread::kNoDeoptId;
@@ -3857,6 +3761,7 @@
  private:
   const intptr_t index_scale_;
   const intptr_t class_id_;
+  const AlignmentType alignment_;
   const TokenPosition token_pos_;
 
   DISALLOW_COPY_AND_ASSIGN(LoadIndexedInstr);
@@ -3947,9 +3852,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool AttributesEqual(Instruction* other) const {
-    return true;
-  }
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
 
  private:
   DISALLOW_COPY_AND_ASSIGN(OneByteStringFromCharCodeInstr);
@@ -4020,25 +3923,12 @@
                     StoreBarrierType emit_store_barrier,
                     intptr_t index_scale,
                     intptr_t class_id,
+                    AlignmentType alignment,
                     intptr_t deopt_id,
-                    TokenPosition token_pos)
-      : TemplateDefinition(deopt_id),
-        emit_store_barrier_(emit_store_barrier),
-        index_scale_(index_scale),
-        class_id_(class_id),
-        token_pos_(token_pos) {
-    SetInputAt(kArrayPos, array);
-    SetInputAt(kIndexPos, index);
-    SetInputAt(kValuePos, value);
-  }
-
+                    TokenPosition token_pos);
   DECLARE_INSTRUCTION(StoreIndexed)
 
-  enum {
-    kArrayPos = 0,
-    kIndexPos = 1,
-    kValuePos = 2
-  };
+  enum { kArrayPos = 0, kIndexPos = 1, kValuePos = 2 };
 
   Value* array() const { return inputs_[kArrayPos]; }
   Value* index() const { return inputs_[kIndexPos]; }
@@ -4046,10 +3936,11 @@
 
   intptr_t index_scale() const { return index_scale_; }
   intptr_t class_id() const { return class_id_; }
+  bool aligned() const { return alignment_ == kAlignedAccess; }
 
   bool ShouldEmitStoreBarrier() const {
-    return value()->NeedsStoreBuffer()
-        && (emit_store_barrier_ == kEmitStoreBarrier);
+    return value()->NeedsStoreBuffer() &&
+           (emit_store_barrier_ == kEmitStoreBarrier);
   }
 
   virtual bool CanDeoptimize() const { return false; }
@@ -4072,6 +3963,7 @@
   const StoreBarrierType emit_store_barrier_;
   const intptr_t index_scale_;
   const intptr_t class_id_;
+  const AlignmentType alignment_;
   const TokenPosition token_pos_;
 
   DISALLOW_COPY_AND_ASSIGN(StoreIndexedInstr);
@@ -4081,9 +3973,7 @@
 // Note overrideable, built-in: value ? false : true.
 class BooleanNegateInstr : public TemplateDefinition<1, NoThrow> {
  public:
-  explicit BooleanNegateInstr(Value* value) {
-    SetInputAt(0, value);
-  }
+  explicit BooleanNegateInstr(Value* value) { SetInputAt(0, value); }
 
   DECLARE_INSTRUCTION(BooleanNegate)
   virtual CompileType ComputeType() const;
@@ -4272,29 +4162,20 @@
   Definition* allocation() const { return allocation_; }
   const Class& cls() const { return cls_; }
 
-  intptr_t num_variables() const {
-    return num_variables_;
-  }
+  intptr_t num_variables() const { return num_variables_; }
 
   intptr_t FieldOffsetAt(intptr_t i) const {
-    return slots_[i]->IsField()
-        ? Field::Cast(*slots_[i]).Offset()
-        : Smi::Cast(*slots_[i]).Value();
+    return slots_[i]->IsField() ? Field::Cast(*slots_[i]).Offset()
+                                : Smi::Cast(*slots_[i]).Value();
   }
 
-  const Location& LocationAt(intptr_t i) {
-    return locations_[i];
-  }
+  const Location& LocationAt(intptr_t i) { return locations_[i]; }
 
   DECLARE_INSTRUCTION(MaterializeObject)
 
-  virtual intptr_t InputCount() const {
-    return values_->length();
-  }
+  virtual intptr_t InputCount() const { return values_->length(); }
 
-  virtual Value* InputAt(intptr_t i) const {
-    return (*values_)[i];
-  }
+  virtual Value* InputAt(intptr_t i) const { return (*values_)[i]; }
 
   // SelectRepresentations pass is run once more while MaterializeObject
   // instructions are still in the graph. To avoid any redundant boxing
@@ -4314,13 +4195,10 @@
 
   virtual bool MayThrow() const { return false; }
 
-  void RemapRegisters(intptr_t* cpu_reg_slots,
-                      intptr_t* fpu_reg_slots);
+  void RemapRegisters(intptr_t* cpu_reg_slots, intptr_t* fpu_reg_slots);
 
   bool was_visited_for_liveness() const { return visited_for_liveness_; }
-  void mark_visited_for_liveness() {
-    visited_for_liveness_ = true;
-  }
+  void mark_visited_for_liveness() { visited_for_liveness_ = true; }
 
   PRINT_OPERANDS_TO_SUPPORT
 
@@ -4350,15 +4228,12 @@
                    Value* num_elements)
       : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
         token_pos_(token_pos),
-        identity_(AliasIdentity::Unknown())  {
+        identity_(AliasIdentity::Unknown()) {
     SetInputAt(kElementTypePos, element_type);
     SetInputAt(kLengthPos, num_elements);
   }
 
-  enum {
-    kElementTypePos = 0,
-    kLengthPos = 1
-  };
+  enum { kElementTypePos = 0, kLengthPos = 1 };
 
   DECLARE_INSTRUCTION(CreateArray)
   virtual CompileType ComputeType() const;
@@ -4395,9 +4270,7 @@
     SetInputAt(0, object);
   }
 
-  virtual Representation representation() const {
-    return kUntagged;
-  }
+  virtual Representation representation() const { return kUntagged; }
   DECLARE_INSTRUCTION(LoadUntagged)
   virtual CompileType ComputeType() const;
 
@@ -4424,13 +4297,9 @@
 
 class LoadClassIdInstr : public TemplateDefinition<1, NoThrow> {
  public:
-  explicit LoadClassIdInstr(Value* object) {
-    SetInputAt(0, object);
-  }
+  explicit LoadClassIdInstr(Value* object) { SetInputAt(0, object); }
 
-  virtual Representation representation() const {
-    return kTagged;
-  }
+  virtual Representation representation() const { return kTagged; }
   DECLARE_INSTRUCTION(LoadClassId)
   virtual CompileType ComputeType() const;
 
@@ -4507,9 +4376,7 @@
     recognized_kind_ = kind;
   }
 
-  MethodRecognizer::Kind recognized_kind() const {
-    return recognized_kind_;
-  }
+  MethodRecognizer::Kind recognized_kind() const { return recognized_kind_; }
 
   DECLARE_INSTRUCTION(LoadField)
   virtual CompileType ComputeType() const;
@@ -4564,8 +4431,7 @@
   DECLARE_INSTRUCTION(InstantiateType)
 
   Value* instantiator() const { return inputs_[0]; }
-  const AbstractType& type() const { return type_;
-  }
+  const AbstractType& type() const { return type_; }
   const Class& instantiator_class() const { return instantiator_class_; }
   virtual TokenPosition token_pos() const { return token_pos_; }
 
@@ -4601,9 +4467,7 @@
   DECLARE_INSTRUCTION(InstantiateTypeArguments)
 
   Value* instantiator() const { return inputs_[0]; }
-  const TypeArguments& type_arguments() const {
-    return type_arguments_;
-  }
+  const TypeArguments& type_arguments() const { return type_arguments_; }
   const Class& instantiator_class() const { return instantiator_class_; }
   virtual TokenPosition token_pos() const { return token_pos_; }
 
@@ -4626,10 +4490,8 @@
 
 class AllocateContextInstr : public TemplateDefinition<0, NoThrow> {
  public:
-  AllocateContextInstr(TokenPosition token_pos,
-                       intptr_t num_context_variables)
-      : token_pos_(token_pos),
-        num_context_variables_(num_context_variables) { }
+  AllocateContextInstr(TokenPosition token_pos, intptr_t num_context_variables)
+      : token_pos_(token_pos), num_context_variables_(num_context_variables) {}
 
   DECLARE_INSTRUCTION(AllocateContext)
   virtual CompileType ComputeType() const;
@@ -4660,9 +4522,7 @@
     CheckField(field);
   }
 
-  virtual TokenPosition token_pos() const {
-    return field_.token_pos();
-  }
+  virtual TokenPosition token_pos() const { return field_.token_pos(); }
   const Field& field() const { return field_; }
 
   DECLARE_INSTRUCTION(InitStaticField)
@@ -4802,9 +4662,7 @@
   virtual CompileType ComputeType() const;
 
   virtual bool CanDeoptimize() const { return false; }
-  virtual intptr_t DeoptimizationTarget() const {
-    return Thread::kNoDeoptId;
-  }
+  virtual intptr_t DeoptimizationTarget() const { return Thread::kNoDeoptId; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx == 0);
@@ -4817,9 +4675,7 @@
 
   Definition* Canonicalize(FlowGraph* flow_graph);
 
-  virtual TokenPosition token_pos() const {
-    return TokenPosition::kBox;
-  }
+  virtual TokenPosition token_pos() const { return TokenPosition::kBox; }
 
  protected:
   BoxInstr(Representation from_representation, Value* value)
@@ -4841,7 +4697,7 @@
 class BoxIntegerInstr : public BoxInstr {
  public:
   BoxIntegerInstr(Representation representation, Value* value)
-      : BoxInstr(representation, value) { }
+      : BoxInstr(representation, value) {}
 
   virtual bool ValueFitsSmi() const;
 
@@ -4862,7 +4718,7 @@
 class BoxInteger32Instr : public BoxIntegerInstr {
  public:
   BoxInteger32Instr(Representation representation, Value* value)
-      : BoxIntegerInstr(representation, value) { }
+      : BoxIntegerInstr(representation, value) {}
 
   DECLARE_INSTRUCTION_BACKEND()
 
@@ -4874,7 +4730,7 @@
 class BoxInt32Instr : public BoxInteger32Instr {
  public:
   explicit BoxInt32Instr(Value* value)
-      : BoxInteger32Instr(kUnboxedInt32, value) { }
+      : BoxInteger32Instr(kUnboxedInt32, value) {}
 
   DECLARE_INSTRUCTION_NO_BACKEND(BoxInt32)
 
@@ -4886,7 +4742,7 @@
 class BoxUint32Instr : public BoxInteger32Instr {
  public:
   explicit BoxUint32Instr(Value* value)
-      : BoxInteger32Instr(kUnboxedUint32, value) { }
+      : BoxInteger32Instr(kUnboxedUint32, value) {}
 
   DECLARE_INSTRUCTION_NO_BACKEND(BoxUint32)
 
@@ -4897,8 +4753,7 @@
 
 class BoxInt64Instr : public BoxIntegerInstr {
  public:
-  explicit BoxInt64Instr(Value* value)
-      : BoxIntegerInstr(kUnboxedMint, value) { }
+  explicit BoxInt64Instr(Value* value) : BoxIntegerInstr(kUnboxedMint, value) {}
 
   virtual Definition* Canonicalize(FlowGraph* flow_graph);
 
@@ -4918,17 +4773,14 @@
   virtual bool CanDeoptimize() const {
     const intptr_t value_cid = value()->Type()->ToCid();
 
-    if (CanConvertSmi() &&
-        (value()->Type()->ToCid() == kSmiCid)) {
+    if (CanConvertSmi() && (value()->Type()->ToCid() == kSmiCid)) {
       return false;
     }
 
     return (value_cid != BoxCid());
   }
 
-  virtual Representation representation() const {
-    return representation_;
-  }
+  virtual Representation representation() const { return representation_; }
 
   DECLARE_INSTRUCTION(Unbox)
   virtual CompileType ComputeType() const;
@@ -4939,20 +4791,13 @@
 
   Definition* Canonicalize(FlowGraph* flow_graph);
 
-  virtual intptr_t DeoptimizationTarget() const {
-    return GetDeoptId();
-  }
+  virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); }
 
-  virtual TokenPosition token_pos() const {
-    return TokenPosition::kBox;
-  }
+  virtual TokenPosition token_pos() const { return TokenPosition::kBox; }
 
  protected:
-  UnboxInstr(Representation representation,
-             Value* value,
-             intptr_t deopt_id)
-      : TemplateDefinition(deopt_id),
-        representation_(representation) {
+  UnboxInstr(Representation representation, Value* value, intptr_t deopt_id)
+      : TemplateDefinition(deopt_id), representation_(representation) {
     SetInputAt(0, value);
   }
 
@@ -4961,13 +4806,9 @@
   void EmitLoadFromBox(FlowGraphCompiler* compiler);
   void EmitSmiConversion(FlowGraphCompiler* compiler);
 
-  intptr_t BoxCid() const {
-    return Boxing::BoxCid(representation_);
-  }
+  intptr_t BoxCid() const { return Boxing::BoxCid(representation_); }
 
-  intptr_t ValueOffset() const {
-    return Boxing::ValueOffset(representation_);
-  }
+  intptr_t ValueOffset() const { return Boxing::ValueOffset(representation_); }
 
   const Representation representation_;
 
@@ -4984,8 +4825,7 @@
                     Value* value,
                     intptr_t deopt_id)
       : UnboxInstr(representation, value, deopt_id),
-        is_truncating_(truncation_mode == kTruncate) {
-  }
+        is_truncating_(truncation_mode == kTruncate) {}
 
   bool is_truncating() const { return is_truncating_; }
 
@@ -4994,7 +4834,7 @@
   virtual bool AttributesEqual(Instruction* other) const {
     UnboxIntegerInstr* other_unbox = other->AsUnboxInteger();
     return UnboxInstr::AttributesEqual(other) &&
-        (other_unbox->is_truncating_ == is_truncating_);
+           (other_unbox->is_truncating_ == is_truncating_);
   }
 
   virtual Definition* Canonicalize(FlowGraph* flow_graph);
@@ -5016,7 +4856,7 @@
                       TruncationMode truncation_mode,
                       Value* value,
                       intptr_t deopt_id)
-      : UnboxIntegerInstr(representation, truncation_mode, value, deopt_id) { }
+      : UnboxIntegerInstr(representation, truncation_mode, value, deopt_id) {}
 
   DECLARE_INSTRUCTION_BACKEND()
 
@@ -5048,8 +4888,7 @@
   UnboxInt32Instr(TruncationMode truncation_mode,
                   Value* value,
                   intptr_t deopt_id)
-      : UnboxInteger32Instr(kUnboxedInt32, truncation_mode, value, deopt_id) {
-  }
+      : UnboxInteger32Instr(kUnboxedInt32, truncation_mode, value, deopt_id) {}
 
   virtual bool CanDeoptimize() const;
 
@@ -5067,8 +4906,7 @@
 class UnboxInt64Instr : public UnboxIntegerInstr {
  public:
   UnboxInt64Instr(Value* value, intptr_t deopt_id)
-      : UnboxIntegerInstr(kUnboxedMint, kNoTruncation, value, deopt_id) {
-  }
+      : UnboxIntegerInstr(kUnboxedMint, kNoTruncation, value, deopt_id) {}
 
   virtual void InferRange(RangeAnalysis* analysis, Range* range);
 
@@ -5080,12 +4918,8 @@
 
 
 bool Definition::IsMintDefinition() {
-  return (Type()->ToCid() == kMintCid) ||
-          IsBinaryMintOp() ||
-          IsUnaryMintOp() ||
-          IsShiftMintOp() ||
-          IsBoxInt64() ||
-          IsUnboxInt64();
+  return (Type()->ToCid() == kMintCid) || IsBinaryMintOp() || IsUnaryMintOp() ||
+         IsShiftMintOp() || IsBoxInt64() || IsUnboxInt64();
 }
 
 
@@ -5106,9 +4940,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedDouble;
-  }
+  virtual Representation representation() const { return kUnboxedDouble; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx == 0);
@@ -5150,13 +4982,12 @@
 class CaseInsensitiveCompareUC16Instr
     : public TemplateDefinition<4, NoThrow, Pure> {
  public:
-  CaseInsensitiveCompareUC16Instr(
-      Value* str,
-      Value* lhs_index,
-      Value* rhs_index,
-      Value* length,
-      intptr_t cid)
-    : cid_(cid) {
+  CaseInsensitiveCompareUC16Instr(Value* str,
+                                  Value* lhs_index,
+                                  Value* rhs_index,
+                                  Value* length,
+                                  intptr_t cid)
+      : cid_(cid) {
     ASSERT(cid == kTwoByteStringCid || cid == kExternalTwoByteStringCid);
     ASSERT(index_scale() == 2);
     SetInputAt(0, str);
@@ -5177,9 +5008,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kTagged;
-  }
+  virtual Representation representation() const { return kTagged; }
 
   DECLARE_INSTRUCTION(CaseInsensitiveCompareUC16)
   virtual CompileType ComputeType() const;
@@ -5261,9 +5090,7 @@
                       Value* right,
                       intptr_t deopt_id,
                       TokenPosition token_pos)
-      : TemplateDefinition(deopt_id),
-        op_kind_(op_kind),
-        token_pos_(token_pos) {
+      : TemplateDefinition(deopt_id), op_kind_(op_kind), token_pos_(token_pos) {
     SetInputAt(0, left);
     SetInputAt(1, right);
   }
@@ -5277,9 +5104,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedDouble;
-  }
+  virtual Representation representation() const { return kUnboxedDouble; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT((idx == 0) || (idx == 1));
@@ -5311,6 +5136,53 @@
 };
 
 
+class DoubleTestOpInstr : public TemplateComparison<1, NoThrow, Pure> {
+ public:
+  DoubleTestOpInstr(MethodRecognizer::Kind op_kind,
+                    Value* value,
+                    intptr_t deopt_id,
+                    TokenPosition token_pos)
+      : TemplateComparison(token_pos, Token::kEQ, deopt_id), op_kind_(op_kind) {
+    SetInputAt(0, value);
+  }
+
+  Value* value() const { return InputAt(0); }
+
+  MethodRecognizer::Kind op_kind() const { return op_kind_; }
+
+  virtual bool CanDeoptimize() const { return false; }
+
+  virtual Representation RequiredInputRepresentation(intptr_t idx) const {
+    ASSERT(idx == 0);
+    return kUnboxedDouble;
+  }
+
+  PRINT_OPERANDS_TO_SUPPORT
+
+  DECLARE_INSTRUCTION(DoubleTestOp)
+  virtual CompileType ComputeType() const;
+
+  virtual Definition* Canonicalize(FlowGraph* flow_graph);
+
+  virtual bool AttributesEqual(Instruction* other) const {
+    return op_kind_ == other->AsDoubleTestOp()->op_kind() &&
+           ComparisonInstr::AttributesEqual(other);
+  }
+
+  virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right);
+
+  virtual void EmitBranchCode(FlowGraphCompiler* compiler, BranchInstr* branch);
+
+  virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler,
+                                       BranchLabels labels);
+
+ private:
+  const MethodRecognizer::Kind op_kind_;
+
+  DISALLOW_COPY_AND_ASSIGN(DoubleTestOpInstr);
+};
+
+
 class BinaryFloat32x4OpInstr : public TemplateDefinition<2, NoThrow, Pure> {
  public:
   BinaryFloat32x4OpInstr(Token::Kind op_kind,
@@ -5329,9 +5201,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedFloat32x4;
-  }
+  virtual Representation representation() const { return kUnboxedFloat32x4; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT((idx == 0) || (idx == 1));
@@ -5362,7 +5232,8 @@
 
 class Simd32x4ShuffleInstr : public TemplateDefinition<1, NoThrow, Pure> {
  public:
-  Simd32x4ShuffleInstr(MethodRecognizer::Kind op_kind, Value* value,
+  Simd32x4ShuffleInstr(MethodRecognizer::Kind op_kind,
+                       Value* value,
                        intptr_t mask,
                        intptr_t deopt_id)
       : TemplateDefinition(deopt_id), op_kind_(op_kind), mask_(mask) {
@@ -5430,8 +5301,11 @@
 
 class Simd32x4ShuffleMixInstr : public TemplateDefinition<2, NoThrow, Pure> {
  public:
-  Simd32x4ShuffleMixInstr(MethodRecognizer::Kind op_kind, Value* xy,
-                           Value* zw, intptr_t mask, intptr_t deopt_id)
+  Simd32x4ShuffleMixInstr(MethodRecognizer::Kind op_kind,
+                          Value* xy,
+                          Value* zw,
+                          intptr_t mask,
+                          intptr_t deopt_id)
       : TemplateDefinition(deopt_id), op_kind_(op_kind), mask_(mask) {
     SetInputAt(0, xy);
     SetInputAt(1, zw);
@@ -5508,9 +5382,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedFloat32x4;
-  }
+  virtual Representation representation() const { return kUnboxedFloat32x4; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx >= 0 && idx < 4);
@@ -5546,9 +5418,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedFloat32x4;
-  }
+  virtual Representation representation() const { return kUnboxedFloat32x4; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx == 0);
@@ -5576,13 +5446,11 @@
 // TODO(vegorov) replace with UnboxedConstantInstr.
 class Float32x4ZeroInstr : public TemplateDefinition<0, NoThrow, Pure> {
  public:
-  Float32x4ZeroInstr() { }
+  Float32x4ZeroInstr() {}
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedFloat32x4;
-  }
+  virtual Representation representation() const { return kUnboxedFloat32x4; }
 
   DECLARE_INSTRUCTION(Float32x4Zero)
   virtual CompileType ComputeType() const;
@@ -5612,9 +5480,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedInt32x4;
-  }
+  virtual Representation representation() const { return kUnboxedInt32x4; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT((idx == 0) || (idx == 1));
@@ -5661,9 +5527,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedFloat32x4;
-  }
+  virtual Representation representation() const { return kUnboxedFloat32x4; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT((idx == 0) || (idx == 1));
@@ -5710,9 +5574,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedFloat32x4;
-  }
+  virtual Representation representation() const { return kUnboxedFloat32x4; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT((idx == 0) || (idx == 1));
@@ -5759,9 +5621,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedFloat32x4;
-  }
+  virtual Representation representation() const { return kUnboxedFloat32x4; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx == 0);
@@ -5796,8 +5656,7 @@
   Float32x4ZeroArgInstr(MethodRecognizer::Kind op_kind,
                         Value* left,
                         intptr_t deopt_id)
-      : TemplateDefinition(deopt_id),
-        op_kind_(op_kind) {
+      : TemplateDefinition(deopt_id), op_kind_(op_kind) {
     SetInputAt(0, left);
   }
 
@@ -5807,9 +5666,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedFloat32x4;
-  }
+  virtual Representation representation() const { return kUnboxedFloat32x4; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx == 0);
@@ -5856,9 +5713,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedFloat32x4;
-  }
+  virtual Representation representation() const { return kUnboxedFloat32x4; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT((idx == 0) || (idx == 1) || (idx == 2));
@@ -5889,8 +5744,7 @@
                      Value* left,
                      Value* replacement,
                      intptr_t deopt_id)
-      : TemplateDefinition(deopt_id),
-        op_kind_(op_kind) {
+      : TemplateDefinition(deopt_id), op_kind_(op_kind) {
     SetInputAt(0, replacement);
     SetInputAt(1, left);
   }
@@ -5902,9 +5756,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedFloat32x4;
-  }
+  virtual Representation representation() const { return kUnboxedFloat32x4; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT((idx == 0) || (idx == 1));
@@ -6008,9 +5860,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedInt32x4;
-  }
+  virtual Representation representation() const { return kUnboxedInt32x4; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx == 0);
@@ -6046,9 +5896,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedFloat64x2;
-  }
+  virtual Representation representation() const { return kUnboxedFloat64x2; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx == 0);
@@ -6084,9 +5932,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedFloat32x4;
-  }
+  virtual Representation representation() const { return kUnboxedFloat32x4; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx == 0);
@@ -6124,9 +5970,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedFloat64x2;
-  }
+  virtual Representation representation() const { return kUnboxedFloat64x2; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx >= 0 && idx < 2);
@@ -6162,9 +6006,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedFloat64x2;
-  }
+  virtual Representation representation() const { return kUnboxedFloat64x2; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx == 0);
@@ -6191,13 +6033,11 @@
 
 class Float64x2ZeroInstr : public TemplateDefinition<0, NoThrow, Pure> {
  public:
-  Float64x2ZeroInstr() { }
+  Float64x2ZeroInstr() {}
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedFloat64x2;
-  }
+  virtual Representation representation() const { return kUnboxedFloat64x2; }
 
   DECLARE_INSTRUCTION(Float64x2Zero)
   virtual CompileType ComputeType() const;
@@ -6278,9 +6118,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedFloat64x2;
-  }
+  virtual Representation representation() const { return kUnboxedFloat64x2; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     if (idx == 0) {
@@ -6338,9 +6176,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedInt32x4;
-  }
+  virtual Representation representation() const { return kUnboxedInt32x4; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT((idx >= 0) && (idx < 4));
@@ -6387,9 +6223,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedInt32x4;
-  }
+  virtual Representation representation() const { return kUnboxedInt32x4; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT((idx >= 0) && (idx < 4));
@@ -6429,9 +6263,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-      return kTagged;
-  }
+  virtual Representation representation() const { return kTagged; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx == 0);
@@ -6475,9 +6307,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kTagged;
-  }
+  virtual Representation representation() const { return kTagged; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx == 0);
@@ -6528,9 +6358,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-      return kUnboxedFloat32x4;
-  }
+  virtual Representation representation() const { return kUnboxedFloat32x4; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT((idx == 0) || (idx == 1) || (idx == 2));
@@ -6576,9 +6404,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-      return kUnboxedInt32x4;
-  }
+  virtual Representation representation() const { return kUnboxedInt32x4; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT((idx == 0) || (idx == 1));
@@ -6621,9 +6447,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedFloat32x4;
-  }
+  virtual Representation representation() const { return kUnboxedFloat32x4; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx == 0);
@@ -6651,9 +6475,9 @@
 class BinaryInt32x4OpInstr : public TemplateDefinition<2, NoThrow, Pure> {
  public:
   BinaryInt32x4OpInstr(Token::Kind op_kind,
-                        Value* left,
-                        Value* right,
-                        intptr_t deopt_id)
+                       Value* left,
+                       Value* right,
+                       intptr_t deopt_id)
       : TemplateDefinition(deopt_id), op_kind_(op_kind) {
     SetInputAt(0, left);
     SetInputAt(1, right);
@@ -6666,9 +6490,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedInt32x4;
-  }
+  virtual Representation representation() const { return kUnboxedInt32x4; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT((idx == 0) || (idx == 1));
@@ -6715,9 +6537,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedFloat64x2;
-  }
+  virtual Representation representation() const { return kUnboxedFloat64x2; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT((idx == 0) || (idx == 1));
@@ -6748,12 +6568,9 @@
 
 class UnaryIntegerOpInstr : public TemplateDefinition<1, NoThrow, Pure> {
  public:
-  UnaryIntegerOpInstr(Token::Kind op_kind,
-                      Value* value,
-                      intptr_t deopt_id)
+  UnaryIntegerOpInstr(Token::Kind op_kind, Value* value, intptr_t deopt_id)
       : TemplateDefinition(deopt_id), op_kind_(op_kind) {
-    ASSERT((op_kind == Token::kNEGATE) ||
-           (op_kind == Token::kBIT_NOT));
+    ASSERT((op_kind == Token::kNEGATE) || (op_kind == Token::kBIT_NOT));
     SetInputAt(0, value);
   }
 
@@ -6790,9 +6607,7 @@
 // Handles both Smi operations: BIT_OR and NEGATE.
 class UnarySmiOpInstr : public UnaryIntegerOpInstr {
  public:
-  UnarySmiOpInstr(Token::Kind op_kind,
-                  Value* value,
-                  intptr_t deopt_id)
+  UnarySmiOpInstr(Token::Kind op_kind, Value* value, intptr_t deopt_id)
       : UnaryIntegerOpInstr(op_kind, value, deopt_id) {}
 
   virtual bool CanDeoptimize() const { return op_kind() == Token::kNEGATE; }
@@ -6808,9 +6623,7 @@
 
 class UnaryUint32OpInstr : public UnaryIntegerOpInstr {
  public:
-  UnaryUint32OpInstr(Token::Kind op_kind,
-                     Value* value,
-                     intptr_t deopt_id)
+  UnaryUint32OpInstr(Token::Kind op_kind, Value* value, intptr_t deopt_id)
       : UnaryIntegerOpInstr(op_kind, value, deopt_id) {
     ASSERT(op_kind == Token::kBIT_NOT);
   }
@@ -6819,9 +6632,7 @@
 
   virtual CompileType ComputeType() const;
 
-  virtual Representation representation() const {
-    return kUnboxedUint32;
-  }
+  virtual Representation representation() const { return kUnboxedUint32; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx == 0);
@@ -6842,15 +6653,11 @@
     ASSERT(op_kind == Token::kBIT_NOT);
   }
 
-  virtual bool CanDeoptimize() const {
-    return false;
-  }
+  virtual bool CanDeoptimize() const { return false; }
 
   virtual CompileType ComputeType() const;
 
-  virtual Representation representation() const {
-    return kUnboxedMint;
-  }
+  virtual Representation representation() const { return kUnboxedMint; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx == 0);
@@ -6870,9 +6677,7 @@
                     Value* left,
                     Value* right,
                     InstanceCallInstr* call)
-      : TemplateDefinition(call->deopt_id()),
-        call_(call),
-        op_kind_(op_kind) {
+      : TemplateDefinition(call->deopt_id()), call_(call), op_kind_(op_kind) {
     SetInputAt(0, left);
     SetInputAt(1, right);
   }
@@ -6882,7 +6687,7 @@
   Value* left() const { return inputs_[0]; }
   Value* right() const { return inputs_[1]; }
 
-  virtual bool CanDeoptimize() const { return true; }
+  virtual bool CanDeoptimize() const { return false; }
 
   virtual EffectSet Effects() const { return EffectSet::All(); }
 
@@ -6899,6 +6704,52 @@
 };
 
 
+class CheckedSmiComparisonInstr : public TemplateComparison<2, Throws> {
+ public:
+  CheckedSmiComparisonInstr(Token::Kind op_kind,
+                            Value* left,
+                            Value* right,
+                            InstanceCallInstr* call)
+      : TemplateComparison(call->token_pos(), op_kind, call->deopt_id()),
+        call_(call),
+        is_negated_(false) {
+    SetInputAt(0, left);
+    SetInputAt(1, right);
+  }
+
+  InstanceCallInstr* call() const { return call_; }
+
+  virtual bool CanDeoptimize() const { return false; }
+
+  virtual Definition* Canonicalize(FlowGraph* flow_graph);
+
+  virtual void NegateComparison() {
+    ComparisonInstr::NegateComparison();
+    is_negated_ = !is_negated_;
+  }
+
+  bool is_negated() const { return is_negated_; }
+
+  virtual EffectSet Effects() const { return EffectSet::All(); }
+
+  PRINT_OPERANDS_TO_SUPPORT
+
+  DECLARE_INSTRUCTION(CheckedSmiComparison)
+
+  virtual void EmitBranchCode(FlowGraphCompiler* compiler, BranchInstr* branch);
+
+  virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler,
+                                       BranchLabels labels);
+
+  virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right);
+
+ private:
+  InstanceCallInstr* call_;
+  bool is_negated_;
+  DISALLOW_COPY_AND_ASSIGN(CheckedSmiComparisonInstr);
+};
+
+
 class BinaryIntegerOpInstr : public TemplateDefinition<2, NoThrow, Pure> {
  public:
   BinaryIntegerOpInstr(Token::Kind op_kind,
@@ -6996,8 +6847,7 @@
                    Value* left,
                    Value* right,
                    intptr_t deopt_id)
-      : BinaryIntegerOpInstr(op_kind, left, right, deopt_id) {
-  }
+      : BinaryIntegerOpInstr(op_kind, left, right, deopt_id) {}
 
   virtual bool CanDeoptimize() const;
 
@@ -7047,9 +6897,7 @@
 
   virtual bool CanDeoptimize() const;
 
-  virtual Representation representation() const {
-    return kUnboxedInt32;
-  }
+  virtual Representation representation() const { return kUnboxedInt32; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT((idx == 0) || (idx == 1));
@@ -7076,13 +6924,9 @@
     mark_truncating();
   }
 
-  virtual bool CanDeoptimize() const {
-    return false;
-  }
+  virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedUint32;
-  }
+  virtual Representation representation() const { return kUnboxedUint32; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT((idx == 0) || (idx == 1));
@@ -7110,9 +6954,7 @@
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual Representation representation() const {
-    return kUnboxedUint32;
-  }
+  virtual Representation representation() const { return kUnboxedUint32; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT((idx == 0) || (idx == 1));
@@ -7134,18 +6976,15 @@
                     Value* left,
                     Value* right,
                     intptr_t deopt_id)
-      : BinaryIntegerOpInstr(op_kind, left, right, deopt_id) {
-  }
+      : BinaryIntegerOpInstr(op_kind, left, right, deopt_id) {}
 
   virtual bool CanDeoptimize() const {
-    return (can_overflow() && ((op_kind() == Token::kADD) ||
-                               (op_kind() == Token::kSUB)))
-        || (op_kind() == Token::kMUL);  // Deopt if inputs are not int32.
+    return (can_overflow() &&
+            ((op_kind() == Token::kADD) || (op_kind() == Token::kSUB))) ||
+           (op_kind() == Token::kMUL);  // Deopt if inputs are not int32.
   }
 
-  virtual Representation representation() const {
-    return kUnboxedMint;
-  }
+  virtual Representation representation() const { return kUnboxedMint; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT((idx == 0) || (idx == 1));
@@ -7173,13 +7012,11 @@
   }
 
   virtual bool CanDeoptimize() const {
-    return  has_shift_count_check()
-        || (can_overflow() && (op_kind() == Token::kSHL));
+    return has_shift_count_check() ||
+           (can_overflow() && (op_kind() == Token::kSHL));
   }
 
-  virtual Representation representation() const {
-    return kUnboxedMint;
-  }
+  virtual Representation representation() const { return kUnboxedMint; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT((idx == 0) || (idx == 1));
@@ -7201,9 +7038,7 @@
 // Handles only NEGATE.
 class UnaryDoubleOpInstr : public TemplateDefinition<1, NoThrow, Pure> {
  public:
-  UnaryDoubleOpInstr(Token::Kind op_kind,
-                     Value* value,
-                     intptr_t deopt_id)
+  UnaryDoubleOpInstr(Token::Kind op_kind, Value* value, intptr_t deopt_id)
       : TemplateDefinition(deopt_id), op_kind_(op_kind) {
     ASSERT(op_kind == Token::kNEGATE);
     SetInputAt(0, value);
@@ -7223,9 +7058,7 @@
     return GetDeoptId();
   }
 
-  virtual Representation representation() const {
-    return kUnboxedDouble;
-  }
+  virtual Representation representation() const { return kUnboxedDouble; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx == 0);
@@ -7248,8 +7081,7 @@
   CheckStackOverflowInstr(TokenPosition token_pos, intptr_t loop_depth)
       : TemplateInstruction(Thread::Current()->GetNextDeoptId()),
         token_pos_(token_pos),
-        loop_depth_(loop_depth) {
-  }
+        loop_depth_(loop_depth) {}
 
   virtual TokenPosition token_pos() const { return token_pos_; }
   bool in_loop() const { return loop_depth_ > 0; }
@@ -7285,9 +7117,7 @@
   DECLARE_INSTRUCTION(SmiToDouble)
   virtual CompileType ComputeType() const;
 
-  virtual Representation representation() const {
-    return kUnboxedDouble;
-  }
+  virtual Representation representation() const { return kUnboxedDouble; }
 
   virtual bool CanDeoptimize() const { return false; }
 
@@ -7302,9 +7132,7 @@
 
 class Int32ToDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> {
  public:
-  explicit Int32ToDoubleInstr(Value* value) {
-    SetInputAt(0, value);
-  }
+  explicit Int32ToDoubleInstr(Value* value) { SetInputAt(0, value); }
 
   Value* value() const { return inputs_[0]; }
 
@@ -7316,9 +7144,7 @@
     return kUnboxedInt32;
   }
 
-  virtual Representation representation() const {
-    return kUnboxedDouble;
-  }
+  virtual Representation representation() const { return kUnboxedDouble; }
 
   virtual bool CanDeoptimize() const { return false; }
 
@@ -7346,9 +7172,7 @@
     return kUnboxedMint;
   }
 
-  virtual Representation representation() const {
-    return kUnboxedDouble;
-  }
+  virtual Representation representation() const { return kUnboxedDouble; }
 
   virtual intptr_t DeoptimizationTarget() const {
     // Direct access since this instruction cannot deoptimize, and the deopt-id
@@ -7426,8 +7250,7 @@
   DoubleToDoubleInstr(Value* value,
                       MethodRecognizer::Kind recognized_kind,
                       intptr_t deopt_id)
-    : TemplateDefinition(deopt_id),
-      recognized_kind_(recognized_kind) {
+      : TemplateDefinition(deopt_id), recognized_kind_(recognized_kind) {
     SetInputAt(0, value);
   }
 
@@ -7440,9 +7263,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedDouble;
-  }
+  virtual Representation representation() const { return kUnboxedDouble; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx == 0);
@@ -7462,7 +7283,7 @@
 };
 
 
-class DoubleToFloatInstr: public TemplateDefinition<1, NoThrow, Pure> {
+class DoubleToFloatInstr : public TemplateDefinition<1, NoThrow, Pure> {
  public:
   DoubleToFloatInstr(Value* value, intptr_t deopt_id)
       : TemplateDefinition(deopt_id) {
@@ -7501,7 +7322,7 @@
 };
 
 
-class FloatToDoubleInstr: public TemplateDefinition<1, NoThrow, Pure> {
+class FloatToDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> {
  public:
   FloatToDoubleInstr(Value* value, intptr_t deopt_id)
       : TemplateDefinition(deopt_id) {
@@ -7516,9 +7337,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedDouble;
-  }
+  virtual Representation representation() const { return kUnboxedDouble; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx == 0);
@@ -7556,9 +7375,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual Representation representation() const {
-    return kUnboxedDouble;
-  }
+  virtual Representation representation() const { return kUnboxedDouble; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT((0 <= idx) && (idx < InputCount()));
@@ -7567,13 +7384,9 @@
 
   virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); }
 
-  virtual intptr_t InputCount() const {
-    return inputs_->length();
-  }
+  virtual intptr_t InputCount() const { return inputs_->length(); }
 
-  virtual Value* InputAt(intptr_t i) const {
-    return (*inputs_)[i];
-  }
+  virtual Value* InputAt(intptr_t i) const { return (*inputs_)[i]; }
 
   virtual bool AttributesEqual(Instruction* other) const {
     InvokeMathCFunctionInstr* other_invoke = other->AsInvokeMathCFunction();
@@ -7623,9 +7436,7 @@
 
   intptr_t index() const { return index_; }
 
-  virtual Representation representation() const {
-    return definition_rep_;
-  }
+  virtual Representation representation() const { return definition_rep_; }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx == 0);
@@ -7680,9 +7491,7 @@
 
   virtual intptr_t InputCount() const { return inputs_->length(); }
 
-  virtual Value* InputAt(intptr_t i) const {
-    return (*inputs_)[i];
-  }
+  virtual Value* InputAt(intptr_t i) const { return (*inputs_)[i]; }
 
   static intptr_t OutputIndexOf(MethodRecognizer::Kind kind);
   static intptr_t OutputIndexOf(Token::Kind token);
@@ -7774,9 +7583,7 @@
 
   virtual Instruction* Canonicalize(FlowGraph* flow_graph);
 
-  bool IsNullCheck() const {
-    return  DeoptIfNull() || DeoptIfNotNull();
-  }
+  bool IsNullCheck() const { return DeoptIfNull() || DeoptIfNotNull(); }
 
   bool DeoptIfNull() const;
   bool DeoptIfNotNull() const;
@@ -7887,9 +7694,7 @@
 
   bool IsRedundant(const RangeBoundary& length);
 
-  void mark_generalized() {
-    generalized_ = true;
-  }
+  void mark_generalized() { generalized_ = true; }
 
   virtual Instruction* Canonicalize(FlowGraph* flow_graph);
 
@@ -7903,10 +7708,7 @@
   void set_licm_hoisted(bool value) { licm_hoisted_ = value; }
 
   // Give a name to the location/input indices.
-  enum {
-    kLengthPos = 0,
-    kIndexPos = 1
-  };
+  enum { kLengthPos = 0, kIndexPos = 1 };
 
  private:
   bool generalized_;
@@ -7935,10 +7737,7 @@
   virtual bool CanDeoptimize() const { return true; }
 
   // Give a name to the location/input indices.
-  enum {
-    kLengthPos = 0,
-    kIndexPos = 1
-  };
+  enum { kLengthPos = 0, kIndexPos = 1 };
 
  private:
   DISALLOW_COPY_AND_ASSIGN(GenericCheckBoundInstr);
@@ -7956,11 +7755,9 @@
         to_representation_(to),
         is_truncating_(to == kUnboxedUint32) {
     ASSERT(from != to);
-    ASSERT((from == kUnboxedMint) ||
-           (from == kUnboxedUint32) ||
+    ASSERT((from == kUnboxedMint) || (from == kUnboxedUint32) ||
            (from == kUnboxedInt32));
-    ASSERT((to == kUnboxedMint) ||
-           (to == kUnboxedUint32) ||
+    ASSERT((to == kUnboxedMint) || (to == kUnboxedUint32) ||
            (to == kUnboxedInt32));
     SetInputAt(0, value);
   }
@@ -7977,9 +7774,7 @@
 
   virtual bool CanDeoptimize() const;
 
-  virtual Representation representation() const {
-    return to();
-  }
+  virtual Representation representation() const { return to(); }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx == 0);
@@ -7991,9 +7786,8 @@
   virtual bool AttributesEqual(Instruction* other) const {
     ASSERT(other->IsUnboxedIntConverter());
     UnboxedIntConverterInstr* converter = other->AsUnboxedIntConverter();
-    return (converter->from() == from()) &&
-        (converter->to() == to()) &&
-        (converter->is_truncating() == is_truncating());
+    return (converter->from() == from()) && (converter->to() == to()) &&
+           (converter->is_truncating() == is_truncating());
   }
 
   virtual void InferRange(RangeAnalysis* analysis, Range* range);
@@ -8042,12 +7836,12 @@
   class ShallowIterator : public ValueObject {
    public:
     explicit ShallowIterator(Environment* environment)
-        : environment_(environment), index_(0) { }
+        : environment_(environment), index_(0) {}
 
     ShallowIterator(const ShallowIterator& other)
         : ValueObject(),
           environment_(other.environment_),
-          index_(other.index_) { }
+          index_(other.index_) {}
 
     ShallowIterator& operator=(const ShallowIterator& other) {
       environment_ = other.environment_;
@@ -8157,17 +7951,14 @@
 
   Environment* Outermost() {
     Environment* result = this;
-    while (result->outer() != NULL) result = result->outer();
+    while (result->outer() != NULL)
+      result = result->outer();
     return result;
   }
 
-  Value* ValueAt(intptr_t ix) const {
-    return values_[ix];
-  }
+  Value* ValueAt(intptr_t ix) const { return values_[ix]; }
 
-  intptr_t Length() const {
-    return values_.length();
-  }
+  intptr_t Length() const { return values_.length(); }
 
   Location LocationAt(intptr_t index) const {
     ASSERT((index >= 0) && (index < values_.length()));
@@ -8185,9 +7976,7 @@
     return env->ValueAt(index);
   }
 
-  intptr_t fixed_parameter_count() const {
-    return fixed_parameter_count_;
-  }
+  intptr_t fixed_parameter_count() const { return fixed_parameter_count_; }
 
   intptr_t CountArgsPushed() {
     intptr_t count = 0;
@@ -8201,9 +7990,7 @@
 
   const Function& function() const { return parsed_function_.function(); }
 
-  Environment* DeepCopy(Zone* zone) const {
-    return DeepCopy(zone, Length());
-  }
+  Environment* DeepCopy(Zone* zone) const { return DeepCopy(zone, Length()); }
 
   void DeepCopyTo(Zone* zone, Instruction* instr) const;
   void DeepCopyToOuter(Zone* zone, Instruction* instr) const;
@@ -8246,8 +8033,7 @@
         fixed_parameter_count_(fixed_parameter_count),
         deopt_id_(deopt_id),
         parsed_function_(parsed_function),
-        outer_(outer) {
-  }
+        outer_(outer) {}
 
 
   GrowableArray<Value*> values_;
@@ -8266,8 +8052,8 @@
 class FlowGraphVisitor : public ValueObject {
  public:
   explicit FlowGraphVisitor(const GrowableArray<BlockEntryInstr*>& block_order)
-      : current_iterator_(NULL), block_order_(block_order) { }
-  virtual ~FlowGraphVisitor() { }
+      : current_iterator_(NULL), block_order_(block_order) {}
+  virtual ~FlowGraphVisitor() {}
 
   ForwardInstructionIterator* current_iterator() const {
     return current_iterator_;
@@ -8277,10 +8063,10 @@
   // instructions in order from the block entry to exit.
   virtual void VisitBlocks();
 
-  // Visit functions for instruction classes, with an empty default
-  // implementation.
+// Visit functions for instruction classes, with an empty default
+// implementation.
 #define DECLARE_VISIT_INSTRUCTION(ShortName)                                   \
-  virtual void Visit##ShortName(ShortName##Instr* instr) { }
+  virtual void Visit##ShortName(ShortName##Instr* instr) {}
 
   FOR_EACH_INSTRUCTION(DECLARE_VISIT_INSTRUCTION)
 
@@ -8296,14 +8082,14 @@
 
 
 // Helper macros for platform ports.
-#define DEFINE_UNIMPLEMENTED_INSTRUCTION(Name)                                \
-  LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const {    \
-    UNIMPLEMENTED();                                                          \
-    return NULL;                                                              \
-  }                                                                           \
+#define DEFINE_UNIMPLEMENTED_INSTRUCTION(Name)                                 \
+  LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const {     \
+    UNIMPLEMENTED();                                                           \
+    return NULL;                                                               \
+  }                                                                            \
   void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); }
 
 
 }  // namespace dart
 
-#endif  // VM_INTERMEDIATE_LANGUAGE_H_
+#endif  // RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_
diff --git a/runtime/vm/intermediate_language_arm.cc b/runtime/vm/intermediate_language_arm.cc
index 9827a4d..395b59a 100644
--- a/runtime/vm/intermediate_language_arm.cc
+++ b/runtime/vm/intermediate_language_arm.cc
@@ -1,3 +1,4 @@
+
 // 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.
@@ -30,8 +31,8 @@
 // Generic summary for call instructions that have all arguments pushed
 // on the stack and return the result in a fixed register R0.
 LocationSummary* Instruction::MakeCallSummary(Zone* zone) {
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, 0, 0, LocationSummary::kCall);
+  LocationSummary* result =
+      new (zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
   result->set_out(0, Location::RegisterLocation(R0));
   return result;
 }
@@ -41,8 +42,8 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::AnyOrConstant(value()));
   return locs;
 }
@@ -67,12 +68,11 @@
 }
 
 
-LocationSummary* ReturnInstr::MakeLocationSummary(Zone* zone,
-                                                  bool opt) const {
+LocationSummary* ReturnInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RegisterLocation(R0));
   return locs;
 }
@@ -114,16 +114,30 @@
 
 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;
+    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;
+    case VC:
+      return VS;
+    case VS:
+      return VC;
     default:
       UNREACHABLE();
       return EQ;
@@ -156,7 +170,7 @@
   __ eor(result, result, Operand(result));
 
   // Emit comparison code. This must not overwrite the result register.
-  BranchLabels labels = { NULL, NULL, NULL };
+  BranchLabels labels = {NULL, NULL, NULL};
   Condition true_condition = comparison()->EmitComparisonCode(compiler, labels);
 
   const bool is_power_of_two_kind = IsPowerOfTwoKind(if_true_, if_false_);
@@ -188,8 +202,7 @@
     __ Lsl(result, result, Operand(shift + kSmiTagSize));
   } else {
     __ sub(result, result, Operand(1));
-    const int32_t val =
-        Smi::RawValue(true_value) - Smi::RawValue(false_value);
+    const int32_t val = Smi::RawValue(true_value) - Smi::RawValue(false_value);
     __ AndImmediate(result, result, val);
     if (false_value != 0) {
       __ AddImmediate(result, Smi::RawValue(false_value));
@@ -202,8 +215,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(R0));  // Function.
   summary->set_out(0, Location::RegisterLocation(R0));
   return summary;
@@ -213,9 +226,8 @@
 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   // Load arguments descriptor in R4.
   int argument_count = ArgumentCount();
-  const Array& arguments_descriptor =
-      Array::ZoneHandle(ArgumentsDescriptor::New(argument_count,
-                                                 argument_names()));
+  const Array& arguments_descriptor = Array::ZoneHandle(
+      ArgumentsDescriptor::New(argument_count, argument_names()));
   __ LoadObject(R4, arguments_descriptor);
 
   // R4: Arguments descriptor.
@@ -238,8 +250,7 @@
   // Add deoptimization continuation point after the call and before the
   // arguments are removed.
   // In optimized code this descriptor is needed for exception handling.
-  compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                                 deopt_id_after,
+  compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after,
                                  token_pos());
   __ Drop(argument_count);
 }
@@ -247,9 +258,7 @@
 
 LocationSummary* LoadLocalInstr::MakeLocationSummary(Zone* zone,
                                                      bool opt) const {
-  return LocationSummary::Make(zone,
-                               0,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, 0, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -262,9 +271,7 @@
 
 LocationSummary* StoreLocalInstr::MakeLocationSummary(Zone* zone,
                                                       bool opt) const {
-  return LocationSummary::Make(zone,
-                               1,
-                               Location::SameAsFirstInput(),
+  return LocationSummary::Make(zone, 1, Location::SameAsFirstInput(),
                                LocationSummary::kNoCall);
 }
 
@@ -279,9 +286,7 @@
 
 LocationSummary* ConstantInstr::MakeLocationSummary(Zone* zone,
                                                     bool opt) const {
-  return LocationSummary::Make(zone,
-                               0,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, 0, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -299,8 +304,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = (representation_ == kUnboxedInt32) ? 0 : 1;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   if (representation_ == kUnboxedInt32) {
     locs->set_out(0, Location::RequiresRegister());
   } else {
@@ -344,8 +349,8 @@
                                                             bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(R0));  // Value.
   summary->set_in(1, Location::RegisterLocation(R1));  // Type arguments.
   summary->set_out(0, Location::RegisterLocation(R0));
@@ -357,8 +362,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(R0));
   locs->set_out(0, Location::RegisterLocation(R0));
   return locs;
@@ -387,11 +392,8 @@
   }
 
   __ Push(reg);  // Push the source object.
-  compiler->GenerateRuntimeCall(token_pos,
-                                deopt_id,
-                                kNonBoolTypeErrorRuntimeEntry,
-                                1,
-                                locs);
+  compiler->GenerateRuntimeCall(token_pos, deopt_id,
+                                kNonBoolTypeErrorRuntimeEntry, 1, locs);
   // We should never return here.
   __ bkpt(0);
   __ Bind(&done);
@@ -409,12 +411,18 @@
 
 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;
+    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;
@@ -427,8 +435,8 @@
   const intptr_t kNumInputs = 2;
   if (operation_cid() == kMintCid) {
     const intptr_t kNumTemps = 0;
-    LocationSummary* locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* locs = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     locs->set_in(0, Location::Pair(Location::RequiresRegister(),
                                    Location::RequiresRegister()));
     locs->set_in(1, Location::Pair(Location::RequiresRegister(),
@@ -438,8 +446,8 @@
   }
   if (operation_cid() == kDoubleCid) {
     const intptr_t kNumTemps = 0;
-    LocationSummary* locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* locs = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     locs->set_in(0, Location::RequiresFpuRegister());
     locs->set_in(1, Location::RequiresFpuRegister());
     locs->set_out(0, Location::RequiresRegister());
@@ -447,8 +455,8 @@
   }
   if (operation_cid() == kSmiCid) {
     const intptr_t kNumTemps = 0;
-    LocationSummary* locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* locs = new (zone)
+        LocationSummary(zone, 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.
@@ -482,16 +490,26 @@
 
 static Condition FlipCondition(Condition condition) {
   switch (condition) {
-    case EQ: return EQ;
-    case NE: return NE;
-    case LT: return GT;
-    case LE: return GE;
-    case GT: return LT;
-    case GE: return LE;
-    case CC: return HI;
-    case LS: return CS;
-    case HI: return CC;
-    case CS: return LS;
+    case EQ:
+      return EQ;
+    case NE:
+      return NE;
+    case LT:
+      return GT;
+    case LE:
+      return GE;
+    case GT:
+      return LT;
+    case GE:
+      return LE;
+    case CC:
+      return HI;
+    case LS:
+      return CS;
+    case HI:
+      return CC;
+    case CS:
+      return LS;
     default:
       UNREACHABLE();
       return EQ;
@@ -541,12 +559,18 @@
 
 static Condition TokenKindToMintCondition(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;
+    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;
@@ -620,12 +644,18 @@
 
 static Condition TokenKindToDoubleCondition(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;
+    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;
@@ -664,7 +694,7 @@
   ASSERT((kind() == Token::kNE) || (kind() == Token::kEQ));
 
   // The ARM code does not use true- and false-labels here.
-  BranchLabels labels = { NULL, NULL, NULL };
+  BranchLabels labels = {NULL, NULL, NULL};
   Condition true_condition = EmitComparisonCode(compiler, labels);
 
   const Register result = locs()->out(0).reg();
@@ -692,20 +722,19 @@
   Condition true_condition = EmitComparisonCode(compiler, labels);
 
   if (operation_cid() == kDoubleCid) {
-    Label* nan_result = (true_condition == NE) ?
-        labels.true_label : labels.false_label;
+    Label* nan_result =
+        (true_condition == NE) ? labels.true_label : labels.false_label;
     __ b(nan_result, VS);
   }
   EmitBranchOnCondition(compiler, true_condition, labels);
 }
 
 
-LocationSummary* TestSmiInstr::MakeLocationSummary(Zone* zone,
-                                                   bool opt) const {
+LocationSummary* TestSmiInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RequiresRegister());
   // Only one input can be a constant operand. The case of two constant
   // operands should be handled by constant propagation.
@@ -720,8 +749,7 @@
   Location right = locs()->in(1);
   if (right.IsConstant()) {
     ASSERT(right.constant().IsSmi());
-    const int32_t imm =
-        reinterpret_cast<int32_t>(right.constant().raw());
+    const int32_t imm = reinterpret_cast<int32_t>(right.constant().raw());
     __ TestImmediate(left, imm);
   } else {
     __ tst(left, Operand(right.reg()));
@@ -749,8 +777,8 @@
                                                     bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RequiresRegister());
   locs->set_temp(0, Location::RequiresRegister());
   locs->set_out(0, Location::RequiresRegister());
@@ -764,11 +792,11 @@
   const Register val_reg = locs()->in(0).reg();
   const Register cid_reg = locs()->temp(0).reg();
 
-  Label* deopt = CanDeoptimize()
-      ? compiler->AddDeoptStub(deopt_id(),
-                               ICData::kDeoptTestCids,
-                               licm_hoisted_ ? ICData::kHoisted : 0)
-      : NULL;
+  Label* deopt =
+      CanDeoptimize()
+          ? compiler->AddDeoptStub(deopt_id(), ICData::kDeoptTestCids,
+                                   licm_hoisted_ ? ICData::kHoisted : 0)
+          : NULL;
 
   const intptr_t true_result = (kind() == Token::kIS) ? 1 : 0;
   const ZoneGrowableArray<intptr_t>& data = cid_results();
@@ -810,7 +838,7 @@
 void TestCidsInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   const Register result_reg = locs()->out(0).reg();
   Label is_true, is_false, done;
-  BranchLabels labels = { &is_true, &is_false, &is_false };
+  BranchLabels labels = {&is_true, &is_false, &is_false};
   EmitComparisonCode(compiler, labels);
   __ Bind(&is_false);
   __ LoadObject(result_reg, Bool::False());
@@ -827,8 +855,8 @@
   const intptr_t kNumTemps = 0;
   if (operation_cid() == kMintCid) {
     const intptr_t kNumTemps = 0;
-    LocationSummary* locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* locs = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     locs->set_in(0, Location::Pair(Location::RequiresRegister(),
                                    Location::RequiresRegister()));
     locs->set_in(1, Location::Pair(Location::RequiresRegister(),
@@ -837,16 +865,16 @@
     return locs;
   }
   if (operation_cid() == kDoubleCid) {
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresFpuRegister());
     summary->set_in(1, Location::RequiresFpuRegister());
     summary->set_out(0, Location::RequiresRegister());
     return summary;
   }
   ASSERT(operation_cid() == kSmiCid);
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, 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.
@@ -873,7 +901,7 @@
 
 void RelationalOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Label is_true, is_false;
-  BranchLabels labels = { &is_true, &is_false, &is_false };
+  BranchLabels labels = {&is_true, &is_false, &is_false};
   Condition true_condition = EmitComparisonCode(compiler, labels);
 
   const Register result = locs()->out(0).reg();
@@ -910,8 +938,8 @@
   if ((operation_cid() == kSmiCid) || (operation_cid() == kMintCid)) {
     EmitBranchOnCondition(compiler, true_condition, labels);
   } else if (operation_cid() == kDoubleCid) {
-    Label* nan_result = (true_condition == NE) ?
-        labels.true_label : labels.false_label;
+    Label* nan_result =
+        (true_condition == NE) ? labels.true_label : labels.false_label;
     __ b(nan_result, VS);
     EmitBranchOnCondition(compiler, true_condition, labels);
   }
@@ -932,8 +960,8 @@
   __ PushObject(Object::null_object());
   // Pass a pointer to the first argument in R2.
   if (!function().HasOptionalParameters()) {
-    __ AddImmediate(R2, FP, (kParamEndSlotFromFp +
-                             function().NumParameters()) * kWordSize);
+    __ AddImmediate(
+        R2, FP, (kParamEndSlotFromFp + function().NumParameters()) * kWordSize);
   } else {
     __ AddImmediate(R2, FP, kFirstLocalSlotFromFp * kWordSize);
   }
@@ -964,21 +992,23 @@
   __ LoadImmediate(R1, argc_tag);
   ExternalLabel label(entry);
   __ LoadNativeEntry(R9, &label, link_lazily() ? kPatchable : kNotPatchable);
-  compiler->GenerateCall(token_pos(),
-                         *stub_entry,
-                         RawPcDescriptors::kOther,
-                         locs());
+  if (link_lazily()) {
+    compiler->GeneratePatchableCall(token_pos(), *stub_entry,
+                                    RawPcDescriptors::kOther, locs());
+  } else {
+    compiler->GenerateCall(token_pos(), *stub_entry, RawPcDescriptors::kOther,
+                           locs());
+  }
   __ Pop(result);
 }
 
 
 LocationSummary* OneByteStringFromCharCodeInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 1;
   // TODO(fschneider): Allow immediate operands for the char code.
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -998,9 +1028,7 @@
 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Zone* zone,
                                                             bool opt) const {
   const intptr_t kNumInputs = 1;
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -1021,8 +1049,8 @@
                                                              bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(R0));
   summary->set_out(0, Location::RegisterLocation(R0));
   return summary;
@@ -1034,12 +1062,8 @@
   __ Push(array);
   const int kNumberOfArguments = 1;
   const Array& kNoArgumentNames = Object::null_array();
-  compiler->GenerateStaticCall(deopt_id(),
-                               token_pos(),
-                               CallFunction(),
-                               kNumberOfArguments,
-                               kNoArgumentNames,
-                               locs(),
+  compiler->GenerateStaticCall(deopt_id(), token_pos(), CallFunction(),
+                               kNumberOfArguments, kNoArgumentNames, locs(),
                                ICData::Handle());
   ASSERT(locs()->out(0).reg() == R0);
 }
@@ -1048,9 +1072,7 @@
 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Zone* zone,
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -1070,9 +1092,7 @@
 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Zone* zone,
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -1208,9 +1228,9 @@
 LocationSummary* LoadIndexedInstr::MakeLocationSummary(Zone* zone,
                                                        bool opt) const {
   const intptr_t kNumInputs = 2;
-  const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  const intptr_t kNumTemps = aligned() ? 0 : 1;
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RequiresRegister());
   bool needs_base = false;
   if (CanBeImmediateIndex(index(), class_id(), IsExternal(),
@@ -1221,9 +1241,9 @@
   } else {
     locs->set_in(1, Location::RequiresRegister());
   }
-  if ((representation() == kUnboxedDouble)    ||
+  if ((representation() == kUnboxedDouble) ||
       (representation() == kUnboxedFloat32x4) ||
-      (representation() == kUnboxedInt32x4)   ||
+      (representation() == kUnboxedInt32x4) ||
       (representation() == kUnboxedFloat64x2)) {
     if (class_id() == kTypedDataFloat32ArrayCid) {
       // Need register <= Q7 for float operations.
@@ -1243,6 +1263,9 @@
     ASSERT(representation() == kTagged);
     locs->set_out(0, Location::RequiresRegister());
   }
+  if (!aligned()) {
+    locs->set_temp(0, Location::RequiresRegister());
+  }
   return locs;
 }
 
@@ -1251,21 +1274,39 @@
   // The array register points to the backing store for external arrays.
   const Register array = locs()->in(0).reg();
   const Location index = locs()->in(1);
+  const Register address = aligned() ? kNoRegister : locs()->temp(0).reg();
 
-  Address element_address = index.IsRegister()
-      ? __ ElementAddressForRegIndex(true,  // Load.
-                                     IsExternal(), class_id(), index_scale(),
-                                     array,
-                                     index.reg())
-      : __ ElementAddressForIntIndex(true,  // Load.
-                                     IsExternal(), class_id(), index_scale(),
-                                     array, Smi::Cast(index.constant()).Value(),
-                                     IP);  // Temp register.
-  // Warning: element_address may use register IP as base.
+  Address element_address(kNoRegister);
+  if (aligned()) {
+    element_address = index.IsRegister()
+                          ? __ ElementAddressForRegIndex(
+                                true,  // Load.
+                                IsExternal(), class_id(), index_scale(), array,
+                                index.reg())
+                          : __ ElementAddressForIntIndex(
+                                true,  // Load.
+                                IsExternal(), class_id(), index_scale(), array,
+                                Smi::Cast(index.constant()).Value(),
+                                IP);  // Temp register.
+    // Warning: element_address may use register IP as base.
+  } else {
+    if (index.IsRegister()) {
+      __ LoadElementAddressForRegIndex(address,
+                                       true,  // Load.
+                                       IsExternal(), class_id(), index_scale(),
+                                       array, index.reg());
+    } else {
+      __ LoadElementAddressForIntIndex(address,
+                                       true,  // Load.
+                                       IsExternal(), class_id(), index_scale(),
+                                       array,
+                                       Smi::Cast(index.constant()).Value());
+    }
+  }
 
-  if ((representation() == kUnboxedDouble)    ||
+  if ((representation() == kUnboxedDouble) ||
       (representation() == kUnboxedFloat32x4) ||
-      (representation() == kUnboxedInt32x4)   ||
+      (representation() == kUnboxedInt32x4) ||
       (representation() == kUnboxedFloat64x2)) {
     const QRegister result = locs()->out(0).fpu_reg();
     const DRegister dresult0 = EvenDRegisterOf(result);
@@ -1297,12 +1338,20 @@
     switch (class_id()) {
       case kTypedDataInt32ArrayCid:
         ASSERT(representation() == kUnboxedInt32);
-        __ ldr(result, element_address);
-      break;
+        if (aligned()) {
+          __ ldr(result, element_address);
+        } else {
+          __ LoadWordUnaligned(result, address, TMP);
+        }
+        break;
       case kTypedDataUint32ArrayCid:
         ASSERT(representation() == kUnboxedUint32);
-        __ ldr(result, element_address);
-      break;
+        if (aligned()) {
+          __ ldr(result, element_address);
+        } else {
+          __ LoadWordUnaligned(result, address, TMP);
+        }
+        break;
       default:
         UNREACHABLE();
     }
@@ -1315,6 +1364,7 @@
   switch (class_id()) {
     case kTypedDataInt8ArrayCid:
       ASSERT(index_scale() == 1);
+      ASSERT(aligned());
       __ ldrsb(result, element_address);
       __ SmiTag(result);
       break;
@@ -1325,17 +1375,26 @@
     case kOneByteStringCid:
     case kExternalOneByteStringCid:
       ASSERT(index_scale() == 1);
+      ASSERT(aligned());
       __ ldrb(result, element_address);
       __ SmiTag(result);
       break;
     case kTypedDataInt16ArrayCid:
-      __ ldrsh(result, element_address);
+      if (aligned()) {
+        __ ldrsh(result, element_address);
+      } else {
+        __ LoadHalfWordUnaligned(result, address, TMP);
+      }
       __ SmiTag(result);
       break;
     case kTypedDataUint16ArrayCid:
     case kTwoByteStringCid:
     case kExternalTwoByteStringCid:
-      __ ldrh(result, element_address);
+      if (aligned()) {
+        __ ldrh(result, element_address);
+      } else {
+        __ LoadHalfWordUnsignedUnaligned(result, address, TMP);
+      }
       __ SmiTag(result);
       break;
     default:
@@ -1349,8 +1408,8 @@
 Representation StoreIndexedInstr::RequiredInputRepresentation(
     intptr_t idx) const {
   // Array can be a Dart object or a pointer to external data.
-  if (idx == 0)  return kNoRepresentation;  // Flexible input representation.
-  if (idx == 1) return kTagged;  // Index is a smi.
+  if (idx == 0) return kNoRepresentation;  // Flexible input representation.
+  if (idx == 1) return kTagged;            // Index is a smi.
   ASSERT(idx == 2);
   switch (class_id_) {
     case kArrayCid:
@@ -1392,29 +1451,37 @@
   if (CanBeImmediateIndex(index(), class_id(), IsExternal(),
                           false,  // Store.
                           &needs_base)) {
-    const intptr_t kNumTemps = needs_base ? 1 : 0;
-    locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    const intptr_t kNumTemps = aligned() ? (needs_base ? 1 : 0) : 2;
+    locs = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
 
     // CanBeImmediateIndex must return false for unsafe smis.
     locs->set_in(1, Location::Constant(index()->definition()->AsConstant()));
     if (needs_base) {
       locs->set_temp(0, Location::RequiresRegister());
     }
+    if (!aligned()) {
+      locs->set_temp(0, Location::RequiresRegister());
+      locs->set_temp(1, Location::RequiresRegister());
+    }
   } else {
-    const intptr_t kNumTemps = 0;
-    locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    const intptr_t kNumTemps = aligned() ? 0 : 2;
+    locs = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
 
     locs->set_in(1, Location::WritableRegister());
+    if (!aligned()) {
+      locs->set_temp(0, Location::RequiresRegister());
+      locs->set_temp(1, Location::RequiresRegister());
+    }
   }
   locs->set_in(0, Location::RequiresRegister());
 
   switch (class_id()) {
     case kArrayCid:
       locs->set_in(2, ShouldEmitStoreBarrier()
-                        ? Location::WritableRegister()
-                        : Location::RegisterOrConstant(value()));
+                          ? Location::WritableRegister()
+                          : Location::RegisterOrConstant(value()));
       break;
     case kExternalTypedDataUint8ArrayCid:
     case kExternalTypedDataUint8ClampedArrayCid:
@@ -1452,16 +1519,34 @@
   const Location index = locs()->in(1);
   const Register temp =
       (locs()->temp_count() > 0) ? locs()->temp(0).reg() : kNoRegister;
+  const Register temp2 =
+      (locs()->temp_count() > 1) ? locs()->temp(1).reg() : kNoRegister;
 
-  Address element_address = index.IsRegister()
-      ? __ ElementAddressForRegIndex(false,  // Store.
-                                     IsExternal(), class_id(), index_scale(),
-                                     array,
-                                     index.reg())
-      : __ ElementAddressForIntIndex(false,  // Store.
-                                     IsExternal(), class_id(), index_scale(),
-                                     array, Smi::Cast(index.constant()).Value(),
-                                     temp);
+  Address element_address(kNoRegister);
+  if (aligned()) {
+    element_address = index.IsRegister()
+                          ? __ ElementAddressForRegIndex(
+                                false,  // Store.
+                                IsExternal(), class_id(), index_scale(), array,
+                                index.reg())
+                          : __ ElementAddressForIntIndex(
+                                false,  // Store.
+                                IsExternal(), class_id(), index_scale(), array,
+                                Smi::Cast(index.constant()).Value(), temp);
+  } else {
+    if (index.IsRegister()) {
+      __ LoadElementAddressForRegIndex(temp,
+                                       false,  // Store.
+                                       IsExternal(), class_id(), index_scale(),
+                                       array, index.reg());
+    } else {
+      __ LoadElementAddressForIntIndex(temp,
+                                       false,  // Store.
+                                       IsExternal(), class_id(), index_scale(),
+                                       array,
+                                       Smi::Cast(index.constant()).Value());
+    }
+  }
 
   switch (class_id()) {
     case kArrayCid:
@@ -1507,9 +1592,9 @@
       } else {
         const Register value = locs()->in(2).reg();
         __ LoadImmediate(IP, 0x1FE);  // Smi 0xFF.
-        __ cmp(value, Operand(IP));  // Compare Smi value and smi 0xFF.
+        __ cmp(value, Operand(IP));   // Compare Smi value and smi 0xFF.
         // Clamp to 0x00 or 0xFF respectively.
-        __ mov(IP, Operand(0), LE);  // IP = value <= 0x1FE ? 0 : 0x1FE.
+        __ mov(IP, Operand(0), LE);      // IP = value <= 0x1FE ? 0 : 0x1FE.
         __ mov(IP, Operand(value), LS);  // IP = value in range ? value : IP.
         __ SmiUntag(IP);
         __ strb(IP, element_address);
@@ -1520,13 +1605,21 @@
     case kTypedDataUint16ArrayCid: {
       const Register value = locs()->in(2).reg();
       __ SmiUntag(IP, value);
-      __ strh(IP, element_address);
+      if (aligned()) {
+        __ strh(IP, element_address);
+      } else {
+        __ StoreHalfWordUnaligned(IP, temp, temp2);
+      }
       break;
     }
     case kTypedDataInt32ArrayCid:
     case kTypedDataUint32ArrayCid: {
       const Register value = locs()->in(2).reg();
-      __ str(value, element_address);
+      if (aligned()) {
+        __ str(value, element_address);
+      } else {
+        __ StoreWordUnaligned(value, temp, temp2);
+      }
       break;
     }
     case kTypedDataFloat32ArrayCid: {
@@ -1561,11 +1654,10 @@
   const intptr_t value_cid = value()->Type()->ToCid();
   const intptr_t field_cid = field().guarded_cid();
 
-  const bool emit_full_guard =
-      !opt || (field_cid == kIllegalCid);
+  const bool emit_full_guard = !opt || (field_cid == kIllegalCid);
 
-  const bool needs_value_cid_temp_reg = emit_full_guard ||
-      ((value_cid == kDynamicCid) && (field_cid != kSmiCid));
+  const bool needs_value_cid_temp_reg =
+      emit_full_guard || ((value_cid == kDynamicCid) && (field_cid != kSmiCid));
 
   const bool needs_field_temp_reg = emit_full_guard;
 
@@ -1577,8 +1669,8 @@
     num_temps++;
   }
 
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, num_temps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, num_temps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
 
   for (intptr_t i = 0; i < num_temps; i++) {
@@ -1599,7 +1691,8 @@
   if (field_cid == kDynamicCid) {
     if (Compiler::IsBackgroundCompilation()) {
       // Field state changed while compiling.
-      Compiler::AbortBackgroundCompilation(deopt_id(),
+      Compiler::AbortBackgroundCompilation(
+          deopt_id(),
           "GuardFieldClassInstr: field state changed while compiling");
     }
     ASSERT(!compiler->is_optimizing());
@@ -1609,23 +1702,26 @@
   const bool emit_full_guard =
       !compiler->is_optimizing() || (field_cid == kIllegalCid);
 
-  const bool needs_value_cid_temp_reg = emit_full_guard ||
-      ((value_cid == kDynamicCid) && (field_cid != kSmiCid));
+  const bool needs_value_cid_temp_reg =
+      emit_full_guard || ((value_cid == kDynamicCid) && (field_cid != kSmiCid));
 
   const bool needs_field_temp_reg = emit_full_guard;
 
   const Register value_reg = locs()->in(0).reg();
 
-  const Register value_cid_reg = needs_value_cid_temp_reg ?
-      locs()->temp(0).reg() : kNoRegister;
+  const Register value_cid_reg =
+      needs_value_cid_temp_reg ? locs()->temp(0).reg() : kNoRegister;
 
-  const Register field_reg = needs_field_temp_reg ?
-      locs()->temp(locs()->temp_count() - 1).reg() : kNoRegister;
+  const Register field_reg = needs_field_temp_reg
+                                 ? locs()->temp(locs()->temp_count() - 1).reg()
+                                 : kNoRegister;
 
   Label ok, fail_label;
 
-  Label* deopt = compiler->is_optimizing() ?
-      compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL;
+  Label* deopt =
+      compiler->is_optimizing()
+          ? compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField)
+          : NULL;
 
   Label* fail = (deopt != NULL) ? deopt : &fail_label;
 
@@ -1633,8 +1729,8 @@
     __ LoadObject(field_reg, Field::ZoneHandle(field().Original()));
 
     FieldAddress field_cid_operand(field_reg, Field::guarded_cid_offset());
-    FieldAddress field_nullability_operand(
-        field_reg, Field::is_nullable_offset());
+    FieldAddress field_nullability_operand(field_reg,
+                                           Field::is_nullable_offset());
 
     if (value_cid == kDynamicCid) {
       LoadValueCid(compiler, value_cid_reg, value_reg);
@@ -1732,8 +1828,8 @@
   const intptr_t kNumInputs = 1;
   if (!opt || (field().guarded_list_length() == Field::kUnknownFixedLength)) {
     const intptr_t kNumTemps = 3;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresRegister());
     // We need temporaries for field object, length offset and expected length.
     summary->set_temp(0, Location::RequiresRegister());
@@ -1744,8 +1840,8 @@
     // TODO(vegorov): can use TMP when length is small enough to fit into
     // immediate.
     const intptr_t kNumTemps = 1;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresRegister());
     summary->set_temp(0, Location::RequiresRegister());
     return summary;
@@ -1758,15 +1854,18 @@
   if (field().guarded_list_length() == Field::kNoFixedLength) {
     if (Compiler::IsBackgroundCompilation()) {
       // Field state changed while compiling.
-      Compiler::AbortBackgroundCompilation(deopt_id(),
+      Compiler::AbortBackgroundCompilation(
+          deopt_id(),
           "GuardFieldLengthInstr: field state changed while compiling");
     }
     ASSERT(!compiler->is_optimizing());
     return;  // Nothing to emit.
   }
 
-  Label* deopt = compiler->is_optimizing() ?
-      compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL;
+  Label* deopt =
+      compiler->is_optimizing()
+          ? compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField)
+          : NULL;
 
   const Register value_reg = locs()->in(0).reg();
 
@@ -1780,10 +1879,12 @@
 
     __ LoadObject(field_reg, Field::ZoneHandle(field().Original()));
 
-    __ ldrsb(offset_reg, FieldAddress(field_reg,
-        Field::guarded_list_length_in_object_offset_offset()));
-    __ ldr(length_reg, FieldAddress(field_reg,
-        Field::guarded_list_length_offset()));
+    __ ldrsb(
+        offset_reg,
+        FieldAddress(field_reg,
+                     Field::guarded_list_length_in_object_offset_offset()));
+    __ ldr(length_reg,
+           FieldAddress(field_reg, Field::guarded_list_length_offset()));
 
     __ tst(offset_reg, Operand(offset_reg));
     __ b(&ok, MI);
@@ -1811,7 +1912,7 @@
     ASSERT(compiler->is_optimizing());
     ASSERT(field().guarded_list_length() >= 0);
     ASSERT(field().guarded_list_length_in_object_offset() !=
-        Field::kUnknownLengthOffset);
+           Field::kUnknownLengthOffset);
 
     const Register length_reg = locs()->temp(0).reg();
 
@@ -1830,14 +1931,11 @@
   BoxAllocationSlowPath(Instruction* instruction,
                         const Class& cls,
                         Register result)
-      : instruction_(instruction),
-        cls_(cls),
-        result_(result) { }
+      : instruction_(instruction), cls_(cls), result_(result) {}
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     if (Assembler::EmittingComments()) {
-      __ Comment("%s slow path allocation of %s",
-                 instruction_->DebugName(),
+      __ Comment("%s slow path allocation of %s", instruction_->DebugName(),
                  String::Handle(cls_.ScrubbedName()).ToCString());
     }
     __ Bind(entry_label());
@@ -1851,9 +1949,7 @@
 
     compiler->SaveLiveRegisters(locs);
     compiler->GenerateCall(TokenPosition::kNoSource,  // No token position.
-                           stub_entry,
-                           RawPcDescriptors::kOther,
-                           locs);
+                           stub_entry, RawPcDescriptors::kOther, locs);
     compiler->AddStubCallTarget(stub);
     __ MoveRegister(result_, R0);
     compiler->RestoreLiveRegisters(locs);
@@ -1866,19 +1962,13 @@
                        Register result,
                        Register temp) {
     if (compiler->intrinsic_mode()) {
-      __ TryAllocate(cls,
-                     compiler->intrinsic_slow_path_label(),
-                     result,
-                     temp);
+      __ TryAllocate(cls, compiler->intrinsic_slow_path_label(), result, temp);
     } else {
       BoxAllocationSlowPath* slow_path =
           new BoxAllocationSlowPath(instruction, cls, result);
       compiler->AddSlowPathCode(slow_path);
 
-      __ TryAllocate(cls,
-                     slow_path->entry_label(),
-                     result,
-                     temp);
+      __ TryAllocate(cls, slow_path->entry_label(), result, temp);
       __ Bind(slow_path->exit_label());
     }
   }
@@ -1890,14 +1980,12 @@
 };
 
 
-
-
 LocationSummary* LoadCodeUnitsInstr::MakeLocationSummary(Zone* zone,
                                                          bool opt) const {
   const bool might_box = (representation() == kTagged) && !can_pack_into_smi();
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = might_box ? 1 : 0;
-  LocationSummary* summary = new(zone) LocationSummary(
+  LocationSummary* summary = new (zone) LocationSummary(
       zone, kNumInputs, kNumTemps,
       might_box ? LocationSummary::kCallOnSlowPath : LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
@@ -1925,7 +2013,7 @@
   const Location index = locs()->in(1);
 
   Address element_address = __ ElementAddressForRegIndex(
-        true,  IsExternal(), class_id(), index_scale(), str, index.reg());
+      true, IsExternal(), class_id(), index_scale(), str, index.reg());
   // Warning: element_address may use register IP as base.
 
   if (representation() == kUnboxedMint) {
@@ -1957,18 +2045,30 @@
       case kOneByteStringCid:
       case kExternalOneByteStringCid:
         switch (element_count()) {
-          case 1: __ ldrb(result, element_address); break;
-          case 2: __ ldrh(result, element_address); break;
-          case 4: __ ldr(result, element_address); break;
-          default: UNREACHABLE();
+          case 1:
+            __ ldrb(result, element_address);
+            break;
+          case 2:
+            __ ldrh(result, element_address);
+            break;
+          case 4:
+            __ ldr(result, element_address);
+            break;
+          default:
+            UNREACHABLE();
         }
         break;
       case kTwoByteStringCid:
       case kExternalTwoByteStringCid:
         switch (element_count()) {
-          case 1: __ ldrh(result, element_address); break;
-          case 2: __ ldr(result, element_address); break;
-          default: UNREACHABLE();
+          case 1:
+            __ ldrh(result, element_address);
+            break;
+          case 2:
+            __ ldr(result, element_address);
+            break;
+          default:
+            UNREACHABLE();
         }
         break;
       default:
@@ -1991,8 +2091,8 @@
       Label done;
       __ TestImmediate(value, 0xC0000000);
       __ b(&done, EQ);
-      BoxAllocationSlowPath::Allocate(
-          compiler, this, compiler->mint_class(), result, temp);
+      BoxAllocationSlowPath::Allocate(compiler, this, compiler->mint_class(),
+                                      result, temp);
       __ eor(temp, temp, Operand(temp));
       __ StoreToOffset(kWord, value, result,
                        Mint::value_offset() - kHeapObjectTag);
@@ -2008,14 +2108,13 @@
                                                               bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps =
-      (IsUnboxedStore() && opt) ? 2 :
-          ((IsPotentialUnboxedStore()) ? 3 : 0);
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps,
-          ((IsUnboxedStore() && opt && is_initialization()) ||
-           IsPotentialUnboxedStore())
-          ? LocationSummary::kCallOnSlowPath
-          : LocationSummary::kNoCall);
+      (IsUnboxedStore() && opt) ? 2 : ((IsPotentialUnboxedStore()) ? 3 : 0);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps,
+                      ((IsUnboxedStore() && opt && is_initialization()) ||
+                       IsPotentialUnboxedStore())
+                          ? LocationSummary::kCallOnSlowPath
+                          : LocationSummary::kNoCall);
 
   summary->set_in(0, Location::RequiresRegister());
   if (IsUnboxedStore() && opt) {
@@ -2023,17 +2122,16 @@
     summary->set_temp(0, Location::RequiresRegister());
     summary->set_temp(1, Location::RequiresRegister());
   } else if (IsPotentialUnboxedStore()) {
-    summary->set_in(1, ShouldEmitStoreBarrier()
-        ? Location::WritableRegister()
-        : Location::RequiresRegister());
+    summary->set_in(1, ShouldEmitStoreBarrier() ? Location::WritableRegister()
+                                                : Location::RequiresRegister());
     summary->set_temp(0, Location::RequiresRegister());
     summary->set_temp(1, Location::RequiresRegister());
     summary->set_temp(2, opt ? Location::RequiresFpuRegister()
                              : Location::FpuRegisterLocation(Q1));
   } else {
     summary->set_in(1, ShouldEmitStoreBarrier()
-                       ? Location::WritableRegister()
-                       : Location::RegisterOrConstant(value()));
+                           ? Location::WritableRegister()
+                           : Location::RegisterOrConstant(value()));
   }
   return summary;
 }
@@ -2051,8 +2149,7 @@
   __ CompareObject(box_reg, Object::null_object());
   __ b(&done, NE);
 
-  BoxAllocationSlowPath::Allocate(
-      compiler, instruction, cls, box_reg, temp);
+  BoxAllocationSlowPath::Allocate(compiler, instruction, cls, box_reg, temp);
 
   __ MoveRegister(temp, box_reg);
   __ StoreIntoObjectOffset(instance_reg, offset, temp);
@@ -2089,8 +2186,7 @@
           UNREACHABLE();
       }
 
-      BoxAllocationSlowPath::Allocate(
-          compiler, this, *cls, temp, temp2);
+      BoxAllocationSlowPath::Allocate(compiler, this, *cls, temp, temp2);
       __ MoveRegister(temp2, temp);
       __ StoreIntoObjectOffset(instance_reg, offset_in_bytes_, temp2);
     } else {
@@ -2104,12 +2200,12 @@
       case kFloat32x4Cid:
         __ Comment("UnboxedFloat32x4StoreInstanceFieldInstr");
         __ StoreMultipleDToOffset(value, 2, temp,
-            Float32x4::value_offset() - kHeapObjectTag);
+                                  Float32x4::value_offset() - kHeapObjectTag);
         break;
       case kFloat64x2Cid:
         __ Comment("UnboxedFloat64x2StoreInstanceFieldInstr");
         __ StoreMultipleDToOffset(value, 2, temp,
-            Float64x2::value_offset() - kHeapObjectTag);
+                                  Float64x2::value_offset() - kHeapObjectTag);
         break;
       default:
         UNREACHABLE();
@@ -2161,45 +2257,30 @@
     __ b(&store_pointer);
 
     if (!compiler->is_optimizing()) {
-        locs()->live_registers()->Add(locs()->in(0));
-        locs()->live_registers()->Add(locs()->in(1));
+      locs()->live_registers()->Add(locs()->in(0));
+      locs()->live_registers()->Add(locs()->in(1));
     }
 
     {
       __ Bind(&store_double);
-      EnsureMutableBox(compiler,
-                       this,
-                       temp,
-                       compiler->double_class(),
-                       instance_reg,
-                       offset_in_bytes_,
-                       temp2);
+      EnsureMutableBox(compiler, this, temp, compiler->double_class(),
+                       instance_reg, offset_in_bytes_, temp2);
       __ CopyDoubleField(temp, value_reg, TMP, temp2, fpu_temp);
       __ b(&skip_store);
     }
 
     {
       __ Bind(&store_float32x4);
-      EnsureMutableBox(compiler,
-                       this,
-                       temp,
-                       compiler->float32x4_class(),
-                       instance_reg,
-                       offset_in_bytes_,
-                       temp2);
+      EnsureMutableBox(compiler, this, temp, compiler->float32x4_class(),
+                       instance_reg, offset_in_bytes_, temp2);
       __ CopyFloat32x4Field(temp, value_reg, TMP, temp2, fpu_temp);
       __ b(&skip_store);
     }
 
     {
       __ Bind(&store_float64x2);
-      EnsureMutableBox(compiler,
-                       this,
-                       temp,
-                       compiler->float64x2_class(),
-                       instance_reg,
-                       offset_in_bytes_,
-                       temp2);
+      EnsureMutableBox(compiler, this, temp, compiler->float64x2_class(),
+                       instance_reg, offset_in_bytes_, temp2);
       __ CopyFloat64x2Field(temp, value_reg, TMP, temp2, fpu_temp);
       __ b(&skip_store);
     }
@@ -2209,19 +2290,15 @@
 
   if (ShouldEmitStoreBarrier()) {
     const Register value_reg = locs()->in(1).reg();
-    __ StoreIntoObjectOffset(instance_reg,
-                             offset_in_bytes_,
-                             value_reg,
+    __ StoreIntoObjectOffset(instance_reg, offset_in_bytes_, value_reg,
                              CanValueBeSmi());
   } else {
     if (locs()->in(1).IsConstant()) {
-      __ StoreIntoObjectNoBarrierOffset(instance_reg,
-                                        offset_in_bytes_,
+      __ StoreIntoObjectNoBarrierOffset(instance_reg, offset_in_bytes_,
                                         locs()->in(1).constant());
     } else {
       const Register value_reg = locs()->in(1).reg();
-      __ StoreIntoObjectNoBarrierOffset(instance_reg,
-                                        offset_in_bytes_,
+      __ StoreIntoObjectNoBarrierOffset(instance_reg, offset_in_bytes_,
                                         value_reg);
     }
   }
@@ -2233,8 +2310,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_out(0, Location::RequiresRegister());
   return summary;
@@ -2255,8 +2332,8 @@
 
 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Zone* zone,
                                                             bool opt) const {
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, 1, 1, LocationSummary::kNoCall);
+  LocationSummary* locs =
+      new (zone) LocationSummary(zone, 1, 1, LocationSummary::kNoCall);
   locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister()
                                               : Location::RequiresRegister());
   locs->set_temp(0, Location::RequiresRegister());
@@ -2270,10 +2347,8 @@
 
   __ LoadObject(temp, Field::ZoneHandle(Z, field().Original()));
   if (this->value()->NeedsStoreBuffer()) {
-    __ StoreIntoObject(temp,
-                       FieldAddress(temp, Field::static_value_offset()),
-                       value,
-                       CanValueBeSmi());
+    __ StoreIntoObject(temp, FieldAddress(temp, Field::static_value_offset()),
+                       value, CanValueBeSmi());
   } else {
     __ StoreIntoObjectNoBarrier(
         temp, FieldAddress(temp, Field::static_value_offset()), value);
@@ -2285,8 +2360,8 @@
                                                       bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(R0));
   summary->set_in(1, Location::RegisterLocation(R1));
   summary->set_out(0, Location::RegisterLocation(R0));
@@ -2298,10 +2373,7 @@
   ASSERT(locs()->in(0).reg() == R0);  // Value.
   ASSERT(locs()->in(1).reg() == R1);  // Instantiator type arguments.
 
-  compiler->GenerateInstanceOf(token_pos(),
-                               deopt_id(),
-                               type(),
-                               negate_result(),
+  compiler->GenerateInstanceOf(token_pos(), deopt_id(), type(), negate_result(),
                                locs());
   ASSERT(locs()->out(0).reg() == R0);
 }
@@ -2311,8 +2383,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(kElementTypePos, Location::RegisterLocation(R1));
   locs->set_in(kLengthPos, Location::RegisterLocation(R2));
   locs->set_out(0, Location::RegisterLocation(R0));
@@ -2322,9 +2394,9 @@
 
 // Inlines array allocation for known constant values.
 static void InlineArrayAllocation(FlowGraphCompiler* compiler,
-                                   intptr_t num_elements,
-                                   Label* slow_path,
-                                   Label* done) {
+                                  intptr_t num_elements,
+                                  Label* slow_path,
+                                  Label* done) {
   const int kInlineArraySize = 12;  // Same as kInlineInstanceSize.
   const Register kLengthReg = R2;
   const Register kElemTypeReg = R1;
@@ -2333,19 +2405,16 @@
   __ TryAllocateArray(kArrayCid, instance_size, slow_path,
                       R0,  // instance
                       R3,  // end address
-                      R8,
-                      R6);
+                      R8, R6);
   // R0: new object start as a tagged pointer.
   // R3: new object end address.
 
   // Store the type argument field.
-  __ StoreIntoObjectNoBarrier(R0,
-                              FieldAddress(R0, Array::type_arguments_offset()),
-                              kElemTypeReg);
+  __ StoreIntoObjectNoBarrier(
+      R0, FieldAddress(R0, Array::type_arguments_offset()), kElemTypeReg);
 
   // Set the length field.
-  __ StoreIntoObjectNoBarrier(R0,
-                              FieldAddress(R0, Array::length_offset()),
+  __ StoreIntoObjectNoBarrier(R0, FieldAddress(R0, Array::length_offset()),
                               kLengthReg);
 
   // Initialize all array elements to raw_null.
@@ -2385,8 +2454,7 @@
   ASSERT(locs()->in(kElementTypePos).reg() == kElemTypeReg);
   ASSERT(locs()->in(kLengthPos).reg() == kLengthReg);
 
-  if (compiler->is_optimizing() &&
-      !FLAG_precompiled_mode &&
+  if (compiler->is_optimizing() && !FLAG_precompiled_mode &&
       num_elements()->BindsToConstant() &&
       num_elements()->BoundConstant().IsSmi()) {
     const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value();
@@ -2395,13 +2463,10 @@
       InlineArrayAllocation(compiler, length, &slow_path, &done);
       __ Bind(&slow_path);
       __ PushObject(Object::null_object());  // Make room for the result.
-      __ Push(kLengthReg);  // length.
+      __ Push(kLengthReg);                   // length.
       __ Push(kElemTypeReg);
-      compiler->GenerateRuntimeCall(token_pos(),
-                                    deopt_id(),
-                                    kAllocateArrayRuntimeEntry,
-                                    2,
-                                    locs());
+      compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                    kAllocateArrayRuntimeEntry, 2, locs());
       __ Drop(2);
       __ Pop(kResultReg);
       __ Bind(&done);
@@ -2411,10 +2476,8 @@
   const Code& stub = Code::ZoneHandle(compiler->zone(),
                                       StubCode::AllocateArray_entry()->code());
   compiler->AddStubCallTarget(stub);
-  compiler->GenerateCall(token_pos(),
-                         *StubCode::AllocateArray_entry(),
-                         RawPcDescriptors::kOther,
-                         locs());
+  compiler->GenerateCall(token_pos(), *StubCode::AllocateArray_entry(),
+                         RawPcDescriptors::kOther, locs());
   ASSERT(locs()->out(0).reg() == kResultReg);
 }
 
@@ -2423,14 +2486,12 @@
                                                      bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps =
-      (IsUnboxedLoad() && opt) ? 1 :
-          ((IsPotentialUnboxedLoad()) ? 3 : 0);
+      (IsUnboxedLoad() && opt) ? 1 : ((IsPotentialUnboxedLoad()) ? 3 : 0);
 
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps,
-          (opt && !IsPotentialUnboxedLoad())
-          ? LocationSummary::kNoCall
-          : LocationSummary::kCallOnSlowPath);
+  LocationSummary* locs = new (zone) LocationSummary(
+      zone, kNumInputs, kNumTemps, (opt && !IsPotentialUnboxedLoad())
+                                       ? LocationSummary::kNoCall
+                                       : LocationSummary::kCallOnSlowPath);
 
   locs->set_in(0, Location::RequiresRegister());
 
@@ -2465,12 +2526,12 @@
       case kFloat32x4Cid:
         __ Comment("UnboxedFloat32x4LoadFieldInstr");
         __ LoadMultipleDFromOffset(result, 2, temp,
-            Float32x4::value_offset() - kHeapObjectTag);
+                                   Float32x4::value_offset() - kHeapObjectTag);
         break;
       case kFloat64x2Cid:
         __ Comment("UnboxedFloat64x2LoadFieldInstr");
         __ LoadMultipleDFromOffset(result, 2, temp,
-            Float64x2::value_offset() - kHeapObjectTag);
+                                   Float64x2::value_offset() - kHeapObjectTag);
         break;
       default:
         UNREACHABLE();
@@ -2521,12 +2582,8 @@
 
     {
       __ Bind(&load_double);
-      BoxAllocationSlowPath::Allocate(
-          compiler,
-          this,
-          compiler->double_class(),
-          result_reg,
-          temp);
+      BoxAllocationSlowPath::Allocate(compiler, this, compiler->double_class(),
+                                      result_reg, temp);
       __ ldr(temp, FieldAddress(instance_reg, offset_in_bytes()));
       __ CopyDoubleField(result_reg, temp, TMP, temp2, value);
       __ b(&done);
@@ -2535,11 +2592,7 @@
     {
       __ Bind(&load_float32x4);
       BoxAllocationSlowPath::Allocate(
-          compiler,
-          this,
-          compiler->float32x4_class(),
-          result_reg,
-          temp);
+          compiler, this, compiler->float32x4_class(), result_reg, temp);
       __ ldr(temp, FieldAddress(instance_reg, offset_in_bytes()));
       __ CopyFloat32x4Field(result_reg, temp, TMP, temp2, value);
       __ b(&done);
@@ -2548,11 +2601,7 @@
     {
       __ Bind(&load_float64x2);
       BoxAllocationSlowPath::Allocate(
-          compiler,
-          this,
-          compiler->float64x2_class(),
-          result_reg,
-          temp);
+          compiler, this, compiler->float64x2_class(), result_reg, temp);
       __ ldr(temp, FieldAddress(instance_reg, offset_in_bytes()));
       __ CopyFloat64x2Field(result_reg, temp, TMP, temp2, value);
       __ b(&done);
@@ -2569,8 +2618,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(R0));
   locs->set_out(0, Location::RegisterLocation(R0));
   return locs;
@@ -2586,23 +2635,21 @@
   __ PushObject(Object::null_object());  // Make room for the result.
   __ PushObject(type());
   __ Push(instantiator_reg);  // Push instantiator type arguments.
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kInstantiateTypeRuntimeEntry,
-                                2,
-                                locs());
-  __ Drop(2);  // Drop instantiator and uninstantiated type.
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                kInstantiateTypeRuntimeEntry, 2, locs());
+  __ Drop(2);          // Drop instantiator and uninstantiated type.
   __ Pop(result_reg);  // Pop instantiated type.
   ASSERT(instantiator_reg == result_reg);
 }
 
 
 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(R0));
   locs->set_out(0, Location::RegisterLocation(R0));
   return locs;
@@ -2655,12 +2702,10 @@
   __ PushObject(Object::null_object());  // Make room for the result.
   __ PushObject(type_arguments());
   __ Push(instantiator_reg);  // Push instantiator type arguments.
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kInstantiateTypeArgumentsRuntimeEntry,
-                                2,
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                kInstantiateTypeArgumentsRuntimeEntry, 2,
                                 locs());
-  __ Drop(2);  // Drop instantiator and uninstantiated type arguments.
+  __ Drop(2);          // Drop instantiator and uninstantiated type arguments.
   __ Pop(result_reg);  // Pop instantiated type arguments.
   __ Bind(&type_arguments_instantiated);
 }
@@ -2672,7 +2717,7 @@
   ASSERT(opt);
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 3;
-  LocationSummary* locs = new(zone) LocationSummary(
+  LocationSummary* locs = new (zone) LocationSummary(
       zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   locs->set_temp(0, Location::RegisterLocation(R1));
   locs->set_temp(1, Location::RegisterLocation(R2));
@@ -2686,7 +2731,7 @@
  public:
   explicit AllocateContextSlowPath(
       AllocateUninitializedContextInstr* instruction)
-      : instruction_(instruction) { }
+      : instruction_(instruction) {}
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     __ Comment("AllocateContextSlowPath");
@@ -2703,8 +2748,7 @@
     compiler->AddStubCallTarget(stub);
     compiler->GenerateCall(instruction_->token_pos(),
                            *StubCode::AllocateContext_entry(),
-                           RawPcDescriptors::kOther,
-                           locs);
+                           RawPcDescriptors::kOther, locs);
     ASSERT(instruction_->locs()->out(0).reg() == R0);
     compiler->RestoreLiveRegisters(instruction_->locs());
     __ b(exit_label());
@@ -2728,9 +2772,7 @@
 
   __ TryAllocateArray(kContextCid, instance_size, slow_path->entry_label(),
                       result,  // instance
-                      temp0,
-                      temp1,
-                      temp2);
+                      temp0, temp1, temp2);
 
   // Setup up number of context variables field.
   __ LoadImmediate(temp0, num_context_variables());
@@ -2744,8 +2786,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 1;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_temp(0, Location::RegisterLocation(R1));
   locs->set_out(0, Location::RegisterLocation(R0));
   return locs;
@@ -2757,10 +2799,8 @@
   ASSERT(locs()->out(0).reg() == R0);
 
   __ LoadImmediate(R1, num_context_variables());
-  compiler->GenerateCall(token_pos(),
-                         *StubCode::AllocateContext_entry(),
-                         RawPcDescriptors::kOther,
-                         locs());
+  compiler->GenerateCall(token_pos(), *StubCode::AllocateContext_entry(),
+                         RawPcDescriptors::kOther, locs());
 }
 
 
@@ -2768,8 +2808,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(R0));
   locs->set_temp(0, Location::RegisterLocation(R1));
   return locs;
@@ -2791,11 +2831,8 @@
   __ Bind(&call_runtime);
   __ PushObject(Object::null_object());  // Make room for (unused) result.
   __ Push(field);
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kInitStaticFieldRuntimeEntry,
-                                1,
-                                locs());
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                kInitStaticFieldRuntimeEntry, 1, locs());
   __ Drop(2);  // Remove argument and result placeholder.
   __ Bind(&no_call);
 }
@@ -2805,8 +2842,8 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(R0));
   locs->set_out(0, Location::RegisterLocation(R0));
   return locs;
@@ -2819,12 +2856,9 @@
 
   __ PushObject(Object::null_object());  // Make room for the result.
   __ Push(context_value);
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kCloneContextRuntimeEntry,
-                                1,
-                                locs());
-  __ Drop(1);  // Remove argument.
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                kCloneContextRuntimeEntry, 1, locs());
+  __ Drop(1);      // Remove argument.
   __ Pop(result);  // Get result (cloned context).
 }
 
@@ -2837,28 +2871,17 @@
 
 
 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  // Ensure space for patching return sites for lazy deopt.
-  if (!FLAG_precompiled_mode && compiler->is_optimizing()) {
-    for (intptr_t i = 0;
-         i < CallPattern::DeoptCallPatternLengthInInstructions();
-         ++i) {
-      __ nop();
-    }
-  }
   __ Bind(compiler->GetJumpLabel(this));
-  compiler->AddExceptionHandler(catch_try_index(),
-                                try_index(),
+  compiler->AddExceptionHandler(catch_try_index(), try_index(),
                                 compiler->assembler()->CodeSize(),
-                                catch_handler_types_,
-                                needs_stacktrace());
+                                catch_handler_types_, needs_stacktrace());
   // On lazy deoptimization we patch the optimized code here to enter the
   // deoptimization stub.
   const intptr_t deopt_id = Thread::ToDeoptAfter(GetDeoptId());
   if (compiler->is_optimizing()) {
     compiler->AddDeoptIndexAtCall(deopt_id);
   } else {
-    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                                   deopt_id,
+    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id,
                                    TokenPosition::kNoSource);
   }
   if (HasParallelMove()) {
@@ -2872,12 +2895,39 @@
   ASSERT(fp_sp_dist <= 0);
   __ AddImmediate(SP, FP, fp_sp_dist);
 
-  // Restore stack and initialize the two exception variables:
-  // exception and stack trace variables.
-  __ StoreToOffset(kWord, kExceptionObjectReg,
-                   FP, exception_var().index() * kWordSize);
-  __ StoreToOffset(kWord, kStackTraceObjectReg,
-                   FP, stacktrace_var().index() * kWordSize);
+  // Auxiliary variables introduced by the try catch can be captured if we are
+  // inside a function with yield/resume points. In this case we first need
+  // to restore the context to match the context at entry into the closure.
+  if (should_restore_closure_context()) {
+    const ParsedFunction& parsed_function = compiler->parsed_function();
+    ASSERT(parsed_function.function().IsClosureFunction());
+    LocalScope* scope = parsed_function.node_sequence()->scope();
+
+    LocalVariable* closure_parameter = scope->VariableAt(0);
+    ASSERT(!closure_parameter->is_captured());
+    __ ldr(CTX, Address(FP, closure_parameter->index() * kWordSize));
+    __ ldr(CTX, FieldAddress(CTX, Closure::context_offset()));
+
+    const intptr_t context_index =
+        parsed_function.current_context_var()->index();
+    __ StoreToOffset(kWord, CTX, FP, context_index * kWordSize);
+  }
+
+  // Initialize exception and stack trace variables.
+  if (exception_var().is_captured()) {
+    ASSERT(stacktrace_var().is_captured());
+    __ StoreIntoObjectOffset(CTX,
+                             Context::variable_offset(exception_var().index()),
+                             kExceptionObjectReg);
+    __ StoreIntoObjectOffset(CTX,
+                             Context::variable_offset(stacktrace_var().index()),
+                             kStackTraceObjectReg);
+  } else {
+    __ StoreToOffset(kWord, kExceptionObjectReg, FP,
+                     exception_var().index() * kWordSize);
+    __ StoreToOffset(kWord, kStackTraceObjectReg, FP,
+                     stacktrace_var().index() * kWordSize);
+  }
 }
 
 
@@ -2885,10 +2935,8 @@
                                                               bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs,
-                          kNumTemps,
-                          LocationSummary::kCallOnSlowPath);
+  LocationSummary* summary = new (zone) LocationSummary(
+      zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   summary->set_temp(0, Location::RequiresRegister());
   return summary;
 }
@@ -2897,7 +2945,7 @@
 class CheckStackOverflowSlowPath : public SlowPathCode {
  public:
   explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction)
-      : instruction_(instruction) { }
+      : instruction_(instruction) {}
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     if (FLAG_use_osr && osr_entry_label()->IsLinked()) {
@@ -2915,11 +2963,9 @@
     ASSERT(compiler->pending_deoptimization_env_ == NULL);
     Environment* env = compiler->SlowPathEnvironmentFor(instruction_);
     compiler->pending_deoptimization_env_ = env;
-    compiler->GenerateRuntimeCall(instruction_->token_pos(),
-                                  instruction_->deopt_id(),
-                                  kStackOverflowRuntimeEntry,
-                                  0,
-                                  instruction_->locs());
+    compiler->GenerateRuntimeCall(
+        instruction_->token_pos(), instruction_->deopt_id(),
+        kStackOverflowRuntimeEntry, 0, instruction_->locs());
 
     if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) {
       // In unoptimized code, record loop stack checks as possible OSR entries.
@@ -2974,9 +3020,10 @@
   const LocationSummary& locs = *shift_left->locs();
   const Register left = locs.in(0).reg();
   const Register result = locs.out(0).reg();
-  Label* deopt = shift_left->CanDeoptimize() ?
-      compiler->AddDeoptStub(shift_left->deopt_id(), ICData::kDeoptBinarySmiOp)
-      : NULL;
+  Label* deopt = shift_left->CanDeoptimize()
+                     ? compiler->AddDeoptStub(shift_left->deopt_id(),
+                                              ICData::kDeoptBinarySmiOp)
+                     : NULL;
   if (locs.in(1).IsConstant()) {
     const Object& constant = locs.in(1).constant();
     ASSERT(constant.IsSmi());
@@ -3066,7 +3113,7 @@
 class CheckedSmiSlowPath : public SlowPathCode {
  public:
   CheckedSmiSlowPath(CheckedSmiOpInstr* instruction, intptr_t try_index)
-      : instruction_(instruction), try_index_(try_index) { }
+      : instruction_(instruction), try_index_(try_index) {}
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     if (Assembler::EmittingComments()) {
@@ -3081,12 +3128,9 @@
     __ Push(locs->in(0).reg());
     __ Push(locs->in(1).reg());
     compiler->EmitMegamorphicInstanceCall(
-        *instruction_->call()->ic_data(),
-        instruction_->call()->ArgumentCount(),
-        instruction_->call()->deopt_id(),
-        instruction_->call()->token_pos(),
-        locs,
-        try_index_,
+        *instruction_->call()->ic_data(), instruction_->call()->ArgumentCount(),
+        instruction_->call()->deopt_id(), instruction_->call()->token_pos(),
+        locs, try_index_,
         /* slow_path_argument_count = */ 2);
     __ mov(result, Operand(R0));
     compiler->RestoreLiveRegisters(locs);
@@ -3103,7 +3147,7 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
+  LocationSummary* summary = new (zone) LocationSummary(
       zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
@@ -3163,31 +3207,158 @@
     case Token::kBIT_XOR:
       __ eor(result, left, Operand(right));
       break;
-    case Token::kEQ:
-    case Token::kLT:
-    case Token::kLTE:
-    case Token::kGT:
-    case Token::kGTE: {
-      Label true_label, false_label, done;
-      BranchLabels labels = { &true_label, &false_label, &false_label };
-      Condition true_condition =
-          EmitSmiComparisonOp(compiler, locs(), op_kind());
-      EmitBranchOnCondition(compiler, true_condition, labels);
-      __ Bind(&false_label);
-      __ LoadObject(result, Bool::False());
-      __ b(&done);
-      __ Bind(&true_label);
-      __ LoadObject(result, Bool::True());
-      __ Bind(&done);
+    case Token::kSHL:
+      ASSERT(result != left);
+      ASSERT(result != right);
+      __ CompareImmediate(right, Smi::RawValue(Smi::kBits));
+      __ b(slow_path->entry_label(), HI);
+
+      __ SmiUntag(TMP, right);
+      // Check for overflow by shifting left and shifting back arithmetically.
+      // If the result is different from the original, there was overflow.
+      __ Lsl(result, left, TMP);
+      __ cmp(left, Operand(result, ASR, TMP));
+      __ b(slow_path->entry_label(), NE);
       break;
-    }
+    case Token::kSHR:
+      ASSERT(result != left);
+      ASSERT(result != right);
+      __ CompareImmediate(right, Smi::RawValue(Smi::kBits));
+      __ b(slow_path->entry_label(), HI);
+
+      __ SmiUntag(result, right);
+      __ SmiUntag(TMP, left);
+      __ Asr(result, TMP, result);
+      __ SmiTag(result);
+      break;
     default:
-      UNIMPLEMENTED();
+      UNREACHABLE();
   }
   __ Bind(slow_path->exit_label());
 }
 
 
+class CheckedSmiComparisonSlowPath : public SlowPathCode {
+ public:
+  CheckedSmiComparisonSlowPath(CheckedSmiComparisonInstr* instruction,
+                               intptr_t try_index,
+                               BranchLabels labels,
+                               bool merged)
+      : instruction_(instruction),
+        try_index_(try_index),
+        labels_(labels),
+        merged_(merged) {}
+
+  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
+    if (Assembler::EmittingComments()) {
+      __ Comment("slow path smi operation");
+    }
+    __ Bind(entry_label());
+    LocationSummary* locs = instruction_->locs();
+    Register result = merged_ ? locs->temp(0).reg() : locs->out(0).reg();
+    locs->live_registers()->Remove(Location::RegisterLocation(result));
+
+    compiler->SaveLiveRegisters(locs);
+    __ Push(locs->in(0).reg());
+    __ Push(locs->in(1).reg());
+    compiler->EmitMegamorphicInstanceCall(
+        *instruction_->call()->ic_data(), instruction_->call()->ArgumentCount(),
+        instruction_->call()->deopt_id(), instruction_->call()->token_pos(),
+        locs, try_index_,
+        /* slow_path_argument_count = */ 2);
+    __ mov(result, Operand(R0));
+    compiler->RestoreLiveRegisters(locs);
+    if (merged_) {
+      __ CompareObject(result, Bool::True());
+      __ b(
+          instruction_->is_negated() ? labels_.false_label : labels_.true_label,
+          EQ);
+      __ b(instruction_->is_negated() ? labels_.true_label
+                                      : labels_.false_label);
+    } else {
+      __ b(exit_label());
+    }
+  }
+
+ private:
+  CheckedSmiComparisonInstr* instruction_;
+  intptr_t try_index_;
+  BranchLabels labels_;
+  bool merged_;
+};
+
+
+LocationSummary* CheckedSmiComparisonInstr::MakeLocationSummary(
+    Zone* zone,
+    bool opt) const {
+  const intptr_t kNumInputs = 2;
+  const intptr_t kNumTemps = 1;
+  LocationSummary* summary = new (zone) LocationSummary(
+      zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
+  summary->set_in(0, Location::RequiresRegister());
+  summary->set_in(1, Location::RequiresRegister());
+  summary->set_temp(0, Location::RequiresRegister());
+  summary->set_out(0, Location::RequiresRegister());
+  return summary;
+}
+
+
+Condition CheckedSmiComparisonInstr::EmitComparisonCode(
+    FlowGraphCompiler* compiler,
+    BranchLabels labels) {
+  return EmitSmiComparisonOp(compiler, locs(), kind());
+}
+
+
+#define EMIT_SMI_CHECK                                                         \
+  Register left = locs()->in(0).reg();                                         \
+  Register right = locs()->in(1).reg();                                        \
+  Register temp = locs()->temp(0).reg();                                       \
+  intptr_t left_cid = this->left()->Type()->ToCid();                           \
+  intptr_t right_cid = this->right()->Type()->ToCid();                         \
+  if (this->left()->definition() == this->right()->definition()) {             \
+    __ tst(left, Operand(kSmiTagMask));                                        \
+  } else if (left_cid == kSmiCid) {                                            \
+    __ tst(right, Operand(kSmiTagMask));                                       \
+  } else if (right_cid == kSmiCid) {                                           \
+    __ tst(left, Operand(kSmiTagMask));                                        \
+  } else {                                                                     \
+    __ orr(temp, left, Operand(right));                                        \
+    __ tst(temp, Operand(kSmiTagMask));                                        \
+  }                                                                            \
+  __ b(slow_path->entry_label(), NE)
+
+
+void CheckedSmiComparisonInstr::EmitBranchCode(FlowGraphCompiler* compiler,
+                                               BranchInstr* branch) {
+  BranchLabels labels = compiler->CreateBranchLabels(branch);
+  CheckedSmiComparisonSlowPath* slow_path = new CheckedSmiComparisonSlowPath(
+      this, compiler->CurrentTryIndex(), labels,
+      /* merged = */ true);
+  compiler->AddSlowPathCode(slow_path);
+  EMIT_SMI_CHECK;
+  Condition true_condition = EmitComparisonCode(compiler, labels);
+  EmitBranchOnCondition(compiler, true_condition, labels);
+  __ Bind(slow_path->exit_label());
+}
+
+
+void CheckedSmiComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  BranchLabels labels = {NULL, NULL, NULL};
+  CheckedSmiComparisonSlowPath* slow_path = new CheckedSmiComparisonSlowPath(
+      this, compiler->CurrentTryIndex(), labels,
+      /* merged = */ false);
+  compiler->AddSlowPathCode(slow_path);
+  EMIT_SMI_CHECK;
+  Condition true_condition = EmitComparisonCode(compiler, labels);
+  Register result = locs()->out(0).reg();
+  __ LoadObject(result, Bool::True(), true_condition);
+  __ LoadObject(result, Bool::False(), NegateCondition(true_condition));
+  __ Bind(slow_path->exit_label());
+}
+#undef EMIT_SMI_CHECK
+
+
 LocationSummary* BinarySmiOpInstr::MakeLocationSummary(Zone* zone,
                                                        bool opt) const {
   const intptr_t kNumInputs = 2;
@@ -3205,8 +3376,8 @@
              (op_kind() == Token::kSHR)) {
     num_temps = 1;
   }
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, num_temps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, num_temps, LocationSummary::kNoCall);
   if (op_kind() == Token::kTRUNCDIV) {
     summary->set_in(0, Location::RequiresRegister());
     if (RightIsPowerOfTwoConstant()) {
@@ -3353,7 +3524,7 @@
         const intptr_t kCountLimit = 0x1F;
         intptr_t value = Smi::Cast(constant).Value();
         __ Asr(result, left,
-            Operand(Utils::Minimum(value + kSmiTagSize, kCountLimit)));
+               Operand(Utils::Minimum(value + kSmiTagSize, kCountLimit)));
         __ SmiTag(result);
         break;
       }
@@ -3510,9 +3681,10 @@
   const LocationSummary& locs = *shift_left->locs();
   const Register left = locs.in(0).reg();
   const Register result = locs.out(0).reg();
-  Label* deopt = shift_left->CanDeoptimize() ?
-      compiler->AddDeoptStub(shift_left->deopt_id(), ICData::kDeoptBinarySmiOp)
-      : NULL;
+  Label* deopt = shift_left->CanDeoptimize()
+                     ? compiler->AddDeoptStub(shift_left->deopt_id(),
+                                              ICData::kDeoptBinarySmiOp)
+                     : NULL;
   ASSERT(locs.in(1).IsConstant());
   const Object& constant = locs.in(1).constant();
   ASSERT(constant.IsSmi());
@@ -3540,8 +3712,8 @@
       (op_kind() == Token::kSHR)) {
     num_temps = 1;
   }
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, num_temps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, num_temps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RegisterOrSmiConstant(right()));
   if (((op_kind() == Token::kSHL) && can_overflow()) ||
@@ -3715,8 +3887,8 @@
   ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid));
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   return summary;
@@ -3724,9 +3896,9 @@
 
 
 void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  Label* deopt = compiler->AddDeoptStub(deopt_id(),
-                                        ICData::kDeoptBinaryDoubleOp,
-                                        licm_hoisted_ ? ICData::kHoisted : 0);
+  Label* deopt =
+      compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinaryDoubleOp,
+                             licm_hoisted_ ? ICData::kHoisted : 0);
   intptr_t left_cid = left()->Type()->ToCid();
   intptr_t right_cid = right()->Type()->ToCid();
   const Register left = locs()->in(0).reg();
@@ -3745,14 +3917,11 @@
 }
 
 
-LocationSummary* BoxInstr::MakeLocationSummary(Zone* zone,
-                                                     bool opt) const {
+LocationSummary* BoxInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs,
-                          kNumTemps,
-                          LocationSummary::kCallOnSlowPath);
+  LocationSummary* summary = new (zone) LocationSummary(
+      zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_temp(0, Location::RequiresRegister());
   summary->set_out(0, Location::RequiresRegister());
@@ -3764,23 +3933,19 @@
   const Register out_reg = locs()->out(0).reg();
   const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg());
 
-  BoxAllocationSlowPath::Allocate(
-      compiler,
-      this,
-      compiler->BoxClassFor(from_representation()),
-      out_reg,
-      locs()->temp(0).reg());
+  BoxAllocationSlowPath::Allocate(compiler, this,
+                                  compiler->BoxClassFor(from_representation()),
+                                  out_reg, locs()->temp(0).reg());
 
   switch (from_representation()) {
     case kUnboxedDouble:
-      __ StoreDToOffset(
-          value, out_reg, ValueOffset() - kHeapObjectTag);
+      __ StoreDToOffset(value, out_reg, ValueOffset() - kHeapObjectTag);
       break;
     case kUnboxedFloat32x4:
     case kUnboxedFloat64x2:
     case kUnboxedInt32x4:
-      __ StoreMultipleDToOffset(
-          value, 2, out_reg, ValueOffset() - kHeapObjectTag);
+      __ StoreMultipleDToOffset(value, 2, out_reg,
+                                ValueOffset() - kHeapObjectTag);
       break;
     default:
       UNREACHABLE();
@@ -3789,13 +3954,12 @@
 }
 
 
-LocationSummary* UnboxInstr::MakeLocationSummary(Zone* zone,
-                                                       bool opt) const {
+LocationSummary* UnboxInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   const bool needs_temp = CanDeoptimize();
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = needs_temp ? 1 : 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   if (needs_temp) {
     summary->set_temp(0, Location::RequiresRegister());
@@ -3816,21 +3980,15 @@
   switch (representation()) {
     case kUnboxedMint: {
       PairLocation* result = locs()->out(0).AsPairLocation();
-      __ LoadFieldFromOffset(kWord,
-                             result->At(0).reg(),
-                             box,
-                             ValueOffset());
-      __ LoadFieldFromOffset(kWord,
-                             result->At(1).reg(),
-                             box,
+      __ LoadFieldFromOffset(kWord, result->At(0).reg(), box, ValueOffset());
+      __ LoadFieldFromOffset(kWord, result->At(1).reg(), box,
                              ValueOffset() + kWordSize);
       break;
     }
 
     case kUnboxedDouble: {
       const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg());
-      __ LoadDFromOffset(
-          result, box, ValueOffset() - kHeapObjectTag);
+      __ LoadDFromOffset(result, box, ValueOffset() - kHeapObjectTag);
       break;
     }
 
@@ -3838,8 +3996,8 @@
     case kUnboxedFloat64x2:
     case kUnboxedInt32x4: {
       const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg());
-      __ LoadMultipleDFromOffset(
-          result, 2, box, ValueOffset() - kHeapObjectTag);
+      __ LoadMultipleDFromOffset(result, 2, box,
+                                 ValueOffset() - kHeapObjectTag);
       break;
     }
 
@@ -3887,8 +4045,8 @@
   } else {
     const Register box = locs()->in(0).reg();
     const Register temp = locs()->temp(0).reg();
-    Label* deopt = compiler->AddDeoptStub(GetDeoptId(),
-                                          ICData::kDeoptCheckClass);
+    Label* deopt =
+        compiler->AddDeoptStub(GetDeoptId(), ICData::kDeoptCheckClass);
     Label is_smi;
 
     if ((value()->Type()->ToNullableCid() == box_cid) &&
@@ -3916,17 +4074,15 @@
 
 
 LocationSummary* BoxInteger32Instr::MakeLocationSummary(Zone* zone,
-                                                   bool opt) const {
+                                                        bool opt) const {
   ASSERT((from_representation() == kUnboxedInt32) ||
          (from_representation() == kUnboxedUint32));
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = ValueFitsSmi() ? 0 : 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone,
-      kNumInputs,
-      kNumTemps,
-      ValueFitsSmi() ? LocationSummary::kNoCall
-                     : LocationSummary::kCallOnSlowPath);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps,
+                      ValueFitsSmi() ? LocationSummary::kNoCall
+                                     : LocationSummary::kCallOnSlowPath);
   summary->set_in(0, Location::RequiresRegister());
   if (!ValueFitsSmi()) {
     summary->set_temp(0, Location::RequiresRegister());
@@ -3954,25 +4110,16 @@
       __ TestImmediate(value, 0xC0000000);
     }
     __ b(&done, EQ);
-    BoxAllocationSlowPath::Allocate(
-        compiler,
-        this,
-        compiler->mint_class(),
-        out,
-        temp);
+    BoxAllocationSlowPath::Allocate(compiler, this, compiler->mint_class(), out,
+                                    temp);
     if (from_representation() == kUnboxedInt32) {
       __ Asr(temp, value, Operand(kBitsPerWord - 1));
     } else {
       ASSERT(from_representation() == kUnboxedUint32);
       __ eor(temp, temp, Operand(temp));
     }
-    __ StoreToOffset(kWord,
-                     value,
-                     out,
-                     Mint::value_offset() - kHeapObjectTag);
-    __ StoreToOffset(kWord,
-                     temp,
-                     out,
+    __ StoreToOffset(kWord, value, out, Mint::value_offset() - kHeapObjectTag);
+    __ StoreToOffset(kWord, temp, out,
                      Mint::value_offset() - kHeapObjectTag + kWordSize);
     __ Bind(&done);
   }
@@ -3983,12 +4130,10 @@
                                                     bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = ValueFitsSmi() ? 0 : 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone,
-      kNumInputs,
-      kNumTemps,
-      ValueFitsSmi() ? LocationSummary::kNoCall
-                     : LocationSummary::kCallOnSlowPath);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps,
+                      ValueFitsSmi() ? LocationSummary::kNoCall
+                                     : LocationSummary::kCallOnSlowPath);
   summary->set_in(0, Location::Pair(Location::RequiresRegister(),
                                     Location::RequiresRegister()));
   if (!ValueFitsSmi()) {
@@ -4020,19 +4165,11 @@
   __ cmp(value_hi, Operand(out_reg, ASR, 31), EQ);
   __ b(&done, EQ);
 
-  BoxAllocationSlowPath::Allocate(
-      compiler,
-      this,
-      compiler->mint_class(),
-      out_reg,
-      tmp);
-  __ StoreToOffset(kWord,
-                   value_lo,
-                   out_reg,
+  BoxAllocationSlowPath::Allocate(compiler, this, compiler->mint_class(),
+                                  out_reg, tmp);
+  __ StoreToOffset(kWord, value_lo, out_reg,
                    Mint::value_offset() - kHeapObjectTag);
-  __ StoreToOffset(kWord,
-                   value_hi,
-                   out_reg,
+  __ StoreToOffset(kWord, value_hi, out_reg,
                    Mint::value_offset() - kHeapObjectTag + kWordSize);
   __ Bind(&done);
 }
@@ -4045,10 +4182,7 @@
                               Label* deopt) {
   __ LoadFieldFromOffset(kWord, result, mint, Mint::value_offset());
   if (deopt != NULL) {
-    __ LoadFieldFromOffset(kWord,
-                           temp,
-                           mint,
-                           Mint::value_offset() + kWordSize);
+    __ LoadFieldFromOffset(kWord, temp, mint, Mint::value_offset() + kWordSize);
     __ cmp(temp, Operand(result, ASR, kBitsPerWord - 1));
     __ b(deopt, NE);
   }
@@ -4062,8 +4196,8 @@
   ASSERT((representation() != kUnboxedUint32) || is_truncating());
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = CanDeoptimize() ? 1 : 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   if (kNumTemps > 0) {
     summary->set_temp(0, Location::RequiresRegister());
@@ -4078,8 +4212,10 @@
   const Register value = locs()->in(0).reg();
   const Register out = locs()->out(0).reg();
   const Register temp = CanDeoptimize() ? locs()->temp(0).reg() : kNoRegister;
-  Label* deopt = CanDeoptimize() ?
-        compiler->AddDeoptStub(GetDeoptId(), ICData::kDeoptUnboxInteger) : NULL;
+  Label* deopt =
+      CanDeoptimize()
+          ? compiler->AddDeoptStub(GetDeoptId(), ICData::kDeoptUnboxInteger)
+          : NULL;
   Label* out_of_range = !is_truncating() ? deopt : NULL;
   ASSERT(value != out);
 
@@ -4107,8 +4243,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
@@ -4121,11 +4257,93 @@
   const DRegister right = EvenDRegisterOf(locs()->in(1).fpu_reg());
   const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg());
   switch (op_kind()) {
-    case Token::kADD: __ vaddd(result, left, right); break;
-    case Token::kSUB: __ vsubd(result, left, right); break;
-    case Token::kMUL: __ vmuld(result, left, right); break;
-    case Token::kDIV: __ vdivd(result, left, right); break;
-    default: UNREACHABLE();
+    case Token::kADD:
+      __ vaddd(result, left, right);
+      break;
+    case Token::kSUB:
+      __ vsubd(result, left, right);
+      break;
+    case Token::kMUL:
+      __ vmuld(result, left, right);
+      break;
+    case Token::kDIV:
+      __ vdivd(result, left, right);
+      break;
+    default:
+      UNREACHABLE();
+  }
+}
+
+
+LocationSummary* DoubleTestOpInstr::MakeLocationSummary(Zone* zone,
+                                                        bool opt) const {
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps =
+      (op_kind() == MethodRecognizer::kDouble_getIsInfinite) ? 1 : 0;
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresFpuRegister());
+  if (op_kind() == MethodRecognizer::kDouble_getIsInfinite) {
+    summary->set_temp(0, Location::RequiresRegister());
+  }
+  summary->set_out(0, Location::RequiresRegister());
+  return summary;
+}
+
+
+Condition DoubleTestOpInstr::EmitComparisonCode(FlowGraphCompiler* compiler,
+                                                BranchLabels labels) {
+  const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg());
+  const bool is_negated = kind() != Token::kEQ;
+  if (op_kind() == MethodRecognizer::kDouble_getIsNaN) {
+    __ vcmpd(value, value);
+    __ vmstat();
+    return is_negated ? VC : VS;
+  } else {
+    ASSERT(op_kind() == MethodRecognizer::kDouble_getIsInfinite);
+    const Register temp = locs()->temp(0).reg();
+    Label done;
+    // TMP <- value[0:31], result <- value[32:63]
+    __ vmovrrd(TMP, temp, value);
+    __ cmp(TMP, Operand(0));
+    __ b(is_negated ? labels.true_label : labels.false_label, NE);
+
+    // Mask off the sign bit.
+    __ AndImmediate(temp, temp, 0x7FFFFFFF);
+    // Compare with +infinity.
+    __ CompareImmediate(temp, 0x7FF00000);
+    return is_negated ? NE : EQ;
+  }
+}
+
+void DoubleTestOpInstr::EmitBranchCode(FlowGraphCompiler* compiler,
+                                       BranchInstr* branch) {
+  ASSERT(compiler->is_optimizing());
+  BranchLabels labels = compiler->CreateBranchLabels(branch);
+  Condition true_condition = EmitComparisonCode(compiler, labels);
+  EmitBranchOnCondition(compiler, true_condition, labels);
+}
+
+
+void DoubleTestOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  ASSERT(compiler->is_optimizing());
+  Label is_true, is_false;
+  BranchLabels labels = {&is_true, &is_false, &is_false};
+  Condition true_condition = EmitComparisonCode(compiler, labels);
+  const Register result = locs()->out(0).reg();
+  if (op_kind() == MethodRecognizer::kDouble_getIsNaN) {
+    __ LoadObject(result, Bool::True(), true_condition);
+    __ LoadObject(result, Bool::False(), NegateCondition(true_condition));
+  } else {
+    ASSERT(op_kind() == MethodRecognizer::kDouble_getIsInfinite);
+    EmitBranchOnCondition(compiler, true_condition, labels);
+    Label done;
+    __ Bind(&is_false);
+    __ LoadObject(result, Bool::False());
+    __ b(&done);
+    __ Bind(&is_true);
+    __ LoadObject(result, Bool::True());
+    __ Bind(&done);
   }
 }
 
@@ -4134,8 +4352,8 @@
                                                              bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
@@ -4149,11 +4367,20 @@
   const QRegister result = locs()->out(0).fpu_reg();
 
   switch (op_kind()) {
-    case Token::kADD: __ vaddqs(result, left, right); break;
-    case Token::kSUB: __ vsubqs(result, left, right); break;
-    case Token::kMUL: __ vmulqs(result, left, right); break;
-    case Token::kDIV: __ Vdivqs(result, left, right); break;
-    default: UNREACHABLE();
+    case Token::kADD:
+      __ vaddqs(result, left, right);
+      break;
+    case Token::kSUB:
+      __ vsubqs(result, left, right);
+      break;
+    case Token::kMUL:
+      __ vmulqs(result, left, right);
+      break;
+    case Token::kDIV:
+      __ Vdivqs(result, left, right);
+      break;
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4162,8 +4389,8 @@
                                                              bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
@@ -4202,7 +4429,8 @@
       __ vdivd(result0, left0, right0);
       __ vdivd(result1, left1, right1);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4211,8 +4439,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   // Low (< Q7) Q registers are needed for the vcvtds and vmovs instructions.
   summary->set_in(0, Location::FpuRegisterLocation(Q5));
   summary->set_out(0, Location::FpuRegisterLocation(Q6));
@@ -4264,7 +4492,7 @@
         __ vdup(kWord, result, dvalue0, 1);
       } else if (mask_ == 0xAA) {
         __ vdup(kWord, result, dvalue1, 0);
-      } else  if (mask_ == 0xFF) {
+      } else if (mask_ == 0xFF) {
         __ vdup(kWord, result, dvalue1, 1);
       } else {
         // TODO(zra): Investigate better instruction sequences for other
@@ -4283,7 +4511,8 @@
         __ vmovs(sresult3, svalues[(mask_ >> 6) & 0x3]);
       }
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4292,8 +4521,8 @@
                                                               bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   // Low (< Q7) Q registers are needed for the vcvtds and vmovs instructions.
   summary->set_in(0, Location::FpuRegisterLocation(Q4));
   summary->set_in(1, Location::FpuRegisterLocation(Q5));
@@ -4340,7 +4569,8 @@
       __ vmovs(sresult2, right_svalues[(mask_ >> 4) & 0x3]);
       __ vmovs(sresult3, right_svalues[(mask_ >> 6) & 0x3]);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4349,8 +4579,8 @@
                                                                bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::FpuRegisterLocation(Q5));
   summary->set_temp(0, Location::RequiresRegister());
   summary->set_out(0, Location::RequiresRegister());
@@ -4387,11 +4617,12 @@
 
 
 LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 4;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_in(2, Location::RequiresFpuRegister());
@@ -4423,8 +4654,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
 }
@@ -4440,8 +4671,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
@@ -4466,8 +4697,8 @@
                                                                bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
@@ -4502,7 +4733,8 @@
       __ vcgeqs(result, right, left);
       break;
 
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4511,8 +4743,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
@@ -4532,7 +4764,8 @@
     case MethodRecognizer::kFloat32x4Max:
       __ vmaxqs(result, left, right);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4541,8 +4774,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   summary->set_temp(0, Location::RequiresFpuRegister());
@@ -4565,7 +4798,8 @@
     case MethodRecognizer::kFloat32x4ReciprocalSqrt:
       __ VreciprocalSqrtqs(result, left);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4574,8 +4808,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
@@ -4594,7 +4828,8 @@
       __ vdup(kWord, result, DTMP, 0);
       __ vmulqs(result, result, right);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4603,8 +4838,8 @@
                                                             bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
@@ -4622,7 +4857,8 @@
     case MethodRecognizer::kFloat32x4Absolute:
       __ vabsqs(result, left);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4631,8 +4867,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 3;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_in(2, Location::RequiresFpuRegister());
@@ -4655,8 +4891,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   // Low (< 7) Q registers are needed for the vmovs instruction.
@@ -4695,7 +4931,8 @@
     case MethodRecognizer::kFloat32x4WithW:
       __ vmovs(sresult3, STMP);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4704,8 +4941,8 @@
                                                               bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
@@ -4726,8 +4963,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
@@ -4751,7 +4988,8 @@
     case MethodRecognizer::kFloat64x2GetY:
       __ vmovd(dresult0, dvalue1);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4760,8 +4998,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
 }
@@ -4777,8 +5015,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
@@ -4802,11 +5040,12 @@
 
 
 LocationSummary* Float64x2ConstructorInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
@@ -4831,11 +5070,12 @@
 
 
 LocationSummary* Float64x2ToFloat32x4Instr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   // Low (< 7) Q registers are needed for the vcvtsd instruction.
   summary->set_out(0, Location::FpuRegisterLocation(Q6));
@@ -4862,11 +5102,12 @@
 
 
 LocationSummary* Float32x4ToFloat64x2Instr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   // Low (< 7) Q registers are needed for the vcvtsd instruction.
   summary->set_out(0, Location::FpuRegisterLocation(Q6));
@@ -4894,8 +5135,8 @@
                                                             bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
 
   if (representation() == kTagged) {
     ASSERT(op_kind() == MethodRecognizer::kFloat64x2GetSignMask);
@@ -4951,7 +5192,8 @@
       __ vsqrtd(dresult0, dvalue0);
       __ vsqrtd(dresult1, dvalue1);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4960,8 +5202,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -5024,17 +5266,18 @@
       __ Bind(&g1);
       break;
     }
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
 
-LocationSummary* Int32x4ConstructorInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+LocationSummary* Int32x4ConstructorInstr::MakeLocationSummary(Zone* zone,
+                                                              bool opt) const {
   const intptr_t kNumInputs = 4;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   summary->set_in(2, Location::RequiresRegister());
@@ -5059,11 +5302,12 @@
 
 
 LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 4;
   const intptr_t kNumTemps = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   summary->set_in(2, Location::RequiresRegister());
@@ -5106,8 +5350,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   // Low (< 7) Q registers are needed for the vmovrs instruction.
   summary->set_in(0, Location::FpuRegisterLocation(Q6));
   summary->set_out(0, Location::RequiresRegister());
@@ -5139,7 +5383,8 @@
     case MethodRecognizer::kInt32x4GetFlagW:
       __ vmovrs(result, svalue3);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 
   __ tst(result, Operand(result));
@@ -5152,8 +5397,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 3;
   const intptr_t kNumTemps = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_in(2, Location::RequiresFpuRegister());
@@ -5187,8 +5432,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
@@ -5224,7 +5469,8 @@
     case MethodRecognizer::kInt32x4WithFlagW:
       __ vmovdr(dresult1, 1, TMP);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -5233,8 +5479,8 @@
                                                               bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
@@ -5255,8 +5501,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
@@ -5269,12 +5515,23 @@
   const QRegister right = locs()->in(1).fpu_reg();
   const QRegister result = locs()->out(0).fpu_reg();
   switch (op_kind()) {
-    case Token::kBIT_AND: __ vandq(result, left, right); break;
-    case Token::kBIT_OR: __ vorrq(result, left, right); break;
-    case Token::kBIT_XOR: __ veorq(result, left, right); break;
-    case Token::kADD: __ vaddqi(kWord, result, left, right); break;
-    case Token::kSUB: __ vsubqi(kWord, result, left, right); break;
-    default: UNREACHABLE();
+    case Token::kBIT_AND:
+      __ vandq(result, left, right);
+      break;
+    case Token::kBIT_OR:
+      __ vorrq(result, left, right);
+      break;
+    case Token::kBIT_XOR:
+      __ veorq(result, left, right);
+      break;
+    case Token::kADD:
+      __ vaddqi(kWord, result, left, right);
+      break;
+    case Token::kSUB:
+      __ vsubqi(kWord, result, left, right);
+      break;
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -5285,8 +5542,8 @@
          (kind() == MathUnaryInstr::kDoubleSquare));
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
@@ -5309,10 +5566,11 @@
 
 
 LocationSummary* CaseInsensitiveCompareUC16Instr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, InputCount(), kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, InputCount(), kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(R0));
   summary->set_in(1, Location::RegisterLocation(R1));
   summary->set_in(2, Location::RegisterLocation(R2));
@@ -5324,7 +5582,6 @@
 
 void CaseInsensitiveCompareUC16Instr::EmitNativeCode(
     FlowGraphCompiler* compiler) {
-
   // Call the function.
   __ CallRuntime(TargetFunction(), TargetFunction().argument_count());
 }
@@ -5335,8 +5592,8 @@
   if (result_cid() == kDoubleCid) {
     const intptr_t kNumInputs = 2;
     const intptr_t kNumTemps = 1;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresFpuRegister());
     summary->set_in(1, Location::RequiresFpuRegister());
     // Reuse the left register so that code can be made shorter.
@@ -5347,8 +5604,8 @@
   ASSERT(result_cid() == kSmiCid);
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   // Reuse the left register so that code can be made shorter.
@@ -5420,8 +5677,8 @@
                                                       bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   // We make use of 3-operand instructions by not requiring result register
   // to be identical to first input register as on Intel.
@@ -5455,8 +5712,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
@@ -5474,8 +5731,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::RequiresRegister());
   result->set_out(0, Location::RequiresFpuRegister());
   return result;
@@ -5494,8 +5751,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::RequiresRegister());
   result->set_out(0, Location::RequiresFpuRegister());
   return result;
@@ -5527,8 +5784,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   result->set_in(0, Location::RegisterLocation(R1));
   result->set_out(0, Location::RegisterLocation(R0));
   return result;
@@ -5566,13 +5823,10 @@
   const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0));
 
   const intptr_t kNumberOfArguments = 1;
-  compiler->GenerateStaticCall(deopt_id(),
-                               instance_call()->token_pos(),
-                               target,
+  compiler->GenerateStaticCall(deopt_id(), instance_call()->token_pos(), target,
                                kNumberOfArguments,
                                Object::null_array(),  // No argument names.,
-                               locs(),
-                               ICData::Handle());
+                               locs(), ICData::Handle());
   __ Bind(&done);
 }
 
@@ -5581,8 +5835,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::RequiresFpuRegister());
   result->set_out(0, Location::RequiresRegister());
   return result;
@@ -5624,8 +5878,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   // Low (<= Q7) Q registers are needed for the conversion instructions.
   result->set_in(0, Location::RequiresFpuRegister());
   result->set_out(0, Location::FpuRegisterLocation(Q7));
@@ -5645,8 +5899,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   // Low (<= Q7) Q registers are needed for the conversion instructions.
   result->set_in(0, Location::FpuRegisterLocation(Q7));
   result->set_out(0, Location::RequiresFpuRegister());
@@ -5666,10 +5920,11 @@
                                                                bool opt) const {
   ASSERT((InputCount() == 1) || (InputCount() == 2));
   const intptr_t kNumTemps =
-      (TargetCPUFeatures::hardfp_supported()) ?
-        ((recognized_kind() == MethodRecognizer::kMathDoublePow) ? 1 : 0) : 4;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, InputCount(), kNumTemps, LocationSummary::kCall);
+      (TargetCPUFeatures::hardfp_supported())
+          ? ((recognized_kind() == MethodRecognizer::kMathDoublePow) ? 1 : 0)
+          : 4;
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, InputCount(), kNumTemps, LocationSummary::kCall);
   result->set_in(0, Location::FpuRegisterLocation(Q0));
   if (InputCount() == 2) {
     result->set_in(1, Location::FpuRegisterLocation(Q1));
@@ -5728,7 +5983,7 @@
   __ vcmpdz(exp);
   __ vmstat();
   __ b(&check_base, VS);  // NaN -> check base.
-  __ b(&skip_call, EQ);  // exp is 0.0, result is 1.0.
+  __ b(&skip_call, EQ);   // exp is 0.0, result is 1.0.
 
   // exponent == 1.0 ?
   __ vcmpd(exp, result);
@@ -5771,6 +6026,7 @@
   __ b(&skip_call, EQ);  // base is 1.0, result is 1.0.
 
   __ vcmpd(saved_base, exp);
+  __ vmstat();
   __ b(&try_sqrt, VC);  // // Neither 'exp' nor 'base' is NaN.
 
   __ Bind(&return_nan);
@@ -5785,15 +6041,18 @@
 
   // base == -Infinity -> call pow;
   __ vcmpd(saved_base, result);
+  __ vmstat();
   __ b(&do_pow, EQ);
 
   // exponent == 0.5 ?
   __ LoadDImmediate(result, 0.5, temp);
   __ vcmpd(exp, result);
+  __ vmstat();
   __ b(&do_pow, NE);
 
   // base == 0 -> return 0;
   __ vcmpdz(saved_base);
+  __ vmstat();
   __ b(&return_zero, EQ);
 
   __ vsqrtd(result, saved_base);
@@ -5854,27 +6113,27 @@
   // Only use this instruction in optimized code.
   ASSERT(opt);
   const intptr_t kNumInputs = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, 0, LocationSummary::kNoCall);
+  LocationSummary* summary =
+      new (zone) LocationSummary(zone, kNumInputs, 0, LocationSummary::kNoCall);
   if (representation() == kUnboxedDouble) {
     if (index() == 0) {
-      summary->set_in(0, Location::Pair(Location::RequiresFpuRegister(),
-                                        Location::Any()));
+      summary->set_in(
+          0, Location::Pair(Location::RequiresFpuRegister(), Location::Any()));
     } else {
       ASSERT(index() == 1);
-      summary->set_in(0, Location::Pair(Location::Any(),
-                                        Location::RequiresFpuRegister()));
+      summary->set_in(
+          0, Location::Pair(Location::Any(), Location::RequiresFpuRegister()));
     }
     summary->set_out(0, Location::RequiresFpuRegister());
   } else {
     ASSERT(representation() == kTagged);
     if (index() == 0) {
-      summary->set_in(0, Location::Pair(Location::RequiresRegister(),
-                                        Location::Any()));
+      summary->set_in(
+          0, Location::Pair(Location::RequiresRegister(), Location::Any()));
     } else {
       ASSERT(index() == 1);
-      summary->set_in(0, Location::Pair(Location::Any(),
-                                        Location::RequiresRegister()));
+      summary->set_in(
+          0, Location::Pair(Location::Any(), Location::RequiresRegister()));
     }
     summary->set_out(0, Location::RequiresRegister());
   }
@@ -5904,8 +6163,8 @@
   if (kind() == MergedMathInstr::kTruncDivMod) {
     const intptr_t kNumInputs = 2;
     const intptr_t kNumTemps = 2;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresRegister());
     summary->set_in(1, Location::RequiresRegister());
     summary->set_temp(0, Location::RequiresRegister());
@@ -5982,13 +6241,13 @@
 
 
 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   return MakeCallSummary(zone);
 }
 
 
-LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone,
-                                                  bool opt) const {
+LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   comparison()->InitializeLocationSummary(zone, opt);
   // Branches don't produce a result.
   comparison()->locs()->set_out(0, Location::NoLocation());
@@ -6006,8 +6265,8 @@
   const intptr_t kNumInputs = 1;
   const bool need_mask_temp = IsDenseSwitch() && !IsDenseMask(ComputeCidMask());
   const intptr_t kNumTemps = !IsNullCheck() ? (need_mask_temp ? 2 : 1) : 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   if (!IsNullCheck()) {
     summary->set_temp(0, Location::RequiresRegister());
@@ -6020,8 +6279,7 @@
 
 
 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  Label* deopt = compiler->AddDeoptStub(deopt_id(),
-                                        ICData::kDeoptCheckClass,
+  Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass,
                                         licm_hoisted_ ? ICData::kHoisted : 0);
   if (IsNullCheck()) {
     __ CompareObject(locs()->in(0).reg(), Object::null_object());
@@ -6063,8 +6321,7 @@
     }
   } else {
     GrowableArray<CidTarget> sorted_ic_data;
-    FlowGraphCompiler::SortICDataByCount(unary_checks(),
-                                         &sorted_ic_data,
+    FlowGraphCompiler::SortICDataByCount(unary_checks(), &sorted_ic_data,
                                          /* drop_smi = */ true);
     const intptr_t num_checks = sorted_ic_data.length();
     for (intptr_t i = 0; i < num_checks; i++) {
@@ -6086,8 +6343,8 @@
                                                     bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   return summary;
 }
@@ -6095,8 +6352,7 @@
 
 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   const Register value = locs()->in(0).reg();
-  Label* deopt = compiler->AddDeoptStub(deopt_id(),
-                                        ICData::kDeoptCheckSmi,
+  Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckSmi,
                                         licm_hoisted_ ? ICData::kHoisted : 0);
   __ BranchIfNotSmi(value, deopt);
 }
@@ -6106,8 +6362,8 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   return summary;
 }
@@ -6125,7 +6381,7 @@
                                                              bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
+  LocationSummary* locs = new (zone) LocationSummary(
       zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   locs->set_in(kLengthPos, Location::RequiresRegister());
   locs->set_in(kIndexPos, Location::RequiresRegister());
@@ -6136,7 +6392,7 @@
 class RangeErrorSlowPath : public SlowPathCode {
  public:
   RangeErrorSlowPath(GenericCheckBoundInstr* instruction, intptr_t try_index)
-      : instruction_(instruction), try_index_(try_index) { }
+      : instruction_(instruction), try_index_(try_index) {}
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     if (Assembler::EmittingComments()) {
@@ -6148,11 +6404,8 @@
     __ Push(locs->in(1).reg());
     __ CallRuntime(kRangeErrorRuntimeEntry, 2);
     compiler->pc_descriptors_list()->AddDescriptor(
-        RawPcDescriptors::kOther,
-        compiler->assembler()->CodeSize(),
-        instruction_->deopt_id(),
-        instruction_->token_pos(),
-        try_index_);
+        RawPcDescriptors::kOther, compiler->assembler()->CodeSize(),
+        instruction_->deopt_id(), instruction_->token_pos(), try_index_);
     compiler->RecordSafepoint(locs, 2);
     __ bkpt(0);
   }
@@ -6185,8 +6438,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length()));
   locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index()));
   return locs;
@@ -6196,10 +6449,8 @@
 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   uint32_t flags = generalized_ ? ICData::kGeneralized : 0;
   flags |= licm_hoisted_ ? ICData::kHoisted : 0;
-  Label* deopt = compiler->AddDeoptStub(
-      deopt_id(),
-      ICData::kDeoptCheckArrayBound,
-      flags);
+  Label* deopt =
+      compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckArrayBound, flags);
 
   Location length_loc = locs()->in(kLengthPos);
   Location index_loc = locs()->in(kIndexPos);
@@ -6249,8 +6500,8 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::Pair(Location::RequiresRegister(),
                                     Location::RequiresRegister()));
   summary->set_in(1, Location::Pair(Location::RequiresRegister(),
@@ -6288,9 +6539,9 @@
       break;
     }
     case Token::kBIT_XOR: {
-     __ eor(out_lo, left_lo, Operand(right_lo));
-     __ eor(out_hi, left_hi, Operand(right_hi));
-     break;
+      __ eor(out_lo, left_lo, Operand(right_lo));
+      __ eor(out_hi, left_hi, Operand(right_hi));
+      break;
     }
     case Token::kADD:
     case Token::kSUB: {
@@ -6329,8 +6580,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::Pair(Location::RequiresRegister(),
                                     Location::RequiresRegister()));
   summary->set_in(1, Location::WritableRegisterOrSmiConstant(right()));
@@ -6343,8 +6594,8 @@
 static const intptr_t kMintShiftCountLimit = 63;
 
 bool ShiftMintOpInstr::has_shift_count_check() const {
-  return !RangeUtils::IsWithin(
-      right()->definition()->range(), 0, kMintShiftCountLimit);
+  return !RangeUtils::IsWithin(right()->definition()->range(), 0,
+                               kMintShiftCountLimit);
 }
 
 
@@ -6474,8 +6725,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::Pair(Location::RequiresRegister(),
                                     Location::RequiresRegister()));
   summary->set_out(0, Location::Pair(Location::RequiresRegister(),
@@ -6517,8 +6768,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   summary->set_out(0, Location::RequiresRegister());
@@ -6560,8 +6811,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RegisterOrSmiConstant(right()));
   summary->set_temp(0, Location::RequiresRegister());
@@ -6630,8 +6881,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_out(0, Location::RequiresRegister());
   return summary;
@@ -6653,8 +6904,8 @@
                                                                bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   if (from() == kUnboxedMint) {
     ASSERT((to() == kUnboxedUint32) || (to() == kUnboxedInt32));
     summary->set_in(0, Location::Pair(Location::RequiresRegister(),
@@ -6725,42 +6976,33 @@
 }
 
 
-LocationSummary* ThrowInstr::MakeLocationSummary(Zone* zone,
-                                                 bool opt) const {
-  return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
+LocationSummary* ThrowInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+  return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
 }
 
 
 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kThrowRuntimeEntry,
-                                1,
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(), kThrowRuntimeEntry, 1,
                                 locs());
   __ bkpt(0);
 }
 
 
-LocationSummary* ReThrowInstr::MakeLocationSummary(Zone* zone,
-                                                   bool opt) const {
-  return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
+LocationSummary* ReThrowInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+  return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
 }
 
 
 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   compiler->SetNeedsStacktrace(catch_try_index());
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kReThrowRuntimeEntry,
-                                2,
-                                locs());
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(), kReThrowRuntimeEntry,
+                                2, locs());
   __ bkpt(0);
 }
 
 
-LocationSummary* StopInstr::MakeLocationSummary(Zone* zone,
-                                                bool opt) const {
-  return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
+LocationSummary* StopInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+  return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
 }
 
 
@@ -6776,9 +7018,8 @@
 }
 
 
-LocationSummary* GotoInstr::MakeLocationSummary(Zone* zone,
-                                                bool opt) const {
-  return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
+LocationSummary* GotoInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+  return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
 }
 
 
@@ -6789,8 +7030,7 @@
     }
     // Add a deoptimization descriptor for deoptimizing instructions that
     // may be inserted before this instruction.
-    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                                   GetDeoptId(),
+    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, GetDeoptId(),
                                    TokenPosition::kNoSource);
   }
   if (HasParallelMove()) {
@@ -6810,8 +7050,8 @@
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
 
-  LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
 
   summary->set_in(0, Location::RequiresRegister());
   summary->set_temp(0, Location::RequiresRegister());
@@ -6829,10 +7069,9 @@
   __ AddImmediate(target_address_reg, target_address_reg, -entry_to_pc_offset);
   // Add the offset.
   Register offset_reg = locs()->in(0).reg();
-  Operand offset_opr =
-      (offset()->definition()->representation() == kTagged) ?
-      Operand(offset_reg, ASR, kSmiTagSize) :
-      Operand(offset_reg);
+  Operand offset_opr = (offset()->definition()->representation() == kTagged)
+                           ? Operand(offset_reg, ASR, kSmiTagSize)
+                           : Operand(offset_reg);
   __ add(target_address_reg, target_address_reg, offset_opr);
 
   // Jump to the absolute address.
@@ -6845,15 +7084,15 @@
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
   if (needs_number_check()) {
-    LocationSummary* locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+    LocationSummary* locs = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
     locs->set_in(0, Location::RegisterLocation(R0));
     locs->set_in(1, Location::RegisterLocation(R1));
     locs->set_out(0, Location::RegisterLocation(R0));
     return locs;
   }
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
 
   // If a constant has more than one use, make sure it is loaded in register
   // so that multiple immediate loads can be avoided.
@@ -6871,8 +7110,8 @@
     // Only one of the inputs can be a constant. Choose register if the first
     // one is a constant.
     locs->set_in(1, locs->in(0).IsConstant()
-        ? Location::RequiresRegister()
-        : Location::RegisterOrConstant(right()));
+                        ? Location::RequiresRegister()
+                        : Location::RegisterOrConstant(right()));
   }
   locs->set_out(0, Location::RequiresRegister());
   return locs;
@@ -6886,20 +7125,14 @@
   ASSERT(!left.IsConstant() || !right.IsConstant());
   Condition true_condition;
   if (left.IsConstant()) {
-    true_condition = compiler->EmitEqualityRegConstCompare(right.reg(),
-                                                           left.constant(),
-                                                           needs_number_check(),
-                                                           token_pos());
+    true_condition = compiler->EmitEqualityRegConstCompare(
+        right.reg(), left.constant(), needs_number_check(), token_pos());
   } else if (right.IsConstant()) {
-    true_condition = compiler->EmitEqualityRegConstCompare(left.reg(),
-                                                           right.constant(),
-                                                           needs_number_check(),
-                                                           token_pos());
+    true_condition = compiler->EmitEqualityRegConstCompare(
+        left.reg(), right.constant(), needs_number_check(), token_pos());
   } else {
-    true_condition = compiler->EmitEqualityRegRegCompare(left.reg(),
-                                                         right.reg(),
-                                                         needs_number_check(),
-                                                         token_pos());
+    true_condition = compiler->EmitEqualityRegRegCompare(
+        left.reg(), right.reg(), needs_number_check(), token_pos());
   }
   if (kind() != Token::kEQ_STRICT) {
     ASSERT(kind() == Token::kNE_STRICT);
@@ -6913,7 +7146,7 @@
   ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT);
 
   // The ARM code does not use true- and false-labels here.
-  BranchLabels labels = { NULL, NULL, NULL };
+  BranchLabels labels = {NULL, NULL, NULL};
   Condition true_condition = EmitComparisonCode(compiler, labels);
 
   const Register result = locs()->out(0).reg();
@@ -6934,9 +7167,7 @@
 
 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Zone* zone,
                                                          bool opt) const {
-  return LocationSummary::Make(zone,
-                               1,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, 1, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -6961,9 +7192,7 @@
   const Code& stub = Code::ZoneHandle(
       compiler->zone(), StubCode::GetAllocationStubForClass(cls()));
   const StubEntry stub_entry(stub);
-  compiler->GenerateCall(token_pos(),
-                         stub_entry,
-                         RawPcDescriptors::kOther,
+  compiler->GenerateCall(token_pos(), stub_entry, RawPcDescriptors::kOther,
                          locs());
   compiler->AddStubCallTarget(stub);
   __ Drop(ArgumentCount());  // Discard arguments.
@@ -6972,17 +7201,18 @@
 
 void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   ASSERT(!compiler->is_optimizing());
-  compiler->GenerateCall(
-      token_pos(), *StubCode::DebugStepCheck_entry(), stub_kind_, locs());
+  __ BranchLinkPatchable(*StubCode::DebugStepCheck_entry());
+  compiler->AddCurrentDescriptor(stub_kind_, Thread::kNoDeoptId, token_pos());
+  compiler->RecordSafepoint(locs());
 }
 
 
-LocationSummary* GrowRegExpStackInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+LocationSummary* GrowRegExpStackInstr::MakeLocationSummary(Zone* zone,
+                                                           bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(R0));
   locs->set_out(0, Location::RegisterLocation(R0));
   return locs;
@@ -6994,11 +7224,8 @@
   const Register result = locs()->out(0).reg();
   __ PushObject(Object::null_object());
   __ Push(typed_data);
-  compiler->GenerateRuntimeCall(TokenPosition::kNoSource,
-                                deopt_id(),
-                                kGrowRegExpStackRuntimeEntry,
-                                1,
-                                locs());
+  compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(),
+                                kGrowRegExpStackRuntimeEntry, 1, locs());
   __ Drop(1);
   __ Pop(result);
 }
diff --git a/runtime/vm/intermediate_language_arm64.cc b/runtime/vm/intermediate_language_arm64.cc
index af9f56d..25a220e 100644
--- a/runtime/vm/intermediate_language_arm64.cc
+++ b/runtime/vm/intermediate_language_arm64.cc
@@ -29,8 +29,8 @@
 // Generic summary for call instructions that have all arguments pushed
 // on the stack and return the result in a fixed register R0.
 LocationSummary* Instruction::MakeCallSummary(Zone* zone) {
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, 0, 0, LocationSummary::kCall);
+  LocationSummary* result =
+      new (zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
   result->set_out(0, Location::RegisterLocation(R0));
   return result;
 }
@@ -40,8 +40,8 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::AnyOrConstant(value()));
   return locs;
 }
@@ -66,12 +66,11 @@
 }
 
 
-LocationSummary* ReturnInstr::MakeLocationSummary(Zone* zone,
-                                                  bool opt) const {
+LocationSummary* ReturnInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RegisterLocation(R0));
   return locs;
 }
@@ -113,16 +112,30 @@
 
 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;
+    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;
+    case VS:
+      return VC;
+    case VC:
+      return VS;
     default:
       UNREACHABLE();
       return EQ;
@@ -152,7 +165,7 @@
   ASSERT(!left.IsConstant() || !right.IsConstant());
 
   // Emit comparison code. This must not overwrite the result register.
-  BranchLabels labels = { NULL, NULL, NULL };
+  BranchLabels labels = {NULL, NULL, NULL};
   Condition true_condition = comparison()->EmitComparisonCode(compiler, labels);
 
   const bool is_power_of_two_kind = IsPowerOfTwoKind(if_true_, if_false_);
@@ -184,8 +197,7 @@
     __ LslImmediate(result, result, shift + kSmiTagSize);
   } else {
     __ sub(result, result, Operand(1));
-    const int64_t val =
-        Smi::RawValue(true_value) - Smi::RawValue(false_value);
+    const int64_t val = Smi::RawValue(true_value) - Smi::RawValue(false_value);
     __ AndImmediate(result, result, val);
     if (false_value != 0) {
       __ AddImmediate(result, result, Smi::RawValue(false_value));
@@ -198,8 +210,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(R0));  // Function.
   summary->set_out(0, Location::RegisterLocation(R0));
   return summary;
@@ -209,9 +221,8 @@
 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   // Load arguments descriptor in R4.
   int argument_count = ArgumentCount();
-  const Array& arguments_descriptor =
-      Array::ZoneHandle(ArgumentsDescriptor::New(argument_count,
-                                                 argument_names()));
+  const Array& arguments_descriptor = Array::ZoneHandle(
+      ArgumentsDescriptor::New(argument_count, argument_names()));
   __ LoadObject(R4, arguments_descriptor);
 
   // R4: Arguments descriptor.
@@ -235,8 +246,7 @@
   // Add deoptimization continuation point after the call and before the
   // arguments are removed.
   // In optimized code this descriptor is needed for exception handling.
-  compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                                 deopt_id_after,
+  compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after,
                                  token_pos());
   __ Drop(argument_count);
 }
@@ -244,9 +254,7 @@
 
 LocationSummary* LoadLocalInstr::MakeLocationSummary(Zone* zone,
                                                      bool opt) const {
-  return LocationSummary::Make(zone,
-                               0,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, 0, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -259,9 +267,7 @@
 
 LocationSummary* StoreLocalInstr::MakeLocationSummary(Zone* zone,
                                                       bool opt) const {
-  return LocationSummary::Make(zone,
-                               1,
-                               Location::SameAsFirstInput(),
+  return LocationSummary::Make(zone, 1, Location::SameAsFirstInput(),
                                LocationSummary::kNoCall);
 }
 
@@ -276,9 +282,7 @@
 
 LocationSummary* ConstantInstr::MakeLocationSummary(Zone* zone,
                                                     bool opt) const {
-  return LocationSummary::Make(zone,
-                               0,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, 0, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -295,12 +299,10 @@
 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Zone* zone,
                                                            bool opt) const {
   const intptr_t kNumInputs = 0;
-  const Location out = (representation_ == kUnboxedInt32) ?
-      Location::RequiresRegister() : Location::RequiresFpuRegister();
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               out,
-                               LocationSummary::kNoCall);
+  const Location out = (representation_ == kUnboxedInt32)
+                           ? Location::RequiresRegister()
+                           : Location::RequiresFpuRegister();
+  return LocationSummary::Make(zone, kNumInputs, out, LocationSummary::kNoCall);
 }
 
 
@@ -332,8 +334,8 @@
                                                             bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(R0));  // Value.
   summary->set_in(1, Location::RegisterLocation(R1));  // Type arguments.
   summary->set_out(0, Location::RegisterLocation(R0));
@@ -345,8 +347,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(R0));
   locs->set_out(0, Location::RegisterLocation(R0));
   return locs;
@@ -375,11 +377,8 @@
   }
 
   __ Push(reg);  // Push the source object.
-  compiler->GenerateRuntimeCall(token_pos,
-                                deopt_id,
-                                kNonBoolTypeErrorRuntimeEntry,
-                                1,
-                                locs);
+  compiler->GenerateRuntimeCall(token_pos, deopt_id,
+                                kNonBoolTypeErrorRuntimeEntry, 1, locs);
   // We should never return here.
   __ brk(0);
   __ Bind(&done);
@@ -397,12 +396,18 @@
 
 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;
+    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;
@@ -412,16 +417,26 @@
 
 static Condition FlipCondition(Condition condition) {
   switch (condition) {
-    case EQ: return EQ;
-    case NE: return NE;
-    case LT: return GT;
-    case LE: return GE;
-    case GT: return LT;
-    case GE: return LE;
-    case CC: return HI;
-    case LS: return CS;
-    case HI: return CC;
-    case CS: return LS;
+    case EQ:
+      return EQ;
+    case NE:
+      return NE;
+    case LT:
+      return GT;
+    case LE:
+      return GE;
+    case GT:
+      return LT;
+    case GE:
+      return LE;
+    case CC:
+      return HI;
+    case LS:
+      return CS;
+    case HI:
+      return CC;
+    case CS:
+      return LS;
     default:
       UNREACHABLE();
       return EQ;
@@ -473,9 +488,9 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 2;
   if (operation_cid() == kDoubleCid) {
-    const intptr_t kNumTemps =  0;
-    LocationSummary* locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    const intptr_t kNumTemps = 0;
+    LocationSummary* locs = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     locs->set_in(0, Location::RequiresFpuRegister());
     locs->set_in(1, Location::RequiresFpuRegister());
     locs->set_out(0, Location::RequiresRegister());
@@ -483,8 +498,8 @@
   }
   if (operation_cid() == kSmiCid) {
     const intptr_t kNumTemps = 0;
-    LocationSummary* locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* locs = new (zone)
+        LocationSummary(zone, 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.
@@ -502,12 +517,18 @@
 
 static Condition TokenKindToDoubleCondition(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;
+    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;
@@ -540,7 +561,7 @@
 void EqualityCompareInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   ASSERT((kind() == Token::kEQ) || (kind() == Token::kNE));
   Label is_true, is_false;
-  BranchLabels labels = { &is_true, &is_false, &is_false };
+  BranchLabels labels = {&is_true, &is_false, &is_false};
   Condition true_condition = EmitComparisonCode(compiler, labels);
   if ((operation_cid() == kDoubleCid) && (true_condition != NE)) {
     // Special case for NaN comparison. Result is always false unless
@@ -576,12 +597,11 @@
 }
 
 
-LocationSummary* TestSmiInstr::MakeLocationSummary(Zone* zone,
-                                                   bool opt) const {
+LocationSummary* TestSmiInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RequiresRegister());
   // Only one input can be a constant operand. The case of two constant
   // operands should be handled by constant propagation.
@@ -596,8 +616,7 @@
   Location right = locs()->in(1);
   if (right.IsConstant()) {
     ASSERT(right.constant().IsSmi());
-    const int64_t imm =
-        reinterpret_cast<int64_t>(right.constant().raw());
+    const int64_t imm = reinterpret_cast<int64_t>(right.constant().raw());
     __ TestImmediate(left, imm);
   } else {
     __ tst(left, Operand(right.reg()));
@@ -625,8 +644,8 @@
                                                     bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RequiresRegister());
   locs->set_temp(0, Location::RequiresRegister());
   locs->set_out(0, Location::RequiresRegister());
@@ -640,11 +659,11 @@
   const Register val_reg = locs()->in(0).reg();
   const Register cid_reg = locs()->temp(0).reg();
 
-  Label* deopt = CanDeoptimize()
-      ? compiler->AddDeoptStub(deopt_id(),
-                               ICData::kDeoptTestCids,
-                               licm_hoisted_ ? ICData::kHoisted : 0)
-      : NULL;
+  Label* deopt =
+      CanDeoptimize()
+          ? compiler->AddDeoptStub(deopt_id(), ICData::kDeoptTestCids,
+                                   licm_hoisted_ ? ICData::kHoisted : 0)
+          : NULL;
 
   const intptr_t true_result = (kind() == Token::kIS) ? 1 : 0;
   const ZoneGrowableArray<intptr_t>& data = cid_results();
@@ -686,7 +705,7 @@
 void TestCidsInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   const Register result_reg = locs()->out(0).reg();
   Label is_true, is_false, done;
-  BranchLabels labels = { &is_true, &is_false, &is_false };
+  BranchLabels labels = {&is_true, &is_false, &is_false};
   EmitComparisonCode(compiler, labels);
   // TODO(zra): instead of branching, use the csel instruction to get
   // True or False into result.
@@ -704,16 +723,16 @@
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
   if (operation_cid() == kDoubleCid) {
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresFpuRegister());
     summary->set_in(1, Location::RequiresFpuRegister());
     summary->set_out(0, Location::RequiresRegister());
     return summary;
   }
   ASSERT(operation_cid() == kSmiCid);
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, 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.
@@ -738,7 +757,7 @@
 
 void RelationalOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Label is_true, is_false;
-  BranchLabels labels = { &is_true, &is_false, &is_false };
+  BranchLabels labels = {&is_true, &is_false, &is_false};
   Condition true_condition = EmitComparisonCode(compiler, labels);
   if ((operation_cid() == kDoubleCid) && (true_condition != NE)) {
     // Special case for NaN comparison. Result is always false unless
@@ -786,8 +805,8 @@
   __ PushObject(Object::null_object());
   // Pass a pointer to the first argument in R2.
   if (!function().HasOptionalParameters()) {
-    __ AddImmediate(R2, FP, (kParamEndSlotFromFp +
-                             function().NumParameters()) * kWordSize);
+    __ AddImmediate(
+        R2, FP, (kParamEndSlotFromFp + function().NumParameters()) * kWordSize);
   } else {
     __ AddImmediate(R2, FP, kFirstLocalSlotFromFp * kWordSize);
   }
@@ -818,21 +837,23 @@
   __ LoadImmediate(R1, argc_tag);
   ExternalLabel label(entry);
   __ LoadNativeEntry(R5, &label);
-  compiler->GenerateCall(token_pos(),
-                         *stub_entry,
-                         RawPcDescriptors::kOther,
-                         locs());
+  if (link_lazily()) {
+    compiler->GeneratePatchableCall(token_pos(), *stub_entry,
+                                    RawPcDescriptors::kOther, locs());
+  } else {
+    compiler->GenerateCall(token_pos(), *stub_entry, RawPcDescriptors::kOther,
+                           locs());
+  }
   __ Pop(result);
 }
 
 
 LocationSummary* OneByteStringFromCharCodeInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 1;
   // TODO(fschneider): Allow immediate operands for the char code.
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -844,8 +865,8 @@
   const Register result = locs()->out(0).reg();
 
   __ ldr(result, Address(THR, Thread::predefined_symbols_address_offset()));
-  __ AddImmediate(
-      result, result, Symbols::kNullCharCodeSymbolOffset * kWordSize);
+  __ AddImmediate(result, result,
+                  Symbols::kNullCharCodeSymbolOffset * kWordSize);
   __ SmiUntag(TMP, char_code);  // Untag to use scaled adress mode.
   __ ldr(result, Address(result, TMP, UXTX, Address::Scaled));
 }
@@ -854,9 +875,7 @@
 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Zone* zone,
                                                             bool opt) const {
   const intptr_t kNumInputs = 1;
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -878,8 +897,8 @@
                                                              bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(R0));
   summary->set_out(0, Location::RegisterLocation(R0));
   return summary;
@@ -891,12 +910,8 @@
   __ Push(array);
   const int kNumberOfArguments = 1;
   const Array& kNoArgumentNames = Object::null_array();
-  compiler->GenerateStaticCall(deopt_id(),
-                               token_pos(),
-                               CallFunction(),
-                               kNumberOfArguments,
-                               kNoArgumentNames,
-                               locs(),
+  compiler->GenerateStaticCall(deopt_id(), token_pos(), CallFunction(),
+                               kNumberOfArguments, kNoArgumentNames, locs(),
                                ICData::Handle());
   ASSERT(locs()->out(0).reg() == R0);
 }
@@ -905,9 +920,7 @@
 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Zone* zone,
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -927,9 +940,7 @@
 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Zone* zone,
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -1029,13 +1040,13 @@
   }
   const int64_t index = Smi::Cast(constant->value()).AsInt64Value();
   const intptr_t scale = Instance::ElementSizeFor(cid);
-  const int64_t offset = index * scale +
+  const int64_t offset =
+      index * scale +
       (is_external ? 0 : (Instance::DataOffsetFor(cid) - kHeapObjectTag));
   if (!Utils::IsInt(32, offset)) {
     return false;
   }
-  return Address::CanHoldOffset(static_cast<int32_t>(offset),
-                                Address::Offset,
+  return Address::CanHoldOffset(static_cast<int32_t>(offset), Address::Offset,
                                 Address::OperandSizeFor(cid));
 }
 
@@ -1043,23 +1054,26 @@
 LocationSummary* LoadIndexedInstr::MakeLocationSummary(Zone* zone,
                                                        bool opt) const {
   const intptr_t kNumInputs = 2;
-  const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  const intptr_t kNumTemps = aligned() ? 0 : 1;
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RequiresRegister());
   if (CanBeImmediateIndex(index(), class_id(), IsExternal())) {
     locs->set_in(1, Location::Constant(index()->definition()->AsConstant()));
   } else {
     locs->set_in(1, Location::RequiresRegister());
   }
-  if ((representation() == kUnboxedDouble)    ||
+  if ((representation() == kUnboxedDouble) ||
       (representation() == kUnboxedFloat32x4) ||
-      (representation() == kUnboxedInt32x4)   ||
+      (representation() == kUnboxedInt32x4) ||
       (representation() == kUnboxedFloat64x2)) {
     locs->set_out(0, Location::RequiresFpuRegister());
   } else {
     locs->set_out(0, Location::RequiresRegister());
   }
+  if (!aligned()) {
+    locs->set_temp(0, Location::RequiresRegister());
+  }
   return locs;
 }
 
@@ -1068,22 +1082,39 @@
   // The array register points to the backing store for external arrays.
   const Register array = locs()->in(0).reg();
   const Location index = locs()->in(1);
+  const Register address = aligned() ? kNoRegister : locs()->temp(0).reg();
 
-  Address element_address = index.IsRegister()
-      ? __ ElementAddressForRegIndex(true,  // Load.
-                                     IsExternal(), class_id(), index_scale(),
-                                     array, index.reg())
-      : __ ElementAddressForIntIndex(
-            IsExternal(), class_id(), index_scale(),
-            array, Smi::Cast(index.constant()).Value());
-  // Warning: element_address may use register TMP as base.
+  Address element_address(TMP);  // Bad address.
+  if (aligned()) {
+    element_address =
+        index.IsRegister()
+            ? __ ElementAddressForRegIndex(true,  // Load.
+                                           IsExternal(), class_id(),
+                                           index_scale(), array, index.reg())
+            : __ ElementAddressForIntIndex(IsExternal(), class_id(),
+                                           index_scale(), array,
+                                           Smi::Cast(index.constant()).Value());
+    // Warning: element_address may use register TMP as base.
+  } else {
+    if (index.IsRegister()) {
+      __ LoadElementAddressForRegIndex(address,
+                                       true,  // Load.
+                                       IsExternal(), class_id(), index_scale(),
+                                       array, index.reg());
+    } else {
+      __ LoadElementAddressForIntIndex(address, IsExternal(), class_id(),
+                                       index_scale(), array,
+                                       Smi::Cast(index.constant()).Value());
+    }
+  }
 
-  if ((representation() == kUnboxedDouble)    ||
+  if ((representation() == kUnboxedDouble) ||
       (representation() == kUnboxedFloat32x4) ||
-      (representation() == kUnboxedInt32x4)   ||
+      (representation() == kUnboxedInt32x4) ||
       (representation() == kUnboxedFloat64x2)) {
     const VRegister result = locs()->out(0).fpu_reg();
     switch (class_id()) {
+      ASSERT(aligned());
       case kTypedDataFloat32ArrayCid:
         // Load single precision float.
         __ fldrs(result, element_address);
@@ -1109,15 +1140,23 @@
     switch (class_id()) {
       case kTypedDataInt32ArrayCid:
         ASSERT(representation() == kUnboxedInt32);
-        __ ldr(result, element_address, kWord);
+        if (aligned()) {
+          __ ldr(result, element_address, kWord);
+        } else {
+          __ LoadUnaligned(result, address, TMP, kWord);
+        }
         break;
       case kTypedDataUint32ArrayCid:
         ASSERT(representation() == kUnboxedUint32);
-        __ ldr(result, element_address, kUnsignedWord);
+        if (aligned()) {
+          __ ldr(result, element_address, kUnsignedWord);
+        } else {
+          __ LoadUnaligned(result, address, TMP, kUnsignedWord);
+        }
         break;
       default:
         UNREACHABLE();
-      }
+    }
     return;
   }
 
@@ -1140,17 +1179,26 @@
       __ SmiTag(result);
       break;
     case kTypedDataInt16ArrayCid:
-      __ ldr(result, element_address, kHalfword);
+      if (aligned()) {
+        __ ldr(result, element_address, kHalfword);
+      } else {
+        __ LoadUnaligned(result, address, TMP, kHalfword);
+      }
       __ SmiTag(result);
       break;
     case kTypedDataUint16ArrayCid:
     case kTwoByteStringCid:
     case kExternalTwoByteStringCid:
-      __ ldr(result, element_address, kUnsignedHalfword);
+      if (aligned()) {
+        __ ldr(result, element_address, kUnsignedHalfword);
+      } else {
+        __ LoadUnaligned(result, address, TMP, kUnsignedHalfword);
+      }
       __ SmiTag(result);
       break;
     default:
       ASSERT((class_id() == kArrayCid) || (class_id() == kImmutableArrayCid));
+      ASSERT(aligned());
       __ ldr(result, element_address);
       break;
   }
@@ -1161,8 +1209,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   summary->set_out(0, Location::RequiresRegister());
@@ -1176,7 +1224,7 @@
   const Location index = locs()->in(1);
 
   Address element_address = __ ElementAddressForRegIndex(
-        true,  IsExternal(), class_id(), index_scale(), str, index.reg());
+      true, IsExternal(), class_id(), index_scale(), str, index.reg());
   // Warning: element_address may use register TMP as base.
 
   Register result = locs()->out(0).reg();
@@ -1184,19 +1232,31 @@
     case kOneByteStringCid:
     case kExternalOneByteStringCid:
       switch (element_count()) {
-        case 1: __ ldr(result, element_address, kUnsignedByte); break;
-        case 2: __ ldr(result, element_address, kUnsignedHalfword); break;
-        case 4: __ ldr(result, element_address, kUnsignedWord); break;
-        default: UNREACHABLE();
+        case 1:
+          __ ldr(result, element_address, kUnsignedByte);
+          break;
+        case 2:
+          __ ldr(result, element_address, kUnsignedHalfword);
+          break;
+        case 4:
+          __ ldr(result, element_address, kUnsignedWord);
+          break;
+        default:
+          UNREACHABLE();
       }
       __ SmiTag(result);
       break;
     case kTwoByteStringCid:
     case kExternalTwoByteStringCid:
       switch (element_count()) {
-        case 1: __ ldr(result, element_address, kUnsignedHalfword); break;
-        case 2: __ ldr(result, element_address, kUnsignedWord); break;
-        default: UNREACHABLE();
+        case 1:
+          __ ldr(result, element_address, kUnsignedHalfword);
+          break;
+        case 2:
+          __ ldr(result, element_address, kUnsignedWord);
+          break;
+        default:
+          UNREACHABLE();
       }
       __ SmiTag(result);
       break;
@@ -1210,8 +1270,8 @@
 Representation StoreIndexedInstr::RequiredInputRepresentation(
     intptr_t idx) const {
   // Array can be a Dart object or a pointer to external data.
-  if (idx == 0)  return kNoRepresentation;  // Flexible input representation.
-  if (idx == 1) return kTagged;  // Index is a smi.
+  if (idx == 0) return kNoRepresentation;  // Flexible input representation.
+  if (idx == 1) return kTagged;            // Index is a smi.
   ASSERT(idx == 2);
   switch (class_id_) {
     case kArrayCid:
@@ -1247,9 +1307,9 @@
 LocationSummary* StoreIndexedInstr::MakeLocationSummary(Zone* zone,
                                                         bool opt) const {
   const intptr_t kNumInputs = 3;
-  const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  const intptr_t kNumTemps = aligned() ? 0 : 2;
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RequiresRegister());
   if (CanBeImmediateIndex(index(), class_id(), IsExternal())) {
     locs->set_in(1, Location::Constant(index()->definition()->AsConstant()));
@@ -1259,8 +1319,8 @@
   switch (class_id()) {
     case kArrayCid:
       locs->set_in(2, ShouldEmitStoreBarrier()
-                        ? Location::WritableRegister()
-                        : Location::RegisterOrConstant(value()));
+                          ? Location::WritableRegister()
+                          : Location::RegisterOrConstant(value()));
       break;
     case kExternalTypedDataUint8ArrayCid:
     case kExternalTypedDataUint8ClampedArrayCid:
@@ -1287,6 +1347,10 @@
       UNREACHABLE();
       return NULL;
   }
+  if (!aligned()) {
+    locs->set_temp(0, Location::RequiresRegister());
+    locs->set_temp(1, Location::RequiresRegister());
+  }
   return locs;
 }
 
@@ -1295,17 +1359,35 @@
   // The array register points to the backing store for external arrays.
   const Register array = locs()->in(0).reg();
   const Location index = locs()->in(1);
+  const Register address = aligned() ? kNoRegister : locs()->temp(0).reg();
+  const Register scratch = aligned() ? kNoRegister : locs()->temp(1).reg();
 
-  Address element_address = index.IsRegister()
-      ? __ ElementAddressForRegIndex(false,  // Store.
-                                     IsExternal(), class_id(), index_scale(),
-                                     array, index.reg())
-      : __ ElementAddressForIntIndex(
-            IsExternal(), class_id(), index_scale(),
-            array, Smi::Cast(index.constant()).Value());
+  Address element_address(TMP);  // Bad address.
+  if (aligned()) {
+    element_address =
+        index.IsRegister()
+            ? __ ElementAddressForRegIndex(false,  // Store.
+                                           IsExternal(), class_id(),
+                                           index_scale(), array, index.reg())
+            : __ ElementAddressForIntIndex(IsExternal(), class_id(),
+                                           index_scale(), array,
+                                           Smi::Cast(index.constant()).Value());
+  } else {
+    if (index.IsRegister()) {
+      __ LoadElementAddressForRegIndex(address,
+                                       false,  // Store.
+                                       IsExternal(), class_id(), index_scale(),
+                                       array, index.reg());
+    } else {
+      __ LoadElementAddressForIntIndex(address, IsExternal(), class_id(),
+                                       index_scale(), array,
+                                       Smi::Cast(index.constant()).Value());
+    }
+  }
 
   switch (class_id()) {
     case kArrayCid:
+      ASSERT(aligned());
       if (ShouldEmitStoreBarrier()) {
         const Register value = locs()->in(2).reg();
         __ StoreIntoObject(array, element_address, value);
@@ -1321,6 +1403,7 @@
     case kTypedDataUint8ArrayCid:
     case kExternalTypedDataUint8ArrayCid:
     case kOneByteStringCid: {
+      ASSERT(aligned());
       if (locs()->in(2).IsConstant()) {
         const Smi& constant = Smi::Cast(locs()->in(2).constant());
         __ LoadImmediate(TMP, static_cast<int8_t>(constant.Value()));
@@ -1334,6 +1417,7 @@
     }
     case kTypedDataUint8ClampedArrayCid:
     case kExternalTypedDataUint8ClampedArrayCid: {
+      ASSERT(aligned());
       if (locs()->in(2).IsConstant()) {
         const Smi& constant = Smi::Cast(locs()->in(2).constant());
         intptr_t value = constant.Value();
@@ -1349,7 +1433,7 @@
         const Register value = locs()->in(2).reg();
         __ CompareImmediate(value, 0x1FE);  // Smi value and smi 0xFF.
         // Clamp to 0x00 or 0xFF respectively.
-        __ csetm(TMP, GT);  // TMP = value > 0x1FE ? -1 : 0.
+        __ csetm(TMP, GT);             // TMP = value > 0x1FE ? -1 : 0.
         __ csel(TMP, value, TMP, LS);  // TMP = value in range ? value : TMP.
         __ SmiUntag(TMP);
         __ str(TMP, element_address, kUnsignedByte);
@@ -1360,21 +1444,31 @@
     case kTypedDataUint16ArrayCid: {
       const Register value = locs()->in(2).reg();
       __ SmiUntag(TMP, value);
-      __ str(TMP, element_address, kUnsignedHalfword);
+      if (aligned()) {
+        __ str(TMP, element_address, kUnsignedHalfword);
+      } else {
+        __ StoreUnaligned(TMP, address, scratch, kUnsignedHalfword);
+      }
       break;
     }
     case kTypedDataInt32ArrayCid:
     case kTypedDataUint32ArrayCid: {
       const Register value = locs()->in(2).reg();
-      __ str(value, element_address, kUnsignedWord);
+      if (aligned()) {
+        __ str(value, element_address, kUnsignedWord);
+      } else {
+        __ StoreUnaligned(value, address, scratch, kUnsignedWord);
+      }
       break;
     }
     case kTypedDataFloat32ArrayCid: {
+      ASSERT(aligned());
       const VRegister value_reg = locs()->in(2).fpu_reg();
       __ fstrs(value_reg, element_address);
       break;
     }
     case kTypedDataFloat64ArrayCid: {
+      ASSERT(aligned());
       const VRegister value_reg = locs()->in(2).fpu_reg();
       __ fstrd(value_reg, element_address);
       break;
@@ -1382,6 +1476,7 @@
     case kTypedDataFloat64x2ArrayCid:
     case kTypedDataInt32x4ArrayCid:
     case kTypedDataFloat32x4ArrayCid: {
+      ASSERT(aligned());
       const VRegister value_reg = locs()->in(2).fpu_reg();
       __ fstrq(value_reg, element_address);
       break;
@@ -1418,11 +1513,10 @@
   const intptr_t value_cid = value()->Type()->ToCid();
   const intptr_t field_cid = field().guarded_cid();
 
-  const bool emit_full_guard =
-      !opt || (field_cid == kIllegalCid);
+  const bool emit_full_guard = !opt || (field_cid == kIllegalCid);
 
-  const bool needs_value_cid_temp_reg = emit_full_guard ||
-      ((value_cid == kDynamicCid) && (field_cid != kSmiCid));
+  const bool needs_value_cid_temp_reg =
+      emit_full_guard || ((value_cid == kDynamicCid) && (field_cid != kSmiCid));
 
   const bool needs_field_temp_reg = emit_full_guard;
 
@@ -1434,8 +1528,8 @@
     num_temps++;
   }
 
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, num_temps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, num_temps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
 
   for (intptr_t i = 0; i < num_temps; i++) {
@@ -1455,7 +1549,8 @@
   if (field_cid == kDynamicCid) {
     if (Compiler::IsBackgroundCompilation()) {
       // Field state changed while compiling.
-      Compiler::AbortBackgroundCompilation(deopt_id(),
+      Compiler::AbortBackgroundCompilation(
+          deopt_id(),
           "GuardFieldClassInstr: field state changed while compiling");
     }
     ASSERT(!compiler->is_optimizing());
@@ -1465,31 +1560,34 @@
   const bool emit_full_guard =
       !compiler->is_optimizing() || (field_cid == kIllegalCid);
 
-  const bool needs_value_cid_temp_reg = emit_full_guard ||
-      ((value_cid == kDynamicCid) && (field_cid != kSmiCid));
+  const bool needs_value_cid_temp_reg =
+      emit_full_guard || ((value_cid == kDynamicCid) && (field_cid != kSmiCid));
 
   const bool needs_field_temp_reg = emit_full_guard;
 
   const Register value_reg = locs()->in(0).reg();
 
-  const Register value_cid_reg = needs_value_cid_temp_reg ?
-      locs()->temp(0).reg() : kNoRegister;
+  const Register value_cid_reg =
+      needs_value_cid_temp_reg ? locs()->temp(0).reg() : kNoRegister;
 
-  const Register field_reg = needs_field_temp_reg ?
-      locs()->temp(locs()->temp_count() - 1).reg() : kNoRegister;
+  const Register field_reg = needs_field_temp_reg
+                                 ? locs()->temp(locs()->temp_count() - 1).reg()
+                                 : kNoRegister;
 
   Label ok, fail_label;
 
-  Label* deopt = compiler->is_optimizing() ?
-      compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL;
+  Label* deopt =
+      compiler->is_optimizing()
+          ? compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField)
+          : NULL;
 
   Label* fail = (deopt != NULL) ? deopt : &fail_label;
 
   if (emit_full_guard) {
     __ LoadObject(field_reg, Field::ZoneHandle(field().Original()));
 
-    FieldAddress field_cid_operand(
-        field_reg, Field::guarded_cid_offset(), kUnsignedWord);
+    FieldAddress field_cid_operand(field_reg, Field::guarded_cid_offset(),
+                                   kUnsignedWord);
     FieldAddress field_nullability_operand(
         field_reg, Field::is_nullable_offset(), kUnsignedWord);
 
@@ -1543,8 +1641,8 @@
       ASSERT(!compiler->is_optimizing());
       __ Bind(fail);
 
-      __ LoadFieldFromOffset(
-          TMP, field_reg, Field::guarded_cid_offset(), kUnsignedWord);
+      __ LoadFieldFromOffset(TMP, field_reg, Field::guarded_cid_offset(),
+                             kUnsignedWord);
       __ CompareImmediate(TMP, kDynamicCid);
       __ b(&ok, EQ);
 
@@ -1589,8 +1687,8 @@
   const intptr_t kNumInputs = 1;
   if (!opt || (field().guarded_list_length() == Field::kUnknownFixedLength)) {
     const intptr_t kNumTemps = 3;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresRegister());
     // We need temporaries for field object, length offset and expected length.
     summary->set_temp(0, Location::RequiresRegister());
@@ -1598,8 +1696,8 @@
     summary->set_temp(2, Location::RequiresRegister());
     return summary;
   } else {
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, 0, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, 0, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresRegister());
     return summary;
   }
@@ -1611,15 +1709,18 @@
   if (field().guarded_list_length() == Field::kNoFixedLength) {
     if (Compiler::IsBackgroundCompilation()) {
       // Field state changed while compiling.
-      Compiler::AbortBackgroundCompilation(deopt_id(),
+      Compiler::AbortBackgroundCompilation(
+          deopt_id(),
           "GuardFieldLengthInstr: field state changed while compiling");
     }
     ASSERT(!compiler->is_optimizing());
     return;  // Nothing to emit.
   }
 
-  Label* deopt = compiler->is_optimizing() ?
-      compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL;
+  Label* deopt =
+      compiler->is_optimizing()
+          ? compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField)
+          : NULL;
 
   const Register value_reg = locs()->in(0).reg();
 
@@ -1637,8 +1738,8 @@
            FieldAddress(field_reg,
                         Field::guarded_list_length_in_object_offset_offset()),
            kByte);
-    __ ldr(length_reg, FieldAddress(field_reg,
-        Field::guarded_list_length_offset()));
+    __ ldr(length_reg,
+           FieldAddress(field_reg, Field::guarded_list_length_offset()));
 
     __ tst(offset_reg, Operand(offset_reg));
     __ b(&ok, MI);
@@ -1666,10 +1767,10 @@
     ASSERT(compiler->is_optimizing());
     ASSERT(field().guarded_list_length() >= 0);
     ASSERT(field().guarded_list_length_in_object_offset() !=
-        Field::kUnknownLengthOffset);
+           Field::kUnknownLengthOffset);
 
     __ ldr(TMP, FieldAddress(value_reg,
-                            field().guarded_list_length_in_object_offset()));
+                             field().guarded_list_length_in_object_offset()));
     __ CompareImmediate(TMP, Smi::RawValue(field().guarded_list_length()));
     __ b(deopt, NE);
   }
@@ -1681,19 +1782,16 @@
   BoxAllocationSlowPath(Instruction* instruction,
                         const Class& cls,
                         Register result)
-      : instruction_(instruction),
-        cls_(cls),
-        result_(result) { }
+      : instruction_(instruction), cls_(cls), result_(result) {}
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     if (Assembler::EmittingComments()) {
-      __ Comment("%s slow path allocation of %s",
-                 instruction_->DebugName(),
+      __ Comment("%s slow path allocation of %s", instruction_->DebugName(),
                  String::Handle(cls_.ScrubbedName()).ToCString());
     }
     __ Bind(entry_label());
-    const Code& stub = Code::ZoneHandle(compiler->zone(),
-        StubCode::GetAllocationStubForClass(cls_));
+    const Code& stub = Code::ZoneHandle(
+        compiler->zone(), StubCode::GetAllocationStubForClass(cls_));
     const StubEntry stub_entry(stub);
 
     LocationSummary* locs = instruction_->locs();
@@ -1702,9 +1800,7 @@
 
     compiler->SaveLiveRegisters(locs);
     compiler->GenerateCall(TokenPosition::kNoSource,  // No token position.
-                           stub_entry,
-                           RawPcDescriptors::kOther,
-                           locs);
+                           stub_entry, RawPcDescriptors::kOther, locs);
     compiler->AddStubCallTarget(stub);
     __ mov(result_, R0);
     compiler->RestoreLiveRegisters(locs);
@@ -1746,8 +1842,7 @@
   __ LoadFieldFromOffset(box_reg, instance_reg, offset);
   __ CompareObject(box_reg, Object::null_object());
   __ b(&done, NE);
-  BoxAllocationSlowPath::Allocate(
-      compiler, instruction, cls, box_reg, temp);
+  BoxAllocationSlowPath::Allocate(compiler, instruction, cls, box_reg, temp);
   __ mov(temp, box_reg);
   __ StoreIntoObjectOffset(instance_reg, offset, temp);
   __ Bind(&done);
@@ -1758,14 +1853,13 @@
                                                               bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps =
-      (IsUnboxedStore() && opt) ? 2 :
-          ((IsPotentialUnboxedStore()) ? 2 : 0);
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps,
-          ((IsUnboxedStore() && opt && is_initialization()) ||
-           IsPotentialUnboxedStore())
-          ? LocationSummary::kCallOnSlowPath
-          : LocationSummary::kNoCall);
+      (IsUnboxedStore() && opt) ? 2 : ((IsPotentialUnboxedStore()) ? 2 : 0);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps,
+                      ((IsUnboxedStore() && opt && is_initialization()) ||
+                       IsPotentialUnboxedStore())
+                          ? LocationSummary::kCallOnSlowPath
+                          : LocationSummary::kNoCall);
 
   summary->set_in(0, Location::RequiresRegister());
   if (IsUnboxedStore() && opt) {
@@ -1773,15 +1867,14 @@
     summary->set_temp(0, Location::RequiresRegister());
     summary->set_temp(1, Location::RequiresRegister());
   } else if (IsPotentialUnboxedStore()) {
-      summary->set_in(1, ShouldEmitStoreBarrier()
-          ? Location::WritableRegister()
-          :  Location::RequiresRegister());
-      summary->set_temp(0, Location::RequiresRegister());
-      summary->set_temp(1, Location::RequiresRegister());
+    summary->set_in(1, ShouldEmitStoreBarrier() ? Location::WritableRegister()
+                                                : Location::RequiresRegister());
+    summary->set_temp(0, Location::RequiresRegister());
+    summary->set_temp(1, Location::RequiresRegister());
   } else {
     summary->set_in(1, ShouldEmitStoreBarrier()
-                       ? Location::WritableRegister()
-                       : Location::RegisterOrConstant(value()));
+                           ? Location::WritableRegister()
+                           : Location::RegisterOrConstant(value()));
   }
   return summary;
 }
@@ -1864,9 +1957,8 @@
     __ CompareImmediate(temp2, kNullCid);
     __ b(&store_pointer, EQ);
 
-    __ LoadFromOffset(
-        temp2, temp, Field::kind_bits_offset() - kHeapObjectTag,
-        kUnsignedByte);
+    __ LoadFromOffset(temp2, temp, Field::kind_bits_offset() - kHeapObjectTag,
+                      kUnsignedByte);
     __ tsti(temp2, Immediate(1 << Field::kUnboxingCandidateBit));
     __ b(&store_pointer, EQ);
 
@@ -1889,19 +1981,14 @@
     __ b(&store_pointer);
 
     if (!compiler->is_optimizing()) {
-        locs()->live_registers()->Add(locs()->in(0));
-        locs()->live_registers()->Add(locs()->in(1));
+      locs()->live_registers()->Add(locs()->in(0));
+      locs()->live_registers()->Add(locs()->in(1));
     }
 
     {
       __ Bind(&store_double);
-      EnsureMutableBox(compiler,
-                       this,
-                       temp,
-                       compiler->double_class(),
-                       instance_reg,
-                       offset_in_bytes_,
-                       temp2);
+      EnsureMutableBox(compiler, this, temp, compiler->double_class(),
+                       instance_reg, offset_in_bytes_, temp2);
       __ LoadDFieldFromOffset(VTMP, value_reg, Double::value_offset());
       __ StoreDFieldToOffset(VTMP, temp, Double::value_offset());
       __ b(&skip_store);
@@ -1909,13 +1996,8 @@
 
     {
       __ Bind(&store_float32x4);
-      EnsureMutableBox(compiler,
-                       this,
-                       temp,
-                       compiler->float32x4_class(),
-                       instance_reg,
-                       offset_in_bytes_,
-                       temp2);
+      EnsureMutableBox(compiler, this, temp, compiler->float32x4_class(),
+                       instance_reg, offset_in_bytes_, temp2);
       __ LoadQFieldFromOffset(VTMP, value_reg, Float32x4::value_offset());
       __ StoreQFieldToOffset(VTMP, temp, Float32x4::value_offset());
       __ b(&skip_store);
@@ -1923,13 +2005,8 @@
 
     {
       __ Bind(&store_float64x2);
-      EnsureMutableBox(compiler,
-                       this,
-                       temp,
-                       compiler->float64x2_class(),
-                       instance_reg,
-                       offset_in_bytes_,
-                       temp2);
+      EnsureMutableBox(compiler, this, temp, compiler->float64x2_class(),
+                       instance_reg, offset_in_bytes_, temp2);
       __ LoadQFieldFromOffset(VTMP, value_reg, Float64x2::value_offset());
       __ StoreQFieldToOffset(VTMP, temp, Float64x2::value_offset());
       __ b(&skip_store);
@@ -1940,16 +2017,16 @@
 
   if (ShouldEmitStoreBarrier()) {
     const Register value_reg = locs()->in(1).reg();
-    __ StoreIntoObjectOffset(
-        instance_reg, offset_in_bytes_, value_reg, CanValueBeSmi());
+    __ StoreIntoObjectOffset(instance_reg, offset_in_bytes_, value_reg,
+                             CanValueBeSmi());
   } else {
     if (locs()->in(1).IsConstant()) {
-      __ StoreIntoObjectOffsetNoBarrier(
-          instance_reg, offset_in_bytes_, locs()->in(1).constant());
+      __ StoreIntoObjectOffsetNoBarrier(instance_reg, offset_in_bytes_,
+                                        locs()->in(1).constant());
     } else {
       const Register value_reg = locs()->in(1).reg();
-      __ StoreIntoObjectOffsetNoBarrier(
-          instance_reg, offset_in_bytes_, value_reg);
+      __ StoreIntoObjectOffsetNoBarrier(instance_reg, offset_in_bytes_,
+                                        value_reg);
     }
   }
   __ Bind(&skip_store);
@@ -1960,8 +2037,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_out(0, Location::RequiresRegister());
   return summary;
@@ -1982,8 +2059,8 @@
 
 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Zone* zone,
                                                             bool opt) const {
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, 1, 1, LocationSummary::kNoCall);
+  LocationSummary* locs =
+      new (zone) LocationSummary(zone, 1, 1, LocationSummary::kNoCall);
   locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister()
                                               : Location::RequiresRegister());
   locs->set_temp(0, Location::RequiresRegister());
@@ -1997,11 +2074,10 @@
 
   __ LoadObject(temp, Field::ZoneHandle(Z, field().Original()));
   if (this->value()->NeedsStoreBuffer()) {
-    __ StoreIntoObjectOffset(
-        temp, Field::static_value_offset(), value, CanValueBeSmi());
+    __ StoreIntoObjectOffset(temp, Field::static_value_offset(), value,
+                             CanValueBeSmi());
   } else {
-    __ StoreIntoObjectOffsetNoBarrier(temp,
-                                      Field::static_value_offset(),
+    __ StoreIntoObjectOffsetNoBarrier(temp, Field::static_value_offset(),
                                       value);
   }
 }
@@ -2011,8 +2087,8 @@
                                                       bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(R0));
   summary->set_in(1, Location::RegisterLocation(R1));
   summary->set_out(0, Location::RegisterLocation(R0));
@@ -2024,10 +2100,7 @@
   ASSERT(locs()->in(0).reg() == R0);  // Value.
   ASSERT(locs()->in(1).reg() == R1);  // Instantiator type arguments.
 
-  compiler->GenerateInstanceOf(token_pos(),
-                               deopt_id(),
-                               type(),
-                               negate_result(),
+  compiler->GenerateInstanceOf(token_pos(), deopt_id(), type(), negate_result(),
                                locs());
   ASSERT(locs()->out(0).reg() == R0);
 }
@@ -2037,8 +2110,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(kElementTypePos, Location::RegisterLocation(R1));
   locs->set_in(kLengthPos, Location::RegisterLocation(R2));
   locs->set_out(0, Location::RegisterLocation(R0));
@@ -2048,9 +2121,9 @@
 
 // Inlines array allocation for known constant values.
 static void InlineArrayAllocation(FlowGraphCompiler* compiler,
-                                   intptr_t num_elements,
-                                   Label* slow_path,
-                                   Label* done) {
+                                  intptr_t num_elements,
+                                  Label* slow_path,
+                                  Label* done) {
   const int kInlineArraySize = 12;  // Same as kInlineInstanceSize.
   const Register kLengthReg = R2;
   const Register kElemTypeReg = R1;
@@ -2059,19 +2132,16 @@
   __ TryAllocateArray(kArrayCid, instance_size, slow_path,
                       R0,  // instance
                       R3,  // end address
-                      R6,
-                      R8);
+                      R6, R8);
   // R0: new object start as a tagged pointer.
   // R3: new object end address.
 
   // Store the type argument field.
-  __ StoreIntoObjectNoBarrier(R0,
-                              FieldAddress(R0, Array::type_arguments_offset()),
-                              kElemTypeReg);
+  __ StoreIntoObjectNoBarrier(
+      R0, FieldAddress(R0, Array::type_arguments_offset()), kElemTypeReg);
 
   // Set the length field.
-  __ StoreIntoObjectNoBarrier(R0,
-                              FieldAddress(R0, Array::length_offset()),
+  __ StoreIntoObjectNoBarrier(R0, FieldAddress(R0, Array::length_offset()),
                               kLengthReg);
 
   // TODO(zra): Use stp once added.
@@ -2114,8 +2184,7 @@
   ASSERT(locs()->in(kElementTypePos).reg() == kElemTypeReg);
   ASSERT(locs()->in(kLengthPos).reg() == kLengthReg);
 
-  if (compiler->is_optimizing() &&
-      !FLAG_precompiled_mode &&
+  if (compiler->is_optimizing() && !FLAG_precompiled_mode &&
       num_elements()->BindsToConstant() &&
       num_elements()->BoundConstant().IsSmi()) {
     const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value();
@@ -2124,13 +2193,10 @@
       InlineArrayAllocation(compiler, length, &slow_path, &done);
       __ Bind(&slow_path);
       __ PushObject(Object::null_object());  // Make room for the result.
-      __ Push(kLengthReg);  // length.
+      __ Push(kLengthReg);                   // length.
       __ Push(kElemTypeReg);
-      compiler->GenerateRuntimeCall(token_pos(),
-                                    deopt_id(),
-                                    kAllocateArrayRuntimeEntry,
-                                    2,
-                                    locs());
+      compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                    kAllocateArrayRuntimeEntry, 2, locs());
       __ Drop(2);
       __ Pop(kResultReg);
       __ Bind(&done);
@@ -2140,10 +2206,8 @@
   const Code& stub = Code::ZoneHandle(compiler->zone(),
                                       StubCode::AllocateArray_entry()->code());
   compiler->AddStubCallTarget(stub);
-  compiler->GenerateCall(token_pos(),
-                         *StubCode::AllocateArray_entry(),
-                         RawPcDescriptors::kOther,
-                         locs());
+  compiler->GenerateCall(token_pos(), *StubCode::AllocateArray_entry(),
+                         RawPcDescriptors::kOther, locs());
   ASSERT(locs()->out(0).reg() == kResultReg);
 }
 
@@ -2152,13 +2216,11 @@
                                                      bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps =
-      (IsUnboxedLoad() && opt) ? 1 :
-          ((IsPotentialUnboxedLoad()) ? 1 : 0);
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps,
-      (opt && !IsPotentialUnboxedLoad())
-          ? LocationSummary::kNoCall
-          : LocationSummary::kCallOnSlowPath);
+      (IsUnboxedLoad() && opt) ? 1 : ((IsPotentialUnboxedLoad()) ? 1 : 0);
+  LocationSummary* locs = new (zone) LocationSummary(
+      zone, kNumInputs, kNumTemps, (opt && !IsPotentialUnboxedLoad())
+                                       ? LocationSummary::kNoCall
+                                       : LocationSummary::kCallOnSlowPath);
 
   locs->set_in(0, Location::RequiresRegister());
 
@@ -2209,8 +2271,8 @@
 
     __ LoadObject(result_reg, Field::ZoneHandle(field()->Original()));
 
-    FieldAddress field_cid_operand(
-        result_reg, Field::guarded_cid_offset(), kUnsignedWord);
+    FieldAddress field_cid_operand(result_reg, Field::guarded_cid_offset(),
+                                   kUnsignedWord);
     FieldAddress field_nullability_operand(
         result_reg, Field::is_nullable_offset(), kUnsignedWord);
 
@@ -2239,11 +2301,8 @@
 
     {
       __ Bind(&load_double);
-      BoxAllocationSlowPath::Allocate(compiler,
-                                      this,
-                                      compiler->double_class(),
-                                      result_reg,
-                                      temp);
+      BoxAllocationSlowPath::Allocate(compiler, this, compiler->double_class(),
+                                      result_reg, temp);
       __ LoadFieldFromOffset(temp, instance_reg, offset_in_bytes());
       __ LoadDFieldFromOffset(VTMP, temp, Double::value_offset());
       __ StoreDFieldToOffset(VTMP, result_reg, Double::value_offset());
@@ -2252,11 +2311,8 @@
 
     {
       __ Bind(&load_float32x4);
-      BoxAllocationSlowPath::Allocate(compiler,
-                                      this,
-                                      compiler->float32x4_class(),
-                                      result_reg,
-                                      temp);
+      BoxAllocationSlowPath::Allocate(
+          compiler, this, compiler->float32x4_class(), result_reg, temp);
       __ LoadFieldFromOffset(temp, instance_reg, offset_in_bytes());
       __ LoadQFieldFromOffset(VTMP, temp, Float32x4::value_offset());
       __ StoreQFieldToOffset(VTMP, result_reg, Float32x4::value_offset());
@@ -2265,11 +2321,8 @@
 
     {
       __ Bind(&load_float64x2);
-      BoxAllocationSlowPath::Allocate(compiler,
-                                      this,
-                                      compiler->float64x2_class(),
-                                      result_reg,
-                                      temp);
+      BoxAllocationSlowPath::Allocate(
+          compiler, this, compiler->float64x2_class(), result_reg, temp);
       __ LoadFieldFromOffset(temp, instance_reg, offset_in_bytes());
       __ LoadQFieldFromOffset(VTMP, temp, Float64x2::value_offset());
       __ StoreQFieldToOffset(VTMP, result_reg, Float64x2::value_offset());
@@ -2287,8 +2340,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(R0));
   locs->set_out(0, Location::RegisterLocation(R0));
   return locs;
@@ -2304,23 +2357,21 @@
   __ PushObject(Object::null_object());  // Make room for the result.
   __ PushObject(type());
   __ Push(instantiator_reg);  // Push instantiator type arguments.
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kInstantiateTypeRuntimeEntry,
-                                2,
-                                locs());
-  __ Drop(2);  // Drop instantiator and uninstantiated type.
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                kInstantiateTypeRuntimeEntry, 2, locs());
+  __ Drop(2);          // Drop instantiator and uninstantiated type.
   __ Pop(result_reg);  // Pop instantiated type.
   ASSERT(instantiator_reg == result_reg);
 }
 
 
 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(R0));
   locs->set_out(0, Location::RegisterLocation(R0));
   return locs;
@@ -2372,12 +2423,10 @@
   __ PushObject(Object::null_object());  // Make room for the result.
   __ PushObject(type_arguments());
   __ Push(instantiator_reg);  // Push instantiator type arguments.
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kInstantiateTypeArgumentsRuntimeEntry,
-                                2,
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                kInstantiateTypeArgumentsRuntimeEntry, 2,
                                 locs());
-  __ Drop(2);  // Drop instantiator and uninstantiated type arguments.
+  __ Drop(2);          // Drop instantiator and uninstantiated type arguments.
   __ Pop(result_reg);  // Pop instantiated type arguments.
   __ Bind(&type_arguments_instantiated);
 }
@@ -2389,7 +2438,7 @@
   ASSERT(opt);
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 3;
-  LocationSummary* locs = new(zone) LocationSummary(
+  LocationSummary* locs = new (zone) LocationSummary(
       zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   locs->set_temp(0, Location::RegisterLocation(R1));
   locs->set_temp(1, Location::RegisterLocation(R2));
@@ -2403,7 +2452,7 @@
  public:
   explicit AllocateContextSlowPath(
       AllocateUninitializedContextInstr* instruction)
-      : instruction_(instruction) { }
+      : instruction_(instruction) {}
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     __ Comment("AllocateContextSlowPath");
@@ -2420,8 +2469,7 @@
     compiler->AddStubCallTarget(stub);
     compiler->GenerateCall(instruction_->token_pos(),
                            *StubCode::AllocateContext_entry(),
-                           RawPcDescriptors::kOther,
-                           locs);
+                           RawPcDescriptors::kOther, locs);
     ASSERT(instruction_->locs()->out(0).reg() == R0);
     compiler->RestoreLiveRegisters(instruction_->locs());
     __ b(exit_label());
@@ -2432,7 +2480,6 @@
 };
 
 
-
 void AllocateUninitializedContextInstr::EmitNativeCode(
     FlowGraphCompiler* compiler) {
   Register temp0 = locs()->temp(0).reg();
@@ -2446,9 +2493,7 @@
 
   __ TryAllocateArray(kContextCid, instance_size, slow_path->entry_label(),
                       result,  // instance
-                      temp0,
-                      temp1,
-                      temp2);
+                      temp0, temp1, temp2);
 
   // Setup up number of context variables field.
   __ LoadImmediate(temp0, num_context_variables());
@@ -2462,8 +2507,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 1;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_temp(0, Location::RegisterLocation(R1));
   locs->set_out(0, Location::RegisterLocation(R0));
   return locs;
@@ -2475,18 +2520,16 @@
   ASSERT(locs()->out(0).reg() == R0);
 
   __ LoadImmediate(R1, num_context_variables());
-  compiler->GenerateCall(token_pos(),
-                         *StubCode::AllocateContext_entry(),
-                         RawPcDescriptors::kOther,
-                         locs());
+  compiler->GenerateCall(token_pos(), *StubCode::AllocateContext_entry(),
+                         RawPcDescriptors::kOther, locs());
 }
 
 LocationSummary* InitStaticFieldInstr::MakeLocationSummary(Zone* zone,
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(R0));
   locs->set_temp(0, Location::RegisterLocation(R1));
   return locs;
@@ -2508,11 +2551,8 @@
   __ Bind(&call_runtime);
   __ PushObject(Object::null_object());  // Make room for (unused) result.
   __ Push(field);
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kInitStaticFieldRuntimeEntry,
-                                1,
-                                locs());
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                kInitStaticFieldRuntimeEntry, 1, locs());
   __ Drop(2);  // Remove argument and result placeholder.
   __ Bind(&no_call);
 }
@@ -2522,8 +2562,8 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(R0));
   locs->set_out(0, Location::RegisterLocation(R0));
   return locs;
@@ -2536,12 +2576,9 @@
 
   __ PushObject(Object::null_object());  // Make room for the result.
   __ Push(context_value);
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kCloneContextRuntimeEntry,
-                                1,
-                                locs());
-  __ Drop(1);  // Remove argument.
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                kCloneContextRuntimeEntry, 1, locs());
+  __ Drop(1);      // Remove argument.
   __ Pop(result);  // Get result (cloned context).
 }
 
@@ -2554,28 +2591,17 @@
 
 
 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  // Ensure space for patching return sites for lazy deopt.
-  if (!FLAG_precompiled_mode && compiler->is_optimizing()) {
-    for (intptr_t i = 0;
-      i < CallPattern::kDeoptCallLengthInInstructions;
-      ++i) {
-      __ orr(R0, ZR, Operand(R0));  // nop
-    }
-  }
   __ Bind(compiler->GetJumpLabel(this));
-  compiler->AddExceptionHandler(catch_try_index(),
-                                try_index(),
+  compiler->AddExceptionHandler(catch_try_index(), try_index(),
                                 compiler->assembler()->CodeSize(),
-                                catch_handler_types_,
-                                needs_stacktrace());
+                                catch_handler_types_, needs_stacktrace());
   // On lazy deoptimization we patch the optimized code here to enter the
   // deoptimization stub.
   const intptr_t deopt_id = Thread::ToDeoptAfter(GetDeoptId());
   if (compiler->is_optimizing()) {
     compiler->AddDeoptIndexAtCall(deopt_id);
   } else {
-    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                                   deopt_id,
+    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id,
                                    TokenPosition::kNoSource);
   }
   if (HasParallelMove()) {
@@ -2591,10 +2617,10 @@
 
   // Restore stack and initialize the two exception variables:
   // exception and stack trace variables.
-  __ StoreToOffset(kExceptionObjectReg,
-                   FP, exception_var().index() * kWordSize);
-  __ StoreToOffset(kStackTraceObjectReg,
-                   FP, stacktrace_var().index() * kWordSize);
+  __ StoreToOffset(kExceptionObjectReg, FP,
+                   exception_var().index() * kWordSize);
+  __ StoreToOffset(kStackTraceObjectReg, FP,
+                   stacktrace_var().index() * kWordSize);
 }
 
 
@@ -2602,7 +2628,7 @@
                                                               bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
+  LocationSummary* summary = new (zone) LocationSummary(
       zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   summary->set_temp(0, Location::RequiresRegister());
   return summary;
@@ -2612,7 +2638,7 @@
 class CheckStackOverflowSlowPath : public SlowPathCode {
  public:
   explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction)
-      : instruction_(instruction) { }
+      : instruction_(instruction) {}
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     if (FLAG_use_osr && osr_entry_label()->IsLinked()) {
@@ -2630,11 +2656,9 @@
     ASSERT(compiler->pending_deoptimization_env_ == NULL);
     Environment* env = compiler->SlowPathEnvironmentFor(instruction_);
     compiler->pending_deoptimization_env_ = env;
-    compiler->GenerateRuntimeCall(instruction_->token_pos(),
-                                  instruction_->deopt_id(),
-                                  kStackOverflowRuntimeEntry,
-                                  0,
-                                  instruction_->locs());
+    compiler->GenerateRuntimeCall(
+        instruction_->token_pos(), instruction_->deopt_id(),
+        kStackOverflowRuntimeEntry, 0, instruction_->locs());
 
     if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) {
       // In unoptimized code, record loop stack checks as possible OSR entries.
@@ -2675,8 +2699,7 @@
     __ LoadObject(temp, compiler->parsed_function().function());
     intptr_t threshold =
         FLAG_optimization_counter_threshold * (loop_depth() + 1);
-    __ LoadFieldFromOffset(
-        temp, temp, Function::usage_counter_offset(), kWord);
+    __ LoadFieldFromOffset(temp, temp, Function::usage_counter_offset(), kWord);
     __ CompareImmediate(temp, threshold);
     __ b(slow_path->osr_entry_label(), GE);
   }
@@ -2692,9 +2715,10 @@
   const LocationSummary& locs = *shift_left->locs();
   const Register left = locs.in(0).reg();
   const Register result = locs.out(0).reg();
-  Label* deopt = shift_left->CanDeoptimize() ?
-      compiler->AddDeoptStub(shift_left->deopt_id(), ICData::kDeoptBinarySmiOp)
-      : NULL;
+  Label* deopt = shift_left->CanDeoptimize()
+                     ? compiler->AddDeoptStub(shift_left->deopt_id(),
+                                              ICData::kDeoptBinarySmiOp)
+                     : NULL;
   if (locs.in(1).IsConstant()) {
     const Object& constant = locs.in(1).constant();
     ASSERT(constant.IsSmi());
@@ -2733,7 +2757,7 @@
           !RangeUtils::IsWithin(right_range, 0, max_right - 1);
       if (right_needs_check) {
         __ CompareImmediate(right,
-            reinterpret_cast<int64_t>(Smi::New(max_right)));
+                            reinterpret_cast<int64_t>(Smi::New(max_right)));
         __ b(deopt, CS);
       }
       __ SmiUntag(TMP, right);
@@ -2754,8 +2778,8 @@
         __ b(deopt, MI);
       }
 
-      __ CompareImmediate(
-          right, reinterpret_cast<int64_t>(Smi::New(Smi::kBits)));
+      __ CompareImmediate(right,
+                          reinterpret_cast<int64_t>(Smi::New(Smi::kBits)));
       __ csel(result, ZR, result, CS);
       __ SmiUntag(TMP, right);
       __ lslv(TMP, left, TMP);
@@ -2767,8 +2791,8 @@
   } else {
     if (right_needs_check) {
       ASSERT(shift_left->CanDeoptimize());
-      __ CompareImmediate(
-          right, reinterpret_cast<int64_t>(Smi::New(Smi::kBits)));
+      __ CompareImmediate(right,
+                          reinterpret_cast<int64_t>(Smi::New(Smi::kBits)));
       __ b(deopt, CS);
     }
     // Left is not a constant.
@@ -2789,7 +2813,7 @@
 class CheckedSmiSlowPath : public SlowPathCode {
  public:
   CheckedSmiSlowPath(CheckedSmiOpInstr* instruction, intptr_t try_index)
-      : instruction_(instruction), try_index_(try_index) { }
+      : instruction_(instruction), try_index_(try_index) {}
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     if (Assembler::EmittingComments()) {
@@ -2804,12 +2828,9 @@
     __ Push(locs->in(0).reg());
     __ Push(locs->in(1).reg());
     compiler->EmitMegamorphicInstanceCall(
-        *instruction_->call()->ic_data(),
-        instruction_->call()->ArgumentCount(),
-        instruction_->call()->deopt_id(),
-        instruction_->call()->token_pos(),
-        locs,
-        try_index_,
+        *instruction_->call()->ic_data(), instruction_->call()->ArgumentCount(),
+        instruction_->call()->deopt_id(), instruction_->call()->token_pos(),
+        locs, try_index_,
         /* slow_path_argument_count = */ 2);
     __ mov(result, R0);
     compiler->RestoreLiveRegisters(locs);
@@ -2826,7 +2847,7 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
+  LocationSummary* summary = new (zone) LocationSummary(
       zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
@@ -2888,24 +2909,31 @@
     case Token::kBIT_XOR:
       __ eor(result, left, Operand(right));
       break;
-    case Token::kEQ:
-    case Token::kLT:
-    case Token::kLTE:
-    case Token::kGT:
-    case Token::kGTE: {
-      Label true_label, false_label, done;
-      BranchLabels labels = { &true_label, &false_label, &false_label };
-      Condition true_condition =
-          EmitSmiComparisonOp(compiler, locs(), op_kind());
-      EmitBranchOnCondition(compiler, true_condition, labels);
-      __ Bind(&false_label);
-      __ LoadObject(result, Bool::False());
-      __ b(&done);
-      __ Bind(&true_label);
-      __ LoadObject(result, Bool::True());
-      __ Bind(&done);
+    case Token::kSHL:
+      ASSERT(result != left);
+      ASSERT(result != right);
+      __ CompareImmediate(right,
+                          reinterpret_cast<int64_t>(Smi::New(Smi::kBits)));
+      __ b(slow_path->entry_label(), CS);
+
+      __ SmiUntag(TMP, right);
+      __ lslv(result, left, TMP);
+      __ asrv(TMP2, result, TMP);
+      __ CompareRegisters(left, TMP2);
+      __ b(slow_path->entry_label(), NE);  // Overflow.
       break;
-    }
+    case Token::kSHR:
+      ASSERT(result != left);
+      ASSERT(result != right);
+      __ CompareImmediate(right,
+                          reinterpret_cast<int64_t>(Smi::New(Smi::kBits)));
+      __ b(slow_path->entry_label(), CS);
+
+      __ SmiUntag(result, right);
+      __ SmiUntag(TMP, left);
+      __ asrv(result, TMP, result);
+      __ SmiTag(result);
+      break;
     default:
       UNIMPLEMENTED();
   }
@@ -2913,14 +2941,141 @@
 }
 
 
+class CheckedSmiComparisonSlowPath : public SlowPathCode {
+ public:
+  CheckedSmiComparisonSlowPath(CheckedSmiComparisonInstr* instruction,
+                               intptr_t try_index,
+                               BranchLabels labels,
+                               bool merged)
+      : instruction_(instruction),
+        try_index_(try_index),
+        labels_(labels),
+        merged_(merged) {}
+
+  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
+    if (Assembler::EmittingComments()) {
+      __ Comment("slow path smi operation");
+    }
+    __ Bind(entry_label());
+    LocationSummary* locs = instruction_->locs();
+    Register result = merged_ ? locs->temp(0).reg() : locs->out(0).reg();
+    locs->live_registers()->Remove(Location::RegisterLocation(result));
+
+    compiler->SaveLiveRegisters(locs);
+    __ Push(locs->in(0).reg());
+    __ Push(locs->in(1).reg());
+    compiler->EmitMegamorphicInstanceCall(
+        *instruction_->call()->ic_data(), instruction_->call()->ArgumentCount(),
+        instruction_->call()->deopt_id(), instruction_->call()->token_pos(),
+        locs, try_index_,
+        /* slow_path_argument_count = */ 2);
+    __ mov(result, R0);
+    compiler->RestoreLiveRegisters(locs);
+    if (merged_) {
+      __ CompareObject(result, Bool::True());
+      __ b(
+          instruction_->is_negated() ? labels_.false_label : labels_.true_label,
+          EQ);
+      __ b(instruction_->is_negated() ? labels_.true_label
+                                      : labels_.false_label);
+    } else {
+      __ b(exit_label());
+    }
+  }
+
+ private:
+  CheckedSmiComparisonInstr* instruction_;
+  intptr_t try_index_;
+  BranchLabels labels_;
+  bool merged_;
+};
+
+
+LocationSummary* CheckedSmiComparisonInstr::MakeLocationSummary(
+    Zone* zone,
+    bool opt) const {
+  const intptr_t kNumInputs = 2;
+  const intptr_t kNumTemps = 1;
+  LocationSummary* summary = new (zone) LocationSummary(
+      zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
+  summary->set_in(0, Location::RequiresRegister());
+  summary->set_in(1, Location::RequiresRegister());
+  summary->set_temp(0, Location::RequiresRegister());
+  summary->set_out(0, Location::RequiresRegister());
+  return summary;
+}
+
+
+Condition CheckedSmiComparisonInstr::EmitComparisonCode(
+    FlowGraphCompiler* compiler,
+    BranchLabels labels) {
+  return EmitSmiComparisonOp(compiler, locs(), kind());
+}
+
+
+#define EMIT_SMI_CHECK                                                         \
+  Register left = locs()->in(0).reg();                                         \
+  Register right = locs()->in(1).reg();                                        \
+  Register temp = locs()->temp(0).reg();                                       \
+  intptr_t left_cid = this->left()->Type()->ToCid();                           \
+  intptr_t right_cid = this->right()->Type()->ToCid();                         \
+  if (this->left()->definition() == this->right()->definition()) {             \
+    __ tsti(left, Immediate(kSmiTagMask));                                     \
+  } else if (left_cid == kSmiCid) {                                            \
+    __ tsti(right, Immediate(kSmiTagMask));                                    \
+  } else if (right_cid == kSmiCid) {                                           \
+    __ tsti(left, Immediate(kSmiTagMask));                                     \
+  } else {                                                                     \
+    __ orr(temp, left, Operand(right));                                        \
+    __ tsti(temp, Immediate(kSmiTagMask));                                     \
+  }                                                                            \
+  __ b(slow_path->entry_label(), NE)
+
+
+void CheckedSmiComparisonInstr::EmitBranchCode(FlowGraphCompiler* compiler,
+                                               BranchInstr* branch) {
+  BranchLabels labels = compiler->CreateBranchLabels(branch);
+  CheckedSmiComparisonSlowPath* slow_path = new CheckedSmiComparisonSlowPath(
+      this, compiler->CurrentTryIndex(), labels,
+      /* merged = */ true);
+  compiler->AddSlowPathCode(slow_path);
+  EMIT_SMI_CHECK;
+  Condition true_condition = EmitComparisonCode(compiler, labels);
+  EmitBranchOnCondition(compiler, true_condition, labels);
+  __ Bind(slow_path->exit_label());
+}
+
+
+void CheckedSmiComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  Label true_label, false_label, done;
+  BranchLabels labels = {&true_label, &false_label, &false_label};
+  CheckedSmiComparisonSlowPath* slow_path = new CheckedSmiComparisonSlowPath(
+      this, compiler->CurrentTryIndex(), labels,
+      /* merged = */ false);
+  compiler->AddSlowPathCode(slow_path);
+  EMIT_SMI_CHECK;
+  Condition true_condition = EmitComparisonCode(compiler, labels);
+  EmitBranchOnCondition(compiler, true_condition, labels);
+  Register result = locs()->out(0).reg();
+  __ Bind(&false_label);
+  __ LoadObject(result, Bool::False());
+  __ b(&done);
+  __ Bind(&true_label);
+  __ LoadObject(result, Bool::True());
+  __ Bind(&done);
+  __ Bind(slow_path->exit_label());
+}
+
+
 LocationSummary* BinarySmiOpInstr::MakeLocationSummary(Zone* zone,
                                                        bool opt) const {
   const intptr_t kNumInputs = 2;
-  const intptr_t kNumTemps =
-      (((op_kind() == Token::kSHL) && can_overflow()) ||
-       (op_kind() == Token::kSHR)) ? 1 : 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  const intptr_t kNumTemps = (((op_kind() == Token::kSHL) && can_overflow()) ||
+                              (op_kind() == Token::kSHR))
+                                 ? 1
+                                 : 0;
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   if (op_kind() == Token::kTRUNCDIV) {
     summary->set_in(0, Location::RequiresRegister());
     if (RightIsPowerOfTwoConstant()) {
@@ -3036,8 +3191,8 @@
         // Asr operation masks the count to 6 bits.
         const intptr_t kCountLimit = 0x3F;
         intptr_t value = Smi::Cast(constant).Value();
-        __ AsrImmediate(
-            result, left, Utils::Minimum(value + kSmiTagSize, kCountLimit));
+        __ AsrImmediate(result, left,
+                        Utils::Minimum(value + kSmiTagSize, kCountLimit));
         __ SmiTag(result);
         break;
       }
@@ -3074,11 +3229,11 @@
       if (deopt == NULL) {
         __ mul(result, TMP, right);
       } else {
-          __ mul(result, TMP, right);
-          __ smulh(TMP, TMP, right);
-          // TMP: result bits 64..127.
-          __ cmp(TMP, Operand(result, ASR, 63));
-          __ b(deopt, NE);
+        __ mul(result, TMP, right);
+        __ smulh(TMP, TMP, right);
+        // TMP: result bits 64..127.
+        __ cmp(TMP, Operand(result, ASR, 63));
+        __ b(deopt, NE);
       }
       break;
     }
@@ -3197,8 +3352,8 @@
   ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid));
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   return summary;
@@ -3206,9 +3361,9 @@
 
 
 void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  Label* deopt = compiler->AddDeoptStub(deopt_id(),
-                                        ICData::kDeoptBinaryDoubleOp,
-                                        licm_hoisted_ ? ICData::kHoisted : 0);
+  Label* deopt =
+      compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinaryDoubleOp,
+                             licm_hoisted_ ? ICData::kHoisted : 0);
   intptr_t left_cid = left()->Type()->ToCid();
   intptr_t right_cid = right()->Type()->ToCid();
   const Register left = locs()->in(0).reg();
@@ -3227,11 +3382,10 @@
 }
 
 
-LocationSummary* BoxInstr::MakeLocationSummary(Zone* zone,
-                                               bool opt) const {
+LocationSummary* BoxInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
+  LocationSummary* summary = new (zone) LocationSummary(
       zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_temp(0, Location::RequiresRegister());
@@ -3245,12 +3399,9 @@
   const Register temp_reg = locs()->temp(0).reg();
   const VRegister value = locs()->in(0).fpu_reg();
 
-  BoxAllocationSlowPath::Allocate(
-      compiler,
-      this,
-      compiler->BoxClassFor(from_representation()),
-      out_reg,
-      temp_reg);
+  BoxAllocationSlowPath::Allocate(compiler, this,
+                                  compiler->BoxClassFor(from_representation()),
+                                  out_reg, temp_reg);
 
   switch (from_representation()) {
     case kUnboxedDouble:
@@ -3268,12 +3419,11 @@
 }
 
 
-LocationSummary* UnboxInstr::MakeLocationSummary(Zone* zone,
-                                                 bool opt) const {
+LocationSummary* UnboxInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
@@ -3343,8 +3493,8 @@
     EmitSmiConversion(compiler);
   } else {
     const Register box = locs()->in(0).reg();
-    Label* deopt = compiler->AddDeoptStub(GetDeoptId(),
-                                          ICData::kDeoptCheckClass);
+    Label* deopt =
+        compiler->AddDeoptStub(GetDeoptId(), ICData::kDeoptCheckClass);
     Label is_smi;
 
     if ((value()->Type()->ToNullableCid() == box_cid) &&
@@ -3377,11 +3527,8 @@
          (from_representation() == kUnboxedUint32));
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone,
-      kNumInputs,
-      kNumTemps,
-      LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_out(0, Location::RequiresRegister());
   return summary;
@@ -3412,8 +3559,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_out(0, Location::RequiresRegister());
   return summary;
@@ -3424,8 +3571,10 @@
   const intptr_t value_cid = value()->Type()->ToCid();
   const Register out = locs()->out(0).reg();
   const Register value = locs()->in(0).reg();
-  Label* deopt = CanDeoptimize() ?
-      compiler->AddDeoptStub(GetDeoptId(), ICData::kDeoptUnboxInteger) : NULL;
+  Label* deopt =
+      CanDeoptimize()
+          ? compiler->AddDeoptStub(GetDeoptId(), ICData::kDeoptUnboxInteger)
+          : NULL;
 
   if (value_cid == kSmiCid) {
     __ SmiUntag(out, value);
@@ -3467,8 +3616,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
@@ -3481,11 +3630,84 @@
   const VRegister right = locs()->in(1).fpu_reg();
   const VRegister result = locs()->out(0).fpu_reg();
   switch (op_kind()) {
-    case Token::kADD: __ faddd(result, left, right); break;
-    case Token::kSUB: __ fsubd(result, left, right); break;
-    case Token::kMUL: __ fmuld(result, left, right); break;
-    case Token::kDIV: __ fdivd(result, left, right); break;
-    default: UNREACHABLE();
+    case Token::kADD:
+      __ faddd(result, left, right);
+      break;
+    case Token::kSUB:
+      __ fsubd(result, left, right);
+      break;
+    case Token::kMUL:
+      __ fmuld(result, left, right);
+      break;
+    case Token::kDIV:
+      __ fdivd(result, left, right);
+      break;
+    default:
+      UNREACHABLE();
+  }
+}
+
+
+LocationSummary* DoubleTestOpInstr::MakeLocationSummary(Zone* zone,
+                                                        bool opt) const {
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps =
+      op_kind() == MethodRecognizer::kDouble_getIsInfinite ? 1 : 0;
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresFpuRegister());
+  if (op_kind() == MethodRecognizer::kDouble_getIsInfinite) {
+    summary->set_temp(0, Location::RequiresRegister());
+  }
+  summary->set_out(0, Location::RequiresRegister());
+  return summary;
+}
+
+
+Condition DoubleTestOpInstr::EmitComparisonCode(FlowGraphCompiler* compiler,
+                                                BranchLabels labels) {
+  ASSERT(compiler->is_optimizing());
+  const VRegister value = locs()->in(0).fpu_reg();
+  const bool is_negated = kind() != Token::kEQ;
+  if (op_kind() == MethodRecognizer::kDouble_getIsNaN) {
+    __ fcmpd(value, value);
+    return is_negated ? VC : VS;
+  } else {
+    ASSERT(op_kind() == MethodRecognizer::kDouble_getIsInfinite);
+    const Register temp = locs()->temp(0).reg();
+    __ vmovrd(temp, value, 0);
+    // Mask off the sign.
+    __ AndImmediate(temp, temp, 0x7FFFFFFFFFFFFFFFLL);
+    // Compare with +infinity.
+    __ CompareImmediate(temp, 0x7FF0000000000000LL);
+    return is_negated ? NE : EQ;
+  }
+}
+
+
+void DoubleTestOpInstr::EmitBranchCode(FlowGraphCompiler* compiler,
+                                       BranchInstr* branch) {
+  ASSERT(compiler->is_optimizing());
+  BranchLabels labels = compiler->CreateBranchLabels(branch);
+  Condition true_condition = EmitComparisonCode(compiler, labels);
+  EmitBranchOnCondition(compiler, true_condition, labels);
+}
+
+
+void DoubleTestOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  ASSERT(compiler->is_optimizing());
+  Label is_true, is_false;
+  BranchLabels labels = {&is_true, &is_false, &is_false};
+  Condition true_condition = EmitComparisonCode(compiler, labels);
+  const Register result = locs()->out(0).reg();
+  if (op_kind() == MethodRecognizer::kDouble_getIsNaN) {
+    __ LoadObject(result, Bool::False());
+    __ LoadObject(TMP, Bool::True());
+    __ csel(result, TMP, result, true_condition);
+  } else {
+    __ LoadObject(result, Bool::False());
+    __ LoadObject(TMP, Bool::True());
+    __ csel(result, TMP, result, true_condition);
   }
 }
 
@@ -3494,8 +3716,8 @@
                                                              bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
@@ -3509,11 +3731,20 @@
   const VRegister result = locs()->out(0).fpu_reg();
 
   switch (op_kind()) {
-    case Token::kADD: __ vadds(result, left, right); break;
-    case Token::kSUB: __ vsubs(result, left, right); break;
-    case Token::kMUL: __ vmuls(result, left, right); break;
-    case Token::kDIV: __ vdivs(result, left, right); break;
-    default: UNREACHABLE();
+    case Token::kADD:
+      __ vadds(result, left, right);
+      break;
+    case Token::kSUB:
+      __ vsubs(result, left, right);
+      break;
+    case Token::kMUL:
+      __ vmuls(result, left, right);
+      break;
+    case Token::kDIV:
+      __ vdivs(result, left, right);
+      break;
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -3522,8 +3753,8 @@
                                                              bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
@@ -3537,11 +3768,20 @@
   const VRegister result = locs()->out(0).fpu_reg();
 
   switch (op_kind()) {
-    case Token::kADD: __ vaddd(result, left, right); break;
-    case Token::kSUB: __ vsubd(result, left, right); break;
-    case Token::kMUL: __ vmuld(result, left, right); break;
-    case Token::kDIV: __ vdivd(result, left, right); break;
-    default: UNREACHABLE();
+    case Token::kADD:
+      __ vaddd(result, left, right);
+      break;
+    case Token::kSUB:
+      __ vsubd(result, left, right);
+      break;
+    case Token::kMUL:
+      __ vmuld(result, left, right);
+      break;
+    case Token::kDIV:
+      __ vdivd(result, left, right);
+      break;
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -3550,8 +3790,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+                                                 LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
@@ -3587,7 +3827,7 @@
         __ vdups(result, value, 1);
       } else if (mask_ == 0xAA) {
         __ vdups(result, value, 2);
-      } else  if (mask_ == 0xFF) {
+      } else if (mask_ == 0xFF) {
         __ vdups(result, value, 3);
       } else {
         __ vinss(result, 0, value, mask_ & 0x3);
@@ -3596,7 +3836,8 @@
         __ vinss(result, 3, value, (mask_ >> 6) & 0x3);
       }
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -3605,8 +3846,8 @@
                                                               bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+                                                 LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
@@ -3627,7 +3868,8 @@
       __ vinss(result, 2, right, (mask_ >> 4) & 0x3);
       __ vinss(result, 3, right, (mask_ >> 6) & 0x3);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -3636,8 +3878,8 @@
                                                                bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
-  LocationSummary* summary =  new LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+                                                 LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_temp(0, Location::RequiresRegister());
   summary->set_out(0, Location::RequiresRegister());
@@ -3671,11 +3913,12 @@
 
 
 LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 4;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_in(2, Location::RequiresFpuRegister());
@@ -3707,8 +3950,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
 }
@@ -3724,8 +3967,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
@@ -3748,8 +3991,8 @@
                                                                bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
@@ -3784,7 +4027,8 @@
       __ vcges(result, right, left);
       break;
 
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -3793,8 +4037,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
@@ -3814,7 +4058,8 @@
     case MethodRecognizer::kFloat32x4Max:
       __ vmaxs(result, left, right);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -3823,8 +4068,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
@@ -3845,7 +4090,8 @@
     case MethodRecognizer::kFloat32x4ReciprocalSqrt:
       __ VRSqrts(result, left);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -3854,8 +4100,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
@@ -3874,7 +4120,8 @@
       __ vdups(result, VTMP, 0);
       __ vmuls(result, result, right);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -3883,8 +4130,8 @@
                                                             bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+                                                 LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
@@ -3902,7 +4149,8 @@
     case MethodRecognizer::kFloat32x4Absolute:
       __ vabss(result, left);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -3911,8 +4159,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 3;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_in(2, Location::RequiresFpuRegister());
@@ -3935,8 +4183,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+                                                 LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
@@ -3967,7 +4215,8 @@
     case MethodRecognizer::kFloat32x4WithW:
       __ vinss(result, 3, VTMP, 0);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -3976,8 +4225,8 @@
                                                               bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+                                                 LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
@@ -3998,8 +4247,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
@@ -4017,7 +4266,8 @@
     case MethodRecognizer::kFloat64x2GetY:
       __ vinsd(result, 0, value, 1);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4026,8 +4276,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
 }
@@ -4043,8 +4293,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
@@ -4059,11 +4309,12 @@
 
 
 LocationSummary* Float64x2ConstructorInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
@@ -4081,11 +4332,12 @@
 
 
 LocationSummary* Float64x2ToFloat32x4Instr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+                                                 LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
@@ -4110,11 +4362,12 @@
 
 
 LocationSummary* Float32x4ToFloat64x2Instr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+                                                 LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
@@ -4140,8 +4393,8 @@
                                                             bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
 
   if (representation() == kTagged) {
     ASSERT(op_kind() == MethodRecognizer::kFloat64x2GetSignMask);
@@ -4185,7 +4438,8 @@
     case MethodRecognizer::kFloat64x2Sqrt:
       __ vsqrtd(result, value);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4194,8 +4448,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+                                                 LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -4226,17 +4480,18 @@
     case MethodRecognizer::kFloat64x2Max:
       __ vmaxd(out, left, right);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
 
-LocationSummary* Int32x4ConstructorInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+LocationSummary* Int32x4ConstructorInstr::MakeLocationSummary(Zone* zone,
+                                                              bool opt) const {
   const intptr_t kNumInputs = 4;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   summary->set_in(2, Location::RequiresRegister());
@@ -4261,11 +4516,12 @@
 
 
 LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 4;
   const intptr_t kNumTemps = 1;
-  LocationSummary* summary = new LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+                                                 LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   summary->set_in(2, Location::RequiresRegister());
@@ -4314,8 +4570,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+                                                 LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresRegister());
   return summary;
@@ -4339,7 +4595,8 @@
     case MethodRecognizer::kInt32x4GetFlagW:
       __ vmovrs(result, value, 3);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 
   __ tst(result, Operand(result));
@@ -4353,8 +4610,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 3;
   const intptr_t kNumTemps = 1;
-  LocationSummary* summary = new LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+                                                 LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_in(2, Location::RequiresFpuRegister());
@@ -4388,8 +4645,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+                                                 LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
@@ -4422,7 +4679,8 @@
     case MethodRecognizer::kInt32x4WithFlagW:
       __ vinsw(result, 3, TMP);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4431,8 +4689,8 @@
                                                               bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+                                                 LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
@@ -4453,8 +4711,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+                                                 LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
@@ -4467,12 +4725,23 @@
   const VRegister right = locs()->in(1).fpu_reg();
   const VRegister result = locs()->out(0).fpu_reg();
   switch (op_kind()) {
-    case Token::kBIT_AND: __ vand(result, left, right); break;
-    case Token::kBIT_OR: __ vorr(result, left, right); break;
-    case Token::kBIT_XOR: __ veor(result, left, right); break;
-    case Token::kADD: __ vaddw(result, left, right); break;
-    case Token::kSUB: __ vsubw(result, left, right); break;
-    default: UNREACHABLE();
+    case Token::kBIT_AND:
+      __ vand(result, left, right);
+      break;
+    case Token::kBIT_OR:
+      __ vorr(result, left, right);
+      break;
+    case Token::kBIT_XOR:
+      __ veor(result, left, right);
+      break;
+    case Token::kADD:
+      __ vaddw(result, left, right);
+      break;
+    case Token::kSUB:
+      __ vsubw(result, left, right);
+      break;
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4483,8 +4752,8 @@
          (kind() == MathUnaryInstr::kDoubleSquare));
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
@@ -4507,10 +4776,11 @@
 
 
 LocationSummary* CaseInsensitiveCompareUC16Instr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, InputCount(), kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, InputCount(), kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(R0));
   summary->set_in(1, Location::RegisterLocation(R1));
   summary->set_in(2, Location::RegisterLocation(R2));
@@ -4522,7 +4792,6 @@
 
 void CaseInsensitiveCompareUC16Instr::EmitNativeCode(
     FlowGraphCompiler* compiler) {
-
   // Call the function.
   __ CallRuntime(TargetFunction(), TargetFunction().argument_count());
 }
@@ -4533,8 +4802,8 @@
   if (result_cid() == kDoubleCid) {
     const intptr_t kNumInputs = 2;
     const intptr_t kNumTemps = 0;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresFpuRegister());
     summary->set_in(1, Location::RequiresFpuRegister());
     // Reuse the left register so that code can be made shorter.
@@ -4544,8 +4813,8 @@
   ASSERT(result_cid() == kSmiCid);
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   // Reuse the left register so that code can be made shorter.
@@ -4618,8 +4887,8 @@
                                                       bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   // We make use of 3-operand instructions by not requiring result register
   // to be identical to first input register as on Intel.
@@ -4653,8 +4922,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
@@ -4669,11 +4938,11 @@
 
 
 LocationSummary* Int32ToDoubleInstr::MakeLocationSummary(Zone* zone,
-                                                       bool opt) const {
+                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::RequiresRegister());
   result->set_out(0, Location::RequiresFpuRegister());
   return result;
@@ -4691,8 +4960,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::RequiresRegister());
   result->set_out(0, Location::RequiresFpuRegister());
   return result;
@@ -4723,8 +4992,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   result->set_in(0, Location::RegisterLocation(R1));
   result->set_out(0, Location::RegisterLocation(R0));
   return result;
@@ -4760,13 +5029,10 @@
   const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0));
 
   const intptr_t kNumberOfArguments = 1;
-  compiler->GenerateStaticCall(deopt_id(),
-                               instance_call()->token_pos(),
-                               target,
+  compiler->GenerateStaticCall(deopt_id(), instance_call()->token_pos(), target,
                                kNumberOfArguments,
                                Object::null_array(),  // No argument names.,
-                               locs(),
-                               ICData::Handle());
+                               locs(), ICData::Handle());
   __ Bind(&done);
 }
 
@@ -4775,8 +5041,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::RequiresFpuRegister());
   result->set_out(0, Location::RequiresRegister());
   return result;
@@ -4817,8 +5083,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::RequiresFpuRegister());
   result->set_out(0, Location::RequiresFpuRegister());
   return result;
@@ -4836,8 +5102,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::RequiresFpuRegister());
   result->set_out(0, Location::RequiresFpuRegister());
   return result;
@@ -4856,8 +5122,8 @@
   ASSERT((InputCount() == 1) || (InputCount() == 2));
   const intptr_t kNumTemps =
       (recognized_kind() == MethodRecognizer::kMathDoublePow) ? 1 : 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, InputCount(), kNumTemps, LocationSummary::kCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, InputCount(), kNumTemps, LocationSummary::kCall);
   result->set_in(0, Location::FpuRegisterLocation(V0));
   if (InputCount() == 2) {
     result->set_in(1, Location::FpuRegisterLocation(V1));
@@ -4904,7 +5170,7 @@
   // exponent == 0.0 -> return 1.0;
   __ fcmpdz(exp);
   __ b(&check_base, VS);  // NaN -> check base.
-  __ b(&skip_call, EQ);  // exp is 0.0, result is 1.0.
+  __ b(&skip_call, EQ);   // exp is 0.0, result is 1.0.
 
   // exponent == 1.0 ?
   __ fcmpd(exp, result);
@@ -4997,27 +5263,27 @@
   // Only use this instruction in optimized code.
   ASSERT(opt);
   const intptr_t kNumInputs = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, 0, LocationSummary::kNoCall);
+  LocationSummary* summary =
+      new (zone) LocationSummary(zone, kNumInputs, 0, LocationSummary::kNoCall);
   if (representation() == kUnboxedDouble) {
     if (index() == 0) {
-      summary->set_in(0, Location::Pair(Location::RequiresFpuRegister(),
-                                        Location::Any()));
+      summary->set_in(
+          0, Location::Pair(Location::RequiresFpuRegister(), Location::Any()));
     } else {
       ASSERT(index() == 1);
-      summary->set_in(0, Location::Pair(Location::Any(),
-                                        Location::RequiresFpuRegister()));
+      summary->set_in(
+          0, Location::Pair(Location::Any(), Location::RequiresFpuRegister()));
     }
     summary->set_out(0, Location::RequiresFpuRegister());
   } else {
     ASSERT(representation() == kTagged);
     if (index() == 0) {
-      summary->set_in(0, Location::Pair(Location::RequiresRegister(),
-                                        Location::Any()));
+      summary->set_in(
+          0, Location::Pair(Location::RequiresRegister(), Location::Any()));
     } else {
       ASSERT(index() == 1);
-      summary->set_in(0, Location::Pair(Location::Any(),
-                                        Location::RequiresRegister()));
+      summary->set_in(
+          0, Location::Pair(Location::Any(), Location::RequiresRegister()));
     }
     summary->set_out(0, Location::RequiresRegister());
   }
@@ -5047,8 +5313,8 @@
   if (kind() == MergedMathInstr::kTruncDivMod) {
     const intptr_t kNumInputs = 2;
     const intptr_t kNumTemps = 0;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresRegister());
     summary->set_in(1, Location::RequiresRegister());
     // Output is a pair of registers.
@@ -5103,7 +5369,7 @@
     //    }
     //  }
     Label done;
-    __ CompareRegisters(result_mod, ZR);;
+    __ CompareRegisters(result_mod, ZR);
     __ b(&done, GE);
     // Result is negative, adjust it.
     __ CompareRegisters(right, ZR);
@@ -5121,13 +5387,13 @@
 
 
 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   return MakeCallSummary(zone);
 }
 
 
-LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone,
-                                                  bool opt) const {
+LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   comparison()->InitializeLocationSummary(zone, opt);
   // Branches don't produce a result.
   comparison()->locs()->set_out(0, Location::NoLocation());
@@ -5145,8 +5411,8 @@
   const intptr_t kNumInputs = 1;
   const bool need_mask_temp = IsDenseSwitch() && !IsDenseMask(ComputeCidMask());
   const intptr_t kNumTemps = !IsNullCheck() ? (need_mask_temp ? 2 : 1) : 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   if (!IsNullCheck()) {
     summary->set_temp(0, Location::RequiresRegister());
@@ -5159,8 +5425,7 @@
 
 
 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  Label* deopt = compiler->AddDeoptStub(deopt_id(),
-                                        ICData::kDeoptCheckClass,
+  Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass,
                                         licm_hoisted_ ? ICData::kHoisted : 0);
   if (IsNullCheck()) {
     __ CompareObject(locs()->in(0).reg(), Object::null_object());
@@ -5203,8 +5468,7 @@
 
   } else {
     GrowableArray<CidTarget> sorted_ic_data;
-    FlowGraphCompiler::SortICDataByCount(unary_checks(),
-                                         &sorted_ic_data,
+    FlowGraphCompiler::SortICDataByCount(unary_checks(), &sorted_ic_data,
                                          /* drop_smi = */ true);
     const intptr_t num_checks = sorted_ic_data.length();
     for (intptr_t i = 0; i < num_checks; i++) {
@@ -5226,8 +5490,8 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   return summary;
 }
@@ -5245,8 +5509,8 @@
                                                     bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   return summary;
 }
@@ -5254,19 +5518,17 @@
 
 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   const Register value = locs()->in(0).reg();
-  Label* deopt = compiler->AddDeoptStub(deopt_id(),
-                                        ICData::kDeoptCheckSmi,
+  Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckSmi,
                                         licm_hoisted_ ? ICData::kHoisted : 0);
   __ BranchIfNotSmi(value, deopt);
 }
 
 
-
 LocationSummary* GenericCheckBoundInstr::MakeLocationSummary(Zone* zone,
                                                              bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
+  LocationSummary* locs = new (zone) LocationSummary(
       zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   locs->set_in(kLengthPos, Location::RequiresRegister());
   locs->set_in(kIndexPos, Location::RequiresRegister());
@@ -5277,7 +5539,7 @@
 class RangeErrorSlowPath : public SlowPathCode {
  public:
   RangeErrorSlowPath(GenericCheckBoundInstr* instruction, intptr_t try_index)
-      : instruction_(instruction), try_index_(try_index) { }
+      : instruction_(instruction), try_index_(try_index) {}
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     if (Assembler::EmittingComments()) {
@@ -5289,11 +5551,8 @@
     __ Push(locs->in(1).reg());
     __ CallRuntime(kRangeErrorRuntimeEntry, 2);
     compiler->pc_descriptors_list()->AddDescriptor(
-        RawPcDescriptors::kOther,
-        compiler->assembler()->CodeSize(),
-        instruction_->deopt_id(),
-        instruction_->token_pos(),
-        try_index_);
+        RawPcDescriptors::kOther, compiler->assembler()->CodeSize(),
+        instruction_->deopt_id(), instruction_->token_pos(), try_index_);
     compiler->RecordSafepoint(locs, 2);
     __ brk(0);
   }
@@ -5326,8 +5585,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length()));
   locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index()));
   return locs;
@@ -5337,10 +5596,8 @@
 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   uint32_t flags = generalized_ ? ICData::kGeneralized : 0;
   flags |= licm_hoisted_ ? ICData::kHoisted : 0;
-  Label* deopt = compiler->AddDeoptStub(
-      deopt_id(),
-      ICData::kDeoptCheckArrayBound,
-      flags);
+  Label* deopt =
+      compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckArrayBound, flags);
 
   Location length_loc = locs()->in(kLengthPos);
   Location index_loc = locs()->in(kIndexPos);
@@ -5460,8 +5717,8 @@
                                                                bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   if (from() == kUnboxedMint) {
     UNREACHABLE();
   } else if (to() == kUnboxedMint) {
@@ -5513,42 +5770,33 @@
 }
 
 
-LocationSummary* ThrowInstr::MakeLocationSummary(Zone* zone,
-                                                 bool opt) const {
-  return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
+LocationSummary* ThrowInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+  return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
 }
 
 
 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kThrowRuntimeEntry,
-                                1,
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(), kThrowRuntimeEntry, 1,
                                 locs());
   __ brk(0);
 }
 
 
-LocationSummary* ReThrowInstr::MakeLocationSummary(Zone* zone,
-                                                   bool opt) const {
-  return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
+LocationSummary* ReThrowInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+  return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
 }
 
 
 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   compiler->SetNeedsStacktrace(catch_try_index());
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kReThrowRuntimeEntry,
-                                2,
-                                locs());
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(), kReThrowRuntimeEntry,
+                                2, locs());
   __ brk(0);
 }
 
 
-LocationSummary* StopInstr::MakeLocationSummary(Zone* zone,
-                                                bool opt) const {
-  return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
+LocationSummary* StopInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+  return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
 }
 
 
@@ -5564,9 +5812,8 @@
 }
 
 
-LocationSummary* GotoInstr::MakeLocationSummary(Zone* zone,
-                                                bool opt) const {
-  return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
+LocationSummary* GotoInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+  return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
 }
 
 
@@ -5577,8 +5824,7 @@
     }
     // Add a deoptimization descriptor for deoptimizing instructions that
     // may be inserted before this instruction.
-    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                                   GetDeoptId(),
+    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, GetDeoptId(),
                                    TokenPosition::kNoSource);
   }
   if (HasParallelMove()) {
@@ -5598,8 +5844,8 @@
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
 
-  LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
 
   summary->set_in(0, Location::RequiresRegister());
   summary->set_temp(0, Location::RequiresRegister());
@@ -5622,10 +5868,9 @@
 
   // Add the offset.
   Register offset_reg = locs()->in(0).reg();
-  Operand offset_opr =
-      (offset()->definition()->representation() == kTagged) ?
-      Operand(offset_reg, ASR, kSmiTagSize) :
-      Operand(offset_reg);
+  Operand offset_opr = (offset()->definition()->representation() == kTagged)
+                           ? Operand(offset_reg, ASR, kSmiTagSize)
+                           : Operand(offset_reg);
   __ add(target_address_reg, target_address_reg, offset_opr);
 
   // Jump to the absolute address.
@@ -5638,15 +5883,15 @@
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
   if (needs_number_check()) {
-    LocationSummary* locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+    LocationSummary* locs = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
     locs->set_in(0, Location::RegisterLocation(R0));
     locs->set_in(1, Location::RegisterLocation(R1));
     locs->set_out(0, Location::RegisterLocation(R0));
     return locs;
   }
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RegisterOrConstant(left()));
   // Only one of the inputs can be a constant. Choose register if the first one
   // is a constant.
@@ -5665,20 +5910,14 @@
   ASSERT(!left.IsConstant() || !right.IsConstant());
   Condition true_condition;
   if (left.IsConstant()) {
-    true_condition = compiler->EmitEqualityRegConstCompare(right.reg(),
-                                                           left.constant(),
-                                                           needs_number_check(),
-                                                           token_pos());
+    true_condition = compiler->EmitEqualityRegConstCompare(
+        right.reg(), left.constant(), needs_number_check(), token_pos());
   } else if (right.IsConstant()) {
-    true_condition = compiler->EmitEqualityRegConstCompare(left.reg(),
-                                                           right.constant(),
-                                                           needs_number_check(),
-                                                           token_pos());
+    true_condition = compiler->EmitEqualityRegConstCompare(
+        left.reg(), right.constant(), needs_number_check(), token_pos());
   } else {
-    true_condition = compiler->EmitEqualityRegRegCompare(left.reg(),
-                                                         right.reg(),
-                                                         needs_number_check(),
-                                                         token_pos());
+    true_condition = compiler->EmitEqualityRegRegCompare(
+        left.reg(), right.reg(), needs_number_check(), token_pos());
   }
   if (kind() != Token::kEQ_STRICT) {
     ASSERT(kind() == Token::kNE_STRICT);
@@ -5693,7 +5932,7 @@
   ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT);
 
   Label is_true, is_false;
-  BranchLabels labels = { &is_true, &is_false, &is_false };
+  BranchLabels labels = {&is_true, &is_false, &is_false};
   Condition true_condition = EmitComparisonCode(compiler, labels);
   EmitBranchOnCondition(compiler, true_condition, labels);
 
@@ -5720,9 +5959,7 @@
 
 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Zone* zone,
                                                          bool opt) const {
-  return LocationSummary::Make(zone,
-                               1,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, 1, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -5748,9 +5985,7 @@
   const Code& stub = Code::ZoneHandle(
       compiler->zone(), StubCode::GetAllocationStubForClass(cls()));
   const StubEntry stub_entry(stub);
-  compiler->GenerateCall(token_pos(),
-                         stub_entry,
-                         RawPcDescriptors::kOther,
+  compiler->GenerateCall(token_pos(), stub_entry, RawPcDescriptors::kOther,
                          locs());
   compiler->AddStubCallTarget(stub);
   __ Drop(ArgumentCount());  // Discard arguments.
@@ -5759,17 +5994,18 @@
 
 void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   ASSERT(!compiler->is_optimizing());
-  compiler->GenerateCall(
-      token_pos(), *StubCode::DebugStepCheck_entry(), stub_kind_, locs());
+  __ BranchLinkPatchable(*StubCode::DebugStepCheck_entry());
+  compiler->AddCurrentDescriptor(stub_kind_, Thread::kNoDeoptId, token_pos());
+  compiler->RecordSafepoint(locs());
 }
 
 
-LocationSummary* GrowRegExpStackInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+LocationSummary* GrowRegExpStackInstr::MakeLocationSummary(Zone* zone,
+                                                           bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(R0));
   locs->set_out(0, Location::RegisterLocation(R0));
   return locs;
@@ -5781,11 +6017,8 @@
   const Register result = locs()->out(0).reg();
   __ PushObject(Object::null_object());
   __ Push(typed_data);
-  compiler->GenerateRuntimeCall(TokenPosition::kNoSource,
-                                deopt_id(),
-                                kGrowRegExpStackRuntimeEntry,
-                                1,
-                                locs());
+  compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(),
+                                kGrowRegExpStackRuntimeEntry, 1, locs());
   __ Drop(1);
   __ Pop(result);
 }
diff --git a/runtime/vm/intermediate_language_dbc.cc b/runtime/vm/intermediate_language_dbc.cc
index aca13bd..f11a372 100644
--- a/runtime/vm/intermediate_language_dbc.cc
+++ b/runtime/vm/intermediate_language_dbc.cc
@@ -43,7 +43,7 @@
   M(BinaryUint32Op)                                                            \
   M(ShiftUint32Op)                                                             \
   M(UnaryUint32Op)                                                             \
-  M(UnboxedIntConverter)                                                       \
+  M(UnboxedIntConverter)
 
 // List of instructions that are not used by DBC.
 // Things we aren't planning to implement for DBC:
@@ -92,6 +92,7 @@
   M(Float64x2ZeroArg)                                                          \
   M(Float64x2OneArg)                                                           \
   M(CheckedSmiOp)                                                              \
+  M(CheckedSmiComparison)
 
 // Location summaries actually are not used by the unoptimizing DBC compiler
 // because we don't allocate any registers.
@@ -101,11 +102,12 @@
     Location output = Location::NoLocation(),
     LocationSummary::ContainsCall contains_call = LocationSummary::kNoCall,
     intptr_t num_temps = 0) {
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, num_inputs, num_temps, contains_call);
+  LocationSummary* locs =
+      new (zone) LocationSummary(zone, num_inputs, num_temps, contains_call);
   for (intptr_t i = 0; i < num_inputs; i++) {
-    locs->set_in(i, (contains_call == LocationSummary::kNoCall) ?
-        Location::RequiresRegister() : Location::RegisterLocation(i));
+    locs->set_in(i, (contains_call == LocationSummary::kNoCall)
+                        ? Location::RequiresRegister()
+                        : Location::RegisterLocation(i));
   }
   for (intptr_t i = 0; i < num_temps; i++) {
     locs->set_temp(i, Location::RequiresRegister());
@@ -122,25 +124,25 @@
   LocationSummary* Name##Instr::MakeLocationSummary(Zone* zone, bool opt)      \
       const {                                                                  \
     return CreateLocationSummary(zone, __VA_ARGS__);                           \
-  }                                                                            \
+  }
 
 #define EMIT_NATIVE_CODE(Name, ...)                                            \
   DEFINE_MAKE_LOCATION_SUMMARY(Name, __VA_ARGS__);                             \
-  void Name##Instr::EmitNativeCode(FlowGraphCompiler* compiler)                \
+  void Name##Instr::EmitNativeCode(FlowGraphCompiler* compiler)
 
 #define DEFINE_UNIMPLEMENTED_MAKE_LOCATION_SUMMARY(Name)                       \
   LocationSummary* Name##Instr::MakeLocationSummary(Zone* zone, bool opt)      \
       const {                                                                  \
     if (!opt) UNIMPLEMENTED();                                                 \
     return NULL;                                                               \
-  }                                                                            \
+  }
 
 #define DEFINE_UNREACHABLE_MAKE_LOCATION_SUMMARY(Name)                         \
   LocationSummary* Name##Instr::MakeLocationSummary(Zone* zone, bool opt)      \
       const {                                                                  \
     UNREACHABLE();                                                             \
     return NULL;                                                               \
-  }                                                                            \
+  }
 
 #define DEFINE_UNIMPLEMENTED_EMIT_NATIVE_CODE(Name)                            \
   void Name##Instr::EmitNativeCode(FlowGraphCompiler* compiler) {              \
@@ -164,7 +166,7 @@
 
 #define DEFINE_UNIMPLEMENTED(Name)                                             \
   DEFINE_UNIMPLEMENTED_MAKE_LOCATION_SUMMARY(Name)                             \
-  DEFINE_UNIMPLEMENTED_EMIT_NATIVE_CODE(Name)                                  \
+  DEFINE_UNIMPLEMENTED_EMIT_NATIVE_CODE(Name)
 
 FOR_EACH_UNIMPLEMENTED_INSTRUCTION(DEFINE_UNIMPLEMENTED)
 
@@ -172,14 +174,20 @@
 
 #define DEFINE_UNREACHABLE(Name)                                               \
   DEFINE_UNREACHABLE_MAKE_LOCATION_SUMMARY(Name)                               \
-  DEFINE_UNREACHABLE_EMIT_NATIVE_CODE(Name)                                    \
+  DEFINE_UNREACHABLE_EMIT_NATIVE_CODE(Name)
 
 FOR_EACH_UNREACHABLE_INSTRUCTION(DEFINE_UNREACHABLE)
 
 #undef DEFINE_UNREACHABLE
 
 
-EMIT_NATIVE_CODE(InstanceOf, 2, Location::SameAsFirstInput(),
+// Only used in AOT compilation.
+DEFINE_UNIMPLEMENTED_EMIT_BRANCH_CODE(CheckedSmiComparison)
+
+
+EMIT_NATIVE_CODE(InstanceOf,
+                 2,
+                 Location::SameAsFirstInput(),
                  LocationSummary::kCall) {
   SubtypeTestCache& test_cache = SubtypeTestCache::Handle();
   if (!type().IsVoidType() && type().IsInstantiated()) {
@@ -194,33 +202,32 @@
   __ PushConstant(type());
   __ PushConstant(test_cache);
   __ InstanceOf(negate_result() ? 1 : 0);
-  compiler->RecordSafepoint(locs());
-  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther,
-                                 deopt_id(),
+  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id(),
                                  token_pos());
-
+  compiler->RecordAfterCall(this);
   if (compiler->is_optimizing()) {
     __ PopLocal(locs()->out(0).reg());
   }
 }
 
 
-DEFINE_MAKE_LOCATION_SUMMARY(AssertAssignable, 2,
+DEFINE_MAKE_LOCATION_SUMMARY(AssertAssignable,
+                             2,
                              Location::SameAsFirstInput(),
                              LocationSummary::kCall);
 
 
 EMIT_NATIVE_CODE(AssertBoolean,
-                 1, Location::SameAsFirstInput(),
+                 1,
+                 Location::SameAsFirstInput(),
                  LocationSummary::kCall) {
   if (compiler->is_optimizing()) {
     __ Push(locs()->in(0).reg());
   }
   __ AssertBoolean(Isolate::Current()->type_checks() ? 1 : 0);
-  compiler->RecordSafepoint(locs());
-  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther,
-                                 deopt_id(),
+  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id(),
                                  token_pos());
+  compiler->RecordAfterCall(this);
   if (compiler->is_optimizing()) {
     __ Drop1();
   }
@@ -228,13 +235,12 @@
 
 
 EMIT_NATIVE_CODE(PolymorphicInstanceCall,
-                 0, Location::RegisterLocation(0),
+                 0,
+                 Location::RegisterLocation(0),
                  LocationSummary::kCall) {
   ASSERT(ic_data().NumArgsTested() == 1);
-  const Array& arguments_descriptor =
-      Array::Handle(ArgumentsDescriptor::New(
-          instance_call()->ArgumentCount(),
-          instance_call()->argument_names()));
+  const Array& arguments_descriptor = Array::Handle(ArgumentsDescriptor::New(
+      instance_call()->ArgumentCount(), instance_call()->argument_names()));
   const intptr_t argdesc_kidx = __ AddConstant(arguments_descriptor);
 
   // Push the target onto the stack.
@@ -242,19 +248,18 @@
     const intptr_t may_be_smi =
         (ic_data().GetReceiverClassIdAt(0) == kSmiCid) ? 1 : 0;
     GrowableArray<CidTarget> sorted_ic_data;
-    FlowGraphCompiler::SortICDataByCount(ic_data(),
-                                         &sorted_ic_data,
+    FlowGraphCompiler::SortICDataByCount(ic_data(), &sorted_ic_data,
                                          /* drop_smi = */ true);
     const intptr_t sorted_length = sorted_ic_data.length();
     if (!Utils::IsUint(8, sorted_length)) {
       Unsupported(compiler);
       UNREACHABLE();
     }
-    __ PushPolymorphicInstanceCall(
-        instance_call()->ArgumentCount(), sorted_length + may_be_smi);
+    __ PushPolymorphicInstanceCall(instance_call()->ArgumentCount(),
+                                   sorted_length + may_be_smi);
     if (may_be_smi == 1) {
-      const Function& target = Function::ZoneHandle(
-          compiler->zone(), ic_data().GetTargetAt(0));
+      const Function& target =
+          Function::ZoneHandle(compiler->zone(), ic_data().GetTargetAt(0));
       __ Nop(compiler->ToEmbeddableCid(kSmiCid, this));
       __ Nop(__ AddConstant(target));
     }
@@ -263,8 +268,8 @@
       __ Nop(compiler->ToEmbeddableCid(sorted_ic_data[i].cid, this));
       __ Nop(__ AddConstant(target));
     }
-    compiler->EmitDeopt(
-        deopt_id(), ICData::kDeoptPolymorphicInstanceCallTestFail, 0);
+    compiler->EmitDeopt(deopt_id(),
+                        ICData::kDeoptPolymorphicInstanceCallTestFail, 0);
   } else {
     ASSERT(ic_data().HasOneTarget());
     const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0));
@@ -273,8 +278,8 @@
 
   // Call the function.
   __ StaticCall(instance_call()->ArgumentCount(), argdesc_kidx);
-  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther,
-      deopt_id(), instance_call()->token_pos());
+  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id(),
+                                 instance_call()->token_pos());
   compiler->RecordAfterCall(this);
   __ PopLocal(locs()->out(0).reg());
 }
@@ -286,11 +291,11 @@
 
 
 EMIT_NATIVE_CODE(CheckStackOverflow,
-                 0, Location::NoLocation(),
+                 0,
+                 Location::NoLocation(),
                  LocationSummary::kCall) {
   __ CheckStack();
-  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther,
-                                 deopt_id(),
+  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id(),
                                  token_pos());
   compiler->RecordAfterCall(this);
 }
@@ -314,11 +319,11 @@
   ASSERT(!compiler->is_optimizing());
   ASSERT(local().index() != 0);
   if (HasTemp()) {
-    __ StoreLocal(
-      (local().index() > 0) ? (-local().index()) : (-local().index() - 1));
+    __ StoreLocal((local().index() > 0) ? (-local().index())
+                                        : (-local().index() - 1));
   } else {
-    __ PopLocal(
-      (local().index() > 0) ? (-local().index()) : (-local().index() - 1));
+    __ PopLocal((local().index() > 0) ? (-local().index())
+                                      : (-local().index() - 1));
   }
 }
 
@@ -334,7 +339,9 @@
 
 EMIT_NATIVE_CODE(Constant, 0, Location::RequiresRegister()) {
   if (compiler->is_optimizing()) {
-    __ LoadConstant(locs()->out(0).reg(), value());
+    if (locs()->out(0).IsRegister()) {
+      __ LoadConstant(locs()->out(0).reg(), value());
+    }
   } else {
     __ PushConstant(value());
   }
@@ -369,12 +376,12 @@
 }
 
 
-LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Zone* zone,
+                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   for (intptr_t i = 0; i < kNumInputs; i++) {
     locs->set_in(i, Location::RequiresRegister());
   }
@@ -401,8 +408,7 @@
 
 EMIT_NATIVE_CODE(LoadStaticField, 1, Location::RequiresRegister()) {
   if (compiler->is_optimizing()) {
-    __ LoadField(locs()->out(0).reg(),
-                 locs()->in(0).reg(),
+    __ LoadField(locs()->out(0).reg(), locs()->in(0).reg(),
                  Field::static_value_offset() / kWordSize);
   } else {
     const intptr_t kidx = __ AddConstant(StaticField());
@@ -411,9 +417,17 @@
 }
 
 
-EMIT_NATIVE_CODE(InitStaticField, 0) {
-  ASSERT(!compiler->is_optimizing());
-  __ InitStaticTOS();
+EMIT_NATIVE_CODE(InitStaticField,
+                 1,
+                 Location::NoLocation(),
+                 LocationSummary::kCall) {
+  if (compiler->is_optimizing()) {
+    __ Push(locs()->in(0).reg());
+    __ InitStaticTOS();
+  } else {
+    __ InitStaticTOS();
+  }
+  compiler->RecordAfterCall(this);
 }
 
 
@@ -426,9 +440,8 @@
   }
 
   intptr_t argument_count = ArgumentCount();
-  const Array& arguments_descriptor =
-      Array::ZoneHandle(ArgumentsDescriptor::New(argument_count,
-                                                 argument_names()));
+  const Array& arguments_descriptor = Array::ZoneHandle(
+      ArgumentsDescriptor::New(argument_count, argument_names()));
   const intptr_t argdesc_kidx =
       compiler->assembler()->AddConstant(arguments_descriptor);
   __ StaticCall(argument_count, argdesc_kidx);
@@ -454,7 +467,7 @@
     }
   } else {
     ASSERT(true_condition == NEXT_IS_FALSE);
-    // NEXT_IS_FALSE indicates that the preceeing test has been flipped and
+    // NEXT_IS_FALSE indicates that the preceeding test has been flipped and
     // expects the false case to be in the subsequent instruction, which it
     // skips if the test succeeds.
     __ Jump(labels.false_label);
@@ -470,8 +483,7 @@
 
 Condition StrictCompareInstr::EmitComparisonCode(FlowGraphCompiler* compiler,
                                                  BranchLabels labels) {
-  ASSERT((kind() == Token::kNE_STRICT) ||
-         (kind() == Token::kEQ_STRICT));
+  ASSERT((kind() == Token::kNE_STRICT) || (kind() == Token::kEQ_STRICT));
 
   Token::Kind comparison;
   Condition condition;
@@ -479,34 +491,33 @@
     condition = NEXT_IS_TRUE;
     comparison = kind();
   } else {
-    // Flip comparision to save a jump.
+    // Flip comparison to save a jump.
     condition = NEXT_IS_FALSE;
-    comparison = (kind() == Token::kEQ_STRICT) ? Token::kNE_STRICT
-                                               : Token::kEQ_STRICT;
+    comparison =
+        (kind() == Token::kEQ_STRICT) ? Token::kNE_STRICT : Token::kEQ_STRICT;
   }
 
   if (!compiler->is_optimizing()) {
-    const Bytecode::Opcode eq_op = needs_number_check() ?
-        Bytecode::kIfEqStrictNumTOS : Bytecode::kIfEqStrictTOS;
-    const Bytecode::Opcode ne_op = needs_number_check() ?
-        Bytecode::kIfNeStrictNumTOS : Bytecode::kIfNeStrictTOS;
+    const Bytecode::Opcode eq_op = needs_number_check()
+                                       ? Bytecode::kIfEqStrictNumTOS
+                                       : Bytecode::kIfEqStrictTOS;
+    const Bytecode::Opcode ne_op = needs_number_check()
+                                       ? Bytecode::kIfNeStrictNumTOS
+                                       : Bytecode::kIfNeStrictTOS;
     __ Emit(comparison == Token::kEQ_STRICT ? eq_op : ne_op);
   } else {
-    const Bytecode::Opcode eq_op = needs_number_check() ?
-        Bytecode::kIfEqStrictNum : Bytecode::kIfEqStrict;
-    const Bytecode::Opcode ne_op = needs_number_check() ?
-        Bytecode::kIfNeStrictNum : Bytecode::kIfNeStrict;
-    __ Emit(Bytecode::Encode(
-        (comparison == Token::kEQ_STRICT) ? eq_op : ne_op,
-        locs()->in(0).reg(),
-        locs()->in(1).reg()));
+    const Bytecode::Opcode eq_op =
+        needs_number_check() ? Bytecode::kIfEqStrictNum : Bytecode::kIfEqStrict;
+    const Bytecode::Opcode ne_op =
+        needs_number_check() ? Bytecode::kIfNeStrictNum : Bytecode::kIfNeStrict;
+    __ Emit(Bytecode::Encode((comparison == Token::kEQ_STRICT) ? eq_op : ne_op,
+                             locs()->in(0).reg(), locs()->in(1).reg()));
   }
 
   if (needs_number_check() && token_pos().IsReal()) {
     compiler->RecordSafepoint(locs());
     compiler->AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
-                                   Thread::kNoDeoptId,
-                                   token_pos());
+                                   Thread::kNoDeoptId, token_pos());
   }
 
   return condition;
@@ -515,8 +526,7 @@
 
 void StrictCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler,
                                         BranchInstr* branch) {
-  ASSERT((kind() == Token::kEQ_STRICT) ||
-         (kind() == Token::kNE_STRICT));
+  ASSERT((kind() == Token::kEQ_STRICT) || (kind() == Token::kNE_STRICT));
 
   BranchLabels labels = compiler->CreateBranchLabels(branch);
   Condition true_condition = EmitComparisonCode(compiler, labels);
@@ -529,11 +539,10 @@
                  Location::RequiresRegister(),
                  needs_number_check() ? LocationSummary::kCall
                                       : LocationSummary::kNoCall) {
-  ASSERT((kind() == Token::kEQ_STRICT) ||
-         (kind() == Token::kNE_STRICT));
+  ASSERT((kind() == Token::kEQ_STRICT) || (kind() == Token::kNE_STRICT));
 
   Label is_true, is_false;
-  BranchLabels labels = { &is_true, &is_false, &is_false };
+  BranchLabels labels = {&is_true, &is_false, &is_false};
   Condition true_condition = EmitComparisonCode(compiler, labels);
   EmitBranchOnCondition(compiler, true_condition, labels);
   Label done;
@@ -556,8 +565,7 @@
 }
 
 
-LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone,
-                                                  bool opt) const {
+LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   comparison()->InitializeLocationSummary(zone, opt);
   if (!comparison()->HasLocs()) {
     return NULL;
@@ -577,8 +585,7 @@
   if (!compiler->is_optimizing()) {
     // Add a deoptimization descriptor for deoptimizing instructions that
     // may be inserted before this instruction.
-    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                                   GetDeoptId(),
+    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, GetDeoptId(),
                                    TokenPosition::kNoSource);
   }
   if (HasParallelMove()) {
@@ -594,8 +601,7 @@
 
 Condition TestSmiInstr::EmitComparisonCode(FlowGraphCompiler* compiler,
                                            BranchLabels labels) {
-  ASSERT((kind() == Token::kEQ) ||
-         (kind() == Token::kNE));
+  ASSERT((kind() == Token::kEQ) || (kind() == Token::kNE));
   Register left = locs()->in(0).reg();
   Register right = locs()->in(1).reg();
   __ TestSmi(left, right);
@@ -621,7 +627,7 @@
 
 
 Condition TestCidsInstr::EmitComparisonCode(FlowGraphCompiler* compiler,
-                                           BranchLabels labels) {
+                                            BranchLabels labels) {
   ASSERT((kind() == Token::kIS) || (kind() == Token::kISNOT));
   const Register value = locs()->in(0).reg();
   const intptr_t true_result = (kind() == Token::kIS) ? 1 : 0;
@@ -640,8 +646,7 @@
 
   // No match found, deoptimize or false.
   if (CanDeoptimize()) {
-    compiler->EmitDeopt(deopt_id(),
-                        ICData::kDeoptTestCids,
+    compiler->EmitDeopt(deopt_id(), ICData::kDeoptTestCids,
                         licm_hoisted_ ? ICData::kHoisted : 0);
   } else {
     Label* target = result ? labels.false_label : labels.true_label;
@@ -660,11 +665,13 @@
 }
 
 
-EMIT_NATIVE_CODE(TestCids, 1, Location::RequiresRegister(),
+EMIT_NATIVE_CODE(TestCids,
+                 1,
+                 Location::RequiresRegister(),
                  LocationSummary::kNoCall) {
   Register result_reg = locs()->out(0).reg();
   Label is_true, is_false, done;
-  BranchLabels labels = { &is_true, &is_false, &is_false };
+  BranchLabels labels = {&is_true, &is_false, &is_false};
   EmitComparisonCode(compiler, labels);
   __ Jump(&is_true);
   __ Bind(&is_false);
@@ -677,7 +684,8 @@
 
 
 EMIT_NATIVE_CODE(CreateArray,
-                 2, Location::RequiresRegister(),
+                 2,
+                 Location::RequiresRegister(),
                  LocationSummary::kCall) {
   if (compiler->is_optimizing()) {
     const Register length = locs()->in(kLengthPos).reg();
@@ -687,17 +695,20 @@
     __ Push(type_arguments);
     __ Push(length);
     __ CreateArrayTOS();
-    compiler->RecordSafepoint(locs());
+    compiler->RecordAfterCall(this);
     __ PopLocal(out);
   } else {
     __ CreateArrayTOS();
-    compiler->RecordSafepoint(locs());
+    compiler->RecordAfterCall(this);
   }
 }
 
 
-EMIT_NATIVE_CODE(StoreIndexed, 3, Location::NoLocation(),
-                 LocationSummary::kNoCall, 1) {
+EMIT_NATIVE_CODE(StoreIndexed,
+                 3,
+                 Location::NoLocation(),
+                 LocationSummary::kNoCall,
+                 1) {
   if (!compiler->is_optimizing()) {
     ASSERT(class_id() == kArrayCid);
     __ StoreIndexedTOS();
@@ -776,8 +787,11 @@
 }
 
 
-EMIT_NATIVE_CODE(LoadIndexed, 2, Location::RequiresRegister(),
-                 LocationSummary::kNoCall, 1) {
+EMIT_NATIVE_CODE(LoadIndexed,
+                 2,
+                 Location::RequiresRegister(),
+                 LocationSummary::kNoCall,
+                 1) {
   ASSERT(compiler->is_optimizing());
   const Register array = locs()->in(0).reg();
   const Register index = locs()->in(1).reg();
@@ -887,7 +901,8 @@
 
 
 EMIT_NATIVE_CODE(StringInterpolate,
-                 1, Location::RegisterLocation(0),
+                 1,
+                 Location::RegisterLocation(0),
                  LocationSummary::kCall) {
   if (compiler->is_optimizing()) {
     __ Push(locs()->in(0).reg());
@@ -906,7 +921,8 @@
 
 
 EMIT_NATIVE_CODE(NativeCall,
-                 0, Location::NoLocation(),
+                 0,
+                 Location::NoLocation(),
                  LocationSummary::kCall) {
   SetupNative();
 
@@ -926,14 +942,14 @@
     __ NativeCall();
   }
   compiler->RecordSafepoint(locs());
-  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther,
-                                 Thread::kNoDeoptId,
+  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId,
                                  token_pos());
 }
 
 
 EMIT_NATIVE_CODE(OneByteStringFromCharCode,
-                 1, Location::RequiresRegister(),
+                 1,
+                 Location::RequiresRegister(),
                  LocationSummary::kNoCall) {
   ASSERT(compiler->is_optimizing());
   const Register char_code = locs()->in(0).reg();  // Char code is a smi.
@@ -943,7 +959,8 @@
 
 
 EMIT_NATIVE_CODE(StringToCharCode,
-                 1, Location::RequiresRegister(),
+                 1,
+                 Location::RequiresRegister(),
                  LocationSummary::kNoCall) {
   ASSERT(cid_ == kOneByteStringCid);
   const Register str = locs()->in(0).reg();
@@ -953,7 +970,8 @@
 
 
 EMIT_NATIVE_CODE(AllocateObject,
-                 0, Location::RequiresRegister(),
+                 0,
+                 Location::RequiresRegister(),
                  LocationSummary::kCall) {
   if (ArgumentCount() == 1) {
     // Allocate with type arguments.
@@ -968,8 +986,8 @@
         ASSERT(cls().id() != kIllegalCid);
         tags = RawObject::ClassIdTag::update(cls().id(), tags);
         if (Smi::IsValid(tags)) {
-          const intptr_t tags_kidx = __ AddConstant(
-              Smi::Handle(Smi::New(tags)));
+          const intptr_t tags_kidx =
+              __ AddConstant(Smi::Handle(Smi::New(tags)));
           __ AllocateTOpt(locs()->out(0).reg(), tags_kidx);
           __ Nop(cls().type_arguments_field_offset());
         }
@@ -977,16 +995,14 @@
       __ PushConstant(cls());
       __ AllocateT();
       compiler->AddCurrentDescriptor(RawPcDescriptors::kOther,
-                                     Thread::kNoDeoptId,
-                                     token_pos());
+                                     Thread::kNoDeoptId, token_pos());
       compiler->RecordSafepoint(locs());
       __ PopLocal(locs()->out(0).reg());
     } else {
       __ PushConstant(cls());
       __ AllocateT();
       compiler->AddCurrentDescriptor(RawPcDescriptors::kOther,
-                                     Thread::kNoDeoptId,
-                                     token_pos());
+                                     Thread::kNoDeoptId, token_pos());
       compiler->RecordSafepoint(locs());
     }
   } else if (compiler->is_optimizing()) {
@@ -1006,16 +1022,14 @@
     }
     const intptr_t kidx = __ AddConstant(cls());
     __ Allocate(kidx);
-    compiler->AddCurrentDescriptor(RawPcDescriptors::kOther,
-                                   Thread::kNoDeoptId,
+    compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId,
                                    token_pos());
     compiler->RecordSafepoint(locs());
     __ PopLocal(locs()->out(0).reg());
   } else {
     const intptr_t kidx = __ AddConstant(cls());
     __ Allocate(kidx);
-    compiler->AddCurrentDescriptor(RawPcDescriptors::kOther,
-                                   Thread::kNoDeoptId,
+    compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId,
                                    token_pos());
     compiler->RecordSafepoint(locs());
   }
@@ -1028,7 +1042,12 @@
   if (compiler->is_optimizing()) {
     const Register value = locs()->in(1).reg();
     const Register instance = locs()->in(0).reg();
-    __ StoreField(instance, offset_in_bytes() / kWordSize, value);
+    if (Utils::IsInt(8, offset_in_bytes() / kWordSize)) {
+      __ StoreField(instance, offset_in_bytes() / kWordSize, value);
+    } else {
+      __ StoreFieldExt(instance, value);
+      __ Nop(offset_in_bytes() / kWordSize);
+    }
   } else {
     __ StoreFieldTOS(offset_in_bytes() / kWordSize);
   }
@@ -1040,7 +1059,12 @@
   if (compiler->is_optimizing()) {
     const Register result = locs()->out(0).reg();
     const Register instance = locs()->in(0).reg();
-    __ LoadField(result, instance, offset_in_bytes() / kWordSize);
+    if (Utils::IsInt(8, offset_in_bytes() / kWordSize)) {
+      __ LoadField(result, instance, offset_in_bytes() / kWordSize);
+    } else {
+      __ LoadFieldExt(result, instance);
+      __ Nop(offset_in_bytes() / kWordSize);
+    }
   } else {
     __ LoadFieldTOS(offset_in_bytes() / kWordSize);
   }
@@ -1069,42 +1093,42 @@
 
 
 EMIT_NATIVE_CODE(AllocateContext,
-                 0, Location::RequiresRegister(),
+                 0,
+                 Location::RequiresRegister(),
                  LocationSummary::kCall) {
   ASSERT(!compiler->is_optimizing());
   __ AllocateContext(num_context_variables());
   compiler->RecordSafepoint(locs());
-  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther,
-                                 Thread::kNoDeoptId,
+  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId,
                                  token_pos());
 }
 
 
 EMIT_NATIVE_CODE(AllocateUninitializedContext,
-                 0, Location::RequiresRegister(),
+                 0,
+                 Location::RequiresRegister(),
                  LocationSummary::kCall) {
   ASSERT(compiler->is_optimizing());
   __ AllocateUninitializedContext(locs()->out(0).reg(),
                                   num_context_variables());
   __ AllocateContext(num_context_variables());
   compiler->RecordSafepoint(locs());
-  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther,
-                                 Thread::kNoDeoptId,
+  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId,
                                  token_pos());
   __ PopLocal(locs()->out(0).reg());
 }
 
 
 EMIT_NATIVE_CODE(CloneContext,
-                 1, Location::RequiresRegister(),
+                 1,
+                 Location::RequiresRegister(),
                  LocationSummary::kCall) {
   if (compiler->is_optimizing()) {
     __ Push(locs()->in(0).reg());
   }
   __ CloneContext();
   compiler->RecordSafepoint(locs());
-  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther,
-                                 Thread::kNoDeoptId,
+  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId,
                                  token_pos());
   if (compiler->is_optimizing()) {
     __ PopLocal(locs()->out(0).reg());
@@ -1114,23 +1138,39 @@
 
 EMIT_NATIVE_CODE(CatchBlockEntry, 0) {
   __ Bind(compiler->GetJumpLabel(this));
-  compiler->AddExceptionHandler(catch_try_index(),
-                                try_index(),
+  compiler->AddExceptionHandler(catch_try_index(), try_index(),
                                 compiler->assembler()->CodeSize(),
-                                catch_handler_types_,
-                                needs_stacktrace());
-  __ MoveSpecial(-exception_var().index()-1,
-                 Simulator::kExceptionSpecialIndex);
-  __ MoveSpecial(-stacktrace_var().index()-1,
-                 Simulator::kStacktraceSpecialIndex);
+                                catch_handler_types_, needs_stacktrace());
+
+  if (HasParallelMove()) {
+    compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
+  }
+  if (compiler->is_optimizing()) {
+    // In optimized code, variables at the catch block entry reside at the top
+    // of the allocatable register range.
+    const intptr_t num_non_copied_params =
+        compiler->flow_graph().num_non_copied_params();
+    const intptr_t exception_reg =
+        kNumberOfCpuRegisters -
+        (-exception_var().index() + num_non_copied_params);
+    const intptr_t stacktrace_reg =
+        kNumberOfCpuRegisters -
+        (-stacktrace_var().index() + num_non_copied_params);
+    __ MoveSpecial(exception_reg, Simulator::kExceptionSpecialIndex);
+    __ MoveSpecial(stacktrace_reg, Simulator::kStacktraceSpecialIndex);
+  } else {
+    __ MoveSpecial(LocalVarIndex(0, exception_var().index()),
+                   Simulator::kExceptionSpecialIndex);
+    __ MoveSpecial(LocalVarIndex(0, stacktrace_var().index()),
+                   Simulator::kStacktraceSpecialIndex);
+  }
   __ SetFrame(compiler->StackSize());
 }
 
 
 EMIT_NATIVE_CODE(Throw, 0, Location::NoLocation(), LocationSummary::kCall) {
   __ Throw(0);
-  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther,
-                                 deopt_id(),
+  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id(),
                                  token_pos());
   compiler->RecordAfterCall(this);
   __ Trap();
@@ -1140,23 +1180,22 @@
 EMIT_NATIVE_CODE(ReThrow, 0, Location::NoLocation(), LocationSummary::kCall) {
   compiler->SetNeedsStacktrace(catch_try_index());
   __ Throw(1);
-  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther,
-                                 deopt_id(),
+  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id(),
                                  token_pos());
   compiler->RecordAfterCall(this);
   __ Trap();
 }
 
 EMIT_NATIVE_CODE(InstantiateType,
-                 1, Location::RequiresRegister(),
+                 1,
+                 Location::RequiresRegister(),
                  LocationSummary::kCall) {
   if (compiler->is_optimizing()) {
     __ Push(locs()->in(0).reg());
   }
   __ InstantiateType(__ AddConstant(type()));
   compiler->RecordSafepoint(locs());
-  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther,
-                                 deopt_id(),
+  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id(),
                                  token_pos());
   if (compiler->is_optimizing()) {
     __ PopLocal(locs()->out(0).reg());
@@ -1164,7 +1203,8 @@
 }
 
 EMIT_NATIVE_CODE(InstantiateTypeArguments,
-                 1, Location::RequiresRegister(),
+                 1,
+                 Location::RequiresRegister(),
                  LocationSummary::kCall) {
   if (compiler->is_optimizing()) {
     __ Push(locs()->in(0).reg());
@@ -1173,8 +1213,7 @@
       type_arguments().IsRawInstantiatedRaw(type_arguments().Length()),
       __ AddConstant(type_arguments()));
   compiler->RecordSafepoint(locs());
-  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther,
-                                 deopt_id(),
+  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id(),
                                  token_pos());
   if (compiler->is_optimizing()) {
     __ PopLocal(locs()->out(0).reg());
@@ -1196,8 +1235,8 @@
 
 
 LocationSummary* Instruction::MakeCallSummary(Zone* zone) {
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, 0, 0, LocationSummary::kCall);
+  LocationSummary* result =
+      new (zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
   // TODO(vegorov) support allocating out registers for calls.
   // Currently we require them to be fixed.
   result->set_out(0, Location::RegisterLocation(0));
@@ -1224,8 +1263,8 @@
 
 
 bool ShiftMintOpInstr::has_shift_count_check() const {
-  return !RangeUtils::IsWithin(
-      right()->definition()->range(), 0, kMintShiftCountLimit);
+  return !RangeUtils::IsWithin(right()->definition()->range(), 0,
+                               kMintShiftCountLimit);
 }
 
 
@@ -1351,21 +1390,20 @@
 
 void Environment::DropArguments(intptr_t argc) {
 #if defined(DEBUG)
-    // Check that we are in the backend - register allocation has been run.
-    ASSERT(locations_ != NULL);
+  // Check that we are in the backend - register allocation has been run.
+  ASSERT(locations_ != NULL);
 
-    // Check that we are only dropping a valid number of instructions from the
-    // environment.
-    ASSERT(argc <= values_.length());
+  // Check that we are only dropping a valid number of instructions from the
+  // environment.
+  ASSERT(argc <= values_.length());
 #endif
-    values_.TruncateTo(values_.length() - argc);
+  values_.TruncateTo(values_.length() - argc);
 }
 
 
 EMIT_NATIVE_CODE(CheckSmi, 1) {
   __ CheckSmi(locs()->in(0).reg());
-  compiler->EmitDeopt(deopt_id(),
-                      ICData::kDeoptCheckSmi,
+  compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckSmi,
                       licm_hoisted_ ? ICData::kHoisted : 0);
 }
 
@@ -1380,8 +1418,7 @@
 
 
 EMIT_NATIVE_CODE(CheckClassId, 1) {
-  __ CheckClassId(locs()->in(0).reg(),
-                  compiler->ToEmbeddableCid(cid_, this));
+  __ CheckClassId(locs()->in(0).reg(), compiler->ToEmbeddableCid(cid_, this));
   compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckClass);
 }
 
@@ -1400,17 +1437,21 @@
            (unary_checks().NumberOfChecks() > 1));
     const intptr_t may_be_smi =
         (unary_checks().GetReceiverClassIdAt(0) == kSmiCid) ? 1 : 0;
+    bool is_dense_switch = false;
+    intptr_t cid_mask = 0;
     if (IsDenseSwitch()) {
       ASSERT(cids_[0] < cids_[cids_.length() - 1]);
+      cid_mask = ComputeCidMask();
+      is_dense_switch = Smi::IsValid(cid_mask);
+    }
+    if (is_dense_switch) {
       const intptr_t low_cid = cids_[0];
-      const intptr_t cid_mask = ComputeCidMask();
       __ CheckDenseSwitch(value, may_be_smi);
       __ Nop(compiler->ToEmbeddableCid(low_cid, this));
       __ Nop(__ AddConstant(Smi::Handle(Smi::New(cid_mask))));
     } else {
       GrowableArray<CidTarget> sorted_ic_data;
-      FlowGraphCompiler::SortICDataByCount(unary_checks(),
-                                           &sorted_ic_data,
+      FlowGraphCompiler::SortICDataByCount(unary_checks(), &sorted_ic_data,
                                            /* drop_smi = */ true);
       const intptr_t sorted_length = sorted_ic_data.length();
       if (!Utils::IsUint(8, sorted_length)) {
@@ -1423,8 +1464,7 @@
       }
     }
   }
-  compiler->EmitDeopt(deopt_id(),
-                      ICData::kDeoptCheckClass,
+  compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckClass,
                       licm_hoisted_ ? ICData::kHoisted : 0);
 }
 
@@ -1522,8 +1562,7 @@
   }
   const intptr_t kidx = __ AddConstant(compiler->double_class());
   __ Allocate(kidx);
-  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther,
-                                 Thread::kNoDeoptId,
+  compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId,
                                  token_pos());
   compiler->RecordSafepoint(locs());
   __ PopLocal(out);
@@ -1542,7 +1581,7 @@
   } else if (CanConvertSmi() && (value_cid == kSmiCid)) {
     __ SmiToDouble(result, box);
   } else if ((value()->Type()->ToNullableCid() == box_cid) &&
-              value()->Type()->is_nullable()) {
+             value()->Type()->is_nullable()) {
     __ IfEqNull(box);
     compiler->EmitDeopt(GetDeoptId(), ICData::kDeoptCheckClass);
     __ UnboxDouble(result, box);
@@ -1608,15 +1647,72 @@
   const Register right = locs()->in(1).reg();
   const Register result = locs()->out(0).reg();
   switch (op_kind()) {
-    case Token::kADD: __ DAdd(result, left, right); break;
-    case Token::kSUB: __ DSub(result, left, right); break;
-    case Token::kMUL: __ DMul(result, left, right); break;
-    case Token::kDIV: __ DDiv(result, left, right); break;
-    default: UNREACHABLE();
+    case Token::kADD:
+      __ DAdd(result, left, right);
+      break;
+    case Token::kSUB:
+      __ DSub(result, left, right);
+      break;
+    case Token::kMUL:
+      __ DMul(result, left, right);
+      break;
+    case Token::kDIV:
+      __ DDiv(result, left, right);
+      break;
+    default:
+      UNREACHABLE();
   }
 }
 
 
+Condition DoubleTestOpInstr::EmitComparisonCode(FlowGraphCompiler* compiler,
+                                                BranchLabels labels) {
+  UNREACHABLE();
+  return Condition();
+}
+
+
+void DoubleTestOpInstr::EmitBranchCode(FlowGraphCompiler* compiler,
+                                       BranchInstr* branch) {
+  ASSERT(compiler->is_optimizing());
+  BranchLabels labels = compiler->CreateBranchLabels(branch);
+  const Register value = locs()->in(0).reg();
+  switch (op_kind()) {
+    case MethodRecognizer::kDouble_getIsNaN:
+      __ DoubleIsNaN(value);
+      break;
+    case MethodRecognizer::kDouble_getIsInfinite:
+      __ DoubleIsInfinite(value);
+      break;
+    default:
+      UNREACHABLE();
+  }
+  const bool is_negated = kind() != Token::kEQ;
+  EmitBranchOnCondition(compiler, is_negated ? NEXT_IS_FALSE : NEXT_IS_TRUE,
+                        labels);
+}
+
+
+EMIT_NATIVE_CODE(DoubleTestOp, 1, Location::RequiresRegister()) {
+  ASSERT(compiler->is_optimizing());
+  const Register value = locs()->in(0).reg();
+  const Register result = locs()->out(0).reg();
+  const bool is_negated = kind() != Token::kEQ;
+  __ LoadConstant(result, is_negated ? Bool::True() : Bool::False());
+  switch (op_kind()) {
+    case MethodRecognizer::kDouble_getIsNaN:
+      __ DoubleIsNaN(value);
+      break;
+    case MethodRecognizer::kDouble_getIsInfinite:
+      __ DoubleIsInfinite(value);
+      break;
+    default:
+      UNREACHABLE();
+  }
+  __ LoadConstant(result, is_negated ? Bool::False() : Bool::True());
+}
+
+
 EMIT_NATIVE_CODE(UnaryDoubleOp, 1, Location::RequiresRegister()) {
   const Register value = locs()->in(0).reg();
   const Register result = locs()->out(0).reg();
@@ -1672,7 +1768,8 @@
 
 
 EMIT_NATIVE_CODE(InvokeMathCFunction,
-                 InputCount(), Location::RequiresRegister()) {
+                 InputCount(),
+                 Location::RequiresRegister()) {
   const Register left = locs()->in(0).reg();
   const Register result = locs()->out(0).reg();
   if (recognized_kind() == MethodRecognizer::kMathDoublePow) {
@@ -1717,12 +1814,18 @@
 
 static Token::Kind FlipCondition(Token::Kind kind) {
   switch (kind) {
-    case Token::kEQ: return Token::kNE;
-    case Token::kNE: return Token::kEQ;
-    case Token::kLT: return Token::kGTE;
-    case Token::kGT: return Token::kLTE;
-    case Token::kLTE: return Token::kGT;
-    case Token::kGTE: return Token::kLT;
+    case Token::kEQ:
+      return Token::kNE;
+    case Token::kNE:
+      return Token::kEQ;
+    case Token::kLT:
+      return Token::kGTE;
+    case Token::kGT:
+      return Token::kLTE;
+    case Token::kLTE:
+      return Token::kGT;
+    case Token::kGTE:
+      return Token::kLT;
     default:
       UNREACHABLE();
       return Token::kNE;
@@ -1732,12 +1835,18 @@
 
 static Bytecode::Opcode OpcodeForSmiCondition(Token::Kind kind) {
   switch (kind) {
-    case Token::kEQ: return Bytecode::kIfEqStrict;
-    case Token::kNE: return Bytecode::kIfNeStrict;
-    case Token::kLT: return Bytecode::kIfLt;
-    case Token::kGT: return Bytecode::kIfGt;
-    case Token::kLTE: return Bytecode::kIfLe;
-    case Token::kGTE: return Bytecode::kIfGe;
+    case Token::kEQ:
+      return Bytecode::kIfEqStrict;
+    case Token::kNE:
+      return Bytecode::kIfNeStrict;
+    case Token::kLT:
+      return Bytecode::kIfLt;
+    case Token::kGT:
+      return Bytecode::kIfGt;
+    case Token::kLTE:
+      return Bytecode::kIfLe;
+    case Token::kGTE:
+      return Bytecode::kIfGe;
     default:
       UNREACHABLE();
       return Bytecode::kTrap;
@@ -1747,12 +1856,18 @@
 
 static Bytecode::Opcode OpcodeForDoubleCondition(Token::Kind kind) {
   switch (kind) {
-    case Token::kEQ: return Bytecode::kIfDEq;
-    case Token::kNE: return Bytecode::kIfDNe;
-    case Token::kLT: return Bytecode::kIfDLt;
-    case Token::kGT: return Bytecode::kIfDGt;
-    case Token::kLTE: return Bytecode::kIfDLe;
-    case Token::kGTE: return Bytecode::kIfDGe;
+    case Token::kEQ:
+      return Bytecode::kIfDEq;
+    case Token::kNE:
+      return Bytecode::kIfDNe;
+    case Token::kLT:
+      return Bytecode::kIfDLt;
+    case Token::kGT:
+      return Bytecode::kIfDGt;
+    case Token::kLTE:
+      return Bytecode::kIfDLe;
+    case Token::kGTE:
+      return Bytecode::kIfDGe;
     default:
       UNREACHABLE();
       return Bytecode::kTrap;
@@ -1783,20 +1898,16 @@
 
 static Condition EmitDoubleComparisonOp(FlowGraphCompiler* compiler,
                                         LocationSummary* locs,
-                                        Token::Kind kind,
-                                        BranchLabels labels) {
+                                        Token::Kind kind) {
   const Register left = locs->in(0).reg();
   const Register right = locs->in(1).reg();
   Token::Kind comparison = kind;
+  // For double comparisons we can't flip the condition like with smi
+  // comparisons because of NaN which will compare false for all except !=
+  // operations.
+  // TODO(fschneider): Change the block order instead in DBC so that the
+  // false block in always the fall-through block.
   Condition condition = NEXT_IS_TRUE;
-  if (labels.fall_through != labels.false_label) {
-    // If we aren't falling through to the false label, we can save a Jump
-    // instruction in the case that the true case is the fall through by
-    // flipping the sense of the test such that the instruction following the
-    // test is the Jump to the false label.
-    condition = NEXT_IS_FALSE;
-    comparison = FlipCondition(kind);
-  }
   __ Emit(Bytecode::Encode(OpcodeForDoubleCondition(comparison), left, right));
   return condition;
 }
@@ -1808,7 +1919,7 @@
     return EmitSmiComparisonOp(compiler, locs(), kind(), labels);
   } else {
     ASSERT(operation_cid() == kDoubleCid);
-    return EmitDoubleComparisonOp(compiler, locs(), kind(), labels);
+    return EmitDoubleComparisonOp(compiler, locs(), kind());
   }
 }
 
@@ -1820,7 +1931,7 @@
   // These labels are not used. They are arranged so that EmitComparisonCode
   // emits a test that executes the following instruction when the test
   // succeeds.
-  BranchLabels labels = { &is_true, &is_false, &is_false };
+  BranchLabels labels = {&is_true, &is_false, &is_false};
   const Register result = locs()->out(0).reg();
   __ LoadConstant(result, Bool::False());
   Condition true_condition = EmitComparisonCode(compiler, labels);
@@ -1844,7 +1955,7 @@
     return EmitSmiComparisonOp(compiler, locs(), kind(), labels);
   } else {
     ASSERT(operation_cid() == kDoubleCid);
-    return EmitDoubleComparisonOp(compiler, locs(), kind(), labels);
+    return EmitDoubleComparisonOp(compiler, locs(), kind());
   }
 }
 
@@ -1852,7 +1963,7 @@
 EMIT_NATIVE_CODE(RelationalOp, 2, Location::RequiresRegister()) {
   ASSERT(compiler->is_optimizing());
   Label is_true, is_false;
-  BranchLabels labels = { &is_true, &is_false, &is_false };
+  BranchLabels labels = {&is_true, &is_false, &is_false};
   const Register result = locs()->out(0).reg();
   __ LoadConstant(result, Bool::False());
   Condition true_condition = EmitComparisonCode(compiler, labels);
@@ -1875,16 +1986,14 @@
   const intptr_t index_cid = this->index()->Type()->ToCid();
   if (index_cid != kSmiCid) {
     __ CheckSmi(index);
-    compiler->EmitDeopt(deopt_id(),
-                        ICData::kDeoptCheckArrayBound,
+    compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckArrayBound,
                         (generalized_ ? ICData::kGeneralized : 0) |
-                        (licm_hoisted_ ? ICData::kHoisted : 0));
+                            (licm_hoisted_ ? ICData::kHoisted : 0));
   }
   __ IfULe(length, index);
-  compiler->EmitDeopt(deopt_id(),
-                      ICData::kDeoptCheckArrayBound,
+  compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckArrayBound,
                       (generalized_ ? ICData::kGeneralized : 0) |
-                      (licm_hoisted_ ? ICData::kHoisted : 0));
+                          (licm_hoisted_ ? ICData::kHoisted : 0));
 }
 
 }  // namespace dart
diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc
index 597fd43..c3f905d 100644
--- a/runtime/vm/intermediate_language_ia32.cc
+++ b/runtime/vm/intermediate_language_ia32.cc
@@ -30,8 +30,8 @@
 LocationSummary* Instruction::MakeCallSummary(Zone* zone) {
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   result->set_out(0, Location::RegisterLocation(EAX));
   return result;
 }
@@ -41,8 +41,8 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::AnyOrConstant(value()));
   return locs;
 }
@@ -65,12 +65,11 @@
 }
 
 
-LocationSummary* ReturnInstr::MakeLocationSummary(Zone* zone,
-                                                  bool opt) const {
+LocationSummary* ReturnInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RegisterLocation(EAX));
   return locs;
 }
@@ -111,10 +110,9 @@
                                                      bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t stack_index = (local().index() < 0)
-      ? kFirstLocalSlotFromFp - local().index()
-      : kParamEndSlotFromFp - local().index();
-  return LocationSummary::Make(zone,
-                               kNumInputs,
+                                   ? kFirstLocalSlotFromFp - local().index()
+                                   : kParamEndSlotFromFp - local().index();
+  return LocationSummary::Make(zone, kNumInputs,
                                Location::StackSlot(stack_index),
                                LocationSummary::kNoCall);
 }
@@ -129,9 +127,7 @@
 LocationSummary* StoreLocalInstr::MakeLocationSummary(Zone* zone,
                                                       bool opt) const {
   const intptr_t kNumInputs = 1;
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::SameAsFirstInput(),
+  return LocationSummary::Make(zone, kNumInputs, Location::SameAsFirstInput(),
                                LocationSummary::kNoCall);
 }
 
@@ -147,8 +143,7 @@
 LocationSummary* ConstantInstr::MakeLocationSummary(Zone* zone,
                                                     bool opt) const {
   const intptr_t kNumInputs = 0;
-  return LocationSummary::Make(zone,
-                               kNumInputs,
+  return LocationSummary::Make(zone, kNumInputs,
                                Assembler::IsSafe(value())
                                    ? Location::Constant(this)
                                    : Location::RequiresRegister(),
@@ -172,8 +167,8 @@
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps =
       (constant_address() == 0) && (representation() != kUnboxedInt32) ? 1 : 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   if (representation() == kUnboxedDouble) {
     locs->set_out(0, Location::RequiresFpuRegister());
   } else {
@@ -218,8 +213,8 @@
                                                             bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(EAX));  // Value.
   summary->set_in(1, Location::RegisterLocation(EDX));  // Type arguments.
   summary->set_out(0, Location::RegisterLocation(EAX));
@@ -231,8 +226,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(EAX));
   locs->set_out(0, Location::RegisterLocation(EAX));
   return locs;
@@ -261,11 +256,8 @@
   }
 
   __ pushl(reg);  // Push the source object.
-  compiler->GenerateRuntimeCall(token_pos,
-                                deopt_id,
-                                kNonBoolTypeErrorRuntimeEntry,
-                                1,
-                                locs);
+  compiler->GenerateRuntimeCall(token_pos, deopt_id,
+                                kNonBoolTypeErrorRuntimeEntry, 1, locs);
   // We should never return here.
   __ int3();
   __ Bind(&done);
@@ -283,12 +275,18 @@
 
 static Condition TokenKindToSmiCondition(Token::Kind kind) {
   switch (kind) {
-    case Token::kEQ: return EQUAL;
-    case Token::kNE: return NOT_EQUAL;
-    case Token::kLT: return LESS;
-    case Token::kGT: return GREATER;
-    case Token::kLTE: return LESS_EQUAL;
-    case Token::kGTE: return GREATER_EQUAL;
+    case Token::kEQ:
+      return EQUAL;
+    case Token::kNE:
+      return NOT_EQUAL;
+    case Token::kLT:
+      return LESS;
+    case Token::kGT:
+      return GREATER;
+    case Token::kLTE:
+      return LESS_EQUAL;
+    case Token::kGTE:
+      return GREATER_EQUAL;
     default:
       UNREACHABLE();
       return OVERFLOW;
@@ -301,8 +299,8 @@
   const intptr_t kNumInputs = 2;
   if (operation_cid() == kMintCid) {
     const intptr_t kNumTemps = 0;
-    LocationSummary* locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* locs = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     locs->set_in(0, Location::Pair(Location::RequiresRegister(),
                                    Location::RequiresRegister()));
     locs->set_in(1, Location::Pair(Location::RequiresRegister(),
@@ -312,8 +310,8 @@
   }
   if (operation_cid() == kDoubleCid) {
     const intptr_t kNumTemps = 0;
-    LocationSummary* locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* locs = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     locs->set_in(0, Location::RequiresFpuRegister());
     locs->set_in(1, Location::RequiresFpuRegister());
     locs->set_out(0, Location::RequiresRegister());
@@ -321,8 +319,8 @@
   }
   if (operation_cid() == kSmiCid) {
     const intptr_t kNumTemps = 0;
-    LocationSummary* locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* locs = new (zone)
+        LocationSummary(zone, 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.
@@ -359,16 +357,26 @@
 
 static Condition FlipCondition(Condition condition) {
   switch (condition) {
-    case EQUAL:         return EQUAL;
-    case NOT_EQUAL:     return NOT_EQUAL;
-    case LESS:          return GREATER;
-    case LESS_EQUAL:    return GREATER_EQUAL;
-    case GREATER:       return LESS;
-    case GREATER_EQUAL: return LESS_EQUAL;
-    case BELOW:         return ABOVE;
-    case BELOW_EQUAL:   return ABOVE_EQUAL;
-    case ABOVE:         return BELOW;
-    case ABOVE_EQUAL:   return BELOW_EQUAL;
+    case EQUAL:
+      return EQUAL;
+    case NOT_EQUAL:
+      return NOT_EQUAL;
+    case LESS:
+      return GREATER;
+    case LESS_EQUAL:
+      return GREATER_EQUAL;
+    case GREATER:
+      return LESS;
+    case GREATER_EQUAL:
+      return LESS_EQUAL;
+    case BELOW:
+      return ABOVE;
+    case BELOW_EQUAL:
+      return ABOVE_EQUAL;
+    case ABOVE:
+      return BELOW;
+    case ABOVE_EQUAL:
+      return BELOW_EQUAL;
     default:
       UNIMPLEMENTED();
       return EQUAL;
@@ -378,16 +386,30 @@
 
 static Condition NegateCondition(Condition condition) {
   switch (condition) {
-    case EQUAL:         return NOT_EQUAL;
-    case NOT_EQUAL:     return EQUAL;
-    case LESS:          return GREATER_EQUAL;
-    case LESS_EQUAL:    return GREATER;
-    case GREATER:       return LESS_EQUAL;
-    case GREATER_EQUAL: return LESS;
-    case BELOW:         return ABOVE_EQUAL;
-    case BELOW_EQUAL:   return ABOVE;
-    case ABOVE:         return BELOW_EQUAL;
-    case ABOVE_EQUAL:   return BELOW;
+    case EQUAL:
+      return NOT_EQUAL;
+    case NOT_EQUAL:
+      return EQUAL;
+    case LESS:
+      return GREATER_EQUAL;
+    case LESS_EQUAL:
+      return GREATER;
+    case GREATER:
+      return LESS_EQUAL;
+    case GREATER_EQUAL:
+      return LESS;
+    case BELOW:
+      return ABOVE_EQUAL;
+    case BELOW_EQUAL:
+      return ABOVE;
+    case ABOVE:
+      return BELOW_EQUAL;
+    case ABOVE_EQUAL:
+      return BELOW;
+    case PARITY_ODD:
+      return PARITY_EVEN;
+    case PARITY_EVEN:
+      return PARITY_ODD;
     default:
       UNIMPLEMENTED();
       return EQUAL;
@@ -440,12 +462,18 @@
 
 static Condition TokenKindToMintCondition(Token::Kind kind) {
   switch (kind) {
-    case Token::kEQ: return EQUAL;
-    case Token::kNE: return NOT_EQUAL;
-    case Token::kLT: return LESS;
-    case Token::kGT: return GREATER;
-    case Token::kLTE: return LESS_EQUAL;
-    case Token::kGTE: return GREATER_EQUAL;
+    case Token::kEQ:
+      return EQUAL;
+    case Token::kNE:
+      return NOT_EQUAL;
+    case Token::kLT:
+      return LESS;
+    case Token::kGT:
+      return GREATER;
+    case Token::kLTE:
+      return LESS_EQUAL;
+    case Token::kGTE:
+      return GREATER_EQUAL;
     default:
       UNREACHABLE();
       return OVERFLOW;
@@ -522,12 +550,18 @@
 
 static Condition TokenKindToDoubleCondition(Token::Kind kind) {
   switch (kind) {
-    case Token::kEQ: return EQUAL;
-    case Token::kNE: return NOT_EQUAL;
-    case Token::kLT: return BELOW;
-    case Token::kGT: return ABOVE;
-    case Token::kLTE: return BELOW_EQUAL;
-    case Token::kGTE: return ABOVE_EQUAL;
+    case Token::kEQ:
+      return EQUAL;
+    case Token::kNE:
+      return NOT_EQUAL;
+    case Token::kLT:
+      return BELOW;
+    case Token::kGT:
+      return ABOVE;
+    case Token::kLTE:
+      return BELOW_EQUAL;
+    case Token::kGTE:
+      return ABOVE_EQUAL;
     default:
       UNREACHABLE();
       return OVERFLOW;
@@ -545,8 +579,8 @@
   __ comisd(left, right);
 
   Condition true_condition = TokenKindToDoubleCondition(kind);
-  Label* nan_result = (true_condition == NOT_EQUAL)
-      ? labels.true_label : labels.false_label;
+  Label* nan_result =
+      (true_condition == NOT_EQUAL) ? labels.true_label : labels.false_label;
   __ j(PARITY_EVEN, nan_result);
   return true_condition;
 }
@@ -569,9 +603,9 @@
   ASSERT((kind() == Token::kNE) || (kind() == Token::kEQ));
 
   Label is_true, is_false;
-  BranchLabels labels = { &is_true, &is_false, &is_false };
+  BranchLabels labels = {&is_true, &is_false, &is_false};
   Condition true_condition = EmitComparisonCode(compiler, labels);
-  EmitBranchOnCondition(compiler,  true_condition, labels);
+  EmitBranchOnCondition(compiler, true_condition, labels);
 
   Register result = locs()->out(0).reg();
   Label done;
@@ -594,12 +628,11 @@
 }
 
 
-LocationSummary* TestSmiInstr::MakeLocationSummary(Zone* zone,
-                                                   bool opt) const {
+LocationSummary* TestSmiInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RequiresRegister());
   // Only one input can be a constant operand. The case of two constant
   // operands should be handled by constant propagation.
@@ -614,8 +647,7 @@
   Location right = locs()->in(1);
   if (right.IsConstant()) {
     ASSERT(right.constant().IsSmi());
-    const int32_t imm =
-        reinterpret_cast<int32_t>(right.constant().raw());
+    const int32_t imm = reinterpret_cast<int32_t>(right.constant().raw());
     __ testl(left, Immediate(imm));
   } else {
     __ testl(left, right.reg());
@@ -639,13 +671,12 @@
 }
 
 
-
 LocationSummary* TestCidsInstr::MakeLocationSummary(Zone* zone,
                                                     bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RequiresRegister());
   locs->set_temp(0, Location::RequiresRegister());
   locs->set_out(0, Location::RequiresRegister());
@@ -659,11 +690,11 @@
   Register val_reg = locs()->in(0).reg();
   Register cid_reg = locs()->temp(0).reg();
 
-  Label* deopt = CanDeoptimize()
-      ? compiler->AddDeoptStub(deopt_id(),
-                               ICData::kDeoptTestCids,
-                               licm_hoisted_ ? ICData::kHoisted : 0)
-      : NULL;
+  Label* deopt =
+      CanDeoptimize()
+          ? compiler->AddDeoptStub(deopt_id(), ICData::kDeoptTestCids,
+                                   licm_hoisted_ ? ICData::kHoisted : 0)
+          : NULL;
 
   const intptr_t true_result = (kind() == Token::kIS) ? 1 : 0;
   const ZoneGrowableArray<intptr_t>& data = cid_results();
@@ -676,14 +707,14 @@
     const intptr_t test_cid = data[i];
     ASSERT(test_cid != kSmiCid);
     result = data[i + 1] == true_result;
-    __ cmpl(cid_reg,  Immediate(test_cid));
+    __ cmpl(cid_reg, Immediate(test_cid));
     __ j(EQUAL, result ? labels.true_label : labels.false_label);
   }
   // No match found, deoptimize or false.
   if (deopt == NULL) {
     Label* target = result ? labels.false_label : labels.true_label;
     if (target != labels.fall_through) {
-        __ jmp(target);
+      __ jmp(target);
     }
   } else {
     __ jmp(deopt);
@@ -704,7 +735,7 @@
 void TestCidsInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Register result_reg = locs()->out(0).reg();
   Label is_true, is_false, done;
-  BranchLabels labels = { &is_true, &is_false, &is_false };
+  BranchLabels labels = {&is_true, &is_false, &is_false};
   EmitComparisonCode(compiler, labels);
   __ Bind(&is_false);
   __ LoadObject(result_reg, Bool::False());
@@ -721,8 +752,8 @@
   const intptr_t kNumTemps = 0;
   if (operation_cid() == kMintCid) {
     const intptr_t kNumTemps = 0;
-    LocationSummary* locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* locs = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     locs->set_in(0, Location::Pair(Location::RequiresRegister(),
                                    Location::RequiresRegister()));
     locs->set_in(1, Location::Pair(Location::RequiresRegister(),
@@ -731,16 +762,16 @@
     return locs;
   }
   if (operation_cid() == kDoubleCid) {
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresFpuRegister());
     summary->set_in(1, Location::RequiresFpuRegister());
     summary->set_out(0, Location::RequiresRegister());
     return summary;
   }
   ASSERT(operation_cid() == kSmiCid);
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, 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.
@@ -767,7 +798,7 @@
 
 void RelationalOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Label is_true, is_false;
-  BranchLabels labels = { &is_true, &is_false, &is_false };
+  BranchLabels labels = {&is_true, &is_false, &is_false};
   Condition true_condition = EmitComparisonCode(compiler, labels);
   EmitBranchOnCondition(compiler, true_condition, labels);
 
@@ -805,28 +836,26 @@
   __ PushObject(Object::null_object());
   // Pass a pointer to the first argument in EAX.
   if (!function().HasOptionalParameters()) {
-    __ leal(EAX, Address(EBP, (kParamEndSlotFromFp +
-                               function().NumParameters()) * kWordSize));
+    __ leal(EAX,
+            Address(EBP, (kParamEndSlotFromFp + function().NumParameters()) *
+                             kWordSize));
   } else {
     __ leal(EAX, Address(EBP, kFirstLocalSlotFromFp * kWordSize));
   }
   __ movl(EDX, Immediate(argc_tag));
 
   const StubEntry* stub_entry;
-  if (link_lazily()) {
-    stub_entry = StubCode::CallBootstrapCFunction_entry();
-    __ movl(ECX, Immediate(NativeEntry::LinkNativeCallEntry()));
-  } else {
-    stub_entry = (is_bootstrap_native()) ?
-        StubCode::CallBootstrapCFunction_entry() :
-        StubCode::CallNativeCFunction_entry();
-    const ExternalLabel label(reinterpret_cast<uword>(native_c_function()));
-    __ movl(ECX, Immediate(label.address()));
-  }
-  compiler->GenerateCall(token_pos(),
-                         *stub_entry,
-                         RawPcDescriptors::kOther,
+
+  // There is no lazy-linking support on ia32.
+  ASSERT(!link_lazily());
+  stub_entry = (is_bootstrap_native())
+                   ? StubCode::CallBootstrapCFunction_entry()
+                   : StubCode::CallNativeCFunction_entry();
+  const ExternalLabel label(reinterpret_cast<uword>(native_c_function()));
+  __ movl(ECX, Immediate(label.address()));
+  compiler->GenerateCall(token_pos(), *stub_entry, RawPcDescriptors::kOther,
                          locs());
+
   __ popl(result);
 }
 
@@ -845,12 +874,11 @@
 
 
 LocationSummary* OneByteStringFromCharCodeInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 1;
   // TODO(fschneider): Allow immediate operands for the char code.
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -861,8 +889,7 @@
   Register result = locs()->out(0).reg();
   __ movl(result,
           Immediate(reinterpret_cast<uword>(Symbols::PredefinedAddress())));
-  __ movl(result, Address(result,
-                          char_code,
+  __ movl(result, Address(result, char_code,
                           TIMES_HALF_WORD_SIZE,  // Char code is a smi.
                           Symbols::kNullCharCodeSymbolOffset * kWordSize));
 }
@@ -871,9 +898,7 @@
 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Zone* zone,
                                                             bool opt) const {
   const intptr_t kNumInputs = 1;
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -899,8 +924,8 @@
                                                              bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(EAX));
   summary->set_out(0, Location::RegisterLocation(EAX));
   return summary;
@@ -912,12 +937,8 @@
   __ pushl(array);
   const int kNumberOfArguments = 1;
   const Array& kNoArgumentNames = Object::null_array();
-  compiler->GenerateStaticCall(deopt_id(),
-                               token_pos(),
-                               CallFunction(),
-                               kNumberOfArguments,
-                               kNoArgumentNames,
-                               locs(),
+  compiler->GenerateStaticCall(deopt_id(), token_pos(), CallFunction(),
+                               kNumberOfArguments, kNoArgumentNames, locs(),
                                ICData::Handle());
   ASSERT(locs()->out(0).reg() == EAX);
 }
@@ -926,9 +947,7 @@
 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Zone* zone,
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::SameAsFirstInput(),
+  return LocationSummary::Make(zone, kNumInputs, Location::SameAsFirstInput(),
                                LocationSummary::kNoCall);
 }
 
@@ -948,9 +967,7 @@
 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Zone* zone,
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -1060,8 +1077,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RequiresRegister());
   if (CanBeImmediateIndex(index(), class_id())) {
     // CanBeImmediateIndex must return false for unsafe smis.
@@ -1069,9 +1086,8 @@
   } else {
     // The index is either untagged (element size == 1) or a smi (for all
     // element sizes > 1).
-    locs->set_in(1, (index_scale() == 1)
-                        ? Location::WritableRegister()
-                        : Location::RequiresRegister());
+    locs->set_in(1, (index_scale() == 1) ? Location::WritableRegister()
+                                         : Location::RequiresRegister());
   }
   if ((representation() == kUnboxedDouble) ||
       (representation() == kUnboxedFloat32x4) ||
@@ -1097,12 +1113,13 @@
   const Register array = locs()->in(0).reg();
   const Location index = locs()->in(1);
 
-  Address element_address = index.IsRegister()
-      ? Assembler::ElementAddressForRegIndex(
-            IsExternal(), class_id(), index_scale(), array, index.reg())
-      : Assembler::ElementAddressForIntIndex(
-            IsExternal(), class_id(), index_scale(),
-            array, Smi::Cast(index.constant()).Value());
+  Address element_address =
+      index.IsRegister()
+          ? Assembler::ElementAddressForRegIndex(
+                IsExternal(), class_id(), index_scale(), array, index.reg())
+          : Assembler::ElementAddressForIntIndex(
+                IsExternal(), class_id(), index_scale(), array,
+                Smi::Cast(index.constant()).Value());
 
   if ((representation() == kUnboxedDouble) ||
       (representation() == kUnboxedFloat32x4) ||
@@ -1140,11 +1157,11 @@
       case kTypedDataInt32ArrayCid:
         ASSERT(representation() == kUnboxedInt32);
         __ movl(result, element_address);
-      break;
+        break;
       case kTypedDataUint32ArrayCid:
         ASSERT(representation() == kUnboxedUint32);
         __ movl(result, element_address);
-      break;
+        break;
       default:
         UNREACHABLE();
     }
@@ -1194,8 +1211,8 @@
 Representation StoreIndexedInstr::RequiredInputRepresentation(
     intptr_t idx) const {
   // Array can be a Dart object or a pointer to external data.
-  if (idx == 0)  return kNoRepresentation;  // Flexible input representation.
-  if (idx == 1) return kTagged;  // Index is a smi.
+  if (idx == 0) return kNoRepresentation;  // Flexible input representation.
+  if (idx == 1) return kTagged;            // Index is a smi.
   ASSERT(idx == 2);
   switch (class_id_) {
     case kArrayCid:
@@ -1232,8 +1249,8 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 3;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RequiresRegister());
   if (CanBeImmediateIndex(index(), class_id())) {
     // CanBeImmediateIndex must return false for unsafe smis.
@@ -1241,15 +1258,14 @@
   } else {
     // The index is either untagged (element size == 1) or a smi (for all
     // element sizes > 1).
-    locs->set_in(1, (index_scale() == 1)
-                        ? Location::WritableRegister()
-                        : Location::RequiresRegister());
+    locs->set_in(1, (index_scale() == 1) ? Location::WritableRegister()
+                                         : Location::RequiresRegister());
   }
   switch (class_id()) {
     case kArrayCid:
       locs->set_in(2, ShouldEmitStoreBarrier()
-                        ? Location::WritableRegister()
-                        : Location::RegisterOrConstant(value()));
+                          ? Location::WritableRegister()
+                          : Location::RegisterOrConstant(value()));
       break;
     case kExternalTypedDataUint8ArrayCid:
     case kExternalTypedDataUint8ClampedArrayCid:
@@ -1293,12 +1309,13 @@
   const Register array = locs()->in(0).reg();
   const Location index = locs()->in(1);
 
-  Address element_address = index.IsRegister()
-      ? Assembler::ElementAddressForRegIndex(
-            IsExternal(), class_id(), index_scale(), array, index.reg())
-      : Assembler::ElementAddressForIntIndex(
-            IsExternal(), class_id(), index_scale(),
-            array, Smi::Cast(index.constant()).Value());
+  Address element_address =
+      index.IsRegister()
+          ? Assembler::ElementAddressForRegIndex(
+                IsExternal(), class_id(), index_scale(), array, index.reg())
+          : Assembler::ElementAddressForIntIndex(
+                IsExternal(), class_id(), index_scale(), array,
+                Smi::Cast(index.constant()).Value());
 
   if ((index_scale() == 1) && index.IsRegister()) {
     __ SmiUntag(index.reg());
@@ -1341,8 +1358,7 @@
         } else if (value < 0) {
           value = 0;
         }
-        __ movb(element_address,
-                Immediate(static_cast<int8_t>(value)));
+        __ movb(element_address, Immediate(static_cast<int8_t>(value)));
       } else {
         ASSERT(locs()->in(2).reg() == EAX);
         Label store_value, store_0xff;
@@ -1397,7 +1413,7 @@
 
   const bool emit_full_guard = !opt || (field_cid == kIllegalCid);
   const bool needs_value_cid_temp_reg =
-    (value_cid == kDynamicCid) && (emit_full_guard || (field_cid != kSmiCid));
+      (value_cid == kDynamicCid) && (emit_full_guard || (field_cid != kSmiCid));
   const bool needs_field_temp_reg = emit_full_guard;
 
   intptr_t num_temps = 0;
@@ -1408,8 +1424,8 @@
     num_temps++;
   }
 
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, num_temps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, num_temps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
 
   for (intptr_t i = 0; i < num_temps; i++) {
@@ -1429,7 +1445,8 @@
   if (field_cid == kDynamicCid) {
     if (Compiler::IsBackgroundCompilation()) {
       // Field state changed while compiling.
-      Compiler::AbortBackgroundCompilation(deopt_id(),
+      Compiler::AbortBackgroundCompilation(
+          deopt_id(),
           "GuardFieldClassInstr: field state changed while compiling");
     }
     ASSERT(!compiler->is_optimizing());
@@ -1446,16 +1463,19 @@
 
   const Register value_reg = locs()->in(0).reg();
 
-  const Register value_cid_reg = needs_value_cid_temp_reg ?
-      locs()->temp(0).reg() : kNoRegister;
+  const Register value_cid_reg =
+      needs_value_cid_temp_reg ? locs()->temp(0).reg() : kNoRegister;
 
-  const Register field_reg = needs_field_temp_reg ?
-      locs()->temp(locs()->temp_count() - 1).reg() : kNoRegister;
+  const Register field_reg = needs_field_temp_reg
+                                 ? locs()->temp(locs()->temp_count() - 1).reg()
+                                 : kNoRegister;
 
   Label ok, fail_label;
 
-  Label* deopt = compiler->is_optimizing() ?
-      compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL;
+  Label* deopt =
+      compiler->is_optimizing()
+          ? compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField)
+          : NULL;
 
   Label* fail = (deopt != NULL) ? deopt : &fail_label;
 
@@ -1463,8 +1483,8 @@
     __ LoadObject(field_reg, Field::ZoneHandle(field().Original()));
 
     FieldAddress field_cid_operand(field_reg, Field::guarded_cid_offset());
-    FieldAddress field_nullability_operand(
-        field_reg, Field::is_nullable_offset());
+    FieldAddress field_nullability_operand(field_reg,
+                                           Field::is_nullable_offset());
 
     if (value_cid == kDynamicCid) {
       LoadValueCid(compiler, value_cid_reg, value_reg);
@@ -1567,8 +1587,8 @@
   const intptr_t kNumInputs = 1;
   if (!opt || (field().guarded_list_length() == Field::kUnknownFixedLength)) {
     const intptr_t kNumTemps = 3;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresRegister());
     // We need temporaries for field object, length offset and expected length.
     summary->set_temp(0, Location::RequiresRegister());
@@ -1576,8 +1596,8 @@
     summary->set_temp(2, Location::RequiresRegister());
     return summary;
   } else {
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, 0, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, 0, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresRegister());
     return summary;
   }
@@ -1589,15 +1609,18 @@
   if (field().guarded_list_length() == Field::kNoFixedLength) {
     if (Compiler::IsBackgroundCompilation()) {
       // Field state changed while compiling.
-      Compiler::AbortBackgroundCompilation(deopt_id(),
+      Compiler::AbortBackgroundCompilation(
+          deopt_id(),
           "GuardFieldLengthInstr: field state changed while compiling");
     }
     ASSERT(!compiler->is_optimizing());
     return;  // Nothing to emit.
   }
 
-  Label* deopt = compiler->is_optimizing() ?
-      compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL;
+  Label* deopt =
+      compiler->is_optimizing()
+          ? compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField)
+          : NULL;
 
   const Register value_reg = locs()->in(0).reg();
 
@@ -1611,10 +1634,12 @@
 
     __ LoadObject(field_reg, Field::ZoneHandle(field().Original()));
 
-    __ movsxb(offset_reg, FieldAddress(field_reg,
-        Field::guarded_list_length_in_object_offset_offset()));
-    __ movl(length_reg, FieldAddress(field_reg,
-        Field::guarded_list_length_offset()));
+    __ movsxb(
+        offset_reg,
+        FieldAddress(field_reg,
+                     Field::guarded_list_length_in_object_offset_offset()));
+    __ movl(length_reg,
+            FieldAddress(field_reg, Field::guarded_list_length_offset()));
 
     __ cmpl(offset_reg, Immediate(0));
     __ j(NEGATIVE, &ok);
@@ -1641,11 +1666,11 @@
     ASSERT(compiler->is_optimizing());
     ASSERT(field().guarded_list_length() >= 0);
     ASSERT(field().guarded_list_length_in_object_offset() !=
-        Field::kUnknownLengthOffset);
+           Field::kUnknownLengthOffset);
 
-    __ cmpl(FieldAddress(value_reg,
-                         field().guarded_list_length_in_object_offset()),
-            Immediate(Smi::RawValue(field().guarded_list_length())));
+    __ cmpl(
+        FieldAddress(value_reg, field().guarded_list_length_in_object_offset()),
+        Immediate(Smi::RawValue(field().guarded_list_length())));
     __ j(NOT_EQUAL, deopt);
   }
 }
@@ -1656,14 +1681,11 @@
   BoxAllocationSlowPath(Instruction* instruction,
                         const Class& cls,
                         Register result)
-      : instruction_(instruction),
-        cls_(cls),
-        result_(result) { }
+      : instruction_(instruction), cls_(cls), result_(result) {}
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     if (Assembler::EmittingComments()) {
-      __ Comment("%s slow path allocation of %s",
-                 instruction_->DebugName(),
+      __ Comment("%s slow path allocation of %s", instruction_->DebugName(),
                  String::Handle(cls_.ScrubbedName()).ToCString());
     }
     __ Bind(entry_label());
@@ -1676,10 +1698,8 @@
     locs->live_registers()->Remove(Location::RegisterLocation(result_));
 
     compiler->SaveLiveRegisters(locs);
-    compiler->GenerateCall(TokenPosition::kNoSource,
-                           stub_entry,
-                           RawPcDescriptors::kOther,
-                           locs);
+    compiler->GenerateCall(TokenPosition::kNoSource, stub_entry,
+                           RawPcDescriptors::kOther, locs);
     compiler->AddStubCallTarget(stub);
     __ MoveRegister(result_, EAX);
     compiler->RestoreLiveRegisters(locs);
@@ -1692,20 +1712,14 @@
                        Register result,
                        Register temp) {
     if (compiler->intrinsic_mode()) {
-      __ TryAllocate(cls,
-                     compiler->intrinsic_slow_path_label(),
-                     Assembler::kFarJump,
-                     result,
-                     temp);
+      __ TryAllocate(cls, compiler->intrinsic_slow_path_label(),
+                     Assembler::kFarJump, result, temp);
     } else {
       BoxAllocationSlowPath* slow_path =
           new BoxAllocationSlowPath(instruction, cls, result);
       compiler->AddSlowPathCode(slow_path);
 
-      __ TryAllocate(cls,
-                     slow_path->entry_label(),
-                     Assembler::kFarJump,
-                     result,
+      __ TryAllocate(cls, slow_path->entry_label(), Assembler::kFarJump, result,
                      temp);
       __ Bind(slow_path->exit_label());
     }
@@ -1722,14 +1736,13 @@
                                                               bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps =
-      (IsUnboxedStore() && opt) ? 2 :
-          ((IsPotentialUnboxedStore()) ? 3 : 0);
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps,
-          ((IsUnboxedStore() && opt && is_initialization()) ||
-           IsPotentialUnboxedStore())
-          ? LocationSummary::kCallOnSlowPath
-          : LocationSummary::kNoCall);
+      (IsUnboxedStore() && opt) ? 2 : ((IsPotentialUnboxedStore()) ? 3 : 0);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps,
+                      ((IsUnboxedStore() && opt && is_initialization()) ||
+                       IsPotentialUnboxedStore())
+                          ? LocationSummary::kCallOnSlowPath
+                          : LocationSummary::kNoCall);
 
   summary->set_in(0, Location::RequiresRegister());
   if (IsUnboxedStore() && opt) {
@@ -1737,17 +1750,16 @@
     summary->set_temp(0, Location::RequiresRegister());
     summary->set_temp(1, Location::RequiresRegister());
   } else if (IsPotentialUnboxedStore()) {
-    summary->set_in(1, ShouldEmitStoreBarrier()
-        ? Location::WritableRegister()
-        :  Location::RequiresRegister());
+    summary->set_in(1, ShouldEmitStoreBarrier() ? Location::WritableRegister()
+                                                : Location::RequiresRegister());
     summary->set_temp(0, Location::RequiresRegister());
     summary->set_temp(1, Location::RequiresRegister());
     summary->set_temp(2, opt ? Location::RequiresFpuRegister()
                              : Location::FpuRegisterLocation(XMM1));
   } else {
     summary->set_in(1, ShouldEmitStoreBarrier()
-                       ? Location::WritableRegister()
-                       : Location::RegisterOrConstant(value()));
+                           ? Location::WritableRegister()
+                           : Location::RegisterOrConstant(value()));
   }
   return summary;
 }
@@ -1768,9 +1780,7 @@
   __ j(NOT_EQUAL, &done);
   BoxAllocationSlowPath::Allocate(compiler, instruction, cls, box_reg, temp);
   __ movl(temp, box_reg);
-  __ StoreIntoObject(instance_reg,
-                     FieldAddress(instance_reg, offset),
-                     temp);
+  __ StoreIntoObject(instance_reg, FieldAddress(instance_reg, offset), temp);
 
   __ Bind(&done);
 }
@@ -1807,8 +1817,7 @@
       BoxAllocationSlowPath::Allocate(compiler, this, *cls, temp, temp2);
       __ movl(temp2, temp);
       __ StoreIntoObject(instance_reg,
-                         FieldAddress(instance_reg, offset_in_bytes_),
-                         temp2);
+                         FieldAddress(instance_reg, offset_in_bytes_), temp2);
     } else {
       __ movl(temp, FieldAddress(instance_reg, offset_in_bytes_));
     }
@@ -1816,15 +1825,15 @@
       case kDoubleCid:
         __ Comment("UnboxedDoubleStoreInstanceFieldInstr");
         __ movsd(FieldAddress(temp, Double::value_offset()), value);
-      break;
+        break;
       case kFloat32x4Cid:
         __ Comment("UnboxedFloat32x4StoreInstanceFieldInstr");
         __ movups(FieldAddress(temp, Float32x4::value_offset()), value);
-      break;
+        break;
       case kFloat64x2Cid:
         __ Comment("UnboxedFloat64x2StoreInstanceFieldInstr");
         __ movups(FieldAddress(temp, Float64x2::value_offset()), value);
-      break;
+        break;
       default:
         UNREACHABLE();
     }
@@ -1882,13 +1891,8 @@
 
     {
       __ Bind(&store_double);
-      EnsureMutableBox(compiler,
-                       this,
-                       temp,
-                       compiler->double_class(),
-                       instance_reg,
-                       offset_in_bytes_,
-                       temp2);
+      EnsureMutableBox(compiler, this, temp, compiler->double_class(),
+                       instance_reg, offset_in_bytes_, temp2);
       __ movsd(fpu_temp, FieldAddress(value_reg, Double::value_offset()));
       __ movsd(FieldAddress(temp, Double::value_offset()), fpu_temp);
       __ jmp(&skip_store);
@@ -1896,13 +1900,8 @@
 
     {
       __ Bind(&store_float32x4);
-      EnsureMutableBox(compiler,
-                       this,
-                       temp,
-                       compiler->float32x4_class(),
-                       instance_reg,
-                       offset_in_bytes_,
-                       temp2);
+      EnsureMutableBox(compiler, this, temp, compiler->float32x4_class(),
+                       instance_reg, offset_in_bytes_, temp2);
       __ movups(fpu_temp, FieldAddress(value_reg, Float32x4::value_offset()));
       __ movups(FieldAddress(temp, Float32x4::value_offset()), fpu_temp);
       __ jmp(&skip_store);
@@ -1910,13 +1909,8 @@
 
     {
       __ Bind(&store_float64x2);
-      EnsureMutableBox(compiler,
-                       this,
-                       temp,
-                       compiler->float64x2_class(),
-                       instance_reg,
-                       offset_in_bytes_,
-                       temp2);
+      EnsureMutableBox(compiler, this, temp, compiler->float64x2_class(),
+                       instance_reg, offset_in_bytes_, temp2);
       __ movups(fpu_temp, FieldAddress(value_reg, Float64x2::value_offset()));
       __ movups(FieldAddress(temp, Float64x2::value_offset()), fpu_temp);
       __ jmp(&skip_store);
@@ -1928,15 +1922,13 @@
   if (ShouldEmitStoreBarrier()) {
     Register value_reg = locs()->in(1).reg();
     __ StoreIntoObject(instance_reg,
-                       FieldAddress(instance_reg, offset_in_bytes_),
-                       value_reg,
+                       FieldAddress(instance_reg, offset_in_bytes_), value_reg,
                        CanValueBeSmi());
   } else {
     if (locs()->in(1).IsConstant()) {
-      __ StoreIntoObjectNoBarrier(
-          instance_reg,
-          FieldAddress(instance_reg, offset_in_bytes_),
-          locs()->in(1).constant());
+      __ StoreIntoObjectNoBarrier(instance_reg,
+                                  FieldAddress(instance_reg, offset_in_bytes_),
+                                  locs()->in(1).constant());
     } else {
       Register value_reg = locs()->in(1).reg();
       __ StoreIntoObjectNoBarrier(instance_reg,
@@ -1952,8 +1944,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   // By specifying same register as input, our simple register allocator can
   // generate better code.
@@ -1976,8 +1968,8 @@
 
 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Zone* zone,
                                                             bool opt) const {
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, 1, 1, LocationSummary::kNoCall);
+  LocationSummary* locs =
+      new (zone) LocationSummary(zone, 1, 1, LocationSummary::kNoCall);
   locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister()
                                               : Location::RequiresRegister());
   locs->set_temp(0, Location::RequiresRegister());
@@ -1991,10 +1983,8 @@
 
   __ LoadObject(temp, Field::ZoneHandle(Z, field().Original()));
   if (this->value()->NeedsStoreBuffer()) {
-    __ StoreIntoObject(temp,
-                       FieldAddress(temp, Field::static_value_offset()),
-                       value,
-                       CanValueBeSmi());
+    __ StoreIntoObject(temp, FieldAddress(temp, Field::static_value_offset()),
+                       value, CanValueBeSmi());
   } else {
     __ StoreIntoObjectNoBarrier(
         temp, FieldAddress(temp, Field::static_value_offset()), value);
@@ -2006,8 +1996,8 @@
                                                       bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(EAX));
   summary->set_in(1, Location::RegisterLocation(EDX));
   summary->set_out(0, Location::RegisterLocation(EAX));
@@ -2019,10 +2009,7 @@
   ASSERT(locs()->in(0).reg() == EAX);  // Value.
   ASSERT(locs()->in(1).reg() == EDX);  // Instantiator type arguments.
 
-  compiler->GenerateInstanceOf(token_pos(),
-                               deopt_id(),
-                               type(),
-                               negate_result(),
+  compiler->GenerateInstanceOf(token_pos(), deopt_id(), type(), negate_result(),
                                locs());
   ASSERT(locs()->out(0).reg() == EAX);
 }
@@ -2034,8 +2021,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(ECX));
   locs->set_in(1, Location::RegisterLocation(EDX));
   locs->set_out(0, Location::RegisterLocation(EAX));
@@ -2056,18 +2043,16 @@
   // Instance in EAX.
   // Object end address in EBX.
   __ TryAllocateArray(kArrayCid, instance_size, slow_path, Assembler::kFarJump,
-                      EAX,  // instance
-                      EBX,  // end address
+                      EAX,   // instance
+                      EBX,   // end address
                       EDI);  // temp
 
   // Store the type argument field.
-  __ StoreIntoObjectNoBarrier(EAX,
-                              FieldAddress(EAX, Array::type_arguments_offset()),
-                              kElemTypeReg);
+  __ StoreIntoObjectNoBarrier(
+      EAX, FieldAddress(EAX, Array::type_arguments_offset()), kElemTypeReg);
 
   // Set the length field.
-  __ StoreIntoObjectNoBarrier(EAX,
-                              FieldAddress(EAX, Array::length_offset()),
+  __ StoreIntoObjectNoBarrier(EAX, FieldAddress(EAX, Array::length_offset()),
                               kLengthReg);
 
   // Initialize all array elements to raw_null.
@@ -2109,8 +2094,7 @@
   ASSERT(locs()->in(1).reg() == kLengthReg);
 
   Label slow_path, done;
-  if (compiler->is_optimizing() &&
-      num_elements()->BindsToConstant() &&
+  if (compiler->is_optimizing() && num_elements()->BindsToConstant() &&
       num_elements()->BoundConstant().IsSmi()) {
     const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value();
     if ((length >= 0) && (length <= Array::kMaxElements)) {
@@ -2120,11 +2104,8 @@
       __ PushObject(Object::null_object());  // Make room for the result.
       __ pushl(kLengthReg);
       __ pushl(kElemTypeReg);
-      compiler->GenerateRuntimeCall(token_pos(),
-                                    deopt_id(),
-                                    kAllocateArrayRuntimeEntry,
-                                    2,
-                                    locs());
+      compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                    kAllocateArrayRuntimeEntry, 2, locs());
       __ Drop(2);
       __ popl(kResultReg);
       __ Bind(&done);
@@ -2136,10 +2117,8 @@
   const Code& stub = Code::ZoneHandle(compiler->zone(),
                                       StubCode::AllocateArray_entry()->code());
   compiler->AddStubCallTarget(stub);
-  compiler->GenerateCall(token_pos(),
-                         *StubCode::AllocateArray_entry(),
-                         RawPcDescriptors::kOther,
-                         locs());
+  compiler->GenerateCall(token_pos(), *StubCode::AllocateArray_entry(),
+                         RawPcDescriptors::kOther, locs());
   __ Bind(&done);
   ASSERT(locs()->out(0).reg() == kResultReg);
 }
@@ -2149,14 +2128,12 @@
                                                      bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps =
-      (IsUnboxedLoad() && opt) ? 1 :
-          ((IsPotentialUnboxedLoad()) ? 2 : 0);
+      (IsUnboxedLoad() && opt) ? 1 : ((IsPotentialUnboxedLoad()) ? 2 : 0);
 
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps,
-          (opt && !IsPotentialUnboxedLoad())
-          ? LocationSummary::kNoCall
-          : LocationSummary::kCallOnSlowPath);
+  LocationSummary* locs = new (zone) LocationSummary(
+      zone, kNumInputs, kNumTemps, (opt && !IsPotentialUnboxedLoad())
+                                       ? LocationSummary::kNoCall
+                                       : LocationSummary::kCallOnSlowPath);
 
   locs->set_in(0, Location::RequiresRegister());
 
@@ -2238,8 +2215,8 @@
 
     {
       __ Bind(&load_double);
-      BoxAllocationSlowPath::Allocate(
-          compiler, this, compiler->double_class(), result, temp);
+      BoxAllocationSlowPath::Allocate(compiler, this, compiler->double_class(),
+                                      result, temp);
       __ movl(temp, FieldAddress(instance_reg, offset_in_bytes()));
       __ movsd(value, FieldAddress(temp, Double::value_offset()));
       __ movsd(FieldAddress(result, Double::value_offset()), value);
@@ -2277,8 +2254,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(EAX));
   locs->set_out(0, Location::RegisterLocation(EAX));
   return locs;
@@ -2294,23 +2271,21 @@
   __ PushObject(Object::null_object());  // Make room for the result.
   __ PushObject(type());
   __ pushl(instantiator_reg);  // Push instantiator type arguments.
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kInstantiateTypeRuntimeEntry,
-                                2,
-                                locs());
-  __ Drop(2);  // Drop instantiator and uninstantiated type.
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                kInstantiateTypeRuntimeEntry, 2, locs());
+  __ Drop(2);           // Drop instantiator and uninstantiated type.
   __ popl(result_reg);  // Pop instantiated type.
   ASSERT(instantiator_reg == result_reg);
 }
 
 
 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(EAX));
   locs->set_out(0, Location::RegisterLocation(EAX));
   return locs;
@@ -2366,12 +2341,10 @@
   __ PushObject(Object::null_object());  // Make room for the result.
   __ PushObject(type_arguments());
   __ pushl(instantiator_reg);  // Push instantiator type arguments.
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kInstantiateTypeArgumentsRuntimeEntry,
-                                2,
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                kInstantiateTypeArgumentsRuntimeEntry, 2,
                                 locs());
-  __ Drop(2);  // Drop instantiator and uninstantiated type arguments.
+  __ Drop(2);           // Drop instantiator and uninstantiated type arguments.
   __ popl(result_reg);  // Pop instantiated type arguments.
   __ Bind(&type_arguments_instantiated);
 }
@@ -2383,7 +2356,7 @@
   ASSERT(opt);
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 2;
-  LocationSummary* locs = new(zone) LocationSummary(
+  LocationSummary* locs = new (zone) LocationSummary(
       zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   locs->set_temp(0, Location::RegisterLocation(ECX));
   locs->set_temp(1, Location::RegisterLocation(EDI));
@@ -2396,7 +2369,7 @@
  public:
   explicit AllocateContextSlowPath(
       AllocateUninitializedContextInstr* instruction)
-      : instruction_(instruction) { }
+      : instruction_(instruction) {}
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     __ Comment("AllocateContextSlowPath");
@@ -2413,8 +2386,7 @@
     compiler->AddStubCallTarget(stub);
     compiler->GenerateCall(instruction_->token_pos(),
                            *StubCode::AllocateContext_entry(),
-                           RawPcDescriptors::kOther,
-                           locs);
+                           RawPcDescriptors::kOther, locs);
     ASSERT(instruction_->locs()->out(0).reg() == EAX);
     compiler->RestoreLiveRegisters(instruction_->locs());
     __ jmp(exit_label());
@@ -2439,7 +2411,7 @@
   __ TryAllocateArray(kContextCid, instance_size, slow_path->entry_label(),
                       Assembler::kFarJump,
                       result,  // instance
-                      temp,  // end address
+                      temp,    // end address
                       temp2);  // temp
 
   // Setup up number of context variables field.
@@ -2454,8 +2426,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 1;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_temp(0, Location::RegisterLocation(EDX));
   locs->set_out(0, Location::RegisterLocation(EAX));
   return locs;
@@ -2467,10 +2439,8 @@
   ASSERT(locs()->out(0).reg() == EAX);
 
   __ movl(EDX, Immediate(num_context_variables()));
-  compiler->GenerateCall(token_pos(),
-                         *StubCode::AllocateContext_entry(),
-                         RawPcDescriptors::kOther,
-                         locs());
+  compiler->GenerateCall(token_pos(), *StubCode::AllocateContext_entry(),
+                         RawPcDescriptors::kOther, locs());
 }
 
 
@@ -2478,8 +2448,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(EAX));
   locs->set_temp(0, Location::RegisterLocation(ECX));
   return locs;
@@ -2502,11 +2472,8 @@
   __ Bind(&call_runtime);
   __ PushObject(Object::null_object());  // Make room for (unused) result.
   __ pushl(field);
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kInitStaticFieldRuntimeEntry,
-                                1,
-                                locs());
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                kInitStaticFieldRuntimeEntry, 1, locs());
   __ Drop(2);  // Remove argument and unused result.
   __ Bind(&no_call);
 }
@@ -2516,8 +2483,8 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(EAX));
   locs->set_out(0, Location::RegisterLocation(EAX));
   return locs;
@@ -2530,11 +2497,8 @@
 
   __ PushObject(Object::null_object());  // Make room for the result.
   __ pushl(context_value);
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kCloneContextRuntimeEntry,
-                                1,
-                                locs());
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                kCloneContextRuntimeEntry, 1, locs());
   __ popl(result);  // Remove argument.
   __ popl(result);  // Get result (cloned context).
 }
@@ -2548,24 +2512,17 @@
 
 
 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  // Ensure space for patching return sites for lazy deopt.
-  if (!FLAG_precompiled_mode && compiler->is_optimizing()) {
-    __ nop(CallPattern::pattern_length_in_bytes());
-  }
   __ Bind(compiler->GetJumpLabel(this));
-  compiler->AddExceptionHandler(catch_try_index(),
-                                try_index(),
+  compiler->AddExceptionHandler(catch_try_index(), try_index(),
                                 compiler->assembler()->CodeSize(),
-                                catch_handler_types_,
-                                needs_stacktrace());
+                                catch_handler_types_, needs_stacktrace());
   // On lazy deoptimization we patch the optimized code here to enter the
   // deoptimization stub.
   const intptr_t deopt_id = Thread::ToDeoptAfter(GetDeoptId());
   if (compiler->is_optimizing()) {
     compiler->AddDeoptIndexAtCall(deopt_id);
   } else {
-    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                                   deopt_id,
+    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id,
                                    TokenPosition::kNoSource);
   }
   if (HasParallelMove()) {
@@ -2592,10 +2549,8 @@
                                                               bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = opt ? 0 : 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs,
-                          kNumTemps,
-                          LocationSummary::kCallOnSlowPath);
+  LocationSummary* summary = new (zone) LocationSummary(
+      zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   if (!opt) {
     summary->set_temp(0, Location::RequiresRegister());
   }
@@ -2606,7 +2561,7 @@
 class CheckStackOverflowSlowPath : public SlowPathCode {
  public:
   explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction)
-      : instruction_(instruction) { }
+      : instruction_(instruction) {}
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     if (FLAG_use_osr && osr_entry_label()->IsLinked()) {
@@ -2623,11 +2578,9 @@
     ASSERT(compiler->pending_deoptimization_env_ == NULL);
     Environment* env = compiler->SlowPathEnvironmentFor(instruction_);
     compiler->pending_deoptimization_env_ = env;
-    compiler->GenerateRuntimeCall(instruction_->token_pos(),
-                                  instruction_->deopt_id(),
-                                  kStackOverflowRuntimeEntry,
-                                  0,
-                                  instruction_->locs());
+    compiler->GenerateRuntimeCall(
+        instruction_->token_pos(), instruction_->deopt_id(),
+        kStackOverflowRuntimeEntry, 0, instruction_->locs());
 
     if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) {
       // In unoptimized code, record loop stack checks as possible OSR entries.
@@ -2683,9 +2636,10 @@
   Register left = locs.in(0).reg();
   Register result = locs.out(0).reg();
   ASSERT(left == result);
-  Label* deopt = shift_left->CanDeoptimize() ?
-      compiler->AddDeoptStub(shift_left->deopt_id(), ICData::kDeoptBinarySmiOp)
-      : NULL;
+  Label* deopt = shift_left->CanDeoptimize()
+                     ? compiler->AddDeoptStub(shift_left->deopt_id(),
+                                              ICData::kDeoptBinarySmiOp)
+                     : NULL;
   if (locs.in(1).IsConstant()) {
     const Object& constant = locs.in(1).constant();
     ASSERT(constant.IsSmi());
@@ -2732,7 +2686,7 @@
           !RangeUtils::IsWithin(right_range, 0, max_right - 1);
       if (right_needs_check) {
         __ cmpl(right,
-            Immediate(reinterpret_cast<int32_t>(Smi::New(max_right))));
+                Immediate(reinterpret_cast<int32_t>(Smi::New(max_right))));
         __ j(ABOVE_EQUAL, deopt);
       }
       __ SmiUntag(right);
@@ -2755,7 +2709,7 @@
       }
       Label done, is_not_zero;
       __ cmpl(right,
-          Immediate(reinterpret_cast<int32_t>(Smi::New(Smi::kBits))));
+              Immediate(reinterpret_cast<int32_t>(Smi::New(Smi::kBits))));
       __ j(BELOW, &is_not_zero, Assembler::kNearJump);
       __ xorl(left, left);
       __ jmp(&done, Assembler::kNearJump);
@@ -2771,7 +2725,7 @@
     if (right_needs_check) {
       ASSERT(shift_left->CanDeoptimize());
       __ cmpl(right,
-        Immediate(reinterpret_cast<int32_t>(Smi::New(Smi::kBits))));
+              Immediate(reinterpret_cast<int32_t>(Smi::New(Smi::kBits))));
       __ j(ABOVE_EQUAL, deopt);
     }
     // Left is not a constant.
@@ -2804,6 +2758,37 @@
 }
 
 
+LocationSummary* CheckedSmiComparisonInstr::MakeLocationSummary(
+    Zone* zone,
+    bool opt) const {
+  // Only for precompiled code, not on ia32 currently.
+  UNIMPLEMENTED();
+  return NULL;
+}
+
+
+Condition CheckedSmiComparisonInstr::EmitComparisonCode(
+    FlowGraphCompiler* compiler,
+    BranchLabels labels) {
+  // Only for precompiled code, not on ia32 currently.
+  UNIMPLEMENTED();
+  return ZERO;
+}
+
+
+void CheckedSmiComparisonInstr::EmitBranchCode(FlowGraphCompiler* compiler,
+                                               BranchInstr* instr) {
+  // Only for precompiled code, not on ia32 currently.
+  UNIMPLEMENTED();
+}
+
+
+void CheckedSmiComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  // Only for precompiled code, not on ia32 currently.
+  UNIMPLEMENTED();
+}
+
+
 static bool IsSmiValue(const Object& constant, intptr_t value) {
   return constant.IsSmi() && (Smi::Cast(constant).Value() == value);
 }
@@ -2814,8 +2799,8 @@
   const intptr_t kNumInputs = 2;
   if (op_kind() == Token::kTRUNCDIV) {
     const intptr_t kNumTemps = 1;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     if (RightIsPowerOfTwoConstant()) {
       summary->set_in(0, Location::RequiresRegister());
       ConstantInstr* right_constant = right()->definition()->AsConstant();
@@ -2834,8 +2819,8 @@
     return summary;
   } else if (op_kind() == Token::kMOD) {
     const intptr_t kNumTemps = 1;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     // Both inputs must be writable because they will be untagged.
     summary->set_in(0, Location::RegisterLocation(EDX));
     summary->set_in(1, Location::WritableRegister());
@@ -2845,8 +2830,8 @@
     return summary;
   } else if (op_kind() == Token::kSHR) {
     const intptr_t kNumTemps = 0;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresRegister());
     summary->set_in(1, Location::FixedRegisterOrSmiConstant(right(), ECX));
     summary->set_out(0, Location::SameAsFirstInput());
@@ -2857,8 +2842,8 @@
     const bool shiftBy1 =
         (right_constant != NULL) && IsSmiValue(right_constant->value(), 1);
     const intptr_t kNumTemps = (can_overflow() && !shiftBy1) ? 1 : 0;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresRegister());
     summary->set_in(1, Location::FixedRegisterOrSmiConstant(right(), ECX));
     if (kNumTemps == 1) {
@@ -2868,8 +2853,8 @@
     return summary;
   } else {
     const intptr_t kNumTemps = 0;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresRegister());
     ConstantInstr* constant = right()->definition()->AsConstant();
     if (constant != NULL) {
@@ -2883,7 +2868,7 @@
 }
 
 
-template<typename OperandType>
+template <typename OperandType>
 static void EmitIntegerArithmetic(FlowGraphCompiler* compiler,
                                   Token::Kind op_kind,
                                   Register left,
@@ -2940,13 +2925,9 @@
       case Token::kBIT_OR:
       case Token::kBIT_XOR:
       case Token::kMUL: {
-        const intptr_t imm = (op_kind() == Token::kMUL) ? value
-                                                        : Smi::RawValue(value);
-        EmitIntegerArithmetic(compiler,
-                              op_kind(),
-                              left,
-                              Immediate(imm),
-                              deopt);
+        const intptr_t imm =
+            (op_kind() == Token::kMUL) ? value : Smi::RawValue(value);
+        EmitIntegerArithmetic(compiler, op_kind(), left, Immediate(imm), deopt);
         break;
       }
 
@@ -2973,8 +2954,8 @@
       case Token::kSHR: {
         // sarl operation masks the count to 5 bits.
         const intptr_t kCountLimit = 0x1F;
-        __ sarl(left, Immediate(
-            Utils::Minimum(value + kSmiTagSize, kCountLimit)));
+        __ sarl(left,
+                Immediate(Utils::Minimum(value + kSmiTagSize, kCountLimit)));
         __ SmiTag(left);
         break;
       }
@@ -3024,7 +3005,7 @@
       ASSERT(result == EAX);
       __ SmiUntag(left);
       __ SmiUntag(right);
-      __ cdq();  // Sign extend EAX -> EDX:EAX.
+      __ cdq();         // Sign extend EAX -> EDX:EAX.
       __ idivl(right);  //  EAX: quotient, EDX: remainder.
       // Check the corner case of dividing the 'MIN_SMI' with -1, in which
       // case we cannot tag the result.
@@ -3046,7 +3027,7 @@
       __ SmiUntag(left);
       __ SmiUntag(right);
       __ movl(EAX, EDX);
-      __ cdq();  // Sign extend EAX -> EDX:EAX.
+      __ cdq();         // Sign extend EAX -> EDX:EAX.
       __ idivl(right);  //  EAX: quotient, EDX: remainder.
       //  res = left % right;
       //  if (res < 0) {
@@ -3129,20 +3110,20 @@
     UNREACHABLE();
     return NULL;
   } else if (op_kind() == Token::kMOD) {
-     UNREACHABLE();
+    UNREACHABLE();
     return NULL;
   } else if (op_kind() == Token::kSHR) {
     const intptr_t kNumTemps = 0;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresRegister());
     summary->set_in(1, Location::FixedRegisterOrSmiConstant(right(), ECX));
     summary->set_out(0, Location::SameAsFirstInput());
     return summary;
   } else if (op_kind() == Token::kSHL) {
     const intptr_t kNumTemps = can_overflow() ? 1 : 0;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresRegister());
     summary->set_in(1, Location::FixedRegisterOrSmiConstant(right(), ECX));
     if (can_overflow()) {
@@ -3152,8 +3133,8 @@
     return summary;
   } else {
     const intptr_t kNumTemps = 0;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresRegister());
     ConstantInstr* constant = right()->definition()->AsConstant();
     if (constant != NULL) {
@@ -3173,9 +3154,10 @@
   Register left = locs.in(0).reg();
   Register result = locs.out(0).reg();
   ASSERT(left == result);
-  Label* deopt = shift_left->CanDeoptimize() ?
-      compiler->AddDeoptStub(shift_left->deopt_id(), ICData::kDeoptBinarySmiOp)
-      : NULL;
+  Label* deopt = shift_left->CanDeoptimize()
+                     ? compiler->AddDeoptStub(shift_left->deopt_id(),
+                                              ICData::kDeoptBinarySmiOp)
+                     : NULL;
   ASSERT(locs.in(1).IsConstant());
 
   const Object& constant = locs.in(1).constant();
@@ -3209,7 +3191,7 @@
   ASSERT(left == result);
   Label* deopt = NULL;
   if (CanDeoptimize()) {
-    deopt  = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinarySmiOp);
+    deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinarySmiOp);
   }
 
   if (locs()->in(1).IsConstant()) {
@@ -3223,15 +3205,11 @@
       case Token::kBIT_AND:
       case Token::kBIT_OR:
       case Token::kBIT_XOR:
-        EmitIntegerArithmetic(compiler,
-                              op_kind(),
-                              left,
-                              Immediate(value),
+        EmitIntegerArithmetic(compiler, op_kind(), left, Immediate(value),
                               deopt);
         break;
 
 
-
       case Token::kTRUNCDIV: {
         UNREACHABLE();
         break;
@@ -3253,11 +3231,7 @@
 
   if (locs()->in(1).IsStackSlot()) {
     const Address& right = locs()->in(1).ToStackSlotAddress();
-    EmitIntegerArithmetic(compiler,
-                          op_kind(),
-                          left,
-                          right,
-                          deopt);
+    EmitIntegerArithmetic(compiler, op_kind(), left, right, deopt);
     return;
   }  // if locs()->in(1).IsStackSlot.
 
@@ -3270,11 +3244,7 @@
     case Token::kBIT_AND:
     case Token::kBIT_OR:
     case Token::kBIT_XOR:
-      EmitIntegerArithmetic(compiler,
-                            op_kind(),
-                            left,
-                            right,
-                            deopt);
+      EmitIntegerArithmetic(compiler, op_kind(), left, right, deopt);
       break;
 
     default:
@@ -3288,8 +3258,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = (op_kind() == Token::kMUL) ? 1 : 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   if (op_kind() == Token::kMUL) {
     summary->set_in(0, Location::RegisterLocation(EAX));
     summary->set_temp(0, Location::RegisterLocation(EDX));
@@ -3333,12 +3303,11 @@
   intptr_t right_cid = right()->Type()->ToCid();
   ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid));
   const intptr_t kNumInputs = 2;
-  const bool need_temp = (left()->definition() != right()->definition())
-                      && (left_cid != kSmiCid)
-                      && (right_cid != kSmiCid);
+  const bool need_temp = (left()->definition() != right()->definition()) &&
+                         (left_cid != kSmiCid) && (right_cid != kSmiCid);
   const intptr_t kNumTemps = need_temp ? 1 : 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   if (need_temp) summary->set_temp(0, Location::RequiresRegister());
@@ -3347,16 +3316,16 @@
 
 
 void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  Label* deopt = compiler->AddDeoptStub(deopt_id(),
-                                        ICData::kDeoptBinaryDoubleOp,
-                                        licm_hoisted_ ? ICData::kHoisted : 0);
+  Label* deopt =
+      compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinaryDoubleOp,
+                             licm_hoisted_ ? ICData::kHoisted : 0);
   intptr_t left_cid = left()->Type()->ToCid();
   intptr_t right_cid = right()->Type()->ToCid();
   Register left = locs()->in(0).reg();
   Register right = locs()->in(1).reg();
   if (this->left()->definition() == this->right()->definition()) {
     __ testl(left, Immediate(kSmiTagMask));
-  } else  if (left_cid == kSmiCid) {
+  } else if (left_cid == kSmiCid) {
     __ testl(right, Immediate(kSmiTagMask));
   } else if (right_cid == kSmiCid) {
     __ testl(left, Immediate(kSmiTagMask));
@@ -3370,11 +3339,10 @@
 }
 
 
-LocationSummary* BoxInstr::MakeLocationSummary(Zone* zone,
-                                                     bool opt) const {
+LocationSummary* BoxInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
+  LocationSummary* summary = new (zone) LocationSummary(
       zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_temp(0, Location::RequiresRegister());
@@ -3387,12 +3355,9 @@
   Register out_reg = locs()->out(0).reg();
   XmmRegister value = locs()->in(0).fpu_reg();
 
-  BoxAllocationSlowPath::Allocate(
-      compiler,
-      this,
-      compiler->BoxClassFor(from_representation()),
-      out_reg,
-      locs()->temp(0).reg());
+  BoxAllocationSlowPath::Allocate(compiler, this,
+                                  compiler->BoxClassFor(from_representation()),
+                                  out_reg, locs()->temp(0).reg());
 
   switch (from_representation()) {
     case kUnboxedDouble:
@@ -3410,15 +3375,15 @@
 }
 
 
-LocationSummary* UnboxInstr::MakeLocationSummary(Zone* zone,
-                                                       bool opt) const {
-  const bool needs_temp = CanDeoptimize() ||
+LocationSummary* UnboxInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+  const bool needs_temp =
+      CanDeoptimize() ||
       (CanConvertSmi() && (value()->Type()->ToCid() == kSmiCid));
 
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = needs_temp ? 1 : 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   if (needs_temp) {
     summary->set_temp(0, Location::RequiresRegister());
@@ -3507,8 +3472,8 @@
   } else {
     const Register box = locs()->in(0).reg();
     const Register temp = locs()->temp(0).reg();
-    Label* deopt = compiler->AddDeoptStub(GetDeoptId(),
-                                          ICData::kDeoptCheckClass);
+    Label* deopt =
+        compiler->AddDeoptStub(GetDeoptId(), ICData::kDeoptCheckClass);
     Label is_smi;
 
     if ((value()->Type()->ToNullableCid() == box_cid) &&
@@ -3541,12 +3506,12 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = ValueFitsSmi() ? 0 : 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps,
-      ValueFitsSmi() ? LocationSummary::kNoCall
-                     : LocationSummary::kCallOnSlowPath);
-  const bool needs_writable_input = ValueFitsSmi() ||
-      (from_representation() == kUnboxedUint32);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps,
+                      ValueFitsSmi() ? LocationSummary::kNoCall
+                                     : LocationSummary::kCallOnSlowPath);
+  const bool needs_writable_input =
+      ValueFitsSmi() || (from_representation() == kUnboxedUint32);
   summary->set_in(0, needs_writable_input ? Location::RequiresRegister()
                                           : Location::WritableRegister());
   if (!ValueFitsSmi()) {
@@ -3578,8 +3543,8 @@
     // Value input is writable register and has to be manually preserved
     // on the slow path.
     locs()->live_registers()->Add(locs()->in(0), kUnboxedInt32);
-    BoxAllocationSlowPath::Allocate(
-        compiler, this, compiler->mint_class(), out, locs()->temp(0).reg());
+    BoxAllocationSlowPath::Allocate(compiler, this, compiler->mint_class(), out,
+                                    locs()->temp(0).reg());
     __ movl(FieldAddress(out, Mint::value_offset()), value);
     if (from_representation() == kUnboxedInt32) {
       __ sarl(value, Immediate(31));  // Sign extend.
@@ -3597,12 +3562,10 @@
                                                     bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = ValueFitsSmi() ? 0 : 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs,
-                          kNumTemps,
-                          ValueFitsSmi()
-                              ? LocationSummary::kNoCall
-                              : LocationSummary::kCallOnSlowPath);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps,
+                      ValueFitsSmi() ? LocationSummary::kNoCall
+                                     : LocationSummary::kCallOnSlowPath);
   summary->set_in(0, Location::Pair(Location::RequiresRegister(),
                                     Location::RequiresRegister()));
   if (!ValueFitsSmi()) {
@@ -3653,8 +3616,8 @@
   // 3. Restore lower half of input before using it.
   __ subl(value_lo, Immediate(0x40000000));
 
-  BoxAllocationSlowPath::Allocate(
-      compiler, this, compiler->mint_class(), out_reg, locs()->temp(0).reg());
+  BoxAllocationSlowPath::Allocate(compiler, this, compiler->mint_class(),
+                                  out_reg, locs()->temp(0).reg());
   __ movl(FieldAddress(out_reg, Mint::value_offset()), value_lo);
   __ movl(FieldAddress(out_reg, Mint::value_offset() + kWordSize), value_hi);
   __ Bind(&done);
@@ -3668,23 +3631,22 @@
   intptr_t kNumTemps = 0;
 
   if (CanDeoptimize()) {
-    if ((value_cid != kSmiCid) &&
-        (value_cid != kMintCid) &&
-        !is_truncating()) {
+    if ((value_cid != kSmiCid) && (value_cid != kMintCid) && !is_truncating()) {
       kNumTemps = 2;
     } else {
       kNumTemps = 1;
     }
   }
 
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   for (int i = 0; i < kNumTemps; i++) {
     summary->set_temp(i, Location::RequiresRegister());
   }
-  summary->set_out(0, ((value_cid == kSmiCid) || (value_cid != kMintCid)) ?
-      Location::SameAsFirstInput() : Location::RequiresRegister());
+  summary->set_out(0, ((value_cid == kSmiCid) || (value_cid != kMintCid))
+                          ? Location::SameAsFirstInput()
+                          : Location::RequiresRegister());
   return summary;
 }
 
@@ -3711,8 +3673,10 @@
   Register value = locs()->in(0).reg();
   const Register result = locs()->out(0).reg();
   const Register temp = CanDeoptimize() ? locs()->temp(0).reg() : kNoRegister;
-  Label* deopt = CanDeoptimize() ?
-      compiler->AddDeoptStub(GetDeoptId(), ICData::kDeoptUnboxInteger) : NULL;
+  Label* deopt =
+      CanDeoptimize()
+          ? compiler->AddDeoptStub(GetDeoptId(), ICData::kDeoptUnboxInteger)
+          : NULL;
   Label* out_of_range = !is_truncating() ? deopt : NULL;
 
   const intptr_t lo_offset = Mint::value_offset();
@@ -3723,12 +3687,8 @@
     __ SmiUntag(value);
   } else if (value_cid == kMintCid) {
     ASSERT((value != result) || (out_of_range == NULL));
-    LoadInt32FromMint(compiler,
-                      result,
-                      FieldAddress(value, lo_offset),
-                      FieldAddress(value, hi_offset),
-                      temp,
-                      out_of_range);
+    LoadInt32FromMint(compiler, result, FieldAddress(value, lo_offset),
+                      FieldAddress(value, hi_offset), temp, out_of_range);
   } else if (!CanDeoptimize()) {
     ASSERT(value == result);
     Label done;
@@ -3746,12 +3706,8 @@
       __ movl(value_temp, value);
       value = value_temp;
     }
-    LoadInt32FromMint(compiler,
-                      result,
-                      Address(value, TIMES_2, lo_offset),
-                      Address(value, TIMES_2, hi_offset),
-                      temp,
-                      out_of_range);
+    LoadInt32FromMint(compiler, result, Address(value, TIMES_2, lo_offset),
+                      Address(value, TIMES_2, hi_offset), temp, out_of_range);
     __ Bind(&done);
   }
 }
@@ -3762,7 +3718,7 @@
   const bool might_box = (representation() == kTagged) && !can_pack_into_smi();
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = might_box ? 2 : 0;
-  LocationSummary* summary = new(zone) LocationSummary(
+  LocationSummary* summary = new (zone) LocationSummary(
       zone, kNumInputs, kNumTemps,
       might_box ? LocationSummary::kCallOnSlowPath : LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
@@ -3793,7 +3749,7 @@
   const Location index = locs()->in(1);
 
   Address element_address = Assembler::ElementAddressForRegIndex(
-        IsExternal(), class_id(), index_scale(), str, index.reg());
+      IsExternal(), class_id(), index_scale(), str, index.reg());
 
   if ((index_scale() == 1)) {
     __ SmiUntag(index.reg());
@@ -3829,18 +3785,30 @@
       case kOneByteStringCid:
       case kExternalOneByteStringCid:
         switch (element_count()) {
-          case 1: __ movzxb(result, element_address); break;
-          case 2: __ movzxw(result, element_address); break;
-          case 4: __ movl(result, element_address); break;
-          default: UNREACHABLE();
+          case 1:
+            __ movzxb(result, element_address);
+            break;
+          case 2:
+            __ movzxw(result, element_address);
+            break;
+          case 4:
+            __ movl(result, element_address);
+            break;
+          default:
+            UNREACHABLE();
         }
         break;
       case kTwoByteStringCid:
       case kExternalTwoByteStringCid:
         switch (element_count()) {
-          case 1: __ movzxw(result, element_address); break;
-          case 2: __ movl(result, element_address); break;
-          default: UNREACHABLE();
+          case 1:
+            __ movzxw(result, element_address);
+            break;
+          case 2:
+            __ movl(result, element_address);
+            break;
+          default:
+            UNREACHABLE();
         }
         break;
       default:
@@ -3863,8 +3831,8 @@
       Label done;
       __ testl(temp, Immediate(0xC0000000));
       __ j(ZERO, &done);
-      BoxAllocationSlowPath::Allocate(
-          compiler, this, compiler->mint_class(), result, temp2);
+      BoxAllocationSlowPath::Allocate(compiler, this, compiler->mint_class(),
+                                      result, temp2);
       __ movl(FieldAddress(result, Mint::value_offset()), temp);
       __ movl(FieldAddress(result, Mint::value_offset() + kWordSize),
               Immediate(0));
@@ -3878,8 +3846,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -3894,21 +3862,106 @@
   ASSERT(locs()->out(0).fpu_reg() == left);
 
   switch (op_kind()) {
-    case Token::kADD: __ addsd(left, right); break;
-    case Token::kSUB: __ subsd(left, right); break;
-    case Token::kMUL: __ mulsd(left, right); break;
-    case Token::kDIV: __ divsd(left, right); break;
-    default: UNREACHABLE();
+    case Token::kADD:
+      __ addsd(left, right);
+      break;
+    case Token::kSUB:
+      __ subsd(left, right);
+      break;
+    case Token::kMUL:
+      __ mulsd(left, right);
+      break;
+    case Token::kDIV:
+      __ divsd(left, right);
+      break;
+    default:
+      UNREACHABLE();
   }
 }
 
 
+LocationSummary* DoubleTestOpInstr::MakeLocationSummary(Zone* zone,
+                                                        bool opt) const {
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps =
+      (op_kind() == MethodRecognizer::kDouble_getIsInfinite) ? 1 : 0;
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresFpuRegister());
+  if (op_kind() == MethodRecognizer::kDouble_getIsInfinite) {
+    summary->set_temp(0, Location::RequiresRegister());
+  }
+  summary->set_out(0, Location::RequiresRegister());
+  return summary;
+}
+
+
+Condition DoubleTestOpInstr::EmitComparisonCode(FlowGraphCompiler* compiler,
+                                                BranchLabels labels) {
+  ASSERT(compiler->is_optimizing());
+  const XmmRegister value = locs()->in(0).fpu_reg();
+  const bool is_negated = kind() != Token::kEQ;
+  if (op_kind() == MethodRecognizer::kDouble_getIsNaN) {
+    Label is_nan;
+    __ comisd(value, value);
+    return is_negated ? PARITY_ODD : PARITY_EVEN;
+  } else {
+    ASSERT(op_kind() == MethodRecognizer::kDouble_getIsInfinite);
+    const Register temp = locs()->temp(0).reg();
+    Label check_upper;
+    __ AddImmediate(ESP, Immediate(-kDoubleSize));
+    __ movsd(Address(ESP, 0), value);
+    __ movl(temp, Address(ESP, 0));
+    // If the low word isn't zero, then it isn't infinity.
+    __ cmpl(temp, Immediate(0));
+    __ j(EQUAL, &check_upper, Assembler::kNearJump);
+    __ AddImmediate(ESP, Immediate(kDoubleSize));
+    __ jmp(is_negated ? labels.true_label : labels.false_label);
+    __ Bind(&check_upper);
+    // Check the high word.
+    __ movl(temp, Address(ESP, kWordSize));
+    __ AddImmediate(ESP, Immediate(kDoubleSize));
+    // Mask off sign bit.
+    __ andl(temp, Immediate(0x7FFFFFFF));
+    // Compare with +infinity.
+    __ cmpl(temp, Immediate(0x7FF00000));
+    return is_negated ? NOT_EQUAL : EQUAL;
+  }
+}
+
+
+void DoubleTestOpInstr::EmitBranchCode(FlowGraphCompiler* compiler,
+                                       BranchInstr* branch) {
+  ASSERT(compiler->is_optimizing());
+  BranchLabels labels = compiler->CreateBranchLabels(branch);
+  Condition true_condition = EmitComparisonCode(compiler, labels);
+  EmitBranchOnCondition(compiler, true_condition, labels);
+}
+
+
+void DoubleTestOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  Label is_true, is_false;
+  BranchLabels labels = {&is_true, &is_false, &is_false};
+  Condition true_condition = EmitComparisonCode(compiler, labels);
+  EmitBranchOnCondition(compiler, true_condition, labels);
+
+  Register result = locs()->out(0).reg();
+  Label done;
+  __ Bind(&is_false);
+  __ LoadObject(result, Bool::False());
+  __ jmp(&done);
+  __ Bind(&is_true);
+  __ LoadObject(result, Bool::True());
+  __ Bind(&done);
+}
+
+
 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Zone* zone,
                                                              bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -3923,11 +3976,20 @@
   ASSERT(locs()->out(0).fpu_reg() == left);
 
   switch (op_kind()) {
-    case Token::kADD: __ addps(left, right); break;
-    case Token::kSUB: __ subps(left, right); break;
-    case Token::kMUL: __ mulps(left, right); break;
-    case Token::kDIV: __ divps(left, right); break;
-    default: UNREACHABLE();
+    case Token::kADD:
+      __ addps(left, right);
+      break;
+    case Token::kSUB:
+      __ subps(left, right);
+      break;
+    case Token::kMUL:
+      __ mulps(left, right);
+      break;
+    case Token::kDIV:
+      __ divps(left, right);
+      break;
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -3936,8 +3998,8 @@
                                                              bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -3952,11 +4014,20 @@
   ASSERT(locs()->out(0).fpu_reg() == left);
 
   switch (op_kind()) {
-    case Token::kADD: __ addpd(left, right); break;
-    case Token::kSUB: __ subpd(left, right); break;
-    case Token::kMUL: __ mulpd(left, right); break;
-    case Token::kDIV: __ divpd(left, right); break;
-    default: UNREACHABLE();
+    case Token::kADD:
+      __ addpd(left, right);
+      break;
+    case Token::kSUB:
+      __ subpd(left, right);
+      break;
+    case Token::kMUL:
+      __ mulpd(left, right);
+      break;
+    case Token::kDIV:
+      __ divpd(left, right);
+      break;
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -3965,8 +4036,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -3999,7 +4070,8 @@
     case MethodRecognizer::kInt32x4Shuffle:
       __ shufps(value, value, Immediate(mask_));
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4008,8 +4080,8 @@
                                                               bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -4027,7 +4099,8 @@
     case MethodRecognizer::kInt32x4ShuffleMix:
       __ shufps(left, right, Immediate(mask_));
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4036,8 +4109,8 @@
                                                                bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresRegister());
   return summary;
@@ -4054,11 +4127,12 @@
 
 
 LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 4;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_in(2, Location::RequiresFpuRegister());
@@ -4095,8 +4169,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
 }
@@ -4112,8 +4186,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -4134,8 +4208,8 @@
                                                                bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -4169,7 +4243,8 @@
       __ cmppsle(left, right);
       break;
 
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4178,8 +4253,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -4200,7 +4275,8 @@
     case MethodRecognizer::kFloat32x4Max:
       __ maxps(left, right);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4209,8 +4285,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -4230,7 +4306,8 @@
       __ shufps(left, left, Immediate(0x00));
       __ mulps(left, right);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4239,8 +4316,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -4262,7 +4339,8 @@
     case MethodRecognizer::kFloat32x4ReciprocalSqrt:
       __ rsqrtps(left);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4271,8 +4349,8 @@
                                                             bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -4290,7 +4368,8 @@
     case MethodRecognizer::kFloat32x4Absolute:
       __ absps(left);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4299,8 +4378,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 3;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_in(2, Location::RequiresFpuRegister());
@@ -4323,8 +4402,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -4383,7 +4462,8 @@
       __ movups(replacement, Address(ESP, 0));
       __ addl(ESP, Immediate(16));
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4392,8 +4472,8 @@
                                                               bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -4409,8 +4489,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -4429,18 +4509,18 @@
     case MethodRecognizer::kFloat64x2GetY:
       __ shufpd(value, value, Immediate(0x33));
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
 
-
 LocationSummary* Float64x2ZeroInstr::MakeLocationSummary(Zone* zone,
                                                          bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
 }
@@ -4456,8 +4536,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -4471,11 +4551,12 @@
 
 
 LocationSummary* Float64x2ConstructorInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -4495,11 +4576,12 @@
 
 
 LocationSummary* Float64x2ToFloat32x4Instr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -4513,11 +4595,12 @@
 
 
 LocationSummary* Float32x4ToFloat64x2Instr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -4534,8 +4617,8 @@
                                                             bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   if (representation() == kTagged) {
     ASSERT(op_kind() == MethodRecognizer::kFloat64x2GetSignMask);
@@ -4568,7 +4651,8 @@
       __ movmskpd(locs()->out(0).reg(), left);
       __ SmiTag(locs()->out(0).reg());
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4577,8 +4661,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -4622,17 +4706,18 @@
     case MethodRecognizer::kFloat64x2Max:
       __ maxpd(left, right);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
 
-LocationSummary* Int32x4ConstructorInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+LocationSummary* Int32x4ConstructorInstr::MakeLocationSummary(Zone* zone,
+                                                              bool opt) const {
   const intptr_t kNumInputs = 4;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   summary->set_in(2, Location::RequiresRegister());
@@ -4659,11 +4744,12 @@
 
 
 LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 4;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   summary->set_in(2, Location::RequiresRegister());
@@ -4725,8 +4811,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresRegister());
   return summary;
@@ -4754,7 +4840,8 @@
     case MethodRecognizer::kInt32x4GetFlagW:
       __ movl(result, Address(ESP, 12));
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
   __ addl(ESP, Immediate(16));
   __ testl(result, result);
@@ -4771,8 +4858,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 3;
   const intptr_t kNumTemps = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_in(2, Location::RequiresFpuRegister());
@@ -4806,8 +4893,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -4831,26 +4918,27 @@
       __ jmp(&exitPath);
       __ Bind(&falsePath);
       __ movl(Address(ESP, 0), Immediate(0x0));
-    break;
+      break;
     case MethodRecognizer::kInt32x4WithFlagY:
       __ movl(Address(ESP, 4), Immediate(0xFFFFFFFF));
       __ jmp(&exitPath);
       __ Bind(&falsePath);
       __ movl(Address(ESP, 4), Immediate(0x0));
-    break;
+      break;
     case MethodRecognizer::kInt32x4WithFlagZ:
       __ movl(Address(ESP, 8), Immediate(0xFFFFFFFF));
       __ jmp(&exitPath);
       __ Bind(&falsePath);
       __ movl(Address(ESP, 8), Immediate(0x0));
-    break;
+      break;
     case MethodRecognizer::kInt32x4WithFlagW:
       __ movl(Address(ESP, 12), Immediate(0xFFFFFFFF));
       __ jmp(&exitPath);
       __ Bind(&falsePath);
       __ movl(Address(ESP, 12), Immediate(0x0));
-    break;
-    default: UNREACHABLE();
+      break;
+    default:
+      UNREACHABLE();
   }
   __ Bind(&exitPath);
   // Copy mask back to register.
@@ -4863,8 +4951,8 @@
                                                               bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -4880,8 +4968,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -4912,7 +5000,8 @@
     case Token::kSUB:
       __ subpl(left, right);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4923,8 +5012,8 @@
          (kind() == MathUnaryInstr::kDoubleSquare));
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   if (kind() == MathUnaryInstr::kDoubleSquare) {
     summary->set_out(0, Location::SameAsFirstInput());
@@ -4949,10 +5038,11 @@
 
 
 LocationSummary* CaseInsensitiveCompareUC16Instr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, InputCount(), kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, InputCount(), kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(EAX));
   summary->set_in(1, Location::RegisterLocation(ECX));
   summary->set_in(2, Location::RegisterLocation(EDX));
@@ -4964,17 +5054,16 @@
 
 void CaseInsensitiveCompareUC16Instr::EmitNativeCode(
     FlowGraphCompiler* compiler) {
-
   // Save ESP. EDI is chosen because it is callee saved so we do not need to
   // back it up before calling into the runtime.
   static const Register kSavedSPReg = EDI;
   __ movl(kSavedSPReg, ESP);
   __ ReserveAlignedFrameSpace(kWordSize * TargetFunction().argument_count());
 
-  __ movl(Address(ESP, + 0 * kWordSize), locs()->in(0).reg());
-  __ movl(Address(ESP, + 1 * kWordSize), locs()->in(1).reg());
-  __ movl(Address(ESP, + 2 * kWordSize), locs()->in(2).reg());
-  __ movl(Address(ESP, + 3 * kWordSize), locs()->in(3).reg());
+  __ movl(Address(ESP, +0 * kWordSize), locs()->in(0).reg());
+  __ movl(Address(ESP, +1 * kWordSize), locs()->in(1).reg());
+  __ movl(Address(ESP, +2 * kWordSize), locs()->in(2).reg());
+  __ movl(Address(ESP, +3 * kWordSize), locs()->in(3).reg());
 
   // Call the function.
   __ CallRuntime(TargetFunction(), TargetFunction().argument_count());
@@ -4989,8 +5078,8 @@
   if (result_cid() == kDoubleCid) {
     const intptr_t kNumInputs = 2;
     const intptr_t kNumTemps = 1;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresFpuRegister());
     summary->set_in(1, Location::RequiresFpuRegister());
     // Reuse the left register so that code can be made shorter.
@@ -5002,8 +5091,8 @@
   ASSERT(result_cid() == kSmiCid);
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   // Reuse the left register so that code can be made shorter.
@@ -5076,9 +5165,7 @@
 LocationSummary* UnarySmiOpInstr::MakeLocationSummary(Zone* zone,
                                                       bool opt) const {
   const intptr_t kNumInputs = 1;
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::SameAsFirstInput(),
+  return LocationSummary::Make(zone, kNumInputs, Location::SameAsFirstInput(),
                                LocationSummary::kNoCall);
 }
 
@@ -5107,8 +5194,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -5123,11 +5210,11 @@
 
 
 LocationSummary* Int32ToDoubleInstr::MakeLocationSummary(Zone* zone,
-                                                       bool opt) const {
+                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::RequiresRegister());
   result->set_out(0, Location::RequiresFpuRegister());
   return result;
@@ -5145,8 +5232,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::WritableRegister());
   result->set_out(0, Location::RequiresFpuRegister());
   return result;
@@ -5165,8 +5252,8 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::Pair(Location::RequiresRegister(),
                                    Location::RequiresRegister()));
   result->set_out(0, Location::RequiresFpuRegister());
@@ -5200,8 +5287,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   result->set_in(0, Location::RegisterLocation(ECX));
   result->set_out(0, Location::RegisterLocation(EAX));
   return result;
@@ -5231,13 +5318,10 @@
   const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0));
 
   const intptr_t kNumberOfArguments = 1;
-  compiler->GenerateStaticCall(deopt_id(),
-                               instance_call()->token_pos(),
-                               target,
+  compiler->GenerateStaticCall(deopt_id(), instance_call()->token_pos(), target,
                                kNumberOfArguments,
                                Object::null_array(),  // No argument names.
-                               locs(),
-                               ICData::Handle());
+                               locs(), ICData::Handle());
   __ Bind(&done);
 }
 
@@ -5246,8 +5330,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::RequiresFpuRegister());
   result->set_out(0, Location::RequiresRegister());
   return result;
@@ -5270,8 +5354,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::RequiresFpuRegister());
   result->set_out(0, Location::RequiresFpuRegister());
   return result;
@@ -5283,13 +5367,13 @@
   XmmRegister result = locs()->out(0).fpu_reg();
   switch (recognized_kind()) {
     case MethodRecognizer::kDoubleTruncate:
-      __ roundsd(result, value,  Assembler::kRoundToZero);
+      __ roundsd(result, value, Assembler::kRoundToZero);
       break;
     case MethodRecognizer::kDoubleFloor:
-      __ roundsd(result, value,  Assembler::kRoundDown);
+      __ roundsd(result, value, Assembler::kRoundDown);
       break;
     case MethodRecognizer::kDoubleCeil:
-      __ roundsd(result, value,  Assembler::kRoundUp);
+      __ roundsd(result, value, Assembler::kRoundUp);
       break;
     default:
       UNREACHABLE();
@@ -5301,8 +5385,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::RequiresFpuRegister());
   result->set_out(0, Location::SameAsFirstInput());
   return result;
@@ -5318,8 +5402,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::RequiresFpuRegister());
   result->set_out(0, Location::SameAsFirstInput());
   return result;
@@ -5336,8 +5420,8 @@
   ASSERT((InputCount() == 1) || (InputCount() == 2));
   const intptr_t kNumTemps =
       (recognized_kind() == MethodRecognizer::kMathDoublePow) ? 3 : 1;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, InputCount(), kNumTemps, LocationSummary::kCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, InputCount(), kNumTemps, LocationSummary::kCall);
   // EDI is chosen because it is callee saved so we do not need to back it
   // up before calling into the runtime.
   result->set_temp(0, Location::RegisterLocation(EDI));
@@ -5385,7 +5469,7 @@
   XmmRegister zero_temp =
       locs->temp(InvokeMathCFunctionInstr::kDoubleTempIndex).fpu_reg();
 
-  __ xorps(zero_temp, zero_temp);   // 0.0.
+  __ xorps(zero_temp, zero_temp);  // 0.0.
   __ LoadObject(temp, Double::ZoneHandle(Double::NewCanonical(1.0)));
   __ movsd(result, FieldAddress(temp, Double::value_offset()));
 
@@ -5514,27 +5598,27 @@
   // Only use this instruction in optimized code.
   ASSERT(opt);
   const intptr_t kNumInputs = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, 0, LocationSummary::kNoCall);
+  LocationSummary* summary =
+      new (zone) LocationSummary(zone, kNumInputs, 0, LocationSummary::kNoCall);
   if (representation() == kUnboxedDouble) {
     if (index() == 0) {
-      summary->set_in(0, Location::Pair(Location::RequiresFpuRegister(),
-                                        Location::Any()));
+      summary->set_in(
+          0, Location::Pair(Location::RequiresFpuRegister(), Location::Any()));
     } else {
       ASSERT(index() == 1);
-      summary->set_in(0, Location::Pair(Location::Any(),
-                                        Location::RequiresFpuRegister()));
+      summary->set_in(
+          0, Location::Pair(Location::Any(), Location::RequiresFpuRegister()));
     }
     summary->set_out(0, Location::RequiresFpuRegister());
   } else {
     ASSERT(representation() == kTagged);
     if (index() == 0) {
-      summary->set_in(0, Location::Pair(Location::RequiresRegister(),
-                                        Location::Any()));
+      summary->set_in(
+          0, Location::Pair(Location::RequiresRegister(), Location::Any()));
     } else {
       ASSERT(index() == 1);
-      summary->set_in(0, Location::Pair(Location::Any(),
-                                        Location::RequiresRegister()));
+      summary->set_in(
+          0, Location::Pair(Location::Any(), Location::RequiresRegister()));
     }
     summary->set_out(0, Location::RequiresRegister());
   }
@@ -5564,8 +5648,8 @@
   if (kind() == MergedMathInstr::kTruncDivMod) {
     const intptr_t kNumInputs = 2;
     const intptr_t kNumTemps = 0;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     // Both inputs must be writable because they will be untagged.
     summary->set_in(0, Location::RegisterLocation(EAX));
     summary->set_in(1, Location::WritableRegister());
@@ -5577,8 +5661,8 @@
   if (kind() == MergedMathInstr::kSinCos) {
     const intptr_t kNumInputs = 1;
     const intptr_t kNumTemps = 2;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
     // Because we always call into the runtime (LocationSummary::kCall) we
     // must specify each input, temp, and output register explicitly.
     summary->set_in(0, Location::FpuRegisterLocation(XMM1));
@@ -5595,17 +5679,20 @@
 }
 
 
-typedef void (*SinCosCFunction) (double x, double* res_sin, double* res_cos);
+typedef void (*SinCosCFunction)(double x, double* res_sin, double* res_cos);
 
 extern const RuntimeEntry kSinCosRuntimeEntry(
-    "libc_sincos", reinterpret_cast<RuntimeFunction>(
-        static_cast<SinCosCFunction>(&SinCos)), 1, true, true);
+    "libc_sincos",
+    reinterpret_cast<RuntimeFunction>(static_cast<SinCosCFunction>(&SinCos)),
+    1,
+    true,
+    true);
 
 
 void MergedMathInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Label* deopt = NULL;
   if (CanDeoptimize()) {
-    deopt  = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinarySmiOp);
+    deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinarySmiOp);
   }
 
   if (kind() == MergedMathInstr::kTruncDivMod) {
@@ -5627,7 +5714,7 @@
     ASSERT(result2 == EDX);
     __ SmiUntag(left);
     __ SmiUntag(right);
-    __ cdq();  // Sign extend EAX -> EDX:EAX.
+    __ cdq();         // Sign extend EAX -> EDX:EAX.
     __ idivl(right);  //  EAX: quotient, EDX: remainder.
     // Check the corner case of dividing the 'MIN_SMI' with -1, in which
     // case we cannot tag the result.
@@ -5718,13 +5805,13 @@
 
 
 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   return MakeCallSummary(zone);
 }
 
 
-LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone,
-                                                  bool opt) const {
+LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   comparison()->InitializeLocationSummary(zone, opt);
   // Branches don't produce a result.
   comparison()->locs()->set_out(0, Location::NoLocation());
@@ -5742,8 +5829,8 @@
   const intptr_t kNumInputs = 1;
   const bool need_mask_temp = IsDenseSwitch() && !IsDenseMask(ComputeCidMask());
   const intptr_t kNumTemps = !IsNullCheck() ? (need_mask_temp ? 2 : 1) : 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   if (!IsNullCheck()) {
     summary->set_temp(0, Location::RequiresRegister());
@@ -5756,8 +5843,7 @@
 
 
 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  Label* deopt = compiler->AddDeoptStub(deopt_id(),
-                                        ICData::kDeoptCheckClass,
+  Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass,
                                         licm_hoisted_ ? ICData::kHoisted : 0);
   if (IsNullCheck()) {
     const Immediate& raw_null =
@@ -5800,8 +5886,7 @@
     }
   } else {
     GrowableArray<CidTarget> sorted_ic_data;
-    FlowGraphCompiler::SortICDataByCount(unary_checks(),
-                                         &sorted_ic_data,
+    FlowGraphCompiler::SortICDataByCount(unary_checks(), &sorted_ic_data,
                                          /* drop_smi = */ true);
     const intptr_t num_checks = sorted_ic_data.length();
     const bool use_near_jump = num_checks < 5;
@@ -5828,8 +5913,8 @@
                                                     bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   return summary;
 }
@@ -5837,8 +5922,7 @@
 
 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Register value = locs()->in(0).reg();
-  Label* deopt = compiler->AddDeoptStub(deopt_id(),
-                                        ICData::kDeoptCheckSmi,
+  Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckSmi,
                                         licm_hoisted_ ? ICData::kHoisted : 0);
   __ BranchIfNotSmi(value, deopt);
 }
@@ -5848,8 +5932,8 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   return summary;
 }
@@ -5883,8 +5967,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   if (length()->definition()->IsConstant()) {
     locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length()));
   } else {
@@ -5898,10 +5982,8 @@
 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   uint32_t flags = generalized_ ? ICData::kGeneralized : 0;
   flags |= licm_hoisted_ ? ICData::kHoisted : 0;
-  Label* deopt = compiler->AddDeoptStub(
-      deopt_id(),
-      ICData::kDeoptCheckArrayBound,
-      flags);
+  Label* deopt =
+      compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckArrayBound, flags);
 
   Location length_loc = locs()->in(kLengthPos);
   Location index_loc = locs()->in(kIndexPos);
@@ -5971,13 +6053,13 @@
     case Token::kSUB:
     case Token::kMUL: {
       const intptr_t kNumTemps = (op_kind() == Token::kMUL) ? 1 : 0;
-      LocationSummary* summary = new(zone) LocationSummary(
+      LocationSummary* summary = new (zone) LocationSummary(
           zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
       summary->set_in(0, (op_kind() == Token::kMUL)
-          ? Location::Pair(Location::RegisterLocation(EAX),
-                           Location::RegisterLocation(EDX))
-          : Location::Pair(Location::RequiresRegister(),
-                           Location::RequiresRegister()));
+                             ? Location::Pair(Location::RegisterLocation(EAX),
+                                              Location::RegisterLocation(EDX))
+                             : Location::Pair(Location::RequiresRegister(),
+                                              Location::RequiresRegister()));
       summary->set_in(1, Location::Pair(Location::RequiresRegister(),
                                         Location::RequiresRegister()));
       summary->set_out(0, Location::SameAsFirstInput());
@@ -6068,8 +6150,8 @@
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps =
       (op_kind() == Token::kSHL) && CanDeoptimize() ? 2 : 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::Pair(Location::RequiresRegister(),
                                     Location::RequiresRegister()));
   summary->set_in(1, Location::FixedRegisterOrSmiConstant(right(), ECX));
@@ -6085,8 +6167,8 @@
 static const intptr_t kMintShiftCountLimit = 63;
 
 bool ShiftMintOpInstr::has_shift_count_check() const {
-  return !RangeUtils::IsWithin(
-      right()->definition()->range(), 0, kMintShiftCountLimit);
+  return !RangeUtils::IsWithin(right()->definition()->range(), 0,
+                               kMintShiftCountLimit);
 }
 
 
@@ -6112,7 +6194,7 @@
     switch (op_kind()) {
       case Token::kSHR: {
         if (shift > 31) {
-          __ movl(left_lo, left_hi);  // Shift by 32.
+          __ movl(left_lo, left_hi);        // Shift by 32.
           __ sarl(left_hi, Immediate(31));  // Sign extend left hi.
           if (shift > 32) {
             __ sarl(left_lo, Immediate(shift > 63 ? 31 : shift - 32));
@@ -6193,14 +6275,14 @@
         __ j(ABOVE, &large_shift);
 
         __ shrdl(left_lo, left_hi, ECX);  // Shift count in CL.
-        __ sarl(left_hi, ECX);  // Shift count in CL.
+        __ sarl(left_hi, ECX);            // Shift count in CL.
         __ jmp(&done, Assembler::kNearJump);
 
         __ Bind(&large_shift);
         // No need to subtract 32 from CL, only 5 bits used by sarl.
-        __ movl(left_lo, left_hi);  // Shift by 32.
+        __ movl(left_lo, left_hi);        // Shift by 32.
         __ sarl(left_hi, Immediate(31));  // Sign extend left hi.
-        __ sarl(left_lo, ECX);  // Shift count: CL % 32.
+        __ sarl(left_lo, ECX);            // Shift count: CL % 32.
         break;
       }
       case Token::kSHL: {
@@ -6212,7 +6294,7 @@
           __ j(ABOVE, &large_shift);
 
           __ shldl(left_hi, left_lo, ECX);  // Shift count in CL.
-          __ shll(left_lo, ECX);  // Shift count in CL.
+          __ shll(left_lo, ECX);            // Shift count in CL.
           // Check for overflow by shifting back the high 32 bits
           // and comparing with the input.
           __ movl(temp2, left_hi);
@@ -6224,7 +6306,7 @@
           __ Bind(&large_shift);
           // No need to subtract 32 from CL, only 5 bits used by shll.
           __ movl(left_hi, left_lo);  // Shift by 32.
-          __ shll(left_hi, ECX);  // Shift count: CL % 32.
+          __ shll(left_hi, ECX);      // Shift count: CL % 32.
           // Check for overflow by sign extending the high 32 bits
           // and comparing with the input.
           __ movl(temp2, left_hi);
@@ -6243,14 +6325,14 @@
           __ j(ABOVE, &large_shift);
 
           __ shldl(left_hi, left_lo, ECX);  // Shift count in CL.
-          __ shll(left_lo, ECX);  // Shift count in CL.
+          __ shll(left_lo, ECX);            // Shift count in CL.
           __ jmp(&done, Assembler::kNearJump);
 
           __ Bind(&large_shift);
           // No need to subtract 32 from CL, only 5 bits used by shll.
           __ movl(left_hi, left_lo);  // Shift by 32.
           __ xorl(left_lo, left_lo);  // Zero left_lo.
-          __ shll(left_hi, ECX);  // Shift count: CL % 32.
+          __ shll(left_hi, ECX);      // Shift count: CL % 32.
         }
         break;
       }
@@ -6266,8 +6348,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::Pair(Location::RequiresRegister(),
                                     Location::RequiresRegister()));
   summary->set_out(0, Location::SameAsFirstInput());
@@ -6309,8 +6391,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::FixedRegisterOrSmiConstant(right(), ECX));
   summary->set_out(0, Location::SameAsFirstInput());
@@ -6340,10 +6422,10 @@
     switch (op_kind()) {
       case Token::kSHR:
         __ shrl(left, Immediate(shift_value));
-      break;
+        break;
       case Token::kSHL:
         __ shll(left, Immediate(shift_value));
-      break;
+        break;
       default:
         UNREACHABLE();
     }
@@ -6372,11 +6454,11 @@
     case Token::kSHR:
       __ shrl(left, shifter);
       __ jmp(&done);
-    break;
+      break;
     case Token::kSHL:
       __ shll(left, shifter);
       __ jmp(&done);
-    break;
+      break;
     default:
       UNREACHABLE();
   }
@@ -6394,8 +6476,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -6416,17 +6498,17 @@
                                                                bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   if ((from() == kUnboxedInt32 || from() == kUnboxedUint32) &&
       (to() == kUnboxedInt32 || to() == kUnboxedUint32)) {
     summary->set_in(0, Location::RequiresRegister());
     summary->set_out(0, Location::SameAsFirstInput());
   } else if (from() == kUnboxedMint) {
-    summary->set_in(0, Location::Pair(
-        CanDeoptimize() ? Location::WritableRegister()
-                        : Location::RequiresRegister(),
-        Location::RequiresRegister()));
+    summary->set_in(
+        0, Location::Pair(CanDeoptimize() ? Location::WritableRegister()
+                                          : Location::RequiresRegister(),
+                          Location::RequiresRegister()));
     summary->set_out(0, Location::RequiresRegister());
   } else if (from() == kUnboxedUint32) {
     summary->set_in(0, Location::RequiresRegister());
@@ -6497,43 +6579,33 @@
 }
 
 
-LocationSummary* ThrowInstr::MakeLocationSummary(Zone* zone,
-                                                 bool opt) const {
-  return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
+LocationSummary* ThrowInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+  return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
 }
 
 
-
 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kThrowRuntimeEntry,
-                                1,
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(), kThrowRuntimeEntry, 1,
                                 locs());
   __ int3();
 }
 
 
-LocationSummary* ReThrowInstr::MakeLocationSummary(Zone* zone,
-                                                   bool opt) const {
-  return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
+LocationSummary* ReThrowInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+  return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
 }
 
 
 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   compiler->SetNeedsStacktrace(catch_try_index());
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kReThrowRuntimeEntry,
-                                2,
-                                locs());
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(), kReThrowRuntimeEntry,
+                                2, locs());
   __ int3();
 }
 
 
-LocationSummary* StopInstr::MakeLocationSummary(Zone* zone,
-                                                bool opt) const {
-  return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
+LocationSummary* StopInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+  return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
 }
 
 
@@ -6549,9 +6621,8 @@
 }
 
 
-LocationSummary* GotoInstr::MakeLocationSummary(Zone* zone,
-                                                bool opt) const {
-  return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
+LocationSummary* GotoInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+  return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
 }
 
 
@@ -6562,8 +6633,7 @@
     }
     // Add a deoptimization descriptor for deoptimizing instructions that
     // may be inserted before this instruction.
-    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                                   GetDeoptId(),
+    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, GetDeoptId(),
                                    TokenPosition::kNoSource);
   }
   if (HasParallelMove()) {
@@ -6583,8 +6653,8 @@
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
 
-  LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
 
   summary->set_in(0, Location::RequiresRegister());
   summary->set_temp(0, Location::RequiresRegister());
@@ -6601,7 +6671,7 @@
   // Load instructions object (active_instructions and Code::entry_point() may
   // not point to this instruction object any more; see Code::DisableDartCode).
   __ movl(target_reg,
-      FieldAddress(target_reg, Code::saved_instructions_offset()));
+          FieldAddress(target_reg, Code::saved_instructions_offset()));
   __ addl(target_reg, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
 
   // Add the offset.
@@ -6621,15 +6691,15 @@
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
   if (needs_number_check()) {
-    LocationSummary* locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+    LocationSummary* locs = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
     locs->set_in(0, Location::RegisterLocation(EAX));
     locs->set_in(1, Location::RegisterLocation(ECX));
     locs->set_out(0, Location::RegisterLocation(EAX));
     return locs;
   }
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RegisterOrConstant(left()));
   // Only one of the inputs can be a constant. Choose register if the first one
   // is a constant.
@@ -6648,20 +6718,14 @@
   ASSERT(!left.IsConstant() || !right.IsConstant());
   Condition true_condition;
   if (left.IsConstant()) {
-    true_condition = compiler->EmitEqualityRegConstCompare(right.reg(),
-                                                           left.constant(),
-                                                           needs_number_check(),
-                                                           token_pos());
+    true_condition = compiler->EmitEqualityRegConstCompare(
+        right.reg(), left.constant(), needs_number_check(), token_pos());
   } else if (right.IsConstant()) {
-    true_condition = compiler->EmitEqualityRegConstCompare(left.reg(),
-                                                           right.constant(),
-                                                           needs_number_check(),
-                                                           token_pos());
+    true_condition = compiler->EmitEqualityRegConstCompare(
+        left.reg(), right.constant(), needs_number_check(), token_pos());
   } else {
-    true_condition = compiler->EmitEqualityRegRegCompare(left.reg(),
-                                                         right.reg(),
-                                                         needs_number_check(),
-                                                         token_pos());
+    true_condition = compiler->EmitEqualityRegRegCompare(
+        left.reg(), right.reg(), needs_number_check(), token_pos());
   }
   if (kind() != Token::kEQ_STRICT) {
     ASSERT(kind() == Token::kNE_STRICT);
@@ -6675,7 +6739,7 @@
   ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT);
 
   Label is_true, is_false;
-  BranchLabels labels = { &is_true, &is_false, &is_false };
+  BranchLabels labels = {&is_true, &is_false, &is_false};
   Condition true_condition = EmitComparisonCode(compiler, labels);
   EmitBranchOnCondition(compiler, true_condition, labels);
 
@@ -6724,7 +6788,7 @@
   __ xorl(EDX, EDX);
 
   // Emit comparison code. This must not overwrite the result register.
-  BranchLabels labels = { NULL, NULL, NULL };
+  BranchLabels labels = {NULL, NULL, NULL};
   Condition true_condition = comparison()->EmitComparisonCode(compiler, labels);
 
   const bool is_power_of_two_kind = IsPowerOfTwoKind(if_true_, if_false_);
@@ -6756,8 +6820,8 @@
     __ shll(EDX, Immediate(shift + kSmiTagSize));
   } else {
     __ decl(EDX);
-    __ andl(EDX, Immediate(
-        Smi::RawValue(true_value) - Smi::RawValue(false_value)));
+    __ andl(EDX,
+            Immediate(Smi::RawValue(true_value) - Smi::RawValue(false_value)));
     if (false_value != 0) {
       __ addl(EDX, Immediate(Smi::RawValue(false_value)));
     }
@@ -6769,8 +6833,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(EAX));  // Function.
   summary->set_out(0, Location::RegisterLocation(EAX));
   return summary;
@@ -6780,9 +6844,8 @@
 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   // Load arguments descriptors.
   intptr_t argument_count = ArgumentCount();
-  const Array& arguments_descriptor =
-      Array::ZoneHandle(ArgumentsDescriptor::New(argument_count,
-                                                 argument_names()));
+  const Array& arguments_descriptor = Array::ZoneHandle(
+      ArgumentsDescriptor::New(argument_count, argument_names()));
   __ LoadObject(EDX, arguments_descriptor);
 
   // EBX: Code (compiled code or lazy compile stub).
@@ -6804,8 +6867,7 @@
   // Add deoptimization continuation point after the call and before the
   // arguments are removed.
   // In optimized code this descriptor is needed for exception handling.
-  compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                                 deopt_id_after,
+  compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after,
                                  token_pos());
   __ Drop(argument_count);
 }
@@ -6813,9 +6875,7 @@
 
 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Zone* zone,
                                                          bool opt) const {
-  return LocationSummary::Make(zone,
-                               1,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, 1, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -6843,9 +6903,7 @@
   const Code& stub = Code::ZoneHandle(
       compiler->zone(), StubCode::GetAllocationStubForClass(cls()));
   const StubEntry stub_entry(stub);
-  compiler->GenerateCall(token_pos(),
-                         stub_entry,
-                         RawPcDescriptors::kOther,
+  compiler->GenerateCall(token_pos(), stub_entry, RawPcDescriptors::kOther,
                          locs());
   compiler->AddStubCallTarget(stub);
   __ Drop(ArgumentCount());  // Discard arguments.
@@ -6854,19 +6912,17 @@
 
 void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   ASSERT(!compiler->is_optimizing());
-  compiler->GenerateCall(token_pos(),
-                         *StubCode::DebugStepCheck_entry(),
-                         stub_kind_,
-                         locs());
+  compiler->GenerateCall(token_pos(), *StubCode::DebugStepCheck_entry(),
+                         stub_kind_, locs());
 }
 
 
-LocationSummary* GrowRegExpStackInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+LocationSummary* GrowRegExpStackInstr::MakeLocationSummary(Zone* zone,
+                                                           bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(EAX));
   locs->set_out(0, Location::RegisterLocation(EAX));
   return locs;
@@ -6878,11 +6934,8 @@
   const Register result = locs()->out(0).reg();
   __ PushObject(Object::null_object());
   __ pushl(typed_data);
-  compiler->GenerateRuntimeCall(TokenPosition::kNoSource,
-                                deopt_id(),
-                                kGrowRegExpStackRuntimeEntry,
-                                1,
-                                locs());
+  compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(),
+                                kGrowRegExpStackRuntimeEntry, 1, locs());
   __ Drop(1);
   __ popl(result);
 }
diff --git a/runtime/vm/intermediate_language_mips.cc b/runtime/vm/intermediate_language_mips.cc
index 6ec28cc..c5a5af5 100644
--- a/runtime/vm/intermediate_language_mips.cc
+++ b/runtime/vm/intermediate_language_mips.cc
@@ -29,8 +29,8 @@
 // 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(Zone* zone) {
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, 0, 0, LocationSummary::kCall);
+  LocationSummary* result =
+      new (zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
   result->set_out(0, Location::RegisterLocation(V0));
   return result;
 }
@@ -40,8 +40,8 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::AnyOrConstant(value()));
   return locs;
 }
@@ -67,12 +67,11 @@
 }
 
 
-LocationSummary* ReturnInstr::MakeLocationSummary(Zone* zone,
-                                                  bool opt) const {
+LocationSummary* ReturnInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RegisterLocation(V0));
   return locs;
 }
@@ -111,18 +110,42 @@
 
 static Condition NegateCondition(Condition condition) {
   switch (condition.rel_op()) {
-    case AL: condition.set_rel_op(NV); break;
-    case NV: condition.set_rel_op(AL); break;
-    case EQ: condition.set_rel_op(NE); break;
-    case NE: condition.set_rel_op(EQ); break;
-    case LT: condition.set_rel_op(GE); break;
-    case LE: condition.set_rel_op(GT); break;
-    case GT: condition.set_rel_op(LE); break;
-    case GE: condition.set_rel_op(LT); break;
-    case ULT: condition.set_rel_op(UGE); break;
-    case ULE: condition.set_rel_op(UGT); break;
-    case UGT: condition.set_rel_op(ULE); break;
-    case UGE: condition.set_rel_op(ULT); break;
+    case AL:
+      condition.set_rel_op(NV);
+      break;
+    case NV:
+      condition.set_rel_op(AL);
+      break;
+    case EQ:
+      condition.set_rel_op(NE);
+      break;
+    case NE:
+      condition.set_rel_op(EQ);
+      break;
+    case LT:
+      condition.set_rel_op(GE);
+      break;
+    case LE:
+      condition.set_rel_op(GT);
+      break;
+    case GT:
+      condition.set_rel_op(LE);
+      break;
+    case GE:
+      condition.set_rel_op(LT);
+      break;
+    case ULT:
+      condition.set_rel_op(UGE);
+      break;
+    case ULE:
+      condition.set_rel_op(UGT);
+      break;
+    case UGT:
+      condition.set_rel_op(ULE);
+      break;
+    case UGE:
+      condition.set_rel_op(ULT);
+      break;
     default:
       UNREACHABLE();
   }
@@ -155,7 +178,7 @@
   __ LoadImmediate(result, Smi::RawValue(true_value));
 
   // Emit comparison code. This must not overwrite the result register.
-  BranchLabels labels = { NULL, NULL, NULL };  // Emit branch-free code.
+  BranchLabels labels = {NULL, NULL, NULL};  // Emit branch-free code.
   Condition true_condition = comparison()->EmitComparisonCode(compiler, labels);
   if (swapped) {
     true_condition = NegateCondition(true_condition);
@@ -166,11 +189,14 @@
   Register right = true_condition.right();
   bool zero_is_false = true;  // Zero in CMPRES1 indicates a false condition.
   switch (true_condition.rel_op()) {
-    case AL: return;  // Result holds true_value.
-    case NV: __ LoadImmediate(result, false_value); return;
+    case AL:
+      return;  // Result holds true_value.
+    case NV:
+      __ LoadImmediate(result, false_value);
+      return;
     case EQ:
       zero_is_false = false;
-      // fall through.
+    // fall through.
     case NE: {
       if (left == IMM) {
         __ XorImmediate(CMPRES1, right, true_condition.imm());
@@ -183,7 +209,7 @@
     }
     case GE:
       zero_is_false = false;
-      // fall through.
+    // fall through.
     case LT: {
       if (left == IMM) {
         __ slti(CMPRES1, right, Immediate(true_condition.imm() + 1));
@@ -197,7 +223,7 @@
     }
     case LE:
       zero_is_false = false;
-      // fall through.
+    // fall through.
     case GT: {
       if (left == IMM) {
         __ slti(CMPRES1, right, Immediate(true_condition.imm()));
@@ -211,7 +237,7 @@
     }
     case UGE:
       zero_is_false = false;
-      // fall through.
+    // fall through.
     case ULT: {
       ASSERT((left != IMM) && (right != IMM));  // No unsigned constants used.
       __ sltu(CMPRES1, left, right);
@@ -219,7 +245,7 @@
     }
     case ULE:
       zero_is_false = false;
-      // fall through.
+    // fall through.
     case UGT: {
       ASSERT((left != IMM) && (right != IMM));  // No unsigned constants used.
       __ sltu(CMPRES1, right, left);
@@ -250,8 +276,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(T0));  // Function.
   summary->set_out(0, Location::RegisterLocation(V0));
   return summary;
@@ -261,9 +287,8 @@
 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   // Load arguments descriptor in S4.
   int argument_count = ArgumentCount();
-  const Array& arguments_descriptor =
-      Array::ZoneHandle(ArgumentsDescriptor::New(argument_count,
-                                                 argument_names()));
+  const Array& arguments_descriptor = Array::ZoneHandle(
+      ArgumentsDescriptor::New(argument_count, argument_names()));
   __ LoadObject(S4, arguments_descriptor);
 
   // Load closure function code in T2.
@@ -284,8 +309,7 @@
   // Add deoptimization continuation point after the call and before the
   // arguments are removed.
   // In optimized code this descriptor is needed for exception handling.
-  compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                                 deopt_id_after,
+  compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after,
                                  token_pos());
   __ Drop(argument_count);
 }
@@ -293,9 +317,7 @@
 
 LocationSummary* LoadLocalInstr::MakeLocationSummary(Zone* zone,
                                                      bool opt) const {
-  return LocationSummary::Make(zone,
-                               0,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, 0, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -309,9 +331,7 @@
 
 LocationSummary* StoreLocalInstr::MakeLocationSummary(Zone* zone,
                                                       bool opt) const {
-  return LocationSummary::Make(zone,
-                               1,
-                               Location::SameAsFirstInput(),
+  return LocationSummary::Make(zone, 1, Location::SameAsFirstInput(),
                                LocationSummary::kNoCall);
 }
 
@@ -327,9 +347,7 @@
 
 LocationSummary* ConstantInstr::MakeLocationSummary(Zone* zone,
                                                     bool opt) const {
-  return LocationSummary::Make(zone,
-                               0,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, 0, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -348,8 +366,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = (representation_ == kUnboxedInt32) ? 0 : 1;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   if (representation_ == kUnboxedInt32) {
     locs->set_out(0, Location::RequiresRegister());
   } else {
@@ -373,13 +391,12 @@
         const DRegister result = locs()->out(0).fpu_reg();
         __ LoadObject(const_value, value());
         __ LoadDFromOffset(result, const_value,
-            Double::value_offset() - kHeapObjectTag);
+                           Double::value_offset() - kHeapObjectTag);
         break;
       }
 
       case kUnboxedInt32:
-        __ LoadImmediate(locs()->out(0).reg(),
-                         Smi::Cast(value()).Value());
+        __ LoadImmediate(locs()->out(0).reg(), Smi::Cast(value()).Value());
         break;
 
       default:
@@ -393,8 +410,8 @@
                                                             bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(A0));  // Value.
   summary->set_in(1, Location::RegisterLocation(A1));  // Type arguments.
   summary->set_out(0, Location::RegisterLocation(A0));
@@ -406,8 +423,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(A0));
   locs->set_out(0, Location::RegisterLocation(A0));
   return locs;
@@ -433,11 +450,8 @@
   }
 
   __ Push(reg);  // Push the source object.
-  compiler->GenerateRuntimeCall(token_pos,
-                                deopt_id,
-                                kNonBoolTypeErrorRuntimeEntry,
-                                1,
-                                locs);
+  compiler->GenerateRuntimeCall(token_pos, deopt_id,
+                                kNonBoolTypeErrorRuntimeEntry, 1, locs);
   // We should never return here.
   __ break_(0);
   __ Bind(&done);
@@ -459,8 +473,8 @@
   const intptr_t kNumInputs = 2;
   if (operation_cid() == kMintCid) {
     const intptr_t kNumTemps = 0;
-    LocationSummary* locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* locs = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     locs->set_in(0, Location::Pair(Location::RequiresRegister(),
                                    Location::RequiresRegister()));
     locs->set_in(1, Location::Pair(Location::RequiresRegister(),
@@ -470,8 +484,8 @@
   }
   if (operation_cid() == kDoubleCid) {
     const intptr_t kNumTemps = 0;
-    LocationSummary* locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* locs = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     locs->set_in(0, Location::RequiresFpuRegister());
     locs->set_in(1, Location::RequiresFpuRegister());
     locs->set_out(0, Location::RequiresRegister());
@@ -479,8 +493,8 @@
   }
   if (operation_cid() == kSmiCid) {
     const intptr_t kNumTemps = 0;
-    LocationSummary* locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* locs = new (zone)
+        LocationSummary(zone, 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.
@@ -517,12 +531,18 @@
 
 static RelationOperator TokenKindToIntRelOp(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;
+    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 NV;
@@ -532,12 +552,18 @@
 
 static RelationOperator TokenKindToUintRelOp(Token::Kind kind) {
   switch (kind) {
-    case Token::kEQ: return EQ;
-    case Token::kNE: return NE;
-    case Token::kLT: return ULT;
-    case Token::kGT: return UGT;
-    case Token::kLTE: return ULE;
-    case Token::kGTE: return UGE;
+    case Token::kEQ:
+      return EQ;
+    case Token::kNE:
+      return NE;
+    case Token::kLT:
+      return ULT;
+    case Token::kGT:
+      return UGT;
+    case Token::kLTE:
+      return ULE;
+    case Token::kGTE:
+      return UGE;
     default:
       UNREACHABLE();
       return NV;
@@ -576,10 +602,12 @@
   ASSERT(right.IsRegister() || right.IsConstant());
 
   int16_t imm = 0;
-  const Register left_reg = left.IsRegister() ?
-      left.reg() : __ LoadConditionOperand(CMPRES1, left.constant(), &imm);
-  const Register right_reg = right.IsRegister() ?
-      right.reg() : __ LoadConditionOperand(CMPRES2, right.constant(), &imm);
+  const Register left_reg =
+      left.IsRegister() ? left.reg() : __ LoadConditionOperand(
+                                           CMPRES1, left.constant(), &imm);
+  const Register right_reg =
+      right.IsRegister() ? right.reg() : __ LoadConditionOperand(
+                                             CMPRES2, right.constant(), &imm);
   return Condition(left_reg, right_reg, TokenKindToIntRelOp(kind), imm);
 }
 
@@ -677,17 +705,29 @@
   __ Comment("DoubleComparisonOp(left=%d, right=%d)", left, right);
 
   __ cund(left, right);
-  Label* nan_label = (kind == Token::kNE)
-      ? labels.true_label : labels.false_label;
+  Label* nan_label =
+      (kind == Token::kNE) ? labels.true_label : labels.false_label;
   __ bc1t(nan_label);
 
   switch (kind) {
-    case Token::kEQ: __ ceqd(left, right); break;
-    case Token::kNE: __ ceqd(left, right); break;
-    case Token::kLT: __ coltd(left, right); break;
-    case Token::kLTE: __ coled(left, right); break;
-    case Token::kGT: __ coltd(right, left); break;
-    case Token::kGTE: __ coled(right, left); break;
+    case Token::kEQ:
+      __ ceqd(left, right);
+      break;
+    case Token::kNE:
+      __ ceqd(left, right);
+      break;
+    case Token::kLT:
+      __ coltd(left, right);
+      break;
+    case Token::kLTE:
+      __ coled(left, right);
+      break;
+    case Token::kGT:
+      __ coltd(right, left);
+      break;
+    case Token::kGTE:
+      __ coled(right, left);
+      break;
     default: {
       // We should only be passing the above conditions to this function.
       UNREACHABLE();
@@ -744,7 +784,7 @@
   __ Comment("EqualityCompareInstr");
 
   Label is_true, is_false;
-  BranchLabels labels = { &is_true, &is_false, &is_false };
+  BranchLabels labels = {&is_true, &is_false, &is_false};
   Condition true_condition = EmitComparisonCode(compiler, labels);
   EmitBranchOnCondition(compiler, true_condition, labels);
 
@@ -770,12 +810,11 @@
 }
 
 
-LocationSummary* TestSmiInstr::MakeLocationSummary(Zone* zone,
-                                                   bool opt) const {
+LocationSummary* TestSmiInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RequiresRegister());
   // Only one input can be a constant operand. The case of two constant
   // operands should be handled by constant propagation.
@@ -790,8 +829,7 @@
   Location right = locs()->in(1);
   if (right.IsConstant()) {
     ASSERT(right.constant().IsSmi());
-    const int32_t imm =
-        reinterpret_cast<int32_t>(right.constant().raw());
+    const int32_t imm = reinterpret_cast<int32_t>(right.constant().raw());
     __ AndImmediate(CMPRES1, left, imm);
   } else {
     __ and_(CMPRES1, left, right.reg());
@@ -818,8 +856,8 @@
                                                     bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RequiresRegister());
   locs->set_temp(0, Location::RequiresRegister());
   locs->set_out(0, Location::RequiresRegister());
@@ -833,11 +871,11 @@
   Register val_reg = locs()->in(0).reg();
   Register cid_reg = locs()->temp(0).reg();
 
-  Label* deopt = CanDeoptimize()
-      ? compiler->AddDeoptStub(deopt_id(),
-                               ICData::kDeoptTestCids,
-                               licm_hoisted_ ? ICData::kHoisted : 0)
-      : NULL;
+  Label* deopt =
+      CanDeoptimize()
+          ? compiler->AddDeoptStub(deopt_id(), ICData::kDeoptTestCids,
+                                   licm_hoisted_ ? ICData::kHoisted : 0)
+          : NULL;
 
   const intptr_t true_result = (kind() == Token::kIS) ? 1 : 0;
   const ZoneGrowableArray<intptr_t>& data = cid_results();
@@ -878,7 +916,7 @@
 void TestCidsInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Register result_reg = locs()->out(0).reg();
   Label is_true, is_false, done;
-  BranchLabels labels = { &is_true, &is_false, &is_false };
+  BranchLabels labels = {&is_true, &is_false, &is_false};
   EmitComparisonCode(compiler, labels);
   __ Bind(&is_false);
   __ LoadObject(result_reg, Bool::False());
@@ -895,8 +933,8 @@
   const intptr_t kNumTemps = 0;
   if (operation_cid() == kMintCid) {
     const intptr_t kNumTemps = 0;
-    LocationSummary* locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* locs = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     locs->set_in(0, Location::Pair(Location::RequiresRegister(),
                                    Location::RequiresRegister()));
     locs->set_in(1, Location::Pair(Location::RequiresRegister(),
@@ -905,16 +943,16 @@
     return locs;
   }
   if (operation_cid() == kDoubleCid) {
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresFpuRegister());
     summary->set_in(1, Location::RequiresFpuRegister());
     summary->set_out(0, Location::RequiresRegister());
     return summary;
   }
   ASSERT(operation_cid() == kSmiCid);
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, 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.
@@ -943,7 +981,7 @@
   __ Comment("RelationalOpInstr");
 
   Label is_true, is_false;
-  BranchLabels labels = { &is_true, &is_false, &is_false };
+  BranchLabels labels = {&is_true, &is_false, &is_false};
   Condition true_condition = EmitComparisonCode(compiler, labels);
   EmitBranchOnCondition(compiler, true_condition, labels);
 
@@ -983,8 +1021,8 @@
   __ PushObject(Object::null_object());
   // Pass a pointer to the first argument in A2.
   if (!function().HasOptionalParameters()) {
-    __ AddImmediate(A2, FP, (kParamEndSlotFromFp +
-                             function().NumParameters()) * kWordSize);
+    __ AddImmediate(
+        A2, FP, (kParamEndSlotFromFp + function().NumParameters()) * kWordSize);
   } else {
     __ AddImmediate(A2, FP, kFirstLocalSlotFromFp * kWordSize);
   }
@@ -1015,21 +1053,23 @@
   __ LoadImmediate(A1, argc_tag);
   ExternalLabel label(entry);
   __ LoadNativeEntry(T5, &label, kNotPatchable);
-  compiler->GenerateCall(token_pos(),
-                         *stub_entry,
-                         RawPcDescriptors::kOther,
-                         locs());
+  if (link_lazily()) {
+    compiler->GeneratePatchableCall(token_pos(), *stub_entry,
+                                    RawPcDescriptors::kOther, locs());
+  } else {
+    compiler->GenerateCall(token_pos(), *stub_entry, RawPcDescriptors::kOther,
+                           locs());
+  }
   __ Pop(result);
 }
 
 
 LocationSummary* OneByteStringFromCharCodeInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 1;
   // TODO(fschneider): Allow immediate operands for the char code.
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -1051,9 +1091,7 @@
 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Zone* zone,
                                                             bool opt) const {
   const intptr_t kNumInputs = 1;
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -1079,8 +1117,8 @@
                                                              bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(A0));
   summary->set_out(0, Location::RegisterLocation(V0));
   return summary;
@@ -1092,12 +1130,8 @@
   __ Push(array);
   const int kNumberOfArguments = 1;
   const Array& kNoArgumentNames = Object::null_array();
-  compiler->GenerateStaticCall(deopt_id(),
-                               token_pos(),
-                               CallFunction(),
-                               kNumberOfArguments,
-                               kNoArgumentNames,
-                               locs(),
+  compiler->GenerateStaticCall(deopt_id(), token_pos(), CallFunction(),
+                               kNumberOfArguments, kNoArgumentNames, locs(),
                                ICData::Handle());
   ASSERT(locs()->out(0).reg() == V0);
 }
@@ -1106,9 +1140,7 @@
 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Zone* zone,
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -1128,9 +1160,7 @@
 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Zone* zone,
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -1228,7 +1258,8 @@
   }
   const int64_t index = Smi::Cast(constant->value()).AsInt64Value();
   const intptr_t scale = Instance::ElementSizeFor(cid);
-  const int64_t offset = index * scale +
+  const int64_t offset =
+      index * scale +
       (is_external ? 0 : (Instance::DataOffsetFor(cid) - kHeapObjectTag));
   if (!Utils::IsInt(32, offset)) {
     return false;
@@ -1240,22 +1271,25 @@
 LocationSummary* LoadIndexedInstr::MakeLocationSummary(Zone* zone,
                                                        bool opt) const {
   const intptr_t kNumInputs = 2;
-  const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  const intptr_t kNumTemps = aligned() ? 0 : 1;
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RequiresRegister());
   if (CanBeImmediateIndex(index(), class_id(), IsExternal())) {
     locs->set_in(1, Location::Constant(index()->definition()->AsConstant()));
   } else {
     locs->set_in(1, Location::RequiresRegister());
   }
-  if ((representation() == kUnboxedDouble)    ||
+  if ((representation() == kUnboxedDouble) ||
       (representation() == kUnboxedFloat32x4) ||
       (representation() == kUnboxedInt32x4)) {
     locs->set_out(0, Location::RequiresFpuRegister());
   } else {
     locs->set_out(0, Location::RequiresRegister());
   }
+  if (!aligned()) {
+    locs->set_temp(0, Location::RequiresRegister());
+  }
   return locs;
 }
 
@@ -1265,15 +1299,31 @@
   // The array register points to the backing store for external arrays.
   const Register array = locs()->in(0).reg();
   const Location index = locs()->in(1);
+  const Register address = aligned() ? kNoRegister : locs()->temp(0).reg();
 
-  Address element_address = index.IsRegister()
-      ? __ ElementAddressForRegIndex(true,  // Load.
-                                     IsExternal(), class_id(), index_scale(),
-                                     array, index.reg())
-      : __ ElementAddressForIntIndex(
-            IsExternal(), class_id(), index_scale(),
-            array, Smi::Cast(index.constant()).Value());
-  // Warning: element_address may use register TMP as base.
+  Address element_address(kNoRegister);
+  if (aligned()) {
+    element_address =
+        index.IsRegister()
+            ? __ ElementAddressForRegIndex(true,  // Load.
+                                           IsExternal(), class_id(),
+                                           index_scale(), array, index.reg())
+            : __ ElementAddressForIntIndex(IsExternal(), class_id(),
+                                           index_scale(), array,
+                                           Smi::Cast(index.constant()).Value());
+    // Warning: element_address may use register TMP as base.
+  } else {
+    if (index.IsRegister()) {
+      __ LoadElementAddressForRegIndex(address,
+                                       true,  // Load.
+                                       IsExternal(), class_id(), index_scale(),
+                                       array, index.reg());
+    } else {
+      __ LoadElementAddressForIntIndex(address, IsExternal(), class_id(),
+                                       index_scale(), array,
+                                       Smi::Cast(index.constant()).Value());
+    }
+  }
 
   if ((representation() == kUnboxedDouble) ||
       (representation() == kUnboxedFloat32x4) ||
@@ -1285,8 +1335,8 @@
         __ lwc1(EvenFRegisterOf(result), element_address);
         break;
       case kTypedDataFloat64ArrayCid:
-        __ LoadDFromOffset(result,
-                           element_address.base(), element_address.offset());
+        __ LoadDFromOffset(result, element_address.base(),
+                           element_address.offset());
         break;
       case kTypedDataInt32x4ArrayCid:
       case kTypedDataFloat32x4ArrayCid:
@@ -1302,11 +1352,19 @@
     switch (class_id()) {
       case kTypedDataInt32ArrayCid:
         ASSERT(representation() == kUnboxedInt32);
-        __ lw(result, element_address);
+        if (aligned()) {
+          __ lw(result, element_address);
+        } else {
+          __ LoadWordUnaligned(result, address, TMP);
+        }
         break;
       case kTypedDataUint32ArrayCid:
         ASSERT(representation() == kUnboxedUint32);
-        __ lw(result, element_address);
+        if (aligned()) {
+          __ lw(result, element_address);
+        } else {
+          __ LoadWordUnaligned(result, address, TMP);
+        }
         break;
       default:
         UNREACHABLE();
@@ -1334,17 +1392,26 @@
       __ SmiTag(result);
       break;
     case kTypedDataInt16ArrayCid:
-      __ lh(result, element_address);
+      if (aligned()) {
+        __ lh(result, element_address);
+      } else {
+        __ LoadHalfWordUnaligned(result, address, TMP);
+      }
       __ SmiTag(result);
       break;
     case kTypedDataUint16ArrayCid:
     case kTwoByteStringCid:
     case kExternalTwoByteStringCid:
-      __ lhu(result, element_address);
+      if (aligned()) {
+        __ lhu(result, element_address);
+      } else {
+        __ LoadHalfWordUnsignedUnaligned(result, address, TMP);
+      }
       __ SmiTag(result);
       break;
     default:
       ASSERT((class_id() == kArrayCid) || (class_id() == kImmutableArrayCid));
+      ASSERT(aligned());
       __ lw(result, element_address);
       break;
   }
@@ -1355,8 +1422,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
 
@@ -1374,7 +1441,7 @@
   const Location index = locs()->in(1);
 
   Address element_address = __ ElementAddressForRegIndex(
-        true, IsExternal(), class_id(), index_scale(), str, index.reg());
+      true, IsExternal(), class_id(), index_scale(), str, index.reg());
   // Warning: element_address may use register TMP as base.
 
   ASSERT(representation() == kTagged);
@@ -1383,19 +1450,27 @@
     case kOneByteStringCid:
     case kExternalOneByteStringCid:
       switch (element_count()) {
-        case 1: __ lbu(result, element_address); break;
-        case 2: __ lhu(result, element_address); break;
+        case 1:
+          __ lbu(result, element_address);
+          break;
+        case 2:
+          __ lhu(result, element_address);
+          break;
         case 4:  // Loading multiple code units is disabled on MIPS.
-        default: UNREACHABLE();
+        default:
+          UNREACHABLE();
       }
       __ SmiTag(result);
       break;
     case kTwoByteStringCid:
     case kExternalTwoByteStringCid:
       switch (element_count()) {
-        case 1: __ lhu(result, element_address); break;
+        case 1:
+          __ lhu(result, element_address);
+          break;
         case 2:  // Loading multiple code units is disabled on MIPS.
-        default: UNREACHABLE();
+        default:
+          UNREACHABLE();
       }
       __ SmiTag(result);
       break;
@@ -1409,8 +1484,8 @@
 Representation StoreIndexedInstr::RequiredInputRepresentation(
     intptr_t idx) const {
   // Array can be a Dart object or a pointer to external data.
-  if (idx == 0)  return kNoRepresentation;  // Flexible input representation.
-  if (idx == 1) return kTagged;  // Index is a smi.
+  if (idx == 0) return kNoRepresentation;  // Flexible input representation.
+  if (idx == 1) return kTagged;            // Index is a smi.
   ASSERT(idx == 2);
   switch (class_id_) {
     case kArrayCid:
@@ -1444,9 +1519,9 @@
 LocationSummary* StoreIndexedInstr::MakeLocationSummary(Zone* zone,
                                                         bool opt) const {
   const intptr_t kNumInputs = 3;
-  const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  const intptr_t kNumTemps = aligned() ? 0 : 2;
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RequiresRegister());
   if (CanBeImmediateIndex(index(), class_id(), IsExternal())) {
     locs->set_in(1, Location::Constant(index()->definition()->AsConstant()));
@@ -1456,8 +1531,8 @@
   switch (class_id()) {
     case kArrayCid:
       locs->set_in(2, ShouldEmitStoreBarrier()
-                        ? Location::WritableRegister()
-                        : Location::RegisterOrConstant(value()));
+                          ? Location::WritableRegister()
+                          : Location::RegisterOrConstant(value()));
       break;
     case kExternalTypedDataUint8ArrayCid:
     case kExternalTypedDataUint8ClampedArrayCid:
@@ -1481,6 +1556,10 @@
       UNREACHABLE();
       return NULL;
   }
+  if (!aligned()) {
+    locs->set_temp(0, Location::RequiresRegister());
+    locs->set_temp(1, Location::RequiresRegister());
+  }
   return locs;
 }
 
@@ -1490,18 +1569,36 @@
   // The array register points to the backing store for external arrays.
   const Register array = locs()->in(0).reg();
   const Location index = locs()->in(1);
+  const Register address = aligned() ? kNoRegister : locs()->temp(0).reg();
+  const Register scratch = aligned() ? kNoRegister : locs()->temp(1).reg();
 
-  Address element_address = index.IsRegister()
-      ? __ ElementAddressForRegIndex(false,  // Store.
-                                     IsExternal(), class_id(), index_scale(),
-                                     array, index.reg())
-      : __ ElementAddressForIntIndex(
-            IsExternal(), class_id(), index_scale(),
-            array, Smi::Cast(index.constant()).Value());
-  ASSERT(element_address.base() != TMP);  // Allowed for load only.
+  Address element_address(kNoRegister);
+  if (aligned()) {
+    element_address =
+        index.IsRegister()
+            ? __ ElementAddressForRegIndex(false,  // Store.
+                                           IsExternal(), class_id(),
+                                           index_scale(), array, index.reg())
+            : __ ElementAddressForIntIndex(IsExternal(), class_id(),
+                                           index_scale(), array,
+                                           Smi::Cast(index.constant()).Value());
+    ASSERT(element_address.base() != TMP);  // Allowed for load only.
+  } else {
+    if (index.IsRegister()) {
+      __ LoadElementAddressForRegIndex(address,
+                                       false,  // Store.
+                                       IsExternal(), class_id(), index_scale(),
+                                       array, index.reg());
+    } else {
+      __ LoadElementAddressForIntIndex(address, IsExternal(), class_id(),
+                                       index_scale(), array,
+                                       Smi::Cast(index.constant()).Value());
+    }
+  }
 
   switch (class_id()) {
     case kArrayCid:
+      ASSERT(aligned());
       if (ShouldEmitStoreBarrier()) {
         Register value = locs()->in(2).reg();
         __ StoreIntoObject(array, element_address, value);
@@ -1517,6 +1614,7 @@
     case kTypedDataUint8ArrayCid:
     case kExternalTypedDataUint8ArrayCid:
     case kOneByteStringCid: {
+      ASSERT(aligned());
       if (locs()->in(2).IsConstant()) {
         const Smi& constant = Smi::Cast(locs()->in(2).constant());
         __ LoadImmediate(TMP, static_cast<int8_t>(constant.Value()));
@@ -1530,6 +1628,7 @@
     }
     case kTypedDataUint8ClampedArrayCid:
     case kExternalTypedDataUint8ClampedArrayCid: {
+      ASSERT(aligned());
       if (locs()->in(2).IsConstant()) {
         const Smi& constant = Smi::Cast(locs()->in(2).constant());
         intptr_t value = constant.Value();
@@ -1558,22 +1657,32 @@
     case kTypedDataUint16ArrayCid: {
       Register value = locs()->in(2).reg();
       __ SmiUntag(TMP, value);
-      __ sh(TMP, element_address);
+      if (aligned()) {
+        __ sh(TMP, element_address);
+      } else {
+        __ StoreHalfWordUnaligned(TMP, address, scratch);
+      }
       break;
     }
     case kTypedDataInt32ArrayCid:
     case kTypedDataUint32ArrayCid: {
-      __ sw(locs()->in(2).reg(), element_address);
+      if (aligned()) {
+        __ sw(locs()->in(2).reg(), element_address);
+      } else {
+        __ StoreWordUnaligned(locs()->in(2).reg(), address, scratch);
+      }
       break;
     }
     case kTypedDataFloat32ArrayCid: {
+      ASSERT(aligned());
       FRegister value = EvenFRegisterOf(locs()->in(2).fpu_reg());
       __ swc1(value, element_address);
       break;
     }
     case kTypedDataFloat64ArrayCid:
-      __ StoreDToOffset(locs()->in(2).fpu_reg(),
-                        element_address.base(), element_address.offset());
+      ASSERT(aligned());
+      __ StoreDToOffset(locs()->in(2).fpu_reg(), element_address.base(),
+                        element_address.offset());
       break;
     case kTypedDataInt32x4ArrayCid:
     case kTypedDataFloat32x4ArrayCid:
@@ -1594,7 +1703,7 @@
 
   const bool emit_full_guard = !opt || (field_cid == kIllegalCid);
   const bool needs_value_cid_temp_reg =
-    (value_cid == kDynamicCid) && (emit_full_guard || (field_cid != kSmiCid));
+      (value_cid == kDynamicCid) && (emit_full_guard || (field_cid != kSmiCid));
   const bool needs_field_temp_reg = emit_full_guard;
 
   intptr_t num_temps = 0;
@@ -1605,8 +1714,8 @@
     num_temps++;
   }
 
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, num_temps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, num_temps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
 
   for (intptr_t i = 0; i < num_temps; i++) {
@@ -1628,7 +1737,8 @@
   if (field_cid == kDynamicCid) {
     if (Compiler::IsBackgroundCompilation()) {
       // Field state changed while compiling.
-      Compiler::AbortBackgroundCompilation(deopt_id(),
+      Compiler::AbortBackgroundCompilation(
+          deopt_id(),
           "GuardFieldClassInstr: field state changed while compiling");
     }
     ASSERT(!compiler->is_optimizing());
@@ -1645,16 +1755,19 @@
 
   const Register value_reg = locs()->in(0).reg();
 
-  const Register value_cid_reg = needs_value_cid_temp_reg ?
-      locs()->temp(0).reg() : kNoRegister;
+  const Register value_cid_reg =
+      needs_value_cid_temp_reg ? locs()->temp(0).reg() : kNoRegister;
 
-  const Register field_reg = needs_field_temp_reg ?
-      locs()->temp(locs()->temp_count() - 1).reg() : kNoRegister;
+  const Register field_reg = needs_field_temp_reg
+                                 ? locs()->temp(locs()->temp_count() - 1).reg()
+                                 : kNoRegister;
 
   Label ok, fail_label;
 
-  Label* deopt = compiler->is_optimizing() ?
-      compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL;
+  Label* deopt =
+      compiler->is_optimizing()
+          ? compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField)
+          : NULL;
 
   Label* fail = (deopt != NULL) ? deopt : &fail_label;
 
@@ -1662,8 +1775,8 @@
     __ LoadObject(field_reg, Field::ZoneHandle(field().Original()));
 
     FieldAddress field_cid_operand(field_reg, Field::guarded_cid_offset());
-    FieldAddress field_nullability_operand(
-        field_reg, Field::is_nullable_offset());
+    FieldAddress field_nullability_operand(field_reg,
+                                           Field::is_nullable_offset());
 
     if (value_cid == kDynamicCid) {
       LoadValueCid(compiler, value_cid_reg, value_reg);
@@ -1767,15 +1880,15 @@
 
   if (!opt || (field().guarded_list_length() == Field::kUnknownFixedLength)) {
     const intptr_t kNumTemps = 1;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresRegister());
     // We need temporaries for field object.
     summary->set_temp(0, Location::RequiresRegister());
     return summary;
   }
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, 0, LocationSummary::kNoCall);
+  LocationSummary* summary =
+      new (zone) LocationSummary(zone, kNumInputs, 0, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   return summary;
 }
@@ -1785,15 +1898,18 @@
   if (field().guarded_list_length() == Field::kNoFixedLength) {
     if (Compiler::IsBackgroundCompilation()) {
       // Field state changed while compiling.
-      Compiler::AbortBackgroundCompilation(deopt_id(),
+      Compiler::AbortBackgroundCompilation(
+          deopt_id(),
           "GuardFieldLengthInstr: field state changed while compiling");
     }
     ASSERT(!compiler->is_optimizing());
     return;  // Nothing to emit.
   }
 
-  Label* deopt = compiler->is_optimizing() ?
-      compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL;
+  Label* deopt =
+      compiler->is_optimizing()
+          ? compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField)
+          : NULL;
 
   const Register value_reg = locs()->in(0).reg();
 
@@ -1805,12 +1921,13 @@
 
     __ LoadObject(field_reg, Field::ZoneHandle(field().Original()));
 
-    __ lb(CMPRES1, FieldAddress(field_reg,
-        Field::guarded_list_length_in_object_offset_offset()));
+    __ lb(CMPRES1,
+          FieldAddress(field_reg,
+                       Field::guarded_list_length_in_object_offset_offset()));
     __ blez(CMPRES1, &ok);
 
-    __ lw(CMPRES2, FieldAddress(field_reg,
-        Field::guarded_list_length_offset()));
+    __ lw(CMPRES2,
+          FieldAddress(field_reg, Field::guarded_list_length_offset()));
 
     // Load the length from the value. GuardFieldClass already verified that
     // value's class matches guarded class id of the field.
@@ -1836,7 +1953,7 @@
     ASSERT(compiler->is_optimizing());
     ASSERT(field().guarded_list_length() >= 0);
     ASSERT(field().guarded_list_length_in_object_offset() !=
-        Field::kUnknownLengthOffset);
+           Field::kUnknownLengthOffset);
 
     __ lw(CMPRES1,
           FieldAddress(value_reg,
@@ -1852,14 +1969,11 @@
   BoxAllocationSlowPath(Instruction* instruction,
                         const Class& cls,
                         Register result)
-      : instruction_(instruction),
-        cls_(cls),
-        result_(result) { }
+      : instruction_(instruction), cls_(cls), result_(result) {}
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     if (Assembler::EmittingComments()) {
-      __ Comment("%s slow path allocation of %s",
-                 instruction_->DebugName(),
+      __ Comment("%s slow path allocation of %s", instruction_->DebugName(),
                  String::Handle(cls_.ScrubbedName()).ToCString());
     }
     __ Bind(entry_label());
@@ -1872,9 +1986,7 @@
 
     compiler->SaveLiveRegisters(locs);
     compiler->GenerateCall(TokenPosition::kNoSource,  // No token position.
-                           stub_entry,
-                           RawPcDescriptors::kOther,
-                           locs);
+                           stub_entry, RawPcDescriptors::kOther, locs);
     compiler->AddStubCallTarget(stub);
     if (result_ != V0) {
       __ mov(result_, V0);
@@ -1889,19 +2001,13 @@
                        Register result,
                        Register temp) {
     if (compiler->intrinsic_mode()) {
-      __ TryAllocate(cls,
-                     compiler->intrinsic_slow_path_label(),
-                     result,
-                     temp);
+      __ TryAllocate(cls, compiler->intrinsic_slow_path_label(), result, temp);
     } else {
       BoxAllocationSlowPath* slow_path =
           new BoxAllocationSlowPath(instruction, cls, result);
       compiler->AddSlowPathCode(slow_path);
 
-      __ TryAllocate(cls,
-                     slow_path->entry_label(),
-                     result,
-                     temp);
+      __ TryAllocate(cls, slow_path->entry_label(), result, temp);
       __ Bind(slow_path->exit_label());
     }
   }
@@ -1917,14 +2023,13 @@
                                                               bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps =
-      (IsUnboxedStore() && opt) ? 2 :
-          ((IsPotentialUnboxedStore()) ? 3 : 0);
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps,
-          ((IsUnboxedStore() && opt && is_initialization()) ||
-           IsPotentialUnboxedStore())
-          ? LocationSummary::kCallOnSlowPath
-          : LocationSummary::kNoCall);
+      (IsUnboxedStore() && opt) ? 2 : ((IsPotentialUnboxedStore()) ? 3 : 0);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps,
+                      ((IsUnboxedStore() && opt && is_initialization()) ||
+                       IsPotentialUnboxedStore())
+                          ? LocationSummary::kCallOnSlowPath
+                          : LocationSummary::kNoCall);
 
   summary->set_in(0, Location::RequiresRegister());
   if (IsUnboxedStore() && opt) {
@@ -1932,17 +2037,16 @@
     summary->set_temp(0, Location::RequiresRegister());
     summary->set_temp(1, Location::RequiresRegister());
   } else if (IsPotentialUnboxedStore()) {
-    summary->set_in(1, ShouldEmitStoreBarrier()
-        ? Location::WritableRegister()
-        :  Location::RequiresRegister());
+    summary->set_in(1, ShouldEmitStoreBarrier() ? Location::WritableRegister()
+                                                : Location::RequiresRegister());
     summary->set_temp(0, Location::RequiresRegister());
     summary->set_temp(1, Location::RequiresRegister());
     summary->set_temp(2, opt ? Location::RequiresFpuRegister()
                              : Location::FpuRegisterLocation(D1));
   } else {
     summary->set_in(1, ShouldEmitStoreBarrier()
-                       ? Location::WritableRegister()
-                       : Location::RegisterOrConstant(value()));
+                           ? Location::WritableRegister()
+                           : Location::RegisterOrConstant(value()));
   }
   return summary;
 }
@@ -1996,7 +2100,7 @@
     switch (cid) {
       case kDoubleCid:
         __ StoreDToOffset(value, temp, Double::value_offset() - kHeapObjectTag);
-      break;
+        break;
       default:
         UNREACHABLE();
     }
@@ -2040,15 +2144,9 @@
 
     {
       __ Bind(&store_double);
-      EnsureMutableBox(compiler,
-                       this,
-                       temp,
-                       compiler->double_class(),
-                       instance_reg,
-                       offset_in_bytes_,
-                       temp2);
-      __ LoadDFromOffset(fpu_temp,
-                         value_reg,
+      EnsureMutableBox(compiler, this, temp, compiler->double_class(),
+                       instance_reg, offset_in_bytes_, temp2);
+      __ LoadDFromOffset(fpu_temp, value_reg,
                          Double::value_offset() - kHeapObjectTag);
       __ StoreDToOffset(fpu_temp, temp,
                         Double::value_offset() - kHeapObjectTag);
@@ -2060,20 +2158,15 @@
 
   if (ShouldEmitStoreBarrier()) {
     Register value_reg = locs()->in(1).reg();
-    __ StoreIntoObjectOffset(instance_reg,
-                             offset_in_bytes_,
-                             value_reg,
+    __ StoreIntoObjectOffset(instance_reg, offset_in_bytes_, value_reg,
                              CanValueBeSmi());
   } else {
     if (locs()->in(1).IsConstant()) {
-      __ StoreIntoObjectNoBarrierOffset(
-          instance_reg,
-          offset_in_bytes_,
-          locs()->in(1).constant());
+      __ StoreIntoObjectNoBarrierOffset(instance_reg, offset_in_bytes_,
+                                        locs()->in(1).constant());
     } else {
       Register value_reg = locs()->in(1).reg();
-      __ StoreIntoObjectNoBarrierOffset(instance_reg,
-                                        offset_in_bytes_,
+      __ StoreIntoObjectNoBarrierOffset(instance_reg, offset_in_bytes_,
                                         value_reg);
     }
   }
@@ -2085,8 +2178,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_out(0, Location::RequiresRegister());
   return summary;
@@ -2102,16 +2195,15 @@
   __ Comment("LoadStaticFieldInstr");
   Register field = locs()->in(0).reg();
   Register result = locs()->out(0).reg();
-  __ LoadFromOffset(result,
-                    field,
+  __ LoadFromOffset(result, field,
                     Field::static_value_offset() - kHeapObjectTag);
 }
 
 
 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Zone* zone,
                                                             bool opt) const {
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, 1, 1, LocationSummary::kNoCall);
+  LocationSummary* locs =
+      new (zone) LocationSummary(zone, 1, 1, LocationSummary::kNoCall);
   locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister()
                                               : Location::RequiresRegister());
   locs->set_temp(0, Location::RequiresRegister());
@@ -2126,10 +2218,8 @@
 
   __ LoadObject(temp, Field::ZoneHandle(Z, field().Original()));
   if (this->value()->NeedsStoreBuffer()) {
-    __ StoreIntoObject(temp,
-                       FieldAddress(temp, Field::static_value_offset()),
-                       value,
-                       CanValueBeSmi());
+    __ StoreIntoObject(temp, FieldAddress(temp, Field::static_value_offset()),
+                       value, CanValueBeSmi());
   } else {
     __ StoreIntoObjectNoBarrier(
         temp, FieldAddress(temp, Field::static_value_offset()), value);
@@ -2141,8 +2231,8 @@
                                                       bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(A0));
   summary->set_in(1, Location::RegisterLocation(A1));
   summary->set_out(0, Location::RegisterLocation(V0));
@@ -2155,10 +2245,7 @@
   ASSERT(locs()->in(1).reg() == A1);  // Instantiator type arguments.
 
   __ Comment("InstanceOfInstr");
-  compiler->GenerateInstanceOf(token_pos(),
-                               deopt_id(),
-                               type(),
-                               negate_result(),
+  compiler->GenerateInstanceOf(token_pos(), deopt_id(), type(), negate_result(),
                                locs());
   ASSERT(locs()->out(0).reg() == V0);
 }
@@ -2168,8 +2255,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(A0));
   locs->set_in(1, Location::RegisterLocation(A1));
   locs->set_out(0, Location::RegisterLocation(V0));
@@ -2179,9 +2266,9 @@
 
 // Inlines array allocation for known constant values.
 static void InlineArrayAllocation(FlowGraphCompiler* compiler,
-                                   intptr_t num_elements,
-                                   Label* slow_path,
-                                   Label* done) {
+                                  intptr_t num_elements,
+                                  Label* slow_path,
+                                  Label* done) {
   const int kInlineArraySize = 12;  // Same as kInlineInstanceSize.
   const Register kLengthReg = A1;
   const Register kElemTypeReg = A0;
@@ -2190,19 +2277,16 @@
   __ TryAllocateArray(kArrayCid, instance_size, slow_path,
                       V0,  // instance
                       T1,  // end address
-                      T2,
-                      T3);
+                      T2, T3);
   // V0: new object start as a tagged pointer.
   // T1: new object end address.
 
   // Store the type argument field.
-  __ StoreIntoObjectNoBarrier(V0,
-                              FieldAddress(V0, Array::type_arguments_offset()),
-                              kElemTypeReg);
+  __ StoreIntoObjectNoBarrier(
+      V0, FieldAddress(V0, Array::type_arguments_offset()), kElemTypeReg);
 
   // Set the length field.
-  __ StoreIntoObjectNoBarrier(V0,
-                              FieldAddress(V0, Array::length_offset()),
+  __ StoreIntoObjectNoBarrier(V0, FieldAddress(V0, Array::length_offset()),
                               kLengthReg);
 
   // Initialize all array elements to raw_null.
@@ -2242,8 +2326,7 @@
   ASSERT(locs()->in(1).reg() == kLengthReg);
 
   Label slow_path, done;
-  if (compiler->is_optimizing() &&
-      !FLAG_precompiled_mode &&
+  if (compiler->is_optimizing() && !FLAG_precompiled_mode &&
       num_elements()->BindsToConstant() &&
       num_elements()->BoundConstant().IsSmi()) {
     const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value();
@@ -2252,13 +2335,10 @@
       InlineArrayAllocation(compiler, length, &slow_path, &done);
       __ Bind(&slow_path);
       __ PushObject(Object::null_object());  // Make room for the result.
-      __ Push(kLengthReg);  // length.
+      __ Push(kLengthReg);                   // length.
       __ Push(kElemTypeReg);
-      compiler->GenerateRuntimeCall(token_pos(),
-                                    deopt_id(),
-                                    kAllocateArrayRuntimeEntry,
-                                    2,
-                                    locs());
+      compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                    kAllocateArrayRuntimeEntry, 2, locs());
       __ Drop(2);
       __ Pop(kResultReg);
       __ Bind(&done);
@@ -2270,10 +2350,8 @@
   const Code& stub = Code::ZoneHandle(compiler->zone(),
                                       StubCode::AllocateArray_entry()->code());
   compiler->AddStubCallTarget(stub);
-  compiler->GenerateCall(token_pos(),
-                         *StubCode::AllocateArray_entry(),
-                         RawPcDescriptors::kOther,
-                         locs());
+  compiler->GenerateCall(token_pos(), *StubCode::AllocateArray_entry(),
+                         RawPcDescriptors::kOther, locs());
   __ Bind(&done);
   ASSERT(locs()->out(0).reg() == kResultReg);
 }
@@ -2283,13 +2361,11 @@
                                                      bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps =
-      (IsUnboxedLoad() && opt) ? 1 :
-          ((IsPotentialUnboxedLoad()) ? 2 : 0);
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps,
-          (opt && !IsPotentialUnboxedLoad())
-          ? LocationSummary::kNoCall
-          : LocationSummary::kCallOnSlowPath);
+      (IsUnboxedLoad() && opt) ? 1 : ((IsPotentialUnboxedLoad()) ? 2 : 0);
+  LocationSummary* locs = new (zone) LocationSummary(
+      zone, kNumInputs, kNumTemps, (opt && !IsPotentialUnboxedLoad())
+                                       ? LocationSummary::kNoCall
+                                       : LocationSummary::kCallOnSlowPath);
 
   locs->set_in(0, Location::RequiresRegister());
 
@@ -2355,12 +2431,11 @@
 
     {
       __ Bind(&load_double);
-      BoxAllocationSlowPath::Allocate(
-          compiler, this, compiler->double_class(), result_reg, temp);
+      BoxAllocationSlowPath::Allocate(compiler, this, compiler->double_class(),
+                                      result_reg, temp);
       __ lw(temp, FieldAddress(instance_reg, offset_in_bytes()));
       __ LoadDFromOffset(value, temp, Double::value_offset() - kHeapObjectTag);
-      __ StoreDToOffset(value,
-                        result_reg,
+      __ StoreDToOffset(value, result_reg,
                         Double::value_offset() - kHeapObjectTag);
       __ b(&done);
     }
@@ -2376,8 +2451,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(T0));
   locs->set_out(0, Location::RegisterLocation(T0));
   return locs;
@@ -2399,11 +2474,8 @@
   // Push instantiator type arguments.
   __ sw(instantiator_reg, Address(SP, 0 * kWordSize));
 
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kInstantiateTypeRuntimeEntry,
-                                2,
-                                locs());
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                kInstantiateTypeRuntimeEntry, 2, locs());
   // Pop instantiated type.
   __ lw(result_reg, Address(SP, 2 * kWordSize));
   // Drop instantiator and uninstantiated type.
@@ -2413,11 +2485,12 @@
 
 
 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(T0));
   locs->set_out(0, Location::RegisterLocation(T0));
   return locs;
@@ -2455,8 +2528,8 @@
   __ Bind(&loop);
   __ lw(T1, Address(T2, 0 * kWordSize));  // Cached instantiator.
   __ beq(T1, T0, &found);
-  __ BranchNotEqual(
-      T1, Immediate(Smi::RawValue(StubCode::kNoInstantiator)), &loop);
+  __ BranchNotEqual(T1, Immediate(Smi::RawValue(StubCode::kNoInstantiator)),
+                    &loop);
   __ delay_slot()->addiu(T2, T2, Immediate(2 * kWordSize));
   __ b(&slow_case);
   __ Bind(&found);
@@ -2474,10 +2547,8 @@
   // Push instantiator type arguments.
   __ sw(instantiator_reg, Address(SP, 0 * kWordSize));
 
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kInstantiateTypeArgumentsRuntimeEntry,
-                                2,
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                kInstantiateTypeArgumentsRuntimeEntry, 2,
                                 locs());
   // Pop instantiated type arguments.
   __ lw(result_reg, Address(SP, 2 * kWordSize));
@@ -2493,7 +2564,7 @@
   ASSERT(opt);
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 3;
-  LocationSummary* locs = new(zone) LocationSummary(
+  LocationSummary* locs = new (zone) LocationSummary(
       zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   locs->set_temp(0, Location::RegisterLocation(T1));
   locs->set_temp(1, Location::RegisterLocation(T2));
@@ -2507,7 +2578,7 @@
  public:
   explicit AllocateContextSlowPath(
       AllocateUninitializedContextInstr* instruction)
-      : instruction_(instruction) { }
+      : instruction_(instruction) {}
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     __ Comment("AllocateContextSlowPath");
@@ -2524,8 +2595,7 @@
     compiler->AddStubCallTarget(stub);
     compiler->GenerateCall(instruction_->token_pos(),
                            *StubCode::AllocateContext_entry(),
-                           RawPcDescriptors::kOther,
-                           locs);
+                           RawPcDescriptors::kOther, locs);
     ASSERT(instruction_->locs()->out(0).reg() == V0);
     compiler->RestoreLiveRegisters(instruction_->locs());
     __ b(exit_label());
@@ -2549,9 +2619,7 @@
 
   __ TryAllocateArray(kContextCid, instance_size, slow_path->entry_label(),
                       result,  // instance
-                      temp0,
-                      temp1,
-                      temp2);
+                      temp0, temp1, temp2);
 
   // Setup up number of context variables field.
   __ LoadImmediate(temp0, num_context_variables());
@@ -2565,8 +2633,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 1;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_temp(0, Location::RegisterLocation(T1));
   locs->set_out(0, Location::RegisterLocation(V0));
   return locs;
@@ -2579,10 +2647,8 @@
 
   __ Comment("AllocateContextInstr");
   __ LoadImmediate(T1, num_context_variables());
-  compiler->GenerateCall(token_pos(),
-                         *StubCode::AllocateContext_entry(),
-                         RawPcDescriptors::kOther,
-                         locs());
+  compiler->GenerateCall(token_pos(), *StubCode::AllocateContext_entry(),
+                         RawPcDescriptors::kOther, locs());
 }
 
 
@@ -2590,8 +2656,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(T0));
   locs->set_temp(0, Location::RegisterLocation(T1));
   return locs;
@@ -2612,14 +2678,11 @@
   __ Bind(&call_runtime);
   __ addiu(SP, SP, Immediate(-2 * kWordSize));
   __ LoadObject(TMP, Object::null_object());
-  __ sw(TMP, Address(SP, 1 * kWordSize));   // Make room for (unused) result.
+  __ sw(TMP, Address(SP, 1 * kWordSize));  // Make room for (unused) result.
   __ sw(field, Address(SP, 0 * kWordSize));
 
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kInitStaticFieldRuntimeEntry,
-                                1,
-                                locs());
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                kInitStaticFieldRuntimeEntry, 1, locs());
 
   __ addiu(SP, SP, Immediate(2 * kWordSize));  // Purge argument and result.
 
@@ -2631,8 +2694,8 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(T0));
   locs->set_out(0, Location::RegisterLocation(T0));
   return locs;
@@ -2650,11 +2713,8 @@
   __ sw(TMP, Address(SP, 1 * kWordSize));
   __ sw(context_value, Address(SP, 0 * kWordSize));
 
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kCloneContextRuntimeEntry,
-                                1,
-                                locs());
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                kCloneContextRuntimeEntry, 1, locs());
   __ lw(result, Address(SP, 1 * kWordSize));  // Get result (cloned context).
   __ addiu(SP, SP, Immediate(2 * kWordSize));
 }
@@ -2668,28 +2728,17 @@
 
 
 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  // Ensure space for patching return sites for lazy deopt.
-  if (!FLAG_precompiled_mode && compiler->is_optimizing()) {
-    for (intptr_t i = 0;
-      i < CallPattern::kDeoptCallLengthInInstructions;
-      ++i) {
-      __ nop();
-    }
-  }
   __ Bind(compiler->GetJumpLabel(this));
-  compiler->AddExceptionHandler(catch_try_index(),
-                                try_index(),
+  compiler->AddExceptionHandler(catch_try_index(), try_index(),
                                 compiler->assembler()->CodeSize(),
-                                catch_handler_types_,
-                                needs_stacktrace());
+                                catch_handler_types_, needs_stacktrace());
   // On lazy deoptimization we patch the optimized code here to enter the
   // deoptimization stub.
   const intptr_t deopt_id = Thread::ToDeoptAfter(GetDeoptId());
   if (compiler->is_optimizing()) {
     compiler->AddDeoptIndexAtCall(deopt_id);
   } else {
-    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                                   deopt_id,
+    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id,
                                    TokenPosition::kNoSource);
   }
   if (HasParallelMove()) {
@@ -2704,10 +2753,10 @@
 
   // Restore stack and initialize the two exception variables:
   // exception and stack trace variables.
-  __ StoreToOffset(kExceptionObjectReg,
-                   FP, exception_var().index() * kWordSize);
-  __ StoreToOffset(kStackTraceObjectReg,
-                   FP, stacktrace_var().index() * kWordSize);
+  __ StoreToOffset(kExceptionObjectReg, FP,
+                   exception_var().index() * kWordSize);
+  __ StoreToOffset(kStackTraceObjectReg, FP,
+                   stacktrace_var().index() * kWordSize);
 }
 
 
@@ -2715,10 +2764,8 @@
                                                               bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs,
-                          kNumTemps,
-                          LocationSummary::kCallOnSlowPath);
+  LocationSummary* summary = new (zone) LocationSummary(
+      zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   summary->set_temp(0, Location::RequiresRegister());
   return summary;
 }
@@ -2727,7 +2774,7 @@
 class CheckStackOverflowSlowPath : public SlowPathCode {
  public:
   explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction)
-      : instruction_(instruction) { }
+      : instruction_(instruction) {}
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     if (FLAG_use_osr && osr_entry_label()->IsLinked()) {
@@ -2745,11 +2792,9 @@
     ASSERT(compiler->pending_deoptimization_env_ == NULL);
     Environment* env = compiler->SlowPathEnvironmentFor(instruction_);
     compiler->pending_deoptimization_env_ = env;
-    compiler->GenerateRuntimeCall(instruction_->token_pos(),
-                                  instruction_->deopt_id(),
-                                  kStackOverflowRuntimeEntry,
-                                  0,
-                                  instruction_->locs());
+    compiler->GenerateRuntimeCall(
+        instruction_->token_pos(), instruction_->deopt_id(),
+        kStackOverflowRuntimeEntry, 0, instruction_->locs());
 
     if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) {
       // In unoptimized code, record loop stack checks as possible OSR entries.
@@ -2789,8 +2834,8 @@
     intptr_t threshold =
         FLAG_optimization_counter_threshold * (loop_depth() + 1);
     __ lw(temp, FieldAddress(temp, Function::usage_counter_offset()));
-    __ BranchSignedGreaterEqual(
-        temp, Immediate(threshold), slow_path->osr_entry_label());
+    __ BranchSignedGreaterEqual(temp, Immediate(threshold),
+                                slow_path->osr_entry_label());
   }
   if (compiler->ForceSlowPathForStackOverflow()) {
     __ b(slow_path->entry_label());
@@ -2804,9 +2849,10 @@
   const LocationSummary& locs = *shift_left->locs();
   Register left = locs.in(0).reg();
   Register result = locs.out(0).reg();
-  Label* deopt = shift_left->CanDeoptimize() ?
-      compiler->AddDeoptStub(shift_left->deopt_id(), ICData::kDeoptBinarySmiOp)
-      : NULL;
+  Label* deopt = shift_left->CanDeoptimize()
+                     ? compiler->AddDeoptStub(shift_left->deopt_id(),
+                                              ICData::kDeoptBinarySmiOp)
+                     : NULL;
 
   __ Comment("EmitSmiShiftLeft");
 
@@ -2868,8 +2914,8 @@
       }
       Label done, is_not_zero;
 
-      __ sltiu(CMPRES1,
-          right, Immediate(reinterpret_cast<int32_t>(Smi::New(Smi::kBits))));
+      __ sltiu(CMPRES1, right,
+               Immediate(reinterpret_cast<int32_t>(Smi::New(Smi::kBits))));
       __ movz(result, ZR, CMPRES1);  // result = right >= kBits ? 0 : result.
       __ sra(TMP, right, kSmiTagSize);
       __ sllv(TMP, left, TMP);
@@ -2903,7 +2949,7 @@
 class CheckedSmiSlowPath : public SlowPathCode {
  public:
   CheckedSmiSlowPath(CheckedSmiOpInstr* instruction, intptr_t try_index)
-      : instruction_(instruction), try_index_(try_index) { }
+      : instruction_(instruction), try_index_(try_index) {}
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     if (Assembler::EmittingComments()) {
@@ -2918,12 +2964,9 @@
     __ Push(locs->in(0).reg());
     __ Push(locs->in(1).reg());
     compiler->EmitMegamorphicInstanceCall(
-        *instruction_->call()->ic_data(),
-        instruction_->call()->ArgumentCount(),
-        instruction_->call()->deopt_id(),
-        instruction_->call()->token_pos(),
-        locs,
-        try_index_,
+        *instruction_->call()->ic_data(), instruction_->call()->ArgumentCount(),
+        instruction_->call()->deopt_id(), instruction_->call()->token_pos(),
+        locs, try_index_,
         /* slow_path_argument_count = */ 2);
     __ mov(result, V0);
     compiler->RestoreLiveRegisters(locs);
@@ -2940,7 +2983,7 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
+  LocationSummary* summary = new (zone) LocationSummary(
       zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
@@ -3001,24 +3044,26 @@
     case Token::kBIT_XOR:
       __ xor_(result, left, right);
       break;
-    case Token::kEQ:
-    case Token::kLT:
-    case Token::kLTE:
-    case Token::kGT:
-    case Token::kGTE: {
-      Label true_label, false_label, done;
-      BranchLabels labels = { &true_label, &false_label, &false_label };
-      Condition true_condition =
-          EmitSmiComparisonOp(compiler, *locs(), op_kind());
-      EmitBranchOnCondition(compiler, true_condition, labels);
-      __ Bind(&false_label);
-      __ LoadObject(result, Bool::False());
-      __ b(&done);
-      __ Bind(&true_label);
-      __ LoadObject(result, Bool::True());
-      __ Bind(&done);
+    case Token::kSHL:
+      ASSERT(result != left);
+      ASSERT(result != right);
+      __ BranchUnsignedGreater(right, Immediate(Smi::RawValue(Smi::kBits)),
+                               slow_path->entry_label());
+      // Check for overflow by shifting left and shifting back arithmetically.
+      // If the result is different from the original, there was overflow.
+      __ delay_slot()->SmiUntag(TMP, right);
+      __ sllv(result, left, TMP);
+      __ srav(CMPRES1, result, TMP);
+      __ bne(CMPRES1, left, slow_path->entry_label());
       break;
-    }
+    case Token::kSHR:
+      __ BranchUnsignedGreater(right, Immediate(Smi::RawValue(Smi::kBits)),
+                               slow_path->entry_label());
+      __ delay_slot()->SmiUntag(result, right);
+      __ SmiUntag(TMP, left);
+      __ srav(result, TMP, result);
+      __ SmiTag(result);
+      break;
     default:
       UNIMPLEMENTED();
   }
@@ -3026,17 +3071,143 @@
 }
 
 
+class CheckedSmiComparisonSlowPath : public SlowPathCode {
+ public:
+  CheckedSmiComparisonSlowPath(CheckedSmiComparisonInstr* instruction,
+                               intptr_t try_index,
+                               BranchLabels labels,
+                               bool merged)
+      : instruction_(instruction),
+        try_index_(try_index),
+        labels_(labels),
+        merged_(merged) {}
+
+  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
+    if (Assembler::EmittingComments()) {
+      __ Comment("slow path smi operation");
+    }
+    __ Bind(entry_label());
+    LocationSummary* locs = instruction_->locs();
+    Register result = merged_ ? locs->temp(0).reg() : locs->out(0).reg();
+    locs->live_registers()->Remove(Location::RegisterLocation(result));
+
+    compiler->SaveLiveRegisters(locs);
+    __ Push(locs->in(0).reg());
+    __ Push(locs->in(1).reg());
+    compiler->EmitMegamorphicInstanceCall(
+        *instruction_->call()->ic_data(), instruction_->call()->ArgumentCount(),
+        instruction_->call()->deopt_id(), instruction_->call()->token_pos(),
+        locs, try_index_,
+        /* slow_path_argument_count = */ 2);
+    __ mov(result, V0);
+    compiler->RestoreLiveRegisters(locs);
+    if (merged_) {
+      __ BranchEqual(result, Bool::True(), instruction_->is_negated()
+                                               ? labels_.false_label
+                                               : labels_.true_label);
+      __ b(instruction_->is_negated() ? labels_.true_label
+                                      : labels_.false_label);
+    } else {
+      __ b(exit_label());
+    }
+  }
+
+ private:
+  CheckedSmiComparisonInstr* instruction_;
+  intptr_t try_index_;
+  BranchLabels labels_;
+  bool merged_;
+};
+
+
+LocationSummary* CheckedSmiComparisonInstr::MakeLocationSummary(
+    Zone* zone,
+    bool opt) const {
+  const intptr_t kNumInputs = 2;
+  const intptr_t kNumTemps = 1;
+  LocationSummary* summary = new (zone) LocationSummary(
+      zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
+  summary->set_in(0, Location::RequiresRegister());
+  summary->set_in(1, Location::RequiresRegister());
+  summary->set_temp(0, Location::RequiresRegister());
+  summary->set_out(0, Location::RequiresRegister());
+  return summary;
+}
+
+
+Condition CheckedSmiComparisonInstr::EmitComparisonCode(
+    FlowGraphCompiler* compiler,
+    BranchLabels labels) {
+  return EmitSmiComparisonOp(compiler, *locs(), kind());
+}
+
+
+#define EMIT_SMI_CHECK                                                         \
+  Register left = locs()->in(0).reg();                                         \
+  Register right = locs()->in(1).reg();                                        \
+  Register temp = locs()->temp(0).reg();                                       \
+  intptr_t left_cid = this->left()->Type()->ToCid();                           \
+  intptr_t right_cid = this->right()->Type()->ToCid();                         \
+  if (this->left()->definition() == this->right()->definition()) {             \
+    __ andi(CMPRES1, left, Immediate(kSmiTagMask));                            \
+  } else if (left_cid == kSmiCid) {                                            \
+    __ andi(CMPRES1, right, Immediate(kSmiTagMask));                           \
+  } else if (right_cid == kSmiCid) {                                           \
+    __ andi(CMPRES1, left, Immediate(kSmiTagMask));                            \
+  } else {                                                                     \
+    __ or_(temp, left, right);                                                 \
+    __ andi(CMPRES1, temp, Immediate(kSmiTagMask));                            \
+  }                                                                            \
+  __ bne(CMPRES1, ZR, slow_path->entry_label());
+
+
+void CheckedSmiComparisonInstr::EmitBranchCode(FlowGraphCompiler* compiler,
+                                               BranchInstr* branch) {
+  BranchLabels labels = compiler->CreateBranchLabels(branch);
+  CheckedSmiComparisonSlowPath* slow_path = new CheckedSmiComparisonSlowPath(
+      this, compiler->CurrentTryIndex(), labels,
+      /* merged = */ true);
+  compiler->AddSlowPathCode(slow_path);
+  EMIT_SMI_CHECK;
+  Condition true_condition = EmitComparisonCode(compiler, labels);
+  EmitBranchOnCondition(compiler, true_condition, labels);
+  __ Bind(slow_path->exit_label());
+}
+
+
+void CheckedSmiComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  Label true_label, false_label, done;
+  BranchLabels labels = {&true_label, &false_label, &false_label};
+  CheckedSmiComparisonSlowPath* slow_path = new CheckedSmiComparisonSlowPath(
+      this, compiler->CurrentTryIndex(), labels,
+      /* merged = */ false);
+  compiler->AddSlowPathCode(slow_path);
+  EMIT_SMI_CHECK;
+  Condition true_condition = EmitComparisonCode(compiler, labels);
+  EmitBranchOnCondition(compiler, true_condition, labels);
+  Register result = locs()->out(0).reg();
+  __ Bind(&false_label);
+  __ LoadObject(result, Bool::False());
+  __ b(&done);
+  __ Bind(&true_label);
+  __ LoadObject(result, Bool::True());
+  __ Bind(&done);
+  __ Bind(slow_path->exit_label());
+}
+
+
 LocationSummary* BinarySmiOpInstr::MakeLocationSummary(Zone* zone,
                                                        bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps =
-      ((op_kind() == Token::kADD) ||
-       (op_kind() == Token::kMOD) ||
+      ((op_kind() == Token::kADD) || (op_kind() == Token::kMOD) ||
        (op_kind() == Token::kTRUNCDIV) ||
        (((op_kind() == Token::kSHL) && can_overflow()) ||
-         (op_kind() == Token::kSHR))) ? 1 : 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+        (op_kind() == Token::kSHR)))
+          ? 1
+          : 0;
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   if (op_kind() == Token::kTRUNCDIV) {
     summary->set_in(0, Location::RequiresRegister());
     if (RightIsPowerOfTwoConstant()) {
@@ -3327,8 +3498,8 @@
   ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid));
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   return summary;
@@ -3336,9 +3507,9 @@
 
 
 void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  Label* deopt = compiler->AddDeoptStub(deopt_id(),
-                                        ICData::kDeoptBinaryDoubleOp,
-                                        licm_hoisted_ ? ICData::kHoisted : 0);
+  Label* deopt =
+      compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinaryDoubleOp,
+                             licm_hoisted_ ? ICData::kHoisted : 0);
   intptr_t left_cid = left()->Type()->ToCid();
   intptr_t right_cid = right()->Type()->ToCid();
   Register left = locs()->in(0).reg();
@@ -3357,11 +3528,10 @@
 }
 
 
-LocationSummary* BoxInstr::MakeLocationSummary(Zone* zone,
-                                                     bool opt) const {
+LocationSummary* BoxInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
+  LocationSummary* summary = new (zone) LocationSummary(
       zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_temp(0, Location::RequiresRegister());
@@ -3376,18 +3546,17 @@
   Register out_reg = locs()->out(0).reg();
   DRegister value = locs()->in(0).fpu_reg();
 
-  BoxAllocationSlowPath::Allocate(
-      compiler, this, compiler->double_class(), out_reg, locs()->temp(0).reg());
+  BoxAllocationSlowPath::Allocate(compiler, this, compiler->double_class(),
+                                  out_reg, locs()->temp(0).reg());
   __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag);
 }
 
 
-LocationSummary* UnboxInstr::MakeLocationSummary(Zone* zone,
-                                                       bool opt) const {
+LocationSummary* UnboxInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   if (representation() == kUnboxedMint) {
     summary->set_out(0, Location::Pair(Location::RequiresRegister(),
@@ -3405,11 +3574,9 @@
   switch (representation()) {
     case kUnboxedMint: {
       PairLocation* result = locs()->out(0).AsPairLocation();
-      __ LoadFromOffset(result->At(0).reg(),
-                        box,
+      __ LoadFromOffset(result->At(0).reg(), box,
                         ValueOffset() - kHeapObjectTag);
-      __ LoadFromOffset(result->At(1).reg(),
-                        box,
+      __ LoadFromOffset(result->At(1).reg(), box,
                         ValueOffset() - kHeapObjectTag + kWordSize);
       break;
     }
@@ -3470,8 +3637,8 @@
     EmitSmiConversion(compiler);
   } else {
     const Register box = locs()->in(0).reg();
-    Label* deopt = compiler->AddDeoptStub(GetDeoptId(),
-                                          ICData::kDeoptCheckClass);
+    Label* deopt =
+        compiler->AddDeoptStub(GetDeoptId(), ICData::kDeoptCheckClass);
     Label is_smi;
 
     if ((value()->Type()->ToNullableCid() == box_cid) &&
@@ -3503,7 +3670,7 @@
          (from_representation() == kUnboxedUint32));
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
+  LocationSummary* summary = new (zone) LocationSummary(
       zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_temp(0, Location::RequiresRegister());
@@ -3529,12 +3696,8 @@
       __ AndImmediate(CMPRES1, value, 0xC0000000);
       __ BranchEqual(CMPRES1, ZR, &done);
     }
-    BoxAllocationSlowPath::Allocate(
-        compiler,
-        this,
-        compiler->mint_class(),
-        out,
-        temp);
+    BoxAllocationSlowPath::Allocate(compiler, this, compiler->mint_class(), out,
+                                    temp);
     Register hi;
     if (from_representation() == kUnboxedInt32) {
       hi = temp;
@@ -3543,11 +3706,8 @@
       ASSERT(from_representation() == kUnboxedUint32);
       hi = ZR;
     }
-    __ StoreToOffset(value,
-                     out,
-                     Mint::value_offset() - kHeapObjectTag);
-    __ StoreToOffset(hi,
-                     out,
+    __ StoreToOffset(value, out, Mint::value_offset() - kHeapObjectTag);
+    __ StoreToOffset(hi, out,
                      Mint::value_offset() - kHeapObjectTag + kWordSize);
     __ Bind(&done);
   }
@@ -3558,12 +3718,10 @@
                                                     bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = ValueFitsSmi() ? 0 : 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone,
-      kNumInputs,
-      kNumTemps,
-      ValueFitsSmi() ? LocationSummary::kNoCall
-                     : LocationSummary::kCallOnSlowPath);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps,
+                      ValueFitsSmi() ? LocationSummary::kNoCall
+                                     : LocationSummary::kCallOnSlowPath);
   summary->set_in(0, Location::Pair(Location::RequiresRegister(),
                                     Location::RequiresRegister()));
   if (!ValueFitsSmi()) {
@@ -3597,15 +3755,10 @@
   __ beq(tmp, value_hi, &done);
 
   __ Bind(&not_smi);
-  BoxAllocationSlowPath::Allocate(
-      compiler,
-      this,
-      compiler->mint_class(),
-      out_reg,
-      tmp);
+  BoxAllocationSlowPath::Allocate(compiler, this, compiler->mint_class(),
+                                  out_reg, tmp);
   __ StoreToOffset(value_lo, out_reg, Mint::value_offset() - kHeapObjectTag);
-  __ StoreToOffset(value_hi,
-                   out_reg,
+  __ StoreToOffset(value_hi, out_reg,
                    Mint::value_offset() - kHeapObjectTag + kWordSize);
   __ Bind(&done);
 }
@@ -3617,8 +3770,8 @@
          (representation() == kUnboxedUint32));
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_out(0, Location::RequiresRegister());
   return summary;
@@ -3631,9 +3784,7 @@
                               Label* deopt) {
   __ LoadFieldFromOffset(result, mint, Mint::value_offset());
   if (deopt != NULL) {
-    __ LoadFieldFromOffset(CMPRES1,
-                           mint,
-                           Mint::value_offset() + kWordSize);
+    __ LoadFieldFromOffset(CMPRES1, mint, Mint::value_offset() + kWordSize);
     __ sra(CMPRES2, result, kBitsPerWord - 1);
     __ BranchNotEqual(CMPRES1, CMPRES2, deopt);
   }
@@ -3644,8 +3795,10 @@
   const intptr_t value_cid = value()->Type()->ToCid();
   const Register value = locs()->in(0).reg();
   const Register out = locs()->out(0).reg();
-  Label* deopt = CanDeoptimize() ?
-        compiler->AddDeoptStub(GetDeoptId(), ICData::kDeoptUnboxInteger) : NULL;
+  Label* deopt =
+      CanDeoptimize()
+          ? compiler->AddDeoptStub(GetDeoptId(), ICData::kDeoptUnboxInteger)
+          : NULL;
   Label* out_of_range = !is_truncating() ? deopt : NULL;
   ASSERT(value != out);
 
@@ -3677,8 +3830,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
@@ -3691,15 +3844,109 @@
   DRegister right = locs()->in(1).fpu_reg();
   DRegister result = locs()->out(0).fpu_reg();
   switch (op_kind()) {
-    case Token::kADD: __ addd(result, left, right); break;
-    case Token::kSUB: __ subd(result, left, right); break;
-    case Token::kMUL: __ muld(result, left, right); break;
-    case Token::kDIV: __ divd(result, left, right); break;
-    default: UNREACHABLE();
+    case Token::kADD:
+      __ addd(result, left, right);
+      break;
+    case Token::kSUB:
+      __ subd(result, left, right);
+      break;
+    case Token::kMUL:
+      __ muld(result, left, right);
+      break;
+    case Token::kDIV:
+      __ divd(result, left, right);
+      break;
+    default:
+      UNREACHABLE();
   }
 }
 
 
+LocationSummary* DoubleTestOpInstr::MakeLocationSummary(Zone* zone,
+                                                        bool opt) const {
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresFpuRegister());
+  summary->set_out(0, Location::RequiresRegister());
+  return summary;
+}
+
+
+Condition DoubleTestOpInstr::EmitComparisonCode(FlowGraphCompiler* compiler,
+                                                BranchLabels labels) {
+  const DRegister value = locs()->in(0).fpu_reg();
+  const bool is_negated = kind() != Token::kEQ;
+  if (op_kind() == MethodRecognizer::kDouble_getIsNaN) {
+    __ cund(value, value);
+    if (labels.fall_through == labels.true_label) {
+      if (is_negated) {
+        __ bc1t(labels.false_label);
+      } else {
+        __ bc1f(labels.false_label);
+      }
+    } else if (labels.fall_through == labels.false_label) {
+      if (is_negated) {
+        __ bc1f(labels.true_label);
+      } else {
+        __ bc1t(labels.true_label);
+      }
+    } else {
+      if (is_negated) {
+        __ bc1t(labels.false_label);
+      } else {
+        __ bc1f(labels.false_label);
+      }
+      __ b(labels.true_label);
+    }
+    return Condition();  // Unused.
+  } else {
+    ASSERT(op_kind() == MethodRecognizer::kDouble_getIsInfinite);
+    __ mfc1(CMPRES1, EvenFRegisterOf(value));
+    // If the low word isn't zero, then it isn't infinity.
+    __ bne(CMPRES1, ZR, is_negated ? labels.true_label : labels.false_label);
+    __ mfc1(CMPRES1, OddFRegisterOf(value));
+    // Mask off the sign bit.
+    __ AndImmediate(CMPRES1, CMPRES1, 0x7FFFFFFF);
+    // Compare with +infinity.
+    __ LoadImmediate(CMPRES2, 0x7FF00000);
+    return Condition(CMPRES1, CMPRES2, is_negated ? NE : EQ);
+  }
+}
+
+void DoubleTestOpInstr::EmitBranchCode(FlowGraphCompiler* compiler,
+                                       BranchInstr* branch) {
+  ASSERT(compiler->is_optimizing());
+  BranchLabels labels = compiler->CreateBranchLabels(branch);
+  Condition true_condition = EmitComparisonCode(compiler, labels);
+  // Branches for isNaN are emitted in EmitComparisonCode already.
+  if (op_kind() == MethodRecognizer::kDouble_getIsInfinite) {
+    EmitBranchOnCondition(compiler, true_condition, labels);
+  }
+}
+
+
+void DoubleTestOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  Label is_true, is_false;
+  BranchLabels labels = {&is_true, &is_false, &is_false};
+  Condition true_condition = EmitComparisonCode(compiler, labels);
+  // Branches for isNaN are emitted in EmitComparisonCode already.
+  if (op_kind() == MethodRecognizer::kDouble_getIsInfinite) {
+    EmitBranchOnCondition(compiler, true_condition, labels);
+  }
+  const Register result = locs()->out(0).reg();
+  Label done;
+  __ Comment("return bool");
+  __ Bind(&is_false);
+  __ LoadObject(result, Bool::False());
+  __ b(&done);
+  __ Bind(&is_true);
+  __ LoadObject(result, Bool::True());
+  __ Bind(&done);
+}
+
+
 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Zone* zone,
                                                              bool opt) const {
   UNIMPLEMENTED();
@@ -3736,7 +3983,6 @@
 }
 
 
-
 LocationSummary* Simd32x4ShuffleMixInstr::MakeLocationSummary(Zone* zone,
                                                               bool opt) const {
   UNIMPLEMENTED();
@@ -3750,7 +3996,8 @@
 
 
 LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   UNIMPLEMENTED();
   return NULL;
 }
@@ -3889,7 +4136,7 @@
 
 
 void Simd64x2ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-    UNIMPLEMENTED();
+  UNIMPLEMENTED();
 }
 
 
@@ -3918,7 +4165,8 @@
 
 
 LocationSummary* Float64x2ConstructorInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   UNIMPLEMENTED();
   return NULL;
 }
@@ -3930,7 +4178,8 @@
 
 
 LocationSummary* Float64x2ToFloat32x4Instr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   UNIMPLEMENTED();
   return NULL;
 }
@@ -3942,7 +4191,8 @@
 
 
 LocationSummary* Float32x4ToFloat64x2Instr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   UNIMPLEMENTED();
   return NULL;
 }
@@ -3977,8 +4227,8 @@
 }
 
 
-LocationSummary* Int32x4ConstructorInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+LocationSummary* Int32x4ConstructorInstr::MakeLocationSummary(Zone* zone,
+                                                              bool opt) const {
   UNIMPLEMENTED();
   return NULL;
 }
@@ -3990,7 +4240,8 @@
 
 
 LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   UNIMPLEMENTED();
   return NULL;
 }
@@ -4079,8 +4330,8 @@
          (kind() == MathUnaryInstr::kDoubleSquare));
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
@@ -4101,10 +4352,11 @@
 
 
 LocationSummary* CaseInsensitiveCompareUC16Instr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, InputCount(), kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, InputCount(), kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(A0));
   summary->set_in(1, Location::RegisterLocation(A1));
   summary->set_in(2, Location::RegisterLocation(A2));
@@ -4116,7 +4368,6 @@
 
 void CaseInsensitiveCompareUC16Instr::EmitNativeCode(
     FlowGraphCompiler* compiler) {
-
   // Call the function.
   __ CallRuntime(TargetFunction(), TargetFunction().argument_count());
 }
@@ -4127,8 +4378,8 @@
   if (result_cid() == kDoubleCid) {
     const intptr_t kNumInputs = 2;
     const intptr_t kNumTemps = 1;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresFpuRegister());
     summary->set_in(1, Location::RequiresFpuRegister());
     // Reuse the left register so that code can be made shorter.
@@ -4139,8 +4390,8 @@
   ASSERT(result_cid() == kSmiCid);
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   // Reuse the left register so that code can be made shorter.
@@ -4218,8 +4469,8 @@
                                                       bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   // We make use of 3-operand instructions by not requiring result register
   // to be identical to first input register as on Intel.
@@ -4252,8 +4503,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
@@ -4268,11 +4519,11 @@
 
 
 LocationSummary* Int32ToDoubleInstr::MakeLocationSummary(Zone* zone,
-                                                       bool opt) const {
+                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::RequiresRegister());
   result->set_out(0, Location::RequiresFpuRegister());
   return result;
@@ -4291,8 +4542,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::RequiresRegister());
   result->set_out(0, Location::RequiresFpuRegister());
   return result;
@@ -4324,8 +4575,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   result->set_in(0, Location::RegisterLocation(T1));
   result->set_out(0, Location::RegisterLocation(V0));
   return result;
@@ -4357,13 +4608,10 @@
   const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0));
 
   const intptr_t kNumberOfArguments = 1;
-  compiler->GenerateStaticCall(deopt_id(),
-                               instance_call()->token_pos(),
-                               target,
+  compiler->GenerateStaticCall(deopt_id(), instance_call()->token_pos(), target,
                                kNumberOfArguments,
                                Object::null_array(),  // No argument names.
-                               locs(),
-                               ICData::Handle());
+                               locs(), ICData::Handle());
   __ Bind(&done);
 }
 
@@ -4372,8 +4620,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::RequiresFpuRegister());
   result->set_out(0, Location::RequiresRegister());
   return result;
@@ -4411,8 +4659,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::RequiresFpuRegister());
   result->set_out(0, Location::SameAsFirstInput());
   return result;
@@ -4430,8 +4678,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::RequiresFpuRegister());
   result->set_out(0, Location::SameAsFirstInput());
   return result;
@@ -4451,8 +4699,8 @@
   // double arguments.
   ASSERT((InputCount() == 1) || (InputCount() == 2));
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, InputCount(), kNumTemps, LocationSummary::kCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, InputCount(), kNumTemps, LocationSummary::kCall);
   result->set_in(0, Location::FpuRegisterLocation(D6));
   if (InputCount() == 2) {
     result->set_in(1, Location::FpuRegisterLocation(D7));
@@ -4543,15 +4791,15 @@
 
   __ Bind(&try_sqrt);
   // Before calling pow, check if we could use sqrt instead of pow.
-  __ LoadImmediate(result, kPosInfinity);
+  __ LoadImmediate(result, kNegInfinity);
   // base == -Infinity -> call pow;
   __ ceqd(base, result);
   Label do_pow;
-  __ b(&do_pow);
+  __ bc1t(&do_pow);
 
   // exponent == 0.5 ?
   __ LoadImmediate(result, 0.5);
-  __ ceqd(base, result);
+  __ ceqd(exp, result);
   __ bc1f(&do_pow);
 
   // base == 0 -> return 0;
@@ -4591,27 +4839,27 @@
   // Only use this instruction in optimized code.
   ASSERT(opt);
   const intptr_t kNumInputs = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, 0, LocationSummary::kNoCall);
+  LocationSummary* summary =
+      new (zone) LocationSummary(zone, kNumInputs, 0, LocationSummary::kNoCall);
   if (representation() == kUnboxedDouble) {
     if (index() == 0) {
-      summary->set_in(0, Location::Pair(Location::RequiresFpuRegister(),
-                                        Location::Any()));
+      summary->set_in(
+          0, Location::Pair(Location::RequiresFpuRegister(), Location::Any()));
     } else {
       ASSERT(index() == 1);
-      summary->set_in(0, Location::Pair(Location::Any(),
-                                        Location::RequiresFpuRegister()));
+      summary->set_in(
+          0, Location::Pair(Location::Any(), Location::RequiresFpuRegister()));
     }
     summary->set_out(0, Location::RequiresFpuRegister());
   } else {
     ASSERT(representation() == kTagged);
     if (index() == 0) {
-      summary->set_in(0, Location::Pair(Location::RequiresRegister(),
-                                        Location::Any()));
+      summary->set_in(
+          0, Location::Pair(Location::RequiresRegister(), Location::Any()));
     } else {
       ASSERT(index() == 1);
-      summary->set_in(0, Location::Pair(Location::Any(),
-                                        Location::RequiresRegister()));
+      summary->set_in(
+          0, Location::Pair(Location::Any(), Location::RequiresRegister()));
     }
     summary->set_out(0, Location::RequiresRegister());
   }
@@ -4641,8 +4889,8 @@
   if (kind() == MergedMathInstr::kTruncDivMod) {
     const intptr_t kNumInputs = 2;
     const intptr_t kNumTemps = 1;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresRegister());
     summary->set_in(1, Location::RequiresRegister());
     summary->set_temp(0, Location::RequiresRegister());
@@ -4717,13 +4965,13 @@
 
 
 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   return MakeCallSummary(zone);
 }
 
 
-LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone,
-                                                  bool opt) const {
+LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   comparison()->InitializeLocationSummary(zone, opt);
   // Branches don't produce a result.
   comparison()->locs()->set_out(0, Location::NoLocation());
@@ -4742,8 +4990,8 @@
   const intptr_t kNumInputs = 1;
   const bool need_mask_temp = IsDenseSwitch() && !IsDenseMask(ComputeCidMask());
   const intptr_t kNumTemps = !IsNullCheck() ? (need_mask_temp ? 2 : 1) : 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   if (!IsNullCheck()) {
     summary->set_temp(0, Location::RequiresRegister());
@@ -4756,8 +5004,7 @@
 
 
 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  Label* deopt = compiler->AddDeoptStub(deopt_id(),
-                                        ICData::kDeoptCheckClass,
+  Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass,
                                         licm_hoisted_ ? ICData::kHoisted : 0);
   if (IsNullCheck()) {
     if (DeoptIfNull()) {
@@ -4802,8 +5049,7 @@
     }
   } else {
     GrowableArray<CidTarget> sorted_ic_data;
-    FlowGraphCompiler::SortICDataByCount(unary_checks(),
-                                         &sorted_ic_data,
+    FlowGraphCompiler::SortICDataByCount(unary_checks(), &sorted_ic_data,
                                          /* drop_smi = */ true);
     const intptr_t num_checks = sorted_ic_data.length();
     for (intptr_t i = 0; i < num_checks; i++) {
@@ -4826,8 +5072,8 @@
                                                     bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   return summary;
 }
@@ -4836,8 +5082,7 @@
 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   __ Comment("CheckSmiInstr");
   Register value = locs()->in(0).reg();
-  Label* deopt = compiler->AddDeoptStub(deopt_id(),
-                                        ICData::kDeoptCheckSmi,
+  Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckSmi,
                                         licm_hoisted_ ? ICData::kHoisted : 0);
   __ BranchIfNotSmi(value, deopt);
 }
@@ -4847,8 +5092,8 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   return summary;
 }
@@ -4865,7 +5110,7 @@
                                                              bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
+  LocationSummary* locs = new (zone) LocationSummary(
       zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   locs->set_in(kLengthPos, Location::RequiresRegister());
   locs->set_in(kIndexPos, Location::RequiresRegister());
@@ -4876,7 +5121,7 @@
 class RangeErrorSlowPath : public SlowPathCode {
  public:
   RangeErrorSlowPath(GenericCheckBoundInstr* instruction, intptr_t try_index)
-      : instruction_(instruction), try_index_(try_index) { }
+      : instruction_(instruction), try_index_(try_index) {}
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     if (Assembler::EmittingComments()) {
@@ -4888,11 +5133,8 @@
     __ Push(locs->in(1).reg());
     __ CallRuntime(kRangeErrorRuntimeEntry, 2);
     compiler->pc_descriptors_list()->AddDescriptor(
-        RawPcDescriptors::kOther,
-        compiler->assembler()->CodeSize(),
-        instruction_->deopt_id(),
-        instruction_->token_pos(),
-        try_index_);
+        RawPcDescriptors::kOther, compiler->assembler()->CodeSize(),
+        instruction_->deopt_id(), instruction_->token_pos(), try_index_);
     __ break_(0);
   }
 
@@ -4923,8 +5165,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length()));
   locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index()));
   return locs;
@@ -4934,10 +5176,8 @@
 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   uint32_t flags = generalized_ ? ICData::kGeneralized : 0;
   flags |= licm_hoisted_ ? ICData::kHoisted : 0;
-  Label* deopt = compiler->AddDeoptStub(
-      deopt_id(),
-      ICData::kDeoptCheckArrayBound,
-      flags);
+  Label* deopt =
+      compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckArrayBound, flags);
 
   Location length_loc = locs()->in(kLengthPos);
   Location index_loc = locs()->in(kIndexPos);
@@ -4984,8 +5224,8 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::Pair(Location::RequiresRegister(),
                                     Location::RequiresRegister()));
   summary->set_in(1, Location::Pair(Location::RequiresRegister(),
@@ -5023,9 +5263,9 @@
       break;
     }
     case Token::kBIT_XOR: {
-     __ xor_(out_lo, left_lo, right_lo);
-     __ xor_(out_hi, left_hi, right_hi);
-     break;
+      __ xor_(out_lo, left_lo, right_lo);
+      __ xor_(out_hi, left_hi, right_hi);
+      break;
     }
     case Token::kADD:
     case Token::kSUB: {
@@ -5078,8 +5318,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::Pair(Location::RequiresRegister(),
                                     Location::RequiresRegister()));
   summary->set_in(1, Location::WritableRegisterOrSmiConstant(right()));
@@ -5092,8 +5332,8 @@
 static const intptr_t kMintShiftCountLimit = 63;
 
 bool ShiftMintOpInstr::has_shift_count_check() const {
-  return !RangeUtils::IsWithin(
-      right()->definition()->range(), 0, kMintShiftCountLimit);
+  return !RangeUtils::IsWithin(right()->definition()->range(), 0,
+                               kMintShiftCountLimit);
 }
 
 
@@ -5180,7 +5420,7 @@
 
     // Deopt if shift is larger than 63 or less than 0.
     if (has_shift_count_check()) {
-      __ sltiu(CMPRES1, shift, Immediate(2*(kMintShiftCountLimit + 1)));
+      __ sltiu(CMPRES1, shift, Immediate(2 * (kMintShiftCountLimit + 1)));
       __ beq(CMPRES1, ZR, deopt);
       // Untag shift count.
       __ delay_slot()->SmiUntag(shift);
@@ -5264,8 +5504,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::Pair(Location::RequiresRegister(),
                                     Location::RequiresRegister()));
   summary->set_out(0, Location::Pair(Location::RequiresRegister(),
@@ -5308,8 +5548,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   summary->set_out(0, Location::RequiresRegister());
@@ -5352,8 +5592,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RegisterOrSmiConstant(right()));
   summary->set_temp(0, Location::RequiresRegister());
@@ -5421,8 +5661,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_out(0, Location::RequiresRegister());
   return summary;
@@ -5447,8 +5687,8 @@
                                                                bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   if (from() == kUnboxedMint) {
     ASSERT((to() == kUnboxedUint32) || (to() == kUnboxedInt32));
     summary->set_in(0, Location::Pair(Location::RequiresRegister(),
@@ -5518,43 +5758,33 @@
 }
 
 
-LocationSummary* ThrowInstr::MakeLocationSummary(Zone* zone,
-                                                 bool opt) const {
-  return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
+LocationSummary* ThrowInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+  return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
 }
 
 
-
 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kThrowRuntimeEntry,
-                                1,
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(), kThrowRuntimeEntry, 1,
                                 locs());
   __ break_(0);
 }
 
 
-LocationSummary* ReThrowInstr::MakeLocationSummary(Zone* zone,
-                                                   bool opt) const {
-  return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
+LocationSummary* ReThrowInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+  return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
 }
 
 
 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   compiler->SetNeedsStacktrace(catch_try_index());
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kReThrowRuntimeEntry,
-                                2,
-                                locs());
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(), kReThrowRuntimeEntry,
+                                2, locs());
   __ break_(0);
 }
 
 
-LocationSummary* StopInstr::MakeLocationSummary(Zone* zone,
-                                                bool opt) const {
-  return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
+LocationSummary* StopInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+  return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
 }
 
 
@@ -5570,9 +5800,8 @@
 }
 
 
-LocationSummary* GotoInstr::MakeLocationSummary(Zone* zone,
-                                                bool opt) const {
-  return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
+LocationSummary* GotoInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+  return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
 }
 
 
@@ -5584,8 +5813,7 @@
     }
     // Add a deoptimization descriptor for deoptimizing instructions that
     // may be inserted before this instruction.
-    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                                   GetDeoptId(),
+    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, GetDeoptId(),
                                    TokenPosition::kNoSource);
   }
   if (HasParallelMove()) {
@@ -5605,8 +5833,8 @@
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
 
-  LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
 
   summary->set_in(0, Location::RequiresRegister());
   summary->set_temp(0, Location::RequiresRegister());
@@ -5619,14 +5847,13 @@
   Register target_reg = locs()->temp_slot(0)->reg();
 
   __ GetNextPC(target_reg, TMP);
-  const intptr_t entry_offset =
-     __ CodeSize() - 1 * Instr::kInstrSize;
+  const intptr_t entry_offset = __ CodeSize() - 1 * Instr::kInstrSize;
   __ AddImmediate(target_reg, target_reg, -entry_offset);
 
   // Add the offset.
   Register offset_reg = locs()->in(0).reg();
   if (offset()->definition()->representation() == kTagged) {
-  __ SmiUntag(offset_reg);
+    __ SmiUntag(offset_reg);
   }
   __ addu(target_reg, target_reg, offset_reg);
 
@@ -5640,15 +5867,15 @@
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
   if (needs_number_check()) {
-    LocationSummary* locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+    LocationSummary* locs = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
     locs->set_in(0, Location::RegisterLocation(A0));
     locs->set_in(1, Location::RegisterLocation(A1));
     locs->set_out(0, Location::RegisterLocation(A0));
     return locs;
   }
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RegisterOrConstant(left()));
   // Only one of the inputs can be a constant. Choose register if the first one
   // is a constant.
@@ -5667,20 +5894,14 @@
   ASSERT(!left.IsConstant() || !right.IsConstant());
   Condition true_condition;
   if (left.IsConstant()) {
-    true_condition = compiler->EmitEqualityRegConstCompare(right.reg(),
-                                                           left.constant(),
-                                                           needs_number_check(),
-                                                           token_pos());
+    true_condition = compiler->EmitEqualityRegConstCompare(
+        right.reg(), left.constant(), needs_number_check(), token_pos());
   } else if (right.IsConstant()) {
-    true_condition = compiler->EmitEqualityRegConstCompare(left.reg(),
-                                                           right.constant(),
-                                                           needs_number_check(),
-                                                           token_pos());
+    true_condition = compiler->EmitEqualityRegConstCompare(
+        left.reg(), right.constant(), needs_number_check(), token_pos());
   } else {
-    true_condition = compiler->EmitEqualityRegRegCompare(left.reg(),
-                                                         right.reg(),
-                                                         needs_number_check(),
-                                                         token_pos());
+    true_condition = compiler->EmitEqualityRegRegCompare(
+        left.reg(), right.reg(), needs_number_check(), token_pos());
   }
   if (kind() != Token::kEQ_STRICT) {
     ASSERT(kind() == Token::kNE_STRICT);
@@ -5695,7 +5916,7 @@
   ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT);
 
   Label is_true, is_false;
-  BranchLabels labels = { &is_true, &is_false, &is_false };
+  BranchLabels labels = {&is_true, &is_false, &is_false};
   Condition true_condition = EmitComparisonCode(compiler, labels);
   EmitBranchOnCondition(compiler, true_condition, labels);
 
@@ -5723,9 +5944,7 @@
 
 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Zone* zone,
                                                          bool opt) const {
-  return LocationSummary::Make(zone,
-                               1,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, 1, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -5752,9 +5971,7 @@
   const Code& stub = Code::ZoneHandle(
       compiler->zone(), StubCode::GetAllocationStubForClass(cls()));
   const StubEntry stub_entry(stub);
-  compiler->GenerateCall(token_pos(),
-                         stub_entry,
-                         RawPcDescriptors::kOther,
+  compiler->GenerateCall(token_pos(), stub_entry, RawPcDescriptors::kOther,
                          locs());
   compiler->AddStubCallTarget(stub);
   __ Drop(ArgumentCount());  // Discard arguments.
@@ -5763,17 +5980,18 @@
 
 void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   ASSERT(!compiler->is_optimizing());
-  compiler->GenerateCall(
-      token_pos(), *StubCode::DebugStepCheck_entry(), stub_kind_, locs());
+  __ BranchLinkPatchable(*StubCode::DebugStepCheck_entry());
+  compiler->AddCurrentDescriptor(stub_kind_, Thread::kNoDeoptId, token_pos());
+  compiler->RecordSafepoint(locs());
 }
 
 
-LocationSummary* GrowRegExpStackInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+LocationSummary* GrowRegExpStackInstr::MakeLocationSummary(Zone* zone,
+                                                           bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(T0));
   locs->set_out(0, Location::RegisterLocation(T0));
   return locs;
@@ -5788,11 +6006,8 @@
   __ LoadObject(TMP, Object::null_object());
   __ sw(TMP, Address(SP, 1 * kWordSize));
   __ sw(typed_data, Address(SP, 0 * kWordSize));
-  compiler->GenerateRuntimeCall(TokenPosition::kNoSource,
-                                deopt_id(),
-                                kGrowRegExpStackRuntimeEntry,
-                                1,
-                                locs());
+  compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(),
+                                kGrowRegExpStackRuntimeEntry, 1, locs());
   __ lw(result, Address(SP, 1 * kWordSize));
   __ addiu(SP, SP, Immediate(2 * kWordSize));
 }
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index b8a57bb..097df6e 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -28,8 +28,8 @@
 // Generic summary for call instructions that have all arguments pushed
 // on the stack and return the result in a fixed register RAX.
 LocationSummary* Instruction::MakeCallSummary(Zone* zone) {
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, 0, 0, LocationSummary::kCall);
+  LocationSummary* result =
+      new (zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
   result->set_out(0, Location::RegisterLocation(RAX));
   return result;
 }
@@ -39,8 +39,8 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::AnyOrConstant(value()));
   return locs;
 }
@@ -63,12 +63,11 @@
 }
 
 
-LocationSummary* ReturnInstr::MakeLocationSummary(Zone* zone,
-                                                  bool opt) const {
+LocationSummary* ReturnInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RegisterLocation(RAX));
   return locs;
 }
@@ -111,16 +110,30 @@
 
 static Condition NegateCondition(Condition condition) {
   switch (condition) {
-    case EQUAL:         return NOT_EQUAL;
-    case NOT_EQUAL:     return EQUAL;
-    case LESS:          return GREATER_EQUAL;
-    case LESS_EQUAL:    return GREATER;
-    case GREATER:       return LESS_EQUAL;
-    case GREATER_EQUAL: return LESS;
-    case BELOW:         return ABOVE_EQUAL;
-    case BELOW_EQUAL:   return ABOVE;
-    case ABOVE:         return BELOW_EQUAL;
-    case ABOVE_EQUAL:   return BELOW;
+    case EQUAL:
+      return NOT_EQUAL;
+    case NOT_EQUAL:
+      return EQUAL;
+    case LESS:
+      return GREATER_EQUAL;
+    case LESS_EQUAL:
+      return GREATER;
+    case GREATER:
+      return LESS_EQUAL;
+    case GREATER_EQUAL:
+      return LESS;
+    case BELOW:
+      return ABOVE_EQUAL;
+    case BELOW_EQUAL:
+      return ABOVE;
+    case ABOVE:
+      return BELOW_EQUAL;
+    case ABOVE_EQUAL:
+      return BELOW;
+    case PARITY_EVEN:
+      return PARITY_ODD;
+    case PARITY_ODD:
+      return PARITY_EVEN;
     default:
       UNIMPLEMENTED();
       return EQUAL;
@@ -152,7 +165,7 @@
   __ xorq(RDX, RDX);
 
   // Emit comparison code. This must not overwrite the result register.
-  BranchLabels labels = { NULL, NULL, NULL };
+  BranchLabels labels = {NULL, NULL, NULL};
   Condition true_condition = comparison()->EmitComparisonCode(compiler, labels);
 
   const bool is_power_of_two_kind = IsPowerOfTwoKind(if_true_, if_false_);
@@ -184,8 +197,8 @@
     __ shlq(RDX, Immediate(shift + kSmiTagSize));
   } else {
     __ decq(RDX);
-    __ AndImmediate(RDX,
-        Immediate(Smi::RawValue(true_value) - Smi::RawValue(false_value)));
+    __ AndImmediate(
+        RDX, Immediate(Smi::RawValue(true_value) - Smi::RawValue(false_value)));
     if (false_value != 0) {
       __ AddImmediate(RDX, Immediate(Smi::RawValue(false_value)));
     }
@@ -197,10 +210,9 @@
                                                      bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t stack_index = (local().index() < 0)
-      ? kFirstLocalSlotFromFp - local().index()
-      : kParamEndSlotFromFp - local().index();
-  return LocationSummary::Make(zone,
-                               kNumInputs,
+                                   ? kFirstLocalSlotFromFp - local().index()
+                                   : kParamEndSlotFromFp - local().index();
+  return LocationSummary::Make(zone, kNumInputs,
                                Location::StackSlot(stack_index),
                                LocationSummary::kNoCall);
 }
@@ -215,9 +227,7 @@
 LocationSummary* StoreLocalInstr::MakeLocationSummary(Zone* zone,
                                                       bool opt) const {
   const intptr_t kNumInputs = 1;
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::SameAsFirstInput(),
+  return LocationSummary::Make(zone, kNumInputs, Location::SameAsFirstInput(),
                                LocationSummary::kNoCall);
 }
 
@@ -233,8 +243,7 @@
 LocationSummary* ConstantInstr::MakeLocationSummary(Zone* zone,
                                                     bool opt) const {
   const intptr_t kNumInputs = 0;
-  return LocationSummary::Make(zone,
-                               kNumInputs,
+  return LocationSummary::Make(zone, kNumInputs,
                                Assembler::IsSafe(value())
                                    ? Location::Constant(this)
                                    : Location::RequiresRegister(),
@@ -257,8 +266,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   switch (representation()) {
     case kUnboxedDouble:
       locs->set_out(0, Location::RequiresFpuRegister());
@@ -303,8 +312,8 @@
                                                             bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(RAX));  // Value.
   summary->set_in(1, Location::RegisterLocation(RDX));  // Type arguments.
   summary->set_out(0, Location::RegisterLocation(RAX));
@@ -316,8 +325,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(RAX));
   locs->set_out(0, Location::RegisterLocation(RAX));
   return locs;
@@ -346,11 +355,8 @@
   }
 
   __ pushq(reg);  // Push the source object.
-  compiler->GenerateRuntimeCall(token_pos,
-                                deopt_id,
-                                kNonBoolTypeErrorRuntimeEntry,
-                                1,
-                                locs);
+  compiler->GenerateRuntimeCall(token_pos, deopt_id,
+                                kNonBoolTypeErrorRuntimeEntry, 1, locs);
   // We should never return here.
   __ int3();
   __ Bind(&done);
@@ -368,12 +374,18 @@
 
 static Condition TokenKindToIntCondition(Token::Kind kind) {
   switch (kind) {
-    case Token::kEQ: return EQUAL;
-    case Token::kNE: return NOT_EQUAL;
-    case Token::kLT: return LESS;
-    case Token::kGT: return GREATER;
-    case Token::kLTE: return LESS_EQUAL;
-    case Token::kGTE: return GREATER_EQUAL;
+    case Token::kEQ:
+      return EQUAL;
+    case Token::kNE:
+      return NOT_EQUAL;
+    case Token::kLT:
+      return LESS;
+    case Token::kGT:
+      return GREATER;
+    case Token::kLTE:
+      return LESS_EQUAL;
+    case Token::kGTE:
+      return GREATER_EQUAL;
     default:
       UNREACHABLE();
       return OVERFLOW;
@@ -386,17 +398,17 @@
   const intptr_t kNumInputs = 2;
   if (operation_cid() == kMintCid) {
     const intptr_t kNumTemps = 0;
-    LocationSummary* locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* locs = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     locs->set_in(0, Location::RequiresRegister());
     locs->set_in(1, Location::RequiresRegister());
     locs->set_out(0, Location::RequiresRegister());
     return locs;
   }
   if (operation_cid() == kDoubleCid) {
-    const intptr_t kNumTemps =  0;
-    LocationSummary* locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    const intptr_t kNumTemps = 0;
+    LocationSummary* locs = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     locs->set_in(0, Location::RequiresFpuRegister());
     locs->set_in(1, Location::RequiresFpuRegister());
     locs->set_out(0, Location::RequiresRegister());
@@ -404,8 +416,8 @@
   }
   if (operation_cid() == kSmiCid) {
     const intptr_t kNumTemps = 0;
-    LocationSummary* locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* locs = new (zone)
+        LocationSummary(zone, 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.
@@ -442,16 +454,26 @@
 
 static Condition FlipCondition(Condition condition) {
   switch (condition) {
-    case EQUAL:         return EQUAL;
-    case NOT_EQUAL:     return NOT_EQUAL;
-    case LESS:          return GREATER;
-    case LESS_EQUAL:    return GREATER_EQUAL;
-    case GREATER:       return LESS;
-    case GREATER_EQUAL: return LESS_EQUAL;
-    case BELOW:         return ABOVE;
-    case BELOW_EQUAL:   return ABOVE_EQUAL;
-    case ABOVE:         return BELOW;
-    case ABOVE_EQUAL:   return BELOW_EQUAL;
+    case EQUAL:
+      return EQUAL;
+    case NOT_EQUAL:
+      return NOT_EQUAL;
+    case LESS:
+      return GREATER;
+    case LESS_EQUAL:
+      return GREATER_EQUAL;
+    case GREATER:
+      return LESS;
+    case GREATER_EQUAL:
+      return LESS_EQUAL;
+    case BELOW:
+      return ABOVE;
+    case BELOW_EQUAL:
+      return ABOVE_EQUAL;
+    case ABOVE:
+      return BELOW;
+    case ABOVE_EQUAL:
+      return BELOW_EQUAL;
     default:
       UNIMPLEMENTED();
       return EQUAL;
@@ -503,12 +525,18 @@
 
 static Condition TokenKindToDoubleCondition(Token::Kind kind) {
   switch (kind) {
-    case Token::kEQ: return EQUAL;
-    case Token::kNE: return NOT_EQUAL;
-    case Token::kLT: return BELOW;
-    case Token::kGT: return ABOVE;
-    case Token::kLTE: return BELOW_EQUAL;
-    case Token::kGTE: return ABOVE_EQUAL;
+    case Token::kEQ:
+      return EQUAL;
+    case Token::kNE:
+      return NOT_EQUAL;
+    case Token::kLT:
+      return BELOW;
+    case Token::kGT:
+      return ABOVE;
+    case Token::kLTE:
+      return BELOW_EQUAL;
+    case Token::kGTE:
+      return ABOVE_EQUAL;
     default:
       UNREACHABLE();
       return OVERFLOW;
@@ -526,8 +554,8 @@
   __ comisd(left, right);
 
   Condition true_condition = TokenKindToDoubleCondition(kind);
-  Label* nan_result = (true_condition == NOT_EQUAL)
-      ? labels.true_label : labels.false_label;
+  Label* nan_result =
+      (true_condition == NOT_EQUAL) ? labels.true_label : labels.false_label;
   __ j(PARITY_EVEN, nan_result);
   return true_condition;
 }
@@ -548,9 +576,9 @@
   ASSERT((kind() == Token::kEQ) || (kind() == Token::kNE));
 
   Label is_true, is_false;
-  BranchLabels labels = { &is_true, &is_false, &is_false };
+  BranchLabels labels = {&is_true, &is_false, &is_false};
   Condition true_condition = EmitComparisonCode(compiler, labels);
-  EmitBranchOnCondition(compiler,  true_condition, labels);
+  EmitBranchOnCondition(compiler, true_condition, labels);
 
   Register result = locs()->out(0).reg();
   Label done;
@@ -573,12 +601,11 @@
 }
 
 
-LocationSummary* TestSmiInstr::MakeLocationSummary(Zone* zone,
-                                                   bool opt) const {
+LocationSummary* TestSmiInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RequiresRegister());
   // Only one input can be a constant operand. The case of two constant
   // operands should be handled by constant propagation.
@@ -593,8 +620,7 @@
   Location right = locs()->in(1);
   if (right.IsConstant()) {
     ASSERT(right.constant().IsSmi());
-    const int64_t imm =
-        reinterpret_cast<int64_t>(right.constant().raw());
+    const int64_t imm = reinterpret_cast<int64_t>(right.constant().raw());
     __ TestImmediate(left_reg, Immediate(imm));
   } else {
     __ testq(left_reg, right.reg());
@@ -618,13 +644,12 @@
 }
 
 
-
 LocationSummary* TestCidsInstr::MakeLocationSummary(Zone* zone,
                                                     bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RequiresRegister());
   locs->set_temp(0, Location::RequiresRegister());
   locs->set_out(0, Location::RequiresRegister());
@@ -638,11 +663,11 @@
   Register val_reg = locs()->in(0).reg();
   Register cid_reg = locs()->temp(0).reg();
 
-  Label* deopt = CanDeoptimize()
-      ? compiler->AddDeoptStub(deopt_id(),
-                               ICData::kDeoptTestCids,
-                               licm_hoisted_ ? ICData::kHoisted : 0)
-      : NULL;
+  Label* deopt =
+      CanDeoptimize()
+          ? compiler->AddDeoptStub(deopt_id(), ICData::kDeoptTestCids,
+                                   licm_hoisted_ ? ICData::kHoisted : 0)
+          : NULL;
 
   const intptr_t true_result = (kind() == Token::kIS) ? 1 : 0;
   const ZoneGrowableArray<intptr_t>& data = cid_results();
@@ -655,7 +680,7 @@
     const intptr_t test_cid = data[i];
     ASSERT(test_cid != kSmiCid);
     result = data[i + 1] == true_result;
-    __ cmpq(cid_reg,  Immediate(test_cid));
+    __ cmpq(cid_reg, Immediate(test_cid));
     __ j(EQUAL, result ? labels.true_label : labels.false_label);
   }
   // No match found, deoptimize or false.
@@ -683,7 +708,7 @@
 void TestCidsInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Register result_reg = locs()->out(0).reg();
   Label is_true, is_false, done;
-  BranchLabels labels = { &is_true, &is_false, &is_false };
+  BranchLabels labels = {&is_true, &is_false, &is_false};
   EmitComparisonCode(compiler, labels);
   __ Bind(&is_false);
   __ LoadObject(result_reg, Bool::False());
@@ -699,23 +724,23 @@
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
   if (operation_cid() == kDoubleCid) {
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresFpuRegister());
     summary->set_in(1, Location::RequiresFpuRegister());
     summary->set_out(0, Location::RequiresRegister());
     return summary;
   } else if (operation_cid() == kMintCid) {
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresRegister());
     summary->set_in(1, Location::RequiresRegister());
     summary->set_out(0, Location::RequiresRegister());
     return summary;
   }
   ASSERT(operation_cid() == kSmiCid);
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, 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.
@@ -740,7 +765,7 @@
 
 void RelationalOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Label is_true, is_false;
-  BranchLabels labels = { &is_true, &is_false, &is_false };
+  BranchLabels labels = {&is_true, &is_false, &is_false};
   Condition true_condition = EmitComparisonCode(compiler, labels);
   EmitBranchOnCondition(compiler, true_condition, labels);
 
@@ -778,8 +803,9 @@
   __ PushObject(Object::null_object());
   // Pass a pointer to the first argument in RAX.
   if (!function().HasOptionalParameters()) {
-    __ leaq(RAX, Address(RBP, (kParamEndSlotFromFp +
-                               function().NumParameters()) * kWordSize));
+    __ leaq(RAX,
+            Address(RBP, (kParamEndSlotFromFp + function().NumParameters()) *
+                             kWordSize));
   } else {
     __ leaq(RAX, Address(RBP, kFirstLocalSlotFromFp * kWordSize));
   }
@@ -789,17 +815,17 @@
     stub_entry = StubCode::CallBootstrapCFunction_entry();
     ExternalLabel label(NativeEntry::LinkNativeCallEntry());
     __ LoadNativeEntry(RBX, &label, kPatchable);
+    compiler->GeneratePatchableCall(token_pos(), *stub_entry,
+                                    RawPcDescriptors::kOther, locs());
   } else {
-    stub_entry = (is_bootstrap_native()) ?
-        StubCode::CallBootstrapCFunction_entry() :
-        StubCode::CallNativeCFunction_entry();
+    stub_entry = (is_bootstrap_native())
+                     ? StubCode::CallBootstrapCFunction_entry()
+                     : StubCode::CallNativeCFunction_entry();
     const ExternalLabel label(reinterpret_cast<uword>(native_c_function()));
     __ LoadNativeEntry(RBX, &label, kNotPatchable);
+    compiler->GenerateCall(token_pos(), *stub_entry, RawPcDescriptors::kOther,
+                           locs());
   }
-  compiler->GenerateCall(token_pos(),
-                         *stub_entry,
-                         RawPcDescriptors::kOther,
-                         locs());
   __ popq(result);
 }
 
@@ -817,12 +843,11 @@
 
 
 LocationSummary* OneByteStringFromCharCodeInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 1;
   // TODO(fschneider): Allow immediate operands for the char code.
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -834,8 +859,7 @@
   Register result = locs()->out(0).reg();
 
   __ movq(result, Address(THR, Thread::predefined_symbols_address_offset()));
-  __ movq(result, Address(result,
-                          char_code,
+  __ movq(result, Address(result, char_code,
                           TIMES_HALF_WORD_SIZE,  // Char code is a smi.
                           Symbols::kNullCharCodeSymbolOffset * kWordSize));
 }
@@ -844,9 +868,7 @@
 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Zone* zone,
                                                             bool opt) const {
   const intptr_t kNumInputs = 1;
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -872,8 +894,8 @@
                                                              bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(RAX));
   summary->set_out(0, Location::RegisterLocation(RAX));
   return summary;
@@ -885,12 +907,8 @@
   __ pushq(array);
   const int kNumberOfArguments = 1;
   const Array& kNoArgumentNames = Object::null_array();
-  compiler->GenerateStaticCall(deopt_id(),
-                               token_pos(),
-                               CallFunction(),
-                               kNumberOfArguments,
-                               kNoArgumentNames,
-                               locs(),
+  compiler->GenerateStaticCall(deopt_id(), token_pos(), CallFunction(),
+                               kNumberOfArguments, kNoArgumentNames, locs(),
                                ICData::Handle());
   ASSERT(locs()->out(0).reg() == RAX);
 }
@@ -899,9 +917,7 @@
 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Zone* zone,
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -921,9 +937,7 @@
 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Zone* zone,
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -1036,23 +1050,25 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RequiresRegister());
   // The smi index is either untagged (element size == 1), or it is left smi
   // tagged (for all element sizes > 1).
   if (index_scale() == 1) {
-    locs->set_in(1, CanBeImmediateIndex(index(), class_id())
-                      ? Location::Constant(index()->definition()->AsConstant())
-                      : Location::WritableRegister());
+    locs->set_in(1,
+                 CanBeImmediateIndex(index(), class_id())
+                     ? Location::Constant(index()->definition()->AsConstant())
+                     : Location::WritableRegister());
   } else {
-    locs->set_in(1, CanBeImmediateIndex(index(), class_id())
-                      ? Location::Constant(index()->definition()->AsConstant())
-                      : Location::RequiresRegister());
+    locs->set_in(1,
+                 CanBeImmediateIndex(index(), class_id())
+                     ? Location::Constant(index()->definition()->AsConstant())
+                     : Location::RequiresRegister());
   }
-  if ((representation() == kUnboxedDouble)    ||
+  if ((representation() == kUnboxedDouble) ||
       (representation() == kUnboxedFloat32x4) ||
-      (representation() == kUnboxedInt32x4)   ||
+      (representation() == kUnboxedInt32x4) ||
       (representation() == kUnboxedFloat64x2)) {
     locs->set_out(0, Location::RequiresFpuRegister());
   } else {
@@ -1067,16 +1083,17 @@
   const Register array = locs()->in(0).reg();
   const Location index = locs()->in(1);
 
-  Address element_address = index.IsRegister()
-      ? Assembler::ElementAddressForRegIndex(
-            IsExternal(), class_id(), index_scale(), array, index.reg())
-      : Assembler::ElementAddressForIntIndex(
-            IsExternal(), class_id(), index_scale(),
-            array, Smi::Cast(index.constant()).Value());
+  Address element_address =
+      index.IsRegister()
+          ? Assembler::ElementAddressForRegIndex(
+                IsExternal(), class_id(), index_scale(), array, index.reg())
+          : Assembler::ElementAddressForIntIndex(
+                IsExternal(), class_id(), index_scale(), array,
+                Smi::Cast(index.constant()).Value());
 
-  if ((representation() == kUnboxedDouble)    ||
+  if ((representation() == kUnboxedDouble) ||
       (representation() == kUnboxedFloat32x4) ||
-      (representation() == kUnboxedInt32x4)   ||
+      (representation() == kUnboxedInt32x4) ||
       (representation() == kUnboxedFloat64x2)) {
     if ((index_scale() == 1) && index.IsRegister()) {
       __ SmiUntag(index.reg());
@@ -1089,7 +1106,7 @@
     } else if (class_id() == kTypedDataFloat64ArrayCid) {
       __ movsd(result, element_address);
     } else {
-      ASSERT((class_id() == kTypedDataInt32x4ArrayCid)   ||
+      ASSERT((class_id() == kTypedDataInt32x4ArrayCid) ||
              (class_id() == kTypedDataFloat32x4ArrayCid) ||
              (class_id() == kTypedDataFloat64x2ArrayCid));
       __ movups(result, element_address);
@@ -1121,7 +1138,7 @@
   if (representation() == kUnboxedMint) {
     ASSERT(class_id() == kTypedDataInt64ArrayCid);
     if ((index_scale() == 1) && index.IsRegister()) {
-    __ SmiUntag(index.reg());
+      __ SmiUntag(index.reg());
     }
     Register result = locs()->out(0).reg();
     __ movq(result, element_address);
@@ -1170,8 +1187,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   // The smi index is either untagged (element size == 1), or it is left smi
   // tagged (for all element sizes > 1).
@@ -1188,7 +1205,7 @@
   const Location index = locs()->in(1);
 
   Address element_address = Assembler::ElementAddressForRegIndex(
-        IsExternal(), class_id(), index_scale(), str, index.reg());
+      IsExternal(), class_id(), index_scale(), str, index.reg());
 
   if ((index_scale() == 1)) {
     __ SmiUntag(index.reg());
@@ -1198,19 +1215,31 @@
     case kOneByteStringCid:
     case kExternalOneByteStringCid:
       switch (element_count()) {
-        case 1: __ movzxb(result, element_address); break;
-        case 2: __ movzxw(result, element_address); break;
-        case 4: __ movl(result, element_address); break;
-        default: UNREACHABLE();
+        case 1:
+          __ movzxb(result, element_address);
+          break;
+        case 2:
+          __ movzxw(result, element_address);
+          break;
+        case 4:
+          __ movl(result, element_address);
+          break;
+        default:
+          UNREACHABLE();
       }
       __ SmiTag(result);
       break;
     case kTwoByteStringCid:
     case kExternalTwoByteStringCid:
       switch (element_count()) {
-        case 1: __ movzxw(result, element_address); break;
-        case 2: __ movl(result, element_address); break;
-        default: UNREACHABLE();
+        case 1:
+          __ movzxw(result, element_address);
+          break;
+        case 2:
+          __ movl(result, element_address);
+          break;
+        default:
+          UNREACHABLE();
       }
       __ SmiTag(result);
       break;
@@ -1263,25 +1292,27 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 3;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RequiresRegister());
   // The smi index is either untagged (element size == 1), or it is left smi
   // tagged (for all element sizes > 1).
   if (index_scale() == 1) {
-    locs->set_in(1, CanBeImmediateIndex(index(), class_id())
-                      ? Location::Constant(index()->definition()->AsConstant())
-                      : Location::WritableRegister());
+    locs->set_in(1,
+                 CanBeImmediateIndex(index(), class_id())
+                     ? Location::Constant(index()->definition()->AsConstant())
+                     : Location::WritableRegister());
   } else {
-    locs->set_in(1, CanBeImmediateIndex(index(), class_id())
-                      ? Location::Constant(index()->definition()->AsConstant())
-                      : Location::RequiresRegister());
+    locs->set_in(1,
+                 CanBeImmediateIndex(index(), class_id())
+                     ? Location::Constant(index()->definition()->AsConstant())
+                     : Location::RequiresRegister());
   }
   switch (class_id()) {
     case kArrayCid:
       locs->set_in(2, ShouldEmitStoreBarrier()
-                        ? Location::WritableRegister()
-                        : Location::RegisterOrConstant(value()));
+                          ? Location::WritableRegister()
+                          : Location::RegisterOrConstant(value()));
       break;
     case kExternalTypedDataUint8ArrayCid:
     case kExternalTypedDataUint8ClampedArrayCid:
@@ -1326,12 +1357,13 @@
   const Register array = locs()->in(0).reg();
   const Location index = locs()->in(1);
 
-  Address element_address = index.IsRegister()
-      ? Assembler::ElementAddressForRegIndex(
-            IsExternal(), class_id(), index_scale(), array, index.reg())
-      : Assembler::ElementAddressForIntIndex(
-            IsExternal(), class_id(), index_scale(),
-            array, Smi::Cast(index.constant()).Value());
+  Address element_address =
+      index.IsRegister()
+          ? Assembler::ElementAddressForRegIndex(
+                IsExternal(), class_id(), index_scale(), array, index.reg())
+          : Assembler::ElementAddressForIntIndex(
+                IsExternal(), class_id(), index_scale(), array,
+                Smi::Cast(index.constant()).Value());
 
   if ((index_scale() == 1) && index.IsRegister()) {
     __ SmiUntag(index.reg());
@@ -1374,8 +1406,7 @@
         } else if (value < 0) {
           value = 0;
         }
-        __ movb(element_address,
-                Immediate(static_cast<int8_t>(value)));
+        __ movb(element_address, Immediate(static_cast<int8_t>(value)));
       } else {
         ASSERT(locs()->in(2).reg() == RAX);
         Label store_value, store_0xff;
@@ -1437,7 +1468,7 @@
 
   const bool emit_full_guard = !opt || (field_cid == kIllegalCid);
   const bool needs_value_cid_temp_reg =
-    (value_cid == kDynamicCid) && (emit_full_guard || (field_cid != kSmiCid));
+      (value_cid == kDynamicCid) && (emit_full_guard || (field_cid != kSmiCid));
   const bool needs_field_temp_reg = emit_full_guard;
 
   intptr_t num_temps = 0;
@@ -1448,8 +1479,8 @@
     num_temps++;
   }
 
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, num_temps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, num_temps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
 
   for (intptr_t i = 0; i < num_temps; i++) {
@@ -1470,7 +1501,8 @@
   if (field_cid == kDynamicCid) {
     if (Compiler::IsBackgroundCompilation()) {
       // Field state changed while compiling.
-      Compiler::AbortBackgroundCompilation(deopt_id(),
+      Compiler::AbortBackgroundCompilation(
+          deopt_id(),
           "GuardFieldClassInstr: field state changed while compiling");
     }
     ASSERT(!compiler->is_optimizing());
@@ -1487,16 +1519,19 @@
 
   const Register value_reg = locs()->in(0).reg();
 
-  const Register value_cid_reg = needs_value_cid_temp_reg ?
-      locs()->temp(0).reg() : kNoRegister;
+  const Register value_cid_reg =
+      needs_value_cid_temp_reg ? locs()->temp(0).reg() : kNoRegister;
 
-  const Register field_reg = needs_field_temp_reg ?
-      locs()->temp(locs()->temp_count() - 1).reg() : kNoRegister;
+  const Register field_reg = needs_field_temp_reg
+                                 ? locs()->temp(locs()->temp_count() - 1).reg()
+                                 : kNoRegister;
 
   Label ok, fail_label;
 
-  Label* deopt = compiler->is_optimizing() ?
-      compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL;
+  Label* deopt =
+      compiler->is_optimizing()
+          ? compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField)
+          : NULL;
 
   Label* fail = (deopt != NULL) ? deopt : &fail_label;
 
@@ -1504,8 +1539,8 @@
     __ LoadObject(field_reg, Field::ZoneHandle(field().Original()));
 
     FieldAddress field_cid_operand(field_reg, Field::guarded_cid_offset());
-    FieldAddress field_nullability_operand(
-        field_reg, Field::is_nullable_offset());
+    FieldAddress field_nullability_operand(field_reg,
+                                           Field::is_nullable_offset());
 
     if (value_cid == kDynamicCid) {
       LoadValueCid(compiler, value_cid_reg, value_reg);
@@ -1594,8 +1629,8 @@
   const intptr_t kNumInputs = 1;
   if (!opt || (field().guarded_list_length() == Field::kUnknownFixedLength)) {
     const intptr_t kNumTemps = 3;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresRegister());
     // We need temporaries for field object, length offset and expected length.
     summary->set_temp(0, Location::RequiresRegister());
@@ -1603,8 +1638,8 @@
     summary->set_temp(2, Location::RequiresRegister());
     return summary;
   } else {
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, 0, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, 0, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresRegister());
     return summary;
   }
@@ -1616,15 +1651,18 @@
   if (field().guarded_list_length() == Field::kNoFixedLength) {
     if (Compiler::IsBackgroundCompilation()) {
       // Field state changed while compiling.
-      Compiler::AbortBackgroundCompilation(deopt_id(),
+      Compiler::AbortBackgroundCompilation(
+          deopt_id(),
           "GuardFieldLengthInstr: field state changed while compiling");
     }
     ASSERT(!compiler->is_optimizing());
     return;  // Nothing to emit.
   }
 
-  Label* deopt = compiler->is_optimizing() ?
-      compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL;
+  Label* deopt =
+      compiler->is_optimizing()
+          ? compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField)
+          : NULL;
 
   const Register value_reg = locs()->in(0).reg();
 
@@ -1638,10 +1676,12 @@
 
     __ LoadObject(field_reg, Field::ZoneHandle(field().Original()));
 
-    __ movsxb(offset_reg, FieldAddress(field_reg,
-        Field::guarded_list_length_in_object_offset_offset()));
-    __ movq(length_reg, FieldAddress(field_reg,
-        Field::guarded_list_length_offset()));
+    __ movsxb(
+        offset_reg,
+        FieldAddress(field_reg,
+                     Field::guarded_list_length_in_object_offset_offset()));
+    __ movq(length_reg,
+            FieldAddress(field_reg, Field::guarded_list_length_offset()));
 
     __ cmpq(offset_reg, Immediate(0));
     __ j(NEGATIVE, &ok);
@@ -1668,12 +1708,11 @@
     ASSERT(compiler->is_optimizing());
     ASSERT(field().guarded_list_length() >= 0);
     ASSERT(field().guarded_list_length_in_object_offset() !=
-        Field::kUnknownLengthOffset);
+           Field::kUnknownLengthOffset);
 
     __ CompareImmediate(
-            FieldAddress(value_reg,
-                         field().guarded_list_length_in_object_offset()),
-            Immediate(Smi::RawValue(field().guarded_list_length())));
+        FieldAddress(value_reg, field().guarded_list_length_in_object_offset()),
+        Immediate(Smi::RawValue(field().guarded_list_length())));
     __ j(NOT_EQUAL, deopt);
   }
 }
@@ -1684,19 +1723,16 @@
   BoxAllocationSlowPath(Instruction* instruction,
                         const Class& cls,
                         Register result)
-      : instruction_(instruction),
-        cls_(cls),
-        result_(result) { }
+      : instruction_(instruction), cls_(cls), result_(result) {}
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     if (Assembler::EmittingComments()) {
-      __ Comment("%s slow path allocation of %s",
-                 instruction_->DebugName(),
+      __ Comment("%s slow path allocation of %s", instruction_->DebugName(),
                  String::Handle(cls_.ScrubbedName()).ToCString());
     }
     __ Bind(entry_label());
-    const Code& stub = Code::ZoneHandle(compiler->zone(),
-        StubCode::GetAllocationStubForClass(cls_));
+    const Code& stub = Code::ZoneHandle(
+        compiler->zone(), StubCode::GetAllocationStubForClass(cls_));
     const StubEntry stub_entry(stub);
 
     LocationSummary* locs = instruction_->locs();
@@ -1705,9 +1741,7 @@
 
     compiler->SaveLiveRegisters(locs);
     compiler->GenerateCall(TokenPosition::kNoSource,  // No token position.
-                           stub_entry,
-                           RawPcDescriptors::kOther,
-                           locs);
+                           stub_entry, RawPcDescriptors::kOther, locs);
     compiler->AddStubCallTarget(stub);
     __ MoveRegister(result_, RAX);
     compiler->RestoreLiveRegisters(locs);
@@ -1720,20 +1754,14 @@
                        Register result,
                        Register temp) {
     if (compiler->intrinsic_mode()) {
-      __ TryAllocate(cls,
-                     compiler->intrinsic_slow_path_label(),
-                     Assembler::kFarJump,
-                     result,
-                     temp);
+      __ TryAllocate(cls, compiler->intrinsic_slow_path_label(),
+                     Assembler::kFarJump, result, temp);
     } else {
       BoxAllocationSlowPath* slow_path =
           new BoxAllocationSlowPath(instruction, cls, result);
       compiler->AddSlowPathCode(slow_path);
 
-      __ TryAllocate(cls,
-                     slow_path->entry_label(),
-                     Assembler::kFarJump,
-                     result,
+      __ TryAllocate(cls, slow_path->entry_label(), Assembler::kFarJump, result,
                      temp);
       __ Bind(slow_path->exit_label());
     }
@@ -1750,14 +1778,13 @@
                                                               bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps =
-      (IsUnboxedStore() && opt) ? 2 :
-          ((IsPotentialUnboxedStore()) ? 3 : 0);
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps,
-          ((IsUnboxedStore() && opt && is_initialization()) ||
-           IsPotentialUnboxedStore())
-          ? LocationSummary::kCallOnSlowPath
-          : LocationSummary::kNoCall);
+      (IsUnboxedStore() && opt) ? 2 : ((IsPotentialUnboxedStore()) ? 3 : 0);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps,
+                      ((IsUnboxedStore() && opt && is_initialization()) ||
+                       IsPotentialUnboxedStore())
+                          ? LocationSummary::kCallOnSlowPath
+                          : LocationSummary::kNoCall);
 
   summary->set_in(0, Location::RequiresRegister());
   if (IsUnboxedStore() && opt) {
@@ -1765,17 +1792,16 @@
     summary->set_temp(0, Location::RequiresRegister());
     summary->set_temp(1, Location::RequiresRegister());
   } else if (IsPotentialUnboxedStore()) {
-    summary->set_in(1, ShouldEmitStoreBarrier()
-        ? Location::WritableRegister()
-        :  Location::RequiresRegister());
+    summary->set_in(1, ShouldEmitStoreBarrier() ? Location::WritableRegister()
+                                                : Location::RequiresRegister());
     summary->set_temp(0, Location::RequiresRegister());
     summary->set_temp(1, Location::RequiresRegister());
     summary->set_temp(2, opt ? Location::RequiresFpuRegister()
                              : Location::FpuRegisterLocation(XMM1));
   } else {
     summary->set_in(1, ShouldEmitStoreBarrier()
-                       ? Location::WritableRegister()
-                       : Location::RegisterOrConstant(value()));
+                           ? Location::WritableRegister()
+                           : Location::RegisterOrConstant(value()));
   }
   return summary;
 }
@@ -1794,9 +1820,7 @@
   __ j(NOT_EQUAL, &done);
   BoxAllocationSlowPath::Allocate(compiler, instruction, cls, box_reg, temp);
   __ movq(temp, box_reg);
-  __ StoreIntoObject(instance_reg,
-                     FieldAddress(instance_reg, offset),
-                     temp);
+  __ StoreIntoObject(instance_reg, FieldAddress(instance_reg, offset), temp);
 
   __ Bind(&done);
 }
@@ -1833,8 +1857,7 @@
       BoxAllocationSlowPath::Allocate(compiler, this, *cls, temp, temp2);
       __ movq(temp2, temp);
       __ StoreIntoObject(instance_reg,
-                         FieldAddress(instance_reg, offset_in_bytes_),
-                         temp2);
+                         FieldAddress(instance_reg, offset_in_bytes_), temp2);
     } else {
       __ movq(temp, FieldAddress(instance_reg, offset_in_bytes_));
     }
@@ -1850,7 +1873,7 @@
       case kFloat64x2Cid:
         __ Comment("UnboxedFloat64x2StoreInstanceFieldInstr");
         __ movups(FieldAddress(temp, Float64x2::value_offset()), value);
-      break;
+        break;
       default:
         UNREACHABLE();
     }
@@ -1906,13 +1929,8 @@
 
     {
       __ Bind(&store_double);
-      EnsureMutableBox(compiler,
-                       this,
-                       temp,
-                       compiler->double_class(),
-                       instance_reg,
-                       offset_in_bytes_,
-                       temp2);
+      EnsureMutableBox(compiler, this, temp, compiler->double_class(),
+                       instance_reg, offset_in_bytes_, temp2);
       __ movsd(fpu_temp, FieldAddress(value_reg, Double::value_offset()));
       __ movsd(FieldAddress(temp, Double::value_offset()), fpu_temp);
       __ jmp(&skip_store);
@@ -1920,13 +1938,8 @@
 
     {
       __ Bind(&store_float32x4);
-      EnsureMutableBox(compiler,
-                       this,
-                       temp,
-                       compiler->float32x4_class(),
-                       instance_reg,
-                       offset_in_bytes_,
-                       temp2);
+      EnsureMutableBox(compiler, this, temp, compiler->float32x4_class(),
+                       instance_reg, offset_in_bytes_, temp2);
       __ movups(fpu_temp, FieldAddress(value_reg, Float32x4::value_offset()));
       __ movups(FieldAddress(temp, Float32x4::value_offset()), fpu_temp);
       __ jmp(&skip_store);
@@ -1934,13 +1947,8 @@
 
     {
       __ Bind(&store_float64x2);
-      EnsureMutableBox(compiler,
-                       this,
-                       temp,
-                       compiler->float64x2_class(),
-                       instance_reg,
-                       offset_in_bytes_,
-                       temp2);
+      EnsureMutableBox(compiler, this, temp, compiler->float64x2_class(),
+                       instance_reg, offset_in_bytes_, temp2);
       __ movups(fpu_temp, FieldAddress(value_reg, Float64x2::value_offset()));
       __ movups(FieldAddress(temp, Float64x2::value_offset()), fpu_temp);
       __ jmp(&skip_store);
@@ -1952,8 +1960,7 @@
   if (ShouldEmitStoreBarrier()) {
     Register value_reg = locs()->in(1).reg();
     __ StoreIntoObject(instance_reg,
-                       FieldAddress(instance_reg, offset_in_bytes_),
-                       value_reg,
+                       FieldAddress(instance_reg, offset_in_bytes_), value_reg,
                        CanValueBeSmi());
   } else {
     if (locs()->in(1).IsConstant()) {
@@ -1963,8 +1970,8 @@
     } else {
       Register value_reg = locs()->in(1).reg();
       __ StoreIntoObjectNoBarrier(instance_reg,
-          FieldAddress(instance_reg, offset_in_bytes_),
-          value_reg);
+                                  FieldAddress(instance_reg, offset_in_bytes_),
+                                  value_reg);
     }
   }
   __ Bind(&skip_store);
@@ -1975,8 +1982,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_out(0, Location::RequiresRegister());
   return summary;
@@ -1997,8 +2004,8 @@
 
 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Zone* zone,
                                                             bool opt) const {
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, 1, 1, LocationSummary::kNoCall);
+  LocationSummary* locs =
+      new (zone) LocationSummary(zone, 1, 1, LocationSummary::kNoCall);
   locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister()
                                               : Location::RequiresRegister());
   locs->set_temp(0, Location::RequiresRegister());
@@ -2012,10 +2019,8 @@
 
   __ LoadObject(temp, Field::ZoneHandle(Z, field().Original()));
   if (this->value()->NeedsStoreBuffer()) {
-    __ StoreIntoObject(temp,
-                       FieldAddress(temp, Field::static_value_offset()),
-                       value,
-                       CanValueBeSmi());
+    __ StoreIntoObject(temp, FieldAddress(temp, Field::static_value_offset()),
+                       value, CanValueBeSmi());
   } else {
     __ StoreIntoObjectNoBarrier(
         temp, FieldAddress(temp, Field::static_value_offset()), value);
@@ -2027,8 +2032,8 @@
                                                       bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(RAX));
   summary->set_in(1, Location::RegisterLocation(RDX));
   summary->set_out(0, Location::RegisterLocation(RAX));
@@ -2040,10 +2045,7 @@
   ASSERT(locs()->in(0).reg() == RAX);  // Value.
   ASSERT(locs()->in(1).reg() == RDX);  // Instantiator type arguments.
 
-  compiler->GenerateInstanceOf(token_pos(),
-                               deopt_id(),
-                               type(),
-                               negate_result(),
+  compiler->GenerateInstanceOf(token_pos(), deopt_id(), type(), negate_result(),
                                locs());
   ASSERT(locs()->out(0).reg() == RAX);
 }
@@ -2055,8 +2057,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(RBX));
   locs->set_in(1, Location::RegisterLocation(R10));
   locs->set_out(0, Location::RegisterLocation(RAX));
@@ -2066,28 +2068,26 @@
 
 // Inlines array allocation for known constant values.
 static void InlineArrayAllocation(FlowGraphCompiler* compiler,
-                                   intptr_t num_elements,
-                                   Label* slow_path,
-                                   Label* done) {
+                                  intptr_t num_elements,
+                                  Label* slow_path,
+                                  Label* done) {
   const int kInlineArraySize = 12;  // Same as kInlineInstanceSize.
   const Register kLengthReg = R10;
   const Register kElemTypeReg = RBX;
   const intptr_t instance_size = Array::InstanceSize(num_elements);
 
   __ TryAllocateArray(kArrayCid, instance_size, slow_path, Assembler::kFarJump,
-                      RAX,  // instance
-                      RCX,  // end address
+                      RAX,   // instance
+                      RCX,   // end address
                       R13);  // temp
 
   // RAX: new object start as a tagged pointer.
   // Store the type argument field.
-  __ StoreIntoObjectNoBarrier(RAX,
-                              FieldAddress(RAX, Array::type_arguments_offset()),
-                              kElemTypeReg);
+  __ StoreIntoObjectNoBarrier(
+      RAX, FieldAddress(RAX, Array::type_arguments_offset()), kElemTypeReg);
 
   // Set the length field.
-  __ StoreIntoObjectNoBarrier(RAX,
-                              FieldAddress(RAX, Array::length_offset()),
+  __ StoreIntoObjectNoBarrier(RAX, FieldAddress(RAX, Array::length_offset()),
                               kLengthReg);
 
   // Initialize all array elements to raw_null.
@@ -2127,8 +2127,7 @@
   ASSERT(locs()->in(1).reg() == kLengthReg);
 
   Label slow_path, done;
-  if (compiler->is_optimizing() &&
-      !FLAG_precompiled_mode &&
+  if (compiler->is_optimizing() && !FLAG_precompiled_mode &&
       num_elements()->BindsToConstant() &&
       num_elements()->BoundConstant().IsSmi()) {
     const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value();
@@ -2139,11 +2138,8 @@
       __ PushObject(Object::null_object());  // Make room for the result.
       __ pushq(kLengthReg);
       __ pushq(kElemTypeReg);
-      compiler->GenerateRuntimeCall(token_pos(),
-                                    deopt_id(),
-                                    kAllocateArrayRuntimeEntry,
-                                    2,
-                                    locs());
+      compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                    kAllocateArrayRuntimeEntry, 2, locs());
       __ Drop(2);
       __ popq(kResultReg);
       __ Bind(&done);
@@ -2155,10 +2151,8 @@
   const Code& stub = Code::ZoneHandle(compiler->zone(),
                                       StubCode::AllocateArray_entry()->code());
   compiler->AddStubCallTarget(stub);
-  compiler->GenerateCall(token_pos(),
-                         *StubCode::AllocateArray_entry(),
-                         RawPcDescriptors::kOther,
-                         locs());
+  compiler->GenerateCall(token_pos(), *StubCode::AllocateArray_entry(),
+                         RawPcDescriptors::kOther, locs());
   __ Bind(&done);
   ASSERT(locs()->out(0).reg() == kResultReg);
 }
@@ -2168,13 +2162,11 @@
                                                      bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps =
-      (IsUnboxedLoad() && opt) ? 1 :
-          ((IsPotentialUnboxedLoad()) ? 2 : 0);
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps,
-          (opt && !IsPotentialUnboxedLoad())
-          ? LocationSummary::kNoCall
-          : LocationSummary::kCallOnSlowPath);
+      (IsUnboxedLoad() && opt) ? 1 : ((IsPotentialUnboxedLoad()) ? 2 : 0);
+  LocationSummary* locs = new (zone) LocationSummary(
+      zone, kNumInputs, kNumTemps, (opt && !IsPotentialUnboxedLoad())
+                                       ? LocationSummary::kNoCall
+                                       : LocationSummary::kCallOnSlowPath);
 
   locs->set_in(0, Location::RequiresRegister());
 
@@ -2255,8 +2247,8 @@
 
     {
       __ Bind(&load_double);
-      BoxAllocationSlowPath::Allocate(
-          compiler, this, compiler->double_class(), result, temp);
+      BoxAllocationSlowPath::Allocate(compiler, this, compiler->double_class(),
+                                      result, temp);
       __ movq(temp, FieldAddress(instance_reg, offset_in_bytes()));
       __ movsd(value, FieldAddress(temp, Double::value_offset()));
       __ movsd(FieldAddress(result, Double::value_offset()), value);
@@ -2294,8 +2286,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(RAX));
   locs->set_out(0, Location::RegisterLocation(RAX));
   return locs;
@@ -2311,23 +2303,21 @@
   __ PushObject(Object::null_object());  // Make room for the result.
   __ PushObject(type());
   __ pushq(instantiator_reg);  // Push instantiator type arguments.
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kInstantiateTypeRuntimeEntry,
-                                2,
-                                locs());
-  __ Drop(2);  // Drop instantiator and uninstantiated type.
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                kInstantiateTypeRuntimeEntry, 2, locs());
+  __ Drop(2);           // Drop instantiator and uninstantiated type.
   __ popq(result_reg);  // Pop instantiated type.
   ASSERT(instantiator_reg == result_reg);
 }
 
 
 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(RAX));
   locs->set_out(0, Location::RegisterLocation(RAX));
   return locs;
@@ -2382,12 +2372,10 @@
   __ PushObject(Object::null_object());  // Make room for the result.
   __ PushObject(type_arguments());
   __ pushq(instantiator_reg);  // Push instantiator type arguments.
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kInstantiateTypeArgumentsRuntimeEntry,
-                                2,
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                kInstantiateTypeArgumentsRuntimeEntry, 2,
                                 locs());
-  __ Drop(2);  // Drop instantiator and uninstantiated type arguments.
+  __ Drop(2);           // Drop instantiator and uninstantiated type arguments.
   __ popq(result_reg);  // Pop instantiated type arguments.
   __ Bind(&type_arguments_instantiated);
   ASSERT(instantiator_reg == result_reg);
@@ -2400,7 +2388,7 @@
   ASSERT(opt);
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 2;
-  LocationSummary* locs = new(zone) LocationSummary(
+  LocationSummary* locs = new (zone) LocationSummary(
       zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   locs->set_temp(0, Location::RegisterLocation(R10));
   locs->set_temp(1, Location::RegisterLocation(R13));
@@ -2413,7 +2401,7 @@
  public:
   explicit AllocateContextSlowPath(
       AllocateUninitializedContextInstr* instruction)
-      : instruction_(instruction) { }
+      : instruction_(instruction) {}
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     __ Comment("AllocateContextSlowPath");
@@ -2430,8 +2418,7 @@
     compiler->AddStubCallTarget(stub);
     compiler->GenerateCall(instruction_->token_pos(),
                            *StubCode::AllocateContext_entry(),
-                           RawPcDescriptors::kOther,
-                           locs);
+                           RawPcDescriptors::kOther, locs);
     ASSERT(instruction_->locs()->out(0).reg() == RAX);
     compiler->RestoreLiveRegisters(instruction_->locs());
     __ jmp(exit_label());
@@ -2455,7 +2442,7 @@
   __ TryAllocateArray(kContextCid, instance_size, slow_path->entry_label(),
                       Assembler::kFarJump,
                       result,  // instance
-                      temp,  // end address
+                      temp,    // end address
                       locs()->temp(1).reg());
 
   // Setup up number of context variables field.
@@ -2470,8 +2457,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 1;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_temp(0, Location::RegisterLocation(R10));
   locs->set_out(0, Location::RegisterLocation(RAX));
   return locs;
@@ -2483,10 +2470,8 @@
   ASSERT(locs()->out(0).reg() == RAX);
 
   __ LoadImmediate(R10, Immediate(num_context_variables()));
-  compiler->GenerateCall(token_pos(),
-                         *StubCode::AllocateContext_entry(),
-                         RawPcDescriptors::kOther,
-                         locs());
+  compiler->GenerateCall(token_pos(), *StubCode::AllocateContext_entry(),
+                         RawPcDescriptors::kOther, locs());
 }
 
 
@@ -2494,8 +2479,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(RAX));
   locs->set_temp(0, Location::RegisterLocation(RCX));
   return locs;
@@ -2518,11 +2503,8 @@
   __ Bind(&call_runtime);
   __ PushObject(Object::null_object());  // Make room for (unused) result.
   __ pushq(field);
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kInitStaticFieldRuntimeEntry,
-                                1,
-                                locs());
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                kInitStaticFieldRuntimeEntry, 1, locs());
   __ Drop(2);  // Remove argument and unused result.
   __ Bind(&no_call);
 }
@@ -2532,8 +2514,8 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(RAX));
   locs->set_out(0, Location::RegisterLocation(RAX));
   return locs;
@@ -2546,11 +2528,8 @@
 
   __ PushObject(Object::null_object());  // Make room for the result.
   __ pushq(context_value);
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kCloneContextRuntimeEntry,
-                                1,
-                                locs());
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+                                kCloneContextRuntimeEntry, 1, locs());
   __ popq(result);  // Remove argument.
   __ popq(result);  // Get result (cloned context).
 }
@@ -2564,24 +2543,17 @@
 
 
 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  // Ensure space for patching return sites for lazy deopt.
-  if (!FLAG_precompiled_mode && compiler->is_optimizing()) {
-    __ nop(ShortCallPattern::pattern_length_in_bytes());
-  }
   __ Bind(compiler->GetJumpLabel(this));
-  compiler->AddExceptionHandler(catch_try_index(),
-                                try_index(),
+  compiler->AddExceptionHandler(catch_try_index(), try_index(),
                                 compiler->assembler()->CodeSize(),
-                                catch_handler_types_,
-                                needs_stacktrace());
+                                catch_handler_types_, needs_stacktrace());
   // On lazy deoptimization we patch the optimized code here to enter the
   // deoptimization stub.
   const intptr_t deopt_id = Thread::ToDeoptAfter(GetDeoptId());
   if (compiler->is_optimizing()) {
     compiler->AddDeoptIndexAtCall(deopt_id);
   } else {
-    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                                   deopt_id,
+    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id,
                                    TokenPosition::kNoSource);
   }
   if (HasParallelMove()) {
@@ -2595,12 +2567,50 @@
   ASSERT(fp_sp_dist <= 0);
   __ leaq(RSP, Address(RBP, fp_sp_dist));
 
-  // Restore stack and initialize the two exception variables:
-  // exception and stack trace variables.
-  __ movq(Address(RBP, exception_var().index() * kWordSize),
-          kExceptionObjectReg);
-  __ movq(Address(RBP, stacktrace_var().index() * kWordSize),
-          kStackTraceObjectReg);
+  // Auxiliary variables introduced by the try catch can be captured if we are
+  // inside a function with yield/resume points. In this case we first need
+  // to restore the context to match the context at entry into the closure.
+  if (should_restore_closure_context()) {
+    const ParsedFunction& parsed_function = compiler->parsed_function();
+    ASSERT(parsed_function.function().IsClosureFunction());
+    LocalScope* scope = parsed_function.node_sequence()->scope();
+
+    LocalVariable* closure_parameter = scope->VariableAt(0);
+    ASSERT(!closure_parameter->is_captured());
+    __ movq(CTX, Address(RBP, closure_parameter->index() * kWordSize));
+    __ movq(CTX, FieldAddress(CTX, Closure::context_offset()));
+
+#ifdef DEBUG
+    Label ok;
+    __ LoadClassId(RBX, CTX);
+    __ cmpq(RBX, Immediate(kContextCid));
+    __ j(EQUAL, &ok, Assembler::kNearJump);
+    __ Stop("Incorrect context at entry");
+    __ Bind(&ok);
+#endif
+
+    const intptr_t context_index =
+        parsed_function.current_context_var()->index();
+    __ movq(Address(RBP, context_index * kWordSize), CTX);
+  }
+
+  // Initialize exception and stack trace variables.
+  if (exception_var().is_captured()) {
+    ASSERT(stacktrace_var().is_captured());
+    __ StoreIntoObject(
+        CTX,
+        FieldAddress(CTX, Context::variable_offset(exception_var().index())),
+        kExceptionObjectReg);
+    __ StoreIntoObject(
+        CTX,
+        FieldAddress(CTX, Context::variable_offset(stacktrace_var().index())),
+        kStackTraceObjectReg);
+  } else {
+    __ movq(Address(RBP, exception_var().index() * kWordSize),
+            kExceptionObjectReg);
+    __ movq(Address(RBP, stacktrace_var().index() * kWordSize),
+            kStackTraceObjectReg);
+  }
 }
 
 
@@ -2608,10 +2618,8 @@
                                                               bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs,
-                          kNumTemps,
-                          LocationSummary::kCallOnSlowPath);
+  LocationSummary* summary = new (zone) LocationSummary(
+      zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   summary->set_temp(0, Location::RequiresRegister());
   return summary;
 }
@@ -2620,7 +2628,7 @@
 class CheckStackOverflowSlowPath : public SlowPathCode {
  public:
   explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction)
-      : instruction_(instruction) { }
+      : instruction_(instruction) {}
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     if (FLAG_use_osr && osr_entry_label()->IsLinked()) {
@@ -2637,11 +2645,9 @@
     ASSERT(compiler->pending_deoptimization_env_ == NULL);
     Environment* env = compiler->SlowPathEnvironmentFor(instruction_);
     compiler->pending_deoptimization_env_ = env;
-    compiler->GenerateRuntimeCall(instruction_->token_pos(),
-                                  instruction_->deopt_id(),
-                                  kStackOverflowRuntimeEntry,
-                                  0,
-                                  instruction_->locs());
+    compiler->GenerateRuntimeCall(
+        instruction_->token_pos(), instruction_->deopt_id(),
+        kStackOverflowRuntimeEntry, 0, instruction_->locs());
 
     if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) {
       // In unoptimized code, record loop stack checks as possible OSR entries.
@@ -2698,9 +2704,10 @@
   Register left = locs.in(0).reg();
   Register result = locs.out(0).reg();
   ASSERT(left == result);
-  Label* deopt = shift_left->CanDeoptimize() ?
-      compiler->AddDeoptStub(shift_left->deopt_id(), ICData::kDeoptBinarySmiOp)
-      : NULL;
+  Label* deopt = shift_left->CanDeoptimize()
+                     ? compiler->AddDeoptStub(shift_left->deopt_id(),
+                                              ICData::kDeoptBinarySmiOp)
+                     : NULL;
   if (locs.in(1).IsConstant()) {
     const Object& constant = locs.in(1).constant();
     ASSERT(constant.IsSmi());
@@ -2746,8 +2753,8 @@
       const bool right_needs_check =
           !RangeUtils::IsWithin(right_range, 0, max_right - 1);
       if (right_needs_check) {
-        __ CompareImmediate(right,
-            Immediate(reinterpret_cast<int64_t>(Smi::New(max_right))));
+        __ CompareImmediate(
+            right, Immediate(reinterpret_cast<int64_t>(Smi::New(max_right))));
         __ j(ABOVE_EQUAL, deopt);
       }
       __ SmiUntag(right);
@@ -2769,8 +2776,8 @@
         __ j(NEGATIVE, deopt);
       }
       Label done, is_not_zero;
-      __ CompareImmediate(right,
-          Immediate(reinterpret_cast<int64_t>(Smi::New(Smi::kBits))));
+      __ CompareImmediate(
+          right, Immediate(reinterpret_cast<int64_t>(Smi::New(Smi::kBits))));
       __ j(BELOW, &is_not_zero, Assembler::kNearJump);
       __ xorq(left, left);
       __ jmp(&done, Assembler::kNearJump);
@@ -2785,8 +2792,8 @@
   } else {
     if (right_needs_check) {
       ASSERT(shift_left->CanDeoptimize());
-      __ CompareImmediate(right,
-          Immediate(reinterpret_cast<int64_t>(Smi::New(Smi::kBits))));
+      __ CompareImmediate(
+          right, Immediate(reinterpret_cast<int64_t>(Smi::New(Smi::kBits))));
       __ j(ABOVE_EQUAL, deopt);
     }
     // Left is not a constant.
@@ -2808,7 +2815,7 @@
 class CheckedSmiSlowPath : public SlowPathCode {
  public:
   CheckedSmiSlowPath(CheckedSmiOpInstr* instruction, intptr_t try_index)
-      : instruction_(instruction), try_index_(try_index) { }
+      : instruction_(instruction), try_index_(try_index) {}
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     if (Assembler::EmittingComments()) {
@@ -2823,12 +2830,9 @@
     __ pushq(locs->in(0).reg());
     __ pushq(locs->in(1).reg());
     compiler->EmitMegamorphicInstanceCall(
-        *instruction_->call()->ic_data(),
-        instruction_->call()->ArgumentCount(),
-        instruction_->call()->deopt_id(),
-        instruction_->call()->token_pos(),
-        locs,
-        try_index_,
+        *instruction_->call()->ic_data(), instruction_->call()->ArgumentCount(),
+        instruction_->call()->deopt_id(), instruction_->call()->token_pos(),
+        locs, try_index_,
         /* slow_path_argument_count = */ 2);
     __ MoveRegister(result, RAX);
     compiler->RestoreLiveRegisters(locs);
@@ -2843,21 +2847,19 @@
 
 LocationSummary* CheckedSmiOpInstr::MakeLocationSummary(Zone* zone,
                                                         bool opt) const {
+  bool is_shift = (op_kind() == Token::kSHL) || (op_kind() == Token::kSHR);
   const intptr_t kNumInputs = 2;
-  const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
+  const intptr_t kNumTemps = is_shift ? 1 : 0;
+  LocationSummary* summary = new (zone) LocationSummary(
       zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   switch (op_kind()) {
-    case Token::kEQ:
-    case Token::kLT:
-    case Token::kLTE:
-    case Token::kGT:
-    case Token::kGTE:
     case Token::kADD:
     case Token::kSUB:
     case Token::kMUL:
+    case Token::kSHL:
+    case Token::kSHR:
       summary->set_out(0, Location::RequiresRegister());
       break;
     case Token::kBIT_OR:
@@ -2868,6 +2870,9 @@
     default:
       UNIMPLEMENTED();
   }
+  if (is_shift) {
+    summary->set_temp(0, Location::RegisterLocation(RCX));
+  }
   return summary;
 }
 
@@ -2924,22 +2929,34 @@
       ASSERT(left == result);
       __ xorq(result, right);
       break;
-    case Token::kEQ:
-    case Token::kLT:
-    case Token::kLTE:
-    case Token::kGT:
-    case Token::kGTE: {
-      Label true_label, false_label, done;
-      BranchLabels labels = { &true_label, &false_label, &false_label };
-      Condition true_condition =
-          EmitInt64ComparisonOp(compiler, *locs(), op_kind());
-      EmitBranchOnCondition(compiler, true_condition, labels);
-      __ Bind(&false_label);
-      __ LoadObject(result, Bool::False());
-      __ jmp(&done);
-      __ Bind(&true_label);
-      __ LoadObject(result, Bool::True());
-      __ Bind(&done);
+    case Token::kSHL:
+      ASSERT(result != right);
+      ASSERT(locs()->temp(0).reg() == RCX);
+      __ cmpq(right, Immediate(Smi::RawValue(Smi::kBits)));
+      __ j(ABOVE_EQUAL, slow_path->entry_label());
+
+      __ movq(RCX, right);
+      __ SmiUntag(RCX);
+      __ movq(result, left);
+      __ shlq(result, RCX);
+      __ movq(TMP, result);
+      __ sarq(TMP, RCX);
+      __ cmpq(TMP, left);
+      __ j(NOT_EQUAL, slow_path->entry_label());
+      break;
+    case Token::kSHR: {
+      Label shift_count_ok;
+      ASSERT(result != right);
+      ASSERT(locs()->temp(0).reg() == RCX);
+      __ cmpq(right, Immediate(Smi::RawValue(Smi::kBits)));
+      __ j(ABOVE_EQUAL, slow_path->entry_label());
+
+      __ movq(RCX, right);
+      __ SmiUntag(RCX);
+      __ movq(result, left);
+      __ SmiUntag(result);
+      __ sarq(result, RCX);
+      __ SmiTag(result);
       break;
     }
     default:
@@ -2949,9 +2966,134 @@
 }
 
 
+class CheckedSmiComparisonSlowPath : public SlowPathCode {
+ public:
+  CheckedSmiComparisonSlowPath(CheckedSmiComparisonInstr* instruction,
+                               intptr_t try_index,
+                               BranchLabels labels,
+                               bool merged = false)
+      : instruction_(instruction),
+        try_index_(try_index),
+        labels_(labels),
+        merged_(merged) {}
+
+  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
+    if (Assembler::EmittingComments()) {
+      __ Comment("slow path smi comparison");
+    }
+    __ Bind(entry_label());
+    LocationSummary* locs = instruction_->locs();
+    Register result = merged_ ? locs->temp(0).reg() : locs->out(0).reg();
+    locs->live_registers()->Remove(Location::RegisterLocation(result));
+
+    compiler->SaveLiveRegisters(locs);
+    __ pushq(locs->in(0).reg());
+    __ pushq(locs->in(1).reg());
+    compiler->EmitMegamorphicInstanceCall(
+        *instruction_->call()->ic_data(), instruction_->call()->ArgumentCount(),
+        instruction_->call()->deopt_id(), instruction_->call()->token_pos(),
+        locs, try_index_,
+        /* slow_path_argument_count = */ 2);
+    __ MoveRegister(result, RAX);
+    compiler->RestoreLiveRegisters(locs);
+    if (merged_) {
+      __ CompareObject(result, Bool::True());
+      __ j(EQUAL, instruction_->is_negated() ? labels_.false_label
+                                             : labels_.true_label);
+      __ jmp(instruction_->is_negated() ? labels_.true_label
+                                        : labels_.false_label);
+    } else {
+      __ jmp(exit_label());
+    }
+  }
+
+ private:
+  CheckedSmiComparisonInstr* instruction_;
+  intptr_t try_index_;
+  BranchLabels labels_;
+  bool merged_;
+};
+
+
+LocationSummary* CheckedSmiComparisonInstr::MakeLocationSummary(
+    Zone* zone,
+    bool opt) const {
+  const intptr_t kNumInputs = 2;
+  const intptr_t kNumTemps = 1;
+  LocationSummary* summary = new (zone) LocationSummary(
+      zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
+  summary->set_in(0, Location::RequiresRegister());
+  summary->set_in(1, Location::RequiresRegister());
+  summary->set_temp(0, Location::RequiresRegister());
+  summary->set_out(0, Location::RequiresRegister());
+  return summary;
+}
+
+
+Condition CheckedSmiComparisonInstr::EmitComparisonCode(
+    FlowGraphCompiler* compiler,
+    BranchLabels labels) {
+  return EmitInt64ComparisonOp(compiler, *locs(), kind());
+}
+
+
+#define EMIT_SMI_CHECK                                                         \
+  intptr_t left_cid = left()->Type()->ToCid();                                 \
+  intptr_t right_cid = right()->Type()->ToCid();                               \
+  Register left = locs()->in(0).reg();                                         \
+  Register right = locs()->in(1).reg();                                        \
+  if (this->left()->definition() == this->right()->definition()) {             \
+    __ testq(left, Immediate(kSmiTagMask));                                    \
+  } else if (left_cid == kSmiCid) {                                            \
+    __ testq(right, Immediate(kSmiTagMask));                                   \
+  } else if (right_cid == kSmiCid) {                                           \
+    __ testq(left, Immediate(kSmiTagMask));                                    \
+  } else {                                                                     \
+    __ movq(TMP, left);                                                        \
+    __ orq(TMP, right);                                                        \
+    __ testq(TMP, Immediate(kSmiTagMask));                                     \
+  }                                                                            \
+  __ j(NOT_ZERO, slow_path->entry_label())
+
+
+void CheckedSmiComparisonInstr::EmitBranchCode(FlowGraphCompiler* compiler,
+                                               BranchInstr* branch) {
+  BranchLabels labels = compiler->CreateBranchLabels(branch);
+  CheckedSmiComparisonSlowPath* slow_path = new CheckedSmiComparisonSlowPath(
+      this, compiler->CurrentTryIndex(), labels,
+      /* merged = */ true);
+  compiler->AddSlowPathCode(slow_path);
+  EMIT_SMI_CHECK;
+  Condition true_condition = EmitComparisonCode(compiler, labels);
+  EmitBranchOnCondition(compiler, true_condition, labels);
+  __ Bind(slow_path->exit_label());
+}
+
+
+void CheckedSmiComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  Label true_label, false_label, done;
+  BranchLabels labels = {&true_label, &false_label, &false_label};
+  CheckedSmiComparisonSlowPath* slow_path = new CheckedSmiComparisonSlowPath(
+      this, compiler->CurrentTryIndex(), labels,
+      /* merged = */ false);
+  compiler->AddSlowPathCode(slow_path);
+  EMIT_SMI_CHECK;
+  Condition true_condition = EmitComparisonCode(compiler, labels);
+  EmitBranchOnCondition(compiler, true_condition, labels);
+  Register result = locs()->out(0).reg();
+  __ Bind(&false_label);
+  __ LoadObject(result, Bool::False());
+  __ jmp(&done);
+  __ Bind(&true_label);
+  __ LoadObject(result, Bool::True());
+  __ Bind(&done);
+  __ Bind(slow_path->exit_label());
+}
+
+
 static bool CanBeImmediate(const Object& constant) {
   return constant.IsSmi() &&
-    Immediate(reinterpret_cast<int64_t>(constant.raw())).is_int32();
+         Immediate(reinterpret_cast<int64_t>(constant.raw())).is_int32();
 }
 
 static bool IsSmiValue(const Object& constant, intptr_t value) {
@@ -2964,15 +3106,12 @@
   const intptr_t kNumInputs = 2;
 
   ConstantInstr* right_constant = right()->definition()->AsConstant();
-  if ((right_constant != NULL) &&
-      (op_kind() != Token::kTRUNCDIV) &&
-      (op_kind() != Token::kSHL) &&
-      (op_kind() != Token::kMUL) &&
-      (op_kind() != Token::kMOD) &&
-      CanBeImmediate(right_constant->value())) {
+  if ((right_constant != NULL) && (op_kind() != Token::kTRUNCDIV) &&
+      (op_kind() != Token::kSHL) && (op_kind() != Token::kMUL) &&
+      (op_kind() != Token::kMOD) && CanBeImmediate(right_constant->value())) {
     const intptr_t kNumTemps = 0;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresRegister());
     summary->set_in(1, Location::Constant(right_constant));
     summary->set_out(0, Location::SameAsFirstInput());
@@ -2981,8 +3120,8 @@
 
   if (op_kind() == Token::kTRUNCDIV) {
     const intptr_t kNumTemps = 1;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     if (RightIsPowerOfTwoConstant()) {
       summary->set_in(0, Location::RequiresRegister());
       ConstantInstr* right_constant = right()->definition()->AsConstant();
@@ -3000,8 +3139,8 @@
     return summary;
   } else if (op_kind() == Token::kMOD) {
     const intptr_t kNumTemps = 1;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     // Both inputs must be writable because they will be untagged.
     summary->set_in(0, Location::RegisterLocation(RDX));
     summary->set_in(1, Location::WritableRegister());
@@ -3011,8 +3150,8 @@
     return summary;
   } else if (op_kind() == Token::kSHR) {
     const intptr_t kNumTemps = 0;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresRegister());
     summary->set_in(1, Location::FixedRegisterOrSmiConstant(right(), RCX));
     summary->set_out(0, Location::SameAsFirstInput());
@@ -3022,8 +3161,8 @@
     const bool shiftBy1 =
         (right_constant != NULL) && IsSmiValue(right_constant->value(), 1);
     const intptr_t kNumTemps = (can_overflow() && !shiftBy1) ? 1 : 0;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresRegister());
     summary->set_in(1, Location::FixedRegisterOrSmiConstant(right(), RCX));
     if (kNumTemps == 1) {
@@ -3033,8 +3172,8 @@
     return summary;
   } else {
     const intptr_t kNumTemps = 0;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresRegister());
     ConstantInstr* constant = right()->definition()->AsConstant();
     if (constant != NULL) {
@@ -3123,8 +3262,8 @@
         // sarq operation masks the count to 6 bits.
         const intptr_t kCountLimit = 0x3F;
         const intptr_t value = Smi::Cast(constant).Value();
-        __ sarq(left, Immediate(
-            Utils::Minimum(value + kSmiTagSize, kCountLimit)));
+        __ sarq(left,
+                Immediate(Utils::Minimum(value + kSmiTagSize, kCountLimit)));
         __ SmiTag(left);
         break;
       }
@@ -3250,7 +3389,7 @@
       __ Bind(&not_32bit);
       __ SmiUntag(left);
       __ SmiUntag(right);
-      __ cqo();  // Sign extend RAX -> RDX:RAX.
+      __ cqo();         // Sign extend RAX -> RDX:RAX.
       __ idivq(right);  //  RAX: quotient, RDX: remainder.
       // Check the corner case of dividing the 'MIN_SMI' with -1, in which
       // case we cannot tag the result.
@@ -3298,7 +3437,7 @@
       __ SmiUntag(left);
       __ SmiUntag(right);
       __ movq(RAX, RDX);
-      __ cqo();  // Sign extend RAX -> RDX:RAX.
+      __ cqo();         // Sign extend RAX -> RDX:RAX.
       __ idivq(right);  //  RAX: quotient, RDX: remainder.
       __ Bind(&div_done);
       //  res = left % right;
@@ -3380,12 +3519,11 @@
   intptr_t right_cid = right()->Type()->ToCid();
   ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid));
   const intptr_t kNumInputs = 2;
-  const bool need_temp = (left()->definition() != right()->definition())
-                      && (left_cid != kSmiCid)
-                      && (right_cid != kSmiCid);
+  const bool need_temp = (left()->definition() != right()->definition()) &&
+                         (left_cid != kSmiCid) && (right_cid != kSmiCid);
   const intptr_t kNumTemps = need_temp ? 1 : 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-    zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   if (need_temp) summary->set_temp(0, Location::RequiresRegister());
@@ -3394,9 +3532,9 @@
 
 
 void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  Label* deopt = compiler->AddDeoptStub(deopt_id(),
-                                        ICData::kDeoptBinaryDoubleOp,
-                                        licm_hoisted_ ? ICData::kHoisted : 0);
+  Label* deopt =
+      compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinaryDoubleOp,
+                             licm_hoisted_ ? ICData::kHoisted : 0);
   intptr_t left_cid = left()->Type()->ToCid();
   intptr_t right_cid = right()->Type()->ToCid();
   Register left = locs()->in(0).reg();
@@ -3417,11 +3555,10 @@
 }
 
 
-LocationSummary* BoxInstr::MakeLocationSummary(Zone* zone,
-                                                     bool opt) const {
+LocationSummary* BoxInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
+  LocationSummary* summary = new (zone) LocationSummary(
       zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_temp(0, Location::RequiresRegister());
@@ -3435,9 +3572,9 @@
   Register temp = locs()->temp(0).reg();
   XmmRegister value = locs()->in(0).fpu_reg();
 
-  BoxAllocationSlowPath::Allocate(
-      compiler, this, compiler->BoxClassFor(from_representation()), out_reg,
-      temp);
+  BoxAllocationSlowPath::Allocate(compiler, this,
+                                  compiler->BoxClassFor(from_representation()),
+                                  out_reg, temp);
   __ movsd(FieldAddress(out_reg, Double::value_offset()), value);
   switch (from_representation()) {
     case kUnboxedDouble:
@@ -3455,15 +3592,14 @@
 }
 
 
-LocationSummary* UnboxInstr::MakeLocationSummary(Zone* zone,
-                                                 bool opt) const {
+LocationSummary* UnboxInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
   const bool needs_writable_input =
       (representation() != kUnboxedMint) &&
       (value()->Type()->ToNullableCid() != BoxCid());
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, needs_writable_input ? Location::WritableRegister()
                                           : Location::RequiresRegister());
   if (representation() == kUnboxedMint) {
@@ -3541,8 +3677,8 @@
     EmitSmiConversion(compiler);
   } else {
     const Register box = locs()->in(0).reg();
-    Label* deopt = compiler->AddDeoptStub(GetDeoptId(),
-                                          ICData::kDeoptCheckClass);
+    Label* deopt =
+        compiler->AddDeoptStub(GetDeoptId(), ICData::kDeoptCheckClass);
     Label is_smi;
 
     if ((value()->Type()->ToNullableCid() == box_cid) &&
@@ -3573,8 +3709,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = (!is_truncating() && CanDeoptimize()) ? 1 : 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   if (kNumTemps > 0) {
@@ -3587,8 +3723,10 @@
 void UnboxInteger32Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
   const intptr_t value_cid = value()->Type()->ToCid();
   const Register value = locs()->in(0).reg();
-  Label* deopt = CanDeoptimize() ?
-      compiler->AddDeoptStub(GetDeoptId(), ICData::kDeoptUnboxInteger) : NULL;
+  Label* deopt =
+      CanDeoptimize()
+          ? compiler->AddDeoptStub(GetDeoptId(), ICData::kDeoptUnboxInteger)
+          : NULL;
   ASSERT(value == locs()->out(0).reg());
 
   if (value_cid == kSmiCid) {
@@ -3629,16 +3767,13 @@
 
 
 LocationSummary* BoxInteger32Instr::MakeLocationSummary(Zone* zone,
-                                                   bool opt) const {
+                                                        bool opt) const {
   ASSERT((from_representation() == kUnboxedInt32) ||
          (from_representation() == kUnboxedUint32));
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone,
-      kNumInputs,
-      kNumTemps,
-      LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_out(0, Location::RequiresRegister());
   return summary;
@@ -3665,12 +3800,10 @@
                                                     bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = ValueFitsSmi() ? 0 : 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone,
-      kNumInputs,
-      kNumTemps,
-      ValueFitsSmi() ? LocationSummary::kNoCall
-                     : LocationSummary::kCallOnSlowPath);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps,
+                      ValueFitsSmi() ? LocationSummary::kNoCall
+                                     : LocationSummary::kCallOnSlowPath);
   summary->set_in(0, Location::RequiresRegister());
   if (!ValueFitsSmi()) {
     summary->set_temp(0, Location::RequiresRegister());
@@ -3689,8 +3822,8 @@
     const Register temp = locs()->temp(0).reg();
     Label done;
     __ j(NO_OVERFLOW, &done);
-    BoxAllocationSlowPath::Allocate(
-        compiler, this, compiler->mint_class(), out, temp);
+    BoxAllocationSlowPath::Allocate(compiler, this, compiler->mint_class(), out,
+                                    temp);
     __ movq(FieldAddress(out, Mint::value_offset()), value);
     __ Bind(&done);
   }
@@ -3701,8 +3834,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -3717,21 +3850,97 @@
   ASSERT(locs()->out(0).fpu_reg() == left);
 
   switch (op_kind()) {
-    case Token::kADD: __ addsd(left, right); break;
-    case Token::kSUB: __ subsd(left, right); break;
-    case Token::kMUL: __ mulsd(left, right); break;
-    case Token::kDIV: __ divsd(left, right); break;
-    default: UNREACHABLE();
+    case Token::kADD:
+      __ addsd(left, right);
+      break;
+    case Token::kSUB:
+      __ subsd(left, right);
+      break;
+    case Token::kMUL:
+      __ mulsd(left, right);
+      break;
+    case Token::kDIV:
+      __ divsd(left, right);
+      break;
+    default:
+      UNREACHABLE();
   }
 }
 
 
+LocationSummary* DoubleTestOpInstr::MakeLocationSummary(Zone* zone,
+                                                        bool opt) const {
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps =
+      (op_kind() == MethodRecognizer::kDouble_getIsInfinite) ? 1 : 0;
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresFpuRegister());
+  if (op_kind() == MethodRecognizer::kDouble_getIsInfinite) {
+    summary->set_temp(0, Location::RequiresRegister());
+  }
+  summary->set_out(0, Location::RequiresRegister());
+  return summary;
+}
+
+
+Condition DoubleTestOpInstr::EmitComparisonCode(FlowGraphCompiler* compiler,
+                                                BranchLabels labels) {
+  ASSERT(compiler->is_optimizing());
+  const XmmRegister value = locs()->in(0).fpu_reg();
+  const bool is_negated = kind() != Token::kEQ;
+  if (op_kind() == MethodRecognizer::kDouble_getIsNaN) {
+    Label is_nan;
+    __ comisd(value, value);
+    return is_negated ? PARITY_ODD : PARITY_EVEN;
+  } else {
+    ASSERT(op_kind() == MethodRecognizer::kDouble_getIsInfinite);
+    const Register temp = locs()->temp(0).reg();
+    __ AddImmediate(RSP, Immediate(-kDoubleSize));
+    __ movsd(Address(RSP, 0), value);
+    __ movq(temp, Address(RSP, 0));
+    __ AddImmediate(RSP, Immediate(kDoubleSize));
+    // Mask off the sign.
+    __ AndImmediate(temp, Immediate(0x7FFFFFFFFFFFFFFFLL));
+    // Compare with +infinity.
+    __ CompareImmediate(temp, Immediate(0x7FF0000000000000LL));
+    return is_negated ? NOT_EQUAL : EQUAL;
+  }
+}
+
+
+void DoubleTestOpInstr::EmitBranchCode(FlowGraphCompiler* compiler,
+                                       BranchInstr* branch) {
+  ASSERT(compiler->is_optimizing());
+  BranchLabels labels = compiler->CreateBranchLabels(branch);
+  Condition true_condition = EmitComparisonCode(compiler, labels);
+  EmitBranchOnCondition(compiler, true_condition, labels);
+}
+
+
+void DoubleTestOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  Label is_true, is_false;
+  BranchLabels labels = {&is_true, &is_false, &is_false};
+  Condition true_condition = EmitComparisonCode(compiler, labels);
+  EmitBranchOnCondition(compiler, true_condition, labels);
+
+  Register result = locs()->out(0).reg();
+  Label done;
+  __ Bind(&is_false);
+  __ LoadObject(result, Bool::False());
+  __ jmp(&done);
+  __ Bind(&is_true);
+  __ LoadObject(result, Bool::True());
+  __ Bind(&done);
+}
+
+
 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Zone* zone,
                                                              bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -3746,11 +3955,20 @@
   ASSERT(locs()->out(0).fpu_reg() == left);
 
   switch (op_kind()) {
-    case Token::kADD: __ addps(left, right); break;
-    case Token::kSUB: __ subps(left, right); break;
-    case Token::kMUL: __ mulps(left, right); break;
-    case Token::kDIV: __ divps(left, right); break;
-    default: UNREACHABLE();
+    case Token::kADD:
+      __ addps(left, right);
+      break;
+    case Token::kSUB:
+      __ subps(left, right);
+      break;
+    case Token::kMUL:
+      __ mulps(left, right);
+      break;
+    case Token::kDIV:
+      __ divps(left, right);
+      break;
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -3759,8 +3977,8 @@
                                                              bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -3775,11 +3993,20 @@
   ASSERT(locs()->out(0).fpu_reg() == left);
 
   switch (op_kind()) {
-    case Token::kADD: __ addpd(left, right); break;
-    case Token::kSUB: __ subpd(left, right); break;
-    case Token::kMUL: __ mulpd(left, right); break;
-    case Token::kDIV: __ divpd(left, right); break;
-    default: UNREACHABLE();
+    case Token::kADD:
+      __ addpd(left, right);
+      break;
+    case Token::kSUB:
+      __ subpd(left, right);
+      break;
+    case Token::kMUL:
+      __ mulpd(left, right);
+      break;
+    case Token::kDIV:
+      __ divpd(left, right);
+      break;
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -3788,8 +4015,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -3822,7 +4049,8 @@
     case MethodRecognizer::kInt32x4Shuffle:
       __ shufps(value, value, Immediate(mask_));
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -3831,8 +4059,8 @@
                                                               bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -3850,7 +4078,8 @@
     case MethodRecognizer::kInt32x4ShuffleMix:
       __ shufps(left, right, Immediate(mask_));
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -3859,8 +4088,8 @@
                                                                bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresRegister());
   return summary;
@@ -3877,11 +4106,12 @@
 
 
 LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 4;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_in(2, Location::RequiresFpuRegister());
@@ -3918,8 +4148,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
 }
@@ -3935,8 +4165,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -3957,8 +4187,8 @@
                                                                bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -3992,7 +4222,8 @@
       __ cmppsle(left, right);
       break;
 
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4001,8 +4232,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -4023,7 +4254,8 @@
     case MethodRecognizer::kFloat32x4Max:
       __ maxps(left, right);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4032,8 +4264,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -4053,7 +4285,8 @@
       __ shufps(left, left, Immediate(0x00));
       __ mulps(left, right);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4062,8 +4295,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -4085,7 +4318,8 @@
     case MethodRecognizer::kFloat32x4ReciprocalSqrt:
       __ rsqrtps(left);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4094,8 +4328,8 @@
                                                             bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -4113,7 +4347,8 @@
     case MethodRecognizer::kFloat32x4Absolute:
       __ absps(left);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4122,8 +4357,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 3;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_in(2, Location::RequiresFpuRegister());
@@ -4146,8 +4381,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -4206,7 +4441,8 @@
       __ movups(replacement, Address(RSP, 0));
       __ AddImmediate(RSP, Immediate(16));
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4215,8 +4451,8 @@
                                                               bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -4232,8 +4468,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -4251,7 +4487,8 @@
     case MethodRecognizer::kFloat64x2GetY:
       __ shufpd(value, value, Immediate(0x33));
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4260,8 +4497,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 0;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_out(0, Location::RequiresFpuRegister());
   return summary;
 }
@@ -4277,8 +4514,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -4292,11 +4529,12 @@
 
 
 LocationSummary* Float64x2ConstructorInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -4316,11 +4554,12 @@
 
 
 LocationSummary* Float64x2ToFloat32x4Instr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -4334,11 +4573,12 @@
 
 
 LocationSummary* Float32x4ToFloat64x2Instr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -4355,8 +4595,8 @@
                                                             bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   if (representation() == kTagged) {
     ASSERT(op_kind() == MethodRecognizer::kFloat64x2GetSignMask);
@@ -4389,7 +4629,8 @@
       __ movmskpd(locs()->out(0).reg(), left);
       __ SmiTag(locs()->out(0).reg());
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4398,8 +4639,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -4443,17 +4684,18 @@
     case MethodRecognizer::kFloat64x2Max:
       __ maxpd(left, right);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
 
-LocationSummary* Int32x4ConstructorInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+LocationSummary* Int32x4ConstructorInstr::MakeLocationSummary(Zone* zone,
+                                                              bool opt) const {
   const intptr_t kNumInputs = 4;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   summary->set_in(2, Location::RequiresRegister());
@@ -4480,11 +4722,12 @@
 
 
 LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumInputs = 4;
   const intptr_t kNumTemps = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   summary->set_in(2, Location::RequiresRegister());
@@ -4553,8 +4796,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::RequiresRegister());
   return summary;
@@ -4582,7 +4825,8 @@
     case MethodRecognizer::kInt32x4GetFlagW:
       __ movl(result, Address(RSP, 12));
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
   __ AddImmediate(RSP, Immediate(16));
   __ testl(result, result);
@@ -4599,8 +4843,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 3;
   const intptr_t kNumTemps = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_in(2, Location::RequiresFpuRegister());
@@ -4634,8 +4878,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresRegister());
   summary->set_temp(0, Location::RequiresRegister());
@@ -4663,7 +4907,7 @@
       __ Bind(&falsePath);
       __ LoadImmediate(temp, Immediate(0x0));
       __ movl(Address(RSP, 0), temp);
-    break;
+      break;
     case MethodRecognizer::kInt32x4WithFlagY:
       __ LoadImmediate(temp, Immediate(0xFFFFFFFF));
       __ movl(Address(RSP, 4), temp);
@@ -4671,7 +4915,7 @@
       __ Bind(&falsePath);
       __ LoadImmediate(temp, Immediate(0x0));
       __ movl(Address(RSP, 4), temp);
-    break;
+      break;
     case MethodRecognizer::kInt32x4WithFlagZ:
       __ LoadImmediate(temp, Immediate(0xFFFFFFFF));
       __ movl(Address(RSP, 8), temp);
@@ -4679,7 +4923,7 @@
       __ Bind(&falsePath);
       __ LoadImmediate(temp, Immediate(0x0));
       __ movl(Address(RSP, 8), temp);
-    break;
+      break;
     case MethodRecognizer::kInt32x4WithFlagW:
       __ LoadImmediate(temp, Immediate(0xFFFFFFFF));
       __ movl(Address(RSP, 12), temp);
@@ -4687,8 +4931,9 @@
       __ Bind(&falsePath);
       __ LoadImmediate(temp, Immediate(0x0));
       __ movl(Address(RSP, 12), temp);
-    break;
-    default: UNREACHABLE();
+      break;
+    default:
+      UNREACHABLE();
   }
   __ Bind(&exitPath);
   // Copy mask back to register.
@@ -4701,8 +4946,8 @@
                                                               bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -4718,8 +4963,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_in(1, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -4750,7 +4995,8 @@
     case Token::kSUB:
       __ subpl(left, right);
       break;
-    default: UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
 }
 
@@ -4761,8 +5007,8 @@
          (kind() == MathUnaryInstr::kDoubleSquare));
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   if (kind() == MathUnaryInstr::kDoubleSquare) {
     summary->set_out(0, Location::SameAsFirstInput());
@@ -4787,10 +5033,11 @@
 
 
 LocationSummary* CaseInsensitiveCompareUC16Instr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, InputCount(), kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, InputCount(), kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(CallingConventions::kArg1Reg));
   summary->set_in(1, Location::RegisterLocation(CallingConventions::kArg2Reg));
   summary->set_in(2, Location::RegisterLocation(CallingConventions::kArg3Reg));
@@ -4802,7 +5049,6 @@
 
 void CaseInsensitiveCompareUC16Instr::EmitNativeCode(
     FlowGraphCompiler* compiler) {
-
   // Save RSP. R13 is chosen because it is callee saved so we do not need to
   // back it up before calling into the runtime.
   static const Register kSavedSPReg = R13;
@@ -4820,9 +5066,7 @@
 LocationSummary* UnarySmiOpInstr::MakeLocationSummary(Zone* zone,
                                                       bool opt) const {
   const intptr_t kNumInputs = 1;
-  return LocationSummary::Make(zone,
-                               kNumInputs,
-                               Location::SameAsFirstInput(),
+  return LocationSummary::Make(zone, kNumInputs, Location::SameAsFirstInput(),
                                LocationSummary::kNoCall);
 }
 
@@ -4852,8 +5096,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresFpuRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -4872,8 +5116,8 @@
   if (result_cid() == kDoubleCid) {
     const intptr_t kNumInputs = 2;
     const intptr_t kNumTemps = 1;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     summary->set_in(0, Location::RequiresFpuRegister());
     summary->set_in(1, Location::RequiresFpuRegister());
     // Reuse the left register so that code can be made shorter.
@@ -4884,8 +5128,8 @@
   ASSERT(result_cid() == kSmiCid);
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   // Reuse the left register so that code can be made shorter.
@@ -4958,11 +5202,11 @@
 
 
 LocationSummary* Int32ToDoubleInstr::MakeLocationSummary(Zone* zone,
-                                                       bool opt) const {
+                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::RequiresRegister());
   result->set_out(0, Location::RequiresFpuRegister());
   return result;
@@ -4980,8 +5224,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::WritableRegister());
   result->set_out(0, Location::RequiresFpuRegister());
   return result;
@@ -5012,8 +5256,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   result->set_in(0, Location::RegisterLocation(RCX));
   result->set_out(0, Location::RegisterLocation(RAX));
   result->set_temp(0, Location::RegisterLocation(RBX));
@@ -5047,13 +5291,10 @@
 
   const intptr_t kNumberOfArguments = 1;
   __ pushq(value_obj);
-  compiler->GenerateStaticCall(deopt_id(),
-                               instance_call()->token_pos(),
-                               target,
+  compiler->GenerateStaticCall(deopt_id(), instance_call()->token_pos(), target,
                                kNumberOfArguments,
                                Object::null_array(),  // No argument names.
-                               locs(),
-                               ICData::Handle());
+                               locs(), ICData::Handle());
   __ Bind(&done);
 }
 
@@ -5062,8 +5303,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::RequiresFpuRegister());
   result->set_out(0, Location::RequiresRegister());
   result->set_temp(0, Location::RequiresRegister());
@@ -5092,8 +5333,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::RequiresFpuRegister());
   result->set_out(0, Location::RequiresFpuRegister());
   return result;
@@ -5105,13 +5346,13 @@
   XmmRegister result = locs()->out(0).fpu_reg();
   switch (recognized_kind()) {
     case MethodRecognizer::kDoubleTruncate:
-      __ roundsd(result, value,  Assembler::kRoundToZero);
+      __ roundsd(result, value, Assembler::kRoundToZero);
       break;
     case MethodRecognizer::kDoubleFloor:
-      __ roundsd(result, value,  Assembler::kRoundDown);
+      __ roundsd(result, value, Assembler::kRoundDown);
       break;
     case MethodRecognizer::kDoubleCeil:
-      __ roundsd(result, value,  Assembler::kRoundUp);
+      __ roundsd(result, value, Assembler::kRoundUp);
       break;
     default:
       UNREACHABLE();
@@ -5123,8 +5364,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::RequiresFpuRegister());
   result->set_out(0, Location::SameAsFirstInput());
   return result;
@@ -5140,8 +5381,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   result->set_in(0, Location::RequiresFpuRegister());
   result->set_out(0, Location::SameAsFirstInput());
   return result;
@@ -5163,8 +5404,8 @@
   ASSERT((InputCount() == 1) || (InputCount() == 2));
   const intptr_t kNumTemps =
       (recognized_kind() == MethodRecognizer::kMathDoublePow) ? 3 : 1;
-  LocationSummary* result = new(zone) LocationSummary(
-      zone, InputCount(), kNumTemps, LocationSummary::kCall);
+  LocationSummary* result = new (zone)
+      LocationSummary(zone, InputCount(), kNumTemps, LocationSummary::kCall);
   ASSERT(R13 != CALLEE_SAVED_TEMP);
   ASSERT(((1 << R13) & CallingConventions::kCalleeSaveCpuRegisters) != 0);
   result->set_temp(0, Location::RegisterLocation(R13));
@@ -5208,8 +5449,7 @@
   XmmRegister base = locs->in(0).fpu_reg();
   XmmRegister exp = locs->in(1).fpu_reg();
   XmmRegister result = locs->out(0).fpu_reg();
-  Register temp =
-      locs->temp(InvokeMathCFunctionInstr::kObjectTempIndex).reg();
+  Register temp = locs->temp(InvokeMathCFunctionInstr::kObjectTempIndex).reg();
   XmmRegister zero_temp =
       locs->temp(InvokeMathCFunctionInstr::kDoubleTempIndex).fpu_reg();
 
@@ -5278,8 +5518,7 @@
   Label do_pow, return_zero;
   __ Bind(&try_sqrt);
   // Before calling pow, check if we could use sqrt instead of pow.
-  __ LoadObject(temp,
-      Double::ZoneHandle(Double::NewCanonical(kNegInfinity)));
+  __ LoadObject(temp, Double::ZoneHandle(Double::NewCanonical(kNegInfinity)));
   __ movsd(result, FieldAddress(temp, Double::value_offset()));
   // base == -Infinity -> call pow;
   __ comisd(base, result);
@@ -5343,27 +5582,27 @@
   // Only use this instruction in optimized code.
   ASSERT(opt);
   const intptr_t kNumInputs = 1;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, 0, LocationSummary::kNoCall);
+  LocationSummary* summary =
+      new (zone) LocationSummary(zone, kNumInputs, 0, LocationSummary::kNoCall);
   if (representation() == kUnboxedDouble) {
     if (index() == 0) {
-      summary->set_in(0, Location::Pair(Location::RequiresFpuRegister(),
-                                        Location::Any()));
+      summary->set_in(
+          0, Location::Pair(Location::RequiresFpuRegister(), Location::Any()));
     } else {
       ASSERT(index() == 1);
-      summary->set_in(0, Location::Pair(Location::Any(),
-                                        Location::RequiresFpuRegister()));
+      summary->set_in(
+          0, Location::Pair(Location::Any(), Location::RequiresFpuRegister()));
     }
     summary->set_out(0, Location::RequiresFpuRegister());
   } else {
     ASSERT(representation() == kTagged);
     if (index() == 0) {
-      summary->set_in(0, Location::Pair(Location::RequiresRegister(),
-                                        Location::Any()));
+      summary->set_in(
+          0, Location::Pair(Location::RequiresRegister(), Location::Any()));
     } else {
       ASSERT(index() == 1);
-      summary->set_in(0, Location::Pair(Location::Any(),
-                                        Location::RequiresRegister()));
+      summary->set_in(
+          0, Location::Pair(Location::Any(), Location::RequiresRegister()));
     }
     summary->set_out(0, Location::RequiresRegister());
   }
@@ -5393,8 +5632,8 @@
   if (kind() == MergedMathInstr::kTruncDivMod) {
     const intptr_t kNumInputs = 2;
     const intptr_t kNumTemps = 0;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
     // Both inputs must be writable because they will be untagged.
     summary->set_in(0, Location::RegisterLocation(RAX));
     summary->set_in(1, Location::WritableRegister());
@@ -5405,8 +5644,8 @@
   if (kind() == MergedMathInstr::kSinCos) {
     const intptr_t kNumInputs = 1;
     const intptr_t kNumTemps = 1;
-    LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+    LocationSummary* summary = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
     // Because we always call into the runtime (LocationSummary::kCall) we
     // must specify each input, temp, and output register explicitly.
     summary->set_in(0, Location::FpuRegisterLocation(XMM1));
@@ -5422,18 +5661,20 @@
 }
 
 
-
-typedef void (*SinCosCFunction) (double x, double* res_sin, double* res_cos);
+typedef void (*SinCosCFunction)(double x, double* res_sin, double* res_cos);
 
 extern const RuntimeEntry kSinCosRuntimeEntry(
-    "libc_sincos", reinterpret_cast<RuntimeFunction>(
-        static_cast<SinCosCFunction>(&SinCos)), 1, true, true);
+    "libc_sincos",
+    reinterpret_cast<RuntimeFunction>(static_cast<SinCosCFunction>(&SinCos)),
+    1,
+    true,
+    true);
 
 
 void MergedMathInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Label* deopt = NULL;
   if (CanDeoptimize()) {
-    deopt  = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinarySmiOp);
+    deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinarySmiOp);
   }
   if (kind() == MergedMathInstr::kTruncDivMod) {
     Register left = locs()->in(0).reg();
@@ -5479,7 +5720,7 @@
     __ Bind(&not_32bit);
     __ SmiUntag(left);
     __ SmiUntag(right);
-    __ cqo();  // Sign extend RAX -> RDX:RAX.
+    __ cqo();         // Sign extend RAX -> RDX:RAX.
     __ idivq(right);  //  RAX: quotient, RDX: remainder.
     // Check the corner case of dividing the 'MIN_SMI' with -1, in which
     // case we cannot tag the result.
@@ -5552,7 +5793,7 @@
 
     __ CallRuntime(kSinCosRuntimeEntry, InputCount());
     __ movsd(out2, Address(RSP, 2 * kWordSize + kDoubleSize * 2));  // sin.
-    __ movsd(out1, Address(RSP, 2 * kWordSize + kDoubleSize));  // cos.
+    __ movsd(out1, Address(RSP, 2 * kWordSize + kDoubleSize));      // cos.
     // Restore RSP.
     __ movq(RSP, locs()->temp(0).reg());
 
@@ -5563,13 +5804,13 @@
 
 
 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+    Zone* zone,
+    bool opt) const {
   return MakeCallSummary(zone);
 }
 
 
-LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone,
-                                                  bool opt) const {
+LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone, bool opt) const {
   comparison()->InitializeLocationSummary(zone, opt);
   // Branches don't produce a result.
   comparison()->locs()->set_out(0, Location::NoLocation());
@@ -5587,8 +5828,8 @@
   const intptr_t kNumInputs = 1;
   const bool need_mask_temp = IsDenseSwitch() && !IsDenseMask(ComputeCidMask());
   const intptr_t kNumTemps = !IsNullCheck() ? (need_mask_temp ? 2 : 1) : 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   if (!IsNullCheck()) {
     summary->set_temp(0, Location::RequiresRegister());
@@ -5601,12 +5842,10 @@
 
 
 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  Label* deopt = compiler->AddDeoptStub(deopt_id(),
-                                        ICData::kDeoptCheckClass,
+  Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass,
                                         licm_hoisted_ ? ICData::kHoisted : 0);
   if (IsNullCheck()) {
-    __ CompareObject(locs()->in(0).reg(),
-                     Object::null_object());
+    __ CompareObject(locs()->in(0).reg(), Object::null_object());
     Condition cond = DeoptIfNull() ? EQUAL : NOT_EQUAL;
     __ j(cond, deopt);
     return;
@@ -5643,8 +5882,7 @@
     }
   } else {
     GrowableArray<CidTarget> sorted_ic_data;
-    FlowGraphCompiler::SortICDataByCount(unary_checks(),
-                                         &sorted_ic_data,
+    FlowGraphCompiler::SortICDataByCount(unary_checks(), &sorted_ic_data,
                                          /* drop_smi = */ true);
     const intptr_t num_checks = sorted_ic_data.length();
     const bool use_near_jump = num_checks < 5;
@@ -5670,8 +5908,8 @@
                                                     bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   return summary;
 }
@@ -5679,8 +5917,7 @@
 
 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Register value = locs()->in(0).reg();
-  Label* deopt = compiler->AddDeoptStub(deopt_id(),
-                                        ICData::kDeoptCheckSmi,
+  Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckSmi,
                                         licm_hoisted_ ? ICData::kHoisted : 0);
   __ BranchIfNotSmi(value, deopt);
 }
@@ -5690,8 +5927,8 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   return summary;
 }
@@ -5709,7 +5946,7 @@
                                                              bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
+  LocationSummary* locs = new (zone) LocationSummary(
       zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   locs->set_in(kLengthPos, Location::RequiresRegister());
   locs->set_in(kIndexPos, Location::RequiresRegister());
@@ -5720,7 +5957,7 @@
 class RangeErrorSlowPath : public SlowPathCode {
  public:
   RangeErrorSlowPath(GenericCheckBoundInstr* instruction, intptr_t try_index)
-      : instruction_(instruction), try_index_(try_index) { }
+      : instruction_(instruction), try_index_(try_index) {}
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     if (Assembler::EmittingComments()) {
@@ -5732,11 +5969,8 @@
     __ pushq(locs->in(1).reg());
     __ CallRuntime(kRangeErrorRuntimeEntry, 2);
     compiler->pc_descriptors_list()->AddDescriptor(
-        RawPcDescriptors::kOther,
-        compiler->assembler()->CodeSize(),
-        instruction_->deopt_id(),
-        instruction_->token_pos(),
-        try_index_);
+        RawPcDescriptors::kOther, compiler->assembler()->CodeSize(),
+        instruction_->deopt_id(), instruction_->token_pos(), try_index_);
     compiler->RecordSafepoint(locs, 2);
     __ int3();
   }
@@ -5769,8 +6003,8 @@
                                                            bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length()));
   locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index()));
   return locs;
@@ -5780,10 +6014,8 @@
 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   uint32_t flags = generalized_ ? ICData::kGeneralized : 0;
   flags |= licm_hoisted_ ? ICData::kHoisted : 0;
-  Label* deopt = compiler->AddDeoptStub(
-      deopt_id(),
-      ICData::kDeoptCheckArrayBound,
-      flags);
+  Label* deopt =
+      compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckArrayBound, flags);
 
   Location length_loc = locs()->in(kLengthPos);
   Location index_loc = locs()->in(kIndexPos);
@@ -5802,8 +6034,8 @@
   if (index_loc.IsConstant()) {
     Register length = length_loc.reg();
     const Smi& index = Smi::Cast(index_loc.constant());
-    __ CompareImmediate(
-        length, Immediate(reinterpret_cast<int64_t>(index.raw())));
+    __ CompareImmediate(length,
+                        Immediate(reinterpret_cast<int64_t>(index.raw())));
     __ j(BELOW_EQUAL, deopt);
   } else if (length_loc.IsConstant()) {
     const Smi& length = Smi::Cast(length_loc.constant());
@@ -5815,8 +6047,8 @@
       __ testq(index, index);
       __ j(NEGATIVE, deopt);
     } else {
-      __ CompareImmediate(
-          index, Immediate(reinterpret_cast<int64_t>(length.raw())));
+      __ CompareImmediate(index,
+                          Immediate(reinterpret_cast<int64_t>(length.raw())));
       __ j(ABOVE_EQUAL, deopt);
     }
   } else {
@@ -5831,7 +6063,7 @@
 }
 
 
-template<typename OperandType>
+template <typename OperandType>
 static void EmitInt64Arithmetic(FlowGraphCompiler* compiler,
                                 Token::Kind op_kind,
                                 Register left,
@@ -5867,8 +6099,8 @@
                                                         bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -5896,8 +6128,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -5916,8 +6148,8 @@
 static const intptr_t kMintShiftCountLimit = 63;
 
 bool ShiftMintOpInstr::has_shift_count_check() const {
-  return !RangeUtils::IsWithin(
-      right()->definition()->range(), 0, kMintShiftCountLimit);
+  return !RangeUtils::IsWithin(right()->definition()->range(), 0,
+                               kMintShiftCountLimit);
 }
 
 
@@ -5925,8 +6157,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = can_overflow() ? 1 : 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::FixedRegisterOrSmiConstant(right(), RCX));
   if (kNumTemps > 0) {
@@ -6028,8 +6260,8 @@
                                                           bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::RequiresRegister());
   summary->set_out(0, Location::SameAsFirstInput());
@@ -6037,7 +6269,7 @@
 }
 
 
-template<typename OperandType>
+template <typename OperandType>
 static void EmitIntegerArithmetic(FlowGraphCompiler* compiler,
                                   Token::Kind op_kind,
                                   Register left,
@@ -6093,8 +6325,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_in(1, Location::FixedRegisterOrSmiConstant(right(), RCX));
   summary->set_out(0, Location::SameAsFirstInput());
@@ -6123,10 +6355,10 @@
     switch (op_kind()) {
       case Token::kSHR:
         __ shrl(left, Immediate(shift_value));
-      break;
+        break;
       case Token::kSHL:
         __ shll(left, Immediate(shift_value));
-      break;
+        break;
       default:
         UNREACHABLE();
     }
@@ -6155,11 +6387,11 @@
     case Token::kSHR:
       __ shrl(left, shifter);
       __ jmp(&done);
-    break;
+      break;
     case Token::kSHL:
       __ shll(left, shifter);
       __ jmp(&done);
-    break;
+      break;
     default:
       UNREACHABLE();
   }
@@ -6177,8 +6409,8 @@
                                                          bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
   summary->set_out(0, Location::SameAsFirstInput());
   return summary;
@@ -6202,8 +6434,8 @@
                                                                bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   if (from() == kUnboxedMint) {
     ASSERT((to() == kUnboxedUint32) || (to() == kUnboxedInt32));
     summary->set_in(0, Location::RequiresRegister());
@@ -6277,42 +6509,33 @@
 }
 
 
-LocationSummary* ThrowInstr::MakeLocationSummary(Zone* zone,
-                                                 bool opt) const {
-  return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
+LocationSummary* ThrowInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+  return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
 }
 
 
 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kThrowRuntimeEntry,
-                                1,
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(), kThrowRuntimeEntry, 1,
                                 locs());
   __ int3();
 }
 
 
-LocationSummary* ReThrowInstr::MakeLocationSummary(Zone* zone,
-                                                   bool opt) const {
-  return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
+LocationSummary* ReThrowInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+  return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
 }
 
 
 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   compiler->SetNeedsStacktrace(catch_try_index());
-  compiler->GenerateRuntimeCall(token_pos(),
-                                deopt_id(),
-                                kReThrowRuntimeEntry,
-                                2,
-                                locs());
+  compiler->GenerateRuntimeCall(token_pos(), deopt_id(), kReThrowRuntimeEntry,
+                                2, locs());
   __ int3();
 }
 
 
-LocationSummary* StopInstr::MakeLocationSummary(Zone* zone,
-                                                bool opt) const {
-  return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
+LocationSummary* StopInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+  return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
 }
 
 
@@ -6328,9 +6551,8 @@
 }
 
 
-LocationSummary* GotoInstr::MakeLocationSummary(Zone* zone,
-                                                bool opt) const {
-  return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
+LocationSummary* GotoInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+  return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
 }
 
 
@@ -6341,8 +6563,7 @@
     }
     // Add a deoptimization descriptor for deoptimizing instructions that
     // may be inserted before this instruction.
-    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                                   GetDeoptId(),
+    compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, GetDeoptId(),
                                    TokenPosition::kNoSource);
   }
   if (HasParallelMove()) {
@@ -6362,8 +6583,8 @@
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 1;
 
-  LocationSummary* summary = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
 
   summary->set_in(0, Location::RequiresRegister());
   summary->set_temp(0, Location::RequiresRegister());
@@ -6378,8 +6599,7 @@
 
   {
     const intptr_t kRIPRelativeLeaqSize = 7;
-    const intptr_t entry_to_rip_offset =
-        __ CodeSize() + kRIPRelativeLeaqSize;
+    const intptr_t entry_to_rip_offset = __ CodeSize() + kRIPRelativeLeaqSize;
     __ leaq(target_address_reg,
             Address::AddressRIPRelative(-entry_to_rip_offset));
     ASSERT(__ CodeSize() == entry_to_rip_offset);
@@ -6402,15 +6622,15 @@
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
   if (needs_number_check()) {
-    LocationSummary* locs = new(zone) LocationSummary(
-        zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+    LocationSummary* locs = new (zone)
+        LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
     locs->set_in(0, Location::RegisterLocation(RAX));
     locs->set_in(1, Location::RegisterLocation(RCX));
     locs->set_out(0, Location::RegisterLocation(RAX));
     return locs;
   }
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RegisterOrConstant(left()));
   // Only one of the inputs can be a constant. Choose register if the first one
   // is a constant.
@@ -6429,20 +6649,14 @@
   ASSERT(!left.IsConstant() || !right.IsConstant());
   Condition true_condition;
   if (left.IsConstant()) {
-    true_condition = compiler->EmitEqualityRegConstCompare(right.reg(),
-                                                           left.constant(),
-                                                           needs_number_check(),
-                                                           token_pos());
+    true_condition = compiler->EmitEqualityRegConstCompare(
+        right.reg(), left.constant(), needs_number_check(), token_pos());
   } else if (right.IsConstant()) {
-    true_condition = compiler->EmitEqualityRegConstCompare(left.reg(),
-                                                           right.constant(),
-                                                           needs_number_check(),
-                                                           token_pos());
+    true_condition = compiler->EmitEqualityRegConstCompare(
+        left.reg(), right.constant(), needs_number_check(), token_pos());
   } else {
-    true_condition = compiler->EmitEqualityRegRegCompare(left.reg(),
-                                                         right.reg(),
-                                                         needs_number_check(),
-                                                         token_pos());
+    true_condition = compiler->EmitEqualityRegRegCompare(
+        left.reg(), right.reg(), needs_number_check(), token_pos());
   }
   if (kind() != Token::kEQ_STRICT) {
     ASSERT(kind() == Token::kNE_STRICT);
@@ -6456,7 +6670,7 @@
   ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT);
 
   Label is_true, is_false;
-  BranchLabels labels = { &is_true, &is_false, &is_false };
+  BranchLabels labels = {&is_true, &is_false, &is_false};
 
   Condition true_condition = EmitComparisonCode(compiler, labels);
   EmitBranchOnCondition(compiler, true_condition, labels);
@@ -6486,8 +6700,8 @@
                                                        bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* summary = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(RAX));  // Function.
   summary->set_out(0, Location::RegisterLocation(RAX));
   return summary;
@@ -6497,9 +6711,8 @@
 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   // Arguments descriptor is expected in R10.
   intptr_t argument_count = ArgumentCount();
-  const Array& arguments_descriptor =
-      Array::ZoneHandle(ArgumentsDescriptor::New(argument_count,
-                                                 argument_names()));
+  const Array& arguments_descriptor = Array::ZoneHandle(
+      ArgumentsDescriptor::New(argument_count, argument_names()));
   __ LoadObject(R10, arguments_descriptor);
 
   // Function in RAX.
@@ -6522,8 +6735,7 @@
   // Add deoptimization continuation point after the call and before the
   // arguments are removed.
   // In optimized code this descriptor is needed for exception handling.
-  compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
-                                 deopt_id_after,
+  compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after,
                                  token_pos());
   __ Drop(argument_count);
 }
@@ -6531,9 +6743,7 @@
 
 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Zone* zone,
                                                          bool opt) const {
-  return LocationSummary::Make(zone,
-                               1,
-                               Location::RequiresRegister(),
+  return LocationSummary::Make(zone, 1, Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
@@ -6561,9 +6771,7 @@
   const Code& stub = Code::ZoneHandle(
       compiler->zone(), StubCode::GetAllocationStubForClass(cls()));
   const StubEntry stub_entry(stub);
-  compiler->GenerateCall(token_pos(),
-                         stub_entry,
-                         RawPcDescriptors::kOther,
+  compiler->GenerateCall(token_pos(), stub_entry, RawPcDescriptors::kOther,
                          locs());
   compiler->AddStubCallTarget(stub);
   __ Drop(ArgumentCount());  // Discard arguments.
@@ -6578,12 +6786,12 @@
 }
 
 
-LocationSummary* GrowRegExpStackInstr::MakeLocationSummary(
-    Zone* zone, bool opt) const {
+LocationSummary* GrowRegExpStackInstr::MakeLocationSummary(Zone* zone,
+                                                           bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
-  LocationSummary* locs = new(zone) LocationSummary(
-      zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+  LocationSummary* locs = new (zone)
+      LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(RAX));
   locs->set_out(0, Location::RegisterLocation(RAX));
   return locs;
@@ -6595,11 +6803,8 @@
   const Register result = locs()->out(0).reg();
   __ PushObject(Object::null_object());
   __ pushq(typed_data);
-  compiler->GenerateRuntimeCall(TokenPosition::kNoSource,
-                                deopt_id(),
-                                kGrowRegExpStackRuntimeEntry,
-                                1,
-                                locs());
+  compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(),
+                                kGrowRegExpStackRuntimeEntry, 1, locs());
   __ Drop(1);
   __ popq(result);
 }
diff --git a/runtime/vm/intrinsifier.cc b/runtime/vm/intrinsifier.cc
index e0355c9..26573ce 100644
--- a/runtime/vm/intrinsifier.cc
+++ b/runtime/vm/intrinsifier.cc
@@ -58,7 +58,7 @@
 }
 
 
-#if defined(DART_NO_SNAPSHOT)
+#if !defined(DART_PRECOMPILED_RUNTIME)
 void Intrinsifier::InitializeState() {
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
@@ -82,7 +82,7 @@
     }                                                                          \
     ASSERT(error.IsNull());                                                    \
     if (#function_name[0] == '.') {                                            \
-      str = String::New(#class_name#function_name);                            \
+      str = String::New(#class_name #function_name);                           \
     } else {                                                                   \
       str = String::New(#function_name);                                       \
     }                                                                          \
@@ -117,13 +117,12 @@
 
 #undef SETUP_FUNCTION
 }
-#endif  // defined(DART_NO_SNAPSHOT).
+#endif  // !defined(DART_PRECOMPILED_RUNTIME)
 
 
 // DBC does not use graph intrinsics.
 #if !defined(TARGET_ARCH_DBC)
-static void EmitCodeFor(FlowGraphCompiler* compiler,
-                        FlowGraph* graph) {
+static void EmitCodeFor(FlowGraphCompiler* compiler, FlowGraph* graph) {
   // The FlowGraph here is constructed by the intrinsics builder methods, and
   // is different from compiler->flow_graph(), the original method's flow graph.
   compiler->assembler()->Comment("Graph intrinsic begin");
@@ -165,24 +164,22 @@
 #if !defined(TARGET_ARCH_DBC)
   ZoneGrowableArray<const ICData*>* ic_data_array =
       new ZoneGrowableArray<const ICData*>();
-  FlowGraphBuilder builder(parsed_function,
-                           *ic_data_array,
+  FlowGraphBuilder builder(parsed_function, *ic_data_array,
                            NULL,  // NULL = not inlining.
                            Compiler::kNoOSRDeoptId);
 
   intptr_t block_id = builder.AllocateBlockId();
   TargetEntryInstr* normal_entry =
-      new TargetEntryInstr(block_id,
-                           CatchClauseNode::kInvalidTryIndex);
+      new TargetEntryInstr(block_id, CatchClauseNode::kInvalidTryIndex);
   GraphEntryInstr* graph_entry = new GraphEntryInstr(
       parsed_function, normal_entry, Compiler::kNoOSRDeoptId);
   FlowGraph* graph = new FlowGraph(parsed_function, graph_entry, block_id);
   const Function& function = parsed_function.function();
   switch (function.recognized_kind()) {
 #define EMIT_CASE(class_name, function_name, enum_name, type, fp)              \
-    case MethodRecognizer::k##enum_name:                                       \
-      if (!Build_##enum_name(graph)) return false;                             \
-      break;
+  case MethodRecognizer::k##enum_name:                                         \
+    if (!Build_##enum_name(graph)) return false;                               \
+    break;
 
     GRAPH_INTRINSICS_LIST(EMIT_CASE);
     default:
@@ -190,8 +187,8 @@
 #undef EMIT_CASE
   }
 
-  if (FLAG_support_il_printer &&
-      FLAG_print_flow_graph && FlowGraphPrinter::ShouldPrint(function)) {
+  if (FLAG_support_il_printer && FLAG_print_flow_graph &&
+      FlowGraphPrinter::ShouldPrint(function)) {
     THR_Print("Intrinsic graph before\n");
     FlowGraphPrinter printer(*graph);
     printer.PrintBlocks();
@@ -201,8 +198,8 @@
   FlowGraphAllocator allocator(*graph, true);  // Intrinsic mode.
   allocator.AllocateRegisters();
 
-  if (FLAG_support_il_printer &&
-      FLAG_print_flow_graph && FlowGraphPrinter::ShouldPrint(function)) {
+  if (FLAG_support_il_printer && FLAG_print_flow_graph &&
+      FlowGraphPrinter::ShouldPrint(function)) {
     THR_Print("Intrinsic graph after\n");
     FlowGraphPrinter printer(*graph);
     printer.PrintBlocks();
@@ -229,10 +226,10 @@
   }
 
 #define EMIT_CASE(class_name, function_name, enum_name, type, fp)              \
-    case MethodRecognizer::k##enum_name:                                       \
-      compiler->assembler()->Comment("Intrinsic");                             \
-      enum_name(compiler->assembler());                                        \
-      break;
+  case MethodRecognizer::k##enum_name:                                         \
+    compiler->assembler()->Comment("Intrinsic");                               \
+    enum_name(compiler->assembler());                                          \
+    break;
 
   switch (function.recognized_kind()) {
     ALL_INTRINSICS_NO_INTEGER_LIB_LIST(EMIT_CASE);
@@ -245,8 +242,8 @@
       break;
   }
 
-  // On DBC all graph intrinsics are handled in the same way as non-graph
-  // intrinsics.
+// On DBC all graph intrinsics are handled in the same way as non-graph
+// intrinsics.
 #if defined(TARGET_ARCH_DBC)
   switch (function.recognized_kind()) {
     GRAPH_INTRINSICS_LIST(EMIT_CASE)
@@ -288,7 +285,7 @@
 class BlockBuilder : public ValueObject {
  public:
   BlockBuilder(FlowGraph* flow_graph, TargetEntryInstr* entry)
-      : flow_graph_(flow_graph), entry_(entry), current_(entry) { }
+      : flow_graph_(flow_graph), entry_(entry), current_(entry) {}
 
   Definition* AddToInitialDefinitions(Definition* def) {
     def->set_ssa_temp_index(flow_graph_->alloc_ssa_temp_index());
@@ -315,26 +312,19 @@
 
   Definition* AddParameter(intptr_t index) {
     intptr_t adjustment = Intrinsifier::ParameterSlotFromSp();
-    return AddToInitialDefinitions(
-      new ParameterInstr(adjustment + index,
-                         flow_graph_->graph_entry(),
-                         SPREG));
+    return AddToInitialDefinitions(new ParameterInstr(
+        adjustment + index, flow_graph_->graph_entry(), SPREG));
   }
 
-  TokenPosition TokenPos() {
-    return flow_graph_->function().token_pos();
-  }
+  TokenPosition TokenPos() { return flow_graph_->function().token_pos(); }
 
   Definition* AddNullDefinition() {
-    return AddDefinition(
-        new ConstantInstr(Object::ZoneHandle(Object::null())));
+    return AddDefinition(new ConstantInstr(Object::ZoneHandle(Object::null())));
   }
 
-  Definition* AddUnboxInstr(Representation rep,
-                            Value* value,
-                            bool is_checked) {
-    Definition* unboxed_value = AddDefinition(
-        UnboxInstr::Create(rep, value, Thread::kNoDeoptId));
+  Definition* AddUnboxInstr(Representation rep, Value* value, bool is_checked) {
+    Definition* unboxed_value =
+        AddDefinition(UnboxInstr::Create(rep, value, Thread::kNoDeoptId));
     if (is_checked) {
       // The type of |value| has already been checked and it is safe to
       // adjust reaching type. This is done manually because there is no type
@@ -360,9 +350,7 @@
   Definition* InvokeMathCFunctionHelper(MethodRecognizer::Kind recognized_kind,
                                         ZoneGrowableArray<Value*>* args) {
     InvokeMathCFunctionInstr* invoke_math_c_function =
-        new InvokeMathCFunctionInstr(args,
-                                     Thread::kNoDeoptId,
-                                     recognized_kind,
+        new InvokeMathCFunctionInstr(args, Thread::kNoDeoptId, recognized_kind,
                                      TokenPos());
     AddDefinition(invoke_math_c_function);
     return invoke_math_c_function;
@@ -379,15 +367,11 @@
                              Definition* array,
                              Definition* index,
                              intptr_t length_offset) {
-  Definition* length = builder->AddDefinition(
-      new LoadFieldInstr(new Value(array),
-                         length_offset,
-                         Type::ZoneHandle(Type::SmiType()),
-                         TokenPosition::kNoSource));
-  builder->AddInstruction(
-      new CheckArrayBoundInstr(new Value(length),
-                               new Value(index),
-                               Thread::kNoDeoptId));
+  Definition* length = builder->AddDefinition(new LoadFieldInstr(
+      new Value(array), length_offset, Type::ZoneHandle(Type::SmiType()),
+      TokenPosition::kNoSource));
+  builder->AddInstruction(new CheckArrayBoundInstr(
+      new Value(length), new Value(index), Thread::kNoDeoptId));
 }
 
 static bool IntrinsifyArrayGetIndexed(FlowGraph* flow_graph,
@@ -409,18 +393,14 @@
   PrepareIndexedOp(&builder, array, index, length_offset);
 
   if (RawObject::IsExternalTypedDataClassId(array_cid)) {
-    array = builder.AddDefinition(
-      new LoadUntaggedInstr(new Value(array),
-                            ExternalTypedData::data_offset()));
+    array = builder.AddDefinition(new LoadUntaggedInstr(
+        new Value(array), ExternalTypedData::data_offset()));
   }
 
-  Definition* result = builder.AddDefinition(
-      new LoadIndexedInstr(new Value(array),
-                           new Value(index),
-                           Instance::ElementSizeFor(array_cid),  // index scale
-                           array_cid,
-                           Thread::kNoDeoptId,
-                           builder.TokenPos()));
+  Definition* result = builder.AddDefinition(new LoadIndexedInstr(
+      new Value(array), new Value(index),
+      Instance::ElementSizeFor(array_cid),  // index scale
+      array_cid, kAlignedAccess, Thread::kNoDeoptId, builder.TokenPos()));
   // Box and/or convert result if necessary.
   switch (array_cid) {
     case kTypedDataInt32ArrayCid:
@@ -436,7 +416,7 @@
     case kTypedDataFloat32ArrayCid:
       result = builder.AddDefinition(
           new FloatToDoubleInstr(new Value(result), Thread::kNoDeoptId));
-      // Fall through.
+    // Fall through.
     case kTypedDataFloat64ArrayCid:
       result = builder.AddDefinition(
           BoxInstr::Create(kUnboxedDouble, new Value(result)));
@@ -501,19 +481,17 @@
     case kExternalTypedDataUint8ClampedArrayCid:
     case kTypedDataInt16ArrayCid:
     case kTypedDataUint16ArrayCid:
-      builder.AddInstruction(new CheckSmiInstr(new Value(value),
-                                               Thread::kNoDeoptId,
-                                               builder.TokenPos()));
+      builder.AddInstruction(new CheckSmiInstr(
+          new Value(value), Thread::kNoDeoptId, builder.TokenPos()));
       break;
     case kTypedDataInt32ArrayCid:
     case kExternalTypedDataInt32ArrayCid:
-      // Use same truncating unbox-instruction for int32 and uint32.
-      // Fall-through.
+    // Use same truncating unbox-instruction for int32 and uint32.
+    // Fall-through.
     case kTypedDataUint32ArrayCid:
     case kExternalTypedDataUint32ArrayCid:
       // Supports smi and mint, slow-case for bigints.
-      value = builder.AddUnboxInstr(kUnboxedUint32,
-                                    new Value(value),
+      value = builder.AddUnboxInstr(kUnboxedUint32, new Value(value),
                                     /* is_checked = */ false);
       break;
     case kTypedDataFloat32ArrayCid:
@@ -540,21 +518,16 @@
           // Float32/Float64 case already handled.
           break;
       }
-      const ICData& value_check = ICData::ZoneHandle(ICData::New(
-          flow_graph->function(),
-          Symbols::Empty(),  // Dummy function name.
-          Object::empty_array(),  // Dummy args. descr.
-          Thread::kNoDeoptId,
-          1,
-          false));
+      const ICData& value_check = ICData::ZoneHandle(
+          ICData::New(flow_graph->function(),
+                      Symbols::Empty(),       // Dummy function name.
+                      Object::empty_array(),  // Dummy args. descr.
+                      Thread::kNoDeoptId, 1, false));
       value_check.AddReceiverCheck(value_check_cid, flow_graph->function());
       builder.AddInstruction(
-          new CheckClassInstr(new Value(value),
-                              Thread::kNoDeoptId,
-                              value_check,
+          new CheckClassInstr(new Value(value), Thread::kNoDeoptId, value_check,
                               builder.TokenPos()));
-      value = builder.AddUnboxInstr(rep,
-                                    new Value(value),
+      value = builder.AddUnboxInstr(rep, new Value(value),
                                     /* is_checked = */ true);
       if (array_cid == kTypedDataFloat32ArrayCid) {
         value = builder.AddDefinition(
@@ -567,22 +540,16 @@
   }
 
   if (RawObject::IsExternalTypedDataClassId(array_cid)) {
-    array = builder.AddDefinition(
-      new LoadUntaggedInstr(new Value(array),
-                            ExternalTypedData::data_offset()));
+    array = builder.AddDefinition(new LoadUntaggedInstr(
+        new Value(array), ExternalTypedData::data_offset()));
   }
   // No store barrier.
   ASSERT(RawObject::IsExternalTypedDataClassId(array_cid) ||
          RawObject::IsTypedDataClassId(array_cid));
-  builder.AddInstruction(
-      new StoreIndexedInstr(new Value(array),
-                            new Value(index),
-                            new Value(value),
-                            kNoStoreBarrier,
-                            Instance::ElementSizeFor(array_cid),  // index scale
-                            array_cid,
-                            Thread::kNoDeoptId,
-                            builder.TokenPos()));
+  builder.AddInstruction(new StoreIndexedInstr(
+      new Value(array), new Value(index), new Value(value), kNoStoreBarrier,
+      Instance::ElementSizeFor(array_cid),  // index scale
+      array_cid, kAlignedAccess, Thread::kNoDeoptId, builder.TokenPos()));
   // Return null.
   Definition* null_def = builder.AddNullDefinition();
   builder.AddIntrinsicReturn(new Value(null_def));
@@ -591,28 +558,26 @@
 
 
 #define DEFINE_ARRAY_GETTER_INTRINSIC(enum_name)                               \
-bool Intrinsifier::Build_##enum_name##GetIndexed(FlowGraph* flow_graph) {      \
-  return IntrinsifyArrayGetIndexed(                                            \
-      flow_graph,                                                              \
-      MethodRecognizer::MethodKindToReceiverCid(                               \
-          MethodRecognizer::k##enum_name##GetIndexed));                        \
-}
+  bool Intrinsifier::Build_##enum_name##GetIndexed(FlowGraph* flow_graph) {    \
+    return IntrinsifyArrayGetIndexed(                                          \
+        flow_graph, MethodRecognizer::MethodKindToReceiverCid(                 \
+                        MethodRecognizer::k##enum_name##GetIndexed));          \
+  }
 
 
 #define DEFINE_ARRAY_SETTER_INTRINSIC(enum_name)                               \
-bool Intrinsifier::Build_##enum_name##SetIndexed(FlowGraph* flow_graph) {      \
-  return IntrinsifyArraySetIndexed(                                            \
-      flow_graph,                                                              \
-      MethodRecognizer::MethodKindToReceiverCid(                               \
-          MethodRecognizer::k##enum_name##SetIndexed));                        \
-}
+  bool Intrinsifier::Build_##enum_name##SetIndexed(FlowGraph* flow_graph) {    \
+    return IntrinsifyArraySetIndexed(                                          \
+        flow_graph, MethodRecognizer::MethodKindToReceiverCid(                 \
+                        MethodRecognizer::k##enum_name##SetIndexed));          \
+  }
 
 DEFINE_ARRAY_GETTER_INTRINSIC(ObjectArray)  // Setter in intrinsifier_<arch>.cc.
 DEFINE_ARRAY_GETTER_INTRINSIC(ImmutableArray)
 
 #define DEFINE_ARRAY_GETTER_SETTER_INTRINSICS(enum_name)                       \
-DEFINE_ARRAY_GETTER_INTRINSIC(enum_name)                                       \
-DEFINE_ARRAY_SETTER_INTRINSIC(enum_name)
+  DEFINE_ARRAY_GETTER_INTRINSIC(enum_name)                                     \
+  DEFINE_ARRAY_SETTER_INTRINSIC(enum_name)
 
 DEFINE_ARRAY_GETTER_SETTER_INTRINSICS(Int8Array)
 DEFINE_ARRAY_GETTER_SETTER_INTRINSICS(Uint8Array)
@@ -630,31 +595,29 @@
 
 
 #define DEFINE_FLOAT_ARRAY_GETTER_INTRINSIC(enum_name)                         \
-bool Intrinsifier::Build_##enum_name##GetIndexed(FlowGraph* flow_graph) {      \
-  if (!FlowGraphCompiler::SupportsUnboxedDoubles()) {                          \
-    return false;                                                              \
-  }                                                                            \
-  return IntrinsifyArrayGetIndexed(                                            \
-      flow_graph,                                                              \
-      MethodRecognizer::MethodKindToReceiverCid(                               \
-          MethodRecognizer::k##enum_name##GetIndexed));                        \
-}
+  bool Intrinsifier::Build_##enum_name##GetIndexed(FlowGraph* flow_graph) {    \
+    if (!FlowGraphCompiler::SupportsUnboxedDoubles()) {                        \
+      return false;                                                            \
+    }                                                                          \
+    return IntrinsifyArrayGetIndexed(                                          \
+        flow_graph, MethodRecognizer::MethodKindToReceiverCid(                 \
+                        MethodRecognizer::k##enum_name##GetIndexed));          \
+  }
 
 
 #define DEFINE_FLOAT_ARRAY_SETTER_INTRINSIC(enum_name)                         \
-bool Intrinsifier::Build_##enum_name##SetIndexed(FlowGraph* flow_graph) {      \
-  if (!FlowGraphCompiler::SupportsUnboxedDoubles()) {                          \
-    return false;                                                              \
-  }                                                                            \
-  return IntrinsifyArraySetIndexed(                                            \
-      flow_graph,                                                              \
-      MethodRecognizer::MethodKindToReceiverCid(                               \
-          MethodRecognizer::k##enum_name##SetIndexed));                        \
-}
+  bool Intrinsifier::Build_##enum_name##SetIndexed(FlowGraph* flow_graph) {    \
+    if (!FlowGraphCompiler::SupportsUnboxedDoubles()) {                        \
+      return false;                                                            \
+    }                                                                          \
+    return IntrinsifyArraySetIndexed(                                          \
+        flow_graph, MethodRecognizer::MethodKindToReceiverCid(                 \
+                        MethodRecognizer::k##enum_name##SetIndexed));          \
+  }
 
 #define DEFINE_FLOAT_ARRAY_GETTER_SETTER_INTRINSICS(enum_name)                 \
-DEFINE_FLOAT_ARRAY_GETTER_INTRINSIC(enum_name)                                 \
-DEFINE_FLOAT_ARRAY_SETTER_INTRINSIC(enum_name)
+  DEFINE_FLOAT_ARRAY_GETTER_INTRINSIC(enum_name)                               \
+  DEFINE_FLOAT_ARRAY_SETTER_INTRINSIC(enum_name)
 
 DEFINE_FLOAT_ARRAY_GETTER_SETTER_INTRINSICS(Float64Array)
 DEFINE_FLOAT_ARRAY_GETTER_SETTER_INTRINSICS(Float32Array)
@@ -665,31 +628,29 @@
 
 
 #define DEFINE_SIMD_ARRAY_GETTER_INTRINSIC(enum_name)                          \
-bool Intrinsifier::Build_##enum_name##GetIndexed(FlowGraph* flow_graph) {      \
-  if (!FlowGraphCompiler::SupportsUnboxedSimd128()) {                          \
-    return false;                                                              \
-  }                                                                            \
-  return IntrinsifyArrayGetIndexed(                                            \
-      flow_graph,                                                              \
-      MethodRecognizer::MethodKindToReceiverCid(                               \
-          MethodRecognizer::k##enum_name##GetIndexed));                        \
-}
+  bool Intrinsifier::Build_##enum_name##GetIndexed(FlowGraph* flow_graph) {    \
+    if (!FlowGraphCompiler::SupportsUnboxedSimd128()) {                        \
+      return false;                                                            \
+    }                                                                          \
+    return IntrinsifyArrayGetIndexed(                                          \
+        flow_graph, MethodRecognizer::MethodKindToReceiverCid(                 \
+                        MethodRecognizer::k##enum_name##GetIndexed));          \
+  }
 
 
 #define DEFINE_SIMD_ARRAY_SETTER_INTRINSIC(enum_name)                          \
-bool Intrinsifier::Build_##enum_name##SetIndexed(FlowGraph* flow_graph) {      \
-  if (!FlowGraphCompiler::SupportsUnboxedSimd128()) {                          \
-    return false;                                                              \
-  }                                                                            \
-  return IntrinsifyArraySetIndexed(                                            \
-      flow_graph,                                                              \
-      MethodRecognizer::MethodKindToReceiverCid(                               \
-          MethodRecognizer::k##enum_name##SetIndexed));                        \
-}
+  bool Intrinsifier::Build_##enum_name##SetIndexed(FlowGraph* flow_graph) {    \
+    if (!FlowGraphCompiler::SupportsUnboxedSimd128()) {                        \
+      return false;                                                            \
+    }                                                                          \
+    return IntrinsifyArraySetIndexed(                                          \
+        flow_graph, MethodRecognizer::MethodKindToReceiverCid(                 \
+                        MethodRecognizer::k##enum_name##SetIndexed));          \
+  }
 
-#define DEFINE_SIMD_ARRAY_GETTER_SETTER_INTRINSICS(enum_name)                 \
-DEFINE_SIMD_ARRAY_GETTER_INTRINSIC(enum_name)                                 \
-DEFINE_SIMD_ARRAY_SETTER_INTRINSIC(enum_name)
+#define DEFINE_SIMD_ARRAY_GETTER_SETTER_INTRINSICS(enum_name)                  \
+  DEFINE_SIMD_ARRAY_GETTER_INTRINSIC(enum_name)                                \
+  DEFINE_SIMD_ARRAY_SETTER_INTRINSIC(enum_name)
 
 DEFINE_SIMD_ARRAY_GETTER_SETTER_INTRINSICS(Float32x4Array)
 DEFINE_SIMD_ARRAY_GETTER_SETTER_INTRINSICS(Int32x4Array)
@@ -711,30 +672,20 @@
 
   // For external strings: Load external data.
   if (cid == kExternalOneByteStringCid) {
-    str = builder.AddDefinition(
-        new LoadUntaggedInstr(new Value(str),
-                              ExternalOneByteString::external_data_offset()));
-    str = builder.AddDefinition(
-        new LoadUntaggedInstr(
-            new Value(str),
-            RawExternalOneByteString::ExternalData::data_offset()));
+    str = builder.AddDefinition(new LoadUntaggedInstr(
+        new Value(str), ExternalOneByteString::external_data_offset()));
+    str = builder.AddDefinition(new LoadUntaggedInstr(
+        new Value(str), RawExternalOneByteString::ExternalData::data_offset()));
   } else if (cid == kExternalTwoByteStringCid) {
-    str = builder.AddDefinition(
-      new LoadUntaggedInstr(new Value(str),
-                            ExternalTwoByteString::external_data_offset()));
-    str = builder.AddDefinition(
-        new LoadUntaggedInstr(
-            new Value(str),
-            RawExternalTwoByteString::ExternalData::data_offset()));
+    str = builder.AddDefinition(new LoadUntaggedInstr(
+        new Value(str), ExternalTwoByteString::external_data_offset()));
+    str = builder.AddDefinition(new LoadUntaggedInstr(
+        new Value(str), RawExternalTwoByteString::ExternalData::data_offset()));
   }
 
-  Definition* result = builder.AddDefinition(
-      new LoadIndexedInstr(new Value(str),
-                           new Value(index),
-                           Instance::ElementSizeFor(cid),
-                           cid,
-                           Thread::kNoDeoptId,
-                           builder.TokenPos()));
+  Definition* result = builder.AddDefinition(new LoadIndexedInstr(
+      new Value(str), new Value(index), Instance::ElementSizeFor(cid), cid,
+      kAlignedAccess, Thread::kNoDeoptId, builder.TokenPos()));
   builder.AddIntrinsicReturn(new Value(result));
   return true;
 }
@@ -773,34 +724,23 @@
   Definition* left = builder.AddParameter(2);
 
   const ICData& value_check = ICData::ZoneHandle(ICData::New(
-      flow_graph->function(),
-      String::Handle(flow_graph->function().name()),
+      flow_graph->function(), String::Handle(flow_graph->function().name()),
       Object::empty_array(),  // Dummy args. descr.
-      Thread::kNoDeoptId,
-      1,
-      false));
+      Thread::kNoDeoptId, 1, false));
   value_check.AddReceiverCheck(kFloat32x4Cid, flow_graph->function());
   // Check argument. Receiver (left) is known to be a Float32x4.
-  builder.AddInstruction(
-      new CheckClassInstr(new Value(right),
-                          Thread::kNoDeoptId,
-                          value_check,
-                          builder.TokenPos()));
+  builder.AddInstruction(new CheckClassInstr(
+      new Value(right), Thread::kNoDeoptId, value_check, builder.TokenPos()));
   Definition* left_simd =
-      builder.AddUnboxInstr(kUnboxedFloat32x4,
-                            new Value(left),
+      builder.AddUnboxInstr(kUnboxedFloat32x4, new Value(left),
                             /* is_checked = */ true);
 
   Definition* right_simd =
-      builder.AddUnboxInstr(kUnboxedFloat32x4,
-                            new Value(right),
+      builder.AddUnboxInstr(kUnboxedFloat32x4, new Value(right),
                             /* is_checked = */ true);
 
-  Definition* unboxed_result = builder.AddDefinition(
-      new BinaryFloat32x4OpInstr(kind,
-                                 new Value(left_simd),
-                                 new Value(right_simd),
-                                 Thread::kNoDeoptId));
+  Definition* unboxed_result = builder.AddDefinition(new BinaryFloat32x4OpInstr(
+      kind, new Value(left_simd), new Value(right_simd), Thread::kNoDeoptId));
   Definition* result = builder.AddDefinition(
       BoxInstr::Create(kUnboxedFloat32x4, new Value(unboxed_result)));
   builder.AddIntrinsicReturn(new Value(result));
@@ -836,15 +776,11 @@
   Definition* receiver = builder.AddParameter(1);
 
   Definition* unboxed_receiver =
-      builder.AddUnboxInstr(kUnboxedFloat32x4,
-                            new Value(receiver),
+      builder.AddUnboxInstr(kUnboxedFloat32x4, new Value(receiver),
                             /* is_checked = */ true);
 
-  Definition* unboxed_result = builder.AddDefinition(
-      new Simd32x4ShuffleInstr(kind,
-                               new Value(unboxed_receiver),
-                               0,
-                               Thread::kNoDeoptId));
+  Definition* unboxed_result = builder.AddDefinition(new Simd32x4ShuffleInstr(
+      kind, new Value(unboxed_receiver), 0, Thread::kNoDeoptId));
 
   Definition* result = builder.AddDefinition(
       BoxInstr::Create(kUnboxedDouble, new Value(unboxed_result)));
@@ -884,11 +820,8 @@
 
   Definition* array = builder.AddParameter(1);
 
-  Definition* length = builder.AddDefinition(
-      new LoadFieldInstr(new Value(array),
-                         offset,
-                         Type::ZoneHandle(),
-                         builder.TokenPos()));
+  Definition* length = builder.AddDefinition(new LoadFieldInstr(
+      new Value(array), offset, Type::ZoneHandle(), builder.TokenPos()));
   builder.AddIntrinsicReturn(new Value(length));
   return true;
 }
@@ -927,15 +860,11 @@
   Definition* array = builder.AddParameter(1);
 
   Definition* backing_store = builder.AddDefinition(
-      new LoadFieldInstr(new Value(array),
-                         GrowableObjectArray::data_offset(),
-                         Type::ZoneHandle(),
-                         builder.TokenPos()));
+      new LoadFieldInstr(new Value(array), GrowableObjectArray::data_offset(),
+                         Type::ZoneHandle(), builder.TokenPos()));
   Definition* capacity = builder.AddDefinition(
-      new LoadFieldInstr(new Value(backing_store),
-                         Array::length_offset(),
-                         Type::ZoneHandle(),
-                         builder.TokenPos()));
+      new LoadFieldInstr(new Value(backing_store), Array::length_offset(),
+                         Type::ZoneHandle(), builder.TokenPos()));
   builder.AddIntrinsicReturn(new Value(capacity));
   return true;
 }
@@ -949,21 +878,16 @@
   Definition* index = builder.AddParameter(1);
   Definition* growable_array = builder.AddParameter(2);
 
-  PrepareIndexedOp(
-      &builder, growable_array, index, GrowableObjectArray::length_offset());
+  PrepareIndexedOp(&builder, growable_array, index,
+                   GrowableObjectArray::length_offset());
 
-  Definition* backing_store = builder.AddDefinition(
-      new LoadFieldInstr(new Value(growable_array),
-                         GrowableObjectArray::data_offset(),
-                         Type::ZoneHandle(),
-                         builder.TokenPos()));
-  Definition* result = builder.AddDefinition(
-      new LoadIndexedInstr(new Value(backing_store),
-                           new Value(index),
-                           Instance::ElementSizeFor(kArrayCid),  // index scale
-                           kArrayCid,
-                           Thread::kNoDeoptId,
-                           builder.TokenPos()));
+  Definition* backing_store = builder.AddDefinition(new LoadFieldInstr(
+      new Value(growable_array), GrowableObjectArray::data_offset(),
+      Type::ZoneHandle(), builder.TokenPos()));
+  Definition* result = builder.AddDefinition(new LoadIndexedInstr(
+      new Value(backing_store), new Value(index),
+      Instance::ElementSizeFor(kArrayCid),  // index scale
+      kArrayCid, kAlignedAccess, Thread::kNoDeoptId, builder.TokenPos()));
   builder.AddIntrinsicReturn(new Value(result));
   return true;
 }
@@ -982,24 +906,18 @@
   Definition* index = builder.AddParameter(2);
   Definition* array = builder.AddParameter(3);
 
-  PrepareIndexedOp(
-      &builder, array, index, GrowableObjectArray::length_offset());
+  PrepareIndexedOp(&builder, array, index,
+                   GrowableObjectArray::length_offset());
 
   Definition* backing_store = builder.AddDefinition(
-      new LoadFieldInstr(new Value(array),
-                         GrowableObjectArray::data_offset(),
-                         Type::ZoneHandle(),
-                         builder.TokenPos()));
+      new LoadFieldInstr(new Value(array), GrowableObjectArray::data_offset(),
+                         Type::ZoneHandle(), builder.TokenPos()));
 
-  builder.AddInstruction(
-      new StoreIndexedInstr(new Value(backing_store),
-                            new Value(index),
-                            new Value(value),
-                            kEmitStoreBarrier,
-                            Instance::ElementSizeFor(kArrayCid),  // index scale
-                            kArrayCid,
-                            Thread::kNoDeoptId,
-                            builder.TokenPos()));
+  builder.AddInstruction(new StoreIndexedInstr(
+      new Value(backing_store), new Value(index), new Value(value),
+      kEmitStoreBarrier,
+      Instance::ElementSizeFor(kArrayCid),  // index scale
+      kArrayCid, kAlignedAccess, Thread::kNoDeoptId, builder.TokenPos()));
   // Return null.
   Definition* null_def = builder.AddNullDefinition();
   builder.AddIntrinsicReturn(new Value(null_def));
@@ -1016,25 +934,16 @@
   Definition* growable_array = builder.AddParameter(2);
 
   const ICData& value_check = ICData::ZoneHandle(ICData::New(
-      flow_graph->function(),
-      String::Handle(flow_graph->function().name()),
+      flow_graph->function(), String::Handle(flow_graph->function().name()),
       Object::empty_array(),  // Dummy args. descr.
-      Thread::kNoDeoptId,
-      1,
-      false));
+      Thread::kNoDeoptId, 1, false));
   value_check.AddReceiverCheck(kArrayCid, flow_graph->function());
-  builder.AddInstruction(
-      new CheckClassInstr(new Value(data),
-                          Thread::kNoDeoptId,
-                          value_check,
-                          builder.TokenPos()));
+  builder.AddInstruction(new CheckClassInstr(
+      new Value(data), Thread::kNoDeoptId, value_check, builder.TokenPos()));
 
-  builder.AddInstruction(
-      new StoreInstanceFieldInstr(GrowableObjectArray::data_offset(),
-                                  new Value(growable_array),
-                                  new Value(data),
-                                  kEmitStoreBarrier,
-                                  builder.TokenPos()));
+  builder.AddInstruction(new StoreInstanceFieldInstr(
+      GrowableObjectArray::data_offset(), new Value(growable_array),
+      new Value(data), kEmitStoreBarrier, builder.TokenPos()));
   // Return null.
   Definition* null_def = builder.AddNullDefinition();
   builder.AddIntrinsicReturn(new Value(null_def));
@@ -1050,16 +959,11 @@
   Definition* length = builder.AddParameter(1);
   Definition* growable_array = builder.AddParameter(2);
 
-  builder.AddInstruction(
-      new CheckSmiInstr(new Value(length),
-                        Thread::kNoDeoptId,
-                        builder.TokenPos()));
-  builder.AddInstruction(
-      new StoreInstanceFieldInstr(GrowableObjectArray::length_offset(),
-                                  new Value(growable_array),
-                                  new Value(length),
-                                  kNoStoreBarrier,
-                                  builder.TokenPos()));
+  builder.AddInstruction(new CheckSmiInstr(
+      new Value(length), Thread::kNoDeoptId, builder.TokenPos()));
+  builder.AddInstruction(new StoreInstanceFieldInstr(
+      GrowableObjectArray::length_offset(), new Value(growable_array),
+      new Value(length), kNoStoreBarrier, builder.TokenPos()));
   Definition* null_def = builder.AddNullDefinition();
   builder.AddIntrinsicReturn(new Value(null_def));
   return true;
@@ -1076,13 +980,10 @@
 
   Definition* receiver = builder.AddParameter(1);
   Definition* unboxed_value =
-      builder.AddUnboxInstr(kUnboxedDouble,
-                            new Value(receiver),
+      builder.AddUnboxInstr(kUnboxedDouble, new Value(receiver),
                             /* is_checked = */ true);
-  Definition* unboxed_result = builder.AddDefinition(
-      new UnaryDoubleOpInstr(Token::kNEGATE,
-                             new Value(unboxed_value),
-                             Thread::kNoDeoptId));
+  Definition* unboxed_result = builder.AddDefinition(new UnaryDoubleOpInstr(
+      Token::kNEGATE, new Value(unboxed_value), Thread::kNoDeoptId));
   Definition* result = builder.AddDefinition(
       BoxInstr::Create(kUnboxedDouble, new Value(unboxed_result)));
   builder.AddIntrinsicReturn(new Value(result));
@@ -1107,8 +1008,7 @@
     args->Add(new Value(unboxed_value));
   }
 
-  Definition* unboxed_result =
-      builder->InvokeMathCFunction(kind, args);
+  Definition* unboxed_result = builder->InvokeMathCFunction(kind, args);
 
   Definition* result = builder->AddDefinition(
       BoxInstr::Create(kUnboxedDouble, new Value(unboxed_result)));
@@ -1126,8 +1026,7 @@
   TargetEntryInstr* normal_entry = graph_entry->normal_entry();
   BlockBuilder builder(flow_graph, normal_entry);
 
-  return BuildInvokeMathCFunction(&builder,
-                                  MethodRecognizer::kMathSin);
+  return BuildInvokeMathCFunction(&builder, MethodRecognizer::kMathSin);
 }
 
 
@@ -1138,8 +1037,7 @@
   TargetEntryInstr* normal_entry = graph_entry->normal_entry();
   BlockBuilder builder(flow_graph, normal_entry);
 
-  return BuildInvokeMathCFunction(&builder,
-                                  MethodRecognizer::kMathCos);
+  return BuildInvokeMathCFunction(&builder, MethodRecognizer::kMathCos);
 }
 
 
@@ -1150,8 +1048,7 @@
   TargetEntryInstr* normal_entry = graph_entry->normal_entry();
   BlockBuilder builder(flow_graph, normal_entry);
 
-  return BuildInvokeMathCFunction(&builder,
-                                  MethodRecognizer::kMathTan);
+  return BuildInvokeMathCFunction(&builder, MethodRecognizer::kMathTan);
 }
 
 
@@ -1162,8 +1059,7 @@
   TargetEntryInstr* normal_entry = graph_entry->normal_entry();
   BlockBuilder builder(flow_graph, normal_entry);
 
-  return BuildInvokeMathCFunction(&builder,
-                                  MethodRecognizer::kMathAsin);
+  return BuildInvokeMathCFunction(&builder, MethodRecognizer::kMathAsin);
 }
 
 
@@ -1174,8 +1070,7 @@
   TargetEntryInstr* normal_entry = graph_entry->normal_entry();
   BlockBuilder builder(flow_graph, normal_entry);
 
-  return BuildInvokeMathCFunction(&builder,
-                                  MethodRecognizer::kMathAcos);
+  return BuildInvokeMathCFunction(&builder, MethodRecognizer::kMathAcos);
 }
 
 
@@ -1186,8 +1081,7 @@
   TargetEntryInstr* normal_entry = graph_entry->normal_entry();
   BlockBuilder builder(flow_graph, normal_entry);
 
-  return BuildInvokeMathCFunction(&builder,
-                                  MethodRecognizer::kMathAtan);
+  return BuildInvokeMathCFunction(&builder, MethodRecognizer::kMathAtan);
 }
 
 
@@ -1198,8 +1092,7 @@
   TargetEntryInstr* normal_entry = graph_entry->normal_entry();
   BlockBuilder builder(flow_graph, normal_entry);
 
-  return BuildInvokeMathCFunction(&builder,
-                                  MethodRecognizer::kMathAtan2,
+  return BuildInvokeMathCFunction(&builder, MethodRecognizer::kMathAtan2,
                                   /* num_parameters = */ 2);
 }
 
@@ -1211,8 +1104,7 @@
   TargetEntryInstr* normal_entry = graph_entry->normal_entry();
   BlockBuilder builder(flow_graph, normal_entry);
 
-  return BuildInvokeMathCFunction(&builder,
-                                  MethodRecognizer::kDoubleMod,
+  return BuildInvokeMathCFunction(&builder, MethodRecognizer::kDoubleMod,
                                   /* num_parameters = */ 2);
 }
 
@@ -1227,8 +1119,7 @@
   TargetEntryInstr* normal_entry = graph_entry->normal_entry();
   BlockBuilder builder(flow_graph, normal_entry);
 
-  return BuildInvokeMathCFunction(&builder,
-                                  MethodRecognizer::kDoubleCeil);
+  return BuildInvokeMathCFunction(&builder, MethodRecognizer::kDoubleCeil);
 }
 
 
@@ -1242,8 +1133,7 @@
   TargetEntryInstr* normal_entry = graph_entry->normal_entry();
   BlockBuilder builder(flow_graph, normal_entry);
 
-  return BuildInvokeMathCFunction(&builder,
-                                  MethodRecognizer::kDoubleFloor);
+  return BuildInvokeMathCFunction(&builder, MethodRecognizer::kDoubleFloor);
 }
 
 
@@ -1257,8 +1147,7 @@
   TargetEntryInstr* normal_entry = graph_entry->normal_entry();
   BlockBuilder builder(flow_graph, normal_entry);
 
-  return BuildInvokeMathCFunction(&builder,
-                                  MethodRecognizer::kDoubleTruncate);
+  return BuildInvokeMathCFunction(&builder, MethodRecognizer::kDoubleTruncate);
 }
 
 
@@ -1269,8 +1158,17 @@
   TargetEntryInstr* normal_entry = graph_entry->normal_entry();
   BlockBuilder builder(flow_graph, normal_entry);
 
-  return BuildInvokeMathCFunction(&builder,
-                                  MethodRecognizer::kDoubleRound);
+  return BuildInvokeMathCFunction(&builder, MethodRecognizer::kDoubleRound);
+}
+
+
+void Intrinsifier::RegExp_ExecuteMatch(Assembler* assembler) {
+  IntrinsifyRegExpExecuteMatch(assembler, /*sticky=*/false);
+}
+
+
+void Intrinsifier::RegExp_ExecuteMatchSticky(Assembler* assembler) {
+  IntrinsifyRegExpExecuteMatch(assembler, /*sticky=*/true);
 }
 #endif  // !defined(TARGET_ARCH_DBC)
 
diff --git a/runtime/vm/intrinsifier.h b/runtime/vm/intrinsifier.h
index 7226d3ac..81d9e65 100644
--- a/runtime/vm/intrinsifier.h
+++ b/runtime/vm/intrinsifier.h
@@ -3,8 +3,8 @@
 // BSD-style license that can be found in the LICENSE file.
 // Class for intrinsifying functions.
 
-#ifndef VM_INTRINSIFIER_H_
-#define VM_INTRINSIFIER_H_
+#ifndef RUNTIME_VM_INTRINSIFIER_H_
+#define RUNTIME_VM_INTRINSIFIER_H_
 
 #include "vm/allocation.h"
 #include "vm/method_recognizer.h"
@@ -23,7 +23,7 @@
  public:
   static bool Intrinsify(const ParsedFunction& parsed_function,
                          FlowGraphCompiler* compiler);
-#if defined(DART_NO_SNAPSHOT)
+#if !defined(DART_PRECOMPILED_RUNTIME)
   static void InitializeState();
 #endif
 
@@ -38,7 +38,7 @@
  private:
   static bool CanIntrinsify(const Function& function);
 
-#define DECLARE_FUNCTION(class_name, function_name, enum_name, type, fp) \
+#define DECLARE_FUNCTION(class_name, function_name, enum_name, type, fp)       \
   static void enum_name(Assembler* assembler);
 
   ALL_INTRINSICS_LIST(DECLARE_FUNCTION)
@@ -50,15 +50,17 @@
 #undef DECLARE_FUNCTION
 
 #if !defined(TARGET_ARCH_DBC)
-#define DECLARE_FUNCTION(class_name, function_name, enum_name, type, fp) \
+#define DECLARE_FUNCTION(class_name, function_name, enum_name, type, fp)       \
   static bool Build_##enum_name(FlowGraph* flow_graph);
 
   GRAPH_INTRINSICS_LIST(DECLARE_FUNCTION)
 
 #undef DECLARE_FUNCTION
+
+  static void IntrinsifyRegExpExecuteMatch(Assembler* assembler, bool sticky);
 #endif
 };
 
 }  // namespace dart
 
-#endif  // VM_INTRINSIFIER_H_
+#endif  // RUNTIME_VM_INTRINSIFIER_H_
diff --git a/runtime/vm/intrinsifier_arm.cc b/runtime/vm/intrinsifier_arm.cc
index 7e9dc7c..99205a7 100644
--- a/runtime/vm/intrinsifier_arm.cc
+++ b/runtime/vm/intrinsifier_arm.cc
@@ -30,7 +30,9 @@
 #define __ assembler->
 
 
-intptr_t Intrinsifier::ParameterSlotFromSp() { return -1; }
+intptr_t Intrinsifier::ParameterSlotFromSp() {
+  return -1;
+}
 
 
 static bool IsABIPreservedRegister(Register reg) {
@@ -79,7 +81,7 @@
   // Note that R1 is Smi, i.e, times 2.
   ASSERT(kSmiTagShift == 1);
   __ ldr(R2, Address(SP, 0 * kWordSize));  // Value.
-  __ add(R1, R0, Operand(R1, LSL, 1));  // R1 is Smi.
+  __ add(R1, R0, Operand(R1, LSL, 1));     // R1 is Smi.
   __ StoreIntoObject(R0, FieldAddress(R1, Array::data_offset()), R2);
   // Caller is responsible for preserving the value if necessary.
   __ Ret();
@@ -104,24 +106,18 @@
   __ ldr(R1, Address(SP, kArrayOffset));  // Data argument.
   // R0 is new, no barrier needed.
   __ StoreIntoObjectNoBarrier(
-      R0,
-      FieldAddress(R0, GrowableObjectArray::data_offset()),
-      R1);
+      R0, FieldAddress(R0, GrowableObjectArray::data_offset()), R1);
 
   // R0: new growable array object start as a tagged pointer.
   // Store the type argument field in the growable array object.
   __ ldr(R1, Address(SP, kTypeArgumentsOffset));  // Type argument.
   __ StoreIntoObjectNoBarrier(
-      R0,
-      FieldAddress(R0, GrowableObjectArray::type_arguments_offset()),
-      R1);
+      R0, FieldAddress(R0, GrowableObjectArray::type_arguments_offset()), R1);
 
   // Set the length field in the growable array object to 0.
   __ LoadImmediate(R1, 0);
   __ StoreIntoObjectNoBarrier(
-      R0,
-      FieldAddress(R0, GrowableObjectArray::length_offset()),
-      R1);
+      R0, FieldAddress(R0, GrowableObjectArray::length_offset()), R1);
   __ Ret();  // Returns the newly allocated object in R0.
 
   __ Bind(&fall_through);
@@ -167,7 +163,7 @@
   Label fall_through;                                                          \
   const intptr_t kArrayLengthStackOffset = 0 * kWordSize;                      \
   NOT_IN_PRODUCT(__ MaybeTraceAllocation(cid, R2, &fall_through));             \
-  __ ldr(R2, Address(SP, kArrayLengthStackOffset));  /* Array length. */       \
+  __ ldr(R2, Address(SP, kArrayLengthStackOffset)); /* Array length. */        \
   /* Check that length is a positive Smi. */                                   \
   /* R2: requested array length argument. */                                   \
   __ tst(R2, Operand(kSmiTagMask));                                            \
@@ -189,7 +185,7 @@
                                                                                \
   /* R2: allocation size. */                                                   \
   __ adds(R1, R0, Operand(R2));                                                \
-  __ b(&fall_through, CS);  /* Fail on unsigned overflow. */                   \
+  __ b(&fall_through, CS); /* Fail on unsigned overflow. */                    \
                                                                                \
   /* Check if the allocation fits into the remaining space. */                 \
   /* R0: potential new object start. */                                        \
@@ -212,24 +208,24 @@
   /* R4: allocation stats address */                                           \
   {                                                                            \
     __ CompareImmediate(R2, RawObject::SizeTag::kMaxSizeTag);                  \
-    __ mov(R3, Operand(R2, LSL,                                                \
-        RawObject::kSizeTagPos - kObjectAlignmentLog2), LS);                   \
+    __ mov(R3,                                                                 \
+           Operand(R2, LSL, RawObject::kSizeTagPos - kObjectAlignmentLog2),    \
+           LS);                                                                \
     __ mov(R3, Operand(0), HI);                                                \
                                                                                \
     /* Get the class index and insert it into the tags. */                     \
     __ LoadImmediate(TMP, RawObject::ClassIdTag::encode(cid));                 \
     __ orr(R3, R3, Operand(TMP));                                              \
-    __ str(R3, FieldAddress(R0, type_name::tags_offset()));  /* Tags. */       \
+    __ str(R3, FieldAddress(R0, type_name::tags_offset())); /* Tags. */        \
   }                                                                            \
   /* Set the length field. */                                                  \
   /* R0: new object start as a tagged pointer. */                              \
   /* R1: new object end address. */                                            \
   /* R2: allocation size. */                                                   \
   /* R4: allocation stats address. */                                          \
-  __ ldr(R3, Address(SP, kArrayLengthStackOffset));  /* Array length. */       \
-  __ StoreIntoObjectNoBarrier(R0,                                              \
-                              FieldAddress(R0, type_name::length_offset()),    \
-                              R3);                                             \
+  __ ldr(R3, Address(SP, kArrayLengthStackOffset)); /* Array length. */        \
+  __ StoreIntoObjectNoBarrier(                                                 \
+      R0, FieldAddress(R0, type_name::length_offset()), R3);                   \
   /* Initialize all array elements to 0. */                                    \
   /* R0: new object start as a tagged pointer. */                              \
   /* R1: new object end address. */                                            \
@@ -251,16 +247,21 @@
                                                                                \
   NOT_IN_PRODUCT(__ IncrementAllocationStatsWithSize(R4, R2, space));          \
   __ Ret();                                                                    \
-  __ Bind(&fall_through);                                                      \
+  __ Bind(&fall_through);
 
 
 static int GetScaleFactor(intptr_t size) {
   switch (size) {
-    case 1: return 0;
-    case 2: return 1;
-    case 4: return 2;
-    case 8: return 3;
-    case 16: return 4;
+    case 1:
+      return 0;
+    case 2:
+      return 1;
+    case 4:
+      return 2;
+    case 8:
+      return 3;
+    case 16:
+      return 4;
   }
   UNREACHABLE();
   return -1;
@@ -268,12 +269,12 @@
 
 
 #define TYPED_DATA_ALLOCATOR(clazz)                                            \
-void Intrinsifier::TypedData_##clazz##_factory(Assembler* assembler) {         \
-  intptr_t size = TypedData::ElementSizeInBytes(kTypedData##clazz##Cid);       \
-  intptr_t max_len = TypedData::MaxElements(kTypedData##clazz##Cid);           \
-  int shift = GetScaleFactor(size);                                            \
-  TYPED_ARRAY_ALLOCATION(TypedData, kTypedData##clazz##Cid, max_len, shift);   \
-}
+  void Intrinsifier::TypedData_##clazz##_factory(Assembler* assembler) {       \
+    intptr_t size = TypedData::ElementSizeInBytes(kTypedData##clazz##Cid);     \
+    intptr_t max_len = TypedData::MaxElements(kTypedData##clazz##Cid);         \
+    int shift = GetScaleFactor(size);                                          \
+    TYPED_ARRAY_ALLOCATION(TypedData, kTypedData##clazz##Cid, max_len, shift); \
+  }
 CLASS_LIST_TYPED_DATA(TYPED_DATA_ALLOCATOR)
 #undef TYPED_DATA_ALLOCATOR
 
@@ -281,8 +282,8 @@
 // Loads args from stack into R0 and R1
 // Tests if they are smis, jumps to label not_smi if not.
 static void TestBothArgumentsSmis(Assembler* assembler, Label* not_smi) {
-  __ ldr(R0, Address(SP, + 0 * kWordSize));
-  __ ldr(R1, Address(SP, + 1 * kWordSize));
+  __ ldr(R0, Address(SP, +0 * kWordSize));
+  __ ldr(R1, Address(SP, +1 * kWordSize));
   __ orr(TMP, R0, Operand(R1));
   __ tst(TMP, Operand(kSmiTagMask));
   __ b(not_smi, NE);
@@ -293,8 +294,8 @@
 void Intrinsifier::Integer_addFromInteger(Assembler* assembler) {
   Label fall_through;
   TestBothArgumentsSmis(assembler, &fall_through);  // Checks two smis.
-  __ adds(R0, R0, Operand(R1));  // Adds.
-  __ bx(LR, VC);  // Return if no overflow.
+  __ adds(R0, R0, Operand(R1));                     // Adds.
+  __ bx(LR, VC);                                    // Return if no overflow.
   // Otherwise fall through.
   __ Bind(&fall_through);
 }
@@ -309,7 +310,7 @@
   Label fall_through;
   TestBothArgumentsSmis(assembler, &fall_through);
   __ subs(R0, R0, Operand(R1));  // Subtract.
-  __ bx(LR, VC);  // Return if no overflow.
+  __ bx(LR, VC);                 // Return if no overflow.
   // Otherwise fall through.
   __ Bind(&fall_through);
 }
@@ -319,7 +320,7 @@
   Label fall_through;
   TestBothArgumentsSmis(assembler, &fall_through);
   __ subs(R0, R1, Operand(R0));  // Subtract.
-  __ bx(LR, VC);  // Return if no overflow.
+  __ bx(LR, VC);                 // Return if no overflow.
   // Otherwise fall through.
   __ Bind(&fall_through);
 }
@@ -328,7 +329,7 @@
 void Intrinsifier::Integer_mulFromInteger(Assembler* assembler) {
   Label fall_through;
   TestBothArgumentsSmis(assembler, &fall_through);  // checks two smis
-  __ SmiUntag(R0);  // Untags R0. We only want result shifted by one.
+  __ SmiUntag(R0);           // Untags R0. We only want result shifted by one.
   __ smull(R0, IP, R0, R1);  // IP:R0 <- R0 * R1.
   __ cmp(IP, Operand(R0, ASR, 31));
   __ bx(LR, EQ);
@@ -404,8 +405,8 @@
   }
   // Check to see if we have integer division
   Label fall_through;
-  __ ldr(R1, Address(SP, + 0 * kWordSize));
-  __ ldr(R0, Address(SP, + 1 * kWordSize));
+  __ ldr(R1, Address(SP, +0 * kWordSize));
+  __ ldr(R0, Address(SP, +1 * kWordSize));
   __ orr(TMP, R0, Operand(R1));
   __ tst(TMP, Operand(kSmiTagMask));
   __ b(&fall_through, NE);
@@ -452,15 +453,15 @@
   // cannot tag the result.
   __ CompareImmediate(R0, 0x40000000);
   __ SmiTag(R0, NE);  // Not equal. Okay to tag and return.
-  __ bx(LR, NE);  // Return.
+  __ bx(LR, NE);      // Return.
   __ Bind(&fall_through);
 }
 
 
 void Intrinsifier::Integer_negate(Assembler* assembler) {
   Label fall_through;
-  __ ldr(R0, Address(SP, + 0 * kWordSize));  // Grab first argument.
-  __ tst(R0, Operand(kSmiTagMask));  // Test for Smi.
+  __ ldr(R0, Address(SP, +0 * kWordSize));  // Grab first argument.
+  __ tst(R0, Operand(kSmiTagMask));         // Test for Smi.
   __ b(&fall_through, NE);
   __ rsbs(R0, R0, Operand(0));  // R0 is a Smi. R0 <- 0 - R0.
   __ bx(LR, VC);  // Return if there wasn't overflow, fall through otherwise.
@@ -547,16 +548,16 @@
   // lo bits = R1 << R0
   __ LoadImmediate(NOTFP, 1);
   __ mov(NOTFP, Operand(NOTFP, LSL, R0));  // NOTFP <- 1 << R0
-  __ sub(NOTFP, NOTFP, Operand(1));  // NOTFP <- NOTFP - 1
-  __ rsb(R3, R0, Operand(32));  // R3 <- 32 - R0
+  __ sub(NOTFP, NOTFP, Operand(1));        // NOTFP <- NOTFP - 1
+  __ rsb(R3, R0, Operand(32));             // R3 <- 32 - R0
   __ mov(NOTFP, Operand(NOTFP, LSL, R3));  // NOTFP <- NOTFP << R3
-  __ and_(NOTFP, R1, Operand(NOTFP));  // NOTFP <- NOTFP & R1
+  __ and_(NOTFP, R1, Operand(NOTFP));      // NOTFP <- NOTFP & R1
   __ mov(NOTFP, Operand(NOTFP, LSR, R3));  // NOTFP <- NOTFP >> R3
   // Now NOTFP has the bits that fall off of R1 on a left shift.
   __ mov(R1, Operand(R1, LSL, R0));  // R1 gets the low bits.
 
-  const Class& mint_class = Class::Handle(
-      Isolate::Current()->object_store()->mint_class());
+  const Class& mint_class =
+      Class::Handle(Isolate::Current()->object_store()->mint_class());
   __ TryAllocate(mint_class, &fall_through, R0, R2);
 
 
@@ -902,7 +903,7 @@
 
   Label last_carry;
   __ teq(R1, Operand(R6));  // Does not affect carry flag.
-  __ b(&last_carry, EQ);  // If used - a_used == 0.
+  __ b(&last_carry, EQ);    // If used - a_used == 0.
 
   Label carry_loop;
   __ Bind(&carry_loop);
@@ -962,7 +963,7 @@
 
   Label done;
   __ teq(R1, Operand(R6));  // Does not affect carry flag.
-  __ b(&done, EQ);  // If used - a_used == 0.
+  __ b(&done, EQ);          // If used - a_used == 0.
 
   Label carry_loop;
   __ Bind(&carry_loop);
@@ -1121,7 +1122,7 @@
 
   // NOTFP = ajp = &a_digits[i]
   __ ldr(R1, Address(SP, 1 * kWordSize));  // a_digits
-  __ add(R1, R1, Operand(R2, LSL, 2));  // j == 2*i, i is Smi.
+  __ add(R1, R1, Operand(R2, LSL, 2));     // j == 2*i, i is Smi.
   __ add(NOTFP, R1, Operand(TypedData::data_offset() - kHeapObjectTag));
 
   // R8:R0 = t = x*x + *ajp
@@ -1164,7 +1165,7 @@
   __ adc(R2, R2, Operand(0));  // R2:R1:R0 = 2*x*xi.
   __ adds(R0, R0, Operand(R8));
   __ adcs(R1, R1, Operand(R9));
-  __ adc(R2, R2, Operand(0));  // R2:R1:R0 = 2*x*xi + c.
+  __ adc(R2, R2, Operand(0));     // R2:R1:R0 = 2*x*xi + c.
   __ ldr(R8, Address(NOTFP, 0));  // R8 = aj = *ajp.
   __ adds(R0, R0, Operand(R8));
   __ adcs(R8, R1, Operand(0));
@@ -1214,8 +1215,8 @@
   __ ldr(R4, Address(SP, 2 * kWordSize));  // args
 
   // R3 = rho = args[2]
-  __ ldr(R3, FieldAddress(R4,
-                          TypedData::data_offset() + 2*Bigint::kBytesPerDigit));
+  __ ldr(R3, FieldAddress(
+                 R4, TypedData::data_offset() + 2 * Bigint::kBytesPerDigit));
 
   // R2 = digits[i >> 1]
   __ ldrd(R0, R1, SP, 0 * kWordSize);  // R0 = i as Smi, R1 = digits
@@ -1226,8 +1227,8 @@
   __ umull(R0, R1, R2, R3);
 
   // args[4] = t mod DIGIT_BASE = low32(t)
-  __ str(R0,
-         FieldAddress(R4, TypedData::data_offset() + 4*Bigint::kBytesPerDigit));
+  __ str(R0, FieldAddress(
+                 R4, TypedData::data_offset() + 4 * Bigint::kBytesPerDigit));
 
   __ mov(R0, Operand(Smi::RawValue(1)));  // One digit processed.
   __ Ret();
@@ -1321,14 +1322,23 @@
     __ ldr(R0, Address(SP, 1 * kWordSize));  // Left argument.
     __ LoadDFromOffset(D0, R0, Double::value_offset() - kHeapObjectTag);
     switch (kind) {
-      case Token::kADD: __ vaddd(D0, D0, D1); break;
-      case Token::kSUB: __ vsubd(D0, D0, D1); break;
-      case Token::kMUL: __ vmuld(D0, D0, D1); break;
-      case Token::kDIV: __ vdivd(D0, D0, D1); break;
-      default: UNREACHABLE();
+      case Token::kADD:
+        __ vaddd(D0, D0, D1);
+        break;
+      case Token::kSUB:
+        __ vsubd(D0, D0, D1);
+        break;
+      case Token::kMUL:
+        __ vmuld(D0, D0, D1);
+        break;
+      case Token::kDIV:
+        __ vdivd(D0, D0, D1);
+        break;
+      default:
+        UNREACHABLE();
     }
-    const Class& double_class = Class::Handle(
-        Isolate::Current()->object_store()->double_class());
+    const Class& double_class =
+        Class::Handle(Isolate::Current()->object_store()->double_class());
     __ TryAllocate(double_class, &fall_through, R0, R1);  // Result register.
     __ StoreDToOffset(D0, R0, Double::value_offset() - kHeapObjectTag);
     __ Ret();
@@ -1377,8 +1387,8 @@
     __ ldr(R0, Address(SP, 1 * kWordSize));
     __ LoadDFromOffset(D0, R0, Double::value_offset() - kHeapObjectTag);
     __ vmuld(D0, D0, D1);
-    const Class& double_class = Class::Handle(
-        Isolate::Current()->object_store()->double_class());
+    const Class& double_class =
+        Class::Handle(Isolate::Current()->object_store()->double_class());
     __ TryAllocate(double_class, &fall_through, R0, R1);  // Result register.
     __ StoreDToOffset(D0, R0, Double::value_offset() - kHeapObjectTag);
     __ Ret();
@@ -1398,8 +1408,8 @@
     __ SmiUntag(R0);
     __ vmovsr(S0, R0);
     __ vcvtdi(D0, S0);
-    const Class& double_class = Class::Handle(
-        Isolate::Current()->object_store()->double_class());
+    const Class& double_class =
+        Class::Handle(Isolate::Current()->object_store()->double_class());
     __ TryAllocate(double_class, &fall_through, R0, R1);  // Result register.
     __ StoreDToOffset(D0, R0, Double::value_offset() - kHeapObjectTag);
     __ Ret();
@@ -1422,6 +1432,31 @@
 }
 
 
+void Intrinsifier::Double_getIsInfinite(Assembler* assembler) {
+  if (TargetCPUFeatures::vfp_supported()) {
+    __ ldr(R0, Address(SP, 0 * kWordSize));
+    // R1 <- value[0:31], R2 <- value[32:63]
+    __ LoadFieldFromOffset(kWord, R1, R0, Double::value_offset());
+    __ LoadFieldFromOffset(kWord, R2, R0, Double::value_offset() + kWordSize);
+
+    // If the low word isn't 0, then it isn't infinity.
+    __ cmp(R1, Operand(0));
+    __ LoadObject(R0, Bool::False(), NE);
+    __ bx(LR, NE);  // Return if NE.
+
+    // Mask off the sign bit.
+    __ AndImmediate(R2, R2, 0x7FFFFFFF);
+    // Compare with +infinity.
+    __ CompareImmediate(R2, 0x7FF00000);
+    __ LoadObject(R0, Bool::False(), NE);
+    __ bx(LR, NE);
+
+    __ LoadObject(R0, Bool::True());
+    __ Ret();
+  }
+}
+
+
 void Intrinsifier::Double_getIsNegative(Assembler* assembler) {
   if (TargetCPUFeatures::vfp_supported()) {
     Label is_false, is_true, is_zero;
@@ -1430,7 +1465,7 @@
     __ vcmpdz(D0);
     __ vmstat();
     __ b(&is_false, VS);  // NaN -> false.
-    __ b(&is_zero, EQ);  // Check for negative zero.
+    __ b(&is_zero, EQ);   // Check for negative zero.
     __ b(&is_false, CS);  // >= 0 -> false.
 
     __ Bind(&is_true);
@@ -1485,8 +1520,8 @@
     __ LoadDFromOffset(D1, R0, Double::value_offset() - kHeapObjectTag);
     __ Bind(&double_op);
     __ vsqrtd(D0, D1);
-    const Class& double_class = Class::Handle(
-        Isolate::Current()->object_store()->double_class());
+    const Class& double_class =
+        Class::Handle(Isolate::Current()->object_store()->double_class());
     __ TryAllocate(double_class, &fall_through, R0, R1);  // Result register.
     __ StoreDToOffset(D0, R0, Double::value_offset() - kHeapObjectTag);
     __ Ret();
@@ -1506,8 +1541,8 @@
 void Intrinsifier::Random_nextState(Assembler* assembler) {
   const Library& math_lib = Library::Handle(Library::MathLibrary());
   ASSERT(!math_lib.IsNull());
-  const Class& random_class = Class::Handle(
-      math_lib.LookupClassAllowPrivate(Symbols::_Random()));
+  const Class& random_class =
+      Class::Handle(math_lib.LookupClassAllowPrivate(Symbols::_Random()));
   ASSERT(!random_class.IsNull());
   const Field& state_field = Field::ZoneHandle(
       random_class.LookupInstanceFieldAllowPrivate(Symbols::_state()));
@@ -1516,7 +1551,12 @@
       random_class.LookupStaticFieldAllowPrivate(Symbols::_A()));
   ASSERT(!random_A_field.IsNull());
   ASSERT(random_A_field.is_const());
-  const Instance& a_value = Instance::Handle(random_A_field.StaticValue());
+  Instance& a_value = Instance::Handle(random_A_field.StaticValue());
+  if (a_value.raw() == Object::sentinel().raw() ||
+      a_value.raw() == Object::transition_sentinel().raw()) {
+    random_A_field.EvaluateInitializer();
+    a_value = random_A_field.StaticValue();
+  }
   const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value();
   // 'a_int_value' is a mask.
   ASSERT(Utils::IsUint(32, a_int_value));
@@ -1529,8 +1569,8 @@
   // Addresses of _state[0] and _state[1].
 
   const int64_t disp_0 = Instance::DataOffsetFor(kTypedDataUint32ArrayCid);
-  const int64_t disp_1 = disp_0 +
-      Instance::ElementSizeFor(kTypedDataUint32ArrayCid);
+  const int64_t disp_1 =
+      disp_0 + Instance::ElementSizeFor(kTypedDataUint32ArrayCid);
 
   __ LoadImmediate(R0, a_int32_value);
   __ LoadFromOffset(kWord, R2, R1, disp_0 - kHeapObjectTag);
@@ -1554,16 +1594,93 @@
 }
 
 
+static void RangeCheck(Assembler* assembler,
+                       Register val,
+                       Register tmp,
+                       intptr_t low,
+                       intptr_t high,
+                       Condition cc,
+                       Label* target) {
+  __ AddImmediate(tmp, val, -low);
+  __ CompareImmediate(tmp, high - low);
+  __ b(target, cc);
+}
+
+
+const Condition kIfNotInRange = HI;
+const Condition kIfInRange = LS;
+
+
+static void JumpIfInteger(Assembler* assembler,
+                          Register cid,
+                          Register tmp,
+                          Label* target) {
+  RangeCheck(assembler, cid, tmp, kSmiCid, kBigintCid, kIfInRange, target);
+}
+
+
+static void JumpIfNotInteger(Assembler* assembler,
+                             Register cid,
+                             Register tmp,
+                             Label* target) {
+  RangeCheck(assembler, cid, tmp, kSmiCid, kBigintCid, kIfNotInRange, target);
+}
+
+
+static void JumpIfString(Assembler* assembler,
+                         Register cid,
+                         Register tmp,
+                         Label* target) {
+  RangeCheck(assembler, cid, tmp, kOneByteStringCid, kExternalTwoByteStringCid,
+             kIfInRange, target);
+}
+
+
+static void JumpIfNotString(Assembler* assembler,
+                            Register cid,
+                            Register tmp,
+                            Label* target) {
+  RangeCheck(assembler, cid, tmp, kOneByteStringCid, kExternalTwoByteStringCid,
+             kIfNotInRange, target);
+}
+
+
 // Return type quickly for simple types (not parameterized and not signature).
 void Intrinsifier::ObjectRuntimeType(Assembler* assembler) {
-  Label fall_through;
+  Label fall_through, use_canonical_type, not_double, not_integer;
   __ ldr(R0, Address(SP, 0 * kWordSize));
   __ LoadClassIdMayBeSmi(R1, R0);
+
   __ CompareImmediate(R1, kClosureCid);
   __ b(&fall_through, EQ);  // Instance is a closure.
-  __ LoadClassById(R2, R1);
-  // R2: class of instance (R0).
 
+  __ CompareImmediate(R1, kNumPredefinedCids);
+  __ b(&use_canonical_type, HI);
+
+  __ CompareImmediate(R1, kDoubleCid);
+  __ b(&not_double, NE);
+
+  __ LoadIsolate(R0);
+  __ LoadFromOffset(kWord, R0, R0, Isolate::object_store_offset());
+  __ LoadFromOffset(kWord, R0, R0, ObjectStore::double_type_offset());
+  __ Ret();
+
+  __ Bind(&not_double);
+  JumpIfNotInteger(assembler, R1, R0, &not_integer);
+  __ LoadIsolate(R0);
+  __ LoadFromOffset(kWord, R0, R0, Isolate::object_store_offset());
+  __ LoadFromOffset(kWord, R0, R0, ObjectStore::int_type_offset());
+  __ Ret();
+
+  __ Bind(&not_integer);
+  JumpIfNotString(assembler, R1, R0, &use_canonical_type);
+  __ LoadIsolate(R0);
+  __ LoadFromOffset(kWord, R0, R0, Isolate::object_store_offset());
+  __ LoadFromOffset(kWord, R0, R0, ObjectStore::string_type_offset());
+  __ Ret();
+
+  __ Bind(&use_canonical_type);
+  __ LoadClassById(R2, R1);
   __ ldrh(R3, FieldAddress(R2, Class::num_type_arguments_offset()));
   __ CompareImmediate(R3, 0);
   __ b(&fall_through, NE);
@@ -1577,6 +1694,61 @@
 }
 
 
+void Intrinsifier::ObjectHaveSameRuntimeType(Assembler* assembler) {
+  Label fall_through, different_cids, equal, not_equal, not_integer;
+  __ ldr(R0, Address(SP, 0 * kWordSize));
+  __ LoadClassIdMayBeSmi(R1, R0);
+
+  // Check if left hand size is a closure. Closures are handled in the runtime.
+  __ CompareImmediate(R1, kClosureCid);
+  __ b(&fall_through, EQ);
+
+  __ ldr(R0, Address(SP, 1 * kWordSize));
+  __ LoadClassIdMayBeSmi(R2, R0);
+
+  // Check whether class ids match. If class ids don't match objects can still
+  // have the same runtime type (e.g. multiple string implementation classes
+  // map to a single String type).
+  __ cmp(R1, Operand(R2));
+  __ b(&different_cids, NE);
+
+  // Objects have the same class and neither is a closure.
+  // Check if there are no type arguments. In this case we can return true.
+  // Otherwise fall through into the runtime to handle comparison.
+  __ LoadClassById(R3, R1);
+  __ ldrh(R3, FieldAddress(R3, Class::num_type_arguments_offset()));
+  __ CompareImmediate(R3, 0);
+  __ b(&fall_through, NE);
+
+  __ Bind(&equal);
+  __ LoadObject(R0, Bool::True());
+  __ Ret();
+
+  // Class ids are different. Check if we are comparing runtime types of
+  // two strings (with different representations) or two integers.
+  __ Bind(&different_cids);
+  __ CompareImmediate(R1, kNumPredefinedCids);
+  __ b(&not_equal, HI);
+
+  // Check if both are integers.
+  JumpIfNotInteger(assembler, R1, R0, &not_integer);
+  JumpIfInteger(assembler, R2, R0, &equal);
+  __ b(&not_equal);
+
+  __ Bind(&not_integer);
+  // Check if both are strings.
+  JumpIfNotString(assembler, R1, R0, &not_equal);
+  JumpIfString(assembler, R2, R0, &equal);
+
+  // Neither strings nor integers and have different class ids.
+  __ Bind(&not_equal);
+  __ LoadObject(R0, Bool::False());
+  __ Ret();
+
+  __ Bind(&fall_through);
+}
+
+
 void Intrinsifier::String_getHashCode(Assembler* assembler) {
   __ ldr(R0, Address(SP, 0 * kWordSize));
   __ ldr(R0, FieldAddress(R0, String::hash_offset()));
@@ -1633,9 +1805,9 @@
   __ Bind(&loop);
 
   if (receiver_cid == kOneByteStringCid) {
-    __ ldrb(R4, Address(R0, 0));     // this.codeUnitAt(i + start)
+    __ ldrb(R4, Address(R0, 0));  // this.codeUnitAt(i + start)
   } else {
-    __ ldrh(R4, Address(R0, 0));     // this.codeUnitAt(i + start)
+    __ ldrh(R4, Address(R0, 0));  // this.codeUnitAt(i + start)
   }
   if (other_cid == kOneByteStringCid) {
     __ ldrb(NOTFP, Address(R2, 0));  // other.codeUnitAt(i)
@@ -1664,7 +1836,7 @@
   __ ldr(R0, Address(SP, 2 * kWordSize));  // this
   __ ldr(R1, Address(SP, 1 * kWordSize));  // start
   __ ldr(R2, Address(SP, 0 * kWordSize));  // other
-  __ Push(R4);  // Make ARGS_DESC_REG available.
+  __ Push(R4);                             // Make ARGS_DESC_REG available.
 
   __ tst(R1, Operand(kSmiTagMask));
   __ b(&fall_through, NE);  // 'start' is not a Smi.
@@ -1675,20 +1847,16 @@
   __ CompareClassId(R0, kOneByteStringCid, R3);
   __ b(&try_two_byte, NE);
 
-  GenerateSubstringMatchesSpecialization(assembler,
-                                         kOneByteStringCid,
-                                         kOneByteStringCid,
-                                         &return_true,
+  GenerateSubstringMatchesSpecialization(assembler, kOneByteStringCid,
+                                         kOneByteStringCid, &return_true,
                                          &return_false);
 
   __ Bind(&try_two_byte);
   __ CompareClassId(R0, kTwoByteStringCid, R3);
   __ b(&fall_through, NE);
 
-  GenerateSubstringMatchesSpecialization(assembler,
-                                         kTwoByteStringCid,
-                                         kOneByteStringCid,
-                                         &return_true,
+  GenerateSubstringMatchesSpecialization(assembler, kTwoByteStringCid,
+                                         kOneByteStringCid, &return_true,
                                          &return_false);
 
   __ Bind(&return_true);
@@ -1877,14 +2045,11 @@
   }
 
   // Set the length field using the saved length (R8).
-  __ StoreIntoObjectNoBarrier(R0,
-                              FieldAddress(R0, String::length_offset()),
+  __ StoreIntoObjectNoBarrier(R0, FieldAddress(R0, String::length_offset()),
                               R8);
   // Clear hash.
   __ LoadImmediate(TMP, 0);
-  __ StoreIntoObjectNoBarrier(R0,
-                              FieldAddress(R0, String::hash_offset()),
-                              TMP);
+  __ StoreIntoObjectNoBarrier(R0, FieldAddress(R0, String::hash_offset()), TMP);
 
   NOT_IN_PRODUCT(__ IncrementAllocationStatsWithSize(R4, R2, space));
   __ b(ok);
@@ -1906,7 +2071,7 @@
 
   __ ldr(R2, Address(SP, kEndIndexOffset));
   __ ldr(TMP, Address(SP, kStartIndexOffset));
-  __ orr(R3, R2,  Operand(TMP));
+  __ orr(R3, R2, Operand(TMP));
   __ tst(R3, Operand(kSmiTagMask));
   __ b(&fall_through, NE);  // 'start', 'end' not Smi.
 
@@ -2004,8 +2169,9 @@
   // TODO(zra): try out other sequences.
   ASSERT((string_cid == kOneByteStringCid) ||
          (string_cid == kTwoByteStringCid));
-  const intptr_t offset = (string_cid == kOneByteStringCid) ?
-      OneByteString::data_offset() : TwoByteString::data_offset();
+  const intptr_t offset = (string_cid == kOneByteStringCid)
+                              ? OneByteString::data_offset()
+                              : TwoByteString::data_offset();
   __ AddImmediate(R0, offset - kHeapObjectTag);
   __ AddImmediate(R1, offset - kHeapObjectTag);
   __ SmiUntag(R2);
@@ -2052,7 +2218,8 @@
 }
 
 
-void Intrinsifier::RegExp_ExecuteMatch(Assembler* assembler) {
+void Intrinsifier::IntrinsifyRegExpExecuteMatch(Assembler* assembler,
+                                                bool sticky) {
   if (FLAG_interpret_irregexp) return;
 
   static const intptr_t kRegExpParamOffset = 2 * kWordSize;
@@ -2071,7 +2238,8 @@
   __ LoadClassId(R1, R1);
   __ AddImmediate(R1, R1, -kOneByteStringCid);
   __ add(R1, R2, Operand(R1, LSL, kWordSizeLog2));
-  __ ldr(R0, FieldAddress(R1, RegExp::function_offset(kOneByteStringCid)));
+  __ ldr(R0,
+         FieldAddress(R1, RegExp::function_offset(kOneByteStringCid, sticky)));
 
   // Registers are now set up for the lazy compile stub. It expects the function
   // in R0, the argument descriptor in R4, and IC-Data in R9.
@@ -2091,7 +2259,7 @@
   // R0: Current user tag.
   __ ldr(R0, Address(R1, Isolate::current_tag_offset()));
   // R2: UserTag.
-  __ ldr(R2, Address(SP, + 0 * kWordSize));
+  __ ldr(R2, Address(SP, +0 * kWordSize));
   // Set Isolate::current_tag_.
   __ str(R2, Address(R1, Isolate::current_tag_offset()));
   // R2: UserTag's tag.
diff --git a/runtime/vm/intrinsifier_arm64.cc b/runtime/vm/intrinsifier_arm64.cc
index f9cade2..06f623e 100644
--- a/runtime/vm/intrinsifier_arm64.cc
+++ b/runtime/vm/intrinsifier_arm64.cc
@@ -29,7 +29,9 @@
 #define __ assembler->
 
 
-intptr_t Intrinsifier::ParameterSlotFromSp() { return -1; }
+intptr_t Intrinsifier::ParameterSlotFromSp() {
+  return -1;
+}
 
 
 static bool IsABIPreservedRegister(Register reg) {
@@ -83,10 +85,8 @@
   // Note that R1 is Smi, i.e, times 2.
   ASSERT(kSmiTagShift == 1);
   __ ldr(R2, Address(SP, 0 * kWordSize));  // Value.
-  __ add(R1, R0, Operand(R1, LSL, 2));  // R1 is Smi.
-  __ StoreIntoObject(R0,
-                     FieldAddress(R1, Array::data_offset()),
-                     R2);
+  __ add(R1, R0, Operand(R1, LSL, 2));     // R1 is Smi.
+  __ StoreIntoObject(R0, FieldAddress(R1, Array::data_offset()), R2);
   // Caller is responsible for preserving the value if necessary.
   __ ret();
   __ Bind(&fall_through);
@@ -110,17 +110,13 @@
   __ ldr(R1, Address(SP, kArrayOffset));  // Data argument.
   // R0 is new, no barrier needed.
   __ StoreIntoObjectNoBarrier(
-      R0,
-      FieldAddress(R0, GrowableObjectArray::data_offset()),
-      R1);
+      R0, FieldAddress(R0, GrowableObjectArray::data_offset()), R1);
 
   // R0: new growable array object start as a tagged pointer.
   // Store the type argument field in the growable array object.
   __ ldr(R1, Address(SP, kTypeArgumentsOffset));  // Type argument.
   __ StoreIntoObjectNoBarrier(
-      R0,
-      FieldAddress(R0, GrowableObjectArray::type_arguments_offset()),
-      R1);
+      R0, FieldAddress(R0, GrowableObjectArray::type_arguments_offset()), R1);
 
   // Set the length field in the growable array object to 0.
   __ LoadImmediate(R1, 0);
@@ -158,9 +154,7 @@
   __ ldr(R0, Address(SP, 0 * kWordSize));  // Value.
   ASSERT(kSmiTagShift == 1);
   __ add(R1, R2, Operand(R1, LSL, 2));
-  __ StoreIntoObject(R2,
-                     FieldAddress(R1, Array::data_offset()),
-                     R0);
+  __ StoreIntoObject(R2, FieldAddress(R1, Array::data_offset()), R0);
   __ LoadObject(R0, Object::null_object());
   __ ret();
   __ Bind(&fall_through);
@@ -169,11 +163,16 @@
 
 static int GetScaleFactor(intptr_t size) {
   switch (size) {
-    case 1: return 0;
-    case 2: return 1;
-    case 4: return 2;
-    case 8: return 3;
-    case 16: return 4;
+    case 1:
+      return 0;
+    case 2:
+      return 1;
+    case 4:
+      return 2;
+    case 8:
+      return 3;
+    case 16:
+      return 4;
   }
   UNREACHABLE();
   return -1;
@@ -184,7 +183,7 @@
   Label fall_through;                                                          \
   const intptr_t kArrayLengthStackOffset = 0 * kWordSize;                      \
   NOT_IN_PRODUCT(__ MaybeTraceAllocation(cid, R2, &fall_through));             \
-  __ ldr(R2, Address(SP, kArrayLengthStackOffset));  /* Array length. */       \
+  __ ldr(R2, Address(SP, kArrayLengthStackOffset)); /* Array length. */        \
   /* Check that length is a positive Smi. */                                   \
   /* R2: requested array length argument. */                                   \
   __ tsti(R2, Immediate(kSmiTagMask));                                         \
@@ -206,7 +205,7 @@
                                                                                \
   /* R2: allocation size. */                                                   \
   __ adds(R1, R0, Operand(R2));                                                \
-  __ b(&fall_through, CS);  /* Fail on unsigned overflow. */                   \
+  __ b(&fall_through, CS); /* Fail on unsigned overflow. */                    \
                                                                                \
   /* Check if the allocation fits into the remaining space. */                 \
   /* R0: potential new object start. */                                        \
@@ -234,15 +233,14 @@
     /* Get the class index and insert it into the tags. */                     \
     __ LoadImmediate(TMP, RawObject::ClassIdTag::encode(cid));                 \
     __ orr(R2, R2, Operand(TMP));                                              \
-    __ str(R2, FieldAddress(R0, type_name::tags_offset()));  /* Tags. */       \
+    __ str(R2, FieldAddress(R0, type_name::tags_offset())); /* Tags. */        \
   }                                                                            \
   /* Set the length field. */                                                  \
   /* R0: new object start as a tagged pointer. */                              \
   /* R1: new object end address. */                                            \
-  __ ldr(R2, Address(SP, kArrayLengthStackOffset));  /* Array length. */       \
-  __ StoreIntoObjectNoBarrier(R0,                                              \
-                              FieldAddress(R0, type_name::length_offset()),    \
-                              R2);                                             \
+  __ ldr(R2, Address(SP, kArrayLengthStackOffset)); /* Array length. */        \
+  __ StoreIntoObjectNoBarrier(                                                 \
+      R0, FieldAddress(R0, type_name::length_offset()), R2);                   \
   /* Initialize all array elements to 0. */                                    \
   /* R0: new object start as a tagged pointer. */                              \
   /* R1: new object end address. */                                            \
@@ -261,16 +259,16 @@
   __ Bind(&done);                                                              \
                                                                                \
   __ ret();                                                                    \
-  __ Bind(&fall_through);                                                      \
+  __ Bind(&fall_through);
 
 
 #define TYPED_DATA_ALLOCATOR(clazz)                                            \
-void Intrinsifier::TypedData_##clazz##_factory(Assembler* assembler) {         \
-  intptr_t size = TypedData::ElementSizeInBytes(kTypedData##clazz##Cid);       \
-  intptr_t max_len = TypedData::MaxElements(kTypedData##clazz##Cid);           \
-  int shift = GetScaleFactor(size);                                            \
-  TYPED_ARRAY_ALLOCATION(TypedData, kTypedData##clazz##Cid, max_len, shift);   \
-}
+  void Intrinsifier::TypedData_##clazz##_factory(Assembler* assembler) {       \
+    intptr_t size = TypedData::ElementSizeInBytes(kTypedData##clazz##Cid);     \
+    intptr_t max_len = TypedData::MaxElements(kTypedData##clazz##Cid);         \
+    int shift = GetScaleFactor(size);                                          \
+    TYPED_ARRAY_ALLOCATION(TypedData, kTypedData##clazz##Cid, max_len, shift); \
+  }
 CLASS_LIST_TYPED_DATA(TYPED_DATA_ALLOCATOR)
 #undef TYPED_DATA_ALLOCATOR
 
@@ -278,8 +276,8 @@
 // Loads args from stack into R0 and R1
 // Tests if they are smis, jumps to label not_smi if not.
 static void TestBothArgumentsSmis(Assembler* assembler, Label* not_smi) {
-  __ ldr(R0, Address(SP, + 0 * kWordSize));
-  __ ldr(R1, Address(SP, + 1 * kWordSize));
+  __ ldr(R0, Address(SP, +0 * kWordSize));
+  __ ldr(R1, Address(SP, +1 * kWordSize));
   __ orr(TMP, R0, Operand(R1));
   __ tsti(TMP, Immediate(kSmiTagMask));
   __ b(not_smi, NE);
@@ -289,8 +287,8 @@
 void Intrinsifier::Integer_addFromInteger(Assembler* assembler) {
   Label fall_through;
   TestBothArgumentsSmis(assembler, &fall_through);  // Checks two smis.
-  __ adds(R0, R0, Operand(R1));  // Adds.
-  __ b(&fall_through, VS);  // Fall-through on overflow.
+  __ adds(R0, R0, Operand(R1));                     // Adds.
+  __ b(&fall_through, VS);                          // Fall-through on overflow.
   __ ret();
   __ Bind(&fall_through);
 }
@@ -305,7 +303,7 @@
   Label fall_through;
   TestBothArgumentsSmis(assembler, &fall_through);
   __ subs(R0, R0, Operand(R1));  // Subtract.
-  __ b(&fall_through, VS);  // Fall-through on overflow.
+  __ b(&fall_through, VS);       // Fall-through on overflow.
   __ ret();
   __ Bind(&fall_through);
 }
@@ -315,7 +313,7 @@
   Label fall_through;
   TestBothArgumentsSmis(assembler, &fall_through);
   __ subs(R0, R1, Operand(R0));  // Subtract.
-  __ b(&fall_through, VS);  // Fall-through on overflow.
+  __ b(&fall_through, VS);       // Fall-through on overflow.
   __ ret();
   __ Bind(&fall_through);
 }
@@ -404,8 +402,8 @@
 void Intrinsifier::Integer_moduloFromInteger(Assembler* assembler) {
   // Check to see if we have integer division
   Label neg_remainder, fall_through;
-  __ ldr(R1, Address(SP, + 0 * kWordSize));
-  __ ldr(R0, Address(SP, + 1 * kWordSize));
+  __ ldr(R1, Address(SP, +0 * kWordSize));
+  __ ldr(R0, Address(SP, +1 * kWordSize));
   __ orr(TMP, R0, Operand(R1));
   __ tsti(TMP, Immediate(kSmiTagMask));
   __ b(&fall_through, NE);
@@ -453,15 +451,15 @@
   __ CompareImmediate(R0, 0x4000000000000000);
   __ b(&fall_through, EQ);
   __ SmiTag(R0);  // Not equal. Okay to tag and return.
-  __ ret();  // Return.
+  __ ret();       // Return.
   __ Bind(&fall_through);
 }
 
 
 void Intrinsifier::Integer_negate(Assembler* assembler) {
   Label fall_through;
-  __ ldr(R0, Address(SP, + 0 * kWordSize));  // Grab first argument.
-  __ tsti(R0, Immediate(kSmiTagMask));  // Test for Smi.
+  __ ldr(R0, Address(SP, +0 * kWordSize));  // Grab first argument.
+  __ tsti(R0, Immediate(kSmiTagMask));      // Test for Smi.
   __ b(&fall_through, NE);
   __ negs(R0, R0);
   __ b(&fall_through, VS);
@@ -523,8 +521,7 @@
   Label fall_through;
 
   TestBothArgumentsSmis(assembler, &fall_through);
-  __ CompareImmediate(
-      right, reinterpret_cast<int64_t>(Smi::New(Smi::kBits)));
+  __ CompareImmediate(right, reinterpret_cast<int64_t>(Smi::New(Smi::kBits)));
   __ b(&fall_through, CS);
 
   // Left is not a constant.
@@ -813,24 +810,24 @@
   Label add_loop;
   __ Bind(&add_loop);
   // Loop (a_used+1)/2 times, a_used > 0.
-  __ ldr(R0, Address(R3, 2*Bigint::kBytesPerDigit, Address::PostIndex));
-  __ ldr(R1, Address(R5, 2*Bigint::kBytesPerDigit, Address::PostIndex));
+  __ ldr(R0, Address(R3, 2 * Bigint::kBytesPerDigit, Address::PostIndex));
+  __ ldr(R1, Address(R5, 2 * Bigint::kBytesPerDigit, Address::PostIndex));
   __ adcs(R0, R0, R1);
   __ sub(R9, R3, Operand(R7));  // Does not affect carry flag.
-  __ str(R0, Address(R6, 2*Bigint::kBytesPerDigit, Address::PostIndex));
+  __ str(R0, Address(R6, 2 * Bigint::kBytesPerDigit, Address::PostIndex));
   __ cbnz(&add_loop, R9);  // Does not affect carry flag.
 
   Label last_carry;
   __ sub(R9, R3, Operand(R8));  // Does not affect carry flag.
-  __ cbz(&last_carry, R9);  // If used - a_used == 0.
+  __ cbz(&last_carry, R9);      // If used - a_used == 0.
 
   Label carry_loop;
   __ Bind(&carry_loop);
   // Loop (used+1)/2 - (a_used+1)/2 times, used - a_used > 0.
-  __ ldr(R0, Address(R3, 2*Bigint::kBytesPerDigit, Address::PostIndex));
+  __ ldr(R0, Address(R3, 2 * Bigint::kBytesPerDigit, Address::PostIndex));
   __ adcs(R0, R0, ZR);
   __ sub(R9, R3, Operand(R8));  // Does not affect carry flag.
-  __ str(R0, Address(R6, 2*Bigint::kBytesPerDigit, Address::PostIndex));
+  __ str(R0, Address(R6, 2 * Bigint::kBytesPerDigit, Address::PostIndex));
   __ cbnz(&carry_loop, R9);
 
   __ Bind(&last_carry);
@@ -879,24 +876,24 @@
   Label sub_loop;
   __ Bind(&sub_loop);
   // Loop (a_used+1)/2 times, a_used > 0.
-  __ ldr(R0, Address(R3, 2*Bigint::kBytesPerDigit, Address::PostIndex));
-  __ ldr(R1, Address(R5, 2*Bigint::kBytesPerDigit, Address::PostIndex));
+  __ ldr(R0, Address(R3, 2 * Bigint::kBytesPerDigit, Address::PostIndex));
+  __ ldr(R1, Address(R5, 2 * Bigint::kBytesPerDigit, Address::PostIndex));
   __ sbcs(R0, R0, R1);
   __ sub(R9, R3, Operand(R7));  // Does not affect carry flag.
-  __ str(R0, Address(R6, 2*Bigint::kBytesPerDigit, Address::PostIndex));
+  __ str(R0, Address(R6, 2 * Bigint::kBytesPerDigit, Address::PostIndex));
   __ cbnz(&sub_loop, R9);  // Does not affect carry flag.
 
   Label done;
   __ sub(R9, R3, Operand(R8));  // Does not affect carry flag.
-  __ cbz(&done, R9);  // If used - a_used == 0.
+  __ cbz(&done, R9);            // If used - a_used == 0.
 
   Label carry_loop;
   __ Bind(&carry_loop);
   // Loop (used+1)/2 - (a_used+1)/2 times, used - a_used > 0.
-  __ ldr(R0, Address(R3, 2*Bigint::kBytesPerDigit, Address::PostIndex));
+  __ ldr(R0, Address(R3, 2 * Bigint::kBytesPerDigit, Address::PostIndex));
   __ sbcs(R0, R0, ZR);
   __ sub(R9, R3, Operand(R8));  // Does not affect carry flag.
-  __ str(R0, Address(R6, 2*Bigint::kBytesPerDigit, Address::PostIndex));
+  __ str(R0, Address(R6, 2 * Bigint::kBytesPerDigit, Address::PostIndex));
   __ cbnz(&carry_loop, R9);
 
   __ Bind(&done);
@@ -974,21 +971,21 @@
   // t:   R7:R8 (not live at loop entry)
 
   // uint64_t mi = *mip++
-  __ ldr(R2, Address(R4, 2*Bigint::kBytesPerDigit, Address::PostIndex));
+  __ ldr(R2, Address(R4, 2 * Bigint::kBytesPerDigit, Address::PostIndex));
 
   // uint64_t aj = *ajp
   __ ldr(R0, Address(R5, 0));
 
   // uint128_t t = x*mi + aj + c
-  __ mul(R7, R2, R3);  // R7 = low64(R2*R3).
+  __ mul(R7, R2, R3);    // R7 = low64(R2*R3).
   __ umulh(R8, R2, R3);  // R8 = high64(R2*R3), t = R8:R7 = x*mi.
   __ adds(R7, R7, Operand(R0));
-  __ adc(R8, R8, ZR);  // t += aj.
+  __ adc(R8, R8, ZR);            // t += aj.
   __ adds(R0, R7, Operand(R1));  // t += c, R0 = low64(t).
-  __ adc(R1, R8, ZR);  // c = R1 = high64(t).
+  __ adc(R1, R8, ZR);            // c = R1 = high64(t).
 
   // *ajp++ = low64(t) = R0
-  __ str(R0, Address(R5, 2*Bigint::kBytesPerDigit, Address::PostIndex));
+  __ str(R0, Address(R5, 2 * Bigint::kBytesPerDigit, Address::PostIndex));
 
   // while (--n > 0)
   __ subs(R6, R6, Operand(1));  // --n
@@ -1000,14 +997,14 @@
   // *ajp++ += c
   __ ldr(R0, Address(R5, 0));
   __ adds(R0, R0, Operand(R1));
-  __ str(R0, Address(R5, 2*Bigint::kBytesPerDigit, Address::PostIndex));
+  __ str(R0, Address(R5, 2 * Bigint::kBytesPerDigit, Address::PostIndex));
   __ b(&done, CC);
 
   Label propagate_carry_loop;
   __ Bind(&propagate_carry_loop);
   __ ldr(R0, Address(R5, 0));
   __ adds(R0, R0, Operand(1));
-  __ str(R0, Address(R5, 2*Bigint::kBytesPerDigit, Address::PostIndex));
+  __ str(R0, Address(R5, 2 * Bigint::kBytesPerDigit, Address::PostIndex));
   __ b(&propagate_carry_loop, CS);
 
   __ Bind(&done);
@@ -1051,31 +1048,31 @@
 
   // R3 = x = *xip++, return if x == 0
   Label x_zero;
-  __ ldr(R3, Address(R4, 2*Bigint::kBytesPerDigit, Address::PostIndex));
+  __ ldr(R3, Address(R4, 2 * Bigint::kBytesPerDigit, Address::PostIndex));
   __ tst(R3, Operand(R3));
   __ b(&x_zero, EQ);
 
   // R5 = ajp = &a_digits[i]
   __ ldr(R1, Address(SP, 1 * kWordSize));  // a_digits
-  __ add(R1, R1, Operand(R2, LSL, 2));  // j == 2*i, i is Smi.
+  __ add(R1, R1, Operand(R2, LSL, 2));     // j == 2*i, i is Smi.
   __ add(R5, R1, Operand(TypedData::data_offset() - kHeapObjectTag));
 
   // R6:R1 = t = x*x + *ajp
   __ ldr(R0, Address(R5, 0));
-  __ mul(R1, R3, R3);  // R1 = low64(R3*R3).
-  __ umulh(R6, R3, R3);  // R6 = high64(R3*R3).
+  __ mul(R1, R3, R3);            // R1 = low64(R3*R3).
+  __ umulh(R6, R3, R3);          // R6 = high64(R3*R3).
   __ adds(R1, R1, Operand(R0));  // R6:R1 += *ajp.
-  __ adc(R6, R6, ZR);  // R6 = low64(c) = high64(t).
-  __ mov(R7, ZR);  // R7 = high64(c) = 0.
+  __ adc(R6, R6, ZR);            // R6 = low64(c) = high64(t).
+  __ mov(R7, ZR);                // R7 = high64(c) = 0.
 
   // *ajp++ = low64(t) = R1
-  __ str(R1, Address(R5, 2*Bigint::kBytesPerDigit, Address::PostIndex));
+  __ str(R1, Address(R5, 2 * Bigint::kBytesPerDigit, Address::PostIndex));
 
   // int n = (used - i + 1)/2 - 1
   __ ldr(R0, Address(SP, 0 * kWordSize));  // used is Smi
   __ sub(R8, R0, Operand(R2));
   __ add(R8, R8, Operand(2));
-  __ movn(R0, Immediate(1), 0);  // R0 = ~1 = -2.
+  __ movn(R0, Immediate(1), 0);          // R0 = ~1 = -2.
   __ adds(R8, R0, Operand(R8, ASR, 2));  // while (--n >= 0)
 
   Label loop, done;
@@ -1090,24 +1087,24 @@
   // n:   R8
 
   // uint64_t xi = *xip++
-  __ ldr(R2, Address(R4, 2*Bigint::kBytesPerDigit, Address::PostIndex));
+  __ ldr(R2, Address(R4, 2 * Bigint::kBytesPerDigit, Address::PostIndex));
 
   // uint192_t t = R2:R1:R0 = 2*x*xi + aj + c
-  __ mul(R0, R2, R3);  // R0 = low64(R2*R3) = low64(x*xi).
+  __ mul(R0, R2, R3);    // R0 = low64(R2*R3) = low64(x*xi).
   __ umulh(R1, R2, R3);  // R1 = high64(R2*R3) = high64(x*xi).
   __ adds(R0, R0, Operand(R0));
   __ adcs(R1, R1, R1);
   __ adc(R2, ZR, ZR);  // R2:R1:R0 = R1:R0 + R1:R0 = 2*x*xi.
   __ adds(R0, R0, Operand(R6));
   __ adcs(R1, R1, R7);
-  __ adc(R2, R2, ZR);  // R2:R1:R0 += c.
+  __ adc(R2, R2, ZR);          // R2:R1:R0 += c.
   __ ldr(R7, Address(R5, 0));  // R7 = aj = *ajp.
   __ adds(R0, R0, Operand(R7));
   __ adcs(R6, R1, ZR);
   __ adc(R7, R2, ZR);  // R7:R6:R0 = 2*x*xi + aj + c.
 
   // *ajp++ = low64(t) = R0
-  __ str(R0, Address(R5, 2*Bigint::kBytesPerDigit, Address::PostIndex));
+  __ str(R0, Address(R5, 2 * Bigint::kBytesPerDigit, Address::PostIndex));
 
   // while (--n >= 0)
   __ subs(R8, R8, Operand(1));  // --n
@@ -1198,8 +1195,8 @@
   __ b(&return_qd, EQ);
 
   // R1 = dl = digits[(i >> 1) - 3 .. (i >> 1) - 2]
-  __ ldr(R1,
-         FieldAddress(R1, TypedData::data_offset() - 3*Bigint::kBytesPerDigit));
+  __ ldr(R1, FieldAddress(
+                 R1, TypedData::data_offset() - 3 * Bigint::kBytesPerDigit));
 
   // R5 = yth = yt >> 32
   __ orr(R5, ZR, Operand(R3, LSR, 32));
@@ -1297,8 +1294,8 @@
 
   __ Bind(&return_qd);
   // args[2..3] = qd
-  __ str(R0,
-         FieldAddress(R4, TypedData::data_offset() + 2*Bigint::kBytesPerDigit));
+  __ str(R0, FieldAddress(
+                 R4, TypedData::data_offset() + 2 * Bigint::kBytesPerDigit));
 
   __ LoadImmediate(R0, Smi::RawValue(2));  // Two digits processed.
   __ ret();
@@ -1319,8 +1316,8 @@
   __ ldr(R4, Address(SP, 2 * kWordSize));  // args
 
   // R3 = rho = args[2..3]
-  __ ldr(R3,
-         FieldAddress(R4, TypedData::data_offset() + 2*Bigint::kBytesPerDigit));
+  __ ldr(R3, FieldAddress(
+                 R4, TypedData::data_offset() + 2 * Bigint::kBytesPerDigit));
 
   // R2 = digits[i >> 1 .. (i >> 1) + 1]
   // R0 = i as Smi, R1 = digits
@@ -1332,8 +1329,8 @@
   __ mul(R0, R2, R3);  // R0 = low64(R2*R3).
 
   // args[4 .. 5] = R0
-  __ str(R0,
-         FieldAddress(R4, TypedData::data_offset() + 4*Bigint::kBytesPerDigit));
+  __ str(R0, FieldAddress(
+                 R4, TypedData::data_offset() + 4 * Bigint::kBytesPerDigit));
 
   __ LoadImmediate(R0, Smi::RawValue(2));  // Two digits processed.
   __ ret();
@@ -1425,14 +1422,23 @@
   __ ldr(R0, Address(SP, 1 * kWordSize));  // Left argument.
   __ LoadDFieldFromOffset(V0, R0, Double::value_offset());
   switch (kind) {
-    case Token::kADD: __ faddd(V0, V0, V1); break;
-    case Token::kSUB: __ fsubd(V0, V0, V1); break;
-    case Token::kMUL: __ fmuld(V0, V0, V1); break;
-    case Token::kDIV: __ fdivd(V0, V0, V1); break;
-    default: UNREACHABLE();
+    case Token::kADD:
+      __ faddd(V0, V0, V1);
+      break;
+    case Token::kSUB:
+      __ fsubd(V0, V0, V1);
+      break;
+    case Token::kMUL:
+      __ fmuld(V0, V0, V1);
+      break;
+    case Token::kDIV:
+      __ fdivd(V0, V0, V1);
+      break;
+    default:
+      UNREACHABLE();
   }
-  const Class& double_class = Class::Handle(
-      Isolate::Current()->object_store()->double_class());
+  const Class& double_class =
+      Class::Handle(Isolate::Current()->object_store()->double_class());
   __ TryAllocate(double_class, &fall_through, R0, R1);
   __ StoreDFieldToOffset(V0, R0, Double::value_offset());
   __ ret();
@@ -1479,8 +1485,8 @@
   __ ldr(R0, Address(SP, 1 * kWordSize));
   __ LoadDFieldFromOffset(V0, R0, Double::value_offset());
   __ fmuld(V0, V0, V1);
-  const Class& double_class = Class::Handle(
-      Isolate::Current()->object_store()->double_class());
+  const Class& double_class =
+      Class::Handle(Isolate::Current()->object_store()->double_class());
   __ TryAllocate(double_class, &fall_through, R0, R1);
   __ StoreDFieldToOffset(V0, R0, Double::value_offset());
   __ ret();
@@ -1497,8 +1503,8 @@
   // Is Smi.
   __ SmiUntag(R0);
   __ scvtfdx(V0, R0);
-  const Class& double_class = Class::Handle(
-      Isolate::Current()->object_store()->double_class());
+  const Class& double_class =
+      Class::Handle(Isolate::Current()->object_store()->double_class());
   __ TryAllocate(double_class, &fall_through, R0, R1);
   __ StoreDFieldToOffset(V0, R0, Double::value_offset());
   __ ret();
@@ -1507,7 +1513,6 @@
 
 
 void Intrinsifier::Double_getIsNaN(Assembler* assembler) {
-  Label is_true;
   __ ldr(R0, Address(SP, 0 * kWordSize));
   __ LoadDFieldFromOffset(V0, R0, Double::value_offset());
   __ fcmpd(V0, V0);
@@ -1518,6 +1523,20 @@
 }
 
 
+void Intrinsifier::Double_getIsInfinite(Assembler* assembler) {
+  __ ldr(R0, Address(SP, 0 * kWordSize));
+  __ LoadFieldFromOffset(R0, R0, Double::value_offset());
+  // Mask off the sign.
+  __ AndImmediate(R0, R0, 0x7FFFFFFFFFFFFFFFLL);
+  // Compare with +infinity.
+  __ CompareImmediate(R0, 0x7FF0000000000000LL);
+  __ LoadObject(R0, Bool::False());
+  __ LoadObject(TMP, Bool::True());
+  __ csel(R0, TMP, R0, EQ);
+  __ ret();
+}
+
+
 void Intrinsifier::Double_getIsNegative(Assembler* assembler) {
   const Register false_reg = R0;
   const Register true_reg = R2;
@@ -1529,7 +1548,7 @@
   __ LoadObject(true_reg, Bool::True());
   __ LoadObject(false_reg, Bool::False());
   __ b(&is_false, VS);  // NaN -> false.
-  __ b(&is_zero, EQ);  // Check for negative zero.
+  __ b(&is_zero, EQ);   // Check for negative zero.
   __ b(&is_false, CS);  // >= 0 -> false.
 
   __ Bind(&is_true);
@@ -1577,8 +1596,8 @@
   __ LoadDFieldFromOffset(V1, R0, Double::value_offset());
   __ Bind(&double_op);
   __ fsqrtd(V0, V1);
-  const Class& double_class = Class::Handle(
-      Isolate::Current()->object_store()->double_class());
+  const Class& double_class =
+      Class::Handle(Isolate::Current()->object_store()->double_class());
   __ TryAllocate(double_class, &fall_through, R0, R1);
   __ StoreDFieldToOffset(V0, R0, Double::value_offset());
   __ ret();
@@ -1596,8 +1615,8 @@
 void Intrinsifier::Random_nextState(Assembler* assembler) {
   const Library& math_lib = Library::Handle(Library::MathLibrary());
   ASSERT(!math_lib.IsNull());
-  const Class& random_class = Class::Handle(
-      math_lib.LookupClassAllowPrivate(Symbols::_Random()));
+  const Class& random_class =
+      Class::Handle(math_lib.LookupClassAllowPrivate(Symbols::_Random()));
   ASSERT(!random_class.IsNull());
   const Field& state_field = Field::ZoneHandle(
       random_class.LookupInstanceFieldAllowPrivate(Symbols::_state()));
@@ -1606,7 +1625,12 @@
       random_class.LookupStaticFieldAllowPrivate(Symbols::_A()));
   ASSERT(!random_A_field.IsNull());
   ASSERT(random_A_field.is_const());
-  const Instance& a_value = Instance::Handle(random_A_field.StaticValue());
+  Instance& a_value = Instance::Handle(random_A_field.StaticValue());
+  if (a_value.raw() == Object::sentinel().raw() ||
+      a_value.raw() == Object::transition_sentinel().raw()) {
+    random_A_field.EvaluateInitializer();
+    a_value = random_A_field.StaticValue();
+  }
   const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value();
 
   // Receiver.
@@ -1640,16 +1664,93 @@
 }
 
 
+static void RangeCheck(Assembler* assembler,
+                       Register val,
+                       Register tmp,
+                       intptr_t low,
+                       intptr_t high,
+                       Condition cc,
+                       Label* target) {
+  __ AddImmediate(tmp, val, -low);
+  __ CompareImmediate(tmp, high - low);
+  __ b(target, cc);
+}
+
+
+const Condition kIfNotInRange = HI;
+const Condition kIfInRange = LS;
+
+
+static void JumpIfInteger(Assembler* assembler,
+                          Register cid,
+                          Register tmp,
+                          Label* target) {
+  RangeCheck(assembler, cid, tmp, kSmiCid, kBigintCid, kIfInRange, target);
+}
+
+
+static void JumpIfNotInteger(Assembler* assembler,
+                             Register cid,
+                             Register tmp,
+                             Label* target) {
+  RangeCheck(assembler, cid, tmp, kSmiCid, kBigintCid, kIfNotInRange, target);
+}
+
+
+static void JumpIfString(Assembler* assembler,
+                         Register cid,
+                         Register tmp,
+                         Label* target) {
+  RangeCheck(assembler, cid, tmp, kOneByteStringCid, kExternalTwoByteStringCid,
+             kIfInRange, target);
+}
+
+
+static void JumpIfNotString(Assembler* assembler,
+                            Register cid,
+                            Register tmp,
+                            Label* target) {
+  RangeCheck(assembler, cid, tmp, kOneByteStringCid, kExternalTwoByteStringCid,
+             kIfNotInRange, target);
+}
+
+
 // Return type quickly for simple types (not parameterized and not signature).
 void Intrinsifier::ObjectRuntimeType(Assembler* assembler) {
-  Label fall_through;
+  Label fall_through, use_canonical_type, not_double, not_integer;
   __ ldr(R0, Address(SP, 0 * kWordSize));
   __ LoadClassIdMayBeSmi(R1, R0);
+
   __ CompareImmediate(R1, kClosureCid);
   __ b(&fall_through, EQ);  // Instance is a closure.
-  __ LoadClassById(R2, R1);
-  // R2: class of instance (R0).
 
+  __ CompareImmediate(R1, kNumPredefinedCids);
+  __ b(&use_canonical_type, HI);
+
+  __ CompareImmediate(R1, kDoubleCid);
+  __ b(&not_double, NE);
+
+  __ LoadIsolate(R0);
+  __ LoadFromOffset(R0, R0, Isolate::object_store_offset());
+  __ LoadFromOffset(R0, R0, ObjectStore::double_type_offset());
+  __ ret();
+
+  __ Bind(&not_double);
+  JumpIfNotInteger(assembler, R1, R0, &not_integer);
+  __ LoadIsolate(R0);
+  __ LoadFromOffset(R0, R0, Isolate::object_store_offset());
+  __ LoadFromOffset(R0, R0, ObjectStore::int_type_offset());
+  __ ret();
+
+  __ Bind(&not_integer);
+  JumpIfNotString(assembler, R1, R0, &use_canonical_type);
+  __ LoadIsolate(R0);
+  __ LoadFromOffset(R0, R0, Isolate::object_store_offset());
+  __ LoadFromOffset(R0, R0, ObjectStore::string_type_offset());
+  __ ret();
+
+  __ Bind(&use_canonical_type);
+  __ LoadClassById(R2, R1);
   __ ldr(R3, FieldAddress(R2, Class::num_type_arguments_offset()), kHalfword);
   __ CompareImmediate(R3, 0);
   __ b(&fall_through, NE);
@@ -1663,6 +1764,61 @@
 }
 
 
+void Intrinsifier::ObjectHaveSameRuntimeType(Assembler* assembler) {
+  Label fall_through, different_cids, equal, not_equal, not_integer;
+  __ ldr(R0, Address(SP, 0 * kWordSize));
+  __ LoadClassIdMayBeSmi(R1, R0);
+
+  // Check if left hand size is a closure. Closures are handled in the runtime.
+  __ CompareImmediate(R1, kClosureCid);
+  __ b(&fall_through, EQ);
+
+  __ ldr(R0, Address(SP, 1 * kWordSize));
+  __ LoadClassIdMayBeSmi(R2, R0);
+
+  // Check whether class ids match. If class ids don't match objects can still
+  // have the same runtime type (e.g. multiple string implementation classes
+  // map to a single String type).
+  __ cmp(R1, Operand(R2));
+  __ b(&different_cids, NE);
+
+  // Objects have the same class and neither is a closure.
+  // Check if there are no type arguments. In this case we can return true.
+  // Otherwise fall through into the runtime to handle comparison.
+  __ LoadClassById(R3, R1);
+  __ ldr(R3, FieldAddress(R3, Class::num_type_arguments_offset()), kHalfword);
+  __ CompareImmediate(R3, 0);
+  __ b(&fall_through, NE);
+
+  __ Bind(&equal);
+  __ LoadObject(R0, Bool::True());
+  __ ret();
+
+  // Class ids are different. Check if we are comparing runtime types of
+  // two strings (with different representations) or two integers.
+  __ Bind(&different_cids);
+  __ CompareImmediate(R1, kNumPredefinedCids);
+  __ b(&not_equal, HI);
+
+  // Check if both are integers.
+  JumpIfNotInteger(assembler, R1, R0, &not_integer);
+  JumpIfInteger(assembler, R2, R0, &equal);
+  __ b(&not_equal);
+
+  __ Bind(&not_integer);
+  // Check if both are strings.
+  JumpIfNotString(assembler, R1, R0, &not_equal);
+  JumpIfString(assembler, R2, R0, &equal);
+
+  // Neither strings nor integers and have different class ids.
+  __ Bind(&not_equal);
+  __ LoadObject(R0, Bool::False());
+  __ ret();
+
+  __ Bind(&fall_through);
+}
+
+
 void Intrinsifier::String_getHashCode(Assembler* assembler) {
   Label fall_through;
   __ ldr(R0, Address(SP, 0 * kWordSize));
@@ -1760,20 +1916,16 @@
   __ CompareClassId(R0, kOneByteStringCid);
   __ b(&fall_through, NE);
 
-  GenerateSubstringMatchesSpecialization(assembler,
-                                         kOneByteStringCid,
-                                         kOneByteStringCid,
-                                         &return_true,
+  GenerateSubstringMatchesSpecialization(assembler, kOneByteStringCid,
+                                         kOneByteStringCid, &return_true,
                                          &return_false);
 
   __ Bind(&try_two_byte);
   __ CompareClassId(R0, kTwoByteStringCid);
   __ b(&fall_through, NE);
 
-  GenerateSubstringMatchesSpecialization(assembler,
-                                         kTwoByteStringCid,
-                                         kOneByteStringCid,
-                                         &return_true,
+  GenerateSubstringMatchesSpecialization(assembler, kTwoByteStringCid,
+                                         kOneByteStringCid, &return_true,
                                          &return_false);
 
   __ Bind(&return_true);
@@ -1808,8 +1960,7 @@
   __ CompareImmediate(R1, Symbols::kNumberOfOneCharCodeSymbols);
   __ b(&fall_through, GE);
   __ ldr(R0, Address(THR, Thread::predefined_symbols_address_offset()));
-  __ AddImmediate(
-      R0, R0, Symbols::kNullCharCodeSymbolOffset * kWordSize);
+  __ AddImmediate(R0, R0, Symbols::kNullCharCodeSymbolOffset * kWordSize);
   __ ldr(R0, Address(R0, R1, UXTX, Address::Scaled));
   __ ret();
 
@@ -1822,8 +1973,7 @@
   __ CompareImmediate(R1, Symbols::kNumberOfOneCharCodeSymbols);
   __ b(&fall_through, GE);
   __ ldr(R0, Address(THR, Thread::predefined_symbols_address_offset()));
-  __ AddImmediate(
-      R0, R0, Symbols::kNullCharCodeSymbolOffset * kWordSize);
+  __ AddImmediate(R0, R0, Symbols::kNullCharCodeSymbolOffset * kWordSize);
   __ ldr(R0, Address(R0, R1, UXTX, Address::Scaled));
   __ ret();
 
@@ -1891,8 +2041,7 @@
   __ eorw(R0, R0, Operand(R0, LSR, 11));
   __ addw(R0, R0, Operand(R0, LSL, 15));
   // hash_ = hash_ & ((static_cast<intptr_t>(1) << bits) - 1);
-  __ AndImmediate(
-      R0, R0, (static_cast<intptr_t>(1) << String::kHashBits) - 1);
+  __ AndImmediate(R0, R0, (static_cast<intptr_t>(1) << String::kHashBits) - 1);
   __ CompareRegisters(R0, ZR);
   // return hash_ == 0 ? 1 : hash_;
   __ Bind(&done);
@@ -1963,8 +2112,7 @@
   }
 
   // Set the length field using the saved length (R6).
-  __ StoreIntoObjectNoBarrier(R0,
-                              FieldAddress(R0, String::length_offset()),
+  __ StoreIntoObjectNoBarrier(R0, FieldAddress(R0, String::length_offset()),
                               R6);
   // Clear hash.
   __ mov(TMP, ZR);
@@ -1988,7 +2136,7 @@
 
   __ ldr(R2, Address(SP, kEndIndexOffset));
   __ ldr(TMP, Address(SP, kStartIndexOffset));
-  __ orr(R3, R2,  Operand(TMP));
+  __ orr(R3, R2, Operand(TMP));
   __ tsti(R3, Immediate(kSmiTagMask));
   __ b(&fall_through, NE);  // 'start', 'end' not Smi.
 
@@ -2087,8 +2235,9 @@
   // TODO(zra): try out other sequences.
   ASSERT((string_cid == kOneByteStringCid) ||
          (string_cid == kTwoByteStringCid));
-  const intptr_t offset = (string_cid == kOneByteStringCid) ?
-      OneByteString::data_offset() : TwoByteString::data_offset();
+  const intptr_t offset = (string_cid == kOneByteStringCid)
+                              ? OneByteString::data_offset()
+                              : TwoByteString::data_offset();
   __ AddImmediate(R0, R0, offset - kHeapObjectTag);
   __ AddImmediate(R1, R1, offset - kHeapObjectTag);
   __ SmiUntag(R2);
@@ -2135,7 +2284,8 @@
 }
 
 
-void Intrinsifier::RegExp_ExecuteMatch(Assembler* assembler) {
+void Intrinsifier::IntrinsifyRegExpExecuteMatch(Assembler* assembler,
+                                                bool sticky) {
   if (FLAG_interpret_irregexp) return;
 
   static const intptr_t kRegExpParamOffset = 2 * kWordSize;
@@ -2154,7 +2304,8 @@
   __ LoadClassId(R1, R1);
   __ AddImmediate(R1, R1, -kOneByteStringCid);
   __ add(R1, R2, Operand(R1, LSL, kWordSizeLog2));
-  __ ldr(R0, FieldAddress(R1, RegExp::function_offset(kOneByteStringCid)));
+  __ ldr(R0,
+         FieldAddress(R1, RegExp::function_offset(kOneByteStringCid, sticky)));
 
   // Registers are now set up for the lazy compile stub. It expects the function
   // in R0, the argument descriptor in R4, and IC-Data in R5.
@@ -2174,7 +2325,7 @@
   // R0: Current user tag.
   __ ldr(R0, Address(R1, Isolate::current_tag_offset()));
   // R2: UserTag.
-  __ ldr(R2, Address(SP, + 0 * kWordSize));
+  __ ldr(R2, Address(SP, +0 * kWordSize));
   // Set Isolate::current_tag_.
   __ str(R2, Address(R1, Isolate::current_tag_offset()));
   // R2: UserTag's tag.
diff --git a/runtime/vm/intrinsifier_dbc.cc b/runtime/vm/intrinsifier_dbc.cc
index 3d0b5d1..e967468 100644
--- a/runtime/vm/intrinsifier_dbc.cc
+++ b/runtime/vm/intrinsifier_dbc.cc
@@ -21,14 +21,16 @@
 
 DECLARE_FLAG(bool, interpret_irregexp);
 
-intptr_t Intrinsifier::ParameterSlotFromSp() { return -1; }
+intptr_t Intrinsifier::ParameterSlotFromSp() {
+  return -1;
+}
 
 #define DEFINE_FUNCTION(class_name, test_function_name, enum_name, type, fp)   \
   void Intrinsifier::enum_name(Assembler* assembler) {                         \
     if (Simulator::IsSupportedIntrinsic(Simulator::k##enum_name##Intrinsic)) { \
       assembler->Intrinsic(Simulator::k##enum_name##Intrinsic);                \
     }                                                                          \
-  }                                                                            \
+  }
 
 ALL_INTRINSICS_LIST(DEFINE_FUNCTION)
 GRAPH_INTRINSICS_LIST(DEFINE_FUNCTION)
diff --git a/runtime/vm/intrinsifier_ia32.cc b/runtime/vm/intrinsifier_ia32.cc
index b9ea3a1..6c0f6a1 100644
--- a/runtime/vm/intrinsifier_ia32.cc
+++ b/runtime/vm/intrinsifier_ia32.cc
@@ -37,7 +37,9 @@
 #define __ assembler->
 
 
-intptr_t Intrinsifier::ParameterSlotFromSp() { return 0; }
+intptr_t Intrinsifier::ParameterSlotFromSp() {
+  return 0;
+}
 
 
 void Intrinsifier::IntrinsicCallPrologue(Assembler* assembler) {
@@ -56,8 +58,8 @@
 
 static intptr_t ComputeObjectArrayTypeArgumentsOffset() {
   const Library& core_lib = Library::Handle(Library::CoreLibrary());
-  const Class& cls = Class::Handle(
-      core_lib.LookupClassAllowPrivate(Symbols::_List()));
+  const Class& cls =
+      Class::Handle(core_lib.LookupClassAllowPrivate(Symbols::_List()));
   ASSERT(!cls.IsNull());
   ASSERT(cls.NumTypeArguments() == 1);
   const intptr_t field_offset = cls.type_arguments_field_offset();
@@ -77,12 +79,12 @@
     const Immediate& raw_null =
         Immediate(reinterpret_cast<intptr_t>(Object::null()));
     Label checked_ok;
-    __ movl(EDI, Address(ESP, + 1 * kWordSize));  // Value.
+    __ movl(EDI, Address(ESP, +1 * kWordSize));  // Value.
     // Null value is valid for any type.
     __ cmpl(EDI, raw_null);
     __ j(EQUAL, &checked_ok, Assembler::kNearJump);
 
-    __ movl(EBX, Address(ESP, + 3 * kWordSize));  // Array.
+    __ movl(EBX, Address(ESP, +3 * kWordSize));  // Array.
     __ movl(EBX, FieldAddress(EBX, type_args_field_offset));
     // EBX: Type arguments of array.
     __ cmpl(EBX, raw_null);
@@ -91,21 +93,21 @@
     // Get type at index 0.
     __ movl(EAX, FieldAddress(EBX, TypeArguments::type_at_offset(0)));
     __ CompareObject(EAX, Object::dynamic_type());
-    __ j(EQUAL,  &checked_ok, Assembler::kNearJump);
+    __ j(EQUAL, &checked_ok, Assembler::kNearJump);
     // Check for int and num.
     __ testl(EDI, Immediate(kSmiTagMask));  // Value is Smi?
-    __ j(NOT_ZERO, &fall_through);  // Non-smi value.
+    __ j(NOT_ZERO, &fall_through);          // Non-smi value.
     __ CompareObject(EAX, Type::ZoneHandle(Type::IntType()));
-    __ j(EQUAL,  &checked_ok, Assembler::kNearJump);
+    __ j(EQUAL, &checked_ok, Assembler::kNearJump);
     __ CompareObject(EAX, Type::ZoneHandle(Type::Number()));
     __ j(NOT_EQUAL, &fall_through);
     __ Bind(&checked_ok);
   }
-  __ movl(EBX, Address(ESP, + 2 * kWordSize));  // Index.
+  __ movl(EBX, Address(ESP, +2 * kWordSize));  // Index.
   __ testl(EBX, Immediate(kSmiTagMask));
   // Index not Smi.
   __ j(NOT_ZERO, &fall_through);
-  __ movl(EAX, Address(ESP, + 3 * kWordSize));  // Array.
+  __ movl(EAX, Address(ESP, +3 * kWordSize));  // Array.
   // Range check.
   __ cmpl(EBX, FieldAddress(EAX, Array::length_offset()));
   // Runtime throws exception.
@@ -113,9 +115,8 @@
   // Note that EBX is Smi, i.e, times 2.
   ASSERT(kSmiTagShift == 1);
   // Destroy ECX (ic data) as we will not continue in the function.
-  __ movl(ECX, Address(ESP, + 1 * kWordSize));  // Value.
-  __ StoreIntoObject(EAX,
-                     FieldAddress(EAX, EBX, TIMES_2, Array::data_offset()),
+  __ movl(ECX, Address(ESP, +1 * kWordSize));  // Value.
+  __ StoreIntoObject(EAX, FieldAddress(EAX, EBX, TIMES_2, Array::data_offset()),
                      ECX);
   // Caller is responsible of preserving the value if necessary.
   __ ret();
@@ -142,16 +143,13 @@
   __ movl(EBX, Address(ESP, kArrayOffset));  // data argument.
   // EAX is new, no barrier needed.
   __ StoreIntoObjectNoBarrier(
-      EAX,
-      FieldAddress(EAX, GrowableObjectArray::data_offset()),
-      EBX);
+      EAX, FieldAddress(EAX, GrowableObjectArray::data_offset()), EBX);
 
   // EAX: new growable array object start as a tagged pointer.
   // Store the type argument field in the growable array object.
   __ movl(EBX, Address(ESP, kTypeArgumentsOffset));  // type argument.
   __ StoreIntoObjectNoBarrier(
-      EAX,
-      FieldAddress(EAX, GrowableObjectArray::type_arguments_offset()),
+      EAX, FieldAddress(EAX, GrowableObjectArray::type_arguments_offset()),
       EBX);
 
   __ ZeroInitSmiField(FieldAddress(EAX, GrowableObjectArray::length_offset()));
@@ -169,7 +167,7 @@
   if (Isolate::Current()->type_checks()) return;
 
   Label fall_through;
-  __ movl(EAX, Address(ESP, + 2 * kWordSize));  // Array.
+  __ movl(EAX, Address(ESP, +2 * kWordSize));  // Array.
   __ movl(EBX, FieldAddress(EAX, GrowableObjectArray::length_offset()));
   // EBX: length.
   __ movl(EDI, FieldAddress(EAX, GrowableObjectArray::data_offset()));
@@ -179,10 +177,9 @@
   __ j(EQUAL, &fall_through);  // Must grow data.
   __ IncrementSmiField(FieldAddress(EAX, GrowableObjectArray::length_offset()),
                        1);
-  __ movl(EAX, Address(ESP, + 1 * kWordSize));  // Value
+  __ movl(EAX, Address(ESP, +1 * kWordSize));  // Value
   ASSERT(kSmiTagShift == 1);
-  __ StoreIntoObject(EDI,
-                     FieldAddress(EDI, EBX, TIMES_2, Array::data_offset()),
+  __ StoreIntoObject(EDI, FieldAddress(EDI, EBX, TIMES_2, Array::data_offset()),
                      EAX);
   const Immediate& raw_null =
       Immediate(reinterpret_cast<int32_t>(Object::null()));
@@ -196,7 +193,7 @@
   Label fall_through;                                                          \
   const intptr_t kArrayLengthStackOffset = 1 * kWordSize;                      \
   NOT_IN_PRODUCT(__ MaybeTraceAllocation(cid, EDI, &fall_through, false));     \
-  __ movl(EDI, Address(ESP, kArrayLengthStackOffset));  /* Array length. */    \
+  __ movl(EDI, Address(ESP, kArrayLengthStackOffset)); /* Array length. */     \
   /* Check that length is a positive Smi. */                                   \
   /* EDI: requested array length argument. */                                  \
   __ testl(EDI, Immediate(kSmiTagMask));                                       \
@@ -258,22 +255,21 @@
                                                                                \
     /* Get the class index and insert it into the tags. */                     \
     __ orl(EDI, Immediate(RawObject::ClassIdTag::encode(cid)));                \
-    __ movl(FieldAddress(EAX, type_name::tags_offset()), EDI);  /* Tags. */    \
+    __ movl(FieldAddress(EAX, type_name::tags_offset()), EDI); /* Tags. */     \
   }                                                                            \
   /* Set the length field. */                                                  \
   /* EAX: new object start as a tagged pointer. */                             \
   /* EBX: new object end address. */                                           \
-  __ movl(EDI, Address(ESP, kArrayLengthStackOffset));  /* Array length. */    \
-  __ StoreIntoObjectNoBarrier(EAX,                                             \
-                              FieldAddress(EAX, type_name::length_offset()),   \
-                              EDI);                                            \
+  __ movl(EDI, Address(ESP, kArrayLengthStackOffset)); /* Array length. */     \
+  __ StoreIntoObjectNoBarrier(                                                 \
+      EAX, FieldAddress(EAX, type_name::length_offset()), EDI);                \
   /* Initialize all array elements to 0. */                                    \
   /* EAX: new object start as a tagged pointer. */                             \
   /* EBX: new object end address. */                                           \
   /* EDI: iterator which initially points to the start of the variable */      \
   /* ECX: scratch register. */                                                 \
   /* data area to be initialized. */                                           \
-  __ xorl(ECX, ECX);  /* Zero. */                                              \
+  __ xorl(ECX, ECX); /* Zero. */                                               \
   __ leal(EDI, FieldAddress(EAX, sizeof(Raw##type_name)));                     \
   Label done, init_loop;                                                       \
   __ Bind(&init_loop);                                                         \
@@ -285,16 +281,21 @@
   __ Bind(&done);                                                              \
                                                                                \
   __ ret();                                                                    \
-  __ Bind(&fall_through);                                                      \
+  __ Bind(&fall_through);
 
 
 static ScaleFactor GetScaleFactor(intptr_t size) {
   switch (size) {
-    case 1: return TIMES_1;
-    case 2: return TIMES_2;
-    case 4: return TIMES_4;
-    case 8: return TIMES_8;
-    case 16: return TIMES_16;
+    case 1:
+      return TIMES_1;
+    case 2:
+      return TIMES_2;
+    case 4:
+      return TIMES_4;
+    case 8:
+      return TIMES_8;
+    case 16:
+      return TIMES_16;
   }
   UNREACHABLE();
   return static_cast<ScaleFactor>(0);
@@ -302,12 +303,12 @@
 
 
 #define TYPED_DATA_ALLOCATOR(clazz)                                            \
-void Intrinsifier::TypedData_##clazz##_factory(Assembler* assembler) {         \
-  intptr_t size = TypedData::ElementSizeInBytes(kTypedData##clazz##Cid);       \
-  intptr_t max_len = TypedData::MaxElements(kTypedData##clazz##Cid);           \
-  ScaleFactor scale = GetScaleFactor(size);                                    \
-  TYPED_ARRAY_ALLOCATION(TypedData, kTypedData##clazz##Cid, max_len, scale);   \
-}
+  void Intrinsifier::TypedData_##clazz##_factory(Assembler* assembler) {       \
+    intptr_t size = TypedData::ElementSizeInBytes(kTypedData##clazz##Cid);     \
+    intptr_t max_len = TypedData::MaxElements(kTypedData##clazz##Cid);         \
+    ScaleFactor scale = GetScaleFactor(size);                                  \
+    TYPED_ARRAY_ALLOCATION(TypedData, kTypedData##clazz##Cid, max_len, scale); \
+  }
 CLASS_LIST_TYPED_DATA(TYPED_DATA_ALLOCATOR)
 #undef TYPED_DATA_ALLOCATOR
 
@@ -315,8 +316,8 @@
 // Tests if two top most arguments are smis, jumps to label not_smi if not.
 // Topmost argument is in EAX.
 static void TestBothArgumentsSmis(Assembler* assembler, Label* not_smi) {
-  __ movl(EAX, Address(ESP, + 1 * kWordSize));
-  __ movl(EBX, Address(ESP, + 2 * kWordSize));
+  __ movl(EAX, Address(ESP, +1 * kWordSize));
+  __ movl(EBX, Address(ESP, +2 * kWordSize));
   __ orl(EBX, EAX);
   __ testl(EBX, Immediate(kSmiTagMask));
   __ j(NOT_ZERO, not_smi, Assembler::kNearJump);
@@ -326,7 +327,7 @@
 void Intrinsifier::Integer_addFromInteger(Assembler* assembler) {
   Label fall_through;
   TestBothArgumentsSmis(assembler, &fall_through);
-  __ addl(EAX, Address(ESP, + 2 * kWordSize));
+  __ addl(EAX, Address(ESP, +2 * kWordSize));
   __ j(OVERFLOW, &fall_through, Assembler::kNearJump);
   // Result is in EAX.
   __ ret();
@@ -342,7 +343,7 @@
 void Intrinsifier::Integer_subFromInteger(Assembler* assembler) {
   Label fall_through;
   TestBothArgumentsSmis(assembler, &fall_through);
-  __ subl(EAX, Address(ESP, + 2 * kWordSize));
+  __ subl(EAX, Address(ESP, +2 * kWordSize));
   __ j(OVERFLOW, &fall_through, Assembler::kNearJump);
   // Result is in EAX.
   __ ret();
@@ -354,7 +355,7 @@
   Label fall_through;
   TestBothArgumentsSmis(assembler, &fall_through);
   __ movl(EBX, EAX);
-  __ movl(EAX, Address(ESP, + 2 * kWordSize));
+  __ movl(EAX, Address(ESP, +2 * kWordSize));
   __ subl(EAX, EBX);
   __ j(OVERFLOW, &fall_through, Assembler::kNearJump);
   // Result is in EAX.
@@ -363,13 +364,12 @@
 }
 
 
-
 void Intrinsifier::Integer_mulFromInteger(Assembler* assembler) {
   Label fall_through;
   TestBothArgumentsSmis(assembler, &fall_through);
   ASSERT(kSmiTag == 0);  // Adjust code below if not the case.
   __ SmiUntag(EAX);
-  __ imull(EAX, Address(ESP, + 2 * kWordSize));
+  __ imull(EAX, Address(ESP, +2 * kWordSize));
   __ j(OVERFLOW, &fall_through, Assembler::kNearJump);
   // Result is in EAX.
   __ ret();
@@ -406,7 +406,7 @@
   __ j(LESS, &modulo, Assembler::kNearJump);
   // left is positive.
   __ cmpl(EAX, EBX);
-  __ j(GREATER, &modulo,  Assembler::kNearJump);
+  __ j(GREATER, &modulo, Assembler::kNearJump);
   // left is less than right, result is left (EAX).
   __ ret();
 
@@ -434,7 +434,7 @@
 void Intrinsifier::Integer_moduloFromInteger(Assembler* assembler) {
   Label fall_through, subtract;
   TestBothArgumentsSmis(assembler, &fall_through);
-  __ movl(EBX, Address(ESP, + 2 * kWordSize));
+  __ movl(EBX, Address(ESP, +2 * kWordSize));
   // EAX: Tagged left (dividend).
   // EBX: Tagged right (divisor).
   // Check if modulo by zero -> exception thrown in main function.
@@ -473,7 +473,7 @@
   __ j(EQUAL, &fall_through, Assembler::kNearJump);
   __ movl(EBX, EAX);
   __ SmiUntag(EBX);
-  __ movl(EAX, Address(ESP, + 2 * kWordSize));  // Left argument (dividend).
+  __ movl(EAX, Address(ESP, +2 * kWordSize));  // Left argument (dividend).
   __ SmiUntag(EAX);
   __ pushl(EDX);  // Preserve EDX in case of 'fall_through'.
   __ cdq();
@@ -491,7 +491,7 @@
 
 void Intrinsifier::Integer_negate(Assembler* assembler) {
   Label fall_through;
-  __ movl(EAX, Address(ESP, + 1 * kWordSize));
+  __ movl(EAX, Address(ESP, +1 * kWordSize));
   __ testl(EAX, Immediate(kSmiTagMask));
   __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);  // Non-smi value.
   __ negl(EAX);
@@ -505,7 +505,7 @@
 void Intrinsifier::Integer_bitAndFromInteger(Assembler* assembler) {
   Label fall_through;
   TestBothArgumentsSmis(assembler, &fall_through);
-  __ movl(EBX, Address(ESP, + 2 * kWordSize));
+  __ movl(EBX, Address(ESP, +2 * kWordSize));
   __ andl(EAX, EBX);
   // Result is in EAX.
   __ ret();
@@ -521,7 +521,7 @@
 void Intrinsifier::Integer_bitOrFromInteger(Assembler* assembler) {
   Label fall_through;
   TestBothArgumentsSmis(assembler, &fall_through);
-  __ movl(EBX, Address(ESP, + 2 * kWordSize));
+  __ movl(EBX, Address(ESP, +2 * kWordSize));
   __ orl(EAX, EBX);
   // Result is in EAX.
   __ ret();
@@ -537,7 +537,7 @@
 void Intrinsifier::Integer_bitXorFromInteger(Assembler* assembler) {
   Label fall_through;
   TestBothArgumentsSmis(assembler, &fall_through);
-  __ movl(EBX, Address(ESP, + 2 * kWordSize));
+  __ movl(EBX, Address(ESP, +2 * kWordSize));
   __ xorl(EAX, EBX);
   // Result is in EAX.
   __ ret();
@@ -560,8 +560,8 @@
   __ j(ABOVE_EQUAL, &fall_through, Assembler::kNearJump);
 
   __ SmiUntag(EAX);
-  __ movl(ECX, EAX);  // Shift amount must be in ECX.
-  __ movl(EAX, Address(ESP, + 2 * kWordSize));  // Value.
+  __ movl(ECX, EAX);                           // Shift amount must be in ECX.
+  __ movl(EAX, Address(ESP, +2 * kWordSize));  // Value.
 
   // Overflow test - all the shifted-out bits must be same as the sign bit.
   __ movl(EBX, EAX);
@@ -586,12 +586,10 @@
   __ xorl(EDI, EDI);
   __ shldl(EDI, EAX, ECX);
   // Result in EDI (high) and EBX (low).
-  const Class& mint_class = Class::Handle(
-      Isolate::Current()->object_store()->mint_class());
-  __ TryAllocate(mint_class,
-                 &fall_through,
-                 Assembler::kNearJump,
-                 EAX,  // Result register.
+  const Class& mint_class =
+      Class::Handle(Isolate::Current()->object_store()->mint_class());
+  __ TryAllocate(mint_class, &fall_through, Assembler::kNearJump,
+                 EAX,   // Result register.
                  ECX);  // temp
   // EBX and EDI are not objects but integer values.
   __ movl(FieldAddress(EAX, Mint::value_offset()), EBX);
@@ -629,7 +627,7 @@
   Label try_mint_smi, is_true, is_false, drop_two_fall_through, fall_through;
   TestBothArgumentsSmis(assembler, &try_mint_smi);
   // EAX contains the right argument.
-  __ cmpl(Address(ESP, + 2 * kWordSize), EAX);
+  __ cmpl(Address(ESP, +2 * kWordSize), EAX);
   __ j(true_condition, &is_true, Assembler::kNearJump);
   __ Bind(&is_false);
   __ LoadObject(EAX, Bool::False());
@@ -661,15 +659,15 @@
   // Note that EDX and ECX must be preserved in case we fall through to main
   // method.
   // EAX contains the right argument.
-  __ movl(EBX, Address(ESP, + 2 * kWordSize));  // Left argument.
+  __ movl(EBX, Address(ESP, +2 * kWordSize));  // Left argument.
   // Push left as 64 bit integer.
   Push64SmiOrMint(assembler, EBX, EDI, &fall_through);
   // Push right as 64 bit integer.
   Push64SmiOrMint(assembler, EAX, EDI, &drop_two_fall_through);
-  __ popl(EBX);  // Right.LO.
-  __ popl(ECX);  // Right.HI.
-  __ popl(EAX);  // Left.LO.
-  __ popl(EDX);  // Left.HI.
+  __ popl(EBX);       // Right.LO.
+  __ popl(ECX);       // Right.HI.
+  __ popl(EAX);       // Left.LO.
+  __ popl(EDX);       // Left.HI.
   __ cmpl(EDX, ECX);  // cmpl left.HI, right.HI.
   __ j(hi_false_cond, &is_false, Assembler::kNearJump);
   __ j(hi_true_cond, &is_true, Assembler::kNearJump);
@@ -684,7 +682,6 @@
 }
 
 
-
 void Intrinsifier::Integer_greaterThanFromInt(Assembler* assembler) {
   CompareIntegers(assembler, LESS);
 }
@@ -715,10 +712,10 @@
 void Intrinsifier::Integer_equalToInteger(Assembler* assembler) {
   Label fall_through, true_label, check_for_mint;
   // For integer receiver '===' check first.
-  __ movl(EAX, Address(ESP, + 1 * kWordSize));
-  __ cmpl(EAX, Address(ESP, + 2 * kWordSize));
+  __ movl(EAX, Address(ESP, +1 * kWordSize));
+  __ cmpl(EAX, Address(ESP, +2 * kWordSize));
   __ j(EQUAL, &true_label, Assembler::kNearJump);
-  __ movl(EBX, Address(ESP, + 2 * kWordSize));
+  __ movl(EBX, Address(ESP, +2 * kWordSize));
   __ orl(EAX, EBX);
   __ testl(EAX, Immediate(kSmiTagMask));
   __ j(NOT_ZERO, &check_for_mint, Assembler::kNearJump);
@@ -732,14 +729,14 @@
   // At least one of the arguments was not Smi.
   Label receiver_not_smi;
   __ Bind(&check_for_mint);
-  __ movl(EAX, Address(ESP, + 2 * kWordSize));  // Receiver.
+  __ movl(EAX, Address(ESP, +2 * kWordSize));  // Receiver.
   __ testl(EAX, Immediate(kSmiTagMask));
   __ j(NOT_ZERO, &receiver_not_smi);
 
   // Left (receiver) is Smi, return false if right is not Double.
   // Note that an instance of Mint or Bigint never contains a value that can be
   // represented by Smi.
-  __ movl(EAX, Address(ESP, + 1 * kWordSize));  // Right argument.
+  __ movl(EAX, Address(ESP, +1 * kWordSize));  // Right argument.
   __ CompareClassId(EAX, kDoubleCid, EDI);
   __ j(EQUAL, &fall_through);
   __ LoadObject(EAX, Bool::False());  // Smi == Mint -> false.
@@ -750,7 +747,7 @@
   __ CompareClassId(EAX, kMintCid, EDI);
   __ j(NOT_EQUAL, &fall_through);
   // Receiver is Mint, return false if right is Smi.
-  __ movl(EAX, Address(ESP, + 1 * kWordSize));  // Right argument.
+  __ movl(EAX, Address(ESP, +1 * kWordSize));  // Right argument.
   __ testl(EAX, Immediate(kSmiTagMask));
   __ j(NOT_ZERO, &fall_through);
   __ LoadObject(EAX, Bool::False());
@@ -782,9 +779,9 @@
   __ j(LESS_EQUAL, &shift_count_ok, Assembler::kNearJump);
   __ movl(EAX, count_limit);
   __ Bind(&shift_count_ok);
-  __ movl(ECX, EAX);  // Shift amount must be in ECX.
-  __ movl(EAX, Address(ESP, + 2 * kWordSize));  // Value.
-  __ SmiUntag(EAX);  // Value.
+  __ movl(ECX, EAX);                           // Shift amount must be in ECX.
+  __ movl(EAX, Address(ESP, +2 * kWordSize));  // Value.
+  __ SmiUntag(EAX);                            // Value.
   __ sarl(EAX, ECX);
   __ SmiTag(EAX);
   __ ret();
@@ -794,7 +791,7 @@
 
 // Argument is Smi (receiver).
 void Intrinsifier::Smi_bitNegate(Assembler* assembler) {
-  __ movl(EAX, Address(ESP, + 1 * kWordSize));  // Receiver.
+  __ movl(EAX, Address(ESP, +1 * kWordSize));  // Receiver.
   __ notl(EAX);
   __ andl(EAX, Immediate(~kSmiTagMask));  // Remove inverted smi-tag.
   __ ret();
@@ -803,7 +800,7 @@
 
 void Intrinsifier::Smi_bitLength(Assembler* assembler) {
   ASSERT(kSmiTagShift == 1);
-  __ movl(EAX, Address(ESP, + 1 * kWordSize));  // Receiver.
+  __ movl(EAX, Address(ESP, +1 * kWordSize));  // Receiver.
   // XOR with sign bit to complement bits if value is negative.
   __ movl(ECX, EAX);
   __ sarl(ECX, Immediate(31));  // All 0 or all 1.
@@ -850,9 +847,8 @@
   Label loop;
   __ Bind(&loop);
   __ movl(EAX, EDX);
-  __ movl(EDX,
-          FieldAddress(EDI, ESI, TIMES_4,
-                       TypedData::data_offset() - Bigint::kBytesPerDigit));
+  __ movl(EDX, FieldAddress(EDI, ESI, TIMES_4,
+                            TypedData::data_offset() - Bigint::kBytesPerDigit));
   __ shldl(EAX, EDX, ECX);
   __ movl(Address(EBX, ESI, TIMES_4, 0), EAX);
   __ decl(ESI);
@@ -881,7 +877,7 @@
   __ SmiUntag(ECX);
   __ movl(EBX, Address(ESP, 2 * kWordSize));  // r_digits
   __ movl(EDX, ECX);
-  __ sarl(EDX, Immediate(5));  // EDX = n ~/ _DIGIT_BITS.
+  __ sarl(EDX, Immediate(5));                 // EDX = n ~/ _DIGIT_BITS.
   __ movl(ESI, Address(ESP, 4 * kWordSize));  // x_used > 0, Smi.
   __ SmiUntag(ESI);
   __ decl(ESI);
@@ -925,10 +921,10 @@
 
   __ movl(EDI, Address(ESP, 6 * kWordSize));  // digits
   __ movl(EAX, Address(ESP, 5 * kWordSize));  // used is Smi
-  __ SmiUntag(EAX);  // used > 0.
+  __ SmiUntag(EAX);                           // used > 0.
   __ movl(ESI, Address(ESP, 4 * kWordSize));  // a_digits
   __ movl(ECX, Address(ESP, 3 * kWordSize));  // a_used is Smi
-  __ SmiUntag(ECX);  // a_used > 0.
+  __ SmiUntag(ECX);                           // a_used > 0.
   __ movl(EBX, Address(ESP, 2 * kWordSize));  // r_digits
 
   // Precompute 'used - a_used' now so that carry flag is not lost later.
@@ -949,7 +945,7 @@
 
   Label last_carry;
   __ popl(ECX);
-  __ decl(ECX);  // Does not affect carry flag.
+  __ decl(ECX);                                   // Does not affect carry flag.
   __ j(ZERO, &last_carry, Assembler::kNearJump);  // If used - a_used == 0.
 
   Label carry_loop;
@@ -985,10 +981,10 @@
 
   __ movl(EDI, Address(ESP, 6 * kWordSize));  // digits
   __ movl(EAX, Address(ESP, 5 * kWordSize));  // used is Smi
-  __ SmiUntag(EAX);  // used > 0.
+  __ SmiUntag(EAX);                           // used > 0.
   __ movl(ESI, Address(ESP, 4 * kWordSize));  // a_digits
   __ movl(ECX, Address(ESP, 3 * kWordSize));  // a_used is Smi
-  __ SmiUntag(ECX);  // a_used > 0.
+  __ SmiUntag(ECX);                           // a_used > 0.
   __ movl(EBX, Address(ESP, 2 * kWordSize));  // r_digits
 
   // Precompute 'used - a_used' now so that carry flag is not lost later.
@@ -1009,7 +1005,7 @@
 
   Label done;
   __ popl(ECX);
-  __ decl(ECX);  // Does not affect carry flag.
+  __ decl(ECX);                             // Does not affect carry flag.
   __ j(ZERO, &done, Assembler::kNearJump);  // If used - a_used == 0.
 
   Label carry_loop;
@@ -1106,7 +1102,7 @@
   __ addl(EDI, Immediate(Bigint::kBytesPerDigit));
 
   // uint64_t t = x*mi
-  __ mull(EBX);  // t = EDX:EAX = EAX * EBX
+  __ mull(EBX);       // t = EDX:EAX = EAX * EBX
   __ addl(EAX, ECX);  // t += c
   __ adcl(EDX, Immediate(0));
 
@@ -1216,7 +1212,7 @@
 
   // uint64_t c = high32(t)
   __ pushl(Immediate(0));  // push high32(c) == 0
-  __ pushl(EDX);  // push low32(c) == high32(t)
+  __ pushl(EDX);           // push low32(c) == high32(t)
 
   Address n_addr = Address(ESP, 2 * kWordSize);
   Address ch_addr = Address(ESP, 1 * kWordSize);
@@ -1240,11 +1236,11 @@
   __ addl(EDI, Immediate(Bigint::kBytesPerDigit));
 
   // uint96_t t = ECX:EDX:EAX = 2*x*xi + aj + c
-  __ mull(EBX);  // EDX:EAX = EAX * EBX
+  __ mull(EBX);       // EDX:EAX = EAX * EBX
   __ xorl(ECX, ECX);  // ECX = 0
   __ shldl(ECX, EDX, Immediate(1));
   __ shldl(EDX, EAX, Immediate(1));
-  __ shll(EAX, Immediate(1));  // ECX:EDX:EAX <<= 1
+  __ shll(EAX, Immediate(1));     // ECX:EDX:EAX <<= 1
   __ addl(EAX, Address(ESI, 0));  // t += aj
   __ adcl(EDX, Immediate(0));
   __ adcl(ECX, Immediate(0));
@@ -1331,9 +1327,9 @@
 
   __ Bind(&return_qd);
   // args[2] = qd
-  __ movl(FieldAddress(EDI,
-                       TypedData::data_offset() + 2*Bigint::kBytesPerDigit),
-          EAX);
+  __ movl(
+      FieldAddress(EDI, TypedData::data_offset() + 2 * Bigint::kBytesPerDigit),
+      EAX);
 
   __ movl(EAX, Immediate(Smi::RawValue(1)));  // One digit processed.
   __ ret();
@@ -1354,9 +1350,8 @@
   __ movl(EDI, Address(ESP, 3 * kWordSize));  // args
 
   // ECX = rho = args[2]
-  __ movl(ECX,
-          FieldAddress(EDI,
-                       TypedData::data_offset() + 2*Bigint::kBytesPerDigit));
+  __ movl(ECX, FieldAddress(
+                   EDI, TypedData::data_offset() + 2 * Bigint::kBytesPerDigit));
 
   // EAX = digits[i >> 1]
   __ movl(EBX, Address(ESP, 2 * kWordSize));  // digits
@@ -1367,9 +1362,9 @@
   __ mull(ECX);
 
   // args[4] = t mod DIGIT_BASE = low32(t)
-  __ movl(FieldAddress(EDI,
-                       TypedData::data_offset() + 4*Bigint::kBytesPerDigit),
-          EAX);
+  __ movl(
+      FieldAddress(EDI, TypedData::data_offset() + 4 * Bigint::kBytesPerDigit),
+      EAX);
 
   __ movl(EAX, Immediate(Smi::RawValue(1)));  // One digit processed.
   __ ret();
@@ -1382,7 +1377,7 @@
 static void TestLastArgumentIsDouble(Assembler* assembler,
                                      Label* is_smi,
                                      Label* not_double_smi) {
-  __ movl(EAX, Address(ESP, + 1 * kWordSize));
+  __ movl(EAX, Address(ESP, +1 * kWordSize));
   __ testl(EAX, Immediate(kSmiTagMask));
   __ j(ZERO, is_smi, Assembler::kNearJump);  // Jump if Smi.
   __ CompareClassId(EAX, kDoubleCid, EBX);
@@ -1401,7 +1396,7 @@
   // Both arguments are double, right operand is in EAX.
   __ movsd(XMM1, FieldAddress(EAX, Double::value_offset()));
   __ Bind(&double_op);
-  __ movl(EAX, Address(ESP, + 2 * kWordSize));  // Left argument.
+  __ movl(EAX, Address(ESP, +2 * kWordSize));  // Left argument.
   __ movsd(XMM0, FieldAddress(EAX, Double::value_offset()));
   __ comisd(XMM0, XMM1);
   __ j(PARITY_EVEN, &is_false, Assembler::kNearJump);  // NaN -> false;
@@ -1459,20 +1454,27 @@
   // Both arguments are double, right operand is in EAX.
   __ movsd(XMM1, FieldAddress(EAX, Double::value_offset()));
   __ Bind(&double_op);
-  __ movl(EAX, Address(ESP, + 2 * kWordSize));  // Left argument.
+  __ movl(EAX, Address(ESP, +2 * kWordSize));  // Left argument.
   __ movsd(XMM0, FieldAddress(EAX, Double::value_offset()));
   switch (kind) {
-    case Token::kADD: __ addsd(XMM0, XMM1); break;
-    case Token::kSUB: __ subsd(XMM0, XMM1); break;
-    case Token::kMUL: __ mulsd(XMM0, XMM1); break;
-    case Token::kDIV: __ divsd(XMM0, XMM1); break;
-    default: UNREACHABLE();
+    case Token::kADD:
+      __ addsd(XMM0, XMM1);
+      break;
+    case Token::kSUB:
+      __ subsd(XMM0, XMM1);
+      break;
+    case Token::kMUL:
+      __ mulsd(XMM0, XMM1);
+      break;
+    case Token::kDIV:
+      __ divsd(XMM0, XMM1);
+      break;
+    default:
+      UNREACHABLE();
   }
-  const Class& double_class = Class::Handle(
-      Isolate::Current()->object_store()->double_class());
-  __ TryAllocate(double_class,
-                 &fall_through,
-                 Assembler::kNearJump,
+  const Class& double_class =
+      Class::Handle(Isolate::Current()->object_store()->double_class());
+  __ TryAllocate(double_class, &fall_through, Assembler::kNearJump,
                  EAX,  // Result register.
                  EBX);
   __ movsd(FieldAddress(EAX, Double::value_offset()), XMM0);
@@ -1509,20 +1511,18 @@
 void Intrinsifier::Double_mulFromInteger(Assembler* assembler) {
   Label fall_through;
   // Only smis allowed.
-  __ movl(EAX, Address(ESP, + 1 * kWordSize));
+  __ movl(EAX, Address(ESP, +1 * kWordSize));
   __ testl(EAX, Immediate(kSmiTagMask));
   __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);
   // Is Smi.
   __ SmiUntag(EAX);
   __ cvtsi2sd(XMM1, EAX);
-  __ movl(EAX, Address(ESP, + 2 * kWordSize));
+  __ movl(EAX, Address(ESP, +2 * kWordSize));
   __ movsd(XMM0, FieldAddress(EAX, Double::value_offset()));
   __ mulsd(XMM0, XMM1);
-  const Class& double_class = Class::Handle(
-      Isolate::Current()->object_store()->double_class());
-  __ TryAllocate(double_class,
-                 &fall_through,
-                 Assembler::kNearJump,
+  const Class& double_class =
+      Class::Handle(Isolate::Current()->object_store()->double_class());
+  __ TryAllocate(double_class, &fall_through, Assembler::kNearJump,
                  EAX,  // Result register.
                  EBX);
   __ movsd(FieldAddress(EAX, Double::value_offset()), XMM0);
@@ -1539,11 +1539,9 @@
   // Is Smi.
   __ SmiUntag(EAX);
   __ cvtsi2sd(XMM0, EAX);
-  const Class& double_class = Class::Handle(
-      Isolate::Current()->object_store()->double_class());
-  __ TryAllocate(double_class,
-                 &fall_through,
-                 Assembler::kNearJump,
+  const Class& double_class =
+      Class::Handle(Isolate::Current()->object_store()->double_class());
+  __ TryAllocate(double_class, &fall_through, Assembler::kNearJump,
                  EAX,  // Result register.
                  EBX);
   __ movsd(FieldAddress(EAX, Double::value_offset()), XMM0);
@@ -1566,6 +1564,30 @@
 }
 
 
+void Intrinsifier::Double_getIsInfinite(Assembler* assembler) {
+  Label not_inf;
+  __ movl(EAX, Address(ESP, +1 * kWordSize));
+  __ movl(EBX, FieldAddress(EAX, Double::value_offset()));
+
+  // If the low word isn't zero, then it isn't infinity.
+  __ cmpl(EBX, Immediate(0));
+  __ j(NOT_EQUAL, &not_inf, Assembler::kNearJump);
+  // Check the high word.
+  __ movl(EBX, FieldAddress(EAX, Double::value_offset() + kWordSize));
+  // Mask off sign bit.
+  __ andl(EBX, Immediate(0x7FFFFFFF));
+  // Compare with +infinity.
+  __ cmpl(EBX, Immediate(0x7FF00000));
+  __ j(NOT_EQUAL, &not_inf, Assembler::kNearJump);
+  __ LoadObject(EAX, Bool::True());
+  __ ret();
+
+  __ Bind(&not_inf);
+  __ LoadObject(EAX, Bool::False());
+  __ ret();
+}
+
+
 void Intrinsifier::Double_getIsNegative(Assembler* assembler) {
   Label is_false, is_true, is_zero;
   __ movl(EAX, Address(ESP, +1 * kWordSize));
@@ -1613,11 +1635,9 @@
   __ movsd(XMM1, FieldAddress(EAX, Double::value_offset()));
   __ Bind(&double_op);
   __ sqrtsd(XMM0, XMM1);
-  const Class& double_class = Class::Handle(
-      Isolate::Current()->object_store()->double_class());
-  __ TryAllocate(double_class,
-                 &fall_through,
-                 Assembler::kNearJump,
+  const Class& double_class =
+      Class::Handle(Isolate::Current()->object_store()->double_class());
+  __ TryAllocate(double_class, &fall_through, Assembler::kNearJump,
                  EAX,  // Result register.
                  EBX);
   __ movsd(FieldAddress(EAX, Double::value_offset()), XMM0);
@@ -1636,8 +1656,8 @@
 void Intrinsifier::Random_nextState(Assembler* assembler) {
   const Library& math_lib = Library::Handle(Library::MathLibrary());
   ASSERT(!math_lib.IsNull());
-  const Class& random_class = Class::Handle(
-      math_lib.LookupClassAllowPrivate(Symbols::_Random()));
+  const Class& random_class =
+      Class::Handle(math_lib.LookupClassAllowPrivate(Symbols::_Random()));
   ASSERT(!random_class.IsNull());
   const Field& state_field = Field::ZoneHandle(
       random_class.LookupInstanceFieldAllowPrivate(Symbols::_state()));
@@ -1646,13 +1666,18 @@
       random_class.LookupStaticFieldAllowPrivate(Symbols::_A()));
   ASSERT(!random_A_field.IsNull());
   ASSERT(random_A_field.is_const());
-  const Instance& a_value = Instance::Handle(random_A_field.StaticValue());
+  Instance& a_value = Instance::Handle(random_A_field.StaticValue());
+  if (a_value.raw() == Object::sentinel().raw() ||
+      a_value.raw() == Object::transition_sentinel().raw()) {
+    random_A_field.EvaluateInitializer();
+    a_value = random_A_field.StaticValue();
+  }
   const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value();
   // 'a_int_value' is a mask.
   ASSERT(Utils::IsUint(32, a_int_value));
   int32_t a_int32_value = static_cast<int32_t>(a_int_value);
   // Receiver.
-  __ movl(EAX, Address(ESP, + 1 * kWordSize));
+  __ movl(EAX, Address(ESP, +1 * kWordSize));
   // Field '_state'.
   __ movl(EBX, FieldAddress(EAX, state_field.Offset()));
   // Addresses of _state[0] and _state[1].
@@ -1674,8 +1699,8 @@
 // Identity comparison.
 void Intrinsifier::ObjectEquals(Assembler* assembler) {
   Label is_true;
-  __ movl(EAX, Address(ESP, + 1 * kWordSize));
-  __ cmpl(EAX, Address(ESP, + 2 * kWordSize));
+  __ movl(EAX, Address(ESP, +1 * kWordSize));
+  __ cmpl(EAX, Address(ESP, +2 * kWordSize));
   __ j(EQUAL, &is_true, Assembler::kNearJump);
   __ LoadObject(EAX, Bool::False());
   __ ret();
@@ -1685,16 +1710,91 @@
 }
 
 
+static void RangeCheck(Assembler* assembler,
+                       Register reg,
+                       intptr_t low,
+                       intptr_t high,
+                       Condition cc,
+                       Label* target) {
+  __ subl(reg, Immediate(low));
+  __ cmpl(reg, Immediate(high - low));
+  __ j(cc, target);
+}
+
+
+const Condition kIfNotInRange = ABOVE;
+const Condition kIfInRange = BELOW_EQUAL;
+
+
+static void JumpIfInteger(Assembler* assembler, Register cid, Label* target) {
+  RangeCheck(assembler, cid, kSmiCid, kBigintCid, kIfInRange, target);
+}
+
+
+static void JumpIfNotInteger(Assembler* assembler,
+                             Register cid,
+                             Label* target) {
+  RangeCheck(assembler, cid, kSmiCid, kBigintCid, kIfNotInRange, target);
+}
+
+
+static void JumpIfString(Assembler* assembler, Register cid, Label* target) {
+  RangeCheck(assembler, cid, kOneByteStringCid, kExternalTwoByteStringCid,
+             kIfInRange, target);
+}
+
+
+static void JumpIfNotString(Assembler* assembler, Register cid, Label* target) {
+  RangeCheck(assembler, cid, kOneByteStringCid, kExternalTwoByteStringCid,
+             kIfNotInRange, target);
+}
+
+
 // Return type quickly for simple types (not parameterized and not signature).
 void Intrinsifier::ObjectRuntimeType(Assembler* assembler) {
-  Label fall_through;
-  __ movl(EAX, Address(ESP, + 1 * kWordSize));
+  Label fall_through, use_canonical_type, not_double, not_integer;
+  __ movl(EAX, Address(ESP, +1 * kWordSize));
   __ LoadClassIdMayBeSmi(EDI, EAX);
-  __ cmpl(EDI, Immediate(kClosureCid));
-  __ j(EQUAL, &fall_through, Assembler::kNearJump);  // Instance is a closure.
-  __ LoadClassById(EBX, EDI);
-  // EBX: class of instance (EAX).
 
+  __ cmpl(EDI, Immediate(kClosureCid));
+  __ j(EQUAL, &fall_through);  // Instance is a closure.
+
+  __ cmpl(EDI, Immediate(kNumPredefinedCids));
+  __ j(ABOVE, &use_canonical_type);
+
+  // If object is a instance of _Double return double type.
+  __ cmpl(EDI, Immediate(kDoubleCid));
+  __ j(NOT_EQUAL, &not_double);
+
+  __ LoadIsolate(EAX);
+  __ movl(EAX, Address(EAX, Isolate::object_store_offset()));
+  __ movl(EAX, Address(EAX, ObjectStore::double_type_offset()));
+  __ ret();
+
+  __ Bind(&not_double);
+  // If object is an integer (smi, mint or bigint) return int type.
+  __ movl(EAX, EDI);
+  JumpIfNotInteger(assembler, EAX, &not_integer);
+
+  __ LoadIsolate(EAX);
+  __ movl(EAX, Address(EAX, Isolate::object_store_offset()));
+  __ movl(EAX, Address(EAX, ObjectStore::int_type_offset()));
+  __ ret();
+
+  __ Bind(&not_integer);
+  // If object is a string (one byte, two byte or external variants) return
+  // string type.
+  __ movl(EAX, EDI);
+  JumpIfNotString(assembler, EAX, &use_canonical_type);
+
+  __ LoadIsolate(EAX);
+  __ movl(EAX, Address(EAX, Isolate::object_store_offset()));
+  __ movl(EAX, Address(EAX, ObjectStore::string_type_offset()));
+  __ ret();
+
+  // Object is neither double, nor integer, nor string.
+  __ Bind(&use_canonical_type);
+  __ LoadClassById(EBX, EDI);
   __ movzxw(EDI, FieldAddress(EBX, Class::num_type_arguments_offset()));
   __ cmpl(EDI, Immediate(0));
   __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump);
@@ -1707,9 +1807,73 @@
 }
 
 
+void Intrinsifier::ObjectHaveSameRuntimeType(Assembler* assembler) {
+  Label fall_through, different_cids, equal, not_equal, not_integer;
+
+  __ movl(EAX, Address(ESP, +1 * kWordSize));
+  __ LoadClassIdMayBeSmi(EDI, EAX);
+
+  // Check if left hand size is a closure. Closures are handled in the runtime.
+  __ cmpl(EDI, Immediate(kClosureCid));
+  __ j(EQUAL, &fall_through);
+
+  __ movl(EAX, Address(ESP, +2 * kWordSize));
+  __ LoadClassIdMayBeSmi(EBX, EAX);
+
+  // Check whether class ids match. If class ids don't match objects can still
+  // have the same runtime type (e.g. multiple string implementation classes
+  // map to a single String type).
+  __ cmpl(EDI, EBX);
+  __ j(NOT_EQUAL, &different_cids);
+
+  // Objects have the same class and neither is a closure.
+  // Check if there are no type arguments. In this case we can return true.
+  // Otherwise fall through into the runtime to handle comparison.
+  __ LoadClassById(EBX, EDI);
+  __ movzxw(EBX, FieldAddress(EBX, Class::num_type_arguments_offset()));
+  __ cmpl(EBX, Immediate(0));
+  __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump);
+
+  __ Bind(&equal);
+  __ LoadObject(EAX, Bool::True());
+  __ ret();
+
+  // Class ids are different. Check if we are comparing runtime types of
+  // two strings (with different representations) or two integers.
+  __ Bind(&different_cids);
+  __ cmpl(EDI, Immediate(kNumPredefinedCids));
+  __ j(ABOVE_EQUAL, &not_equal);
+
+  __ movl(EAX, EDI);
+  JumpIfNotInteger(assembler, EAX, &not_integer);
+
+  // First object is an integer. Check if the second is an integer too.
+  // Otherwise types are unequal because only integers have the same runtime
+  // type as other integers.
+  JumpIfInteger(assembler, EBX, &equal);
+  __ jmp(&not_equal);
+
+  __ Bind(&not_integer);
+  // Check if the first object is a string. If it is not then
+  // objects don't have the same runtime type because they have
+  // different class ids and they are not strings or integers.
+  JumpIfNotString(assembler, EDI, &not_equal);
+  // First object is a string. Check if the second is a string too.
+  JumpIfString(assembler, EBX, &equal);
+  // Strings only have the same runtime type as other strings.
+  // Fall-through to the not equal case.
+
+  __ Bind(&not_equal);
+  __ LoadObject(EAX, Bool::False());
+  __ ret();
+
+  __ Bind(&fall_through);
+}
+
+
 void Intrinsifier::String_getHashCode(Assembler* assembler) {
   Label fall_through;
-  __ movl(EAX, Address(ESP, + 1 * kWordSize));  // String object.
+  __ movl(EAX, Address(ESP, +1 * kWordSize));  // String object.
   __ movl(EAX, FieldAddress(EAX, String::hash_offset()));
   __ cmpl(EAX, Immediate(0));
   __ j(EQUAL, &fall_through, Assembler::kNearJump);
@@ -1727,8 +1891,8 @@
 
 void Intrinsifier::StringBaseCharAt(Assembler* assembler) {
   Label fall_through, try_two_byte_string;
-  __ movl(EBX, Address(ESP, + 1 * kWordSize));  // Index.
-  __ movl(EAX, Address(ESP, + 2 * kWordSize));  // String.
+  __ movl(EBX, Address(ESP, +1 * kWordSize));  // Index.
+  __ movl(EAX, Address(ESP, +2 * kWordSize));  // String.
   __ testl(EBX, Immediate(kSmiTagMask));
   __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);  // Non-smi index.
   // Range check.
@@ -1743,9 +1907,7 @@
   __ j(GREATER_EQUAL, &fall_through);
   __ movl(EAX,
           Immediate(reinterpret_cast<uword>(Symbols::PredefinedAddress())));
-  __ movl(EAX, Address(EAX,
-                       EBX,
-                       TIMES_4,
+  __ movl(EAX, Address(EAX, EBX, TIMES_4,
                        Symbols::kNullCharCodeSymbolOffset * kWordSize));
   __ ret();
 
@@ -1758,9 +1920,7 @@
   __ j(GREATER_EQUAL, &fall_through);
   __ movl(EAX,
           Immediate(reinterpret_cast<uword>(Symbols::PredefinedAddress())));
-  __ movl(EAX, Address(EAX,
-                       EBX,
-                       TIMES_4,
+  __ movl(EAX, Address(EAX, EBX, TIMES_4,
                        Symbols::kNullCharCodeSymbolOffset * kWordSize));
   __ ret();
 
@@ -1771,7 +1931,7 @@
 void Intrinsifier::StringBaseIsEmpty(Assembler* assembler) {
   Label is_true;
   // Get length.
-  __ movl(EAX, Address(ESP, + 1 * kWordSize));  // String object.
+  __ movl(EAX, Address(ESP, +1 * kWordSize));  // String object.
   __ movl(EAX, FieldAddress(EAX, String::length_offset()));
   __ cmpl(EAX, Immediate(Smi::RawValue(0)));
   __ j(EQUAL, &is_true, Assembler::kNearJump);
@@ -1785,7 +1945,7 @@
 
 void Intrinsifier::OneByteString_getHashCode(Assembler* assembler) {
   Label compute_hash;
-  __ movl(EBX, Address(ESP, + 1 * kWordSize));  // OneByteString object.
+  __ movl(EBX, Address(ESP, +1 * kWordSize));  // OneByteString object.
   __ movl(EAX, FieldAddress(EBX, String::hash_offset()));
   __ cmpl(EAX, Immediate(0));
   __ j(EQUAL, &compute_hash, Assembler::kNearJump);
@@ -1839,7 +1999,7 @@
   __ addl(EAX, EDX);
   // hash_ = hash_ & ((static_cast<intptr_t>(1) << bits) - 1);
   __ andl(EAX,
-      Immediate(((static_cast<intptr_t>(1) << String::kHashBits) - 1)));
+          Immediate(((static_cast<intptr_t>(1) << String::kHashBits) - 1)));
 
   // return hash_ == 0 ? 1 : hash_;
   __ cmpl(EAX, Immediate(0));
@@ -1860,7 +2020,7 @@
                                      Label* failure,
                                      Register length_reg) {
   NOT_IN_PRODUCT(
-    __ MaybeTraceAllocation(kOneByteStringCid, EAX, failure, false));
+      __ MaybeTraceAllocation(kOneByteStringCid, EAX, failure, false));
   if (length_reg != EDI) {
     __ movl(EDI, length_reg);
   }
@@ -1918,8 +2078,7 @@
 
   // Set the length field.
   __ popl(EDI);
-  __ StoreIntoObjectNoBarrier(EAX,
-                              FieldAddress(EAX, String::length_offset()),
+  __ StoreIntoObjectNoBarrier(EAX, FieldAddress(EAX, String::length_offset()),
                               EDI);
   // Clear hash.
   __ ZeroInitSmiField(FieldAddress(EAX, String::hash_offset()));
@@ -1940,24 +2099,24 @@
   const intptr_t kStartIndexOffset = 2 * kWordSize;
   const intptr_t kEndIndexOffset = 1 * kWordSize;
   Label fall_through, ok;
-  __ movl(EAX, Address(ESP, + kStartIndexOffset));
-  __ movl(EDI, Address(ESP, + kEndIndexOffset));
+  __ movl(EAX, Address(ESP, +kStartIndexOffset));
+  __ movl(EDI, Address(ESP, +kEndIndexOffset));
   __ orl(EAX, EDI);
   __ testl(EAX, Immediate(kSmiTagMask));
   __ j(NOT_ZERO, &fall_through);  // 'start', 'end' not Smi.
 
-  __ subl(EDI, Address(ESP, + kStartIndexOffset));
+  __ subl(EDI, Address(ESP, +kStartIndexOffset));
   TryAllocateOnebyteString(assembler, &ok, &fall_through, EDI);
   __ Bind(&ok);
   // EAX: new string as tagged pointer.
   // Copy string.
-  __ movl(EDI, Address(ESP, + kStringOffset));
-  __ movl(EBX, Address(ESP, + kStartIndexOffset));
+  __ movl(EDI, Address(ESP, +kStringOffset));
+  __ movl(EBX, Address(ESP, +kStartIndexOffset));
   __ SmiUntag(EBX);
   __ leal(EDI, FieldAddress(EDI, EBX, TIMES_1, OneByteString::data_offset()));
   // EDI: Start address to copy from (untagged).
   // EBX: Untagged start index.
-  __ movl(ECX, Address(ESP, + kEndIndexOffset));
+  __ movl(ECX, Address(ESP, +kEndIndexOffset));
   __ SmiUntag(ECX);
   __ subl(ECX, EBX);
   __ xorl(EDX, EDX);
@@ -1981,9 +2140,9 @@
 
 
 void Intrinsifier::OneByteStringSetAt(Assembler* assembler) {
-  __ movl(ECX, Address(ESP, + 1 * kWordSize));  // Value.
-  __ movl(EBX, Address(ESP, + 2 * kWordSize));  // Index.
-  __ movl(EAX, Address(ESP, + 3 * kWordSize));  // OneByteString.
+  __ movl(ECX, Address(ESP, +1 * kWordSize));  // Value.
+  __ movl(EBX, Address(ESP, +2 * kWordSize));  // Index.
+  __ movl(EAX, Address(ESP, +3 * kWordSize));  // OneByteString.
   __ SmiUntag(EBX);
   __ SmiUntag(ECX);
   __ movb(FieldAddress(EAX, EBX, TIMES_1, OneByteString::data_offset()), CL);
@@ -1992,7 +2151,7 @@
 
 
 void Intrinsifier::OneByteString_allocate(Assembler* assembler) {
-  __ movl(EDI, Address(ESP, + 1 * kWordSize));  // Length.
+  __ movl(EDI, Address(ESP, +1 * kWordSize));  // Length.
   Label fall_through, ok;
   TryAllocateOnebyteString(assembler, &ok, &fall_through, EDI);
   // EDI: Start address to copy from (untagged).
@@ -2007,8 +2166,8 @@
 // TODO(srdjan): Add combinations (one-byte/two-byte/external strings).
 static void StringEquality(Assembler* assembler, intptr_t string_cid) {
   Label fall_through, is_true, is_false, loop;
-  __ movl(EAX, Address(ESP, + 2 * kWordSize));  // This.
-  __ movl(EBX, Address(ESP, + 1 * kWordSize));  // Other.
+  __ movl(EAX, Address(ESP, +2 * kWordSize));  // This.
+  __ movl(EBX, Address(ESP, +1 * kWordSize));  // Other.
 
   // Are identical?
   __ cmpl(EAX, EBX);
@@ -2034,14 +2193,14 @@
   __ j(LESS, &is_true, Assembler::kNearJump);
   if (string_cid == kOneByteStringCid) {
     __ movzxb(ECX,
-        FieldAddress(EAX, EDI, TIMES_1, OneByteString::data_offset()));
+              FieldAddress(EAX, EDI, TIMES_1, OneByteString::data_offset()));
     __ movzxb(EDX,
-        FieldAddress(EBX, EDI, TIMES_1, OneByteString::data_offset()));
+              FieldAddress(EBX, EDI, TIMES_1, OneByteString::data_offset()));
   } else if (string_cid == kTwoByteStringCid) {
     __ movzxw(ECX,
-        FieldAddress(EAX, EDI, TIMES_2, TwoByteString::data_offset()));
+              FieldAddress(EAX, EDI, TIMES_2, TwoByteString::data_offset()));
     __ movzxw(EDX,
-        FieldAddress(EBX, EDI, TIMES_2, TwoByteString::data_offset()));
+              FieldAddress(EBX, EDI, TIMES_2, TwoByteString::data_offset()));
   } else {
     UNIMPLEMENTED();
   }
@@ -2071,7 +2230,8 @@
 }
 
 
-void Intrinsifier::RegExp_ExecuteMatch(Assembler* assembler) {
+void Intrinsifier::IntrinsifyRegExpExecuteMatch(Assembler* assembler,
+                                                bool sticky) {
   if (FLAG_interpret_irregexp) return;
 
   static const intptr_t kRegExpParamOffset = 3 * kWordSize;
@@ -2089,8 +2249,8 @@
   __ movl(EDI, Address(ESP, kStringParamOffset));
   __ LoadClassId(EDI, EDI);
   __ SubImmediate(EDI, Immediate(kOneByteStringCid));
-  __ movl(EAX, FieldAddress(EBX, EDI, TIMES_4,
-                            RegExp::function_offset(kOneByteStringCid)));
+  __ movl(EAX, FieldAddress(EBX, EDI, TIMES_4, RegExp::function_offset(
+                                                   kOneByteStringCid, sticky)));
 
   // Registers are now set up for the lazy compile stub. It expects the function
   // in EAX, the argument descriptor in EDX, and IC-Data in ECX.
@@ -2109,7 +2269,7 @@
   // EAX: Current user tag.
   __ movl(EAX, Address(EDI, Isolate::current_tag_offset()));
   // EAX: UserTag.
-  __ movl(EBX, Address(ESP, + 1 * kWordSize));
+  __ movl(EBX, Address(ESP, +1 * kWordSize));
   // Set Isolate::current_tag_.
   __ movl(Address(EDI, Isolate::current_tag_offset()), EBX);
   // EAX: UserTag's tag.
diff --git a/runtime/vm/intrinsifier_mips.cc b/runtime/vm/intrinsifier_mips.cc
index 748f06d..04707c7 100644
--- a/runtime/vm/intrinsifier_mips.cc
+++ b/runtime/vm/intrinsifier_mips.cc
@@ -29,7 +29,9 @@
 #define __ assembler->
 
 
-intptr_t Intrinsifier::ParameterSlotFromSp() { return -1; }
+intptr_t Intrinsifier::ParameterSlotFromSp() {
+  return -1;
+}
 
 
 static bool IsABIPreservedRegister(Register reg) {
@@ -76,11 +78,9 @@
   // Note that T1 is Smi, i.e, times 2.
   ASSERT(kSmiTagShift == 1);
   __ lw(T2, Address(SP, 0 * kWordSize));  // Value.
-  __ sll(T1, T1, 1);  // T1 is Smi.
+  __ sll(T1, T1, 1);                      // T1 is Smi.
   __ addu(T1, T0, T1);
-  __ StoreIntoObject(T0,
-                     FieldAddress(T1, Array::data_offset()),
-                     T2);
+  __ StoreIntoObject(T0, FieldAddress(T1, Array::data_offset()), T2);
   // Caller is responsible for preserving the value if necessary.
   __ Ret();
   __ Bind(&fall_through);
@@ -104,21 +104,17 @@
   __ lw(T1, Address(SP, kArrayOffset));  // Data argument.
   // V0 is new, no barrier needed.
   __ StoreIntoObjectNoBarrier(
-      V0,
-      FieldAddress(V0, GrowableObjectArray::data_offset()),
-      T1);
+      V0, FieldAddress(V0, GrowableObjectArray::data_offset()), T1);
 
   // V0: new growable array object start as a tagged pointer.
   // Store the type argument field in the growable array object.
   __ lw(T1, Address(SP, kTypeArgumentsOffset));  // Type argument.
   __ StoreIntoObjectNoBarrier(
-      V0,
-      FieldAddress(V0, GrowableObjectArray::type_arguments_offset()),
-      T1);
+      V0, FieldAddress(V0, GrowableObjectArray::type_arguments_offset()), T1);
   // Set the length field in the growable array object to 0.
   __ Ret();  // Returns the newly allocated object in V0.
   __ delay_slot()->sw(ZR,
-      FieldAddress(V0, GrowableObjectArray::length_offset()));
+                      FieldAddress(V0, GrowableObjectArray::length_offset()));
 
   __ Bind(&fall_through);
 }
@@ -148,9 +144,7 @@
   ASSERT(kSmiTagShift == 1);
   __ sll(T1, T1, 1);
   __ addu(T1, T2, T1);
-  __ StoreIntoObject(T2,
-                     FieldAddress(T1, Array::data_offset()),
-                     T0);
+  __ StoreIntoObject(T2, FieldAddress(T1, Array::data_offset()), T0);
   __ LoadObject(T7, Object::null_object());
   __ Ret();
   __ delay_slot()->mov(V0, T7);
@@ -162,7 +156,7 @@
   Label fall_through;                                                          \
   const intptr_t kArrayLengthStackOffset = 0 * kWordSize;                      \
   NOT_IN_PRODUCT(__ MaybeTraceAllocation(cid, T2, &fall_through));             \
-  __ lw(T2, Address(SP, kArrayLengthStackOffset));  /* Array length. */        \
+  __ lw(T2, Address(SP, kArrayLengthStackOffset)); /* Array length. */         \
   /* Check that length is a positive Smi. */                                   \
   /* T2: requested array length argument. */                                   \
   __ andi(CMPRES1, T2, Immediate(kSmiTagMask));                                \
@@ -209,7 +203,7 @@
                              &size_tag_overflow);                              \
     __ b(&done);                                                               \
     __ delay_slot()->sll(T2, T2,                                               \
-        RawObject::kSizeTagPos - kObjectAlignmentLog2);                        \
+                         RawObject::kSizeTagPos - kObjectAlignmentLog2);       \
                                                                                \
     __ Bind(&size_tag_overflow);                                               \
     __ mov(T2, ZR);                                                            \
@@ -218,15 +212,14 @@
     /* Get the class index and insert it into the tags. */                     \
     __ LoadImmediate(TMP, RawObject::ClassIdTag::encode(cid));                 \
     __ or_(T2, T2, TMP);                                                       \
-    __ sw(T2, FieldAddress(V0, type_name::tags_offset()));  /* Tags. */        \
+    __ sw(T2, FieldAddress(V0, type_name::tags_offset())); /* Tags. */         \
   }                                                                            \
   /* Set the length field. */                                                  \
   /* V0: new object start as a tagged pointer. */                              \
   /* T1: new object end address. */                                            \
-  __ lw(T2, Address(SP, kArrayLengthStackOffset));  /* Array length. */        \
-  __ StoreIntoObjectNoBarrier(V0,                                              \
-                              FieldAddress(V0, type_name::length_offset()),    \
-                              T2);                                             \
+  __ lw(T2, Address(SP, kArrayLengthStackOffset)); /* Array length. */         \
+  __ StoreIntoObjectNoBarrier(                                                 \
+      V0, FieldAddress(V0, type_name::length_offset()), T2);                   \
   /* Initialize all array elements to 0. */                                    \
   /* V0: new object start as a tagged pointer. */                              \
   /* T1: new object end address. */                                            \
@@ -242,16 +235,21 @@
   __ Bind(&done);                                                              \
                                                                                \
   __ Ret();                                                                    \
-  __ Bind(&fall_through);                                                      \
+  __ Bind(&fall_through);
 
 
 static int GetScaleFactor(intptr_t size) {
   switch (size) {
-    case 1: return 0;
-    case 2: return 1;
-    case 4: return 2;
-    case 8: return 3;
-    case 16: return 4;
+    case 1:
+      return 0;
+    case 2:
+      return 1;
+    case 4:
+      return 2;
+    case 8:
+      return 3;
+    case 16:
+      return 4;
   }
   UNREACHABLE();
   return -1;
@@ -259,12 +257,12 @@
 
 
 #define TYPED_DATA_ALLOCATOR(clazz)                                            \
-void Intrinsifier::TypedData_##clazz##_factory(Assembler* assembler) {         \
-  intptr_t size = TypedData::ElementSizeInBytes(kTypedData##clazz##Cid);       \
-  intptr_t max_len = TypedData::MaxElements(kTypedData##clazz##Cid);           \
-  int shift = GetScaleFactor(size);                                            \
-  TYPED_ARRAY_ALLOCATION(TypedData, kTypedData##clazz##Cid, max_len, shift);   \
-}
+  void Intrinsifier::TypedData_##clazz##_factory(Assembler* assembler) {       \
+    intptr_t size = TypedData::ElementSizeInBytes(kTypedData##clazz##Cid);     \
+    intptr_t max_len = TypedData::MaxElements(kTypedData##clazz##Cid);         \
+    int shift = GetScaleFactor(size);                                          \
+    TYPED_ARRAY_ALLOCATION(TypedData, kTypedData##clazz##Cid, max_len, shift); \
+  }
 CLASS_LIST_TYPED_DATA(TYPED_DATA_ALLOCATOR)
 #undef TYPED_DATA_ALLOCATOR
 
@@ -285,8 +283,8 @@
   Label fall_through;
 
   TestBothArgumentsSmis(assembler, &fall_through);  // Checks two Smis.
-  __ AdduDetectOverflow(V0, T0, T1, CMPRES1);  // Add.
-  __ bltz(CMPRES1, &fall_through);  // Fall through on overflow.
+  __ AdduDetectOverflow(V0, T0, T1, CMPRES1);       // Add.
+  __ bltz(CMPRES1, &fall_through);                  // Fall through on overflow.
   __ Ret();  // Nothing in branch delay slot.
   __ Bind(&fall_through);
 }
@@ -302,7 +300,7 @@
 
   TestBothArgumentsSmis(assembler, &fall_through);
   __ SubuDetectOverflow(V0, T0, T1, CMPRES1);  // Subtract.
-  __ bltz(CMPRES1, &fall_through);  // Fall through on overflow.
+  __ bltz(CMPRES1, &fall_through);             // Fall through on overflow.
   __ Ret();
   __ Bind(&fall_through);
 }
@@ -313,8 +311,8 @@
 
   TestBothArgumentsSmis(assembler, &fall_through);
   __ SubuDetectOverflow(V0, T1, T0, CMPRES1);  // Subtract.
-  __ bltz(CMPRES1, &fall_through);  // Fall through on overflow.
-  __ Ret();  // Nothing in branch delay slot.
+  __ bltz(CMPRES1, &fall_through);             // Fall through on overflow.
+  __ Ret();                                    // Nothing in branch delay slot.
   __ Bind(&fall_through);
 }
 
@@ -325,10 +323,10 @@
   TestBothArgumentsSmis(assembler, &fall_through);  // checks two smis
   __ SmiUntag(T0);  // untags T0. only want result shifted by one
 
-  __ mult(T0, T1);  // HI:LO <- T0 * T1.
-  __ mflo(V0);  // V0 <- LO.
-  __ mfhi(T2);  // T2 <- HI.
-  __ sra(T3, V0, 31);  // T3 <- V0 >> 31.
+  __ mult(T0, T1);                // HI:LO <- T0 * T1.
+  __ mflo(V0);                    // V0 <- LO.
+  __ mfhi(T2);                    // T2 <- HI.
+  __ sra(T3, V0, 31);             // T3 <- V0 >> 31.
   __ bne(T2, T3, &fall_through);  // Fall through on overflow.
   __ Ret();
   __ Bind(&fall_through);
@@ -375,7 +373,7 @@
   __ SmiUntag(right);
   __ SmiUntag(left);
   __ div(left, right);  // Divide, remainder goes in HI.
-  __ mfhi(result);  // result <- HI.
+  __ mfhi(result);      // result <- HI.
   return;
 }
 
@@ -433,7 +431,7 @@
   __ SmiUntag(T0);
   __ SmiUntag(T1);
   __ div(T1, T0);  // LO <- T1 / T0
-  __ mflo(V0);  // V0 <- LO
+  __ mflo(V0);     // V0 <- LO
   // Check the corner case of dividing the 'MIN_SMI' with -1, in which case we
   // cannot tag the result.
   __ BranchEqual(V0, Immediate(0x40000000), &fall_through);
@@ -446,9 +444,9 @@
 void Intrinsifier::Integer_negate(Assembler* assembler) {
   Label fall_through;
 
-  __ lw(T0, Address(SP, + 0 * kWordSize));  // Grabs first argument.
+  __ lw(T0, Address(SP, +0 * kWordSize));        // Grabs first argument.
   __ andi(CMPRES1, T0, Immediate(kSmiTagMask));  // Test for Smi.
-  __ bne(CMPRES1, ZR, &fall_through);  // Fall through if not a Smi.
+  __ bne(CMPRES1, ZR, &fall_through);            // Fall through if not a Smi.
   __ SubuDetectOverflow(V0, ZR, T0, CMPRES1);
   __ bltz(CMPRES1, &fall_through);  // There was overflow.
   __ Ret();
@@ -507,8 +505,8 @@
   Label fall_through, overflow;
 
   TestBothArgumentsSmis(assembler, &fall_through);
-  __ BranchUnsignedGreater(
-      T0, Immediate(Smi::RawValue(Smi::kBits)), &fall_through);
+  __ BranchUnsignedGreater(T0, Immediate(Smi::RawValue(Smi::kBits)),
+                           &fall_through);
   __ SmiUntag(T0);
 
   // Check for overflow by shifting left and shifting back arithmetically.
@@ -531,18 +529,18 @@
   // high bits = (((1 << T0) - 1) << (32 - T0)) & T1) >> (32 - T0)
   // lo bits = T1 << T0
   __ LoadImmediate(T3, 1);
-  __ sllv(T3, T3, T0);  // T3 <- T3 << T0
+  __ sllv(T3, T3, T0);              // T3 <- T3 << T0
   __ addiu(T3, T3, Immediate(-1));  // T3 <- T3 - 1
-  __ subu(T4, ZR, T0);  // T4 <- -T0
+  __ subu(T4, ZR, T0);              // T4 <- -T0
   __ addiu(T4, T4, Immediate(32));  // T4 <- 32 - T0
-  __ sllv(T3, T3, T4);  // T3 <- T3 << T4
-  __ and_(T3, T3, T1);  // T3 <- T3 & T1
-  __ srlv(T3, T3, T4);  // T3 <- T3 >> T4
+  __ sllv(T3, T3, T4);              // T3 <- T3 << T4
+  __ and_(T3, T3, T1);              // T3 <- T3 & T1
+  __ srlv(T3, T3, T4);              // T3 <- T3 >> T4
   // Now T3 has the bits that fall off of T1 on a left shift.
   __ sllv(T0, T1, T0);  // T0 gets low bits.
 
-  const Class& mint_class = Class::Handle(
-      Isolate::Current()->object_store()->mint_class());
+  const Class& mint_class =
+      Class::Handle(Isolate::Current()->object_store()->mint_class());
   __ TryAllocate(mint_class, &fall_through, V0, T1);
 
   __ sw(T0, FieldAddress(V0, Mint::value_offset()));
@@ -585,10 +583,18 @@
   // T0 contains the right argument. T1 contains left argument
 
   switch (rel_op) {
-    case LT: __ BranchSignedLess(T1, T0, &is_true); break;
-    case LE: __ BranchSignedLessEqual(T1, T0, &is_true); break;
-    case GT: __ BranchSignedGreater(T1, T0, &is_true); break;
-    case GE: __ BranchSignedGreaterEqual(T1, T0, &is_true); break;
+    case LT:
+      __ BranchSignedLess(T1, T0, &is_true);
+      break;
+    case LE:
+      __ BranchSignedLessEqual(T1, T0, &is_true);
+      break;
+    case GT:
+      __ BranchSignedGreater(T1, T0, &is_true);
+      break;
+    case GE:
+      __ BranchSignedGreaterEqual(T1, T0, &is_true);
+      break;
     default:
       UNREACHABLE();
       break;
@@ -743,7 +749,7 @@
   __ bltz(T0, &fall_through);
 
   __ LoadImmediate(T2, 0x1F);
-  __ slt(CMPRES1, T2, T0);  // CMPRES1 <- 0x1F < T0 ? 1 : 0
+  __ slt(CMPRES1, T2, T0);   // CMPRES1 <- 0x1F < T0 ? 1 : 0
   __ movn(T0, T2, CMPRES1);  // T0 <- 0x1F < T0 ? 0x1F : T0
 
   __ SmiUntag(T1);
@@ -1178,7 +1184,7 @@
 
   // T5 = ajp = &a_digits[i]
   __ lw(T1, Address(SP, 1 * kWordSize));  // a_digits
-  __ sll(T0, T2, 2);  // j == 2*i, i is Smi.
+  __ sll(T0, T2, 2);                      // j == 2*i, i is Smi.
   __ addu(T1, T0, T1);
   __ addiu(T5, T1, Immediate(TypedData::data_offset() - kHeapObjectTag));
 
@@ -1239,7 +1245,7 @@
   __ sltu(T1, T0, T6);
   __ addu(T6, A1, T1);  // No carry out; A2:T6:T0 = 2*x*xi + aj + low32(c).
   __ addu(T6, T6, T7);  // No carry out; A2:T6:T0 = 2*x*xi + aj + c.
-  __ mov(T7, A2);  // T7:T6:T0 = 2*x*xi + aj + c.
+  __ mov(T7, A2);       // T7:T6:T0 = 2*x*xi + aj + c.
 
   // *ajp++ = low32(t) = T0
   __ sw(T0, Address(T5, 0));
@@ -1288,8 +1294,8 @@
   __ lw(T4, Address(SP, 2 * kWordSize));  // args
 
   // T3 = rho = args[2]
-  __ lw(T3,
-        FieldAddress(T4, TypedData::data_offset() + 2*Bigint::kBytesPerDigit));
+  __ lw(T3, FieldAddress(
+                T4, TypedData::data_offset() + 2 * Bigint::kBytesPerDigit));
 
   // T2 = d = digits[i >> 1]
   __ lw(T0, Address(SP, 0 * kWordSize));  // T0 = i as Smi.
@@ -1303,8 +1309,8 @@
 
   // args[4] = t mod DIGIT_BASE = low32(t)
   __ mflo(T0);
-  __ sw(T0,
-        FieldAddress(T4, TypedData::data_offset() + 4*Bigint::kBytesPerDigit));
+  __ sw(T0, FieldAddress(
+                T4, TypedData::data_offset() + 4 * Bigint::kBytesPerDigit));
 
   __ addiu(V0, ZR, Immediate(Smi::RawValue(1)));  // One digit processed.
   __ Ret();
@@ -1349,11 +1355,21 @@
   __ Bind(&no_NaN);
 
   switch (rel_op) {
-    case EQ: __ ceqd(D0, D1); break;
-    case LT: __ coltd(D0, D1); break;
-    case LE: __ coled(D0, D1); break;
-    case GT: __ coltd(D1, D0); break;
-    case GE: __ coled(D1, D0); break;
+    case EQ:
+      __ ceqd(D0, D1);
+      break;
+    case LT:
+      __ coltd(D0, D1);
+      break;
+    case LE:
+      __ coled(D0, D1);
+      break;
+    case GT:
+      __ coltd(D1, D0);
+      break;
+    case GE:
+      __ coled(D1, D0);
+      break;
     default: {
       // Only passing the above conditions to this function.
       UNREACHABLE();
@@ -1420,14 +1436,23 @@
   __ lwc1(F0, FieldAddress(T0, Double::value_offset()));
   __ lwc1(F1, FieldAddress(T0, Double::value_offset() + kWordSize));
   switch (kind) {
-    case Token::kADD: __ addd(D0, D0, D1); break;
-    case Token::kSUB: __ subd(D0, D0, D1); break;
-    case Token::kMUL: __ muld(D0, D0, D1); break;
-    case Token::kDIV: __ divd(D0, D0, D1); break;
-    default: UNREACHABLE();
+    case Token::kADD:
+      __ addd(D0, D0, D1);
+      break;
+    case Token::kSUB:
+      __ subd(D0, D0, D1);
+      break;
+    case Token::kMUL:
+      __ muld(D0, D0, D1);
+      break;
+    case Token::kDIV:
+      __ divd(D0, D0, D1);
+      break;
+    default:
+      UNREACHABLE();
   }
-  const Class& double_class = Class::Handle(
-      Isolate::Current()->object_store()->double_class());
+  const Class& double_class =
+      Class::Handle(Isolate::Current()->object_store()->double_class());
   __ TryAllocate(double_class, &fall_through, V0, T1);  // Result register.
   __ swc1(F0, FieldAddress(V0, Double::value_offset()));
   __ Ret();
@@ -1481,8 +1506,8 @@
   __ lwc1(F0, FieldAddress(T0, Double::value_offset()));
   __ lwc1(F1, FieldAddress(T0, Double::value_offset() + kWordSize));
   __ muld(D0, D0, D1);
-  const Class& double_class = Class::Handle(
-      Isolate::Current()->object_store()->double_class());
+  const Class& double_class =
+      Class::Handle(Isolate::Current()->object_store()->double_class());
   __ TryAllocate(double_class, &fall_through, V0, T1);  // Result register.
   __ swc1(F0, FieldAddress(V0, Double::value_offset()));
   __ Ret();
@@ -1503,8 +1528,8 @@
   __ SmiUntag(T0);
   __ mtc1(T0, F4);
   __ cvtdw(D0, F4);
-  const Class& double_class = Class::Handle(
-      Isolate::Current()->object_store()->double_class());
+  const Class& double_class =
+      Class::Handle(Isolate::Current()->object_store()->double_class());
   __ TryAllocate(double_class, &fall_through, V0, T1);  // Result register.
   __ swc1(F0, FieldAddress(V0, Double::value_offset()));
   __ Ret();
@@ -1530,6 +1555,27 @@
 }
 
 
+void Intrinsifier::Double_getIsInfinite(Assembler* assembler) {
+  Label not_inf;
+  __ lw(T0, Address(SP, 0 * kWordSize));
+  __ lw(T1, FieldAddress(T0, Double::value_offset()));
+  __ lw(T2, FieldAddress(T0, Double::value_offset() + kWordSize));
+  // If the low word isn't zero, then it isn't infinity.
+  __ bne(T1, ZR, &not_inf);
+  // Mask off the sign bit.
+  __ AndImmediate(T2, T2, 0x7FFFFFFF);
+  // Compare with +infinity.
+  __ BranchNotEqual(T2, Immediate(0x7FF00000), &not_inf);
+
+  __ LoadObject(V0, Bool::True());
+  __ Ret();
+
+  __ Bind(&not_inf);
+  __ LoadObject(V0, Bool::False());
+  __ Ret();
+}
+
+
 void Intrinsifier::Double_getIsNegative(Assembler* assembler) {
   Label is_false, is_true, is_zero;
   __ lw(T0, Address(SP, 0 * kWordSize));
@@ -1555,10 +1601,10 @@
 
   __ Bind(&is_zero);
   // Check for negative zero by looking at the sign bit.
-  __ mfc1(T0, F1);  // Moves bits 32...63 of D0 to T0.
-  __ srl(T0, T0, 31);  // Get the sign bit down to bit 0 of T0.
+  __ mfc1(T0, F1);                     // Moves bits 32...63 of D0 to T0.
+  __ srl(T0, T0, 31);                  // Get the sign bit down to bit 0 of T0.
   __ andi(CMPRES1, T0, Immediate(1));  // Check if the bit is set.
-  __ bne(T0, ZR, &is_true);  // Sign bit set. True.
+  __ bne(T0, ZR, &is_true);            // Sign bit set. True.
   __ b(&is_false);
 }
 
@@ -1589,8 +1635,8 @@
   __ LoadDFromOffset(D1, T0, Double::value_offset() - kHeapObjectTag);
   __ Bind(&double_op);
   __ sqrtd(D0, D1);
-  const Class& double_class = Class::Handle(
-      Isolate::Current()->object_store()->double_class());
+  const Class& double_class =
+      Class::Handle(Isolate::Current()->object_store()->double_class());
   __ TryAllocate(double_class, &fall_through, V0, T1);  // Result register.
   __ swc1(F0, FieldAddress(V0, Double::value_offset()));
   __ Ret();
@@ -1612,8 +1658,8 @@
 void Intrinsifier::Random_nextState(Assembler* assembler) {
   const Library& math_lib = Library::Handle(Library::MathLibrary());
   ASSERT(!math_lib.IsNull());
-  const Class& random_class = Class::Handle(
-      math_lib.LookupClassAllowPrivate(Symbols::_Random()));
+  const Class& random_class =
+      Class::Handle(math_lib.LookupClassAllowPrivate(Symbols::_Random()));
   ASSERT(!random_class.IsNull());
   const Field& state_field = Field::ZoneHandle(
       random_class.LookupInstanceFieldAllowPrivate(Symbols::_state()));
@@ -1622,7 +1668,12 @@
       random_class.LookupStaticFieldAllowPrivate(Symbols::_A()));
   ASSERT(!random_A_field.IsNull());
   ASSERT(random_A_field.is_const());
-  const Instance& a_value = Instance::Handle(random_A_field.StaticValue());
+  Instance& a_value = Instance::Handle(random_A_field.StaticValue());
+  if (a_value.raw() == Object::sentinel().raw() ||
+      a_value.raw() == Object::transition_sentinel().raw()) {
+    random_A_field.EvaluateInitializer();
+    a_value = random_A_field.StaticValue();
+  }
   const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value();
   // 'a_int_value' is a mask.
   ASSERT(Utils::IsUint(32, a_int_value));
@@ -1668,15 +1719,97 @@
 }
 
 
+enum RangeCheckCondition { kIfNotInRange, kIfInRange };
+
+
+static void RangeCheck(Assembler* assembler,
+                       Register val,
+                       Register tmp,
+                       intptr_t low,
+                       intptr_t high,
+                       RangeCheckCondition cc,
+                       Label* target) {
+  __ AddImmediate(tmp, val, -low);
+  if (cc == kIfInRange) {
+    __ BranchUnsignedLessEqual(tmp, Immediate(high - low), target);
+  } else {
+    ASSERT(cc == kIfNotInRange);
+    __ BranchUnsignedGreater(tmp, Immediate(high - low), target);
+  }
+}
+
+
+static void JumpIfInteger(Assembler* assembler,
+                          Register cid,
+                          Register tmp,
+                          Label* target) {
+  RangeCheck(assembler, cid, tmp, kSmiCid, kBigintCid, kIfInRange, target);
+}
+
+
+static void JumpIfNotInteger(Assembler* assembler,
+                             Register cid,
+                             Register tmp,
+                             Label* target) {
+  RangeCheck(assembler, cid, tmp, kSmiCid, kBigintCid, kIfNotInRange, target);
+}
+
+
+static void JumpIfString(Assembler* assembler,
+                         Register cid,
+                         Register tmp,
+                         Label* target) {
+  RangeCheck(assembler, cid, tmp, kOneByteStringCid, kExternalTwoByteStringCid,
+             kIfInRange, target);
+}
+
+
+static void JumpIfNotString(Assembler* assembler,
+                            Register cid,
+                            Register tmp,
+                            Label* target) {
+  RangeCheck(assembler, cid, tmp, kOneByteStringCid, kExternalTwoByteStringCid,
+             kIfNotInRange, target);
+}
+
+
 // Return type quickly for simple types (not parameterized and not signature).
 void Intrinsifier::ObjectRuntimeType(Assembler* assembler) {
-  Label fall_through;
+  Label fall_through, use_canonical_type, not_integer, not_double;
   __ lw(T0, Address(SP, 0 * kWordSize));
   __ LoadClassIdMayBeSmi(T1, T0);
-  __ BranchEqual(T1, Immediate(kClosureCid), &fall_through);
-  __ LoadClassById(T2, T1);
-  // T2: class of instance (T0).
 
+  // Closures are handled in the runtime.
+  __ BranchEqual(T1, Immediate(kClosureCid), &fall_through);
+
+  __ BranchUnsignedGreaterEqual(T1, Immediate(kNumPredefinedCids),
+                                &use_canonical_type);
+
+  __ BranchNotEqual(T1, Immediate(kDoubleCid), &not_double);
+  // Object is a double.
+  __ LoadIsolate(T1);
+  __ LoadFromOffset(T1, T1, Isolate::object_store_offset());
+  __ LoadFromOffset(V0, T1, ObjectStore::double_type_offset());
+  __ Ret();
+
+  __ Bind(&not_double);
+  JumpIfNotInteger(assembler, T1, T2, &not_integer);
+  // Object is an integer.
+  __ LoadIsolate(T1);
+  __ LoadFromOffset(T1, T1, Isolate::object_store_offset());
+  __ LoadFromOffset(V0, T1, ObjectStore::int_type_offset());
+  __ Ret();
+
+  __ Bind(&not_integer);
+  JumpIfNotString(assembler, T1, T2, &use_canonical_type);
+  // Object is a string.
+  __ LoadIsolate(T1);
+  __ LoadFromOffset(T1, T1, Isolate::object_store_offset());
+  __ LoadFromOffset(V0, T1, ObjectStore::string_type_offset());
+  __ Ret();
+
+  __ Bind(&use_canonical_type);
+  __ LoadClassById(T2, T1);
   __ lhu(T1, FieldAddress(T2, Class::num_type_arguments_offset()));
   __ BranchNotEqual(T1, Immediate(0), &fall_through);
 
@@ -1688,6 +1821,58 @@
 }
 
 
+void Intrinsifier::ObjectHaveSameRuntimeType(Assembler* assembler) {
+  Label fall_through, different_cids, equal, not_equal, not_integer;
+
+  __ lw(T0, Address(SP, 0 * kWordSize));
+  __ LoadClassIdMayBeSmi(T1, T0);
+
+  // Closures are handled in the runtime.
+  __ BranchEqual(T1, Immediate(kClosureCid), &fall_through);
+
+  __ lw(T0, Address(SP, 1 * kWordSize));
+  __ LoadClassIdMayBeSmi(T2, T0);
+
+  // Check whether class ids match. If class ids don't match objects can still
+  // have the same runtime type (e.g. multiple string implementation classes
+  // map to a single String type).
+  __ BranchNotEqual(T1, T2, &different_cids);
+
+  // Objects have the same class and neither is a closure.
+  // Check if there are no type arguments. In this case we can return true.
+  // Otherwise fall through into the runtime to handle comparison.
+  __ LoadClassById(T2, T1);
+  __ lhu(T1, FieldAddress(T2, Class::num_type_arguments_offset()));
+  __ BranchNotEqual(T1, Immediate(0), &fall_through);
+
+  __ Bind(&equal);
+  __ LoadObject(V0, Bool::True());
+  __ Ret();
+
+  // Class ids are different. Check if we are comparing runtime types of
+  // two strings (with different representations) or two integers.
+  __ Bind(&different_cids);
+  __ BranchUnsignedGreaterEqual(T1, Immediate(kNumPredefinedCids), &not_equal);
+
+  // Check if both are integers.
+  JumpIfNotInteger(assembler, T1, T0, &not_integer);
+  JumpIfInteger(assembler, T2, T0, &equal);
+  __ b(&not_equal);
+
+  __ Bind(&not_integer);
+  // Check if both are strings.
+  JumpIfNotString(assembler, T1, T0, &not_equal);
+  JumpIfString(assembler, T2, T0, &equal);
+
+  // Neither strings nor integers and have different class ids.
+  __ Bind(&not_equal);
+  __ LoadObject(V0, Bool::False());
+  __ Ret();
+
+  __ Bind(&fall_through);
+}
+
+
 void Intrinsifier::String_getHashCode(Assembler* assembler) {
   Label fall_through;
   __ lw(T0, Address(SP, 0 * kWordSize));
@@ -1782,20 +1967,16 @@
   __ LoadClassId(CMPRES1, A0);
   __ BranchNotEqual(CMPRES1, Immediate(kOneByteStringCid), &try_two_byte);
 
-  GenerateSubstringMatchesSpecialization(assembler,
-                                         kOneByteStringCid,
-                                         kOneByteStringCid,
-                                         &return_true,
+  GenerateSubstringMatchesSpecialization(assembler, kOneByteStringCid,
+                                         kOneByteStringCid, &return_true,
                                          &return_false);
 
   __ Bind(&try_two_byte);
   __ LoadClassId(CMPRES1, A0);
   __ BranchNotEqual(CMPRES1, Immediate(kTwoByteStringCid), &fall_through);
 
-  GenerateSubstringMatchesSpecialization(assembler,
-                                         kTwoByteStringCid,
-                                         kOneByteStringCid,
-                                         &return_true,
+  GenerateSubstringMatchesSpecialization(assembler, kTwoByteStringCid,
+                                         kOneByteStringCid, &return_true,
                                          &return_false);
 
   __ Bind(&return_true);
@@ -1818,13 +1999,13 @@
 
   // Checks.
   __ andi(CMPRES1, T1, Immediate(kSmiTagMask));
-  __ bne(CMPRES1, ZR, &fall_through);  // Index is not a Smi.
+  __ bne(CMPRES1, ZR, &fall_through);                    // Index is not a Smi.
   __ lw(T2, FieldAddress(T0, String::length_offset()));  // Range check.
   // Runtime throws exception.
   __ BranchUnsignedGreaterEqual(T1, T2, &fall_through);
   __ LoadClassId(CMPRES1, T0);  // Class ID check.
-  __ BranchNotEqual(
-      CMPRES1, Immediate(kOneByteStringCid), &try_two_byte_string);
+  __ BranchNotEqual(CMPRES1, Immediate(kOneByteStringCid),
+                    &try_two_byte_string);
 
   // Grab byte and return.
   __ SmiUntag(T1);
@@ -1987,8 +2168,8 @@
     Label overflow, done;
     const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2;
 
-    __ BranchUnsignedGreater(
-        T2, Immediate(RawObject::SizeTag::kMaxSizeTag), &overflow);
+    __ BranchUnsignedGreater(T2, Immediate(RawObject::SizeTag::kMaxSizeTag),
+                             &overflow);
     __ b(&done);
     __ delay_slot()->sll(T2, T2, shift);
     __ Bind(&overflow);
@@ -2003,8 +2184,7 @@
   }
 
   // Set the length field using the saved length (T6).
-  __ StoreIntoObjectNoBarrier(V0,
-                              FieldAddress(V0, String::length_offset()),
+  __ StoreIntoObjectNoBarrier(V0, FieldAddress(V0, String::length_offset()),
                               T6);
   // Clear hash.
   __ b(ok);
@@ -2107,7 +2287,7 @@
   // Is other OneByteString?
   __ andi(CMPRES1, T1, Immediate(kSmiTagMask));
   __ beq(CMPRES1, ZR, &fall_through);  // Other is Smi.
-  __ LoadClassId(CMPRES1, T1);  // Class ID check.
+  __ LoadClassId(CMPRES1, T1);         // Class ID check.
   __ BranchNotEqual(CMPRES1, Immediate(string_cid), &fall_through);
 
   // Have same length?
@@ -2159,7 +2339,8 @@
 }
 
 
-void Intrinsifier::RegExp_ExecuteMatch(Assembler* assembler) {
+void Intrinsifier::IntrinsifyRegExpExecuteMatch(Assembler* assembler,
+                                                bool sticky) {
   if (FLAG_interpret_irregexp) return;
 
   static const intptr_t kRegExpParamOffset = 2 * kWordSize;
@@ -2179,7 +2360,8 @@
   __ AddImmediate(T2, -kOneByteStringCid);
   __ sll(T2, T2, kWordSizeLog2);
   __ addu(T2, T2, T1);
-  __ lw(T0, FieldAddress(T2, RegExp::function_offset(kOneByteStringCid)));
+  __ lw(T0,
+        FieldAddress(T2, RegExp::function_offset(kOneByteStringCid, sticky)));
 
   // Registers are now set up for the lazy compile stub. It expects the function
   // in T0, the argument descriptor in S4, and IC-Data in S5.
@@ -2199,7 +2381,7 @@
   // V0: Current user tag.
   __ lw(V0, Address(T1, Isolate::current_tag_offset()));
   // T2: UserTag.
-  __ lw(T2, Address(SP, + 0 * kWordSize));
+  __ lw(T2, Address(SP, +0 * kWordSize));
   // Set Isolate::current_tag_.
   __ sw(T2, Address(T1, Isolate::current_tag_offset()));
   // T2: UserTag's tag.
diff --git a/runtime/vm/intrinsifier_x64.cc b/runtime/vm/intrinsifier_x64.cc
index cdb11df..fa250d4 100644
--- a/runtime/vm/intrinsifier_x64.cc
+++ b/runtime/vm/intrinsifier_x64.cc
@@ -29,7 +29,9 @@
 #define __ assembler->
 
 
-intptr_t Intrinsifier::ParameterSlotFromSp() { return 0; }
+intptr_t Intrinsifier::ParameterSlotFromSp() {
+  return 0;
+}
 
 
 static bool IsABIPreservedRegister(Register reg) {
@@ -61,9 +63,9 @@
   }
 
   Label fall_through;
-  __ movq(RDX, Address(RSP, + 1 * kWordSize));  // Value.
-  __ movq(RCX, Address(RSP, + 2 * kWordSize));  // Index.
-  __ movq(RAX, Address(RSP, + 3 * kWordSize));  // Array.
+  __ movq(RDX, Address(RSP, +1 * kWordSize));  // Value.
+  __ movq(RCX, Address(RSP, +2 * kWordSize));  // Index.
+  __ movq(RAX, Address(RSP, +3 * kWordSize));  // Array.
   __ testq(RCX, Immediate(kSmiTagMask));
   __ j(NOT_ZERO, &fall_through);
   // Range check.
@@ -73,8 +75,7 @@
   // Note that RBX is Smi, i.e, times 2.
   ASSERT(kSmiTagShift == 1);
   // Destroy RCX (ic data) as we will not continue in the function.
-  __ StoreIntoObject(RAX,
-                     FieldAddress(RAX, RCX, TIMES_4, Array::data_offset()),
+  __ StoreIntoObject(RAX, FieldAddress(RAX, RCX, TIMES_4, Array::data_offset()),
                      RDX);
   // Caller is responsible of preserving the value if necessary.
   __ ret();
@@ -101,16 +102,13 @@
   __ movq(RCX, Address(RSP, kArrayOffset));  // data argument.
   // RAX is new, no barrier needed.
   __ StoreIntoObjectNoBarrier(
-      RAX,
-      FieldAddress(RAX, GrowableObjectArray::data_offset()),
-      RCX);
+      RAX, FieldAddress(RAX, GrowableObjectArray::data_offset()), RCX);
 
   // RAX: new growable array object start as a tagged pointer.
   // Store the type argument field in the growable array object.
   __ movq(RCX, Address(RSP, kTypeArgumentsOffset));  // type argument.
   __ StoreIntoObjectNoBarrier(
-      RAX,
-      FieldAddress(RAX, GrowableObjectArray::type_arguments_offset()),
+      RAX, FieldAddress(RAX, GrowableObjectArray::type_arguments_offset()),
       RCX);
 
   // Set the length field in the growable array object to 0.
@@ -128,7 +126,7 @@
   // In checked mode we need to check the incoming argument.
   if (Isolate::Current()->type_checks()) return;
   Label fall_through;
-  __ movq(RAX, Address(RSP, + 2 * kWordSize));  // Array.
+  __ movq(RAX, Address(RSP, +2 * kWordSize));  // Array.
   __ movq(RCX, FieldAddress(RAX, GrowableObjectArray::length_offset()));
   // RCX: length.
   __ movq(RDX, FieldAddress(RAX, GrowableObjectArray::data_offset()));
@@ -139,10 +137,9 @@
   // len = len + 1;
   __ IncrementSmiField(FieldAddress(RAX, GrowableObjectArray::length_offset()),
                        1);
-  __ movq(RAX, Address(RSP, + 1 * kWordSize));  // Value
+  __ movq(RAX, Address(RSP, +1 * kWordSize));  // Value
   ASSERT(kSmiTagShift == 1);
-  __ StoreIntoObject(RDX,
-                     FieldAddress(RDX, RCX, TIMES_4, Array::data_offset()),
+  __ StoreIntoObject(RDX, FieldAddress(RDX, RCX, TIMES_4, Array::data_offset()),
                      RAX);
   __ LoadObject(RAX, Object::null_object());
   __ ret();
@@ -154,7 +151,7 @@
   Label fall_through;                                                          \
   const intptr_t kArrayLengthStackOffset = 1 * kWordSize;                      \
   NOT_IN_PRODUCT(__ MaybeTraceAllocation(cid, &fall_through, false));          \
-  __ movq(RDI, Address(RSP, kArrayLengthStackOffset));  /* Array length. */    \
+  __ movq(RDI, Address(RSP, kArrayLengthStackOffset)); /* Array length. */     \
   /* Check that length is a positive Smi. */                                   \
   /* RDI: requested array length argument. */                                  \
   __ testq(RDI, Immediate(kSmiTagMask));                                       \
@@ -216,22 +213,21 @@
                                                                                \
     /* Get the class index and insert it into the tags. */                     \
     __ orq(RDI, Immediate(RawObject::ClassIdTag::encode(cid)));                \
-    __ movq(FieldAddress(RAX, type_name::tags_offset()), RDI);  /* Tags. */    \
+    __ movq(FieldAddress(RAX, type_name::tags_offset()), RDI); /* Tags. */     \
   }                                                                            \
   /* Set the length field. */                                                  \
   /* RAX: new object start as a tagged pointer. */                             \
   /* RCX: new object end address. */                                           \
-  __ movq(RDI, Address(RSP, kArrayLengthStackOffset));  /* Array length. */    \
-  __ StoreIntoObjectNoBarrier(RAX,                                             \
-                              FieldAddress(RAX, type_name::length_offset()),   \
-                              RDI);                                            \
+  __ movq(RDI, Address(RSP, kArrayLengthStackOffset)); /* Array length. */     \
+  __ StoreIntoObjectNoBarrier(                                                 \
+      RAX, FieldAddress(RAX, type_name::length_offset()), RDI);                \
   /* Initialize all array elements to 0. */                                    \
   /* RAX: new object start as a tagged pointer. */                             \
   /* RCX: new object end address. */                                           \
   /* RDI: iterator which initially points to the start of the variable */      \
   /* RBX: scratch register. */                                                 \
   /* data area to be initialized. */                                           \
-  __ xorq(RBX, RBX);  /* Zero. */                                              \
+  __ xorq(RBX, RBX); /* Zero. */                                               \
   __ leaq(RDI, FieldAddress(RAX, sizeof(Raw##type_name)));                     \
   Label done, init_loop;                                                       \
   __ Bind(&init_loop);                                                         \
@@ -243,16 +239,21 @@
   __ Bind(&done);                                                              \
                                                                                \
   __ ret();                                                                    \
-  __ Bind(&fall_through);                                                      \
+  __ Bind(&fall_through);
 
 
 static ScaleFactor GetScaleFactor(intptr_t size) {
   switch (size) {
-    case 1: return TIMES_1;
-    case 2: return TIMES_2;
-    case 4: return TIMES_4;
-    case 8: return TIMES_8;
-    case 16: return TIMES_16;
+    case 1:
+      return TIMES_1;
+    case 2:
+      return TIMES_2;
+    case 4:
+      return TIMES_4;
+    case 8:
+      return TIMES_8;
+    case 16:
+      return TIMES_16;
   }
   UNREACHABLE();
   return static_cast<ScaleFactor>(0);
@@ -260,12 +261,12 @@
 
 
 #define TYPED_DATA_ALLOCATOR(clazz)                                            \
-void Intrinsifier::TypedData_##clazz##_factory(Assembler* assembler) {         \
-  intptr_t size = TypedData::ElementSizeInBytes(kTypedData##clazz##Cid);       \
-  intptr_t max_len = TypedData::MaxElements(kTypedData##clazz##Cid);           \
-  ScaleFactor scale = GetScaleFactor(size);                                    \
-  TYPED_ARRAY_ALLOCATION(TypedData, kTypedData##clazz##Cid, max_len, scale);   \
-}
+  void Intrinsifier::TypedData_##clazz##_factory(Assembler* assembler) {       \
+    intptr_t size = TypedData::ElementSizeInBytes(kTypedData##clazz##Cid);     \
+    intptr_t max_len = TypedData::MaxElements(kTypedData##clazz##Cid);         \
+    ScaleFactor scale = GetScaleFactor(size);                                  \
+    TYPED_ARRAY_ALLOCATION(TypedData, kTypedData##clazz##Cid, max_len, scale); \
+  }
 CLASS_LIST_TYPED_DATA(TYPED_DATA_ALLOCATOR)
 #undef TYPED_DATA_ALLOCATOR
 
@@ -273,8 +274,8 @@
 // Tests if two top most arguments are smis, jumps to label not_smi if not.
 // Topmost argument is in RAX.
 static void TestBothArgumentsSmis(Assembler* assembler, Label* not_smi) {
-  __ movq(RAX, Address(RSP, + 1 * kWordSize));
-  __ movq(RCX, Address(RSP, + 2 * kWordSize));
+  __ movq(RAX, Address(RSP, +1 * kWordSize));
+  __ movq(RCX, Address(RSP, +2 * kWordSize));
   __ orq(RCX, RAX);
   __ testq(RCX, Immediate(kSmiTagMask));
   __ j(NOT_ZERO, not_smi);
@@ -285,7 +286,7 @@
   Label fall_through;
   TestBothArgumentsSmis(assembler, &fall_through);
   // RAX contains right argument.
-  __ addq(RAX, Address(RSP, + 2 * kWordSize));
+  __ addq(RAX, Address(RSP, +2 * kWordSize));
   __ j(OVERFLOW, &fall_through, Assembler::kNearJump);
   // Result is in RAX.
   __ ret();
@@ -302,7 +303,7 @@
   Label fall_through;
   TestBothArgumentsSmis(assembler, &fall_through);
   // RAX contains right argument, which is the actual minuend of subtraction.
-  __ subq(RAX, Address(RSP, + 2 * kWordSize));
+  __ subq(RAX, Address(RSP, +2 * kWordSize));
   __ j(OVERFLOW, &fall_through, Assembler::kNearJump);
   // Result is in RAX.
   __ ret();
@@ -315,7 +316,7 @@
   TestBothArgumentsSmis(assembler, &fall_through);
   // RAX contains right argument, which is the actual subtrahend of subtraction.
   __ movq(RCX, RAX);
-  __ movq(RAX, Address(RSP, + 2 * kWordSize));
+  __ movq(RAX, Address(RSP, +2 * kWordSize));
   __ subq(RAX, RCX);
   __ j(OVERFLOW, &fall_through, Assembler::kNearJump);
   // Result is in RAX.
@@ -324,14 +325,13 @@
 }
 
 
-
 void Intrinsifier::Integer_mulFromInteger(Assembler* assembler) {
   Label fall_through;
   TestBothArgumentsSmis(assembler, &fall_through);
   // RAX is the right argument.
   ASSERT(kSmiTag == 0);  // Adjust code below if not the case.
   __ SmiUntag(RAX);
-  __ imulq(RAX, Address(RSP, + 2 * kWordSize));
+  __ imulq(RAX, Address(RSP, +2 * kWordSize));
   __ j(OVERFLOW, &fall_through, Assembler::kNearJump);
   // Result is in RAX.
   __ ret();
@@ -368,7 +368,7 @@
   __ j(LESS, &try_modulo, Assembler::kNearJump);
   // left is positive.
   __ cmpq(RAX, RCX);
-  __ j(GREATER, &try_modulo,  Assembler::kNearJump);
+  __ j(GREATER, &try_modulo, Assembler::kNearJump);
   // left is less than right, result is left (RAX).
   __ ret();
 
@@ -420,7 +420,7 @@
 void Intrinsifier::Integer_moduloFromInteger(Assembler* assembler) {
   Label fall_through, negative_result;
   TestBothArgumentsSmis(assembler, &fall_through);
-  __ movq(RCX, Address(RSP, + 2 * kWordSize));
+  __ movq(RCX, Address(RSP, +2 * kWordSize));
   // RAX: Tagged left (dividend).
   // RCX: Tagged right (divisor).
   __ cmpq(RCX, Immediate(0));
@@ -458,7 +458,7 @@
   __ cmpq(RAX, Immediate(0));
   __ j(EQUAL, &fall_through, Assembler::kNearJump);
   __ movq(RCX, RAX);
-  __ movq(RAX, Address(RSP, + 2 * kWordSize));  // Left argument (dividend).
+  __ movq(RAX, Address(RSP, +2 * kWordSize));  // Left argument (dividend).
 
   // Check if both operands fit into 32bits as idiv with 64bit operands
   // requires twice as many cycles and has much higher latency. We are checking
@@ -500,7 +500,7 @@
 
 void Intrinsifier::Integer_negate(Assembler* assembler) {
   Label fall_through;
-  __ movq(RAX, Address(RSP, + 1 * kWordSize));
+  __ movq(RAX, Address(RSP, +1 * kWordSize));
   __ testq(RAX, Immediate(kSmiTagMask));
   __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);  // Non-smi value.
   __ negq(RAX);
@@ -515,7 +515,7 @@
   Label fall_through;
   TestBothArgumentsSmis(assembler, &fall_through);
   // RAX is the right argument.
-  __ andq(RAX, Address(RSP, + 2 * kWordSize));
+  __ andq(RAX, Address(RSP, +2 * kWordSize));
   // Result is in RAX.
   __ ret();
   __ Bind(&fall_through);
@@ -531,7 +531,7 @@
   Label fall_through;
   TestBothArgumentsSmis(assembler, &fall_through);
   // RAX is the right argument.
-  __ orq(RAX, Address(RSP, + 2 * kWordSize));
+  __ orq(RAX, Address(RSP, +2 * kWordSize));
   // Result is in RAX.
   __ ret();
   __ Bind(&fall_through);
@@ -547,7 +547,7 @@
   Label fall_through;
   TestBothArgumentsSmis(assembler, &fall_through);
   // RAX is the right argument.
-  __ xorq(RAX, Address(RSP, + 2 * kWordSize));
+  __ xorq(RAX, Address(RSP, +2 * kWordSize));
   // Result is in RAX.
   __ ret();
   __ Bind(&fall_through);
@@ -569,8 +569,8 @@
   __ j(ABOVE_EQUAL, &fall_through, Assembler::kNearJump);
 
   __ SmiUntag(RAX);
-  __ movq(RCX, RAX);  // Shift amount must be in RCX.
-  __ movq(RAX, Address(RSP, + 2 * kWordSize));  // Value.
+  __ movq(RCX, RAX);                           // Shift amount must be in RCX.
+  __ movq(RAX, Address(RSP, +2 * kWordSize));  // Value.
 
   // Overflow test - all the shifted-out bits must be same as the sign bit.
   __ movq(RDI, RAX);
@@ -595,7 +595,7 @@
   Label fall_through, true_label;
   TestBothArgumentsSmis(assembler, &fall_through);
   // RAX contains the right argument.
-  __ cmpq(Address(RSP, + 2 * kWordSize), RAX);
+  __ cmpq(Address(RSP, +2 * kWordSize), RAX);
   __ j(true_condition, &true_label, Assembler::kNearJump);
   __ LoadObject(RAX, Bool::False());
   __ ret();
@@ -639,8 +639,8 @@
   const intptr_t kArgumentOffset = 1;
 
   // For integer receiver '===' check first.
-  __ movq(RAX, Address(RSP, + kArgumentOffset * kWordSize));
-  __ movq(RCX, Address(RSP, + kReceiverOffset * kWordSize));
+  __ movq(RAX, Address(RSP, +kArgumentOffset * kWordSize));
+  __ movq(RCX, Address(RSP, +kReceiverOffset * kWordSize));
   __ cmpq(RAX, RCX);
   __ j(EQUAL, &true_label, Assembler::kNearJump);
   __ orq(RAX, RCX);
@@ -656,14 +656,14 @@
   // At least one of the arguments was not Smi.
   Label receiver_not_smi;
   __ Bind(&check_for_mint);
-  __ movq(RAX, Address(RSP, + kReceiverOffset * kWordSize));
+  __ movq(RAX, Address(RSP, +kReceiverOffset * kWordSize));
   __ testq(RAX, Immediate(kSmiTagMask));
   __ j(NOT_ZERO, &receiver_not_smi);
 
   // Left (receiver) is Smi, return false if right is not Double.
   // Note that an instance of Mint or Bigint never contains a value that can be
   // represented by Smi.
-  __ movq(RAX, Address(RSP, + kArgumentOffset * kWordSize));
+  __ movq(RAX, Address(RSP, +kArgumentOffset * kWordSize));
   __ CompareClassId(RAX, kDoubleCid);
   __ j(EQUAL, &fall_through);
   __ LoadObject(RAX, Bool::False());
@@ -674,7 +674,7 @@
   __ CompareClassId(RAX, kMintCid);
   __ j(NOT_EQUAL, &fall_through);
   // Receiver is Mint, return false if right is Smi.
-  __ movq(RAX, Address(RSP, + kArgumentOffset * kWordSize));
+  __ movq(RAX, Address(RSP, +kArgumentOffset * kWordSize));
   __ testq(RAX, Immediate(kSmiTagMask));
   __ j(NOT_ZERO, &fall_through);
   // Smi == Mint -> false.
@@ -706,9 +706,9 @@
   __ j(LESS_EQUAL, &shift_count_ok, Assembler::kNearJump);
   __ movq(RAX, count_limit);
   __ Bind(&shift_count_ok);
-  __ movq(RCX, RAX);  // Shift amount must be in RCX.
-  __ movq(RAX, Address(RSP, + 2 * kWordSize));  // Value.
-  __ SmiUntag(RAX);  // Value.
+  __ movq(RCX, RAX);                           // Shift amount must be in RCX.
+  __ movq(RAX, Address(RSP, +2 * kWordSize));  // Value.
+  __ SmiUntag(RAX);                            // Value.
   __ sarq(RAX, RCX);
   __ SmiTag(RAX);
   __ ret();
@@ -718,7 +718,7 @@
 
 // Argument is Smi (receiver).
 void Intrinsifier::Smi_bitNegate(Assembler* assembler) {
-  __ movq(RAX, Address(RSP, + 1 * kWordSize));  // Index.
+  __ movq(RAX, Address(RSP, +1 * kWordSize));  // Index.
   __ notq(RAX);
   __ andq(RAX, Immediate(~kSmiTagMask));  // Remove inverted smi-tag.
   __ ret();
@@ -727,7 +727,7 @@
 
 void Intrinsifier::Smi_bitLength(Assembler* assembler) {
   ASSERT(kSmiTagShift == 1);
-  __ movq(RAX, Address(RSP, + 1 * kWordSize));  // Index.
+  __ movq(RAX, Address(RSP, +1 * kWordSize));  // Index.
   // XOR with sign bit to complement bits if value is negative.
   __ movq(RCX, RAX);
   __ sarq(RCX, Immediate(63));  // All 0 or all 1.
@@ -751,7 +751,7 @@
   //                  Uint32List r_digits)
 
   __ movq(RDI, Address(RSP, 4 * kWordSize));  // x_digits
-  __ movq(R8, Address(RSP, 3 * kWordSize));  // x_used is Smi
+  __ movq(R8, Address(RSP, 3 * kWordSize));   // x_used is Smi
   __ subq(R8, Immediate(2));  // x_used > 0, Smi. R8 = x_used - 1, round up.
   __ sarq(R8, Immediate(2));  // R8 + 1 = number of digit pairs to read.
   __ movq(RCX, Address(RSP, 2 * kWordSize));  // n is Smi
@@ -770,9 +770,8 @@
   Label loop;
   __ Bind(&loop);
   __ movq(RAX, RDX);
-  __ movq(RDX,
-          FieldAddress(RDI, R8, TIMES_8,
-                       TypedData::data_offset() - 2 * Bigint::kBytesPerDigit));
+  __ movq(RDX, FieldAddress(RDI, R8, TIMES_8, TypedData::data_offset() -
+                                                  2 * Bigint::kBytesPerDigit));
   __ shldq(RAX, RDX, RCX);
   __ movq(Address(RBX, R8, TIMES_8, 0), RAX);
   __ decq(R8);
@@ -794,7 +793,7 @@
   __ SmiUntag(RCX);
   __ movq(RBX, Address(RSP, 1 * kWordSize));  // r_digits
   __ movq(RDX, RCX);
-  __ sarq(RDX, Immediate(6));  // RDX = n ~/ (2*_DIGIT_BITS).
+  __ sarq(RDX, Immediate(6));                 // RDX = n ~/ (2*_DIGIT_BITS).
   __ movq(RSI, Address(RSP, 3 * kWordSize));  // x_used is Smi
   __ subq(RSI, Immediate(2));  // x_used > 0, Smi. RSI = x_used - 1, round up.
   __ sarq(RSI, Immediate(2));
@@ -828,7 +827,7 @@
   //                     Uint32List r_digits)
 
   __ movq(RDI, Address(RSP, 5 * kWordSize));  // digits
-  __ movq(R8, Address(RSP, 4 * kWordSize));  // used is Smi
+  __ movq(R8, Address(RSP, 4 * kWordSize));   // used is Smi
   __ addq(R8, Immediate(2));  // used > 0, Smi. R8 = used + 1, round up.
   __ sarq(R8, Immediate(2));  // R8 = number of digit pairs to process.
   __ movq(RSI, Address(RSP, 3 * kWordSize));  // a_digits
@@ -853,7 +852,7 @@
   __ j(NOT_ZERO, &add_loop, Assembler::kNearJump);
 
   Label last_carry;
-  __ decq(R8);  // Does not affect carry flag.
+  __ decq(R8);                                    // Does not affect carry flag.
   __ j(ZERO, &last_carry, Assembler::kNearJump);  // If used - a_used == 0.
 
   Label carry_loop;
@@ -863,7 +862,7 @@
   __ adcq(RAX, Immediate(0));
   __ movq(FieldAddress(RBX, RDX, TIMES_8, TypedData::data_offset()), RAX);
   __ incq(RDX);  // Does not affect carry flag.
-  __ decq(R8);  // Does not affect carry flag.
+  __ decq(R8);   // Does not affect carry flag.
   __ j(NOT_ZERO, &carry_loop, Assembler::kNearJump);
 
   __ Bind(&last_carry);
@@ -884,7 +883,7 @@
   //                     Uint32List r_digits)
 
   __ movq(RDI, Address(RSP, 5 * kWordSize));  // digits
-  __ movq(R8, Address(RSP, 4 * kWordSize));  // used is Smi
+  __ movq(R8, Address(RSP, 4 * kWordSize));   // used is Smi
   __ addq(R8, Immediate(2));  // used > 0, Smi. R8 = used + 1, round up.
   __ sarq(R8, Immediate(2));  // R8 = number of digit pairs to process.
   __ movq(RSI, Address(RSP, 3 * kWordSize));  // a_digits
@@ -909,7 +908,7 @@
   __ j(NOT_ZERO, &sub_loop, Assembler::kNearJump);
 
   Label done;
-  __ decq(R8);  // Does not affect carry flag.
+  __ decq(R8);                              // Does not affect carry flag.
   __ j(ZERO, &done, Assembler::kNearJump);  // If used - a_used == 0.
 
   Label carry_loop;
@@ -919,7 +918,7 @@
   __ sbbq(RAX, Immediate(0));
   __ movq(FieldAddress(RBX, RDX, TIMES_8, TypedData::data_offset()), RAX);
   __ incq(RDX);  // Does not affect carry flag.
-  __ decq(R8);  // Does not affect carry flag.
+  __ decq(R8);   // Does not affect carry flag.
   __ j(NOT_ZERO, &carry_loop, Assembler::kNearJump);
 
   __ Bind(&done);
@@ -995,10 +994,10 @@
 
   // uint64_t mi = *mip++
   __ movq(RAX, Address(RDI, 0));
-  __ addq(RDI, Immediate(2*Bigint::kBytesPerDigit));
+  __ addq(RDI, Immediate(2 * Bigint::kBytesPerDigit));
 
   // uint128_t t = x*mi
-  __ mulq(RBX);  // t = RDX:RAX = RAX * RBX, 64-bit * 64-bit -> 64-bit
+  __ mulq(RBX);       // t = RDX:RAX = RAX * RBX, 64-bit * 64-bit -> 64-bit
   __ addq(RAX, RCX);  // t += c
   __ adcq(RDX, Immediate(0));
 
@@ -1008,7 +1007,7 @@
 
   // *ajp++ = low64(t)
   __ movq(Address(RSI, 0), RAX);
-  __ addq(RSI, Immediate(2*Bigint::kBytesPerDigit));
+  __ addq(RSI, Immediate(2 * Bigint::kBytesPerDigit));
 
   // c = high64(t)
   __ movq(RCX, RDX);
@@ -1026,7 +1025,7 @@
 
   Label propagate_carry_loop;
   __ Bind(&propagate_carry_loop);
-  __ addq(RSI, Immediate(2*Bigint::kBytesPerDigit));
+  __ addq(RSI, Immediate(2 * Bigint::kBytesPerDigit));
   __ incq(Address(RSI, 0));  // c == 0 or 1
   __ j(CARRY, &propagate_carry_loop, Assembler::kNearJump);
 
@@ -1073,7 +1072,7 @@
   __ movq(RBX, Address(RDI, 0));
   __ cmpq(RBX, Immediate(0));
   __ j(EQUAL, &x_zero);
-  __ addq(RDI, Immediate(2*Bigint::kBytesPerDigit));
+  __ addq(RDI, Immediate(2 * Bigint::kBytesPerDigit));
 
   // RSI = ajp = &a_digits[i]
   __ movq(RSI, Address(RSP, 2 * kWordSize));  // a_digits
@@ -1087,7 +1086,7 @@
 
   // *ajp++ = low64(t)
   __ movq(Address(RSI, 0), RAX);
-  __ addq(RSI, Immediate(2*Bigint::kBytesPerDigit));
+  __ addq(RSI, Immediate(2 * Bigint::kBytesPerDigit));
 
   // int n = (used - i + 1)/2 - 1
   __ movq(R8, Address(RSP, 1 * kWordSize));  // used is Smi
@@ -1115,14 +1114,14 @@
 
   // uint64_t xi = *xip++
   __ movq(RAX, Address(RDI, 0));
-  __ addq(RDI, Immediate(2*Bigint::kBytesPerDigit));
+  __ addq(RDI, Immediate(2 * Bigint::kBytesPerDigit));
 
   // uint192_t t = RCX:RDX:RAX = 2*x*xi + aj + c
-  __ mulq(RBX);  // RDX:RAX = RAX * RBX
+  __ mulq(RBX);       // RDX:RAX = RAX * RBX
   __ xorq(RCX, RCX);  // RCX = 0
   __ shldq(RCX, RDX, Immediate(1));
   __ shldq(RDX, RAX, Immediate(1));
-  __ shlq(RAX, Immediate(1));  // RCX:RDX:RAX <<= 1
+  __ shlq(RAX, Immediate(1));     // RCX:RDX:RAX <<= 1
   __ addq(RAX, Address(RSI, 0));  // t += aj
   __ adcq(RDX, Immediate(0));
   __ adcq(RCX, Immediate(0));
@@ -1132,7 +1131,7 @@
 
   // *ajp++ = low64(t)
   __ movq(Address(RSI, 0), RAX);
-  __ addq(RSI, Immediate(2*Bigint::kBytesPerDigit));
+  __ addq(RSI, Immediate(2 * Bigint::kBytesPerDigit));
 
   // c = high128(t)
   __ movq(R12, RDX);
@@ -1148,7 +1147,7 @@
   // *ajp++ = low64(t)
   // *ajp = high64(t)
   __ movq(Address(RSI, 0), R12);
-  __ movq(Address(RSI, 2*Bigint::kBytesPerDigit), R13);
+  __ movq(Address(RSI, 2 * Bigint::kBytesPerDigit), R13);
 
   __ Bind(&x_zero);
   __ movq(RAX, Immediate(Smi::RawValue(2)));  // Two digits processed.
@@ -1197,16 +1196,16 @@
   __ j(EQUAL, &return_qd, Assembler::kNearJump);
 
   // RAX = dl = dp[-1]
-  __ movq(RAX, Address(RBX, -2*Bigint::kBytesPerDigit));
+  __ movq(RAX, Address(RBX, -2 * Bigint::kBytesPerDigit));
 
   // RAX = qd = dh:dl / yt = RDX:RAX / RCX
   __ divq(RCX);
 
   __ Bind(&return_qd);
   // args[2..3] = qd
-  __ movq(FieldAddress(RDI,
-                       TypedData::data_offset() + 2*Bigint::kBytesPerDigit),
-          RAX);
+  __ movq(
+      FieldAddress(RDI, TypedData::data_offset() + 2 * Bigint::kBytesPerDigit),
+      RAX);
 
   __ movq(RAX, Immediate(Smi::RawValue(2)));  // Two digits processed.
   __ ret();
@@ -1227,9 +1226,8 @@
   __ movq(RDI, Address(RSP, 3 * kWordSize));  // args
 
   // RCX = rho = args[2 .. 3]
-  __ movq(RCX,
-          FieldAddress(RDI,
-                       TypedData::data_offset() + 2*Bigint::kBytesPerDigit));
+  __ movq(RCX, FieldAddress(
+                   RDI, TypedData::data_offset() + 2 * Bigint::kBytesPerDigit));
 
   // RAX = digits[i >> 1 .. (i >> 1) + 1]
   __ movq(RBX, Address(RSP, 2 * kWordSize));  // digits
@@ -1240,9 +1238,9 @@
   __ mulq(RCX);
 
   // args[4 .. 5] = t mod DIGIT_BASE^2 = low64(t)
-  __ movq(FieldAddress(RDI,
-                       TypedData::data_offset() + 4*Bigint::kBytesPerDigit),
-          RAX);
+  __ movq(
+      FieldAddress(RDI, TypedData::data_offset() + 4 * Bigint::kBytesPerDigit),
+      RAX);
 
   __ movq(RAX, Immediate(Smi::RawValue(2)));  // Two digits processed.
   __ ret();
@@ -1255,7 +1253,7 @@
 static void TestLastArgumentIsDouble(Assembler* assembler,
                                      Label* is_smi,
                                      Label* not_double_smi) {
-  __ movq(RAX, Address(RSP, + 1 * kWordSize));
+  __ movq(RAX, Address(RSP, +1 * kWordSize));
   __ testq(RAX, Immediate(kSmiTagMask));
   __ j(ZERO, is_smi);  // Jump if Smi.
   __ CompareClassId(RAX, kDoubleCid);
@@ -1274,7 +1272,7 @@
   // Both arguments are double, right operand is in RAX.
   __ movsd(XMM1, FieldAddress(RAX, Double::value_offset()));
   __ Bind(&double_op);
-  __ movq(RAX, Address(RSP, + 2 * kWordSize));  // Left argument.
+  __ movq(RAX, Address(RSP, +2 * kWordSize));  // Left argument.
   __ movsd(XMM0, FieldAddress(RAX, Double::value_offset()));
   __ comisd(XMM0, XMM1);
   __ j(PARITY_EVEN, &is_false, Assembler::kNearJump);  // NaN -> false;
@@ -1327,20 +1325,27 @@
   // Both arguments are double, right operand is in RAX.
   __ movsd(XMM1, FieldAddress(RAX, Double::value_offset()));
   __ Bind(&double_op);
-  __ movq(RAX, Address(RSP, + 2 * kWordSize));  // Left argument.
+  __ movq(RAX, Address(RSP, +2 * kWordSize));  // Left argument.
   __ movsd(XMM0, FieldAddress(RAX, Double::value_offset()));
   switch (kind) {
-    case Token::kADD: __ addsd(XMM0, XMM1); break;
-    case Token::kSUB: __ subsd(XMM0, XMM1); break;
-    case Token::kMUL: __ mulsd(XMM0, XMM1); break;
-    case Token::kDIV: __ divsd(XMM0, XMM1); break;
-    default: UNREACHABLE();
+    case Token::kADD:
+      __ addsd(XMM0, XMM1);
+      break;
+    case Token::kSUB:
+      __ subsd(XMM0, XMM1);
+      break;
+    case Token::kMUL:
+      __ mulsd(XMM0, XMM1);
+      break;
+    case Token::kDIV:
+      __ divsd(XMM0, XMM1);
+      break;
+    default:
+      UNREACHABLE();
   }
-  const Class& double_class = Class::Handle(
-      Isolate::Current()->object_store()->double_class());
-  __ TryAllocate(double_class,
-                 &fall_through,
-                 Assembler::kFarJump,
+  const Class& double_class =
+      Class::Handle(Isolate::Current()->object_store()->double_class());
+  __ TryAllocate(double_class, &fall_through, Assembler::kFarJump,
                  RAX,  // Result register.
                  R13);
   __ movsd(FieldAddress(RAX, Double::value_offset()), XMM0);
@@ -1376,20 +1381,18 @@
 void Intrinsifier::Double_mulFromInteger(Assembler* assembler) {
   Label fall_through;
   // Only smis allowed.
-  __ movq(RAX, Address(RSP, + 1 * kWordSize));
+  __ movq(RAX, Address(RSP, +1 * kWordSize));
   __ testq(RAX, Immediate(kSmiTagMask));
   __ j(NOT_ZERO, &fall_through);
   // Is Smi.
   __ SmiUntag(RAX);
   __ cvtsi2sdq(XMM1, RAX);
-  __ movq(RAX, Address(RSP, + 2 * kWordSize));
+  __ movq(RAX, Address(RSP, +2 * kWordSize));
   __ movsd(XMM0, FieldAddress(RAX, Double::value_offset()));
   __ mulsd(XMM0, XMM1);
-  const Class& double_class = Class::Handle(
-      Isolate::Current()->object_store()->double_class());
-  __ TryAllocate(double_class,
-                 &fall_through,
-                 Assembler::kFarJump,
+  const Class& double_class =
+      Class::Handle(Isolate::Current()->object_store()->double_class());
+  __ TryAllocate(double_class, &fall_through, Assembler::kFarJump,
                  RAX,  // Result register.
                  R13);
   __ movsd(FieldAddress(RAX, Double::value_offset()), XMM0);
@@ -1407,11 +1410,9 @@
   // Is Smi.
   __ SmiUntag(RAX);
   __ cvtsi2sdq(XMM0, RAX);
-  const Class& double_class = Class::Handle(
-      Isolate::Current()->object_store()->double_class());
-  __ TryAllocate(double_class,
-                 &fall_through,
-                 Assembler::kFarJump,
+  const Class& double_class =
+      Class::Handle(Isolate::Current()->object_store()->double_class());
+  __ TryAllocate(double_class, &fall_through, Assembler::kFarJump,
                  RAX,  // Result register.
                  R13);
   __ movsd(FieldAddress(RAX, Double::value_offset()), XMM0);
@@ -1434,6 +1435,26 @@
 }
 
 
+void Intrinsifier::Double_getIsInfinite(Assembler* assembler) {
+  Label is_inf, done;
+  __ movq(RAX, Address(RSP, +1 * kWordSize));
+  __ movq(RAX, FieldAddress(RAX, Double::value_offset()));
+  // Mask off the sign.
+  __ AndImmediate(RAX, Immediate(0x7FFFFFFFFFFFFFFFLL));
+  // Compare with +infinity.
+  __ CompareImmediate(RAX, Immediate(0x7FF0000000000000LL));
+  __ j(EQUAL, &is_inf, Assembler::kNearJump);
+  __ LoadObject(RAX, Bool::False());
+  __ jmp(&done);
+
+  __ Bind(&is_inf);
+  __ LoadObject(RAX, Bool::True());
+
+  __ Bind(&done);
+  __ ret();
+}
+
+
 void Intrinsifier::Double_getIsNegative(Assembler* assembler) {
   Label is_false, is_true, is_zero;
   __ movq(RAX, Address(RSP, +1 * kWordSize));
@@ -1481,11 +1502,9 @@
   __ movsd(XMM1, FieldAddress(RAX, Double::value_offset()));
   __ Bind(&double_op);
   __ sqrtsd(XMM0, XMM1);
-  const Class& double_class = Class::Handle(
-      Isolate::Current()->object_store()->double_class());
-  __ TryAllocate(double_class,
-                 &fall_through,
-                 Assembler::kFarJump,
+  const Class& double_class =
+      Class::Handle(Isolate::Current()->object_store()->double_class());
+  __ TryAllocate(double_class, &fall_through, Assembler::kFarJump,
                  RAX,  // Result register.
                  R13);
   __ movsd(FieldAddress(RAX, Double::value_offset()), XMM0);
@@ -1504,8 +1523,8 @@
 void Intrinsifier::Random_nextState(Assembler* assembler) {
   const Library& math_lib = Library::Handle(Library::MathLibrary());
   ASSERT(!math_lib.IsNull());
-  const Class& random_class = Class::Handle(
-      math_lib.LookupClassAllowPrivate(Symbols::_Random()));
+  const Class& random_class =
+      Class::Handle(math_lib.LookupClassAllowPrivate(Symbols::_Random()));
   ASSERT(!random_class.IsNull());
   const Field& state_field = Field::ZoneHandle(
       random_class.LookupInstanceFieldAllowPrivate(Symbols::_state()));
@@ -1514,10 +1533,15 @@
       random_class.LookupStaticFieldAllowPrivate(Symbols::_A()));
   ASSERT(!random_A_field.IsNull());
   ASSERT(random_A_field.is_const());
-  const Instance& a_value = Instance::Handle(random_A_field.StaticValue());
+  Instance& a_value = Instance::Handle(random_A_field.StaticValue());
+  if (a_value.raw() == Object::sentinel().raw() ||
+      a_value.raw() == Object::transition_sentinel().raw()) {
+    random_A_field.EvaluateInitializer();
+    a_value = random_A_field.StaticValue();
+  }
   const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value();
   // Receiver.
-  __ movq(RAX, Address(RSP, + 1 * kWordSize));
+  __ movq(RAX, Address(RSP, +1 * kWordSize));
   // Field '_state'.
   __ movq(RBX, FieldAddress(RAX, state_field.Offset()));
   // Addresses of _state[0] and _state[1].
@@ -1542,8 +1566,8 @@
   const intptr_t kReceiverOffset = 2;
   const intptr_t kArgumentOffset = 1;
 
-  __ movq(RAX, Address(RSP, + kArgumentOffset * kWordSize));
-  __ cmpq(RAX, Address(RSP, + kReceiverOffset * kWordSize));
+  __ movq(RAX, Address(RSP, +kArgumentOffset * kWordSize));
+  __ cmpq(RAX, Address(RSP, +kReceiverOffset * kWordSize));
   __ j(EQUAL, &is_true, Assembler::kNearJump);
   __ LoadObject(RAX, Bool::False());
   __ ret();
@@ -1553,19 +1577,92 @@
 }
 
 
+static void RangeCheck(Assembler* assembler,
+                       Register reg,
+                       intptr_t low,
+                       intptr_t high,
+                       Condition cc,
+                       Label* target) {
+  __ subq(reg, Immediate(low));
+  __ cmpq(reg, Immediate(high - low));
+  __ j(cc, target);
+}
+
+
+const Condition kIfNotInRange = ABOVE;
+const Condition kIfInRange = BELOW_EQUAL;
+
+
+static void JumpIfInteger(Assembler* assembler, Register cid, Label* target) {
+  RangeCheck(assembler, cid, kSmiCid, kBigintCid, kIfInRange, target);
+}
+
+
+static void JumpIfNotInteger(Assembler* assembler,
+                             Register cid,
+                             Label* target) {
+  RangeCheck(assembler, cid, kSmiCid, kBigintCid, kIfNotInRange, target);
+}
+
+
+static void JumpIfString(Assembler* assembler, Register cid, Label* target) {
+  RangeCheck(assembler, cid, kOneByteStringCid, kExternalTwoByteStringCid,
+             kIfInRange, target);
+}
+
+
+static void JumpIfNotString(Assembler* assembler, Register cid, Label* target) {
+  RangeCheck(assembler, cid, kOneByteStringCid, kExternalTwoByteStringCid,
+             kIfNotInRange, target);
+}
+
+
 // Return type quickly for simple types (not parameterized and not signature).
 void Intrinsifier::ObjectRuntimeType(Assembler* assembler) {
-  Label fall_through;
-  __ movq(RAX, Address(RSP, + 1 * kWordSize));
+  Label fall_through, use_canonical_type, not_integer, not_double;
+  __ movq(RAX, Address(RSP, +1 * kWordSize));
   __ LoadClassIdMayBeSmi(RCX, RAX);
 
   // RCX: untagged cid of instance (RAX).
   __ cmpq(RCX, Immediate(kClosureCid));
-  __ j(EQUAL, &fall_through, Assembler::kNearJump);  // Instance is a closure.
+  __ j(EQUAL, &fall_through);  // Instance is a closure.
 
+  __ cmpl(RCX, Immediate(kNumPredefinedCids));
+  __ j(ABOVE, &use_canonical_type);
+
+  // If object is a instance of _Double return double type.
+  __ cmpl(RCX, Immediate(kDoubleCid));
+  __ j(NOT_EQUAL, &not_double);
+
+  __ LoadIsolate(RAX);
+  __ movq(RAX, Address(RAX, Isolate::object_store_offset()));
+  __ movq(RAX, Address(RAX, ObjectStore::double_type_offset()));
+  __ ret();
+
+  __ Bind(&not_double);
+  // If object is an integer (smi, mint or bigint) return int type.
+  __ movl(RAX, RCX);
+  JumpIfNotInteger(assembler, RAX, &not_integer);
+
+  __ LoadIsolate(RAX);
+  __ movq(RAX, Address(RAX, Isolate::object_store_offset()));
+  __ movq(RAX, Address(RAX, ObjectStore::int_type_offset()));
+  __ ret();
+
+  __ Bind(&not_integer);
+  // If object is a string (one byte, two byte or external variants) return
+  // string type.
+  __ movq(RAX, RCX);
+  JumpIfNotString(assembler, RAX, &use_canonical_type);
+
+  __ LoadIsolate(RAX);
+  __ movq(RAX, Address(RAX, Isolate::object_store_offset()));
+  __ movq(RAX, Address(RAX, ObjectStore::string_type_offset()));
+  __ ret();
+
+  // Object is neither double, nor integer, nor string.
+  __ Bind(&use_canonical_type);
   __ LoadClassById(RDI, RCX);
-  // RDI: class of instance (RAX).
-
   __ movzxw(RCX, FieldAddress(RDI, Class::num_type_arguments_offset()));
   __ cmpq(RCX, Immediate(0));
   __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump);
@@ -1578,9 +1675,73 @@
 }
 
 
+void Intrinsifier::ObjectHaveSameRuntimeType(Assembler* assembler) {
+  Label fall_through, different_cids, equal, not_equal, not_integer;
+
+  __ movq(RAX, Address(RSP, +1 * kWordSize));
+  __ LoadClassIdMayBeSmi(RCX, RAX);
+
+  // Check if left hand size is a closure. Closures are handled in the runtime.
+  __ cmpq(RCX, Immediate(kClosureCid));
+  __ j(EQUAL, &fall_through);
+
+  __ movq(RAX, Address(RSP, +2 * kWordSize));
+  __ LoadClassIdMayBeSmi(RDX, RAX);
+
+  // Check whether class ids match. If class ids don't match objects can still
+  // have the same runtime type (e.g. multiple string implementation classes
+  // map to a single String type).
+  __ cmpq(RCX, RDX);
+  __ j(NOT_EQUAL, &different_cids);
+
+  // Objects have the same class and neither is a closure.
+  // Check if there are no type arguments. In this case we can return true.
+  // Otherwise fall through into the runtime to handle comparison.
+  __ LoadClassById(RDI, RCX);
+  __ movzxw(RCX, FieldAddress(RDI, Class::num_type_arguments_offset()));
+  __ cmpq(RCX, Immediate(0));
+  __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump);
+
+  __ Bind(&equal);
+  __ LoadObject(RAX, Bool::True());
+  __ ret();
+
+  // Class ids are different. Check if we are comparing runtime types of
+  // two strings (with different representations) or two integers.
+  __ Bind(&different_cids);
+  __ cmpq(RCX, Immediate(kNumPredefinedCids));
+  __ j(ABOVE_EQUAL, &not_equal);
+
+  __ movq(RAX, RCX);
+  JumpIfNotInteger(assembler, RAX, &not_integer);
+
+  // First object is an integer. Check if the second is an integer too.
+  // Otherwise types are unequal because only integers have the same runtime
+  // type as other integers.
+  JumpIfInteger(assembler, RDX, &equal);
+  __ jmp(&not_equal);
+
+  __ Bind(&not_integer);
+  // Check if the first object is a string. If it is not then
+  // objects don't have the same runtime type because they have
+  // different class ids and they are not strings or integers.
+  JumpIfNotString(assembler, RCX, &not_equal);
+  // First object is a string. Check if the second is a string too.
+  JumpIfString(assembler, RDX, &equal);
+  // Strings only have the same runtime type as other strings.
+  // Fall-through to the not equal case.
+
+  __ Bind(&not_equal);
+  __ LoadObject(RAX, Bool::False());
+  __ ret();
+
+  __ Bind(&fall_through);
+}
+
+
 void Intrinsifier::String_getHashCode(Assembler* assembler) {
   Label fall_through;
-  __ movq(RAX, Address(RSP, + 1 * kWordSize));  // String object.
+  __ movq(RAX, Address(RSP, +1 * kWordSize));  // String object.
   __ movq(RAX, FieldAddress(RAX, String::hash_offset()));
   __ cmpq(RAX, Immediate(0));
   __ j(EQUAL, &fall_through, Assembler::kNearJump);
@@ -1612,8 +1773,8 @@
   __ cmpq(R11, R8);
   __ j(GREATER, return_false);
 
-  __ SmiUntag(RBX);  // start
-  __ SmiUntag(R9);   // other.length
+  __ SmiUntag(RBX);            // start
+  __ SmiUntag(R9);             // other.length
   __ movq(R11, Immediate(0));  // i = 0
 
   // do
@@ -1658,9 +1819,9 @@
 // OneByteString other.
 void Intrinsifier::StringBaseSubstringMatches(Assembler* assembler) {
   Label fall_through, return_true, return_false, try_two_byte;
-  __ movq(RAX, Address(RSP, + 3 * kWordSize));  // receiver
-  __ movq(RBX, Address(RSP, + 2 * kWordSize));  // start
-  __ movq(RCX, Address(RSP, + 1 * kWordSize));  // other
+  __ movq(RAX, Address(RSP, +3 * kWordSize));  // receiver
+  __ movq(RBX, Address(RSP, +2 * kWordSize));  // start
+  __ movq(RCX, Address(RSP, +1 * kWordSize));  // other
 
   __ testq(RBX, Immediate(kSmiTagMask));
   __ j(NOT_ZERO, &fall_through);  // 'start' is not Smi.
@@ -1671,20 +1832,16 @@
   __ CompareClassId(RAX, kOneByteStringCid);
   __ j(NOT_EQUAL, &try_two_byte);
 
-  GenerateSubstringMatchesSpecialization(assembler,
-                                         kOneByteStringCid,
-                                         kOneByteStringCid,
-                                         &return_true,
+  GenerateSubstringMatchesSpecialization(assembler, kOneByteStringCid,
+                                         kOneByteStringCid, &return_true,
                                          &return_false);
 
   __ Bind(&try_two_byte);
   __ CompareClassId(RAX, kTwoByteStringCid);
   __ j(NOT_EQUAL, &fall_through);
 
-  GenerateSubstringMatchesSpecialization(assembler,
-                                         kTwoByteStringCid,
-                                         kOneByteStringCid,
-                                         &return_true,
+  GenerateSubstringMatchesSpecialization(assembler, kTwoByteStringCid,
+                                         kOneByteStringCid, &return_true,
                                          &return_false);
 
   __ Bind(&return_true);
@@ -1701,8 +1858,8 @@
 
 void Intrinsifier::StringBaseCharAt(Assembler* assembler) {
   Label fall_through, try_two_byte_string;
-  __ movq(RCX, Address(RSP, + 1 * kWordSize));  // Index.
-  __ movq(RAX, Address(RSP, + 2 * kWordSize));  // String.
+  __ movq(RCX, Address(RSP, +1 * kWordSize));  // Index.
+  __ movq(RAX, Address(RSP, +2 * kWordSize));  // String.
   __ testq(RCX, Immediate(kSmiTagMask));
   __ j(NOT_ZERO, &fall_through);  // Non-smi index.
   // Range check.
@@ -1716,9 +1873,7 @@
   __ cmpq(RCX, Immediate(Symbols::kNumberOfOneCharCodeSymbols));
   __ j(GREATER_EQUAL, &fall_through);
   __ movq(RAX, Address(THR, Thread::predefined_symbols_address_offset()));
-  __ movq(RAX, Address(RAX,
-                       RCX,
-                       TIMES_8,
+  __ movq(RAX, Address(RAX, RCX, TIMES_8,
                        Symbols::kNullCharCodeSymbolOffset * kWordSize));
   __ ret();
 
@@ -1730,9 +1885,7 @@
   __ cmpq(RCX, Immediate(Symbols::kNumberOfOneCharCodeSymbols));
   __ j(GREATER_EQUAL, &fall_through);
   __ movq(RAX, Address(THR, Thread::predefined_symbols_address_offset()));
-  __ movq(RAX, Address(RAX,
-                       RCX,
-                       TIMES_8,
+  __ movq(RAX, Address(RAX, RCX, TIMES_8,
                        Symbols::kNullCharCodeSymbolOffset * kWordSize));
   __ ret();
 
@@ -1743,7 +1896,7 @@
 void Intrinsifier::StringBaseIsEmpty(Assembler* assembler) {
   Label is_true;
   // Get length.
-  __ movq(RAX, Address(RSP, + 1 * kWordSize));  // String object.
+  __ movq(RAX, Address(RSP, +1 * kWordSize));  // String object.
   __ movq(RAX, FieldAddress(RAX, String::length_offset()));
   __ cmpq(RAX, Immediate(Smi::RawValue(0)));
   __ j(EQUAL, &is_true, Assembler::kNearJump);
@@ -1757,7 +1910,7 @@
 
 void Intrinsifier::OneByteString_getHashCode(Assembler* assembler) {
   Label compute_hash;
-  __ movq(RBX, Address(RSP, + 1 * kWordSize));  // OneByteString object.
+  __ movq(RBX, Address(RSP, +1 * kWordSize));  // OneByteString object.
   __ movq(RAX, FieldAddress(RBX, String::hash_offset()));
   __ cmpq(RAX, Immediate(0));
   __ j(EQUAL, &compute_hash, Assembler::kNearJump);
@@ -1811,7 +1964,7 @@
   __ addl(RAX, RDX);
   // hash_ = hash_ & ((static_cast<intptr_t>(1) << bits) - 1);
   __ andl(RAX,
-      Immediate(((static_cast<intptr_t>(1) << String::kHashBits) - 1)));
+          Immediate(((static_cast<intptr_t>(1) << String::kHashBits) - 1)));
 
   // return hash_ == 0 ? 1 : hash_;
   __ cmpq(RAX, Immediate(0));
@@ -1850,7 +2003,7 @@
   // RDI: allocation size.
   __ movq(RCX, RAX);
   __ addq(RCX, RDI);
-  __ j(CARRY,  &pop_and_fail);
+  __ j(CARRY, &pop_and_fail);
 
   // Check if the allocation fits into the remaining space.
   // RAX: potential new object start.
@@ -1887,8 +2040,7 @@
 
   // Set the length field.
   __ popq(RDI);
-  __ StoreIntoObjectNoBarrier(RAX,
-                              FieldAddress(RAX, String::length_offset()),
+  __ StoreIntoObjectNoBarrier(RAX, FieldAddress(RAX, String::length_offset()),
                               RDI);
   // Clear hash.
   __ ZeroInitSmiField(FieldAddress(RAX, String::hash_offset()));
@@ -1909,24 +2061,24 @@
   const intptr_t kStartIndexOffset = 2 * kWordSize;
   const intptr_t kEndIndexOffset = 1 * kWordSize;
   Label fall_through, ok;
-  __ movq(RSI, Address(RSP, + kStartIndexOffset));
-  __ movq(RDI, Address(RSP, + kEndIndexOffset));
+  __ movq(RSI, Address(RSP, +kStartIndexOffset));
+  __ movq(RDI, Address(RSP, +kEndIndexOffset));
   __ orq(RSI, RDI);
   __ testq(RSI, Immediate(kSmiTagMask));
   __ j(NOT_ZERO, &fall_through);  // 'start', 'end' not Smi.
 
-  __ subq(RDI, Address(RSP, + kStartIndexOffset));
+  __ subq(RDI, Address(RSP, +kStartIndexOffset));
   TryAllocateOnebyteString(assembler, &ok, &fall_through, RDI);
   __ Bind(&ok);
   // RAX: new string as tagged pointer.
   // Copy string.
-  __ movq(RSI, Address(RSP, + kStringOffset));
-  __ movq(RBX, Address(RSP, + kStartIndexOffset));
+  __ movq(RSI, Address(RSP, +kStringOffset));
+  __ movq(RBX, Address(RSP, +kStartIndexOffset));
   __ SmiUntag(RBX);
   __ leaq(RSI, FieldAddress(RSI, RBX, TIMES_1, OneByteString::data_offset()));
   // RSI: Start address to copy from (untagged).
   // RBX: Untagged start index.
-  __ movq(RCX, Address(RSP, + kEndIndexOffset));
+  __ movq(RCX, Address(RSP, +kEndIndexOffset));
   __ SmiUntag(RCX);
   __ subq(RCX, RBX);
   __ xorq(RDX, RDX);
@@ -1950,9 +2102,9 @@
 
 
 void Intrinsifier::OneByteStringSetAt(Assembler* assembler) {
-  __ movq(RCX, Address(RSP, + 1 * kWordSize));  // Value.
-  __ movq(RBX, Address(RSP, + 2 * kWordSize));  // Index.
-  __ movq(RAX, Address(RSP, + 3 * kWordSize));  // OneByteString.
+  __ movq(RCX, Address(RSP, +1 * kWordSize));  // Value.
+  __ movq(RBX, Address(RSP, +2 * kWordSize));  // Index.
+  __ movq(RAX, Address(RSP, +3 * kWordSize));  // OneByteString.
   __ SmiUntag(RBX);
   __ SmiUntag(RCX);
   __ movb(FieldAddress(RAX, RBX, TIMES_1, OneByteString::data_offset()), RCX);
@@ -1961,7 +2113,7 @@
 
 
 void Intrinsifier::OneByteString_allocate(Assembler* assembler) {
-  __ movq(RDI, Address(RSP, + 1 * kWordSize));  // Length.v=
+  __ movq(RDI, Address(RSP, +1 * kWordSize));  // Length.v=
   Label fall_through, ok;
   TryAllocateOnebyteString(assembler, &ok, &fall_through, RDI);
   // RDI: Start address to copy from (untagged).
@@ -1976,8 +2128,8 @@
 // TODO(srdjan): Add combinations (one-byte/two-byte/external strings).
 static void StringEquality(Assembler* assembler, intptr_t string_cid) {
   Label fall_through, is_true, is_false, loop;
-  __ movq(RAX, Address(RSP, + 2 * kWordSize));  // This.
-  __ movq(RCX, Address(RSP, + 1 * kWordSize));  // Other.
+  __ movq(RAX, Address(RSP, +2 * kWordSize));  // This.
+  __ movq(RCX, Address(RSP, +1 * kWordSize));  // Other.
 
   // Are identical?
   __ cmpq(RAX, RCX);
@@ -2003,14 +2155,14 @@
   __ j(LESS, &is_true, Assembler::kNearJump);
   if (string_cid == kOneByteStringCid) {
     __ movzxb(RBX,
-        FieldAddress(RAX, RDI, TIMES_1, OneByteString::data_offset()));
+              FieldAddress(RAX, RDI, TIMES_1, OneByteString::data_offset()));
     __ movzxb(RDX,
-        FieldAddress(RCX, RDI, TIMES_1, OneByteString::data_offset()));
+              FieldAddress(RCX, RDI, TIMES_1, OneByteString::data_offset()));
   } else if (string_cid == kTwoByteStringCid) {
     __ movzxw(RBX,
-        FieldAddress(RAX, RDI, TIMES_2, TwoByteString::data_offset()));
+              FieldAddress(RAX, RDI, TIMES_2, TwoByteString::data_offset()));
     __ movzxw(RDX,
-        FieldAddress(RCX, RDI, TIMES_2, TwoByteString::data_offset()));
+              FieldAddress(RCX, RDI, TIMES_2, TwoByteString::data_offset()));
   } else {
     UNIMPLEMENTED();
   }
@@ -2040,7 +2192,8 @@
 }
 
 
-void Intrinsifier::RegExp_ExecuteMatch(Assembler* assembler) {
+void Intrinsifier::IntrinsifyRegExpExecuteMatch(Assembler* assembler,
+                                                bool sticky) {
   if (FLAG_interpret_irregexp) return;
 
   static const intptr_t kRegExpParamOffset = 3 * kWordSize;
@@ -2058,8 +2211,8 @@
   __ movq(RDI, Address(RSP, kStringParamOffset));
   __ LoadClassId(RDI, RDI);
   __ SubImmediate(RDI, Immediate(kOneByteStringCid));
-  __ movq(RAX, FieldAddress(RBX, RDI, TIMES_8,
-                            RegExp::function_offset(kOneByteStringCid)));
+  __ movq(RAX, FieldAddress(RBX, RDI, TIMES_8, RegExp::function_offset(
+                                                   kOneByteStringCid, sticky)));
 
   // Registers are now set up for the lazy compile stub. It expects the function
   // in RAX, the argument descriptor in R10, and IC-Data in RCX.
@@ -2079,7 +2232,7 @@
   // RAX: Current user tag.
   __ movq(RAX, Address(RBX, Isolate::current_tag_offset()));
   // R10: UserTag.
-  __ movq(R10, Address(RSP, + 1 * kWordSize));
+  __ movq(R10, Address(RSP, +1 * kWordSize));
   // Set Isolate::current_tag_.
   __ movq(Address(RBX, Isolate::current_tag_offset()), R10);
   // R10: UserTag's tag.
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index 908f0f2..aa851bf 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -64,7 +64,7 @@
 DECLARE_FLAG(bool, trace_reload);
 
 
-NOT_IN_PRODUCT(
+#if !defined(PRODUCT)
 static void CheckedModeHandler(bool value) {
   FLAG_enable_asserts = value;
   FLAG_enable_type_checks = value;
@@ -76,10 +76,8 @@
                     enable_checked_mode,
                     "Enable checked mode.");
 
-DEFINE_FLAG_HANDLER(CheckedModeHandler,
-                    checked,
-                    "Enable checked mode.");
-)
+DEFINE_FLAG_HANDLER(CheckedModeHandler, checked, "Enable checked mode.");
+#endif  // !defined(PRODUCT)
 
 
 // Quick access to the locally defined thread() and isolate() methods.
@@ -93,9 +91,7 @@
  public:
   explicit VerifyOriginId(Dart_Port id) : id_(id) {}
 
-  void VisitIsolate(Isolate* isolate) {
-    ASSERT(isolate->origin_id() != id_);
-  }
+  void VisitIsolate(Isolate* isolate) { ASSERT(isolate->origin_id() != id_); }
 
  private:
   Dart_Port id_;
@@ -120,8 +116,7 @@
 }
 
 // TODO(zra): Allocation of Message objects should be centralized.
-static Message* SerializeMessage(
-    Dart_Port dest_port, const Instance& obj) {
+static Message* SerializeMessage(Dart_Port dest_port, const Instance& obj) {
   if (ApiObjectConverter::CanConvert(obj.raw())) {
     return new Message(dest_port, obj.raw(), Message::kNormalPriority);
   } else {
@@ -144,29 +139,28 @@
 
 
 NoReloadScope::NoReloadScope(Isolate* isolate, Thread* thread)
-    : StackResource(thread),
-      isolate_(isolate) {
+    : StackResource(thread), isolate_(isolate) {
   ASSERT(isolate_ != NULL);
   AtomicOperations::FetchAndIncrement(&(isolate_->no_reload_scope_depth_));
-  ASSERT(
-      AtomicOperations::LoadRelaxed(&(isolate_->no_reload_scope_depth_)) >= 0);
+  ASSERT(AtomicOperations::LoadRelaxed(&(isolate_->no_reload_scope_depth_)) >=
+         0);
 }
 
 
 NoReloadScope::~NoReloadScope() {
   AtomicOperations::FetchAndDecrement(&(isolate_->no_reload_scope_depth_));
-  ASSERT(
-      AtomicOperations::LoadRelaxed(&(isolate_->no_reload_scope_depth_)) >= 0);
+  ASSERT(AtomicOperations::LoadRelaxed(&(isolate_->no_reload_scope_depth_)) >=
+         0);
 }
 
 
 void Isolate::RegisterClass(const Class& cls) {
-  NOT_IN_PRODUCT(
-    if (IsReloading()) {
-      reload_context()->RegisterClass(cls);
-      return;
-    }
-  )
+#if !defined(PRODUCT)
+  if (IsReloading()) {
+    reload_context()->RegisterClass(cls);
+    return;
+  }
+#endif  // !defined(PRODUCT)
   class_table()->Register(cls);
 }
 
@@ -196,8 +190,7 @@
   MessageWriter writer(&data, &allocator, false);
   writer.WriteMessage(msg);
 
-  PortMap::PostMessage(new Message(main_port(),
-                                   data, writer.BytesWritten(),
+  PortMap::PostMessage(new Message(main_port(), data, writer.BytesWritten(),
                                    Message::kOOBPriority));
 }
 
@@ -233,12 +226,10 @@
 
 
 IsolateMessageHandler::IsolateMessageHandler(Isolate* isolate)
-    : isolate_(isolate) {
-}
+    : isolate_(isolate) {}
 
 
-IsolateMessageHandler::~IsolateMessageHandler() {
-}
+IsolateMessageHandler::~IsolateMessageHandler() {}
 
 const char* IsolateMessageHandler::name() const {
   return isolate_->name();
@@ -293,19 +284,18 @@
       const Instance& response =
           obj4.IsNull() ? Instance::null_instance() : Instance::Cast(obj4);
       if (priority == Isolate::kImmediateAction) {
-        PortMap::PostMessage(SerializeMessage(
-            send_port.Id(), response));
+        PortMap::PostMessage(SerializeMessage(send_port.Id(), response));
       } else {
         ASSERT((priority == Isolate::kBeforeNextEventAction) ||
                (priority == Isolate::kAsEventAction));
         // Update the message so that it will be handled immediately when it
         // is picked up from the message queue the next time.
-        message.SetAt(0, Smi::Handle(zone,
-            Smi::New(Message::kDelayedIsolateLibOOBMsg)));
-        message.SetAt(3, Smi::Handle(zone,
-            Smi::New(Isolate::kImmediateAction)));
-        this->PostMessage(SerializeMessage(
-            Message::kIllegalPort, message),
+        message.SetAt(
+            0, Smi::Handle(zone, Smi::New(Message::kDelayedIsolateLibOOBMsg)));
+        message.SetAt(3,
+                      Smi::Handle(zone, Smi::New(Isolate::kImmediateAction)));
+        this->PostMessage(
+            SerializeMessage(Message::kIllegalPort, message),
             priority == Isolate::kBeforeNextEventAction /* at_head */);
       }
       break;
@@ -323,22 +313,22 @@
         if (I->VerifyTerminateCapability(obj)) {
           // We will kill the current isolate by returning an UnwindError.
           if (msg_type == Isolate::kKillMsg) {
-            const String& msg = String::Handle(String::New(
-                "isolate terminated by Isolate.kill"));
+            const String& msg = String::Handle(
+                String::New("isolate terminated by Isolate.kill"));
             const UnwindError& error =
                 UnwindError::Handle(UnwindError::New(msg));
             error.set_is_user_initiated(true);
             return error.raw();
           } else if (msg_type == Isolate::kInternalKillMsg) {
-            const String& msg = String::Handle(String::New(
-                "isolate terminated by vm"));
+            const String& msg =
+                String::Handle(String::New("isolate terminated by vm"));
             return UnwindError::New(msg);
           } else if (msg_type == Isolate::kVMRestartMsg) {
             // If this is the main isolate, this request to restart
             // will be caught and handled in the embedder.  Otherwise
             // this unwind error will cause the isolate to exit.
-            const String& msg = String::Handle(String::New(
-                "isolate terminated for vm restart"));
+            const String& msg = String::Handle(
+                String::New("isolate terminated for vm restart"));
             const UnwindError& error =
                 UnwindError::Handle(UnwindError::New(msg));
             error.set_is_vm_restart(true);
@@ -354,12 +344,12 @@
                (priority == Isolate::kAsEventAction));
         // Update the message so that it will be handled immediately when it
         // is picked up from the message queue the next time.
-        message.SetAt(0, Smi::Handle(zone,
-            Smi::New(Message::kDelayedIsolateLibOOBMsg)));
-        message.SetAt(3, Smi::Handle(zone,
-            Smi::New(Isolate::kImmediateAction)));
-        this->PostMessage(SerializeMessage(
-            Message::kIllegalPort, message),
+        message.SetAt(
+            0, Smi::Handle(zone, Smi::New(Message::kDelayedIsolateLibOOBMsg)));
+        message.SetAt(3,
+                      Smi::Handle(zone, Smi::New(Isolate::kImmediateAction)));
+        this->PostMessage(
+            SerializeMessage(Message::kIllegalPort, message),
             priority == Isolate::kBeforeNextEventAction /* at_head */);
       }
       break;
@@ -394,9 +384,9 @@
           if (!response.IsInstance() && !response.IsNull()) {
             return Error::null();
           }
-          I->AddExitListener(listener,
-                             response.IsNull() ? Instance::null_instance()
-                                               : Instance::Cast(response));
+          I->AddExitListener(listener, response.IsNull()
+                                           ? Instance::null_instance()
+                                           : Instance::Cast(response));
           break;
         }
         case Isolate::kDelExitMsg:
@@ -460,8 +450,7 @@
   Zone* zone = stack_zone.GetZone();
   HandleScope handle_scope(thread);
 #ifndef PRODUCT
-  TimelineDurationScope tds(thread,
-                            Timeline::GetIsolateStream(),
+  TimelineDurationScope tds(thread, Timeline::GetIsolateStream(),
                             "HandleMessage");
   tds.SetNumArguments(1);
   tds.CopyArgument(0, "isolateName", I->name());
@@ -571,8 +560,8 @@
       }
     }
   } else {
-    const Object& result = Object::Handle(zone,
-        DartLibraryCalls::HandleMessage(msg_handler, msg));
+    const Object& result =
+        Object::Handle(zone, DartLibraryCalls::HandleMessage(msg_handler, msg));
     if (result.IsError()) {
       status = ProcessUnhandledException(Error::Cast(result));
     } else {
@@ -624,8 +613,7 @@
     ServiceEvent pause_event(I, ServiceEvent::kPauseExit);
     Service::HandleEvent(&pause_event);
   } else if (FLAG_trace_service) {
-    OS::Print("vm-service: Dropping event of type PauseExit (%s)\n",
-              I->name());
+    OS::Print("vm-service: Dropping event of type PauseExit (%s)\n", I->name());
   }
 }
 #endif  // !PRODUCT
@@ -681,7 +669,7 @@
     if (!tmp.IsString()) {
       tmp = String::New(stacktrace.ToCString());
     }
-    stacktrace_str ^= tmp.raw();;
+    stacktrace_str ^= tmp.raw();
   } else {
     exc_str = String::New(result.ToErrorCString());
   }
@@ -737,17 +725,18 @@
 }
 
 
-NOT_IN_PRODUCT(
+#if !defined(PRODUCT)
 void Isolate::FlagsCopyFrom(const Dart_IsolateFlags& api_flags) {
   type_checks_ = api_flags.enable_type_checks;
   asserts_ = api_flags.enable_asserts;
   error_on_bad_type_ = api_flags.enable_error_on_bad_type;
   error_on_bad_override_ = api_flags.enable_error_on_bad_override;
   // Leave others at defaults.
-})
+}
+#endif  // !defined(PRODUCT)
 
 
-DEBUG_ONLY(
+#if defined(DEBUG)
 // static
 void BaseIsolate::AssertCurrent(BaseIsolate* isolate) {
   ASSERT(isolate == Isolate::Current());
@@ -757,7 +746,7 @@
   ASSERT(Isolate::Current() == this);
   ASSERT(Thread::Current()->IsMutatorThread());
 }
-)
+#endif  // defined(DEBUG)
 
 #if defined(DEBUG)
 #define REUSABLE_HANDLE_SCOPE_INIT(object)                                     \
@@ -766,17 +755,17 @@
 #define REUSABLE_HANDLE_SCOPE_INIT(object)
 #endif  // defined(DEBUG)
 
-#define REUSABLE_HANDLE_INITIALIZERS(object)                                   \
-  object##_handle_(NULL),
+#define REUSABLE_HANDLE_INITIALIZERS(object) object##_handle_(NULL),
 
 // TODO(srdjan): Some Isolate monitors can be shared. Replace their usage with
 // that shared monitor.
 Isolate::Isolate(const Dart_IsolateFlags& api_flags)
-  :   store_buffer_(new StoreBuffer()),
+    : store_buffer_(new StoreBuffer()),
       heap_(NULL),
       user_tag_(0),
       current_tag_(UserTag::null()),
       default_tag_(UserTag::null()),
+      object_store_(NULL),
       class_table_(),
       single_step_(false),
       thread_registry_(new ThreadRegistry()),
@@ -790,8 +779,6 @@
       pause_capability_(0),
       terminate_capability_(0),
       errors_fatal_(true),
-      object_store_(NULL),
-      top_exit_frame_info_(0),
       init_callback_data_(NULL),
       environment_callback_(NULL),
       library_tag_handler_(NULL),
@@ -813,10 +800,9 @@
       gc_prologue_callback_(NULL),
       gc_epilogue_callback_(NULL),
       defer_finalization_count_(0),
+      pending_deopts_(new MallocGrowableArray<PendingLazyDeopt>),
       deopt_context_(NULL),
       is_service_isolate_(false),
-      stacktrace_(NULL),
-      stack_frame_index_(-1),
       last_allocationprofile_accumulator_reset_timestamp_(0),
       last_allocationprofile_gc_timestamp_(0),
       object_id_ring_(NULL),
@@ -838,11 +824,16 @@
       boxed_field_list_(GrowableObjectArray::null()),
       spawn_count_monitor_(new Monitor()),
       spawn_count_(0),
-      has_attempted_reload_(false),
+#define ISOLATE_METRIC_CONSTRUCTORS(type, variable, name, unit)                \
+  metric_##variable##_(),
+      ISOLATE_METRIC_LIST(ISOLATE_METRIC_CONSTRUCTORS)
+#undef ISOLATE_METRIC_CONSTRUCTORS
+          has_attempted_reload_(false),
       no_reload_scope_depth_(0),
       reload_every_n_stack_overflow_checks_(FLAG_reload_every),
       reload_context_(NULL),
-      last_reload_timestamp_(OS::GetCurrentTimeMillis()) {
+      last_reload_timestamp_(OS::GetCurrentTimeMillis()),
+      should_pause_post_service_request_(false) {
   NOT_IN_PRODUCT(FlagsCopyFrom(api_flags));
   // TODO(asiva): A Thread is not available here, need to figure out
   // how the vm_tag (kEmbedderTagId) can be set, these tags need to
@@ -878,6 +869,8 @@
   constant_canonicalization_mutex_ = NULL;
   delete megamorphic_lookup_mutex_;
   megamorphic_lookup_mutex_ = NULL;
+  delete pending_deopts_;
+  pending_deopts_ = NULL;
   delete message_handler_;
   message_handler_ = NULL;  // Fail fast if we send messages to a dead isolate.
   ASSERT(deopt_context_ == NULL);  // No deopt in progress when isolate deleted.
@@ -913,7 +906,7 @@
   Isolate* result = new Isolate(api_flags);
   ASSERT(result != NULL);
 
-  // Initialize metrics.
+// Initialize metrics.
 #define ISOLATE_METRIC_INIT(type, variable, name, unit)                        \
   result->metric_##variable##_.Init(result, name, NULL, Metric::unit);
   ISOLATE_METRIC_LIST(ISOLATE_METRIC_INIT);
@@ -962,8 +955,10 @@
   }
   if (FLAG_trace_isolates) {
     if (name_prefix == NULL || strcmp(name_prefix, "vm-isolate") != 0) {
-      OS::Print("[+] Starting isolate:\n"
-                "\tisolate:    %s\n", result->name());
+      OS::Print(
+          "[+] Starting isolate:\n"
+          "\tisolate:    %s\n",
+          result->name());
     }
   }
 
@@ -999,7 +994,7 @@
     OS::Print("Precompiled instructions are at [0x%" Px ", 0x%" Px ")\n",
               reinterpret_cast<uword>(snapshot.instructions_start()),
               reinterpret_cast<uword>(snapshot.instructions_start()) +
-              snapshot.instructions_size());
+                  snapshot.instructions_size());
   }
 #endif
   heap_->SetupExternalPage(snapshot.instructions_start(),
@@ -1012,14 +1007,13 @@
   DataSnapshot snapshot(data_snapshot_buffer);
 #if defined(DEBUG)
   if (FLAG_trace_isolates) {
-    OS::Print("Precompiled rodata are at [0x%" Px ", 0x%" Px ")\n",
-              reinterpret_cast<uword>(snapshot.data_start()),
-              reinterpret_cast<uword>(snapshot.data_start()) +
-              snapshot.data_size());
+    OS::Print(
+        "Precompiled rodata are at [0x%" Px ", 0x%" Px ")\n",
+        reinterpret_cast<uword>(snapshot.data_start()),
+        reinterpret_cast<uword>(snapshot.data_start()) + snapshot.data_size());
   }
 #endif
-  heap_->SetupExternalPage(snapshot.data_start(),
-                           snapshot.data_size(),
+  heap_->SetupExternalPage(snapshot.data_start(), snapshot.data_size(),
                            /* is_executable = */ false);
 }
 
@@ -1041,6 +1035,26 @@
 }
 
 
+bool Isolate::IsPaused() const {
+  return (debugger_ != NULL) && (debugger_->PauseEvent() != NULL);
+}
+
+
+void Isolate::PausePostRequest() {
+  if (!FLAG_support_debugger) {
+    return;
+  }
+  if (debugger_ == NULL) {
+    return;
+  }
+  ASSERT(!IsPaused());
+  const Error& error = Error::Handle(debugger_->PausePostRequest());
+  if (!error.IsNull()) {
+    Exceptions::PropagateError(error);
+  }
+}
+
+
 void Isolate::BuildName(const char* name_prefix) {
   ASSERT(name_ == NULL);
   if (name_prefix == NULL) {
@@ -1056,8 +1070,8 @@
 
 
 void Isolate::DoneLoading() {
-  GrowableObjectArray& libs = GrowableObjectArray::Handle(current_zone(),
-      object_store()->libraries());
+  GrowableObjectArray& libs =
+      GrowableObjectArray::Handle(current_zone(), object_store()->libraries());
   Library& lib = Library::Handle(current_zone());
   intptr_t num_libs = libs.Length();
   for (intptr_t i = 0; i < num_libs; i++) {
@@ -1075,8 +1089,8 @@
 
 bool Isolate::CanReload() const {
 #ifndef PRODUCT
-  return !ServiceIsolate::IsServiceIsolateDescendant(this) &&
-         is_runnable() && !IsReloading() &&
+  return !ServiceIsolate::IsServiceIsolateDescendant(this) && is_runnable() &&
+         !IsReloading() &&
          (AtomicOperations::LoadRelaxed(&no_reload_scope_depth_) == 0) &&
          IsolateCreationEnabled();
 #else
@@ -1088,25 +1102,17 @@
 #ifndef PRODUCT
 bool Isolate::ReloadSources(JSONStream* js,
                             bool force_reload,
+                            const char* root_script_url,
+                            const char* packages_url,
                             bool dont_delete_reload_context) {
   ASSERT(!IsReloading());
   has_attempted_reload_ = true;
   reload_context_ = new IsolateReloadContext(this, js);
-  reload_context_->Reload(force_reload);
+  reload_context_->Reload(force_reload, root_script_url, packages_url);
   bool success = !reload_context_->reload_aborted();
   if (!dont_delete_reload_context) {
     DeleteReloadContext();
   }
-#if defined(DEBUG)
-  if (success) {
-    return success;
-    Thread* thread = Thread::Current();
-    Isolate* isolate = thread->isolate();
-    isolate->heap()->CollectAllGarbage();
-    VerifyCanonicalVisitor check_canonical(thread);
-    isolate->heap()->IterateObjects(&check_canonical);
-  }
-#endif  // DEBUG
   return success;
 }
 
@@ -1123,15 +1129,14 @@
 
 
 void Isolate::DoneFinalizing() {
-  NOT_IN_PRODUCT(
-    if (IsReloading()) {
-      reload_context_->FinalizeLoading();
-    }
-  )
+#if !defined(PRODUCT)
+  if (IsReloading()) {
+    reload_context_->FinalizeLoading();
+  }
+#endif  // !defined(PRODUCT)
 }
 
 
-
 bool Isolate::MakeRunnable() {
   ASSERT(Isolate::Current() == NULL);
 
@@ -1176,16 +1181,14 @@
 
 
 bool Isolate::VerifyPauseCapability(const Object& capability) const {
-  return !capability.IsNull() &&
-      capability.IsCapability() &&
-      (pause_capability() == Capability::Cast(capability).Id());
+  return !capability.IsNull() && capability.IsCapability() &&
+         (pause_capability() == Capability::Cast(capability).Id());
 }
 
 
 bool Isolate::VerifyTerminateCapability(const Object& capability) const {
-  return !capability.IsNull() &&
-      capability.IsCapability() &&
-      (terminate_capability() == Capability::Cast(capability).Id());
+  return !capability.IsNull() && capability.IsCapability() &&
+         (terminate_capability() == Capability::Cast(capability).Id());
 }
 
 
@@ -1224,7 +1227,7 @@
 
 bool Isolate::RemoveResumeCapability(const Capability& capability) {
   const GrowableObjectArray& caps = GrowableObjectArray::Handle(
-       current_zone(), object_store()->resume_capabilities());
+      current_zone(), object_store()->resume_capabilities());
   Capability& current = Capability::Handle(current_zone());
   for (intptr_t i = 0; i < caps.Length(); i++) {
     current ^= caps.At(i);
@@ -1247,7 +1250,7 @@
   static const intptr_t kMaxListeners = kSmiMax / (12 * kWordSize);
 
   const GrowableObjectArray& listeners = GrowableObjectArray::Handle(
-       current_zone(), object_store()->exit_listeners());
+      current_zone(), object_store()->exit_listeners());
   SendPort& current = SendPort::Handle(current_zone());
   intptr_t insertion_index = -1;
   for (intptr_t i = 0; i < listeners.Length(); i += 2) {
@@ -1414,7 +1417,7 @@
 
 
     if (!ClassFinalizer::ProcessPendingClasses()) {
-      // Error is in sticky error already.
+// Error is in sticky error already.
 #if defined(DEBUG)
       const Error& error = Error::Handle(thread->sticky_error());
       ASSERT(!error.IsUnwindError());
@@ -1469,8 +1472,8 @@
     args.SetAt(2, Instance::Handle(state->BuildArgs(thread)));
     args.SetAt(3, Instance::Handle(state->BuildMessage(thread)));
     args.SetAt(4, is_spawn_uri ? Bool::True() : Bool::False());
-    args.SetAt(5, ReceivePort::Handle(
-        ReceivePort::New(isolate->main_port(), true /* control port */)));
+    args.SetAt(5, ReceivePort::Handle(ReceivePort::New(
+                      isolate->main_port(), true /* control port */)));
     args.SetAt(6, capabilities);
 
     const Library& lib = Library::Handle(Library::IsolateLibrary());
@@ -1501,7 +1504,7 @@
     ASSERT(thread->isolate() == isolate);
     StackZone zone(thread);
     HandleScope handle_scope(thread);
-    // TODO(27003): Enable for precompiled.
+// TODO(27003): Enable for precompiled.
 #if defined(DEBUG) && !defined(DART_PRECOMPILED_RUNTIME)
     if (!isolate->HasAttemptedReload()) {
       // For this verification we need to stop the background compiler earlier.
@@ -1524,17 +1527,15 @@
 
 
 void Isolate::SetStickyError(RawError* sticky_error) {
-  ASSERT(((sticky_error_ == Error::null()) ||
-         (sticky_error == Error::null())) &&
-         (sticky_error != sticky_error_));
+  ASSERT(
+      ((sticky_error_ == Error::null()) || (sticky_error == Error::null())) &&
+      (sticky_error != sticky_error_));
   sticky_error_ = sticky_error;
 }
 
 
 void Isolate::Run() {
-  message_handler()->Run(Dart::thread_pool(),
-                         RunIsolate,
-                         ShutdownIsolate,
+  message_handler()->Run(Dart::thread_pool(), RunIsolate, ShutdownIsolate,
                          reinterpret_cast<uword>(this));
 }
 
@@ -1598,8 +1599,7 @@
 
 class FinalizeWeakPersistentHandlesVisitor : public HandleVisitor {
  public:
-  FinalizeWeakPersistentHandlesVisitor() : HandleVisitor(Thread::Current()) {
-  }
+  FinalizeWeakPersistentHandlesVisitor() : HandleVisitor(Thread::Current()) {}
 
   void VisitHandle(uword addr) {
     FinalizablePersistentHandle* handle =
@@ -1624,8 +1624,7 @@
   // Notify exit listeners that this isolate is shutting down.
   if (object_store() != NULL) {
     const Error& error = Error::Handle(thread->sticky_error());
-    if (error.IsNull() ||
-        !error.IsUnwindError() ||
+    if (error.IsNull() || !error.IsUnwindError() ||
         UnwindError::Cast(error).is_user_initiated()) {
       NotifyExitListeners();
     }
@@ -1649,7 +1648,7 @@
     Timeline::ReclaimCachedBlocksFromThreads();
   }
 
-  // Dump all timing data for the isolate.
+// Dump all timing data for the isolate.
 #ifndef PRODUCT
   if (FLAG_support_timeline && FLAG_timing) {
     TimelinePauseTrace tpt;
@@ -1667,8 +1666,10 @@
   if (FLAG_trace_isolates) {
     heap()->PrintSizes();
     Symbols::DumpStats();
-    OS::Print("[-] Stopping isolate:\n"
-              "\tisolate:    %s\n", name());
+    OS::Print(
+        "[-] Stopping isolate:\n"
+        "\tisolate:    %s\n",
+        name());
   }
   if (FLAG_print_metrics) {
     LogBlock lb;
@@ -1729,9 +1730,9 @@
     HandleScope handle_scope(thread);
 
     // Write compiler stats data if enabled.
-    if (FLAG_support_compiler_stats && FLAG_compiler_stats
-        && !ServiceIsolate::IsServiceIsolateDescendant(this)
-        && (this != Dart::vm_isolate())) {
+    if (FLAG_support_compiler_stats && FLAG_compiler_stats &&
+        !ServiceIsolate::IsServiceIsolateDescendant(this) &&
+        (this != Dart::vm_isolate())) {
       OS::Print("%s", aggregate_compiler_stats()->PrintToZone());
     }
   }
@@ -1750,12 +1751,12 @@
     }
   }
 
-  if (FLAG_check_reloaded && is_runnable() &&
-      (this != Dart::vm_isolate()) &&
+  if (FLAG_check_reloaded && is_runnable() && (this != Dart::vm_isolate()) &&
       !ServiceIsolate::IsServiceIsolateDescendant(this)) {
     if (!HasAttemptedReload()) {
-      FATAL("Isolate did not reload before exiting and "
-            "--check-reloaded is enabled.\n");
+      FATAL(
+          "Isolate did not reload before exiting and "
+          "--check-reloaded is enabled.\n");
     }
   }
 
@@ -1791,6 +1792,13 @@
 }
 
 
+void Isolate::IterateStackPointers(ObjectPointerVisitor* visitor,
+                                   bool validate_frames) {
+  HeapIterationScope heap_iteration_scope;
+  VisitStackPointers(visitor, validate_frames);
+}
+
+
 void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor,
                                   bool validate_frames) {
   ASSERT(visitor != NULL);
@@ -1826,8 +1834,7 @@
   visitor->VisitPointer(
       reinterpret_cast<RawObject**>(&deoptimized_code_array_));
 
-  visitor->VisitPointer(
-        reinterpret_cast<RawObject**>(&sticky_error_));
+  visitor->VisitPointer(reinterpret_cast<RawObject**>(&sticky_error_));
 
   // Visit the pending service extension calls.
   visitor->VisitPointer(
@@ -1848,21 +1855,27 @@
     debugger()->VisitObjectPointers(visitor);
   }
 
-  NOT_IN_PRODUCT(
-    // Visit objects that are being used for isolate reload.
-    if (reload_context() != NULL) {
-      reload_context()->VisitObjectPointers(visitor);
-    }
-    if (ServiceIsolate::IsServiceIsolate(this)) {
-      ServiceIsolate::VisitObjectPointers(visitor);
-    }
-  )
+#if !defined(PRODUCT)
+  // Visit objects that are being used for isolate reload.
+  if (reload_context() != NULL) {
+    reload_context()->VisitObjectPointers(visitor);
+  }
+  if (ServiceIsolate::IsServiceIsolate(this)) {
+    ServiceIsolate::VisitObjectPointers(visitor);
+  }
+#endif  // !defined(PRODUCT)
 
   // Visit objects that are being used for deoptimization.
   if (deopt_context() != NULL) {
     deopt_context()->VisitObjectPointers(visitor);
   }
 
+  VisitStackPointers(visitor, validate_frames);
+}
+
+
+void Isolate::VisitStackPointers(ObjectPointerVisitor* visitor,
+                                 bool validate_frames) {
   // Visit objects in all threads (e.g., Dart stack, handles in zones).
   thread_registry()->VisitObjectPointers(visitor, validate_frames);
 }
@@ -1900,6 +1913,45 @@
 }
 
 
+void Isolate::AddPendingDeopt(uword fp, uword pc) {
+  // GrowableArray::Add is not atomic and may be interrupt by a profiler
+  // stack walk.
+  MallocGrowableArray<PendingLazyDeopt>* old_pending_deopts = pending_deopts_;
+  MallocGrowableArray<PendingLazyDeopt>* new_pending_deopts =
+      new MallocGrowableArray<PendingLazyDeopt>(old_pending_deopts->length() +
+                                                1);
+  for (intptr_t i = 0; i < old_pending_deopts->length(); i++) {
+    ASSERT((*old_pending_deopts)[i].fp() != fp);
+    new_pending_deopts->Add((*old_pending_deopts)[i]);
+  }
+  PendingLazyDeopt deopt(fp, pc);
+  new_pending_deopts->Add(deopt);
+
+  pending_deopts_ = new_pending_deopts;
+  delete old_pending_deopts;
+}
+
+
+uword Isolate::FindPendingDeopt(uword fp) const {
+  for (intptr_t i = 0; i < pending_deopts_->length(); i++) {
+    if ((*pending_deopts_)[i].fp() == fp) {
+      return (*pending_deopts_)[i].pc();
+    }
+  }
+  FATAL("Missing pending deopt entry");
+  return 0;
+}
+
+
+void Isolate::ClearPendingDeoptsAtOrBelow(uword fp) const {
+  for (intptr_t i = pending_deopts_->length() - 1; i >= 0; i--) {
+    if ((*pending_deopts_)[i].fp() <= fp) {
+      pending_deopts_->RemoveAt(i);
+    }
+  }
+}
+
+
 #ifndef PRODUCT
 static const char* ExceptionPauseInfoToServiceEnum(Dart_ExceptionPauseInfo pi) {
   switch (pi) {
@@ -1922,12 +1974,11 @@
   }
   JSONObject jsobj(stream);
   jsobj.AddProperty("type", (ref ? "@Isolate" : "Isolate"));
-  jsobj.AddFixedServiceId("isolates/%" Pd64 "",
+  jsobj.AddFixedServiceId(ISOLATE_SERVICE_ID_FORMAT_STRING,
                           static_cast<int64_t>(main_port()));
 
   jsobj.AddProperty("name", debugger_name());
-  jsobj.AddPropertyF("number", "%" Pd64 "",
-                     static_cast<int64_t>(main_port()));
+  jsobj.AddPropertyF("number", "%" Pd64 "", static_cast<int64_t>(main_port()));
   if (ref) {
     return;
   }
@@ -1956,12 +2007,11 @@
     ASSERT((debugger() == NULL) || (debugger()->PauseEvent() == NULL));
     ServiceEvent pause_event(this, ServiceEvent::kPauseStart);
     jsobj.AddProperty("pauseEvent", &pause_event);
-  } else if (message_handler()->is_paused_on_exit()) {
-    ASSERT((debugger() == NULL) || (debugger()->PauseEvent() == NULL));
+  } else if (message_handler()->is_paused_on_exit() &&
+             ((debugger() == NULL) || (debugger()->PauseEvent() == NULL))) {
     ServiceEvent pause_event(this, ServiceEvent::kPauseExit);
     jsobj.AddProperty("pauseEvent", &pause_event);
-  } else if ((debugger() != NULL) &&
-             (debugger()->PauseEvent() != NULL) &&
+  } else if ((debugger() != NULL) && (debugger()->PauseEvent() != NULL) &&
              !resume_request_) {
     jsobj.AddProperty("pauseEvent", debugger()->PauseEvent());
   } else {
@@ -1977,8 +2027,7 @@
     jsobj.AddProperty("pauseEvent", &pause_event);
   }
 
-  const Library& lib =
-      Library::Handle(object_store()->root_library());
+  const Library& lib = Library::Handle(object_store()->root_library());
   if (!lib.IsNull()) {
     jsobj.AddProperty("rootLib", lib);
   }
@@ -2019,8 +2068,8 @@
   }
 
   Dart_ExceptionPauseInfo pause_info = (debugger() != NULL)
-      ? debugger()->GetExceptionPauseInfo()
-      : kNoPauseOnExceptions;
+                                           ? debugger()->GetExceptionPauseInfo()
+                                           : kNoPauseOnExceptions;
   jsobj.AddProperty("exceptionPauseMode",
                     ExceptionPauseInfoToServiceEnum(pause_info));
 
@@ -2093,7 +2142,7 @@
 
 
 void Isolate::set_pending_service_extension_calls(
-      const GrowableObjectArray& value) {
+    const GrowableObjectArray& value) {
   pending_service_extension_calls_ = value.raw();
 }
 
@@ -2121,7 +2170,7 @@
 
 RawField* Isolate::GetDeoptimizingBoxedField() {
   ASSERT(Thread::Current()->IsMutatorThread());
-  MutexLocker ml(field_list_mutex_);
+  SafepointMutexLocker ml(field_list_mutex_);
   if (boxed_field_list_ == GrowableObjectArray::null()) {
     return Field::null();
   }
@@ -2182,27 +2231,21 @@
     arguments.SetAt(kPendingEntrySize, Bool::Get(FLAG_trace_service));
 
     if (FLAG_trace_service) {
-      OS::Print(
-          "[+%" Pd64 "ms] Isolate %s invoking _runExtension for %s\n",
-          Dart::timestamp(), name(), method_name.ToCString());
+      OS::Print("[+%" Pd64 "ms] Isolate %s invoking _runExtension for %s\n",
+                Dart::timestamp(), name(), method_name.ToCString());
     }
     result = DartEntry::InvokeFunction(run_extension, arguments);
     if (FLAG_trace_service) {
-      OS::Print(
-          "[+%" Pd64 "ms] Isolate %s : _runExtension complete for %s\n",
-          Dart::timestamp(), name(), method_name.ToCString());
+      OS::Print("[+%" Pd64 "ms] Isolate %s : _runExtension complete for %s\n",
+                Dart::timestamp(), name(), method_name.ToCString());
     }
     // Propagate the error.
     if (result.IsError()) {
       // Remaining service extension calls are dropped.
       if (!result.IsUnwindError()) {
         // Send error back over the protocol.
-        Service::PostError(method_name,
-                           parameter_keys,
-                           parameter_values,
-                           reply_port,
-                           id,
-                           Error::Cast(result));
+        Service::PostError(method_name, parameter_keys, parameter_values,
+                           reply_port, id, Error::Cast(result));
       }
       return result.raw();
     }
@@ -2232,9 +2275,8 @@
                                          const Instance& reply_port,
                                          const Instance& id) {
   if (FLAG_trace_service) {
-    OS::Print(
-        "[+%" Pd64 "ms] Isolate %s ENQUEUING request for extension %s\n",
-        Dart::timestamp(), name(), method_name.ToCString());
+    OS::Print("[+%" Pd64 "ms] Isolate %s ENQUEUING request for extension %s\n",
+              Dart::timestamp(), name(), method_name.ToCString());
   }
   GrowableObjectArray& calls =
       GrowableObjectArray::Handle(pending_service_extension_calls());
@@ -2339,8 +2381,7 @@
   Dart_EnterScope();
   MonitorLocker ml(pause_loop_monitor_);
 
-  Dart_MessageNotifyCallback saved_notify_callback =
-      message_notify_callback();
+  Dart_MessageNotifyCallback saved_notify_callback = message_notify_callback();
   set_message_notify_callback(Isolate::WakePauseEventHandler);
 
   const bool had_isolate_reload_context = reload_context() != NULL;
@@ -2363,8 +2404,7 @@
       if (FLAG_trace_reload) {
         const int64_t reload_time_micros =
             OS::GetCurrentMonotonicMicros() - start_time_micros;
-        double reload_millis =
-            MicrosecondsToMilliseconds(reload_time_micros);
+        double reload_millis = MicrosecondsToMilliseconds(reload_time_micros);
         OS::Print("Reloading has finished! (%.2f ms)\n", reload_millis);
       }
       break;
@@ -2500,10 +2540,8 @@
     ASSERT(success);
 
     // Post the message at the given port.
-    success = PortMap::PostMessage(new Message(main_port(),
-                                               buffer,
-                                               writer.BytesWritten(),
-                                               Message::kOOBPriority));
+    success = PortMap::PostMessage(new Message(
+        main_port(), buffer, writer.BytesWritten(), Message::kOOBPriority));
     ASSERT(success);
   }
 }
@@ -2741,9 +2779,7 @@
     class_name_ = NewConstChar(class_name.ToCString());
   }
   bool can_send_any_object = true;
-  SerializeObject(message,
-                  &serialized_message_,
-                  &serialized_message_len_,
+  SerializeObject(message, &serialized_message_, &serialized_message_len_,
                   can_send_any_object);
   // Inherit flags from spawning isolate.
   Isolate::Current()->FlagsCopyTo(isolate_flags());
@@ -2786,13 +2822,9 @@
       errors_are_fatal_(errors_are_fatal) {
   function_name_ = NewConstChar("main");
   bool can_send_any_object = false;
-  SerializeObject(args,
-                  &serialized_args_,
-                  &serialized_args_len_,
+  SerializeObject(args, &serialized_args_, &serialized_args_len_,
                   can_send_any_object);
-  SerializeObject(message,
-                  &serialized_message_,
-                  &serialized_message_len_,
+  SerializeObject(message, &serialized_message_, &serialized_message_len_,
                   can_send_any_object);
   // By default inherit flags from spawning isolate. These can be overridden
   // from the calling code.
@@ -2821,8 +2853,8 @@
   if (library_url() == NULL) {
     // Handle spawnUri lookup rules.
     // Check whether the root library defines a main function.
-    const Library& lib = Library::Handle(zone,
-                                         I->object_store()->root_library());
+    const Library& lib =
+        Library::Handle(zone, I->object_store()->root_library());
     Function& func = Function::Handle(zone, lib.LookupLocalFunction(func_name));
     if (func.IsNull()) {
       // Check whether main is reexported from the root library.
@@ -2832,9 +2864,10 @@
       }
     }
     if (func.IsNull()) {
-      const String& msg = String::Handle(zone, String::NewFormatted(
-          "Unable to resolve function '%s' in script '%s'.",
-          function_name(), script_url()));
+      const String& msg = String::Handle(
+          zone, String::NewFormatted(
+                    "Unable to resolve function '%s' in script '%s'.",
+                    function_name(), script_url()));
       return LanguageError::New(msg);
     }
     return func.raw();
@@ -2843,22 +2876,24 @@
   // Lookup the to be spawned function for the Isolate.spawn implementation.
   // Resolve the library.
   const String& lib_url = String::Handle(zone, String::New(library_url()));
-  const Library& lib = Library::Handle(zone,
-                                       Library::LookupLibrary(thread, lib_url));
+  const Library& lib =
+      Library::Handle(zone, Library::LookupLibrary(thread, lib_url));
   if (lib.IsNull() || lib.IsError()) {
-    const String& msg = String::Handle(zone, String::NewFormatted(
-        "Unable to find library '%s'.", library_url()));
+    const String& msg = String::Handle(
+        zone,
+        String::NewFormatted("Unable to find library '%s'.", library_url()));
     return LanguageError::New(msg);
   }
 
   // Resolve the function.
   if (class_name() == NULL) {
-    const Function& func = Function::Handle(zone,
-                                            lib.LookupLocalFunction(func_name));
+    const Function& func =
+        Function::Handle(zone, lib.LookupLocalFunction(func_name));
     if (func.IsNull()) {
-      const String& msg = String::Handle(zone, String::NewFormatted(
-          "Unable to resolve function '%s' in library '%s'.",
-          function_name(), library_url()));
+      const String& msg = String::Handle(
+          zone, String::NewFormatted(
+                    "Unable to resolve function '%s' in library '%s'.",
+                    function_name(), library_url()));
       return LanguageError::New(msg);
     }
     return func.raw();
@@ -2867,19 +2902,20 @@
   const String& cls_name = String::Handle(zone, String::New(class_name()));
   const Class& cls = Class::Handle(zone, lib.LookupLocalClass(cls_name));
   if (cls.IsNull()) {
-    const String& msg = String::Handle(zone, String::NewFormatted(
-          "Unable to resolve class '%s' in library '%s'.",
-          class_name(),
-          (library_url() != NULL ? library_url() : script_url())));
+    const String& msg = String::Handle(
+        zone, String::NewFormatted(
+                  "Unable to resolve class '%s' in library '%s'.", class_name(),
+                  (library_url() != NULL ? library_url() : script_url())));
     return LanguageError::New(msg);
   }
   const Function& func =
       Function::Handle(zone, cls.LookupStaticFunctionAllowPrivate(func_name));
   if (func.IsNull()) {
-    const String& msg = String::Handle(zone, String::NewFormatted(
-          "Unable to resolve static method '%s.%s' in library '%s'.",
-          class_name(), function_name(),
-          (library_url() != NULL ? library_url() : script_url())));
+    const String& msg = String::Handle(
+        zone, String::NewFormatted(
+                  "Unable to resolve static method '%s.%s' in library '%s'.",
+                  class_name(), function_name(),
+                  (library_url() != NULL ? library_url() : script_url())));
     return LanguageError::New(msg);
   }
   return func.raw();
@@ -2892,8 +2928,8 @@
 
 
 RawInstance* IsolateSpawnState::BuildMessage(Thread* thread) {
-  return DeserializeObject(thread,
-                           serialized_message_, serialized_message_len_);
+  return DeserializeObject(thread, serialized_message_,
+                           serialized_message_len_);
 }
 
 
diff --git a/runtime/vm/isolate.h b/runtime/vm/isolate.h
index 12dd5fa..9fa4361 100644
--- a/runtime/vm/isolate.h
+++ b/runtime/vm/isolate.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_ISOLATE_H_
-#define VM_ISOLATE_H_
+#ifndef RUNTIME_VM_ISOLATE_H_
+#define RUNTIME_VM_ISOLATE_H_
 
 #include "include/dart_api.h"
 #include "platform/assert.h"
@@ -19,6 +19,7 @@
 #include "vm/os_thread.h"
 #include "vm/timer.h"
 #include "vm/token_position.h"
+#include "vm/growable_array.h"
 
 namespace dart {
 
@@ -70,6 +71,19 @@
 class UserTag;
 
 
+class PendingLazyDeopt {
+ public:
+  PendingLazyDeopt(uword fp, uword pc) : fp_(fp), pc_(pc) {}
+  uword fp() { return fp_; }
+  uword pc() { return pc_; }
+  void set_pc(uword pc) { pc_ = pc; }
+
+ private:
+  uword fp_;
+  uword pc_;
+};
+
+
 class IsolateVisitor {
  public:
   IsolateVisitor() {}
@@ -87,6 +101,7 @@
  public:
   explicit NoOOBMessageScope(Thread* thread);
   ~NoOOBMessageScope();
+
  private:
   DISALLOW_COPY_AND_ASSIGN(NoOOBMessageScope);
 };
@@ -146,6 +161,8 @@
   // Visit all object pointers.
   void IterateObjectPointers(ObjectPointerVisitor* visitor,
                              bool validate_frames);
+  void IterateStackPointers(ObjectPointerVisitor* visitor,
+                            bool validate_frames);
 
   // Visits weak object pointers.
   void VisitWeakPersistentHandles(HandleVisitor* visitor);
@@ -192,8 +209,7 @@
   }
   Dart_Port origin_id() const { return origin_id_; }
   void set_origin_id(Dart_Port id) {
-    ASSERT((id == main_port_ && origin_id_ == 0) ||
-           (origin_id_ == main_port_));
+    ASSERT((id == main_port_ && origin_id_ == 0) || (origin_id_ == main_port_));
     origin_id_ = id;
   }
   void set_pause_capability(uint64_t value) { pause_capability_ = value; }
@@ -207,20 +223,18 @@
 
   Heap* heap() const { return heap_; }
   void set_heap(Heap* value) { heap_ = value; }
-  static intptr_t heap_offset() { return OFFSET_OF(Isolate, heap_); }
 
   ObjectStore* object_store() const { return object_store_; }
   void set_object_store(ObjectStore* value) { object_store_ = value; }
+  static intptr_t object_store_offset() {
+    return OFFSET_OF(Isolate, object_store_);
+  }
 
   ApiState* api_state() const { return api_state_; }
   void set_api_state(ApiState* value) { api_state_ = value; }
 
-  void set_init_callback_data(void* value) {
-    init_callback_data_ = value;
-  }
-  void* init_callback_data() const {
-    return init_callback_data_;
-  }
+  void set_init_callback_data(void* value) { init_callback_data_ = value; }
+  void* init_callback_data() const { return init_callback_data_; }
 
   Dart_EnvironmentCallback environment_callback() const {
     return environment_callback_;
@@ -238,8 +252,7 @@
 
   void SetupInstructionsSnapshotPage(
       const uint8_t* instructions_snapshot_buffer);
-  void SetupDataSnapshotPage(
-      const uint8_t* instructions_snapshot_buffer);
+  void SetupDataSnapshotPage(const uint8_t* instructions_snapshot_buffer);
 
   void ScheduleMessageInterrupts();
 
@@ -251,6 +264,8 @@
   // the caller to delete is separately if it is still needed.
   bool ReloadSources(JSONStream* js,
                      bool force_reload,
+                     const char* root_script_url = NULL,
+                     const char* packages_url = NULL,
                      bool dont_delete_reload_context = false);
 
   bool MakeRunnable();
@@ -278,9 +293,7 @@
   Mutex* constant_canonicalization_mutex() const {
     return constant_canonicalization_mutex_;
   }
-  Mutex* megamorphic_lookup_mutex() const {
-    return megamorphic_lookup_mutex_;
-  }
+  Mutex* megamorphic_lookup_mutex() const { return megamorphic_lookup_mutex_; }
 
   Debugger* debugger() const {
     if (!FLAG_support_debugger) {
@@ -309,9 +322,7 @@
     last_resume_timestamp_ = OS::GetCurrentTimeMillis();
   }
 
-  int64_t last_resume_timestamp() const {
-    return last_resume_timestamp_;
-  }
+  int64_t last_resume_timestamp() const { return last_resume_timestamp_; }
 
   // Returns whether the vm service has requested that the debugger
   // resume execution.
@@ -383,13 +394,15 @@
     return shutdown_callback_;
   }
 
-  void set_object_id_ring(ObjectIdRing* ring) {
-    object_id_ring_ = ring;
-  }
-  ObjectIdRing* object_id_ring() {
-    return object_id_ring_;
-  }
+  void set_object_id_ring(ObjectIdRing* ring) { object_id_ring_ = ring; }
+  ObjectIdRing* object_id_ring() { return object_id_ring_; }
 
+  void AddPendingDeopt(uword fp, uword pc);
+  uword FindPendingDeopt(uword fp) const;
+  void ClearPendingDeoptsAtOrBelow(uword fp) const;
+  MallocGrowableArray<PendingLazyDeopt>* pending_deopts() const {
+    return pending_deopts_;
+  }
   bool IsDeoptimizing() const { return deopt_context_ != NULL; }
   DeoptContext* deopt_context() const { return deopt_context_; }
   void set_deopt_context(DeoptContext* value) {
@@ -409,14 +422,13 @@
   void enable_background_compiler() {
     background_compiler_disabled_depth_--;
     if (background_compiler_disabled_depth_ < 0) {
-      FATAL("Mismatched number of calls to disable_background_compiler and "
-            "enable_background_compiler.");
+      FATAL(
+          "Mismatched number of calls to disable_background_compiler and "
+          "enable_background_compiler.");
     }
   }
 
-  void disable_background_compiler() {
-    background_compiler_disabled_depth_++;
-  }
+  void disable_background_compiler() { background_compiler_disabled_depth_++; }
 
   bool is_background_compiler_disabled() const {
     return background_compiler_disabled_depth_ > 0;
@@ -463,39 +475,37 @@
     return mutator_thread()->compiler_stats();
   }
 
-  VMTagCounters* vm_tag_counters() {
-    return &vm_tag_counters_;
-  }
+  VMTagCounters* vm_tag_counters() { return &vm_tag_counters_; }
 
-  bool IsReloading() const {
-    return reload_context_ != NULL;
-  }
+  bool IsReloading() const { return reload_context_ != NULL; }
 
-  IsolateReloadContext* reload_context() {
-    return reload_context_;
-  }
+  IsolateReloadContext* reload_context() { return reload_context_; }
 
   void DeleteReloadContext();
 
-  bool HasAttemptedReload() const {
-    return has_attempted_reload_;
-  }
+  bool HasAttemptedReload() const { return has_attempted_reload_; }
 
   bool CanReload() const;
 
   void set_last_reload_timestamp(int64_t value) {
     last_reload_timestamp_ = value;
   }
-  int64_t last_reload_timestamp() const {
-    return last_reload_timestamp_;
+  int64_t last_reload_timestamp() const { return last_reload_timestamp_; }
+
+  bool IsPaused() const;
+
+  bool should_pause_post_service_request() const {
+    return should_pause_post_service_request_;
+  }
+  void set_should_pause_post_service_request(
+      bool should_pause_post_service_request) {
+    should_pause_post_service_request_ = should_pause_post_service_request;
   }
 
-  uword user_tag() const {
-    return user_tag_;
-  }
-  static intptr_t user_tag_offset() {
-    return OFFSET_OF(Isolate, user_tag_);
-  }
+  void PausePostRequest();
+
+  uword user_tag() const { return user_tag_; }
+  static intptr_t user_tag_offset() { return OFFSET_OF(Isolate, user_tag_); }
   static intptr_t current_tag_offset() {
     return OFFSET_OF(Isolate, current_tag_);
   }
@@ -521,13 +531,9 @@
 
   void set_ic_miss_code(const Code& code);
 
-  Metric* metrics_list_head() {
-    return metrics_list_head_;
-  }
+  Metric* metrics_list_head() { return metrics_list_head_; }
 
-  void set_metrics_list_head(Metric* metric) {
-    metrics_list_head_ = metric;
-  }
+  void set_metrics_list_head(Metric* metric) { metrics_list_head_ = metric; }
 
   RawGrowableObjectArray* deoptimized_code_array() const {
     return deoptimized_code_array_;
@@ -542,15 +548,11 @@
   void clear_sticky_error();
 
   bool compilation_allowed() const { return compilation_allowed_; }
-  void set_compilation_allowed(bool allowed) {
-    compilation_allowed_ = allowed;
-  }
+  void set_compilation_allowed(bool allowed) { compilation_allowed_ = allowed; }
 
   // In precompilation we finalize all regular classes before compiling.
   bool all_classes_finalized() const { return all_classes_finalized_; }
-  void set_all_classes_finalized(bool value) {
-    all_classes_finalized_ = value;
-  }
+  void set_all_classes_finalized(bool value) { all_classes_finalized_ = value; }
 
   // True during top level parsing.
   bool IsTopLevelParsing() {
@@ -588,11 +590,11 @@
 #ifndef PRODUCT
   RawObject* InvokePendingServiceExtensionCalls();
   void AppendServiceExtensionCall(const Instance& closure,
-                           const String& method_name,
-                           const Array& parameter_keys,
-                           const Array& parameter_values,
-                           const Instance& reply_port,
-                           const Instance& id);
+                                  const String& method_name,
+                                  const Array& parameter_keys,
+                                  const Array& parameter_values,
+                                  const Instance& reply_port,
+                                  const Instance& id);
   void RegisterServiceExtensionHandler(const String& name,
                                        const Instance& closure);
   RawInstance* LookupServiceExtensionHandler(const String& name);
@@ -621,7 +623,7 @@
   bool asserts() const { return FLAG_enable_asserts; }
   bool error_on_bad_type() const { return FLAG_error_on_bad_type; }
   bool error_on_bad_override() const { return FLAG_error_on_bad_override; }
-#else  // defined(PRODUCT)
+#else   // defined(PRODUCT)
   bool type_checks() const { return type_checks_; }
   bool asserts() const { return asserts_; }
   bool error_on_bad_type() const { return error_on_bad_type_; }
@@ -644,7 +646,7 @@
   void MaybeIncreaseReloadEveryNStackOverflowChecks();
 
  private:
-  friend class Dart;  // Init, InitOnce, Shutdown.
+  friend class Dart;                  // Init, InitOnce, Shutdown.
   friend class IsolateKillerVisitor;  // Kill().
 
   explicit Isolate(const Dart_IsolateFlags& api_flags);
@@ -667,10 +669,9 @@
   // Visit all object pointers. Caller must ensure concurrent sweeper is not
   // running, and the visitor must not allocate.
   void VisitObjectPointers(ObjectPointerVisitor* visitor, bool validate_frames);
+  void VisitStackPointers(ObjectPointerVisitor* visitor, bool validate_frames);
 
-  void set_user_tag(uword tag) {
-    user_tag_ = tag;
-  }
+  void set_user_tag(uword tag) { user_tag_ = tag; }
 
   RawGrowableObjectArray* GetAndClearPendingServiceExtensionCalls();
   RawGrowableObjectArray* pending_service_extension_calls() const {
@@ -685,8 +686,9 @@
 
   Monitor* threads_lock() const;
   Thread* ScheduleThread(bool is_mutator, bool bypass_safepoint = false);
-  void UnscheduleThread(
-      Thread* thread, bool is_mutator, bool bypass_safepoint = false);
+  void UnscheduleThread(Thread* thread,
+                        bool is_mutator,
+                        bool bypass_safepoint = false);
 
   // DEPRECATED: Use Thread's methods instead. During migration, these default
   // to using the mutator thread (which must also be the current thread).
@@ -702,9 +704,9 @@
   RawUserTag* current_tag_;
   RawUserTag* default_tag_;
   RawCode* ic_miss_code_;
+  ObjectStore* object_store_;
   ClassTable class_table_;
   bool single_step_;
-  bool skip_step_;  // skip the next single step.
 
   ThreadRegistry* thread_registry_;
   SafepointHandler* safepoint_handler_;
@@ -717,8 +719,6 @@
   uint64_t pause_capability_;
   uint64_t terminate_capability_;
   bool errors_fatal_;
-  ObjectStore* object_store_;
-  uword top_exit_frame_info_;
   void* init_callback_data_;
   Dart_EnvironmentCallback environment_callback_;
   Dart_LibraryTagHandler library_tag_handler_;
@@ -729,9 +729,9 @@
   bool has_compiled_code_;  // Can check that no compilation occured.
   Random random_;
   Simulator* simulator_;
-  Mutex* mutex_;  // Protects compiler stats.
+  Mutex* mutex_;          // Protects compiler stats.
   Mutex* symbols_mutex_;  // Protects concurrent access to the symbol table.
-  Mutex* type_canonicalization_mutex_;  // Protects type canonicalization.
+  Mutex* type_canonicalization_mutex_;      // Protects type canonicalization.
   Mutex* constant_canonicalization_mutex_;  // Protects const canonicalization.
   Mutex* megamorphic_lookup_mutex_;  // Protects megamorphic table lookup.
   MessageHandler* message_handler_;
@@ -740,21 +740,18 @@
   Dart_GcPrologueCallback gc_prologue_callback_;
   Dart_GcEpilogueCallback gc_epilogue_callback_;
   intptr_t defer_finalization_count_;
+  MallocGrowableArray<PendingLazyDeopt>* pending_deopts_;
   DeoptContext* deopt_context_;
 
   bool is_service_isolate_;
 
-  // Isolate-specific flags.
-  NOT_IN_PRODUCT(
-    bool type_checks_;
-    bool asserts_;
-    bool error_on_bad_type_;
-    bool error_on_bad_override_;
-  )
-
-  // Status support.
-  char* stacktrace_;
-  intptr_t stack_frame_index_;
+// Isolate-specific flags.
+#if !defined(PRODUCT)
+  bool type_checks_;
+  bool asserts_;
+  bool error_on_bad_type_;
+  bool error_on_bad_override_;
+#endif  // !defined(PRODUCT)
 
   // Timestamps of last operation via service.
   int64_t last_allocationprofile_accumulator_reset_timestamp_;
@@ -821,6 +818,11 @@
   Monitor* spawn_count_monitor_;
   intptr_t spawn_count_;
 
+#define ISOLATE_METRIC_VARIABLE(type, variable, name, unit)                    \
+  type metric_##variable##_;
+  ISOLATE_METRIC_LIST(ISOLATE_METRIC_VARIABLE);
+#undef ISOLATE_METRIC_VARIABLE
+
   // Has a reload ever been attempted?
   bool has_attempted_reload_;
   intptr_t no_reload_scope_depth_;  // we can only reload when this is 0.
@@ -828,12 +830,8 @@
   intptr_t reload_every_n_stack_overflow_checks_;
   IsolateReloadContext* reload_context_;
   int64_t last_reload_timestamp_;
-
-#define ISOLATE_METRIC_VARIABLE(type, variable, name, unit)                    \
-  type metric_##variable##_;
-  ISOLATE_METRIC_LIST(ISOLATE_METRIC_VARIABLE);
-#undef ISOLATE_METRIC_VARIABLE
-
+  // Should we pause in the debug message loop after this request?
+  bool should_pause_post_service_request_;
 
   static Dart_IsolateCreateCallback create_callback_;
   static Dart_IsolateShutdownCallback shutdown_callback_;
@@ -851,10 +849,10 @@
 
 #define REUSABLE_FRIEND_DECLARATION(name)                                      \
   friend class Reusable##name##HandleScope;
-REUSABLE_HANDLE_LIST(REUSABLE_FRIEND_DECLARATION)
+  REUSABLE_HANDLE_LIST(REUSABLE_FRIEND_DECLARATION)
 #undef REUSABLE_FRIEND_DECLARATION
 
-  friend class Become;  // VisitObjectPointers
+  friend class Become;    // VisitObjectPointers
   friend class GCMarker;  // VisitObjectPointers
   friend class SafepointHandler;
   friend class Scavenger;  // VisitObjectPointers
@@ -996,4 +994,4 @@
 
 }  // namespace dart
 
-#endif  // VM_ISOLATE_H_
+#endif  // RUNTIME_VM_ISOLATE_H_
diff --git a/runtime/vm/isolate_reload.cc b/runtime/vm/isolate_reload.cc
index 2b00272..c375df3 100644
--- a/runtime/vm/isolate_reload.cc
+++ b/runtime/vm/isolate_reload.cc
@@ -25,16 +25,24 @@
 namespace dart {
 
 DEFINE_FLAG(bool, trace_reload, false, "Trace isolate reloading");
-DEFINE_FLAG(bool, trace_reload_verbose, false,
+DEFINE_FLAG(bool,
+            trace_reload_verbose,
+            false,
             "trace isolate reloading verbose");
 DEFINE_FLAG(bool, identity_reload, false, "Enable checks for identity reload.");
 DEFINE_FLAG(int, reload_every, 0, "Reload every N stack overflow checks.");
 DEFINE_FLAG(bool, reload_every_optimized, true, "Only from optimized code.");
-DEFINE_FLAG(bool, reload_every_back_off, false,
+DEFINE_FLAG(bool,
+            reload_every_back_off,
+            false,
             "Double the --reload-every value after each reload.");
-DEFINE_FLAG(bool, reload_force_rollback, false,
+DEFINE_FLAG(bool,
+            reload_force_rollback,
+            false,
             "Force all reloads to fail and rollback.");
-DEFINE_FLAG(bool, check_reloaded, false,
+DEFINE_FLAG(bool,
+            check_reloaded,
+            false,
             "Assert that an isolate has reloaded at least once.")
 #ifndef PRODUCT
 
@@ -42,20 +50,20 @@
 #define Z (thread->zone())
 
 #define TIMELINE_SCOPE(name)                                                   \
-    TimelineDurationScope tds##name(Thread::Current(),                         \
-                                   Timeline::GetIsolateStream(),               \
-                                   #name)
+  TimelineDurationScope tds##name(Thread::Current(),                           \
+                                  Timeline::GetIsolateStream(), #name)
 
 
 InstanceMorpher::InstanceMorpher(Zone* zone, const Class& from, const Class& to)
     : from_(Class::Handle(zone, from.raw())),
       to_(Class::Handle(zone, to.raw())),
       mapping_(zone, 0) {
-  ComputeMapping();
-  before_ = new(zone) ZoneGrowableArray<const Instance*>(zone, 0);
-  after_ = new(zone) ZoneGrowableArray<const Instance*>(zone, 0);
+  before_ = new (zone) ZoneGrowableArray<const Instance*>(zone, 0);
+  after_ = new (zone) ZoneGrowableArray<const Instance*>(zone, 0);
+  new_fields_ = new (zone) ZoneGrowableArray<const Field*>(zone, 0);
   ASSERT(from_.id() == to_.id());
   cid_ = from_.id();
+  ComputeMapping();
 }
 
 
@@ -79,27 +87,50 @@
 
   // Add copying of the instance fields if matching by name.
   // Note: currently the type of the fields are ignored.
-  const Array& from_fields = Array::Handle(from_.OffsetToFieldMap());
+  const Array& from_fields =
+      Array::Handle(from_.OffsetToFieldMap(true /* original classes */));
   const Array& to_fields = Array::Handle(to_.OffsetToFieldMap());
   Field& from_field = Field::Handle();
   Field& to_field = Field::Handle();
   String& from_name = String::Handle();
   String& to_name = String::Handle();
-  for (intptr_t i = 0; i < from_fields.Length(); i++) {
-    if (from_fields.At(i) == Field::null()) continue;  // Ignore non-fields.
-    from_field = Field::RawCast(from_fields.At(i));
-    ASSERT(from_field.is_instance());
-    from_name = from_field.name();
-    // We now have to find where this field is in the to class.
-    for (intptr_t j = 0; j < to_fields.Length(); j++) {
-      if (to_fields.At(j) == Field::null()) continue;  // Ignore non-fields.
-      to_field = Field::RawCast(to_fields.At(j));
-      ASSERT(to_field.is_instance());
-      to_name = to_field.name();
+
+  // Scan across all the fields in the new class definition.
+  for (intptr_t i = 0; i < to_fields.Length(); i++) {
+    if (to_fields.At(i) == Field::null()) {
+      continue;  // Ignore non-fields.
+    }
+
+    // Grab the field's name.
+    to_field = Field::RawCast(to_fields.At(i));
+    ASSERT(to_field.is_instance());
+    to_name = to_field.name();
+
+    // Did this field not exist in the old class definition?
+    bool new_field = true;
+
+    // Find this field in the old class.
+    for (intptr_t j = 0; j < from_fields.Length(); j++) {
+      if (from_fields.At(j) == Field::null()) {
+        continue;  // Ignore non-fields.
+      }
+      from_field = Field::RawCast(from_fields.At(j));
+      ASSERT(from_field.is_instance());
+      from_name = from_field.name();
       if (from_name.Equals(to_name)) {
         // Success
         mapping_.Add(from_field.Offset());
         mapping_.Add(to_field.Offset());
+        // Field did exist in old class deifnition.
+        new_field = false;
+      }
+    }
+
+    if (new_field) {
+      if (to_field.has_initializer()) {
+        // This is a new field with an initializer.
+        const Field& field = Field::Handle(to_field.raw());
+        new_fields_->Add(&field);
       }
     }
   }
@@ -109,9 +140,9 @@
 RawInstance* InstanceMorpher::Morph(const Instance& instance) const {
   const Instance& result = Instance::Handle(Instance::New(to_));
   // Morph the context from instance to result using mapping_.
-  for (intptr_t i = 0; i < mapping_.length(); i +=2) {
+  for (intptr_t i = 0; i < mapping_.length(); i += 2) {
     intptr_t from_offset = mapping_.At(i);
-    intptr_t to_offset = mapping_.At(i+1);
+    intptr_t to_offset = mapping_.At(i + 1);
     const Object& value =
         Object::Handle(instance.RawGetFieldAtOffset(from_offset));
     result.RawSetFieldAtOffset(to_offset, value);
@@ -122,6 +153,48 @@
 }
 
 
+void InstanceMorpher::RunNewFieldInitializers() const {
+  if ((new_fields_->length() == 0) || (after_->length() == 0)) {
+    return;
+  }
+
+  TIR_Print("Running new field initializers for class: %s\n", to_.ToCString());
+  String& initializing_expression = String::Handle();
+  Function& eval_func = Function::Handle();
+  Object& result = Object::Handle();
+  Class& owning_class = Class::Handle();
+  // For each new field.
+  for (intptr_t i = 0; i < new_fields_->length(); i++) {
+    // Create a function that returns the expression.
+    const Field* field = new_fields_->At(i);
+    owning_class ^= field->Owner();
+    ASSERT(!owning_class.IsNull());
+    // Extract the initializing expression.
+    initializing_expression = field->InitializingExpression();
+    TIR_Print("New `%s` has initializing expression `%s`\n", field->ToCString(),
+              initializing_expression.ToCString());
+    eval_func ^= Function::EvaluateHelper(owning_class, initializing_expression,
+                                          Array::empty_array(), true);
+    for (intptr_t j = 0; j < after_->length(); j++) {
+      const Instance* instance = after_->At(j);
+      TIR_Print("Initializing instance %" Pd " / %" Pd "\n", j + 1,
+                after_->length());
+      // Run the function and assign the field.
+      result = DartEntry::InvokeFunction(eval_func, Array::empty_array());
+      if (result.IsError()) {
+        // TODO(johnmccutchan): Report this error in the reload response?
+        OS::PrintErr(
+            "RELOAD: Running initializer for new field `%s` resulted in "
+            "an error: %s\n",
+            field->ToCString(), Error::Cast(result).ToErrorCString());
+        continue;
+      }
+      instance->RawSetFieldAtOffset(field->Offset(), result);
+    }
+  }
+}
+
+
 void InstanceMorpher::CreateMorphedCopies() const {
   for (intptr_t i = 0; i < before()->length(); i++) {
     const Instance& copy = Instance::Handle(Morph(*before()->At(i)));
@@ -150,8 +223,8 @@
   }
 
   THR_Print("Mapping: ");
-  for (int i = 0; i < mapping_.length(); i +=2) {
-    THR_Print(" %" Pd "->%" Pd,  mapping_.At(i),  mapping_.At(i+1));
+  for (int i = 0; i < mapping_.length(); i += 2) {
+    THR_Print(" %" Pd "->%" Pd, mapping_.At(i), mapping_.At(i + 1));
   }
   THR_Print("\n");
 }
@@ -176,7 +249,7 @@
   for (int i = 0; i < mapping_.length(); i += 2) {
     JSONArray pair(&map);
     pair.AddValue(mapping_.At(i));
-    pair.AddValue(mapping_.At(i+1));
+    pair.AddValue(mapping_.At(i + 1));
   }
 }
 
@@ -213,8 +286,7 @@
                                                    const Class& to)
     : ReasonForCancelling(zone),
       from_(Class::ZoneHandle(zone, from.raw())),
-      to_(Class::ZoneHandle(zone, to.raw())) {
-}
+      to_(Class::ZoneHandle(zone, to.raw())) {}
 
 
 void ClassReasonForCancelling::AppendTo(JSONArray* array) {
@@ -246,9 +318,7 @@
     return String::Cast(a).Equals(String::Cast(b));
   }
 
-  static uword Hash(const Object& obj) {
-    return String::Cast(obj).Hash();
-  }
+  static uword Hash(const Object& obj) { return String::Cast(obj).Hash(); }
 };
 
 
@@ -279,13 +349,11 @@
     if (!a.IsLibrary() || !b.IsLibrary()) {
       return false;
     }
-    return IsolateReloadContext::IsSameLibrary(
-        Library::Cast(a), Library::Cast(b));
+    return IsolateReloadContext::IsSameLibrary(Library::Cast(a),
+                                               Library::Cast(b));
   }
 
-  static uword Hash(const Object& obj) {
-    return Library::Cast(obj).UrlHash();
-  }
+  static uword Hash(const Object& obj) { return Library::Cast(obj).UrlHash(); }
 };
 
 
@@ -352,12 +420,16 @@
 
   const Library& a_lib = Library::Handle(a.library());
   const Library& b_lib = Library::Handle(b.library());
-  return IsSameLibrary(a_lib, b_lib);
+
+  if (a_lib.IsNull() || b_lib.IsNull()) {
+    return a_lib.raw() == b_lib.raw();
+  }
+  return (a_lib.private_key() == b_lib.private_key());
 }
 
 
-bool IsolateReloadContext::IsSameLibrary(
-    const Library& a_lib, const Library& b_lib) {
+bool IsolateReloadContext::IsSameLibrary(const Library& a_lib,
+                                         const Library& b_lib) {
   const String& a_lib_url =
       String::Handle(a_lib.IsNull() ? String::null() : a_lib.url());
   const String& b_lib_url =
@@ -366,8 +438,7 @@
 }
 
 
-IsolateReloadContext::IsolateReloadContext(Isolate* isolate,
-                                           JSONStream* js)
+IsolateReloadContext::IsolateReloadContext(Isolate* isolate, JSONStream* js)
     : zone_(Thread::Current()->zone()),
       start_time_micros_(OS::GetCurrentMonotonicMicros()),
       reload_timestamp_(OS::GetCurrentTimeMillis()),
@@ -383,7 +454,7 @@
       reasons_to_cancel_reload_(zone_, 0),
       cid_mapper_(),
       modified_libs_(NULL),
-      script_uri_(String::null()),
+      script_url_(String::null()),
       error_(Error::null()),
       old_classes_set_storage_(Array::null()),
       class_map_storage_(Array::null()),
@@ -392,7 +463,9 @@
       become_map_storage_(Array::null()),
       become_enum_mappings_(GrowableObjectArray::null()),
       saved_root_library_(Library::null()),
-      saved_libraries_(GrowableObjectArray::null()) {
+      saved_libraries_(GrowableObjectArray::null()),
+      root_url_prefix_(String::null()),
+      old_root_url_prefix_(String::null()) {
   // NOTE: DO NOT ALLOCATE ANY RAW OBJECTS HERE. The IsolateReloadContext is not
   // associated with the isolate yet and if a GC is triggered here the raw
   // objects will not be properly accounted for.
@@ -400,8 +473,7 @@
 }
 
 
-IsolateReloadContext::~IsolateReloadContext() {
-}
+IsolateReloadContext::~IsolateReloadContext() {}
 
 
 void IsolateReloadContext::ReportError(const Error& error) {
@@ -424,8 +496,7 @@
  public:
   Aborted(Zone* zone, const Error& error)
       : ReasonForCancelling(zone),
-        error_(Error::ZoneHandle(zone, error.raw())) {
-  }
+        error_(Error::ZoneHandle(zone, error.raw())) {}
 
  private:
   const Error& error_;
@@ -437,20 +508,58 @@
 };
 
 
+static intptr_t CommonSuffixLength(const char* a, const char* b) {
+  const intptr_t a_length = strlen(a);
+  const intptr_t b_length = strlen(b);
+  intptr_t a_cursor = a_length;
+  intptr_t b_cursor = b_length;
+
+  while ((a_cursor >= 0) && (b_cursor >= 0)) {
+    if (a[a_cursor] != b[b_cursor]) {
+      break;
+    }
+    a_cursor--;
+    b_cursor--;
+  }
+
+  ASSERT((a_length - a_cursor) == (b_length - b_cursor));
+  return (a_length - a_cursor);
+}
+
+
 // NOTE: This function returns *after* FinalizeLoading is called.
-void IsolateReloadContext::Reload(bool force_reload) {
+void IsolateReloadContext::Reload(bool force_reload,
+                                  const char* root_script_url,
+                                  const char* packages_url_) {
   TIMELINE_SCOPE(Reload);
   Thread* thread = Thread::Current();
   ASSERT(isolate() == thread->isolate());
 
   // Grab root library before calling CheckpointBeforeReload.
-  const Library& root_lib = Library::Handle(object_store()->root_library());
-  ASSERT(!root_lib.IsNull());
-  const String& root_lib_url = String::Handle(root_lib.url());
+  const Library& old_root_lib = Library::Handle(object_store()->root_library());
+  ASSERT(!old_root_lib.IsNull());
+  const String& old_root_lib_url = String::Handle(old_root_lib.url());
+  // Root library url.
+  const String& root_lib_url =
+      (root_script_url == NULL) ? old_root_lib_url
+                                : String::Handle(String::New(root_script_url));
+
+  // Check to see if the base url of the loaded libraries has moved.
+  if (!old_root_lib_url.Equals(root_lib_url)) {
+    const char* old_root_library_url_c = old_root_lib_url.ToCString();
+    const char* root_library_url_c = root_lib_url.ToCString();
+    const intptr_t common_suffix_length =
+        CommonSuffixLength(root_library_url_c, old_root_library_url_c);
+    root_url_prefix_ = String::SubString(
+        root_lib_url, 0, root_lib_url.Length() - common_suffix_length + 1);
+    old_root_url_prefix_ =
+        String::SubString(old_root_lib_url, 0,
+                          old_root_lib_url.Length() - common_suffix_length + 1);
+  }
 
   // Check to see which libraries have been modified.
   modified_libs_ = FindModifiedLibraries(force_reload);
-  if (!modified_libs_->Contains(root_lib.index())) {
+  if (!modified_libs_->Contains(old_root_lib.index())) {
     ASSERT(modified_libs_->IsEmpty());
     reload_skipped_ = true;
     ReportOnJSON(js_);
@@ -463,14 +572,12 @@
   // Preallocate storage for maps.
   old_classes_set_storage_ =
       HashTables::New<UnorderedHashSet<ClassMapTraits> >(4);
-  class_map_storage_ =
-      HashTables::New<UnorderedHashMap<ClassMapTraits> >(4);
+  class_map_storage_ = HashTables::New<UnorderedHashMap<ClassMapTraits> >(4);
   old_libraries_set_storage_ =
       HashTables::New<UnorderedHashSet<LibraryMapTraits> >(4);
   library_map_storage_ =
       HashTables::New<UnorderedHashMap<LibraryMapTraits> >(4);
-  become_map_storage_ =
-      HashTables::New<UnorderedHashMap<BecomeMapTraits> >(4);
+  become_map_storage_ = HashTables::New<UnorderedHashMap<BecomeMapTraits> >(4);
   // Keep a separate array for enum mappings to avoid having to invoke
   // hashCode on the instances.
   become_enum_mappings_ = GrowableObjectArray::New(Heap::kOld);
@@ -507,23 +614,29 @@
   // for example, top level parse errors. We want to capture these errors while
   // propagating the UnwindError or an UnhandledException error.
   Object& result = Object::Handle(thread->zone());
+
+  String& packages_url = String::Handle();
+  if (packages_url_ != NULL) {
+    packages_url = String::New(packages_url_);
+  }
+
+  TIR_Print("---- ENTERING TAG HANDLER\n");
   {
     TransitionVMToNative transition(thread);
     Api::Scope api_scope(thread);
 
-    Dart_Handle retval =
-        (I->library_tag_handler())(Dart_kScriptTag,
-                                   Api::NewHandle(thread, Library::null()),
-                                   Api::NewHandle(thread, root_lib_url.raw()));
+    Dart_Handle retval = (I->library_tag_handler())(
+        Dart_kScriptTag, Api::NewHandle(thread, packages_url.raw()),
+        Api::NewHandle(thread, root_lib_url.raw()));
     result = Api::UnwrapHandle(retval);
   }
   //
   // WEIRD CONTROL FLOW ENDS.
+  TIR_Print("---- EXITED TAG HANDLER\n");
 
   BackgroundCompiler::Enable();
 
-  if (result.IsUnwindError() ||
-      result.IsUnhandledException()) {
+  if (result.IsUnwindError() || result.IsUnhandledException()) {
     // If the tag handler returns with an UnwindError or an UnhandledException
     // error, propagate it and give up.
     Exceptions::PropagateError(Error::Cast(result));
@@ -552,6 +665,7 @@
     AddClassMapping(new_cls, new_cls);
     return;
   }
+  VTIR_Print("Registering class: %s\n", new_cls.ToCString());
   new_cls.set_id(old_cls.id());
   isolate()->class_table()->SetAt(old_cls.id(), new_cls.raw());
   if (!old_cls.is_enum_class()) {
@@ -719,8 +833,7 @@
   Class& cls = Class::Handle();
   UnorderedHashSet<ClassMapTraits> old_classes_set(old_classes_set_storage_);
   for (intptr_t i = 0; i < saved_num_cids_; i++) {
-    if (class_table->IsValidIndex(i) &&
-        class_table->HasValidClassAt(i)) {
+    if (class_table->IsValidIndex(i) && class_table->HasValidClassAt(i)) {
       // Copy the class into the saved class table and add it to the set.
       local_saved_class_table[i] = class_table->At(i);
       if (i != kFreeListElement && i != kForwardingCorpse) {
@@ -756,7 +869,7 @@
 
 
 static void PropagateLibraryModified(
-    const ZoneGrowableArray<ZoneGrowableArray<intptr_t>* >* imported_by,
+    const ZoneGrowableArray<ZoneGrowableArray<intptr_t>*>* imported_by,
     intptr_t lib_index,
     BitVector* modified_libs) {
   ZoneGrowableArray<intptr_t>* dep_libs = (*imported_by)[lib_index];
@@ -782,12 +895,11 @@
   intptr_t num_libs = libs.Length();
 
   // Construct the imported-by graph.
-  ZoneGrowableArray<ZoneGrowableArray<intptr_t>* >* imported_by =
-      new(zone_) ZoneGrowableArray<ZoneGrowableArray<intptr_t>* >(
-          zone_, num_libs);
+  ZoneGrowableArray<ZoneGrowableArray<intptr_t>*>* imported_by = new (zone_)
+      ZoneGrowableArray<ZoneGrowableArray<intptr_t>*>(zone_, num_libs);
   imported_by->SetLength(num_libs);
   for (intptr_t i = 0; i < num_libs; i++) {
-    (*imported_by)[i] = new(zone_) ZoneGrowableArray<intptr_t>(zone_, 0);
+    (*imported_by)[i] = new (zone_) ZoneGrowableArray<intptr_t>(zone_, 0);
   }
   Array& ports = Array::Handle();
   Namespace& ns = Namespace::Handle();
@@ -842,7 +954,7 @@
     }
   }
 
-  BitVector* modified_libs = new(Z) BitVector(Z, num_libs);
+  BitVector* modified_libs = new (Z) BitVector(Z, num_libs);
 
   for (intptr_t lib_idx = 0; lib_idx < num_libs; lib_idx++) {
     lib ^= libs.At(lib_idx);
@@ -871,8 +983,7 @@
   TIMELINE_SCOPE(CheckpointLibraries);
   TIR_Print("---- CHECKPOINTING LIBRARIES\n");
   // Save the root library in case we abort the reload.
-  const Library& root_lib =
-      Library::Handle(object_store()->root_library());
+  const Library& root_lib = Library::Handle(object_store()->root_library());
   set_saved_root_library(root_lib);
 
   // Save the old libraries array in case we abort the reload.
@@ -882,11 +993,11 @@
 
   // Make a filtered copy of the old libraries array. Keep "clean" libraries
   // that we will use instead of reloading.
-  const GrowableObjectArray& new_libs = GrowableObjectArray::Handle(
-      GrowableObjectArray::New(Heap::kOld));
+  const GrowableObjectArray& new_libs =
+      GrowableObjectArray::Handle(GrowableObjectArray::New(Heap::kOld));
   Library& lib = Library::Handle();
-  UnorderedHashSet<LibraryMapTraits>
-      old_libraries_set(old_libraries_set_storage_);
+  UnorderedHashSet<LibraryMapTraits> old_libraries_set(
+      old_libraries_set_storage_);
   num_saved_libs_ = 0;
   for (intptr_t i = 0; i < libs.Length(); i++) {
     lib ^= libs.At(i);
@@ -949,8 +1060,8 @@
   TIR_Print("---- ROLLING BACK LIBRARY CHANGES\n");
   Thread* thread = Thread::Current();
   Library& lib = Library::Handle();
-  GrowableObjectArray& saved_libs = GrowableObjectArray::Handle(
-      Z, saved_libraries());
+  GrowableObjectArray& saved_libs =
+      GrowableObjectArray::Handle(Z, saved_libraries());
   if (!saved_libs.IsNull()) {
     for (intptr_t i = 0; i < saved_libs.Length(); i++) {
       lib = Library::RawCast(saved_libs.At(i));
@@ -991,7 +1102,7 @@
   UnorderedHashMap<ClassMapTraits> class_map(class_map_storage_);
   UnorderedHashMap<ClassMapTraits> reverse_class_map(
       HashTables::New<UnorderedHashMap<ClassMapTraits> >(
-         class_map.NumOccupied()));
+          class_map.NumOccupied()));
   {
     UnorderedHashMap<ClassMapTraits>::Iterator it(&class_map);
     while (it.MoveNext()) {
@@ -1000,9 +1111,10 @@
       cls = Class::RawCast(class_map.GetPayload(entry, 0));
       cls2 ^= reverse_class_map.GetOrNull(new_cls);
       if (!cls2.IsNull()) {
-        OS::PrintErr("Classes '%s' and '%s' are distinct classes but both map "
-                     " to class '%s'\n",
-                     cls.ToCString(), cls2.ToCString(), new_cls.ToCString());
+        OS::PrintErr(
+            "Classes '%s' and '%s' are distinct classes but both map "
+            " to class '%s'\n",
+            cls.ToCString(), cls2.ToCString(), new_cls.ToCString());
         UNREACHABLE();
       }
       bool update = reverse_class_map.UpdateOrInsert(cls, new_cls);
@@ -1082,6 +1194,10 @@
         new_lib = Library::RawCast(lib_map.GetKey(entry));
         lib = Library::RawCast(lib_map.GetPayload(entry, 0));
         new_lib.set_debuggable(lib.IsDebuggable());
+        // Native extension support.
+        new_lib.set_native_entry_resolver(lib.native_entry_resolver());
+        new_lib.set_native_entry_symbol_resolver(
+            lib.native_entry_symbol_resolver());
       }
     }
 
@@ -1093,8 +1209,8 @@
     TIMELINE_SCOPE(UpdateLibrariesArray);
     // Update the libraries array.
     Library& lib = Library::Handle();
-    const GrowableObjectArray& libs = GrowableObjectArray::Handle(
-        I->object_store()->libraries());
+    const GrowableObjectArray& libs =
+        GrowableObjectArray::Handle(I->object_store()->libraries());
     for (intptr_t i = 0; i < libs.Length(); i++) {
       lib = Library::RawCast(libs.At(i));
       VTIR_Print("Lib '%s' at index %" Pd "\n", lib.ToCString(), i);
@@ -1114,8 +1230,8 @@
     const GrowableObjectArray& become_enum_mappings =
         GrowableObjectArray::Handle(become_enum_mappings_);
     UnorderedHashMap<BecomeMapTraits> become_map(become_map_storage_);
-    intptr_t replacement_count = become_map.NumOccupied() +
-                                 become_enum_mappings.Length() / 2;
+    intptr_t replacement_count =
+        become_map.NumOccupied() + become_enum_mappings.Length() / 2;
     const Array& before =
         Array::Handle(Array::New(replacement_count, Heap::kOld));
     const Array& after =
@@ -1144,22 +1260,57 @@
     Become::ElementsForwardIdentity(before, after);
   }
 
+  // Run the initializers for new instance fields.
+  RunNewFieldInitializers();
+
   if (FLAG_identity_reload) {
     if (saved_num_cids_ != I->class_table()->NumCids()) {
       TIR_Print("Identity reload failed! B#C=%" Pd " A#C=%" Pd "\n",
-                saved_num_cids_,
-                I->class_table()->NumCids());
+                saved_num_cids_, I->class_table()->NumCids());
     }
     const GrowableObjectArray& saved_libs =
         GrowableObjectArray::Handle(saved_libraries());
     const GrowableObjectArray& libs =
         GrowableObjectArray::Handle(I->object_store()->libraries());
     if (saved_libs.Length() != libs.Length()) {
-     TIR_Print("Identity reload failed! B#L=%" Pd " A#L=%" Pd "\n",
-               saved_libs.Length(),
-               libs.Length());
+      TIR_Print("Identity reload failed! B#L=%" Pd " A#L=%" Pd "\n",
+                saved_libs.Length(), libs.Length());
     }
   }
+
+  // Rehash constants map for all classes.
+  RehashConstants();
+
+#ifdef DEBUG
+  // Verify that all canonical instances are correctly setup in the
+  // corresponding canonical tables.
+  Thread* thread = Thread::Current();
+  I->heap()->CollectAllGarbage();
+  VerifyCanonicalVisitor check_canonical(thread);
+  I->heap()->IterateObjects(&check_canonical);
+#endif  // DEBUG
+}
+
+
+void IsolateReloadContext::RehashConstants() {
+  TIMELINE_SCOPE(RehashConstants);
+  ClassTable* class_table = I->class_table();
+  Class& cls = Class::Handle(zone_);
+  const intptr_t top = class_table->NumCids();
+  for (intptr_t cid = kInstanceCid; cid < top; cid++) {
+    if (!class_table->IsValidIndex(cid) || !class_table->HasValidClassAt(cid)) {
+      // Skip invalid classes.
+      continue;
+    }
+    if (RawObject::IsNumberClassId(cid) || RawObject::IsStringClassId(cid)) {
+      // Skip classes that cannot be affected by the 'become' operation.
+      continue;
+    }
+    // Rehash constants.
+    cls = class_table->At(cid);
+    VTIR_Print("Rehashing constants in class `%s`\n", cls.ToCString());
+    cls.RehashConstants(zone_);
+  }
 }
 
 
@@ -1208,8 +1359,7 @@
 class ObjectLocator : public ObjectVisitor {
  public:
   explicit ObjectLocator(IsolateReloadContext* context)
-      : context_(context), count_(0) {
-  }
+      : context_(context), count_(0) {}
 
   void VisitObject(RawObject* obj) {
     InstanceMorpher* morpher =
@@ -1248,12 +1398,12 @@
   intptr_t count = locator.count();
   if (count == 0) return;
 
-  TIR_Print("Found %" Pd " object%s subject to morphing.\n",
-            count, (count > 1) ? "s" : "");
+  TIR_Print("Found %" Pd " object%s subject to morphing.\n", count,
+            (count > 1) ? "s" : "");
 
   Array& before = Array::Handle();
   Array& after = Array::Handle();
-  { // Prevent GC to take place due object format confusion.
+  {  // Prevent GC to take place due object format confusion.
     // Hint: More than one class share the same cid.
     NoHeapGrowthControlScope scope;
     for (intptr_t i = 0; i < instance_morphers_.length(); i++) {
@@ -1283,6 +1433,14 @@
 }
 
 
+void IsolateReloadContext::RunNewFieldInitializers() {
+  // Run new field initializers on all instances.
+  for (intptr_t i = 0; i < instance_morphers_.length(); i++) {
+    instance_morphers_.At(i)->RunNewFieldInitializers();
+  }
+}
+
+
 bool IsolateReloadContext::ValidateReload() {
   TIMELINE_SCOPE(ValidateReload);
   if (reload_aborted()) return false;
@@ -1395,7 +1553,7 @@
     if (code.is_optimized()) {
       // If this code is optimized, we need to reset the ICs in the
       // corresponding unoptimized code, which will be executed when the stack
-      // unwinds to the the optimized code.
+      // unwinds to the optimized code.
       function = code.function();
       code = function.unoptimized_code();
       ASSERT(!code.IsNull());
@@ -1422,14 +1580,13 @@
   MarkFunctionsForRecompilation(Isolate* isolate,
                                 IsolateReloadContext* reload_context,
                                 Zone* zone)
-    : ObjectVisitor(),
-      handle_(Object::Handle(zone)),
-      owning_class_(Class::Handle(zone)),
-      owning_lib_(Library::Handle(zone)),
-      code_(Code::Handle(zone)),
-      reload_context_(reload_context),
-      zone_(zone) {
-  }
+      : ObjectVisitor(),
+        handle_(Object::Handle(zone)),
+        owning_class_(Class::Handle(zone)),
+        owning_lib_(Library::Handle(zone)),
+        code_(Code::Handle(zone)),
+        reload_context_(reload_context),
+        zone_(zone) {}
 
   virtual void VisitObject(RawObject* obj) {
     if (obj->IsPseudoObject()) {
@@ -1455,7 +1612,7 @@
       if (!stub_code) {
         if (clear_code) {
           VTIR_Print("Marking %s for recompilation, clearning code\n",
-              func.ToCString());
+                     func.ToCString());
           ClearAllCode(func);
         } else {
           PreserveUnoptimizedCode();
@@ -1554,21 +1711,70 @@
   if (old.IsNull()) {
     return String::null();
   }
+#if defined(DEBUG)
+  VTIR_Print("`%s` is getting `%s`'s private key.\n",
+             String::Handle(replacement_or_new.url()).ToCString(),
+             String::Handle(old.url()).ToCString());
+#endif
   return old.private_key();
 }
 
 
 RawLibrary* IsolateReloadContext::OldLibraryOrNull(
     const Library& replacement_or_new) {
-  UnorderedHashSet<LibraryMapTraits>
-      old_libraries_set(old_libraries_set_storage_);
+  UnorderedHashSet<LibraryMapTraits> old_libraries_set(
+      old_libraries_set_storage_);
   Library& lib = Library::Handle();
   lib ^= old_libraries_set.GetOrNull(replacement_or_new);
   old_libraries_set.Release();
+  if (lib.IsNull() && (root_url_prefix_ != String::null()) &&
+      (old_root_url_prefix_ != String::null())) {
+    return OldLibraryOrNullBaseMoved(replacement_or_new);
+  }
   return lib.raw();
 }
 
 
+// Attempt to find the pair to |replacement_or_new| with the knowledge that
+// the base url prefix has moved.
+RawLibrary* IsolateReloadContext::OldLibraryOrNullBaseMoved(
+    const Library& replacement_or_new) {
+  const String& url_prefix = String::Handle(root_url_prefix_);
+  const String& old_url_prefix = String::Handle(old_root_url_prefix_);
+  const intptr_t prefix_length = url_prefix.Length();
+  const intptr_t old_prefix_length = old_url_prefix.Length();
+  const String& new_url = String::Handle(replacement_or_new.url());
+  const String& suffix =
+      String::Handle(String::SubString(new_url, prefix_length));
+  if (!new_url.StartsWith(url_prefix)) {
+    return Library::null();
+  }
+  Library& old = Library::Handle();
+  String& old_url = String::Handle();
+  String& old_suffix = String::Handle();
+  GrowableObjectArray& saved_libs =
+      GrowableObjectArray::Handle(saved_libraries());
+  ASSERT(!saved_libs.IsNull());
+  for (intptr_t i = 0; i < saved_libs.Length(); i++) {
+    old = Library::RawCast(saved_libs.At(i));
+    old_url = old.url();
+    if (!old_url.StartsWith(old_url_prefix)) {
+      continue;
+    }
+    old_suffix ^= String::SubString(old_url, old_prefix_length);
+    if (old_suffix.IsNull()) {
+      continue;
+    }
+    if (old_suffix.Equals(suffix)) {
+      TIR_Print("`%s` is moving to `%s`\n", old_url.ToCString(),
+                new_url.ToCString());
+      return old.raw();
+    }
+  }
+  return Library::null();
+}
+
+
 void IsolateReloadContext::BuildLibraryMapping() {
   const GrowableObjectArray& libs =
       GrowableObjectArray::Handle(object_store()->libraries());
@@ -1619,8 +1825,8 @@
 }
 
 
-void IsolateReloadContext::AddStaticFieldMapping(
-    const Field& old_field, const Field& new_field) {
+void IsolateReloadContext::AddStaticFieldMapping(const Field& old_field,
+                                                 const Field& new_field) {
   ASSERT(old_field.is_static());
   ASSERT(new_field.is_static());
 
diff --git a/runtime/vm/isolate_reload.h b/runtime/vm/isolate_reload.h
index ce16bef..f83297e 100644
--- a/runtime/vm/isolate_reload.h
+++ b/runtime/vm/isolate_reload.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_ISOLATE_RELOAD_H_
-#define VM_ISOLATE_RELOAD_H_
+#ifndef RUNTIME_VM_ISOLATE_RELOAD_H_
+#define RUNTIME_VM_ISOLATE_RELOAD_H_
 
 #include "include/dart_tools_api.h"
 
@@ -17,20 +17,20 @@
 
 // 'Trace Isolate Reload' TIR_Print
 #if defined(_MSC_VER)
-#define TIR_Print(format, ...) \
-    if (FLAG_trace_reload) Log::Current()->Print(format, __VA_ARGS__)
+#define TIR_Print(format, ...)                                                 \
+  if (FLAG_trace_reload) Log::Current()->Print(format, __VA_ARGS__)
 #else
-#define TIR_Print(format, ...) \
-    if (FLAG_trace_reload) Log::Current()->Print(format, ##__VA_ARGS__)
+#define TIR_Print(format, ...)                                                 \
+  if (FLAG_trace_reload) Log::Current()->Print(format, ##__VA_ARGS__)
 #endif
 
 // 'Verbose Trace Isolate Reload' VTIR_Print
 #if defined(_MSC_VER)
-#define VTIR_Print(format, ...) \
-    if (FLAG_trace_reload_verbose) Log::Current()->Print(format, __VA_ARGS__)
+#define VTIR_Print(format, ...)                                                \
+  if (FLAG_trace_reload_verbose) Log::Current()->Print(format, __VA_ARGS__)
 #else
-#define VTIR_Print(format, ...) \
-    if (FLAG_trace_reload_verbose) Log::Current()->Print(format, ##__VA_ARGS__)
+#define VTIR_Print(format, ...)                                                \
+  if (FLAG_trace_reload_verbose) Log::Current()->Print(format, ##__VA_ARGS__)
 #endif
 
 namespace dart {
@@ -58,6 +58,8 @@
   // Called on each instance that needs to be morphed.
   RawInstance* Morph(const Instance& instance) const;
 
+  void RunNewFieldInitializers() const;
+
   // Adds an object to be morphed.
   void AddObject(RawObject* object) const;
 
@@ -74,6 +76,8 @@
   ZoneGrowableArray<const Instance*>* before() const { return before_; }
   // Returns the list of morphed objects (matches order in before()).
   ZoneGrowableArray<const Instance*>* after() const { return after_; }
+  // Returns the list of new fields.
+  ZoneGrowableArray<const Field*>* new_fields() const { return new_fields_; }
 
   // Returns the cid associated with the from_ and to_ class.
   intptr_t cid() const { return cid_; }
@@ -84,6 +88,7 @@
   ZoneGrowableArray<intptr_t> mapping_;
   ZoneGrowableArray<const Instance*>* before_;
   ZoneGrowableArray<const Instance*>* after_;
+  ZoneGrowableArray<const Field*>* new_fields_;
   intptr_t cid_;
 
   void ComputeMapping();
@@ -128,11 +133,12 @@
 
 class IsolateReloadContext {
  public:
-  explicit IsolateReloadContext(Isolate* isolate,
-                                JSONStream* js);
+  explicit IsolateReloadContext(Isolate* isolate, JSONStream* js);
   ~IsolateReloadContext();
 
-  void Reload(bool force_reload);
+  void Reload(bool force_reload,
+              const char* root_script_url = NULL,
+              const char* packages_url = NULL);
 
   // All zone allocated objects must be allocated from this zone.
   Zone* zone() const { return zone_; }
@@ -191,9 +197,7 @@
   void AddInstanceMorpher(InstanceMorpher* morpher);
 
   // Tells whether instance in the heap must be morphed.
-  bool HasInstanceMorphers() const {
-    return !instance_morphers_.is_empty();
-  }
+  bool HasInstanceMorphers() const { return !instance_morphers_.is_empty(); }
 
   // NOTE: FinalizeLoading will be called *before* Reload() returns. This
   // function will not be called if the embedder does not call
@@ -235,6 +239,8 @@
   // Transforms the heap based on instance_morphers_.
   void MorphInstances();
 
+  void RunNewFieldInitializers();
+
   bool ValidateReload();
 
   void Rollback();
@@ -250,6 +256,8 @@
 
   void PostCommit();
 
+  void RehashConstants();
+
   void ClearReplacedObjectBits();
 
   // atomic_install:
@@ -305,10 +313,12 @@
   RawClass* OldClassOrNull(const Class& replacement_or_new);
 
   RawLibrary* OldLibraryOrNull(const Library& replacement_or_new);
+
+  RawLibrary* OldLibraryOrNullBaseMoved(const Library& replacement_or_new);
+
   void BuildLibraryMapping();
 
-  void AddClassMapping(const Class& replacement_or_new,
-                       const Class& original);
+  void AddClassMapping(const Class& replacement_or_new, const Class& original);
 
   void AddLibraryMapping(const Library& replacement_or_new,
                          const Library& original);
@@ -323,8 +333,8 @@
   RawClass* MappedClass(const Class& replacement_or_new);
   RawLibrary* MappedLibrary(const Library& replacement_or_new);
 
-  RawObject** from() { return reinterpret_cast<RawObject**>(&script_uri_); }
-  RawString* script_uri_;
+  RawObject** from() { return reinterpret_cast<RawObject**>(&script_url_); }
+  RawString* script_url_;
   RawError* error_;
   RawArray* old_classes_set_storage_;
   RawArray* class_map_storage_;
@@ -334,7 +344,11 @@
   RawGrowableObjectArray* become_enum_mappings_;
   RawLibrary* saved_root_library_;
   RawGrowableObjectArray* saved_libraries_;
-  RawObject** to() { return reinterpret_cast<RawObject**>(&saved_libraries_); }
+  RawString* root_url_prefix_;
+  RawString* old_root_url_prefix_;
+  RawObject** to() {
+    return reinterpret_cast<RawObject**>(&old_root_url_prefix_);
+  }
 
   friend class Isolate;
   friend class Class;  // AddStaticFieldMapping, AddEnumBecomeMapping.
@@ -348,4 +362,4 @@
 
 }  // namespace dart
 
-#endif   // VM_ISOLATE_RELOAD_H_
+#endif  // RUNTIME_VM_ISOLATE_RELOAD_H_
diff --git a/runtime/vm/isolate_reload_test.cc b/runtime/vm/isolate_reload_test.cc
index 4543baa..287eb71 100644
--- a/runtime/vm/isolate_reload_test.cc
+++ b/runtime/vm/isolate_reload_test.cc
@@ -313,7 +313,7 @@
 
   Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
   EXPECT_VALID(lib);
-  EXPECT_ERROR(SimpleInvokeError(lib, "main"), "max");;
+  EXPECT_ERROR(SimpleInvokeError(lib, "main"), "max");
 
   const char* kReloadScript =
       "import 'dart:math';\n"
@@ -346,7 +346,7 @@
   lib = TestCase::ReloadTestScript(kReloadScript);
   EXPECT_VALID(lib);
 
-  EXPECT_ERROR(SimpleInvokeError(lib, "main"), "max");;
+  EXPECT_ERROR(SimpleInvokeError(lib, "main"), "max");
 }
 
 
@@ -634,8 +634,7 @@
 
   Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
   EXPECT_VALID(lib);
-  EXPECT_STREQ("saved:field=mixin1,func=mixin1",
-               SimpleInvokeStr(lib, "main"));
+  EXPECT_STREQ("saved:field=mixin1,func=mixin1", SimpleInvokeStr(lib, "main"));
 
   const char* kReloadScript =
       "class Mixin2 {\n"
@@ -656,9 +655,10 @@
 
   // The saved instance of B retains its old field value from mixin1,
   // but it gets the new implementation of func from mixin2.
-  EXPECT_STREQ("saved:field=mixin1,func=mixin2 "
-               "newer:field=mixin2,func=mixin2",
-               SimpleInvokeStr(lib, "main"));
+  EXPECT_STREQ(
+      "saved:field=mixin1,func=mixin2 "
+      "newer:field=mixin2,func=mixin2",
+      SimpleInvokeStr(lib, "main"));
 }
 
 
@@ -683,10 +683,11 @@
 
   Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
   EXPECT_VALID(lib);
-  EXPECT_STREQ("(a is A(true)/ B(false)/ C(false),"
-               " b is A(true)/ B(true)/ C(false),"
-               " c is A(true)/ B(true)/ C(true))",
-               SimpleInvokeStr(lib, "main"));
+  EXPECT_STREQ(
+      "(a is A(true)/ B(false)/ C(false),"
+      " b is A(true)/ B(true)/ C(false),"
+      " c is A(true)/ B(true)/ C(true))",
+      SimpleInvokeStr(lib, "main"));
 
   const char* kReloadScript =
       "class C {\n"
@@ -709,11 +710,12 @@
 
   lib = TestCase::ReloadTestScript(kReloadScript);
   EXPECT_VALID(lib);
-  EXPECT_STREQ("(a is A(true)/ C(true)/ X(true),"
-               " b is A(true)/ C(true)/ X(true),"  // still extends A...
-               " c is A(false)/ C(true)/ X(false),"
-               " x is A(false)/ C(true)/ X(true))",
-               SimpleInvokeStr(lib, "main"));
+  EXPECT_STREQ(
+      "(a is A(true)/ C(true)/ X(true),"
+      " b is A(true)/ C(true)/ X(true),"  // still extends A...
+      " c is A(false)/ C(true)/ X(false),"
+      " x is A(false)/ C(true)/ X(true))",
+      SimpleInvokeStr(lib, "main"));
 
   // Revive the class B and make sure all allocated instances take
   // their place in the inheritance hierarchy.
@@ -741,11 +743,12 @@
 
   lib = TestCase::ReloadTestScript(kReloadScript2);
   EXPECT_VALID(lib);
-  EXPECT_STREQ("(a is A(true)/ B(false)/ C(false)/ X(true),"
-               " b is A(false)/ B(true)/ C(false)/ X(true),"
-               " c is A(true)/ B(false)/ C(true)/ X(true),"
-               " x is A(false)/ B(false)/ C(false)/ X(true))",
-               SimpleInvokeStr(lib, "main"));
+  EXPECT_STREQ(
+      "(a is A(true)/ B(false)/ C(false)/ X(true),"
+      " b is A(false)/ B(true)/ C(false)/ X(true),"
+      " c is A(true)/ B(false)/ C(true)/ X(true),"
+      " x is A(false)/ B(false)/ C(false)/ X(true))",
+      SimpleInvokeStr(lib, "main"));
 }
 
 
@@ -784,8 +787,7 @@
 
 
 TEST_CASE(IsolateReload_LibraryLookup) {
-  const char* kImportScript =
-      "importedFunc() => 'a';\n";
+  const char* kImportScript = "importedFunc() => 'a';\n";
   TestCase::AddTestLib("test:lib1", kImportScript);
 
   const char* kScript =
@@ -827,8 +829,7 @@
 
 
 TEST_CASE(IsolateReload_LibraryHide) {
-  const char* kImportScript =
-      "importedFunc() => 'a';\n";
+  const char* kImportScript = "importedFunc() => 'a';\n";
   TestCase::AddTestLib("test:lib1", kImportScript);
 
   // Import 'test:lib1' with importedFunc hidden. Will result in an
@@ -908,8 +909,7 @@
 // Verifies that we clear the ICs for the functions live on the stack in a way
 // that is compatible with the fast path smi stubs.
 TEST_CASE(IsolateReload_SmiFastPathStubs) {
-  const char* kImportScript =
-      "importedIntFunc() => 4;\n";
+  const char* kImportScript = "importedIntFunc() => 4;\n";
   TestCase::AddTestLib("test:lib1", kImportScript);
 
   const char* kScript =
@@ -1536,7 +1536,7 @@
 
   TestCase::SetReloadTestScript(kReloadScript);
 
-  EXPECT_STREQ("4 Class 'C' has no instance getter 'y'.",
+  EXPECT_STREQ("4 NoSuchMethodError: Class 'C' has no instance getter 'y'.",
                SimpleInvokeStr(lib, "main"));
 
   lib = TestCase::GetReloadErrorOrRootLibrary();
@@ -1595,8 +1595,10 @@
 
   TestCase::SetReloadTestScript(kReloadScript);
 
-  EXPECT_STREQ("4 No static getter 'y' declared in class 'C'.",
-               SimpleInvokeStr(lib, "main"));
+  EXPECT_STREQ(
+      "4 NoSuchMethodError: No static getter 'y' declared "
+      "in class 'C'.",
+      SimpleInvokeStr(lib, "main"));
 
   lib = TestCase::GetReloadErrorOrRootLibrary();
   EXPECT_VALID(lib);
@@ -1605,8 +1607,7 @@
 
 static void IsolateReload_DanlingGetter_LibraryReload(
     Dart_NativeArguments native_args) {
-  const char* kImportScript2 =
-    "var x;\n";
+  const char* kImportScript2 = "var x;\n";
   TestCase::AddTestLib("test:other", kImportScript2);
 
   DART_CHECK_VALID(TestCase::TriggerReload());
@@ -1653,7 +1654,7 @@
 
   TestCase::SetReloadTestScript(kScript);  // Root library does not change.
 
-  EXPECT_STREQ("4 No top-level getter 'y' declared.",
+  EXPECT_STREQ("4 NoSuchMethodError: No top-level getter 'y' declared.",
                SimpleInvokeStr(lib, "main"));
 
   lib = TestCase::GetReloadErrorOrRootLibrary();
@@ -1710,7 +1711,7 @@
 
   TestCase::SetReloadTestScript(kReloadScript);
 
-  EXPECT_STREQ("null Class 'C' has no instance setter 'y='.",
+  EXPECT_STREQ("null NoSuchMethodError: Class 'C' has no instance setter 'y='.",
                SimpleInvokeStr(lib, "main"));
 
   lib = TestCase::GetReloadErrorOrRootLibrary();
@@ -1769,8 +1770,10 @@
 
   TestCase::SetReloadTestScript(kReloadScript);
 
-  EXPECT_STREQ("5 No static setter 'y=' declared in class 'C'.",
-               SimpleInvokeStr(lib, "main"));
+  EXPECT_STREQ(
+      "5 NoSuchMethodError: No static setter 'y=' declared in "
+      "class 'C'.",
+      SimpleInvokeStr(lib, "main"));
 
   lib = TestCase::GetReloadErrorOrRootLibrary();
   EXPECT_VALID(lib);
@@ -1779,8 +1782,7 @@
 
 static void IsolateReload_DanlingSetter_LibraryReload(
     Dart_NativeArguments native_args) {
-  const char* kImportScript2 =
-    "var x;\n";
+  const char* kImportScript2 = "var x;\n";
   TestCase::AddTestLib("test:other", kImportScript2);
 
   DART_CHECK_VALID(TestCase::TriggerReload());
@@ -1827,7 +1829,7 @@
 
   TestCase::SetReloadTestScript(kScript);  // Root library does not change.
 
-  EXPECT_STREQ("5 No top-level setter 'y=' declared.",
+  EXPECT_STREQ("5 NoSuchMethodError: No top-level setter 'y=' declared.",
                SimpleInvokeStr(lib, "main"));
 
   lib = TestCase::GetReloadErrorOrRootLibrary();
@@ -1883,8 +1885,10 @@
 
   TestCase::SetReloadTestScript(kReloadScript);
 
-  EXPECT_STREQ("1 Class 'C' has no instance method 'foo' with matching"
-               " arguments.", SimpleInvokeStr(lib, "main"));
+  EXPECT_STREQ(
+      "1 NoSuchMethodError: Class 'C' has no instance method "
+      "'foo' with matching arguments.",
+      SimpleInvokeStr(lib, "main"));
 
   lib = TestCase::GetReloadErrorOrRootLibrary();
   EXPECT_VALID(lib);
@@ -1937,8 +1941,10 @@
 
   TestCase::SetReloadTestScript(kReloadScript);
 
-  EXPECT_STREQ("1 Closure call with mismatched arguments: function 'C.foo'",
-               SimpleInvokeStr(lib, "main"));
+  EXPECT_STREQ(
+      "1 NoSuchMethodError: Closure call with mismatched arguments: "
+      "function 'C.foo'",
+      SimpleInvokeStr(lib, "main"));
 
   lib = TestCase::GetReloadErrorOrRootLibrary();
   EXPECT_VALID(lib);
@@ -2174,7 +2180,7 @@
 
   lib = TestCase::ReloadTestScript(kReloadScript);
   EXPECT_VALID(lib);
-  EXPECT_STREQ("Fruit.Cantalope true 2",
+  EXPECT_STREQ("Deleted enum value from Fruit true -1",
                SimpleInvokeStr(lib, "main"));
 }
 
@@ -2881,8 +2887,7 @@
 
 
 TEST_CASE(IsolateReload_NoLibsModified) {
-  const char* kImportScript =
-      "importedFunc() => 'fancy';";
+  const char* kImportScript = "importedFunc() => 'fancy';";
   TestCase::AddTestLib("test:lib1", kImportScript);
 
   const char* kScript =
@@ -2895,8 +2900,7 @@
   EXPECT_VALID(lib);
   EXPECT_STREQ("fancy feast", SimpleInvokeStr(lib, "main"));
 
-  const char* kReloadImportScript =
-      "importedFunc() => 'bossy';";
+  const char* kReloadImportScript = "importedFunc() => 'bossy';";
   TestCase::AddTestLib("test:lib1", kReloadImportScript);
 
   const char* kReloadScript =
@@ -2924,8 +2928,7 @@
 
 
 TEST_CASE(IsolateReload_MainLibModified) {
-  const char* kImportScript =
-      "importedFunc() => 'fancy';";
+  const char* kImportScript = "importedFunc() => 'fancy';";
   TestCase::AddTestLib("test:lib1", kImportScript);
 
   const char* kScript =
@@ -2938,8 +2941,7 @@
   EXPECT_VALID(lib);
   EXPECT_STREQ("fancy feast", SimpleInvokeStr(lib, "main"));
 
-  const char* kReloadImportScript =
-      "importedFunc() => 'bossy';";
+  const char* kReloadImportScript = "importedFunc() => 'bossy';";
   TestCase::AddTestLib("test:lib1", kReloadImportScript);
 
   const char* kReloadScript =
@@ -2967,8 +2969,7 @@
 
 
 TEST_CASE(IsolateReload_ImportedLibModified) {
-  const char* kImportScript =
-      "importedFunc() => 'fancy';";
+  const char* kImportScript = "importedFunc() => 'fancy';";
   TestCase::AddTestLib("test:lib1", kImportScript);
 
   const char* kScript =
@@ -2981,8 +2982,7 @@
   EXPECT_VALID(lib);
   EXPECT_STREQ("fancy feast", SimpleInvokeStr(lib, "main"));
 
-  const char* kReloadImportScript =
-      "importedFunc() => 'bossy';";
+  const char* kReloadImportScript = "importedFunc() => 'bossy';";
   TestCase::AddTestLib("test:lib1", kReloadImportScript);
 
   const char* kReloadScript =
@@ -3002,8 +3002,7 @@
 
 
 TEST_CASE(IsolateReload_PrefixImportedLibModified) {
-  const char* kImportScript =
-      "importedFunc() => 'fancy';";
+  const char* kImportScript = "importedFunc() => 'fancy';";
   TestCase::AddTestLib("test:lib1", kImportScript);
 
   const char* kScript =
@@ -3016,8 +3015,7 @@
   EXPECT_VALID(lib);
   EXPECT_STREQ("fancy feast", SimpleInvokeStr(lib, "main"));
 
-  const char* kReloadImportScript =
-      "importedFunc() => 'bossy';";
+  const char* kReloadImportScript = "importedFunc() => 'bossy';";
   TestCase::AddTestLib("test:lib1", kReloadImportScript);
 
   const char* kReloadScript =
@@ -3046,12 +3044,10 @@
 
 
 TEST_CASE(IsolateReload_ExportedLibModified) {
-  const char* kImportScript =
-      "export 'test:exportlib';";
+  const char* kImportScript = "export 'test:exportlib';";
   TestCase::AddTestLib("test:importlib", kImportScript);
 
-  const char* kExportScript =
-      "exportedFunc() => 'fancy';";
+  const char* kExportScript = "exportedFunc() => 'fancy';";
   TestCase::AddTestLib("test:exportlib", kExportScript);
 
   const char* kScript =
@@ -3064,8 +3060,7 @@
   EXPECT_VALID(lib);
   EXPECT_STREQ("fancy feast", SimpleInvokeStr(lib, "main"));
 
-  const char* kReloadExportScript =
-      "exportedFunc() => 'bossy';";
+  const char* kReloadExportScript = "exportedFunc() => 'bossy';";
   TestCase::AddTestLib("test:exportlib", kReloadExportScript);
 
   const char* kReloadScript =
@@ -3083,6 +3078,343 @@
   EXPECT_STREQ("bossy pants", SimpleInvokeStr(lib, "main"));
 }
 
+
+TEST_CASE(IsolateReload_SimpleConstFieldUpdate) {
+  const char* kScript =
+      "const value = 'a';\n"
+      "main() {\n"
+      "  return 'value=${value}';\n"
+      "}\n";
+
+  Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
+  EXPECT_VALID(lib);
+  EXPECT_STREQ("value=a", SimpleInvokeStr(lib, "main"));
+
+  const char* kReloadScript =
+      "const value = 'b';\n"
+      "main() {\n"
+      "  return 'value=${value}';\n"
+      "}\n";
+
+  lib = TestCase::ReloadTestScript(kReloadScript);
+  EXPECT_VALID(lib);
+  EXPECT_STREQ("value=b", SimpleInvokeStr(lib, "main"));
+}
+
+
+TEST_CASE(IsolateReload_ConstFieldUpdate) {
+  const char* kScript =
+      "const value = const Duration(seconds: 1);\n"
+      "main() {\n"
+      "  return 'value=${value}';\n"
+      "}\n";
+
+  Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
+  EXPECT_VALID(lib);
+  EXPECT_STREQ("value=0:00:01.000000", SimpleInvokeStr(lib, "main"));
+
+  const char* kReloadScript =
+      "const value = const Duration(seconds: 2);\n"
+      "main() {\n"
+      "  return 'value=${value}';\n"
+      "}\n";
+
+  lib = TestCase::ReloadTestScript(kReloadScript);
+  EXPECT_VALID(lib);
+  EXPECT_STREQ("value=0:00:02.000000", SimpleInvokeStr(lib, "main"));
+}
+
+
+TEST_CASE(IsolateReload_RunNewFieldInitializers) {
+  const char* kScript =
+      "class Foo {\n"
+      "  int x = 4;\n"
+      "}\n"
+      "Foo value;\n"
+      "main() {\n"
+      "  value = new Foo();\n"
+      "  return value.x;\n"
+      "}\n";
+
+  Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
+  EXPECT_VALID(lib);
+  EXPECT_EQ(4, SimpleInvoke(lib, "main"));
+
+  // Add the field y.
+  const char* kReloadScript =
+      "class Foo {\n"
+      "  int x = 4;\n"
+      "  int y = 7;\n"
+      "}\n"
+      "Foo value;\n"
+      "main() {\n"
+      "  return value.y;\n"
+      "}\n";
+
+  lib = TestCase::ReloadTestScript(kReloadScript);
+  EXPECT_VALID(lib);
+  // Verify that we ran field initializers on existing instances.
+  EXPECT_EQ(7, SimpleInvoke(lib, "main"));
+}
+
+
+TEST_CASE(IsolateReload_RunNewFieldInitializersReferenceStaticField) {
+  const char* kScript =
+      "int myInitialValue = 8 * 7;\n"
+      "class Foo {\n"
+      "  int x = 4;\n"
+      "}\n"
+      "Foo value;\n"
+      "main() {\n"
+      "  value = new Foo();\n"
+      "  return value.x;\n"
+      "}\n";
+
+  Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
+  EXPECT_VALID(lib);
+  EXPECT_EQ(4, SimpleInvoke(lib, "main"));
+
+  // Add the field y.
+  const char* kReloadScript =
+      "int myInitialValue = 8 * 7;\n"
+      "class Foo {\n"
+      "  int x = 4;\n"
+      "  int y = myInitialValue;\n"
+      "}\n"
+      "Foo value;\n"
+      "main() {\n"
+      "  return value.y;\n"
+      "}\n";
+
+  lib = TestCase::ReloadTestScript(kReloadScript);
+  EXPECT_VALID(lib);
+  // Verify that we ran field initializers on existing instances.
+  EXPECT_EQ(56, SimpleInvoke(lib, "main"));
+}
+
+
+TEST_CASE(IsolateReload_RunNewFieldInitializersMutateStaticField) {
+  const char* kScript =
+      "int myInitialValue = 8 * 7;\n"
+      "class Foo {\n"
+      "  int x = 4;\n"
+      "}\n"
+      "Foo value;\n"
+      "Foo value1;\n"
+      "main() {\n"
+      "  value = new Foo();\n"
+      "  value1 = new Foo();\n"
+      "  return value.x;\n"
+      "}\n";
+
+  Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
+  EXPECT_VALID(lib);
+  EXPECT_EQ(4, SimpleInvoke(lib, "main"));
+
+  // Add the field y.
+  const char* kReloadScript =
+      "int myInitialValue = 8 * 7;\n"
+      "class Foo {\n"
+      "  int x = 4;\n"
+      "  int y = myInitialValue++;\n"
+      "}\n"
+      "Foo value;\n"
+      "Foo value1;\n"
+      "main() {\n"
+      "  return myInitialValue;\n"
+      "}\n";
+
+  lib = TestCase::ReloadTestScript(kReloadScript);
+  EXPECT_VALID(lib);
+  // Verify that we ran field initializers on existing instances and that
+  // they affected the value of the field myInitialValue.
+  EXPECT_EQ(58, SimpleInvoke(lib, "main"));
+}
+
+
+// When an initializer expression throws, we leave the field as null.
+TEST_CASE(IsolateReload_RunNewFieldInitializersThrows) {
+  const char* kScript =
+      "class Foo {\n"
+      "  int x = 4;\n"
+      "}\n"
+      "Foo value;\n"
+      "main() {\n"
+      "  value = new Foo();\n"
+      "  return value.x;\n"
+      "}\n";
+
+  Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
+  EXPECT_VALID(lib);
+  EXPECT_EQ(4, SimpleInvoke(lib, "main"));
+
+  // Add the field y.
+  const char* kReloadScript =
+      "class Foo {\n"
+      "  int x = 4;\n"
+      "  int y = throw 'a';\n"
+      "}\n"
+      "Foo value;\n"
+      "main() {\n"
+      "  return '${value.y == null}';"
+      "}\n";
+
+  lib = TestCase::ReloadTestScript(kReloadScript);
+  EXPECT_VALID(lib);
+  // Verify that we ran field initializers on existing instances.
+  EXPECT_STREQ("true", SimpleInvokeStr(lib, "main"));
+}
+
+
+// When an initializer expression has a syntax error, we detect it at reload
+// time.
+TEST_CASE(IsolateReload_RunNewFieldInitializersSyntaxError) {
+  const char* kScript =
+      "class Foo {\n"
+      "  int x = 4;\n"
+      "}\n"
+      "Foo value;\n"
+      "main() {\n"
+      "  value = new Foo();\n"
+      "  return value.x;\n"
+      "}\n";
+
+  Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
+  EXPECT_VALID(lib);
+  EXPECT_EQ(4, SimpleInvoke(lib, "main"));
+
+  // Add the field y with a syntax error in the initializing expression.
+  const char* kReloadScript =
+      "class Foo {\n"
+      "  int x = 4;\n"
+      "  int y = ......;\n"
+      "}\n"
+      "Foo value;\n"
+      "main() {\n"
+      "  return '${value.y == null}';"
+      "}\n";
+
+  // The reload fails because the initializing expression is parsed at
+  // class finalization time.
+  lib = TestCase::ReloadTestScript(kReloadScript);
+  EXPECT_ERROR(lib, "......");
+}
+
+
+// When an initializer expression has a syntax error, we detect it at reload
+// time.
+TEST_CASE(IsolateReload_RunNewFieldInitializersSyntaxError2) {
+  const char* kScript =
+      "class Foo {\n"
+      "  Foo() { /* default constructor */ }\n"
+      "  int x = 4;\n"
+      "}\n"
+      "Foo value;\n"
+      "main() {\n"
+      "  value = new Foo();\n"
+      "  return value.x;\n"
+      "}\n";
+
+  Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
+  EXPECT_VALID(lib);
+  EXPECT_EQ(4, SimpleInvoke(lib, "main"));
+
+  // Add the field y with a syntax error in the initializing expression.
+  const char* kReloadScript =
+      "class Foo {\n"
+      "  Foo() { /* default constructor */ }\n"
+      "  int x = 4;\n"
+      "  int y = ......;\n"
+      "}\n"
+      "Foo value;\n"
+      "main() {\n"
+      "  return '${value.y == null}';"
+      "}\n";
+
+  // The reload fails because the initializing expression is parsed at
+  // class finalization time.
+  lib = TestCase::ReloadTestScript(kReloadScript);
+  EXPECT_ERROR(lib, "......");
+}
+
+
+// When an initializer expression has a syntax error, we detect it at reload
+// time.
+TEST_CASE(IsolateReload_RunNewFieldInitializersSyntaxError3) {
+  const char* kScript =
+      "class Foo {\n"
+      "  Foo() { /* default constructor */ }\n"
+      "  int x = 4;\n"
+      "}\n"
+      "Foo value;\n"
+      "main() {\n"
+      "  value = new Foo();\n"
+      "  return value.x;\n"
+      "}\n";
+
+  Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
+  EXPECT_VALID(lib);
+  EXPECT_EQ(4, SimpleInvoke(lib, "main"));
+
+  // Add the field y with a syntax error in the initializing expression.
+  const char* kReloadScript =
+      "class Foo {\n"
+      "  Foo() { /* default constructor */ }\n"
+      "  int x = 4;\n"
+      "  int y = ......\n"
+      "}\n"
+      "Foo value;\n"
+      "main() {\n"
+      "  return '${value.y == null}';"
+      "}\n";
+
+  // The reload fails because the initializing expression is parsed at
+  // class finalization time.
+  lib = TestCase::ReloadTestScript(kReloadScript);
+  EXPECT_ERROR(lib, "......");
+}
+
+
+TEST_CASE(IsolateREload_RunNewFieldInitialiazersSuperClass) {
+  const char* kScript =
+      "class Super {\n"
+      "  static var foo = 'right';\n"
+      "}\n"
+      "class Foo extends Super {\n"
+      "  static var foo = 'wrong';\n"
+      "}\n"
+      "Foo value;\n"
+      "main() {\n"
+      "  Super.foo;\n"
+      "  Foo.foo;\n"
+      "  value = new Foo();\n"
+      "  return 0;\n"
+      "}\n";
+
+  Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
+  EXPECT_VALID(lib);
+  EXPECT_EQ(0, SimpleInvoke(lib, "main"));
+
+  const char* kReloadScript =
+      "class Super {\n"
+      "  static var foo = 'right';\n"
+      "  var newField = foo;\n"
+      "}\n"
+      "class Foo extends Super {\n"
+      "  static var foo = 'wrong';\n"
+      "}\n"
+      "Foo value;\n"
+      "main() {\n"
+      "  return value.newField;\n"
+      "}\n";
+
+  lib = TestCase::ReloadTestScript(kReloadScript);
+  EXPECT_VALID(lib);
+  // Verify that we ran field initializers on existing instances in the
+  // correct scope.
+  EXPECT_STREQ("right", SimpleInvokeStr(lib, "main"));
+}
+
 #endif  // !PRODUCT
 
 }  // namespace dart
diff --git a/runtime/vm/isolate_test.cc b/runtime/vm/isolate_test.cc
index 4e39113..5e71ed7 100644
--- a/runtime/vm/isolate_test.cc
+++ b/runtime/vm/isolate_test.cc
@@ -49,9 +49,8 @@
   Dart_Handle internal_lib = Dart_LookupLibrary(url);
   DART_CHECK_VALID(internal_lib);
   Dart_Handle print = Dart_GetField(test_lib, NewString("_nullPrintClosure"));
-  Dart_Handle result = Dart_SetField(internal_lib,
-                                     NewString("_printClosure"),
-                                     print);
+  Dart_Handle result =
+      Dart_SetField(internal_lib, NewString("_printClosure"), print);
 
   DART_CHECK_VALID(result);
 
@@ -60,9 +59,8 @@
   DART_CHECK_VALID(url);
   Dart_Handle isolate_lib = Dart_LookupLibrary(url);
   DART_CHECK_VALID(isolate_lib);
-  Dart_Handle schedule_immediate_closure =
-      Dart_Invoke(isolate_lib, NewString("_getIsolateScheduleImmediateClosure"),
-                  0, NULL);
+  Dart_Handle schedule_immediate_closure = Dart_Invoke(
+      isolate_lib, NewString("_getIsolateScheduleImmediateClosure"), 0, NULL);
   Dart_Handle args[1];
   args[0] = schedule_immediate_closure;
   url = NewString("dart:async");
@@ -90,9 +88,7 @@
   static const intptr_t kIterations;
 
   InterruptChecker(Thread* thread, ThreadBarrier* barrier)
-    : thread_(thread),
-      barrier_(barrier) {
-  }
+      : thread_(thread), barrier_(barrier) {}
 
   virtual void Run() {
     Thread::EnterIsolateAsHelper(thread_->isolate(), Thread::kUnknownTask);
@@ -104,9 +100,9 @@
       do {
         limit = AtomicOperations::LoadRelaxed(
             reinterpret_cast<uword*>(thread_->stack_limit_address()));
-      } while ((limit == thread_->saved_stack_limit_) ||
-               (((limit & Thread::kInterruptsMask) &
-                 Thread::kVMInterrupt) == 0));
+      } while (
+          (limit == thread_->saved_stack_limit_) ||
+          (((limit & Thread::kInterruptsMask) & Thread::kVMInterrupt) == 0));
       // Tell main thread that we observed the interrupt.
       barrier_->Sync();
     }
@@ -157,9 +153,7 @@
 
 class IsolateTestHelper {
  public:
-  static uword GetStackLimit(Thread* thread) {
-    return thread->stack_limit_;
-  }
+  static uword GetStackLimit(Thread* thread) { return thread->stack_limit_; }
   static uword GetSavedStackLimit(Thread* thread) {
     return thread->saved_stack_limit_;
   }
diff --git a/runtime/vm/jit_optimizer.cc b/runtime/vm/jit_optimizer.cc
index 00f1588..ff691b0 100644
--- a/runtime/vm/jit_optimizer.cc
+++ b/runtime/vm/jit_optimizer.cc
@@ -1,7 +1,7 @@
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
-
+#ifndef DART_PRECOMPILED_RUNTIME
 #include "vm/jit_optimizer.h"
 
 #include "vm/bit_vector.h"
@@ -61,8 +61,7 @@
 void JitOptimizer::ApplyClassIds() {
   ASSERT(current_iterator_ == NULL);
   for (BlockIterator block_it = flow_graph_->reverse_postorder_iterator();
-       !block_it.Done();
-       block_it.Advance()) {
+       !block_it.Done(); block_it.Advance()) {
     ForwardInstructionIterator it(block_it.Current());
     current_iterator_ = &it;
     for (; !it.Done(); it.Advance()) {
@@ -105,8 +104,7 @@
 
   const Token::Kind op_kind = call->token_kind();
   if (Token::IsRelationalOperator(op_kind) ||
-      Token::IsEqualityOperator(op_kind) ||
-      Token::IsBinaryOperator(op_kind)) {
+      Token::IsEqualityOperator(op_kind) || Token::IsBinaryOperator(op_kind)) {
     // Guess cid: if one of the inputs is a number assume that the other
     // is a number of same type.
     if (FLAG_guess_icdata_cid) {
@@ -130,24 +128,22 @@
   }
 
   if (all_cids_known) {
-    const Class& receiver_class = Class::Handle(Z,
-        isolate()->class_table()->At(class_ids[0]));
+    const Class& receiver_class =
+        Class::Handle(Z, isolate()->class_table()->At(class_ids[0]));
     if (!receiver_class.is_finalized()) {
       // Do not eagerly finalize classes. ResolveDynamicForReceiverClass can
       // cause class finalization, since callee's receiver class may not be
       // finalized yet.
       return false;
     }
-    const Array& args_desc_array = Array::Handle(Z,
-        ArgumentsDescriptor::New(call->ArgumentCount(),
-                                 call->argument_names()));
+    const Array& args_desc_array =
+        Array::Handle(Z, ArgumentsDescriptor::New(call->ArgumentCount(),
+                                                  call->argument_names()));
     ArgumentsDescriptor args_desc(args_desc_array);
-    const Function& function = Function::Handle(Z,
-        Resolver::ResolveDynamicForReceiverClass(
-            receiver_class,
-            call->function_name(),
-            args_desc,
-            false /* allow add */));
+    const Function& function =
+        Function::Handle(Z, Resolver::ResolveDynamicForReceiverClass(
+                                receiver_class, call->function_name(),
+                                args_desc, false /* allow add */));
     if (function.IsNull()) {
       return false;
     }
@@ -156,8 +152,8 @@
     // since it is attached to the assembly instruction itself.
     // TODO(srdjan): Prevent modification of ICData object that is
     // referenced in assembly code.
-    const ICData& ic_data = ICData::ZoneHandle(Z,
-        ICData::NewFrom(*call->ic_data(), class_ids.length()));
+    const ICData& ic_data = ICData::ZoneHandle(
+        Z, ICData::NewFrom(*call->ic_data(), class_ids.length()));
     if (class_ids.length() > 1) {
       ic_data.AddCheck(class_ids, function);
     } else {
@@ -169,25 +165,22 @@
   }
 
   // Check if getter or setter in function's class and class is currently leaf.
-  if (FLAG_guess_icdata_cid &&
-      ((call->token_kind() == Token::kGET) ||
-          (call->token_kind() == Token::kSET))) {
+  if (FLAG_guess_icdata_cid && ((call->token_kind() == Token::kGET) ||
+                                (call->token_kind() == Token::kSET))) {
     const Class& owner_class = Class::Handle(Z, function().Owner());
-    if (!owner_class.is_abstract() &&
-        !CHA::HasSubclasses(owner_class) &&
+    if (!owner_class.is_abstract() && !CHA::HasSubclasses(owner_class) &&
         !CHA::IsImplemented(owner_class)) {
-      const Array& args_desc_array = Array::Handle(Z,
-          ArgumentsDescriptor::New(call->ArgumentCount(),
-                                   call->argument_names()));
+      const Array& args_desc_array =
+          Array::Handle(Z, ArgumentsDescriptor::New(call->ArgumentCount(),
+                                                    call->argument_names()));
       ArgumentsDescriptor args_desc(args_desc_array);
-      const Function& function = Function::Handle(Z,
-          Resolver::ResolveDynamicForReceiverClass(owner_class,
-                                                   call->function_name(),
-                                                   args_desc,
-                                                   false /* allow_add */));
+      const Function& function =
+          Function::Handle(Z, Resolver::ResolveDynamicForReceiverClass(
+                                  owner_class, call->function_name(), args_desc,
+                                  false /* allow_add */));
       if (!function.IsNull()) {
-        const ICData& ic_data = ICData::ZoneHandle(Z,
-            ICData::NewFrom(*call->ic_data(), class_ids.length()));
+        const ICData& ic_data = ICData::ZoneHandle(
+            Z, ICData::NewFrom(*call->ic_data(), class_ids.length()));
         ic_data.AddReceiverCheck(owner_class.id(), function);
         call->set_ic_data(&ic_data);
         return true;
@@ -212,13 +205,11 @@
   // TODO(fschneider): Try looking up the function on the class if it is
   // not found in the ICData.
   if (!function.IsNull()) {
-    const ICData& new_ic_data = ICData::ZoneHandle(Z, ICData::New(
-        Function::Handle(Z, ic_data.Owner()),
-        String::Handle(Z, ic_data.target_name()),
-        Object::empty_array(),  // Dummy argument descriptor.
-        ic_data.deopt_id(),
-        ic_data.NumArgsTested(),
-        false));
+    const ICData& new_ic_data = ICData::ZoneHandle(
+        Z, ICData::New(Function::Handle(Z, ic_data.Owner()),
+                       String::Handle(Z, ic_data.target_name()),
+                       Object::empty_array(),  // Dummy argument descriptor.
+                       ic_data.deopt_id(), ic_data.NumArgsTested(), false));
     new_ic_data.SetDeoptReasons(ic_data.DeoptReasons());
     new_ic_data.AddReceiverCheck(cid, function);
     return new_ic_data;
@@ -253,10 +244,8 @@
   const bool with_checks = false;
   const bool complete = false;
   PolymorphicInstanceCallInstr* specialized =
-      new(Z) PolymorphicInstanceCallInstr(call->instance_call(),
-                                          ic_data,
-                                          with_checks,
-                                          complete);
+      new (Z) PolymorphicInstanceCallInstr(call->instance_call(), ic_data,
+                                           with_checks, complete);
   call->ReplaceWith(specialized, current_iterator());
 }
 
@@ -321,19 +310,19 @@
 
 
 static bool HasOnlyOneSmi(const ICData& ic_data) {
-  return (ic_data.NumberOfUsedChecks() == 1)
-      && ic_data.HasReceiverClassId(kSmiCid);
+  return (ic_data.NumberOfUsedChecks() == 1) &&
+         ic_data.HasReceiverClassId(kSmiCid);
 }
 
 
 static bool HasOnlySmiOrMint(const ICData& ic_data) {
   if (ic_data.NumberOfUsedChecks() == 1) {
-    return ic_data.HasReceiverClassId(kSmiCid)
-        || ic_data.HasReceiverClassId(kMintCid);
+    return ic_data.HasReceiverClassId(kSmiCid) ||
+           ic_data.HasReceiverClassId(kMintCid);
   }
-  return (ic_data.NumberOfUsedChecks() == 2)
-      && ic_data.HasReceiverClassId(kSmiCid)
-      && ic_data.HasReceiverClassId(kMintCid);
+  return (ic_data.NumberOfUsedChecks() == 2) &&
+         ic_data.HasReceiverClassId(kSmiCid) &&
+         ic_data.HasReceiverClassId(kMintCid);
 }
 
 
@@ -376,8 +365,8 @@
 
 
 static bool HasOnlyOneDouble(const ICData& ic_data) {
-  return (ic_data.NumberOfUsedChecks() == 1)
-      && ic_data.HasReceiverClassId(kDoubleCid);
+  return (ic_data.NumberOfUsedChecks() == 1) &&
+         ic_data.HasReceiverClassId(kDoubleCid);
 }
 
 
@@ -397,8 +386,7 @@
 }
 
 
-void JitOptimizer::ReplaceCall(Definition* call,
-                               Definition* replacement) {
+void JitOptimizer::ReplaceCall(Definition* call, Definition* replacement) {
   // Remove the original push arguments.
   for (intptr_t i = 0; i < call->ArgumentCount(); ++i) {
     PushArgumentInstr* push = call->PushArgumentAt(i);
@@ -415,11 +403,9 @@
                                Instruction* insert_before) {
   if (to_check->Type()->ToCid() != kSmiCid) {
     InsertBefore(insert_before,
-                 new(Z) CheckSmiInstr(new(Z) Value(to_check),
-                                      deopt_id,
-                                      insert_before->token_pos()),
-                 deopt_environment,
-                 FlowGraph::kEffect);
+                 new (Z) CheckSmiInstr(new (Z) Value(to_check), deopt_id,
+                                       insert_before->token_pos()),
+                 deopt_environment, FlowGraph::kEffect);
   }
 }
 
@@ -430,12 +416,10 @@
                                          TokenPosition token_pos) {
   if ((unary_checks.NumberOfUsedChecks() == 1) &&
       unary_checks.HasReceiverClassId(kSmiCid)) {
-    return new(Z) CheckSmiInstr(new(Z) Value(to_check),
-                                deopt_id,
-                                token_pos);
+    return new (Z) CheckSmiInstr(new (Z) Value(to_check), deopt_id, token_pos);
   }
-  return new(Z) CheckClassInstr(
-      new(Z) Value(to_check), deopt_id, unary_checks, token_pos);
+  return new (Z) CheckClassInstr(new (Z) Value(to_check), deopt_id,
+                                 unary_checks, token_pos);
 }
 
 
@@ -445,8 +429,8 @@
                                  Environment* deopt_environment,
                                  Instruction* insert_before) {
   // Type propagation has not run yet, we cannot eliminate the check.
-  Instruction* check = GetCheckClass(
-      to_check, unary_checks, deopt_id, insert_before->token_pos());
+  Instruction* check = GetCheckClass(to_check, unary_checks, deopt_id,
+                                     insert_before->token_pos());
   InsertBefore(insert_before, check, deopt_environment, FlowGraph::kEffect);
 }
 
@@ -454,9 +438,7 @@
 void JitOptimizer::AddReceiverCheck(InstanceCallInstr* call) {
   AddCheckClass(call->ArgumentAt(0),
                 ICData::ZoneHandle(Z, call->ic_data()->AsUnaryClassChecks()),
-                call->deopt_id(),
-                call->env(),
-                call);
+                call->deopt_id(), call->env(), call);
 }
 
 
@@ -534,12 +516,12 @@
       ASSERT(str.Length() == 1);
       ConstantInstr* char_code_left = flow_graph()->GetConstant(
           Smi::ZoneHandle(Z, Smi::New(static_cast<intptr_t>(str.CharAt(0)))));
-      left_val = new(Z) Value(char_code_left);
+      left_val = new (Z) Value(char_code_left);
     } else if (left->IsOneByteStringFromCharCode()) {
       // Use input of string-from-charcode as left value.
       OneByteStringFromCharCodeInstr* instr =
           left->AsOneByteStringFromCharCode();
-      left_val = new(Z) Value(instr->char_code()->definition());
+      left_val = new (Z) Value(instr->char_code()->definition());
       to_remove_left = instr;
     } else {
       // IsLengthOneString(left) should have been false.
@@ -552,32 +534,24 @@
       // Skip string-from-char-code, and use its input as right value.
       OneByteStringFromCharCodeInstr* right_instr =
           right->AsOneByteStringFromCharCode();
-      right_val = new(Z) Value(right_instr->char_code()->definition());
+      right_val = new (Z) Value(right_instr->char_code()->definition());
       to_remove_right = right_instr;
     } else {
       const ICData& unary_checks_1 =
           ICData::ZoneHandle(Z, call->ic_data()->AsUnaryClassChecksForArgNr(1));
-      AddCheckClass(right,
-                    unary_checks_1,
-                    call->deopt_id(),
-                    call->env(),
-                    call);
+      AddCheckClass(right, unary_checks_1, call->deopt_id(), call->env(), call);
       // String-to-char-code instructions returns -1 (illegal charcode) if
       // string is not of length one.
-      StringToCharCodeInstr* char_code_right =
-          new(Z) StringToCharCodeInstr(new(Z) Value(right), kOneByteStringCid);
+      StringToCharCodeInstr* char_code_right = new (Z)
+          StringToCharCodeInstr(new (Z) Value(right), kOneByteStringCid);
       InsertBefore(call, char_code_right, call->env(), FlowGraph::kValue);
-      right_val = new(Z) Value(char_code_right);
+      right_val = new (Z) Value(char_code_right);
     }
 
     // Comparing char-codes instead of strings.
     EqualityCompareInstr* comp =
-        new(Z) EqualityCompareInstr(call->token_pos(),
-                                    op_kind,
-                                    left_val,
-                                    right_val,
-                                    kSmiCid,
-                                    call->deopt_id());
+        new (Z) EqualityCompareInstr(call->token_pos(), op_kind, left_val,
+                                     right_val, kSmiCid, call->deopt_id());
     ReplaceCall(call, comp);
 
     // Remove dead instructions.
@@ -597,7 +571,9 @@
 }
 
 
-static bool SmiFitsInDouble() { return kSmiBits < 53; }
+static bool SmiFitsInDouble() {
+  return kSmiBits < 53;
+}
 
 bool JitOptimizer::TryReplaceWithEqualityOp(InstanceCallInstr* call,
                                             Token::Kind op_kind) {
@@ -617,17 +593,13 @@
     }
   } else if (HasOnlyTwoOf(ic_data, kSmiCid)) {
     InsertBefore(call,
-                 new(Z) CheckSmiInstr(new(Z) Value(left),
-                                      call->deopt_id(),
-                                      call->token_pos()),
-                 call->env(),
-                 FlowGraph::kEffect);
+                 new (Z) CheckSmiInstr(new (Z) Value(left), call->deopt_id(),
+                                       call->token_pos()),
+                 call->env(), FlowGraph::kEffect);
     InsertBefore(call,
-                 new(Z) CheckSmiInstr(new(Z) Value(right),
-                                      call->deopt_id(),
-                                      call->token_pos()),
-                 call->env(),
-                 FlowGraph::kEffect);
+                 new (Z) CheckSmiInstr(new (Z) Value(right), call->deopt_id(),
+                                       call->token_pos()),
+                 call->env(), FlowGraph::kEffect);
     cid = kSmiCid;
   } else if (HasTwoMintOrSmi(ic_data) &&
              FlowGraphCompiler::SupportsUnboxedMints()) {
@@ -642,13 +614,10 @@
         // call.
         return false;
       } else {
-        InsertBefore(call,
-                     new(Z) CheckEitherNonSmiInstr(
-                         new(Z) Value(left),
-                         new(Z) Value(right),
-                         call->deopt_id()),
-                     call->env(),
-                     FlowGraph::kEffect);
+        InsertBefore(call, new (Z) CheckEitherNonSmiInstr(new (Z) Value(left),
+                                                          new (Z) Value(right),
+                                                          call->deopt_id()),
+                     call->env(), FlowGraph::kEffect);
         cid = kDoubleCid;
       }
     }
@@ -659,24 +628,15 @@
     GrowableArray<intptr_t> smi_or_null(2);
     smi_or_null.Add(kSmiCid);
     smi_or_null.Add(kNullCid);
-    if (ICDataHasOnlyReceiverArgumentClassIds(ic_data,
-                                              smi_or_null,
+    if (ICDataHasOnlyReceiverArgumentClassIds(ic_data, smi_or_null,
                                               smi_or_null)) {
       const ICData& unary_checks_0 =
           ICData::ZoneHandle(Z, call->ic_data()->AsUnaryClassChecks());
-      AddCheckClass(left,
-                    unary_checks_0,
-                    call->deopt_id(),
-                    call->env(),
-                    call);
+      AddCheckClass(left, unary_checks_0, call->deopt_id(), call->env(), call);
 
       const ICData& unary_checks_1 =
           ICData::ZoneHandle(Z, call->ic_data()->AsUnaryClassChecksForArgNr(1));
-      AddCheckClass(right,
-                    unary_checks_1,
-                    call->deopt_id(),
-                    call->env(),
-                    call);
+      AddCheckClass(right, unary_checks_1, call->deopt_id(), call->env(), call);
       cid = kSmiCid;
     } else {
       // Shortcut for equality with null.
@@ -684,12 +644,10 @@
       ConstantInstr* left_const = left->AsConstant();
       if ((right_const != NULL && right_const->value().IsNull()) ||
           (left_const != NULL && left_const->value().IsNull())) {
-        StrictCompareInstr* comp =
-            new(Z) StrictCompareInstr(call->token_pos(),
-                                      Token::kEQ_STRICT,
-                                      new(Z) Value(left),
-                                      new(Z) Value(right),
-                                      false);  // No number check.
+        StrictCompareInstr* comp = new (Z)
+            StrictCompareInstr(call->token_pos(), Token::kEQ_STRICT,
+                               new (Z) Value(left), new (Z) Value(right),
+                               false);  // No number check.
         ReplaceCall(call, comp);
         return true;
       }
@@ -697,12 +655,9 @@
     }
   }
   ASSERT(cid != kIllegalCid);
-  EqualityCompareInstr* comp = new(Z) EqualityCompareInstr(call->token_pos(),
-                                                           op_kind,
-                                                           new(Z) Value(left),
-                                                           new(Z) Value(right),
-                                                           cid,
-                                                           call->deopt_id());
+  EqualityCompareInstr* comp = new (Z)
+      EqualityCompareInstr(call->token_pos(), op_kind, new (Z) Value(left),
+                           new (Z) Value(right), cid, call->deopt_id());
   ReplaceCall(call, comp);
   return true;
 }
@@ -720,17 +675,13 @@
   intptr_t cid = kIllegalCid;
   if (HasOnlyTwoOf(ic_data, kSmiCid)) {
     InsertBefore(call,
-                 new(Z) CheckSmiInstr(new(Z) Value(left),
-                                      call->deopt_id(),
-                                      call->token_pos()),
-                 call->env(),
-                 FlowGraph::kEffect);
+                 new (Z) CheckSmiInstr(new (Z) Value(left), call->deopt_id(),
+                                       call->token_pos()),
+                 call->env(), FlowGraph::kEffect);
     InsertBefore(call,
-                 new(Z) CheckSmiInstr(new(Z) Value(right),
-                                      call->deopt_id(),
-                                      call->token_pos()),
-                 call->env(),
-                 FlowGraph::kEffect);
+                 new (Z) CheckSmiInstr(new (Z) Value(right), call->deopt_id(),
+                                       call->token_pos()),
+                 call->env(), FlowGraph::kEffect);
     cid = kSmiCid;
   } else if (HasTwoMintOrSmi(ic_data) &&
              FlowGraphCompiler::SupportsUnboxedMints()) {
@@ -745,13 +696,10 @@
         // call.
         return false;
       } else {
-        InsertBefore(call,
-                     new(Z) CheckEitherNonSmiInstr(
-                         new(Z) Value(left),
-                         new(Z) Value(right),
-                         call->deopt_id()),
-                     call->env(),
-                     FlowGraph::kEffect);
+        InsertBefore(call, new (Z) CheckEitherNonSmiInstr(new (Z) Value(left),
+                                                          new (Z) Value(right),
+                                                          call->deopt_id()),
+                     call->env(), FlowGraph::kEffect);
         cid = kDoubleCid;
       }
     }
@@ -759,12 +707,9 @@
     return false;
   }
   ASSERT(cid != kIllegalCid);
-  RelationalOpInstr* comp = new(Z) RelationalOpInstr(call->token_pos(),
-                                                     op_kind,
-                                                     new(Z) Value(left),
-                                                     new(Z) Value(right),
-                                                     cid,
-                                                     call->deopt_id());
+  RelationalOpInstr* comp =
+      new (Z) RelationalOpInstr(call->token_pos(), op_kind, new (Z) Value(left),
+                                new (Z) Value(right), cid, call->deopt_id());
   ReplaceCall(call, comp);
   return true;
 }
@@ -783,8 +728,8 @@
         // Don't generate smi code if the IC data is marked because
         // of an overflow.
         operands_type = ic_data.HasDeoptReason(ICData::kDeoptBinarySmiOp)
-            ? kMintCid
-            : kSmiCid;
+                            ? kMintCid
+                            : kSmiCid;
       } else if (HasTwoMintOrSmi(ic_data) &&
                  FlowGraphCompiler::SupportsUnboxedMints()) {
         // Don't generate mint code if the IC data is marked because of an
@@ -840,11 +785,11 @@
           return false;
         }
         operands_type = ic_data.HasDeoptReason(ICData::kDeoptBinarySmiOp)
-            ? kMintCid
-            : kSmiCid;
+                            ? kMintCid
+                            : kSmiCid;
       } else if (HasTwoMintOrSmi(ic_data) &&
-                 HasOnlyOneSmi(ICData::Handle(Z,
-                     ic_data.AsUnaryClassChecksForArgNr(1)))) {
+                 HasOnlyOneSmi(ICData::Handle(
+                     Z, ic_data.AsUnaryClassChecksForArgNr(1)))) {
         // Don't generate mint code if the IC data is marked because of an
         // overflow.
         if (ic_data.HasDeoptReason(ICData::kDeoptBinaryMintOp)) {
@@ -883,34 +828,25 @@
     // binary operation with two smis is a smi not a double, except '/' which
     // returns a double for two smis.
     if (op_kind != Token::kDIV) {
-      InsertBefore(call,
-                   new(Z) CheckEitherNonSmiInstr(
-                       new(Z) Value(left),
-                       new(Z) Value(right),
-                       call->deopt_id()),
-                   call->env(),
-                   FlowGraph::kEffect);
+      InsertBefore(call, new (Z) CheckEitherNonSmiInstr(new (Z) Value(left),
+                                                        new (Z) Value(right),
+                                                        call->deopt_id()),
+                   call->env(), FlowGraph::kEffect);
     }
 
-    BinaryDoubleOpInstr* double_bin_op =
-        new(Z) BinaryDoubleOpInstr(op_kind,
-                                   new(Z) Value(left),
-                                   new(Z) Value(right),
-                                   call->deopt_id(), call->token_pos());
+    BinaryDoubleOpInstr* double_bin_op = new (Z)
+        BinaryDoubleOpInstr(op_kind, new (Z) Value(left), new (Z) Value(right),
+                            call->deopt_id(), call->token_pos());
     ReplaceCall(call, double_bin_op);
   } else if (operands_type == kMintCid) {
     if (!FlowGraphCompiler::SupportsUnboxedMints()) return false;
     if ((op_kind == Token::kSHR) || (op_kind == Token::kSHL)) {
-      ShiftMintOpInstr* shift_op =
-          new(Z) ShiftMintOpInstr(
-              op_kind, new(Z) Value(left), new(Z) Value(right),
-              call->deopt_id());
+      ShiftMintOpInstr* shift_op = new (Z) ShiftMintOpInstr(
+          op_kind, new (Z) Value(left), new (Z) Value(right), call->deopt_id());
       ReplaceCall(call, shift_op);
     } else {
-      BinaryMintOpInstr* bin_op =
-          new(Z) BinaryMintOpInstr(
-              op_kind, new(Z) Value(left), new(Z) Value(right),
-              call->deopt_id());
+      BinaryMintOpInstr* bin_op = new (Z) BinaryMintOpInstr(
+          op_kind, new (Z) Value(left), new (Z) Value(right), call->deopt_id());
       ReplaceCall(call, bin_op);
     }
   } else if (operands_type == kFloat32x4Cid) {
@@ -927,19 +863,14 @@
         // Insert smi check and attach a copy of the original environment
         // because the smi operation can still deoptimize.
         InsertBefore(call,
-                     new(Z) CheckSmiInstr(new(Z) Value(left),
-                                          call->deopt_id(),
-                                          call->token_pos()),
-                     call->env(),
-                     FlowGraph::kEffect);
-        ConstantInstr* constant =
-            flow_graph()->GetConstant(Smi::Handle(Z,
-                Smi::New(Smi::Cast(obj).Value() - 1)));
+                     new (Z) CheckSmiInstr(new (Z) Value(left),
+                                           call->deopt_id(), call->token_pos()),
+                     call->env(), FlowGraph::kEffect);
+        ConstantInstr* constant = flow_graph()->GetConstant(
+            Smi::Handle(Z, Smi::New(Smi::Cast(obj).Value() - 1)));
         BinarySmiOpInstr* bin_op =
-            new(Z) BinarySmiOpInstr(Token::kBIT_AND,
-                                    new(Z) Value(left),
-                                    new(Z) Value(constant),
-                                    call->deopt_id());
+            new (Z) BinarySmiOpInstr(Token::kBIT_AND, new (Z) Value(left),
+                                     new (Z) Value(constant), call->deopt_id());
         ReplaceCall(call, bin_op);
         return true;
       }
@@ -948,11 +879,8 @@
     // environment because the smi operation can still deoptimize.
     AddCheckSmi(left, call->deopt_id(), call->env(), call);
     AddCheckSmi(right, call->deopt_id(), call->env(), call);
-    BinarySmiOpInstr* bin_op =
-        new(Z) BinarySmiOpInstr(op_kind,
-                                new(Z) Value(left),
-                                new(Z) Value(right),
-                                call->deopt_id());
+    BinarySmiOpInstr* bin_op = new (Z) BinarySmiOpInstr(
+        op_kind, new (Z) Value(left), new (Z) Value(right), call->deopt_id());
     ReplaceCall(call, bin_op);
   } else {
     ASSERT(operands_type == kSmiCid);
@@ -967,12 +895,8 @@
       left = right;
       right = temp;
     }
-    BinarySmiOpInstr* bin_op =
-        new(Z) BinarySmiOpInstr(
-            op_kind,
-            new(Z) Value(left),
-            new(Z) Value(right),
-            call->deopt_id());
+    BinarySmiOpInstr* bin_op = new (Z) BinarySmiOpInstr(
+        op_kind, new (Z) Value(left), new (Z) Value(right), call->deopt_id());
     ReplaceCall(call, bin_op);
   }
   return true;
@@ -986,24 +910,21 @@
   Definition* unary_op = NULL;
   if (HasOnlyOneSmi(*call->ic_data())) {
     InsertBefore(call,
-                 new(Z) CheckSmiInstr(new(Z) Value(input),
-                                      call->deopt_id(),
-                                      call->token_pos()),
-                 call->env(),
-                 FlowGraph::kEffect);
-    unary_op = new(Z) UnarySmiOpInstr(
-        op_kind, new(Z) Value(input), call->deopt_id());
+                 new (Z) CheckSmiInstr(new (Z) Value(input), call->deopt_id(),
+                                       call->token_pos()),
+                 call->env(), FlowGraph::kEffect);
+    unary_op = new (Z)
+        UnarySmiOpInstr(op_kind, new (Z) Value(input), call->deopt_id());
   } else if ((op_kind == Token::kBIT_NOT) &&
              HasOnlySmiOrMint(*call->ic_data()) &&
              FlowGraphCompiler::SupportsUnboxedMints()) {
-    unary_op = new(Z) UnaryMintOpInstr(
-        op_kind, new(Z) Value(input), call->deopt_id());
+    unary_op = new (Z)
+        UnaryMintOpInstr(op_kind, new (Z) Value(input), call->deopt_id());
   } else if (HasOnlyOneDouble(*call->ic_data()) &&
-             (op_kind == Token::kNEGATE) &&
-             CanUnboxDouble()) {
+             (op_kind == Token::kNEGATE) && CanUnboxDouble()) {
     AddReceiverCheck(call);
-    unary_op = new(Z) UnaryDoubleOpInstr(
-        Token::kNEGATE, new(Z) Value(input), call->deopt_id());
+    unary_op = new (Z) UnaryDoubleOpInstr(Token::kNEGATE, new (Z) Value(input),
+                                          call->deopt_id());
   } else {
     return false;
   }
@@ -1014,8 +935,7 @@
 
 
 // Using field class.
-RawField* JitOptimizer::GetField(intptr_t class_id,
-                                 const String& field_name) {
+RawField* JitOptimizer::GetField(intptr_t class_id, const String& field_name) {
   Class& cls = Class::Handle(Z, isolate()->class_table()->At(class_id));
   Field& field = Field::Handle(Z);
   while (!cls.IsNull()) {
@@ -1044,19 +964,16 @@
   // Inline implicit instance getter.
   const String& field_name =
       String::Handle(Z, Field::NameFromGetter(call->function_name()));
-  const Field& field =
-      Field::ZoneHandle(Z, GetField(class_ids[0], field_name));
+  const Field& field = Field::ZoneHandle(Z, GetField(class_ids[0], field_name));
   ASSERT(!field.IsNull());
 
-  if (flow_graph()->InstanceCallNeedsClassCheck(
-          call, RawFunction::kImplicitGetter)) {
+  if (flow_graph()->InstanceCallNeedsClassCheck(call,
+                                                RawFunction::kImplicitGetter)) {
     AddReceiverCheck(call);
   }
-  LoadFieldInstr* load = new(Z) LoadFieldInstr(
-      new(Z) Value(call->ArgumentAt(0)),
-      &field,
-      AbstractType::ZoneHandle(Z, field.type()),
-      call->token_pos());
+  LoadFieldInstr* load = new (Z) LoadFieldInstr(
+      new (Z) Value(call->ArgumentAt(0)), &field,
+      AbstractType::ZoneHandle(Z, field.type()), call->token_pos());
   load->set_is_immutable(field.is_final());
   if (field.guarded_cid() != kIllegalCid) {
     if (!field.is_nullable() || (field.guarded_cid() == kNullCid)) {
@@ -1072,9 +989,7 @@
 
   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()) {
+    for (Value::Iterator it(load->input_use_list()); !it.Done(); it.Advance()) {
       it.Current()->SetReachingType(NULL);
     }
   }
@@ -1091,24 +1006,16 @@
   Definition* left = call->ArgumentAt(0);
   Definition* right = call->ArgumentAt(1);
   // Type check left.
-  AddCheckClass(left,
-                ICData::ZoneHandle(
-                    Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
-                call->deopt_id(),
-                call->env(),
-                call);
+  AddCheckClass(left, ICData::ZoneHandle(
+                          Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
+                call->deopt_id(), call->env(), call);
   // Type check right.
-  AddCheckClass(right,
-                ICData::ZoneHandle(
-                    Z, call->ic_data()->AsUnaryClassChecksForArgNr(1)),
-                call->deopt_id(),
-                call->env(),
-                call);
+  AddCheckClass(right, ICData::ZoneHandle(
+                           Z, call->ic_data()->AsUnaryClassChecksForArgNr(1)),
+                call->deopt_id(), call->env(), call);
   // Replace call.
-  BinaryFloat32x4OpInstr* float32x4_bin_op =
-      new(Z) BinaryFloat32x4OpInstr(
-          op_kind, new(Z) Value(left), new(Z) Value(right),
-          call->deopt_id());
+  BinaryFloat32x4OpInstr* float32x4_bin_op = new (Z) BinaryFloat32x4OpInstr(
+      op_kind, new (Z) Value(left), new (Z) Value(right), call->deopt_id());
   ReplaceCall(call, float32x4_bin_op);
 
   return true;
@@ -1124,24 +1031,16 @@
   Definition* left = call->ArgumentAt(0);
   Definition* right = call->ArgumentAt(1);
   // Type check left.
-  AddCheckClass(left,
-                ICData::ZoneHandle(
-                    Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
-                call->deopt_id(),
-                call->env(),
-                call);
+  AddCheckClass(left, ICData::ZoneHandle(
+                          Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
+                call->deopt_id(), call->env(), call);
   // Type check right.
-  AddCheckClass(right,
-                ICData::ZoneHandle(Z,
-                    call->ic_data()->AsUnaryClassChecksForArgNr(1)),
-                call->deopt_id(),
-                call->env(),
-                call);
+  AddCheckClass(right, ICData::ZoneHandle(
+                           Z, call->ic_data()->AsUnaryClassChecksForArgNr(1)),
+                call->deopt_id(), call->env(), call);
   // Replace call.
-  BinaryInt32x4OpInstr* int32x4_bin_op =
-      new(Z) BinaryInt32x4OpInstr(
-          op_kind, new(Z) Value(left), new(Z) Value(right),
-          call->deopt_id());
+  BinaryInt32x4OpInstr* int32x4_bin_op = new (Z) BinaryInt32x4OpInstr(
+      op_kind, new (Z) Value(left), new (Z) Value(right), call->deopt_id());
   ReplaceCall(call, int32x4_bin_op);
   return true;
 }
@@ -1156,24 +1055,16 @@
   Definition* left = call->ArgumentAt(0);
   Definition* right = call->ArgumentAt(1);
   // Type check left.
-  AddCheckClass(left,
-                ICData::ZoneHandle(
-                    call->ic_data()->AsUnaryClassChecksForArgNr(0)),
-                call->deopt_id(),
-                call->env(),
-                call);
+  AddCheckClass(
+      left, ICData::ZoneHandle(call->ic_data()->AsUnaryClassChecksForArgNr(0)),
+      call->deopt_id(), call->env(), call);
   // Type check right.
-  AddCheckClass(right,
-                ICData::ZoneHandle(
-                    call->ic_data()->AsUnaryClassChecksForArgNr(1)),
-                call->deopt_id(),
-                call->env(),
-                call);
+  AddCheckClass(
+      right, ICData::ZoneHandle(call->ic_data()->AsUnaryClassChecksForArgNr(1)),
+      call->deopt_id(), call->env(), call);
   // Replace call.
-  BinaryFloat64x2OpInstr* float64x2_bin_op =
-      new(Z) BinaryFloat64x2OpInstr(
-          op_kind, new(Z) Value(left), new(Z) Value(right),
-          call->deopt_id());
+  BinaryFloat64x2OpInstr* float64x2_bin_op = new (Z) BinaryFloat64x2OpInstr(
+      op_kind, new (Z) Value(left), new (Z) Value(right), call->deopt_id());
   ReplaceCall(call, float64x2_bin_op);
   return true;
 }
@@ -1209,15 +1100,12 @@
     MethodRecognizer::Kind recognized_kind) {
   AddReceiverCheck(call);
   ZoneGrowableArray<Value*>* args =
-      new(Z) ZoneGrowableArray<Value*>(call->ArgumentCount());
+      new (Z) ZoneGrowableArray<Value*>(call->ArgumentCount());
   for (intptr_t i = 0; i < call->ArgumentCount(); i++) {
-    args->Add(new(Z) Value(call->ArgumentAt(i)));
+    args->Add(new (Z) Value(call->ArgumentAt(i)));
   }
-  InvokeMathCFunctionInstr* invoke =
-      new(Z) InvokeMathCFunctionInstr(args,
-                                      call->deopt_id(),
-                                      recognized_kind,
-                                      call->token_pos());
+  InvokeMathCFunctionInstr* invoke = new (Z) InvokeMathCFunctionInstr(
+      args, call->deopt_id(), recognized_kind, call->token_pos());
   ReplaceCall(call, invoke);
 }
 
@@ -1242,15 +1130,14 @@
     if (class_ids[0] == kSmiCid) {
       AddReceiverCheck(call);
       ReplaceCall(call,
-                  new(Z) SmiToDoubleInstr(
-                      new(Z) Value(call->ArgumentAt(0)),
-                      call->token_pos()));
+                  new (Z) SmiToDoubleInstr(new (Z) Value(call->ArgumentAt(0)),
+                                           call->token_pos()));
       return true;
     } else if ((class_ids[0] == kMintCid) && CanConvertUnboxedMintToDouble()) {
       AddReceiverCheck(call);
       ReplaceCall(call,
-                  new(Z) MintToDoubleInstr(new(Z) Value(call->ArgumentAt(0)),
-                                           call->deopt_id()));
+                  new (Z) MintToDoubleInstr(new (Z) Value(call->ArgumentAt(0)),
+                                            call->deopt_id()));
       return true;
     }
   }
@@ -1268,12 +1155,11 @@
         Definition* d2i_instr = NULL;
         if (ic_data.HasDeoptReason(ICData::kDeoptDoubleToSmi)) {
           // Do not repeatedly deoptimize because result didn't fit into Smi.
-          d2i_instr =  new(Z) DoubleToIntegerInstr(
-              new(Z) Value(input), call);
+          d2i_instr = new (Z) DoubleToIntegerInstr(new (Z) Value(input), call);
         } else {
           // Optimistically assume result fits into Smi.
-          d2i_instr = new(Z) DoubleToSmiInstr(
-              new(Z) Value(input), call->deopt_id());
+          d2i_instr =
+              new (Z) DoubleToSmiInstr(new (Z) Value(input), call->deopt_id());
         }
         ReplaceCall(call, d2i_instr);
         return true;
@@ -1290,8 +1176,8 @@
         } else {
           AddReceiverCheck(call);
           DoubleToDoubleInstr* d2d_instr =
-              new(Z) DoubleToDoubleInstr(new(Z) Value(call->ArgumentAt(0)),
-                                         recognized_kind, call->deopt_id());
+              new (Z) DoubleToDoubleInstr(new (Z) Value(call->ArgumentAt(0)),
+                                          recognized_kind, call->deopt_id());
           ReplaceCall(call, d2d_instr);
         }
         return true;
@@ -1331,7 +1217,7 @@
     const TypeArguments& type_arguments =
         TypeArguments::Handle(Z, type.arguments());
     const bool is_raw_type = type_arguments.IsNull() ||
-        type_arguments.IsRaw(from_index, num_type_params);
+                             type_arguments.IsRaw(from_index, num_type_params);
     if (!is_raw_type) {
       // Unknown result.
       return Bool::null();
@@ -1348,13 +1234,9 @@
     if (cls.NumTypeArguments() > 0) {
       return Bool::null();
     }
-    const bool is_subtype = cls.IsSubtypeOf(
-        TypeArguments::Handle(Z),
-        type_class,
-        TypeArguments::Handle(Z),
-        NULL,
-        NULL,
-        Heap::kOld);
+    const bool is_subtype =
+        cls.IsSubtypeOf(TypeArguments::Handle(Z), type_class,
+                        TypeArguments::Handle(Z), NULL, NULL, Heap::kOld);
     results->Add(cls.id());
     results->Add(is_subtype);
     if (prev.IsNull()) {
@@ -1365,7 +1247,7 @@
       }
     }
   }
-  return results_differ ?  Bool::null() : prev.raw();
+  return results_differ ? Bool::null() : prev.raw();
 }
 
 
@@ -1388,7 +1270,8 @@
   if (!type_class.IsPrivate()) {
     if (FLAG_use_cha_deopt || isolate()->all_classes_finalized()) {
       if (FLAG_trace_cha) {
-        THR_Print("  **(CHA) Typecheck as class equality since no "
+        THR_Print(
+            "  **(CHA) Typecheck as class equality since no "
             "subclasses: %s\n",
             type_class.ToCString());
       }
@@ -1408,7 +1291,7 @@
     const TypeArguments& type_arguments =
         TypeArguments::Handle(type.arguments());
     const bool is_raw_type = type_arguments.IsNull() ||
-        type_arguments.IsRaw(from_index, num_type_params);
+                             type_arguments.IsRaw(from_index, num_type_params);
     return is_raw_type;
   }
   return true;
@@ -1444,12 +1327,9 @@
   if ((*results)[0] != kSmiCid) {
     const Class& cls = Class::Handle(class_table.At(kSmiCid));
     const Class& type_class = Class::Handle(type.type_class());
-    const bool smi_is_subtype = cls.IsSubtypeOf(TypeArguments::Handle(),
-                                                type_class,
-                                                TypeArguments::Handle(),
-                                                NULL,
-                                                NULL,
-                                                Heap::kOld);
+    const bool smi_is_subtype =
+        cls.IsSubtypeOf(TypeArguments::Handle(), type_class,
+                        TypeArguments::Handle(), NULL, NULL, Heap::kOld);
     results->Add((*results)[results->length() - 2]);
     results->Add((*results)[results->length() - 2]);
     for (intptr_t i = results->length() - 3; i > 1; --i) {
@@ -1506,31 +1386,33 @@
       } else {
         UNIMPLEMENTED();
       }
-      negate = Bool::Cast(call->ArgumentAt(1)->OriginalDefinition()
-                          ->AsConstant()->value()).value();
+      negate =
+          Bool::Cast(
+              call->ArgumentAt(1)->OriginalDefinition()->AsConstant()->value())
+              .value();
     }
   } else {
     type_args = call->ArgumentAt(1);
     type = AbstractType::Cast(call->ArgumentAt(2)->AsConstant()->value()).raw();
-    negate = Bool::Cast(call->ArgumentAt(3)->OriginalDefinition()
-        ->AsConstant()->value()).value();
+    negate =
+        Bool::Cast(
+            call->ArgumentAt(3)->OriginalDefinition()->AsConstant()->value())
+            .value();
   }
   const ICData& unary_checks =
       ICData::ZoneHandle(Z, call->ic_data()->AsUnaryClassChecks());
   if ((unary_checks.NumberOfChecks() > 0) &&
       (unary_checks.NumberOfChecks() <= FLAG_max_polymorphic_checks)) {
     ZoneGrowableArray<intptr_t>* results =
-        new(Z) ZoneGrowableArray<intptr_t>(unary_checks.NumberOfChecks() * 2);
+        new (Z) ZoneGrowableArray<intptr_t>(unary_checks.NumberOfChecks() * 2);
     Bool& as_bool =
         Bool::ZoneHandle(Z, InstanceOfAsBool(unary_checks, type, results));
     if (as_bool.IsNull()) {
       if (results->length() == unary_checks.NumberOfChecks() * 2) {
         const bool can_deopt = TryExpandTestCidsResult(results, type);
-        TestCidsInstr* test_cids = new(Z) TestCidsInstr(
-            call->token_pos(),
-            negate ? Token::kISNOT : Token::kIS,
-            new(Z) Value(left),
-            *results,
+        TestCidsInstr* test_cids = new (Z) TestCidsInstr(
+            call->token_pos(), negate ? Token::kISNOT : Token::kIS,
+            new (Z) Value(left), *results,
             can_deopt ? call->deopt_id() : Thread::kNoDeoptId);
         // Remove type.
         ReplaceCall(call, test_cids);
@@ -1557,33 +1439,23 @@
   }
 
   if (TypeCheckAsClassEquality(type)) {
-    LoadClassIdInstr* left_cid = new(Z) LoadClassIdInstr(new(Z) Value(left));
-    InsertBefore(call,
-                 left_cid,
-                 NULL,
-                 FlowGraph::kValue);
+    LoadClassIdInstr* left_cid = new (Z) LoadClassIdInstr(new (Z) Value(left));
+    InsertBefore(call, left_cid, NULL, FlowGraph::kValue);
     const intptr_t type_cid = Class::Handle(Z, type.type_class()).id();
     ConstantInstr* cid =
         flow_graph()->GetConstant(Smi::Handle(Z, Smi::New(type_cid)));
 
-    StrictCompareInstr* check_cid =
-        new(Z) StrictCompareInstr(
-            call->token_pos(),
-            negate ? Token::kNE_STRICT : Token::kEQ_STRICT,
-            new(Z) Value(left_cid),
-            new(Z) Value(cid),
-            false);  // No number check.
+    StrictCompareInstr* check_cid = new (Z) StrictCompareInstr(
+        call->token_pos(), negate ? Token::kNE_STRICT : Token::kEQ_STRICT,
+        new (Z) Value(left_cid), new (Z) Value(cid),
+        false);  // No number check.
     ReplaceCall(call, check_cid);
     return;
   }
 
-  InstanceOfInstr* instance_of =
-      new(Z) InstanceOfInstr(call->token_pos(),
-                             new(Z) Value(left),
-                             new(Z) Value(type_args),
-                             type,
-                             negate,
-                             call->deopt_id());
+  InstanceOfInstr* instance_of = new (Z)
+      InstanceOfInstr(call->token_pos(), new (Z) Value(left),
+                      new (Z) Value(type_args), type, negate, call->deopt_id());
   ReplaceCall(call, instance_of);
 }
 
@@ -1601,9 +1473,9 @@
   if ((unary_checks.NumberOfChecks() > 0) &&
       (unary_checks.NumberOfChecks() <= FLAG_max_polymorphic_checks)) {
     ZoneGrowableArray<intptr_t>* results =
-        new(Z) ZoneGrowableArray<intptr_t>(unary_checks.NumberOfChecks() * 2);
-    const Bool& as_bool = Bool::ZoneHandle(Z,
-        InstanceOfAsBool(unary_checks, type, results));
+        new (Z) ZoneGrowableArray<intptr_t>(unary_checks.NumberOfChecks() * 2);
+    const Bool& as_bool =
+        Bool::ZoneHandle(Z, InstanceOfAsBool(unary_checks, type, results));
     if (as_bool.raw() == Bool::True().raw()) {
       AddReceiverCheck(call);
       // Remove the original push arguments.
@@ -1619,13 +1491,9 @@
       return;
     }
   }
-  AssertAssignableInstr* assert_as =
-      new(Z) AssertAssignableInstr(call->token_pos(),
-                                   new(Z) Value(left),
-                                   new(Z) Value(type_args),
-                                   type,
-                                   Symbols::InTypeCast(),
-                                   call->deopt_id());
+  AssertAssignableInstr* assert_as = new (Z) AssertAssignableInstr(
+      call->token_pos(), new (Z) Value(left), new (Z) Value(type_args), type,
+      Symbols::InTypeCast(), call->deopt_id());
   ReplaceCall(call, assert_as);
 }
 
@@ -1654,10 +1522,9 @@
 
   const bool is_dense = CheckClassInstr::IsDenseCidRange(unary_checks);
   const intptr_t max_checks = (op_kind == Token::kEQ)
-      ? FLAG_max_equality_polymorphic_checks
-      : FLAG_max_polymorphic_checks;
-  if ((unary_checks.NumberOfChecks() > max_checks) &&
-      !is_dense &&
+                                  ? FLAG_max_equality_polymorphic_checks
+                                  : FLAG_max_polymorphic_checks;
+  if ((unary_checks.NumberOfChecks() > max_checks) && !is_dense &&
       flow_graph()->InstanceCallNeedsClassCheck(
           instr, RawFunction::kRegularFunction)) {
     // Too many checks, it will be megamorphic which needs unary checks.
@@ -1705,20 +1572,25 @@
   if (has_one_target) {
     // Check if the single target is a polymorphic target, if it is,
     // we don't have one target.
-    const Function& target =
-        Function::Handle(Z, unary_checks.GetTargetAt(0));
-    const bool polymorphic_target = MethodRecognizer::PolymorphicTarget(target);
-    has_one_target = !polymorphic_target;
+    const Function& target = Function::Handle(Z, unary_checks.GetTargetAt(0));
+    if (target.recognized_kind() == MethodRecognizer::kObjectRuntimeType) {
+      has_one_target = PolymorphicInstanceCallInstr::ComputeRuntimeType(
+                           unary_checks) != Type::null();
+    } else {
+      const bool polymorphic_target =
+          MethodRecognizer::PolymorphicTarget(target);
+      has_one_target = !polymorphic_target;
+    }
   }
 
   if (has_one_target) {
-    RawFunction::Kind function_kind =
-        Function::Handle(Z, unary_checks.GetTargetAt(0)).kind();
+    const Function& target = Function::Handle(Z, unary_checks.GetTargetAt(0));
+    const RawFunction::Kind function_kind = target.kind();
     if (!flow_graph()->InstanceCallNeedsClassCheck(instr, function_kind)) {
       PolymorphicInstanceCallInstr* call =
-          new(Z) PolymorphicInstanceCallInstr(instr, unary_checks,
-                                              /* call_with_checks = */ false,
-                                              /* complete = */ false);
+          new (Z) PolymorphicInstanceCallInstr(instr, unary_checks,
+                                               /* call_with_checks = */ false,
+                                               /* complete = */ false);
       instr->ReplaceWith(call, current_iterator());
       return;
     }
@@ -1735,10 +1607,9 @@
     } else {
       call_with_checks = true;
     }
-    PolymorphicInstanceCallInstr* call =
-        new(Z) PolymorphicInstanceCallInstr(instr, unary_checks,
-                                            call_with_checks,
-                                            /* complete = */ false);
+    PolymorphicInstanceCallInstr* call = new (Z)
+        PolymorphicInstanceCallInstr(instr, unary_checks, call_with_checks,
+                                     /* complete = */ false);
     instr->ReplaceWith(call, current_iterator());
   }
 }
@@ -1776,37 +1647,27 @@
     case MethodRecognizer::kMathMax: {
       // We can handle only monomorphic min/max call sites with both arguments
       // being either doubles or smis.
-      if (CanUnboxDouble() &&
-          call->HasICData() &&
+      if (CanUnboxDouble() && call->HasICData() &&
           (call->ic_data()->NumberOfChecks() == 1)) {
         const ICData& ic_data = *call->ic_data();
         intptr_t result_cid = kIllegalCid;
-        if (ICDataHasReceiverArgumentClassIds(ic_data,
-                                              kDoubleCid, kDoubleCid)) {
+        if (ICDataHasReceiverArgumentClassIds(ic_data, kDoubleCid,
+                                              kDoubleCid)) {
           result_cid = kDoubleCid;
-        } else if (ICDataHasReceiverArgumentClassIds(ic_data,
-                                                     kSmiCid, kSmiCid)) {
+        } else if (ICDataHasReceiverArgumentClassIds(ic_data, kSmiCid,
+                                                     kSmiCid)) {
           result_cid = kSmiCid;
         }
         if (result_cid != kIllegalCid) {
-          MathMinMaxInstr* min_max = new(Z) MathMinMaxInstr(
-              recognized_kind,
-              new(Z) Value(call->ArgumentAt(0)),
-              new(Z) Value(call->ArgumentAt(1)),
-              call->deopt_id(),
-              result_cid);
+          MathMinMaxInstr* min_max = new (Z) MathMinMaxInstr(
+              recognized_kind, new (Z) Value(call->ArgumentAt(0)),
+              new (Z) Value(call->ArgumentAt(1)), call->deopt_id(), result_cid);
           const ICData& unary_checks =
               ICData::ZoneHandle(Z, ic_data.AsUnaryClassChecks());
-          AddCheckClass(min_max->left()->definition(),
-                        unary_checks,
-                        call->deopt_id(),
-                        call->env(),
-                        call);
-          AddCheckClass(min_max->right()->definition(),
-                        unary_checks,
-                        call->deopt_id(),
-                        call->env(),
-                        call);
+          AddCheckClass(min_max->left()->definition(), unary_checks,
+                        call->deopt_id(), call->env(), call);
+          AddCheckClass(min_max->right()->definition(), unary_checks,
+                        call->deopt_id(), call->env(), call);
           ReplaceCall(call, min_max);
         }
       }
@@ -1820,15 +1681,13 @@
           if (ArgIsAlways(kSmiCid, ic_data, 1)) {
             Definition* arg = call->ArgumentAt(1);
             AddCheckSmi(arg, call->deopt_id(), call->env(), call);
-            ReplaceCall(call,
-                        new(Z) SmiToDoubleInstr(new(Z) Value(arg),
-                                                call->token_pos()));
+            ReplaceCall(call, new (Z) SmiToDoubleInstr(new (Z) Value(arg),
+                                                       call->token_pos()));
           } else if (ArgIsAlways(kMintCid, ic_data, 1) &&
                      CanConvertUnboxedMintToDouble()) {
             Definition* arg = call->ArgumentAt(1);
-            ReplaceCall(call,
-                        new(Z) MintToDoubleInstr(new(Z) Value(arg),
-                                                 call->deopt_id()));
+            ReplaceCall(call, new (Z) MintToDoubleInstr(new (Z) Value(arg),
+                                                        call->deopt_id()));
           }
         }
       }
@@ -1840,8 +1699,7 @@
 }
 
 
-void JitOptimizer::VisitStoreInstanceField(
-    StoreInstanceFieldInstr* instr) {
+void JitOptimizer::VisitStoreInstanceField(StoreInstanceFieldInstr* instr) {
   if (instr->IsUnboxedStore()) {
     // Determine if this field should be unboxed based on the usage of getter
     // and setter functions: The heuristic requires that the setter has a
@@ -1861,7 +1719,7 @@
         unboxed_field = true;
       } else if ((setter.usage_counter() > 0) &&
                  ((FLAG_getter_setter_ratio * setter.usage_counter()) >=
-                   getter.usage_counter())) {
+                  getter.usage_counter())) {
         unboxed_field = true;
       }
     }
@@ -1872,8 +1730,8 @@
       // - deoptimize dependent code.
       if (Compiler::IsBackgroundCompilation()) {
         isolate()->AddDeoptimizingBoxedField(field);
-        Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId,
-            "Unboxing instance field while compiling");
+        Compiler::AbortBackgroundCompilation(
+            Thread::kNoDeoptId, "Unboxing instance field while compiling");
         UNREACHABLE();
       }
       if (FLAG_trace_optimization || FLAG_trace_field_guards) {
@@ -1903,24 +1761,20 @@
                                             instr->num_context_variables());
   instr->ReplaceWith(replacement, current_iterator());
 
-  StoreInstanceFieldInstr* store =
-      new(Z) StoreInstanceFieldInstr(Context::parent_offset(),
-                                     new Value(replacement),
-                                     new Value(flow_graph_->constant_null()),
-                                     kNoStoreBarrier,
-                                     instr->token_pos());
+  StoreInstanceFieldInstr* store = new (Z)
+      StoreInstanceFieldInstr(Context::parent_offset(), new Value(replacement),
+                              new Value(flow_graph_->constant_null()),
+                              kNoStoreBarrier, instr->token_pos());
   // Storing into uninitialized memory; remember to prevent dead store
   // elimination and ensure proper GC barrier.
   store->set_is_initialization(true);
   flow_graph_->InsertAfter(replacement, store, NULL, FlowGraph::kEffect);
   Definition* cursor = store;
   for (intptr_t i = 0; i < instr->num_context_variables(); ++i) {
-    store =
-        new(Z) StoreInstanceFieldInstr(Context::variable_offset(i),
-                                       new Value(replacement),
-                                       new Value(flow_graph_->constant_null()),
-                                       kNoStoreBarrier,
-                                       instr->token_pos());
+    store = new (Z) StoreInstanceFieldInstr(
+        Context::variable_offset(i), new Value(replacement),
+        new Value(flow_graph_->constant_null()), kNoStoreBarrier,
+        instr->token_pos());
     // Storing into uninitialized memory; remember to prevent dead store
     // elimination and ensure proper GC barrier.
     store->set_is_initialization(true);
@@ -1931,10 +1785,9 @@
 
 
 void JitOptimizer::VisitLoadCodeUnits(LoadCodeUnitsInstr* instr) {
-  // TODO(zerny): Use kUnboxedUint32 once it is fully supported/optimized.
+// TODO(zerny): Use kUnboxedUint32 once it is fully supported/optimized.
 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_ARM)
-  if (!instr->can_pack_into_smi())
-    instr->set_representation(kUnboxedMint);
+  if (!instr->can_pack_into_smi()) instr->set_representation(kUnboxedMint);
 #endif
 }
 
@@ -1942,7 +1795,7 @@
 bool JitOptimizer::TryInlineInstanceSetter(InstanceCallInstr* instr,
                                            const ICData& unary_ic_data) {
   ASSERT((unary_ic_data.NumberOfChecks() > 0) &&
-      (unary_ic_data.NumArgsTested() == 1));
+         (unary_ic_data.NumArgsTested() == 1));
   if (I->type_checks()) {
     // Checked mode setters are inlined like normal methods by conventional
     // inlining.
@@ -1969,43 +1822,34 @@
   // Inline implicit instance setter.
   const String& field_name =
       String::Handle(Z, Field::NameFromSetter(instr->function_name()));
-  const Field& field =
-      Field::ZoneHandle(Z, GetField(class_id, field_name));
+  const Field& field = Field::ZoneHandle(Z, GetField(class_id, field_name));
   ASSERT(!field.IsNull());
 
-  if (flow_graph()->InstanceCallNeedsClassCheck(
-          instr, RawFunction::kImplicitSetter)) {
+  if (flow_graph()->InstanceCallNeedsClassCheck(instr,
+                                                RawFunction::kImplicitSetter)) {
     AddReceiverCheck(instr);
   }
   if (field.guarded_cid() != kDynamicCid) {
     ASSERT(FLAG_use_field_guards);
-    InsertBefore(instr,
-                 new(Z) GuardFieldClassInstr(
-                     new(Z) Value(instr->ArgumentAt(1)),
-                      field,
-                      instr->deopt_id()),
-                 instr->env(),
-                 FlowGraph::kEffect);
+    InsertBefore(
+        instr, new (Z) GuardFieldClassInstr(new (Z) Value(instr->ArgumentAt(1)),
+                                            field, instr->deopt_id()),
+        instr->env(), FlowGraph::kEffect);
   }
 
   if (field.needs_length_check()) {
     ASSERT(FLAG_use_field_guards);
-    InsertBefore(instr,
-                 new(Z) GuardFieldLengthInstr(
-                     new(Z) Value(instr->ArgumentAt(1)),
-                      field,
-                      instr->deopt_id()),
-                 instr->env(),
-                 FlowGraph::kEffect);
+    InsertBefore(instr, new (Z) GuardFieldLengthInstr(
+                            new (Z) Value(instr->ArgumentAt(1)), field,
+                            instr->deopt_id()),
+                 instr->env(), FlowGraph::kEffect);
   }
 
   // Field guard was detached.
-  StoreInstanceFieldInstr* store = new(Z) StoreInstanceFieldInstr(
-      field,
-      new(Z) Value(instr->ArgumentAt(0)),
-      new(Z) Value(instr->ArgumentAt(1)),
-      kEmitStoreBarrier,
-      instr->token_pos());
+  StoreInstanceFieldInstr* store = new (Z)
+      StoreInstanceFieldInstr(field, new (Z) Value(instr->ArgumentAt(0)),
+                              new (Z) Value(instr->ArgumentAt(1)),
+                              kEmitStoreBarrier, instr->token_pos());
 
   if (store->IsUnboxedStore()) {
     flow_graph()->parsed_function().AddToGuardedFields(&field);
@@ -2020,3 +1864,4 @@
 
 
 }  // namespace dart
+#endif  // DART_PRECOMPILED_RUNTIME
diff --git a/runtime/vm/jit_optimizer.h b/runtime/vm/jit_optimizer.h
index 21a7855..cc6ac93 100644
--- a/runtime/vm/jit_optimizer.h
+++ b/runtime/vm/jit_optimizer.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_JIT_OPTIMIZER_H_
-#define VM_JIT_OPTIMIZER_H_
+#ifndef RUNTIME_VM_JIT_OPTIMIZER_H_
+#define RUNTIME_VM_JIT_OPTIMIZER_H_
 
 #include "vm/intermediate_language.h"
 #include "vm/flow_graph.h"
@@ -11,14 +11,15 @@
 namespace dart {
 
 class CSEInstructionMap;
-template <typename T> class GrowableArray;
+template <typename T>
+class GrowableArray;
 class ParsedFunction;
 
 class JitOptimizer : public FlowGraphVisitor {
  public:
   explicit JitOptimizer(FlowGraph* flow_graph)
       : FlowGraphVisitor(flow_graph->reverse_postorder()),
-        flow_graph_(flow_graph) { }
+        flow_graph_(flow_graph) {}
 
   virtual ~JitOptimizer() {}
 
@@ -101,12 +102,9 @@
   bool InstanceCallNeedsClassCheck(InstanceCallInstr* call,
                                    RawFunction::Kind kind) const;
 
-  bool InlineFloat32x4BinaryOp(InstanceCallInstr* call,
-                               Token::Kind op_kind);
-  bool InlineInt32x4BinaryOp(InstanceCallInstr* call,
-                              Token::Kind op_kind);
-  bool InlineFloat64x2BinaryOp(InstanceCallInstr* call,
-                               Token::Kind op_kind);
+  bool InlineFloat32x4BinaryOp(InstanceCallInstr* call, Token::Kind op_kind);
+  bool InlineInt32x4BinaryOp(InstanceCallInstr* call, Token::Kind op_kind);
+  bool InlineFloat64x2BinaryOp(InstanceCallInstr* call, Token::Kind op_kind);
   bool InlineImplicitInstanceGetter(InstanceCallInstr* call);
 
   RawBool* InstanceOfAsBool(const ICData& ic_data,
@@ -134,4 +132,4 @@
 
 }  // namespace dart
 
-#endif  // VM_JIT_OPTIMIZER_H_
+#endif  // RUNTIME_VM_JIT_OPTIMIZER_H_
diff --git a/runtime/vm/json_stream.cc b/runtime/vm/json_stream.cc
index e26c915..8310e70 100644
--- a/runtime/vm/json_stream.cc
+++ b/runtime/vm/json_stream.cc
@@ -65,8 +65,7 @@
 }
 
 
-JSONStream::~JSONStream() {
-}
+JSONStream::~JSONStream() {}
 
 
 void JSONStream::Setup(Zone* zone,
@@ -168,8 +167,7 @@
 }
 
 
-void JSONStream::PrintError(intptr_t code,
-                            const char* details_format, ...) {
+void JSONStream::PrintError(intptr_t code, const char* details_format, ...) {
   SetupError();
   JSONObject jsobj(this);
   jsobj.AddProperty("code", code);
@@ -196,8 +194,8 @@
 
 
 void JSONStream::PostNullReply(Dart_Port port) {
-  PortMap::PostMessage(new Message(
-      port, Object::null(), Message::kNormalPriority));
+  PortMap::PostMessage(
+      new Message(port, Object::null(), Message::kNormalPriority));
 }
 
 
@@ -262,11 +260,13 @@
     const char* isolate_name = isolate->name();
     int64_t total_time = OS::GetCurrentTimeMicros() - setup_time_micros_;
     if (result) {
-      OS::Print("[+%" Pd64 "ms] Isolate %s processed service request %s "
+      OS::Print("[+%" Pd64
+                "ms] Isolate %s processed service request %s "
                 "(%" Pd64 "us)\n",
                 Dart::timestamp(), isolate_name, method_, total_time);
     } else {
-      OS::Print("[+%" Pd64 "ms] Isolate %s processed service request %s "
+      OS::Print("[+%" Pd64
+                "ms] Isolate %s processed service request %s "
                 "(%" Pd64 "us) FAILED\n",
                 Dart::timestamp(), isolate_name, method_, total_time);
     }
@@ -417,7 +417,7 @@
 
 
 static const char base64_digits[65] =
-  "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+    "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
 static const char base64_pad = '=';
 
 
@@ -484,9 +484,9 @@
   va_start(args, format);
   intptr_t len = OS::VSNPrint(NULL, 0, format, args);
   va_end(args);
-  char* p = reinterpret_cast<char*>(malloc(len+1));
+  char* p = reinterpret_cast<char*>(malloc(len + 1));
   va_start(args, format);
-  intptr_t len2 = OS::VSNPrint(p, len+1, format, args);
+  intptr_t len2 = OS::VSNPrint(p, len + 1, format, args);
   va_end(args);
   ASSERT(len == len2);
   buffer_.AddChar('"');
@@ -681,9 +681,9 @@
   va_start(args, format);
   intptr_t len = OS::VSNPrint(NULL, 0, format, args);
   va_end(args);
-  char* p = reinterpret_cast<char*>(malloc(len+1));
+  char* p = reinterpret_cast<char*>(malloc(len + 1));
   va_start(args, format);
-  intptr_t len2 = OS::VSNPrint(p, len+1, format, args);
+  intptr_t len2 = OS::VSNPrint(p, len + 1, format, args);
   va_end(args);
   ASSERT(len == len2);
   buffer_.AddChar('"');
@@ -786,7 +786,7 @@
   if (length == 0) {
     return false;
   }
-  char ch = buffer[length-1];
+  char ch = buffer[length - 1];
   return (ch != '[') && (ch != '{') && (ch != ':') && (ch != ',');
 }
 
@@ -794,8 +794,10 @@
 void JSONStream::EnsureIntegerIsRepresentableInJavaScript(int64_t i) {
 #ifdef DEBUG
   if (!Utils::IsJavascriptInt(i)) {
-    OS::Print("JSONStream::EnsureIntegerIsRepresentableInJavaScript failed on "
-              "%" Pd64 "\n", i);
+    OS::Print(
+        "JSONStream::EnsureIntegerIsRepresentableInJavaScript failed on "
+        "%" Pd64 "\n",
+        i);
     UNREACHABLE();
   }
 #endif
@@ -817,7 +819,7 @@
   }
   const uint8_t* s8 = reinterpret_cast<const uint8_t*>(s);
   intptr_t i = 0;
-  for (; i < len; ) {
+  for (; i < len;) {
     // Extract next UTF8 character.
     int32_t ch = 0;
     int32_t ch_len = Utf8::Decode(&s8[i], len - i, &ch);
@@ -850,7 +852,7 @@
       if (i + 1 == limit) {
         buffer_.EscapeAndAddUTF16CodeUnit(code_unit);
       } else {
-        uint16_t next_code_unit = s.CharAt(i+1);
+        uint16_t next_code_unit = s.CharAt(i + 1);
         if (Utf16::IsTrailSurrogate(next_code_unit)) {
           uint32_t decoded = Utf16::Decode(code_unit, next_code_unit);
           buffer_.EscapeAndAddCodeUnit(decoded);
@@ -882,9 +884,9 @@
   va_start(args, format);
   intptr_t len = OS::VSNPrint(NULL, 0, format, args);
   va_end(args);
-  char* p = reinterpret_cast<char*>(malloc(len+1));
+  char* p = reinterpret_cast<char*>(malloc(len + 1));
   va_start(args, format);
-  intptr_t len2 = OS::VSNPrint(p, len+1, format, args);
+  intptr_t len2 = OS::VSNPrint(p, len + 1, format, args);
   va_end(args);
   ASSERT(len == len2);
   stream_->buffer_.AddChar('"');
@@ -941,8 +943,7 @@
     // This unresolved breakpoint was specified at a particular line.
     location.AddProperty("line", bpt_loc->requested_line_number());
     if (bpt_loc->requested_column_number() >= 0) {
-      location.AddProperty("column",
-                           bpt_loc->requested_column_number());
+      location.AddProperty("column", bpt_loc->requested_column_number());
     }
   } else {
     // This unresolved breakpoint was requested at some function entry.
@@ -951,16 +952,15 @@
 }
 
 
-void JSONObject::AddPropertyF(const char* name,
-                              const char* format, ...) const {
+void JSONObject::AddPropertyF(const char* name, const char* format, ...) const {
   stream_->PrintPropertyName(name);
   va_list args;
   va_start(args, format);
   intptr_t len = OS::VSNPrint(NULL, 0, format, args);
   va_end(args);
-  char* p = reinterpret_cast<char*>(malloc(len+1));
+  char* p = reinterpret_cast<char*>(malloc(len + 1));
   va_start(args, format);
-  intptr_t len2 = OS::VSNPrint(p, len+1, format, args);
+  intptr_t len2 = OS::VSNPrint(p, len + 1, format, args);
   va_end(args);
   ASSERT(len == len2);
   stream_->buffer_.AddChar('"');
@@ -976,9 +976,9 @@
   va_start(args, format);
   intptr_t len = OS::VSNPrint(NULL, 0, format, args);
   va_end(args);
-  char* p = reinterpret_cast<char*>(malloc(len+1));
+  char* p = reinterpret_cast<char*>(malloc(len + 1));
   va_start(args, format);
-  intptr_t len2 = OS::VSNPrint(p, len+1, format, args);
+  intptr_t len2 = OS::VSNPrint(p, len + 1, format, args);
   va_end(args);
   ASSERT(len == len2);
   stream_->buffer_.AddChar('"');
diff --git a/runtime/vm/json_stream.h b/runtime/vm/json_stream.h
index 2dac1c7..b54bfb2 100644
--- a/runtime/vm/json_stream.h
+++ b/runtime/vm/json_stream.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_JSON_STREAM_H_
-#define VM_JSON_STREAM_H_
+#ifndef RUNTIME_VM_JSON_STREAM_H_
+#define RUNTIME_VM_JSON_STREAM_H_
 
 #include "include/dart_api.h"  // for Dart_Port
 #include "platform/text_buffer.h"
@@ -39,28 +39,28 @@
 //  - runtime/observatory/lib/src/service/object.dart
 //
 enum JSONRpcErrorCode {
-  kParseError     = -32700,
+  kParseError = -32700,
   kInvalidRequest = -32600,
   kMethodNotFound = -32601,
-  kInvalidParams  = -32602,
-  kInternalError  = -32603,
+  kInvalidParams = -32602,
+  kInternalError = -32603,
 
   kExtensionError = -32000,
 
-  kFeatureDisabled           = 100,
-  kCannotAddBreakpoint       = 102,
-  kStreamAlreadySubscribed   = 103,
-  kStreamNotSubscribed       = 104,
-  kIsolateMustBeRunnable     = 105,
-  kIsolateMustBePaused       = 106,
+  kFeatureDisabled = 100,
+  kCannotAddBreakpoint = 102,
+  kStreamAlreadySubscribed = 103,
+  kStreamNotSubscribed = 104,
+  kIsolateMustBeRunnable = 105,
+  kIsolateMustBePaused = 106,
 
   // Experimental (used in private rpcs).
-  kIsolateIsReloading        = 1000,
-  kFileSystemAlreadyExists   = 1001,
-  kFileSystemDoesNotExist    = 1002,
-  kFileDoesNotExist          = 1003,
-  kIsolateReloadFailed       = 1004,
-  kIsolateReloadBarred       = 1005,
+  kIsolateIsReloading = 1000,
+  kFileSystemAlreadyExists = 1001,
+  kFileSystemDoesNotExist = 1002,
+  kFileDoesNotExist = 1003,
+  kIsolateReloadFailed = 1004,
+  kIsolateReloadBarred = 1005,
 };
 
 // Expected that user_data is a JSONStream*.
@@ -88,12 +88,8 @@
 
   void PostReply();
 
-  void set_id_zone(ServiceIdZone* id_zone) {
-    id_zone_ = id_zone;
-  }
-  ServiceIdZone* id_zone() {
-    return id_zone_;
-  }
+  void set_id_zone(ServiceIdZone* id_zone) { id_zone_ = id_zone; }
+  ServiceIdZone* id_zone() { return id_zone_; }
 
   TextBuffer* buffer() { return &buffer_; }
   const char* ToCString() { return buffer_.buf(); }
@@ -102,7 +98,8 @@
 
   void set_reply_port(Dart_Port port);
 
-  void SetParams(const char** param_keys, const char** param_values,
+  void SetParams(const char** param_keys,
+                 const char** param_values,
                  intptr_t num_params);
 
   Dart_Port reply_port() const { return reply_port_; }
@@ -113,12 +110,8 @@
   RawObject* LookupObjectParam(const char* key) const;
 
   intptr_t num_params() const { return num_params_; }
-  const char* GetParamKey(intptr_t i) const {
-    return param_keys_[i];
-  }
-  const char* GetParamValue(intptr_t i) const {
-    return param_values_[i];
-  }
+  const char* GetParamKey(intptr_t i) const { return param_keys_[i]; }
+  const char* GetParamValue(intptr_t i) const { return param_values_[i]; }
 
   const char* LookupParam(const char* key) const;
 
@@ -152,8 +145,7 @@
   void PrintCommaIfNeeded();
 
   // Append |buffer| to the stream.
-  void AppendSerializedObject(const uint8_t* buffer,
-                              intptr_t buffer_length);
+  void AppendSerializedObject(const uint8_t* buffer, intptr_t buffer_length);
 
   // Append |serialized_object| to the stream with |property_name|.
   void AppendSerializedObject(const char* property_name,
@@ -204,11 +196,13 @@
                            const uint8_t* bytes,
                            intptr_t length);
   void PrintProperty(const char* name, const char* s);
-  bool PrintPropertyStr(const char* name, const String& s,
-                        intptr_t offset, intptr_t count);
+  bool PrintPropertyStr(const char* name,
+                        const String& s,
+                        intptr_t offset,
+                        intptr_t count);
   void PrintPropertyNoEscape(const char* name, const char* s);
   void PrintfProperty(const char* name, const char* format, ...)
-  PRINTF_ATTRIBUTE(3, 4);
+      PRINTF_ATTRIBUTE(3, 4);
   void PrintProperty(const char* name, const Object& o, bool ref = true);
 
   void PrintProperty(const char* name, const ServiceEvent* event);
@@ -265,13 +259,9 @@
   }
   explicit JSONObject(const JSONArray* arr);
 
-  ~JSONObject() {
-    stream_->CloseObject();
-  }
+  ~JSONObject() { stream_->CloseObject(); }
 
-  void AddServiceId(const Object& o) const {
-    stream_->PrintServiceId(o);
-  }
+  void AddServiceId(const Object& o) const { stream_->PrintServiceId(o); }
 
   void AddFixedServiceId(const char* format, ...) const PRINTF_ATTRIBUTE(2, 3);
 
@@ -375,9 +365,7 @@
   explicit JSONArray(const JSONArray* arr) : stream_(arr->stream_) {
     stream_->OpenArray();
   }
-  ~JSONArray() {
-    stream_->CloseArray();
-  }
+  ~JSONArray() { stream_->CloseArray(); }
 
   void AddValueNull() const { stream_->PrintValueNull(); }
   void AddValue(bool b) const { stream_->PrintValueBool(b); }
@@ -397,30 +385,18 @@
   void AddValue(Isolate* isolate, bool ref = true) const {
     stream_->PrintValue(isolate, ref);
   }
-  void AddValue(Breakpoint* bpt) const {
-    stream_->PrintValue(bpt);
-  }
-  void AddValue(TokenPosition tp) const {
-    stream_->PrintValue(tp);
-  }
-  void AddValue(const ServiceEvent* event) const {
-    stream_->PrintValue(event);
-  }
-  void AddValue(Metric* metric) const {
-    stream_->PrintValue(metric);
-  }
-  void AddValue(MessageQueue* queue) const {
-    stream_->PrintValue(queue);
-  }
+  void AddValue(Breakpoint* bpt) const { stream_->PrintValue(bpt); }
+  void AddValue(TokenPosition tp) const { stream_->PrintValue(tp); }
+  void AddValue(const ServiceEvent* event) const { stream_->PrintValue(event); }
+  void AddValue(Metric* metric) const { stream_->PrintValue(metric); }
+  void AddValue(MessageQueue* queue) const { stream_->PrintValue(queue); }
   void AddValue(const TimelineEvent* timeline_event) const {
     stream_->PrintValue(timeline_event);
   }
   void AddValue(const TimelineEventBlock* timeline_event_block) const {
     stream_->PrintValue(timeline_event_block);
   }
-  void AddValueVM(bool ref = true) const {
-    stream_->PrintValueVM(ref);
-  }
+  void AddValueVM(bool ref = true) const { stream_->PrintValueVM(ref); }
   void AddValueF(const char* format, ...) const PRINTF_ATTRIBUTE(2, 3);
 
  private:
@@ -434,4 +410,4 @@
 
 }  // namespace dart
 
-#endif  // VM_JSON_STREAM_H_
+#endif  // RUNTIME_VM_JSON_STREAM_H_
diff --git a/runtime/vm/json_test.cc b/runtime/vm/json_test.cc
index a0b27c2..372ec2b 100644
--- a/runtime/vm/json_test.cc
+++ b/runtime/vm/json_test.cc
@@ -24,16 +24,12 @@
 TEST_CASE(JSON_JSONStream_Primitives) {
   {
     JSONStream js;
-    {
-      JSONObject jsobj(&js);
-    }
+    { JSONObject jsobj(&js); }
     EXPECT_STREQ("{}", js.ToCString());
   }
   {
     JSONStream js;
-    {
-      JSONArray jsarr(&js);
-    }
+    { JSONArray jsarr(&js); }
     EXPECT_STREQ("[]", js.ToCString());
   }
   {
@@ -183,24 +179,25 @@
   }
   char buffer[1024];
   ElideJSONSubstring("classes", js.ToCString(), buffer);
-  EXPECT_STREQ("[{\"type\":\"@Instance\","
-               "\"_vmType\":\"null\","
-               "\"class\":{\"type\":\"@Class\",\"fixedId\":true,\"id\":\"\","
-               "\"name\":\"Null\"},"
-               "\"kind\":\"Null\","
-               "\"fixedId\":true,"
-               "\"id\":\"objects\\/null\","
-               "\"valueAsString\":\"null\"},"
-               "{\"object_key\":"
-               "{\"type\":\"@Instance\","
-               "\"_vmType\":\"null\","
-               "\"class\":{\"type\":\"@Class\",\"fixedId\":true,\"id\":\"\","
-               "\"name\":\"Null\"},"
-               "\"kind\":\"Null\","
-               "\"fixedId\":true,"
-               "\"id\":\"objects\\/null\","
-               "\"valueAsString\":\"null\"}}]",
-               buffer);
+  EXPECT_STREQ(
+      "[{\"type\":\"@Instance\","
+      "\"_vmType\":\"null\","
+      "\"class\":{\"type\":\"@Class\",\"fixedId\":true,\"id\":\"\","
+      "\"name\":\"Null\"},"
+      "\"kind\":\"Null\","
+      "\"fixedId\":true,"
+      "\"id\":\"objects\\/null\","
+      "\"valueAsString\":\"null\"},"
+      "{\"object_key\":"
+      "{\"type\":\"@Instance\","
+      "\"_vmType\":\"null\","
+      "\"class\":{\"type\":\"@Class\",\"fixedId\":true,\"id\":\"\","
+      "\"name\":\"Null\"},"
+      "\"kind\":\"Null\","
+      "\"fixedId\":true,"
+      "\"id\":\"objects\\/null\","
+      "\"valueAsString\":\"null\"}}]",
+      buffer);
 }
 
 TEST_CASE(JSON_JSONStream_EscapedString) {
@@ -338,16 +335,13 @@
       const char* test_data = "{a, b, c},";
       AppendJSONStreamConsumer(Dart_StreamConsumer_kData, "",
                                reinterpret_cast<const uint8_t*>(&test_data[0]),
-                               strlen(test_data),
-                               &js);
+                               strlen(test_data), &js);
       AppendJSONStreamConsumer(Dart_StreamConsumer_kData, "",
                                reinterpret_cast<const uint8_t*>(&test_data[0]),
-                               strlen(test_data),
-                               &js);
+                               strlen(test_data), &js);
       AppendJSONStreamConsumer(Dart_StreamConsumer_kData, "",
                                reinterpret_cast<const uint8_t*>(&test_data[0]),
-                               strlen(test_data) - 1,
-                               &js);
+                               strlen(test_data) - 1, &js);
     }
   }
 
diff --git a/runtime/vm/kernel.cc b/runtime/vm/kernel.cc
new file mode 100644
index 0000000..f30e100
--- /dev/null
+++ b/runtime/vm/kernel.cc
@@ -0,0 +1,1211 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#include "vm/kernel.h"
+
+#if !defined(DART_PRECOMPILED_RUNTIME)
+namespace dart {
+
+namespace kernel {
+
+
+template <typename T>
+void VisitList(List<T>* list, Visitor* visitor) {
+  for (int i = 0; i < list->length(); ++i) {
+    (*list)[i]->AcceptVisitor(visitor);
+  }
+}
+
+
+Node::~Node() {}
+
+
+TreeNode::~TreeNode() {}
+
+
+void TreeNode::AcceptVisitor(Visitor* visitor) {
+  AcceptTreeVisitor(visitor);
+}
+
+
+Library::~Library() {}
+
+
+void Library::AcceptTreeVisitor(TreeVisitor* visitor) {
+  visitor->VisitLibrary(this);
+}
+
+
+void Library::VisitChildren(Visitor* visitor) {
+  VisitList(&classes(), visitor);
+  VisitList(&procedures(), visitor);
+  VisitList(&fields(), visitor);
+}
+
+
+Class::~Class() {}
+
+
+void Class::AcceptTreeVisitor(TreeVisitor* visitor) {
+  AcceptClassVisitor(visitor);
+}
+
+
+NormalClass::~NormalClass() {}
+
+
+void NormalClass::AcceptClassVisitor(ClassVisitor* visitor) {
+  visitor->VisitNormalClass(this);
+}
+
+
+void NormalClass::AcceptReferenceVisitor(ClassReferenceVisitor* visitor) {
+  visitor->VisitNormalClassReference(this);
+}
+
+
+void NormalClass::VisitChildren(Visitor* visitor) {
+  VisitList(&type_parameters(), visitor);
+  if (super_class() != NULL) visitor->VisitInterfaceType(super_class());
+  VisitList(&implemented_classes(), visitor);
+  VisitList(&constructors(), visitor);
+  VisitList(&procedures(), visitor);
+  VisitList(&fields(), visitor);
+}
+
+
+MixinClass::~MixinClass() {}
+
+
+void MixinClass::AcceptClassVisitor(ClassVisitor* visitor) {
+  visitor->VisitMixinClass(this);
+}
+
+
+void MixinClass::AcceptReferenceVisitor(ClassReferenceVisitor* visitor) {
+  visitor->VisitMixinClassReference(this);
+}
+
+
+void MixinClass::VisitChildren(Visitor* visitor) {
+  VisitList(&type_parameters(), visitor);
+  visitor->VisitInterfaceType(first());
+  visitor->VisitInterfaceType(second());
+  VisitList(&implemented_classes(), visitor);
+  VisitList(&constructors(), visitor);
+}
+
+
+Member::~Member() {}
+
+
+void Member::AcceptTreeVisitor(TreeVisitor* visitor) {
+  AcceptMemberVisitor(visitor);
+}
+
+
+Field::~Field() {}
+
+
+void Field::AcceptMemberVisitor(MemberVisitor* visitor) {
+  visitor->VisitField(this);
+}
+
+
+void Field::AcceptReferenceVisitor(MemberReferenceVisitor* visitor) {
+  visitor->VisitFieldReference(this);
+}
+
+
+void Field::VisitChildren(Visitor* visitor) {
+  type()->AcceptDartTypeVisitor(visitor);
+  visitor->VisitName(name());
+  if (initializer() != NULL) initializer()->AcceptExpressionVisitor(visitor);
+}
+
+
+Constructor::~Constructor() {}
+
+
+void Constructor::AcceptMemberVisitor(MemberVisitor* visitor) {
+  visitor->VisitConstructor(this);
+}
+
+
+void Constructor::AcceptReferenceVisitor(MemberReferenceVisitor* visitor) {
+  visitor->VisitConstructorReference(this);
+}
+
+
+void Constructor::VisitChildren(Visitor* visitor) {
+  visitor->VisitName(name());
+  visitor->VisitFunctionNode(function());
+  VisitList(&initializers(), visitor);
+}
+
+
+Procedure::~Procedure() {}
+
+
+void Procedure::AcceptMemberVisitor(MemberVisitor* visitor) {
+  visitor->VisitProcedure(this);
+}
+
+
+void Procedure::AcceptReferenceVisitor(MemberReferenceVisitor* visitor) {
+  visitor->VisitProcedureReference(this);
+}
+
+
+void Procedure::VisitChildren(Visitor* visitor) {
+  visitor->VisitName(name());
+  if (function() != NULL) visitor->VisitFunctionNode(function());
+}
+
+
+Initializer::~Initializer() {}
+
+
+void Initializer::AcceptTreeVisitor(TreeVisitor* visitor) {
+  AcceptInitializerVisitor(visitor);
+}
+
+
+InvalidInitializer::~InvalidInitializer() {}
+
+
+void InvalidInitializer::AcceptInitializerVisitor(InitializerVisitor* visitor) {
+  visitor->VisitInvalidInitializer(this);
+}
+
+
+void InvalidInitializer::VisitChildren(Visitor* visitor) {}
+
+
+FieldInitializer::~FieldInitializer() {}
+
+
+void FieldInitializer::AcceptInitializerVisitor(InitializerVisitor* visitor) {
+  visitor->VisitFieldInitializer(this);
+}
+
+
+void FieldInitializer::VisitChildren(Visitor* visitor) {
+  visitor->VisitFieldReference(field());
+  value()->AcceptExpressionVisitor(visitor);
+}
+
+
+SuperInitializer::~SuperInitializer() {}
+
+
+void SuperInitializer::AcceptInitializerVisitor(InitializerVisitor* visitor) {
+  visitor->VisitSuperInitializer(this);
+}
+
+
+void SuperInitializer::VisitChildren(Visitor* visitor) {
+  visitor->VisitConstructorReference(target());
+  visitor->VisitArguments(arguments());
+}
+
+
+RedirectingInitializer::~RedirectingInitializer() {}
+
+
+void RedirectingInitializer::AcceptInitializerVisitor(
+    InitializerVisitor* visitor) {
+  visitor->VisitRedirectingInitializer(this);
+}
+
+
+void RedirectingInitializer::VisitChildren(Visitor* visitor) {
+  visitor->VisitConstructorReference(target());
+  visitor->VisitArguments(arguments());
+}
+
+
+LocalInitializer::~LocalInitializer() {}
+
+
+void LocalInitializer::AcceptInitializerVisitor(InitializerVisitor* visitor) {
+  visitor->VisitLocalInitializer(this);
+}
+
+
+void LocalInitializer::VisitChildren(Visitor* visitor) {
+  visitor->VisitVariableDeclaration(variable());
+}
+
+
+FunctionNode::~FunctionNode() {}
+
+
+void FunctionNode::AcceptTreeVisitor(TreeVisitor* visitor) {
+  visitor->VisitFunctionNode(this);
+}
+
+
+void FunctionNode::VisitChildren(Visitor* visitor) {
+  VisitList(&type_parameters(), visitor);
+  VisitList(&positional_parameters(), visitor);
+  VisitList(&named_parameters(), visitor);
+  if (return_type() != NULL) return_type()->AcceptDartTypeVisitor(visitor);
+  if (body() != NULL) body()->AcceptStatementVisitor(visitor);
+}
+
+
+Expression::~Expression() {}
+
+
+void Expression::AcceptTreeVisitor(TreeVisitor* visitor) {
+  AcceptExpressionVisitor(visitor);
+}
+
+
+InvalidExpression::~InvalidExpression() {}
+
+
+void InvalidExpression::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitInvalidExpression(this);
+}
+
+
+void InvalidExpression::VisitChildren(Visitor* visitor) {}
+
+
+VariableGet::~VariableGet() {}
+
+
+void VariableGet::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitVariableGet(this);
+}
+
+
+void VariableGet::VisitChildren(Visitor* visitor) {}
+
+
+VariableSet::~VariableSet() {}
+
+
+void VariableSet::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitVariableSet(this);
+}
+
+
+void VariableSet::VisitChildren(Visitor* visitor) {
+  expression()->AcceptExpressionVisitor(visitor);
+}
+
+
+PropertyGet::~PropertyGet() {}
+
+
+void PropertyGet::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitPropertyGet(this);
+}
+
+
+void PropertyGet::VisitChildren(Visitor* visitor) {
+  receiver()->AcceptExpressionVisitor(visitor);
+  visitor->VisitName(name());
+}
+
+
+PropertySet::~PropertySet() {}
+
+
+void PropertySet::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitPropertySet(this);
+}
+
+
+void PropertySet::VisitChildren(Visitor* visitor) {
+  receiver()->AcceptExpressionVisitor(visitor);
+  visitor->VisitName(name());
+  value()->AcceptExpressionVisitor(visitor);
+}
+
+
+DirectPropertyGet::~DirectPropertyGet() {}
+
+
+void DirectPropertyGet::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitDirectPropertyGet(this);
+}
+
+
+void DirectPropertyGet::VisitChildren(Visitor* visitor) {
+  receiver()->AcceptExpressionVisitor(visitor);
+  target()->AcceptReferenceVisitor(visitor);
+}
+
+
+DirectPropertySet::~DirectPropertySet() {}
+
+
+void DirectPropertySet::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitDirectPropertySet(this);
+}
+
+
+void DirectPropertySet::VisitChildren(Visitor* visitor) {
+  receiver()->AcceptExpressionVisitor(visitor);
+  target()->AcceptReferenceVisitor(visitor);
+  value()->AcceptExpressionVisitor(visitor);
+}
+
+
+StaticGet::~StaticGet() {}
+
+
+void StaticGet::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitStaticGet(this);
+}
+
+
+void StaticGet::VisitChildren(Visitor* visitor) {
+  target()->AcceptReferenceVisitor(visitor);
+}
+
+
+StaticSet::~StaticSet() {}
+
+
+void StaticSet::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitStaticSet(this);
+}
+
+
+void StaticSet::VisitChildren(Visitor* visitor) {
+  target()->AcceptReferenceVisitor(visitor);
+  expression()->AcceptExpressionVisitor(visitor);
+}
+
+
+Arguments::~Arguments() {}
+
+
+void Arguments::AcceptTreeVisitor(TreeVisitor* visitor) {
+  visitor->VisitArguments(this);
+}
+
+
+void Arguments::VisitChildren(Visitor* visitor) {
+  VisitList(&types(), visitor);
+  VisitList(&positional(), visitor);
+  VisitList(&named(), visitor);
+}
+
+
+NamedExpression::~NamedExpression() {}
+
+
+void NamedExpression::AcceptTreeVisitor(TreeVisitor* visitor) {
+  visitor->VisitNamedExpression(this);
+}
+
+
+void NamedExpression::VisitChildren(Visitor* visitor) {
+  expression()->AcceptExpressionVisitor(visitor);
+}
+
+
+MethodInvocation::~MethodInvocation() {}
+
+
+void MethodInvocation::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitMethodInvocation(this);
+}
+
+
+void MethodInvocation::VisitChildren(Visitor* visitor) {
+  receiver()->AcceptExpressionVisitor(visitor);
+  visitor->VisitName(name());
+  visitor->VisitArguments(arguments());
+}
+
+
+DirectMethodInvocation::~DirectMethodInvocation() {}
+
+
+void DirectMethodInvocation::AcceptExpressionVisitor(
+    ExpressionVisitor* visitor) {
+  visitor->VisitDirectMethodInvocation(this);
+}
+
+
+void DirectMethodInvocation::VisitChildren(Visitor* visitor) {
+  receiver()->AcceptExpressionVisitor(visitor);
+  visitor->VisitProcedureReference(target());
+  visitor->VisitArguments(arguments());
+}
+
+
+StaticInvocation::~StaticInvocation() {}
+
+
+void StaticInvocation::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitStaticInvocation(this);
+}
+
+
+void StaticInvocation::VisitChildren(Visitor* visitor) {
+  visitor->VisitProcedureReference(procedure());
+  visitor->VisitArguments(arguments());
+}
+
+
+ConstructorInvocation::~ConstructorInvocation() {}
+
+
+void ConstructorInvocation::AcceptExpressionVisitor(
+    ExpressionVisitor* visitor) {
+  visitor->VisitConstructorInvocation(this);
+}
+
+
+void ConstructorInvocation::VisitChildren(Visitor* visitor) {
+  visitor->VisitConstructorReference(target());
+  visitor->VisitArguments(arguments());
+}
+
+
+Not::~Not() {}
+
+
+void Not::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitNot(this);
+}
+
+
+void Not::VisitChildren(Visitor* visitor) {
+  expression()->AcceptExpressionVisitor(visitor);
+}
+
+
+LogicalExpression::~LogicalExpression() {}
+
+
+void LogicalExpression::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitLogicalExpression(this);
+}
+
+
+void LogicalExpression::VisitChildren(Visitor* visitor) {
+  left()->AcceptExpressionVisitor(visitor);
+  right()->AcceptExpressionVisitor(visitor);
+}
+
+
+ConditionalExpression::~ConditionalExpression() {}
+
+
+void ConditionalExpression::AcceptExpressionVisitor(
+    ExpressionVisitor* visitor) {
+  visitor->VisitConditionalExpression(this);
+}
+
+
+void ConditionalExpression::VisitChildren(Visitor* visitor) {
+  condition()->AcceptExpressionVisitor(visitor);
+  then()->AcceptExpressionVisitor(visitor);
+  otherwise()->AcceptExpressionVisitor(visitor);
+}
+
+
+StringConcatenation::~StringConcatenation() {}
+
+
+void StringConcatenation::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitStringConcatenation(this);
+}
+
+
+void StringConcatenation::VisitChildren(Visitor* visitor) {
+  VisitList(&expressions(), visitor);
+}
+
+
+IsExpression::~IsExpression() {}
+
+
+void IsExpression::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitIsExpression(this);
+}
+
+
+void IsExpression::VisitChildren(Visitor* visitor) {
+  operand()->AcceptExpressionVisitor(visitor);
+  type()->AcceptDartTypeVisitor(visitor);
+}
+
+
+AsExpression::~AsExpression() {}
+
+
+void AsExpression::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitAsExpression(this);
+}
+
+
+void AsExpression::VisitChildren(Visitor* visitor) {
+  operand()->AcceptExpressionVisitor(visitor);
+  type()->AcceptDartTypeVisitor(visitor);
+}
+
+
+BasicLiteral::~BasicLiteral() {}
+
+
+void BasicLiteral::VisitChildren(Visitor* visitor) {}
+
+
+StringLiteral::~StringLiteral() {}
+
+
+void StringLiteral::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitStringLiteral(this);
+}
+
+
+BigintLiteral::~BigintLiteral() {}
+
+
+void BigintLiteral::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitBigintLiteral(this);
+}
+
+
+IntLiteral::~IntLiteral() {}
+
+
+void IntLiteral::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitIntLiteral(this);
+}
+
+
+DoubleLiteral::~DoubleLiteral() {}
+
+
+void DoubleLiteral::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitDoubleLiteral(this);
+}
+
+
+BoolLiteral::~BoolLiteral() {}
+
+
+void BoolLiteral::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitBoolLiteral(this);
+}
+
+
+NullLiteral::~NullLiteral() {}
+
+
+void NullLiteral::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitNullLiteral(this);
+}
+
+
+SymbolLiteral::~SymbolLiteral() {}
+
+
+void SymbolLiteral::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitSymbolLiteral(this);
+}
+
+
+void SymbolLiteral::VisitChildren(Visitor* visitor) {}
+
+
+TypeLiteral::~TypeLiteral() {}
+
+
+void TypeLiteral::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitTypeLiteral(this);
+}
+
+
+void TypeLiteral::VisitChildren(Visitor* visitor) {
+  type()->AcceptDartTypeVisitor(visitor);
+}
+
+
+ThisExpression::~ThisExpression() {}
+
+
+void ThisExpression::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitThisExpression(this);
+}
+
+
+void ThisExpression::VisitChildren(Visitor* visitor) {}
+
+
+Rethrow::~Rethrow() {}
+
+
+void Rethrow::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitRethrow(this);
+}
+
+
+void Rethrow::VisitChildren(Visitor* visitor) {}
+
+
+Throw::~Throw() {}
+
+
+void Throw::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitThrow(this);
+}
+
+
+void Throw::VisitChildren(Visitor* visitor) {
+  expression()->AcceptExpressionVisitor(visitor);
+}
+
+
+ListLiteral::~ListLiteral() {}
+
+
+void ListLiteral::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitListLiteral(this);
+}
+
+
+void ListLiteral::VisitChildren(Visitor* visitor) {
+  type()->AcceptDartTypeVisitor(visitor);
+  VisitList(&expressions(), visitor);
+}
+
+
+MapLiteral::~MapLiteral() {}
+
+
+void MapLiteral::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitMapLiteral(this);
+}
+
+
+void MapLiteral::VisitChildren(Visitor* visitor) {
+  key_type()->AcceptDartTypeVisitor(visitor);
+  value_type()->AcceptDartTypeVisitor(visitor);
+  VisitList(&entries(), visitor);
+}
+
+
+MapEntry::~MapEntry() {}
+
+
+void MapEntry::AcceptTreeVisitor(TreeVisitor* visitor) {
+  visitor->VisitMapEntry(this);
+}
+
+
+void MapEntry::VisitChildren(Visitor* visitor) {
+  key()->AcceptExpressionVisitor(visitor);
+  value()->AcceptExpressionVisitor(visitor);
+}
+
+
+AwaitExpression::~AwaitExpression() {}
+
+
+void AwaitExpression::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitAwaitExpression(this);
+}
+
+
+void AwaitExpression::VisitChildren(Visitor* visitor) {
+  operand()->AcceptExpressionVisitor(visitor);
+}
+
+
+FunctionExpression::~FunctionExpression() {}
+
+
+void FunctionExpression::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitFunctionExpression(this);
+}
+
+
+void FunctionExpression::VisitChildren(Visitor* visitor) {
+  visitor->VisitFunctionNode(function());
+}
+
+
+Let::~Let() {}
+
+
+void Let::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitLet(this);
+}
+
+
+void Let::VisitChildren(Visitor* visitor) {
+  visitor->VisitVariableDeclaration(variable());
+  body()->AcceptExpressionVisitor(visitor);
+}
+
+
+BlockExpression::~BlockExpression() {}
+
+
+void BlockExpression::AcceptExpressionVisitor(ExpressionVisitor* visitor) {
+  visitor->VisitBlockExpression(this);
+}
+
+
+void BlockExpression::VisitChildren(Visitor* visitor) {
+  visitor->VisitBlock(body());
+  value()->AcceptExpressionVisitor(visitor);
+}
+
+
+Statement::~Statement() {}
+
+
+void Statement::AcceptTreeVisitor(TreeVisitor* visitor) {
+  AcceptStatementVisitor(visitor);
+}
+
+
+InvalidStatement::~InvalidStatement() {}
+
+
+void InvalidStatement::AcceptStatementVisitor(StatementVisitor* visitor) {
+  visitor->VisitInvalidStatement(this);
+}
+
+
+void InvalidStatement::VisitChildren(Visitor* visitor) {}
+
+
+ExpressionStatement::~ExpressionStatement() {}
+
+
+void ExpressionStatement::AcceptStatementVisitor(StatementVisitor* visitor) {
+  visitor->VisitExpressionStatement(this);
+}
+
+
+void ExpressionStatement::VisitChildren(Visitor* visitor) {
+  expression()->AcceptExpressionVisitor(visitor);
+}
+
+
+Block::~Block() {}
+
+
+void Block::AcceptStatementVisitor(StatementVisitor* visitor) {
+  visitor->VisitBlock(this);
+}
+
+
+void Block::VisitChildren(Visitor* visitor) {
+  VisitList(&statements(), visitor);
+}
+
+
+EmptyStatement::~EmptyStatement() {}
+
+
+void EmptyStatement::AcceptStatementVisitor(StatementVisitor* visitor) {
+  visitor->VisitEmptyStatement(this);
+}
+
+
+void EmptyStatement::VisitChildren(Visitor* visitor) {}
+
+
+AssertStatement::~AssertStatement() {}
+
+
+void AssertStatement::AcceptStatementVisitor(StatementVisitor* visitor) {
+  visitor->VisitAssertStatement(this);
+}
+
+
+void AssertStatement::VisitChildren(Visitor* visitor) {
+  condition()->AcceptExpressionVisitor(visitor);
+  if (message() != NULL) message()->AcceptExpressionVisitor(visitor);
+}
+
+
+LabeledStatement::~LabeledStatement() {}
+
+
+void LabeledStatement::AcceptStatementVisitor(StatementVisitor* visitor) {
+  visitor->VisitLabeledStatement(this);
+}
+
+
+void LabeledStatement::VisitChildren(Visitor* visitor) {
+  body()->AcceptStatementVisitor(visitor);
+}
+
+
+BreakStatement::~BreakStatement() {}
+
+
+void BreakStatement::AcceptStatementVisitor(StatementVisitor* visitor) {
+  visitor->VisitBreakStatement(this);
+}
+
+
+void BreakStatement::VisitChildren(Visitor* visitor) {}
+
+
+WhileStatement::~WhileStatement() {}
+
+
+void WhileStatement::AcceptStatementVisitor(StatementVisitor* visitor) {
+  visitor->VisitWhileStatement(this);
+}
+
+
+void WhileStatement::VisitChildren(Visitor* visitor) {
+  condition()->AcceptExpressionVisitor(visitor);
+  body()->AcceptStatementVisitor(visitor);
+}
+
+
+DoStatement::~DoStatement() {}
+
+
+void DoStatement::AcceptStatementVisitor(StatementVisitor* visitor) {
+  visitor->VisitDoStatement(this);
+}
+
+
+void DoStatement::VisitChildren(Visitor* visitor) {
+  body()->AcceptStatementVisitor(visitor);
+  condition()->AcceptExpressionVisitor(visitor);
+}
+
+
+ForStatement::~ForStatement() {}
+
+
+void ForStatement::AcceptStatementVisitor(StatementVisitor* visitor) {
+  visitor->VisitForStatement(this);
+}
+
+
+void ForStatement::VisitChildren(Visitor* visitor) {
+  VisitList(&variables(), visitor);
+  if (condition() != NULL) condition()->AcceptExpressionVisitor(visitor);
+  VisitList(&updates(), visitor);
+  body()->AcceptStatementVisitor(visitor);
+}
+
+
+ForInStatement::~ForInStatement() {}
+
+
+void ForInStatement::AcceptStatementVisitor(StatementVisitor* visitor) {
+  visitor->VisitForInStatement(this);
+}
+
+
+void ForInStatement::VisitChildren(Visitor* visitor) {
+  visitor->VisitVariableDeclaration(variable());
+  iterable()->AcceptExpressionVisitor(visitor);
+  body()->AcceptStatementVisitor(visitor);
+}
+
+
+SwitchStatement::~SwitchStatement() {}
+
+
+void SwitchStatement::AcceptStatementVisitor(StatementVisitor* visitor) {
+  visitor->VisitSwitchStatement(this);
+}
+
+
+void SwitchStatement::VisitChildren(Visitor* visitor) {
+  condition()->AcceptExpressionVisitor(visitor);
+  VisitList(&cases(), visitor);
+}
+
+
+SwitchCase::~SwitchCase() {}
+
+
+void SwitchCase::AcceptTreeVisitor(TreeVisitor* visitor) {
+  visitor->VisitSwitchCase(this);
+}
+
+
+void SwitchCase::VisitChildren(Visitor* visitor) {
+  VisitList(&expressions(), visitor);
+  body()->AcceptStatementVisitor(visitor);
+}
+
+
+ContinueSwitchStatement::~ContinueSwitchStatement() {}
+
+
+void ContinueSwitchStatement::AcceptStatementVisitor(
+    StatementVisitor* visitor) {
+  visitor->VisitContinueSwitchStatement(this);
+}
+
+
+void ContinueSwitchStatement::VisitChildren(Visitor* visitor) {}
+
+
+IfStatement::~IfStatement() {}
+
+
+void IfStatement::AcceptStatementVisitor(StatementVisitor* visitor) {
+  visitor->VisitIfStatement(this);
+}
+
+
+void IfStatement::VisitChildren(Visitor* visitor) {
+  condition()->AcceptExpressionVisitor(visitor);
+  then()->AcceptStatementVisitor(visitor);
+  otherwise()->AcceptStatementVisitor(visitor);
+}
+
+
+ReturnStatement::~ReturnStatement() {}
+
+
+void ReturnStatement::AcceptStatementVisitor(StatementVisitor* visitor) {
+  visitor->VisitReturnStatement(this);
+}
+
+
+void ReturnStatement::VisitChildren(Visitor* visitor) {
+  if (expression() != NULL) expression()->AcceptExpressionVisitor(visitor);
+}
+
+
+TryCatch::~TryCatch() {}
+
+
+void TryCatch::AcceptStatementVisitor(StatementVisitor* visitor) {
+  visitor->VisitTryCatch(this);
+}
+
+
+void TryCatch::VisitChildren(Visitor* visitor) {
+  body()->AcceptStatementVisitor(visitor);
+  VisitList(&catches(), visitor);
+}
+
+
+Catch::~Catch() {}
+
+
+void Catch::AcceptTreeVisitor(TreeVisitor* visitor) {
+  visitor->VisitCatch(this);
+}
+
+
+void Catch::VisitChildren(Visitor* visitor) {
+  if (guard() != NULL) guard()->AcceptDartTypeVisitor(visitor);
+  if (exception() != NULL) visitor->VisitVariableDeclaration(exception());
+  if (stack_trace() != NULL) visitor->VisitVariableDeclaration(stack_trace());
+  body()->AcceptStatementVisitor(visitor);
+}
+
+
+TryFinally::~TryFinally() {}
+
+
+void TryFinally::AcceptStatementVisitor(StatementVisitor* visitor) {
+  visitor->VisitTryFinally(this);
+}
+
+
+void TryFinally::VisitChildren(Visitor* visitor) {
+  body()->AcceptStatementVisitor(visitor);
+  finalizer()->AcceptStatementVisitor(visitor);
+}
+
+
+YieldStatement::~YieldStatement() {}
+
+
+void YieldStatement::AcceptStatementVisitor(StatementVisitor* visitor) {
+  visitor->VisitYieldStatement(this);
+}
+
+
+void YieldStatement::VisitChildren(Visitor* visitor) {
+  expression()->AcceptExpressionVisitor(visitor);
+}
+
+
+VariableDeclaration::~VariableDeclaration() {}
+
+
+void VariableDeclaration::AcceptStatementVisitor(StatementVisitor* visitor) {
+  visitor->VisitVariableDeclaration(this);
+}
+
+
+void VariableDeclaration::VisitChildren(Visitor* visitor) {
+  if (type() != NULL) type()->AcceptDartTypeVisitor(visitor);
+  if (initializer() != NULL) initializer()->AcceptExpressionVisitor(visitor);
+}
+
+
+FunctionDeclaration::~FunctionDeclaration() {}
+
+
+void FunctionDeclaration::AcceptStatementVisitor(StatementVisitor* visitor) {
+  visitor->VisitFunctionDeclaration(this);
+}
+
+
+void FunctionDeclaration::VisitChildren(Visitor* visitor) {
+  visitor->VisitVariableDeclaration(variable());
+  visitor->VisitFunctionNode(function());
+}
+
+
+Name::~Name() {}
+
+
+void Name::AcceptVisitor(Visitor* visitor) {
+  visitor->VisitName(this);
+}
+
+
+void Name::VisitChildren(Visitor* visitor) {}
+
+
+InferredValue::~InferredValue() {}
+
+
+void InferredValue::AcceptVisitor(Visitor* visitor) {
+  visitor->VisitInferredValue(this);
+}
+
+
+void InferredValue::VisitChildren(Visitor* visitor) {}
+
+
+DartType::~DartType() {}
+
+
+void DartType::AcceptVisitor(Visitor* visitor) {
+  AcceptDartTypeVisitor(visitor);
+}
+
+
+InvalidType::~InvalidType() {}
+
+
+void InvalidType::AcceptDartTypeVisitor(DartTypeVisitor* visitor) {
+  visitor->VisitInvalidType(this);
+}
+
+
+void InvalidType::VisitChildren(Visitor* visitor) {}
+
+
+DynamicType::~DynamicType() {}
+
+
+void DynamicType::AcceptDartTypeVisitor(DartTypeVisitor* visitor) {
+  visitor->VisitDynamicType(this);
+}
+
+
+void DynamicType::VisitChildren(Visitor* visitor) {}
+
+
+VoidType::~VoidType() {}
+
+
+void VoidType::AcceptDartTypeVisitor(DartTypeVisitor* visitor) {
+  visitor->VisitVoidType(this);
+}
+
+
+void VoidType::VisitChildren(Visitor* visitor) {}
+
+
+InterfaceType::~InterfaceType() {}
+
+
+void InterfaceType::AcceptDartTypeVisitor(DartTypeVisitor* visitor) {
+  visitor->VisitInterfaceType(this);
+}
+
+
+void InterfaceType::VisitChildren(Visitor* visitor) {
+  klass()->AcceptReferenceVisitor(visitor);
+  VisitList(&type_arguments(), visitor);
+}
+
+
+FunctionType::~FunctionType() {}
+
+
+void FunctionType::AcceptDartTypeVisitor(DartTypeVisitor* visitor) {
+  visitor->VisitFunctionType(this);
+}
+
+
+void FunctionType::VisitChildren(Visitor* visitor) {
+  VisitList(&type_parameters(), visitor);
+  VisitList(&positional_parameters(), visitor);
+  for (int i = 0; i < named_parameters().length(); ++i) {
+    named_parameters()[i]->second()->AcceptDartTypeVisitor(visitor);
+  }
+  return_type()->AcceptDartTypeVisitor(visitor);
+}
+
+
+TypeParameterType::~TypeParameterType() {}
+
+
+void TypeParameterType::AcceptDartTypeVisitor(DartTypeVisitor* visitor) {
+  visitor->VisitTypeParameterType(this);
+}
+
+
+void TypeParameterType::VisitChildren(Visitor* visitor) {}
+
+
+TypeParameter::~TypeParameter() {}
+
+
+void TypeParameter::AcceptTreeVisitor(TreeVisitor* visitor) {
+  visitor->VisitTypeParameter(this);
+}
+
+
+void TypeParameter::VisitChildren(Visitor* visitor) {
+  bound()->AcceptDartTypeVisitor(visitor);
+}
+
+
+Program::~Program() {}
+
+
+void Program::AcceptTreeVisitor(TreeVisitor* visitor) {
+  visitor->VisitProgram(this);
+}
+
+
+void Program::VisitChildren(Visitor* visitor) {
+  VisitList(&libraries(), visitor);
+  visitor->VisitProcedureReference(main_method());
+}
+
+
+}  // namespace kernel
+
+}  // namespace dart
+#endif  // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/kernel.h b/runtime/vm/kernel.h
new file mode 100644
index 0000000..15bf633
--- /dev/null
+++ b/runtime/vm/kernel.h
@@ -0,0 +1,3268 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#ifndef RUNTIME_VM_KERNEL_H_
+#define RUNTIME_VM_KERNEL_H_
+
+#if !defined(DART_PRECOMPILED_RUNTIME)
+#include "platform/assert.h"
+#include "vm/allocation.h"
+#include "vm/globals.h"
+#include "vm/token_position.h"
+
+
+#define KERNEL_NODES_DO(M)                                                     \
+  M(Name)                                                                      \
+  M(InferredValue)                                                             \
+  M(DartType)                                                                  \
+  M(InvalidType)                                                               \
+  M(DynamicType)                                                               \
+  M(VoidType)                                                                  \
+  M(InterfaceType)                                                             \
+  M(FunctionType)                                                              \
+  M(TypeParameterType)
+
+#define KERNEL_TREE_NODES_DO(M)                                                \
+  M(Library)                                                                   \
+  M(Class)                                                                     \
+  M(NormalClass)                                                               \
+  M(MixinClass)                                                                \
+  M(Member)                                                                    \
+  M(Field)                                                                     \
+  M(Constructor)                                                               \
+  M(Procedure)                                                                 \
+  M(Initializer)                                                               \
+  M(InvalidInitializer)                                                        \
+  M(FieldInitializer)                                                          \
+  M(SuperInitializer)                                                          \
+  M(RedirectingInitializer)                                                    \
+  M(LocalInitializer)                                                          \
+  M(FunctionNode)                                                              \
+  M(Expression)                                                                \
+  M(InvalidExpression)                                                         \
+  M(VariableGet)                                                               \
+  M(VariableSet)                                                               \
+  M(PropertyGet)                                                               \
+  M(PropertySet)                                                               \
+  M(DirectPropertyGet)                                                         \
+  M(DirectPropertySet)                                                         \
+  M(StaticGet)                                                                 \
+  M(StaticSet)                                                                 \
+  M(Arguments)                                                                 \
+  M(NamedExpression)                                                           \
+  M(MethodInvocation)                                                          \
+  M(DirectMethodInvocation)                                                    \
+  M(StaticInvocation)                                                          \
+  M(ConstructorInvocation)                                                     \
+  M(Not)                                                                       \
+  M(LogicalExpression)                                                         \
+  M(ConditionalExpression)                                                     \
+  M(StringConcatenation)                                                       \
+  M(IsExpression)                                                              \
+  M(AsExpression)                                                              \
+  M(BasicLiteral)                                                              \
+  M(StringLiteral)                                                             \
+  M(BigintLiteral)                                                             \
+  M(IntLiteral)                                                                \
+  M(DoubleLiteral)                                                             \
+  M(BoolLiteral)                                                               \
+  M(NullLiteral)                                                               \
+  M(SymbolLiteral)                                                             \
+  M(TypeLiteral)                                                               \
+  M(ThisExpression)                                                            \
+  M(Rethrow)                                                                   \
+  M(Throw)                                                                     \
+  M(ListLiteral)                                                               \
+  M(MapLiteral)                                                                \
+  M(MapEntry)                                                                  \
+  M(AwaitExpression)                                                           \
+  M(FunctionExpression)                                                        \
+  M(Let)                                                                       \
+  M(BlockExpression)                                                           \
+  M(Statement)                                                                 \
+  M(InvalidStatement)                                                          \
+  M(ExpressionStatement)                                                       \
+  M(Block)                                                                     \
+  M(EmptyStatement)                                                            \
+  M(AssertStatement)                                                           \
+  M(LabeledStatement)                                                          \
+  M(BreakStatement)                                                            \
+  M(WhileStatement)                                                            \
+  M(DoStatement)                                                               \
+  M(ForStatement)                                                              \
+  M(ForInStatement)                                                            \
+  M(SwitchStatement)                                                           \
+  M(SwitchCase)                                                                \
+  M(ContinueSwitchStatement)                                                   \
+  M(IfStatement)                                                               \
+  M(ReturnStatement)                                                           \
+  M(TryCatch)                                                                  \
+  M(Catch)                                                                     \
+  M(TryFinally)                                                                \
+  M(YieldStatement)                                                            \
+  M(VariableDeclaration)                                                       \
+  M(FunctionDeclaration)                                                       \
+  M(TypeParameter)                                                             \
+  M(Program)
+
+#define KERNEL_ALL_NODES_DO(M)                                                 \
+  M(Node)                                                                      \
+  KERNEL_NODES_DO(M)                                                           \
+  M(TreeNode)                                                                  \
+  KERNEL_TREE_NODES_DO(M)
+
+#define KERNEL_VISITORS_DO(M)                                                  \
+  M(ExpressionVisitor)                                                         \
+  M(StatementVisitor)                                                          \
+  M(MemberVisitor)                                                             \
+  M(ClassVisitor)                                                              \
+  M(InitializerVisitor)                                                        \
+  M(DartTypeVisitor)                                                           \
+  M(ClassReferenceVisitor)                                                     \
+  M(MemberReferenceVisitor)                                                    \
+  M(TreeVisitor)                                                               \
+  M(Visitor)
+
+namespace dart {
+
+class Field;
+class ParsedFunction;
+class Zone;
+
+namespace kernel {
+
+
+class Reader;
+class TreeNode;
+class TypeParameter;
+class Writer;
+
+// Boxes a value of type `T*` and `delete`s it on destruction.
+template <typename T>
+class Child {
+ public:
+  Child() : pointer_(NULL) {}
+  explicit Child(T* value) : pointer_(value) {}
+
+  ~Child() { delete pointer_; }
+
+  // Support `Child<T> box = T* obj`.
+  T*& operator=(T* value) {
+    ASSERT(pointer_ == NULL);
+    return pointer_ = value;
+  }
+
+  // Implicitly convert `Child<T>` to `T*`.
+  operator T*&() { return pointer_; }
+
+  T* operator->() { return pointer_; }
+
+ private:
+  T* pointer_;
+};
+
+// Boxes a value of type `T*` (only used to mark a member as a weak reference).
+template <typename T>
+class Ref {
+ public:
+  Ref() : pointer_(NULL) {}
+  explicit Ref(T* value) : pointer_(value) {}
+
+  // Support `Ref<T> box = T* obj`.
+  T*& operator=(T* value) {
+    ASSERT(pointer_ == NULL);
+    return pointer_ = value;
+  }
+
+  // Implicitly convert `Ref<T>` to `T*`.
+  operator T*&() { return pointer_; }
+
+  T* operator->() { return pointer_; }
+
+ private:
+  T* pointer_;
+};
+
+
+template <typename T>
+class List {
+ public:
+  List() : array_(NULL), length_(0) {}
+  ~List();
+
+  template <typename IT>
+  void ReadFrom(Reader* reader);
+
+  template <typename IT>
+  void ReadFrom(Reader* reader, TreeNode* parent);
+
+  template <typename IT>
+  void ReadFromStatic(Reader* reader);
+
+  void WriteTo(Writer* writer);
+
+  template <typename IT>
+  void WriteToStatic(Writer* writer);
+
+  // Extends the array to at least be able to hold [length] elements.
+  //
+  // Free places will be filled with `NULL` values.
+  void EnsureInitialized(int length);
+
+  // Returns element at [index].
+  //
+  // If the array is not big enough, it will be grown via `EnsureInitialized`.
+  // If the element doesn't exist, it will be created via `new IT()`.
+  template <typename IT>
+  IT* GetOrCreate(int index);
+
+  template <typename IT, typename PT>
+  IT* GetOrCreate(int index, PT* parent);
+
+  // Returns element at [index].
+  T*& operator[](int index) {
+    ASSERT(index < length_);
+    return array_[index];
+  }
+
+  int length() { return length_; }
+
+  T** raw_array() { return array_; }
+
+ private:
+  T** array_;
+  int length_;
+
+  DISALLOW_COPY_AND_ASSIGN(List);
+};
+
+
+class TypeParameterList : public List<TypeParameter> {
+ public:
+  void ReadFrom(Reader* reader);
+  void WriteTo(Writer* writer);
+};
+
+
+template <typename A, typename B>
+class Tuple {
+ public:
+  static Tuple<A, B>* ReadFrom(Reader* reader);
+  void WriteTo(Writer* writer);
+
+  Tuple(A* a, B* b) : first_(a), second_(b) {}
+
+  A* first() { return first_; }
+  B* second() { return second_; }
+
+ private:
+  Tuple() {}
+
+  Ref<A> first_;
+  Child<B> second_;
+
+  DISALLOW_COPY_AND_ASSIGN(Tuple);
+};
+
+
+class String {
+ public:
+  static String* ReadFrom(Reader* reader);
+  static String* ReadFromImpl(Reader* reader);
+  void WriteTo(Writer* writer);
+  void WriteToImpl(Writer* writer);
+
+  String(const uint8_t* utf8, int length) {
+    buffer_ = new uint8_t[length];
+    size_ = length;
+    memmove(buffer_, utf8, length);
+  }
+  ~String() { delete[] buffer_; }
+
+  uint8_t* buffer() { return buffer_; }
+  int size() { return size_; }
+
+  bool is_empty() { return size_ == 0; }
+
+ private:
+  uint8_t* buffer_;
+  int size_;
+
+  DISALLOW_COPY_AND_ASSIGN(String);
+};
+
+
+class StringTable {
+ public:
+  void ReadFrom(Reader* reader);
+  void WriteTo(Writer* writer);
+
+  List<String>& strings() { return strings_; }
+
+ private:
+  StringTable() {}
+
+  friend class Program;
+
+  List<String> strings_;
+
+  DISALLOW_COPY_AND_ASSIGN(StringTable);
+};
+
+
+class LineStartingTable {
+ public:
+  void ReadFrom(Reader* reader);
+  void WriteTo(Writer* writer);
+  ~LineStartingTable() {
+    for (intptr_t i = 0; i < size_; ++i) {
+      delete[] values_[i];
+    }
+    delete[] values_;
+  }
+
+  intptr_t size() { return size_; }
+  intptr_t* valuesFor(int i) { return values_[i]; }
+
+ private:
+  LineStartingTable() : values_(NULL), size_(0) {}
+
+  friend class Program;
+
+  intptr_t** values_;
+  intptr_t size_;
+
+  DISALLOW_COPY_AND_ASSIGN(LineStartingTable);
+};
+
+// Forward declare all classes.
+#define DO(name) class name;
+KERNEL_ALL_NODES_DO(DO)
+KERNEL_VISITORS_DO(DO)
+#undef DO
+
+
+#define DEFINE_CASTING_OPERATIONS(klass)                                       \
+  virtual bool Is##klass() { return true; }                                    \
+                                                                               \
+  static klass* Cast(Node* node) {                                             \
+    ASSERT(node == NULL || node->Is##klass());                                 \
+    return static_cast<klass*>(node);                                          \
+  }                                                                            \
+                                                                               \
+  virtual Node::NodeType Type() { return Node::kType##klass; }
+
+#define DEFINE_IS_OPERATION(klass)                                             \
+  virtual bool Is##klass() { return false; }
+
+#define DEFINE_ALL_IS_OPERATIONS()                                             \
+  KERNEL_NODES_DO(DEFINE_IS_OPERATION)                                         \
+  DEFINE_IS_OPERATION(TreeNode)                                                \
+  KERNEL_TREE_NODES_DO(DEFINE_IS_OPERATION)
+
+
+class Node {
+ public:
+  virtual ~Node();
+
+  enum NodeType {
+#define DO(name) kType##name,
+    KERNEL_ALL_NODES_DO(DO)
+#undef DO
+
+        kNumTypes
+  };
+
+  DEFINE_ALL_IS_OPERATIONS();
+  DEFINE_CASTING_OPERATIONS(Node);
+
+  virtual void AcceptVisitor(Visitor* visitor) = 0;
+  virtual void VisitChildren(Visitor* visitor) = 0;
+
+ protected:
+  Node() {}
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(Node);
+};
+
+
+class TreeNode : public Node {
+ public:
+  virtual ~TreeNode();
+
+  DEFINE_CASTING_OPERATIONS(TreeNode);
+
+  virtual void AcceptVisitor(Visitor* visitor);
+  virtual void AcceptTreeVisitor(TreeVisitor* visitor) = 0;
+
+ protected:
+  TreeNode() {}
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(TreeNode);
+};
+
+
+class Library : public TreeNode {
+ public:
+  Library* ReadFrom(Reader* reader);
+  void WriteTo(Writer* writer);
+
+  virtual ~Library();
+
+  DEFINE_CASTING_OPERATIONS(Library);
+
+  virtual void AcceptTreeVisitor(TreeVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  String* import_uri() { return import_uri_; }
+  intptr_t source_uri_index() { return source_uri_index_; }
+  String* name() { return name_; }
+  List<Class>& classes() { return classes_; }
+  List<Field>& fields() { return fields_; }
+  List<Procedure>& procedures() { return procedures_; }
+
+  bool IsCorelibrary() {
+    static const char* dart_library = "dart:";
+    static intptr_t dart_library_length = strlen(dart_library);
+    static const char* patch_library = "dart:_patch";
+    static intptr_t patch_library_length = strlen(patch_library);
+
+    if (name_->size() < 5) return false;
+
+    // Check for dart: prefix.
+    char* buffer = reinterpret_cast<char*>(import_uri_->buffer());
+    if (strncmp(buffer, dart_library, dart_library_length) != 0) {
+      return false;
+    }
+
+    // Rasta emits dart:_patch and we should treat it as a user library.
+    if (name_->size() == patch_library_length &&
+        strncmp(buffer, patch_library, patch_library_length) == 0) {
+      return false;
+    }
+    return true;
+  }
+
+ private:
+  Library() : name_(NULL) {}
+
+  template <typename T>
+  friend class List;
+
+  Ref<String> name_;
+  Ref<String> import_uri_;
+  intptr_t source_uri_index_;
+  List<Class> classes_;
+  List<Field> fields_;
+  List<Procedure> procedures_;
+
+  DISALLOW_COPY_AND_ASSIGN(Library);
+};
+
+
+class Class : public TreeNode {
+ public:
+  Class* ReadFrom(Reader* reader);
+  void WriteTo(Writer* writer);
+
+  virtual ~Class();
+
+  DEFINE_CASTING_OPERATIONS(Class);
+
+  virtual void AcceptTreeVisitor(TreeVisitor* visitor);
+  virtual void AcceptClassVisitor(ClassVisitor* visitor) = 0;
+  virtual void AcceptReferenceVisitor(ClassReferenceVisitor* visitor) = 0;
+
+  Library* parent() { return parent_; }
+  String* name() { return name_; }
+  intptr_t source_uri_index() { return source_uri_index_; }
+  bool is_abstract() { return is_abstract_; }
+  List<Expression>& annotations() { return annotations_; }
+
+  virtual List<TypeParameter>& type_parameters() = 0;
+  virtual List<InterfaceType>& implemented_classes() = 0;
+  virtual List<Field>& fields() = 0;
+  virtual List<Constructor>& constructors() = 0;
+  virtual List<Procedure>& procedures() = 0;
+
+ protected:
+  Class() : is_abstract_(false) {}
+
+ private:
+  template <typename T>
+  friend class List;
+
+  Ref<Library> parent_;
+  Ref<String> name_;
+  intptr_t source_uri_index_;
+  bool is_abstract_;
+  List<Expression> annotations_;
+
+  DISALLOW_COPY_AND_ASSIGN(Class);
+};
+
+
+class NormalClass : public Class {
+ public:
+  NormalClass* ReadFrom(Reader* reader);
+  void WriteTo(Writer* writer);
+
+  virtual ~NormalClass();
+
+  DEFINE_CASTING_OPERATIONS(NormalClass);
+
+  virtual void AcceptClassVisitor(ClassVisitor* visitor);
+  virtual void AcceptReferenceVisitor(ClassReferenceVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  virtual TypeParameterList& type_parameters() { return type_parameters_; }
+  InterfaceType* super_class() { return super_class_; }
+  virtual List<InterfaceType>& implemented_classes() {
+    return implemented_classes_;
+  }
+  virtual List<Constructor>& constructors() { return constructors_; }
+  virtual List<Procedure>& procedures() { return procedures_; }
+  virtual List<Field>& fields() { return fields_; }
+
+ private:
+  NormalClass() {}
+
+  template <typename T>
+  friend class List;
+
+  TypeParameterList type_parameters_;
+  Child<InterfaceType> super_class_;
+  List<InterfaceType> implemented_classes_;
+  List<Constructor> constructors_;
+  List<Procedure> procedures_;
+  List<Field> fields_;
+
+  DISALLOW_COPY_AND_ASSIGN(NormalClass);
+};
+
+
+class MixinClass : public Class {
+ public:
+  MixinClass* ReadFrom(Reader* reader);
+  void WriteTo(Writer* writer);
+
+  virtual ~MixinClass();
+
+  DEFINE_CASTING_OPERATIONS(MixinClass);
+
+  virtual void AcceptClassVisitor(ClassVisitor* visitor);
+  virtual void AcceptReferenceVisitor(ClassReferenceVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  virtual TypeParameterList& type_parameters() { return type_parameters_; }
+  InterfaceType* first() { return first_; }
+  InterfaceType* second() { return second_; }
+  virtual List<InterfaceType>& implemented_classes() {
+    return implemented_classes_;
+  }
+  virtual List<Constructor>& constructors() { return constructors_; }
+  virtual List<Field>& fields() { return fields_; }
+  virtual List<Procedure>& procedures() { return procedures_; }
+
+ private:
+  MixinClass() {}
+
+  template <typename T>
+  friend class List;
+
+  TypeParameterList type_parameters_;
+  Child<InterfaceType> first_;
+  Child<InterfaceType> second_;
+  List<InterfaceType> implemented_classes_;
+  List<Constructor> constructors_;
+
+  // Dummy instances which are empty lists.
+  List<Field> fields_;
+  List<Procedure> procedures_;
+
+  DISALLOW_COPY_AND_ASSIGN(MixinClass);
+};
+
+
+class Member : public TreeNode {
+ public:
+  virtual ~Member();
+
+  DEFINE_CASTING_OPERATIONS(Member);
+
+  virtual void AcceptTreeVisitor(TreeVisitor* visitor);
+  virtual void AcceptMemberVisitor(MemberVisitor* visitor) = 0;
+  virtual void AcceptReferenceVisitor(MemberReferenceVisitor* visitor) = 0;
+
+  TreeNode* parent() { return parent_; }
+  Name* name() { return name_; }
+  List<Expression>& annotations() { return annotations_; }
+
+ protected:
+  Member() {}
+
+  template <typename T>
+  friend class List;
+
+  Ref<TreeNode> parent_;
+  Child<Name> name_;
+  List<Expression> annotations_;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(Member);
+};
+
+
+class Field : public Member {
+ public:
+  enum Flags {
+    kFlagFinal = 1 << 0,
+    kFlagConst = 1 << 1,
+    kFlagStatic = 1 << 2,
+  };
+
+  Field* ReadFrom(Reader* reader);
+  void WriteTo(Writer* writer);
+
+  virtual ~Field();
+
+  DEFINE_CASTING_OPERATIONS(Field);
+
+  virtual void AcceptMemberVisitor(MemberVisitor* visitor);
+  virtual void AcceptReferenceVisitor(MemberReferenceVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  bool IsConst() { return (flags_ & kFlagConst) == kFlagConst; }
+  bool IsFinal() { return (flags_ & kFlagFinal) == kFlagFinal; }
+  bool IsStatic() { return (flags_ & kFlagStatic) == kFlagStatic; }
+  intptr_t source_uri_index() { return source_uri_index_; }
+
+  DartType* type() { return type_; }
+  InferredValue* inferred_value() { return inferred_value_; }
+  Expression* initializer() { return initializer_; }
+  TokenPosition position() { return position_; }
+
+ private:
+  Field() : position_(TokenPosition::kNoSource) {}
+
+  template <typename T>
+  friend class List;
+
+  word flags_;
+  intptr_t source_uri_index_;
+  Child<DartType> type_;
+  Child<InferredValue> inferred_value_;
+  Child<Expression> initializer_;
+  TokenPosition position_;
+
+  DISALLOW_COPY_AND_ASSIGN(Field);
+};
+
+
+class Constructor : public Member {
+ public:
+  enum Flags {
+    kFlagConst = 1 << 0,
+    kFlagExternal = 1 << 1,
+  };
+
+  Constructor* ReadFrom(Reader* reader);
+  void WriteTo(Writer* writer);
+
+  virtual ~Constructor();
+
+  DEFINE_CASTING_OPERATIONS(Constructor);
+
+  virtual void AcceptMemberVisitor(MemberVisitor* visitor);
+  virtual void AcceptReferenceVisitor(MemberReferenceVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  bool IsExternal() { return (flags_ & kFlagExternal) == kFlagExternal; }
+  bool IsConst() { return (flags_ & kFlagConst) == kFlagConst; }
+
+  FunctionNode* function() { return function_; }
+  List<Initializer>& initializers() { return initializers_; }
+
+ private:
+  template <typename T>
+  friend class List;
+
+  Constructor() {}
+
+  uint8_t flags_;
+  Child<FunctionNode> function_;
+  List<Initializer> initializers_;
+
+  DISALLOW_COPY_AND_ASSIGN(Constructor);
+};
+
+
+class Procedure : public Member {
+ public:
+  enum Flags {
+    kFlagStatic = 1 << 0,
+    kFlagAbstract = 1 << 1,
+    kFlagExternal = 1 << 2,
+    kFlagConst = 1 << 3,  // Only for external const factories.
+  };
+
+  // Keep in sync with package:dynamo/lib/ast.dart:ProcedureKind
+  enum ProcedureKind {
+    kMethod,
+    kGetter,
+    kSetter,
+    kOperator,
+    kFactory,
+
+    kIncompleteProcedure = 255
+  };
+
+  Procedure* ReadFrom(Reader* reader);
+  void WriteTo(Writer* writer);
+
+  virtual ~Procedure();
+
+  DEFINE_CASTING_OPERATIONS(Procedure);
+
+  virtual void AcceptMemberVisitor(MemberVisitor* visitor);
+  virtual void AcceptReferenceVisitor(MemberReferenceVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  ProcedureKind kind() { return kind_; }
+  FunctionNode* function() { return function_; }
+
+  bool IsStatic() { return (flags_ & kFlagStatic) == kFlagStatic; }
+  bool IsAbstract() { return (flags_ & kFlagAbstract) == kFlagAbstract; }
+  bool IsExternal() { return (flags_ & kFlagExternal) == kFlagExternal; }
+  bool IsConst() { return (flags_ & kFlagConst) == kFlagConst; }
+  intptr_t source_uri_index() { return source_uri_index_; }
+
+ private:
+  Procedure() : kind_(kIncompleteProcedure), flags_(0), function_(NULL) {}
+
+  template <typename T>
+  friend class List;
+
+  ProcedureKind kind_;
+  word flags_;
+  intptr_t source_uri_index_;
+  Child<FunctionNode> function_;
+
+  DISALLOW_COPY_AND_ASSIGN(Procedure);
+};
+
+
+class Initializer : public TreeNode {
+ public:
+  static Initializer* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer) = 0;
+
+  virtual ~Initializer();
+
+  DEFINE_CASTING_OPERATIONS(Initializer);
+
+  virtual void AcceptTreeVisitor(TreeVisitor* visitor);
+  virtual void AcceptInitializerVisitor(InitializerVisitor* visitor) = 0;
+
+ protected:
+  Initializer() {}
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(Initializer);
+};
+
+
+class InvalidInitializer : public Initializer {
+ public:
+  static InvalidInitializer* ReadFromImpl(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~InvalidInitializer();
+
+  DEFINE_CASTING_OPERATIONS(InvalidInitializer);
+  virtual void AcceptInitializerVisitor(InitializerVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+ private:
+  InvalidInitializer() {}
+
+  DISALLOW_COPY_AND_ASSIGN(InvalidInitializer);
+};
+
+
+class FieldInitializer : public Initializer {
+ public:
+  static FieldInitializer* ReadFromImpl(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~FieldInitializer();
+
+  DEFINE_CASTING_OPERATIONS(FieldInitializer);
+
+  virtual void AcceptInitializerVisitor(InitializerVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Field* field() { return field_; }
+  Expression* value() { return value_; }
+
+ private:
+  FieldInitializer() {}
+
+  Ref<Field> field_;
+  Child<Expression> value_;
+
+  DISALLOW_COPY_AND_ASSIGN(FieldInitializer);
+};
+
+
+class SuperInitializer : public Initializer {
+ public:
+  static SuperInitializer* ReadFromImpl(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~SuperInitializer();
+
+  DEFINE_CASTING_OPERATIONS(SuperInitializer);
+
+  virtual void AcceptInitializerVisitor(InitializerVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Constructor* target() { return target_; }
+  Arguments* arguments() { return arguments_; }
+
+ private:
+  SuperInitializer() {}
+
+  Ref<Constructor> target_;
+  Child<Arguments> arguments_;
+
+  DISALLOW_COPY_AND_ASSIGN(SuperInitializer);
+};
+
+
+class RedirectingInitializer : public Initializer {
+ public:
+  static RedirectingInitializer* ReadFromImpl(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~RedirectingInitializer();
+
+  DEFINE_CASTING_OPERATIONS(RedirectingInitializer);
+
+  virtual void AcceptInitializerVisitor(InitializerVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Constructor* target() { return target_; }
+  Arguments* arguments() { return arguments_; }
+
+ private:
+  RedirectingInitializer() {}
+
+  Ref<Constructor> target_;
+  Child<Arguments> arguments_;
+
+  DISALLOW_COPY_AND_ASSIGN(RedirectingInitializer);
+};
+
+
+class LocalInitializer : public Initializer {
+ public:
+  static LocalInitializer* ReadFromImpl(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~LocalInitializer();
+
+  DEFINE_CASTING_OPERATIONS(LocalInitializer);
+
+  virtual void AcceptInitializerVisitor(InitializerVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  VariableDeclaration* variable() { return variable_; }
+
+ private:
+  LocalInitializer() {}
+
+  Child<VariableDeclaration> variable_;
+
+  DISALLOW_COPY_AND_ASSIGN(LocalInitializer);
+};
+
+
+class FunctionNode : public TreeNode {
+ public:
+  enum AsyncMarker {
+    kSync = 0,
+    kSyncStar = 1,
+    kAsync = 2,
+    kAsyncStar = 3,
+    kSyncYielding = 4,
+  };
+
+  static FunctionNode* ReadFrom(Reader* reader);
+  void WriteTo(Writer* writer);
+
+  virtual ~FunctionNode();
+
+  DEFINE_CASTING_OPERATIONS(FunctionNode);
+
+  virtual void AcceptTreeVisitor(TreeVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  AsyncMarker async_marker() { return async_marker_; }
+  TypeParameterList& type_parameters() { return type_parameters_; }
+  int required_parameter_count() { return required_parameter_count_; }
+  List<VariableDeclaration>& positional_parameters() {
+    return positional_parameters_;
+  }
+  List<VariableDeclaration>& named_parameters() { return named_parameters_; }
+  DartType* return_type() { return return_type_; }
+  InferredValue* inferred_return_value() { return inferred_return_value_; }
+  Statement* body() { return body_; }
+
+ private:
+  FunctionNode() {}
+
+  AsyncMarker async_marker_;
+  TypeParameterList type_parameters_;
+  int required_parameter_count_;
+  List<VariableDeclaration> positional_parameters_;
+  List<VariableDeclaration> named_parameters_;
+  Child<DartType> return_type_;
+  Child<InferredValue> inferred_return_value_;
+  Child<Statement> body_;
+
+  DISALLOW_COPY_AND_ASSIGN(FunctionNode);
+};
+
+
+class Expression : public TreeNode {
+ public:
+  static Expression* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer) = 0;
+
+  virtual ~Expression();
+
+  DEFINE_CASTING_OPERATIONS(Expression);
+
+  virtual void AcceptTreeVisitor(TreeVisitor* visitor);
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor) = 0;
+  TokenPosition position() { return position_; }
+
+ protected:
+  Expression() : position_(TokenPosition::kNoSource) {}
+  TokenPosition position_;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(Expression);
+};
+
+
+class InvalidExpression : public Expression {
+ public:
+  static InvalidExpression* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~InvalidExpression();
+  virtual void VisitChildren(Visitor* visitor);
+
+  DEFINE_CASTING_OPERATIONS(InvalidExpression);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+
+ private:
+  InvalidExpression() {}
+
+  DISALLOW_COPY_AND_ASSIGN(InvalidExpression);
+};
+
+
+class VariableGet : public Expression {
+ public:
+  static VariableGet* ReadFrom(Reader* reader);
+  static VariableGet* ReadFrom(Reader* reader, uint8_t payload);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~VariableGet();
+
+  DEFINE_CASTING_OPERATIONS(VariableGet);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  VariableDeclaration* variable() { return variable_; }
+
+ private:
+  VariableGet() {}
+
+  Ref<VariableDeclaration> variable_;
+
+  DISALLOW_COPY_AND_ASSIGN(VariableGet);
+};
+
+
+class VariableSet : public Expression {
+ public:
+  static VariableSet* ReadFrom(Reader* reader);
+  static VariableSet* ReadFrom(Reader* reader, uint8_t payload);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~VariableSet();
+
+  DEFINE_CASTING_OPERATIONS(VariableSet);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  VariableDeclaration* variable() { return variable_; }
+  Expression* expression() { return expression_; }
+
+ private:
+  VariableSet() {}
+
+  Ref<VariableDeclaration> variable_;
+  Child<Expression> expression_;
+
+  DISALLOW_COPY_AND_ASSIGN(VariableSet);
+};
+
+
+class PropertyGet : public Expression {
+ public:
+  static PropertyGet* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~PropertyGet();
+
+  DEFINE_CASTING_OPERATIONS(PropertyGet);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Expression* receiver() { return receiver_; }
+  Name* name() { return name_; }
+
+ private:
+  PropertyGet() {}
+
+  Child<Expression> receiver_;
+  Child<Name> name_;
+  Ref<Member> interfaceTarget_;
+
+  DISALLOW_COPY_AND_ASSIGN(PropertyGet);
+};
+
+
+class PropertySet : public Expression {
+ public:
+  static PropertySet* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~PropertySet();
+
+  DEFINE_CASTING_OPERATIONS(PropertySet);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Expression* receiver() { return receiver_; }
+  Name* name() { return name_; }
+  Expression* value() { return value_; }
+
+ private:
+  PropertySet() {}
+
+  Child<Expression> receiver_;
+  Child<Name> name_;
+  Child<Expression> value_;
+  Ref<Member> interfaceTarget_;
+
+  DISALLOW_COPY_AND_ASSIGN(PropertySet);
+};
+
+
+class DirectPropertyGet : public Expression {
+ public:
+  static DirectPropertyGet* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~DirectPropertyGet();
+
+  DEFINE_CASTING_OPERATIONS(DirectPropertyGet);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Expression* receiver() { return receiver_; }
+  Member* target() { return target_; }
+
+ private:
+  DirectPropertyGet() {}
+
+  Child<Expression> receiver_;
+  Ref<Member> target_;
+
+  DISALLOW_COPY_AND_ASSIGN(DirectPropertyGet);
+};
+
+
+class DirectPropertySet : public Expression {
+ public:
+  static DirectPropertySet* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~DirectPropertySet();
+
+  DEFINE_CASTING_OPERATIONS(DirectPropertySet);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Expression* receiver() { return receiver_; }
+  Member* target() { return target_; }
+  Expression* value() { return value_; }
+
+ private:
+  DirectPropertySet() {}
+
+  Child<Expression> receiver_;
+  Ref<Member> target_;
+  Child<Expression> value_;
+
+  DISALLOW_COPY_AND_ASSIGN(DirectPropertySet);
+};
+
+
+class StaticGet : public Expression {
+ public:
+  static StaticGet* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~StaticGet();
+
+  DEFINE_CASTING_OPERATIONS(StaticGet);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Member* target() { return target_; }
+
+ private:
+  StaticGet() {}
+
+  Ref<Member> target_;
+
+  DISALLOW_COPY_AND_ASSIGN(StaticGet);
+};
+
+
+class StaticSet : public Expression {
+ public:
+  static StaticSet* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~StaticSet();
+
+  DEFINE_CASTING_OPERATIONS(StaticSet);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Member* target() { return target_; }
+  Expression* expression() { return expression_; }
+
+ private:
+  StaticSet() {}
+
+  Ref<Member> target_;
+  Child<Expression> expression_;
+
+  DISALLOW_COPY_AND_ASSIGN(StaticSet);
+};
+
+
+class Arguments : public TreeNode {
+ public:
+  static Arguments* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~Arguments();
+
+  DEFINE_CASTING_OPERATIONS(Arguments);
+
+  virtual void AcceptTreeVisitor(TreeVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  List<DartType>& types() { return types_; }
+  List<Expression>& positional() { return positional_; }
+  List<NamedExpression>& named() { return named_; }
+
+  int count() { return positional_.length() + named_.length(); }
+
+ private:
+  Arguments() {}
+
+  List<DartType> types_;
+  List<Expression> positional_;
+  List<NamedExpression> named_;
+
+  DISALLOW_COPY_AND_ASSIGN(Arguments);
+};
+
+
+class NamedExpression : public TreeNode {
+ public:
+  static NamedExpression* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  NamedExpression(String* name, Expression* expr)
+      : name_(name), expression_(expr) {}
+  virtual ~NamedExpression();
+
+  DEFINE_CASTING_OPERATIONS(NamedExpression);
+
+  virtual void AcceptTreeVisitor(TreeVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  String* name() { return name_; }
+  Expression* expression() { return expression_; }
+
+ private:
+  NamedExpression() {}
+
+  Ref<String> name_;
+  Child<Expression> expression_;
+
+  DISALLOW_COPY_AND_ASSIGN(NamedExpression);
+};
+
+
+class MethodInvocation : public Expression {
+ public:
+  static MethodInvocation* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~MethodInvocation();
+
+  DEFINE_CASTING_OPERATIONS(MethodInvocation);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Expression* receiver() { return receiver_; }
+  Name* name() { return name_; }
+  Arguments* arguments() { return arguments_; }
+
+ private:
+  MethodInvocation() {}
+
+  Child<Expression> receiver_;
+  Child<Name> name_;
+  Child<Arguments> arguments_;
+  Ref<Member> interfaceTarget_;
+
+  DISALLOW_COPY_AND_ASSIGN(MethodInvocation);
+};
+
+
+class DirectMethodInvocation : public Expression {
+ public:
+  static DirectMethodInvocation* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~DirectMethodInvocation();
+
+  DEFINE_CASTING_OPERATIONS(DirectMethodInvocation);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Expression* receiver() { return receiver_; }
+  Procedure* target() { return target_; }
+  Arguments* arguments() { return arguments_; }
+
+ private:
+  DirectMethodInvocation() {}
+
+  Child<Expression> receiver_;
+  Ref<Procedure> target_;
+  Child<Arguments> arguments_;
+
+  DISALLOW_COPY_AND_ASSIGN(DirectMethodInvocation);
+};
+
+
+class StaticInvocation : public Expression {
+ public:
+  static StaticInvocation* ReadFrom(Reader* reader, bool is_const);
+  virtual void WriteTo(Writer* writer);
+  ~StaticInvocation();
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Procedure* procedure() { return procedure_; }
+  Arguments* arguments() { return arguments_; }
+  bool is_const() { return is_const_; }
+
+ private:
+  StaticInvocation() {}
+
+  Ref<Procedure> procedure_;
+  Child<Arguments> arguments_;
+  bool is_const_;
+
+  DISALLOW_COPY_AND_ASSIGN(StaticInvocation);
+};
+
+
+class ConstructorInvocation : public Expression {
+ public:
+  static ConstructorInvocation* ReadFrom(Reader* reader, bool is_const);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~ConstructorInvocation();
+
+  DEFINE_CASTING_OPERATIONS(ConstructorInvocation);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  bool is_const() { return is_const_; }
+  Constructor* target() { return target_; }
+  Arguments* arguments() { return arguments_; }
+
+ private:
+  ConstructorInvocation() {}
+
+  bool is_const_;
+  Ref<Constructor> target_;
+  Child<Arguments> arguments_;
+
+  DISALLOW_COPY_AND_ASSIGN(ConstructorInvocation);
+};
+
+
+class Not : public Expression {
+ public:
+  static Not* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~Not();
+
+  DEFINE_CASTING_OPERATIONS(Not);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Expression* expression() { return expression_; }
+
+ private:
+  Not() {}
+
+  Child<Expression> expression_;
+
+  DISALLOW_COPY_AND_ASSIGN(Not);
+};
+
+
+class LogicalExpression : public Expression {
+ public:
+  enum Operator { kAnd, kOr };
+
+  static LogicalExpression* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~LogicalExpression();
+
+  DEFINE_CASTING_OPERATIONS(LogicalExpression);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Expression* left() { return left_; }
+  Operator op() { return operator_; }
+  Expression* right() { return right_; }
+
+ private:
+  LogicalExpression() {}
+
+  Child<Expression> left_;
+  Operator operator_;
+  Child<Expression> right_;
+
+  DISALLOW_COPY_AND_ASSIGN(LogicalExpression);
+};
+
+
+class ConditionalExpression : public Expression {
+ public:
+  static ConditionalExpression* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~ConditionalExpression();
+
+  DEFINE_CASTING_OPERATIONS(ConditionalExpression);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Expression* condition() { return condition_; }
+  Expression* then() { return then_; }
+  Expression* otherwise() { return otherwise_; }
+
+ private:
+  ConditionalExpression() {}
+
+  Child<Expression> condition_;
+  Child<Expression> then_;
+  Child<Expression> otherwise_;
+
+  DISALLOW_COPY_AND_ASSIGN(ConditionalExpression);
+};
+
+
+class StringConcatenation : public Expression {
+ public:
+  static StringConcatenation* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~StringConcatenation();
+
+  DEFINE_CASTING_OPERATIONS(StringConcatenation);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  List<Expression>& expressions() { return expressions_; }
+
+ private:
+  StringConcatenation() {}
+
+  List<Expression> expressions_;
+
+  DISALLOW_COPY_AND_ASSIGN(StringConcatenation);
+};
+
+
+class IsExpression : public Expression {
+ public:
+  static IsExpression* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~IsExpression();
+
+  DEFINE_CASTING_OPERATIONS(IsExpression);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Expression* operand() { return operand_; }
+  DartType* type() { return type_; }
+
+ private:
+  IsExpression() {}
+
+  Child<Expression> operand_;
+  Child<DartType> type_;
+
+  DISALLOW_COPY_AND_ASSIGN(IsExpression);
+};
+
+
+class AsExpression : public Expression {
+ public:
+  static AsExpression* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~AsExpression();
+
+  DEFINE_CASTING_OPERATIONS(AsExpression);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Expression* operand() { return operand_; }
+  DartType* type() { return type_; }
+
+ private:
+  AsExpression() {}
+
+  Child<Expression> operand_;
+  Child<DartType> type_;
+
+  DISALLOW_COPY_AND_ASSIGN(AsExpression);
+};
+
+
+class BasicLiteral : public Expression {
+ public:
+  virtual ~BasicLiteral();
+
+  DEFINE_CASTING_OPERATIONS(BasicLiteral);
+
+  virtual void VisitChildren(Visitor* visitor);
+};
+
+
+class StringLiteral : public BasicLiteral {
+ public:
+  static StringLiteral* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+
+  explicit StringLiteral(String* string) : value_(string) {}
+  virtual ~StringLiteral();
+
+  DEFINE_CASTING_OPERATIONS(StringLiteral);
+
+  String* value() { return value_; }
+
+ protected:
+  StringLiteral() {}
+
+  Ref<String> value_;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(StringLiteral);
+};
+
+
+class BigintLiteral : public StringLiteral {
+ public:
+  static BigintLiteral* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+
+  explicit BigintLiteral(String* string) : StringLiteral(string) {}
+  virtual ~BigintLiteral();
+
+  DEFINE_CASTING_OPERATIONS(BigintLiteral);
+
+ private:
+  BigintLiteral() {}
+
+  DISALLOW_COPY_AND_ASSIGN(BigintLiteral);
+};
+
+
+class IntLiteral : public BasicLiteral {
+ public:
+  static IntLiteral* ReadFrom(Reader* reader, bool is_negative);
+  static IntLiteral* ReadFrom(Reader* reader, uint8_t payload);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~IntLiteral();
+
+  DEFINE_CASTING_OPERATIONS(IntLiteral);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+
+  int64_t value() { return value_; }
+
+ private:
+  IntLiteral() {}
+
+  int64_t value_;
+
+  DISALLOW_COPY_AND_ASSIGN(IntLiteral);
+};
+
+
+class DoubleLiteral : public BasicLiteral {
+ public:
+  static DoubleLiteral* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~DoubleLiteral();
+
+  DEFINE_CASTING_OPERATIONS(DoubleLiteral);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+
+  String* value() { return value_; }
+
+ private:
+  DoubleLiteral() {}
+
+  Ref<String> value_;
+
+  DISALLOW_COPY_AND_ASSIGN(DoubleLiteral);
+};
+
+
+class BoolLiteral : public BasicLiteral {
+ public:
+  static BoolLiteral* ReadFrom(Reader* reader, bool value);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~BoolLiteral();
+
+  DEFINE_CASTING_OPERATIONS(BoolLiteral);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+
+  bool value() { return value_; }
+
+ private:
+  BoolLiteral() {}
+
+  bool value_;
+
+  DISALLOW_COPY_AND_ASSIGN(BoolLiteral);
+};
+
+
+class NullLiteral : public BasicLiteral {
+ public:
+  static NullLiteral* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~NullLiteral();
+
+  DEFINE_CASTING_OPERATIONS(NullLiteral);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+
+ private:
+  NullLiteral() {}
+
+  DISALLOW_COPY_AND_ASSIGN(NullLiteral);
+};
+
+
+class SymbolLiteral : public Expression {
+ public:
+  static SymbolLiteral* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~SymbolLiteral();
+
+  DEFINE_CASTING_OPERATIONS(SymbolLiteral);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  String* value() { return value_; }
+
+ private:
+  SymbolLiteral() {}
+
+  Ref<String> value_;
+
+  DISALLOW_COPY_AND_ASSIGN(SymbolLiteral);
+};
+
+
+class TypeLiteral : public Expression {
+ public:
+  static TypeLiteral* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~TypeLiteral();
+
+  DEFINE_CASTING_OPERATIONS(TypeLiteral);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  DartType* type() { return type_; }
+
+ private:
+  TypeLiteral() {}
+
+  Child<DartType> type_;
+
+  DISALLOW_COPY_AND_ASSIGN(TypeLiteral);
+};
+
+
+class ThisExpression : public Expression {
+ public:
+  static ThisExpression* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~ThisExpression();
+
+  DEFINE_CASTING_OPERATIONS(ThisExpression);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+ private:
+  ThisExpression() {}
+
+  DISALLOW_COPY_AND_ASSIGN(ThisExpression);
+};
+
+
+class Rethrow : public Expression {
+ public:
+  static Rethrow* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~Rethrow();
+
+  DEFINE_CASTING_OPERATIONS(Rethrow);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+ private:
+  Rethrow() {}
+
+  DISALLOW_COPY_AND_ASSIGN(Rethrow);
+};
+
+
+class Throw : public Expression {
+ public:
+  static Throw* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~Throw();
+
+  DEFINE_CASTING_OPERATIONS(Throw);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Expression* expression() { return expression_; }
+
+ private:
+  Throw() {}
+
+  Child<Expression> expression_;
+
+  DISALLOW_COPY_AND_ASSIGN(Throw);
+};
+
+
+class ListLiteral : public Expression {
+ public:
+  static ListLiteral* ReadFrom(Reader* reader, bool is_const);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~ListLiteral();
+
+  DEFINE_CASTING_OPERATIONS(ListLiteral);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  bool is_const() { return is_const_; }
+  DartType* type() { return type_; }
+  List<Expression>& expressions() { return expressions_; }
+
+ private:
+  ListLiteral() {}
+
+  bool is_const_;
+  Child<DartType> type_;
+  List<Expression> expressions_;
+
+  DISALLOW_COPY_AND_ASSIGN(ListLiteral);
+};
+
+
+class MapLiteral : public Expression {
+ public:
+  static MapLiteral* ReadFrom(Reader* reader, bool is_const);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~MapLiteral();
+
+  DEFINE_CASTING_OPERATIONS(MapLiteral);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  bool is_const() { return is_const_; }
+  DartType* key_type() { return key_type_; }
+  DartType* value_type() { return value_type_; }
+  List<MapEntry>& entries() { return entries_; }
+
+ private:
+  MapLiteral() {}
+
+  bool is_const_;
+  Child<DartType> key_type_;
+  Child<DartType> value_type_;
+  List<MapEntry> entries_;
+
+  DISALLOW_COPY_AND_ASSIGN(MapLiteral);
+};
+
+
+class MapEntry : public TreeNode {
+ public:
+  static MapEntry* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~MapEntry();
+
+  DEFINE_CASTING_OPERATIONS(MapEntry);
+
+  virtual void AcceptTreeVisitor(TreeVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Expression* key() { return key_; }
+  Expression* value() { return value_; }
+
+ private:
+  MapEntry() {}
+
+  template <typename T>
+  friend class List;
+
+  Child<Expression> key_;
+  Child<Expression> value_;
+
+  DISALLOW_COPY_AND_ASSIGN(MapEntry);
+};
+
+
+class AwaitExpression : public Expression {
+ public:
+  static AwaitExpression* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~AwaitExpression();
+
+  DEFINE_CASTING_OPERATIONS(AwaitExpression);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Expression* operand() { return operand_; }
+
+ private:
+  AwaitExpression() {}
+
+  Child<Expression> operand_;
+
+  DISALLOW_COPY_AND_ASSIGN(AwaitExpression);
+};
+
+
+class FunctionExpression : public Expression {
+ public:
+  static FunctionExpression* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~FunctionExpression();
+
+  DEFINE_CASTING_OPERATIONS(FunctionExpression);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  FunctionNode* function() { return function_; }
+
+ private:
+  FunctionExpression() {}
+
+  Child<FunctionNode> function_;
+
+  DISALLOW_COPY_AND_ASSIGN(FunctionExpression);
+};
+
+
+class Let : public Expression {
+ public:
+  static Let* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~Let();
+
+  DEFINE_CASTING_OPERATIONS(Let);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  VariableDeclaration* variable() { return variable_; }
+  Expression* body() { return body_; }
+
+ private:
+  Let() {}
+
+  Child<VariableDeclaration> variable_;
+  Child<Expression> body_;
+
+  DISALLOW_COPY_AND_ASSIGN(Let);
+};
+
+
+class BlockExpression : public Expression {
+ public:
+  static BlockExpression* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~BlockExpression();
+
+  DEFINE_CASTING_OPERATIONS(BlockExpression);
+
+  virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Block* body() { return body_; }
+  Expression* value() { return value_; }
+
+ private:
+  BlockExpression() {}
+
+  Child<Block> body_;
+  Child<Expression> value_;
+
+  DISALLOW_COPY_AND_ASSIGN(BlockExpression);
+};
+
+
+class Statement : public TreeNode {
+ public:
+  static Statement* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer) = 0;
+
+  virtual ~Statement();
+
+  DEFINE_CASTING_OPERATIONS(Statement);
+
+  virtual void AcceptTreeVisitor(TreeVisitor* visitor);
+  virtual void AcceptStatementVisitor(StatementVisitor* visitor) = 0;
+
+ protected:
+  Statement() {}
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(Statement);
+};
+
+
+class InvalidStatement : public Statement {
+ public:
+  static InvalidStatement* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~InvalidStatement();
+
+  DEFINE_CASTING_OPERATIONS(InvalidStatement);
+
+  virtual void AcceptStatementVisitor(StatementVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+ private:
+  InvalidStatement() {}
+
+  DISALLOW_COPY_AND_ASSIGN(InvalidStatement);
+};
+
+
+class ExpressionStatement : public Statement {
+ public:
+  static ExpressionStatement* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  explicit ExpressionStatement(Expression* exp) : expression_(exp) {}
+  virtual ~ExpressionStatement();
+
+  DEFINE_CASTING_OPERATIONS(ExpressionStatement);
+
+  virtual void AcceptStatementVisitor(StatementVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Expression* expression() { return expression_; }
+
+ private:
+  ExpressionStatement() {}
+
+  Child<Expression> expression_;
+
+  DISALLOW_COPY_AND_ASSIGN(ExpressionStatement);
+};
+
+
+class Block : public Statement {
+ public:
+  static Block* ReadFromImpl(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+  void WriteToImpl(Writer* writer);
+
+  virtual ~Block();
+
+  DEFINE_CASTING_OPERATIONS(Block);
+
+  virtual void AcceptStatementVisitor(StatementVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  List<Statement>& statements() { return statements_; }
+
+ private:
+  Block() {}
+
+  List<Statement> statements_;
+
+  DISALLOW_COPY_AND_ASSIGN(Block);
+};
+
+
+class EmptyStatement : public Statement {
+ public:
+  static EmptyStatement* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~EmptyStatement();
+
+  DEFINE_CASTING_OPERATIONS(EmptyStatement);
+
+  virtual void AcceptStatementVisitor(StatementVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+ private:
+  EmptyStatement() {}
+
+  DISALLOW_COPY_AND_ASSIGN(EmptyStatement);
+};
+
+
+class AssertStatement : public Statement {
+ public:
+  static AssertStatement* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~AssertStatement();
+
+  DEFINE_CASTING_OPERATIONS(AssertStatement);
+
+  virtual void AcceptStatementVisitor(StatementVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Expression* condition() { return condition_; }
+  Expression* message() { return message_; }
+
+ private:
+  AssertStatement() {}
+
+  Child<Expression> condition_;
+  Child<Expression> message_;
+
+  DISALLOW_COPY_AND_ASSIGN(AssertStatement);
+};
+
+
+class LabeledStatement : public Statement {
+ public:
+  static LabeledStatement* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~LabeledStatement();
+
+  DEFINE_CASTING_OPERATIONS(LabeledStatement);
+
+  virtual void AcceptStatementVisitor(StatementVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Statement* body() { return body_; }
+
+ private:
+  LabeledStatement() {}
+
+  Child<Statement> body_;
+
+  DISALLOW_COPY_AND_ASSIGN(LabeledStatement);
+};
+
+
+class BreakStatement : public Statement {
+ public:
+  static BreakStatement* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~BreakStatement();
+
+  DEFINE_CASTING_OPERATIONS(BreakStatement);
+
+  virtual void AcceptStatementVisitor(StatementVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  LabeledStatement* target() { return target_; }
+
+ private:
+  BreakStatement() {}
+
+  Ref<LabeledStatement> target_;
+
+  DISALLOW_COPY_AND_ASSIGN(BreakStatement);
+};
+
+
+class WhileStatement : public Statement {
+ public:
+  static WhileStatement* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~WhileStatement();
+
+  DEFINE_CASTING_OPERATIONS(WhileStatement);
+
+  virtual void AcceptStatementVisitor(StatementVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Expression* condition() { return condition_; }
+  Statement* body() { return body_; }
+
+ private:
+  WhileStatement() {}
+
+  Child<Expression> condition_;
+  Child<Statement> body_;
+
+  DISALLOW_COPY_AND_ASSIGN(WhileStatement);
+};
+
+
+class DoStatement : public Statement {
+ public:
+  static DoStatement* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~DoStatement();
+
+  DEFINE_CASTING_OPERATIONS(DoStatement);
+
+  virtual void AcceptStatementVisitor(StatementVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Expression* condition() { return condition_; }
+  Statement* body() { return body_; }
+
+ private:
+  DoStatement() {}
+
+  Child<Expression> condition_;
+  Child<Statement> body_;
+
+  DISALLOW_COPY_AND_ASSIGN(DoStatement);
+};
+
+
+class ForStatement : public Statement {
+ public:
+  static ForStatement* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~ForStatement();
+
+  DEFINE_CASTING_OPERATIONS(ForStatement);
+
+  virtual void AcceptStatementVisitor(StatementVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  List<VariableDeclaration>& variables() { return variables_; }
+  Expression* condition() { return condition_; }
+  List<Expression>& updates() { return updates_; }
+  Statement* body() { return body_; }
+
+ private:
+  ForStatement() {}
+
+  List<VariableDeclaration> variables_;
+  Child<Expression> condition_;
+  List<Expression> updates_;
+  Child<Statement> body_;
+
+  DISALLOW_COPY_AND_ASSIGN(ForStatement);
+};
+
+
+class ForInStatement : public Statement {
+ public:
+  static ForInStatement* ReadFrom(Reader* reader, bool is_async);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~ForInStatement();
+
+  DEFINE_CASTING_OPERATIONS(ForInStatement);
+
+  virtual void AcceptStatementVisitor(StatementVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  VariableDeclaration* variable() { return variable_; }
+  Expression* iterable() { return iterable_; }
+  Statement* body() { return body_; }
+  bool is_async() { return is_async_; }
+
+ private:
+  ForInStatement() {}
+
+  Child<VariableDeclaration> variable_;
+  Child<Expression> iterable_;
+  Child<Statement> body_;
+  bool is_async_;
+
+  DISALLOW_COPY_AND_ASSIGN(ForInStatement);
+};
+
+
+class SwitchStatement : public Statement {
+ public:
+  static SwitchStatement* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~SwitchStatement();
+
+  DEFINE_CASTING_OPERATIONS(SwitchStatement);
+
+  virtual void AcceptStatementVisitor(StatementVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Expression* condition() { return condition_; }
+  List<SwitchCase>& cases() { return cases_; }
+
+ private:
+  SwitchStatement() {}
+
+  Child<Expression> condition_;
+  List<SwitchCase> cases_;
+
+  DISALLOW_COPY_AND_ASSIGN(SwitchStatement);
+};
+
+
+class SwitchCase : public TreeNode {
+ public:
+  SwitchCase* ReadFrom(Reader* reader);
+  void WriteTo(Writer* writer);
+
+  virtual ~SwitchCase();
+
+  DEFINE_CASTING_OPERATIONS(SwitchCase);
+
+  virtual void AcceptTreeVisitor(TreeVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  List<Expression>& expressions() { return expressions_; }
+  bool is_default() { return is_default_; }
+  Statement* body() { return body_; }
+
+ private:
+  SwitchCase() {}
+
+  template <typename T>
+  friend class List;
+
+  List<Expression> expressions_;
+  bool is_default_;
+  Child<Statement> body_;
+
+  DISALLOW_COPY_AND_ASSIGN(SwitchCase);
+};
+
+
+class ContinueSwitchStatement : public Statement {
+ public:
+  static ContinueSwitchStatement* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~ContinueSwitchStatement();
+
+  DEFINE_CASTING_OPERATIONS(ContinueSwitchStatement);
+
+  virtual void AcceptStatementVisitor(StatementVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  SwitchCase* target() { return target_; }
+
+ private:
+  ContinueSwitchStatement() {}
+
+  Ref<SwitchCase> target_;
+
+  DISALLOW_COPY_AND_ASSIGN(ContinueSwitchStatement);
+};
+
+
+class IfStatement : public Statement {
+ public:
+  static IfStatement* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~IfStatement();
+
+  DEFINE_CASTING_OPERATIONS(IfStatement);
+
+  virtual void AcceptStatementVisitor(StatementVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Expression* condition() { return condition_; }
+  Statement* then() { return then_; }
+  Statement* otherwise() { return otherwise_; }
+
+ private:
+  IfStatement() {}
+
+  Child<Expression> condition_;
+  Child<Statement> then_;
+  Child<Statement> otherwise_;
+
+  DISALLOW_COPY_AND_ASSIGN(IfStatement);
+};
+
+
+class ReturnStatement : public Statement {
+ public:
+  static ReturnStatement* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~ReturnStatement();
+
+  DEFINE_CASTING_OPERATIONS(ReturnStatement);
+
+  virtual void AcceptStatementVisitor(StatementVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Expression* expression() { return expression_; }
+
+ private:
+  ReturnStatement() {}
+
+  Child<Expression> expression_;
+
+  DISALLOW_COPY_AND_ASSIGN(ReturnStatement);
+};
+
+
+class TryCatch : public Statement {
+ public:
+  static TryCatch* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~TryCatch();
+
+  DEFINE_CASTING_OPERATIONS(TryCatch);
+
+  virtual void AcceptStatementVisitor(StatementVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Statement* body() { return body_; }
+  List<Catch>& catches() { return catches_; }
+
+ private:
+  TryCatch() {}
+
+  Child<Statement> body_;
+  List<Catch> catches_;
+
+  DISALLOW_COPY_AND_ASSIGN(TryCatch);
+};
+
+
+class Catch : public TreeNode {
+ public:
+  static Catch* ReadFrom(Reader* reader);
+  void WriteTo(Writer* writer);
+
+  virtual ~Catch();
+
+  DEFINE_CASTING_OPERATIONS(Catch);
+
+  virtual void AcceptTreeVisitor(TreeVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  DartType* guard() { return guard_; }
+  VariableDeclaration* exception() { return exception_; }
+  VariableDeclaration* stack_trace() { return stack_trace_; }
+  Statement* body() { return body_; }
+
+ private:
+  Catch() {}
+
+  template <typename T>
+  friend class List;
+
+  Child<DartType> guard_;
+  Child<VariableDeclaration> exception_;
+  Child<VariableDeclaration> stack_trace_;
+  Child<Statement> body_;
+
+  DISALLOW_COPY_AND_ASSIGN(Catch);
+};
+
+
+class TryFinally : public Statement {
+ public:
+  static TryFinally* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~TryFinally();
+
+  DEFINE_CASTING_OPERATIONS(TryFinally);
+
+  virtual void AcceptStatementVisitor(StatementVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Statement* body() { return body_; }
+  Statement* finalizer() { return finalizer_; }
+
+ private:
+  TryFinally() {}
+
+  Child<Statement> body_;
+  Child<Statement> finalizer_;
+
+  DISALLOW_COPY_AND_ASSIGN(TryFinally);
+};
+
+
+class YieldStatement : public Statement {
+ public:
+  enum {
+    kFlagYieldStar = 1 << 0,
+    kFlagNative = 1 << 1,
+  };
+  static YieldStatement* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~YieldStatement();
+
+  DEFINE_CASTING_OPERATIONS(YieldStatement);
+
+  virtual void AcceptStatementVisitor(StatementVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  bool is_yield_start() { return (flags_ & kFlagYieldStar) == kFlagYieldStar; }
+  bool is_native() { return (flags_ & kFlagNative) == kFlagNative; }
+  Expression* expression() { return expression_; }
+
+ private:
+  YieldStatement() {}
+
+  word flags_;
+  Child<Expression> expression_;
+
+  DISALLOW_COPY_AND_ASSIGN(YieldStatement);
+};
+
+
+class VariableDeclaration : public Statement {
+ public:
+  enum Flags {
+    kFlagFinal = 1 << 0,
+    kFlagConst = 1 << 1,
+  };
+
+  static VariableDeclaration* ReadFrom(Reader* reader);
+  static VariableDeclaration* ReadFromImpl(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+  void WriteToImpl(Writer* writer);
+
+  virtual ~VariableDeclaration();
+
+  DEFINE_CASTING_OPERATIONS(VariableDeclaration);
+
+  virtual void AcceptStatementVisitor(StatementVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  bool IsConst() { return (flags_ & kFlagConst) == kFlagConst; }
+  bool IsFinal() { return (flags_ & kFlagFinal) == kFlagFinal; }
+
+  String* name() { return name_; }
+  DartType* type() { return type_; }
+  InferredValue* inferred_value() { return inferred_value_; }
+  Expression* initializer() { return initializer_; }
+
+ private:
+  VariableDeclaration() {}
+
+  template <typename T>
+  friend class List;
+
+  word flags_;
+  Ref<String> name_;
+  Child<DartType> type_;
+  Child<InferredValue> inferred_value_;
+  Child<Expression> initializer_;
+
+  DISALLOW_COPY_AND_ASSIGN(VariableDeclaration);
+};
+
+
+class FunctionDeclaration : public Statement {
+ public:
+  static FunctionDeclaration* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer);
+
+  virtual ~FunctionDeclaration();
+
+  DEFINE_CASTING_OPERATIONS(FunctionDeclaration);
+
+  virtual void AcceptStatementVisitor(StatementVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  VariableDeclaration* variable() { return variable_; }
+  FunctionNode* function() { return function_; }
+
+ private:
+  FunctionDeclaration() {}
+
+  Child<VariableDeclaration> variable_;
+  Child<FunctionNode> function_;
+
+  DISALLOW_COPY_AND_ASSIGN(FunctionDeclaration);
+};
+
+
+class Name : public Node {
+ public:
+  static Name* ReadFrom(Reader* reader);
+  void WriteTo(Writer* writer);
+
+  virtual ~Name();
+
+  DEFINE_CASTING_OPERATIONS(Name);
+
+  virtual void AcceptVisitor(Visitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  String* string() { return string_; }
+  Library* library() { return library_; }
+
+ private:
+  Name(String* string, Library* library) : string_(string), library_(library) {}
+
+  Ref<String> string_;
+  Ref<Library> library_;
+
+  DISALLOW_COPY_AND_ASSIGN(Name);
+};
+
+
+class InferredValue : public Node {
+ public:
+  static const uint8_t kNull = 1 << 0;
+  static const uint8_t kInteger = 1 << 1;
+  static const uint8_t kDouble = 1 << 2;
+  static const uint8_t kString = 1 << 3;
+  static const uint8_t kOther = 1 << 4;
+
+  enum BaseClassKind {
+    kNone,
+    kExact,
+    kSubclass,
+    kSubtype,
+  };
+
+  static InferredValue* ReadFrom(Reader* reader);
+  void WriteTo(Writer* writer);
+
+  virtual ~InferredValue();
+
+  DEFINE_CASTING_OPERATIONS(InferredValue);
+
+  virtual void AcceptVisitor(Visitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  bool IsInterfaceType() { return kind_ == kSubtype; }
+  bool IsExactClass() { return kind_ == kExact; }
+  bool IsSubclass() { return kind_ == kSubclass; }
+
+  bool CanBeNull() { return (value_bits_ & kNull) != 0; }
+  bool CanBeInteger() { return (value_bits_ & kInteger) != 0; }
+  bool CanBeDouble() { return (value_bits_ & kDouble) != 0; }
+  bool CanBeString() { return (value_bits_ & kString) != 0; }
+
+  bool IsAlwaysNull() { return value_bits_ == kNull; }
+  bool IsAlwaysInteger() { return value_bits_ == kInteger; }
+  bool IsAlwaysDouble() { return value_bits_ == kDouble; }
+  bool IsAlwaysString() { return value_bits_ == kString; }
+
+  Class* klass() { return klass_; }
+  BaseClassKind kind() { return kind_; }
+  uint8_t value_bits() { return value_bits_; }
+
+ private:
+  InferredValue() {}
+
+  Ref<Class> klass_;
+  BaseClassKind kind_;
+  uint8_t value_bits_;
+
+  DISALLOW_COPY_AND_ASSIGN(InferredValue);
+};
+
+
+class DartType : public Node {
+ public:
+  static DartType* ReadFrom(Reader* reader);
+  virtual void WriteTo(Writer* writer) = 0;
+
+  virtual ~DartType();
+
+  DEFINE_CASTING_OPERATIONS(DartType);
+
+  virtual void AcceptVisitor(Visitor* visitor);
+  virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor) = 0;
+
+ protected:
+  DartType() {}
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(DartType);
+};
+
+
+class InvalidType : public DartType {
+ public:
+  static InvalidType* ReadFrom(Reader* reader);
+  void WriteTo(Writer* writer);
+
+  virtual ~InvalidType();
+
+  DEFINE_CASTING_OPERATIONS(InvalidType);
+
+  virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+ private:
+  InvalidType() {}
+
+  DISALLOW_COPY_AND_ASSIGN(InvalidType);
+};
+
+
+class DynamicType : public DartType {
+ public:
+  static DynamicType* ReadFrom(Reader* reader);
+  void WriteTo(Writer* writer);
+
+  virtual ~DynamicType();
+
+  DEFINE_CASTING_OPERATIONS(DynamicType);
+
+  virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+ private:
+  DynamicType() {}
+
+  DISALLOW_COPY_AND_ASSIGN(DynamicType);
+};
+
+
+class VoidType : public DartType {
+ public:
+  static VoidType* ReadFrom(Reader* reader);
+  void WriteTo(Writer* writer);
+
+  virtual ~VoidType();
+
+  DEFINE_CASTING_OPERATIONS(VoidType);
+
+  virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+ private:
+  VoidType() {}
+
+  DISALLOW_COPY_AND_ASSIGN(VoidType);
+};
+
+
+class InterfaceType : public DartType {
+ public:
+  static InterfaceType* ReadFrom(Reader* reader);
+  static InterfaceType* ReadFrom(Reader* reader, bool _without_type_arguments_);
+  void WriteTo(Writer* writer);
+
+  explicit InterfaceType(Class* klass) : klass_(klass) {}
+  virtual ~InterfaceType();
+
+  DEFINE_CASTING_OPERATIONS(InterfaceType);
+
+  virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  Class* klass() { return klass_; }
+  List<DartType>& type_arguments() { return type_arguments_; }
+
+ private:
+  InterfaceType() {}
+
+  Ref<Class> klass_;
+  List<DartType> type_arguments_;
+
+  DISALLOW_COPY_AND_ASSIGN(InterfaceType);
+};
+
+
+class FunctionType : public DartType {
+ public:
+  static FunctionType* ReadFrom(Reader* reader);
+  static FunctionType* ReadFrom(Reader* reader, bool _without_type_arguments_);
+  void WriteTo(Writer* writer);
+
+  virtual ~FunctionType();
+
+  DEFINE_CASTING_OPERATIONS(FunctionType);
+
+  virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  TypeParameterList& type_parameters() { return type_parameters_; }
+  int required_parameter_count() { return required_parameter_count_; }
+  List<DartType>& positional_parameters() { return positional_parameters_; }
+  List<Tuple<String, DartType> >& named_parameters() {
+    return named_parameters_;
+  }
+  DartType* return_type() { return return_type_; }
+
+ private:
+  FunctionType() {}
+
+  TypeParameterList type_parameters_;
+  int required_parameter_count_;
+  List<DartType> positional_parameters_;
+  List<Tuple<String, DartType> > named_parameters_;
+  Child<DartType> return_type_;
+
+  DISALLOW_COPY_AND_ASSIGN(FunctionType);
+};
+
+
+class TypeParameterType : public DartType {
+ public:
+  static TypeParameterType* ReadFrom(Reader* reader);
+  void WriteTo(Writer* writer);
+
+  virtual ~TypeParameterType();
+
+  DEFINE_CASTING_OPERATIONS(TypeParameterType);
+
+  virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  TypeParameter* parameter() { return parameter_; }
+
+ private:
+  TypeParameterType() {}
+
+  Ref<TypeParameter> parameter_;
+
+  DISALLOW_COPY_AND_ASSIGN(TypeParameterType);
+};
+
+
+class TypeParameter : public TreeNode {
+ public:
+  TypeParameter* ReadFrom(Reader* reader);
+  void WriteTo(Writer* writer);
+
+  virtual ~TypeParameter();
+
+  DEFINE_CASTING_OPERATIONS(TypeParameter);
+
+  virtual void AcceptTreeVisitor(TreeVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  String* name() { return name_; }
+  DartType* bound() { return bound_; }
+
+ private:
+  TypeParameter() {}
+
+  template <typename T>
+  friend class List;
+  friend class TypeParameterList;
+
+  Ref<String> name_;
+  Child<DartType> bound_;
+
+  DISALLOW_COPY_AND_ASSIGN(TypeParameter);
+};
+
+
+class Program : public TreeNode {
+ public:
+  static Program* ReadFrom(Reader* reader);
+  void WriteTo(Writer* writer);
+
+  virtual ~Program();
+
+  DEFINE_CASTING_OPERATIONS(Program);
+
+  virtual void AcceptTreeVisitor(TreeVisitor* visitor);
+  virtual void VisitChildren(Visitor* visitor);
+
+  StringTable& string_table() { return string_table_; }
+  StringTable& source_uri_table() { return source_uri_table_; }
+  LineStartingTable& line_starting_table() { return line_starting_table_; }
+  List<Library>& libraries() { return libraries_; }
+  Procedure* main_method() { return main_method_; }
+
+ private:
+  Program() {}
+
+  List<Library> libraries_;
+  Ref<Procedure> main_method_;
+  StringTable string_table_;
+  StringTable source_uri_table_;
+  LineStartingTable line_starting_table_;
+
+  DISALLOW_COPY_AND_ASSIGN(Program);
+};
+
+
+class Reference : public AllStatic {
+ public:
+  static Member* ReadMemberFrom(Reader* reader, bool allow_null = false);
+  static void WriteMemberTo(Writer* writer,
+                            Member* member,
+                            bool allow_null = false);
+
+  static Class* ReadClassFrom(Reader* reader, bool allow_null = false);
+  static void WriteClassTo(Writer* writer,
+                           Class* klass,
+                           bool allow_null = false);
+
+  static String* ReadStringFrom(Reader* reader);
+  static void WriteStringTo(Writer* writer, String* string);  // NOLINT
+};
+
+
+class ExpressionVisitor {
+ public:
+  virtual ~ExpressionVisitor() {}
+
+  virtual void VisitDefaultExpression(Expression* node) = 0;
+  virtual void VisitDefaultBasicLiteral(BasicLiteral* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitInvalidExpression(InvalidExpression* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitVariableGet(VariableGet* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitVariableSet(VariableSet* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitPropertyGet(PropertyGet* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitPropertySet(PropertySet* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitDirectPropertyGet(DirectPropertyGet* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitDirectPropertySet(DirectPropertySet* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitStaticGet(StaticGet* node) { VisitDefaultExpression(node); }
+  virtual void VisitStaticSet(StaticSet* node) { VisitDefaultExpression(node); }
+  virtual void VisitMethodInvocation(MethodInvocation* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitDirectMethodInvocation(DirectMethodInvocation* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitStaticInvocation(StaticInvocation* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitConstructorInvocation(ConstructorInvocation* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitNot(Not* node) { VisitDefaultExpression(node); }
+  virtual void VisitLogicalExpression(LogicalExpression* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitConditionalExpression(ConditionalExpression* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitStringConcatenation(StringConcatenation* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitIsExpression(IsExpression* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitAsExpression(AsExpression* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitSymbolLiteral(SymbolLiteral* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitTypeLiteral(TypeLiteral* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitThisExpression(ThisExpression* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitRethrow(Rethrow* node) { VisitDefaultExpression(node); }
+  virtual void VisitThrow(Throw* node) { VisitDefaultExpression(node); }
+  virtual void VisitListLiteral(ListLiteral* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitMapLiteral(MapLiteral* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitAwaitExpression(AwaitExpression* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitFunctionExpression(FunctionExpression* node) {
+    VisitDefaultExpression(node);
+  }
+  virtual void VisitStringLiteral(StringLiteral* node) {
+    VisitDefaultBasicLiteral(node);
+  }
+  virtual void VisitBigintLiteral(BigintLiteral* node) {
+    VisitDefaultBasicLiteral(node);
+  }
+  virtual void VisitIntLiteral(IntLiteral* node) {
+    VisitDefaultBasicLiteral(node);
+  }
+  virtual void VisitDoubleLiteral(DoubleLiteral* node) {
+    VisitDefaultBasicLiteral(node);
+  }
+  virtual void VisitBoolLiteral(BoolLiteral* node) {
+    VisitDefaultBasicLiteral(node);
+  }
+  virtual void VisitNullLiteral(NullLiteral* node) {
+    VisitDefaultBasicLiteral(node);
+  }
+  virtual void VisitLet(Let* node) { VisitDefaultExpression(node); }
+  virtual void VisitBlockExpression(BlockExpression* node) {
+    VisitDefaultExpression(node);
+  }
+};
+
+
+class StatementVisitor {
+ public:
+  virtual ~StatementVisitor() {}
+
+  virtual void VisitDefaultStatement(Statement* node) = 0;
+  virtual void VisitInvalidStatement(InvalidStatement* node) {
+    VisitDefaultStatement(node);
+  }
+  virtual void VisitExpressionStatement(ExpressionStatement* node) {
+    VisitDefaultStatement(node);
+  }
+  virtual void VisitBlock(Block* node) { VisitDefaultStatement(node); }
+  virtual void VisitEmptyStatement(EmptyStatement* node) {
+    VisitDefaultStatement(node);
+  }
+  virtual void VisitAssertStatement(AssertStatement* node) {
+    VisitDefaultStatement(node);
+  }
+  virtual void VisitLabeledStatement(LabeledStatement* node) {
+    VisitDefaultStatement(node);
+  }
+  virtual void VisitBreakStatement(BreakStatement* node) {
+    VisitDefaultStatement(node);
+  }
+  virtual void VisitWhileStatement(WhileStatement* node) {
+    VisitDefaultStatement(node);
+  }
+  virtual void VisitDoStatement(DoStatement* node) {
+    VisitDefaultStatement(node);
+  }
+  virtual void VisitForStatement(ForStatement* node) {
+    VisitDefaultStatement(node);
+  }
+  virtual void VisitForInStatement(ForInStatement* node) {
+    VisitDefaultStatement(node);
+  }
+  virtual void VisitSwitchStatement(SwitchStatement* node) {
+    VisitDefaultStatement(node);
+  }
+  virtual void VisitContinueSwitchStatement(ContinueSwitchStatement* node) {
+    VisitDefaultStatement(node);
+  }
+  virtual void VisitIfStatement(IfStatement* node) {
+    VisitDefaultStatement(node);
+  }
+  virtual void VisitReturnStatement(ReturnStatement* node) {
+    VisitDefaultStatement(node);
+  }
+  virtual void VisitTryCatch(TryCatch* node) { VisitDefaultStatement(node); }
+  virtual void VisitTryFinally(TryFinally* node) {
+    VisitDefaultStatement(node);
+  }
+  virtual void VisitYieldStatement(YieldStatement* node) {
+    VisitDefaultStatement(node);
+  }
+  virtual void VisitVariableDeclaration(VariableDeclaration* node) {
+    VisitDefaultStatement(node);
+  }
+  virtual void VisitFunctionDeclaration(FunctionDeclaration* node) {
+    VisitDefaultStatement(node);
+  }
+};
+
+
+class MemberVisitor {
+ public:
+  virtual ~MemberVisitor() {}
+
+  virtual void VisitDefaultMember(Member* node) = 0;
+  virtual void VisitConstructor(Constructor* node) { VisitDefaultMember(node); }
+  virtual void VisitProcedure(Procedure* node) { VisitDefaultMember(node); }
+  virtual void VisitField(Field* node) { VisitDefaultMember(node); }
+};
+
+
+class ClassVisitor {
+ public:
+  virtual ~ClassVisitor() {}
+
+  virtual void VisitDefaultClass(Class* node) = 0;
+  virtual void VisitNormalClass(NormalClass* node) { VisitDefaultClass(node); }
+  virtual void VisitMixinClass(MixinClass* node) { VisitDefaultClass(node); }
+};
+
+
+class InitializerVisitor {
+ public:
+  virtual ~InitializerVisitor() {}
+
+  virtual void VisitDefaultInitializer(Initializer* node) = 0;
+  virtual void VisitInvalidInitializer(InvalidInitializer* node) {
+    VisitDefaultInitializer(node);
+  }
+  virtual void VisitFieldInitializer(FieldInitializer* node) {
+    VisitDefaultInitializer(node);
+  }
+  virtual void VisitSuperInitializer(SuperInitializer* node) {
+    VisitDefaultInitializer(node);
+  }
+  virtual void VisitRedirectingInitializer(RedirectingInitializer* node) {
+    VisitDefaultInitializer(node);
+  }
+  virtual void VisitLocalInitializer(LocalInitializer* node) {
+    VisitDefaultInitializer(node);
+  }
+};
+
+
+class DartTypeVisitor {
+ public:
+  virtual ~DartTypeVisitor() {}
+
+  virtual void VisitDefaultDartType(DartType* node) = 0;
+  virtual void VisitInvalidType(InvalidType* node) {
+    VisitDefaultDartType(node);
+  }
+  virtual void VisitDynamicType(DynamicType* node) {
+    VisitDefaultDartType(node);
+  }
+  virtual void VisitVoidType(VoidType* node) { VisitDefaultDartType(node); }
+  virtual void VisitInterfaceType(InterfaceType* node) {
+    VisitDefaultDartType(node);
+  }
+  virtual void VisitFunctionType(FunctionType* node) {
+    VisitDefaultDartType(node);
+  }
+  virtual void VisitTypeParameterType(TypeParameterType* node) {
+    VisitDefaultDartType(node);
+  }
+};
+
+
+class ClassReferenceVisitor {
+ public:
+  virtual ~ClassReferenceVisitor() {}
+
+  virtual void VisitDefaultClassReference(Class* node) = 0;
+  virtual void VisitNormalClassReference(NormalClass* node) {
+    VisitDefaultClassReference(node);
+  }
+  virtual void VisitMixinClassReference(MixinClass* node) {
+    VisitDefaultClassReference(node);
+  }
+};
+
+
+class MemberReferenceVisitor {
+ public:
+  virtual ~MemberReferenceVisitor() {}
+
+  virtual void VisitDefaultMemberReference(Member* node) = 0;
+  virtual void VisitFieldReference(Field* node) {
+    VisitDefaultMemberReference(node);
+  }
+  virtual void VisitConstructorReference(Constructor* node) {
+    VisitDefaultMemberReference(node);
+  }
+  virtual void VisitProcedureReference(Procedure* node) {
+    VisitDefaultMemberReference(node);
+  }
+};
+
+
+class TreeVisitor : public ExpressionVisitor,
+                    public StatementVisitor,
+                    public MemberVisitor,
+                    public ClassVisitor,
+                    public InitializerVisitor {
+ public:
+  virtual ~TreeVisitor() {}
+
+  virtual void VisitDefaultTreeNode(TreeNode* node) = 0;
+  virtual void VisitDefaultStatement(Statement* node) {
+    VisitDefaultTreeNode(node);
+  }
+  virtual void VisitDefaultExpression(Expression* node) {
+    VisitDefaultTreeNode(node);
+  }
+  virtual void VisitDefaultMember(Member* node) { VisitDefaultTreeNode(node); }
+  virtual void VisitDefaultClass(Class* node) { VisitDefaultTreeNode(node); }
+  virtual void VisitDefaultInitializer(Initializer* node) {
+    VisitDefaultTreeNode(node);
+  }
+
+  virtual void VisitLibrary(Library* node) { VisitDefaultTreeNode(node); }
+  virtual void VisitTypeParameter(TypeParameter* node) {
+    VisitDefaultTreeNode(node);
+  }
+  virtual void VisitFunctionNode(FunctionNode* node) {
+    VisitDefaultTreeNode(node);
+  }
+  virtual void VisitArguments(Arguments* node) { VisitDefaultTreeNode(node); }
+  virtual void VisitNamedExpression(NamedExpression* node) {
+    VisitDefaultTreeNode(node);
+  }
+  virtual void VisitSwitchCase(SwitchCase* node) { VisitDefaultTreeNode(node); }
+  virtual void VisitCatch(Catch* node) { VisitDefaultTreeNode(node); }
+  virtual void VisitMapEntry(MapEntry* node) { VisitDefaultTreeNode(node); }
+  virtual void VisitProgram(Program* node) { VisitDefaultTreeNode(node); }
+};
+
+
+class Visitor : public TreeVisitor,
+                public DartTypeVisitor,
+                public ClassReferenceVisitor,
+                public MemberReferenceVisitor {
+ public:
+  virtual ~Visitor() {}
+
+  virtual void VisitDefaultNode(Node* node) = 0;
+  virtual void VisitInferredValue(InferredValue* node) {
+    VisitDefaultNode(node);
+  }
+  virtual void VisitDefaultTreeNode(TreeNode* node) { VisitDefaultNode(node); }
+  virtual void VisitDefaultDartType(DartType* node) { VisitDefaultNode(node); }
+  virtual void VisitName(Name* node) { VisitDefaultNode(node); }
+  virtual void VisitDefaultClassReference(Class* node) {
+    VisitDefaultNode(node);
+  }
+  virtual void VisitDefaultMemberReference(Member* node) {
+    VisitDefaultNode(node);
+  }
+};
+
+
+class RecursiveVisitor : public Visitor {
+ public:
+  virtual ~RecursiveVisitor() {}
+
+  virtual void VisitDefaultNode(Node* node) { node->VisitChildren(this); }
+
+  virtual void VisitDefaultClassReference(Class* node) {}
+  virtual void VisitDefaultMemberReference(Member* node) {}
+};
+
+
+template <typename T>
+List<T>::~List() {
+  for (int i = 0; i < length_; i++) {
+    delete array_[i];
+  }
+  delete[] array_;
+}
+
+
+template <typename T>
+void List<T>::EnsureInitialized(int length) {
+  if (length < length_) return;
+
+  T** old_array = array_;
+  int old_length = length_;
+
+  // TODO(27590) Maybe we should use double-growth instead to avoid running
+  // into the quadratic case.
+  length_ = length;
+  array_ = new T*[length_];
+
+  // Move old elements at the start (if necessary).
+  int offset = 0;
+  if (old_array != NULL) {
+    for (; offset < old_length; offset++) {
+      array_[offset] = old_array[offset];
+    }
+  }
+
+  // Set the rest to NULL.
+  for (; offset < length_; offset++) {
+    array_[offset] = NULL;
+  }
+
+  delete[] old_array;
+}
+
+
+template <typename T>
+template <typename IT>
+IT* List<T>::GetOrCreate(int index) {
+  EnsureInitialized(index + 1);
+
+  T* member = array_[index];
+  if (member == NULL) {
+    member = array_[index] = new IT();
+  }
+  return IT::Cast(member);
+}
+
+
+template <typename T>
+template <typename IT, typename PT>
+IT* List<T>::GetOrCreate(int index, PT* parent) {
+  EnsureInitialized(index + 1);
+
+  T* member = array_[index];
+  if (member == NULL) {
+    member = array_[index] = new IT();
+    member->parent_ = parent;
+  } else {
+    ASSERT(member->parent_ == parent);
+  }
+  return IT::Cast(member);
+}
+
+ParsedFunction* ParseStaticFieldInitializer(Zone* zone,
+                                            const dart::Field& field);
+
+}  // namespace kernel
+
+kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer,
+                                                 intptr_t buffer_length);
+
+class ByteWriter {
+ public:
+  virtual ~ByteWriter();
+
+  virtual void WriteByte(uint8_t byte) = 0;
+
+  virtual void WriteBytes(uint8_t* buffer, int count) = 0;
+};
+
+
+void WritePrecompiledKernel(ByteWriter* out, kernel::Program* program);
+
+
+}  // namespace dart
+
+#endif  // !defined(DART_PRECOMPILED_RUNTIME)
+#endif  // RUNTIME_VM_KERNEL_H_
diff --git a/runtime/vm/kernel_binary.cc b/runtime/vm/kernel_binary.cc
new file mode 100644
index 0000000..25b8899
--- /dev/null
+++ b/runtime/vm/kernel_binary.cc
@@ -0,0 +1,2939 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+#if !defined(DART_PRECOMPILED_RUNTIME)
+
+#include <map>
+#include <vector>
+
+#include "platform/globals.h"
+#include "vm/flags.h"
+#include "vm/kernel.h"
+#include "vm/os.h"
+
+#if defined(DEBUG)
+#define TRACE_READ_OFFSET()                                                    \
+  do {                                                                         \
+    if (FLAG_trace_kernel_binary) reader->DumpOffset(DART_PRETTY_FUNCTION);    \
+  } while (0)
+#define TRACE_WRITE_OFFSET()                                                   \
+  do {                                                                         \
+    if (FLAG_trace_kernel_binary) writer->DumpOffset(DART_PRETTY_FUNCTION);    \
+  } while (0)
+#else
+#define TRACE_READ_OFFSET()
+#define TRACE_WRITE_OFFSET()
+#endif
+
+namespace dart {
+
+
+ByteWriter::~ByteWriter() {}
+
+
+namespace kernel {
+
+
+static const uint32_t kMagicProgramFile = 0x90ABCDEFu;
+
+
+// Keep in sync with package:dynamo/lib/binary/tag.dart
+enum Tag {
+  kNothing = 0,
+  kSomething = 1,
+
+  kNormalClass = 2,
+  kMixinClass = 3,
+
+  kField = 4,
+  kConstructor = 5,
+  kProcedure = 6,
+
+  kInvalidInitializer = 7,
+  kFieldInitializer = 8,
+  kSuperInitializer = 9,
+  kRedirectingInitializer = 10,
+  kLocalInitializer = 11,
+
+  kDirectPropertyGet = 15,
+  kDirectPropertySet = 16,
+  kDirectMethodInvocation = 17,
+  kConstStaticInvocation = 18,
+  kInvalidExpression = 19,
+  kVariableGet = 20,
+  kVariableSet = 21,
+  kPropertyGet = 22,
+  kPropertySet = 23,
+  kSuperPropertyGet = 24,
+  kSuperPropertySet = 25,
+  kStaticGet = 26,
+  kStaticSet = 27,
+  kMethodInvocation = 28,
+  kSuperMethodInvocation = 29,
+  kStaticInvocation = 30,
+  kConstructorInvocation = 31,
+  kConstConstructorInvocation = 32,
+  kNot = 33,
+  kLogicalExpression = 34,
+  kConditionalExpression = 35,
+  kStringConcatenation = 36,
+  kIsExpression = 37,
+  kAsExpression = 38,
+  kStringLiteral = 39,
+  kDoubleLiteral = 40,
+  kTrueLiteral = 41,
+  kFalseLiteral = 42,
+  kNullLiteral = 43,
+  kSymbolLiteral = 44,
+  kTypeLiteral = 45,
+  kThisExpression = 46,
+  kRethrow = 47,
+  kThrow = 48,
+  kListLiteral = 49,
+  kMapLiteral = 50,
+  kAwaitExpression = 51,
+  kFunctionExpression = 52,
+  kLet = 53,
+  kBlockExpression = 54,
+
+  kPositiveIntLiteral = 55,
+  kNegativeIntLiteral = 56,
+  kBigIntLiteral = 57,
+  kConstListLiteral = 58,
+  kConstMapLiteral = 59,
+
+  kInvalidStatement = 60,
+  kExpressionStatement = 61,
+  kBlock = 62,
+  kEmptyStatement = 63,
+  kAssertStatement = 64,
+  kLabeledStatement = 65,
+  kBreakStatement = 66,
+  kWhileStatement = 67,
+  kDoStatement = 68,
+  kForStatement = 69,
+  kForInStatement = 70,
+  kSwitchStatement = 71,
+  kContinueSwitchStatement = 72,
+  kIfStatement = 73,
+  kReturnStatement = 74,
+  kTryCatch = 75,
+  kTryFinally = 76,
+  kYieldStatement = 77,
+  kVariableDeclaration = 78,
+  kFunctionDeclaration = 79,
+  kAsyncForInStatement = 80,
+
+  kInvalidType = 90,
+  kDynamicType = 91,
+  kVoidType = 92,
+  kInterfaceType = 93,
+  kFunctionType = 94,
+  kTypeParameterType = 95,
+  kSimpleInterfaceType = 96,
+  kSimpleFunctionType = 97,
+
+  kNullReference = 99,
+  kNormalClassReference = 100,
+  kMixinClassReference = 101,
+
+  kLibraryFieldReference = 102,
+  kClassFieldReference = 103,
+  kClassConstructorReference = 104,
+  kLibraryProcedureReference = 105,
+  kClassProcedureReference = 106,
+
+  kSpecializedTagHighBit = 0x80,  // 10000000
+  kSpecializedTagMask = 0xF8,     // 11111000
+  kSpecializedPayloadMask = 0x7,  // 00000111
+
+  kSpecializedVariableGet = 128,
+  kSpecializedVariableSet = 136,
+  kSpecialIntLiteral = 144,
+};
+
+
+static const int SpecializedIntLiteralBias = 3;
+
+
+template <typename T>
+class BlockStack {
+ public:
+  BlockStack() : current_count_(0) {}
+
+  void EnterScope() {
+    variable_count_.push_back(current_count_);
+    current_count_ = 0;
+  }
+
+  void LeaveScope() {
+    variables_.resize(variables_.size() - current_count_);
+    current_count_ = variable_count_[variable_count_.size() - 1];
+    variable_count_.pop_back();
+  }
+
+  T* Lookup(int index) {
+    ASSERT(static_cast<unsigned>(index) < variables_.size());
+    return variables_[index];
+  }
+
+  void Push(T* v) {
+    variables_.push_back(v);
+    current_count_++;
+  }
+
+  void Push(List<T>* decl) {
+    for (int i = 0; i < decl->length(); i++) {
+      variables_.push_back(decl[i]);
+      current_count_++;
+    }
+  }
+
+  void Pop(T* decl) {
+    variables_.resize(variables_.size() - 1);
+    current_count_--;
+  }
+
+  void Pop(List<T>* decl) {
+    variables_.resize(variables_.size() - decl->length());
+    current_count_ -= decl->length();
+  }
+
+ private:
+  int current_count_;
+  std::vector<T*> variables_;
+  std::vector<int> variable_count_;
+};
+
+
+template <typename T>
+class BlockMap {
+ public:
+  BlockMap() : current_count_(0), stack_height_(0) {}
+
+  void EnterScope() {
+    variable_count_.push_back(current_count_);
+    current_count_ = 0;
+  }
+
+  void LeaveScope() {
+    stack_height_ -= current_count_;
+    current_count_ = variable_count_[variable_count_.size() - 1];
+    variable_count_.pop_back();
+  }
+
+  int Lookup(T* object) {
+    ASSERT(variables_.find(object) != variables_.end());
+    if (variables_.find(object) == variables_.end()) FATAL("lookup failure");
+    return variables_[object];
+  }
+
+  void Push(T* v) {
+    int index = stack_height_++;
+    variables_[v] = index;
+    current_count_++;
+  }
+
+  void Set(T* v, int index) { variables_[v] = index; }
+
+  void Push(List<T>* decl) {
+    for (int i = 0; i < decl->length(); i++) {
+      Push(decl[i]);
+    }
+  }
+
+  void Pop(T* v) {
+    current_count_--;
+    stack_height_--;
+  }
+
+ private:
+  int current_count_;
+  int stack_height_;
+  std::map<T*, int> variables_;
+  std::vector<int> variable_count_;
+};
+
+
+template <typename T>
+class VariableScope {
+ public:
+  explicit VariableScope(T* builder) : builder_(builder) {
+    builder_->variables().EnterScope();
+  }
+  ~VariableScope() { builder_->variables().LeaveScope(); }
+
+ private:
+  T* builder_;
+};
+
+
+template <typename T>
+class TypeParameterScope {
+ public:
+  explicit TypeParameterScope(T* builder) : builder_(builder) {
+    builder_->type_parameters().EnterScope();
+  }
+  ~TypeParameterScope() { builder_->type_parameters().LeaveScope(); }
+
+ private:
+  T* builder_;
+};
+
+
+template <typename T>
+class SwitchCaseScope {
+ public:
+  explicit SwitchCaseScope(T* builder) : builder_(builder) {
+    builder_->switch_cases().EnterScope();
+  }
+  ~SwitchCaseScope() { builder_->switch_cases().LeaveScope(); }
+
+ private:
+  T* builder_;
+};
+
+
+// Unlike other scopes, labels from enclosing functions are not visible in
+// nested functions.  The LabelScope class is used to hide outer labels.
+template <typename Builder, typename Block>
+class LabelScope {
+ public:
+  explicit LabelScope(Builder* builder) : builder_(builder) {
+    outer_block_ = builder_->labels();
+    builder_->set_labels(&block_);
+  }
+  ~LabelScope() { builder_->set_labels(outer_block_); }
+
+ private:
+  Builder* builder_;
+  Block block_;
+  Block* outer_block_;
+};
+
+class ReaderHelper {
+ public:
+  ReaderHelper() : program_(NULL), labels_(NULL) {}
+
+  Program* program() { return program_; }
+  void set_program(Program* program) { program_ = program; }
+
+  BlockStack<VariableDeclaration>& variables() { return scope_; }
+  BlockStack<TypeParameter>& type_parameters() { return type_parameters_; }
+  BlockStack<SwitchCase>& switch_cases() { return switch_cases_; }
+
+  BlockStack<LabeledStatement>* labels() { return labels_; }
+  void set_labels(BlockStack<LabeledStatement>* labels) { labels_ = labels; }
+
+ private:
+  Program* program_;
+  BlockStack<VariableDeclaration> scope_;
+  BlockStack<TypeParameter> type_parameters_;
+  BlockStack<SwitchCase> switch_cases_;
+  BlockStack<LabeledStatement>* labels_;
+};
+
+
+class Reader {
+ public:
+  Reader(const uint8_t* buffer, int64_t size)
+      : buffer_(buffer), size_(size), offset_(0) {}
+
+  uint32_t ReadUInt32() {
+    ASSERT(offset_ + 4 <= size_);
+
+    uint32_t value = (buffer_[offset_ + 0] << 24) |
+                     (buffer_[offset_ + 1] << 16) |
+                     (buffer_[offset_ + 2] << 8) | (buffer_[offset_ + 3] << 0);
+    offset_ += 4;
+    return value;
+  }
+
+  uint32_t ReadUInt() {
+    ASSERT(offset_ + 1 <= size_);
+    uint8_t byte0 = buffer_[offset_];
+    if ((byte0 & 0x80) == 0) {
+      // 0...
+      offset_++;
+      return byte0;
+    } else if ((byte0 & 0xc0) == 0x80) {
+      // 10...
+      ASSERT(offset_ + 2 <= size_);
+      uint32_t value = ((byte0 & ~0x80) << 8) | (buffer_[offset_ + 1]);
+      offset_ += 2;
+      return value;
+    } else {
+      // 11...
+      ASSERT(offset_ + 4 <= size_);
+      uint32_t value = ((byte0 & ~0xc0) << 24) | (buffer_[offset_ + 1] << 16) |
+                       (buffer_[offset_ + 2] << 8) |
+                       (buffer_[offset_ + 3] << 0);
+      offset_ += 4;
+      return value;
+    }
+  }
+
+  TokenPosition ReadPosition() {
+    intptr_t value = ReadUInt();
+    // Position is saved as unsigned,
+    // but actually ranges from -1 and up (thus the -1)
+    return TokenPosition(value - 1);
+  }
+
+  intptr_t ReadListLength() { return ReadUInt(); }
+
+  uint8_t ReadByte() { return buffer_[offset_++]; }
+
+  bool ReadBool() { return (ReadByte() & 1) == 1; }
+
+  word ReadFlags() { return ReadByte(); }
+
+  Tag ReadTag(uint8_t* payload = NULL) {
+    uint8_t byte = ReadByte();
+    bool has_payload = (byte & kSpecializedTagHighBit) != 0;
+    if (has_payload) {
+      if (payload != NULL) {
+        *payload = byte & kSpecializedPayloadMask;
+      }
+      return static_cast<Tag>(byte & kSpecializedTagMask);
+    } else {
+      return static_cast<Tag>(byte);
+    }
+  }
+
+  const uint8_t* Consume(int count) {
+    ASSERT(offset_ + count <= size_);
+    const uint8_t* old = buffer_ + offset_;
+    offset_ += count;
+    return old;
+  }
+
+  void EnsureEnd() {
+    if (offset_ != size_) {
+      FATAL2(
+          "Reading Kernel file: Expected to be at EOF "
+          "(offset: %" Pd64 ", size: %" Pd64 ")",
+          offset_, size_);
+    }
+  }
+
+  void DumpOffset(const char* str) {
+    OS::PrintErr("@%" Pd64 " %s\n", offset_, str);
+  }
+
+  template <typename T, typename RT>
+  T* ReadOptional() {
+    Tag tag = ReadTag();
+    if (tag == kNothing) {
+      return NULL;
+    }
+    ASSERT(tag == kSomething);
+    return RT::ReadFrom(this);
+  }
+
+  template <typename T>
+  T* ReadOptional() {
+    return ReadOptional<T, T>();
+  }
+
+  ReaderHelper* helper() { return &builder_; }
+
+ private:
+  const uint8_t* buffer_;
+  int64_t size_;
+  int64_t offset_;
+  ReaderHelper builder_;
+};
+
+
+class WriterHelper {
+ public:
+  WriterHelper() : labels_(NULL) {}
+
+  void SetProgram(Program* program) {
+    program_ = program;
+    for (int i = 0; i < program->libraries().length(); i++) {
+      Library* lib = program->libraries()[i];
+      libraries_.Set(lib, i);
+
+      for (int j = 0; j < lib->classes().length(); j++) {
+        Class* klass = lib->classes()[j];
+        classes_.Set(klass, j);
+
+        for (int k = 0; k < klass->fields().length(); k++) {
+          Field* field = klass->fields()[k];
+          fields_.Set(field, k);
+        }
+        for (int k = 0; k < klass->constructors().length(); k++) {
+          Constructor* constructor = klass->constructors()[k];
+          constructors_.Set(constructor, k);
+        }
+        for (int k = 0; k < klass->procedures().length(); k++) {
+          Procedure* procedure = klass->procedures()[k];
+          procedures_.Set(procedure, k);
+        }
+      }
+
+      for (int k = 0; k < lib->fields().length(); k++) {
+        Field* field = lib->fields()[k];
+        fields_.Set(field, k);
+      }
+
+      for (int k = 0; k < lib->procedures().length(); k++) {
+        Procedure* procedure = lib->procedures()[k];
+        procedures_.Set(procedure, k);
+      }
+    }
+  }
+
+  Program* program() { return program_; }
+
+  BlockMap<String>& strings() { return strings_; }
+  BlockMap<Library>& libraries() { return libraries_; }
+  BlockMap<Class>& classes() { return classes_; }
+  BlockMap<Field>& fields() { return fields_; }
+  BlockMap<Procedure>& procedures() { return procedures_; }
+  BlockMap<Constructor>& constructors() { return constructors_; }
+
+  BlockMap<VariableDeclaration>& variables() { return scope_; }
+  BlockMap<TypeParameter>& type_parameters() { return type_parameters_; }
+  BlockMap<SwitchCase>& switch_cases() { return switch_cases_; }
+
+  BlockMap<LabeledStatement>* labels() { return labels_; }
+  void set_labels(BlockMap<LabeledStatement>* labels) { labels_ = labels; }
+
+ private:
+  Program* program_;
+
+  BlockMap<String> strings_;
+  BlockMap<Library> libraries_;
+  BlockMap<Class> classes_;
+  BlockMap<Field> fields_;
+  BlockMap<Procedure> procedures_;
+  BlockMap<Constructor> constructors_;
+
+  BlockMap<VariableDeclaration> scope_;
+  BlockMap<TypeParameter> type_parameters_;
+  BlockMap<SwitchCase> switch_cases_;
+  BlockMap<LabeledStatement>* labels_;
+};
+
+
+class Writer {
+ public:
+  explicit Writer(ByteWriter* writer) : out_(writer), offset_(0) {}
+
+  void WriteUInt32(uint32_t value) {
+    uint8_t buffer[4] = {
+        static_cast<uint8_t>((value >> 24) & 0xff),
+        static_cast<uint8_t>((value >> 16) & 0xff),
+        static_cast<uint8_t>((value >> 8) & 0xff),
+        static_cast<uint8_t>((value >> 0) & 0xff),
+    };
+    WriteBytes(buffer, 4);
+  }
+
+  void WriteUInt(uint32_t value) {
+    if (value < 0x80) {
+      // 0...
+      WriteByte(static_cast<uint8_t>(value));
+    } else if (value < 0x4000) {
+      // 10...
+      WriteByte(static_cast<uint8_t>(((value >> 8) & 0x3f) | 0x80));
+      WriteByte(static_cast<uint8_t>(value & 0xff));
+    } else {
+      // 11...
+      // Ensure the highest 2 bits is not used for anything (we use it to for
+      // encoding).
+      ASSERT(static_cast<uint8_t>((value >> 24) & 0xc0) == 0);
+      uint8_t buffer[4] = {
+          static_cast<uint8_t>(((value >> 24) & 0x7f) | 0xc0),
+          static_cast<uint8_t>((value >> 16) & 0xff),
+          static_cast<uint8_t>((value >> 8) & 0xff),
+          static_cast<uint8_t>((value >> 0) & 0xff),
+      };
+      WriteBytes(buffer, 4);
+    }
+  }
+
+  void WriteListLength(intptr_t value) { return WriteUInt(value); }
+
+  void WriteByte(uint8_t value) {
+    out_->WriteByte(value);
+    offset_++;
+  }
+
+  void WriteBool(bool value) { WriteByte(value ? 1 : 0); }
+
+  void WriteFlags(uint8_t value) { WriteByte(value); }
+
+  void WriteTag(Tag tag) { WriteByte(static_cast<uint8_t>(tag)); }
+
+  void WriteTag(Tag tag, uint8_t payload) {
+    ASSERT((payload & ~kSpecializedPayloadMask) == 0);
+    WriteByte(kSpecializedTagHighBit | static_cast<uint8_t>(tag) | payload);
+  }
+
+  void WriteBytes(uint8_t* bytes, int length) {
+    out_->WriteBytes(bytes, length);
+    offset_ += length;
+  }
+
+  void WritePosition(TokenPosition position) {
+    intptr_t value = position.value() + 1;
+    WriteUInt(value);
+  }
+
+  template <typename T>
+  void WriteOptional(T* object) {
+    if (object == NULL) {
+      WriteTag(kNothing);
+    } else {
+      WriteTag(kSomething);
+      object->WriteTo(this);
+    }
+  }
+
+  template <typename T, typename WT>
+  void WriteOptionalStatic(T* object) {
+    if (object == NULL) {
+      WriteTag(kNothing);
+    } else {
+      WriteTag(kSomething);
+      WT::WriteTo(this, object);
+    }
+  }
+
+  template <typename T>
+  void WriteOptionalStatic(T* object) {
+    return WriteOptionalStatic<T, T>(object);
+  }
+
+  void DumpOffset(const char* str) {
+    OS::PrintErr("@%" Pd64 " %s\n", offset_, str);
+  }
+
+  WriterHelper* helper() { return &helper_; }
+
+ private:
+  ByteWriter* out_;
+  WriterHelper helper_;
+  int64_t offset_;
+};
+
+
+template <typename T>
+template <typename IT>
+void List<T>::ReadFrom(Reader* reader, TreeNode* parent) {
+  TRACE_READ_OFFSET();
+  ASSERT(parent != NULL);
+  int length = reader->ReadListLength();
+  EnsureInitialized(length);
+
+  for (int i = 0; i < length_; i++) {
+    IT* object = GetOrCreate<IT>(i, parent);
+    object->ReadFrom(reader);
+  }
+}
+
+
+template <typename T>
+template <typename IT>
+void List<T>::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  int length = reader->ReadListLength();
+  EnsureInitialized(length);
+
+  for (int i = 0; i < length_; i++) {
+    GetOrCreate<IT>(i)->ReadFrom(reader);
+  }
+}
+
+
+template <typename T>
+template <typename IT>
+void List<T>::ReadFromStatic(Reader* reader) {
+  TRACE_READ_OFFSET();
+  int length = reader->ReadListLength();
+  EnsureInitialized(length);
+
+  for (int i = 0; i < length_; i++) {
+    ASSERT(array_[i] == NULL);
+    array_[i] = IT::ReadFrom(reader);
+  }
+}
+
+
+template <typename T>
+void List<T>::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+
+  // NOTE: We only support dense lists.
+  writer->WriteListLength(length_);
+  for (int i = 0; i < length_; i++) {
+    T* object = array_[i];
+    ASSERT(object != NULL);
+    object->WriteTo(writer);
+  }
+}
+
+
+template <typename T>
+template <typename IT>
+void List<T>::WriteToStatic(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+
+  // NOTE: We only support dense lists.
+  writer->WriteListLength(length_);
+  for (int i = 0; i < length_; i++) {
+    T* object = array_[i];
+    ASSERT(object != NULL);
+    IT::WriteTo(writer, object);
+  }
+}
+
+
+void TypeParameterList::ReadFrom(Reader* reader) {
+  // It is possible for the bound of the first type parameter to refer to
+  // the second type parameter. This means we need to create [TypeParameter]
+  // objects before reading the bounds.
+  int length = reader->ReadListLength();
+  EnsureInitialized(length);
+
+  // Make all [TypeParameter]s available in scope.
+  for (int i = 0; i < length; i++) {
+    TypeParameter* parameter = (*this)[i] = new TypeParameter();
+    reader->helper()->type_parameters().Push(parameter);
+  }
+
+  // Read all [TypeParameter]s and their bounds.
+  for (int i = 0; i < length; i++) {
+    (*this)[i]->ReadFrom(reader);
+  }
+}
+
+
+void TypeParameterList::WriteTo(Writer* writer) {
+  writer->WriteListLength(length());
+
+  // Make all [TypeParameter]s available in scope.
+  for (int i = 0; i < length(); i++) {
+    TypeParameter* parameter = (*this)[i];
+    writer->helper()->type_parameters().Push(parameter);
+  }
+
+  // Write all [TypeParameter]s and their bounds.
+  for (int i = 0; i < length(); i++) {
+    TypeParameter* parameter = (*this)[i];
+    parameter->WriteTo(writer);
+  }
+}
+
+
+template <typename A, typename B>
+Tuple<A, B>* Tuple<A, B>::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  A* first = A::ReadFrom(reader);
+  B* second = B::ReadFrom(reader);
+  return new Tuple<A, B>(first, second);
+}
+
+
+template <typename A, typename B>
+void Tuple<A, B>::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  first_->WriteTo(writer);
+  second_->WriteTo(writer);
+}
+
+
+template <typename B, typename S>
+class DowncastReader {
+ public:
+  static S* ReadFrom(Reader* reader) {
+    TRACE_READ_OFFSET();
+    return S::Cast(B::ReadFrom(reader));
+  }
+};
+
+
+class StringImpl {
+ public:
+  static String* ReadFrom(Reader* reader) {
+    TRACE_READ_OFFSET();
+    return String::ReadFromImpl(reader);
+  }
+
+  static void WriteTo(Writer* writer, String* string) {
+    TRACE_WRITE_OFFSET();
+    string->WriteToImpl(writer);
+  }
+};
+
+
+class VariableDeclarationImpl {
+ public:
+  static VariableDeclaration* ReadFrom(Reader* reader) {
+    TRACE_READ_OFFSET();
+    return VariableDeclaration::ReadFromImpl(reader);
+  }
+
+  static void WriteTo(Writer* writer, VariableDeclaration* d) {
+    TRACE_WRITE_OFFSET();
+    d->WriteToImpl(writer);
+  }
+};
+
+
+String* String::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  return Reference::ReadStringFrom(reader);
+}
+
+
+String* String::ReadFromImpl(Reader* reader) {
+  TRACE_READ_OFFSET();
+  uint32_t bytes = reader->ReadUInt();
+  String* string = new String(reader->Consume(bytes), bytes);
+  return string;
+}
+
+
+void String::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  Reference::WriteStringTo(writer, this);
+}
+
+
+void String::WriteToImpl(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteUInt(size_);
+  writer->WriteBytes(buffer_, size_);
+}
+
+
+void StringTable::ReadFrom(Reader* reader) {
+  strings_.ReadFromStatic<StringImpl>(reader);
+}
+
+
+void StringTable::WriteTo(Writer* writer) {
+  strings_.WriteToStatic<StringImpl>(writer);
+
+  // Build up the "String* -> index" table.
+  WriterHelper* helper = writer->helper();
+  for (int i = 0; i < strings_.length(); i++) {
+    helper->strings().Push(strings_[i]);
+  }
+}
+
+
+void LineStartingTable::ReadFrom(Reader* reader) {
+  size_ = reader->helper()->program()->source_uri_table().strings().length();
+  values_ = new intptr_t*[size_];
+  for (intptr_t i = 0; i < size_; ++i) {
+    intptr_t line_count = reader->ReadUInt();
+    intptr_t* line_starts = new intptr_t[line_count + 1];
+    line_starts[0] = line_count;
+    intptr_t previous_line_start = 0;
+    for (intptr_t j = 0; j < line_count; ++j) {
+      intptr_t line_start = reader->ReadUInt() + previous_line_start;
+      line_starts[j + 1] = line_start;
+      previous_line_start = line_start;
+    }
+    values_[i] = line_starts;
+  }
+}
+
+
+void LineStartingTable::WriteTo(Writer* writer) {
+  for (intptr_t i = 0; i < size_; ++i) {
+    intptr_t* line_starts = values_[i];
+    intptr_t line_count = line_starts[0];
+    writer->WriteUInt(line_count);
+
+    intptr_t previous_line_start = 0;
+    for (intptr_t j = 0; j < line_count; ++j) {
+      intptr_t line_start = line_starts[j + 1];
+      writer->WriteUInt(line_start - previous_line_start);
+      previous_line_start = line_start;
+    }
+  }
+}
+
+
+Library* Library::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  int flags = reader->ReadFlags();
+  ASSERT(flags == 0);  // external libraries not supported
+  name_ = Reference::ReadStringFrom(reader);
+  import_uri_ = Reference::ReadStringFrom(reader);
+  source_uri_index_ = reader->ReadUInt();
+
+  int num_classes = reader->ReadUInt();
+  classes().EnsureInitialized(num_classes);
+  for (int i = 0; i < num_classes; i++) {
+    Tag tag = reader->ReadTag();
+    if (tag == kNormalClass) {
+      NormalClass* klass = classes().GetOrCreate<NormalClass>(i, this);
+      klass->ReadFrom(reader);
+    } else {
+      ASSERT(tag == kMixinClass);
+      MixinClass* klass = classes().GetOrCreate<MixinClass>(i, this);
+      klass->ReadFrom(reader);
+    }
+  }
+
+  fields().ReadFrom<Field>(reader, this);
+  procedures().ReadFrom<Procedure>(reader, this);
+  return this;
+}
+
+
+void Library::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  name_->WriteTo(writer);
+  import_uri_->WriteTo(writer);
+  writer->WriteUInt(source_uri_index_);
+
+  writer->WriteUInt(classes_.length());
+  for (int i = 0; i < classes_.length(); i++) {
+    Class* klass = classes_[i];
+    if (klass->IsNormalClass()) {
+      writer->WriteTag(kNormalClass);
+      NormalClass::Cast(klass)->WriteTo(writer);
+    } else {
+      writer->WriteTag(kMixinClass);
+      MixinClass::Cast(klass)->WriteTo(writer);
+    }
+  }
+  fields().WriteTo(writer);
+  procedures().WriteTo(writer);
+}
+
+
+Class* Class::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+
+  is_abstract_ = reader->ReadBool();
+  name_ = Reference::ReadStringFrom(reader);
+  source_uri_index_ = reader->ReadUInt();
+  annotations_.ReadFromStatic<Expression>(reader);
+
+  return this;
+}
+
+
+void Class::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteBool(is_abstract_);
+  name_->WriteTo(writer);
+  writer->WriteUInt(source_uri_index_);
+  annotations_.WriteTo(writer);
+}
+
+
+NormalClass* NormalClass::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  Class::ReadFrom(reader);
+  TypeParameterScope<ReaderHelper> scope(reader->helper());
+
+  type_parameters_.ReadFrom(reader);
+  DartType* type = reader->ReadOptional<DartType>();
+
+  super_class_ = InterfaceType::Cast(type);
+  implemented_classes_.ReadFromStatic<DowncastReader<DartType, InterfaceType> >(
+      reader);
+  fields_.ReadFrom<Field>(reader, this);
+  constructors_.ReadFrom<Constructor>(reader, this);
+  procedures_.ReadFrom<Procedure>(reader, this);
+
+  return this;
+}
+
+
+void NormalClass::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  Class::WriteTo(writer);
+  TypeParameterScope<WriterHelper> scope(writer->helper());
+
+  type_parameters().WriteTo(writer);
+  writer->WriteOptional<DartType>(super_class_);
+  implemented_classes().WriteTo(writer);
+  fields_.WriteTo(writer);
+  constructors_.WriteTo(writer);
+  procedures_.WriteTo(writer);
+}
+
+
+MixinClass* MixinClass::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  TypeParameterScope<ReaderHelper> scope(reader->helper());
+
+  Class::ReadFrom(reader);
+  type_parameters_.ReadFrom(reader);
+  first_ = InterfaceType::Cast(DartType::ReadFrom(reader));
+  second_ = InterfaceType::Cast(DartType::ReadFrom(reader));
+  implemented_classes_.ReadFromStatic<DowncastReader<DartType, InterfaceType> >(
+      reader);
+  constructors_.ReadFrom<Constructor>(reader, this);
+  return this;
+}
+
+
+void MixinClass::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  TypeParameterScope<WriterHelper> scope(writer->helper());
+
+  Class::WriteTo(writer);
+  type_parameters_.WriteTo(writer);
+  first_->WriteTo(writer);
+  second_->WriteTo(writer);
+  implemented_classes_.WriteTo(writer);
+  constructors_.WriteTo(writer);
+}
+
+
+Member* Reference::ReadMemberFrom(Reader* reader, bool allow_null) {
+  TRACE_READ_OFFSET();
+
+  Program* program = reader->helper()->program();
+  Tag tag = reader->ReadTag();
+  switch (tag) {
+    case kLibraryFieldReference: {
+      int library_idx = reader->ReadUInt();
+      int field_idx = reader->ReadUInt();
+      Library* library = program->libraries().GetOrCreate<Library>(library_idx);
+      return library->fields().GetOrCreate<Field>(field_idx, library);
+    }
+    case kLibraryProcedureReference: {
+      int library_idx = reader->ReadUInt();
+      int procedure_idx = reader->ReadUInt();
+      Library* library = program->libraries().GetOrCreate<Library>(library_idx);
+      return library->procedures().GetOrCreate<Procedure>(procedure_idx,
+                                                          library);
+    }
+    case kClassFieldReference:
+    case kClassConstructorReference:
+    case kClassProcedureReference: {
+      Class* klass = Reference::ReadClassFrom(reader);
+      if (tag == kClassFieldReference) {
+        int field_idx = reader->ReadUInt();
+        return klass->fields().GetOrCreate<Field>(field_idx, klass);
+      } else if (tag == kClassConstructorReference) {
+        int constructor_idx = reader->ReadUInt();
+        return klass->constructors().GetOrCreate<Constructor>(constructor_idx,
+                                                              klass);
+      } else {
+        ASSERT(tag == kClassProcedureReference);
+        int procedure_idx = reader->ReadUInt();
+        return klass->procedures().GetOrCreate<Procedure>(procedure_idx, klass);
+      }
+    }
+    case kNullReference:
+      if (allow_null) {
+        return NULL;
+      } else {
+        FATAL("Expected a valid member reference, but got `null`");
+      }
+    default:
+      UNREACHABLE();
+      break;
+  }
+
+  UNREACHABLE();
+  return NULL;
+}
+
+
+void Reference::WriteMemberTo(Writer* writer, Member* member, bool allow_null) {
+  TRACE_WRITE_OFFSET();
+  if (member == NULL) {
+    if (allow_null) {
+      writer->WriteTag(kNullReference);
+      return;
+    } else {
+      FATAL("Expected a valid member reference but got `null`");
+    }
+  }
+  TreeNode* node = member->parent();
+
+  WriterHelper* helper = writer->helper();
+
+  if (node->IsLibrary()) {
+    Library* library = Library::Cast(node);
+    if (member->IsField()) {
+      Field* field = Field::Cast(member);
+      writer->WriteTag(kLibraryFieldReference);
+      writer->WriteUInt(helper->libraries().Lookup(library));
+      writer->WriteUInt(helper->fields().Lookup(field));
+    } else {
+      Procedure* procedure = Procedure::Cast(member);
+      writer->WriteTag(kLibraryProcedureReference);
+      writer->WriteUInt(helper->libraries().Lookup(library));
+      writer->WriteUInt(helper->procedures().Lookup(procedure));
+    }
+  } else {
+    Class* klass = Class::Cast(node);
+
+    if (member->IsField()) {
+      Field* field = Field::Cast(member);
+      writer->WriteTag(kClassFieldReference);
+      Reference::WriteClassTo(writer, klass);
+      writer->WriteUInt(helper->fields().Lookup(field));
+    } else if (member->IsConstructor()) {
+      Constructor* constructor = Constructor::Cast(member);
+      writer->WriteTag(kClassConstructorReference);
+      Reference::WriteClassTo(writer, klass);
+      writer->WriteUInt(helper->constructors().Lookup(constructor));
+    } else {
+      Procedure* procedure = Procedure::Cast(member);
+      writer->WriteTag(kClassProcedureReference);
+      Reference::WriteClassTo(writer, klass);
+      writer->WriteUInt(helper->procedures().Lookup(procedure));
+    }
+  }
+}
+
+
+Class* Reference::ReadClassFrom(Reader* reader, bool allow_null) {
+  TRACE_READ_OFFSET();
+  Program* program = reader->helper()->program();
+
+  Tag klass_member_tag = reader->ReadTag();
+  if (klass_member_tag == kNullReference) {
+    if (allow_null) {
+      return NULL;
+    } else {
+      FATAL("Expected a valid class reference but got `null`.");
+    }
+  }
+  int library_idx = reader->ReadUInt();
+  int class_idx = reader->ReadUInt();
+
+  Library* library = program->libraries().GetOrCreate<Library>(library_idx);
+  Class* klass;
+  if (klass_member_tag == kNormalClassReference) {
+    klass = library->classes().GetOrCreate<NormalClass>(class_idx, library);
+  } else {
+    ASSERT(klass_member_tag == kMixinClassReference);
+    klass = library->classes().GetOrCreate<MixinClass>(class_idx, library);
+  }
+  return klass;
+}
+
+
+void Reference::WriteClassTo(Writer* writer, Class* klass, bool allow_null) {
+  TRACE_WRITE_OFFSET();
+  if (klass == NULL) {
+    if (allow_null) {
+      writer->WriteTag(kNullReference);
+      return;
+    } else {
+      FATAL("Expected a valid class reference but got `null`.");
+    }
+  }
+  if (klass->IsNormalClass()) {
+    writer->WriteTag(kNormalClassReference);
+  } else {
+    ASSERT(klass->IsMixinClass());
+    writer->WriteTag(kMixinClassReference);
+  }
+
+  writer->WriteUInt(writer->helper()->libraries().Lookup(klass->parent()));
+  writer->WriteUInt(writer->helper()->classes().Lookup(klass));
+}
+
+
+String* Reference::ReadStringFrom(Reader* reader) {
+  int index = reader->ReadUInt();
+  return reader->helper()->program()->string_table().strings()[index];
+}
+
+
+void Reference::WriteStringTo(Writer* writer, String* string) {
+  int index = writer->helper()->strings().Lookup(string);
+  writer->WriteUInt(index);
+}
+
+
+Field* Field::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  Tag tag = reader->ReadTag();
+  ASSERT(tag == kField);
+
+  position_ = reader->ReadPosition();
+  flags_ = reader->ReadFlags();
+  name_ = Name::ReadFrom(reader);
+  source_uri_index_ = reader->ReadUInt();
+  annotations_.ReadFromStatic<Expression>(reader);
+  type_ = DartType::ReadFrom(reader);
+  inferred_value_ = reader->ReadOptional<InferredValue>();
+  initializer_ = reader->ReadOptional<Expression>();
+  return this;
+}
+
+
+void Field::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kField);
+  writer->WritePosition(position_);
+  writer->WriteFlags(flags_);
+  name_->WriteTo(writer);
+  writer->WriteUInt(source_uri_index_);
+  annotations_.WriteTo(writer);
+  type_->WriteTo(writer);
+  writer->WriteOptional<InferredValue>(inferred_value_);
+  writer->WriteOptional<Expression>(initializer_);
+}
+
+
+Constructor* Constructor::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  Tag tag = reader->ReadTag();
+  ASSERT(tag == kConstructor);
+
+  VariableScope<ReaderHelper> parameters(reader->helper());
+  flags_ = reader->ReadFlags();
+  name_ = Name::ReadFrom(reader);
+  annotations_.ReadFromStatic<Expression>(reader);
+  function_ = FunctionNode::ReadFrom(reader);
+  initializers_.ReadFromStatic<Initializer>(reader);
+  return this;
+}
+
+
+void Constructor::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kConstructor);
+
+  VariableScope<WriterHelper> parameters(writer->helper());
+  writer->WriteFlags(flags_);
+  name_->WriteTo(writer);
+  annotations_.WriteTo(writer);
+  function_->WriteTo(writer);
+  initializers_.WriteTo(writer);
+}
+
+
+Procedure* Procedure::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  Tag tag = reader->ReadTag();
+  ASSERT(tag == kProcedure);
+
+  VariableScope<ReaderHelper> parameters(reader->helper());
+  kind_ = static_cast<ProcedureKind>(reader->ReadByte());
+  flags_ = reader->ReadFlags();
+  name_ = Name::ReadFrom(reader);
+  source_uri_index_ = reader->ReadUInt();
+  annotations_.ReadFromStatic<Expression>(reader);
+  function_ = reader->ReadOptional<FunctionNode>();
+  return this;
+}
+
+
+void Procedure::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kProcedure);
+
+  VariableScope<WriterHelper> parameters(writer->helper());
+  writer->WriteByte(kind_);
+  writer->WriteFlags(flags_);
+  name_->WriteTo(writer);
+  writer->WriteUInt(source_uri_index_);
+  annotations_.WriteTo(writer);
+  writer->WriteOptional<FunctionNode>(function_);
+}
+
+
+Initializer* Initializer::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  Tag tag = reader->ReadTag();
+  switch (tag) {
+    case kInvalidInitializer:
+      return InvalidInitializer::ReadFromImpl(reader);
+    case kFieldInitializer:
+      return FieldInitializer::ReadFromImpl(reader);
+    case kSuperInitializer:
+      return SuperInitializer::ReadFromImpl(reader);
+    case kRedirectingInitializer:
+      return RedirectingInitializer::ReadFromImpl(reader);
+    case kLocalInitializer:
+      return LocalInitializer::ReadFromImpl(reader);
+    default:
+      UNREACHABLE();
+  }
+  return NULL;
+}
+
+
+InvalidInitializer* InvalidInitializer::ReadFromImpl(Reader* reader) {
+  TRACE_READ_OFFSET();
+  return new InvalidInitializer();
+}
+
+
+void InvalidInitializer::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kInvalidInitializer);
+}
+
+
+FieldInitializer* FieldInitializer::ReadFromImpl(Reader* reader) {
+  TRACE_READ_OFFSET();
+  FieldInitializer* initializer = new FieldInitializer();
+  initializer->field_ = Field::Cast(Reference::ReadMemberFrom(reader));
+  initializer->value_ = Expression::ReadFrom(reader);
+  return initializer;
+}
+
+
+void FieldInitializer::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kFieldInitializer);
+  Reference::WriteMemberTo(writer, field_);
+  value_->WriteTo(writer);
+}
+
+
+SuperInitializer* SuperInitializer::ReadFromImpl(Reader* reader) {
+  TRACE_READ_OFFSET();
+  SuperInitializer* init = new SuperInitializer();
+  init->target_ = Constructor::Cast(Reference::ReadMemberFrom(reader));
+  init->arguments_ = Arguments::ReadFrom(reader);
+  return init;
+}
+
+
+void SuperInitializer::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kSuperInitializer);
+  Reference::WriteMemberTo(writer, target_);
+  arguments_->WriteTo(writer);
+}
+
+
+RedirectingInitializer* RedirectingInitializer::ReadFromImpl(Reader* reader) {
+  TRACE_READ_OFFSET();
+  RedirectingInitializer* init = new RedirectingInitializer();
+  init->target_ = Constructor::Cast(Reference::ReadMemberFrom(reader));
+  init->arguments_ = Arguments::ReadFrom(reader);
+  return init;
+}
+
+
+void RedirectingInitializer::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kRedirectingInitializer);
+  Reference::WriteMemberTo(writer, target_);
+  arguments_->WriteTo(writer);
+}
+
+
+LocalInitializer* LocalInitializer::ReadFromImpl(Reader* reader) {
+  TRACE_READ_OFFSET();
+  LocalInitializer* init = new LocalInitializer();
+  init->variable_ = VariableDeclaration::ReadFromImpl(reader);
+  return init;
+}
+
+
+void LocalInitializer::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kLocalInitializer);
+  variable_->WriteToImpl(writer);
+}
+
+
+Expression* Expression::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  uint8_t payload = 0;
+  Tag tag = reader->ReadTag(&payload);
+  switch (tag) {
+    case kInvalidExpression:
+      return InvalidExpression::ReadFrom(reader);
+    case kVariableGet:
+      return VariableGet::ReadFrom(reader);
+    case kSpecializedVariableGet:
+      return VariableGet::ReadFrom(reader, payload);
+    case kVariableSet:
+      return VariableSet::ReadFrom(reader);
+    case kSpecializedVariableSet:
+      return VariableSet::ReadFrom(reader, payload);
+    case kPropertyGet:
+      return PropertyGet::ReadFrom(reader);
+    case kPropertySet:
+      return PropertySet::ReadFrom(reader);
+    case kDirectPropertyGet:
+      return DirectPropertyGet::ReadFrom(reader);
+    case kDirectPropertySet:
+      return DirectPropertySet::ReadFrom(reader);
+    case kStaticGet:
+      return StaticGet::ReadFrom(reader);
+    case kStaticSet:
+      return StaticSet::ReadFrom(reader);
+    case kMethodInvocation:
+      return MethodInvocation::ReadFrom(reader);
+    case kDirectMethodInvocation:
+      return DirectMethodInvocation::ReadFrom(reader);
+    case kStaticInvocation:
+      return StaticInvocation::ReadFrom(reader, false);
+    case kConstStaticInvocation:
+      return StaticInvocation::ReadFrom(reader, true);
+    case kConstructorInvocation:
+      return ConstructorInvocation::ReadFrom(reader, false);
+    case kConstConstructorInvocation:
+      return ConstructorInvocation::ReadFrom(reader, true);
+    case kNot:
+      return Not::ReadFrom(reader);
+    case kLogicalExpression:
+      return LogicalExpression::ReadFrom(reader);
+    case kConditionalExpression:
+      return ConditionalExpression::ReadFrom(reader);
+    case kStringConcatenation:
+      return StringConcatenation::ReadFrom(reader);
+    case kIsExpression:
+      return IsExpression::ReadFrom(reader);
+    case kAsExpression:
+      return AsExpression::ReadFrom(reader);
+    case kSymbolLiteral:
+      return SymbolLiteral::ReadFrom(reader);
+    case kTypeLiteral:
+      return TypeLiteral::ReadFrom(reader);
+    case kThisExpression:
+      return ThisExpression::ReadFrom(reader);
+    case kRethrow:
+      return Rethrow::ReadFrom(reader);
+    case kThrow:
+      return Throw::ReadFrom(reader);
+    case kListLiteral:
+      return ListLiteral::ReadFrom(reader, false);
+    case kConstListLiteral:
+      return ListLiteral::ReadFrom(reader, true);
+    case kMapLiteral:
+      return MapLiteral::ReadFrom(reader, false);
+    case kConstMapLiteral:
+      return MapLiteral::ReadFrom(reader, true);
+    case kAwaitExpression:
+      return AwaitExpression::ReadFrom(reader);
+    case kFunctionExpression:
+      return FunctionExpression::ReadFrom(reader);
+    case kLet:
+      return Let::ReadFrom(reader);
+    case kBlockExpression:
+      return BlockExpression::ReadFrom(reader);
+    case kBigIntLiteral:
+      return BigintLiteral::ReadFrom(reader);
+    case kStringLiteral:
+      return StringLiteral::ReadFrom(reader);
+    case kSpecialIntLiteral:
+      return IntLiteral::ReadFrom(reader, payload);
+    case kNegativeIntLiteral:
+      return IntLiteral::ReadFrom(reader, true);
+    case kPositiveIntLiteral:
+      return IntLiteral::ReadFrom(reader, false);
+    case kDoubleLiteral:
+      return DoubleLiteral::ReadFrom(reader);
+    case kTrueLiteral:
+      return BoolLiteral::ReadFrom(reader, true);
+    case kFalseLiteral:
+      return BoolLiteral::ReadFrom(reader, false);
+    case kNullLiteral:
+      return NullLiteral::ReadFrom(reader);
+    default:
+      UNREACHABLE();
+  }
+  return NULL;
+}
+
+
+InvalidExpression* InvalidExpression::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  return new InvalidExpression();
+}
+
+
+void InvalidExpression::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kInvalidExpression);
+}
+
+
+VariableGet* VariableGet::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  VariableGet* get = new VariableGet();
+  get->variable_ = reader->helper()->variables().Lookup(reader->ReadUInt());
+  reader->ReadOptional<DartType>();  // Unused promoted type.
+  return get;
+}
+
+
+VariableGet* VariableGet::ReadFrom(Reader* reader, uint8_t payload) {
+  TRACE_READ_OFFSET();
+  VariableGet* get = new VariableGet();
+  get->variable_ = reader->helper()->variables().Lookup(payload);
+  return get;
+}
+
+
+void VariableGet::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  int index = writer->helper()->variables().Lookup(variable_);
+  if ((index & kSpecializedPayloadMask) == index) {
+    writer->WriteTag(kSpecializedVariableGet, static_cast<uint8_t>(index));
+  } else {
+    writer->WriteTag(kVariableGet);
+    writer->WriteUInt(index);
+    writer->WriteOptional<DartType>(NULL);
+  }
+}
+
+
+VariableSet* VariableSet::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  VariableSet* set = new VariableSet();
+  set->variable_ = reader->helper()->variables().Lookup(reader->ReadUInt());
+  set->expression_ = Expression::ReadFrom(reader);
+  return set;
+}
+
+
+VariableSet* VariableSet::ReadFrom(Reader* reader, uint8_t payload) {
+  TRACE_READ_OFFSET();
+  VariableSet* set = new VariableSet();
+  set->variable_ = reader->helper()->variables().Lookup(payload);
+  set->expression_ = Expression::ReadFrom(reader);
+  return set;
+}
+
+
+void VariableSet::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  int index = writer->helper()->variables().Lookup(variable_);
+  if ((index & kSpecializedPayloadMask) == index) {
+    writer->WriteTag(kSpecializedVariableSet, static_cast<uint8_t>(index));
+  } else {
+    writer->WriteTag(kVariableSet);
+    writer->WriteUInt(index);
+  }
+  expression_->WriteTo(writer);
+}
+
+
+PropertyGet* PropertyGet::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  PropertyGet* get = new PropertyGet();
+  get->position_ = reader->ReadPosition();
+  get->receiver_ = Expression::ReadFrom(reader);
+  get->name_ = Name::ReadFrom(reader);
+  get->interfaceTarget_ = Reference::ReadMemberFrom(reader, true);
+  return get;
+}
+
+
+void PropertyGet::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kPropertyGet);
+  writer->WritePosition(position_);
+  receiver_->WriteTo(writer);
+  name_->WriteTo(writer);
+  Reference::WriteMemberTo(writer, interfaceTarget_, true);
+}
+
+
+PropertySet* PropertySet::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  PropertySet* set = new PropertySet();
+  set->position_ = reader->ReadPosition();
+  set->receiver_ = Expression::ReadFrom(reader);
+  set->name_ = Name::ReadFrom(reader);
+  set->value_ = Expression::ReadFrom(reader);
+  set->interfaceTarget_ = Reference::ReadMemberFrom(reader, true);
+  return set;
+}
+
+
+void PropertySet::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kPropertySet);
+  writer->WritePosition(position_);
+  receiver_->WriteTo(writer);
+  name_->WriteTo(writer);
+  value_->WriteTo(writer);
+  Reference::WriteMemberTo(writer, interfaceTarget_, true);
+}
+
+
+DirectPropertyGet* DirectPropertyGet::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  DirectPropertyGet* get = new DirectPropertyGet();
+  get->receiver_ = Expression::ReadFrom(reader);
+  get->target_ = Reference::ReadMemberFrom(reader);
+  return get;
+}
+
+
+void DirectPropertyGet::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kDirectPropertyGet);
+  receiver_->WriteTo(writer);
+  Reference::WriteMemberTo(writer, target_);
+}
+
+
+DirectPropertySet* DirectPropertySet::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  DirectPropertySet* set = new DirectPropertySet();
+  set->receiver_ = Expression::ReadFrom(reader);
+  set->target_ = Reference::ReadMemberFrom(reader);
+  set->value_ = Expression::ReadFrom(reader);
+  return set;
+}
+
+
+void DirectPropertySet::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kDirectPropertySet);
+  receiver_->WriteTo(writer);
+  Reference::WriteMemberTo(writer, target_);
+  value_->WriteTo(writer);
+}
+
+
+StaticGet* StaticGet::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  StaticGet* get = new StaticGet();
+  get->position_ = reader->ReadPosition();
+  get->target_ = Reference::ReadMemberFrom(reader);
+  return get;
+}
+
+
+void StaticGet::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kStaticGet);
+  writer->WritePosition(position_);
+  Reference::WriteMemberTo(writer, target_);
+}
+
+
+StaticSet* StaticSet::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  StaticSet* set = new StaticSet();
+  set->target_ = Reference::ReadMemberFrom(reader);
+  set->expression_ = Expression::ReadFrom(reader);
+  return set;
+}
+
+
+void StaticSet::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kStaticSet);
+  Reference::WriteMemberTo(writer, target_);
+  expression_->WriteTo(writer);
+}
+
+
+Arguments* Arguments::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  Arguments* arguments = new Arguments();
+  arguments->types().ReadFromStatic<DartType>(reader);
+  arguments->positional().ReadFromStatic<Expression>(reader);
+  arguments->named().ReadFromStatic<NamedExpression>(reader);
+  return arguments;
+}
+
+
+void Arguments::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  types().WriteTo(writer);
+  positional().WriteTo(writer);
+  named().WriteTo(writer);
+}
+
+
+NamedExpression* NamedExpression::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  String* name = Reference::ReadStringFrom(reader);
+  Expression* expression = Expression::ReadFrom(reader);
+  return new NamedExpression(name, expression);
+}
+
+
+void NamedExpression::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  name_->WriteTo(writer);
+  expression_->WriteTo(writer);
+}
+
+
+MethodInvocation* MethodInvocation::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  MethodInvocation* invocation = new MethodInvocation();
+  invocation->position_ = reader->ReadPosition();
+  invocation->receiver_ = Expression::ReadFrom(reader);
+  invocation->name_ = Name::ReadFrom(reader);
+  invocation->arguments_ = Arguments::ReadFrom(reader);
+  invocation->interfaceTarget_ = Reference::ReadMemberFrom(reader, true);
+  return invocation;
+}
+
+
+void MethodInvocation::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kMethodInvocation);
+  writer->WritePosition(position_);
+  receiver_->WriteTo(writer);
+  name_->WriteTo(writer);
+  arguments_->WriteTo(writer);
+  Reference::WriteMemberTo(writer, interfaceTarget_, true);
+}
+
+
+DirectMethodInvocation* DirectMethodInvocation::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  DirectMethodInvocation* invocation = new DirectMethodInvocation();
+  invocation->receiver_ = Expression::ReadFrom(reader);
+  invocation->target_ = Procedure::Cast(Reference::ReadMemberFrom(reader));
+  invocation->arguments_ = Arguments::ReadFrom(reader);
+  return invocation;
+}
+
+
+void DirectMethodInvocation::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kDirectMethodInvocation);
+  receiver_->WriteTo(writer);
+  Reference::WriteMemberTo(writer, target_);
+  arguments_->WriteTo(writer);
+}
+
+
+StaticInvocation* StaticInvocation::ReadFrom(Reader* reader, bool is_const) {
+  TRACE_READ_OFFSET();
+  StaticInvocation* invocation = new StaticInvocation();
+  invocation->is_const_ = is_const;
+  invocation->position_ = reader->ReadPosition();
+  invocation->procedure_ = Procedure::Cast(Reference::ReadMemberFrom(reader));
+  invocation->arguments_ = Arguments::ReadFrom(reader);
+  return invocation;
+}
+
+
+void StaticInvocation::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(is_const_ ? kConstStaticInvocation : kStaticInvocation);
+  writer->WritePosition(position_);
+  Reference::WriteMemberTo(writer, procedure_);
+  arguments_->WriteTo(writer);
+}
+
+
+ConstructorInvocation* ConstructorInvocation::ReadFrom(Reader* reader,
+                                                       bool is_const) {
+  TRACE_READ_OFFSET();
+  ConstructorInvocation* invocation = new ConstructorInvocation();
+  invocation->is_const_ = is_const;
+  invocation->position_ = reader->ReadPosition();
+  invocation->target_ = Constructor::Cast(Reference::ReadMemberFrom(reader));
+  invocation->arguments_ = Arguments::ReadFrom(reader);
+  return invocation;
+}
+
+
+void ConstructorInvocation::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(is_const_ ? kConstConstructorInvocation
+                             : kConstructorInvocation);
+  writer->WritePosition(position_);
+  Reference::WriteMemberTo(writer, target_);
+  arguments_->WriteTo(writer);
+}
+
+
+Not* Not::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  Not* n = new Not();
+  n->expression_ = Expression::ReadFrom(reader);
+  return n;
+}
+
+
+void Not::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kNot);
+  expression_->WriteTo(writer);
+}
+
+
+LogicalExpression* LogicalExpression::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  LogicalExpression* expr = new LogicalExpression();
+  expr->left_ = Expression::ReadFrom(reader);
+  expr->operator_ = static_cast<Operator>(reader->ReadByte());
+  expr->right_ = Expression::ReadFrom(reader);
+  return expr;
+}
+
+
+void LogicalExpression::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kLogicalExpression);
+  left_->WriteTo(writer);
+  writer->WriteByte(operator_);
+  right_->WriteTo(writer);
+}
+
+
+ConditionalExpression* ConditionalExpression::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  ConditionalExpression* expr = new ConditionalExpression();
+  expr->condition_ = Expression::ReadFrom(reader);
+  expr->then_ = Expression::ReadFrom(reader);
+  expr->otherwise_ = Expression::ReadFrom(reader);
+  reader->ReadOptional<DartType>();  // Unused static type.
+  return expr;
+}
+
+
+void ConditionalExpression::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kConditionalExpression);
+  condition_->WriteTo(writer);
+  then_->WriteTo(writer);
+  otherwise_->WriteTo(writer);
+  writer->WriteOptional<DartType>(NULL);  // Unused static type.
+}
+
+
+StringConcatenation* StringConcatenation::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  StringConcatenation* concat = new StringConcatenation();
+  concat->expressions_.ReadFromStatic<Expression>(reader);
+  return concat;
+}
+
+
+void StringConcatenation::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kStringConcatenation);
+  expressions_.WriteTo(writer);
+}
+
+
+IsExpression* IsExpression::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  IsExpression* expr = new IsExpression();
+  expr->operand_ = Expression::ReadFrom(reader);
+  expr->type_ = DartType::ReadFrom(reader);
+  return expr;
+}
+
+
+void IsExpression::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kIsExpression);
+  operand_->WriteTo(writer);
+  type_->WriteTo(writer);
+}
+
+
+AsExpression* AsExpression::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  AsExpression* expr = new AsExpression();
+  expr->operand_ = Expression::ReadFrom(reader);
+  expr->type_ = DartType::ReadFrom(reader);
+  return expr;
+}
+
+
+void AsExpression::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kAsExpression);
+  operand_->WriteTo(writer);
+  type_->WriteTo(writer);
+}
+
+
+StringLiteral* StringLiteral::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  return new StringLiteral(Reference::ReadStringFrom(reader));
+}
+
+
+void StringLiteral::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kStringLiteral);
+  value_->WriteTo(writer);
+}
+
+
+BigintLiteral* BigintLiteral::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  return new BigintLiteral(Reference::ReadStringFrom(reader));
+}
+
+
+void BigintLiteral::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kBigIntLiteral);
+  value_->WriteTo(writer);
+}
+
+
+IntLiteral* IntLiteral::ReadFrom(Reader* reader, bool is_negative) {
+  TRACE_READ_OFFSET();
+  IntLiteral* literal = new IntLiteral();
+  literal->value_ = is_negative ? -static_cast<int64_t>(reader->ReadUInt())
+                                : reader->ReadUInt();
+  return literal;
+}
+
+
+IntLiteral* IntLiteral::ReadFrom(Reader* reader, uint8_t payload) {
+  TRACE_READ_OFFSET();
+  IntLiteral* literal = new IntLiteral();
+  literal->value_ = static_cast<int32_t>(payload) - SpecializedIntLiteralBias;
+  return literal;
+}
+
+
+void IntLiteral::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  int64_t payload = value_ + SpecializedIntLiteralBias;
+  if ((payload & kSpecializedPayloadMask) == payload) {
+    writer->WriteTag(kSpecialIntLiteral, static_cast<uint8_t>(payload));
+  } else {
+    writer->WriteTag(value_ < 0 ? kNegativeIntLiteral : kPositiveIntLiteral);
+    writer->WriteUInt(static_cast<uint32_t>(value_ < 0 ? -value_ : value_));
+  }
+}
+
+
+DoubleLiteral* DoubleLiteral::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  DoubleLiteral* literal = new DoubleLiteral();
+  literal->value_ = Reference::ReadStringFrom(reader);
+  return literal;
+}
+
+
+void DoubleLiteral::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kDoubleLiteral);
+  value_->WriteTo(writer);
+}
+
+
+BoolLiteral* BoolLiteral::ReadFrom(Reader* reader, bool value) {
+  TRACE_READ_OFFSET();
+  BoolLiteral* lit = new BoolLiteral();
+  lit->value_ = value;
+  return lit;
+}
+
+
+void BoolLiteral::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(value_ ? kTrueLiteral : kFalseLiteral);
+}
+
+
+NullLiteral* NullLiteral::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  return new NullLiteral();
+}
+
+
+void NullLiteral::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kNullLiteral);
+}
+
+
+SymbolLiteral* SymbolLiteral::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  SymbolLiteral* lit = new SymbolLiteral();
+  lit->value_ = Reference::ReadStringFrom(reader);
+  return lit;
+}
+
+
+void SymbolLiteral::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kSymbolLiteral);
+  value_->WriteTo(writer);
+}
+
+
+TypeLiteral* TypeLiteral::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  TypeLiteral* literal = new TypeLiteral();
+  literal->type_ = DartType::ReadFrom(reader);
+  return literal;
+}
+
+
+void TypeLiteral::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kTypeLiteral);
+  type_->WriteTo(writer);
+}
+
+
+ThisExpression* ThisExpression::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  return new ThisExpression();
+}
+
+
+void ThisExpression::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kThisExpression);
+}
+
+
+Rethrow* Rethrow::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  return new Rethrow();
+}
+
+
+void Rethrow::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kRethrow);
+}
+
+
+Throw* Throw::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  Throw* t = new Throw();
+  t->position_ = reader->ReadPosition();
+  t->expression_ = Expression::ReadFrom(reader);
+  return t;
+}
+
+
+void Throw::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kThrow);
+  writer->WritePosition(position_);
+  expression_->WriteTo(writer);
+}
+
+
+ListLiteral* ListLiteral::ReadFrom(Reader* reader, bool is_const) {
+  TRACE_READ_OFFSET();
+  ListLiteral* literal = new ListLiteral();
+  literal->is_const_ = is_const;
+  literal->type_ = DartType::ReadFrom(reader);
+  literal->expressions_.ReadFromStatic<Expression>(reader);
+  return literal;
+}
+
+
+void ListLiteral::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(is_const_ ? kConstListLiteral : kListLiteral);
+  type_->WriteTo(writer);
+  expressions_.WriteTo(writer);
+}
+
+
+MapLiteral* MapLiteral::ReadFrom(Reader* reader, bool is_const) {
+  TRACE_READ_OFFSET();
+  MapLiteral* literal = new MapLiteral();
+  literal->is_const_ = is_const;
+  literal->key_type_ = DartType::ReadFrom(reader);
+  literal->value_type_ = DartType::ReadFrom(reader);
+  literal->entries_.ReadFromStatic<MapEntry>(reader);
+  return literal;
+}
+
+
+void MapLiteral::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(is_const_ ? kConstMapLiteral : kMapLiteral);
+  key_type_->WriteTo(writer);
+  value_type_->WriteTo(writer);
+  entries_.WriteTo(writer);
+}
+
+
+MapEntry* MapEntry::ReadFrom(Reader* reader) {
+  MapEntry* entry = new MapEntry();
+  entry->key_ = Expression::ReadFrom(reader);
+  entry->value_ = Expression::ReadFrom(reader);
+  return entry;
+}
+
+
+void MapEntry::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  key_->WriteTo(writer);
+  value_->WriteTo(writer);
+}
+
+
+AwaitExpression* AwaitExpression::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  AwaitExpression* await = new AwaitExpression();
+  await->operand_ = Expression::ReadFrom(reader);
+  return await;
+}
+
+
+void AwaitExpression::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kAwaitExpression);
+  operand_->WriteTo(writer);
+}
+
+
+FunctionExpression* FunctionExpression::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  VariableScope<ReaderHelper> parameters(reader->helper());
+  FunctionExpression* expr = new FunctionExpression();
+  expr->function_ = FunctionNode::ReadFrom(reader);
+  return expr;
+}
+
+
+void FunctionExpression::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  VariableScope<WriterHelper> parameters(writer->helper());
+  writer->WriteTag(kFunctionExpression);
+  function_->WriteTo(writer);
+}
+
+
+Let* Let::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  VariableScope<ReaderHelper> vars(reader->helper());
+  Let* let = new Let();
+  let->variable_ = VariableDeclaration::ReadFromImpl(reader);
+  let->body_ = Expression::ReadFrom(reader);
+  return let;
+}
+
+
+void Let::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  VariableScope<WriterHelper> vars(writer->helper());
+  writer->WriteTag(kLet);
+  variable_->WriteToImpl(writer);
+  body_->WriteTo(writer);
+}
+
+
+BlockExpression* BlockExpression::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  BlockExpression* be = new BlockExpression();
+  be->body_ = Block::ReadFromImpl(reader);
+  be->value_ = Expression::ReadFrom(reader);
+  return be;
+}
+
+
+void BlockExpression::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kBlockExpression);
+  body_->WriteToImpl(writer);
+  value_->WriteTo(writer);
+}
+
+
+Statement* Statement::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  Tag tag = reader->ReadTag();
+  switch (tag) {
+    case kInvalidStatement:
+      return InvalidStatement::ReadFrom(reader);
+    case kExpressionStatement:
+      return ExpressionStatement::ReadFrom(reader);
+    case kBlock:
+      return Block::ReadFromImpl(reader);
+    case kEmptyStatement:
+      return EmptyStatement::ReadFrom(reader);
+    case kAssertStatement:
+      return AssertStatement::ReadFrom(reader);
+    case kLabeledStatement:
+      return LabeledStatement::ReadFrom(reader);
+    case kBreakStatement:
+      return BreakStatement::ReadFrom(reader);
+    case kWhileStatement:
+      return WhileStatement::ReadFrom(reader);
+    case kDoStatement:
+      return DoStatement::ReadFrom(reader);
+    case kForStatement:
+      return ForStatement::ReadFrom(reader);
+    case kForInStatement:
+      return ForInStatement::ReadFrom(reader, false);
+    case kAsyncForInStatement:
+      return ForInStatement::ReadFrom(reader, true);
+    case kSwitchStatement:
+      return SwitchStatement::ReadFrom(reader);
+    case kContinueSwitchStatement:
+      return ContinueSwitchStatement::ReadFrom(reader);
+    case kIfStatement:
+      return IfStatement::ReadFrom(reader);
+    case kReturnStatement:
+      return ReturnStatement::ReadFrom(reader);
+    case kTryCatch:
+      return TryCatch::ReadFrom(reader);
+    case kTryFinally:
+      return TryFinally::ReadFrom(reader);
+    case kYieldStatement:
+      return YieldStatement::ReadFrom(reader);
+    case kVariableDeclaration:
+      return VariableDeclaration::ReadFromImpl(reader);
+    case kFunctionDeclaration:
+      return FunctionDeclaration::ReadFrom(reader);
+    default:
+      UNREACHABLE();
+  }
+  return NULL;
+}
+
+
+InvalidStatement* InvalidStatement::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  return new InvalidStatement();
+}
+
+
+void InvalidStatement::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kInvalidStatement);
+}
+
+
+ExpressionStatement* ExpressionStatement::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  return new ExpressionStatement(Expression::ReadFrom(reader));
+}
+
+
+void ExpressionStatement::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kExpressionStatement);
+  expression_->WriteTo(writer);
+}
+
+
+Block* Block::ReadFromImpl(Reader* reader) {
+  TRACE_READ_OFFSET();
+  VariableScope<ReaderHelper> vars(reader->helper());
+  Block* block = new Block();
+  block->statements().ReadFromStatic<Statement>(reader);
+  return block;
+}
+
+
+void Block::WriteTo(Writer* writer) {
+  writer->WriteTag(kBlock);
+  WriteToImpl(writer);
+}
+
+
+void Block::WriteToImpl(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  VariableScope<WriterHelper> vars(writer->helper());
+  statements_.WriteTo(writer);
+}
+
+
+EmptyStatement* EmptyStatement::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  return new EmptyStatement();
+}
+
+
+void EmptyStatement::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kEmptyStatement);
+}
+
+
+AssertStatement* AssertStatement::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  AssertStatement* stmt = new AssertStatement();
+  stmt->condition_ = Expression::ReadFrom(reader);
+  stmt->message_ = reader->ReadOptional<Expression>();
+  return stmt;
+}
+
+
+void AssertStatement::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kAssertStatement);
+  condition_->WriteTo(writer);
+  writer->WriteOptional<Expression>(message_);
+}
+
+
+LabeledStatement* LabeledStatement::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  LabeledStatement* stmt = new LabeledStatement();
+  reader->helper()->labels()->Push(stmt);
+  stmt->body_ = Statement::ReadFrom(reader);
+  reader->helper()->labels()->Pop(stmt);
+  return stmt;
+}
+
+
+void LabeledStatement::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kLabeledStatement);
+  writer->helper()->labels()->Push(this);
+  body_->WriteTo(writer);
+  writer->helper()->labels()->Pop(this);
+}
+
+
+BreakStatement* BreakStatement::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  BreakStatement* stmt = new BreakStatement();
+  stmt->target_ = reader->helper()->labels()->Lookup(reader->ReadUInt());
+  return stmt;
+}
+
+
+void BreakStatement::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kBreakStatement);
+  writer->WriteUInt(writer->helper()->labels()->Lookup(target_));
+}
+
+
+WhileStatement* WhileStatement::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  WhileStatement* stmt = new WhileStatement();
+  stmt->condition_ = Expression::ReadFrom(reader);
+  stmt->body_ = Statement::ReadFrom(reader);
+  return stmt;
+}
+
+
+void WhileStatement::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kWhileStatement);
+  condition_->WriteTo(writer);
+  body_->WriteTo(writer);
+}
+
+
+DoStatement* DoStatement::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  DoStatement* dostmt = new DoStatement();
+  dostmt->body_ = Statement::ReadFrom(reader);
+  dostmt->condition_ = Expression::ReadFrom(reader);
+  return dostmt;
+}
+
+
+void DoStatement::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kDoStatement);
+  body_->WriteTo(writer);
+  condition_->WriteTo(writer);
+}
+
+
+ForStatement* ForStatement::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  VariableScope<ReaderHelper> vars(reader->helper());
+  ForStatement* forstmt = new ForStatement();
+  forstmt->variables_.ReadFromStatic<VariableDeclarationImpl>(reader);
+  forstmt->condition_ = reader->ReadOptional<Expression>();
+  forstmt->updates_.ReadFromStatic<Expression>(reader);
+  forstmt->body_ = Statement::ReadFrom(reader);
+  return forstmt;
+}
+
+
+void ForStatement::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kForStatement);
+  VariableScope<WriterHelper> vars(writer->helper());
+  variables_.WriteToStatic<VariableDeclarationImpl>(writer);
+  writer->WriteOptional<Expression>(condition_);
+  updates_.WriteTo(writer);
+  body_->WriteTo(writer);
+}
+
+
+ForInStatement* ForInStatement::ReadFrom(Reader* reader, bool is_async) {
+  TRACE_READ_OFFSET();
+  VariableScope<ReaderHelper> vars(reader->helper());
+  ForInStatement* forinstmt = new ForInStatement();
+  forinstmt->is_async_ = is_async;
+  forinstmt->variable_ = VariableDeclaration::ReadFromImpl(reader);
+  forinstmt->iterable_ = Expression::ReadFrom(reader);
+  forinstmt->body_ = Statement::ReadFrom(reader);
+  return forinstmt;
+}
+
+
+void ForInStatement::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(is_async_ ? kAsyncForInStatement : kForInStatement);
+  VariableScope<WriterHelper> vars(writer->helper());
+  variable_->WriteToImpl(writer);
+  iterable_->WriteTo(writer);
+  body_->WriteTo(writer);
+}
+
+
+SwitchStatement* SwitchStatement::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  SwitchCaseScope<ReaderHelper> scope(reader->helper());
+  SwitchStatement* stmt = new SwitchStatement();
+  stmt->condition_ = Expression::ReadFrom(reader);
+  // We need to explicitly create empty [SwitchCase]s first in order to add them
+  // to the [SwitchCaseScope]. This is necessary since a [Statement] in a switch
+  // case can refer to one defined later on.
+  int count = reader->ReadUInt();
+  for (int i = 0; i < count; i++) {
+    SwitchCase* sc = stmt->cases_.GetOrCreate<SwitchCase>(i);
+    reader->helper()->switch_cases().Push(sc);
+  }
+  for (int i = 0; i < count; i++) {
+    SwitchCase* sc = stmt->cases_[i];
+    sc->ReadFrom(reader);
+  }
+  return stmt;
+}
+
+
+void SwitchStatement::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  SwitchCaseScope<WriterHelper> scope(writer->helper());
+  writer->WriteTag(kSwitchStatement);
+  condition_->WriteTo(writer);
+  for (int i = 0; i < cases_.length(); i++) {
+    writer->helper()->switch_cases().Push(cases_[i]);
+  }
+  cases_.WriteTo(writer);
+}
+
+
+SwitchCase* SwitchCase::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  expressions_.ReadFromStatic<Expression>(reader);
+  is_default_ = reader->ReadBool();
+  body_ = Statement::ReadFrom(reader);
+  return this;
+}
+
+
+void SwitchCase::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  expressions_.WriteTo(writer);
+  writer->WriteBool(is_default_);
+  body_->WriteTo(writer);
+}
+
+
+ContinueSwitchStatement* ContinueSwitchStatement::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  ContinueSwitchStatement* stmt = new ContinueSwitchStatement();
+  stmt->target_ = reader->helper()->switch_cases().Lookup(reader->ReadUInt());
+  return stmt;
+}
+
+
+void ContinueSwitchStatement::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kContinueSwitchStatement);
+  writer->WriteUInt(writer->helper()->switch_cases().Lookup(target_));
+}
+
+
+IfStatement* IfStatement::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  IfStatement* ifstmt = new IfStatement();
+  ifstmt->condition_ = Expression::ReadFrom(reader);
+  ifstmt->then_ = Statement::ReadFrom(reader);
+  ifstmt->otherwise_ = Statement::ReadFrom(reader);
+  return ifstmt;
+}
+
+
+void IfStatement::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kIfStatement);
+  condition_->WriteTo(writer);
+  then_->WriteTo(writer);
+  otherwise_->WriteTo(writer);
+}
+
+
+ReturnStatement* ReturnStatement::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  ReturnStatement* ret = new ReturnStatement();
+  ret->expression_ = reader->ReadOptional<Expression>();
+  return ret;
+}
+
+
+void ReturnStatement::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kReturnStatement);
+  writer->WriteOptional<Expression>(expression_);
+}
+
+
+TryCatch* TryCatch::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  TryCatch* tc = new TryCatch();
+  tc->body_ = Statement::ReadFrom(reader);
+  tc->catches_.ReadFromStatic<Catch>(reader);
+  return tc;
+}
+
+
+void TryCatch::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kTryCatch);
+  body_->WriteTo(writer);
+  catches_.WriteTo(writer);
+}
+
+
+Catch* Catch::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  VariableScope<ReaderHelper> vars(reader->helper());
+  Catch* c = new Catch();
+  c->guard_ = DartType::ReadFrom(reader);
+  c->exception_ =
+      reader->ReadOptional<VariableDeclaration, VariableDeclarationImpl>();
+  c->stack_trace_ =
+      reader->ReadOptional<VariableDeclaration, VariableDeclarationImpl>();
+  c->body_ = Statement::ReadFrom(reader);
+  return c;
+}
+
+
+void Catch::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  VariableScope<WriterHelper> vars(writer->helper());
+  guard_->WriteTo(writer);
+  writer->WriteOptionalStatic<VariableDeclaration, VariableDeclarationImpl>(
+      exception_);
+  writer->WriteOptionalStatic<VariableDeclaration, VariableDeclarationImpl>(
+      stack_trace_);
+  body_->WriteTo(writer);
+}
+
+
+TryFinally* TryFinally::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  TryFinally* tf = new TryFinally();
+  tf->body_ = Statement::ReadFrom(reader);
+  tf->finalizer_ = Statement::ReadFrom(reader);
+  return tf;
+}
+
+
+void TryFinally::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kTryFinally);
+  body_->WriteTo(writer);
+  finalizer_->WriteTo(writer);
+}
+
+
+YieldStatement* YieldStatement::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  YieldStatement* stmt = new YieldStatement();
+  stmt->flags_ = reader->ReadByte();
+  stmt->expression_ = Expression::ReadFrom(reader);
+  return stmt;
+}
+
+
+void YieldStatement::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kYieldStatement);
+  writer->WriteByte(flags_);
+  expression_->WriteTo(writer);
+}
+
+
+VariableDeclaration* VariableDeclaration::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  Tag tag = reader->ReadTag();
+  ASSERT(tag == kVariableDeclaration);
+  return VariableDeclaration::ReadFromImpl(reader);
+}
+
+
+VariableDeclaration* VariableDeclaration::ReadFromImpl(Reader* reader) {
+  TRACE_READ_OFFSET();
+  VariableDeclaration* decl = new VariableDeclaration();
+  decl->flags_ = reader->ReadFlags();
+  decl->name_ = Reference::ReadStringFrom(reader);
+  decl->type_ = DartType::ReadFrom(reader);
+  decl->inferred_value_ = reader->ReadOptional<InferredValue>();
+  decl->initializer_ = reader->ReadOptional<Expression>();
+  reader->helper()->variables().Push(decl);
+  return decl;
+}
+
+
+void VariableDeclaration::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kVariableDeclaration);
+  WriteToImpl(writer);
+}
+
+
+void VariableDeclaration::WriteToImpl(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteFlags(flags_);
+  name_->WriteTo(writer);
+  type_->WriteTo(writer);
+  writer->WriteOptional<InferredValue>(inferred_value_);
+  writer->WriteOptional<Expression>(initializer_);
+  writer->helper()->variables().Push(this);
+}
+
+
+FunctionDeclaration* FunctionDeclaration::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  FunctionDeclaration* decl = new FunctionDeclaration();
+  decl->variable_ = VariableDeclaration::ReadFromImpl(reader);
+  VariableScope<ReaderHelper> parameters(reader->helper());
+  decl->function_ = FunctionNode::ReadFrom(reader);
+  return decl;
+}
+
+
+void FunctionDeclaration::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kFunctionDeclaration);
+  variable_->WriteToImpl(writer);
+  VariableScope<WriterHelper> parameters(writer->helper());
+  function_->WriteTo(writer);
+}
+
+
+Name* Name::ReadFrom(Reader* reader) {
+  String* string = Reference::ReadStringFrom(reader);
+  if (string->size() >= 1 && string->buffer()[0] == '_') {
+    int lib_index = reader->ReadUInt();
+    Library* library =
+        reader->helper()->program()->libraries().GetOrCreate<Library>(
+            lib_index);
+    return new Name(string, library);
+  } else {
+    return new Name(string, NULL);
+  }
+}
+
+
+void Name::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  string_->WriteTo(writer);
+  Library* library = library_;
+  bool is_private = library != NULL;
+  if (is_private) {
+    writer->WriteUInt(writer->helper()->libraries().Lookup(library_));
+  }
+}
+
+
+InferredValue* InferredValue::ReadFrom(Reader* reader) {
+  InferredValue* type = new InferredValue();
+  type->klass_ = Reference::ReadClassFrom(reader, true);
+  type->kind_ = static_cast<BaseClassKind>(reader->ReadByte());
+  type->value_bits_ = reader->ReadByte();
+  return type;
+}
+
+
+void InferredValue::WriteTo(Writer* writer) {
+  Reference::WriteClassTo(writer, klass_, true);
+  writer->WriteByte(static_cast<uint8_t>(kind_));
+  writer->WriteByte(value_bits_);
+}
+
+
+DartType* DartType::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  Tag tag = reader->ReadTag();
+  switch (tag) {
+    case kInvalidType:
+      return InvalidType::ReadFrom(reader);
+    case kDynamicType:
+      return DynamicType::ReadFrom(reader);
+    case kVoidType:
+      return VoidType::ReadFrom(reader);
+    case kInterfaceType:
+      return InterfaceType::ReadFrom(reader);
+    case kSimpleInterfaceType:
+      return InterfaceType::ReadFrom(reader, true);
+    case kFunctionType:
+      return FunctionType::ReadFrom(reader);
+    case kSimpleFunctionType:
+      return FunctionType::ReadFrom(reader, true);
+    case kTypeParameterType:
+      return TypeParameterType::ReadFrom(reader);
+    default:
+      UNREACHABLE();
+  }
+  UNREACHABLE();
+  return NULL;
+}
+
+
+InvalidType* InvalidType::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  return new InvalidType();
+}
+
+
+void InvalidType::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kInvalidType);
+}
+
+
+DynamicType* DynamicType::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  return new DynamicType();
+}
+
+
+void DynamicType::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kDynamicType);
+}
+
+
+VoidType* VoidType::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  return new VoidType();
+}
+
+
+void VoidType::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kVoidType);
+}
+
+
+InterfaceType* InterfaceType::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  Class* klass = Reference::ReadClassFrom(reader);
+  InterfaceType* type = new InterfaceType(klass);
+  type->type_arguments().ReadFromStatic<DartType>(reader);
+  return type;
+}
+
+
+InterfaceType* InterfaceType::ReadFrom(Reader* reader,
+                                       bool _without_type_arguments_) {
+  TRACE_READ_OFFSET();
+  Class* klass = Reference::ReadClassFrom(reader);
+  InterfaceType* type = new InterfaceType(klass);
+  ASSERT(_without_type_arguments_);
+  return type;
+}
+
+
+void InterfaceType::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  if (type_arguments_.length() == 0) {
+    writer->WriteTag(kSimpleInterfaceType);
+    Reference::WriteClassTo(writer, klass_);
+  } else {
+    writer->WriteTag(kInterfaceType);
+    Reference::WriteClassTo(writer, klass_);
+    type_arguments_.WriteTo(writer);
+  }
+}
+
+
+FunctionType* FunctionType::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  FunctionType* type = new FunctionType();
+  TypeParameterScope<ReaderHelper> scope(reader->helper());
+  type->type_parameters().ReadFrom(reader);
+  type->required_parameter_count_ = reader->ReadUInt();
+  type->positional_parameters().ReadFromStatic<DartType>(reader);
+  type->named_parameters().ReadFromStatic<Tuple<String, DartType> >(reader);
+  type->return_type_ = DartType::ReadFrom(reader);
+  return type;
+}
+
+
+FunctionType* FunctionType::ReadFrom(Reader* reader, bool _is_simple_) {
+  TRACE_READ_OFFSET();
+  FunctionType* type = new FunctionType();
+  ASSERT(_is_simple_);
+  type->positional_parameters().ReadFromStatic<DartType>(reader);
+  type->required_parameter_count_ = type->positional_parameters().length();
+  type->return_type_ = DartType::ReadFrom(reader);
+  return type;
+}
+
+
+void FunctionType::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+
+  bool is_simple =
+      positional_parameters_.length() == required_parameter_count_ &&
+      type_parameters_.length() == 0 && named_parameters_.length() == 0;
+  if (is_simple) {
+    writer->WriteTag(kSimpleFunctionType);
+    positional_parameters_.WriteTo(writer);
+    return_type_->WriteTo(writer);
+  } else {
+    TypeParameterScope<WriterHelper> scope(writer->helper());
+    writer->WriteTag(kFunctionType);
+    type_parameters_.WriteTo(writer);
+    writer->WriteUInt(required_parameter_count_);
+    positional_parameters_.WriteTo(writer);
+    named_parameters_.WriteTo(writer);
+    return_type_->WriteTo(writer);
+  }
+}
+
+
+TypeParameterType* TypeParameterType::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  TypeParameterType* type = new TypeParameterType();
+  type->parameter_ =
+      reader->helper()->type_parameters().Lookup(reader->ReadUInt());
+  return type;
+}
+
+
+void TypeParameterType::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  writer->WriteTag(kTypeParameterType);
+  writer->WriteUInt(writer->helper()->type_parameters().Lookup(parameter_));
+}
+
+
+Program* Program::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  uint32_t magic = reader->ReadUInt32();
+  if (magic != kMagicProgramFile) FATAL("Invalid magic identifier");
+
+  Program* program = new Program();
+  reader->helper()->set_program(program);
+
+  program->string_table_.ReadFrom(reader);
+  program->source_uri_table_.ReadFrom(reader);
+  program->line_starting_table_.ReadFrom(reader);
+
+  int libraries = reader->ReadUInt();
+  program->libraries().EnsureInitialized(libraries);
+  for (int i = 0; i < libraries; i++) {
+    program->libraries().GetOrCreate<Library>(i)->ReadFrom(reader);
+  }
+
+  program->main_method_ = Procedure::Cast(Reference::ReadMemberFrom(reader));
+
+  return program;
+}
+
+
+void Program::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+
+  writer->helper()->SetProgram(this);
+
+  writer->WriteUInt32(kMagicProgramFile);
+
+  // NOTE: Currently we don't GC strings and we require that all referenced
+  // strings in nodes are present in [string_table_].
+  string_table_.WriteTo(writer);
+  source_uri_table_.WriteTo(writer);
+  line_starting_table_.WriteTo(writer);
+
+  libraries_.WriteTo(writer);
+  Reference::WriteMemberTo(writer, main_method_);
+}
+
+
+FunctionNode* FunctionNode::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  TypeParameterScope<ReaderHelper> scope(reader->helper());
+
+  FunctionNode* function = new FunctionNode();
+  function->async_marker_ =
+      static_cast<FunctionNode::AsyncMarker>(reader->ReadByte());
+  function->type_parameters().ReadFrom(reader);
+  function->required_parameter_count_ = reader->ReadUInt();
+  function->positional_parameters().ReadFromStatic<VariableDeclarationImpl>(
+      reader);
+  function->named_parameters().ReadFromStatic<VariableDeclarationImpl>(reader);
+  function->return_type_ = DartType::ReadFrom(reader);
+  function->inferred_return_value_ = reader->ReadOptional<InferredValue>();
+
+  LabelScope<ReaderHelper, BlockStack<LabeledStatement> > labels(
+      reader->helper());
+  VariableScope<ReaderHelper> vars(reader->helper());
+  function->body_ = reader->ReadOptional<Statement>();
+  return function;
+}
+
+
+void FunctionNode::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  TypeParameterScope<WriterHelper> scope(writer->helper());
+
+  writer->WriteByte(static_cast<uint8_t>(async_marker_));
+  type_parameters().WriteTo(writer);
+  writer->WriteUInt(required_parameter_count());
+  positional_parameters().WriteToStatic<VariableDeclarationImpl>(writer);
+  named_parameters().WriteToStatic<VariableDeclarationImpl>(writer);
+  return_type_->WriteTo(writer);
+  writer->WriteOptional<InferredValue>(inferred_return_value_);
+
+  LabelScope<WriterHelper, BlockMap<LabeledStatement> > labels(
+      writer->helper());
+  VariableScope<WriterHelper> vars(writer->helper());
+  writer->WriteOptional<Statement>(body_);
+}
+
+
+TypeParameter* TypeParameter::ReadFrom(Reader* reader) {
+  TRACE_READ_OFFSET();
+  name_ = Reference::ReadStringFrom(reader);
+  bound_ = DartType::ReadFrom(reader);
+  return this;
+}
+
+
+void TypeParameter::WriteTo(Writer* writer) {
+  TRACE_WRITE_OFFSET();
+  name_->WriteTo(writer);
+  bound_->WriteTo(writer);
+}
+
+
+}  // namespace kernel
+
+
+kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer,
+                                                 intptr_t buffer_length) {
+  kernel::Reader reader(buffer, buffer_length);
+  return kernel::Program::ReadFrom(&reader);
+}
+
+
+void WritePrecompiledKernel(ByteWriter* byte_writer, kernel::Program* program) {
+  ASSERT(byte_writer != NULL);
+
+  kernel::Writer writer(byte_writer);
+  program->WriteTo(&writer);
+}
+
+
+}  // namespace dart
+#endif  // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/kernel_reader.cc b/runtime/vm/kernel_reader.cc
new file mode 100644
index 0000000..e3b633f
--- /dev/null
+++ b/runtime/vm/kernel_reader.cc
@@ -0,0 +1,717 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#include "vm/kernel_reader.h"
+
+#include <string.h>
+
+#include "vm/dart_api_impl.h"
+#include "vm/longjump.h"
+#include "vm/object_store.h"
+#include "vm/parser.h"
+#include "vm/symbols.h"
+
+#if !defined(DART_PRECOMPILED_RUNTIME)
+namespace dart {
+namespace kernel {
+
+#define Z (zone_)
+#define I (isolate_)
+#define T (type_translator_)
+#define H (translation_helper_)
+
+class SimpleExpressionConverter : public ExpressionVisitor {
+ public:
+  SimpleExpressionConverter(Thread* thread, Zone* zone)
+      : translation_helper_(thread, zone, NULL),
+        zone_(zone),
+        is_simple_(false),
+        simple_value_(NULL) {}
+
+  virtual void VisitDefaultExpression(Expression* node) { is_simple_ = false; }
+
+  virtual void VisitIntLiteral(IntLiteral* node) {
+    is_simple_ = true;
+    simple_value_ =
+        &Integer::ZoneHandle(Z, Integer::New(node->value(), Heap::kOld));
+    *simple_value_ = H.Canonicalize(*simple_value_);
+  }
+
+  virtual void VisitBigintLiteral(BigintLiteral* node) {
+    is_simple_ = true;
+    simple_value_ = &Integer::ZoneHandle(
+        Z, Integer::New(H.DartString(node->value(), Heap::kOld)));
+    *simple_value_ = H.Canonicalize(*simple_value_);
+  }
+
+  virtual void VisitDoubleLiteral(DoubleLiteral* node) {
+    is_simple_ = true;
+    simple_value_ = &Double::ZoneHandle(
+        Z, Double::New(H.DartString(node->value()), Heap::kOld));
+    *simple_value_ = H.Canonicalize(*simple_value_);
+  }
+
+  virtual void VisitBoolLiteral(BoolLiteral* node) {
+    is_simple_ = true;
+    simple_value_ = &Bool::Handle(Z, Bool::Get(node->value()).raw());
+  }
+
+  virtual void VisitNullLiteral(NullLiteral* node) {
+    is_simple_ = true;
+    simple_value_ = &dart::Instance::ZoneHandle(Z, dart::Instance::null());
+  }
+
+  virtual void VisitStringLiteral(StringLiteral* node) {
+    is_simple_ = true;
+    simple_value_ = &H.DartSymbol(node->value());
+  }
+
+  bool IsSimple(Expression* expression) {
+    expression->AcceptExpressionVisitor(this);
+    return is_simple_;
+  }
+
+  const dart::Instance& SimpleValue() { return *simple_value_; }
+  dart::Zone* zone() const { return zone_; }
+
+ private:
+  TranslationHelper translation_helper_;
+  dart::Zone* zone_;
+  bool is_simple_;
+  dart::Instance* simple_value_;
+};
+
+
+RawLibrary* BuildingTranslationHelper::LookupLibraryByKernelLibrary(
+    Library* library) {
+  return reader_->LookupLibrary(library).raw();
+}
+
+
+RawClass* BuildingTranslationHelper::LookupClassByKernelClass(Class* klass) {
+  return reader_->LookupClass(klass).raw();
+}
+
+KernelReader::KernelReader(Program* program)
+    : program_(program),
+      thread_(dart::Thread::Current()),
+      zone_(thread_->zone()),
+      isolate_(thread_->isolate()),
+      scripts_(Array::ZoneHandle(zone_)),
+      translation_helper_(this, thread_, zone_, isolate_),
+      type_translator_(&translation_helper_,
+                       &active_class_,
+                       /*finalize=*/false) {
+  intptr_t source_file_count = program_->line_starting_table().size();
+  scripts_ = Array::New(source_file_count);
+}
+
+Object& KernelReader::ReadProgram() {
+  LongJumpScope jump;
+  if (setjmp(*jump.Set()) == 0) {
+    Procedure* main = program_->main_method();
+    Library* kernel_main_library = Library::Cast(main->parent());
+
+    intptr_t length = program_->libraries().length();
+    for (intptr_t i = 0; i < length; i++) {
+      Library* kernel_library = program_->libraries()[i];
+      ReadLibrary(kernel_library);
+    }
+
+    for (intptr_t i = 0; i < length; i++) {
+      dart::Library& library = LookupLibrary(program_->libraries()[i]);
+      if (!library.Loaded()) library.SetLoaded();
+    }
+
+    if (ClassFinalizer::ProcessPendingClasses(/*from_kernel=*/true)) {
+      dart::Library& library = LookupLibrary(kernel_main_library);
+
+      // Sanity check that we can find the main entrypoint.
+      Object& main_obj = Object::Handle(
+          Z, library.LookupObjectAllowPrivate(H.DartSymbol("main")));
+      ASSERT(!main_obj.IsNull());
+      return library;
+    }
+  }
+
+  // Either class finalization failed or we caught a compile error.
+  // In both cases sticky error would be set.
+  Error& error = Error::Handle(Z);
+  error = thread_->sticky_error();
+  thread_->clear_sticky_error();
+  return error;
+}
+
+
+void KernelReader::ReadLibrary(Library* kernel_library) {
+  dart::Library& library = LookupLibrary(kernel_library);
+  if (library.Loaded()) return;
+
+  // The bootstrapper will take care of creating the native wrapper classes, but
+  // we will add the synthetic constructors to them here.
+  if (library.name() ==
+      Symbols::Symbol(Symbols::kDartNativeWrappersLibNameId).raw()) {
+    ASSERT(library.LoadInProgress());
+  } else {
+    library.SetLoadInProgress();
+  }
+  // Setup toplevel class (which contains library fields/procedures).
+
+  Script& script = ScriptAt(kernel_library->source_uri_index());
+  dart::Class& toplevel_class = dart::Class::Handle(
+      Z, dart::Class::New(library, Symbols::TopLevel(), script,
+                          TokenPosition::kNoSource));
+  toplevel_class.set_is_cycle_free();
+  library.set_toplevel_class(toplevel_class);
+
+  ActiveClassScope active_class_scope(&active_class_, NULL, &toplevel_class);
+  // Load toplevel fields.
+  for (intptr_t i = 0; i < kernel_library->fields().length(); i++) {
+    Field* kernel_field = kernel_library->fields()[i];
+
+    ActiveMemberScope active_member_scope(&active_class_, kernel_field);
+    const dart::String& name = H.DartFieldName(kernel_field->name());
+    const Object& script_class =
+        ClassForScriptAt(toplevel_class, kernel_field->source_uri_index());
+    dart::Field& field = dart::Field::Handle(
+        Z, dart::Field::NewTopLevel(name, kernel_field->IsFinal(),
+                                    kernel_field->IsConst(), script_class,
+                                    kernel_field->position()));
+    field.set_kernel_field(kernel_field);
+    const AbstractType& type = T.TranslateType(kernel_field->type());
+    field.SetFieldType(type);
+    field.set_has_initializer(kernel_field->initializer() != NULL);
+    GenerateFieldAccessors(toplevel_class, field, kernel_field);
+    toplevel_class.AddField(field);
+    library.AddObject(field, name);
+  }
+
+  // Load toplevel procedures.
+  for (intptr_t i = 0; i < kernel_library->procedures().length(); i++) {
+    Procedure* kernel_procedure = kernel_library->procedures()[i];
+    ReadProcedure(library, toplevel_class, kernel_procedure);
+  }
+
+  const GrowableObjectArray& classes =
+      GrowableObjectArray::Handle(I->object_store()->pending_classes());
+
+  // Load all classes.
+  for (intptr_t i = 0; i < kernel_library->classes().length(); i++) {
+    Class* kernel_klass = kernel_library->classes()[i];
+    classes.Add(ReadClass(library, kernel_klass), Heap::kOld);
+  }
+
+  classes.Add(toplevel_class, Heap::kOld);
+}
+
+
+void KernelReader::ReadPreliminaryClass(dart::Class* klass,
+                                        Class* kernel_klass) {
+  ASSERT(kernel_klass->IsNormalClass());
+  NormalClass* kernel_normal_class = NormalClass::Cast(kernel_klass);
+
+  ActiveClassScope active_class_scope(&active_class_, kernel_klass, klass);
+
+  // First setup the type parameters, so if any of the following code uses it
+  // (in a recursive way) we're fine.
+  TypeArguments& type_parameters =
+      TypeArguments::Handle(Z, TypeArguments::null());
+  intptr_t num_type_parameters = kernel_klass->type_parameters().length();
+  if (num_type_parameters > 0) {
+    dart::TypeParameter& parameter = dart::TypeParameter::Handle(Z);
+    Type& null_bound = Type::Handle(Z, Type::null());
+
+    // Step a) Create array of [TypeParameter] objects (without bound).
+    type_parameters = TypeArguments::New(num_type_parameters);
+    for (intptr_t i = 0; i < num_type_parameters; i++) {
+      parameter = dart::TypeParameter::New(
+          *klass, Function::Handle(Z), i,
+          H.DartSymbol(kernel_klass->type_parameters()[i]->name()), null_bound,
+          TokenPosition::kNoSource);
+      type_parameters.SetTypeAt(i, parameter);
+    }
+    klass->set_type_parameters(type_parameters);
+
+    // Step b) Fill in the bounds of all [TypeParameter]s.
+    for (intptr_t i = 0; i < num_type_parameters; i++) {
+      TypeParameter* kernel_parameter = kernel_klass->type_parameters()[i];
+      // TODO(github.com/dart-lang/kernel/issues/42): This should be handled
+      // by the frontend.
+      if (kernel_parameter->bound()->IsDynamicType()) {
+        parameter ^= type_parameters.TypeAt(i);
+        parameter.set_bound(Type::Handle(Z, I->object_store()->object_type()));
+      } else {
+        AbstractType& bound =
+            T.TranslateTypeWithoutFinalization(kernel_parameter->bound());
+        if (bound.IsMalformedOrMalbounded()) {
+          bound = I->object_store()->object_type();
+        }
+
+        parameter ^= type_parameters.TypeAt(i);
+        parameter.set_bound(bound);
+      }
+    }
+  }
+
+  // Set super type.  Some classes (e.g., Object) do not have one.
+  if (kernel_normal_class->super_class() != NULL) {
+    AbstractType& super_type =
+        T.TranslateTypeWithoutFinalization(kernel_normal_class->super_class());
+    if (super_type.IsMalformed()) H.ReportError("Malformed super type");
+    klass->set_super_type(super_type);
+  }
+
+  // Build implemented interface types
+  intptr_t interface_count = kernel_klass->implemented_classes().length();
+  const dart::Array& interfaces =
+      dart::Array::Handle(Z, dart::Array::New(interface_count));
+  for (intptr_t i = 0; i < interface_count; i++) {
+    InterfaceType* kernel_interface_type =
+        kernel_klass->implemented_classes()[i];
+    const AbstractType& type =
+        T.TranslateTypeWithoutFinalization(kernel_interface_type);
+    if (type.IsMalformed()) H.ReportError("Malformed interface type.");
+    interfaces.SetAt(i, type);
+  }
+  klass->set_interfaces(interfaces);
+  if (kernel_klass->is_abstract()) klass->set_is_abstract();
+}
+
+
+dart::Class& KernelReader::ReadClass(const dart::Library& library,
+                                     Class* kernel_klass) {
+  // This will trigger a call to [ReadPreliminaryClass] if not already done.
+  dart::Class& klass = LookupClass(kernel_klass);
+
+  ActiveClassScope active_class_scope(&active_class_, kernel_klass, &klass);
+
+  for (intptr_t i = 0; i < kernel_klass->fields().length(); i++) {
+    Field* kernel_field = kernel_klass->fields()[i];
+    ActiveMemberScope active_member_scope(&active_class_, kernel_field);
+
+    const dart::String& name = H.DartFieldName(kernel_field->name());
+    const AbstractType& type =
+        T.TranslateTypeWithoutFinalization(kernel_field->type());
+    dart::Field& field = dart::Field::Handle(
+        Z, dart::Field::New(name, kernel_field->IsStatic(),
+                            // In the VM all const fields are implicitly final
+                            // whereas in Kernel they are not final because they
+                            // are not explicitly declared that way.
+                            kernel_field->IsFinal() || kernel_field->IsConst(),
+                            kernel_field->IsConst(),
+                            false,  // is_reflectable
+                            klass, type, kernel_field->position()));
+    field.set_kernel_field(kernel_field);
+    field.set_has_initializer(kernel_field->initializer() != NULL);
+    GenerateFieldAccessors(klass, field, kernel_field);
+    klass.AddField(field);
+  }
+
+  for (intptr_t i = 0; i < kernel_klass->constructors().length(); i++) {
+    Constructor* kernel_constructor = kernel_klass->constructors()[i];
+    ActiveMemberScope active_member_scope(&active_class_, kernel_constructor);
+    ActiveFunctionScope active_function_scope(&active_class_,
+                                              kernel_constructor->function());
+
+    const dart::String& name = H.DartConstructorName(kernel_constructor);
+    Function& function = dart::Function::ZoneHandle(
+        Z, dart::Function::New(name, RawFunction::kConstructor,
+                               false,  // is_static
+                               kernel_constructor->IsConst(),
+                               false,  // is_abstract
+                               kernel_constructor->IsExternal(),
+                               false,  // is_native
+                               klass, TokenPosition::kNoSource));
+    klass.AddFunction(function);
+    function.set_kernel_function(kernel_constructor);
+    function.set_result_type(T.ReceiverType(klass));
+    SetupFunctionParameters(H, T, klass, function,
+                            kernel_constructor->function(),
+                            true,    // is_method
+                            false);  // is_closure
+  }
+
+  for (intptr_t i = 0; i < kernel_klass->procedures().length(); i++) {
+    Procedure* kernel_procedure = kernel_klass->procedures()[i];
+    ActiveMemberScope active_member_scope(&active_class_, kernel_procedure);
+    ReadProcedure(library, klass, kernel_procedure, kernel_klass);
+  }
+
+  if (!klass.is_marked_for_parsing()) {
+    klass.set_is_marked_for_parsing();
+  }
+
+  return klass;
+}
+
+
+void KernelReader::ReadProcedure(const dart::Library& library,
+                                 const dart::Class& owner,
+                                 Procedure* kernel_procedure,
+                                 Class* kernel_klass) {
+  ActiveClassScope active_class_scope(&active_class_, kernel_klass, &owner);
+  ActiveMemberScope active_member_scope(&active_class_, kernel_procedure);
+  ActiveFunctionScope active_function_scope(&active_class_,
+                                            kernel_procedure->function());
+
+  const dart::String& name = H.DartProcedureName(kernel_procedure);
+  bool is_method = kernel_klass != NULL && !kernel_procedure->IsStatic();
+  bool is_abstract = kernel_procedure->IsAbstract();
+  bool is_external = kernel_procedure->IsExternal();
+  dart::String* native_name = NULL;
+  if (is_external) {
+    // Maybe it has a native implementation, which is not external as far as
+    // the VM is concerned because it does have an implementation.  Check for
+    // an ExternalName annotation and extract the string from it.
+    for (int i = 0; i < kernel_procedure->annotations().length(); ++i) {
+      Expression* annotation = kernel_procedure->annotations()[i];
+      if (!annotation->IsConstructorInvocation()) continue;
+      ConstructorInvocation* invocation =
+          ConstructorInvocation::Cast(annotation);
+      Class* annotation_class = Class::Cast(invocation->target()->parent());
+      String* class_name = annotation_class->name();
+      // Just compare by name, do not generate the annotation class.
+      int length = sizeof("ExternalName") - 1;
+      if (class_name->size() != length) continue;
+      if (memcmp(class_name->buffer(), "ExternalName", length) != 0) continue;
+      String* library_name = annotation_class->parent()->name();
+      length = sizeof("dart._internal") - 1;
+      if (library_name->size() != length) continue;
+      if (memcmp(library_name->buffer(), "dart._internal", length) != 0) {
+        continue;
+      }
+
+      is_external = false;
+      ASSERT(invocation->arguments()->positional().length() == 1 &&
+             invocation->arguments()->named().length() == 0);
+      StringLiteral* literal =
+          StringLiteral::Cast(invocation->arguments()->positional()[0]);
+      native_name = &H.DartSymbol(literal->value());
+      break;
+    }
+  }
+  const Object& script_class =
+      ClassForScriptAt(owner, kernel_procedure->source_uri_index());
+  dart::Function& function = dart::Function::ZoneHandle(
+      Z, Function::New(name, GetFunctionType(kernel_procedure),
+                       !is_method,  // is_static
+                       false,       // is_const
+                       is_abstract, is_external,
+                       native_name != NULL,  // is_native
+                       script_class, TokenPosition::kNoSource));
+  owner.AddFunction(function);
+  function.set_kernel_function(kernel_procedure);
+  function.set_is_debuggable(false);
+  if (native_name != NULL) {
+    function.set_native_name(*native_name);
+  }
+
+  SetupFunctionParameters(H, T, owner, function, kernel_procedure->function(),
+                          is_method,
+                          false);  // is_closure
+
+  if (kernel_klass == NULL) {
+    library.AddObject(function, name);
+    ASSERT(!Object::Handle(Z, library.LookupObjectAllowPrivate(
+                                  H.DartProcedureName(kernel_procedure)))
+                .IsNull());
+  }
+}
+
+const Object& KernelReader::ClassForScriptAt(const dart::Class& klass,
+                                             intptr_t source_uri_index) {
+  Script& correct_script = ScriptAt(source_uri_index);
+  if (klass.script() != correct_script.raw()) {
+    // TODO(jensj): We could probably cache this so we don't create
+    // new PatchClasses all the time
+    return PatchClass::ZoneHandle(Z, PatchClass::New(klass, correct_script));
+  }
+  return klass;
+}
+
+Script& KernelReader::ScriptAt(intptr_t source_uri_index) {
+  Script& script = Script::ZoneHandle(Z);
+  script ^= scripts_.At(source_uri_index);
+  if (script.IsNull()) {
+    String* uri = program_->source_uri_table().strings()[source_uri_index];
+    script = Script::New(H.DartString(uri), dart::String::ZoneHandle(Z),
+                         RawScript::kKernelTag);
+    scripts_.SetAt(source_uri_index, script);
+    intptr_t* line_starts =
+        program_->line_starting_table().valuesFor(source_uri_index);
+    intptr_t line_count = line_starts[0];
+    Array& array_object = Array::Handle(Z, Array::New(line_count));
+    Smi& value = Smi::Handle(Z);
+    for (intptr_t i = 0; i < line_count; ++i) {
+      value = Smi::New(line_starts[i + 1]);
+      array_object.SetAt(i, value);
+    }
+    script.set_line_starts(array_object);
+  }
+  return script;
+}
+
+void KernelReader::GenerateFieldAccessors(const dart::Class& klass,
+                                          const dart::Field& field,
+                                          Field* kernel_field) {
+  if (kernel_field->IsStatic() && kernel_field->initializer() != NULL) {
+    // Static fields with initializers either have the static value set to the
+    // initializer value if it is simple enough or else set to an uninitialized
+    // sentinel.
+    SimpleExpressionConverter converter(H.thread(), Z);
+    if (converter.IsSimple(kernel_field->initializer())) {
+      // We do not need a getter.
+      field.SetStaticValue(converter.SimpleValue(), true);
+      return;
+    }
+    // We do need a getter that evaluates the initializer if necessary.
+    field.SetStaticValue(Object::sentinel(), true);
+  }
+
+  const dart::String& getter_name = H.DartGetterName(kernel_field->name());
+  const Object& script_class =
+      ClassForScriptAt(klass, kernel_field->source_uri_index());
+  Function& getter = Function::ZoneHandle(
+      Z,
+      Function::New(
+          getter_name,
+          kernel_field->IsStatic() ? RawFunction::kImplicitStaticFinalGetter
+                                   : RawFunction::kImplicitGetter,
+          kernel_field->IsStatic(),
+          // The functions created by the parser have is_const for static fields
+          // that are const (not just final) and they have is_const for
+          // non-static
+          // fields that are final.
+          kernel_field->IsStatic() ? kernel_field->IsConst()
+                                   : kernel_field->IsFinal(),
+          false,  // is_abstract
+          false,  // is_external
+          false,  // is_native
+          script_class, kernel_field->position()));
+  klass.AddFunction(getter);
+  getter.set_kernel_function(kernel_field);
+  getter.set_result_type(AbstractType::Handle(Z, field.type()));
+  getter.set_is_debuggable(false);
+  SetupFieldAccessorFunction(klass, getter);
+
+  if (!kernel_field->IsStatic() && !kernel_field->IsFinal()) {
+    // Only static fields can be const.
+    ASSERT(!kernel_field->IsConst());
+    const dart::String& setter_name = H.DartSetterName(kernel_field->name());
+    Function& setter = Function::ZoneHandle(
+        Z, Function::New(setter_name, RawFunction::kImplicitSetter,
+                         false,  // is_static
+                         false,  // is_const
+                         false,  // is_abstract
+                         false,  // is_external
+                         false,  // is_native
+                         script_class, kernel_field->position()));
+    klass.AddFunction(setter);
+    setter.set_kernel_function(kernel_field);
+    setter.set_result_type(Object::void_type());
+    setter.set_is_debuggable(false);
+    SetupFieldAccessorFunction(klass, setter);
+  }
+}
+
+
+void KernelReader::SetupFunctionParameters(TranslationHelper translation_helper,
+                                           DartTypeTranslator type_translator,
+                                           const dart::Class& klass,
+                                           const dart::Function& function,
+                                           FunctionNode* node,
+                                           bool is_method,
+                                           bool is_closure) {
+  dart::Zone* zone = translation_helper.zone();
+
+  ASSERT(!(is_method && is_closure));
+  bool is_factory = function.IsFactory();
+  intptr_t extra_parameters = (is_method || is_closure || is_factory) ? 1 : 0;
+
+  function.set_num_fixed_parameters(extra_parameters +
+                                    node->required_parameter_count());
+  if (node->named_parameters().length() > 0) {
+    function.SetNumOptionalParameters(node->named_parameters().length(), false);
+  } else {
+    function.SetNumOptionalParameters(node->positional_parameters().length() -
+                                          node->required_parameter_count(),
+                                      true);
+  }
+  intptr_t num_parameters = extra_parameters +
+                            node->positional_parameters().length() +
+                            node->named_parameters().length();
+  function.set_parameter_types(
+      Array::Handle(zone, Array::New(num_parameters, Heap::kOld)));
+  function.set_parameter_names(
+      Array::Handle(zone, Array::New(num_parameters, Heap::kOld)));
+  intptr_t pos = 0;
+  if (is_method) {
+    ASSERT(!klass.IsNull());
+    function.SetParameterTypeAt(pos,
+                                translation_helper.GetCanonicalType(klass));
+    function.SetParameterNameAt(pos, Symbols::This());
+    pos++;
+  } else if (is_closure) {
+    function.SetParameterTypeAt(pos, AbstractType::dynamic_type());
+    function.SetParameterNameAt(pos, Symbols::ClosureParameter());
+    pos++;
+  } else if (is_factory) {
+    function.SetParameterTypeAt(pos, AbstractType::dynamic_type());
+    function.SetParameterNameAt(pos, Symbols::TypeArgumentsParameter());
+    pos++;
+  }
+  for (intptr_t i = 0; i < node->positional_parameters().length(); i++, pos++) {
+    VariableDeclaration* kernel_variable = node->positional_parameters()[i];
+    const AbstractType& type = type_translator.TranslateTypeWithoutFinalization(
+        kernel_variable->type());
+    function.SetParameterTypeAt(
+        pos, type.IsMalformed() ? Type::dynamic_type() : type);
+    function.SetParameterNameAt(
+        pos, translation_helper.DartSymbol(kernel_variable->name()));
+  }
+  for (intptr_t i = 0; i < node->named_parameters().length(); i++, pos++) {
+    VariableDeclaration* named_expression = node->named_parameters()[i];
+    const AbstractType& type = type_translator.TranslateTypeWithoutFinalization(
+        named_expression->type());
+    function.SetParameterTypeAt(
+        pos, type.IsMalformed() ? Type::dynamic_type() : type);
+    function.SetParameterNameAt(
+        pos, translation_helper.DartSymbol(named_expression->name()));
+  }
+
+  // The result type for generative constructors has already been set.
+  if (!function.IsGenerativeConstructor()) {
+    const AbstractType& return_type =
+        type_translator.TranslateTypeWithoutFinalization(node->return_type());
+    function.set_result_type(return_type.IsMalformed() ? Type::dynamic_type()
+                                                       : return_type);
+  }
+}
+
+
+void KernelReader::SetupFieldAccessorFunction(const dart::Class& klass,
+                                              const dart::Function& function) {
+  bool is_setter = function.IsImplicitSetterFunction();
+  bool is_method = !function.IsStaticFunction();
+  intptr_t num_parameters = (is_method ? 1 : 0) + (is_setter ? 1 : 0);
+
+  function.SetNumOptionalParameters(0, false);
+  function.set_num_fixed_parameters(num_parameters);
+  function.set_parameter_types(
+      Array::Handle(Z, Array::New(num_parameters, Heap::kOld)));
+  function.set_parameter_names(
+      Array::Handle(Z, Array::New(num_parameters, Heap::kOld)));
+
+  intptr_t pos = 0;
+  if (is_method) {
+    function.SetParameterTypeAt(pos, T.ReceiverType(klass));
+    function.SetParameterNameAt(pos, Symbols::This());
+    pos++;
+  }
+  if (is_setter) {
+    function.SetParameterTypeAt(pos, AbstractType::dynamic_type());
+    function.SetParameterNameAt(pos, Symbols::Value());
+    pos++;
+  }
+}
+
+dart::Library& KernelReader::LookupLibrary(Library* library) {
+  dart::Library* handle = NULL;
+  if (!libraries_.Lookup(library, &handle)) {
+    const dart::String& url = H.DartSymbol(library->import_uri());
+    handle =
+        &dart::Library::Handle(Z, dart::Library::LookupLibrary(thread_, url));
+    if (handle->IsNull()) {
+      *handle = dart::Library::New(url);
+      handle->Register(thread_);
+    }
+    ASSERT(!handle->IsNull());
+    libraries_.Insert(library, handle);
+  }
+  return *handle;
+}
+
+dart::Class& KernelReader::LookupClass(Class* klass) {
+  dart::Class* handle = NULL;
+  if (!classes_.Lookup(klass, &handle)) {
+    dart::Library& library = LookupLibrary(klass->parent());
+    const dart::String& name = H.DartClassName(klass);
+    handle = &dart::Class::Handle(Z, library.LookupClass(name));
+    if (handle->IsNull()) {
+      // The class needs to have a script because all the functions in the class
+      // will inherit it.  The predicate Function::IsOptimizable uses the
+      // absence of a script to detect test functions that should not be
+      // optimized.
+      Script& script = ScriptAt(klass->source_uri_index());
+      handle = &dart::Class::Handle(
+          Z, dart::Class::New(library, name, script, TokenPosition::kNoSource));
+      library.AddClass(*handle);
+    } else if (handle->script() == Script::null()) {
+      // When bootstrapping we can encounter classes that do not yet have a
+      // dummy script.
+      Script& script = ScriptAt(klass->source_uri_index());
+      handle->set_script(script);
+    }
+    // Insert the class in the cache before calling ReadPreliminaryClass so
+    // we do not risk allocating the class again by calling LookupClass
+    // recursively from ReadPreliminaryClass for the same class.
+    classes_.Insert(klass, handle);
+    if (!handle->is_cycle_free()) {
+      ReadPreliminaryClass(handle, klass);
+    }
+  }
+  return *handle;
+}
+
+
+RawFunction::Kind KernelReader::GetFunctionType(Procedure* kernel_procedure) {
+  intptr_t lookuptable[] = {
+      RawFunction::kRegularFunction,  // Procedure::kMethod
+      RawFunction::kGetterFunction,   // Procedure::kGetter
+      RawFunction::kSetterFunction,   // Procedure::kSetter
+      RawFunction::kRegularFunction,  // Procedure::kOperator
+      RawFunction::kConstructor,      // Procedure::kFactory
+  };
+  intptr_t kind = static_cast<int>(kernel_procedure->kind());
+  if (kind == Procedure::kIncompleteProcedure) {
+    return RawFunction::kSignatureFunction;
+  } else {
+    ASSERT(0 <= kind && kind <= Procedure::kFactory);
+    return static_cast<RawFunction::Kind>(lookuptable[kind]);
+  }
+}
+
+
+ParsedFunction* ParseStaticFieldInitializer(Zone* zone,
+                                            const dart::Field& field) {
+  Thread* thread = Thread::Current();
+  kernel::Field* kernel_field = kernel::Field::Cast(
+      reinterpret_cast<kernel::Node*>(field.kernel_field()));
+
+  dart::String& init_name = dart::String::Handle(zone, field.name());
+  init_name = Symbols::FromConcat(thread, Symbols::InitPrefix(), init_name);
+
+  // Create a static initializer.
+  const Object& owner = Object::Handle(field.RawOwner());
+  const Function& initializer_fun = Function::ZoneHandle(
+      zone,
+      dart::Function::New(init_name, RawFunction::kImplicitStaticFinalGetter,
+                          true,   // is_static
+                          false,  // is_const
+                          false,  // is_abstract
+                          false,  // is_external
+                          false,  // is_native
+                          owner, TokenPosition::kNoSource));
+  initializer_fun.set_kernel_function(kernel_field);
+  initializer_fun.set_result_type(AbstractType::Handle(zone, field.type()));
+  initializer_fun.set_is_debuggable(false);
+  initializer_fun.set_is_reflectable(false);
+  initializer_fun.set_is_inlinable(false);
+  return new (zone) ParsedFunction(thread, initializer_fun);
+}
+
+
+}  // namespace kernel
+}  // namespace dart
+#endif  // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/kernel_reader.h b/runtime/vm/kernel_reader.h
new file mode 100644
index 0000000..f6b4ffd
--- /dev/null
+++ b/runtime/vm/kernel_reader.h
@@ -0,0 +1,119 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#ifndef RUNTIME_VM_KERNEL_READER_H_
+#define RUNTIME_VM_KERNEL_READER_H_
+
+#if !defined(DART_PRECOMPILED_RUNTIME)
+#include <map>
+
+#include "vm/kernel.h"
+#include "vm/kernel_to_il.h"
+#include "vm/object.h"
+
+namespace dart {
+namespace kernel {
+
+class KernelReader;
+
+class BuildingTranslationHelper : public TranslationHelper {
+ public:
+  BuildingTranslationHelper(KernelReader* reader,
+                            dart::Thread* thread,
+                            dart::Zone* zone,
+                            Isolate* isolate)
+      : TranslationHelper(thread, zone, isolate), reader_(reader) {}
+  virtual ~BuildingTranslationHelper() {}
+
+  virtual RawLibrary* LookupLibraryByKernelLibrary(Library* library);
+  virtual RawClass* LookupClassByKernelClass(Class* klass);
+
+ private:
+  KernelReader* reader_;
+};
+
+template <typename KernelType, typename VmType>
+class Mapping {
+ public:
+  bool Lookup(KernelType* node, VmType** handle) {
+    typename MapType::iterator value = map_.find(node);
+    if (value != map_.end()) {
+      *handle = value->second;
+      return true;
+    }
+    return false;
+  }
+
+  void Insert(KernelType* node, VmType* object) { map_[node] = object; }
+
+ private:
+  typedef typename std::map<KernelType*, VmType*> MapType;
+  MapType map_;
+};
+
+class KernelReader {
+ public:
+  explicit KernelReader(Program* program);
+
+  // Returns either a library or a failure object.
+  dart::Object& ReadProgram();
+
+  static void SetupFunctionParameters(TranslationHelper translation_helper_,
+                                      DartTypeTranslator type_translator_,
+                                      const dart::Class& owner,
+                                      const dart::Function& function,
+                                      FunctionNode* kernel_function,
+                                      bool is_method,
+                                      bool is_closure);
+
+  void ReadLibrary(Library* kernel_library);
+
+ private:
+  friend class BuildingTranslationHelper;
+
+  void ReadPreliminaryClass(dart::Class* klass, Class* kernel_klass);
+  dart::Class& ReadClass(const dart::Library& library, Class* kernel_klass);
+  void ReadProcedure(const dart::Library& library,
+                     const dart::Class& owner,
+                     Procedure* procedure,
+                     Class* kernel_klass = NULL);
+
+  // If klass's script is not the script at the uri index, return a PatchClass
+  // for klass whose script corresponds to the uri index.
+  // Otherwise return klass.
+  const Object& ClassForScriptAt(const dart::Class& klass,
+                                 intptr_t source_uri_index);
+  Script& ScriptAt(intptr_t source_uri_index);
+
+  void GenerateFieldAccessors(const dart::Class& klass,
+                              const dart::Field& field,
+                              Field* kernel_field);
+
+  void SetupFieldAccessorFunction(const dart::Class& klass,
+                                  const dart::Function& function);
+
+  dart::Library& LookupLibrary(Library* library);
+  dart::Class& LookupClass(Class* klass);
+
+  dart::RawFunction::Kind GetFunctionType(Procedure* kernel_procedure);
+
+  Program* program_;
+
+  dart::Thread* thread_;
+  dart::Zone* zone_;
+  dart::Isolate* isolate_;
+  Array& scripts_;
+  ActiveClass active_class_;
+  BuildingTranslationHelper translation_helper_;
+  DartTypeTranslator type_translator_;
+
+  Mapping<Library, dart::Library> libraries_;
+  Mapping<Class, dart::Class> classes_;
+};
+
+}  // namespace kernel
+}  // namespace dart
+
+#endif  // !defined(DART_PRECOMPILED_RUNTIME)
+#endif  // RUNTIME_VM_KERNEL_READER_H_
diff --git a/runtime/vm/kernel_to_il.cc b/runtime/vm/kernel_to_il.cc
new file mode 100644
index 0000000..f741ce5
--- /dev/null
+++ b/runtime/vm/kernel_to_il.cc
@@ -0,0 +1,5816 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 <map>
+#include <set>
+#include <string>
+
+#include "vm/kernel_to_il.h"
+
+#include "vm/compiler.h"
+#include "vm/intermediate_language.h"
+#include "vm/kernel_reader.h"
+#include "vm/longjump.h"
+#include "vm/method_recognizer.h"
+#include "vm/object_store.h"
+#include "vm/report.h"
+#include "vm/resolver.h"
+#include "vm/stack_frame.h"
+
+#if !defined(DART_PRECOMPILED_RUNTIME)
+namespace dart {
+
+DECLARE_FLAG(bool, support_externalizable_strings);
+
+namespace kernel {
+
+#define Z (zone_)
+#define H (translation_helper_)
+#define T (type_translator_)
+#define I Isolate::Current()
+
+
+static void DiscoverEnclosingElements(Zone* zone,
+                                      const Function& function,
+                                      Function* outermost_function,
+                                      TreeNode** outermost_node,
+                                      Class** klass) {
+  // Find out if there is an enclosing kernel class (which will be used to
+  // resolve type parameters).
+  *outermost_function = function.raw();
+  while (outermost_function->parent_function() != Object::null()) {
+    *outermost_function = outermost_function->parent_function();
+  }
+  *outermost_node =
+      static_cast<TreeNode*>(outermost_function->kernel_function());
+  if (*outermost_node != NULL) {
+    TreeNode* parent = NULL;
+    if ((*outermost_node)->IsProcedure()) {
+      parent = Procedure::Cast(*outermost_node)->parent();
+    } else if ((*outermost_node)->IsConstructor()) {
+      parent = Constructor::Cast(*outermost_node)->parent();
+    } else if ((*outermost_node)->IsField()) {
+      parent = Field::Cast(*outermost_node)->parent();
+    }
+    if (parent != NULL && parent->IsClass()) *klass = Class::Cast(parent);
+  }
+}
+
+
+void ScopeBuilder::EnterScope(TreeNode* node) {
+  scope_ = new (Z) LocalScope(scope_, depth_.function_, depth_.loop_);
+  result_->scopes.Insert(node, scope_);
+}
+
+
+void ScopeBuilder::ExitScope() {
+  scope_ = scope_->parent();
+}
+
+
+LocalVariable* ScopeBuilder::MakeVariable(const dart::String& name,
+                                          const AbstractType& type) {
+  return new (Z) LocalVariable(TokenPosition::kNoSource,
+                               TokenPosition::kNoSource, name, type);
+}
+
+
+void ScopeBuilder::AddParameters(FunctionNode* function, intptr_t pos) {
+  List<VariableDeclaration>& positional = function->positional_parameters();
+  for (intptr_t i = 0; i < positional.length(); ++i) {
+    AddParameter(positional[i], pos++);
+  }
+  List<VariableDeclaration>& named = function->named_parameters();
+  for (intptr_t i = 0; i < named.length(); ++i) {
+    AddParameter(named[i], pos++);
+  }
+}
+
+
+void ScopeBuilder::AddParameter(VariableDeclaration* declaration,
+                                intptr_t pos) {
+  LocalVariable* variable = MakeVariable(H.DartSymbol(declaration->name()),
+                                         T.TranslateVariableType(declaration));
+  if (declaration->IsFinal()) {
+    variable->set_is_final();
+  }
+  scope_->InsertParameterAt(pos, variable);
+  result_->locals.Insert(declaration, variable);
+
+  // The default value may contain 'let' bindings for which the constant
+  // evaluator needs scope bindings.
+  Expression* defaultValue = declaration->initializer();
+  if (defaultValue != NULL) {
+    defaultValue->AcceptExpressionVisitor(this);
+  }
+}
+
+
+void ScopeBuilder::AddExceptionVariable(
+    GrowableArray<LocalVariable*>* variables,
+    const char* prefix,
+    intptr_t nesting_depth) {
+  LocalVariable* v = NULL;
+
+  // If we are inside a function with yield points then Kernel transformer
+  // could have lifted some of the auxiliary exception variables into the
+  // context to preserve them across yield points because they might
+  // be needed for rethrow.
+  // Check if it did and capture such variables instead of introducing
+  // new local ones.
+  // Note: function that wrap kSyncYielding function does not contain
+  // its own try/catches.
+  if (current_function_node_->async_marker() == FunctionNode::kSyncYielding) {
+    ASSERT(current_function_scope_->parent() != NULL);
+    v = current_function_scope_->parent()->LocalLookupVariable(
+        GenerateName(prefix, nesting_depth - 1));
+    if (v != NULL) {
+      scope_->CaptureVariable(v);
+    }
+  }
+
+  // No need to create variables for try/catch-statements inside
+  // nested functions.
+  if (depth_.function_ > 0) return;
+  if (variables->length() >= nesting_depth) return;
+
+  // If variable was not lifted by the transformer introduce a new
+  // one into the current function scope.
+  if (v == NULL) {
+    v = MakeVariable(GenerateName(prefix, nesting_depth - 1),
+                     AbstractType::dynamic_type());
+
+    // If transformer did not lift the variable then there is no need
+    // to lift it into the context when we encouter a YieldStatement.
+    v->set_is_forced_stack();
+    current_function_scope_->AddVariable(v);
+  }
+
+  variables->Add(v);
+}
+
+
+void ScopeBuilder::AddTryVariables() {
+  AddExceptionVariable(&result_->catch_context_variables,
+                       ":saved_try_context_var", depth_.try_);
+}
+
+
+void ScopeBuilder::AddCatchVariables() {
+  AddExceptionVariable(&result_->exception_variables, ":exception",
+                       depth_.catch_);
+  AddExceptionVariable(&result_->stack_trace_variables, ":stack_trace",
+                       depth_.catch_);
+}
+
+
+void ScopeBuilder::AddIteratorVariable() {
+  if (depth_.function_ > 0) return;
+  if (result_->iterator_variables.length() >= depth_.for_in_) return;
+
+  ASSERT(result_->iterator_variables.length() == depth_.for_in_ - 1);
+  LocalVariable* iterator =
+      MakeVariable(GenerateName(":iterator", depth_.for_in_ - 1),
+                   AbstractType::dynamic_type());
+  current_function_scope_->AddVariable(iterator);
+  result_->iterator_variables.Add(iterator);
+}
+
+
+void ScopeBuilder::LookupVariable(VariableDeclaration* declaration) {
+  LocalVariable* variable = result_->locals.Lookup(declaration);
+  if (variable == NULL) {
+    // We have not seen a declaration of the variable, so it must be the
+    // case that we are compiling a nested function and the variable is
+    // declared in an outer scope.  In that case, look it up in the scope by
+    // name and add it to the variable map to simplify later lookup.
+    ASSERT(current_function_scope_->parent() != NULL);
+    const dart::String& name = H.DartSymbol(declaration->name());
+    variable = current_function_scope_->parent()->LookupVariable(name, true);
+    ASSERT(variable != NULL);
+    result_->locals.Insert(declaration, variable);
+  }
+  if (variable->owner()->function_level() < scope_->function_level()) {
+    // We call `LocalScope->CaptureVariable(variable)` in two scenarios for two
+    // different reasons:
+    //   Scenario 1:
+    //       We need to know which variables defined in this function
+    //       are closed over by nested closures in order to ensure we will
+    //       create a [Context] object of appropriate size and store captured
+    //       variables there instead of the stack.
+    //   Scenario 2:
+    //       We need to find out which variables defined in enclosing functions
+    //       are closed over by this function/closure or nested closures. This
+    //       is necessary in order to build a fat flattened [ContextScope]
+    //       object.
+    scope_->CaptureVariable(variable);
+  } else {
+    ASSERT(variable->owner()->function_level() == scope_->function_level());
+  }
+}
+
+
+void ScopeBuilder::LookupCapturedVariableByName(LocalVariable** variable,
+                                                const dart::String& name) {
+  if (*variable == NULL) {
+    *variable = scope_->LookupVariable(name, true);
+    ASSERT(*variable != NULL);
+    scope_->CaptureVariable(*variable);
+  }
+}
+
+
+const dart::String& ScopeBuilder::GenerateName(const char* prefix,
+                                               intptr_t suffix) {
+  char name[64];
+  OS::SNPrint(name, 64, "%s%" Pd "", prefix, suffix);
+  return H.DartSymbol(name);
+}
+
+
+void ScopeBuilder::AddVariable(VariableDeclaration* declaration) {
+  // In case `declaration->IsConst()` the flow graph building will take care of
+  // evaluating the constant and setting it via
+  // `declaration->SetConstantValue()`.
+  const dart::String& name = declaration->name()->is_empty()
+                                 ? GenerateName(":var", name_index_++)
+                                 : H.DartSymbol(declaration->name());
+  LocalVariable* variable =
+      MakeVariable(name, T.TranslateVariableType(declaration));
+  if (declaration->IsFinal()) {
+    variable->set_is_final();
+  }
+  scope_->AddVariable(variable);
+  result_->locals.Insert(declaration, variable);
+}
+
+
+static bool IsStaticInitializer(const Function& function, Zone* zone) {
+  return (function.kind() == RawFunction::kImplicitStaticFinalGetter) &&
+         dart::String::Handle(zone, function.name())
+             .StartsWith(Symbols::InitPrefix());
+}
+
+
+ScopeBuildingResult* ScopeBuilder::BuildScopes() {
+  if (result_ != NULL) return result_;
+
+  ASSERT(scope_ == NULL && depth_.loop_ == 0 && depth_.function_ == 0);
+  result_ = new (Z) ScopeBuildingResult();
+
+  ParsedFunction* parsed_function = parsed_function_;
+  const dart::Function& function = parsed_function->function();
+
+  // Setup a [ActiveClassScope] and a [ActiveMemberScope] which will be used
+  // e.g. for type translation.
+  const dart::Class& klass =
+      dart::Class::Handle(zone_, parsed_function_->function().Owner());
+  Function& outermost_function = Function::Handle(Z);
+  TreeNode* outermost_node = NULL;
+  Class* kernel_klass = NULL;
+  DiscoverEnclosingElements(Z, function, &outermost_function, &outermost_node,
+                            &kernel_klass);
+  // Use [klass]/[kernel_klass] as active class.  Type parameters will get
+  // resolved via [kernel_klass] unless we are nested inside a static factory
+  // in which case we will use [member].
+  ActiveClassScope active_class_scope(&active_class_, kernel_klass, &klass);
+  Member* member = ((outermost_node != NULL) && outermost_node->IsMember())
+                       ? Member::Cast(outermost_node)
+                       : NULL;
+  ActiveMemberScope active_member(&active_class_, member);
+
+
+  LocalScope* enclosing_scope = NULL;
+  if (function.IsLocalFunction()) {
+    enclosing_scope = LocalScope::RestoreOuterScope(
+        ContextScope::Handle(Z, function.context_scope()));
+  }
+  current_function_scope_ = scope_ = new (Z) LocalScope(enclosing_scope, 0, 0);
+
+  LocalVariable* context_var = parsed_function->current_context_var();
+  context_var->set_is_forced_stack();
+  scope_->AddVariable(context_var);
+  scope_->AddVariable(parsed_function->EnsureExpressionTemp());
+
+  parsed_function->SetNodeSequence(
+      new SequenceNode(TokenPosition::kNoSource, scope_));
+
+  switch (function.kind()) {
+    case RawFunction::kClosureFunction:
+    case RawFunction::kRegularFunction:
+    case RawFunction::kGetterFunction:
+    case RawFunction::kSetterFunction:
+    case RawFunction::kConstructor: {
+      FunctionNode* node;
+      if (node_->IsProcedure()) {
+        node = Procedure::Cast(node_)->function();
+      } else if (node_->IsConstructor()) {
+        node = Constructor::Cast(node_)->function();
+      } else {
+        node = FunctionNode::Cast(node_);
+      }
+      current_function_node_ = node;
+
+      intptr_t pos = 0;
+      if (function.IsClosureFunction()) {
+        LocalVariable* variable = MakeVariable(Symbols::ClosureParameter(),
+                                               AbstractType::dynamic_type());
+        variable->set_is_forced_stack();
+        scope_->InsertParameterAt(pos++, variable);
+      } else if (!function.is_static()) {
+        // We use [is_static] instead of [IsStaticFunction] because the latter
+        // returns `false` for constructors.
+        dart::Class& klass = dart::Class::Handle(Z, function.Owner());
+        Type& klass_type = H.GetCanonicalType(klass);
+        LocalVariable* variable = MakeVariable(Symbols::This(), klass_type);
+        scope_->InsertParameterAt(pos++, variable);
+        result_->this_variable = variable;
+
+        // We visit instance field initializers because they might contain
+        // [Let] expressions and we need to have a mapping.
+        if (node_->IsConstructor()) {
+          Class* klass = Class::Cast(Constructor::Cast(node_)->parent());
+
+          for (intptr_t i = 0; i < klass->fields().length(); i++) {
+            Field* field = klass->fields()[i];
+            if (!field->IsStatic() && (field->initializer() != NULL)) {
+              EnterScope(field);
+              field->initializer()->AcceptExpressionVisitor(this);
+              ExitScope();
+            }
+          }
+        }
+      } else if (function.IsFactory()) {
+        LocalVariable* variable = MakeVariable(
+            Symbols::TypeArgumentsParameter(), AbstractType::dynamic_type());
+        scope_->InsertParameterAt(pos++, variable);
+        result_->type_arguments_variable = variable;
+      }
+      AddParameters(node, pos);
+
+      // We generate a syntethic body for implicit closure functions - which
+      // will forward the call to the real function.
+      //     -> see BuildGraphOfImplicitClosureFunction
+      if (!function.IsImplicitClosureFunction()) {
+        node_->AcceptVisitor(this);
+      }
+      break;
+    }
+    case RawFunction::kImplicitGetter:
+    case RawFunction::kImplicitStaticFinalGetter:
+    case RawFunction::kImplicitSetter: {
+      ASSERT(node_->IsField());
+      if (IsStaticInitializer(function, Z)) {
+        node_->AcceptVisitor(this);
+        break;
+      }
+      bool is_setter = function.IsImplicitSetterFunction();
+      bool is_method = !function.IsStaticFunction();
+      intptr_t pos = 0;
+      if (is_method) {
+        dart::Class& klass = dart::Class::Handle(Z, function.Owner());
+        Type& klass_type = H.GetCanonicalType(klass);
+        LocalVariable* variable = MakeVariable(Symbols::This(), klass_type);
+        scope_->InsertParameterAt(pos++, variable);
+        result_->this_variable = variable;
+      }
+      if (is_setter) {
+        result_->setter_value =
+            MakeVariable(Symbols::Value(), AbstractType::dynamic_type());
+        scope_->InsertParameterAt(pos++, result_->setter_value);
+      }
+      break;
+    }
+    case RawFunction::kMethodExtractor: {
+      // Add a receiver parameter.  Though it is captured, we emit code to
+      // explicitly copy it to a fixed offset in a freshly-allocated context
+      // instead of using the generic code for regular functions.
+      // Therefore, it isn't necessary to mark it as captured here.
+      dart::Class& klass = dart::Class::Handle(Z, function.Owner());
+      Type& klass_type = H.GetCanonicalType(klass);
+      LocalVariable* variable = MakeVariable(Symbols::This(), klass_type);
+      scope_->InsertParameterAt(0, variable);
+      result_->this_variable = variable;
+      break;
+    }
+    case RawFunction::kNoSuchMethodDispatcher:
+    case RawFunction::kInvokeFieldDispatcher:
+      for (intptr_t i = 0; i < function.NumParameters(); ++i) {
+        LocalVariable* variable = MakeVariable(
+            dart::String::ZoneHandle(Z, function.ParameterNameAt(i)),
+            AbstractType::dynamic_type());
+        scope_->InsertParameterAt(i, variable);
+      }
+      break;
+    case RawFunction::kSignatureFunction:
+    case RawFunction::kIrregexpFunction:
+      UNREACHABLE();
+  }
+
+  parsed_function->AllocateVariables();
+
+  return result_;
+}
+
+
+void ScopeBuilder::VisitThisExpression(ThisExpression* node) {
+  HandleSpecialLoad(&result_->this_variable, Symbols::This());
+}
+
+
+void ScopeBuilder::VisitTypeParameterType(TypeParameterType* node) {
+  Function& function = Function::Handle(Z, parsed_function_->function().raw());
+  while (function.IsClosureFunction()) {
+    function = function.parent_function();
+  }
+
+  if (function.IsFactory()) {
+    // The type argument vector is passed as the very first argument to the
+    // factory constructor function.
+    HandleSpecialLoad(&result_->type_arguments_variable,
+                      Symbols::TypeArgumentsParameter());
+  } else {
+    // The type argument vector is stored on the instance object. We therefore
+    // need to capture `this`.
+    HandleSpecialLoad(&result_->this_variable, Symbols::This());
+  }
+}
+
+
+void ScopeBuilder::VisitVariableGet(VariableGet* node) {
+  LookupVariable(node->variable());
+}
+
+
+void ScopeBuilder::VisitVariableSet(VariableSet* node) {
+  LookupVariable(node->variable());
+  node->VisitChildren(this);
+}
+
+
+void ScopeBuilder::HandleLocalFunction(TreeNode* parent,
+                                       FunctionNode* function) {
+  LocalScope* saved_function_scope = current_function_scope_;
+  FunctionNode* saved_function_node = current_function_node_;
+  ScopeBuilder::DepthState saved_depth_state = depth_;
+  depth_ = DepthState(depth_.function_ + 1);
+  EnterScope(parent);
+  current_function_scope_ = scope_;
+  current_function_node_ = function;
+  if (depth_.function_ == 1) {
+    FunctionScope function_scope = {function, scope_};
+    result_->function_scopes.Add(function_scope);
+  }
+  AddParameters(function);
+  VisitFunctionNode(function);
+  ExitScope();
+  depth_ = saved_depth_state;
+  current_function_scope_ = saved_function_scope;
+  current_function_node_ = saved_function_node;
+}
+
+
+void ScopeBuilder::HandleSpecialLoad(LocalVariable** variable,
+                                     const dart::String& symbol) {
+  if (current_function_scope_->parent() != NULL) {
+    // We are building the scope tree of a closure function and saw [node]. We
+    // lazily populate the variable using the parent function scope.
+    if (*variable == NULL) {
+      *variable =
+          current_function_scope_->parent()->LookupVariable(symbol, true);
+      ASSERT(*variable != NULL);
+    }
+  }
+
+  if ((current_function_scope_->parent() != NULL) ||
+      (scope_->function_level() > 0)) {
+    // Every scope we use the [variable] from needs to be notified of the usage
+    // in order to ensure that preserving the context scope on that particular
+    // use-site also includes the [variable].
+    scope_->CaptureVariable(*variable);
+  }
+}
+
+
+void ScopeBuilder::VisitFunctionExpression(FunctionExpression* node) {
+  HandleLocalFunction(node, node->function());
+}
+
+
+void ScopeBuilder::VisitLet(Let* node) {
+  EnterScope(node);
+  node->VisitChildren(this);
+  ExitScope();
+}
+
+
+void ScopeBuilder::VisitBlock(Block* node) {
+  EnterScope(node);
+  node->VisitChildren(this);
+  ExitScope();
+}
+
+
+void ScopeBuilder::VisitVariableDeclaration(VariableDeclaration* node) {
+  AddVariable(node);
+  node->VisitChildren(this);
+}
+
+
+void ScopeBuilder::VisitFunctionDeclaration(FunctionDeclaration* node) {
+  VisitVariableDeclaration(node->variable());
+  HandleLocalFunction(node, node->function());
+}
+
+
+void ScopeBuilder::VisitWhileStatement(WhileStatement* node) {
+  ++depth_.loop_;
+  node->VisitChildren(this);
+  --depth_.loop_;
+}
+
+
+void ScopeBuilder::VisitDoStatement(DoStatement* node) {
+  ++depth_.loop_;
+  node->VisitChildren(this);
+  --depth_.loop_;
+}
+
+
+void ScopeBuilder::VisitForStatement(ForStatement* node) {
+  EnterScope(node);
+  List<VariableDeclaration>& variables = node->variables();
+  for (intptr_t i = 0; i < variables.length(); ++i) {
+    VisitVariableDeclaration(variables[i]);
+  }
+  ++depth_.loop_;
+  if (node->condition() != NULL) {
+    node->condition()->AcceptExpressionVisitor(this);
+  }
+  node->body()->AcceptStatementVisitor(this);
+  List<Expression>& updates = node->updates();
+  for (intptr_t i = 0; i < updates.length(); ++i) {
+    updates[i]->AcceptExpressionVisitor(this);
+  }
+  --depth_.loop_;
+  ExitScope();
+}
+
+
+void ScopeBuilder::VisitForInStatement(ForInStatement* node) {
+  node->iterable()->AcceptExpressionVisitor(this);
+  ++depth_.for_in_;
+  AddIteratorVariable();
+  ++depth_.loop_;
+  EnterScope(node);
+  VisitVariableDeclaration(node->variable());
+  node->body()->AcceptStatementVisitor(this);
+  ExitScope();
+  --depth_.loop_;
+  --depth_.for_in_;
+}
+
+
+void ScopeBuilder::AddSwitchVariable() {
+  if ((depth_.function_ == 0) && (result_->switch_variable == NULL)) {
+    LocalVariable* variable =
+        MakeVariable(Symbols::SwitchExpr(), AbstractType::dynamic_type());
+    variable->set_is_forced_stack();
+    current_function_scope_->AddVariable(variable);
+    result_->switch_variable = variable;
+  }
+}
+
+
+void ScopeBuilder::VisitSwitchStatement(SwitchStatement* node) {
+  AddSwitchVariable();
+  node->VisitChildren(this);
+}
+
+
+void ScopeBuilder::VisitReturnStatement(ReturnStatement* node) {
+  if ((depth_.function_ == 0) && (depth_.finally_ > 0) &&
+      (result_->finally_return_variable == NULL)) {
+    const dart::String& name = H.DartSymbol(":try_finally_return_value");
+    LocalVariable* variable = MakeVariable(name, AbstractType::dynamic_type());
+    current_function_scope_->AddVariable(variable);
+    result_->finally_return_variable = variable;
+  }
+  node->VisitChildren(this);
+}
+
+
+void ScopeBuilder::VisitTryCatch(TryCatch* node) {
+  ++depth_.try_;
+  AddTryVariables();
+  node->body()->AcceptStatementVisitor(this);
+  --depth_.try_;
+
+  ++depth_.catch_;
+  AddCatchVariables();
+  List<Catch>& catches = node->catches();
+  for (intptr_t i = 0; i < catches.length(); ++i) {
+    Catch* ketch = catches[i];
+    EnterScope(ketch);
+    if (ketch->exception() != NULL) {
+      VisitVariableDeclaration(ketch->exception());
+    }
+    if (ketch->stack_trace() != NULL) {
+      VisitVariableDeclaration(ketch->stack_trace());
+    }
+    ketch->body()->AcceptStatementVisitor(this);
+    ExitScope();
+  }
+  --depth_.catch_;
+}
+
+
+void ScopeBuilder::VisitTryFinally(TryFinally* node) {
+  ++depth_.try_;
+  ++depth_.finally_;
+  AddTryVariables();
+  node->body()->AcceptStatementVisitor(this);
+  --depth_.finally_;
+  --depth_.try_;
+
+  ++depth_.catch_;
+  AddCatchVariables();
+  node->finalizer()->AcceptStatementVisitor(this);
+  --depth_.catch_;
+}
+
+
+void ScopeBuilder::VisitFunctionNode(FunctionNode* node) {
+  List<TypeParameter>& type_parameters = node->type_parameters();
+  for (intptr_t i = 0; i < type_parameters.length(); ++i) {
+    VisitTypeParameter(type_parameters[i]);
+  }
+
+  if (node->async_marker() == FunctionNode::kSyncYielding) {
+    LocalScope* scope = parsed_function_->node_sequence()->scope();
+    for (intptr_t i = 0;
+         i < parsed_function_->function().NumOptionalPositionalParameters();
+         i++) {
+      scope->VariableAt(i)->set_is_forced_stack();
+    }
+  }
+
+  // Do not visit the positional and named parameters, because they've
+  // already been added to the scope.
+  if (node->body() != NULL) {
+    node->body()->AcceptStatementVisitor(this);
+  }
+
+  // Ensure that :await_jump_var and :await_ctx_var are captured.
+  if (node->async_marker() == FunctionNode::kSyncYielding) {
+    {
+      LocalVariable* temp = NULL;
+      LookupCapturedVariableByName(
+          (depth_.function_ == 0) ? &result_->yield_jump_variable : &temp,
+          Symbols::AwaitJumpVar());
+    }
+    {
+      LocalVariable* temp = NULL;
+      LookupCapturedVariableByName(
+          (depth_.function_ == 0) ? &result_->yield_context_variable : &temp,
+          Symbols::AwaitContextVar());
+    }
+  }
+}
+
+
+void ScopeBuilder::VisitYieldStatement(YieldStatement* node) {
+  ASSERT(node->is_native());
+  if (depth_.function_ == 0) {
+    AddSwitchVariable();
+    // Promote all currently visible local variables into the context.
+    // TODO(27590) CaptureLocalVariables promotes to many variables into
+    // the scope. Mark those variables as stack_local.
+    // TODO(27590) we don't need to promote those variables that are
+    // not used across yields.
+    scope_->CaptureLocalVariables(current_function_scope_);
+  }
+}
+
+
+void ScopeBuilder::VisitAssertStatement(AssertStatement* node) {
+  if (I->asserts()) {
+    RecursiveVisitor::VisitAssertStatement(node);
+  }
+}
+
+
+void ScopeBuilder::VisitConstructor(Constructor* node) {
+  // Field initializers that come from non-static field declarations are
+  // compiled as if they appear in the constructor initializer list.  This is
+  // important for closure-valued field initializers because the VM expects the
+  // corresponding closure functions to appear as if they were nested inside the
+  // constructor.
+  List<Field>& fields = Class::Cast(node->parent())->fields();
+  for (intptr_t i = 0; i < fields.length(); ++i) {
+    Field* field = fields[i];
+    Expression* initializer = field->initializer();
+    if (!field->IsStatic() && (initializer != NULL)) {
+      initializer->AcceptExpressionVisitor(this);
+    }
+  }
+  node->VisitChildren(this);
+}
+
+
+class BreakableBlock {
+ public:
+  BreakableBlock(FlowGraphBuilder* builder, LabeledStatement* statement)
+      : builder_(builder),
+        labeled_statement_(statement),
+        outer_(builder->breakable_block_),
+        destination_(NULL),
+        outer_finally_(builder->try_finally_block_),
+        context_depth_(builder->context_depth_) {
+    builder_->breakable_block_ = this;
+  }
+  ~BreakableBlock() { builder_->breakable_block_ = outer_; }
+
+  bool HadJumper() { return destination_ != NULL; }
+
+  JoinEntryInstr* destination() { return destination_; }
+
+  JoinEntryInstr* BreakDestination(LabeledStatement* label,
+                                   TryFinallyBlock** outer_finally,
+                                   intptr_t* context_depth) {
+    BreakableBlock* block = builder_->breakable_block_;
+    while (block->labeled_statement_ != label) {
+      block = block->outer_;
+    }
+    ASSERT(block != NULL);
+    *outer_finally = block->outer_finally_;
+    *context_depth = block->context_depth_;
+    return block->EnsureDestination();
+  }
+
+ private:
+  JoinEntryInstr* EnsureDestination() {
+    if (destination_ == NULL) {
+      destination_ = builder_->BuildJoinEntry();
+    }
+    return destination_;
+  }
+
+  FlowGraphBuilder* builder_;
+  LabeledStatement* labeled_statement_;
+  BreakableBlock* outer_;
+  JoinEntryInstr* destination_;
+  TryFinallyBlock* outer_finally_;
+  intptr_t context_depth_;
+};
+
+
+class SwitchBlock {
+ public:
+  SwitchBlock(FlowGraphBuilder* builder, SwitchStatement* switch_stmt)
+      : builder_(builder),
+        outer_(builder->switch_block_),
+        outer_finally_(builder->try_finally_block_),
+        switch_statement_(switch_stmt),
+        context_depth_(builder->context_depth_) {
+    builder_->switch_block_ = this;
+  }
+  ~SwitchBlock() { builder_->switch_block_ = outer_; }
+
+  bool HadJumper(SwitchCase* switch_case) {
+    return destinations_.Lookup(switch_case) != NULL;
+  }
+
+  JoinEntryInstr* Destination(SwitchCase* label,
+                              TryFinallyBlock** outer_finally = NULL,
+                              intptr_t* context_depth = NULL) {
+    // Find corresponding [SwitchStatement].
+    SwitchBlock* block = this;
+    while (true) {
+      block->EnsureSwitchCaseMapping();
+      if (block->Contains(label)) break;
+      block = block->outer_;
+    }
+
+    // Set the outer finally block.
+    if (outer_finally != NULL) {
+      *outer_finally = block->outer_finally_;
+      *context_depth = block->context_depth_;
+    }
+
+    // Ensure there's [JoinEntryInstr] for that [SwitchCase].
+    return block->EnsureDestination(label);
+  }
+
+ private:
+  typedef std::set<SwitchCase*> DestinationSwitches;
+
+  JoinEntryInstr* EnsureDestination(SwitchCase* switch_case) {
+    JoinEntryInstr* cached_inst = destinations_.Lookup(switch_case);
+    if (cached_inst == NULL) {
+      JoinEntryInstr* inst = builder_->BuildJoinEntry();
+      destinations_.Insert(switch_case, inst);
+      return inst;
+    }
+    return cached_inst;
+  }
+
+  void EnsureSwitchCaseMapping() {
+    if (destination_switches_.begin() == destination_switches_.end()) {
+      List<SwitchCase>& cases = switch_statement_->cases();
+      for (intptr_t i = 0; i < cases.length(); i++) {
+        destination_switches_.insert(cases[i]);
+      }
+    }
+  }
+
+  bool Contains(SwitchCase* sc) {
+    return destination_switches_.find(sc) != destination_switches_.end();
+  }
+
+  FlowGraphBuilder* builder_;
+  SwitchBlock* outer_;
+
+  Map<SwitchCase, JoinEntryInstr*> destinations_;
+  DestinationSwitches destination_switches_;
+
+  TryFinallyBlock* outer_finally_;
+  SwitchStatement* switch_statement_;
+  intptr_t context_depth_;
+};
+
+
+class TryFinallyBlock {
+ public:
+  TryFinallyBlock(FlowGraphBuilder* builder, Statement* finalizer)
+      : builder_(builder),
+        outer_(builder->try_finally_block_),
+        finalizer_(finalizer),
+        context_depth_(builder->context_depth_),
+        // Finalizers are executed outside of the try block hence
+        // try depth of finalizers are one less than current try
+        // depth.
+        try_depth_(builder->try_depth_ - 1),
+        try_index_(builder_->CurrentTryIndex()) {
+    builder_->try_finally_block_ = this;
+  }
+  ~TryFinallyBlock() { builder_->try_finally_block_ = outer_; }
+
+  Statement* finalizer() const { return finalizer_; }
+  intptr_t context_depth() const { return context_depth_; }
+  intptr_t try_depth() const { return try_depth_; }
+  intptr_t try_index() const { return try_index_; }
+  TryFinallyBlock* outer() const { return outer_; }
+
+ private:
+  FlowGraphBuilder* const builder_;
+  TryFinallyBlock* const outer_;
+  Statement* const finalizer_;
+  const intptr_t context_depth_;
+  const intptr_t try_depth_;
+  const intptr_t try_index_;
+};
+
+
+class TryCatchBlock {
+ public:
+  explicit TryCatchBlock(FlowGraphBuilder* builder,
+                         intptr_t try_handler_index = -1)
+      : builder_(builder),
+        outer_(builder->try_catch_block_),
+        try_index_(try_handler_index) {
+    if (try_index_ == -1) try_index_ = builder->AllocateTryIndex();
+    builder->try_catch_block_ = this;
+  }
+  ~TryCatchBlock() { builder_->try_catch_block_ = outer_; }
+
+  intptr_t try_index() { return try_index_; }
+  TryCatchBlock* outer() const { return outer_; }
+
+ private:
+  FlowGraphBuilder* builder_;
+  TryCatchBlock* outer_;
+  intptr_t try_index_;
+};
+
+
+class CatchBlock {
+ public:
+  CatchBlock(FlowGraphBuilder* builder,
+             LocalVariable* exception_var,
+             LocalVariable* stack_trace_var,
+             intptr_t catch_try_index)
+      : builder_(builder),
+        outer_(builder->catch_block_),
+        exception_var_(exception_var),
+        stack_trace_var_(stack_trace_var),
+        catch_try_index_(catch_try_index) {
+    builder_->catch_block_ = this;
+  }
+  ~CatchBlock() { builder_->catch_block_ = outer_; }
+
+  LocalVariable* exception_var() { return exception_var_; }
+  LocalVariable* stack_trace_var() { return stack_trace_var_; }
+  intptr_t catch_try_index() { return catch_try_index_; }
+
+ private:
+  FlowGraphBuilder* builder_;
+  CatchBlock* outer_;
+  LocalVariable* exception_var_;
+  LocalVariable* stack_trace_var_;
+  intptr_t catch_try_index_;
+};
+
+
+Fragment& Fragment::operator+=(const Fragment& other) {
+  if (entry == NULL) {
+    entry = other.entry;
+    current = other.current;
+  } else if (current != NULL && other.entry != NULL) {
+    current->LinkTo(other.entry);
+    current = other.current;
+  }
+  return *this;
+}
+
+
+Fragment& Fragment::operator<<=(Instruction* next) {
+  if (entry == NULL) {
+    entry = current = next;
+  } else if (current != NULL) {
+    current->LinkTo(next);
+    current = next;
+  }
+  return *this;
+}
+
+
+Fragment Fragment::closed() {
+  ASSERT(entry != NULL);
+  return Fragment(entry, NULL);
+}
+
+
+Fragment operator+(const Fragment& first, const Fragment& second) {
+  Fragment result = first;
+  result += second;
+  return result;
+}
+
+
+Fragment operator<<(const Fragment& fragment, Instruction* next) {
+  Fragment result = fragment;
+  result <<= next;
+  return result;
+}
+
+
+RawInstance* TranslationHelper::Canonicalize(const Instance& instance) {
+  if (instance.IsNull()) return instance.raw();
+
+  const char* error_str = NULL;
+  RawInstance* result = instance.CheckAndCanonicalize(thread(), &error_str);
+  if (result == Object::null()) {
+    ReportError("Invalid const object %s", error_str);
+  }
+  return result;
+}
+
+
+const dart::String& TranslationHelper::DartString(const char* content,
+                                                  Heap::Space space) {
+  return dart::String::ZoneHandle(Z, dart::String::New(content, space));
+}
+
+
+dart::String& TranslationHelper::DartString(String* content,
+                                            Heap::Space space) {
+  return dart::String::ZoneHandle(
+      Z, dart::String::FromUTF8(content->buffer(), content->size(), space));
+}
+
+
+const dart::String& TranslationHelper::DartSymbol(const char* content) const {
+  return dart::String::ZoneHandle(Z, Symbols::New(thread_, content));
+}
+
+
+dart::String& TranslationHelper::DartSymbol(String* content) const {
+  return dart::String::ZoneHandle(
+      Z, dart::Symbols::FromUTF8(thread_, content->buffer(), content->size()));
+}
+
+
+const dart::String& TranslationHelper::DartClassName(
+    kernel::Class* kernel_klass) {
+  ASSERT(kernel_klass->IsNormalClass());
+  dart::String& name = DartString(kernel_klass->name());
+  return ManglePrivateName(kernel_klass->parent(), &name);
+}
+
+
+const dart::String& TranslationHelper::DartConstructorName(Constructor* node) {
+  Class* klass = Class::Cast(node->parent());
+  return DartFactoryName(klass, node->name());
+}
+
+
+const dart::String& TranslationHelper::DartProcedureName(Procedure* procedure) {
+  if (procedure->kind() == Procedure::kSetter) {
+    return DartSetterName(procedure->name());
+  } else if (procedure->kind() == Procedure::kGetter) {
+    return DartGetterName(procedure->name());
+  } else if (procedure->kind() == Procedure::kFactory) {
+    return DartFactoryName(Class::Cast(procedure->parent()), procedure->name());
+  } else {
+    return DartMethodName(procedure->name());
+  }
+}
+
+
+const dart::String& TranslationHelper::DartSetterName(Name* kernel_name) {
+  // The names flowing into [content] are coming from the Kernel file:
+  //   * user-defined setters: `fieldname=`
+  //   * property-set expressions:  `fieldname`
+  //
+  // The VM uses `get:fieldname` and `set:fieldname`.
+  //
+  // => In order to be consistent, we remove the `=` always and adopt the VM
+  //    conventions.
+  String* content = kernel_name->string();
+  ASSERT(content->size() > 0);
+  intptr_t skip = 0;
+  if (content->buffer()[content->size() - 1] == '=') {
+    skip = 1;
+  }
+  dart::String& name = dart::String::ZoneHandle(
+      Z, dart::String::FromUTF8(content->buffer(), content->size() - skip,
+                                allocation_space_));
+  ManglePrivateName(kernel_name->library(), &name, false);
+  name = dart::Field::SetterSymbol(name);
+  return name;
+}
+
+
+const dart::String& TranslationHelper::DartGetterName(Name* kernel_name) {
+  dart::String& name = DartString(kernel_name->string());
+  ManglePrivateName(kernel_name->library(), &name, false);
+  name = dart::Field::GetterSymbol(name);
+  return name;
+}
+
+
+const dart::String& TranslationHelper::DartFieldName(Name* kernel_name) {
+  dart::String& name = DartString(kernel_name->string());
+  return ManglePrivateName(kernel_name->library(), &name);
+}
+
+
+const dart::String& TranslationHelper::DartInitializerName(Name* kernel_name) {
+  // The [DartFieldName] will take care of mangling the name.
+  dart::String& name =
+      dart::String::Handle(Z, DartFieldName(kernel_name).raw());
+  name = Symbols::FromConcat(thread_, Symbols::InitPrefix(), name);
+  return name;
+}
+
+
+const dart::String& TranslationHelper::DartMethodName(Name* kernel_name) {
+  dart::String& name = DartString(kernel_name->string());
+  return ManglePrivateName(kernel_name->library(), &name);
+}
+
+
+const dart::String& TranslationHelper::DartFactoryName(Class* klass,
+                                                       Name* method_name) {
+  // [DartMethodName] will mangle the name.
+  GrowableHandlePtrArray<const dart::String> pieces(Z, 3);
+  pieces.Add(DartClassName(klass));
+  pieces.Add(Symbols::Dot());
+  pieces.Add(DartMethodName(method_name));
+  return dart::String::ZoneHandle(
+      Z, dart::Symbols::FromConcatAll(thread_, pieces));
+}
+
+
+dart::RawLibrary* TranslationHelper::LookupLibraryByKernelLibrary(
+    Library* kernel_library) {
+  const dart::String& library_name = DartSymbol(kernel_library->import_uri());
+  ASSERT(!library_name.IsNull());
+  dart::RawLibrary* library =
+      dart::Library::LookupLibrary(thread_, library_name);
+  ASSERT(library != Object::null());
+  return library;
+}
+
+
+dart::RawClass* TranslationHelper::LookupClassByKernelClass(
+    Class* kernel_klass) {
+  dart::RawClass* klass = NULL;
+
+  const dart::String& class_name = DartClassName(kernel_klass);
+  Library* kernel_library = Library::Cast(kernel_klass->parent());
+  dart::Library& library =
+      dart::Library::Handle(Z, LookupLibraryByKernelLibrary(kernel_library));
+  klass = library.LookupClassAllowPrivate(class_name);
+
+  ASSERT(klass != Object::null());
+  return klass;
+}
+
+
+dart::RawUnresolvedClass* TranslationHelper::ToUnresolvedClass(
+    Class* kernel_klass) {
+  dart::RawClass* klass = NULL;
+
+  const dart::String& class_name = DartClassName(kernel_klass);
+  Library* kernel_library = Library::Cast(kernel_klass->parent());
+  dart::Library& library =
+      dart::Library::Handle(Z, LookupLibraryByKernelLibrary(kernel_library));
+
+  ASSERT(klass != Object::null());
+  return dart::UnresolvedClass::New(library, class_name,
+                                    TokenPosition::kNoSource);
+}
+
+
+dart::RawField* TranslationHelper::LookupFieldByKernelField(
+    Field* kernel_field) {
+  TreeNode* node = kernel_field->parent();
+
+  dart::Class& klass = dart::Class::Handle(Z);
+  if (node->IsClass()) {
+    klass = LookupClassByKernelClass(Class::Cast(node));
+  } else {
+    ASSERT(node->IsLibrary());
+    dart::Library& library = dart::Library::Handle(
+        Z, LookupLibraryByKernelLibrary(Library::Cast(node)));
+    klass = library.toplevel_class();
+  }
+  dart::RawField* field =
+      klass.LookupFieldAllowPrivate(DartSymbol(kernel_field->name()->string()));
+  ASSERT(field != Object::null());
+  return field;
+}
+
+
+dart::RawFunction* TranslationHelper::LookupStaticMethodByKernelProcedure(
+    Procedure* procedure) {
+  ASSERT(procedure->IsStatic());
+  const dart::String& procedure_name = DartProcedureName(procedure);
+
+  // The parent is either a library or a class (in which case the procedure is a
+  // static method).
+  TreeNode* parent = procedure->parent();
+  if (parent->IsClass()) {
+    dart::Class& klass =
+        dart::Class::Handle(Z, LookupClassByKernelClass(Class::Cast(parent)));
+    dart::RawFunction* raw_function =
+        klass.LookupFunctionAllowPrivate(procedure_name);
+    ASSERT(raw_function != Object::null());
+
+    // TODO(27590): We can probably get rid of this after no longer using
+    // core libraries from the source.
+    dart::Function& function = dart::Function::ZoneHandle(Z, raw_function);
+    if (function.IsRedirectingFactory()) {
+      ClassFinalizer::ResolveRedirectingFactory(klass, function);
+      function = function.RedirectionTarget();
+    }
+    return function.raw();
+  } else {
+    ASSERT(parent->IsLibrary());
+    dart::Library& library = dart::Library::Handle(
+        Z, LookupLibraryByKernelLibrary(Library::Cast(parent)));
+    dart::RawFunction* function =
+        library.LookupFunctionAllowPrivate(procedure_name);
+    ASSERT(function != Object::null());
+    return function;
+  }
+}
+
+
+dart::RawFunction* TranslationHelper::LookupConstructorByKernelConstructor(
+    Constructor* constructor) {
+  Class* kernel_klass = Class::Cast(constructor->parent());
+  dart::Class& klass =
+      dart::Class::Handle(Z, LookupClassByKernelClass(kernel_klass));
+  return LookupConstructorByKernelConstructor(klass, constructor);
+}
+
+
+dart::RawFunction* TranslationHelper::LookupConstructorByKernelConstructor(
+    const dart::Class& owner,
+    Constructor* constructor) {
+  dart::RawFunction* function =
+      owner.LookupConstructorAllowPrivate(DartConstructorName(constructor));
+  ASSERT(function != Object::null());
+  return function;
+}
+
+
+dart::Type& TranslationHelper::GetCanonicalType(const dart::Class& klass) {
+  ASSERT(!klass.IsNull());
+  // Note that if cls is _Closure, the returned type will be _Closure,
+  // and not the signature type.
+  Type& type = Type::ZoneHandle(Z, klass.CanonicalType());
+  if (!type.IsNull()) {
+    return type;
+  }
+  type = Type::New(klass, TypeArguments::Handle(Z, klass.type_parameters()),
+                   klass.token_pos());
+  if (klass.is_type_finalized()) {
+    type ^= ClassFinalizer::FinalizeType(
+        klass, type, ClassFinalizer::kCanonicalizeWellFormed);
+    // Note that the receiver type may now be a malbounded type.
+    klass.SetCanonicalType(type);
+  }
+  return type;
+}
+
+
+void TranslationHelper::ReportError(const char* format, ...) {
+  const Script& null_script = Script::Handle(Z);
+
+  va_list args;
+  va_start(args, format);
+  Report::MessageV(Report::kError, null_script, TokenPosition::kNoSource,
+                   Report::AtLocation, format, args);
+  va_end(args);
+  UNREACHABLE();
+}
+
+
+void TranslationHelper::ReportError(const Error& prev_error,
+                                    const char* format,
+                                    ...) {
+  const Script& null_script = Script::Handle(Z);
+
+  va_list args;
+  va_start(args, format);
+  Report::LongJumpV(prev_error, null_script, TokenPosition::kNoSource, format,
+                    args);
+  va_end(args);
+  UNREACHABLE();
+}
+
+
+dart::String& TranslationHelper::ManglePrivateName(Library* kernel_library,
+                                                   dart::String* name_to_modify,
+                                                   bool symbolize) {
+  if (name_to_modify->Length() >= 1 && name_to_modify->CharAt(0) == '_') {
+    const dart::Library& library =
+        dart::Library::Handle(Z, LookupLibraryByKernelLibrary(kernel_library));
+    *name_to_modify = library.PrivateName(*name_to_modify);
+  } else if (symbolize) {
+    *name_to_modify = Symbols::New(thread_, *name_to_modify);
+  }
+  return *name_to_modify;
+}
+
+
+const Array& TranslationHelper::ArgumentNames(List<NamedExpression>* named) {
+  if (named->length() == 0) return Array::ZoneHandle(Z);
+
+  const Array& names =
+      Array::ZoneHandle(Z, Array::New(named->length(), allocation_space_));
+  for (intptr_t i = 0; i < named->length(); ++i) {
+    names.SetAt(i, DartSymbol((*named)[i]->name()));
+  }
+  return names;
+}
+
+
+ConstantEvaluator::ConstantEvaluator(FlowGraphBuilder* builder,
+                                     Zone* zone,
+                                     TranslationHelper* h,
+                                     DartTypeTranslator* type_translator)
+    : builder_(builder),
+      isolate_(Isolate::Current()),
+      zone_(zone),
+      translation_helper_(*h),
+      type_translator_(*type_translator),
+      script_(dart::Script::Handle(
+          zone,
+          builder_->parsed_function_->function().script())),
+      result_(dart::Instance::Handle(zone)) {}
+
+
+Instance& ConstantEvaluator::EvaluateExpression(Expression* expression) {
+  if (!GetCachedConstant(expression, &result_)) {
+    expression->AcceptExpressionVisitor(this);
+    CacheConstantValue(expression, result_);
+  }
+  // We return a new `ZoneHandle` here on purpose: The intermediate language
+  // instructions do not make a copy of the handle, so we do it.
+  return dart::Instance::ZoneHandle(Z, result_.raw());
+}
+
+
+Object& ConstantEvaluator::EvaluateExpressionSafe(Expression* expression) {
+  LongJumpScope jump;
+  if (setjmp(*jump.Set()) == 0) {
+    return EvaluateExpression(expression);
+  } else {
+    Thread* thread = Thread::Current();
+    Error& error = Error::Handle(Z);
+    error = thread->sticky_error();
+    thread->clear_sticky_error();
+    return error;
+  }
+}
+
+
+Instance& ConstantEvaluator::EvaluateConstructorInvocation(
+    ConstructorInvocation* node) {
+  if (!GetCachedConstant(node, &result_)) {
+    VisitConstructorInvocation(node);
+    CacheConstantValue(node, result_);
+  }
+  // We return a new `ZoneHandle` here on purpose: The intermediate language
+  // instructions do not make a copy of the handle, so we do it.
+  return dart::Instance::ZoneHandle(Z, result_.raw());
+}
+
+
+Instance& ConstantEvaluator::EvaluateListLiteral(ListLiteral* node) {
+  if (!GetCachedConstant(node, &result_)) {
+    VisitListLiteral(node);
+    CacheConstantValue(node, result_);
+  }
+  // We return a new `ZoneHandle` here on purpose: The intermediate language
+  // instructions do not make a copy of the handle, so we do it.
+  return dart::Instance::ZoneHandle(Z, result_.raw());
+}
+
+
+Instance& ConstantEvaluator::EvaluateMapLiteral(MapLiteral* node) {
+  if (!GetCachedConstant(node, &result_)) {
+    VisitMapLiteral(node);
+    CacheConstantValue(node, result_);
+  }
+  // We return a new `ZoneHandle` here on purpose: The intermediate language
+  // instructions do not make a copy of the handle, so we do it.
+  return dart::Instance::ZoneHandle(Z, result_.raw());
+}
+
+
+void ConstantEvaluator::VisitBigintLiteral(BigintLiteral* node) {
+  const dart::String& value = H.DartString(node->value());
+  result_ = Integer::New(value, Heap::kOld);
+  result_ = H.Canonicalize(result_);
+}
+
+
+void ConstantEvaluator::VisitBoolLiteral(BoolLiteral* node) {
+  result_ = dart::Bool::Get(node->value()).raw();
+}
+
+
+void ConstantEvaluator::VisitDoubleLiteral(DoubleLiteral* node) {
+  result_ = dart::Double::New(H.DartString(node->value()), Heap::kOld);
+  result_ = H.Canonicalize(result_);
+}
+
+
+void ConstantEvaluator::VisitIntLiteral(IntLiteral* node) {
+  result_ = dart::Integer::New(node->value(), Heap::kOld);
+  result_ = H.Canonicalize(result_);
+}
+
+
+void ConstantEvaluator::VisitNullLiteral(NullLiteral* node) {
+  result_ = dart::Instance::null();
+}
+
+
+void ConstantEvaluator::VisitStringLiteral(StringLiteral* node) {
+  result_ = H.DartSymbol(node->value()).raw();
+}
+
+
+void ConstantEvaluator::VisitTypeLiteral(TypeLiteral* node) {
+  const AbstractType& type = T.TranslateType(node->type());
+  if (type.IsMalformed()) {
+    H.ReportError("Malformed type literal in constant expression.");
+  }
+  result_ = type.raw();
+}
+
+
+RawObject* ConstantEvaluator::EvaluateConstConstructorCall(
+    const dart::Class& type_class,
+    const TypeArguments& type_arguments,
+    const Function& constructor,
+    const Object& argument) {
+  // Factories have one extra argument: the type arguments.
+  // Constructors have 1 extra arguments: receiver.
+  const int kNumArgs = 1;
+  const int kNumExtraArgs = 1;
+  const int num_arguments = kNumArgs + kNumExtraArgs;
+  const Array& arg_values =
+      Array::Handle(Z, Array::New(num_arguments, Heap::kOld));
+  Instance& instance = Instance::Handle(Z);
+  if (!constructor.IsFactory()) {
+    instance = Instance::New(type_class, Heap::kOld);
+    if (!type_arguments.IsNull()) {
+      ASSERT(type_arguments.IsInstantiated());
+      instance.SetTypeArguments(
+          TypeArguments::Handle(Z, type_arguments.Canonicalize()));
+    }
+    arg_values.SetAt(0, instance);
+  } else {
+    // Prepend type_arguments to list of arguments to factory.
+    ASSERT(type_arguments.IsZoneHandle());
+    arg_values.SetAt(0, type_arguments);
+  }
+  arg_values.SetAt((0 + kNumExtraArgs), argument);
+  const Array& args_descriptor = Array::Handle(
+      Z, ArgumentsDescriptor::New(num_arguments, Object::empty_array()));
+  const Object& result = Object::Handle(
+      Z, DartEntry::InvokeFunction(constructor, arg_values, args_descriptor));
+  ASSERT(!result.IsError());
+  if (constructor.IsFactory()) {
+    // The factory method returns the allocated object.
+    instance ^= result.raw();
+  }
+  return H.Canonicalize(instance);
+}
+
+
+bool ConstantEvaluator::GetCachedConstant(TreeNode* node, Instance* value) {
+  const Function& function = builder_->parsed_function_->function();
+  if (function.kind() == RawFunction::kImplicitStaticFinalGetter) {
+    // Don't cache constants in initializer expressions. They get
+    // evaluated only once.
+    return false;
+  }
+
+  bool is_present = false;
+  ASSERT(!script_.InVMHeap());
+  if (script_.compile_time_constants() == Array::null()) {
+    return false;
+  }
+  KernelConstantsMap constants(script_.compile_time_constants());
+  *value ^= constants.GetOrNull(node, &is_present);
+  // Mutator compiler thread may add constants while background compiler
+  // is running, and thus change the value of 'compile_time_constants';
+  // do not assert that 'compile_time_constants' has not changed.
+  constants.Release();
+  if (FLAG_compiler_stats && is_present) {
+    H.thread()->compiler_stats()->num_const_cache_hits++;
+  }
+  return is_present;
+}
+
+
+void ConstantEvaluator::CacheConstantValue(TreeNode* node,
+                                           const Instance& value) {
+  ASSERT(Thread::Current()->IsMutatorThread());
+
+  const Function& function = builder_->parsed_function_->function();
+  if (function.kind() == RawFunction::kImplicitStaticFinalGetter) {
+    // Don't cache constants in initializer expressions. They get
+    // evaluated only once.
+    return;
+  }
+  const intptr_t kInitialConstMapSize = 16;
+  ASSERT(!script_.InVMHeap());
+  if (script_.compile_time_constants() == Array::null()) {
+    const Array& array = Array::Handle(
+        HashTables::New<KernelConstantsMap>(kInitialConstMapSize, Heap::kNew));
+    script_.set_compile_time_constants(array);
+  }
+  KernelConstantsMap constants(script_.compile_time_constants());
+  constants.InsertNewOrGetValue(node, value);
+  script_.set_compile_time_constants(constants.Release());
+}
+
+
+void ConstantEvaluator::VisitSymbolLiteral(SymbolLiteral* node) {
+  const dart::String& symbol_value = H.DartSymbol(node->value());
+
+  const dart::Class& symbol_class =
+      dart::Class::ZoneHandle(Z, I->object_store()->symbol_class());
+  ASSERT(!symbol_class.IsNull());
+  const dart::Function& symbol_constructor = Function::ZoneHandle(
+      Z, symbol_class.LookupConstructor(Symbols::SymbolCtor()));
+  ASSERT(!symbol_constructor.IsNull());
+  result_ ^= EvaluateConstConstructorCall(
+      symbol_class, TypeArguments::Handle(Z), symbol_constructor, symbol_value);
+}
+
+
+void ConstantEvaluator::VisitListLiteral(ListLiteral* node) {
+  DartType* types[] = {node->type()};
+  const TypeArguments& type_arguments = T.TranslateTypeArguments(types, 1);
+
+  intptr_t length = node->expressions().length();
+  const Array& const_list =
+      Array::ZoneHandle(Z, Array::New(length, Heap::kOld));
+  const_list.SetTypeArguments(type_arguments);
+  for (intptr_t i = 0; i < length; i++) {
+    const Instance& expression = EvaluateExpression(node->expressions()[i]);
+    const_list.SetAt(i, expression);
+  }
+  const_list.MakeImmutable();
+  result_ = H.Canonicalize(const_list);
+}
+
+
+void ConstantEvaluator::VisitMapLiteral(MapLiteral* node) {
+  DartType* types[] = {node->key_type(), node->value_type()};
+  const TypeArguments& type_arguments = T.TranslateTypeArguments(types, 2);
+
+  intptr_t length = node->entries().length();
+
+  Array& const_kv_array =
+      Array::ZoneHandle(Z, Array::New(2 * length, Heap::kOld));
+  for (intptr_t i = 0; i < length; i++) {
+    const_kv_array.SetAt(2 * i + 0,
+                         EvaluateExpression(node->entries()[i]->key()));
+    const_kv_array.SetAt(2 * i + 1,
+                         EvaluateExpression(node->entries()[i]->value()));
+  }
+
+  const_kv_array.MakeImmutable();
+  const_kv_array ^= H.Canonicalize(const_kv_array);
+
+  const dart::Class& map_class = dart::Class::Handle(
+      Z, dart::Library::LookupCoreClass(Symbols::ImmutableMap()));
+  ASSERT(!map_class.IsNull());
+  ASSERT(map_class.NumTypeArguments() == 2);
+
+  const dart::Field& field = dart::Field::Handle(
+      Z, map_class.LookupInstanceFieldAllowPrivate(H.DartSymbol("_kvPairs")));
+  ASSERT(!field.IsNull());
+
+  // NOTE: This needs to be kept in sync with `runtime/lib/immutable_map.dart`!
+  result_ = Instance::New(map_class, Heap::kOld);
+  ASSERT(!result_.IsNull());
+  result_.SetTypeArguments(type_arguments);
+  result_.SetField(field, const_kv_array);
+  result_ = H.Canonicalize(result_);
+}
+
+
+void ConstantEvaluator::VisitConstructorInvocation(
+    ConstructorInvocation* node) {
+  Arguments* kernel_arguments = node->arguments();
+
+  const Function& constructor = Function::Handle(
+      Z, H.LookupConstructorByKernelConstructor(node->target()));
+  dart::Class& klass = dart::Class::Handle(Z, constructor.Owner());
+
+  // Build the type arguments vector (if necessary).
+  const TypeArguments* type_arguments =
+      TranslateTypeArguments(constructor, &klass, kernel_arguments);
+
+  // Prepare either the instance or the type argument vector for the constructor
+  // call.
+  Instance* receiver = NULL;
+  const TypeArguments* type_arguments_argument = NULL;
+  if (!constructor.IsFactory()) {
+    receiver = &Instance::ZoneHandle(Z, Instance::New(klass, Heap::kOld));
+    if (type_arguments != NULL) {
+      receiver->SetTypeArguments(*type_arguments);
+    }
+  } else {
+    type_arguments_argument = type_arguments;
+  }
+
+  const Object& result = RunFunction(constructor, kernel_arguments, receiver,
+                                     type_arguments_argument);
+  if (constructor.IsFactory()) {
+    // Factories return the new object.
+    result_ ^= result.raw();
+    result_ = H.Canonicalize(result_);
+  } else {
+    ASSERT(!receiver->IsNull());
+    result_ = H.Canonicalize(*receiver);
+  }
+}
+
+
+void ConstantEvaluator::VisitMethodInvocation(MethodInvocation* node) {
+  Arguments* kernel_arguments = node->arguments();
+
+  // Dart does not support generic methods yet.
+  ASSERT(kernel_arguments->types().length() == 0);
+
+  const dart::Instance& receiver = EvaluateExpression(node->receiver());
+  dart::Class& klass = dart::Class::Handle(
+      Z, isolate_->class_table()->At(receiver.GetClassId()));
+  ASSERT(!klass.IsNull());
+
+  // Search the superclass chain for the selector.
+  dart::Function& function = dart::Function::Handle(Z);
+  const dart::String& method_name = H.DartMethodName(node->name());
+  while (!klass.IsNull()) {
+    function = klass.LookupDynamicFunctionAllowPrivate(method_name);
+    if (!function.IsNull()) break;
+    klass = klass.SuperClass();
+  }
+
+  // The frontend should guarantee that [MethodInvocation]s inside constant
+  // expressions are always valid.
+  ASSERT(!function.IsNull());
+
+  // Run the method and canonicalize the result.
+  const Object& result = RunFunction(function, kernel_arguments, &receiver);
+  result_ ^= result.raw();
+  result_ = H.Canonicalize(result_);
+}
+
+
+void ConstantEvaluator::VisitStaticGet(StaticGet* node) {
+  Member* member = node->target();
+  if (member->IsField()) {
+    Field* kernel_field = Field::Cast(member);
+    const dart::Field& field =
+        dart::Field::Handle(Z, H.LookupFieldByKernelField(kernel_field));
+    if (field.StaticValue() == Object::sentinel().raw() ||
+        field.StaticValue() == Object::transition_sentinel().raw()) {
+      field.EvaluateInitializer();
+      result_ = field.StaticValue();
+      result_ = H.Canonicalize(result_);
+      field.SetStaticValue(result_, true);
+    } else {
+      result_ = field.StaticValue();
+    }
+  } else if (member->IsProcedure()) {
+    Procedure* procedure = Procedure::Cast(member);
+    const Function& target = Function::ZoneHandle(
+        Z, H.LookupStaticMethodByKernelProcedure(procedure));
+
+    if (procedure->kind() == Procedure::kMethod) {
+      ASSERT(procedure->IsStatic());
+      Function& closure_function =
+          Function::ZoneHandle(Z, target.ImplicitClosureFunction());
+      closure_function.set_kernel_function(target.kernel_function());
+      result_ = closure_function.ImplicitStaticClosure();
+      result_ = H.Canonicalize(result_);
+    } else if (procedure->kind() == Procedure::kGetter) {
+      UNIMPLEMENTED();
+    } else {
+      UNIMPLEMENTED();
+    }
+  }
+}
+
+
+void ConstantEvaluator::VisitVariableGet(VariableGet* node) {
+  // When we see a [VariableGet] the corresponding [VariableDeclaration] must've
+  // been executed already. It therefore must have a constant object associated
+  // with it.
+  LocalVariable* variable = builder_->LookupVariable(node->variable());
+  ASSERT(variable->IsConst());
+  result_ = variable->ConstValue()->raw();
+}
+
+
+void ConstantEvaluator::VisitLet(Let* node) {
+  VariableDeclaration* variable = node->variable();
+  LocalVariable* local = builder_->LookupVariable(variable);
+  local->SetConstValue(EvaluateExpression(variable->initializer()));
+  node->body()->AcceptExpressionVisitor(this);
+}
+
+
+void ConstantEvaluator::VisitStaticInvocation(StaticInvocation* node) {
+  const Function& function = Function::ZoneHandle(
+      Z, H.LookupStaticMethodByKernelProcedure(node->procedure()));
+  dart::Class& klass = dart::Class::Handle(Z, function.Owner());
+
+  // Build the type arguments vector (if necessary).
+  const TypeArguments* type_arguments =
+      TranslateTypeArguments(function, &klass, node->arguments());
+
+  const Object& result =
+      RunFunction(function, node->arguments(), NULL, type_arguments);
+  result_ ^= result.raw();
+  result_ = H.Canonicalize(result_);
+}
+
+
+void ConstantEvaluator::VisitStringConcatenation(StringConcatenation* node) {
+  intptr_t length = node->expressions().length();
+
+  bool all_string = true;
+  const Array& strings = Array::Handle(Z, Array::New(length));
+  for (intptr_t i = 0; i < length; i++) {
+    EvaluateExpression(node->expressions()[i]);
+    strings.SetAt(i, result_);
+    all_string = all_string && result_.IsString();
+  }
+  if (all_string) {
+    result_ = dart::String::ConcatAll(strings, Heap::kOld);
+    result_ = H.Canonicalize(result_);
+  } else {
+    // Get string interpolation function.
+    const dart::Class& cls = dart::Class::Handle(
+        Z, dart::Library::LookupCoreClass(Symbols::StringBase()));
+    ASSERT(!cls.IsNull());
+    const Function& func = Function::Handle(
+        Z, cls.LookupStaticFunction(
+               dart::Library::PrivateCoreLibName(Symbols::Interpolate())));
+    ASSERT(!func.IsNull());
+
+    // Build argument array to pass to the interpolation function.
+    const Array& interpolate_arg = Array::Handle(Z, Array::New(1, Heap::kOld));
+    interpolate_arg.SetAt(0, strings);
+
+    // Run and canonicalize.
+    const Object& result =
+        RunFunction(func, interpolate_arg, Array::null_array());
+    result_ = H.Canonicalize(dart::String::Cast(result));
+  }
+}
+
+
+void ConstantEvaluator::VisitConditionalExpression(
+    ConditionalExpression* node) {
+  EvaluateExpression(node->condition());
+  if (Bool::Cast(result_).value()) {
+    EvaluateExpression(node->then());
+  } else {
+    EvaluateExpression(node->otherwise());
+  }
+}
+
+
+void ConstantEvaluator::VisitLogicalExpression(LogicalExpression* node) {
+  if (node->op() == LogicalExpression::kAnd) {
+    EvaluateExpression(node->left());
+    if (Bool::Cast(result_).value()) {
+      EvaluateExpression(node->right());
+    }
+  } else {
+    ASSERT(node->op() == LogicalExpression::kOr);
+    EvaluateExpression(node->left());
+    if (!Bool::Cast(result_).value()) {
+      EvaluateExpression(node->right());
+    }
+  }
+}
+
+
+void ConstantEvaluator::VisitNot(Not* node) {
+  EvaluateExpression(node->expression());
+  ASSERT(result_.IsBool());
+  result_ =
+      Bool::Cast(result_).value() ? Bool::False().raw() : Bool::True().raw();
+}
+
+
+const TypeArguments* ConstantEvaluator::TranslateTypeArguments(
+    const Function& target,
+    dart::Class* target_klass,
+    Arguments* kernel_arguments) {
+  List<DartType>& kernel_type_arguments = kernel_arguments->types();
+
+  const TypeArguments* type_arguments = NULL;
+  if (kernel_type_arguments.length() > 0) {
+    type_arguments = &T.TranslateInstantiatedTypeArguments(
+        *target_klass, kernel_type_arguments.raw_array(),
+        kernel_type_arguments.length());
+
+    if (!(type_arguments->IsNull() || type_arguments->IsInstantiated())) {
+      H.ReportError("Type must be constant in const constructor.");
+    }
+  } else if (target.IsFactory() && type_arguments == NULL) {
+    // All factories take a type arguments vector as first argument (independent
+    // of whether the class is generic or not).
+    type_arguments = &TypeArguments::ZoneHandle(Z, TypeArguments::null());
+  }
+  return type_arguments;
+}
+
+
+const Object& ConstantEvaluator::RunFunction(const Function& function,
+                                             Arguments* kernel_arguments,
+                                             const Instance* receiver,
+                                             const TypeArguments* type_args) {
+  // We do not support generic methods yet.
+  ASSERT((receiver == NULL) || (type_args == NULL));
+  intptr_t extra_arguments =
+      (receiver != NULL ? 1 : 0) + (type_args != NULL ? 1 : 0);
+
+  // Build up arguments.
+  const Array& arguments = Array::ZoneHandle(
+      Z, Array::New(extra_arguments + kernel_arguments->count()));
+  const Array& names =
+      Array::ZoneHandle(Z, Array::New(kernel_arguments->named().length()));
+  intptr_t pos = 0;
+  if (receiver != NULL) {
+    arguments.SetAt(pos++, *receiver);
+  }
+  if (type_args != NULL) {
+    arguments.SetAt(pos++, *type_args);
+  }
+  for (intptr_t i = 0; i < kernel_arguments->positional().length(); i++) {
+    EvaluateExpression(kernel_arguments->positional()[i]);
+    arguments.SetAt(pos++, result_);
+  }
+  for (intptr_t i = 0; i < kernel_arguments->named().length(); i++) {
+    NamedExpression* named_expression = kernel_arguments->named()[i];
+    EvaluateExpression(named_expression->expression());
+    arguments.SetAt(pos++, result_);
+    names.SetAt(i, H.DartSymbol(named_expression->name()));
+  }
+  return RunFunction(function, arguments, names);
+}
+
+
+const Object& ConstantEvaluator::RunFunction(const Function& function,
+                                             const Array& arguments,
+                                             const Array& names) {
+  const Array& args_descriptor =
+      Array::Handle(Z, ArgumentsDescriptor::New(arguments.Length(), names));
+  const Object& result = Object::Handle(
+      Z, DartEntry::InvokeFunction(function, arguments, args_descriptor));
+  if (result.IsError()) {
+    H.ReportError(Error::Cast(result), "error evaluating constant constructor");
+  }
+  return result;
+}
+
+
+FlowGraphBuilder::FlowGraphBuilder(
+    TreeNode* node,
+    ParsedFunction* parsed_function,
+    const ZoneGrowableArray<const ICData*>& ic_data_array,
+    InlineExitCollector* exit_collector,
+    intptr_t osr_id,
+    intptr_t first_block_id)
+    : zone_(Thread::Current()->zone()),
+      translation_helper_(Thread::Current(),
+                          zone_,
+                          Thread::Current()->isolate()),
+      node_(node),
+      parsed_function_(parsed_function),
+      osr_id_(osr_id),
+      ic_data_array_(ic_data_array),
+      exit_collector_(exit_collector),
+      next_block_id_(first_block_id),
+      next_function_id_(0),
+      context_depth_(0),
+      loop_depth_(0),
+      try_depth_(0),
+      catch_depth_(0),
+      for_in_depth_(0),
+      stack_(NULL),
+      pending_argument_count_(0),
+      graph_entry_(NULL),
+      scopes_(NULL),
+      breakable_block_(NULL),
+      switch_block_(NULL),
+      try_finally_block_(NULL),
+      try_catch_block_(NULL),
+      next_used_try_index_(0),
+      catch_block_(NULL),
+      type_translator_(&translation_helper_,
+                       &active_class_,
+                       /* finalize= */ true),
+      constant_evaluator_(this,
+                          zone_,
+                          &translation_helper_,
+                          &type_translator_) {}
+
+
+FlowGraphBuilder::~FlowGraphBuilder() {}
+
+
+Fragment FlowGraphBuilder::TranslateFinallyFinalizers(
+    TryFinallyBlock* outer_finally,
+    intptr_t target_context_depth) {
+  TryFinallyBlock* const saved_block = try_finally_block_;
+  TryCatchBlock* const saved_try_catch_block = try_catch_block_;
+  const intptr_t saved_depth = context_depth_;
+  const intptr_t saved_try_depth = try_depth_;
+
+  Fragment instructions;
+
+  // While translating the body of a finalizer we need to set the try-finally
+  // block which is active when translating the body.
+  while (try_finally_block_ != outer_finally) {
+    // Set correct try depth (in case there are nested try statements).
+    try_depth_ = try_finally_block_->try_depth();
+
+    // Potentially restore the context to what is expected for the finally
+    // block.
+    instructions += AdjustContextTo(try_finally_block_->context_depth());
+
+    // The to-be-translated finalizer has to have the correct try-index (namely
+    // the one outside the try-finally block).
+    bool changed_try_index = false;
+    intptr_t target_try_index = try_finally_block_->try_index();
+    while (CurrentTryIndex() != target_try_index) {
+      try_catch_block_ = try_catch_block_->outer();
+      changed_try_index = true;
+    }
+    if (changed_try_index) {
+      JoinEntryInstr* entry = BuildJoinEntry();
+      instructions += Goto(entry);
+      instructions = Fragment(instructions.entry, entry);
+    }
+
+    Statement* finalizer = try_finally_block_->finalizer();
+    try_finally_block_ = try_finally_block_->outer();
+
+    // This will potentially have exceptional cases as described in
+    // [VisitTryFinally] and will handle them.
+    instructions += TranslateStatement(finalizer);
+
+    // We only need to make sure that if the finalizer ended normally, we
+    // continue towards the next outer try-finally.
+    if (!instructions.is_open()) break;
+  }
+
+  if (instructions.is_open() && target_context_depth != -1) {
+    // A target context depth of -1 indicates that the code after this
+    // will not care about the context chain so we can leave it any way we
+    // want after the last finalizer.  That is used when returning.
+    instructions += AdjustContextTo(target_context_depth);
+  }
+
+  try_finally_block_ = saved_block;
+  try_catch_block_ = saved_try_catch_block;
+  context_depth_ = saved_depth;
+  try_depth_ = saved_try_depth;
+
+  return instructions;
+}
+
+
+Fragment FlowGraphBuilder::EnterScope(TreeNode* node, bool* new_context) {
+  Fragment instructions;
+  const intptr_t context_size =
+      scopes_->scopes.Lookup(node)->num_context_variables();
+  if (context_size > 0) {
+    instructions += PushContext(context_size);
+    instructions += Drop();
+    if (new_context != NULL) {
+      *new_context = true;
+    }
+  }
+  return instructions;
+}
+
+
+Fragment FlowGraphBuilder::ExitScope(TreeNode* node) {
+  Fragment instructions;
+  const intptr_t context_size =
+      scopes_->scopes.Lookup(node)->num_context_variables();
+  if (context_size > 0) {
+    instructions += PopContext();
+  }
+  return instructions;
+}
+
+
+Fragment FlowGraphBuilder::LoadContextAt(int depth) {
+  intptr_t delta = context_depth_ - depth;
+  ASSERT(delta >= 0);
+  Fragment instructions = LoadLocal(parsed_function_->current_context_var());
+  while (delta-- > 0) {
+    instructions += LoadField(Context::parent_offset());
+  }
+  return instructions;
+}
+
+
+Fragment FlowGraphBuilder::AdjustContextTo(int depth) {
+  ASSERT(depth <= context_depth_ && depth >= 0);
+  Fragment instructions;
+  if (depth < context_depth_) {
+    instructions += LoadContextAt(depth);
+    instructions += StoreLocal(parsed_function_->current_context_var());
+    instructions += Drop();
+    context_depth_ = depth;
+  }
+  return instructions;
+}
+
+
+Fragment FlowGraphBuilder::PushContext(int size) {
+  ASSERT(size > 0);
+  Fragment instructions = AllocateContext(size);
+  LocalVariable* context = MakeTemporary();
+  instructions += LoadLocal(context);
+  instructions += LoadLocal(parsed_function_->current_context_var());
+  instructions += StoreInstanceField(Context::parent_offset());
+  instructions += StoreLocal(parsed_function_->current_context_var());
+  ++context_depth_;
+  return instructions;
+}
+
+
+Fragment FlowGraphBuilder::PopContext() {
+  return AdjustContextTo(context_depth_ - 1);
+}
+
+
+Fragment FlowGraphBuilder::LoadInstantiatorTypeArguments() {
+  // TODO(27590): We could use `active_class_->IsGeneric()`.
+  Fragment instructions;
+  if (scopes_->type_arguments_variable != NULL) {
+#ifdef DEBUG
+    Function& function =
+        Function::Handle(Z, parsed_function_->function().raw());
+    while (function.IsClosureFunction()) {
+      function = function.parent_function();
+    }
+    ASSERT(function.IsFactory());
+#endif
+    instructions += LoadLocal(scopes_->type_arguments_variable);
+  } else if (scopes_->this_variable != NULL &&
+             active_class_.kernel_class != NULL &&
+             active_class_.kernel_class->type_parameters().length() > 0) {
+    ASSERT(!parsed_function_->function().IsFactory());
+    intptr_t type_arguments_field_offset =
+        active_class_.klass->type_arguments_field_offset();
+    ASSERT(type_arguments_field_offset != dart::Class::kNoTypeArguments);
+
+    instructions += LoadLocal(scopes_->this_variable);
+    instructions += LoadField(type_arguments_field_offset);
+  } else {
+    instructions += NullConstant();
+  }
+  return instructions;
+}
+
+
+Fragment FlowGraphBuilder::InstantiateTypeArguments(
+    const TypeArguments& type_arguments) {
+  InstantiateTypeArgumentsInstr* instr = new (Z) InstantiateTypeArgumentsInstr(
+      TokenPosition::kNoSource, type_arguments, *active_class_.klass, Pop());
+  Push(instr);
+  return Fragment(instr);
+}
+
+
+Fragment FlowGraphBuilder::TranslateInstantiatedTypeArguments(
+    const TypeArguments& type_arguments) {
+  Fragment instructions;
+
+  if (type_arguments.IsNull() || type_arguments.IsInstantiated()) {
+    // There are no type references to type parameters so we can just take it.
+    instructions += Constant(type_arguments);
+  } else {
+    // The [type_arguments] vector contains a type reference to a type
+    // parameter we need to resolve it.
+    const bool use_instantiator =
+        type_arguments.IsUninstantiatedIdentity() ||
+        type_arguments.CanShareInstantiatorTypeArguments(*active_class_.klass);
+    if (use_instantiator) {
+      // If the instantiator type arguments are just passed on, we don't need to
+      // resolve the type parameters.
+      //
+      // This is for example the case here:
+      //     class Foo<T> {
+      //       newList() => new List<T>();
+      //     }
+      // We just use the type argument vector from the [Foo] object and pass it
+      // directly to the `new List<T>()` factory constructor.
+      instructions += LoadInstantiatorTypeArguments();
+    } else {
+      // Otherwise we need to resolve [TypeParameterType]s in the type
+      // expression based on the current instantiator type argument vector.
+      instructions += LoadInstantiatorTypeArguments();
+      instructions += InstantiateTypeArguments(type_arguments);
+    }
+  }
+  return instructions;
+}
+
+
+Fragment FlowGraphBuilder::AllocateContext(int size) {
+  AllocateContextInstr* allocate =
+      new (Z) AllocateContextInstr(TokenPosition::kNoSource, size);
+  Push(allocate);
+  return Fragment(allocate);
+}
+
+
+Fragment FlowGraphBuilder::AllocateObject(const dart::Class& klass,
+                                          intptr_t argument_count) {
+  ArgumentArray arguments = GetArguments(argument_count);
+  AllocateObjectInstr* allocate =
+      new (Z) AllocateObjectInstr(TokenPosition::kNoSource, klass, arguments);
+  Push(allocate);
+  return Fragment(allocate);
+}
+
+
+Fragment FlowGraphBuilder::AllocateObject(const dart::Class& klass,
+                                          const Function& closure_function) {
+  ArgumentArray arguments = new (Z) ZoneGrowableArray<PushArgumentInstr*>(Z, 0);
+  AllocateObjectInstr* allocate =
+      new (Z) AllocateObjectInstr(TokenPosition::kNoSource, klass, arguments);
+  allocate->set_closure_function(closure_function);
+  Push(allocate);
+  return Fragment(allocate);
+}
+
+
+Fragment FlowGraphBuilder::BooleanNegate() {
+  BooleanNegateInstr* negate = new (Z) BooleanNegateInstr(Pop());
+  Push(negate);
+  return Fragment(negate);
+}
+
+
+Fragment FlowGraphBuilder::StrictCompare(Token::Kind kind,
+                                         bool number_check /* = false */) {
+  Value* right = Pop();
+  Value* left = Pop();
+  StrictCompareInstr* compare = new (Z) StrictCompareInstr(
+      TokenPosition::kNoSource, kind, left, right, number_check);
+  Push(compare);
+  return Fragment(compare);
+}
+
+
+Fragment FlowGraphBuilder::BranchIfTrue(TargetEntryInstr** then_entry,
+                                        TargetEntryInstr** otherwise_entry,
+                                        bool negate) {
+  Fragment instructions = Constant(Bool::True());
+  return instructions + BranchIfEqual(then_entry, otherwise_entry, negate);
+}
+
+
+Fragment FlowGraphBuilder::BranchIfNull(TargetEntryInstr** then_entry,
+                                        TargetEntryInstr** otherwise_entry,
+                                        bool negate) {
+  Fragment instructions = NullConstant();
+  return instructions + BranchIfEqual(then_entry, otherwise_entry, negate);
+}
+
+Fragment FlowGraphBuilder::BranchIfEqual(TargetEntryInstr** then_entry,
+                                         TargetEntryInstr** otherwise_entry,
+                                         bool negate) {
+  Value* right_value = Pop();
+  Value* left_value = Pop();
+  StrictCompareInstr* compare = new (Z) StrictCompareInstr(
+      TokenPosition::kNoSource, negate ? Token::kNE_STRICT : Token::kEQ_STRICT,
+      left_value, right_value, false);
+  BranchInstr* branch = new (Z) BranchInstr(compare);
+  *then_entry = *branch->true_successor_address() = BuildTargetEntry();
+  *otherwise_entry = *branch->false_successor_address() = BuildTargetEntry();
+  return Fragment(branch).closed();
+}
+
+
+Fragment FlowGraphBuilder::BranchIfStrictEqual(
+    TargetEntryInstr** then_entry,
+    TargetEntryInstr** otherwise_entry) {
+  Value* rhs = Pop();
+  Value* lhs = Pop();
+  StrictCompareInstr* compare = new (Z) StrictCompareInstr(
+      TokenPosition::kNoSource, Token::kEQ_STRICT, lhs, rhs, false);
+  BranchInstr* branch = new (Z) BranchInstr(compare);
+  *then_entry = *branch->true_successor_address() = BuildTargetEntry();
+  *otherwise_entry = *branch->false_successor_address() = BuildTargetEntry();
+  return Fragment(branch).closed();
+}
+
+
+Fragment FlowGraphBuilder::CatchBlockEntry(const Array& handler_types,
+                                           intptr_t handler_index) {
+  ASSERT(CurrentException()->is_captured() ==
+         CurrentStackTrace()->is_captured());
+  const bool should_restore_closure_context =
+      CurrentException()->is_captured() || CurrentCatchContext()->is_captured();
+  CatchBlockEntryInstr* entry = new (Z) CatchBlockEntryInstr(
+      AllocateBlockId(), CurrentTryIndex(), graph_entry_, handler_types,
+      handler_index, *CurrentException(), *CurrentStackTrace(),
+      /* needs_stacktrace = */ true, Thread::Current()->GetNextDeoptId(),
+      should_restore_closure_context);
+  graph_entry_->AddCatchEntry(entry);
+  Fragment instructions(entry);
+
+  // :saved_try_context_var can be captured in the context of
+  // of the closure, in this case CatchBlockEntryInstr restores
+  // :current_context_var to point to closure context in the
+  // same way as normal function prologue does.
+  // Update current context depth to reflect that.
+  const intptr_t saved_context_depth = context_depth_;
+  ASSERT(!CurrentCatchContext()->is_captured() ||
+         CurrentCatchContext()->owner()->context_level() == 0);
+  context_depth_ = 0;
+  instructions += LoadLocal(CurrentCatchContext());
+  instructions += StoreLocal(parsed_function_->current_context_var());
+  instructions += Drop();
+  context_depth_ = saved_context_depth;
+
+  return instructions;
+}
+
+
+Fragment FlowGraphBuilder::TryCatch(int try_handler_index) {
+  // The body of the try needs to have it's own block in order to get a new try
+  // index.
+  //
+  // => We therefore create a block for the body (fresh try index) and another
+  //    join block (with current try index).
+  Fragment body;
+  JoinEntryInstr* entry =
+      new (Z) JoinEntryInstr(AllocateBlockId(), try_handler_index);
+  body += LoadLocal(parsed_function_->current_context_var());
+  body += StoreLocal(CurrentCatchContext());
+  body += Drop();
+  body += Goto(entry);
+  return Fragment(body.entry, entry);
+}
+
+
+Fragment FlowGraphBuilder::CheckStackOverflowInPrologue() {
+  if (IsInlining()) {
+    // If we are inlining don't actually attach the stack check.  We must still
+    // create the stack check in order to allocate a deopt id.
+    CheckStackOverflow();
+    return Fragment();
+  }
+  return CheckStackOverflow();
+}
+
+
+Fragment FlowGraphBuilder::CheckStackOverflow() {
+  return Fragment(
+      new (Z) CheckStackOverflowInstr(TokenPosition::kNoSource, loop_depth_));
+}
+
+
+Fragment FlowGraphBuilder::CloneContext() {
+  LocalVariable* context_variable = parsed_function_->current_context_var();
+
+  Fragment instructions = LoadLocal(context_variable);
+
+  CloneContextInstr* clone_instruction =
+      new (Z) CloneContextInstr(TokenPosition::kNoSource, Pop());
+  instructions <<= clone_instruction;
+  Push(clone_instruction);
+
+  instructions += StoreLocal(context_variable);
+  instructions += Drop();
+  return instructions;
+}
+
+
+Fragment FlowGraphBuilder::Constant(const Object& value) {
+  ASSERT(value.IsNotTemporaryScopedHandle());
+  ConstantInstr* constant = new (Z) ConstantInstr(value);
+  Push(constant);
+  return Fragment(constant);
+}
+
+
+Fragment FlowGraphBuilder::CreateArray() {
+  Value* element_count = Pop();
+  CreateArrayInstr* array = new (Z) CreateArrayInstr(TokenPosition::kNoSource,
+                                                     Pop(),  // Element type.
+                                                     element_count);
+  Push(array);
+  return Fragment(array);
+}
+
+
+Fragment FlowGraphBuilder::Goto(JoinEntryInstr* destination) {
+  return Fragment(new (Z) GotoInstr(destination)).closed();
+}
+
+
+Fragment FlowGraphBuilder::IntConstant(int64_t value) {
+  return Fragment(
+      Constant(Integer::ZoneHandle(Z, Integer::New(value, Heap::kOld))));
+}
+
+
+Fragment FlowGraphBuilder::InstanceCall(TokenPosition position,
+                                        const dart::String& name,
+                                        Token::Kind kind,
+                                        intptr_t argument_count,
+                                        intptr_t num_args_checked) {
+  return InstanceCall(position, name, kind, argument_count, Array::null_array(),
+                      num_args_checked);
+}
+
+
+Fragment FlowGraphBuilder::InstanceCall(TokenPosition position,
+                                        const dart::String& name,
+                                        Token::Kind kind,
+                                        intptr_t argument_count,
+                                        const Array& argument_names,
+                                        intptr_t num_args_checked) {
+  ArgumentArray arguments = GetArguments(argument_count);
+  InstanceCallInstr* call =
+      new (Z) InstanceCallInstr(position, name, kind, arguments, argument_names,
+                                num_args_checked, ic_data_array_);
+  Push(call);
+  return Fragment(call);
+}
+
+
+Fragment FlowGraphBuilder::ClosureCall(int argument_count,
+                                       const Array& argument_names) {
+  Value* function = Pop();
+  ArgumentArray arguments = GetArguments(argument_count);
+  ClosureCallInstr* call = new (Z) ClosureCallInstr(
+      function, arguments, argument_names, TokenPosition::kNoSource);
+  Push(call);
+  return Fragment(call);
+}
+
+
+Fragment FlowGraphBuilder::ThrowException(TokenPosition position) {
+  Fragment instructions;
+  instructions += Drop();
+  instructions += Fragment(new (Z) ThrowInstr(position)).closed();
+  // Use it's side effect of leaving a constant on the stack (does not change
+  // the graph).
+  NullConstant();
+
+  pending_argument_count_ -= 1;
+
+  return instructions;
+}
+
+
+Fragment FlowGraphBuilder::RethrowException(int catch_try_index) {
+  Fragment instructions;
+  instructions += Drop();
+  instructions += Drop();
+  instructions +=
+      Fragment(new (Z) ReThrowInstr(TokenPosition::kNoSource, catch_try_index))
+          .closed();
+  // Use it's side effect of leaving a constant on the stack (does not change
+  // the graph).
+  NullConstant();
+
+  pending_argument_count_ -= 2;
+
+  return instructions;
+}
+
+
+Fragment FlowGraphBuilder::LoadClassId() {
+  LoadClassIdInstr* load = new (Z) LoadClassIdInstr(Pop());
+  Push(load);
+  return Fragment(load);
+}
+
+
+const dart::Field& MayCloneField(Zone* zone, const dart::Field& field) {
+  if ((Compiler::IsBackgroundCompilation() ||
+       FLAG_force_clone_compiler_objects) &&
+      field.IsOriginal()) {
+    return dart::Field::ZoneHandle(zone, field.CloneFromOriginal());
+  } else {
+    ASSERT(field.IsZoneHandle());
+    return field;
+  }
+}
+
+
+Fragment FlowGraphBuilder::LoadField(const dart::Field& field) {
+  LoadFieldInstr* load = new (Z) LoadFieldInstr(
+      Pop(), &MayCloneField(Z, field),
+      AbstractType::ZoneHandle(Z, field.type()), TokenPosition::kNoSource);
+  Push(load);
+  return Fragment(load);
+}
+
+
+Fragment FlowGraphBuilder::LoadField(intptr_t offset, intptr_t class_id) {
+  LoadFieldInstr* load = new (Z) LoadFieldInstr(
+      Pop(), offset, AbstractType::ZoneHandle(Z), TokenPosition::kNoSource);
+  load->set_result_cid(class_id);
+  Push(load);
+  return Fragment(load);
+}
+
+
+Fragment FlowGraphBuilder::LoadNativeField(MethodRecognizer::Kind kind,
+                                           intptr_t offset,
+                                           const Type& type,
+                                           intptr_t class_id,
+                                           bool is_immutable) {
+  LoadFieldInstr* load =
+      new (Z) LoadFieldInstr(Pop(), offset, type, TokenPosition::kNoSource);
+  load->set_recognized_kind(kind);
+  load->set_result_cid(class_id);
+  load->set_is_immutable(is_immutable);
+  Push(load);
+  return Fragment(load);
+}
+
+
+Fragment FlowGraphBuilder::LoadLocal(LocalVariable* variable) {
+  Fragment instructions;
+  if (variable->is_captured()) {
+    instructions += LoadContextAt(variable->owner()->context_level());
+    instructions += LoadField(Context::variable_offset(variable->index()));
+  } else {
+    LoadLocalInstr* load =
+        new (Z) LoadLocalInstr(*variable, TokenPosition::kNoSource);
+    instructions <<= load;
+    Push(load);
+  }
+  return instructions;
+}
+
+
+Fragment FlowGraphBuilder::InitStaticField(const dart::Field& field) {
+  InitStaticFieldInstr* init =
+      new (Z) InitStaticFieldInstr(Pop(), MayCloneField(Z, field));
+  return Fragment(init);
+}
+
+
+Fragment FlowGraphBuilder::LoadStaticField() {
+  LoadStaticFieldInstr* load =
+      new (Z) LoadStaticFieldInstr(Pop(), TokenPosition::kNoSource);
+  Push(load);
+  return Fragment(load);
+}
+
+
+Fragment FlowGraphBuilder::NullConstant() {
+  return Constant(Instance::ZoneHandle(Z, Instance::null()));
+}
+
+
+Fragment FlowGraphBuilder::NativeCall(const dart::String* name,
+                                      const Function* function) {
+  InlineBailout("kernel::FlowGraphBuilder::NativeCall");
+  NativeCallInstr* call = new (Z) NativeCallInstr(
+      name, function, FLAG_link_natives_lazily, TokenPosition::kNoSource);
+  Push(call);
+  return Fragment(call);
+}
+
+
+Fragment FlowGraphBuilder::PushArgument() {
+  PushArgumentInstr* argument = new (Z) PushArgumentInstr(Pop());
+  Push(argument);
+
+  argument->set_temp_index(argument->temp_index() - 1);
+  ++pending_argument_count_;
+
+  return Fragment(argument);
+}
+
+
+Fragment FlowGraphBuilder::Return() {
+  Value* value = Pop();
+  ASSERT(stack_ == NULL);
+  ReturnInstr* return_instr =
+      new (Z) ReturnInstr(TokenPosition::kNoSource, value);
+  if (exit_collector_ != NULL) exit_collector_->AddExit(return_instr);
+  return Fragment(return_instr).closed();
+}
+
+
+Fragment FlowGraphBuilder::StaticCall(TokenPosition position,
+                                      const Function& target,
+                                      intptr_t argument_count) {
+  return StaticCall(position, target, argument_count, Array::null_array());
+}
+
+
+static intptr_t GetResultCidOfListFactory(Zone* zone,
+                                          const Function& function,
+                                          intptr_t argument_count) {
+  if (!function.IsFactory()) {
+    return kDynamicCid;
+  }
+
+  const dart::Class& owner = dart::Class::Handle(zone, function.Owner());
+  if ((owner.library() != dart::Library::CoreLibrary()) &&
+      (owner.library() != dart::Library::TypedDataLibrary())) {
+    return kDynamicCid;
+  }
+
+  if ((owner.Name() == Symbols::List().raw()) &&
+      (function.name() == Symbols::ListFactory().raw())) {
+    ASSERT(argument_count == 1 || argument_count == 2);
+    return (argument_count == 1) ? kGrowableObjectArrayCid : kArrayCid;
+  }
+  return FactoryRecognizer::ResultCid(function);
+}
+
+
+Fragment FlowGraphBuilder::StaticCall(TokenPosition position,
+                                      const Function& target,
+                                      intptr_t argument_count,
+                                      const Array& argument_names) {
+  ArgumentArray arguments = GetArguments(argument_count);
+  StaticCallInstr* call = new (Z) StaticCallInstr(
+      position, target, argument_names, arguments, ic_data_array_);
+  const intptr_t list_cid =
+      GetResultCidOfListFactory(Z, target, argument_count);
+  if (list_cid != kDynamicCid) {
+    call->set_result_cid(list_cid);
+    call->set_is_known_list_constructor(true);
+  } else if (target.recognized_kind() != MethodRecognizer::kUnknown) {
+    call->set_result_cid(MethodRecognizer::ResultCid(target));
+  }
+  Push(call);
+  return Fragment(call);
+}
+
+
+Fragment FlowGraphBuilder::StoreIndexed(intptr_t class_id) {
+  Value* value = Pop();
+  Value* index = Pop();
+  const StoreBarrierType emit_store_barrier =
+      value->BindsToConstant() ? kNoStoreBarrier : kEmitStoreBarrier;
+  StoreIndexedInstr* store = new (Z) StoreIndexedInstr(
+      Pop(),  // Array.
+      index, value, emit_store_barrier, Instance::ElementSizeFor(class_id),
+      class_id, kAlignedAccess, Thread::kNoDeoptId, TokenPosition::kNoSource);
+  Push(store);
+  return Fragment(store);
+}
+
+
+Fragment FlowGraphBuilder::StoreInstanceField(
+    const dart::Field& field,
+    StoreBarrierType emit_store_barrier) {
+  Value* value = Pop();
+  if (value->BindsToConstant()) {
+    emit_store_barrier = kNoStoreBarrier;
+  }
+  StoreInstanceFieldInstr* store = new (Z)
+      StoreInstanceFieldInstr(MayCloneField(Z, field), Pop(), value,
+                              emit_store_barrier, TokenPosition::kNoSource);
+  return Fragment(store);
+}
+
+
+Fragment FlowGraphBuilder::StoreInstanceFieldGuarded(const dart::Field& field) {
+  Fragment instructions;
+  const dart::Field& field_clone = MayCloneField(Z, field);
+  if (FLAG_use_field_guards) {
+    LocalVariable* store_expression = MakeTemporary();
+    instructions += LoadLocal(store_expression);
+    instructions +=
+        GuardFieldClass(field_clone, Thread::Current()->GetNextDeoptId());
+    instructions += LoadLocal(store_expression);
+    instructions +=
+        GuardFieldLength(field_clone, Thread::Current()->GetNextDeoptId());
+  }
+  instructions += StoreInstanceField(field_clone);
+  return instructions;
+}
+
+
+Fragment FlowGraphBuilder::StoreInstanceField(
+    intptr_t offset,
+    StoreBarrierType emit_store_barrier) {
+  Value* value = Pop();
+  if (value->BindsToConstant()) {
+    emit_store_barrier = kNoStoreBarrier;
+  }
+  StoreInstanceFieldInstr* store = new (Z) StoreInstanceFieldInstr(
+      offset, Pop(), value, emit_store_barrier, TokenPosition::kNoSource);
+  return Fragment(store);
+}
+
+
+Fragment FlowGraphBuilder::StoreLocal(LocalVariable* variable) {
+  Fragment instructions;
+  if (variable->is_captured()) {
+    LocalVariable* value = MakeTemporary();
+    instructions += LoadContextAt(variable->owner()->context_level());
+    instructions += LoadLocal(value);
+    instructions +=
+        StoreInstanceField(Context::variable_offset(variable->index()));
+  } else {
+    StoreLocalInstr* store =
+        new (Z) StoreLocalInstr(*variable, Pop(), TokenPosition::kNoSource);
+    instructions <<= store;
+    Push(store);
+  }
+  return instructions;
+}
+
+
+Fragment FlowGraphBuilder::StoreStaticField(const dart::Field& field) {
+  return Fragment(new (Z) StoreStaticFieldInstr(MayCloneField(Z, field), Pop(),
+                                                TokenPosition::kNoSource));
+}
+
+
+Fragment FlowGraphBuilder::StringInterpolate() {
+  Value* array = Pop();
+  StringInterpolateInstr* interpolate =
+      new (Z) StringInterpolateInstr(array, TokenPosition::kNoSource);
+  Push(interpolate);
+  return Fragment(interpolate);
+}
+
+
+Fragment FlowGraphBuilder::ThrowTypeError() {
+  const dart::Class& klass = dart::Class::ZoneHandle(
+      Z, dart::Library::LookupCoreClass(Symbols::TypeError()));
+  ASSERT(!klass.IsNull());
+  const dart::Function& constructor = dart::Function::ZoneHandle(
+      Z,
+      klass.LookupConstructorAllowPrivate(H.DartSymbol("_TypeError._create")));
+  ASSERT(!constructor.IsNull());
+
+  const dart::String& url = H.DartString(
+      parsed_function_->function().ToLibNamePrefixedQualifiedCString(),
+      Heap::kOld);
+
+  Fragment instructions;
+
+  // Create instance of _FallThroughError
+  instructions += AllocateObject(klass, 0);
+  LocalVariable* instance = MakeTemporary();
+
+  // Call _AssertionError._create constructor.
+  instructions += LoadLocal(instance);
+  instructions += PushArgument();  // this
+
+  instructions += Constant(url);
+  instructions += PushArgument();  // url
+
+  instructions += NullConstant();
+  instructions += PushArgument();  // line
+
+  instructions += IntConstant(0);
+  instructions += PushArgument();  // column
+
+  instructions += Constant(H.DartSymbol("Malformed type."));
+  instructions += PushArgument();  // message
+
+  instructions += StaticCall(TokenPosition::kNoSource, constructor, 5);
+  instructions += Drop();
+
+  // Throw the exception
+  instructions += PushArgument();
+  instructions += ThrowException(TokenPosition::kNoSource);
+
+  return instructions;
+}
+
+
+Fragment FlowGraphBuilder::ThrowNoSuchMethodError() {
+  const dart::Class& klass = dart::Class::ZoneHandle(
+      Z, dart::Library::LookupCoreClass(Symbols::NoSuchMethodError()));
+  ASSERT(!klass.IsNull());
+  const dart::Function& throw_function = dart::Function::ZoneHandle(
+      Z, klass.LookupStaticFunctionAllowPrivate(Symbols::ThrowNew()));
+  ASSERT(!throw_function.IsNull());
+
+  Fragment instructions;
+
+  // Call NoSuchMethodError._throwNew static function.
+  instructions += NullConstant();
+  instructions += PushArgument();  // receiver
+
+  instructions += Constant(H.DartString("<unknown>", Heap::kOld));
+  instructions += PushArgument();  // memberName
+
+  instructions += IntConstant(-1);
+  instructions += PushArgument();  // invocation_type
+
+  instructions += NullConstant();
+  instructions += PushArgument();  // arguments
+
+  instructions += NullConstant();
+  instructions += PushArgument();  // argumentNames
+
+  instructions += NullConstant();
+  instructions += PushArgument();  // existingArgumentNames
+
+  instructions += StaticCall(TokenPosition::kNoSource, throw_function, 6);
+  // Leave "result" on the stack since callers expect it to be there (even
+  // though the function will result in an exception).
+
+  return instructions;
+}
+
+
+dart::RawFunction* FlowGraphBuilder::LookupMethodByMember(
+    Member* target,
+    const dart::String& method_name) {
+  Class* kernel_klass = Class::Cast(target->parent());
+  dart::Class& klass =
+      dart::Class::Handle(Z, H.LookupClassByKernelClass(kernel_klass));
+
+  dart::RawFunction* function = klass.LookupFunctionAllowPrivate(method_name);
+  ASSERT(function != Object::null());
+  return function;
+}
+
+
+LocalVariable* FlowGraphBuilder::MakeTemporary() {
+  char name[64];
+  intptr_t index = stack_->definition()->temp_index();
+  OS::SNPrint(name, 64, ":temp%" Pd, index);
+  LocalVariable* variable =
+      new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource,
+                            H.DartSymbol(name), Object::dynamic_type());
+  // Set the index relative to the base of the expression stack including
+  // outgoing arguments.
+  variable->set_index(parsed_function_->first_stack_local_index() -
+                      parsed_function_->num_stack_locals() -
+                      pending_argument_count_ - index);
+
+  // The value has uses as if it were a local variable.  Mark the definition
+  // as used so that its temp index will not be cleared (causing it to never
+  // be materialized in the expression stack).
+  stack_->definition()->set_ssa_temp_index(0);
+
+  return variable;
+}
+
+
+intptr_t FlowGraphBuilder::CurrentTryIndex() {
+  if (try_catch_block_ == NULL) {
+    return CatchClauseNode::kInvalidTryIndex;
+  } else {
+    return try_catch_block_->try_index();
+  }
+}
+
+
+dart::LocalVariable* FlowGraphBuilder::LookupVariable(
+    VariableDeclaration* var) {
+  LocalVariable* local = scopes_->locals.Lookup(var);
+  ASSERT(local != NULL);
+  return local;
+}
+
+
+void FlowGraphBuilder::SetTempIndex(Definition* definition) {
+  definition->set_temp_index(
+      stack_ == NULL ? 0 : stack_->definition()->temp_index() + 1);
+}
+
+
+void FlowGraphBuilder::Push(Definition* definition) {
+  SetTempIndex(definition);
+  Value::AddToList(new (Z) Value(definition), &stack_);
+}
+
+
+Value* FlowGraphBuilder::Pop() {
+  ASSERT(stack_ != NULL);
+  Value* value = stack_;
+  stack_ = value->next_use();
+  if (stack_ != NULL) stack_->set_previous_use(NULL);
+
+  value->set_next_use(NULL);
+  value->set_previous_use(NULL);
+  value->definition()->ClearSSATempIndex();
+  return value;
+}
+
+
+Fragment FlowGraphBuilder::Drop() {
+  ASSERT(stack_ != NULL);
+  Fragment instructions;
+  Definition* definition = stack_->definition();
+  // The SSA renaming implementation doesn't like [LoadLocal]s without a
+  // tempindex.
+  if (definition->HasSSATemp() || definition->IsLoadLocal()) {
+    instructions <<= new (Z) DropTempsInstr(1, NULL);
+  } else {
+    definition->ClearTempIndex();
+  }
+
+  Pop();
+  return instructions;
+}
+
+
+// TODO(27590): This method should be shared with
+// runtime/vm/object.cc:RecognizeArithmeticOp.
+Token::Kind FlowGraphBuilder::MethodKind(const dart::String& name) {
+  ASSERT(name.IsSymbol());
+  if (name.raw() == Symbols::Plus().raw()) {
+    return Token::kADD;
+  } else if (name.raw() == Symbols::Minus().raw()) {
+    return Token::kSUB;
+  } else if (name.raw() == Symbols::Star().raw()) {
+    return Token::kMUL;
+  } else if (name.raw() == Symbols::Slash().raw()) {
+    return Token::kDIV;
+  } else if (name.raw() == Symbols::TruncDivOperator().raw()) {
+    return Token::kTRUNCDIV;
+  } else if (name.raw() == Symbols::Percent().raw()) {
+    return Token::kMOD;
+  } else if (name.raw() == Symbols::BitOr().raw()) {
+    return Token::kBIT_OR;
+  } else if (name.raw() == Symbols::Ampersand().raw()) {
+    return Token::kBIT_AND;
+  } else if (name.raw() == Symbols::Caret().raw()) {
+    return Token::kBIT_XOR;
+  } else if (name.raw() == Symbols::LeftShiftOperator().raw()) {
+    return Token::kSHL;
+  } else if (name.raw() == Symbols::RightShiftOperator().raw()) {
+    return Token::kSHR;
+  } else if (name.raw() == Symbols::Tilde().raw()) {
+    return Token::kBIT_NOT;
+  } else if (name.raw() == Symbols::UnaryMinus().raw()) {
+    return Token::kNEGATE;
+  } else if (name.raw() == Symbols::EqualOperator().raw()) {
+    return Token::kEQ;
+  } else if (name.raw() == Symbols::Token(Token::kNE).raw()) {
+    return Token::kNE;
+  } else if (name.raw() == Symbols::LAngleBracket().raw()) {
+    return Token::kLT;
+  } else if (name.raw() == Symbols::RAngleBracket().raw()) {
+    return Token::kGT;
+  } else if (name.raw() == Symbols::LessEqualOperator().raw()) {
+    return Token::kLTE;
+  } else if (name.raw() == Symbols::GreaterEqualOperator().raw()) {
+    return Token::kGTE;
+  } else if (dart::Field::IsGetterName(name)) {
+    return Token::kGET;
+  } else if (dart::Field::IsSetterName(name)) {
+    return Token::kSET;
+  }
+  return Token::kILLEGAL;
+}
+
+
+void FlowGraphBuilder::InlineBailout(const char* reason) {
+  bool is_inlining = exit_collector_ != NULL;
+  if (is_inlining) {
+    parsed_function_->function().set_is_inlinable(false);
+    parsed_function_->Bailout("kernel::FlowGraphBuilder", reason);
+  }
+}
+
+
+FlowGraph* FlowGraphBuilder::BuildGraph() {
+  const dart::Function& function = parsed_function_->function();
+
+  if (function.IsConstructorClosureFunction()) return NULL;
+
+  dart::Class& klass =
+      dart::Class::Handle(zone_, parsed_function_->function().Owner());
+
+  Function& outermost_function = Function::Handle(Z);
+  TreeNode* outermost_node = NULL;
+  Class* kernel_klass = NULL;
+  DiscoverEnclosingElements(Z, function, &outermost_function, &outermost_node,
+                            &kernel_klass);
+
+  // Mark that we are using [klass]/[kernell_klass] as active class.  Resolving
+  // of type parameters will get resolved via [kernell_klass] unless we are
+  // nested inside a static factory in which case we will use [member].
+  ActiveClassScope active_class_scope(&active_class_, kernel_klass, &klass);
+  Member* member = ((outermost_node != NULL) && outermost_node->IsMember())
+                       ? Member::Cast(outermost_node)
+                       : NULL;
+  ActiveMemberScope active_member(&active_class_, member);
+
+  // The IR builder will create its own local variables and scopes, and it
+  // will not need an AST.  The code generator will assume that there is a
+  // local variable stack slot allocated for the current context and (I
+  // think) that the runtime will expect it to be at a fixed offset which
+  // requires allocating an unused expression temporary variable.
+  scopes_ = parsed_function_->EnsureKernelScopes();
+
+  switch (function.kind()) {
+    case RawFunction::kClosureFunction:
+    case RawFunction::kRegularFunction:
+    case RawFunction::kGetterFunction:
+    case RawFunction::kSetterFunction: {
+      FunctionNode* kernel_function = node_->IsProcedure()
+                                          ? Procedure::Cast(node_)->function()
+                                          : FunctionNode::Cast(node_);
+      ActiveFunctionScope active_function_scope(&active_class_,
+                                                kernel_function);
+      return function.IsImplicitClosureFunction()
+                 ? BuildGraphOfImplicitClosureFunction(kernel_function,
+                                                       function)
+                 : BuildGraphOfFunction(kernel_function);
+    }
+    case RawFunction::kConstructor: {
+      bool is_factory = function.IsFactory();
+      if (is_factory) {
+        Procedure* procedure = Procedure::Cast(node_);
+        FunctionNode* function = procedure->function();
+        ActiveFunctionScope active_function_scope(&active_class_, function);
+        return BuildGraphOfFunction(function, NULL);
+      } else {
+        Constructor* constructor = Constructor::Cast(node_);
+        FunctionNode* function = constructor->function();
+        ActiveFunctionScope active_function_scope(&active_class_, function);
+        return BuildGraphOfFunction(function, constructor);
+      }
+    }
+    case RawFunction::kImplicitGetter:
+    case RawFunction::kImplicitStaticFinalGetter:
+    case RawFunction::kImplicitSetter: {
+      Field* field = Field::Cast(node_);
+      return IsStaticInitializer(function, Z)
+                 ? BuildGraphOfStaticFieldInitializer(field)
+                 : BuildGraphOfFieldAccessor(field, scopes_->setter_value);
+    }
+    case RawFunction::kMethodExtractor:
+      return BuildGraphOfMethodExtractor(function);
+    case RawFunction::kNoSuchMethodDispatcher:
+      return BuildGraphOfNoSuchMethodDispatcher(function);
+    case RawFunction::kInvokeFieldDispatcher:
+      return BuildGraphOfInvokeFieldDispatcher(function);
+    case RawFunction::kSignatureFunction:
+    case RawFunction::kIrregexpFunction:
+      break;
+  }
+  UNREACHABLE();
+  return NULL;
+}
+
+
+FlowGraph* FlowGraphBuilder::BuildGraphOfFunction(FunctionNode* function,
+                                                  Constructor* constructor) {
+  const Function& dart_function = parsed_function_->function();
+  TargetEntryInstr* normal_entry = BuildTargetEntry();
+  graph_entry_ =
+      new (Z) GraphEntryInstr(*parsed_function_, normal_entry, osr_id_);
+
+  SetupDefaultParameterValues(function);
+
+  Fragment body;
+  if (!dart_function.is_native()) body += CheckStackOverflowInPrologue();
+  intptr_t context_size =
+      parsed_function_->node_sequence()->scope()->num_context_variables();
+  if (context_size > 0) {
+    body += PushContext(context_size);
+    LocalVariable* context = MakeTemporary();
+
+    // Copy captured parameters from the stack into the context.
+    LocalScope* scope = parsed_function_->node_sequence()->scope();
+    intptr_t parameter_count = dart_function.NumParameters();
+    intptr_t parameter_index = parsed_function_->first_parameter_index();
+    for (intptr_t i = 0; i < parameter_count; ++i, --parameter_index) {
+      LocalVariable* variable = scope->VariableAt(i);
+      if (variable->is_captured()) {
+        // There is no LocalVariable describing the on-stack parameter so
+        // create one directly and use the same type.
+        LocalVariable* parameter = new (Z)
+            LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource,
+                          Symbols::TempParam(), variable->type());
+        parameter->set_index(parameter_index);
+        // Mark the stack variable so it will be ignored by the code for
+        // try/catch.
+        parameter->set_is_captured_parameter(true);
+
+        // Copy the parameter from the stack to the context.  Overwrite it
+        // with a null constant on the stack so the original value is
+        // eligible for garbage collection.
+        body += LoadLocal(context);
+        body += LoadLocal(parameter);
+        body += StoreInstanceField(Context::variable_offset(variable->index()));
+        body += NullConstant();
+        body += StoreLocal(parameter);
+        body += Drop();
+      }
+    }
+    body += Drop();  // The context.
+  }
+  if (constructor != NULL) {
+    // TODO(27590): Currently the [VariableDeclaration]s from the
+    // initializers will be visible inside the entire body of the constructor.
+    // We should make a separate scope for them.
+    Class* kernel_klass = Class::Cast(constructor->parent());
+    body += TranslateInitializers(kernel_klass, &constructor->initializers());
+  }
+
+  // The specification defines the result of `a == b` to be:
+  //
+  //   a) if either side is `null` then the result is `identical(a, b)`.
+  //   b) else the result is `a.operator==(b)`
+  //
+  // For user-defined implementations of `operator==` we need therefore
+  // implement the handling of a).
+  //
+  // The default `operator==` implementation in `Object` is implemented in terms
+  // of identical (which we assume here!) which means that case a) is actually
+  // included in b).  So we just use the normal implementation in the body.
+  if ((dart_function.NumParameters() == 2) &&
+      (dart_function.name() == Symbols::EqualOperator().raw()) &&
+      (dart_function.Owner() != I->object_store()->object_class())) {
+    LocalVariable* parameter =
+        LookupVariable(function->positional_parameters()[0]);
+
+    TargetEntryInstr* null_entry;
+    TargetEntryInstr* non_null_entry;
+
+    body += LoadLocal(parameter);
+    body += BranchIfNull(&null_entry, &non_null_entry);
+
+    // The argument was `null` and the receiver is not the null class (we only
+    // go into this branch for user-defined == operators) so we can return
+    // false.
+    Fragment null_fragment(null_entry);
+    null_fragment += Constant(Bool::False());
+    null_fragment += Return();
+
+    body = Fragment(body.entry, non_null_entry);
+  }
+
+  if (dart_function.is_native()) {
+    body += NativeFunctionBody(function, dart_function);
+  } else if (function->body() != NULL) {
+    body += TranslateStatement(function->body());
+  }
+  if (body.is_open()) {
+    body += NullConstant();
+    body += Return();
+  }
+
+  // If functions body contains any yield points build switch statement that
+  // selects a continuation point based on the value of :await_jump_var.
+  if (!yield_continuations_.is_empty()) {
+    // The code we are building will be executed right after we enter
+    // the function and before any nested contexts are allocated.
+    // Reset current context_depth_ to match this.
+    intptr_t current_context_depth = context_depth_;
+    context_depth_ = scopes_->yield_jump_variable->owner()->context_level();
+
+    // Prepend an entry corresponding to normal entry to the function.
+    yield_continuations_.InsertAt(
+        0, YieldContinuation(new (Z) DropTempsInstr(0, NULL),
+                             CatchClauseNode::kInvalidTryIndex));
+    yield_continuations_[0].entry->LinkTo(body.entry);
+
+    // Build a switch statement.
+    Fragment dispatch;
+
+    // Load :await_jump_var into a temporary.
+    dispatch += LoadLocal(scopes_->yield_jump_variable);
+    dispatch += StoreLocal(scopes_->switch_variable);
+    dispatch += Drop();
+
+    BlockEntryInstr* block = NULL;
+    for (intptr_t i = 0; i < yield_continuations_.length(); i++) {
+      if (i == 1) {
+        // This is not a normal entry but a resumption.  Restore
+        // :current_context_var from :await_ctx_var.
+        // Note: after this point context_depth_ does not match current context
+        // depth so we should not access any local variables anymore.
+        dispatch += LoadLocal(scopes_->yield_context_variable);
+        dispatch += StoreLocal(parsed_function_->current_context_var());
+        dispatch += Drop();
+      }
+      if (i == (yield_continuations_.length() - 1)) {
+        // We reached the last possility, no need to build more ifs.
+        // Coninue to the last continuation.
+        // Note: continuations start with nop DropTemps instruction
+        // which acts like an anchor, so we need to skip it.
+        block->set_try_index(yield_continuations_[i].try_index);
+        dispatch <<= yield_continuations_[i].entry->next();
+        break;
+      }
+
+      // Build comparison:
+      //
+      //   if (:await_ctx_var == i) {
+      //     -> yield_continuations_[i]
+      //   } else ...
+      //
+      TargetEntryInstr* then;
+      TargetEntryInstr* otherwise;
+      dispatch += LoadLocal(scopes_->switch_variable);
+      dispatch += IntConstant(i);
+      dispatch += BranchIfStrictEqual(&then, &otherwise);
+
+      // True branch is linked to appropriate continuation point.
+      // Note: continuations start with nop DropTemps instruction
+      // which acts like an anchor, so we need to skip it.
+      then->LinkTo(yield_continuations_[i].entry->next());
+      then->set_try_index(yield_continuations_[i].try_index);
+
+      // False branch will contain the next comparison.
+      dispatch = Fragment(dispatch.entry, otherwise);
+      block = otherwise;
+    }
+    body = dispatch;
+
+    context_depth_ = current_context_depth;
+  }
+  normal_entry->LinkTo(body.entry);
+
+  // When compiling for OSR, use a depth first search to prune instructions
+  // unreachable from the OSR entry. Catch entries are always considered
+  // reachable, even if they become unreachable after OSR.
+  if (osr_id_ != Compiler::kNoOSRDeoptId) {
+    BitVector* block_marks = new (Z) BitVector(Z, next_block_id_);
+    bool found = graph_entry_->PruneUnreachable(graph_entry_, NULL, osr_id_,
+                                                block_marks);
+    ASSERT(found);
+  }
+  return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1);
+}
+
+
+Fragment FlowGraphBuilder::NativeFunctionBody(FunctionNode* kernel_function,
+                                              const Function& function) {
+  ASSERT(function.is_native());
+  // We explicitly build the graph for native functions in the same way that the
+  // from-source backend does.  We should find a way to have a single component
+  // to build these graphs so that this code is not duplicated.
+
+  Fragment body;
+  MethodRecognizer::Kind kind = MethodRecognizer::RecognizeKind(function);
+  switch (kind) {
+    case MethodRecognizer::kObjectEquals:
+      body += LoadLocal(scopes_->this_variable);
+      body += LoadLocal(
+          LookupVariable(kernel_function->positional_parameters()[0]));
+      body += StrictCompare(Token::kEQ_STRICT);
+      break;
+    case MethodRecognizer::kStringBaseLength:
+    case MethodRecognizer::kStringBaseIsEmpty:
+      // Depending on FLAG_support_externalizable_strings, treat string length
+      // loads as mutable so that the class check that precedes them will not be
+      // hoisted.  This is unsafe because string externalization can change the
+      // class.
+      body += LoadLocal(scopes_->this_variable);
+      body += LoadNativeField(MethodRecognizer::kStringBaseLength,
+                              dart::String::length_offset(),
+                              Type::ZoneHandle(Z, Type::SmiType()), kSmiCid,
+                              !FLAG_support_externalizable_strings);
+      if (kind == MethodRecognizer::kStringBaseIsEmpty) {
+        body += IntConstant(0);
+        body += StrictCompare(Token::kEQ_STRICT);
+      }
+      break;
+    case MethodRecognizer::kGrowableArrayLength:
+      body += LoadLocal(scopes_->this_variable);
+      body += LoadNativeField(kind, GrowableObjectArray::length_offset(),
+                              Type::ZoneHandle(Z, Type::SmiType()), kSmiCid);
+      break;
+    case MethodRecognizer::kObjectArrayLength:
+    case MethodRecognizer::kImmutableArrayLength:
+      body += LoadLocal(scopes_->this_variable);
+      body +=
+          LoadNativeField(kind, Array::length_offset(),
+                          Type::ZoneHandle(Z, Type::SmiType()), kSmiCid, true);
+      break;
+    case MethodRecognizer::kTypedDataLength:
+      body += LoadLocal(scopes_->this_variable);
+      body +=
+          LoadNativeField(kind, TypedData::length_offset(),
+                          Type::ZoneHandle(Z, Type::SmiType()), kSmiCid, true);
+      break;
+    case MethodRecognizer::kClassIDgetID:
+      body += LoadLocal(
+          LookupVariable(kernel_function->positional_parameters()[0]));
+      body += LoadClassId();
+      break;
+    case MethodRecognizer::kGrowableArrayCapacity:
+      body += LoadLocal(scopes_->this_variable);
+      body += LoadField(Array::data_offset(), kArrayCid);
+      body += LoadNativeField(MethodRecognizer::kObjectArrayLength,
+                              Array::length_offset(),
+                              Type::ZoneHandle(Z, Type::SmiType()), kSmiCid);
+      break;
+    case MethodRecognizer::kObjectArrayAllocate:
+      body += LoadLocal(scopes_->type_arguments_variable);
+      body += LoadLocal(
+          LookupVariable(kernel_function->positional_parameters()[0]));
+      body += CreateArray();
+      break;
+    case MethodRecognizer::kBigint_getDigits:
+      body += LoadLocal(scopes_->this_variable);
+      body += LoadNativeField(kind, Bigint::digits_offset(),
+                              Object::dynamic_type(), kTypedDataUint32ArrayCid);
+      break;
+    case MethodRecognizer::kBigint_getUsed:
+      body += LoadLocal(scopes_->this_variable);
+      body += LoadNativeField(kind, Bigint::used_offset(),
+                              Type::ZoneHandle(Z, Type::SmiType()), kSmiCid);
+      break;
+    case MethodRecognizer::kLinkedHashMap_getIndex:
+      body += LoadLocal(scopes_->this_variable);
+      body += LoadNativeField(kind, LinkedHashMap::index_offset(),
+                              Object::dynamic_type(), kDynamicCid);
+      break;
+    case MethodRecognizer::kLinkedHashMap_setIndex:
+      body += LoadLocal(scopes_->this_variable);
+      body += LoadLocal(
+          LookupVariable(kernel_function->positional_parameters()[0]));
+      body += StoreInstanceField(LinkedHashMap::index_offset());
+      body += NullConstant();
+      break;
+    case MethodRecognizer::kLinkedHashMap_getData:
+      body += LoadLocal(scopes_->this_variable);
+      body += LoadNativeField(kind, LinkedHashMap::data_offset(),
+                              Object::dynamic_type(), kArrayCid);
+      break;
+    case MethodRecognizer::kLinkedHashMap_setData:
+      body += LoadLocal(scopes_->this_variable);
+      body += LoadLocal(
+          LookupVariable(kernel_function->positional_parameters()[0]));
+      body += StoreInstanceField(LinkedHashMap::data_offset());
+      body += NullConstant();
+      break;
+    case MethodRecognizer::kLinkedHashMap_getHashMask:
+      body += LoadLocal(scopes_->this_variable);
+      body += LoadNativeField(kind, LinkedHashMap::hash_mask_offset(),
+                              Type::ZoneHandle(Z, Type::SmiType()), kSmiCid);
+      break;
+    case MethodRecognizer::kLinkedHashMap_setHashMask:
+      body += LoadLocal(scopes_->this_variable);
+      body += LoadLocal(
+          LookupVariable(kernel_function->positional_parameters()[0]));
+      body += StoreInstanceField(LinkedHashMap::hash_mask_offset(),
+                                 kNoStoreBarrier);
+      body += NullConstant();
+      break;
+    case MethodRecognizer::kLinkedHashMap_getUsedData:
+      body += LoadLocal(scopes_->this_variable);
+      body += LoadNativeField(kind, LinkedHashMap::used_data_offset(),
+                              Type::ZoneHandle(Z, Type::SmiType()), kSmiCid);
+      break;
+    case MethodRecognizer::kLinkedHashMap_setUsedData:
+      body += LoadLocal(scopes_->this_variable);
+      body += LoadLocal(
+          LookupVariable(kernel_function->positional_parameters()[0]));
+      body += StoreInstanceField(LinkedHashMap::used_data_offset(),
+                                 kNoStoreBarrier);
+      body += NullConstant();
+      break;
+    case MethodRecognizer::kLinkedHashMap_getDeletedKeys:
+      body += LoadLocal(scopes_->this_variable);
+      body += LoadNativeField(kind, LinkedHashMap::deleted_keys_offset(),
+                              Type::ZoneHandle(Z, Type::SmiType()), kSmiCid);
+      break;
+    case MethodRecognizer::kLinkedHashMap_setDeletedKeys:
+      body += LoadLocal(scopes_->this_variable);
+      body += LoadLocal(
+          LookupVariable(kernel_function->positional_parameters()[0]));
+      body += StoreInstanceField(LinkedHashMap::deleted_keys_offset(),
+                                 kNoStoreBarrier);
+      body += NullConstant();
+      break;
+    case MethodRecognizer::kBigint_getNeg:
+      body += LoadLocal(scopes_->this_variable);
+      body += LoadNativeField(kind, Bigint::neg_offset(),
+                              Type::ZoneHandle(Z, Type::BoolType()), kBoolCid);
+      break;
+    default: {
+      dart::String& name = dart::String::ZoneHandle(Z, function.native_name());
+      body += NativeCall(&name, &function);
+      break;
+    }
+  }
+  return body + Return();
+}
+
+
+FlowGraph* FlowGraphBuilder::BuildGraphOfFieldAccessor(
+    Field* kernel_field,
+    LocalVariable* setter_value) {
+  const dart::Function& function = parsed_function_->function();
+
+  bool is_setter = function.IsImplicitSetterFunction();
+  bool is_method = !function.IsStaticFunction();
+  dart::Field& field =
+      dart::Field::ZoneHandle(Z, H.LookupFieldByKernelField(kernel_field));
+
+  TargetEntryInstr* normal_entry = BuildTargetEntry();
+  graph_entry_ = new (Z)
+      GraphEntryInstr(*parsed_function_, normal_entry, Compiler::kNoOSRDeoptId);
+
+  Fragment body(normal_entry);
+  if (is_setter) {
+    if (is_method) {
+      body += LoadLocal(scopes_->this_variable);
+      body += LoadLocal(setter_value);
+      body += StoreInstanceFieldGuarded(field);
+    } else {
+      body += LoadLocal(setter_value);
+      body += StoreStaticField(field);
+    }
+    body += NullConstant();
+  } else if (is_method) {
+    body += LoadLocal(scopes_->this_variable);
+    body += LoadField(field);
+  } else if (field.is_const()) {
+    // If the parser needs to know the value of an uninitialized constant field
+    // it will set the value to the transition sentinel (used to detect circular
+    // initialization) and then call the implicit getter.  Thus, the getter
+    // cannot contain the InitStaticField instruction that normal static getters
+    // contain because it would detect spurious circular initialization when it
+    // checks for the transition sentinel.
+    Expression* initializer = kernel_field->initializer();
+    ASSERT(initializer != NULL);
+    body += Constant(constant_evaluator_.EvaluateExpression(initializer));
+  } else {
+    // The field always has an initializer because static fields without
+    // initializers are initialized eagerly and do not have implicit getters.
+    ASSERT(field.has_initializer());
+    body += Constant(field);
+    body += InitStaticField(field);
+    body += Constant(field);
+    body += LoadStaticField();
+  }
+  body += Return();
+
+  return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1);
+}
+
+
+FlowGraph* FlowGraphBuilder::BuildGraphOfStaticFieldInitializer(
+    Field* kernel_field) {
+  ASSERT(kernel_field->IsStatic());
+
+  Expression* initializer = kernel_field->initializer();
+
+  TargetEntryInstr* normal_entry = BuildTargetEntry();
+  graph_entry_ = new (Z)
+      GraphEntryInstr(*parsed_function_, normal_entry, Compiler::kNoOSRDeoptId);
+
+  Fragment body(normal_entry);
+  body += CheckStackOverflowInPrologue();
+  if (kernel_field->IsConst()) {
+    body += Constant(constant_evaluator_.EvaluateExpression(initializer));
+  } else {
+    body += TranslateExpression(initializer);
+  }
+  body += Return();
+
+  return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1);
+}
+
+
+Fragment FlowGraphBuilder::BuildImplicitClosureCreation(
+    const Function& target) {
+  Fragment fragment;
+  const dart::Class& closure_class =
+      dart::Class::ZoneHandle(Z, I->object_store()->closure_class());
+  fragment += AllocateObject(closure_class, target);
+  LocalVariable* closure = MakeTemporary();
+
+  // Allocate a context that closes over `this`.
+  fragment += AllocateContext(1);
+  LocalVariable* context = MakeTemporary();
+
+  // Store the function and the context in the closure.
+  fragment += LoadLocal(closure);
+  fragment += Constant(target);
+  fragment += StoreInstanceField(Closure::function_offset());
+
+  fragment += LoadLocal(closure);
+  fragment += LoadLocal(context);
+  fragment += StoreInstanceField(Closure::context_offset());
+
+  // The context is on top of the operand stack.  Store `this`.  The context
+  // doesn't need a parent pointer because it doesn't close over anything
+  // else.
+  fragment += LoadLocal(scopes_->this_variable);
+  fragment += StoreInstanceField(Context::variable_offset(0));
+
+  return fragment;
+}
+
+
+Fragment FlowGraphBuilder::GuardFieldLength(const dart::Field& field,
+                                            intptr_t deopt_id) {
+  return Fragment(new (Z) GuardFieldLengthInstr(Pop(), field, deopt_id));
+}
+
+
+Fragment FlowGraphBuilder::GuardFieldClass(const dart::Field& field,
+                                           intptr_t deopt_id) {
+  return Fragment(new (Z) GuardFieldClassInstr(Pop(), field, deopt_id));
+}
+
+
+FlowGraph* FlowGraphBuilder::BuildGraphOfMethodExtractor(
+    const Function& method) {
+  // A method extractor is the implicit getter for a method.
+  const Function& function =
+      Function::ZoneHandle(Z, method.extracted_method_closure());
+
+  TargetEntryInstr* normal_entry = BuildTargetEntry();
+  graph_entry_ = new (Z)
+      GraphEntryInstr(*parsed_function_, normal_entry, Compiler::kNoOSRDeoptId);
+  Fragment body(normal_entry);
+  body += CheckStackOverflowInPrologue();
+  body += BuildImplicitClosureCreation(function);
+  body += Return();
+
+  return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1);
+}
+
+
+FlowGraph* FlowGraphBuilder::BuildGraphOfImplicitClosureFunction(
+    FunctionNode* kernel_function,
+    const Function& function) {
+  const Function& target = Function::ZoneHandle(Z, function.parent_function());
+
+  TargetEntryInstr* normal_entry = BuildTargetEntry();
+  graph_entry_ = new (Z)
+      GraphEntryInstr(*parsed_function_, normal_entry, Compiler::kNoOSRDeoptId);
+  SetupDefaultParameterValues(kernel_function);
+
+  Fragment body(normal_entry);
+  body += CheckStackOverflowInPrologue();
+
+  // Load all the arguments.
+  if (!target.is_static()) {
+    // The context has a fixed shape: a single variable which is the
+    // closed-over receiver.
+    body += LoadLocal(parsed_function_->current_context_var());
+    body += LoadField(Context::variable_offset(0));
+    body += PushArgument();
+  }
+  intptr_t positional_argument_count =
+      kernel_function->positional_parameters().length();
+  for (intptr_t i = 0; i < positional_argument_count; i++) {
+    body +=
+        LoadLocal(LookupVariable(kernel_function->positional_parameters()[i]));
+    body += PushArgument();
+  }
+  intptr_t named_argument_count = kernel_function->named_parameters().length();
+  Array& argument_names = Array::ZoneHandle(Z);
+  if (named_argument_count > 0) {
+    argument_names = Array::New(named_argument_count);
+    for (intptr_t i = 0; i < named_argument_count; i++) {
+      VariableDeclaration* variable = kernel_function->named_parameters()[i];
+      body += LoadLocal(LookupVariable(variable));
+      body += PushArgument();
+      argument_names.SetAt(i, H.DartSymbol(variable->name()));
+    }
+  }
+  // Forward them to the target.
+  intptr_t argument_count = positional_argument_count + named_argument_count;
+  if (!target.is_static()) ++argument_count;
+  body += StaticCall(TokenPosition::kNoSource, target, argument_count,
+                     argument_names);
+
+  // Return the result.
+  body += Return();
+
+  return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1);
+}
+
+
+FlowGraph* FlowGraphBuilder::BuildGraphOfNoSuchMethodDispatcher(
+    const Function& function) {
+  // This function is specialized for a receiver class, a method name, and
+  // the arguments descriptor at a call site.
+
+  TargetEntryInstr* normal_entry = BuildTargetEntry();
+  graph_entry_ = new (Z)
+      GraphEntryInstr(*parsed_function_, normal_entry, Compiler::kNoOSRDeoptId);
+
+  // The backend will expect an array of default values for all the named
+  // parameters, even if they are all known to be passed at the call site
+  // because the call site matches the arguments descriptor.  Use null for
+  // the default values.
+  const Array& descriptor_array =
+      Array::ZoneHandle(Z, function.saved_args_desc());
+  ArgumentsDescriptor descriptor(descriptor_array);
+  ZoneGrowableArray<const Instance*>* default_values =
+      new ZoneGrowableArray<const Instance*>(Z, descriptor.NamedCount());
+  for (intptr_t i = 0; i < descriptor.NamedCount(); ++i) {
+    default_values->Add(&Object::null_instance());
+  }
+  parsed_function_->set_default_parameter_values(default_values);
+
+  Fragment body(normal_entry);
+  body += CheckStackOverflowInPrologue();
+
+  // The receiver is the first argument to noSuchMethod, and it is the first
+  // argument passed to the dispatcher function.
+  LocalScope* scope = parsed_function_->node_sequence()->scope();
+  body += LoadLocal(scope->VariableAt(0));
+  body += PushArgument();
+
+  // The second argument to noSuchMethod is an invocation mirror.  Push the
+  // arguments for allocating the invocation mirror.  First, the name.
+  body += Constant(dart::String::ZoneHandle(Z, function.name()));
+  body += PushArgument();
+
+  // Second, the arguments descriptor.
+  body += Constant(descriptor_array);
+  body += PushArgument();
+
+  // Third, an array containing the original arguments.  Create it and fill
+  // it in.
+  body += Constant(TypeArguments::ZoneHandle(Z, TypeArguments::null()));
+  body += IntConstant(descriptor.Count());
+  body += CreateArray();
+  LocalVariable* array = MakeTemporary();
+  for (intptr_t i = 0; i < descriptor.PositionalCount(); ++i) {
+    body += LoadLocal(array);
+    body += IntConstant(i);
+    body += LoadLocal(scope->VariableAt(i));
+    body += StoreIndexed(kArrayCid);
+    body += Drop();
+  }
+  dart::String& name = dart::String::Handle(Z);
+  for (intptr_t i = 0; i < descriptor.NamedCount(); ++i) {
+    intptr_t parameter_index = descriptor.PositionalCount() + i;
+    name = descriptor.NameAt(i);
+    name = dart::Symbols::New(H.thread(), name);
+    body += LoadLocal(array);
+    body += IntConstant(descriptor.PositionAt(i));
+    body += LoadLocal(scope->VariableAt(parameter_index));
+    body += StoreIndexed(kArrayCid);
+    body += Drop();
+  }
+  body += PushArgument();
+
+  // Fourth, false indicating this is not a super NoSuchMethod.
+  body += Constant(Bool::False());
+  body += PushArgument();
+
+  const dart::Class& mirror_class = dart::Class::Handle(
+      Z, dart::Library::LookupCoreClass(Symbols::InvocationMirror()));
+  ASSERT(!mirror_class.IsNull());
+  const Function& allocation_function = Function::ZoneHandle(
+      Z, mirror_class.LookupStaticFunction(dart::Library::PrivateCoreLibName(
+             Symbols::AllocateInvocationMirror())));
+  ASSERT(!allocation_function.IsNull());
+  body += StaticCall(TokenPosition::kMinSource, allocation_function, 4);
+  body += PushArgument();  // For the call to noSuchMethod.
+
+  ArgumentsDescriptor two_arguments(
+      Array::Handle(Z, ArgumentsDescriptor::New(2)));
+  Function& no_such_method =
+      Function::ZoneHandle(Z, Resolver::ResolveDynamicForReceiverClass(
+                                  dart::Class::Handle(Z, function.Owner()),
+                                  Symbols::NoSuchMethod(), two_arguments));
+  if (no_such_method.IsNull()) {
+    // If noSuchMethod is not found on the receiver class, call
+    // Object.noSuchMethod.
+    no_such_method = Resolver::ResolveDynamicForReceiverClass(
+        dart::Class::Handle(Z, I->object_store()->object_class()),
+        Symbols::NoSuchMethod(), two_arguments);
+  }
+  body += StaticCall(TokenPosition::kMinSource, no_such_method, 2);
+  body += Return();
+
+  return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1);
+}
+
+
+FlowGraph* FlowGraphBuilder::BuildGraphOfInvokeFieldDispatcher(
+    const Function& function) {
+  // Find the name of the field we should dispatch to.
+  const dart::Class& owner = dart::Class::Handle(Z, function.Owner());
+  ASSERT(!owner.IsNull());
+  const dart::String& field_name = dart::String::Handle(Z, function.name());
+  const dart::String& getter_name = dart::String::ZoneHandle(
+      Z,
+      Symbols::New(H.thread(), dart::String::Handle(
+                                   Z, dart::Field::GetterSymbol(field_name))));
+
+  // Determine if this is `class Closure { get call => this; }`
+  const dart::Class& closure_class =
+      dart::Class::Handle(Z, I->object_store()->closure_class());
+  const bool is_closure_call = (owner.raw() == closure_class.raw()) &&
+                               field_name.Equals(Symbols::Call());
+
+  // Set default parameters & construct argument names array.
+  //
+  // The backend will expect an array of default values for all the named
+  // parameters, even if they are all known to be passed at the call site
+  // because the call site matches the arguments descriptor.  Use null for
+  // the default values.
+  const Array& descriptor_array =
+      Array::ZoneHandle(Z, function.saved_args_desc());
+  ArgumentsDescriptor descriptor(descriptor_array);
+  const Array& argument_names =
+      Array::ZoneHandle(Z, Array::New(descriptor.NamedCount(), Heap::kOld));
+  ZoneGrowableArray<const Instance*>* default_values =
+      new ZoneGrowableArray<const Instance*>(Z, descriptor.NamedCount());
+  dart::String& string_handle = dart::String::Handle(Z);
+  for (intptr_t i = 0; i < descriptor.NamedCount(); ++i) {
+    default_values->Add(&Object::null_instance());
+    string_handle = descriptor.NameAt(i);
+    argument_names.SetAt(i, string_handle);
+  }
+  parsed_function_->set_default_parameter_values(default_values);
+
+  TargetEntryInstr* normal_entry = BuildTargetEntry();
+  graph_entry_ = new (Z)
+      GraphEntryInstr(*parsed_function_, normal_entry, Compiler::kNoOSRDeoptId);
+
+  Fragment body(normal_entry);
+  body += CheckStackOverflowInPrologue();
+
+  LocalScope* scope = parsed_function_->node_sequence()->scope();
+
+  LocalVariable* closure = NULL;
+  if (is_closure_call) {
+    closure = scope->VariableAt(0);
+
+    // The closure itself is the first argument.
+    body += LoadLocal(closure);
+  } else {
+    // Invoke the getter to get the field value.
+    body += LoadLocal(scope->VariableAt(0));
+    body += PushArgument();
+    body +=
+        InstanceCall(TokenPosition::kMinSource, getter_name, Token::kGET, 1);
+  }
+
+  body += PushArgument();
+
+  // Push all arguments onto the stack.
+  intptr_t pos = 1;
+  for (; pos < descriptor.Count(); pos++) {
+    body += LoadLocal(scope->VariableAt(pos));
+    body += PushArgument();
+  }
+
+  if (is_closure_call) {
+    // Lookup the function in the closure.
+    body += LoadLocal(closure);
+    body += LoadField(Closure::function_offset());
+
+    body += ClosureCall(descriptor.Count(), argument_names);
+  } else {
+    body += InstanceCall(TokenPosition::kMinSource, Symbols::Call(),
+                         Token::kILLEGAL, descriptor.Count(), argument_names);
+  }
+
+  body += Return();
+
+  return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1);
+}
+
+
+void FlowGraphBuilder::SetupDefaultParameterValues(FunctionNode* function) {
+  intptr_t num_optional_parameters =
+      parsed_function_->function().NumOptionalParameters();
+  if (num_optional_parameters > 0) {
+    ZoneGrowableArray<const Instance*>* default_values =
+        new ZoneGrowableArray<const Instance*>(Z, num_optional_parameters);
+
+    if (parsed_function_->function().HasOptionalNamedParameters()) {
+      ASSERT(!parsed_function_->function().HasOptionalPositionalParameters());
+      for (intptr_t i = 0; i < num_optional_parameters; i++) {
+        VariableDeclaration* variable = function->named_parameters()[i];
+        Instance* default_value;
+        if (variable->initializer() != NULL) {
+          default_value =
+              &constant_evaluator_.EvaluateExpression(variable->initializer());
+        } else {
+          default_value = &Instance::ZoneHandle(Z, Instance::null());
+        }
+        default_values->Add(default_value);
+      }
+    } else {
+      ASSERT(parsed_function_->function().HasOptionalPositionalParameters());
+      intptr_t required = function->required_parameter_count();
+      for (intptr_t i = 0; i < num_optional_parameters; i++) {
+        VariableDeclaration* variable =
+            function->positional_parameters()[required + i];
+        Instance* default_value;
+        if (variable->initializer() != NULL) {
+          default_value =
+              &constant_evaluator_.EvaluateExpression(variable->initializer());
+        } else {
+          default_value = &Instance::ZoneHandle(Z, Instance::null());
+        }
+        default_values->Add(default_value);
+      }
+    }
+    parsed_function_->set_default_parameter_values(default_values);
+  }
+}
+
+
+TargetEntryInstr* FlowGraphBuilder::BuildTargetEntry() {
+  return new (Z) TargetEntryInstr(AllocateBlockId(), CurrentTryIndex());
+}
+
+
+JoinEntryInstr* FlowGraphBuilder::BuildJoinEntry() {
+  return new (Z) JoinEntryInstr(AllocateBlockId(), CurrentTryIndex());
+}
+
+
+Fragment FlowGraphBuilder::TranslateInitializers(
+    Class* kernel_klass,
+    List<Initializer>* initializers) {
+  Fragment instructions;
+
+  // These come from:
+  //   class A {
+  //     var x = (expr);
+  //   }
+  for (intptr_t i = 0; i < kernel_klass->fields().length(); i++) {
+    Field* kernel_field = kernel_klass->fields()[i];
+    Expression* init = kernel_field->initializer();
+    if (!kernel_field->IsStatic() && init != NULL) {
+      dart::Field& field =
+          dart::Field::ZoneHandle(Z, H.LookupFieldByKernelField(kernel_field));
+
+      EnterScope(kernel_field);
+      instructions += LoadLocal(scopes_->this_variable);
+      instructions += TranslateExpression(init);
+      instructions += StoreInstanceFieldGuarded(field);
+      ExitScope(kernel_field);
+    }
+  }
+
+  // These to come from:
+  //   class A {
+  //     var x;
+  //     var y;
+  //     A(this.x) : super(expr), y = (expr);
+  //   }
+  for (intptr_t i = 0; i < initializers->length(); i++) {
+    Initializer* initializer = (*initializers)[i];
+    if (initializer->IsFieldInitializer()) {
+      FieldInitializer* init = FieldInitializer::Cast(initializer);
+      dart::Field& field =
+          dart::Field::ZoneHandle(Z, H.LookupFieldByKernelField(init->field()));
+
+      instructions += LoadLocal(scopes_->this_variable);
+      instructions += TranslateExpression(init->value());
+      instructions += StoreInstanceFieldGuarded(field);
+    } else if (initializer->IsSuperInitializer()) {
+      SuperInitializer* init = SuperInitializer::Cast(initializer);
+
+      instructions += LoadLocal(scopes_->this_variable);
+      instructions += PushArgument();
+
+      ASSERT(init->arguments()->types().length() == 0);
+      Array& argument_names = Array::ZoneHandle(Z);
+      instructions += TranslateArguments(init->arguments(), &argument_names);
+
+      const Function& target = Function::ZoneHandle(
+          Z, H.LookupConstructorByKernelConstructor(init->target()));
+      intptr_t argument_count = init->arguments()->count() + 1;
+      instructions += StaticCall(TokenPosition::kNoSource, target,
+                                 argument_count, argument_names);
+      instructions += Drop();
+    } else if (initializer->IsRedirectingInitializer()) {
+      RedirectingInitializer* init = RedirectingInitializer::Cast(initializer);
+
+      instructions += LoadLocal(scopes_->this_variable);
+      instructions += PushArgument();
+
+      ASSERT(init->arguments()->types().length() == 0);
+      Array& argument_names = Array::ZoneHandle(Z);
+      instructions += TranslateArguments(init->arguments(), &argument_names);
+
+      const Function& target = Function::ZoneHandle(
+          Z, H.LookupConstructorByKernelConstructor(init->target()));
+      intptr_t argument_count = init->arguments()->count() + 1;
+      instructions += StaticCall(TokenPosition::kNoSource, target,
+                                 argument_count, argument_names);
+      instructions += Drop();
+    } else if (initializer->IsLocalInitializer()) {
+      // The other initializers following this one might read the variable. This
+      // is used e.g. for evaluating the arguments to a super call first, run
+      // normal field initializers next and then make the actual super call:
+      //
+      //   The frontend converts
+      //
+      //      class A {
+      //        var x;
+      //        A(a, b) : super(a + b), x = 2*b {}
+      //      }
+      //
+      //   to
+      //
+      //      class A {
+      //        var x;
+      //        A(a, b) : tmp = a + b, x = 2*b, super(tmp) {}
+      //      }
+      //
+      // (This is strictly speaking not what one should do in terms of the
+      //  specification but that is how it is currently implemented.)
+      LocalInitializer* init = LocalInitializer::Cast(initializer);
+
+      VariableDeclaration* declaration = init->variable();
+      LocalVariable* variable = LookupVariable(declaration);
+      Expression* initializer = init->variable()->initializer();
+      ASSERT(initializer != NULL);
+      ASSERT(!declaration->IsConst());
+
+      instructions += TranslateExpression(initializer);
+      instructions += StoreLocal(variable);
+      instructions += Drop();
+
+      fragment_ = instructions;
+    } else {
+      UNIMPLEMENTED();
+    }
+  }
+  return instructions;
+}
+
+
+Fragment FlowGraphBuilder::TranslateStatement(Statement* statement) {
+#ifdef DEBUG
+  intptr_t original_context_depth = context_depth_;
+#endif
+  statement->AcceptStatementVisitor(this);
+  DEBUG_ASSERT(context_depth_ == original_context_depth);
+  return fragment_;
+}
+
+
+Fragment FlowGraphBuilder::TranslateCondition(Expression* expression,
+                                              bool* negate) {
+  *negate = expression->IsNot();
+  if (*negate) {
+    return TranslateExpression(Not::Cast(expression)->expression());
+  }
+  return TranslateExpression(expression);
+}
+
+
+Fragment FlowGraphBuilder::TranslateExpression(Expression* expression) {
+  expression->AcceptExpressionVisitor(this);
+  return fragment_;
+}
+
+
+ArgumentArray FlowGraphBuilder::GetArguments(int count) {
+  ArgumentArray arguments =
+      new (Z) ZoneGrowableArray<PushArgumentInstr*>(Z, count);
+  arguments->SetLength(count);
+  for (intptr_t i = count - 1; i >= 0; --i) {
+    ASSERT(stack_->definition()->IsPushArgument());
+    ASSERT(!stack_->definition()->HasSSATemp());
+    arguments->data()[i] = stack_->definition()->AsPushArgument();
+    Drop();
+  }
+  pending_argument_count_ -= count;
+  ASSERT(pending_argument_count_ >= 0);
+  return arguments;
+}
+
+
+void FlowGraphBuilder::VisitInvalidExpression(InvalidExpression* node) {
+  // The frontend will take care of emitting normal errors (like
+  // [NoSuchMethodError]s) and only emit [InvalidExpression]s in very special
+  // situations (e.g. an invalid annotation).
+  fragment_ = ThrowNoSuchMethodError();
+}
+
+
+void FlowGraphBuilder::VisitNullLiteral(NullLiteral* node) {
+  fragment_ = Constant(Instance::ZoneHandle(Z, Instance::null()));
+}
+
+
+void FlowGraphBuilder::VisitBoolLiteral(BoolLiteral* node) {
+  fragment_ = Constant(Bool::Get(node->value()));
+}
+
+
+void FlowGraphBuilder::VisitIntLiteral(IntLiteral* node) {
+  fragment_ = IntConstant(node->value());
+}
+
+
+void FlowGraphBuilder::VisitBigintLiteral(BigintLiteral* node) {
+  const dart::String& value = H.DartString(node->value());
+  fragment_ = Constant(Integer::ZoneHandle(Z, Integer::New(value, Heap::kOld)));
+}
+
+
+void FlowGraphBuilder::VisitDoubleLiteral(DoubleLiteral* node) {
+  fragment_ = Constant(constant_evaluator_.EvaluateExpression(node));
+}
+
+
+void FlowGraphBuilder::VisitStringLiteral(StringLiteral* node) {
+  fragment_ = Constant(H.DartSymbol(node->value()));
+}
+
+
+void FlowGraphBuilder::VisitSymbolLiteral(SymbolLiteral* node) {
+  fragment_ = Constant(constant_evaluator_.EvaluateExpression(node));
+}
+
+
+AbstractType& DartTypeTranslator::TranslateType(DartType* node) {
+  node->AcceptDartTypeVisitor(this);
+
+  // We return a new `ZoneHandle` here on purpose: The intermediate language
+  // instructions do not make a copy of the handle, so we do it.
+  return dart::AbstractType::ZoneHandle(Z, result_.raw());
+}
+
+
+AbstractType& DartTypeTranslator::TranslateTypeWithoutFinalization(
+    DartType* node) {
+  bool saved_finalize = finalize_;
+  finalize_ = false;
+  AbstractType& result = TranslateType(node);
+  finalize_ = saved_finalize;
+  return result;
+}
+
+
+const AbstractType& DartTypeTranslator::TranslateVariableType(
+    VariableDeclaration* variable) {
+  AbstractType& abstract_type = TranslateType(variable->type());
+
+  // We return a new `ZoneHandle` here on purpose: The intermediate language
+  // instructions do not make a copy of the handle, so we do it.
+  AbstractType& type = Type::ZoneHandle(Z);
+
+  if (abstract_type.IsMalformed()) {
+    type = AbstractType::dynamic_type().raw();
+  } else {
+    type = result_.raw();
+  }
+
+  return type;
+}
+
+
+void DartTypeTranslator::VisitInvalidType(InvalidType* node) {
+  result_ = ClassFinalizer::NewFinalizedMalformedType(
+      Error::Handle(Z),  // No previous error.
+      dart::Script::Handle(Z, dart::Script::null()), TokenPosition::kNoSource,
+      "[InvalidType] in Kernel IR.");
+}
+
+
+void DartTypeTranslator::VisitFunctionType(FunctionType* node) {
+  // The spec describes in section "19.1 Static Types":
+  //
+  //     Any use of a malformed type gives rise to a static warning. A
+  //     malformed type is then interpreted as dynamic by the static type
+  //     checker and the runtime unless explicitly specified otherwise.
+  //
+  // So we convert malformed return/parameter types to `dynamic`.
+
+  const Function& signature_function = Function::ZoneHandle(
+      Z, Function::NewSignatureFunction(*active_class_->klass,
+                                        TokenPosition::kNoSource));
+
+  node->return_type()->AcceptDartTypeVisitor(this);
+  if (result_.IsMalformed()) {
+    result_ = AbstractType::dynamic_type().raw();
+  }
+  signature_function.set_result_type(result_);
+
+  const intptr_t positional_count = node->positional_parameters().length();
+  const intptr_t named_count = node->named_parameters().length();
+  const intptr_t all_count = positional_count + named_count;
+  const intptr_t required_count = node->required_parameter_count();
+
+  // The additional first parameter is the receiver type (set to dynamic).
+  signature_function.set_num_fixed_parameters(1 + required_count);
+  signature_function.SetNumOptionalParameters(
+      all_count - required_count, positional_count > required_count);
+
+  const Array& parameter_types =
+      Array::Handle(Z, Array::New(1 + all_count, Heap::kOld));
+  signature_function.set_parameter_types(parameter_types);
+  const Array& parameter_names =
+      Array::Handle(Z, Array::New(1 + all_count, Heap::kOld));
+  signature_function.set_parameter_names(parameter_names);
+
+  intptr_t pos = 0;
+  parameter_types.SetAt(pos, AbstractType::dynamic_type());
+  parameter_names.SetAt(pos, H.DartSymbol("_receiver_"));
+  pos++;
+  for (intptr_t i = 0; i < positional_count; i++, pos++) {
+    node->positional_parameters()[i]->AcceptDartTypeVisitor(this);
+    if (result_.IsMalformed()) {
+      result_ = AbstractType::dynamic_type().raw();
+    }
+    parameter_types.SetAt(pos, result_);
+    parameter_names.SetAt(pos, H.DartSymbol("noname"));
+  }
+  for (intptr_t i = 0; i < named_count; i++, pos++) {
+    Tuple<String, DartType>* tuple = node->named_parameters()[i];
+    tuple->second()->AcceptDartTypeVisitor(this);
+    if (result_.IsMalformed()) {
+      result_ = AbstractType::dynamic_type().raw();
+    }
+    parameter_types.SetAt(pos, result_);
+    parameter_names.SetAt(pos, H.DartSymbol(tuple->first()));
+  }
+
+  Type& signature_type =
+      Type::ZoneHandle(Z, signature_function.SignatureType());
+
+  if (finalize_) {
+    signature_type ^= ClassFinalizer::FinalizeType(
+        *active_class_->klass, signature_type, ClassFinalizer::kCanonicalize);
+  }
+  signature_function.SetSignatureType(signature_type);
+
+  result_ = signature_type.raw();
+}
+
+
+void DartTypeTranslator::VisitTypeParameterType(TypeParameterType* node) {
+  ASSERT(active_class_->kernel_class != NULL);
+
+  List<TypeParameter>* parameters =
+      &active_class_->kernel_class->type_parameters();
+  if ((active_class_->member != NULL) && active_class_->member->IsProcedure()) {
+    Procedure* procedure = Procedure::Cast(active_class_->member);
+    if ((procedure->function() != NULL) &&
+        (procedure->function()->type_parameters().length() > 0)) {
+      //
+      // WARNING: This is a little hackish:
+      //
+      // We have a static factory constructor. The kernel IR gives the factory
+      // constructor function it's own type parameters (which are equal in name
+      // and number to the ones of the enclosing class).
+      // I.e.,
+      //
+      //   class A<T> {
+      //     factory A.x() { return new B<T>(); }
+      //   }
+      //
+      //  is basically translated to this:
+      //
+      //   class A<T> {
+      //     static A.x<T'>() { return new B<T'>(); }
+      //   }
+      //
+      parameters = &procedure->function()->type_parameters();
+    }
+  }
+
+  for (intptr_t i = 0; i < parameters->length(); i++) {
+    TypeParameter* type_parameter = (*parameters)[i];
+    if (node->parameter() == type_parameter) {
+      // The index of the type parameter in [parameters] is
+      // the same index into the `klass->type_parameters()` array.
+      result_ ^= dart::TypeArguments::Handle(
+                     Z, active_class_->klass->type_parameters())
+                     .TypeAt(i);
+      return;
+    }
+  }
+
+  UNREACHABLE();
+}
+
+
+void DartTypeTranslator::VisitInterfaceType(InterfaceType* node) {
+  // NOTE: That an interface type like `T<A, B>` is considered to be
+  // malformed iff `T` is malformed.
+  //   => We therefore ignore errors in `A` or `B`.
+  const TypeArguments& type_arguments = TranslateTypeArguments(
+      node->type_arguments().raw_array(), node->type_arguments().length());
+
+
+  dart::Object& klass =
+      dart::Object::Handle(Z, H.ToUnresolvedClass(node->klass()));
+  result_ = Type::New(klass, type_arguments, TokenPosition::kNoSource);
+  if (finalize_) {
+    ASSERT(active_class_->klass != NULL);
+    result_ = ClassFinalizer::FinalizeType(*active_class_->klass, result_,
+                                           ClassFinalizer::kCanonicalize);
+  }
+}
+
+
+void DartTypeTranslator::VisitDynamicType(DynamicType* node) {
+  result_ = Object::dynamic_type().raw();
+}
+
+
+void DartTypeTranslator::VisitVoidType(VoidType* node) {
+  result_ = Object::void_type().raw();
+}
+
+
+const TypeArguments& DartTypeTranslator::TranslateTypeArguments(
+    DartType** dart_types,
+    intptr_t length) {
+  bool only_dynamic = true;
+  for (intptr_t i = 0; i < length; i++) {
+    if (!dart_types[i]->IsDynamicType()) {
+      only_dynamic = false;
+      break;
+    }
+  }
+  TypeArguments& type_arguments = TypeArguments::ZoneHandle(Z);
+  if (!only_dynamic) {
+    type_arguments = TypeArguments::New(length);
+    for (intptr_t i = 0; i < length; i++) {
+      dart_types[i]->AcceptDartTypeVisitor(this);
+      if (result_.IsMalformed()) {
+        type_arguments = TypeArguments::null();
+        return type_arguments;
+      }
+      type_arguments.SetTypeAt(i, result_);
+    }
+    if (finalize_) {
+      type_arguments = type_arguments.Canonicalize();
+    }
+  }
+  return type_arguments;
+}
+
+
+const TypeArguments& DartTypeTranslator::TranslateInstantiatedTypeArguments(
+    const dart::Class& receiver_class,
+    DartType** receiver_type_arguments,
+    intptr_t length) {
+  const TypeArguments& type_arguments =
+      TranslateTypeArguments(receiver_type_arguments, length);
+  if (type_arguments.IsNull()) return type_arguments;
+
+  // We make a temporary [Type] object and use `ClassFinalizer::FinalizeType` to
+  // finalize the argument types.
+  // (This can for example make the [type_arguments] vector larger)
+  Type& type = Type::Handle(
+      Z, Type::New(receiver_class, type_arguments, TokenPosition::kNoSource));
+  if (finalize_) {
+    type ^= ClassFinalizer::FinalizeType(
+        *active_class_->klass, type, ClassFinalizer::kCanonicalizeWellFormed);
+  }
+
+  const TypeArguments& instantiated_type_arguments =
+      TypeArguments::ZoneHandle(Z, type.arguments());
+  return instantiated_type_arguments;
+}
+
+
+const Type& DartTypeTranslator::ReceiverType(const dart::Class& klass) {
+  ASSERT(!klass.IsNull());
+  ASSERT(!klass.IsTypedefClass());
+  // Note that if klass is _Closure, the returned type will be _Closure,
+  // and not the signature type.
+  Type& type = Type::ZoneHandle(Z, klass.CanonicalType());
+  if (!type.IsNull()) {
+    return type;
+  }
+  type = Type::New(klass, TypeArguments::Handle(Z, klass.type_parameters()),
+                   klass.token_pos());
+  if (klass.is_type_finalized()) {
+    type ^= ClassFinalizer::FinalizeType(
+        klass, type, ClassFinalizer::kCanonicalizeWellFormed);
+    klass.SetCanonicalType(type);
+  }
+  return type;
+}
+
+
+void FlowGraphBuilder::VisitTypeLiteral(TypeLiteral* node) {
+  const AbstractType& type = T.TranslateType(node->type());
+  if (type.IsMalformed()) H.ReportError("Malformed type literal");
+
+  fragment_ = Constant(type);
+}
+
+
+void FlowGraphBuilder::VisitVariableGet(VariableGet* node) {
+  fragment_ = LoadLocal(LookupVariable(node->variable()));
+}
+
+
+void FlowGraphBuilder::VisitVariableSet(VariableSet* node) {
+  Fragment instructions = TranslateExpression(node->expression());
+  instructions += StoreLocal(LookupVariable(node->variable()));
+  fragment_ = instructions;
+}
+
+
+void FlowGraphBuilder::VisitStaticGet(StaticGet* node) {
+  Member* target = node->target();
+  if (target->IsField()) {
+    Field* kernel_field = Field::Cast(target);
+    const dart::Field& field =
+        dart::Field::ZoneHandle(Z, H.LookupFieldByKernelField(kernel_field));
+    if (kernel_field->IsConst()) {
+      fragment_ = Constant(constant_evaluator_.EvaluateExpression(node));
+    } else {
+      const dart::Class& owner = dart::Class::Handle(Z, field.Owner());
+      const dart::String& getter_name = H.DartGetterName(kernel_field->name());
+      const Function& getter =
+          Function::ZoneHandle(Z, owner.LookupStaticFunction(getter_name));
+      if (getter.IsNull() || !field.has_initializer()) {
+        Fragment instructions = Constant(field);
+        fragment_ = instructions + LoadStaticField();
+      } else {
+        fragment_ = StaticCall(node->position(), getter, 0);
+      }
+    }
+  } else {
+    Procedure* procedure = Procedure::Cast(target);
+    const Function& target = Function::ZoneHandle(
+        Z, H.LookupStaticMethodByKernelProcedure(procedure));
+
+    if (procedure->kind() == Procedure::kGetter) {
+      fragment_ = StaticCall(node->position(), target, 0);
+    } else if (procedure->kind() == Procedure::kMethod) {
+      ASSERT(procedure->IsStatic());
+      Function& closure_function =
+          Function::ZoneHandle(Z, target.ImplicitClosureFunction());
+      closure_function.set_kernel_function(target.kernel_function());
+      const Instance& closure =
+          Instance::ZoneHandle(Z, closure_function.ImplicitStaticClosure());
+      fragment_ = Constant(closure);
+    } else {
+      UNIMPLEMENTED();
+    }
+  }
+}
+
+
+void FlowGraphBuilder::VisitStaticSet(StaticSet* node) {
+  Member* target = node->target();
+  if (target->IsField()) {
+    Field* kernel_field = Field::Cast(target);
+    const dart::Field& field =
+        dart::Field::ZoneHandle(Z, H.LookupFieldByKernelField(kernel_field));
+    Fragment instructions = TranslateExpression(node->expression());
+    LocalVariable* variable = MakeTemporary();
+    instructions += LoadLocal(variable);
+    fragment_ = instructions + StoreStaticField(field);
+  } else {
+    ASSERT(target->IsProcedure());
+
+    // Evaluate the expression on the right hand side.
+    Fragment instructions = TranslateExpression(node->expression());
+    LocalVariable* variable = MakeTemporary();
+
+    // Prepare argument.
+    instructions += LoadLocal(variable);
+    instructions += PushArgument();
+
+    // Invoke the setter function.
+    Procedure* procedure = Procedure::Cast(target);
+    const Function& target = Function::ZoneHandle(
+        Z, H.LookupStaticMethodByKernelProcedure(procedure));
+    instructions += StaticCall(node->position(), target, 1);
+
+    // Drop the unused result & leave the stored value on the stack.
+    fragment_ = instructions + Drop();
+  }
+}
+
+
+void FlowGraphBuilder::VisitPropertyGet(PropertyGet* node) {
+  Fragment instructions = TranslateExpression(node->receiver());
+  instructions += PushArgument();
+  const dart::String& getter_name = H.DartGetterName(node->name());
+  fragment_ = instructions +
+              InstanceCall(node->position(), getter_name, Token::kGET, 1);
+}
+
+
+void FlowGraphBuilder::VisitPropertySet(PropertySet* node) {
+  Fragment instructions(NullConstant());
+  LocalVariable* variable = MakeTemporary();
+  instructions += TranslateExpression(node->receiver());
+  instructions += PushArgument();
+  instructions += TranslateExpression(node->value());
+  instructions += StoreLocal(variable);
+  instructions += PushArgument();
+
+  const dart::String& setter_name = H.DartSetterName(node->name());
+  instructions += InstanceCall(node->position(), setter_name, Token::kSET, 2);
+  fragment_ = instructions + Drop();
+}
+
+
+void FlowGraphBuilder::VisitDirectPropertyGet(DirectPropertyGet* node) {
+  Function& target = Function::ZoneHandle(Z);
+  if (node->target()->IsProcedure()) {
+    Procedure* kernel_procedure = Procedure::Cast(node->target());
+    Name* kernel_name = kernel_procedure->name();
+    if (kernel_procedure->kind() == Procedure::kGetter) {
+      target =
+          LookupMethodByMember(kernel_procedure, H.DartGetterName(kernel_name));
+    } else {
+      target =
+          LookupMethodByMember(kernel_procedure, H.DartMethodName(kernel_name));
+      target = target.ImplicitClosureFunction();
+      ASSERT(!target.IsNull());
+      fragment_ = BuildImplicitClosureCreation(target);
+      return;
+    }
+  } else {
+    ASSERT(node->target()->IsField());
+    const dart::String& getter_name = H.DartGetterName(node->target()->name());
+    target = LookupMethodByMember(node->target(), getter_name);
+    ASSERT(target.IsGetterFunction() || target.IsImplicitGetterFunction());
+  }
+
+  Fragment instructions = TranslateExpression(node->receiver());
+  instructions += PushArgument();
+  fragment_ = instructions + StaticCall(node->position(), target, 1);
+}
+
+
+void FlowGraphBuilder::VisitDirectPropertySet(DirectPropertySet* node) {
+  const dart::String& method_name = H.DartSetterName(node->target()->name());
+  const Function& target = Function::ZoneHandle(
+      Z, LookupMethodByMember(node->target(), method_name));
+  ASSERT(target.IsSetterFunction() || target.IsImplicitSetterFunction());
+
+  Fragment instructions(NullConstant());
+  LocalVariable* value = MakeTemporary();
+  instructions += TranslateExpression(node->receiver());
+  instructions += PushArgument();
+  instructions += TranslateExpression(node->value());
+  instructions += StoreLocal(value);
+  instructions += PushArgument();
+  instructions += StaticCall(node->position(), target, 2);
+
+  fragment_ = instructions + Drop();
+}
+
+
+void FlowGraphBuilder::VisitStaticInvocation(StaticInvocation* node) {
+  const Function& target = Function::ZoneHandle(
+      Z, H.LookupStaticMethodByKernelProcedure(node->procedure()));
+  const dart::Class& klass = dart::Class::ZoneHandle(Z, target.Owner());
+  intptr_t argument_count = node->arguments()->count();
+  if (target.IsGenerativeConstructor() || target.IsFactory()) {
+    // The VM requires a TypeArguments object as first parameter for
+    // every factory constructor.
+    ++argument_count;
+  }
+
+  List<NamedExpression>& named = node->arguments()->named();
+  const Array& argument_names = H.ArgumentNames(&named);
+
+  // The frontend ensures we the [StaticInvocation] has matching arguments.
+  ASSERT(target.AreValidArguments(argument_count, argument_names, NULL));
+
+  Fragment instructions;
+  LocalVariable* instance_variable = NULL;
+
+  // If we cross the Kernel -> VM core library boundary, a [StaticInvocation]
+  // can appear, but the thing we're calling is not a static method, but a
+  // factory constructor.
+  // The `H.LookupStaticmethodByKernelProcedure` will potentially resolve to the
+  // forwarded constructor.
+  // In that case we'll make an instance and pass it as first argument.
+  //
+  // TODO(27590): Get rid of this after we're using core libraries compiled
+  // into Kernel.
+  if (target.IsGenerativeConstructor()) {
+    if (klass.NumTypeArguments() > 0) {
+      List<DartType>& kernel_type_arguments = node->arguments()->types();
+      const TypeArguments& type_arguments =
+          T.TranslateInstantiatedTypeArguments(
+              klass, kernel_type_arguments.raw_array(),
+              kernel_type_arguments.length());
+      instructions += TranslateInstantiatedTypeArguments(type_arguments);
+      instructions += PushArgument();
+      instructions += AllocateObject(klass, 1);
+    } else {
+      instructions += AllocateObject(klass, 0);
+    }
+
+    instance_variable = MakeTemporary();
+
+    instructions += LoadLocal(instance_variable);
+    instructions += PushArgument();
+  } else if (target.IsFactory()) {
+    // The VM requires currently a TypeArguments object as first parameter for
+    // every factory constructor :-/ !
+    //
+    // TODO(27590): Get rid of this after we're using core libraries compiled
+    // into Kernel.
+    List<DartType>& kernel_type_arguments = node->arguments()->types();
+
+    const TypeArguments& type_arguments = T.TranslateInstantiatedTypeArguments(
+        klass, kernel_type_arguments.raw_array(),
+        kernel_type_arguments.length());
+
+    instructions += TranslateInstantiatedTypeArguments(type_arguments);
+    instructions += PushArgument();
+  } else {
+    ASSERT(node->arguments()->types().length() == 0);
+  }
+
+  // Special case identical(x, y) call.
+  // TODO(27590) consider moving this into the inliner and force inline it
+  // there.
+  if (klass.IsTopLevel() && (klass.library() == dart::Library::CoreLibrary()) &&
+      (target.name() == Symbols::Identical().raw())) {
+    ASSERT(argument_count == 2);
+
+    List<Expression>& positional = node->arguments()->positional();
+    for (intptr_t i = 0; i < positional.length(); ++i) {
+      instructions += TranslateExpression(positional[i]);
+    }
+    instructions += StrictCompare(Token::kEQ_STRICT, /*number_check=*/true);
+  } else {
+    instructions += TranslateArguments(node->arguments(), NULL);
+    instructions +=
+        StaticCall(node->position(), target, argument_count, argument_names);
+
+    if (target.IsGenerativeConstructor()) {
+      // Drop the result of the constructor call and leave [instance_variable]
+      // on top-of-stack.
+      instructions += Drop();
+    }
+  }
+
+  fragment_ = instructions;
+}
+
+
+static bool IsNumberLiteral(Node* node) {
+  return node->IsIntLiteral() || node->IsDoubleLiteral();
+}
+
+
+void FlowGraphBuilder::VisitMethodInvocation(MethodInvocation* node) {
+  const dart::String& name = H.DartMethodName(node->name());
+  const intptr_t argument_count = node->arguments()->count() + 1;
+  const Token::Kind token_kind = MethodKind(name);
+  if (IsNumberLiteral(node->receiver())) {
+    if ((argument_count == 1) && (token_kind == Token::kNEGATE)) {
+      const Object& result = constant_evaluator_.EvaluateExpressionSafe(node);
+      if (!result.IsError()) {
+        fragment_ = Constant(result);
+        return;
+      }
+    } else if ((argument_count == 2) &&
+               Token::IsBinaryArithmeticOperator(token_kind) &&
+               IsNumberLiteral(node->arguments()->positional()[0])) {
+      const Object& result = constant_evaluator_.EvaluateExpressionSafe(node);
+      if (!result.IsError()) {
+        fragment_ = Constant(result);
+        return;
+      }
+    }
+  }
+
+  Fragment instructions = TranslateExpression(node->receiver());
+  instructions += PushArgument();
+
+  // Dart does not support generic methods yet.
+  ASSERT(node->arguments()->types().length() == 0);
+
+  Array& argument_names = Array::ZoneHandle(Z);
+  instructions += TranslateArguments(node->arguments(), &argument_names);
+
+  intptr_t num_args_checked = 1;
+  // If we have a special operation (e.g. +/-/==) we mark both arguments as
+  // to be checked.
+  if (token_kind != Token::kILLEGAL) {
+    ASSERT(argument_count <= 2);
+    num_args_checked = argument_count;
+  }
+
+  fragment_ = instructions + InstanceCall(node->position(), name, token_kind,
+                                          argument_count, argument_names,
+                                          num_args_checked);
+}
+
+
+void FlowGraphBuilder::VisitDirectMethodInvocation(
+    DirectMethodInvocation* node) {
+  const dart::String& method_name = H.DartMethodName(node->target()->name());
+  const Function& target = Function::ZoneHandle(
+      Z, LookupMethodByMember(node->target(), method_name));
+
+  intptr_t argument_count = node->arguments()->count() + 1;
+  Array& argument_names = Array::ZoneHandle(Z);
+
+  ASSERT(node->arguments()->types().length() == 0);
+  Fragment instructions = TranslateExpression(node->receiver());
+  instructions += PushArgument();
+  instructions += TranslateArguments(node->arguments(), &argument_names);
+  fragment_ = instructions + StaticCall(node->position(), target,
+                                        argument_count, argument_names);
+}
+
+
+void FlowGraphBuilder::VisitConstructorInvocation(ConstructorInvocation* node) {
+  if (node->is_const()) {
+    fragment_ =
+        Constant(constant_evaluator_.EvaluateConstructorInvocation(node));
+    return;
+  }
+
+  Class* kernel_class = Class::Cast(node->target()->parent());
+
+  dart::Class& klass =
+      dart::Class::ZoneHandle(Z, H.LookupClassByKernelClass(kernel_class));
+
+  Fragment instructions;
+  if (klass.NumTypeArguments() > 0) {
+    List<DartType>& kernel_type_arguments = node->arguments()->types();
+    const TypeArguments& type_arguments = T.TranslateInstantiatedTypeArguments(
+        klass, kernel_type_arguments.raw_array(),
+        kernel_type_arguments.length());
+
+    if (type_arguments.IsNull() || type_arguments.IsInstantiated()) {
+      instructions += TranslateInstantiatedTypeArguments(type_arguments);
+    } else {
+      if (!klass.IsGeneric()) {
+        Type& type = Type::ZoneHandle(Z, T.ReceiverType(klass).raw());
+
+        // TODO(27590): Can we move this code into [ReceiverType]?
+        type ^= ClassFinalizer::FinalizeType(*active_class_.klass, type,
+                                             ClassFinalizer::kFinalize);
+        ASSERT(!type.IsMalformedOrMalbounded());
+
+        TypeArguments& canonicalized_type_arguments =
+            TypeArguments::ZoneHandle(Z, type.arguments());
+        canonicalized_type_arguments =
+            canonicalized_type_arguments.Canonicalize();
+        instructions += Constant(canonicalized_type_arguments);
+      } else {
+        instructions += TranslateInstantiatedTypeArguments(type_arguments);
+      }
+    }
+
+    instructions += PushArgument();
+    instructions += AllocateObject(klass, 1);
+  } else {
+    instructions += AllocateObject(klass, 0);
+  }
+  LocalVariable* variable = MakeTemporary();
+
+  instructions += LoadLocal(variable);
+  instructions += PushArgument();
+
+  Array& argument_names = Array::ZoneHandle(Z);
+  instructions += TranslateArguments(node->arguments(), &argument_names);
+
+  const Function& target = Function::ZoneHandle(
+      Z, H.LookupConstructorByKernelConstructor(klass, node->target()));
+  intptr_t argument_count = node->arguments()->count() + 1;
+  instructions +=
+      StaticCall(node->position(), target, argument_count, argument_names);
+  fragment_ = instructions + Drop();
+}
+
+
+void FlowGraphBuilder::VisitIsExpression(IsExpression* node) {
+  Fragment instructions = TranslateExpression(node->operand());
+
+  // The VM does not like an instanceOf call with a dynamic type. We need to
+  // special case this situation.
+  const Type& object_type = Type::Handle(Z, Type::ObjectType());
+  const AbstractType& type = T.TranslateType(node->type());
+  if (type.IsMalformed()) {
+    instructions += Drop();
+    instructions += ThrowTypeError();
+    fragment_ = instructions;
+    return;
+  }
+
+  if (type.IsInstantiated() &&
+      object_type.IsSubtypeOf(type, NULL, NULL, Heap::kOld)) {
+    // Evaluate the expression on the left but ignore it's result.
+    instructions += Drop();
+
+    // Let condition be always true.
+    instructions += Constant(Bool::True());
+  } else {
+    instructions += PushArgument();
+
+    if (!type.IsInstantiated()) {
+      instructions += LoadInstantiatorTypeArguments();
+    } else {
+      instructions += NullConstant();
+    }
+    instructions += PushArgument();  // Type arguments.
+
+    instructions += Constant(type);
+    instructions += PushArgument();  // Type.
+
+    instructions += Constant(Bool::False());
+    instructions += PushArgument();  // Negate?.
+
+    instructions +=
+        InstanceCall(TokenPosition::kNoSource,
+                     dart::Library::PrivateCoreLibName(Symbols::_instanceOf()),
+                     Token::kIS, 4);
+  }
+
+  fragment_ = instructions;
+}
+
+
+void FlowGraphBuilder::VisitAsExpression(AsExpression* node) {
+  Fragment instructions = TranslateExpression(node->operand());
+
+  // The VM does not like an Object_as call with a dynamic type. We need to
+  // special case this situation.
+  const Type& object_type = Type::Handle(Z, Type::ObjectType());
+  const AbstractType& type = T.TranslateType(node->type());
+  if (type.IsMalformed()) {
+    instructions += Drop();
+    instructions += ThrowTypeError();
+    fragment_ = instructions;
+    return;
+  }
+
+  if (type.IsInstantiated() &&
+      object_type.IsSubtypeOf(type, NULL, NULL, Heap::kOld)) {
+    // We already evaluated the operand on the left and just leave it there as
+    // the result of the `obj as dynamic` expression.
+  } else {
+    instructions += PushArgument();
+
+    if (!type.IsInstantiated()) {
+      instructions += LoadInstantiatorTypeArguments();
+    } else {
+      instructions += NullConstant();
+    }
+    instructions += PushArgument();  // Type arguments.
+
+    instructions += Constant(type);
+    instructions += PushArgument();  // Type.
+
+    instructions += InstanceCall(
+        TokenPosition::kNoSource,
+        dart::Library::PrivateCoreLibName(Symbols::_as()), Token::kAS, 3);
+  }
+
+  fragment_ = instructions;
+}
+
+
+void FlowGraphBuilder::VisitConditionalExpression(ConditionalExpression* node) {
+  bool negate;
+  Fragment instructions = TranslateCondition(node->condition(), &negate);
+
+  TargetEntryInstr* then_entry;
+  TargetEntryInstr* otherwise_entry;
+  instructions += BranchIfTrue(&then_entry, &otherwise_entry, negate);
+
+  Value* top = stack_;
+  Fragment then_fragment(then_entry);
+  then_fragment += TranslateExpression(node->then());
+  then_fragment += StoreLocal(parsed_function_->expression_temp_var());
+  then_fragment += Drop();
+
+  ASSERT(stack_ == top);
+  Fragment otherwise_fragment(otherwise_entry);
+  otherwise_fragment += TranslateExpression(node->otherwise());
+  otherwise_fragment += StoreLocal(parsed_function_->expression_temp_var());
+  otherwise_fragment += Drop();
+
+  JoinEntryInstr* join = BuildJoinEntry();
+  then_fragment += Goto(join);
+  otherwise_fragment += Goto(join);
+
+  fragment_ = Fragment(instructions.entry, join) +
+              LoadLocal(parsed_function_->expression_temp_var());
+}
+
+
+void FlowGraphBuilder::VisitLogicalExpression(LogicalExpression* node) {
+  bool negate;
+  Fragment instructions = TranslateCondition(node->left(), &negate);
+  TargetEntryInstr* right_entry;
+  TargetEntryInstr* constant_entry;
+
+  if (node->op() == LogicalExpression::kAnd) {
+    instructions += BranchIfTrue(&right_entry, &constant_entry, negate);
+  } else {
+    instructions += BranchIfTrue(&constant_entry, &right_entry, negate);
+  }
+
+  Value* top = stack_;
+  Fragment right_fragment(right_entry);
+  right_fragment += TranslateCondition(node->right(), &negate);
+  right_fragment += Constant(Bool::True());
+  right_fragment +=
+      StrictCompare(negate ? Token::kNE_STRICT : Token::kEQ_STRICT);
+  right_fragment += StoreLocal(parsed_function_->expression_temp_var());
+  right_fragment += Drop();
+
+  ASSERT(top == stack_);
+  Fragment constant_fragment(constant_entry);
+  constant_fragment +=
+      Constant(Bool::Get(node->op() == LogicalExpression::kOr));
+  constant_fragment += StoreLocal(parsed_function_->expression_temp_var());
+  constant_fragment += Drop();
+
+  JoinEntryInstr* join = BuildJoinEntry();
+  right_fragment += Goto(join);
+  constant_fragment += Goto(join);
+
+  fragment_ = Fragment(instructions.entry, join) +
+              LoadLocal(parsed_function_->expression_temp_var());
+}
+
+
+void FlowGraphBuilder::VisitNot(Not* node) {
+  Fragment instructions = TranslateExpression(node->expression());
+  fragment_ = instructions + BooleanNegate();
+}
+
+
+void FlowGraphBuilder::VisitThisExpression(ThisExpression* node) {
+  fragment_ = LoadLocal(scopes_->this_variable);
+}
+
+
+void FlowGraphBuilder::VisitStringConcatenation(StringConcatenation* node) {
+  List<Expression>& expressions = node->expressions();
+
+  Fragment instructions;
+
+  // The type arguments for CreateArray.
+  instructions += Constant(TypeArguments::ZoneHandle(Z));
+  instructions += IntConstant(expressions.length());
+  instructions += CreateArray();
+  LocalVariable* array = MakeTemporary();
+
+  for (intptr_t i = 0; i < node->expressions().length(); i++) {
+    instructions += LoadLocal(array);
+    instructions += IntConstant(i);
+    instructions += TranslateExpression(node->expressions()[i]);
+    instructions += StoreIndexed(kArrayCid);
+    instructions += Drop();
+  }
+
+  instructions += StringInterpolate();
+
+  fragment_ = instructions;
+}
+
+
+void FlowGraphBuilder::VisitListLiteral(ListLiteral* node) {
+  if (node->is_const()) {
+    fragment_ = Constant(constant_evaluator_.EvaluateListLiteral(node));
+    return;
+  }
+
+  DartType* types[] = {node->type()};
+  const TypeArguments& type_arguments = T.TranslateTypeArguments(types, 1);
+
+  // The type argument for the factory call.
+  Fragment instructions = TranslateInstantiatedTypeArguments(type_arguments);
+  instructions += PushArgument();
+  List<Expression>& expressions = node->expressions();
+  if (expressions.length() == 0) {
+    instructions += Constant(Object::empty_array());
+  } else {
+    // The type arguments for CreateArray.
+    instructions += Constant(TypeArguments::ZoneHandle(Z));
+    instructions += IntConstant(expressions.length());
+    instructions += CreateArray();
+
+    LocalVariable* array = MakeTemporary();
+    for (intptr_t i = 0; i < expressions.length(); ++i) {
+      instructions += LoadLocal(array);
+      instructions += IntConstant(i);
+      instructions += TranslateExpression(expressions[i]);
+      instructions += StoreIndexed(kArrayCid);
+      instructions += Drop();
+    }
+  }
+  instructions += PushArgument();  // The array.
+
+  const dart::Class& factory_class =
+      dart::Class::Handle(Z, dart::Library::LookupCoreClass(Symbols::List()));
+  const Function& factory_method = Function::ZoneHandle(
+      Z, factory_class.LookupFactory(
+             dart::Library::PrivateCoreLibName(Symbols::ListLiteralFactory())));
+  fragment_ = instructions + StaticCall(node->position(), factory_method, 2);
+}
+
+
+void FlowGraphBuilder::VisitMapLiteral(MapLiteral* node) {
+  if (node->is_const()) {
+    fragment_ = Constant(constant_evaluator_.EvaluateMapLiteral(node));
+    return;
+  }
+
+  const dart::Class& map_class =
+      dart::Class::Handle(Z, dart::Library::LookupCoreClass(Symbols::Map()));
+  const Function& factory_method = Function::ZoneHandle(
+      Z, map_class.LookupFactory(
+             dart::Library::PrivateCoreLibName(Symbols::MapLiteralFactory())));
+
+  DartType* types[] = {node->key_type(), node->value_type()};
+  const TypeArguments& type_arguments = T.TranslateTypeArguments(types, 2);
+
+  // The type argument for the factory call `new Map<K, V>._fromLiteral(List)`.
+  Fragment instructions = TranslateInstantiatedTypeArguments(type_arguments);
+  instructions += PushArgument();
+
+  List<MapEntry>& entries = node->entries();
+  if (entries.length() == 0) {
+    instructions += Constant(Object::empty_array());
+  } else {
+    // The type arguments for `new List<X>(int len)`.
+    instructions += Constant(TypeArguments::ZoneHandle(Z));
+
+    // We generate a list of tuples, i.e. [key1, value1, ..., keyN, valueN].
+    instructions += IntConstant(2 * entries.length());
+    instructions += CreateArray();
+
+    LocalVariable* array = MakeTemporary();
+    for (intptr_t i = 0; i < entries.length(); ++i) {
+      instructions += LoadLocal(array);
+      instructions += IntConstant(2 * i);
+      instructions += TranslateExpression(entries[i]->key());
+      instructions += StoreIndexed(kArrayCid);
+      instructions += Drop();
+
+      instructions += LoadLocal(array);
+      instructions += IntConstant(2 * i + 1);
+      instructions += TranslateExpression(entries[i]->value());
+      instructions += StoreIndexed(kArrayCid);
+      instructions += Drop();
+    }
+  }
+  instructions += PushArgument();  // The array.
+
+  fragment_ = instructions + StaticCall(node->position(), factory_method, 2);
+}
+
+
+void FlowGraphBuilder::VisitFunctionExpression(FunctionExpression* node) {
+  fragment_ = TranslateFunctionNode(node->function(), node);
+}
+
+
+void FlowGraphBuilder::VisitLet(Let* node) {
+  Fragment instructions = TranslateStatement(node->variable());
+  instructions += TranslateExpression(node->body());
+  fragment_ = instructions;
+}
+
+
+void FlowGraphBuilder::VisitThrow(Throw* node) {
+  Fragment instructions;
+
+  instructions += TranslateExpression(node->expression());
+  instructions += PushArgument();
+  instructions += ThrowException(node->position());
+  ASSERT(instructions.is_closed());
+
+  fragment_ = instructions;
+}
+
+
+void FlowGraphBuilder::VisitRethrow(Rethrow* node) {
+  Fragment instructions;
+
+  instructions += LoadLocal(catch_block_->exception_var());
+  instructions += PushArgument();
+  instructions += LoadLocal(catch_block_->stack_trace_var());
+  instructions += PushArgument();
+  instructions += RethrowException(catch_block_->catch_try_index());
+
+  fragment_ = instructions;
+}
+
+
+void FlowGraphBuilder::VisitBlockExpression(BlockExpression* node) {
+  Fragment instructions = TranslateStatement(node->body());
+  instructions += TranslateExpression(node->value());
+  fragment_ = instructions;
+}
+
+
+Fragment FlowGraphBuilder::TranslateArguments(Arguments* node,
+                                              Array* argument_names) {
+  Fragment instructions;
+
+  List<Expression>& positional = node->positional();
+  for (intptr_t i = 0; i < positional.length(); ++i) {
+    instructions += TranslateExpression(positional[i]);
+    instructions += PushArgument();
+  }
+
+  List<NamedExpression>& named = node->named();
+  if (argument_names != NULL) {
+    *argument_names = H.ArgumentNames(&named).raw();
+  }
+  for (intptr_t i = 0; i < named.length(); ++i) {
+    NamedExpression* named_expression = named[i];
+    instructions += TranslateExpression(named_expression->expression());
+    instructions += PushArgument();
+  }
+  return instructions;
+}
+
+
+void FlowGraphBuilder::VisitInvalidStatement(InvalidStatement* node) {
+  H.ReportError("Invalid statements not implemented yet!");
+}
+
+
+void FlowGraphBuilder::VisitEmptyStatement(EmptyStatement* node) {
+  fragment_ = Fragment();
+}
+
+
+void FlowGraphBuilder::VisitBlock(Block* node) {
+  Fragment instructions;
+
+  instructions += EnterScope(node);
+  List<Statement>& statements = node->statements();
+  for (intptr_t i = 0; (i < statements.length()) && instructions.is_open();
+       ++i) {
+    instructions += TranslateStatement(statements[i]);
+  }
+  instructions += ExitScope(node);
+
+  fragment_ = instructions;
+}
+
+
+void FlowGraphBuilder::VisitReturnStatement(ReturnStatement* node) {
+  bool inside_try_finally = try_finally_block_ != NULL;
+
+  Fragment instructions = node->expression() == NULL
+                              ? NullConstant()
+                              : TranslateExpression(node->expression());
+  if (instructions.is_open()) {
+    if (inside_try_finally) {
+      ASSERT(scopes_->finally_return_variable != NULL);
+      instructions += StoreLocal(scopes_->finally_return_variable);
+      instructions += Drop();
+      instructions += TranslateFinallyFinalizers(NULL, -1);
+      if (instructions.is_open()) {
+        instructions += LoadLocal(scopes_->finally_return_variable);
+        instructions += Return();
+      }
+    } else {
+      instructions += Return();
+    }
+  } else {
+    Pop();
+  }
+  fragment_ = instructions;
+}
+
+
+void FlowGraphBuilder::VisitExpressionStatement(ExpressionStatement* node) {
+  Fragment instructions = TranslateExpression(node->expression());
+  instructions += Drop();
+  fragment_ = instructions;
+}
+
+
+void FlowGraphBuilder::VisitVariableDeclaration(VariableDeclaration* node) {
+  LocalVariable* variable = LookupVariable(node);
+  Expression* initializer = node->initializer();
+
+  Fragment instructions;
+  if (initializer == NULL) {
+    instructions += NullConstant();
+  } else {
+    if (node->IsConst()) {
+      const Instance& constant_value =
+          constant_evaluator_.EvaluateExpression(initializer);
+      variable->SetConstValue(constant_value);
+      instructions += Constant(constant_value);
+    } else {
+      instructions += TranslateExpression(initializer);
+    }
+  }
+  instructions += StoreLocal(variable);
+  instructions += Drop();
+  fragment_ = instructions;
+}
+
+
+void FlowGraphBuilder::VisitFunctionDeclaration(FunctionDeclaration* node) {
+  Fragment instructions = TranslateFunctionNode(node->function(), node);
+  instructions += StoreLocal(LookupVariable(node->variable()));
+  instructions += Drop();
+  fragment_ = instructions;
+}
+
+
+void FlowGraphBuilder::VisitIfStatement(IfStatement* node) {
+  bool negate;
+  Fragment instructions = TranslateCondition(node->condition(), &negate);
+  TargetEntryInstr* then_entry;
+  TargetEntryInstr* otherwise_entry;
+  instructions += BranchIfTrue(&then_entry, &otherwise_entry, negate);
+
+  Fragment then_fragment(then_entry);
+  then_fragment += TranslateStatement(node->then());
+
+  Fragment otherwise_fragment(otherwise_entry);
+  otherwise_fragment += TranslateStatement(node->otherwise());
+
+  if (then_fragment.is_open()) {
+    if (otherwise_fragment.is_open()) {
+      JoinEntryInstr* join = BuildJoinEntry();
+      then_fragment += Goto(join);
+      otherwise_fragment += Goto(join);
+      fragment_ = Fragment(instructions.entry, join);
+    } else {
+      fragment_ = Fragment(instructions.entry, then_fragment.current);
+    }
+  } else if (otherwise_fragment.is_open()) {
+    fragment_ = Fragment(instructions.entry, otherwise_fragment.current);
+  } else {
+    fragment_ = instructions.closed();
+  }
+}
+
+
+void FlowGraphBuilder::VisitWhileStatement(WhileStatement* node) {
+  ++loop_depth_;
+  bool negate;
+  Fragment condition = TranslateCondition(node->condition(), &negate);
+  TargetEntryInstr* body_entry;
+  TargetEntryInstr* loop_exit;
+  condition += BranchIfTrue(&body_entry, &loop_exit, negate);
+
+  Fragment body(body_entry);
+  body += TranslateStatement(node->body());
+
+  Instruction* entry;
+  if (body.is_open()) {
+    JoinEntryInstr* join = BuildJoinEntry();
+    body += Goto(join);
+
+    Fragment loop(join);
+    loop += CheckStackOverflow();
+    loop += condition;
+    entry = new (Z) GotoInstr(join);
+  } else {
+    entry = condition.entry;
+  }
+
+
+  fragment_ = Fragment(entry, loop_exit);
+  --loop_depth_;
+}
+
+
+void FlowGraphBuilder::VisitDoStatement(DoStatement* node) {
+  ++loop_depth_;
+  Fragment body = TranslateStatement(node->body());
+
+  if (body.is_closed()) {
+    fragment_ = body;
+    --loop_depth_;
+    return;
+  }
+
+  bool negate;
+  JoinEntryInstr* join = BuildJoinEntry();
+  Fragment loop(join);
+  loop += CheckStackOverflow();
+  loop += body;
+  loop += TranslateCondition(node->condition(), &negate);
+  TargetEntryInstr* loop_repeat;
+  TargetEntryInstr* loop_exit;
+  loop += BranchIfTrue(&loop_repeat, &loop_exit, negate);
+
+  Fragment repeat(loop_repeat);
+  repeat += Goto(join);
+
+  fragment_ = Fragment(new (Z) GotoInstr(join), loop_exit);
+  --loop_depth_;
+}
+
+
+void FlowGraphBuilder::VisitForStatement(ForStatement* node) {
+  Fragment declarations;
+
+  bool new_context = false;
+  declarations += EnterScope(node, &new_context);
+
+  List<VariableDeclaration>& variables = node->variables();
+  for (intptr_t i = 0; i < variables.length(); ++i) {
+    declarations += TranslateStatement(variables[i]);
+  }
+
+  ++loop_depth_;
+  bool negate = false;
+  Fragment condition = node->condition() == NULL
+                           ? Constant(Bool::True())
+                           : TranslateCondition(node->condition(), &negate);
+  TargetEntryInstr* body_entry;
+  TargetEntryInstr* loop_exit;
+  condition += BranchIfTrue(&body_entry, &loop_exit, negate);
+
+  Fragment body(body_entry);
+  body += TranslateStatement(node->body());
+
+  if (body.is_open()) {
+    // We allocated a fresh context before the loop which contains captured
+    // [ForStatement] variables.  Before jumping back to the loop entry we clone
+    // the context object (at same depth) which ensures the next iteration of
+    // the body gets a fresh set of [ForStatement] variables (with the old
+    // (possibly updated) values).
+    if (new_context) body += CloneContext();
+
+    List<Expression>& updates = node->updates();
+    for (intptr_t i = 0; i < updates.length(); ++i) {
+      body += TranslateExpression(updates[i]);
+      body += Drop();
+    }
+    JoinEntryInstr* join = BuildJoinEntry();
+    declarations += Goto(join);
+    body += Goto(join);
+
+    Fragment loop(join);
+    loop += CheckStackOverflow();
+    loop += condition;
+  } else {
+    declarations += condition;
+  }
+
+  Fragment loop(declarations.entry, loop_exit);
+  --loop_depth_;
+
+  loop += ExitScope(node);
+
+  fragment_ = loop;
+}
+
+
+void FlowGraphBuilder::VisitForInStatement(ForInStatement* node) {
+  Fragment instructions = TranslateExpression(node->iterable());
+  instructions += PushArgument();
+
+  const dart::String& iterator_getter = dart::String::ZoneHandle(
+      Z, dart::Field::GetterSymbol(Symbols::Iterator()));
+  instructions +=
+      InstanceCall(TokenPosition::kNoSource, iterator_getter, Token::kGET, 1);
+  LocalVariable* iterator = scopes_->iterator_variables[for_in_depth_];
+  instructions += StoreLocal(iterator);
+  instructions += Drop();
+
+  ++for_in_depth_;
+  ++loop_depth_;
+  Fragment condition = LoadLocal(iterator);
+  condition += PushArgument();
+  condition += InstanceCall(TokenPosition::kNoSource, Symbols::MoveNext(),
+                            Token::kILLEGAL, 1);
+  TargetEntryInstr* body_entry;
+  TargetEntryInstr* loop_exit;
+  condition += BranchIfTrue(&body_entry, &loop_exit);
+
+  Fragment body(body_entry);
+  body += EnterScope(node);
+  body += LoadLocal(iterator);
+  body += PushArgument();
+  const dart::String& current_getter = dart::String::ZoneHandle(
+      Z, dart::Field::GetterSymbol(Symbols::Current()));
+  body +=
+      InstanceCall(TokenPosition::kNoSource, current_getter, Token::kGET, 1);
+  body += StoreLocal(LookupVariable(node->variable()));
+  body += Drop();
+  body += TranslateStatement(node->body());
+  body += ExitScope(node);
+
+  if (body.is_open()) {
+    JoinEntryInstr* join = BuildJoinEntry();
+    instructions += Goto(join);
+    body += Goto(join);
+
+    Fragment loop(join);
+    loop += CheckStackOverflow();
+    loop += condition;
+  } else {
+    instructions += condition;
+  }
+
+  fragment_ = Fragment(instructions.entry, loop_exit);
+  --loop_depth_;
+  --for_in_depth_;
+}
+
+
+void FlowGraphBuilder::VisitLabeledStatement(LabeledStatement* node) {
+  // There can be serveral cases:
+  //
+  //   * the body contains a break
+  //   * the body doesn't contain a break
+  //
+  //   * translating the body results in a closed fragment
+  //   * translating the body results in a open fragment
+  //
+  // => We will only know which case we are in after the body has been
+  //    traversed.
+
+  BreakableBlock block(this, node);
+  Fragment instructions = TranslateStatement(node->body());
+  if (block.HadJumper()) {
+    if (instructions.is_open()) {
+      instructions += Goto(block.destination());
+    }
+    fragment_ = Fragment(instructions.entry, block.destination());
+  } else {
+    fragment_ = instructions;
+  }
+}
+
+
+void FlowGraphBuilder::VisitBreakStatement(BreakStatement* node) {
+  TryFinallyBlock* outer_finally = NULL;
+  intptr_t target_context_depth = -1;
+  JoinEntryInstr* destination = breakable_block_->BreakDestination(
+      node->target(), &outer_finally, &target_context_depth);
+
+  Fragment instructions;
+  instructions +=
+      TranslateFinallyFinalizers(outer_finally, target_context_depth);
+  if (instructions.is_open()) {
+    instructions += Goto(destination);
+  }
+  fragment_ = instructions;
+}
+
+
+void FlowGraphBuilder::VisitSwitchStatement(SwitchStatement* node) {
+  SwitchBlock block(this, node);
+
+  // Instead of using a variable we should reuse the expression on the stack,
+  // since it won't be assigned again, we don't need phi nodes.
+  Fragment head_instructions = TranslateExpression(node->condition());
+  head_instructions += StoreLocal(scopes_->switch_variable);
+  head_instructions += Drop();
+
+  // Phase 1: Generate bodies and try to find out whether a body will be target
+  // of a jump due to:
+  //   * `continue case_label`
+  //   * `case e1: case e2: body`
+  Fragment* body_fragments = new Fragment[node->cases().length()];
+
+  intptr_t num_cases = node->cases().length();
+  for (intptr_t i = 0; i < num_cases; i++) {
+    SwitchCase* switch_case = node->cases()[i];
+    Fragment& body_fragment = body_fragments[i] =
+        TranslateStatement(switch_case->body());
+
+    if (body_fragment.entry == NULL) {
+      // Make a NOP in order to ensure linking works properly.
+      body_fragment = NullConstant();
+      body_fragment += Drop();
+    }
+
+    // The Dart language specification mandates fall-throughs in [SwitchCase]es
+    // to be runtime errors.
+    if (!switch_case->is_default() && body_fragment.is_open() &&
+        (i < (node->cases().length() - 1))) {
+      const dart::Class& klass = dart::Class::ZoneHandle(
+          Z, dart::Library::LookupCoreClass(Symbols::FallThroughError()));
+      ASSERT(!klass.IsNull());
+      const dart::Function& constructor = dart::Function::ZoneHandle(
+          Z, klass.LookupConstructorAllowPrivate(
+                 H.DartSymbol("FallThroughError._create")));
+      ASSERT(!constructor.IsNull());
+      const dart::String& url = H.DartString(
+          parsed_function_->function().ToLibNamePrefixedQualifiedCString(),
+          Heap::kOld);
+
+      // Create instance of _FallThroughError
+      body_fragment += AllocateObject(klass, 0);
+      LocalVariable* instance = MakeTemporary();
+
+      // Call _AssertionError._create constructor.
+      body_fragment += LoadLocal(instance);
+      body_fragment += PushArgument();  // this
+
+      body_fragment += Constant(url);
+      body_fragment += PushArgument();  // url
+
+      body_fragment += NullConstant();
+      body_fragment += PushArgument();  // line
+
+      body_fragment += StaticCall(TokenPosition::kNoSource, constructor, 3);
+      body_fragment += Drop();
+
+      // Throw the exception
+      body_fragment += PushArgument();
+      body_fragment += ThrowException(TokenPosition::kNoSource);
+      body_fragment += Drop();
+    }
+
+    // If there is an implicit fall-through we have one [SwitchCase] and
+    // multiple expressions, e.g.
+    //
+    //    switch(expr) {
+    //      case a:
+    //      case b:
+    //        <stmt-body>
+    //    }
+    //
+    // This means that the <stmt-body> will have more than 1 incoming edge (one
+    // from `a == expr` and one from `a != expr && b == expr`). The
+    // `block.Destination()` records the additional jump.
+    if (switch_case->expressions().length() > 1) {
+      block.Destination(switch_case);
+    }
+  }
+
+  // Phase 2: Generate everything except the real bodies:
+  //   * jump directly to a body (if there is no jumper)
+  //   * jump to a wrapper block which jumps to the body (if there is a jumper)
+  Fragment current_instructions = head_instructions;
+  for (intptr_t i = 0; i < num_cases; i++) {
+    SwitchCase* switch_case = node->cases()[i];
+
+    if (switch_case->is_default()) {
+      ASSERT(i == (node->cases().length() - 1));
+
+      // Evaluate the conditions for the default [SwitchCase] just for the
+      // purpose of potentially triggering a compile-time error.
+      for (intptr_t k = 0; k < switch_case->expressions().length(); k++) {
+        constant_evaluator_.EvaluateExpression(switch_case->expressions()[k]);
+      }
+
+      if (block.HadJumper(switch_case)) {
+        // There are several branches to the body, so we will make a goto to
+        // the join block (and prepend a join instruction to the real body).
+        JoinEntryInstr* join = block.Destination(switch_case);
+        current_instructions += Goto(join);
+
+        current_instructions = Fragment(current_instructions.entry, join);
+        current_instructions += body_fragments[i];
+      } else {
+        current_instructions += body_fragments[i];
+      }
+    } else {
+      JoinEntryInstr* body_join = NULL;
+      if (block.HadJumper(switch_case)) {
+        body_join = block.Destination(switch_case);
+        body_fragments[i] = Fragment(body_join) + body_fragments[i];
+      }
+
+      for (intptr_t j = 0; j < switch_case->expressions().length(); j++) {
+        TargetEntryInstr* then;
+        TargetEntryInstr* otherwise;
+
+        current_instructions += Constant(constant_evaluator_.EvaluateExpression(
+            switch_case->expressions()[j]));
+        current_instructions += PushArgument();
+        current_instructions += LoadLocal(scopes_->switch_variable);
+        current_instructions += PushArgument();
+        current_instructions += InstanceCall(
+            TokenPosition::kNoSource, Symbols::EqualOperator(), Token::kEQ,
+            /*argument_count=*/2,
+            /*num_args_checked=*/2);
+        current_instructions += BranchIfTrue(&then, &otherwise);
+
+        Fragment then_fragment(then);
+
+        if (body_join != NULL) {
+          // There are several branches to the body, so we will make a goto to
+          // the join block (the real body has already been prepended with a
+          // join instruction).
+          then_fragment += Goto(body_join);
+        } else {
+          // There is only a signle branch to the body, so we will just append
+          // the body fragment.
+          then_fragment += body_fragments[i];
+        }
+
+        current_instructions = Fragment(otherwise);
+      }
+    }
+  }
+
+  bool has_no_default =
+      num_cases > 0 && !node->cases()[num_cases - 1]->is_default();
+  if (has_no_default) {
+    // There is no default, which means we have an open [current_instructions]
+    // (which is a [TargetEntryInstruction] for the last "otherwise" branch).
+    //
+    // Furthermore the last [SwitchCase] can be open as well.  If so, we need
+    // to join these two.
+    Fragment& last_body = body_fragments[node->cases().length() - 1];
+    if (last_body.is_open()) {
+      ASSERT(current_instructions.is_open());
+      ASSERT(current_instructions.current->IsTargetEntry());
+
+      // Join the last "otherwise" branch and the last [SwitchCase] fragment.
+      JoinEntryInstr* join = BuildJoinEntry();
+      current_instructions += Goto(join);
+      last_body += Goto(join);
+
+      current_instructions = Fragment(join);
+    }
+  } else {
+    // All non-default cases will be closed (i.e. break/continue/throw/return)
+    // So it is fine to just let more statements after the switch append to the
+    // default case.
+  }
+
+  delete[] body_fragments;
+
+  fragment_ = Fragment(head_instructions.entry, current_instructions.current);
+}
+
+
+void FlowGraphBuilder::VisitContinueSwitchStatement(
+    ContinueSwitchStatement* node) {
+  TryFinallyBlock* outer_finally = NULL;
+  intptr_t target_context_depth = -1;
+  JoinEntryInstr* entry = switch_block_->Destination(
+      node->target(), &outer_finally, &target_context_depth);
+
+  Fragment instructions;
+  instructions +=
+      TranslateFinallyFinalizers(outer_finally, target_context_depth);
+  if (instructions.is_open()) {
+    instructions += Goto(entry);
+  }
+  fragment_ = instructions;
+}
+
+
+void FlowGraphBuilder::VisitAssertStatement(AssertStatement* node) {
+  if (!I->asserts()) {
+    fragment_ = Fragment();
+    return;
+  }
+
+  TargetEntryInstr* then;
+  TargetEntryInstr* otherwise;
+
+  bool negate;
+  Fragment instructions;
+  instructions += TranslateCondition(node->condition(), &negate);
+  instructions += BranchIfTrue(&then, &otherwise, negate);
+
+  const dart::Class& klass = dart::Class::ZoneHandle(
+      Z, dart::Library::LookupCoreClass(Symbols::AssertionError()));
+  ASSERT(!klass.IsNull());
+  const dart::Function& constructor = dart::Function::ZoneHandle(
+      Z, klass.LookupConstructorAllowPrivate(
+             H.DartSymbol("_AssertionError._create")));
+  ASSERT(!constructor.IsNull());
+
+  const dart::String& url = H.DartString(
+      parsed_function_->function().ToLibNamePrefixedQualifiedCString(),
+      Heap::kOld);
+
+  // Create instance of _AssertionError
+  Fragment otherwise_fragment(otherwise);
+  otherwise_fragment += AllocateObject(klass, 0);
+  LocalVariable* instance = MakeTemporary();
+
+  // Call _AssertionError._create constructor.
+  otherwise_fragment += LoadLocal(instance);
+  otherwise_fragment += PushArgument();  // this
+
+  otherwise_fragment +=
+      node->message() != NULL
+          ? TranslateExpression(node->message())
+          : Constant(H.DartString("<no message>", Heap::kOld));
+  otherwise_fragment += PushArgument();  // message
+
+  otherwise_fragment += Constant(url);
+  otherwise_fragment += PushArgument();  // url
+
+  otherwise_fragment += IntConstant(0);
+  otherwise_fragment += PushArgument();  // line
+
+  otherwise_fragment += IntConstant(0);
+  otherwise_fragment += PushArgument();  // column
+
+  otherwise_fragment += StaticCall(TokenPosition::kNoSource, constructor, 5);
+  otherwise_fragment += Drop();
+
+  // Throw _AssertionError exception.
+  otherwise_fragment += PushArgument();
+  otherwise_fragment += ThrowException(TokenPosition::kNoSource);
+  otherwise_fragment += Drop();
+
+  fragment_ = Fragment(instructions.entry, then);
+}
+
+
+void FlowGraphBuilder::VisitTryFinally(TryFinally* node) {
+  InlineBailout("kernel::FlowgraphBuilder::VisitTryFinally");
+
+  // There are 5 different cases where we need to execute the finally block:
+  //
+  //  a) 1/2/3th case: Special control flow going out of `node->body()`:
+  //
+  //   * [BreakStatement] transfers control to a [LabledStatement]
+  //   * [ContinueSwitchStatement] transfers control to a [SwitchCase]
+  //   * [ReturnStatement] returns a value
+  //
+  //   => All three cases will automatically append all finally blocks
+  //      between the branching point and the destination (so we don't need to
+  //      do anything here).
+  //
+  //  b) 4th case: Translating the body resulted in an open fragment (i.e. body
+  //               executes without any control flow out of it)
+  //
+  //   => We are responsible for jumping out of the body to a new block (with
+  //      different try index) and execute the finalizer.
+  //
+  //  c) 5th case: An exception occured inside the body.
+  //
+  //   => We are responsible for catching it, executing the finally block and
+  //      rethrowing the exception.
+  intptr_t try_handler_index = AllocateTryIndex();
+  Fragment try_body = TryCatch(try_handler_index);
+  JoinEntryInstr* after_try = BuildJoinEntry();
+
+  // Fill in the body of the try.
+  ++try_depth_;
+  {
+    TryFinallyBlock tfb(this, node->finalizer());
+    TryCatchBlock tcb(this, try_handler_index);
+    try_body += TranslateStatement(node->body());
+  }
+  --try_depth_;
+
+  if (try_body.is_open()) {
+    // Please note: The try index will be on level out of this block,
+    // thereby ensuring if there's an exception in the finally block we
+    // won't run it twice.
+    JoinEntryInstr* finally_entry = BuildJoinEntry();
+
+    try_body += Goto(finally_entry);
+
+    Fragment finally_body(finally_entry);
+    finally_body += TranslateStatement(node->finalizer());
+    finally_body += Goto(after_try);
+  }
+
+  // Fill in the body of the catch.
+  ++catch_depth_;
+  const Array& handler_types = Array::ZoneHandle(Z, Array::New(1, Heap::kOld));
+  handler_types.SetAt(0, Object::dynamic_type());
+  Fragment finally_body = CatchBlockEntry(handler_types, try_handler_index);
+  finally_body += TranslateStatement(node->finalizer());
+  if (finally_body.is_open()) {
+    finally_body += LoadLocal(CurrentException());
+    finally_body += PushArgument();
+    finally_body += LoadLocal(CurrentStackTrace());
+    finally_body += PushArgument();
+    finally_body += RethrowException(try_handler_index);
+    Drop();
+  }
+  --catch_depth_;
+
+  fragment_ = Fragment(try_body.entry, after_try);
+}
+
+
+void FlowGraphBuilder::VisitTryCatch(class TryCatch* node) {
+  InlineBailout("kernel::FlowgraphBuilder::VisitTryCatch");
+
+  intptr_t try_handler_index = AllocateTryIndex();
+  Fragment try_body = TryCatch(try_handler_index);
+  JoinEntryInstr* after_try = BuildJoinEntry();
+
+  // Fill in the body of the try.
+  ++try_depth_;
+  {
+    TryCatchBlock block(this, try_handler_index);
+    try_body += TranslateStatement(node->body());
+    try_body += Goto(after_try);
+  }
+  --try_depth_;
+
+  ++catch_depth_;
+  const Array& handler_types =
+      Array::ZoneHandle(Z, Array::New(node->catches().length(), Heap::kOld));
+  Fragment catch_body = CatchBlockEntry(handler_types, try_handler_index);
+  // Fill in the body of the catch.
+  for (intptr_t i = 0; i < node->catches().length(); i++) {
+    Catch* catch_clause = node->catches()[i];
+
+    Fragment catch_handler_body;
+
+    catch_handler_body += EnterScope(catch_clause);
+
+    if (catch_clause->exception() != NULL) {
+      catch_handler_body += LoadLocal(CurrentException());
+      catch_handler_body +=
+          StoreLocal(LookupVariable(catch_clause->exception()));
+      catch_handler_body += Drop();
+    }
+    if (catch_clause->stack_trace() != NULL) {
+      catch_handler_body += LoadLocal(CurrentStackTrace());
+      catch_handler_body +=
+          StoreLocal(LookupVariable(catch_clause->stack_trace()));
+      catch_handler_body += Drop();
+    }
+    AbstractType* type_guard = NULL;
+    if (catch_clause->guard() != NULL &&
+        !catch_clause->guard()->IsDynamicType()) {
+      type_guard = &T.TranslateType(catch_clause->guard());
+      handler_types.SetAt(i, *type_guard);
+    } else {
+      handler_types.SetAt(i, Object::dynamic_type());
+    }
+
+    {
+      CatchBlock block(this, CurrentException(), CurrentStackTrace(),
+                       try_handler_index);
+
+      catch_handler_body += TranslateStatement(catch_clause->body());
+
+      // Note: ExitScope adjusts context_depth_ so even if catch_handler_body
+      // is closed we still need to execute ExitScope for its side effect.
+      catch_handler_body += ExitScope(catch_clause);
+      if (catch_handler_body.is_open()) {
+        catch_handler_body += Goto(after_try);
+      }
+    }
+
+    if (type_guard != NULL) {
+      if (type_guard->IsMalformed()) {
+        catch_body += ThrowTypeError();
+        catch_body += Drop();
+      } else {
+        catch_body += LoadLocal(CurrentException());
+        catch_body += PushArgument();  // exception
+        catch_body += NullConstant();
+        catch_body += PushArgument();  // type arguments
+        catch_body += Constant(*type_guard);
+        catch_body += PushArgument();  // guard type
+        catch_body += Constant(Object::bool_false());
+        catch_body += PushArgument();  // negate
+        catch_body += InstanceCall(
+            TokenPosition::kNoSource,
+            dart::Library::PrivateCoreLibName(Symbols::_instanceOf()),
+            Token::kIS, 4);
+
+        TargetEntryInstr* catch_entry;
+        TargetEntryInstr* next_catch_entry;
+        catch_body += BranchIfTrue(&catch_entry, &next_catch_entry);
+
+        Fragment(catch_entry) + catch_handler_body;
+        catch_body = Fragment(next_catch_entry);
+      }
+    } else {
+      catch_body += catch_handler_body;
+    }
+  }
+
+  // In case the last catch body was not handling the exception and branching to
+  // after the try block, we will rethrow the exception (i.e. no default catch
+  // handler).
+  if (catch_body.is_open()) {
+    catch_body += LoadLocal(CurrentException());
+    catch_body += PushArgument();
+    catch_body += LoadLocal(CurrentStackTrace());
+    catch_body += PushArgument();
+    catch_body += RethrowException(try_handler_index);
+    Drop();
+  }
+  --catch_depth_;
+
+  fragment_ = Fragment(try_body.entry, after_try);
+}
+
+
+void FlowGraphBuilder::VisitYieldStatement(YieldStatement* node) {
+  ASSERT(node->is_native());  // Must have been desugared.
+  // Setup yield/continue point:
+  //
+  //   ...
+  //   :await_jump_var = index;
+  //   :await_ctx_var = :current_context_var
+  //   return <expr>
+  //
+  // Continuation<index>:
+  //   Drop(1)
+  //   ...
+  //
+  // BuildGraphOfFunction will create a dispatch that jumps to
+  // Continuation<:await_jump_var> upon entry to the function.
+  //
+  Fragment instructions = IntConstant(yield_continuations_.length() + 1);
+  instructions += StoreLocal(scopes_->yield_jump_variable);
+  instructions += Drop();
+  instructions += LoadLocal(parsed_function_->current_context_var());
+  instructions += StoreLocal(scopes_->yield_context_variable);
+  instructions += Drop();
+  instructions += TranslateExpression(node->expression());
+  instructions += Return();
+
+  // Note: DropTempsInstr serves as an anchor instruction. It will not
+  // be linked into the resulting graph.
+  DropTempsInstr* anchor = new (Z) DropTempsInstr(0, NULL);
+  yield_continuations_.Add(YieldContinuation(anchor, CurrentTryIndex()));
+
+  Fragment continuation(instructions.entry, anchor);
+
+  // TODO(27590): we need a better way to detect if we need to check for an
+  // exception after yield or not.
+  if (parsed_function_->function().NumOptionalPositionalParameters() == 3) {
+    // If function takes three parameters then the second and the third
+    // are exception and stack_trace. Check if exception is non-null
+    // and rethrow it.
+    //
+    //   :async_op([:result, :exception, :stack_trace]) {
+    //     ...
+    //     Continuation<index>:
+    //       if (:exception != null) rethrow(:exception, :stack_trace);
+    //     ...
+    //   }
+    //
+    LocalScope* scope = parsed_function_->node_sequence()->scope();
+    LocalVariable* exception_var = scope->VariableAt(2);
+    LocalVariable* stack_trace_var = scope->VariableAt(3);
+    ASSERT(exception_var->name().raw() == Symbols::ExceptionParameter().raw());
+    ASSERT(stack_trace_var->name().raw() ==
+           Symbols::StackTraceParameter().raw());
+
+    TargetEntryInstr* no_error;
+    TargetEntryInstr* error;
+
+    continuation += LoadLocal(exception_var);
+    continuation += BranchIfNull(&no_error, &error);
+
+    Fragment rethrow(error);
+    rethrow += LoadLocal(exception_var);
+    rethrow += PushArgument();
+    rethrow += LoadLocal(stack_trace_var);
+    rethrow += PushArgument();
+    rethrow += RethrowException(CatchClauseNode::kInvalidTryIndex);
+    Drop();
+
+
+    continuation = Fragment(continuation.entry, no_error);
+  }
+
+  fragment_ = continuation;
+}
+
+
+Fragment FlowGraphBuilder::TranslateFunctionNode(FunctionNode* node,
+                                                 TreeNode* parent) {
+  // The VM has a per-isolate table of functions indexed by the enclosing
+  // function and token position.  We don't have token positions, so we've
+  // simply numbered the immediately-nested functions with respect to the
+  // parent.
+  Function& function = Function::ZoneHandle(Z);
+  for (intptr_t i = 0; i < scopes_->function_scopes.length(); ++i) {
+    if (scopes_->function_scopes[i].function != node) continue;
+
+    // NOTE: This is not TokenPosition in the general sense!
+    function = I->LookupClosureFunction(parsed_function_->function(),
+                                        TokenPosition(i));
+    if (function.IsNull()) {
+      const dart::String* name;
+      if (parent->IsFunctionExpression()) {
+        name = &Symbols::AnonymousClosure();
+      } else {
+        ASSERT(parent->IsFunctionDeclaration());
+        name = &H.DartSymbol(
+            FunctionDeclaration::Cast(parent)->variable()->name());
+      }
+      // NOTE: This is not TokenPosition in the general sense!
+      function = Function::NewClosureFunction(
+          *name, parsed_function_->function(), TokenPosition(i));
+      function.set_is_debuggable(false);
+      LocalScope* scope = scopes_->function_scopes[i].scope;
+      const ContextScope& context_scope =
+          ContextScope::Handle(Z, scope->PreserveOuterScope(context_depth_));
+      function.set_context_scope(context_scope);
+      function.set_kernel_function(node);
+      KernelReader::SetupFunctionParameters(H, T, dart::Class::Handle(Z),
+                                            function, node,
+                                            false,  // is_method
+                                            true);  // is_closure
+      // Finalize function type.
+      Type& signature_type = Type::Handle(Z, function.SignatureType());
+      signature_type ^= ClassFinalizer::FinalizeType(
+          *active_class_.klass, signature_type, ClassFinalizer::kCanonicalize);
+      function.SetSignatureType(signature_type);
+
+      I->AddClosureFunction(function);
+    }
+    break;
+  }
+
+  const dart::Class& closure_class =
+      dart::Class::ZoneHandle(Z, I->object_store()->closure_class());
+  ASSERT(!closure_class.IsNull());
+  Fragment instructions = AllocateObject(closure_class, function);
+  LocalVariable* closure = MakeTemporary();
+
+  // TODO(27590): Generic closures need type arguments.
+
+  // Store the function and the context in the closure.
+  instructions += LoadLocal(closure);
+  instructions += Constant(function);
+  instructions += StoreInstanceField(Closure::function_offset());
+
+  instructions += LoadLocal(closure);
+  instructions += LoadLocal(parsed_function_->current_context_var());
+  instructions += StoreInstanceField(Closure::context_offset());
+
+  return instructions;
+}
+
+
+}  // namespace kernel
+}  // namespace dart
+#endif  // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/kernel_to_il.h b/runtime/vm/kernel_to_il.h
new file mode 100644
index 0000000..3f9db3e
--- /dev/null
+++ b/runtime/vm/kernel_to_il.h
@@ -0,0 +1,929 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#ifndef RUNTIME_VM_KERNEL_TO_IL_H_
+#define RUNTIME_VM_KERNEL_TO_IL_H_
+
+#if !defined(DART_PRECOMPILED_RUNTIME)
+
+#include "vm/growable_array.h"
+#include "vm/hash_map.h"
+
+#include "vm/flow_graph.h"
+#include "vm/flow_graph_builder.h"
+#include "vm/intermediate_language.h"
+#include "vm/kernel.h"
+
+namespace dart {
+namespace kernel {
+
+// TODO(27590): Instead of using [dart::kernel::TreeNode]s as keys we
+// should use [TokenPosition]s.
+class KernelConstMapKeyEqualsTraits {
+ public:
+  static const char* Name() { return "KernelConstMapKeyEqualsTraits"; }
+  static bool ReportStats() { return false; }
+
+  static bool IsMatch(const Object& a, const Object& b) {
+    const Smi& key1 = Smi::Cast(a);
+    const Smi& key2 = Smi::Cast(b);
+    return (key1.Value() == key2.Value());
+  }
+  static bool IsMatch(const TreeNode* key1, const Object& b) {
+    return KeyAsSmi(key1) == Smi::Cast(b).raw();
+  }
+  static uword Hash(const Object& obj) {
+    const Smi& key = Smi::Cast(obj);
+    return HashValue(key.Value());
+  }
+  static uword Hash(const TreeNode* key) {
+    return HashValue(Smi::Value(KeyAsSmi(key)));
+  }
+  static RawObject* NewKey(const TreeNode* key) { return KeyAsSmi(key); }
+
+ private:
+  static uword HashValue(intptr_t pos) { return pos % (Smi::kMaxValue - 13); }
+
+  static RawSmi* KeyAsSmi(const TreeNode* key) {
+    // We exploit that all [TreeNode] objects will be aligned and therefore are
+    // already [Smi]s!
+    return reinterpret_cast<RawSmi*>(const_cast<TreeNode*>(key));
+  }
+};
+typedef UnorderedHashMap<KernelConstMapKeyEqualsTraits> KernelConstantsMap;
+
+
+template <typename K, typename V>
+class Map : public DirectChainedHashMap<RawPointerKeyValueTrait<K, V> > {
+ public:
+  typedef typename RawPointerKeyValueTrait<K, V>::Key Key;
+  typedef typename RawPointerKeyValueTrait<K, V>::Value Value;
+  typedef typename RawPointerKeyValueTrait<K, V>::Pair Pair;
+
+  inline void Insert(const Key& key, const Value& value) {
+    Pair pair(key, value);
+    DirectChainedHashMap<RawPointerKeyValueTrait<K, V> >::Insert(pair);
+  }
+
+  inline V Lookup(const Key& key) {
+    Pair* pair =
+        DirectChainedHashMap<RawPointerKeyValueTrait<K, V> >::Lookup(key);
+    if (pair == NULL) {
+      return V();
+    } else {
+      return pair->value;
+    }
+  }
+};
+
+class BreakableBlock;
+class CatchBlock;
+class FlowGraphBuilder;
+class SwitchBlock;
+class TryCatchBlock;
+class TryFinallyBlock;
+
+class Fragment {
+ public:
+  Instruction* entry;
+  Instruction* current;
+
+  Fragment() : entry(NULL), current(NULL) {}
+
+  explicit Fragment(Instruction* instruction)
+      : entry(instruction), current(instruction) {}
+
+  Fragment(Instruction* entry, Instruction* current)
+      : entry(entry), current(current) {}
+
+  bool is_open() { return entry == NULL || current != NULL; }
+  bool is_closed() { return !is_open(); }
+
+  Fragment& operator+=(const Fragment& other);
+  Fragment& operator<<=(Instruction* next);
+
+  Fragment closed();
+};
+
+Fragment operator+(const Fragment& first, const Fragment& second);
+Fragment operator<<(const Fragment& fragment, Instruction* next);
+
+typedef ZoneGrowableArray<PushArgumentInstr*>* ArgumentArray;
+
+
+class ActiveClass {
+ public:
+  ActiveClass()
+      : kernel_class(NULL), klass(NULL), member(NULL), kernel_function(NULL) {}
+
+  // The current enclosing kernel class (if available, otherwise NULL).
+  Class* kernel_class;
+
+  // The current enclosing class (or the library top-level class).  When this is
+  // a library's top-level class, the kernel_class will be NULL.
+  const dart::Class* klass;
+
+  // The enclosing member (e.g., Constructor, Procedure, or Field) if there
+  // is one.
+  Member* member;
+
+  // The current function.
+  FunctionNode* kernel_function;
+};
+
+
+class ActiveClassScope {
+ public:
+  ActiveClassScope(ActiveClass* active_class,
+                   Class* kernel_class,
+                   const dart::Class* klass)
+      : active_class_(active_class), saved_(*active_class) {
+    active_class_->kernel_class = kernel_class;
+    active_class_->klass = klass;
+    active_class_->member = NULL;
+    active_class_->kernel_function = NULL;
+  }
+
+  ~ActiveClassScope() { *active_class_ = saved_; }
+
+ private:
+  ActiveClass* active_class_;
+  ActiveClass saved_;
+};
+
+
+class ActiveMemberScope {
+ public:
+  ActiveMemberScope(ActiveClass* active_class, Member* member)
+      : active_class_(active_class), saved_(*active_class) {
+    // The class and kernel_class is inherited.
+    active_class_->member = member;
+    active_class_->kernel_function = NULL;
+  }
+
+  ~ActiveMemberScope() { *active_class_ = saved_; }
+
+ private:
+  ActiveClass* active_class_;
+  ActiveClass saved_;
+};
+
+
+class ActiveFunctionScope {
+ public:
+  ActiveFunctionScope(ActiveClass* active_class, FunctionNode* kernel_function)
+      : active_class_(active_class), saved_(*active_class) {
+    // The class, kernel_class, and member are inherited.
+    active_class_->kernel_function = kernel_function;
+  }
+
+  ~ActiveFunctionScope() { *active_class_ = saved_; }
+
+ private:
+  ActiveClass* active_class_;
+  ActiveClass saved_;
+};
+
+
+class TranslationHelper {
+ public:
+  TranslationHelper(dart::Thread* thread, dart::Zone* zone, Isolate* isolate)
+      : thread_(thread),
+        zone_(zone),
+        isolate_(isolate),
+        allocation_space_(thread_->IsMutatorThread() ? Heap::kNew
+                                                     : Heap::kOld) {}
+  virtual ~TranslationHelper() {}
+
+  Thread* thread() { return thread_; }
+
+  Zone* zone() { return zone_; }
+
+  Isolate* isolate() { return isolate_; }
+
+  Heap::Space allocation_space() { return allocation_space_; }
+
+  RawInstance* Canonicalize(const Instance& instance);
+
+  const dart::String& DartString(const char* content) {
+    return DartString(content, allocation_space_);
+  }
+  const dart::String& DartString(const char* content, Heap::Space space);
+
+  dart::String& DartString(String* content) {
+    return DartString(content, allocation_space_);
+  }
+  dart::String& DartString(String* content, Heap::Space space);
+
+  const dart::String& DartSymbol(const char* content) const;
+  dart::String& DartSymbol(String* content) const;
+
+  const dart::String& DartClassName(Class* kernel_klass);
+  const dart::String& DartConstructorName(Constructor* node);
+  const dart::String& DartProcedureName(Procedure* procedure);
+
+  const dart::String& DartSetterName(Name* kernel_name);
+  const dart::String& DartGetterName(Name* kernel_name);
+  const dart::String& DartFieldName(Name* kernel_name);
+  const dart::String& DartInitializerName(Name* kernel_name);
+  const dart::String& DartMethodName(Name* kernel_name);
+  const dart::String& DartFactoryName(Class* klass, Name* kernel_name);
+
+  const Array& ArgumentNames(List<NamedExpression>* named);
+
+  // A subclass overrides these when reading in the Kernel program in order to
+  // support recursive type expressions (e.g. for "implements X" ...
+  // annotations).
+  virtual RawLibrary* LookupLibraryByKernelLibrary(Library* library);
+  virtual RawClass* LookupClassByKernelClass(Class* klass);
+
+  RawUnresolvedClass* ToUnresolvedClass(Class* klass);
+
+  RawField* LookupFieldByKernelField(Field* field);
+  RawFunction* LookupStaticMethodByKernelProcedure(Procedure* procedure);
+  RawFunction* LookupConstructorByKernelConstructor(Constructor* constructor);
+  dart::RawFunction* LookupConstructorByKernelConstructor(
+      const dart::Class& owner,
+      Constructor* constructor);
+
+  dart::Type& GetCanonicalType(const dart::Class& klass);
+
+  void ReportError(const char* format, ...);
+  void ReportError(const Error& prev_error, const char* format, ...);
+
+ private:
+  // This will mangle [kernel_name] (if necessary) and make the result a symbol.
+  // The result will be avilable in [name_to_modify] and it is also returned.
+  dart::String& ManglePrivateName(Library* kernel_library,
+                                  dart::String* name_to_modify,
+                                  bool symbolize = true);
+
+  dart::Thread* thread_;
+  dart::Zone* zone_;
+  dart::Isolate* isolate_;
+  Heap::Space allocation_space_;
+};
+
+// Regarding malformed types:
+// The spec says in section "19.1 Static Types" roughly:
+//
+//   A type T is malformed iff:
+//     * T does not denote a type in scope
+//     * T refers to a type parameter in a static member
+//     * T is a parametrized Type G<T1, ...> and G is malformed
+//     * T denotes declarations from multiple imports
+//
+// Any use of a malformed type gives rise to a static warning.  A malformed
+// type is then interpreted as dynamic by the static type checker and the
+// runtime unless explicitly specified otherwise.
+class DartTypeTranslator : public DartTypeVisitor {
+ public:
+  DartTypeTranslator(TranslationHelper* helper,
+                     ActiveClass* active_class,
+                     bool finalize = false)
+      : translation_helper_(*helper),
+        active_class_(active_class),
+        zone_(helper->zone()),
+        result_(AbstractType::Handle(helper->zone())),
+        finalize_(finalize) {}
+
+  // Can return a malformed type.
+  AbstractType& TranslateType(DartType* node);
+
+  // Can return a malformed type.
+  AbstractType& TranslateTypeWithoutFinalization(DartType* node);
+
+  // Is guaranteed to be not malformed.
+  const AbstractType& TranslateVariableType(VariableDeclaration* variable);
+
+
+  virtual void VisitDefaultDartType(DartType* node) { UNREACHABLE(); }
+
+  virtual void VisitInvalidType(InvalidType* node);
+
+  virtual void VisitFunctionType(FunctionType* node);
+
+  virtual void VisitTypeParameterType(TypeParameterType* node);
+
+  virtual void VisitInterfaceType(InterfaceType* node);
+
+  virtual void VisitDynamicType(DynamicType* node);
+
+  virtual void VisitVoidType(VoidType* node);
+
+  // Will return `TypeArguments::null()` in case any of the arguments are
+  // malformed.
+  const TypeArguments& TranslateInstantiatedTypeArguments(
+      const dart::Class& receiver_class,
+      DartType** receiver_type_arguments,
+      intptr_t length);
+
+  // Will return `TypeArguments::null()` in case any of the arguments are
+  // malformed.
+  const TypeArguments& TranslateTypeArguments(DartType** dart_types,
+                                              intptr_t length);
+
+  const Type& ReceiverType(const dart::Class& klass);
+
+ private:
+  TranslationHelper& translation_helper_;
+  ActiveClass* active_class_;
+  Zone* zone_;
+  AbstractType& result_;
+
+  bool finalize_;
+};
+
+
+// There are several cases when we are compiling constant expressions:
+//
+//   * constant field initializers:
+//      const FieldName = <expr>;
+//
+//   * constant expressions:
+//      const [<expr>, ...]
+//      const {<expr> : <expr>, ...}
+//      const Constructor(<expr>, ...)
+//
+//   * constant default parameters:
+//      f(a, [b = <expr>])
+//      f(a, {b: <expr>})
+//
+//   * constant values to compare in a [SwitchCase]
+//      case <expr>:
+//
+// In all cases `<expr>` must be recursively evaluated and canonicalized at
+// compile-time.
+class ConstantEvaluator : public ExpressionVisitor {
+ public:
+  ConstantEvaluator(FlowGraphBuilder* builder,
+                    Zone* zone,
+                    TranslationHelper* h,
+                    DartTypeTranslator* type_translator);
+  virtual ~ConstantEvaluator() {}
+
+  Instance& EvaluateExpression(Expression* node);
+  Object& EvaluateExpressionSafe(Expression* node);
+  Instance& EvaluateConstructorInvocation(ConstructorInvocation* node);
+  Instance& EvaluateListLiteral(ListLiteral* node);
+  Instance& EvaluateMapLiteral(MapLiteral* node);
+
+  virtual void VisitDefaultExpression(Expression* node) { UNREACHABLE(); }
+
+  virtual void VisitBigintLiteral(BigintLiteral* node);
+  virtual void VisitBoolLiteral(BoolLiteral* node);
+  virtual void VisitDoubleLiteral(DoubleLiteral* node);
+  virtual void VisitIntLiteral(IntLiteral* node);
+  virtual void VisitNullLiteral(NullLiteral* node);
+  virtual void VisitStringLiteral(StringLiteral* node);
+  virtual void VisitSymbolLiteral(SymbolLiteral* node);
+  virtual void VisitTypeLiteral(TypeLiteral* node);
+
+  virtual void VisitListLiteral(ListLiteral* node);
+  virtual void VisitMapLiteral(MapLiteral* node);
+
+  virtual void VisitConstructorInvocation(ConstructorInvocation* node);
+  virtual void VisitMethodInvocation(MethodInvocation* node);
+  virtual void VisitStaticGet(StaticGet* node);
+  virtual void VisitVariableGet(VariableGet* node);
+  virtual void VisitLet(Let* node);
+  virtual void VisitStaticInvocation(StaticInvocation* node);
+  virtual void VisitStringConcatenation(StringConcatenation* node);
+  virtual void VisitConditionalExpression(ConditionalExpression* node);
+  virtual void VisitLogicalExpression(LogicalExpression* node);
+  virtual void VisitNot(Not* node);
+
+ private:
+  // This will translate type arguments form [kernel_arguments].  If no type
+  // arguments are passed and the [target] is a factory then the null type
+  // argument array will be returned.
+  //
+  // If none of these cases apply, NULL will be returned.
+  const TypeArguments* TranslateTypeArguments(const Function& target,
+                                              dart::Class* target_klass,
+                                              Arguments* kernel_arguments);
+
+  const Object& RunFunction(const Function& function,
+                            Arguments* arguments,
+                            const Instance* receiver = NULL,
+                            const TypeArguments* type_args = NULL);
+
+  const Object& RunFunction(const Function& function,
+                            const Array& arguments,
+                            const Array& names);
+
+  RawObject* EvaluateConstConstructorCall(const dart::Class& type_class,
+                                          const TypeArguments& type_arguments,
+                                          const Function& constructor,
+                                          const Object& argument);
+
+  // TODO(27590): Instead of using [dart::kernel::TreeNode]s as keys we
+  // should use [TokenPosition]s as well as the existing functionality in
+  // `Parser::CacheConstantValue`.
+  bool GetCachedConstant(TreeNode* node, Instance* value);
+  void CacheConstantValue(TreeNode* node, const Instance& value);
+
+  FlowGraphBuilder* builder_;
+  Isolate* isolate_;
+  Zone* zone_;
+  TranslationHelper& translation_helper_;
+  DartTypeTranslator& type_translator_;
+
+  Script& script_;
+  Instance& result_;
+};
+
+
+struct FunctionScope {
+  FunctionNode* function;
+  LocalScope* scope;
+};
+
+
+class ScopeBuildingResult : public ZoneAllocated {
+ public:
+  ScopeBuildingResult()
+      : this_variable(NULL),
+        type_arguments_variable(NULL),
+        switch_variable(NULL),
+        finally_return_variable(NULL),
+        setter_value(NULL),
+        yield_jump_variable(NULL),
+        yield_context_variable(NULL) {}
+
+  Map<VariableDeclaration, LocalVariable*> locals;
+  Map<TreeNode, LocalScope*> scopes;
+  GrowableArray<FunctionScope> function_scopes;
+
+  // Only non-NULL for instance functions.
+  LocalVariable* this_variable;
+
+  // Only non-NULL for factory constructor functions.
+  LocalVariable* type_arguments_variable;
+
+  // Non-NULL when the function contains a switch statement.
+  LocalVariable* switch_variable;
+
+  // Non-NULL when the function contains a return inside a finally block.
+  LocalVariable* finally_return_variable;
+
+  // Non-NULL when the function is a setter.
+  LocalVariable* setter_value;
+
+  // Non-NULL if the function contains yield statement.
+  // TODO(27590) actual variable is called :await_jump_var, we should rename
+  // it to reflect the fact that it is used for both await and yield.
+  LocalVariable* yield_jump_variable;
+
+  // Non-NULL if the function contains yield statement.
+  // TODO(27590) actual variable is called :await_ctx_var, we should rename
+  // it to reflect the fact that it is used for both await and yield.
+  LocalVariable* yield_context_variable;
+
+  // Variables used in exception handlers, one per exception handler nesting
+  // level.
+  GrowableArray<LocalVariable*> exception_variables;
+  GrowableArray<LocalVariable*> stack_trace_variables;
+  GrowableArray<LocalVariable*> catch_context_variables;
+
+  // For-in iterators, one per for-in nesting level.
+  GrowableArray<LocalVariable*> iterator_variables;
+};
+
+
+class ScopeBuilder : public RecursiveVisitor {
+ public:
+  ScopeBuilder(ParsedFunction* parsed_function, TreeNode* node)
+      : result_(NULL),
+        parsed_function_(parsed_function),
+        node_(node),
+        zone_(Thread::Current()->zone()),
+        translation_helper_(Thread::Current(), zone_, Isolate::Current()),
+        type_translator_(&translation_helper_,
+                         &active_class_,
+                         /*finalize=*/true),
+        current_function_scope_(NULL),
+        scope_(NULL),
+        depth_(0),
+        name_index_(0) {}
+
+  virtual ~ScopeBuilder() {}
+
+  ScopeBuildingResult* BuildScopes();
+
+  virtual void VisitName(Name* node) { /* NOP */
+  }
+
+  virtual void VisitThisExpression(ThisExpression* node);
+  virtual void VisitTypeParameterType(TypeParameterType* node);
+  virtual void VisitVariableGet(VariableGet* node);
+  virtual void VisitVariableSet(VariableSet* node);
+  virtual void VisitFunctionExpression(FunctionExpression* node);
+  virtual void VisitLet(Let* node);
+  virtual void VisitBlock(Block* node);
+  virtual void VisitVariableDeclaration(VariableDeclaration* node);
+  virtual void VisitFunctionDeclaration(FunctionDeclaration* node);
+  virtual void VisitWhileStatement(WhileStatement* node);
+  virtual void VisitDoStatement(DoStatement* node);
+  virtual void VisitForStatement(ForStatement* node);
+  virtual void VisitForInStatement(ForInStatement* node);
+  virtual void VisitSwitchStatement(SwitchStatement* node);
+  virtual void VisitReturnStatement(ReturnStatement* node);
+  virtual void VisitTryCatch(TryCatch* node);
+  virtual void VisitTryFinally(TryFinally* node);
+  virtual void VisitYieldStatement(YieldStatement* node);
+  virtual void VisitAssertStatement(AssertStatement* node);
+
+  virtual void VisitFunctionNode(FunctionNode* node);
+
+  virtual void VisitConstructor(Constructor* node);
+
+ private:
+  void EnterScope(TreeNode* node);
+  void ExitScope();
+
+  const Type& TranslateVariableType(VariableDeclaration* variable);
+  LocalVariable* MakeVariable(const dart::String& name,
+                              const AbstractType& type);
+
+  void AddParameters(FunctionNode* function, intptr_t pos = 0);
+  void AddParameter(VariableDeclaration* declaration, intptr_t pos);
+  void AddVariable(VariableDeclaration* declaration);
+  void AddExceptionVariable(GrowableArray<LocalVariable*>* variables,
+                            const char* prefix,
+                            intptr_t nesting_depth);
+  void AddTryVariables();
+  void AddCatchVariables();
+  void AddIteratorVariable();
+  void AddSwitchVariable();
+
+  // Record an assignment or reference to a variable.  If the occurrence is
+  // in a nested function, ensure that the variable is handled properly as a
+  // captured variable.
+  void LookupVariable(VariableDeclaration* declaration);
+
+  const dart::String& GenerateName(const char* prefix, intptr_t suffix);
+
+  void HandleLocalFunction(TreeNode* parent, FunctionNode* function);
+  void HandleSpecialLoad(LocalVariable** variable, const dart::String& symbol);
+  void LookupCapturedVariableByName(LocalVariable** variable,
+                                    const dart::String& name);
+
+
+  struct DepthState {
+    explicit DepthState(intptr_t function)
+        : loop_(0),
+          function_(function),
+          try_(0),
+          catch_(0),
+          finally_(0),
+          for_in_(0) {}
+
+    intptr_t loop_;
+    intptr_t function_;
+    intptr_t try_;
+    intptr_t catch_;
+    intptr_t finally_;
+    intptr_t for_in_;
+  };
+
+  ScopeBuildingResult* result_;
+  ParsedFunction* parsed_function_;
+  TreeNode* node_;
+
+  ActiveClass active_class_;
+
+  Zone* zone_;
+  TranslationHelper translation_helper_;
+  DartTypeTranslator type_translator_;
+
+  FunctionNode* current_function_node_;
+  LocalScope* current_function_scope_;
+  LocalScope* scope_;
+  DepthState depth_;
+
+  intptr_t name_index_;
+};
+
+
+class FlowGraphBuilder : public TreeVisitor {
+ public:
+  FlowGraphBuilder(TreeNode* node,
+                   ParsedFunction* parsed_function,
+                   const ZoneGrowableArray<const ICData*>& ic_data_array,
+                   InlineExitCollector* exit_collector,
+                   intptr_t osr_id,
+                   intptr_t first_block_id = 1);
+  virtual ~FlowGraphBuilder();
+
+  FlowGraph* BuildGraph();
+
+  virtual void VisitDefaultTreeNode(TreeNode* node) { UNREACHABLE(); }
+
+  virtual void VisitInvalidExpression(InvalidExpression* node);
+  virtual void VisitNullLiteral(NullLiteral* node);
+  virtual void VisitBoolLiteral(BoolLiteral* node);
+  virtual void VisitIntLiteral(IntLiteral* node);
+  virtual void VisitBigintLiteral(BigintLiteral* node);
+  virtual void VisitDoubleLiteral(DoubleLiteral* node);
+  virtual void VisitStringLiteral(StringLiteral* node);
+  virtual void VisitSymbolLiteral(SymbolLiteral* node);
+  virtual void VisitTypeLiteral(TypeLiteral* node);
+  virtual void VisitVariableGet(VariableGet* node);
+  virtual void VisitVariableSet(VariableSet* node);
+  virtual void VisitStaticGet(StaticGet* node);
+  virtual void VisitStaticSet(StaticSet* node);
+  virtual void VisitPropertyGet(PropertyGet* node);
+  virtual void VisitPropertySet(PropertySet* node);
+  virtual void VisitDirectPropertyGet(DirectPropertyGet* node);
+  virtual void VisitDirectPropertySet(DirectPropertySet* node);
+  virtual void VisitStaticInvocation(StaticInvocation* node);
+  virtual void VisitMethodInvocation(MethodInvocation* node);
+  virtual void VisitDirectMethodInvocation(DirectMethodInvocation* node);
+  virtual void VisitConstructorInvocation(ConstructorInvocation* node);
+  virtual void VisitIsExpression(IsExpression* node);
+  virtual void VisitAsExpression(AsExpression* node);
+  virtual void VisitConditionalExpression(ConditionalExpression* node);
+  virtual void VisitLogicalExpression(LogicalExpression* node);
+  virtual void VisitNot(Not* node);
+  virtual void VisitThisExpression(ThisExpression* node);
+  virtual void VisitStringConcatenation(StringConcatenation* node);
+  virtual void VisitListLiteral(ListLiteral* node);
+  virtual void VisitMapLiteral(MapLiteral* node);
+  virtual void VisitFunctionExpression(FunctionExpression* node);
+  virtual void VisitLet(Let* node);
+  virtual void VisitThrow(Throw* node);
+  virtual void VisitRethrow(Rethrow* node);
+  virtual void VisitBlockExpression(BlockExpression* node);
+
+  virtual void VisitInvalidStatement(InvalidStatement* node);
+  virtual void VisitEmptyStatement(EmptyStatement* node);
+  virtual void VisitBlock(Block* node);
+  virtual void VisitReturnStatement(ReturnStatement* node);
+  virtual void VisitExpressionStatement(ExpressionStatement* node);
+  virtual void VisitVariableDeclaration(VariableDeclaration* node);
+  virtual void VisitFunctionDeclaration(FunctionDeclaration* node);
+  virtual void VisitIfStatement(IfStatement* node);
+  virtual void VisitWhileStatement(WhileStatement* node);
+  virtual void VisitDoStatement(DoStatement* node);
+  virtual void VisitForStatement(ForStatement* node);
+  virtual void VisitForInStatement(ForInStatement* node);
+  virtual void VisitLabeledStatement(LabeledStatement* node);
+  virtual void VisitBreakStatement(BreakStatement* node);
+  virtual void VisitSwitchStatement(SwitchStatement* node);
+  virtual void VisitContinueSwitchStatement(ContinueSwitchStatement* node);
+  virtual void VisitAssertStatement(AssertStatement* node);
+  virtual void VisitTryFinally(TryFinally* node);
+  virtual void VisitTryCatch(TryCatch* node);
+  virtual void VisitYieldStatement(YieldStatement* node);
+
+ private:
+  FlowGraph* BuildGraphOfFunction(FunctionNode* node,
+                                  Constructor* constructor = NULL);
+  FlowGraph* BuildGraphOfFieldAccessor(Field* node,
+                                       LocalVariable* setter_value);
+  FlowGraph* BuildGraphOfStaticFieldInitializer(Field* node);
+  FlowGraph* BuildGraphOfMethodExtractor(const Function& method);
+  FlowGraph* BuildGraphOfImplicitClosureFunction(FunctionNode* kernel_function,
+                                                 const Function& function);
+  FlowGraph* BuildGraphOfNoSuchMethodDispatcher(const Function& function);
+  FlowGraph* BuildGraphOfInvokeFieldDispatcher(const Function& function);
+
+  Fragment NativeFunctionBody(FunctionNode* kernel_function,
+                              const Function& function);
+
+  void SetupDefaultParameterValues(FunctionNode* function);
+
+  TargetEntryInstr* BuildTargetEntry();
+  JoinEntryInstr* BuildJoinEntry();
+
+  Fragment TranslateArguments(Arguments* node, Array* argument_names);
+  ArgumentArray GetArguments(int count);
+
+  Fragment TranslateInitializers(Class* kernel_klass,
+                                 List<Initializer>* initialiers);
+
+  Fragment TranslateStatement(Statement* statement);
+  Fragment TranslateCondition(Expression* expression, bool* negate);
+  Fragment TranslateExpression(Expression* expression);
+
+  Fragment TranslateFinallyFinalizers(TryFinallyBlock* outer_finally,
+                                      intptr_t target_context_depth);
+
+  Fragment TranslateFunctionNode(FunctionNode* node, TreeNode* parent);
+
+  Fragment EnterScope(TreeNode* node, bool* new_context = NULL);
+  Fragment ExitScope(TreeNode* node);
+
+  Fragment LoadContextAt(int depth);
+  Fragment AdjustContextTo(int depth);
+
+  Fragment PushContext(int size);
+  Fragment PopContext();
+
+  Fragment LoadInstantiatorTypeArguments();
+  Fragment InstantiateTypeArguments(const TypeArguments& type_arguments);
+  Fragment TranslateInstantiatedTypeArguments(
+      const TypeArguments& type_arguments);
+
+  Fragment AllocateContext(int size);
+  Fragment AllocateObject(const dart::Class& klass, intptr_t argument_count);
+  Fragment AllocateObject(const dart::Class& klass,
+                          const Function& closure_function);
+  Fragment BooleanNegate();
+  Fragment StrictCompare(Token::Kind kind, bool number_check = false);
+  Fragment BranchIfTrue(TargetEntryInstr** then_entry,
+                        TargetEntryInstr** otherwise_entry,
+                        bool negate = false);
+  Fragment BranchIfNull(TargetEntryInstr** then_entry,
+                        TargetEntryInstr** otherwise_entry,
+                        bool negate = false);
+  Fragment BranchIfEqual(TargetEntryInstr** then_entry,
+                         TargetEntryInstr** otherwise_entry,
+                         bool negate = false);
+  Fragment BranchIfStrictEqual(TargetEntryInstr** then_entry,
+                               TargetEntryInstr** otherwise_entry);
+  Fragment CatchBlockEntry(const Array& handler_types, intptr_t handler_index);
+  Fragment TryCatch(int try_handler_index);
+  Fragment CheckStackOverflowInPrologue();
+  Fragment CheckStackOverflow();
+  Fragment CloneContext();
+  Fragment Constant(const Object& value);
+  Fragment CreateArray();
+  Fragment Goto(JoinEntryInstr* destination);
+  Fragment IntConstant(int64_t value);
+  Fragment InstanceCall(TokenPosition position,
+                        const dart::String& name,
+                        Token::Kind kind,
+                        intptr_t argument_count,
+                        intptr_t num_args_checked = 1);
+  Fragment InstanceCall(TokenPosition position,
+                        const dart::String& name,
+                        Token::Kind kind,
+                        intptr_t argument_count,
+                        const Array& argument_names,
+                        intptr_t num_args_checked = 1);
+  Fragment ClosureCall(int argument_count, const Array& argument_names);
+  Fragment ThrowException(TokenPosition position);
+  Fragment RethrowException(int catch_try_index);
+  Fragment LoadClassId();
+  Fragment LoadField(const dart::Field& field);
+  Fragment LoadField(intptr_t offset, intptr_t class_id = kDynamicCid);
+  Fragment LoadNativeField(MethodRecognizer::Kind kind,
+                           intptr_t offset,
+                           const Type& type,
+                           intptr_t class_id,
+                           bool is_immutable = false);
+  Fragment LoadLocal(LocalVariable* variable);
+  Fragment InitStaticField(const dart::Field& field);
+  Fragment LoadStaticField();
+  Fragment NullConstant();
+  Fragment NativeCall(const dart::String* name, const Function* function);
+  Fragment PushArgument();
+  Fragment Return();
+  Fragment StaticCall(TokenPosition position,
+                      const Function& target,
+                      intptr_t argument_count);
+  Fragment StaticCall(TokenPosition position,
+                      const Function& target,
+                      intptr_t argument_count,
+                      const Array& argument_names);
+  Fragment StoreIndexed(intptr_t class_id);
+  Fragment StoreInstanceFieldGuarded(const dart::Field& field);
+  Fragment StoreInstanceField(
+      const dart::Field& field,
+      StoreBarrierType emit_store_barrier = kEmitStoreBarrier);
+  Fragment StoreInstanceField(
+      intptr_t offset,
+      StoreBarrierType emit_store_barrier = kEmitStoreBarrier);
+  Fragment StoreLocal(LocalVariable* variable);
+  Fragment StoreStaticField(const dart::Field& field);
+  Fragment StringInterpolate();
+  Fragment ThrowTypeError();
+  Fragment ThrowNoSuchMethodError();
+  Fragment BuildImplicitClosureCreation(const Function& target);
+  Fragment GuardFieldLength(const dart::Field& field, intptr_t deopt_id);
+  Fragment GuardFieldClass(const dart::Field& field, intptr_t deopt_id);
+
+  dart::RawFunction* LookupMethodByMember(Member* target,
+                                          const dart::String& method_name);
+
+  LocalVariable* MakeTemporary();
+  LocalVariable* MakeNonTemporary(const dart::String& symbol);
+
+  intptr_t CurrentTryIndex();
+  intptr_t AllocateTryIndex() { return next_used_try_index_++; }
+
+  void AddVariable(VariableDeclaration* declaration, LocalVariable* variable);
+  void AddParameter(VariableDeclaration* declaration,
+                    LocalVariable* variable,
+                    intptr_t pos);
+  dart::LocalVariable* LookupVariable(VariableDeclaration* var);
+
+  void SetTempIndex(Definition* definition);
+
+  void Push(Definition* definition);
+  Value* Pop();
+  Fragment Drop();
+
+  bool IsInlining() { return exit_collector_ != NULL; }
+
+  Token::Kind MethodKind(const dart::String& name);
+
+  void InlineBailout(const char* reason);
+
+  Zone* zone_;
+  TranslationHelper translation_helper_;
+
+  // The node we are currently compiling (e.g. FunctionNode, Constructor,
+  // Field)
+  TreeNode* node_;
+
+  ParsedFunction* parsed_function_;
+  intptr_t osr_id_;
+  const ZoneGrowableArray<const ICData*>& ic_data_array_;
+  InlineExitCollector* exit_collector_;
+
+  intptr_t next_block_id_;
+  intptr_t AllocateBlockId() { return next_block_id_++; }
+
+  intptr_t next_function_id_;
+  intptr_t AllocateFunctionId() { return next_function_id_++; }
+
+  intptr_t context_depth_;
+  intptr_t loop_depth_;
+  intptr_t try_depth_;
+  intptr_t catch_depth_;
+  intptr_t for_in_depth_;
+  Fragment fragment_;
+  Value* stack_;
+  intptr_t pending_argument_count_;
+
+  GraphEntryInstr* graph_entry_;
+
+  ScopeBuildingResult* scopes_;
+
+  struct YieldContinuation {
+    Instruction* entry;
+    intptr_t try_index;
+
+    YieldContinuation(Instruction* entry, intptr_t try_index)
+        : entry(entry), try_index(try_index) {}
+
+    YieldContinuation()
+        : entry(NULL), try_index(CatchClauseNode::kInvalidTryIndex) {}
+  };
+
+  GrowableArray<YieldContinuation> yield_continuations_;
+
+  LocalVariable* CurrentException() {
+    return scopes_->exception_variables[catch_depth_ - 1];
+  }
+  LocalVariable* CurrentStackTrace() {
+    return scopes_->stack_trace_variables[catch_depth_ - 1];
+  }
+  LocalVariable* CurrentCatchContext() {
+    return scopes_->catch_context_variables[try_depth_];
+  }
+
+  // A chained list of breakable blocks. Chaining and lookup is done by the
+  // [BreakableBlock] class.
+  BreakableBlock* breakable_block_;
+
+  // A chained list of switch blocks. Chaining and lookup is done by the
+  // [SwitchBlock] class.
+  SwitchBlock* switch_block_;
+
+  // A chained list of try-finally blocks. Chaining and lookup is done by the
+  // [TryFinallyBlock] class.
+  TryFinallyBlock* try_finally_block_;
+
+  // A chained list of try-catch blocks. Chaining and lookup is done by the
+  // [TryCatchBlock] class.
+  TryCatchBlock* try_catch_block_;
+  intptr_t next_used_try_index_;
+
+  // A chained list of catch blocks. Chaining and lookup is done by the
+  // [CatchBlock] class.
+  CatchBlock* catch_block_;
+
+  ActiveClass active_class_;
+  DartTypeTranslator type_translator_;
+  ConstantEvaluator constant_evaluator_;
+
+  friend class BreakableBlock;
+  friend class CatchBlock;
+  friend class ConstantEvaluator;
+  friend class DartTypeTranslator;
+  friend class ScopeBuilder;
+  friend class SwitchBlock;
+  friend class TryCatchBlock;
+  friend class TryFinallyBlock;
+};
+
+}  // namespace kernel
+}  // namespace dart
+
+#endif  // !defined(DART_PRECOMPILED_RUNTIME)
+#endif  // RUNTIME_VM_KERNEL_TO_IL_H_
diff --git a/runtime/vm/libdart_dependency_helper.cc b/runtime/vm/libdart_dependency_helper.cc
index ccf26c8..75040ca 100644
--- a/runtime/vm/libdart_dependency_helper.cc
+++ b/runtime/vm/libdart_dependency_helper.cc
@@ -2,7 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-int main(int argc, char *argv[]) {
+int main(int argc, char* argv[]) {
   return 0;
 }
-
diff --git a/runtime/vm/locations.cc b/runtime/vm/locations.cc
index 5603a1c..5175819 100644
--- a/runtime/vm/locations.cc
+++ b/runtime/vm/locations.cc
@@ -44,8 +44,8 @@
     intptr_t input_count,
     Location out,
     LocationSummary::ContainsCall contains_call) {
-  LocationSummary* summary = new(zone) LocationSummary(
-      zone, input_count, 0, contains_call);
+  LocationSummary* summary =
+      new (zone) LocationSummary(zone, input_count, 0, contains_call);
   for (intptr_t i = 0; i < input_count; i++) {
     summary->set_in(i, Location::RequiresRegister());
   }
@@ -73,48 +73,48 @@
 Location Location::RegisterOrConstant(Value* value) {
   ConstantInstr* constant = value->definition()->AsConstant();
   return ((constant != NULL) && Assembler::IsSafe(constant->value()))
-      ? Location::Constant(constant)
-      : Location::RequiresRegister();
+             ? Location::Constant(constant)
+             : Location::RequiresRegister();
 }
 
 
 Location Location::RegisterOrSmiConstant(Value* value) {
   ConstantInstr* constant = value->definition()->AsConstant();
   return ((constant != NULL) && Assembler::IsSafeSmi(constant->value()))
-      ? Location::Constant(constant)
-      : Location::RequiresRegister();
+             ? Location::Constant(constant)
+             : Location::RequiresRegister();
 }
 
 
 Location Location::WritableRegisterOrSmiConstant(Value* value) {
   ConstantInstr* constant = value->definition()->AsConstant();
   return ((constant != NULL) && Assembler::IsSafeSmi(constant->value()))
-      ? Location::Constant(constant)
-      : Location::WritableRegister();
+             ? Location::Constant(constant)
+             : Location::WritableRegister();
 }
 
 
 Location Location::FixedRegisterOrConstant(Value* value, Register reg) {
   ConstantInstr* constant = value->definition()->AsConstant();
   return ((constant != NULL) && Assembler::IsSafe(constant->value()))
-      ? Location::Constant(constant)
-      : Location::RegisterLocation(reg);
+             ? Location::Constant(constant)
+             : Location::RegisterLocation(reg);
 }
 
 
 Location Location::FixedRegisterOrSmiConstant(Value* value, Register reg) {
   ConstantInstr* constant = value->definition()->AsConstant();
   return ((constant != NULL) && Assembler::IsSafeSmi(constant->value()))
-      ? Location::Constant(constant)
-      : Location::RegisterLocation(reg);
+             ? Location::Constant(constant)
+             : Location::RegisterLocation(reg);
 }
 
 
 Location Location::AnyOrConstant(Value* value) {
   ConstantInstr* constant = value->definition()->AsConstant();
   return ((constant != NULL) && Assembler::IsSafe(constant->value()))
-      ? Location::Constant(constant)
-      : Location::Any();
+             ? Location::Constant(constant)
+             : Location::Any();
 }
 
 
@@ -125,7 +125,7 @@
   const Register base = base_reg();
   if (base == FPREG) {
     if (index < 0) {
-      const intptr_t offset = (kParamEndSlotFromFp - index)  * kWordSize;
+      const intptr_t offset = (kParamEndSlotFromFp - index) * kWordSize;
       return Address(base, offset);
     } else {
       const intptr_t offset = (kFirstLocalSlotFromFp - index) * kWordSize;
@@ -142,7 +142,7 @@
   const intptr_t index = stack_index();
   if (base_reg() == FPREG) {
     if (index < 0) {
-      const intptr_t offset = (kParamEndSlotFromFp - index)  * kWordSize;
+      const intptr_t offset = (kParamEndSlotFromFp - index) * kWordSize;
       return offset;
     } else {
       const intptr_t offset = (kFirstLocalSlotFromFp - index) * kWordSize;
@@ -162,12 +162,18 @@
 
 const char* Location::Name() const {
   switch (kind()) {
-    case kInvalid: return "?";
-    case kRegister: return Assembler::RegisterName(reg());
-    case kFpuRegister: return Assembler::FpuRegisterName(fpu_reg());
-    case kStackSlot: return "S";
-    case kDoubleStackSlot: return "DS";
-    case kQuadStackSlot: return "QS";
+    case kInvalid:
+      return "?";
+    case kRegister:
+      return Assembler::RegisterName(reg());
+    case kFpuRegister:
+      return Assembler::FpuRegisterName(fpu_reg());
+    case kStackSlot:
+      return "S";
+    case kDoubleStackSlot:
+      return "DS";
+    case kQuadStackSlot:
+      return "QS";
     case kUnallocated:
       switch (policy()) {
         case kAny:
diff --git a/runtime/vm/locations.h b/runtime/vm/locations.h
index 0692007..c2d815b 100644
--- a/runtime/vm/locations.h
+++ b/runtime/vm/locations.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_LOCATIONS_H_
-#define VM_LOCATIONS_H_
+#ifndef RUNTIME_VM_LOCATIONS_H_
+#define RUNTIME_VM_LOCATIONS_H_
 
 #include "vm/allocation.h"
 #include "vm/assembler.h"
@@ -87,9 +87,9 @@
 
     // Spill slots allocated by the register allocator.  Payload contains
     // a spill index.
-    kStackSlot = 4,  // Word size slot.
+    kStackSlot = 4,        // Word size slot.
     kDoubleStackSlot = 7,  // 64bit stack slot.
-    kQuadStackSlot = 11,  // 128bit stack slot.
+    kQuadStackSlot = 11,   // 128bit stack slot.
 
     // Register location represents a fixed register.  Payload contains
     // register code.
@@ -132,16 +132,14 @@
     ASSERT(IsInvalid());
   }
 
-  Location(const Location& other) : ValueObject(), value_(other.value_) { }
+  Location(const Location& other) : ValueObject(), value_(other.value_) {}
 
   Location& operator=(const Location& other) {
     value_ = other.value_;
     return *this;
   }
 
-  bool IsInvalid() const {
-    return value_ == kInvalidLocation;
-  }
+  bool IsInvalid() const { return value_ == kInvalidLocation; }
 
   // Constants.
   bool IsConstant() const {
@@ -179,22 +177,16 @@
     kSameAsFirstInput,
   };
 
-  bool IsUnallocated() const {
-    return kind() == kUnallocated;
-  }
+  bool IsUnallocated() const { return kind() == kUnallocated; }
 
-  bool IsRegisterBeneficial() {
-    return !Equals(Any());
-  }
+  bool IsRegisterBeneficial() { return !Equals(Any()); }
 
   static Location UnallocatedLocation(Policy policy) {
     return Location(kUnallocated, PolicyField::encode(policy));
   }
 
   // Any free register is suitable to replace this unallocated location.
-  static Location Any() {
-    return UnallocatedLocation(kAny);
-  }
+  static Location Any() { return UnallocatedLocation(kAny); }
 
   static Location PrefersRegister() {
     return UnallocatedLocation(kPrefersRegister);
@@ -219,9 +211,7 @@
   }
 
   // Empty location. Used if there the location should be ignored.
-  static Location NoLocation() {
-    return Location();
-  }
+  static Location NoLocation() { return Location(); }
 
   Policy policy() const {
     ASSERT(IsUnallocated());
@@ -233,9 +223,7 @@
     return Location(kRegister, reg);
   }
 
-  bool IsRegister() const {
-    return kind() == kRegister;
-  }
+  bool IsRegister() const { return kind() == kRegister; }
 
   Register reg() const {
     ASSERT(IsRegister());
@@ -247,9 +235,7 @@
     return Location(kFpuRegister, reg);
   }
 
-  bool IsFpuRegister() const {
-    return kind() == kFpuRegister;
-  }
+  bool IsFpuRegister() const { return kind() == kFpuRegister; }
 
   FpuRegister fpu_reg() const {
     ASSERT(IsFpuRegister());
@@ -260,8 +246,7 @@
     return (kind == kRegister) || (kind == kFpuRegister);
   }
 
-  static Location MachineRegisterLocation(Kind kind,
-                                          intptr_t reg) {
+  static Location MachineRegisterLocation(Kind kind, intptr_t reg) {
     if (kind == kRegister) {
       return RegisterLocation(static_cast<Register>(reg));
     } else {
@@ -270,9 +255,7 @@
     }
   }
 
-  bool IsMachineRegister() const {
-    return IsMachineRegisterKind(kind());
-  }
+  bool IsMachineRegister() const { return IsMachineRegisterKind(kind()); }
 
   intptr_t register_code() const {
     ASSERT(IsMachineRegister());
@@ -286,45 +269,38 @@
   }
 
   // Spill slots.
-  static Location StackSlot(intptr_t stack_index,
-                            Register base = FPREG) {
-    uword payload = StackSlotBaseField::encode(base)
-        | StackIndexField::encode(EncodeStackIndex(stack_index));
+  static Location StackSlot(intptr_t stack_index, Register base = FPREG) {
+    uword payload = StackSlotBaseField::encode(base) |
+                    StackIndexField::encode(EncodeStackIndex(stack_index));
     Location loc(kStackSlot, payload);
     // Ensure that sign is preserved.
     ASSERT(loc.stack_index() == stack_index);
     return loc;
   }
 
-  bool IsStackSlot() const {
-    return kind() == kStackSlot;
-  }
+  bool IsStackSlot() const { return kind() == kStackSlot; }
 
   static Location DoubleStackSlot(intptr_t stack_index) {
-    uword payload = StackSlotBaseField::encode(FPREG)
-        | StackIndexField::encode(EncodeStackIndex(stack_index));
+    uword payload = StackSlotBaseField::encode(FPREG) |
+                    StackIndexField::encode(EncodeStackIndex(stack_index));
     Location loc(kDoubleStackSlot, payload);
     // Ensure that sign is preserved.
     ASSERT(loc.stack_index() == stack_index);
     return loc;
   }
 
-  bool IsDoubleStackSlot() const {
-    return kind() == kDoubleStackSlot;
-  }
+  bool IsDoubleStackSlot() const { return kind() == kDoubleStackSlot; }
 
   static Location QuadStackSlot(intptr_t stack_index) {
-    uword payload = StackSlotBaseField::encode(FPREG)
-        | StackIndexField::encode(EncodeStackIndex(stack_index));
+    uword payload = StackSlotBaseField::encode(FPREG) |
+                    StackIndexField::encode(EncodeStackIndex(stack_index));
     Location loc(kQuadStackSlot, payload);
     // Ensure that sign is preserved.
     ASSERT(loc.stack_index() == stack_index);
     return loc;
   }
 
-  bool IsQuadStackSlot() const {
-    return kind() == kQuadStackSlot;
-  }
+  bool IsQuadStackSlot() const { return kind() == kQuadStackSlot; }
 
   Register base_reg() const {
     ASSERT(HasStackIndex());
@@ -341,7 +317,7 @@
     return IsStackSlot() || IsDoubleStackSlot() || IsQuadStackSlot();
   }
 
-  // DBC does not have an notion of 'address' in its instruction set.
+// DBC does not have an notion of 'address' in its instruction set.
 #if !defined(TARGET_ARCH_DBC)
   // Return a memory operand for stack slot locations.
   Address ToStackSlotAddress() const;
@@ -364,15 +340,11 @@
   const char* ToCString() const;
 
   // Compare two locations.
-  bool Equals(Location other) const {
-    return value_ == other.value_;
-  }
+  bool Equals(Location other) const { return value_ == other.value_; }
 
   // If current location is constant might return something that
   // is not equal to any Kind.
-  Kind kind() const {
-    return KindField::decode(value_);
-  }
+  Kind kind() const { return KindField::decode(value_); }
 
   Location Copy() const;
 
@@ -381,37 +353,36 @@
                             intptr_t* fpu_reg_slots) const;
 
  private:
-  explicit Location(uword value) : value_(value) { }
+  explicit Location(uword value) : value_(value) {}
 
   Location(Kind kind, uword payload)
-      : value_(KindField::encode(kind) | PayloadField::encode(payload)) { }
+      : value_(KindField::encode(kind) | PayloadField::encode(payload)) {}
 
-  uword payload() const {
-    return PayloadField::decode(value_);
-  }
+  uword payload() const { return PayloadField::decode(value_); }
 
   class KindField : public BitField<uword, Kind, 0, kBitsForKind> {};
-  class PayloadField :
-      public BitField<uword, uword, kBitsForKind, kBitsForPayload> {};
+  class PayloadField
+      : public BitField<uword, uword, kBitsForKind, kBitsForPayload> {};
 
   // Layout for kUnallocated locations payload.
   typedef BitField<uword, Policy, 0, 3> PolicyField;
 
-  // Layout for stack slots.
+// Layout for stack slots.
 #if defined(ARCH_IS_64_BIT)
   static const intptr_t kBitsForBaseReg = 6;
 #else
   static const intptr_t kBitsForBaseReg = 5;
 #endif
   static const intptr_t kBitsForStackIndex = kBitsForPayload - kBitsForBaseReg;
-  class StackSlotBaseField :
-      public BitField<uword, Register, 0, kBitsForBaseReg> {};
-  class StackIndexField :
-      public BitField<uword, intptr_t, kBitsForBaseReg, kBitsForStackIndex> {};
+  class StackSlotBaseField
+      : public BitField<uword, Register, 0, kBitsForBaseReg> {};
+  class StackIndexField
+      : public BitField<uword, intptr_t, kBitsForBaseReg, kBitsForStackIndex> {
+  };
   COMPILE_ASSERT(1 << kBitsForBaseReg >= kNumberOfCpuRegisters);
 
-  static const intptr_t kStackIndexBias =
-      static_cast<intptr_t>(1) << (kBitsForStackIndex - 1);
+  static const intptr_t kStackIndexBias = static_cast<intptr_t>(1)
+                                          << (kBitsForStackIndex - 1);
 
   // Location either contains kind and payload fields or a tagged handle for
   // a constant locations. Values of enumeration Kind are selected in such a
@@ -454,12 +425,12 @@
 };
 
 
-template<typename T>
+template <typename T>
 class SmallSet {
  public:
-  SmallSet() : data_(0) { }
+  SmallSet() : data_(0) {}
 
-  explicit SmallSet(intptr_t data) : data_(data) { }
+  explicit SmallSet(intptr_t data) : data_(data) {}
 
   bool Contains(T value) const { return (data_ & ToMask(value)) != 0; }
 
@@ -484,9 +455,7 @@
 class RegisterSet : public ValueObject {
  public:
   RegisterSet()
-      : cpu_registers_(),
-        untagged_cpu_registers_(),
-        fpu_registers_() {
+      : cpu_registers_(), untagged_cpu_registers_(), fpu_registers_() {
     ASSERT(kNumberOfCpuRegisters <= (kWordSize * kBitsPerByte));
     ASSERT(kNumberOfFpuRegisters <= (kWordSize * kBitsPerByte));
   }
@@ -528,7 +497,7 @@
       Register r = static_cast<Register>(i);
       if (ContainsRegister(r)) {
         THR_Print("%s %s\n", Assembler::RegisterName(r),
-                           IsTagged(r) ? "tagged" : "untagged");
+                  IsTagged(r) ? "tagged" : "untagged");
       }
     }
 
@@ -584,20 +553,14 @@
 // Specification of locations for inputs and output.
 class LocationSummary : public ZoneAllocated {
  public:
-  enum ContainsCall {
-    kNoCall,
-    kCall,
-    kCallOnSlowPath
-  };
+  enum ContainsCall { kNoCall, kCall, kCallOnSlowPath };
 
   LocationSummary(Zone* zone,
                   intptr_t input_count,
                   intptr_t temp_count,
                   LocationSummary::ContainsCall contains_call);
 
-  intptr_t input_count() const {
-    return num_inputs_;
-  }
+  intptr_t input_count() const { return num_inputs_; }
 
   Location in(intptr_t index) const {
     ASSERT(index >= 0);
@@ -618,9 +581,7 @@
     input_locations_[index] = loc;
   }
 
-  intptr_t temp_count() const {
-    return num_temps_;
-  }
+  intptr_t temp_count() const { return num_temps_; }
 
   Location temp(intptr_t index) const {
     ASSERT(index >= 0);
@@ -641,9 +602,7 @@
     temp_locations_[index] = loc;
   }
 
-  intptr_t output_count() const {
-    return 1;
-  }
+  intptr_t output_count() const { return 1; }
 
   Location out(intptr_t index) const {
     ASSERT(index == 0);
@@ -657,12 +616,11 @@
 
   void set_out(intptr_t index, Location loc) {
     ASSERT(index == 0);
-    // DBC calls are different from call on other architectures so this
-    // assert doesn't make sense.
+// DBC calls are different from call on other architectures so this
+// assert doesn't make sense.
 #if !defined(TARGET_ARCH_DBC)
-    ASSERT(!always_calls() ||
-           (loc.IsMachineRegister() || loc.IsInvalid() ||
-            loc.IsPairLocation()));
+    ASSERT(!always_calls() || (loc.IsMachineRegister() || loc.IsInvalid() ||
+                               loc.IsPairLocation()));
 #endif
     output_location_ = loc;
   }
@@ -673,21 +631,13 @@
     }
     return stack_bitmap_;
   }
-  void SetStackBit(intptr_t index) {
-    stack_bitmap()->Set(index, true);
-  }
+  void SetStackBit(intptr_t index) { stack_bitmap()->Set(index, true); }
 
-  bool always_calls() const {
-    return contains_call_ == kCall;
-  }
+  bool always_calls() const { return contains_call_ == kCall; }
 
-  bool can_call() {
-    return contains_call_ != kNoCall;
-  }
+  bool can_call() { return contains_call_ != kNoCall; }
 
-  bool HasCallOnSlowPath() {
-    return can_call() && !always_calls();
-  }
+  bool HasCallOnSlowPath() { return can_call() && !always_calls(); }
 
   void PrintTo(BufferFormatter* f) const;
 
@@ -696,9 +646,7 @@
                                Location out,
                                ContainsCall contains_call);
 
-  RegisterSet* live_registers() {
-    return &live_registers_;
-  }
+  RegisterSet* live_registers() { return &live_registers_; }
 
 #if defined(DEBUG)
   // Debug only verification that ensures that writable registers are correctly
@@ -727,4 +675,4 @@
 
 }  // namespace dart
 
-#endif  // VM_LOCATIONS_H_
+#endif  // RUNTIME_VM_LOCATIONS_H_
diff --git a/runtime/vm/lockers.cc b/runtime/vm/lockers.cc
index b8ac4b6..6b47e28 100644
--- a/runtime/vm/lockers.cc
+++ b/runtime/vm/lockers.cc
@@ -15,8 +15,8 @@
   uint32_t old_state = Thread::SetAtSafepoint(true, 0);
   uword addr =
       reinterpret_cast<uword>(thread) + Thread::safepoint_state_offset();
-  if (AtomicOperations::CompareAndSwapUint32(
-          reinterpret_cast<uint32_t*>(addr), old_state, 0) != old_state) {
+  if (AtomicOperations::CompareAndSwapUint32(reinterpret_cast<uint32_t*>(addr),
+                                             old_state, 0) != old_state) {
     // Fast update failed which means we could potentially be in the middle
     // of a safepoint operation and need to block for it.
     SafepointHandler* handler = thread->isolate()->safepoint_handler();
@@ -29,6 +29,7 @@
 Monitor::WaitResult MonitorLocker::WaitWithSafepointCheck(Thread* thread,
                                                           int64_t millis) {
   ASSERT(thread == Thread::Current());
+  ASSERT(thread->execution_state() == Thread::kThreadInVM);
   thread->set_execution_state(Thread::kThreadInBlockedState);
   thread->EnterSafepoint();
   Monitor::WaitResult result = monitor_->Wait(millis);
@@ -37,8 +38,8 @@
   uint32_t old_state = Thread::SetAtSafepoint(true, 0);
   uword addr =
       reinterpret_cast<uword>(thread) + Thread::safepoint_state_offset();
-  if (AtomicOperations::CompareAndSwapUint32(
-          reinterpret_cast<uint32_t*>(addr), old_state, 0) != old_state) {
+  if (AtomicOperations::CompareAndSwapUint32(reinterpret_cast<uint32_t*>(addr),
+                                             old_state, 0) != old_state) {
     // Fast update failed which means we could potentially be in the middle
     // of a safepoint operation and need to block for it.
     monitor_->Exit();
diff --git a/runtime/vm/lockers.h b/runtime/vm/lockers.h
index a0b1a17..d16c77e 100644
--- a/runtime/vm/lockers.h
+++ b/runtime/vm/lockers.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_LOCKERS_H_
-#define VM_LOCKERS_H_
+#ifndef RUNTIME_VM_LOCKERS_H_
+#define RUNTIME_VM_LOCKERS_H_
 
 #include "platform/assert.h"
 #include "vm/allocation.h"
@@ -170,19 +170,16 @@
   }
 
   Monitor::WaitResult WaitWithSafepointCheck(
-      Thread* thread, int64_t millis = Monitor::kNoTimeout);
+      Thread* thread,
+      int64_t millis = Monitor::kNoTimeout);
 
   Monitor::WaitResult WaitMicros(int64_t micros = Monitor::kNoTimeout) {
     return monitor_->WaitMicros(micros);
   }
 
-  void Notify() {
-    monitor_->Notify();
-  }
+  void Notify() { monitor_->Notify(); }
 
-  void NotifyAll() {
-    monitor_->NotifyAll();
-  }
+  void NotifyAll() { monitor_->NotifyAll(); }
 
  private:
   Monitor* const monitor_;
@@ -212,9 +209,7 @@
 class SafepointMutexLocker : public ValueObject {
  public:
   explicit SafepointMutexLocker(Mutex* mutex);
-  virtual ~SafepointMutexLocker() {
-    mutex_->Unlock();
-  }
+  virtual ~SafepointMutexLocker() { mutex_->Unlock(); }
 
  private:
   Mutex* const mutex_;
@@ -243,9 +238,7 @@
 class SafepointMonitorLocker : public ValueObject {
  public:
   explicit SafepointMonitorLocker(Monitor* monitor);
-  virtual ~SafepointMonitorLocker() {
-    monitor_->Exit();
-  }
+  virtual ~SafepointMonitorLocker() { monitor_->Exit(); }
 
   Monitor::WaitResult Wait(int64_t millis = Monitor::kNoTimeout);
 
@@ -258,4 +251,4 @@
 }  // namespace dart
 
 
-#endif  // VM_LOCKERS_H_
+#endif  // RUNTIME_VM_LOCKERS_H_
diff --git a/runtime/vm/log.cc b/runtime/vm/log.cc
index f5247c7..15e3e20 100644
--- a/runtime/vm/log.cc
+++ b/runtime/vm/log.cc
@@ -11,16 +11,15 @@
 
 DEFINE_FLAG(bool, force_log_flush, false, "Always flush log messages.");
 
-DEFINE_FLAG(charp, isolate_log_filter, NULL,
+DEFINE_FLAG(charp,
+            isolate_log_filter,
+            NULL,
             "Log isolates whose name include the filter. "
             "Default: service isolate log messages are suppressed "
             "(specify 'vm-service' to log them).");
 
 Log::Log(LogPrinter printer)
-    : printer_(printer),
-      manual_flush_(0),
-      buffer_(0) {
-}
+    : printer_(printer), manual_flush_(0), buffer_(0) {}
 
 
 Log::~Log() {
diff --git a/runtime/vm/log.h b/runtime/vm/log.h
index a2f18fa..c9cafc8 100644
--- a/runtime/vm/log.h
+++ b/runtime/vm/log.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_LOG_H_
-#define VM_LOG_H_
+#ifndef RUNTIME_VM_LOG_H_
+#define RUNTIME_VM_LOG_H_
 
 #include "vm/allocation.h"
 #include "vm/growable_array.h"
@@ -15,15 +15,12 @@
 class Thread;
 
 #if defined(_MSC_VER)
-#define THR_Print(format, ...) \
-    Log::Current()->Print(format, __VA_ARGS__)
+#define THR_Print(format, ...) Log::Current()->Print(format, __VA_ARGS__)
 #else
-#define THR_Print(format, ...) \
-    Log::Current()->Print(format, ##__VA_ARGS__)
+#define THR_Print(format, ...) Log::Current()->Print(format, ##__VA_ARGS__)
 #endif
 
-#define THR_VPrint(format, args) \
-    Log::Current()->VPrint(format, args)
+#define THR_VPrint(format, args) Log::Current()->VPrint(format, args)
 
 typedef void (*LogPrinter)(const char* str, ...);
 
@@ -98,4 +95,4 @@
 
 }  // namespace dart
 
-#endif  // VM_LOG_H_
+#endif  // RUNTIME_VM_LOG_H_
diff --git a/runtime/vm/longjump.cc b/runtime/vm/longjump.cc
index 2bc7e31..d79ee76 100644
--- a/runtime/vm/longjump.cc
+++ b/runtime/vm/longjump.cc
@@ -31,8 +31,8 @@
   Simulator* sim = Simulator::Current();
   // When using simulator, only mutator thread should refer to Simulator
   // since there can be only one per isolate.
-  uword top_exit_frame_info = thread->IsMutatorThread() ?
-      sim->top_exit_frame_info() : 0;
+  uword top_exit_frame_info =
+      thread->IsMutatorThread() ? sim->top_exit_frame_info() : 0;
 #else
   uword top_exit_frame_info = thread->top_exit_frame_info();
 #endif
@@ -56,7 +56,7 @@
 #if defined(DEBUG)
 #define CHECK_REUSABLE_HANDLE(name)                                            \
   ASSERT(!thread->reusable_##name##_handle_scope_active());
-REUSABLE_HANDLE_LIST(CHECK_REUSABLE_HANDLE)
+  REUSABLE_HANDLE_LIST(CHECK_REUSABLE_HANDLE)
 #undef CHECK_REUSABLE_HANDLE
 #endif  // defined(DEBUG)
 
diff --git a/runtime/vm/longjump.h b/runtime/vm/longjump.h
index ce4f813..7fbe9eb 100644
--- a/runtime/vm/longjump.h
+++ b/runtime/vm/longjump.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_LONGJUMP_H_
-#define VM_LONGJUMP_H_
+#ifndef RUNTIME_VM_LONGJUMP_H_
+#define RUNTIME_VM_LONGJUMP_H_
 
 #include <setjmp.h>
 
@@ -17,15 +17,13 @@
 class LongJumpScope : public StackResource {
  public:
   LongJumpScope()
-    : StackResource(Thread::Current()),
-      top_(NULL),
-      base_(Thread::Current()->long_jump_base()) {
+      : StackResource(Thread::Current()),
+        top_(NULL),
+        base_(Thread::Current()->long_jump_base()) {
     Thread::Current()->set_long_jump_base(this);
   }
 
-  ~LongJumpScope() {
-    Thread::Current()->set_long_jump_base(base_);
-  }
+  ~LongJumpScope() { Thread::Current()->set_long_jump_base(base_); }
 
   jmp_buf* Set();
   void Jump(int value, const Error& error);
@@ -45,4 +43,4 @@
 
 }  // namespace dart
 
-#endif  // VM_LONGJUMP_H_
+#endif  // RUNTIME_VM_LONGJUMP_H_
diff --git a/runtime/vm/longjump_test.cc b/runtime/vm/longjump_test.cc
index 4f48050..5e35c0c 100644
--- a/runtime/vm/longjump_test.cc
+++ b/runtime/vm/longjump_test.cc
@@ -9,9 +9,8 @@
 namespace dart {
 
 static void LongJumpHelper(LongJumpScope* jump) {
-  const Error& error =
-      Error::Handle(LanguageError::New(
-          String::Handle(String::New("LongJumpHelper"))));
+  const Error& error = Error::Handle(
+      LanguageError::New(String::Handle(String::New("LongJumpHelper"))));
   jump->Jump(1, error);
   UNREACHABLE();
 }
diff --git a/runtime/vm/megamorphic_cache_table.cc b/runtime/vm/megamorphic_cache_table.cc
index e3d34dd..c6edb75 100644
--- a/runtime/vm/megamorphic_cache_table.cc
+++ b/runtime/vm/megamorphic_cache_table.cc
@@ -53,29 +53,26 @@
 void MegamorphicCacheTable::InitMissHandler(Isolate* isolate) {
   // The miss handler for a class ID not found in the table is invoked as a
   // normal Dart function.
-  const Code& code =
-      Code::Handle(StubCode::Generate("_stub_MegamorphicMiss",
-                                      StubCode::GenerateMegamorphicMissStub));
+  const Code& code = Code::Handle(StubCode::Generate(
+      "_stub_MegamorphicMiss", StubCode::GenerateMegamorphicMissStub));
   // When FLAG_lazy_dispatchers=false, this stub can be on the stack during
   // exceptions, but it has a corresponding function so IsStubCode is false and
   // it is considered in the search for an exception handler.
   code.set_exception_handlers(Object::empty_exception_handlers());
   const Class& cls =
       Class::Handle(Type::Handle(Type::DartFunctionType()).type_class());
-  const Function& function =
-      Function::Handle(Function::New(Symbols::MegamorphicMiss(),
-                                     RawFunction::kRegularFunction,
-                                     false,  // Not static.
-                                     false,  // Not const.
-                                     false,  // Not abstract.
-                                     false,  // Not external.
-                                     false,  // Not native.
-                                     cls,
-                                     TokenPosition::kNoSource));
+  const Function& function = Function::Handle(
+      Function::New(Symbols::MegamorphicMiss(), RawFunction::kRegularFunction,
+                    true,   // Static, but called as a method.
+                    false,  // Not const.
+                    false,  // Not abstract.
+                    false,  // Not external.
+                    false,  // Not native.
+                    cls, TokenPosition::kNoSource));
   function.set_result_type(Type::Handle(Type::DynamicType()));
   function.set_is_debuggable(false);
   function.set_is_visible(false);
-  function.AttachCode(code);
+  function.AttachCode(code);  // Has a single entry point, as a static function.
   // For inclusion in Snapshot::kAppWithJIT.
   function.set_unoptimized_code(code);
 
@@ -101,8 +98,8 @@
       max_size = buckets.Length();
     }
   }
-  OS::Print("%" Pd " megamorphic caches using %" Pd "KB.\n",
-            table.Length(), size / 1024);
+  OS::Print("%" Pd " megamorphic caches using %" Pd "KB.\n", table.Length(),
+            size / 1024);
 
   intptr_t* probe_counts = new intptr_t[max_size];
   intptr_t entry_count = 0;
@@ -143,10 +140,9 @@
   intptr_t cumulative_entries = 0;
   for (intptr_t i = 0; i <= max_probe_count; i++) {
     cumulative_entries += probe_counts[i];
-    OS::Print("Megamorphic probe %" Pd ": %" Pd " (%lf)\n",
-              i, probe_counts[i],
+    OS::Print("Megamorphic probe %" Pd ": %" Pd " (%lf)\n", i, probe_counts[i],
               static_cast<double>(cumulative_entries) /
-              static_cast<double>(entry_count));
+                  static_cast<double>(entry_count));
   }
   delete[] probe_counts;
 }
diff --git a/runtime/vm/megamorphic_cache_table.h b/runtime/vm/megamorphic_cache_table.h
index 4c7242a..ee65118 100644
--- a/runtime/vm/megamorphic_cache_table.h
+++ b/runtime/vm/megamorphic_cache_table.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_MEGAMORPHIC_CACHE_TABLE_H_
-#define VM_MEGAMORPHIC_CACHE_TABLE_H_
+#ifndef RUNTIME_VM_MEGAMORPHIC_CACHE_TABLE_H_
+#define RUNTIME_VM_MEGAMORPHIC_CACHE_TABLE_H_
 
 #include "vm/allocation.h"
 
@@ -34,4 +34,4 @@
 
 }  // namespace dart
 
-#endif  // VM_MEGAMORPHIC_CACHE_TABLE_H_
+#endif  // RUNTIME_VM_MEGAMORPHIC_CACHE_TABLE_H_
diff --git a/runtime/vm/memory_region.cc b/runtime/vm/memory_region.cc
index ce0a107..0b4603d 100644
--- a/runtime/vm/memory_region.cc
+++ b/runtime/vm/memory_region.cc
@@ -10,8 +10,8 @@
   ASSERT(from.pointer() != NULL && from.size() > 0);
   ASSERT(this->size() >= from.size());
   ASSERT(offset <= this->size() - from.size());
-  memmove(reinterpret_cast<void*>(start() + offset),
-          from.pointer(), from.size());
+  memmove(reinterpret_cast<void*>(start() + offset), from.pointer(),
+          from.size());
 }
 
 }  // namespace dart
diff --git a/runtime/vm/memory_region.h b/runtime/vm/memory_region.h
index eaa5221..2b1763a 100644
--- a/runtime/vm/memory_region.h
+++ b/runtime/vm/memory_region.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_MEMORY_REGION_H_
-#define VM_MEMORY_REGION_H_
+#ifndef RUNTIME_VM_MEMORY_REGION_H_
+#define RUNTIME_VM_MEMORY_REGION_H_
 
 #include "platform/assert.h"
 #include "vm/allocation.h"
@@ -16,8 +16,8 @@
 // of the region.
 class MemoryRegion : public ValueObject {
  public:
-  MemoryRegion() : pointer_(NULL), size_(0) { }
-  MemoryRegion(void* pointer, uword size) : pointer_(pointer), size_(size) { }
+  MemoryRegion() : pointer_(NULL), size_(0) {}
+  MemoryRegion(void* pointer, uword size) : pointer_(pointer), size_(size) {}
   MemoryRegion(const MemoryRegion& other) : ValueObject() { *this = other; }
   MemoryRegion& operator=(const MemoryRegion& other) {
     pointer_ = other.pointer_;
@@ -34,15 +34,18 @@
   uword start() const { return reinterpret_cast<uword>(pointer_); }
   uword end() const { return start() + size_; }
 
-  template<typename T> T Load(uword offset) const {
+  template <typename T>
+  T Load(uword offset) const {
     return *ComputeInternalPointer<T>(offset);
   }
 
-  template<typename T> void Store(uword offset, T value) const {
+  template <typename T>
+  void Store(uword offset, T value) const {
     *ComputeInternalPointer<T>(offset) = value;
   }
 
-  template<typename T> T* PointerTo(uword offset) const {
+  template <typename T>
+  T* PointerTo(uword offset) const {
     return ComputeInternalPointer<T>(offset);
   }
 
@@ -67,7 +70,8 @@
   }
 
  private:
-  template<typename T> T* ComputeInternalPointer(uword offset) const {
+  template <typename T>
+  T* ComputeInternalPointer(uword offset) const {
     ASSERT(size() >= sizeof(T));
     ASSERT(offset <= size() - sizeof(T));
     return reinterpret_cast<T*>(start() + offset);
@@ -79,4 +83,4 @@
 
 }  // namespace dart
 
-#endif  // VM_MEMORY_REGION_H_
+#endif  // RUNTIME_VM_MEMORY_REGION_H_
diff --git a/runtime/vm/message.cc b/runtime/vm/message.cc
index 0cb618a..4d5fc31 100644
--- a/runtime/vm/message.cc
+++ b/runtime/vm/message.cc
@@ -30,10 +30,10 @@
   switch (priority) {
     case kNormalPriority:
       return "Normal";
-    break;
+      break;
     case kOOBPriority:
       return "OOB";
-    break;
+      break;
     default:
       UNIMPLEMENTED();
       return NULL;
@@ -65,9 +65,9 @@
   } else {
     ASSERT(tail_ != NULL);
     if (!before_events) {
-        // Append at the tail.
-        tail_->next_ = msg;
-        tail_ = msg;
+      // Append at the tail.
+      tail_->next_ = msg;
+      tail_ = msg;
     } else {
       ASSERT(msg->dest_port() == Message::kIllegalPort);
       if (head_->dest_port() != Message::kIllegalPort) {
@@ -106,7 +106,7 @@
     }
 #if defined(DEBUG)
     result->next_ = result;  // Make sure to trigger ASSERT in Enqueue.
-#endif  // DEBUG
+#endif                       // DEBUG
     return result;
   }
   return NULL;
@@ -129,14 +129,12 @@
 }
 
 
-MessageQueue::Iterator::Iterator(const MessageQueue* queue)
-    : next_(NULL) {
+MessageQueue::Iterator::Iterator(const MessageQueue* queue) : next_(NULL) {
   Reset(queue);
 }
 
 
-MessageQueue::Iterator::~Iterator() {
-}
+MessageQueue::Iterator::~Iterator() {}
 
 void MessageQueue::Iterator::Reset(const MessageQueue* queue) {
   ASSERT(queue != NULL);
@@ -171,7 +169,7 @@
   MessageQueue::Iterator it(this);
   while (it.HasNext()) {
     Message* current = it.Next();
-     ASSERT(current != NULL);
+    ASSERT(current != NULL);
     if (current->Id() == id) {
       return current;
     }
@@ -196,14 +194,13 @@
     JSONObject message(&messages);
     message.AddProperty("type", "Message");
     message.AddPropertyF("name", "Isolate Message (%" Px ")", current->Id());
-    message.AddPropertyF("messageObjectId", "messages/%" Px "",
-                         current->Id());
+    message.AddPropertyF("messageObjectId", "messages/%" Px "", current->Id());
     message.AddProperty("size", current->len());
     message.AddProperty("index", depth++);
     message.AddPropertyF("_destinationPort", "%" Pd64 "",
-        static_cast<int64_t>(current->dest_port()));
+                         static_cast<int64_t>(current->dest_port()));
     message.AddProperty("_priority",
-        Message::PriorityAsString(current->priority()));
+                        Message::PriorityAsString(current->priority()));
     // TODO(johnmccutchan): Move port -> handler map out of Dart and into the
     // VM, that way we can lookup the handler without invoking Dart code.
     msg_handler = DartLibraryCalls::LookupHandler(current->dest_port());
diff --git a/runtime/vm/message.h b/runtime/vm/message.h
index aaa14c7..4765ef2 100644
--- a/runtime/vm/message.h
+++ b/runtime/vm/message.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_MESSAGE_H_
-#define VM_MESSAGE_H_
+#ifndef RUNTIME_VM_MESSAGE_H_
+#define RUNTIME_VM_MESSAGE_H_
 
 #include "platform/assert.h"
 #include "vm/allocation.h"
@@ -87,9 +87,7 @@
     ASSERT(len_ > 0);
     return data_;
   }
-  intptr_t len() const {
-    return len_;
-  }
+  intptr_t len() const { return len_; }
   RawObject* raw_obj() const {
     ASSERT(len_ == 0);
     return reinterpret_cast<RawObject*>(data_);
@@ -169,4 +167,4 @@
 
 }  // namespace dart
 
-#endif  // VM_MESSAGE_H_
+#endif  // RUNTIME_VM_MESSAGE_H_
diff --git a/runtime/vm/message_handler.cc b/runtime/vm/message_handler.cc
index 80cfbbf..f98ec65 100644
--- a/runtime/vm/message_handler.cc
+++ b/runtime/vm/message_handler.cc
@@ -19,8 +19,7 @@
 
 class MessageHandlerTask : public ThreadPool::Task {
  public:
-  explicit MessageHandlerTask(MessageHandler* handler)
-      : handler_(handler) {
+  explicit MessageHandlerTask(MessageHandler* handler) : handler_(handler) {
     ASSERT(handler != NULL);
   }
 
@@ -110,9 +109,10 @@
   bool task_running;
   MonitorLocker ml(&monitor_);
   if (FLAG_trace_isolates) {
-    OS::Print("[+] Starting message handler:\n"
-              "\thandler:    %s\n",
-              name());
+    OS::Print(
+        "[+] Starting message handler:\n"
+        "\thandler:    %s\n",
+        name());
   }
   ASSERT(pool_ == NULL);
   ASSERT(!delete_me_);
@@ -137,12 +137,14 @@
       if (source_isolate) {
         source_name = source_isolate->name();
       }
-      OS::Print("[>] Posting message:\n"
-                "\tlen:        %" Pd "\n"
-                "\tsource:     %s\n"
-                "\tdest:       %s\n"
-                "\tdest_port:  %" Pd64 "\n",
-                message->len(), source_name, name(), message->dest_port());
+      OS::Print(
+          "[>] Posting message:\n"
+          "\tlen:        %" Pd
+          "\n"
+          "\tsource:     %s\n"
+          "\tdest:       %s\n"
+          "\tdest_port:  %" Pd64 "\n",
+          message->len(), source_name, name(), message->dest_port());
     }
 
     saved_priority = message->priority();
@@ -191,18 +193,20 @@
   StartIsolateScope start_isolate(isolate());
 
   MessageStatus max_status = kOK;
-  Message::Priority min_priority = ((allow_normal_messages && !paused())
-                                    ? Message::kNormalPriority
-                                    : Message::kOOBPriority);
+  Message::Priority min_priority =
+      ((allow_normal_messages && !paused()) ? Message::kNormalPriority
+                                            : Message::kOOBPriority);
   Message* message = DequeueMessage(min_priority);
   while (message != NULL) {
     intptr_t message_len = message->len();
     if (FLAG_trace_isolates) {
-      OS::Print("[<] Handling message:\n"
-                "\tlen:        %" Pd "\n"
-                "\thandler:    %s\n"
-                "\tport:       %" Pd64 "\n",
-                message_len, name(), message->dest_port());
+      OS::Print(
+          "[<] Handling message:\n"
+          "\tlen:        %" Pd
+          "\n"
+          "\thandler:    %s\n"
+          "\tport:       %" Pd64 "\n",
+          message_len, name(), message->dest_port());
     }
 
     // Release the monitor_ temporarily while we handle the message.
@@ -217,12 +221,13 @@
     message = NULL;  // May be deleted by now.
     ml->Enter();
     if (FLAG_trace_isolates) {
-      OS::Print("[.] Message handled (%s):\n"
-                "\tlen:        %" Pd "\n"
-                "\thandler:    %s\n"
-                "\tport:       %" Pd64 "\n",
-                MessageStatusString(status),
-                message_len, name(), saved_dest_port);
+      OS::Print(
+          "[.] Message handled (%s):\n"
+          "\tlen:        %" Pd
+          "\n"
+          "\thandler:    %s\n"
+          "\tport:       %" Pd64 "\n",
+          MessageStatusString(status), message_len, name(), saved_dest_port);
     }
     // If we are shutting down, do not process any more messages.
     if (status == kShutdown) {
@@ -245,8 +250,8 @@
     // Even if we encounter an error, we still process pending OOB
     // messages so that we don't lose the message notification.
     min_priority = (((max_status == kOK) && allow_normal_messages && !paused())
-                    ? Message::kNormalPriority
-                    : Message::kOOBPriority);
+                        ? Message::kNormalPriority
+                        : Message::kOOBPriority);
     message = DequeueMessage(min_priority);
   }
   return max_status;
@@ -375,8 +380,10 @@
       if (ShouldPauseOnExit(status)) {
         if (!is_paused_on_exit()) {
           if (FLAG_trace_service_pause_events) {
-            OS::PrintErr("Isolate %s paused before exiting. "
-                         "Use the Observatory to release it.\n", name());
+            OS::PrintErr(
+                "Isolate %s paused before exiting. "
+                "Use the Observatory to release it.\n",
+                name());
           }
           PausedOnExitLocked(&ml, true);
           // More messages may have come in while we released the monitor.
@@ -394,14 +401,16 @@
       if (FLAG_trace_isolates) {
         if (status != kOK && thread() != NULL) {
           const Error& error = Error::Handle(thread()->sticky_error());
-          OS::Print("[-] Stopping message handler (%s):\n"
-                    "\thandler:    %s\n"
-                    "\terror:    %s\n",
-                    MessageStatusString(status), name(), error.ToCString());
+          OS::Print(
+              "[-] Stopping message handler (%s):\n"
+              "\thandler:    %s\n"
+              "\terror:    %s\n",
+              MessageStatusString(status), name(), error.ToCString());
         } else {
-          OS::Print("[-] Stopping message handler (%s):\n"
-                    "\thandler:    %s\n",
-                    MessageStatusString(status), name());
+          OS::Print(
+              "[-] Stopping message handler (%s):\n"
+              "\thandler:    %s\n",
+              MessageStatusString(status), name());
         }
       }
       pool_ = NULL;
@@ -431,11 +440,13 @@
 void MessageHandler::ClosePort(Dart_Port port) {
   MonitorLocker ml(&monitor_);
   if (FLAG_trace_isolates) {
-    OS::Print("[-] Closing port:\n"
-              "\thandler:    %s\n"
-              "\tport:       %" Pd64 "\n"
-              "\tports:      live(%" Pd ")\n",
-              name(), port, live_ports_);
+    OS::Print(
+        "[-] Closing port:\n"
+        "\thandler:    %s\n"
+        "\tport:       %" Pd64
+        "\n"
+        "\tports:      live(%" Pd ")\n",
+        name(), port, live_ports_);
   }
 }
 
@@ -443,9 +454,10 @@
 void MessageHandler::CloseAllPorts() {
   MonitorLocker ml(&monitor_);
   if (FLAG_trace_isolates) {
-    OS::Print("[-] Closing all ports:\n"
-              "\thandler:    %s\n",
-              name());
+    OS::Print(
+        "[-] Closing all ports:\n"
+        "\thandler:    %s\n",
+        name());
   }
   queue_->Clear();
   oob_queue_->Clear();
diff --git a/runtime/vm/message_handler.h b/runtime/vm/message_handler.h
index 825e3d3..88942ed 100644
--- a/runtime/vm/message_handler.h
+++ b/runtime/vm/message_handler.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_MESSAGE_HANDLER_H_
-#define VM_MESSAGE_HANDLER_H_
+#ifndef RUNTIME_VM_MESSAGE_HANDLER_H_
+#define RUNTIME_VM_MESSAGE_HANDLER_H_
 
 #include "vm/isolate.h"
 #include "vm/lockers.h"
@@ -77,47 +77,38 @@
   // A message handler tracks how many live ports it has.
   bool HasLivePorts() const { return live_ports_ > 0; }
 
-  intptr_t live_ports() const {
-    return live_ports_;
-  }
+  intptr_t live_ports() const { return live_ports_; }
 
   void DebugDump();
 
   bool paused() const { return paused_ > 0; }
 
   void increment_paused() { paused_++; }
-  void decrement_paused() { ASSERT(paused_ > 0); paused_--; }
+  void decrement_paused() {
+    ASSERT(paused_ > 0);
+    paused_--;
+  }
 
   bool ShouldPauseOnStart(MessageStatus status) const;
-  bool should_pause_on_start() const {
-    return should_pause_on_start_;
-  }
+  bool should_pause_on_start() const { return should_pause_on_start_; }
 
   void set_should_pause_on_start(bool should_pause_on_start) {
     should_pause_on_start_ = should_pause_on_start;
   }
 
-  bool is_paused_on_start() const {
-    return is_paused_on_start_;
-  }
+  bool is_paused_on_start() const { return is_paused_on_start_; }
 
   bool ShouldPauseOnExit(MessageStatus status) const;
-  bool should_pause_on_exit() const {
-    return should_pause_on_exit_;
-  }
+  bool should_pause_on_exit() const { return should_pause_on_exit_; }
 
   void set_should_pause_on_exit(bool should_pause_on_exit) {
     should_pause_on_exit_ = should_pause_on_exit;
   }
 
-  bool is_paused_on_exit() const {
-    return is_paused_on_exit_;
-  }
+  bool is_paused_on_exit() const { return is_paused_on_exit_; }
 
   // Timestamp of the paused on start or paused on exit.
-  int64_t paused_timestamp() const {
-    return paused_timestamp_;
-  }
+  int64_t paused_timestamp() const { return paused_timestamp_; }
 
   void PausedOnStart(bool paused);
   void PausedOnExit(bool paused);
@@ -240,7 +231,7 @@
   // thread.
   bool oob_message_handling_allowed_;
   intptr_t live_ports_;  // The number of open ports, including control ports.
-  intptr_t paused_;  // The number of pause messages received.
+  intptr_t paused_;      // The number of pause messages received.
   bool should_pause_on_start_;
   bool should_pause_on_exit_;
   bool is_paused_on_start_;
@@ -258,4 +249,4 @@
 
 }  // namespace dart
 
-#endif  // VM_MESSAGE_HANDLER_H_
+#endif  // RUNTIME_VM_MESSAGE_HANDLER_H_
diff --git a/runtime/vm/message_handler_test.cc b/runtime/vm/message_handler_test.cc
index e6a39a6..fedb823 100644
--- a/runtime/vm/message_handler_test.cc
+++ b/runtime/vm/message_handler_test.cc
@@ -39,16 +39,11 @@
         message_count_(0),
         start_called_(false),
         end_called_(false),
-        results_(NULL) {
-  }
+        results_(NULL) {}
 
-  ~TestMessageHandler() {
-    delete[] port_buffer_;
-  }
+  ~TestMessageHandler() { delete[] port_buffer_; }
 
-  void MessageNotify(Message::Priority priority) {
-    notify_count_++;
-  }
+  void MessageNotify(Message::Priority priority) { notify_count_++; }
 
   MessageStatus HandleMessage(Message* message) {
     // For testing purposes, keep a list of the ports
@@ -248,9 +243,9 @@
 UNIT_TEST_CASE(MessageHandler_HandleNextMessage_ProcessOOBAfterError) {
   TestMessageHandler handler;
   MessageHandler::MessageStatus results[] = {
-    MessageHandler::kError,     // oob_message1
-    MessageHandler::kOK,        // oob_message2
-    MessageHandler::kOK,        // unused
+      MessageHandler::kError,  // oob_message1
+      MessageHandler::kOK,     // oob_message2
+      MessageHandler::kOK,     // unused
   };
   handler.set_results(results);
   MessageHandlerTestPeer handler_peer(&handler);
@@ -278,10 +273,10 @@
 UNIT_TEST_CASE(MessageHandler_HandleNextMessage_Shutdown) {
   TestMessageHandler handler;
   MessageHandler::MessageStatus results[] = {
-    MessageHandler::kOK,        // oob_message1
-    MessageHandler::kShutdown,  // oob_message2
-    MessageHandler::kOK,        // unused
-    MessageHandler::kOK,        // unused
+      MessageHandler::kOK,        // oob_message1
+      MessageHandler::kShutdown,  // oob_message2
+      MessageHandler::kOK,        // unused
+      MessageHandler::kOK,        // unused
   };
   handler.set_results(results);
   MessageHandlerTestPeer handler_peer(&handler);
@@ -368,9 +363,7 @@
   EXPECT(!handler.HasLivePorts());
   handler_peer.increment_live_ports();
 
-  handler.Run(&pool,
-              TestStartFunction,
-              TestEndFunction,
+  handler.Run(&pool, TestStartFunction, TestEndFunction,
               reinterpret_cast<uword>(&handler));
   Dart_Port port = PortMap::CreatePort(&handler);
   Message* message = new Message(port, NULL, 0, Message::kNormalPriority);
diff --git a/runtime/vm/message_test.cc b/runtime/vm/message_test.cc
index 5250a77..d496a7b 100644
--- a/runtime/vm/message_test.cc
+++ b/runtime/vm/message_test.cc
@@ -31,8 +31,8 @@
   const char* str6 = "msg6";
 
   // Add two messages.
-  Message* msg1 = new Message(
-      port, AllocMsg(str1), strlen(str1) + 1, Message::kNormalPriority);
+  Message* msg1 = new Message(port, AllocMsg(str1), strlen(str1) + 1,
+                              Message::kNormalPriority);
   queue.Enqueue(msg1, false);
   EXPECT(queue.Length() == 1);
   EXPECT(!queue.IsEmpty());
@@ -41,8 +41,8 @@
   EXPECT(it.Next() == msg1);
   EXPECT(!it.HasNext());
 
-  Message* msg2 = new Message(
-      port, AllocMsg(str2), strlen(str2) + 1, Message::kNormalPriority);
+  Message* msg2 = new Message(port, AllocMsg(str2), strlen(str2) + 1,
+                              Message::kNormalPriority);
   queue.Enqueue(msg2, false);
   EXPECT(queue.Length() == 2);
   EXPECT(!queue.IsEmpty());
@@ -76,26 +76,23 @@
   EXPECT_STREQ(str2, reinterpret_cast<char*>(msg->data()));
   EXPECT(queue.IsEmpty());
 
-  Message* msg3 = new Message(Message::kIllegalPort,
-                              AllocMsg(str3), strlen(str3) + 1,
-                              Message::kNormalPriority);
+  Message* msg3 = new Message(Message::kIllegalPort, AllocMsg(str3),
+                              strlen(str3) + 1, Message::kNormalPriority);
   queue.Enqueue(msg3, true);
   EXPECT(!queue.IsEmpty());
 
-  Message* msg4 = new Message(Message::kIllegalPort,
-                              AllocMsg(str4), strlen(str4) + 1,
-                              Message::kNormalPriority);
+  Message* msg4 = new Message(Message::kIllegalPort, AllocMsg(str4),
+                              strlen(str4) + 1, Message::kNormalPriority);
   queue.Enqueue(msg4, true);
   EXPECT(!queue.IsEmpty());
 
-  Message* msg5 = new Message(
-      port, AllocMsg(str5), strlen(str5) + 1, Message::kNormalPriority);
+  Message* msg5 = new Message(port, AllocMsg(str5), strlen(str5) + 1,
+                              Message::kNormalPriority);
   queue.Enqueue(msg5, false);
   EXPECT(!queue.IsEmpty());
 
-  Message* msg6 = new Message(Message::kIllegalPort,
-                              AllocMsg(str6), strlen(str6) + 1,
-                              Message::kNormalPriority);
+  Message* msg6 = new Message(Message::kIllegalPort, AllocMsg(str6),
+                              strlen(str6) + 1, Message::kNormalPriority);
   queue.Enqueue(msg6, true);
   EXPECT(!queue.IsEmpty());
 
@@ -137,13 +134,11 @@
   const char* str2 = "msg2";
 
   // Add two messages.
-  Message* msg1 =
-      new Message(port1, AllocMsg(str1), strlen(str1) + 1,
-                  Message::kNormalPriority);
+  Message* msg1 = new Message(port1, AllocMsg(str1), strlen(str1) + 1,
+                              Message::kNormalPriority);
   queue.Enqueue(msg1, false);
-  Message* msg2 =
-      new Message(port2, AllocMsg(str2), strlen(str2) + 1,
-                  Message::kNormalPriority);
+  Message* msg2 = new Message(port2, AllocMsg(str2), strlen(str2) + 1,
+                              Message::kNormalPriority);
   queue.Enqueue(msg2, false);
 
   EXPECT(!queue.IsEmpty());
diff --git a/runtime/vm/method_recognizer.cc b/runtime/vm/method_recognizer.cc
index 649a1fe..12694a8 100644
--- a/runtime/vm/method_recognizer.cc
+++ b/runtime/vm/method_recognizer.cc
@@ -27,8 +27,9 @@
 
 intptr_t MethodRecognizer::ResultCid(const Function& function) {
   switch (function.recognized_kind()) {
-#define DEFINE_CASE(cname, fname, ename, result_type, fingerprint) \
-    case k##ename: return k##result_type##Cid;
+#define DEFINE_CASE(cname, fname, ename, result_type, fingerprint)             \
+  case k##ename:                                                               \
+    return k##result_type##Cid;
     RECOGNIZED_LIST(DEFINE_CASE)
 #undef DEFINE_CASE
     default:
@@ -118,12 +119,10 @@
 }
 
 
-#define KIND_TO_STRING(class_name, function_name, enum_name, type, fp) \
+#define KIND_TO_STRING(class_name, function_name, enum_name, type, fp)         \
   #enum_name,
 static const char* recognized_list_method_name[] = {
-  "Unknown",
-  RECOGNIZED_LIST(KIND_TO_STRING)
-};
+    "Unknown", RECOGNIZED_LIST(KIND_TO_STRING)};
 #undef KIND_TO_STRING
 
 const char* MethodRecognizer::KindToCString(Kind kind) {
@@ -133,7 +132,7 @@
 }
 
 
-#if defined(DART_NO_SNAPSHOT)
+#if !defined(DART_PRECOMPILED_RUNTIME)
 void MethodRecognizer::InitializeState() {
   GrowableArray<Library*> libs(3);
   libs.Add(&Library::ZoneHandle(Library::CoreLibrary()));
@@ -183,6 +182,7 @@
 #undef SET_IS_POLYMORPHIC_TARGET
 #undef SET_FUNCTION_BIT
 }
-#endif  // defined(DART_NO_SNAPSHOT).
+#endif  // !defined(DART_PRECOMPILED_RUNTIME)
+
 
 }  // namespace dart
diff --git a/runtime/vm/method_recognizer.h b/runtime/vm/method_recognizer.h
index 651ee3c..5ab5eac 100644
--- a/runtime/vm/method_recognizer.h
+++ b/runtime/vm/method_recognizer.h
@@ -2,13 +2,14 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_METHOD_RECOGNIZER_H_
-#define VM_METHOD_RECOGNIZER_H_
+#ifndef RUNTIME_VM_METHOD_RECOGNIZER_H_
+#define RUNTIME_VM_METHOD_RECOGNIZER_H_
 
 #include "vm/allocation.h"
 
 namespace dart {
 
+// clang-format off
 // (class-name, function-name, recognized enum, result type, fingerprint).
 // When adding a new function add a 0 as fingerprint, build and run to get the
 // correct fingerprint from the mismatch error.
@@ -156,6 +157,7 @@
   V(_Double, *, Double_mul, Double, 0x23d068d8)                                \
   V(_Double, /, Double_div, Double, 0x48bac1dc)                                \
   V(_Double, get:isNaN, Double_getIsNaN, Bool, 0x0af8ebeb)                     \
+  V(_Double, get:isInfinite, Double_getIsInfinite, Bool, 0x0f79e289)           \
   V(_Double, get:isNegative, Double_getIsNegative, Bool, 0x3a58ff36)           \
   V(_Double, _mulFromInteger, Double_mulFromInteger, Double, 0x330e9a36)       \
   V(_Double, .fromInteger, DoubleFromInteger, Double, 0x7ef45843)              \
@@ -164,8 +166,11 @@
     0x25a786de)                                                                \
   V(_GrowableList, add, GrowableArray_add, Dynamic, 0x0d1358ed)                \
   V(_RegExp, _ExecuteMatch, RegExp_ExecuteMatch, Dynamic, 0x6036d7fa)          \
+  V(_RegExp, _ExecuteMatchSticky, RegExp_ExecuteMatchSticky, Dynamic,          \
+    0x71c67f7d)                                                                \
   V(Object, ==, ObjectEquals, Bool, 0x11662ed8)                                \
   V(Object, get:runtimeType, ObjectRuntimeType, Type, 0x00e7c26b)              \
+  V(Object, _haveSameRuntimeType, ObjectHaveSameRuntimeType, Bool, 0x72aad7e2) \
   V(_StringBase, get:hashCode, String_getHashCode, Smi, 0x78c2eb88)            \
   V(_StringBase, get:isEmpty, StringBaseIsEmpty, Bool, 0x74c21fca)             \
   V(_StringBase, _substringMatches, StringBaseSubstringMatches, Bool,          \
@@ -488,6 +493,9 @@
   V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 0x4765edda)              \
   V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 0x7cca4533)          \
   V(_TypedList, _setInt32x4, ByteArrayBaseSetInt32x4, 0x7631bdbc)              \
+  V(Object, get:runtimeType, ObjectRuntimeType, 0x00e7c26b)
+
+// clang-format on
 
 // Forward declarations.
 class Function;
@@ -499,11 +507,11 @@
  public:
   enum Kind {
     kUnknown,
-#define DEFINE_ENUM_LIST(class_name, function_name, enum_name, type, fp) \
-    k##enum_name,
+#define DEFINE_ENUM_LIST(class_name, function_name, enum_name, type, fp)       \
+  k##enum_name,
     RECOGNIZED_LIST(DEFINE_ENUM_LIST)
 #undef DEFINE_ENUM_LIST
-    kNumRecognizedMethods
+        kNumRecognizedMethods
   };
 
   static Kind RecognizeKind(const Function& function);
@@ -512,21 +520,23 @@
   static intptr_t ResultCid(const Function& function);
   static intptr_t MethodKindToReceiverCid(Kind kind);
   static const char* KindToCString(Kind kind);
-#if defined(DART_NO_SNAPSHOT)
+
+#if !defined(DART_PRECOMPILED_RUNTIME)
   static void InitializeState();
-#endif  // defined(DART_NO_SNAPSHOT).
+#endif  // !defined(DART_PRECOMPILED_RUNTIME)
 };
 
 
-#if defined(DART_NO_SNAPSHOT)
-#define CHECK_FINGERPRINT2(f, p0, p1, fp) \
+#if !defined(DART_PRECOMPILED_RUNTIME)
+#define CHECK_FINGERPRINT2(f, p0, p1, fp)                                      \
   ASSERT(f.CheckSourceFingerprint(#p0 ", " #p1, fp))
 
-#define CHECK_FINGERPRINT3(f, p0, p1, p2, fp) \
+#define CHECK_FINGERPRINT3(f, p0, p1, p2, fp)                                  \
   ASSERT(f.CheckSourceFingerprint(#p0 ", " #p1 ", " #p2, fp))
-#endif  // defined(DART_NO_SNAPSHOT).
+#endif  // !defined(DART_PRECOMPILED_RUNTIME)
 
 
+// clang-format off
 // List of recognized list factories:
 // (factory-name-symbol, result-cid, fingerprint).
 #define RECOGNIZED_LIST_FACTORY_LIST(V)                                        \
@@ -544,8 +554,9 @@
   V(_Uint64ArrayFactory, kTypedDataUint64ArrayCid, 0x2c093004)                 \
   V(_Float64ArrayFactory, kTypedDataFloat64ArrayCid, 0x501be4f1)               \
   V(_Float32ArrayFactory, kTypedDataFloat32ArrayCid, 0x738e124b)               \
-  V(_Float32x4ArrayFactory, kTypedDataFloat32x4ArrayCid, 0x7a7dd718)           \
+  V(_Float32x4ArrayFactory, kTypedDataFloat32x4ArrayCid, 0x7a7dd718)
 
+// clang-format on
 
 // Class that recognizes factories and returns corresponding result cid.
 class FactoryRecognizer : public AllStatic {
@@ -556,4 +567,4 @@
 
 }  // namespace dart
 
-#endif  // VM_METHOD_RECOGNIZER_H_
+#endif  // RUNTIME_VM_METHOD_RECOGNIZER_H_
diff --git a/runtime/vm/metrics.cc b/runtime/vm/metrics.cc
index 137042e..5a2f5a7 100644
--- a/runtime/vm/metrics.cc
+++ b/runtime/vm/metrics.cc
@@ -13,7 +13,9 @@
 
 namespace dart {
 
-DEFINE_FLAG(bool, print_metrics, false,
+DEFINE_FLAG(bool,
+            print_metrics,
+            false,
             "Print metrics when isolates (and the VM) are shutdown.");
 
 Metric* Metric::vm_list_head_ = NULL;
@@ -24,8 +26,7 @@
       description_(NULL),
       unit_(kCounter),
       value_(0),
-      next_(NULL) {
-}
+      next_(NULL) {}
 
 
 void Metric::Init(Isolate* isolate,
@@ -70,8 +71,10 @@
 #ifndef PRODUCT
 static const char* UnitString(intptr_t unit) {
   switch (unit) {
-    case Metric::kCounter: return "counter";
-    case Metric::kByte: return "byte";
+    case Metric::kCounter:
+      return "counter";
+    case Metric::kByte:
+      return "byte";
     default:
       UNREACHABLE();
   }
@@ -122,10 +125,8 @@
         scaled_suffix = "gb";
         scaled_value /= GB;
       }
-      return zone->PrintToString("%.3f %s (%" Pd64 ")",
-                                 scaled_value,
-                                 scaled_suffix,
-                                 value);
+      return zone->PrintToString("%.3f %s (%" Pd64 ")", scaled_value,
+                                 scaled_suffix, value);
     }
     default:
       UNREACHABLE();
@@ -157,7 +158,6 @@
 }
 
 
-
 void Metric::RegisterWithIsolate() {
   ASSERT(isolate_ != NULL);
   ASSERT(next_ == NULL);
@@ -293,7 +293,7 @@
 
 #define VM_METRIC_VARIABLE(type, variable, name, unit)                         \
   static type vm_metric_##variable##_;
-  VM_METRIC_LIST(VM_METRIC_VARIABLE);
+VM_METRIC_LIST(VM_METRIC_VARIABLE);
 #undef VM_METRIC_VARIABLE
 
 
@@ -319,8 +319,7 @@
 }
 
 
-MaxMetric::MaxMetric()
-    : Metric() {
+MaxMetric::MaxMetric() : Metric() {
   set_value(kMinInt64);
 }
 
@@ -332,8 +331,7 @@
 }
 
 
-MinMetric::MinMetric()
-    : Metric() {
+MinMetric::MinMetric() : Metric() {
   set_value(kMaxInt64);
 }
 
diff --git a/runtime/vm/metrics.h b/runtime/vm/metrics.h
index c34f02d..fd4449b 100644
--- a/runtime/vm/metrics.h
+++ b/runtime/vm/metrics.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_METRICS_H_
-#define VM_METRICS_H_
+#ifndef RUNTIME_VM_METRICS_H_
+#define RUNTIME_VM_METRICS_H_
 
 #include "vm/allocation.h"
 
@@ -25,7 +25,7 @@
   V(MaxMetric, HeapNewCapacityMax, "heap.new.capacity.max", kByte)             \
   V(MetricHeapNewExternal, HeapNewExternal, "heap.new.external", kByte)        \
   V(MetricHeapUsed, HeapGlobalUsed, "heap.global.used", kByte)                 \
-  V(MaxMetric, HeapGlobalUsedMax, "heap.global.used.max", kByte)               \
+  V(MaxMetric, HeapGlobalUsedMax, "heap.global.used.max", kByte)
 
 #define VM_METRIC_LIST(V)                                                      \
   V(MetricIsolateCount, IsolateCount, "vm.isolate.count", kCounter)
@@ -50,9 +50,7 @@
             Unit unit);
 
   // Initialize and register a metric for the VM.
-  void Init(const char* name,
-            const char* description,
-            Unit unit);
+  void Init(const char* name, const char* description, Unit unit);
 
   virtual ~Metric();
 
@@ -72,9 +70,7 @@
   void increment() { value_++; }
 
   Metric* next() const { return next_; }
-  void set_next(Metric* next) {
-    next_ = next;
-  }
+  void set_next(Metric* next) { next_ = next; }
 
   const char* name() const { return name_; }
   const char* description() const { return description_; }
@@ -179,4 +175,4 @@
 
 }  // namespace dart
 
-#endif  // VM_METRICS_H_
+#endif  // RUNTIME_VM_METRICS_H_
diff --git a/runtime/vm/metrics_test.cc b/runtime/vm/metrics_test.cc
index 1e99b2d..77a762f 100644
--- a/runtime/vm/metrics_test.cc
+++ b/runtime/vm/metrics_test.cc
@@ -16,8 +16,8 @@
 #ifndef PRODUCT
 
 UNIT_TEST_CASE(Metric_Simple) {
-  Dart_CreateIsolate(
-      NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL, NULL);
+  Dart_CreateIsolate(NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL,
+                     NULL);
   {
     Metric metric;
 
@@ -45,8 +45,8 @@
 };
 
 UNIT_TEST_CASE(Metric_OnDemand) {
-  Dart_CreateIsolate(
-      NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL, NULL);
+  Dart_CreateIsolate(NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL,
+                     NULL);
   {
     Thread* thread = Thread::Current();
     StackZone zone(thread);
@@ -63,10 +63,12 @@
     JSONStream js;
     metric.PrintJSON(&js);
     const char* json = js.ToCString();
-    EXPECT_STREQ("{\"type\":\"Counter\",\"name\":\"a.b.c\",\"description\":"
-                 "\"foobar\",\"unit\":\"byte\","
-                 "\"fixedId\":true,\"id\":\"metrics\\/native\\/a.b.c\""
-                 ",\"value\":99.000000}", json);
+    EXPECT_STREQ(
+        "{\"type\":\"Counter\",\"name\":\"a.b.c\",\"description\":"
+        "\"foobar\",\"unit\":\"byte\","
+        "\"fixedId\":true,\"id\":\"metrics\\/native\\/a.b.c\""
+        ",\"value\":99.000000}",
+        json);
   }
   Dart_ShutdownIsolate();
 }
diff --git a/runtime/vm/mirrors_api_impl.cc b/runtime/vm/mirrors_api_impl.cc
index ddc649b..3ed8355 100644
--- a/runtime/vm/mirrors_api_impl.cc
+++ b/runtime/vm/mirrors_api_impl.cc
@@ -32,7 +32,7 @@
     const Class& cls = Class::Handle(Type::Cast(obj).type_class());
     return Api::NewHandle(T, cls.UserVisibleName());
   } else {
-    RETURN_TYPE_ERROR(Z, object, Class/Type);
+    RETURN_TYPE_ERROR(Z, object, Class / Type);
   }
 }
 
@@ -41,8 +41,9 @@
   DARTSCOPE(Thread::Current());
   const Object& obj = Object::Handle(Z, Api::UnwrapHandle(object));
   if (obj.IsType() || obj.IsClass()) {
-    const Class& cls = (obj.IsType()) ?
-        Class::Handle(Z, Type::Cast(obj).type_class()) : Class::Cast(obj);
+    const Class& cls = (obj.IsType())
+                           ? Class::Handle(Z, Type::Cast(obj).type_class())
+                           : Class::Cast(obj);
     const char* str = cls.ToCString();
     if (str == NULL) {
       RETURN_NULL_ERROR(str);
@@ -50,7 +51,7 @@
     CHECK_CALLBACK_STATE(T);
     return Api::NewHandle(T, String::New(str));
   } else {
-    RETURN_TYPE_ERROR(Z, object, Class/Type);
+    RETURN_TYPE_ERROR(Z, object, Class / Type);
   }
 }
 
@@ -121,8 +122,7 @@
     }
   } else {
     return Api::NewError(
-        "%s expects argument 'target' to be a class or library.",
-        CURRENT_FUNC);
+        "%s expects argument 'target' to be a class or library.", CURRENT_FUNC);
   }
   return Api::NewHandle(T, Array::MakeArray(names));
 }
@@ -191,8 +191,7 @@
     }
   } else {
     return Api::NewError(
-        "%s expects argument 'target' to be a class or library.",
-        CURRENT_FUNC);
+        "%s expects argument 'target' to be a class or library.", CURRENT_FUNC);
   }
 
 #if defined(DEBUG)
@@ -232,8 +231,8 @@
   const Class& owner = Class::Handle(Z, func.Owner());
   ASSERT(!owner.IsNull());
   if (owner.IsTopLevel()) {
-    // Top-level functions are implemented as members of a hidden class. We hide
-    // that class here and instead answer the library.
+// Top-level functions are implemented as members of a hidden class. We hide
+// that class here and instead answer the library.
 #if defined(DEBUG)
     const Library& lib = Library::Handle(Z, owner.library());
     if (lib.IsNull()) {
diff --git a/runtime/vm/native_api_impl.cc b/runtime/vm/native_api_impl.cc
index 48d9289..08a8daa 100644
--- a/runtime/vm/native_api_impl.cc
+++ b/runtime/vm/native_api_impl.cc
@@ -37,6 +37,7 @@
       Dart_EnterIsolate(I);
     }
   }
+
  private:
   Isolate* saved_isolate_;
 
@@ -64,8 +65,8 @@
 
 DART_EXPORT bool Dart_PostInteger(Dart_Port port_id, int64_t message) {
   if (Smi::IsValid(message)) {
-    return PortMap::PostMessage(new Message(
-        port_id, Smi::New(message), Message::kNormalPriority));
+    return PortMap::PostMessage(
+        new Message(port_id, Smi::New(message), Message::kNormalPriority));
   }
   Dart_CObject cobj;
   cobj.type = Dart_CObject_kInt64;
@@ -132,8 +133,7 @@
 
 static void ParseAll(Thread* thread, Dart_Handle* result) {
   ASSERT(thread != NULL);
-  const Error& error = Error::Handle(thread->zone(),
-                                     Library::ParseAll(thread));
+  const Error& error = Error::Handle(thread->zone(), Library::ParseAll(thread));
   if (error.IsNull()) {
     *result = Api::Success();
   } else {
diff --git a/runtime/vm/native_arguments.h b/runtime/vm/native_arguments.h
index 77c67ed..b54499c 100644
--- a/runtime/vm/native_arguments.h
+++ b/runtime/vm/native_arguments.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_NATIVE_ARGUMENTS_H_
-#define VM_NATIVE_ARGUMENTS_H_
+#ifndef RUNTIME_VM_NATIVE_ARGUMENTS_H_
+#define RUNTIME_VM_NATIVE_ARGUMENTS_H_
 
 #include "platform/assert.h"
 #include "platform/memory_sanitizer.h"
@@ -28,26 +28,30 @@
 // C-stack is always aligned on DBC because we don't have any native code.
 #define CHECK_STACK_ALIGNMENT
 #elif defined(USING_SIMULATOR)
-#define CHECK_STACK_ALIGNMENT {                                                \
-  uword current_sp = Simulator::Current()->get_register(SPREG);                \
-  ASSERT(Utils::IsAligned(current_sp, OS::ActivationFrameAlignment()));        \
-}
+#define CHECK_STACK_ALIGNMENT                                                  \
+  {                                                                            \
+    uword current_sp = Simulator::Current()->get_register(SPREG);              \
+    ASSERT(Utils::IsAligned(current_sp, OS::ActivationFrameAlignment()));      \
+  }
 #elif defined(TARGET_OS_WINDOWS)
 // The compiler may dynamically align the stack on Windows, so do not check.
-#define CHECK_STACK_ALIGNMENT { }
+#define CHECK_STACK_ALIGNMENT                                                  \
+  {}
 #else
-#define CHECK_STACK_ALIGNMENT {                                                \
-  uword (*func)() = reinterpret_cast<uword (*)()>(                             \
-      StubCode::GetStackPointer_entry()->EntryPoint());                        \
-  uword current_sp = func();                                                   \
-  ASSERT(Utils::IsAligned(current_sp, OS::ActivationFrameAlignment()));        \
-}
+#define CHECK_STACK_ALIGNMENT                                                  \
+  {                                                                            \
+    uword (*func)() = reinterpret_cast<uword (*)()>(                           \
+        StubCode::GetStackPointer_entry()->EntryPoint());                      \
+    uword current_sp = func();                                                 \
+    ASSERT(Utils::IsAligned(current_sp, OS::ActivationFrameAlignment()));      \
+  }
 #endif
 
+void VerifyOnTransition();
+
 #define VERIFY_ON_TRANSITION                                                   \
   if (FLAG_verify_on_transition) {                                             \
-    VerifyPointersVisitor::VerifyPointers();                                   \
-    Isolate::Current()->heap()->Verify();                                      \
+    VerifyOnTransition();                                                      \
   }
 #define DEOPTIMIZE_ALOT                                                        \
   if (FLAG_deoptimize_alot) {                                                  \
@@ -56,9 +60,12 @@
 
 #else
 
-#define CHECK_STACK_ALIGNMENT { }
-#define VERIFY_ON_TRANSITION { }
-#define DEOPTIMIZE_ALOT { }
+#define CHECK_STACK_ALIGNMENT                                                  \
+  {}
+#define VERIFY_ON_TRANSITION                                                   \
+  {}
+#define DEOPTIMIZE_ALOT                                                        \
+  {}
 
 #endif
 
@@ -69,7 +76,8 @@
   }
 #else
 #define TRACE_NATIVE_CALL(format, name)                                        \
-  do { } while (0)
+  do {                                                                         \
+  } while (0)
 #endif
 
 // Class NativeArguments is used to access arguments passed in from
@@ -137,11 +145,11 @@
     return ArgAt(actual_index);
   }
 
-  void SetReturn(const Object& value) const {
-    *retval_ = value.raw();
-  }
+  void SetReturn(const Object& value) const { *retval_ = value.raw(); }
 
   RawObject* ReturnValue() const {
+    // Tell MemorySanitizer the retval_ was initialized (by generated code).
+    MSAN_UNPOISON(retval_, kWordSize);
     return *retval_;
   }
 
@@ -204,10 +212,10 @@
     kAutoSetupScopeBit = 26,
   };
   class ArgcBits : public BitField<intptr_t, int32_t, kArgcBit, kArgcSize> {};
-  class FunctionBits :
-      public BitField<intptr_t, int, kFunctionBit, kFunctionSize> {};
-  class AutoSetupScopeBits :
-      public BitField<intptr_t, int, kAutoSetupScopeBit, 1> {};
+  class FunctionBits
+      : public BitField<intptr_t, int, kFunctionBit, kFunctionSize> {};
+  class AutoSetupScopeBits
+      : public BitField<intptr_t, int, kAutoSetupScopeBit, 1> {};
   friend class Api;
   friend class BootstrapNatives;
   friend class Simulator;
@@ -218,17 +226,14 @@
                   int argc_tag,
                   RawObject** argv,
                   RawObject** retval)
-      : thread_(thread), argc_tag_(argc_tag), argv_(argv), retval_(retval) {
-  }
+      : thread_(thread), argc_tag_(argc_tag), argv_(argv), retval_(retval) {}
 #endif
 
   // Since this function is passed a RawObject directly, we need to be
   // exceedingly careful when we use it.  If there are any other side
   // effects in the statement that may cause GC, it could lead to
   // bugs.
-  void SetReturnUnsafe(RawObject* value) const {
-    *retval_ = value;
-  }
+  void SetReturnUnsafe(RawObject* value) const { *retval_ = value; }
 
   // Returns true if the arguments are those of an instance function call.
   bool ToInstanceFunction() const {
@@ -251,12 +256,12 @@
     return 0;
   }
 
-  Thread* thread_;  // Current thread pointer.
-  intptr_t argc_tag_;  // Encodes argument count and invoked native call type.
-  RawObject** argv_;  // Pointer to an array of arguments to runtime call.
+  Thread* thread_;      // Current thread pointer.
+  intptr_t argc_tag_;   // Encodes argument count and invoked native call type.
+  RawObject** argv_;    // Pointer to an array of arguments to runtime call.
   RawObject** retval_;  // Pointer to the return value area.
 };
 
 }  // namespace dart
 
-#endif  // VM_NATIVE_ARGUMENTS_H_
+#endif  // RUNTIME_VM_NATIVE_ARGUMENTS_H_
diff --git a/runtime/vm/native_entry.cc b/runtime/vm/native_entry.cc
index e1e7e45..7e1655e 100644
--- a/runtime/vm/native_entry.cc
+++ b/runtime/vm/native_entry.cc
@@ -10,6 +10,7 @@
 #include "vm/code_patcher.h"
 #include "vm/dart_api_impl.h"
 #include "vm/dart_api_state.h"
+#include "vm/native_symbol.h"
 #include "vm/object_store.h"
 #include "vm/reusable_handles.h"
 #include "vm/safepoint.h"
@@ -20,7 +21,9 @@
 
 namespace dart {
 
-DEFINE_FLAG(bool, trace_natives, false,
+DEFINE_FLAG(bool,
+            trace_natives,
+            false,
             "Trace invocation of natives (debug mode only)");
 
 
@@ -132,6 +135,7 @@
   /* Tell MemorySanitizer 'arguments' is initialized by generated code. */
   MSAN_UNPOISON(arguments, sizeof(*arguments));
   Thread* thread = arguments->thread();
+  ASSERT(thread->execution_state() == Thread::kThreadInGenerated);
   if (!arguments->IsNativeAutoSetupScope()) {
     TransitionGeneratedToNative transition(thread);
     func(args);
@@ -147,13 +151,11 @@
     TRACE_NATIVE_CALL("0x%" Px "", reinterpret_cast<uintptr_t>(func));
     TransitionGeneratedToNative transition(thread);
     if (scope == NULL) {
-      scope = new ApiLocalScope(current_top_scope,
-                                thread->top_exit_frame_info());
+      scope =
+          new ApiLocalScope(current_top_scope, thread->top_exit_frame_info());
       ASSERT(scope != NULL);
     } else {
-      scope->Reinit(thread,
-                    current_top_scope,
-                    thread->top_exit_frame_info());
+      scope->Reinit(thread, current_top_scope, thread->top_exit_frame_info());
       thread->set_api_reusable_scope(NULL);
     }
     thread->set_api_top_scope(scope);  // New scope is now the top scope.
@@ -173,8 +175,9 @@
       delete scope;
     }
     DEOPTIMIZE_ALOT;
-    VERIFY_ON_TRANSITION;
   }
+  ASSERT(thread->execution_state() == Thread::kThreadInGenerated);
+  VERIFY_ON_TRANSITION;
 }
 
 
@@ -194,8 +197,8 @@
 
   const int num_params = NativeArguments::ParameterCountForResolution(func);
   bool auto_setup_scope = true;
-  return NativeEntry::ResolveNative(
-      library, native_name, num_params, &auto_setup_scope);
+  return NativeEntry::ResolveNative(library, native_name, num_params,
+                                    &auto_setup_scope);
 }
 
 
@@ -235,27 +238,25 @@
     }
 
     bool is_bootstrap_native = false;
-    target_function = ResolveNativeFunction(
-        arguments->thread()->zone(), func, &is_bootstrap_native);
+    target_function = ResolveNativeFunction(arguments->thread()->zone(), func,
+                                            &is_bootstrap_native);
     ASSERT(target_function != NULL);
 
 #if defined(DEBUG)
     {
       NativeFunction current_function = NULL;
-      const Code& current_trampoline = Code::Handle(
-          CodePatcher::GetNativeCallAt(caller_frame->pc(),
-                                       code,
-                                       &current_function));
+      const Code& current_trampoline =
+          Code::Handle(CodePatcher::GetNativeCallAt(caller_frame->pc(), code,
+                                                    &current_function));
 #if !defined(USING_SIMULATOR)
       ASSERT(current_function ==
              reinterpret_cast<NativeFunction>(LinkNativeCall));
 #else
-      ASSERT(current_function ==
-             reinterpret_cast<NativeFunction>(
-                 Simulator::RedirectExternalReference(
-                     reinterpret_cast<uword>(LinkNativeCall),
-                     Simulator::kBootstrapNativeCall,
-                     NativeEntry::kNumArguments)));
+      ASSERT(
+          current_function ==
+          reinterpret_cast<NativeFunction>(Simulator::RedirectExternalReference(
+              reinterpret_cast<uword>(LinkNativeCall),
+              Simulator::kBootstrapNativeCall, NativeEntry::kNumArguments)));
 #endif
       ASSERT(current_trampoline.raw() ==
              StubCode::CallBootstrapCFunction_entry()->code());
@@ -264,26 +265,25 @@
 
     call_through_wrapper = !is_bootstrap_native;
     const Code& trampoline =
-        Code::Handle(call_through_wrapper ?
-            StubCode::CallNativeCFunction_entry()->code() :
-            StubCode::CallBootstrapCFunction_entry()->code());
+        Code::Handle(call_through_wrapper
+                         ? StubCode::CallNativeCFunction_entry()->code()
+                         : StubCode::CallBootstrapCFunction_entry()->code());
 
     NativeFunction patch_target_function = target_function;
 #if defined(USING_SIMULATOR)
     if (!call_through_wrapper) {
-      patch_target_function = reinterpret_cast<NativeFunction>(
-          Simulator::RedirectExternalReference(
+      patch_target_function =
+          reinterpret_cast<NativeFunction>(Simulator::RedirectExternalReference(
               reinterpret_cast<uword>(patch_target_function),
               Simulator::kBootstrapNativeCall, NativeEntry::kNumArguments));
     }
 #endif
 
-    CodePatcher::PatchNativeCallAt(
-        caller_frame->pc(), code, patch_target_function, trampoline);
+    CodePatcher::PatchNativeCallAt(caller_frame->pc(), code,
+                                   patch_target_function, trampoline);
 
     if (FLAG_trace_natives) {
-      OS::Print("    -> %p (%s)\n",
-                target_function,
+      OS::Print("    -> %p (%s)\n", target_function,
                 is_bootstrap_native ? "bootstrap" : "non-bootstrap");
     }
   }
diff --git a/runtime/vm/native_entry.h b/runtime/vm/native_entry.h
index 4be2cc3..9b8f6e34 100644
--- a/runtime/vm/native_entry.h
+++ b/runtime/vm/native_entry.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_NATIVE_ENTRY_H_
-#define VM_NATIVE_ENTRY_H_
+#ifndef RUNTIME_VM_NATIVE_ENTRY_H_
+#define RUNTIME_VM_NATIVE_ENTRY_H_
 
 #include "platform/memory_sanitizer.h"
 
@@ -33,15 +33,12 @@
   ASSERT(retval->IsDartInstance());                                            \
   arguments->SetReturnUnsafe(retval);
 #else
-#define SET_NATIVE_RETVAL(arguments, value)                                    \
-  arguments->SetReturnUnsafe(value);
+#define SET_NATIVE_RETVAL(arguments, value) arguments->SetReturnUnsafe(value);
 #endif
 
 #define DEFINE_NATIVE_ENTRY(name, argument_count)                              \
-  static RawObject* DN_Helper##name(Isolate* isolate,                          \
-                                    Thread* thread,                            \
-                                    Zone* zone,                                \
-                                    NativeArguments* arguments);               \
+  static RawObject* DN_Helper##name(Isolate* isolate, Thread* thread,          \
+                                    Zone* zone, NativeArguments* arguments);   \
   void NATIVE_ENTRY_FUNCTION(name)(Dart_NativeArguments args) {                \
     CHECK_STACK_ALIGNMENT;                                                     \
     VERIFY_ON_TRANSITION;                                                      \
@@ -49,26 +46,22 @@
     /* Tell MemorySanitizer 'arguments' is initialized by generated code. */   \
     MSAN_UNPOISON(arguments, sizeof(*arguments));                              \
     ASSERT(arguments->NativeArgCount() == argument_count);                     \
-    TRACE_NATIVE_CALL("%s", ""#name);                                          \
+    TRACE_NATIVE_CALL("%s", "" #name);                                         \
     {                                                                          \
       Thread* thread = arguments->thread();                                    \
       ASSERT(thread == Thread::Current());                                     \
       Isolate* isolate = thread->isolate();                                    \
       TransitionGeneratedToVM transition(thread);                              \
       StackZone zone(thread);                                                  \
-      SET_NATIVE_RETVAL(arguments,                                             \
-                        DN_Helper##name(isolate,                               \
-                                        thread,                                \
-                                        zone.GetZone(),                        \
-                                        arguments));                           \
+      SET_NATIVE_RETVAL(                                                       \
+          arguments,                                                           \
+          DN_Helper##name(isolate, thread, zone.GetZone(), arguments));        \
       DEOPTIMIZE_ALOT;                                                         \
     }                                                                          \
     VERIFY_ON_TRANSITION;                                                      \
   }                                                                            \
-  static RawObject* DN_Helper##name(Isolate* isolate,                          \
-                                    Thread* thread,                            \
-                                    Zone* zone,                                \
-                                    NativeArguments* arguments)
+  static RawObject* DN_Helper##name(Isolate* isolate, Thread* thread,          \
+                                    Zone* zone, NativeArguments* arguments)
 
 
 // Helper that throws an argument exception.
@@ -118,7 +111,7 @@
   static void NativeCallWrapper(Dart_NativeArguments args,
                                 Dart_NativeFunction func);
 
-  // DBC does not support lazy native call linking.
+// DBC does not support lazy native call linking.
 #if !defined(TARGET_ARCH_DBC)
   static uword LinkNativeCallEntry();
   static void LinkNativeCall(Dart_NativeArguments args);
@@ -134,4 +127,4 @@
 
 }  // namespace dart
 
-#endif  // VM_NATIVE_ENTRY_H_
+#endif  // RUNTIME_VM_NATIVE_ENTRY_H_
diff --git a/runtime/vm/native_entry_test.cc b/runtime/vm/native_entry_test.cc
index 6929913..eb012e0 100644
--- a/runtime/vm/native_entry_test.cc
+++ b/runtime/vm/native_entry_test.cc
@@ -64,7 +64,7 @@
   for (int i = 0; i < arg_count; i++) {
     Dart_Handle arg = Dart_GetNativeArgument(args, i);
     GET_NATIVE_ARGUMENT(Integer, argument, arguments->NativeArgAt(i));
-    EXPECT(argument.IsInteger());  // May be null.
+    EXPECT(argument.IsInteger());                       // May be null.
     EXPECT_EQ(Api::UnwrapHandle(arg), argument.raw());  // May be null.
     int64_t arg_value = -1;
     if (argument.IsNull()) {
diff --git a/runtime/vm/native_entry_test.h b/runtime/vm/native_entry_test.h
index 706b4b6..682221a 100644
--- a/runtime/vm/native_entry_test.h
+++ b/runtime/vm/native_entry_test.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_NATIVE_ENTRY_TEST_H_
-#define VM_NATIVE_ENTRY_TEST_H_
+#ifndef RUNTIME_VM_NATIVE_ENTRY_TEST_H_
+#define RUNTIME_VM_NATIVE_ENTRY_TEST_H_
 
 #include "include/dart_api.h"
 #include "vm/runtime_entry.h"
@@ -16,4 +16,4 @@
 
 }  // namespace dart
 
-#endif  // VM_NATIVE_ENTRY_TEST_H_
+#endif  // RUNTIME_VM_NATIVE_ENTRY_TEST_H_
diff --git a/runtime/vm/native_message_handler.cc b/runtime/vm/native_message_handler.cc
index 1763341..41fbd2c 100644
--- a/runtime/vm/native_message_handler.cc
+++ b/runtime/vm/native_message_handler.cc
@@ -13,9 +13,7 @@
 
 NativeMessageHandler::NativeMessageHandler(const char* name,
                                            Dart_NativeMessageHandler func)
-    : name_(strdup(name)),
-      func_(func) {
-}
+    : name_(strdup(name)), func_(func) {}
 
 
 NativeMessageHandler::~NativeMessageHandler() {
diff --git a/runtime/vm/native_message_handler.h b/runtime/vm/native_message_handler.h
index 9a34c77..7133662 100644
--- a/runtime/vm/native_message_handler.h
+++ b/runtime/vm/native_message_handler.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_NATIVE_MESSAGE_HANDLER_H_
-#define VM_NATIVE_MESSAGE_HANDLER_H_
+#ifndef RUNTIME_VM_NATIVE_MESSAGE_HANDLER_H_
+#define RUNTIME_VM_NATIVE_MESSAGE_HANDLER_H_
 
 #include "include/dart_api.h"
 #include "include/dart_native_api.h"
@@ -38,4 +38,4 @@
 
 }  // namespace dart
 
-#endif  // VM_NATIVE_MESSAGE_HANDLER_H_
+#endif  // RUNTIME_VM_NATIVE_MESSAGE_HANDLER_H_
diff --git a/runtime/vm/native_symbol.h b/runtime/vm/native_symbol.h
index dec113a..f82f314 100644
--- a/runtime/vm/native_symbol.h
+++ b/runtime/vm/native_symbol.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_NATIVE_SYMBOL_H_
-#define VM_NATIVE_SYMBOL_H_
+#ifndef RUNTIME_VM_NATIVE_SYMBOL_H_
+#define RUNTIME_VM_NATIVE_SYMBOL_H_
 
 #include "vm/allocation.h"
 #include "vm/globals.h"
@@ -23,4 +23,4 @@
 
 }  // namespace dart
 
-#endif  // VM_NATIVE_SYMBOL_H_
+#endif  // RUNTIME_VM_NATIVE_SYMBOL_H_
diff --git a/runtime/vm/native_symbol_android.cc b/runtime/vm/native_symbol_android.cc
index db43d23..8cb3b67 100644
--- a/runtime/vm/native_symbol_android.cc
+++ b/runtime/vm/native_symbol_android.cc
@@ -11,12 +11,10 @@
 
 namespace dart {
 
-void NativeSymbolResolver::InitOnce() {
-}
+void NativeSymbolResolver::InitOnce() {}
 
 
-void NativeSymbolResolver::ShutdownOnce() {
-}
+void NativeSymbolResolver::ShutdownOnce() {}
 
 
 char* NativeSymbolResolver::LookupSymbolName(uintptr_t pc, uintptr_t* start) {
diff --git a/runtime/vm/native_symbol_fuchsia.cc b/runtime/vm/native_symbol_fuchsia.cc
index cb0f02a..528d4e5 100644
--- a/runtime/vm/native_symbol_fuchsia.cc
+++ b/runtime/vm/native_symbol_fuchsia.cc
@@ -5,30 +5,45 @@
 #include "vm/globals.h"
 #if defined(TARGET_OS_FUCHSIA)
 
+#include "platform/memory_sanitizer.h"
 #include "vm/native_symbol.h"
 
-#include "platform/assert.h"
+#include <cxxabi.h>  // NOLINT
+#include <dlfcn.h>   // NOLINT
 
 namespace dart {
 
-void NativeSymbolResolver::InitOnce() {
-  UNIMPLEMENTED();
-}
+void NativeSymbolResolver::InitOnce() {}
 
 
-void NativeSymbolResolver::ShutdownOnce() {
-  UNIMPLEMENTED();
-}
+void NativeSymbolResolver::ShutdownOnce() {}
 
 
 char* NativeSymbolResolver::LookupSymbolName(uintptr_t pc, uintptr_t* start) {
-  UNIMPLEMENTED();
-  return NULL;
+  Dl_info info;
+  int r = dladdr(reinterpret_cast<void*>(pc), &info);
+  if (r == 0) {
+    return NULL;
+  }
+  if (info.dli_sname == NULL) {
+    return NULL;
+  }
+  if (start != NULL) {
+    *start = reinterpret_cast<uintptr_t>(info.dli_saddr);
+  }
+  int status = 0;
+  size_t len = 0;
+  char* demangled = abi::__cxa_demangle(info.dli_sname, NULL, &len, &status);
+  MSAN_UNPOISON(demangled, len);
+  if (status == 0) {
+    return demangled;
+  }
+  return strdup(info.dli_sname);
 }
 
 
 void NativeSymbolResolver::FreeSymbolName(char* name) {
-  UNIMPLEMENTED();
+  free(name);
 }
 
 }  // namespace dart
diff --git a/runtime/vm/native_symbol_linux.cc b/runtime/vm/native_symbol_linux.cc
index a903938..9556ddb 100644
--- a/runtime/vm/native_symbol_linux.cc
+++ b/runtime/vm/native_symbol_linux.cc
@@ -5,19 +5,18 @@
 #include "vm/globals.h"
 #if defined(TARGET_OS_LINUX)
 
+#include "platform/memory_sanitizer.h"
 #include "vm/native_symbol.h"
 
 #include <cxxabi.h>  // NOLINT
-#include <dlfcn.h>  // NOLINT
+#include <dlfcn.h>   // NOLINT
 
 namespace dart {
 
-void NativeSymbolResolver::InitOnce() {
-}
+void NativeSymbolResolver::InitOnce() {}
 
 
-void NativeSymbolResolver::ShutdownOnce() {
-}
+void NativeSymbolResolver::ShutdownOnce() {}
 
 
 char* NativeSymbolResolver::LookupSymbolName(uintptr_t pc, uintptr_t* start) {
@@ -32,8 +31,10 @@
   if (start != NULL) {
     *start = reinterpret_cast<uintptr_t>(info.dli_saddr);
   }
-  int status;
-  char* demangled = abi::__cxa_demangle(info.dli_sname, NULL, NULL, &status);
+  int status = 0;
+  size_t len = 0;
+  char* demangled = abi::__cxa_demangle(info.dli_sname, NULL, &len, &status);
+  MSAN_UNPOISON(demangled, len);
   if (status == 0) {
     return demangled;
   }
diff --git a/runtime/vm/native_symbol_macos.cc b/runtime/vm/native_symbol_macos.cc
index df944cc..6ca35cd 100644
--- a/runtime/vm/native_symbol_macos.cc
+++ b/runtime/vm/native_symbol_macos.cc
@@ -8,16 +8,14 @@
 #include "vm/native_symbol.h"
 
 #include <cxxabi.h>  // NOLINT
-#include <dlfcn.h>  // NOLINT
+#include <dlfcn.h>   // NOLINT
 
 namespace dart {
 
-void NativeSymbolResolver::InitOnce() {
-}
+void NativeSymbolResolver::InitOnce() {}
 
 
-void NativeSymbolResolver::ShutdownOnce() {
-}
+void NativeSymbolResolver::ShutdownOnce() {}
 
 
 char* NativeSymbolResolver::LookupSymbolName(uintptr_t pc, uintptr_t* start) {
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 6f0f164..ac586d9 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -49,20 +49,32 @@
 
 namespace dart {
 
-DEFINE_FLAG(int, huge_method_cutoff_in_code_size, 200000,
-    "Huge method cutoff in unoptimized code size (in bytes).");
-DEFINE_FLAG(bool, overlap_type_arguments, true,
+DEFINE_FLAG(int,
+            huge_method_cutoff_in_code_size,
+            200000,
+            "Huge method cutoff in unoptimized code size (in bytes).");
+DEFINE_FLAG(
+    bool,
+    overlap_type_arguments,
+    true,
     "When possible, partially or fully overlap the type arguments of a type "
     "with the type arguments of its super type.");
-DEFINE_FLAG(bool, show_internal_names, false,
+DEFINE_FLAG(
+    bool,
+    show_internal_names,
+    false,
     "Show names of internal classes (e.g. \"OneByteString\") in error messages "
     "instead of showing the corresponding interface names (e.g. \"String\")");
 DEFINE_FLAG(bool, use_lib_cache, true, "Use library name cache");
 DEFINE_FLAG(bool, use_exp_cache, true, "Use library exported name cache");
-DEFINE_FLAG(bool, ignore_patch_signature_mismatch, false,
+DEFINE_FLAG(bool,
+            ignore_patch_signature_mismatch,
+            false,
             "Ignore patch file member signature mismatch.");
 
-DEFINE_FLAG(bool, remove_script_timestamps_for_test, false,
+DEFINE_FLAG(bool,
+            remove_script_timestamps_for_test,
+            false,
             "Remove script timestamps to allow for deterministic testing.");
 
 DECLARE_FLAG(bool, show_invisible_frames);
@@ -72,17 +84,17 @@
 DECLARE_FLAG(bool, write_protect_code);
 DECLARE_FLAG(bool, support_externalizable_strings);
 
-
 static const char* const kGetterPrefix = "get:";
 static const intptr_t kGetterPrefixLength = strlen(kGetterPrefix);
 static const char* const kSetterPrefix = "set:";
 static const intptr_t kSetterPrefixLength = strlen(kSetterPrefix);
 
+
 // A cache of VM heap allocated preinitialized empty ic data entry arrays.
 RawArray* ICData::cached_icdata_arrays_[kCachedICDataArrayCount];
 
 cpp_vtable Object::handle_vtable_ = 0;
-cpp_vtable Object::builtin_vtables_[kNumPredefinedCids] = { 0 };
+cpp_vtable Object::builtin_vtables_[kNumPredefinedCids] = {0};
 cpp_vtable Smi::handle_vtable_ = 0;
 
 // These are initialized to a value that will force a illegal memory access if
@@ -172,7 +184,8 @@
 static void AppendSubString(Zone* zone,
                             GrowableArray<const char*>* segments,
                             const char* name,
-                            intptr_t start_pos, intptr_t len) {
+                            intptr_t start_pos,
+                            intptr_t len) {
   char* segment = zone->Alloc<char>(len + 1);  // '\0'-terminated.
   memmove(segment, name + start_pos, len);
   segment[len] = '\0';
@@ -227,12 +240,12 @@
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
 
-NOT_IN_PRODUCT(
+#if !defined(PRODUCT)
   if (name.Equals(Symbols::TopLevel())) {
     // Name of invisible top-level class.
     return Symbols::Empty().raw();
   }
-)
+#endif  // !defined(PRODUCT)
 
   const char* cname = name.ToCString();
   ASSERT(strlen(cname) == static_cast<size_t>(name.Length()));
@@ -242,8 +255,8 @@
   GrowableArray<const char*> unmangled_segments;
   intptr_t sum_segment_len = 0;
   for (intptr_t i = 0; i < name_len; i++) {
-    if ((cname[i] == '@') && ((i + 1) < name_len) &&
-        (cname[i + 1] >= '0') && (cname[i + 1] <= '9')) {
+    if ((cname[i] == '@') && ((i + 1) < name_len) && (cname[i + 1] >= '0') &&
+        (cname[i + 1] <= '9')) {
       // Append the current segment to the unmangled name.
       const intptr_t segment_len = i - start_pos;
       sum_segment_len += segment_len;
@@ -251,8 +264,7 @@
       // Advance until past the name mangling. The private keys are only
       // numbers so we skip until the first non-number.
       i++;  // Skip the '@'.
-      while ((i < name.Length()) &&
-             (name.CharAt(i) >= '0') &&
+      while ((i < name.Length()) && (name.CharAt(i) >= '0') &&
              (name.CharAt(i) <= '9')) {
         i++;
       }
@@ -277,7 +289,7 @@
     unmangled_name = MergeSubStrings(zone, unmangled_segments, sum_segment_len);
   }
 
-NOT_IN_PRODUCT(
+#if !defined(PRODUCT)
   intptr_t len = sum_segment_len;
   intptr_t start = 0;
   intptr_t dot_pos = -1;  // Position of '.' in the name, if any.
@@ -326,14 +338,14 @@
   }
 
   unmangled_name = MergeSubStrings(zone, unmangled_segments, final_len);
-)
+#endif  // !defined(PRODUCT)
 
   return Symbols::New(thread, unmangled_name);
 }
 
 
 RawString* String::ScrubNameRetainPrivate(const String& name) {
-NOT_IN_PRODUCT(
+#if !defined(PRODUCT)
   intptr_t len = name.Length();
   intptr_t start = 0;
   intptr_t at_pos = -1;  // Position of '@' in the name, if any.
@@ -376,22 +388,16 @@
   }
 
   return result.raw();
-)
+#endif                // !defined(PRODUCT)
   return name.raw();  // In PRODUCT, return argument unchanged.
 }
 
 
-template<typename type>
+template <typename type>
 static bool IsSpecialCharacter(type value) {
-  return ((value == '"') ||
-          (value == '\n') ||
-          (value == '\f') ||
-          (value == '\b') ||
-          (value == '\t') ||
-          (value == '\v') ||
-          (value == '\r') ||
-          (value == '\\') ||
-          (value == '$'));
+  return ((value == '"') || (value == '\n') || (value == '\f') ||
+          (value == '\b') || (value == '\t') || (value == '\v') ||
+          (value == '\r') || (value == '\\') || (value == '$'));
 }
 
 
@@ -401,10 +407,7 @@
 
 
 static inline bool NeedsEscapeSequence(int32_t c) {
-  return (c == '"')  ||
-         (c == '\\') ||
-         (c == '$')  ||
-         IsAsciiNonprintable(c);
+  return (c == '"') || (c == '\\') || (c == '$') || IsAsciiNonprintable(c);
 }
 
 
@@ -418,7 +421,7 @@
 }
 
 
-template<typename type>
+template <typename type>
 static type SpecialCharacter(type value) {
   if (value == '"') {
     return '"';
@@ -496,8 +499,8 @@
   extractor_parameter_names_ = Array::ReadOnlyHandle();
   sentinel_ = Instance::ReadOnlyHandle();
   transition_sentinel_ = Instance::ReadOnlyHandle();
-  unknown_constant_ =  Instance::ReadOnlyHandle();
-  non_constant_ =  Instance::ReadOnlyHandle();
+  unknown_constant_ = Instance::ReadOnlyHandle();
+  non_constant_ = Instance::ReadOnlyHandle();
   bool_true_ = Bool::ReadOnlyHandle();
   bool_false_ = Bool::ReadOnlyHandle();
   smi_illegal_cid_ = Smi::ReadOnlyHandle();
@@ -542,6 +545,7 @@
     cls.set_state_bits(0);
     cls.set_is_finalized();
     cls.set_is_type_finalized();
+    cls.set_is_cycle_free();
     cls.set_type_arguments_field_offset_in_words(Class::kNoTypeArguments);
     cls.set_num_type_arguments(0);
     cls.set_num_own_type_arguments(0);
@@ -562,6 +566,7 @@
   cls.set_num_own_type_arguments(0);
   cls.set_is_finalized();
   cls.set_is_type_finalized();
+  cls.set_is_cycle_free();
 
   // Allocate and initialize the forwarding corpse class.
   cls = Class::New<ForwardingCorpse::FakeInstance>(kForwardingCorpse);
@@ -569,6 +574,7 @@
   cls.set_num_own_type_arguments(0);
   cls.set_is_finalized();
   cls.set_is_type_finalized();
+  cls.set_is_cycle_free();
 
   // Allocate and initialize the sentinel values of Null class.
   {
@@ -724,8 +730,7 @@
     uword address = heap->Allocate(Array::InstanceSize(0), Heap::kOld);
     InitializeObject(address, kImmutableArrayCid, Array::InstanceSize(0), true);
     Array::initializeHandle(
-        empty_array_,
-        reinterpret_cast<RawArray*>(address + kHeapObjectTag));
+        empty_array_, reinterpret_cast<RawArray*>(address + kHeapObjectTag));
     empty_array_->StoreSmi(&empty_array_->raw_ptr()->length_, Smi::New(0));
     empty_array_->SetCanonical();
   }
@@ -736,8 +741,7 @@
     uword address = heap->Allocate(Array::InstanceSize(1), Heap::kOld);
     InitializeObject(address, kImmutableArrayCid, Array::InstanceSize(1), true);
     Array::initializeHandle(
-        zero_array_,
-        reinterpret_cast<RawArray*>(address + kHeapObjectTag));
+        zero_array_, reinterpret_cast<RawArray*>(address + kHeapObjectTag));
     zero_array_->StoreSmi(&zero_array_->raw_ptr()->length_, Smi::New(1));
     smi = Smi::New(0);
     zero_array_->SetAt(0, smi);
@@ -747,9 +751,7 @@
   // Allocate and initialize the canonical empty context scope object.
   {
     uword address = heap->Allocate(ContextScope::InstanceSize(0), Heap::kOld);
-    InitializeObject(address,
-                     kContextScopeCid,
-                     ContextScope::InstanceSize(0),
+    InitializeObject(address, kContextScopeCid, ContextScope::InstanceSize(0),
                      true);
     ContextScope::initializeHandle(
         empty_context_scope_,
@@ -763,25 +765,21 @@
 
   // Allocate and initialize the canonical empty object pool object.
   {
-    uword address =
-        heap->Allocate(ObjectPool::InstanceSize(0), Heap::kOld);
-    InitializeObject(address,
-                     kObjectPoolCid,
-                     ObjectPool::InstanceSize(0),
+    uword address = heap->Allocate(ObjectPool::InstanceSize(0), Heap::kOld);
+    InitializeObject(address, kObjectPoolCid, ObjectPool::InstanceSize(0),
                      true);
     ObjectPool::initializeHandle(
         empty_object_pool_,
         reinterpret_cast<RawObjectPool*>(address + kHeapObjectTag));
-    empty_object_pool_->StoreNonPointer(
-        &empty_object_pool_->raw_ptr()->length_, 0);
+    empty_object_pool_->StoreNonPointer(&empty_object_pool_->raw_ptr()->length_,
+                                        0);
     empty_object_pool_->SetCanonical();
   }
 
   // Allocate and initialize the empty_descriptors instance.
   {
     uword address = heap->Allocate(PcDescriptors::InstanceSize(0), Heap::kOld);
-    InitializeObject(address, kPcDescriptorsCid,
-                     PcDescriptors::InstanceSize(0),
+    InitializeObject(address, kPcDescriptorsCid, PcDescriptors::InstanceSize(0),
                      true);
     PcDescriptors::initializeHandle(
         empty_descriptors_,
@@ -795,10 +793,8 @@
   {
     uword address =
         heap->Allocate(LocalVarDescriptors::InstanceSize(0), Heap::kOld);
-    InitializeObject(address,
-                     kLocalVarDescriptorsCid,
-                     LocalVarDescriptors::InstanceSize(0),
-                     true);
+    InitializeObject(address, kLocalVarDescriptorsCid,
+                     LocalVarDescriptors::InstanceSize(0), true);
     LocalVarDescriptors::initializeHandle(
         empty_var_descriptors_,
         reinterpret_cast<RawLocalVarDescriptors*>(address + kHeapObjectTag));
@@ -813,10 +809,8 @@
   {
     uword address =
         heap->Allocate(ExceptionHandlers::InstanceSize(0), Heap::kOld);
-    InitializeObject(address,
-                     kExceptionHandlersCid,
-                     ExceptionHandlers::InstanceSize(0),
-                     true);
+    InitializeObject(address, kExceptionHandlersCid,
+                     ExceptionHandlers::InstanceSize(0), true);
     ExceptionHandlers::initializeHandle(
         empty_exception_handlers_,
         reinterpret_cast<RawExceptionHandlers*>(address + kHeapObjectTag));
@@ -833,20 +827,23 @@
   cls.set_is_abstract();
   cls.set_num_type_arguments(0);
   cls.set_num_own_type_arguments(0);
-  cls.set_is_type_finalized();
   cls.set_is_finalized();
+  cls.set_is_type_finalized();
+  cls.set_is_cycle_free();
   dynamic_class_ = cls.raw();
 
   cls = Class::New<Instance>(kVoidCid);
   cls.set_num_type_arguments(0);
   cls.set_num_own_type_arguments(0);
-  cls.set_is_type_finalized();
   cls.set_is_finalized();
+  cls.set_is_type_finalized();
+  cls.set_is_cycle_free();
   void_class_ = cls.raw();
 
   cls = Class::New<Type>();
-  cls.set_is_type_finalized();
   cls.set_is_finalized();
+  cls.set_is_type_finalized();
+  cls.set_is_cycle_free();
 
   cls = dynamic_class_;
   *dynamic_type_ = Type::NewNonParameterizedType(cls);
@@ -864,21 +861,17 @@
 
   String& error_str = String::Handle();
   error_str = String::New("SnapshotWriter Error", Heap::kOld);
-  *snapshot_writer_error_ = LanguageError::New(error_str,
-                                               Report::kError,
-                                               Heap::kOld);
+  *snapshot_writer_error_ =
+      LanguageError::New(error_str, Report::kError, Heap::kOld);
   error_str = String::New("Branch offset overflow", Heap::kOld);
-  *branch_offset_error_ = LanguageError::New(error_str,
-                                             Report::kBailout,
-                                             Heap::kOld);
+  *branch_offset_error_ =
+      LanguageError::New(error_str, Report::kBailout, Heap::kOld);
   error_str = String::New("Speculative inlining failed", Heap::kOld);
-  *speculative_inlining_error_ = LanguageError::New(error_str,
-                                                    Report::kBailout,
-                                                    Heap::kOld);
+  *speculative_inlining_error_ =
+      LanguageError::New(error_str, Report::kBailout, Heap::kOld);
   error_str = String::New("Background Compilation Failed", Heap::kOld);
-  *background_compilation_error_ = LanguageError::New(error_str,
-                                                      Report::kBailout,
-                                                      Heap::kOld);
+  *background_compilation_error_ =
+      LanguageError::New(error_str, Report::kBailout, Heap::kOld);
 
   // Some thread fields need to be reinitialized as null constants have not been
   // initialized until now.
@@ -938,7 +931,7 @@
 // premark all objects in the vm_isolate_ heap.
 class PremarkingVisitor : public ObjectVisitor {
  public:
-  PremarkingVisitor() { }
+  PremarkingVisitor() {}
 
   void VisitObject(RawObject* obj) {
     // Free list elements should never be marked.
@@ -955,7 +948,7 @@
 
 #define SET_CLASS_NAME(class_name, name)                                       \
   cls = class_name##_class();                                                  \
-  cls.set_name(Symbols::name());                                               \
+  cls.set_name(Symbols::name());
 
 void Object::FinalizeVMIsolate(Isolate* isolate) {
   // Should only be run by the vm isolate.
@@ -1067,8 +1060,8 @@
       // TODO(iposva): Investigate whether CompareAndSwapWord is necessary.
       do {
         old_tags = tags;
-        tags = AtomicOperations::CompareAndSwapWord(
-            &raw->ptr()->tags_, old_tags, new_tags);
+        tags = AtomicOperations::CompareAndSwapWord(&raw->ptr()->tags_,
+                                                    old_tags, new_tags);
       } while (tags != old_tags);
 
       intptr_t leftover_len = (leftover_size - TypedData::InstanceSize(0));
@@ -1085,8 +1078,8 @@
       // TODO(iposva): Investigate whether CompareAndSwapWord is necessary.
       do {
         old_tags = tags;
-        tags = AtomicOperations::CompareAndSwapWord(
-            &raw->ptr()->tags_, old_tags, new_tags);
+        tags = AtomicOperations::CompareAndSwapWord(&raw->ptr()->tags_,
+                                                    old_tags, new_tags);
       } while (tags != old_tags);
     }
   }
@@ -1132,643 +1125,633 @@
 }
 
 
-RawError* Object::Init(Isolate* isolate) {
+// Initialize a new isolate from source or from a snapshot.
+//
+// There are three possibilities:
+//   1. Running a Kernel binary.  This function will bootstrap from the KERNEL
+//      file.
+//   2. There is no snapshot.  This function will bootstrap from source.
+//   3. There is a snapshot.  The caller should initialize from the snapshot.
+//
+// A non-NULL kernel argument indicates (1).  A NULL kernel indicates (2) or
+// (3), depending on whether the VM is compiled with DART_NO_SNAPSHOT defined or
+// not.
+RawError* Object::Init(Isolate* isolate, kernel::Program* kernel_program) {
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
   ASSERT(isolate == thread->isolate());
-NOT_IN_PRODUCT(
-  TimelineDurationScope tds(thread,
-                            Timeline::GetIsolateStream(),
-                            "Object::Init");
-)
+#if !defined(DART_PRECOMPILED_RUNTIME)
+  const bool is_kernel = (kernel_program != NULL);
+#endif
+  NOT_IN_PRODUCT(TimelineDurationScope tds(thread, Timeline::GetIsolateStream(),
+                                           "Object::Init");)
 
 #if defined(DART_NO_SNAPSHOT)
-  // Object::Init version when we are running in a version of dart that does
-  // not have a full snapshot linked in.
-  ObjectStore* object_store = isolate->object_store();
+  bool bootstrapping = true;
+#elif defined(DART_PRECOMPILED_RUNTIME)
+  bool bootstrapping = false;
+#else
+  bool bootstrapping = is_kernel;
+#endif
 
-  Class& cls = Class::Handle(zone);
-  Type& type = Type::Handle(zone);
-  Array& array = Array::Handle(zone);
-  Library& lib = Library::Handle(zone);
+  if (bootstrapping) {
+#if !defined(DART_PRECOMPILED_RUNTIME)
+    // Object::Init version when we are bootstrapping from source or from a
+    // Kernel binary.
+    ObjectStore* object_store = isolate->object_store();
 
-  // All RawArray fields will be initialized to an empty array, therefore
-  // initialize array class first.
-  cls = Class::New<Array>();
-  object_store->set_array_class(cls);
+    Class& cls = Class::Handle(zone);
+    Type& type = Type::Handle(zone);
+    Array& array = Array::Handle(zone);
+    Library& lib = Library::Handle(zone);
 
-  // VM classes that are parameterized (Array, ImmutableArray,
-  // GrowableObjectArray, and LinkedHashMap) are also pre-finalized,
-  // so CalculateFieldOffsets() is not called, so we need to set the
-  // offset of their type_arguments_ field, which is explicitly
-  // declared in their respective Raw* classes.
-  cls.set_type_arguments_field_offset(Array::type_arguments_offset());
-  cls.set_num_type_arguments(1);
+    // All RawArray fields will be initialized to an empty array, therefore
+    // initialize array class first.
+    cls = Class::New<Array>();
+    object_store->set_array_class(cls);
 
-  // Set up the growable object array class (Has to be done after the array
-  // class is setup as one of its field is an array object).
-  cls = Class::New<GrowableObjectArray>();
-  object_store->set_growable_object_array_class(cls);
-  cls.set_type_arguments_field_offset(
-      GrowableObjectArray::type_arguments_offset());
-  cls.set_num_type_arguments(1);
+    // VM classes that are parameterized (Array, ImmutableArray,
+    // GrowableObjectArray, and LinkedHashMap) are also pre-finalized, so
+    // CalculateFieldOffsets() is not called, so we need to set the offset of
+    // their type_arguments_ field, which is explicitly declared in their
+    // respective Raw* classes.
+    cls.set_type_arguments_field_offset(Array::type_arguments_offset());
+    cls.set_num_type_arguments(1);
 
-  // Initialize hash set for canonical_type_.
-  const intptr_t kInitialCanonicalTypeSize = 16;
-  array = HashTables::New<CanonicalTypeSet>(
-      kInitialCanonicalTypeSize, Heap::kOld);
-  object_store->set_canonical_types(array);
+    // Set up the growable object array class (Has to be done after the array
+    // class is setup as one of its field is an array object).
+    cls = Class::New<GrowableObjectArray>();
+    object_store->set_growable_object_array_class(cls);
+    cls.set_type_arguments_field_offset(
+        GrowableObjectArray::type_arguments_offset());
+    cls.set_num_type_arguments(1);
 
-  // Initialize hash set for canonical_type_arguments_.
-  const intptr_t kInitialCanonicalTypeArgumentsSize = 4;
-  array = HashTables::New<CanonicalTypeArgumentsSet>(
-      kInitialCanonicalTypeArgumentsSize, Heap::kOld);
-  object_store->set_canonical_type_arguments(array);
+    // Initialize hash set for canonical_type_.
+    const intptr_t kInitialCanonicalTypeSize = 16;
+    array = HashTables::New<CanonicalTypeSet>(kInitialCanonicalTypeSize,
+                                              Heap::kOld);
+    object_store->set_canonical_types(array);
 
-  // Setup type class early in the process.
-  const Class& type_cls = Class::Handle(zone, Class::New<Type>());
-  const Class& type_ref_cls = Class::Handle(zone, Class::New<TypeRef>());
-  const Class& type_parameter_cls = Class::Handle(zone,
-                                                  Class::New<TypeParameter>());
-  const Class& bounded_type_cls = Class::Handle(zone,
-                                                Class::New<BoundedType>());
-  const Class& mixin_app_type_cls = Class::Handle(zone,
-                                                  Class::New<MixinAppType>());
-  const Class& library_prefix_cls = Class::Handle(zone,
-                                                  Class::New<LibraryPrefix>());
+    // Initialize hash set for canonical_type_arguments_.
+    const intptr_t kInitialCanonicalTypeArgumentsSize = 4;
+    array = HashTables::New<CanonicalTypeArgumentsSet>(
+        kInitialCanonicalTypeArgumentsSize, Heap::kOld);
+    object_store->set_canonical_type_arguments(array);
 
-  // Pre-allocate the OneByteString class needed by the symbol table.
-  cls = Class::NewStringClass(kOneByteStringCid);
-  object_store->set_one_byte_string_class(cls);
+    // Setup type class early in the process.
+    const Class& type_cls = Class::Handle(zone, Class::New<Type>());
+    const Class& type_ref_cls = Class::Handle(zone, Class::New<TypeRef>());
+    const Class& type_parameter_cls =
+        Class::Handle(zone, Class::New<TypeParameter>());
+    const Class& bounded_type_cls =
+        Class::Handle(zone, Class::New<BoundedType>());
+    const Class& mixin_app_type_cls =
+        Class::Handle(zone, Class::New<MixinAppType>());
+    const Class& library_prefix_cls =
+        Class::Handle(zone, Class::New<LibraryPrefix>());
 
-  // Pre-allocate the TwoByteString class needed by the symbol table.
-  cls = Class::NewStringClass(kTwoByteStringCid);
-  object_store->set_two_byte_string_class(cls);
+    // Pre-allocate the OneByteString class needed by the symbol table.
+    cls = Class::NewStringClass(kOneByteStringCid);
+    object_store->set_one_byte_string_class(cls);
 
-  // Setup the symbol table for the symbols created in the isolate.
-  Symbols::SetupSymbolTable(isolate);
+    // Pre-allocate the TwoByteString class needed by the symbol table.
+    cls = Class::NewStringClass(kTwoByteStringCid);
+    object_store->set_two_byte_string_class(cls);
 
-  // Set up the libraries array before initializing the core library.
-  const GrowableObjectArray& libraries = GrowableObjectArray::Handle(
-      zone, GrowableObjectArray::New(Heap::kOld));
-  object_store->set_libraries(libraries);
+    // Setup the symbol table for the symbols created in the isolate.
+    Symbols::SetupSymbolTable(isolate);
 
-  // Pre-register the core library.
-  Library::InitCoreLibrary(isolate);
+    // Set up the libraries array before initializing the core library.
+    const GrowableObjectArray& libraries =
+        GrowableObjectArray::Handle(zone, GrowableObjectArray::New(Heap::kOld));
+    object_store->set_libraries(libraries);
 
-  // Basic infrastructure has been setup, initialize the class dictionary.
-  const Library& core_lib = Library::Handle(zone, Library::CoreLibrary());
-  ASSERT(!core_lib.IsNull());
+    // Pre-register the core library.
+    Library::InitCoreLibrary(isolate);
 
-  const GrowableObjectArray& pending_classes =
-      GrowableObjectArray::Handle(zone, GrowableObjectArray::New());
-  object_store->set_pending_classes(pending_classes);
+    // Basic infrastructure has been setup, initialize the class dictionary.
+    const Library& core_lib = Library::Handle(zone, Library::CoreLibrary());
+    ASSERT(!core_lib.IsNull());
 
-  Context& context = Context::Handle(zone, Context::New(0, Heap::kOld));
-  object_store->set_empty_context(context);
+    const GrowableObjectArray& pending_classes =
+        GrowableObjectArray::Handle(zone, GrowableObjectArray::New());
+    object_store->set_pending_classes(pending_classes);
 
-  // Now that the symbol table is initialized and that the core dictionary as
-  // well as the core implementation dictionary have been setup, preallocate
-  // remaining classes and register them by name in the dictionaries.
-  String& name = String::Handle(zone);
-  cls = object_store->array_class();  // Was allocated above.
-  RegisterPrivateClass(cls, Symbols::_List(), core_lib);
-  pending_classes.Add(cls);
-  // We cannot use NewNonParameterizedType(cls), because Array is parameterized.
-  // Warning: class _List has not been patched yet. Its declared number of type
-  // parameters is still 0. It will become 1 after patching. The array type
-  // allocated below represents the raw type _List and not _List<E> as we
-  // could expect. Use with caution.
-  type ^= Type::New(Object::Handle(zone, cls.raw()),
-                    TypeArguments::Handle(zone),
-                    TokenPosition::kNoSource);
-  type.SetIsFinalized();
-  type ^= type.Canonicalize();
-  object_store->set_array_type(type);
+    Context& context = Context::Handle(zone, Context::New(0, Heap::kOld));
+    object_store->set_empty_context(context);
 
-  cls = object_store->growable_object_array_class();  // Was allocated above.
-  RegisterPrivateClass(cls, Symbols::_GrowableList(), core_lib);
-  pending_classes.Add(cls);
+    // Now that the symbol table is initialized and that the core dictionary as
+    // well as the core implementation dictionary have been setup, preallocate
+    // remaining classes and register them by name in the dictionaries.
+    String& name = String::Handle(zone);
+    cls = object_store->array_class();  // Was allocated above.
+    RegisterPrivateClass(cls, Symbols::_List(), core_lib);
+    pending_classes.Add(cls);
+    // We cannot use NewNonParameterizedType(cls), because Array is
+    // parameterized.  Warning: class _List has not been patched yet. Its
+    // declared number of type parameters is still 0. It will become 1 after
+    // patching. The array type allocated below represents the raw type _List
+    // and not _List<E> as we could expect. Use with caution.
+    type ^= Type::New(Object::Handle(zone, cls.raw()),
+                      TypeArguments::Handle(zone), TokenPosition::kNoSource);
+    type.SetIsFinalized();
+    type ^= type.Canonicalize();
+    object_store->set_array_type(type);
 
-  cls = Class::New<Array>(kImmutableArrayCid);
-  object_store->set_immutable_array_class(cls);
-  cls.set_type_arguments_field_offset(Array::type_arguments_offset());
-  cls.set_num_type_arguments(1);
-  ASSERT(object_store->immutable_array_class() != object_store->array_class());
-  cls.set_is_prefinalized();
-  RegisterPrivateClass(cls, Symbols::_ImmutableList(), core_lib);
-  pending_classes.Add(cls);
+    cls = object_store->growable_object_array_class();  // Was allocated above.
+    RegisterPrivateClass(cls, Symbols::_GrowableList(), core_lib);
+    pending_classes.Add(cls);
 
-  cls = object_store->one_byte_string_class();  // Was allocated above.
-  RegisterPrivateClass(cls, Symbols::OneByteString(), core_lib);
-  pending_classes.Add(cls);
+    cls = Class::New<Array>(kImmutableArrayCid);
+    object_store->set_immutable_array_class(cls);
+    cls.set_type_arguments_field_offset(Array::type_arguments_offset());
+    cls.set_num_type_arguments(1);
+    ASSERT(object_store->immutable_array_class() !=
+           object_store->array_class());
+    cls.set_is_prefinalized();
+    RegisterPrivateClass(cls, Symbols::_ImmutableList(), core_lib);
+    pending_classes.Add(cls);
 
-  cls = object_store->two_byte_string_class();  // Was allocated above.
-  RegisterPrivateClass(cls, Symbols::TwoByteString(), core_lib);
-  pending_classes.Add(cls);
+    cls = object_store->one_byte_string_class();  // Was allocated above.
+    RegisterPrivateClass(cls, Symbols::OneByteString(), core_lib);
+    pending_classes.Add(cls);
 
-  cls = Class::NewStringClass(kExternalOneByteStringCid);
-  object_store->set_external_one_byte_string_class(cls);
-  RegisterPrivateClass(cls, Symbols::ExternalOneByteString(), core_lib);
-  pending_classes.Add(cls);
+    cls = object_store->two_byte_string_class();  // Was allocated above.
+    RegisterPrivateClass(cls, Symbols::TwoByteString(), core_lib);
+    pending_classes.Add(cls);
 
-  cls = Class::NewStringClass(kExternalTwoByteStringCid);
-  object_store->set_external_two_byte_string_class(cls);
-  RegisterPrivateClass(cls, Symbols::ExternalTwoByteString(), core_lib);
-  pending_classes.Add(cls);
+    cls = Class::NewStringClass(kExternalOneByteStringCid);
+    object_store->set_external_one_byte_string_class(cls);
+    RegisterPrivateClass(cls, Symbols::ExternalOneByteString(), core_lib);
+    pending_classes.Add(cls);
 
-  // Pre-register the isolate library so the native class implementations
-  // can be hooked up before compiling it.
-  Library& isolate_lib =
-      Library::Handle(zone, Library::LookupLibrary(thread,
-                                                   Symbols::DartIsolate()));
-  if (isolate_lib.IsNull()) {
-    isolate_lib = Library::NewLibraryHelper(Symbols::DartIsolate(), true);
-    isolate_lib.SetLoadRequested();
-    isolate_lib.Register(thread);
+    cls = Class::NewStringClass(kExternalTwoByteStringCid);
+    object_store->set_external_two_byte_string_class(cls);
+    RegisterPrivateClass(cls, Symbols::ExternalTwoByteString(), core_lib);
+    pending_classes.Add(cls);
+
+    // Pre-register the isolate library so the native class implementations can
+    // be hooked up before compiling it.
+    Library& isolate_lib = Library::Handle(
+        zone, Library::LookupLibrary(thread, Symbols::DartIsolate()));
+    if (isolate_lib.IsNull()) {
+      isolate_lib = Library::NewLibraryHelper(Symbols::DartIsolate(), true);
+      isolate_lib.SetLoadRequested();
+      isolate_lib.Register(thread);
+    }
     object_store->set_bootstrap_library(ObjectStore::kIsolate, isolate_lib);
-  }
-  ASSERT(!isolate_lib.IsNull());
-  ASSERT(isolate_lib.raw() == Library::IsolateLibrary());
+    ASSERT(!isolate_lib.IsNull());
+    ASSERT(isolate_lib.raw() == Library::IsolateLibrary());
 
-  cls = Class::New<Capability>();
-  RegisterPrivateClass(cls, Symbols::_CapabilityImpl(), isolate_lib);
-  pending_classes.Add(cls);
+    cls = Class::New<Capability>();
+    RegisterPrivateClass(cls, Symbols::_CapabilityImpl(), isolate_lib);
+    pending_classes.Add(cls);
 
-  cls = Class::New<ReceivePort>();
-  RegisterPrivateClass(cls, Symbols::_RawReceivePortImpl(), isolate_lib);
-  pending_classes.Add(cls);
+    cls = Class::New<ReceivePort>();
+    RegisterPrivateClass(cls, Symbols::_RawReceivePortImpl(), isolate_lib);
+    pending_classes.Add(cls);
 
-  cls = Class::New<SendPort>();
-  RegisterPrivateClass(cls, Symbols::_SendPortImpl(), isolate_lib);
-  pending_classes.Add(cls);
+    cls = Class::New<SendPort>();
+    RegisterPrivateClass(cls, Symbols::_SendPortImpl(), isolate_lib);
+    pending_classes.Add(cls);
 
-  const Class& stacktrace_cls = Class::Handle(zone,
-                                              Class::New<Stacktrace>());
-  RegisterPrivateClass(stacktrace_cls, Symbols::_StackTrace(), core_lib);
-  pending_classes.Add(stacktrace_cls);
-  // Super type set below, after Object is allocated.
+    const Class& stacktrace_cls = Class::Handle(zone, Class::New<Stacktrace>());
+    RegisterPrivateClass(stacktrace_cls, Symbols::_StackTrace(), core_lib);
+    pending_classes.Add(stacktrace_cls);
+    // Super type set below, after Object is allocated.
 
-  cls = Class::New<RegExp>();
-  RegisterPrivateClass(cls, Symbols::_RegExp(), core_lib);
-  pending_classes.Add(cls);
+    cls = Class::New<RegExp>();
+    RegisterPrivateClass(cls, Symbols::_RegExp(), core_lib);
+    pending_classes.Add(cls);
 
-  // Initialize the base interfaces used by the core VM classes.
+    // Initialize the base interfaces used by the core VM classes.
 
-  // Allocate and initialize the pre-allocated classes in the core library.
-  // The script and token index of these pre-allocated classes is set up in
-  // the parser when the corelib script is compiled (see
-  // Parser::ParseClassDefinition).
-  cls = Class::New<Instance>(kInstanceCid);
-  object_store->set_object_class(cls);
-  cls.set_name(Symbols::Object());
-  cls.set_num_type_arguments(0);
-  cls.set_num_own_type_arguments(0);
-  cls.set_is_prefinalized();
-  core_lib.AddClass(cls);
-  pending_classes.Add(cls);
-  type = Type::NewNonParameterizedType(cls);
-  object_store->set_object_type(type);
+    // Allocate and initialize the pre-allocated classes in the core library.
+    // The script and token index of these pre-allocated classes is set up in
+    // the parser when the corelib script is compiled (see
+    // Parser::ParseClassDefinition).
+    cls = Class::New<Instance>(kInstanceCid);
+    object_store->set_object_class(cls);
+    cls.set_name(Symbols::Object());
+    cls.set_num_type_arguments(0);
+    cls.set_num_own_type_arguments(0);
+    cls.set_is_prefinalized();
+    core_lib.AddClass(cls);
+    pending_classes.Add(cls);
+    type = Type::NewNonParameterizedType(cls);
+    object_store->set_object_type(type);
 
-  cls = Class::New<Bool>();
-  object_store->set_bool_class(cls);
-  RegisterClass(cls, Symbols::Bool(), core_lib);
-  pending_classes.Add(cls);
+    cls = Class::New<Bool>();
+    object_store->set_bool_class(cls);
+    RegisterClass(cls, Symbols::Bool(), core_lib);
+    pending_classes.Add(cls);
 
-  cls = Class::New<Instance>(kNullCid);
-  object_store->set_null_class(cls);
-  cls.set_num_type_arguments(0);
-  cls.set_num_own_type_arguments(0);
-  cls.set_is_prefinalized();
-  RegisterClass(cls, Symbols::Null(), core_lib);
-  pending_classes.Add(cls);
+    cls = Class::New<Instance>(kNullCid);
+    object_store->set_null_class(cls);
+    cls.set_num_type_arguments(0);
+    cls.set_num_own_type_arguments(0);
+    cls.set_is_prefinalized();
+    RegisterClass(cls, Symbols::Null(), core_lib);
+    pending_classes.Add(cls);
 
-  ASSERT(!library_prefix_cls.IsNull());
-  RegisterPrivateClass(library_prefix_cls, Symbols::_LibraryPrefix(), core_lib);
-  pending_classes.Add(library_prefix_cls);
+    ASSERT(!library_prefix_cls.IsNull());
+    RegisterPrivateClass(library_prefix_cls, Symbols::_LibraryPrefix(),
+                         core_lib);
+    pending_classes.Add(library_prefix_cls);
 
-  RegisterPrivateClass(type_cls, Symbols::Type(), core_lib);
-  pending_classes.Add(type_cls);
+    RegisterPrivateClass(type_cls, Symbols::Type(), core_lib);
+    pending_classes.Add(type_cls);
 
-  RegisterPrivateClass(type_ref_cls, Symbols::TypeRef(), core_lib);
-  pending_classes.Add(type_ref_cls);
+    RegisterPrivateClass(type_ref_cls, Symbols::TypeRef(), core_lib);
+    pending_classes.Add(type_ref_cls);
 
-  RegisterPrivateClass(type_parameter_cls, Symbols::TypeParameter(), core_lib);
-  pending_classes.Add(type_parameter_cls);
+    RegisterPrivateClass(type_parameter_cls, Symbols::TypeParameter(),
+                         core_lib);
+    pending_classes.Add(type_parameter_cls);
 
-  RegisterPrivateClass(bounded_type_cls, Symbols::BoundedType(), core_lib);
-  pending_classes.Add(bounded_type_cls);
+    RegisterPrivateClass(bounded_type_cls, Symbols::BoundedType(), core_lib);
+    pending_classes.Add(bounded_type_cls);
 
-  RegisterPrivateClass(mixin_app_type_cls, Symbols::MixinAppType(), core_lib);
-  pending_classes.Add(mixin_app_type_cls);
+    RegisterPrivateClass(mixin_app_type_cls, Symbols::MixinAppType(), core_lib);
+    pending_classes.Add(mixin_app_type_cls);
 
-  cls = Class::New<Integer>();
-  object_store->set_integer_implementation_class(cls);
-  RegisterPrivateClass(cls, Symbols::IntegerImplementation(), core_lib);
-  pending_classes.Add(cls);
+    cls = Class::New<Integer>();
+    object_store->set_integer_implementation_class(cls);
+    RegisterPrivateClass(cls, Symbols::IntegerImplementation(), core_lib);
+    pending_classes.Add(cls);
 
-  cls = Class::New<Smi>();
-  object_store->set_smi_class(cls);
-  RegisterPrivateClass(cls, Symbols::_Smi(), core_lib);
-  pending_classes.Add(cls);
+    cls = Class::New<Smi>();
+    object_store->set_smi_class(cls);
+    RegisterPrivateClass(cls, Symbols::_Smi(), core_lib);
+    pending_classes.Add(cls);
 
-  cls = Class::New<Mint>();
-  object_store->set_mint_class(cls);
-  RegisterPrivateClass(cls, Symbols::_Mint(), core_lib);
-  pending_classes.Add(cls);
+    cls = Class::New<Mint>();
+    object_store->set_mint_class(cls);
+    RegisterPrivateClass(cls, Symbols::_Mint(), core_lib);
+    pending_classes.Add(cls);
 
-  cls = Class::New<Bigint>();
-  object_store->set_bigint_class(cls);
-  RegisterPrivateClass(cls, Symbols::_Bigint(), core_lib);
-  pending_classes.Add(cls);
+    cls = Class::New<Bigint>();
+    object_store->set_bigint_class(cls);
+    RegisterPrivateClass(cls, Symbols::_Bigint(), core_lib);
+    pending_classes.Add(cls);
 
-  cls = Class::New<Double>();
-  object_store->set_double_class(cls);
-  RegisterPrivateClass(cls, Symbols::_Double(), core_lib);
-  pending_classes.Add(cls);
+    cls = Class::New<Double>();
+    object_store->set_double_class(cls);
+    RegisterPrivateClass(cls, Symbols::_Double(), core_lib);
+    pending_classes.Add(cls);
 
-  // Class that represents the Dart class _Closure and C++ class Closure.
-  cls = Class::New<Closure>();
-  cls.set_type_arguments_field_offset(Closure::type_arguments_offset());
-  cls.set_num_type_arguments(0);  // Although a closure has type_arguments_.
-  cls.set_num_own_type_arguments(0);
-  RegisterPrivateClass(cls, Symbols::_Closure(), core_lib);
-  pending_classes.Add(cls);
-  object_store->set_closure_class(cls);
+    // Class that represents the Dart class _Closure and C++ class Closure.
+    cls = Class::New<Closure>();
+    cls.set_type_arguments_field_offset(Closure::type_arguments_offset());
+    cls.set_num_type_arguments(0);  // Although a closure has type_arguments_.
+    cls.set_num_own_type_arguments(0);
+    RegisterPrivateClass(cls, Symbols::_Closure(), core_lib);
+    pending_classes.Add(cls);
+    object_store->set_closure_class(cls);
 
-  cls = Class::New<WeakProperty>();
-  object_store->set_weak_property_class(cls);
-  RegisterPrivateClass(cls, Symbols::_WeakProperty(), core_lib);
+    cls = Class::New<WeakProperty>();
+    object_store->set_weak_property_class(cls);
+    RegisterPrivateClass(cls, Symbols::_WeakProperty(), core_lib);
 
-  // Pre-register the mirrors library so we can place the vm class
-  // MirrorReference there rather than the core library.
-NOT_IN_PRODUCT(
-  lib = Library::LookupLibrary(thread, Symbols::DartMirrors());
-  if (lib.IsNull()) {
-    lib = Library::NewLibraryHelper(Symbols::DartMirrors(), true);
-    lib.SetLoadRequested();
-    lib.Register(thread);
+// Pre-register the mirrors library so we can place the vm class
+// MirrorReference there rather than the core library.
+#if !defined(PRODUCT)
+    lib = Library::LookupLibrary(thread, Symbols::DartMirrors());
+    if (lib.IsNull()) {
+      lib = Library::NewLibraryHelper(Symbols::DartMirrors(), true);
+      lib.SetLoadRequested();
+      lib.Register(thread);
+    }
     object_store->set_bootstrap_library(ObjectStore::kMirrors, lib);
-  }
-  ASSERT(!lib.IsNull());
-  ASSERT(lib.raw() == Library::MirrorsLibrary());
+    ASSERT(!lib.IsNull());
+    ASSERT(lib.raw() == Library::MirrorsLibrary());
 
-  cls = Class::New<MirrorReference>();
-  RegisterPrivateClass(cls, Symbols::_MirrorReference(), lib);
-)
+    cls = Class::New<MirrorReference>();
+    RegisterPrivateClass(cls, Symbols::_MirrorReference(), lib);
+#endif
 
-  // Pre-register the collection library so we can place the vm class
-  // LinkedHashMap there rather than the core library.
-  lib = Library::LookupLibrary(thread, Symbols::DartCollection());
-  if (lib.IsNull()) {
-    lib = Library::NewLibraryHelper(Symbols::DartCollection(), true);
-    lib.SetLoadRequested();
-    lib.Register(thread);
+    // Pre-register the collection library so we can place the vm class
+    // LinkedHashMap there rather than the core library.
+    lib = Library::LookupLibrary(thread, Symbols::DartCollection());
+    if (lib.IsNull()) {
+      lib = Library::NewLibraryHelper(Symbols::DartCollection(), true);
+      lib.SetLoadRequested();
+      lib.Register(thread);
+    }
+
     object_store->set_bootstrap_library(ObjectStore::kCollection, lib);
-  }
-  ASSERT(!lib.IsNull());
-  ASSERT(lib.raw() == Library::CollectionLibrary());
-  cls = Class::New<LinkedHashMap>();
-  object_store->set_linked_hash_map_class(cls);
-  cls.set_type_arguments_field_offset(LinkedHashMap::type_arguments_offset());
-  cls.set_num_type_arguments(2);
-  cls.set_num_own_type_arguments(2);
-  RegisterPrivateClass(cls, Symbols::_LinkedHashMap(), lib);
-  pending_classes.Add(cls);
+    ASSERT(!lib.IsNull());
+    ASSERT(lib.raw() == Library::CollectionLibrary());
+    cls = Class::New<LinkedHashMap>();
+    object_store->set_linked_hash_map_class(cls);
+    cls.set_type_arguments_field_offset(LinkedHashMap::type_arguments_offset());
+    cls.set_num_type_arguments(2);
+    cls.set_num_own_type_arguments(0);
+    RegisterPrivateClass(cls, Symbols::_LinkedHashMap(), lib);
+    pending_classes.Add(cls);
 
-  // Pre-register the developer library so we can place the vm class
-  // UserTag there rather than the core library.
-  lib = Library::LookupLibrary(thread, Symbols::DartDeveloper());
-  if (lib.IsNull()) {
-    lib = Library::NewLibraryHelper(Symbols::DartDeveloper(), true);
-    lib.SetLoadRequested();
-    lib.Register(thread);
+    // Pre-register the developer library so we can place the vm class
+    // UserTag there rather than the core library.
+    lib = Library::LookupLibrary(thread, Symbols::DartDeveloper());
+    if (lib.IsNull()) {
+      lib = Library::NewLibraryHelper(Symbols::DartDeveloper(), true);
+      lib.SetLoadRequested();
+      lib.Register(thread);
+    }
     object_store->set_bootstrap_library(ObjectStore::kDeveloper, lib);
-  }
-  ASSERT(!lib.IsNull());
-  ASSERT(lib.raw() == Library::DeveloperLibrary());
+    ASSERT(!lib.IsNull());
+    ASSERT(lib.raw() == Library::DeveloperLibrary());
+    cls = Class::New<UserTag>();
+    RegisterPrivateClass(cls, Symbols::_UserTag(), lib);
+    pending_classes.Add(cls);
 
-  lib = Library::LookupLibrary(thread, Symbols::DartDeveloper());
-  ASSERT(!lib.IsNull());
-  cls = Class::New<UserTag>();
-  RegisterPrivateClass(cls, Symbols::_UserTag(), lib);
-  pending_classes.Add(cls);
+    // Setup some default native field classes which can be extended for
+    // specifying native fields in dart classes.
+    Library::InitNativeWrappersLibrary(isolate, is_kernel);
+    ASSERT(object_store->native_wrappers_library() != Library::null());
 
-  // Setup some default native field classes which can be extended for
-  // specifying native fields in dart classes.
-  Library::InitNativeWrappersLibrary(isolate);
-  ASSERT(object_store->native_wrappers_library() != Library::null());
-
-  // Pre-register the typed_data library so the native class implementations
-  // can be hooked up before compiling it.
-  lib = Library::LookupLibrary(thread, Symbols::DartTypedData());
-  if (lib.IsNull()) {
-    lib = Library::NewLibraryHelper(Symbols::DartTypedData(), true);
-    lib.SetLoadRequested();
-    lib.Register(thread);
+    // Pre-register the typed_data library so the native class implementations
+    // can be hooked up before compiling it.
+    lib = Library::LookupLibrary(thread, Symbols::DartTypedData());
+    if (lib.IsNull()) {
+      lib = Library::NewLibraryHelper(Symbols::DartTypedData(), true);
+      lib.SetLoadRequested();
+      lib.Register(thread);
+    }
     object_store->set_bootstrap_library(ObjectStore::kTypedData, lib);
-  }
-  ASSERT(!lib.IsNull());
-  ASSERT(lib.raw() == Library::TypedDataLibrary());
+    ASSERT(!lib.IsNull());
+    ASSERT(lib.raw() == Library::TypedDataLibrary());
 #define REGISTER_TYPED_DATA_CLASS(clazz)                                       \
   cls = Class::NewTypedDataClass(kTypedData##clazz##ArrayCid);                 \
-  RegisterClass(cls, Symbols::clazz##List(), lib);                             \
+  RegisterClass(cls, Symbols::clazz##List(), lib);
 
-  DART_CLASS_LIST_TYPED_DATA(REGISTER_TYPED_DATA_CLASS);
+    DART_CLASS_LIST_TYPED_DATA(REGISTER_TYPED_DATA_CLASS);
 #undef REGISTER_TYPED_DATA_CLASS
 #define REGISTER_TYPED_DATA_VIEW_CLASS(clazz)                                  \
   cls = Class::NewTypedDataViewClass(kTypedData##clazz##ViewCid);              \
   RegisterPrivateClass(cls, Symbols::_##clazz##View(), lib);                   \
-  pending_classes.Add(cls);                                                    \
-
-  CLASS_LIST_TYPED_DATA(REGISTER_TYPED_DATA_VIEW_CLASS);
-  cls = Class::NewTypedDataViewClass(kByteDataViewCid);
-  RegisterPrivateClass(cls, Symbols::_ByteDataView(), lib);
   pending_classes.Add(cls);
+
+    CLASS_LIST_TYPED_DATA(REGISTER_TYPED_DATA_VIEW_CLASS);
+    cls = Class::NewTypedDataViewClass(kByteDataViewCid);
+    RegisterPrivateClass(cls, Symbols::_ByteDataView(), lib);
+    pending_classes.Add(cls);
 #undef REGISTER_TYPED_DATA_VIEW_CLASS
 #define REGISTER_EXT_TYPED_DATA_CLASS(clazz)                                   \
   cls = Class::NewExternalTypedDataClass(kExternalTypedData##clazz##Cid);      \
-  RegisterPrivateClass(cls, Symbols::_External##clazz(), lib);                 \
+  RegisterPrivateClass(cls, Symbols::_External##clazz(), lib);
 
-  cls = Class::New<Instance>(kByteBufferCid);
-  cls.set_instance_size(0);
-  cls.set_next_field_offset(-kWordSize);
-  RegisterClass(cls, Symbols::ByteBuffer(), lib);
-  pending_classes.Add(cls);
+    cls = Class::New<Instance>(kByteBufferCid);
+    cls.set_instance_size(0);
+    cls.set_next_field_offset(-kWordSize);
+    RegisterClass(cls, Symbols::ByteBuffer(), lib);
+    pending_classes.Add(cls);
 
-  CLASS_LIST_TYPED_DATA(REGISTER_EXT_TYPED_DATA_CLASS);
+    CLASS_LIST_TYPED_DATA(REGISTER_EXT_TYPED_DATA_CLASS);
 #undef REGISTER_EXT_TYPED_DATA_CLASS
-  // Register Float32x4 and Int32x4 in the object store.
-  cls = Class::New<Float32x4>();
-  RegisterClass(cls, Symbols::Float32x4(), lib);
-  cls.set_num_type_arguments(0);
-  cls.set_num_own_type_arguments(0);
-  cls.set_is_prefinalized();
-  pending_classes.Add(cls);
-  object_store->set_float32x4_class(cls);
-  type = Type::NewNonParameterizedType(cls);
-  object_store->set_float32x4_type(type);
+    // Register Float32x4 and Int32x4 in the object store.
+    cls = Class::New<Float32x4>();
+    RegisterClass(cls, Symbols::Float32x4(), lib);
+    cls.set_num_type_arguments(0);
+    cls.set_num_own_type_arguments(0);
+    cls.set_is_prefinalized();
+    pending_classes.Add(cls);
+    object_store->set_float32x4_class(cls);
+    type = Type::NewNonParameterizedType(cls);
+    object_store->set_float32x4_type(type);
 
-  cls = Class::New<Int32x4>();
-  RegisterClass(cls, Symbols::Int32x4(), lib);
-  cls.set_num_type_arguments(0);
-  cls.set_num_own_type_arguments(0);
-  cls.set_is_prefinalized();
-  pending_classes.Add(cls);
-  object_store->set_int32x4_class(cls);
-  type = Type::NewNonParameterizedType(cls);
-  object_store->set_int32x4_type(type);
+    cls = Class::New<Int32x4>();
+    RegisterClass(cls, Symbols::Int32x4(), lib);
+    cls.set_num_type_arguments(0);
+    cls.set_num_own_type_arguments(0);
+    cls.set_is_prefinalized();
+    pending_classes.Add(cls);
+    object_store->set_int32x4_class(cls);
+    type = Type::NewNonParameterizedType(cls);
+    object_store->set_int32x4_type(type);
 
-  cls = Class::New<Float64x2>();
-  RegisterClass(cls, Symbols::Float64x2(), lib);
-  cls.set_num_type_arguments(0);
-  cls.set_num_own_type_arguments(0);
-  cls.set_is_prefinalized();
-  pending_classes.Add(cls);
-  object_store->set_float64x2_class(cls);
-  type = Type::NewNonParameterizedType(cls);
-  object_store->set_float64x2_type(type);
+    cls = Class::New<Float64x2>();
+    RegisterClass(cls, Symbols::Float64x2(), lib);
+    cls.set_num_type_arguments(0);
+    cls.set_num_own_type_arguments(0);
+    cls.set_is_prefinalized();
+    pending_classes.Add(cls);
+    object_store->set_float64x2_class(cls);
+    type = Type::NewNonParameterizedType(cls);
+    object_store->set_float64x2_type(type);
 
-  // Set the super type of class Stacktrace to Object type so that the
-  // 'toString' method is implemented.
-  type = object_store->object_type();
-  stacktrace_cls.set_super_type(type);
+    // Set the super type of class Stacktrace to Object type so that the
+    // 'toString' method is implemented.
+    type = object_store->object_type();
+    stacktrace_cls.set_super_type(type);
 
-  // Abstract class that represents the Dart class Function.
-  cls = Class::New<Instance>(kIllegalCid);
-  cls.set_num_type_arguments(0);
-  cls.set_num_own_type_arguments(0);
-  cls.set_is_prefinalized();
-  RegisterClass(cls, Symbols::Function(), core_lib);
-  pending_classes.Add(cls);
-  type = Type::NewNonParameterizedType(cls);
-  object_store->set_function_type(type);
+    // Abstract class that represents the Dart class Function.
+    cls = Class::New<Instance>(kIllegalCid);
+    cls.set_num_type_arguments(0);
+    cls.set_num_own_type_arguments(0);
+    cls.set_is_prefinalized();
+    RegisterClass(cls, Symbols::Function(), core_lib);
+    pending_classes.Add(cls);
+    type = Type::NewNonParameterizedType(cls);
+    object_store->set_function_type(type);
 
-  cls = Class::New<Number>();
-  RegisterClass(cls, Symbols::Number(), core_lib);
-  pending_classes.Add(cls);
-  type = Type::NewNonParameterizedType(cls);
-  object_store->set_number_type(type);
+    cls = Class::New<Number>();
+    RegisterClass(cls, Symbols::Number(), core_lib);
+    pending_classes.Add(cls);
+    type = Type::NewNonParameterizedType(cls);
+    object_store->set_number_type(type);
 
-  cls = Class::New<Instance>(kIllegalCid);
-  RegisterClass(cls, Symbols::Int(), core_lib);
-  cls.set_num_type_arguments(0);
-  cls.set_num_own_type_arguments(0);
-  cls.set_is_prefinalized();
-  pending_classes.Add(cls);
-  type = Type::NewNonParameterizedType(cls);
-  object_store->set_int_type(type);
+    cls = Class::New<Instance>(kIllegalCid);
+    RegisterClass(cls, Symbols::Int(), core_lib);
+    cls.set_num_type_arguments(0);
+    cls.set_num_own_type_arguments(0);
+    cls.set_is_prefinalized();
+    pending_classes.Add(cls);
+    type = Type::NewNonParameterizedType(cls);
+    object_store->set_int_type(type);
 
-  cls = Class::New<Instance>(kIllegalCid);
-  RegisterClass(cls, Symbols::Double(), core_lib);
-  cls.set_num_type_arguments(0);
-  cls.set_num_own_type_arguments(0);
-  cls.set_is_prefinalized();
-  pending_classes.Add(cls);
-  type = Type::NewNonParameterizedType(cls);
-  object_store->set_double_type(type);
+    cls = Class::New<Instance>(kIllegalCid);
+    RegisterClass(cls, Symbols::Double(), core_lib);
+    cls.set_num_type_arguments(0);
+    cls.set_num_own_type_arguments(0);
+    cls.set_is_prefinalized();
+    pending_classes.Add(cls);
+    type = Type::NewNonParameterizedType(cls);
+    object_store->set_double_type(type);
 
-  name = Symbols::_String().raw();
-  cls = Class::New<Instance>(kIllegalCid);
-  RegisterClass(cls, name, core_lib);
-  cls.set_num_type_arguments(0);
-  cls.set_num_own_type_arguments(0);
-  cls.set_is_prefinalized();
-  pending_classes.Add(cls);
-  type = Type::NewNonParameterizedType(cls);
-  object_store->set_string_type(type);
+    name = Symbols::_String().raw();
+    cls = Class::New<Instance>(kIllegalCid);
+    RegisterClass(cls, name, core_lib);
+    cls.set_num_type_arguments(0);
+    cls.set_num_own_type_arguments(0);
+    cls.set_is_prefinalized();
+    pending_classes.Add(cls);
+    type = Type::NewNonParameterizedType(cls);
+    object_store->set_string_type(type);
 
-  cls = object_store->bool_class();
-  type = Type::NewNonParameterizedType(cls);
-  object_store->set_bool_type(type);
+    cls = object_store->bool_class();
+    type = Type::NewNonParameterizedType(cls);
+    object_store->set_bool_type(type);
 
-  cls = object_store->smi_class();
-  type = Type::NewNonParameterizedType(cls);
-  object_store->set_smi_type(type);
+    cls = object_store->smi_class();
+    type = Type::NewNonParameterizedType(cls);
+    object_store->set_smi_type(type);
 
-  cls = object_store->mint_class();
-  type = Type::NewNonParameterizedType(cls);
-  object_store->set_mint_type(type);
+    cls = object_store->mint_class();
+    type = Type::NewNonParameterizedType(cls);
+    object_store->set_mint_type(type);
 
-  // The classes 'void' and 'dynamic' are phoney classes to make type checking
-  // more regular; they live in the VM isolate. The class 'void' is not
-  // registered in the class dictionary because its name is a reserved word.
-  // The class 'dynamic' is registered in the class dictionary because its name
-  // is a built-in identifier (this is wrong).
-  // The corresponding types are stored in the object store.
-  cls = object_store->null_class();
-  type = Type::NewNonParameterizedType(cls);
-  object_store->set_null_type(type);
+    // The classes 'void' and 'dynamic' are phony classes to make type checking
+    // more regular; they live in the VM isolate. The class 'void' is not
+    // registered in the class dictionary because its name is a reserved word.
+    // The class 'dynamic' is registered in the class dictionary because its
+    // name is a built-in identifier (this is wrong).  The corresponding types
+    // are stored in the object store.
+    cls = object_store->null_class();
+    type = Type::NewNonParameterizedType(cls);
+    object_store->set_null_type(type);
 
-  // Consider removing when/if Null becomes an ordinary class.
-  type = object_store->object_type();
-  cls.set_super_type(type);
+    // Consider removing when/if Null becomes an ordinary class.
+    type = object_store->object_type();
+    cls.set_super_type(type);
 
-  // Finish the initialization by compiling the bootstrap scripts containing the
-  // base interfaces and the implementation of the internal classes.
-  const Error& error = Error::Handle(Bootstrap::LoadandCompileScripts());
-  if (!error.IsNull()) {
-    return error.raw();
-  }
+    // Finish the initialization by compiling the bootstrap scripts containing
+    // the base interfaces and the implementation of the internal classes.
+    const Error& error =
+        Error::Handle(zone, Bootstrap::DoBootstrapping(kernel_program));
+    if (!error.IsNull()) {
+      return error.raw();
+    }
 
-  ClassFinalizer::VerifyBootstrapClasses();
+    ClassFinalizer::VerifyBootstrapClasses();
 
-  // Set up the intrinsic state of all functions (core, math and typed data).
-  Intrinsifier::InitializeState();
+    // Set up the intrinsic state of all functions (core, math and typed data).
+    Intrinsifier::InitializeState();
 
-  // Set up recognized state of all functions (core, math and typed data).
-  MethodRecognizer::InitializeState();
+    // Set up recognized state of all functions (core, math and typed data).
+    MethodRecognizer::InitializeState();
 
-  // Adds static const fields (class ids) to the class 'ClassID');
-  lib = Library::LookupLibrary(thread, Symbols::DartInternal());
-  ASSERT(!lib.IsNull());
-  cls = lib.LookupClassAllowPrivate(Symbols::ClassID());
-  ASSERT(!cls.IsNull());
-  Field& field = Field::Handle(zone);
-  Smi& value = Smi::Handle(zone);
-  String& field_name = String::Handle(zone);
+    isolate->object_store()->InitKnownObjects();
+#endif  // !defined(DART_PRECOMPILED_RUNTIME)
+  } else {
+    // Object::Init version when we are running in a version of dart that has a
+    // full snapshot linked in and an isolate is initialized using the full
+    // snapshot.
+    ObjectStore* object_store = isolate->object_store();
 
-#define CLASS_LIST_WITH_NULL(V)                                                \
-  V(Null)                                                                      \
-  CLASS_LIST_NO_OBJECT(V)
+    Class& cls = Class::Handle(zone);
 
-#define ADD_SET_FIELD(clazz)                                                   \
-  field_name = Symbols::New(thread, "cid"#clazz);                              \
-  field = Field::New(field_name, true, false, true, false, cls,                \
-      Type::Handle(Type::IntType()), TokenPosition::kMinSource);               \
-  value = Smi::New(k##clazz##Cid);                                             \
-  field.SetStaticValue(value, true);                                           \
-  cls.AddField(field);                                                         \
+    // Set up empty classes in the object store, these will get initialized
+    // correctly when we read from the snapshot.  This is done to allow
+    // bootstrapping of reading classes from the snapshot.  Some classes are not
+    // stored in the object store. Yet we still need to create their Class
+    // object so that they get put into the class_table (as a side effect of
+    // Class::New()).
+    cls = Class::New<Instance>(kInstanceCid);
+    object_store->set_object_class(cls);
 
-  CLASS_LIST_WITH_NULL(ADD_SET_FIELD)
-#undef ADD_SET_FIELD
+    cls = Class::New<LibraryPrefix>();
+    cls = Class::New<Type>();
+    cls = Class::New<TypeRef>();
+    cls = Class::New<TypeParameter>();
+    cls = Class::New<BoundedType>();
+    cls = Class::New<MixinAppType>();
 
-  isolate->object_store()->InitKnownObjects();
+    cls = Class::New<Array>();
+    object_store->set_array_class(cls);
 
-  return Error::null();
-#else  // defined(DART_NO_SNAPSHOT).
-  // Object::Init version when we are running in a version of dart that has
-  // a full snapshot linked in and an isolate is initialized using the full
-  // snapshot.
-  ObjectStore* object_store = isolate->object_store();
+    cls = Class::New<Array>(kImmutableArrayCid);
+    object_store->set_immutable_array_class(cls);
 
-  Class& cls = Class::Handle();
+    cls = Class::New<GrowableObjectArray>();
+    object_store->set_growable_object_array_class(cls);
 
-  // Set up empty classes in the object store, these will get
-  // initialized correctly when we read from the snapshot.
-  // This is done to allow bootstrapping of reading classes from the snapshot.
-  // Some classes are not stored in the object store. Yet we still need to
-  // create their Class object so that they get put into the class_table
-  // (as a side effect of Class::New()).
+    cls = Class::New<LinkedHashMap>();
+    object_store->set_linked_hash_map_class(cls);
 
-  cls = Class::New<Instance>(kInstanceCid);
-  object_store->set_object_class(cls);
+    cls = Class::New<Float32x4>();
+    object_store->set_float32x4_class(cls);
 
-  cls = Class::New<LibraryPrefix>();
-  cls = Class::New<Type>();
-  cls = Class::New<TypeRef>();
-  cls = Class::New<TypeParameter>();
-  cls = Class::New<BoundedType>();
-  cls = Class::New<MixinAppType>();
+    cls = Class::New<Int32x4>();
+    object_store->set_int32x4_class(cls);
 
-  cls = Class::New<Array>();
-  object_store->set_array_class(cls);
-
-  cls = Class::New<Array>(kImmutableArrayCid);
-  object_store->set_immutable_array_class(cls);
-
-  cls = Class::New<GrowableObjectArray>();
-  object_store->set_growable_object_array_class(cls);
-
-  cls = Class::New<LinkedHashMap>();
-  object_store->set_linked_hash_map_class(cls);
-
-  cls = Class::New<Float32x4>();
-  object_store->set_float32x4_class(cls);
-
-  cls = Class::New<Int32x4>();
-  object_store->set_int32x4_class(cls);
-
-  cls = Class::New<Float64x2>();
-  object_store->set_float64x2_class(cls);
+    cls = Class::New<Float64x2>();
+    object_store->set_float64x2_class(cls);
 
 #define REGISTER_TYPED_DATA_CLASS(clazz)                                       \
   cls = Class::NewTypedDataClass(kTypedData##clazz##Cid);
-  CLASS_LIST_TYPED_DATA(REGISTER_TYPED_DATA_CLASS);
+    CLASS_LIST_TYPED_DATA(REGISTER_TYPED_DATA_CLASS);
 #undef REGISTER_TYPED_DATA_CLASS
 #define REGISTER_TYPED_DATA_VIEW_CLASS(clazz)                                  \
   cls = Class::NewTypedDataViewClass(kTypedData##clazz##ViewCid);
-  CLASS_LIST_TYPED_DATA(REGISTER_TYPED_DATA_VIEW_CLASS);
+    CLASS_LIST_TYPED_DATA(REGISTER_TYPED_DATA_VIEW_CLASS);
 #undef REGISTER_TYPED_DATA_VIEW_CLASS
-  cls = Class::NewTypedDataViewClass(kByteDataViewCid);
+    cls = Class::NewTypedDataViewClass(kByteDataViewCid);
 #define REGISTER_EXT_TYPED_DATA_CLASS(clazz)                                   \
   cls = Class::NewExternalTypedDataClass(kExternalTypedData##clazz##Cid);
-  CLASS_LIST_TYPED_DATA(REGISTER_EXT_TYPED_DATA_CLASS);
+    CLASS_LIST_TYPED_DATA(REGISTER_EXT_TYPED_DATA_CLASS);
 #undef REGISTER_EXT_TYPED_DATA_CLASS
 
-  cls = Class::New<Instance>(kByteBufferCid);
+    cls = Class::New<Instance>(kByteBufferCid);
 
-  cls = Class::New<Integer>();
-  object_store->set_integer_implementation_class(cls);
+    cls = Class::New<Integer>();
+    object_store->set_integer_implementation_class(cls);
 
-  cls = Class::New<Smi>();
-  object_store->set_smi_class(cls);
+    cls = Class::New<Smi>();
+    object_store->set_smi_class(cls);
 
-  cls = Class::New<Mint>();
-  object_store->set_mint_class(cls);
+    cls = Class::New<Mint>();
+    object_store->set_mint_class(cls);
 
-  cls = Class::New<Double>();
-  object_store->set_double_class(cls);
+    cls = Class::New<Double>();
+    object_store->set_double_class(cls);
 
-  cls = Class::New<Closure>();
-  object_store->set_closure_class(cls);
+    cls = Class::New<Closure>();
+    object_store->set_closure_class(cls);
 
-  cls = Class::New<Bigint>();
-  object_store->set_bigint_class(cls);
+    cls = Class::New<Bigint>();
+    object_store->set_bigint_class(cls);
 
-  cls = Class::NewStringClass(kOneByteStringCid);
-  object_store->set_one_byte_string_class(cls);
+    cls = Class::NewStringClass(kOneByteStringCid);
+    object_store->set_one_byte_string_class(cls);
 
-  cls = Class::NewStringClass(kTwoByteStringCid);
-  object_store->set_two_byte_string_class(cls);
+    cls = Class::NewStringClass(kTwoByteStringCid);
+    object_store->set_two_byte_string_class(cls);
 
-  cls = Class::NewStringClass(kExternalOneByteStringCid);
-  object_store->set_external_one_byte_string_class(cls);
+    cls = Class::NewStringClass(kExternalOneByteStringCid);
+    object_store->set_external_one_byte_string_class(cls);
 
-  cls = Class::NewStringClass(kExternalTwoByteStringCid);
-  object_store->set_external_two_byte_string_class(cls);
+    cls = Class::NewStringClass(kExternalTwoByteStringCid);
+    object_store->set_external_two_byte_string_class(cls);
 
-  cls = Class::New<Bool>();
-  object_store->set_bool_class(cls);
+    cls = Class::New<Bool>();
+    object_store->set_bool_class(cls);
 
-  cls = Class::New<Instance>(kNullCid);
-  object_store->set_null_class(cls);
+    cls = Class::New<Instance>(kNullCid);
+    object_store->set_null_class(cls);
 
-  cls = Class::New<Capability>();
-  cls = Class::New<ReceivePort>();
-  cls = Class::New<SendPort>();
-  cls = Class::New<Stacktrace>();
-  cls = Class::New<RegExp>();
-  cls = Class::New<Number>();
+    cls = Class::New<Capability>();
+    cls = Class::New<ReceivePort>();
+    cls = Class::New<SendPort>();
+    cls = Class::New<Stacktrace>();
+    cls = Class::New<RegExp>();
+    cls = Class::New<Number>();
 
-  cls = Class::New<WeakProperty>();
-  object_store->set_weak_property_class(cls);
+    cls = Class::New<WeakProperty>();
+    object_store->set_weak_property_class(cls);
 
-  cls = Class::New<MirrorReference>();
-  cls = Class::New<UserTag>();
+    cls = Class::New<MirrorReference>();
+    cls = Class::New<UserTag>();
 
-  const Context& context = Context::Handle(zone,
-                                           Context::New(0, Heap::kOld));
-  object_store->set_empty_context(context);
-
-#endif  // defined(DART_NO_SNAPSHOT).
-
+    const Context& context = Context::Handle(zone, Context::New(0, Heap::kOld));
+    object_store->set_empty_context(context);
+  }
   return Error::null();
 }
 
 
 #if defined(DEBUG)
-bool Object:: InVMHeap() const {
+bool Object::InVMHeap() const {
   if (FLAG_verify_handles && raw()->IsVMHeapObject()) {
     Heap* vm_isolate_heap = Dart::vm_isolate()->heap();
     ASSERT(vm_isolate_heap->Contains(RawObject::ToAddr(raw())));
@@ -1793,7 +1776,8 @@
                               intptr_t size,
                               bool is_vm_object) {
   uword initial_value = (class_id == kInstructionsCid)
-      ? Assembler::GetBreakInstructionFiller() : reinterpret_cast<uword>(null_);
+                            ? Assembler::GetBreakInstructionFiller()
+                            : reinterpret_cast<uword>(null_);
   uword cur = address;
   uword end = address + size;
   while (cur < end) {
@@ -1834,9 +1818,7 @@
 }
 
 
-RawObject* Object::Allocate(intptr_t cls_id,
-                            intptr_t size,
-                            Heap::Space space) {
+RawObject* Object::Allocate(intptr_t cls_id, intptr_t size, Heap::Space space) {
   ASSERT(Utils::IsAligned(size, kObjectAlignment));
   Thread* thread = Thread::Current();
   Isolate* isolate = thread->isolate();
@@ -1876,8 +1858,10 @@
 
 class StoreBufferUpdateVisitor : public ObjectPointerVisitor {
  public:
-  explicit StoreBufferUpdateVisitor(Thread* thread, RawObject* obj) :
-      ObjectPointerVisitor(thread->isolate()), thread_(thread), old_obj_(obj) {
+  explicit StoreBufferUpdateVisitor(Thread* thread, RawObject* obj)
+      : ObjectPointerVisitor(thread->isolate()),
+        thread_(thread),
+        old_obj_(obj) {
     ASSERT(old_obj_->IsOldObject());
   }
 
@@ -1911,7 +1895,6 @@
 }
 
 
-
 RawObject* Object::Clone(const Object& orig, Heap::Space space) {
   const Class& cls = Class::Handle(orig.clazz());
   intptr_t size = orig.raw()->Size();
@@ -1942,7 +1925,6 @@
 
 
 RawString* Class::Name() const {
-  ASSERT(raw_ptr()->name_ != String::null());
   return raw_ptr()->name_;
 }
 
@@ -1953,10 +1935,10 @@
 
 
 RawString* Class::UserVisibleName() const {
-NOT_IN_PRODUCT(
+#if !defined(PRODUCT)
   ASSERT(raw_ptr()->user_name_ != String::null());
   return raw_ptr()->user_name_;
-)
+#endif                               // !defined(PRODUCT)
   return GenerateUserVisibleName();  // No caching in PRODUCT, regenerate.
 }
 
@@ -1969,23 +1951,17 @@
 
 RawAbstractType* Class::RareType() const {
   const Type& type = Type::Handle(Type::New(
-      *this,
-      Object::null_type_arguments(),
-      TokenPosition::kNoSource));
-  return ClassFinalizer::FinalizeType(*this,
-                                      type,
+      *this, Object::null_type_arguments(), TokenPosition::kNoSource));
+  return ClassFinalizer::FinalizeType(*this, type,
                                       ClassFinalizer::kCanonicalize);
 }
 
 
 RawAbstractType* Class::DeclarationType() const {
   const TypeArguments& args = TypeArguments::Handle(type_parameters());
-  const Type& type = Type::Handle(Type::New(
-      *this,
-      args,
-      TokenPosition::kNoSource));
-  return ClassFinalizer::FinalizeType(*this,
-                                      type,
+  const Type& type =
+      Type::Handle(Type::New(*this, args, TokenPosition::kNoSource));
+  return ClassFinalizer::FinalizeType(*this, type,
                                       ClassFinalizer::kCanonicalize);
 }
 
@@ -1995,9 +1971,8 @@
   ASSERT(Object::class_class() != Class::null());
   Class& result = Class::Handle();
   {
-    RawObject* raw = Object::Allocate(Class::kClassId,
-                                      Class::InstanceSize(),
-                                      Heap::kOld);
+    RawObject* raw =
+        Object::Allocate(Class::kClassId, Class::InstanceSize(), Heap::kOld);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -2028,12 +2003,9 @@
 }
 
 
-
 static void ReportTooManyTypeArguments(const Class& cls) {
-  Report::MessageF(Report::kError,
-                   Script::Handle(cls.script()),
-                   cls.token_pos(),
-                   Report::AtLocation,
+  Report::MessageF(Report::kError, Script::Handle(cls.script()),
+                   cls.token_pos(), Report::AtLocation,
                    "too many type parameters declared in class '%s' or in its "
                    "super classes",
                    String::Handle(cls.Name()).ToCString());
@@ -2072,7 +2044,7 @@
 }
 
 
-RawArray* Class::OffsetToFieldMap() const {
+RawArray* Class::OffsetToFieldMap(bool original_classes) const {
   Array& array = Array::Handle(raw_ptr()->offset_in_words_to_field_);
   if (array.IsNull()) {
     ASSERT(is_finalized());
@@ -2089,7 +2061,7 @@
           array.SetAt(f.Offset() >> kWordSizeLog2, f);
         }
       }
-      cls = cls.SuperClass();
+      cls = cls.SuperClass(original_classes);
     }
     StorePointer(&raw_ptr()->offset_in_words_to_field_, array.raw());
   }
@@ -2123,6 +2095,7 @@
     }
   }
   intptr_t Hash() const { return name_.Hash(); }
+
  private:
   const String& name_;
   String* tmp_string_;
@@ -2147,9 +2120,7 @@
   static uword Hash(const Object& key) {
     return String::HashRawSymbol(Function::Cast(key).name());
   }
-  static uword Hash(const FunctionName& name) {
-    return name.Hash();
-  }
+  static uword Hash(const FunctionName& name) { return name.Hash(); }
 };
 typedef UnorderedHashSet<ClassFunctionsTraits> ClassFunctionsSet;
 
@@ -2269,7 +2240,6 @@
 }
 
 
-
 intptr_t Class::FindInvocationDispatcherFunctionIndex(
     const Function& needle) const {
   Thread* thread = Thread::Current();
@@ -2340,8 +2310,7 @@
   }
   if (type_parameters() == TypeArguments::null()) {
     const intptr_t cid = id();
-    if ((cid == kArrayCid) ||
-        (cid == kImmutableArrayCid) ||
+    if ((cid == kArrayCid) || (cid == kImmutableArrayCid) ||
         (cid == kGrowableObjectArrayCid)) {
       return 1;  // List's type parameter may not have been parsed yet.
     }
@@ -2363,8 +2332,7 @@
   Isolate* isolate = thread->isolate();
   Zone* zone = thread->zone();
   const intptr_t num_type_params = NumTypeParameters();
-  if (!FLAG_overlap_type_arguments ||
-      (num_type_params == 0) ||
+  if (!FLAG_overlap_type_arguments || (num_type_params == 0) ||
       (super_type() == AbstractType::null()) ||
       (super_type() == isolate->object_store()->object_type())) {
     set_num_own_type_arguments(num_type_params);
@@ -2402,14 +2370,14 @@
   TypeParameter& type_param = TypeParameter::Handle(zone);
   AbstractType& sup_type_arg = AbstractType::Handle(zone);
   for (intptr_t num_overlapping_type_args =
-           (num_type_params < num_sup_type_args) ?
-               num_type_params : num_sup_type_args;
+           (num_type_params < num_sup_type_args) ? num_type_params
+                                                 : num_sup_type_args;
        num_overlapping_type_args > 0; num_overlapping_type_args--) {
     intptr_t i = 0;
     for (; i < num_overlapping_type_args; i++) {
       type_param ^= type_params.TypeAt(i);
-      sup_type_arg = sup_type_args.TypeAt(
-          num_sup_type_args - num_overlapping_type_args + i);
+      sup_type_arg = sup_type_args.TypeAt(num_sup_type_args -
+                                          num_overlapping_type_args + i);
       // BoundedType can nest in case the finalized super type has bounded type
       // arguments that overlap multiple times in its own super class chain.
       while (sup_type_arg.IsBoundedType()) {
@@ -2466,18 +2434,25 @@
 }
 
 
-RawClass* Class::SuperClass() const {
+RawClass* Class::SuperClass(bool original_classes) const {
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
   if (super_type() == AbstractType::null()) {
     return Class::null();
   }
-  const AbstractType& sup_type = AbstractType::Handle(super_type());
-  return sup_type.type_class();
+  const AbstractType& sup_type = AbstractType::Handle(zone, super_type());
+  const intptr_t type_class_id = sup_type.type_class_id();
+  if (original_classes) {
+    return isolate->GetClassForHeapWalkAt(type_class_id);
+  } else {
+    return isolate->class_table()->At(type_class_id);
+  }
 }
 
 
 void Class::set_super_type(const AbstractType& value) const {
-  ASSERT(value.IsNull() ||
-         (value.IsType() && !value.IsDynamicType()) ||
+  ASSERT(value.IsNull() || (value.IsType() && !value.IsDynamicType()) ||
          value.IsMixinAppType());
   StorePointer(&raw_ptr()->super_type_, value.raw());
 }
@@ -2490,7 +2465,7 @@
   REUSABLE_TYPE_PARAMETER_HANDLESCOPE(thread);
   REUSABLE_STRING_HANDLESCOPE(thread);
   TypeArguments& type_params = thread->TypeArgumentsHandle();
-  TypeParameter&  type_param = thread->TypeParameterHandle();
+  TypeParameter& type_param = thread->TypeParameterHandle();
   String& type_param_name = thread->StringHandle();
 
   type_params ^= type_parameters();
@@ -2561,12 +2536,7 @@
                                             const Array& args_desc,
                                             RawFunction::Kind kind,
                                             bool create_if_absent) const {
-  enum {
-    kNameIndex = 0,
-    kArgsDescIndex,
-    kFunctionIndex,
-    kEntrySize
-  };
+  enum { kNameIndex = 0, kArgsDescIndex, kFunctionIndex, kEntrySize };
 
   ASSERT(kind == RawFunction::kNoSuchMethodDispatcher ||
          kind == RawFunction::kInvokeFieldDispatcher);
@@ -2594,8 +2564,8 @@
     if (i == cache.Length()) {
       // Allocate new larger cache.
       intptr_t new_len = (cache.Length() == 0)
-          ? static_cast<intptr_t>(kEntrySize)
-          : cache.Length() * 2;
+                             ? static_cast<intptr_t>(kEntrySize)
+                             : cache.Length() * 2;
       cache ^= Array::Grow(cache, new_len);
       set_invocation_dispatcher_cache(cache);
     }
@@ -2613,24 +2583,23 @@
                                                RawFunction::Kind kind) const {
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
-  Function& invocation = Function::Handle(zone,
-      Function::New(String::Handle(zone, Symbols::New(thread, target_name)),
-                    kind,
-                    false,  // Not static.
-                    false,  // Not const.
-                    false,  // Not abstract.
-                    false,  // Not external.
-                    false,  // Not native.
-                    *this,
-                    TokenPosition::kMinSource));
+  Function& invocation = Function::Handle(
+      zone, Function::New(
+                String::Handle(zone, Symbols::New(thread, target_name)), kind,
+                false,  // Not static.
+                false,  // Not const.
+                false,  // Not abstract.
+                false,  // Not external.
+                false,  // Not native.
+                *this, TokenPosition::kMinSource));
   ArgumentsDescriptor desc(args_desc);
   invocation.set_num_fixed_parameters(desc.PositionalCount());
   invocation.SetNumOptionalParameters(desc.NamedCount(),
                                       false);  // Not positional.
-  invocation.set_parameter_types(Array::Handle(zone, Array::New(desc.Count(),
-                                                                Heap::kOld)));
-  invocation.set_parameter_names(Array::Handle(zone, Array::New(desc.Count(),
-                                                                Heap::kOld)));
+  invocation.set_parameter_types(
+      Array::Handle(zone, Array::New(desc.Count(), Heap::kOld)));
+  invocation.set_parameter_names(
+      Array::Handle(zone, Array::New(desc.Count(), Heap::kOld)));
   // Receiver.
   invocation.SetParameterTypeAt(0, Object::dynamic_type());
   invocation.SetParameterNameAt(0, Symbols::This());
@@ -2640,8 +2609,8 @@
     invocation.SetParameterTypeAt(i, Object::dynamic_type());
     char name[64];
     OS::SNPrint(name, 64, ":p%" Pd, i);
-    invocation.SetParameterNameAt(i, String::Handle(zone,
-        Symbols::New(thread, name)));
+    invocation.SetParameterNameAt(
+        i, String::Handle(zone, Symbols::New(thread, name)));
   }
 
   // Named parameters.
@@ -2673,16 +2642,16 @@
       Function::Handle(zone, ImplicitClosureFunction());
 
   const Class& owner = Class::Handle(zone, closure_function.Owner());
-  Function& extractor = Function::Handle(zone,
-    Function::New(String::Handle(zone, Symbols::New(thread, getter_name)),
-                  RawFunction::kMethodExtractor,
-                  false,  // Not static.
-                  false,  // Not const.
-                  false,  // Not abstract.
-                  false,  // Not external.
-                  false,  // Not native.
-                  owner,
-                  TokenPosition::kMethodExtractor));
+  Function& extractor = Function::Handle(
+      zone,
+      Function::New(String::Handle(zone, Symbols::New(thread, getter_name)),
+                    RawFunction::kMethodExtractor,
+                    false,  // Not static.
+                    false,  // Not const.
+                    false,  // Not abstract.
+                    false,  // Not external.
+                    false,  // Not native.
+                    owner, TokenPosition::kMethodExtractor));
 
   // Initialize signature: receiver is a single fixed parameter.
   const intptr_t kNumParameters = 1;
@@ -2691,6 +2660,7 @@
   extractor.set_parameter_types(Object::extractor_parameter_types());
   extractor.set_parameter_names(Object::extractor_parameter_names());
   extractor.set_result_type(Object::dynamic_type());
+  extractor.set_kernel_function(kernel_function());
 
   extractor.set_extracted_method_closure(closure_function);
   extractor.set_is_debuggable(false);
@@ -2743,8 +2713,7 @@
 class CHACodeArray : public WeakCodeReferences {
  public:
   explicit CHACodeArray(const Class& cls)
-      : WeakCodeReferences(Array::Handle(cls.dependent_code())), cls_(cls) {
-  }
+      : WeakCodeReferences(Array::Handle(cls.dependent_code())), cls_(cls) {}
 
   virtual void UpdateArrayTo(const Array& value) {
     // TODO(fschneider): Fails for classes in the VM isolate.
@@ -2755,18 +2724,17 @@
     if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) {
       Function& function = Function::Handle(code.function());
       THR_Print("Deoptimizing %s because CHA optimized (%s).\n",
-          function.ToFullyQualifiedCString(),
-          cls_.ToCString());
+                function.ToFullyQualifiedCString(), cls_.ToCString());
     }
   }
 
   virtual void ReportSwitchingCode(const Code& code) {
     if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) {
       Function& function = Function::Handle(code.function());
-      THR_Print("Switching %s to unoptimized code because CHA invalid"
-                " (%s)\n",
-                function.ToFullyQualifiedCString(),
-                cls_.ToCString());
+      THR_Print(
+          "Switching %s to unoptimized code because CHA invalid"
+          " (%s)\n",
+          function.ToFullyQualifiedCString(), cls_.ToCString());
     }
   }
 
@@ -2787,7 +2755,8 @@
 void Class::RegisterCHACode(const Code& code) {
   if (FLAG_trace_cha) {
     THR_Print("RegisterCHACode '%s' depends on class '%s'\n",
-        Function::Handle(code.function()).ToQualifiedCString(), ToCString());
+              Function::Handle(code.function()).ToQualifiedCString(),
+              ToCString());
   }
   DEBUG_ASSERT(IsMutatorOrAtSafepoint());
   ASSERT(code.is_optimized());
@@ -2843,24 +2812,17 @@
   if (fields() != Object::empty_array().raw()) {
     *error = LanguageError::NewFormatted(
         *error,  // No previous error.
-        Script::Handle(script()),
-        token_pos(),
-        Report::AtLocation,
-        Report::kError,
-        Heap::kNew,
+        Script::Handle(script()), token_pos(), Report::AtLocation,
+        Report::kError, Heap::kNew,
         "new fields are not allowed for this patch");
     return false;
   }
   // There seem to be no functions, the patch is pointless.
   if (functions() == Object::empty_array().raw()) {
-    *error = LanguageError::NewFormatted(
-        *error,  // No previous error.
-        Script::Handle(script()),
-        token_pos(),
-        Report::AtLocation,
-        Report::kError,
-        Heap::kNew,
-        "no functions to patch");
+    *error = LanguageError::NewFormatted(*error,  // No previous error.
+                                         Script::Handle(script()), token_pos(),
+                                         Report::AtLocation, Report::kError,
+                                         Heap::kNew, "no functions to patch");
     return false;
   }
   // Iterate over all functions that will be patched and make sure
@@ -2882,14 +2844,11 @@
         // We can only patch external functions in a post finalized class.
         *error = LanguageError::NewFormatted(
             *error,  // No previous error.
-            Script::Handle(script()),
-            token_pos(),
-            Report::AtLocation,
-            Report::kError,
-            Heap::kNew,
-            !orig_func.is_external() ?
-            "'%s' is not external and therefore cannot be patched" :
-            "'%s' has already executed and therefore cannot be patched",
+            Script::Handle(script()), token_pos(), Report::AtLocation,
+            Report::kError, Heap::kNew,
+            !orig_func.is_external()
+                ? "'%s' is not external and therefore cannot be patched"
+                : "'%s' has already executed and therefore cannot be patched",
             name.ToCString());
         return false;
       }
@@ -2897,11 +2856,8 @@
       // We can only have new private functions that are added.
       *error = LanguageError::NewFormatted(
           *error,  // No previous error.
-          Script::Handle(script()),
-          token_pos(),
-          Report::AtLocation,
-          Report::kError,
-          Heap::kNew,
+          Script::Handle(script()), token_pos(), Report::AtLocation,
+          Report::kError, Heap::kNew,
           "'%s' is not private and therefore cannot be patched",
           name.ToCString());
       return false;
@@ -2944,8 +2900,8 @@
     // Not an implicit constructor, but a user declared one.
     orig_implicit_ctor = Function::null();
   }
-  const GrowableObjectArray& new_functions = GrowableObjectArray::Handle(
-      GrowableObjectArray::New(orig_len));
+  const GrowableObjectArray& new_functions =
+      GrowableObjectArray::Handle(GrowableObjectArray::New(orig_len));
   for (intptr_t i = 0; i < orig_len; i++) {
     orig_func ^= orig_list.At(i);
     member_name ^= orig_func.name();
@@ -2959,18 +2915,15 @@
         new_functions.Add(orig_func);
       }
     } else if (func.UserVisibleSignature() !=
-               orig_func.UserVisibleSignature()
-               && !FLAG_ignore_patch_signature_mismatch) {
+                   orig_func.UserVisibleSignature() &&
+               !FLAG_ignore_patch_signature_mismatch) {
       // Compare user visible signatures to ignore different implicit parameters
       // when patching a constructor with a factory.
       *error = LanguageError::NewFormatted(
           *error,  // No previous error.
-          Script::Handle(patch.script()),
-          func.token_pos(),
-          Report::AtLocation,
-          Report::kError,
-          Heap::kNew,
-          "signature mismatch: '%s'", member_name.ToCString());
+          Script::Handle(patch.script()), func.token_pos(), Report::AtLocation,
+          Report::kError, Heap::kNew, "signature mismatch: '%s'",
+          member_name.ToCString());
       return false;
     }
   }
@@ -3011,12 +2964,9 @@
     if (!orig_field.IsNull()) {
       *error = LanguageError::NewFormatted(
           *error,  // No previous error.
-          Script::Handle(patch.script()),
-          field.token_pos(),
-          Report::AtLocation,
-          Report::kError,
-          Heap::kNew,
-          "duplicate field: %s", member_name.ToCString());
+          Script::Handle(patch.script()), field.token_pos(), Report::AtLocation,
+          Report::kError, Heap::kNew, "duplicate field: %s",
+          member_name.ToCString());
       return false;
     }
     new_list.SetAt(i, field);
@@ -3058,16 +3008,15 @@
 }
 
 
-static RawFunction* EvaluateHelper(const Class& cls,
-                                   const String& expr,
-                                   const Array& param_names,
-                                   bool is_static) {
+RawFunction* Function::EvaluateHelper(const Class& cls,
+                                      const String& expr,
+                                      const Array& param_names,
+                                      bool is_static) {
   const String& func_src =
       String::Handle(BuildClosureSource(param_names, expr));
   Script& script = Script::Handle();
-  script = Script::New(Symbols::EvalSourceUri(),
-                       func_src,
-                       RawScript::kEvaluateTag);
+  script =
+      Script::New(Symbols::EvalSourceUri(), func_src, RawScript::kEvaluateTag);
   // In order to tokenize the source, we need to get the key to mangle
   // private names from the library from which the class originates.
   const Library& lib = Library::Handle(cls.library());
@@ -3075,8 +3024,8 @@
   const String& lib_key = String::Handle(lib.private_key());
   script.Tokenize(lib_key, false);
 
-  const Function& func = Function::Handle(
-       Function::NewEvalFunction(cls, script, is_static));
+  const Function& func =
+      Function::Handle(Function::NewEvalFunction(cls, script, is_static));
   func.set_result_type(Object::dynamic_type());
   const intptr_t num_implicit_params = is_static ? 0 : 1;
   func.set_num_fixed_parameters(num_implicit_params + param_names.Length());
@@ -3091,14 +3040,14 @@
                            const Array& param_values) const {
   ASSERT(Thread::Current()->IsMutatorThread());
   if (id() < kInstanceCid) {
-    const Instance& exception = Instance::Handle(String::New(
-        "Cannot evaluate against a VM internal class"));
+    const Instance& exception = Instance::Handle(
+        String::New("Cannot evaluate against a VM internal class"));
     const Instance& stacktrace = Instance::Handle();
     return UnhandledException::New(exception, stacktrace);
   }
 
-  const Function& eval_func =
-      Function::Handle(EvaluateHelper(*this, expr, param_names, true));
+  const Function& eval_func = Function::Handle(
+      Function::EvaluateHelper(*this, expr, param_names, true));
   const Object& result =
       Object::Handle(DartEntry::InvokeFunction(eval_func, param_values));
   return result.raw();
@@ -3113,12 +3062,12 @@
   }
   if (Compiler::IsBackgroundCompilation()) {
     Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId,
-        "Class finalization while compiling");
+                                         "Class finalization while compiling");
   }
   ASSERT(thread->IsMutatorThread());
   ASSERT(thread != NULL);
-  const Error& error = Error::Handle(
-      thread->zone(), Compiler::CompileClass(*this));
+  const Error& error =
+      Error::Handle(thread->zone(), Compiler::CompileClass(*this));
   if (!error.IsNull()) {
     ASSERT(thread == Thread::Current());
     if (thread->long_jump_base() != NULL) {
@@ -3174,9 +3123,8 @@
   ASSERT(Object::class_class() != Class::null());
   Class& result = Class::Handle();
   {
-    RawObject* raw = Object::Allocate(Class::kClassId,
-                                      Class::InstanceSize(),
-                                      Heap::kOld);
+    RawObject* raw =
+        Object::Allocate(Class::kClassId, Class::InstanceSize(), Heap::kOld);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -3243,6 +3191,7 @@
     cls.set_is_finalized();
     cls.set_is_type_finalized();
     cls.set_is_synthesized_class();
+    cls.set_is_cycle_free();
     library.AddClass(cls);
     return cls.raw();
   } else {
@@ -3306,7 +3255,7 @@
   ASSERT(raw_ptr()->name_ == String::null());
   ASSERT(value.IsSymbol());
   StorePointer(&raw_ptr()->name_, value.raw());
-NOT_IN_PRODUCT(
+#if !defined(PRODUCT)
   if (raw_ptr()->user_name_ == String::null()) {
     // TODO(johnmccutchan): Eagerly set user name for VM isolate classes,
     // lazily set user name for the other classes.
@@ -3314,15 +3263,15 @@
     const String& user_name = String::Handle(GenerateUserVisibleName());
     set_user_name(user_name);
   }
-)
+#endif  // !defined(PRODUCT)
 }
 
 
-NOT_IN_PRODUCT(
+#if !defined(PRODUCT)
 void Class::set_user_name(const String& value) const {
   StorePointer(&raw_ptr()->user_name_, value.raw());
 }
-)
+#endif  // !defined(PRODUCT)
 
 
 RawString* Class::GenerateUserVisibleName() const {
@@ -3376,7 +3325,8 @@
     case kTypedDataFloat64ArrayCid:
     case kExternalTypedDataFloat64ArrayCid:
       return Symbols::Float64List().raw();
-NOT_IN_PRODUCT(
+
+#if !defined(PRODUCT)
     case kNullCid:
       return Symbols::Null().raw();
     case kDynamicCid:
@@ -3463,7 +3413,7 @@
     case kImmutableArrayCid:
     case kGrowableObjectArrayCid:
       return Symbols::List().raw();
-)
+#endif  // !defined(PRODUCT)
   }
   const String& name = String::Handle(Name());
   return String::ScrubName(name);
@@ -3494,9 +3444,7 @@
     ASSERT(Dart::snapshot_kind() == Snapshot::kAppNoJIT);
     return TokenPosition::kNoSource;
   }
-  TokenStream::Iterator tkit(zone,
-                             tkns,
-                             token_pos(),
+  TokenStream::Iterator tkit(zone, tkns, token_pos(),
                              TokenStream::Iterator::kNoNewlines);
   intptr_t level = 0;
   while (tkit.CurrentTokenKind() != Token::kEOS) {
@@ -3577,8 +3525,8 @@
 
 void Class::set_is_finalized() const {
   ASSERT(!is_finalized());
-  set_state_bits(ClassFinalizedBits::update(RawClass::kFinalized,
-                                            raw_ptr()->state_bits_));
+  set_state_bits(
+      ClassFinalizedBits::update(RawClass::kFinalized, raw_ptr()->state_bits_));
 }
 
 
@@ -3592,8 +3540,8 @@
 
 void Class::ResetFinalization() const {
   ASSERT(IsTopLevel());
-  set_state_bits(ClassFinalizedBits::update(RawClass::kAllocated,
-                                            raw_ptr()->state_bits_));
+  set_state_bits(
+      ClassFinalizedBits::update(RawClass::kAllocated, raw_ptr()->state_bits_));
   set_state_bits(TypeFinalizedBit::update(false, raw_ptr()->state_bits_));
 }
 
@@ -3761,7 +3709,7 @@
     if (thsi.IsNullClass()) {
       // We already checked for other.IsDynamicClass() above.
       return (test_kind == Class::kIsMoreSpecificThan) ||
-      other.IsObjectClass() || other.IsNullClass();
+             other.IsObjectClass() || other.IsNullClass();
     }
     // Check for ObjectType. Any type that is not NullType or DynamicType
     // (already checked above), is more specific than ObjectType.
@@ -3790,18 +3738,14 @@
         // above.
         return test_kind == Class::kIsSubtypeOf;
       }
-      return type_arguments.TypeTest(test_kind,
-                                     other_type_arguments,
-                                     from_index,
-                                     num_type_params,
-                                     bound_error,
-                                     bound_trail,
-                                     space);
+      return type_arguments.TypeTest(test_kind, other_type_arguments,
+                                     from_index, num_type_params, bound_error,
+                                     bound_trail, space);
     }
     if (other.IsDartFunctionClass()) {
       // Check if type S has a call() method.
-      Function& function = Function::Handle(zone,
-          thsi.LookupDynamicFunctionAllowAbstract(Symbols::Call()));
+      Function& function = Function::Handle(
+          zone, thsi.LookupDynamicFunctionAllowAbstract(Symbols::Call()));
       if (function.IsNull()) {
         // Walk up the super_class chain.
         Class& cls = Class::Handle(zone, thsi.SuperClass());
@@ -3832,8 +3776,8 @@
           // runtime if this type test returns false at compile time.
           continue;
         }
-        ClassFinalizer::FinalizeType(
-            thsi, interface, ClassFinalizer::kCanonicalize);
+        ClassFinalizer::FinalizeType(thsi, interface,
+                                     ClassFinalizer::kCanonicalize);
         interfaces.SetAt(i, interface);
       }
       if (interface.IsMalbounded()) {
@@ -3855,12 +3799,8 @@
         // after the type arguments of the super type of this type.
         // The index of the type parameters is adjusted upon finalization.
         error = Error::null();
-        interface_args =
-            interface_args.InstantiateFrom(type_arguments,
-                                           &error,
-                                           NULL,
-                                           bound_trail,
-                                           space);
+        interface_args = interface_args.InstantiateFrom(
+            type_arguments, &error, NULL, bound_trail, space);
         if (!error.IsNull()) {
           // Return the first bound error to the caller if it requests it.
           if ((bound_error != NULL) && bound_error->IsNull()) {
@@ -3869,13 +3809,9 @@
           continue;  // Another interface may work better.
         }
       }
-      if (interface_class.TypeTest(test_kind,
-                                   interface_args,
-                                   other,
-                                   other_type_arguments,
-                                   bound_error,
-                                   bound_trail,
-                                   space)) {
+      if (interface_class.TypeTest(test_kind, interface_args, other,
+                                   other_type_arguments, bound_error,
+                                   bound_trail, space)) {
         return true;
       }
     }
@@ -3903,13 +3839,8 @@
                      Error* bound_error,
                      TrailPtr bound_trail,
                      Heap::Space space) const {
-  return TypeTestNonRecursive(*this,
-                              test_kind,
-                              type_arguments,
-                              other,
-                              other_type_arguments,
-                              bound_error,
-                              bound_trail,
+  return TypeTestNonRecursive(*this, test_kind, type_arguments, other,
+                              other_type_arguments, bound_error, bound_trail,
                               space);
 }
 
@@ -4046,8 +3977,8 @@
   Function& function = thread->FunctionHandle();
   if (len >= kFunctionLookupHashTreshold) {
     // Cache functions hash table to allow multi threaded access.
-    const Array& hash_table = Array::Handle(thread->zone(),
-                                            raw_ptr()->functions_hash_table_);
+    const Array& hash_table =
+        Array::Handle(thread->zone(), raw_ptr()->functions_hash_table_);
     if (!hash_table.IsNull()) {
       ClassFunctionsSet set(hash_table.raw());
       REUSABLE_STRING_HANDLESCOPE(thread);
@@ -4275,8 +4206,8 @@
   const char* library_name = lib.IsNull() ? "" : lib.ToCString();
   const char* patch_prefix = is_patch() ? "Patch " : "";
   const char* class_name = String::Handle(Name()).ToCString();
-  return OS::SCreate(Thread::Current()->zone(),
-      "%s %sClass: %s", library_name, patch_prefix, class_name);
+  return OS::SCreate(Thread::Current()->zone(), "%s %sClass: %s", library_name,
+                     patch_prefix, class_name);
 }
 
 
@@ -4284,8 +4215,9 @@
 // 'index' points to either:
 // - constants_list_ position of found element, or
 // - constants_list_ position where new canonical can be inserted.
-RawDouble* Class::LookupCanonicalDouble(
-    Zone* zone, double value, intptr_t* index) const {
+RawDouble* Class::LookupCanonicalDouble(Zone* zone,
+                                        double value,
+                                        intptr_t* index) const {
   ASSERT(this->raw() == Isolate::Current()->object_store()->double_class());
   const Array& constants = Array::Handle(zone, this->constants());
   const intptr_t constants_len = constants.Length();
@@ -4307,8 +4239,9 @@
 }
 
 
-RawMint* Class::LookupCanonicalMint(
-    Zone* zone, int64_t value, intptr_t* index) const {
+RawMint* Class::LookupCanonicalMint(Zone* zone,
+                                    int64_t value,
+                                    intptr_t* index) const {
   ASSERT(this->raw() == Isolate::Current()->object_store()->mint_class());
   const Array& constants = Array::Handle(zone, this->constants());
   const intptr_t constants_len = constants.Length();
@@ -4367,9 +4300,7 @@
     }
     return false;
   }
-  uword Hash() const {
-    return key_.ComputeCanonicalTableHash();
-  }
+  uword Hash() const { return key_.ComputeCanonicalTableHash(); }
   const Instance& key_;
 
  private:
@@ -4397,19 +4328,18 @@
     ASSERT(key.IsInstance());
     return Instance::Cast(key).ComputeCanonicalTableHash();
   }
-  static uword Hash(const CanonicalInstanceKey& key) {
-    return key.Hash();
-  }
+  static uword Hash(const CanonicalInstanceKey& key) { return key.Hash(); }
   static RawObject* NewKey(const CanonicalInstanceKey& obj) {
     return obj.key_.raw();
   }
 };
-typedef UnorderedHashSet <CanonicalInstanceTraits> CanonicalInstancesSet;
+typedef UnorderedHashSet<CanonicalInstanceTraits> CanonicalInstancesSet;
 
 
 RawInstance* Class::LookupCanonicalInstance(Zone* zone,
                                             const Instance& value) const {
   ASSERT(this->raw() == value.clazz());
+  ASSERT(is_finalized());
   Instance& canonical_value = Instance::Handle(zone);
   if (this->constants() != Object::empty_array().raw()) {
     CanonicalInstancesSet constants(zone, this->constants());
@@ -4478,11 +4408,11 @@
 }
 
 
-RawUnresolvedClass* UnresolvedClass::New(const LibraryPrefix& library_prefix,
+RawUnresolvedClass* UnresolvedClass::New(const Object& library_prefix,
                                          const String& ident,
                                          TokenPosition token_pos) {
   const UnresolvedClass& type = UnresolvedClass::Handle(UnresolvedClass::New());
-  type.set_library_prefix(library_prefix);
+  type.set_library_or_library_prefix(library_prefix);
   type.set_ident(ident);
   type.set_token_pos(token_pos);
   return type.raw();
@@ -4491,9 +4421,8 @@
 
 RawUnresolvedClass* UnresolvedClass::New() {
   ASSERT(Object::unresolved_class_class() != Class::null());
-  RawObject* raw = Object::Allocate(UnresolvedClass::kClassId,
-                                    UnresolvedClass::InstanceSize(),
-                                    Heap::kOld);
+  RawObject* raw = Object::Allocate(
+      UnresolvedClass::kClassId, UnresolvedClass::InstanceSize(), Heap::kOld);
   return reinterpret_cast<RawUnresolvedClass*>(raw);
 }
 
@@ -4509,19 +4438,24 @@
 }
 
 
-void UnresolvedClass::set_library_prefix(
-    const LibraryPrefix& library_prefix) const {
-  StorePointer(&raw_ptr()->library_prefix_, library_prefix.raw());
+void UnresolvedClass::set_library_or_library_prefix(
+    const Object& library_prefix) const {
+  StorePointer(&raw_ptr()->library_or_library_prefix_, library_prefix.raw());
 }
 
 
 RawString* UnresolvedClass::Name() const {
-  if (library_prefix() != LibraryPrefix::null()) {
+  if (library_or_library_prefix() != Object::null()) {
     Thread* thread = Thread::Current();
     Zone* zone = thread->zone();
-    const LibraryPrefix& lib_prefix = LibraryPrefix::Handle(zone,
-                                                            library_prefix());
-    const String& name = String::Handle(zone, lib_prefix.name());  // Qualifier.
+    const Object& lib_prefix =
+        Object::Handle(zone, library_or_library_prefix());
+    String& name = String::Handle(zone);  // Qualifier.
+    if (lib_prefix.IsLibraryPrefix()) {
+      name = LibraryPrefix::Cast(lib_prefix).name();
+    } else {
+      name = Library::Cast(lib_prefix).name();
+    }
     GrowableHandlePtrArray<const String> strs(zone, 3);
     strs.Add(name);
     strs.Add(Symbols::Dot());
@@ -4534,9 +4468,8 @@
 
 
 const char* UnresolvedClass::ToCString() const {
-  const char* cname =  String::Handle(Name()).ToCString();
-  return OS::SCreate(Thread::Current()->zone(),
-      "unresolved class '%s'", cname);
+  const char* cname = String::Handle(Name()).ToCString();
+  return OS::SCreate(Thread::Current()->zone(), "unresolved class '%s'", cname);
 }
 
 
@@ -4582,7 +4515,8 @@
   Zone* zone = thread->zone();
   ASSERT(from_index + len <= Length());
   String& name = String::Handle(zone);
-  const intptr_t num_strings = (len == 0) ? 2 : 2*len + 1;  // "<""T"", ""T"">".
+  const intptr_t num_strings =
+      (len == 0) ? 2 : 2 * len + 1;  // "<""T"", ""T"">".
   GrowableHandlePtrArray<const String> pieces(zone, num_strings);
   pieces.Add(Symbols::LAngleBracket());
   AbstractType& type = AbstractType::Handle(zone);
@@ -4687,10 +4621,7 @@
     ASSERT(!type.IsNull());
     other_type = other.TypeAt(from_index + i);
     ASSERT(!other_type.IsNull());
-    if (!type.TypeTest(test_kind,
-                       other_type,
-                       bound_error,
-                       bound_trail,
+    if (!type.TypeTest(test_kind, other_type, bound_error, bound_trail,
                        space)) {
       return false;
     }
@@ -4713,7 +4644,7 @@
   while (prior_instantiations.At(i) != Smi::New(StubCode::kNoInstantiator)) {
     i += 2;
   }
-  return i/2;
+  return i / 2;
 }
 
 
@@ -4739,8 +4670,7 @@
 }
 
 
-void TypeArguments::SetTypeAt(intptr_t index,
-                                const AbstractType& value) const {
+void TypeArguments::SetTypeAt(intptr_t index, const AbstractType& value) const {
   ASSERT(!IsCanonical());
   StorePointer(TypeAddr(index), value.raw());
 }
@@ -4810,7 +4740,7 @@
 // Return true if this uninstantiated type argument vector, once instantiated
 // at runtime, is a prefix of the type argument vector of its instantiator.
 bool TypeArguments::CanShareInstantiatorTypeArguments(
-      const Class& instantiator_class) const {
+    const Class& instantiator_class) const {
   ASSERT(!IsInstantiated());
   const intptr_t num_type_args = Length();
   const intptr_t num_instantiator_type_args =
@@ -4856,16 +4786,16 @@
   if (first_type_param_offset == 0) {
     return true;
   }
-  AbstractType& super_type = AbstractType::Handle(
-      instantiator_class.super_type());
-  const TypeArguments& super_type_args = TypeArguments::Handle(
-      super_type.arguments());
+  AbstractType& super_type =
+      AbstractType::Handle(instantiator_class.super_type());
+  const TypeArguments& super_type_args =
+      TypeArguments::Handle(super_type.arguments());
   if (super_type_args.IsNull()) {
     return false;
   }
   AbstractType& super_type_arg = AbstractType::Handle();
-  for (intptr_t i = 0;
-       (i < first_type_param_offset) && (i < num_type_args); i++) {
+  for (intptr_t i = 0; (i < first_type_param_offset) && (i < num_type_args);
+       i++) {
     type_arg = TypeAt(i);
     super_type_arg = super_type_args.TypeAt(i);
     if (!type_arg.Equals(super_type_arg)) {
@@ -4899,15 +4829,15 @@
       return true;
     }
     if (type.IsTypeParameter()) {
-      const AbstractType& bound = AbstractType::Handle(
-          TypeParameter::Cast(type).bound());
+      const AbstractType& bound =
+          AbstractType::Handle(TypeParameter::Cast(type).bound());
       if (!bound.IsObjectType() && !bound.IsDynamicType()) {
         return true;
       }
       continue;
     }
-    const TypeArguments& type_args = TypeArguments::Handle(
-        Type::Cast(type).arguments());
+    const TypeArguments& type_args =
+        TypeArguments::Handle(Type::Cast(type).arguments());
     if (!type_args.IsNull() && type_args.IsBounded()) {
       return true;
     }
@@ -4923,8 +4853,7 @@
     TrailPtr bound_trail,
     Heap::Space space) const {
   ASSERT(!IsInstantiated());
-  if (!instantiator_type_arguments.IsNull() &&
-      IsUninstantiatedIdentity() &&
+  if (!instantiator_type_arguments.IsNull() && IsUninstantiatedIdentity() &&
       (instantiator_type_arguments.Length() == Length())) {
     return instantiator_type_arguments.raw();
   }
@@ -4941,11 +4870,8 @@
     // solely on the type parameters of A and will be replaced by a non-null
     // type before A is marked as finalized.
     if (!type.IsNull() && !type.IsInstantiated()) {
-      type = type.InstantiateFrom(instantiator_type_arguments,
-                                  bound_error,
-                                  instantiation_trail,
-                                  bound_trail,
-                                  space);
+      type = type.InstantiateFrom(instantiator_type_arguments, bound_error,
+                                  instantiation_trail, bound_trail, space);
     }
     instantiated_array.SetTypeAt(i, type);
   }
@@ -4977,8 +4903,8 @@
   }
   // Cache lookup failed. Instantiate the type arguments.
   TypeArguments& result = TypeArguments::Handle();
-  result = InstantiateFrom(
-      instantiator_type_arguments, bound_error, NULL, NULL, Heap::kOld);
+  result = InstantiateFrom(instantiator_type_arguments, bound_error, NULL, NULL,
+                           Heap::kOld);
   if ((bound_error != NULL) && !bound_error->IsNull()) {
     return result.raw();
   }
@@ -4992,9 +4918,8 @@
   if ((index + 2) >= length) {
     // Grow the instantiations array.
     // The initial array is Object::zero_array() of length 1.
-    length = (length > 64) ?
-        (length + 64) :
-        ((length == 1) ? 3 : ((length - 1) * 2 + 1));
+    length = (length > 64) ? (length + 64)
+                           : ((length == 1) ? 3 : ((length - 1) * 2 + 1));
     prior_instantiations =
         Array::Grow(prior_instantiations, length, Heap::kOld);
     set_instantiations(prior_instantiations);
@@ -5016,8 +4941,7 @@
   TypeArguments& result = TypeArguments::Handle();
   {
     RawObject* raw = Object::Allocate(TypeArguments::kClassId,
-                                      TypeArguments::InstanceSize(len),
-                                      space);
+                                      TypeArguments::InstanceSize(len), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
     // Length must be set before we start storing into the array.
@@ -5032,7 +4956,6 @@
 }
 
 
-
 RawAbstractType* const* TypeArguments::TypeAddr(intptr_t index) const {
   // TODO(iposva): Determine if we should throw an exception here.
   ASSERT((index >= 0) && (index < Length()));
@@ -5055,8 +4978,8 @@
   ASSERT(IsResolved());
   AbstractType& type = AbstractType::Handle();
   const intptr_t num_types = Length();
-  const TypeArguments& clone = TypeArguments::Handle(
-      TypeArguments::New(num_types));
+  const TypeArguments& clone =
+      TypeArguments::Handle(TypeArguments::New(num_types));
   for (intptr_t i = 0; i < num_types; i++) {
     type = TypeAt(i);
     type = type.CloneUnfinalized();
@@ -5067,16 +4990,15 @@
 }
 
 
-RawTypeArguments* TypeArguments::CloneUninstantiated(
-    const Class& new_owner,
-    TrailPtr trail) const {
+RawTypeArguments* TypeArguments::CloneUninstantiated(const Class& new_owner,
+                                                     TrailPtr trail) const {
   ASSERT(!IsNull());
   ASSERT(IsFinalized());
   ASSERT(!IsInstantiated());
   AbstractType& type = AbstractType::Handle();
   const intptr_t num_types = Length();
-  const TypeArguments& clone = TypeArguments::Handle(
-      TypeArguments::New(num_types));
+  const TypeArguments& clone =
+      TypeArguments::Handle(TypeArguments::New(num_types));
   for (intptr_t i = 0; i < num_types; i++) {
     type = TypeAt(i);
     if (!type.IsInstantiated()) {
@@ -5129,8 +5051,8 @@
       ComputeHash();
     }
     SafepointMutexLocker ml(isolate->type_canonicalization_mutex());
-    CanonicalTypeArgumentsSet table(
-        zone, object_store->canonical_type_arguments());
+    CanonicalTypeArgumentsSet table(zone,
+                                    object_store->canonical_type_arguments());
     // Since we canonicalized some type arguments above we need to lookup
     // in the table again to make sure we don't already have an equivalent
     // canonical entry.
@@ -5180,8 +5102,8 @@
     return "NULL TypeArguments";
   }
   Zone* zone = Thread::Current()->zone();
-  const char* prev_cstr = OS::SCreate(
-      zone, "TypeArguments: (%" Pd ")", Smi::Value(raw_ptr()->hash_));
+  const char* prev_cstr = OS::SCreate(zone, "TypeArguments: (%" Pd ")",
+                                      Smi::Value(raw_ptr()->hash_));
   for (int i = 0; i < Length(); i++) {
     const AbstractType& type_at = AbstractType::Handle(zone, TypeAt(i));
     const char* type_cstr = type_at.IsNull() ? "null" : type_at.ToCString();
@@ -5195,8 +5117,7 @@
 const char* PatchClass::ToCString() const {
   const Class& cls = Class::Handle(patched_class());
   const char* cls_name = cls.ToCString();
-  return OS::SCreate(Thread::Current()->zone(),
-      "PatchClass for %s", cls_name);
+  return OS::SCreate(Thread::Current()->zone(), "PatchClass for %s", cls_name);
 }
 
 
@@ -5223,8 +5144,7 @@
 RawPatchClass* PatchClass::New() {
   ASSERT(Object::patch_class_class() != Class::null());
   RawObject* raw = Object::Allocate(PatchClass::kClassId,
-                                    PatchClass::InstanceSize(),
-                                    Heap::kOld);
+                                    PatchClass::InstanceSize(), Heap::kOld);
   return reinterpret_cast<RawPatchClass*>(raw);
 }
 
@@ -5286,7 +5206,7 @@
   value.set_owner(*this);
   SetInstructions(value);
   ASSERT(Function::Handle(value.function()).IsNull() ||
-      (value.function() == this->raw()));
+         (value.function() == this->raw()));
 }
 
 
@@ -5312,8 +5232,8 @@
   Zone* zone = thread->zone();
   ASSERT(thread->IsMutatorThread());
 
-  const Error& error = Error::Handle(zone,
-      Compiler::EnsureUnoptimizedCode(thread, *this));
+  const Error& error =
+      Error::Handle(zone, Compiler::EnsureUnoptimizedCode(thread, *this));
   if (!error.IsNull()) {
     Exceptions::PropagateError(error);
   }
@@ -5330,12 +5250,11 @@
 
   if (FLAG_trace_deoptimization_verbose) {
     THR_Print("Disabling optimized code: '%s' entry: %#" Px "\n",
-      ToFullyQualifiedCString(),
-      current_code.UncheckedEntryPoint());
+              ToFullyQualifiedCString(), current_code.UncheckedEntryPoint());
   }
   current_code.DisableDartCode();
-  const Error& error = Error::Handle(zone,
-      Compiler::EnsureUnoptimizedCode(thread, *this));
+  const Error& error =
+      Error::Handle(zone, Compiler::EnsureUnoptimizedCode(thread, *this));
   if (!error.IsNull()) {
     Exceptions::PropagateError(error);
   }
@@ -5495,7 +5414,6 @@
 }
 
 
-
 RawFunction* Function::parent_function() const {
   if (IsClosureFunction()) {
     const Object& obj = Object::Handle(raw_ptr()->data_);
@@ -5527,9 +5445,7 @@
 
 
 RawFunction* Function::implicit_closure_function() const {
-  if (IsClosureFunction() ||
-      IsSignatureFunction() ||
-      IsFactory()) {
+  if (IsClosureFunction() || IsSignatureFunction() || IsFactory()) {
     return Function::null();
   }
   const Object& obj = Object::Handle(raw_ptr()->data_);
@@ -5590,8 +5506,7 @@
     // to _Closure class as well as the owner of the signature function.
     Class& scope_class = Class::Handle(Owner());
     if (!scope_class.IsTypedefClass() &&
-        (is_static() ||
-         !scope_class.IsGeneric() ||
+        (is_static() || !scope_class.IsGeneric() ||
          HasInstantiatedSignature())) {
       scope_class = Isolate::Current()->object_store()->closure_class();
       if (IsSignatureFunction()) {
@@ -5786,21 +5701,36 @@
 }
 
 
+class StickySpecialization : public BitField<intptr_t, bool, 0, 1> {};
+class StringSpecializationCid
+    : public BitField<intptr_t, intptr_t, 1, RawObject::kClassIdTagSize> {};
+
+
 intptr_t Function::string_specialization_cid() const {
   ASSERT(kind() == RawFunction::kIrregexpFunction);
   const Array& pair = Array::Cast(Object::Handle(raw_ptr()->data_));
-  return Smi::Value(Smi::RawCast(pair.At(1)));
+  return StringSpecializationCid::decode(Smi::Value(Smi::RawCast(pair.At(1))));
+}
+
+
+bool Function::is_sticky_specialization() const {
+  ASSERT(kind() == RawFunction::kIrregexpFunction);
+  const Array& pair = Array::Cast(Object::Handle(raw_ptr()->data_));
+  return StickySpecialization::decode(Smi::Value(Smi::RawCast(pair.At(1))));
 }
 
 
 void Function::SetRegExpData(const RegExp& regexp,
-                             intptr_t string_specialization_cid) const {
+                             intptr_t string_specialization_cid,
+                             bool sticky) const {
   ASSERT(kind() == RawFunction::kIrregexpFunction);
   ASSERT(RawObject::IsStringClassId(string_specialization_cid));
   ASSERT(raw_ptr()->data_ == Object::null());
   const Array& pair = Array::Handle(Array::New(2, Heap::kOld));
   pair.SetAt(0, regexp);
-  pair.SetAt(1, Smi::Handle(Smi::New(string_specialization_cid)));
+  pair.SetAt(1, Smi::Handle(Smi::New(StickySpecialization::encode(sticky) |
+                                     StringSpecializationCid::encode(
+                                         string_specialization_cid))));
   set_data(pair);
 }
 
@@ -5835,8 +5765,8 @@
 }
 
 
-void Function::SetParameterTypeAt(
-    intptr_t index, const AbstractType& value) const {
+void Function::SetParameterTypeAt(intptr_t index,
+                                  const AbstractType& value) const {
   ASSERT(!value.IsNull());
   // Method extractor parameters are shared and are in the VM heap.
   ASSERT(kind() != RawFunction::kMethodExtractor);
@@ -5885,7 +5815,8 @@
 
 
 RawTypeParameter* Function::LookupTypeParameter(
-    const String& type_name, intptr_t* function_level) const {
+    const String& type_name,
+    intptr_t* function_level) const {
   ASSERT(!type_name.IsNull());
   Thread* thread = Thread::Current();
   REUSABLE_TYPE_ARGUMENTS_HANDLESCOPE(thread);
@@ -5893,7 +5824,7 @@
   REUSABLE_STRING_HANDLESCOPE(thread);
   REUSABLE_FUNCTION_HANDLESCOPE(thread);
   TypeArguments& type_params = thread->TypeArgumentsHandle();
-  TypeParameter&  type_param = thread->TypeParameterHandle();
+  TypeParameter& type_param = thread->TypeParameterHandle();
   String& type_param_name = thread->StringHandle();
   Function& function = thread->FunctionHandle();
 
@@ -5975,9 +5906,9 @@
 void Function::SetNumOptionalParameters(intptr_t num_optional_parameters,
                                         bool are_optional_positional) const {
   ASSERT(num_optional_parameters >= 0);
-  set_num_optional_parameters(are_optional_positional ?
-                              num_optional_parameters :
-                              -num_optional_parameters);
+  set_num_optional_parameters(are_optional_positional
+                                  ? num_optional_parameters
+                                  : -num_optional_parameters);
 }
 
 
@@ -5994,7 +5925,7 @@
       (function_length < FLAG_huge_method_cutoff_in_tokens)) {
     // Additional check needed for implicit getters.
     return (unoptimized_code() == Object::null()) ||
-        (Code::Handle(unoptimized_code()).Size() <
+           (Code::Handle(unoptimized_code()).Size() <
             FLAG_huge_method_cutoff_in_code_size);
   }
   return false;
@@ -6024,9 +5955,7 @@
 
 bool Function::CanBeInlined() const {
   Thread* thread = Thread::Current();
-  return is_inlinable() &&
-         !is_external() &&
-         !is_generated_body() &&
+  return is_inlinable() && !is_external() && !is_generated_body() &&
          (!FLAG_support_debugger ||
           !thread->isolate()->debugger()->HasBreakpoint(*this, thread->zone()));
 }
@@ -6065,11 +5994,9 @@
     if (error_message != NULL) {
       const intptr_t kMessageBufferSize = 64;
       char message_buffer[kMessageBufferSize];
-      OS::SNPrint(message_buffer,
-                  kMessageBufferSize,
+      OS::SNPrint(message_buffer, kMessageBufferSize,
                   "%" Pd " named passed, at most %" Pd " expected",
-                  num_named_arguments,
-                  NumOptionalNamedParameters());
+                  num_named_arguments, NumOptionalNamedParameters());
       // Allocate in old space because it can be invoked in background
       // optimizing compilation.
       *error_message = String::New(message_buffer, Heap::kOld);
@@ -6085,8 +6012,7 @@
       char message_buffer[kMessageBufferSize];
       // Hide implicit parameters to the user.
       const intptr_t num_hidden_params = NumImplicitParameters();
-      OS::SNPrint(message_buffer,
-                  kMessageBufferSize,
+      OS::SNPrint(message_buffer, kMessageBufferSize,
                   "%" Pd "%s passed, %s%" Pd " expected",
                   num_pos_args - num_hidden_params,
                   num_opt_pos_params > 0 ? " positional" : "",
@@ -6104,8 +6030,7 @@
       char message_buffer[kMessageBufferSize];
       // Hide implicit parameters to the user.
       const intptr_t num_hidden_params = NumImplicitParameters();
-      OS::SNPrint(message_buffer,
-                  kMessageBufferSize,
+      OS::SNPrint(message_buffer, kMessageBufferSize,
                   "%" Pd "%s passed, %s%" Pd " expected",
                   num_pos_args - num_hidden_params,
                   num_opt_pos_params > 0 ? " positional" : "",
@@ -6126,8 +6051,7 @@
                                  String* error_message) const {
   const intptr_t num_named_arguments =
       argument_names.IsNull() ? 0 : argument_names.Length();
-  if (!AreValidArgumentCounts(num_arguments,
-                              num_named_arguments,
+  if (!AreValidArgumentCounts(num_arguments, num_named_arguments,
                               error_message)) {
     return false;
   }
@@ -6141,8 +6065,7 @@
     bool found = false;
     const intptr_t num_positional_args = num_arguments - num_named_arguments;
     const intptr_t num_parameters = NumParameters();
-    for (intptr_t j = num_positional_args;
-         !found && (j < num_parameters);
+    for (intptr_t j = num_positional_args; !found && (j < num_parameters);
          j++) {
       parameter_name = ParameterNameAt(j);
       ASSERT(argument_name.IsSymbol());
@@ -6154,8 +6077,7 @@
       if (error_message != NULL) {
         const intptr_t kMessageBufferSize = 64;
         char message_buffer[kMessageBufferSize];
-        OS::SNPrint(message_buffer,
-                    kMessageBufferSize,
+        OS::SNPrint(message_buffer, kMessageBufferSize,
                     "no optional formal parameter named '%s'",
                     argument_name.ToCString());
         // Allocate in old space because it can be invoked in background
@@ -6174,8 +6096,7 @@
   const intptr_t num_arguments = args_desc.Count();
   const intptr_t num_named_arguments = args_desc.NamedCount();
 
-  if (!AreValidArgumentCounts(num_arguments,
-                              num_named_arguments,
+  if (!AreValidArgumentCounts(num_arguments, num_named_arguments,
                               error_message)) {
     return false;
   }
@@ -6189,8 +6110,7 @@
     bool found = false;
     const intptr_t num_positional_args = num_arguments - num_named_arguments;
     const int num_parameters = NumParameters();
-    for (intptr_t j = num_positional_args;
-         !found && (j < num_parameters);
+    for (intptr_t j = num_positional_args; !found && (j < num_parameters);
          j++) {
       parameter_name = ParameterNameAt(j);
       ASSERT(argument_name.IsSymbol());
@@ -6202,8 +6122,7 @@
       if (error_message != NULL) {
         const intptr_t kMessageBufferSize = 64;
         char message_buffer[kMessageBufferSize];
-        OS::SNPrint(message_buffer,
-                    kMessageBufferSize,
+        OS::SNPrint(message_buffer, kMessageBufferSize,
                     "no optional formal parameter named '%s'",
                     argument_name.ToCString());
         // Allocate in old space because it can be invoked in background
@@ -6269,14 +6188,11 @@
         OS::SNPrint(NULL, 0, lib_class_format, library_name, class_name);
     ASSERT(chars != NULL);
     *chars = Thread::Current()->zone()->Alloc<char>(reserve_len + 1);
-    written = OS::SNPrint(
-        *chars, reserve_len + 1, lib_class_format, library_name, class_name);
+    written = OS::SNPrint(*chars, reserve_len + 1, lib_class_format,
+                          library_name, class_name);
   } else {
-    written = ConstructFunctionFullyQualifiedCString(parent,
-                                                     chars,
-                                                     reserve_len,
-                                                     with_lib,
-                                                     lib_kind);
+    written = ConstructFunctionFullyQualifiedCString(parent, chars, reserve_len,
+                                                     with_lib, lib_kind);
   }
   ASSERT(*chars != NULL);
   char* next = *chars + written;
@@ -6321,28 +6237,24 @@
   ASSERT((bound_error != NULL) && bound_error->IsNull());
   // Check that this function's signature type is a subtype of the other
   // function's signature type.
-  if (!TypeTest(kIsSubtypeOf, Object::null_type_arguments(),
-                other, Object::null_type_arguments(), bound_error,
-                Heap::kOld)) {
+  if (!TypeTest(kIsSubtypeOf, Object::null_type_arguments(), other,
+                Object::null_type_arguments(), bound_error, Heap::kOld)) {
     // For more informative error reporting, use the location of the other
     // function here, since the caller will use the location of this function.
     *bound_error = LanguageError::NewFormatted(
         *bound_error,  // A bound error if non null.
-        Script::Handle(other.script()),
-        other.token_pos(),
-        Report::AtLocation,
-        Report::kError,
-        Heap::kNew,
+        Script::Handle(other.script()), other.token_pos(), Report::AtLocation,
+        Report::kError, Heap::kNew,
         "signature type '%s' of function '%s' is not a subtype of signature "
         "type '%s' of function '%s' where\n%s%s",
         String::Handle(UserVisibleSignature()).ToCString(),
         String::Handle(UserVisibleName()).ToCString(),
         String::Handle(other.UserVisibleSignature()).ToCString(),
         String::Handle(other.UserVisibleName()).ToCString(),
-        String::Handle(Type::Handle(
-            SignatureType()).EnumerateURIs()).ToCString(),
-        String::Handle(Type::Handle(
-            other.SignatureType()).EnumerateURIs()).ToCString());
+        String::Handle(Type::Handle(SignatureType()).EnumerateURIs())
+            .ToCString(),
+        String::Handle(Type::Handle(other.SignatureType()).EnumerateURIs())
+            .ToCString());
     return false;
   }
   // We should also check that if the other function explicitly specifies a
@@ -6363,21 +6275,19 @@
 // parameter of the other function.
 // Note that we do not apply contravariance of parameter types, but covariance
 // of both parameter types and result type.
-bool Function::TestParameterType(
-    TypeTestKind test_kind,
-    intptr_t parameter_position,
-    intptr_t other_parameter_position,
-    const TypeArguments& type_arguments,
-    const Function& other,
-    const TypeArguments& other_type_arguments,
-    Error* bound_error,
-    Heap::Space space) const {
+bool Function::TestParameterType(TypeTestKind test_kind,
+                                 intptr_t parameter_position,
+                                 intptr_t other_parameter_position,
+                                 const TypeArguments& type_arguments,
+                                 const Function& other,
+                                 const TypeArguments& other_type_arguments,
+                                 Error* bound_error,
+                                 Heap::Space space) const {
   AbstractType& other_param_type =
       AbstractType::Handle(other.ParameterTypeAt(other_parameter_position));
   if (!other_param_type.IsInstantiated()) {
     other_param_type =
-        other_param_type.InstantiateFrom(other_type_arguments,
-                                         bound_error,
+        other_param_type.InstantiateFrom(other_type_arguments, bound_error,
                                          NULL,  // instantiation_trail
                                          NULL,  // bound_trail
                                          space);
@@ -6389,8 +6299,7 @@
   AbstractType& param_type =
       AbstractType::Handle(ParameterTypeAt(parameter_position));
   if (!param_type.IsInstantiated()) {
-    param_type = param_type.InstantiateFrom(type_arguments,
-                                            bound_error,
+    param_type = param_type.InstantiateFrom(type_arguments, bound_error,
                                             NULL,  // instantiation_trail
                                             NULL,  // bound_trail
                                             space);
@@ -6406,8 +6315,8 @@
     }
   } else {
     ASSERT(test_kind == kIsMoreSpecificThan);
-    if (!param_type.IsMoreSpecificThan(
-            other_param_type, bound_error, NULL, space)) {
+    if (!param_type.IsMoreSpecificThan(other_param_type, bound_error, NULL,
+                                       space)) {
       return false;
     }
   }
@@ -6444,16 +6353,15 @@
   // Check the result type.
   AbstractType& other_res_type = AbstractType::Handle(other.result_type());
   if (!other_res_type.IsInstantiated()) {
-    other_res_type = other_res_type.InstantiateFrom(other_type_arguments,
-                                                    bound_error,
-                                                    NULL, NULL, space);
+    other_res_type = other_res_type.InstantiateFrom(
+        other_type_arguments, bound_error, NULL, NULL, space);
     ASSERT((bound_error == NULL) || bound_error->IsNull());
   }
   if (!other_res_type.IsDynamicType() && !other_res_type.IsVoidType()) {
     AbstractType& res_type = AbstractType::Handle(result_type());
     if (!res_type.IsInstantiated()) {
-      res_type = res_type.InstantiateFrom(type_arguments, bound_error,
-                                          NULL, NULL, space);
+      res_type = res_type.InstantiateFrom(type_arguments, bound_error, NULL,
+                                          NULL, space);
       ASSERT((bound_error == NULL) || bound_error->IsNull());
     }
     if (res_type.IsVoidType()) {
@@ -6466,20 +6374,19 @@
       }
     } else {
       ASSERT(test_kind == kIsMoreSpecificThan);
-      if (!res_type.IsMoreSpecificThan(other_res_type, bound_error,
-                                       NULL, space)) {
+      if (!res_type.IsMoreSpecificThan(other_res_type, bound_error, NULL,
+                                       space)) {
         return false;
       }
     }
   }
   // Check the types of fixed and optional positional parameters.
   for (intptr_t i = 0; i < (other_num_fixed_params - other_num_ignored_params +
-                            other_num_opt_pos_params); i++) {
-    if (!TestParameterType(test_kind,
-                           i + num_ignored_params, i + other_num_ignored_params,
-                           type_arguments, other, other_type_arguments,
-                           bound_error,
-                           space)) {
+                            other_num_opt_pos_params);
+       i++) {
+    if (!TestParameterType(test_kind, i + num_ignored_params,
+                           i + other_num_ignored_params, type_arguments, other,
+                           other_type_arguments, bound_error, space)) {
       return false;
     }
   }
@@ -6507,11 +6414,8 @@
       ASSERT(String::Handle(ParameterNameAt(j)).IsSymbol());
       if (ParameterNameAt(j) == other_param_name.raw()) {
         found_param_name = true;
-        if (!TestParameterType(test_kind,
-                               j, i,
-                               type_arguments, other, other_type_arguments,
-                               bound_error,
-                               space)) {
+        if (!TestParameterType(test_kind, j, i, type_arguments, other,
+                               other_type_arguments, bound_error, space)) {
           return false;
         }
         break;
@@ -6559,15 +6463,14 @@
 
 bool Function::IsConstructorClosureFunction() const {
   return IsClosureFunction() &&
-      String::Handle(name()).StartsWith(Symbols::ConstructorClosurePrefix());
+         String::Handle(name()).StartsWith(Symbols::ConstructorClosurePrefix());
 }
 
 
 RawFunction* Function::New() {
   ASSERT(Object::function_class() != Class::null());
   RawObject* raw = Object::Allocate(Function::kClassId,
-                                    Function::InstanceSize(),
-                                    Heap::kOld);
+                                    Function::InstanceSize(), Heap::kOld);
   return reinterpret_cast<RawFunction*>(raw);
 }
 
@@ -6595,8 +6498,8 @@
   result.set_is_external(is_external);
   result.set_is_native(is_native);
   result.set_is_reflectable(true);  // Will be computed later.
-  result.set_is_visible(true);  // Will be computed later.
-  result.set_is_debuggable(true);  // Will be computed later.
+  result.set_is_visible(true);      // Will be computed later.
+  result.set_is_debuggable(true);   // Will be computed later.
   result.set_is_intrinsic(false);
   result.set_is_redirecting(false);
   result.set_is_generated_body(false);
@@ -6612,6 +6515,7 @@
   NOT_IN_PRECOMPILED(result.set_deoptimization_counter(0));
   NOT_IN_PRECOMPILED(result.set_optimized_instruction_count(0));
   NOT_IN_PRECOMPILED(result.set_optimized_call_site_count(0));
+  result.set_kernel_function(NULL);
   result.set_is_optimizable(is_native ? false : true);
   result.set_is_inlinable(true);
   result.set_allows_hoisting_check_class(true);
@@ -6640,6 +6544,7 @@
   clone.set_deoptimization_counter(0);
   clone.set_optimized_instruction_count(0);
   clone.set_optimized_call_site_count(0);
+  clone.set_kernel_function(kernel_function());
   if (new_owner.NumTypeParameters() > 0) {
     // Adjust uninstantiated types to refer to type parameters of the new owner.
     AbstractType& type = AbstractType::Handle(clone.result_type());
@@ -6667,15 +6572,12 @@
   const Object& parent_owner = Object::Handle(parent.raw_ptr()->owner_);
   ASSERT(!parent_owner.IsNull());
   const Function& result = Function::Handle(
-      Function::New(name,
-                    RawFunction::kClosureFunction,
+      Function::New(name, RawFunction::kClosureFunction,
                     /* is_static = */ parent.is_static(),
                     /* is_const = */ false,
                     /* is_abstract = */ false,
                     /* is_external = */ false,
-                    /* is_native = */ false,
-                    parent_owner,
-                    token_pos));
+                    /* is_native = */ false, parent_owner, token_pos));
   result.set_parent_function(parent);
   return result.raw();
 }
@@ -6684,8 +6586,7 @@
 RawFunction* Function::NewSignatureFunction(const Class& owner,
                                             TokenPosition token_pos) {
   const Function& result = Function::Handle(Function::New(
-      Symbols::AnonymousSignature(),
-      RawFunction::kSignatureFunction,
+      Symbols::AnonymousSignature(), RawFunction::kSignatureFunction,
       /* is_static = */ false,
       /* is_const = */ false,
       /* is_abstract = */ false,
@@ -6705,16 +6606,14 @@
                                        bool is_static) {
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
-  const Function& result = Function::Handle(zone,
+  const Function& result = Function::Handle(
+      zone,
       Function::New(String::Handle(Symbols::New(thread, ":Eval")),
-                    RawFunction::kRegularFunction,
-                    is_static,
+                    RawFunction::kRegularFunction, is_static,
                     /* is_const = */ false,
                     /* is_abstract = */ false,
                     /* is_external = */ false,
-                    /* is_native = */ false,
-                    owner,
-                    TokenPosition::kMinSource));
+                    /* is_native = */ false, owner, TokenPosition::kMinSource));
   ASSERT(!script.IsNull());
   result.set_is_debuggable(false);
   result.set_is_visible(true);
@@ -6730,8 +6629,8 @@
   ASSERT(!IsSignatureFunction() && !IsClosureFunction());
   // Create closure function.
   const String& closure_name = String::Handle(name());
-  const Function& closure_function = Function::Handle(
-      NewClosureFunction(closure_name, *this, token_pos()));
+  const Function& closure_function =
+      Function::Handle(NewClosureFunction(closure_name, *this, token_pos()));
 
   // Set closure function's context scope.
   if (is_static()) {
@@ -6764,10 +6663,10 @@
   const int num_params = num_fixed_params + num_opt_params;
   closure_function.set_num_fixed_parameters(num_fixed_params);
   closure_function.SetNumOptionalParameters(num_opt_params, has_opt_pos_params);
-  closure_function.set_parameter_types(Array::Handle(Array::New(num_params,
-                                                                Heap::kOld)));
-  closure_function.set_parameter_names(Array::Handle(Array::New(num_params,
-                                                                Heap::kOld)));
+  closure_function.set_parameter_types(
+      Array::Handle(Array::New(num_params, Heap::kOld)));
+  closure_function.set_parameter_names(
+      Array::Handle(Array::New(num_params, Heap::kOld)));
   AbstractType& param_type = AbstractType::Handle();
   String& param_name = String::Handle();
   // Add implicit closure object parameter.
@@ -6780,10 +6679,12 @@
     param_name = ParameterNameAt(has_receiver - kClosure + i);
     closure_function.SetParameterNameAt(i, param_name);
   }
+  closure_function.set_kernel_function(kernel_function());
+
   const Type& signature_type = Type::Handle(closure_function.SignatureType());
   if (!signature_type.IsFinalized()) {
-    ClassFinalizer::FinalizeType(
-        Class::Handle(Owner()), signature_type, ClassFinalizer::kCanonicalize);
+    ClassFinalizer::FinalizeType(Class::Handle(Owner()), signature_type,
+                                 ClassFinalizer::kCanonicalize);
   }
   set_implicit_closure_function(closure_function);
   ASSERT(closure_function.IsImplicitClosureFunction());
@@ -6808,8 +6709,8 @@
   // '_LoadRequest', CommaSpace, '_LoadError'.
   GrowableHandlePtrArray<const String> pieces(zone, 5);
   const TypeArguments& instantiator = TypeArguments::Handle(zone);
-  BuildSignatureParameters(thread, zone,
-                           false, kUserVisibleName, instantiator, &pieces);
+  BuildSignatureParameters(thread, zone, false, kUserVisibleName, instantiator,
+                           &pieces);
   return Symbols::FromConcatAll(thread, pieces);
 }
 
@@ -6837,11 +6738,10 @@
   while (i < num_fixed_params) {
     param_type = ParameterTypeAt(i);
     ASSERT(!param_type.IsNull());
-    if (instantiate &&
-        param_type.IsFinalized() &&
+    if (instantiate && param_type.IsFinalized() &&
         !param_type.IsInstantiated()) {
-      param_type = param_type.InstantiateFrom(instantiator, NULL,
-                                              NULL, NULL, Heap::kNew);
+      param_type = param_type.InstantiateFrom(instantiator, NULL, NULL, NULL,
+                                              Heap::kNew);
     }
     name = param_type.BuildName(name_visibility);
     pieces->Add(name);
@@ -6858,11 +6758,10 @@
     }
     for (intptr_t i = num_fixed_params; i < num_params; i++) {
       param_type = ParameterTypeAt(i);
-      if (instantiate &&
-          param_type.IsFinalized() &&
+      if (instantiate && param_type.IsFinalized() &&
           !param_type.IsInstantiated()) {
-        param_type = param_type.InstantiateFrom(instantiator, NULL,
-                                                NULL, NULL, Heap::kNew);
+        param_type = param_type.InstantiateFrom(instantiator, NULL, NULL, NULL,
+                                                Heap::kNew);
       }
       ASSERT(!param_type.IsNull());
       name = param_type.BuildName(name_visibility);
@@ -6934,8 +6833,8 @@
     const Class& scope_class = Class::Handle(zone, Owner());
     ASSERT(!scope_class.IsNull());
     if (scope_class.IsGeneric()) {
-      const TypeArguments& type_parameters = TypeArguments::Handle(
-          zone, scope_class.type_parameters());
+      const TypeArguments& type_parameters =
+          TypeArguments::Handle(zone, scope_class.type_parameters());
       const String& scope_class_name = String::Handle(zone, scope_class.Name());
       pieces.Add(scope_class_name);
       const intptr_t num_type_parameters = type_parameters.Length();
@@ -6960,16 +6859,13 @@
     }
   }
   pieces.Add(Symbols::LParen());
-  BuildSignatureParameters(thread, zone,
-                           instantiate,
-                           name_visibility,
-                           instantiator,
-                           &pieces);
+  BuildSignatureParameters(thread, zone, instantiate, name_visibility,
+                           instantiator, &pieces);
   pieces.Add(Symbols::RParenArrow());
   AbstractType& res_type = AbstractType::Handle(zone, result_type());
   if (instantiate && res_type.IsFinalized() && !res_type.IsInstantiated()) {
-    res_type = res_type.InstantiateFrom(instantiator, NULL,
-                                        NULL, NULL, Heap::kNew);
+    res_type =
+        res_type.InstantiateFrom(instantiator, NULL, NULL, NULL, Heap::kNew);
   }
   name = res_type.BuildName(name_visibility);
   pieces.Add(name);
@@ -7058,16 +6954,16 @@
     while (fun.IsLocalFunction() && !fun.IsImplicitClosureFunction()) {
       fun = fun.parent_function();
       result = String::Concat(Symbols::Dot(), result, Heap::kOld);
-      result = String::Concat(
-          String::Handle(fun.UserVisibleName()), result, Heap::kOld);
+      result = String::Concat(String::Handle(fun.UserVisibleName()), result,
+                              Heap::kOld);
     }
   }
   const Class& cls = Class::Handle(Owner());
   if (!cls.IsTopLevel()) {
     result = String::Concat(Symbols::Dot(), result, Heap::kOld);
-    const String& cls_name = String::Handle(
-        name_visibility == kScrubbedName ? cls.ScrubbedName()
-                                         : cls.UserVisibleName());
+    const String& cls_name = String::Handle(name_visibility == kScrubbedName
+                                                ? cls.ScrubbedName()
+                                                : cls.UserVisibleName());
     result = String::Concat(cls_name, result, Heap::kOld);
   }
   return result.raw();
@@ -7105,14 +7001,15 @@
   // (2) "foo(() => null);": End token is ')`, but we don't print it.
   // (3) "var foo = () => null;": End token is `;', but in this case the token
   // semicolon belongs to the assignment so we skip it.
-  if ((tkit.CurrentTokenKind() == Token::kCOMMA) ||                   // Case 1.
-      (tkit.CurrentTokenKind() == Token::kRPAREN) ||                  // Case 2.
+  if ((tkit.CurrentTokenKind() == Token::kCOMMA) ||   // Case 1.
+      (tkit.CurrentTokenKind() == Token::kRPAREN) ||  // Case 2.
       (tkit.CurrentTokenKind() == Token::kSEMICOLON &&
        String::Handle(zone, name()).Equals("<anonymous closure>"))) {  // Cas 3.
     last_tok_len = 0;
   }
-  const String& result = String::Handle(zone, func_script.GetSnippet(
-      from_line, from_col, to_line, to_col + last_tok_len));
+  const String& result =
+      String::Handle(zone, func_script.GetSnippet(from_line, from_col, to_line,
+                                                  to_col + last_tok_len));
   ASSERT(!result.IsNull());
   return result.raw();
 }
@@ -7124,8 +7021,7 @@
   uint32_t result = 0;
   Zone* zone = Thread::Current()->zone();
   TokenStream::Iterator tokens_iterator(
-      zone,
-      TokenStream::Handle(zone, Script::Handle(zone, script()).tokens()),
+      zone, TokenStream::Handle(zone, Script::Handle(zone, script()).tokens()),
       token_pos());
   Object& obj = Object::Handle(zone);
   String& literal = String::Handle(zone);
@@ -7187,8 +7083,10 @@
   const intptr_t saved_length = saved_ic_data.Length();
   ASSERT(saved_length > 0);
   if (saved_length > 1) {
-    const intptr_t restored_length = ICData::Cast(Object::Handle(
-        zone, saved_ic_data.At(saved_length - 1))).deopt_id() + 1;
+    const intptr_t restored_length =
+        ICData::Cast(Object::Handle(zone, saved_ic_data.At(saved_length - 1)))
+            .deopt_id() +
+        1;
     deopt_id_to_ic_data->SetLength(restored_length);
     for (intptr_t i = 0; i < restored_length; i++) {
       (*deopt_id_to_ic_data)[i] = NULL;
@@ -7236,7 +7134,7 @@
 
 
 bool Function::CheckSourceFingerprint(const char* prefix, int32_t fp) const {
-  if (SourceFingerprint() != fp) {
+  if ((kernel_function() == NULL) && (SourceFingerprint() != fp)) {
     const bool recalculatingFingerprints = false;
     if (recalculatingFingerprints) {
       // This output can be copied into a file, then used with sed
@@ -7244,11 +7142,10 @@
       // sed -i .bak -f /tmp/newkeys runtime/vm/method_recognizer.h
       THR_Print("s/0x%08x/0x%08x/\n", fp, SourceFingerprint());
     } else {
-      THR_Print("FP mismatch while recognizing method %s:"
-                " expecting 0x%08x found 0x%08x\n",
-                ToFullyQualifiedCString(),
-                fp,
-                SourceFingerprint());
+      THR_Print(
+          "FP mismatch while recognizing method %s:"
+          " expecting 0x%08x found 0x%08x\n",
+          ToFullyQualifiedCString(), fp, SourceFingerprint());
       return false;
     }
   }
@@ -7299,9 +7196,9 @@
       UNREACHABLE();
   }
   const char* function_name = String::Handle(name()).ToCString();
-  return OS::SCreate(Thread::Current()->zone(),
-      "Function '%s':%s%s%s%s.",
-      function_name, static_str, abstract_str, kind_str, const_str);
+  return OS::SCreate(Thread::Current()->zone(), "Function '%s':%s%s%s%s.",
+                     function_name, static_str, abstract_str, kind_str,
+                     const_str);
 }
 
 
@@ -7330,8 +7227,7 @@
 RawClosureData* ClosureData::New() {
   ASSERT(Object::closure_data_class() != Class::null());
   RawObject* raw = Object::Allocate(ClosureData::kClassId,
-                                    ClosureData::InstanceSize(),
-                                    Heap::kOld);
+                                    ClosureData::InstanceSize(), Heap::kOld);
   return reinterpret_cast<RawClosureData*>(raw);
 }
 
@@ -7359,9 +7255,8 @@
 
 RawRedirectionData* RedirectionData::New() {
   ASSERT(Object::redirection_data_class() != Class::null());
-  RawObject* raw = Object::Allocate(RedirectionData::kClassId,
-                                    RedirectionData::InstanceSize(),
-                                    Heap::kOld);
+  RawObject* raw = Object::Allocate(
+      RedirectionData::kClassId, RedirectionData::InstanceSize(), Heap::kOld);
   return reinterpret_cast<RawRedirectionData*>(raw);
 }
 
@@ -7428,13 +7323,13 @@
 
 RawString* Field::NameFromGetter(const String& getter_name) {
   return Symbols::New(Thread::Current(), getter_name, kGetterPrefixLength,
-      getter_name.Length() - kGetterPrefixLength);
+                      getter_name.Length() - kGetterPrefixLength);
 }
 
 
 RawString* Field::NameFromSetter(const String& setter_name) {
   return Symbols::New(Thread::Current(), setter_name, kSetterPrefixLength,
-      setter_name.Length() - kSetterPrefixLength);
+                      setter_name.Length() - kSetterPrefixLength);
 }
 
 
@@ -7456,7 +7351,7 @@
 
 
 RawObject* Field::RawOwner() const {
-  if (Original()) {
+  if (IsOriginal()) {
     return raw_ptr()->owner_;
   } else {
     const Field& field = Field::Handle(Original());
@@ -7518,9 +7413,8 @@
 
 RawField* Field::New() {
   ASSERT(Object::field_class() != Class::null());
-  RawObject* raw = Object::Allocate(Field::kClassId,
-                                    Field::InstanceSize(),
-                                    Heap::kOld);
+  RawObject* raw =
+      Object::Allocate(Field::kClassId, Field::InstanceSize(), Heap::kOld);
   return reinterpret_cast<RawField*>(raw);
 }
 
@@ -7546,6 +7440,7 @@
   result.set_token_pos(token_pos);
   result.set_has_initializer(false);
   result.set_is_unboxing_candidate(true);
+  result.set_kernel_field(NULL);
   Isolate* isolate = Isolate::Current();
 
   // Use field guards if they are enabled and the isolate has never reloaded.
@@ -7576,14 +7471,8 @@
                      TokenPosition token_pos) {
   ASSERT(!owner.IsNull());
   const Field& result = Field::Handle(Field::New());
-  InitializeNew(result,
-                name,
-                is_static,
-                is_final,
-                is_const,
-                is_reflectable,
-                owner,
-                token_pos);
+  InitializeNew(result, name, is_static, is_final, is_const, is_reflectable,
+                owner, token_pos);
   result.SetFieldType(type);
   return result.raw();
 }
@@ -7596,14 +7485,9 @@
                              TokenPosition token_pos) {
   ASSERT(!owner.IsNull());
   const Field& result = Field::Handle(Field::New());
-  InitializeNew(result,
-                name,
-                true, /* is_static */
-                is_final,
-                is_const,
-                true, /* is_reflectable */
-                owner,
-                token_pos);
+  InitializeNew(result, name, true,       /* is_static */
+                is_final, is_const, true, /* is_reflectable */
+                owner, token_pos);
   return result.raw();
 }
 
@@ -7636,10 +7520,41 @@
   Field& clone = Field::Handle();
   clone ^= Object::Clone(*this, Heap::kOld);
   clone.SetOriginal(original);
+  clone.set_kernel_field(original.kernel_field());
   return clone.raw();
 }
 
 
+RawString* Field::InitializingExpression() const {
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  const class Script& scr = Script::Handle(zone, Script());
+  ASSERT(!scr.IsNull());
+  const TokenStream& tkns = TokenStream::Handle(zone, scr.tokens());
+  if (tkns.IsNull()) {
+    ASSERT(Dart::snapshot_kind() == Snapshot::kAppNoJIT);
+    return String::null();
+  }
+  TokenStream::Iterator tkit(zone, tkns, token_pos());
+  ASSERT(Token::IsIdentifier(tkit.CurrentTokenKind()));
+#if defined(DEBUG)
+  const String& literal = String::Handle(zone, tkit.CurrentLiteral());
+  ASSERT(literal.raw() == name());
+#endif
+  tkit.Advance();
+  if (tkit.CurrentTokenKind() != Token::kASSIGN) {
+    return String::null();
+  }
+  tkit.Advance();
+  const TokenPosition start_of_expression = tkit.CurrentPosition();
+  while (tkit.CurrentTokenKind() != Token::kSEMICOLON) {
+    tkit.Advance();
+  }
+  const TokenPosition end_of_expression = tkit.CurrentPosition();
+  return scr.GetSnippet(start_of_expression, end_of_expression);
+}
+
+
 RawString* Field::UserVisibleName() const {
   if (FLAG_show_internal_names) {
     return name();
@@ -7685,8 +7600,8 @@
   const char* field_name = String::Handle(name()).ToCString();
   const Class& cls = Class::Handle(Owner());
   const char* cls_name = String::Handle(cls.Name()).ToCString();
-  return OS::SCreate(Thread::Current()->zone(),
-      "Field <%s.%s>:%s%s%s", cls_name, field_name, kF0, kF1, kF2);
+  return OS::SCreate(Thread::Current()->zone(), "Field <%s.%s>:%s%s%s",
+                     cls_name, field_name, kF0, kF1, kF2);
 }
 
 
@@ -7702,16 +7617,16 @@
   String& closure_name = String::Handle(zone, this->name());
   closure_name = Symbols::FromConcat(thread, Symbols::HashMark(), closure_name);
   if (make_setter) {
-    closure_name = Symbols::FromConcat(thread,
-        Symbols::HashMark(), closure_name);
+    closure_name =
+        Symbols::FromConcat(thread, Symbols::HashMark(), closure_name);
   }
 
   Field& closure_field = Field::Handle(zone);
   closure_field = field_owner.LookupStaticField(closure_name);
   if (!closure_field.IsNull()) {
     ASSERT(closure_field.is_static());
-    const Instance& closure = Instance::Handle(zone,
-        closure_field.StaticValue());
+    const Instance& closure =
+        Instance::Handle(zone, closure_field.StaticValue());
     ASSERT(!closure.IsNull());
     ASSERT(closure.IsClosure());
     return closure.raw();
@@ -7722,29 +7637,26 @@
   const char* field_name = String::Handle(zone, name()).ToCString();
   String& expr_src = String::Handle(zone);
   if (make_setter) {
-    expr_src =
-        String::NewFormatted("(%s_) { return %s = %s_; }",
-                             field_name, field_name, field_name);
+    expr_src = String::NewFormatted("(%s_) { return %s = %s_; }", field_name,
+                                    field_name, field_name);
   } else {
     expr_src = String::NewFormatted("() { return %s; }", field_name);
   }
-  Object& result = Object::Handle(zone,
-      field_owner.Evaluate(expr_src,
-                           Object::empty_array(),
-                           Object::empty_array()));
+  Object& result =
+      Object::Handle(zone, field_owner.Evaluate(expr_src, Object::empty_array(),
+                                                Object::empty_array()));
   ASSERT(result.IsInstance());
   // The caller may expect the closure to be allocated in old space. Copy
   // the result here, since Object::Clone() is a private method.
   result = Object::Clone(result, Heap::kOld);
 
-  closure_field = Field::New(closure_name,
-                             true,  // is_static
-                             true,  // is_final
-                             true,  // is_const
-                             false,  // is_reflectable
-                             field_owner,
-                             Object::dynamic_type(),
-                             this->token_pos());
+  closure_field =
+      Field::New(closure_name,
+                 true,   // is_static
+                 true,   // is_final
+                 true,   // is_const
+                 false,  // is_reflectable
+                 field_owner, Object::dynamic_type(), this->token_pos());
   closure_field.SetStaticValue(Instance::Cast(result), true);
   field_owner.AddField(closure_field);
 
@@ -7777,7 +7689,7 @@
  public:
   explicit FieldDependentArray(const Field& field)
       : WeakCodeReferences(Array::Handle(field.dependent_code())),
-                           field_(field) {}
+        field_(field) {}
 
   virtual void UpdateArrayTo(const Array& value) {
     field_.set_dependent_code(value);
@@ -7794,10 +7706,10 @@
   virtual void ReportSwitchingCode(const Code& code) {
     if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) {
       Function& function = Function::Handle(code.function());
-      THR_Print("Switching '%s' to unoptimized code because guard"
-                " on field '%s' was violated.\n",
-                function.ToFullyQualifiedCString(),
-                field_.ToCString());
+      THR_Print(
+          "Switching '%s' to unoptimized code because guard"
+          " on field '%s' was violated.\n",
+          function.ToFullyQualifiedCString(), field_.ToCString());
     }
   }
 
@@ -7828,7 +7740,7 @@
   return (raw_ptr()->guarded_cid_ == other.raw_ptr()->guarded_cid_) &&
          (raw_ptr()->is_nullable_ == other.raw_ptr()->is_nullable_) &&
          (raw_ptr()->guarded_list_length_ ==
-             other.raw_ptr()->guarded_list_length_) &&
+          other.raw_ptr()->guarded_list_length_) &&
          (is_unboxing_candidate() == other.is_unboxing_candidate());
 }
 
@@ -7876,7 +7788,6 @@
                                   : Instance::Cast(value));
     return;
   } else if (StaticValue() == Object::transition_sentinel().raw()) {
-    SetStaticValue(Object::null_instance());
     const Array& ctor_args = Array::Handle(Array::New(1));
     const String& field_name = String::Handle(name());
     ctor_args.SetAt(0, field_name);
@@ -7935,29 +7846,24 @@
     return "<*>";
   }
 
-  const Class& cls = Class::Handle(
-      Isolate::Current()->class_table()->At(guarded_cid()));
+  const Class& cls =
+      Class::Handle(Isolate::Current()->class_table()->At(guarded_cid()));
   const char* class_name = String::Handle(cls.Name()).ToCString();
 
-  if (RawObject::IsBuiltinListClassId(guarded_cid()) &&
-      !is_nullable() &&
+  if (RawObject::IsBuiltinListClassId(guarded_cid()) && !is_nullable() &&
       is_final()) {
     ASSERT(guarded_list_length() != kUnknownFixedLength);
     if (guarded_list_length() == kNoFixedLength) {
-      return Thread::Current()->zone()->PrintToString(
-          "<%s [*]>", class_name);
+      return Thread::Current()->zone()->PrintToString("<%s [*]>", class_name);
     } else {
       return Thread::Current()->zone()->PrintToString(
-          "<%s [%" Pd " @%" Pd "]>",
-          class_name,
-          guarded_list_length(),
+          "<%s [%" Pd " @%" Pd "]>", class_name, guarded_list_length(),
           guarded_list_length_in_object_offset());
     }
   }
 
-  return Thread::Current()->zone()->PrintToString("<%s %s>",
-    is_nullable() ? "nullable" : "not-nullable",
-    class_name);
+  return Thread::Current()->zone()->PrintToString(
+      "<%s %s>", is_nullable() ? "nullable" : "not-nullable", class_name);
 }
 
 
@@ -8058,9 +7964,7 @@
   }
 
   if (FLAG_trace_field_guards) {
-    THR_Print("Store %s %s <- %s\n",
-              ToCString(),
-              GuardedPropertiesAsCString(),
+    THR_Print("Store %s %s <- %s\n", ToCString(), GuardedPropertiesAsCString(),
               value.ToCString());
   }
 
@@ -8099,8 +8003,7 @@
 RawLiteralToken* LiteralToken::New() {
   ASSERT(Object::literal_token_class() != Class::null());
   RawObject* raw = Object::Allocate(LiteralToken::kClassId,
-                                    LiteralToken::InstanceSize(),
-                                    Heap::kOld);
+                                    LiteralToken::InstanceSize(), Heap::kOld);
   return reinterpret_cast<RawLiteralToken*>(raw);
 }
 
@@ -8152,7 +8055,7 @@
 
 void TokenStream::DataFinalizer(void* isolate_callback_data,
                                 Dart_WeakPersistentHandle handle,
-                                void *peer) {
+                                void* peer) {
   ASSERT(peer != NULL);
   ::free(peer);
 }
@@ -8168,8 +8071,7 @@
 }
 
 RawString* TokenStream::GenerateSource() const {
-  return GenerateSource(TokenPosition::kMinSource,
-                        TokenPosition::kMaxSource);
+  return GenerateSource(TokenPosition::kMinSource, TokenPosition::kMaxSource);
 }
 
 RawString* TokenStream::GenerateSource(TokenPosition start_pos,
@@ -8177,9 +8079,8 @@
   Zone* zone = Thread::Current()->zone();
   Iterator iterator(zone, *this, start_pos, Iterator::kAllTokens);
   const ExternalTypedData& data = ExternalTypedData::Handle(zone, GetStream());
-  const GrowableObjectArray& literals =
-      GrowableObjectArray::Handle(zone,
-                                  GrowableObjectArray::New(data.Length()));
+  const GrowableObjectArray& literals = GrowableObjectArray::Handle(
+      zone, GrowableObjectArray::New(data.Length()));
   const String& private_key = String::Handle(zone, PrivateKey());
   intptr_t private_len = private_key.Length();
 
@@ -8317,10 +8218,10 @@
       separator = &Symbols::Blank();
     } else if ((curr == Token::kASSIGN) && (next == Token::kLPAREN)) {
       separator = &Symbols::Blank();
-    } else if ((curr == Token::kRETURN  ||
-                curr == Token::kCONDITIONAL ||
+    } else if ((curr == Token::kRETURN || curr == Token::kCONDITIONAL ||
                 Token::IsBinaryOperator(curr) ||
-                Token::IsEqualityOperator(curr)) && (next == Token::kLPAREN)) {
+                Token::IsEqualityOperator(curr)) &&
+               (next == Token::kLPAREN)) {
       separator = &Symbols::Blank();
     } else if ((curr == Token::kLBRACE) && (next == Token::kRBRACE)) {
       separator = NULL;
@@ -8345,9 +8246,9 @@
 
     // Account for indentation in case we printed a newline.
     if (curr == Token::kNEWLINE) {
-        for (int i = 0; i < indent; i++) {
-          literals.Add(Symbols::TwoSpaces());
-        }
+      for (int i = 0; i < indent; i++) {
+        literals.Add(Symbols::TwoSpaces());
+      }
     }
 
     // Setup for next iteration.
@@ -8361,9 +8262,7 @@
 
 intptr_t TokenStream::ComputeSourcePosition(TokenPosition tok_pos) const {
   Zone* zone = Thread::Current()->zone();
-  Iterator iterator(zone,
-                    *this,
-                    TokenPosition::kMinSource,
+  Iterator iterator(zone, *this, TokenPosition::kMinSource,
                     Iterator::kAllTokens);
   intptr_t src_pos = 0;
   Token::Kind kind = iterator.CurrentTokenKind();
@@ -8379,8 +8278,7 @@
 RawTokenStream* TokenStream::New() {
   ASSERT(Object::token_stream_class() != Class::null());
   RawObject* raw = Object::Allocate(TokenStream::kClassId,
-                                    TokenStream::InstanceSize(),
-                                    Heap::kOld);
+                                    TokenStream::InstanceSize(), Heap::kOld);
   return reinterpret_cast<RawTokenStream*>(raw);
 }
 
@@ -8394,9 +8292,8 @@
   ASSERT(data != NULL);
   Zone* zone = Thread::Current()->zone();
   const ExternalTypedData& stream = ExternalTypedData::Handle(
-      zone,
-      ExternalTypedData::New(kExternalTypedDataUint8ArrayCid,
-                             data, len, Heap::kOld));
+      zone, ExternalTypedData::New(kExternalTypedDataUint8ArrayCid, data, len,
+                                   Heap::kOld));
   stream.AddFinalizer(data, DataFinalizer, len);
   const TokenStream& result = TokenStream::Handle(zone, TokenStream::New());
   result.SetStream(stream);
@@ -8448,16 +8345,15 @@
   static const bool kPrintTokenObjects = false;
 
   CompressedTokenStreamData(const GrowableObjectArray& ta,
-                            CompressedTokenMap* map) :
-      buffer_(NULL),
-      stream_(&buffer_, Reallocate, kInitialBufferSize),
-      token_objects_(ta),
-      tokens_(map),
-      value_(Object::Handle()),
-      fresh_index_smi_(Smi::Handle()),
-      num_tokens_collected_(0) {
-  }
-  virtual ~CompressedTokenStreamData() { }
+                            CompressedTokenMap* map)
+      : buffer_(NULL),
+        stream_(&buffer_, Reallocate, kInitialBufferSize),
+        token_objects_(ta),
+        tokens_(map),
+        value_(Object::Handle()),
+        fresh_index_smi_(Smi::Handle()),
+        num_tokens_collected_(0) {}
+  virtual ~CompressedTokenStreamData() {}
 
   virtual void AddToken(const Scanner::TokenDescriptor& token) {
     if (token.kind == Token::kIDENT) {  // Identifier token.
@@ -8485,14 +8381,14 @@
     ASSERT(ident.IsSymbol());
     const intptr_t fresh_index = token_objects_.Length();
     fresh_index_smi_ = Smi::New(fresh_index);
-    intptr_t index = Smi::Value(Smi::RawCast(
-        tokens_->InsertOrGetValue(ident, fresh_index_smi_)));
+    intptr_t index = Smi::Value(
+        Smi::RawCast(tokens_->InsertOrGetValue(ident, fresh_index_smi_)));
     if (index == fresh_index) {
       token_objects_.Add(ident);
       if (kPrintTokenObjects) {
         int iid = Isolate::Current()->main_port() % 1024;
-        OS::Print("ident  %03x  %p <%s>\n",
-                  iid, ident.raw(), ident.ToCString());
+        OS::Print("ident  %03x  %p <%s>\n", iid, ident.raw(),
+                  ident.ToCString());
       }
     }
     WriteIndex(index);
@@ -8512,13 +8408,13 @@
       fresh_index_smi_ = Smi::New(fresh_index);
       const LiteralToken& lit = LiteralToken::Handle(
           LiteralToken::New(descriptor.kind, *descriptor.literal));
-      index = Smi::Value(Smi::RawCast(
-          tokens_->InsertOrGetValue(lit, fresh_index_smi_)));
+      index = Smi::Value(
+          Smi::RawCast(tokens_->InsertOrGetValue(lit, fresh_index_smi_)));
       token_objects_.Add(lit);
       if (kPrintTokenObjects) {
         int iid = Isolate::Current()->main_port() % 1024;
-        printf("lit    %03x  %p  %p  %p  <%s>\n",
-               iid, token_objects_.raw(), lit.literal(), lit.value(),
+        printf("lit    %03x  %p  %p  %p  <%s>\n", iid, token_objects_.raw(),
+               lit.literal(), lit.value(),
                String::Handle(lit.literal()).ToCString());
       }
     }
@@ -8526,9 +8422,7 @@
   }
 
   // Add a simple token into the stream.
-  void AddSimpleToken(intptr_t kind) {
-    stream_.WriteUnsigned(kind);
-  }
+  void AddSimpleToken(intptr_t kind) { stream_.WriteUnsigned(kind); }
 
   void WriteIndex(intptr_t value) {
     stream_.WriteUnsigned(value + Token::kNumTokens);
@@ -8575,9 +8469,8 @@
     const int kInitialPrivateCapacity = 256;
     token_objects =
         GrowableObjectArray::New(kInitialPrivateCapacity, Heap::kOld);
-    token_objects_map =
-        HashTables::New<CompressedTokenMap>(kInitialPrivateCapacity,
-                                            Heap::kOld);
+    token_objects_map = HashTables::New<CompressedTokenMap>(
+        kInitialPrivateCapacity, Heap::kOld);
   }
   CompressedTokenMap map(token_objects_map.raw());
   CompressedTokenStreamData data(token_objects, &map);
@@ -8588,8 +8481,8 @@
   // Create and setup the token stream object.
   const ExternalTypedData& stream = ExternalTypedData::Handle(
       zone,
-      ExternalTypedData::New(kExternalTypedDataUint8ArrayCid,
-                             data.GetStream(), data.Length(), Heap::kOld));
+      ExternalTypedData::New(kExternalTypedDataUint8ArrayCid, data.GetStream(),
+                             data.Length(), Heap::kOld));
   intptr_t external_size = data.Length();
   stream.AddFinalizer(data.GetStream(), DataFinalizer, external_size);
   const TokenStream& result = TokenStream::Handle(zone, New());
@@ -8609,15 +8502,14 @@
 
 
 void TokenStream::OpenSharedTokenList(Isolate* isolate) {
-  const int kInitialSharedCapacity = 5*1024;
+  const int kInitialSharedCapacity = 5 * 1024;
   ObjectStore* store = isolate->object_store();
   ASSERT(store->token_objects() == GrowableObjectArray::null());
   const GrowableObjectArray& token_objects = GrowableObjectArray::Handle(
       GrowableObjectArray::New(kInitialSharedCapacity, Heap::kOld));
   store->set_token_objects(token_objects);
   const Array& token_objects_map = Array::Handle(
-      HashTables::New<CompressedTokenMap>(kInitialSharedCapacity,
-                                          Heap::kOld));
+      HashTables::New<CompressedTokenMap>(kInitialSharedCapacity, Heap::kOld));
   store->set_token_objects_map(token_objects_map);
 }
 
@@ -8640,8 +8532,9 @@
     : tokens_(TokenStream::Handle(zone, tokens.raw())),
       data_(ExternalTypedData::Handle(zone, tokens.GetStream())),
       stream_(reinterpret_cast<uint8_t*>(data_.DataAddr(0)), data_.Length()),
-      token_objects_(Array::Handle(zone,
-         GrowableObjectArray::Handle(zone, tokens.TokenObjects()).data())),
+      token_objects_(Array::Handle(
+          zone,
+          GrowableObjectArray::Handle(zone, tokens.TokenObjects()).data())),
       obj_(Object::Handle(zone)),
       cur_token_pos_(token_pos.Pos()),
       cur_token_kind_(Token::kILLEGAL),
@@ -8810,9 +8703,7 @@
   Smi& value = Smi::Handle(zone);
   String& tokenValue = String::Handle(zone);
   ASSERT(!tkns.IsNull());
-  TokenStream::Iterator tkit(zone,
-                             tkns,
-                             TokenPosition::kMinSource,
+  TokenStream::Iterator tkit(zone, tkns, TokenPosition::kMinSource,
                              TokenStream::Iterator::kAllTokens);
   int current_line = -1;
   Scanner s(source, key);
@@ -8896,6 +8787,8 @@
       return "patch";
     case RawScript::kEvaluateTag:
       return "evaluate";
+    case RawScript::kKernelTag:
+      return "kernel";
     default:
       UNIMPLEMENTED();
   }
@@ -8918,6 +8811,10 @@
   StorePointer(&raw_ptr()->source_, value.raw());
 }
 
+void Script::set_line_starts(const Array& value) const {
+  StorePointer(&raw_ptr()->line_starts_, value.raw());
+}
+
 
 void Script::set_kind(RawScript::Kind value) const {
   StoreNonPointer(&raw_ptr()->kind_, value);
@@ -8934,8 +8831,7 @@
 }
 
 
-void Script::Tokenize(const String& private_key,
-                      bool use_shared_tokens) const {
+void Script::Tokenize(const String& private_key, bool use_shared_tokens) const {
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
   const TokenStream& tkns = TokenStream::Handle(zone, tokens());
@@ -8947,8 +8843,8 @@
   VMTagScope tagScope(thread, VMTag::kCompileScannerTagId);
   CSTAT_TIMER_SCOPE(thread, scanner_timer);
   const String& src = String::Handle(zone, Source());
-  const TokenStream& ts = TokenStream::Handle(zone,
-      TokenStream::New(src, private_key, use_shared_tokens));
+  const TokenStream& ts = TokenStream::Handle(
+      zone, TokenStream::New(src, private_key, use_shared_tokens));
   set_tokens(ts);
   INC_STAT(thread, src_length, src.Length());
 }
@@ -8969,9 +8865,49 @@
                               intptr_t* token_len) const {
   ASSERT(line != NULL);
   Zone* zone = Thread::Current()->zone();
+
+  if (kind() == RawScript::kKernelTag) {
+    const Array& line_starts_array = Array::Handle(line_starts());
+    if (line_starts_array.IsNull()) {
+      // Scripts in the AOT snapshot do not have a line starts array.
+      *line = -1;
+      if (column != NULL) {
+        *column = -1;
+      }
+      if (token_len != NULL) {
+        *token_len = 1;
+      }
+      return;
+    }
+    ASSERT(line_starts_array.Length() > 0);
+    intptr_t offset = token_pos.value();
+    int min = 0;
+    int max = line_starts_array.Length() - 1;
+
+    // Binary search to find the line containing this offset.
+    Smi& smi = Smi::Handle();
+    while (min < max) {
+      int midpoint = (max - min + 1) / 2 + min;
+
+      smi ^= line_starts_array.At(midpoint);
+      if (smi.Value() > offset) {
+        max = midpoint - 1;
+      } else {
+        min = midpoint;
+      }
+    }
+    *line = min + 1;
+    smi ^= line_starts_array.At(min);
+    *column = offset - smi.Value() + 1;
+    if (token_len != NULL) {
+      *token_len = 1;
+    }
+    return;
+  }
+
   const TokenStream& tkns = TokenStream::Handle(zone, tokens());
   if (tkns.IsNull()) {
-    ASSERT(Dart::snapshot_kind() == Snapshot::kAppNoJIT);
+    ASSERT((Dart::snapshot_kind() == Snapshot::kAppNoJIT));
     *line = -1;
     if (column != NULL) {
       *column = -1;
@@ -8982,9 +8918,7 @@
     return;
   }
   if (column == NULL) {
-    TokenStream::Iterator tkit(zone,
-                               tkns,
-                               TokenPosition::kMinSource,
+    TokenStream::Iterator tkit(zone, tkns, TokenPosition::kMinSource,
                                TokenStream::Iterator::kAllTokens);
     intptr_t cur_line = line_offset() + 1;
     while ((tkit.CurrentPosition() < token_pos) &&
@@ -9029,9 +8963,7 @@
   const TokenStream& tkns = TokenStream::Handle(zone, tokens());
   line_number -= line_offset();
   if (line_number < 1) line_number = 1;
-  TokenStream::Iterator tkit(zone,
-                             tkns,
-                             TokenPosition::kMinSource,
+  TokenStream::Iterator tkit(zone, tkns, TokenPosition::kMinSource,
                              TokenStream::Iterator::kAllTokens);
   // Scan through the token stream to the required line.
   intptr_t cur_line = 1;
@@ -9081,8 +9013,7 @@
   intptr_t line_start_idx = -1;
   intptr_t last_char_idx = -1;
   for (intptr_t ix = 0;
-       (ix < src.Length()) && (current_line <= relative_line_number);
-       ix++) {
+       (ix < src.Length()) && (current_line <= relative_line_number); ix++) {
     if ((current_line == relative_line_number) && (line_start_idx < 0)) {
       line_start_idx = ix;
     }
@@ -9099,16 +9030,25 @@
   // Guarantee that returned string is never NULL.
 
   if (line_start_idx >= 0) {
-    return String::SubString(src,
-                             line_start_idx,
-                             last_char_idx - line_start_idx + 1,
-                             space);
+    return String::SubString(src, line_start_idx,
+                             last_char_idx - line_start_idx + 1, space);
   } else {
     return Symbols::Empty().raw();
   }
 }
 
 
+RawString* Script::GetSnippet(TokenPosition from, TokenPosition to) const {
+  intptr_t from_line;
+  intptr_t from_column;
+  intptr_t to_line;
+  intptr_t to_column;
+  GetTokenLocation(from, &from_line, &from_column);
+  GetTokenLocation(to, &to_line, &to_column);
+  return GetSnippet(from_line, from_column, to_line, to_column);
+}
+
+
 RawString* Script::GetSnippet(intptr_t from_line,
                               intptr_t from_column,
                               intptr_t to_line,
@@ -9166,9 +9106,8 @@
 
 RawScript* Script::New() {
   ASSERT(Object::script_class() != Class::null());
-  RawObject* raw = Object::Allocate(Script::kClassId,
-                                    Script::InstanceSize(),
-                                    Heap::kOld);
+  RawObject* raw =
+      Object::Allocate(Script::kClassId, Script::InstanceSize(), Heap::kOld);
   return reinterpret_cast<RawScript*>(raw);
 }
 
@@ -9192,8 +9131,8 @@
       String::Handle(zone, Symbols::New(thread, resolved_url)));
   result.set_source(source);
   result.set_kind(kind);
-  result.set_load_timestamp(FLAG_remove_script_timestamps_for_test
-                            ? 0 : OS::GetCurrentTimeMillis());
+  result.set_load_timestamp(
+      FLAG_remove_script_timestamps_for_test ? 0 : OS::GetCurrentTimeMillis());
   result.SetLocationOffset(0, 0);
   return result.raw();
 }
@@ -9209,8 +9148,8 @@
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
   Isolate* isolate = thread->isolate();
-  const GrowableObjectArray& libs = GrowableObjectArray::Handle(zone,
-      isolate->object_store()->libraries());
+  const GrowableObjectArray& libs =
+      GrowableObjectArray::Handle(zone, isolate->object_store()->libraries());
   Library& lib = Library::Handle(zone);
   Array& scripts = Array::Handle(zone);
   for (intptr_t i = 0; i < libs.Length(); i++) {
@@ -9256,10 +9195,9 @@
 ClassDictionaryIterator::ClassDictionaryIterator(const Library& library,
                                                  IterationKind kind)
     : DictionaryIterator(library),
-      toplevel_class_(Class::Handle(
-          (kind == kIteratePrivate)
-              ? library.toplevel_class()
-              : Class::null())) {
+      toplevel_class_(Class::Handle((kind == kIteratePrivate)
+                                        ? library.toplevel_class()
+                                        : Class::null())) {
   MoveToNextClass();
 }
 
@@ -9318,12 +9256,9 @@
 
 static void ReportTooManyImports(const Library& lib) {
   const String& url = String::Handle(lib.url());
-  Report::MessageF(Report::kError,
-                   Script::Handle(lib.LookupScript(url)),
-                   TokenPosition::kNoSource,
-                   Report::AtLocation,
-                   "too many imports in library '%s'",
-                   url.ToCString());
+  Report::MessageF(Report::kError, Script::Handle(lib.LookupScript(url)),
+                   TokenPosition::kNoSource, Report::AtLocation,
+                   "too many imports in library '%s'", url.ToCString());
   UNREACHABLE();
 }
 
@@ -9385,9 +9320,7 @@
     // Library objects are always canonical.
     return a.raw() == b.raw();
   }
-  static uword Hash(const Object& key) {
-    return Library::Cast(key).UrlHash();
-  }
+  static uword Hash(const Object& key) { return Library::Cast(key).UrlHash(); }
 };
 typedef UnorderedHashSet<LibraryUrlTraits> LibraryLoadErrorSet;
 
@@ -9471,16 +9404,19 @@
 }
 
 
-static RawString* MakeClassMetaName(Thread* thread, Zone* zone,
+static RawString* MakeClassMetaName(Thread* thread,
+                                    Zone* zone,
                                     const Class& cls) {
-  return Symbols::FromConcat(thread,
-                             Symbols::At(), String::Handle(zone, cls.Name()));
+  return Symbols::FromConcat(thread, Symbols::At(),
+                             String::Handle(zone, cls.Name()));
 }
 
 
-static RawString* MakeFieldMetaName(Thread* thread, Zone* zone,
+static RawString* MakeFieldMetaName(Thread* thread,
+                                    Zone* zone,
                                     const Field& field) {
-  const String& cname = String::Handle(zone,
+  const String& cname = String::Handle(
+      zone,
       MakeClassMetaName(thread, zone, Class::Handle(zone, field.Origin())));
   GrowableHandlePtrArray<const String> pieces(zone, 3);
   pieces.Add(cname);
@@ -9490,9 +9426,11 @@
 }
 
 
-static RawString* MakeFunctionMetaName(Thread* thread, Zone* zone,
+static RawString* MakeFunctionMetaName(Thread* thread,
+                                       Zone* zone,
                                        const Function& func) {
-  const String& cname = String::Handle(zone,
+  const String& cname = String::Handle(
+      zone,
       MakeClassMetaName(thread, zone, Class::Handle(zone, func.origin())));
   GrowableHandlePtrArray<const String> pieces(zone, 3);
   pieces.Add(cname);
@@ -9502,9 +9440,11 @@
 }
 
 
-static RawString* MakeTypeParameterMetaName(Thread* thread, Zone* zone,
+static RawString* MakeTypeParameterMetaName(Thread* thread,
+                                            Zone* zone,
                                             const TypeParameter& param) {
-  const String& cname = String::Handle(zone,
+  const String& cname = String::Handle(
+      zone,
       MakeClassMetaName(thread, zone,
                         Class::Handle(zone, param.parameterized_class())));
   GrowableHandlePtrArray<const String> pieces(zone, 3);
@@ -9522,12 +9462,11 @@
   ASSERT(thread->IsMutatorThread());
   Zone* zone = thread->zone();
   const String& metaname = String::Handle(zone, Symbols::New(thread, name));
-  const Field& field = Field::Handle(zone,
-      Field::NewTopLevel(metaname,
-                         false,  // is_final
-                         false,  // is_const
-                         owner,
-                         token_pos));
+  const Field& field =
+      Field::Handle(zone, Field::NewTopLevel(metaname,
+                                             false,  // is_final
+                                             false,  // is_const
+                                             owner, token_pos));
   field.SetFieldType(Object::dynamic_type());
   field.set_is_reflectable(false);
   field.SetStaticValue(Array::empty_array(), true);
@@ -9574,10 +9513,10 @@
                                        TokenPosition token_pos) const {
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
-  AddMetadata(Class::Handle(zone, param.parameterized_class()),
-              String::Handle(zone,
-                             MakeTypeParameterMetaName(thread, zone, param)),
-              token_pos);
+  AddMetadata(
+      Class::Handle(zone, param.parameterized_class()),
+      String::Handle(zone, MakeTypeParameterMetaName(thread, zone, param)),
+      token_pos);
 }
 
 
@@ -9649,14 +9588,12 @@
 
 
 static bool ShouldBePrivate(const String& name) {
-  return
-      (name.Length() >= 1 && name.CharAt(0) == '_') ||
-      (name.Length() >= 5 &&
-        (name.CharAt(4) == '_' &&
-          (name.CharAt(0) == 'g' || name.CharAt(0) == 's') &&
-          name.CharAt(1) == 'e' &&
-          name.CharAt(2) == 't' &&
-          name.CharAt(3) == ':'));
+  return (name.Length() >= 1 && name.CharAt(0) == '_') ||
+         (name.Length() >= 5 &&
+          (name.CharAt(4) == '_' &&
+           (name.CharAt(0) == 'g' || name.CharAt(0) == 's') &&
+           name.CharAt(1) == 'e' && name.CharAt(2) == 't' &&
+           name.CharAt(3) == ':'));
 }
 
 
@@ -9697,9 +9634,7 @@
   static bool IsMatch(const Object& a, const Object& b) {
     return String::Cast(a).Equals(String::Cast(b));
   }
-  static uword Hash(const Object& obj) {
-    return String::Cast(obj).Hash();
-  }
+  static uword Hash(const Object& obj) { return String::Cast(obj).Hash(); }
 };
 typedef UnorderedHashMap<StringEqualsTraits> ResolvedNamesMap;
 
@@ -9707,14 +9642,13 @@
 // Returns true if the name is found in the cache, false no cache hit.
 // obj is set to the cached entry. It may be null, indicating that the
 // name does not resolve to anything in this library.
-bool Library::LookupResolvedNamesCache(const String& name,
-                                       Object* obj) const {
+bool Library::LookupResolvedNamesCache(const String& name, Object* obj) const {
   ResolvedNamesMap cache(resolved_names());
   bool present = false;
   *obj = cache.GetOrNull(name, &present);
-  // Mutator compiler thread may add entries and therefore
-  // change 'resolved_names()' while running a background compilation;
-  // ASSERT that 'resolved_names()' has not changed only in mutator.
+// Mutator compiler thread may add entries and therefore
+// change 'resolved_names()' while running a background compilation;
+// ASSERT that 'resolved_names()' has not changed only in mutator.
 #if defined(DEBUG)
   if (Thread::Current()->IsMutatorThread()) {
     ASSERT(cache.Release().raw() == resolved_names());
@@ -9741,8 +9675,7 @@
 }
 
 
-bool Library::LookupExportedNamesCache(const String& name,
-                                       Object* obj) const {
+bool Library::LookupExportedNamesCache(const String& name, Object* obj) const {
   ASSERT(FLAG_use_exp_cache);
   if (exported_names() == Array::null()) {
     return false;
@@ -9750,9 +9683,9 @@
   ResolvedNamesMap cache(exported_names());
   bool present = false;
   *obj = cache.GetOrNull(name, &present);
-  // Mutator compiler thread may add entries and therefore
-  // change 'exported_names()' while running a background compilation;
-  // do not ASSERT that 'exported_names()' has not changed.
+// Mutator compiler thread may add entries and therefore
+// change 'exported_names()' while running a background compilation;
+// do not ASSERT that 'exported_names()' has not changed.
 #if defined(DEBUG)
   if (Thread::Current()->IsMutatorThread()) {
     ASSERT(cache.Release().raw() == exported_names());
@@ -9856,9 +9789,7 @@
 
 void Library::AddObject(const Object& obj, const String& name) const {
   ASSERT(Thread::Current()->IsMutatorThread());
-  ASSERT(obj.IsClass() ||
-         obj.IsFunction() ||
-         obj.IsField() ||
+  ASSERT(obj.IsClass() || obj.IsFunction() || obj.IsField() ||
          obj.IsLibraryPrefix());
   ASSERT(name.Equals(String::Handle(obj.DictionaryName())));
   ASSERT(LookupLocalObject(name) == Object::null());
@@ -9929,16 +9860,14 @@
     }
   }
   bool in_cycle = (trail->RemoveLast() < 0);
-  if (FLAG_use_exp_cache &&
-      !in_cycle &&
-      !Compiler::IsBackgroundCompilation()) {
+  if (FLAG_use_exp_cache && !in_cycle && !Compiler::IsBackgroundCompilation()) {
     AddToExportedNamesCache(name, obj);
   }
   return obj.raw();
 }
 
 
-RawObject* Library::LookupEntry(const String& name, intptr_t *index) const {
+RawObject* Library::LookupEntry(const String& name, intptr_t* index) const {
   Thread* thread = Thread::Current();
   REUSABLE_ARRAY_HANDLESCOPE(thread);
   REUSABLE_OBJECT_HANDLESCOPE(thread);
@@ -10087,7 +10016,7 @@
       entry = patches.At(i);
       if (entry.IsClass()) {
         owner_script = Class::Cast(entry).script();
-      }  else {
+      } else {
         ASSERT(entry.IsScript());
         owner_script = Script::Cast(entry).raw();
       }
@@ -10141,7 +10070,7 @@
       // If we do a suffix match, only match if the partial path
       // starts at or immediately after the path separator.
       if (((url.CharAt(0) == '/') ||
-          (script_url.CharAt(start_idx - 1) == '/')) &&
+           (script_url.CharAt(start_idx - 1) == '/')) &&
           url.Equals(script_url, start_idx, url_length)) {
         return script.raw();
       }
@@ -10415,7 +10344,7 @@
 // pre-allocate any unused capacity. The assumption is that
 // re-exports are quite rare.
 void Library::AddExport(const Namespace& ns) const {
-  Array &exports = Array::Handle(this->exports());
+  Array& exports = Array::Handle(this->exports());
   intptr_t num_exports = exports.Length();
   exports = Array::Grow(exports, num_exports + 1);
   StorePointer(&raw_ptr()->exports_, exports.raw());
@@ -10469,15 +10398,13 @@
 
 RawLibrary* Library::New() {
   ASSERT(Object::library_class() != Class::null());
-  RawObject* raw = Object::Allocate(Library::kClassId,
-                                    Library::InstanceSize(),
-                                    Heap::kOld);
+  RawObject* raw =
+      Object::Allocate(Library::kClassId, Library::InstanceSize(), Heap::kOld);
   return reinterpret_cast<RawLibrary*>(raw);
 }
 
 
-RawLibrary* Library::NewLibraryHelper(const String& url,
-                                      bool import_core_lib) {
+RawLibrary* Library::NewLibraryHelper(const String& url, bool import_core_lib) {
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
   ASSERT(thread->IsMutatorThread());
@@ -10491,16 +10418,15 @@
   result.StorePointer(&result.raw_ptr()->url_, url.raw());
   result.StorePointer(&result.raw_ptr()->resolved_names_,
                       Object::empty_array().raw());
-  result.StorePointer(&result.raw_ptr()->exported_names_,
-                      Array::null());
+  result.StorePointer(&result.raw_ptr()->exported_names_, Array::null());
   result.StorePointer(&result.raw_ptr()->dictionary_,
                       Object::empty_array().raw());
   result.StorePointer(&result.raw_ptr()->metadata_,
                       GrowableObjectArray::New(4, Heap::kOld));
   result.StorePointer(&result.raw_ptr()->toplevel_class_, Class::null());
-  result.StorePointer(&result.raw_ptr()->patch_classes_,
-                      GrowableObjectArray::New(Object::empty_array(),
-                                               Heap::kOld));
+  result.StorePointer(
+      &result.raw_ptr()->patch_classes_,
+      GrowableObjectArray::New(Object::empty_array(), Heap::kOld));
   result.StorePointer(&result.raw_ptr()->imports_, Object::empty_array().raw());
   result.StorePointer(&result.raw_ptr()->exports_, Object::empty_array().raw());
   result.StorePointer(&result.raw_ptr()->loaded_scripts_, Array::null());
@@ -10522,7 +10448,8 @@
   if (import_core_lib) {
     const Library& core_lib = Library::Handle(zone, Library::CoreLibrary());
     ASSERT(!core_lib.IsNull());
-    const Namespace& ns = Namespace::Handle(zone,
+    const Namespace& ns = Namespace::Handle(
+        zone,
         Namespace::New(core_lib, Object::null_array(), Object::null_array()));
     result.AddImport(ns);
   }
@@ -10564,15 +10491,15 @@
 }
 
 
-void Library::InitNativeWrappersLibrary(Isolate* isolate) {
+void Library::InitNativeWrappersLibrary(Isolate* isolate, bool is_kernel) {
   static const int kNumNativeWrappersClasses = 4;
   COMPILE_ASSERT((kNumNativeWrappersClasses > 0) &&
                  (kNumNativeWrappersClasses < 10));
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
   const String& native_flds_lib_url = Symbols::DartNativeWrappers();
-  const Library& native_flds_lib = Library::Handle(zone,
-      Library::NewLibraryHelper(native_flds_lib_url, false));
+  const Library& native_flds_lib = Library::Handle(
+      zone, Library::NewLibraryHelper(native_flds_lib_url, false));
   const String& native_flds_lib_name = Symbols::DartNativeWrappersLibName();
   native_flds_lib.SetName(native_flds_lib_name);
   native_flds_lib.SetLoadRequested();
@@ -10585,15 +10512,17 @@
   char name_buffer[kNameLength];
   String& cls_name = String::Handle(zone);
   for (int fld_cnt = 1; fld_cnt <= kNumNativeWrappersClasses; fld_cnt++) {
-    OS::SNPrint(name_buffer,
-                kNameLength,
-                "%s%d",
-                kNativeWrappersClass,
+    OS::SNPrint(name_buffer, kNameLength, "%s%d", kNativeWrappersClass,
                 fld_cnt);
     cls_name = Symbols::New(thread, name_buffer);
     Class::NewNativeWrapper(native_flds_lib, cls_name, fld_cnt);
   }
-  native_flds_lib.SetLoaded();
+  // NOTE: If we bootstrap from a Kernel IR file we want to generate the
+  // synthetic constructors for the native wrapper classes.  We leave this up to
+  // the [KernelReader] who will take care of it later.
+  if (!is_kernel) {
+    native_flds_lib.SetLoaded();
+  }
 }
 
 
@@ -10611,19 +10540,15 @@
     return a_str.Equals(b_str);
   }
 
-  static uword Hash(const Object& key) {
-    return String::Cast(key).Hash();
-  }
+  static uword Hash(const Object& key) { return String::Cast(key).Hash(); }
 
-  static RawObject* NewKey(const String& str) {
-    return str.raw();
-  }
+  static RawObject* NewKey(const String& str) { return str.raw(); }
 };
 typedef UnorderedHashMap<LibraryLookupTraits> LibraryLookupMap;
 
 
 // Returns library with given url in current isolate, or NULL.
-RawLibrary* Library::LookupLibrary(Thread* thread, const String &url) {
+RawLibrary* Library::LookupLibrary(Thread* thread, const String& url) {
   Zone* zone = thread->zone();
   Isolate* isolate = thread->isolate();
   ObjectStore* object_store = isolate->object_store();
@@ -10691,16 +10616,15 @@
   const String& url = String::Handle(zone, this->url());
   intptr_t hash_value = url.Hash() & hash_mask;
 
-  const GrowableObjectArray& libs = GrowableObjectArray::Handle(zone,
-      isolate->object_store()->libraries());
+  const GrowableObjectArray& libs =
+      GrowableObjectArray::Handle(zone, isolate->object_store()->libraries());
   intptr_t sequence_value = libs.Length();
 
   char private_key[32];
-  OS::SNPrint(private_key, sizeof(private_key),
-              "%c%" Pd "%06" Pd "",
+  OS::SNPrint(private_key, sizeof(private_key), "%c%" Pd "%06" Pd "",
               kPrivateKeySeparator, sequence_value, hash_value);
-  const String& key = String::Handle(zone, String::New(private_key,
-                                                       Heap::kOld));
+  const String& key =
+      String::Handle(zone, String::New(private_key, Heap::kOld));
   key.Hash();  // This string may end up in the VM isolate.
   StorePointer(&raw_ptr()->private_key_, key.raw());
 }
@@ -10720,8 +10644,8 @@
   String& name = String::Handle(zone, class_name.raw());
   if (class_name.CharAt(0) == kPrivateIdentifierStart) {
     // Private identifiers are mangled on a per library basis.
-    name = Symbols::FromConcat(thread,
-        name, String::Handle(zone, core_lib.private_key()));
+    name = Symbols::FromConcat(thread, name,
+                               String::Handle(zone, core_lib.private_key()));
   }
   return core_lib.LookupClass(name);
 }
@@ -10736,8 +10660,8 @@
   // ASSERT(strchr(name, '@') == NULL);
   String& str = String::Handle(zone);
   str = name.raw();
-  str = Symbols::FromConcat(thread,
-                            str, String::Handle(zone, this->private_key()));
+  str = Symbols::FromConcat(thread, str,
+                            String::Handle(zone, this->private_key()));
   return str.raw();
 }
 
@@ -10768,8 +10692,8 @@
   const String& lib_url = String::Handle(zone, url());
   ASSERT(Library::LookupLibrary(thread, lib_url) == Library::null());
   ASSERT(lib_url.HasHash());
-  GrowableObjectArray& libs = GrowableObjectArray::Handle(zone,
-      object_store->libraries());
+  GrowableObjectArray& libs =
+      GrowableObjectArray::Handle(zone, object_store->libraries());
   ASSERT(!libs.IsNull());
   set_index(libs.Length());
   libs.Add(*this);
@@ -10834,7 +10758,7 @@
 
 
 RawLibrary* Library::InternalLibrary() {
-  return Isolate::Current()->object_store()->internal_library();
+  return Isolate::Current()->object_store()->_internal_library();
 }
 
 
@@ -10848,9 +10772,11 @@
 }
 
 
+#if !defined(PRODUCT)
 RawLibrary* Library::MirrorsLibrary() {
   return Isolate::Current()->object_store()->mirrors_library();
 }
+#endif
 
 
 RawLibrary* Library::NativeWrappersLibrary() {
@@ -10869,14 +10795,14 @@
 
 
 RawLibrary* Library::VMServiceLibrary() {
-  return Isolate::Current()->object_store()->vmservice_library();
+  return Isolate::Current()->object_store()->_vmservice_library();
 }
 
 
 const char* Library::ToCString() const {
   const String& name = String::Handle(url());
-  return OS::SCreate(Thread::Current()->zone(),
-      "Library:'%s'", name.ToCString());
+  return OS::SCreate(Thread::Current()->zone(), "Library:'%s'",
+                     name.ToCString());
 }
 
 
@@ -11074,17 +11000,16 @@
     {
       TransitionVMToNative transition(thread);
       Api::Scope api_scope(thread);
-      obj = Api::UnwrapHandle(
-              handler(Dart_kImportTag,
-                      Api::NewHandle(thread, importer()),
-                      Api::NewHandle(thread, lib_url.raw())));
+      obj = Api::UnwrapHandle(handler(Dart_kImportTag,
+                                      Api::NewHandle(thread, importer()),
+                                      Api::NewHandle(thread, lib_url.raw())));
     }
     if (obj.IsError()) {
       Exceptions::PropagateError(Error::Cast(obj));
     }
   } else {
-    // Another load request is in flight.
-    ASSERT(deferred_lib.LoadRequested());
+    // Another load request is in flight or previously failed.
+    ASSERT(deferred_lib.LoadRequested() || deferred_lib.LoadFailed());
   }
   return false;  // Load request not yet completed.
 }
@@ -11104,7 +11029,7 @@
  public:
   explicit PrefixDependentArray(const LibraryPrefix& prefix)
       : WeakCodeReferences(Array::Handle(prefix.dependent_code())),
-                           prefix_(prefix) {}
+        prefix_(prefix) {}
 
   virtual void UpdateArrayTo(const Array& value) {
     prefix_.set_dependent_code(value);
@@ -11121,10 +11046,10 @@
   virtual void ReportSwitchingCode(const Code& code) {
     if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) {
       THR_Print("Prefix '%s': disabling %s code for %s function '%s'\n",
-          String::Handle(prefix_.name()).ToCString(),
-          code.is_optimized() ? "optimized" : "unoptimized",
-          code.IsDisabled() ? "'patched'" : "'unpatched'",
-          Function::Handle(code.function()).ToCString());
+                String::Handle(prefix_.name()).ToCString(),
+                code.is_optimized() ? "optimized" : "unoptimized",
+                code.IsDisabled() ? "'patched'" : "'unpatched'",
+                Function::Handle(code.function()).ToCString());
     }
   }
 
@@ -11153,8 +11078,7 @@
 
 RawLibraryPrefix* LibraryPrefix::New() {
   RawObject* raw = Object::Allocate(LibraryPrefix::kClassId,
-                                    LibraryPrefix::InstanceSize(),
-                                    Heap::kOld);
+                                    LibraryPrefix::InstanceSize(), Heap::kOld);
   return reinterpret_cast<RawLibraryPrefix*>(raw);
 }
 
@@ -11201,8 +11125,8 @@
 
 const char* LibraryPrefix::ToCString() const {
   const String& prefix = String::Handle(name());
-  return OS::SCreate(Thread::Current()->zone(),
-      "LibraryPrefix:'%s'", prefix.ToCString());
+  return OS::SCreate(Thread::Current()->zone(), "LibraryPrefix:'%s'",
+                     prefix.ToCString());
 }
 
 
@@ -11216,8 +11140,7 @@
   Field& field = Field::Handle(Field::NewTopLevel(Symbols::TopLevel(),
                                                   false,  // is_final
                                                   false,  // is_const
-                                                  owner,
-                                                  token_pos));
+                                                  owner, token_pos));
   field.set_is_reflectable(false);
   field.SetFieldType(Object::dynamic_type());
   field.SetStaticValue(Array::empty_array(), true);
@@ -11246,8 +11169,8 @@
 
 const char* Namespace::ToCString() const {
   const Library& lib = Library::Handle(library());
-  return OS::SCreate(Thread::Current()->zone(),
-      "Namespace for library '%s'", lib.ToCString());
+  return OS::SCreate(Thread::Current()->zone(), "Namespace for library '%s'",
+                     lib.ToCString());
 }
 
 
@@ -11307,7 +11230,7 @@
     // Look for cycle in reexport graph.
     for (int i = 0; i < trail->length(); i++) {
       if (trail->At(i) == lib.index()) {
-        for (int j = i+1; j < trail->length(); j++) {
+        for (int j = i + 1; j < trail->length(); j++) {
           (*trail)[j] = -1;
         }
         return Object::null();
@@ -11318,8 +11241,7 @@
   intptr_t ignore = 0;
   // Lookup the name in the library's symbols.
   Object& obj = Object::Handle(zone, lib.LookupEntry(name, &ignore));
-  if (!Field::IsGetterName(name) &&
-      !Field::IsSetterName(name) &&
+  if (!Field::IsGetterName(name) && !Field::IsSetterName(name) &&
       (obj.IsNull() || obj.IsLibraryPrefix())) {
     String& accessor_name = String::Handle(zone);
     accessor_name ^= Field::LookupGetterSymbol(name);
@@ -11358,8 +11280,7 @@
 RawNamespace* Namespace::New() {
   ASSERT(Object::namespace_class() != Class::null());
   RawObject* raw = Object::Allocate(Namespace::kClassId,
-                                    Namespace::InstanceSize(),
-                                    Heap::kOld);
+                                    Namespace::InstanceSize(), Heap::kOld);
   return reinterpret_cast<RawNamespace*>(raw);
 }
 
@@ -11404,8 +11325,8 @@
   // Inner functions get added to the closures array. As part of compilation
   // more closures can be added to the end of the array. Compile all the
   // closures until we have reached the end of the "worklist".
-  const GrowableObjectArray& closures = GrowableObjectArray::Handle(zone,
-      Isolate::Current()->object_store()->closure_functions());
+  const GrowableObjectArray& closures = GrowableObjectArray::Handle(
+      zone, Isolate::Current()->object_store()->closure_functions());
   Function& func = Function::Handle(zone);
   for (int i = 0; i < closures.Length(); i++) {
     func ^= closures.At(i);
@@ -11426,8 +11347,8 @@
   Zone* zone = thread->zone();
   Error& error = Error::Handle(zone);
   Isolate* isolate = thread->isolate();
-  const GrowableObjectArray& libs = GrowableObjectArray::Handle(
-      isolate->object_store()->libraries());
+  const GrowableObjectArray& libs =
+      GrowableObjectArray::Handle(isolate->object_store()->libraries());
   Library& lib = Library::Handle(zone);
   Class& cls = Class::Handle(zone);
   for (int i = 0; i < libs.Length(); i++) {
@@ -11449,8 +11370,8 @@
   // Inner functions get added to the closures array. As part of compilation
   // more closures can be added to the end of the array. Compile all the
   // closures until we have reached the end of the "worklist".
-  const GrowableObjectArray& closures = GrowableObjectArray::Handle(zone,
-      Isolate::Current()->object_store()->closure_functions());
+  const GrowableObjectArray& closures = GrowableObjectArray::Handle(
+      zone, Isolate::Current()->object_store()->closure_functions());
   Function& func = Function::Handle(zone);
   for (int i = 0; i < closures.Length(); i++) {
     func ^= closures.At(i);
@@ -11516,7 +11437,7 @@
     CHECK_FINGERPRINT3(func, class_name, function_name, dest, fp);             \
   }
 
-#define CHECK_FINGERPRINTS2(class_name, function_name, dest, type, fp) \
+#define CHECK_FINGERPRINTS2(class_name, function_name, dest, type, fp)         \
   CHECK_FINGERPRINTS(class_name, function_name, dest, fp)
 
   all_libs.Add(&Library::ZoneHandle(Library::CoreLibrary()));
@@ -11548,8 +11469,7 @@
 #undef CHECK_FINGERPRINTS2
 
 
-
-Class& cls = Class::Handle();
+  Class& cls = Class::Handle();
 
 #define CHECK_FACTORY_FINGERPRINTS(factory_symbol, cid, fp)                    \
   cls = Isolate::Current()->class_table()->At(cid);                            \
@@ -11557,10 +11477,10 @@
   if (func.IsNull()) {                                                         \
     has_errors = true;                                                         \
     OS::Print("Function not found %s.%s\n", cls.ToCString(),                   \
-        Symbols::factory_symbol().ToCString());                                \
+              Symbols::factory_symbol().ToCString());                          \
   } else {                                                                     \
     CHECK_FINGERPRINT2(func, factory_symbol, cid, fp);                         \
-  }                                                                            \
+  }
 
   RECOGNIZED_LIST_FACTORY_LIST(CHECK_FACTORY_FINGERPRINTS);
 
@@ -11573,7 +11493,8 @@
 #endif  // defined(DART_NO_SNAPSHOT) && !defined(PRODUCT).
 
 
-RawInstructions* Instructions::New(intptr_t size) {
+RawInstructions* Instructions::New(intptr_t size, bool has_single_entry_point) {
+  ASSERT(size >= 0);
   ASSERT(Object::instructions_class() != Class::null());
   if (size < 0 || size > kMaxElements) {
     // This should be caught before we reach here.
@@ -11582,12 +11503,12 @@
   Instructions& result = Instructions::Handle();
   {
     uword aligned_size = Instructions::InstanceSize(size);
-    RawObject* raw = Object::Allocate(Instructions::kClassId,
-                                      aligned_size,
-                                      Heap::kCode);
+    RawObject* raw =
+        Object::Allocate(Instructions::kClassId, aligned_size, Heap::kCode);
     NoSafepointScope no_safepoint;
     result ^= raw;
-    result.set_size(size);
+    result.SetSize(size);
+    result.SetHasSingleEntryPoint(has_single_entry_point);
   }
   return result.raw();
 }
@@ -11599,8 +11520,7 @@
 
 
 // Encode integer |value| in SLEB128 format and store into |data|.
-static void EncodeSLEB128(GrowableArray<uint8_t>* data,
-                          intptr_t value) {
+static void EncodeSLEB128(GrowableArray<uint8_t>* data, intptr_t value) {
   bool is_last_part = false;
   while (!is_last_part) {
     uint8_t part = value & 0x7f;
@@ -11661,9 +11581,7 @@
   ObjectPool& result = ObjectPool::Handle();
   {
     uword size = ObjectPool::InstanceSize(len);
-    RawObject* raw = Object::Allocate(ObjectPool::kClassId,
-                                      size,
-                                      Heap::kOld);
+    RawObject* raw = Object::Allocate(ObjectPool::kClassId, size, Heap::kOld);
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.SetLength(len);
@@ -11702,9 +11620,8 @@
     THR_Print("  %" Pd " PP+0x%" Px ": ", i, offset);
     if (InfoAt(i) == kTaggedObject) {
       RawObject* obj = ObjectAt(i);
-      THR_Print("0x%" Px " %s (obj)\n",
-          reinterpret_cast<uword>(obj),
-          Object::Handle(obj).ToCString());
+      THR_Print("0x%" Px " %s (obj)\n", reinterpret_cast<uword>(obj),
+                Object::Handle(obj).ToCString());
     } else if (InfoAt(i) == kNativeEntry) {
       THR_Print("0x%" Px " (native entry)\n", RawValueAt(i));
     } else {
@@ -11740,9 +11657,8 @@
   PcDescriptors& result = PcDescriptors::Handle(thread->zone());
   {
     uword size = PcDescriptors::InstanceSize(data->length());
-    RawObject* raw = Object::Allocate(PcDescriptors::kClassId,
-                                      size,
-                                      Heap::kOld);
+    RawObject* raw =
+        Object::Allocate(PcDescriptors::kClassId, size, Heap::kOld);
     INC_STAT(thread, total_code_size, size);
     INC_STAT(thread, pc_desc_size, size);
     NoSafepointScope no_safepoint;
@@ -11760,9 +11676,8 @@
   PcDescriptors& result = PcDescriptors::Handle(thread->zone());
   {
     uword size = PcDescriptors::InstanceSize(length);
-    RawObject* raw = Object::Allocate(PcDescriptors::kClassId,
-                                      size,
-                                      Heap::kOld);
+    RawObject* raw =
+        Object::Allocate(PcDescriptors::kClassId, size, Heap::kOld);
     INC_STAT(thread, total_code_size, size);
     INC_STAT(thread, pc_desc_size, size);
     NoSafepointScope no_safepoint;
@@ -11775,13 +11690,21 @@
 
 const char* PcDescriptors::KindAsStr(RawPcDescriptors::Kind kind) {
   switch (kind) {
-    case RawPcDescriptors::kDeopt:           return "deopt        ";
-    case RawPcDescriptors::kIcCall:          return "ic-call      ";
-    case RawPcDescriptors::kUnoptStaticCall: return "unopt-call   ";
-    case RawPcDescriptors::kRuntimeCall:     return "runtime-call ";
-    case RawPcDescriptors::kOsrEntry:        return "osr-entry    ";
-    case RawPcDescriptors::kOther:           return "other        ";
-    case RawPcDescriptors::kAnyKind:         UNREACHABLE(); break;
+    case RawPcDescriptors::kDeopt:
+      return "deopt        ";
+    case RawPcDescriptors::kIcCall:
+      return "ic-call      ";
+    case RawPcDescriptors::kUnoptStaticCall:
+      return "unopt-call   ";
+    case RawPcDescriptors::kRuntimeCall:
+      return "runtime-call ";
+    case RawPcDescriptors::kOsrEntry:
+      return "osr-entry    ";
+    case RawPcDescriptors::kOther:
+      return "other        ";
+    case RawPcDescriptors::kAnyKind:
+      UNREACHABLE();
+      break;
   }
   UNREACHABLE();
   return "";
@@ -11793,14 +11716,13 @@
   const int addr_width = (kBitsPerWord / 4) + 2;
   // "*" in a printf format specifier tells it to read the field width from
   // the printf argument list.
-  THR_Print("%-*s\tkind    \tdeopt-id\ttok-ix\ttry-ix\n",
-            addr_width, "pc");
+  THR_Print("%-*s\tkind    \tdeopt-id\ttok-ix\ttry-ix\n", addr_width, "pc");
 }
 
 
 const char* PcDescriptors::ToCString() const {
-  // "*" in a printf format specifier tells it to read the field width from
-  // the printf argument list.
+// "*" in a printf format specifier tells it to read the field width from
+// the printf argument list.
 #define FORMAT "%#-*" Px "\t%s\t%" Pd "\t\t%s\t%" Pd "\n"
   if (Length() == 0) {
     return "empty PcDescriptors\n";
@@ -11812,12 +11734,9 @@
   {
     Iterator iter(*this, RawPcDescriptors::kAnyKind);
     while (iter.MoveNext()) {
-      len += OS::SNPrint(NULL, 0, FORMAT, addr_width,
-                         iter.PcOffset(),
-                         KindAsStr(iter.Kind()),
-                         iter.DeoptId(),
-                         iter.TokenPos().ToCString(),
-                         iter.TryIndex());
+      len += OS::SNPrint(NULL, 0, FORMAT, addr_width, iter.PcOffset(),
+                         KindAsStr(iter.Kind()), iter.DeoptId(),
+                         iter.TokenPos().ToCString(), iter.TryIndex());
     }
   }
   // Allocate the buffer.
@@ -11826,12 +11745,10 @@
   intptr_t index = 0;
   Iterator iter(*this, RawPcDescriptors::kAnyKind);
   while (iter.MoveNext()) {
-    index += OS::SNPrint((buffer + index), (len - index), FORMAT, addr_width,
-                         iter.PcOffset(),
-                         KindAsStr(iter.Kind()),
-                         iter.DeoptId(),
-                         iter.TokenPos().ToCString(),
-                         iter.TryIndex());
+    index +=
+        OS::SNPrint((buffer + index), (len - index), FORMAT, addr_width,
+                    iter.PcOffset(), KindAsStr(iter.Kind()), iter.DeoptId(),
+                    iter.TokenPos().ToCString(), iter.TryIndex());
   }
   return buffer;
 #undef FORMAT
@@ -11859,8 +11776,8 @@
   }
 
   Zone* zone = Thread::Current()->zone();
-  BitVector* deopt_ids = new(zone) BitVector(zone, max_deopt_id + 1);
-  BitVector* iccall_ids = new(zone) BitVector(zone, max_deopt_id + 1);
+  BitVector* deopt_ids = new (zone) BitVector(zone, max_deopt_id + 1);
+  BitVector* iccall_ids = new (zone) BitVector(zone, max_deopt_id + 1);
   Iterator iter(*this, RawPcDescriptors::kDeopt | RawPcDescriptors::kIcCall);
   while (iter.MoveNext()) {
     // 'deopt_id' is set for kDeopt and kIcCall and must be unique for one kind.
@@ -11882,8 +11799,7 @@
 }
 
 
-TokenPosition CodeSourceMap::TokenPositionForPCOffset(
-    uword pc_offset) const {
+TokenPosition CodeSourceMap::TokenPositionForPCOffset(uword pc_offset) const {
   Iterator iterator(*this);
 
   TokenPosition result = TokenPosition::kNoSource;
@@ -11946,19 +11862,14 @@
     current_script ^=
         code_source_map.ScriptForPCOffset(code, function, pc_offset);
     if (current_function.IsNull() || current_script.IsNull()) {
-      THR_Print("%#-*" Px "\t%s\t%s\n", addr_width,
-                pc_offset,
-                tp.ToCString(),
+      THR_Print("%#-*" Px "\t%s\t%s\n", addr_width, pc_offset, tp.ToCString(),
                 code_name);
       continue;
     }
     const String& uri = String::Handle(current_script.url());
     ASSERT(!uri.IsNull());
-    THR_Print("%#-*" Px "\t%s\t%s\t%s\n", addr_width,
-              pc_offset,
-              tp.ToCString(),
-              current_function.ToQualifiedCString(),
-              uri.ToCString());
+    THR_Print("%#-*" Px "\t%s\t%s\t%s\n", addr_width, pc_offset, tp.ToCString(),
+              current_function.ToQualifiedCString(), uri.ToCString());
   }
 }
 
@@ -11988,9 +11899,8 @@
   CodeSourceMap& result = CodeSourceMap::Handle(thread->zone());
   {
     uword size = CodeSourceMap::InstanceSize(data->length());
-    RawObject* raw = Object::Allocate(CodeSourceMap::kClassId,
-                                      size,
-                                      Heap::kOld);
+    RawObject* raw =
+        Object::Allocate(CodeSourceMap::kClassId, size, Heap::kOld);
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.SetLength(data->length());
@@ -12006,9 +11916,8 @@
   CodeSourceMap& result = CodeSourceMap::Handle(thread->zone());
   {
     uword size = CodeSourceMap::InstanceSize(length);
-    RawObject* raw = Object::Allocate(CodeSourceMap::kClassId,
-                                      size,
-                                      Heap::kOld);
+    RawObject* raw =
+        Object::Allocate(CodeSourceMap::kClassId, size, Heap::kOld);
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.SetLength(length);
@@ -12018,8 +11927,8 @@
 
 
 const char* CodeSourceMap::ToCString() const {
-  // "*" in a printf format specifier tells it to read the field width from
-  // the printf argument list.
+// "*" in a printf format specifier tells it to read the field width from
+// the printf argument list.
 #define FORMAT "%#-*" Px "\t%s\n"
   if (Length() == 0) {
     return "empty CodeSourceMap\n";
@@ -12031,8 +11940,7 @@
   {
     Iterator iter(*this);
     while (iter.MoveNext()) {
-      len += OS::SNPrint(NULL, 0, FORMAT, addr_width,
-                         iter.PcOffset(),
+      len += OS::SNPrint(NULL, 0, FORMAT, addr_width, iter.PcOffset(),
                          iter.TokenPos().ToCString());
     }
   }
@@ -12043,8 +11951,7 @@
   Iterator iter(*this);
   while (iter.MoveNext()) {
     index += OS::SNPrint((buffer + index), (len - index), FORMAT, addr_width,
-                         iter.PcOffset(),
-                         iter.TokenPos().ToCString());
+                         iter.PcOffset(), iter.TokenPos().ToCString());
   }
   return buffer;
 #undef FORMAT
@@ -12099,20 +12006,16 @@
   Stackmap& result = Stackmap::Handle();
   // Guard against integer overflow of the instance size computation.
   intptr_t length = bmap->Length();
-  intptr_t payload_size =
-      Utils::RoundUp(length, kBitsPerByte) / kBitsPerByte;
-  if ((payload_size < 0) ||
-      (payload_size > kMaxLengthInBytes)) {
+  intptr_t payload_size = Utils::RoundUp(length, kBitsPerByte) / kBitsPerByte;
+  if ((payload_size < 0) || (payload_size > kMaxLengthInBytes)) {
     // This should be caught before we reach here.
-    FATAL1("Fatal error in Stackmap::New: invalid length %" Pd "\n",
-           length);
+    FATAL1("Fatal error in Stackmap::New: invalid length %" Pd "\n", length);
   }
   {
     // Stackmap data objects are associated with a code object, allocate them
     // in old generation.
-    RawObject* raw = Object::Allocate(Stackmap::kClassId,
-                                      Stackmap::InstanceSize(length),
-                                      Heap::kOld);
+    RawObject* raw = Object::Allocate(
+        Stackmap::kClassId, Stackmap::InstanceSize(length), Heap::kOld);
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.SetLength(length);
@@ -12136,20 +12039,16 @@
   ASSERT(Object::stackmap_class() != Class::null());
   Stackmap& result = Stackmap::Handle();
   // Guard against integer overflow of the instance size computation.
-  intptr_t payload_size =
-  Utils::RoundUp(length, kBitsPerByte) / kBitsPerByte;
-  if ((payload_size < 0) ||
-      (payload_size > kMaxLengthInBytes)) {
+  intptr_t payload_size = Utils::RoundUp(length, kBitsPerByte) / kBitsPerByte;
+  if ((payload_size < 0) || (payload_size > kMaxLengthInBytes)) {
     // This should be caught before we reach here.
-    FATAL1("Fatal error in Stackmap::New: invalid length %" Pd "\n",
-           length);
+    FATAL1("Fatal error in Stackmap::New: invalid length %" Pd "\n", length);
   }
   {
     // Stackmap data objects are associated with a code object, allocate them
     // in old generation.
-    RawObject* raw = Object::Allocate(Stackmap::kClassId,
-                                      Stackmap::InstanceSize(length),
-                                      Heap::kOld);
+    RawObject* raw = Object::Allocate(
+        Stackmap::kClassId, Stackmap::InstanceSize(length), Heap::kOld);
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.SetLength(length);
@@ -12165,7 +12064,7 @@
 
 
 const char* Stackmap::ToCString() const {
-#define FORMAT "%#x: "
+#define FORMAT "%#05x: "
   if (IsNull()) {
     return "{null}";
   } else {
@@ -12215,44 +12114,36 @@
 }
 
 
-static int PrintVarInfo(char* buffer, int len,
+static int PrintVarInfo(char* buffer,
+                        int len,
                         intptr_t i,
                         const String& var_name,
                         const RawLocalVarDescriptors::VarInfo& info) {
   const RawLocalVarDescriptors::VarInfoKind kind = info.kind();
   const int32_t index = info.index();
   if (kind == RawLocalVarDescriptors::kContextLevel) {
-    return OS::SNPrint(buffer, len,
-                       "%2" Pd " %-13s level=%-3d scope=%-3d"
-                       " begin=%-3d end=%d\n",
-                       i,
-                       LocalVarDescriptors::KindToCString(kind),
-                       index,
-                       info.scope_id,
-                       static_cast<int>(info.begin_pos.Pos()),
+    return OS::SNPrint(buffer, len, "%2" Pd
+                                    " %-13s level=%-3d scope=%-3d"
+                                    " begin=%-3d end=%d\n",
+                       i, LocalVarDescriptors::KindToCString(kind), index,
+                       info.scope_id, static_cast<int>(info.begin_pos.Pos()),
                        static_cast<int>(info.end_pos.Pos()));
   } else if (kind == RawLocalVarDescriptors::kContextVar) {
-    return OS::SNPrint(buffer, len,
-                       "%2" Pd " %-13s level=%-3d index=%-3d"
-                       " begin=%-3d end=%-3d name=%s\n",
-                       i,
-                       LocalVarDescriptors::KindToCString(kind),
-                       info.scope_id,
-                       index,
-                       static_cast<int>(info.begin_pos.Pos()),
-                       static_cast<int>(info.end_pos.Pos()),
-                       var_name.ToCString());
+    return OS::SNPrint(
+        buffer, len, "%2" Pd
+                     " %-13s level=%-3d index=%-3d"
+                     " begin=%-3d end=%-3d name=%s\n",
+        i, LocalVarDescriptors::KindToCString(kind), info.scope_id, index,
+        static_cast<int>(info.begin_pos.Pos()),
+        static_cast<int>(info.end_pos.Pos()), var_name.ToCString());
   } else {
-    return OS::SNPrint(buffer, len,
-                       "%2" Pd " %-13s scope=%-3d index=%-3d"
-                       " begin=%-3d end=%-3d name=%s\n",
-                       i,
-                       LocalVarDescriptors::KindToCString(kind),
-                       info.scope_id,
-                       index,
-                       static_cast<int>(info.begin_pos.Pos()),
-                       static_cast<int>(info.end_pos.Pos()),
-                       var_name.ToCString());
+    return OS::SNPrint(
+        buffer, len, "%2" Pd
+                     " %-13s scope=%-3d index=%-3d"
+                     " begin=%-3d end=%-3d name=%s\n",
+        i, LocalVarDescriptors::KindToCString(kind), info.scope_id, index,
+        static_cast<int>(info.begin_pos.Pos()),
+        static_cast<int>(info.end_pos.Pos()), var_name.ToCString());
   }
 }
 
@@ -12279,9 +12170,8 @@
     RawLocalVarDescriptors::VarInfo info;
     var_name = GetName(i);
     GetInfo(i, &info);
-    num_chars += PrintVarInfo((buffer + num_chars),
-                              (len - num_chars),
-                              i, var_name, info);
+    num_chars += PrintVarInfo((buffer + num_chars), (len - num_chars), i,
+                              var_name, info);
   }
   return buffer;
 }
@@ -12308,16 +12198,16 @@
   ASSERT(Object::var_descriptors_class() != Class::null());
   if (num_variables < 0 || num_variables > kMaxElements) {
     // This should be caught before we reach here.
-    FATAL2("Fatal error in LocalVarDescriptors::New: "
-           "invalid num_variables %" Pd ". Maximum is: %d\n",
-           num_variables, RawLocalVarDescriptors::kMaxIndex);
+    FATAL2(
+        "Fatal error in LocalVarDescriptors::New: "
+        "invalid num_variables %" Pd ". Maximum is: %d\n",
+        num_variables, RawLocalVarDescriptors::kMaxIndex);
   }
   LocalVarDescriptors& result = LocalVarDescriptors::Handle();
   {
     uword size = LocalVarDescriptors::InstanceSize(num_variables);
-    RawObject* raw = Object::Allocate(LocalVarDescriptors::kClassId,
-                                      size,
-                                      Heap::kOld);
+    RawObject* raw =
+        Object::Allocate(LocalVarDescriptors::kClassId, size, Heap::kOld);
     INC_STAT(Thread::Current(), total_code_size, size);
     INC_STAT(Thread::Current(), vardesc_size, size);
     NoSafepointScope no_safepoint;
@@ -12416,23 +12306,23 @@
 RawExceptionHandlers* ExceptionHandlers::New(intptr_t num_handlers) {
   ASSERT(Object::exception_handlers_class() != Class::null());
   if ((num_handlers < 0) || (num_handlers >= kMaxHandlers)) {
-    FATAL1("Fatal error in ExceptionHandlers::New(): "
-           "invalid num_handlers %" Pd "\n",
-           num_handlers);
+    FATAL1(
+        "Fatal error in ExceptionHandlers::New(): "
+        "invalid num_handlers %" Pd "\n",
+        num_handlers);
   }
   ExceptionHandlers& result = ExceptionHandlers::Handle();
   {
     uword size = ExceptionHandlers::InstanceSize(num_handlers);
-    RawObject* raw = Object::Allocate(ExceptionHandlers::kClassId,
-                                      size,
-                                      Heap::kOld);
+    RawObject* raw =
+        Object::Allocate(ExceptionHandlers::kClassId, size, Heap::kOld);
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.StoreNonPointer(&result.raw_ptr()->num_entries_, num_handlers);
   }
-  const Array& handled_types_data = (num_handlers == 0) ?
-      Object::empty_array() :
-      Array::Handle(Array::New(num_handlers, Heap::kOld));
+  const Array& handled_types_data =
+      (num_handlers == 0) ? Object::empty_array()
+                          : Array::Handle(Array::New(num_handlers, Heap::kOld));
   result.set_handled_types_data(handled_types_data);
   return result.raw();
 }
@@ -12442,16 +12332,16 @@
   ASSERT(Object::exception_handlers_class() != Class::null());
   const intptr_t num_handlers = handled_types_data.Length();
   if ((num_handlers < 0) || (num_handlers >= kMaxHandlers)) {
-    FATAL1("Fatal error in ExceptionHandlers::New(): "
-           "invalid num_handlers %" Pd "\n",
-           num_handlers);
+    FATAL1(
+        "Fatal error in ExceptionHandlers::New(): "
+        "invalid num_handlers %" Pd "\n",
+        num_handlers);
   }
   ExceptionHandlers& result = ExceptionHandlers::Handle();
   {
     uword size = ExceptionHandlers::InstanceSize(num_handlers);
-    RawObject* raw = Object::Allocate(ExceptionHandlers::kClassId,
-                                      size,
-                                      Heap::kOld);
+    RawObject* raw =
+        Object::Allocate(ExceptionHandlers::kClassId, size, Heap::kOld);
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.StoreNonPointer(&result.raw_ptr()->num_entries_, num_handlers);
@@ -12477,10 +12367,7 @@
     handled_types = GetHandledTypes(i);
     const intptr_t num_types =
         handled_types.IsNull() ? 0 : handled_types.Length();
-    len += OS::SNPrint(NULL, 0, FORMAT1,
-                       i,
-                       info.handler_pc_offset,
-                       num_types,
+    len += OS::SNPrint(NULL, 0, FORMAT1, i, info.handler_pc_offset, num_types,
                        info.outer_try_index);
     for (int k = 0; k < num_types; k++) {
       type ^= handled_types.At(k);
@@ -12497,18 +12384,13 @@
     handled_types = GetHandledTypes(i);
     const intptr_t num_types =
         handled_types.IsNull() ? 0 : handled_types.Length();
-    num_chars += OS::SNPrint((buffer + num_chars),
-                             (len - num_chars),
-                             FORMAT1,
-                             i,
-                             info.handler_pc_offset,
-                             num_types,
-                             info.outer_try_index);
+    num_chars +=
+        OS::SNPrint((buffer + num_chars), (len - num_chars), FORMAT1, i,
+                    info.handler_pc_offset, num_types, info.outer_try_index);
     for (int k = 0; k < num_types; k++) {
       type ^= handled_types.At(k);
-      num_chars += OS::SNPrint((buffer + num_chars),
-                               (len - num_chars),
-                               FORMAT2, k, type.ToCString());
+      num_chars += OS::SNPrint((buffer + num_chars), (len - num_chars), FORMAT2,
+                               k, type.ToCString());
     }
   }
   return buffer;
@@ -12555,13 +12437,12 @@
     TypedData& suffix = TypedData::Handle();
     Smi& offset = Smi::Handle();
     Smi& reason_and_flags = Smi::Handle();
-    DeoptTable::GetEntry(
-      table, info_number, &offset, &suffix, &reason_and_flags);
+    DeoptTable::GetEntry(table, info_number, &offset, &suffix,
+                         &reason_and_flags);
     UnpackInto(table, suffix, unpacked, suffix_length);
   }
 
-  while ((read_stream.PendingBytes() > 0) &&
-         (unpacked->length() < length)) {
+  while ((read_stream.PendingBytes() > 0) && (unpacked->length() < length)) {
     const intptr_t instruction = Reader::Read(&read_stream);
     const intptr_t from_index = Reader::Read(&read_stream);
     unpacked->Add(DeoptInstr::Create(instruction, from_index));
@@ -12600,9 +12481,7 @@
   // Layout the fields in the buffer.
   intptr_t index = 0;
   for (intptr_t i = 0; i < deopt_instrs.length(); i++) {
-    index += OS::SNPrint((buffer + index),
-                         (len - index),
-                         FORMAT,
+    index += OS::SNPrint((buffer + index), (len - index), FORMAT,
                          deopt_instrs[i]->ToCString());
   }
 
@@ -12639,9 +12518,9 @@
   SingleTargetCache& result = SingleTargetCache::Handle();
   {
     // IC data objects are long living objects, allocate them in old generation.
-    RawObject* raw = Object::Allocate(SingleTargetCache::kClassId,
-                                      SingleTargetCache::InstanceSize(),
-                                      Heap::kOld);
+    RawObject* raw =
+        Object::Allocate(SingleTargetCache::kClassId,
+                         SingleTargetCache::InstanceSize(), Heap::kOld);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -12670,8 +12549,7 @@
 
 RawUnlinkedCall* UnlinkedCall::New() {
   RawObject* raw = Object::Allocate(UnlinkedCall::kClassId,
-                                    UnlinkedCall::InstanceSize(),
-                                    Heap::kOld);
+                                    UnlinkedCall::InstanceSize(), Heap::kOld);
   return reinterpret_cast<RawUnlinkedCall*>(raw);
 }
 
@@ -12687,8 +12565,8 @@
   const intptr_t num_args = NumArgsTested();
   const intptr_t num_checks = NumberOfChecks();
   return OS::SCreate(Thread::Current()->zone(),
-      "ICData target:'%s' num-args: %" Pd " num-checks: %" Pd "",
-      name.ToCString(), num_args, num_checks);
+                     "ICData target:'%s' num-args: %" Pd " num-checks: %" Pd "",
+                     name.ToCString(), num_args, num_checks);
 }
 
 
@@ -12944,8 +12822,8 @@
   GrowableArray<intptr_t> class_ids(2);
   Function& target = Function::Handle();
   GetCheckAt(0, &class_ids, &target);
-  if ((target.raw() == smi_op_target.raw()) &&
-      (class_ids[0] == kSmiCid) && (class_ids[1] == kSmiCid)) {
+  if ((target.raw() == smi_op_target.raw()) && (class_ids[0] == kSmiCid) &&
+      (class_ids[1] == kSmiCid)) {
     // The smi fast path case, preserve the initial entry but reset the count.
     ClearCountAt(0);
     return;
@@ -13020,8 +12898,8 @@
     GrowableArray<intptr_t> class_ids(2);
     Function& target = Function::Handle();
     GetCheckAt(0, &class_ids, &target);
-    if ((target.raw() == smi_op_target.raw()) &&
-        (class_ids[0] == kSmiCid) && (class_ids[1] == kSmiCid)) {
+    if ((target.raw() == smi_op_target.raw()) && (class_ids[0] == kSmiCid) &&
+        (class_ids[1] == kSmiCid)) {
       is_smi_two_args_op = true;
     }
   }
@@ -13334,8 +13212,8 @@
   ASSERT(value <= Smi::kMaxValue);
 
   const Array& data = Array::Handle(ic_data());
-  const intptr_t data_pos = index * TestEntryLength() +
-      CountIndexFor(NumArgsTested());
+  const intptr_t data_pos =
+      index * TestEntryLength() + CountIndexFor(NumArgsTested());
   data.SetAt(data_pos, Smi::Handle(Smi::New(value)));
 }
 
@@ -13343,8 +13221,8 @@
 intptr_t ICData::GetCountAt(intptr_t index) const {
   ASSERT(Isolate::Current()->compilation_allowed());
   const Array& data = Array::Handle(ic_data());
-  const intptr_t data_pos = index * TestEntryLength() +
-      CountIndexFor(NumArgsTested());
+  const intptr_t data_pos =
+      index * TestEntryLength() + CountIndexFor(NumArgsTested());
   return Smi::Value(Smi::RawCast(data.At(data_pos)));
 }
 
@@ -13363,8 +13241,8 @@
 void ICData::SetCodeAt(intptr_t index, const Code& value) const {
   ASSERT(!Isolate::Current()->compilation_allowed());
   const Array& data = Array::Handle(ic_data());
-  const intptr_t data_pos = index * TestEntryLength() +
-      CodeIndexFor(NumArgsTested());
+  const intptr_t data_pos =
+      index * TestEntryLength() + CodeIndexFor(NumArgsTested());
   data.SetAt(data_pos, value);
 }
 
@@ -13372,8 +13250,8 @@
 void ICData::SetEntryPointAt(intptr_t index, const Smi& value) const {
   ASSERT(!Isolate::Current()->compilation_allowed());
   const Array& data = Array::Handle(ic_data());
-  const intptr_t data_pos = index * TestEntryLength() +
-      EntryPointIndexFor(NumArgsTested());
+  const intptr_t data_pos =
+      index * TestEntryLength() + EntryPointIndexFor(NumArgsTested());
   data.SetAt(data_pos, value);
 }
 
@@ -13389,8 +13267,8 @@
 }
 
 
-RawICData* ICData::AsUnaryClassChecksForCid(
-    intptr_t cid, const Function& target) const {
+RawICData* ICData::AsUnaryClassChecksForCid(intptr_t cid,
+                                            const Function& target) const {
   ASSERT(!IsNull());
   const intptr_t kNumArgsTested = 1;
   ICData& result = ICData::Handle(ICData::NewFrom(*this, kNumArgsTested));
@@ -13432,8 +13310,7 @@
       result.IncrementCountAt(duplicate_class_id, count);
     } else {
       // This will make sure that Smi is first if it exists.
-      result.AddReceiverCheck(class_id,
-                              Function::Handle(GetTargetAt(i)),
+      result.AddReceiverCheck(class_id, Function::Handle(GetTargetAt(i)),
                               count);
     }
   }
@@ -13487,8 +13364,8 @@
       }
     }
     if (!found) {
-      aggregate.Add(CidCount(class_id, count,
-                             &Function::ZoneHandle(GetTargetAt(i))));
+      aggregate.Add(
+          CidCount(class_id, count, &Function::ZoneHandle(GetTargetAt(i))));
     }
   }
   aggregate.Sort(CidCount::HighestCountFirst);
@@ -13496,8 +13373,7 @@
   ICData& result = ICData::Handle(ICData::NewFrom(*this, kNumArgsTested));
   ASSERT(result.NumberOfChecks() == 0);
   // Room for all entries and the sentinel.
-  const intptr_t data_len =
-      result.TestEntryLength() * (aggregate.length() + 1);
+  const intptr_t data_len = result.TestEntryLength() * (aggregate.length() + 1);
   // Allocate the array but do not assign it to result until we have populated
   // it with the aggregate data and the terminating sentinel.
   const Array& data = Array::Handle(Array::New(data_len, Heap::kOld));
@@ -13506,7 +13382,7 @@
     data.SetAt(pos + 0, Smi::Handle(Smi::New(aggregate[i].cid)));
     data.SetAt(pos + TargetIndexFor(1), *aggregate[i].function);
     data.SetAt(pos + CountIndexFor(1),
-        Smi::Handle(Smi::New(aggregate[i].count)));
+               Smi::Handle(Smi::New(aggregate[i].count)));
 
     pos += result.TestEntryLength();
   }
@@ -13636,7 +13512,6 @@
 }
 
 
-
 // Does not initialize ICData array.
 RawICData* ICData::NewDescriptor(Zone* zone,
                                  const Function& owner,
@@ -13653,9 +13528,8 @@
   ICData& result = ICData::Handle(zone);
   {
     // IC data objects are long living objects, allocate them in old generation.
-    RawObject* raw = Object::Allocate(ICData::kClassId,
-                                      ICData::InstanceSize(),
-                                      Heap::kOld);
+    RawObject* raw =
+        Object::Allocate(ICData::kClassId, ICData::InstanceSize(), Heap::kOld);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -13683,9 +13557,8 @@
   ICData& result = ICData::Handle();
   {
     // IC data objects are long living objects, allocate them in old generation.
-    RawObject* raw = Object::Allocate(ICData::kClassId,
-                                      ICData::InstanceSize(),
-                                      Heap::kOld);
+    RawObject* raw =
+        Object::Allocate(ICData::kClassId, ICData::InstanceSize(), Heap::kOld);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -13705,14 +13578,9 @@
                        intptr_t num_args_tested,
                        bool is_static_call) {
   Zone* zone = Thread::Current()->zone();
-  const ICData& result = ICData::Handle(zone,
-                                        NewDescriptor(zone,
-                                                      owner,
-                                                      target_name,
-                                                      arguments_descriptor,
-                                                      deopt_id,
-                                                      num_args_tested,
-                                                      is_static_call));
+  const ICData& result = ICData::Handle(
+      zone, NewDescriptor(zone, owner, target_name, arguments_descriptor,
+                          deopt_id, num_args_tested, is_static_call));
   result.set_ic_data_array(
       Array::Handle(zone, CachedEmptyICDataArray(num_args_tested)));
   return result.raw();
@@ -13721,12 +13589,9 @@
 
 RawICData* ICData::NewFrom(const ICData& from, intptr_t num_args_tested) {
   const ICData& result = ICData::Handle(ICData::New(
-      Function::Handle(from.Owner()),
-      String::Handle(from.target_name()),
-      Array::Handle(from.arguments_descriptor()),
-      from.deopt_id(),
-      num_args_tested,
-      from.is_static_call()));
+      Function::Handle(from.Owner()), String::Handle(from.target_name()),
+      Array::Handle(from.arguments_descriptor()), from.deopt_id(),
+      num_args_tested, from.is_static_call()));
   // Copy deoptimization reasons.
   result.SetDeoptReasons(from.DeoptReasons());
   return result.raw();
@@ -13736,18 +13601,14 @@
 RawICData* ICData::Clone(const ICData& from) {
   Zone* zone = Thread::Current()->zone();
   const ICData& result = ICData::Handle(ICData::NewDescriptor(
-      zone,
-      Function::Handle(zone, from.Owner()),
+      zone, Function::Handle(zone, from.Owner()),
       String::Handle(zone, from.target_name()),
-      Array::Handle(zone, from.arguments_descriptor()),
-      from.deopt_id(),
-      from.NumArgsTested(),
-      from.is_static_call()));
+      Array::Handle(zone, from.arguments_descriptor()), from.deopt_id(),
+      from.NumArgsTested(), from.is_static_call()));
   // Clone entry array.
   const Array& from_array = Array::Handle(zone, from.ic_data());
   const intptr_t len = from_array.Length();
-  const Array& cloned_array =
-      Array::Handle(zone, Array::New(len, Heap::kOld));
+  const Array& cloned_array = Array::Handle(zone, Array::New(len, Heap::kOld));
   Object& obj = Object::Handle(zone);
   for (intptr_t i = 0; i < len; i++) {
     obj = from_array.At(i);
@@ -13787,12 +13648,12 @@
 
 
 intptr_t Code::Comments::PCOffsetAt(intptr_t idx) const {
-  return Smi::Value(Smi::RawCast(
-      comments_.At(idx * kNumberOfEntries + kPCOffsetEntry)));
+  return Smi::Value(
+      Smi::RawCast(comments_.At(idx * kNumberOfEntries + kPCOffsetEntry)));
 }
 
 
-void Code::Comments::SetPCOffsetAt(intptr_t idx, intptr_t pc)  {
+void Code::Comments::SetPCOffsetAt(intptr_t idx, intptr_t pc) {
   comments_.SetAt(idx * kNumberOfEntries + kPCOffsetEntry,
                   Smi::Handle(Smi::New(pc)));
 }
@@ -13808,9 +13669,7 @@
 }
 
 
-Code::Comments::Comments(const Array& comments)
-    : comments_(comments) {
-}
+Code::Comments::Comments(const Array& comments) : comments_(comments) {}
 
 
 RawLocalVarDescriptors* Code::GetLocalVarDescriptors() const {
@@ -13818,6 +13677,9 @@
   if (v.IsNull()) {
     ASSERT(!is_optimized());
     const Function& f = Function::Handle(function());
+    if (f.kernel_function() != NULL) {
+      return v.raw();
+    }
     ASSERT(!f.IsIrregexpFunction());  // Not yet implemented.
     Compiler::ComputeLocalVarDescriptors(*this);
   }
@@ -13843,8 +13705,7 @@
 void Code::set_stackmaps(const Array& maps) const {
   ASSERT(maps.IsOld());
   StorePointer(&raw_ptr()->stackmaps_, maps.raw());
-  INC_STAT(Thread::Current(),
-           total_code_size,
+  INC_STAT(Thread::Current(), total_code_size,
            maps.IsNull() ? 0 : maps.Length() * sizeof(uword));
 }
 
@@ -13870,9 +13731,8 @@
   // FlowGraphCompiler::AddStaticCallTarget adds pc-offsets to the table while
   // emitting assembly. This guarantees that every succeeding pc-offset is
   // larger than the previously added one.
-  for (intptr_t i = kSCallTableEntryLength;
-      i < value.Length();
-      i += kSCallTableEntryLength) {
+  for (intptr_t i = kSCallTableEntryLength; i < value.Length();
+       i += kSCallTableEntryLength) {
     ASSERT(value.At(i - kSCallTableEntryLength) < value.At(i));
   }
 #endif  // DEBUG
@@ -13961,8 +13821,7 @@
   if (i < 0) {
     return Function::null();
   }
-  const Array& array =
-      Array::Handle(raw_ptr()->static_calls_target_table_);
+  const Array& array = Array::Handle(raw_ptr()->static_calls_target_table_);
   Function& function = Function::Handle();
   function ^= array.At(i + kSCallTableFunctionEntry);
   return function.raw();
@@ -13979,8 +13838,7 @@
   if (i < 0) {
     return Code::null();
   }
-  const Array& array =
-      Array::Handle(raw_ptr()->static_calls_target_table_);
+  const Array& array = Array::Handle(raw_ptr()->static_calls_target_table_);
   Code& code = Code::Handle();
   code ^= array.At(i + kSCallTableCodeEntry);
   return code.raw();
@@ -13994,8 +13852,7 @@
 #else
   const intptr_t i = BinarySearchInSCallTable(pc);
   ASSERT(i >= 0);
-  const Array& array =
-      Array::Handle(raw_ptr()->static_calls_target_table_);
+  const Array& array = Array::Handle(raw_ptr()->static_calls_target_table_);
   ASSERT(code.IsNull() ||
          (code.function() == array.At(i + kSCallTableFunctionEntry)));
   array.SetAt(i + kSCallTableCodeEntry, code);
@@ -14009,8 +13866,7 @@
 #else
   const intptr_t i = BinarySearchInSCallTable(pc);
   ASSERT(i >= 0);
-  const Array& array =
-      Array::Handle(raw_ptr()->static_calls_target_table_);
+  const Array& array = Array::Handle(raw_ptr()->static_calls_target_table_);
 #if defined(DEBUG)
   if (array.At(i + kSCallTableFunctionEntry) == Function::null()) {
     ASSERT(!code.IsNull() && Object::Handle(code.owner()).IsClass());
@@ -14032,15 +13888,15 @@
   const Instructions& instr = Instructions::Handle(instructions());
   uword start = instr.PayloadStart();
   if (formatter == NULL) {
-    Disassembler::Disassemble(start, start + instr.size(), *this);
+    Disassembler::Disassemble(start, start + instr.Size(), *this);
   } else {
-    Disassembler::Disassemble(start, start + instr.size(), formatter, *this);
+    Disassembler::Disassemble(start, start + instr.Size(), formatter, *this);
   }
 #endif
 }
 
 
-const Code::Comments& Code::comments() const  {
+const Code::Comments& Code::comments() const {
 #if defined(DART_PRECOMPILED_RUNTIME)
   Comments* comments = new Code::Comments(Array::Handle());
 #else
@@ -14066,7 +13922,7 @@
 #else
   ASSERT(offset >= 0);
   StoreSmi(
-      reinterpret_cast<RawSmi* const *>(&raw_ptr()->return_address_metadata_),
+      reinterpret_cast<RawSmi* const*>(&raw_ptr()->return_address_metadata_),
       Smi::New(offset));
 #endif
 }
@@ -14229,8 +14085,6 @@
     result.set_is_alive(false);
     result.set_comments(Comments::New(0));
     result.set_compile_timestamp(0);
-    result.set_lazy_deopt_return_pc_offset(kInvalidPc);
-    result.set_lazy_deopt_throw_pc_offset(kInvalidPc);
     result.set_pc_descriptors(Object::empty_descriptors());
   }
   return result.raw();
@@ -14257,24 +14111,22 @@
 #ifdef TARGET_ARCH_IA32
   assembler->set_code_object(code);
 #endif
-  Instructions& instrs =
-      Instructions::ZoneHandle(Instructions::New(assembler->CodeSize()));
+  Instructions& instrs = Instructions::ZoneHandle(Instructions::New(
+      assembler->CodeSize(), assembler->has_single_entry_point()));
   INC_STAT(Thread::Current(), total_instr_size, assembler->CodeSize());
   INC_STAT(Thread::Current(), total_code_size, assembler->CodeSize());
 
   // Copy the instructions into the instruction area and apply all fixups.
   // Embedded pointers are still in handles at this point.
   MemoryRegion region(reinterpret_cast<void*>(instrs.PayloadStart()),
-                      instrs.size());
+                      instrs.Size());
   assembler->FinalizeInstructions(region);
-  CPU::FlushICache(instrs.PayloadStart(), instrs.size());
+  CPU::FlushICache(instrs.PayloadStart(), instrs.Size());
 
   code.set_compile_timestamp(OS::GetCurrentMonotonicMicros());
 #ifndef PRODUCT
-  CodeObservers::NotifyAll(name,
-                           instrs.PayloadStart(),
-                           assembler->prologue_offset(),
-                           instrs.size(),
+  CodeObservers::NotifyAll(name, instrs.PayloadStart(),
+                           assembler->prologue_offset(), instrs.Size(),
                            optimized);
 #endif
   {
@@ -14296,21 +14148,20 @@
     }
 
     // Hook up Code and Instructions objects.
-    code.SetActiveInstructions(instrs.raw());
-    code.set_instructions(instrs.raw());
+    code.SetActiveInstructions(instrs);
+    code.set_instructions(instrs);
     code.set_is_alive(true);
 
     // Set object pool in Instructions object.
-    INC_STAT(Thread::Current(),
-             total_code_size, object_pool.Length() * sizeof(uintptr_t));
+    INC_STAT(Thread::Current(), total_code_size,
+             object_pool.Length() * sizeof(uintptr_t));
     code.set_object_pool(object_pool.raw());
 
     if (FLAG_write_protect_code) {
       uword address = RawObject::ToAddr(instrs.raw());
-      bool status = VirtualMemory::Protect(
-          reinterpret_cast<void*>(address),
-          instrs.raw()->Size(),
-          VirtualMemory::kReadExecute);
+      bool status = VirtualMemory::Protect(reinterpret_cast<void*>(address),
+                                           instrs.raw()->Size(),
+                                           VirtualMemory::kReadExecute);
       ASSERT(status);
     }
   }
@@ -14322,8 +14173,8 @@
     // pushed onto the stack.
     code.SetPrologueOffset(assembler->CodeSize());
   }
-  INC_STAT(Thread::Current(),
-           total_code_size, code.comments().comments_.Length());
+  INC_STAT(Thread::Current(), total_code_size,
+           code.comments().comments_.Length());
   return code.raw();
 }
 
@@ -14331,12 +14182,11 @@
 RawCode* Code::FinalizeCode(const Function& function,
                             Assembler* assembler,
                             bool optimized) {
-  // Calling ToLibNamePrefixedQualifiedCString is very expensive,
-  // try to avoid it.
+// Calling ToLibNamePrefixedQualifiedCString is very expensive,
+// try to avoid it.
 #ifndef PRODUCT
   if (CodeObservers::AreActive()) {
-    return FinalizeCode(function.ToLibNamePrefixedQualifiedCString(),
-                        assembler,
+    return FinalizeCode(function.ToLibNamePrefixedQualifiedCString(), assembler,
                         optimized);
   }
 #endif  // !PRODUCT
@@ -14453,9 +14303,7 @@
     Zone* zone = thread->zone();
     const char* name = StubCode::NameOfStub(UncheckedEntryPoint());
     ASSERT(name != NULL);
-    char* stub_name = OS::SCreate(zone,
-        "%s%s", Symbols::StubPrefix().ToCString(), name);
-    return stub_name;
+    return OS::SCreate(zone, "[Stub] %s", name);
   } else if (obj.IsClass()) {
     // Allocation stub.
     Thread* thread = Thread::Current();
@@ -14463,9 +14311,7 @@
     const Class& cls = Class::Cast(obj);
     String& cls_name = String::Handle(zone, cls.ScrubbedName());
     ASSERT(!cls_name.IsNull());
-    char* stub_name = OS::SCreate(zone,
-        "%s%s", Symbols::AllocationStubFor().ToCString(), cls_name.ToCString());
-    return stub_name;
+    return OS::SCreate(zone, "[Stub] Allocate %s", cls_name.ToCString());
   } else {
     ASSERT(obj.IsFunction());
     // Dart function.
@@ -14478,8 +14324,8 @@
 const char* Code::QualifiedName() const {
   const Object& obj = Object::Handle(owner());
   if (obj.IsFunction()) {
-    return String::Handle(
-        Function::Cast(obj).QualifiedScrubbedName()).ToCString();
+    return String::Handle(Function::Cast(obj).QualifiedScrubbedName())
+        .ToCString();
   }
   return Name();
 }
@@ -14509,7 +14355,7 @@
   ASSERT(instructions() == active_instructions());
   const Code& new_code =
       Code::Handle(StubCode::FixCallersTarget_entry()->code());
-  SetActiveInstructions(new_code.instructions());
+  SetActiveInstructions(Instructions::Handle(new_code.instructions()));
 }
 
 
@@ -14520,7 +14366,7 @@
   ASSERT(instructions() == active_instructions());
   const Code& new_code =
       Code::Handle(StubCode::FixAllocationStubTarget_entry()->code());
-  SetActiveInstructions(new_code.instructions());
+  SetActiveInstructions(Instructions::Handle(new_code.instructions()));
 #else
   // DBC does not use allocation stubs.
   UNIMPLEMENTED();
@@ -14528,36 +14374,25 @@
 }
 
 
-void Code::SetActiveInstructions(RawInstructions* instructions) const {
+void Code::SetActiveInstructions(const Instructions& instructions) const {
 #if defined(DART_PRECOMPILED_RUNTIME)
   UNREACHABLE();
 #else
   DEBUG_ASSERT(IsMutatorOrAtSafepoint() || !is_alive());
   // RawInstructions are never allocated in New space and hence a
   // store buffer update is not needed here.
-  StorePointer(&raw_ptr()->active_instructions_, instructions);
+  StorePointer(&raw_ptr()->active_instructions_, instructions.raw());
   StoreNonPointer(&raw_ptr()->entry_point_,
-                  Instructions::UncheckedEntryPoint(instructions));
+                  Instructions::UncheckedEntryPoint(instructions.raw()));
   StoreNonPointer(&raw_ptr()->checked_entry_point_,
-                  Instructions::CheckedEntryPoint(instructions));
+                  Instructions::CheckedEntryPoint(instructions.raw()));
 #endif
 }
 
 
-uword Code::GetLazyDeoptReturnPc() const {
-  return (lazy_deopt_return_pc_offset() != kInvalidPc)
-      ? PayloadStart() + lazy_deopt_return_pc_offset() : 0;
-}
-
-
-uword Code::GetLazyDeoptThrowPc() const {
-  return (lazy_deopt_throw_pc_offset() != kInvalidPc)
-      ? PayloadStart() + lazy_deopt_throw_pc_offset() : 0;
-}
-
-
-RawStackmap* Code::GetStackmap(
-    uint32_t pc_offset, Array* maps, Stackmap* map) const {
+RawStackmap* Code::GetStackmap(uint32_t pc_offset,
+                               Array* maps,
+                               Stackmap* map) const {
   // This code is used during iterating frames during a GC and hence it
   // should not in turn start a GC.
   NoSafepointScope no_safepoint;
@@ -14577,7 +14412,12 @@
       return map->raw();  // We found a stack map for this frame.
     }
   }
-  ASSERT(!is_optimized());
+  // If we are missing a stack map, this must either be unoptimized code, or
+  // the entry to an osr function. (In which case all stack slots are
+  // considered to have tagged pointers.)
+  // Running with --verify-on-transition should hit this.
+  ASSERT(!is_optimized() ||
+         (pc_offset == UncheckedEntryPoint() - PayloadStart()));
   return Stackmap::null();
 }
 
@@ -14673,7 +14513,7 @@
       THR_Print("  %s <-", name);
     }
     if (inlined_functions[inlined_functions.length() - 1]->raw() !=
-           inliner.raw()) {
+        inliner.raw()) {
       THR_Print(" (ERROR, missing inliner)\n");
     } else {
       THR_Print("\n");
@@ -14716,9 +14556,8 @@
   }
   Context& result = Context::Handle();
   {
-    RawObject* raw = Object::Allocate(Context::kClassId,
-                                      Context::InstanceSize(num_variables),
-                                      space);
+    RawObject* raw = Object::Allocate(
+        Context::kClassId, Context::InstanceSize(num_variables), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.set_num_variables(num_variables);
@@ -14738,9 +14577,8 @@
                                num_variables());
   } else {
     const char* parent_str = parent_ctx.ToCString();
-    return zone->PrintToString(
-        "Context num_variables: %" Pd " parent:{ %s }",
-        num_variables(), parent_str);
+    return zone->PrintToString("Context num_variables: %" Pd " parent:{ %s }",
+                               num_variables(), parent_str);
   }
 }
 
@@ -14792,9 +14630,7 @@
   intptr_t size = ContextScope::InstanceSize(num_variables);
   ContextScope& result = ContextScope::Handle();
   {
-    RawObject* raw = Object::Allocate(ContextScope::kClassId,
-                                      size,
-                                      Heap::kOld);
+    RawObject* raw = Object::Allocate(ContextScope::kClassId, size, Heap::kOld);
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.set_num_variables(num_variables);
@@ -14816,6 +14652,21 @@
 }
 
 
+TokenPosition ContextScope::DeclarationTokenIndexAt(
+    intptr_t scope_index) const {
+  return TokenPosition(
+      Smi::Value(VariableDescAddr(scope_index)->declaration_token_pos));
+}
+
+
+void ContextScope::SetDeclarationTokenIndexAt(
+    intptr_t scope_index,
+    TokenPosition declaration_token_pos) const {
+  StoreSmi(&VariableDescAddr(scope_index)->declaration_token_pos,
+           Smi::New(declaration_token_pos.value()));
+}
+
+
 RawString* ContextScope::NameAt(intptr_t scope_index) const {
   return VariableDescAddr(scope_index)->name;
 }
@@ -14854,8 +14705,8 @@
 }
 
 
-void ContextScope::SetTypeAt(
-    intptr_t scope_index, const AbstractType& type) const {
+void ContextScope::SetTypeAt(intptr_t scope_index,
+                             const AbstractType& type) const {
   StorePointer(&(VariableDescAddr(scope_index)->type), type.raw());
 }
 
@@ -14866,8 +14717,8 @@
 }
 
 
-void ContextScope::SetConstValueAt(
-    intptr_t scope_index, const Instance& value) const {
+void ContextScope::SetConstValueAt(intptr_t scope_index,
+                                   const Instance& value) const {
   ASSERT(IsConstAt(scope_index));
   StorePointer(&(VariableDescAddr(scope_index)->value), value.raw());
 }
@@ -14906,9 +14757,10 @@
     TokenPosition pos = TokenIndexAt(i);
     intptr_t idx = ContextIndexAt(i);
     intptr_t lvl = ContextLevelAt(i);
-    char* chars = OS::SCreate(Thread::Current()->zone(),
-        "%s\nvar %s  token-pos %s  ctx lvl %" Pd "  index %" Pd "",
-        prev_cstr, cname, pos.ToCString(), lvl, idx);
+    char* chars =
+        OS::SCreate(Thread::Current()->zone(),
+                    "%s\nvar %s  token-pos %s  ctx lvl %" Pd "  index %" Pd "",
+                    prev_cstr, cname, pos.ToCString(), lvl, idx);
     prev_cstr = chars;
   }
   return prev_cstr;
@@ -14960,9 +14812,10 @@
 
 RawMegamorphicCache* MegamorphicCache::New() {
   MegamorphicCache& result = MegamorphicCache::Handle();
-  { RawObject* raw = Object::Allocate(MegamorphicCache::kClassId,
-                                      MegamorphicCache::InstanceSize(),
-                                      Heap::kOld);
+  {
+    RawObject* raw =
+        Object::Allocate(MegamorphicCache::kClassId,
+                         MegamorphicCache::InstanceSize(), Heap::kOld);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -14974,17 +14827,18 @@
 RawMegamorphicCache* MegamorphicCache::New(const String& target_name,
                                            const Array& arguments_descriptor) {
   MegamorphicCache& result = MegamorphicCache::Handle();
-  { RawObject* raw = Object::Allocate(MegamorphicCache::kClassId,
-                                      MegamorphicCache::InstanceSize(),
-                                      Heap::kOld);
+  {
+    RawObject* raw =
+        Object::Allocate(MegamorphicCache::kClassId,
+                         MegamorphicCache::InstanceSize(), Heap::kOld);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
   const intptr_t capacity = kInitialCapacity;
-  const Array& buckets = Array::Handle(
-      Array::New(kEntryLength * capacity, Heap::kOld));
-  const Function& handler = Function::Handle(
-      MegamorphicCacheTable::miss_handler(Isolate::Current()));
+  const Array& buckets =
+      Array::Handle(Array::New(kEntryLength * capacity, Heap::kOld));
+  const Function& handler =
+      Function::Handle(MegamorphicCacheTable::miss_handler(Isolate::Current()));
   for (intptr_t i = 0; i < capacity; ++i) {
     SetEntry(buckets, i, smi_illegal_cid(), handler);
   }
@@ -15050,8 +14904,8 @@
 
 const char* MegamorphicCache::ToCString() const {
   const String& name = String::Handle(target_name());
-  return OS::SCreate(Thread::Current()->zone(),
-                     "MegamorphicCache(%s)", name.ToCString());
+  return OS::SCreate(Thread::Current()->zone(), "MegamorphicCache(%s)",
+                     name.ToCString());
 }
 
 
@@ -15061,9 +14915,9 @@
   {
     // SubtypeTestCache objects are long living objects, allocate them in the
     // old generation.
-    RawObject* raw = Object::Allocate(SubtypeTestCache::kClassId,
-                                      SubtypeTestCache::InstanceSize(),
-                                      Heap::kOld);
+    RawObject* raw =
+        Object::Allocate(SubtypeTestCache::kClassId,
+                         SubtypeTestCache::InstanceSize(), Heap::kOld);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -15142,8 +14996,7 @@
 RawApiError* ApiError::New() {
   ASSERT(Object::api_error_class() != Class::null());
   RawObject* raw = Object::Allocate(ApiError::kClassId,
-                                    ApiError::InstanceSize(),
-                                    Heap::kOld);
+                                    ApiError::InstanceSize(), Heap::kOld);
   return reinterpret_cast<RawApiError*>(raw);
 }
 
@@ -15152,9 +15005,8 @@
   ASSERT(Object::api_error_class() != Class::null());
   ApiError& result = ApiError::Handle();
   {
-    RawObject* raw = Object::Allocate(ApiError::kClassId,
-                                      ApiError::InstanceSize(),
-                                      space);
+    RawObject* raw =
+        Object::Allocate(ApiError::kClassId, ApiError::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -15182,8 +15034,7 @@
 RawLanguageError* LanguageError::New() {
   ASSERT(Object::language_error_class() != Class::null());
   RawObject* raw = Object::Allocate(LanguageError::kClassId,
-                                    LanguageError::InstanceSize(),
-                                    Heap::kOld);
+                                    LanguageError::InstanceSize(), Heap::kOld);
   return reinterpret_cast<RawLanguageError*>(raw);
 }
 
@@ -15200,8 +15051,7 @@
   LanguageError& result = LanguageError::Handle();
   {
     RawObject* raw = Object::Allocate(LanguageError::kClassId,
-                                      LanguageError::InstanceSize(),
-                                      space);
+                                      LanguageError::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -15210,8 +15060,8 @@
   result.set_token_pos(token_pos);
   result.set_report_after_token(report_after_token);
   result.set_kind(kind);
-  result.set_message(String::Handle(
-      String::NewFormattedV(format, args, space)));
+  result.set_message(
+      String::Handle(String::NewFormattedV(format, args, space)));
   return result.raw();
 }
 
@@ -15222,12 +15072,13 @@
                                               bool report_after_token,
                                               Report::Kind kind,
                                               Heap::Space space,
-                                              const char* format, ...) {
+                                              const char* format,
+                                              ...) {
   va_list args;
   va_start(args, format);
   RawLanguageError* result = LanguageError::NewFormattedV(
-      prev_error, script, token_pos, report_after_token,
-      kind, space, format, args);
+      prev_error, script, token_pos, report_after_token, kind, space, format,
+      args);
   NoSafepointScope no_safepoint;
   va_end(args);
   return result;
@@ -15241,8 +15092,7 @@
   LanguageError& result = LanguageError::Handle();
   {
     RawObject* raw = Object::Allocate(LanguageError::kClassId,
-                                      LanguageError::InstanceSize(),
-                                      space);
+                                      LanguageError::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -15293,11 +15143,8 @@
     return formatted_message();
   }
   String& result = String::Handle(
-      Report::PrependSnippet(kind(),
-                             Script::Handle(script()),
-                             token_pos(),
-                             report_after_token(),
-                             String::Handle(message())));
+      Report::PrependSnippet(kind(), Script::Handle(script()), token_pos(),
+                             report_after_token(), String::Handle(message())));
   // Prepend previous error message.
   const Error& prev_error = Error::Handle(previous_error());
   if (!prev_error.IsNull()) {
@@ -15326,9 +15173,9 @@
   ASSERT(Object::unhandled_exception_class() != Class::null());
   UnhandledException& result = UnhandledException::Handle();
   {
-    RawObject* raw = Object::Allocate(UnhandledException::kClassId,
-                                      UnhandledException::InstanceSize(),
-                                      space);
+    RawObject* raw =
+        Object::Allocate(UnhandledException::kClassId,
+                         UnhandledException::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -15342,9 +15189,9 @@
   ASSERT(Object::unhandled_exception_class() != Class::null());
   UnhandledException& result = UnhandledException::Handle();
   {
-    RawObject* raw = Object::Allocate(UnhandledException::kClassId,
-                                      UnhandledException::InstanceSize(),
-                                      space);
+    RawObject* raw =
+        Object::Allocate(UnhandledException::kClassId,
+                         UnhandledException::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -15390,8 +15237,8 @@
   if (!strtmp.IsError()) {
     stack_str = strtmp.ToCString();
   }
-  return OS::SCreate(thread->zone(),
-      "Unhandled exception:\n%s\n%s", exc_str, stack_str);
+  return OS::SCreate(thread->zone(), "Unhandled exception:\n%s\n%s", exc_str,
+                     stack_str);
 }
 
 
@@ -15405,8 +15252,7 @@
   UnwindError& result = UnwindError::Handle();
   {
     RawObject* raw = Object::Allocate(UnwindError::kClassId,
-                                      UnwindError::InstanceSize(),
-                                      space);
+                                      UnwindError::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -15447,8 +15293,8 @@
                               const String& expr,
                               const Array& param_names,
                               const Array& param_values) const {
-  const Function& eval_func =
-      Function::Handle(EvaluateHelper(method_cls, expr, param_names, false));
+  const Function& eval_func = Function::Handle(
+      Function::EvaluateHelper(method_cls, expr, param_names, false));
   const Array& args = Array::Handle(Array::New(1 + param_values.Length()));
   PassiveObject& param = PassiveObject::Handle();
   args.SetAt(0, *this);
@@ -15488,8 +15334,7 @@
     }
     uword this_addr = reinterpret_cast<uword>(this->raw_ptr());
     uword other_addr = reinterpret_cast<uword>(other.raw_ptr());
-    for (intptr_t offset = Instance::NextFieldOffset();
-         offset < instance_size;
+    for (intptr_t offset = Instance::NextFieldOffset(); offset < instance_size;
          offset += kWordSize) {
       if ((*reinterpret_cast<RawObject**>(this_addr + offset)) !=
           (*reinterpret_cast<RawObject**>(other_addr + offset))) {
@@ -15508,8 +15353,7 @@
   ASSERT(instance_size != 0);
   uword hash = instance_size;
   uword this_addr = reinterpret_cast<uword>(this->raw_ptr());
-  for (intptr_t offset = Instance::NextFieldOffset();
-       offset < instance_size;
+  for (intptr_t offset = Instance::NextFieldOffset(); offset < instance_size;
        offset += kWordSize) {
     uword value = reinterpret_cast<uword>(
         *reinterpret_cast<RawObject**>(this_addr + offset));
@@ -15550,8 +15394,7 @@
     Object& obj = Object::Handle(zone);
     const intptr_t instance_size = SizeFromClass();
     ASSERT(instance_size != 0);
-    for (intptr_t offset = Instance::NextFieldOffset();
-         offset < instance_size;
+    for (intptr_t offset = Instance::NextFieldOffset(); offset < instance_size;
          offset += kWordSize) {
       obj = *this->FieldAddrAtOffset(offset);
       if (obj.IsInstance() && !obj.IsSmi() && !obj.IsCanonical()) {
@@ -15625,7 +15468,7 @@
 #endif  // DEBUG
 
 
-RawAbstractType* Instance::GetType() const {
+RawAbstractType* Instance::GetType(Heap::Space space) const {
   if (IsNull()) {
     return Type::NullType();
   }
@@ -15645,7 +15488,8 @@
     const Class& scope_cls = Class::Handle(type.type_class());
     ASSERT(scope_cls.NumTypeArguments() > 0);
     TypeArguments& type_arguments = TypeArguments::Handle(GetTypeArguments());
-    type = Type::New(scope_cls, type_arguments, TokenPosition::kNoSource);
+    type =
+        Type::New(scope_cls, type_arguments, TokenPosition::kNoSource, space);
     type.set_signature(signature);
     type.SetIsFinalized();
     type ^= type.Canonicalize();
@@ -15660,7 +15504,7 @@
     if (cls.NumTypeArguments() > 0) {
       type_arguments = GetTypeArguments();
     }
-    type = Type::New(cls, type_arguments, TokenPosition::kNoSource);
+    type = Type::New(cls, type_arguments, TokenPosition::kNoSource, space);
     type.SetIsFinalized();
     type ^= type.Canonicalize();
   }
@@ -15701,8 +15545,7 @@
   Zone* zone = Thread::Current()->zone();
   const Class& cls = Class::Handle(zone, clazz());
   if (cls.IsClosureClass()) {
-    if (other.IsObjectType() ||
-        other.IsDartFunctionType() ||
+    if (other.IsObjectType() || other.IsDartFunctionType() ||
         other.IsDartClosureType()) {
       return true;
     }
@@ -15711,8 +15554,8 @@
     // Note that we may encounter a bound error in checked mode.
     if (!other.IsInstantiated()) {
       AbstractType& instantiated_other = AbstractType::Handle(
-          zone, other.InstantiateFrom(other_instantiator, bound_error,
-                                      NULL, NULL, Heap::kOld));
+          zone, other.InstantiateFrom(other_instantiator, bound_error, NULL,
+                                      NULL, Heap::kOld));
       if ((bound_error != NULL) && !bound_error->IsNull()) {
         ASSERT(Isolate::Current()->type_checks());
         return false;
@@ -15741,11 +15584,8 @@
         Function::Handle(zone, Closure::Cast(*this).function());
     const TypeArguments& type_arguments =
         TypeArguments::Handle(zone, GetTypeArguments());
-    return signature.IsSubtypeOf(type_arguments,
-                                 other_signature,
-                                 other_type_arguments,
-                                 bound_error,
-                                 Heap::kOld);
+    return signature.IsSubtypeOf(type_arguments, other_signature,
+                                 other_type_arguments, bound_error, Heap::kOld);
   }
   TypeArguments& type_arguments = TypeArguments::Handle(zone);
   if (cls.NumTypeArguments() > 0) {
@@ -15784,8 +15624,8 @@
   const bool other_is_dart_function = instantiated_other.IsDartFunctionType();
   if (other_is_dart_function || instantiated_other.IsFunctionType()) {
     // Check if this instance understands a call() method of a compatible type.
-    Function& call = Function::Handle(zone,
-        cls.LookupDynamicFunctionAllowAbstract(Symbols::Call()));
+    Function& call = Function::Handle(
+        zone, cls.LookupDynamicFunctionAllowAbstract(Symbols::Call()));
     if (call.IsNull()) {
       // Walk up the super_class chain.
       Class& super_cls = Class::Handle(zone, cls.SuperClass());
@@ -15798,13 +15638,10 @@
       if (other_is_dart_function) {
         return true;
       }
-      const Function& other_signature = Function::Handle(
-          zone, Type::Cast(instantiated_other).signature());
-      if (call.IsSubtypeOf(type_arguments,
-                           other_signature,
-                           other_type_arguments,
-                           bound_error,
-                           Heap::kOld)) {
+      const Function& other_signature =
+          Function::Handle(zone, Type::Cast(instantiated_other).signature());
+      if (call.IsSubtypeOf(type_arguments, other_signature,
+                           other_type_arguments, bound_error, Heap::kOld)) {
         return true;
       }
     }
@@ -15997,11 +15834,11 @@
     if (num_type_arguments > 0) {
       type_arguments = GetTypeArguments();
     }
-    const Type& type = Type::Handle(
-        Type::New(cls, type_arguments, TokenPosition::kNoSource));
+    const Type& type =
+        Type::Handle(Type::New(cls, type_arguments, TokenPosition::kNoSource));
     const String& type_name = String::Handle(type.UserVisibleName());
-    return OS::SCreate(Thread::Current()->zone(),
-        "Instance of '%s'", type_name.ToCString());
+    return OS::SCreate(Thread::Current()->zone(), "Instance of '%s'",
+                       type_name.ToCString());
   }
 }
 
@@ -16047,7 +15884,7 @@
 }
 
 
-RawTypeArguments* AbstractType::arguments() const  {
+RawTypeArguments* AbstractType::arguments() const {
   // AbstractType is an abstract class.
   UNREACHABLE();
   return NULL;
@@ -16166,8 +16003,8 @@
 }
 
 
-RawAbstractType* AbstractType::CloneUninstantiated(
-    const Class& new_owner, TrailPtr trail) const {
+RawAbstractType* AbstractType::CloneUninstantiated(const Class& new_owner,
+                                                   TrailPtr trail) const {
   // AbstractType is an abstract class.
   UNREACHABLE();
   return NULL;
@@ -16264,8 +16101,8 @@
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
   if (IsBoundedType()) {
-    const AbstractType& type = AbstractType::Handle(zone,
-        BoundedType::Cast(*this).type());
+    const AbstractType& type =
+        AbstractType::Handle(zone, BoundedType::Cast(*this).type());
     if (name_visibility == kUserVisibleName) {
       return type.BuildName(kUserVisibleName);
     }
@@ -16274,8 +16111,8 @@
     pieces.Add(type_name);
     pieces.Add(Symbols::SpaceExtendsSpace());
     // Build the bound name without causing divergence.
-    const AbstractType& bound = AbstractType::Handle(zone,
-        BoundedType::Cast(*this).bound());
+    const AbstractType& bound =
+        AbstractType::Handle(zone, BoundedType::Cast(*this).bound());
     String& bound_name = String::Handle(zone);
     if (bound.IsTypeParameter()) {
       bound_name = TypeParameter::Cast(bound).name();
@@ -16305,8 +16142,8 @@
   Class& cls = Class::Handle(zone);
   if (IsFunctionType()) {
     cls = type_class();
-    const Function& signature_function = Function::Handle(zone,
-        Type::Cast(*this).signature());
+    const Function& signature_function =
+        Function::Handle(zone, Type::Cast(*this).signature());
     if (!cls.IsTypedefClass() ||
         (cls.signature_function() != signature_function.raw())) {
       if (!IsFinalized() || IsBeingFinalized() || IsMalformed()) {
@@ -16372,10 +16209,9 @@
       args.IsRaw(first_type_param_index, num_type_params)) {
     // Do nothing.
   } else {
-    const String& args_name = String::Handle(zone,
-        args.SubvectorName(first_type_param_index,
-                           num_type_params,
-                           name_visibility));
+    const String& args_name = String::Handle(
+        zone, args.SubvectorName(first_type_param_index, num_type_params,
+                                 name_visibility));
     pieces.Add(args_name);
   }
   // The name is only used for type checking and debugging purposes.
@@ -16404,91 +16240,79 @@
 
 
 bool AbstractType::IsVoidType() const {
-    return raw() == Object::void_type().raw();
+  return raw() == Object::void_type().raw();
 }
 
 
 bool AbstractType::IsNullType() const {
-  return !IsFunctionType() &&
-      HasResolvedTypeClass() &&
-      (type_class() == Isolate::Current()->object_store()->null_class());
+  return !IsFunctionType() && HasResolvedTypeClass() &&
+         (type_class() == Isolate::Current()->object_store()->null_class());
 }
 
 
 bool AbstractType::IsBoolType() const {
-  return !IsFunctionType() &&
-      HasResolvedTypeClass() &&
-      (type_class() == Isolate::Current()->object_store()->bool_class());
+  return !IsFunctionType() && HasResolvedTypeClass() &&
+         (type_class() == Isolate::Current()->object_store()->bool_class());
 }
 
 
 bool AbstractType::IsIntType() const {
-  return !IsFunctionType() &&
-      HasResolvedTypeClass() &&
-      (type_class() == Type::Handle(Type::IntType()).type_class());
+  return !IsFunctionType() && HasResolvedTypeClass() &&
+         (type_class() == Type::Handle(Type::IntType()).type_class());
 }
 
 
 bool AbstractType::IsDoubleType() const {
-  return !IsFunctionType() &&
-      HasResolvedTypeClass() &&
-      (type_class() == Type::Handle(Type::Double()).type_class());
+  return !IsFunctionType() && HasResolvedTypeClass() &&
+         (type_class() == Type::Handle(Type::Double()).type_class());
 }
 
 
 bool AbstractType::IsFloat32x4Type() const {
-  return !IsFunctionType() &&
-      HasResolvedTypeClass() &&
-      (type_class() == Type::Handle(Type::Float32x4()).type_class());
+  return !IsFunctionType() && HasResolvedTypeClass() &&
+         (type_class() == Type::Handle(Type::Float32x4()).type_class());
 }
 
 
 bool AbstractType::IsFloat64x2Type() const {
-  return !IsFunctionType() &&
-      HasResolvedTypeClass() &&
-      (type_class() == Type::Handle(Type::Float64x2()).type_class());
+  return !IsFunctionType() && HasResolvedTypeClass() &&
+         (type_class() == Type::Handle(Type::Float64x2()).type_class());
 }
 
 
 bool AbstractType::IsInt32x4Type() const {
-  return !IsFunctionType() &&
-      HasResolvedTypeClass() &&
-      (type_class() == Type::Handle(Type::Int32x4()).type_class());
+  return !IsFunctionType() && HasResolvedTypeClass() &&
+         (type_class() == Type::Handle(Type::Int32x4()).type_class());
 }
 
 
 bool AbstractType::IsNumberType() const {
-  return !IsFunctionType() &&
-      HasResolvedTypeClass() &&
-      (type_class() == Type::Handle(Type::Number()).type_class());
+  return !IsFunctionType() && HasResolvedTypeClass() &&
+         (type_class() == Type::Handle(Type::Number()).type_class());
 }
 
 
 bool AbstractType::IsSmiType() const {
-  return !IsFunctionType() &&
-      HasResolvedTypeClass() &&
-      (type_class() == Type::Handle(Type::SmiType()).type_class());
+  return !IsFunctionType() && HasResolvedTypeClass() &&
+         (type_class() == Type::Handle(Type::SmiType()).type_class());
 }
 
 
 bool AbstractType::IsStringType() const {
-  return !IsFunctionType() &&
-      HasResolvedTypeClass() &&
-      (type_class() == Type::Handle(Type::StringType()).type_class());
+  return !IsFunctionType() && HasResolvedTypeClass() &&
+         (type_class() == Type::Handle(Type::StringType()).type_class());
 }
 
 
 bool AbstractType::IsDartFunctionType() const {
-  return !IsFunctionType() &&
-      HasResolvedTypeClass() &&
-      (type_class() == Type::Handle(Type::DartFunctionType()).type_class());
+  return !IsFunctionType() && HasResolvedTypeClass() &&
+         (type_class() == Type::Handle(Type::DartFunctionType()).type_class());
 }
 
 
 bool AbstractType::IsDartClosureType() const {
-  return !IsFunctionType() &&
-      HasResolvedTypeClass() &&
-      (type_class() == Isolate::Current()->object_store()->closure_class());
+  return !IsFunctionType() && HasResolvedTypeClass() &&
+         (type_class() == Isolate::Current()->object_store()->closure_class());
 }
 
 
@@ -16548,18 +16372,12 @@
     if (IsBoundedType()) {
       const AbstractType& bounded_type =
           AbstractType::Handle(zone, BoundedType::Cast(*this).type());
-      return bounded_type.TypeTest(test_kind,
-                                   other,
-                                   bound_error,
-                                   bound_trail,
+      return bounded_type.TypeTest(test_kind, other, bound_error, bound_trail,
                                    space);
     }
     const AbstractType& other_bounded_type =
         AbstractType::Handle(zone, BoundedType::Cast(other).type());
-    return TypeTest(test_kind,
-                    other_bounded_type,
-                    bound_error,
-                    bound_trail,
+    return TypeTest(test_kind, other_bounded_type, bound_error, bound_trail,
                     space);
   }
   // Type parameters cannot be handled by Class::TypeTest().
@@ -16611,16 +16429,13 @@
       // Check for two function types.
       const Function& fun =
           Function::Handle(zone, Type::Cast(*this).signature());
-      return fun.TypeTest(test_kind,
-                          TypeArguments::Handle(zone, arguments()),
-                          other_fun,
-                          TypeArguments::Handle(zone, other.arguments()),
-                          bound_error,
-                          space);
+      return fun.TypeTest(
+          test_kind, TypeArguments::Handle(zone, arguments()), other_fun,
+          TypeArguments::Handle(zone, other.arguments()), bound_error, space);
     }
     // Check if type S has a call() method of function type T.
-    Function& function = Function::Handle(zone,
-        type_cls.LookupDynamicFunctionAllowAbstract(Symbols::Call()));
+    Function& function = Function::Handle(
+        zone, type_cls.LookupDynamicFunctionAllowAbstract(Symbols::Call()));
     if (function.IsNull()) {
       // Walk up the super_class chain.
       Class& cls = Class::Handle(zone, type_cls.SuperClass());
@@ -16631,13 +16446,11 @@
     }
     if (!function.IsNull()) {
       if (other_is_dart_function_type ||
-          function.TypeTest(test_kind,
-                            TypeArguments::Handle(zone, arguments()),
-                            Function::Handle(
-                                zone, Type::Cast(other).signature()),
-                            TypeArguments::Handle(zone, other.arguments()),
-                            bound_error,
-                            space)) {
+          function.TypeTest(
+              test_kind, TypeArguments::Handle(zone, arguments()),
+              Function::Handle(zone, Type::Cast(other).signature()),
+              TypeArguments::Handle(zone, other.arguments()), bound_error,
+              space)) {
         return true;
       }
     }
@@ -16645,13 +16458,10 @@
   if (IsFunctionType()) {
     return false;
   }
-  return type_cls.TypeTest(test_kind,
-                           TypeArguments::Handle(zone, arguments()),
+  return type_cls.TypeTest(test_kind, TypeArguments::Handle(zone, arguments()),
                            Class::Handle(zone, other.type_class()),
                            TypeArguments::Handle(zone, other.arguments()),
-                           bound_error,
-                           bound_trail,
-                           space);
+                           bound_error, bound_trail, space);
 }
 
 
@@ -16754,8 +16564,7 @@
   Type& type = Type::Handle(type_class.CanonicalType());
   if (type.IsNull()) {
     const TypeArguments& no_type_arguments = TypeArguments::Handle();
-    type ^= Type::New(Object::Handle(type_class.raw()),
-                      no_type_arguments,
+    type ^= Type::New(Object::Handle(type_class.raw()), no_type_arguments,
                       TokenPosition::kNoSource);
     type.SetIsFinalized();
     type ^= type.Canonicalize();
@@ -16956,11 +16765,9 @@
   const Class& cls = Class::Handle(zone, type_class());
   TypeArguments& type_arguments = TypeArguments::Handle(zone, arguments());
   ASSERT(type_arguments.Length() == cls.NumTypeArguments());
-  type_arguments = type_arguments.InstantiateFrom(instantiator_type_arguments,
-                                                  bound_error,
-                                                  instantiation_trail,
-                                                  bound_trail,
-                                                  space);
+  type_arguments =
+      type_arguments.InstantiateFrom(instantiator_type_arguments, bound_error,
+                                     instantiation_trail, bound_trail, space);
   // This uninstantiated type is not modified, as it can be instantiated
   // with different instantiators. Allocate a new instantiated version of it.
   const Type& instantiated_type =
@@ -16994,8 +16801,8 @@
   }
   if (other.IsTypeRef()) {
     // Unfold right hand type. Divergence is controlled by left hand type.
-    const AbstractType& other_ref_type = AbstractType::Handle(
-        TypeRef::Cast(other).type());
+    const AbstractType& other_ref_type =
+        AbstractType::Handle(TypeRef::Cast(other).type());
     ASSERT(!other_ref_type.IsTypeRef());
     return IsEquivalent(other_ref_type, trail);
   }
@@ -17033,8 +16840,8 @@
       const intptr_t num_type_args = cls.NumTypeArguments();
       const intptr_t from_index = num_type_args - num_type_params;
       const TypeArguments& type_args = TypeArguments::Handle(zone, arguments());
-      const TypeArguments& other_type_args = TypeArguments::Handle(
-          zone, other_type.arguments());
+      const TypeArguments& other_type_args =
+          TypeArguments::Handle(zone, other_type.arguments());
       if (type_args.IsNull()) {
         // Ignore from_index.
         if (!other_type_args.IsRaw(0, num_type_args)) {
@@ -17045,10 +16852,8 @@
         if (!type_args.IsRaw(0, num_type_args)) {
           return false;
         }
-      } else if (!type_args.IsSubvectorEquivalent(other_type_args,
-                                                  from_index,
-                                                  num_type_params,
-                                                  trail)) {
+      } else if (!type_args.IsSubvectorEquivalent(other_type_args, from_index,
+                                                  num_type_params, trail)) {
         return false;
       }
 #ifdef DEBUG
@@ -17086,8 +16891,8 @@
     return true;
   }
   const Function& sig_fun = Function::Handle(zone, signature());
-  const Function& other_sig_fun = Function::Handle(
-      zone, other_type.signature());
+  const Function& other_sig_fun =
+      Function::Handle(zone, other_type.signature());
 
   // Compare number of function parameters.
   const intptr_t num_fixed_params = sig_fun.num_fixed_parameters();
@@ -17154,7 +16959,7 @@
   if (IsFinalized()) {
     return raw();
   }
-  ASSERT(!IsMalformed());  // Malformed types are finalized.
+  ASSERT(!IsMalformed());       // Malformed types are finalized.
   ASSERT(!IsBeingFinalized());  // Cloning must occur prior to finalization.
   Zone* zone = Thread::Current()->zone();
   const TypeArguments& type_args = TypeArguments::Handle(zone, arguments());
@@ -17163,7 +16968,8 @@
   if (type_args_clone.raw() == type_args.raw()) {
     return raw();
   }
-  const Type& clone = Type::Handle(zone,
+  const Type& clone = Type::Handle(
+      zone,
       Type::New(Class::Handle(zone, type_class()), type_args, token_pos()));
   // Preserve the bound error if any.
   if (IsMalbounded()) {
@@ -17174,8 +16980,8 @@
   Function& fun = Function::Handle(zone, signature());
   if (!fun.IsNull()) {
     const Class& owner = Class::Handle(zone, fun.Owner());
-    Function& fun_clone = Function::Handle(zone,
-        Function::NewSignatureFunction(owner, TokenPosition::kNoSource));
+    Function& fun_clone = Function::Handle(
+        zone, Function::NewSignatureFunction(owner, TokenPosition::kNoSource));
     AbstractType& type = AbstractType::Handle(zone, fun.result_type());
     type = type.CloneUnfinalized();
     fun_clone.set_result_type(type);
@@ -17183,8 +16989,8 @@
     fun_clone.set_num_fixed_parameters(fun.num_fixed_parameters());
     fun_clone.SetNumOptionalParameters(fun.NumOptionalParameters(),
                                        fun.HasOptionalPositionalParameters());
-    fun_clone.set_parameter_types(Array::Handle(Array::New(num_params,
-                                                           Heap::kOld)));
+    fun_clone.set_parameter_types(
+        Array::Handle(Array::New(num_params, Heap::kOld)));
     for (intptr_t i = 0; i < num_params; i++) {
       type = fun.ParameterTypeAt(i);
       type = type.CloneUnfinalized();
@@ -17201,6 +17007,7 @@
 RawAbstractType* Type::CloneUninstantiated(const Class& new_owner,
                                            TrailPtr trail) const {
   ASSERT(IsFinalized());
+  ASSERT(IsCanonical());
   ASSERT(!IsMalformed());
   if (IsInstantiated()) {
     return raw();
@@ -17243,7 +17050,8 @@
       clone.set_arguments(type_args);
       type_args_cloned = true;
     }
-    Function& fun_clone = Function::Handle(zone,
+    Function& fun_clone = Function::Handle(
+        zone,
         Function::NewSignatureFunction(new_owner, TokenPosition::kNoSource));
     AbstractType& type = AbstractType::Handle(zone, fun.result_type());
     type = type.CloneUninstantiated(new_owner, trail);
@@ -17252,8 +17060,8 @@
     fun_clone.set_num_fixed_parameters(fun.num_fixed_parameters());
     fun_clone.SetNumOptionalParameters(fun.NumOptionalParameters(),
                                        fun.HasOptionalPositionalParameters());
-    fun_clone.set_parameter_types(Array::Handle(Array::New(num_params,
-                                                           Heap::kOld)));
+    fun_clone.set_parameter_types(
+        Array::Handle(Array::New(num_params, Heap::kOld)));
     for (intptr_t i = 0; i < num_params; i++) {
       type = fun.ParameterTypeAt(i);
       type = type.CloneUninstantiated(new_owner, trail);
@@ -17271,6 +17079,7 @@
     clone.set_arguments(type_args);
   }
   clone.SetIsFinalized();
+  clone ^= clone.Canonicalize();
   return clone.raw();
 }
 
@@ -17376,8 +17185,8 @@
         sig_fun.set_num_fixed_parameters(fun.num_fixed_parameters());
         sig_fun.SetNumOptionalParameters(fun.NumOptionalParameters(),
                                          fun.HasOptionalPositionalParameters());
-        sig_fun.set_parameter_types(Array::Handle(Array::New(num_params,
-                                                             Heap::kOld)));
+        sig_fun.set_parameter_types(
+            Array::Handle(Array::New(num_params, Heap::kOld)));
         for (intptr_t i = 0; i < num_params; i++) {
           type = fun.ParameterTypeAt(i);
           type = type.Canonicalize(trail);
@@ -17395,7 +17204,11 @@
     type ^= table.GetOrNull(CanonicalTypeKey(*this));
     if (type.IsNull()) {
       // Add this Type into the canonical list of types.
-      type ^= raw();
+      if (this->IsNew()) {
+        type ^= Object::Clone(*this, Heap::kOld);
+      } else {
+        type ^= this->raw();
+      }
       ASSERT(type.IsOld());
       type.SetCanonical();  // Mark object as being canonical.
       bool present = table.Insert(type);
@@ -17526,9 +17339,8 @@
 
 
 RawType* Type::New(Heap::Space space) {
-  RawObject* raw = Object::Allocate(Type::kClassId,
-                                    Type::InstanceSize(),
-                                    space);
+  RawObject* raw =
+      Object::Allocate(Type::kClassId, Type::InstanceSize(), space);
   return reinterpret_cast<RawType*>(raw);
 }
 
@@ -17579,20 +17391,17 @@
   }
   if (IsFunctionType()) {
     const Function& sig_fun = Function::Handle(zone, signature());
-    const String& sig = IsFinalized() ?
-        String::Handle(zone, sig_fun.InstantiatedSignatureFrom(type_args,
-                                                               kInternalName)) :
-        String::Handle(zone, sig_fun.Signature());
+    const String& sig =
+        IsFinalized() ? String::Handle(zone, sig_fun.InstantiatedSignatureFrom(
+                                                 type_args, kInternalName))
+                      : String::Handle(zone, sig_fun.Signature());
     if (cls.IsClosureClass()) {
       ASSERT(type_args.IsNull());
-      return OS::SCreate(zone, "%sFunction Type: %s",
-                         unresolved, sig.ToCString());
+      return OS::SCreate(zone, "%sFunction Type: %s", unresolved,
+                         sig.ToCString());
     }
     return OS::SCreate(zone, "%s Function Type: %s (class: %s, args: %s)",
-                       unresolved,
-                       sig.ToCString(),
-                       class_name,
-                       args_cstr);
+                       unresolved, sig.ToCString(), class_name, args_cstr);
   }
   if (type_args.IsNull()) {
     return OS::SCreate(zone, "%sType: class '%s'", unresolved, class_name);
@@ -17601,8 +17410,8 @@
     return OS::SCreate(zone, "Type: (@%p H%" Px ") class '%s', args:[%s]",
                        raw(), hash, class_name, args_cstr);
   } else {
-    return OS::SCreate(zone, "%sType: class '%s', args:[%s]",
-                       unresolved, class_name, args_cstr);
+    return OS::SCreate(zone, "%sType: class '%s', args:[%s]", unresolved,
+                       class_name, args_cstr);
   }
 }
 
@@ -17646,12 +17455,9 @@
   AbstractType& ref_type = AbstractType::Handle(type());
   ASSERT(!ref_type.IsTypeRef());
   AbstractType& instantiated_ref_type = AbstractType::Handle();
-  instantiated_ref_type = ref_type.InstantiateFrom(
-      instantiator_type_arguments,
-      bound_error,
-      instantiation_trail,
-      bound_trail,
-      space);
+  instantiated_ref_type =
+      ref_type.InstantiateFrom(instantiator_type_arguments, bound_error,
+                               instantiation_trail, bound_trail, space);
   ASSERT(!instantiated_ref_type.IsTypeRef());
   instantiated_type_ref.set_type(instantiated_ref_type);
   return instantiated_type_ref.raw();
@@ -17737,9 +17543,8 @@
 
 
 RawTypeRef* TypeRef::New() {
-  RawObject* raw = Object::Allocate(TypeRef::kClassId,
-                                    TypeRef::InstanceSize(),
-                                    Heap::kOld);
+  RawObject* raw =
+      Object::Allocate(TypeRef::kClassId, TypeRef::InstanceSize(), Heap::kOld);
   return reinterpret_cast<RawTypeRef*>(raw);
 }
 
@@ -17752,16 +17557,20 @@
 
 
 const char* TypeRef::ToCString() const {
-  const char* type_cstr = String::Handle(Class::Handle(
-      type_class()).Name()).ToCString();
   AbstractType& ref_type = AbstractType::Handle(type());
+  if (ref_type.IsNull()) {
+    return "TypeRef: null";
+  }
+  const char* type_cstr =
+      String::Handle(Class::Handle(type_class()).Name()).ToCString();
   if (ref_type.IsFinalized()) {
     const intptr_t hash = ref_type.Hash();
     return OS::SCreate(Thread::Current()->zone(),
-        "TypeRef: %s<...> (@%p H%" Px ")", type_cstr, ref_type.raw(), hash);
+                       "TypeRef: %s<...> (@%p H%" Px ")", type_cstr,
+                       ref_type.raw(), hash);
   } else {
-    return OS::SCreate(Thread::Current()->zone(),
-        "TypeRef: %s<...>", type_cstr);
+    return OS::SCreate(Thread::Current()->zone(), "TypeRef: %s<...>",
+                       type_cstr);
   }
 }
 
@@ -17778,8 +17587,8 @@
   }
   if (other.IsTypeRef()) {
     // Unfold right hand type. Divergence is controlled by left hand type.
-    const AbstractType& other_ref_type = AbstractType::Handle(
-        TypeRef::Cast(other).type());
+    const AbstractType& other_ref_type =
+        AbstractType::Handle(TypeRef::Cast(other).type());
     ASSERT(!other_ref_type.IsTypeRef());
     return IsEquivalent(other_ref_type, trail);
   }
@@ -17854,8 +17663,8 @@
   if (instantiator_type_arguments.IsNull()) {
     return Type::DynamicType();
   }
-  const AbstractType& type_arg = AbstractType::Handle(
-      instantiator_type_arguments.TypeAt(index()));
+  const AbstractType& type_arg =
+      AbstractType::Handle(instantiator_type_arguments.TypeAt(index()));
   // There is no need to canonicalize the instantiated type parameter, since all
   // type arguments are canonicalized at type finalization time. It would be too
   // early to canonicalize the returned type argument here, since instantiation
@@ -17895,13 +17704,13 @@
     // Report the bound error only if both the bounded type and the upper bound
     // are instantiated. Otherwise, we cannot tell yet it is a bound error.
     if (bounded_type.IsInstantiated() && upper_bound.IsInstantiated()) {
-      const String& bounded_type_name = String::Handle(
-          bounded_type.UserVisibleName());
-      const String& upper_bound_name = String::Handle(
-          upper_bound.UserVisibleName());
+      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& 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());
@@ -17909,18 +17718,12 @@
       // Since the bound may have been canonicalized, its token index is
       // meaningless, therefore use the token index of this type parameter.
       *bound_error = LanguageError::NewFormatted(
-          *bound_error,
-          script,
-          token_pos(),
-          Report::AtLocation,
-          Report::kMalboundedType,
-          Heap::kNew,
+          *bound_error, script, token_pos(), Report::AtLocation,
+          Report::kMalboundedType, Heap::kNew,
           "type parameter '%s' of class '%s' must extend bound '%s', "
           "but type argument '%s' is not a subtype of '%s' where\n%s%s",
-          type_param_name.ToCString(),
-          class_name.ToCString(),
-          declared_bound_name.ToCString(),
-          bounded_type_name.ToCString(),
+          type_param_name.ToCString(), class_name.ToCString(),
+          declared_bound_name.ToCString(), bounded_type_name.ToCString(),
           upper_bound_name.ToCString(),
           String::Handle(bounded_type.EnumerateURIs()).ToCString(),
           String::Handle(upper_bound.EnumerateURIs()).ToCString());
@@ -17936,16 +17739,14 @@
   }
   // No need to clone bound, as it is not part of the finalization state.
   return TypeParameter::New(Class::Handle(parameterized_class()),
-                            Function::Handle(parameterized_function()),
-                            index(),
+                            Function::Handle(parameterized_function()), index(),
                             String::Handle(name()),
-                            AbstractType::Handle(bound()),
-                            token_pos());
+                            AbstractType::Handle(bound()), token_pos());
 }
 
 
-RawAbstractType* TypeParameter::CloneUninstantiated(
-    const Class& new_owner, TrailPtr trail) const {
+RawAbstractType* TypeParameter::CloneUninstantiated(const Class& new_owner,
+                                                    TrailPtr trail) const {
   ASSERT(IsFinalized());
   TypeParameter& clone = TypeParameter::Handle();
   clone ^= OnlyBuddyInTrail(trail);
@@ -17953,13 +17754,11 @@
     return clone.raw();
   }
   const Class& old_owner = Class::Handle(parameterized_class());
-  const intptr_t new_index = index() +
-      new_owner.NumTypeArguments() - old_owner.NumTypeArguments();
+  const intptr_t new_index =
+      index() + new_owner.NumTypeArguments() - old_owner.NumTypeArguments();
   AbstractType& upper_bound = AbstractType::Handle(bound());
   ASSERT(parameterized_function() == Function::null());
-  clone = TypeParameter::New(new_owner,
-                             Function::Handle(),
-                             new_index,
+  clone = TypeParameter::New(new_owner, Function::Handle(), new_index,
                              String::Handle(name()),
                              upper_bound,  // Not cloned yet.
                              token_pos());
@@ -18002,8 +17801,7 @@
 
 RawTypeParameter* TypeParameter::New() {
   RawObject* raw = Object::Allocate(TypeParameter::kClassId,
-                                    TypeParameter::InstanceSize(),
-                                    Heap::kOld);
+                                    TypeParameter::InstanceSize(), Heap::kOld);
   return reinterpret_cast<RawTypeParameter*>(raw);
 }
 
@@ -18053,12 +17851,14 @@
   const AbstractType& upper_bound = AbstractType::Handle(bound());
   const char* bound_cstr = String::Handle(upper_bound.Name()).ToCString();
   if (IsFunctionTypeParameter()) {
-    const char* format = "TypeParameter: name %s; index: %d; parent_level: %d, "
+    const char* format =
+        "TypeParameter: name %s; index: %d; parent_level: %d, "
         "function: %s; bound: %s";
     const Function& function = Function::Handle(parameterized_function());
     const char* fun_cstr = String::Handle(function.name()).ToCString();
     intptr_t len = OS::SNPrint(NULL, 0, format, name_cstr, index(),
-                               parent_level(), fun_cstr, bound_cstr) + 1;
+                               parent_level(), fun_cstr, bound_cstr) +
+                   1;
     char* chars = Thread::Current()->zone()->Alloc<char>(len);
     OS::SNPrint(chars, len, format, name_cstr, index(), parent_level(),
                 fun_cstr, bound_cstr);
@@ -18069,8 +17869,9 @@
     const Class& cls = Class::Handle(parameterized_class());
     const char* cls_cstr =
         cls.IsNull() ? " null" : String::Handle(cls.Name()).ToCString();
-    intptr_t len = OS::SNPrint(
-        NULL, 0, format, name_cstr, index(), cls_cstr, bound_cstr) + 1;
+    intptr_t len =
+        OS::SNPrint(NULL, 0, format, name_cstr, index(), cls_cstr, bound_cstr) +
+        1;
     char* chars = Thread::Current()->zone()->Alloc<char>(len);
     OS::SNPrint(chars, len, format, name_cstr, index(), cls_cstr, bound_cstr);
     return chars;
@@ -18106,8 +17907,8 @@
   }
   if (other.IsTypeRef()) {
     // Unfold right hand type. Divergence is controlled by left hand type.
-    const AbstractType& other_ref_type = AbstractType::Handle(
-        TypeRef::Cast(other).type());
+    const AbstractType& other_ref_type =
+        AbstractType::Handle(TypeRef::Cast(other).type());
     ASSERT(!other_ref_type.IsTypeRef());
     return IsEquivalent(other_ref_type, trail);
   }
@@ -18125,8 +17926,7 @@
   }
   const AbstractType& this_bound = AbstractType::Handle(bound());
   const AbstractType& other_bound = AbstractType::Handle(other_bounded.bound());
-  return this_bound.IsFinalized() &&
-         other_bound.IsFinalized() &&
+  return this_bound.IsFinalized() && other_bound.IsFinalized() &&
          this_bound.Equals(other_bound);  // Different graph, do not pass trail.
 }
 
@@ -18137,8 +17937,7 @@
 
 
 void BoundedType::set_type(const AbstractType& value) const {
-  ASSERT(value.IsFinalized() ||
-         value.IsBeingFinalized() ||
+  ASSERT(value.IsFinalized() || value.IsBeingFinalized() ||
          value.IsTypeParameter());
   ASSERT(!value.IsMalformed());
   StorePointer(&raw_ptr()->type_, value.raw());
@@ -18174,18 +17973,15 @@
       AbstractType::Handle(bounded_type.raw());
   if (!bounded_type.IsInstantiated()) {
     instantiated_bounded_type =
-        bounded_type.InstantiateFrom(instantiator_type_arguments,
-                                     bound_error,
-                                     instantiation_trail,
-                                     bound_trail,
-                                     space);
+        bounded_type.InstantiateFrom(instantiator_type_arguments, bound_error,
+                                     instantiation_trail, bound_trail, space);
     // In case types of instantiator_type_arguments are not finalized
     // (or instantiated), then the instantiated_bounded_type is not finalized
     // (or instantiated) either.
     // Note that instantiator_type_arguments must have the final length, though.
   }
-  if ((Isolate::Current()->type_checks()) &&
-      (bound_error != NULL) && bound_error->IsNull()) {
+  if ((Isolate::Current()->type_checks()) && (bound_error != NULL) &&
+      bound_error->IsNull()) {
     AbstractType& upper_bound = AbstractType::Handle(bound());
     ASSERT(upper_bound.IsFinalized());
     ASSERT(!upper_bound.IsObjectType() && !upper_bound.IsDynamicType());
@@ -18193,11 +17989,8 @@
         AbstractType::Handle(upper_bound.raw());
     if (!upper_bound.IsInstantiated()) {
       instantiated_upper_bound =
-          upper_bound.InstantiateFrom(instantiator_type_arguments,
-                                      bound_error,
-                                      instantiation_trail,
-                                      bound_trail,
-                                      space);
+          upper_bound.InstantiateFrom(instantiator_type_arguments, bound_error,
+                                      instantiation_trail, bound_trail, space);
       // The instantiated_upper_bound may not be finalized or instantiated.
       // See comment above.
     }
@@ -18211,10 +18004,8 @@
       if (!instantiated_bounded_type.IsFinalized() ||
           !instantiated_upper_bound.IsFinalized() ||
           (!type_param.CheckBound(instantiated_bounded_type,
-                                  instantiated_upper_bound,
-                                  bound_error,
-                                  bound_trail,
-                                  space) &&
+                                  instantiated_upper_bound, bound_error,
+                                  bound_trail, space) &&
            bound_error->IsNull())) {
         // We cannot determine yet whether the bounded_type is below the
         // upper_bound, because one or both of them is still being finalized or
@@ -18227,9 +18018,8 @@
         // Postpone bound check by returning a new BoundedType with unfinalized
         // or partially instantiated bounded_type and upper_bound, but keeping
         // type_param.
-        instantiated_bounded_type = BoundedType::New(instantiated_bounded_type,
-                                                     instantiated_upper_bound,
-                                                     type_param);
+        instantiated_bounded_type = BoundedType::New(
+            instantiated_bounded_type, instantiated_upper_bound, type_param);
       }
     }
   }
@@ -18249,14 +18039,13 @@
   }
   // No need to clone bound or type parameter, as they are not part of the
   // finalization state of this bounded type.
-  return BoundedType::New(bounded_type,
-                          AbstractType::Handle(bound()),
+  return BoundedType::New(bounded_type, AbstractType::Handle(bound()),
                           TypeParameter::Handle(type_parameter()));
 }
 
 
-RawAbstractType* BoundedType::CloneUninstantiated(
-    const Class& new_owner, TrailPtr trail) const {
+RawAbstractType* BoundedType::CloneUninstantiated(const Class& new_owner,
+                                                  TrailPtr trail) const {
   if (IsInstantiated()) {
     return raw();
   }
@@ -18264,7 +18053,7 @@
   bounded_type = bounded_type.CloneUninstantiated(new_owner, trail);
   AbstractType& upper_bound = AbstractType::Handle(bound());
   upper_bound = upper_bound.CloneUninstantiated(new_owner, trail);
-  TypeParameter& type_param =  TypeParameter::Handle(type_parameter());
+  TypeParameter& type_param = TypeParameter::Handle(type_parameter());
   type_param ^= type_param.CloneUninstantiated(new_owner, trail);
   return BoundedType::New(bounded_type, upper_bound, type_param);
 }
@@ -18280,8 +18069,8 @@
   uint32_t result = AbstractType::Handle(type()).Hash();
   // No need to include the hash of the bound, since the bound is defined by the
   // type parameter (modulo instantiation state).
-  result = CombineHashes(result,
-                         TypeParameter::Handle(type_parameter()).Hash());
+  result =
+      CombineHashes(result, TypeParameter::Handle(type_parameter()).Hash());
   result = FinalizeHash(result, kHashBits);
   SetHash(result);
   return result;
@@ -18290,8 +18079,7 @@
 
 RawBoundedType* BoundedType::New() {
   RawObject* raw = Object::Allocate(BoundedType::kClassId,
-                                    BoundedType::InstanceSize(),
-                                    Heap::kOld);
+                                    BoundedType::InstanceSize(), Heap::kOld);
   return reinterpret_cast<RawBoundedType*>(raw);
 }
 
@@ -18310,19 +18098,20 @@
 
 const char* BoundedType::ToCString() const {
   const char* format = "BoundedType: type %s; bound: %s; type param: %s of %s";
-  const char* type_cstr = String::Handle(AbstractType::Handle(
-      type()).Name()).ToCString();
-  const char* bound_cstr = String::Handle(AbstractType::Handle(
-      bound()).Name()).ToCString();
+  const char* type_cstr =
+      String::Handle(AbstractType::Handle(type()).Name()).ToCString();
+  const char* bound_cstr =
+      String::Handle(AbstractType::Handle(bound()).Name()).ToCString();
   const TypeParameter& type_param = TypeParameter::Handle(type_parameter());
   const char* type_param_cstr = String::Handle(type_param.name()).ToCString();
   const Class& cls = Class::Handle(type_param.parameterized_class());
   const char* cls_cstr = String::Handle(cls.Name()).ToCString();
-  intptr_t len = OS::SNPrint(
-      NULL, 0, format, type_cstr, bound_cstr, type_param_cstr, cls_cstr) + 1;
+  intptr_t len = OS::SNPrint(NULL, 0, format, type_cstr, bound_cstr,
+                             type_param_cstr, cls_cstr) +
+                 1;
   char* chars = Thread::Current()->zone()->Alloc<char>(len);
-  OS::SNPrint(
-      chars, len, format, type_cstr, bound_cstr, type_param_cstr, cls_cstr);
+  OS::SNPrint(chars, len, format, type_cstr, bound_cstr, type_param_cstr,
+              cls_cstr);
   return chars;
 }
 
@@ -18344,12 +18133,12 @@
 
 const char* MixinAppType::ToCString() const {
   const char* format = "MixinAppType: super type: %s; first mixin type: %s";
-  const char* super_type_cstr = String::Handle(AbstractType::Handle(
-      super_type()).Name()).ToCString();
-  const char* first_mixin_type_cstr = String::Handle(AbstractType::Handle(
-      MixinTypeAt(0)).Name()).ToCString();
-  intptr_t len = OS::SNPrint(
-      NULL, 0, format, super_type_cstr, first_mixin_type_cstr) + 1;
+  const char* super_type_cstr =
+      String::Handle(AbstractType::Handle(super_type()).Name()).ToCString();
+  const char* first_mixin_type_cstr =
+      String::Handle(AbstractType::Handle(MixinTypeAt(0)).Name()).ToCString();
+  intptr_t len =
+      OS::SNPrint(NULL, 0, format, super_type_cstr, first_mixin_type_cstr) + 1;
   char* chars = Thread::Current()->zone()->Alloc<char>(len);
   OS::SNPrint(chars, len, format, super_type_cstr, first_mixin_type_cstr);
   return chars;
@@ -18375,8 +18164,7 @@
   // MixinAppType objects do not survive finalization, so allocate
   // on new heap.
   RawObject* raw = Object::Allocate(MixinAppType::kClassId,
-                                    MixinAppType::InstanceSize(),
-                                    Heap::kOld);
+                                    MixinAppType::InstanceSize(), Heap::kOld);
   return reinterpret_cast<RawMixinAppType*>(raw);
 }
 
@@ -18417,8 +18205,8 @@
         SafepointMutexLocker ml(isolate->constant_canonicalization_mutex());
         // Retry lookup.
         {
-          result ^= cls.LookupCanonicalBigint(
-              zone, Bigint::Cast(*this), &index);
+          result ^=
+              cls.LookupCanonicalBigint(zone, Bigint::Cast(*this), &index);
           if (!result.IsNull()) {
             return result.raw();
           }
@@ -18496,8 +18284,8 @@
   ASSERT(str.IsOneByteString());
   int64_t value;
   if (!OS::StringToInt64(str.ToCString(), &value)) {
-    const Bigint& big = Bigint::Handle(
-        Bigint::NewFromCString(str.ToCString(), space));
+    const Bigint& big =
+        Bigint::Handle(Bigint::NewFromCString(str.ToCString(), space));
     ASSERT(!big.FitsIntoSmi());
     ASSERT(!big.FitsIntoInt64());
     return big.raw();
@@ -18640,15 +18428,15 @@
         if (Smi::kBits < 32) {
           // In 32-bit mode, the product of two Smis fits in a 64-bit result.
           return Integer::New(static_cast<int64_t>(left_value) *
-                              static_cast<int64_t>(right_value),
+                                  static_cast<int64_t>(right_value),
                               space);
         } else {
           // In 64-bit mode, the product of two signed integers fits in a
           // 64-bit result if the sum of the highest bits of their absolute
           // values is smaller than 62.
           ASSERT(sizeof(intptr_t) == sizeof(int64_t));
-          if ((Utils::HighestBit(left_value) +
-               Utils::HighestBit(right_value)) < 62) {
+          if ((Utils::HighestBit(left_value) + Utils::HighestBit(right_value)) <
+              62) {
             return Integer::New(left_value * right_value, space);
           }
         }
@@ -18689,8 +18477,8 @@
         break;
       }
       case Token::kMUL: {
-        if ((Utils::HighestBit(left_value) +
-             Utils::HighestBit(right_value)) < 62) {
+        if ((Utils::HighestBit(left_value) + Utils::HighestBit(right_value)) <
+            62) {
           return Integer::New(left_value * right_value, space);
         }
         break;
@@ -18725,8 +18513,9 @@
 }
 
 
-RawInteger* Integer::BitOp(
-    Token::Kind kind, const Integer& other, Heap::Space space) const {
+RawInteger* Integer::BitOp(Token::Kind kind,
+                           const Integer& other,
+                           Heap::Space space) const {
   if (IsSmi() && other.IsSmi()) {
     intptr_t op1_value = Smi::Value(Smi::RawCast(raw()));
     intptr_t op2_value = Smi::Value(Smi::RawCast(other.raw()));
@@ -18777,7 +18566,7 @@
       if ((left_value == 0) || (right_value == 0)) {
         return raw();
       }
-      { // Check for overflow.
+      {  // Check for overflow.
         int cnt = Utils::BitLength(left_value);
         if ((cnt + right_value) > Smi::kBits) {
           if ((cnt + right_value) > Mint::kBits) {
@@ -18872,9 +18661,8 @@
   ASSERT(Isolate::Current()->object_store()->mint_class() != Class::null());
   Mint& result = Mint::Handle();
   {
-    RawObject* raw = Object::Allocate(Mint::kClassId,
-                                      Mint::InstanceSize(),
-                                      space);
+    RawObject* raw =
+        Object::Allocate(Mint::kClassId, Mint::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -19014,9 +18802,8 @@
   ASSERT(Isolate::Current()->object_store()->double_class() != Class::null());
   Double& result = Double::Handle();
   {
-    RawObject* raw = Object::Allocate(Double::kClassId,
-                                      Double::InstanceSize(),
-                                      space);
+    RawObject* raw =
+        Object::Allocate(Double::kClassId, Double::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -19080,7 +18867,7 @@
   // Refactoring can avoid Zone::Alloc and strlen, but gains are insignificant.
   const char* cstr = ToCString();
   intptr_t len = strlen(cstr);
-  // Resulting string is ASCII ...
+// Resulting string is ASCII ...
 #ifdef DEBUG
   for (intptr_t i = 0; i < len; ++i) {
     ASSERT(static_cast<uint8_t>(cstr[i]) < 128);
@@ -19214,9 +19001,8 @@
   ASSERT(isolate->object_store()->bigint_class() != Class::null());
   Bigint& result = Bigint::Handle(zone);
   {
-    RawObject* raw = Object::Allocate(Bigint::kClassId,
-                                      Bigint::InstanceSize(),
-                                      space);
+    RawObject* raw =
+        Object::Allocate(Bigint::kClassId, Bigint::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -19228,7 +19014,9 @@
 }
 
 
-RawBigint* Bigint::New(bool neg, intptr_t used, const TypedData& digits,
+RawBigint* Bigint::New(bool neg,
+                       intptr_t used,
+                       const TypedData& digits,
                        Heap::Space space) {
   ASSERT((used == 0) ||
          (!digits.IsNull() && (digits.Length() >= (used + (used & 1)))));
@@ -19238,9 +19026,8 @@
   ASSERT(isolate->object_store()->bigint_class() != Class::null());
   Bigint& result = Bigint::Handle(zone);
   {
-    RawObject* raw = Object::Allocate(Bigint::kClassId,
-                                      Bigint::InstanceSize(),
-                                      space);
+    RawObject* raw =
+        Object::Allocate(Bigint::kClassId, Bigint::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -19292,7 +19079,8 @@
 }
 
 
-RawBigint* Bigint::NewFromShiftedInt64(int64_t value, intptr_t shift,
+RawBigint* Bigint::NewFromShiftedInt64(int64_t value,
+                                       intptr_t shift,
                                        Heap::Space space) {
   ASSERT(kBitsPerDigit == 32);
   ASSERT(shift >= 0);
@@ -19317,8 +19105,8 @@
   SetDigitAt(digits, 1 + digit_shift,
              static_cast<uint32_t>(abs_value >> (32 - bit_shift)));
   SetDigitAt(digits, 2 + digit_shift,
-      (bit_shift == 0) ? 0
-                       : static_cast<uint32_t>(abs_value >> (64 - bit_shift)));
+             (bit_shift == 0) ? 0 : static_cast<uint32_t>(abs_value >>
+                                                          (64 - bit_shift)));
   return New(neg, used, digits, space);
 }
 
@@ -19334,8 +19122,7 @@
   }
   intptr_t used;
   const intptr_t str_length = strlen(str);
-  if ((str_length >= 2) &&
-      (str[0] == '0') &&
+  if ((str_length >= 2) && (str[0] == '0') &&
       ((str[1] == 'x') || (str[1] == 'X'))) {
     digits = NewDigitsFromHexCString(&str[2], &used, space);
   } else {
@@ -19349,8 +19136,8 @@
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
   Isolate* isolate = thread->isolate();
-  const Bigint& value = Bigint::Handle(
-      zone, Bigint::NewFromCString(str.ToCString(), Heap::kOld));
+  const Bigint& value =
+      Bigint::Handle(zone, Bigint::NewFromCString(str.ToCString(), Heap::kOld));
   const Class& cls =
       Class::Handle(zone, isolate->object_store()->bigint_class());
   intptr_t index = 0;
@@ -19377,7 +19164,8 @@
 }
 
 
-RawTypedData* Bigint::NewDigitsFromHexCString(const char* str, intptr_t* used,
+RawTypedData* Bigint::NewDigitsFromHexCString(const char* str,
+                                              intptr_t* used,
                                               Heap::Space space) {
   const int kBitsPerHexDigit = 4;
   const int kHexDigitsPerDigit = 8;
@@ -19408,7 +19196,8 @@
 }
 
 
-RawTypedData* Bigint::NewDigitsFromDecCString(const char* str, intptr_t* used,
+RawTypedData* Bigint::NewDigitsFromDecCString(const char* str,
+                                              intptr_t* used,
                                               Heap::Space space) {
   // Read 9 digits a time. 10^9 < 2^32.
   const int kDecDigitsPerIteration = 9;
@@ -19423,8 +19212,8 @@
   // The extra 5 digits allocated take care of variations.
   const int64_t kLog10Dividend = 33219281;
   const int64_t kLog10Divisor = 10000000;
-  const intptr_t length = (kLog10Dividend * str_length) /
-                          (kLog10Divisor * kBitsPerDigit) + 5;
+  const intptr_t length =
+      (kLog10Dividend * str_length) / (kLog10Divisor * kBitsPerDigit) + 5;
   const TypedData& digits = TypedData::Handle(NewDigits(length, space));
   // Read first digit separately. This avoids a multiplication and addition.
   // The first digit might also not have kDecDigitsPerIteration decimal digits.
@@ -19496,8 +19285,8 @@
   if (y > 0) {
     return static_cast<double>(y);
   } else {
-    const double half = static_cast<double>(
-        static_cast<int64_t>(x >> 1) | (y & 1));
+    const double half =
+        static_cast<double>(static_cast<int64_t>(x >> 1) | (y & 1));
     return half + half;
   }
 #else
@@ -19710,7 +19499,7 @@
     const Bigint& other_bgi = Bigint::Cast(other);
     int64_t result = Used() - other_bgi.Used();
     if (result == 0) {
-      for (intptr_t i = Used(); --i >= 0; ) {
+      for (intptr_t i = Used(); --i >= 0;) {
         result = DigitAt(i);
         result -= other_bgi.DigitAt(i);
         if (result != 0) break;
@@ -19725,7 +19514,7 @@
 }
 
 
-const char* Bigint::ToDecCString(uword (*allocator)(intptr_t size)) const {
+const char* Bigint::ToDecCString(Zone* zone) const {
   // log10(2) ~= 0.30102999566398114.
   const intptr_t kLog2Dividend = 30103;
   const intptr_t kLog2Divisor = 100000;
@@ -19740,7 +19529,7 @@
   const int64_t dec_len = (bit_len * kLog2Dividend / kLog2Divisor) + 1;
   // Add one byte for the minus sign and for the trailing \0 character.
   const int64_t len = (Neg() ? 1 : 0) + dec_len + 1;
-  char* chars = reinterpret_cast<char*>(allocator(len));
+  char* chars = zone->Alloc<char>(len);
   intptr_t pos = 0;
   const intptr_t kDivisor = 100000000;
   const intptr_t kDigits = 8;
@@ -19748,10 +19537,9 @@
   ASSERT(kDivisor < kDigitBase);
   ASSERT(Smi::IsValid(kDivisor));
   // Allocate a copy of the digits.
-  const TypedData& rest_digits = TypedData::Handle(
-      TypedData::New(kTypedDataUint32ArrayCid, used));
+  uint32_t* rest_digits = zone->Alloc<uint32_t>(used);
   for (intptr_t i = 0; i < used; i++) {
-    rest_digits.SetUint32(i << 2, DigitAt(i));
+    rest_digits[i] = DigitAt(i);
   }
   if (used == 0) {
     chars[pos++] = '0';
@@ -19759,15 +19547,15 @@
   while (used > 0) {
     uint32_t remainder = 0;
     for (intptr_t i = used - 1; i >= 0; i--) {
-      uint64_t dividend = (static_cast<uint64_t>(remainder) << kBitsPerDigit) +
-          rest_digits.GetUint32(i << 2);
+      uint64_t dividend =
+          (static_cast<uint64_t>(remainder) << kBitsPerDigit) + rest_digits[i];
       uint32_t quotient = static_cast<uint32_t>(dividend / kDivisor);
       remainder = static_cast<uint32_t>(
           dividend - static_cast<uint64_t>(quotient) * kDivisor);
-      rest_digits.SetUint32(i << 2, quotient);
+      rest_digits[i] = quotient;
     }
     // Clamp rest_digits.
-    while ((used > 0) && (rest_digits.GetUint32((used - 1) << 2) == 0)) {
+    while ((used > 0) && (rest_digits[used - 1] == 0)) {
       used--;
     }
     for (intptr_t i = 0; i < kDigits; i++) {
@@ -19798,12 +19586,12 @@
 }
 
 
-const char* Bigint::ToHexCString(uword (*allocator)(intptr_t size)) const {
+const char* Bigint::ToHexCString(Zone* zone) const {
   const intptr_t used = Used();
   if (used == 0) {
     const char* zero = "0x0";
     const size_t len = strlen(zero) + 1;
-    char* chars = reinterpret_cast<char*>(allocator(len));
+    char* chars = zone->Alloc<char>(len);
     strncpy(chars, zero, len);
     return chars;
   }
@@ -19824,7 +19612,7 @@
   }
   // Add bytes for '0x', for the minus sign, and for the trailing \0 character.
   const int32_t len = (Neg() ? 1 : 0) + 2 + hex_len + 1;
-  char* chars = reinterpret_cast<char*>(allocator(len));
+  char* chars = zone->Alloc<char>(len);
   intptr_t pos = len;
   chars[--pos] = '\0';
   for (intptr_t i = 0; i < (used - 1); i++) {
@@ -19849,14 +19637,8 @@
 }
 
 
-static uword BigintAllocator(intptr_t size) {
-  Zone* zone = Thread::Current()->zone();
-  return zone->AllocUnsafe(size);
-}
-
-
 const char* Bigint::ToCString() const {
-  return ToDecCString(&BigintAllocator);
+  return ToDecCString(Thread::Current()->zone());
 }
 
 
@@ -19864,9 +19646,7 @@
 class StringHasher : ValueObject {
  public:
   StringHasher() : hash_(0) {}
-  void Add(int32_t ch) {
-    hash_ = CombineHashes(hash_, ch);
-  }
+  void Add(int32_t ch) { hash_ = CombineHashes(hash_, ch); }
   void Add(const String& str, intptr_t begin_index, intptr_t len);
 
   // Return a non-zero hash of at most 'bits' bits.
@@ -19876,6 +19656,7 @@
     ASSERT(hash_ <= static_cast<uint32_t>(kMaxInt32));
     return hash_;
   }
+
  private:
   uint32_t hash_;
 };
@@ -19927,7 +19708,7 @@
 }
 
 
-template<typename T>
+template <typename T>
 static intptr_t HashImpl(const T* characters, intptr_t len) {
   ASSERT(len >= 0);
   StringHasher hasher;
@@ -20047,8 +19828,7 @@
   Scanner::CharAtFunc this_char_at_func = this->CharAtFunc();
   Scanner::CharAtFunc str_char_at_func = str.CharAtFunc();
   for (intptr_t i = 0; i < len; i++) {
-    if (this_char_at_func(*this, i) !=
-        str_char_at_func(str, begin_index + i)) {
+    if (this_char_at_func(*this, i) != str_char_at_func(str, begin_index + i)) {
       return false;
     }
   }
@@ -20067,9 +19847,8 @@
       return false;
     }
     int32_t ch;
-    intptr_t consumed = Utf8::Decode(reinterpret_cast<const uint8_t*>(cstr),
-                                     len,
-                                     &ch);
+    intptr_t consumed =
+        Utf8::Decode(reinterpret_cast<const uint8_t*>(cstr), len, &ch);
     if (consumed == 0 || it.Current() != ch) {
       return false;
     }
@@ -20111,26 +19890,28 @@
 
 
 bool String::Equals(const int32_t* utf32_array, intptr_t len) const {
-  CodePointIterator it(*this);
-  intptr_t i = 0;
-  bool has_more = it.Next();
-  while (has_more && (i < len)) {
-    if ((it.Current() != static_cast<int32_t>(utf32_array[i]))) {
-      return false;
+  if (len < 0) return false;
+  intptr_t j = 0;
+  for (intptr_t i = 0; i < len; ++i) {
+    if (Utf::IsSupplementary(utf32_array[i])) {
+      uint16_t encoded[2];
+      Utf16::Encode(utf32_array[i], &encoded[0]);
+      if (j + 1 >= Length()) return false;
+      if (CharAt(j++) != encoded[0]) return false;
+      if (CharAt(j++) != encoded[1]) return false;
+    } else {
+      if (j >= Length()) return false;
+      if (CharAt(j++) != utf32_array[i]) return false;
     }
-    // Advance both streams forward.
-    ++i;
-    has_more = it.Next();
   }
-  // Strings are only true iff we reached the end in both streams.
-  return (i == len) && !has_more;
+  return j == Length();
 }
 
 
 bool String::EqualsConcat(const String& str1, const String& str2) const {
   return (Length() == str1.Length() + str2.Length()) &&
-    str1.Equals(*this, 0, str1.Length()) &&
-    str2.Equals(*this, str1.Length(), str2.Length());
+         str1.Equals(*this, 0, str1.Length()) &&
+         str2.Equals(*this, str1.Length(), str2.Length());
 }
 
 
@@ -20211,8 +19992,8 @@
   ASSERT((type == Utf8::kBMP) || (type == Utf8::kSupplementary));
   const String& strobj = String::Handle(TwoByteString::New(len, space));
   NoSafepointScope no_safepoint;
-  Utf8::DecodeToUTF16(utf8_array, array_len,
-                      TwoByteString::CharAddr(strobj, 0), len);
+  Utf8::DecodeToUTF16(utf8_array, array_len, TwoByteString::CharAddr(strobj, 0),
+                      len);
   return strobj.raw();
 }
 
@@ -20298,7 +20079,8 @@
 }
 
 
-void String::Copy(const String& dst, intptr_t dst_offset,
+void String::Copy(const String& dst,
+                  intptr_t dst_offset,
                   const uint8_t* characters,
                   intptr_t len) {
   ASSERT(dst_offset >= 0);
@@ -20307,9 +20089,7 @@
   if (dst.IsOneByteString()) {
     NoSafepointScope no_safepoint;
     if (len > 0) {
-      memmove(OneByteString::CharAddr(dst, dst_offset),
-              characters,
-              len);
+      memmove(OneByteString::CharAddr(dst, dst_offset), characters, len);
     }
   } else if (dst.IsTwoByteString()) {
     for (intptr_t i = 0; i < len; ++i) {
@@ -20319,7 +20099,8 @@
 }
 
 
-void String::Copy(const String& dst, intptr_t dst_offset,
+void String::Copy(const String& dst,
+                  intptr_t dst_offset,
                   const uint16_t* utf16_array,
                   intptr_t array_len) {
   ASSERT(dst_offset >= 0);
@@ -20335,16 +20116,17 @@
     ASSERT(dst.IsTwoByteString());
     NoSafepointScope no_safepoint;
     if (array_len > 0) {
-      memmove(TwoByteString::CharAddr(dst, dst_offset),
-              utf16_array,
+      memmove(TwoByteString::CharAddr(dst, dst_offset), utf16_array,
               array_len * 2);
     }
   }
 }
 
 
-void String::Copy(const String& dst, intptr_t dst_offset,
-                  const String& src, intptr_t src_offset,
+void String::Copy(const String& dst,
+                  intptr_t dst_offset,
+                  const String& src,
+                  intptr_t src_offset,
                   intptr_t len) {
   ASSERT(dst_offset >= 0);
   ASSERT(src_offset >= 0);
@@ -20356,33 +20138,25 @@
     if (char_size == kOneByteChar) {
       if (src.IsOneByteString()) {
         NoSafepointScope no_safepoint;
-        String::Copy(dst,
-                     dst_offset,
-                     OneByteString::CharAddr(src, src_offset),
+        String::Copy(dst, dst_offset, OneByteString::CharAddr(src, src_offset),
                      len);
       } else {
         ASSERT(src.IsExternalOneByteString());
         NoSafepointScope no_safepoint;
-        String::Copy(dst,
-                     dst_offset,
-                     ExternalOneByteString::CharAddr(src, src_offset),
-                     len);
+        String::Copy(dst, dst_offset,
+                     ExternalOneByteString::CharAddr(src, src_offset), len);
       }
     } else {
       ASSERT(char_size == kTwoByteChar);
       if (src.IsTwoByteString()) {
         NoSafepointScope no_safepoint;
-        String::Copy(dst,
-                     dst_offset,
-                     TwoByteString::CharAddr(src, src_offset),
+        String::Copy(dst, dst_offset, TwoByteString::CharAddr(src, src_offset),
                      len);
       } else {
         ASSERT(src.IsExternalTwoByteString());
         NoSafepointScope no_safepoint;
-        String::Copy(dst,
-                     dst_offset,
-                     ExternalTwoByteString::CharAddr(src, src_offset),
-                     len);
+        String::Copy(dst, dst_offset,
+                     ExternalTwoByteString::CharAddr(src, src_offset), len);
       }
     }
   }
@@ -20571,7 +20345,8 @@
 }
 
 
-RawString* String::NewFormattedV(const char* format, va_list args,
+RawString* String::NewFormattedV(const char* format,
+                                 va_list args,
                                  Heap::Space space) {
   va_list args_copy;
   va_copy(args_copy, args);
@@ -20598,8 +20373,7 @@
 }
 
 
-RawString* String::ConcatAll(const Array& strings,
-                             Heap::Space space) {
+RawString* String::ConcatAll(const Array& strings, Heap::Space space) {
   return ConcatAllRange(strings, 0, strings.Length(), space);
 }
 
@@ -20640,9 +20414,7 @@
   if (begin_index >= str.Length()) {
     return String::null();
   }
-  return String::SubString(str,
-                           begin_index,
-                           (str.Length() - begin_index),
+  return String::SubString(str, begin_index, (str.Length() - begin_index),
                            space);
 }
 
@@ -20729,11 +20501,8 @@
     intptr_t external_size) {
   ASSERT((callback != NULL && peer != NULL) ||
          (callback == NULL && peer == NULL));
-  return FinalizablePersistentHandle::New(Isolate::Current(),
-                                          referent,
-                                          peer,
-                                          callback,
-                                          external_size);
+  return FinalizablePersistentHandle::New(Isolate::Current(), referent, peer,
+                                          callback, external_size);
 }
 
 
@@ -20780,8 +20549,8 @@
       } while (tags != old_tags);
       result = this->raw();
       const uint8_t* ext_array = reinterpret_cast<const uint8_t*>(array);
-      ExternalStringData<uint8_t>* ext_data = new ExternalStringData<uint8_t>(
-          ext_array, peer, cback);
+      ExternalStringData<uint8_t>* ext_data =
+          new ExternalStringData<uint8_t>(ext_array, peer, cback);
       ASSERT(result.Length() == str_length);
       ASSERT(!result.HasHash() ||
              (result.Hash() == String::Hash(ext_array, str_length)));
@@ -20796,8 +20565,7 @@
 
       // Copy the data into the external array.
       if (str_length > 0) {
-        memmove(array,
-                TwoByteString::CharAddr(*this, 0),
+        memmove(array, TwoByteString::CharAddr(*this, 0),
                 (str_length * kTwoByteChar));
       }
 
@@ -20818,8 +20586,8 @@
       } while (tags != old_tags);
       result = this->raw();
       const uint16_t* ext_array = reinterpret_cast<const uint16_t*>(array);
-      ExternalStringData<uint16_t>* ext_data = new ExternalStringData<uint16_t>(
-          ext_array, peer, cback);
+      ExternalStringData<uint16_t>* ext_data =
+          new ExternalStringData<uint16_t>(ext_array, peer, cback);
       ASSERT(result.Length() == str_length);
       ASSERT(!result.HasHash() ||
              (result.Hash() == String::Hash(ext_array, str_length)));
@@ -20871,7 +20639,8 @@
 }
 
 bool String::ParseDouble(const String& str,
-                         intptr_t start, intptr_t end,
+                         intptr_t start,
+                         intptr_t end,
                          double* result) {
   ASSERT(0 <= start);
   ASSERT(start <= end);
@@ -20896,8 +20665,8 @@
     }
     startChar = chars;
   }
-  return CStringToDouble(reinterpret_cast<const char*>(startChar),
-                         length, result);
+  return CStringToDouble(reinterpret_cast<const char*>(startChar), length,
+                         result);
 }
 
 
@@ -20912,9 +20681,8 @@
 //
 //    _ReceivePortImpl@6be832b._internal@6be832b
 //
-template<typename T1, typename T2>
-static bool EqualsIgnoringPrivateKey(const String& str1,
-                                     const String& str2) {
+template <typename T1, typename T2>
+static bool EqualsIgnoringPrivateKey(const String& str1, const String& str2) {
   intptr_t len = str1.Length();
   intptr_t str2_len = str2.Length();
   if (len == str2_len) {
@@ -20956,22 +20724,21 @@
 
 #define EQUALS_IGNORING_PRIVATE_KEY(class_id, type, str1, str2)                \
   switch (class_id) {                                                          \
-    case kOneByteStringCid :                                                   \
+    case kOneByteStringCid:                                                    \
       return dart::EqualsIgnoringPrivateKey<type, OneByteString>(str1, str2);  \
-    case kTwoByteStringCid :                                                   \
+    case kTwoByteStringCid:                                                    \
       return dart::EqualsIgnoringPrivateKey<type, TwoByteString>(str1, str2);  \
-    case kExternalOneByteStringCid :                                           \
-      return dart::EqualsIgnoringPrivateKey<type, ExternalOneByteString>(str1, \
-                                                                         str2);\
-    case kExternalTwoByteStringCid :                                           \
-      return dart::EqualsIgnoringPrivateKey<type, ExternalTwoByteString>(str1, \
-                                                                         str2);\
+    case kExternalOneByteStringCid:                                            \
+      return dart::EqualsIgnoringPrivateKey<type, ExternalOneByteString>(      \
+          str1, str2);                                                         \
+    case kExternalTwoByteStringCid:                                            \
+      return dart::EqualsIgnoringPrivateKey<type, ExternalTwoByteString>(      \
+          str1, str2);                                                         \
   }                                                                            \
-  UNREACHABLE();                                                               \
+  UNREACHABLE();
 
 
-bool String::EqualsIgnoringPrivateKey(const String& str1,
-                                      const String& str2) {
+bool String::EqualsIgnoringPrivateKey(const String& str1, const String& str2) {
   if (str1.raw() == str2.raw()) {
     return true;  // Both handles point to the same raw instance.
   }
@@ -20979,19 +20746,19 @@
   intptr_t str1_class_id = str1.raw()->GetClassId();
   intptr_t str2_class_id = str2.raw()->GetClassId();
   switch (str1_class_id) {
-    case kOneByteStringCid :
+    case kOneByteStringCid:
       EQUALS_IGNORING_PRIVATE_KEY(str2_class_id, OneByteString, str1, str2);
       break;
-    case kTwoByteStringCid :
+    case kTwoByteStringCid:
       EQUALS_IGNORING_PRIVATE_KEY(str2_class_id, TwoByteString, str1, str2);
       break;
-    case kExternalOneByteStringCid :
-      EQUALS_IGNORING_PRIVATE_KEY(str2_class_id,
-                                  ExternalOneByteString, str1, str2);
+    case kExternalOneByteStringCid:
+      EQUALS_IGNORING_PRIVATE_KEY(str2_class_id, ExternalOneByteString, str1,
+                                  str2);
       break;
-    case kExternalTwoByteStringCid :
-      EQUALS_IGNORING_PRIVATE_KEY(str2_class_id,
-                                  ExternalTwoByteString, str1, str2);
+    case kExternalTwoByteStringCid:
+      EQUALS_IGNORING_PRIVATE_KEY(str2_class_id, ExternalTwoByteString, str1,
+                                  str2);
       break;
   }
   UNREACHABLE();
@@ -21025,8 +20792,8 @@
     for (intptr_t i = 0; i < len; i++) {
       num_escapes += EscapeOverhead(CharAt(str, i));
     }
-    const String& dststr = String::Handle(
-        OneByteString::New(len + num_escapes, Heap::kNew));
+    const String& dststr =
+        String::Handle(OneByteString::New(len + num_escapes, Heap::kNew));
     intptr_t index = 0;
     for (intptr_t i = 0; i < len; i++) {
       uint8_t ch = CharAt(str, i);
@@ -21059,8 +20826,8 @@
     for (intptr_t i = 0; i < len; i++) {
       num_escapes += EscapeOverhead(CharAt(str, i));
     }
-    const String& dststr = String::Handle(
-        OneByteString::New(len + num_escapes, Heap::kNew));
+    const String& dststr =
+        String::Handle(OneByteString::New(len + num_escapes, Heap::kNew));
     intptr_t index = 0;
     for (intptr_t i = 0; i < len; i++) {
       uint8_t ch = CharAt(str, i);
@@ -21085,8 +20852,7 @@
 }
 
 
-RawOneByteString* OneByteString::New(intptr_t len,
-                                     Heap::Space space) {
+RawOneByteString* OneByteString::New(intptr_t len, Heap::Space space) {
   ASSERT((Isolate::Current() == Dart::vm_isolate()) ||
          ((Isolate::Current()->object_store() != NULL) &&
           (Isolate::Current()->object_store()->one_byte_string_class() !=
@@ -21097,8 +20863,7 @@
   }
   {
     RawObject* raw = Object::Allocate(OneByteString::kClassId,
-                                      OneByteString::InstanceSize(len),
-                                      space);
+                                      OneByteString::InstanceSize(len), space);
     NoSafepointScope no_safepoint;
     RawOneByteString* result = reinterpret_cast<RawOneByteString*>(raw);
     result->StoreSmi(&(result->ptr()->length_), Smi::New(len));
@@ -21146,8 +20911,7 @@
 }
 
 
-RawOneByteString* OneByteString::New(const String& str,
-                                     Heap::Space space) {
+RawOneByteString* OneByteString::New(const String& str, Heap::Space space) {
   intptr_t len = str.Length();
   const String& result = String::Handle(OneByteString::New(len, space));
   String::Copy(result, 0, str, 0, len);
@@ -21180,8 +20944,7 @@
   if (other_len > 0) {
     NoSafepointScope no_safepoint;
     memmove(OneByteString::CharAddr(result, 0),
-            other_typed_data.DataAddr(other_start_index),
-            other_len);
+            other_typed_data.DataAddr(other_start_index), other_len);
   }
   return OneByteString::raw(result);
 }
@@ -21196,8 +20959,7 @@
   if (other_len > 0) {
     NoSafepointScope no_safepoint;
     memmove(OneByteString::CharAddr(result, 0),
-            other_typed_data.DataAddr(other_start_index),
-            other_len);
+            other_typed_data.DataAddr(other_start_index), other_len);
   }
   return OneByteString::raw(result);
 }
@@ -21269,7 +21031,7 @@
   NoSafepointScope no_safepoint;
   if (length > 0) {
     uint8_t* dest = &result->ptr()->data()[0];
-    const uint8_t* src =  &raw_ptr(str)->data()[begin_index];
+    const uint8_t* src = &raw_ptr(str)->data()[begin_index];
     memmove(dest, src, length);
   }
   return result;
@@ -21303,8 +21065,8 @@
     for (intptr_t i = 0; i < len; i++) {
       num_escapes += EscapeOverhead(CharAt(str, i));
     }
-    const String& dststr = String::Handle(
-        TwoByteString::New(len + num_escapes, Heap::kNew));
+    const String& dststr =
+        String::Handle(TwoByteString::New(len + num_escapes, Heap::kNew));
     intptr_t index = 0;
     for (intptr_t i = 0; i < len; i++) {
       uint16_t ch = CharAt(str, i);
@@ -21329,8 +21091,7 @@
 }
 
 
-RawTwoByteString* TwoByteString::New(intptr_t len,
-                                     Heap::Space space) {
+RawTwoByteString* TwoByteString::New(intptr_t len, Heap::Space space) {
   ASSERT(Isolate::Current()->object_store()->two_byte_string_class());
   if (len < 0 || len > kMaxElements) {
     // This should be caught before we reach here.
@@ -21339,8 +21100,7 @@
   String& result = String::Handle();
   {
     RawObject* raw = Object::Allocate(TwoByteString::kClassId,
-                                      TwoByteString::InstanceSize(len),
-                                      space);
+                                      TwoByteString::InstanceSize(len), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.SetLength(len);
@@ -21388,8 +21148,7 @@
 }
 
 
-RawTwoByteString* TwoByteString::New(const String& str,
-                                     Heap::Space space) {
+RawTwoByteString* TwoByteString::New(const String& str, Heap::Space space) {
   intptr_t len = str.Length();
   const String& result = String::Handle(TwoByteString::New(len, space));
   String::Copy(result, 0, str, 0, len);
@@ -21514,8 +21273,8 @@
     void* peer,
     Dart_PeerFinalizer callback,
     Heap::Space space) {
-  ASSERT(Isolate::Current()->object_store()->
-         external_one_byte_string_class() != Class::null());
+  ASSERT(Isolate::Current()->object_store()->external_one_byte_string_class() !=
+         Class::null());
   if (len < 0 || len > kMaxElements) {
     // This should be caught before we reach here.
     FATAL1("Fatal error in ExternalOneByteString::New: invalid len %" Pd "\n",
@@ -21525,9 +21284,9 @@
   ExternalStringData<uint8_t>* external_data =
       new ExternalStringData<uint8_t>(data, peer, callback);
   {
-    RawObject* raw = Object::Allocate(ExternalOneByteString::kClassId,
-                                      ExternalOneByteString::InstanceSize(),
-                                      space);
+    RawObject* raw =
+        Object::Allocate(ExternalOneByteString::kClassId,
+                         ExternalOneByteString::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.SetLength(len);
@@ -21565,9 +21324,9 @@
   ExternalStringData<uint16_t>* external_data =
       new ExternalStringData<uint16_t>(data, peer, callback);
   {
-    RawObject* raw = Object::Allocate(ExternalTwoByteString::kClassId,
-                                      ExternalTwoByteString::InstanceSize(),
-                                      space);
+    RawObject* raw =
+        Object::Allocate(ExternalTwoByteString::kClassId,
+                         ExternalTwoByteString::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.SetLength(len);
@@ -21594,9 +21353,8 @@
   {
     // Since the two boolean instances are singletons we allocate them straight
     // in the old generation.
-    RawObject* raw = Object::Allocate(Bool::kClassId,
-                                      Bool::InstanceSize(),
-                                      Heap::kOld);
+    RawObject* raw =
+        Object::Allocate(Bool::kClassId, Bool::InstanceSize(), Heap::kOld);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -21641,8 +21399,8 @@
     return true;
   }
   const TypeArguments& type_args = TypeArguments::Handle(GetTypeArguments());
-  const TypeArguments& other_type_args = TypeArguments::Handle(
-      other.GetTypeArguments());
+  const TypeArguments& other_type_args =
+      TypeArguments::Handle(other.GetTypeArguments());
   if (!type_args.Equals(other_type_args)) {
     return false;
   }
@@ -21678,9 +21436,7 @@
   }
   {
     RawArray* raw = reinterpret_cast<RawArray*>(
-        Object::Allocate(class_id,
-                         Array::InstanceSize(len),
-                         space));
+        Object::Allocate(class_id, Array::InstanceSize(len), space));
     NoSafepointScope no_safepoint;
     raw->StoreSmi(&(raw->ptr()->length_), Smi::New(len));
     return raw;
@@ -21713,8 +21469,8 @@
   uword old_tags;
   do {
     old_tags = tags;
-    uword new_tags = RawObject::ClassIdTag::update(kImmutableArrayCid,
-                                                   old_tags);
+    uword new_tags =
+        RawObject::ClassIdTag::update(kImmutableArrayCid, old_tags);
     tags = CompareAndSwapTags(old_tags, new_tags);
   } while (tags != old_tags);
 }
@@ -21725,8 +21481,8 @@
     return IsImmutable() ? "_ImmutableList NULL" : "_List NULL";
   }
   Zone* zone = Thread::Current()->zone();
-  const char* format = IsImmutable() ? "_ImmutableList len:%" Pd
-                                     : "_List len:%" Pd;
+  const char* format =
+      IsImmutable() ? "_ImmutableList len:%" Pd : "_List len:%" Pd;
   return zone->PrintToString(format, Length());
 }
 
@@ -21822,8 +21578,8 @@
           this->SetAt(i, obj);
         } else {
           ASSERT(error_str != NULL);
-          char* chars = OS::SCreate(
-              zone, "element at index %" Pd ": %s\n", i, obj.ToCString());
+          char* chars = OS::SCreate(zone, "element at index %" Pd ": %s\n", i,
+                                    obj.ToCString());
           *error_str = chars;
           return false;
         }
@@ -21834,8 +21590,7 @@
 }
 
 
-RawImmutableArray* ImmutableArray::New(intptr_t len,
-                                       Heap::Space space) {
+RawImmutableArray* ImmutableArray::New(intptr_t len, Heap::Space space) {
   ASSERT(Isolate::Current()->object_store()->immutable_array_class() !=
          Class::null());
   return reinterpret_cast<RawImmutableArray*>(Array::New(kClassId, len, space));
@@ -21890,13 +21645,13 @@
 
 RawGrowableObjectArray* GrowableObjectArray::New(const Array& array,
                                                  Heap::Space space) {
-  ASSERT(Isolate::Current()->object_store()->growable_object_array_class()
-         != Class::null());
+  ASSERT(Isolate::Current()->object_store()->growable_object_array_class() !=
+         Class::null());
   GrowableObjectArray& result = GrowableObjectArray::Handle();
   {
-    RawObject* raw = Object::Allocate(GrowableObjectArray::kClassId,
-                                      GrowableObjectArray::InstanceSize(),
-                                      space);
+    RawObject* raw =
+        Object::Allocate(GrowableObjectArray::kClassId,
+                         GrowableObjectArray::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.SetLength(0);
@@ -21911,7 +21666,7 @@
     return "_GrowableList NULL";
   }
   return OS::SCreate(Thread::Current()->zone(),
-      "Instance(length:%" Pd ") of '_GrowableList'", Length());
+                     "Instance(length:%" Pd ") of '_GrowableList'", Length());
 }
 
 
@@ -21953,8 +21708,8 @@
 
 RawLinkedHashMap* LinkedHashMap::NewDefault(Heap::Space space) {
   const Array& data = Array::Handle(Array::New(kInitialIndexSize, space));
-  const TypedData& index = TypedData::Handle(TypedData::New(
-      kTypedDataUint32ArrayCid, kInitialIndexSize, space));
+  const TypedData& index = TypedData::Handle(
+      TypedData::New(kTypedDataUint32ArrayCid, kInitialIndexSize, space));
   // On 32-bit, the top bits are wasted to avoid Mint allocation.
   static const intptr_t kAvailableBits = (kSmiBits >= 32) ? 32 : kSmiBits;
   static const intptr_t kInitialHashMask =
@@ -21969,10 +21724,10 @@
                                      intptr_t used_data,
                                      intptr_t deleted_keys,
                                      Heap::Space space) {
-  ASSERT(Isolate::Current()->object_store()->linked_hash_map_class()
-         != Class::null());
-  LinkedHashMap& result = LinkedHashMap::Handle(
-      LinkedHashMap::NewUninitialized(space));
+  ASSERT(Isolate::Current()->object_store()->linked_hash_map_class() !=
+         Class::null());
+  LinkedHashMap& result =
+      LinkedHashMap::Handle(LinkedHashMap::NewUninitialized(space));
   result.SetData(data);
   result.SetIndex(index);
   result.SetHashMask(hash_mask);
@@ -21983,13 +21738,12 @@
 
 
 RawLinkedHashMap* LinkedHashMap::NewUninitialized(Heap::Space space) {
-  ASSERT(Isolate::Current()->object_store()->linked_hash_map_class()
-         != Class::null());
+  ASSERT(Isolate::Current()->object_store()->linked_hash_map_class() !=
+         Class::null());
   LinkedHashMap& result = LinkedHashMap::Handle();
   {
     RawObject* raw = Object::Allocate(LinkedHashMap::kClassId,
-                                      LinkedHashMap::InstanceSize(),
-                                      space);
+                                      LinkedHashMap::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -22003,15 +21757,17 @@
 }
 
 
-RawFloat32x4* Float32x4::New(float v0, float v1, float v2, float v3,
+RawFloat32x4* Float32x4::New(float v0,
+                             float v1,
+                             float v2,
+                             float v3,
                              Heap::Space space) {
   ASSERT(Isolate::Current()->object_store()->float32x4_class() !=
          Class::null());
   Float32x4& result = Float32x4::Handle();
   {
-    RawObject* raw = Object::Allocate(Float32x4::kClassId,
-                                      Float32x4::InstanceSize(),
-                                      space);
+    RawObject* raw =
+        Object::Allocate(Float32x4::kClassId, Float32x4::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -22028,9 +21784,8 @@
          Class::null());
   Float32x4& result = Float32x4::Handle();
   {
-    RawObject* raw = Object::Allocate(Float32x4::kClassId,
-                                      Float32x4::InstanceSize(),
-                                      space);
+    RawObject* raw =
+        Object::Allocate(Float32x4::kClassId, Float32x4::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -22094,20 +21849,21 @@
   float _y = y();
   float _z = z();
   float _w = w();
-  return OS::SCreate(Thread::Current()->zone(),
-      "[%f, %f, %f, %f]", _x, _y, _z, _w);
+  return OS::SCreate(Thread::Current()->zone(), "[%f, %f, %f, %f]", _x, _y, _z,
+                     _w);
 }
 
 
-RawInt32x4* Int32x4::New(int32_t v0, int32_t v1, int32_t v2, int32_t v3,
+RawInt32x4* Int32x4::New(int32_t v0,
+                         int32_t v1,
+                         int32_t v2,
+                         int32_t v3,
                          Heap::Space space) {
-  ASSERT(Isolate::Current()->object_store()->int32x4_class() !=
-         Class::null());
+  ASSERT(Isolate::Current()->object_store()->int32x4_class() != Class::null());
   Int32x4& result = Int32x4::Handle();
   {
-    RawObject* raw = Object::Allocate(Int32x4::kClassId,
-                                      Int32x4::InstanceSize(),
-                                      space);
+    RawObject* raw =
+        Object::Allocate(Int32x4::kClassId, Int32x4::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -22120,13 +21876,11 @@
 
 
 RawInt32x4* Int32x4::New(simd128_value_t value, Heap::Space space) {
-  ASSERT(Isolate::Current()->object_store()->int32x4_class() !=
-         Class::null());
+  ASSERT(Isolate::Current()->object_store()->int32x4_class() != Class::null());
   Int32x4& result = Int32x4::Handle();
   {
-    RawObject* raw = Object::Allocate(Int32x4::kClassId,
-                                      Int32x4::InstanceSize(),
-                                      space);
+    RawObject* raw =
+        Object::Allocate(Int32x4::kClassId, Int32x4::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -22190,8 +21944,8 @@
   int32_t _y = y();
   int32_t _z = z();
   int32_t _w = w();
-  return OS::SCreate(Thread::Current()->zone(),
-      "[%08x, %08x, %08x, %08x]", _x, _y, _z, _w);
+  return OS::SCreate(Thread::Current()->zone(), "[%08x, %08x, %08x, %08x]", _x,
+                     _y, _z, _w);
 }
 
 
@@ -22200,9 +21954,8 @@
          Class::null());
   Float64x2& result = Float64x2::Handle();
   {
-    RawObject* raw = Object::Allocate(Float64x2::kClassId,
-                                      Float64x2::InstanceSize(),
-                                      space);
+    RawObject* raw =
+        Object::Allocate(Float64x2::kClassId, Float64x2::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -22217,9 +21970,8 @@
          Class::null());
   Float64x2& result = Float64x2::Handle();
   {
-    RawObject* raw = Object::Allocate(Float64x2::kClassId,
-                                      Float64x2::InstanceSize(),
-                                      space);
+    RawObject* raw =
+        Object::Allocate(Float64x2::kClassId, Float64x2::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -22266,20 +22018,20 @@
 
 
 const intptr_t TypedData::element_size_table[TypedData::kNumElementSizes] = {
-  1,   // kTypedDataInt8ArrayCid.
-  1,   // kTypedDataUint8ArrayCid.
-  1,   // kTypedDataUint8ClampedArrayCid.
-  2,   // kTypedDataInt16ArrayCid.
-  2,   // kTypedDataUint16ArrayCid.
-  4,   // kTypedDataInt32ArrayCid.
-  4,   // kTypedDataUint32ArrayCid.
-  8,   // kTypedDataInt64ArrayCid.
-  8,   // kTypedDataUint64ArrayCid.
-  4,   // kTypedDataFloat32ArrayCid.
-  8,   // kTypedDataFloat64ArrayCid.
-  16,  // kTypedDataFloat32x4ArrayCid.
-  16,  // kTypedDataInt32x4ArrayCid.
-  16,  // kTypedDataFloat64x2ArrayCid,
+    1,   // kTypedDataInt8ArrayCid.
+    1,   // kTypedDataUint8ArrayCid.
+    1,   // kTypedDataUint8ClampedArrayCid.
+    2,   // kTypedDataInt16ArrayCid.
+    2,   // kTypedDataUint16ArrayCid.
+    4,   // kTypedDataInt32ArrayCid.
+    4,   // kTypedDataUint32ArrayCid.
+    8,   // kTypedDataInt64ArrayCid.
+    8,   // kTypedDataUint64ArrayCid.
+    4,   // kTypedDataFloat32ArrayCid.
+    8,   // kTypedDataFloat64ArrayCid.
+    16,  // kTypedDataFloat32x4ArrayCid.
+    16,  // kTypedDataInt32x4ArrayCid.
+    16,  // kTypedDataFloat64x2ArrayCid,
 };
 
 
@@ -22305,7 +22057,7 @@
   }
   NoSafepointScope no_safepoint;
   return (len == 0) ||
-      (memcmp(DataAddr(0), other_typed_data.DataAddr(0), len) == 0);
+         (memcmp(DataAddr(0), other_typed_data.DataAddr(0), len) == 0);
 }
 
 
@@ -22329,9 +22081,8 @@
   TypedData& result = TypedData::Handle();
   {
     const intptr_t lengthInBytes = len * ElementSizeInBytes(class_id);
-    RawObject* raw = Object::Allocate(class_id,
-                                      TypedData::InstanceSize(lengthInBytes),
-                                      space);
+    RawObject* raw = Object::Allocate(
+        class_id, TypedData::InstanceSize(lengthInBytes), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.SetLength(len);
@@ -22352,8 +22103,8 @@
     // Already created.
     return isolate->object_store()->empty_uint32_array();
   }
-  const TypedData& array = TypedData::Handle(thread->zone(),
-      TypedData::New(kTypedDataUint32ArrayCid, 0, Heap::kOld));
+  const TypedData& array = TypedData::Handle(
+      thread->zone(), TypedData::New(kTypedDataUint32ArrayCid, 0, Heap::kOld));
   isolate->object_store()->set_empty_uint32_array(array);
   return array.raw();
 }
@@ -22362,8 +22113,9 @@
 const char* TypedData::ToCString() const {
   switch (GetClassId()) {
 #define CASE_TYPED_DATA_CLASS(clazz)                                           \
-  case kTypedData##clazz##Cid: return #clazz;
-  CLASS_LIST_TYPED_DATA(CASE_TYPED_DATA_CLASS);
+  case kTypedData##clazz##Cid:                                                 \
+    return #clazz;
+    CLASS_LIST_TYPED_DATA(CASE_TYPED_DATA_CLASS);
 #undef CASE_TYPED_DATA_CLASS
   }
   return "TypedData";
@@ -22384,9 +22136,8 @@
                                              Heap::Space space) {
   ExternalTypedData& result = ExternalTypedData::Handle();
   {
-    RawObject* raw = Object::Allocate(class_id,
-                                      ExternalTypedData::InstanceSize(),
-                                      space);
+    RawObject* raw =
+        Object::Allocate(class_id, ExternalTypedData::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.SetLength(len);
@@ -22405,8 +22156,7 @@
   Capability& result = Capability::Handle();
   {
     RawObject* raw = Object::Allocate(Capability::kClassId,
-                                      Capability::InstanceSize(),
-                                      space);
+                                      Capability::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.StoreNonPointer(&result.raw_ptr()->id_, id);
@@ -22432,8 +22182,7 @@
   ReceivePort& result = ReceivePort::Handle(zone);
   {
     RawObject* raw = Object::Allocate(ReceivePort::kClassId,
-                                      ReceivePort::InstanceSize(),
-                                      space);
+                                      ReceivePort::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.StorePointer(&result.raw_ptr()->send_port_, send_port.raw());
@@ -22463,9 +22212,8 @@
   ASSERT(id != ILLEGAL_PORT);
   SendPort& result = SendPort::Handle();
   {
-    RawObject* raw = Object::Allocate(SendPort::kClassId,
-                                      SendPort::InstanceSize(),
-                                      space);
+    RawObject* raw =
+        Object::Allocate(SendPort::kClassId, SendPort::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.StoreNonPointer(&result.raw_ptr()->id_, id);
@@ -22486,8 +22234,8 @@
   const char* fun_sig = String::Handle(fun.UserVisibleSignature()).ToCString();
   const char* from = is_implicit_closure ? " from " : "";
   const char* fun_desc = is_implicit_closure ? fun.ToCString() : "";
-  return OS::SCreate(Thread::Current()->zone(),
-      "Closure: %s%s%s", fun_sig, from, fun_desc);
+  return OS::SCreate(Thread::Current()->zone(), "Closure: %s%s%s", fun_sig,
+                     from, fun_desc);
 }
 
 
@@ -22496,9 +22244,8 @@
                          Heap::Space space) {
   Closure& result = Closure::Handle();
   {
-    RawObject* raw = Object::Allocate(Closure::kClassId,
-                                      Closure::InstanceSize(),
-                                      space);
+    RawObject* raw =
+        Object::Allocate(Closure::kClassId, Closure::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.StorePointer(&result.raw_ptr()->function_, function.raw());
@@ -22509,9 +22256,8 @@
 
 
 RawClosure* Closure::New() {
-  RawObject* raw = Object::Allocate(Closure::kClassId,
-                                    Closure::InstanceSize(),
-                                    Heap::kOld);
+  RawObject* raw =
+      Object::Allocate(Closure::kClassId, Closure::InstanceSize(), Heap::kOld);
   return reinterpret_cast<RawClosure*>(raw);
 }
 
@@ -22534,8 +22280,7 @@
 }
 
 
-void Stacktrace::SetCodeAtFrame(intptr_t frame_index,
-                                const Code& code) const {
+void Stacktrace::SetCodeAtFrame(intptr_t frame_index, const Code& code) const {
   const Array& code_array = Array::Handle(raw_ptr()->code_array_);
   code_array.SetAt(frame_index, code);
 }
@@ -22580,8 +22325,7 @@
   Stacktrace& result = Stacktrace::Handle();
   {
     RawObject* raw = Object::Allocate(Stacktrace::kClassId,
-                                      Stacktrace::InstanceSize(),
-                                      space);
+                                      Stacktrace::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -22608,11 +22352,12 @@
   const Script& script = Script::Handle(zone, function.script());
   const String& function_name =
       String::Handle(zone, function.QualifiedUserVisibleName());
-  const String& url = String::Handle(zone, script.url());
+  const String& url = String::Handle(
+      zone, script.IsNull() ? String::New("Kernel") : script.url());
   intptr_t line = -1;
   intptr_t column = -1;
-  if (token_pos.IsReal()) {
-    if (script.HasSource()) {
+  if (!script.IsNull() && token_pos.IsReal()) {
+    if (script.HasSource() || script.kind() == RawScript::kKernelTag) {
       script.GetTokenLocation(token_pos, &line, &column);
     } else {
       script.GetTokenLocation(token_pos, &line, NULL);
@@ -22620,17 +22365,15 @@
   }
   char* chars = NULL;
   if (column >= 0) {
-    chars = OS::SCreate(zone,
-        "#%-6" Pd " %s (%s:%" Pd ":%" Pd ")\n",
-        frame_index, function_name.ToCString(), url.ToCString(), line, column);
+    chars =
+        OS::SCreate(zone, "#%-6" Pd " %s (%s:%" Pd ":%" Pd ")\n", frame_index,
+                    function_name.ToCString(), url.ToCString(), line, column);
   } else if (line >= 0) {
-    chars = OS::SCreate(zone,
-        "#%-6" Pd " %s (%s:%" Pd ")\n",
-        frame_index, function_name.ToCString(), url.ToCString(), line);
+    chars = OS::SCreate(zone, "#%-6" Pd " %s (%s:%" Pd ")\n", frame_index,
+                        function_name.ToCString(), url.ToCString(), line);
   } else {
-    chars = OS::SCreate(zone,
-        "#%-6" Pd " %s (%s)\n",
-        frame_index, function_name.ToCString(), url.ToCString());
+    chars = OS::SCreate(zone, "#%-6" Pd " %s (%s)\n", frame_index,
+                        function_name.ToCString(), url.ToCString());
   }
   frame_strings->Add(chars);
   return strlen(chars);
@@ -22667,8 +22410,7 @@
       code = CodeAtFrame(i);
       ASSERT(function.raw() == code.function());
       uword pc = code.PayloadStart() + Smi::Value(PcOffsetAtFrame(i));
-      if (code.is_optimized() &&
-          expand_inlined() &&
+      if (code.is_optimized() && expand_inlined() &&
           !FLAG_precompiled_runtime) {
         // Traverse inlined frames.
         for (InlinedFunctionsIterator it(code, pc);
@@ -22681,15 +22423,15 @@
             ASSERT(pc != 0);
             ASSERT(code.PayloadStart() <= pc);
             ASSERT(pc < (code.PayloadStart() + code.Size()));
-            total_len += PrintOneStacktrace(
-                zone, &frame_strings, pc, function, code, *frame_index);
+            total_len += PrintOneStacktrace(zone, &frame_strings, pc, function,
+                                            code, *frame_index);
             (*frame_index)++;  // To account for inlined frames.
           }
         }
       } else {
         if (function.is_visible() || FLAG_show_invisible_frames) {
-          total_len += PrintOneStacktrace(
-              zone, &frame_strings, pc, function, code, *frame_index);
+          total_len += PrintOneStacktrace(zone, &frame_strings, pc, function,
+                                          code, *frame_index);
           (*frame_index)++;
         }
       }
@@ -22700,9 +22442,7 @@
   char* chars = zone->Alloc<char>(total_len + 1);
   intptr_t index = 0;
   for (intptr_t i = 0; i < frame_strings.length(); i++) {
-    index += OS::SNPrint((chars + index),
-                         (total_len + 1 - index),
-                         "%s",
+    index += OS::SNPrint((chars + index), (total_len + 1 - index), "%s",
                          frame_strings[i]);
   }
   chars[total_len] = '\0';
@@ -22715,16 +22455,28 @@
 }
 
 
-void RegExp::set_function(intptr_t cid, const Function& value) const {
-  StorePointer(FunctionAddr(cid), value.raw());
+void RegExp::set_function(intptr_t cid,
+                          bool sticky,
+                          const Function& value) const {
+  StorePointer(FunctionAddr(cid, sticky), value.raw());
 }
 
 
-void RegExp::set_bytecode(bool is_one_byte, const TypedData& bytecode) const {
-  if (is_one_byte) {
-    StorePointer(&raw_ptr()->one_byte_bytecode_, bytecode.raw());
+void RegExp::set_bytecode(bool is_one_byte,
+                          bool sticky,
+                          const TypedData& bytecode) const {
+  if (sticky) {
+    if (is_one_byte) {
+      StorePointer(&raw_ptr()->one_byte_sticky_.bytecode_, bytecode.raw());
+    } else {
+      StorePointer(&raw_ptr()->two_byte_sticky_.bytecode_, bytecode.raw());
+    }
   } else {
-    StorePointer(&raw_ptr()->two_byte_bytecode_, bytecode.raw());
+    if (is_one_byte) {
+      StorePointer(&raw_ptr()->one_byte_.bytecode_, bytecode.raw());
+    } else {
+      StorePointer(&raw_ptr()->two_byte_.bytecode_, bytecode.raw());
+    }
   }
 }
 
@@ -22737,9 +22489,8 @@
 RawRegExp* RegExp::New(Heap::Space space) {
   RegExp& result = RegExp::Handle();
   {
-    RawObject* raw = Object::Allocate(RegExp::kClassId,
-                                      RegExp::InstanceSize(),
-                                      space);
+    RawObject* raw =
+        Object::Allocate(RegExp::kClassId, RegExp::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.set_type(kUnitialized);
@@ -22766,13 +22517,13 @@
 
 const char* RegExp::Flags() const {
   switch (flags()) {
-    case kGlobal | kIgnoreCase | kMultiLine :
-    case kIgnoreCase | kMultiLine :
+    case kGlobal | kIgnoreCase | kMultiLine:
+    case kIgnoreCase | kMultiLine:
       return "im";
-    case kGlobal | kIgnoreCase :
+    case kGlobal | kIgnoreCase:
     case kIgnoreCase:
       return "i";
-    case kGlobal | kMultiLine :
+    case kGlobal | kMultiLine:
     case kMultiLine:
       return "m";
     default:
@@ -22808,17 +22559,16 @@
 
 const char* RegExp::ToCString() const {
   const String& str = String::Handle(pattern());
-  return OS::SCreate(Thread::Current()->zone(),
-      "RegExp: pattern=%s flags=%s", str.ToCString(), Flags());
+  return OS::SCreate(Thread::Current()->zone(), "RegExp: pattern=%s flags=%s",
+                     str.ToCString(), Flags());
 }
 
 
 RawWeakProperty* WeakProperty::New(Heap::Space space) {
-  ASSERT(Isolate::Current()->object_store()->weak_property_class()
-         != Class::null());
+  ASSERT(Isolate::Current()->object_store()->weak_property_class() !=
+         Class::null());
   RawObject* raw = Object::Allocate(WeakProperty::kClassId,
-                                    WeakProperty::InstanceSize(),
-                                    space);
+                                    WeakProperty::InstanceSize(), space);
   RawWeakProperty* result = reinterpret_cast<RawWeakProperty*>(raw);
   result->ptr()->next_ = 0;  // Init the list to NULL.
   return result;
@@ -22871,8 +22621,7 @@
   MirrorReference& result = MirrorReference::Handle();
   {
     RawObject* raw = Object::Allocate(MirrorReference::kClassId,
-                                      MirrorReference::InstanceSize(),
-                                      space);
+                                      MirrorReference::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -22904,18 +22653,16 @@
     return result.raw();
   }
   if (TagTableIsFull(thread)) {
-    const String& error = String::Handle(
-        String::NewFormatted("UserTag instance limit (%" Pd ") reached.",
-                             UserTags::kMaxUserTags));
+    const String& error = String::Handle(String::NewFormatted(
+        "UserTag instance limit (%" Pd ") reached.", UserTags::kMaxUserTags));
     const Array& args = Array::Handle(Array::New(1));
     args.SetAt(0, error);
     Exceptions::ThrowByType(Exceptions::kUnsupported, args);
   }
   // No tag with label exists, create and register with isolate tag table.
   {
-    RawObject* raw = Object::Allocate(UserTag::kClassId,
-                                      UserTag::InstanceSize(),
-                                      space);
+    RawObject* raw =
+        Object::Allocate(UserTag::kClassId, UserTag::InstanceSize(), space);
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
@@ -22935,8 +22682,8 @@
     return isolate->default_tag();
   }
   // Create default tag.
-  const UserTag& result = UserTag::Handle(zone,
-                                          UserTag::New(Symbols::Default()));
+  const UserTag& result =
+      UserTag::Handle(zone, UserTag::New(Symbols::Default()));
   ASSERT(result.tag() == UserTags::kDefaultUserTag);
   isolate->set_default_tag(result);
   return result.raw();
@@ -22947,8 +22694,8 @@
   Isolate* isolate = thread->isolate();
   Zone* zone = thread->zone();
   ASSERT(isolate->tag_table() != GrowableObjectArray::null());
-  const GrowableObjectArray& tag_table = GrowableObjectArray::Handle(
-      zone, isolate->tag_table());
+  const GrowableObjectArray& tag_table =
+      GrowableObjectArray::Handle(zone, isolate->tag_table());
   UserTag& other = UserTag::Handle(zone);
   String& tag_label = String::Handle(zone);
   for (intptr_t i = 0; i < tag_table.Length(); i++) {
@@ -22968,8 +22715,8 @@
   Isolate* isolate = thread->isolate();
   Zone* zone = thread->zone();
   ASSERT(isolate->tag_table() != GrowableObjectArray::null());
-  const GrowableObjectArray& tag_table = GrowableObjectArray::Handle(
-      zone, isolate->tag_table());
+  const GrowableObjectArray& tag_table =
+      GrowableObjectArray::Handle(zone, isolate->tag_table());
   ASSERT(!TagTableIsFull(thread));
 #if defined(DEBUG)
   // Verify that no existing tag has the same tag id.
@@ -22993,8 +22740,8 @@
 bool UserTag::TagTableIsFull(Thread* thread) {
   Isolate* isolate = thread->isolate();
   ASSERT(isolate->tag_table() != GrowableObjectArray::null());
-  const GrowableObjectArray& tag_table = GrowableObjectArray::Handle(
-      thread->zone(), isolate->tag_table());
+  const GrowableObjectArray& tag_table =
+      GrowableObjectArray::Handle(thread->zone(), isolate->tag_table());
   ASSERT(tag_table.Length() <= UserTags::kMaxUserTags);
   return tag_table.Length() == UserTags::kMaxUserTags;
 }
@@ -23005,8 +22752,8 @@
   Zone* zone = thread->zone();
   Isolate* isolate = thread->isolate();
   ASSERT(isolate->tag_table() != GrowableObjectArray::null());
-  const GrowableObjectArray& tag_table = GrowableObjectArray::Handle(
-      zone, isolate->tag_table());
+  const GrowableObjectArray& tag_table =
+      GrowableObjectArray::Handle(zone, isolate->tag_table());
   UserTag& tag = UserTag::Handle(zone);
   for (intptr_t i = 0; i < tag_table.Length(); i++) {
     tag ^= tag_table.At(i);
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 3ce365b..61a2866 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_OBJECT_H_
-#define VM_OBJECT_H_
+#ifndef RUNTIME_VM_OBJECT_H_
+#define RUNTIME_VM_OBJECT_H_
 
 #include "include/dart_api.h"
 #include "platform/assert.h"
@@ -29,8 +29,11 @@
 namespace dart {
 
 // Forward declarations.
-#define DEFINE_FORWARD_DECLARATION(clazz)                                      \
-  class clazz;
+namespace kernel {
+class Program;
+}
+
+#define DEFINE_FORWARD_DECLARATION(clazz) class clazz;
 CLASS_LIST(DEFINE_FORWARD_DECLARATION)
 #undef DEFINE_FORWARD_DECLARATION
 class Api;
@@ -43,8 +46,7 @@
 class FinalizablePersistentHandle;
 class LocalScope;
 
-#define REUSABLE_FORWARD_DECLARATION(name)                                     \
-  class Reusable##name##HandleScope;
+#define REUSABLE_FORWARD_DECLARATION(name) class Reusable##name##HandleScope;
 REUSABLE_HANDLE_LIST(REUSABLE_FORWARD_DECLARATION)
 #undef REUSABLE_FORWARD_DECLARATION
 
@@ -57,31 +59,27 @@
 #endif
 
 #define BASE_OBJECT_IMPLEMENTATION(object, super)                              \
- public:  /* NOLINT */                                                         \
+ public: /* NOLINT */                                                          \
   Raw##object* raw() const { return reinterpret_cast<Raw##object*>(raw_); }    \
   bool Is##object() const { return true; }                                     \
   static object& Handle(Zone* zone, Raw##object* raw_ptr) {                    \
-    object* obj =                                                              \
-      reinterpret_cast<object*>(VMHandles::AllocateHandle(zone));              \
+    object* obj = reinterpret_cast<object*>(VMHandles::AllocateHandle(zone));  \
     initializeHandle(obj, raw_ptr);                                            \
     return *obj;                                                               \
   }                                                                            \
   static object& Handle() {                                                    \
     return Handle(Thread::Current()->zone(), object::null());                  \
   }                                                                            \
-  static object& Handle(Zone* zone) {                                          \
-    return Handle(zone, object::null());                                       \
-  }                                                                            \
+  static object& Handle(Zone* zone) { return Handle(zone, object::null()); }   \
   static object& Handle(Raw##object* raw_ptr) {                                \
     return Handle(Thread::Current()->zone(), raw_ptr);                         \
   }                                                                            \
   static object& CheckedHandle(Zone* zone, RawObject* raw_ptr) {               \
-    object* obj =                                                              \
-        reinterpret_cast<object*>(VMHandles::AllocateHandle(zone));            \
+    object* obj = reinterpret_cast<object*>(VMHandles::AllocateHandle(zone));  \
     initializeHandle(obj, raw_ptr);                                            \
     if (!obj->Is##object()) {                                                  \
-      FATAL2("Handle check failed: saw %s expected %s",                        \
-             obj->ToCString(), #object);                                       \
+      FATAL2("Handle check failed: saw %s expected %s", obj->ToCString(),      \
+             #object);                                                         \
     }                                                                          \
     return *obj;                                                               \
   }                                                                            \
@@ -89,14 +87,13 @@
     return CheckedHandle(Thread::Current()->zone(), raw_ptr);                  \
   }                                                                            \
   static object& ZoneHandle(Zone* zone, Raw##object* raw_ptr) {                \
-    object* obj = reinterpret_cast<object*>(                                   \
-        VMHandles::AllocateZoneHandle(zone));                                  \
+    object* obj =                                                              \
+        reinterpret_cast<object*>(VMHandles::AllocateZoneHandle(zone));        \
     initializeHandle(obj, raw_ptr);                                            \
     return *obj;                                                               \
   }                                                                            \
   static object* ReadOnlyHandle() {                                            \
-    object* obj = reinterpret_cast<object*>(                                   \
-        Dart::AllocateReadOnlyHandle());                                       \
+    object* obj = reinterpret_cast<object*>(Dart::AllocateReadOnlyHandle());   \
     initializeHandle(obj, object::null());                                     \
     return obj;                                                                \
   }                                                                            \
@@ -110,12 +107,12 @@
     return ZoneHandle(Thread::Current()->zone(), raw_ptr);                     \
   }                                                                            \
   static object& CheckedZoneHandle(Zone* zone, RawObject* raw_ptr) {           \
-    object* obj = reinterpret_cast<object*>(                                   \
-        VMHandles::AllocateZoneHandle(zone));                                  \
+    object* obj =                                                              \
+        reinterpret_cast<object*>(VMHandles::AllocateZoneHandle(zone));        \
     initializeHandle(obj, raw_ptr);                                            \
     if (!obj->Is##object()) {                                                  \
-      FATAL2("Handle check failed: saw %s expected %s",                        \
-             obj->ToCString(), #object);                                       \
+      FATAL2("Handle check failed: saw %s expected %s", obj->ToCString(),      \
+             #object);                                                         \
     }                                                                          \
     return *obj;                                                               \
   }                                                                            \
@@ -138,7 +135,8 @@
   }                                                                            \
   virtual const char* ToCString() const;                                       \
   static const ClassId kClassId = k##object##Cid;                              \
- private:  /* NOLINT */                                                        \
+                                                                               \
+ private: /* NOLINT */                                                         \
   /* Initialize the handle based on the raw_ptr in the presence of null. */    \
   static void initializeHandle(object* obj, RawObject* raw_ptr) {              \
     if (raw_ptr != Object::null()) {                                           \
@@ -150,16 +148,15 @@
     }                                                                          \
   }                                                                            \
   /* Disallow allocation, copy constructors and override super assignment. */  \
- public:  /* NOLINT */                                                         \
-  void operator delete(void* pointer) {                                        \
-    UNREACHABLE();                                                             \
-  }                                                                            \
- private:  /* NOLINT */                                                        \
+ public: /* NOLINT */                                                          \
+  void operator delete(void* pointer) { UNREACHABLE(); }                       \
+                                                                               \
+ private: /* NOLINT */                                                         \
   void* operator new(size_t size);                                             \
   object(const object& value);                                                 \
   void operator=(Raw##super* value);                                           \
   void operator=(const object& value);                                         \
-  void operator=(const super& value);                                          \
+  void operator=(const super& value);
 
 // Conditionally include object_service.cc functionality in the vtable to avoid
 // link errors like the following:
@@ -170,37 +167,31 @@
 //
 #ifndef PRODUCT
 #define OBJECT_SERVICE_SUPPORT(object)                                         \
-   protected:  /* NOLINT */                                                    \
+ protected: /* NOLINT */                                                       \
   /* Object is printed as JSON into stream. If ref is true only a header */    \
   /* with an object id is printed. If ref is false the object is fully   */    \
   /* printed.                                                            */    \
-    virtual void PrintJSONImpl(JSONStream* stream, bool ref) const;            \
-    virtual const char* JSONType() const {                                     \
-      return ""#object;                                                        \
-    }
+  virtual void PrintJSONImpl(JSONStream* stream, bool ref) const;              \
+  virtual const char* JSONType() const { return "" #object; }
 #else
-#define OBJECT_SERVICE_SUPPORT(object)                                         \
-   protected:  /* NOLINT */
-#endif  // !PRODUCT
+#define OBJECT_SERVICE_SUPPORT(object) protected: /* NOLINT */
+#endif                                            // !PRODUCT
 
 #define SNAPSHOT_READER_SUPPORT(object)                                        \
-  static Raw##object* ReadFrom(SnapshotReader* reader,                         \
-                               intptr_t object_id,                             \
-                               intptr_t tags,                                  \
-                               Snapshot::Kind,                                 \
+  static Raw##object* ReadFrom(SnapshotReader* reader, intptr_t object_id,     \
+                               intptr_t tags, Snapshot::Kind,                  \
                                bool as_reference);                             \
-  friend class SnapshotReader;                                                 \
+  friend class SnapshotReader;
 
 #define OBJECT_IMPLEMENTATION(object, super)                                   \
- public:  /* NOLINT */                                                         \
-  void operator=(Raw##object* value) {                                         \
-    initializeHandle(this, value);                                             \
-  }                                                                            \
+ public: /* NOLINT */                                                          \
+  void operator=(Raw##object* value) { initializeHandle(this, value); }        \
   void operator^=(RawObject* value) {                                          \
     initializeHandle(this, value);                                             \
     ASSERT(IsNull() || Is##object());                                          \
   }                                                                            \
- protected:  /* NOLINT */                                                      \
+                                                                               \
+ protected: /* NOLINT */                                                       \
   object() : super() {}                                                        \
   BASE_OBJECT_IMPLEMENTATION(object, super)                                    \
   OBJECT_SERVICE_SUPPORT(object)
@@ -213,11 +204,11 @@
   }                                                                            \
   SNAPSHOT_READER_SUPPORT(object)                                              \
   friend class StackFrame;                                                     \
-  friend class Thread;                                                         \
+  friend class Thread;
 
 // This macro is used to denote types that do not have a sub-type.
 #define FINAL_HEAP_OBJECT_IMPLEMENTATION_HELPER(object, rettype, super)        \
- public:  /* NOLINT */                                                         \
+ public: /* NOLINT */                                                          \
   void operator=(Raw##object* value) {                                         \
     raw_ = value;                                                              \
     CHECK_HANDLE();                                                            \
@@ -226,7 +217,8 @@
     raw_ = value;                                                              \
     CHECK_HANDLE();                                                            \
   }                                                                            \
- private:  /* NOLINT */                                                        \
+                                                                               \
+ private: /* NOLINT */                                                         \
   object() : super() {}                                                        \
   BASE_OBJECT_IMPLEMENTATION(object, super)                                    \
   OBJECT_SERVICE_SUPPORT(object)                                               \
@@ -234,49 +226,39 @@
     ASSERT(raw() != null());                                                   \
     return raw()->ptr();                                                       \
   }                                                                            \
-  static intptr_t NextFieldOffset() {                                          \
-    return -kWordSize;                                                         \
-  }                                                                            \
+  static intptr_t NextFieldOffset() { return -kWordSize; }                     \
   SNAPSHOT_READER_SUPPORT(rettype)                                             \
   friend class StackFrame;                                                     \
-  friend class Thread;                                                         \
+  friend class Thread;
 
 #define FINAL_HEAP_OBJECT_IMPLEMENTATION(object, super)                        \
-  FINAL_HEAP_OBJECT_IMPLEMENTATION_HELPER(object, object, super)               \
+  FINAL_HEAP_OBJECT_IMPLEMENTATION_HELPER(object, object, super)
 
 #define MINT_OBJECT_IMPLEMENTATION(object, rettype, super)                     \
-  FINAL_HEAP_OBJECT_IMPLEMENTATION_HELPER(object, rettype, super)              \
+  FINAL_HEAP_OBJECT_IMPLEMENTATION_HELPER(object, rettype, super)
 
 class Object {
  public:
-  virtual ~Object() { }
+  virtual ~Object() {}
 
   RawObject* raw() const { return raw_; }
-  void operator=(RawObject* value) {
-    initializeHandle(this, value);
-  }
+  void operator=(RawObject* value) { initializeHandle(this, value); }
 
   uword CompareAndSwapTags(uword old_tags, uword new_tags) const {
-    return AtomicOperations::CompareAndSwapWord(
-        &raw()->ptr()->tags_, old_tags, new_tags);
+    return AtomicOperations::CompareAndSwapWord(&raw()->ptr()->tags_, old_tags,
+                                                new_tags);
   }
-  bool IsCanonical() const {
-    return raw()->IsCanonical();
-  }
-  void SetCanonical() const {
-    raw()->SetCanonical();
-  }
-  void ClearCanonical() const {
-    raw()->ClearCanonical();
-  }
+  bool IsCanonical() const { return raw()->IsCanonical(); }
+  void SetCanonical() const { raw()->SetCanonical(); }
+  void ClearCanonical() const { raw()->ClearCanonical(); }
   intptr_t GetClassId() const {
-    return !raw()->IsHeapObject() ?
-        static_cast<intptr_t>(kSmiCid) : raw()->GetClassId();
+    return !raw()->IsHeapObject() ? static_cast<intptr_t>(kSmiCid)
+                                  : raw()->GetClassId();
   }
   inline RawClass* clazz() const;
   static intptr_t tags_offset() { return OFFSET_OF(RawObject, tags_); }
 
-  // Class testers.
+// Class testers.
 #define DEFINE_CLASS_TESTER(clazz)                                             \
   virtual bool Is##clazz() const { return false; }
   CLASS_LIST_FOR_HANDLES(DEFINE_CLASS_TESTER);
@@ -296,9 +278,7 @@
 #ifndef PRODUCT
   void PrintJSON(JSONStream* stream, bool ref = true) const;
   virtual void PrintJSONImpl(JSONStream* stream, bool ref) const;
-  virtual const char* JSONType() const {
-    return IsNull() ? "null" : "Object";
-  }
+  virtual const char* JSONType() const { return IsNull() ? "null" : "Object"; }
 #endif
 
   // Returns the name that is used to identify an object in the
@@ -333,27 +313,22 @@
     return *obj;
   }
   static Object* ReadOnlyHandle() {
-    Object* obj = reinterpret_cast<Object*>(
-        Dart::AllocateReadOnlyHandle());
+    Object* obj = reinterpret_cast<Object*>(Dart::AllocateReadOnlyHandle());
     initializeHandle(obj, Object::null());
     return obj;
   }
 
-  static Object& Handle() {
-    return Handle(Thread::Current()->zone(), null_);
-  }
+  static Object& Handle() { return Handle(Thread::Current()->zone(), null_); }
 
-  static Object& Handle(Zone* zone) {
-    return Handle(zone, null_);
-  }
+  static Object& Handle(Zone* zone) { return Handle(zone, null_); }
 
   static Object& Handle(RawObject* raw_ptr) {
     return Handle(Thread::Current()->zone(), raw_ptr);
   }
 
   static Object& ZoneHandle(Zone* zone, RawObject* raw_ptr) {
-    Object* obj = reinterpret_cast<Object*>(
-        VMHandles::AllocateZoneHandle(zone));
+    Object* obj =
+        reinterpret_cast<Object*>(VMHandles::AllocateZoneHandle(zone));
     initializeHandle(obj, raw_ptr);
     return *obj;
   }
@@ -554,8 +529,9 @@
   static void InitOnce(Isolate* isolate);
   static void FinalizeVMIsolate(Isolate* isolate);
 
-  // Initialize a new isolate either from source or from a snapshot.
-  static RawError* Init(Isolate* isolate);
+  // Initialize a new isolate either from a Kernel IR, from source, or from a
+  // snapshot.
+  static RawError* Init(Isolate* isolate, kernel::Program* program);
 
   static void MakeUnusedSpaceTraversable(const Object& obj,
                                          intptr_t original_size,
@@ -570,10 +546,7 @@
   static const ClassId kClassId = kObjectCid;
 
   // Different kinds of type tests.
-  enum TypeTestKind {
-    kIsSubtypeOf = 0,
-    kIsMoreSpecificThan
-  };
+  enum TypeTestKind { kIsSubtypeOf = 0, kIsMoreSpecificThan };
 
   // Different kinds of name visibility.
   enum NameVisibility {
@@ -619,9 +592,7 @@
   // Used for extracting the C++ vtable during bringup.
   Object() : raw_(null_) {}
 
-  uword raw_value() const {
-    return reinterpret_cast<uword>(raw());
-  }
+  uword raw_value() const { return reinterpret_cast<uword>(raw()); }
 
   inline void SetRaw(RawObject* value);
   void CheckHandle() const;
@@ -629,9 +600,7 @@
   cpp_vtable vtable() const { return bit_copy<cpp_vtable>(*this); }
   void set_vtable(cpp_vtable value) { *vtable_address() = value; }
 
-  static RawObject* Allocate(intptr_t cls_id,
-                             intptr_t size,
-                             Heap::Space space);
+  static RawObject* Allocate(intptr_t cls_id, intptr_t size, Heap::Space space);
 
   static intptr_t RoundedAllocationSize(intptr_t size) {
     return Utils::RoundUp(size, kObjectAlignment);
@@ -645,7 +614,7 @@
   // methods below or their counterparts in RawObject, to ensure that the
   // write barrier is correctly applied.
 
-  template<typename type>
+  template <typename type>
   void StorePointer(type const* addr, type value) const {
     raw()->StorePointer(addr, value);
   }
@@ -671,14 +640,14 @@
     raw()->StoreSmi(addr, value);
   }
 
-  template<typename FieldType>
+  template <typename FieldType>
   void StoreSimd128(const FieldType* addr, simd128_value_t value) const {
     ASSERT(Contains(reinterpret_cast<uword>(addr)));
     value.writeTo(const_cast<FieldType*>(addr));
   }
 
   // Needs two template arguments to allow assigning enums to fixed-size ints.
-  template<typename FieldType, typename ValueType>
+  template <typename FieldType, typename ValueType>
   void StoreNonPointer(const FieldType* addr, ValueType value) const {
     // Can't use Contains, as it uses tags_, which is set through this method.
     ASSERT(reinterpret_cast<uword>(addr) >= RawObject::ToAddr(raw()));
@@ -688,7 +657,7 @@
   // Provides non-const access to non-pointer fields within the object. Such
   // access does not need a write barrier, but it is *not* GC-safe, since the
   // object might move, hence must be fully contained within a NoSafepointScope.
-  template<typename FieldType>
+  template <typename FieldType>
   FieldType* UnsafeMutableNonPointer(const FieldType* addr) const {
     // Allow pointers at the end of variable-length data, and disallow pointers
     // within the header word.
@@ -699,10 +668,10 @@
     return const_cast<FieldType*>(addr);
   }
 
-  // Fail at link time if StoreNonPointer or UnsafeMutableNonPointer is
-  // instantiated with an object pointer type.
+// Fail at link time if StoreNonPointer or UnsafeMutableNonPointer is
+// instantiated with an object pointer type.
 #define STORE_NON_POINTER_ILLEGAL_TYPE(type)                                   \
-  template<typename ValueType>                                                 \
+  template <typename ValueType>                                                \
   void StoreNonPointer(Raw##type* const* addr, ValueType value) const {        \
     UnimplementedMethod();                                                     \
   }                                                                            \
@@ -768,41 +737,41 @@
   // isolates. They are all allocated in the non-GC'd Dart::vm_isolate_.
   static RawObject* null_;
 
-  static RawClass* class_class_;  // Class of the Class vm object.
-  static RawClass* dynamic_class_;  // Class of the 'dynamic' type.
-  static RawClass* void_class_;  // Class of the 'void' type.
+  static RawClass* class_class_;             // Class of the Class vm object.
+  static RawClass* dynamic_class_;           // Class of the 'dynamic' type.
+  static RawClass* void_class_;              // Class of the 'void' type.
   static RawClass* unresolved_class_class_;  // Class of UnresolvedClass.
   static RawClass* type_arguments_class_;  // Class of TypeArguments vm object.
-  static RawClass* patch_class_class_;  // Class of the PatchClass vm object.
-  static RawClass* function_class_;  // Class of the Function vm object.
-  static RawClass* closure_data_class_;  // Class of ClosureData vm obj.
+  static RawClass* patch_class_class_;     // Class of the PatchClass vm object.
+  static RawClass* function_class_;        // Class of the Function vm object.
+  static RawClass* closure_data_class_;    // Class of ClosureData vm obj.
   static RawClass* redirection_data_class_;  // Class of RedirectionData vm obj.
-  static RawClass* field_class_;  // Class of the Field vm object.
-  static RawClass* literal_token_class_;  // Class of LiteralToken vm object.
+  static RawClass* field_class_;             // Class of the Field vm object.
+  static RawClass* literal_token_class_;     // Class of LiteralToken vm object.
   static RawClass* token_stream_class_;  // Class of the TokenStream vm object.
-  static RawClass* script_class_;  // Class of the Script vm object.
-  static RawClass* library_class_;  // Class of the Library vm object.
-  static RawClass* namespace_class_;  // Class of Namespace vm object.
-  static RawClass* code_class_;  // Class of the Code vm object.
+  static RawClass* script_class_;        // Class of the Script vm object.
+  static RawClass* library_class_;       // Class of the Library vm object.
+  static RawClass* namespace_class_;     // Class of Namespace vm object.
+  static RawClass* code_class_;          // Class of the Code vm object.
   static RawClass* instructions_class_;  // Class of the Instructions vm object.
-  static RawClass* object_pool_class_;  // Class of the ObjectPool vm object.
-  static RawClass* pc_descriptors_class_;  // Class of PcDescriptors vm object.
+  static RawClass* object_pool_class_;   // Class of the ObjectPool vm object.
+  static RawClass* pc_descriptors_class_;   // Class of PcDescriptors vm object.
   static RawClass* code_source_map_class_;  // Class of CodeSourceMap vm object.
-  static RawClass* stackmap_class_;  // Class of Stackmap vm object.
+  static RawClass* stackmap_class_;         // Class of Stackmap vm object.
   static RawClass* var_descriptors_class_;  // Class of LocalVarDescriptors.
   static RawClass* exception_handlers_class_;  // Class of ExceptionHandlers.
-  static RawClass* deopt_info_class_;  // Class of DeoptInfo.
-  static RawClass* context_class_;  // Class of the Context vm object.
+  static RawClass* deopt_info_class_;          // Class of DeoptInfo.
+  static RawClass* context_class_;        // Class of the Context vm object.
   static RawClass* context_scope_class_;  // Class of ContextScope vm object.
-  static RawClass* singletargetcache_class_;  // Class of SingleTargetCache.
-  static RawClass* unlinkedcall_class_;  // Class of UnlinkedCall.
-  static RawClass* icdata_class_;  // Class of ICData.
-  static RawClass* megamorphic_cache_class_;  // Class of MegamorphiCache.
-  static RawClass* subtypetestcache_class_;  // Class of SubtypeTestCache.
-  static RawClass* api_error_class_;  // Class of ApiError.
-  static RawClass* language_error_class_;  // Class of LanguageError.
+  static RawClass* singletargetcache_class_;    // Class of SingleTargetCache.
+  static RawClass* unlinkedcall_class_;         // Class of UnlinkedCall.
+  static RawClass* icdata_class_;               // Class of ICData.
+  static RawClass* megamorphic_cache_class_;    // Class of MegamorphiCache.
+  static RawClass* subtypetestcache_class_;     // Class of SubtypeTestCache.
+  static RawClass* api_error_class_;            // Class of ApiError.
+  static RawClass* language_error_class_;       // Class of LanguageError.
   static RawClass* unhandled_exception_class_;  // Class of UnhandledException.
-  static RawClass* unwind_error_class_;  // Class of UnwindError.
+  static RawClass* unwind_error_class_;         // Class of UnwindError.
 
   // The static values below are read-only handle pointers for singleton
   // objects that are shared between the different isolates.
@@ -848,7 +817,7 @@
 
 #define REUSABLE_FRIEND_DECLARATION(name)                                      \
   friend class Reusable##name##HandleScope;
-REUSABLE_HANDLE_LIST(REUSABLE_FRIEND_DECLARATION)
+  REUSABLE_HANDLE_LIST(REUSABLE_FRIEND_DECLARATION)
 #undef REUSABLE_FRIEND_DECLARATION
 
   DISALLOW_ALLOCATION();
@@ -858,16 +827,12 @@
 
 class PassiveObject : public Object {
  public:
-  void operator=(RawObject* value) {
-    raw_ = value;
-  }
-  void operator^=(RawObject* value) {
-    raw_ = value;
-  }
+  void operator=(RawObject* value) { raw_ = value; }
+  void operator^=(RawObject* value) { raw_ = value; }
 
   static PassiveObject& Handle(Zone* zone, RawObject* raw_ptr) {
-    PassiveObject* obj = reinterpret_cast<PassiveObject*>(
-        VMHandles::AllocateHandle(zone));
+    PassiveObject* obj =
+        reinterpret_cast<PassiveObject*>(VMHandles::AllocateHandle(zone));
     obj->raw_ = raw_ptr;
     obj->set_vtable(0);
     return *obj;
@@ -882,8 +847,8 @@
     return Handle(zone, Object::null());
   }
   static PassiveObject& ZoneHandle(Zone* zone, RawObject* raw_ptr) {
-    PassiveObject* obj = reinterpret_cast<PassiveObject*>(
-        VMHandles::AllocateZoneHandle(zone));
+    PassiveObject* obj =
+        reinterpret_cast<PassiveObject*>(VMHandles::AllocateZoneHandle(zone));
     obj->raw_ = raw_ptr;
     obj->set_vtable(0);
     return *obj;
@@ -994,7 +959,7 @@
   // The type parameters (and their bounds) are specified as an array of
   // TypeParameter.
   RawTypeArguments* type_parameters() const {
-      return raw_ptr()->type_parameters_;
+    return raw_ptr()->type_parameters_;
   }
   void set_type_parameters(const TypeArguments& value) const;
   intptr_t NumTypeParameters(Thread* thread) const;
@@ -1070,7 +1035,10 @@
   }
 
   // Asserts that the class of the super type has been resolved.
-  RawClass* SuperClass() const;
+  // |original_classes| only has an effect when reloading. If true and we
+  // are reloading, it will prefer the original classes to the replacement
+  // classes.
+  RawClass* SuperClass(bool original_classes = false) const;
 
   RawType* mixin() const { return raw_ptr()->mixin_; }
   void set_mixin(const Type& value) const;
@@ -1110,16 +1078,14 @@
   bool IsDartFunctionClass() const;
 
   // Check if this class represents the 'Closure' class.
-  bool IsClosureClass() const  { return id() == kClosureCid; }
+  bool IsClosureClass() const { return id() == kClosureCid; }
   static bool IsClosureClass(RawClass* cls) {
     NoSafepointScope no_safepoint;
     return cls->ptr()->id_ == kClosureCid;
   }
 
   // Check if this class represents a typedef class.
-  bool IsTypedefClass() const {
-    return signature_function() != Object::null();
-  }
+  bool IsTypedefClass() const { return signature_function() != Object::null(); }
 
   static bool IsInFullSnapshot(RawClass* cls) {
     NoSafepointScope no_safepoint;
@@ -1133,13 +1099,8 @@
                    Error* bound_error,
                    TrailPtr bound_trail,
                    Heap::Space space) const {
-    return TypeTest(kIsSubtypeOf,
-                    type_arguments,
-                    other,
-                    other_type_arguments,
-                    bound_error,
-                    bound_trail,
-                    space);
+    return TypeTest(kIsSubtypeOf, type_arguments, other, other_type_arguments,
+                    bound_error, bound_trail, space);
   }
 
   // Check the 'more specific' relationship.
@@ -1149,13 +1110,8 @@
                           Error* bound_error,
                           TrailPtr bound_trail,
                           Heap::Space space) const {
-    return TypeTest(kIsMoreSpecificThan,
-                    type_arguments,
-                    other,
-                    other_type_arguments,
-                    bound_error,
-                    bound_trail,
-                    space);
+    return TypeTest(kIsMoreSpecificThan, type_arguments, other,
+                    other_type_arguments, bound_error, bound_trail, space);
   }
 
   // Check if this is the top level class.
@@ -1171,7 +1127,10 @@
 
   // Returns an array of all instance fields of this class and its superclasses
   // indexed by offset in words.
-  RawArray* OffsetToFieldMap() const;
+  // |original_classes| only has an effect when reloading. If true and we
+  // are reloading, it will prefer the original classes to the replacement
+  // classes.
+  RawArray* OffsetToFieldMap(bool original_classes = false) const;
 
   // Returns true if non-static fields are defined.
   bool HasInstanceFields() const;
@@ -1213,14 +1172,16 @@
   // - constants_list_ position of found element, or
   // - constants_list_ position where new canonical can be inserted.
   RawDouble* LookupCanonicalDouble(Zone* zone,
-                                   double value, intptr_t* index) const;
+                                   double value,
+                                   intptr_t* index) const;
   RawMint* LookupCanonicalMint(Zone* zone,
-                               int64_t value, intptr_t* index) const;
+                               int64_t value,
+                               intptr_t* index) const;
   RawBigint* LookupCanonicalBigint(Zone* zone,
-                                   const Bigint& value, intptr_t* index) const;
+                                   const Bigint& value,
+                                   intptr_t* index) const;
   // The methods above are more efficient than this generic one.
-  RawInstance* LookupCanonicalInstance(Zone* zone,
-                                       const Instance& value) const;
+  RawInstance* LookupCanonicalInstance(Zone* zone, const Instance& value) const;
 
   RawInstance* InsertCanonicalConstant(Zone* zone,
                                        const Instance& constant) const;
@@ -1249,9 +1210,7 @@
   }
   void set_is_type_finalized() const;
 
-  bool is_patch() const {
-    return PatchBit::decode(raw_ptr()->state_bits_);
-  }
+  bool is_patch() const { return PatchBit::decode(raw_ptr()->state_bits_); }
   void set_is_patch() const;
 
   bool is_synthesized_class() const {
@@ -1259,27 +1218,25 @@
   }
   void set_is_synthesized_class() const;
 
-  bool is_enum_class() const {
-    return EnumBit::decode(raw_ptr()->state_bits_);
-  }
+  bool is_enum_class() const { return EnumBit::decode(raw_ptr()->state_bits_); }
   void set_is_enum_class() const;
 
   bool is_finalized() const {
-    return ClassFinalizedBits::decode(raw_ptr()->state_bits_)
-        == RawClass::kFinalized;
+    return ClassFinalizedBits::decode(raw_ptr()->state_bits_) ==
+           RawClass::kFinalized;
   }
   void set_is_finalized() const;
 
   bool is_prefinalized() const {
-    return ClassFinalizedBits::decode(raw_ptr()->state_bits_)
-        == RawClass::kPreFinalized;
+    return ClassFinalizedBits::decode(raw_ptr()->state_bits_) ==
+           RawClass::kPreFinalized;
   }
 
   void set_is_prefinalized() const;
 
   bool is_refinalize_after_patch() const {
-    return ClassFinalizedBits::decode(raw_ptr()->state_bits_)
-        == RawClass::kRefinalizeAfterPatch;
+    return ClassFinalizedBits::decode(raw_ptr()->state_bits_) ==
+           RawClass::kRefinalizeAfterPatch;
   }
 
   void SetRefinalizeAfterPatch() const;
@@ -1319,16 +1276,12 @@
   }
   void set_is_allocated(bool value) const;
 
-  uint16_t num_native_fields() const {
-    return raw_ptr()->num_native_fields_;
-  }
+  uint16_t num_native_fields() const { return raw_ptr()->num_native_fields_; }
   void set_num_native_fields(uint16_t value) const {
     StoreNonPointer(&raw_ptr()->num_native_fields_, value);
   }
 
-  RawCode* allocation_stub() const {
-    return raw_ptr()->allocation_stub_;
-  }
+  RawCode* allocation_stub() const { return raw_ptr()->allocation_stub_; }
   void set_allocation_stub(const Code& value) const;
 
   void DisableAllocationStub() const;
@@ -1362,7 +1315,8 @@
   RawError* EnsureIsFinalized(Thread* thread) const;
 
   // Allocate a class used for VM internal objects.
-  template <class FakeObject> static RawClass* New();
+  template <class FakeObject>
+  static RawClass* New();
 
   // Allocate instance classes.
   static RawClass* New(const Library& lib,
@@ -1423,7 +1377,8 @@
   // Tells whether instances need morphing for reload.
   bool RequiresInstanceMorphing(const Class& replacement) const;
 
-  template <class FakeObject> static RawClass* NewCommon(intptr_t index);
+  template <class FakeObject>
+  static RawClass* NewCommon(intptr_t index);
 
   enum MemberKind {
     kAny = 0,
@@ -1452,24 +1407,24 @@
   };
   class ConstBit : public BitField<uint16_t, bool, kConstBit, 1> {};
   class ImplementedBit : public BitField<uint16_t, bool, kImplementedBit, 1> {};
-  class TypeFinalizedBit :
-      public BitField<uint16_t, bool, kTypeFinalizedBit, 1> {};
+  class TypeFinalizedBit
+      : public BitField<uint16_t, bool, kTypeFinalizedBit, 1> {};
   class ClassFinalizedBits : public BitField<uint16_t,
                                              RawClass::ClassFinalizedState,
                                              kClassFinalizedPos,
                                              kClassFinalizedSize> {};
   class AbstractBit : public BitField<uint16_t, bool, kAbstractBit, 1> {};
   class PatchBit : public BitField<uint16_t, bool, kPatchBit, 1> {};
-  class SynthesizedClassBit :
-      public BitField<uint16_t, bool, kSynthesizedClassBit, 1> {};
-  class MarkedForParsingBit :
-      public BitField<uint16_t, bool, kMarkedForParsingBit, 1> {};
-  class MixinAppAliasBit :
-      public BitField<uint16_t, bool, kMixinAppAliasBit, 1> {};
-  class MixinTypeAppliedBit :
-      public BitField<uint16_t, bool, kMixinTypeAppliedBit, 1> {};
-  class FieldsMarkedNullableBit :
-      public BitField<uint16_t, bool, kFieldsMarkedNullableBit, 1> {};
+  class SynthesizedClassBit
+      : public BitField<uint16_t, bool, kSynthesizedClassBit, 1> {};
+  class MarkedForParsingBit
+      : public BitField<uint16_t, bool, kMarkedForParsingBit, 1> {};
+  class MixinAppAliasBit
+      : public BitField<uint16_t, bool, kMixinAppAliasBit, 1> {};
+  class MixinTypeAppliedBit
+      : public BitField<uint16_t, bool, kMixinTypeAppliedBit, 1> {};
+  class FieldsMarkedNullableBit
+      : public BitField<uint16_t, bool, kFieldsMarkedNullableBit, 1> {};
   class CycleFreeBit : public BitField<uint16_t, bool, kCycleFreeBit, 1> {};
   class EnumBit : public BitField<uint16_t, bool, kEnumBit, 1> {};
   class IsAllocatedBit : public BitField<uint16_t, bool, kIsAllocatedBit, 1> {};
@@ -1496,9 +1451,7 @@
   // Initial value for the cached number of type arguments.
   static const intptr_t kUnknownNumTypeArguments = -1;
 
-  int16_t num_type_arguments() const {
-    return raw_ptr()->num_type_arguments_;
-  }
+  int16_t num_type_arguments() const { return raw_ptr()->num_type_arguments_; }
   void set_num_type_arguments(intptr_t value) const;
   static intptr_t num_type_arguments_offset() {
     return OFFSET_OF(RawClass, num_type_arguments_);
@@ -1523,7 +1476,8 @@
                                       const String& name) const;
 
   // Allocate an instance class which has a VM implementation.
-  template <class FakeInstance> static RawClass* New(intptr_t id);
+  template <class FakeInstance>
+  static RawClass* New(intptr_t id);
 
   // Helper that calls 'Class::New<Instance>(kIllegalCid)'.
   static RawClass* NewInstanceClass();
@@ -1537,15 +1491,14 @@
                 TrailPtr bound_trail,
                 Heap::Space space) const;
 
-  static bool TypeTestNonRecursive(
-      const Class& cls,
-      TypeTestKind test_kind,
-      const TypeArguments& type_arguments,
-      const Class& other,
-      const TypeArguments& other_type_arguments,
-      Error* bound_error,
-      TrailPtr bound_trail,
-      Heap::Space space);
+  static bool TypeTestNonRecursive(const Class& cls,
+                                   TypeTestKind test_kind,
+                                   const TypeArguments& type_arguments,
+                                   const Class& other,
+                                   const TypeArguments& other_type_arguments,
+                                   Error* bound_error,
+                                   TrailPtr bound_trail,
+                                   Heap::Space space);
 
   FINAL_HEAP_OBJECT_IMPLEMENTATION(Class, Object);
   friend class AbstractType;
@@ -1561,8 +1514,8 @@
 // to a class after all classes have been loaded and finalized.
 class UnresolvedClass : public Object {
  public:
-  RawLibraryPrefix* library_prefix() const {
-    return raw_ptr()->library_prefix_;
+  RawObject* library_or_library_prefix() const {
+    return raw_ptr()->library_or_library_prefix_;
   }
   RawString* ident() const { return raw_ptr()->ident_; }
   TokenPosition token_pos() const { return raw_ptr()->token_pos_; }
@@ -1573,12 +1526,12 @@
     return RoundedAllocationSize(sizeof(RawUnresolvedClass));
   }
 
-  static RawUnresolvedClass* New(const LibraryPrefix& library_prefix,
+  static RawUnresolvedClass* New(const Object& library_prefix,
                                  const String& ident,
                                  TokenPosition token_pos);
 
  private:
-  void set_library_prefix(const LibraryPrefix& library_prefix) const;
+  void set_library_or_library_prefix(const Object& library_prefix) const;
   void set_ident(const String& ident) const;
   void set_token_pos(TokenPosition token_pos) const;
 
@@ -1600,15 +1553,13 @@
   intptr_t Length() const;
   RawAbstractType* TypeAt(intptr_t index) const;
   static intptr_t type_at_offset(intptr_t index) {
-    return OFFSET_OF_RETURNED_VALUE(
-        RawTypeArguments, types) + index * kWordSize;
+    return OFFSET_OF_RETURNED_VALUE(RawTypeArguments, types) +
+           index * kWordSize;
   }
   void SetTypeAt(intptr_t index, const AbstractType& value) const;
 
   // The name of this type argument vector, e.g. "<T, dynamic, List<T>, Smi>".
-  RawString* Name() const {
-    return SubvectorName(0, Length(), kInternalName);
-  }
+  RawString* Name() const { return SubvectorName(0, Length(), kInternalName); }
 
   // The name of this type argument vector, e.g. "<T, dynamic, List<T>, int>".
   // Names of internal classes are mapped to their public interfaces.
@@ -1638,8 +1589,8 @@
                    Error* bound_error,
                    TrailPtr bound_trail,
                    Heap::Space space) const {
-    return TypeTest(kIsSubtypeOf, other, from_index, len,
-                    bound_error, bound_trail, space);
+    return TypeTest(kIsSubtypeOf, other, from_index, len, bound_error,
+                    bound_trail, space);
   }
 
   // Check the 'more specific' relationship, considering only a subvector of
@@ -1650,8 +1601,8 @@
                           Error* bound_error,
                           TrailPtr bound_trail,
                           Heap::Space space) const {
-    return TypeTest(kIsMoreSpecificThan, other, from_index, len,
-                    bound_error, bound_trail, space);
+    return TypeTest(kIsMoreSpecificThan, other, from_index, len, bound_error,
+                    bound_trail, space);
   }
 
   // Check if the vectors are equal (they may be null).
@@ -1693,8 +1644,8 @@
   // Clone this type argument vector and clone all uninstantiated type
   // arguments, changing the class owner of type parameters.
   // Instantiated type arguments are shared.
-  RawTypeArguments* CloneUninstantiated(
-      const Class& new_owner, TrailPtr trail = NULL) const;
+  RawTypeArguments* CloneUninstantiated(const Class& new_owner,
+                                        TrailPtr trail = NULL) const;
 
   // Canonicalize only if instantiated, otherwise returns 'this'.
   RawTypeArguments* Canonicalize(TrailPtr trail = NULL) const;
@@ -1745,8 +1696,8 @@
     ASSERT(sizeof(RawTypeArguments) ==
            (sizeof(RawObject) + (kNumFields * kWordSize)));
     ASSERT(0 <= len && len <= kMaxElements);
-    return RoundedAllocationSize(
-        sizeof(RawTypeArguments) + (len * kBytesPerElement));
+    return RoundedAllocationSize(sizeof(RawTypeArguments) +
+                                 (len * kBytesPerElement));
   }
 
   intptr_t Hash() const;
@@ -1811,8 +1762,7 @@
   static RawPatchClass* New(const Class& patched_class,
                             const Class& origin_class);
 
-  static RawPatchClass* New(const Class& patched_class,
-                            const Script& source);
+  static RawPatchClass* New(const Class& patched_class, const Script& source);
 
  private:
   void set_patched_class(const Class& value) const;
@@ -1841,11 +1791,11 @@
   }                                                                            \
   static intptr_t name##_offset() {                                            \
     return OFFSET_OF(RawSingleTargetCache, name##_);                           \
-  }                                                                            \
+  }
 
-DEFINE_NON_POINTER_FIELD_ACCESSORS(uword, entry_point);
-DEFINE_NON_POINTER_FIELD_ACCESSORS(intptr_t, lower_limit);
-DEFINE_NON_POINTER_FIELD_ACCESSORS(intptr_t, upper_limit);
+  DEFINE_NON_POINTER_FIELD_ACCESSORS(uword, entry_point);
+  DEFINE_NON_POINTER_FIELD_ACCESSORS(intptr_t, lower_limit);
+  DEFINE_NON_POINTER_FIELD_ACCESSORS(intptr_t, upper_limit);
 #undef DEFINE_NON_POINTER_FIELD_ACCESSORS
 
   static intptr_t InstanceSize() {
@@ -1892,17 +1842,11 @@
 
   void SetOriginal(const ICData& value) const;
 
-  bool IsOriginal() const {
-    return Original() == this->raw();
-  }
+  bool IsOriginal() const { return Original() == this->raw(); }
 
-  RawString* target_name() const {
-    return raw_ptr()->target_name_;
-  }
+  RawString* target_name() const { return raw_ptr()->target_name_; }
 
-  RawArray* arguments_descriptor() const {
-    return raw_ptr()->args_descriptor_;
-  }
+  RawArray* arguments_descriptor() const { return raw_ptr()->args_descriptor_; }
 
   intptr_t NumArgsTested() const;
 
@@ -1920,31 +1864,31 @@
   void Reset(Zone* zone) const;
   void ResetSwitchable(Zone* zone) const;
 
-  // Note: only deopts with reasons before Unknown in this list are recorded in
-  // the ICData. All other reasons are used purely for informational messages
-  // printed during deoptimization itself.
-  #define DEOPT_REASONS(V)                                                     \
-    V(BinarySmiOp)                                                             \
-    V(BinaryMintOp)                                                            \
-    V(DoubleToSmi)                                                             \
-    V(CheckSmi)                                                                \
-    V(Unknown)                                                                 \
-    V(PolymorphicInstanceCallTestFail)                                         \
-    V(UnaryMintOp)                                                             \
-    V(BinaryDoubleOp)                                                          \
-    V(UnaryOp)                                                                 \
-    V(UnboxInteger)                                                            \
-    V(CheckClass)                                                              \
-    V(CheckArrayBound)                                                         \
-    V(AtCall)                                                                  \
-    V(GuardField)                                                              \
-    V(TestCids)                                                                \
-    V(NumReasons)                                                              \
+// Note: only deopts with reasons before Unknown in this list are recorded in
+// the ICData. All other reasons are used purely for informational messages
+// printed during deoptimization itself.
+#define DEOPT_REASONS(V)                                                       \
+  V(BinarySmiOp)                                                               \
+  V(BinaryMintOp)                                                              \
+  V(DoubleToSmi)                                                               \
+  V(CheckSmi)                                                                  \
+  V(Unknown)                                                                   \
+  V(PolymorphicInstanceCallTestFail)                                           \
+  V(UnaryMintOp)                                                               \
+  V(BinaryDoubleOp)                                                            \
+  V(UnaryOp)                                                                   \
+  V(UnboxInteger)                                                              \
+  V(CheckClass)                                                                \
+  V(CheckArrayBound)                                                           \
+  V(AtCall)                                                                    \
+  V(GuardField)                                                                \
+  V(TestCids)                                                                  \
+  V(NumReasons)
 
   enum DeoptReasonId {
-  #define DEFINE_ENUM_LIST(name) kDeopt##name,
-  DEOPT_REASONS(DEFINE_ENUM_LIST)
-  #undef DEFINE_ENUM_LIST
+#define DEFINE_ENUM_LIST(name) kDeopt##name,
+    DEOPT_REASONS(DEFINE_ENUM_LIST)
+#undef DEFINE_ENUM_LIST
   };
 
   static const intptr_t kLastRecordedDeoptReason = kDeoptUnknown - 1;
@@ -1985,9 +1929,7 @@
     return OFFSET_OF(RawICData, state_bits_);
   }
 
-  static intptr_t NumArgsTestedShift() {
-    return kNumArgsTestedPos;
-  }
+  static intptr_t NumArgsTestedShift() { return kNumArgsTestedPos; }
 
   static intptr_t NumArgsTestedMask() {
     return ((1 << kNumArgsTestedSize) - 1) << kNumArgsTestedPos;
@@ -1997,13 +1939,9 @@
     return OFFSET_OF(RawICData, args_descriptor_);
   }
 
-  static intptr_t ic_data_offset() {
-    return OFFSET_OF(RawICData, ic_data_);
-  }
+  static intptr_t ic_data_offset() { return OFFSET_OF(RawICData, ic_data_); }
 
-  static intptr_t owner_offset() {
-    return OFFSET_OF(RawICData, owner_);
-  }
+  static intptr_t owner_offset() { return OFFSET_OF(RawICData, owner_); }
 
   // Replaces entry |index| with the sentinel.
   void WriteSentinelAt(intptr_t index) const;
@@ -2082,8 +2020,8 @@
   RawICData* AsUnaryClassChecks() const {
     return AsUnaryClassChecksForArgNr(0);
   }
-  RawICData* AsUnaryClassChecksForCid(
-      intptr_t cid, const Function& target) const;
+  RawICData* AsUnaryClassChecksForCid(intptr_t cid,
+                                      const Function& target) const;
 
   // Returns ICData with aggregated receiver count, sorted by highest count.
   // Smi not first!! (the convention for ICData used in code generation is that
@@ -2111,16 +2049,10 @@
 
   static intptr_t TestEntryLengthFor(intptr_t num_args);
 
-  static intptr_t TargetIndexFor(intptr_t num_args) {
-    return num_args;
-  }
-  static intptr_t CodeIndexFor(intptr_t num_args) {
-    return num_args;
-  }
+  static intptr_t TargetIndexFor(intptr_t num_args) { return num_args; }
+  static intptr_t CodeIndexFor(intptr_t num_args) { return num_args; }
 
-  static intptr_t CountIndexFor(intptr_t num_args) {
-    return (num_args + 1);
-  }
+  static intptr_t CountIndexFor(intptr_t num_args) { return (num_args + 1); }
   static intptr_t EntryPointIndexFor(intptr_t num_args) {
     return (num_args + 1);
   }
@@ -2136,9 +2068,7 @@
   // Initialize the preallocated empty ICData entry arrays.
   static void InitOnce();
 
-  enum {
-    kCachedICDataArrayCount = 4
-  };
+  enum { kCachedICDataArrayCount = 4 };
 
 #if defined(TAG_IC_DATA)
   void set_tag(intptr_t value) const;
@@ -2151,9 +2081,7 @@
  private:
   static RawICData* New();
 
-  RawArray* ic_data() const {
-    return raw_ptr()->ic_data_;
-  }
+  RawArray* ic_data() const { return raw_ptr()->ic_data_; }
 
   void set_owner(const Function& value) const;
   void set_target_name(const String& value) const;
@@ -2256,8 +2184,8 @@
   // scope class and its type parameters.
   RawString* UserVisibleSignature() const {
     const bool instantiate = false;
-    return BuildSignature(
-        instantiate, kUserVisibleName, TypeArguments::Handle());
+    return BuildSignature(instantiate, kUserVisibleName,
+                          TypeArguments::Handle());
   }
 
   // Build a string of the form '(A, {B b, C c}) => D' representing the
@@ -2289,8 +2217,10 @@
 
   RawRegExp* regexp() const;
   intptr_t string_specialization_cid() const;
+  bool is_sticky_specialization() const;
   void SetRegExpData(const RegExp& regexp,
-                     intptr_t string_specialization_cid) const;
+                     intptr_t string_specialization_cid,
+                     bool sticky) const;
 
   RawString* native_name() const;
   void set_native_name(const String& name) const;
@@ -2313,7 +2243,7 @@
   // The type parameters (and their bounds) are specified as an array of
   // TypeParameter.
   RawTypeArguments* type_parameters() const {
-      return raw_ptr()->type_parameters_;
+    return raw_ptr()->type_parameters_;
   }
   void set_type_parameters(const TypeArguments& value) const;
   intptr_t NumTypeParameters(Thread* thread) const;
@@ -2347,9 +2277,7 @@
 
   // Return the most recently compiled and installed code for this function.
   // It is not the only Code object that points to this function.
-  RawCode* CurrentCode() const {
-    return raw_ptr()->code_;
-  }
+  RawCode* CurrentCode() const { return raw_ptr()->code_; }
 
   RawCode* unoptimized_code() const {
 #if defined(DART_PRECOMPILED_RUNTIME)
@@ -2361,9 +2289,7 @@
   void set_unoptimized_code(const Code& value) const;
   bool HasCode() const;
 
-  static intptr_t code_offset() {
-    return OFFSET_OF(RawFunction, code_);
-  }
+  static intptr_t code_offset() { return OFFSET_OF(RawFunction, code_); }
 
   static intptr_t entry_point_offset() {
     return OFFSET_OF(RawFunction, entry_point_);
@@ -2506,7 +2432,7 @@
 #else
     return raw_ptr()->end_token_pos_;
 #endif
-}
+  }
   void set_end_token_pos(TokenPosition value) const {
 #if defined(DART_PRECOMPILED_RUNTIME)
     UNREACHABLE();
@@ -2632,6 +2558,20 @@
 #endif
   }
 
+  void* kernel_function() const {
+#if defined(DART_PRECOMPILED_RUNTIME)
+    return NULL;
+#else
+    return raw_ptr()->kernel_function_;
+#endif
+  }
+
+  void set_kernel_function(void* kernel_function) const {
+#if !defined(DART_PRECOMPILED_RUNTIME)
+    StoreNonPointer(&raw_ptr()->kernel_function_, kernel_function);
+#endif
+  }
+
   bool IsOptimizable() const;
   bool IsNativeAutoSetupScope() const;
   void SetIsOptimizable(bool value) const;
@@ -2686,12 +2626,8 @@
                    const TypeArguments& other_type_arguments,
                    Error* bound_error,
                    Heap::Space space) const {
-    return TypeTest(kIsSubtypeOf,
-                    type_arguments,
-                    other,
-                    other_type_arguments,
-                    bound_error,
-                    space);
+    return TypeTest(kIsSubtypeOf, type_arguments, other, other_type_arguments,
+                    bound_error, space);
   }
 
   // Returns true if the type of this function is more specific than the type of
@@ -2701,12 +2637,8 @@
                           const TypeArguments& other_type_arguments,
                           Error* bound_error,
                           Heap::Space space) const {
-    return TypeTest(kIsMoreSpecificThan,
-                    type_arguments,
-                    other,
-                    other_type_arguments,
-                    bound_error,
-                    space);
+    return TypeTest(kIsMoreSpecificThan, type_arguments, other,
+                    other_type_arguments, bound_error, space);
   }
 
   // Check the subtype or 'more specific' relationship.
@@ -2772,9 +2704,7 @@
   bool IsConstructorClosureFunction() const;
 
   // Returns true if this function represents a local function.
-  bool IsLocalFunction() const {
-    return parent_function() != Function::null();
-  }
+  bool IsLocalFunction() const { return parent_function() != Function::null(); }
 
   // Returns true if this function represents a signature function without code.
   bool IsSignatureFunction() const {
@@ -2783,43 +2713,37 @@
   static bool IsSignatureFunction(RawFunction* function) {
     NoSafepointScope no_safepoint;
     return KindBits::decode(function->ptr()->kind_tag_) ==
-        RawFunction::kSignatureFunction;
+           RawFunction::kSignatureFunction;
   }
 
-  bool IsAsyncFunction() const {
-    return modifier() == RawFunction::kAsync;
-  }
+  bool IsAsyncFunction() const { return modifier() == RawFunction::kAsync; }
 
   bool IsAsyncClosure() const {
     return is_generated_body() &&
-        Function::Handle(parent_function()).IsAsyncFunction();
+           Function::Handle(parent_function()).IsAsyncFunction();
   }
 
   bool IsGenerator() const {
     return (modifier() & RawFunction::kGeneratorBit) != 0;
   }
 
-  bool IsSyncGenerator() const {
-    return modifier() == RawFunction::kSyncGen;
-  }
+  bool IsSyncGenerator() const { return modifier() == RawFunction::kSyncGen; }
 
   bool IsSyncGenClosure() const {
     return is_generated_body() &&
-        Function::Handle(parent_function()).IsSyncGenerator();
+           Function::Handle(parent_function()).IsSyncGenerator();
   }
 
   bool IsGeneratorClosure() const {
     return is_generated_body() &&
-        Function::Handle(parent_function()).IsGenerator();
+           Function::Handle(parent_function()).IsGenerator();
   }
 
-  bool IsAsyncGenerator() const {
-    return modifier() == RawFunction::kAsyncGen;
-  }
+  bool IsAsyncGenerator() const { return modifier() == RawFunction::kAsyncGen; }
 
   bool IsAsyncGenClosure() const {
     return is_generated_body() &&
-        Function::Handle(parent_function()).IsAsyncGenerator();
+           Function::Handle(parent_function()).IsAsyncGenerator();
   }
 
   bool IsAsyncOrGenerator() const {
@@ -2830,6 +2754,11 @@
     return RoundedAllocationSize(sizeof(RawFunction));
   }
 
+  static RawFunction* EvaluateHelper(const Class& cls,
+                                     const String& expr,
+                                     const Array& param_names,
+                                     bool is_static);
+
   static RawFunction* New(const String& name,
                           RawFunction::Kind kind,
                           bool is_static,
@@ -2904,29 +2833,29 @@
 #endif
   }
 
-  // static: Considered during class-side or top-level resolution rather than
-  //         instance-side resolution.
-  // const: Valid target of a const constructor call.
-  // abstract: Skipped during instance-side resolution.
-  // reflectable: Enumerated by mirrors, invocable by mirrors. False for private
-  //              functions of dart: libraries.
-  // debuggable: Valid location of a breakpoint. Synthetic code is not
-  //             debuggable.
-  // visible: Frame is included in stack traces. Synthetic code such as
-  //          dispatchers is not visible. Synthetic code that can trigger
-  //          exceptions such as the outer async functions that create Futures
-  //          is visible.
-  // optimizable: Candidate for going through the optimizing compiler. False for
-  //              some functions known to be execute infrequently and functions
-  //              which have been de-optimized too many times.
-  // instrinsic: Has a hand-written assembly prologue.
-  // inlinable: Candidate for inlining. False for functions with features we
-  //            don't support during inlining (e.g., optional parameters),
-  //            functions which are too big, etc.
-  // native: Bridge to C/C++ code.
-  // redirecting: Redirecting generative or factory constructor.
-  // external: Just a declaration that expects to be defined in another patch
-  //           file.
+// static: Considered during class-side or top-level resolution rather than
+//         instance-side resolution.
+// const: Valid target of a const constructor call.
+// abstract: Skipped during instance-side resolution.
+// reflectable: Enumerated by mirrors, invocable by mirrors. False for private
+//              functions of dart: libraries.
+// debuggable: Valid location of a breakpoint. Synthetic code is not
+//             debuggable.
+// visible: Frame is included in stack traces. Synthetic code such as
+//          dispatchers is not visible. Synthetic code that can trigger
+//          exceptions such as the outer async functions that create Futures
+//          is visible.
+// optimizable: Candidate for going through the optimizing compiler. False for
+//              some functions known to be execute infrequently and functions
+//              which have been de-optimized too many times.
+// instrinsic: Has a hand-written assembly prologue.
+// inlinable: Candidate for inlining. False for functions with features we
+//            don't support during inlining (e.g., optional parameters),
+//            functions which are too big, etc.
+// native: Bridge to C/C++ code.
+// redirecting: Redirecting generative or factory constructor.
+// external: Just a declaration that expects to be defined in another patch
+//           file.
 
 #define FOR_EACH_FUNCTION_KIND_BIT(V)                                          \
   V(Static, is_static)                                                         \
@@ -2945,16 +2874,14 @@
   V(AllowsBoundsCheckGeneralization, allows_bounds_check_generalization)       \
   V(GeneratedBody, is_generated_body)                                          \
   V(AlwaysInline, always_inline)                                               \
-  V(PolymorphicTarget, is_polymorphic_target)                                  \
+  V(PolymorphicTarget, is_polymorphic_target)
 
 #define DEFINE_ACCESSORS(name, accessor_name)                                  \
   void set_##accessor_name(bool value) const {                                 \
     set_kind_tag(name##Bit::update(value, raw_ptr()->kind_tag_));              \
   }                                                                            \
-  bool accessor_name() const {                                                 \
-    return name##Bit::decode(raw_ptr()->kind_tag_);                            \
-  }
-FOR_EACH_FUNCTION_KIND_BIT(DEFINE_ACCESSORS)
+  bool accessor_name() const { return name##Bit::decode(raw_ptr()->kind_tag_); }
+  FOR_EACH_FUNCTION_KIND_BIT(DEFINE_ACCESSORS)
 #undef DEFINE_ACCESSORS
 
  private:
@@ -2969,21 +2896,23 @@
     kModifierPos = kRecognizedTagPos + kRecognizedTagSize,
     kModifierSize = 2,
     kLastModifierBitPos = kModifierPos + (kModifierSize - 1),
-    // Single bit sized fields start here.
+// Single bit sized fields start here.
 #define DECLARE_BIT(name, _) k##name##Bit,
-FOR_EACH_FUNCTION_KIND_BIT(DECLARE_BIT)
+    FOR_EACH_FUNCTION_KIND_BIT(DECLARE_BIT)
 #undef DECLARE_BIT
-    kNumTagBits
+        kNumTagBits
   };
 
-  COMPILE_ASSERT(
-      MethodRecognizer::kNumRecognizedMethods < (1 << kRecognizedTagSize));
-  COMPILE_ASSERT(
-      kNumTagBits <=
-      (kBitsPerByte * sizeof(static_cast<RawFunction*>(0)->kind_tag_)));
+  COMPILE_ASSERT(MethodRecognizer::kNumRecognizedMethods <
+                 (1 << kRecognizedTagSize));
+  COMPILE_ASSERT(kNumTagBits <=
+                 (kBitsPerByte *
+                  sizeof(static_cast<RawFunction*>(0)->kind_tag_)));
 
-  class KindBits :
-    public BitField<uint32_t, RawFunction::Kind, kKindTagPos, kKindTagSize> {};
+  class KindBits : public BitField<uint32_t,
+                                   RawFunction::Kind,
+                                   kKindTagPos,
+                                   kKindTagSize> {};
 
   class RecognizedBits : public BitField<uint32_t,
                                          MethodRecognizer::Kind,
@@ -2994,9 +2923,9 @@
                                        kModifierPos,
                                        kModifierSize> {};
 
-#define DEFINE_BIT(name, _) \
+#define DEFINE_BIT(name, _)                                                    \
   class name##Bit : public BitField<uint32_t, bool, k##name##Bit, 1> {};
-FOR_EACH_FUNCTION_KIND_BIT(DEFINE_BIT)
+  FOR_EACH_FUNCTION_KIND_BIT(DEFINE_BIT)
 #undef DEFINE_BIT
 
   void set_name(const String& value) const;
@@ -3050,7 +2979,7 @@
 };
 
 
-class ClosureData: public Object {
+class ClosureData : public Object {
  public:
   static intptr_t InstanceSize() {
     return RoundedAllocationSize(sizeof(RawClosureData));
@@ -3068,9 +2997,7 @@
   RawType* signature_type() const { return raw_ptr()->signature_type_; }
   void set_signature_type(const Type& value) const;
 
-  RawInstance* implicit_static_closure() const {
-    return raw_ptr()->closure_;
-  }
+  RawInstance* implicit_static_closure() const { return raw_ptr()->closure_; }
   void set_implicit_static_closure(const Instance& closure) const;
 
   static RawClosureData* New();
@@ -3082,7 +3009,7 @@
 };
 
 
-class RedirectionData: public Object {
+class RedirectionData : public Object {
  public:
   static intptr_t InstanceSize() {
     return RoundedAllocationSize(sizeof(RawRedirectionData));
@@ -3152,6 +3079,21 @@
     set_kind_bits(DoubleInitializedBit::update(value, raw_ptr()->kind_bits_));
   }
 
+  void* kernel_field() const {
+#if defined(DART_PRECOMPILED_RUNTIME)
+    return NULL;
+#else
+    return raw_ptr()->kernel_field_;
+#endif
+  }
+
+  void set_kernel_field(void* kernel_field) const {
+#if !defined(DART_PRECOMPILED_RUNTIME)
+    StoreNonPointer(&raw_ptr()->kernel_field_, kernel_field);
+#endif
+  }
+
+
   inline intptr_t Offset() const;
   // Called during class finalization.
   inline void SetOffset(intptr_t offset_in_bytes) const;
@@ -3165,7 +3107,7 @@
   RawScript* Script() const;
   RawObject* RawOwner() const;
 
-  RawAbstractType* type() const  { return raw_ptr()->type_; }
+  RawAbstractType* type() const { return raw_ptr()->type_; }
   // Used by class finalizer, otherwise initialized in constructor.
   void SetFieldType(const AbstractType& value) const;
 
@@ -3206,6 +3148,8 @@
 
   TokenPosition token_pos() const { return raw_ptr()->token_pos_; }
 
+  RawString* InitializingExpression() const;
+
   bool has_initializer() const {
     return HasInitializerBit::decode(raw_ptr()->kind_bits_);
   }
@@ -3213,8 +3157,8 @@
   void set_has_initializer(bool has_initializer) const {
     ASSERT(IsOriginal());
     ASSERT(Thread::Current()->IsMutatorThread());
-    set_kind_bits(HasInitializerBit::update(has_initializer,
-                                            raw_ptr()->kind_bits_));
+    set_kind_bits(
+        HasInitializerBit::update(has_initializer, raw_ptr()->kind_bits_));
   }
 
   // Return class id that any non-null value read from this field is guaranteed
@@ -3261,9 +3205,7 @@
 
   const char* GuardedPropertiesAsCString() const;
 
-  intptr_t UnboxedFieldCid() const {
-    return guarded_cid();
-  }
+  intptr_t UnboxedFieldCid() const { return guarded_cid(); }
 
   bool is_unboxing_candidate() const {
     return UnboxingCandidateBit::decode(raw_ptr()->kind_bits_);
@@ -3287,9 +3229,7 @@
   // Internally we is_nullable_ field contains either kNullCid (nullable) or
   // any other value (non-nullable) instead of boolean. This is done to simplify
   // guarding sequence in the generated code.
-  bool is_nullable() const {
-    return raw_ptr()->is_nullable_ == kNullCid;
-  }
+  bool is_nullable() const { return raw_ptr()->is_nullable_ == kNullCid; }
   void set_is_nullable(bool val) const {
     ASSERT(Thread::Current()->IsMutatorThread());
     StoreNonPointer(&raw_ptr()->is_nullable_, val ? kNullCid : kIllegalCid);
@@ -3379,13 +3319,13 @@
   class ConstBit : public BitField<uint8_t, bool, kConstBit, 1> {};
   class StaticBit : public BitField<uint8_t, bool, kStaticBit, 1> {};
   class FinalBit : public BitField<uint8_t, bool, kFinalBit, 1> {};
-  class HasInitializerBit :
-      public BitField<uint8_t, bool, kHasInitializerBit, 1> {};
-  class UnboxingCandidateBit :
-      public BitField<uint8_t, bool, kUnboxingCandidateBit, 1> {};
+  class HasInitializerBit
+      : public BitField<uint8_t, bool, kHasInitializerBit, 1> {};
+  class UnboxingCandidateBit
+      : public BitField<uint8_t, bool, kUnboxingCandidateBit, 1> {};
   class ReflectableBit : public BitField<uint8_t, bool, kReflectableBit, 1> {};
-  class DoubleInitializedBit :
-      public BitField<uint8_t, bool, kDoubleInitializedBit, 1> {};
+  class DoubleInitializedBit
+      : public BitField<uint8_t, bool, kDoubleInitializedBit, 1> {};
 
   // Update guarded cid and guarded length for this field. Returns true, if
   // deoptimization of dependent code is required.
@@ -3458,8 +3398,7 @@
   void SetStream(const ExternalTypedData& stream) const;
 
   RawString* GenerateSource() const;
-  RawString* GenerateSource(TokenPosition start,
-                            TokenPosition end) const;
+  RawString* GenerateSource(TokenPosition start, TokenPosition end) const;
   intptr_t ComputeSourcePosition(TokenPosition tok_pos) const;
 
   RawString* PrivateKey() const;
@@ -3483,10 +3422,7 @@
   // in a TokenStream object.
   class Iterator : ValueObject {
    public:
-    enum StreamType {
-      kNoNewlines,
-      kAllTokens
-    };
+    enum StreamType { kNoNewlines, kAllTokens };
 
     Iterator(Zone* zone,
              const TokenStream& tokens,
@@ -3496,9 +3432,7 @@
     void SetStream(const TokenStream& tokens, TokenPosition token_pos);
     bool IsValid() const;
 
-    inline Token::Kind CurrentTokenKind() const {
-      return cur_token_kind_;
-    }
+    inline Token::Kind CurrentTokenKind() const { return cur_token_kind_; }
 
     Token::Kind LookaheadTokenKind(intptr_t num_tokens);
 
@@ -3537,7 +3471,7 @@
   static RawTokenStream* New();
   static void DataFinalizer(void* isolate_callback_data,
                             Dart_WeakPersistentHandle handle,
-                            void *peer);
+                            void* peer);
 
   FINAL_HEAP_OBJECT_IMPLEMENTATION(TokenStream, Object);
   friend class Class;
@@ -3571,12 +3505,16 @@
 
   RawTokenStream* tokens() const { return raw_ptr()->tokens_; }
 
-  void Tokenize(const String& private_key,
-                bool use_shared_tokens = true) const;
+  RawArray* line_starts() const { return raw_ptr()->line_starts_; }
+
+  void set_line_starts(const Array& value) const;
+
+  void Tokenize(const String& private_key, bool use_shared_tokens = true) const;
 
   RawLibrary* FindLibrary() const;
   RawString* GetLine(intptr_t line_number,
                      Heap::Space space = Heap::kNew) const;
+  RawString* GetSnippet(TokenPosition from, TokenPosition to) const;
   RawString* GetSnippet(intptr_t from_line,
                         intptr_t from_column,
                         intptr_t to_line,
@@ -3640,7 +3578,7 @@
 
   const Array& array_;
   const int size_;  // Number of elements to iterate over.
-  int next_ix_;  // Index of next element.
+  int next_ix_;     // Index of next element.
 
   friend class ClassDictionaryIterator;
   friend class LibraryPrefixIterator;
@@ -3661,7 +3599,7 @@
                           IterationKind kind = kNoIteratePrivate);
 
   bool HasNext() const {
-      return (next_ix_ < size_) || !toplevel_class_.IsNull();
+    return (next_ix_ < size_) || !toplevel_class_.IsNull();
   }
 
   // Returns a non-null raw class.
@@ -3680,6 +3618,7 @@
  public:
   explicit LibraryPrefixIterator(const Library& library);
   RawLibraryPrefix* GetNext();
+
  private:
   void Advance();
   DISALLOW_COPY_AND_ASSIGN(LibraryPrefixIterator);
@@ -3775,17 +3714,14 @@
                         const Object& tl_owner,
                         TokenPosition token_pos) const;
   void AddFieldMetadata(const Field& field, TokenPosition token_pos) const;
-  void AddFunctionMetadata(const Function& func,
-                           TokenPosition token_pos) const;
+  void AddFunctionMetadata(const Function& func, TokenPosition token_pos) const;
   void AddLibraryMetadata(const Object& tl_owner,
                           TokenPosition token_pos) const;
   void AddTypeParameterMetadata(const TypeParameter& param,
                                 TokenPosition token_pos) const;
   RawObject* GetMetadata(const Object& obj) const;
 
-  RawClass* toplevel_class() const {
-    return raw_ptr()->toplevel_class_;
-  }
+  RawClass* toplevel_class() const { return raw_ptr()->toplevel_class_; }
   void set_toplevel_class(const Class& value) const;
 
   RawGrowableObjectArray* patch_classes() const {
@@ -3837,23 +3773,17 @@
   static void RegisterLibraries(Thread* thread,
                                 const GrowableObjectArray& libs);
 
-  bool IsDebuggable() const {
-    return raw_ptr()->debuggable_;
-  }
+  bool IsDebuggable() const { return raw_ptr()->debuggable_; }
   void set_debuggable(bool value) const {
     StoreNonPointer(&raw_ptr()->debuggable_, value);
   }
 
-  bool is_dart_scheme() const {
-    return raw_ptr()->is_dart_scheme_;
-  }
+  bool is_dart_scheme() const { return raw_ptr()->is_dart_scheme_; }
   void set_is_dart_scheme(bool value) const {
     StoreNonPointer(&raw_ptr()->is_dart_scheme_, value);
   }
 
-  bool IsCoreLibrary() const {
-    return raw() == CoreLibrary();
-  }
+  bool IsCoreLibrary() const { return raw() == CoreLibrary(); }
 
   inline intptr_t UrlHash() const;
 
@@ -3861,7 +3791,7 @@
   static RawLibrary* GetLibrary(intptr_t index);
 
   static void InitCoreLibrary(Isolate* isolate);
-  static void InitNativeWrappersLibrary(Isolate* isolate);
+  static void InitNativeWrappersLibrary(Isolate* isolate, bool is_kernel_file);
 
   static RawLibrary* AsyncLibrary();
   static RawLibrary* ConvertLibrary();
@@ -3871,7 +3801,9 @@
   static RawLibrary* InternalLibrary();
   static RawLibrary* IsolateLibrary();
   static RawLibrary* MathLibrary();
+#if !defined(PRODUCT)
   static RawLibrary* MirrorsLibrary();
+#endif
   static RawLibrary* NativeWrappersLibrary();
   static RawLibrary* ProfilerLibrary();
   static RawLibrary* TypedDataLibrary();
@@ -3901,7 +3833,7 @@
                                   const char* function_name);
 
   // Character used to indicate a private identifier.
-  static const char kPrivateIdentifierStart  = '_';
+  static const char kPrivateIdentifierStart = '_';
 
   // Character used to separate private identifiers from
   // the library-specific key.
@@ -3940,9 +3872,8 @@
 
   void InitImportList() const;
   void GrowDictionary(const Array& dict, intptr_t dict_size) const;
-  static RawLibrary* NewLibraryHelper(const String& url,
-                                      bool import_core_lib);
-  RawObject* LookupEntry(const String& name, intptr_t *index) const;
+  static RawLibrary* NewLibraryHelper(const String& url, bool import_core_lib);
+  RawObject* LookupEntry(const String& name, intptr_t* index) const;
 
   void AllocatePrivateKey() const;
 
@@ -4011,9 +3942,9 @@
   };
 
   struct Entry {
-    Entry() : raw_value_(), type_() { }
-    explicit Entry(const Object* obj) : obj_(obj), type_(kTaggedObject) { }
-    Entry(uword value, EntryType info) : raw_value_(value), type_(info) { }
+    Entry() : raw_value_(), type_() {}
+    explicit Entry(const Object* obj) : obj_(obj), type_(kTaggedObject) {}
+    Entry(uword value, EntryType info) : raw_value_(value), type_(info) {}
     union {
       const Object* obj_;
       uword raw_value_;
@@ -4021,16 +3952,12 @@
     EntryType type_;
   };
 
-  intptr_t Length() const {
-    return raw_ptr()->length_;
-  }
+  intptr_t Length() const { return raw_ptr()->length_; }
   void SetLength(intptr_t value) const {
     StoreNonPointer(&raw_ptr()->length_, value);
   }
 
-  RawTypedData* info_array() const {
-    return raw_ptr()->info_array_;
-  }
+  RawTypedData* info_array() const { return raw_ptr()->info_array_; }
 
   void set_info_array(const TypedData& info_array) const;
 
@@ -4039,8 +3966,8 @@
     return OFFSET_OF_RETURNED_VALUE(RawObjectPool, data);
   }
   static intptr_t element_offset(intptr_t index) {
-    return OFFSET_OF_RETURNED_VALUE(RawObjectPool, data)
-        + kBytesPerElement * index;
+    return OFFSET_OF_RETURNED_VALUE(RawObjectPool, data) +
+           kBytesPerElement * index;
   }
 
   EntryType InfoAt(intptr_t index) const;
@@ -4076,8 +4003,8 @@
     // Ensure that variable length data is not adding to the object length.
     ASSERT(sizeof(RawObjectPool) == (sizeof(RawObject) + (2 * kWordSize)));
     ASSERT(0 <= len && len <= kMaxElements);
-    return RoundedAllocationSize(
-        sizeof(RawObjectPool) + (len * kBytesPerElement));
+    return RoundedAllocationSize(sizeof(RawObjectPool) +
+                                 (len * kBytesPerElement));
   }
 
   static RawObjectPool* New(intptr_t len);
@@ -4110,18 +4037,33 @@
 
 class Instructions : public Object {
  public:
-  intptr_t size() const { return raw_ptr()->size_; }  // Excludes HeaderSize().
+  enum {
+    kSizePos = 0,
+    kSizeSize = 31,
+    kFlagsPos = kSizePos + kSizeSize,
+    kFlagsSize = 1,  // Currently, only flag is single entry flag.
+  };
 
-  uword PayloadStart() const {
-    return PayloadStart(raw());
+  class SizeBits : public BitField<uint32_t, uint32_t, kSizePos, kSizeSize> {};
+  class FlagsBits : public BitField<uint32_t, bool, kFlagsPos, kFlagsSize> {};
+
+  // Excludes HeaderSize().
+  intptr_t Size() const { return SizeBits::decode(raw_ptr()->size_and_flags_); }
+  static intptr_t Size(const RawInstructions* instr) {
+    return SizeBits::decode(instr->ptr()->size_and_flags_);
   }
-  uword UncheckedEntryPoint() const {
-    return UncheckedEntryPoint(raw());
+
+  bool HasSingleEntryPoint() const {
+    return FlagsBits::decode(raw_ptr()->size_and_flags_);
   }
-  uword CheckedEntryPoint() const {
-    return CheckedEntryPoint(raw());
+  static bool HasSingleEntryPoint(const RawInstructions* instr) {
+    return FlagsBits::decode(instr->ptr()->size_and_flags_);
   }
-  static uword PayloadStart(RawInstructions* instr) {
+
+  uword PayloadStart() const { return PayloadStart(raw()); }
+  uword CheckedEntryPoint() const { return CheckedEntryPoint(raw()); }
+  uword UncheckedEntryPoint() const { return UncheckedEntryPoint(raw()); }
+  static uword PayloadStart(const RawInstructions* instr) {
     return reinterpret_cast<uword>(instr->ptr()) + HeaderSize();
   }
 
@@ -4129,17 +4071,17 @@
   static const intptr_t kCheckedEntryOffset = 0;
   static const intptr_t kUncheckedEntryOffset = 0;
 #elif defined(TARGET_ARCH_X64)
-  static const intptr_t kCheckedEntryOffset = 23;
-  static const intptr_t kUncheckedEntryOffset = 44;
-#elif defined(TARGET_ARCH_ARM)
-  static const intptr_t kCheckedEntryOffset = 12;
-  static const intptr_t kUncheckedEntryOffset = 36;
-#elif defined(TARGET_ARCH_ARM64)
-  static const intptr_t kCheckedEntryOffset = 24;
-  static const intptr_t kUncheckedEntryOffset = 48;
-#elif defined(TARGET_ARCH_MIPS)
   static const intptr_t kCheckedEntryOffset = 16;
-  static const intptr_t kUncheckedEntryOffset = 56;
+  static const intptr_t kUncheckedEntryOffset = 38;
+#elif defined(TARGET_ARCH_ARM)
+  static const intptr_t kCheckedEntryOffset = 8;
+  static const intptr_t kUncheckedEntryOffset = 32;
+#elif defined(TARGET_ARCH_ARM64)
+  static const intptr_t kCheckedEntryOffset = 16;
+  static const intptr_t kUncheckedEntryOffset = 40;
+#elif defined(TARGET_ARCH_MIPS)
+  static const intptr_t kCheckedEntryOffset = 12;
+  static const intptr_t kUncheckedEntryOffset = 52;
 #elif defined(TARGET_ARCH_DBC)
   static const intptr_t kCheckedEntryOffset = 0;
   static const intptr_t kUncheckedEntryOffset = 0;
@@ -4147,17 +4089,24 @@
 #error Missing entry offsets for current architecture
 #endif
 
-  static uword UncheckedEntryPoint(RawInstructions* instr) {
-    return PayloadStart(instr) + kUncheckedEntryOffset;
+  static uword CheckedEntryPoint(const RawInstructions* instr) {
+    uword entry = PayloadStart(instr);
+    if (!HasSingleEntryPoint(instr)) {
+      entry += kCheckedEntryOffset;
+    }
+    return entry;
   }
-  static uword CheckedEntryPoint(RawInstructions* instr) {
-    return PayloadStart(instr) + kCheckedEntryOffset;
+  static uword UncheckedEntryPoint(const RawInstructions* instr) {
+    uword entry = PayloadStart(instr);
+    if (!HasSingleEntryPoint(instr)) {
+      entry += kUncheckedEntryOffset;
+    }
+    return entry;
   }
 
-  static const intptr_t kMaxElements = (kMaxInt32 -
-                                        (sizeof(RawInstructions) +
-                                         sizeof(RawObject) +
-                                         (2 * OS::kMaxPreferredCodeAlignment)));
+  static const intptr_t kMaxElements =
+      (kMaxInt32 - (sizeof(RawInstructions) + sizeof(RawObject) +
+                    (2 * OS::kMaxPreferredCodeAlignment)));
 
   static intptr_t InstanceSize() {
     ASSERT(sizeof(RawInstructions) ==
@@ -4166,8 +4115,8 @@
   }
 
   static intptr_t InstanceSize(intptr_t size) {
-    intptr_t instructions_size = Utils::RoundUp(size,
-                                                OS::PreferredCodeAlignment());
+    intptr_t instructions_size =
+        Utils::RoundUp(size, OS::PreferredCodeAlignment());
     intptr_t result = instructions_size + HeaderSize();
     ASSERT(result % OS::PreferredCodeAlignment() == 0);
     return result;
@@ -4178,29 +4127,36 @@
     return Utils::RoundUp(sizeof(RawInstructions), alignment);
   }
 
-  static RawInstructions* FromUncheckedEntryPoint(uword entry_point) {
-    return reinterpret_cast<RawInstructions*>(
-        entry_point - HeaderSize() - kUncheckedEntryOffset + kHeapObjectTag);
+  static RawInstructions* FromPayloadStart(uword payload_start) {
+    return reinterpret_cast<RawInstructions*>(payload_start - HeaderSize() +
+                                              kHeapObjectTag);
   }
 
   bool Equals(const Instructions& other) const {
-    if (size() != other.size()) {
+    if (Size() != other.Size()) {
       return false;
     }
     NoSafepointScope no_safepoint;
-    return memcmp(raw_ptr(), other.raw_ptr(), InstanceSize(size())) == 0;
+    return memcmp(raw_ptr(), other.raw_ptr(), InstanceSize(Size())) == 0;
   }
 
  private:
-  void set_size(intptr_t size) const {
-    StoreNonPointer(&raw_ptr()->size_, size);
+  void SetSize(intptr_t value) const {
+    ASSERT(value >= 0);
+    StoreNonPointer(&raw_ptr()->size_and_flags_,
+                    SizeBits::update(value, raw_ptr()->size_and_flags_));
+  }
+
+  void SetHasSingleEntryPoint(bool value) const {
+    StoreNonPointer(&raw_ptr()->size_and_flags_,
+                    FlagsBits::update(value, raw_ptr()->size_and_flags_));
   }
 
   // New is a private method as RawInstruction and RawCode objects should
   // only be created using the Code::FinalizeCode method. This method creates
   // the RawInstruction and RawCode objects, sets up the pointer offsets
   // and links the two in a GC safe manner.
-  static RawInstructions* New(intptr_t size);
+  static RawInstructions* New(intptr_t size, bool has_single_entry_point);
 
   FINAL_HEAP_OBJECT_IMPLEMENTATION(Instructions, Object);
   friend class Class;
@@ -4228,13 +4184,14 @@
 
   static intptr_t InstanceSize() {
     ASSERT(sizeof(RawLocalVarDescriptors) ==
-        OFFSET_OF_RETURNED_VALUE(RawLocalVarDescriptors, names));
+           OFFSET_OF_RETURNED_VALUE(RawLocalVarDescriptors, names));
     return 0;
   }
   static intptr_t InstanceSize(intptr_t len) {
     ASSERT(0 <= len && len <= kMaxElements);
-    return RoundedAllocationSize(sizeof(RawLocalVarDescriptors)
-        + (len * kWordSize)  // RawStrings for names.
+    return RoundedAllocationSize(
+        sizeof(RawLocalVarDescriptors) +
+        (len * kWordSize)  // RawStrings for names.
         + (len * sizeof(RawLocalVarDescriptors::VarInfo)));
   }
 
@@ -4293,8 +4250,7 @@
           cur_kind_(0),
           cur_deopt_id_(0),
           cur_token_pos_(0),
-          cur_try_index_(0) {
-    }
+          cur_try_index_(0) {}
 
     bool MoveNext() {
       // Moves to record that matches kind_mask_.
@@ -4408,8 +4364,7 @@
         : code_source_map_(code_source_map),
           byte_index_(0),
           cur_pc_offset_(0),
-          cur_token_pos_(0) {
-    }
+          cur_token_pos_(0) {}
 
     bool MoveNext() {
       // Moves to the next record.
@@ -4489,8 +4444,7 @@
   static intptr_t InstanceSize(intptr_t length) {
     ASSERT(length >= 0);
     // The stackmap payload is in an array of bytes.
-    intptr_t payload_size =
-        Utils::RoundUp(length, kBitsPerByte) / kBitsPerByte;
+    intptr_t payload_size = Utils::RoundUp(length, kBitsPerByte) / kBitsPerByte;
     return RoundedAllocationSize(sizeof(RawStackmap) + payload_size);
   }
   static RawStackmap* New(intptr_t pc_offset,
@@ -4503,7 +4457,7 @@
 
  private:
   void SetLength(intptr_t length) const {
-      StoreNonPointer(&raw_ptr()->length_, length);
+    StoreNonPointer(&raw_ptr()->length_, length);
   }
 
   bool InRange(intptr_t index) const { return index < Length(); }
@@ -4548,7 +4502,7 @@
   static intptr_t InstanceSize(intptr_t len) {
     return RoundedAllocationSize(
         sizeof(RawExceptionHandlers) +
-            (len * sizeof(RawExceptionHandlers::HandlerInfo)));
+        (len * sizeof(RawExceptionHandlers::HandlerInfo)));
   }
 
   static RawExceptionHandlers* New(intptr_t num_handlers);
@@ -4599,8 +4553,7 @@
 
   // Size of the frame part of the translation not counting kMaterializeObject
   // instructions in the prefix.
-  static const char* ToCString(const Array& table,
-                               const TypedData& packed);
+  static const char* ToCString(const Array& table, const TypedData& packed);
 
   // Returns true iff decompression yields the same instructions as the
   // original.
@@ -4654,31 +4607,30 @@
     return OptimizedBit::decode(raw_ptr()->state_bits_);
   }
   void set_is_optimized(bool value) const;
-  bool is_alive() const {
-    return AliveBit::decode(raw_ptr()->state_bits_);
-  }
+  bool is_alive() const { return AliveBit::decode(raw_ptr()->state_bits_); }
   void set_is_alive(bool value) const;
 
   uword PayloadStart() const {
-    return Instructions::PayloadStart(instructions());
+    const Instructions& instr = Instructions::Handle(instructions());
+    return instr.PayloadStart();
   }
   uword UncheckedEntryPoint() const {
-    return Instructions::UncheckedEntryPoint(instructions());
+    const Instructions& instr = Instructions::Handle(instructions());
+    return instr.UncheckedEntryPoint();
   }
   uword CheckedEntryPoint() const {
-    return Instructions::CheckedEntryPoint(instructions());
+    const Instructions& instr = Instructions::Handle(instructions());
+    return instr.CheckedEntryPoint();
   }
   intptr_t Size() const {
     const Instructions& instr = Instructions::Handle(instructions());
-    return instr.size();
+    return instr.Size();
   }
-  RawObjectPool* GetObjectPool() const {
-    return object_pool();
-  }
+  RawObjectPool* GetObjectPool() const { return object_pool(); }
   bool ContainsInstructionAt(uword addr) const {
     const Instructions& instr = Instructions::Handle(instructions());
     const uword offset = addr - instr.PayloadStart();
-    return offset < static_cast<uword>(instr.size());
+    return offset < static_cast<uword>(instr.Size());
   }
 
   // Returns true if there is a debugger breakpoint set in this code object.
@@ -4726,12 +4678,11 @@
   }
   void set_deopt_info_array(const Array& array) const;
 
-  RawArray* stackmaps() const {
-    return raw_ptr()->stackmaps_;
-  }
+  RawArray* stackmaps() const { return raw_ptr()->stackmaps_; }
   void set_stackmaps(const Array& maps) const;
-  RawStackmap* GetStackmap(
-      uint32_t pc_offset, Array* stackmaps, Stackmap* map) const;
+  RawStackmap* GetStackmap(uint32_t pc_offset,
+                           Array* stackmaps,
+                           Stackmap* map) const;
 
   enum {
     kSCallTableOffsetEntry = 0,
@@ -4782,7 +4733,7 @@
     // Layout of entries describing comments.
     enum {
       kPCOffsetEntry = 0,  // PC offset to a comment as a Smi.
-      kCommentEntry,  // Comment text as a String.
+      kCommentEntry,       // Comment text as a String.
       kNumberOfEntries
     };
 
@@ -4872,9 +4823,7 @@
     return reinterpret_cast<RawFunction*>(raw_ptr()->owner_);
   }
 
-  RawObject* owner() const {
-    return raw_ptr()->owner_;
-  }
+  RawObject* owner() const { return raw_ptr()->owner_; }
 
   void set_owner(const Function& function) const {
     ASSERT(function.IsOld());
@@ -4918,13 +4867,6 @@
   }
   TokenPosition GetTokenIndexOfPC(uword pc) const;
 
-  enum {
-    kInvalidPc = -1
-  };
-
-  uword GetLazyDeoptReturnPc() const;
-  uword GetLazyDeoptThrowPc() const;
-
   // Find pc, return 0 if not found.
   uword GetPcForDeoptId(intptr_t deopt_id, RawPcDescriptors::Kind kind) const;
   intptr_t GetDeoptIdForOsr(uword pc) const;
@@ -4940,35 +4882,6 @@
 #endif
   }
 
-  intptr_t lazy_deopt_return_pc_offset() const {
-#if defined(DART_PRECOMPILED_RUNTIME)
-    return 0;
-#else
-    return raw_ptr()->lazy_deopt_return_pc_offset_;
-#endif
-  }
-  void set_lazy_deopt_return_pc_offset(intptr_t pc) const {
-#if defined(DART_PRECOMPILED_RUNTIME)
-    UNREACHABLE();
-#else
-    StoreNonPointer(&raw_ptr()->lazy_deopt_return_pc_offset_, pc);
-#endif
-  }
-  intptr_t lazy_deopt_throw_pc_offset() const {
-#if defined(DART_PRECOMPILED_RUNTIME)
-    return 0;
-#else
-    return raw_ptr()->lazy_deopt_throw_pc_offset_;
-#endif
-  }
-  void set_lazy_deopt_throw_pc_offset(intptr_t pc) const {
-#if defined(DART_PRECOMPILED_RUNTIME)
-    UNREACHABLE();
-#else
-    StoreNonPointer(&raw_ptr()->lazy_deopt_throw_pc_offset_, pc);
-#endif
-  }
-
   bool IsAllocationStubCode() const;
   bool IsStubCode() const;
   bool IsFunctionCode() const;
@@ -4981,12 +4894,10 @@
     if (!IsDisabled()) return;
     ASSERT(Thread::Current()->IsMutatorThread());
     ASSERT(instructions() != active_instructions());
-    SetActiveInstructions(instructions());
+    SetActiveInstructions(Instructions::Handle(instructions()));
   }
 
-  bool IsDisabled() const {
-    return instructions() != active_instructions();
-  }
+  bool IsDisabled() const { return instructions() != active_instructions(); }
 
  private:
   void set_state_bits(intptr_t bits) const;
@@ -5006,13 +4917,13 @@
 
   class OptimizedBit : public BitField<int32_t, bool, kOptimizedBit, 1> {};
   class AliveBit : public BitField<int32_t, bool, kAliveBit, 1> {};
-  class PtrOffBits :
-      public BitField<int32_t, intptr_t, kPtrOffBit, kPtrOffSize> {};
+  class PtrOffBits
+      : public BitField<int32_t, intptr_t, kPtrOffBit, kPtrOffSize> {};
 
   class SlowFindRawCodeVisitor : public FindObjectVisitor {
    public:
-    explicit SlowFindRawCodeVisitor(uword pc) : pc_(pc) { }
-    virtual ~SlowFindRawCodeVisitor() { }
+    explicit SlowFindRawCodeVisitor(uword pc) : pc_(pc) {}
+    virtual ~SlowFindRawCodeVisitor() {}
 
     // Check if object matches find condition.
     virtual bool FindObject(RawObject* obj) const;
@@ -5037,11 +4948,11 @@
 #endif
   }
 
-  void SetActiveInstructions(RawInstructions* instructions) const;
+  void SetActiveInstructions(const Instructions& instructions) const;
 
-  void set_instructions(RawInstructions* instructions) const {
+  void set_instructions(const Instructions& instructions) const {
     ASSERT(Thread::Current()->IsMutatorThread() || !is_alive());
-    StorePointer(&raw_ptr()->instructions_, instructions);
+    StorePointer(&raw_ptr()->instructions_, instructions.raw());
   }
 
   void set_pointer_offsets_length(intptr_t value) {
@@ -5158,6 +5069,10 @@
   TokenPosition TokenIndexAt(intptr_t scope_index) const;
   void SetTokenIndexAt(intptr_t scope_index, TokenPosition token_pos) const;
 
+  TokenPosition DeclarationTokenIndexAt(intptr_t scope_index) const;
+  void SetDeclarationTokenIndexAt(intptr_t scope_index,
+                                  TokenPosition declaration_token_pos) const;
+
   RawString* NameAt(intptr_t scope_index) const;
   void SetNameAt(intptr_t scope_index, const String& name) const;
 
@@ -5191,8 +5106,8 @@
 
   static intptr_t InstanceSize(intptr_t len) {
     ASSERT(0 <= len && len <= kMaxElements);
-    return RoundedAllocationSize(
-        sizeof(RawContextScope) + (len * kBytesPerElement));
+    return RoundedAllocationSize(sizeof(RawContextScope) +
+                                 (len * kBytesPerElement));
   }
 
   static RawContextScope* New(intptr_t num_variables, bool is_implicit);
@@ -5229,13 +5144,9 @@
   intptr_t mask() const;
   void set_mask(intptr_t mask) const;
 
-  RawString* target_name() const {
-    return raw_ptr()->target_name_;
-  }
+  RawString* target_name() const { return raw_ptr()->target_name_; }
 
-  RawArray* arguments_descriptor() const {
-    return raw_ptr()->args_descriptor_;
-  }
+  RawArray* arguments_descriptor() const { return raw_ptr()->args_descriptor_; }
 
   intptr_t filled_entry_count() const;
   void set_filled_entry_count(intptr_t num) const;
@@ -5297,7 +5208,7 @@
     kInstanceTypeArguments = 1,
     kInstantiatorTypeArguments = 2,
     kTestResult = 3,
-    kTestEntryLength  = 4,
+    kTestEntryLength = 4,
   };
 
   intptr_t NumberOfChecks() const;
@@ -5322,9 +5233,7 @@
   }
 
  private:
-  RawArray* cache() const {
-    return raw_ptr()->cache_;
-  }
+  RawArray* cache() const { return raw_ptr()->cache_; }
 
   void set_cache(const Array& value) const;
 
@@ -5387,8 +5296,8 @@
                                         bool report_after_token,
                                         Report::Kind kind,
                                         Heap::Space space,
-                                        const char* format, ...)
-    PRINTF_ATTRIBUTE(7, 8);
+                                        const char* format,
+                                        ...) PRINTF_ATTRIBUTE(7, 8);
 
   static RawLanguageError* NewFormattedV(const Error& prev_error,
                                          const Script& script,
@@ -5396,7 +5305,8 @@
                                          bool report_after_token,
                                          Report::Kind kind,
                                          Heap::Space space,
-                                         const char* format, va_list args);
+                                         const char* format,
+                                         va_list args);
 
   static RawLanguageError* New(const String& formatted_message,
                                Report::Kind kind = Report::kError,
@@ -5407,9 +5317,7 @@
   TokenPosition token_pos() const { return raw_ptr()->token_pos_; }
 
  private:
-  RawError* previous_error() const {
-    return raw_ptr()->previous_error_;
-  }
+  RawError* previous_error() const { return raw_ptr()->previous_error_; }
   void set_previous_error(const Error& value) const;
 
   RawScript* script() const { return raw_ptr()->script_; }
@@ -5537,16 +5445,14 @@
   virtual bool CheckIsCanonical(Thread* thread) const;
 #endif  // DEBUG
 
-  RawObject* GetField(const Field& field) const {
-    return *FieldAddr(field);
-  }
+  RawObject* GetField(const Field& field) const { return *FieldAddr(field); }
 
   void SetField(const Field& field, const Object& value) const {
     field.RecordStore(value);
     StorePointer(FieldAddr(field), value.raw());
   }
 
-  RawAbstractType* GetType() const;
+  RawAbstractType* GetType(Heap::Space space) const;
 
   virtual RawTypeArguments* GetTypeArguments() const;
   virtual void SetTypeArguments(const TypeArguments& value) const;
@@ -5564,8 +5470,7 @@
   inline intptr_t GetNativeField(int index) const;
   inline void GetNativeFields(uint16_t num_fields,
                               intptr_t* field_values) const;
-  void SetNativeFields(uint16_t num_fields,
-                       const intptr_t* field_values) const;
+  void SetNativeFields(uint16_t num_fields, const intptr_t* field_values) const;
 
   uint16_t NumNativeFields() const {
     return clazz()->ptr()->num_native_fields_;
@@ -5622,9 +5527,7 @@
   }
   bool IsValidFieldOffset(intptr_t offset) const;
 
-  static intptr_t NextFieldOffset() {
-    return sizeof(RawInstance);
-  }
+  static intptr_t NextFieldOffset() { return sizeof(RawInstance); }
 
   // The follwoing raw methods are used for morphing.
   // They are needed due to the extraction of the class in IsValidFieldOffset.
@@ -5772,8 +5675,8 @@
   // but belonging to the new owner class.
   // Apply recursively to type arguments, i.e. instantiated type arguments of
   // an uninstantiated type are not cloned, but shared.
-  virtual RawAbstractType* CloneUninstantiated(
-      const Class& new_owner, TrailPtr trail = NULL) const;
+  virtual RawAbstractType* CloneUninstantiated(const Class& new_owner,
+                                               TrailPtr trail = NULL) const;
 
   virtual RawInstance* CheckAndCanonicalize(Thread* thread,
                                             const char** error_str) const {
@@ -5811,9 +5714,7 @@
   bool TestAndAddBuddyToTrail(TrailPtr* trail, const AbstractType& buddy) const;
 
   // The name of this type, including the names of its type arguments, if any.
-  virtual RawString* Name() const {
-    return BuildName(kInternalName);
-  }
+  virtual RawString* Name() const { return BuildName(kInternalName); }
 
   // The name of this type, including the names of its type arguments, if any.
   // Names of internal classes are mapped to their public interfaces.
@@ -5842,9 +5743,8 @@
   bool IsNullType() const;
 
   bool IsObjectType() const {
-    return !IsFunctionType() &&
-        HasResolvedTypeClass() &&
-        Class::Handle(type_class()).IsObjectClass();
+    return !IsFunctionType() && HasResolvedTypeClass() &&
+           Class::Handle(type_class()).IsObjectClass();
   }
 
   // Check if this type represents the 'bool' type.
@@ -5893,8 +5793,8 @@
                           Error* bound_error,
                           TrailPtr bound_trail,
                           Heap::Space space) const {
-    return TypeTest(kIsMoreSpecificThan, other,
-                    bound_error, bound_trail, space);
+    return TypeTest(kIsMoreSpecificThan, other, bound_error, bound_trail,
+                    space);
   }
 
  private:
@@ -5930,9 +5830,8 @@
     return OFFSET_OF(RawType, type_class_id_);
   }
   virtual bool IsFinalized() const {
-    return
-        (raw_ptr()->type_state_ == RawType::kFinalizedInstantiated) ||
-        (raw_ptr()->type_state_ == RawType::kFinalizedUninstantiated);
+    return (raw_ptr()->type_state_ == RawType::kFinalizedInstantiated) ||
+           (raw_ptr()->type_state_ == RawType::kFinalizedUninstantiated);
   }
   virtual void SetIsFinalized() const;
   void ResetIsFinalized() const;  // Ignore current state and set again.
@@ -5974,9 +5873,8 @@
       TrailPtr bound_trail,
       Heap::Space space) const;
   virtual RawAbstractType* CloneUnfinalized() const;
-  virtual RawAbstractType* CloneUninstantiated(
-      const Class& new_owner,
-      TrailPtr trail = NULL) const;
+  virtual RawAbstractType* CloneUninstantiated(const Class& new_owner,
+                                               TrailPtr trail = NULL) const;
   virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const;
 #if defined(DEBUG)
   // Check if type is canonical.
@@ -6097,8 +5995,7 @@
     return AbstractType::Handle(type()).token_pos();
   }
   virtual bool IsInstantiated(TrailPtr trail = NULL) const;
-  virtual bool IsEquivalent(const Instance& other,
-                            TrailPtr trail = NULL) const;
+  virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const;
   virtual bool IsRecursive() const { return true; }
   virtual RawTypeRef* InstantiateFrom(
       const TypeArguments& instantiator_type_arguments,
@@ -6106,9 +6003,8 @@
       TrailPtr instantiation_trail,
       TrailPtr bound_trail,
       Heap::Space space) const;
-  virtual RawTypeRef* CloneUninstantiated(
-      const Class& new_owner,
-      TrailPtr trail = NULL) const;
+  virtual RawTypeRef* CloneUninstantiated(const Class& new_owner,
+                                          TrailPtr trail = NULL) const;
   virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const;
 #if defined(DEBUG)
   // Check if typeref is canonical.
@@ -6182,9 +6078,7 @@
                   TrailPtr bound_trail,
                   Heap::Space space) const;
   virtual TokenPosition token_pos() const { return raw_ptr()->token_pos_; }
-  virtual bool IsInstantiated(TrailPtr trail = NULL) const {
-    return false;
-  }
+  virtual bool IsInstantiated(TrailPtr trail = NULL) const { return false; }
   virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const;
   virtual bool IsRecursive() const { return false; }
   virtual RawAbstractType* InstantiateFrom(
@@ -6194,16 +6088,14 @@
       TrailPtr bound_trail,
       Heap::Space space) const;
   virtual RawAbstractType* CloneUnfinalized() const;
-  virtual RawAbstractType* CloneUninstantiated(
-      const Class& new_owner, TrailPtr trail = NULL) const;
+  virtual RawAbstractType* CloneUninstantiated(const Class& new_owner,
+                                               TrailPtr trail = NULL) const;
   virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const {
     return raw();
   }
 #if defined(DEBUG)
   // Check if type parameter is canonical.
-  virtual bool CheckIsCanonical(Thread* thread) const {
-    return true;
-  }
+  virtual bool CheckIsCanonical(Thread* thread) const { return true; }
 #endif  // DEBUG
   virtual RawString* EnumerateURIs() const;
 
@@ -6294,16 +6186,14 @@
       TrailPtr bound_trail,
       Heap::Space space) const;
   virtual RawAbstractType* CloneUnfinalized() const;
-  virtual RawAbstractType* CloneUninstantiated(
-      const Class& new_owner, TrailPtr trail = NULL) const;
+  virtual RawAbstractType* CloneUninstantiated(const Class& new_owner,
+                                               TrailPtr trail = NULL) const;
   virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const {
     return raw();
   }
 #if defined(DEBUG)
   // Check if bounded type is canonical.
-  virtual bool CheckIsCanonical(Thread* thread) const {
-    return true;
-  }
+  virtual bool CheckIsCanonical(Thread* thread) const { return true; }
 #endif  // DEBUG
   virtual RawString* EnumerateURIs() const;
 
@@ -6435,9 +6325,7 @@
 
   virtual double AsDoubleValue() const;
   virtual int64_t AsInt64Value() const;
-  virtual int64_t AsTruncatedInt64Value() const {
-    return AsInt64Value();
-  }
+  virtual int64_t AsTruncatedInt64Value() const { return AsInt64Value(); }
   virtual uint32_t AsTruncatedUint32Value() const;
 
   virtual bool FitsIntoSmi() const;
@@ -6468,9 +6356,7 @@
   static const intptr_t kMaxValue = kSmiMax;
   static const intptr_t kMinValue = kSmiMin;
 
-  intptr_t Value() const {
-    return ValueFromRaw(raw_value());
-  }
+  intptr_t Value() const { return ValueFromRaw(raw_value()); }
 
   virtual bool Equals(const Instance& other) const;
   virtual bool IsZero() const { return Value() == 0; }
@@ -6557,17 +6443,11 @@
   static const int64_t kMinValue =
       static_cast<int64_t>(DART_2PART_UINT64_C(0x80000000, 00000000));
 
-  int64_t value() const {
-    return raw_ptr()->value_;
-  }
+  int64_t value() const { return raw_ptr()->value_; }
   static intptr_t value_offset() { return OFFSET_OF(RawMint, value_); }
 
-  virtual bool IsZero() const {
-    return value() == 0;
-  }
-  virtual bool IsNegative() const {
-    return value() < 0;
-  }
+  virtual bool IsZero() const { return value() == 0; }
+  virtual bool IsNegative() const { return value() < 0; }
 
   virtual bool Equals(const Instance& other) const;
 
@@ -6602,7 +6482,7 @@
 
 class Bigint : public Integer {
  public:
-  virtual bool IsZero() const { return Used() == 0;}
+  virtual bool IsZero() const { return Used() == 0; }
   virtual bool IsNegative() const { return Neg(); }
   virtual bool Equals(const Instance& other) const;
 
@@ -6640,8 +6520,8 @@
   intptr_t Used() const;
   uint32_t DigitAt(intptr_t index) const;
 
-  const char* ToDecCString(uword (*allocator)(intptr_t size)) const;
-  const char* ToHexCString(uword (*allocator)(intptr_t size)) const;
+  const char* ToDecCString(Zone* zone) const;
+  const char* ToHexCString(Zone* zone) const;
 
   static const intptr_t kBitsPerDigit = 32;  // Same as _Bigint._DIGIT_BITS
   static const intptr_t kBytesPerDigit = 4;
@@ -6650,20 +6530,22 @@
 
   static RawBigint* New(Heap::Space space = Heap::kNew);  // For snapshots.
 
-  static RawBigint* New(bool neg, intptr_t used, const TypedData& digits,
+  static RawBigint* New(bool neg,
+                        intptr_t used,
+                        const TypedData& digits,
                         Heap::Space space = Heap::kNew);
 
-  static RawBigint* NewFromInt64(int64_t value,
-                                  Heap::Space space = Heap::kNew);
+  static RawBigint* NewFromInt64(int64_t value, Heap::Space space = Heap::kNew);
 
   static RawBigint* NewFromUint64(uint64_t value,
-                                   Heap::Space space = Heap::kNew);
+                                  Heap::Space space = Heap::kNew);
 
-  static RawBigint* NewFromShiftedInt64(int64_t value, intptr_t shift,
-                                         Heap::Space space = Heap::kNew);
+  static RawBigint* NewFromShiftedInt64(int64_t value,
+                                        intptr_t shift,
+                                        Heap::Space space = Heap::kNew);
 
   static RawBigint* NewFromCString(const char* str,
-                                    Heap::Space space = Heap::kNew);
+                                   Heap::Space space = Heap::kNew);
 
   // Returns a canonical Bigint object allocated in the old gen space.
   static RawBigint* NewCanonical(const String& str);
@@ -6681,10 +6563,12 @@
                          intptr_t index,
                          uint32_t value);
 
-  static RawTypedData* NewDigitsFromHexCString(const char* str, intptr_t* used,
+  static RawTypedData* NewDigitsFromHexCString(const char* str,
+                                               intptr_t* used,
                                                Heap::Space space = Heap::kNew);
 
-  static RawTypedData* NewDigitsFromDecCString(const char* str, intptr_t* used,
+  static RawTypedData* NewDigitsFromDecCString(const char* str,
+                                               intptr_t* used,
                                                Heap::Space space = Heap::kNew);
 
   static RawBigint* Allocate(intptr_t length, Heap::Space space = Heap::kNew);
@@ -6698,9 +6582,7 @@
 // abstract class double in corelib.
 class Double : public Number {
  public:
-  double value() const {
-    return raw_ptr()->value_;
-  }
+  double value() const { return raw_ptr()->value_; }
 
   bool BitwiseEqualsToDouble(double value) const;
   virtual bool OperatorEquals(const Instance& other) const;
@@ -6758,18 +6640,12 @@
   class CodePointIterator : public ValueObject {
    public:
     explicit CodePointIterator(const String& str)
-        : str_(str),
-          ch_(0),
-          index_(-1),
-          end_(str.Length()) {
+        : str_(str), ch_(0), index_(-1), end_(str.Length()) {
       ASSERT(!str_.IsNull());
     }
 
     CodePointIterator(const String& str, intptr_t start, intptr_t length)
-        : str_(str),
-          ch_(0),
-          index_(start - 1),
-          end_(start + length) {
+        : str_(str), ch_(0), index_(start - 1), end_(start + length) {
       ASSERT(start >= 0);
       ASSERT(end_ <= str.Length());
     }
@@ -6835,7 +6711,7 @@
 
   bool Equals(const String& str,
               intptr_t begin_index,  // begin index on 'str'.
-              intptr_t len) const;  // len on 'str'.
+              intptr_t len) const;   // len on 'str'.
 
   // Compares to a '\0' terminated array of UTF-8 encoded characters.
   bool Equals(const char* cstr) const;
@@ -7017,14 +6893,14 @@
   static RawString* ScrubName(const String& name);
   static RawString* ScrubNameRetainPrivate(const String& name);
 
-  static bool EqualsIgnoringPrivateKey(const String& str1,
-                                       const String& str2);
+  static bool EqualsIgnoringPrivateKey(const String& str1, const String& str2);
 
   static RawString* NewFormatted(const char* format, ...)
       PRINTF_ATTRIBUTE(1, 2);
   static RawString* NewFormatted(Heap::Space space, const char* format, ...)
       PRINTF_ATTRIBUTE(2, 3);
-  static RawString* NewFormattedV(const char* format, va_list args,
+  static RawString* NewFormattedV(const char* format,
+                                  va_list args,
                                   Heap::Space space = Heap::kNew);
 
   static bool ParseDouble(const String& str,
@@ -7051,7 +6927,7 @@
     StoreSmi(&raw_ptr()->hash_, Smi::New(value));
   }
 
-  template<typename HandleType, typename ElementType, typename CallbackType>
+  template <typename HandleType, typename ElementType, typename CallbackType>
   static void ReadFromImpl(SnapshotReader* reader,
                            String* str_obj,
                            intptr_t len,
@@ -7064,7 +6940,8 @@
   friend class Class;
   friend class Symbols;
   friend class StringSlice;  // SetHash
-  template<typename CharType> friend class CharArray;  // SetHash
+  template <typename CharType>
+  friend class CharArray;     // SetHash
   friend class ConcatString;  // SetHash
   friend class OneByteString;
   friend class TwoByteString;
@@ -7107,16 +6984,14 @@
   static intptr_t InstanceSize(intptr_t len) {
     ASSERT(sizeof(RawOneByteString) == String::kSizeofRawString);
     ASSERT(0 <= len && len <= kMaxElements);
-    return String::RoundedAllocationSize(
-        sizeof(RawOneByteString) + (len * kBytesPerElement));
+    return String::RoundedAllocationSize(sizeof(RawOneByteString) +
+                                         (len * kBytesPerElement));
   }
 
-  static RawOneByteString* New(intptr_t len,
-                               Heap::Space space);
+  static RawOneByteString* New(intptr_t len, Heap::Space space);
   static RawOneByteString* New(const char* c_string,
                                Heap::Space space = Heap::kNew) {
-    return New(reinterpret_cast<const uint8_t*>(c_string),
-               strlen(c_string),
+    return New(reinterpret_cast<const uint8_t*>(c_string), strlen(c_string),
                space);
   }
   static RawOneByteString* New(const uint8_t* characters,
@@ -7128,8 +7003,7 @@
   static RawOneByteString* New(const int32_t* characters,
                                intptr_t len,
                                Heap::Space space);
-  static RawOneByteString* New(const String& str,
-                               Heap::Space space);
+  static RawOneByteString* New(const String& str, Heap::Space space);
   // 'other' must be OneByteString.
   static RawOneByteString* New(const String& other_one_byte_string,
                                intptr_t other_start_index,
@@ -7243,12 +7117,11 @@
   static intptr_t InstanceSize(intptr_t len) {
     ASSERT(sizeof(RawTwoByteString) == String::kSizeofRawString);
     ASSERT(0 <= len && len <= kMaxElements);
-    return String::RoundedAllocationSize(
-        sizeof(RawTwoByteString) + (len * kBytesPerElement));
+    return String::RoundedAllocationSize(sizeof(RawTwoByteString) +
+                                         (len * kBytesPerElement));
   }
 
-  static RawTwoByteString* New(intptr_t len,
-                               Heap::Space space);
+  static RawTwoByteString* New(intptr_t len, Heap::Space space);
   static RawTwoByteString* New(const uint16_t* characters,
                                intptr_t len,
                                Heap::Space space);
@@ -7256,8 +7129,7 @@
                                const int32_t* characters,
                                intptr_t len,
                                Heap::Space space);
-  static RawTwoByteString* New(const String& str,
-                               Heap::Space space);
+  static RawTwoByteString* New(const String& str, Heap::Space space);
 
   static RawTwoByteString* New(const TypedData& other_typed_data,
                                intptr_t other_start_index,
@@ -7493,21 +7365,15 @@
 // Class Bool implements Dart core class bool.
 class Bool : public Instance {
  public:
-  bool value() const {
-    return raw_ptr()->value_;
-  }
+  bool value() const { return raw_ptr()->value_; }
 
   static intptr_t InstanceSize() {
     return RoundedAllocationSize(sizeof(RawBool));
   }
 
-  static const Bool& True() {
-    return Object::bool_true();
-  }
+  static const Bool& True() { return Object::bool_true(); }
 
-  static const Bool& False() {
-    return Object::bool_false();
-  }
+  static const Bool& False() { return Object::bool_false(); }
 
   static const Bool& Get(bool value) {
     return value ? Bool::True() : Bool::False();
@@ -7546,17 +7412,13 @@
     return OFFSET_OF_RETURNED_VALUE(RawArray, data) + kWordSize * index;
   }
 
-  RawObject* At(intptr_t index) const {
-    return *ObjectAddr(index);
-  }
+  RawObject* At(intptr_t index) const { return *ObjectAddr(index); }
   void SetAt(intptr_t index, const Object& value) const {
     // TODO(iposva): Add storing NoSafepointScope.
     StorePointer(ObjectAddr(index), value.raw());
   }
 
-  bool IsImmutable() const {
-    return raw()->GetClassId() == kImmutableArrayCid;
-  }
+  bool IsImmutable() const { return raw()->GetClassId() == kImmutableArrayCid; }
 
   virtual RawTypeArguments* GetTypeArguments() const {
     return raw_ptr()->type_arguments_;
@@ -7664,9 +7526,7 @@
 
   static const ClassId kClassId = kImmutableArrayCid;
 
-  static intptr_t InstanceSize() {
-    return Array::InstanceSize();
-  }
+  static intptr_t InstanceSize() { return Array::InstanceSize(); }
 
   static intptr_t InstanceSize(intptr_t len) {
     return Array::InstanceSize(len);
@@ -7734,10 +7594,8 @@
     // A GrowableObjectArray is raw or takes one type argument. However, its
     // type argument vector may be longer than 1 due to a type optimization
     // reusing the type argument vector of the instantiator.
-    ASSERT(value.IsNull() ||
-           ((value.Length() >= 1) &&
-            value.IsInstantiated() &&
-            value.IsCanonical()));
+    ASSERT(value.IsNull() || ((value.Length() >= 1) && value.IsInstantiated() &&
+                              value.IsCanonical()));
     const Array& contents = Array::Handle(data());
     contents.SetTypeArguments(value);
     StorePointer(&raw_ptr()->type_arguments_, value.raw());
@@ -7800,8 +7658,11 @@
 
 class Float32x4 : public Instance {
  public:
-  static RawFloat32x4* New(float value0, float value1, float value2,
-                           float value3, Heap::Space space = Heap::kNew);
+  static RawFloat32x4* New(float value0,
+                           float value1,
+                           float value2,
+                           float value3,
+                           Heap::Space space = Heap::kNew);
   static RawFloat32x4* New(simd128_value_t value,
                            Heap::Space space = Heap::kNew);
 
@@ -7822,9 +7683,7 @@
     return RoundedAllocationSize(sizeof(RawFloat32x4));
   }
 
-  static intptr_t value_offset() {
-    return OFFSET_OF(RawFloat32x4, value_);
-  }
+  static intptr_t value_offset() { return OFFSET_OF(RawFloat32x4, value_); }
 
  private:
   FINAL_HEAP_OBJECT_IMPLEMENTATION(Float32x4, Instance);
@@ -7834,10 +7693,12 @@
 
 class Int32x4 : public Instance {
  public:
-  static RawInt32x4* New(int32_t value0, int32_t value1, int32_t value2,
-                          int32_t value3, Heap::Space space = Heap::kNew);
-  static RawInt32x4* New(simd128_value_t value,
-                          Heap::Space space = Heap::kNew);
+  static RawInt32x4* New(int32_t value0,
+                         int32_t value1,
+                         int32_t value2,
+                         int32_t value3,
+                         Heap::Space space = Heap::kNew);
+  static RawInt32x4* New(simd128_value_t value, Heap::Space space = Heap::kNew);
 
   int32_t x() const;
   int32_t y() const;
@@ -7856,9 +7717,7 @@
     return RoundedAllocationSize(sizeof(RawInt32x4));
   }
 
-  static intptr_t value_offset() {
-    return OFFSET_OF(RawInt32x4, value_);
-  }
+  static intptr_t value_offset() { return OFFSET_OF(RawInt32x4, value_); }
 
  private:
   FINAL_HEAP_OBJECT_IMPLEMENTATION(Int32x4, Instance);
@@ -7868,7 +7727,8 @@
 
 class Float64x2 : public Instance {
  public:
-  static RawFloat64x2* New(double value0, double value1,
+  static RawFloat64x2* New(double value0,
+                           double value1,
                            Heap::Space space = Heap::kNew);
   static RawFloat64x2* New(simd128_value_t value,
                            Heap::Space space = Heap::kNew);
@@ -7886,9 +7746,7 @@
     return RoundedAllocationSize(sizeof(RawFloat64x2));
   }
 
-  static intptr_t value_offset() {
-    return OFFSET_OF(RawFloat64x2, value_);
-  }
+  static intptr_t value_offset() { return OFFSET_OF(RawFloat64x2, value_); }
 
  private:
   FINAL_HEAP_OBJECT_IMPLEMENTATION(Float64x2, Instance);
@@ -7926,13 +7784,14 @@
   void* DataAddr(intptr_t byte_offset) const {
     ASSERT((byte_offset == 0) ||
            ((byte_offset > 0) && (byte_offset < LengthInBytes())));
-    return reinterpret_cast<void*>(
-        UnsafeMutableNonPointer(raw_ptr()->data()) + byte_offset);
+    return reinterpret_cast<void*>(UnsafeMutableNonPointer(raw_ptr()->data()) +
+                                   byte_offset);
   }
 
   virtual bool CanonicalizeEquals(const Instance& other) const;
   virtual uword ComputeCanonicalTableHash() const;
 
+#if defined(HOST_ARCH_IA32) || defined(HOST_ARCH_X64)
 #define TYPED_GETTER_SETTER(name, type)                                        \
   type Get##name(intptr_t byte_offset) const {                                 \
     NoSafepointScope no_safepoint;                                             \
@@ -7942,6 +7801,20 @@
     NoSafepointScope no_safepoint;                                             \
     *reinterpret_cast<type*>(DataAddr(byte_offset)) = value;                   \
   }
+#else  // defined(HOST_ARCH_IA32) || defined(HOST_ARCH_X64)
+#define TYPED_GETTER_SETTER(name, type)                                        \
+  type Get##name(intptr_t byte_offset) const {                                 \
+    NoSafepointScope no_safepoint;                                             \
+    type result;                                                               \
+    memmove(&result, DataAddr(byte_offset), sizeof(type));                     \
+    return result;                                                             \
+  }                                                                            \
+  void Set##name(intptr_t byte_offset, type value) const {                     \
+    NoSafepointScope no_safepoint;                                             \
+    memmove(DataAddr(byte_offset), &value, sizeof(type));                      \
+  }
+#endif  // defined(HOST_ARCH_IA32) || defined(HOST_ARCH_X64)
+
   TYPED_GETTER_SETTER(Int8, int8_t)
   TYPED_GETTER_SETTER(Uint8, uint8_t)
   TYPED_GETTER_SETTER(Int16, int16_t)
@@ -7958,9 +7831,7 @@
 
 #undef TYPED_GETTER_SETTER
 
-  static intptr_t length_offset() {
-    return OFFSET_OF(RawTypedData, length_);
-  }
+  static intptr_t length_offset() { return OFFSET_OF(RawTypedData, length_); }
 
   static intptr_t data_offset() {
     return OFFSET_OF_RETURNED_VALUE(RawTypedData, data);
@@ -7984,8 +7855,7 @@
 
   static TypedDataElementType ElementType(intptr_t class_id) {
     ASSERT(RawObject::IsTypedDataClassId(class_id));
-    return static_cast<TypedDataElementType>(
-        class_id - kTypedDataInt8ArrayCid);
+    return static_cast<TypedDataElementType>(class_id - kTypedDataInt8ArrayCid);
   }
 
   static intptr_t MaxElements(intptr_t class_id) {
@@ -7998,35 +7868,34 @@
                            Heap::Space space = Heap::kNew);
 
   template <typename DstType, typename SrcType>
-  static void Copy(const DstType& dst, intptr_t dst_offset_in_bytes,
-                   const SrcType& src, intptr_t src_offset_in_bytes,
+  static void Copy(const DstType& dst,
+                   intptr_t dst_offset_in_bytes,
+                   const SrcType& src,
+                   intptr_t src_offset_in_bytes,
                    intptr_t length_in_bytes) {
-    ASSERT(Utils::RangeCheck(src_offset_in_bytes,
-                             length_in_bytes,
+    ASSERT(Utils::RangeCheck(src_offset_in_bytes, length_in_bytes,
                              src.LengthInBytes()));
-    ASSERT(Utils::RangeCheck(dst_offset_in_bytes,
-                             length_in_bytes,
+    ASSERT(Utils::RangeCheck(dst_offset_in_bytes, length_in_bytes,
                              dst.LengthInBytes()));
     {
       NoSafepointScope no_safepoint;
       if (length_in_bytes > 0) {
         memmove(dst.DataAddr(dst_offset_in_bytes),
-                src.DataAddr(src_offset_in_bytes),
-                length_in_bytes);
+                src.DataAddr(src_offset_in_bytes), length_in_bytes);
       }
     }
   }
 
 
   template <typename DstType, typename SrcType>
-  static void ClampedCopy(const DstType& dst, intptr_t dst_offset_in_bytes,
-                          const SrcType& src, intptr_t src_offset_in_bytes,
+  static void ClampedCopy(const DstType& dst,
+                          intptr_t dst_offset_in_bytes,
+                          const SrcType& src,
+                          intptr_t src_offset_in_bytes,
                           intptr_t length_in_bytes) {
-    ASSERT(Utils::RangeCheck(src_offset_in_bytes,
-                             length_in_bytes,
+    ASSERT(Utils::RangeCheck(src_offset_in_bytes, length_in_bytes,
                              src.LengthInBytes()));
-    ASSERT(Utils::RangeCheck(dst_offset_in_bytes,
-                             length_in_bytes,
+    ASSERT(Utils::RangeCheck(dst_offset_in_bytes, length_in_bytes,
                              dst.LengthInBytes()));
     {
       NoSafepointScope no_safepoint;
@@ -8152,8 +8021,8 @@
 
   static TypedDataElementType ElementType(intptr_t class_id) {
     ASSERT(RawObject::IsExternalTypedDataClassId(class_id));
-    return static_cast<TypedDataElementType>(
-        class_id - kExternalTypedDataInt8ArrayCid);
+    return static_cast<TypedDataElementType>(class_id -
+                                             kExternalTypedDataInt8ArrayCid);
   }
 
   static intptr_t MaxElements(intptr_t class_id) {
@@ -8178,8 +8047,8 @@
   }
 
   void SetData(uint8_t* data) const {
-    ASSERT(!Isolate::Current()->heap()->Contains(
-        reinterpret_cast<uword>(data)));
+    ASSERT(
+        !Isolate::Current()->heap()->Contains(reinterpret_cast<uword>(data)));
     StoreNonPointer(&raw_ptr()->data_, data);
   }
 
@@ -8199,20 +8068,20 @@
 
   static RawInstance* Data(const Instance& view_obj) {
     ASSERT(!view_obj.IsNull());
-    return *reinterpret_cast<RawInstance* const*>(
-        view_obj.raw_ptr() + kDataOffset);
+    return *reinterpret_cast<RawInstance* const*>(view_obj.raw_ptr() +
+                                                  kDataOffset);
   }
 
   static RawSmi* OffsetInBytes(const Instance& view_obj) {
     ASSERT(!view_obj.IsNull());
-    return *reinterpret_cast<RawSmi* const*>(
-        view_obj.raw_ptr() + kOffsetInBytesOffset);
+    return *reinterpret_cast<RawSmi* const*>(view_obj.raw_ptr() +
+                                             kOffsetInBytesOffset);
   }
 
   static RawSmi* Length(const Instance& view_obj) {
     ASSERT(!view_obj.IsNull());
-    return *reinterpret_cast<RawSmi* const*>(
-        view_obj.raw_ptr() + kLengthOffset);
+    return *reinterpret_cast<RawSmi* const*>(view_obj.raw_ptr() +
+                                             kLengthOffset);
   }
 
   static bool IsExternalTypedDataView(const Instance& view_obj) {
@@ -8223,26 +8092,21 @@
     return RawObject::IsExternalTypedDataClassId(cid);
   }
 
-  static intptr_t NumberOfFields() {
-    return kLengthOffset;
-  }
+  static intptr_t NumberOfFields() { return kLengthOffset; }
 
-  static intptr_t data_offset() {
-    return kWordSize * kDataOffset;
-  }
+  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 length_offset() { return kWordSize * kLengthOffset; }
 
   static intptr_t ElementSizeInBytes(intptr_t class_id) {
     ASSERT(RawObject::IsTypedDataViewClassId(class_id));
-    return (class_id == kByteDataViewCid) ?
-        1 : TypedData::element_size(class_id - kTypedDataInt8ArrayViewCid);
+    return (class_id == kByteDataViewCid)
+               ? 1
+               : TypedData::element_size(class_id - kTypedDataInt8ArrayViewCid);
   }
 
  private:
@@ -8258,17 +8122,13 @@
  public:
   static RawInstance* Data(const Instance& view_obj) {
     ASSERT(!view_obj.IsNull());
-    return *reinterpret_cast<RawInstance* const*>(
-        view_obj.raw_ptr() + kDataOffset);
+    return *reinterpret_cast<RawInstance* const*>(view_obj.raw_ptr() +
+                                                  kDataOffset);
   }
 
-  static intptr_t NumberOfFields() {
-    return kDataOffset;
-  }
+  static intptr_t NumberOfFields() { return kDataOffset; }
 
-  static intptr_t data_offset() {
-    return kWordSize * kDataOffset;
-  }
+  static intptr_t data_offset() { return kWordSize * kDataOffset; }
 
  private:
   enum {
@@ -8311,29 +8171,19 @@
     return OFFSET_OF(RawLinkedHashMap, type_arguments_);
   }
 
-  RawTypedData* index() const {
-    return raw_ptr()->index_;
-  }
+  RawTypedData* index() const { return raw_ptr()->index_; }
   void SetIndex(const TypedData& value) const {
     StorePointer(&raw_ptr()->index_, value.raw());
   }
-  static intptr_t index_offset() {
-    return OFFSET_OF(RawLinkedHashMap, index_);
-  }
+  static intptr_t index_offset() { return OFFSET_OF(RawLinkedHashMap, index_); }
 
-  RawArray* data() const {
-    return raw_ptr()->data_;
-  }
+  RawArray* data() const { return raw_ptr()->data_; }
   void SetData(const Array& value) const {
     StorePointer(&raw_ptr()->data_, value.raw());
   }
-  static intptr_t data_offset() {
-    return OFFSET_OF(RawLinkedHashMap, data_);
-  }
+  static intptr_t data_offset() { return OFFSET_OF(RawLinkedHashMap, data_); }
 
-  RawSmi* hash_mask() const {
-    return raw_ptr()->hash_mask_;
-  }
+  RawSmi* hash_mask() const { return raw_ptr()->hash_mask_; }
   void SetHashMask(intptr_t value) const {
     StoreSmi(&raw_ptr()->hash_mask_, Smi::New(value));
   }
@@ -8341,9 +8191,7 @@
     return OFFSET_OF(RawLinkedHashMap, hash_mask_);
   }
 
-  RawSmi* used_data() const {
-    return raw_ptr()->used_data_;
-  }
+  RawSmi* used_data() const { return raw_ptr()->used_data_; }
   void SetUsedData(intptr_t value) const {
     StoreSmi(&raw_ptr()->used_data_, Smi::New(value));
   }
@@ -8351,9 +8199,7 @@
     return OFFSET_OF(RawLinkedHashMap, used_data_);
   }
 
-  RawSmi* deleted_keys() const {
-    return raw_ptr()->deleted_keys_;
-  }
+  RawSmi* deleted_keys() const { return raw_ptr()->deleted_keys_; }
   void SetDeletedKeys(intptr_t value) const {
     StoreSmi(&raw_ptr()->deleted_keys_, Smi::New(value));
   }
@@ -8362,6 +8208,10 @@
   }
 
   intptr_t Length() const {
+    // The map may be uninitialized.
+    if (raw_ptr()->used_data_ == Object::null()) return 0;
+    if (raw_ptr()->deleted_keys_ == Object::null()) return 0;
+
     intptr_t used = Smi::Value(raw_ptr()->used_data_);
     intptr_t deleted = Smi::Value(raw_ptr()->deleted_keys_);
     return (used >> 1) - deleted;
@@ -8375,10 +8225,10 @@
   class Iterator : ValueObject {
    public:
     explicit Iterator(const LinkedHashMap& map)
-      : data_(Array::Handle(map.data())),
-        scratch_(Object::Handle()),
-        offset_(-2),
-        length_(Smi::Value(map.used_data())) {}
+        : data_(Array::Handle(map.data())),
+          scratch_(Object::Handle()),
+          offset_(-2),
+          length_(Smi::Value(map.used_data())) {}
 
     bool MoveNext() {
       while (true) {
@@ -8394,13 +8244,9 @@
       }
     }
 
-    RawObject* CurrentKey() const {
-      return data_.At(offset_);
-    }
+    RawObject* CurrentKey() const { return data_.At(offset_); }
 
-    RawObject* CurrentValue() const {
-      return data_.At(offset_ + 1);
-    }
+    RawObject* CurrentValue() const { return data_.At(offset_ + 1); }
 
    private:
     const Array& data_;
@@ -8517,8 +8363,7 @@
   static intptr_t InstanceSize() {
     return RoundedAllocationSize(sizeof(RawSendPort));
   }
-  static RawSendPort* New(Dart_Port id,
-                          Heap::Space space = Heap::kNew);
+  static RawSendPort* New(Dart_Port id, Heap::Space space = Heap::kNew);
   static RawSendPort* New(Dart_Port id,
                           Dart_Port origin_id,
                           Heap::Space space = Heap::kNew);
@@ -8614,39 +8459,59 @@
     return raw_ptr()->num_bracket_expressions_;
   }
 
-  RawTypedData* bytecode(bool is_one_byte) const {
-    return is_one_byte ? raw_ptr()->one_byte_bytecode_
-                       : raw_ptr()->two_byte_bytecode_;
+  RawTypedData* bytecode(bool is_one_byte, bool sticky) const {
+    if (sticky) {
+      return is_one_byte ? raw_ptr()->one_byte_sticky_.bytecode_
+                         : raw_ptr()->two_byte_sticky_.bytecode_;
+    } else {
+      return is_one_byte ? raw_ptr()->one_byte_.bytecode_
+                         : raw_ptr()->two_byte_.bytecode_;
+    }
   }
 
-  static intptr_t function_offset(intptr_t cid) {
-    switch (cid) {
-      case kOneByteStringCid:
-        return OFFSET_OF(RawRegExp, one_byte_function_);
-      case kTwoByteStringCid:
-        return OFFSET_OF(RawRegExp, two_byte_function_);
-      case kExternalOneByteStringCid:
-         return OFFSET_OF(RawRegExp, external_one_byte_function_);
-      case kExternalTwoByteStringCid:
-        return OFFSET_OF(RawRegExp, external_two_byte_function_);
+  static intptr_t function_offset(intptr_t cid, bool sticky) {
+    if (sticky) {
+      switch (cid) {
+        case kOneByteStringCid:
+          return OFFSET_OF(RawRegExp, one_byte_sticky_.function_);
+        case kTwoByteStringCid:
+          return OFFSET_OF(RawRegExp, two_byte_sticky_.function_);
+        case kExternalOneByteStringCid:
+          return OFFSET_OF(RawRegExp, external_one_byte_sticky_function_);
+        case kExternalTwoByteStringCid:
+          return OFFSET_OF(RawRegExp, external_two_byte_sticky_function_);
+      }
+    } else {
+      switch (cid) {
+        case kOneByteStringCid:
+          return OFFSET_OF(RawRegExp, one_byte_.function_);
+        case kTwoByteStringCid:
+          return OFFSET_OF(RawRegExp, two_byte_.function_);
+        case kExternalOneByteStringCid:
+          return OFFSET_OF(RawRegExp, external_one_byte_function_);
+        case kExternalTwoByteStringCid:
+          return OFFSET_OF(RawRegExp, external_two_byte_function_);
+      }
     }
 
     UNREACHABLE();
     return -1;
   }
 
-  RawFunction** FunctionAddr(intptr_t cid) const {
+  RawFunction** FunctionAddr(intptr_t cid, bool sticky) const {
     return reinterpret_cast<RawFunction**>(
-          FieldAddrAtOffset(function_offset(cid)));
+        FieldAddrAtOffset(function_offset(cid, sticky)));
   }
 
-  RawFunction* function(intptr_t cid) const {
-    return *FunctionAddr(cid);
+  RawFunction* function(intptr_t cid, bool sticky) const {
+    return *FunctionAddr(cid, sticky);
   }
 
   void set_pattern(const String& pattern) const;
-  void set_function(intptr_t cid, const Function& value) const;
-  void set_bytecode(bool is_one_byte, const TypedData& bytecode) const;
+  void set_function(intptr_t cid, bool sticky, const Function& value) const;
+  void set_bytecode(bool is_one_byte,
+                    bool sticky,
+                    const TypedData& bytecode) const;
 
   void set_num_bracket_expressions(intptr_t value) const;
   void set_is_global() const { set_flags(flags() | kGlobal); }
@@ -8680,12 +8545,8 @@
                     FlagsBits::update(value, raw_ptr()->type_flags_));
   }
 
-  RegExType type() const {
-    return TypeBits::decode(raw_ptr()->type_flags_);
-  }
-  intptr_t flags() const {
-    return FlagsBits::decode(raw_ptr()->type_flags_);
-  }
+  RegExType type() const { return TypeBits::decode(raw_ptr()->type_flags_); }
+  intptr_t flags() const { return FlagsBits::decode(raw_ptr()->type_flags_); }
 
   FINAL_HEAP_OBJECT_IMPLEMENTATION(RegExp, Instance);
   friend class Class;
@@ -8694,17 +8555,13 @@
 
 class WeakProperty : public Instance {
  public:
-  RawObject* key() const {
-    return raw_ptr()->key_;
-  }
+  RawObject* key() const { return raw_ptr()->key_; }
 
   void set_key(const Object& key) const {
     StorePointer(&raw_ptr()->key_, key.raw());
   }
 
-  RawObject* value() const {
-    return raw_ptr()->value_;
-  }
+  RawObject* value() const { return raw_ptr()->value_; }
 
   void set_value(const Object& value) const {
     StorePointer(&raw_ptr()->value_, value.raw());
@@ -8730,9 +8587,7 @@
 
 class MirrorReference : public Instance {
  public:
-  RawObject* referent() const {
-    return raw_ptr()->referent_;
-  }
+  RawObject* referent() const { return raw_ptr()->referent_; }
 
   void set_referent(const Object& referent) const {
     StorePointer(&raw_ptr()->referent_, referent.raw());
@@ -8773,9 +8628,7 @@
   }
   static intptr_t tag_offset() { return OFFSET_OF(RawUserTag, tag_); }
 
-  RawString* label() const {
-    return raw_ptr()->label_;
-  }
+  RawString* label() const { return raw_ptr()->label_; }
 
   void MakeActive() const;
 
@@ -8783,8 +8636,7 @@
     return RoundedAllocationSize(sizeof(RawUserTag));
   }
 
-  static RawUserTag* New(const String& label,
-                         Heap::Space space = Heap::kOld);
+  static RawUserTag* New(const String& label, Heap::Space space = Heap::kOld);
   static RawUserTag* DefaultTag();
 
   static bool TagTableIsFull(Thread* thread);
@@ -9020,4 +8872,4 @@
 
 }  // namespace dart
 
-#endif  // VM_OBJECT_H_
+#endif  // RUNTIME_VM_OBJECT_H_
diff --git a/runtime/vm/object_graph.cc b/runtime/vm/object_graph.cc
index b5a5cac..2352bd88 100644
--- a/runtime/vm/object_graph.cc
+++ b/runtime/vm/object_graph.cc
@@ -8,6 +8,7 @@
 #include "vm/growable_array.h"
 #include "vm/isolate.h"
 #include "vm/object.h"
+#include "vm/object_store.h"
 #include "vm/raw_object.h"
 #include "vm/reusable_handles.h"
 #include "vm/visitor.h"
@@ -25,7 +26,7 @@
 class ObjectGraph::Stack : public ObjectPointerVisitor {
  public:
   explicit Stack(Isolate* isolate)
-      : ObjectPointerVisitor(isolate), data_(kInitialCapacity) { }
+      : ObjectPointerVisitor(isolate), data_(kInitialCapacity) {}
 
   // Marks and pushes. Used to initialize this stack with roots.
   virtual void VisitPointers(RawObject** first, RawObject** last) {
@@ -138,7 +139,7 @@
 
 class Unmarker : public ObjectVisitor {
  public:
-  Unmarker() { }
+  Unmarker() {}
 
   void VisitObject(RawObject* obj) {
     if (obj->IsMarked()) {
@@ -156,8 +157,7 @@
 };
 
 
-ObjectGraph::ObjectGraph(Thread* thread)
-    : StackResource(thread) {
+ObjectGraph::ObjectGraph(Thread* thread) : StackResource(thread) {
   // The VM isolate has all its objects pre-marked, so iterating over it
   // would be a no-op.
   ASSERT(thread->isolate() != Dart::vm_isolate());
@@ -193,7 +193,7 @@
 class InstanceAccumulator : public ObjectVisitor {
  public:
   InstanceAccumulator(ObjectGraph::Stack* stack, intptr_t class_id)
-      : stack_(stack), class_id_(class_id) { }
+      : stack_(stack), class_id_(class_id) {}
 
   void VisitObject(RawObject* obj) {
     if (obj->GetClassId() == class_id_) {
@@ -225,7 +225,7 @@
 
 class SizeVisitor : public ObjectGraph::Visitor {
  public:
-  SizeVisitor() : size_(0) { }
+  SizeVisitor() : size_(0) {}
   intptr_t size() const { return size_; }
   virtual bool ShouldSkip(RawObject* obj) const { return false; }
   virtual Direction VisitObject(ObjectGraph::StackIterator* it) {
@@ -236,6 +236,7 @@
     size_ += obj->Size();
     return kProceed;
   }
+
  private:
   intptr_t size_;
 };
@@ -243,8 +244,9 @@
 
 class SizeExcludingObjectVisitor : public SizeVisitor {
  public:
-  explicit SizeExcludingObjectVisitor(const Object& skip) : skip_(skip) { }
+  explicit SizeExcludingObjectVisitor(const Object& skip) : skip_(skip) {}
   virtual bool ShouldSkip(RawObject* obj) const { return obj == skip_.raw(); }
+
  private:
   const Object& skip_;
 };
@@ -252,10 +254,11 @@
 
 class SizeExcludingClassVisitor : public SizeVisitor {
  public:
-  explicit SizeExcludingClassVisitor(intptr_t skip) : skip_(skip) { }
+  explicit SizeExcludingClassVisitor(intptr_t skip) : skip_(skip) {}
   virtual bool ShouldSkip(RawObject* obj) const {
     return obj->GetClassId() == skip_;
   }
+
  private:
   const intptr_t skip_;
 };
@@ -312,10 +315,10 @@
     // and it is less informative than its alternatives.
     intptr_t cid = obj->GetClassId();
     switch (cid) {
-    case kICDataCid:
-      return true;
-    default:
-      return false;
+      case kICDataCid:
+        return true;
+      default:
+        return false;
     }
   }
 
@@ -328,9 +331,7 @@
     return false;
   }
 
-  void StartList() {
-    was_last_array_ = false;
-  }
+  void StartList() { was_last_array_ = false; }
 
   intptr_t HideNDescendant(RawObject* obj) {
     // A GrowableObjectArray overwrites its internal storage.
@@ -408,8 +409,12 @@
                            RawObject* target,
                            const Array& references,
                            Object* scratch)
-    : ObjectPointerVisitor(isolate), source_(NULL),
-      target_(target), references_(references), scratch_(scratch), length_(0) {
+      : ObjectPointerVisitor(isolate),
+        source_(NULL),
+        target_(target),
+        references_(references),
+        scratch_(scratch),
+        length_(0) {
     ASSERT(Thread::Current()->no_safepoint_scope_depth() != 0);
   }
 
@@ -483,17 +488,26 @@
 
 class WritePointerVisitor : public ObjectPointerVisitor {
  public:
-  WritePointerVisitor(Isolate* isolate, WriteStream* stream)
-      : ObjectPointerVisitor(isolate), stream_(stream), count_(0) {}
+  WritePointerVisitor(Isolate* isolate,
+                      WriteStream* stream,
+                      bool only_instances)
+      : ObjectPointerVisitor(isolate),
+        stream_(stream),
+        only_instances_(only_instances),
+        count_(0) {}
   virtual void VisitPointers(RawObject** first, RawObject** last) {
     for (RawObject** current = first; current <= last; ++current) {
-      if (!(*current)->IsHeapObject() || (*current == Object::null())) {
-        // Ignore smis and nulls for now.
+      RawObject* object = *current;
+      if (!object->IsHeapObject() || object->IsVMHeapObject()) {
+        // Ignore smis and objects in the VM isolate for now.
         // TODO(koda): To track which field each pointer corresponds to,
         // we'll need to encode which fields were omitted here.
         continue;
       }
-      WritePtr(*current, stream_);
+      if (only_instances_ && (object->GetClassId() < kInstanceCid)) {
+        continue;
+      }
+      WritePtr(object, stream_);
       ++count_;
     }
   }
@@ -502,12 +516,15 @@
 
  private:
   WriteStream* stream_;
+  bool only_instances_;
   intptr_t count_;
 };
 
 
-static void WriteHeader(RawObject* raw, intptr_t size, intptr_t cid,
-                 WriteStream* stream) {
+static void WriteHeader(RawObject* raw,
+                        intptr_t size,
+                        intptr_t cid,
+                        WriteStream* stream) {
   WritePtr(raw, stream);
   ASSERT(Utils::IsAligned(size, kObjectAlignment));
   stream->WriteUnsigned(size);
@@ -517,8 +534,13 @@
 
 class WriteGraphVisitor : public ObjectGraph::Visitor {
  public:
-  WriteGraphVisitor(Isolate* isolate, WriteStream* stream)
-    : stream_(stream), ptr_writer_(isolate, stream), count_(0) {}
+  WriteGraphVisitor(Isolate* isolate,
+                    WriteStream* stream,
+                    ObjectGraph::SnapshotRoots roots)
+      : stream_(stream),
+        ptr_writer_(isolate, stream, roots == ObjectGraph::kUser),
+        roots_(roots),
+        count_(0) {}
 
   virtual Direction VisitObject(ObjectGraph::StackIterator* it) {
     RawObject* raw_obj = it->Get();
@@ -526,11 +548,13 @@
     REUSABLE_OBJECT_HANDLESCOPE(thread);
     Object& obj = thread->ObjectHandle();
     obj = raw_obj;
-    // Each object is a header + a zero-terminated list of its neighbors.
-    WriteHeader(raw_obj, raw_obj->Size(), obj.GetClassId(), stream_);
-    raw_obj->VisitPointers(&ptr_writer_);
-    stream_->WriteUnsigned(0);
-    ++count_;
+    if ((roots_ == ObjectGraph::kVM) || obj.IsField() || obj.IsInstance()) {
+      // Each object is a header + a zero-terminated list of its neighbors.
+      WriteHeader(raw_obj, raw_obj->Size(), obj.GetClassId(), stream_);
+      raw_obj->VisitPointers(&ptr_writer_);
+      stream_->WriteUnsigned(0);
+      ++count_;
+    }
     return kProceed;
   }
 
@@ -539,29 +563,98 @@
  private:
   WriteStream* stream_;
   WritePointerVisitor ptr_writer_;
+  ObjectGraph::SnapshotRoots roots_;
   intptr_t count_;
 };
 
 
-intptr_t ObjectGraph::Serialize(WriteStream* stream, bool collect_garbage) {
+static void IterateUserFields(ObjectPointerVisitor* visitor) {
+  Thread* thread = Thread::Current();
+  // Scope to prevent handles create here from appearing as stack references.
+  HANDLESCOPE(thread);
+  Zone* zone = thread->zone();
+  const GrowableObjectArray& libraries = GrowableObjectArray::Handle(
+      zone, thread->isolate()->object_store()->libraries());
+  Library& library = Library::Handle(zone);
+  Object& entry = Object::Handle(zone);
+  Class& cls = Class::Handle(zone);
+  Array& fields = Array::Handle(zone);
+  Field& field = Field::Handle(zone);
+  for (intptr_t i = 0; i < libraries.Length(); i++) {
+    library ^= libraries.At(i);
+    DictionaryIterator entries(library);
+    while (entries.HasNext()) {
+      entry = entries.GetNext();
+      if (entry.IsClass()) {
+        cls ^= entry.raw();
+        fields = cls.fields();
+        for (intptr_t j = 0; j < fields.Length(); j++) {
+          field ^= fields.At(j);
+          RawObject* ptr = field.raw();
+          visitor->VisitPointer(&ptr);
+        }
+      } else if (entry.IsField()) {
+        field ^= entry.raw();
+        RawObject* ptr = field.raw();
+        visitor->VisitPointer(&ptr);
+      }
+    }
+  }
+}
+
+
+intptr_t ObjectGraph::Serialize(WriteStream* stream,
+                                SnapshotRoots roots,
+                                bool collect_garbage) {
   if (collect_garbage) {
     isolate()->heap()->CollectAllGarbage();
   }
   // Current encoding assumes objects do not move, so promote everything to old.
   isolate()->heap()->new_space()->Evacuate();
 
-  WriteGraphVisitor visitor(isolate(), stream);
+  RawObject* kRootAddress = reinterpret_cast<RawObject*>(kHeapObjectTag);
+  const intptr_t kRootCid = kIllegalCid;
+  RawObject* kStackAddress =
+      reinterpret_cast<RawObject*>(kObjectAlignment + kHeapObjectTag);
+
   stream->WriteUnsigned(kObjectAlignment);
-  stream->WriteUnsigned(0);
-  stream->WriteUnsigned(0);
-  stream->WriteUnsigned(0);
-  {
-    WritePointerVisitor ptr_writer(isolate(), stream);
+  stream->WriteUnsigned(kStackCid);
+
+  if (roots == kVM) {
+    // Write root "object".
+    WriteHeader(kRootAddress, 0, kRootCid, stream);
+    WritePointerVisitor ptr_writer(isolate(), stream, false);
     isolate()->IterateObjectPointers(&ptr_writer, false);
+    stream->WriteUnsigned(0);
+  } else {
+    {
+      // Write root "object".
+      WriteHeader(kRootAddress, 0, kRootCid, stream);
+      WritePointerVisitor ptr_writer(isolate(), stream, false);
+      IterateUserFields(&ptr_writer);
+      WritePtr(kStackAddress, stream);
+      stream->WriteUnsigned(0);
+    }
+
+    {
+      // Write stack "object".
+      WriteHeader(kStackAddress, 0, kStackCid, stream);
+      WritePointerVisitor ptr_writer(isolate(), stream, true);
+      isolate()->IterateStackPointers(&ptr_writer, false);
+      stream->WriteUnsigned(0);
+    }
   }
-  stream->WriteUnsigned(0);
+
+  WriteGraphVisitor visitor(isolate(), stream, roots);
   IterateObjects(&visitor);
-  return visitor.count() + 1;  // + root
+
+  intptr_t object_count = visitor.count();
+  if (roots == kVM) {
+    object_count += 1;  // root
+  } else {
+    object_count += 2;  // root and stack
+  }
+  return object_count;
 }
 
 }  // namespace dart
diff --git a/runtime/vm/object_graph.h b/runtime/vm/object_graph.h
index 70091d6..8060fba 100644
--- a/runtime/vm/object_graph.h
+++ b/runtime/vm/object_graph.h
@@ -2,15 +2,18 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_OBJECT_GRAPH_H_
-#define VM_OBJECT_GRAPH_H_
+#ifndef RUNTIME_VM_OBJECT_GRAPH_H_
+#define RUNTIME_VM_OBJECT_GRAPH_H_
 
 #include "vm/allocation.h"
-#include "vm/object.h"
 
 namespace dart {
 
+class Array;
 class Isolate;
+class Object;
+class RawObject;
+class WriteStream;
 
 // Utility to traverse the object graph in an ordered fashion.
 // Example uses:
@@ -29,9 +32,10 @@
     bool MoveToParent();
     // Offset into parent for the pointer to current object. -1 if no parent.
     intptr_t OffsetFromParentInWords() const;
+
    private:
     StackIterator(const Stack* stack, intptr_t index)
-        : stack_(stack), index_(index) { }
+        : stack_(stack), index_(index) {}
     const Stack* stack_;
     intptr_t index_;
     friend class ObjectGraph::Stack;
@@ -46,7 +50,7 @@
       kBacktrack,  // Ignore this object's pointers.
       kAbort,      // Terminate the entire search immediately.
     };
-    virtual ~Visitor() { }
+    virtual ~Visitor() {}
     // Visits the object pointed to by *it. The iterator is only valid
     // during this call. This method must not allocate from the heap or
     // trigger GC in any way.
@@ -92,12 +96,16 @@
   // be live due to references from the stack or embedder handles.
   intptr_t InboundReferences(Object* obj, const Array& references);
 
+  enum SnapshotRoots { kVM, kUser };
+
   // Write the isolate's object graph to 'stream'. Smis and nulls are omitted.
   // Returns the number of nodes in the stream, including the root.
   // If collect_garabage is false, the graph will include weakly-reachable
   // objects.
   // TODO(koda): Document format; support streaming/chunking.
-  intptr_t Serialize(WriteStream* stream, bool collect_garbage);
+  intptr_t Serialize(WriteStream* stream,
+                     SnapshotRoots roots,
+                     bool collect_garbage);
 
  private:
   DISALLOW_IMPLICIT_CONSTRUCTORS(ObjectGraph);
@@ -105,4 +113,4 @@
 
 }  // namespace dart
 
-#endif  // VM_OBJECT_GRAPH_H_
+#endif  // RUNTIME_VM_OBJECT_GRAPH_H_
diff --git a/runtime/vm/object_graph_test.cc b/runtime/vm/object_graph_test.cc
index 801d01c..0b5c095 100644
--- a/runtime/vm/object_graph_test.cc
+++ b/runtime/vm/object_graph_test.cc
@@ -13,7 +13,7 @@
   // Records the number of objects and total size visited, excluding 'skip'
   // and any objects only reachable through 'skip'.
   CounterVisitor(RawObject* skip, RawObject* expected_parent)
-      : count_(0), size_(0), skip_(skip), expected_parent_(expected_parent) { }
+      : count_(0), size_(0), skip_(skip), expected_parent_(expected_parent) {}
 
   virtual Direction VisitObject(ObjectGraph::StackIterator* it) {
     RawObject* obj = it->Get();
@@ -74,8 +74,7 @@
       graph.IterateObjectsFrom(a, &without);
       // Only 'b' and 'c' were cut off.
       EXPECT_EQ(2, with.count() - without.count());
-      EXPECT_EQ(b_size + c_size,
-                with.size() - without.size());
+      EXPECT_EQ(b_size + c_size, with.size() - without.size());
     }
     {
       // Like above, but iterate over the entire isolate. The counts and sizes
@@ -85,8 +84,7 @@
       CounterVisitor without(b_raw, a.raw());
       graph.IterateObjects(&without);
       EXPECT_EQ(2, with.count() - without.count());
-      EXPECT_EQ(b_size + c_size,
-                with.size() - without.size());
+      EXPECT_EQ(b_size + c_size, with.size() - without.size());
     }
     EXPECT_EQ(a_size + b_size + c_size + d_size,
               graph.SizeRetainedByInstance(a));
diff --git a/runtime/vm/object_id_ring.h b/runtime/vm/object_id_ring.h
index b3ad0c9..4936316 100644
--- a/runtime/vm/object_id_ring.h
+++ b/runtime/vm/object_id_ring.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_OBJECT_ID_RING_H_
-#define VM_OBJECT_ID_RING_H_
+#ifndef RUNTIME_VM_OBJECT_ID_RING_H_
+#define RUNTIME_VM_OBJECT_ID_RING_H_
 
 namespace dart {
 
@@ -28,9 +28,9 @@
   };
 
   enum IdPolicy {
-    kAllocateId,        // Always allocate a new object id.
-    kReuseId,           // If the object is already in the ring, reuse id.
-                        // Otherwise allocate a new object id.
+    kAllocateId,  // Always allocate a new object id.
+    kReuseId,     // If the object is already in the ring, reuse id.
+                  // Otherwise allocate a new object id.
     kNumIdPolicy,
   };
 
@@ -67,12 +67,8 @@
   int32_t serial_num_;
   bool wrapped_;
 
-  RawObject** table() {
-    return table_;
-  }
-  int32_t table_size() {
-    return capacity_;
-  }
+  RawObject** table() { return table_; }
+  int32_t table_size() { return capacity_; }
 
   int32_t NextSerial();
   int32_t AllocateNewId(RawObject* object);
@@ -86,4 +82,4 @@
 
 }  // namespace dart
 
-#endif  // VM_OBJECT_ID_RING_H_
+#endif  // RUNTIME_VM_OBJECT_ID_RING_H_
diff --git a/runtime/vm/object_id_ring_test.cc b/runtime/vm/object_id_ring_test.cc
index dd64aa5..cbd3407 100644
--- a/runtime/vm/object_id_ring_test.cc
+++ b/runtime/vm/object_id_ring_test.cc
@@ -15,7 +15,8 @@
 
 class ObjectIdRingTestHelper {
  public:
-  static void SetCapacityAndMaxSerial(ObjectIdRing* ring, int32_t capacity,
+  static void SetCapacityAndMaxSerial(ObjectIdRing* ring,
+                                      int32_t capacity,
                                       int32_t max_serial) {
     ring->SetCapacityAndMaxSerial(capacity, max_serial);
   }
@@ -123,9 +124,9 @@
 // Test that the ring table is updated when the scavenger moves an object.
 TEST_CASE(ObjectIdRingScavengeMoveTest) {
   const char* kScriptChars =
-  "main() {\n"
-  "  return [1, 2, 3];\n"
-  "}\n";
+      "main() {\n"
+      "  return [1, 2, 3];\n"
+      "}\n";
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
   Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
   intptr_t list_length = 0;
@@ -145,14 +146,12 @@
   intptr_t raw_obj_id1 = ring->GetIdForObject(raw_obj);
   EXPECT_EQ(0, raw_obj_id1);
   // Get id 0 again.
-  EXPECT_EQ(raw_obj_id1,
-      ring->GetIdForObject(raw_obj, ObjectIdRing::kReuseId));
+  EXPECT_EQ(raw_obj_id1, ring->GetIdForObject(raw_obj, ObjectIdRing::kReuseId));
   // Add to ring a second time.
   intptr_t raw_obj_id2 = ring->GetIdForObject(raw_obj);
   EXPECT_EQ(1, raw_obj_id2);
   // Get id 0 again.
-  EXPECT_EQ(raw_obj_id1,
-      ring->GetIdForObject(raw_obj, ObjectIdRing::kReuseId));
+  EXPECT_EQ(raw_obj_id1, ring->GetIdForObject(raw_obj, ObjectIdRing::kReuseId));
   RawObject* raw_obj1 = ring->GetObjectForId(raw_obj_id1, &kind);
   EXPECT_EQ(ObjectIdRing::kValid, kind);
   RawObject* raw_obj2 = ring->GetObjectForId(raw_obj_id2, &kind);
@@ -186,7 +185,7 @@
   EXPECT_EQ(3, list_length);
   // Test id reuse.
   EXPECT_EQ(raw_obj_id1,
-      ring->GetIdForObject(raw_object_moved1, ObjectIdRing::kReuseId));
+            ring->GetIdForObject(raw_object_moved1, ObjectIdRing::kReuseId));
 }
 
 
diff --git a/runtime/vm/object_reload.cc b/runtime/vm/object_reload.cc
index f3b06e0..a5998b9 100644
--- a/runtime/vm/object_reload.cc
+++ b/runtime/vm/object_reload.cc
@@ -58,7 +58,7 @@
 
 
 void Code::ResetICDatas(Zone* zone) const {
-  // Iterate over the Code's object pool and reset all ICDatas.
+// Iterate over the Code's object pool and reset all ICDatas.
 #ifdef TARGET_ARCH_IA32
   // IA32 does not have an object pool, but, we can iterate over all
   // embedded objects by using the variable length data section.
@@ -128,7 +128,9 @@
         old_field = Field::RawCast(old_field_list.At(j));
         old_name = old_field.name();
         if (name.Equals(old_name)) {
-          if (update_values) {
+          // We only copy values if requested and if the field is not a const
+          // field. We let const fields be updated with a reload.
+          if (update_values && !field.is_const()) {
             value = old_field.StaticValue();
             field.SetStaticValue(value);
           }
@@ -159,8 +161,7 @@
     return;
   }
   TIR_Print("Copied %" Pd " canonical constants for class `%s`\n",
-            old_constants.Length(),
-            ToCString());
+            old_constants.Length(), ToCString());
   set_constants(old_constants);
 }
 
@@ -203,18 +204,10 @@
 //   the ordering is always correct (i.e. enum indicies match slots in values
 //   array)
 // 3) An existing enum value is removed.
-//   We leave old enum values that have no mapping to the reloaded class
-//   in the heap. This means that if a programmer does the following:
-//   enum Foo { A, B }; var x = Foo.A;
-//   *reload*
-//   enum Foo { B };
-//   *reload*
-//   enum Foo { A, B }; expect(identical(x, Foo.A));
-//   The program will fail because we were not able to pair Foo.A on the second
-//   reload.
+//   Each enum class has a canonical 'deleted' enum sentinel instance.
+//   When an enum value is deleted, we 'become' all references to the 'deleted'
+//   sentinel value. The index value is -1.
 //
-//   Deleted enum values still in the heap continue to function but their
-//   index field will not be valid.
 void Class::ReplaceEnum(const Class& old_enum) const {
   // We only do this for finalized enum classes.
   ASSERT(is_enum_class());
@@ -236,8 +229,12 @@
   Instance& old_enum_values = Instance::Handle(zone);
   // The E.values array.
   Instance& enum_values = Instance::Handle(zone);
-  Array& enum_map_storage = Array::Handle(zone,
-      HashTables::New<UnorderedHashMap<EnumMapTraits> >(4));
+  // The E._deleted_enum_sentinel instance.
+  Instance& old_deleted_enum_sentinel = Instance::Handle(zone);
+  // The E._deleted_enum_sentinel instance.
+  Instance& deleted_enum_sentinel = Instance::Handle(zone);
+  Array& enum_map_storage =
+      Array::Handle(zone, HashTables::New<UnorderedHashMap<EnumMapTraits> >(4));
   ASSERT(!enum_map_storage.IsNull());
 
   TIR_Print("Replacing enum `%s`\n", String::Handle(Name()).ToCString());
@@ -258,6 +255,11 @@
         // Non-enum instance.
         continue;
       }
+      if (enum_ident.Equals(Symbols::_DeletedEnumSentinel())) {
+        old_deleted_enum_sentinel = field.StaticValue();
+        // Non-enum instance.
+        continue;
+      }
       old_enum_value = field.StaticValue();
       ASSERT(!old_enum_value.IsNull());
       VTIR_Print("Element %s being added to mapping\n", enum_ident.ToCString());
@@ -287,6 +289,11 @@
         // Non-enum instance.
         continue;
       }
+      if (enum_ident.Equals(Symbols::_DeletedEnumSentinel())) {
+        deleted_enum_sentinel = field.StaticValue();
+        // Non-enum instance.
+        continue;
+      }
       enum_value = field.StaticValue();
       ASSERT(!enum_value.IsNull());
       old_enum_value ^= enum_map.GetOrNull(enum_ident);
@@ -312,16 +319,29 @@
   ASSERT(!enum_values.IsNull());
   reload_context->AddEnumBecomeMapping(old_enum_values, enum_values);
 
-  if (enums_deleted && FLAG_trace_reload_verbose) {
+  // Map the old E._deleted_enum_sentinel to the new E._deleted_enum_sentinel.
+  ASSERT(!old_deleted_enum_sentinel.IsNull());
+  ASSERT(!deleted_enum_sentinel.IsNull());
+  reload_context->AddEnumBecomeMapping(old_deleted_enum_sentinel,
+                                       deleted_enum_sentinel);
+
+  if (enums_deleted) {
+    // Map all deleted enums to the deleted enum senintel value.
     // TODO(johnmccutchan): Add this to the reload 'notices' list.
-    VTIR_Print("The following enum values were deleted and are forever lost in "
-               "the heap:\n");
+    VTIR_Print(
+        "The following enum values were deleted from %s and will become the "
+        "deleted enum sentinel:\n",
+        old_enum.ToCString());
     UnorderedHashMap<EnumMapTraits> enum_map(enum_map_storage.raw());
     UnorderedHashMap<EnumMapTraits>::Iterator it(&enum_map);
     while (it.MoveNext()) {
       const intptr_t entry = it.Current();
       enum_ident = String::RawCast(enum_map.GetKey(entry));
       ASSERT(!enum_ident.IsNull());
+      old_enum_value ^= enum_map.GetOrNull(enum_ident);
+      VTIR_Print("Element `%s` was deleted\n", enum_ident.ToCString());
+      reload_context->AddEnumBecomeMapping(old_enum_value,
+                                           deleted_enum_sentinel);
     }
     enum_map.Release();
   }
@@ -383,8 +403,7 @@
   Instance& new_closure = Instance::Handle();
   for (intptr_t i = 0; i < funcs.Length(); i++) {
     old_func ^= funcs.At(i);
-    if (old_func.is_static() &&
-      old_func.HasImplicitClosureFunction()) {
+    if (old_func.is_static() && old_func.HasImplicitClosureFunction()) {
       selector = old_func.name();
       new_func = new_cls.LookupFunction(selector);
       if (!new_func.IsNull() && new_func.is_static()) {
@@ -405,13 +424,13 @@
 class EnumClassConflict : public ClassReasonForCancelling {
  public:
   EnumClassConflict(Zone* zone, const Class& from, const Class& to)
-      : ClassReasonForCancelling(zone, from, to) { }
+      : ClassReasonForCancelling(zone, from, to) {}
 
   RawString* ToString() {
     return String::NewFormatted(
         from_.is_enum_class()
-        ? "Enum class cannot be redefined to be a non-enum class: %s"
-        : "Class cannot be redefined to be a enum class: %s",
+            ? "Enum class cannot be redefined to be a non-enum class: %s"
+            : "Class cannot be redefined to be a enum class: %s",
         from_.ToCString());
   }
 };
@@ -423,28 +442,26 @@
                        const Class& from,
                        const Class& to,
                        const Error& error)
-      : ClassReasonForCancelling(zone, from, to), error_(error) { }
+      : ClassReasonForCancelling(zone, from, to), error_(error) {}
 
  private:
   const Error& error_;
 
   RawError* ToError() { return error_.raw(); }
 
-  RawString* ToString() {
-    return String::New(error_.ToErrorCString());
-  }
+  RawString* ToString() { return String::New(error_.ToErrorCString()); }
 };
 
 
 class NativeFieldsConflict : public ClassReasonForCancelling {
  public:
   NativeFieldsConflict(Zone* zone, const Class& from, const Class& to)
-      : ClassReasonForCancelling(zone, from, to) { }
+      : ClassReasonForCancelling(zone, from, to) {}
 
  private:
   RawString* ToString() {
-    return String::NewFormatted(
-        "Number of native fields changed in %s", from_.ToCString());
+    return String::NewFormatted("Number of native fields changed in %s",
+                                from_.ToCString());
   }
 };
 
@@ -471,7 +488,7 @@
 };
 
 
-class PreFinalizedConflict :  public ClassReasonForCancelling {
+class PreFinalizedConflict : public ClassReasonForCancelling {
  public:
   PreFinalizedConflict(Zone* zone, const Class& from, const Class& to)
       : ClassReasonForCancelling(zone, from, to) {}
@@ -486,20 +503,18 @@
 };
 
 
-class InstanceSizeConflict :  public ClassReasonForCancelling {
+class InstanceSizeConflict : public ClassReasonForCancelling {
  public:
   InstanceSizeConflict(Zone* zone, const Class& from, const Class& to)
       : ClassReasonForCancelling(zone, from, to) {}
 
  private:
   RawString* ToString() {
-    return String::NewFormatted(
-        "Instance size mismatch between '%s' (%" Pd ") and replacement "
-        "'%s' ( %" Pd ")",
-        from_.ToCString(),
-        from_.instance_size(),
-        to_.ToCString(),
-        to_.instance_size());
+    return String::NewFormatted("Instance size mismatch between '%s' (%" Pd
+                                ") and replacement "
+                                "'%s' ( %" Pd ")",
+                                from_.ToCString(), from_.instance_size(),
+                                to_.ToCString(), to_.instance_size());
   }
 };
 
@@ -528,16 +543,15 @@
 };
 
 
-// This is executed before interating over the instances.
+// This is executed before iterating over the instances.
 void Class::CheckReload(const Class& replacement,
                         IsolateReloadContext* context) const {
   ASSERT(IsolateReloadContext::IsSameClass(*this, replacement));
 
   // Class cannot change enum property.
   if (is_enum_class() != replacement.is_enum_class()) {
-    context->AddReasonForCancelling(
-        new(context->zone())
-            EnumClassConflict(context->zone(), *this, replacement));
+    context->AddReasonForCancelling(new (context->zone()) EnumClassConflict(
+        context->zone(), *this, replacement));
     return;
   }
 
@@ -547,7 +561,7 @@
         Error::Handle(replacement.EnsureIsFinalized(Thread::Current()));
     if (!error.IsNull()) {
       context->AddReasonForCancelling(
-          new(context->zone())
+          new (context->zone())
               EnsureFinalizedError(context->zone(), *this, replacement, error));
       return;  // No reason to check other properties.
     }
@@ -557,10 +571,9 @@
 
   // Native field count cannot change.
   if (num_native_fields() != replacement.num_native_fields()) {
-      context->AddReasonForCancelling(
-          new(context->zone())
-              NativeFieldsConflict(context->zone(), *this, replacement));
-      return;
+    context->AddReasonForCancelling(new (context->zone()) NativeFieldsConflict(
+        context->zone(), *this, replacement));
+    return;
   }
 
   // Just checking.
@@ -574,18 +587,18 @@
     if (!CanReloadPreFinalized(replacement, context)) return;
   }
   ASSERT(is_finalized() == replacement.is_finalized());
-  TIR_Print("Class `%s` can be reloaded (%" Pd " and %" Pd ")\n",
-            ToCString(), id(), replacement.id());
+  TIR_Print("Class `%s` can be reloaded (%" Pd " and %" Pd ")\n", ToCString(),
+            id(), replacement.id());
 }
 
 
-
 bool Class::RequiresInstanceMorphing(const Class& replacement) const {
   // Get the field maps for both classes. These field maps walk the class
   // hierarchy.
-  const Array& fields = Array::Handle(OffsetToFieldMap());
-  const Array& replacement_fields
-      = Array::Handle(replacement.OffsetToFieldMap());
+  const Array& fields =
+      Array::Handle(OffsetToFieldMap(true /* original classes */));
+  const Array& replacement_fields =
+      Array::Handle(replacement.OffsetToFieldMap());
 
   // Check that the size of the instance is the same.
   if (fields.Length() != replacement_fields.Length()) return true;
@@ -625,15 +638,13 @@
   const AbstractType& replacement_dt =
       AbstractType::Handle(replacement.DeclarationType());
   if (!dt.Equals(replacement_dt)) {
-    context->AddReasonForCancelling(
-        new(context->zone())
-            TypeParametersChanged(context->zone(), *this, replacement));
+    context->AddReasonForCancelling(new (context->zone()) TypeParametersChanged(
+        context->zone(), *this, replacement));
     return false;
   }
   if (RequiresInstanceMorphing(replacement)) {
-    context->AddInstanceMorpher(
-        new(context->zone())
-            InstanceMorpher(context->zone(), *this, replacement));
+    context->AddInstanceMorpher(new (context->zone()) InstanceMorpher(
+        context->zone(), *this, replacement));
   }
   return true;
 }
@@ -643,17 +654,15 @@
                                   IsolateReloadContext* context) const {
   // The replacement class must also prefinalized.
   if (!replacement.is_prefinalized()) {
-      context->AddReasonForCancelling(
-          new(context->zone())
-              PreFinalizedConflict(context->zone(), *this, replacement));
-      return false;
+    context->AddReasonForCancelling(new (context->zone()) PreFinalizedConflict(
+        context->zone(), *this, replacement));
+    return false;
   }
   // Check the instance sizes are equal.
   if (instance_size() != replacement.instance_size()) {
-      context->AddReasonForCancelling(
-          new(context->zone())
-              InstanceSizeConflict(context->zone(), *this, replacement));
-      return false;
+    context->AddReasonForCancelling(new (context->zone()) InstanceSizeConflict(
+        context->zone(), *this, replacement));
+    return false;
   }
   return true;
 }
@@ -670,9 +679,8 @@
     if (prefix.is_deferred_load()) {
       const String& prefix_name = String::Handle(prefix.name());
       context->AddReasonForCancelling(
-          new(context->zone())
-              UnimplementedDeferredLibrary(context->zone(),
-                                           *this, replacement, prefix_name));
+          new (context->zone()) UnimplementedDeferredLibrary(
+              context->zone(), *this, replacement, prefix_name));
       return;
     }
   }
@@ -739,8 +747,7 @@
 
     const Array& args_desc_array = Array::Handle(zone, arguments_descriptor());
     ArgumentsDescriptor args_desc(args_desc_array);
-    if (new_target.IsNull() ||
-        !new_target.AreValidArguments(args_desc, NULL)) {
+    if (new_target.IsNull() || !new_target.AreValidArguments(args_desc, NULL)) {
       // TODO(rmacnak): Patch to a NSME stub.
       VTIR_Print("Cannot rebind static call to %s from %s\n",
                  old_target.ToCString(),
@@ -762,4 +769,4 @@
 
 #endif  // !PRODUCT
 
-}   // namespace dart.
+}  // namespace dart.
diff --git a/runtime/vm/object_service.cc b/runtime/vm/object_service.cc
index 578d97a..6d2bd9e 100644
--- a/runtime/vm/object_service.cc
+++ b/runtime/vm/object_service.cc
@@ -87,9 +87,7 @@
   jsobj.AddFixedServiceId("classes/%" Pd "", id());
   const String& scrubbed_name = String::Handle(ScrubbedName());
   const String& vm_name = String::Handle(Name());
-  AddNameProperties(&jsobj,
-                    scrubbed_name.ToCString(),
-                    vm_name.ToCString());
+  AddNameProperties(&jsobj, scrubbed_name.ToCString(), vm_name.ToCString());
   if (ref) {
     return;
   }
@@ -260,16 +258,16 @@
   }
   if (id != -1) {
     ASSERT(selector != NULL);
-    jsobj.AddFixedServiceId("classes/%" Pd "/%s/%" Pd "",
-                            cls.id(), selector, id);
+    jsobj.AddFixedServiceId("classes/%" Pd "/%s/%" Pd "", cls.id(), selector,
+                            id);
     return;
   }
   // Regular functions known to their owner use their name (percent-encoded).
   String& name = String::Handle(f.name());
   if (cls.LookupFunction(name) == f.raw()) {
     const char* encoded_name = String::EncodeIRI(name);
-    jsobj.AddFixedServiceId("classes/%" Pd "/functions/%s",
-                            cls.id(), encoded_name);
+    jsobj.AddFixedServiceId("classes/%" Pd "/functions/%s", cls.id(),
+                            encoded_name);
     return;
   }
   // Oddball functions (not known to their owner) fall back to use the object
@@ -356,8 +354,8 @@
   String& field_name = String::Handle(name());
   const char* encoded_field_name = String::EncodeIRI(field_name);
   AddCommonObjectProperties(&jsobj, "Field", ref);
-  jsobj.AddFixedServiceId("classes/%" Pd "/fields/%s",
-                          cls.id(), encoded_field_name);
+  jsobj.AddFixedServiceId("classes/%" Pd "/fields/%s", cls.id(),
+                          encoded_field_name);
 
   const String& user_name = String::Handle(UserVisibleName());
   const String& vm_name = String::Handle(name());
@@ -442,8 +440,7 @@
     jsobj.AddServiceId(*this);
   } else {
     jsobj.AddFixedServiceId("libraries/%" Pd "/scripts/%s/%" Px64 "",
-                            lib.index(), encoded_uri,
-                            load_timestamp());
+                            lib.index(), encoded_uri, load_timestamp());
   }
   jsobj.AddPropertyStr("uri", uri);
   jsobj.AddProperty("_kind", GetKindAsCString());
@@ -656,23 +653,23 @@
       JSONObject jsentry(stream);
       jsentry.AddProperty("offset", OffsetFromIndex(i));
       switch (InfoAt(i)) {
-      case ObjectPool::kTaggedObject:
-        obj = ObjectAt(i);
-        jsentry.AddProperty("kind", "Object");
-        jsentry.AddProperty("value", obj);
-        break;
-      case ObjectPool::kImmediate:
-        imm = RawValueAt(i);
-        jsentry.AddProperty("kind", "Immediate");
-        jsentry.AddProperty64("value", imm);
-        break;
-      case ObjectPool::kNativeEntry:
-        imm = RawValueAt(i);
-        jsentry.AddProperty("kind", "NativeEntry");
-        jsentry.AddProperty64("value", imm);
-        break;
-      default:
-        UNREACHABLE();
+        case ObjectPool::kTaggedObject:
+          obj = ObjectAt(i);
+          jsentry.AddProperty("kind", "Object");
+          jsentry.AddProperty("value", obj);
+          break;
+        case ObjectPool::kImmediate:
+          imm = RawValueAt(i);
+          jsentry.AddProperty("kind", "Immediate");
+          jsentry.AddProperty64("value", imm);
+          break;
+        case ObjectPool::kNativeEntry:
+          imm = RawValueAt(i);
+          jsentry.AddProperty("kind", "NativeEntry");
+          jsentry.AddProperty64("value", imm);
+          break;
+        default:
+          UNREACHABLE();
       }
     }
   }
@@ -717,8 +714,7 @@
 }
 
 
-void LocalVarDescriptors::PrintJSONImpl(JSONStream* stream,
-                                        bool ref) const {
+void LocalVarDescriptors::PrintJSONImpl(JSONStream* stream, bool ref) const {
   JSONObject jsobj(stream);
   AddCommonObjectProperties(&jsobj, "Object", ref);
   // TODO(johnmccutchan): Generate a stable id. LocalVarDescriptors hang off
@@ -736,16 +732,16 @@
     JSONObject var(&members);
     var.AddProperty("name", var_name.ToCString());
     var.AddProperty("index", static_cast<intptr_t>(info.index()));
-    var.AddProperty("beginPos", info.begin_pos);
-    var.AddProperty("endPos", info.end_pos);
+    var.AddProperty("declarationTokenPos", info.declaration_pos);
+    var.AddProperty("scopeStartTokenPos", info.begin_pos);
+    var.AddProperty("scopeEndTokenPos", info.end_pos);
     var.AddProperty("scopeId", static_cast<intptr_t>(info.scope_id));
     var.AddProperty("kind", KindToCString(info.kind()));
   }
 }
 
 
-void ExceptionHandlers::PrintJSONImpl(JSONStream* stream,
-                                      bool ref) const {
+void ExceptionHandlers::PrintJSONImpl(JSONStream* stream, bool ref) const {
   Object::PrintJSONImpl(stream, ref);
 }
 
@@ -806,8 +802,7 @@
 void Code::PrintJSONImpl(JSONStream* stream, bool ref) const {
   JSONObject jsobj(stream);
   AddCommonObjectProperties(&jsobj, "Code", ref);
-  jsobj.AddFixedServiceId("code/%" Px64"-%" Px "",
-                          compile_timestamp(),
+  jsobj.AddFixedServiceId("code/%" Px64 "-%" Px "", compile_timestamp(),
                           PayloadStart());
   const char* qualified_name = QualifiedName();
   const char* vm_name = Name();
@@ -980,8 +975,7 @@
 }
 
 
-void UnhandledException::PrintJSONImpl(JSONStream* stream,
-                                       bool ref) const {
+void UnhandledException::PrintJSONImpl(JSONStream* stream, bool ref) const {
   JSONObject jsobj(stream);
   AddCommonObjectProperties(&jsobj, "Error", ref);
   jsobj.AddProperty("kind", "UnhandledException");
@@ -1009,8 +1003,7 @@
 }
 
 
-void Instance::PrintSharedInstanceJSON(JSONObject* jsobj,
-                                       bool ref) const {
+void Instance::PrintSharedInstanceJSON(JSONObject* jsobj, bool ref) const {
   AddCommonObjectProperties(jsobj, "Instance", ref);
   if (ref) {
     return;
@@ -1310,8 +1303,7 @@
 }
 
 
-void GrowableObjectArray::PrintJSONImpl(JSONStream* stream,
-                                        bool ref) const {
+void GrowableObjectArray::PrintJSONImpl(JSONStream* stream, bool ref) const {
   JSONObject jsobj(stream);
   PrintSharedInstanceJSON(&jsobj, ref);
   jsobj.AddProperty("kind", "List");
@@ -1432,16 +1424,14 @@
     jsobj.AddProperty("bytes", "");
   } else {
     NoSafepointScope no_safepoint;
-    jsobj.AddPropertyBase64("bytes",
-                            reinterpret_cast<const uint8_t*>(
-                                DataAddr(offset * ElementSizeInBytes())),
+    jsobj.AddPropertyBase64("bytes", reinterpret_cast<const uint8_t*>(DataAddr(
+                                         offset * ElementSizeInBytes())),
                             count * ElementSizeInBytes());
   }
 }
 
 
-void ExternalTypedData::PrintJSONImpl(JSONStream* stream,
-                                      bool ref) const {
+void ExternalTypedData::PrintJSONImpl(JSONStream* stream, bool ref) const {
   JSONObject jsobj(stream);
   PrintSharedInstanceJSON(&jsobj, ref);
   const Class& cls = Class::Handle(clazz());
@@ -1465,9 +1455,8 @@
     jsobj.AddProperty("bytes", "");
   } else {
     NoSafepointScope no_safepoint;
-    jsobj.AddPropertyBase64("bytes",
-                            reinterpret_cast<const uint8_t*>(
-                                DataAddr(offset * ElementSizeInBytes())),
+    jsobj.AddPropertyBase64("bytes", reinterpret_cast<const uint8_t*>(DataAddr(
+                                         offset * ElementSizeInBytes())),
                             count * ElementSizeInBytes());
   }
 }
@@ -1523,21 +1512,35 @@
   jsobj.AddProperty("isCaseSensitive", !is_ignore_case());
   jsobj.AddProperty("isMultiLine", is_multi_line());
 
-  Function& func = Function::Handle();
-  func = function(kOneByteStringCid);
-  jsobj.AddProperty("_oneByteFunction", func);
-  func = function(kTwoByteStringCid);
-  jsobj.AddProperty("_twoByteFunction", func);
-  func = function(kExternalOneByteStringCid);
-  jsobj.AddProperty("_externalOneByteFunction", func);
-  func = function(kExternalTwoByteStringCid);
-  jsobj.AddProperty("_externalTwoByteFunction", func);
-
-  TypedData& bc = TypedData::Handle();
-  bc = bytecode(true);
-  jsobj.AddProperty("_oneByteBytecode", bc);
-  bc = bytecode(false);
-  jsobj.AddProperty("_twoByteBytecode", bc);
+  if (!FLAG_interpret_irregexp) {
+    Function& func = Function::Handle();
+    func = function(kOneByteStringCid, /*sticky=*/false);
+    jsobj.AddProperty("_oneByteFunction", func);
+    func = function(kTwoByteStringCid, /*sticky=*/false);
+    jsobj.AddProperty("_twoByteFunction", func);
+    func = function(kExternalOneByteStringCid, /*sticky=*/false);
+    jsobj.AddProperty("_externalOneByteFunction", func);
+    func = function(kExternalTwoByteStringCid, /*sticky=*/false);
+    jsobj.AddProperty("_externalTwoByteFunction", func);
+    func = function(kOneByteStringCid, /*sticky=*/true);
+    jsobj.AddProperty("_oneByteFunctionSticky", func);
+    func = function(kTwoByteStringCid, /*sticky=*/true);
+    jsobj.AddProperty("_twoByteFunctionSticky", func);
+    func = function(kExternalOneByteStringCid, /*sticky=*/true);
+    jsobj.AddProperty("_externalOneByteFunctionSticky", func);
+    func = function(kExternalTwoByteStringCid, /*sticky=*/true);
+    jsobj.AddProperty("_externalTwoByteFunctionSticky", func);
+  } else {
+    TypedData& bc = TypedData::Handle();
+    bc = bytecode(/*is_one_byte=*/true, /*sticky=*/false);
+    jsobj.AddProperty("_oneByteBytecode", bc);
+    bc = bytecode(/*is_one_byte=*/false, /*sticky=*/false);
+    jsobj.AddProperty("_twoByteBytecode", bc);
+    bc = bytecode(/*is_one_byte=*/true, /*sticky=*/true);
+    jsobj.AddProperty("_oneByteBytecodeSticky", bc);
+    bc = bytecode(/*is_one_byte=*/false, /*sticky=*/true);
+    jsobj.AddProperty("_twoByteBytecodeSticky", bc);
+  }
 }
 
 
diff --git a/runtime/vm/object_set.h b/runtime/vm/object_set.h
index 8ba53ba..a153377 100644
--- a/runtime/vm/object_set.h
+++ b/runtime/vm/object_set.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_OBJECT_SET_H_
-#define VM_OBJECT_SET_H_
+#ifndef RUNTIME_VM_OBJECT_SET_H_
+#define RUNTIME_VM_OBJECT_SET_H_
 
 #include "platform/utils.h"
 #include "vm/bit_vector.h"
@@ -19,8 +19,7 @@
       : start_(start),
         end_(end),
         bit_vector_(zone, (end - start) >> kWordSizeLog2),
-        next_(NULL) {
-  }
+        next_(NULL) {}
 
   bool ContainsAddress(uword address) {
     return address >= start_ && address < end_;
@@ -31,9 +30,7 @@
     return (address - start_) >> kWordSizeLog2;
   }
 
-  void AddObject(uword address) {
-    bit_vector_.Add(IndexForAddress(address));
-  }
+  void AddObject(uword address) { bit_vector_.Add(IndexForAddress(address)); }
 
   bool ContainsObject(uword address) {
     return bit_vector_.Contains(IndexForAddress(address));
@@ -51,18 +48,17 @@
 
 class ObjectSet : public ZoneAllocated {
  public:
-  explicit ObjectSet(Zone* zone) : zone_(zone), head_(NULL) { }
+  explicit ObjectSet(Zone* zone) : zone_(zone), head_(NULL) {}
 
   void AddRegion(uword start, uword end) {
-    ObjectSetRegion* region = new(zone_) ObjectSetRegion(zone_, start, end);
+    ObjectSetRegion* region = new (zone_) ObjectSetRegion(zone_, start, end);
     region->set_next(head_);
     head_ = region;
   }
 
   bool Contains(RawObject* raw_obj) const {
     uword raw_addr = RawObject::ToAddr(raw_obj);
-    for (ObjectSetRegion* region = head_;
-         region != NULL;
+    for (ObjectSetRegion* region = head_; region != NULL;
          region = region->next()) {
       if (region->ContainsAddress(raw_addr)) {
         return region->ContainsObject(raw_addr);
@@ -73,8 +69,7 @@
 
   void Add(RawObject* raw_obj) {
     uword raw_addr = RawObject::ToAddr(raw_obj);
-    for (ObjectSetRegion* region = head_;
-         region != NULL;
+    for (ObjectSetRegion* region = head_; region != NULL;
          region = region->next()) {
       if (region->ContainsAddress(raw_addr)) {
         return region->AddObject(raw_addr);
@@ -90,4 +85,4 @@
 
 }  // namespace dart
 
-#endif  // VM_OBJECT_SET_H_
+#endif  // RUNTIME_VM_OBJECT_SET_H_
diff --git a/runtime/vm/object_store.cc b/runtime/vm/object_store.cc
index 8812a8e..a4e4958 100644
--- a/runtime/vm/object_store.cc
+++ b/runtime/vm/object_store.cc
@@ -15,99 +15,98 @@
 namespace dart {
 
 ObjectStore::ObjectStore()
-  : object_class_(Class::null()),
-    object_type_(Type::null()),
-    null_class_(Class::null()),
-    null_type_(Type::null()),
-    function_type_(Type::null()),
-    closure_class_(Class::null()),
-    number_type_(Type::null()),
-    int_type_(Type::null()),
-    integer_implementation_class_(Class::null()),
-    smi_class_(Class::null()),
-    smi_type_(Type::null()),
-    mint_class_(Class::null()),
-    mint_type_(Type::null()),
-    bigint_class_(Class::null()),
-    double_class_(Class::null()),
-    double_type_(Type::null()),
-    float32x4_type_(Type::null()),
-    int32x4_type_(Type::null()),
-    float64x2_type_(Type::null()),
-    string_type_(Type::null()),
-    compiletime_error_class_(Class::null()),
-    future_class_(Class::null()),
-    completer_class_(Class::null()),
-    stream_iterator_class_(Class::null()),
-    symbol_class_(Class::null()),
-    one_byte_string_class_(Class::null()),
-    two_byte_string_class_(Class::null()),
-    external_one_byte_string_class_(Class::null()),
-    external_two_byte_string_class_(Class::null()),
-    bool_type_(Type::null()),
-    bool_class_(Class::null()),
-    array_class_(Class::null()),
-    array_type_(Type::null()),
-    immutable_array_class_(Class::null()),
-    growable_object_array_class_(Class::null()),
-    linked_hash_map_class_(Class::null()),
-    float32x4_class_(Class::null()),
-    int32x4_class_(Class::null()),
-    float64x2_class_(Class::null()),
-    error_class_(Class::null()),
-    weak_property_class_(Class::null()),
-    symbol_table_(Array::null()),
-    canonical_types_(Array::null()),
-    canonical_type_arguments_(Array::null()),
-    async_library_(Library::null()),
-    builtin_library_(Library::null()),
-    core_library_(Library::null()),
-    collection_library_(Library::null()),
-    convert_library_(Library::null()),
-    developer_library_(Library::null()),
-    internal_library_(Library::null()),
-    isolate_library_(Library::null()),
-    math_library_(Library::null()),
-    mirrors_library_(Library::null()),
-    native_wrappers_library_(Library::null()),
-    profiler_library_(Library::null()),
-    root_library_(Library::null()),
-    typed_data_library_(Library::null()),
-    vmservice_library_(Library::null()),
-    libraries_(GrowableObjectArray::null()),
-    libraries_map_(Array::null()),
-    closure_functions_(GrowableObjectArray::null()),
-    pending_classes_(GrowableObjectArray::null()),
-    pending_deferred_loads_(GrowableObjectArray::null()),
-    resume_capabilities_(GrowableObjectArray::null()),
-    exit_listeners_(GrowableObjectArray::null()),
-    error_listeners_(GrowableObjectArray::null()),
-    empty_context_(Context::null()),
-    stack_overflow_(Instance::null()),
-    out_of_memory_(Instance::null()),
-    preallocated_unhandled_exception_(UnhandledException::null()),
-    preallocated_stack_trace_(Stacktrace::null()),
-    lookup_port_handler_(Function::null()),
-    empty_uint32_array_(TypedData::null()),
-    handle_message_function_(Function::null()),
-    simple_instance_of_function_(Function::null()),
-    simple_instance_of_true_function_(Function::null()),
-    simple_instance_of_false_function_(Function::null()),
-    library_load_error_table_(Array::null()),
-    unique_dynamic_targets_(Array::null()),
-    token_objects_(GrowableObjectArray::null()),
-    token_objects_map_(Array::null()),
-    megamorphic_cache_table_(GrowableObjectArray::null()),
-    megamorphic_miss_code_(Code::null()),
-    megamorphic_miss_function_(Function::null()) {
+    : object_class_(Class::null()),
+      object_type_(Type::null()),
+      null_class_(Class::null()),
+      null_type_(Type::null()),
+      function_type_(Type::null()),
+      closure_class_(Class::null()),
+      number_type_(Type::null()),
+      int_type_(Type::null()),
+      integer_implementation_class_(Class::null()),
+      smi_class_(Class::null()),
+      smi_type_(Type::null()),
+      mint_class_(Class::null()),
+      mint_type_(Type::null()),
+      bigint_class_(Class::null()),
+      double_class_(Class::null()),
+      double_type_(Type::null()),
+      float32x4_type_(Type::null()),
+      int32x4_type_(Type::null()),
+      float64x2_type_(Type::null()),
+      string_type_(Type::null()),
+      compiletime_error_class_(Class::null()),
+      future_class_(Class::null()),
+      completer_class_(Class::null()),
+      stream_iterator_class_(Class::null()),
+      symbol_class_(Class::null()),
+      one_byte_string_class_(Class::null()),
+      two_byte_string_class_(Class::null()),
+      external_one_byte_string_class_(Class::null()),
+      external_two_byte_string_class_(Class::null()),
+      bool_type_(Type::null()),
+      bool_class_(Class::null()),
+      array_class_(Class::null()),
+      array_type_(Type::null()),
+      immutable_array_class_(Class::null()),
+      growable_object_array_class_(Class::null()),
+      linked_hash_map_class_(Class::null()),
+      float32x4_class_(Class::null()),
+      int32x4_class_(Class::null()),
+      float64x2_class_(Class::null()),
+      error_class_(Class::null()),
+      weak_property_class_(Class::null()),
+      symbol_table_(Array::null()),
+      canonical_types_(Array::null()),
+      canonical_type_arguments_(Array::null()),
+      async_library_(Library::null()),
+      builtin_library_(Library::null()),
+      core_library_(Library::null()),
+      collection_library_(Library::null()),
+      convert_library_(Library::null()),
+      developer_library_(Library::null()),
+      _internal_library_(Library::null()),
+      isolate_library_(Library::null()),
+      math_library_(Library::null()),
+      mirrors_library_(Library::null()),
+      native_wrappers_library_(Library::null()),
+      profiler_library_(Library::null()),
+      root_library_(Library::null()),
+      typed_data_library_(Library::null()),
+      _vmservice_library_(Library::null()),
+      libraries_(GrowableObjectArray::null()),
+      libraries_map_(Array::null()),
+      closure_functions_(GrowableObjectArray::null()),
+      pending_classes_(GrowableObjectArray::null()),
+      pending_deferred_loads_(GrowableObjectArray::null()),
+      resume_capabilities_(GrowableObjectArray::null()),
+      exit_listeners_(GrowableObjectArray::null()),
+      error_listeners_(GrowableObjectArray::null()),
+      empty_context_(Context::null()),
+      stack_overflow_(Instance::null()),
+      out_of_memory_(Instance::null()),
+      preallocated_unhandled_exception_(UnhandledException::null()),
+      preallocated_stack_trace_(Stacktrace::null()),
+      lookup_port_handler_(Function::null()),
+      empty_uint32_array_(TypedData::null()),
+      handle_message_function_(Function::null()),
+      simple_instance_of_function_(Function::null()),
+      simple_instance_of_true_function_(Function::null()),
+      simple_instance_of_false_function_(Function::null()),
+      library_load_error_table_(Array::null()),
+      unique_dynamic_targets_(Array::null()),
+      token_objects_(GrowableObjectArray::null()),
+      token_objects_map_(Array::null()),
+      megamorphic_cache_table_(GrowableObjectArray::null()),
+      megamorphic_miss_code_(Code::null()),
+      megamorphic_miss_function_(Function::null()) {
   for (RawObject** current = from(); current <= to(); current++) {
     ASSERT(*current == Object::null());
   }
 }
 
 
-ObjectStore::~ObjectStore() {
-}
+ObjectStore::~ObjectStore() {}
 
 
 void ObjectStore::VisitObjectPointers(ObjectPointerVisitor* visitor) {
@@ -134,9 +133,9 @@
     JSONObject fields(jsobj, "fields");
     Object& value = Object::Handle();
 #define PRINT_OBJECT_STORE_FIELD(type, name)                                   \
-    value = name;                                                              \
-    fields.AddProperty(#name, value);
-OBJECT_STORE_FIELD_LIST(PRINT_OBJECT_STORE_FIELD);
+  value = name;                                                                \
+  fields.AddProperty(#name, value);
+    OBJECT_STORE_FIELD_LIST(PRINT_OBJECT_STORE_FIELD);
 #undef PRINT_OBJECT_STORE_FIELD
   }
 }
@@ -167,19 +166,17 @@
   Object& result = Object::Handle();
   const Library& library = Library::Handle(Library::CoreLibrary());
 
-  result = DartLibraryCalls::InstanceCreate(library,
-                                            Symbols::StackOverflowError(),
-                                            Symbols::Dot(),
-                                            Object::empty_array());
+  result =
+      DartLibraryCalls::InstanceCreate(library, Symbols::StackOverflowError(),
+                                       Symbols::Dot(), Object::empty_array());
   if (result.IsError()) {
     return Error::Cast(result).raw();
   }
   set_stack_overflow(Instance::Cast(result));
 
-  result = DartLibraryCalls::InstanceCreate(library,
-                                            Symbols::OutOfMemoryError(),
-                                            Symbols::Dot(),
-                                            Object::empty_array());
+  result =
+      DartLibraryCalls::InstanceCreate(library, Symbols::OutOfMemoryError(),
+                                       Symbols::Dot(), Object::empty_array());
   if (result.IsError()) {
     return Error::Cast(result).raw();
   }
@@ -187,17 +184,17 @@
 
   // Allocate pre-allocated unhandled exception object initialized with the
   // pre-allocated OutOfMemoryError.
-  const UnhandledException& unhandled_exception = UnhandledException::Handle(
-      UnhandledException::New(Instance::Cast(result),
-                              Stacktrace::Handle(zone)));
+  const UnhandledException& unhandled_exception =
+      UnhandledException::Handle(UnhandledException::New(
+          Instance::Cast(result), Stacktrace::Handle(zone)));
   set_preallocated_unhandled_exception(unhandled_exception);
 
-  const Array& code_array = Array::Handle(zone,
-      Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld));
-  const Array& pc_offset_array = Array::Handle(zone,
-      Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld));
-  const Stacktrace& stack_trace = Stacktrace::Handle(zone,
-      Stacktrace::New(code_array, pc_offset_array));
+  const Array& code_array = Array::Handle(
+      zone, Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld));
+  const Array& pc_offset_array = Array::Handle(
+      zone, Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld));
+  const Stacktrace& stack_trace =
+      Stacktrace::Handle(zone, Stacktrace::New(code_array, pc_offset_array));
   // Expansion of inlined functions requires additional memory at run time,
   // avoid it.
   stack_trace.set_expand_inlined(false);
@@ -240,7 +237,7 @@
   ASSERT(!cls.IsNull());
   set_stream_iterator_class(cls);
 
-  const Library& internal_lib = Library::Handle(internal_library());
+  const Library& internal_lib = Library::Handle(_internal_library());
   cls = internal_lib.LookupClass(Symbols::Symbol());
   set_symbol_class(cls);
 
diff --git a/runtime/vm/object_store.h b/runtime/vm/object_store.h
index 33c25ec..8be015e 100644
--- a/runtime/vm/object_store.h
+++ b/runtime/vm/object_store.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_OBJECT_STORE_H_
-#define VM_OBJECT_STORE_H_
+#ifndef RUNTIME_VM_OBJECT_STORE_H_
+#define RUNTIME_VM_OBJECT_STORE_H_
 
 #include "vm/object.h"
 
@@ -13,6 +13,32 @@
 class Isolate;
 class ObjectPointerVisitor;
 
+// A list of the bootstrap libraries including CamelName and name.
+//
+// These are listed in the order that they are compiled (see vm/bootstrap.cc).
+#define FOR_EACH_PRODUCT_LIBRARY(M)                                            \
+  M(Core, core)                                                                \
+  M(Async, async)                                                              \
+  M(Collection, collection)                                                    \
+  M(Convert, convert)                                                          \
+  M(Developer, developer)                                                      \
+  M(Internal, _internal)                                                       \
+  M(Isolate, isolate)                                                          \
+  M(Math, math)                                                                \
+  M(Profiler, profiler)                                                        \
+  M(TypedData, typed_data)                                                     \
+  M(VMService, _vmservice)
+
+#ifdef PRODUCT
+#define FOR_EACH_BOOTSTRAP_LIBRARY(M) FOR_EACH_PRODUCT_LIBRARY(M)
+
+#else
+#define FOR_EACH_BOOTSTRAP_LIBRARY(M)                                          \
+  FOR_EACH_PRODUCT_LIBRARY(M)                                                  \
+  M(Mirrors, mirrors)
+
+#endif
+
 // The object store is a per isolate instance which stores references to
 // objects used by the VM.
 // TODO(iposva): Move the actual store into the object heap for quick handling
@@ -20,19 +46,10 @@
 class ObjectStore {
  public:
   enum BootstrapLibraryId {
-    kNone = 0,
-    kAsync,
-    kCore,
-    kCollection,
-    kConvert,
-    kDeveloper,
-    kInternal,
-    kIsolate,
-    kMath,
-    kMirrors,
-    kProfiler,
-    kTypedData,
-    kVMService,
+#define MAKE_ID(Name, _) k##Name,
+
+    FOR_EACH_BOOTSTRAP_LIBRARY(MAKE_ID)
+#undef MAKE_ID
   };
 
   ~ObjectStore();
@@ -47,9 +64,7 @@
   }
 
   RawType* object_type() const { return object_type_; }
-  void set_object_type(const Type& value) {
-    object_type_ = value.raw();
-  }
+  void set_object_type(const Type& value) { object_type_ = value.raw(); }
 
   RawClass* null_class() const {
     ASSERT(null_class_ != Object::null());
@@ -58,28 +73,21 @@
   void set_null_class(const Class& value) { null_class_ = value.raw(); }
 
   RawType* null_type() const { return null_type_; }
-  void set_null_type(const Type& value) {
-    null_type_ = value.raw();
-  }
+  void set_null_type(const Type& value) { null_type_ = value.raw(); }
 
   RawType* function_type() const { return function_type_; }
-  void set_function_type(const Type& value) {
-    function_type_ = value.raw();
-  }
+  void set_function_type(const Type& value) { function_type_ = value.raw(); }
 
   RawClass* closure_class() const { return closure_class_; }
-  void set_closure_class(const Class& value) {
-    closure_class_ = value.raw();
-  }
+  void set_closure_class(const Class& value) { closure_class_ = value.raw(); }
 
   RawType* number_type() const { return number_type_; }
-  void set_number_type(const Type& value) {
-    number_type_ = value.raw();
-  }
+  void set_number_type(const Type& value) { number_type_ = value.raw(); }
 
   RawType* int_type() const { return int_type_; }
-  void set_int_type(const Type& value) {
-    int_type_ = value.raw();
+  void set_int_type(const Type& value) { int_type_ = value.raw(); }
+  static intptr_t int_type_offset() {
+    return OFFSET_OF(ObjectStore, int_type_);
   }
 
   RawClass* integer_implementation_class() const {
@@ -93,14 +101,16 @@
   void set_smi_class(const Class& value) { smi_class_ = value.raw(); }
 
   RawType* smi_type() const { return smi_type_; }
-  void set_smi_type(const Type& value) { smi_type_ = value.raw();
-  }
+  void set_smi_type(const Type& value) { smi_type_ = value.raw(); }
 
   RawClass* double_class() const { return double_class_; }
   void set_double_class(const Class& value) { double_class_ = value.raw(); }
 
   RawType* double_type() const { return double_type_; }
   void set_double_type(const Type& value) { double_type_ = value.raw(); }
+  static intptr_t double_type_offset() {
+    return OFFSET_OF(ObjectStore, double_type_);
+  }
 
   RawClass* mint_class() const { return mint_class_; }
   void set_mint_class(const Class& value) { mint_class_ = value.raw(); }
@@ -112,21 +122,18 @@
   void set_bigint_class(const Class& value) { bigint_class_ = value.raw(); }
 
   RawType* string_type() const { return string_type_; }
-  void set_string_type(const Type& value) {
-    string_type_ = value.raw();
+  void set_string_type(const Type& value) { string_type_ = value.raw(); }
+  static intptr_t string_type_offset() {
+    return OFFSET_OF(ObjectStore, string_type_);
   }
 
-  RawClass* compiletime_error_class() const {
-    return compiletime_error_class_;
-  }
+  RawClass* compiletime_error_class() const { return compiletime_error_class_; }
   void set_compiletime_error_class(const Class& value) {
     compiletime_error_class_ = value.raw();
   }
 
   RawClass* future_class() const { return future_class_; }
-  void set_future_class(const Class& value) {
-    future_class_ = value.raw();
-  }
+  void set_future_class(const Class& value) { future_class_ = value.raw(); }
 
   RawClass* completer_class() const { return completer_class_; }
   void set_completer_class(const Class& value) {
@@ -139,9 +146,7 @@
   }
 
   RawClass* symbol_class() { return symbol_class_; }
-  void set_symbol_class(const Class& value) {
-    symbol_class_ = value.raw();
-  }
+  void set_symbol_class(const Class& value) { symbol_class_ = value.raw(); }
 
   RawClass* one_byte_string_class() const { return one_byte_string_class_; }
   void set_one_byte_string_class(const Class& value) {
@@ -197,16 +202,12 @@
     return OFFSET_OF(ObjectStore, growable_object_array_class_);
   }
 
-  RawClass* linked_hash_map_class() const {
-    return linked_hash_map_class_;
-  }
+  RawClass* linked_hash_map_class() const { return linked_hash_map_class_; }
   void set_linked_hash_map_class(const Class& value) {
     linked_hash_map_class_ = value.raw();
   }
 
-  RawClass* float32x4_class() const {
-    return float32x4_class_;
-  }
+  RawClass* float32x4_class() const { return float32x4_class_; }
   void set_float32x4_class(const Class& value) {
     float32x4_class_ = value.raw();
   }
@@ -214,19 +215,13 @@
   RawType* float32x4_type() const { return float32x4_type_; }
   void set_float32x4_type(const Type& value) { float32x4_type_ = value.raw(); }
 
-  RawClass* int32x4_class() const {
-    return int32x4_class_;
-  }
-  void set_int32x4_class(const Class& value) {
-    int32x4_class_ = value.raw();
-  }
+  RawClass* int32x4_class() const { return int32x4_class_; }
+  void set_int32x4_class(const Class& value) { int32x4_class_ = value.raw(); }
 
   RawType* int32x4_type() const { return int32x4_type_; }
   void set_int32x4_type(const Type& value) { int32x4_type_ = value.raw(); }
 
-  RawClass* float64x2_class() const {
-    return float64x2_class_;
-  }
+  RawClass* float64x2_class() const { return float64x2_class_; }
   void set_float64x2_class(const Class& value) {
     float64x2_class_ = value.raw();
   }
@@ -234,19 +229,13 @@
   RawType* float64x2_type() const { return float64x2_type_; }
   void set_float64x2_type(const Type& value) { float64x2_type_ = value.raw(); }
 
-  RawClass* error_class() const {
-    return error_class_;
-  }
-  void set_error_class(const Class& value) {
-    error_class_ = value.raw();
-  }
+  RawClass* error_class() const { return error_class_; }
+  void set_error_class(const Class& value) { error_class_ = value.raw(); }
   static intptr_t error_class_offset() {
     return OFFSET_OF(ObjectStore, error_class_);
   }
 
-  RawClass* weak_property_class() const {
-    return weak_property_class_;
-  }
+  RawClass* weak_property_class() const { return weak_property_class_; }
   void set_weak_property_class(const Class& value) {
     weak_property_class_ = value.raw();
   }
@@ -254,9 +243,7 @@
   RawArray* symbol_table() const { return symbol_table_; }
   void set_symbol_table(const Array& value) { symbol_table_ = value.raw(); }
 
-  RawArray* canonical_types() const {
-    return canonical_types_;
-  }
+  RawArray* canonical_types() const { return canonical_types_; }
   void set_canonical_types(const Array& value) {
     canonical_types_ = value.raw();
   }
@@ -268,58 +255,36 @@
     canonical_type_arguments_ = value.raw();
   }
 
-  RawLibrary* async_library() const { return async_library_; }
-  RawLibrary* builtin_library() const { return builtin_library_; }
-  RawLibrary* core_library() const { return core_library_; }
-  RawLibrary* collection_library() const { return collection_library_; }
-  RawLibrary* convert_library() const { return convert_library_; }
-  RawLibrary* developer_library() const { return developer_library_; }
-  RawLibrary* internal_library() const { return internal_library_; }
-  RawLibrary* isolate_library() const { return isolate_library_; }
-  RawLibrary* math_library() const { return math_library_; }
-  RawLibrary* mirrors_library() const { return mirrors_library_; }
-  RawLibrary* profiler_library() const { return profiler_library_; }
-  RawLibrary* typed_data_library() const { return typed_data_library_; }
-  RawLibrary* vmservice_library() const { return vmservice_library_; }
+#define MAKE_GETTER(_, name)                                                   \
+  RawLibrary* name##_library() const { return name##_library_; }
+
+  FOR_EACH_BOOTSTRAP_LIBRARY(MAKE_GETTER)
+#undef MAKE_GETTER
+
+  RawLibrary* bootstrap_library(BootstrapLibraryId index) {
+    switch (index) {
+#define MAKE_CASE(CamelName, name)                                             \
+  case k##CamelName:                                                           \
+    return name##_library_;
+
+      FOR_EACH_BOOTSTRAP_LIBRARY(MAKE_CASE)
+#undef MAKE_CASE
+
+      default:
+        UNREACHABLE();
+        return Library::null();
+    }
+  }
 
   void set_bootstrap_library(BootstrapLibraryId index, const Library& value) {
     switch (index) {
-      case kAsync:
-        async_library_ = value.raw();
-        break;
-      case kCore:
-        core_library_ = value.raw();
-        break;
-      case kCollection:
-        collection_library_ = value.raw();
-        break;
-      case kConvert:
-        convert_library_ = value.raw();
-        break;
-      case kDeveloper:
-        developer_library_ = value.raw();
-        break;
-      case kInternal:
-        internal_library_ = value.raw();
-        break;
-      case kIsolate:
-        isolate_library_ = value.raw();
-        break;
-      case kMath:
-        math_library_ = value.raw();
-        break;
-      case kMirrors:
-        mirrors_library_ = value.raw();
-        break;
-      case kProfiler:
-        profiler_library_ = value.raw();
-        break;
-      case kTypedData:
-        typed_data_library_ = value.raw();
-        break;
-      case kVMService:
-        vmservice_library_ = value.raw();
-        break;
+#define MAKE_CASE(CamelName, name)                                             \
+  case k##CamelName:                                                           \
+    name##_library_ = value.raw();                                             \
+    break;
+
+      FOR_EACH_BOOTSTRAP_LIBRARY(MAKE_CASE)
+#undef MAKE_CASE
       default:
         UNREACHABLE();
     }
@@ -337,9 +302,7 @@
   }
 
   RawLibrary* root_library() const { return root_library_; }
-  void set_root_library(const Library& value) {
-    root_library_ = value.raw();
-  }
+  void set_root_library(const Library& value) { root_library_ = value.raw(); }
 
   RawGrowableObjectArray* libraries() const { return libraries_; }
   void set_libraries(const GrowableObjectArray& value) {
@@ -347,9 +310,7 @@
   }
 
   RawArray* libraries_map() const { return libraries_map_; }
-  void set_libraries_map(const Array& value) {
-    libraries_map_ = value.raw();
-  }
+  void set_libraries_map(const Array& value) { libraries_map_ = value.raw(); }
 
   RawGrowableObjectArray* closure_functions() const {
     return closure_functions_;
@@ -376,18 +337,12 @@
     return resume_capabilities_;
   }
 
-  RawGrowableObjectArray* exit_listeners() const {
-    return exit_listeners_;
-  }
+  RawGrowableObjectArray* exit_listeners() const { return exit_listeners_; }
 
-  RawGrowableObjectArray* error_listeners() const {
-    return error_listeners_;
-  }
+  RawGrowableObjectArray* error_listeners() const { return error_listeners_; }
 
   RawContext* empty_context() const { return empty_context_; }
-  void set_empty_context(const Context& value) {
-    empty_context_ = value.raw();
-  }
+  void set_empty_context(const Context& value) { empty_context_ = value.raw(); }
 
   RawInstance* stack_overflow() const { return stack_overflow_; }
   void set_stack_overflow(const Instance& value) {
@@ -413,16 +368,12 @@
     preallocated_stack_trace_ = value.raw();
   }
 
-  RawFunction* lookup_port_handler() const {
-    return lookup_port_handler_;
-  }
+  RawFunction* lookup_port_handler() const { return lookup_port_handler_; }
   void set_lookup_port_handler(const Function& function) {
     lookup_port_handler_ = function.raw();
   }
 
-  RawTypedData* empty_uint32_array() const {
-    return empty_uint32_array_;
-  }
+  RawTypedData* empty_uint32_array() const { return empty_uint32_array_; }
   void set_empty_uint32_array(const TypedData& array) {
     // Only set once.
     ASSERT(empty_uint32_array_ == TypedData::null());
@@ -447,23 +398,17 @@
     return OFFSET_OF(ObjectStore, library_load_error_table_);
   }
 
-  RawArray* unique_dynamic_targets() const {
-    return unique_dynamic_targets_;
-  }
+  RawArray* unique_dynamic_targets() const { return unique_dynamic_targets_; }
   void set_unique_dynamic_targets(const Array& value) {
     unique_dynamic_targets_ = value.raw();
   }
 
-  RawGrowableObjectArray* token_objects() const {
-    return token_objects_;
-  }
+  RawGrowableObjectArray* token_objects() const { return token_objects_; }
   void set_token_objects(const GrowableObjectArray& value) {
     token_objects_ = value.raw();
   }
 
-  RawArray* token_objects_map() const {
-    return token_objects_map_;
-  }
+  RawArray* token_objects_map() const { return token_objects_map_; }
   void set_token_objects_map(const Array& value) {
     token_objects_map_ = value.raw();
   }
@@ -474,9 +419,7 @@
   void set_megamorphic_cache_table(const GrowableObjectArray& value) {
     megamorphic_cache_table_ = value.raw();
   }
-  RawCode* megamorphic_miss_code() const {
-    return megamorphic_miss_code_;
-  }
+  RawCode* megamorphic_miss_code() const { return megamorphic_miss_code_; }
   RawFunction* megamorphic_miss_function() const {
     return megamorphic_miss_function_;
   }
@@ -569,7 +512,7 @@
   V(RawLibrary*, collection_library_)                                          \
   V(RawLibrary*, convert_library_)                                             \
   V(RawLibrary*, developer_library_)                                           \
-  V(RawLibrary*, internal_library_)                                            \
+  V(RawLibrary*, _internal_library_)                                           \
   V(RawLibrary*, isolate_library_)                                             \
   V(RawLibrary*, math_library_)                                                \
   V(RawLibrary*, mirrors_library_)                                             \
@@ -577,7 +520,7 @@
   V(RawLibrary*, profiler_library_)                                            \
   V(RawLibrary*, root_library_)                                                \
   V(RawLibrary*, typed_data_library_)                                          \
-  V(RawLibrary*, vmservice_library_)                                           \
+  V(RawLibrary*, _vmservice_library_)                                          \
   V(RawGrowableObjectArray*, libraries_)                                       \
   V(RawArray*, libraries_map_)                                                 \
   V(RawGrowableObjectArray*, closure_functions_)                               \
@@ -607,9 +550,8 @@
   // Please remember the last entry must be referred in the 'to' function below.
 
   RawObject** from() { return reinterpret_cast<RawObject**>(&object_class_); }
-#define DECLARE_OBJECT_STORE_FIELD(type, name)                                 \
-  type name;
-OBJECT_STORE_FIELD_LIST(DECLARE_OBJECT_STORE_FIELD)
+#define DECLARE_OBJECT_STORE_FIELD(type, name) type name;
+  OBJECT_STORE_FIELD_LIST(DECLARE_OBJECT_STORE_FIELD)
 #undef DECLARE_OBJECT_STORE_FIELD
   RawObject** to() {
     return reinterpret_cast<RawObject**>(&megamorphic_miss_function_);
@@ -639,4 +581,4 @@
 
 }  // namespace dart
 
-#endif  // VM_OBJECT_STORE_H_
+#endif  // RUNTIME_VM_OBJECT_STORE_H_
diff --git a/runtime/vm/object_test.cc b/runtime/vm/object_test.cc
index 73e2d70..c0ac1ad 100644
--- a/runtime/vm/object_test.cc
+++ b/runtime/vm/object_test.cc
@@ -62,14 +62,14 @@
   Function& function = Function::Handle();
   String& function_name = String::Handle();
   function_name = Symbols::New(thread, "foo");
-  function = Function::New(
-      function_name, RawFunction::kRegularFunction,
-      false, false, false, false, false, cls, TokenPosition::kMinSource);
+  function =
+      Function::New(function_name, RawFunction::kRegularFunction, false, false,
+                    false, false, false, cls, TokenPosition::kMinSource);
   functions.SetAt(0, function);
   function_name = Symbols::New(thread, "bar");
-  function = Function::New(
-      function_name, RawFunction::kRegularFunction,
-      false, false, false, false, false, cls, TokenPosition::kMinSource);
+  function =
+      Function::New(function_name, RawFunction::kRegularFunction, false, false,
+                    false, false, false, cls, TokenPosition::kMinSource);
 
   const int kNumFixedParameters = 2;
   const int kNumOptionalParameters = 3;
@@ -80,26 +80,26 @@
   functions.SetAt(1, function);
 
   function_name = Symbols::New(thread, "baz");
-  function = Function::New(
-      function_name, RawFunction::kRegularFunction,
-      false, false, false, false, false, cls, TokenPosition::kMinSource);
+  function =
+      Function::New(function_name, RawFunction::kRegularFunction, false, false,
+                    false, false, false, cls, TokenPosition::kMinSource);
   functions.SetAt(2, function);
 
   function_name = Symbols::New(thread, "Foo");
-  function = Function::New(
-      function_name, RawFunction::kRegularFunction,
-      true, false, false, false, false, cls, TokenPosition::kMinSource);
+  function =
+      Function::New(function_name, RawFunction::kRegularFunction, true, false,
+                    false, false, false, cls, TokenPosition::kMinSource);
 
   functions.SetAt(3, function);
   function_name = Symbols::New(thread, "Bar");
-  function = Function::New(
-      function_name, RawFunction::kRegularFunction,
-      true, false, false, false, false, cls, TokenPosition::kMinSource);
+  function =
+      Function::New(function_name, RawFunction::kRegularFunction, true, false,
+                    false, false, false, cls, TokenPosition::kMinSource);
   functions.SetAt(4, function);
   function_name = Symbols::New(thread, "BaZ");
-  function = Function::New(
-      function_name, RawFunction::kRegularFunction,
-      true, false, false, false, false, cls, TokenPosition::kMinSource);
+  function =
+      Function::New(function_name, RawFunction::kRegularFunction, true, false,
+                    false, false, false, cls, TokenPosition::kMinSource);
   functions.SetAt(5, function);
 
   // Setup the functions in the class.
@@ -142,12 +142,12 @@
 VM_TEST_CASE(TypeArguments) {
   const Type& type1 = Type::Handle(Type::Double());
   const Type& type2 = Type::Handle(Type::StringType());
-  const TypeArguments& type_arguments1 = TypeArguments::Handle(
-    TypeArguments::New(2));
+  const TypeArguments& type_arguments1 =
+      TypeArguments::Handle(TypeArguments::New(2));
   type_arguments1.SetTypeAt(0, type1);
   type_arguments1.SetTypeAt(1, type2);
-  const TypeArguments& type_arguments2 = TypeArguments::Handle(
-    TypeArguments::New(2));
+  const TypeArguments& type_arguments2 =
+      TypeArguments::Handle(TypeArguments::New(2));
   type_arguments2.SetTypeAt(0, type1);
   type_arguments2.SetTypeAt(1, type2);
   EXPECT_NE(type_arguments1.raw(), type_arguments2.raw());
@@ -165,8 +165,8 @@
   Zone* zone = Thread::Current()->zone();
   String& source = String::Handle(zone, String::New("= ( 9 , ."));
   String& private_key = String::Handle(zone, String::New(""));
-  const TokenStream& token_stream = TokenStream::Handle(
-      zone, TokenStream::New(source, private_key, false));
+  const TokenStream& token_stream =
+      TokenStream::Handle(zone, TokenStream::New(source, private_key, false));
   TokenStream::Iterator iterator(zone, token_stream, TokenPosition::kMinSource);
   iterator.Advance();  // Advance to '(' token.
   EXPECT_EQ(Token::kLPAREN, iterator.CurrentTokenKind());
@@ -182,36 +182,35 @@
 VM_TEST_CASE(GenerateExactSource) {
   // Verify the exact formatting of generated sources.
   const char* kScriptChars =
-  "\n"
-  "class A {\n"
-  "  static bar() { return 42; }\n"
-  "  static fly() { return 5; }\n"
-  "  void catcher(x) {\n"
-  "    try {\n"
-  "      if (x is! List) {\n"
-  "        for (int i = 0; i < x; i++) {\n"
-  "          fly();\n"
-  "          ++i;\n"
-  "        }\n"
-  "      } else {\n"
-  "        for (int i = 0; i < x; i--) {\n"
-  "          !fly();\n"
-  "          --i;\n"
-  "        }\n"
-  "      }\n"
-  "    } on Blah catch (a) {\n"
-  "      _print(17);\n"
-  "    } catch (e, s) {\n"
-  "      bar()\n"
-  "    }\n"
-  "  }\n"
-  "}\n";
+      "\n"
+      "class A {\n"
+      "  static bar() { return 42; }\n"
+      "  static fly() { return 5; }\n"
+      "  void catcher(x) {\n"
+      "    try {\n"
+      "      if (x is! List) {\n"
+      "        for (int i = 0; i < x; i++) {\n"
+      "          fly();\n"
+      "          ++i;\n"
+      "        }\n"
+      "      } else {\n"
+      "        for (int i = 0; i < x; i--) {\n"
+      "          !fly();\n"
+      "          --i;\n"
+      "        }\n"
+      "      }\n"
+      "    } on Blah catch (a) {\n"
+      "      _print(17);\n"
+      "    } catch (e, s) {\n"
+      "      bar()\n"
+      "    }\n"
+      "  }\n"
+      "}\n";
 
   String& url = String::Handle(String::New("dart-test:GenerateExactSource"));
   String& source = String::Handle(String::New(kScriptChars));
-  Script& script = Script::Handle(Script::New(url,
-                                              source,
-                                              RawScript::kScriptTag));
+  Script& script =
+      Script::Handle(Script::New(url, source, RawScript::kScriptTag));
   script.Tokenize(String::Handle(String::New("")));
   const TokenStream& tokens = TokenStream::Handle(script.tokens());
   const String& gen_source = String::Handle(tokens.GenerateSource());
@@ -221,23 +220,23 @@
 
 TEST_CASE(Class_ComputeEndTokenPos) {
   const char* kScript =
-  "\n"
-  "class A {\n"
-  "  /**\n"
-  "   * Description of foo().\n"
-  "   */\n"
-  "  foo(a) { return '''\"}'''; }\n"
-  "  // }\n"
-  "  var bar = '\\'}';\n"
-  "  var baz = \"${foo('}')}\";\n"
-  "}\n";
+      "\n"
+      "class A {\n"
+      "  /**\n"
+      "   * Description of foo().\n"
+      "   */\n"
+      "  foo(a) { return '''\"}'''; }\n"
+      "  // }\n"
+      "  var bar = '\\'}';\n"
+      "  var baz = \"${foo('}')}\";\n"
+      "}\n";
   Dart_Handle lib_h = TestCase::LoadTestScript(kScript, NULL);
   EXPECT_VALID(lib_h);
   Library& lib = Library::Handle();
   lib ^= Api::UnwrapHandle(lib_h);
   EXPECT(!lib.IsNull());
-  const Class& cls = Class::Handle(
-      lib.LookupClass(String::Handle(String::New("A"))));
+  const Class& cls =
+      Class::Handle(lib.LookupClass(String::Handle(String::New("A"))));
   EXPECT(!cls.IsNull());
   const TokenPosition end_token_pos = cls.ComputeEndTokenPos();
   const Script& scr = Script::Handle(cls.script());
@@ -313,7 +312,7 @@
   EXPECT(Smi::IsValid(0));
   EXPECT(Smi::IsValid(-15));
   EXPECT(Smi::IsValid(0xFFu));
-  // Upper two bits must be either 00 or 11.
+// Upper two bits must be either 00 or 11.
 #if defined(ARCH_IS_64_BIT)
   EXPECT(!Smi::IsValid(kMaxInt64));
   EXPECT(Smi::IsValid(0x3FFFFFFFFFFFFFFF));
@@ -345,10 +344,9 @@
   EXPECT_EQ(-1, c.CompareWith(mint1));
   EXPECT_EQ(1, c.CompareWith(mint2));
 
-  Bigint& big1 = Bigint::Handle(Bigint::NewFromCString(
-      "10000000000000000000"));
-  Bigint& big2 = Bigint::Handle(Bigint::NewFromCString(
-      "-10000000000000000000"));
+  Bigint& big1 = Bigint::Handle(Bigint::NewFromCString("10000000000000000000"));
+  Bigint& big2 =
+      Bigint::Handle(Bigint::NewFromCString("-10000000000000000000"));
   EXPECT_EQ(-1, a.CompareWith(big1));
   EXPECT_EQ(1, a.CompareWith(big2));
   EXPECT_EQ(-1, c.CompareWith(big1));
@@ -365,14 +363,13 @@
   EXPECT(abce.CompareTo(abcd) > 0);
 
   const int kMonkeyLen = 4;
-  const uint8_t monkey_utf8[kMonkeyLen] = { 0xf0, 0x9f, 0x90, 0xb5 };
+  const uint8_t monkey_utf8[kMonkeyLen] = {0xf0, 0x9f, 0x90, 0xb5};
   const String& monkey_face =
       String::Handle(String::FromUTF8(monkey_utf8, kMonkeyLen));
   const int kDogLen = 4;
   // 0x1f436 DOG FACE.
-  const uint8_t dog_utf8[kDogLen] = { 0xf0, 0x9f, 0x90, 0xb6 };
-  const String& dog_face =
-      String::Handle(String::FromUTF8(dog_utf8, kDogLen));
+  const uint8_t dog_utf8[kDogLen] = {0xf0, 0x9f, 0x90, 0xb6};
+  const String& dog_face = String::Handle(String::FromUTF8(dog_utf8, kDogLen));
   EXPECT_EQ(0, monkey_face.CompareTo(monkey_face));
   EXPECT_EQ(0, dog_face.CompareTo(dog_face));
   EXPECT(monkey_face.CompareTo(dog_face) < 0);
@@ -380,7 +377,7 @@
 
   const int kDominoLen = 4;
   // 0x1f036 DOMINO TILE HORIZONTAL-00-05.
-  const uint8_t domino_utf8[kDominoLen] = { 0xf0, 0x9f, 0x80, 0xb6 };
+  const uint8_t domino_utf8[kDominoLen] = {0xf0, 0x9f, 0x80, 0xb6};
   const String& domino =
       String::Handle(String::FromUTF8(domino_utf8, kDominoLen));
   EXPECT_EQ(0, domino.CompareTo(domino));
@@ -442,11 +439,11 @@
 
 VM_TEST_CASE(StringIRITwoByte) {
   const intptr_t kInputLen = 3;
-  const uint16_t kInput[kInputLen] = { 'x', '/', 256 };
+  const uint16_t kInput[kInputLen] = {'x', '/', 256};
   const String& input = String::Handle(String::FromUTF16(kInput, kInputLen));
   const intptr_t kOutputLen = 10;
-  const uint16_t kOutput[kOutputLen] =
-      { 'x', '%', '2', 'F', '%', 'C', '4', '%', '8', '0' };
+  const uint16_t kOutput[kOutputLen] = {'x', '%', '2', 'F', '%',
+                                        'C', '4', '%', '8', '0'};
   const String& output = String::Handle(String::FromUTF16(kOutput, kOutputLen));
   const String& encoded = String::Handle(String::New(String::EncodeIRI(input)));
   EXPECT(output.Equals(encoded));
@@ -459,7 +456,8 @@
 // On 64-bit architectures a Smi is stored in a 64 bit word. A Midint cannot
 // be allocated if it does fit into a Smi.
 #if !defined(ARCH_IS_64_BIT)
-  { Mint& med = Mint::Handle();
+  {
+    Mint& med = Mint::Handle();
     EXPECT(med.IsNull());
     int64_t v = DART_2PART_UINT64_C(1, 0);
     med ^= Integer::New(v);
@@ -507,10 +505,9 @@
   EXPECT_EQ(-1, c.CompareWith(smi1));
   EXPECT_EQ(-1, c.CompareWith(smi2));
 
-  Bigint& big1 = Bigint::Handle(Bigint::NewFromCString(
-      "10000000000000000000"));
-  Bigint& big2 = Bigint::Handle(Bigint::NewFromCString(
-      "-10000000000000000000"));
+  Bigint& big1 = Bigint::Handle(Bigint::NewFromCString("10000000000000000000"));
+  Bigint& big2 =
+      Bigint::Handle(Bigint::NewFromCString("-10000000000000000000"));
   EXPECT_EQ(-1, a.CompareWith(big1));
   EXPECT_EQ(1, a.CompareWith(big2));
   EXPECT_EQ(-1, c.CompareWith(big1));
@@ -586,10 +583,10 @@
     EXPECT(nan0.IsIdenticalTo(nan0));
     EXPECT(nan0.CanonicalizeEquals(nan0));
     EXPECT(!nan0.OperatorEquals(nan0));
-    const Double& nan1 = Double::Handle(
-        Double::New(bit_cast<double>(kMaxUint64 - 0)));
-    const Double& nan2 = Double::Handle(
-        Double::New(bit_cast<double>(kMaxUint64 - 1)));
+    const Double& nan1 =
+        Double::Handle(Double::New(bit_cast<double>(kMaxUint64 - 0)));
+    const Double& nan2 =
+        Double::Handle(Double::New(bit_cast<double>(kMaxUint64 - 1)));
     EXPECT(isnan(nan1.value()));
     EXPECT(isnan(nan2.value()));
     EXPECT(!nan1.IsIdenticalTo(nan2));
@@ -628,12 +625,12 @@
   big = Bigint::NewFromCString("10000000000000000000");
   EXPECT_EQ(1e19, big.AsDoubleValue());
 
-  Bigint& big1 = Bigint::Handle(Bigint::NewFromCString(
-      "100000000000000000000"));
-  Bigint& big2 = Bigint::Handle(Bigint::NewFromCString(
-      "100000000000000000010"));
-  Bigint& big3 = Bigint::Handle(Bigint::NewFromCString(
-      "-10000000000000000000"));
+  Bigint& big1 =
+      Bigint::Handle(Bigint::NewFromCString("100000000000000000000"));
+  Bigint& big2 =
+      Bigint::Handle(Bigint::NewFromCString("100000000000000000010"));
+  Bigint& big3 =
+      Bigint::Handle(Bigint::NewFromCString("-10000000000000000000"));
 
   EXPECT_EQ(0, big1.CompareWith(big1));
   EXPECT_EQ(-1, big1.CompareWith(big2));
@@ -694,7 +691,7 @@
 
   const uint8_t* motto =
       reinterpret_cast<const uint8_t*>("Dart's bescht wos je hets gits");
-  const String& str2 = String::Handle(String::FromUTF8(motto+7, 4));
+  const String& str2 = String::Handle(String::FromUTF8(motto + 7, 4));
   EXPECT_EQ(4, str2.Length());
   EXPECT_EQ('b', str2.CharAt(0));
   EXPECT_EQ('e', str2.CharAt(1));
@@ -721,7 +718,7 @@
   EXPECT(empty1.Equals(empty2, 0, 0));
 
   const intptr_t kCharsLen = 8;
-  const uint8_t chars[kCharsLen] = { 1, 2, 127, 64, 92, 0, 55, 55 };
+  const uint8_t chars[kCharsLen] = {1, 2, 127, 64, 92, 0, 55, 55};
   const String& str8 = String::Handle(String::FromUTF8(chars, kCharsLen));
   EXPECT_EQ(kCharsLen, str8.Length());
   EXPECT_EQ(1, str8.CharAt(0));
@@ -740,9 +737,9 @@
   EXPECT_EQ(55, sub1.CharAt(4));
 
   const intptr_t kWideCharsLen = 7;
-  uint16_t wide_chars[kWideCharsLen] = { 'H', 'e', 'l', 'l', 'o', 256, '!' };
-  const String& two_str = String::Handle(String::FromUTF16(wide_chars,
-                                                           kWideCharsLen));
+  uint16_t wide_chars[kWideCharsLen] = {'H', 'e', 'l', 'l', 'o', 256, '!'};
+  const String& two_str =
+      String::Handle(String::FromUTF16(wide_chars, kWideCharsLen));
   EXPECT(two_str.IsInstance());
   EXPECT(two_str.IsString());
   EXPECT(two_str.IsTwoByteString());
@@ -766,7 +763,7 @@
     EXPECT_EQ(false, str1.StartsWith(str3));
   }
 
-  const int32_t four_chars[] = { 'C', 0xFF, 'h', 0xFFFF, 'a', 0x10FFFF, 'r' };
+  const int32_t four_chars[] = {'C', 0xFF, 'h', 0xFFFF, 'a', 0x10FFFF, 'r'};
   const String& four_str = String::Handle(String::FromUTF32(four_chars, 7));
   EXPECT_EQ(four_str.Hash(), four_str.Hash());
   EXPECT(four_str.IsTwoByteString());
@@ -783,7 +780,7 @@
 
   // Create a 1-byte string from an array of 2-byte elements.
   {
-    const uint16_t char16[] = { 0x00, 0x7F, 0xFF };
+    const uint16_t char16[] = {0x00, 0x7F, 0xFF};
     const String& str8 = String::Handle(String::FromUTF16(char16, 3));
     EXPECT(str8.IsOneByteString());
     EXPECT(!str8.IsTwoByteString());
@@ -794,7 +791,7 @@
 
   // Create a 1-byte string from an array of 4-byte elements.
   {
-    const int32_t char32[] = { 0x00, 0x1F, 0x7F };
+    const int32_t char32[] = {0x00, 0x1F, 0x7F};
     const String& str8 = String::Handle(String::FromUTF32(char32, 3));
     EXPECT(str8.IsOneByteString());
     EXPECT(!str8.IsTwoByteString());
@@ -805,7 +802,7 @@
 
   // Create a 2-byte string from an array of 4-byte elements.
   {
-    const int32_t char32[] = { 0, 0x7FFF, 0xFFFF };
+    const int32_t char32[] = {0, 0x7FFF, 0xFFFF};
     const String& str16 = String::Handle(String::FromUTF32(char32, 3));
     EXPECT(!str16.IsOneByteString());
     EXPECT(str16.IsTwoByteString());
@@ -1010,7 +1007,7 @@
     EXPECT(str1.IsOneByteString());
     EXPECT_EQ(0, str1.Length());
 
-    uint16_t two[] = { 0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9 };
+    uint16_t two[] = {0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9};
     intptr_t two_len = sizeof(two) / sizeof(two[0]);
     const String& str2 = String::Handle(String::FromUTF16(two, two_len));
     EXPECT(str2.IsTwoByteString());
@@ -1056,8 +1053,8 @@
     const String& str7 = String::Handle(String::ConcatAll(array3));
     EXPECT(str7.IsTwoByteString());
     EXPECT_EQ(two_len * 2, str7.Length());
-    uint16_t twotwo[] = { 0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9,
-                          0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9 };
+    uint16_t twotwo[] = {0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9,
+                         0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9};
     intptr_t twotwo_len = sizeof(twotwo) / sizeof(twotwo[0]);
     EXPECT(str7.IsTwoByteString());
     EXPECT(str7.Equals(twotwo, twotwo_len));
@@ -1065,13 +1062,13 @@
 
   // Concatenating non-empty 2-byte strings.
   {
-    const uint16_t one[] = { 0x05D0, 0x05D9, 0x05D9, 0x05DF };
+    const uint16_t one[] = {0x05D0, 0x05D9, 0x05D9, 0x05DF};
     intptr_t one_len = sizeof(one) / sizeof(one[0]);
     const String& str1 = String::Handle(String::FromUTF16(one, one_len));
     EXPECT(str1.IsTwoByteString());
     EXPECT_EQ(one_len, str1.Length());
 
-    const uint16_t two[] = { 0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9 };
+    const uint16_t two[] = {0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9};
     intptr_t two_len = sizeof(two) / sizeof(two[0]);
     const String& str2 = String::Handle(String::FromUTF16(two, two_len));
     EXPECT(str2.IsTwoByteString());
@@ -1081,16 +1078,16 @@
 
     const String& one_two_str = String::Handle(String::Concat(str1, str2));
     EXPECT(one_two_str.IsTwoByteString());
-    const uint16_t one_two[] = { 0x05D0, 0x05D9, 0x05D9, 0x05DF,
-                                 0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9 };
+    const uint16_t one_two[] = {0x05D0, 0x05D9, 0x05D9, 0x05DF, 0x05E6,
+                                0x05D5, 0x05D5, 0x05D9, 0x05D9};
     intptr_t one_two_len = sizeof(one_two) / sizeof(one_two[0]);
     EXPECT_EQ(one_two_len, one_two_str.Length());
     EXPECT(one_two_str.Equals(one_two, one_two_len));
 
     const String& two_one_str = String::Handle(String::Concat(str2, str1));
     EXPECT(two_one_str.IsTwoByteString());
-    const uint16_t two_one[] = { 0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9,
-                                 0x05D0, 0x05D9, 0x05D9, 0x05DF };
+    const uint16_t two_one[] = {0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9,
+                                0x05D0, 0x05D9, 0x05D9, 0x05DF};
     intptr_t two_one_len = sizeof(two_one) / sizeof(two_one[0]);
     EXPECT_EQ(two_one_len, two_one_str.Length());
     EXPECT(two_one_str.Equals(two_one, two_one_len));
@@ -1122,9 +1119,9 @@
     array3.SetAt(2, str1);
     const String& str5 = String::Handle(String::ConcatAll(array3));
     EXPECT(str5.IsTwoByteString());
-    const uint16_t one_two_one[] = { 0x05D0, 0x05D9, 0x05D9, 0x05DF,
-                                     0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9,
-                                     0x05D0, 0x05D9, 0x05D9, 0x05DF };
+    const uint16_t one_two_one[] = {0x05D0, 0x05D9, 0x05D9, 0x05DF, 0x05E6,
+                                    0x05D5, 0x05D5, 0x05D9, 0x05D9, 0x05D0,
+                                    0x05D9, 0x05D9, 0x05DF};
     intptr_t one_two_one_len = sizeof(one_two_one) / sizeof(one_two_one[0]);
     EXPECT_EQ(one_two_one_len, str5.Length());
     EXPECT(str5.Equals(one_two_one, one_two_one_len));
@@ -1136,9 +1133,9 @@
     array4.SetAt(2, str2);
     const String& str6 = String::Handle(String::ConcatAll(array4));
     EXPECT(str6.IsTwoByteString());
-    const uint16_t two_one_two[] = { 0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9,
-                                     0x05D0, 0x05D9, 0x05D9, 0x05DF,
-                                     0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9 };
+    const uint16_t two_one_two[] = {0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9,
+                                    0x05D0, 0x05D9, 0x05D9, 0x05DF, 0x05E6,
+                                    0x05D5, 0x05D5, 0x05D9, 0x05D9};
     intptr_t two_one_two_len = sizeof(two_one_two) / sizeof(two_one_two[0]);
     EXPECT_EQ(two_one_two_len, str6.Length());
     EXPECT(str6.Equals(two_one_two, two_one_two_len));
@@ -1150,7 +1147,7 @@
     EXPECT(str1.IsOneByteString());
     EXPECT_EQ(0, str1.Length());
 
-    int32_t four[] = { 0x1D4D5, 0x1D4DE, 0x1D4E4, 0x1D4E1 };
+    int32_t four[] = {0x1D4D5, 0x1D4DE, 0x1D4E4, 0x1D4E1};
     intptr_t four_len = sizeof(four) / sizeof(four[0]);
     intptr_t expected_len = (four_len * 2);
     const String& str2 = String::Handle(String::FromUTF32(four, four_len));
@@ -1195,8 +1192,8 @@
     array3.SetAt(2, str2);
     const String& str7 = String::Handle(String::ConcatAll(array3));
     EXPECT(str7.IsTwoByteString());
-    int32_t fourfour[] = { 0x1D4D5, 0x1D4DE, 0x1D4E4, 0x1D4E1,
-                           0x1D4D5, 0x1D4DE, 0x1D4E4, 0x1D4E1 };
+    int32_t fourfour[] = {0x1D4D5, 0x1D4DE, 0x1D4E4, 0x1D4E1,
+                          0x1D4D5, 0x1D4DE, 0x1D4E4, 0x1D4E1};
     intptr_t fourfour_len = sizeof(fourfour) / sizeof(fourfour[0]);
     EXPECT_EQ((fourfour_len * 2), str7.Length());
     const String& fourfour_str =
@@ -1206,13 +1203,13 @@
 
   // Concatenate non-empty strings built from 4-byte elements.
   {
-    const int32_t one[] = { 0x105D0, 0x105D9, 0x105D9, 0x105DF };
+    const int32_t one[] = {0x105D0, 0x105D9, 0x105D9, 0x105DF};
     intptr_t one_len = sizeof(one) / sizeof(one[0]);
     const String& onestr = String::Handle(String::FromUTF32(one, one_len));
     EXPECT(onestr.IsTwoByteString());
-    EXPECT_EQ((one_len *2), onestr.Length());
+    EXPECT_EQ((one_len * 2), onestr.Length());
 
-    const int32_t two[] = { 0x105E6, 0x105D5, 0x105D5, 0x105D9, 0x105D9 };
+    const int32_t two[] = {0x105E6, 0x105D5, 0x105D5, 0x105D9, 0x105D9};
     intptr_t two_len = sizeof(two) / sizeof(two[0]);
     const String& twostr = String::Handle(String::FromUTF32(two, two_len));
     EXPECT(twostr.IsTwoByteString());
@@ -1222,8 +1219,8 @@
 
     const String& str1 = String::Handle(String::Concat(onestr, twostr));
     EXPECT(str1.IsTwoByteString());
-    const int32_t one_two[] = { 0x105D0, 0x105D9, 0x105D9, 0x105DF,
-                                0x105E6, 0x105D5, 0x105D5, 0x105D9, 0x105D9 };
+    const int32_t one_two[] = {0x105D0, 0x105D9, 0x105D9, 0x105DF, 0x105E6,
+                               0x105D5, 0x105D5, 0x105D9, 0x105D9};
     intptr_t one_two_len = sizeof(one_two) / sizeof(one_two[0]);
     EXPECT_EQ((one_two_len * 2), str1.Length());
     const String& one_two_str =
@@ -1232,8 +1229,8 @@
 
     const String& str2 = String::Handle(String::Concat(twostr, onestr));
     EXPECT(str2.IsTwoByteString());
-    const int32_t two_one[] = { 0x105E6, 0x105D5, 0x105D5, 0x105D9, 0x105D9,
-                                0x105D0, 0x105D9, 0x105D9, 0x105DF };
+    const int32_t two_one[] = {0x105E6, 0x105D5, 0x105D5, 0x105D9, 0x105D9,
+                               0x105D0, 0x105D9, 0x105D9, 0x105DF};
     intptr_t two_one_len = sizeof(two_one) / sizeof(two_one[0]);
     EXPECT_EQ((two_one_len * 2), str2.Length());
     const String& two_one_str =
@@ -1267,10 +1264,9 @@
     array3.SetAt(2, onestr);
     const String& str5 = String::Handle(String::ConcatAll(array3));
     EXPECT(str5.IsTwoByteString());
-    const int32_t one_two_one[] = { 0x105D0, 0x105D9, 0x105D9, 0x105DF,
-                                    0x105E6, 0x105D5, 0x105D5, 0x105D9,
-                                    0x105D9,
-                                    0x105D0, 0x105D9, 0x105D9, 0x105DF };
+    const int32_t one_two_one[] = {0x105D0, 0x105D9, 0x105D9, 0x105DF, 0x105E6,
+                                   0x105D5, 0x105D5, 0x105D9, 0x105D9, 0x105D0,
+                                   0x105D9, 0x105D9, 0x105DF};
     intptr_t one_two_one_len = sizeof(one_two_one) / sizeof(one_two_one[0]);
     EXPECT_EQ((one_two_one_len * 2), str5.Length());
     const String& one_two_one_str =
@@ -1284,11 +1280,9 @@
     array4.SetAt(2, twostr);
     const String& str6 = String::Handle(String::ConcatAll(array4));
     EXPECT(str6.IsTwoByteString());
-    const int32_t two_one_two[] = { 0x105E6, 0x105D5, 0x105D5, 0x105D9,
-                                    0x105D9,
-                                    0x105D0, 0x105D9, 0x105D9, 0x105DF,
-                                    0x105E6, 0x105D5, 0x105D5, 0x105D9,
-                                    0x105D9 };
+    const int32_t two_one_two[] = {0x105E6, 0x105D5, 0x105D5, 0x105D9, 0x105D9,
+                                   0x105D0, 0x105D9, 0x105D9, 0x105DF, 0x105E6,
+                                   0x105D5, 0x105D5, 0x105D9, 0x105D9};
     intptr_t two_one_two_len = sizeof(two_one_two) / sizeof(two_one_two[0]);
     EXPECT_EQ((two_one_two_len * 2), str6.Length());
     const String& two_one_two_str =
@@ -1298,14 +1292,14 @@
 
   // Concatenate 1-byte strings and 2-byte strings.
   {
-    const uint8_t one[] = { 'o', 'n', 'e', ' ', 'b', 'y', 't', 'e' };
+    const uint8_t one[] = {'o', 'n', 'e', ' ', 'b', 'y', 't', 'e'};
     intptr_t one_len = sizeof(one) / sizeof(one[0]);
     const String& onestr = String::Handle(String::FromLatin1(one, one_len));
     EXPECT(onestr.IsOneByteString());
     EXPECT_EQ(one_len, onestr.Length());
     EXPECT(onestr.EqualsLatin1(one, one_len));
 
-    uint16_t two[] = { 0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9 };
+    uint16_t two[] = {0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9};
     intptr_t two_len = sizeof(two) / sizeof(two[0]);
     const String& twostr = String::Handle(String::FromUTF16(two, two_len));
     EXPECT(twostr.IsTwoByteString());
@@ -1316,16 +1310,16 @@
 
     const String& one_two_str = String::Handle(String::Concat(onestr, twostr));
     EXPECT(one_two_str.IsTwoByteString());
-    uint16_t one_two[] = { 'o', 'n', 'e', ' ', 'b', 'y', 't', 'e',
-                           0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9 };
+    uint16_t one_two[] = {'o', 'n',    'e',    ' ',    'b',    'y',   't',
+                          'e', 0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9};
     intptr_t one_two_len = sizeof(one_two) / sizeof(one_two[0]);
     EXPECT_EQ(one_two_len, one_two_str.Length());
     EXPECT(one_two_str.Equals(one_two, one_two_len));
 
     const String& two_one_str = String::Handle(String::Concat(twostr, onestr));
     EXPECT(two_one_str.IsTwoByteString());
-    uint16_t two_one[] = { 0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9,
-                           'o', 'n', 'e', ' ', 'b', 'y', 't', 'e' };
+    uint16_t two_one[] = {0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9, 'o', 'n',
+                          'e',    ' ',    'b',    'y',    't',    'e'};
     intptr_t two_one_len = sizeof(two_one) / sizeof(two_one[0]);
     EXPECT_EQ(two_one_len, two_one_str.Length());
     EXPECT(two_one_str.Equals(two_one, two_one_len));
@@ -1339,10 +1333,10 @@
     array1.SetAt(2, onestr);
     const String& one_two_one_str = String::Handle(String::ConcatAll(array1));
     EXPECT(one_two_one_str.IsTwoByteString());
-    EXPECT_EQ(onestr.Length()*2 + twostr.Length(), one_two_one_str.Length());
-    uint16_t one_two_one[] = { 'o', 'n', 'e', ' ', 'b', 'y', 't', 'e',
-                               0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9,
-                               'o', 'n', 'e', ' ', 'b', 'y', 't', 'e' };
+    EXPECT_EQ(onestr.Length() * 2 + twostr.Length(), one_two_one_str.Length());
+    uint16_t one_two_one[] = {'o', 'n',    'e',    ' ',    'b',    'y',    't',
+                              'e', 0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9, 'o',
+                              'n', 'e',    ' ',    'b',    'y',    't',    'e'};
     intptr_t one_two_one_len = sizeof(one_two_one) / sizeof(one_two_one[0]);
     EXPECT(one_two_one_str.Equals(one_two_one, one_two_one_len));
 
@@ -1353,10 +1347,10 @@
     array2.SetAt(2, twostr);
     const String& two_one_two_str = String::Handle(String::ConcatAll(array2));
     EXPECT(two_one_two_str.IsTwoByteString());
-    EXPECT_EQ(twostr.Length()*2 + onestr.Length(), two_one_two_str.Length());
-    uint16_t two_one_two[] = { 0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9,
-                               'o', 'n', 'e', ' ', 'b', 'y', 't', 'e',
-                               0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9 };
+    EXPECT_EQ(twostr.Length() * 2 + onestr.Length(), two_one_two_str.Length());
+    uint16_t two_one_two[] = {0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9, 'o',
+                              'n',    'e',    ' ',    'b',    'y',    't',
+                              'e',    0x05E6, 0x05D5, 0x05D5, 0x05D9, 0x05D9};
     intptr_t two_one_two_len = sizeof(two_one_two) / sizeof(two_one_two[0]);
     EXPECT(two_one_two_str.Equals(two_one_two, two_one_two_len));
   }
@@ -1367,22 +1361,21 @@
   EXPECT_EQ(String::Handle(String::New("onebyte")).Hash(),
             String::HashConcat(String::Handle(String::New("one")),
                                String::Handle(String::New("byte"))));
-  uint16_t clef_utf16[] = { 0xD834, 0xDD1E };
+  uint16_t clef_utf16[] = {0xD834, 0xDD1E};
   const String& clef = String::Handle(String::FromUTF16(clef_utf16, 2));
-  int32_t clef_utf32[] = { 0x1D11E };
+  int32_t clef_utf32[] = {0x1D11E};
   EXPECT(clef.Equals(clef_utf32, 1));
   intptr_t hash32 = String::Hash(clef_utf32, 1);
   EXPECT_EQ(hash32, clef.Hash());
   EXPECT_EQ(hash32, String::HashConcat(
-      String::Handle(String::FromUTF16(clef_utf16, 1)),
-      String::Handle(String::FromUTF16(clef_utf16 + 1, 1))));
+                        String::Handle(String::FromUTF16(clef_utf16, 1)),
+                        String::Handle(String::FromUTF16(clef_utf16 + 1, 1))));
 }
 
 
 VM_TEST_CASE(StringSubStringDifferentWidth) {
   // Create 1-byte substring from a 1-byte source string.
-  const char* onechars =
-      "\xC3\xB6\xC3\xB1\xC3\xA9";
+  const char* onechars = "\xC3\xB6\xC3\xB1\xC3\xA9";
 
   const String& onestr = String::Handle(String::New(onechars));
   EXPECT(!onestr.IsNull());
@@ -1470,18 +1463,14 @@
         "\xC3\xB8\xC3\xB9\xC3\xBA\xC3\xBB"
         "\xC3\xBC\xC3\xBD\xC3\xBE\xC3\xBF";
     const uint8_t expected[] = {
-      0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7,
-      0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF,
-      0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7,
-      0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF,
-      0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
-      0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,
-      0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7,
-      0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
-      0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
-      0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
-      0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
-      0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF,
+        0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB,
+        0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7,
+        0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, 0xC0, 0xC1, 0xC2, 0xC3,
+        0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,
+        0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB,
+        0xDC, 0xDD, 0xDE, 0xDF, 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
+        0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, 0xF3,
+        0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF,
     };
     const String& str = String::Handle(String::New(src));
     EXPECT(str.IsOneByteString());
@@ -1497,10 +1486,8 @@
     const char* src =
         "\xD7\x92\xD7\x9C\xD7\xA2\xD7\x93"
         "\xD7\x91\xD7\xA8\xD7\x9B\xD7\x94";
-    const uint16_t expected[] = {
-      0x5D2, 0x5DC, 0x5E2, 0x5D3,
-      0x5D1, 0x5E8, 0x5DB, 0x5D4
-    };
+    const uint16_t expected[] = {0x5D2, 0x5DC, 0x5E2, 0x5D3,
+                                 0x5D1, 0x5E8, 0x5DB, 0x5D4};
     const String& str = String::Handle(String::New(src));
     EXPECT(str.IsTwoByteString());
     intptr_t expected_size = sizeof(expected) / sizeof(expected[0]);
@@ -1522,10 +1509,9 @@
         "\x80\x80\xEC\x80\x80\xED\x80\x80"
         "\xEE\x80\x80\xEF\x80\x80";
     const intptr_t expected[] = {
-      0x000A, 0x000B, 0x000D, 0x000C, 0x000E, 0x000F, 0x00A0, 0x00B0,
-      0x00C0, 0x00D0, 0x00E0, 0x00F0, 0x0A00, 0x0B00, 0x0C00, 0x0D00,
-      0x0E00, 0x0F00, 0xA000, 0xB000, 0xC000, 0xD000, 0xE000, 0xF000
-    };
+        0x000A, 0x000B, 0x000D, 0x000C, 0x000E, 0x000F, 0x00A0, 0x00B0,
+        0x00C0, 0x00D0, 0x00E0, 0x00F0, 0x0A00, 0x0B00, 0x0C00, 0x0D00,
+        0x0E00, 0x0F00, 0xA000, 0xB000, 0xC000, 0xD000, 0xE000, 0xF000};
     const String& str = String::Handle(String::New(src));
     EXPECT(str.IsTwoByteString());
     intptr_t expected_size = sizeof(expected) / sizeof(expected[0]);
@@ -1541,8 +1527,8 @@
     const char* src =
         "\xF0\x9D\x91\xA0\xF0\x9D\x91\xA1"
         "\xF0\x9D\x91\xA2\xF0\x9D\x91\xA3";
-    const intptr_t expected[] = { 0xd835, 0xdc60, 0xd835, 0xdc61,
-                                  0xd835, 0xdc62, 0xd835, 0xdc63 };
+    const intptr_t expected[] = {0xd835, 0xdc60, 0xd835, 0xdc61,
+                                 0xd835, 0xdc62, 0xd835, 0xdc63};
     const String& str = String::Handle(String::New(src));
     EXPECT(str.IsTwoByteString());
     intptr_t expected_size = (sizeof(expected) / sizeof(expected[0]));
@@ -1564,9 +1550,9 @@
         "\xF0\x9B\x80\x80\xF0\x9D\x80\x80"
         "\xF0\x9E\x80\x80\xF0\x9F\x80\x80";
     const intptr_t expected[] = {
-      0x0A00, 0x0B00, 0x0C00, 0x0D00, 0x0E00, 0x0F00, 0xA000, 0xB000, 0xC000,
-      0xD000, 0xE000, 0xF000, 0xD828, 0xDC00, 0xD82c, 0xDC00, 0xD834, 0xDC00,
-      0xD838, 0xDC00, 0xD83c, 0xDC00,
+        0x0A00, 0x0B00, 0x0C00, 0x0D00, 0x0E00, 0x0F00, 0xA000, 0xB000,
+        0xC000, 0xD000, 0xE000, 0xF000, 0xD828, 0xDC00, 0xD82c, 0xDC00,
+        0xD834, 0xDC00, 0xD838, 0xDC00, 0xD83c, 0xDC00,
     };
     const String& str = String::Handle(String::New(src));
     EXPECT(str.IsTwoByteString());
@@ -1592,11 +1578,10 @@
         "\x80\x80\xF0\x9E\x80\x80\xF0\x9F"
         "\x80\x80";
     const intptr_t expected[] = {
-      0x000A, 0x000B, 0x000D, 0x000C, 0x000E, 0x000F, 0x00A0, 0x00B0,
-      0x00C0, 0x00D0, 0x00E0, 0x00F0, 0x0A00, 0x0B00, 0x0C00, 0x0D00,
-      0x0E00, 0x0F00, 0xA000, 0xB000, 0xC000, 0xD000, 0xE000, 0xF000,
-      0xD828, 0xDC00, 0xD82c, 0xDC00, 0xD834, 0xDC00, 0xD838, 0xDC00,
-      0xD83c, 0xDC00,
+        0x000A, 0x000B, 0x000D, 0x000C, 0x000E, 0x000F, 0x00A0, 0x00B0, 0x00C0,
+        0x00D0, 0x00E0, 0x00F0, 0x0A00, 0x0B00, 0x0C00, 0x0D00, 0x0E00, 0x0F00,
+        0xA000, 0xB000, 0xC000, 0xD000, 0xE000, 0xF000, 0xD828, 0xDC00, 0xD82c,
+        0xDC00, 0xD834, 0xDC00, 0xD838, 0xDC00, 0xD83c, 0xDC00,
     };
     const String& str = String::Handle(String::New(src));
     EXPECT(str.IsTwoByteString());
@@ -1635,8 +1620,9 @@
   EXPECT(!fourstr.Equals("\xF0\x90\x8E\xA0"));
   EXPECT(!fourstr.Equals("\xF0\x90\x8E\xA0\xF0\x90\x8E\xA1"));
   EXPECT(fourstr.Equals("\xF0\x90\x8E\xA0\xF0\x90\x8E\xA1\xF0\x90\x8E\xA2"));
-  EXPECT(!fourstr.Equals("\xF0\x90\x8E\xA0\xF0\x90\x8E\xA1"
-                         "\xF0\x90\x8E\xA2\xF0\x90\x8E\xA3"));
+  EXPECT(
+      !fourstr.Equals("\xF0\x90\x8E\xA0\xF0\x90\x8E\xA1"
+                      "\xF0\x90\x8E\xA2\xF0\x90\x8E\xA3"));
 }
 
 
@@ -1658,12 +1644,11 @@
 
 
 VM_TEST_CASE(ExternalOneByteString) {
-  uint8_t characters[] = { 0xF6, 0xF1, 0xE9 };
+  uint8_t characters[] = {0xF6, 0xF1, 0xE9};
   intptr_t len = ARRAY_SIZE(characters);
 
-  const String& str =
-      String::Handle(
-          ExternalOneByteString::New(characters, len, NULL, NULL, Heap::kNew));
+  const String& str = String::Handle(
+      ExternalOneByteString::New(characters, len, NULL, NULL, Heap::kNew));
   EXPECT(!str.IsOneByteString());
   EXPECT(str.IsExternalOneByteString());
   EXPECT_EQ(str.Length(), len);
@@ -1690,13 +1675,12 @@
 
 
 VM_TEST_CASE(EscapeSpecialCharactersOneByteString) {
-  uint8_t characters[] =
-      { 'a', '\n', '\f', '\b', '\t', '\v', '\r', '\\', '$', 'z' };
+  uint8_t characters[] = {'a',  '\n', '\f', '\b', '\t',
+                          '\v', '\r', '\\', '$',  'z'};
   intptr_t len = ARRAY_SIZE(characters);
 
   const String& str =
-      String::Handle(
-          OneByteString::New(characters, len, Heap::kNew));
+      String::Handle(OneByteString::New(characters, len, Heap::kNew));
   EXPECT(str.IsOneByteString());
   EXPECT_EQ(str.Length(), len);
   EXPECT(str.Equals("a\n\f\b\t\v\r\\$z"));
@@ -1711,13 +1695,12 @@
 
 
 VM_TEST_CASE(EscapeSpecialCharactersExternalOneByteString) {
-  uint8_t characters[] =
-      { 'a', '\n', '\f', '\b', '\t', '\v', '\r', '\\', '$', 'z' };
+  uint8_t characters[] = {'a',  '\n', '\f', '\b', '\t',
+                          '\v', '\r', '\\', '$',  'z'};
   intptr_t len = ARRAY_SIZE(characters);
 
-  const String& str =
-      String::Handle(
-          ExternalOneByteString::New(characters, len, NULL, NULL, Heap::kNew));
+  const String& str = String::Handle(
+      ExternalOneByteString::New(characters, len, NULL, NULL, Heap::kNew));
   EXPECT(!str.IsOneByteString());
   EXPECT(str.IsExternalOneByteString());
   EXPECT_EQ(str.Length(), len);
@@ -1726,9 +1709,8 @@
       String::Handle(String::EscapeSpecialCharacters(str));
   EXPECT(escaped_str.Equals("a\\n\\f\\b\\t\\v\\r\\\\\\$z"));
 
-  const String& empty_str =
-      String::Handle(
-          ExternalOneByteString::New(characters, 0, NULL, NULL, Heap::kNew));
+  const String& empty_str = String::Handle(
+      ExternalOneByteString::New(characters, 0, NULL, NULL, Heap::kNew));
   const String& escaped_empty_str =
       String::Handle(String::EscapeSpecialCharacters(empty_str));
   EXPECT_EQ(empty_str.Length(), 0);
@@ -1736,8 +1718,8 @@
 }
 
 VM_TEST_CASE(EscapeSpecialCharactersTwoByteString) {
-  uint16_t characters[] =
-      { 'a', '\n', '\f', '\b', '\t', '\v', '\r', '\\', '$', 'z' };
+  uint16_t characters[] = {'a',  '\n', '\f', '\b', '\t',
+                           '\v', '\r', '\\', '$',  'z'};
   intptr_t len = ARRAY_SIZE(characters);
 
   const String& str =
@@ -1759,13 +1741,12 @@
 
 
 VM_TEST_CASE(EscapeSpecialCharactersExternalTwoByteString) {
-  uint16_t characters[] =
-      { 'a', '\n', '\f', '\b', '\t', '\v', '\r', '\\', '$', 'z' };
+  uint16_t characters[] = {'a',  '\n', '\f', '\b', '\t',
+                           '\v', '\r', '\\', '$',  'z'};
   intptr_t len = ARRAY_SIZE(characters);
 
-  const String& str =
-      String::Handle(
-          ExternalTwoByteString::New(characters, len, NULL, NULL, Heap::kNew));
+  const String& str = String::Handle(
+      ExternalTwoByteString::New(characters, len, NULL, NULL, Heap::kNew));
   EXPECT(str.IsExternalTwoByteString());
   EXPECT_EQ(str.Length(), len);
   EXPECT(str.Equals("a\n\f\b\t\v\r\\$z"));
@@ -1773,9 +1754,8 @@
       String::Handle(String::EscapeSpecialCharacters(str));
   EXPECT(escaped_str.Equals("a\\n\\f\\b\\t\\v\\r\\\\\\$z"));
 
-  const String& empty_str =
-      String::Handle(
-          ExternalTwoByteString::New(characters, 0, NULL, NULL, Heap::kNew));
+  const String& empty_str = String::Handle(
+      ExternalTwoByteString::New(characters, 0, NULL, NULL, Heap::kNew));
   const String& escaped_empty_str =
       String::Handle(String::EscapeSpecialCharacters(empty_str));
   EXPECT_EQ(empty_str.Length(), 0);
@@ -1784,12 +1764,11 @@
 
 
 VM_TEST_CASE(ExternalTwoByteString) {
-  uint16_t characters[] = { 0x1E6B, 0x1E85, 0x1E53 };
+  uint16_t characters[] = {0x1E6B, 0x1E85, 0x1E53};
   intptr_t len = ARRAY_SIZE(characters);
 
-  const String& str =
-      String::Handle(
-          ExternalTwoByteString::New(characters, len, NULL, NULL, Heap::kNew));
+  const String& str = String::Handle(
+      ExternalTwoByteString::New(characters, len, NULL, NULL, Heap::kNew));
   EXPECT(!str.IsTwoByteString());
   EXPECT(str.IsExternalTwoByteString());
   EXPECT_EQ(str.Length(), len);
@@ -1805,8 +1784,9 @@
   EXPECT(!concat.IsExternalTwoByteString());
   EXPECT(concat.IsTwoByteString());
   EXPECT_EQ(len * 2, concat.Length());
-  EXPECT(concat.Equals("\xE1\xB9\xAB\xE1\xBA\x85\xE1\xB9\x93"
-                       "\xE1\xB9\xAB\xE1\xBA\x85\xE1\xB9\x93"));
+  EXPECT(
+      concat.Equals("\xE1\xB9\xAB\xE1\xBA\x85\xE1\xB9\x93"
+                    "\xE1\xB9\xAB\xE1\xBA\x85\xE1\xB9\x93"));
 
   const String& substr = String::Handle(String::SubString(str, 1, 1));
   EXPECT(!substr.IsExternalTwoByteString());
@@ -1867,9 +1847,9 @@
   EXPECT_EQ(one.raw(), ein_symbol.raw());
   EXPECT(one.raw() != eins.raw());
 
-  uint16_t char16[] = { 'E', 'l', 'f' };
+  uint16_t char16[] = {'E', 'l', 'f'};
   String& elf1 = String::Handle(Symbols::FromUTF16(thread, char16, 3));
-  int32_t char32[] = { 'E', 'l', 'f' };
+  int32_t char32[] = {'E', 'l', 'f'};
   String& elf2 = String::Handle(Symbols::FromUTF32(thread, char32, 3));
   EXPECT(elf1.IsSymbol());
   EXPECT(elf2.IsSymbol());
@@ -1879,7 +1859,7 @@
 
 
 VM_TEST_CASE(SymbolUnicode) {
-  uint16_t monkey_utf16[] = { 0xd83d, 0xdc35 };  // Unicode Monkey Face.
+  uint16_t monkey_utf16[] = {0xd83d, 0xdc35};  // Unicode Monkey Face.
   String& monkey = String::Handle(Symbols::FromUTF16(thread, monkey_utf16, 2));
   EXPECT(monkey.IsSymbol());
   const char monkey_utf8[] = {'\xf0', '\x9f', '\x90', '\xb5', 0};
@@ -1891,10 +1871,10 @@
 
   // Unicode cat face with tears of joy.
   int32_t kCatFaceWithTearsOfJoy = 0x1f639;
-  String& cat = String::Handle(Symbols::FromCharCode(thread,
-                                                     kCatFaceWithTearsOfJoy));
+  String& cat =
+      String::Handle(Symbols::FromCharCode(thread, kCatFaceWithTearsOfJoy));
 
-  uint16_t cat_utf16[] = { 0xd83d, 0xde39 };
+  uint16_t cat_utf16[] = {0xd83d, 0xde39};
   String& cat2 = String::Handle(Symbols::FromUTF16(thread, cat_utf16, 2));
   EXPECT(cat2.IsSymbol());
   EXPECT_EQ(cat2.raw(), cat.raw());
@@ -1954,24 +1934,29 @@
 static void TestIllegalArrayLength(intptr_t length) {
   char buffer[1024];
   OS::SNPrint(buffer, sizeof(buffer),
-      "main() {\n"
-      "  new List(%" Pd ");\n"
-      "}\n",
-      length);
+              "main() {\n"
+              "  new List(%" Pd
+              ");\n"
+              "}\n",
+              length);
   Dart_Handle lib = TestCase::LoadTestScript(buffer, NULL);
   EXPECT_VALID(lib);
   Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
   OS::SNPrint(buffer, sizeof(buffer),
-      "Unhandled exception:\n"
-      "RangeError (length): Invalid value: "
-      "Not in range 0..%" Pd ", inclusive: %" Pd,
-      Array::kMaxElements, length);
+              "Unhandled exception:\n"
+              "RangeError (length): Invalid value: "
+              "Not in range 0..%" Pd ", inclusive: %" Pd,
+              Array::kMaxElements, length);
   EXPECT_ERROR(result, buffer);
 }
 
 
-TEST_CASE(ArrayLengthNegativeOne) { TestIllegalArrayLength(-1); }
-TEST_CASE(ArrayLengthSmiMin) { TestIllegalArrayLength(kSmiMin); }
+TEST_CASE(ArrayLengthNegativeOne) {
+  TestIllegalArrayLength(-1);
+}
+TEST_CASE(ArrayLengthSmiMin) {
+  TestIllegalArrayLength(kSmiMin);
+}
 TEST_CASE(ArrayLengthOneTooMany) {
   const intptr_t kOneTooMany = Array::kMaxElements + 1;
   ASSERT(kOneTooMany >= 0);
@@ -1982,10 +1967,11 @@
 TEST_CASE(ArrayLengthMaxElements) {
   char buffer[1024];
   OS::SNPrint(buffer, sizeof(buffer),
-      "main() {\n"
-      "  return new List(%" Pd ");\n"
-      "}\n",
-      Array::kMaxElements);
+              "main() {\n"
+              "  return new List(%" Pd
+              ");\n"
+              "}\n",
+              Array::kMaxElements);
   Dart_Handle lib = TestCase::LoadTestScript(buffer, NULL);
   EXPECT_VALID(lib);
   Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
@@ -2004,15 +1990,16 @@
                                        intptr_t length) {
   char buffer[1024];
   OS::SNPrint(buffer, sizeof(buffer),
-      "import 'dart:typed_data';\n"
-      "main() {\n"
-      "  new %s(%" Pd ");\n"
-      "}\n",
-      class_name, length);
+              "import 'dart:typed_data';\n"
+              "main() {\n"
+              "  new %s(%" Pd
+              ");\n"
+              "}\n",
+              class_name, length);
   Dart_Handle lib = TestCase::LoadTestScript(buffer, NULL);
   EXPECT_VALID(lib);
   Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
-  OS::SNPrint(buffer, sizeof(buffer), "%" Pd,  length);
+  OS::SNPrint(buffer, sizeof(buffer), "%" Pd, length);
   EXPECT_ERROR(result, "Invalid argument(s)");
   EXPECT_ERROR(result, buffer);
 }
@@ -2036,11 +2023,12 @@
   const intptr_t max_elements = TypedData::MaxElements(kTypedDataInt8ArrayCid);
   char buffer[1024];
   OS::SNPrint(buffer, sizeof(buffer),
-      "import 'dart:typed_data';\n"
-      "main() {\n"
-      "  return new Int8List(%" Pd ");\n"
-      "}\n",
-      max_elements);
+              "import 'dart:typed_data';\n"
+              "main() {\n"
+              "  return new Int8List(%" Pd
+              ");\n"
+              "}\n",
+              max_elements);
   Dart_Handle lib = TestCase::LoadTestScript(buffer, NULL);
   EXPECT_VALID(lib);
   Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
@@ -2069,10 +2057,11 @@
   EXPECT_EQ(' ', it1.Current());
   EXPECT(!it1.Next());
 
-  const String& str2 = String::Handle(String::New("\xD7\x92\xD7\x9C"
-                                                  "\xD7\xA2\xD7\x93"
-                                                  "\xD7\x91\xD7\xA8"
-                                                  "\xD7\x9B\xD7\x94"));
+  const String& str2 =
+      String::Handle(String::New("\xD7\x92\xD7\x9C"
+                                 "\xD7\xA2\xD7\x93"
+                                 "\xD7\x91\xD7\xA8"
+                                 "\xD7\x9B\xD7\x94"));
   String::CodePointIterator it2(str2);
   EXPECT(it2.Next());
   EXPECT_EQ(0x5D2, it2.Current());
@@ -2092,10 +2081,11 @@
   EXPECT_EQ(0x5D4, it2.Current());
   EXPECT(!it2.Next());
 
-  const String& str3 = String::Handle(String::New("\xF0\x9D\x91\xA0"
-                                                  "\xF0\x9D\x91\xA1"
-                                                  "\xF0\x9D\x91\xA2"
-                                                  "\xF0\x9D\x91\xA3"));
+  const String& str3 =
+      String::Handle(String::New("\xF0\x9D\x91\xA0"
+                                 "\xF0\x9D\x91\xA1"
+                                 "\xF0\x9D\x91\xA2"
+                                 "\xF0\x9D\x91\xA3"));
   String::CodePointIterator it3(str3);
   EXPECT(it3.Next());
   EXPECT_EQ(0x1D460, it3.Current());
@@ -2249,7 +2239,7 @@
 
 
 VM_TEST_CASE(InternalTypedData) {
-  uint8_t data[] = { 253, 254, 255, 0, 1, 2, 3, 4 };
+  uint8_t data[] = {253, 254, 255, 0, 1, 2, 3, 4};
   intptr_t data_length = ARRAY_SIZE(data);
 
   const TypedData& int8_array =
@@ -2305,30 +2295,24 @@
 
 
 VM_TEST_CASE(ExternalTypedData) {
-  uint8_t data[] = { 253, 254, 255, 0, 1, 2, 3, 4 };
+  uint8_t data[] = {253, 254, 255, 0, 1, 2, 3, 4};
   intptr_t data_length = ARRAY_SIZE(data);
 
   const ExternalTypedData& int8_array =
-      ExternalTypedData::Handle(
-          ExternalTypedData::New(kExternalTypedDataInt8ArrayCid,
-                                 data,
-                                 data_length));
+      ExternalTypedData::Handle(ExternalTypedData::New(
+          kExternalTypedDataInt8ArrayCid, data, data_length));
   EXPECT(!int8_array.IsNull());
   EXPECT_EQ(data_length, int8_array.Length());
 
   const ExternalTypedData& uint8_array =
-      ExternalTypedData::Handle(
-          ExternalTypedData::New(kExternalTypedDataUint8ArrayCid,
-                                  data,
-                                  data_length));
+      ExternalTypedData::Handle(ExternalTypedData::New(
+          kExternalTypedDataUint8ArrayCid, data, data_length));
   EXPECT(!uint8_array.IsNull());
   EXPECT_EQ(data_length, uint8_array.Length());
 
   const ExternalTypedData& uint8_clamped_array =
-      ExternalTypedData::Handle(
-          ExternalTypedData::New(kExternalTypedDataUint8ClampedArrayCid,
-                                 data,
-                                 data_length));
+      ExternalTypedData::Handle(ExternalTypedData::New(
+          kExternalTypedDataUint8ClampedArrayCid, data, data_length));
   EXPECT(!uint8_clamped_array.IsNull());
   EXPECT_EQ(data_length, uint8_clamped_array.Length());
 
@@ -2356,18 +2340,18 @@
   EXPECT_EQ(2, uint8_array.GetUint8(5));
   EXPECT_EQ(2, uint8_clamped_array.GetUint8(5));
 
-  for (intptr_t i = 0 ; i < int8_array.Length(); ++i) {
+  for (intptr_t i = 0; i < int8_array.Length(); ++i) {
     EXPECT_EQ(int8_array.GetUint8(i), uint8_array.GetUint8(i));
   }
 
   int8_array.SetInt8(2, -123);
   uint8_array.SetUint8(0, 123);
-  for (intptr_t i = 0 ; i < int8_array.Length(); ++i) {
+  for (intptr_t i = 0; i < int8_array.Length(); ++i) {
     EXPECT_EQ(int8_array.GetInt8(i), uint8_array.GetInt8(i));
   }
 
   uint8_clamped_array.SetUint8(0, 123);
-  for (intptr_t i = 0 ; i < int8_array.Length(); ++i) {
+  for (intptr_t i = 0; i < int8_array.Length(); ++i) {
     EXPECT_EQ(int8_array.GetUint8(i), uint8_clamped_array.GetUint8(i));
   }
 }
@@ -2378,9 +2362,8 @@
   const char* source_chars = "This will not compile.";
   const String& url = String::Handle(String::New(url_chars));
   const String& source = String::Handle(String::New(source_chars));
-  const Script& script = Script::Handle(Script::New(url,
-                                                    source,
-                                                    RawScript::kScriptTag));
+  const Script& script =
+      Script::Handle(Script::New(url, source, RawScript::kScriptTag));
   EXPECT(!script.IsNull());
   EXPECT(script.IsScript());
   String& str = String::Handle(script.url());
@@ -2408,11 +2391,16 @@
 VM_TEST_CASE(EmbeddedScript) {
   const char* url_chars = "builtin:test-case";
   const char* text =
-      /* 1 */ "<!DOCTYPE html>\n"
-      /* 2 */ "  ... more junk ...\n"
-      /* 3 */ "  <script type='application/dart'>main() {\n"
-      /* 4 */ "    return 'foo';\n"
-      /* 5 */ "  }\n"
+      /* 1 */
+      "<!DOCTYPE html>\n"
+      /* 2 */
+      "  ... more junk ...\n"
+      /* 3 */
+      "  <script type='application/dart'>main() {\n"
+      /* 4 */
+      "    return 'foo';\n"
+      /* 5 */
+      "  }\n"
       /* 6 */ "</script>\n";
   const char* line1 = text;
   const char* line2 = strstr(line1, "\n") + 1;
@@ -2443,8 +2431,8 @@
 
   const String& url = String::Handle(String::New(url_chars));
   const String& source = String::Handle(String::New(src_chars));
-  const Script& script = Script::Handle(
-      Script::New(url, source, RawScript::kScriptTag));
+  const Script& script =
+      Script::Handle(Script::New(url, source, RawScript::kScriptTag));
   script.SetLocationOffset(line_offset, col_offset);
 
   String& str = String::Handle();
@@ -2534,18 +2522,18 @@
 
   const Type& dynamic_type = Type::ZoneHandle(Type::DynamicType());
   const String& a = String::ZoneHandle(Symbols::New(thread, "a"));
-  LocalVariable* var_a =
-      new LocalVariable(TokenPosition::kNoSource, a, dynamic_type);
+  LocalVariable* var_a = new LocalVariable(
+      TokenPosition::kNoSource, TokenPosition::kNoSource, a, dynamic_type);
   parent_scope->AddVariable(var_a);
 
   const String& b = String::ZoneHandle(Symbols::New(thread, "b"));
-  LocalVariable* var_b =
-      new LocalVariable(TokenPosition::kNoSource, b, dynamic_type);
+  LocalVariable* var_b = new LocalVariable(
+      TokenPosition::kNoSource, TokenPosition::kNoSource, b, dynamic_type);
   local_scope->AddVariable(var_b);
 
   const String& c = String::ZoneHandle(Symbols::New(thread, "c"));
-  LocalVariable* var_c =
-      new LocalVariable(TokenPosition::kNoSource, c, dynamic_type);
+  LocalVariable* var_c = new LocalVariable(
+      TokenPosition::kNoSource, TokenPosition::kNoSource, c, dynamic_type);
   parent_scope->AddVariable(var_c);
 
   bool test_only = false;  // Please, insert alias.
@@ -2570,18 +2558,16 @@
   var_c = local_scope->LookupVariable(c, test_only);
   EXPECT(var_c->is_captured());
 
-  EXPECT_EQ(3, local_scope->num_variables());  // a, b, and c alias.
+  EXPECT_EQ(3, local_scope->num_variables());         // a, b, and c alias.
   EXPECT_EQ(2, local_scope->NumCapturedVariables());  // a, c alias.
 
   const int first_parameter_index = 0;
   const int num_parameters = 0;
   const int first_frame_index = -1;
   bool found_captured_vars = false;
-  int next_frame_index = parent_scope->AllocateVariables(first_parameter_index,
-                                                         num_parameters,
-                                                         first_frame_index,
-                                                         NULL,
-                                                         &found_captured_vars);
+  int next_frame_index = parent_scope->AllocateVariables(
+      first_parameter_index, num_parameters, first_frame_index, NULL,
+      &found_captured_vars);
   EXPECT_EQ(first_frame_index, next_frame_index);  // a and c not in frame.
   const intptr_t parent_scope_context_level = 1;
   EXPECT_EQ(parent_scope_context_level, parent_scope->context_level());
@@ -2620,16 +2606,16 @@
   const Context& context = Context::Handle(Context::New(0));
   Function& parent = Function::Handle();
   const String& parent_name = String::Handle(Symbols::New(thread, "foo_papa"));
-  parent = Function::New(parent_name, RawFunction::kRegularFunction,
-                         false, false, false, false, false, cls,
-                         TokenPosition::kMinSource);
+  parent =
+      Function::New(parent_name, RawFunction::kRegularFunction, false, false,
+                    false, false, false, cls, TokenPosition::kMinSource);
   functions.SetAt(0, parent);
   cls.SetFunctions(functions);
 
   Function& function = Function::Handle();
   const String& function_name = String::Handle(Symbols::New(thread, "foo"));
-  function = Function::NewClosureFunction(
-      function_name, parent, TokenPosition::kMinSource);
+  function = Function::NewClosureFunction(function_name, parent,
+                                          TokenPosition::kMinSource);
   const Closure& closure = Closure::Handle(Closure::New(function, context));
   const Class& closure_class = Class::Handle(closure.clazz());
   EXPECT_EQ(closure_class.id(), kClosureCid);
@@ -2648,8 +2634,7 @@
   // bool class and true/false values.
   ObjectStore* object_store = Isolate::Current()->object_store();
   const Class& bool_class = Class::Handle(object_store->bool_class());
-  EXPECT_STREQ("Library:'dart:core' Class: bool",
-               bool_class.ToCString());
+  EXPECT_STREQ("Library:'dart:core' Class: bool", bool_class.ToCString());
   EXPECT_STREQ("true", Bool::True().ToCString());
   EXPECT_STREQ("false", Bool::False().ToCString());
 
@@ -2693,30 +2678,28 @@
   const Script& script = Script::Handle();
   const Class& owner_class =
       Class::Handle(CreateDummyClass(class_name, script));
-  const Library& owner_library =
-      Library::Handle(CreateDummyLibrary(lib_name));
+  const Library& owner_library = Library::Handle(CreateDummyLibrary(lib_name));
   owner_class.set_library(owner_library);
   const String& function_name = String::ZoneHandle(Symbols::New(thread, name));
-  return Function::New(function_name, RawFunction::kRegularFunction,
-                       true, false, false, false, false, owner_class,
+  return Function::New(function_name, RawFunction::kRegularFunction, true,
+                       false, false, false, false, owner_class,
                        TokenPosition::kMinSource);
 }
 
 
 // Test for Code and Instruction object creation.
 VM_TEST_CASE(Code) {
-  extern void GenerateIncrement(Assembler* assembler);
+  extern void GenerateIncrement(Assembler * assembler);
   Assembler _assembler_;
   GenerateIncrement(&_assembler_);
   const Function& function = Function::Handle(CreateFunction("Test_Code"));
   Code& code = Code::Handle(Code::FinalizeCode(function, &_assembler_));
   function.AttachCode(code);
   const Instructions& instructions = Instructions::Handle(code.instructions());
-  uword entry_point = instructions.UncheckedEntryPoint();
-  EXPECT_EQ(instructions.raw(),
-            Instructions::FromUncheckedEntryPoint(entry_point));
-  const Object& result = Object::Handle(
-      DartEntry::InvokeFunction(function, Array::empty_array()));
+  uword payload_start = instructions.PayloadStart();
+  EXPECT_EQ(instructions.raw(), Instructions::FromPayloadStart(payload_start));
+  const Object& result =
+      Object::Handle(DartEntry::InvokeFunction(function, Array::empty_array()));
   EXPECT_EQ(1, Smi::Cast(result).Value());
 }
 
@@ -2724,18 +2707,17 @@
 // Test for immutability of generated instructions. The test crashes with a
 // segmentation fault when writing into it.
 VM_TEST_CASE(CodeImmutability) {
-  extern void GenerateIncrement(Assembler* assembler);
+  extern void GenerateIncrement(Assembler * assembler);
   Assembler _assembler_;
   GenerateIncrement(&_assembler_);
   const Function& function = Function::Handle(CreateFunction("Test_Code"));
   Code& code = Code::Handle(Code::FinalizeCode(function, &_assembler_));
   function.AttachCode(code);
   Instructions& instructions = Instructions::Handle(code.instructions());
-  uword entry_point = instructions.UncheckedEntryPoint();
-  EXPECT_EQ(instructions.raw(),
-            Instructions::FromUncheckedEntryPoint(entry_point));
+  uword payload_start = instructions.PayloadStart();
+  EXPECT_EQ(instructions.raw(), Instructions::FromPayloadStart(payload_start));
   // Try writing into the generated code, expected to crash.
-  *(reinterpret_cast<char*>(entry_point) + 1) = 1;
+  *(reinterpret_cast<char*>(payload_start) + 1) = 1;
   if (!FLAG_write_protect_code) {
     // Since this test is expected to crash, crash if write protection of code
     // is switched off.
@@ -2747,7 +2729,7 @@
 
 // Test for Embedded String object in the instructions.
 VM_TEST_CASE(EmbedStringInCode) {
-  extern void GenerateEmbedStringInCode(Assembler* assembler, const char* str);
+  extern void GenerateEmbedStringInCode(Assembler * assembler, const char* str);
   const char* kHello = "Hello World!";
   word expected_length = static_cast<word>(strlen(kHello));
   Assembler _assembler_;
@@ -2762,7 +2744,7 @@
   String& string_object = String::Handle();
   string_object ^= result.raw();
   EXPECT(string_object.Length() == expected_length);
-  for (int i = 0; i < expected_length; i ++) {
+  for (int i = 0; i < expected_length; i++) {
     EXPECT(string_object.CharAt(i) == kHello[i]);
   }
 }
@@ -2770,7 +2752,7 @@
 
 // Test for Embedded Smi object in the instructions.
 VM_TEST_CASE(EmbedSmiInCode) {
-  extern void GenerateEmbedSmiInCode(Assembler* assembler, intptr_t value);
+  extern void GenerateEmbedSmiInCode(Assembler * assembler, intptr_t value);
   const intptr_t kSmiTestValue = 5;
   Assembler _assembler_;
   GenerateEmbedSmiInCode(&_assembler_, kSmiTestValue);
@@ -2787,7 +2769,7 @@
 #if defined(ARCH_IS_64_BIT)
 // Test for Embedded Smi object in the instructions.
 VM_TEST_CASE(EmbedSmiIn64BitCode) {
-  extern void GenerateEmbedSmiInCode(Assembler* assembler, intptr_t value);
+  extern void GenerateEmbedSmiInCode(Assembler * assembler, intptr_t value);
   const intptr_t kSmiTestValue = DART_INT64_C(5) << 32;
   Assembler _assembler_;
   GenerateEmbedSmiInCode(&_assembler_, kSmiTestValue);
@@ -2814,7 +2796,7 @@
   exception_handlers.SetHandlerInfo(2, -1, 40u, kNoStacktrace, true);
   exception_handlers.SetHandlerInfo(3, 1, 150u, kNoStacktrace, true);
 
-  extern void GenerateIncrement(Assembler* assembler);
+  extern void GenerateIncrement(Assembler * assembler);
   Assembler _assembler_;
   GenerateIncrement(&_assembler_);
   Code& code = Code::Handle(Code::FinalizeCode(
@@ -2844,23 +2826,18 @@
   DescriptorList* builder = new DescriptorList(0);
 
   // kind, pc_offset, deopt_id, token_pos, try_index
-  builder->AddDescriptor(RawPcDescriptors::kOther,
-                         10, 1, TokenPosition(20), 1);
-  builder->AddDescriptor(RawPcDescriptors::kDeopt,
-                         20, 2, TokenPosition(30), 0);
-  builder->AddDescriptor(RawPcDescriptors::kOther,
-                         30, 3, TokenPosition(40), 1);
-  builder->AddDescriptor(RawPcDescriptors::kOther,
-                         10, 4, TokenPosition(40), 2);
-  builder->AddDescriptor(RawPcDescriptors::kOther,
-                         10, 5, TokenPosition(80), 3);
-  builder->AddDescriptor(RawPcDescriptors::kOther,
-                         80, 6, TokenPosition(150), 3);
+  builder->AddDescriptor(RawPcDescriptors::kOther, 10, 1, TokenPosition(20), 1);
+  builder->AddDescriptor(RawPcDescriptors::kDeopt, 20, 2, TokenPosition(30), 0);
+  builder->AddDescriptor(RawPcDescriptors::kOther, 30, 3, TokenPosition(40), 1);
+  builder->AddDescriptor(RawPcDescriptors::kOther, 10, 4, TokenPosition(40), 2);
+  builder->AddDescriptor(RawPcDescriptors::kOther, 10, 5, TokenPosition(80), 3);
+  builder->AddDescriptor(RawPcDescriptors::kOther, 80, 6, TokenPosition(150),
+                         3);
 
   PcDescriptors& descriptors = PcDescriptors::Handle();
   descriptors ^= builder->FinalizePcDescriptors(0);
 
-  extern void GenerateIncrement(Assembler* assembler);
+  extern void GenerateIncrement(Assembler * assembler);
   Assembler _assembler_;
   GenerateIncrement(&_assembler_);
   Code& code = Code::Handle(Code::FinalizeCode(
@@ -2907,23 +2884,22 @@
   DescriptorList* builder = new DescriptorList(0);
 
   // kind, pc_offset, deopt_id, token_pos, try_index
-  builder->AddDescriptor(RawPcDescriptors::kOther,
-                         100, 1, TokenPosition(200), 1);
-  builder->AddDescriptor(RawPcDescriptors::kDeopt,
-                         200, 2, TokenPosition(300), 0);
-  builder->AddDescriptor(RawPcDescriptors::kOther,
-                         300, 3, TokenPosition(400), 1);
-  builder->AddDescriptor(RawPcDescriptors::kOther,
-                         100, 4, TokenPosition(0), 2);
-  builder->AddDescriptor(RawPcDescriptors::kOther,
-                         100, 5, TokenPosition(800), 3);
-  builder->AddDescriptor(RawPcDescriptors::kOther,
-                         800, 6, TokenPosition(150), 3);
+  builder->AddDescriptor(RawPcDescriptors::kOther, 100, 1, TokenPosition(200),
+                         1);
+  builder->AddDescriptor(RawPcDescriptors::kDeopt, 200, 2, TokenPosition(300),
+                         0);
+  builder->AddDescriptor(RawPcDescriptors::kOther, 300, 3, TokenPosition(400),
+                         1);
+  builder->AddDescriptor(RawPcDescriptors::kOther, 100, 4, TokenPosition(0), 2);
+  builder->AddDescriptor(RawPcDescriptors::kOther, 100, 5, TokenPosition(800),
+                         3);
+  builder->AddDescriptor(RawPcDescriptors::kOther, 800, 6, TokenPosition(150),
+                         3);
 
   PcDescriptors& descriptors = PcDescriptors::Handle();
   descriptors ^= builder->FinalizePcDescriptors(0);
 
-  extern void GenerateIncrement(Assembler* assembler);
+  extern void GenerateIncrement(Assembler * assembler);
   Assembler _assembler_;
   GenerateIncrement(&_assembler_);
   Code& code = Code::Handle(Code::FinalizeCode(
@@ -2967,21 +2943,21 @@
 
 
 static RawClass* CreateTestClass(const char* name) {
-  const String& class_name = String::Handle(Symbols::New(Thread::Current(),
-                                                         name));
-  const Class& cls = Class::Handle(
-      CreateDummyClass(class_name, Script::Handle()));
+  const String& class_name =
+      String::Handle(Symbols::New(Thread::Current(), name));
+  const Class& cls =
+      Class::Handle(CreateDummyClass(class_name, Script::Handle()));
   return cls.raw();
 }
 
 
 static RawField* CreateTestField(const char* name) {
   const Class& cls = Class::Handle(CreateTestClass("global:"));
-  const String& field_name = String::Handle(Symbols::New(Thread::Current(),
-                                                         name));
-  const Field& field =
-      Field::Handle(Field::New(field_name, true, false, false, true, cls,
-          Object::dynamic_type(), TokenPosition::kMinSource));
+  const String& field_name =
+      String::Handle(Symbols::New(Thread::Current(), name));
+  const Field& field = Field::Handle(
+      Field::New(field_name, true, false, false, true, cls,
+                 Object::dynamic_type(), TokenPosition::kMinSource));
   return field.raw();
 }
 
@@ -3010,23 +2986,17 @@
 
 
 static RawFunction* GetDummyTarget(const char* name) {
-  const String& function_name = String::Handle(Symbols::New(Thread::Current(),
-                                                            name));
-  const Class& cls = Class::Handle(
-       CreateDummyClass(function_name, Script::Handle()));
+  const String& function_name =
+      String::Handle(Symbols::New(Thread::Current(), name));
+  const Class& cls =
+      Class::Handle(CreateDummyClass(function_name, Script::Handle()));
   const bool is_static = false;
   const bool is_const = false;
   const bool is_abstract = false;
   const bool is_external = false;
   const bool is_native = false;
-  return Function::New(function_name,
-                       RawFunction::kRegularFunction,
-                       is_static,
-                       is_const,
-                       is_abstract,
-                       is_external,
-                       is_native,
-                       cls,
+  return Function::New(function_name, RawFunction::kRegularFunction, is_static,
+                       is_const, is_abstract, is_external, is_native, cls,
                        TokenPosition::kMinSource);
 }
 
@@ -3039,8 +3009,8 @@
   const Array& args_descriptor =
       Array::Handle(ArgumentsDescriptor::New(1, Object::null_array()));
   ICData& o1 = ICData::Handle();
-  o1 = ICData::New(function, target_name, args_descriptor, id,
-                   num_args_tested, false);
+  o1 = ICData::New(function, target_name, args_descriptor, id, num_args_tested,
+                   false);
   EXPECT_EQ(1, o1.NumArgsTested());
   EXPECT_EQ(id, o1.deopt_id());
   EXPECT_EQ(function.raw(), o1.Owner());
@@ -3097,9 +3067,8 @@
 
   // Check ICData for unoptimized static calls.
   const intptr_t kNumArgsChecked = 0;
-  const ICData& scall_icdata = ICData::Handle(
-      ICData::New(function, target_name, args_descriptor, 57,
-                  kNumArgsChecked, false));
+  const ICData& scall_icdata = ICData::Handle(ICData::New(
+      function, target_name, args_descriptor, 57, kNumArgsChecked, false));
   scall_icdata.AddTarget(target1);
   EXPECT_EQ(target1.raw(), scall_icdata.GetTargetAt(0));
 }
@@ -3122,8 +3091,8 @@
   TypeArguments& test_targ_0 = TypeArguments::Handle();
   TypeArguments& test_targ_1 = TypeArguments::Handle();
   Bool& test_result = Bool::Handle();
-  cache.GetCheck(
-      0, &test_class_id_or_fun, &test_targ_0, &test_targ_1, &test_result);
+  cache.GetCheck(0, &test_class_id_or_fun, &test_targ_0, &test_targ_1,
+                 &test_result);
   EXPECT_EQ(class_id_or_fun.raw(), test_class_id_or_fun.raw());
   EXPECT_EQ(targ_0.raw(), test_targ_0.raw());
   EXPECT_EQ(targ_1.raw(), test_targ_1.raw());
@@ -3148,8 +3117,6 @@
 }
 
 
-
-
 // Expose helper function from object.cc for testing.
 bool EqualsIgnoringPrivate(const String& name, const String& private_name);
 
@@ -3264,9 +3231,9 @@
       reinterpret_cast<const uint8_t*>(ext_mangled_str),
       strlen(ext_mangled_str), NULL, NULL, Heap::kNew);
   EXPECT(ext_mangled_name.IsExternalOneByteString());
-  ext_bare_name = ExternalOneByteString::New(
-      reinterpret_cast<const uint8_t*>(ext_bare_str),
-      strlen(ext_bare_str), NULL, NULL, Heap::kNew);
+  ext_bare_name =
+      ExternalOneByteString::New(reinterpret_cast<const uint8_t*>(ext_bare_str),
+                                 strlen(ext_bare_str), NULL, NULL, Heap::kNew);
   EXPECT(ext_bare_name.IsExternalOneByteString());
   ext_bad_bare_name = ExternalOneByteString::New(
       reinterpret_cast<const uint8_t*>(ext_bad_bare_str),
@@ -3282,8 +3249,8 @@
 
   // str1 - ExternalOneByteString, str2 - ExternalOneByteString.
   EXPECT(String::EqualsIgnoringPrivateKey(ext_mangled_name, ext_bare_name));
-  EXPECT(!String::EqualsIgnoringPrivateKey(ext_mangled_name,
-                                           ext_bad_bare_name));
+  EXPECT(
+      !String::EqualsIgnoringPrivateKey(ext_mangled_name, ext_bad_bare_name));
 }
 
 
@@ -3335,21 +3302,20 @@
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
   EXPECT_VALID(lib);
   Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
-  EXPECT_ERROR(
-      result,
-      "Unhandled exception:\n"
-      "MyException\n"
-      "#0      baz (test-lib:2:3)\n"
-      "#1      _OtherClass._OtherClass._named (test-lib:7:5)\n"
-      "#2      globalVar= (test-lib:12:7)\n"
-      "#3      _bar (test-lib:16:3)\n"
-      "#4      MyClass.field (test-lib:25:5)\n"
-      "#5      MyClass.foo.fooHelper (test-lib:30:7)\n"
-      "#6      MyClass.foo (test-lib:32:14)\n"
-      "#7      MyClass.MyClass.<anonymous closure> (test-lib:21:12)\n"
-      "#8      MyClass.MyClass (test-lib:21:18)\n"
-      "#9      main.<anonymous closure> (test-lib:37:14)\n"
-      "#10     main (test-lib:37:24)");
+  EXPECT_ERROR(result,
+               "Unhandled exception:\n"
+               "MyException\n"
+               "#0      baz (test-lib:2:3)\n"
+               "#1      _OtherClass._OtherClass._named (test-lib:7:5)\n"
+               "#2      globalVar= (test-lib:12:7)\n"
+               "#3      _bar (test-lib:16:3)\n"
+               "#4      MyClass.field (test-lib:25:5)\n"
+               "#5      MyClass.foo.fooHelper (test-lib:30:7)\n"
+               "#6      MyClass.foo (test-lib:32:14)\n"
+               "#7      MyClass.MyClass.<anonymous closure> (test-lib:21:12)\n"
+               "#8      MyClass.MyClass (test-lib:21:18)\n"
+               "#9      main.<anonymous closure> (test-lib:37:14)\n"
+               "#10     main (test-lib:37:24)");
 }
 
 
@@ -3761,16 +3727,16 @@
 
 
 static RawFunction* GetFunction(const Class& cls, const char* name) {
-  const Function& result = Function::Handle(cls.LookupDynamicFunction(
-      String::Handle(String::New(name))));
+  const Function& result = Function::Handle(
+      cls.LookupDynamicFunction(String::Handle(String::New(name))));
   EXPECT(!result.IsNull());
   return result.raw();
 }
 
 
 static RawFunction* GetStaticFunction(const Class& cls, const char* name) {
-  const Function& result = Function::Handle(cls.LookupStaticFunction(
-      String::Handle(String::New(name))));
+  const Function& result = Function::Handle(
+      cls.LookupStaticFunction(String::Handle(String::New(name))));
   EXPECT(!result.IsNull());
   return result.raw();
 }
@@ -3802,9 +3768,9 @@
 
   Function& parent = Function::Handle();
   const String& parent_name = String::Handle(Symbols::New(thread, "foo_papa"));
-  parent = Function::New(parent_name, RawFunction::kRegularFunction,
-                         false, false, false, false, false, cls,
-                         TokenPosition::kMinSource);
+  parent =
+      Function::New(parent_name, RawFunction::kRegularFunction, false, false,
+                    false, false, false, cls, TokenPosition::kMinSource);
   functions.SetAt(0, parent);
   cls.SetFunctions(functions);
 
@@ -3839,9 +3805,9 @@
   const Array& functions = Array::Handle(Array::New(1));
   Function& parent = Function::Handle();
   const String& parent_name = String::Handle(Symbols::New(thread, "foo_papa"));
-  parent = Function::New(parent_name, RawFunction::kRegularFunction,
-                         false, false, false, false, false, cls,
-                         TokenPosition::kMinSource);
+  parent =
+      Function::New(parent_name, RawFunction::kRegularFunction, false, false,
+                    false, false, false, cls, TokenPosition::kMinSource);
   functions.SetAt(0, parent);
   cls.SetFunctions(functions);
   cls.Finalize();
@@ -3851,10 +3817,9 @@
       String::Handle(Symbols::New(thread, "myMethod"));
   const Array& args_desc = Array::Handle(ArgumentsDescriptor::New(1));
   Function& invocation_dispatcher = Function::Handle();
-  invocation_dispatcher ^=
-      cls.GetInvocationDispatcher(invocation_dispatcher_name, args_desc,
-                                  RawFunction::kNoSuchMethodDispatcher,
-                                  true /* create_if_absent */);
+  invocation_dispatcher ^= cls.GetInvocationDispatcher(
+      invocation_dispatcher_name, args_desc,
+      RawFunction::kNoSuchMethodDispatcher, true /* create_if_absent */);
   EXPECT(!invocation_dispatcher.IsNull());
   // Get index to function.
   intptr_t invocation_dispatcher_index =
@@ -3878,8 +3843,7 @@
 
 static void PrintMetadata(const char* name, const Object& data) {
   if (data.IsError()) {
-    OS::Print("Error in metadata evaluation for %s: '%s'\n",
-              name,
+    OS::Print("Error in metadata evaluation for %s: '%s'\n", name,
               Error::Cast(data).ToErrorCString());
   }
   EXPECT(data.IsArray());
@@ -3954,8 +3918,8 @@
   res = lib.GetMetadata(func);
   PrintMetadata("main", res);
 
-  func = lib.LookupLocalFunction(String::Handle(Symbols::New(thread,
-                                                             "get:tlGetter")));
+  func = lib.LookupLocalFunction(
+      String::Handle(Symbols::New(thread, "get:tlGetter")));
   EXPECT(!func.IsNull());
   res = lib.GetMetadata(func);
   PrintMetadata("tlGetter", res);
@@ -4011,10 +3975,10 @@
   const Library& lib = Library::Handle(Library::LookupLibrary(thread, name));
   EXPECT(!lib.IsNull());
 
-  const Class& class_a = Class::Handle(
-      lib.LookupClass(String::Handle(Symbols::New(thread, "A"))));
-  const Class& class_b = Class::Handle(
-      lib.LookupClass(String::Handle(Symbols::New(thread, "B"))));
+  const Class& class_a =
+      Class::Handle(lib.LookupClass(String::Handle(Symbols::New(thread, "A"))));
+  const Class& class_b =
+      Class::Handle(lib.LookupClass(String::Handle(Symbols::New(thread, "B"))));
   const Function& a_test1 =
       Function::Handle(GetStaticFunction(class_a, "test1"));
   const Function& b_test1 =
@@ -4029,10 +3993,8 @@
       Function::Handle(GetStaticFunction(class_a, "test5"));
   const Function& b_test5 =
       Function::Handle(GetStaticFunction(class_b, "test5"));
-  const Function& a_test6 =
-      Function::Handle(GetFunction(class_a, "test6"));
-  const Function& b_test6 =
-      Function::Handle(GetFunction(class_b, "test6"));
+  const Function& a_test6 = Function::Handle(GetFunction(class_a, "test6"));
+  const Function& b_test6 = Function::Handle(GetFunction(class_b, "test6"));
 
   EXPECT_EQ(a_test1.SourceFingerprint(), b_test1.SourceFingerprint());
   EXPECT_NE(a_test1.SourceFingerprint(), a_test2.SourceFingerprint());
@@ -4077,8 +4039,7 @@
   EXPECT(!vmlib.IsNull());
   const Class& class_a = Class::Handle(
       vmlib.LookupClass(String::Handle(Symbols::New(thread, "A"))));
-  const Function& func_b =
-      Function::Handle(GetFunction(class_a, "b"));
+  const Function& func_b = Function::Handle(GetFunction(class_a, "b"));
   EXPECT(func_b.CanBeInlined());
 
   // After setting a breakpoint in a function A.b, it is no longer inlineable.
@@ -4125,21 +4086,20 @@
 class ObjectAccumulator : public ObjectVisitor {
  public:
   explicit ObjectAccumulator(GrowableArray<Object*>* objects)
-      : objects_(objects) { }
-  virtual ~ObjectAccumulator() { }
+      : objects_(objects) {}
+  virtual ~ObjectAccumulator() {}
   virtual void VisitObject(RawObject* obj) {
     if (obj->IsPseudoObject()) {
       return;  // Cannot be wrapped in handles.
     }
     Object& handle = Object::Handle(obj);
     // Skip some common simple objects to run in reasonable time.
-    if (handle.IsString() ||
-        handle.IsArray() ||
-        handle.IsLiteralToken()) {
+    if (handle.IsString() || handle.IsArray() || handle.IsLiteralToken()) {
       return;
     }
     objects_->Add(&handle);
   }
+
  private:
   GrowableArray<Object*>* objects_;
 };
@@ -4622,8 +4582,8 @@
     pieces.Add(*data[i]);
     array.SetAt(i, *data[i]);
   }
-  const String& res1 = String::Handle(zone, Symbols::FromConcatAll(thread,
-                                                                   pieces));
+  const String& res1 =
+      String::Handle(zone, Symbols::FromConcatAll(thread, pieces));
   const String& res2 = String::Handle(zone, String::ConcatAll(array));
   EXPECT(res1.Equals(res2));
 }
@@ -4631,65 +4591,63 @@
 
 VM_TEST_CASE(Symbols_FromConcatAll) {
   {
-    const String* data[3] = { &Symbols::FallThroughError(),
-                              &Symbols::Dot(),
-                              &Symbols::isPaused() };
+    const String* data[3] = {&Symbols::FallThroughError(), &Symbols::Dot(),
+                             &Symbols::isPaused()};
     CheckConcatAll(data, 3);
   }
 
   {
     const intptr_t kWideCharsLen = 7;
-    uint16_t wide_chars[kWideCharsLen] = { 'H', 'e', 'l', 'l', 'o', 256, '!' };
-    const String& two_str = String::Handle(String::FromUTF16(wide_chars,
-                                                             kWideCharsLen));
+    uint16_t wide_chars[kWideCharsLen] = {'H', 'e', 'l', 'l', 'o', 256, '!'};
+    const String& two_str =
+        String::Handle(String::FromUTF16(wide_chars, kWideCharsLen));
 
-    const String* data[3] = { &two_str, &Symbols::Dot(), &two_str };
+    const String* data[3] = {&two_str, &Symbols::Dot(), &two_str};
     CheckConcatAll(data, 3);
   }
 
   {
-    uint8_t characters[] = { 0xF6, 0xF1, 0xE9 };
+    uint8_t characters[] = {0xF6, 0xF1, 0xE9};
     intptr_t len = ARRAY_SIZE(characters);
 
     const String& str = String::Handle(
         ExternalOneByteString::New(characters, len, NULL, NULL, Heap::kNew));
-    const String* data[3] = { &str, &Symbols::Dot(), &str };
+    const String* data[3] = {&str, &Symbols::Dot(), &str};
     CheckConcatAll(data, 3);
   }
 
   {
-    uint16_t characters[] =
-        { 'a', '\n', '\f', '\b', '\t', '\v', '\r', '\\', '$', 'z' };
+    uint16_t characters[] = {'a',  '\n', '\f', '\b', '\t',
+                             '\v', '\r', '\\', '$',  'z'};
     intptr_t len = ARRAY_SIZE(characters);
 
     const String& str = String::Handle(
         ExternalTwoByteString::New(characters, len, NULL, NULL, Heap::kNew));
-    const String* data[3] = { &str, &Symbols::Dot(), &str };
+    const String* data[3] = {&str, &Symbols::Dot(), &str};
     CheckConcatAll(data, 3);
   }
 
   {
-    uint8_t characters1[] = { 0xF6, 0xF1, 0xE9 };
+    uint8_t characters1[] = {0xF6, 0xF1, 0xE9};
     intptr_t len1 = ARRAY_SIZE(characters1);
 
     const String& str1 = String::Handle(
         ExternalOneByteString::New(characters1, len1, NULL, NULL, Heap::kNew));
 
-    uint16_t characters2[] =
-        { 'a', '\n', '\f', '\b', '\t', '\v', '\r', '\\', '$', 'z' };
+    uint16_t characters2[] = {'a',  '\n', '\f', '\b', '\t',
+                              '\v', '\r', '\\', '$',  'z'};
     intptr_t len2 = ARRAY_SIZE(characters2);
 
     const String& str2 = String::Handle(
         ExternalTwoByteString::New(characters2, len2, NULL, NULL, Heap::kNew));
-    const String* data[3] = { &str1, &Symbols::Dot(), &str2 };
+    const String* data[3] = {&str1, &Symbols::Dot(), &str2};
     CheckConcatAll(data, 3);
   }
 
   {
     const String& empty = String::Handle(String::New(""));
-    const String* data[3] = { &Symbols::FallThroughError(),
-                              &empty,
-                              &Symbols::isPaused() };
+    const String* data[3] = {&Symbols::FallThroughError(), &empty,
+                             &Symbols::isPaused()};
     CheckConcatAll(data, 3);
   }
 }
@@ -4703,19 +4661,20 @@
 
 VM_TEST_CASE(String_ScrubName) {
   TestResult tests[] = {
-    {"(dynamic, dynamic) => void", "(dynamic, dynamic) => void"},
-    {"_List@915557746", "_List"},
-    {"_HashMap@600006304<K, V>(dynamic) => V", "_HashMap<K, V>(dynamic) => V"},
-    {"set:foo", "foo="},
-    {"get:foo", "foo"},
-    {"_ReceivePortImpl@709387912", "_ReceivePortImpl"},
-    {"_ReceivePortImpl@709387912._internal@709387912",
-        "_ReceivePortImpl._internal"},
-    {"_C@6328321&_E@6328321&_F@6328321", "_C&_E&_F"},
-    {"List.", "List"},
-    {"get:foo@6328321", "foo"},
-    {"_MyClass@6328321.", "_MyClass"},
-    {"_MyClass@6328321.named", "_MyClass.named"},
+      {"(dynamic, dynamic) => void", "(dynamic, dynamic) => void"},
+      {"_List@915557746", "_List"},
+      {"_HashMap@600006304<K, V>(dynamic) => V",
+       "_HashMap<K, V>(dynamic) => V"},
+      {"set:foo", "foo="},
+      {"get:foo", "foo"},
+      {"_ReceivePortImpl@709387912", "_ReceivePortImpl"},
+      {"_ReceivePortImpl@709387912._internal@709387912",
+       "_ReceivePortImpl._internal"},
+      {"_C@6328321&_E@6328321&_F@6328321", "_C&_E&_F"},
+      {"List.", "List"},
+      {"get:foo@6328321", "foo"},
+      {"_MyClass@6328321.", "_MyClass"},
+      {"_MyClass@6328321.named", "_MyClass.named"},
   };
   String& test = String::Handle();
   String& result = String::Handle();
@@ -4726,4 +4685,18 @@
   }
 }
 
+
+VM_TEST_CASE(String_EqualsUTF32) {
+  // Regression test for Issue 27433. Checks that comparisons between Strings
+  // and utf32 arrays happens after conversion to utf16 instead of utf32, as
+  // required for proper canonicalization of string literals with a lossy
+  // utf32->utf16 conversion.
+  int32_t char_codes[] = {0,      0x0a,   0x0d,   0x7f,   0xff,
+                          0xffff, 0xd800, 0xdc00, 0xdbff, 0xdfff};
+
+  const String& str =
+      String::Handle(String::FromUTF32(char_codes, ARRAY_SIZE(char_codes)));
+  EXPECT(str.Equals(char_codes, ARRAY_SIZE(char_codes)));
+}
+
 }  // namespace dart
diff --git a/runtime/vm/os.h b/runtime/vm/os.h
index c36c8ed..b90b06d 100644
--- a/runtime/vm/os.h
+++ b/runtime/vm/os.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_OS_H_
-#define VM_OS_H_
+#ifndef RUNTIME_VM_OS_H_
+#define RUNTIME_VM_OS_H_
 
 #include "vm/globals.h"
 
@@ -121,9 +121,7 @@
   // that occur.
   static int SNPrint(char* str, size_t size, const char* format, ...)
       PRINTF_ATTRIBUTE(3, 4);
-  static int VSNPrint(char* str, size_t size,
-                      const char* format,
-                      va_list args);
+  static int VSNPrint(char* str, size_t size, const char* format, va_list args);
 
   // Allocate a string and print formatted output into the buffer.
   // Uses the zone for allocation if one if provided, and otherwise uses
@@ -156,4 +154,4 @@
 
 }  // namespace dart
 
-#endif  // VM_OS_H_
+#endif  // RUNTIME_VM_OS_H_
diff --git a/runtime/vm/os_android.cc b/runtime/vm/os_android.cc
index 92fcfd9..1ce9650 100644
--- a/runtime/vm/os_android.cc
+++ b/runtime/vm/os_android.cc
@@ -7,16 +7,16 @@
 
 #include "vm/os.h"
 
-#include <android/log.h>  // NOLINT
-#include <endian.h>  // NOLINT
-#include <errno.h>  // NOLINT
-#include <limits.h>  // NOLINT
-#include <malloc.h>  // NOLINT
-#include <time.h>  // NOLINT
+#include <android/log.h>   // NOLINT
+#include <endian.h>        // NOLINT
+#include <errno.h>         // NOLINT
+#include <limits.h>        // NOLINT
+#include <malloc.h>        // NOLINT
+#include <time.h>          // NOLINT
 #include <sys/resource.h>  // NOLINT
-#include <sys/time.h>  // NOLINT
-#include <sys/types.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <sys/time.h>      // NOLINT
+#include <sys/types.h>     // NOLINT
+#include <unistd.h>        // NOLINT
 
 #include "platform/utils.h"
 #include "vm/code_observers.h"
@@ -31,8 +31,10 @@
 
 #ifndef PRODUCT
 
-DEFINE_FLAG(bool, generate_perf_events_symbols, false,
-    "Generate events symbols for profiling with perf");
+DEFINE_FLAG(bool,
+            generate_perf_events_symbols,
+            false,
+            "Generate events symbols for profiling with perf");
 
 class PerfCodeObserver : public CodeObserver {
  public:
@@ -69,8 +71,9 @@
       return;
     }
     const char* marker = optimized ? "*" : "";
-    char* buffer = OS::SCreate(Thread::Current()->zone(),
-        "%" Px " %" Px " %s%s\n", base, size, marker, name);
+    char* buffer =
+        OS::SCreate(Thread::Current()->zone(), "%" Px " %" Px " %s%s\n", base,
+                    size, marker, name);
     (*file_write)(buffer, strlen(buffer), out_file_);
   }
 
@@ -184,7 +187,7 @@
 // TODO(5411554):  May need to hoist these architecture dependent code
 // into a architecture specific file e.g: os_ia32_linux.cc
 intptr_t OS::ActivationFrameAlignment() {
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) || \
+#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) ||                   \
     defined(TARGET_ARCH_ARM64)
   const int kMinimumAlignment = 16;
 #elif defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_DBC)
@@ -203,10 +206,8 @@
 
 
 intptr_t OS::PreferredCodeAlignment() {
-#if defined(TARGET_ARCH_IA32) ||                                               \
-    defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM64) ||                                              \
-    defined(TARGET_ARCH_DBC)
+#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) ||                   \
+    defined(TARGET_ARCH_ARM64) || defined(TARGET_ARCH_DBC)
   const int kMinimumAlignment = 32;
 #elif defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS)
   const int kMinimumAlignment = 16;
@@ -390,8 +391,7 @@
   if (str[0] == '-') {
     i = 1;
   }
-  if ((str[i] == '0') &&
-      (str[i + 1] == 'x' || str[i + 1] == 'X') &&
+  if ((str[i] == '0') && (str[i + 1] == 'x' || str[i + 1] == 'X') &&
       (str[i + 2] != '\0')) {
     base = 16;
   }
@@ -430,8 +430,7 @@
 }
 
 
-void OS::Shutdown() {
-}
+void OS::Shutdown() {}
 
 
 void OS::Abort() {
diff --git a/runtime/vm/os_fuchsia.cc b/runtime/vm/os_fuchsia.cc
index 48181f7..1e3fc48 100644
--- a/runtime/vm/os_fuchsia.cc
+++ b/runtime/vm/os_fuchsia.cc
@@ -18,8 +18,10 @@
 
 #ifndef PRODUCT
 
-DEFINE_FLAG(bool, generate_perf_events_symbols, false,
-    "Generate events symbols for profiling with perf");
+DEFINE_FLAG(bool,
+            generate_perf_events_symbols,
+            false,
+            "Generate events symbols for profiling with perf");
 
 #endif  // !PRODUCT
 
@@ -33,21 +35,39 @@
 }
 
 
+static bool LocalTime(int64_t seconds_since_epoch, tm* tm_result) {
+  time_t seconds = static_cast<time_t>(seconds_since_epoch);
+  if (seconds != seconds_since_epoch) {
+    return false;
+  }
+  struct tm* error_code = localtime_r(&seconds, tm_result);
+  return error_code != NULL;
+}
+
+
 const char* OS::GetTimeZoneName(int64_t seconds_since_epoch) {
-  UNIMPLEMENTED();
-  return "";
+  tm decomposed;
+  bool succeeded = LocalTime(seconds_since_epoch, &decomposed);
+  // If unsuccessful, return an empty string like V8 does.
+  return (succeeded && (decomposed.tm_zone != NULL)) ? decomposed.tm_zone : "";
 }
 
 
 int OS::GetTimeZoneOffsetInSeconds(int64_t seconds_since_epoch) {
-  UNIMPLEMENTED();
-  return 0;
+  tm decomposed;
+  bool succeeded = LocalTime(seconds_since_epoch, &decomposed);
+  // Even if the offset was 24 hours it would still easily fit into 32 bits.
+  // If unsuccessful, return zero like V8 does.
+  return succeeded ? static_cast<int>(decomposed.tm_gmtoff) : 0;
 }
 
 
 int OS::GetLocalTimeZoneAdjustmentInSeconds() {
-  UNIMPLEMENTED();
-  return 0;
+  // TODO(floitsch): avoid excessive calls to tzset?
+  tzset();
+  // Even if the offset was 24 hours it would still easily fit into 32 bits.
+  // Note that Unix and Dart disagree on the sign.
+  return static_cast<int>(-timezone);
 }
 
 
@@ -57,12 +77,12 @@
 
 
 int64_t OS::GetCurrentTimeMicros() {
-  return mx_current_time() / 1000;
+  return mx_time_get(MX_CLOCK_UTC) / kNanosecondsPerMicrosecond;
 }
 
 
 int64_t OS::GetCurrentMonotonicTicks() {
-  return mx_current_time();
+  return mx_time_get(MX_CLOCK_MONOTONIC);
 }
 
 
@@ -87,7 +107,7 @@
 // TODO(5411554):  May need to hoist these architecture dependent code
 // into a architecture specific file e.g: os_ia32_fuchsia.cc
 intptr_t OS::ActivationFrameAlignment() {
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) || \
+#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) ||                   \
     defined(TARGET_ARCH_ARM64)
   const int kMinimumAlignment = 16;
 #elif defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_DBC)
@@ -106,10 +126,8 @@
 
 
 intptr_t OS::PreferredCodeAlignment() {
-#if defined(TARGET_ARCH_IA32) ||                                               \
-    defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM64) ||                                              \
-    defined(TARGET_ARCH_DBC)
+#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) ||                   \
+    defined(TARGET_ARCH_ARM64) || defined(TARGET_ARCH_DBC)
   const int kMinimumAlignment = 32;
 #elif defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS)
   const int kMinimumAlignment = 16;
@@ -139,20 +157,19 @@
 
 
 uintptr_t OS::MaxRSS() {
-  UNIMPLEMENTED();
+  // TODO(US-95): Implement.
   return 0;
 }
 
 
 void OS::Sleep(int64_t millis) {
-  mx_nanosleep(
-      millis * kMicrosecondsPerMillisecond * kNanosecondsPerMicrosecond);
+  mx_nanosleep(millis * kMicrosecondsPerMillisecond *
+               kNanosecondsPerMicrosecond);
 }
 
 
 void OS::SleepMicros(int64_t micros) {
-  mx_nanosleep(
-      micros * kNanosecondsPerMicrosecond);
+  mx_nanosleep(micros * kNanosecondsPerMicrosecond);
 }
 
 
@@ -244,8 +261,7 @@
   if (str[0] == '-') {
     i = 1;
   }
-  if ((str[i] == '0') &&
-      (str[i + 1] == 'x' || str[i + 1] == 'X') &&
+  if ((str[i] == '0') && (str[i + 1] == 'x' || str[i + 1] == 'X') &&
       (str[i + 2] != '\0')) {
     base = 16;
   }
@@ -282,8 +298,7 @@
 }
 
 
-void OS::Shutdown() {
-}
+void OS::Shutdown() {}
 
 
 void OS::Abort() {
diff --git a/runtime/vm/os_linux.cc b/runtime/vm/os_linux.cc
index 12dd646..163f436 100644
--- a/runtime/vm/os_linux.cc
+++ b/runtime/vm/os_linux.cc
@@ -7,18 +7,19 @@
 
 #include "vm/os.h"
 
-#include <errno.h>  // NOLINT
-#include <limits.h>  // NOLINT
-#include <malloc.h>  // NOLINT
-#include <time.h>  // NOLINT
+#include <errno.h>         // NOLINT
+#include <limits.h>        // NOLINT
+#include <malloc.h>        // NOLINT
+#include <time.h>          // NOLINT
 #include <sys/resource.h>  // NOLINT
-#include <sys/time.h>  // NOLINT
-#include <sys/types.h>  // NOLINT
-#include <sys/syscall.h>  // NOLINT
-#include <sys/stat.h>  // NOLINT
-#include <fcntl.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <sys/time.h>      // NOLINT
+#include <sys/types.h>     // NOLINT
+#include <sys/syscall.h>   // NOLINT
+#include <sys/stat.h>      // NOLINT
+#include <fcntl.h>         // NOLINT
+#include <unistd.h>        // NOLINT
 
+#include "platform/memory_sanitizer.h"
 #include "platform/utils.h"
 #include "vm/code_observers.h"
 #include "vm/dart.h"
@@ -33,8 +34,10 @@
 
 #ifndef PRODUCT
 
-DEFINE_FLAG(bool, generate_perf_events_symbols, false,
-    "Generate events symbols for profiling with perf");
+DEFINE_FLAG(bool,
+            generate_perf_events_symbols,
+            false,
+            "Generate events symbols for profiling with perf");
 
 // Linux CodeObservers.
 class PerfCodeObserver : public CodeObserver {
@@ -72,8 +75,9 @@
       return;
     }
     const char* marker = optimized ? "*" : "";
-    char* buffer = OS::SCreate(Thread::Current()->zone(),
-        "%" Px " %" Px " %s%s\n", base, size, marker, name);
+    char* buffer =
+        OS::SCreate(Thread::Current()->zone(), "%" Px " %" Px " %s%s\n", base,
+                    size, marker, name);
     {
       MutexLocker ml(CodeObservers::mutex());
       (*file_write)(buffer, strlen(buffer), out_file_);
@@ -191,10 +195,8 @@
 // TODO(5411554):  May need to hoist these architecture dependent code
 // into a architecture specific file e.g: os_ia32_linux.cc
 intptr_t OS::ActivationFrameAlignment() {
-#if defined(TARGET_ARCH_IA32) ||                                               \
-    defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM64) ||                                              \
-    defined(TARGET_ARCH_DBC)
+#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) ||                   \
+    defined(TARGET_ARCH_ARM64) || defined(TARGET_ARCH_DBC)
   const int kMinimumAlignment = 16;
 #elif defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS)
   const int kMinimumAlignment = 8;
@@ -212,10 +214,8 @@
 
 
 intptr_t OS::PreferredCodeAlignment() {
-#if defined(TARGET_ARCH_IA32) ||                                               \
-    defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM64) ||                                              \
-    defined(TARGET_ARCH_DBC)
+#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) ||                   \
+    defined(TARGET_ARCH_ARM64) || defined(TARGET_ARCH_DBC)
   const int kMinimumAlignment = 32;
 #elif defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS)
   const int kMinimumAlignment = 16;
@@ -321,6 +321,7 @@
 
 
 int OS::VSNPrint(char* str, size_t size, const char* format, va_list args) {
+  MSAN_UNPOISON(str, size);
   int retval = vsnprintf(str, size, format, args);
   if (retval < 0) {
     FATAL1("Fatal error in OS::VSNPrint with format '%s'", format);
@@ -370,8 +371,7 @@
   if (str[0] == '-') {
     i = 1;
   }
-  if ((str[i] == '0') &&
-      (str[i + 1] == 'x' || str[i + 1] == 'X') &&
+  if ((str[i] == '0') && (str[i + 1] == 'x' || str[i + 1] == 'X') &&
       (str[i + 2] != '\0')) {
     base = 16;
   }
@@ -408,8 +408,7 @@
 }
 
 
-void OS::Shutdown() {
-}
+void OS::Shutdown() {}
 
 
 void OS::Abort() {
diff --git a/runtime/vm/os_macos.cc b/runtime/vm/os_macos.cc
index db3adbb..7038dd5 100644
--- a/runtime/vm/os_macos.cc
+++ b/runtime/vm/os_macos.cc
@@ -7,17 +7,17 @@
 
 #include "vm/os.h"
 
-#include <errno.h>  // NOLINT
-#include <limits.h>  // NOLINT
-#include <mach/mach.h>  // NOLINT
-#include <mach/clock.h>  // NOLINT
+#include <errno.h>           // NOLINT
+#include <limits.h>          // NOLINT
+#include <mach/mach.h>       // NOLINT
+#include <mach/clock.h>      // NOLINT
 #include <mach/mach_time.h>  // NOLINT
-#include <sys/time.h>  // NOLINT
-#include <sys/resource.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <sys/time.h>        // NOLINT
+#include <sys/resource.h>    // NOLINT
+#include <unistd.h>          // NOLINT
 #if TARGET_OS_IOS
 #include <sys/sysctl.h>  // NOLINT
-#include <syslog.h>  // NOLINT
+#include <syslog.h>      // NOLINT
 #endif
 
 #include "platform/utils.h"
@@ -153,8 +153,8 @@
   if (thread_port == MACH_PORT_NULL) {
     return -1;
   }
-  kern_return_t r = thread_info(thread_port, THREAD_BASIC_INFO,
-                                (thread_info_t)info, &count);
+  kern_return_t r =
+      thread_info(thread_port, THREAD_BASIC_INFO, (thread_info_t)info, &count);
   mach_port_deallocate(mach_task_self(), thread_port);
   ASSERT(r == KERN_SUCCESS);
   int64_t thread_cpu_micros =
@@ -183,7 +183,7 @@
 #else
 #error Unimplemented
 #endif
-#else  // TARGET_OS_IOS
+#else   // TARGET_OS_IOS
   // OS X activation frames must be 16 byte-aligned; see "Mac OS X ABI
   // Function Call Guide".
   return 16;
@@ -192,10 +192,8 @@
 
 
 intptr_t OS::PreferredCodeAlignment() {
-#if defined(TARGET_ARCH_IA32) ||                                               \
-    defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM64) ||                                              \
-    defined(TARGET_ARCH_DBC)
+#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) ||                   \
+    defined(TARGET_ARCH_ARM64) || defined(TARGET_ARCH_DBC)
   const int kMinimumAlignment = 32;
 #elif defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS)
   const int kMinimumAlignment = 16;
@@ -269,9 +267,9 @@
 
 
 char* OS::StrNDup(const char* s, intptr_t n) {
-  // strndup has only been added to Mac OS X in 10.7. We are supplying
-  // our own copy here if needed.
-#if !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || \
+// strndup has only been added to Mac OS X in 10.7. We are supplying
+// our own copy here if needed.
+#if !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) ||                 \
     __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ <= 1060
   intptr_t len = strlen(s);
   if ((n < 0) || (len < 0)) {
@@ -286,16 +284,16 @@
   }
   result[len] = '\0';
   return reinterpret_cast<char*>(memmove(result, s, len));
-#else  // !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || ...
+#else   // !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || ...
   return strndup(s, n);
 #endif  // !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || ...
 }
 
 
 intptr_t OS::StrNLen(const char* s, intptr_t n) {
-  // strnlen has only been added to Mac OS X in 10.7. We are supplying
-  // our own copy here if needed.
-#if !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || \
+// strnlen has only been added to Mac OS X in 10.7. We are supplying
+// our own copy here if needed.
+#if !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) ||                 \
     __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ <= 1060
   intptr_t len = 0;
   while ((len <= n) && (*s != '\0')) {
@@ -303,7 +301,7 @@
     len++;
   }
   return len;
-#else  // !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || ...
+#else   // !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || ...
   return strnlen(s, n);
 #endif  // !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || ...
 }
@@ -389,8 +387,7 @@
   if (str[0] == '-') {
     i = 1;
   }
-  if ((str[i] == '0') &&
-      (str[i + 1] == 'x' || str[i + 1] == 'X') &&
+  if ((str[i] == '0') && (str[i + 1] == 'x' || str[i + 1] == 'X') &&
       (str[i + 2] != '\0')) {
     base = 16;
   }
@@ -400,8 +397,7 @@
 }
 
 
-void OS::RegisterCodeObservers() {
-}
+void OS::RegisterCodeObservers() {}
 
 
 void OS::PrintErr(const char* format, ...) {
@@ -429,8 +425,7 @@
 }
 
 
-void OS::Shutdown() {
-}
+void OS::Shutdown() {}
 
 
 void OS::Abort() {
diff --git a/runtime/vm/os_thread.cc b/runtime/vm/os_thread.cc
index 3700c9f..f5818a2 100644
--- a/runtime/vm/os_thread.cc
+++ b/runtime/vm/os_thread.cc
@@ -20,23 +20,23 @@
 bool OSThread::creation_enabled_ = false;
 
 
-OSThread::OSThread() :
-    BaseThread(true),
-    id_(OSThread::GetCurrentThreadId()),
+OSThread::OSThread()
+    : BaseThread(true),
+      id_(OSThread::GetCurrentThreadId()),
 #if defined(DEBUG)
-    join_id_(kInvalidThreadJoinId),
+      join_id_(kInvalidThreadJoinId),
 #endif
 #ifndef PRODUCT
-    trace_id_(OSThread::GetCurrentThreadTraceId()),
+      trace_id_(OSThread::GetCurrentThreadTraceId()),
 #endif
-    name_(NULL),
-    timeline_block_lock_(new Mutex()),
-    timeline_block_(NULL),
-    thread_list_next_(NULL),
-    thread_interrupt_disabled_(1),  // Thread interrupts disabled by default.
-    log_(new class Log()),
-    stack_base_(0),
-    thread_(NULL) {
+      name_(NULL),
+      timeline_block_lock_(new Mutex()),
+      timeline_block_(NULL),
+      thread_list_next_(NULL),
+      thread_interrupt_disabled_(1),  // Thread interrupts disabled by default.
+      log_(new class Log()),
+      stack_base_(0),
+      thread_(NULL) {
 }
 
 
@@ -67,7 +67,6 @@
 }
 
 
-
 void OSThread::SetName(const char* name) {
   MutexLocker ml(thread_list_lock_);
   // Clear the old thread name.
@@ -135,8 +134,8 @@
 
 
 void OSThread::Cleanup() {
-  // We cannot delete the thread local key and thread list lock,  yet.
-  // See the note on thread_list_lock_ in os_thread.h.
+// We cannot delete the thread local key and thread list lock,  yet.
+// See the note on thread_list_lock_ in os_thread.h.
 #if 0
   if (thread_list_lock_ != NULL) {
     // Delete the thread local key.
@@ -243,7 +242,7 @@
           previous->thread_list_next_ = current->thread_list_next_;
         }
         thread->thread_list_next_ = NULL;
-        final_thread = !creation_enabled_  && (thread_list_head_ == NULL);
+        final_thread = !creation_enabled_ && (thread_list_head_ == NULL);
         break;
       }
       previous = current;
diff --git a/runtime/vm/os_thread.h b/runtime/vm/os_thread.h
index e950832..da29831 100644
--- a/runtime/vm/os_thread.h
+++ b/runtime/vm/os_thread.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_OS_THREAD_H_
-#define VM_OS_THREAD_H_
+#ifndef RUNTIME_VM_OS_THREAD_H_
+#define RUNTIME_VM_OS_THREAD_H_
 
 #include "platform/globals.h"
 #include "vm/allocation.h"
@@ -70,9 +70,7 @@
   }
 #endif
 
-  const char* name() const {
-    return name_;
-  }
+  const char* name() const { return name_; }
 
   void SetName(const char* name);
 
@@ -83,14 +81,10 @@
     name_ = strdup(name);
   }
 
-  Mutex* timeline_block_lock() const {
-    return timeline_block_lock_;
-  }
+  Mutex* timeline_block_lock() const { return timeline_block_lock_; }
 
   // Only safe to access when holding |timeline_block_lock_|.
-  TimelineEventBlock* timeline_block() const {
-    return timeline_block_;
-  }
+  TimelineEventBlock* timeline_block() const { return timeline_block_; }
 
   // Only safe to access when holding |timeline_block_lock_|.
   void set_timeline_block(TimelineEventBlock* block) {
@@ -147,18 +141,17 @@
   static BaseThread* GetCurrentTLS() {
     return reinterpret_cast<BaseThread*>(OSThread::GetThreadLocal(thread_key_));
   }
-  static void SetCurrentTLS(uword value) {
-    SetThreadLocal(thread_key_, value);
-  }
+  static void SetCurrentTLS(uword value) { SetThreadLocal(thread_key_, value); }
 
-  typedef void (*ThreadStartFunction) (uword parameter);
-  typedef void (*ThreadDestructor) (void* parameter);
+  typedef void (*ThreadStartFunction)(uword parameter);
+  typedef void (*ThreadDestructor)(void* parameter);
 
   // Start a thread running the specified function. Returns 0 if the
   // thread started successfuly and a system specific error code if
   // the thread failed to start.
-  static int Start(
-      const char* name, ThreadStartFunction function, uword parameter);
+  static int Start(const char* name,
+                   ThreadStartFunction function,
+                   uword parameter);
 
   static ThreadLocalKey CreateThreadLocal(ThreadDestructor destructor = NULL);
   static void DeleteThreadLocal(ThreadLocalKey key);
@@ -202,9 +195,7 @@
   // We could eliminate this requirement if the windows thread interrupter
   // is implemented differently.
   Thread* thread() const { return thread_; }
-  void set_thread(Thread* value) {
-    thread_ = value;
-  }
+  void set_thread(Thread* value) { thread_ = value; }
 
   static void Cleanup();
 #ifndef PRODUCT
@@ -311,10 +302,7 @@
 
 class Monitor {
  public:
-  enum WaitResult {
-    kNotified,
-    kTimedOut
-  };
+  enum WaitResult { kNotified, kTimedOut };
 
   static const int64_t kNoTimeout = 0;
 
@@ -360,4 +348,4 @@
 }  // namespace dart
 
 
-#endif  // VM_OS_THREAD_H_
+#endif  // RUNTIME_VM_OS_THREAD_H_
diff --git a/runtime/vm/os_thread_android.cc b/runtime/vm/os_thread_android.cc
index 8f9c648..29823b8 100644
--- a/runtime/vm/os_thread_android.cc
+++ b/runtime/vm/os_thread_android.cc
@@ -9,7 +9,7 @@
 
 #include "vm/os_thread.h"
 
-#include <errno.h>  // NOLINT
+#include <errno.h>     // NOLINT
 #include <sys/time.h>  // NOLINT
 
 #include "platform/assert.h"
@@ -20,13 +20,13 @@
 
 namespace dart {
 
-#define VALIDATE_PTHREAD_RESULT(result) \
-  if (result != 0) { \
-    const int kBufferSize = 1024; \
-    char error_message[kBufferSize]; \
-    NOT_IN_PRODUCT(Profiler::DumpStackTrace(true /* native_stack_trace */)); \
-    Utils::StrError(result, error_message, kBufferSize); \
-    FATAL2("pthread error: %d (%s)", result, error_message); \
+#define VALIDATE_PTHREAD_RESULT(result)                                        \
+  if (result != 0) {                                                           \
+    const int kBufferSize = 1024;                                              \
+    char error_message[kBufferSize];                                           \
+    NOT_IN_PRODUCT(Profiler::DumpStackTrace());                                \
+    Utils::StrError(result, error_message, kBufferSize);                       \
+    FATAL2("pthread error: %d (%s)", result, error_message);                   \
   }
 
 
@@ -39,17 +39,17 @@
 
 
 #ifdef DEBUG
-#define RETURN_ON_PTHREAD_FAILURE(result) \
-  if (result != 0) { \
-    const int kBufferSize = 1024; \
-    char error_message[kBufferSize]; \
-    Utils::StrError(result, error_message, kBufferSize); \
-    fprintf(stderr, "%s:%d: pthread error: %d (%s)\n", \
-            __FILE__, __LINE__, result, error_message); \
-    return result; \
+#define RETURN_ON_PTHREAD_FAILURE(result)                                      \
+  if (result != 0) {                                                           \
+    const int kBufferSize = 1024;                                              \
+    char error_message[kBufferSize];                                           \
+    Utils::StrError(result, error_message, kBufferSize);                       \
+    fprintf(stderr, "%s:%d: pthread error: %d (%s)\n", __FILE__, __LINE__,     \
+            result, error_message);                                            \
+    return result;                                                             \
   }
 #else
-#define RETURN_ON_PTHREAD_FAILURE(result) \
+#define RETURN_ON_PTHREAD_FAILURE(result)                                      \
   if (result != 0) return result;
 #endif
 
diff --git a/runtime/vm/os_thread_android.h b/runtime/vm/os_thread_android.h
index c4f3981..0954712 100644
--- a/runtime/vm/os_thread_android.h
+++ b/runtime/vm/os_thread_android.h
@@ -2,10 +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.
 
-#ifndef VM_OS_THREAD_ANDROID_H_
-#define VM_OS_THREAD_ANDROID_H_
+#ifndef RUNTIME_VM_OS_THREAD_ANDROID_H_
+#define RUNTIME_VM_OS_THREAD_ANDROID_H_
 
-#if !defined(VM_OS_THREAD_H_)
+#if !defined(RUNTIME_VM_OS_THREAD_H_)
 #error Do not include os_thread_android.h directly; use os_thread.h instead.
 #endif
 
@@ -77,4 +77,4 @@
 
 }  // namespace dart
 
-#endif  // VM_OS_THREAD_ANDROID_H_
+#endif  // RUNTIME_VM_OS_THREAD_ANDROID_H_
diff --git a/runtime/vm/os_thread_fuchsia.cc b/runtime/vm/os_thread_fuchsia.cc
index 536f11f..c57c2a1 100644
--- a/runtime/vm/os_thread_fuchsia.cc
+++ b/runtime/vm/os_thread_fuchsia.cc
@@ -16,9 +16,9 @@
 
 namespace dart {
 
-#define VALIDATE_PTHREAD_RESULT(result) \
-  if (result != 0) { \
-    FATAL1("pthread error: %d", result); \
+#define VALIDATE_PTHREAD_RESULT(result)                                        \
+  if (result != 0) {                                                           \
+    FATAL1("pthread error: %d", result);                                       \
   }
 
 
@@ -31,23 +31,20 @@
 
 
 #ifdef DEBUG
-#define RETURN_ON_PTHREAD_FAILURE(result) \
-  if (result != 0) { \
-    const int kBufferSize = 1024; \
-    char error_buf[kBufferSize]; \
-    fprintf(stderr, "%s:%d: pthread error: %d\n", \
-            __FILE__, __LINE__, result); \
-    return result; \
+#define RETURN_ON_PTHREAD_FAILURE(result)                                      \
+  if (result != 0) {                                                           \
+    fprintf(stderr, "%s:%d: pthread error: %d\n", __FILE__, __LINE__, result); \
+    return result;                                                             \
   }
 #else
-#define RETURN_ON_PTHREAD_FAILURE(result) \
+#define RETURN_ON_PTHREAD_FAILURE(result)                                      \
   if (result != 0) return result;
 #endif
 
 
 static void ComputeTimeSpecMicros(struct timespec* ts, int64_t micros) {
   // time in nanoseconds.
-  mx_time_t now = mx_current_time();
+  mx_time_t now = mx_time_get(MX_CLOCK_MONOTONIC);
   mx_time_t target = now + (micros * kNanosecondsPerMicrosecond);
   int64_t secs = target / kNanosecondsPerSecond;
   int64_t nanos = target - (secs * kNanosecondsPerSecond);
diff --git a/runtime/vm/os_thread_fuchsia.h b/runtime/vm/os_thread_fuchsia.h
index b45207b..b9275f9 100644
--- a/runtime/vm/os_thread_fuchsia.h
+++ b/runtime/vm/os_thread_fuchsia.h
@@ -2,10 +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.
 
-#ifndef VM_OS_THREAD_FUCHSIA_H_
-#define VM_OS_THREAD_FUCHSIA_H_
+#ifndef RUNTIME_VM_OS_THREAD_FUCHSIA_H_
+#define RUNTIME_VM_OS_THREAD_FUCHSIA_H_
 
-#if !defined(VM_OS_THREAD_H_)
+#if !defined(RUNTIME_VM_OS_THREAD_H_)
 #error Do not include os_thread_fuchsia.h directly; use os_thread.h instead.
 #endif
 
@@ -77,4 +77,4 @@
 
 }  // namespace dart
 
-#endif  // VM_OS_THREAD_FUCHSIA_H_
+#endif  // RUNTIME_VM_OS_THREAD_FUCHSIA_H_
diff --git a/runtime/vm/os_thread_linux.cc b/runtime/vm/os_thread_linux.cc
index ac8a02b..438fb17 100644
--- a/runtime/vm/os_thread_linux.cc
+++ b/runtime/vm/os_thread_linux.cc
@@ -8,10 +8,10 @@
 
 #include "vm/os_thread.h"
 
-#include <errno.h>  // NOLINT
+#include <errno.h>         // NOLINT
 #include <sys/resource.h>  // NOLINT
-#include <sys/syscall.h>  // NOLINT
-#include <sys/time.h>  // NOLINT
+#include <sys/syscall.h>   // NOLINT
+#include <sys/time.h>      // NOLINT
 
 #include "platform/assert.h"
 #include "platform/signal_blocker.h"
@@ -21,13 +21,13 @@
 
 namespace dart {
 
-#define VALIDATE_PTHREAD_RESULT(result) \
-  if (result != 0) { \
-    const int kBufferSize = 1024; \
-    char error_buf[kBufferSize]; \
-    NOT_IN_PRODUCT(Profiler::DumpStackTrace(true /* native_stack_trace */)); \
-    FATAL2("pthread error: %d (%s)", result, \
-           Utils::StrError(result, error_buf, kBufferSize)); \
+#define VALIDATE_PTHREAD_RESULT(result)                                        \
+  if (result != 0) {                                                           \
+    const int kBufferSize = 1024;                                              \
+    char error_buf[kBufferSize];                                               \
+    NOT_IN_PRODUCT(Profiler::DumpStackTrace());                                \
+    FATAL2("pthread error: %d (%s)", result,                                   \
+           Utils::StrError(result, error_buf, kBufferSize));                   \
   }
 
 
@@ -40,17 +40,16 @@
 
 
 #ifdef DEBUG
-#define RETURN_ON_PTHREAD_FAILURE(result) \
-  if (result != 0) { \
-    const int kBufferSize = 1024; \
-    char error_buf[kBufferSize]; \
-    fprintf(stderr, "%s:%d: pthread error: %d (%s)\n", \
-            __FILE__, __LINE__, result, \
-            Utils::StrError(result, error_buf, kBufferSize)); \
-    return result; \
+#define RETURN_ON_PTHREAD_FAILURE(result)                                      \
+  if (result != 0) {                                                           \
+    const int kBufferSize = 1024;                                              \
+    char error_buf[kBufferSize];                                               \
+    fprintf(stderr, "%s:%d: pthread error: %d (%s)\n", __FILE__, __LINE__,     \
+            result, Utils::StrError(result, error_buf, kBufferSize));          \
+    return result;                                                             \
   }
 #else
-#define RETURN_ON_PTHREAD_FAILURE(result) \
+#define RETURN_ON_PTHREAD_FAILURE(result)                                      \
   if (result != 0) return result;
 #endif
 
diff --git a/runtime/vm/os_thread_linux.h b/runtime/vm/os_thread_linux.h
index 306229b..4ee2473 100644
--- a/runtime/vm/os_thread_linux.h
+++ b/runtime/vm/os_thread_linux.h
@@ -2,10 +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.
 
-#ifndef VM_OS_THREAD_LINUX_H_
-#define VM_OS_THREAD_LINUX_H_
+#ifndef RUNTIME_VM_OS_THREAD_LINUX_H_
+#define RUNTIME_VM_OS_THREAD_LINUX_H_
 
-#if !defined(VM_OS_THREAD_H_)
+#if !defined(RUNTIME_VM_OS_THREAD_H_)
 #error Do not include os_thread_linux.h directly; use os_thread.h instead.
 #endif
 
@@ -77,4 +77,4 @@
 
 }  // namespace dart
 
-#endif  // VM_OS_THREAD_LINUX_H_
+#endif  // RUNTIME_VM_OS_THREAD_LINUX_H_
diff --git a/runtime/vm/os_thread_macos.cc b/runtime/vm/os_thread_macos.cc
index 92d0414..23fe4d7 100644
--- a/runtime/vm/os_thread_macos.cc
+++ b/runtime/vm/os_thread_macos.cc
@@ -7,16 +7,16 @@
 
 #include "vm/os_thread.h"
 
-#include <sys/errno.h>  // NOLINT
-#include <sys/types.h>  // NOLINT
-#include <sys/sysctl.h>  // NOLINT
-#include <mach/mach_init.h>  // NOLINT
-#include <mach/mach_host.h>  // NOLINT
-#include <mach/mach_port.h>  // NOLINT
-#include <mach/mach_traps.h>  // NOLINT
-#include <mach/task_info.h>  // NOLINT
+#include <sys/errno.h>         // NOLINT
+#include <sys/types.h>         // NOLINT
+#include <sys/sysctl.h>        // NOLINT
+#include <mach/mach_init.h>    // NOLINT
+#include <mach/mach_host.h>    // NOLINT
+#include <mach/mach_port.h>    // NOLINT
+#include <mach/mach_traps.h>   // NOLINT
+#include <mach/task_info.h>    // NOLINT
 #include <mach/thread_info.h>  // NOLINT
-#include <mach/thread_act.h>  // NOLINT
+#include <mach/thread_act.h>   // NOLINT
 
 #include "platform/assert.h"
 #include "platform/utils.h"
@@ -25,13 +25,13 @@
 
 namespace dart {
 
-#define VALIDATE_PTHREAD_RESULT(result)         \
-  if (result != 0) { \
-    const int kBufferSize = 1024; \
-    char error_message[kBufferSize]; \
-    NOT_IN_PRODUCT(Profiler::DumpStackTrace(true /* native_stack_trace */)); \
-    Utils::StrError(result, error_message, kBufferSize); \
-    FATAL2("pthread error: %d (%s)", result, error_message); \
+#define VALIDATE_PTHREAD_RESULT(result)                                        \
+  if (result != 0) {                                                           \
+    const int kBufferSize = 1024;                                              \
+    char error_message[kBufferSize];                                           \
+    NOT_IN_PRODUCT(Profiler::DumpStackTrace());                                \
+    Utils::StrError(result, error_message, kBufferSize);                       \
+    FATAL2("pthread error: %d (%s)", result, error_message);                   \
   }
 
 
@@ -44,17 +44,17 @@
 
 
 #ifdef DEBUG
-#define RETURN_ON_PTHREAD_FAILURE(result) \
-  if (result != 0) { \
-    const int kBufferSize = 1024; \
-    char error_message[kBufferSize]; \
-    Utils::StrError(result, error_message, kBufferSize); \
-    fprintf(stderr, "%s:%d: pthread error: %d (%s)\n", \
-            __FILE__, __LINE__, result, error_message); \
-    return result; \
+#define RETURN_ON_PTHREAD_FAILURE(result)                                      \
+  if (result != 0) {                                                           \
+    const int kBufferSize = 1024;                                              \
+    char error_message[kBufferSize];                                           \
+    Utils::StrError(result, error_message, kBufferSize);                       \
+    fprintf(stderr, "%s:%d: pthread error: %d (%s)\n", __FILE__, __LINE__,     \
+            result, error_message);                                            \
+    return result;                                                             \
   }
 #else
-#define RETURN_ON_PTHREAD_FAILURE(result) \
+#define RETURN_ON_PTHREAD_FAILURE(result)                                      \
   if (result != 0) return result;
 #endif
 
@@ -394,9 +394,8 @@
         (micros - (secs * kMicrosecondsPerSecond)) * kNanosecondsPerMicrosecond;
     ts.tv_sec = static_cast<int32_t>(secs);
     ts.tv_nsec = static_cast<long>(nanos);  // NOLINT (long used in timespec).
-    int result = pthread_cond_timedwait_relative_np(data_.cond(),
-                                                    data_.mutex(),
-                                                    &ts);
+    int result =
+        pthread_cond_timedwait_relative_np(data_.cond(), data_.mutex(), &ts);
     ASSERT((result == 0) || (result == ETIMEDOUT));
     if (result == ETIMEDOUT) {
       retval = kTimedOut;
diff --git a/runtime/vm/os_thread_macos.h b/runtime/vm/os_thread_macos.h
index 4909edf..2a2fcf5 100644
--- a/runtime/vm/os_thread_macos.h
+++ b/runtime/vm/os_thread_macos.h
@@ -2,10 +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.
 
-#ifndef VM_OS_THREAD_MACOS_H_
-#define VM_OS_THREAD_MACOS_H_
+#ifndef RUNTIME_VM_OS_THREAD_MACOS_H_
+#define RUNTIME_VM_OS_THREAD_MACOS_H_
 
-#if !defined(VM_OS_THREAD_H_)
+#if !defined(RUNTIME_VM_OS_THREAD_H_)
 #error Do not include os_thread_macos.h directly; use os_thread.h instead.
 #endif
 
@@ -78,4 +78,4 @@
 
 }  // namespace dart
 
-#endif  // VM_OS_THREAD_MACOS_H_
+#endif  // RUNTIME_VM_OS_THREAD_MACOS_H_
diff --git a/runtime/vm/os_thread_win.cc b/runtime/vm/os_thread_win.cc
index 6be6804..7599195 100644
--- a/runtime/vm/os_thread_win.cc
+++ b/runtime/vm/os_thread_win.cc
@@ -314,7 +314,7 @@
 void MonitorWaitData::ThreadExit() {
   if (MonitorWaitData::monitor_wait_data_key_ != kUnsetThreadLocalKey) {
     uword raw_wait_data =
-      OSThread::GetThreadLocal(MonitorWaitData::monitor_wait_data_key_);
+        OSThread::GetThreadLocal(MonitorWaitData::monitor_wait_data_key_);
     // Clear in case this is called a second time.
     OSThread::SetThreadLocal(MonitorWaitData::monitor_wait_data_key_, 0);
     if (raw_wait_data != 0) {
@@ -425,7 +425,7 @@
   // Get the MonitorWaitData object containing the event for this
   // thread from thread local storage. Create it if it does not exist.
   uword raw_wait_data =
-    OSThread::GetThreadLocal(MonitorWaitData::monitor_wait_data_key_);
+      OSThread::GetThreadLocal(MonitorWaitData::monitor_wait_data_key_);
   MonitorWaitData* wait_data = NULL;
   if (raw_wait_data == 0) {
     HANDLE event = CreateEvent(NULL, FALSE, FALSE, NULL);
diff --git a/runtime/vm/os_thread_win.h b/runtime/vm/os_thread_win.h
index 913b074..3620570 100644
--- a/runtime/vm/os_thread_win.h
+++ b/runtime/vm/os_thread_win.h
@@ -2,10 +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.
 
-#ifndef VM_OS_THREAD_WIN_H_
-#define VM_OS_THREAD_WIN_H_
+#ifndef RUNTIME_VM_OS_THREAD_WIN_H_
+#define RUNTIME_VM_OS_THREAD_WIN_H_
 
-#if !defined(VM_OS_THREAD_H_)
+#if !defined(RUNTIME_VM_OS_THREAD_H_)
 #error Do not include os_thread_win.h directly; use os_thread.h instead.
 #endif
 
@@ -122,24 +122,18 @@
 };
 
 
-typedef void (*ThreadDestructor) (void* parameter);
+typedef void (*ThreadDestructor)(void* parameter);
 
 
 class ThreadLocalEntry {
  public:
   ThreadLocalEntry(ThreadLocalKey key, ThreadDestructor destructor)
-      : key_(key),
-        destructor_(destructor) {
-  }
+      : key_(key), destructor_(destructor) {}
 
-  ThreadLocalKey key() const {
-    return key_;
-  }
+  ThreadLocalKey key() const { return key_; }
 
 
-  ThreadDestructor destructor() const {
-    return destructor_;
-  }
+  ThreadDestructor destructor() const { return destructor_; }
 
  private:
   ThreadLocalKey key_;
@@ -149,7 +143,7 @@
 };
 
 
-template<typename T>
+template <typename T>
 class MallocGrowableArray;
 
 
@@ -173,4 +167,4 @@
 
 }  // namespace dart
 
-#endif  // VM_OS_THREAD_WIN_H_
+#endif  // RUNTIME_VM_OS_THREAD_WIN_H_
diff --git a/runtime/vm/os_win.cc b/runtime/vm/os_win.cc
index 129dcd1..1134ce7 100644
--- a/runtime/vm/os_win.cc
+++ b/runtime/vm/os_win.cc
@@ -7,10 +7,10 @@
 
 #include "vm/os.h"
 
-#include <malloc.h>  // NOLINT
+#include <malloc.h>   // NOLINT
 #include <process.h>  // NOLINT
-#include <psapi.h>  // NOLINT
-#include <time.h>  // NOLINT
+#include <psapi.h>    // NOLINT
+#include <time.h>     // NOLINT
 
 #include "platform/utils.h"
 #include "platform/assert.h"
@@ -79,14 +79,12 @@
   }
 
   // Convert the wchar string to a null-terminated utf8 string.
-  wchar_t* wchar_name = daylight_savings
-                      ? zone_information.DaylightName
-                      : zone_information.StandardName;
-  intptr_t utf8_len = WideCharToMultiByte(
-      CP_UTF8, 0, wchar_name, -1, NULL, 0, NULL, NULL);
+  wchar_t* wchar_name = daylight_savings ? zone_information.DaylightName
+                                         : zone_information.StandardName;
+  intptr_t utf8_len =
+      WideCharToMultiByte(CP_UTF8, 0, wchar_name, -1, NULL, 0, NULL, NULL);
   char* name = Thread::Current()->zone()->Alloc<char>(utf8_len + 1);
-  WideCharToMultiByte(
-      CP_UTF8, 0, wchar_name, -1, name, utf8_len, NULL, NULL);
+  WideCharToMultiByte(CP_UTF8, 0, wchar_name, -1, name, utf8_len, NULL, NULL);
   name[utf8_len] = '\0';
   return name;
 }
@@ -377,8 +375,7 @@
   if (str[0] == '-') {
     i = 1;
   }
-  if ((str[i] == '0') &&
-      (str[i + 1] == 'x' || str[i + 1] == 'X') &&
+  if ((str[i] == '0') && (str[i + 1] == 'x' || str[i + 1] == 'X') &&
       (str[i + 2] != '\0')) {
     base = 16;
   }
@@ -388,8 +385,7 @@
 }
 
 
-void OS::RegisterCodeObservers() {
-}
+void OS::RegisterCodeObservers() {}
 
 
 void OS::PrintErr(const char* format, ...) {
diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc
index f2bbdf2..36019130 100644
--- a/runtime/vm/pages.cc
+++ b/runtime/vm/pages.cc
@@ -17,23 +17,41 @@
 
 namespace dart {
 
-DEFINE_FLAG(int, heap_growth_rate, 0,
+DEFINE_FLAG(int,
+            heap_growth_rate,
+            0,
             "The max number of pages the heap can grow at a time");
-DEFINE_FLAG(int, old_gen_growth_space_ratio, 20,
+DEFINE_FLAG(int,
+            old_gen_growth_space_ratio,
+            20,
             "The desired maximum percentage of free space after old gen GC");
-DEFINE_FLAG(int, old_gen_growth_time_ratio, 3,
+DEFINE_FLAG(int,
+            old_gen_growth_time_ratio,
+            3,
             "The desired maximum percentage of time spent in old gen GC");
-DEFINE_FLAG(int, old_gen_growth_rate, 280,
+DEFINE_FLAG(int,
+            old_gen_growth_rate,
+            280,
             "The max number of pages the old generation can grow at a time");
-DEFINE_FLAG(bool, print_free_list_before_gc, false,
+DEFINE_FLAG(bool,
+            print_free_list_before_gc,
+            false,
             "Print free list statistics before a GC");
-DEFINE_FLAG(bool, print_free_list_after_gc, false,
+DEFINE_FLAG(bool,
+            print_free_list_after_gc,
+            false,
             "Print free list statistics after a GC");
-DEFINE_FLAG(int, code_collection_interval_in_us, 30000000,
+DEFINE_FLAG(int,
+            code_collection_interval_in_us,
+            30000000,
             "Time between attempts to collect unused code.");
-DEFINE_FLAG(bool, log_code_drop, false,
+DEFINE_FLAG(bool,
+            log_code_drop,
+            false,
             "Emit a log message when pointers to unused code are dropped.");
-DEFINE_FLAG(bool, always_drop_code, false,
+DEFINE_FLAG(bool,
+            always_drop_code,
+            false,
             "Always try to drop code if the function's usage counter is >= 0");
 DEFINE_FLAG(bool, log_growth, false, "Log PageSpace growth policy decisions.");
 
@@ -405,22 +423,22 @@
     // A successful allocation should increase usage_.
     ASSERT(usage_before.used_in_words < usage_.used_in_words);
   }
-  // Note we cannot assert that a failed allocation should not change
-  // used_in_words as another thread could have changed used_in_words.
+// Note we cannot assert that a failed allocation should not change
+// used_in_words as another thread could have changed used_in_words.
 #endif
   ASSERT((result & kObjectAlignmentMask) == kOldObjectAlignmentOffset);
   return result;
 }
 
 
-  void PageSpace::AcquireDataLock() {
-    freelist_[HeapPage::kData].mutex()->Lock();
-  }
+void PageSpace::AcquireDataLock() {
+  freelist_[HeapPage::kData].mutex()->Lock();
+}
 
 
-  void PageSpace::ReleaseDataLock() {
-    freelist_[HeapPage::kData].mutex()->Unlock();
-  }
+void PageSpace::ReleaseDataLock() {
+  freelist_[HeapPage::kData].mutex()->Unlock();
+}
 
 
 void PageSpace::AllocateExternal(intptr_t size) {
@@ -456,6 +474,7 @@
     ASSERT(!Done());
     page_ = space_->NextPageAnySize(page_);
   }
+
  private:
   const PageSpace* space_;
   MutexLocker ml_;
@@ -479,6 +498,7 @@
     ASSERT(!Done());
     page_ = page_->next();
   }
+
  private:
   const PageSpace* space_;
   MutexLocker ml_;
@@ -501,6 +521,7 @@
     ASSERT(!Done());
     page_ = page_->next();
   }
+
  private:
   const PageSpace* space_;
   MutexLocker ml_;
@@ -549,8 +570,7 @@
   ASSERT(heap_ != NULL);
   ASSERT(heap_->isolate() != NULL);
   Isolate* isolate = heap_->isolate();
-  isolate->GetHeapOldUsedMaxMetric()->SetValue(
-      UsedInWords() * kWordSize);
+  isolate->GetHeapOldUsedMaxMetric()->SetValue(UsedInWords() * kWordSize);
 }
 
 
@@ -699,25 +719,25 @@
 
 class HeapMapAsJSONVisitor : public ObjectVisitor {
  public:
-  explicit HeapMapAsJSONVisitor(JSONArray* array) : array_(array) { }
+  explicit HeapMapAsJSONVisitor(JSONArray* array) : array_(array) {}
   virtual void VisitObject(RawObject* obj) {
     array_->AddValue(obj->Size() / kObjectAlignment);
     array_->AddValue(obj->GetClassId());
   }
+
  private:
   JSONArray* array_;
 };
 
 
-void PageSpace::PrintHeapMapToJSONStream(
-    Isolate* isolate, JSONStream* stream) const {
+void PageSpace::PrintHeapMapToJSONStream(Isolate* isolate,
+                                         JSONStream* stream) const {
   if (!FLAG_support_service) {
     return;
   }
   JSONObject heap_map(stream);
   heap_map.AddProperty("type", "HeapMap");
-  heap_map.AddProperty("freeClassId",
-                       static_cast<intptr_t>(kFreeListElement));
+  heap_map.AddProperty("freeClassId", static_cast<intptr_t>(kFreeListElement));
   heap_map.AddProperty("unitSizeBytes",
                        static_cast<intptr_t>(kObjectAlignment));
   heap_map.AddProperty("pageSizeBytes", kPageSizeInWords * kWordSize);
@@ -735,16 +755,16 @@
     JSONArray all_pages(&heap_map, "pages");
     for (HeapPage* page = pages_; page != NULL; page = page->next()) {
       JSONObject page_container(&all_pages);
-      page_container.AddPropertyF("objectStart",
-                                  "0x%" Px "", page->object_start());
+      page_container.AddPropertyF("objectStart", "0x%" Px "",
+                                  page->object_start());
       JSONArray page_map(&page_container, "objects");
       HeapMapAsJSONVisitor printer(&page_map);
       page->VisitObjects(&printer);
     }
     for (HeapPage* page = exec_pages_; page != NULL; page = page->next()) {
       JSONObject page_container(&all_pages);
-      page_container.AddPropertyF("objectStart",
-                                  "0x%" Px "", page->object_start());
+      page_container.AddPropertyF("objectStart", "0x%" Px "",
+                                  page->object_start());
       JSONArray page_map(&page_container, "objects");
       HeapMapAsJSONVisitor printer(&page_map);
       page->VisitObjects(&printer);
@@ -841,8 +861,7 @@
     SpaceUsage usage_before = GetCurrentUsage();
 
     // Mark all reachable old-gen objects.
-    bool collect_code = FLAG_collect_code &&
-                        ShouldCollectCode() &&
+    bool collect_code = FLAG_collect_code && ShouldCollectCode() &&
                         !isolate->HasAttemptedReload();
     GCMarker marker(heap_);
     marker.MarkObjects(isolate, this, invoke_api_callbacks, collect_code);
@@ -911,8 +930,8 @@
         page = pages_;
         while (page != NULL) {
           HeapPage* next_page = page->next();
-          bool page_in_use = sweeper.SweepPage(
-              page, &freelist_[page->type()], true);
+          bool page_in_use =
+              sweeper.SweepPage(page, &freelist_[page->type()], true);
           if (page_in_use) {
             prev_page = page;
           } else {
@@ -928,8 +947,8 @@
         }
       } else {
         // Start the concurrent sweeper task now.
-        GCSweeper::SweepConcurrent(
-            isolate, pages_, pages_tail_, &freelist_[HeapPage::kData]);
+        GCSweeper::SweepConcurrent(isolate, pages_, pages_tail_,
+                                   &freelist_[HeapPage::kData]);
       }
     }
 
@@ -939,9 +958,8 @@
     int64_t end = OS::GetCurrentTimeMicros();
 
     // Record signals for growth control. Include size of external allocations.
-    page_space_controller_.EvaluateGarbageCollection(usage_before,
-                                                     GetCurrentUsage(),
-                                                     start, end);
+    page_space_controller_.EvaluateGarbageCollection(
+        usage_before, GetCurrentUsage(), start, end);
 
     heap_->RecordTime(kMarkObjects, mid1 - start);
     heap_->RecordTime(kResetFreeLists, mid2 - mid1);
@@ -979,21 +997,18 @@
   if (remaining < size) {
     // Checking this first would be logical, but needlessly slow.
     if (size >= kAllocatablePageSize) {
-      return is_locked ?
-          TryAllocateDataLocked(size, growth_policy) :
-          TryAllocate(size, HeapPage::kData, growth_policy);
+      return is_locked ? TryAllocateDataLocked(size, growth_policy)
+                       : TryAllocate(size, HeapPage::kData, growth_policy);
     }
-    FreeListElement* block = is_locked ?
-        freelist_[HeapPage::kData].TryAllocateLargeLocked(size) :
-        freelist_[HeapPage::kData].TryAllocateLarge(size);
+    FreeListElement* block =
+        is_locked ? freelist_[HeapPage::kData].TryAllocateLargeLocked(size)
+                  : freelist_[HeapPage::kData].TryAllocateLarge(size);
     if (block == NULL) {
       // Allocating from a new page (if growth policy allows) will have the
       // side-effect of populating the freelist with a large block. The next
       // bump allocation request will have a chance to consume that block.
       // TODO(koda): Could take freelist lock just once instead of twice.
-      return TryAllocateInFreshPage(size,
-                                    HeapPage::kData,
-                                    growth_policy,
+      return TryAllocateInFreshPage(size, HeapPage::kData, growth_policy,
                                     is_locked);
     }
     intptr_t block_size = block->Size();
@@ -1013,7 +1028,7 @@
   bump_top_ += size;
   AtomicOperations::IncrementBy(&(usage_.used_in_words),
                                 (size >> kWordSizeLog2));
-  // Note: Remaining block is unwalkable until MakeIterable is called.
+// Note: Remaining block is unwalkable until MakeIterable is called.
 #ifdef DEBUG
   if (bump_top_ < bump_end_) {
     // Fail fast if we try to walk the remaining block.
@@ -1071,7 +1086,7 @@
   page->object_end_ = memory->end();
 
   MutexLocker ml(pages_lock_);
-  HeapPage** first, **tail;
+  HeapPage **first, **tail;
   if (is_executable) {
     ASSERT(Utils::IsAligned(pointer, OS::PreferredCodeAlignment()));
     page->type_ = HeapPage::kExecutable;
@@ -1102,8 +1117,7 @@
       desired_utilization_((100.0 - heap_growth_ratio) / 100.0),
       heap_growth_max_(heap_growth_max),
       garbage_collection_time_ratio_(garbage_collection_time_ratio),
-      last_code_collection_in_us_(OS::GetCurrentTimeMicros()) {
-}
+      last_code_collection_in_us_(OS::GetCurrentTimeMicros()) {}
 
 
 PageSpaceController::~PageSpaceController() {}
@@ -1139,18 +1153,17 @@
   bool needs_gc = capacity_increase_in_pages * multiplier > grow_heap_;
   if (FLAG_log_growth) {
     OS::PrintErr("%s: %" Pd " * %f %s %" Pd "\n",
-                 needs_gc ? "NEEDS GC" : "grow",
-                 capacity_increase_in_pages,
-                 multiplier,
-                 needs_gc ? ">" : "<=",
-                 grow_heap_);
+                 needs_gc ? "NEEDS GC" : "grow", capacity_increase_in_pages,
+                 multiplier, needs_gc ? ">" : "<=", grow_heap_);
   }
   return needs_gc;
 }
 
 
-void PageSpaceController::EvaluateGarbageCollection(
-    SpaceUsage before, SpaceUsage after, int64_t start, int64_t end) {
+void PageSpaceController::EvaluateGarbageCollection(SpaceUsage before,
+                                                    SpaceUsage after,
+                                                    int64_t start,
+                                                    int64_t end) {
   ASSERT(end >= start);
   history_.AddGarbageCollectionTime(start, end);
   const int gc_time_fraction = history_.GarbageCollectionTimeFraction();
@@ -1174,15 +1187,16 @@
       t += (gc_time_fraction - garbage_collection_time_ratio_) / 100.0;
     }
 
-    const intptr_t grow_ratio = (
-        static_cast<intptr_t>(after.capacity_in_words / desired_utilization_) -
-        after.capacity_in_words) / PageSpace::kPageSizeInWords;
+    const intptr_t grow_ratio =
+        (static_cast<intptr_t>(after.capacity_in_words / desired_utilization_) -
+         after.capacity_in_words) /
+        PageSpace::kPageSizeInWords;
     if (garbage_ratio == 0) {
       // No garbage in the previous cycle so it would be hard to compute a
       // grow_heap_ size based on estimated garbage so we use growth ratio
       // heuristics instead.
-      grow_heap_ = Utils::Maximum(static_cast<intptr_t>(heap_growth_max_),
-                                  grow_ratio);
+      grow_heap_ =
+          Utils::Maximum(static_cast<intptr_t>(heap_growth_max_), grow_ratio);
     } else {
       // Find minimum 'grow_heap_' such that after increasing capacity by
       // 'grow_heap_' pages and filling them, we expect a GC to be worthwhile.
@@ -1192,7 +1206,7 @@
       while (min < max) {
         local_grow_heap = (max + min) / 2;
         const intptr_t limit = after.capacity_in_words +
-            (grow_heap_ * PageSpace::kPageSizeInWords);
+                               (grow_heap_ * PageSpace::kPageSizeInWords);
         const intptr_t allocated_before_next_gc = limit - after.used_in_words;
         const double estimated_garbage = k * allocated_before_next_gc;
         if (t <= estimated_garbage / limit) {
@@ -1225,8 +1239,8 @@
 }
 
 
-void PageSpaceGarbageCollectionHistory::
-    AddGarbageCollectionTime(int64_t start, int64_t end) {
+void PageSpaceGarbageCollectionHistory::AddGarbageCollectionTime(int64_t start,
+                                                                 int64_t end) {
   Entry entry;
   entry.start = start;
   entry.end = end;
@@ -1247,8 +1261,8 @@
     return 0;
   } else {
     ASSERT(total_time >= gc_time);
-    int result = static_cast<int>((static_cast<double>(gc_time) /
-                                   static_cast<double>(total_time)) * 100);
+    int result = static_cast<int>(
+        (static_cast<double>(gc_time) / static_cast<double>(total_time)) * 100);
     return result;
   }
 }
diff --git a/runtime/vm/pages.h b/runtime/vm/pages.h
index 06e3ab5..d1cfad2 100644
--- a/runtime/vm/pages.h
+++ b/runtime/vm/pages.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_PAGES_H_
-#define VM_PAGES_H_
+#ifndef RUNTIME_VM_PAGES_H_
+#define RUNTIME_VM_PAGES_H_
 
 #include "vm/freelist.h"
 #include "vm/globals.h"
@@ -28,30 +28,17 @@
 // A page containing old generation objects.
 class HeapPage {
  public:
-  enum PageType {
-    kData = 0,
-    kExecutable,
-    kReadOnlyData,
-    kNumPageTypes
-  };
+  enum PageType { kData = 0, kExecutable, kReadOnlyData, kNumPageTypes };
 
   HeapPage* next() const { return next_; }
   void set_next(HeapPage* next) { next_ = next; }
 
-  bool Contains(uword addr) {
-    return memory_->Contains(addr);
-  }
+  bool Contains(uword addr) { return memory_->Contains(addr); }
 
-  uword object_start() const {
-    return memory_->start() + ObjectStartOffset();
-  }
-  uword object_end() const {
-    return object_end_;
-  }
+  uword object_start() const { return memory_->start() + ObjectStartOffset(); }
+  uword object_end() const { return object_end_; }
 
-  PageType type() const {
-    return type_;
-  }
+  PageType type() const { return type_; }
 
   bool embedder_allocated() const { return memory_->embedder_allocated(); }
 
@@ -137,26 +124,19 @@
   // Should be called after each collection to update the controller state.
   void EvaluateGarbageCollection(SpaceUsage before,
                                  SpaceUsage after,
-                                 int64_t start, int64_t end);
+                                 int64_t start,
+                                 int64_t end);
 
   int64_t last_code_collection_in_us() { return last_code_collection_in_us_; }
   void set_last_code_collection_in_us(int64_t t) {
     last_code_collection_in_us_ = t;
   }
 
-  void set_last_usage(SpaceUsage current) {
-    last_usage_ = current;
-  }
+  void set_last_usage(SpaceUsage current) { last_usage_ = current; }
 
-  void Enable() {
-    is_enabled_ = true;
-  }
-  void Disable() {
-    is_enabled_ = false;
-  }
-  bool is_enabled() {
-    return is_enabled_;
-  }
+  void Enable() { is_enabled_ = true; }
+  void Disable() { is_enabled_ = false; }
+  bool is_enabled() { return is_enabled_; }
 
  private:
   Heap* heap_;
@@ -199,10 +179,7 @@
   // TODO(iposva): Determine heap sizes and tune the page size accordingly.
   static const intptr_t kPageSizeInWords = 256 * KBInWords;
 
-  enum GrowthPolicy {
-    kControlGrowth,
-    kForceGrowth
-  };
+  enum GrowthPolicy { kControlGrowth, kForceGrowth };
 
   PageSpace(Heap* heap,
             intptr_t max_capacity_in_words,
@@ -215,8 +192,8 @@
     bool is_protected =
         (type == HeapPage::kExecutable) && FLAG_write_protect_code;
     bool is_locked = false;
-    return TryAllocateInternal(
-        size, type, growth_policy, is_protected, is_locked);
+    return TryAllocateInternal(size, type, growth_policy, is_protected,
+                               is_locked);
   }
 
   bool NeedsGarbageCollection() const {
@@ -230,8 +207,8 @@
     return usage_.capacity_in_words;
   }
   void IncreaseCapacityInWords(intptr_t increase_in_words) {
-     MutexLocker ml(pages_lock_);
-     IncreaseCapacityInWordsLocked(increase_in_words);
+    MutexLocker ml(pages_lock_);
+    IncreaseCapacityInWordsLocked(increase_in_words);
   }
   void IncreaseCapacityInWordsLocked(intptr_t increase_in_words) {
     DEBUG_ASSERT(pages_lock_->IsOwnedByCurrentThread());
@@ -242,9 +219,7 @@
   void UpdateMaxCapacityLocked();
   void UpdateMaxUsed();
 
-  int64_t ExternalInWords() const {
-    return usage_.external_in_words;
-  }
+  int64_t ExternalInWords() const { return usage_.external_in_words; }
   SpaceUsage GetCurrentUsage() const {
     MutexLocker ml(pages_lock_);
     return usage_;
@@ -252,9 +227,7 @@
 
   bool Contains(uword addr) const;
   bool Contains(uword addr, HeapPage::PageType type) const;
-  bool IsValidAddress(uword addr) const {
-    return Contains(addr);
-  }
+  bool IsValidAddress(uword addr) const { return Contains(addr); }
 
   void VisitObjects(ObjectVisitor* visitor) const;
   void VisitObjectsNoEmbedderPages(ObjectVisitor* visitor) const;
@@ -285,13 +258,11 @@
     }
   }
 
-  bool GrowthControlState() {
-    return page_space_controller_.is_enabled();
-  }
+  bool GrowthControlState() { return page_space_controller_.is_enabled(); }
 
   bool NeedsExternalGC() const {
     return (max_external_in_words_ != 0) &&
-        (ExternalInWords() > max_external_in_words_);
+           (ExternalInWords() > max_external_in_words_);
   }
 
   // Note: Code pages are made executable/non-executable when 'read_only' is
@@ -299,21 +270,13 @@
   void WriteProtect(bool read_only);
   void WriteProtectCode(bool read_only);
 
-  void AddGCTime(int64_t micros) {
-    gc_time_micros_ += micros;
-  }
+  void AddGCTime(int64_t micros) { gc_time_micros_ += micros; }
 
-  int64_t gc_time_micros() const {
-    return gc_time_micros_;
-  }
+  int64_t gc_time_micros() const { return gc_time_micros_; }
 
-  void IncrementCollections() {
-    collections_++;
-  }
+  void IncrementCollections() { collections_++; }
 
-  intptr_t collections() const {
-    return collections_;
-  }
+  intptr_t collections() const { return collections_; }
 
 #ifndef PRODUCT
   void PrintToJSONObject(JSONObject* object) const;
@@ -330,9 +293,7 @@
   uword TryAllocateDataLocked(intptr_t size, GrowthPolicy growth_policy) {
     bool is_protected = false;
     bool is_locked = true;
-    return TryAllocateInternal(size,
-                               HeapPage::kData,
-                               growth_policy,
+    return TryAllocateInternal(size, HeapPage::kData, growth_policy,
                                is_protected, is_locked);
   }
 
@@ -468,4 +429,4 @@
 
 }  // namespace dart
 
-#endif  // VM_PAGES_H_
+#endif  // RUNTIME_VM_PAGES_H_
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index def0cfd..1a91fcb 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -16,6 +16,7 @@
 #include "vm/compiler_stats.h"
 #include "vm/dart_api_impl.h"
 #include "vm/dart_entry.h"
+#include "vm/kernel_to_il.h"
 #include "vm/growable_array.h"
 #include "vm/handles.h"
 #include "vm/hash_table.h"
@@ -44,23 +45,36 @@
 DEFINE_FLAG(bool, enable_debug_break, false, "Allow use of break \"message\".");
 DEFINE_FLAG(bool, trace_parser, false, "Trace parser operations.");
 DEFINE_FLAG(bool, warn_mixin_typedef, true, "Warning on legacy mixin typedef.");
+DEFINE_FLAG(bool, warn_new_tearoff_syntax, true, "Warning on new tear off.");
 // TODO(floitsch): remove the conditional-directive flag, once we publicly
 // committed to the current version.
-DEFINE_FLAG(bool, conditional_directives, true,
-    "Enable conditional directives");
-DEFINE_FLAG(bool, generic_method_syntax, false, "Enable generic functions.");
-DEFINE_FLAG(bool, initializing_formal_access, false,
-    "Make initializing formal parameters visible in initializer list.");
-DEFINE_FLAG(bool, warn_super, false,
-    "Warning if super initializer not last in initializer list.");
+DEFINE_FLAG(bool,
+            conditional_directives,
+            true,
+            "Enable conditional directives");
+DEFINE_FLAG(bool, generic_method_syntax, true, "Enable generic functions.");
+DEFINE_FLAG(bool,
+            initializing_formal_access,
+            true,
+            "Make initializing formal parameters visible in initializer list.");
+DEFINE_FLAG(bool,
+            warn_super,
+            false,
+            "Warning if super initializer not last in initializer list.");
 DEFINE_FLAG(bool, warn_patch, false, "Warn on old-style patch syntax.");
-DEFINE_FLAG(bool, await_is_keyword, false,
+DEFINE_FLAG(
+    bool,
+    await_is_keyword,
+    false,
     "await and yield are treated as proper keywords in synchronous code.");
-DEFINE_FLAG(bool, assert_initializer, false,
-    "Allow asserts in initializer lists.");
+DEFINE_FLAG(bool,
+            assert_initializer,
+            false,
+            "Allow asserts in initializer lists.");
 
 DECLARE_FLAG(bool, profile_vm);
 DECLARE_FLAG(bool, trace_service);
+DECLARE_FLAG(bool, ignore_patch_signature_mismatch);
 
 // Quick access to the current thread, isolate and zone.
 #define T (thread())
@@ -84,8 +98,8 @@
         intptr_t line, column;
         script.GetTokenLocation(token_pos, &line, &column);
         PrintIndent();
-        OS::Print("%s (line %" Pd ", col %" Pd ", token %" Pd ")\n",
-                  msg, line, column, token_pos.value());
+        OS::Print("%s (line %" Pd ", col %" Pd ", token %" Pd ")\n", msg, line,
+                  column, token_pos.value());
       }
       (*indent_)++;
     }
@@ -99,13 +113,15 @@
 
  private:
   void PrintIndent() {
-    for (intptr_t i = 0; i < *indent_; i++) { OS::Print(". "); }
+    for (intptr_t i = 0; i < *indent_; i++) {
+      OS::Print(". ");
+    }
   }
   intptr_t* indent_;
 };
 
 
-#define TRACE_PARSER(s) \
+#define TRACE_PARSER(s)                                                        \
   TraceParser __p__(this->TokenPos(), this->script_, &this->trace_indent_, s)
 
 #else  // not DEBUG
@@ -118,9 +134,7 @@
   BoolScope(bool* addr, bool new_value) : _addr(addr), _saved_value(*addr) {
     *_addr = new_value;
   }
-  ~BoolScope() {
-    *_addr = _saved_value;
-  }
+  ~BoolScope() { *_addr = _saved_value; }
 
  private:
   bool* _addr;
@@ -131,14 +145,9 @@
 // Helper class to save and restore token position.
 class Parser::TokenPosScope : public ValueObject {
  public:
-  explicit TokenPosScope(Parser *p) : p_(p) {
-    saved_pos_ = p_->TokenPos();
-  }
-  TokenPosScope(Parser *p, TokenPosition pos) : p_(p), saved_pos_(pos) {
-  }
-  ~TokenPosScope() {
-    p_->SetPosition(saved_pos_);
-  }
+  explicit TokenPosScope(Parser* p) : p_(p) { saved_pos_ = p_->TokenPos(); }
+  TokenPosScope(Parser* p, TokenPosition pos) : p_(p), saved_pos_(pos) {}
+  ~TokenPosScope() { p_->SetPosition(saved_pos_); }
 
  private:
   Parser* p_;
@@ -159,9 +168,7 @@
       parser_->CheckStack();
     }
   }
-  ~RecursionChecker() {
-    parser_->recursion_counter_--;
-  }
+  ~RecursionChecker() { parser_->recursion_counter_--; }
 
  private:
   Parser* parser_;
@@ -195,7 +202,8 @@
       // the resulting code anyway.
       if (Compiler::IsBackgroundCompilation()) {
         if (!other->IsConsistentWith(*field)) {
-          Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId,
+          Compiler::AbortBackgroundCompilation(
+              Thread::kNoDeoptId,
               "Field's guarded state changed during compilation");
         }
       }
@@ -213,24 +221,32 @@
 
 
 void ParsedFunction::Bailout(const char* origin, const char* reason) const {
-  Report::MessageF(Report::kBailout,
-                   Script::Handle(function_.script()),
-                   function_.token_pos(),
-                   Report::AtLocation,
-                   "%s Bailout in %s: %s",
-                   origin,
-                   String::Handle(function_.name()).ToCString(),
-                   reason);
+  Report::MessageF(Report::kBailout, Script::Handle(function_.script()),
+                   function_.token_pos(), Report::AtLocation,
+                   "%s Bailout in %s: %s", origin,
+                   String::Handle(function_.name()).ToCString(), reason);
   UNREACHABLE();
 }
 
 
+kernel::ScopeBuildingResult* ParsedFunction::EnsureKernelScopes() {
+  if (kernel_scopes_ == NULL) {
+    kernel::TreeNode* node = NULL;
+    if (function().kernel_function() != NULL) {
+      node = static_cast<kernel::TreeNode*>(function().kernel_function());
+    }
+    kernel::ScopeBuilder builder(this, node);
+    kernel_scopes_ = builder.BuildScopes();
+  }
+  return kernel_scopes_;
+}
+
+
 LocalVariable* ParsedFunction::EnsureExpressionTemp() {
   if (!has_expression_temp_var()) {
     LocalVariable* temp =
-        new (Z) LocalVariable(function_.token_pos(),
-                              Symbols::ExprTemp(),
-                              Object::dynamic_type());
+        new (Z) LocalVariable(function_.token_pos(), function_.token_pos(),
+                              Symbols::ExprTemp(), Object::dynamic_type());
     ASSERT(temp != NULL);
     set_expression_temp_var(temp);
   }
@@ -241,10 +257,9 @@
 
 void ParsedFunction::EnsureFinallyReturnTemp(bool is_async) {
   if (!has_finally_return_temp_var()) {
-    LocalVariable* temp = new(Z) LocalVariable(
-        function_.token_pos(),
-        Symbols::FinallyRetVal(),
-        Object::dynamic_type());
+    LocalVariable* temp =
+        new (Z) LocalVariable(function_.token_pos(), function_.token_pos(),
+                              Symbols::FinallyRetVal(), Object::dynamic_type());
     ASSERT(temp != NULL);
     temp->set_is_final();
     if (is_async) {
@@ -311,12 +326,9 @@
   // Allocate parameters and local variables, either in the local frame or
   // in the context(s).
   bool found_captured_variables = false;
-  int next_free_frame_index =
-      scope->AllocateVariables(first_parameter_index_,
-                               num_params,
-                               first_stack_local_index_,
-                               NULL,
-                               &found_captured_variables);
+  int next_free_frame_index = scope->AllocateVariables(
+      first_parameter_index_, num_params, first_stack_local_index_, NULL,
+      &found_captured_variables);
 
   // Frame indices are relative to the frame pointer and are decreasing.
   ASSERT(next_free_frame_index <= first_stack_local_index_);
@@ -329,7 +341,7 @@
       : token_pos(TokenPosition::kNoSource),
         type(NULL),
         name(NULL),
-        var(NULL) { }
+        var(NULL) {}
   TokenPosition token_pos;
   const AbstractType* type;
   const String* name;
@@ -357,7 +369,7 @@
 
 struct Parser::Block : public ZoneAllocated {
   Block(Block* outer_block, LocalScope* local_scope, SequenceNode* seq)
-    : parent(outer_block), scope(local_scope), statements(seq) {
+      : parent(outer_block), scope(local_scope), statements(seq) {
     ASSERT(scope != NULL);
     ASSERT(statements != NULL);
   }
@@ -378,7 +390,7 @@
         outer_try_(outer_try),
         try_index_(try_index),
         inside_catch_(false),
-        inside_finally_(false) { }
+        inside_finally_(false) {}
 
   TryStack* outer_try() const { return outer_try_; }
   Block* try_block() const { return try_block_; }
@@ -390,7 +402,7 @@
   void exit_finally() { inside_finally_ = false; }
 
   void AddNodeForFinallyInlining(AstNode* node);
-  void RemoveJumpToLabel(SourceLabel *label);
+  void RemoveJumpToLabel(SourceLabel* label);
   AstNode* GetNodeToInlineFinally(int index) {
     if (0 <= index && index < inlined_finally_nodes_.length()) {
       return inlined_finally_nodes_[index];
@@ -403,7 +415,7 @@
   GrowableArray<AstNode*> inlined_finally_nodes_;
   TryStack* outer_try_;
   const intptr_t try_index_;
-  bool inside_catch_;  // True when parsing a catch clause of this try.
+  bool inside_catch_;    // True when parsing a catch clause of this try.
   bool inside_finally_;  // True when parsing a finally clause of an inner try
                          // of this try.
 
@@ -416,7 +428,7 @@
 }
 
 
-void Parser::TryStack::RemoveJumpToLabel(SourceLabel *label) {
+void Parser::TryStack::RemoveJumpToLabel(SourceLabel* label) {
   int i = 0;
   while (i < inlined_finally_nodes_.length()) {
     if (inlined_finally_nodes_[i]->IsJumpNode()) {
@@ -484,14 +496,15 @@
       current_member_(NULL),
       allow_function_literals_(true),
       parsed_function_(parsed_function),
-      innermost_function_(Function::Handle(zone(),
-                                           parsed_function->function().raw())),
+      innermost_function_(
+          Function::Handle(zone(), parsed_function->function().raw())),
       literal_token_(LiteralToken::Handle(zone())),
-      current_class_(Class::Handle(zone(),
-                                   parsed_function->function().Owner())),
-      library_(Library::Handle(zone(), Class::Handle(
+      current_class_(
+          Class::Handle(zone(), parsed_function->function().Owner())),
+      library_(Library::Handle(
           zone(),
-          parsed_function->function().origin()).library())),
+          Class::Handle(zone(), parsed_function->function().origin())
+              .library())),
       try_stack_(NULL),
       last_used_try_index_(0),
       unregister_pending_function_(false),
@@ -511,7 +524,7 @@
     ASSERT(!pending_functions.IsNull());
     ASSERT(pending_functions.Length() > 0);
     ASSERT(pending_functions.At(pending_functions.Length() - 1) ==
-        current_function().raw());
+           current_function().raw());
     pending_functions.RemoveLast();
   }
 }
@@ -529,8 +542,8 @@
 
 void Parser::SetScript(const Script& script, TokenPosition token_pos) {
   script_ = script.raw();
-  tokens_iterator_.SetStream(
-      TokenStream::Handle(Z, script.tokens()), token_pos);
+  tokens_iterator_.SetStream(TokenStream::Handle(Z, script.tokens()),
+                             token_pos);
   token_kind_ = Token::kILLEGAL;
 }
 
@@ -599,8 +612,7 @@
   CSTAT_TIMER_SCOPE(thread, parser_timer);
 #ifndef PRODUCT
   VMTagScope tagScope(thread, VMTag::kCompileTopLevelTagId);
-  TimelineDurationScope tds(thread,
-                            Timeline::GetCompilerStream(),
+  TimelineDurationScope tds(thread, Timeline::GetCompilerStream(),
                             "CompileTopLevel");
   if (tds.enabled()) {
     tds.SetNumArguments(1);
@@ -629,8 +641,7 @@
 
 
 String* Parser::CurrentLiteral() const {
-  String& result =
-      String::ZoneHandle(Z, tokens_iterator_.CurrentLiteral());
+  String& result = String::ZoneHandle(Z, tokens_iterator_.CurrentLiteral());
   return &result;
 }
 
@@ -660,13 +671,13 @@
         var(NULL),
         is_final(false),
         is_field_initializer(false),
-        has_explicit_type(false) { }
+        has_explicit_type(false) {}
   const AbstractType* type;
   TokenPosition name_pos;
   const String* name;
   const Instance* default_value;  // NULL if not an optional parameter.
   const Object* metadata;  // NULL if no metadata or metadata not evaluated.
-  LocalVariable* var;  // Scope variable allocated for this parameter.
+  LocalVariable* var;      // Scope variable allocated for this parameter.
   bool is_final;
   bool is_field_initializer;
   bool has_explicit_type;
@@ -674,9 +685,7 @@
 
 
 struct ParamList {
-  ParamList() {
-    Clear();
-  }
+  ParamList() { Clear(); }
 
   void Clear() {
     num_fixed_parameters = 0;
@@ -702,8 +711,7 @@
     this->parameters->Add(param);
   }
 
-  void AddReceiver(const AbstractType* receiver_type,
-                   TokenPosition token_pos) {
+  void AddReceiver(const AbstractType* receiver_type, TokenPosition token_pos) {
     ASSERT(this->parameters->is_empty());
     AddFinalParameter(token_pos, &Symbols::This(), receiver_type);
   }
@@ -739,9 +747,7 @@
     }
   }
 
-  void SetImplicitlyFinal() {
-    implicitly_final = true;
-  }
+  void SetImplicitlyFinal() { implicitly_final = true; }
 
   int num_fixed_parameters;
   int num_optional_parameters;
@@ -756,9 +762,7 @@
 
 
 struct MemberDesc {
-  MemberDesc() {
-    Clear();
-  }
+  MemberDesc() { Clear(); }
 
   void Clear() {
     has_abstract = false;
@@ -791,12 +795,8 @@
   bool IsFactoryOrConstructor() const {
     return (kind == RawFunction::kConstructor);
   }
-  bool IsGetter() const {
-    return kind == RawFunction::kGetterFunction;
-  }
-  bool IsSetter() const {
-    return kind == RawFunction::kSetterFunction;
-  }
+  bool IsGetter() const { return kind == RawFunction::kGetterFunction; }
+  bool IsSetter() const { return kind == RawFunction::kSetterFunction; }
   const char* ToCString() const {
     if (field_ != NULL) {
       return "field";
@@ -811,9 +811,7 @@
     }
     return "method";
   }
-  String* DictName() const {
-    return (dict_name  != NULL) ? dict_name : name;
-  }
+  String* DictName() const { return (dict_name != NULL) ? dict_name : name; }
   bool has_abstract;
   bool has_external;
   bool has_final;
@@ -856,32 +854,23 @@
         class_name_(cls_name),
         token_pos_(token_pos),
         functions_(zone, 4),
-        fields_(zone, 4) {
-  }
+        fields_(zone, 4) {}
 
   void AddFunction(const Function& function) {
     functions_.Add(&Function::ZoneHandle(zone_, function.raw()));
   }
 
-  const GrowableArray<const Function*>& functions() const {
-    return functions_;
-  }
+  const GrowableArray<const Function*>& functions() const { return functions_; }
 
   void AddField(const Field& field) {
     fields_.Add(&Field::ZoneHandle(zone_, field.raw()));
   }
 
-  const GrowableArray<const Field*>& fields() const {
-    return fields_;
-  }
+  const GrowableArray<const Field*>& fields() const { return fields_; }
 
-  const Class& clazz() const {
-    return clazz_;
-  }
+  const Class& clazz() const { return clazz_; }
 
-  const String& class_name() const {
-    return class_name_;
-  }
+  const String& class_name() const { return class_name_; }
 
   bool has_constructor() const {
     for (int i = 0; i < functions_.length(); i++) {
@@ -893,17 +882,11 @@
     return false;
   }
 
-  TokenPosition token_pos() const {
-    return token_pos_;
-  }
+  TokenPosition token_pos() const { return token_pos_; }
 
-  void AddMember(const MemberDesc& member) {
-    members_.Add(member);
-  }
+  void AddMember(const MemberDesc& member) { members_.Add(member); }
 
-  const GrowableArray<MemberDesc>& members() const {
-    return members_;
-  }
+  const GrowableArray<MemberDesc>& members() const { return members_; }
 
   MemberDesc* LookupMember(const String& name) const {
     for (int i = 0; i < members_.length(); i++) {
@@ -927,7 +910,7 @@
   Zone* zone_;
   const Class& clazz_;
   const String& class_name_;
-  TokenPosition token_pos_;   // Token index of "class" keyword.
+  TokenPosition token_pos_;  // Token index of "class" keyword.
   GrowableArray<const Function*> functions_;
   GrowableArray<const Field*> fields_;
   GrowableArray<MemberDesc> members_;
@@ -936,10 +919,8 @@
 
 class TopLevel : public ValueObject {
  public:
-  explicit TopLevel(Zone* zone) :
-      zone_(zone),
-      fields_(zone, 4),
-      functions_(zone, 4) { }
+  explicit TopLevel(Zone* zone)
+      : zone_(zone), fields_(zone, 4), functions_(zone, 4) {}
 
   void AddField(const Field& field) {
     fields_.Add(&Field::ZoneHandle(zone_, field.raw()));
@@ -949,13 +930,9 @@
     functions_.Add(&Function::ZoneHandle(zone_, function.raw()));
   }
 
-  const GrowableArray<const Field*>& fields() const {
-    return fields_;
-  }
+  const GrowableArray<const Field*>& fields() const { return fields_; }
 
-  const GrowableArray<const Function*>& functions() const {
-    return functions_;
-  }
+  const GrowableArray<const Function*>& functions() const { return functions_; }
 
  private:
   Zone* zone_;
@@ -969,8 +946,7 @@
   Zone* zone = thread->zone();
   const int64_t num_tokes_before = STAT_VALUE(thread, num_tokens_consumed);
 #ifndef PRODUCT
-  TimelineDurationScope tds(thread,
-                            Timeline::GetCompilerStream(),
+  TimelineDurationScope tds(thread, Timeline::GetCompilerStream(),
                             "ParseClass");
   if (tds.enabled()) {
     tds.SetNumArguments(1);
@@ -1007,30 +983,32 @@
     const Script& script = Script::Handle(zone, func.script());
     const Class& owner = Class::Handle(zone, func.Owner());
     ASSERT(!owner.IsNull());
-    ParsedFunction* parsed_function = new ParsedFunction(
-        thread, Function::ZoneHandle(zone, func.raw()));
+    ParsedFunction* parsed_function =
+        new ParsedFunction(thread, Function::ZoneHandle(zone, func.raw()));
     Parser parser(script, parsed_function, func.token_pos());
     parser.SkipFunctionPreamble();
     ParamList params;
     parser.ParseFormalParameterList(true, true, &params);
     ParamDesc* param = params.parameters->data();
-    const int param_cnt = params.num_fixed_parameters +
-                          params.num_optional_parameters;
+    const int param_cnt =
+        params.num_fixed_parameters + params.num_optional_parameters;
     const Array& param_descriptor =
         Array::Handle(Array::New(param_cnt * kParameterEntrySize, Heap::kOld));
     for (int i = 0, j = 0; i < param_cnt; i++, j += kParameterEntrySize) {
       param_descriptor.SetAt(j + kParameterIsFinalOffset,
                              param[i].is_final ? Bool::True() : Bool::False());
       param_descriptor.SetAt(j + kParameterDefaultValueOffset,
-          (param[i].default_value == NULL) ? Object::null_instance() :
-                                             *(param[i].default_value));
+                             (param[i].default_value == NULL)
+                                 ? Object::null_instance()
+                                 : *(param[i].default_value));
       const Object* metadata = param[i].metadata;
       if ((metadata != NULL) && (*metadata).IsError()) {
         return metadata->raw();  // Error evaluating the metadata.
       }
       param_descriptor.SetAt(j + kParameterMetadataOffset,
-          (param[i].metadata == NULL) ? Object::null_instance() :
-                                        *(param[i].metadata));
+                             (param[i].metadata == NULL)
+                                 ? Object::null_instance()
+                                 : *(param[i].metadata));
     }
     return param_descriptor.raw();
   } else {
@@ -1086,8 +1064,7 @@
 #ifndef PRODUCT
   VMTagScope tagScope(thread, VMTag::kCompileParseFunctionTagId,
                       FLAG_profile_vm);
-  TimelineDurationScope tds(thread,
-                            Timeline::GetCompilerStream(),
+  TimelineDurationScope tds(thread, Timeline::GetCompilerStream(),
                             "ParseFunction");
 #endif  // !PRODUCT
   ASSERT(thread->long_jump_base()->IsSafeToJump());
@@ -1112,7 +1089,7 @@
         node_sequence = parser.ParseConstructorClosure(func);
         break;
       }
-      // Fall-through: Handle non-implicit closures.
+    // Fall-through: Handle non-implicit closures.
     case RawFunction::kRegularFunction:
     case RawFunction::kGetterFunction:
     case RawFunction::kSetterFunction:
@@ -1141,12 +1118,10 @@
       INC_STAT(thread, num_method_extractors, 1);
       break;
     case RawFunction::kNoSuchMethodDispatcher:
-      node_sequence =
-          parser.ParseNoSuchMethodDispatcher(func);
+      node_sequence = parser.ParseNoSuchMethodDispatcher(func);
       break;
     case RawFunction::kInvokeFieldDispatcher:
-      node_sequence =
-          parser.ParseInvokeFieldDispatcher(func);
+      node_sequence = parser.ParseInvokeFieldDispatcher(func);
       break;
     case RawFunction::kIrregexpFunction:
       UNREACHABLE();  // Irregexp functions have their own parser.
@@ -1157,8 +1132,7 @@
   if (parsed_function->has_expression_temp_var()) {
     node_sequence->scope()->AddVariable(parsed_function->expression_temp_var());
   }
-  node_sequence->scope()->AddVariable(
-      parsed_function->current_context_var());
+  node_sequence->scope()->AddVariable(parsed_function->current_context_var());
   if (parsed_function->has_finally_return_temp_var()) {
     node_sequence->scope()->AddVariable(
         parsed_function->finally_return_temp_var());
@@ -1199,19 +1173,17 @@
     // normally used for expressions and assume current_function is non-null,
     // so we create a fake function to use as the current_function rather than
     // scattering special cases throughout the parser.
-    const Function& fake_function = Function::ZoneHandle(zone, Function::New(
-        Symbols::At(),
-        RawFunction::kRegularFunction,
-        true,  // is_static
-        false,  // is_const
-        false,  // is_abstract
-        false,  // is_external
-        false,  // is_native
-        Object::Handle(zone, meta_data.RawOwner()),
-        token_pos));
+    const Function& fake_function = Function::ZoneHandle(
+        zone,
+        Function::New(Symbols::At(), RawFunction::kRegularFunction,
+                      true,   // is_static
+                      false,  // is_const
+                      false,  // is_abstract
+                      false,  // is_external
+                      false,  // is_native
+                      Object::Handle(zone, meta_data.RawOwner()), token_pos));
     fake_function.set_is_debuggable(false);
-    ParsedFunction* parsed_function =
-        new ParsedFunction(thread, fake_function);
+    ParsedFunction* parsed_function = new ParsedFunction(thread, fake_function);
     Parser parser(script, parsed_function, token_pos);
     parser.set_current_class(owner_class);
     parser.OpenFunctionBlock(fake_function);
@@ -1253,10 +1225,10 @@
     AstNode* expr = NULL;
     if ((LookaheadToken(1) == Token::kLPAREN) ||
         ((LookaheadToken(1) == Token::kPERIOD) &&
-            (LookaheadToken(3) == Token::kLPAREN)) ||
+         (LookaheadToken(3) == Token::kLPAREN)) ||
         ((LookaheadToken(1) == Token::kPERIOD) &&
-            (LookaheadToken(3) == Token::kPERIOD) &&
-            (LookaheadToken(5) == Token::kLPAREN))) {
+         (LookaheadToken(3) == Token::kPERIOD) &&
+         (LookaheadToken(5) == Token::kLPAREN))) {
       expr = ParseNewOperator(Token::kCONST);
     } else {
       // Can be x, C.x, or L.C.x.
@@ -1286,16 +1258,12 @@
         String* ident = ExpectIdentifier("identifier expected");
         const Field& field = Field::Handle(Z, cls.LookupStaticField(*ident));
         if (field.IsNull()) {
-          ReportError(ident_pos,
-                      "Class '%s' has no field '%s'",
-                      cls.ToCString(),
-                      ident->ToCString());
+          ReportError(ident_pos, "Class '%s' has no field '%s'",
+                      cls.ToCString(), ident->ToCString());
         }
         if (!field.is_const()) {
-          ReportError(ident_pos,
-                      "Field '%s' of class '%s' is not const",
-                      ident->ToCString(),
-                      cls.ToCString());
+          ReportError(ident_pos, "Field '%s' of class '%s' is not const",
+                      ident->ToCString(), cls.ToCString());
         }
         expr = GenerateStaticFieldLookup(field, ident_pos);
       }
@@ -1317,7 +1285,7 @@
   OpenFunctionBlock(parsed_function()->function());
   TokenPosition expr_pos = TokenPos();
   AstNode* expr = ParseExpr(kAllowConst, kConsumeCascades);
-  ReturnNode* ret = new(Z) ReturnNode(expr_pos, expr);
+  ReturnNode* ret = new (Z) ReturnNode(expr_pos, expr);
   current_block_->statements->Add(ret);
   return CloseBlock();
 }
@@ -1336,24 +1304,21 @@
 #endif  // !PRODUCT
 
   const String& field_name = String::Handle(zone, field.name());
-  String& init_name = String::Handle(zone,
-      Symbols::FromConcat(thread, Symbols::InitPrefix(), field_name));
+  String& init_name = String::Handle(
+      zone, Symbols::FromConcat(thread, Symbols::InitPrefix(), field_name));
 
   const Script& script = Script::Handle(zone, field.Script());
   Object& initializer_owner = Object::Handle(field.Owner());
-  initializer_owner =
-      PatchClass::New(Class::Handle(field.Owner()), script);
+  initializer_owner = PatchClass::New(Class::Handle(field.Owner()), script);
 
-  const Function& initializer = Function::ZoneHandle(zone,
-      Function::New(init_name,
-                    RawFunction::kImplicitStaticFinalGetter,
-                    true,   // static
-                    false,  // !const
-                    false,  // !abstract
-                    false,  // !external
-                    false,  // !native
-                    initializer_owner,
-                    field.token_pos()));
+  const Function& initializer = Function::ZoneHandle(
+      zone, Function::New(init_name, RawFunction::kImplicitStaticFinalGetter,
+                          true,   // static
+                          false,  // !const
+                          false,  // !abstract
+                          false,  // !external
+                          false,  // !native
+                          initializer_owner, field.token_pos()));
   initializer.set_result_type(AbstractType::Handle(zone, field.type()));
   // Static initializer functions are hidden from the user.
   // Since they are only executed once, we avoid inlining them.
@@ -1423,11 +1388,10 @@
     // Call runtime support to parse and evaluate the initializer expression.
     // The runtime function will detect circular dependencies in expressions
     // and handle errors while evaluating the expression.
-    current_block_->statements->Add(
-        new (Z) InitStaticFieldNode(ident_pos, field));
+    current_block_->statements->Add(new (Z)
+                                        InitStaticFieldNode(ident_pos, field));
     ReturnNode* return_node =
-        new ReturnNode(ident_pos,
-                       new LoadStaticFieldNode(ident_pos, field));
+        new ReturnNode(ident_pos, new LoadStaticFieldNode(ident_pos, field));
     current_block_->statements->Add(return_node);
   }
   return CloseBlock();
@@ -1491,9 +1455,7 @@
   ParamList params;
   ASSERT(current_class().raw() == func.Owner());
   params.AddReceiver(ReceiverType(current_class()), ident_pos);
-  params.AddFinalParameter(ident_pos,
-                           &Symbols::Value(),
-                           &field_type);
+  params.AddFinalParameter(ident_pos, &Symbols::Value(), &field_type);
   ASSERT(func.num_fixed_parameters() == 2);  // receiver, value.
   ASSERT(!func.HasOptionalParameters());
   ASSERT(AbstractType::Handle(Z, func.result_type()).IsVoidType());
@@ -1529,8 +1491,7 @@
   ParamList params;
   // The first parameter of the closure function is the
   // implicit closure argument.
-  params.AddFinalParameter(token_pos,
-                           &Symbols::ClosureParameter(),
+  params.AddFinalParameter(token_pos, &Symbols::ClosureParameter(),
                            &Object::dynamic_type());
   bool params_ok = ParseFormalParameters(constructor, &params);
   USE(params_ok);
@@ -1578,24 +1539,24 @@
   OpenFunctionBlock(func);
 
   ParamList params;
-  params.AddFinalParameter(
-      token_pos,
-      &Symbols::ClosureParameter(),
-      &Object::dynamic_type());
+  params.AddFinalParameter(token_pos, &Symbols::ClosureParameter(),
+                           &Object::dynamic_type());
 
   const Function& parent = Function::Handle(func.parent_function());
   if (parent.IsImplicitSetterFunction()) {
     const TokenPosition ident_pos = func.token_pos();
     ASSERT(IsIdentifier());
-    params.AddFinalParameter(ident_pos,
-                             &Symbols::Value(),
+    params.AddFinalParameter(ident_pos, &Symbols::Value(),
                              &Object::dynamic_type());
     ASSERT(func.num_fixed_parameters() == 2);  // closure, value.
   } else if (!parent.IsGetterFunction() && !parent.IsImplicitGetterFunction()) {
-    const bool allow_explicit_default_values = true;
-    SkipFunctionPreamble();
-    ParseFormalParameterList(allow_explicit_default_values, false, &params);
-    SetupDefaultsForOptionalParams(params);
+    // NOTE: For the `kernel -> flowgraph` we don't use the parser.
+    if (parent.kernel_function() == NULL) {
+      const bool allow_explicit_default_values = true;
+      SkipFunctionPreamble();
+      ParseFormalParameterList(allow_explicit_default_values, false, &params);
+      SetupDefaultsForOptionalParams(params);
+    }
   }
 
   // Populate function scope with the formal parameters.
@@ -1628,8 +1589,7 @@
   Function& target = Function::ZoneHandle(owner.LookupFunction(func_name));
   if (target.raw() != parent.raw()) {
     ASSERT(Isolate::Current()->HasAttemptedReload());
-    if (target.IsNull() ||
-        (target.is_static() != parent.is_static()) ||
+    if (target.IsNull() || (target.is_static() != parent.is_static()) ||
         (target.kind() != parent.kind())) {
       target = Function::null();
     }
@@ -1655,16 +1615,14 @@
     const intptr_t kNumArguments = 2;  // Receiver, InvocationMirror.
     ArgumentsDescriptor args_desc(
         Array::Handle(Z, ArgumentsDescriptor::New(kNumArguments)));
-    Function& no_such_method = Function::ZoneHandle(Z,
-    Resolver::ResolveDynamicForReceiverClass(owner,
-                                             Symbols::NoSuchMethod(),
-                                             args_desc));
+    Function& no_such_method =
+        Function::ZoneHandle(Z, Resolver::ResolveDynamicForReceiverClass(
+                                    owner, Symbols::NoSuchMethod(), args_desc));
     if (no_such_method.IsNull()) {
       // If noSuchMethod(i) is not found, call Object:noSuchMethod.
       no_such_method ^= Resolver::ResolveDynamicForReceiverClass(
           Class::Handle(Z, I->object_store()->object_class()),
-          Symbols::NoSuchMethod(),
-          args_desc);
+          Symbols::NoSuchMethod(), args_desc);
     }
     call = new StaticCallNode(token_pos, no_such_method, arguments);
   } else {
@@ -1682,12 +1640,8 @@
     } else {
       im_type = InvocationMirror::kMethod;
     }
-    call = ThrowNoSuchMethodError(TokenPos(),
-                                  owner,
-                                  func_name,
-                                  func_args,
-                                  InvocationMirror::kStatic,
-                                  im_type,
+    call = ThrowNoSuchMethodError(TokenPos(), owner, func_name, func_args,
+                                  InvocationMirror::kStatic, im_type,
                                   NULL);  // No existing function.
   }
 
@@ -1719,10 +1673,8 @@
   LoadLocalNode* load_receiver = new LoadLocalNode(ident_pos, receiver);
 
   ClosureNode* closure = new ClosureNode(
-      ident_pos,
-      Function::ZoneHandle(Z, func.extracted_method_closure()),
-      load_receiver,
-      NULL);
+      ident_pos, Function::ZoneHandle(Z, func.extracted_method_closure()),
+      load_receiver, NULL);
 
   ReturnNode* return_node = new ReturnNode(ident_pos, closure);
   current_block_->statements->Add(return_node);
@@ -1801,21 +1753,20 @@
   }
 
   const String& func_name = String::ZoneHandle(Z, func.name());
-  ArgumentListNode* arguments = BuildNoSuchMethodArguments(
-      token_pos, func_name, *func_args, NULL, false);
+  ArgumentListNode* arguments =
+      BuildNoSuchMethodArguments(token_pos, func_name, *func_args, NULL, false);
   const intptr_t kNumArguments = 2;  // Receiver, InvocationMirror.
   ArgumentsDescriptor args_desc(
       Array::Handle(Z, ArgumentsDescriptor::New(kNumArguments)));
-  Function& no_such_method = Function::ZoneHandle(Z,
-      Resolver::ResolveDynamicForReceiverClass(Class::Handle(Z, func.Owner()),
-                                               Symbols::NoSuchMethod(),
-                                               args_desc));
+  Function& no_such_method = Function::ZoneHandle(
+      Z,
+      Resolver::ResolveDynamicForReceiverClass(
+          Class::Handle(Z, func.Owner()), Symbols::NoSuchMethod(), args_desc));
   if (no_such_method.IsNull()) {
     // If noSuchMethod(i) is not found, call Object:noSuchMethod.
     no_such_method ^= Resolver::ResolveDynamicForReceiverClass(
         Class::Handle(Z, I->object_store()->object_class()),
-        Symbols::NoSuchMethod(),
-        args_desc);
+        Symbols::NoSuchMethod(), args_desc);
   }
   StaticCallNode* call =
       new StaticCallNode(token_pos, no_such_method, arguments);
@@ -1845,8 +1796,8 @@
   ArgumentListNode* no_args = new ArgumentListNode(token_pos);
   LoadLocalNode* receiver = new LoadLocalNode(token_pos, scope->VariableAt(0));
 
-  const Class& closure_cls = Class::Handle(
-      Isolate::Current()->object_store()->closure_class());
+  const Class& closure_cls =
+      Class::Handle(Isolate::Current()->object_store()->closure_class());
 
   const Class& owner = Class::Handle(Z, func.Owner());
   ASSERT(!owner.IsNull());
@@ -1855,16 +1806,16 @@
   if (owner.raw() == closure_cls.raw() && name.Equals(Symbols::Call())) {
     function_object = receiver;
   } else {
-    const String& getter_name = String::ZoneHandle(Z,
-        Field::GetterSymbol(name));
-    function_object = new(Z) InstanceCallNode(
-        token_pos, receiver, getter_name, no_args);
+    const String& getter_name =
+        String::ZoneHandle(Z, Field::GetterSymbol(name));
+    function_object =
+        new (Z) InstanceCallNode(token_pos, receiver, getter_name, no_args);
   }
 
   // Pass arguments 1..n to the closure call.
-  ArgumentListNode* args = new(Z) ArgumentListNode(token_pos);
-  const Array& names = Array::Handle(
-      Z, Array::New(desc.NamedCount(), Heap::kOld));
+  ArgumentListNode* args = new (Z) ArgumentListNode(token_pos);
+  const Array& names =
+      Array::Handle(Z, Array::New(desc.NamedCount(), Heap::kOld));
   // Positional parameters.
   intptr_t i = 1;
   for (; i < desc.PositionalCount(); ++i) {
@@ -1872,7 +1823,7 @@
   }
   // Named parameters.
   for (; i < desc.Count(); i++) {
-    args->Add(new(Z) LoadLocalNode(token_pos, scope->VariableAt(i)));
+    args->Add(new (Z) LoadLocalNode(token_pos, scope->VariableAt(i)));
     intptr_t index = i - desc.PositionalCount();
     names.SetAt(index, String::Handle(Z, desc.NameAt(index)));
   }
@@ -1894,10 +1845,7 @@
 AstNode* Parser::BuildClosureCall(TokenPosition token_pos,
                                   AstNode* closure,
                                   ArgumentListNode* arguments) {
-  return new InstanceCallNode(token_pos,
-                              closure,
-                              Symbols::Call(),
-                              arguments);
+  return new InstanceCallNode(token_pos, closure, Symbols::Call(), arguments);
 }
 
 
@@ -1910,7 +1858,7 @@
   // Adding the first opening brace here, because it will be consumed
   // in the loop right away.
   token_stack.Add(opening_token);
-  const TokenPosition start_pos =  TokenPos();
+  const TokenPosition start_pos = TokenPos();
   TokenPosition opening_pos = start_pos;
   token_pos_stack.Add(start_pos);
   bool is_match = true;
@@ -1954,20 +1902,18 @@
     }
   } while (!token_stack.is_empty() && is_match && !unexpected_token_found);
   if (!is_match) {
-    const Error& error = Error::Handle(
-        LanguageError::NewFormatted(Error::Handle(),
-            script_, opening_pos, Report::AtLocation,
-            Report::kWarning, Heap::kNew,
-            "unbalanced '%s' opens here", Token::Str(opening_token)));
-    ReportErrors(error, script_, token_pos,
-                 "unbalanced '%s'", Token::Str(token));
+    const Error& error = Error::Handle(LanguageError::NewFormatted(
+        Error::Handle(), script_, opening_pos, Report::AtLocation,
+        Report::kWarning, Heap::kNew, "unbalanced '%s' opens here",
+        Token::Str(opening_token)));
+    ReportErrors(error, script_, token_pos, "unbalanced '%s'",
+                 Token::Str(token));
   } else if (unexpected_token_found) {
     ReportError(start_pos, "unterminated '%s'", Token::Str(opening_token));
   }
 }
 
 
-
 void Parser::SkipBlock() {
   ASSERT(CurrentToken() == Token::kLBRACE);
   SkipToMatching();
@@ -2051,8 +1997,8 @@
       parameter.has_explicit_type = true;
       // It is too early to resolve the type here, since it can be a result type
       // referring to a not yet declared function type parameter.
-      parameter.type = &AbstractType::ZoneHandle(Z,
-          ParseType(ClassFinalizer::kDoNotResolve));
+      parameter.type = &AbstractType::ZoneHandle(
+          Z, ParseType(ClassFinalizer::kDoNotResolve));
     } else {
       // If this is an initializing formal, its type will be set to the type of
       // the respective field when the constructor is fully parsed.
@@ -2110,9 +2056,9 @@
       // signature functions (except typedef signature functions), therefore
       // we do not need to keep the correct script via a patch class. Use the
       // actual current class as owner of the signature function.
-      const Function& signature_function = Function::Handle(Z,
-          Function::NewSignatureFunction(current_class(),
-                                         TokenPosition::kNoSource));
+      const Function& signature_function =
+          Function::Handle(Z, Function::NewSignatureFunction(
+                                  current_class(), TokenPosition::kNoSource));
       signature_function.set_parent_function(innermost_function());
       innermost_function_ = signature_function.raw();
 
@@ -2125,16 +2071,16 @@
       }
 
       // Now that type parameters are declared, the result type can be resolved.
-      ResolveType(ClassFinalizer::kResolveTypeParameters, &result_type);
+      ResolveType(is_top_level_ ? ClassFinalizer::kResolveTypeParameters
+                                : ClassFinalizer::kCanonicalize,
+                  &result_type);
 
       ASSERT(CurrentToken() == Token::kLPAREN);
       ParamList func_params;
 
       // Add implicit closure object parameter.
-      func_params.AddFinalParameter(
-          TokenPos(),
-          &Symbols::ClosureParameter(),
-          &Object::dynamic_type());
+      func_params.AddFinalParameter(TokenPos(), &Symbols::ClosureParameter(),
+                                    &Object::dynamic_type());
 
       const bool no_explicit_default_values = false;
       ParseFormalParameterList(no_explicit_default_values, false, &func_params);
@@ -2164,12 +2110,12 @@
   } else {
     if (!parameter.type->IsFinalized()) {
       AbstractType& type = AbstractType::ZoneHandle(Z, parameter.type->raw());
-      ResolveType(ClassFinalizer::kResolveTypeParameters, &type);
-      if (!is_top_level_) {
-        type = ClassFinalizer::FinalizeType(
-            Class::Handle(Z, innermost_function().origin()),
-            type,
-            ClassFinalizer::kCanonicalize);
+      if (is_top_level_) {
+        ResolveType(ClassFinalizer::kResolveTypeParameters, &type);
+      } else {
+        ResolveType(ClassFinalizer::kCanonicalize, &type);
+        type = ClassFinalizer::FinalizeType(current_class(), type,
+                                            ClassFinalizer::kCanonicalize);
       }
       parameter.type = &type;
     }
@@ -2184,7 +2130,7 @@
     if (params->has_optional_positional_parameters) {
       ExpectToken(Token::kASSIGN);
     } else {
-      ExpectToken(Token::kCOLON);
+      ConsumeToken();
     }
     params->num_optional_parameters++;
     params->has_explicit_default_values = true;  // Also if explicitly NULL.
@@ -2241,16 +2187,16 @@
       params->has_optional_named_parameters = true;
       return;
     }
-    Token::Kind terminator =
-       params->has_optional_positional_parameters ? Token::kRBRACK :
-       params->has_optional_named_parameters ? Token::kRBRACE :
-       Token :: kRPAREN;
+    Token::Kind terminator = params->has_optional_positional_parameters
+                                 ? Token::kRBRACK
+                                 : params->has_optional_named_parameters
+                                       ? Token::kRBRACE
+                                       : Token::kRPAREN;
     if (has_seen_parameter && CurrentToken() == terminator) {
       // Allow a trailing comma.
       break;
     }
-    ParseFormalParameter(allow_explicit_default_values,
-                         evaluate_metadata,
+    ParseFormalParameter(allow_explicit_default_values, evaluate_metadata,
                          params);
     has_seen_parameter = true;
   } while (CurrentToken() == Token::kCOMMA);
@@ -2265,14 +2211,12 @@
 
   if (LookaheadToken(1) != Token::kRPAREN) {
     // Parse fixed parameters.
-    ParseFormalParameters(allow_explicit_default_values,
-                          evaluate_metadata,
+    ParseFormalParameters(allow_explicit_default_values, evaluate_metadata,
                           params);
     if (params->has_optional_positional_parameters ||
         params->has_optional_named_parameters) {
       // Parse optional parameters.
-      ParseFormalParameters(allow_explicit_default_values,
-                            evaluate_metadata,
+      ParseFormalParameters(allow_explicit_default_values, evaluate_metadata,
                             params);
       if (params->has_optional_positional_parameters) {
         CheckToken(Token::kRBRACK, "',' or ']' expected");
@@ -2318,11 +2262,10 @@
     ReportError(token_pos, "class '%s' does not have a superclass",
                 String::Handle(Z, current_class().Name()).ToCString());
   }
-  Function& super_func = Function::Handle(Z,
-      Resolver::ResolveDynamicAnyArgs(Z, super_class, name));
+  Function& super_func = Function::Handle(
+      Z, Resolver::ResolveDynamicAnyArgs(Z, super_class, name));
   if (!super_func.IsNull() &&
-      !super_func.AreValidArguments(arguments->length(),
-                                    arguments->names(),
+      !super_func.AreValidArguments(arguments->length(), arguments->names(),
                                     NULL)) {
     super_func = Function::null();
   } else if (super_func.IsNull() && resolve_getter) {
@@ -2332,8 +2275,8 @@
            (super_func.kind() != RawFunction::kImplicitStaticFinalGetter));
   }
   if (super_func.IsNull()) {
-    super_func = Resolver::ResolveDynamicAnyArgs(Z,
-        super_class, Symbols::NoSuchMethod());
+    super_func = Resolver::ResolveDynamicAnyArgs(Z, super_class,
+                                                 Symbols::NoSuchMethod());
     ASSERT(!super_func.IsNull());
     *is_no_such_method = true;
   } else {
@@ -2356,9 +2299,8 @@
   // The first argument is the original function name.
   arguments->Add(new LiteralNode(args_pos, function_name));
   // The second argument is the arguments descriptor of the original function.
-  const Array& args_descriptor =
-      Array::ZoneHandle(ArgumentsDescriptor::New(function_args.length(),
-                                                 function_args.names()));
+  const Array& args_descriptor = Array::ZoneHandle(
+      ArgumentsDescriptor::New(function_args.length(), function_args.names()));
   arguments->Add(new LiteralNode(args_pos, args_descriptor));
   // The third argument is an array containing the original function arguments,
   // including the receiver.
@@ -2368,11 +2310,10 @@
     AstNode* arg = function_args.NodeAt(i);
     if ((temp_for_last_arg != NULL) && (i == function_args.length() - 1)) {
       LetNode* store_arg = new LetNode(arg->token_pos());
-      store_arg->AddNode(new StoreLocalNode(arg->token_pos(),
-                                           temp_for_last_arg,
-                                           arg));
-      store_arg->AddNode(new LoadLocalNode(arg->token_pos(),
-                                           temp_for_last_arg));
+      store_arg->AddNode(
+          new StoreLocalNode(arg->token_pos(), temp_for_last_arg, arg));
+      store_arg->AddNode(
+          new LoadLocalNode(arg->token_pos(), temp_for_last_arg));
       args_array->AddElement(store_arg);
     } else {
       args_array->AddElement(arg);
@@ -2384,8 +2325,8 @@
   const Class& mirror_class =
       Class::Handle(Library::LookupCoreClass(Symbols::InvocationMirror()));
   ASSERT(!mirror_class.IsNull());
-  const Function& allocation_function = Function::ZoneHandle(
-      mirror_class.LookupStaticFunction(
+  const Function& allocation_function =
+      Function::ZoneHandle(mirror_class.LookupStaticFunction(
           Library::PrivateCoreLibName(Symbols::AllocateInvocationMirror())));
   ASSERT(!allocation_function.IsNull());
   return new StaticCallNode(call_pos, allocation_function, arguments);
@@ -2403,11 +2344,9 @@
   ArgumentListNode* arguments = new ArgumentListNode(args_pos);
   arguments->Add(function_args.NodeAt(0));
   // The second argument is the invocation mirror.
-  arguments->Add(BuildInvocationMirrorAllocation(call_pos,
-                                                 function_name,
-                                                 function_args,
-                                                 temp_for_last_arg,
-                                                 is_super_invocation));
+  arguments->Add(
+      BuildInvocationMirrorAllocation(call_pos, function_name, function_args,
+                                      temp_for_last_arg, is_super_invocation));
   return arguments;
 }
 
@@ -2425,20 +2364,15 @@
 
   const bool kResolveGetter = true;
   bool is_no_such_method = false;
-  const Function& super_function = Function::ZoneHandle(Z,
-      GetSuperFunction(supercall_pos,
-                       function_name,
-                       arguments,
-                       kResolveGetter,
-                       &is_no_such_method));
+  const Function& super_function = Function::ZoneHandle(
+      Z, GetSuperFunction(supercall_pos, function_name, arguments,
+                          kResolveGetter, &is_no_such_method));
   if (super_function.IsGetterFunction() ||
       super_function.IsImplicitGetterFunction()) {
     const Class& super_class =
         Class::ZoneHandle(Z, current_class().SuperClass());
-    AstNode* closure = new StaticGetterNode(supercall_pos,
-                                            LoadReceiver(supercall_pos),
-                                            super_class,
-                                            function_name);
+    AstNode* closure = new StaticGetterNode(
+        supercall_pos, LoadReceiver(supercall_pos), super_class, function_name);
     // 'this' is not passed as parameter to the closure.
     ArgumentListNode* closure_arguments = new ArgumentListNode(supercall_pos);
     for (int i = 1; i < arguments->length(); i++) {
@@ -2447,8 +2381,8 @@
     return BuildClosureCall(supercall_pos, closure, closure_arguments);
   }
   if (is_no_such_method) {
-    arguments = BuildNoSuchMethodArguments(
-        supercall_pos, function_name, *arguments, NULL, true);
+    arguments = BuildNoSuchMethodArguments(supercall_pos, function_name,
+                                           *arguments, NULL, true);
   }
   return new StaticCallNode(supercall_pos, super_function, arguments);
 }
@@ -2464,8 +2398,7 @@
   ASSERT(super->IsSuper());
   AstNode* super_op = NULL;
   const TokenPosition super_pos = super->token_pos();
-  if ((op == Token::kNEGATE) ||
-      (op == Token::kBIT_NOT)) {
+  if ((op == Token::kNEGATE) || (op == Token::kBIT_NOT)) {
     // Resolve the operator function in the superclass.
     const String& operator_function_name = Symbols::Token(op);
     ArgumentListNode* op_arguments = new ArgumentListNode(super_pos);
@@ -2473,12 +2406,9 @@
     op_arguments->Add(receiver);
     const bool kResolveGetter = false;
     bool is_no_such_method = false;
-    const Function& super_operator = Function::ZoneHandle(Z,
-        GetSuperFunction(super_pos,
-                         operator_function_name,
-                         op_arguments,
-                         kResolveGetter,
-                         &is_no_such_method));
+    const Function& super_operator = Function::ZoneHandle(
+        Z, GetSuperFunction(super_pos, operator_function_name, op_arguments,
+                            kResolveGetter, &is_no_such_method));
     if (is_no_such_method) {
       op_arguments = BuildNoSuchMethodArguments(
           super_pos, operator_function_name, *op_arguments, NULL, true);
@@ -2530,12 +2460,9 @@
     const String& operator_function_name = Symbols::Token(op);
     const bool kResolveGetter = false;
     bool is_no_such_method = false;
-    const Function& super_operator = Function::ZoneHandle(Z,
-        GetSuperFunction(operator_pos,
-                         operator_function_name,
-                         op_arguments,
-                         kResolveGetter,
-                         &is_no_such_method));
+    const Function& super_operator = Function::ZoneHandle(
+        Z, GetSuperFunction(operator_pos, operator_function_name, op_arguments,
+                            kResolveGetter, &is_no_such_method));
     if (is_no_such_method) {
       op_arguments = BuildNoSuchMethodArguments(
           operator_pos, operator_function_name, *op_arguments, NULL, true);
@@ -2579,37 +2506,36 @@
         String::ZoneHandle(Z, Field::LookupSetterSymbol(field_name));
     Function& super_setter = Function::ZoneHandle(Z);
     if (!setter_name.IsNull()) {
-      super_setter = Resolver::ResolveDynamicAnyArgs(Z,
-          super_class, setter_name);
+      super_setter =
+          Resolver::ResolveDynamicAnyArgs(Z, super_class, setter_name);
     }
     if (super_setter.IsNull()) {
       // Check if this is an access to an implicit closure using 'super'.
       // If a function exists of the specified field_name then try
       // accessing it as a getter, at runtime we will handle this by
       // creating an implicit closure of the function and returning it.
-      const Function& super_function = Function::ZoneHandle(Z,
-          Resolver::ResolveDynamicAnyArgs(Z, super_class, field_name));
+      const Function& super_function = Function::ZoneHandle(
+          Z, Resolver::ResolveDynamicAnyArgs(Z, super_class, field_name));
       if (!super_function.IsNull()) {
         // In case CreateAssignmentNode is called later on this
         // CreateImplicitClosureNode, it will be replaced by a StaticSetterNode.
-        return CreateImplicitClosureNode(super_function,
-                                         field_pos,
+        return CreateImplicitClosureNode(super_function, field_pos,
                                          implicit_argument);
       }
       // No function or field exists of the specified field_name.
       // Emit a StaticGetterNode anyway, so that noSuchMethod gets called.
     }
   }
-  return new(Z) StaticGetterNode(
-      field_pos, implicit_argument, super_class, field_name);
+  return new (Z)
+      StaticGetterNode(field_pos, implicit_argument, super_class, field_name);
 }
 
 
 StaticCallNode* Parser::GenerateSuperConstructorCall(
-      const Class& cls,
-      TokenPosition supercall_pos,
-      LocalVariable* receiver,
-      ArgumentListNode* forwarding_args) {
+    const Class& cls,
+    TokenPosition supercall_pos,
+    LocalVariable* receiver,
+    ArgumentListNode* forwarding_args) {
   const Class& super_class = Class::Handle(Z, cls.SuperClass());
   // Omit the implicit super() if there is no super class (i.e.
   // we're not compiling class Object), or if the super class is an
@@ -2639,27 +2565,26 @@
     if (ctor_name.Length() > class_name.Length() + 1) {
       // Generating a forwarding call to a named constructor 'C.n'.
       // Add the constructor name 'n' to the super constructor.
-      const intptr_t kLen =  class_name.Length() + 1;
+      const intptr_t kLen = class_name.Length() + 1;
       ctor_name = Symbols::New(T, ctor_name, kLen, ctor_name.Length() - kLen);
       super_ctor_name = Symbols::FromConcat(T, super_ctor_name, ctor_name);
     }
   }
 
   // Resolve super constructor function and check arguments.
-  const Function& super_ctor = Function::ZoneHandle(Z,
-      super_class.LookupConstructor(super_ctor_name));
+  const Function& super_ctor =
+      Function::ZoneHandle(Z, super_class.LookupConstructor(super_ctor_name));
   if (super_ctor.IsNull()) {
-      ReportError(supercall_pos,
-                  "unresolved implicit call to super constructor '%s()'",
-                  String::Handle(Z, super_class.Name()).ToCString());
+    ReportError(supercall_pos,
+                "unresolved implicit call to super constructor '%s()'",
+                String::Handle(Z, super_class.Name()).ToCString());
   }
   if (current_function().is_const() && !super_ctor.is_const()) {
     ReportError(supercall_pos, "implicit call to non-const super constructor");
   }
 
   String& error_message = String::Handle(Z);
-  if (!super_ctor.AreValidArguments(arguments->length(),
-                                    arguments->names(),
+  if (!super_ctor.AreValidArguments(arguments->length(), arguments->names(),
                                     &error_message)) {
     ReportError(supercall_pos,
                 "invalid arguments passed to super constructor '%s()': %s",
@@ -2679,11 +2604,11 @@
   const Class& super_class = Class::Handle(Z, cls.SuperClass());
   ASSERT(!super_class.IsNull());
   String& ctor_name = String::Handle(Z, super_class.Name());
-  ctor_name =  Symbols::FromConcat(T, ctor_name, Symbols::Dot());
+  ctor_name = Symbols::FromConcat(T, ctor_name, Symbols::Dot());
   if (CurrentToken() == Token::kPERIOD) {
     ConsumeToken();
-    ctor_name = Symbols::FromConcat(T,
-        ctor_name, *ExpectIdentifier("constructor name expected"));
+    ctor_name = Symbols::FromConcat(
+        T, ctor_name, *ExpectIdentifier("constructor name expected"));
   }
   CheckToken(Token::kLPAREN, "parameter list expected");
 
@@ -2698,24 +2623,21 @@
   receiver->set_invisible(false);
 
   // Resolve the constructor.
-  const Function& super_ctor = Function::ZoneHandle(Z,
-      super_class.LookupConstructor(ctor_name));
+  const Function& super_ctor =
+      Function::ZoneHandle(Z, super_class.LookupConstructor(ctor_name));
   if (super_ctor.IsNull()) {
-    ReportError(supercall_pos,
-                "super class constructor '%s' not found",
+    ReportError(supercall_pos, "super class constructor '%s' not found",
                 ctor_name.ToCString());
   }
   if (current_function().is_const() && !super_ctor.is_const()) {
     ReportError(supercall_pos, "super constructor must be const");
   }
   String& error_message = String::Handle(Z);
-  if (!super_ctor.AreValidArguments(arguments->length(),
-                                    arguments->names(),
+  if (!super_ctor.AreValidArguments(arguments->length(), arguments->names(),
                                     &error_message)) {
     ReportError(supercall_pos,
                 "invalid arguments passed to super class constructor '%s': %s",
-                ctor_name.ToCString(),
-                error_message.ToCString());
+                ctor_name.ToCString(), error_message.ToCString());
   }
   return new StaticCallNode(supercall_pos, super_ctor, arguments);
 }
@@ -2763,13 +2685,13 @@
                 field_name.ToCString());
   }
   EnsureExpressionTemp();
-  AstNode* instance = new(Z) LoadLocalNode(field_pos, receiver);
-  AstNode* initializer = CheckDuplicateFieldInit(field_pos,
-      initialized_fields, instance, &field, init_expr);
+  AstNode* instance = new (Z) LoadLocalNode(field_pos, receiver);
+  AstNode* initializer = CheckDuplicateFieldInit(field_pos, initialized_fields,
+                                                 instance, &field, init_expr);
   if (initializer == NULL) {
     initializer =
-        new(Z) StoreInstanceFieldNode(field_pos, instance, field, init_expr,
-                                      /* is_initializer = */ true);
+        new (Z) StoreInstanceFieldNode(field_pos, instance, field, init_expr,
+                                       /* is_initializer = */ true);
   }
   return initializer;
 }
@@ -2840,9 +2762,10 @@
 }
 
 
-void Parser::ParseInitializedInstanceFields(const Class& cls,
-                 LocalVariable* receiver,
-                 GrowableArray<Field*>* initialized_fields) {
+void Parser::ParseInitializedInstanceFields(
+    const Class& cls,
+    LocalVariable* receiver,
+    GrowableArray<Field*>* initialized_fields) {
   TRACE_PARSER("ParseInitializedInstanceFields");
   const Array& fields = Array::Handle(Z, cls.fields());
   Field& f = Field::Handle(Z);
@@ -2881,12 +2804,9 @@
       ASSERT(init_expr != NULL);
       AstNode* instance = new LoadLocalNode(field.token_pos(), receiver);
       EnsureExpressionTemp();
-      AstNode* field_init =
-          new StoreInstanceFieldNode(field.token_pos(),
-                                     instance,
-                                     field,
-                                     init_expr,
-                                     /* is_initializer = */ true);
+      AstNode* field_init = new StoreInstanceFieldNode(
+          field.token_pos(), instance, field, init_expr,
+          /* is_initializer = */ true);
       current_block_->statements->Add(field_init);
     }
   }
@@ -2931,46 +2851,42 @@
       //     List argumentNames,
       //     List existingArgumentNames);
 
-      ArgumentListNode* nsm_args = new(Z) ArgumentListNode(init_pos);
+      ArgumentListNode* nsm_args = new (Z) ArgumentListNode(init_pos);
       // Object receiver.
       nsm_args->Add(instance);
 
       // String memberName.
       String& setter_name = String::ZoneHandle(field->name());
       setter_name = Field::SetterSymbol(setter_name);
-      nsm_args->Add(new(Z) LiteralNode(init_pos, setter_name));
+      nsm_args->Add(new (Z) LiteralNode(init_pos, setter_name));
 
       // Smi invocation_type.
-      const int invocation_type =
-          InvocationMirror::EncodeType(InvocationMirror::kDynamic,
-                                       InvocationMirror::kSetter);
-      nsm_args->Add(new(Z) LiteralNode(
+      const int invocation_type = InvocationMirror::EncodeType(
+          InvocationMirror::kDynamic, InvocationMirror::kSetter);
+      nsm_args->Add(new (Z) LiteralNode(
           init_pos, Smi::ZoneHandle(Z, Smi::New(invocation_type))));
 
       // List arguments.
       GrowableArray<AstNode*> setter_args;
       setter_args.Add(init_value);
-      ArrayNode* setter_args_array = new(Z) ArrayNode(
-          init_pos,
-          Type::ZoneHandle(Z, Type::ArrayType()),
-          setter_args);
+      ArrayNode* setter_args_array = new (Z) ArrayNode(
+          init_pos, Type::ZoneHandle(Z, Type::ArrayType()), setter_args);
       nsm_args->Add(setter_args_array);
 
       // List argumentNames.
       // The missing implicit setter of the field has no argument names.
-      nsm_args->Add(new(Z) LiteralNode(init_pos, Object::null_array()));
+      nsm_args->Add(new (Z) LiteralNode(init_pos, Object::null_array()));
 
       // List existingArgumentNames.
       // There is no setter for the final field, thus there are
       // no existing names.
-      nsm_args->Add(new(Z) LiteralNode(init_pos, Object::null_array()));
+      nsm_args->Add(new (Z) LiteralNode(init_pos, Object::null_array()));
 
       AstNode* nsm_call = MakeStaticCall(
           Symbols::NoSuchMethodError(),
-          Library::PrivateCoreLibName(Symbols::ThrowNew()),
-          nsm_args);
+          Library::PrivateCoreLibName(Symbols::ThrowNew()), nsm_args);
 
-      LetNode* let = new(Z) LetNode(init_pos);
+      LetNode* let = new (Z) LetNode(init_pos);
       let->AddNode(init_value);
       let->AddNode(nsm_call);
       result = let;
@@ -2984,8 +2900,7 @@
     Field* initialized_field = (*initialized_fields)[initializer_idx];
     initializer_idx++;
     if (initialized_field->raw() == field->raw()) {
-      ReportError(init_pos,
-                  "duplicate initializer for field %s",
+      ReportError(init_pos, "duplicate initializer for field %s",
                   String::Handle(Z, field->name()).ToCString());
     }
   }
@@ -3048,16 +2963,16 @@
     }
     ASSERT(super_init_index >= 0);
     ArgumentListNode* ctor_args = super_init_call->arguments();
-    LetNode* saved_args = new(Z) LetNode(super_init_call->token_pos());
+    LetNode* saved_args = new (Z) LetNode(super_init_call->token_pos());
     // The super initializer call has at least 1 arguments: the
     // implicit receiver.
     ASSERT(ctor_args->length() >= 1);
     for (int i = 1; i < ctor_args->length(); i++) {
       AstNode* arg = ctor_args->NodeAt(i);
       LocalVariable* temp = CreateTempConstVariable(arg->token_pos(), "sca");
-      AstNode* save_temp = new(Z) StoreLocalNode(arg->token_pos(), temp, arg);
+      AstNode* save_temp = new (Z) StoreLocalNode(arg->token_pos(), temp, arg);
       saved_args->AddNode(save_temp);
-      ctor_args->SetNodeAt(i, new(Z) LoadLocalNode(arg->token_pos(), temp));
+      ctor_args->SetNodeAt(i, new (Z) LoadLocalNode(arg->token_pos(), temp));
     }
     current_block_->statements->ReplaceNodeAt(super_init_index, saved_args);
     current_block_->statements->Add(super_init_call);
@@ -3093,18 +3008,21 @@
   ParseActualParameters(arguments, kAllowConst);
   receiver->set_invisible(false);
   // Resolve the constructor.
-  const Function& redirect_ctor = Function::ZoneHandle(Z,
-      cls.LookupConstructor(ctor_name));
+  const Function& redirect_ctor =
+      Function::ZoneHandle(Z, cls.LookupConstructor(ctor_name));
   if (redirect_ctor.IsNull()) {
-    ReportError(call_pos, "constructor '%s' not found", ctor_name.ToCString());
+    ReportError(call_pos, "constructor '%s' not found",
+                String::Handle(Z, redirect_ctor.UserVisibleName()).ToCString());
+  }
+  if (current_function().is_const() && !redirect_ctor.is_const()) {
+    ReportError(call_pos, "redirection constructor '%s' must be const",
+                String::Handle(Z, redirect_ctor.UserVisibleName()).ToCString());
   }
   String& error_message = String::Handle(Z);
-  if (!redirect_ctor.AreValidArguments(arguments->length(),
-                                       arguments->names(),
+  if (!redirect_ctor.AreValidArguments(arguments->length(), arguments->names(),
                                        &error_message)) {
-    ReportError(call_pos,
-                "invalid arguments passed to constructor '%s': %s",
-                ctor_name.ToCString(),
+    ReportError(call_pos, "invalid arguments passed to constructor '%s': %s",
+                String::Handle(Z, redirect_ctor.UserVisibleName()).ToCString(),
                 error_message.ToCString());
   }
   current_block_->statements->Add(
@@ -3118,10 +3036,9 @@
   const TokenPosition ctor_pos = TokenPos();
   OpenFunctionBlock(func);
 
-  LocalVariable* receiver = new LocalVariable(
-      TokenPosition::kNoSource,
-      Symbols::This(),
-      *ReceiverType(current_class()));
+  LocalVariable* receiver =
+      new LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource,
+                        Symbols::This(), *ReceiverType(current_class()));
   current_block_->scope->InsertParameterAt(0, receiver);
 
   // Parse expressions of instance fields that have an explicit
@@ -3129,8 +3046,8 @@
   // The receiver must not be visible to field initializer expressions.
   receiver->set_invisible(true);
   GrowableArray<Field*> initialized_fields;
-  ParseInitializedInstanceFields(
-      current_class(), receiver, &initialized_fields);
+  ParseInitializedInstanceFields(current_class(), receiver,
+                                 &initialized_fields);
   receiver->set_invisible(false);
 
   // If the class of this implicit constructor is a mixin application alias,
@@ -3166,20 +3083,17 @@
     // The first user-defined argument is at position 1.
     forwarding_args = new ArgumentListNode(ST(ctor_pos));
     for (int i = 1; i < func.NumParameters(); i++) {
-      LocalVariable* param = new LocalVariable(
-          TokenPosition::kNoSource,
-          String::ZoneHandle(Z, func.ParameterNameAt(i)),
-          Object::dynamic_type());
+      LocalVariable* param =
+          new LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource,
+                            String::ZoneHandle(Z, func.ParameterNameAt(i)),
+                            Object::dynamic_type());
       current_block_->scope->InsertParameterAt(i, param);
       forwarding_args->Add(new LoadLocalNode(ST(ctor_pos), param));
     }
   }
 
-  AstNode* super_call = GenerateSuperConstructorCall(
-      current_class(),
-      ctor_pos,
-      receiver,
-      forwarding_args);
+  AstNode* super_call = GenerateSuperConstructorCall(current_class(), ctor_pos,
+                                                     receiver, forwarding_args);
   if (super_call != NULL) {
     current_block_->statements->Add(super_call);
   }
@@ -3221,8 +3135,7 @@
             DumpPendingFunctions(Z, pending_functions);
         ASSERT(pending_function_dump != NULL);
         ReportError("circular dependency for function %s\n%s",
-                    fname.ToCString(),
-                    pending_function_dump);
+                    fname.ToCString(), pending_function_dump);
       } else {
         ReportError("circular dependency for function %s", fname.ToCString());
       }
@@ -3281,10 +3194,10 @@
 
   const bool is_redirecting_constructor =
       (CurrentToken() == Token::kCOLON) &&
-          ((LookaheadToken(1) == Token::kTHIS) &&
-              ((LookaheadToken(2) == Token::kLPAREN) ||
-              ((LookaheadToken(2) == Token::kPERIOD) &&
-              (LookaheadToken(4) == Token::kLPAREN))));
+      ((LookaheadToken(1) == Token::kTHIS) &&
+       ((LookaheadToken(2) == Token::kLPAREN) ||
+        ((LookaheadToken(2) == Token::kPERIOD) &&
+         (LookaheadToken(4) == Token::kLPAREN))));
 
   GrowableArray<Field*> initialized_fields;
   LocalVariable* receiver = (*params.parameters)[0].var;
@@ -3342,16 +3255,12 @@
         ASSERT(p != NULL);
         AstNode* value = new LoadLocalNode(param.name_pos, p);
         EnsureExpressionTemp();
-        AstNode* initializer =
-            CheckDuplicateFieldInit(param.name_pos,
-                                    &initialized_fields,
-                                    instance,
-                                    &field,
-                                    value);
+        AstNode* initializer = CheckDuplicateFieldInit(
+            param.name_pos, &initialized_fields, instance, &field, value);
         if (initializer == NULL) {
-          initializer = new(Z) StoreInstanceFieldNode(
-              param.name_pos, instance, field, value,
-              /* is_initializer = */ true);
+          initializer = new (Z)
+              StoreInstanceFieldNode(param.name_pos, instance, field, value,
+                                     /* is_initializer = */ true);
         }
         current_block_->statements->Add(initializer);
       }
@@ -3389,14 +3298,11 @@
     if (func.is_external()) {
       // Body of an external method contains a single throw.
       const String& function_name = String::ZoneHandle(func.name());
-      current_block_->statements->Add(
-          ThrowNoSuchMethodError(TokenPos(),
-                                 cls,
-                                 function_name,
-                                 NULL,   // No arguments.
-                                 InvocationMirror::kStatic,
-                                 InvocationMirror::kMethod,
-                                 NULL));  // No existing function.
+      current_block_->statements->Add(ThrowNoSuchMethodError(
+          TokenPos(), cls, function_name,
+          NULL,  // No arguments.
+          InvocationMirror::kStatic, InvocationMirror::kMethod,
+          NULL));  // No existing function.
     }
   } else {
     UnexpectedToken();
@@ -3442,10 +3348,8 @@
   if (func.IsClosureFunction()) {
     // The first parameter of a closure function is the closure object.
     ASSERT(!func.is_const());  // Closure functions cannot be const.
-    params.AddFinalParameter(
-        TokenPos(),
-        &Symbols::ClosureParameter(),
-        &Object::dynamic_type());
+    params.AddFinalParameter(TokenPos(), &Symbols::ClosureParameter(),
+                             &Object::dynamic_type());
   } else if (!func.is_static()) {
     // Static functions do not have a receiver.
     ASSERT(current_class().raw() == func.Owner());
@@ -3453,17 +3357,14 @@
   } else if (func.IsFactory()) {
     // The first parameter of a factory is the TypeArguments vector of
     // the type of the instance to be allocated.
-    params.AddFinalParameter(
-        TokenPos(),
-        &Symbols::TypeArgumentsParameter(),
-        &Object::dynamic_type());
+    params.AddFinalParameter(TokenPos(), &Symbols::TypeArgumentsParameter(),
+                             &Object::dynamic_type());
   }
   // Expect the parameter list unless this is a getter function, or the
   // body closure of an async or generator getter function.
-  ASSERT((CurrentToken() == Token::kLPAREN) ||
-         func.IsGetterFunction() ||
+  ASSERT((CurrentToken() == Token::kLPAREN) || func.IsGetterFunction() ||
          (func.is_generated_body() &&
-             Function::Handle(func.parent_function()).IsGetterFunction()));
+          Function::Handle(func.parent_function()).IsGetterFunction()));
   const bool allow_explicit_default_values = true;
   if (func.IsGetterFunction()) {
     // Populate function scope with the formal parameters. Since in this case
@@ -3476,12 +3377,10 @@
     ASSERT(AbstractType::Handle(Z, func.result_type()).IsResolved());
     ASSERT(func.NumParameters() == params.parameters->length());
     if (!Function::Handle(func.parent_function()).IsGetterFunction()) {
-      // Parse and discard any formal parameters. They are accessed as
-      // context variables.
-      ParamList discarded_params;
-      ParseFormalParameterList(allow_explicit_default_values,
-                               false,
-                               &discarded_params);
+      // Skip formal parameters. They are accessed as context variables.
+      // Parsing them again (and discarding them) does not work in case of
+      // default values with same name as already parsed formal parameter.
+      SkipToMatchingParenthesis();
     }
   } else if (func.IsSyncGenClosure()) {
     AddSyncGenClosureParameters(&params);
@@ -3489,12 +3388,10 @@
     AddFormalParamsToScope(&params, current_block_->scope);
     ASSERT(AbstractType::Handle(Z, func.result_type()).IsResolved());
     if (!Function::Handle(func.parent_function()).IsGetterFunction()) {
-      // Parse and discard any formal parameters. They are accessed as
-      // context variables.
-      ParamList discarded_params;
-      ParseFormalParameterList(allow_explicit_default_values,
-                               false,
-                               &discarded_params);
+      // Skip formal parameters. They are accessed as context variables.
+      // Parsing them again (and discarding them) does not work in case of
+      // default values with same name as already parsed formal parameter.
+      SkipToMatchingParenthesis();
     }
   } else if (func.IsAsyncGenClosure()) {
     AddAsyncGenClosureParameters(&params);
@@ -3503,12 +3400,10 @@
     ASSERT(AbstractType::Handle(Z, func.result_type()).IsResolved());
     ASSERT(func.NumParameters() == params.parameters->length());
     if (!Function::Handle(func.parent_function()).IsGetterFunction()) {
-      // Parse and discard any formal parameters. They are accessed as
-      // context variables.
-      ParamList discarded_params;
-      ParseFormalParameterList(allow_explicit_default_values,
-                               false,
-                               &discarded_params);
+      // Skip formal parameters. They are accessed as context variables.
+      // Parsing them again (and discarding them) does not work in case of
+      // default values with same name as already parsed formal parameter.
+      SkipToMatchingParenthesis();
     }
   } else {
     ParseFormalParameterList(allow_explicit_default_values, false, &params);
@@ -3527,8 +3422,7 @@
     // Populate function scope with the formal parameters.
     AddFormalParamsToScope(&params, current_block_->scope);
 
-    if (I->type_checks() &&
-        (FunctionLevel() > 0)) {
+    if (I->type_checks() && (FunctionLevel() > 0)) {
       // We are parsing, but not compiling, a local function.
       // The instantiator may be required at run time for generic type checks.
       if (IsInstantiatorRequired()) {
@@ -3598,8 +3492,7 @@
                   "=> style function may not be sync* or async* generator");
     }
     ConsumeToken();
-    if (String::Handle(Z, func.name()).Equals(
-        Symbols::EqualOperator())) {
+    if (String::Handle(Z, func.name()).Equals(Symbols::EqualOperator())) {
       const Class& owner = Class::Handle(Z, func.Owner());
       if (!owner.IsObjectClass()) {
         AddEqualityNullCheck();
@@ -3614,8 +3507,7 @@
       ExpectSemicolon();
     }
   } else if (IsSymbol(Symbols::Native())) {
-    if (String::Handle(Z, func.name()).Equals(
-        Symbols::EqualOperator())) {
+    if (String::Handle(Z, func.name()).Equals(Symbols::EqualOperator())) {
       const Class& owner = Class::Handle(Z, func.Owner());
       if (!owner.IsObjectClass()) {
         AddEqualityNullCheck();
@@ -3627,16 +3519,13 @@
   } else if (func.is_external()) {
     // Body of an external method contains a single throw.
     const String& function_name = String::ZoneHandle(Z, func.name());
-    current_block_->statements->Add(
-        ThrowNoSuchMethodError(TokenPos(),
-                               Class::Handle(func.Owner()),
-                               function_name,
-                               NULL,  // Ignore arguments.
-                               func.is_static() ?
-                                   InvocationMirror::kStatic :
-                                   InvocationMirror::kDynamic,
-                               InvocationMirror::kMethod,
-                               &func));  // Unpatched external function.
+    current_block_->statements->Add(ThrowNoSuchMethodError(
+        TokenPos(), Class::Handle(func.Owner()), function_name,
+        NULL,  // Ignore arguments.
+        func.is_static() ? InvocationMirror::kStatic
+                         : InvocationMirror::kDynamic,
+        InvocationMirror::kMethod,
+        &func));  // Unpatched external function.
     end_token_pos = TokenPos();
   } else {
     UnexpectedToken();
@@ -3671,28 +3560,20 @@
 
 
 void Parser::AddEqualityNullCheck() {
-  AstNode* argument =
-      new LoadLocalNode(TokenPosition::kNoSource,
-                        current_block_->scope->parent()->VariableAt(1));
+  AstNode* argument = new LoadLocalNode(
+      TokenPosition::kNoSource, current_block_->scope->parent()->VariableAt(1));
   LiteralNode* null_operand =
       new LiteralNode(TokenPosition::kNoSource, Instance::ZoneHandle(Z));
-  ComparisonNode* check_arg =
-      new ComparisonNode(TokenPosition::kNoSource,
-                         Token::kEQ_STRICT,
-                         argument,
-                         null_operand);
+  ComparisonNode* check_arg = new ComparisonNode(
+      TokenPosition::kNoSource, Token::kEQ_STRICT, argument, null_operand);
   ComparisonNode* result =
-      new ComparisonNode(TokenPosition::kNoSource,
-                         Token::kEQ_STRICT,
-                         LoadReceiver(TokenPosition::kNoSource),
-                         null_operand);
-  SequenceNode* arg_is_null = new SequenceNode(TokenPosition::kNoSource,
-                                               current_block_->scope);
+      new ComparisonNode(TokenPosition::kNoSource, Token::kEQ_STRICT,
+                         LoadReceiver(TokenPosition::kNoSource), null_operand);
+  SequenceNode* arg_is_null =
+      new SequenceNode(TokenPosition::kNoSource, current_block_->scope);
   arg_is_null->Add(new ReturnNode(TokenPosition::kNoSource, result));
-  IfNode* if_arg_null = new IfNode(TokenPosition::kNoSource,
-                                   check_arg,
-                                   arg_is_null,
-                                   NULL);
+  IfNode* if_arg_null =
+      new IfNode(TokenPosition::kNoSource, check_arg, arg_is_null, NULL);
   current_block_->statements->Add(if_arg_null);
 }
 
@@ -3785,8 +3666,7 @@
 void Parser::ParseMethodOrConstructor(ClassDesc* members, MemberDesc* method) {
   TRACE_PARSER("ParseMethodOrConstructor");
   // We are at the beginning of the formal parameters list.
-  ASSERT(CurrentToken() == Token::kLPAREN ||
-         CurrentToken() == Token::kLT ||
+  ASSERT(CurrentToken() == Token::kLPAREN || CurrentToken() == Token::kLT ||
          method->IsGetter());
   ASSERT(method->type != NULL);  // May still be unresolved.
   ASSERT(current_member_ == method);
@@ -3798,10 +3678,9 @@
     ReportError(method->name_pos, "'final' not allowed for methods");
   }
   if (method->has_abstract && method->has_static) {
-    ReportError(method->name_pos,
-                "static method '%s' cannot be abstract",
+    ReportError(method->name_pos, "static method '%s' cannot be abstract",
                 method->name->ToCString());
-     }
+  }
   if (method->has_const && !method->IsFactoryOrConstructor()) {
     ReportError(method->name_pos, "'const' not allowed for methods");
   }
@@ -3812,16 +3691,14 @@
     current_class().set_is_const();
   }
 
-  Function& func = Function::Handle(Z,
+  Function& func = Function::Handle(
+      Z,
       Function::New(*method->name,  // May change.
-                    method->kind,
-                    method->has_static,
-                    method->has_const,
+                    method->kind, method->has_static, method->has_const,
                     method->has_abstract,  // May change.
                     method->has_external,
                     method->has_native,  // May change.
-                    current_class(),
-                    method->decl_begin_pos));
+                    current_class(), method->decl_begin_pos));
 
   ASSERT(innermost_function().IsNull());
   innermost_function_ = func.raw();
@@ -3836,7 +3713,7 @@
     }
     if (method->IsGetter() || method->IsSetter()) {
       ReportError(type_param_pos, "%s cannot be generic",
-          method->IsGetter() ? "getter" : "setter");
+                  method->IsGetter() ? "getter" : "setter");
     }
     ParseTypeParameters(false);  // Not parameterizing class, but function.
   }
@@ -3859,17 +3736,15 @@
   if (!method->has_static || method->IsConstructor()) {
     method->params.AddReceiver(ReceiverType(current_class()), formal_param_pos);
   } else if (method->IsFactory()) {
-    method->params.AddFinalParameter(
-        formal_param_pos,
-        &Symbols::TypeArgumentsParameter(),
-        &Object::dynamic_type());
+    method->params.AddFinalParameter(formal_param_pos,
+                                     &Symbols::TypeArgumentsParameter(),
+                                     &Object::dynamic_type());
   }
   if (are_implicitly_final) {
     method->params.SetImplicitlyFinal();
   }
   if (!method->IsGetter()) {
-    ParseFormalParameterList(allow_explicit_default_values,
-                             false,
+    ParseFormalParameterList(allow_explicit_default_values, false,
                              &method->params);
   }
 
@@ -3877,7 +3752,7 @@
   // unary and binary operator -.
   if (method->has_operator) {
     if ((method->operator_token == Token::kSUB) &&
-       (method->params.num_fixed_parameters == 1)) {
+        (method->params.num_fixed_parameters == 1)) {
       // Patch up name for unary operator - so it does not clash with the
       // name for binary operator -.
       method->operator_token = Token::kNEGATE;
@@ -3897,8 +3772,8 @@
     } else {
       ASSERT(method->IsSetter());
       expected_num_parameters = (method->has_static) ? 1 : 2;
-      method->dict_name = &String::ZoneHandle(Z,
-          Symbols::FromConcat(T, *method->name, Symbols::Equals()));
+      method->dict_name = &String::ZoneHandle(
+          Z, Symbols::FromConcat(T, *method->name, Symbols::Equals()));
       method->name = &String::ZoneHandle(Z, Field::SetterSymbol(*method->name));
     }
     if ((method->params.num_fixed_parameters != expected_num_parameters) ||
@@ -3915,9 +3790,10 @@
   if (method->IsFactory() && (CurrentToken() == Token::kASSIGN)) {
     // Default parameter values are disallowed in redirecting factories.
     if (method->params.has_explicit_default_values) {
-      ReportError("redirecting factory '%s' may not specify default values "
-                  "for optional parameters",
-                  method->name->ToCString());
+      ReportError(
+          "redirecting factory '%s' may not specify default values "
+          "for optional parameters",
+          method->name->ToCString());
     }
     if (method->has_external) {
       ReportError(TokenPos(),
@@ -3930,16 +3806,14 @@
     const bool consume_unresolved_prefix =
         (LookaheadToken(3) == Token::kLT) ||
         (LookaheadToken(3) == Token::kPERIOD);
-    const AbstractType& type = AbstractType::Handle(Z,
-        ParseType(ClassFinalizer::kResolveTypeParameters,
-                  true,
-                  consume_unresolved_prefix));
+    const AbstractType& type = AbstractType::Handle(
+        Z, ParseType(ClassFinalizer::kResolveTypeParameters, true,
+                     consume_unresolved_prefix));
     if (!type.IsMalformed() && type.IsTypeParameter()) {
       // Replace the type with a malformed type and compile a throw when called.
       redirection_type = ClassFinalizer::NewFinalizedMalformedType(
           Error::Handle(Z),  // No previous error.
-          script_,
-          type_pos,
+          script_, type_pos,
           "factory '%s' may not redirect to type parameter '%s'",
           method->name->ToCString(),
           String::Handle(Z, type.UserVisibleName()).ToCString());
@@ -3970,7 +3844,8 @@
       if (method->params.has_field_initializer) {
         // Constructors that redirect to another constructor must not
         // initialize any fields using field initializer parameters.
-        ReportError(formal_param_pos, "Redirecting constructor "
+        ReportError(formal_param_pos,
+                    "Redirecting constructor "
                     "may not use field initializer parameters");
       }
       ConsumeToken();  // Colon.
@@ -3996,8 +3871,7 @@
   // Only constructors can redirect to another method.
   ASSERT((method->redirect_name == NULL) || method->IsConstructor());
 
-  if (method->IsConstructor() &&
-      method->has_external &&
+  if (method->IsConstructor() && method->has_external &&
       method->params.has_field_initializer) {
     ReportError(method->name_pos,
                 "external constructor '%s' may not have field initializers",
@@ -4008,23 +3882,20 @@
   RawFunction::AsyncModifier async_modifier = ParseFunctionModifier();
   if ((method->IsFactoryOrConstructor() || method->IsSetter()) &&
       (async_modifier != RawFunction::kNoModifier)) {
-    ReportError(modifier_pos,
-                "%s '%s' may not be async, async* or sync*",
+    ReportError(modifier_pos, "%s '%s' may not be async, async* or sync*",
                 (method->IsSetter()) ? "setter" : "constructor",
                 method->name->ToCString());
   }
 
   TokenPosition method_end_pos = TokenPos();
   String* native_name = NULL;
-  if ((CurrentToken() == Token::kLBRACE) ||
-      (CurrentToken() == Token::kARROW)) {
+  if ((CurrentToken() == Token::kLBRACE) || (CurrentToken() == Token::kARROW)) {
     if (method->has_abstract) {
       ReportError(TokenPos(),
                   "abstract method '%s' may not have a function body",
                   method->name->ToCString());
     } else if (method->has_external) {
-      ReportError(TokenPos(),
-                  "external %s '%s' may not have a function body",
+      ReportError(TokenPos(), "external %s '%s' may not have a function body",
                   method->IsFactoryOrConstructor() ? "constructor" : "method",
                   method->name->ToCString());
     } else if (method->IsConstructor() && method->has_const) {
@@ -4032,8 +3903,7 @@
                   "const constructor '%s' may not have a function body",
                   method->name->ToCString());
     } else if (method->IsFactory() && method->has_const) {
-      ReportError(TokenPos(),
-                  "const factory '%s' may not have a function body",
+      ReportError(TokenPos(), "const factory '%s' may not have a function body",
                   method->name->ToCString());
     }
     if (method->redirect_name != NULL) {
@@ -4063,8 +3933,7 @@
                   "abstract method '%s' may not have a function body",
                   method->name->ToCString());
     } else if (method->IsConstructor() && method->has_const) {
-      ReportError(method->name_pos,
-                  "const constructor '%s' may not be native",
+      ReportError(method->name_pos, "const constructor '%s' may not be native",
                   method->name->ToCString());
     }
     if (method->redirect_name != NULL) {
@@ -4077,23 +3946,19 @@
     method->has_native = true;
   } else {
     // We haven't found a method body. Issue error if one is required.
-    const bool must_have_body =
-        method->has_static &&
-        !method->has_external &&
-        redirection_type.IsNull();
+    const bool must_have_body = method->has_static && !method->has_external &&
+                                redirection_type.IsNull();
     if (must_have_body) {
-      ReportError(method->name_pos,
-                  "function body expected for method '%s'",
+      ReportError(method->name_pos, "function body expected for method '%s'",
                   method->name->ToCString());
     }
 
     if (CurrentToken() == Token::kSEMICOLON) {
       ConsumeToken();
-      if (!method->has_static &&
-          !method->has_external &&
+      if (!method->has_static && !method->has_external &&
           !method->IsConstructor()) {
-          // Methods, getters and setters without a body are
-          // implicitly abstract.
+        // Methods, getters and setters without a body are
+        // implicitly abstract.
         method->has_abstract = true;
       }
     } else {
@@ -4166,8 +4031,7 @@
   // The parser has read the first field name and is now at the token
   // after the field name.
   ASSERT(CurrentToken() == Token::kSEMICOLON ||
-         CurrentToken() == Token::kCOMMA ||
-         CurrentToken() == Token::kASSIGN);
+         CurrentToken() == Token::kCOMMA || CurrentToken() == Token::kASSIGN);
   ASSERT(field->type != NULL);
   ASSERT(field->name_pos.IsReal());
   ASSERT(current_member_ == field);
@@ -4227,14 +4091,9 @@
     // Create the field object.
     const bool is_reflectable =
         !(library_.is_dart_scheme() && library_.IsPrivate(*field->name));
-    class_field = Field::New(*field->name,
-                             field->has_static,
-                             field->has_final,
-                             field->has_const,
-                             is_reflectable,
-                             current_class(),
-                             *field->type,
-                             field->name_pos);
+    class_field = Field::New(*field->name, field->has_static, field->has_final,
+                             field->has_const, is_reflectable, current_class(),
+                             *field->type, field->name_pos);
     class_field.set_has_initializer(has_initializer);
     members->AddField(class_field);
     field->field_ = &class_field;
@@ -4264,15 +4123,12 @@
       if (!has_simple_literal) {
         String& getter_name =
             String::Handle(Z, Field::GetterSymbol(*field->name));
-        getter = Function::New(getter_name,
-                               RawFunction::kImplicitStaticFinalGetter,
-                               field->has_static,
-                               field->has_const,
-                               /* is_abstract = */ false,
-                               /* is_external = */ false,
-                               /* is_native = */ false,
-                               current_class(),
-                               field->name_pos);
+        getter = Function::New(
+            getter_name, RawFunction::kImplicitStaticFinalGetter,
+            field->has_static, field->has_const,
+            /* is_abstract = */ false,
+            /* is_external = */ false,
+            /* is_native = */ false, current_class(), field->name_pos);
         getter.set_result_type(*field->type);
         getter.set_is_debuggable(false);
         if (library_.is_dart_scheme() && library_.IsPrivate(*field->name)) {
@@ -4287,12 +4143,10 @@
       String& getter_name =
           String::Handle(Z, Field::GetterSymbol(*field->name));
       getter = Function::New(getter_name, RawFunction::kImplicitGetter,
-                             field->has_static,
-                             field->has_final,
+                             field->has_static, field->has_final,
                              /* is_abstract = */ false,
                              /* is_external = */ false,
-                             /* is_native = */ false,
-                             current_class(),
+                             /* is_native = */ false, current_class(),
                              field->name_pos);
       ParamList params;
       ASSERT(current_class().raw() == getter.Owner());
@@ -4306,19 +4160,15 @@
         String& setter_name =
             String::Handle(Z, Field::SetterSymbol(*field->name));
         setter = Function::New(setter_name, RawFunction::kImplicitSetter,
-                               field->has_static,
-                               field->has_final,
+                               field->has_static, field->has_final,
                                /* is_abstract = */ false,
                                /* is_external = */ false,
-                               /* is_native = */ false,
-                               current_class(),
+                               /* is_native = */ false, current_class(),
                                field->name_pos);
         ParamList params;
         ASSERT(current_class().raw() == setter.Owner());
         params.AddReceiver(ReceiverType(current_class()), field->name_pos);
-        params.AddFinalParameter(TokenPos(),
-                                 &Symbols::Value(),
-                                 field->type);
+        params.AddFinalParameter(TokenPos(), &Symbols::Value(), field->type);
         setter.set_result_type(Object::void_type());
         setter.set_is_debuggable(false);
         if (library_.is_dart_scheme() && library_.IsPrivate(*field->name)) {
@@ -4361,29 +4211,22 @@
 }
 
 
-void Parser::CheckMemberNameConflict(ClassDesc* members,
-                                     MemberDesc* member) {
+void Parser::CheckMemberNameConflict(ClassDesc* members, MemberDesc* member) {
   const String& name = *member->DictName();
   if (name.Equals(members->class_name())) {
-    ReportError(member->name_pos,
-                "%s '%s' conflicts with class name",
-                member->ToCString(),
-                name.ToCString());
+    ReportError(member->name_pos, "%s '%s' conflicts with class name",
+                member->ToCString(), name.ToCString());
   }
   if (members->clazz().LookupTypeParameter(name) != TypeParameter::null()) {
-    ReportError(member->name_pos,
-                "%s '%s' conflicts with type parameter",
-                member->ToCString(),
-                name.ToCString());
+    ReportError(member->name_pos, "%s '%s' conflicts with type parameter",
+                member->ToCString(), name.ToCString());
   }
   for (int i = 0; i < members->members().length(); i++) {
     MemberDesc* existing_member = &members->members()[i];
     if (name.Equals(*existing_member->DictName())) {
-      ReportError(member->name_pos,
-                  "%s '%s' conflicts with previously declared %s",
-                  member->ToCString(),
-                  name.ToCString(),
-                  existing_member->ToCString());
+      ReportError(
+          member->name_pos, "%s '%s' conflicts with previously declared %s",
+          member->ToCString(), name.ToCString(), existing_member->ToCString());
     }
   }
 }
@@ -4425,7 +4268,7 @@
     // The member type is the 'dynamic' type.
     member.type = &Object::dynamic_type();
   } else if ((CurrentToken() == Token::kFACTORY) &&
-      (LookaheadToken(1) != Token::kLPAREN)) {
+             (LookaheadToken(1) != Token::kLPAREN)) {
     ConsumeToken();
     if (member.has_static) {
       ReportError("factory method cannot be explicitly marked static");
@@ -4449,10 +4292,9 @@
       // Lookahead to determine whether the next tokens are a return type.
       TokenPosScope saved_pos(this);
       if (TryParseReturnType()) {
-        if (IsIdentifier() ||
-           (CurrentToken() == Token::kGET) ||
-           (CurrentToken() == Token::kSET) ||
-           (CurrentToken() == Token::kOPERATOR)) {
+        if (IsIdentifier() || (CurrentToken() == Token::kGET) ||
+            (CurrentToken() == Token::kSET) ||
+            (CurrentToken() == Token::kOPERATOR)) {
           found_type = true;
         }
       }
@@ -4460,8 +4302,8 @@
     if (found_type) {
       // It is too early to resolve the type here, since it can be a result type
       // referring to a not yet declared function type parameter.
-      member.type = &AbstractType::ZoneHandle(Z,
-          ParseType(ClassFinalizer::kDoNotResolve));
+      member.type = &AbstractType::ZoneHandle(
+          Z, ParseType(ClassFinalizer::kDoNotResolve));
     }
   }
 
@@ -4486,17 +4328,17 @@
     }
     // Do not bypass class resolution by using current_class() directly, since
     // it may be a patch class.
-    const Object& result_type_class = Object::Handle(Z,
-        UnresolvedClass::New(LibraryPrefix::Handle(Z),
-                             *member.name,
-                             member.name_pos));
+    const Object& result_type_class =
+        Object::Handle(Z, UnresolvedClass::New(LibraryPrefix::Handle(Z),
+                                               *member.name, member.name_pos));
     // The type arguments of the result type are the type parameters of the
     // current class. Note that in the case of a patch class, they are copied
     // from the class being patched.
-    member.type = &Type::ZoneHandle(Z, Type::New(
-        result_type_class,
-        TypeArguments::Handle(Z, current_class().type_parameters()),
-        member.name_pos));
+    member.type = &Type::ZoneHandle(
+        Z,
+        Type::New(result_type_class,
+                  TypeArguments::Handle(Z, current_class().type_parameters()),
+                  member.name_pos));
 
     // We must be dealing with a constructor or named constructor.
     member.kind = RawFunction::kConstructor;
@@ -4515,7 +4357,7 @@
              (LookaheadToken(1) != Token::kLPAREN) &&
              (LookaheadToken(1) != Token::kLT) &&
              (LookaheadToken(1) != Token::kASSIGN) &&
-             (LookaheadToken(1) != Token::kCOMMA)  &&
+             (LookaheadToken(1) != Token::kCOMMA) &&
              (LookaheadToken(1) != Token::kSEMICOLON)) {
     ConsumeToken();
     member.kind = RawFunction::kGetterFunction;
@@ -4526,8 +4368,8 @@
              (LookaheadToken(1) != Token::kLPAREN) &&
              (LookaheadToken(1) != Token::kLT) &&
              (LookaheadToken(1) != Token::kASSIGN) &&
-             (LookaheadToken(1) != Token::kCOMMA)  &&
-             (LookaheadToken(1) != Token::kSEMICOLON))  {
+             (LookaheadToken(1) != Token::kCOMMA) &&
+             (LookaheadToken(1) != Token::kSEMICOLON)) {
     ConsumeToken();
     member.kind = RawFunction::kSetterFunction;
     member.name_pos = this->TokenPos();
@@ -4541,7 +4383,7 @@
   } else if ((CurrentToken() == Token::kOPERATOR) && !member.has_var &&
              (LookaheadToken(1) != Token::kLPAREN) &&
              (LookaheadToken(1) != Token::kASSIGN) &&
-             (LookaheadToken(1) != Token::kCOMMA)  &&
+             (LookaheadToken(1) != Token::kCOMMA) &&
              (LookaheadToken(1) != Token::kSEMICOLON)) {
     // TODO(hausner): handle the case of a generic function named 'operator':
     // eg: T operator<T>(a, b) => ...
@@ -4556,8 +4398,8 @@
     member.has_operator = true;
     member.kind = RawFunction::kRegularFunction;
     member.name_pos = this->TokenPos();
-    member.name = &String::ZoneHandle(Z,
-        Symbols::Token(member.operator_token).raw());
+    member.name =
+        &String::ZoneHandle(Z, Symbols::Token(member.operator_token).raw());
     ConsumeToken();
   } else if (IsIdentifier()) {
     member.name = CurrentLiteral();
@@ -4576,7 +4418,7 @@
     ASSERT(member.IsFactory() == member.has_factory);
     // Note that member.type may still be unresolved.
     ParseMethodOrConstructor(members, &member);
-  } else if (CurrentToken() ==  Token::kSEMICOLON ||
+  } else if (CurrentToken() == Token::kSEMICOLON ||
              CurrentToken() == Token::kCOMMA ||
              CurrentToken() == Token::kASSIGN) {
     // Field definition.
@@ -4588,8 +4430,9 @@
       if (member.has_final) {
         member.type = &Object::dynamic_type();
       } else {
-        ReportError("missing 'var', 'final', 'const' or type"
-                    " in field declaration");
+        ReportError(
+            "missing 'var', 'final', 'const' or type"
+            " in field declaration");
       }
     } else if (member.type->IsVoidType()) {
       ReportError(member.name_pos, "field may not be 'void'");
@@ -4665,7 +4508,7 @@
   bool is_patch = false;
   bool is_abstract = false;
   TokenPosition declaration_pos =
-    metadata_pos.IsReal() ? metadata_pos : TokenPos();
+      metadata_pos.IsReal() ? metadata_pos : TokenPos();
   if (is_patch_source() && IsPatchAnnotation(metadata_pos)) {
     is_patch = true;
     metadata_pos = TokenPosition::kNoSource;
@@ -4731,35 +4574,35 @@
                   "class '%s' must be patched with identical type parameters",
                   class_name.ToCString());
     }
-    TypeParameter& new_type_param = TypeParameter::Handle(Z);
-    TypeParameter& orig_type_param = TypeParameter::Handle(Z);
-    String& new_name = String::Handle(Z);
-    String& orig_name = String::Handle(Z);
-    AbstractType& new_bound = AbstractType::Handle(Z);
-    AbstractType& orig_bound = AbstractType::Handle(Z);
-    for (int i = 0; i < new_type_params_count; i++) {
-      new_type_param ^= new_type_parameters.TypeAt(i);
-      orig_type_param ^= orig_type_parameters.TypeAt(i);
-      new_name = new_type_param.name();
-      orig_name = orig_type_param.name();
-      if (!new_name.Equals(orig_name)) {
-        ReportError(new_type_param.token_pos(),
-                    "type parameter '%s' of patch class '%s' does not match "
-                    "original type parameter '%s'",
-                    new_name.ToCString(),
-                    class_name.ToCString(),
-                    orig_name.ToCString());
-      }
-      new_bound = new_type_param.bound();
-      orig_bound = orig_type_param.bound();
-      if (!new_bound.Equals(orig_bound)) {
-        ReportError(new_type_param.token_pos(),
-                    "bound '%s' of type parameter '%s' of patch class '%s' "
-                    "does not match original type parameter bound '%s'",
-                    String::Handle(new_bound.UserVisibleName()).ToCString(),
-                    new_name.ToCString(),
-                    class_name.ToCString(),
-                    String::Handle(orig_bound.UserVisibleName()).ToCString());
+    if (!FLAG_ignore_patch_signature_mismatch) {
+      TypeParameter& new_type_param = TypeParameter::Handle(Z);
+      TypeParameter& orig_type_param = TypeParameter::Handle(Z);
+      String& new_name = String::Handle(Z);
+      String& orig_name = String::Handle(Z);
+      AbstractType& new_bound = AbstractType::Handle(Z);
+      AbstractType& orig_bound = AbstractType::Handle(Z);
+      for (int i = 0; i < new_type_params_count; i++) {
+        new_type_param ^= new_type_parameters.TypeAt(i);
+        orig_type_param ^= orig_type_parameters.TypeAt(i);
+        new_name = new_type_param.name();
+        orig_name = orig_type_param.name();
+        if (!new_name.Equals(orig_name)) {
+          ReportError(new_type_param.token_pos(),
+                      "type parameter '%s' of patch class '%s' does not match "
+                      "original type parameter '%s'",
+                      new_name.ToCString(), class_name.ToCString(),
+                      orig_name.ToCString());
+        }
+        new_bound = new_type_param.bound();
+        orig_bound = orig_type_param.bound();
+        if (!new_bound.Equals(orig_bound)) {
+          ReportError(new_type_param.token_pos(),
+                      "bound '%s' of type parameter '%s' of patch class '%s' "
+                      "does not match original type parameter bound '%s'",
+                      String::Handle(new_bound.UserVisibleName()).ToCString(),
+                      new_name.ToCString(), class_name.ToCString(),
+                      String::Handle(orig_bound.UserVisibleName()).ToCString());
+        }
       }
     }
     cls.set_type_parameters(orig_type_parameters);
@@ -4789,16 +4632,13 @@
     }
     if (super_type.IsDynamicType()) {
       // Unlikely here, since super type is not resolved yet.
-      ReportError(type_pos,
-                  "class '%s' may not extend 'dynamic'",
+      ReportError(type_pos, "class '%s' may not extend 'dynamic'",
                   class_name.ToCString());
     }
     if (super_type.IsTypeParameter()) {
-      ReportError(type_pos,
-                  "class '%s' may not extend type parameter '%s'",
+      ReportError(type_pos, "class '%s' may not extend type parameter '%s'",
                   class_name.ToCString(),
-                  String::Handle(Z,
-                                 super_type.UserVisibleName()).ToCString());
+                  String::Handle(Z, super_type.UserVisibleName()).ToCString());
     }
     // The class finalizer will check whether the super type is malbounded.
     if (is_mixin_declaration) {
@@ -4871,8 +4711,7 @@
   ExpectToken(Token::kRBRACE);
 
   if (cls.LookupTypeParameter(class_name) != TypeParameter::null()) {
-    ReportError(class_pos,
-                "class name conflicts with type parameter '%s'",
+    ReportError(class_pos, "class name conflicts with type parameter '%s'",
                 class_name.ToCString());
   }
   CheckConstructors(&members);
@@ -4938,24 +4777,19 @@
                            true,   // Field is final.
                            false,  // Not const.
                            true,   // Is reflectable.
-                           cls,
-                           int_type,
-                           cls.token_pos());
+                           cls, int_type, cls.token_pos());
   enum_members.AddField(index_field);
 
   // Add implicit getter for index field.
   const String& getter_name =
       String::Handle(Z, Field::GetterSymbol(Symbols::Index()));
   Function& getter = Function::Handle(Z);
-  getter = Function::New(getter_name,
-                         RawFunction::kImplicitGetter,
+  getter = Function::New(getter_name, RawFunction::kImplicitGetter,
                          /* is_static = */ false,
                          /* is_const = */ true,
                          /* is_abstract = */ false,
                          /* is_external = */ false,
-                         /* is_native = */ false,
-                         cls,
-                         cls.token_pos());
+                         /* is_native = */ false, cls, cls.token_pos());
   getter.set_result_type(int_type);
   getter.set_is_debuggable(false);
   ParamList params;
@@ -4978,22 +4812,24 @@
     // Check for name conflicts.
     if (enum_ident->raw() == cls.Name()) {
       ReportError("enum identifier '%s' cannot be equal to enum type name",
-          CurrentLiteral()->ToCString());
+                  CurrentLiteral()->ToCString());
     } else if (enum_ident->raw() == Symbols::Index().raw()) {
-      ReportError("enum identifier conflicts with "
-                  "implicit instance field 'index'");
+      ReportError(
+          "enum identifier conflicts with "
+          "implicit instance field 'index'");
     } else if (enum_ident->raw() == Symbols::Values().raw()) {
-      ReportError("enum identifier conflicts with "
-                  "implicit static field 'values'");
+      ReportError(
+          "enum identifier conflicts with "
+          "implicit static field 'values'");
     } else if (enum_ident->raw() == Symbols::toString().raw()) {
-      ReportError("enum identifier conflicts with "
-                  "implicit instance method 'toString()'");
+      ReportError(
+          "enum identifier conflicts with "
+          "implicit instance method 'toString()'");
     }
     for (intptr_t n = 0; n < declared_names.length(); n++) {
       if (enum_ident->Equals(*declared_names[n])) {
         ReportError("Duplicate name '%s' in enum definition '%s'",
-                    enum_ident->ToCString(),
-                    enum_name.ToCString());
+                    enum_ident->ToCString(), enum_name.ToCString());
       }
     }
     declared_names.Add(enum_ident);
@@ -5003,10 +4839,8 @@
                             /* is_static = */ true,
                             /* is_final = */ true,
                             /* is_const = */ true,
-                            /* is_reflectable = */ true,
-                            cls,
-                            Object::dynamic_type(),
-                            cls.token_pos());
+                            /* is_reflectable = */ true, cls,
+                            Object::dynamic_type(), cls.token_pos());
     enum_value.set_has_initializer(false);
     enum_members.AddField(enum_value);
     // Initialize the field with the ordinal value. It will be patched
@@ -5023,18 +4857,27 @@
   }
   ExpectToken(Token::kRBRACE);
 
+  const Type& array_type = Type::Handle(Z, Type::ArrayType());
   // Add static field 'const List values'.
   Field& values_field = Field::ZoneHandle(Z);
-  values_field = Field::New(Symbols::Values(),
-                            /* is_static = */ true,
-                            /* is_final = */ true,
-                            /* is_const = */ true,
-                            /* is_reflectable = */ true,
-                            cls,
-                            Type::Handle(Z, Type::ArrayType()),
-                            cls.token_pos());
+  values_field =
+      Field::New(Symbols::Values(),
+                 /* is_static = */ true,
+                 /* is_final = */ true,
+                 /* is_const = */ true,
+                 /* is_reflectable = */ true, cls, array_type, cls.token_pos());
   enum_members.AddField(values_field);
 
+  // Add static field 'const _deleted_enum_sentinel'.
+  Field& deleted_enum_sentinel = Field::ZoneHandle(Z);
+  deleted_enum_sentinel = Field::New(Symbols::_DeletedEnumSentinel(),
+                                     /* is_static = */ true,
+                                     /* is_final = */ true,
+                                     /* is_const = */ true,
+                                     /* is_reflectable = */ false, cls,
+                                     Object::dynamic_type(), cls.token_pos());
+  enum_members.AddField(deleted_enum_sentinel);
+
   // Allocate the immutable array containing the enumeration values.
   // The actual enum instance values will be patched in later.
   const Array& values_array = Array::Handle(Z, Array::New(i, Heap::kOld));
@@ -5042,8 +4885,8 @@
   values_field.RecordStore(values_array);
 
   // Clone the _name field from the helper class.
-  Field& _name_field = Field::Handle(Z,
-      helper_class.LookupInstanceFieldAllowPrivate(Symbols::_name()));
+  Field& _name_field = Field::Handle(
+      Z, helper_class.LookupInstanceFieldAllowPrivate(Symbols::_name()));
   ASSERT(!_name_field.IsNull());
   _name_field = _name_field.Clone(cls);
   enum_members.AddField(_name_field);
@@ -5052,18 +4895,15 @@
   // name directly here so that the private key matches those of the other
   // cloned helper functions and fields.
   const Type& string_type = Type::Handle(Z, Type::StringType());
-  const String& name_getter_name = String::Handle(Z,
-      Field::GetterSymbol(String::Handle(_name_field.name())));
+  const String& name_getter_name = String::Handle(
+      Z, Field::GetterSymbol(String::Handle(_name_field.name())));
   Function& name_getter = Function::Handle(Z);
-  name_getter = Function::New(name_getter_name,
-                              RawFunction::kImplicitGetter,
+  name_getter = Function::New(name_getter_name, RawFunction::kImplicitGetter,
                               /* is_static = */ false,
                               /* is_const = */ true,
                               /* is_abstract = */ false,
                               /* is_external = */ false,
-                              /* is_native = */ false,
-                              cls,
-                              cls.token_pos());
+                              /* is_native = */ false, cls, cls.token_pos());
   name_getter.set_result_type(string_type);
   name_getter.set_is_debuggable(false);
   ParamList name_params;
@@ -5072,15 +4912,15 @@
   enum_members.AddFunction(name_getter);
 
   // Clone the toString() function from the helper class.
-  Function& to_string_func = Function::Handle(Z,
-      helper_class.LookupDynamicFunctionAllowPrivate(Symbols::toString()));
+  Function& to_string_func = Function::Handle(
+      Z, helper_class.LookupDynamicFunctionAllowPrivate(Symbols::toString()));
   ASSERT(!to_string_func.IsNull());
   to_string_func = to_string_func.Clone(cls);
   enum_members.AddFunction(to_string_func);
 
   // Clone the hashCode getter function from the helper class.
-  Function& hash_code_func = Function::Handle(Z,
-      helper_class.LookupDynamicFunctionAllowPrivate(Symbols::hashCode()));
+  Function& hash_code_func = Function::Handle(
+      Z, helper_class.LookupDynamicFunctionAllowPrivate(Symbols::hashCode()));
   ASSERT(!hash_code_func.IsNull());
   hash_code_func = hash_code_func.Clone(cls);
   enum_members.AddFunction(hash_code_func);
@@ -5099,16 +4939,13 @@
   // To indicate that this is an implicit constructor, we set the
   // token position and end token position of the function
   // to the token position of the class.
-  Function& ctor = Function::Handle(Z,
-      Function::New(ctor_name,
-                    RawFunction::kConstructor,
-                    /* is_static = */ false,
-                    /* is_const = */ false,
-                    /* is_abstract = */ false,
-                    /* is_external = */ false,
-                    /* is_native = */ false,
-                    cls,
-                    cls.token_pos()));
+  Function& ctor = Function::Handle(
+      Z, Function::New(ctor_name, RawFunction::kConstructor,
+                       /* is_static = */ false,
+                       /* is_const = */ false,
+                       /* is_abstract = */ false,
+                       /* is_external = */ false,
+                       /* is_native = */ false, cls, cls.token_pos()));
   ctor.set_end_token_pos(ctor.token_pos());
   ctor.set_is_debuggable(false);
   if (library_.is_dart_scheme() && library_.IsPrivate(ctor_name)) {
@@ -5159,10 +4996,9 @@
 }
 
 
-void Parser::ParseMixinAppAlias(
-    const GrowableObjectArray& pending_classes,
-    const Object& tl_owner,
-    TokenPosition metadata_pos) {
+void Parser::ParseMixinAppAlias(const GrowableObjectArray& pending_classes,
+                                const Object& tl_owner,
+                                TokenPosition metadata_pos) {
   TRACE_PARSER("ParseMixinAppAlias");
   const TokenPosition classname_pos = TokenPos();
   String& class_name = *ExpectUserDefinedTypeIdentifier("class name expected");
@@ -5175,9 +5011,8 @@
     ReportError(classname_pos, "'%s' is already defined",
                 class_name.ToCString());
   }
-  const Class& mixin_application =
-      Class::Handle(Z, Class::New(library_, class_name,
-                                  script_, classname_pos));
+  const Class& mixin_application = Class::Handle(
+      Z, Class::New(library_, class_name, script_, classname_pos));
   mixin_application.set_is_mixin_app_alias();
   library_.AddClass(mixin_application);
   set_current_class(mixin_application);
@@ -5191,12 +5026,10 @@
   }
 
   const TokenPosition type_pos = TokenPos();
-  AbstractType& type =
-      AbstractType::Handle(Z,
-                           ParseType(ClassFinalizer::kResolveTypeParameters));
+  AbstractType& type = AbstractType::Handle(
+      Z, ParseType(ClassFinalizer::kResolveTypeParameters));
   if (type.IsTypeParameter()) {
-    ReportError(type_pos,
-                "class '%s' may not extend type parameter '%s'",
+    ReportError(type_pos, "class '%s' may not extend type parameter '%s'",
                 class_name.ToCString(),
                 String::Handle(Z, type.UserVisibleName()).ToCString());
   }
@@ -5293,17 +5126,16 @@
   const Object& obj =
       Object::Handle(Z, library_.LookupLocalObject(*alias_name));
   if (!obj.IsNull()) {
-    ReportError(alias_name_pos,
-                "'%s' is already defined", alias_name->ToCString());
+    ReportError(alias_name_pos, "'%s' is already defined",
+                alias_name->ToCString());
   }
 
   // Create the function type alias scope class. It will be linked to its
   // signature function after it has been parsed. The type parameters, in order
   // to be properly finalized, need to be associated to this scope class as
   // they are parsed.
-  const Class& function_type_alias =
-      Class::Handle(Z, Class::New(
-          library_, *alias_name, script_, declaration_pos));
+  const Class& function_type_alias = Class::Handle(
+      Z, Class::New(library_, *alias_name, script_, declaration_pos));
   function_type_alias.set_is_synthesized_class();
   function_type_alias.set_is_abstract();
   function_type_alias.set_is_prefinalized();
@@ -5321,18 +5153,15 @@
   ParamList func_params;
 
   // Add implicit closure object parameter.
-  func_params.AddFinalParameter(
-      TokenPos(),
-      &Symbols::ClosureParameter(),
-      &Object::dynamic_type());
+  func_params.AddFinalParameter(TokenPos(), &Symbols::ClosureParameter(),
+                                &Object::dynamic_type());
 
   // Mark the current class as a typedef class (by setting its signature
   // function field to a non-null function) before parsing its formal parameters
   // so that parsed function types are aware that their owner class is a
   // typedef class.
-  Function& signature_function =
-      Function::Handle(Z, Function::NewSignatureFunction(function_type_alias,
-                                                         alias_name_pos));
+  Function& signature_function = Function::Handle(
+      Z, Function::NewSignatureFunction(function_type_alias, alias_name_pos));
   ASSERT(innermost_function().IsNull());
   innermost_function_ = signature_function.raw();
   // Set the signature function in the function type alias class.
@@ -5356,9 +5185,7 @@
   ASSERT(!function_type_alias.is_finalized());
   pending_classes.Add(function_type_alias, Heap::kOld);
   if (FLAG_enable_mirrors && metadata_pos.IsReal()) {
-    library_.AddClassMetadata(function_type_alias,
-                              tl_owner,
-                              metadata_pos);
+    library_.AddClassMetadata(function_type_alias, tl_owner, metadata_pos);
   }
 }
 
@@ -5493,10 +5320,7 @@
       type_parameter = TypeParameter::New(
           parameterizing_class ? current_class() : Class::Handle(Z),
           parameterizing_class ? Function::Handle(Z) : innermost_function(),
-          index,
-          type_parameter_name,
-          type_parameter_bound,
-          declaration_pos);
+          index, type_parameter_name, type_parameter_bound, declaration_pos);
       if (!parameterizing_class) {
         // TODO(regis): Resolve and finalize function type parameter in
         // class finalizer. For now, already mark as finalized.
@@ -5617,7 +5441,7 @@
     mixin_types.Add(mixin_type);
   } while (CurrentToken() == Token::kCOMMA);
   return MixinAppType::New(super_type,
-      Array::Handle(Z, Array::MakeArray(mixin_types)));
+                           Array::Handle(Z, Array::MakeArray(mixin_types)));
 }
 
 
@@ -5629,8 +5453,8 @@
   // Const fields are implicitly final.
   const bool is_final = is_const || (CurrentToken() == Token::kFINAL);
   const bool is_static = true;
-  const AbstractType& type = AbstractType::ZoneHandle(Z,
-      ParseConstFinalVarOrType(ClassFinalizer::kResolveTypeParameters));
+  const AbstractType& type = AbstractType::ZoneHandle(
+      Z, ParseConstFinalVarOrType(ClassFinalizer::kResolveTypeParameters));
   Field& field = Field::Handle(Z);
   Function& getter = Function::Handle(Z);
   while (true) {
@@ -5682,15 +5506,12 @@
       if (!has_simple_literal) {
         // Create a static final getter.
         String& getter_name = String::Handle(Z, Field::GetterSymbol(var_name));
-        getter = Function::New(getter_name,
-                               RawFunction::kImplicitStaticFinalGetter,
-                               is_static,
-                               is_const,
-                               /* is_abstract = */ false,
-                               /* is_external = */ false,
-                               /* is_native = */ false,
-                               owner,
-                               name_pos);
+        getter =
+            Function::New(getter_name, RawFunction::kImplicitStaticFinalGetter,
+                          is_static, is_const,
+                          /* is_abstract = */ false,
+                          /* is_external = */ false,
+                          /* is_native = */ false, owner, name_pos);
         getter.set_result_type(type);
         getter.set_is_debuggable(false);
         getter.set_is_reflectable(is_reflectable);
@@ -5725,8 +5546,7 @@
     } else {
       return RawFunction::kAsync;
     }
-  } else if (IsSymbol(Symbols::Sync()) &&
-      (LookaheadToken(1) == Token::kMUL)) {
+  } else if (IsSymbol(Symbols::Sync()) && (LookaheadToken(1) == Token::kMUL)) {
     const bool enableSyncStar = true;
     if (!enableSyncStar) {
       ReportError("sync* generator functions are not yet supported");
@@ -5783,16 +5603,13 @@
   // A setter named x= may co-exist with a function named x, thus we do
   // not need to check setters.
 
-  Function& func = Function::Handle(Z,
-      Function::New(func_name,
-                    RawFunction::kRegularFunction,
-                    /* is_static = */ true,
-                    /* is_const = */ false,
-                    /* is_abstract = */ false,
-                    is_external,
-                    /* is_native = */ false,  // May change.
-                    owner,
-                    decl_begin_pos));
+  Function& func = Function::Handle(
+      Z, Function::New(func_name, RawFunction::kRegularFunction,
+                       /* is_static = */ true,
+                       /* is_const = */ false,
+                       /* is_abstract = */ false, is_external,
+                       /* is_native = */ false,  // May change.
+                       owner, decl_begin_pos));
 
   ASSERT(innermost_function().IsNull());
   innermost_function_ = func.raw();
@@ -5895,8 +5712,7 @@
     is_external = true;
   }
   bool is_getter = (CurrentToken() == Token::kGET);
-  if (CurrentToken() == Token::kGET ||
-      CurrentToken() == Token::kSET) {
+  if (CurrentToken() == Token::kGET || CurrentToken() == Token::kSET) {
     ConsumeToken();
     result_type = Type::DynamicType();
   } else {
@@ -5955,12 +5771,10 @@
   bool found = library_.LookupLocalObject(accessor_name) != Object::null();
   if (found && !is_patch) {
     ReportError(name_pos, "%s for '%s' is already defined",
-                is_getter ? "getter" : "setter",
-                field_name->ToCString());
+                is_getter ? "getter" : "setter", field_name->ToCString());
   } else if (!found && is_patch) {
     ReportError(name_pos, "missing %s for '%s' cannot be patched",
-                is_getter ? "getter" : "setter",
-                field_name->ToCString());
+                is_getter ? "getter" : "setter", field_name->ToCString());
   }
 
   const TokenPosition modifier_pos = TokenPos();
@@ -5999,17 +5813,13 @@
   } else {
     ReportError("function block expected");
   }
-  Function& func = Function::Handle(Z,
-      Function::New(accessor_name,
-                    is_getter ? RawFunction::kGetterFunction :
-                                RawFunction::kSetterFunction,
-                    is_static,
-                    /* is_const = */ false,
-                    /* is_abstract = */ false,
-                    is_external,
-                    is_native,
-                    owner,
-                    decl_begin_pos));
+  Function& func = Function::Handle(
+      Z, Function::New(accessor_name, is_getter ? RawFunction::kGetterFunction
+                                                : RawFunction::kSetterFunction,
+                       is_static,
+                       /* is_const = */ false,
+                       /* is_abstract = */ false, is_external, is_native, owner,
+                       decl_begin_pos));
   func.set_result_type(result_type);
   func.set_end_token_pos(accessor_end_pos);
   func.set_modifier(func_modifier);
@@ -6026,9 +5836,9 @@
     library_.AddObject(func, accessor_name);
   } else {
     // Need to remove the previously added accessor that is being patched.
-    const Class& toplevel_cls = Class::Handle(Z,
-        owner.IsClass() ? Class::Cast(owner).raw()
-                        : PatchClass::Cast(owner).patched_class());
+    const Class& toplevel_cls = Class::Handle(
+        Z, owner.IsClass() ? Class::Cast(owner).raw()
+                           : PatchClass::Cast(owner).patched_class());
     const Function& replaced_func =
         Function::Handle(Z, toplevel_cls.LookupFunction(accessor_name));
     ASSERT(!replaced_func.IsNull());
@@ -6061,8 +5871,7 @@
   {
     TransitionVMToNative transition(T);
     Api::Scope api_scope(T);
-    Dart_Handle retval = handler(tag,
-                                 Api::NewHandle(T, library_.raw()),
+    Dart_Handle retval = handler(tag, Api::NewHandle(T, library_.raw()),
                                  Api::NewHandle(T, url.raw()));
     result = Api::UnwrapHandle(retval);
   }
@@ -6161,9 +5970,10 @@
       // Check if this conditional line overrides the default import.
       const String& key = String::Handle(
           String::ConcatAll(Array::Handle(Array::MakeArray(pieces))));
-      const String& value = (valueNode == NULL)
-          ? Symbols::True()
-          : String::Cast(valueNode->AsLiteralNode()->literal());
+      const String& value =
+          (valueNode == NULL)
+              ? Symbols::True()
+              : String::Cast(valueNode->AsLiteralNode()->literal());
       // Call the embedder to supply us with the environment.
       const String& env_value =
           String::Handle(Api::GetEnvironmentValue(T, key));
@@ -6195,8 +6005,7 @@
 
   Array& show_names = Array::Handle(Z);
   Array& hide_names = Array::Handle(Z);
-  if (is_deferred_import ||
-      IsSymbol(Symbols::Show()) ||
+  if (is_deferred_import || IsSymbol(Symbols::Show()) ||
       IsSymbol(Symbols::Hide())) {
     GrowableObjectArray& show_list =
         GrowableObjectArray::Handle(Z, GrowableObjectArray::New());
@@ -6247,8 +6056,8 @@
     CallLibraryTagHandler(Dart_kImportTag, import_pos, canon_url);
   }
 
-  Namespace& ns = Namespace::Handle(Z,
-      Namespace::New(library, show_names, hide_names));
+  Namespace& ns =
+      Namespace::Handle(Z, Namespace::New(library, show_names, hide_names));
   if (FLAG_enable_mirrors && metadata_pos.IsReal()) {
     ns.AddMetadata(tl_owner, metadata_pos);
   }
@@ -6345,7 +6154,7 @@
     metadata_pos = SkipMetadata();
   }
   while ((CurrentToken() == Token::kIMPORT) ||
-      (CurrentToken() == Token::kEXPORT)) {
+         (CurrentToken() == Token::kEXPORT)) {
     ParseLibraryImportExport(tl_owner, metadata_pos);
     rewind_pos = TokenPos();
     metadata_pos = SkipMetadata();
@@ -6355,7 +6164,8 @@
   if (!library_.ImportsCorelib()) {
     Library& core_lib = Library::Handle(Z, Library::CoreLibrary());
     ASSERT(!core_lib.IsNull());
-    const Namespace& core_ns = Namespace::Handle(Z,
+    const Namespace& core_ns = Namespace::Handle(
+        Z,
         Namespace::New(core_lib, Object::null_array(), Object::null_array()));
     library_.AddImport(core_ns);
   }
@@ -6431,7 +6241,7 @@
       set_current_class(toplevel_class);
       ParseTypedef(pending_classes, tl_owner, metadata_pos);
     } else if ((CurrentToken() == Token::kABSTRACT) &&
-        (LookaheadToken(1) == Token::kCLASS)) {
+               (LookaheadToken(1) == Token::kCLASS)) {
       ParseClassDeclaration(pending_classes, tl_owner, metadata_pos);
     } else {
       set_current_class(toplevel_class);
@@ -6475,10 +6285,8 @@
 
 
 void Parser::ChainNewBlock(LocalScope* outer_scope) {
-  Block* block = new(Z) Block(
-      current_block_,
-      outer_scope,
-      new(Z) SequenceNode(TokenPos(), outer_scope));
+  Block* block = new (Z) Block(current_block_, outer_scope,
+                               new (Z) SequenceNode(TokenPos(), outer_scope));
   current_block_ = block;
 }
 
@@ -6486,18 +6294,16 @@
 void Parser::OpenBlock() {
   ASSERT(current_block_ != NULL);
   LocalScope* outer_scope = current_block_->scope;
-  ChainNewBlock(new(Z) LocalScope(
-      outer_scope, outer_scope->function_level(), outer_scope->loop_level()));
+  ChainNewBlock(new (Z) LocalScope(outer_scope, outer_scope->function_level(),
+                                   outer_scope->loop_level()));
 }
 
 
 void Parser::OpenLoopBlock() {
   ASSERT(current_block_ != NULL);
   LocalScope* outer_scope = current_block_->scope;
-  ChainNewBlock(new(Z) LocalScope(
-      outer_scope,
-      outer_scope->function_level(),
-      outer_scope->loop_level() + 1));
+  ChainNewBlock(new (Z) LocalScope(outer_scope, outer_scope->function_level(),
+                                   outer_scope->loop_level() + 1));
 }
 
 
@@ -6506,22 +6312,20 @@
   if (current_block_ == NULL) {
     if (!func.IsLocalFunction()) {
       // We are compiling a non-nested function.
-      outer_scope = new(Z) LocalScope(NULL, 0, 0);
+      outer_scope = new (Z) LocalScope(NULL, 0, 0);
     } else {
       // We are compiling the function of an invoked closure.
       // Restore the outer scope containing all captured variables.
       const ContextScope& context_scope =
           ContextScope::Handle(Z, func.context_scope());
       ASSERT(!context_scope.IsNull());
-      outer_scope = new(Z) LocalScope(
-          LocalScope::RestoreOuterScope(context_scope), 0, 0);
+      outer_scope = new (Z)
+          LocalScope(LocalScope::RestoreOuterScope(context_scope), 0, 0);
     }
   } else {
     // We are parsing a nested function while compiling the enclosing function.
-    outer_scope =
-        new(Z) LocalScope(current_block_->scope,
-                                  current_block_->scope->function_level() + 1,
-                                  0);
+    outer_scope = new (Z) LocalScope(
+        current_block_->scope, current_block_->scope->function_level() + 1, 0);
   }
   ChainNewBlock(outer_scope);
 }
@@ -6534,7 +6338,7 @@
 }
 
 
-SequenceNode* Parser::CloseAsyncGeneratorTryBlock(SequenceNode *body) {
+SequenceNode* Parser::CloseAsyncGeneratorTryBlock(SequenceNode* body) {
   TRACE_PARSER("CloseAsyncGeneratorTryBlock");
   // The generated try-catch-finally that wraps the async generator function
   // body is the outermost try statement.
@@ -6562,25 +6366,24 @@
   stack_trace_param.type = &Object::dynamic_type();
   stack_trace_param.name = &Symbols::StackTraceParameter();
 
-  AddCatchParamsToScope(
-      &exception_param, &stack_trace_param, current_block_->scope);
+  AddCatchParamsToScope(&exception_param, &stack_trace_param,
+                        current_block_->scope);
 
   // Generate code to save the exception object and stack trace
   // in local variables.
-  LocalVariable* context_var = try_scope->LocalLookupVariable(
-      Symbols::SavedTryContextVar());
+  LocalVariable* context_var =
+      try_scope->LocalLookupVariable(Symbols::SavedTryContextVar());
   ASSERT(context_var != NULL);
 
-  LocalVariable* exception_var = try_scope->LocalLookupVariable(
-      Symbols::ExceptionVar());
+  LocalVariable* exception_var =
+      try_scope->LocalLookupVariable(Symbols::ExceptionVar());
   ASSERT(exception_var != NULL);
   if (exception_param.var != NULL) {
     // Generate code to load the exception object (:exception_var) into
     // the exception variable specified in this block.
-    current_block_->statements->Add(new(Z) StoreLocalNode(
-        TokenPosition::kNoSource,
-        exception_param.var,
-        new(Z) LoadLocalNode(TokenPosition::kNoSource, exception_var)));
+    current_block_->statements->Add(new (Z) StoreLocalNode(
+        TokenPosition::kNoSource, exception_param.var,
+        new (Z) LoadLocalNode(TokenPosition::kNoSource, exception_var)));
   }
 
   LocalVariable* stack_trace_var =
@@ -6590,19 +6393,16 @@
     // A stack trace variable is specified in this block, so generate code
     // to load the stack trace object (:stack_trace_var) into the stack
     // trace variable specified in this block.
-    current_block_->statements->Add(new(Z) StoreLocalNode(
-        TokenPosition::kNoSource,
-        stack_trace_param.var,
-        new(Z) LoadLocalNode(TokenPosition::kNoSource, stack_trace_var)));
+    current_block_->statements->Add(new (Z) StoreLocalNode(
+        TokenPosition::kNoSource, stack_trace_param.var,
+        new (Z) LoadLocalNode(TokenPosition::kNoSource, stack_trace_var)));
   }
-  LocalVariable* saved_exception_var = try_scope->LocalLookupVariable(
-      Symbols::SavedExceptionVar());
-  LocalVariable* saved_stack_trace_var = try_scope->LocalLookupVariable(
-      Symbols::SavedStackTraceVar());
-  SaveExceptionAndStacktrace(current_block_->statements,
-                             exception_var,
-                             stack_trace_var,
-                             saved_exception_var,
+  LocalVariable* saved_exception_var =
+      try_scope->LocalLookupVariable(Symbols::SavedExceptionVar());
+  LocalVariable* saved_stack_trace_var =
+      try_scope->LocalLookupVariable(Symbols::SavedStackTraceVar());
+  SaveExceptionAndStacktrace(current_block_->statements, exception_var,
+                             stack_trace_var, saved_exception_var,
                              saved_stack_trace_var);
 
   // Catch block: add the error to the stream.
@@ -6611,18 +6411,15 @@
   LocalVariable* controller =
       current_block_->scope->LookupVariable(Symbols::Controller(), false);
   ASSERT(controller != NULL);
-  ArgumentListNode* args =
-      new(Z) ArgumentListNode(TokenPosition::kNoSource);
-  args->Add(new(Z) LoadLocalNode(
-      TokenPosition::kNoSource, exception_param.var));
-  args->Add(new(Z) LoadLocalNode(
-      TokenPosition::kNoSource, stack_trace_param.var));
-  current_block_->statements->Add(
-      new(Z) InstanceCallNode(try_end_pos,
-          new(Z) LoadLocalNode(TokenPosition::kNoSource, controller),
-          Symbols::AddError(),
-          args));
-  ReturnNode* return_node = new(Z) ReturnNode(TokenPosition::kNoSource);
+  ArgumentListNode* args = new (Z) ArgumentListNode(TokenPosition::kNoSource);
+  args->Add(new (Z)
+                LoadLocalNode(TokenPosition::kNoSource, exception_param.var));
+  args->Add(new (Z)
+                LoadLocalNode(TokenPosition::kNoSource, stack_trace_param.var));
+  current_block_->statements->Add(new (Z) InstanceCallNode(
+      try_end_pos, new (Z) LoadLocalNode(TokenPosition::kNoSource, controller),
+      Symbols::AddError(), args));
+  ReturnNode* return_node = new (Z) ReturnNode(TokenPosition::kNoSource);
   AddNodeForFinallyInlining(return_node);
   current_block_->statements->Add(return_node);
   AstNode* catch_block = CloseBlock();
@@ -6647,20 +6444,17 @@
   do {
     OpenBlock();
     ArgumentListNode* no_args =
-        new(Z) ArgumentListNode(TokenPosition::kNoSource);
-    current_block_->statements->Add(
-        new(Z) InstanceCallNode(try_end_pos,
-            new(Z) LoadLocalNode(TokenPosition::kNoSource, controller),
-            Symbols::Close(),
-            no_args));
+        new (Z) ArgumentListNode(TokenPosition::kNoSource);
+    current_block_->statements->Add(new (Z) InstanceCallNode(
+        try_end_pos,
+        new (Z) LoadLocalNode(TokenPosition::kNoSource, controller),
+        Symbols::Close(), no_args));
 
     // Suspend after the close.
-    AwaitMarkerNode* await_marker =
-        new(Z) AwaitMarkerNode(async_temp_scope_,
-                               current_block_->scope,
-                               TokenPosition::kNoSource);
+    AwaitMarkerNode* await_marker = new (Z) AwaitMarkerNode(
+        async_temp_scope_, current_block_->scope, TokenPosition::kNoSource);
     current_block_->statements->Add(await_marker);
-    ReturnNode* continuation_ret = new(Z) ReturnNode(try_end_pos);
+    ReturnNode* continuation_ret = new (Z) ReturnNode(try_end_pos);
     continuation_ret->set_return_type(ReturnNode::kContinuationTarget);
     current_block_->statements->Add(continuation_ret);
 
@@ -6668,11 +6462,9 @@
     AstNode* node_to_inline = try_statement->GetNodeToInlineFinally(node_index);
     if (node_to_inline != NULL) {
       InlinedFinallyNode* node =
-          new(Z) InlinedFinallyNode(try_end_pos,
-                                    finally_clause,
-                                    context_var,
-                                    // No outer try statement
-                                    CatchClauseNode::kInvalidTryIndex);
+          new (Z) InlinedFinallyNode(try_end_pos, finally_clause, context_var,
+                                     // No outer try statement
+                                     CatchClauseNode::kInvalidTryIndex);
       finally_clause = NULL;
       AddFinallyClauseToNode(true, node_to_inline, node);
       node_index++;
@@ -6688,28 +6480,17 @@
   // Catch block handles all exceptions.
   handler_types.Add(Object::dynamic_type());
 
-  CatchClauseNode* catch_clause = new(Z) CatchClauseNode(
-      TokenPosition::kNoSource,
-      catch_handler_list,
-      Array::ZoneHandle(Z, Array::MakeArray(handler_types)),
-      context_var,
-      exception_var,
-      stack_trace_var,
-      saved_exception_var,
-      saved_stack_trace_var,
-      AllocateTryIndex(),
-      true);
+  CatchClauseNode* catch_clause = new (Z) CatchClauseNode(
+      TokenPosition::kNoSource, catch_handler_list,
+      Array::ZoneHandle(Z, Array::MakeArray(handler_types)), context_var,
+      exception_var, stack_trace_var, saved_exception_var,
+      saved_stack_trace_var, AllocateTryIndex(), true);
 
   const intptr_t try_index = try_statement->try_index();
 
-  AstNode* try_catch_node =
-      new(Z) TryCatchNode(TokenPosition::kNoSource,
-                          body,
-                          context_var,
-                          catch_clause,
-                          finally_clause,
-                          try_index,
-                          finally_clause);
+  AstNode* try_catch_node = new (Z)
+      TryCatchNode(TokenPosition::kNoSource, body, context_var, catch_clause,
+                   finally_clause, try_index, finally_clause);
   current_block_->statements->Add(try_catch_node);
   return CloseBlock();
 }
@@ -6735,23 +6516,22 @@
   stack_trace_param.type = &Object::dynamic_type();
   stack_trace_param.name = &Symbols::StackTraceParameter();
 
-  AddCatchParamsToScope(
-      &exception_param, &stack_trace_param, current_block_->scope);
+  AddCatchParamsToScope(&exception_param, &stack_trace_param,
+                        current_block_->scope);
 
-  LocalVariable* context_var = try_scope->LocalLookupVariable(
-      Symbols::SavedTryContextVar());
+  LocalVariable* context_var =
+      try_scope->LocalLookupVariable(Symbols::SavedTryContextVar());
   ASSERT(context_var != NULL);
 
-  LocalVariable* exception_var = try_scope->LocalLookupVariable(
-      Symbols::ExceptionVar());
+  LocalVariable* exception_var =
+      try_scope->LocalLookupVariable(Symbols::ExceptionVar());
   if (exception_param.var != NULL) {
     // Generate code to load the exception object (:exception_var) into
     // the exception variable specified in this block.
     ASSERT(exception_var != NULL);
-    current_block_->statements->Add(new(Z) StoreLocalNode(
-        TokenPosition::kNoSource,
-        exception_param.var,
-        new(Z) LoadLocalNode(TokenPosition::kNoSource, exception_var)));
+    current_block_->statements->Add(new (Z) StoreLocalNode(
+        TokenPosition::kNoSource, exception_param.var,
+        new (Z) LoadLocalNode(TokenPosition::kNoSource, exception_var)));
   }
 
   LocalVariable* stack_trace_var =
@@ -6761,38 +6541,33 @@
     // to load the stack trace object (:stack_trace_var) into the stack
     // trace variable specified in this block.
     ASSERT(stack_trace_var != NULL);
-    current_block_->statements->Add(new(Z) StoreLocalNode(
-        TokenPosition::kNoSource,
-        stack_trace_param.var,
-        new(Z) LoadLocalNode(TokenPosition::kNoSource, stack_trace_var)));
+    current_block_->statements->Add(new (Z) StoreLocalNode(
+        TokenPosition::kNoSource, stack_trace_param.var,
+        new (Z) LoadLocalNode(TokenPosition::kNoSource, stack_trace_var)));
   }
-  LocalVariable* saved_exception_var = try_scope->LocalLookupVariable(
-      Symbols::SavedExceptionVar());
-  LocalVariable* saved_stack_trace_var = try_scope->LocalLookupVariable(
-      Symbols::SavedStackTraceVar());
-  SaveExceptionAndStacktrace(current_block_->statements,
-                             exception_var,
-                             stack_trace_var,
-                             saved_exception_var,
+  LocalVariable* saved_exception_var =
+      try_scope->LocalLookupVariable(Symbols::SavedExceptionVar());
+  LocalVariable* saved_stack_trace_var =
+      try_scope->LocalLookupVariable(Symbols::SavedStackTraceVar());
+  SaveExceptionAndStacktrace(current_block_->statements, exception_var,
+                             stack_trace_var, saved_exception_var,
                              saved_stack_trace_var);
 
   // Complete the async future with an error. This catch block executes
   // unconditionally, there is no need to generate a type check for.
-  LocalVariable* async_completer = current_block_->scope->LookupVariable(
-      Symbols::AsyncCompleter(), false);
+  LocalVariable* async_completer =
+      current_block_->scope->LookupVariable(Symbols::AsyncCompleter(), false);
   ASSERT(async_completer != NULL);
   ArgumentListNode* completer_args =
       new (Z) ArgumentListNode(TokenPosition::kNoSource);
   completer_args->Add(
       new (Z) LoadLocalNode(TokenPosition::kNoSource, exception_param.var));
   completer_args->Add(
-      new (Z) LoadLocalNode(TokenPosition::kNoSource,
-                            stack_trace_param.var));
+      new (Z) LoadLocalNode(TokenPosition::kNoSource, stack_trace_param.var));
   current_block_->statements->Add(new (Z) InstanceCallNode(
       TokenPos(),
       new (Z) LoadLocalNode(TokenPosition::kNoSource, async_completer),
-      Symbols::CompleterCompleteError(),
-      completer_args));
+      Symbols::CompleterCompleteError(), completer_args));
   ReturnNode* return_node = new (Z) ReturnNode(TokenPosition::kNoSource);
   // Behavior like a continuation return, i.e,. don't call a completer.
   return_node->set_return_type(ReturnNode::kContinuation);
@@ -6810,21 +6585,12 @@
   const intptr_t try_index = try_statement->try_index();
 
   CatchClauseNode* catch_clause = new (Z) CatchClauseNode(
-      TokenPosition::kNoSource,
-      catch_handler_list,
-      Array::ZoneHandle(Z, Array::MakeArray(handler_types)),
-      context_var,
-      exception_var,
-      stack_trace_var,
-      saved_exception_var,
-      saved_stack_trace_var,
-      CatchClauseNode::kInvalidTryIndex,
-      true);
+      TokenPosition::kNoSource, catch_handler_list,
+      Array::ZoneHandle(Z, Array::MakeArray(handler_types)), context_var,
+      exception_var, stack_trace_var, saved_exception_var,
+      saved_stack_trace_var, CatchClauseNode::kInvalidTryIndex, true);
   AstNode* try_catch_node = new (Z) TryCatchNode(
-      TokenPosition::kNoSource,
-      try_block,
-      context_var,
-      catch_clause,
+      TokenPosition::kNoSource, try_block, context_var, catch_clause,
       NULL,  // No finally clause.
       try_index,
       NULL);  // No rethrow-finally clause.
@@ -6842,13 +6608,9 @@
   LocalVariable* stack_trace_var = NULL;
   LocalVariable* saved_exception_var = NULL;
   LocalVariable* saved_stack_trace_var = NULL;
-  SetupExceptionVariables(current_block_->scope,
-                          true,
-                          &context_var,
-                          &exception_var,
-                          &stack_trace_var,
-                          &saved_exception_var,
-                          &saved_stack_trace_var);
+  SetupExceptionVariables(current_block_->scope, true, &context_var,
+                          &exception_var, &stack_trace_var,
+                          &saved_exception_var, &saved_stack_trace_var);
 
   // Open the try block.
   OpenBlock();
@@ -6866,10 +6628,9 @@
   // 2) Iterator
   // Add implicit closure parameter if not already present.
   if (params->parameters->length() == 0) {
-    params->AddFinalParameter(
-        TokenPosition::kMinSource,
-        &Symbols::ClosureParameter(),
-        &Object::dynamic_type());
+    params->AddFinalParameter(TokenPosition::kMinSource,
+                              &Symbols::ClosureParameter(),
+                              &Object::dynamic_type());
   }
   ParamDesc iterator_param;
   iterator_param.name = &Symbols::IteratorParameter();
@@ -6907,8 +6668,7 @@
     String& generator_name = String::Handle(Z, innermost_function().name());
     body_closure_name =
         Symbols::NewFormatted(T, "<%s_sync_body>", generator_name.ToCString());
-    body = Function::NewClosureFunction(body_closure_name,
-                                        innermost_function(),
+    body = Function::NewClosureFunction(body_closure_name, innermost_function(),
                                         func_pos);
     body.set_is_generated_body(true);
     body.set_result_type(Object::dynamic_type());
@@ -6951,33 +6711,31 @@
   // :await_jump_var = -1;
   LocalVariable* jump_var =
       current_block_->scope->LookupVariable(Symbols::AwaitJumpVar(), false);
-  LiteralNode* init_value = new(Z) LiteralNode(TokenPosition::kNoSource,
-                                               Smi::ZoneHandle(Smi::New(-1)));
+  LiteralNode* init_value = new (Z)
+      LiteralNode(TokenPosition::kNoSource, Smi::ZoneHandle(Smi::New(-1)));
   current_block_->statements->Add(
-      new(Z) StoreLocalNode(TokenPosition::kNoSource, jump_var, init_value));
+      new (Z) StoreLocalNode(TokenPosition::kNoSource, jump_var, init_value));
 
   // return new SyncIterable(body_closure);
   const Class& iterable_class =
       Class::Handle(Z, Library::LookupCoreClass(Symbols::_SyncIterable()));
   ASSERT(!iterable_class.IsNull());
-  const Function& iterable_constructor = Function::ZoneHandle(Z,
-      iterable_class.LookupConstructorAllowPrivate(
-          Symbols::_SyncIterableConstructor()));
+  const Function& iterable_constructor =
+      Function::ZoneHandle(Z, iterable_class.LookupConstructorAllowPrivate(
+                                  Symbols::_SyncIterableConstructor()));
   ASSERT(!iterable_constructor.IsNull());
 
   const String& closure_name = String::Handle(Z, closure.name());
   ASSERT(closure_name.IsSymbol());
 
   ArgumentListNode* arguments =
-      new(Z) ArgumentListNode(TokenPosition::kNoSource);
-  ClosureNode* closure_obj = new(Z) ClosureNode(
+      new (Z) ArgumentListNode(TokenPosition::kNoSource);
+  ClosureNode* closure_obj = new (Z) ClosureNode(
       TokenPosition::kNoSource, closure, NULL, closure_body->scope());
   arguments->Add(closure_obj);
-  ConstructorCallNode* new_iterable =
-      new(Z) ConstructorCallNode(TokenPosition::kNoSource,
-          TypeArguments::ZoneHandle(Z),
-          iterable_constructor,
-          arguments);
+  ConstructorCallNode* new_iterable = new (Z) ConstructorCallNode(
+      TokenPosition::kNoSource, TypeArguments::ZoneHandle(Z),
+      iterable_constructor, arguments);
   ReturnNode* return_node =
       new (Z) ReturnNode(TokenPosition::kNoSource, new_iterable);
   current_block_->statements->Add(return_node);
@@ -6993,10 +6751,9 @@
   ASSERT(params->parameters->length() <= 1);
   // Add implicit closure parameter if not yet present.
   if (params->parameters->length() == 0) {
-    params->AddFinalParameter(
-        TokenPosition::kMinSource,
-        &Symbols::ClosureParameter(),
-        &Object::dynamic_type());
+    params->AddFinalParameter(TokenPosition::kMinSource,
+                              &Symbols::ClosureParameter(),
+                              &Object::dynamic_type());
   }
   ParamDesc result_param;
   result_param.name = &Symbols::AsyncOperationParam();
@@ -7037,12 +6794,11 @@
     // Create the closure containing the body of this async function.
     const String& async_func_name =
         String::Handle(Z, innermost_function().name());
-    String& closure_name = String::Handle(Z, Symbols::NewFormatted(T,
-        "<%s_async_body>", async_func_name.ToCString()));
-    closure = Function::NewClosureFunction(
-        closure_name,
-        innermost_function(),
-        async_func_pos);
+    String& closure_name =
+        String::Handle(Z, Symbols::NewFormatted(T, "<%s_async_body>",
+                                                async_func_name.ToCString()));
+    closure = Function::NewClosureFunction(closure_name, innermost_function(),
+                                           async_func_pos);
     closure.set_is_generated_body(true);
     closure.set_result_type(Object::dynamic_type());
     is_new_closure = true;
@@ -7080,15 +6836,13 @@
   // Add to current block's scope:
   //   var :await_jump_var;
   //   var :await_ctx_var;
-  LocalVariable* await_jump_var = new (Z) LocalVariable(
-      TokenPosition::kNoSource,
-      Symbols::AwaitJumpVar(),
-      Object::dynamic_type());
+  LocalVariable* await_jump_var =
+      new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource,
+                            Symbols::AwaitJumpVar(), Object::dynamic_type());
   current_block_->scope->AddVariable(await_jump_var);
-  LocalVariable* await_ctx_var = new (Z) LocalVariable(
-      TokenPosition::kNoSource,
-      Symbols::AwaitContextVar(),
-      Object::dynamic_type());
+  LocalVariable* await_ctx_var =
+      new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource,
+                            Symbols::AwaitContextVar(), Object::dynamic_type());
   current_block_->scope->AddVariable(await_ctx_var);
 }
 
@@ -7099,25 +6853,21 @@
   //   var :async_then_callback;
   //   var :async_catch_error_callback;
   //   var :async_completer;
-  LocalVariable* async_op_var = new(Z) LocalVariable(
-      TokenPosition::kNoSource,
-      Symbols::AsyncOperation(),
-      Object::dynamic_type());
+  LocalVariable* async_op_var =
+      new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource,
+                            Symbols::AsyncOperation(), Object::dynamic_type());
   current_block_->scope->AddVariable(async_op_var);
-  LocalVariable* async_then_callback_var = new(Z) LocalVariable(
-      TokenPosition::kNoSource,
-      Symbols::AsyncThenCallback(),
-      Object::dynamic_type());
+  LocalVariable* async_then_callback_var = new (Z)
+      LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource,
+                    Symbols::AsyncThenCallback(), Object::dynamic_type());
   current_block_->scope->AddVariable(async_then_callback_var);
-  LocalVariable* async_catch_error_callback_var = new(Z) LocalVariable(
-      TokenPosition::kNoSource,
-      Symbols::AsyncCatchErrorCallback(),
-      Object::dynamic_type());
+  LocalVariable* async_catch_error_callback_var = new (Z)
+      LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource,
+                    Symbols::AsyncCatchErrorCallback(), Object::dynamic_type());
   current_block_->scope->AddVariable(async_catch_error_callback_var);
-  LocalVariable* async_completer = new(Z) LocalVariable(
-      TokenPosition::kNoSource,
-      Symbols::AsyncCompleter(),
-      Object::dynamic_type());
+  LocalVariable* async_completer =
+      new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource,
+                            Symbols::AsyncCompleter(), Object::dynamic_type());
   current_block_->scope->AddVariable(async_completer);
 }
 
@@ -7133,31 +6883,26 @@
   //   var :async_catch_error_callback;
   // These variables are used to store the async generator closure containing
   // the body of the async* function. They are used by the await operator.
-  LocalVariable* controller_var = new(Z) LocalVariable(
-      TokenPosition::kNoSource,
-      Symbols::Controller(),
-      Object::dynamic_type());
+  LocalVariable* controller_var =
+      new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource,
+                            Symbols::Controller(), Object::dynamic_type());
   current_block_->scope->AddVariable(controller_var);
-  LocalVariable* async_op_var = new(Z) LocalVariable(
-      TokenPosition::kNoSource,
-      Symbols::AsyncOperation(),
-      Object::dynamic_type());
+  LocalVariable* async_op_var =
+      new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource,
+                            Symbols::AsyncOperation(), Object::dynamic_type());
   current_block_->scope->AddVariable(async_op_var);
-  LocalVariable* async_then_callback_var = new(Z) LocalVariable(
-      TokenPosition::kNoSource,
-      Symbols::AsyncThenCallback(),
-      Object::dynamic_type());
+  LocalVariable* async_then_callback_var = new (Z)
+      LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource,
+                    Symbols::AsyncThenCallback(), Object::dynamic_type());
   current_block_->scope->AddVariable(async_then_callback_var);
-  LocalVariable* async_catch_error_callback_var = new(Z) LocalVariable(
-      TokenPosition::kNoSource,
-      Symbols::AsyncCatchErrorCallback(),
-      Object::dynamic_type());
+  LocalVariable* async_catch_error_callback_var = new (Z)
+      LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource,
+                    Symbols::AsyncCatchErrorCallback(), Object::dynamic_type());
   current_block_->scope->AddVariable(async_catch_error_callback_var);
 }
 
 
-RawFunction* Parser::OpenAsyncGeneratorFunction(
-    TokenPosition async_func_pos) {
+RawFunction* Parser::OpenAsyncGeneratorFunction(TokenPosition async_func_pos) {
   TRACE_PARSER("OpenAsyncGeneratorFunction");
   AddContinuationVariables();
   AddAsyncGeneratorVariables();
@@ -7177,10 +6922,10 @@
     // Create the closure containing the body of this async generator function.
     const String& async_generator_name =
         String::Handle(Z, innermost_function().name());
-    const String& closure_name = String::Handle(Z, Symbols::NewFormatted(T,
-          "<%s_async_gen_body>", async_generator_name.ToCString()));
-    closure = Function::NewClosureFunction(closure_name,
-                                           innermost_function(),
+    const String& closure_name = String::Handle(
+        Z, Symbols::NewFormatted(T, "<%s_async_gen_body>",
+                                 async_generator_name.ToCString()));
+    closure = Function::NewClosureFunction(closure_name, innermost_function(),
                                            async_func_pos);
     closure.set_is_generated_body(true);
     closure.set_result_type(Object::dynamic_type());
@@ -7233,17 +6978,17 @@
 
   // Explicitly reference variables of the async genenerator function from the
   // closure body in order to mark them as captured.
-  LocalVariable* existing_var = closure_body->scope()->LookupVariable(
-      Symbols::AwaitJumpVar(), false);
+  LocalVariable* existing_var =
+      closure_body->scope()->LookupVariable(Symbols::AwaitJumpVar(), false);
   ASSERT((existing_var != NULL) && existing_var->is_captured());
-  existing_var = closure_body->scope()->LookupVariable(
-      Symbols::AwaitContextVar(), false);
+  existing_var =
+      closure_body->scope()->LookupVariable(Symbols::AwaitContextVar(), false);
   ASSERT((existing_var != NULL) && existing_var->is_captured());
-  existing_var = closure_body->scope()->LookupVariable(
-      Symbols::Controller(), false);
+  existing_var =
+      closure_body->scope()->LookupVariable(Symbols::Controller(), false);
   ASSERT((existing_var != NULL) && existing_var->is_captured());
-  existing_var = closure_body->scope()->LookupVariable(
-      Symbols::AsyncOperation(), false);
+  existing_var =
+      closure_body->scope()->LookupVariable(Symbols::AsyncOperation(), false);
   ASSERT((existing_var != NULL) && existing_var->is_captured());
   existing_var = closure_body->scope()->LookupVariable(
       Symbols::AsyncThenCallback(), false);
@@ -7254,106 +6999,96 @@
 
   const Library& async_lib = Library::Handle(Library::AsyncLibrary());
 
-  const Class& controller_class = Class::Handle(Z,
-      async_lib.LookupClassAllowPrivate(
-          Symbols::_AsyncStarStreamController()));
+  const Class& controller_class = Class::Handle(
+      Z,
+      async_lib.LookupClassAllowPrivate(Symbols::_AsyncStarStreamController()));
   ASSERT(!controller_class.IsNull());
-  const Function& controller_constructor = Function::ZoneHandle(Z,
-      controller_class.LookupConstructorAllowPrivate(
-          Symbols::_AsyncStarStreamControllerConstructor()));
+  const Function& controller_constructor = Function::ZoneHandle(
+      Z, controller_class.LookupConstructorAllowPrivate(
+             Symbols::_AsyncStarStreamControllerConstructor()));
 
   // :await_jump_var = -1;
   LocalVariable* jump_var =
       current_block_->scope->LookupVariable(Symbols::AwaitJumpVar(), false);
-  LiteralNode* init_value = new(Z) LiteralNode(TokenPosition::kNoSource,
-                                               Smi::ZoneHandle(Smi::New(-1)));
+  LiteralNode* init_value = new (Z)
+      LiteralNode(TokenPosition::kNoSource, Smi::ZoneHandle(Smi::New(-1)));
   current_block_->statements->Add(
-      new(Z) StoreLocalNode(TokenPosition::kNoSource, jump_var, init_value));
+      new (Z) StoreLocalNode(TokenPosition::kNoSource, jump_var, init_value));
 
   // Add to AST:
   //   :async_op = <closure>;  (containing the original body)
   LocalVariable* async_op_var =
       current_block_->scope->LookupVariable(Symbols::AsyncOperation(), false);
-  ClosureNode* closure_obj = new(Z) ClosureNode(
+  ClosureNode* closure_obj = new (Z) ClosureNode(
       TokenPosition::kNoSource, closure_func, NULL, closure_body->scope());
-  StoreLocalNode* store_async_op = new (Z) StoreLocalNode(
-      TokenPosition::kNoSource,
-      async_op_var,
-      closure_obj);
+  StoreLocalNode* store_async_op = new (Z)
+      StoreLocalNode(TokenPosition::kNoSource, async_op_var, closure_obj);
 
   current_block_->statements->Add(store_async_op);
 
   // :async_then_callback = _asyncThenWrapperHelper(:async_op)
   const Function& async_then_wrapper_helper = Function::ZoneHandle(
-      Z, async_lib.LookupFunctionAllowPrivate(
-          Symbols::AsyncThenWrapperHelper()));
+      Z,
+      async_lib.LookupFunctionAllowPrivate(Symbols::AsyncThenWrapperHelper()));
   ASSERT(!async_then_wrapper_helper.IsNull());
-  ArgumentListNode* async_then_wrapper_helper_args = new (Z) ArgumentListNode(
-      TokenPosition::kNoSource);
+  ArgumentListNode* async_then_wrapper_helper_args =
+      new (Z) ArgumentListNode(TokenPosition::kNoSource);
   async_then_wrapper_helper_args->Add(
       new (Z) LoadLocalNode(TokenPosition::kNoSource, async_op_var));
-  StaticCallNode* then_wrapper_call = new (Z) StaticCallNode(
-      TokenPosition::kNoSource,
-      async_then_wrapper_helper,
-      async_then_wrapper_helper_args);
+  StaticCallNode* then_wrapper_call = new (Z)
+      StaticCallNode(TokenPosition::kNoSource, async_then_wrapper_helper,
+                     async_then_wrapper_helper_args);
   LocalVariable* async_then_callback_var =
-      current_block_->scope->LookupVariable(
-          Symbols::AsyncThenCallback(), false);
+      current_block_->scope->LookupVariable(Symbols::AsyncThenCallback(),
+                                            false);
   StoreLocalNode* store_async_then_callback = new (Z) StoreLocalNode(
-      TokenPosition::kNoSource,
-      async_then_callback_var,
-      then_wrapper_call);
+      TokenPosition::kNoSource, async_then_callback_var, then_wrapper_call);
 
   current_block_->statements->Add(store_async_then_callback);
 
   // :async_catch_error_callback = _asyncErrorWrapperHelper(:async_op)
 
   const Function& async_error_wrapper_helper = Function::ZoneHandle(
-      Z, async_lib.LookupFunctionAllowPrivate(
-          Symbols::AsyncErrorWrapperHelper()));
+      Z,
+      async_lib.LookupFunctionAllowPrivate(Symbols::AsyncErrorWrapperHelper()));
   ASSERT(!async_error_wrapper_helper.IsNull());
-  ArgumentListNode* async_error_wrapper_helper_args = new (Z) ArgumentListNode(
-      TokenPosition::kNoSource);
+  ArgumentListNode* async_error_wrapper_helper_args =
+      new (Z) ArgumentListNode(TokenPosition::kNoSource);
   async_error_wrapper_helper_args->Add(
       new (Z) LoadLocalNode(TokenPosition::kNoSource, async_op_var));
-  StaticCallNode* error_wrapper_call = new (Z) StaticCallNode(
-      TokenPosition::kNoSource,
-      async_error_wrapper_helper,
-      async_error_wrapper_helper_args);
+  StaticCallNode* error_wrapper_call = new (Z)
+      StaticCallNode(TokenPosition::kNoSource, async_error_wrapper_helper,
+                     async_error_wrapper_helper_args);
   LocalVariable* async_catch_error_callback_var =
-      current_block_->scope->LookupVariable(
-          Symbols::AsyncCatchErrorCallback(), false);
-  StoreLocalNode* store_async_catch_error_callback = new (Z) StoreLocalNode(
-      TokenPosition::kNoSource,
-      async_catch_error_callback_var,
-      error_wrapper_call);
+      current_block_->scope->LookupVariable(Symbols::AsyncCatchErrorCallback(),
+                                            false);
+  StoreLocalNode* store_async_catch_error_callback = new (Z)
+      StoreLocalNode(TokenPosition::kNoSource, async_catch_error_callback_var,
+                     error_wrapper_call);
 
   current_block_->statements->Add(store_async_catch_error_callback);
 
   // :controller = new _AsyncStarStreamController(body_closure);
   ArgumentListNode* arguments =
-      new(Z) ArgumentListNode(TokenPosition::kNoSource);
-  arguments->Add(
-      new (Z) LoadLocalNode(TokenPosition::kNoSource, async_op_var));
+      new (Z) ArgumentListNode(TokenPosition::kNoSource);
+  arguments->Add(new (Z) LoadLocalNode(TokenPosition::kNoSource, async_op_var));
   ConstructorCallNode* controller_constructor_call =
-      new(Z) ConstructorCallNode(TokenPosition::kNoSource,
-                                 TypeArguments::ZoneHandle(Z),
-                                 controller_constructor,
-                                 arguments);
+      new (Z) ConstructorCallNode(TokenPosition::kNoSource,
+                                  TypeArguments::ZoneHandle(Z),
+                                  controller_constructor, arguments);
   LocalVariable* controller_var =
-     current_block_->scope->LookupVariable(Symbols::Controller(), false);
-  StoreLocalNode* store_controller =
-      new(Z) StoreLocalNode(TokenPosition::kNoSource,
-                            controller_var,
-                            controller_constructor_call);
+      current_block_->scope->LookupVariable(Symbols::Controller(), false);
+  StoreLocalNode* store_controller = new (Z) StoreLocalNode(
+      TokenPosition::kNoSource, controller_var, controller_constructor_call);
   current_block_->statements->Add(store_controller);
 
   // return :controller.stream;
-  ReturnNode* return_node = new(Z) ReturnNode(TokenPosition::kNoSource,
-      new(Z) InstanceGetterNode(TokenPosition::kNoSource,
-          new(Z) LoadLocalNode(TokenPosition::kNoSource,
-              controller_var),
-              Symbols::Stream()));
+  ReturnNode* return_node = new (Z) ReturnNode(
+      TokenPosition::kNoSource,
+      new (Z) InstanceGetterNode(
+          TokenPosition::kNoSource,
+          new (Z) LoadLocalNode(TokenPosition::kNoSource, controller_var),
+          Symbols::Stream()));
   current_block_->statements->Add(return_node);
   return CloseBlock();
 }
@@ -7379,15 +7114,15 @@
 // Add a return node to the sequence if necessary.
 void Parser::EnsureHasReturnStatement(SequenceNode* seq,
                                       TokenPosition return_pos) {
-  if ((seq->length() == 0) ||
-      !seq->NodeAt(seq->length() - 1)->IsReturnNode()) {
+  if ((seq->length() == 0) || !seq->NodeAt(seq->length() - 1)->IsReturnNode()) {
     const Function& func = innermost_function();
     // The implicit return value of synchronous generator closures is false,
     // to indicate that there are no more elements in the iterable.
     // In other cases the implicit return value is null.
-    AstNode* return_value = func.IsSyncGenClosure()
-        ? new LiteralNode(return_pos, Bool::False())
-        : new LiteralNode(return_pos, Instance::ZoneHandle());
+    AstNode* return_value =
+        func.IsSyncGenClosure()
+            ? new LiteralNode(return_pos, Bool::False())
+            : new LiteralNode(return_pos, Instance::ZoneHandle());
     seq->Add(new ReturnNode(return_pos, return_value));
   }
 }
@@ -7430,115 +7165,96 @@
   // No need to capture parameters or other variables, since they have already
   // been captured in the corresponding scope as the body has been parsed within
   // a nested block (contained in the async function's block).
-  const Class& future =
-      Class::ZoneHandle(Z, I->object_store()->future_class());
+  const Class& future = Class::ZoneHandle(Z, I->object_store()->future_class());
   ASSERT(!future.IsNull());
-  const Function& constructor = Function::ZoneHandle(Z,
-      future.LookupFunction(Symbols::FutureMicrotask()));
+  const Function& constructor = Function::ZoneHandle(
+      Z, future.LookupFunction(Symbols::FutureMicrotask()));
   ASSERT(!constructor.IsNull());
   const Class& completer =
       Class::ZoneHandle(Z, I->object_store()->completer_class());
   ASSERT(!completer.IsNull());
-  const Function& completer_constructor = Function::ZoneHandle(Z,
-      completer.LookupFunction(Symbols::CompleterSyncConstructor()));
+  const Function& completer_constructor = Function::ZoneHandle(
+      Z, completer.LookupFunction(Symbols::CompleterSyncConstructor()));
   ASSERT(!completer_constructor.IsNull());
 
-  LocalVariable* async_completer = current_block_->scope->LookupVariable(
-      Symbols::AsyncCompleter(), false);
+  LocalVariable* async_completer =
+      current_block_->scope->LookupVariable(Symbols::AsyncCompleter(), false);
 
   const TokenPosition token_pos = ST(closure_body->token_pos());
   // Add to AST:
   //   :async_completer = new Completer.sync();
-  ArgumentListNode* empty_args =
-      new (Z) ArgumentListNode(token_pos);
-  ConstructorCallNode* completer_constructor_node = new (Z) ConstructorCallNode(
-      token_pos,
-      TypeArguments::ZoneHandle(Z),
-      completer_constructor,
-      empty_args);
-  StoreLocalNode* store_completer = new (Z) StoreLocalNode(
-      token_pos,
-      async_completer,
-      completer_constructor_node);
+  ArgumentListNode* empty_args = new (Z) ArgumentListNode(token_pos);
+  ConstructorCallNode* completer_constructor_node =
+      new (Z) ConstructorCallNode(token_pos, TypeArguments::ZoneHandle(Z),
+                                  completer_constructor, empty_args);
+  StoreLocalNode* store_completer = new (Z)
+      StoreLocalNode(token_pos, async_completer, completer_constructor_node);
   current_block_->statements->Add(store_completer);
 
   // :await_jump_var = -1;
   LocalVariable* jump_var =
       current_block_->scope->LookupVariable(Symbols::AwaitJumpVar(), false);
   LiteralNode* init_value =
-      new(Z) LiteralNode(token_pos,
-                         Smi::ZoneHandle(Smi::New(-1)));
+      new (Z) LiteralNode(token_pos, Smi::ZoneHandle(Smi::New(-1)));
   current_block_->statements->Add(
-      new(Z) StoreLocalNode(token_pos, jump_var, init_value));
+      new (Z) StoreLocalNode(token_pos, jump_var, init_value));
 
   // Add to AST:
   //   :async_op = <closure>;  (containing the original body)
-  LocalVariable* async_op_var = current_block_->scope->LookupVariable(
-      Symbols::AsyncOperation(), false);
-  ClosureNode* cn = new(Z) ClosureNode(
-      token_pos, closure, NULL, closure_body->scope());
-  StoreLocalNode* store_async_op = new (Z) StoreLocalNode(
-      token_pos,
-      async_op_var,
-      cn);
+  LocalVariable* async_op_var =
+      current_block_->scope->LookupVariable(Symbols::AsyncOperation(), false);
+  ClosureNode* cn =
+      new (Z) ClosureNode(token_pos, closure, NULL, closure_body->scope());
+  StoreLocalNode* store_async_op =
+      new (Z) StoreLocalNode(token_pos, async_op_var, cn);
   current_block_->statements->Add(store_async_op);
 
   const Library& async_lib = Library::Handle(Library::AsyncLibrary());
   // :async_then_callback = _asyncThenWrapperHelper(:async_op)
   const Function& async_then_wrapper_helper = Function::ZoneHandle(
-      Z, async_lib.LookupFunctionAllowPrivate(
-          Symbols::AsyncThenWrapperHelper()));
+      Z,
+      async_lib.LookupFunctionAllowPrivate(Symbols::AsyncThenWrapperHelper()));
   ASSERT(!async_then_wrapper_helper.IsNull());
-  ArgumentListNode* async_then_wrapper_helper_args = new (Z) ArgumentListNode(
-      token_pos);
+  ArgumentListNode* async_then_wrapper_helper_args =
+      new (Z) ArgumentListNode(token_pos);
   async_then_wrapper_helper_args->Add(
       new (Z) LoadLocalNode(token_pos, async_op_var));
   StaticCallNode* then_wrapper_call = new (Z) StaticCallNode(
-      token_pos,
-      async_then_wrapper_helper,
-      async_then_wrapper_helper_args);
+      token_pos, async_then_wrapper_helper, async_then_wrapper_helper_args);
   LocalVariable* async_then_callback_var =
-      current_block_->scope->LookupVariable(
-          Symbols::AsyncThenCallback(), false);
-  StoreLocalNode* store_async_then_callback = new (Z) StoreLocalNode(
-      token_pos,
-      async_then_callback_var,
-      then_wrapper_call);
+      current_block_->scope->LookupVariable(Symbols::AsyncThenCallback(),
+                                            false);
+  StoreLocalNode* store_async_then_callback = new (Z)
+      StoreLocalNode(token_pos, async_then_callback_var, then_wrapper_call);
 
   current_block_->statements->Add(store_async_then_callback);
 
   // :async_catch_error_callback = _asyncErrorWrapperHelper(:async_op)
 
   const Function& async_error_wrapper_helper = Function::ZoneHandle(
-      Z, async_lib.LookupFunctionAllowPrivate(
-          Symbols::AsyncErrorWrapperHelper()));
+      Z,
+      async_lib.LookupFunctionAllowPrivate(Symbols::AsyncErrorWrapperHelper()));
   ASSERT(!async_error_wrapper_helper.IsNull());
-  ArgumentListNode* async_error_wrapper_helper_args = new (Z) ArgumentListNode(
-      token_pos);
+  ArgumentListNode* async_error_wrapper_helper_args =
+      new (Z) ArgumentListNode(token_pos);
   async_error_wrapper_helper_args->Add(
       new (Z) LoadLocalNode(token_pos, async_op_var));
   StaticCallNode* error_wrapper_call = new (Z) StaticCallNode(
-      token_pos,
-      async_error_wrapper_helper,
-      async_error_wrapper_helper_args);
+      token_pos, async_error_wrapper_helper, async_error_wrapper_helper_args);
   LocalVariable* async_catch_error_callback_var =
-      current_block_->scope->LookupVariable(
-          Symbols::AsyncCatchErrorCallback(), false);
+      current_block_->scope->LookupVariable(Symbols::AsyncCatchErrorCallback(),
+                                            false);
   StoreLocalNode* store_async_catch_error_callback = new (Z) StoreLocalNode(
-      token_pos,
-      async_catch_error_callback_var,
-      error_wrapper_call);
+      token_pos, async_catch_error_callback_var, error_wrapper_call);
 
   current_block_->statements->Add(store_async_catch_error_callback);
 
   // Add to AST:
   //   new Future.microtask(:async_op);
   ArgumentListNode* arguments = new (Z) ArgumentListNode(token_pos);
-  arguments->Add(new (Z) LoadLocalNode(
-      token_pos, async_op_var));
+  arguments->Add(new (Z) LoadLocalNode(token_pos, async_op_var));
   ConstructorCallNode* future_node = new (Z) ConstructorCallNode(
-      token_pos, TypeArguments::ZoneHandle(Z), constructor,
-      arguments);
+      token_pos, TypeArguments::ZoneHandle(Z), constructor, arguments);
   current_block_->statements->Add(future_node);
 
   // Add to AST:
@@ -7546,10 +7262,7 @@
   ReturnNode* return_node = new (Z) ReturnNode(
       token_pos,
       new (Z) InstanceGetterNode(
-          token_pos,
-          new (Z) LoadLocalNode(
-              token_pos,
-              async_completer),
+          token_pos, new (Z) LoadLocalNode(token_pos, async_completer),
           Symbols::CompleterFuture()));
   current_block_->statements->Add(return_node);
   return CloseBlock();
@@ -7598,9 +7311,8 @@
   if (!Utils::IsInt(16, params->num_fixed_parameters) ||
       !Utils::IsInt(16, params->num_optional_parameters)) {
     const Script& script = Script::Handle(Class::Handle(func.Owner()).script());
-    Report::MessageF(Report::kError,
-                     script, func.token_pos(), Report::AtLocation,
-                     "too many formal parameters");
+    Report::MessageF(Report::kError, script, func.token_pos(),
+                     Report::AtLocation, "too many formal parameters");
   }
   func.set_num_fixed_parameters(params->num_fixed_parameters);
   func.SetNumOptionalParameters(params->num_optional_parameters,
@@ -7609,10 +7321,10 @@
   ASSERT(num_parameters == func.NumParameters());
   ASSERT(func.parameter_types() == Object::empty_array().raw());
   ASSERT(func.parameter_names() == Object::empty_array().raw());
-  func.set_parameter_types(Array::Handle(Array::New(num_parameters,
-                                                    Heap::kOld)));
-  func.set_parameter_names(Array::Handle(Array::New(num_parameters,
-                                                    Heap::kOld)));
+  func.set_parameter_types(
+      Array::Handle(Array::New(num_parameters, Heap::kOld)));
+  func.set_parameter_names(
+      Array::Handle(Array::New(num_parameters, Heap::kOld)));
   for (int i = 0; i < num_parameters; i++) {
     ParamDesc& param_desc = (*params->parameters)[i];
     func.SetParameterTypeAt(i, *param_desc.type);
@@ -7637,11 +7349,10 @@
     ParamDesc& param_desc = (*params->parameters)[i];
     ASSERT(!is_top_level_ || param_desc.type->IsResolved());
     const String* name = param_desc.name;
-    LocalVariable* parameter = new(Z) LocalVariable(
-        param_desc.name_pos, *name, *param_desc.type);
+    LocalVariable* parameter = new (Z) LocalVariable(
+        param_desc.name_pos, param_desc.name_pos, *name, *param_desc.type);
     if (!scope->InsertParameterAt(i, parameter)) {
-      ReportError(param_desc.name_pos,
-                  "name '%s' already exists in scope",
+      ReportError(param_desc.name_pos, "name '%s' already exists in scope",
                   param_desc.name->ToCString());
     }
     param_desc.var = parameter;
@@ -7669,14 +7380,11 @@
   const String& native_name = ParseNativeDeclaration();
 
   // Now add the NativeBodyNode and return statement.
-  current_block_->statements->Add(new(Z) ReturnNode(
+  current_block_->statements->Add(new (Z) ReturnNode(
       TokenPos(),
-      new(Z) NativeBodyNode(
-          TokenPos(),
-          Function::ZoneHandle(Z, func.raw()),
-          native_name,
-          current_block_->scope,
-          FLAG_link_natives_lazily)));
+      new (Z) NativeBodyNode(TokenPos(), Function::ZoneHandle(Z, func.raw()),
+                             native_name, current_block_->scope,
+                             FLAG_link_natives_lazily)));
 }
 
 
@@ -7696,8 +7404,9 @@
 
 void Parser::CaptureInstantiator() {
   ASSERT(FunctionLevel() > 0);
-  const String* variable_name = current_function().IsInFactoryScope() ?
-      &Symbols::TypeArgumentsParameter() : &Symbols::This();
+  const String* variable_name = current_function().IsInFactoryScope()
+                                    ? &Symbols::TypeArgumentsParameter()
+                                    : &Symbols::This();
   current_block_->scope->CaptureVariable(
       current_block_->scope->LookupVariable(*variable_name, true));
 }
@@ -7719,14 +7428,14 @@
   if (receiver == NULL) {
     ReportError(token_pos, "illegal implicit access to receiver 'this'");
   }
-  return new(Z) LoadLocalNode(TokenPos(), receiver);
+  return new (Z) LoadLocalNode(TokenPos(), receiver);
 }
 
 
 InstanceGetterNode* Parser::CallGetter(TokenPosition token_pos,
                                        AstNode* object,
                                        const String& name) {
-  return new(Z) InstanceGetterNode(token_pos, object, name);
+  return new (Z) InstanceGetterNode(token_pos, object, name);
 }
 
 
@@ -7746,13 +7455,11 @@
   if (CurrentToken() == Token::kASSIGN) {
     // Variable initialization.
     ConsumeToken();
-    AstNode* expr = ParseAwaitableExpr(
-        is_const, kConsumeCascades, await_preamble);
+    AstNode* expr =
+        ParseAwaitableExpr(is_const, kConsumeCascades, await_preamble);
     const TokenPosition expr_end_pos = TokenPos();
-    variable = new(Z) LocalVariable(
-        expr_end_pos, ident, type);
-    initialization = new(Z) StoreLocalNode(
-        assign_pos, variable, expr);
+    variable = new (Z) LocalVariable(ident_pos, expr_end_pos, ident, type);
+    initialization = new (Z) StoreLocalNode(assign_pos, variable, expr);
     if (is_const) {
       ASSERT(expr->IsLiteralNode());
       variable->SetConstValue(expr->AsLiteralNode()->literal());
@@ -7762,11 +7469,10 @@
                 "missing initialization of 'final' or 'const' variable");
   } else {
     // Initialize variable with null.
-    variable = new(Z) LocalVariable(
-        assign_pos, ident, type);
-    AstNode* null_expr = new(Z) LiteralNode(ident_pos, Object::null_instance());
-    initialization = new(Z) StoreLocalNode(
-        ident_pos, variable, null_expr);
+    variable = new (Z) LocalVariable(ident_pos, assign_pos, ident, type);
+    AstNode* null_expr =
+        new (Z) LiteralNode(ident_pos, Object::null_instance());
+    initialization = new (Z) StoreLocalNode(ident_pos, variable, null_expr);
   }
 
   ASSERT(current_block_ != NULL);
@@ -7775,17 +7481,14 @@
   if (previous_pos.IsReal()) {
     ASSERT(!script_.IsNull());
     if (previous_pos > ident_pos) {
-      ReportError(ident_pos,
-                  "initializer of '%s' may not refer to itself",
+      ReportError(ident_pos, "initializer of '%s' may not refer to itself",
                   ident.ToCString());
 
     } else {
       intptr_t line_number;
       script_.GetTokenLocation(previous_pos, &line_number, NULL);
-      ReportError(ident_pos,
-                  "identifier '%s' previously used in line %" Pd "",
-                  ident.ToCString(),
-                  line_number);
+      ReportError(ident_pos, "identifier '%s' previously used in line %" Pd "",
+                  ident.ToCString(), line_number);
     }
   }
 
@@ -7834,10 +7537,10 @@
     Token::Kind follower = LookaheadToken(1);
     // We have an identifier followed by a 'follower' token.
     // We either parse a type or return now.
-    if ((follower != Token::kLT) &&  // Parameterized type.
-        (follower != Token::kPERIOD) &&  // Qualified class name of type.
+    if ((follower != Token::kLT) &&        // Parameterized type.
+        (follower != Token::kPERIOD) &&    // Qualified class name of type.
         !Token::IsIdentifier(follower) &&  // Variable name following a type.
-        (follower != Token::kTHIS)) {  // Field parameter following a type.
+        (follower != Token::kTHIS)) {      // Field parameter following a type.
       return Type::DynamicType();
     }
   }
@@ -7853,9 +7556,10 @@
   SkipMetadata();
   bool is_final = (CurrentToken() == Token::kFINAL);
   bool is_const = (CurrentToken() == Token::kCONST);
-  const AbstractType& type = AbstractType::ZoneHandle(Z,
-      ParseConstFinalVarOrType(I->type_checks() ?
-          ClassFinalizer::kCanonicalize : ClassFinalizer::kIgnore));
+  const AbstractType& type = AbstractType::ZoneHandle(
+      Z,
+      ParseConstFinalVarOrType(I->type_checks() ? ClassFinalizer::kCanonicalize
+                                                : ClassFinalizer::kIgnore));
   if (!IsIdentifier()) {
     ReportError("identifier expected");
   }
@@ -7875,12 +7579,11 @@
     }
     // We have a second initializer. Allocate a sequence node now.
     // The sequence does not own the current scope. Set its own scope to NULL.
-    SequenceNode* sequence = NodeAsSequenceNode(initializers->token_pos(),
-                                                initializers,
-                                                NULL);
+    SequenceNode* sequence =
+        NodeAsSequenceNode(initializers->token_pos(), initializers, NULL);
     preamble = NULL;
-    AstNode* declaration = ParseVariableDeclaration(
-        type, is_final, is_const, &preamble);
+    AstNode* declaration =
+        ParseVariableDeclaration(type, is_final, is_const, &preamble);
     if (preamble != NULL) {
       sequence->Add(preamble);
     }
@@ -7894,12 +7597,12 @@
 AstNode* Parser::ParseFunctionStatement(bool is_literal) {
   TRACE_PARSER("ParseFunctionStatement");
   AbstractType& result_type = AbstractType::Handle(Z);
-  const String* variable_name = NULL;
   const String* function_name = NULL;
 
   result_type = Type::DynamicType();
 
   const TokenPosition function_pos = TokenPos();
+  TokenPosition function_name_pos = TokenPosition::kNoSource;
   TokenPosition metadata_pos = TokenPosition::kNoSource;
   if (is_literal) {
     ASSERT(CurrentToken() == Token::kLPAREN || CurrentToken() == Token::kLT);
@@ -7914,9 +7617,8 @@
       // referring to a not yet declared function type parameter.
       result_type = ParseType(ClassFinalizer::kDoNotResolve);
     }
-    const TokenPosition name_pos = TokenPos();
-    variable_name = ExpectIdentifier("function name expected");
-    function_name = variable_name;
+    function_name_pos = TokenPos();
+    function_name = ExpectIdentifier("function name expected");
 
     // Check that the function name has not been referenced
     // before this declaration.
@@ -7927,10 +7629,9 @@
       ASSERT(!script_.IsNull());
       intptr_t line_number;
       script_.GetTokenLocation(previous_pos, &line_number, NULL);
-      ReportError(name_pos,
+      ReportError(function_name_pos,
                   "identifier '%s' previously used in line %" Pd "",
-                  function_name->ToCString(),
-                  line_number);
+                  function_name->ToCString(), line_number);
     }
   }
 
@@ -7951,8 +7652,7 @@
     // function has been properly setup.
     found_func = false;
     function = Function::NewClosureFunction(*function_name,
-                                            innermost_function(),
-                                            function_pos);
+                                            innermost_function(), function_pos);
     function.set_result_type(result_type);
     if (FLAG_enable_mirrors && metadata_pos.IsReal()) {
       library_.AddFunctionMetadata(function, metadata_pos);
@@ -7976,9 +7676,9 @@
   if (!found_func && !result_type.IsFinalized()) {
     // Now that type parameters are declared, the result type can be resolved
     // and finalized.
-    ResolveType(ClassFinalizer::kResolveTypeParameters, &result_type);
-    result_type = ClassFinalizer::FinalizeType(
-        current_class(), result_type, ClassFinalizer::kCanonicalize);
+    ResolveType(ClassFinalizer::kCanonicalize, &result_type);
+    result_type = ClassFinalizer::FinalizeType(current_class(), result_type,
+                                               ClassFinalizer::kCanonicalize);
     function.set_result_type(result_type);
   }
 
@@ -7990,32 +7690,29 @@
 
   LocalVariable* function_variable = NULL;
   Type& function_type = Type::ZoneHandle(Z);
-  if (variable_name != NULL) {
+  if (!is_literal) {
     // Since the function type depends on the signature of the closure function,
     // it cannot be determined before the formal parameter list of the closure
     // function is parsed. Therefore, we set the function type to a new
     // function type to be patched after the actual type is known.
     // We temporarily use the Closure class as scope class.
-    const Class& unknown_scope_class = Class::Handle(Z,
-        I->object_store()->closure_class());
-    function_type = Type::New(unknown_scope_class,
-                              TypeArguments::Handle(Z),
-                              function_pos);
+    const Class& unknown_scope_class =
+        Class::Handle(Z, I->object_store()->closure_class());
+    function_type =
+        Type::New(unknown_scope_class, TypeArguments::Handle(Z), function_pos);
     function_type.set_signature(function);
     function_type.SetIsFinalized();  // No finalization needed.
 
     // Add the function variable to the scope before parsing the function in
     // order to allow self reference from inside the function.
-    function_variable = new(Z) LocalVariable(function_pos,
-                                             *variable_name,
-                                             function_type);
+    function_variable = new (Z) LocalVariable(function_name_pos, function_pos,
+                                              *function_name, function_type);
     function_variable->set_is_final();
     ASSERT(current_block_ != NULL);
     ASSERT(current_block_->scope != NULL);
     if (!current_block_->scope->AddVariable(function_variable)) {
-      LocalVariable* existing_var =
-          current_block_->scope->LookupVariable(function_variable->name(),
-                                                true);
+      LocalVariable* existing_var = current_block_->scope->LookupVariable(
+          function_variable->name(), true);
       ASSERT(existing_var != NULL);
       // Use before define cases have already been detected and reported above.
       ASSERT(existing_var->owner() == current_block_->scope);
@@ -8077,10 +7774,9 @@
   ASSERT(!signature_type.IsMalformed());
   ASSERT(!signature_type.IsMalbounded());
 
-  if (variable_name != NULL) {
+  if (!is_literal) {
     // Patch the function type of the variable now that the signature is known.
-    function_type.set_type_class(
-        Class::Handle(Z, signature_type.type_class()));
+    function_type.set_type_class(Class::Handle(Z, signature_type.type_class()));
     function_type.set_arguments(
         TypeArguments::Handle(Z, signature_type.arguments()));
     ASSERT(function_type.signature() == function.raw());
@@ -8090,8 +7786,7 @@
     function_type.ResetIsFinalized();
 
     // The function variable type should have been patched above.
-    ASSERT((function_variable == NULL) ||
-           (function_variable->type().raw() == function_type.raw()));
+    ASSERT(function_variable->type().raw() == function_type.raw());
   }
 
   // The code generator does not compile the closure function when visiting
@@ -8114,20 +7809,14 @@
   // This pruning is done by omitting to hook the local scope in its parent
   // scope in the constructor of LocalScope.
   AstNode* closure =
-      new(Z) ClosureNode(function_pos, function, NULL,
-                         statements != NULL ? statements->scope() : NULL);
+      new (Z) ClosureNode(function_pos, function, NULL,
+                          statements != NULL ? statements->scope() : NULL);
 
   ASSERT(innermost_function_.raw() == function.raw());
   innermost_function_ = function.parent_function();
 
-  if (function_variable == NULL) {
-    ASSERT(is_literal);
-    return closure;
-  } else {
-    AstNode* initialization = new(Z) StoreLocalNode(
-        function_pos, function_variable, closure);
-    return initialization;
-  }
+  return is_literal ? closure : new (Z) StoreLocalNode(
+                                    function_pos, function_variable, closure);
 }
 
 
@@ -8150,8 +7839,7 @@
         // Consume the identifier, the period will be consumed below.
         ConsumeToken();
       }
-    } else if ((ct != Token::kCOMMA) &&
-               (ct != Token::kEXTENDS) &&
+    } else if ((ct != Token::kCOMMA) && (ct != Token::kEXTENDS) &&
                (!FLAG_generic_method_syntax || (ct != Token::kSUPER))) {
       // We are looking at something other than type parameters.
       return false;
@@ -8284,16 +7972,16 @@
 // Returns true if the current token is kIDENT or a pseudo-keyword.
 bool Parser::IsIdentifier() {
   return Token::IsIdentifier(CurrentToken()) &&
-      !(await_is_keyword_ &&
-       ((CurrentLiteral()->raw() == Symbols::Await().raw()) ||
-       (CurrentLiteral()->raw() == Symbols::Async().raw()) ||
-       (CurrentLiteral()->raw() == Symbols::YieldKw().raw())));
+         !(await_is_keyword_ &&
+           ((CurrentLiteral()->raw() == Symbols::Await().raw()) ||
+            (CurrentLiteral()->raw() == Symbols::Async().raw()) ||
+            (CurrentLiteral()->raw() == Symbols::YieldKw().raw())));
 }
 
 
 bool Parser::IsSymbol(const String& symbol) {
   return (CurrentLiteral()->raw() == symbol.raw()) &&
-      (CurrentToken() == Token::kIDENT);
+         (CurrentToken() == Token::kIDENT);
 }
 
 
@@ -8354,8 +8042,7 @@
 //   | type ident (';' | '=' | ',')
 // Token position remains unchanged.
 bool Parser::IsVariableDeclaration() {
-  if ((CurrentToken() == Token::kVAR) ||
-      (CurrentToken() == Token::kFINAL)) {
+  if ((CurrentToken() == Token::kVAR) || (CurrentToken() == Token::kFINAL)) {
     return true;
   }
   // Skip optional metadata.
@@ -8379,8 +8066,8 @@
   }
   if (IsIdentifier()) {  // Type or variable name.
     Token::Kind follower = LookaheadToken(1);
-    if ((follower == Token::kLT) ||  // Parameterized type.
-        (follower == Token::kPERIOD) ||  // Qualified class name of type.
+    if ((follower == Token::kLT) ||       // Parameterized type.
+        (follower == Token::kPERIOD) ||   // Qualified class name of type.
         Token::IsIdentifier(follower)) {  // Variable name following a type.
       // We see the beginning of something that could be a type.
       const TokenPosition type_pos = TokenPos();
@@ -8453,12 +8140,9 @@
 
   // Check parameter list and the following token.
   SkipToMatchingParenthesis();
-  if ((CurrentToken() == Token::kLBRACE) ||
-      (CurrentToken() == Token::kARROW) ||
-      (is_top_level_ && IsSymbol(Symbols::Native())) ||
-      is_external ||
-      IsSymbol(Symbols::Async()) ||
-      IsSymbol(Symbols::Sync())) {
+  if ((CurrentToken() == Token::kLBRACE) || (CurrentToken() == Token::kARROW) ||
+      (is_top_level_ && IsSymbol(Symbols::Native())) || is_external ||
+      IsSymbol(Symbols::Async()) || IsSymbol(Symbols::Sync())) {
     return true;
   }
   return false;
@@ -8500,7 +8184,7 @@
     ParseFunctionModifier();
     if ((CurrentToken() == Token::kLBRACE) ||
         (CurrentToken() == Token::kARROW)) {
-       return true;
+      return true;
     }
   }
   return false;
@@ -8515,8 +8199,7 @@
   // Allow const modifier as well when recognizing a for-in statement
   // pattern. We will get an error later if the loop variable is
   // declared with const.
-  if (CurrentToken() == Token::kVAR ||
-      CurrentToken() == Token::kFINAL ||
+  if (CurrentToken() == Token::kVAR || CurrentToken() == Token::kFINAL ||
       CurrentToken() == Token::kCONST) {
     ConsumeToken();
   }
@@ -8537,11 +8220,10 @@
 static bool ContainsAbruptCompletingStatement(SequenceNode* seq);
 
 static bool IsAbruptCompleting(AstNode* statement) {
-  return statement->IsReturnNode() ||
-         statement->IsJumpNode()   ||
-         statement->IsThrowNode()  ||
+  return statement->IsReturnNode() || statement->IsJumpNode() ||
+         statement->IsThrowNode() ||
          (statement->IsSequenceNode() &&
-             ContainsAbruptCompletingStatement(statement->AsSequenceNode()));
+          ContainsAbruptCompletingStatement(statement->AsSequenceNode()));
 }
 
 
@@ -8631,8 +8313,8 @@
     ConsumeToken();
     false_branch = ParseNestedStatement(parsing_loop_body, NULL);
   }
-  AstNode* if_node = new(Z) IfNode(
-      if_pos, cond_expr, true_branch, false_branch);
+  AstNode* if_node =
+      new (Z) IfNode(if_pos, cond_expr, true_branch, false_branch);
   if (label != NULL) {
     current_block_->statements->Add(if_node);
     SequenceNode* sequence = CloseBlock();
@@ -8647,7 +8329,8 @@
 // == operator.
 static bool ImplementsEqualOperator(Zone* zone, const Instance& value) {
   Class& cls = Class::Handle(value.clazz());
-  const Function& equal_op = Function::Handle(zone,
+  const Function& equal_op = Function::Handle(
+      zone,
       Resolver::ResolveDynamicAnyArgs(zone, cls, Symbols::EqualOperator()));
   ASSERT(!equal_op.IsNull());
   cls = equal_op.Owner();
@@ -8718,7 +8401,7 @@
   bool default_seen = false;
   const TokenPosition case_pos = TokenPos();
   // The case expressions node sequence does not own the enclosing scope.
-  SequenceNode* case_expressions = new(Z) SequenceNode(case_pos, NULL);
+  SequenceNode* case_expressions = new (Z) SequenceNode(case_pos, NULL);
   while (CurrentToken() == Token::kCASE || CurrentToken() == Token::kDEFAULT) {
     if (CurrentToken() == Token::kCASE) {
       if (default_seen) {
@@ -8730,10 +8413,10 @@
       ASSERT(expr->IsLiteralNode());
       case_expr_values->Add(expr->AsLiteralNode());
 
-      AstNode* switch_expr_load = new(Z) LoadLocalNode(
-          case_pos, switch_expr_value);
-      AstNode* case_comparison = new(Z) ComparisonNode(
-          expr_pos, Token::kEQ, expr, switch_expr_load);
+      AstNode* switch_expr_load =
+          new (Z) LoadLocalNode(case_pos, switch_expr_value);
+      AstNode* case_comparison =
+          new (Z) ComparisonNode(expr_pos, Token::kEQ, expr, switch_expr_load);
       case_expressions->Add(case_comparison);
     } else {
       if (default_seen) {
@@ -8766,15 +8449,13 @@
       // End of this case clause. If there is a possible fall-through to
       // the next case clause, throw an implicit FallThroughError.
       if (!abrupt_completing_seen) {
-        ArgumentListNode* arguments = new(Z) ArgumentListNode(TokenPos());
-        arguments->Add(new(Z) LiteralNode(
-            TokenPos(),
-            Integer::ZoneHandle(Z, Integer::New(TokenPos().value(),
-                                                Heap::kOld))));
-        current_block_->statements->Add(
-            MakeStaticCall(Symbols::FallThroughError(),
-                           Library::PrivateCoreLibName(Symbols::ThrowNew()),
-                           arguments));
+        ArgumentListNode* arguments = new (Z) ArgumentListNode(TokenPos());
+        arguments->Add(new (Z) LiteralNode(
+            TokenPos(), Integer::ZoneHandle(
+                            Z, Integer::New(TokenPos().value(), Heap::kOld))));
+        current_block_->statements->Add(MakeStaticCall(
+            Symbols::FallThroughError(),
+            Library::PrivateCoreLibName(Symbols::ThrowNew()), arguments));
       }
       break;
     }
@@ -8786,8 +8467,8 @@
     }
   }
   SequenceNode* statements = CloseBlock();
-  return new(Z) CaseNode(case_pos, case_label,
-      case_expressions, default_seen, switch_expr_value, statements);
+  return new (Z) CaseNode(case_pos, case_label, case_expressions, default_seen,
+                          switch_expr_value, statements);
 }
 
 
@@ -8800,8 +8481,8 @@
   ConsumeToken();
   ExpectToken(Token::kLPAREN);
   const TokenPosition expr_pos = TokenPos();
-  AstNode* switch_expr = ParseAwaitableExpr(
-      kAllowConst, kConsumeCascades, NULL);
+  AstNode* switch_expr =
+      ParseAwaitableExpr(kAllowConst, kConsumeCascades, NULL);
   ExpectToken(Token::kRPAREN);
   ExpectToken(Token::kLBRACE);
   OpenBlock();
@@ -8812,16 +8493,15 @@
   // type of the case clause expressions. Therefore, we have to allocate
   // a new type representing dynamic and can't reuse the canonical
   // type object for dynamic.
-  const Type& temp_var_type = Type::ZoneHandle(Z,
-       Type::New(Class::Handle(Z, Object::dynamic_class()),
-                 TypeArguments::Handle(Z),
-                 expr_pos));
+  const Type& temp_var_type =
+      Type::ZoneHandle(Z, Type::New(Class::Handle(Z, Object::dynamic_class()),
+                                    TypeArguments::Handle(Z), expr_pos));
   temp_var_type.SetIsFinalized();
-  LocalVariable* temp_variable = new(Z) LocalVariable(
-      expr_pos,  Symbols::SwitchExpr(), temp_var_type);
+  LocalVariable* temp_variable = new (Z)
+      LocalVariable(expr_pos, expr_pos, Symbols::SwitchExpr(), temp_var_type);
   current_block_->scope->AddVariable(temp_variable);
-  AstNode* save_switch_expr = new(Z) StoreLocalNode(
-      expr_pos, temp_variable, switch_expr);
+  AstNode* save_switch_expr =
+      new (Z) StoreLocalNode(expr_pos, temp_variable, switch_expr);
   current_block_->statements->Add(save_switch_expr);
 
   // Parse case clauses
@@ -8839,8 +8519,8 @@
       case_label = current_block_->scope->LocalLookupLabel(*label_name);
       if (case_label == NULL) {
         // Label does not exist yet. Add it to scope of switch statement.
-        case_label = new(Z) SourceLabel(
-            label_pos, *label_name, SourceLabel::kCase);
+        case_label =
+            new (Z) SourceLabel(label_pos, *label_name, SourceLabel::kCase);
         current_block_->scope->AddLabel(case_label);
       } else if (case_label->kind() == SourceLabel::kForward) {
         // We have seen a 'continue' with this label name. Resolve
@@ -8853,8 +8533,7 @@
       }
       ASSERT(case_label->kind() == SourceLabel::kCase);
     }
-    if (CurrentToken() == Token::kCASE ||
-        CurrentToken() == Token::kDEFAULT) {
+    if (CurrentToken() == Token::kCASE || CurrentToken() == Token::kDEFAULT) {
       if (default_seen) {
         ReportError("no case clauses allowed after default clause");
       }
@@ -8888,7 +8567,7 @@
 
   SequenceNode* switch_body = CloseBlock();
   ExpectToken(Token::kRBRACE);
-  return new(Z) SwitchNode(switch_pos, label, switch_body);
+  return new (Z) SwitchNode(switch_pos, label, switch_body);
 }
 
 
@@ -8900,16 +8579,13 @@
   ConsumeToken();
   ExpectToken(Token::kLPAREN);
   SequenceNode* await_preamble = NULL;
-  AstNode* cond_expr = ParseAwaitableExpr(
-      kAllowConst, kConsumeCascades, &await_preamble);
+  AstNode* cond_expr =
+      ParseAwaitableExpr(kAllowConst, kConsumeCascades, &await_preamble);
   ExpectToken(Token::kRPAREN);
-  const bool parsing_loop_body =  true;
+  const bool parsing_loop_body = true;
   SequenceNode* while_body = ParseNestedStatement(parsing_loop_body, label);
-  WhileNode* while_node = new (Z) WhileNode(while_pos,
-                                            label,
-                                            cond_expr,
-                                            await_preamble,
-                                            while_body);
+  WhileNode* while_node = new (Z)
+      WhileNode(while_pos, label, cond_expr, await_preamble, while_body);
   return while_node;
 }
 
@@ -8920,7 +8596,7 @@
   SourceLabel* label =
       SourceLabel::New(do_pos, label_name, SourceLabel::kDoWhile);
   ConsumeToken();
-  const bool parsing_loop_body =  true;
+  const bool parsing_loop_body = true;
   SequenceNode* dowhile_body = ParseNestedStatement(parsing_loop_body, label);
   ExpectToken(Token::kWHILE);
   ExpectToken(Token::kLPAREN);
@@ -8930,14 +8606,14 @@
       ParseAwaitableExpr(kAllowConst, kConsumeCascades, &await_preamble);
   if (await_preamble != NULL) {
     // Prepend the preamble to the condition.
-    LetNode* await_cond = new(Z) LetNode(expr_pos);
+    LetNode* await_cond = new (Z) LetNode(expr_pos);
     await_cond->AddNode(await_preamble);
     await_cond->AddNode(cond_expr);
     cond_expr = await_cond;
   }
   ExpectToken(Token::kRPAREN);
   ExpectSemicolon();
-  return new(Z) DoWhileNode(do_pos, label, cond_expr, dowhile_body);
+  return new (Z) DoWhileNode(do_pos, label, cond_expr, dowhile_body);
 }
 
 
@@ -8953,11 +8629,10 @@
                                                     LocalScope* scope,
                                                     uint16_t try_index) {
   Zone* zone = thread->zone();
-  const String& async_saved_try_ctx_name = String::ZoneHandle(zone,
-      Symbols::NewFormatted(thread,
-                            "%s%d",
-                            Symbols::AsyncSavedTryCtxVarPrefix().ToCString(),
-                            try_index));
+  const String& async_saved_try_ctx_name = String::ZoneHandle(
+      zone, Symbols::NewFormatted(
+                thread, "%s%d",
+                Symbols::AsyncSavedTryCtxVarPrefix().ToCString(), try_index));
   LocalVariable* var = scope->LocalLookupVariable(async_saved_try_ctx_name);
   ASSERT(var != NULL);
   return var;
@@ -8995,8 +8670,8 @@
       // The block declaring :saved_try_ctx_var variable is the parent of the
       // pushed try block.
       *saved_try_ctx = LookupSavedTryContextVar(scope->parent());
-      *async_saved_try_ctx = LookupAsyncSavedTryContextVar(T,
-          async_temp_scope_, try_index);
+      *async_saved_try_ctx =
+          LookupAsyncSavedTryContextVar(T, async_temp_scope_, try_index);
       if ((try_stack_->outer_try() != NULL) && !try_stack_->inside_finally()) {
         // Collecting the outer try scope is not necessary if we
         // are in a finally block.
@@ -9004,8 +8679,8 @@
         try_index = try_stack_->outer_try()->try_index();
         if (scope->function_level() == current_function_level) {
           *outer_saved_try_ctx = LookupSavedTryContextVar(scope->parent());
-          *outer_async_saved_try_ctx = LookupAsyncSavedTryContextVar(T,
-              async_temp_scope_, try_index);
+          *outer_async_saved_try_ctx =
+              LookupAsyncSavedTryContextVar(T, async_temp_scope_, try_index);
         }
       }
     }
@@ -9013,8 +8688,7 @@
   // An async or async* has an implicitly created try-catch around the
   // function body, so the await or yield inside the async closure should always
   // be created with a try scope.
-  ASSERT((*saved_try_ctx != NULL) ||
-         innermost_function().IsAsyncFunction() ||
+  ASSERT((*saved_try_ctx != NULL) || innermost_function().IsAsyncFunction() ||
          innermost_function().IsAsyncGenerator() ||
          innermost_function().IsSyncGenClosure() ||
          innermost_function().IsSyncGenerator());
@@ -9025,15 +8699,15 @@
 // Used during debugging to insert print in generated dart code.
 AstNode* Parser::DartPrint(const char* str) {
   const Library& lib = Library::Handle(Library::CoreLibrary());
-  const Function& print_fn = Function::ZoneHandle(
-      Z, lib.LookupFunctionAllowPrivate(Symbols::print()));
+  const Function& print_fn =
+      Function::ZoneHandle(Z, lib.LookupFunctionAllowPrivate(Symbols::print()));
   ASSERT(!print_fn.IsNull());
   ArgumentListNode* one_arg =
-      new(Z) ArgumentListNode(TokenPosition::kNoSource);
+      new (Z) ArgumentListNode(TokenPosition::kNoSource);
   String& msg = String::ZoneHandle(Symbols::NewFormatted(T, "%s", str));
-  one_arg->Add(new(Z) LiteralNode(TokenPosition::kNoSource, msg));
+  one_arg->Add(new (Z) LiteralNode(TokenPosition::kNoSource, msg));
   AstNode* print_call =
-      new(Z) StaticCallNode(TokenPosition::kNoSource, print_fn, one_arg);
+      new (Z) StaticCallNode(TokenPosition::kNoSource, print_fn, one_arg);
   return print_call;
 }
 
@@ -9061,15 +8735,15 @@
     ReportError("Loop variable cannot be 'const'");
   }
   bool new_loop_var = false;
-  AbstractType& loop_var_type =  AbstractType::ZoneHandle(Z);
+  AbstractType& loop_var_type = AbstractType::ZoneHandle(Z);
   if (LookaheadToken(1) != Token::kIN) {
     // Declaration of a new loop variable.
     // Delay creation of the local variable until we know its actual
     // position, which is inside the loop body.
     new_loop_var = true;
-    loop_var_type = ParseConstFinalVarOrType(
-       I->type_checks() ? ClassFinalizer::kCanonicalize :
-                                  ClassFinalizer::kIgnore);
+    loop_var_type = ParseConstFinalVarOrType(I->type_checks()
+                                                 ? ClassFinalizer::kCanonicalize
+                                                 : ClassFinalizer::kIgnore);
   }
   TokenPosition loop_var_pos = TokenPos();
   const String* loop_var_name = ExpectIdentifier("variable name expected");
@@ -9095,23 +8769,20 @@
   const Class& stream_iterator_cls =
       Class::ZoneHandle(Z, I->object_store()->stream_iterator_class());
   ASSERT(!stream_iterator_cls.IsNull());
-  const Function& iterator_ctor =
-      Function::ZoneHandle(Z, stream_iterator_cls.LookupFunction(
-          Symbols::StreamIteratorConstructor()));
+  const Function& iterator_ctor = Function::ZoneHandle(
+      Z,
+      stream_iterator_cls.LookupFunction(Symbols::StreamIteratorConstructor()));
   ASSERT(!iterator_ctor.IsNull());
   ArgumentListNode* ctor_args = new (Z) ArgumentListNode(stream_expr_pos);
   ctor_args->Add(stream_expr);
-  ConstructorCallNode* ctor_call =
-      new (Z) ConstructorCallNode(stream_expr_pos,
-                              TypeArguments::ZoneHandle(Z),
-                              iterator_ctor,
-                              ctor_args);
+  ConstructorCallNode* ctor_call = new (Z) ConstructorCallNode(
+      stream_expr_pos, TypeArguments::ZoneHandle(Z), iterator_ctor, ctor_args);
   const AbstractType& iterator_type = Object::dynamic_type();
-  LocalVariable* iterator_var = new(Z) LocalVariable(
-      stream_expr_pos, Symbols::ForInIter(), iterator_type);
+  LocalVariable* iterator_var = new (Z) LocalVariable(
+      stream_expr_pos, stream_expr_pos, Symbols::ForInIter(), iterator_type);
   current_block_->scope->AddVariable(iterator_var);
   AstNode* iterator_init =
-      new(Z) StoreLocalNode(stream_expr_pos, iterator_var, ctor_call);
+      new (Z) StoreLocalNode(stream_expr_pos, iterator_var, ctor_call);
   current_block_->statements->Add(iterator_init);
 
   // We need to ensure that the stream is cancelled after the loop.
@@ -9130,11 +8801,8 @@
   LocalVariable* saved_stack_trace_var = NULL;
   SetupExceptionVariables(current_block_->scope,
                           false,  // Do not create the saved_ vars.
-                          &context_var,
-                          &exception_var,
-                          &stack_trace_var,
-                          &saved_exception_var,
-                          &saved_stack_trace_var);
+                          &context_var, &exception_var, &stack_trace_var,
+                          &saved_exception_var, &saved_stack_trace_var);
   OpenBlock();  // try block.
   PushTry(current_block_);
   SetupSavedTryContext(context_var);
@@ -9145,25 +8813,16 @@
   LocalVariable* async_saved_try_ctx;
   LocalVariable* outer_saved_try_ctx;
   LocalVariable* outer_async_saved_try_ctx;
-  CheckAsyncOpInTryBlock(&saved_try_ctx,
-                         &async_saved_try_ctx,
-                         &outer_saved_try_ctx,
-                         &outer_async_saved_try_ctx);
-  ArgumentListNode* no_args = new(Z) ArgumentListNode(stream_expr_pos);
-  AstNode* iterator_moveNext = new(Z) InstanceCallNode(
-      stream_expr_pos,
-      new(Z) LoadLocalNode(stream_expr_pos, iterator_var),
-                           Symbols::MoveNext(),
-                           no_args);
+  CheckAsyncOpInTryBlock(&saved_try_ctx, &async_saved_try_ctx,
+                         &outer_saved_try_ctx, &outer_async_saved_try_ctx);
+  ArgumentListNode* no_args = new (Z) ArgumentListNode(stream_expr_pos);
+  AstNode* iterator_moveNext = new (Z) InstanceCallNode(
+      stream_expr_pos, new (Z) LoadLocalNode(stream_expr_pos, iterator_var),
+      Symbols::MoveNext(), no_args);
   OpenBlock();
-  AstNode* await_moveNext =
-      new(Z) AwaitNode(stream_expr_pos,
-                       iterator_moveNext,
-                       saved_try_ctx,
-                       async_saved_try_ctx,
-                       outer_saved_try_ctx,
-                       outer_async_saved_try_ctx,
-                       current_block_->scope);
+  AstNode* await_moveNext = new (Z) AwaitNode(
+      stream_expr_pos, iterator_moveNext, saved_try_ctx, async_saved_try_ctx,
+      outer_saved_try_ctx, outer_async_saved_try_ctx, current_block_->scope);
   AwaitTransformer at(current_block_->statements, async_temp_scope_);
   await_moveNext = at.Transform(await_moveNext);
   SequenceNode* await_preamble = CloseBlock();
@@ -9179,9 +8838,9 @@
   current_block_->scope->AddLabel(label);
   const TokenPosition loop_var_assignment_pos = TokenPos();
 
-  AstNode* iterator_current = new(Z) InstanceGetterNode(
+  AstNode* iterator_current = new (Z) InstanceGetterNode(
       loop_var_assignment_pos,
-      new(Z) LoadLocalNode(loop_var_assignment_pos, iterator_var),
+      new (Z) LoadLocalNode(loop_var_assignment_pos, iterator_var),
       Symbols::Current());
 
   // Generate assignment of next iterator value to loop variable.
@@ -9192,23 +8851,21 @@
     // Note that the variable token position needs to be inside the
     // loop block, so it gets put in the loop context level.
     LocalVariable* loop_var =
-        new(Z) LocalVariable(loop_var_assignment_pos,
-                             *loop_var_name,
-                             loop_var_type);;
+        new (Z) LocalVariable(loop_var_assignment_pos, loop_var_assignment_pos,
+                              *loop_var_name, loop_var_type);
     if (loop_var_is_final) {
       loop_var->set_is_final();
     }
     current_block_->scope->AddVariable(loop_var);
-    loop_var_assignment = new(Z) StoreLocalNode(
-        loop_var_assignment_pos, loop_var, iterator_current);
+    loop_var_assignment = new (Z)
+        StoreLocalNode(loop_var_assignment_pos, loop_var, iterator_current);
   } else {
     AstNode* loop_var_primary =
         ResolveIdent(loop_var_pos, *loop_var_name, false);
     ASSERT(!loop_var_primary->IsPrimaryNode());
-    loop_var_assignment = CreateAssignmentNode(loop_var_primary,
-                                               iterator_current,
-                                               loop_var_name,
-                                               loop_var_assignment_pos);
+    loop_var_assignment =
+        CreateAssignmentNode(loop_var_primary, iterator_current, loop_var_name,
+                             loop_var_assignment_pos);
     ASSERT(loop_var_assignment != NULL);
   }
   current_block_->statements->Add(loop_var_assignment);
@@ -9226,11 +8883,8 @@
   }
   SequenceNode* for_loop_block = CloseBlock();
 
-  WhileNode* while_node = new (Z) WhileNode(await_for_pos,
-                                            label,
-                                            await_moveNext,
-                                            await_preamble,
-                                            for_loop_block);
+  WhileNode* while_node = new (Z) WhileNode(
+      await_for_pos, label, await_moveNext, await_preamble, for_loop_block);
   // Add the while loop to the try block.
   current_block_->statements->Add(while_node);
   SequenceNode* try_block = CloseBlock();
@@ -9238,12 +8892,11 @@
   // Create an empty "catch all" block that rethrows the current
   // exception and stacktrace.
   try_stack_->enter_catch();
-  SequenceNode* catch_block = new(Z) SequenceNode(await_for_pos, NULL);
+  SequenceNode* catch_block = new (Z) SequenceNode(await_for_pos, NULL);
 
   if (outer_saved_try_ctx != NULL) {
     catch_block->Add(new (Z) StoreLocalNode(
-        TokenPosition::kNoSource,
-        outer_saved_try_ctx,
+        TokenPosition::kNoSource, outer_saved_try_ctx,
         new (Z) LoadLocalNode(TokenPosition::kNoSource,
                               outer_async_saved_try_ctx)));
   }
@@ -9253,16 +8906,16 @@
   // is no code in the catch clause that could suspend the function.
 
   // Rethrow the exception.
-  catch_block->Add(new(Z) ThrowNode(
-      await_for_pos,
-      new(Z) LoadLocalNode(await_for_pos, exception_var),
-      new(Z) LoadLocalNode(await_for_pos, stack_trace_var)));
+  catch_block->Add(new (Z) ThrowNode(
+      await_for_pos, new (Z) LoadLocalNode(await_for_pos, exception_var),
+      new (Z) LoadLocalNode(await_for_pos, stack_trace_var)));
 
   TryStack* try_statement = PopTry();
   const intptr_t try_index = try_statement->try_index();
   TryStack* outer_try = try_stack_;
-  const intptr_t outer_try_index = (outer_try != NULL) ?
-      outer_try->try_index() : CatchClauseNode::kInvalidTryIndex;
+  const intptr_t outer_try_index = (outer_try != NULL)
+                                       ? outer_try->try_index()
+                                       : CatchClauseNode::kInvalidTryIndex;
 
   // The finally block contains a call to cancel the stream.
   // :for-in-iter.cancel();
@@ -9280,28 +8933,24 @@
     // exists.
     if (outer_saved_try_ctx != NULL) {
       current_block_->statements->Add(new (Z) StoreLocalNode(
-          TokenPosition::kNoSource,
-          outer_saved_try_ctx,
+          TokenPosition::kNoSource, outer_saved_try_ctx,
           new (Z) LoadLocalNode(TokenPosition::kNoSource,
                                 outer_async_saved_try_ctx)));
     }
     // :for-in-iter.cancel();
     ArgumentListNode* no_args =
-        new(Z) ArgumentListNode(TokenPosition::kNoSource);
-    current_block_->statements->Add(
-        new(Z) InstanceCallNode(TokenPosition::kNoSource,
-            new(Z) LoadLocalNode(TokenPosition::kNoSource, iterator_var),
-            Symbols::Cancel(),
-            no_args));
+        new (Z) ArgumentListNode(TokenPosition::kNoSource);
+    current_block_->statements->Add(new (Z) InstanceCallNode(
+        TokenPosition::kNoSource,
+        new (Z) LoadLocalNode(TokenPosition::kNoSource, iterator_var),
+        Symbols::Cancel(), no_args));
     finally_clause = CloseBlock();
 
     AstNode* node_to_inline = try_statement->GetNodeToInlineFinally(node_index);
     if (node_to_inline != NULL) {
       InlinedFinallyNode* node =
-          new(Z) InlinedFinallyNode(TokenPosition::kNoSource,
-                                    finally_clause,
-                                    context_var,
-                                    outer_try_index);
+          new (Z) InlinedFinallyNode(TokenPosition::kNoSource, finally_clause,
+                                     context_var, outer_try_index);
       finally_clause = NULL;
       AddFinallyClauseToNode(true, node_to_inline, node);
       node_index++;
@@ -9319,25 +8968,14 @@
   // Catch block handles all exceptions.
   handler_types.SetAt(0, Object::dynamic_type());
 
-  CatchClauseNode* catch_clause = new(Z) CatchClauseNode(await_for_pos,
-      catch_block,
-      handler_types,
-      context_var,
-      exception_var,
-      stack_trace_var,
-      exception_var,
-      stack_trace_var,
-      AllocateTryIndex(),
+  CatchClauseNode* catch_clause = new (Z) CatchClauseNode(
+      await_for_pos, catch_block, handler_types, context_var, exception_var,
+      stack_trace_var, exception_var, stack_trace_var, AllocateTryIndex(),
       true);  // Needs stack trace.
 
   AstNode* try_catch_node =
-      new(Z) TryCatchNode(await_for_pos,
-                         try_block,
-                         context_var,
-                         catch_clause,
-                         finally_clause,
-                         try_index,
-                         finally_clause);
+      new (Z) TryCatchNode(await_for_pos, try_block, context_var, catch_clause,
+                           finally_clause, try_index, finally_clause);
 
   ASSERT(current_block_ == await_for_block);
   await_for_block->statements->Add(try_catch_node);
@@ -9356,7 +8994,7 @@
   const String* loop_var_name = NULL;
   TokenPosition loop_var_pos = TokenPosition::kNoSource;
   bool new_loop_var = false;
-  AbstractType& loop_var_type =  AbstractType::ZoneHandle(Z);
+  AbstractType& loop_var_type = AbstractType::ZoneHandle(Z);
   if (LookaheadToken(1) == Token::kIN) {
     loop_var_pos = TokenPos();
     loop_var_name = ExpectIdentifier("variable name expected");
@@ -9365,9 +9003,10 @@
     // Delay creation of the local variable until we know its actual
     // position, which is inside the loop body.
     new_loop_var = true;
-    loop_var_type = ParseConstFinalVarOrType(
-        I->type_checks() ? ClassFinalizer::kCanonicalize :
-                                   ClassFinalizer::kIgnore);
+    loop_var_type = ParseConstFinalVarOrType(I->type_checks()
+                                                 ? ClassFinalizer::kCanonicalize
+                                                 : ClassFinalizer::kIgnore);
+    loop_var_pos = TokenPos();
     loop_var_name = ExpectIdentifier("variable name expected");
   }
   ExpectToken(Token::kIN);
@@ -9390,24 +9029,22 @@
   // It is better to leave the iterator untyped and postpone the type error
   // until the loop variable is assigned to.
   const AbstractType& iterator_type = Object::dynamic_type();
-  LocalVariable* iterator_var = new(Z) LocalVariable(
-      collection_pos, Symbols::ForInIter(), iterator_type);
+  LocalVariable* iterator_var = new (Z) LocalVariable(
+      collection_pos, collection_pos, Symbols::ForInIter(), iterator_type);
   current_block_->scope->AddVariable(iterator_var);
 
   // Generate initialization of iterator variable.
-  ArgumentListNode* no_args = new(Z) ArgumentListNode(collection_pos);
-  AstNode* get_iterator = new(Z) InstanceGetterNode(
-      collection_pos, collection_expr, Symbols::Iterator());
+  ArgumentListNode* no_args = new (Z) ArgumentListNode(collection_pos);
+  AstNode* get_iterator = new (Z)
+      InstanceGetterNode(collection_pos, collection_expr, Symbols::Iterator());
   AstNode* iterator_init =
-      new(Z) StoreLocalNode(collection_pos, iterator_var, get_iterator);
+      new (Z) StoreLocalNode(collection_pos, iterator_var, get_iterator);
   current_block_->statements->Add(iterator_init);
 
   // Generate while loop condition.
-  AstNode* iterator_moveNext = new(Z) InstanceCallNode(
-      collection_pos,
-      new(Z) LoadLocalNode(collection_pos, iterator_var),
-      Symbols::MoveNext(),
-      no_args);
+  AstNode* iterator_moveNext = new (Z) InstanceCallNode(
+      collection_pos, new (Z) LoadLocalNode(collection_pos, iterator_var),
+      Symbols::MoveNext(), no_args);
 
   // Parse the for loop body. Ideally, we would use ParseNestedStatement()
   // here, but that does not work well because we have to insert an implicit
@@ -9417,9 +9054,9 @@
   current_block_->scope->AddLabel(label);
   const TokenPosition loop_var_assignment_pos = TokenPos();
 
-  AstNode* iterator_current = new(Z) InstanceGetterNode(
+  AstNode* iterator_current = new (Z) InstanceGetterNode(
       loop_var_assignment_pos,
-      new(Z) LoadLocalNode(loop_var_assignment_pos, iterator_var),
+      new (Z) LoadLocalNode(loop_var_assignment_pos, iterator_var),
       Symbols::Current());
 
   // Generate assignment of next iterator value to loop variable.
@@ -9427,24 +9064,21 @@
   if (new_loop_var) {
     // The for loop variable is new for each iteration.
     // Create a variable and add it to the loop body scope.
-    LocalVariable* loop_var =
-       new(Z) LocalVariable(loop_var_assignment_pos,
-                            *loop_var_name,
-                            loop_var_type);;
+    LocalVariable* loop_var = new (Z) LocalVariable(
+        loop_var_pos, loop_var_assignment_pos, *loop_var_name, loop_var_type);
     if (loop_var_is_final) {
       loop_var->set_is_final();
     }
     current_block_->scope->AddVariable(loop_var);
-    loop_var_assignment = new(Z) StoreLocalNode(
-        loop_var_assignment_pos, loop_var, iterator_current);
+    loop_var_assignment = new (Z)
+        StoreLocalNode(loop_var_assignment_pos, loop_var, iterator_current);
   } else {
     AstNode* loop_var_primary =
         ResolveIdent(loop_var_pos, *loop_var_name, false);
     ASSERT(!loop_var_primary->IsPrimaryNode());
-    loop_var_assignment = CreateAssignmentNode(loop_var_primary,
-                                               iterator_current,
-                                               loop_var_name,
-                                               loop_var_assignment_pos);
+    loop_var_assignment =
+        CreateAssignmentNode(loop_var_primary, iterator_current, loop_var_name,
+                             loop_var_assignment_pos);
     ASSERT(loop_var_assignment != NULL);
   }
   current_block_->statements->Add(loop_var_assignment);
@@ -9463,8 +9097,8 @@
 
   SequenceNode* for_loop_statement = CloseBlock();
 
-  AstNode* while_statement = new(Z) WhileNode(
-      forin_pos, label, iterator_moveNext, NULL, for_loop_statement);
+  AstNode* while_statement = new (Z)
+      WhileNode(forin_pos, label, iterator_moveNext, NULL, for_loop_statement);
   current_block_->statements->Add(while_statement);
 
   return CloseBlock();  // Implicit block around while loop.
@@ -9497,8 +9131,8 @@
   AstNode* condition = NULL;
   SequenceNode* condition_preamble = NULL;
   if (CurrentToken() != Token::kSEMICOLON) {
-    condition = ParseAwaitableExpr(
-        kAllowConst, kConsumeCascades, &condition_preamble);
+    condition =
+        ParseAwaitableExpr(kAllowConst, kConsumeCascades, &condition_preamble);
   }
   ExpectSemicolon();
   AstNode* increment = NULL;
@@ -9507,7 +9141,7 @@
     increment = ParseAwaitableExprList();
   }
   ExpectToken(Token::kRPAREN);
-  const bool parsing_loop_body =  true;
+  const bool parsing_loop_body = true;
   SequenceNode* body = ParseNestedStatement(parsing_loop_body, label);
 
   // Check whether any of the variables in the initializer part of
@@ -9517,8 +9151,8 @@
   for (int i = 0; i < init_scope->num_variables(); i++) {
     if (init_scope->VariableAt(i)->is_captured() &&
         (init_scope->VariableAt(i)->owner() == init_scope)) {
-      SequenceNode* incr_sequence = new(Z) SequenceNode(incr_pos, NULL);
-      incr_sequence->Add(new(Z) CloneContextNode(for_pos));
+      SequenceNode* incr_sequence = new (Z) SequenceNode(incr_pos, NULL);
+      incr_sequence->Add(new (Z) CloneContextNode(for_pos));
       if (increment != NULL) {
         incr_sequence->Add(increment);
       }
@@ -9526,14 +9160,10 @@
       break;
     }
   }
-  AstNode* for_node = new(Z) ForNode(
-      for_pos,
-      label,
-      NodeAsSequenceNode(init_pos, initializer, NULL),
-      condition,
-      condition_preamble,
-      NodeAsSequenceNode(incr_pos, increment, NULL),
-      body);
+  AstNode* for_node = new (Z)
+      ForNode(for_pos, label, NodeAsSequenceNode(init_pos, initializer, NULL),
+              condition, condition_preamble,
+              NodeAsSequenceNode(incr_pos, increment, NULL), body);
   current_block_->statements->Add(for_node);
   return CloseBlock();
 }
@@ -9545,13 +9175,11 @@
                                 ArgumentListNode* arguments) {
   const Class& cls = Class::Handle(Z, Library::LookupCoreClass(cls_name));
   ASSERT(!cls.IsNull());
-  const Function& func = Function::ZoneHandle(Z,
-      Resolver::ResolveStatic(cls,
-                              func_name,
-                              arguments->length(),
-                              arguments->names()));
+  const Function& func = Function::ZoneHandle(
+      Z, Resolver::ResolveStatic(cls, func_name, arguments->length(),
+                                 arguments->names()));
   ASSERT(!func.IsNull());
-  return new(Z) StaticCallNode(arguments->token_pos(), func, arguments);
+  return new (Z) StaticCallNode(arguments->token_pos(), func, arguments);
 }
 
 
@@ -9573,13 +9201,16 @@
   const TokenPosition condition_end = TokenPos();
   ExpectToken(Token::kRPAREN);
 
-  ArgumentListNode* arguments = new(Z) ArgumentListNode(condition_pos);
+  ArgumentListNode* arguments = new (Z) ArgumentListNode(condition_pos);
   arguments->Add(condition);
-  arguments->Add(new(Z) LiteralNode(condition_pos,
+  arguments->Add(new (Z) LiteralNode(
+      condition_pos,
       Integer::ZoneHandle(Z, Integer::New(condition_pos.value(), Heap::kOld))));
-  arguments->Add(new(Z) LiteralNode(condition_end,
+  arguments->Add(new (Z) LiteralNode(
+      condition_end,
       Integer::ZoneHandle(Z, Integer::New(condition_end.value(), Heap::kOld))));
-  AstNode* assert_throw = MakeStaticCall(Symbols::AssertionError(),
+  AstNode* assert_throw = MakeStaticCall(
+      Symbols::AssertionError(),
       Library::PrivateCoreLibName(is_const ? Symbols::CheckConstAssertion()
                                            : Symbols::CheckAssertion()),
       arguments);
@@ -9593,20 +9224,18 @@
                                    CatchParamDesc* stack_trace_param,
                                    LocalScope* scope) {
   if (exception_param->name != NULL) {
-    LocalVariable* var = new(Z) LocalVariable(
-        exception_param->token_pos,
-        *exception_param->name,
-        *exception_param->type);
+    LocalVariable* var = new (Z)
+        LocalVariable(exception_param->token_pos, exception_param->token_pos,
+                      *exception_param->name, *exception_param->type);
     var->set_is_final();
     bool added_to_scope = scope->AddVariable(var);
     ASSERT(added_to_scope);
     exception_param->var = var;
   }
   if (stack_trace_param->name != NULL) {
-    LocalVariable* var = new(Z) LocalVariable(
-        stack_trace_param->token_pos,
-        *stack_trace_param->name,
-        *stack_trace_param->type);
+    LocalVariable* var = new (Z) LocalVariable(
+        stack_trace_param->token_pos, stack_trace_param->token_pos,
+        *stack_trace_param->name, *stack_trace_param->type);
     var->set_is_final();
     bool added_to_scope = scope->AddVariable(var);
     if (!added_to_scope) {
@@ -9638,17 +9267,15 @@
 
   ASSERT(saved_exception_var != NULL);
   ASSERT(exception_var != NULL);
-  statements->Add(new(Z) StoreLocalNode(
-      TokenPosition::kNoSource,
-      saved_exception_var,
-      new(Z) LoadLocalNode(TokenPosition::kNoSource, exception_var)));
+  statements->Add(new (Z) StoreLocalNode(
+      TokenPosition::kNoSource, saved_exception_var,
+      new (Z) LoadLocalNode(TokenPosition::kNoSource, exception_var)));
 
   ASSERT(saved_stack_trace_var != NULL);
   ASSERT(stack_trace_var != NULL);
-  statements->Add(new(Z) StoreLocalNode(
-      TokenPosition::kNoSource,
-      saved_stack_trace_var,
-      new(Z) LoadLocalNode(TokenPosition::kNoSource, stack_trace_var)));
+  statements->Add(new (Z) StoreLocalNode(
+      TokenPosition::kNoSource, saved_stack_trace_var,
+      new (Z) LoadLocalNode(TokenPosition::kNoSource, stack_trace_var)));
 }
 
 
@@ -9687,24 +9314,20 @@
       if (scope->function_level() == current_block_->scope->function_level()) {
         LocalVariable* saved_try_ctx =
             LookupSavedTryContextVar(scope->parent());
-        LocalVariable* async_saved_try_ctx = LookupAsyncSavedTryContextVar(T,
-            async_temp_scope_, try_stack_->try_index());
-        current_block_->statements->Add(
-            new (Z) StoreLocalNode(
-                TokenPosition::kNoSource,
-                saved_try_ctx,
-                new (Z) LoadLocalNode(TokenPosition::kNoSource,
-                                      async_saved_try_ctx)));
+        LocalVariable* async_saved_try_ctx = LookupAsyncSavedTryContextVar(
+            T, async_temp_scope_, try_stack_->try_index());
+        current_block_->statements->Add(new (Z) StoreLocalNode(
+            TokenPosition::kNoSource, saved_try_ctx,
+            new (Z)
+                LoadLocalNode(TokenPosition::kNoSource, async_saved_try_ctx)));
       }
     }
     // We need to save the exception variables as in catch clauses, whether
     // there is an outer try or not. Note that this is only necessary if the
     // finally clause contains an await or yield.
     // TODO(hausner): Optimize.
-    SaveExceptionAndStacktrace(current_block_->statements,
-                               exception_var,
-                               stack_trace_var,
-                               rethrow_exception_var,
+    SaveExceptionAndStacktrace(current_block_->statements, exception_var,
+                               stack_trace_var, rethrow_exception_var,
                                rethrow_stack_trace_var);
   }
 
@@ -9722,7 +9345,7 @@
 
 void Parser::PushTry(Block* try_block) {
   intptr_t try_index = AllocateTryIndex();
-  try_stack_ = new(Z) TryStack(try_block, try_stack_, try_index);
+  try_stack_ = new (Z) TryStack(try_block, try_stack_, try_index);
 }
 
 
@@ -9741,7 +9364,7 @@
   const intptr_t func_level = FunctionLevel();
   TryStack* iterator = try_stack_;
   while ((iterator != NULL) &&
-      (iterator->try_block()->scope->function_level() == func_level)) {
+         (iterator->try_block()->scope->function_level() == func_level)) {
     // For continue and break node check if the target label is in scope.
     if (node->IsJumpNode()) {
       SourceLabel* label = node->AsJumpNode()->label();
@@ -9822,8 +9445,8 @@
     CatchParamDesc stack_trace_param;
     if (IsSymbol(Symbols::On())) {
       ConsumeToken();
-      exception_param.type = &AbstractType::ZoneHandle(Z,
-          ParseType(ClassFinalizer::kCanonicalize));
+      exception_param.type = &AbstractType::ZoneHandle(
+          Z, ParseType(ClassFinalizer::kCanonicalize));
     } else {
       exception_param.type = &Object::dynamic_type();
     }
@@ -9856,9 +9479,9 @@
       // Generate code to load the exception object (:exception_var) into
       // the exception variable specified in this block.
       ASSERT(exception_var != NULL);
-      current_block_->statements->Add(new(Z) StoreLocalNode(
-          catch_pos, exception_param.var, new(Z) LoadLocalNode(
-              catch_pos, exception_var)));
+      current_block_->statements->Add(new (Z) StoreLocalNode(
+          catch_pos, exception_param.var,
+          new (Z) LoadLocalNode(catch_pos, exception_var)));
     }
     if (stack_trace_param.var != NULL) {
       // A stack trace variable is specified in this block, so generate code
@@ -9866,9 +9489,9 @@
       // trace variable specified in this block.
       *needs_stack_trace = true;
       ASSERT(stack_trace_var != NULL);
-      current_block_->statements->Add(new(Z) StoreLocalNode(
-          catch_pos, stack_trace_param.var, new(Z) LoadLocalNode(
-              catch_pos, stack_trace_var)));
+      current_block_->statements->Add(new (Z) StoreLocalNode(
+          catch_pos, stack_trace_param.var,
+          new (Z) LoadLocalNode(catch_pos, stack_trace_var)));
     }
 
     // Add nested block with user-defined code.  This block allows
@@ -9878,18 +9501,17 @@
     current_block_->statements->Add(ParseNestedStatement(false, NULL));
     catch_blocks.Add(CloseBlock());
 
-    const bool is_bad_type =
-        exception_param.type->IsMalformed() ||
-        exception_param.type->IsMalbounded();
+    const bool is_bad_type = exception_param.type->IsMalformed() ||
+                             exception_param.type->IsMalbounded();
     if (exception_param.type->IsDynamicType() || is_bad_type) {
       // There is no exception type or else it is malformed or malbounded.
       // In the first case, unconditionally execute the catch body.  In the
       // second case, unconditionally throw.
       generic_catch_seen = true;
-      type_tests.Add(new(Z) LiteralNode(catch_pos, Bool::True()));
+      type_tests.Add(new (Z) LiteralNode(catch_pos, Bool::True()));
       if (is_bad_type) {
         // Replace the body with one that throws.
-        SequenceNode* block = new(Z) SequenceNode(catch_pos, NULL);
+        SequenceNode* block = new (Z) SequenceNode(catch_pos, NULL);
         block->Add(ThrowTypeError(catch_pos, *exception_param.type));
         catch_blocks.Last() = block;
       }
@@ -9900,20 +9522,19 @@
     } else {
       // Has a type specification that is not malformed or malbounded.  Now
       // form an 'if type check' to guard the catch handler code.
-      if (!exception_param.type->IsInstantiated() &&
-          (FunctionLevel() > 0)) {
+      if (!exception_param.type->IsInstantiated() && (FunctionLevel() > 0)) {
         // Make sure that the instantiator is captured.
         CaptureInstantiator();
       }
-      TypeNode* exception_type = new(Z) TypeNode(
-          catch_pos, *exception_param.type);
-      AstNode* exception_value = new(Z) LoadLocalNode(
-          catch_pos, exception_var);
+      TypeNode* exception_type =
+          new (Z) TypeNode(catch_pos, *exception_param.type);
+      AstNode* exception_value =
+          new (Z) LoadLocalNode(catch_pos, exception_var);
       if (!exception_type->type().IsInstantiated()) {
         EnsureExpressionTemp();
       }
-      type_tests.Add(new(Z) ComparisonNode(
-          catch_pos, Token::kIS, exception_value, exception_type));
+      type_tests.Add(new (Z) ComparisonNode(catch_pos, Token::kIS,
+                                            exception_value, exception_type));
 
       // Do not add uninstantiated types (e.g. type parameter T or generic
       // type List<T>), since the debugger won't be able to instantiate it
@@ -9943,11 +9564,10 @@
     // An await cannot possibly be executed inbetween the catch entry and here,
     // therefore, it is safe to rethrow the stack-based :exception_var instead
     // of the captured copy :saved_exception_var.
-    current = new(Z) SequenceNode(handler_pos, NULL);
-    current->Add(new(Z) ThrowNode(
-        handler_pos,
-        new(Z) LoadLocalNode(handler_pos, exception_var),
-        new(Z) LoadLocalNode(handler_pos, stack_trace_var)));
+    current = new (Z) SequenceNode(handler_pos, NULL);
+    current->Add(new (Z) ThrowNode(
+        handler_pos, new (Z) LoadLocalNode(handler_pos, exception_var),
+        new (Z) LoadLocalNode(handler_pos, stack_trace_var)));
   } else if (type_tests.Last()->IsLiteralNode()) {
     ASSERT(type_tests.Last()->AsLiteralNode()->literal().raw() ==
            Bool::True().raw());
@@ -9964,7 +9584,7 @@
   while (!type_tests.is_empty()) {
     AstNode* type_test = type_tests.RemoveLast();
     SequenceNode* catch_block = catch_blocks.RemoveLast();
-    current_block_->statements->Add(new(Z) IfNode(
+    current_block_->statements->Add(new (Z) IfNode(
         type_test->token_pos(), type_test, catch_block, current));
     current = CloseBlock();
   }
@@ -9972,28 +9592,23 @@
   // the catch clauses.
   if (is_async && (current != NULL)) {
     ASSERT(try_stack_ != NULL);
-    SequenceNode* async_code = new(Z) SequenceNode(handler_pos, NULL);
+    SequenceNode* async_code = new (Z) SequenceNode(handler_pos, NULL);
     const TryStack* try_block = try_stack_->outer_try();
     if (try_block != NULL) {
       LocalScope* scope = try_block->try_block()->scope;
       if (scope->function_level() == current_block_->scope->function_level()) {
         LocalVariable* saved_try_ctx =
             LookupSavedTryContextVar(scope->parent());
-        LocalVariable* async_saved_try_ctx = LookupAsyncSavedTryContextVar(T,
-            async_temp_scope_, try_block->try_index());
-        async_code->Add(
-            new (Z) StoreLocalNode(
-                TokenPosition::kNoSource,
-                saved_try_ctx,
-                new (Z) LoadLocalNode(TokenPosition::kNoSource,
-                                      async_saved_try_ctx)));
+        LocalVariable* async_saved_try_ctx = LookupAsyncSavedTryContextVar(
+            T, async_temp_scope_, try_block->try_index());
+        async_code->Add(new (Z) StoreLocalNode(
+            TokenPosition::kNoSource, saved_try_ctx,
+            new (Z)
+                LoadLocalNode(TokenPosition::kNoSource, async_saved_try_ctx)));
       }
     }
-    SaveExceptionAndStacktrace(async_code,
-                               exception_var,
-                               stack_trace_var,
-                               rethrow_exception_var,
-                               rethrow_stack_trace_var);
+    SaveExceptionAndStacktrace(async_code, exception_var, stack_trace_var,
+                               rethrow_exception_var, rethrow_stack_trace_var);
     // The async_code node sequence contains code to restore the context (if
     // an outer try block is present) and code to save the exception and
     // stack trace variables.
@@ -10007,22 +9622,19 @@
 
 
 void Parser::SetupSavedTryContext(LocalVariable* saved_try_context) {
-  const String& async_saved_try_ctx_name = String::ZoneHandle(Z,
-      Symbols::NewFormatted(T,
-                            "%s%d",
-                            Symbols::AsyncSavedTryCtxVarPrefix().ToCString(),
-                            last_used_try_index_ - 1));
-  LocalVariable* async_saved_try_ctx = new (Z) LocalVariable(
-      TokenPosition::kNoSource,
-      async_saved_try_ctx_name,
-      Object::dynamic_type());
+  const String& async_saved_try_ctx_name = String::ZoneHandle(
+      Z, Symbols::NewFormatted(T, "%s%d",
+                               Symbols::AsyncSavedTryCtxVarPrefix().ToCString(),
+                               last_used_try_index_ - 1));
+  LocalVariable* async_saved_try_ctx =
+      new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource,
+                            async_saved_try_ctx_name, Object::dynamic_type());
   ASSERT(async_temp_scope_ != NULL);
   async_temp_scope_->AddVariable(async_saved_try_ctx);
   ASSERT(saved_try_context != NULL);
-  current_block_->statements->Add(new(Z) StoreLocalNode(
-      TokenPosition::kNoSource,
-      async_saved_try_ctx,
-      new(Z) LoadLocalNode(TokenPosition::kNoSource, saved_try_context)));
+  current_block_->statements->Add(new (Z) StoreLocalNode(
+      TokenPosition::kNoSource, async_saved_try_ctx,
+      new (Z) LoadLocalNode(TokenPosition::kNoSource, saved_try_context)));
 }
 
 
@@ -10053,45 +9665,40 @@
   // Consecutive try statements share the same set of variables.
   *context_var = try_scope->LocalLookupVariable(Symbols::SavedTryContextVar());
   if (*context_var == NULL) {
-    *context_var = new(Z) LocalVariable(
-        TokenPos(),
-        Symbols::SavedTryContextVar(),
-        Object::dynamic_type());
+    *context_var = new (Z)
+        LocalVariable(TokenPos(), TokenPos(), Symbols::SavedTryContextVar(),
+                      Object::dynamic_type());
     try_scope->AddVariable(*context_var);
   }
   *exception_var = try_scope->LocalLookupVariable(Symbols::ExceptionVar());
   if (*exception_var == NULL) {
-    *exception_var = new(Z) LocalVariable(
-        TokenPos(),
-        Symbols::ExceptionVar(),
-        Object::dynamic_type());
+    *exception_var =
+        new (Z) LocalVariable(TokenPos(), TokenPos(), Symbols::ExceptionVar(),
+                              Object::dynamic_type());
     try_scope->AddVariable(*exception_var);
   }
   *stack_trace_var = try_scope->LocalLookupVariable(Symbols::StackTraceVar());
   if (*stack_trace_var == NULL) {
-    *stack_trace_var = new(Z) LocalVariable(
-        TokenPos(),
-        Symbols::StackTraceVar(),
-        Object::dynamic_type());
+    *stack_trace_var =
+        new (Z) LocalVariable(TokenPos(), TokenPos(), Symbols::StackTraceVar(),
+                              Object::dynamic_type());
     try_scope->AddVariable(*stack_trace_var);
   }
   if (is_async) {
-    *saved_exception_var = try_scope->LocalLookupVariable(
-        Symbols::SavedExceptionVar());
+    *saved_exception_var =
+        try_scope->LocalLookupVariable(Symbols::SavedExceptionVar());
     if (*saved_exception_var == NULL) {
-      *saved_exception_var = new(Z) LocalVariable(
-          TokenPos(),
-          Symbols::SavedExceptionVar(),
-          Object::dynamic_type());
+      *saved_exception_var = new (Z)
+          LocalVariable(TokenPos(), TokenPos(), Symbols::SavedExceptionVar(),
+                        Object::dynamic_type());
       try_scope->AddVariable(*saved_exception_var);
     }
-    *saved_stack_trace_var = try_scope->LocalLookupVariable(
-        Symbols::SavedStackTraceVar());
+    *saved_stack_trace_var =
+        try_scope->LocalLookupVariable(Symbols::SavedStackTraceVar());
     if (*saved_stack_trace_var == NULL) {
-      *saved_stack_trace_var = new(Z) LocalVariable(
-          TokenPos(),
-          Symbols::SavedStackTraceVar(),
-          Object::dynamic_type());
+      *saved_stack_trace_var = new (Z)
+          LocalVariable(TokenPos(), TokenPos(), Symbols::SavedStackTraceVar(),
+                        Object::dynamic_type());
       try_scope->AddVariable(*saved_stack_trace_var);
     }
   }
@@ -10120,13 +9727,9 @@
   LocalVariable* stack_trace_var = NULL;
   LocalVariable* saved_exception_var = NULL;
   LocalVariable* saved_stack_trace_var = NULL;
-  SetupExceptionVariables(current_block_->scope,
-                          is_async,
-                          &context_var,
-                          &exception_var,
-                          &stack_trace_var,
-                          &saved_exception_var,
-                          &saved_stack_trace_var);
+  SetupExceptionVariables(current_block_->scope, is_async, &context_var,
+                          &exception_var, &stack_trace_var,
+                          &saved_exception_var, &saved_stack_trace_var);
 
   ConsumeToken();  // Consume the 'try'.
 
@@ -10155,20 +9758,17 @@
       GrowableObjectArray::Handle(Z, GrowableObjectArray::New(Heap::kOld));
   bool needs_stack_trace = false;
   SequenceNode* catch_handler_list =
-      ParseCatchClauses(handler_pos,
-                        is_async,
-                        exception_var,
-                        stack_trace_var,
+      ParseCatchClauses(handler_pos, is_async, exception_var, stack_trace_var,
                         is_async ? saved_exception_var : exception_var,
                         is_async ? saved_stack_trace_var : stack_trace_var,
-                        handler_types,
-                        &needs_stack_trace);
+                        handler_types, &needs_stack_trace);
 
   TryStack* try_statement = PopTry();
   const intptr_t try_index = try_statement->try_index();
   TryStack* outer_try = try_stack_;
-  const intptr_t outer_try_index = (outer_try != NULL) ?
-      outer_try->try_index() : CatchClauseNode::kInvalidTryIndex;
+  const intptr_t outer_try_index = (outer_try != NULL)
+                                       ? outer_try->try_index()
+                                       : CatchClauseNode::kInvalidTryIndex;
 
   // Finally, parse or generate the 'finally' clause.
   // A finally clause is required in async code to restore the saved try context
@@ -10187,28 +9787,20 @@
     AstNode* node_to_inline = try_statement->GetNodeToInlineFinally(node_index);
     while (node_to_inline != NULL) {
       finally_clause = EnsureFinallyClause(
-          parse,
-          is_async,
-          exception_var,
-          stack_trace_var,
+          parse, is_async, exception_var, stack_trace_var,
           is_async ? saved_exception_var : exception_var,
           is_async ? saved_stack_trace_var : stack_trace_var);
-      InlinedFinallyNode* node = new(Z) InlinedFinallyNode(finally_pos,
-                                                           finally_clause,
-                                                           context_var,
-                                                           outer_try_index);
+      InlinedFinallyNode* node = new (Z) InlinedFinallyNode(
+          finally_pos, finally_clause, context_var, outer_try_index);
       AddFinallyClauseToNode(is_async, node_to_inline, node);
       node_index += 1;
       node_to_inline = try_statement->GetNodeToInlineFinally(node_index);
       tokens_iterator_.SetCurrentPosition(finally_pos);
     }
-    finally_clause = EnsureFinallyClause(
-        parse,
-        is_async,
-        exception_var,
-        stack_trace_var,
-        is_async ? saved_exception_var : exception_var,
-        is_async ? saved_stack_trace_var : stack_trace_var);
+    finally_clause =
+        EnsureFinallyClause(parse, is_async, exception_var, stack_trace_var,
+                            is_async ? saved_exception_var : exception_var,
+                            is_async ? saved_stack_trace_var : stack_trace_var);
     if (finally_clause != NULL) {
       // Re-parse to create a duplicate of finally clause to avoid unintended
       // sharing of try-indices if the finally-block contains a try-catch.
@@ -10217,34 +9809,28 @@
       // non-exception case (see EffectGraphVisitor::VisitTryCatchNode)
       tokens_iterator_.SetCurrentPosition(finally_pos);
       rethrow_clause = EnsureFinallyClause(
-          parse,
-          is_async,
-          exception_var,
-          stack_trace_var,
+          parse, is_async, exception_var, stack_trace_var,
           is_async ? saved_exception_var : exception_var,
           is_async ? saved_stack_trace_var : stack_trace_var);
     }
   }
 
-  CatchClauseNode* catch_clause = new(Z) CatchClauseNode(
-      handler_pos,
-      catch_handler_list,
-      Array::ZoneHandle(Z, Array::MakeArray(handler_types)),
-      context_var,
-      exception_var,
-      stack_trace_var,
+  CatchClauseNode* catch_clause = new (Z) CatchClauseNode(
+      handler_pos, catch_handler_list,
+      Array::ZoneHandle(Z, Array::MakeArray(handler_types)), context_var,
+      exception_var, stack_trace_var,
       is_async ? saved_exception_var : exception_var,
       is_async ? saved_stack_trace_var : stack_trace_var,
-      (finally_clause != NULL) ?
-          AllocateTryIndex() : CatchClauseNode::kInvalidTryIndex,
+      (finally_clause != NULL) ? AllocateTryIndex()
+                               : CatchClauseNode::kInvalidTryIndex,
       needs_stack_trace);
 
   // Now create the try/catch ast node and return it. If there is a label
   // on the try/catch, close the block that's embedding the try statement
   // and attach the label to it.
-  AstNode* try_catch_node = new(Z) TryCatchNode(
-      try_pos, try_block, context_var, catch_clause, finally_clause, try_index,
-      rethrow_clause);
+  AstNode* try_catch_node =
+      new (Z) TryCatchNode(try_pos, try_block, context_var, catch_clause,
+                           finally_clause, try_index, rethrow_clause);
 
   if (try_label != NULL) {
     current_block_->statements->Add(try_catch_node);
@@ -10286,8 +9872,8 @@
       LocalScope* switch_scope = current_block_->scope->LookupSwitchScope();
       if (switch_scope != NULL) {
         // We found a switch scope. Enter a forward reference to the label.
-        target = new(Z) SourceLabel(
-            TokenPos(), target_name, SourceLabel::kForward);
+        target =
+            new (Z) SourceLabel(TokenPos(), target_name, SourceLabel::kForward);
         switch_scope->AddLabel(target);
       }
     }
@@ -10297,7 +9883,7 @@
   } else if (FLAG_enable_debug_break && (CurrentToken() == Token::kSTRING)) {
     const char* message = strdup(CurrentLiteral()->ToCString());
     ConsumeToken();
-    return new(Z) StopNode(jump_pos, message);
+    return new (Z) StopNode(jump_pos, message);
   } else {
     target = current_block_->scope->LookupInnermostLabel(jump_kind);
     if (target == NULL) {
@@ -10320,7 +9906,7 @@
     ReportError(jump_pos, "'%s' target must be in same function context",
                 Token::Str(jump_kind));
   }
-  return new(Z) JumpNode(jump_pos, jump_kind, target);
+  return new (Z) JumpNode(jump_pos, jump_kind, target);
 }
 
 
@@ -10341,7 +9927,7 @@
 
   AstNode* expr = ParseAwaitableExpr(kAllowConst, kConsumeCascades, NULL);
 
-  LetNode* yield = new(Z) LetNode(yield_pos);
+  LetNode* yield = new (Z) LetNode(yield_pos);
   if (innermost_function().IsSyncGenerator() ||
       innermost_function().IsSyncGenClosure()) {
     // Yield statement in sync* function.
@@ -10351,31 +9937,25 @@
     ASSERT(iterator_param != NULL);
     // Generate :iterator.current = expr;
     AstNode* iterator =
-        new(Z) LoadLocalNode(TokenPosition::kNoSource, iterator_param);
-    AstNode* store_current =
-        new(Z) InstanceSetterNode(TokenPosition::kNoSource,
-                                  iterator,
-                                  Library::PrivateCoreLibName(
-                                      Symbols::_current()),
-                                  expr);
+        new (Z) LoadLocalNode(TokenPosition::kNoSource, iterator_param);
+    AstNode* store_current = new (Z) InstanceSetterNode(
+        TokenPosition::kNoSource, iterator,
+        Library::PrivateCoreLibName(Symbols::_current()), expr);
     yield->AddNode(store_current);
     if (is_yield_each) {
       // Generate :iterator.isYieldEach = true;
-      AstNode* set_is_yield_each =
-          new(Z) InstanceSetterNode(TokenPosition::kNoSource,
-              iterator,
-              String::ZoneHandle(Symbols::IsYieldEach().raw()),
-              new(Z) LiteralNode(TokenPos(), Bool::True()));
+      AstNode* set_is_yield_each = new (Z)
+          InstanceSetterNode(TokenPosition::kNoSource, iterator,
+                             String::ZoneHandle(Symbols::IsYieldEach().raw()),
+                             new (Z) LiteralNode(TokenPos(), Bool::True()));
       yield->AddNode(set_is_yield_each);
     }
-    AwaitMarkerNode* await_marker =
-        new(Z) AwaitMarkerNode(async_temp_scope_,
-                               current_block_->scope,
-                               TokenPosition::kNoSource);
+    AwaitMarkerNode* await_marker = new (Z) AwaitMarkerNode(
+        async_temp_scope_, current_block_->scope, TokenPosition::kNoSource);
     yield->AddNode(await_marker);
     // Return true to indicate that a value has been generated.
-    ReturnNode* return_true = new(Z) ReturnNode(yield_pos,
-        new(Z) LiteralNode(TokenPos(), Bool::True()));
+    ReturnNode* return_true = new (Z)
+        ReturnNode(yield_pos, new (Z) LiteralNode(TokenPos(), Bool::True()));
     return_true->set_return_type(ReturnNode::kContinuationTarget);
     yield->AddNode(return_true);
 
@@ -10386,20 +9966,16 @@
     LocalVariable* async_saved_try_ctx;
     LocalVariable* outer_saved_try_ctx;
     LocalVariable* outer_async_saved_try_ctx;
-    CheckAsyncOpInTryBlock(&saved_try_ctx,
-                           &async_saved_try_ctx,
-                           &outer_saved_try_ctx,
-                           &outer_async_saved_try_ctx);
+    CheckAsyncOpInTryBlock(&saved_try_ctx, &async_saved_try_ctx,
+                           &outer_saved_try_ctx, &outer_async_saved_try_ctx);
     if (saved_try_ctx != NULL) {
       yield->AddNode(new (Z) StoreLocalNode(
-          TokenPosition::kNoSource,
-          saved_try_ctx,
-          new (Z) LoadLocalNode(TokenPosition::kNoSource,
-                                async_saved_try_ctx)));
+          TokenPosition::kNoSource, saved_try_ctx,
+          new (Z)
+              LoadLocalNode(TokenPosition::kNoSource, async_saved_try_ctx)));
       if (outer_saved_try_ctx != NULL) {
         yield->AddNode(new (Z) StoreLocalNode(
-            TokenPosition::kNoSource,
-            outer_saved_try_ctx,
+            TokenPosition::kNoSource, outer_saved_try_ctx,
             new (Z) LoadLocalNode(TokenPosition::kNoSource,
                                   outer_async_saved_try_ctx)));
       }
@@ -10414,13 +9990,12 @@
     LocalVariable* controller_var = LookupLocalScope(Symbols::Controller());
     ASSERT(controller_var != NULL);
     // :controller.add[Stream](expr);
-    ArgumentListNode* add_args = new(Z) ArgumentListNode(yield_pos);
+    ArgumentListNode* add_args = new (Z) ArgumentListNode(yield_pos);
     add_args->Add(expr);
-    AstNode* add_call =
-        new(Z) InstanceCallNode(yield_pos,
-            new(Z) LoadLocalNode(TokenPosition::kNoSource, controller_var),
-            is_yield_each ? Symbols::AddStream() : Symbols::add(),
-            add_args);
+    AstNode* add_call = new (Z) InstanceCallNode(
+        yield_pos,
+        new (Z) LoadLocalNode(TokenPosition::kNoSource, controller_var),
+        is_yield_each ? Symbols::AddStream() : Symbols::add(), add_args);
 
     // if (:controller.add[Stream](expr)) {
     //   return;
@@ -10430,20 +10005,18 @@
     // restore saved_try_context
 
     SequenceNode* true_branch =
-        new(Z) SequenceNode(TokenPosition::kNoSource, NULL);
-    AstNode* return_from_generator = new(Z) ReturnNode(yield_pos);
+        new (Z) SequenceNode(TokenPosition::kNoSource, NULL);
+    AstNode* return_from_generator = new (Z) ReturnNode(yield_pos);
     true_branch->Add(return_from_generator);
     AddNodeForFinallyInlining(return_from_generator);
     AstNode* if_is_cancelled =
-       new(Z) IfNode(TokenPosition::kNoSource, add_call, true_branch, NULL);
+        new (Z) IfNode(TokenPosition::kNoSource, add_call, true_branch, NULL);
     yield->AddNode(if_is_cancelled);
 
-    AwaitMarkerNode* await_marker =
-        new(Z) AwaitMarkerNode(async_temp_scope_,
-                               current_block_->scope,
-                               TokenPosition::kNoSource);
+    AwaitMarkerNode* await_marker = new (Z) AwaitMarkerNode(
+        async_temp_scope_, current_block_->scope, TokenPosition::kNoSource);
     yield->AddNode(await_marker);
-    ReturnNode* continuation_return = new(Z) ReturnNode(yield_pos);
+    ReturnNode* continuation_return = new (Z) ReturnNode(yield_pos);
     continuation_return->set_return_type(ReturnNode::kContinuationTarget);
     yield->AddNode(continuation_return);
 
@@ -10454,20 +10027,16 @@
     LocalVariable* async_saved_try_ctx;
     LocalVariable* outer_saved_try_ctx;
     LocalVariable* outer_async_saved_try_ctx;
-    CheckAsyncOpInTryBlock(&saved_try_ctx,
-                           &async_saved_try_ctx,
-                           &outer_saved_try_ctx,
-                           &outer_async_saved_try_ctx);
+    CheckAsyncOpInTryBlock(&saved_try_ctx, &async_saved_try_ctx,
+                           &outer_saved_try_ctx, &outer_async_saved_try_ctx);
     if (saved_try_ctx != NULL) {
       yield->AddNode(new (Z) StoreLocalNode(
-          TokenPosition::kNoSource,
-          saved_try_ctx,
-          new (Z) LoadLocalNode(TokenPosition::kNoSource,
-                                async_saved_try_ctx)));
+          TokenPosition::kNoSource, saved_try_ctx,
+          new (Z)
+              LoadLocalNode(TokenPosition::kNoSource, async_saved_try_ctx)));
       if (outer_saved_try_ctx != NULL) {
         yield->AddNode(new (Z) StoreLocalNode(
-            TokenPosition::kNoSource,
-            outer_saved_try_ctx,
+            TokenPosition::kNoSource, outer_saved_try_ctx,
             new (Z) LoadLocalNode(TokenPosition::kNoSource,
                                   outer_async_saved_try_ctx)));
       }
@@ -10520,7 +10089,7 @@
         ReportError(expr_pos,
                     "return of a value is not allowed in constructors");
       } else if (current_function().IsGeneratorClosure() &&
-          (function_level == 0)) {
+                 (function_level == 0)) {
         ReportError(expr_pos, "generator functions may not return a value");
       }
       AstNode* expr = ParseAwaitableExpr(kAllowConst, kConsumeCascades, NULL);
@@ -10544,46 +10113,37 @@
           if (!result_type_args.IsNull() && (result_type_args.Length() == 1)) {
             const AbstractType& result_type_arg =
                 AbstractType::ZoneHandle(Z, result_type_args.TypeAt(0));
-            LetNode* checked_expr = new(Z) LetNode(expr_pos);
+            LetNode* checked_expr = new (Z) LetNode(expr_pos);
             LocalVariable* temp = checked_expr->AddInitializer(expr);
             temp->set_is_final();
             const AbstractType& future_type =
                 AbstractType::ZoneHandle(Z, future_class.RareType());
-            AstNode* is_future = new(Z) LoadLocalNode(expr_pos, temp);
-            is_future = new(Z) ComparisonNode(expr_pos,
-                                              Token::kIS,
-                                              is_future,
-                                              new(Z) TypeNode(expr_pos,
-                                                              future_type));
-            AstNode* as_future_t = new(Z) LoadLocalNode(expr_pos, temp);
-            as_future_t = new(Z) AssignableNode(expr_pos,
-                                                as_future_t,
-                                                result_type,
-                                                Symbols::FunctionResult());
-            AstNode* as_t = new(Z) LoadLocalNode(expr_pos, temp);
-            as_t = new(Z) AssignableNode(expr_pos,
-                                         as_t,
-                                         result_type_arg,
-                                         Symbols::FunctionResult());
-            checked_expr->AddNode(new(Z) ConditionalExprNode(expr_pos,
-                                                             is_future,
-                                                             as_future_t,
-                                                             as_t));
+            AstNode* is_future = new (Z) LoadLocalNode(expr_pos, temp);
+            is_future =
+                new (Z) ComparisonNode(expr_pos, Token::kIS, is_future,
+                                       new (Z) TypeNode(expr_pos, future_type));
+            AstNode* as_future_t = new (Z) LoadLocalNode(expr_pos, temp);
+            as_future_t = new (Z) AssignableNode(
+                expr_pos, as_future_t, result_type, Symbols::FunctionResult());
+            AstNode* as_t = new (Z) LoadLocalNode(expr_pos, temp);
+            as_t = new (Z) AssignableNode(expr_pos, as_t, result_type_arg,
+                                          Symbols::FunctionResult());
+            checked_expr->AddNode(new (Z) ConditionalExprNode(
+                expr_pos, is_future, as_future_t, as_t));
             expr = checked_expr;
           }
         }
       }
-      statement = new(Z) ReturnNode(statement_pos, expr);
+      statement = new (Z) ReturnNode(statement_pos, expr);
     } else {
-      if (current_function().IsSyncGenClosure() &&
-          (FunctionLevel() == 0)) {
+      if (current_function().IsSyncGenClosure() && (FunctionLevel() == 0)) {
         // In a synchronous generator, return without an expression
         // returns false, signaling that the iterator terminates and
         // did not yield a value.
-        statement = new(Z) ReturnNode(statement_pos,
-            new(Z) LiteralNode(return_pos, Bool::False()));
+        statement = new (Z) ReturnNode(
+            statement_pos, new (Z) LiteralNode(return_pos, Bool::False()));
       } else {
-        statement = new(Z) ReturnNode(statement_pos);
+        statement = new (Z) ReturnNode(statement_pos);
       }
     }
     AddNodeForFinallyInlining(statement);
@@ -10665,10 +10225,9 @@
     ASSERT(excp_var != NULL);
     ASSERT(trace_var != NULL);
 
-    statement = new(Z) ThrowNode(
-        statement_pos,
-        new(Z) LoadLocalNode(statement_pos, excp_var),
-        new(Z) LoadLocalNode(statement_pos, trace_var));
+    statement = new (Z)
+        ThrowNode(statement_pos, new (Z) LoadLocalNode(statement_pos, excp_var),
+                  new (Z) LoadLocalNode(statement_pos, trace_var));
   } else {
     statement = ParseAwaitableExpr(kAllowConst, kConsumeCascades, NULL);
     ExpectSemicolon();
@@ -10684,8 +10243,10 @@
 
 
 void Parser::ReportErrors(const Error& prev_error,
-                          const Script& script, TokenPosition token_pos,
-                          const char* format, ...) {
+                          const Script& script,
+                          TokenPosition token_pos,
+                          const char* format,
+                          ...) {
   va_list args;
   va_start(args, format);
   Report::LongJumpV(prev_error, script, token_pos, format, args);
@@ -10695,11 +10256,12 @@
 
 
 void Parser::ReportError(TokenPosition token_pos,
-                         const char* format, ...) const {
+                         const char* format,
+                         ...) const {
   va_list args;
   va_start(args, format);
-  Report::MessageV(Report::kError,
-                   script_, token_pos, Report::AtLocation, format, args);
+  Report::MessageV(Report::kError, script_, token_pos, Report::AtLocation,
+                   format, args);
   va_end(args);
   UNREACHABLE();
 }
@@ -10708,9 +10270,8 @@
 void Parser::ReportErrorBefore(const char* format, ...) {
   va_list args;
   va_start(args, format);
-  Report::MessageV(Report::kError,
-                   script_, PrevTokenPos(), Report::AfterLocation,
-                   format, args);
+  Report::MessageV(Report::kError, script_, PrevTokenPos(),
+                   Report::AfterLocation, format, args);
   va_end(args);
   UNREACHABLE();
 }
@@ -10719,19 +10280,20 @@
 void Parser::ReportError(const char* format, ...) const {
   va_list args;
   va_start(args, format);
-  Report::MessageV(Report::kError,
-                   script_, TokenPos(), Report::AtLocation, format, args);
+  Report::MessageV(Report::kError, script_, TokenPos(), Report::AtLocation,
+                   format, args);
   va_end(args);
   UNREACHABLE();
 }
 
 
 void Parser::ReportWarning(TokenPosition token_pos,
-                           const char* format, ...) const {
+                           const char* format,
+                           ...) const {
   va_list args;
   va_start(args, format);
-  Report::MessageV(Report::kWarning,
-                   script_, token_pos, Report::AtLocation, format, args);
+  Report::MessageV(Report::kWarning, script_, token_pos, Report::AtLocation,
+                   format, args);
   va_end(args);
 }
 
@@ -10739,8 +10301,8 @@
 void Parser::ReportWarning(const char* format, ...) const {
   va_list args;
   va_start(args, format);
-  Report::MessageV(Report::kWarning,
-                   script_, TokenPos(), Report::AtLocation, format, args);
+  Report::MessageV(Report::kWarning, script_, TokenPos(), Report::AtLocation,
+                   format, args);
   va_end(args);
 }
 
@@ -10773,9 +10335,9 @@
 
 
 void Parser::UnexpectedToken() {
-  ReportError("unexpected token '%s'",
-              CurrentToken() == Token::kIDENT ?
-                  CurrentLiteral()->ToCString() : Token::Str(CurrentToken()));
+  ReportError("unexpected token '%s'", CurrentToken() == Token::kIDENT
+                                           ? CurrentLiteral()->ToCString()
+                                           : Token::Str(CurrentToken()));
 }
 
 
@@ -10805,13 +10367,13 @@
 
 bool Parser::IsAwaitKeyword() {
   return (FLAG_await_is_keyword || await_is_keyword_) &&
-      IsSymbol(Symbols::Await());
+         IsSymbol(Symbols::Await());
 }
 
 
 bool Parser::IsYieldKeyword() {
   return (FLAG_await_is_keyword || await_is_keyword_) &&
-      IsSymbol(Symbols::YieldKw());
+         IsSymbol(Symbols::YieldKw());
 }
 
 
@@ -10821,8 +10383,7 @@
 
 
 static bool IsPrefixOperator(Token::Kind token) {
-  return (token == Token::kSUB) ||
-         (token == Token::kNOT) ||
+  return (token == Token::kSUB) || (token == Token::kNOT) ||
          (token == Token::kBIT_NOT);
 }
 
@@ -10845,28 +10406,28 @@
 AstNode* Parser::ThrowTypeError(TokenPosition type_pos,
                                 const AbstractType& type,
                                 LibraryPrefix* prefix) {
-  ArgumentListNode* arguments = new(Z) ArgumentListNode(type_pos);
+  ArgumentListNode* arguments = new (Z) ArgumentListNode(type_pos);
 
   String& method_name = String::Handle(Z);
   if (prefix == NULL) {
     method_name = Library::PrivateCoreLibName(Symbols::ThrowNew()).raw();
   } else {
-    arguments->Add(new(Z) LiteralNode(type_pos, *prefix));
-    method_name = Library::PrivateCoreLibName(
-        Symbols::ThrowNewIfNotLoaded()).raw();
+    arguments->Add(new (Z) LiteralNode(type_pos, *prefix));
+    method_name =
+        Library::PrivateCoreLibName(Symbols::ThrowNewIfNotLoaded()).raw();
   }
   // Location argument.
-  arguments->Add(new(Z) LiteralNode(
-      type_pos, Integer::ZoneHandle(Z, Integer::New(type_pos.value(),
-                                                    Heap::kOld))));
+  arguments->Add(new (Z) LiteralNode(
+      type_pos,
+      Integer::ZoneHandle(Z, Integer::New(type_pos.value(), Heap::kOld))));
   // Src value argument.
-  arguments->Add(new(Z) LiteralNode(type_pos, Object::null_instance()));
+  arguments->Add(new (Z) LiteralNode(type_pos, Object::null_instance()));
   // Dst type argument.
-  arguments->Add(new(Z) LiteralNode(type_pos, type));
+  arguments->Add(new (Z) LiteralNode(type_pos, type));
   // Dst name argument.
-  arguments->Add(new(Z) LiteralNode(type_pos, Symbols::Empty()));
+  arguments->Add(new (Z) LiteralNode(type_pos, Symbols::Empty()));
   // Bound error msg argument.
-  arguments->Add(new(Z) LiteralNode(type_pos, Object::null_instance()));
+  arguments->Add(new (Z) LiteralNode(type_pos, Object::null_instance()));
   return MakeStaticCall(Symbols::TypeError(), method_name, arguments);
 }
 
@@ -10880,31 +10441,31 @@
                                         InvocationMirror::Type im_type,
                                         const Function* func,
                                         const LibraryPrefix* prefix) {
-  ArgumentListNode* arguments = new(Z) ArgumentListNode(call_pos);
+  ArgumentListNode* arguments = new (Z) ArgumentListNode(call_pos);
 
   String& method_name = String::Handle(Z);
   if (prefix == NULL) {
     method_name = Library::PrivateCoreLibName(Symbols::ThrowNew()).raw();
   } else {
-    arguments->Add(new(Z) LiteralNode(call_pos, *prefix));
-    method_name = Library::PrivateCoreLibName(
-        Symbols::ThrowNewIfNotLoaded()).raw();
+    arguments->Add(new (Z) LiteralNode(call_pos, *prefix));
+    method_name =
+        Library::PrivateCoreLibName(Symbols::ThrowNewIfNotLoaded()).raw();
   }
   // Object receiver.
   // If the function is external and dynamic, pass the actual receiver,
   // otherwise, pass a class literal of the unresolved method's owner.
-  if ((func != NULL) && !func->IsNull() &&
-      func->is_external() && !func->is_static()) {
+  if ((func != NULL) && !func->IsNull() && func->is_external() &&
+      !func->is_static()) {
     arguments->Add(LoadReceiver(func->token_pos()));
   } else {
     AbstractType& type = AbstractType::ZoneHandle(Z);
     type ^= Type::New(cls, TypeArguments::Handle(Z), call_pos, Heap::kOld);
-    type ^= ClassFinalizer::FinalizeType(
-        current_class(), type, ClassFinalizer::kCanonicalize);
-    arguments->Add(new(Z) LiteralNode(call_pos, type));
+    type ^= ClassFinalizer::FinalizeType(current_class(), type,
+                                         ClassFinalizer::kCanonicalize);
+    arguments->Add(new (Z) LiteralNode(call_pos, type));
   }
   // String memberName.
-  arguments->Add(new(Z) LiteralNode(
+  arguments->Add(new (Z) LiteralNode(
       call_pos, String::ZoneHandle(Z, Symbols::New(T, function_name))));
   // Smi invocation_type.
   if (cls.IsTopLevel()) {
@@ -10912,23 +10473,23 @@
            im_call == InvocationMirror::kTopLevel);
     im_call = InvocationMirror::kTopLevel;
   }
-  arguments->Add(new(Z) LiteralNode(call_pos, Smi::ZoneHandle(Z,
-      Smi::New(InvocationMirror::EncodeType(im_call, im_type)))));
+  arguments->Add(new (Z) LiteralNode(
+      call_pos, Smi::ZoneHandle(Z, Smi::New(InvocationMirror::EncodeType(
+                                       im_call, im_type)))));
   // List arguments.
   if (function_arguments == NULL) {
-    arguments->Add(new(Z) LiteralNode(call_pos, Object::null_array()));
+    arguments->Add(new (Z) LiteralNode(call_pos, Object::null_array()));
   } else {
-    ArrayNode* array = new(Z) ArrayNode(
-        call_pos,
-        Type::ZoneHandle(Z, Type::ArrayType()),
-        function_arguments->nodes());
+    ArrayNode* array =
+        new (Z) ArrayNode(call_pos, Type::ZoneHandle(Z, Type::ArrayType()),
+                          function_arguments->nodes());
     arguments->Add(array);
   }
   // List argumentNames.
   if (function_arguments == NULL) {
-    arguments->Add(new(Z) LiteralNode(call_pos, Object::null_array()));
+    arguments->Add(new (Z) LiteralNode(call_pos, Object::null_array()));
   } else {
-    arguments->Add(new(Z) LiteralNode(call_pos, function_arguments->names()));
+    arguments->Add(new (Z) LiteralNode(call_pos, function_arguments->names()));
   }
 
   // List existingArgumentNames.
@@ -10960,7 +10521,7 @@
     array = Array::New(1, Heap::kOld);
     array.SetAt(0, String::Handle(Z, function.UserVisibleFormalParameters()));
   }
-  arguments->Add(new(Z) LiteralNode(call_pos, array));
+  arguments->Add(new (Z) LiteralNode(call_pos, array));
 
   return MakeStaticCall(Symbols::NoSuchMethodError(), method_name, arguments);
 }
@@ -10990,39 +10551,37 @@
           op_kind = Token::kISNOT;
         }
         const TokenPosition type_pos = TokenPos();
-        const AbstractType& type = AbstractType::ZoneHandle(Z,
-            ParseType(ClassFinalizer::kCanonicalize));
+        const AbstractType& type = AbstractType::ZoneHandle(
+            Z, ParseType(ClassFinalizer::kCanonicalize));
         if (!type.IsInstantiated() && (FunctionLevel() > 0)) {
           // Make sure that the instantiator is captured.
           CaptureInstantiator();
         }
-        right_operand = new(Z) TypeNode(type_pos, type);
+        right_operand = new (Z) TypeNode(type_pos, type);
         // In production mode, the type may be malformed.
         // In checked mode, the type may be malformed or malbounded.
-        if (((op_kind == Token::kIS) || (op_kind == Token::kISNOT) ||
-             (op_kind == Token::kAS)) &&
-            type.IsMalformedOrMalbounded()) {
+        if (type.IsMalformedOrMalbounded()) {
           // Note that a type error is thrown in a type test or in
           // a type cast even if the tested value is null.
           // We need to evaluate the left operand for potential
           // side effects.
-          LetNode* let = new(Z) LetNode(left_operand->token_pos());
+          LetNode* let = new (Z) LetNode(left_operand->token_pos());
           let->AddNode(left_operand);
           let->AddNode(ThrowTypeError(type_pos, type));
           left_operand = let;
           break;  // Type checks and casts can't be chained.
         }
       }
-      if (Token::IsRelationalOperator(op_kind)
-          || Token::IsTypeTestOperator(op_kind)
-          || Token::IsTypeCastOperator(op_kind)
-          || Token::IsEqualityOperator(op_kind)) {
-        left_operand = new(Z) ComparisonNode(
-            op_pos, op_kind, left_operand, right_operand);
+      if (Token::IsRelationalOperator(op_kind) ||
+          Token::IsTypeTestOperator(op_kind) ||
+          Token::IsTypeCastOperator(op_kind) ||
+          Token::IsEqualityOperator(op_kind)) {
+        left_operand = new (Z)
+            ComparisonNode(op_pos, op_kind, left_operand, right_operand);
         break;  // Equality and relational operators cannot be chained.
       } else {
-        left_operand = OptimizeBinaryOpNode(
-            op_pos, op_kind, left_operand, right_operand);
+        left_operand =
+            OptimizeBinaryOpNode(op_pos, op_kind, left_operand, right_operand);
       }
     }
     current_preced--;
@@ -11034,21 +10593,21 @@
 AstNode* Parser::ParseAwaitableExprList() {
   TRACE_PARSER("ParseAwaitableExprList");
   SequenceNode* preamble = NULL;
-  AstNode* expressions = ParseAwaitableExpr(
-      kAllowConst, kConsumeCascades, &preamble);
+  AstNode* expressions =
+      ParseAwaitableExpr(kAllowConst, kConsumeCascades, &preamble);
   if (preamble != NULL) {
     preamble->Add(expressions);
     expressions = preamble;
   }
   if (CurrentToken() == Token::kCOMMA) {
     // Collect comma-separated expressions in a non scope owning sequence node.
-    SequenceNode* list = new(Z) SequenceNode(TokenPos(), NULL);
+    SequenceNode* list = new (Z) SequenceNode(TokenPos(), NULL);
     list->Add(expressions);
     while (CurrentToken() == Token::kCOMMA) {
       ConsumeToken();
       preamble = NULL;
-      AstNode* expr = ParseAwaitableExpr(
-          kAllowConst, kConsumeCascades, &preamble);
+      AstNode* expr =
+          ParseAwaitableExpr(kAllowConst, kConsumeCascades, &preamble);
       if (preamble != NULL) {
         list->Add(preamble);
       }
@@ -11070,9 +10629,8 @@
                                                const char* s) {
   char name[64];
   OS::SNPrint(name, 64, ":%s%" Pd "", s, token_pos.value());
-  LocalVariable* temp = new(Z) LocalVariable(
-      token_pos,
-      String::ZoneHandle(Z, Symbols::New(T, name)),
+  LocalVariable* temp = new (Z) LocalVariable(
+      token_pos, token_pos, String::ZoneHandle(Z, Symbols::New(T, name)),
       Object::dynamic_type());
   temp->set_is_final();
   current_block_->scope->AddVariable(temp);
@@ -11092,9 +10650,9 @@
       double left_double = Double::Cast(lhs_literal->literal()).value();
       double right_double = Double::Cast(rhs_literal->literal()).value();
       if (binary_op == Token::kDIV) {
-        const Double& dbl_obj = Double::ZoneHandle(Z,
-            Double::NewCanonical((left_double / right_double)));
-        return new(Z) LiteralNode(op_pos, dbl_obj);
+        const Double& dbl_obj = Double::ZoneHandle(
+            Z, Double::NewCanonical((left_double / right_double)));
+        return new (Z) LiteralNode(op_pos, dbl_obj);
       }
     }
   }
@@ -11110,33 +10668,28 @@
   if (binary_op == Token::kIFNULL) {
     // Handle a ?? b.
     if ((lhs->EvalConstExpr() != NULL) && (rhs->EvalConstExpr() != NULL)) {
-      Instance& expr_value = Instance::ZoneHandle(Z,
-          EvaluateConstExpr(lhs->token_pos(), lhs).raw());
+      Instance& expr_value = Instance::ZoneHandle(
+          Z, EvaluateConstExpr(lhs->token_pos(), lhs).raw());
       if (expr_value.IsNull()) {
         expr_value = EvaluateConstExpr(rhs->token_pos(), rhs).raw();
       }
-      return new(Z) LiteralNode(op_pos, expr_value);
+      return new (Z) LiteralNode(op_pos, expr_value);
     }
 
-    LetNode* result = new(Z) LetNode(op_pos);
+    LetNode* result = new (Z) LetNode(op_pos);
     LocalVariable* left_temp = result->AddInitializer(lhs);
     left_temp->set_is_final();
     const TokenPosition no_pos = TokenPosition::kNoSource;
     LiteralNode* null_operand =
-        new(Z) LiteralNode(no_pos, Object::null_instance());
-    LoadLocalNode* load_left_temp = new(Z) LoadLocalNode(no_pos, left_temp);
-    ComparisonNode* null_compare =
-        new(Z) ComparisonNode(no_pos,
-                              Token::kNE_STRICT,
-                              load_left_temp,
-                              null_operand);
-    result->AddNode(new(Z) ConditionalExprNode(op_pos,
-                                               null_compare,
-                                               load_left_temp,
-                                               rhs));
+        new (Z) LiteralNode(no_pos, Object::null_instance());
+    LoadLocalNode* load_left_temp = new (Z) LoadLocalNode(no_pos, left_temp);
+    ComparisonNode* null_compare = new (Z)
+        ComparisonNode(no_pos, Token::kNE_STRICT, load_left_temp, null_operand);
+    result->AddNode(
+        new (Z) ConditionalExprNode(op_pos, null_compare, load_left_temp, rhs));
     return result;
   }
-  return new(Z) BinaryOpNode(op_pos, binary_op, lhs, rhs);
+  return new (Z) BinaryOpNode(op_pos, binary_op, lhs, rhs);
 }
 
 
@@ -11149,29 +10702,29 @@
     case Token::kASSIGN:
       return rhs;
     case Token::kASSIGN_ADD:
-      return new(Z) BinaryOpNode(op_pos, Token::kADD, lhs, rhs);
+      return new (Z) BinaryOpNode(op_pos, Token::kADD, lhs, rhs);
     case Token::kASSIGN_SUB:
-      return new(Z) BinaryOpNode(op_pos, Token::kSUB, lhs, rhs);
+      return new (Z) BinaryOpNode(op_pos, Token::kSUB, lhs, rhs);
     case Token::kASSIGN_MUL:
-      return new(Z) BinaryOpNode(op_pos, Token::kMUL, lhs, rhs);
+      return new (Z) BinaryOpNode(op_pos, Token::kMUL, lhs, rhs);
     case Token::kASSIGN_TRUNCDIV:
-      return new(Z) BinaryOpNode(op_pos, Token::kTRUNCDIV, lhs, rhs);
+      return new (Z) BinaryOpNode(op_pos, Token::kTRUNCDIV, lhs, rhs);
     case Token::kASSIGN_DIV:
-      return new(Z) BinaryOpNode(op_pos, Token::kDIV, lhs, rhs);
+      return new (Z) BinaryOpNode(op_pos, Token::kDIV, lhs, rhs);
     case Token::kASSIGN_MOD:
-      return new(Z) BinaryOpNode(op_pos, Token::kMOD, lhs, rhs);
+      return new (Z) BinaryOpNode(op_pos, Token::kMOD, lhs, rhs);
     case Token::kASSIGN_SHR:
-      return new(Z) BinaryOpNode(op_pos, Token::kSHR, lhs, rhs);
+      return new (Z) BinaryOpNode(op_pos, Token::kSHR, lhs, rhs);
     case Token::kASSIGN_SHL:
-      return new(Z) BinaryOpNode(op_pos, Token::kSHL, lhs, rhs);
+      return new (Z) BinaryOpNode(op_pos, Token::kSHL, lhs, rhs);
     case Token::kASSIGN_OR:
-      return new(Z) BinaryOpNode(op_pos, Token::kBIT_OR, lhs, rhs);
+      return new (Z) BinaryOpNode(op_pos, Token::kBIT_OR, lhs, rhs);
     case Token::kASSIGN_AND:
-      return new(Z) BinaryOpNode(op_pos, Token::kBIT_AND, lhs, rhs);
+      return new (Z) BinaryOpNode(op_pos, Token::kBIT_AND, lhs, rhs);
     case Token::kASSIGN_XOR:
-      return new(Z) BinaryOpNode(op_pos, Token::kBIT_XOR, lhs, rhs);
+      return new (Z) BinaryOpNode(op_pos, Token::kBIT_XOR, lhs, rhs);
     case Token::kASSIGN_COND:
-      return new(Z) BinaryOpNode(op_pos, Token::kIFNULL, lhs, rhs);
+      return new (Z) BinaryOpNode(op_pos, Token::kIFNULL, lhs, rhs);
     default:
       ReportError(op_pos,
                   "internal error: ExpandAssignableOp '%s' unimplemented",
@@ -11191,31 +10744,28 @@
   if (expr->EvalConstExpr() == NULL) {
     ReportError(expr_pos, "expression is not a valid compile-time constant");
   }
-  return new(Z) LiteralNode(expr_pos, EvaluateConstExpr(expr_pos, expr));
+  return new (Z) LiteralNode(expr_pos, EvaluateConstExpr(expr_pos, expr));
 }
 
 
 LetNode* Parser::PrepareCompoundAssignmentNodes(AstNode** expr) {
   AstNode* node = *expr;
   TokenPosition token_pos = node->token_pos();
-  LetNode* result = new(Z) LetNode(token_pos);
+  LetNode* result = new (Z) LetNode(token_pos);
   if (node->IsLoadIndexedNode()) {
     LoadIndexedNode* load_indexed = node->AsLoadIndexedNode();
     AstNode* array = load_indexed->array();
     AstNode* index = load_indexed->index_expr();
     if (!IsSimpleLocalOrLiteralNode(load_indexed->array())) {
       LocalVariable* t0 = result->AddInitializer(load_indexed->array());
-      array = new(Z) LoadLocalNode(token_pos, t0);
+      array = new (Z) LoadLocalNode(token_pos, t0);
     }
     if (!IsSimpleLocalOrLiteralNode(load_indexed->index_expr())) {
-      LocalVariable* t1 = result->AddInitializer(
-          load_indexed->index_expr());
-      index = new(Z) LoadLocalNode(token_pos, t1);
+      LocalVariable* t1 = result->AddInitializer(load_indexed->index_expr());
+      index = new (Z) LoadLocalNode(token_pos, t1);
     }
-    *expr = new(Z) LoadIndexedNode(token_pos,
-                                   array,
-                                   index,
-                                   load_indexed->super_class());
+    *expr = new (Z)
+        LoadIndexedNode(token_pos, array, index, load_indexed->super_class());
     return result;
   }
   if (node->IsInstanceGetterNode()) {
@@ -11223,9 +10773,9 @@
     AstNode* receiver = getter->receiver();
     if (!IsSimpleLocalOrLiteralNode(getter->receiver())) {
       LocalVariable* t0 = result->AddInitializer(getter->receiver());
-      receiver = new(Z) LoadLocalNode(token_pos, t0);
+      receiver = new (Z) LoadLocalNode(token_pos, t0);
     }
-    *expr = new(Z) InstanceGetterNode(
+    *expr = new (Z) InstanceGetterNode(
         token_pos, receiver, getter->field_name(), getter->is_conditional());
     return result;
   }
@@ -11268,28 +10818,25 @@
       name = Symbols::New(T, original->AsTypeNode()->TypeName());
     } else if (original->IsLoadStaticFieldNode()) {
       name = original->AsLoadStaticFieldNode()->field().name();
-      target_cls = &Class::Handle(Z,
-          original->AsLoadStaticFieldNode()->field().Owner());
+      target_cls =
+          &Class::Handle(Z, original->AsLoadStaticFieldNode()->field().Owner());
     } else if ((left_ident != NULL) &&
-               (original->IsLiteralNode() ||
-                original->IsLoadLocalNode())) {
+               (original->IsLiteralNode() || original->IsLoadLocalNode())) {
       name = left_ident->raw();
     }
     if (name.IsNull()) {
       ReportError(left_pos, "expression is not assignable");
     }
-    LetNode* let_node = new(Z) LetNode(left_pos);
-    let_node->AddInitializer(rhs);
-    let_node->AddNode(ThrowNoSuchMethodError(
-         original->token_pos(),
-         *target_cls,
-         String::Handle(Z, Field::SetterName(name)),
-         NULL,  // No arguments.
-         InvocationMirror::kStatic,
-         original->IsLoadLocalNode() ?
-         InvocationMirror::kLocalVar : InvocationMirror::kSetter,
-         NULL));  // No existing function.
-    result = let_node;
+    ArgumentListNode* error_arguments =
+        new (Z) ArgumentListNode(rhs->token_pos());
+    error_arguments->Add(rhs);
+    result = ThrowNoSuchMethodError(original->token_pos(), *target_cls,
+                                    String::Handle(Z, Field::SetterName(name)),
+                                    error_arguments, InvocationMirror::kStatic,
+                                    original->IsLoadLocalNode()
+                                        ? InvocationMirror::kLocalVar
+                                        : InvocationMirror::kSetter,
+                                    NULL);  // No existing function.
   }
   // The compound assignment operator a ??= b is different from other
   // a op= b assignments. If a is non-null, the assignment to a must be
@@ -11297,19 +10844,13 @@
   // normally: a op= b ==> a = a op b
   // however:  a ??= b ==> a ?? (a = b)
   // Therefore, we need to transform a = (a ?? b) into a ?? (a = b)
-  if (is_compound &&
-      rhs->IsBinaryOpNode() &&
+  if (is_compound && rhs->IsBinaryOpNode() &&
       (rhs->AsBinaryOpNode()->kind() == Token::kIFNULL)) {
     BinaryOpNode* ifnull = rhs->AsBinaryOpNode();
     AstNode* modified_assign =
-        CreateAssignmentNode(original,
-                             ifnull->right(),
-                             left_ident,
-                             left_pos);
-    result = OptimizeBinaryOpNode(ifnull->token_pos(),
-                                  ifnull->kind(),
-                                  ifnull->left(),
-                                  modified_assign);
+        CreateAssignmentNode(original, ifnull->right(), left_ident, left_pos);
+    result = OptimizeBinaryOpNode(ifnull->token_pos(), ifnull->kind(),
+                                  ifnull->left(), modified_assign);
   }
   return result;
 }
@@ -11317,12 +10858,12 @@
 
 AstNode* Parser::ParseCascades(AstNode* expr) {
   TokenPosition cascade_pos = TokenPos();
-  LetNode* cascade = new(Z) LetNode(cascade_pos);
+  LetNode* cascade = new (Z) LetNode(cascade_pos);
   LocalVariable* cascade_receiver_var = cascade->AddInitializer(expr);
   while (CurrentToken() == Token::kCASCADE) {
     cascade_pos = TokenPos();
     LoadLocalNode* load_cascade_receiver =
-        new(Z) LoadLocalNode(cascade_pos, cascade_receiver_var);
+        new (Z) LoadLocalNode(cascade_pos, cascade_receiver_var);
     if (Token::IsIdentifier(LookaheadToken(1))) {
       // Replace .. with . for ParseSelectors().
       token_kind_ = Token::kPERIOD;
@@ -11367,7 +10908,7 @@
   }
   // The result is an expression with the (side effects of the) cascade
   // sequence followed by the (value of the) receiver temp variable load.
-  cascade->AddNode(new(Z) LoadLocalNode(cascade_pos, cascade_receiver_var));
+  cascade->AddNode(new (Z) LoadLocalNode(cascade_pos, cascade_receiver_var));
   return cascade;
 }
 
@@ -11380,9 +10921,8 @@
         !expr->AsLoadStaticFieldNode()->is_deferred_reference()) {
       ASSERT(field.StaticValue() != Object::sentinel().raw());
       ASSERT(field.StaticValue() != Object::transition_sentinel().raw());
-      return new(zone) LiteralNode(
-          expr->token_pos(),
-          Instance::ZoneHandle(zone, field.StaticValue()));
+      return new (zone) LiteralNode(
+          expr->token_pos(), Instance::ZoneHandle(zone, field.StaticValue()));
     }
   }
   return expr;
@@ -11433,7 +10973,7 @@
       ReportError("expression expected after throw");
     }
     AstNode* expr = ParseExpr(require_compiletime_const, consume_cascades);
-    return new(Z) ThrowNode(expr_pos, expr, NULL);
+    return new (Z) ThrowNode(expr_pos, expr, NULL);
   }
 
   if (require_compiletime_const) {
@@ -11442,7 +10982,7 @@
     Instance& existing_const = Instance::ZoneHandle(Z);
     if (GetCachedConstant(expr_pos, &existing_const)) {
       SkipConditionalExpr();
-      return new(Z) LiteralNode(expr_pos, existing_const);
+      return new (Z) LiteralNode(expr_pos, existing_const);
     }
   }
 
@@ -11512,7 +11052,7 @@
     AstNode* expr1 = ParseExpr(kAllowConst, kNoCascades);
     ExpectToken(Token::kCOLON);
     AstNode* expr2 = ParseExpr(kAllowConst, kNoCascades);
-    expr = new(Z) ConditionalExprNode(expr_pos, expr, expr1, expr2);
+    expr = new (Z) ConditionalExprNode(expr_pos, expr, expr1, expr2);
   }
   return expr;
 }
@@ -11537,17 +11077,11 @@
     LocalVariable* async_saved_try_ctx;
     LocalVariable* outer_saved_try_ctx;
     LocalVariable* outer_async_saved_try_ctx;
-    CheckAsyncOpInTryBlock(&saved_try_ctx,
-                           &async_saved_try_ctx,
-                           &outer_saved_try_ctx,
-                           &outer_async_saved_try_ctx);
-    expr = new (Z) AwaitNode(op_pos,
-                             ParseUnaryExpr(),
-                             saved_try_ctx,
-                             async_saved_try_ctx,
-                             outer_saved_try_ctx,
-                             outer_async_saved_try_ctx,
-                             current_block_->scope);
+    CheckAsyncOpInTryBlock(&saved_try_ctx, &async_saved_try_ctx,
+                           &outer_saved_try_ctx, &outer_async_saved_try_ctx);
+    expr = new (Z) AwaitNode(op_pos, ParseUnaryExpr(), saved_try_ctx,
+                             async_saved_try_ctx, outer_saved_try_ctx,
+                             outer_async_saved_try_ctx, current_block_->scope);
   } else if (IsPrefixOperator(CurrentToken())) {
     Token::Kind unary_op = CurrentToken();
     if (unary_op == Token::kSUB) {
@@ -11574,11 +11108,9 @@
     LetNode* let_expr = PrepareCompoundAssignmentNodes(&expr);
     Token::Kind binary_op =
         (incr_op == Token::kINCR) ? Token::kADD : Token::kSUB;
-    BinaryOpNode* add = new(Z) BinaryOpNode(
-        op_pos,
-        binary_op,
-        expr,
-        new(Z) LiteralNode(op_pos, Smi::ZoneHandle(Z, Smi::New(1))));
+    BinaryOpNode* add = new (Z) BinaryOpNode(
+        op_pos, binary_op, expr,
+        new (Z) LiteralNode(op_pos, Smi::ZoneHandle(Z, Smi::New(1))));
     AstNode* store =
         CreateAssignmentNode(expr, add, expr_ident, expr_pos, true);
     ASSERT(store != NULL);
@@ -11592,14 +11124,14 @@
 
 
 ArgumentListNode* Parser::ParseActualParameters(
-                              ArgumentListNode* implicit_arguments,
-                              bool require_const) {
+    ArgumentListNode* implicit_arguments,
+    bool require_const) {
   TRACE_PARSER("ParseActualParameters");
   ASSERT(CurrentToken() == Token::kLPAREN);
   const bool saved_mode = SetAllowFunctionLiterals(true);
   ArgumentListNode* arguments;
   if (implicit_arguments == NULL) {
-    arguments = new(Z) ArgumentListNode(TokenPos());
+    arguments = new (Z) ArgumentListNode(TokenPos());
   } else {
     arguments = implicit_arguments;
   }
@@ -11656,11 +11188,9 @@
   ASSERT(CurrentToken() == Token::kLPAREN);
   ArgumentListNode* arguments = ParseActualParameters(NULL, kAllowConst);
   const int num_arguments = arguments->length();
-  const Function& func = Function::ZoneHandle(Z,
-      Resolver::ResolveStatic(cls,
-                              func_name,
-                              num_arguments,
-                              arguments->names()));
+  const Function& func = Function::ZoneHandle(
+      Z, Resolver::ResolveStatic(cls, func_name, num_arguments,
+                                 arguments->names()));
   if (func.IsNull()) {
     // Check if there is a static field of the same name, it could be a closure
     // and so we try and invoke the closure.
@@ -11672,17 +11202,12 @@
       const String& getter_name =
           String::ZoneHandle(Z, Field::GetterName(func_name));
       const int kNumArguments = 0;  // no arguments.
-      func = Resolver::ResolveStatic(cls,
-                                     getter_name,
-                                     kNumArguments,
+      func = Resolver::ResolveStatic(cls, getter_name, kNumArguments,
                                      Object::empty_array());
       if (!func.IsNull()) {
         ASSERT(func.kind() != RawFunction::kImplicitStaticFinalGetter);
-        closure = new(Z) StaticGetterNode(
-            call_pos,
-            NULL,
-            Class::ZoneHandle(Z, cls.raw()),
-            func_name);
+        closure = new (Z) StaticGetterNode(
+            call_pos, NULL, Class::ZoneHandle(Z, cls.raw()), func_name);
         return BuildClosureCall(call_pos, closure, arguments);
       }
     } else {
@@ -11690,16 +11215,12 @@
       return BuildClosureCall(call_pos, closure, arguments);
     }
     // Could not resolve static method: throw a NoSuchMethodError.
-    return ThrowNoSuchMethodError(ident_pos,
-                                  cls,
-                                  func_name,
-                                  arguments,
+    return ThrowNoSuchMethodError(ident_pos, cls, func_name, arguments,
                                   InvocationMirror::kStatic,
                                   InvocationMirror::kMethod,
                                   NULL);  // No existing function.
-  } else if (cls.IsTopLevel() &&
-      (cls.library() == Library::CoreLibrary()) &&
-      (func.name() == Symbols::Identical().raw())) {
+  } else if (cls.IsTopLevel() && (cls.library() == Library::CoreLibrary()) &&
+             (func.name() == Symbols::Identical().raw())) {
     // This is the predefined toplevel function identical(a,b).
     // Create a comparison node instead of a static call to the function.
     ASSERT(num_arguments == 2);
@@ -11715,20 +11236,18 @@
       AstNode* arg1 = arguments->NodeAt(1);
       const Instance* val1 = arg1->EvalConstExpr();
       if ((val1 != NULL) && (val1->IsString())) {
-        arguments->SetNodeAt(0,
-            new(Z) LiteralNode(arg0->token_pos(),
-                               EvaluateConstExpr(arg0->token_pos(), arg0)));
-        arguments->SetNodeAt(1,
-            new(Z) LiteralNode(arg1->token_pos(),
-                               EvaluateConstExpr(arg1->token_pos(), arg1)));
+        arguments->SetNodeAt(
+            0, new (Z) LiteralNode(arg0->token_pos(),
+                                   EvaluateConstExpr(arg0->token_pos(), arg0)));
+        arguments->SetNodeAt(
+            1, new (Z) LiteralNode(arg1->token_pos(),
+                                   EvaluateConstExpr(arg1->token_pos(), arg1)));
       }
     }
-    return new(Z) ComparisonNode(ident_pos,
-                                 Token::kEQ_STRICT,
-                                 arguments->NodeAt(0),
-                                 arguments->NodeAt(1));
+    return new (Z) ComparisonNode(ident_pos, Token::kEQ_STRICT,
+                                  arguments->NodeAt(0), arguments->NodeAt(1));
   }
-  return new(Z) StaticCallNode(ident_pos, func, arguments);
+  return new (Z) StaticCallNode(ident_pos, func, arguments);
 }
 
 
@@ -11739,11 +11258,8 @@
   TRACE_PARSER("ParseInstanceCall");
   CheckToken(Token::kLPAREN);
   ArgumentListNode* arguments = ParseActualParameters(NULL, kAllowConst);
-  return new(Z) InstanceCallNode(ident_pos,
-                                 receiver,
-                                 func_name,
-                                 arguments,
-                                 is_conditional);
+  return new (Z) InstanceCallNode(ident_pos, receiver, func_name, arguments,
+                                  is_conditional);
 }
 
 
@@ -11772,18 +11288,17 @@
   const String& field_name = String::ZoneHandle(Z, field.name());
   const String& getter_name =
       String::Handle(Z, Field::GetterSymbol(field_name));
-  const Function& getter = Function::Handle(Z,
-      field_owner.LookupStaticFunction(getter_name));
+  const Function& getter =
+      Function::Handle(Z, field_owner.LookupStaticFunction(getter_name));
   // Never load field directly if there is a getter (deterministic AST).
   if (getter.IsNull() || field.is_const()) {
-    return new(Z) LoadStaticFieldNode(
-        ident_pos, Field::ZoneHandle(Z, field.raw()));
+    return new (Z)
+        LoadStaticFieldNode(ident_pos, Field::ZoneHandle(Z, field.raw()));
   } else {
     ASSERT(getter.kind() == RawFunction::kImplicitStaticFinalGetter);
-    return new(Z) StaticGetterNode(ident_pos,
-                                   NULL,  // Receiver.
-                                   field_owner,
-                                   field_name);
+    return new (Z) StaticGetterNode(ident_pos,
+                                    NULL,  // Receiver.
+                                    field_owner, field_name);
   }
 }
 
@@ -11810,14 +11325,12 @@
         // Create a getter call, which may later be turned into
         // a setter call, or else the backend will generate
         // a throw NoSuchMethodError().
-        access = new(Z) StaticGetterNode(ident_pos,
-                                         NULL,
-                                         Class::ZoneHandle(Z, cls.raw()),
-                                         field_name);
+        access = new (Z) StaticGetterNode(
+            ident_pos, NULL, Class::ZoneHandle(Z, cls.raw()), field_name);
       }
     } else {
       ASSERT(func.kind() != RawFunction::kImplicitStaticFinalGetter);
-      access = new(Z) StaticGetterNode(
+      access = new (Z) StaticGetterNode(
           ident_pos, NULL, Class::ZoneHandle(Z, cls.raw()), field_name);
     }
   } else {
@@ -11844,11 +11357,10 @@
         String::Cast(Object::ZoneHandle(primary->primary().raw()));
     if (current_function().is_static() ||
         current_function().IsInFactoryScope()) {
-      StaticGetterNode* getter = new(Z) StaticGetterNode(
-          primary->token_pos(),
-          NULL,  // No receiver.
-          Class::ZoneHandle(Z, current_class().raw()),
-          name);
+      StaticGetterNode* getter = new (Z)
+          StaticGetterNode(primary->token_pos(),
+                           NULL,  // No receiver.
+                           Class::ZoneHandle(Z, current_class().raw()), name);
       getter->set_is_deferred(primary->is_deferred_reference());
       return getter;
     } else {
@@ -11908,21 +11420,15 @@
     type_parameter ^= ClassFinalizer::FinalizeType(
         current_class(), type_parameter, ClassFinalizer::kCanonicalize);
     ASSERT(!type_parameter.IsMalformed());
-    return new(Z) TypeNode(primary_pos, type_parameter);
+    return new (Z) TypeNode(primary_pos, type_parameter);
   } else {
     ASSERT(type_parameter.IsFunctionTypeParameter());
     // TODO(regis): Verify that CaptureFunctionInstantiator() was already
     // called if necessary.
     // TODO(regis): Finalize type parameter and return as type node.
-    // For now, throw a type error.
-    Type& malformed_type = Type::ZoneHandle(Z);
-    malformed_type = ClassFinalizer::NewFinalizedMalformedType(
-        Error::Handle(Z),  // No previous error.
-        script_,
-        primary_pos,
-        "function type parameter '%s' not yet supported",
-        String::Handle(Z, type_parameter.name()).ToCString());
-    return ThrowTypeError(primary_pos, malformed_type);
+    // For now, map to dynamic type.
+    Type& type = Type::ZoneHandle(Z, Type::DynamicType());
+    return new (Z) TypeNode(primary_pos, type);
   }
 }
 
@@ -11986,10 +11492,8 @@
         }
         if (cls.IsNull()) {
           // Instance field access.
-          selector = new(Z) InstanceGetterNode(ident_pos,
-                                               left,
-                                               *ident,
-                                               is_conditional);
+          selector = new (Z)
+              InstanceGetterNode(ident_pos, left, *ident, is_conditional);
         } else {
           // Static field access.
           selector = GenerateStaticFieldAccess(cls, *ident, ident_pos);
@@ -12020,22 +11524,22 @@
           array = LoadClosure(primary_node);
         } else if (primary_node->primary().IsClass()) {
           const Class& type_class = Class::Cast(primary_node->primary());
-          AbstractType& type = Type::ZoneHandle(Z,
-              Type::New(type_class, TypeArguments::Handle(Z),
-                        primary_pos, Heap::kOld));
-          type ^= ClassFinalizer::FinalizeType(
-              current_class(), type, ClassFinalizer::kCanonicalize);
+          AbstractType& type = Type::ZoneHandle(
+              Z, Type::New(type_class, TypeArguments::Handle(Z), primary_pos,
+                           Heap::kOld));
+          type ^= ClassFinalizer::FinalizeType(current_class(), type,
+                                               ClassFinalizer::kCanonicalize);
           // Type may be malbounded, but not malformed.
           ASSERT(!type.IsMalformed());
-          array = new(Z) TypeNode(primary_pos, type);
+          array = new (Z) TypeNode(primary_pos, type);
         } else if (primary_node->primary().IsTypeParameter()) {
           array = LoadTypeParameter(primary_node);
         } else {
           UNREACHABLE();  // Internal parser error.
         }
       }
-      selector =  new(Z) LoadIndexedNode(
-          bracket_pos, array, index, Class::ZoneHandle(Z));
+      selector = new (Z)
+          LoadIndexedNode(bracket_pos, array, index, Class::ZoneHandle(Z));
     } else if (IsArgumentPart()) {
       if (CurrentToken() == Token::kLT) {
         // Type arguments.
@@ -12064,10 +11568,9 @@
                           "from static function",
                           func_name.ToCString());
             }
-            selector = ParseInstanceCall(LoadReceiver(primary_pos),
-                                         func_name,
-                                         primary_pos,
-                                         false /* is_conditional */);
+            selector =
+                ParseInstanceCall(LoadReceiver(primary_pos), func_name,
+                                  primary_pos, false /* is_conditional */);
           }
         } else if (primary_node->primary().IsString()) {
           // Primary is an unresolved name.
@@ -12081,10 +11584,9 @@
             selector = ParseStaticCall(current_class(), name, primary_pos);
           } else {
             // Treat as call to unresolved (instance) method.
-            selector = ParseInstanceCall(LoadReceiver(primary_pos),
-                                         name,
-                                         primary_pos,
-                                         false /* is_conditional */);
+            selector =
+                ParseInstanceCall(LoadReceiver(primary_pos), name, primary_pos,
+                                  false /* is_conditional */);
           }
         } else if (primary_node->primary().IsTypeParameter()) {
           TypeParameter& type_parameter = TypeParameter::ZoneHandle(Z);
@@ -12092,17 +11594,16 @@
           const String& name = String::ZoneHandle(Z, type_parameter.name());
           if (type_parameter.IsClassTypeParameter()) {
             if (ParsingStaticMember()) {
-                // Treat as this.T(), because T is in scope.
-                ReportError(primary_pos,
-                            "cannot access type parameter '%s' "
-                            "from static function",
-                            name.ToCString());
+              // Treat as this.T(), because T is in scope.
+              ReportError(primary_pos,
+                          "cannot access type parameter '%s' "
+                          "from static function",
+                          name.ToCString());
             } else {
               // Treat as call to unresolved (instance) method.
-              selector = ParseInstanceCall(LoadReceiver(primary_pos),
-                                           name,
-                                           primary_pos,
-                                           false /* is_conditional */);
+              selector =
+                  ParseInstanceCall(LoadReceiver(primary_pos), name,
+                                    primary_pos, false /* is_conditional */);
             }
           } else {
             ASSERT(type_parameter.IsFunctionTypeParameter());
@@ -12113,13 +11614,14 @@
           }
         } else if (primary_node->primary().IsClass()) {
           const Class& type_class = Class::Cast(primary_node->primary());
-          AbstractType& type = Type::ZoneHandle(Z, Type::New(
-              type_class, TypeArguments::Handle(Z), primary_pos, Heap::kOld));
-          type ^= ClassFinalizer::FinalizeType(
-              current_class(), type, ClassFinalizer::kCanonicalize);
+          AbstractType& type = Type::ZoneHandle(
+              Z, Type::New(type_class, TypeArguments::Handle(Z), primary_pos,
+                           Heap::kOld));
+          type ^= ClassFinalizer::FinalizeType(current_class(), type,
+                                               ClassFinalizer::kCanonicalize);
           // Type may be malbounded, but not malformed.
           ASSERT(!type.IsMalformed());
-          selector = new(Z) TypeNode(primary_pos, type);
+          selector = new (Z) TypeNode(primary_pos, type);
         } else {
           UNREACHABLE();  // Internal parser error.
         }
@@ -12139,13 +11641,14 @@
           left = LoadClosure(primary_node);
         } else if (primary_node->primary().IsClass()) {
           const Class& type_class = Class::Cast(primary_node->primary());
-          AbstractType& type = Type::ZoneHandle(Z, Type::New(
-              type_class, TypeArguments::Handle(Z), primary_pos, Heap::kOld));
-          type = ClassFinalizer::FinalizeType(
-              current_class(), type, ClassFinalizer::kCanonicalize);
+          AbstractType& type = Type::ZoneHandle(
+              Z, Type::New(type_class, TypeArguments::Handle(Z), primary_pos,
+                           Heap::kOld));
+          type = ClassFinalizer::FinalizeType(current_class(), type,
+                                              ClassFinalizer::kCanonicalize);
           // Type may be malbounded, but not malformed.
           ASSERT(!type.IsMalformed());
-          left = new(Z) TypeNode(primary_pos, type);
+          left = new (Z) TypeNode(primary_pos, type);
         } else if (primary_node->primary().IsTypeParameter()) {
           left = LoadTypeParameter(primary_node);
         } else if (primary_node->IsSuper()) {
@@ -12167,6 +11670,11 @@
 
 // Closurization e#m of getter, setter, method or operator.
 AstNode* Parser::ParseClosurization(AstNode* primary) {
+  if (FLAG_warn_new_tearoff_syntax) {
+    ReportWarning(
+        "Tear-offs using the x#id syntax is a deprecated feature,"
+        "it will not be supported in the next release");
+  }
   ExpectToken(Token::kHASH);
   TokenPosition property_pos = TokenPos();
   bool is_setter_name = false;
@@ -12215,7 +11723,8 @@
         obj = prefix.LookupObject(extractor_name);
       }
     }
-    if (!prefix.is_loaded() && (parsed_function() != NULL)) {
+    if (!prefix.is_loaded() && (parsed_function() != NULL) &&
+        !FLAG_load_deferred_eagerly) {
       // Remember that this function depends on an import prefix of an
       // unloaded deferred library.
       parsed_function()->AddDeferredPrefix(prefix);
@@ -12230,22 +11739,19 @@
       const Field& field = Field::Cast(obj);
       if (is_setter_name && !field.is_final()) {
         Instance& setter_closure = Instance::ZoneHandle(field.SetterClosure());
-        return new(Z) LiteralNode(property_pos, setter_closure);
+        return new (Z) LiteralNode(property_pos, setter_closure);
       }
       if (!is_setter_name) {
         Instance& getter_closure = Instance::ZoneHandle(field.GetterClosure());
-        return new(Z) LiteralNode(property_pos, getter_closure);
+        return new (Z) LiteralNode(property_pos, getter_closure);
       }
     }
-    return ThrowNoSuchMethodError(property_pos,
-                                  current_class(),
-                                  extractor_name,
-                                  NULL,  // No arguments.
-                                  InvocationMirror::kTopLevel,
-                                  is_setter_name
-                                      ? InvocationMirror::kSetter
-                                      : InvocationMirror::kMethod,
-                                  NULL);  // No existing function.
+    return ThrowNoSuchMethodError(
+        property_pos, current_class(), extractor_name,
+        NULL,  // No arguments.
+        InvocationMirror::kTopLevel,
+        is_setter_name ? InvocationMirror::kSetter : InvocationMirror::kMethod,
+        NULL);  // No existing function.
   }
 
   // Handle closurization of static properties of classes, C#n.
@@ -12264,13 +11770,13 @@
           // Note: the created closure is cached after it's created
           // once. If eager compilation is desired, the compiler can
           // be invoked here. The same applies for getters below.
-          return new(Z) LiteralNode(property_pos, setter_closure);
+          return new (Z) LiteralNode(property_pos, setter_closure);
         }
       } else {
         const Instance& getter_closure =
             Instance::ZoneHandle(Z, field.GetterClosure());
         ASSERT(getter_closure.IsClosure());
-        return new(Z) LiteralNode(property_pos, getter_closure);
+        return new (Z) LiteralNode(property_pos, getter_closure);
       }
     } else {
       Function& func = Function::Handle(Z);
@@ -12289,15 +11795,12 @@
         return CreateImplicitClosureNode(func, property_pos, NULL);
       }
     }
-    return ThrowNoSuchMethodError(property_pos,
-                                  cls,
-                                  extractor_name,
-                                  NULL,  // No arguments.
-                                  InvocationMirror::kStatic,
-                                  is_setter_name
-                                      ? InvocationMirror::kSetter
-                                      : InvocationMirror::kMethod,
-                                  NULL);  // No existing function.
+    return ThrowNoSuchMethodError(
+        property_pos, cls, extractor_name,
+        NULL,  // No arguments.
+        InvocationMirror::kStatic,
+        is_setter_name ? InvocationMirror::kSetter : InvocationMirror::kMethod,
+        NULL);  // No existing function.
   }
 
   // Closurization of instance getter, setter, method or operator.
@@ -12308,7 +11811,7 @@
   }
   pieces.Add(extractor_name);
   extractor_name = Symbols::FromConcatAll(T, pieces);
-  return new(Z) InstanceGetterNode(property_pos, primary, extractor_name);
+  return new (Z) InstanceGetterNode(property_pos, primary, extractor_name);
 }
 
 
@@ -12337,18 +11840,16 @@
     LocalVariable* temp = let_expr->AddInitializer(expr);
     Token::Kind binary_op =
         (incr_op == Token::kINCR) ? Token::kADD : Token::kSUB;
-    BinaryOpNode* add = new(Z) BinaryOpNode(
-        op_pos,
-        binary_op,
-        new(Z) LoadLocalNode(op_pos, temp),
-        new(Z) LiteralNode(op_pos, Smi::ZoneHandle(Z, Smi::New(1))));
+    BinaryOpNode* add = new (Z) BinaryOpNode(
+        op_pos, binary_op, new (Z) LoadLocalNode(op_pos, temp),
+        new (Z) LiteralNode(op_pos, Smi::ZoneHandle(Z, Smi::New(1))));
     AstNode* store =
         CreateAssignmentNode(expr, add, expr_ident, expr_pos, true);
     ASSERT(store != NULL);
     // The result is a pair of the (side effects of the) store followed by
     // the (value of the) initial value temp variable load.
     let_expr->AddNode(store);
-    let_expr->AddNode(new(Z) LoadLocalNode(op_pos, temp));
+    let_expr->AddNode(new (Z) LoadLocalNode(op_pos, temp));
     return let_expr;
   }
   return expr;
@@ -12374,38 +11875,30 @@
     const String& unresolved_class_name =
         String::Handle(Z, unresolved_class.ident());
     Class& resolved_type_class = Class::Handle(Z);
-    if (unresolved_class.library_prefix() == LibraryPrefix::null()) {
+    if (unresolved_class.library_or_library_prefix() == Object::null()) {
       // First check if the type is a function type parameter.
       if (!innermost_function().IsNull()) {
         // TODO(regis): Shortcut this lookup if no generic functions in scope.
-        TypeParameter& type_parameter = TypeParameter::ZoneHandle(Z,
-            innermost_function().LookupTypeParameter(unresolved_class_name,
-                                                     NULL));
+        TypeParameter& type_parameter = TypeParameter::ZoneHandle(
+            Z, innermost_function().LookupTypeParameter(unresolved_class_name,
+                                                        NULL));
         if (!type_parameter.IsNull()) {
           // TODO(regis): Check for absence of type arguments.
-          // For now, return as malformed type.
-          Type& malformed_type = Type::ZoneHandle(Z);
-          malformed_type = ClassFinalizer::NewFinalizedMalformedType(
-              Error::Handle(Z),  // No previous error.
-              script_,
-              type->token_pos(),
-              "function type parameter '%s' not yet supported",
-              String::Handle(Z, type_parameter.name()).ToCString());
-          *type = malformed_type.raw();
+          // For now, resolve the function type parameter to dynamic.
+          *type = Type::DynamicType();
           return;
         }
       }
       // Then check if the type is a class type parameter.
-      const TypeParameter& type_parameter = TypeParameter::Handle(Z,
-          current_class().LookupTypeParameter(unresolved_class_name));
+      const TypeParameter& type_parameter = TypeParameter::Handle(
+          Z, current_class().LookupTypeParameter(unresolved_class_name));
       if (!type_parameter.IsNull()) {
         // A type parameter is considered to be a malformed type when
         // referenced by a static member.
         if (ParsingStaticMember()) {
           *type = ClassFinalizer::NewFinalizedMalformedType(
               Error::Handle(Z),  // No previous error.
-              script_,
-              type->token_pos(),
+              script_, type->token_pos(),
               "type parameter '%s' cannot be referenced "
               "from static member",
               String::Handle(Z, type_parameter.name()).ToCString());
@@ -12416,8 +11909,7 @@
         if (type->arguments() != TypeArguments::null()) {
           *type = ClassFinalizer::NewFinalizedMalformedType(
               Error::Handle(Z),  // No previous error.
-              script_,
-              type_parameter.token_pos(),
+              script_, type_parameter.token_pos(),
               "type parameter '%s' cannot be parameterized",
               String::Handle(Z, type_parameter.name()).ToCString());
           return;
@@ -12428,14 +11920,18 @@
       // The referenced class may not have been parsed yet. It would be wrong
       // to resolve it too early to an imported class of the same name. Only
       // resolve the class when a finalized type is requested.
+      // Note that when compiling a cloned mixin function, library_ may be
+      // different than current_class's library.
       if (finalization > ClassFinalizer::kResolveTypeParameters) {
         resolved_type_class = library_.LookupClass(unresolved_class_name);
       }
     } else {
       // Resolve class name in the scope of the library prefix.
-      const LibraryPrefix& lib_prefix =
-          LibraryPrefix::Handle(Z, unresolved_class.library_prefix());
-      resolved_type_class = lib_prefix.LookupClass(unresolved_class_name);
+      const Object& prefix =
+          Object::Handle(Z, unresolved_class.library_or_library_prefix());
+      ASSERT(prefix.IsLibraryPrefix());
+      resolved_type_class =
+          LibraryPrefix::Cast(prefix).LookupClass(unresolved_class_name);
     }
     // At this point, we can only have a parameterized_type.
     const Type& parameterized_type = Type::Cast(*type);
@@ -12445,9 +11941,7 @@
     } else if (finalization >= ClassFinalizer::kCanonicalize) {
       ClassFinalizer::FinalizeMalformedType(
           Error::Handle(Z),  // No previous error.
-          script_,
-          parameterized_type,
-          "type '%s' is not loaded",
+          script_, parameterized_type, "type '%s' is not loaded",
           String::Handle(Z, parameterized_type.UserVisibleName()).ToCString());
       return;
     }
@@ -12491,12 +11985,12 @@
 
 bool Parser::ParsingStaticMember() const {
   if (is_top_level_) {
-    return (current_member_ != NULL) &&
-           current_member_->has_static && !current_member_->has_factory;
+    return (current_member_ != NULL) && current_member_->has_static &&
+           !current_member_->has_factory;
   }
   ASSERT(!current_function().IsNull());
-  return
-      current_function().is_static() && !current_function().IsInFactoryScope();
+  return current_function().is_static() &&
+         !current_function().IsInFactoryScope();
 }
 
 
@@ -12538,9 +12032,8 @@
   const intptr_t kInitialConstMapSize = 16;
   ASSERT(!script.InVMHeap());
   if (script.compile_time_constants() == Array::null()) {
-    const Array& array =
-        Array::Handle(HashTables::New<ConstantsMap>(kInitialConstMapSize,
-                                                    Heap::kNew));
+    const Array& array = Array::Handle(
+        HashTables::New<ConstantsMap>(kInitialConstMapSize, Heap::kNew));
     script.set_compile_time_constants(array);
   }
   ConstantsMap constants(script.compile_time_constants());
@@ -12599,14 +12092,15 @@
 // Otherwise, if the field is constant, initialize the field and return no ast.
 // If the field is not initialized and not const, return the ast for the getter.
 StaticGetterNode* Parser::RunStaticFieldInitializer(
-    const Field& field, TokenPosition field_ref_pos) {
+    const Field& field,
+    TokenPosition field_ref_pos) {
   ASSERT(field.is_static());
   const Class& field_owner = Class::ZoneHandle(Z, field.Owner());
   const String& field_name = String::ZoneHandle(Z, field.name());
   const String& getter_name =
       String::Handle(Z, Field::GetterSymbol(field_name));
-  const Function& getter = Function::Handle(Z,
-      field_owner.LookupStaticFunction(getter_name));
+  const Function& getter =
+      Function::Handle(Z, field_owner.LookupStaticFunction(getter_name));
   const Instance& value = Instance::Handle(Z, field.StaticValue());
   if (value.raw() == Object::transition_sentinel().raw()) {
     if (field.is_const()) {
@@ -12614,8 +12108,8 @@
                   field_name.ToCString());
     } else {
       // The implicit static getter will throw the exception if necessary.
-      return new(Z) StaticGetterNode(
-          field_ref_pos, NULL, field_owner, field_name);
+      return new (Z)
+          StaticGetterNode(field_ref_pos, NULL, field_owner, field_name);
     }
   } else if (value.raw() == Object::sentinel().raw()) {
     // This field has not been referenced yet and thus the value has
@@ -12626,11 +12120,9 @@
       NoOOBMessageScope no_msg_scope(thread());
       field.SetStaticValue(Object::transition_sentinel());
       const int kNumArguments = 0;  // no arguments.
-      const Function& func = Function::Handle(Z,
-          Resolver::ResolveStatic(field_owner,
-                                  getter_name,
-                                  kNumArguments,
-                                  Object::empty_array()));
+      const Function& func = Function::Handle(
+          Z, Resolver::ResolveStatic(field_owner, getter_name, kNumArguments,
+                                     Object::empty_array()));
       ASSERT(!func.IsNull());
       ASSERT(func.kind() == RawFunction::kImplicitStaticFinalGetter);
       Object& const_value = Object::Handle(Z);
@@ -12646,8 +12138,7 @@
           // It is a compile-time error if evaluation of a compile-time constant
           // would raise an exception.
           const String& field_name = String::Handle(Z, field.name());
-          ReportErrors(error,
-                       script_, field_ref_pos,
+          ReportErrors(error, script_, field_ref_pos,
                        "error initializing const field '%s'",
                        field_name.ToCString());
         } else {
@@ -12660,10 +12151,10 @@
       instance ^= const_value.raw();
       instance = TryCanonicalize(instance, field_ref_pos);
       field.SetStaticValue(instance);
-      return NULL;   // Constant
+      return NULL;  // Constant
     } else {
-      return new(Z) StaticGetterNode(
-          field_ref_pos, NULL, field_owner, field_name);
+      return new (Z)
+          StaticGetterNode(field_ref_pos, NULL, field_owner, field_name);
     }
   }
   if (getter.IsNull() ||
@@ -12671,8 +12162,7 @@
     return NULL;
   }
   ASSERT(getter.kind() == RawFunction::kImplicitGetter);
-  return new(Z) StaticGetterNode(
-      field_ref_pos, NULL, field_owner, field_name);
+  return new (Z) StaticGetterNode(field_ref_pos, NULL, field_owner, field_name);
 }
 
 
@@ -12711,22 +12201,22 @@
     ASSERT(arg->IsLiteralNode());
     arg_values.SetAt((i + kNumExtraArgs), arg->AsLiteralNode()->literal());
   }
-  const Array& args_descriptor = Array::Handle(Z,
-      ArgumentsDescriptor::New(num_arguments, arguments->names()));
-  const Object& result = Object::Handle(Z,
-      DartEntry::InvokeFunction(constructor, arg_values, args_descriptor));
+  const Array& args_descriptor = Array::Handle(
+      Z, ArgumentsDescriptor::New(num_arguments, arguments->names()));
+  const Object& result = Object::Handle(
+      Z, DartEntry::InvokeFunction(constructor, arg_values, args_descriptor));
   if (result.IsError()) {
-      // An exception may not occur in every parse attempt, i.e., the
-      // generated AST is not deterministic. Therefore mark the function as
-      // not optimizable.
-      current_function().SetIsOptimizable(false);
-      if (result.IsUnhandledException()) {
-        return result.raw();
-      } else {
-        thread()->long_jump_base()->Jump(1, Error::Cast(result));
-        UNREACHABLE();
-        return Object::null();
-      }
+    // An exception may not occur in every parse attempt, i.e., the
+    // generated AST is not deterministic. Therefore mark the function as
+    // not optimizable.
+    current_function().SetIsOptimizable(false);
+    if (result.IsUnhandledException()) {
+      return result.raw();
+    } else {
+      thread()->long_jump_base()->Jump(1, Error::Cast(result));
+      UNREACHABLE();
+      return Object::null();
+    }
   } else {
     if (constructor.IsFactory()) {
       // The factory method returns the allocated object.
@@ -12741,7 +12231,7 @@
 // return true if the identifier is found, false otherwise.
 // If node is non NULL return an AST node corresponding to the identifier.
 bool Parser::ResolveIdentInLocalScope(TokenPosition ident_pos,
-                                      const String &ident,
+                                      const String& ident,
                                       AstNode** node,
                                       intptr_t* function_level) {
   TRACE_PARSER("ResolveIdentInLocalScope");
@@ -12752,7 +12242,7 @@
   }
   if (local != NULL) {
     if (node != NULL) {
-      *node = new(Z) LoadLocalNode(ident_pos, local);
+      *node = new (Z) LoadLocalNode(ident_pos, local);
     }
     if (function_level != NULL) {
       *function_level = local->owner()->function_level();
@@ -12801,13 +12291,11 @@
 
   // Check if an instance/static function exists.
   func = cls.LookupFunction(ident);
-  if (!func.IsNull() &&
-      (func.IsDynamicFunction() ||
-      func.IsStaticFunction() ||
-      func.is_abstract())) {
+  if (!func.IsNull() && (func.IsDynamicFunction() || func.IsStaticFunction() ||
+                         func.is_abstract())) {
     if (node != NULL) {
-      *node = new(Z) PrimaryNode(
-          ident_pos, Function::ZoneHandle(Z, func.raw()));
+      *node =
+          new (Z) PrimaryNode(ident_pos, Function::ZoneHandle(Z, func.raw()));
     }
     return true;
   }
@@ -12832,10 +12320,8 @@
       return true;
     } else if (func.IsStaticFunction()) {
       if (node != NULL) {
-        *node = new(Z) StaticGetterNode(ident_pos,
-                                        NULL,
-                                        Class::ZoneHandle(Z, cls.raw()),
-                                        ident);
+        *node = new (Z) StaticGetterNode(
+            ident_pos, NULL, Class::ZoneHandle(Z, cls.raw()), ident);
       }
       return true;
     }
@@ -12859,7 +12345,7 @@
   const Object& obj = Object::Handle(Z, library_.ResolveName(ident));
   if (obj.IsClass()) {
     const Class& cls = Class::Cast(obj);
-    return new(Z) PrimaryNode(ident_pos, Class::ZoneHandle(Z, cls.raw()));
+    return new (Z) PrimaryNode(ident_pos, Class::ZoneHandle(Z, cls.raw()));
   } else if (obj.IsField()) {
     const Field& field = Field::Cast(obj);
     ASSERT(field.is_static());
@@ -12872,26 +12358,24 @@
     const Function& func = Function::Cast(obj);
     ASSERT(func.is_static());
     if (func.IsGetterFunction() || func.IsSetterFunction()) {
-      StaticGetterNode* getter =
-          new(Z) StaticGetterNode(ident_pos,
-                                  /* receiver */ NULL,
-                                  Class::ZoneHandle(Z, func.Owner()),
-                                  ident);
+      StaticGetterNode* getter = new (Z) StaticGetterNode(
+          ident_pos,
+          /* receiver */ NULL, Class::ZoneHandle(Z, func.Owner()), ident);
       getter->set_owner(library_);
       return getter;
     } else {
-      return new(Z) PrimaryNode(ident_pos, Function::ZoneHandle(Z, func.raw()));
+      return new (Z)
+          PrimaryNode(ident_pos, Function::ZoneHandle(Z, func.raw()));
     }
   } else if (obj.IsLibraryPrefix()) {
     const LibraryPrefix& prefix = LibraryPrefix::Cast(obj);
-    ReportError(ident_pos,
-                "illegal use of library prefix '%s'",
+    ReportError(ident_pos, "illegal use of library prefix '%s'",
                 String::Handle(prefix.name()).ToCString());
   } else {
     ASSERT(obj.IsNull());
   }
   // Lexically unresolved primary identifiers are referenced by their name.
-  return new(Z) PrimaryNode(ident_pos, ident);
+  return new (Z) PrimaryNode(ident_pos, ident);
 }
 
 
@@ -12930,7 +12414,7 @@
   } else if (obj.IsClass()) {
     const Class& cls = Class::Cast(obj);
     PrimaryNode* primary =
-        new(Z) PrimaryNode(ident_pos, Class::ZoneHandle(Z, cls.raw()));
+        new (Z) PrimaryNode(ident_pos, Class::ZoneHandle(Z, cls.raw()));
     primary->set_is_deferred(is_deferred);
     return primary;
   } else if (obj.IsField()) {
@@ -12951,17 +12435,15 @@
     const Function& func = Function::Cast(obj);
     ASSERT(func.is_static());
     if (func.IsGetterFunction() || func.IsSetterFunction()) {
-      StaticGetterNode* getter = new(Z) StaticGetterNode(
-         ident_pos,
-         /* receiver */ NULL,
-         Class::ZoneHandle(Z, func.Owner()),
-         ident);
+      StaticGetterNode* getter = new (Z) StaticGetterNode(
+          ident_pos,
+          /* receiver */ NULL, Class::ZoneHandle(Z, func.Owner()), ident);
       getter->set_is_deferred(is_deferred);
       getter->set_owner(prefix);
       return getter;
     } else {
-      PrimaryNode* primary = new(Z) PrimaryNode(
-           ident_pos, Function::ZoneHandle(Z, func.raw()));
+      PrimaryNode* primary =
+          new (Z) PrimaryNode(ident_pos, Function::ZoneHandle(Z, func.raw()));
       primary->set_is_deferred(is_deferred);
       return primary;
     }
@@ -12989,9 +12471,9 @@
   if (!innermost_function().IsNull()) {
     // TODO(regis): Shortcut this lookup if no generic functions in scope.
     intptr_t type_param_func_level = FunctionLevel();
-    const TypeParameter& type_parameter = TypeParameter::ZoneHandle(Z,
-        innermost_function().LookupTypeParameter(ident,
-                                                 &type_param_func_level));
+    const TypeParameter& type_parameter =
+        TypeParameter::ZoneHandle(Z, innermost_function().LookupTypeParameter(
+                                         ident, &type_param_func_level));
     if (!type_parameter.IsNull()) {
       if ((resolved == NULL) || (resolved_func_level < type_param_func_level)) {
         // The identifier is a function type parameter, possibly shadowing
@@ -13001,23 +12483,17 @@
           CaptureFunctionInstantiator();
         }
         // TODO(regis): Finalize type parameter and return as type node.
-        // For now, return as malformed type.
-        Type& malformed_type = Type::ZoneHandle(Z);
-        malformed_type = ClassFinalizer::NewFinalizedMalformedType(
-            Error::Handle(Z),  // No previous error.
-            script_,
-            ident_pos,
-            "function type parameter '%s' not yet supported",
-            ident.ToCString());
-        return new(Z) TypeNode(ident_pos, malformed_type);
+        // For now, map to dynamic type.
+        Type& type = Type::ZoneHandle(Z, Type::DynamicType());
+        return new (Z) TypeNode(ident_pos, type);
       }
     }
   }
   if (resolved == NULL) {
     // Check whether the identifier is a class type parameter.
     if (!current_class().IsNull()) {
-      TypeParameter& type_parameter = TypeParameter::ZoneHandle(Z,
-          current_class().LookupTypeParameter(ident));
+      TypeParameter& type_parameter = TypeParameter::ZoneHandle(
+          Z, current_class().LookupTypeParameter(ident));
       if (!type_parameter.IsNull()) {
         if (FunctionLevel() > 0) {
           // Make sure that the class instantiator is captured.
@@ -13026,7 +12502,7 @@
         type_parameter ^= ClassFinalizer::FinalizeType(
             current_class(), type_parameter, ClassFinalizer::kCanonicalize);
         ASSERT(!type_parameter.IsMalformed());
-        return new(Z) TypeNode(ident_pos, type_parameter);
+        return new (Z) TypeNode(ident_pos, type_parameter);
       }
     }
     // Not found in the local scope, and the name is not a type parameter.
@@ -13044,9 +12520,7 @@
       // the unresolved name to an instance field access, since a
       // subclass might define a field with this name.
       if (current_function().is_static()) {
-        resolved = ThrowNoSuchMethodError(ident_pos,
-                                          current_class(),
-                                          ident,
+        resolved = ThrowNoSuchMethodError(ident_pos, current_class(), ident,
                                           NULL,  // No arguments.
                                           InvocationMirror::kStatic,
                                           InvocationMirror::kField,
@@ -13064,14 +12538,14 @@
       }
     } else if (primary->primary().IsClass()) {
       const Class& type_class = Class::Cast(primary->primary());
-      AbstractType& type = Type::ZoneHandle(Z,
-          Type::New(type_class, TypeArguments::Handle(Z), primary_pos,
-                    Heap::kOld));
-      type ^= ClassFinalizer::FinalizeType(
-          current_class(), type, ClassFinalizer::kCanonicalize);
+      AbstractType& type =
+          Type::ZoneHandle(Z, Type::New(type_class, TypeArguments::Handle(Z),
+                                        primary_pos, Heap::kOld));
+      type ^= ClassFinalizer::FinalizeType(current_class(), type,
+                                           ClassFinalizer::kCanonicalize);
       // Type may be malbounded, but not malformed.
       ASSERT(!type.IsMalformed());
-      resolved = new(Z) TypeNode(primary_pos, type);
+      resolved = new (Z) TypeNode(primary_pos, type);
     }
   }
   return resolved;
@@ -13083,8 +12557,8 @@
     bool allow_deferred_type,
     bool consume_unresolved_prefix) {
   LibraryPrefix& prefix = LibraryPrefix::Handle(Z);
-  return ParseType(finalization, allow_deferred_type,
-                   consume_unresolved_prefix, &prefix);
+  return ParseType(finalization, allow_deferred_type, consume_unresolved_prefix,
+                   &prefix);
 }
 
 // Parses type = [ident "."] ident ["<" type { "," type } ">"], then resolve and
@@ -13119,8 +12593,7 @@
     // If we didn't see a valid prefix but the identifier is followed by
     // a period and another identifier, consume the qualified identifier
     // and create a malformed type.
-    if (consume_unresolved_prefix &&
-        prefix->IsNull() &&
+    if (consume_unresolved_prefix && prefix->IsNull() &&
         (CurrentToken() == Token::kPERIOD) &&
         (Token::IsIdentifier(LookaheadToken(1)))) {
       if (!is_top_level_ && (current_block_ != NULL)) {
@@ -13138,24 +12611,19 @@
       ParseTypeArguments(ClassFinalizer::kIgnore);
       return ClassFinalizer::NewFinalizedMalformedType(
           Error::Handle(Z),  // No previous error.
-          script_,
-          ident_pos,
-          "qualified name '%s' does not refer to a type",
+          script_, ident_pos, "qualified name '%s' does not refer to a type",
           qualified_name.ToCString());
     }
 
     // If parsing inside a local scope, check whether the type name
     // is shadowed by a local declaration.
-    if (!is_top_level_ &&
-        (prefix->IsNull()) &&
+    if (!is_top_level_ && (prefix->IsNull()) &&
         ResolveIdentInLocalScope(ident_pos, type_name, NULL, NULL)) {
       // The type is malformed. Skip over its type arguments.
       ParseTypeArguments(ClassFinalizer::kIgnore);
       return ClassFinalizer::NewFinalizedMalformedType(
           Error::Handle(Z),  // No previous error.
-          script_,
-          ident_pos,
-          "using '%s' in this context is invalid",
+          script_, ident_pos, "using '%s' in this context is invalid",
           type_name.ToCString());
     }
     if ((!FLAG_load_deferred_eagerly || !allow_deferred_type) &&
@@ -13171,16 +12639,14 @@
       // loaded when finalization is requested, return a malformed type.
       // Otherwise, handle resolution below, as needed.
       if (!allow_deferred_type ||
-          (!prefix->is_loaded()
-              && (finalization > ClassFinalizer::kResolveTypeParameters))) {
+          (!prefix->is_loaded() &&
+           (finalization > ClassFinalizer::kResolveTypeParameters))) {
         ParseTypeArguments(ClassFinalizer::kIgnore);
         return ClassFinalizer::NewFinalizedMalformedType(
             Error::Handle(Z),  // No previous error.
-            script_,
-            ident_pos,
-            !prefix->is_loaded() && allow_deferred_type
-                ? "deferred type '%s.%s' is not yet loaded"
-                : "using deferred type '%s.%s' is invalid",
+            script_, ident_pos, !prefix->is_loaded() && allow_deferred_type
+                                    ? "deferred type '%s.%s' is not yet loaded"
+                                    : "using deferred type '%s.%s' is invalid",
             String::Handle(Z, prefix->name()).ToCString(),
             type_name.ToCString());
       }
@@ -13191,8 +12657,8 @@
   if (finalization != ClassFinalizer::kIgnore) {
     type_class = UnresolvedClass::New(*prefix, type_name, ident_pos);
   }
-  TypeArguments& type_arguments = TypeArguments::Handle(
-      Z, ParseTypeArguments(finalization));
+  TypeArguments& type_arguments =
+      TypeArguments::Handle(Z, ParseTypeArguments(finalization));
   if (finalization == ClassFinalizer::kIgnore) {
     return Type::DynamicType();
   }
@@ -13209,7 +12675,8 @@
 
 
 void Parser::CheckConstructorCallTypeArguments(
-    TokenPosition pos, const Function& constructor,
+    TokenPosition pos,
+    const Function& constructor,
     const TypeArguments& type_arguments) {
   if (!type_arguments.IsNull()) {
     const Class& constructor_class = Class::Handle(Z, constructor.Owner());
@@ -13241,7 +12708,7 @@
     Instance& existing_const = Instance::ZoneHandle(Z);
     if (GetCachedConstant(literal_pos, &existing_const)) {
       SkipListLiteral();
-      return new(Z) LiteralNode(literal_pos, existing_const);
+      return new (Z) LiteralNode(literal_pos, existing_const);
     }
   }
 
@@ -13258,7 +12725,7 @@
     // List literals take a single type argument.
     if (list_type_arguments.Length() == 1) {
       element_type = list_type_arguments.TypeAt(0);
-      ASSERT(!element_type.IsMalformed());  // Would be mapped to dynamic.
+      ASSERT(!element_type.IsMalformed());   // Would be mapped to dynamic.
       ASSERT(!element_type.IsMalbounded());  // No declared bound in List.
       if (element_type.IsDynamicType()) {
         list_type_arguments = TypeArguments::null();
@@ -13279,10 +12746,10 @@
   }
   ASSERT(list_type_arguments.IsNull() || (list_type_arguments.Length() == 1));
   const Class& array_class = Class::Handle(Z, I->object_store()->array_class());
-  Type& type = Type::ZoneHandle(Z,
-      Type::New(array_class, list_type_arguments, type_pos, Heap::kOld));
-  type ^= ClassFinalizer::FinalizeType(
-      current_class(), type, ClassFinalizer::kCanonicalize);
+  Type& type = Type::ZoneHandle(
+      Z, Type::New(array_class, list_type_arguments, type_pos, Heap::kOld));
+  type ^= ClassFinalizer::FinalizeType(current_class(), type,
+                                       ClassFinalizer::kCanonicalize);
   GrowableArray<AstNode*> element_list;
   // Parse the list elements. Note: there may be an optional extra
   // comma after the last element.
@@ -13291,13 +12758,9 @@
     while (CurrentToken() != Token::kRBRACK) {
       const TokenPosition element_pos = TokenPos();
       AstNode* element = ParseExpr(is_const, kConsumeCascades);
-      if (I->type_checks() &&
-          !is_const &&
-          !element_type.IsDynamicType()) {
-        element = new(Z) AssignableNode(element_pos,
-                                        element,
-                                        element_type,
-                                        Symbols::ListLiteralElement());
+      if (I->type_checks() && !is_const && !element_type.IsDynamicType()) {
+        element = new (Z) AssignableNode(element_pos, element, element_type,
+                                         Symbols::ListLiteralElement());
       }
       element_list.Add(element);
       if (CurrentToken() == Token::kCOMMA) {
@@ -13313,10 +12776,10 @@
   if (is_const) {
     // Allocate and initialize the const list at compile time.
     if ((element_list.length() == 0) && list_type_arguments.IsNull()) {
-      return new(Z) LiteralNode(literal_pos, Object::empty_array());
+      return new (Z) LiteralNode(literal_pos, Object::empty_array());
     }
-    Array& const_list = Array::ZoneHandle(Z,
-        Array::New(element_list.length(), Heap::kOld));
+    Array& const_list =
+        Array::ZoneHandle(Z, Array::New(element_list.length(), Heap::kOld));
     const_list.SetTypeArguments(
         TypeArguments::Handle(Z, list_type_arguments.Canonicalize()));
     Error& bound_error = Error::Handle(Z);
@@ -13325,23 +12788,19 @@
       // Arguments have been evaluated to a literal value already.
       ASSERT(elem->IsLiteralNode());
       ASSERT(!is_top_level_);  // We cannot check unresolved types.
-      if (I->type_checks() &&
-          !element_type.IsDynamicType() &&
+      if (I->type_checks() && !element_type.IsDynamicType() &&
           (!elem->AsLiteralNode()->literal().IsNull() &&
            !elem->AsLiteralNode()->literal().IsInstanceOf(
-               element_type,
-               TypeArguments::Handle(Z),
-               &bound_error))) {
+               element_type, TypeArguments::Handle(Z), &bound_error))) {
         // If the failure is due to a bound error, display it instead.
         if (!bound_error.IsNull()) {
           ReportError(bound_error);
         } else {
-          ReportError(elem->AsLiteralNode()->token_pos(),
-                      "list literal element at index %d must be "
-                      "a constant of type '%s'",
-                      i,
-                      String::Handle(Z,
-                          element_type.UserVisibleName()).ToCString());
+          ReportError(
+              elem->AsLiteralNode()->token_pos(),
+              "list literal element at index %d must be "
+              "a constant of type '%s'",
+              i, String::Handle(Z, element_type.UserVisibleName()).ToCString());
         }
       }
       const_list.SetAt(i, elem->AsLiteralNode()->literal());
@@ -13349,19 +12808,18 @@
     const_list.MakeImmutable();
     const_list ^= TryCanonicalize(const_list, literal_pos);
     CacheConstantValue(literal_pos, const_list);
-    return new(Z) LiteralNode(literal_pos, const_list);
+    return new (Z) LiteralNode(literal_pos, const_list);
   } else {
     // Factory call at runtime.
     const Class& factory_class =
         Class::Handle(Z, Library::LookupCoreClass(Symbols::List()));
     ASSERT(!factory_class.IsNull());
-    const Function& factory_method = Function::ZoneHandle(Z,
-        factory_class.LookupFactory(
-            Library::PrivateCoreLibName(Symbols::ListLiteralFactory())));
+    const Function& factory_method = Function::ZoneHandle(
+        Z, factory_class.LookupFactory(
+               Library::PrivateCoreLibName(Symbols::ListLiteralFactory())));
     ASSERT(!factory_method.IsNull());
     if (!list_type_arguments.IsNull() &&
-        !list_type_arguments.IsInstantiated() &&
-        (FunctionLevel() > 0)) {
+        !list_type_arguments.IsInstantiated() && (FunctionLevel() > 0)) {
       // Make sure that the instantiator is captured.
       CaptureInstantiator();
     }
@@ -13371,28 +12829,25 @@
     // type argument vector.
     if (!factory_type_args.IsNull() && (factory_class.NumTypeArguments() > 1)) {
       ASSERT(factory_type_args.Length() == 1);
-      Type& factory_type = Type::Handle(Z, Type::New(
-          factory_class, factory_type_args, type_pos, Heap::kOld));
+      Type& factory_type = Type::Handle(
+          Z, Type::New(factory_class, factory_type_args, type_pos, Heap::kOld));
       factory_type ^= ClassFinalizer::FinalizeType(
           current_class(), factory_type, ClassFinalizer::kFinalize);
       factory_type_args = factory_type.arguments();
       ASSERT(factory_type_args.Length() == factory_class.NumTypeArguments());
     }
     factory_type_args = factory_type_args.Canonicalize();
-    ArgumentListNode* factory_param = new(Z) ArgumentListNode(
-        literal_pos);
+    ArgumentListNode* factory_param = new (Z) ArgumentListNode(literal_pos);
     if (element_list.length() == 0) {
       LiteralNode* empty_array_literal =
-          new(Z) LiteralNode(TokenPos(), Object::empty_array());
+          new (Z) LiteralNode(TokenPos(), Object::empty_array());
       factory_param->Add(empty_array_literal);
     } else {
-      ArrayNode* list = new(Z) ArrayNode(TokenPos(), type, element_list);
+      ArrayNode* list = new (Z) ArrayNode(TokenPos(), type, element_list);
       factory_param->Add(list);
     }
-    return CreateConstructorCallNode(literal_pos,
-                                     factory_type_args,
-                                     factory_method,
-                                     factory_param);
+    return CreateConstructorCallNode(literal_pos, factory_type_args,
+                                     factory_method, factory_param);
   }
 }
 
@@ -13405,8 +12860,8 @@
   if (!type_arguments.IsNull() && !type_arguments.IsInstantiated()) {
     EnsureExpressionTemp();
   }
-  return new(Z) ConstructorCallNode(
-      token_pos, type_arguments, constructor, arguments);
+  return new (Z)
+      ConstructorCallNode(token_pos, type_arguments, constructor, arguments);
 }
 
 
@@ -13447,7 +12902,7 @@
     Instance& existing_const = Instance::ZoneHandle(Z);
     if (GetCachedConstant(literal_pos, &existing_const)) {
       SkipMapLiteral();
-      return new(Z) LiteralNode(literal_pos, existing_const);
+      return new (Z) LiteralNode(literal_pos, existing_const);
     }
   }
 
@@ -13496,11 +12951,9 @@
     const bool saved_mode = SetAllowFunctionLiterals(true);
     const TokenPosition key_pos = TokenPos();
     AstNode* key = ParseExpr(is_const, kConsumeCascades);
-    if (I->type_checks() &&
-        !is_const &&
-        !key_type.IsDynamicType()) {
-      key = new(Z) AssignableNode(
-          key_pos, key, key_type, Symbols::ListLiteralElement());
+    if (I->type_checks() && !is_const && !key_type.IsDynamicType()) {
+      key = new (Z)
+          AssignableNode(key_pos, key, key_type, Symbols::ListLiteralElement());
     }
     if (is_const) {
       ASSERT(key->IsLiteralNode());
@@ -13508,8 +12961,7 @@
       if (key_value.IsDouble()) {
         ReportError(key_pos, "key value must not be of type double");
       }
-      if (!key_value.IsInteger() &&
-          !key_value.IsString() &&
+      if (!key_value.IsInteger() && !key_value.IsString() &&
           (key_value.clazz() != I->object_store()->symbol_class()) &&
           ImplementsEqualOperator(Z, key_value)) {
         ReportError(key_pos, "key value must not implement operator ==");
@@ -13519,11 +12971,9 @@
     const TokenPosition value_pos = TokenPos();
     AstNode* value = ParseExpr(is_const, kConsumeCascades);
     SetAllowFunctionLiterals(saved_mode);
-    if (I->type_checks() &&
-        !is_const &&
-        !value_type.IsDynamicType()) {
-      value = new(Z) AssignableNode(
-          value_pos, value, value_type, Symbols::ListLiteralElement());
+    if (I->type_checks() && !is_const && !value_type.IsDynamicType()) {
+      value = new (Z) AssignableNode(value_pos, value, value_type,
+                                     Symbols::ListLiteralElement());
     }
     AddKeyValuePair(&kv_pairs_list, is_const, key, value);
 
@@ -13562,20 +13012,17 @@
         if (!arg_type.IsDynamicType() &&
             (!arg->AsLiteralNode()->literal().IsNull() &&
              !arg->AsLiteralNode()->literal().IsInstanceOf(
-                 arg_type,
-                 Object::null_type_arguments(),
-                 &bound_error))) {
+                 arg_type, Object::null_type_arguments(), &bound_error))) {
           // If the failure is due to a bound error, display it.
           if (!bound_error.IsNull()) {
             ReportError(bound_error);
           } else {
-            ReportError(arg->AsLiteralNode()->token_pos(),
-                        "map literal %s at index %d must be "
-                        "a constant of type '%s'",
-                        ((i % 2) == 0) ? "key" : "value",
-                        i >> 1,
-                        String::Handle(Z,
-                                       arg_type.UserVisibleName()).ToCString());
+            ReportError(
+                arg->AsLiteralNode()->token_pos(),
+                "map literal %s at index %d must be "
+                "a constant of type '%s'",
+                ((i % 2) == 0) ? "key" : "value", i >> 1,
+                String::Handle(Z, arg_type.UserVisibleName()).ToCString());
           }
         }
       }
@@ -13585,44 +13032,40 @@
     key_value_array ^= TryCanonicalize(key_value_array, TokenPos());
 
     // Construct the map object.
-    const Class& immutable_map_class = Class::Handle(Z,
-        Library::LookupCoreClass(Symbols::ImmutableMap()));
+    const Class& immutable_map_class =
+        Class::Handle(Z, Library::LookupCoreClass(Symbols::ImmutableMap()));
     ASSERT(!immutable_map_class.IsNull());
     // If the immutable map class extends other parameterized classes, we need
     // to adjust the type argument vector. This is currently not the case.
     ASSERT(immutable_map_class.NumTypeArguments() == 2);
-    ArgumentListNode* constr_args = new(Z) ArgumentListNode(TokenPos());
-    constr_args->Add(new(Z) LiteralNode(literal_pos, key_value_array));
-    const Function& map_constr =
-        Function::ZoneHandle(Z, immutable_map_class.LookupConstructor(
-            Library::PrivateCoreLibName(Symbols::ImmutableMapConstructor())));
+    ArgumentListNode* constr_args = new (Z) ArgumentListNode(TokenPos());
+    constr_args->Add(new (Z) LiteralNode(literal_pos, key_value_array));
+    const Function& map_constr = Function::ZoneHandle(
+        Z, immutable_map_class.LookupConstructor(Library::PrivateCoreLibName(
+               Symbols::ImmutableMapConstructor())));
     ASSERT(!map_constr.IsNull());
-    const Object& constructor_result = Object::Handle(Z,
-        EvaluateConstConstructorCall(immutable_map_class,
-                                     map_type_arguments,
-                                     map_constr,
-                                     constr_args));
+    const Object& constructor_result = Object::Handle(
+        Z, EvaluateConstConstructorCall(immutable_map_class, map_type_arguments,
+                                        map_constr, constr_args));
     if (constructor_result.IsUnhandledException()) {
-      ReportErrors(Error::Cast(constructor_result),
-                   script_, literal_pos,
+      ReportErrors(Error::Cast(constructor_result), script_, literal_pos,
                    "error executing const Map constructor");
     } else {
       const Instance& const_instance = Instance::Cast(constructor_result);
       CacheConstantValue(literal_pos, const_instance);
-      return new(Z) LiteralNode(
-          literal_pos, Instance::ZoneHandle(Z, const_instance.raw()));
+      return new (Z) LiteralNode(literal_pos,
+                                 Instance::ZoneHandle(Z, const_instance.raw()));
     }
   } else {
     // Factory call at runtime.
     const Class& factory_class =
         Class::Handle(Z, Library::LookupCoreClass(Symbols::Map()));
     ASSERT(!factory_class.IsNull());
-    const Function& factory_method = Function::ZoneHandle(Z,
-        factory_class.LookupFactory(
-            Library::PrivateCoreLibName(Symbols::MapLiteralFactory())));
+    const Function& factory_method = Function::ZoneHandle(
+        Z, factory_class.LookupFactory(
+               Library::PrivateCoreLibName(Symbols::MapLiteralFactory())));
     ASSERT(!factory_method.IsNull());
-    if (!map_type_arguments.IsNull() &&
-        !map_type_arguments.IsInstantiated() &&
+    if (!map_type_arguments.IsNull() && !map_type_arguments.IsInstantiated() &&
         (FunctionLevel() > 0)) {
       // Make sure that the instantiator is captured.
       CaptureInstantiator();
@@ -13633,34 +13076,30 @@
     // type argument vector.
     if (!factory_type_args.IsNull() && (factory_class.NumTypeArguments() > 2)) {
       ASSERT(factory_type_args.Length() == 2);
-      Type& factory_type = Type::Handle(Z, Type::New(
-          factory_class, factory_type_args, type_pos, Heap::kOld));
+      Type& factory_type = Type::Handle(
+          Z, Type::New(factory_class, factory_type_args, type_pos, Heap::kOld));
       factory_type ^= ClassFinalizer::FinalizeType(
           current_class(), factory_type, ClassFinalizer::kFinalize);
       factory_type_args = factory_type.arguments();
       ASSERT(factory_type_args.Length() == factory_class.NumTypeArguments());
     }
     factory_type_args = factory_type_args.Canonicalize();
-    ArgumentListNode* factory_param = new(Z) ArgumentListNode(literal_pos);
+    ArgumentListNode* factory_param = new (Z) ArgumentListNode(literal_pos);
     // The kv_pair array is temporary and of element type dynamic. It is passed
     // to the factory to initialize a properly typed map. Pass a pre-allocated
     // array for the common empty map literal case.
     if (kv_pairs_list.length() == 0) {
       LiteralNode* empty_array_literal =
-          new(Z) LiteralNode(TokenPos(), Object::empty_array());
+          new (Z) LiteralNode(TokenPos(), Object::empty_array());
       factory_param->Add(empty_array_literal);
     } else {
-      ArrayNode* kv_pairs = new(Z) ArrayNode(
-          TokenPos(),
-          Type::ZoneHandle(Z, Type::ArrayType()),
-          kv_pairs_list);
+      ArrayNode* kv_pairs = new (Z) ArrayNode(
+          TokenPos(), Type::ZoneHandle(Z, Type::ArrayType()), kv_pairs_list);
       factory_param->Add(kv_pairs);
     }
 
-    return CreateConstructorCallNode(literal_pos,
-                                     factory_type_args,
-                                     factory_method,
-                                     factory_param);
+    return CreateConstructorCallNode(literal_pos, factory_type_args,
+                                     factory_method, factory_param);
   }
   UNREACHABLE();
   return NULL;
@@ -13675,15 +13114,14 @@
     ConsumeToken();
   }
   const TokenPosition type_pos = TokenPos();
-  TypeArguments& type_arguments = TypeArguments::Handle(Z,
-      ParseTypeArguments(ClassFinalizer::kCanonicalize));
+  TypeArguments& type_arguments = TypeArguments::Handle(
+      Z, ParseTypeArguments(ClassFinalizer::kCanonicalize));
   // Malformed type arguments are mapped to dynamic, so we will not encounter
   // them here.
   // Map and List interfaces do not declare bounds on their type parameters, so
   // we will not see malbounded type arguments here.
   AstNode* primary = NULL;
-  if ((CurrentToken() == Token::kLBRACK) ||
-      (CurrentToken() == Token::kINDEX)) {
+  if ((CurrentToken() == Token::kLBRACK) || (CurrentToken() == Token::kINDEX)) {
     primary = ParseListLiteral(type_pos, is_const, type_arguments);
   } else if (CurrentToken() == Token::kLBRACE) {
     primary = ParseMapLiteral(type_pos, is_const, type_arguments);
@@ -13720,35 +13158,32 @@
 
   Instance& symbol_instance = Instance::ZoneHandle(Z);
   if (GetCachedConstant(symbol_pos, &symbol_instance)) {
-    return new(Z) LiteralNode(symbol_pos, symbol_instance);
+    return new (Z) LiteralNode(symbol_pos, symbol_instance);
   }
 
   // Call Symbol class constructor to create a symbol instance.
   const Class& symbol_class = Class::Handle(I->object_store()->symbol_class());
   ASSERT(!symbol_class.IsNull());
-  ArgumentListNode* constr_args = new(Z) ArgumentListNode(symbol_pos);
-  constr_args->Add(new(Z) LiteralNode(symbol_pos, symbol));
-  const Function& constr = Function::ZoneHandle(Z,
-      symbol_class.LookupConstructor(Symbols::SymbolCtor()));
+  ArgumentListNode* constr_args = new (Z) ArgumentListNode(symbol_pos);
+  constr_args->Add(new (Z) LiteralNode(symbol_pos, symbol));
+  const Function& constr = Function::ZoneHandle(
+      Z, symbol_class.LookupConstructor(Symbols::SymbolCtor()));
   ASSERT(!constr.IsNull());
-  const Object& result = Object::Handle(Z,
-      EvaluateConstConstructorCall(symbol_class,
-                                   TypeArguments::Handle(Z),
-                                   constr,
-                                   constr_args));
+  const Object& result = Object::Handle(
+      Z, EvaluateConstConstructorCall(symbol_class, TypeArguments::Handle(Z),
+                                      constr, constr_args));
   if (result.IsUnhandledException()) {
-    ReportErrors(Error::Cast(result),
-                 script_, symbol_pos,
+    ReportErrors(Error::Cast(result), script_, symbol_pos,
                  "error executing const Symbol constructor");
   }
   symbol_instance ^= result.raw();
   CacheConstantValue(symbol_pos, symbol_instance);
-  return new(Z) LiteralNode(symbol_pos, symbol_instance);
+  return new (Z) LiteralNode(symbol_pos, symbol_instance);
 }
 
 
-RawFunction* Parser::BuildConstructorClosureFunction(
-    const Function& ctr, TokenPosition token_pos) {
+RawFunction* Parser::BuildConstructorClosureFunction(const Function& ctr,
+                                                     TokenPosition token_pos) {
   ASSERT(ctr.kind() == RawFunction::kConstructor);
   Function& closure = Function::Handle(Z);
   closure = I->LookupClosureFunction(innermost_function(), token_pos);
@@ -13758,12 +13193,11 @@
   }
 
   String& closure_name = String::Handle(Z, ctr.name());
-  closure_name = Symbols::FromConcat(T,
-      Symbols::ConstructorClosurePrefix(), closure_name);
+  closure_name =
+      Symbols::FromConcat(T, Symbols::ConstructorClosurePrefix(), closure_name);
 
   ParamList params;
-  params.AddFinalParameter(token_pos,
-                           &Symbols::ClosureParameter(),
+  params.AddFinalParameter(token_pos, &Symbols::ClosureParameter(),
                            &Object::dynamic_type());
 
   ParseFormalParameters(ctr, &params);
@@ -13771,8 +13205,7 @@
   // Replace the types parsed from the constructor.
   params.EraseParameterTypes();
 
-  closure = Function::NewClosureFunction(closure_name,
-                                         innermost_function(),
+  closure = Function::NewClosureFunction(closure_name, innermost_function(),
                                          token_pos);
   closure.set_is_generated_body(true);
   closure.set_is_debuggable(false);
@@ -13799,8 +13232,8 @@
   // unnamed constructor for class 'A' is labeled 'A.'.
   // This convention prevents users from explicitly calling constructors.
   Zone* zone = thread->zone();
-  String& constructor_name = String::Handle(zone,
-      Symbols::FromDot(thread, type_class_name));
+  String& constructor_name =
+      String::Handle(zone, Symbols::FromDot(thread, type_class_name));
   if (named_constructor != NULL) {
     constructor_name =
         Symbols::FromConcat(thread, constructor_name, *named_constructor);
@@ -13823,15 +13256,19 @@
   const bool consume_unresolved_prefix =
       (la3 == Token::kLT) || (la3 == Token::kPERIOD) || (la3 == Token::kHASH);
   LibraryPrefix& prefix = LibraryPrefix::ZoneHandle(Z);
-  AbstractType& type = AbstractType::Handle(Z,
-      ParseType(ClassFinalizer::kCanonicalizeWellFormed,
-      true,  // allow deferred type
-      consume_unresolved_prefix,
-      &prefix));
+  AbstractType& type =
+      AbstractType::Handle(Z, ParseType(ClassFinalizer::kCanonicalizeWellFormed,
+                                        true,  // allow deferred type
+                                        consume_unresolved_prefix, &prefix));
   // A constructor tear-off closure can only have been created for a
   // type that is loaded.
   ASSERT(prefix.IsNull() || prefix.is_loaded());
   ASSERT(!type.IsMalformed() && !type.IsTypeParameter());
+  if (FLAG_warn_new_tearoff_syntax) {
+    ReportWarning(
+        "Tear-offs using the x#id syntax is a deprecated feature,"
+        "it will not be supported in the next release");
+  }
   ExpectToken(Token::kHASH);
   String* named_constructor = NULL;
   if (IsIdentifier()) {
@@ -13842,8 +13279,8 @@
   Class& type_class = Class::Handle(Z, type.type_class());
   String& type_class_name = String::Handle(Z, type_class.Name());
   *type_arguments = type.arguments();
-  String& constructor_name = BuildConstructorName(T,
-      type_class_name, named_constructor);
+  String& constructor_name =
+      BuildConstructorName(T, type_class_name, named_constructor);
   *constructor = type_class.LookupConstructor(constructor_name);
   if (constructor->IsNull()) {
     *constructor = type_class.LookupFactory(constructor_name);
@@ -13854,8 +13291,7 @@
       ASSERT(!type.IsMalformedOrMalbounded());
       if (!type.IsInstantiated()) {
         Error& error = Error::Handle(Z);
-        type ^= type.InstantiateFrom(*type_arguments,
-                                     &error,
+        type ^= type.InstantiateFrom(*type_arguments, &error,
                                      NULL,  // instantiation_trail
                                      NULL,  // bound_trail
                                      Heap::kOld);
@@ -13884,21 +13320,17 @@
       (la3 == Token::kLT) || (la3 == Token::kPERIOD) || (la3 == Token::kHASH);
 
   LibraryPrefix& prefix = LibraryPrefix::ZoneHandle(Z);
-  AbstractType& type = AbstractType::ZoneHandle(Z,
-      ParseType(ClassFinalizer::kCanonicalizeWellFormed,
-                allow_deferred_type,
-                consume_unresolved_prefix,
-                &prefix));
+  AbstractType& type = AbstractType::ZoneHandle(
+      Z, ParseType(ClassFinalizer::kCanonicalizeWellFormed, allow_deferred_type,
+                   consume_unresolved_prefix, &prefix));
 
-  if (FLAG_load_deferred_eagerly &&
-      !prefix.IsNull() && prefix.is_deferred_load() && !prefix.is_loaded()) {
+  if (FLAG_load_deferred_eagerly && !prefix.IsNull() &&
+      prefix.is_deferred_load() && !prefix.is_loaded()) {
     // Add runtime check.
     Type& malformed_type = Type::ZoneHandle(Z);
     malformed_type = ClassFinalizer::NewFinalizedMalformedType(
         Error::Handle(Z),  // No previous error.
-        script_,
-        type_pos,
-        "deferred type '%s.%s' is not yet loaded",
+        script_, type_pos, "deferred type '%s.%s' is not yet loaded",
         String::Handle(Z, prefix.name()).ToCString(),
         String::Handle(type.Name()).ToCString());
     // Note: Adding a statement to current block is a hack, parsing an
@@ -13912,13 +13344,11 @@
     // Replace the type with a malformed type.
     type = ClassFinalizer::NewFinalizedMalformedType(
         Error::Handle(Z),  // No previous error.
-        script_,
-        type_pos,
-        "%s'%s' cannot be instantiated",
+        script_, type_pos, "%s'%s' cannot be instantiated",
         type.IsTypeParameter() ? "type parameter " : "",
-        type.IsTypeParameter() ?
-            String::Handle(Z, type.UserVisibleName()).ToCString() :
-            "dynamic");
+        type.IsTypeParameter()
+            ? String::Handle(Z, type.UserVisibleName()).ToCString()
+            : "dynamic");
   }
   // Attempting to instantiate an enum type is a compile-time error.
   Class& type_class = Class::Handle(Z, type.type_class());
@@ -13937,6 +13367,11 @@
     if (is_const) {
       ReportError("tear-off closure not allowed with const allocation");
     }
+    if (FLAG_warn_new_tearoff_syntax) {
+      ReportWarning(
+          "Tear-offs using the x#id syntax is a deprecated feature,"
+          "and will not be supported in the next release");
+    }
     ConsumeToken();
     if (IsIdentifier()) {
       named_constructor = ExpectIdentifier("name of constructor expected");
@@ -13956,7 +13391,7 @@
   } else {
     // Allocate dummy node with no arguments so we don't have to deal
     // with the NULL corner case below.
-    arguments = new(Z) ArgumentListNode(TokenPos());
+    arguments = new (Z) ArgumentListNode(TokenPos());
   }
 
   // Parsing is complete, so we can return a throw in case of a malformed or
@@ -13966,6 +13401,15 @@
       const Error& error = Error::Handle(Z, type.error());
       ReportError(error);
     }
+    if (arguments->length() > 0) {
+      // Evaluate arguments for side-effects and throw.
+      LetNode* error_result = new (Z) LetNode(type_pos);
+      for (intptr_t i = 0; i < arguments->length(); ++i) {
+        error_result->AddNode(arguments->NodeAt(i));
+      }
+      error_result->AddNode(ThrowTypeError(type_pos, type));
+      return error_result;
+    }
     return ThrowTypeError(type_pos, type);
   }
 
@@ -13983,10 +13427,10 @@
   AbstractType& type_bound = AbstractType::ZoneHandle(Z);
 
   // Make sure that an appropriate constructor exists.
-  String& constructor_name = BuildConstructorName(T,
-              type_class_name, named_constructor);
-  Function& constructor = Function::ZoneHandle(Z,
-      type_class.LookupConstructor(constructor_name));
+  String& constructor_name =
+      BuildConstructorName(T, type_class_name, named_constructor);
+  Function& constructor =
+      Function::ZoneHandle(Z, type_class.LookupConstructor(constructor_name));
   if (constructor.IsNull()) {
     constructor = type_class.LookupFactory(constructor_name);
     if (constructor.IsNull()) {
@@ -13997,20 +13441,16 @@
       if (is_const) {
         type = ClassFinalizer::NewFinalizedMalformedType(
             Error::Handle(Z),  // No previous error.
-            script_,
-            call_pos,
+            script_, call_pos,
             "class '%s' has no constructor or factory named '%s'",
             String::Handle(Z, type_class.Name()).ToCString(),
             external_constructor_name.ToCString());
         ReportError(Error::Handle(Z, type.error()));
       }
-      return ThrowNoSuchMethodError(call_pos,
-                                    type_class,
-                                    external_constructor_name,
-                                    arguments,
-                                    InvocationMirror::kConstructor,
-                                    InvocationMirror::kMethod,
-                                    NULL);  // No existing function.
+      return ThrowNoSuchMethodError(
+          call_pos, type_class, external_constructor_name, arguments,
+          InvocationMirror::kConstructor, InvocationMirror::kMethod,
+          NULL);  // No existing function.
     } else if (constructor.IsRedirectingFactory()) {
       ClassFinalizer::ResolveRedirectingFactory(type_class, constructor);
       Type& redirect_type = Type::ZoneHandle(Z, constructor.RedirectionType());
@@ -14019,17 +13459,14 @@
         // The type arguments of the redirection type are instantiated from the
         // type arguments of the parsed type of the 'new' or 'const' expression.
         Error& error = Error::Handle(Z);
-        redirect_type ^= redirect_type.InstantiateFrom(
-            type_arguments,
-            &error,
-            NULL,  // instantiation_trail
-            NULL,  // bound_trail
-            Heap::kOld);
+        redirect_type ^=
+            redirect_type.InstantiateFrom(type_arguments, &error,
+                                          NULL,  // instantiation_trail
+                                          NULL,  // bound_trail
+                                          Heap::kOld);
         if (!error.IsNull()) {
           redirect_type = ClassFinalizer::NewFinalizedMalformedType(
-              error,
-              script_,
-              call_pos,
+              error, script_, call_pos,
               "redirecting factory type '%s' cannot be instantiated",
               String::Handle(Z, redirect_type.UserVisibleName()).ToCString());
         }
@@ -14039,9 +13476,10 @@
         // into throwing a type error.
         const UnresolvedClass& cls =
             UnresolvedClass::Handle(Z, redirect_type.unresolved_class());
-        const LibraryPrefix& prefix =
-            LibraryPrefix::Handle(Z, cls.library_prefix());
-        if (!prefix.IsNull() && !prefix.is_loaded()) {
+        const LibraryPrefix& prefix = LibraryPrefix::Cast(
+            Object::Handle(Z, cls.library_or_library_prefix()));
+        if (!prefix.IsNull() && !prefix.is_loaded() &&
+            !FLAG_load_deferred_eagerly) {
           // If the redirection type is unresolved because it refers to
           // an unloaded deferred prefix, mark this function as depending
           // on the library prefix. It will then get invalidated when the
@@ -14049,9 +13487,7 @@
           parsed_function()->AddDeferredPrefix(prefix);
         }
         redirect_type = ClassFinalizer::NewFinalizedMalformedType(
-            Error::Handle(Z),
-            script_,
-            call_pos,
+            Error::Handle(Z), script_, call_pos,
             "redirection type '%s' is not loaded",
             String::Handle(Z, redirect_type.UserVisibleName()).ToCString());
       }
@@ -14063,7 +13499,7 @@
         return ThrowTypeError(redirect_type.token_pos(), redirect_type);
       }
       if (I->type_checks() &&
-              !redirect_type.IsSubtypeOf(type, NULL, NULL, Heap::kOld)) {
+          !redirect_type.IsSubtypeOf(type, NULL, NULL, Heap::kOld)) {
         // Additional type checking of the result is necessary.
         type_bound = type.raw();
       }
@@ -14088,28 +13524,27 @@
   // a dynamic error to instantiate an abstract class.
   if (type_class.is_abstract() && !constructor.IsFactory()) {
     // Evaluate arguments before throwing.
-    LetNode* result = new(Z) LetNode(call_pos);
+    LetNode* result = new (Z) LetNode(call_pos);
     for (intptr_t i = 0; i < arguments->length(); ++i) {
       result->AddNode(arguments->NodeAt(i));
     }
-    ArgumentListNode* error_arguments = new(Z) ArgumentListNode(type_pos);
-    error_arguments->Add(new(Z) LiteralNode(
-        TokenPos(), Integer::ZoneHandle(Z, Integer::New(type_pos.value(),
-                                                        Heap::kOld))));
-    error_arguments->Add(new(Z) LiteralNode(
+    ArgumentListNode* error_arguments = new (Z) ArgumentListNode(type_pos);
+    error_arguments->Add(new (Z) LiteralNode(
+        TokenPos(),
+        Integer::ZoneHandle(Z, Integer::New(type_pos.value(), Heap::kOld))));
+    error_arguments->Add(new (Z) LiteralNode(
         TokenPos(), String::ZoneHandle(Z, type_class_name.raw())));
-    result->AddNode(
-        MakeStaticCall(Symbols::AbstractClassInstantiationError(),
-                       Library::PrivateCoreLibName(Symbols::ThrowNew()),
-                       error_arguments));
+    result->AddNode(MakeStaticCall(
+        Symbols::AbstractClassInstantiationError(),
+        Library::PrivateCoreLibName(Symbols::ThrowNew()), error_arguments));
     return result;
   }
 
   type_arguments ^= type_arguments.Canonicalize();
 
   if (is_tearoff_expression) {
-    const Function& tearoff_func = Function::ZoneHandle(Z,
-        BuildConstructorClosureFunction(constructor, new_pos));
+    const Function& tearoff_func = Function::ZoneHandle(
+        Z, BuildConstructorClosureFunction(constructor, new_pos));
 
     // Local functions normally get parsed when the enclosing function is
     // compiled. Since constructor tearoff closures don't get parsed here,
@@ -14119,20 +13554,19 @@
     OpenFunctionBlock(tearoff_func);
     // If there are type arguments in the tearoff expression that are
     // not yet instantiated, capture the instantiator.
-    if (IsInstantiatorRequired() &&
-        !type_arguments.IsNull() && !type_arguments.IsInstantiated()) {
+    if (IsInstantiatorRequired() && !type_arguments.IsNull() &&
+        !type_arguments.IsInstantiated()) {
       CaptureInstantiator();
     }
     SequenceNode* tearoff_body = CloseBlock();
     ClosureNode* closure_obj =
-        new(Z) ClosureNode(new_pos, tearoff_func, NULL, tearoff_body->scope());
+        new (Z) ClosureNode(new_pos, tearoff_func, NULL, tearoff_body->scope());
     return closure_obj;
   }
 
   ASSERT(!is_tearoff_expression);
   String& error_message = String::Handle(Z);
-  if (!constructor.AreValidArguments(arguments_length,
-                                     arguments->names(),
+  if (!constructor.AreValidArguments(arguments_length, arguments->names(),
                                      &error_message)) {
     const String& external_constructor_name =
         (named_constructor ? constructor_name : type_class_name);
@@ -14144,13 +13578,10 @@
                   String::Handle(Z, type_class.Name()).ToCString(),
                   error_message.ToCString());
     }
-    return ThrowNoSuchMethodError(call_pos,
-                                  type_class,
-                                  external_constructor_name,
-                                  arguments,
+    return ThrowNoSuchMethodError(call_pos, type_class,
+                                  external_constructor_name, arguments,
                                   InvocationMirror::kConstructor,
-                                  InvocationMirror::kMethod,
-                                  &constructor);
+                                  InvocationMirror::kMethod, &constructor);
   }
 
   // Return a throw in case of a malformed or malbounded type or report a
@@ -14168,42 +13599,37 @@
     if (!constructor.is_const()) {
       const String& external_constructor_name =
           (named_constructor ? constructor_name : type_class_name);
-      ReportError("non-const constructor '%s' cannot be used in "
-                  "const object creation",
-                  external_constructor_name.ToCString());
+      ReportError(
+          "non-const constructor '%s' cannot be used in "
+          "const object creation",
+          external_constructor_name.ToCString());
     }
 
     Instance& const_instance = Instance::ZoneHandle(Z);
     if (GetCachedConstant(new_pos, &const_instance)) {
       // Cache hit, nothing else to do.
     } else {
-      Object& constructor_result = Object::Handle(Z,
-          EvaluateConstConstructorCall(type_class,
-                                       type_arguments,
-                                       constructor,
-                                       arguments));
+      Object& constructor_result = Object::Handle(
+          Z, EvaluateConstConstructorCall(type_class, type_arguments,
+                                          constructor, arguments));
       if (constructor_result.IsUnhandledException()) {
         // It's a compile-time error if invocation of a const constructor
         // call fails.
-        ReportErrors(Error::Cast(constructor_result),
-                     script_, new_pos,
+        ReportErrors(Error::Cast(constructor_result), script_, new_pos,
                      "error while evaluating const constructor");
       }
       const_instance ^= constructor_result.raw();
       CacheConstantValue(new_pos, const_instance);
     }
-    new_object = new(Z) LiteralNode(new_pos, const_instance);
+    new_object = new (Z) LiteralNode(new_pos, const_instance);
     if (!type_bound.IsNull()) {
       ASSERT(!type_bound.IsMalformed());
       Error& bound_error = Error::Handle(Z);
       ASSERT(!is_top_level_);  // We cannot check unresolved types.
-      if (!const_instance.IsInstanceOf(type_bound,
-                                       TypeArguments::Handle(Z),
+      if (!const_instance.IsInstanceOf(type_bound, TypeArguments::Handle(Z),
                                        &bound_error)) {
         type_bound = ClassFinalizer::NewFinalizedMalformedType(
-            bound_error,
-            script_,
-            new_pos,
+            bound_error, script_, new_pos,
             "const factory result is not an instance of '%s'",
             String::Handle(Z, type_bound.UserVisibleName()).ToCString());
         new_object = ThrowTypeError(new_pos, type_bound);
@@ -14212,20 +13638,19 @@
     }
   } else {
     CheckConstructorCallTypeArguments(new_pos, constructor, type_arguments);
-    if (!type_arguments.IsNull() &&
-        !type_arguments.IsInstantiated() &&
+    if (!type_arguments.IsNull() && !type_arguments.IsInstantiated() &&
         (FunctionLevel() > 0)) {
       // Make sure that the instantiator is captured.
       CaptureInstantiator();
     }
     // If the type argument vector is not instantiated, we verify in checked
     // mode at runtime that it is within its declared bounds.
-    new_object = CreateConstructorCallNode(
-        new_pos, type_arguments, constructor, arguments);
+    new_object = CreateConstructorCallNode(new_pos, type_arguments, constructor,
+                                           arguments);
   }
   if (!type_bound.IsNull()) {
-    new_object = new(Z) AssignableNode(
-         new_pos, new_object, type_bound, Symbols::FactoryResult());
+    new_object = new (Z) AssignableNode(new_pos, new_object, type_bound,
+                                        Symbols::FactoryResult());
   }
   return new_object;
 }
@@ -14234,16 +13659,17 @@
 String& Parser::Interpolate(const GrowableArray<AstNode*>& values) {
   NoReloadScope no_reload_scope(isolate(), thread());
   NoOOBMessageScope no_msg_scope(thread());
-  const Class& cls = Class::Handle(
-      Z, Library::LookupCoreClass(Symbols::StringBase()));
+  const Class& cls =
+      Class::Handle(Z, Library::LookupCoreClass(Symbols::StringBase()));
   ASSERT(!cls.IsNull());
-  const Function& func = Function::Handle(Z, cls.LookupStaticFunction(
-      Library::PrivateCoreLibName(Symbols::Interpolate())));
+  const Function& func = Function::Handle(
+      Z, cls.LookupStaticFunction(
+             Library::PrivateCoreLibName(Symbols::Interpolate())));
   ASSERT(!func.IsNull());
 
   // Build the array of literal values to interpolate.
-  const Array& value_arr = Array::Handle(Z,
-      Array::New(values.length(), Heap::kOld));
+  const Array& value_arr =
+      Array::Handle(Z, Array::New(values.length(), Heap::kOld));
   for (int i = 0; i < values.length(); i++) {
     ASSERT(values[i]->IsLiteralNode());
     value_arr.SetAt(i, values[i]->AsLiteralNode()->literal());
@@ -14278,11 +13704,10 @@
   const TokenPosition literal_start = TokenPos();
   ASSERT(CurrentToken() == Token::kSTRING);
   Token::Kind l1_token = LookaheadToken(1);
-  if ((l1_token != Token::kSTRING) &&
-      (l1_token != Token::kINTERPOL_VAR) &&
+  if ((l1_token != Token::kSTRING) && (l1_token != Token::kINTERPOL_VAR) &&
       (l1_token != Token::kINTERPOL_START)) {
     // Common case: no interpolation.
-    primary = new(Z) LiteralNode(literal_start, *CurrentLiteral());
+    primary = new (Z) LiteralNode(literal_start, *CurrentLiteral());
     ConsumeToken();
     return primary;
   }
@@ -14293,8 +13718,8 @@
   Instance& cached_string = Instance::Handle(Z);
   if (GetCachedConstant(literal_start, &cached_string)) {
     SkipStringLiteral();
-    return new(Z) LiteralNode(literal_start,
-                              Instance::ZoneHandle(Z, cached_string.raw()));
+    return new (Z) LiteralNode(literal_start,
+                               Instance::ZoneHandle(Z, cached_string.raw()));
   }
 
   bool is_compiletime_const = true;
@@ -14304,11 +13729,11 @@
     if (CurrentLiteral()->Length() > 0) {
       // Only add non-empty string sections to the values list
       // that will be concatenated.
-      values_list.Add(new(Z) LiteralNode(TokenPos(), *CurrentLiteral()));
+      values_list.Add(new (Z) LiteralNode(TokenPos(), *CurrentLiteral()));
     }
     ConsumeToken();
     while ((CurrentToken() == Token::kINTERPOL_VAR) ||
-        (CurrentToken() == Token::kINTERPOL_START)) {
+           (CurrentToken() == Token::kINTERPOL_START)) {
       if (!allow_interpolation) {
         ReportError("string interpolation not allowed in this context");
       }
@@ -14333,13 +13758,11 @@
       if (is_compiletime_const) {
         const Object* const_expr = expr->EvalConstExpr();
         if ((const_expr != NULL) &&
-            (const_expr->IsNumber() ||
-            const_expr->IsString() ||
-            const_expr->IsBool() ||
-            const_expr->IsNull())) {
+            (const_expr->IsNumber() || const_expr->IsString() ||
+             const_expr->IsBool() || const_expr->IsNull())) {
           // Change expr into a literal.
-          expr = new(Z) LiteralNode(expr_pos,
-                                    EvaluateConstExpr(expr_pos, expr));
+          expr =
+              new (Z) LiteralNode(expr_pos, EvaluateConstExpr(expr_pos, expr));
         } else {
           is_compiletime_const = false;
         }
@@ -14350,7 +13773,7 @@
   if (is_compiletime_const) {
     if (has_interpolation) {
       const String& interpolated_string = Interpolate(values_list);
-      primary = new(Z) LiteralNode(literal_start, interpolated_string);
+      primary = new (Z) LiteralNode(literal_start, interpolated_string);
       CacheConstantValue(literal_start, interpolated_string);
     } else {
       GrowableHandlePtrArray<const String> pieces(Z, values_list.length());
@@ -14359,18 +13782,16 @@
         ASSERT(part.IsString());
         pieces.Add(String::Cast(part));
       }
-      const String& lit = String::ZoneHandle(Z,
-          Symbols::FromConcatAll(T, pieces));
-      primary = new(Z) LiteralNode(literal_start, lit);
+      const String& lit =
+          String::ZoneHandle(Z, Symbols::FromConcatAll(T, pieces));
+      primary = new (Z) LiteralNode(literal_start, lit);
       // Caching of constant not necessary because the symbol lookup will
       // find the value next time.
     }
   } else {
-    ArrayNode* values = new(Z) ArrayNode(
-        TokenPos(),
-        Type::ZoneHandle(Z, Type::ArrayType()),
-        values_list);
-    primary = new(Z) StringInterpolateNode(TokenPos(), values);
+    ArrayNode* values = new (Z) ArrayNode(
+        TokenPos(), Type::ZoneHandle(Z, Type::ArrayType()), values_list);
+    primary = new (Z) StringInterpolateNode(TokenPos(), values);
   }
   return primary;
 }
@@ -14382,18 +13803,19 @@
   AstNode* primary = NULL;
   const Token::Kind token = CurrentToken();
   if (IsFunctionLiteral()) {
-    // The name of a literal function is visible from inside the function, but
-    // must not collide with names in the scope declaring the literal.
-    OpenBlock();
     primary = ParseFunctionStatement(true);
-    CloseBlock();
   } else if (IsIdentifier()) {
     TokenPosition qual_ident_pos = TokenPos();
     const LibraryPrefix& prefix = LibraryPrefix::ZoneHandle(Z, ParsePrefix());
     if (!prefix.IsNull()) {
       if (CurrentToken() == Token::kHASH) {
+        if (FLAG_warn_new_tearoff_syntax) {
+          ReportWarning(
+              "Tear-offs using the x#id syntax is a deprecated feature,"
+              "it will not be supported in the next release");
+        }
         // Closurization of top-level entity in prefix scope.
-        return new(Z) LiteralNode(qual_ident_pos, prefix);
+        return new (Z) LiteralNode(qual_ident_pos, prefix);
       } else {
         ExpectToken(Token::kPERIOD);
       }
@@ -14402,15 +13824,15 @@
     ConsumeToken();
     if (prefix.IsNull()) {
       intptr_t primary_func_level = 0;
-      ResolveIdentInLocalScope(
-          qual_ident_pos, ident, &primary, &primary_func_level);
+      ResolveIdentInLocalScope(qual_ident_pos, ident, &primary,
+                               &primary_func_level);
       // Check whether the identifier is shadowed by a function type parameter.
       if (!innermost_function().IsNull()) {
         // TODO(regis): Shortcut this lookup if no generic functions in scope.
         intptr_t type_param_func_level = FunctionLevel();
-        TypeParameter& type_param = TypeParameter::ZoneHandle(Z,
-            innermost_function().LookupTypeParameter(ident,
-                                                     &type_param_func_level));
+        TypeParameter& type_param = TypeParameter::ZoneHandle(
+            Z, innermost_function().LookupTypeParameter(
+                   ident, &type_param_func_level));
         if (!type_param.IsNull()) {
           if ((primary == NULL) ||
               (primary_func_level < type_param_func_level)) {
@@ -14420,17 +13842,17 @@
               // Make sure that the function instantiator is captured.
               CaptureFunctionInstantiator();
             }
-            return new(Z) PrimaryNode(qual_ident_pos, type_param);
+            return new (Z) PrimaryNode(qual_ident_pos, type_param);
           }
         }
       }
       if (primary == NULL) {
         // Check whether the identifier is a type parameter.
         if (!current_class().IsNull()) {
-          TypeParameter& type_param = TypeParameter::ZoneHandle(Z,
-              current_class().LookupTypeParameter(ident));
+          TypeParameter& type_param = TypeParameter::ZoneHandle(
+              Z, current_class().LookupTypeParameter(ident));
           if (!type_param.IsNull()) {
-            return new(Z) PrimaryNode(qual_ident_pos, type_param);
+            return new (Z) PrimaryNode(qual_ident_pos, type_param);
           }
         }
         // This is a non-local unqualified identifier so resolve the
@@ -14449,41 +13871,21 @@
       // interpret the unresolved identifier as an instance method or
       // instance getter call when compiling an instance method.
       if (primary == NULL) {
-        if (prefix.is_deferred_load() &&
-            ident.Equals(Symbols::LoadLibrary())) {
+        if (prefix.is_deferred_load() && ident.Equals(Symbols::LoadLibrary())) {
           // Hack Alert: recognize special 'loadLibrary' call on the
           // prefix object. The prefix is the primary. Rewind parser and
           // let ParseSelectors() handle the loadLibrary call.
           SetPosition(qual_ident_pos);
           ConsumeToken();  // Prefix name.
-          primary = new(Z) LiteralNode(qual_ident_pos, prefix);
+          primary = new (Z) LiteralNode(qual_ident_pos, prefix);
         } else {
-          // TODO(hausner): Ideally we should generate the NoSuchMethodError
-          // later, when we know more about how the unresolved name is used.
-          // For example, we don't know yet whether the unresolved name
-          // refers to a getter or a setter. However, it is more awkward
-          // to distinuish four NoSuchMethodError cases all over the place
-          // in the parser. The four cases are: prefixed vs non-prefixed
-          // name, static vs dynamic context in which the unresolved name
-          // is used. We cheat a little here by looking at the next token
-          // to determine whether we have an unresolved method call or
-          // field access.
           GrowableHandlePtrArray<const String> pieces(Z, 3);
           pieces.Add(String::Handle(Z, prefix.name()));
           pieces.Add(Symbols::Dot());
           pieces.Add(ident);
-          const String& qualified_name = String::ZoneHandle(Z,
-              Symbols::FromConcatAll(T, pieces));
-          InvocationMirror::Type call_type =
-              CurrentToken() == Token::kLPAREN ?
-                  InvocationMirror::kMethod : InvocationMirror::kGetter;
-          primary = ThrowNoSuchMethodError(qual_ident_pos,
-                                           current_class(),
-                                           qualified_name,
-                                           NULL,  // No arguments.
-                                           InvocationMirror::kTopLevel,
-                                           call_type,
-                                           NULL);  // No existing function.
+          const String& qualified_name =
+              String::ZoneHandle(Z, Symbols::FromConcatAll(T, pieces));
+          primary = new (Z) PrimaryNode(qual_ident_pos, qualified_name);
         }
       } else if (FLAG_load_deferred_eagerly && prefix.is_deferred_load()) {
         // primary != NULL.
@@ -14491,22 +13893,19 @@
         pieces.Add(String::Handle(Z, prefix.name()));
         pieces.Add(Symbols::Dot());
         pieces.Add(ident);
-        const String& qualified_name = String::ZoneHandle(Z,
-            Symbols::FromConcatAll(T, pieces));
-        InvocationMirror::Type call_type =
-            CurrentToken() == Token::kLPAREN ?
-                InvocationMirror::kMethod : InvocationMirror::kGetter;
+        const String& qualified_name =
+            String::ZoneHandle(Z, Symbols::FromConcatAll(T, pieces));
+        InvocationMirror::Type call_type = CurrentToken() == Token::kLPAREN
+                                               ? InvocationMirror::kMethod
+                                               : InvocationMirror::kGetter;
         // Note: Adding a statement to current block is a hack, parsing an
         // espression should have no side-effect.
         current_block_->statements->Add(ThrowNoSuchMethodError(
-                                            qual_ident_pos,
-                                            current_class(),
-                                            qualified_name,
-                                            NULL,  // No arguments.
-                                            InvocationMirror::kTopLevel,
-                                            call_type,
-                                            NULL,  // No existing function.
-                                            &prefix));
+            qual_ident_pos, current_class(), qualified_name,
+            NULL,  // No arguments.
+            InvocationMirror::kTopLevel, call_type,
+            NULL,  // No existing function.
+            &prefix));
       }
     }
     ASSERT(primary != NULL);
@@ -14515,20 +13914,20 @@
     if (local == NULL) {
       ReportError("receiver 'this' is not in scope");
     }
-    primary = new(Z) LoadLocalNode(TokenPos(), local);
+    primary = new (Z) LoadLocalNode(TokenPos(), local);
     ConsumeToken();
   } else if (token == Token::kINTEGER) {
     const Integer& literal = Integer::ZoneHandle(Z, CurrentIntegerLiteral());
-    primary = new(Z) LiteralNode(TokenPos(), literal);
+    primary = new (Z) LiteralNode(TokenPos(), literal);
     ConsumeToken();
   } else if (token == Token::kTRUE) {
-    primary = new(Z) LiteralNode(TokenPos(), Bool::True());
+    primary = new (Z) LiteralNode(TokenPos(), Bool::True());
     ConsumeToken();
   } else if (token == Token::kFALSE) {
-    primary = new(Z) LiteralNode(TokenPos(), Bool::False());
+    primary = new (Z) LiteralNode(TokenPos(), Bool::False());
     ConsumeToken();
   } else if (token == Token::kNULL) {
-    primary = new(Z) LiteralNode(TokenPos(), Object::null_instance());
+    primary = new (Z) LiteralNode(TokenPos(), Object::null_instance());
     ConsumeToken();
   } else if (token == Token::kLPAREN) {
     ConsumeToken();
@@ -14541,7 +13940,7 @@
     if (double_value.IsNull()) {
       ReportError("invalid double literal");
     }
-    primary = new(Z) LiteralNode(TokenPos(), double_value);
+    primary = new (Z) LiteralNode(TokenPos(), double_value);
     ConsumeToken();
   } else if (token == Token::kSTRING) {
     primary = ParseStringLiteral(true);
@@ -14558,10 +13957,8 @@
       ConsumeToken();
       primary = ParseNewOperator(Token::kCONST);
     }
-  } else if (token == Token::kLT ||
-             token == Token::kLBRACK ||
-             token == Token::kINDEX ||
-             token == Token::kLBRACE) {
+  } else if (token == Token::kLT || token == Token::kLBRACK ||
+             token == Token::kINDEX || token == Token::kLBRACE) {
     primary = ParseCompoundLiteral();
   } else if (token == Token::kHASH) {
     primary = ParseSymbolLiteral();
@@ -14585,13 +13982,13 @@
         primary = ParseSuperFieldAccess(ident, ident_pos);
       }
     } else if ((CurrentToken() == Token::kLBRACK) ||
-        Token::CanBeOverloaded(CurrentToken()) ||
-        (CurrentToken() == Token::kNE)) {
+               Token::CanBeOverloaded(CurrentToken()) ||
+               (CurrentToken() == Token::kNE)) {
       primary = ParseSuperOperator();
     } else if (CurrentToken() == Token::kQM_PERIOD) {
       ReportError("super call or super getter may not use ?.");
     } else {
-      primary = new(Z) PrimaryNode(super_pos, Symbols::Super());
+      primary = new (Z) PrimaryNode(super_pos, Symbols::Super());
     }
   } else {
     UnexpectedToken();
@@ -14609,7 +14006,7 @@
   if (expr->IsLiteralNode()) {
     return expr->AsLiteralNode()->literal();
   } else if (expr->IsLoadLocalNode() &&
-      expr->AsLoadLocalNode()->local().IsConst()) {
+             expr->AsLoadLocalNode()->local().IsConst()) {
     return *expr->AsLoadLocalNode()->local().ConstValue();
   } else if (expr->IsLoadStaticFieldNode()) {
     const Field& field = expr->AsLoadStaticFieldNode()->field();
@@ -14636,18 +14033,17 @@
     if (GetCachedConstant(expr_pos, &value)) {
       return value;
     }
-    ReturnNode* ret = new(Z) ReturnNode(expr_pos, expr);
+    ReturnNode* ret = new (Z) ReturnNode(expr_pos, expr);
     // Compile time constant expressions cannot reference anything from a
     // local scope.
-    LocalScope* empty_scope = new(Z) LocalScope(NULL, 0, 0);
-    SequenceNode* seq = new(Z) SequenceNode(expr_pos, empty_scope);
+    LocalScope* empty_scope = new (Z) LocalScope(NULL, 0, 0);
+    SequenceNode* seq = new (Z) SequenceNode(expr_pos, empty_scope);
     seq->Add(ret);
 
     INC_STAT(thread_, num_execute_const, 1);
     Object& result = Object::Handle(Z, Compiler::ExecuteOnce(seq));
     if (result.IsError()) {
-      ReportErrors(Error::Cast(result),
-                   script_, expr_pos,
+      ReportErrors(Error::Cast(result), script_, expr_pos,
                    "error evaluating constant expression");
     }
     ASSERT(result.IsInstance() || result.IsNull());
@@ -14667,10 +14063,7 @@
     ExpectIdentifier("function name expected");
   }
   if (CurrentToken() == Token::kLPAREN) {
-    const bool allow_explicit_default_values = true;
-    ParamList params;
-    params.skipped = true;
-    ParseFormalParameterList(allow_explicit_default_values, false, &params);
+    SkipToMatchingParenthesis();
   }
   RawFunction::AsyncModifier async_modifier = ParseFunctionModifier();
   BoolScope allow_await(&this->await_is_keyword_,
@@ -14769,8 +14162,7 @@
   if (CurrentToken() == Token::kLT) {
     SkipTypeArguments();
   }
-  if ((CurrentToken() == Token::kLBRACK) ||
-      (CurrentToken() == Token::kINDEX)) {
+  if ((CurrentToken() == Token::kLBRACK) || (CurrentToken() == Token::kINDEX)) {
     SkipListLiteral();
   } else if (CurrentToken() == Token::kLBRACE) {
     SkipMapLiteral();
@@ -14909,7 +14301,7 @@
         ExpectIdentifier("identifier or [ expected after ..");
       }
     } else if ((current_token == Token::kPERIOD) ||
-        (current_token == Token::kQM_PERIOD)) {
+               (current_token == Token::kQM_PERIOD)) {
       ConsumeToken();
       ExpectIdentifier("identifier expected");
     } else if (current_token == Token::kLBRACK) {
@@ -14945,8 +14337,7 @@
 
 
 void Parser::SkipUnaryExpr() {
-  if (IsPrefixOperator(CurrentToken()) ||
-      IsIncrementOperator(CurrentToken()) ||
+  if (IsPrefixOperator(CurrentToken()) || IsIncrementOperator(CurrentToken()) ||
       IsAwaitKeyword()) {
     ConsumeToken();
     SkipUnaryExpr();
@@ -14961,7 +14352,7 @@
   const int min_prec = Token::Precedence(Token::kIFNULL);
   const int max_prec = Token::Precedence(Token::kMUL);
   while (((min_prec <= Token::Precedence(CurrentToken())) &&
-      (Token::Precedence(CurrentToken()) <= max_prec))) {
+          (Token::Precedence(CurrentToken()) <= max_prec))) {
     if (CurrentToken() == Token::kIS) {
       ConsumeToken();
       if (CurrentToken() == Token::kNOT) {
@@ -15034,6 +14425,12 @@
 }
 
 
+kernel::ScopeBuildingResult* ParsedFunction::EnsureKernelScopes() {
+  UNREACHABLE();
+  return NULL;
+}
+
+
 LocalVariable* ParsedFunction::EnsureExpressionTemp() {
   UNREACHABLE();
   return NULL;
diff --git a/runtime/vm/parser.h b/runtime/vm/parser.h
index 9134bb1..004913e 100644
--- a/runtime/vm/parser.h
+++ b/runtime/vm/parser.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_PARSER_H_
-#define VM_PARSER_H_
+#ifndef RUNTIME_VM_PARSER_H_
+#define RUNTIME_VM_PARSER_H_
 
 #include "include/dart_api.h"
 
@@ -14,6 +14,7 @@
 #include "vm/ast.h"
 #include "vm/class_finalizer.h"
 #include "vm/compiler_stats.h"
+#include "vm/kernel.h"
 #include "vm/hash_table.h"
 #include "vm/object.h"
 #include "vm/raw_object.h"
@@ -22,13 +23,21 @@
 namespace dart {
 
 // Forward declarations.
+
+namespace kernel {
+
+class ScopeBuildingResult;
+
+}  // kernel
+
 class ArgumentsDescriptor;
 class Isolate;
 class LocalScope;
 class LocalVariable;
 struct RegExpCompileData;
 class SourceLabel;
-template <typename T> class GrowableArray;
+template <typename T>
+class GrowableArray;
 class Parser;
 
 struct CatchParamDesc;
@@ -66,18 +75,14 @@
     const Smi& key = Smi::Cast(obj);
     return HashValue(key.Value());
   }
-  static uword Hash(const TokenPosition& key) {
-    return HashValue(key.value());
-  }
+  static uword Hash(const TokenPosition& key) { return HashValue(key.value()); }
   // Used by CacheConstantValue if a new constant is added to the map.
   static RawObject* NewKey(const TokenPosition& key) {
     return Smi::New(key.value());
   }
 
  private:
-  static uword HashValue(intptr_t pos) {
-    return pos % (Smi::kMaxValue - 13);
-  }
+  static uword HashValue(intptr_t pos) { return pos % (Smi::kMaxValue - 13); }
 };
 typedef UnorderedHashMap<ConstMapKeyEqualsTraits> ConstantsMap;
 
@@ -101,13 +106,13 @@
         first_stack_local_index_(0),
         num_copied_params_(0),
         num_stack_locals_(0),
-        have_seen_await_expr_(false) {
+        have_seen_await_expr_(false),
+        kernel_scopes_(NULL) {
     ASSERT(function.IsZoneHandle());
     // Every function has a local variable for the current context.
-    LocalVariable* temp = new(zone()) LocalVariable(
-        function.token_pos(),
-        Symbols::CurrentContextVar(),
-        Object::dynamic_type());
+    LocalVariable* temp = new (zone())
+        LocalVariable(function.token_pos(), function.token_pos(),
+                      Symbols::CurrentContextVar(), Object::dynamic_type());
     ASSERT(temp != NULL);
     current_context_var_ = temp;
   }
@@ -149,9 +154,7 @@
     return default_parameter_values_;
   }
 
-  LocalVariable* current_context_var() const {
-    return current_context_var_;
-  }
+  LocalVariable* current_context_var() const { return current_context_var_; }
 
   LocalVariable* expression_temp_var() const {
     ASSERT(has_expression_temp_var());
@@ -161,9 +164,7 @@
     ASSERT(!has_expression_temp_var());
     expression_temp_var_ = value;
   }
-  bool has_expression_temp_var() const {
-    return expression_temp_var_ != NULL;
-  }
+  bool has_expression_temp_var() const { return expression_temp_var_ != NULL; }
 
   LocalVariable* finally_return_temp_var() const {
     ASSERT(has_finally_return_temp_var());
@@ -195,8 +196,7 @@
   int num_copied_params() const { return num_copied_params_; }
   int num_stack_locals() const { return num_stack_locals_; }
   int num_non_copied_params() const {
-    return (num_copied_params_ == 0)
-        ? function().num_fixed_parameters() : 0;
+    return (num_copied_params_ == 0) ? function().num_fixed_parameters() : 0;
   }
 
   void AllocateVariables();
@@ -215,6 +215,8 @@
 
   void Bailout(const char* origin, const char* reason) const;
 
+  kernel::ScopeBuildingResult* EnsureKernelScopes();
+
  private:
   Thread* thread_;
   const Function& function_;
@@ -235,6 +237,8 @@
   int num_stack_locals_;
   bool have_seen_await_expr_;
 
+  kernel::ScopeBuildingResult* kernel_scopes_;
+
   friend class Parser;
   DISALLOW_COPY_AND_ASSIGN(ParsedFunction);
 };
@@ -287,9 +291,7 @@
   class TryStack;
   class TokenPosScope;
 
-  Parser(const Script& script,
-         const Library& library,
-         TokenPosition token_pos);
+  Parser(const Script& script, const Library& library, TokenPosition token_pos);
   Parser(const Script& script,
          ParsedFunction* function,
          TokenPosition token_pos);
@@ -331,9 +333,7 @@
   void set_current_class(const Class& value);
 
   // ParsedFunction accessor.
-  ParsedFunction* parsed_function() const {
-    return parsed_function_;
-  }
+  ParsedFunction* parsed_function() const { return parsed_function_; }
 
   const Script& script() const { return script_; }
   void SetScript(const Script& script, TokenPosition token_pos);
@@ -344,7 +344,7 @@
   // Parsing a library or a regular source script.
   bool is_library_source() const {
     return (script_.kind() == RawScript::kScriptTag) ||
-        (script_.kind() == RawScript::kLibraryTag);
+           (script_.kind() == RawScript::kLibraryTag);
   }
 
   bool is_part_source() const {
@@ -356,9 +356,7 @@
     return script_.kind() == RawScript::kPatchTag;
   }
 
-  TokenPosition TokenPos() const {
-    return tokens_iterator_.CurrentPosition();
-  }
+  TokenPosition TokenPos() const { return tokens_iterator_.CurrentPosition(); }
   TokenPosition PrevTokenPos() const { return prev_token_pos_; }
 
   Token::Kind CurrentToken() {
@@ -439,8 +437,10 @@
 
   // Concatenate and report an already formatted error and a new error message.
   static void ReportErrors(const Error& prev_error,
-                           const Script& script, TokenPosition token_pos,
-                           const char* format, ...) PRINTF_ATTRIBUTE(4, 5);
+                           const Script& script,
+                           TokenPosition token_pos,
+                           const char* format,
+                           ...) PRINTF_ATTRIBUTE(4, 5);
 
   // Report error message at location of current token in current script.
   void ReportError(const char* msg, ...) const PRINTF_ATTRIBUTE(2, 3);
@@ -448,15 +448,15 @@
   void ReportErrorBefore(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
 
   // Report error message at given location in current script.
-  void ReportError(TokenPosition token_pos,
-                   const char* msg, ...) const PRINTF_ATTRIBUTE(3, 4);
+  void ReportError(TokenPosition token_pos, const char* msg, ...) const
+      PRINTF_ATTRIBUTE(3, 4);
 
   // Report warning message at location of current token in current script.
   void ReportWarning(const char* msg, ...) const PRINTF_ATTRIBUTE(2, 3);
 
   // Report warning message at given location in current script.
-  void ReportWarning(TokenPosition token_pos,
-                     const char* msg, ...) const PRINTF_ATTRIBUTE(3, 4);
+  void ReportWarning(TokenPosition token_pos, const char* msg, ...) const
+      PRINTF_ATTRIBUTE(3, 4);
 
   void CheckRecursiveInvocation();
 
@@ -486,11 +486,14 @@
                     const Object& tl_owner,
                     TokenPosition metadata_pos);
   void ParseTopLevelVariable(TopLevel* top_level,
-                             const Object& owner, TokenPosition metadata_pos);
+                             const Object& owner,
+                             TokenPosition metadata_pos);
   void ParseTopLevelFunction(TopLevel* top_level,
-                             const Object& owner, TokenPosition metadata_pos);
+                             const Object& owner,
+                             TokenPosition metadata_pos);
   void ParseTopLevelAccessor(TopLevel* top_level,
-                             const Object& owner, TokenPosition metadata_pos);
+                             const Object& owner,
+                             TokenPosition metadata_pos);
   RawArray* EvaluateMetadata();
 
   RawFunction::AsyncModifier ParseFunctionModifier();
@@ -515,11 +518,10 @@
   RawAbstractType* ParseType(ClassFinalizer::FinalizationKind finalization,
                              bool allow_deferred_type = false,
                              bool consume_unresolved_prefix = true);
-  RawAbstractType* ParseType(
-      ClassFinalizer::FinalizationKind finalization,
-      bool allow_deferred_type,
-      bool consume_unresolved_prefix,
-      LibraryPrefix* prefix);
+  RawAbstractType* ParseType(ClassFinalizer::FinalizationKind finalization,
+                             bool allow_deferred_type,
+                             bool consume_unresolved_prefix,
+                             LibraryPrefix* prefix);
 
   void ParseTypeParameters(bool parameterizing_class);
   RawTypeArguments* ParseTypeArguments(
@@ -546,20 +548,18 @@
       const Class& cls,
       LocalVariable* receiver,
       GrowableArray<Field*>* initialized_fields);
-  AstNode* CheckDuplicateFieldInit(
-      TokenPosition init_pos,
-      GrowableArray<Field*>* initialized_fields,
-      AstNode* instance,
-      Field* field,
-      AstNode* init_value);
+  AstNode* CheckDuplicateFieldInit(TokenPosition init_pos,
+                                   GrowableArray<Field*>* initialized_fields,
+                                   AstNode* instance,
+                                   Field* field,
+                                   AstNode* init_value);
   StaticCallNode* GenerateSuperConstructorCall(
       const Class& cls,
       TokenPosition supercall_pos,
       LocalVariable* receiver,
       ArgumentListNode* forwarding_args);
-  StaticCallNode* ParseSuperInitializer(
-      const Class& cls,
-      LocalVariable* receiver);
+  StaticCallNode* ParseSuperInitializer(const Class& cls,
+                                        LocalVariable* receiver);
   AstNode* ParseInitializer(const Class& cls,
                             LocalVariable* receiver,
                             GrowableArray<Field*>* initialized_fields);
@@ -649,7 +649,7 @@
 
   SequenceNode* CloseAsyncClosure(SequenceNode* body);
   SequenceNode* CloseAsyncTryBlock(SequenceNode* try_block);
-  SequenceNode* CloseAsyncGeneratorTryBlock(SequenceNode *body);
+  SequenceNode* CloseAsyncGeneratorTryBlock(SequenceNode* body);
 
   void AddAsyncClosureParameters(ParamList* params);
   void AddContinuationVariables();
@@ -720,11 +720,10 @@
   // Pop the inner most try block from the stack.
   TryStack* PopTry();
   // Collect saved try context variables if await or yield is in try block.
-  void CheckAsyncOpInTryBlock(
-      LocalVariable** saved_try_ctx,
-      LocalVariable** async_saved_try_ctx,
-      LocalVariable** outer_saved_try_ctx,
-      LocalVariable** outer_async_saved_try_ctx) const;
+  void CheckAsyncOpInTryBlock(LocalVariable** saved_try_ctx,
+                              LocalVariable** async_saved_try_ctx,
+                              LocalVariable** outer_saved_try_ctx,
+                              LocalVariable** outer_async_saved_try_ctx) const;
   // Add specified node to try block list so that it can be patched with
   // inlined finally code if needed.
   void AddNodeForFinallyInlining(AstNode* node);
@@ -826,7 +825,7 @@
   const AbstractType* ReceiverType(const Class& cls);
   bool IsInstantiatorRequired() const;
   bool ResolveIdentInLocalScope(TokenPosition ident_pos,
-                                const String &ident,
+                                const String& ident,
                                 AstNode** node,
                                 intptr_t* function_level);
   static const bool kResolveLocally = true;
@@ -910,7 +909,7 @@
   Isolate* isolate() const { return isolate_; }
   Zone* zone() const { return thread_->zone(); }
 
-  Thread* thread_;  // Cached current thread.
+  Thread* thread_;    // Cached current thread.
   Isolate* isolate_;  // Cached current isolate.
 
   Script& script_;
@@ -981,4 +980,4 @@
 
 }  // namespace dart
 
-#endif  // VM_PARSER_H_
+#endif  // RUNTIME_VM_PARSER_H_
diff --git a/runtime/vm/parser_test.cc b/runtime/vm/parser_test.cc
index 14fae8e..ece6a9a 100644
--- a/runtime/vm/parser_test.cc
+++ b/runtime/vm/parser_test.cc
@@ -21,8 +21,8 @@
 static void DumpFunction(const Library& lib,
                          const char* cname,
                          const char* fname) {
-  const String& classname = String::Handle(Symbols::New(Thread::Current(),
-                                                        cname));
+  const String& classname =
+      String::Handle(Symbols::New(Thread::Current(), cname));
   String& funcname = String::Handle(String::New(fname));
 
   bool retval;
@@ -32,7 +32,7 @@
     Class& cls = Class::Handle(lib.LookupClass(classname));
     EXPECT(!cls.IsNull());
     Function& function =
-      Function::ZoneHandle(cls.LookupStaticFunction(funcname));
+        Function::ZoneHandle(cls.LookupStaticFunction(funcname));
     EXPECT(!function.IsNull());
     ParsedFunction* parsed_function =
         new ParsedFunction(Thread::Current(), function);
@@ -58,8 +58,8 @@
                 const char* field_name,
                 bool expect_static,
                 bool is_final) {
-  const String& classname = String::Handle(Symbols::New(Thread::Current(),
-                                                        class_name));
+  const String& classname =
+      String::Handle(Symbols::New(Thread::Current(), class_name));
   Class& cls = Class::Handle(lib.LookupClass(classname));
   EXPECT(!cls.IsNull());
 
@@ -94,8 +94,8 @@
                    const char* class_name,
                    const char* function_name,
                    bool expect_static) {
-  const String& classname = String::Handle(Symbols::New(Thread::Current(),
-                                                        class_name));
+  const String& classname =
+      String::Handle(Symbols::New(Thread::Current(), class_name));
   Class& cls = Class::Handle(lib.LookupClass(classname));
   EXPECT(!cls.IsNull());
 
@@ -126,9 +126,8 @@
 
   String& url = String::Handle(String::New("dart-test:Parser_TopLevel"));
   String& source = String::Handle(String::New(script_chars));
-  Script& script = Script::Handle(Script::New(url,
-                                              source,
-                                              RawScript::kScriptTag));
+  Script& script =
+      Script::Handle(Script::New(url, source, RawScript::kScriptTag));
   Library& lib = Library::ZoneHandle(Library::CoreLibrary());
 
   script.Tokenize(String::Handle(String::New("")));
@@ -161,9 +160,8 @@
 
   String& url = String::Handle(String::New("dart-test:Parser_TopLevel"));
   String& source = String::Handle(String::New(script_chars));
-  Script& script = Script::Handle(Script::New(url,
-                                              source,
-                                              RawScript::kScriptTag));
+  Script& script =
+      Script::Handle(Script::New(url, source, RawScript::kScriptTag));
   Library& lib = Library::ZoneHandle(Library::CoreLibrary());
 
   script.Tokenize(String::Handle(String::New("")));
@@ -217,8 +215,7 @@
 static void SaveVars(Dart_IsolateId isolate_id,
                      intptr_t bp_id,
                      const Dart_CodeLocation& loc) {
-  DebuggerStackTrace* stack =
-      Isolate::Current()->debugger()->StackTrace();
+  DebuggerStackTrace* stack = Isolate::Current()->debugger()->StackTrace();
   intptr_t num_frames = stack->Length();
   const int kBufferLen = 2048;
   char* buffer = new char[kBufferLen];
@@ -228,13 +225,12 @@
     ActivationFrame* frame = stack->FrameAt(i);
     var_desc = frame->code().GetLocalVarDescriptors();
     const char* var_str = SkipIndex(var_desc.ToCString());
-    const char* function_str = String::Handle(
-        frame->function().QualifiedUserVisibleName()).ToCString();
-    pos += OS::SNPrint(pos, (kBufferLen - (pos - buffer)),
-                       "%s\n%s",
-                       function_str,
-                       var_str);
-    delete [] var_str;
+    const char* function_str =
+        String::Handle(frame->function().QualifiedUserVisibleName())
+            .ToCString();
+    pos += OS::SNPrint(pos, (kBufferLen - (pos - buffer)), "%s\n%s",
+                       function_str, var_str);
+    delete[] var_str;
   }
   pos[0] = '\0';
   saved_vars = buffer;
diff --git a/runtime/vm/port.cc b/runtime/vm/port.cc
index d5513d5..20a142d 100644
--- a/runtime/vm/port.cc
+++ b/runtime/vm/port.cc
@@ -112,11 +112,12 @@
     map_[index].handler->increment_live_ports();
   }
   if (FLAG_trace_isolates) {
-    OS::Print("[^] Port (%s) -> (%s): \n"
-              "\thandler:    %s\n"
-              "\tport:       %" Pd64 "\n",
-              PortStateString(old_state), PortStateString(state),
-              map_[index].handler->name(), port);
+    OS::Print(
+        "[^] Port (%s) -> (%s): \n"
+        "\thandler:    %s\n"
+        "\tport:       %" Pd64 "\n",
+        PortStateString(old_state), PortStateString(state),
+        map_[index].handler->name(), port);
   }
 }
 
@@ -174,10 +175,11 @@
   MaintainInvariants();
 
   if (FLAG_trace_isolates) {
-    OS::Print("[+] Opening port: \n"
-              "\thandler:    %s\n"
-              "\tport:       %" Pd64 "\n",
-              handler->name(), entry.port);
+    OS::Print(
+        "[+] Opening port: \n"
+        "\thandler:    %s\n"
+        "\tport:       %" Pd64 "\n",
+        handler->name(), entry.port);
   }
 
   return entry.port;
diff --git a/runtime/vm/port.h b/runtime/vm/port.h
index 6e41e3a..113562e 100644
--- a/runtime/vm/port.h
+++ b/runtime/vm/port.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_PORT_H_
-#define VM_PORT_H_
+#ifndef RUNTIME_VM_PORT_H_
+#define RUNTIME_VM_PORT_H_
 
 #include "include/dart_api.h"
 #include "vm/allocation.h"
@@ -102,4 +102,4 @@
 
 }  // namespace dart
 
-#endif  // VM_PORT_H_
+#endif  // RUNTIME_VM_PORT_H_
diff --git a/runtime/vm/port_test.cc b/runtime/vm/port_test.cc
index ee443cd..d42a3e6 100644
--- a/runtime/vm/port_test.cc
+++ b/runtime/vm/port_test.cc
@@ -34,9 +34,7 @@
  public:
   PortTestMessageHandler() : notify_count(0) {}
 
-  void MessageNotify(Message::Priority priority) {
-    notify_count++;
-  }
+  void MessageNotify(Message::Priority priority) { notify_count++; }
 
   MessageStatus HandleMessage(Message* message) { return kOK; }
 
@@ -141,9 +139,9 @@
   const char* message = "msg";
   intptr_t message_len = strlen(message) + 1;
 
-  EXPECT(PortMap::PostMessage(new Message(
-      port, reinterpret_cast<uint8_t*>(strdup(message)), message_len,
-      Message::kNormalPriority)));
+  EXPECT(PortMap::PostMessage(
+      new Message(port, reinterpret_cast<uint8_t*>(strdup(message)),
+                  message_len, Message::kNormalPriority)));
 
   // Check that the message notify callback was called.
   EXPECT_EQ(1, handler.notify_count);
@@ -156,8 +154,8 @@
   Dart_Port port = PortMap::CreatePort(&handler);
   EXPECT_EQ(0, handler.notify_count);
 
-  EXPECT(PortMap::PostMessage(new Message(
-      port, Smi::New(42), Message::kNormalPriority)));
+  EXPECT(PortMap::PostMessage(
+      new Message(port, Smi::New(42), Message::kNormalPriority)));
 
   // Check that the message notify callback was called.
   EXPECT_EQ(1, handler.notify_count);
@@ -170,8 +168,8 @@
   Dart_Port port = PortMap::CreatePort(&handler);
   EXPECT_EQ(0, handler.notify_count);
 
-  EXPECT(PortMap::PostMessage(new Message(
-      port, Object::null(), Message::kNormalPriority)));
+  EXPECT(PortMap::PostMessage(
+      new Message(port, Object::null(), Message::kNormalPriority)));
 
   // Check that the message notify callback was called.
   EXPECT_EQ(1, handler.notify_count);
@@ -188,9 +186,9 @@
   const char* message = "msg";
   intptr_t message_len = strlen(message) + 1;
 
-  EXPECT(!PortMap::PostMessage(new Message(
-      port, reinterpret_cast<uint8_t*>(strdup(message)), message_len,
-      Message::kNormalPriority)));
+  EXPECT(!PortMap::PostMessage(
+      new Message(port, reinterpret_cast<uint8_t*>(strdup(message)),
+                  message_len, Message::kNormalPriority)));
 }
 
 }  // namespace dart
diff --git a/runtime/vm/precompiler.cc b/runtime/vm/precompiler.cc
index d55a6f1..8d72d929a 100644
--- a/runtime/vm/precompiler.cc
+++ b/runtime/vm/precompiler.cc
@@ -53,7 +53,10 @@
 
 DEFINE_FLAG(bool, print_unique_targets, false, "Print unique dynaic targets");
 DEFINE_FLAG(bool, trace_precompiler, false, "Trace precompiler.");
-DEFINE_FLAG(int, max_speculative_inlining_attempts, 1,
+DEFINE_FLAG(
+    int,
+    max_speculative_inlining_attempts,
+    1,
     "Max number of attempts with speculative inlining (precompilation only)");
 DEFINE_FLAG(int, precompiler_rounds, 1, "Number of precompiler iterations");
 
@@ -80,16 +83,13 @@
  public:
   explicit DartPrecompilationPipeline(Zone* zone,
                                       FieldTypeMap* field_map = NULL)
-      : zone_(zone),
-        result_type_(CompileType::None()),
-        field_map_(field_map) { }
+      : zone_(zone), result_type_(CompileType::None()), field_map_(field_map) {}
 
   virtual void FinalizeCompilation(FlowGraph* flow_graph) {
-    if ((field_map_ != NULL )&&
+    if ((field_map_ != NULL) &&
         flow_graph->function().IsGenerativeConstructor()) {
       for (BlockIterator block_it = flow_graph->reverse_postorder_iterator();
-           !block_it.Done();
-           block_it.Advance()) {
+           !block_it.Done(); block_it.Advance()) {
         ForwardInstructionIterator it(block_it.Current());
         for (; !it.Done(); it.Advance()) {
           StoreInstanceFieldInstr* store = it.Current()->AsStoreInstanceField();
@@ -106,18 +106,18 @@
                     &Field::Handle(zone_, store->field().raw()),  // Re-wrap.
                     store->value()->Type()->ToCid()));
                 if (FLAG_trace_precompiler && FLAG_support_il_printer) {
-                    THR_Print(" initial type = %s\n",
-                              store->value()->Type()->ToCString());
+                  THR_Print(" initial type = %s\n",
+                            store->value()->Type()->ToCString());
                 }
                 continue;
               }
               CompileType type = CompileType::FromCid(entry->cid_);
               if (FLAG_trace_precompiler && FLAG_support_il_printer) {
-                  THR_Print(" old type = %s\n", type.ToCString());
+                THR_Print(" old type = %s\n", type.ToCString());
               }
               type.Union(store->value()->Type());
               if (FLAG_trace_precompiler && FLAG_support_il_printer) {
-                  THR_Print(" new type = %s\n", type.ToCString());
+                THR_Print(" new type = %s\n", type.ToCString());
               }
               entry->cid_ = type.ToCid();
             }
@@ -128,8 +128,7 @@
 
     CompileType result_type = CompileType::None();
     for (BlockIterator block_it = flow_graph->reverse_postorder_iterator();
-         !block_it.Done();
-         block_it.Advance()) {
+         !block_it.Done(); block_it.Advance()) {
       ForwardInstructionIterator it(block_it.Current());
       for (; !it.Done(); it.Advance()) {
         ReturnInstr* return_instr = it.Current()->AsReturn();
@@ -152,12 +151,13 @@
 
 class PrecompileParsedFunctionHelper : public ValueObject {
  public:
-  PrecompileParsedFunctionHelper(ParsedFunction* parsed_function,
+  PrecompileParsedFunctionHelper(Precompiler* precompiler,
+                                 ParsedFunction* parsed_function,
                                  bool optimized)
-      : parsed_function_(parsed_function),
+      : precompiler_(precompiler),
+        parsed_function_(parsed_function),
         optimized_(optimized),
-        thread_(Thread::Current()) {
-  }
+        thread_(Thread::Current()) {}
 
   bool Compile(CompilationPipeline* pipeline);
 
@@ -171,6 +171,7 @@
                            FlowGraphCompiler* graph_compiler,
                            FlowGraph* flow_graph);
 
+  Precompiler* precompiler_;
   ParsedFunction* parsed_function_;
   const bool optimized_;
   Thread* const thread_;
@@ -213,7 +214,8 @@
   const TypeArguments& type_arguments =
       TypeArguments::Handle(zone, type.arguments());
   if (!type_arguments.IsNull() &&
-      !type_arguments.IsRaw(0, type_arguments.Length())) return false;
+      !type_arguments.IsRaw(0, type_arguments.Length()))
+    return false;
 
 
   intptr_t type_cid = type.type_class_id();
@@ -287,35 +289,35 @@
 }
 
 
-Precompiler::Precompiler(Thread* thread, bool reset_fields) :
-    thread_(thread),
-    zone_(NULL),
-    isolate_(thread->isolate()),
-    reset_fields_(reset_fields),
-    changed_(false),
-    function_count_(0),
-    class_count_(0),
-    selector_count_(0),
-    dropped_function_count_(0),
-    dropped_field_count_(0),
-    dropped_class_count_(0),
-    dropped_typearg_count_(0),
-    dropped_type_count_(0),
-    dropped_library_count_(0),
-    libraries_(GrowableObjectArray::Handle(I->object_store()->libraries())),
-    pending_functions_(
-        GrowableObjectArray::Handle(GrowableObjectArray::New())),
-    sent_selectors_(),
-    enqueued_functions_(),
-    fields_to_retain_(),
-    functions_to_retain_(),
-    classes_to_retain_(),
-    typeargs_to_retain_(),
-    types_to_retain_(),
-    consts_to_retain_(),
-    field_type_map_(),
-    error_(Error::Handle()) {
-}
+Precompiler::Precompiler(Thread* thread, bool reset_fields)
+    : thread_(thread),
+      zone_(NULL),
+      isolate_(thread->isolate()),
+      reset_fields_(reset_fields),
+      changed_(false),
+      function_count_(0),
+      class_count_(0),
+      selector_count_(0),
+      dropped_function_count_(0),
+      dropped_field_count_(0),
+      dropped_class_count_(0),
+      dropped_typearg_count_(0),
+      dropped_type_count_(0),
+      dropped_library_count_(0),
+      libraries_(GrowableObjectArray::Handle(I->object_store()->libraries())),
+      pending_functions_(
+          GrowableObjectArray::Handle(GrowableObjectArray::New())),
+      sent_selectors_(),
+      enqueued_functions_(),
+      fields_to_retain_(),
+      functions_to_retain_(),
+      classes_to_retain_(),
+      typeargs_to_retain_(),
+      types_to_retain_(),
+      consts_to_retain_(),
+      field_type_map_(),
+      error_(Error::Handle()),
+      get_runtime_type_is_unique_(false) {}
 
 
 void Precompiler::DoCompileAll(
@@ -326,7 +328,8 @@
     StackZone stack_zone(T);
     zone_ = stack_zone.GetZone();
 
-    { HANDLESCOPE(T);
+    {
+      HANDLESCOPE(T);
       // Make sure class hierarchy is stable before compilation so that CHA
       // can be used. Also ensures lookup of entry points won't miss functions
       // because their class hasn't been finalized yet.
@@ -450,15 +453,14 @@
   class StaticInitializerVisitor : public ClassVisitor {
    public:
     explicit StaticInitializerVisitor(Zone* zone)
-      : fields_(Array::Handle(zone)),
-        field_(Field::Handle(zone)),
-        function_(Function::Handle(zone)) { }
+        : fields_(Array::Handle(zone)),
+          field_(Field::Handle(zone)),
+          function_(Function::Handle(zone)) {}
     void Visit(const Class& cls) {
       fields_ = cls.fields();
       for (intptr_t j = 0; j < fields_.Length(); j++) {
         field_ ^= fields_.At(j);
-        if (field_.is_static() &&
-            field_.is_final() &&
+        if (field_.is_static() && field_.is_final() &&
             field_.has_initializer()) {
           if (FLAG_trace_precompiler) {
             THR_Print("Precompiling initializer for %s\n", field_.ToCString());
@@ -483,10 +485,8 @@
 void Precompiler::PrecompileConstructors() {
   class ConstructorVisitor : public FunctionVisitor {
    public:
-    explicit ConstructorVisitor(Zone* zone, FieldTypeMap* map)
-        : zone_(zone), field_type_map_(map) {
-      ASSERT(map != NULL);
-    }
+    explicit ConstructorVisitor(Precompiler* precompiler, Zone* zone)
+        : precompiler_(precompiler), zone_(zone) {}
     void Visit(const Function& function) {
       if (!function.IsGenerativeConstructor()) return;
       if (function.HasCode()) {
@@ -497,29 +497,28 @@
       if (FLAG_trace_precompiler) {
         THR_Print("Precompiling constructor %s\n", function.ToCString());
       }
-      CompileFunction(Thread::Current(),
-                      zone_,
-                      function,
-                      field_type_map_);
+      CompileFunction(precompiler_, Thread::Current(), zone_, function,
+                      precompiler_->field_type_map());
     }
+
    private:
+    Precompiler* precompiler_;
     Zone* zone_;
-    FieldTypeMap* field_type_map_;
   };
 
   HANDLESCOPE(T);
-  ConstructorVisitor visitor(zone_, &field_type_map_);
+  ConstructorVisitor visitor(this, zone_);
   VisitFunctions(&visitor);
 
   FieldTypeMap::Iterator it(field_type_map_.GetIterator());
-  for (FieldTypePair* current = it.Next();
-       current != NULL;
+  for (FieldTypePair* current = it.Next(); current != NULL;
        current = it.Next()) {
     const intptr_t cid = current->cid_;
     current->field_->set_guarded_cid(cid);
     current->field_->set_is_nullable(cid == kNullCid || cid == kDynamicCid);
     if (FLAG_trace_precompiler) {
-      THR_Print("Field %s <- Type %s\n", current->field_->ToCString(),
+      THR_Print(
+          "Field %s <- Type %s\n", current->field_->ToCString(),
           Class::Handle(T->isolate()->class_table()->At(cid)).ToCString());
     }
   }
@@ -537,9 +536,7 @@
   VisitFunctions(&function_visitor);
 
   class ClearCodeClassVisitor : public ClassVisitor {
-    void Visit(const Class& cls) {
-      cls.DisableAllocationStub();
-    }
+    void Visit(const Class& cls) { cls.DisableAllocationStub(); }
   };
   ClearCodeClassVisitor class_visitor;
   VisitClasses(&class_visitor);
@@ -561,10 +558,8 @@
     if (!isolate()->class_table()->HasValidClassAt(cid)) {
       continue;
     }
-    if ((cid == kDynamicCid) ||
-        (cid == kVoidCid) ||
-        (cid == kFreeListElement) ||
-        (cid == kForwardingCorpse)) {
+    if ((cid == kDynamicCid) || (cid == kVoidCid) ||
+        (cid == kFreeListElement) || (cid == kForwardingCorpse)) {
       continue;
     }
     cls = isolate()->class_table()->At(cid);
@@ -573,49 +568,48 @@
 
   Dart_QualifiedFunctionName vm_entry_points[] = {
     // Functions
-    { "dart:async", "::", "_setScheduleImmediateClosure" },
-    { "dart:core", "::", "_completeDeferredLoads" },
-    { "dart:core", "AbstractClassInstantiationError",
-                   "AbstractClassInstantiationError._create" },
-    { "dart:core", "ArgumentError", "ArgumentError." },
-    { "dart:core", "CyclicInitializationError",
-                   "CyclicInitializationError." },
-    { "dart:core", "FallThroughError", "FallThroughError._create" },
-    { "dart:core", "FormatException", "FormatException." },
-    { "dart:core", "NoSuchMethodError", "NoSuchMethodError._withType" },
-    { "dart:core", "NullThrownError", "NullThrownError." },
-    { "dart:core", "OutOfMemoryError", "OutOfMemoryError." },
-    { "dart:core", "RangeError", "RangeError." },
-    { "dart:core", "RangeError", "RangeError.range" },
-    { "dart:core", "StackOverflowError", "StackOverflowError." },
-    { "dart:core", "UnsupportedError", "UnsupportedError." },
-    { "dart:core", "_AssertionError", "_AssertionError._create" },
-    { "dart:core", "_CastError", "_CastError._create" },
-    { "dart:core", "_InternalError", "_InternalError." },
-    { "dart:core", "_InvocationMirror", "_allocateInvocationMirror" },
-    { "dart:core", "_TypeError", "_TypeError._create" },
-    { "dart:isolate", "IsolateSpawnException", "IsolateSpawnException." },
-    { "dart:isolate", "::", "_getIsolateScheduleImmediateClosure" },
-    { "dart:isolate", "::", "_setupHooks" },
-    { "dart:isolate", "::", "_startMainIsolate" },
-    { "dart:isolate", "::", "_startIsolate" },
-    { "dart:isolate", "_RawReceivePortImpl", "_handleMessage" },
-    { "dart:isolate", "_RawReceivePortImpl", "_lookupHandler" },
-    { "dart:isolate", "_SendPortImpl", "send" },
-    { "dart:typed_data", "ByteData", "ByteData." },
-    { "dart:typed_data", "ByteData", "ByteData._view" },
-    { "dart:typed_data", "ByteBuffer", "ByteBuffer._New" },
-    { "dart:_vmservice", "::", "_registerIsolate" },
-    { "dart:_vmservice", "::", "boot" },
+    {"dart:async", "::", "_setScheduleImmediateClosure"},
+    {"dart:core", "::", "_completeDeferredLoads"},
+    {"dart:core", "AbstractClassInstantiationError",
+     "AbstractClassInstantiationError._create"},
+    {"dart:core", "ArgumentError", "ArgumentError."},
+    {"dart:core", "CyclicInitializationError", "CyclicInitializationError."},
+    {"dart:core", "FallThroughError", "FallThroughError._create"},
+    {"dart:core", "FormatException", "FormatException."},
+    {"dart:core", "NoSuchMethodError", "NoSuchMethodError._withType"},
+    {"dart:core", "NullThrownError", "NullThrownError."},
+    {"dart:core", "OutOfMemoryError", "OutOfMemoryError."},
+    {"dart:core", "RangeError", "RangeError."},
+    {"dart:core", "RangeError", "RangeError.range"},
+    {"dart:core", "StackOverflowError", "StackOverflowError."},
+    {"dart:core", "UnsupportedError", "UnsupportedError."},
+    {"dart:core", "_AssertionError", "_AssertionError._create"},
+    {"dart:core", "_CastError", "_CastError._create"},
+    {"dart:core", "_InternalError", "_InternalError."},
+    {"dart:core", "_InvocationMirror", "_allocateInvocationMirror"},
+    {"dart:core", "_TypeError", "_TypeError._create"},
+    {"dart:isolate", "IsolateSpawnException", "IsolateSpawnException."},
+    {"dart:isolate", "::", "_getIsolateScheduleImmediateClosure"},
+    {"dart:isolate", "::", "_setupHooks"},
+    {"dart:isolate", "::", "_startMainIsolate"},
+    {"dart:isolate", "::", "_startIsolate"},
+    {"dart:isolate", "_RawReceivePortImpl", "_handleMessage"},
+    {"dart:isolate", "_RawReceivePortImpl", "_lookupHandler"},
+    {"dart:isolate", "_SendPortImpl", "send"},
+    {"dart:typed_data", "ByteData", "ByteData."},
+    {"dart:typed_data", "ByteData", "ByteData._view"},
+    {"dart:typed_data", "ByteBuffer", "ByteBuffer._New"},
+    {"dart:_vmservice", "::", "_registerIsolate"},
+    {"dart:_vmservice", "::", "boot"},
 #if !defined(PRODUCT)
-    { "dart:developer", "Metrics", "_printMetrics" },
-    { "dart:developer", "::", "_runExtension" },
-    { "dart:isolate", "::", "_runPendingImmediateCallback" },
+    {"dart:developer", "Metrics", "_printMetrics"},
+    {"dart:developer", "::", "_runExtension"},
+    {"dart:isolate", "::", "_runPendingImmediateCallback"},
 #endif  // !PRODUCT
     // Fields
-    { "dart:core", "Error", "_stackTrace" },
-    { "dart:math", "_Random", "_state" },
-    { NULL, NULL, NULL }  // Must be terminated with NULL entries.
+    {"dart:core", "Error", "_stackTrace"},
+    {"dart:math", "_Random", "_state"},
+    {NULL, NULL, NULL}  // Must be terminated with NULL entries.
   };
 
   AddEntryPoints(vm_entry_points);
@@ -639,8 +633,9 @@
 
     lib = Library::LookupLibrary(T, library_uri);
     if (lib.IsNull()) {
-      String& msg = String::Handle(Z, String::NewFormatted(
-          "Cannot find entry point %s\n", entry_points[i].library_uri));
+      String& msg =
+          String::Handle(Z, String::NewFormatted("Cannot find entry point %s\n",
+                                                 entry_points[i].library_uri));
       Jump(Error::Handle(Z, ApiError::New(msg)));
       UNREACHABLE();
     }
@@ -657,10 +652,10 @@
       }
       cls = lib.LookupLocalClass(class_name);
       if (cls.IsNull()) {
-        String& msg = String::Handle(Z, String::NewFormatted(
-            "Cannot find entry point %s %s\n",
-            entry_points[i].library_uri,
-            entry_points[i].class_name));
+        String& msg = String::Handle(
+            Z, String::NewFormatted("Cannot find entry point %s %s\n",
+                                    entry_points[i].library_uri,
+                                    entry_points[i].class_name));
         Jump(Error::Handle(Z, ApiError::New(msg)));
         UNREACHABLE();
       }
@@ -671,11 +666,11 @@
     }
 
     if (func.IsNull() && field.IsNull()) {
-      String& msg = String::Handle(Z, String::NewFormatted(
-          "Cannot find entry point %s %s %s\n",
-          entry_points[i].library_uri,
-          entry_points[i].class_name,
-          entry_points[i].function_name));
+      String& msg = String::Handle(
+          Z, String::NewFormatted("Cannot find entry point %s %s %s\n",
+                                  entry_points[i].library_uri,
+                                  entry_points[i].class_name,
+                                  entry_points[i].function_name));
       Jump(Error::Handle(Z, ApiError::New(msg)));
       UNREACHABLE();
     }
@@ -754,8 +749,7 @@
         if (FLAG_trace_precompiler) {
           THR_Print("Found callback field %s\n", field_name.ToCString());
         }
-        args_desc =
-            ArgumentsDescriptor::New(function.num_fixed_parameters());
+        args_desc = ArgumentsDescriptor::New(function.num_fixed_parameters());
         cids.Clear();
         if (T->cha()->ConcreteSubclasses(cls, &cids)) {
           for (intptr_t j = 0; j < cids.length(); ++j) {
@@ -763,9 +757,7 @@
             if (subcls.is_allocated()) {
               // Add dispatcher to cls.
               dispatcher = subcls.GetInvocationDispatcher(
-                  field_name,
-                  args_desc,
-                  RawFunction::kInvokeFieldDispatcher,
+                  field_name, args_desc, RawFunction::kInvokeFieldDispatcher,
                   /* create_if_absent = */ true);
               if (FLAG_trace_precompiler) {
                 THR_Print("Added invoke-field-dispatcher for %s to %s\n",
@@ -786,8 +778,7 @@
     function_count_++;
 
     if (FLAG_trace_precompiler) {
-      THR_Print("Precompiling %" Pd " %s (%s, %s)\n",
-                function_count_,
+      THR_Print("Precompiling %" Pd " %s (%s, %s)\n", function_count_,
                 function.ToLibNamePrefixedQualifiedCString(),
                 function.token_pos().ToCString(),
                 Function::KindToCString(function.kind()));
@@ -796,7 +787,7 @@
     ASSERT(!function.is_abstract());
     ASSERT(!function.IsRedirectingFactory());
 
-    error_ = CompileFunction(thread_, zone_, function);
+    error_ = CompileFunction(this, thread_, zone_, function);
     if (!error_.IsNull()) {
       Jump(error_);
     }
@@ -1052,10 +1043,10 @@
 
   class ConstObjectVisitor : public ObjectPointerVisitor {
    public:
-    ConstObjectVisitor(Precompiler* precompiler, Isolate* isolate) :
-        ObjectPointerVisitor(isolate),
-        precompiler_(precompiler),
-        subinstance_(Object::Handle()) {}
+    ConstObjectVisitor(Precompiler* precompiler, Isolate* isolate)
+        : ObjectPointerVisitor(isolate),
+          precompiler_(precompiler),
+          subinstance_(Object::Handle()) {}
 
     virtual void VisitPointers(RawObject** first, RawObject** last) {
       for (RawObject** current = first; current <= last; current++) {
@@ -1082,11 +1073,10 @@
       Array::Handle(Z, call_site.arguments_descriptor());
   const Class& cache_class =
       Class::Handle(Z, I->object_store()->closure_class());
-  const Function& dispatcher = Function::Handle(Z,
-      cache_class.GetInvocationDispatcher(Symbols::Call(),
-                                          arguments_descriptor,
-                                          RawFunction::kInvokeFieldDispatcher,
-                                          true /* create_if_absent */));
+  const Function& dispatcher = Function::Handle(
+      Z, cache_class.GetInvocationDispatcher(
+             Symbols::Call(), arguments_descriptor,
+             RawFunction::kInvokeFieldDispatcher, true /* create_if_absent */));
   AddFunction(dispatcher);
 }
 
@@ -1113,8 +1103,8 @@
           THR_Print("Precompiling initializer for %s\n", field.ToCString());
         }
         ASSERT(Dart::snapshot_kind() != Snapshot::kAppNoJIT);
-        const Function& initializer = Function::Handle(Z,
-            CompileStaticInitializer(field, /* compute_type = */ true));
+        const Function& initializer = Function::Handle(
+            Z, CompileStaticInitializer(field, /* compute_type = */ true));
         ASSERT(!initializer.IsNull());
         field.SetPrecompiledInitializer(initializer);
         AddCalleesOf(initializer);
@@ -1128,13 +1118,22 @@
                                                    bool compute_type) {
   ASSERT(field.is_static());
   Thread* thread = Thread::Current();
-  StackZone zone(thread);
+  StackZone stack_zone(thread);
+  Zone* zone = stack_zone.GetZone();
 
-  ParsedFunction* parsed_function = Parser::ParseStaticFieldInitializer(field);
+  ParsedFunction* parsed_function;
+  // Check if this field is comming from the Kernel binary.
+  if (field.kernel_field() != NULL) {
+    parsed_function = kernel::ParseStaticFieldInitializer(zone, field);
+  } else {
+    parsed_function = Parser::ParseStaticFieldInitializer(field);
+    parsed_function->AllocateVariables();
+  }
 
-  parsed_function->AllocateVariables();
-  DartPrecompilationPipeline pipeline(zone.GetZone());
-  PrecompileParsedFunctionHelper helper(parsed_function,
+
+  DartPrecompilationPipeline pipeline(zone);
+  PrecompileParsedFunctionHelper helper(/* precompiler = */ NULL,
+                                        parsed_function,
                                         /* optimized = */ true);
   bool success = helper.Compile(&pipeline);
   ASSERT(success);
@@ -1181,8 +1180,7 @@
   } else {
     Thread* const thread = Thread::Current();
     StackZone zone(thread);
-    const Error& error =
-        Error::Handle(thread->zone(), thread->sticky_error());
+    const Error& error = Error::Handle(thread->zone(), thread->sticky_error());
     thread->clear_sticky_error();
     return error.raw();
   }
@@ -1208,7 +1206,7 @@
     const Function& func = Function::ZoneHandle(Function::New(
         String::Handle(Symbols::New(thread, kEvalConst)),
         RawFunction::kRegularFunction,
-        true,  // static function
+        true,   // static function
         false,  // not const function
         false,  // not abstract
         false,  // not external
@@ -1229,25 +1227,24 @@
     ParsedFunction* parsed_function = new ParsedFunction(thread, func);
     parsed_function->SetNodeSequence(fragment);
     fragment->scope()->AddVariable(parsed_function->EnsureExpressionTemp());
-    fragment->scope()->AddVariable(
-        parsed_function->current_context_var());
+    fragment->scope()->AddVariable(parsed_function->current_context_var());
     parsed_function->AllocateVariables();
 
     // Non-optimized code generator.
     DartPrecompilationPipeline pipeline(Thread::Current()->zone());
-    PrecompileParsedFunctionHelper helper(parsed_function,
+    PrecompileParsedFunctionHelper helper(/* precompiler = */ NULL,
+                                          parsed_function,
                                           /* optimized = */ false);
     helper.Compile(&pipeline);
-    Code::Handle(func.unoptimized_code()).set_var_descriptors(
-        Object::empty_var_descriptors());
+    Code::Handle(func.unoptimized_code())
+        .set_var_descriptors(Object::empty_var_descriptors());
 
     const Object& result = PassiveObject::Handle(
         DartEntry::InvokeFunction(func, Object::empty_array()));
     return result.raw();
   } else {
     Thread* const thread = Thread::Current();
-    const Object& result =
-      PassiveObject::Handle(thread->sticky_error());
+    const Object& result = PassiveObject::Handle(thread->sticky_error());
     thread->clear_sticky_error();
     return result.raw();
   }
@@ -1282,8 +1279,7 @@
     changed_ = true;
 
     if (FLAG_trace_precompiler) {
-      THR_Print("Enqueueing selector %" Pd " %s\n",
-                selector_count_,
+      THR_Print("Enqueueing selector %" Pd " %s\n", selector_count_,
                 selector.ToCString());
     }
   }
@@ -1355,8 +1351,8 @@
             // Function is get:foo and somewhere foo is called.
             AddFunction(function);
           }
-          selector3 = Symbols::LookupFromConcat(thread(),
-              Symbols::ClosurizePrefix(), selector2);
+          selector3 = Symbols::LookupFromConcat(
+              thread(), Symbols::ClosurizePrefix(), selector2);
           if (IsSent(selector3)) {
             // Hash-closurization.
             // Function is get:foo and somewhere get:#foo is called.
@@ -1370,8 +1366,8 @@
             AddFunction(function2);
           }
         } else if (Field::IsSetterName(selector)) {
-          selector2 = Symbols::LookupFromConcat(thread(),
-              Symbols::ClosurizePrefix(), selector);
+          selector2 = Symbols::LookupFromConcat(
+              thread(), Symbols::ClosurizePrefix(), selector);
           if (IsSent(selector2)) {
             // Hash-closurization.
             // Function is set:foo and somewhere get:#set:foo is called.
@@ -1396,8 +1392,8 @@
             function2 = function.GetMethodExtractor(selector2);
             AddFunction(function2);
           }
-          selector2 = Symbols::LookupFromConcat(thread(),
-              Symbols::ClosurizePrefix(), selector);
+          selector2 = Symbols::LookupFromConcat(
+              thread(), Symbols::ClosurizePrefix(), selector);
           if (IsSent(selector2)) {
             // Hash-closurization.
             // Function is foo and somewhere get:#foo is called.
@@ -1422,14 +1418,10 @@
 
   static bool IsMatch(const Object& a, const Object& b) {
     return a.IsString() && b.IsString() &&
-        String::Cast(a).Equals(String::Cast(b));
+           String::Cast(a).Equals(String::Cast(b));
   }
-  static uword Hash(const Object& obj) {
-    return String::Cast(obj).Hash();
-  }
-  static RawObject* NewKey(const String& str) {
-    return str.raw();
-  }
+  static uword Hash(const Object& obj) { return String::Cast(obj).Hash(); }
+  static RawObject* NewKey(const String& str) { return str.raw(); }
 };
 
 typedef UnorderedHashMap<NameFunctionsTraits> Table;
@@ -1495,8 +1487,7 @@
     }
   }
 
-  // Locate all entries with one function only, and whose owner is neither
-  // subclassed nor implemented.
+  // Locate all entries with one function only
   Table::Iterator iter(&table);
   String& key = String::Handle(Z);
   UniqueFunctionsSet functions_set(HashTables::New<UniqueFunctionsSet>(20));
@@ -1508,12 +1499,14 @@
     if (farray.Length() == 1) {
       function ^= farray.At(0);
       cls = function.Owner();
-      if (!CHA::IsImplemented(cls) && !CHA::HasSubclasses(cls)) {
-        functions_set.Insert(function);
-      }
+      functions_set.Insert(function);
     }
   }
 
+  farray ^= table.GetOrNull(Symbols::GetRuntimeType());
+
+  get_runtime_type_is_unique_ = !farray.IsNull() && (farray.Length() == 1);
+
   if (FLAG_print_unique_targets) {
     UniqueFunctionsSet::Iterator unique_iter(&functions_set);
     while (unique_iter.MoveNext()) {
@@ -1522,7 +1515,7 @@
       THR_Print("* %s\n", function.ToQualifiedCString());
     }
     THR_Print("%" Pd " of %" Pd " dynamic selectors are unique\n",
-        functions_set.NumOccupied(), table.NumOccupied());
+              functions_set.NumOccupied(), table.NumOccupied());
   }
 
   isolate()->object_store()->set_unique_dynamic_targets(
@@ -1724,13 +1717,11 @@
           bool top_level = cls.IsTopLevel();
           if (top_level) {
             name = field.DictionaryName();
-            bool removed = lib.RemoveObject(field, name);
-            ASSERT(removed);
+            lib.RemoveObject(field, name);
           }
           dropped_field_count_++;
           if (FLAG_trace_precompiler) {
-            THR_Print("Dropping field %s\n",
-                      field.ToCString());
+            THR_Print("Dropping field %s\n", field.ToCString());
           }
         }
       }
@@ -1809,8 +1800,8 @@
   // Now construct a new type arguments table and save in the object store.
   const intptr_t dict_size =
       Utils::RoundUpToPowerOfTwo(retained_typeargs.Length() * 4 / 3);
-  typeargs_array = HashTables::New<CanonicalTypeArgumentsSet>(dict_size,
-                                                              Heap::kOld);
+  typeargs_array =
+      HashTables::New<CanonicalTypeArgumentsSet>(dict_size, Heap::kOld);
   CanonicalTypeArgumentsSet typeargs_table(Z, typeargs_array.raw());
   bool present;
   for (intptr_t i = 0; i < retained_typeargs.Length(); i++) {
@@ -1962,8 +1953,7 @@
         class_table->StatsWithUpdatedSize(cid)->post_gc.old_count;
     if (instances != 0) {
       FATAL2("Want to drop class %s, but it has %" Pd " instances\n",
-             cls.ToCString(),
-             instances);
+             cls.ToCString(), instances);
     }
 #endif
 
@@ -1987,8 +1977,8 @@
 void Precompiler::DropLibraries() {
   const GrowableObjectArray& retained_libraries =
       GrowableObjectArray::Handle(Z, GrowableObjectArray::New());
-  const Library& root_lib = Library::Handle(Z,
-      I->object_store()->root_library());
+  const Library& root_lib =
+      Library::Handle(Z, I->object_store()->root_library());
   Library& lib = Library::Handle(Z);
 
   for (intptr_t i = 0; i < libraries_.Length(); i++) {
@@ -2040,13 +2030,12 @@
 void Precompiler::BindStaticCalls() {
   class BindStaticCallsVisitor : public FunctionVisitor {
    public:
-    explicit BindStaticCallsVisitor(Zone* zone) :
-        code_(Code::Handle(zone)),
-        table_(Array::Handle(zone)),
-        pc_offset_(Smi::Handle(zone)),
-        target_(Function::Handle(zone)),
-        target_code_(Code::Handle(zone)) {
-    }
+    explicit BindStaticCallsVisitor(Zone* zone)
+        : code_(Code::Handle(zone)),
+          table_(Array::Handle(zone)),
+          pc_offset_(Smi::Handle(zone)),
+          target_(Function::Handle(zone)),
+          target_code_(Code::Handle(zone)) {}
 
     void Visit(const Function& function) {
       if (!function.HasCode()) {
@@ -2055,8 +2044,7 @@
       code_ = function.CurrentCode();
       table_ = code_.static_calls_target_table();
 
-      for (intptr_t i = 0;
-           i < table_.Length();
+      for (intptr_t i = 0; i < table_.Length();
            i += Code::kSCallTableEntryLength) {
         pc_offset_ ^= table_.At(i + Code::kSCallTableOffsetEntry);
         target_ ^= table_.At(i + Code::kSCallTableFunctionEntry);
@@ -2107,18 +2095,17 @@
 
   class SwitchICCallsVisitor : public FunctionVisitor {
    public:
-    explicit SwitchICCallsVisitor(Zone* zone) :
-        zone_(zone),
-        code_(Code::Handle(zone)),
-        pool_(ObjectPool::Handle(zone)),
-        entry_(Object::Handle(zone)),
-        ic_(ICData::Handle(zone)),
-        target_name_(String::Handle(zone)),
-        args_descriptor_(Array::Handle(zone)),
-        unlinked_(UnlinkedCall::Handle(zone)),
-        target_code_(Code::Handle(zone)),
-        canonical_unlinked_calls_() {
-    }
+    explicit SwitchICCallsVisitor(Zone* zone)
+        : zone_(zone),
+          code_(Code::Handle(zone)),
+          pool_(ObjectPool::Handle(zone)),
+          entry_(Object::Handle(zone)),
+          ic_(ICData::Handle(zone)),
+          target_name_(String::Handle(zone)),
+          args_descriptor_(Array::Handle(zone)),
+          unlinked_(UnlinkedCall::Handle(zone)),
+          target_code_(Code::Handle(zone)),
+          canonical_unlinked_calls_() {}
 
     void Visit(const Function& function) {
       if (!function.HasCode()) {
@@ -2184,18 +2171,18 @@
 
 
 void Precompiler::ShareMegamorphicBuckets() {
-  const GrowableObjectArray& table = GrowableObjectArray::Handle(Z,
-      I->object_store()->megamorphic_cache_table());
+  const GrowableObjectArray& table = GrowableObjectArray::Handle(
+      Z, I->object_store()->megamorphic_cache_table());
   if (table.IsNull()) return;
   MegamorphicCache& cache = MegamorphicCache::Handle(Z);
 
   const intptr_t capacity = 1;
-  const Array& buckets = Array::Handle(Z,
-      Array::New(MegamorphicCache::kEntryLength * capacity, Heap::kOld));
+  const Array& buckets = Array::Handle(
+      Z, Array::New(MegamorphicCache::kEntryLength * capacity, Heap::kOld));
   const Function& handler =
       Function::Handle(Z, MegamorphicCacheTable::miss_handler(I));
-  MegamorphicCache::SetEntry(buckets, 0,
-                             MegamorphicCache::smi_illegal_cid(), handler);
+  MegamorphicCache::SetEntry(buckets, 0, MegamorphicCache::smi_illegal_cid(),
+                             handler);
 
   for (intptr_t i = 0; i < table.Length(); i++) {
     cache ^= table.At(i);
@@ -2209,13 +2196,12 @@
 void Precompiler::DedupStackmaps() {
   class DedupStackmapsVisitor : public FunctionVisitor {
    public:
-    explicit DedupStackmapsVisitor(Zone* zone) :
-      zone_(zone),
-      canonical_stackmaps_(),
-      code_(Code::Handle(zone)),
-      stackmaps_(Array::Handle(zone)),
-      stackmap_(Stackmap::Handle(zone)) {
-    }
+    explicit DedupStackmapsVisitor(Zone* zone)
+        : zone_(zone),
+          canonical_stackmaps_(),
+          code_(Code::Handle(zone)),
+          stackmaps_(Array::Handle(zone)),
+          stackmap_(Stackmap::Handle(zone)) {}
 
     void Visit(const Function& function) {
       if (!function.HasCode()) {
@@ -2259,12 +2245,11 @@
 void Precompiler::DedupLists() {
   class DedupListsVisitor : public FunctionVisitor {
    public:
-    explicit DedupListsVisitor(Zone* zone) :
-      zone_(zone),
-      canonical_lists_(),
-      code_(Code::Handle(zone)),
-      list_(Array::Handle(zone)) {
-    }
+    explicit DedupListsVisitor(Zone* zone)
+        : zone_(zone),
+          canonical_lists_(),
+          code_(Code::Handle(zone)),
+          list_(Array::Handle(zone)) {}
 
     void Visit(const Function& function) {
       code_ = function.CurrentCode();
@@ -2278,10 +2263,8 @@
 
       list_ = function.parameter_types();
       if (!list_.IsNull()) {
-        if (!function.IsSignatureFunction() &&
-            !function.IsClosureFunction() &&
-            (function.name() != Symbols::Call().raw()) &&
-            !list_.InVMHeap()) {
+        if (!function.IsSignatureFunction() && !function.IsClosureFunction() &&
+            (function.name() != Symbols::Call().raw()) && !list_.InVMHeap()) {
           // Parameter types not needed for function type tests.
           for (intptr_t i = 0; i < list_.Length(); i++) {
             list_.SetAt(i, Object::dynamic_type());
@@ -2293,8 +2276,7 @@
 
       list_ = function.parameter_names();
       if (!list_.IsNull()) {
-        if (!function.HasOptionalNamedParameters() &&
-            !list_.InVMHeap()) {
+        if (!function.HasOptionalNamedParameters() && !list_.InVMHeap()) {
           // Parameter names not needed for resolution.
           for (intptr_t i = 0; i < list_.Length(); i++) {
             list_.SetAt(i, Symbols::OptimizedOut());
@@ -2330,12 +2312,11 @@
 void Precompiler::DedupInstructions() {
   class DedupInstructionsVisitor : public FunctionVisitor {
    public:
-    explicit DedupInstructionsVisitor(Zone* zone) :
-      zone_(zone),
-      canonical_instructions_set_(),
-      code_(Code::Handle(zone)),
-      instructions_(Instructions::Handle(zone)) {
-    }
+    explicit DedupInstructionsVisitor(Zone* zone)
+        : zone_(zone),
+          canonical_instructions_set_(),
+          code_(Code::Handle(zone)),
+          instructions_(Instructions::Handle(zone)) {}
 
     void Visit(const Function& function) {
       if (!function.HasCode()) {
@@ -2345,8 +2326,8 @@
       code_ = function.CurrentCode();
       instructions_ = code_.instructions();
       instructions_ = DedupOneInstructions(instructions_);
-      code_.SetActiveInstructions(instructions_.raw());
-      code_.set_instructions(instructions_.raw());
+      code_.SetActiveInstructions(instructions_);
+      code_.set_instructions(instructions_);
       function.SetInstructions(code_);  // Update cached entry point.
     }
 
@@ -2456,9 +2437,11 @@
     lib ^= libraries_.At(i);
     if (!lib.Loaded()) {
       String& uri = String::Handle(Z, lib.url());
-      String& msg = String::Handle(Z, String::NewFormatted(
-          "Library '%s' is not loaded. "
-          "Did you forget to call Dart_FinalizeLoading?", uri.ToCString()));
+      String& msg = String::Handle(
+          Z,
+          String::NewFormatted("Library '%s' is not loaded. "
+                               "Did you forget to call Dart_FinalizeLoading?",
+                               uri.ToCString()));
       Jump(Error::Handle(Z, ApiError::New(msg)));
     }
 
@@ -2516,8 +2499,8 @@
     if (old_to_new_cid[cid] == -1) {
       old_to_new_cid[cid] = next_new_cid++;
       if (FLAG_trace_precompiler) {
-        THR_Print("%" Pd ": %s, was %" Pd "\n",
-                  old_to_new_cid[cid], cls.ToCString(), cid);
+        THR_Print("%" Pd ": %s, was %" Pd "\n", old_to_new_cid[cid],
+                  cls.ToCString(), cid);
       }
     }
     subclasses = cls.direct_subclasses();
@@ -2536,8 +2519,8 @@
       old_to_new_cid[cid] = next_new_cid++;
       if (FLAG_trace_precompiler && table->HasValidClassAt(cid)) {
         cls = table->At(cid);
-        THR_Print("%" Pd ": %s, was %" Pd "\n",
-                  old_to_new_cid[cid], cls.ToCString(), cid);
+        THR_Print("%" Pd ": %s, was %" Pd "\n", old_to_new_cid[cid],
+                  cls.ToCString(), cid);
       }
     }
   }
@@ -2551,7 +2534,7 @@
 class CidRewriteVisitor : public ObjectVisitor {
  public:
   explicit CidRewriteVisitor(intptr_t* old_to_new_cids)
-      : old_to_new_cids_(old_to_new_cids) { }
+      : old_to_new_cids_(old_to_new_cids) {}
 
   intptr_t Map(intptr_t cid) {
     ASSERT(cid != -1);
@@ -2663,8 +2646,8 @@
            deopt_info_array.Length() * sizeof(uword));
   // Allocates instruction object. Since this occurs only at safepoint,
   // there can be no concurrent access to the instruction page.
-  const Code& code = Code::Handle(
-      Code::FinalizeCode(function, assembler, optimized()));
+  const Code& code =
+      Code::Handle(Code::FinalizeCode(function, assembler, optimized()));
   code.set_is_optimized(optimized());
   code.set_owner(function);
   if (!function.IsOptimizable()) {
@@ -2674,8 +2657,7 @@
   }
 
   const Array& intervals = graph_compiler->inlined_code_intervals();
-  INC_STAT(thread(), total_code_size,
-           intervals.Length() * sizeof(uword));
+  INC_STAT(thread(), total_code_size, intervals.Length() * sizeof(uword));
   code.SetInlinedIntervals(intervals);
 
   const Array& inlined_id_array =
@@ -2760,16 +2742,13 @@
       {
         CSTAT_TIMER_SCOPE(thread(), graphbuilder_timer);
         ZoneGrowableArray<const ICData*>* ic_data_array =
-            new(zone) ZoneGrowableArray<const ICData*>();
+            new (zone) ZoneGrowableArray<const ICData*>();
 #ifndef PRODUCT
-        TimelineDurationScope tds(thread(),
-                                  compiler_timeline,
+        TimelineDurationScope tds(thread(), compiler_timeline,
                                   "BuildFlowGraph");
 #endif  // !PRODUCT
-        flow_graph = pipeline->BuildFlowGraph(zone,
-                                              parsed_function(),
-                                              *ic_data_array,
-                                              Compiler::kNoOSRDeoptId);
+        flow_graph = pipeline->BuildFlowGraph(
+            zone, parsed_function(), *ic_data_array, Compiler::kNoOSRDeoptId);
       }
 
       const bool print_flow_graph =
@@ -2783,9 +2762,7 @@
 
       if (optimized()) {
 #ifndef PRODUCT
-        TimelineDurationScope tds(thread(),
-                                  compiler_timeline,
-                                  "ComputeSSA");
+        TimelineDurationScope tds(thread(), compiler_timeline, "ComputeSSA");
 #endif  // !PRODUCT
         CSTAT_TIMER_SCOPE(thread(), ssa_timer);
         // Transform to SSA (virtual register 0 and no inlining arguments).
@@ -2808,8 +2785,7 @@
       // potentially affect optimizations.
       if (optimized()) {
 #ifndef PRODUCT
-        TimelineDurationScope tds(thread(),
-                                  compiler_timeline,
+        TimelineDurationScope tds(thread(), compiler_timeline,
                                   "OptimizationPasses");
 #endif  // !PRODUCT
         inline_id_to_function.Add(&function);
@@ -2823,9 +2799,8 @@
         caller_inline_id.Add(-1);
         CSTAT_TIMER_SCOPE(thread(), graphoptimizer_timer);
 
-        AotOptimizer optimizer(flow_graph,
-                               use_speculative_inlining,
-                               &inlining_black_list);
+        AotOptimizer optimizer(precompiler_, flow_graph,
+                               use_speculative_inlining, &inlining_black_list);
         optimizer.PopulateWithICData();
 
         optimizer.ApplyClassIds();
@@ -2847,9 +2822,7 @@
         // Inlining (mutates the flow graph)
         if (FLAG_use_inlining) {
 #ifndef PRODUCT
-          TimelineDurationScope tds2(thread(),
-                                     compiler_timeline,
-                                     "Inlining");
+          TimelineDurationScope tds2(thread(), compiler_timeline, "Inlining");
 #endif  // !PRODUCT
           CSTAT_TIMER_SCOPE(thread(), graphinliner_timer);
           // Propagate types to create more inlining opportunities.
@@ -2860,12 +2833,10 @@
           optimizer.ApplyClassIds();
           DEBUG_ASSERT(flow_graph->VerifyUseLists());
 
-          FlowGraphInliner inliner(flow_graph,
-                                   &inline_id_to_function,
-                                   &inline_id_to_token_pos,
-                                   &caller_inline_id,
+          FlowGraphInliner inliner(flow_graph, &inline_id_to_function,
+                                   &inline_id_to_token_pos, &caller_inline_id,
                                    use_speculative_inlining,
-                                   &inlining_black_list);
+                                   &inlining_black_list, precompiler_);
           inliner.Inline();
           // Use lists are maintained and validated by the inliner.
           DEBUG_ASSERT(flow_graph->VerifyUseLists());
@@ -2877,8 +2848,7 @@
 
         {
 #ifndef PRODUCT
-          TimelineDurationScope tds2(thread(),
-                                     compiler_timeline,
+          TimelineDurationScope tds2(thread(), compiler_timeline,
                                      "ApplyClassIds");
 #endif  // !PRODUCT
           // Use propagated class-ids to optimize further.
@@ -2901,8 +2871,7 @@
 
         {
 #ifndef PRODUCT
-          TimelineDurationScope tds2(thread(),
-                                     compiler_timeline,
+          TimelineDurationScope tds2(thread(), compiler_timeline,
                                      "BranchSimplifier");
 #endif  // !PRODUCT
           BranchSimplifier::Simplify(flow_graph);
@@ -2914,8 +2883,7 @@
 
         if (FLAG_constant_propagation) {
 #ifndef PRODUCT
-          TimelineDurationScope tds2(thread(),
-                                     compiler_timeline,
+          TimelineDurationScope tds2(thread(), compiler_timeline,
                                      "ConstantPropagation");
 #endif  // !PRODUCT
           ConstantPropagator::Optimize(flow_graph);
@@ -2945,8 +2913,7 @@
 
         {
 #ifndef PRODUCT
-          TimelineDurationScope tds2(thread(),
-                                     compiler_timeline,
+          TimelineDurationScope tds2(thread(), compiler_timeline,
                                      "SelectRepresentations");
 #endif  // !PRODUCT
           // Where beneficial convert Smi operations into Int32 operations.
@@ -2962,8 +2929,7 @@
 
         {
 #ifndef PRODUCT
-          TimelineDurationScope tds2(thread(),
-                                     compiler_timeline,
+          TimelineDurationScope tds2(thread(), compiler_timeline,
                                      "CommonSubexpressionElinination");
 #endif  // !PRODUCT
           if (FLAG_common_subexpression_elimination ||
@@ -3004,8 +2970,7 @@
 
         {
 #ifndef PRODUCT
-          TimelineDurationScope tds2(thread(),
-                                     compiler_timeline,
+          TimelineDurationScope tds2(thread(), compiler_timeline,
                                      "DeadStoreElimination");
 #endif  // !PRODUCT
           DeadStoreElimination::Optimize(flow_graph);
@@ -3013,8 +2978,7 @@
 
         if (FLAG_range_analysis) {
 #ifndef PRODUCT
-          TimelineDurationScope tds2(thread(),
-                                     compiler_timeline,
+          TimelineDurationScope tds2(thread(), compiler_timeline,
                                      "RangeAnalysis");
 #endif  // !PRODUCT
           // Propagate types after store-load-forwarding. Some phis may have
@@ -3032,8 +2996,7 @@
 
         if (FLAG_constant_propagation) {
 #ifndef PRODUCT
-          TimelineDurationScope tds2(thread(),
-                                     compiler_timeline,
+          TimelineDurationScope tds2(thread(), compiler_timeline,
                                      "ConstantPropagator::OptimizeBranches");
 #endif  // !PRODUCT
           // Constant propagation can use information from range analysis to
@@ -3050,8 +3013,7 @@
 
         {
 #ifndef PRODUCT
-          TimelineDurationScope tds2(thread(),
-                                     compiler_timeline,
+          TimelineDurationScope tds2(thread(), compiler_timeline,
                                      "TryCatchAnalyzer::Optimize");
 #endif  // !PRODUCT
           // Optimize try-blocks.
@@ -3065,8 +3027,7 @@
 
         {
 #ifndef PRODUCT
-          TimelineDurationScope tds2(thread(),
-                                     compiler_timeline,
+          TimelineDurationScope tds2(thread(), compiler_timeline,
                                      "EliminateDeadPhis");
 #endif  // !PRODUCT
           DeadCodeElimination::EliminateDeadPhis(flow_graph);
@@ -3081,10 +3042,9 @@
         // the deoptimization path.
         AllocationSinking* sinking = NULL;
         if (FLAG_allocation_sinking &&
-            (flow_graph->graph_entry()->SuccessorCount()  == 1)) {
+            (flow_graph->graph_entry()->SuccessorCount() == 1)) {
 #ifndef PRODUCT
-          TimelineDurationScope tds2(thread(),
-                                     compiler_timeline,
+          TimelineDurationScope tds2(thread(), compiler_timeline,
                                      "AllocationSinking::Optimize");
 #endif  // !PRODUCT
           // TODO(fschneider): Support allocation sinking with try-catch.
@@ -3101,8 +3061,7 @@
 
         {
 #ifndef PRODUCT
-          TimelineDurationScope tds2(thread(),
-                                     compiler_timeline,
+          TimelineDurationScope tds2(thread(), compiler_timeline,
                                      "SelectRepresentations");
 #endif  // !PRODUCT
           // Ensure that all phis inserted by optimization passes have
@@ -3123,8 +3082,7 @@
         if (sinking != NULL) {
 #ifndef PRODUCT
           TimelineDurationScope tds2(
-              thread(),
-              compiler_timeline,
+              thread(), compiler_timeline,
               "AllocationSinking::DetachMaterializations");
 #endif  // !PRODUCT
           // Remove all MaterializeObject instructions inserted by allocation
@@ -3143,8 +3101,7 @@
 
         {
 #ifndef PRODUCT
-          TimelineDurationScope tds2(thread(),
-                                     compiler_timeline,
+          TimelineDurationScope tds2(thread(), compiler_timeline,
                                      "AllocateRegisters");
 #endif  // !PRODUCT
           // Perform register allocation on the SSA graph.
@@ -3159,25 +3116,20 @@
 
       ASSERT(inline_id_to_function.length() == caller_inline_id.length());
       Assembler assembler(use_far_branches);
-      FlowGraphCompiler graph_compiler(&assembler, flow_graph,
-                                       *parsed_function(), optimized(),
-                                       inline_id_to_function,
-                                       inline_id_to_token_pos,
-                                       caller_inline_id);
+      FlowGraphCompiler graph_compiler(
+          &assembler, flow_graph, *parsed_function(), optimized(),
+          inline_id_to_function, inline_id_to_token_pos, caller_inline_id);
       {
         CSTAT_TIMER_SCOPE(thread(), graphcompiler_timer);
 #ifndef PRODUCT
-        TimelineDurationScope tds(thread(),
-                                  compiler_timeline,
-                                  "CompileGraph");
+        TimelineDurationScope tds(thread(), compiler_timeline, "CompileGraph");
 #endif  // !PRODUCT
         graph_compiler.CompileGraph();
         pipeline->FinalizeCompilation(flow_graph);
       }
       {
 #ifndef PRODUCT
-        TimelineDurationScope tds(thread(),
-                                  compiler_timeline,
+        TimelineDurationScope tds(thread(), compiler_timeline,
                                   "FinalizeCompilation");
 #endif  // !PRODUCT
         ASSERT(thread()->IsMutatorThread());
@@ -3244,7 +3196,8 @@
 }
 
 
-static RawError* PrecompileFunctionHelper(CompilationPipeline* pipeline,
+static RawError* PrecompileFunctionHelper(Precompiler* precompiler,
+                                          CompilationPipeline* pipeline,
                                           const Function& function,
                                           bool optimized) {
   // Check that we optimize, except if the function is not optimizable.
@@ -3257,20 +3210,17 @@
     StackZone stack_zone(thread);
     Zone* const zone = stack_zone.GetZone();
     const bool trace_compiler =
-        FLAG_trace_compiler ||
-        (FLAG_trace_optimizing_compiler && optimized);
+        FLAG_trace_compiler || (FLAG_trace_optimizing_compiler && optimized);
     Timer per_compile_timer(trace_compiler, "Compilation time");
     per_compile_timer.Start();
 
-    ParsedFunction* parsed_function = new(zone) ParsedFunction(
-        thread, Function::ZoneHandle(zone, function.raw()));
+    ParsedFunction* parsed_function = new (zone)
+        ParsedFunction(thread, Function::ZoneHandle(zone, function.raw()));
     if (trace_compiler) {
-      THR_Print(
-          "Precompiling %sfunction: '%s' @ token %" Pd ", size %" Pd "\n",
-          (optimized ? "optimized " : ""),
-          function.ToFullyQualifiedCString(),
-          function.token_pos().Pos(),
-          (function.end_token_pos().Pos() - function.token_pos().Pos()));
+      THR_Print("Precompiling %sfunction: '%s' @ token %" Pd ", size %" Pd "\n",
+                (optimized ? "optimized " : ""),
+                function.ToFullyQualifiedCString(), function.token_pos().Pos(),
+                (function.end_token_pos().Pos() - function.token_pos().Pos()));
     }
     INC_STAT(thread, num_functions_compiled, 1);
     if (optimized) {
@@ -3281,12 +3231,12 @@
       const int64_t num_tokens_before = STAT_VALUE(thread, num_tokens_consumed);
       pipeline->ParseFunction(parsed_function);
       const int64_t num_tokens_after = STAT_VALUE(thread, num_tokens_consumed);
-      INC_STAT(thread,
-               num_func_tokens_compiled,
+      INC_STAT(thread, num_func_tokens_compiled,
                num_tokens_after - num_tokens_before);
     }
 
-    PrecompileParsedFunctionHelper helper(parsed_function, optimized);
+    PrecompileParsedFunctionHelper helper(precompiler, parsed_function,
+                                          optimized);
     const bool success = helper.Compile(pipeline);
     if (!success) {
       // Encountered error.
@@ -3311,8 +3261,7 @@
 
     if (FLAG_disassemble && FlowGraphPrinter::ShouldPrint(function)) {
       Disassembler::DisassembleCode(function, optimized);
-    } else if (FLAG_disassemble_optimized &&
-               optimized &&
+    } else if (FLAG_disassemble_optimized && optimized &&
                FlowGraphPrinter::ShouldPrint(function)) {
       Disassembler::DisassembleCode(function, true);
     }
@@ -3334,7 +3283,8 @@
 }
 
 
-RawError* Precompiler::CompileFunction(Thread* thread,
+RawError* Precompiler::CompileFunction(Precompiler* precompiler,
+                                       Thread* thread,
                                        Zone* zone,
                                        const Function& function,
                                        FieldTypeMap* field_type_map) {
@@ -3344,7 +3294,7 @@
   ASSERT(FLAG_precompiled_mode);
   const bool optimized = function.IsOptimizable();  // False for natives.
   DartPrecompilationPipeline pipeline(zone, field_type_map);
-  return PrecompileFunctionHelper(&pipeline, function, optimized);
+  return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized);
 }
 
 #endif  // DART_PRECOMPILER
diff --git a/runtime/vm/precompiler.h b/runtime/vm/precompiler.h
index 90b5f82..2566a78 100644
--- a/runtime/vm/precompiler.h
+++ b/runtime/vm/precompiler.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_PRECOMPILER_H_
-#define VM_PRECOMPILER_H_
+#ifndef RUNTIME_VM_PRECOMPILER_H_
+#define RUNTIME_VM_PRECOMPILER_H_
 
 #include "vm/allocation.h"
 #include "vm/hash_map.h"
@@ -69,9 +69,7 @@
 
   static Value ValueOf(Pair kv) { return kv; }
 
-  static inline intptr_t Hashcode(Key key) {
-    return key->Hash();
-  }
+  static inline intptr_t Hashcode(Key key) { return key->Hash(); }
 
   static inline bool IsKeyEqual(Pair pair, Key key) {
     return pair->raw() == key->raw();
@@ -91,9 +89,7 @@
 
   static Value ValueOf(Pair kv) { return kv; }
 
-  static inline intptr_t Hashcode(Key key) {
-    return key->PcOffset();
-  }
+  static inline intptr_t Hashcode(Key key) { return key->PcOffset(); }
 
   static inline bool IsKeyEqual(Pair pair, Key key) {
     return pair->Equals(*key);
@@ -114,9 +110,7 @@
 
   static Value ValueOf(Pair kv) { return kv; }
 
-  static inline intptr_t Hashcode(Key key) {
-    return key->Length();
-  }
+  static inline intptr_t Hashcode(Key key) { return key->Length(); }
 
   static inline bool IsKeyEqual(Pair pair, Key key) {
     if (pair->Length() != key->Length()) {
@@ -145,9 +139,7 @@
 
   static Value ValueOf(Pair kv) { return kv; }
 
-  static inline intptr_t Hashcode(Key key) {
-    return key->size();
-  }
+  static inline intptr_t Hashcode(Key key) { return key->Size(); }
 
   static inline bool IsKeyEqual(Pair pair, Key key) {
     return pair->Equals(*key);
@@ -174,7 +166,7 @@
 
   static inline bool IsKeyEqual(Pair pair, Key key) {
     return (pair->target_name() == key->target_name()) &&
-        (pair->args_descriptor() == key->args_descriptor());
+           (pair->args_descriptor() == key->args_descriptor());
   }
 };
 
@@ -192,9 +184,7 @@
 
   static Value ValueOf(Pair kv) { return kv; }
 
-  static inline intptr_t Hashcode(Key key) {
-    return key->token_pos().value();
-  }
+  static inline intptr_t Hashcode(Key key) { return key->token_pos().value(); }
 
   static inline bool IsKeyEqual(Pair pair, Key key) {
     return pair->raw() == key->raw();
@@ -215,9 +205,7 @@
 
   static Value ValueOf(Pair kv) { return kv; }
 
-  static inline intptr_t Hashcode(Key key) {
-    return key->token_pos().value();
-  }
+  static inline intptr_t Hashcode(Key key) { return key->token_pos().value(); }
 
   static inline bool IsKeyEqual(Pair pair, Key key) {
     return pair->raw() == key->raw();
@@ -238,9 +226,7 @@
 
   static Value ValueOf(Pair kv) { return kv; }
 
-  static inline intptr_t Hashcode(Key key) {
-    return key->token_pos().value();
-  }
+  static inline intptr_t Hashcode(Key key) { return key->token_pos().value(); }
 
   static inline bool IsKeyEqual(Pair pair, Key key) {
     return pair->raw() == key->raw();
@@ -261,9 +247,7 @@
 
   static Value ValueOf(Pair kv) { return kv; }
 
-  static inline intptr_t Hashcode(Key key) {
-    return key->Hash();
-  }
+  static inline intptr_t Hashcode(Key key) { return key->Hash(); }
 
   static inline bool IsKeyEqual(Pair pair, Key key) {
     return pair->raw() == key->raw();
@@ -284,9 +268,7 @@
 
   static Value ValueOf(Pair kv) { return kv; }
 
-  static inline intptr_t Hashcode(Key key) {
-    return key->Hash();
-  }
+  static inline intptr_t Hashcode(Key key) { return key->Hash(); }
 
   static inline bool IsKeyEqual(Pair pair, Key key) {
     return pair->raw() == key->raw();
@@ -307,9 +289,7 @@
 
   static Value ValueOf(Pair kv) { return kv; }
 
-  static inline intptr_t Hashcode(Key key) {
-    return key->GetClassId();
-  }
+  static inline intptr_t Hashcode(Key key) { return key->GetClassId(); }
 
   static inline bool IsKeyEqual(Pair pair, Key key) {
     return pair->raw() == key->raw();
@@ -329,17 +309,15 @@
 
   static Value ValueOf(Pair kv) { return kv.cid_; }
 
-  static inline intptr_t Hashcode(Key key) {
-    return key->token_pos().value();
-  }
+  static inline intptr_t Hashcode(Key key) { return key->token_pos().value(); }
 
   static inline bool IsKeyEqual(Pair pair, Key key) {
     return pair.field_->raw() == key->raw();
   }
 
-  FieldTypePair(const Field* f, intptr_t cid) : field_(f), cid_(cid) { }
+  FieldTypePair(const Field* f, intptr_t cid) : field_(f), cid_(cid) {}
 
-  FieldTypePair() : field_(NULL), cid_(-1) { }
+  FieldTypePair() : field_(NULL), cid_(-1) {}
 
   void Print() const;
 
@@ -356,7 +334,8 @@
       Dart_QualifiedFunctionName embedder_entry_points[],
       bool reset_fields);
 
-  static RawError* CompileFunction(Thread* thread,
+  static RawError* CompileFunction(Precompiler* precompiler,
+                                   Thread* thread,
                                    Zone* zone,
                                    const Function& function,
                                    FieldTypeMap* field_type_map = NULL);
@@ -367,6 +346,13 @@
   static RawFunction* CompileStaticInitializer(const Field& field,
                                                bool compute_type);
 
+  // Returns true if get:runtimeType is not overloaded by any class.
+  bool get_runtime_type_is_unique() const {
+    return get_runtime_type_is_unique_;
+  }
+
+  FieldTypeMap* field_type_map() { return &field_type_map_; }
+
  private:
   Precompiler(Thread* thread, bool reset_fields);
 
@@ -417,7 +403,7 @@
   void PrecompileStaticInitializers();
   void PrecompileConstructors();
 
-  template<typename T>
+  template <typename T>
   class Visitor : public ValueObject {
    public:
     virtual ~Visitor() {}
@@ -466,6 +452,8 @@
   InstanceSet consts_to_retain_;
   FieldTypeMap field_type_map_;
   Error& error_;
+
+  bool get_runtime_type_is_unique_;
 };
 
 
@@ -491,9 +479,7 @@
       return String::Cast(obj).Hash();
     }
   }
-  static RawObject* NewKey(const Function& function) {
-    return function.raw();
-  }
+  static RawObject* NewKey(const Function& function) { return function.raw(); }
 };
 
 typedef UnorderedHashSet<FunctionsTraits> UniqueFunctionsSet;
@@ -501,4 +487,4 @@
 
 }  // namespace dart
 
-#endif  // VM_PRECOMPILER_H_
+#endif  // RUNTIME_VM_PRECOMPILER_H_
diff --git a/runtime/vm/proccpuinfo.cc b/runtime/vm/proccpuinfo.cc
index 94e8db6..dd8416f 100644
--- a/runtime/vm/proccpuinfo.cc
+++ b/runtime/vm/proccpuinfo.cc
@@ -7,7 +7,7 @@
 
 #include "vm/proccpuinfo.h"
 
-#include <ctype.h>  // NOLINT
+#include <ctype.h>   // NOLINT
 #include <string.h>  // NOLINT
 
 #include "platform/assert.h"
@@ -41,7 +41,7 @@
   data_ = reinterpret_cast<char*>(malloc(datalen_ + 1));
   fp = fopen(PATHNAME, "r");
   if (fp != NULL) {
-    for (intptr_t offset = 0; offset < datalen_; ) {
+    for (intptr_t offset = 0; offset < datalen_;) {
       size_t n = fread(data_ + offset, 1, datalen_ - offset, fp);
       if (n == 0) {
         break;
diff --git a/runtime/vm/proccpuinfo.h b/runtime/vm/proccpuinfo.h
index 0814c6a..e81d7ee 100644
--- a/runtime/vm/proccpuinfo.h
+++ b/runtime/vm/proccpuinfo.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_PROCCPUINFO_H_
-#define VM_PROCCPUINFO_H_
+#ifndef RUNTIME_VM_PROCCPUINFO_H_
+#define RUNTIME_VM_PROCCPUINFO_H_
 
 #include "vm/globals.h"
 #if defined(TARGET_OS_LINUX) || defined(TARGET_OS_ANDROID)
@@ -31,4 +31,4 @@
 
 #endif  // defined(TARGET_OS_LINUX) || defined(TARGET_OS_ANDROID)
 
-#endif  // VM_PROCCPUINFO_H_
+#endif  // RUNTIME_VM_PROCCPUINFO_H_
diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc
index 50a202a..9db93ae 100644
--- a/runtime/vm/profiler.cc
+++ b/runtime/vm/profiler.cc
@@ -33,20 +33,24 @@
 
 #if defined(TARGET_OS_ANDROID) || defined(TARGET_ARCH_ARM64) ||                \
     defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS)
-  DEFINE_FLAG(int, profile_period, 10000,
-              "Time between profiler samples in microseconds. Minimum 50.");
+DEFINE_FLAG(int,
+            profile_period,
+            10000,
+            "Time between profiler samples in microseconds. Minimum 50.");
 #else
-  DEFINE_FLAG(int, profile_period, 1000,
-              "Time between profiler samples in microseconds. Minimum 50.");
+DEFINE_FLAG(int,
+            profile_period,
+            1000,
+            "Time between profiler samples in microseconds. Minimum 50.");
 #endif
-DEFINE_FLAG(int, max_profile_depth, kSampleSize * kMaxSamplesPerTick,
+DEFINE_FLAG(int,
+            max_profile_depth,
+            kSampleSize* kMaxSamplesPerTick,
             "Maximum number stack frames walked. Minimum 1. Maximum 255.");
 #if defined(USING_SIMULATOR)
-DEFINE_FLAG(bool, profile_vm, true,
-            "Always collect native stack traces.");
+DEFINE_FLAG(bool, profile_vm, true, "Always collect native stack traces.");
 #else
-DEFINE_FLAG(bool, profile_vm, false,
-            "Always collect native stack traces.");
+DEFINE_FLAG(bool, profile_vm, false, "Always collect native stack traces.");
 #endif
 
 #ifndef PRODUCT
@@ -113,21 +117,20 @@
 
 void Sample::InitOnce() {
   pcs_length_ = kSampleSize;
-  instance_size_ =
-      sizeof(Sample) + (sizeof(uword) * pcs_length_);  // NOLINT.
+  instance_size_ = sizeof(Sample) + (sizeof(uword) * pcs_length_);  // NOLINT.
 }
 
 
 uword* Sample::GetPCArray() const {
-  return reinterpret_cast<uword*>(
-        reinterpret_cast<uintptr_t>(this) + sizeof(*this));
+  return reinterpret_cast<uword*>(reinterpret_cast<uintptr_t>(this) +
+                                  sizeof(*this));
 }
 
 
 SampleBuffer::SampleBuffer(intptr_t capacity) {
   ASSERT(Sample::instance_size() > 0);
-  samples_ = reinterpret_cast<Sample*>(
-      calloc(capacity, Sample::instance_size()));
+  samples_ =
+      reinterpret_cast<Sample*>(calloc(capacity, Sample::instance_size()));
   if (FLAG_trace_profiler) {
     OS::Print("Profiler holds %" Pd " samples\n", capacity);
     OS::Print("Profiler sample is %" Pd " bytes\n", Sample::instance_size());
@@ -194,9 +197,7 @@
     ASSERT(code_.ContainsInstructionAt(pc_));
   }
 
-  uword pc() {
-    return pc_;
-  }
+  uword pc() { return pc_; }
 
   // Returns false on failure.
   bool LocateReturnAddress(uword* return_address);
@@ -303,8 +304,7 @@
 
 
 bool SampleFilter::TimeFilterSample(Sample* sample) {
-  if ((time_origin_micros_ == -1) ||
-      (time_extent_micros_ == -1)) {
+  if ((time_origin_micros_ == -1) || (time_extent_micros_ == -1)) {
     // No time filter passed in, always pass.
     return true;
   }
@@ -321,8 +321,7 @@
 
 
 ClearProfileVisitor::ClearProfileVisitor(Isolate* isolate)
-    : SampleVisitor(isolate) {
-}
+    : SampleVisitor(isolate) {}
 
 
 void ClearProfileVisitor::VisitSample(Sample* sample) {
@@ -332,8 +331,7 @@
 
 static void DumpStackFrame(intptr_t frame_index, uword pc) {
   uintptr_t start = 0;
-  char* native_symbol_name =
-      NativeSymbolResolver::LookupSymbolName(pc, &start);
+  char* native_symbol_name = NativeSymbolResolver::LookupSymbolName(pc, &start);
   if (native_symbol_name == NULL) {
     OS::PrintErr("  [0x%" Pp "] Unknown symbol\n", pc);
   } else {
@@ -343,14 +341,12 @@
 }
 
 
-static void DumpStackFrame(intptr_t frame_index,
-                           uword pc,
-                           const Code& code) {
+static void DumpStackFrame(intptr_t frame_index, uword pc, const Code& code) {
   if (code.IsNull()) {
     DumpStackFrame(frame_index, pc);
   } else {
-    OS::PrintErr("Frame[%" Pd "] = Dart:`%s` [0x%" Px "]\n",
-                 frame_index, code.ToCString(), pc);
+    OS::PrintErr("Frame[%" Pd "] = Dart:`%s` [0x%" Px "]\n", frame_index,
+                 code.ToCString(), pc);
   }
 }
 
@@ -360,11 +356,11 @@
   ProfilerStackWalker(Isolate* isolate,
                       Sample* head_sample,
                       SampleBuffer* sample_buffer)
-    : isolate_(isolate),
-      sample_(head_sample),
-      sample_buffer_(sample_buffer),
-      frame_index_(0),
-      total_frames_(0) {
+      : isolate_(isolate),
+        sample_(head_sample),
+        sample_buffer_(sample_buffer),
+        frame_index_(0),
+        total_frames_(0) {
     ASSERT(isolate_ != NULL);
     if (sample_ == NULL) {
       ASSERT(sample_buffer_ == NULL);
@@ -422,68 +418,54 @@
 };
 
 
-// Given an exit frame, walk the Dart stack.
-class ProfilerDartExitStackWalker : public ProfilerStackWalker {
- public:
-  ProfilerDartExitStackWalker(Thread* thread,
-                              Isolate* isolate,
-                              Sample* sample,
-                              SampleBuffer* sample_buffer)
-      : ProfilerStackWalker(isolate, sample, sample_buffer),
-        frame_iterator_(thread) {
-  }
-
-  void walk() {
-    // Mark that this sample was collected from an exit frame.
-    sample_->set_exit_frame_sample(true);
-
-    StackFrame* frame = frame_iterator_.NextFrame();
-    if (sample_ == NULL) {
-      // Only when we are dumping the stack trace for debug purposes.
-      Code& code = Code::Handle();
-      while (frame != NULL) {
-        code ^= frame->LookupDartCode();
-        if (!Append(frame->pc(), code)) {
-          return;
-        }
-        frame = frame_iterator_.NextFrame();
-      }
-    } else {
-      while (frame != NULL) {
-        if (!Append(frame->pc())) {
-          return;
-        }
-        frame = frame_iterator_.NextFrame();
-      }
-    }
-  }
-
- private:
-  DartFrameIterator frame_iterator_;
-};
-
-
 // Executing Dart code, walk the stack.
 class ProfilerDartStackWalker : public ProfilerStackWalker {
  public:
-  ProfilerDartStackWalker(Isolate* isolate,
+  ProfilerDartStackWalker(Thread* thread,
                           Sample* sample,
                           SampleBuffer* sample_buffer,
                           uword stack_lower,
                           uword stack_upper,
                           uword pc,
                           uword fp,
-                          uword sp)
-      : ProfilerStackWalker(isolate, sample, sample_buffer),
+                          uword sp,
+                          bool exited_dart_code,
+                          bool allocation_sample)
+      : ProfilerStackWalker(thread->isolate(), sample, sample_buffer),
+        pc_(reinterpret_cast<uword*>(pc)),
+        fp_(reinterpret_cast<uword*>(fp)),
+        sp_(reinterpret_cast<uword*>(sp)),
         stack_upper_(stack_upper),
-        stack_lower_(stack_lower) {
-    pc_ = reinterpret_cast<uword*>(pc);
-    fp_ = reinterpret_cast<uword*>(fp);
-    sp_ = reinterpret_cast<uword*>(sp);
+        stack_lower_(stack_lower),
+        has_exit_frame_(exited_dart_code) {
+    if (exited_dart_code) {
+      StackFrameIterator iterator(StackFrameIterator::kDontValidateFrames,
+                                  thread);
+      pc_ = NULL;
+      fp_ = NULL;
+      sp_ = NULL;
+      if (!iterator.HasNextFrame()) {
+        return;
+      }
+      // Ensure we are able to get to the exit frame.
+      StackFrame* frame = iterator.NextFrame();
+      if (!frame->IsExitFrame()) {
+        return;
+      }
+      // Skip the exit frame.
+      if (!iterator.HasNextFrame()) {
+        return;
+      }
+      frame = iterator.NextFrame();
+      // Record frame details of the first frame from which we start walking.
+      pc_ = reinterpret_cast<uword*>(frame->pc());
+      fp_ = reinterpret_cast<uword*>(frame->fp());
+      sp_ = reinterpret_cast<uword*>(frame->sp());
+    }
   }
 
   void walk() {
-    sample_->set_exit_frame_sample(false);
+    sample_->set_exit_frame_sample(has_exit_frame_);
     if (!ValidFramePointer()) {
       sample_->set_ignore_sample(true);
       return;
@@ -595,9 +577,7 @@
     return reinterpret_cast<uword*>(*exit_link_ptr);
   }
 
-  bool ValidFramePointer() const {
-    return ValidFramePointer(fp_);
-  }
+  bool ValidFramePointer() const { return ValidFramePointer(fp_); }
 
   bool ValidFramePointer(uword* fp) const {
     if (fp == NULL) {
@@ -612,7 +592,8 @@
   uword* fp_;
   uword* sp_;
   const uword stack_upper_;
-  uword stack_lower_;
+  const uword stack_lower_;
+  bool has_exit_frame_;
 };
 
 
@@ -635,8 +616,7 @@
         original_pc_(pc),
         original_fp_(fp),
         original_sp_(sp),
-        lower_bound_(stack_lower) {
-  }
+        lower_bound_(stack_lower) {}
 
   void walk() {
     const uword kMaxStep = VirtualMemory::PageSize();
@@ -766,7 +746,6 @@
                           bool in_dart_code,
                           Sample* sample,
                           ProfilerNativeStackWalker* native_stack_walker,
-                          ProfilerDartExitStackWalker* dart_exit_stack_walker,
                           ProfilerDartStackWalker* dart_stack_walker,
                           uword pc,
                           uword fp,
@@ -778,32 +757,32 @@
   __try {
 #endif
 
-  if (in_dart_code) {
-    // We can only trust the stack pointer if we are executing Dart code.
-    // See http://dartbug.com/20421 for details.
-    CopyStackBuffer(sample, sp);
-  }
+    if (in_dart_code) {
+      // We can only trust the stack pointer if we are executing Dart code.
+      // See http://dartbug.com/20421 for details.
+      CopyStackBuffer(sample, sp);
+    }
 
-  if (FLAG_profile_vm) {
-    // Always walk the native stack collecting both native and Dart frames.
-    AtomicOperations::IncrementInt64By(&counters->stack_walker_native, 1);
-    native_stack_walker->walk();
-  } else if (StubCode::HasBeenInitialized() && exited_dart_code) {
-    AtomicOperations::IncrementInt64By(&counters->stack_walker_dart_exit, 1);
-    // We have a valid exit frame info, use the Dart stack walker.
-    dart_exit_stack_walker->walk();
-  } else if (StubCode::HasBeenInitialized() && in_dart_code) {
-    AtomicOperations::IncrementInt64By(&counters->stack_walker_dart, 1);
-    // We are executing Dart code. We have frame pointers.
-    dart_stack_walker->walk();
-  } else {
-    AtomicOperations::IncrementInt64By(&counters->stack_walker_none, 1);
-    sample->SetAt(0, pc);
-  }
+    if (FLAG_profile_vm) {
+      // Always walk the native stack collecting both native and Dart frames.
+      AtomicOperations::IncrementInt64By(&counters->stack_walker_native, 1);
+      native_stack_walker->walk();
+    } else if (StubCode::HasBeenInitialized() && exited_dart_code) {
+      AtomicOperations::IncrementInt64By(&counters->stack_walker_dart_exit, 1);
+      // We have a valid exit frame info, use the Dart stack walker.
+      dart_stack_walker->walk();
+    } else if (StubCode::HasBeenInitialized() && in_dart_code) {
+      AtomicOperations::IncrementInt64By(&counters->stack_walker_dart, 1);
+      // We are executing Dart code. We have frame pointers.
+      dart_stack_walker->walk();
+    } else {
+      AtomicOperations::IncrementInt64By(&counters->stack_walker_none, 1);
+      sample->SetAt(0, pc);
+    }
 
 #if defined(TARGET_OS_WINDOWS)
-  // Use structured exception handling to trap guard page access.
-  } __except(GuardPageExceptionFilter(GetExceptionInformation())) {
+    // Use structured exception handling to trap guard page access.
+  } __except (GuardPageExceptionFilter(GetExceptionInformation())) {  // NOLINT
     // Sample collection triggered a guard page fault:
     // 1) discard entire sample.
     sample->set_ignore_sample(true);
@@ -812,10 +791,9 @@
     // https://goo.gl/5mCsXW
     DWORD new_protect = PAGE_READWRITE | PAGE_GUARD;
     DWORD old_protect = 0;
-    BOOL success = VirtualProtect(reinterpret_cast<void*>(fault_address),
-                                  sizeof(fault_address),
-                                  new_protect,
-                                  &old_protect);
+    BOOL success =
+        VirtualProtect(reinterpret_cast<void*>(fault_address),
+                       sizeof(fault_address), new_protect, &old_protect);
     USE(success);
     ASSERT(success);
     ASSERT(old_protect == PAGE_READWRITE);
@@ -942,8 +920,7 @@
 
 
 #if defined(TARGET_OS_WINDOWS)
-__declspec(noinline)
-static uintptr_t GetProgramCounter() {
+__declspec(noinline) static uintptr_t GetProgramCounter() {
   return reinterpret_cast<uintptr_t>(_ReturnAddress());
 }
 #else
@@ -954,7 +931,33 @@
 #endif
 
 
-void Profiler::DumpStackTrace(bool native_stack_trace) {
+void Profiler::DumpStackTrace(void* context) {
+#if defined(TARGET_OS_LINUX) || defined(TARGET_OS_MACOS)
+  ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
+  mcontext_t mcontext = ucontext->uc_mcontext;
+  uword pc = SignalHandler::GetProgramCounter(mcontext);
+  uword fp = SignalHandler::GetFramePointer(mcontext);
+  uword sp = SignalHandler::GetCStackPointer(mcontext);
+  DumpStackTrace(sp, fp, pc);
+#else
+// TODO(fschneider): Add support for more platforms.
+// Do nothing on unsupported platforms.
+#endif
+}
+
+
+void Profiler::DumpStackTrace() {
+  uintptr_t sp = Thread::GetCurrentStackPointer();
+  uintptr_t fp = 0;
+  uintptr_t pc = GetProgramCounter();
+
+  COPY_FP_REGISTER(fp);
+
+  DumpStackTrace(sp, fp, pc);
+}
+
+
+void Profiler::DumpStackTrace(uword sp, uword fp, uword pc) {
   // Allow only one stack trace to prevent recursively printing stack traces if
   // we hit an assert while printing the stack.
   static uintptr_t started_dump = 0;
@@ -974,63 +977,27 @@
     return;
   }
 
-  const bool exited_dart_code = thread->HasExitedDartCode();
-
-  OS::PrintErr("Dumping %s stack trace for thread %" Px "\n",
-               native_stack_trace ? "native" : "dart-only",
+  OS::PrintErr("Dumping native stack trace for thread %" Px "\n",
                OSThread::ThreadIdToIntPtr(os_thread->trace_id()));
 
-  uintptr_t sp = Thread::GetCurrentStackPointer();
-  uintptr_t fp = 0;
-  uintptr_t pc = GetProgramCounter();
-
-  COPY_FP_REGISTER(fp);
-
   uword stack_lower = 0;
   uword stack_upper = 0;
 
   if (!InitialRegisterCheck(pc, fp, sp)) {
-    OS::PrintErr(
-        "Stack dump aborted because InitialRegisterCheck.\n");
+    OS::PrintErr("Stack dump aborted because InitialRegisterCheck.\n");
     return;
   }
 
-  if (!GetAndValidateIsolateStackBounds(thread,
-                                        fp,
-                                        sp,
-                                        &stack_lower,
+  if (!GetAndValidateIsolateStackBounds(thread, fp, sp, &stack_lower,
                                         &stack_upper)) {
     OS::PrintErr(
         "Stack dump aborted because GetAndValidateIsolateStackBounds.\n");
     return;
   }
 
-  if (native_stack_trace) {
-    ProfilerNativeStackWalker native_stack_walker(isolate,
-                                                  NULL,
-                                                  NULL,
-                                                  stack_lower,
-                                                  stack_upper,
-                                                  pc,
-                                                  fp,
-                                                  sp);
-    native_stack_walker.walk();
-  } else if (exited_dart_code) {
-    ProfilerDartExitStackWalker dart_exit_stack_walker(thread,
-                                                       isolate,
-                                                       NULL,
-                                                       NULL);
-    dart_exit_stack_walker.walk();
-  } else {
-    ProfilerDartStackWalker dart_stack_walker(isolate,
-                                              NULL,
-                                              NULL,
-                                              stack_lower,
-                                              stack_upper,
-                                              pc,
-                                              fp,
-                                              sp);
-  }
+  ProfilerNativeStackWalker native_stack_walker(
+      isolate, NULL, NULL, stack_lower, stack_upper, pc, fp, sp);
+  native_stack_walker.walk();
   OS::PrintErr("-- End of DumpStackTrace\n");
 }
 
@@ -1052,47 +1019,36 @@
     return;
   }
 
+  uintptr_t sp = Thread::GetCurrentStackPointer();
+  uintptr_t fp = 0;
+  uintptr_t pc = GetProgramCounter();
+
+  COPY_FP_REGISTER(fp);
+
+  uword stack_lower = 0;
+  uword stack_upper = 0;
+
+  if (!InitialRegisterCheck(pc, fp, sp)) {
+    return;
+  }
+
+  if (!GetAndValidateIsolateStackBounds(thread, fp, sp, &stack_lower,
+                                        &stack_upper)) {
+    // Could not get stack boundary.
+    return;
+  }
+
+  Sample* sample = SetupSample(thread, sample_buffer, os_thread->trace_id());
+  sample->SetAllocationCid(cid);
+
   if (FLAG_profile_vm) {
-    uintptr_t sp = Thread::GetCurrentStackPointer();
-    uintptr_t fp = 0;
-    uintptr_t pc = GetProgramCounter();
-
-    COPY_FP_REGISTER(fp);
-
-    uword stack_lower = 0;
-    uword stack_upper = 0;
-
-    if (!InitialRegisterCheck(pc, fp, sp)) {
-      return;
-    }
-
-    if (!GetAndValidateIsolateStackBounds(thread,
-                                          fp,
-                                          sp,
-                                          &stack_lower,
-                                          &stack_upper)) {
-      // Could not get stack boundary.
-      return;
-    }
-
-    Sample* sample = SetupSample(thread, sample_buffer, os_thread->trace_id());
-    sample->SetAllocationCid(cid);
-    ProfilerNativeStackWalker native_stack_walker(isolate,
-                                                  sample,
-                                                  sample_buffer,
-                                                  stack_lower,
-                                                  stack_upper,
-                                                  pc,
-                                                  fp,
-                                                  sp);
+    ProfilerNativeStackWalker native_stack_walker(
+        isolate, sample, sample_buffer, stack_lower, stack_upper, pc, fp, sp);
     native_stack_walker.walk();
   } else if (exited_dart_code) {
-    Sample* sample = SetupSample(thread, sample_buffer, os_thread->trace_id());
-    sample->SetAllocationCid(cid);
-    ProfilerDartExitStackWalker dart_exit_stack_walker(thread,
-                                                       isolate,
-                                                       sample,
-                                                       sample_buffer);
+    ProfilerDartStackWalker dart_exit_stack_walker(
+        thread, sample, sample_buffer, stack_lower, stack_upper, pc, fp, sp,
+        exited_dart_code, true);
     dart_exit_stack_walker.walk();
   } else {
     // Fall back.
@@ -1143,11 +1099,10 @@
     return;
   }
 
-  if (StubCode::HasBeenInitialized() &&
-      StubCode::InJumpToExceptionHandlerStub(state.pc)) {
-    // The JumpToExceptionHandler stub manually adjusts the stack pointer,
-    // frame pointer, and some isolate state before jumping to a catch entry.
-    // It is not safe to walk the stack when executing this stub.
+  if (StubCode::HasBeenInitialized() && StubCode::InJumpToFrameStub(state.pc)) {
+    // The JumpToFrame stub manually adjusts the stack pointer, frame
+    // pointer, and some isolate state.  It is not safe to walk the
+    // stack when executing this stub.
     AtomicOperations::IncrementInt64By(
         &counters_.bail_out_jump_to_exception_handler, 1);
     return;
@@ -1163,7 +1118,7 @@
 #endif
 
   if (in_dart_code) {
-    // If we're in Dart code, use the Dart stack pointer.
+// If we're in Dart code, use the Dart stack pointer.
 #if defined(TARGET_ARCH_DBC)
     simulator = isolate->simulator();
     sp = simulator->get_sp();
@@ -1203,13 +1158,10 @@
 
   uword stack_lower = 0;
   uword stack_upper = 0;
-  if (!GetAndValidateIsolateStackBounds(thread,
-                                        fp,
-                                        sp,
-                                        &stack_lower,
+  if (!GetAndValidateIsolateStackBounds(thread, fp, sp, &stack_lower,
                                         &stack_upper)) {
     AtomicOperations::IncrementInt64By(
-       &counters_.single_frame_sample_get_and_validate_stack_bounds, 1);
+        &counters_.single_frame_sample_get_and_validate_stack_bounds, 1);
     // Could not get stack boundary.
     SampleThreadSingleFrame(thread, pc);
     return;
@@ -1232,47 +1184,20 @@
     counters->Increment(sample->vm_tag());
   }
 
-  ProfilerNativeStackWalker native_stack_walker(isolate,
-                                                sample,
-                                                sample_buffer,
-                                                stack_lower,
-                                                stack_upper,
-                                                pc,
-                                                fp,
-                                                sp);
-
-  ProfilerDartExitStackWalker dart_exit_stack_walker(thread,
-                                                     isolate,
-                                                     sample,
-                                                     sample_buffer);
-
-  ProfilerDartStackWalker dart_stack_walker(isolate,
-                                            sample,
-                                            sample_buffer,
-                                            stack_lower,
-                                            stack_upper,
-                                            pc,
-                                            fp,
-                                            sp);
-
+  ProfilerNativeStackWalker native_stack_walker(
+      isolate, sample, sample_buffer, stack_lower, stack_upper, pc, fp, sp);
   const bool exited_dart_code = thread->HasExitedDartCode();
+  ProfilerDartStackWalker dart_stack_walker(thread, sample, sample_buffer,
+                                            stack_lower, stack_upper, pc, fp,
+                                            sp, exited_dart_code, false);
 
   // All memory access is done inside CollectSample.
-  CollectSample(isolate,
-                exited_dart_code,
-                in_dart_code,
-                sample,
-                &native_stack_walker,
-                &dart_exit_stack_walker,
-                &dart_stack_walker,
-                pc,
-                fp,
-                sp,
+  CollectSample(isolate, exited_dart_code, in_dart_code, sample,
+                &native_stack_walker, &dart_stack_walker, pc, fp, sp,
                 &counters_);
 }
 
 
-
 CodeDescriptor::CodeDescriptor(const Code& code) : code_(code) {
   ASSERT(!code_.IsNull());
 }
@@ -1304,8 +1229,7 @@
     ASSERT(table_ != NULL);
   }
 
-  ~CodeLookupTableBuilder() {
-  }
+  ~CodeLookupTableBuilder() {}
 
   void VisitObject(RawObject* raw_obj) {
     uword tags = raw_obj->ptr()->tags_;
@@ -1408,7 +1332,7 @@
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
 
-  ProcessedSampleBuffer* buffer = new(zone) ProcessedSampleBuffer();
+  ProcessedSampleBuffer* buffer = new (zone) ProcessedSampleBuffer();
 
   const intptr_t length = capacity();
   for (intptr_t i = 0; i < length; i++) {
@@ -1457,7 +1381,7 @@
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
 
-  ProcessedSample* processed_sample = new(zone) ProcessedSample();
+  ProcessedSample* processed_sample = new (zone) ProcessedSample();
 
   // Copy state bits from sample.
   processed_sample->set_timestamp(sample->timestamp());
@@ -1485,8 +1409,7 @@
   }
 
   if (!sample->exit_frame_sample()) {
-    processed_sample->FixupCaller(clt,
-                                  sample->pc_marker(),
+    processed_sample->FixupCaller(clt, sample->pc_marker(),
                                   sample->GetStackBuffer());
   }
 
@@ -1496,8 +1419,7 @@
 
 
 Sample* SampleBuffer::Next(Sample* sample) {
-  if (!sample->is_continuation_sample())
-    return NULL;
+  if (!sample->is_continuation_sample()) return NULL;
   Sample* next_sample = At(sample->continuation_index());
   // Sanity check.
   ASSERT(sample != next_sample);
@@ -1522,8 +1444,7 @@
       user_tag_(0),
       allocation_cid_(-1),
       truncated_(false),
-      timeline_trie_(NULL) {
-}
+      timeline_trie_(NULL) {}
 
 
 void ProcessedSample::FixupCaller(const CodeLookupTable& clt,
diff --git a/runtime/vm/profiler.h b/runtime/vm/profiler.h
index 529a193..ee87a31 100644
--- a/runtime/vm/profiler.h
+++ b/runtime/vm/profiler.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_PROFILER_H_
-#define VM_PROFILER_H_
+#ifndef RUNTIME_VM_PROFILER_H_
+#define RUNTIME_VM_PROFILER_H_
 
 #include "vm/allocation.h"
 #include "vm/bitfield.h"
@@ -52,11 +52,10 @@
   static void SetSampleDepth(intptr_t depth);
   static void SetSamplePeriod(intptr_t period);
 
-  static SampleBuffer* sample_buffer() {
-    return sample_buffer_;
-  }
+  static SampleBuffer* sample_buffer() { return sample_buffer_; }
 
-  static void DumpStackTrace(bool native_stack_trace = true);
+  static void DumpStackTrace(void* context);
+  static void DumpStackTrace();
 
   static void SampleAllocation(Thread* thread, intptr_t cid);
 
@@ -68,8 +67,7 @@
   //   * Allocating memory -- Because this takes locks which may already be
   //                          held, resulting in a dead lock.
   //   * Taking a lock -- See above.
-  static void SampleThread(Thread* thread,
-                           const InterruptedThreadState& state);
+  static void SampleThread(Thread* thread, const InterruptedThreadState& state);
 
   static ProfilerCounters counters() {
     // Copies the counter values.
@@ -77,6 +75,8 @@
   }
 
  private:
+  static void DumpStackTrace(uword sp, uword fp, uword pc);
+
   // Does not walk the thread's stack.
   static void SampleThreadSingleFrame(Thread* thread, uintptr_t pc);
   static bool initialized_;
@@ -91,22 +91,16 @@
 
 class SampleVisitor : public ValueObject {
  public:
-  explicit SampleVisitor(Isolate* isolate) : isolate_(isolate), visited_(0) { }
+  explicit SampleVisitor(Isolate* isolate) : isolate_(isolate), visited_(0) {}
   virtual ~SampleVisitor() {}
 
   virtual void VisitSample(Sample* sample) = 0;
 
-  intptr_t visited() const {
-    return visited_;
-  }
+  intptr_t visited() const { return visited_; }
 
-  void IncrementVisited() {
-    visited_++;
-  }
+  void IncrementVisited() { visited_++; }
 
-  Isolate* isolate() const {
-    return isolate_;
-  }
+  Isolate* isolate() const { return isolate_; }
 
  private:
   Isolate* isolate_;
@@ -130,17 +124,13 @@
     ASSERT(time_origin_micros_ >= -1);
     ASSERT(time_extent_micros_ >= -1);
   }
-  virtual ~SampleFilter() { }
+  virtual ~SampleFilter() {}
 
   // Override this function.
   // Return |true| if |sample| passes the filter.
-  virtual bool FilterSample(Sample* sample) {
-    return true;
-  }
+  virtual bool FilterSample(Sample* sample) { return true; }
 
-  Isolate* isolate() const {
-    return isolate_;
-  }
+  Isolate* isolate() const { return isolate_; }
 
   // Returns |true| if |sample| passes the time filter.
   bool TimeFilterSample(Sample* sample);
@@ -175,14 +165,10 @@
   }
 
   // Isolate sample was taken from.
-  Isolate* isolate() const {
-    return isolate_;
-  }
+  Isolate* isolate() const { return isolate_; }
 
   // Thread sample was taken on.
-  ThreadId tid() const {
-    return tid_;
-  }
+  ThreadId tid() const { return tid_; }
 
   void Clear() {
     isolate_ = NULL;
@@ -204,14 +190,10 @@
   }
 
   // Timestamp sample was taken at.
-  int64_t timestamp() const {
-    return timestamp_;
-  }
+  int64_t timestamp() const { return timestamp_; }
 
   // Top most pc.
-  uword pc() const {
-    return At(0);
-  }
+  uword pc() const { return At(0); }
 
   // Get stack trace entry.
   uword At(intptr_t i) const {
@@ -229,56 +211,36 @@
     pcs[i] = pc;
   }
 
-  uword vm_tag() const {
-    return vm_tag_;
-  }
+  uword vm_tag() const { return vm_tag_; }
   void set_vm_tag(uword tag) {
     ASSERT(tag != VMTag::kInvalidTagId);
     vm_tag_ = tag;
   }
 
-  uword user_tag() const {
-    return user_tag_;
-  }
-  void set_user_tag(uword tag) {
-    user_tag_ = tag;
-  }
+  uword user_tag() const { return user_tag_; }
+  void set_user_tag(uword tag) { user_tag_ = tag; }
 
-  uword pc_marker() const {
-    return pc_marker_;
-  }
+  uword pc_marker() const { return pc_marker_; }
 
-  void set_pc_marker(uword pc_marker) {
-    pc_marker_ = pc_marker;
-  }
+  void set_pc_marker(uword pc_marker) { pc_marker_ = pc_marker; }
 
-  uword lr() const {
-    return lr_;
-  }
+  uword lr() const { return lr_; }
 
-  void set_lr(uword link_register) {
-    lr_ = link_register;
-  }
+  void set_lr(uword link_register) { lr_ = link_register; }
 
-  bool leaf_frame_is_dart() const {
-    return LeafFrameIsDart::decode(state_);
-  }
+  bool leaf_frame_is_dart() const { return LeafFrameIsDart::decode(state_); }
 
   void set_leaf_frame_is_dart(bool leaf_frame_is_dart) {
     state_ = LeafFrameIsDart::update(leaf_frame_is_dart, state_);
   }
 
-  bool ignore_sample() const {
-    return IgnoreBit::decode(state_);
-  }
+  bool ignore_sample() const { return IgnoreBit::decode(state_); }
 
   void set_ignore_sample(bool ignore_sample) {
     state_ = IgnoreBit::update(ignore_sample, state_);
   }
 
-  bool exit_frame_sample() const {
-    return ExitFrameBit::decode(state_);
-  }
+  bool exit_frame_sample() const { return ExitFrameBit::decode(state_); }
 
   void set_exit_frame_sample(bool exit_frame_sample) {
     state_ = ExitFrameBit::update(exit_frame_sample, state_);
@@ -292,9 +254,7 @@
     state_ = MissingFrameInsertedBit::update(missing_frame_inserted, state_);
   }
 
-  bool truncated_trace() const {
-    return TruncatedTraceBit::decode(state_);
-  }
+  bool truncated_trace() const { return TruncatedTraceBit::decode(state_); }
 
   void set_truncated_trace(bool truncated_trace) {
     state_ = TruncatedTraceBit::update(truncated_trace, state_);
@@ -308,9 +268,7 @@
     state_ = ClassAllocationSampleBit::update(allocation_sample, state_);
   }
 
-  Thread::TaskKind thread_task() const {
-    return ThreadTaskBit::decode(state_);
-  }
+  Thread::TaskKind thread_task() const { return ThreadTaskBit::decode(state_); }
 
   void set_thread_task(Thread::TaskKind task) {
     state_ = ThreadTaskBit::update(task, state_);
@@ -342,13 +300,9 @@
     state_ = HeadSampleBit::update(head_sample, state_);
   }
 
-  bool head_sample() const {
-    return HeadSampleBit::decode(state_);
-  }
+  bool head_sample() const { return HeadSampleBit::decode(state_); }
 
-  void set_metadata(intptr_t metadata) {
-    metadata_ = metadata;
-  }
+  void set_metadata(intptr_t metadata) { metadata_ = metadata; }
 
   void SetAllocationCid(intptr_t cid) {
     set_is_allocation_sample(true);
@@ -357,16 +311,12 @@
 
   static void InitOnce();
 
-  static intptr_t instance_size() {
-    return instance_size_;
-  }
+  static intptr_t instance_size() { return instance_size_; }
 
   uword* GetPCArray() const;
 
   static const int kStackBufferSizeInWords = 2;
-  uword* GetStackBuffer() {
-    return &stack_buffer_[0];
-  }
+  uword* GetStackBuffer() { return &stack_buffer_[0]; }
 
  private:
   static intptr_t instance_size_;
@@ -384,14 +334,14 @@
     kNextFreeBit = 13,
   };
   class HeadSampleBit : public BitField<uword, bool, kHeadSampleBit, 1> {};
-  class LeafFrameIsDart :
-      public BitField<uword, bool, kLeafFrameIsDartBit, 1> {};
+  class LeafFrameIsDart : public BitField<uword, bool, kLeafFrameIsDartBit, 1> {
+  };
   class IgnoreBit : public BitField<uword, bool, kIgnoreBit, 1> {};
   class ExitFrameBit : public BitField<uword, bool, kExitFrameBit, 1> {};
   class MissingFrameInsertedBit
       : public BitField<uword, bool, kMissingFrameInsertedBit, 1> {};
-  class TruncatedTraceBit :
-      public BitField<uword, bool, kTruncatedTraceBit, 1> {};
+  class TruncatedTraceBit
+      : public BitField<uword, bool, kTruncatedTraceBit, 1> {};
   class ClassAllocationSampleBit
       : public BitField<uword, bool, kClassAllocationSampleBit, 1> {};
   class ContinuationSampleBit
@@ -429,21 +379,16 @@
 
   int64_t CompileTimestamp() const;
 
-  RawCode* code() const {
-    return code_.raw();
-  }
+  RawCode* code() const { return code_.raw(); }
 
-  const char* Name() const {
-    return code_.Name();
-  }
+  const char* Name() const { return code_.Name(); }
 
   bool Contains(uword pc) const {
     uword end = Start() + Size();
     return (pc >= Start()) && (pc < end);
   }
 
-  static int Compare(CodeDescriptor* const* a,
-                     CodeDescriptor* const* b) {
+  static int Compare(CodeDescriptor* const* a, CodeDescriptor* const* b) {
     ASSERT(a != NULL);
     ASSERT(b != NULL);
 
@@ -471,9 +416,7 @@
  public:
   explicit CodeLookupTable(Thread* thread);
 
-  intptr_t length() const {
-    return code_objects_.length();
-  }
+  intptr_t length() const { return code_objects_.length(); }
 
   const CodeDescriptor* At(intptr_t index) const {
     return code_objects_.At(index);
@@ -571,14 +514,10 @@
   ProcessedSample();
 
   // Add |pc| to stack trace.
-  void Add(uword pc) {
-    pcs_.Add(pc);
-  }
+  void Add(uword pc) { pcs_.Add(pc); }
 
   // Insert |pc| at |index|.
-  void InsertAt(intptr_t index, uword pc) {
-    pcs_.InsertAt(index, pc);
-  }
+  void InsertAt(intptr_t index, uword pc) { pcs_.InsertAt(index, pc); }
 
   // Number of pcs in stack trace.
   intptr_t length() const { return pcs_.length(); }
@@ -609,9 +548,7 @@
   intptr_t allocation_cid() const { return allocation_cid_; }
   void set_allocation_cid(intptr_t cid) { allocation_cid_ = cid; }
 
-  bool IsAllocationSample() const {
-    return allocation_cid_ > 0;
-  }
+  bool IsAllocationSample() const { return allocation_cid_ > 0; }
 
   // Was the stack trace truncated?
   bool truncated() const { return truncated_; }
@@ -659,17 +596,11 @@
  public:
   ProcessedSampleBuffer();
 
-  void Add(ProcessedSample* sample) {
-    samples_.Add(sample);
-  }
+  void Add(ProcessedSample* sample) { samples_.Add(sample); }
 
-  intptr_t length() const {
-    return samples_.length();
-  }
+  intptr_t length() const { return samples_.length(); }
 
-  ProcessedSample* At(intptr_t index) {
-    return samples_.At(index);
-  }
+  ProcessedSample* At(intptr_t index) { return samples_.At(index); }
 
   const CodeLookupTable& code_lookup_table() const {
     return *code_lookup_table_;
@@ -684,4 +615,4 @@
 
 }  // namespace dart
 
-#endif  // VM_PROFILER_H_
+#endif  // RUNTIME_VM_PROFILER_H_
diff --git a/runtime/vm/profiler_service.cc b/runtime/vm/profiler_service.cc
index b198a22..6731e2d 100644
--- a/runtime/vm/profiler_service.cc
+++ b/runtime/vm/profiler_service.cc
@@ -29,9 +29,8 @@
       : previous_(
             GrowableObjectArray::ZoneHandle(isolate->deoptimized_code_array())),
         current_(GrowableObjectArray::ZoneHandle(
-            previous_.IsNull() ? GrowableObjectArray::null() :
-                                 GrowableObjectArray::New())) {
-  }
+            previous_.IsNull() ? GrowableObjectArray::null()
+                               : GrowableObjectArray::New())) {}
 
   void Add(const Code& code) {
     if (current_.IsNull()) {
@@ -49,9 +48,10 @@
     if ((size_before > 0) && FLAG_trace_profiler) {
       intptr_t length_before = previous_.Length();
       intptr_t length_after = current_.Length();
-      OS::Print("Updating isolate deoptimized code array: "
-                "%" Pd " -> %" Pd " [%" Pd " -> %" Pd "]\n",
-                size_before, size_after, length_before, length_after);
+      OS::Print(
+          "Updating isolate deoptimized code array: "
+          "%" Pd " -> %" Pd " [%" Pd " -> %" Pd "]\n",
+          size_before, size_after, length_before, length_after);
     }
     isolate->set_deoptimized_code_array(current_);
   }
@@ -93,10 +93,7 @@
 
 ProfileFunctionSourcePosition::ProfileFunctionSourcePosition(
     TokenPosition token_pos)
-    : token_pos_(token_pos),
-      exclusive_ticks_(0),
-      inclusive_ticks_(0) {
-}
+    : token_pos_(token_pos), exclusive_ticks_(0), inclusive_ticks_(0) {}
 
 
 void ProfileFunctionSourcePosition::Tick(bool exclusive) {
@@ -109,9 +106,9 @@
 
 
 ProfileFunction::ProfileFunction(Kind kind,
-                  const char* name,
-                  const Function& function,
-                  const intptr_t table_index)
+                                 const char* name,
+                                 const Function& function,
+                                 const intptr_t table_index)
     : kind_(kind),
       name_(name),
       function_(Function::ZoneHandle(function.raw())),
@@ -273,10 +270,7 @@
 
 
 ProfileCodeAddress::ProfileCodeAddress(uword pc)
-    : pc_(pc),
-      exclusive_ticks_(0),
-      inclusive_ticks_(0) {
-}
+    : pc_(pc), exclusive_ticks_(0), inclusive_ticks_(0) {}
 
 
 void ProfileCodeAddress::Tick(bool exclusive) {
@@ -304,8 +298,7 @@
       compile_timestamp_(0),
       function_(NULL),
       code_table_index_(-1),
-      address_ticks_(0) {
-}
+      address_ticks_(0) {}
 
 
 void ProfileCode::AdjustExtent(uword start, uword end) {
@@ -321,10 +314,8 @@
 
 bool ProfileCode::Overlaps(const ProfileCode* other) const {
   ASSERT(other != NULL);
-  return other->Contains(start_)   ||
-         other->Contains(end_ - 1) ||
-         Contains(other->start())  ||
-         Contains(other->end() - 1);
+  return other->Contains(start_) || other->Contains(end_ - 1) ||
+         Contains(other->start()) || Contains(other->end() - 1);
 }
 
 
@@ -347,8 +338,8 @@
 void ProfileCode::GenerateAndSetSymbolName(const char* prefix) {
   const intptr_t kBuffSize = 512;
   char buff[kBuffSize];
-  OS::SNPrint(&buff[0], kBuffSize-1, "%s [%" Px ", %" Px ")",
-              prefix, start(), end());
+  OS::SNPrint(&buff[0], kBuffSize - 1, "%s [%" Px ", %" Px ")", prefix, start(),
+              end());
   SetName(buff);
 }
 
@@ -527,8 +518,8 @@
       : null_function_(Function::ZoneHandle()),
         unknown_function_(NULL),
         table_(8) {
-    unknown_function_ = Add(ProfileFunction::kUnknownFunction,
-                            "<unknown Dart function>");
+    unknown_function_ =
+        Add(ProfileFunction::kUnknownFunction, "<unknown Dart function>");
   }
 
   ProfileFunction* LookupOrAdd(const Function& function) {
@@ -568,9 +559,7 @@
     return Add(ProfileFunction::kStubFunction, name);
   }
 
-  intptr_t length() const {
-    return table_.length();
-  }
+  intptr_t length() const { return table_.length(); }
 
   ProfileFunction* At(intptr_t i) const {
     ASSERT(i >= 0);
@@ -583,21 +572,15 @@
     ASSERT(kind != ProfileFunction::kDartFunction);
     ASSERT(name != NULL);
     ProfileFunction* profile_function =
-        new ProfileFunction(kind,
-                            name,
-                            null_function_,
-                            table_.length());
+        new ProfileFunction(kind, name, null_function_, table_.length());
     table_.Add(profile_function);
     return profile_function;
   }
 
   ProfileFunction* Add(const Function& function) {
     ASSERT(Lookup(function) == NULL);
-    ProfileFunction* profile_function =
-        new ProfileFunction(ProfileFunction::kDartFunction,
-                            NULL,
-                            function,
-                            table_.length());
+    ProfileFunction* profile_function = new ProfileFunction(
+        ProfileFunction::kDartFunction, NULL, function, table_.length());
     table_.Add(profile_function);
     function_hash_.Insert(profile_function);
     return profile_function;
@@ -609,17 +592,11 @@
     typedef const Function* Key;
     typedef ProfileFunction* Pair;
 
-    static Key KeyOf(Pair kv) {
-      return kv->function();
-    }
+    static Key KeyOf(Pair kv) { return kv->function(); }
 
-    static Value ValueOf(Pair kv) {
-      return kv;
-    }
+    static Value ValueOf(Pair kv) { return kv; }
 
-    static inline intptr_t Hashcode(Key key) {
-      return key->Hash();
-    }
+    static inline intptr_t Hashcode(Key key) { return key->Hash(); }
 
     static inline bool IsKeyEqual(Pair kv, Key key) {
       return kv->function()->raw() == key->raw();
@@ -667,8 +644,7 @@
         const char* tag_name = UserTags::TagName(start());
         ASSERT(tag_name != NULL);
         SetName(tag_name);
-      } else if (VMTag::IsVMTag(start()) ||
-                 VMTag::IsRuntimeEntryTag(start()) ||
+      } else if (VMTag::IsVMTag(start()) || VMTag::IsRuntimeEntryTag(start()) ||
                  VMTag::IsNativeEntryTag(start())) {
         const char* tag_name = VMTag::TagName(start());
         ASSERT(tag_name != NULL);
@@ -701,7 +677,7 @@
             break;
           default:
             UNIMPLEMENTED();
-          break;
+            break;
         }
       }
     }
@@ -722,9 +698,7 @@
 
 class ProfileCodeTable : public ZoneAllocated {
  public:
-  ProfileCodeTable()
-      : table_(8) {
-  }
+  ProfileCodeTable() : table_(8) {}
 
   intptr_t length() const { return table_.length(); }
 
@@ -846,8 +820,10 @@
     return end <= pc;
   }
 
-  void HandleOverlap(ProfileCode* existing, ProfileCode* code,
-                     uword start, uword end) {
+  void HandleOverlap(ProfileCode* existing,
+                     ProfileCode* code,
+                     uword start,
+                     uword end) {
     // We should never see overlapping Dart code regions.
     ASSERT(existing->kind() != ProfileCode::kDartCode);
     // We should never see overlapping Tag code regions.
@@ -874,12 +850,10 @@
     const intptr_t length = table_.length();
     for (intptr_t i = 0; i < length; i++) {
       ProfileCode* a = table_[i];
-      for (intptr_t j = i+1; j < length; j++) {
+      for (intptr_t j = i + 1; j < length; j++) {
         ProfileCode* b = table_[j];
-        ASSERT(!a->Contains(b->start()) &&
-               !a->Contains(b->end() - 1) &&
-               !b->Contains(a->start()) &&
-               !b->Contains(a->end() - 1));
+        ASSERT(!a->Contains(b->start()) && !a->Contains(b->end() - 1) &&
+               !b->Contains(a->start()) && !b->Contains(a->end() - 1));
       }
     }
   }
@@ -889,16 +863,12 @@
 
 
 ProfileTrieNode::ProfileTrieNode(intptr_t table_index)
-    : table_index_(table_index),
-      count_(0),
-      children_(0),
-      frame_id_(-1) {
+    : table_index_(table_index), count_(0), children_(0), frame_id_(-1) {
   ASSERT(table_index_ >= 0);
 }
 
 
-ProfileTrieNode::~ProfileTrieNode() {
-}
+ProfileTrieNode::~ProfileTrieNode() {}
 
 
 void ProfileTrieNode::SortChildren() {
@@ -923,8 +893,7 @@
 class ProfileCodeTrieNode : public ProfileTrieNode {
  public:
   explicit ProfileCodeTrieNode(intptr_t table_index)
-      : ProfileTrieNode(table_index) {
-  }
+      : ProfileTrieNode(table_index) {}
 
   void PrintToJSONArray(JSONArray* array) const {
     ASSERT(array != NULL);
@@ -971,21 +940,13 @@
 class ProfileFunctionTrieNodeCode {
  public:
   explicit ProfileFunctionTrieNodeCode(intptr_t index)
-      : code_index_(index),
-        ticks_(0) {
-  }
+      : code_index_(index), ticks_(0) {}
 
-  intptr_t index() const {
-    return code_index_;
-  }
+  intptr_t index() const { return code_index_; }
 
-  void Tick() {
-    ticks_++;
-  }
+  void Tick() { ticks_++; }
 
-  intptr_t ticks() const {
-    return ticks_;
-  }
+  intptr_t ticks() const { return ticks_; }
 
  private:
   intptr_t code_index_;
@@ -996,9 +957,7 @@
 class ProfileFunctionTrieNode : public ProfileTrieNode {
  public:
   explicit ProfileFunctionTrieNode(intptr_t table_index)
-      : ProfileTrieNode(table_index),
-        code_objects_(1) {
-  }
+      : ProfileTrieNode(table_index), code_objects_(1) {}
 
   void PrintToJSONArray(JSONArray* array) const {
     ASSERT(array != NULL);
@@ -1069,9 +1028,7 @@
 
 class ProfileCodeInlinedFunctionsCache : public ValueObject {
  public:
-  ProfileCodeInlinedFunctionsCache()
-      : cache_cursor_(0),
-        last_hit_(0) {
+  ProfileCodeInlinedFunctionsCache() : cache_cursor_(0), last_hit_(0) {
     for (intptr_t i = 0; i < kCacheSize; i++) {
       cache_[i].Reset();
     }
@@ -1082,10 +1039,8 @@
   ~ProfileCodeInlinedFunctionsCache() {
     if (FLAG_trace_profiler) {
       intptr_t total = cache_hit_ + cache_miss_;
-      OS::Print("LOOKUPS: %" Pd " HITS: %" Pd " MISSES: %" Pd "\n",
-                total,
-                cache_hit_,
-                cache_miss_);
+      OS::Print("LOOKUPS: %" Pd " HITS: %" Pd " MISSES: %" Pd "\n", total,
+                cache_hit_, cache_miss_);
     }
   }
 
@@ -1098,16 +1053,13 @@
            GrowableArray<TokenPosition>** inlined_token_positions,
            TokenPosition* token_position) {
     const intptr_t offset = OffsetForPC(pc, code, sample, frame_index);
-    if (FindInCache(pc,
-                    offset,
-                    inlined_functions,
-                    inlined_token_positions,
+    if (FindInCache(pc, offset, inlined_functions, inlined_token_positions,
                     token_position)) {
       // Found in cache.
       return;
     }
-    Add(pc, code, sample, frame_index,
-        inlined_functions, inlined_token_positions, token_position);
+    Add(pc, code, sample, frame_index, inlined_functions,
+        inlined_token_positions, token_position);
   }
 
  private:
@@ -1151,8 +1103,7 @@
     CacheEntry* cache_entry = &cache_[NextFreeIndex()];
     cache_entry->pc = pc;
     cache_entry->offset = offset;
-    code.GetInlinedFunctionsAt(offset,
-                               &(cache_entry->inlined_functions),
+    code.GetInlinedFunctionsAt(offset, &(cache_entry->inlined_functions),
                                &(cache_entry->inlined_token_positions));
     cache_entry->token_position = code.GetTokenPositionAt(offset);
     *token_position = (cache_entry->token_position);
@@ -1164,9 +1115,8 @@
     // The inlined token position table does not include the token position
     // of the final call. Insert it at the beginning because the table.
     // is reversed.
-    cache_entry->inlined_token_positions.InsertAt(
-        0,
-        cache_entry->token_position);
+    cache_entry->inlined_token_positions.InsertAt(0,
+                                                  cache_entry->token_position);
 
     // Write outputs.
     *inlined_functions = &(cache_entry->inlined_functions);
@@ -1275,8 +1225,8 @@
  private:
   // Returns true if |frame_index| in |sample| is using CPU.
   static bool IsExecutingFrame(ProcessedSample* sample, intptr_t frame_index) {
-    return (frame_index == 0) && (sample->first_frame_executing() ||
-                                  sample->IsAllocationSample());
+    return (frame_index == 0) &&
+           (sample->first_frame_executing() || sample->IsAllocationSample());
   }
 
   static bool IsInclusiveTrie(Profile::TrieKind kind) {
@@ -1340,17 +1290,13 @@
       ASSERT(descriptor != NULL);
       const Code& code = Code::Handle(descriptor->code());
       ASSERT(!code.IsNull());
-      RegisterLiveProfileCode(
-          new ProfileCode(ProfileCode::kDartCode,
-                          code.PayloadStart(),
-                          code.PayloadStart() + code.Size(),
-                          code.compile_timestamp(),
-                          code));
+      RegisterLiveProfileCode(new ProfileCode(
+          ProfileCode::kDartCode, code.PayloadStart(),
+          code.PayloadStart() + code.Size(), code.compile_timestamp(), code));
     }
 
     // Iterate over samples.
-    for (intptr_t sample_index = 0;
-         sample_index < samples_->length();
+    for (intptr_t sample_index = 0; sample_index < samples_->length();
          sample_index++) {
       ProcessedSample* sample = samples_->At(sample_index);
       const int64_t timestamp = sample->timestamp();
@@ -1371,8 +1317,7 @@
 
       // Make sure that a ProfileCode objects exist for all pcs in the sample
       // and tick each one.
-      for (intptr_t frame_index = 0;
-           frame_index < sample->length();
+      for (intptr_t frame_index = 0; frame_index < sample->length();
            frame_index++) {
         const uword pc = sample->At(frame_index);
         ASSERT(pc != 0);
@@ -1461,8 +1406,7 @@
   void BuildInclusiveCodeTrie(ProfileCodeTrieNode* root) {
     ScopeTimer sw("ProfileBuilder::BuildInclusiveCodeTrie",
                   FLAG_trace_profiler);
-    for (intptr_t sample_index = 0;
-         sample_index < samples_->length();
+    for (intptr_t sample_index = 0; sample_index < samples_->length();
          sample_index++) {
       ProcessedSample* sample = samples_->At(sample_index);
 
@@ -1482,8 +1426,7 @@
 
       // Walk the sampled PCs.
       Code& code = Code::Handle();
-      for (intptr_t frame_index = sample->length() - 1;
-           frame_index >= 0;
+      for (intptr_t frame_index = sample->length() - 1; frame_index >= 0;
            frame_index--) {
         ASSERT(sample->At(frame_index) != 0);
         intptr_t index =
@@ -1507,8 +1450,7 @@
   void BuildExclusiveCodeTrie(ProfileCodeTrieNode* root) {
     ScopeTimer sw("ProfileBuilder::BuildExclusiveCodeTrie",
                   FLAG_trace_profiler);
-    for (intptr_t sample_index = 0;
-         sample_index < samples_->length();
+    for (intptr_t sample_index = 0; sample_index < samples_->length();
          sample_index++) {
       ProcessedSample* sample = samples_->At(sample_index);
 
@@ -1527,8 +1469,7 @@
 
       // Walk the sampled PCs.
       Code& code = Code::Handle();
-      for (intptr_t frame_index = 0;
-           frame_index < sample->length();
+      for (intptr_t frame_index = 0; frame_index < sample->length();
            frame_index++) {
         ASSERT(sample->At(frame_index) != 0);
         intptr_t index =
@@ -1552,9 +1493,8 @@
   }
 
   void BuildFunctionTrie(Profile::TrieKind kind) {
-    ProfileFunctionTrieNode* root =
-        new ProfileFunctionTrieNode(
-            GetProfileFunctionTagIndex(VMTag::kRootTagId));
+    ProfileFunctionTrieNode* root = new ProfileFunctionTrieNode(
+        GetProfileFunctionTagIndex(VMTag::kRootTagId));
     // We tick the functions while building the trie, but, we don't want to do
     // it for both tries, just the exclusive trie.
     inclusive_tree_ = IsInclusiveTrie(kind);
@@ -1572,8 +1512,7 @@
     ScopeTimer sw("ProfileBuilder::BuildInclusiveFunctionTrie",
                   FLAG_trace_profiler);
     ASSERT(!tick_functions_);
-    for (intptr_t sample_index = 0;
-         sample_index < samples_->length();
+    for (intptr_t sample_index = 0; sample_index < samples_->length();
          sample_index++) {
       ProcessedSample* sample = samples_->At(sample_index);
 
@@ -1590,8 +1529,7 @@
       }
 
       // Walk the sampled PCs.
-      for (intptr_t frame_index = sample->length() - 1;
-           frame_index >= 0;
+      for (intptr_t frame_index = sample->length() - 1; frame_index >= 0;
            frame_index--) {
         ASSERT(sample->At(frame_index) != 0);
         current = ProcessFrame(current, sample_index, sample, frame_index);
@@ -1609,8 +1547,7 @@
     ScopeTimer sw("ProfileBuilder::BuildExclusiveFunctionTrie",
                   FLAG_trace_profiler);
     ASSERT(tick_functions_);
-    for (intptr_t sample_index = 0;
-         sample_index < samples_->length();
+    for (intptr_t sample_index = 0; sample_index < samples_->length();
          sample_index++) {
       ProcessedSample* sample = samples_->At(sample_index);
 
@@ -1628,8 +1565,7 @@
       }
 
       // Walk the sampled PCs.
-      for (intptr_t frame_index = 0;
-           frame_index < sample->length();
+      for (intptr_t frame_index = 0; frame_index < sample->length();
            frame_index++) {
         ASSERT(sample->At(frame_index) != 0);
         current = ProcessFrame(current, sample_index, sample, frame_index);
@@ -1645,14 +1581,12 @@
     }
   }
 
-  ProfileFunctionTrieNode* ProcessFrame(
-      ProfileFunctionTrieNode* current,
-      intptr_t sample_index,
-      ProcessedSample* sample,
-      intptr_t frame_index) {
+  ProfileFunctionTrieNode* ProcessFrame(ProfileFunctionTrieNode* current,
+                                        intptr_t sample_index,
+                                        ProcessedSample* sample,
+                                        intptr_t frame_index) {
     const uword pc = sample->At(frame_index);
-    ProfileCode* profile_code = GetProfileCode(pc,
-                                               sample->timestamp());
+    ProfileCode* profile_code = GetProfileCode(pc, sample->timestamp());
     ProfileFunction* function = profile_code->function();
     ASSERT(function != NULL);
     const intptr_t code_index = profile_code->code_table_index();
@@ -1663,34 +1597,26 @@
     TokenPosition token_position = TokenPosition::kNoSource;
     if (!code.IsNull()) {
       inlined_functions_cache_.Get(pc, code, sample, frame_index,
-                                   &inlined_functions,
-                                   &inlined_token_positions,
+                                   &inlined_functions, &inlined_token_positions,
                                    &token_position);
       if (FLAG_trace_profiler_verbose) {
         for (intptr_t i = 0; i < inlined_functions->length(); i++) {
           const String& name =
               String::Handle((*inlined_functions)[i]->QualifiedScrubbedName());
-          THR_Print("InlinedFunction[%" Pd "] = {%s, %s}\n",
-                    i,
+          THR_Print("InlinedFunction[%" Pd "] = {%s, %s}\n", i,
                     name.ToCString(),
                     (*inlined_token_positions)[i].ToCString());
         }
       }
     }
-    if (code.IsNull() ||
-        (inlined_functions == NULL) ||
+    if (code.IsNull() || (inlined_functions == NULL) ||
         (inlined_functions->length() == 0)) {
       // No inlined functions.
       if (inclusive_tree_) {
         current = AppendKind(code, current);
       }
-      current = ProcessFunction(current,
-                                sample_index,
-                                sample,
-                                frame_index,
-                                function,
-                                token_position,
-                                code_index);
+      current = ProcessFunction(current, sample_index, sample, frame_index,
+                                function, token_position, code_index);
       if (!inclusive_tree_) {
         current = AppendKind(code, current);
       }
@@ -1709,13 +1635,9 @@
         if (inliner) {
           current = AppendKind(code, current);
         }
-        current = ProcessInlinedFunction(current,
-                                         sample_index,
-                                         sample,
-                                         frame_index,
-                                         inlined_function,
-                                         inlined_token_position,
-                                         code_index);
+        current = ProcessInlinedFunction(current, sample_index, sample,
+                                         frame_index, inlined_function,
+                                         inlined_token_position, code_index);
         if (inliner) {
           current = AppendKind(kInlineStart, current);
         }
@@ -1733,13 +1655,9 @@
         if (inliner) {
           current = AppendKind(kInlineStart, current);
         }
-        current = ProcessInlinedFunction(current,
-                                         sample_index,
-                                         sample,
-                                         frame_index + i,
-                                         inlined_function,
-                                         inlined_token_position,
-                                         code_index);
+        current = ProcessInlinedFunction(current, sample_index, sample,
+                                         frame_index + i, inlined_function,
+                                         inlined_token_position, code_index);
         if (inliner) {
           current = AppendKind(code, current);
         }
@@ -1760,13 +1678,8 @@
     ProfileFunctionTable* function_table = profile_->functions_;
     ProfileFunction* function = function_table->LookupOrAdd(*inlined_function);
     ASSERT(function != NULL);
-    return ProcessFunction(current,
-                           sample_index,
-                           sample,
-                           frame_index,
-                           function,
-                           inlined_token_position,
-                           code_index);
+    return ProcessFunction(current, sample_index, sample, frame_index, function,
+                           inlined_token_position, code_index);
   }
 
   bool ShouldTickNode(ProcessedSample* sample, intptr_t frame_index) {
@@ -1775,8 +1688,8 @@
     }
     // Only tick the first frame's node, if we are executing OR
     // vm tags have been emitted.
-    return IsExecutingFrame(sample, frame_index) ||
-           !FLAG_profile_vm || vm_tags_emitted();
+    return IsExecutingFrame(sample, frame_index) || !FLAG_profile_vm ||
+           vm_tags_emitted();
   }
 
   ProfileFunctionTrieNode* ProcessFunction(ProfileFunctionTrieNode* current,
@@ -1791,15 +1704,11 @@
     }
     if (tick_functions_) {
       if (FLAG_trace_profiler_verbose) {
-        THR_Print("S[%" Pd "]F[%" Pd "] %s %s 0x%" Px "\n",
-                  sample_index,
-                  frame_index,
-                  function->Name(),
-                  token_position.ToCString(),
+        THR_Print("S[%" Pd "]F[%" Pd "] %s %s 0x%" Px "\n", sample_index,
+                  frame_index, function->Name(), token_position.ToCString(),
                   sample->At(frame_index));
       }
-      function->Tick(IsExecutingFrame(sample, frame_index),
-                     sample_index,
+      function->Tick(IsExecutingFrame(sample, frame_index), sample_index,
                      token_position);
     }
     function->AddProfileCode(code_index);
@@ -1847,8 +1756,7 @@
     return current;
   }
 
-  ProfileCodeTrieNode* AppendVMTag(uword vm_tag,
-                                   ProfileCodeTrieNode* current) {
+  ProfileCodeTrieNode* AppendVMTag(uword vm_tag, ProfileCodeTrieNode* current) {
     if (VMTag::IsNativeEntryTag(vm_tag)) {
       // Insert a dummy kNativeTagId node.
       intptr_t tag_index = GetProfileCodeTagIndex(VMTag::kNativeTagId);
@@ -1871,10 +1779,10 @@
   }
 
   ProfileCodeTrieNode* AppendSpecificNativeRuntimeEntryVMTag(
-      uword vm_tag, ProfileCodeTrieNode* current) {
+      uword vm_tag,
+      ProfileCodeTrieNode* current) {
     // Only Native and Runtime entries have a second VM tag.
-    if (!VMTag::IsNativeEntryTag(vm_tag) &&
-        !VMTag::IsRuntimeEntryTag(vm_tag)) {
+    if (!VMTag::IsNativeEntryTag(vm_tag) && !VMTag::IsRuntimeEntryTag(vm_tag)) {
       return current;
     }
     intptr_t tag_index = GetProfileCodeTagIndex(vm_tag);
@@ -1976,8 +1884,7 @@
       return current;
     }
 
-    if (VMTag::IsNativeEntryTag(vm_tag) ||
-        VMTag::IsRuntimeEntryTag(vm_tag)) {
+    if (VMTag::IsNativeEntryTag(vm_tag) || VMTag::IsRuntimeEntryTag(vm_tag)) {
       current = AppendSpecificNativeRuntimeEntryVMTag(vm_tag, current);
     } else {
       intptr_t tag_index = GetProfileCodeTagIndex(vm_tag);
@@ -2025,9 +1932,7 @@
   }
 
   // ProfileFunctionTrieNode
-  void ResetKind() {
-    info_kind_ = kNone;
-  }
+  void ResetKind() { info_kind_ = kNone; }
 
   ProfileFunctionTrieNode* AppendKind(ProfileInfoKind kind,
                                       ProfileFunctionTrieNode* current) {
@@ -2101,10 +2006,10 @@
   }
 
   ProfileFunctionTrieNode* AppendSpecificNativeRuntimeEntryVMTag(
-      uword vm_tag, ProfileFunctionTrieNode* current) {
+      uword vm_tag,
+      ProfileFunctionTrieNode* current) {
     // Only Native and Runtime entries have a second VM tag.
-    if (!VMTag::IsNativeEntryTag(vm_tag) &&
-        !VMTag::IsRuntimeEntryTag(vm_tag)) {
+    if (!VMTag::IsNativeEntryTag(vm_tag) && !VMTag::IsRuntimeEntryTag(vm_tag)) {
       return current;
     }
     intptr_t tag_index = GetProfileFunctionTagIndex(vm_tag);
@@ -2130,8 +2035,7 @@
     if (!VMTag::IsExitFrameTag(vm_tag)) {
       return current;
     }
-    if (VMTag::IsNativeEntryTag(vm_tag) ||
-        VMTag::IsRuntimeEntryTag(vm_tag)) {
+    if (VMTag::IsNativeEntryTag(vm_tag) || VMTag::IsRuntimeEntryTag(vm_tag)) {
       current = AppendSpecificNativeRuntimeEntryVMTag(vm_tag, current);
     } else {
       intptr_t tag_index = GetProfileFunctionTagIndex(vm_tag);
@@ -2240,21 +2144,15 @@
       // Already created.
       return;
     }
-    ProfileCode* code = new ProfileCode(ProfileCode::kTagCode,
-                                        tag,
-                                        tag + 1,
-                                        0,
-                                        null_code_);
+    ProfileCode* code =
+        new ProfileCode(ProfileCode::kTagCode, tag, tag + 1, 0, null_code_);
     index = tag_table->InsertCode(code);
     ASSERT(index >= 0);
   }
 
   ProfileCode* CreateProfileCodeReused(uword pc) {
-    ProfileCode* code = new ProfileCode(ProfileCode::kReusedCode,
-                                        pc,
-                                        pc + 1,
-                                        0,
-                                        null_code_);
+    ProfileCode* code =
+        new ProfileCode(ProfileCode::kReusedCode, pc, pc + 1, 0, null_code_);
     return code;
   }
 
@@ -2277,8 +2175,8 @@
 
     // Check NativeSymbolResolver for pc.
     uintptr_t native_start = 0;
-    char* native_name = NativeSymbolResolver::LookupSymbolName(pc,
-                                                               &native_start);
+    char* native_name =
+        NativeSymbolResolver::LookupSymbolName(pc, &native_start);
     if (native_name == NULL) {
       // Failed to find a native symbol for pc.
       native_start = pc;
@@ -2291,11 +2189,8 @@
 #endif
 
     ASSERT(pc >= native_start);
-    profile_code = new ProfileCode(ProfileCode::kNativeCode,
-                                   native_start,
-                                   pc + 1,
-                                   0,
-                                   code);
+    profile_code = new ProfileCode(ProfileCode::kNativeCode, native_start,
+                                   pc + 1, 0, code);
     if (native_name != NULL) {
       profile_code->SetName(native_name);
       NativeSymbolResolver::FreeSymbolName(native_name);
@@ -2340,14 +2235,11 @@
     return FindOrRegisterDeadProfileCode(pc);
   }
 
-  Profile::TagOrder tag_order() const {
-    return tag_order_;
-  }
+  Profile::TagOrder tag_order() const { return tag_order_; }
 
   bool vm_tags_emitted() const {
     return (tag_order_ == Profile::kUserVM) ||
-           (tag_order_ == Profile::kVMUser) ||
-           (tag_order_ == Profile::kVM);
+           (tag_order_ == Profile::kVMUser) || (tag_order_ == Profile::kVM);
   }
 
   bool TagsEnabled(intptr_t extra_tags_bits) const {
@@ -2441,10 +2333,8 @@
 
 
 void Profile::PrintHeaderJSON(JSONObject* obj) {
-  obj->AddProperty("samplePeriod",
-                   static_cast<intptr_t>(FLAG_profile_period));
-  obj->AddProperty("stackDepth",
-                   static_cast<intptr_t>(FLAG_max_profile_depth));
+  obj->AddProperty("samplePeriod", static_cast<intptr_t>(FLAG_profile_period));
+  obj->AddProperty("stackDepth", static_cast<intptr_t>(FLAG_max_profile_depth));
   obj->AddProperty("sampleCount", sample_count());
   obj->AddProperty("timeSpan", MicrosecondsToSeconds(GetTimeSpan()));
   obj->AddPropertyTimeMicros("timeOriginMicros", min_time());
@@ -2453,36 +2343,24 @@
   ProfilerCounters counters = Profiler::counters();
   {
     JSONObject counts(obj, "counters");
-    counts.AddProperty64(
-        "bail_out_unknown_task",
-        counters.bail_out_unknown_task);
-    counts.AddProperty64(
-        "bail_out_jump_to_exception_handler",
-        counters.bail_out_jump_to_exception_handler);
-    counts.AddProperty64(
-        "bail_out_check_isolate",
-        counters.bail_out_check_isolate);
-    counts.AddProperty64(
-        "single_frame_sample_deoptimizing",
-        counters.single_frame_sample_deoptimizing);
-    counts.AddProperty64(
-        "single_frame_sample_register_check",
-        counters.single_frame_sample_register_check);
+    counts.AddProperty64("bail_out_unknown_task",
+                         counters.bail_out_unknown_task);
+    counts.AddProperty64("bail_out_jump_to_exception_handler",
+                         counters.bail_out_jump_to_exception_handler);
+    counts.AddProperty64("bail_out_check_isolate",
+                         counters.bail_out_check_isolate);
+    counts.AddProperty64("single_frame_sample_deoptimizing",
+                         counters.single_frame_sample_deoptimizing);
+    counts.AddProperty64("single_frame_sample_register_check",
+                         counters.single_frame_sample_register_check);
     counts.AddProperty64(
         "single_frame_sample_get_and_validate_stack_bounds",
         counters.single_frame_sample_get_and_validate_stack_bounds);
-    counts.AddProperty64(
-        "stack_walker_native",
-        counters.stack_walker_native);
-    counts.AddProperty64(
-        "stack_walker_dart_exit",
-        counters.stack_walker_dart_exit);
-    counts.AddProperty64(
-        "stack_walker_dart",
-        counters.stack_walker_dart);
-    counts.AddProperty64(
-        "stack_walker_none",
-        counters.stack_walker_none);
+    counts.AddProperty64("stack_walker_native", counters.stack_walker_native);
+    counts.AddProperty64("stack_walker_dart_exit",
+                         counters.stack_walker_dart_exit);
+    counts.AddProperty64("stack_walker_dart", counters.stack_walker_dart);
+    counts.AddProperty64("stack_walker_none", counters.stack_walker_none);
   }
 }
 
@@ -2501,16 +2379,16 @@
     // The samples from many isolates may be merged into a single timeline,
     // so prefix frames id with the isolate.
     intptr_t isolate_id = reinterpret_cast<intptr_t>(isolate_);
-    const char* key = zone_->PrintToString("%" Pd "-%" Pd,
-                                           isolate_id, current->frame_id());
+    const char* key =
+        zone_->PrintToString("%" Pd "-%" Pd, isolate_id, current->frame_id());
     JSONObject frame(frames, key);
     frame.AddProperty("category", "Dart");
     ProfileFunction* func = GetFunction(current->table_index());
     frame.AddProperty("name", func->Name());
     if (parent != NULL) {
       ASSERT(parent->frame_id() != -1);
-      frame.AddPropertyF("parent", "%" Pd "-%" Pd,
-                         isolate_id, parent->frame_id());
+      frame.AddPropertyF("parent", "%" Pd "-%" Pd, isolate_id,
+                         parent->frame_id());
     }
   }
 
@@ -2536,8 +2414,7 @@
     JSONArray events(&obj, "traceEvents");
     intptr_t pid = OS::ProcessId();
     intptr_t isolate_id = reinterpret_cast<intptr_t>(isolate_);
-    for (intptr_t sample_index = 0;
-         sample_index < samples_->length();
+    for (intptr_t sample_index = 0; sample_index < samples_->length();
          sample_index++) {
       ProcessedSample* sample = samples_->At(sample_index);
       JSONObject event(&events);
@@ -2549,8 +2426,7 @@
 
       ProfileTrieNode* trie = sample->timeline_trie();
       ASSERT(trie->frame_id() != -1);
-      event.AddPropertyF("sf", "%" Pd "-%" Pd,
-                         isolate_id, trie->frame_id());
+      event.AddPropertyF("sf", "%" Pd "-%" Pd, isolate_id, trie->frame_id());
     }
   }
 }
@@ -2801,12 +2677,9 @@
       : SampleFilter(isolate,
                      thread_task_mask,
                      time_origin_micros,
-                     time_extent_micros) {
-  }
+                     time_extent_micros) {}
 
-  bool FilterSample(Sample* sample) {
-    return !sample->is_allocation_sample();
-  }
+  bool FilterSample(Sample* sample) { return !sample->is_allocation_sample(); }
 };
 
 
@@ -2817,10 +2690,8 @@
                                 int64_t time_extent_micros) {
   Thread* thread = Thread::Current();
   Isolate* isolate = thread->isolate();
-  NoAllocationSampleFilter filter(isolate,
-                                  Thread::kMutatorTask,
-                                  time_origin_micros,
-                                  time_extent_micros);
+  NoAllocationSampleFilter filter(isolate, Thread::kMutatorTask,
+                                  time_origin_micros, time_extent_micros);
   const bool as_timeline = false;
   PrintJSONImpl(thread, stream, tag_order, extra_tags, &filter, as_timeline);
 }
@@ -2858,11 +2729,8 @@
                                           int64_t time_extent_micros) {
   Thread* thread = Thread::Current();
   Isolate* isolate = thread->isolate();
-  ClassAllocationSampleFilter filter(isolate,
-                                     cls,
-                                     Thread::kMutatorTask,
-                                     time_origin_micros,
-                                     time_extent_micros);
+  ClassAllocationSampleFilter filter(isolate, cls, Thread::kMutatorTask,
+                                     time_origin_micros, time_extent_micros);
   const bool as_timeline = false;
   PrintJSONImpl(thread, stream, tag_order, kNoExtraTags, &filter, as_timeline);
 }
@@ -2876,11 +2744,8 @@
   Isolate* isolate = thread->isolate();
   const intptr_t thread_task_mask = Thread::kMutatorTask |
                                     Thread::kCompilerTask |
-                                    Thread::kSweeperTask |
-                                    Thread::kMarkerTask;
-  NoAllocationSampleFilter filter(isolate,
-                                  thread_task_mask,
-                                  time_origin_micros,
+                                    Thread::kSweeperTask | Thread::kMarkerTask;
+  NoAllocationSampleFilter filter(isolate, thread_task_mask, time_origin_micros,
                                   time_extent_micros);
   const bool as_timeline = true;
   PrintJSONImpl(thread, stream, tag_order, kNoExtraTags, &filter, as_timeline);
diff --git a/runtime/vm/profiler_service.h b/runtime/vm/profiler_service.h
index 0e0e6d3..7251432 100644
--- a/runtime/vm/profiler_service.h
+++ b/runtime/vm/profiler_service.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_PROFILER_SERVICE_H_
-#define VM_PROFILER_SERVICE_H_
+#ifndef RUNTIME_VM_PROFILER_SERVICE_H_
+#define RUNTIME_VM_PROFILER_SERVICE_H_
 
 #include "vm/allocation.h"
 #include "vm/code_observers.h"
@@ -54,10 +54,10 @@
 class ProfileFunction : public ZoneAllocated {
  public:
   enum Kind {
-    kDartFunction,    // Dart function.
-    kNativeFunction,  // Synthetic function for Native (C/C++).
-    kTagFunction,     // Synthetic function for a VM or User tag.
-    kStubFunction,    // Synthetic function for stub code.
+    kDartFunction,     // Dart function.
+    kNativeFunction,   // Synthetic function for Native (C/C++).
+    kTagFunction,      // Synthetic function for a VM or User tag.
+    kStubFunction,     // Synthetic function for stub code.
     kUnknownFunction,  // A singleton function for unknown objects.
   };
 
@@ -73,26 +73,18 @@
 
   const char* Name() const;
 
-  const Function* function() const {
-    return &function_;
-  }
+  const Function* function() const { return &function_; }
 
   bool is_visible() const;
 
-  intptr_t table_index() const {
-    return table_index_;
-  }
+  intptr_t table_index() const { return table_index_; }
 
-  Kind kind() const {
-    return kind_;
-  }
+  Kind kind() const { return kind_; }
 
   intptr_t exclusive_ticks() const { return exclusive_ticks_; }
   intptr_t inclusive_ticks() const { return inclusive_ticks_; }
 
-  void IncInclusiveTicks() {
-    inclusive_ticks_++;
-  }
+  void IncInclusiveTicks() { inclusive_ticks_++; }
 
   void Tick(bool exclusive,
             intptr_t inclusive_serial,
@@ -180,9 +172,7 @@
 
   void AdjustExtent(uword start, uword end);
 
-  bool Contains(uword pc) const {
-    return (pc >= start_) && (pc < end_);
-  }
+  bool Contains(uword pc) const { return (pc >= start_) && (pc < end_); }
 
   bool Overlaps(const ProfileCode* other) const;
 
@@ -195,22 +185,16 @@
   void set_exclusive_ticks(intptr_t exclusive_ticks) {
     exclusive_ticks_ = exclusive_ticks;
   }
-  void IncExclusiveTicks() {
-    exclusive_ticks_++;
-  }
+  void IncExclusiveTicks() { exclusive_ticks_++; }
 
   intptr_t inclusive_ticks() const { return inclusive_ticks_; }
   void set_inclusive_ticks(intptr_t inclusive_ticks) {
     inclusive_ticks_ = inclusive_ticks;
   }
-  void IncInclusiveTicks() {
-    inclusive_ticks_++;
-  }
+  void IncInclusiveTicks() { inclusive_ticks_++; }
 
   bool IsOptimizedDart() const;
-  RawCode* code() const {
-    return code_.raw();
-  }
+  RawCode* code() const { return code_.raw(); }
 
   const char* name() const { return name_; }
   void SetName(const char* name);
@@ -226,9 +210,7 @@
 
   ProfileFunction* SetFunctionAndName(ProfileFunctionTable* table);
 
-  ProfileFunction* function() const {
-    return function_;
-  }
+  ProfileFunction* function() const { return function_; }
 
   void PrintNativeCode(JSONObject* profile_code_obj);
   void PrintCollectedCode(JSONObject* profile_code_obj);
@@ -275,17 +257,11 @@
 
   intptr_t count() const { return count_; }
 
-  void Tick() {
-    count_++;
-  }
+  void Tick() { count_++; }
 
-  intptr_t NumChildren() const {
-    return children_.length();
-  }
+  intptr_t NumChildren() const { return children_.length(); }
 
-  ProfileTrieNode* At(intptr_t i) {
-    return children_.At(i);
-  }
+  ProfileTrieNode* At(intptr_t i) { return children_.At(i); }
 
   intptr_t IndexOf(ProfileTrieNode* node);
 
@@ -319,13 +295,7 @@
 // a zone must be created that lives longer than this object.
 class Profile : public ValueObject {
  public:
-  enum TagOrder {
-    kNoTags,
-    kUser,
-    kUserVM,
-    kVM,
-    kVMUser
-  };
+  enum TagOrder { kNoTags, kUser, kUserVM, kVM, kVMUser };
 
   enum TrieKind {
     kExclusiveCode,
@@ -339,22 +309,20 @@
     return (kind == kExclusiveCode) || (kind == kInclusiveCode);
   }
 
-  static bool IsFunctionTrie(TrieKind kind) {
-    return !IsCodeTrie(kind);
-  }
+  static bool IsFunctionTrie(TrieKind kind) { return !IsCodeTrie(kind); }
 
   explicit Profile(Isolate* isolate);
 
   // Build a filtered model using |filter| with the specified |tag_order|.
   void Build(Thread* thread,
-             SampleFilter* filter, TagOrder tag_order, intptr_t extra_tags = 0);
+             SampleFilter* filter,
+             TagOrder tag_order,
+             intptr_t extra_tags = 0);
 
   // After building:
   int64_t min_time() const { return min_time_; }
   int64_t max_time() const { return max_time_; }
-  int64_t GetTimeSpan() const {
-    return max_time() - min_time();
-  }
+  int64_t GetTimeSpan() const { return max_time() - min_time(); }
   intptr_t sample_count() const { return sample_count_; }
 
   intptr_t NumFunctions() const;
@@ -399,10 +367,7 @@
 class ProfileTrieWalker : public ValueObject {
  public:
   explicit ProfileTrieWalker(Profile* profile)
-      : profile_(profile),
-        parent_(NULL),
-        current_(NULL),
-        code_trie_(false) {
+      : profile_(profile), parent_(NULL), current_(NULL), code_trie_(false) {
     ASSERT(profile_ != NULL);
   }
 
@@ -472,4 +437,4 @@
 
 }  // namespace dart
 
-#endif  // VM_PROFILER_SERVICE_H_
+#endif  // RUNTIME_VM_PROFILER_SERVICE_H_
diff --git a/runtime/vm/profiler_test.cc b/runtime/vm/profiler_test.cc
index 8bb6232..a150c30 100644
--- a/runtime/vm/profiler_test.cc
+++ b/runtime/vm/profiler_test.cc
@@ -24,14 +24,11 @@
 // Some tests are written assuming native stack trace profiling is disabled.
 class DisableNativeProfileScope : public ValueObject {
  public:
-  DisableNativeProfileScope()
-      : FLAG_profile_vm_(FLAG_profile_vm) {
+  DisableNativeProfileScope() : FLAG_profile_vm_(FLAG_profile_vm) {
     FLAG_profile_vm = false;
   }
 
-  ~DisableNativeProfileScope() {
-    FLAG_profile_vm = FLAG_profile_vm_;
-  }
+  ~DisableNativeProfileScope() { FLAG_profile_vm = FLAG_profile_vm_; }
 
  private:
   const bool FLAG_profile_vm_;
@@ -62,9 +59,7 @@
     Profiler::SetSampleDepth(new_max_depth);
   }
 
-  ~MaxProfileDepthScope() {
-    Profiler::SetSampleDepth(FLAG_max_profile_depth_);
-  }
+  ~MaxProfileDepthScope() { Profiler::SetSampleDepth(FLAG_max_profile_depth_); }
 
  private:
   const intptr_t FLAG_max_profile_depth_;
@@ -161,9 +156,8 @@
 
 
 static RawClass* GetClass(const Library& lib, const char* name) {
-  const Class& cls = Class::Handle(
-      lib.LookupClassAllowPrivate(String::Handle(Symbols::New(Thread::Current(),
-                                                              name))));
+  const Class& cls = Class::Handle(lib.LookupClassAllowPrivate(
+      String::Handle(Symbols::New(Thread::Current(), name))));
   EXPECT(!cls.IsNull());  // No ambiguity error expected.
   return cls.raw();
 }
@@ -188,22 +182,17 @@
                      time_origin_micros,
                      time_extent_micros),
         cid_(cid),
-        enable_vm_ticks_(false) {
-  }
+        enable_vm_ticks_(false) {}
 
   bool FilterSample(Sample* sample) {
-    if (!enable_vm_ticks_ &&
-        (sample->vm_tag() == VMTag::kVMTagId)) {
+    if (!enable_vm_ticks_ && (sample->vm_tag() == VMTag::kVMTagId)) {
       // We don't want to see embedder ticks in the test.
       return false;
     }
-    return sample->is_allocation_sample() &&
-           (sample->allocation_cid() == cid_);
+    return sample->is_allocation_sample() && (sample->allocation_cid() == cid_);
   }
 
-  void set_enable_vm_ticks(bool enable) {
-    enable_vm_ticks_ = enable;
-  }
+  void set_enable_vm_ticks(bool enable) { enable_vm_ticks_ = enable; }
 
  private:
   intptr_t cid_;
@@ -250,9 +239,7 @@
     HANDLESCOPE(thread);
     Profile profile(isolate);
     // Filter for the class in the time range.
-    AllocationFilter filter(isolate,
-                            class_a.id(),
-                            before_allocations_micros,
+    AllocationFilter filter(isolate, class_a.id(), before_allocations_micros,
                             allocation_extent_micros);
     profile.Build(thread, &filter, Profile::kNoTags);
     // We should have 1 allocation sample.
@@ -265,6 +252,8 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT(walker.Down());
     EXPECT_STREQ("B.boo", walker.CurrentName());
     EXPECT(walker.Down());
     EXPECT_STREQ("main", walker.CurrentName());
@@ -278,6 +267,8 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("B.boo", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(!walker.Down());
 
@@ -287,6 +278,8 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT(walker.Down());
     EXPECT_STREQ("B.boo", walker.CurrentName());
     EXPECT(walker.Down());
     EXPECT_STREQ("main", walker.CurrentName());
@@ -300,6 +293,8 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("B.boo", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(!walker.Down());
   }
@@ -311,9 +306,7 @@
     StackZone zone(thread);
     HANDLESCOPE(thread);
     Profile profile(isolate);
-    AllocationFilter filter(isolate,
-                            class_a.id(),
-                            Dart_TimelineGetMicros(),
+    AllocationFilter filter(isolate, class_a.id(), Dart_TimelineGetMicros(),
                             16000);
     profile.Build(thread, &filter, Profile::kNoTags);
     // We should have no allocation samples because none occured within
@@ -387,6 +380,8 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT(walker.Down());
     EXPECT_STREQ("B.boo", walker.CurrentName());
     EXPECT(walker.Down());
     EXPECT_STREQ("main", walker.CurrentName());
@@ -400,6 +395,8 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("B.boo", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(!walker.Down());
 
@@ -409,6 +406,8 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT(walker.Down());
     EXPECT_STREQ("B.boo", walker.CurrentName());
     EXPECT(walker.Down());
     EXPECT_STREQ("main", walker.CurrentName());
@@ -422,6 +421,8 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("B.boo", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(!walker.Down());
   }
@@ -459,7 +460,7 @@
       "  }\n"
       "}\n"
       "main() {\n"
-      "  B.boo();\n"
+      "  return B.boo();\n"
       "}\n";
 
   Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
@@ -514,10 +515,12 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT_EQ(3, walker.CurrentExclusiveTicks());
+    EXPECT(walker.Down());
     EXPECT_STREQ("B.boo", walker.CurrentName());
     EXPECT_EQ(3, walker.CurrentNodeTickCount());
     EXPECT_EQ(3, walker.CurrentInclusiveTicks());
-    EXPECT_EQ(3, walker.CurrentExclusiveTicks());
     EXPECT(walker.Down());
     EXPECT_STREQ("main", walker.CurrentName());
     EXPECT_EQ(3, walker.CurrentNodeTickCount());
@@ -537,6 +540,8 @@
     EXPECT_STREQ("B.boo", walker.CurrentName());
     EXPECT_EQ(3, walker.CurrentNodeTickCount());
     EXPECT_EQ(3, walker.CurrentInclusiveTicks());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
     EXPECT_EQ(3, walker.CurrentExclusiveTicks());
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
@@ -558,7 +563,7 @@
       "  }\n"
       "}\n"
       "main() {\n"
-      "  B.boo();\n"
+      "  return B.boo();\n"
       "}\n";
 
   Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
@@ -613,10 +618,12 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT_EQ(3, walker.CurrentExclusiveTicks());
+    EXPECT(walker.Down());
     EXPECT_STREQ("B.boo", walker.CurrentName());
     EXPECT_EQ(3, walker.CurrentNodeTickCount());
     EXPECT_EQ(3, walker.CurrentInclusiveTicks());
-    EXPECT_EQ(3, walker.CurrentExclusiveTicks());
     EXPECT(walker.Down());
     EXPECT_STREQ("main", walker.CurrentName());
     EXPECT_EQ(3, walker.CurrentNodeTickCount());
@@ -636,6 +643,8 @@
     EXPECT_STREQ("B.boo", walker.CurrentName());
     EXPECT_EQ(3, walker.CurrentNodeTickCount());
     EXPECT_EQ(3, walker.CurrentInclusiveTicks());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
     EXPECT_EQ(3, walker.CurrentExclusiveTicks());
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
@@ -657,7 +666,9 @@
       Class::Handle(isolate->object_store()->double_class());
   EXPECT(!double_class.IsNull());
 
-  Dart_Handle args[2] = { Dart_NewDouble(1.0), Dart_NewDouble(2.0), };
+  Dart_Handle args[2] = {
+      Dart_NewDouble(1.0), Dart_NewDouble(2.0),
+  };
 
   Dart_Handle result = Dart_Invoke(lib, NewString("foo"), 2, &args[0]);
   EXPECT_VALID(result);
@@ -760,6 +771,8 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateArray", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] AllocateArray", walker.CurrentName());
+    EXPECT(walker.Down());
     EXPECT_STREQ("_List._List", walker.CurrentName());
     EXPECT(walker.Down());
     EXPECT_STREQ("List.List", walker.CurrentName());
@@ -810,6 +823,8 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateArray", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] AllocateArray", walker.CurrentName());
+    EXPECT(walker.Down());
     EXPECT_STREQ("_List._List", walker.CurrentName());
     EXPECT(walker.Down());
     EXPECT_STREQ("_GrowableList._GrowableList", walker.CurrentName());
@@ -836,8 +851,7 @@
   root_library ^= Api::UnwrapHandle(lib);
   Isolate* isolate = thread->isolate();
 
-  const Class& context_class =
-      Class::Handle(Object::context_class());
+  const Class& context_class = Class::Handle(Object::context_class());
   EXPECT(!context_class.IsNull());
 
   Dart_Handle result = Dart_Invoke(lib, NewString("foo"), 0, NULL);
@@ -871,6 +885,8 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateContext", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] AllocateContext", walker.CurrentName());
+    EXPECT(walker.Down());
     EXPECT_STREQ("foo", walker.CurrentName());
     EXPECT(!walker.Down());
   }
@@ -937,6 +953,8 @@
     EXPECT(walker.Down());
     EXPECT_SUBSTRING("DRT_AllocateObject", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate _Closure", walker.CurrentName());
+    EXPECT(walker.Down());
     EXPECT_SUBSTRING("foo", walker.CurrentName());
     EXPECT(!walker.Down());
   }
@@ -1059,7 +1077,9 @@
       Class::Handle(isolate->object_store()->one_byte_string_class());
   EXPECT(!one_byte_string_class.IsNull());
 
-  Dart_Handle args[2] = { NewString("a"), NewString("b"), };
+  Dart_Handle args[2] = {
+      NewString("a"), NewString("b"),
+  };
 
   Dart_Handle result = Dart_Invoke(lib, NewString("foo"), 2, &args[0]);
   EXPECT_VALID(result);
@@ -1092,8 +1112,10 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("String_concat", walker.CurrentName());
     EXPECT(walker.Down());
+#if 1
     EXPECT_STREQ("_StringBase.+", walker.CurrentName());
     EXPECT(walker.Down());
+#endif
     EXPECT_STREQ("foo", walker.CurrentName());
     EXPECT(!walker.Down());
   }
@@ -1142,7 +1164,9 @@
       Class::Handle(isolate->object_store()->one_byte_string_class());
   EXPECT(!one_byte_string_class.IsNull());
 
-  Dart_Handle args[2] = { NewString("a"), NewString("b"), };
+  Dart_Handle args[2] = {
+      NewString("a"), NewString("b"),
+  };
 
   Dart_Handle result = Dart_Invoke(lib, NewString("foo"), 2, &args[0]);
   EXPECT_VALID(result);
@@ -1296,11 +1320,13 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT_EQ(50000, walker.CurrentExclusiveTicks());
+    EXPECT(walker.Down());
     EXPECT_STREQ("B.boo", walker.CurrentName());
     EXPECT_EQ(1, walker.SiblingCount());
     EXPECT_EQ(50000, walker.CurrentNodeTickCount());
     EXPECT_EQ(50000, walker.CurrentInclusiveTicks());
-    EXPECT_EQ(50000, walker.CurrentExclusiveTicks());
     EXPECT(walker.Down());
     EXPECT_STREQ("mainA", walker.CurrentName());
     EXPECT_EQ(1, walker.SiblingCount());
@@ -1321,6 +1347,8 @@
     EXPECT_EQ(1, walker.SiblingCount());
     EXPECT_EQ(50000, walker.CurrentNodeTickCount());
     EXPECT_EQ(50000, walker.CurrentInclusiveTicks());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
     EXPECT_EQ(50000, walker.CurrentExclusiveTicks());
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
@@ -1332,11 +1360,13 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT_EQ(50000, walker.CurrentExclusiveTicks());
+    EXPECT(walker.Down());
     EXPECT_STREQ("B.choo", walker.CurrentName());
     EXPECT_EQ(1, walker.SiblingCount());
     EXPECT_EQ(50000, walker.CurrentNodeTickCount());
     EXPECT_EQ(50000, walker.CurrentInclusiveTicks());
-    EXPECT_EQ(50000, walker.CurrentExclusiveTicks());
     EXPECT(walker.Down());
     EXPECT_STREQ("B.foo", walker.CurrentName());
     EXPECT_EQ(1, walker.SiblingCount());
@@ -1383,6 +1413,8 @@
     EXPECT_EQ(1, walker.SiblingCount());
     EXPECT_EQ(50000, walker.CurrentNodeTickCount());
     EXPECT_EQ(50000, walker.CurrentInclusiveTicks());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
     EXPECT_EQ(50000, walker.CurrentExclusiveTicks());
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
@@ -1397,9 +1429,7 @@
     HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, class_a.id());
-    profile.Build(thread,
-                  &filter,
-                  Profile::kNoTags,
+    profile.Build(thread, &filter, Profile::kNoTags,
                   ProfilerService::kCodeTransitionTagsBit);
     // We should have 50,000 allocation samples.
     EXPECT_EQ(50000, profile.sample_count());
@@ -1409,6 +1439,10 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("[Unoptimized Code]", walker.CurrentName());
+    EXPECT(walker.Down());
     EXPECT_STREQ("B.boo", walker.CurrentName());
     EXPECT(walker.Down());
     EXPECT_STREQ("[Optimized Code]", walker.CurrentName());
@@ -1428,6 +1462,10 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("B.boo", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Unoptimized Code]", walker.CurrentName());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(!walker.Down());
 
@@ -1437,6 +1475,10 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("[Unoptimized Code]", walker.CurrentName());
+    EXPECT(walker.Down());
     EXPECT_STREQ("[Inline End]", walker.CurrentName());
     EXPECT(walker.Down());
     EXPECT_STREQ("B.choo", walker.CurrentName());
@@ -1458,8 +1500,6 @@
     // mainA -> B.boo -> B.foo -> B.choo.
     walker.Reset(Profile::kInclusiveFunction);
     EXPECT(walker.Down());
-    EXPECT_STREQ("[Unoptimized Code]", walker.CurrentName());
-    EXPECT(walker.Down());
     EXPECT_STREQ("mainA", walker.CurrentName());
     EXPECT(walker.Down());
     EXPECT_STREQ("[Optimized Code]", walker.CurrentName());
@@ -1474,6 +1514,10 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("[Inline End]", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Unoptimized Code]", walker.CurrentName());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(!walker.Down());
   }
@@ -1585,6 +1629,8 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT(walker.Down());
     EXPECT_STREQ("maybeAlloc", walker.CurrentName());
     EXPECT(walker.Down());
     EXPECT_STREQ("right", walker.CurrentName());
@@ -1592,10 +1638,12 @@
     EXPECT_STREQ("a", walker.CurrentName());
     EXPECT(walker.Down());
     EXPECT_STREQ("mainAlloc", walker.CurrentName());
+    EXPECT(walker.Down());  // Account for "[Native] [xxxxxxx, xxxxxxx)"
     EXPECT(!walker.Down());
 
     // Inline expansion should show us the complete call chain:
     walker.Reset(Profile::kInclusiveFunction);
+    EXPECT(walker.Down());  // Account for "[Native] [xxxxxxx, xxxxxxx)"
     EXPECT(walker.Down());
     EXPECT_STREQ("mainAlloc", walker.CurrentName());
     EXPECT(walker.Down());
@@ -1605,6 +1653,8 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("maybeAlloc", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(!walker.Down());
   }
@@ -1679,6 +1729,8 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT(walker.Down());
     EXPECT_STREQ("B.boo", walker.CurrentName());
     EXPECT(walker.Down());
     EXPECT_STREQ("orange", walker.CurrentName());
@@ -1780,10 +1832,12 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT_EQ(1, walker.CurrentExclusiveTicks());
+    EXPECT(walker.Down());
     EXPECT_STREQ("B.boo", walker.CurrentName());
     EXPECT_EQ(1, walker.CurrentNodeTickCount());
     EXPECT_EQ(1, walker.CurrentInclusiveTicks());
-    EXPECT_EQ(1, walker.CurrentExclusiveTicks());
     EXPECT_STREQ("A", walker.CurrentToken());
     EXPECT(walker.Down());
     EXPECT_STREQ("main", walker.CurrentName());
@@ -1872,10 +1926,12 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT_EQ(1, walker.CurrentExclusiveTicks());
+    EXPECT(walker.Down());
     EXPECT_STREQ("B.boo", walker.CurrentName());
     EXPECT_EQ(1, walker.CurrentNodeTickCount());
     EXPECT_EQ(1, walker.CurrentInclusiveTicks());
-    EXPECT_EQ(1, walker.CurrentExclusiveTicks());
     EXPECT_STREQ("A", walker.CurrentToken());
     EXPECT(walker.Down());
     EXPECT_STREQ("main", walker.CurrentName());
@@ -1957,10 +2013,12 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT_EQ(1, walker.CurrentExclusiveTicks());
+    EXPECT(walker.Down());
     EXPECT_STREQ("B.boo", walker.CurrentName());
     EXPECT_EQ(1, walker.CurrentNodeTickCount());
     EXPECT_EQ(1, walker.CurrentInclusiveTicks());
-    EXPECT_EQ(1, walker.CurrentExclusiveTicks());
     EXPECT_STREQ("A", walker.CurrentToken());
     EXPECT(walker.Down());
     EXPECT_STREQ("B.oats", walker.CurrentName());
@@ -2080,10 +2138,12 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT_EQ(1, walker.CurrentExclusiveTicks());
+    EXPECT(walker.Down());
     EXPECT_STREQ("B.boo", walker.CurrentName());
     EXPECT_EQ(1, walker.CurrentNodeTickCount());
     EXPECT_EQ(1, walker.CurrentInclusiveTicks());
-    EXPECT_EQ(1, walker.CurrentExclusiveTicks());
     EXPECT_STREQ("A", walker.CurrentToken());
     EXPECT(walker.Down());
     EXPECT_STREQ("B.oats", walker.CurrentName());
@@ -2186,10 +2246,12 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT_EQ(1, walker.CurrentExclusiveTicks());
+    EXPECT(walker.Down());
     EXPECT_STREQ("B.boo", walker.CurrentName());
     EXPECT_EQ(1, walker.CurrentNodeTickCount());
     EXPECT_EQ(1, walker.CurrentInclusiveTicks());
-    EXPECT_EQ(1, walker.CurrentExclusiveTicks());
     EXPECT_STREQ("A", walker.CurrentToken());
     EXPECT(walker.Down());
     EXPECT_STREQ("B.oats", walker.CurrentName());
@@ -2318,10 +2380,12 @@
     EXPECT(walker.Down());
     EXPECT_STREQ("DRT_AllocateObject", walker.CurrentName());
     EXPECT(walker.Down());
+    EXPECT_STREQ("[Stub] Allocate A", walker.CurrentName());
+    EXPECT_EQ(1, walker.CurrentExclusiveTicks());
+    EXPECT(walker.Down());
     EXPECT_STREQ("B.boo", walker.CurrentName());
     EXPECT_EQ(1, walker.CurrentNodeTickCount());
     EXPECT_EQ(1, walker.CurrentInclusiveTicks());
-    EXPECT_EQ(1, walker.CurrentExclusiveTicks());
     EXPECT_STREQ("A", walker.CurrentToken());
     EXPECT(walker.Down());
     EXPECT_STREQ("B.oats", walker.CurrentName());
@@ -2358,14 +2422,12 @@
 }
 
 
-static void InsertFakeSample(SampleBuffer* sample_buffer,
-                             uword* pc_offsets) {
+static void InsertFakeSample(SampleBuffer* sample_buffer, uword* pc_offsets) {
   ASSERT(sample_buffer != NULL);
   Isolate* isolate = Isolate::Current();
   Sample* sample = sample_buffer->ReserveSample();
   ASSERT(sample != NULL);
-  sample->Init(isolate,
-               OS::GetCurrentMonotonicMicros(),
+  sample->Init(isolate, OS::GetCurrentMonotonicMicros(),
                OSThread::Current()->trace_id());
   sample->set_thread_task(Thread::kMutatorTask);
 
@@ -2473,10 +2535,8 @@
   CodeSourceMap::Dump(main_code_source_map, main_code, main);
 
   // Look up some source token position's pc.
-  uword squarePositionPc =
-      FindPCForTokenPosition(do_work_code,
-                             do_work_code_source_map,
-                             squarePosition);
+  uword squarePositionPc = FindPCForTokenPosition(
+      do_work_code, do_work_code_source_map, squarePosition);
   EXPECT(squarePositionPc != 0);
 
   uword callPositionPc =
@@ -2484,16 +2544,12 @@
   EXPECT(callPositionPc != 0);
 
   // Look up some classifying token position's pc.
-  uword controlFlowPc =
-      FindPCForTokenPosition(do_work_code,
-                             do_work_code_source_map,
-                             TokenPosition::kControlFlow);
+  uword controlFlowPc = FindPCForTokenPosition(
+      do_work_code, do_work_code_source_map, TokenPosition::kControlFlow);
   EXPECT(controlFlowPc != 0);
 
-  uword tempMovePc =
-      FindPCForTokenPosition(main_code,
-                             main_code_source_map,
-                             TokenPosition::kTempMove);
+  uword tempMovePc = FindPCForTokenPosition(main_code, main_code_source_map,
+                                            TokenPosition::kTempMove);
   EXPECT(tempMovePc != 0);
 
   // Insert fake samples.
@@ -2501,34 +2557,28 @@
   // Sample 1:
   // squarePositionPc exclusive.
   // callPositionPc inclusive.
-  uword sample1[] = {
-    squarePositionPc,  // doWork.
-    callPositionPc,    // main.
-    0
-  };
+  uword sample1[] = {squarePositionPc,  // doWork.
+                     callPositionPc,    // main.
+                     0};
 
   // Sample 2:
   // squarePositionPc exclusive.
   uword sample2[] = {
-    squarePositionPc,  // doWork.
-    0,
+      squarePositionPc,  // doWork.
+      0,
   };
 
   // Sample 3:
   // controlFlowPc exclusive.
   // callPositionPc inclusive.
-  uword sample3[] = {
-    controlFlowPc,   // doWork.
-    callPositionPc,  // main.
-    0
-  };
+  uword sample3[] = {controlFlowPc,   // doWork.
+                     callPositionPc,  // main.
+                     0};
 
   // Sample 4:
   // tempMovePc exclusive.
-  uword sample4[] = {
-    tempMovePc,  // main.
-    0
-  };
+  uword sample4[] = {tempMovePc,  // main.
+                     0};
 
   InsertFakeSample(sample_buffer, &sample1[0]);
   InsertFakeSample(sample_buffer, &sample2[0]);
@@ -2538,9 +2588,7 @@
   // Generate source report for main.
   SourceReport sourceReport(SourceReport::kProfile);
   JSONStream js;
-  sourceReport.PrintJSON(&js,
-                         script,
-                         do_work.token_pos(),
+  sourceReport.PrintJSON(&js, script, do_work.token_pos(),
                          main.end_token_pos());
 
   // Verify positions in do_work.
diff --git a/runtime/vm/random.h b/runtime/vm/random.h
index f5614de..2af1fa7 100644
--- a/runtime/vm/random.h
+++ b/runtime/vm/random.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_RANDOM_H_
-#define VM_RANDOM_H_
+#ifndef RUNTIME_VM_RANDOM_H_
+#define RUNTIME_VM_RANDOM_H_
 
 #include "vm/globals.h"
 #include "vm/allocation.h"
@@ -20,7 +20,7 @@
   uint32_t NextUInt32();
   uint64_t NextUInt64() {
     return (static_cast<uint64_t>(NextUInt32()) << 32) |
-        static_cast<uint64_t>(NextUInt32());
+           static_cast<uint64_t>(NextUInt32());
   }
 
  private:
@@ -34,4 +34,4 @@
 
 }  // namespace dart
 
-#endif  // VM_RANDOM_H_
+#endif  // RUNTIME_VM_RANDOM_H_
diff --git a/runtime/vm/raw_object.cc b/runtime/vm/raw_object.cc
index d777f68..bfe850a 100644
--- a/runtime/vm/raw_object.cc
+++ b/runtime/vm/raw_object.cc
@@ -68,13 +68,12 @@
     case kInstructionsCid: {
       const RawInstructions* raw_instructions =
           reinterpret_cast<const RawInstructions*>(this);
-      intptr_t instructions_size = raw_instructions->ptr()->size_;
+      intptr_t instructions_size = Instructions::Size(raw_instructions);
       instance_size = Instructions::InstanceSize(instructions_size);
       break;
     }
     case kContextCid: {
-      const RawContext* raw_context =
-          reinterpret_cast<const RawContext*>(this);
+      const RawContext* raw_context = reinterpret_cast<const RawContext*>(this);
       intptr_t num_variables = raw_context->ptr()->num_variables_;
       instance_size = Context::InstanceSize(num_variables);
       break;
@@ -114,17 +113,16 @@
       instance_size = ObjectPool::InstanceSize(len);
       break;
     }
-#define SIZE_FROM_CLASS(clazz)                                                 \
-    case kTypedData##clazz##Cid:
-    CLASS_LIST_TYPED_DATA(SIZE_FROM_CLASS) {
-      const RawTypedData* raw_obj =
-          reinterpret_cast<const RawTypedData*>(this);
-      intptr_t cid = raw_obj->GetClassId();
-      intptr_t array_len = Smi::Value(raw_obj->ptr()->length_);
-      intptr_t lengthInBytes = array_len * TypedData::ElementSizeInBytes(cid);
-      instance_size = TypedData::InstanceSize(lengthInBytes);
-      break;
-    }
+#define SIZE_FROM_CLASS(clazz) case kTypedData##clazz##Cid:
+      CLASS_LIST_TYPED_DATA(SIZE_FROM_CLASS) {
+        const RawTypedData* raw_obj =
+            reinterpret_cast<const RawTypedData*>(this);
+        intptr_t cid = raw_obj->GetClassId();
+        intptr_t array_len = Smi::Value(raw_obj->ptr()->length_);
+        intptr_t lengthInBytes = array_len * TypedData::ElementSizeInBytes(cid);
+        instance_size = TypedData::InstanceSize(lengthInBytes);
+        break;
+      }
 #undef SIZE_FROM_CLASS
     case kTypeArgumentsCid: {
       const RawTypeArguments* raw_array =
@@ -187,13 +185,13 @@
       ClassTable* class_table = isolate->class_table();
       if (!class_table->IsValidIndex(class_id) ||
           !class_table->HasValidClassAt(class_id)) {
-        FATAL2("Invalid class id: %" Pd " from tags %" Px "\n",
-               class_id, ptr()->tags_);
+        FATAL2("Invalid class id: %" Pd " from tags %" Px "\n", class_id,
+               ptr()->tags_);
       }
 #endif  // DEBUG
       RawClass* raw_class = isolate->GetClassForHeapWalkAt(class_id);
-      instance_size =
-          raw_class->ptr()->instance_size_in_words_ << kWordSizeLog2;
+      instance_size = raw_class->ptr()->instance_size_in_words_
+                      << kWordSizeLog2;
     }
   }
   ASSERT(instance_size != 0);
@@ -233,23 +231,21 @@
   if (class_id < kNumPredefinedCids) {
     switch (class_id) {
 #define RAW_VISITPOINTERS(clazz)                                               \
-      case k##clazz##Cid: {                                                    \
-        Raw##clazz* raw_obj = reinterpret_cast<Raw##clazz*>(this);             \
-        size = Raw##clazz::Visit##clazz##Pointers(raw_obj, visitor);           \
-        break;                                                                 \
-      }
+  case k##clazz##Cid: {                                                        \
+    Raw##clazz* raw_obj = reinterpret_cast<Raw##clazz*>(this);                 \
+    size = Raw##clazz::Visit##clazz##Pointers(raw_obj, visitor);               \
+    break;                                                                     \
+  }
       CLASS_LIST_NO_OBJECT(RAW_VISITPOINTERS)
 #undef RAW_VISITPOINTERS
-#define RAW_VISITPOINTERS(clazz)                                               \
-      case kTypedData##clazz##Cid:
+#define RAW_VISITPOINTERS(clazz) case kTypedData##clazz##Cid:
       CLASS_LIST_TYPED_DATA(RAW_VISITPOINTERS) {
         RawTypedData* raw_obj = reinterpret_cast<RawTypedData*>(this);
         size = RawTypedData::VisitTypedDataPointers(raw_obj, visitor);
         break;
       }
 #undef RAW_VISITPOINTERS
-#define RAW_VISITPOINTERS(clazz)                                               \
-      case kExternalTypedData##clazz##Cid:
+#define RAW_VISITPOINTERS(clazz) case kExternalTypedData##clazz##Cid:
       CLASS_LIST_TYPED_DATA(RAW_VISITPOINTERS) {
         RawExternalTypedData* raw_obj =
             reinterpret_cast<RawExternalTypedData*>(this);
@@ -258,8 +254,7 @@
         break;
       }
 #undef RAW_VISITPOINTERS
-#define RAW_VISITPOINTERS(clazz)                                               \
-      case kTypedData##clazz##ViewCid:
+#define RAW_VISITPOINTERS(clazz) case kTypedData##clazz##ViewCid:
       CLASS_LIST_TYPED_DATA(RAW_VISITPOINTERS)
       case kByteDataViewCid:
       case kByteBufferCid: {
@@ -313,57 +308,63 @@
 
 
 intptr_t RawUnresolvedClass::VisitUnresolvedClassPointers(
-    RawUnresolvedClass* raw_obj, ObjectPointerVisitor* visitor) {
+    RawUnresolvedClass* raw_obj,
+    ObjectPointerVisitor* visitor) {
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
   return UnresolvedClass::InstanceSize();
 }
 
 
 intptr_t RawAbstractType::VisitAbstractTypePointers(
-    RawAbstractType* raw_obj, ObjectPointerVisitor* visitor) {
+    RawAbstractType* raw_obj,
+    ObjectPointerVisitor* visitor) {
   // RawAbstractType is an abstract class.
   UNREACHABLE();
   return 0;
 }
 
 
-intptr_t RawType::VisitTypePointers(
-    RawType* raw_obj, ObjectPointerVisitor* visitor) {
+intptr_t RawType::VisitTypePointers(RawType* raw_obj,
+                                    ObjectPointerVisitor* visitor) {
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
   return Type::InstanceSize();
 }
 
 
-intptr_t RawTypeRef::VisitTypeRefPointers(
-    RawTypeRef* raw_obj, ObjectPointerVisitor* visitor) {
+intptr_t RawTypeRef::VisitTypeRefPointers(RawTypeRef* raw_obj,
+                                          ObjectPointerVisitor* visitor) {
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
   return TypeRef::InstanceSize();
 }
 
 
 intptr_t RawTypeParameter::VisitTypeParameterPointers(
-    RawTypeParameter* raw_obj, ObjectPointerVisitor* visitor) {
+    RawTypeParameter* raw_obj,
+    ObjectPointerVisitor* visitor) {
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
   return TypeParameter::InstanceSize();
 }
 
 
 intptr_t RawBoundedType::VisitBoundedTypePointers(
-    RawBoundedType* raw_obj, ObjectPointerVisitor* visitor) {
+    RawBoundedType* raw_obj,
+    ObjectPointerVisitor* visitor) {
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
   return BoundedType::InstanceSize();
 }
 
 
 intptr_t RawMixinAppType::VisitMixinAppTypePointers(
-    RawMixinAppType* raw_obj, ObjectPointerVisitor* visitor) {
+    RawMixinAppType* raw_obj,
+    ObjectPointerVisitor* visitor) {
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
   return MixinAppType::InstanceSize();
 }
 
 
 intptr_t RawTypeArguments::VisitTypeArgumentsPointers(
-    RawTypeArguments* raw_obj, ObjectPointerVisitor* visitor) {
+    RawTypeArguments* raw_obj,
+    ObjectPointerVisitor* visitor) {
   intptr_t length = Smi::Value(raw_obj->ptr()->length_);
   visitor->VisitPointers(raw_obj->from(), raw_obj->to(length));
   return TypeArguments::InstanceSize(length);
@@ -377,22 +378,24 @@
 }
 
 
-intptr_t RawClosure::VisitClosurePointers(
-    RawClosure* raw_obj, ObjectPointerVisitor* visitor) {
+intptr_t RawClosure::VisitClosurePointers(RawClosure* raw_obj,
+                                          ObjectPointerVisitor* visitor) {
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
   return Closure::InstanceSize();
 }
 
 
 intptr_t RawClosureData::VisitClosureDataPointers(
-    RawClosureData* raw_obj, ObjectPointerVisitor* visitor) {
+    RawClosureData* raw_obj,
+    ObjectPointerVisitor* visitor) {
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
   return ClosureData::InstanceSize();
 }
 
 
 intptr_t RawRedirectionData::VisitRedirectionDataPointers(
-    RawRedirectionData* raw_obj, ObjectPointerVisitor* visitor) {
+    RawRedirectionData* raw_obj,
+    ObjectPointerVisitor* visitor) {
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
   return RedirectionData::InstanceSize();
 }
@@ -473,14 +476,16 @@
 
 
 intptr_t RawLiteralToken::VisitLiteralTokenPointers(
-    RawLiteralToken* raw_obj, ObjectPointerVisitor* visitor) {
+    RawLiteralToken* raw_obj,
+    ObjectPointerVisitor* visitor) {
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
   return LiteralToken::InstanceSize();
 }
 
 
 intptr_t RawTokenStream::VisitTokenStreamPointers(
-    RawTokenStream* raw_obj, ObjectPointerVisitor* visitor) {
+    RawTokenStream* raw_obj,
+    ObjectPointerVisitor* visitor) {
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
   return TokenStream::InstanceSize();
 }
@@ -501,14 +506,15 @@
 
 
 intptr_t RawLibraryPrefix::VisitLibraryPrefixPointers(
-    RawLibraryPrefix* raw_obj, ObjectPointerVisitor* visitor) {
+    RawLibraryPrefix* raw_obj,
+    ObjectPointerVisitor* visitor) {
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
   return LibraryPrefix::InstanceSize();
 }
 
 
-intptr_t RawNamespace::VisitNamespacePointers(
-    RawNamespace* raw_obj, ObjectPointerVisitor* visitor) {
+intptr_t RawNamespace::VisitNamespacePointers(RawNamespace* raw_obj,
+                                              ObjectPointerVisitor* visitor) {
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
   return Namespace::InstanceSize();
 }
@@ -536,7 +542,7 @@
   // find those pointers for tracing.
   if (Code::AliveBit::decode(obj->state_bits_)) {
     uword entry_point = reinterpret_cast<uword>(obj->instructions_->ptr()) +
-        Instructions::HeaderSize();
+                        Instructions::HeaderSize();
     for (intptr_t i = 0; i < length; i++) {
       int32_t offset = obj->data()[i];
       visitor->VisitPointer(
@@ -553,8 +559,8 @@
 }
 
 
-intptr_t RawObjectPool::VisitObjectPoolPointers(
-    RawObjectPool* raw_obj, ObjectPointerVisitor* visitor) {
+intptr_t RawObjectPool::VisitObjectPoolPointers(RawObjectPool* raw_obj,
+                                                ObjectPointerVisitor* visitor) {
   visitor->VisitPointer(
       reinterpret_cast<RawObject**>(&raw_obj->ptr()->info_array_));
   const intptr_t len = raw_obj->ptr()->length_;
@@ -572,29 +578,31 @@
 
 
 intptr_t RawInstructions::VisitInstructionsPointers(
-    RawInstructions* raw_obj, ObjectPointerVisitor* visitor) {
-  RawInstructions* obj = raw_obj->ptr();
-  return Instructions::InstanceSize(obj->size_);
+    RawInstructions* raw_obj,
+    ObjectPointerVisitor* visitor) {
+  return Instructions::InstanceSize(Instructions::Size(raw_obj));
 }
 
 
 bool RawInstructions::ContainsPC(RawInstructions* raw_instr, uword pc) {
   uword start_pc =
       reinterpret_cast<uword>(raw_instr->ptr()) + Instructions::HeaderSize();
-  uword end_pc = start_pc + raw_instr->ptr()->size_;
+  uword end_pc = start_pc + Instructions::Size(raw_instr);
   ASSERT(end_pc > start_pc);
   return (pc >= start_pc) && (pc < end_pc);
 }
 
 
 intptr_t RawPcDescriptors::VisitPcDescriptorsPointers(
-    RawPcDescriptors* raw_obj, ObjectPointerVisitor* visitor) {
+    RawPcDescriptors* raw_obj,
+    ObjectPointerVisitor* visitor) {
   return PcDescriptors::InstanceSize(raw_obj->ptr()->length_);
 }
 
 
 intptr_t RawCodeSourceMap::VisitCodeSourceMapPointers(
-    RawCodeSourceMap* raw_obj, ObjectPointerVisitor* visitor) {
+    RawCodeSourceMap* raw_obj,
+    ObjectPointerVisitor* visitor) {
   return CodeSourceMap::InstanceSize(raw_obj->ptr()->length_);
 }
 
@@ -606,7 +614,8 @@
 
 
 intptr_t RawLocalVarDescriptors::VisitLocalVarDescriptorsPointers(
-    RawLocalVarDescriptors* raw_obj, ObjectPointerVisitor* visitor) {
+    RawLocalVarDescriptors* raw_obj,
+    ObjectPointerVisitor* visitor) {
   intptr_t num_entries = raw_obj->ptr()->num_entries_;
   visitor->VisitPointers(raw_obj->from(), raw_obj->to(num_entries));
   return LocalVarDescriptors::InstanceSize(num_entries);
@@ -614,7 +623,8 @@
 
 
 intptr_t RawExceptionHandlers::VisitExceptionHandlersPointers(
-    RawExceptionHandlers* raw_obj, ObjectPointerVisitor* visitor) {
+    RawExceptionHandlers* raw_obj,
+    ObjectPointerVisitor* visitor) {
   RawExceptionHandlers* obj = raw_obj->ptr();
   intptr_t len = obj->num_entries_;
   visitor->VisitPointer(
@@ -632,7 +642,8 @@
 
 
 intptr_t RawContextScope::VisitContextScopePointers(
-    RawContextScope* raw_obj, ObjectPointerVisitor* visitor) {
+    RawContextScope* raw_obj,
+    ObjectPointerVisitor* visitor) {
   intptr_t num_variables = raw_obj->ptr()->num_variables_;
   visitor->VisitPointers(raw_obj->from(), raw_obj->to(num_variables));
   return ContextScope::InstanceSize(num_variables);
@@ -640,14 +651,16 @@
 
 
 intptr_t RawSingleTargetCache::VisitSingleTargetCachePointers(
-    RawSingleTargetCache* raw_obj, ObjectPointerVisitor* visitor) {
+    RawSingleTargetCache* raw_obj,
+    ObjectPointerVisitor* visitor) {
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
   return SingleTargetCache::InstanceSize();
 }
 
 
 intptr_t RawUnlinkedCall::VisitUnlinkedCallPointers(
-    RawUnlinkedCall* raw_obj, ObjectPointerVisitor* visitor) {
+    RawUnlinkedCall* raw_obj,
+    ObjectPointerVisitor* visitor) {
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
   return UnlinkedCall::InstanceSize();
 }
@@ -669,7 +682,8 @@
 
 
 intptr_t RawSubtypeTestCache::VisitSubtypeTestCachePointers(
-    RawSubtypeTestCache* raw_obj, ObjectPointerVisitor* visitor) {
+    RawSubtypeTestCache* raw_obj,
+    ObjectPointerVisitor* visitor) {
   // Make sure that we got here with the tagged pointer as this.
   RawSubtypeTestCache* obj = raw_obj->ptr();
   visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->cache_));
@@ -685,29 +699,32 @@
 }
 
 
-intptr_t RawApiError::VisitApiErrorPointers(
-    RawApiError* raw_obj, ObjectPointerVisitor* visitor) {
+intptr_t RawApiError::VisitApiErrorPointers(RawApiError* raw_obj,
+                                            ObjectPointerVisitor* visitor) {
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
   return ApiError::InstanceSize();
 }
 
 
 intptr_t RawLanguageError::VisitLanguageErrorPointers(
-    RawLanguageError* raw_obj, ObjectPointerVisitor* visitor) {
+    RawLanguageError* raw_obj,
+    ObjectPointerVisitor* visitor) {
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
   return LanguageError::InstanceSize();
 }
 
 
 intptr_t RawUnhandledException::VisitUnhandledExceptionPointers(
-    RawUnhandledException* raw_obj, ObjectPointerVisitor* visitor) {
+    RawUnhandledException* raw_obj,
+    ObjectPointerVisitor* visitor) {
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
   return UnhandledException::InstanceSize();
 }
 
 
 intptr_t RawUnwindError::VisitUnwindErrorPointers(
-    RawUnwindError* raw_obj, ObjectPointerVisitor* visitor) {
+    RawUnwindError* raw_obj,
+    ObjectPointerVisitor* visitor) {
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
   return UnwindError::InstanceSize();
 }
@@ -793,7 +810,8 @@
 
 
 intptr_t RawOneByteString::VisitOneByteStringPointers(
-    RawOneByteString* raw_obj, ObjectPointerVisitor* visitor) {
+    RawOneByteString* raw_obj,
+    ObjectPointerVisitor* visitor) {
   ASSERT(!raw_obj->ptr()->length_->IsHeapObject());
   ASSERT(!raw_obj->ptr()->hash_->IsHeapObject());
   intptr_t length = Smi::Value(raw_obj->ptr()->length_);
@@ -802,7 +820,8 @@
 
 
 intptr_t RawTwoByteString::VisitTwoByteStringPointers(
-    RawTwoByteString* raw_obj, ObjectPointerVisitor* visitor) {
+    RawTwoByteString* raw_obj,
+    ObjectPointerVisitor* visitor) {
   ASSERT(!raw_obj->ptr()->length_->IsHeapObject());
   ASSERT(!raw_obj->ptr()->hash_->IsHeapObject());
   intptr_t length = Smi::Value(raw_obj->ptr()->length_);
@@ -811,7 +830,8 @@
 
 
 intptr_t RawExternalOneByteString::VisitExternalOneByteStringPointers(
-    RawExternalOneByteString* raw_obj, ObjectPointerVisitor* visitor) {
+    RawExternalOneByteString* raw_obj,
+    ObjectPointerVisitor* visitor) {
   // Make sure that we got here with the tagged pointer as this.
   ASSERT(raw_obj->IsHeapObject());
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
@@ -820,7 +840,8 @@
 
 
 intptr_t RawExternalTwoByteString::VisitExternalTwoByteStringPointers(
-    RawExternalTwoByteString* raw_obj, ObjectPointerVisitor* visitor) {
+    RawExternalTwoByteString* raw_obj,
+    ObjectPointerVisitor* visitor) {
   // Make sure that we got here with the tagged pointer as this.
   ASSERT(raw_obj->IsHeapObject());
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
@@ -845,50 +866,50 @@
 
 
 intptr_t RawImmutableArray::VisitImmutableArrayPointers(
-    RawImmutableArray* raw_obj, ObjectPointerVisitor* visitor) {
+    RawImmutableArray* raw_obj,
+    ObjectPointerVisitor* visitor) {
   return RawArray::VisitArrayPointers(raw_obj, visitor);
 }
 
 
 intptr_t RawGrowableObjectArray::VisitGrowableObjectArrayPointers(
-    RawGrowableObjectArray* raw_obj, ObjectPointerVisitor* visitor) {
+    RawGrowableObjectArray* raw_obj,
+    ObjectPointerVisitor* visitor) {
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
   return GrowableObjectArray::InstanceSize();
 }
 
 
 intptr_t RawLinkedHashMap::VisitLinkedHashMapPointers(
-    RawLinkedHashMap* raw_obj, ObjectPointerVisitor* visitor) {
+    RawLinkedHashMap* raw_obj,
+    ObjectPointerVisitor* visitor) {
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
   return LinkedHashMap::InstanceSize();
 }
 
 
-intptr_t RawFloat32x4::VisitFloat32x4Pointers(
-    RawFloat32x4* raw_obj,
-    ObjectPointerVisitor* visitor) {
-    ASSERT(raw_obj->IsHeapObject());
-    return Float32x4::InstanceSize();
+intptr_t RawFloat32x4::VisitFloat32x4Pointers(RawFloat32x4* raw_obj,
+                                              ObjectPointerVisitor* visitor) {
+  ASSERT(raw_obj->IsHeapObject());
+  return Float32x4::InstanceSize();
 }
 
 
-intptr_t RawInt32x4::VisitInt32x4Pointers(
-    RawInt32x4* raw_obj,
-    ObjectPointerVisitor* visitor) {
-    ASSERT(raw_obj->IsHeapObject());
-    return Int32x4::InstanceSize();
+intptr_t RawInt32x4::VisitInt32x4Pointers(RawInt32x4* raw_obj,
+                                          ObjectPointerVisitor* visitor) {
+  ASSERT(raw_obj->IsHeapObject());
+  return Int32x4::InstanceSize();
 }
 
 
-intptr_t RawFloat64x2::VisitFloat64x2Pointers(
-    RawFloat64x2* raw_obj,
-    ObjectPointerVisitor* visitor) {
-    ASSERT(raw_obj->IsHeapObject());
-    return Float64x2::InstanceSize();
+intptr_t RawFloat64x2::VisitFloat64x2Pointers(RawFloat64x2* raw_obj,
+                                              ObjectPointerVisitor* visitor) {
+  ASSERT(raw_obj->IsHeapObject());
+  return Float64x2::InstanceSize();
 }
 
-intptr_t RawTypedData::VisitTypedDataPointers(
-    RawTypedData* raw_obj, ObjectPointerVisitor* visitor) {
+intptr_t RawTypedData::VisitTypedDataPointers(RawTypedData* raw_obj,
+                                              ObjectPointerVisitor* visitor) {
   // Make sure that we got here with the tagged pointer as this.
   ASSERT(raw_obj->IsHeapObject());
   intptr_t cid = raw_obj->GetClassId();
@@ -900,7 +921,8 @@
 
 
 intptr_t RawExternalTypedData::VisitExternalTypedDataPointers(
-    RawExternalTypedData* raw_obj, ObjectPointerVisitor* visitor) {
+    RawExternalTypedData* raw_obj,
+    ObjectPointerVisitor* visitor) {
   // Make sure that we got here with the tagged pointer as this.
   ASSERT(raw_obj->IsHeapObject());
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
@@ -916,7 +938,8 @@
 
 
 intptr_t RawReceivePort::VisitReceivePortPointers(
-    RawReceivePort* raw_obj, ObjectPointerVisitor* visitor) {
+    RawReceivePort* raw_obj,
+    ObjectPointerVisitor* visitor) {
   // Make sure that we got here with the tagged pointer as this.
   ASSERT(raw_obj->IsHeapObject());
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
@@ -951,7 +974,8 @@
 
 
 intptr_t RawWeakProperty::VisitWeakPropertyPointers(
-    RawWeakProperty* raw_obj, ObjectPointerVisitor* visitor) {
+    RawWeakProperty* raw_obj,
+    ObjectPointerVisitor* visitor) {
   // Make sure that we got here with the tagged pointer as this.
   ASSERT(raw_obj->IsHeapObject());
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
@@ -960,7 +984,8 @@
 
 
 intptr_t RawMirrorReference::VisitMirrorReferencePointers(
-    RawMirrorReference* raw_obj, ObjectPointerVisitor* visitor) {
+    RawMirrorReference* raw_obj,
+    ObjectPointerVisitor* visitor) {
   // Make sure that we got here with the tagged pointer as this.
   ASSERT(raw_obj->IsHeapObject());
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
@@ -968,8 +993,8 @@
 }
 
 
-intptr_t RawUserTag::VisitUserTagPointers(
-    RawUserTag* raw_obj, ObjectPointerVisitor* visitor) {
+intptr_t RawUserTag::VisitUserTagPointers(RawUserTag* raw_obj,
+                                          ObjectPointerVisitor* visitor) {
   // Make sure that we got here with the tagged pointer as this.
   ASSERT(raw_obj->IsHeapObject());
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index cef387b..253c304 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_RAW_OBJECT_H_
-#define VM_RAW_OBJECT_H_
+#ifndef RUNTIME_VM_RAW_OBJECT_H_
+#define RUNTIME_VM_RAW_OBJECT_H_
 
 #include "platform/assert.h"
 #include "vm/atomic.h"
@@ -45,52 +45,52 @@
   V(MegamorphicCache)                                                          \
   V(SubtypeTestCache)                                                          \
   V(Error)                                                                     \
-    V(ApiError)                                                                \
-    V(LanguageError)                                                           \
-    V(UnhandledException)                                                      \
-    V(UnwindError)                                                             \
+  V(ApiError)                                                                  \
+  V(LanguageError)                                                             \
+  V(UnhandledException)                                                        \
+  V(UnwindError)                                                               \
   V(Instance)                                                                  \
-    V(LibraryPrefix)                                                           \
-    V(AbstractType)                                                            \
-      V(Type)                                                                  \
-      V(TypeRef)                                                               \
-      V(TypeParameter)                                                         \
-      V(BoundedType)                                                           \
-      V(MixinAppType)                                                          \
-    V(Closure)                                                                 \
-    V(Number)                                                                  \
-      V(Integer)                                                               \
-        V(Smi)                                                                 \
-        V(Mint)                                                                \
-        V(Bigint)                                                              \
-      V(Double)                                                                \
-    V(Bool)                                                                    \
-    V(GrowableObjectArray)                                                     \
-    V(Float32x4)                                                               \
-    V(Int32x4)                                                                 \
-    V(Float64x2)                                                               \
-    V(TypedData)                                                               \
-    V(ExternalTypedData)                                                       \
-    V(Capability)                                                              \
-    V(ReceivePort)                                                             \
-    V(SendPort)                                                                \
-    V(Stacktrace)                                                              \
-    V(RegExp)                                                                  \
-    V(WeakProperty)                                                            \
-    V(MirrorReference)                                                         \
-    V(LinkedHashMap)                                                           \
-    V(UserTag)                                                                 \
+  V(LibraryPrefix)                                                             \
+  V(AbstractType)                                                              \
+  V(Type)                                                                      \
+  V(TypeRef)                                                                   \
+  V(TypeParameter)                                                             \
+  V(BoundedType)                                                               \
+  V(MixinAppType)                                                              \
+  V(Closure)                                                                   \
+  V(Number)                                                                    \
+  V(Integer)                                                                   \
+  V(Smi)                                                                       \
+  V(Mint)                                                                      \
+  V(Bigint)                                                                    \
+  V(Double)                                                                    \
+  V(Bool)                                                                      \
+  V(GrowableObjectArray)                                                       \
+  V(Float32x4)                                                                 \
+  V(Int32x4)                                                                   \
+  V(Float64x2)                                                                 \
+  V(TypedData)                                                                 \
+  V(ExternalTypedData)                                                         \
+  V(Capability)                                                                \
+  V(ReceivePort)                                                               \
+  V(SendPort)                                                                  \
+  V(Stacktrace)                                                                \
+  V(RegExp)                                                                    \
+  V(WeakProperty)                                                              \
+  V(MirrorReference)                                                           \
+  V(LinkedHashMap)                                                             \
+  V(UserTag)
 
 #define CLASS_LIST_ARRAYS(V)                                                   \
   V(Array)                                                                     \
-    V(ImmutableArray)                                                          \
+  V(ImmutableArray)
 
 #define CLASS_LIST_STRINGS(V)                                                  \
   V(String)                                                                    \
-    V(OneByteString)                                                           \
-    V(TwoByteString)                                                           \
-    V(ExternalOneByteString)                                                   \
-    V(ExternalTwoByteString)
+  V(OneByteString)                                                             \
+  V(TwoByteString)                                                             \
+  V(ExternalOneByteString)                                                     \
+  V(ExternalTwoByteString)
 
 #define CLASS_LIST_TYPED_DATA(V)                                               \
   V(Int8Array)                                                                 \
@@ -106,7 +106,7 @@
   V(Float64Array)                                                              \
   V(Float32x4Array)                                                            \
   V(Int32x4Array)                                                              \
-  V(Float64x2Array)                                                            \
+  V(Float64x2Array)
 
 #define DART_CLASS_LIST_TYPED_DATA(V)                                          \
   V(Int8)                                                                      \
@@ -141,8 +141,7 @@
 
 // Forward declarations.
 class Isolate;
-#define DEFINE_FORWARD_DECLARATION(clazz)                                      \
-  class Raw##clazz;
+#define DEFINE_FORWARD_DECLARATION(clazz) class Raw##clazz;
 CLASS_LIST(DEFINE_FORWARD_DECLARATION)
 #undef DEFINE_FORWARD_DECLARATION
 
@@ -151,6 +150,10 @@
   // Illegal class id.
   kIllegalCid = 0,
 
+  // A sentinel used by the vm service's heap snapshots to represent references
+  // from the stack.
+  kStackCid = 1,
+
   // The following entries describes classes for pseudo-objects in the heap
   // that should never be reachable from live objects. Free list elements
   // maintain the free list for old space, and forwarding corpses are used to
@@ -158,33 +161,29 @@
   kFreeListElement,
   kForwardingCorpse,
 
-  // List of Ids for predefined classes.
-#define DEFINE_OBJECT_KIND(clazz)                                              \
-  k##clazz##Cid,
-CLASS_LIST(DEFINE_OBJECT_KIND)
+// List of Ids for predefined classes.
+#define DEFINE_OBJECT_KIND(clazz) k##clazz##Cid,
+  CLASS_LIST(DEFINE_OBJECT_KIND)
 #undef DEFINE_OBJECT_KIND
 
-#define DEFINE_OBJECT_KIND(clazz)                                              \
-  kTypedData##clazz##Cid,
-CLASS_LIST_TYPED_DATA(DEFINE_OBJECT_KIND)
+#define DEFINE_OBJECT_KIND(clazz) kTypedData##clazz##Cid,
+      CLASS_LIST_TYPED_DATA(DEFINE_OBJECT_KIND)
 #undef DEFINE_OBJECT_KIND
 
-#define DEFINE_OBJECT_KIND(clazz)                                              \
-  kTypedData##clazz##ViewCid,
-CLASS_LIST_TYPED_DATA(DEFINE_OBJECT_KIND)
+#define DEFINE_OBJECT_KIND(clazz) kTypedData##clazz##ViewCid,
+          CLASS_LIST_TYPED_DATA(DEFINE_OBJECT_KIND)
 #undef DEFINE_OBJECT_KIND
 
-  kByteDataViewCid,
+              kByteDataViewCid,
 
-#define DEFINE_OBJECT_KIND(clazz)                                              \
-  kExternalTypedData##clazz##Cid,
-CLASS_LIST_TYPED_DATA(DEFINE_OBJECT_KIND)
+#define DEFINE_OBJECT_KIND(clazz) kExternalTypedData##clazz##Cid,
+  CLASS_LIST_TYPED_DATA(DEFINE_OBJECT_KIND)
 #undef DEFINE_OBJECT_KIND
 
-  kByteBufferCid,
+      kByteBufferCid,
 
   // The following entries do not describe a predefined class, but instead
-  // are class indexes for pre-allocated instance (Null, dynamic and Void).
+  // are class indexes for pre-allocated instances (Null, dynamic and Void).
   kNullCid,
   kDynamicCid,
   kVoidCid,
@@ -212,25 +211,23 @@
 
 enum TypedDataElementType {
 #define V(name) k##name##Element,
-CLASS_LIST_TYPED_DATA(V)
+  CLASS_LIST_TYPED_DATA(V)
 #undef V
 };
 
 #define SNAPSHOT_WRITER_SUPPORT()                                              \
-  void WriteTo(                                                                \
-      SnapshotWriter* writer, intptr_t object_id,                              \
-      Snapshot::Kind kind, bool as_reference);                                 \
-  friend class SnapshotWriter;                                                 \
+  void WriteTo(SnapshotWriter* writer, intptr_t object_id,                     \
+               Snapshot::Kind kind, bool as_reference);                        \
+  friend class SnapshotWriter;
 
 #define VISITOR_SUPPORT(object)                                                \
   static intptr_t Visit##object##Pointers(Raw##object* raw_obj,                \
                                           ObjectPointerVisitor* visitor);
 
-#define HEAP_PROFILER_SUPPORT()                                                \
-  friend class HeapProfiler;                                                   \
+#define HEAP_PROFILER_SUPPORT() friend class HeapProfiler;
 
 #define RAW_OBJECT_IMPLEMENTATION(object)                                      \
- private:  /* NOLINT */                                                        \
+ private: /* NOLINT */                                                         \
   VISITOR_SUPPORT(object)                                                      \
   friend class object;                                                         \
   friend class RawObject;                                                      \
@@ -242,17 +239,17 @@
 
 // TODO(koda): Make ptr() return const*, like Object::raw_ptr().
 #define RAW_HEAP_OBJECT_IMPLEMENTATION(object)                                 \
-  private:                                                                     \
-    RAW_OBJECT_IMPLEMENTATION(object);                                         \
-    Raw##object* ptr() const {                                                 \
-      ASSERT(IsHeapObject());                                                  \
-      return reinterpret_cast<Raw##object*>(                                   \
-          reinterpret_cast<uword>(this) - kHeapObjectTag);                     \
-    }                                                                          \
-    SNAPSHOT_WRITER_SUPPORT()                                                  \
-    HEAP_PROFILER_SUPPORT()                                                    \
-    friend class object##SerializationCluster;                                 \
-    friend class object##DeserializationCluster;                               \
+ private:                                                                      \
+  RAW_OBJECT_IMPLEMENTATION(object);                                           \
+  Raw##object* ptr() const {                                                   \
+    ASSERT(IsHeapObject());                                                    \
+    return reinterpret_cast<Raw##object*>(reinterpret_cast<uword>(this) -      \
+                                          kHeapObjectTag);                     \
+  }                                                                            \
+  SNAPSHOT_WRITER_SUPPORT()                                                    \
+  HEAP_PROFILER_SUPPORT()                                                      \
+  friend class object##SerializationCluster;                                   \
+  friend class object##DeserializationCluster;
 
 // RawObject is the base class of all raw objects; even though it carries the
 // tags_ field not all raw objects are allocated in the heap and thus cannot
@@ -289,8 +286,8 @@
   // Encodes the object size in the tag in units of object alignment.
   class SizeTag {
    public:
-    static const intptr_t kMaxSizeTag =
-        ((1 << RawObject::kSizeTagSize) - 1) << kObjectAlignmentLog2;
+    static const intptr_t kMaxSizeTag = ((1 << RawObject::kSizeTagSize) - 1)
+                                        << kObjectAlignmentLog2;
 
     static uword encode(intptr_t size) {
       return SizeBits::encode(SizeToTagValue(size));
@@ -306,25 +303,25 @@
 
    private:
     // The actual unscaled bit field used within the tag field.
-    class SizeBits :
-        public BitField<uword, intptr_t, kSizeTagPos, kSizeTagSize> {};
+    class SizeBits
+        : public BitField<uword, intptr_t, kSizeTagPos, kSizeTagSize> {};
 
     static intptr_t SizeToTagValue(intptr_t size) {
       ASSERT(Utils::IsAligned(size, kObjectAlignment));
-      return  (size > kMaxSizeTag) ? 0 : (size >> kObjectAlignmentLog2);
+      return (size > kMaxSizeTag) ? 0 : (size >> kObjectAlignmentLog2);
     }
     static intptr_t TagValueToSize(intptr_t value) {
       return value << kObjectAlignmentLog2;
     }
   };
 
-  class ClassIdTag :
-      public BitField<uword, intptr_t, kClassIdTagPos, kClassIdTagSize> {};
+  class ClassIdTag
+      : public BitField<uword, intptr_t, kClassIdTagPos, kClassIdTagSize> {};
 
   bool IsWellFormed() const {
     uword value = reinterpret_cast<uword>(this);
     return (value & kSmiTagMask) == 0 ||
-        Utils::IsAligned(value - kHeapObjectTag, kWordSize);
+           Utils::IsAligned(value - kHeapObjectTag, kWordSize);
   }
   bool IsHeapObject() const {
     ASSERT(IsWellFormed());
@@ -356,9 +353,7 @@
   }
 
   // Support for GC marking bit.
-  bool IsMarked() const {
-    return MarkBit::decode(ptr()->tags_);
-  }
+  bool IsMarked() const { return MarkBit::decode(ptr()->tags_); }
   void SetMarkBit() {
     ASSERT(!IsMarked());
     UpdateTagBit<MarkBit>(true);
@@ -374,31 +369,17 @@
   }
   // Returns false if the bit was already set.
   // TODO(koda): Add "must use result" annotation here, after we add support.
-  bool TryAcquireMarkBit() {
-    return TryAcquireTagBit<MarkBit>();
-  }
+  bool TryAcquireMarkBit() { return TryAcquireTagBit<MarkBit>(); }
 
   // Support for object tags.
-  bool IsCanonical() const {
-    return CanonicalObjectTag::decode(ptr()->tags_);
-  }
-  void SetCanonical() {
-    UpdateTagBit<CanonicalObjectTag>(true);
-  }
-  void ClearCanonical() {
-    UpdateTagBit<CanonicalObjectTag>(false);
-  }
-  bool IsVMHeapObject() const {
-    return VMHeapObjectTag::decode(ptr()->tags_);
-  }
-  void SetVMHeapObject() {
-    UpdateTagBit<VMHeapObjectTag>(true);
-  }
+  bool IsCanonical() const { return CanonicalObjectTag::decode(ptr()->tags_); }
+  void SetCanonical() { UpdateTagBit<CanonicalObjectTag>(true); }
+  void ClearCanonical() { UpdateTagBit<CanonicalObjectTag>(false); }
+  bool IsVMHeapObject() const { return VMHeapObjectTag::decode(ptr()->tags_); }
+  void SetVMHeapObject() { UpdateTagBit<VMHeapObjectTag>(true); }
 
   // Support for GC remembered bit.
-  bool IsRemembered() const {
-    return RememberedBit::decode(ptr()->tags_);
-  }
+  bool IsRemembered() const { return RememberedBit::decode(ptr()->tags_); }
   void SetRememberedBit() {
     ASSERT(!IsRemembered());
     UpdateTagBit<RememberedBit>(true);
@@ -408,22 +389,18 @@
     uword tags = ptr()->tags_;
     ptr()->tags_ = RememberedBit::update(true, tags);
   }
-  void ClearRememberedBit() {
-    UpdateTagBit<RememberedBit>(false);
-  }
+  void ClearRememberedBit() { UpdateTagBit<RememberedBit>(false); }
   void ClearRememberedBitUnsynchronized() {
     uword tags = ptr()->tags_;
     ptr()->tags_ = RememberedBit::update(false, tags);
   }
   // Returns false if the bit was already set.
   // TODO(koda): Add "must use result" annotation here, after we add support.
-  bool TryAcquireRememberedBit() {
-    return TryAcquireTagBit<RememberedBit>();
-  }
+  bool TryAcquireRememberedBit() { return TryAcquireTagBit<RememberedBit>(); }
 
 #define DEFINE_IS_CID(clazz)                                                   \
   bool Is##clazz() const { return ((GetClassId() == k##clazz##Cid)); }
-CLASS_LIST(DEFINE_IS_CID)
+  CLASS_LIST(DEFINE_IS_CID)
 #undef DEFINE_IS_CID
 
 #define DEFINE_IS_CID(clazz)                                                   \
@@ -436,12 +413,10 @@
   bool IsExternalTypedData##clazz() const {                                    \
     return ((GetClassId() == kExternalTypedData##clazz##Cid));                 \
   }
-CLASS_LIST_TYPED_DATA(DEFINE_IS_CID)
+  CLASS_LIST_TYPED_DATA(DEFINE_IS_CID)
 #undef DEFINE_IS_CID
 
-  bool IsStringInstance() const {
-    return IsStringClassId(GetClassId());
-  }
+  bool IsStringInstance() const { return IsStringClassId(GetClassId()); }
   bool IsDartInstance() const {
     return (!IsHeapObject() || (GetClassId() >= kInstanceCid));
   }
@@ -524,14 +499,14 @@
 
   class VMHeapObjectTag : public BitField<uword, bool, kVMHeapObjectBit, 1> {};
 
-  class ReservedBits : public
-      BitField<uword, intptr_t, kReservedTagPos, kReservedTagSize> {};
+  class ReservedBits
+      : public BitField<uword, intptr_t, kReservedTagPos, kReservedTagSize> {};
 
   // TODO(koda): After handling tags_, return const*, like Object::raw_ptr().
   RawObject* ptr() const {
     ASSERT(IsHeapObject());
-    return reinterpret_cast<RawObject*>(
-        reinterpret_cast<uword>(this) - kHeapObjectTag);
+    return reinterpret_cast<RawObject*>(reinterpret_cast<uword>(this) -
+                                        kHeapObjectTag);
   }
 
   intptr_t SizeFromClass() const;
@@ -546,19 +521,19 @@
     ptr()->tags_ = ClassIdTag::update(new_cid, tags);
   }
 
-  template<class TagBitField>
+  template <class TagBitField>
   void UpdateTagBit(bool value) {
     uword tags = ptr()->tags_;
     uword old_tags;
     do {
       old_tags = tags;
       uword new_tags = TagBitField::update(value, old_tags);
-      tags = AtomicOperations::CompareAndSwapWord(
-          &ptr()->tags_, old_tags, new_tags);
+      tags = AtomicOperations::CompareAndSwapWord(&ptr()->tags_, old_tags,
+                                                  new_tags);
     } while (tags != old_tags);
   }
 
-  template<class TagBitField>
+  template <class TagBitField>
   bool TryAcquireTagBit() {
     uword tags = ptr()->tags_;
     uword old_tags;
@@ -566,8 +541,8 @@
       old_tags = tags;
       if (TagBitField::decode(tags)) return false;
       uword new_tags = TagBitField::update(true, old_tags);
-      tags = AtomicOperations::CompareAndSwapWord(
-          &ptr()->tags_, old_tags, new_tags);
+      tags = AtomicOperations::CompareAndSwapWord(&ptr()->tags_, old_tags,
+                                                  new_tags);
     } while (tags != old_tags);
     return true;
   }
@@ -576,13 +551,12 @@
   // methods below or their counterparts in Object, to ensure that the
   // write barrier is correctly applied.
 
-  template<typename type>
+  template <typename type>
   void StorePointer(type const* addr, type value) {
     *const_cast<type*>(addr) = value;
     // Filter stores based on source and target.
     if (!value->IsHeapObject()) return;
-    if (value->IsNewObject() && this->IsOldObject() &&
-        !this->IsRemembered()) {
+    if (value->IsNewObject() && this->IsOldObject() && !this->IsRemembered()) {
       this->SetRememberedBit();
       Thread::Current()->StoreBufferAddObject(this);
     }
@@ -598,7 +572,7 @@
 
   friend class Api;
   friend class ApiMessageReader;  // GetClassId
-  friend class Serializer;  // GetClassId
+  friend class Serializer;        // GetClassId
   friend class Array;
   friend class Become;  // GetClassId
   friend class Bigint;
@@ -617,7 +591,8 @@
   friend class Heap;
   friend class HeapMapAsJSONVisitor;
   friend class ClassStatsVisitor;
-  template<bool> friend class MarkingVisitorBase;
+  template <bool>
+  friend class MarkingVisitorBase;
   friend class Mint;
   friend class Object;
   friend class OneByteString;  // StoreSmi
@@ -629,10 +604,10 @@
   friend class Scavenger;
   friend class ScavengerVisitor;
   friend class SizeExcludingClassVisitor;  // GetClassId
-  friend class InstanceAccumulator;  // GetClassId
-  friend class RetainingPathVisitor;  // GetClassId
-  friend class SkippedCodeFunctions;  // StorePointer
-  friend class InstructionsReader;  // tags_ check
+  friend class InstanceAccumulator;        // GetClassId
+  friend class RetainingPathVisitor;       // GetClassId
+  friend class SkippedCodeFunctions;       // StorePointer
+  friend class InstructionsReader;         // tags_ check
   friend class AssemblyInstructionsWriter;
   friend class BlobInstructionsWriter;
   friend class SnapshotReader;
@@ -642,11 +617,12 @@
   friend class Type;  // GetClassId
   friend class TypedData;
   friend class TypedDataView;
-  friend class WeakProperty;  // StorePointer
-  friend class Instance;  // StorePointer
-  friend class StackFrame;  // GetCodeObject assertion.
+  friend class WeakProperty;            // StorePointer
+  friend class Instance;                // StorePointer
+  friend class StackFrame;              // GetCodeObject assertion.
   friend class CodeLookupTableBuilder;  // profiler
-  friend class NativeEntry;  // GetClassId
+  friend class NativeEntry;             // GetClassId
+  friend class WritePointerVisitor;     // GetClassId
   friend class Simulator;
   friend class SimulatorHelpers;
   friend class ObjectLocator;
@@ -661,9 +637,9 @@
 class RawClass : public RawObject {
  public:
   enum ClassFinalizedState {
-    kAllocated = 0,  // Initial state.
-    kPreFinalized,  // VM classes: size precomputed, but no checks done.
-    kFinalized,  // Class parsed, finalized and ready for use.
+    kAllocated = 0,         // Initial state.
+    kPreFinalized,          // VM classes: size precomputed, but no checks done.
+    kFinalized,             // Class parsed, finalized and ready for use.
     kRefinalizeAfterPatch,  // Class needs to be refinalized (patched).
   };
 
@@ -684,12 +660,12 @@
   RawAbstractType* super_type_;
   RawType* mixin_;  // Generic mixin type, e.g. M<T>, not M<int>.
   RawFunction* signature_function_;  // Associated function for typedef class.
-  RawArray* constants_;  // Canonicalized const instances of this class.
+  RawArray* constants_;      // Canonicalized const instances of this class.
   RawType* canonical_type_;  // Canonical type for this class.
   RawArray* invocation_dispatcher_cache_;  // Cache for dispatcher functions.
   RawCode* allocation_stub_;  // Stub code for allocation of instances.
   RawGrowableObjectArray* direct_subclasses_;  // Array of Class.
-  RawArray* dependent_code_;  // CHA optimized codes.
+  RawArray* dependent_code_;                   // CHA optimized codes.
   RawObject** to() {
     return reinterpret_cast<RawObject**>(&ptr()->dependent_code_);
   }
@@ -714,10 +690,10 @@
   int32_t instance_size_in_words_;  // Size if fixed len or 0 if variable len.
   int32_t type_arguments_field_offset_in_words_;  // Offset of type args fld.
   int32_t next_field_offset_in_words_;  // Offset of the next instance field.
-  classid_t id_;  // Class Id, also index in the class table.
+  classid_t id_;                // Class Id, also index in the class table.
   int16_t num_type_arguments_;  // Number of type arguments in flattened vector.
   int16_t num_own_type_arguments_;  // Number of non-overlapping type arguments.
-  uint16_t num_native_fields_;  // Number of native fields in class.
+  uint16_t num_native_fields_;      // Number of native fields in class.
   uint16_t state_bits_;
 
   friend class Instance;
@@ -735,13 +711,12 @@
   RAW_HEAP_OBJECT_IMPLEMENTATION(UnresolvedClass);
 
   RawObject** from() {
-    return reinterpret_cast<RawObject**>(&ptr()->library_prefix_);
+    return reinterpret_cast<RawObject**>(&ptr()->library_or_library_prefix_);
   }
-  RawLibraryPrefix* library_prefix_;  // Library prefix qualifier for the ident.
-  RawString* ident_;  // Name of the unresolved identifier.
-  RawObject** to() {
-    return reinterpret_cast<RawObject**>(&ptr()->ident_);
-  }
+  RawObject* library_or_library_prefix_;  // Library or library prefix qualifier
+                                          // for the ident.
+  RawString* ident_;                      // Name of the unresolved identifier.
+  RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->ident_); }
   TokenPosition token_pos_;
 };
 
@@ -787,9 +762,7 @@
   RawClass* patched_class_;
   RawClass* origin_class_;
   RawScript* script_;
-  RawObject** to() {
-    return reinterpret_cast<RawObject**>(&ptr()->script_);
-  }
+  RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->script_); }
 
   friend class Function;
 };
@@ -804,23 +777,23 @@
     kGetterFunction,     // represents getter functions e.g: get foo() { .. }.
     kSetterFunction,     // represents setter functions e.g: set foo(..) { .. }.
     kConstructor,
-    kImplicitGetter,     // represents an implicit getter for fields.
-    kImplicitSetter,     // represents an implicit setter for fields.
+    kImplicitGetter,             // represents an implicit getter for fields.
+    kImplicitSetter,             // represents an implicit setter for fields.
     kImplicitStaticFinalGetter,  // represents an implicit getter for static
                                  // final fields (incl. static const fields).
     kMethodExtractor,  // converts method into implicit closure on the receiver.
     kNoSuchMethodDispatcher,  // invokes noSuchMethod.
-    kInvokeFieldDispatcher,  // invokes a field as a closure.
-    kIrregexpFunction,   // represents a generated irregexp matcher function.
+    kInvokeFieldDispatcher,   // invokes a field as a closure.
+    kIrregexpFunction,  // represents a generated irregexp matcher function.
   };
 
   enum AsyncModifier {
     kNoModifier = 0x0,
-    kAsyncBit   = 0x1,
-    kGeneratorBit =  0x2,
-    kAsync      = kAsyncBit,
-    kSyncGen    = kGeneratorBit,
-    kAsyncGen   = kAsyncBit | kGeneratorBit,
+    kAsyncBit = 0x1,
+    kGeneratorBit = 0x2,
+    kAsync = kAsyncBit,
+    kSyncGen = kGeneratorBit,
+    kAsyncGen = kAsyncBit | kGeneratorBit,
   };
 
  private:
@@ -866,9 +839,10 @@
   NOT_IN_PRECOMPILED(TokenPosition end_token_pos_);
   NOT_IN_PRECOMPILED(int32_t usage_counter_);  // Accessed from generated code
                                                // (JIT only).
-  uint32_t kind_tag_;  // See Function::KindTagBits.
+  uint32_t kind_tag_;                          // See Function::KindTagBits.
   int16_t num_fixed_parameters_;
   int16_t num_optional_parameters_;  // > 0: positional; < 0: named.
+  NOT_IN_PRECOMPILED(void* kernel_function_);
   NOT_IN_PRECOMPILED(uint16_t optimized_instruction_count_);
   NOT_IN_PRECOMPILED(uint16_t optimized_call_site_count_);
   NOT_IN_PRECOMPILED(int8_t deoptimization_counter_);
@@ -887,9 +861,7 @@
   RawFunction* parent_function_;  // Enclosing function of this local function.
   RawType* signature_type_;
   RawInstance* closure_;  // Closure object for static implicit closures.
-  RawObject** to() {
-    return reinterpret_cast<RawObject**>(&ptr()->closure_);
-  }
+  RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->closure_); }
 
   friend class Function;
 };
@@ -899,15 +871,11 @@
  private:
   RAW_HEAP_OBJECT_IMPLEMENTATION(RedirectionData);
 
-  RawObject** from() {
-    return reinterpret_cast<RawObject**>(&ptr()->type_);
-  }
+  RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->type_); }
   RawType* type_;
   RawString* identifier_;
   RawFunction* target_;
-  RawObject** to() {
-    return reinterpret_cast<RawObject**>(&ptr()->target_);
-  }
+  RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->target_); }
 };
 
 
@@ -921,7 +889,7 @@
   RawAbstractType* type_;
   union {
     RawInstance* static_value_;  // Value for static fields.
-    RawSmi* offset_;  // Offset in words for instance fields.
+    RawSmi* offset_;             // Offset in words for instance fields.
   } value_;
   union {
     // When precompiling we need to save the static initializer function here
@@ -941,8 +909,9 @@
     switch (kind) {
       case Snapshot::kCore:
       case Snapshot::kScript:
-      case Snapshot::kAppWithJIT:
         return reinterpret_cast<RawObject**>(&ptr()->guarded_list_length_);
+      case Snapshot::kAppWithJIT:
+        return reinterpret_cast<RawObject**>(&ptr()->dependent_code_);
       case Snapshot::kAppNoJIT:
         return reinterpret_cast<RawObject**>(&ptr()->initializer_);
       case Snapshot::kMessage:
@@ -964,6 +933,7 @@
   int8_t guarded_list_length_in_object_offset_;
 
   uint8_t kind_bits_;  // static, final, const, has initializer....
+  NOT_IN_PRECOMPILED(void* kernel_field_);
 
   friend class CidRewriteVisitor;
 };
@@ -972,14 +942,10 @@
 class RawLiteralToken : public RawObject {
   RAW_HEAP_OBJECT_IMPLEMENTATION(LiteralToken);
 
-  RawObject** from() {
-    return reinterpret_cast<RawObject**>(&ptr()->literal_);
-  }
+  RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->literal_); }
   RawString* literal_;  // Literal characters as they appear in source text.
-  RawObject* value_;  // The actual object corresponding to the token.
-  RawObject** to() {
-    return reinterpret_cast<RawObject**>(&ptr()->value_);
-  }
+  RawObject* value_;    // The actual object corresponding to the token.
+  RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->value_); }
   Token::Kind kind_;  // The literal kind (string, integer, double).
 
   friend class SnapshotReader;
@@ -995,9 +961,7 @@
   RawString* private_key_;  // Key used for private identifiers.
   RawGrowableObjectArray* token_objects_;
   RawExternalTypedData* stream_;
-  RawObject** to() {
-    return reinterpret_cast<RawObject**>(&ptr()->stream_);
-  }
+  RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->stream_); }
 
   friend class SnapshotReader;
 };
@@ -1011,6 +975,7 @@
     kSourceTag,
     kPatchTag,
     kEvaluateTag,
+    kKernelTag,
   };
 
  private:
@@ -1020,9 +985,10 @@
   RawString* url_;
   RawString* resolved_url_;
   RawArray* compile_time_constants_;
+  RawArray* line_starts_;
   RawTokenStream* tokens_;
   RawString* source_;
-  RawObject** to() {return reinterpret_cast<RawObject**>(&ptr()->source_); }
+  RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->source_); }
   RawObject** to_snapshot(Snapshot::Kind kind) {
     switch (kind) {
       case Snapshot::kAppNoJIT:
@@ -1062,32 +1028,32 @@
   RawString* name_;
   RawString* url_;
   RawString* private_key_;
-  RawArray* dictionary_;         // Top-level names in this library.
+  RawArray* dictionary_;              // Top-level names in this library.
   RawGrowableObjectArray* metadata_;  // Metadata on classes, methods etc.
-  RawClass* toplevel_class_;     // Class containing top-level elements.
+  RawClass* toplevel_class_;          // Class containing top-level elements.
   RawGrowableObjectArray* patch_classes_;
-  RawArray* imports_;            // List of Namespaces imported without prefix.
-  RawArray* exports_;            // List of re-exported Namespaces.
-  RawInstance* load_error_;      // Error iff load_state_ == kLoadError.
+  RawArray* imports_;        // List of Namespaces imported without prefix.
+  RawArray* exports_;        // List of re-exported Namespaces.
+  RawInstance* load_error_;  // Error iff load_state_ == kLoadError.
   RawObject** to_snapshot() {
     return reinterpret_cast<RawObject**>(&ptr()->load_error_);
   }
-  RawArray* resolved_names_;     // Cache of resolved names in library scope.
-  RawArray* exported_names_;     // Cache of exported names by library.
-  RawArray* loaded_scripts_;     // Array of scripts loaded in this library.
+  RawArray* resolved_names_;  // Cache of resolved names in library scope.
+  RawArray* exported_names_;  // Cache of exported names by library.
+  RawArray* loaded_scripts_;  // Array of scripts loaded in this library.
   RawObject** to() {
     return reinterpret_cast<RawObject**>(&ptr()->loaded_scripts_);
   }
 
   Dart_NativeEntryResolver native_entry_resolver_;  // Resolves natives.
   Dart_NativeEntrySymbol native_entry_symbol_resolver_;
-  classid_t index_;              // Library id number.
-  uint16_t num_imports_;         // Number of entries in imports_.
-  int8_t load_state_;            // Of type LibraryState.
+  classid_t index_;       // Library id number.
+  uint16_t num_imports_;  // Number of entries in imports_.
+  int8_t load_state_;     // Of type LibraryState.
   bool corelib_imported_;
   bool is_dart_scheme_;
-  bool debuggable_;              // True if debugger can stop in library.
-  bool is_in_fullsnapshot_;      // True if library is in a full snapshot.
+  bool debuggable_;          // True if debugger can stop in library.
+  bool is_in_fullsnapshot_;  // True if library is in a full snapshot.
 
   friend class Class;
   friend class Isolate;
@@ -1097,14 +1063,12 @@
 class RawNamespace : public RawObject {
   RAW_HEAP_OBJECT_IMPLEMENTATION(Namespace);
 
-  RawObject** from() {
-    return reinterpret_cast<RawObject**>(&ptr()->library_);
-  }
-  RawLibrary* library_;          // library with name dictionary.
-  RawArray* show_names_;         // list of names that are exported.
-  RawArray* hide_names_;         // blacklist of names that are not exported.
-  RawField* metadata_field_;     // remembers the token pos of metadata if any,
-                                 // and the metadata values if computed.
+  RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->library_); }
+  RawLibrary* library_;       // library with name dictionary.
+  RawArray* show_names_;      // list of names that are exported.
+  RawArray* hide_names_;      // blacklist of names that are not exported.
+  RawField* metadata_field_;  // remembers the token pos of metadata if any,
+                              // and the metadata values if computed.
   RawObject** to() {
     return reinterpret_cast<RawObject**>(&ptr()->metadata_field_);
   }
@@ -1122,13 +1086,13 @@
 
   RAW_HEAP_OBJECT_IMPLEMENTATION(Code);
 
-  uword entry_point_;  // Accessed from generated code.
+  uword entry_point_;          // Accessed from generated code.
   uword checked_entry_point_;  // Accessed from generated code (AOT only).
 
   RawObject** from() {
     return reinterpret_cast<RawObject**>(&ptr()->object_pool_);
   }
-  RawObjectPool* object_pool_;  // Accessed from generated code.
+  RawObjectPool* object_pool_;     // Accessed from generated code.
   RawInstructions* instructions_;  // Accessed from generated code.
   // If owner_ is Function::null() the owner is a regular stub.
   // If owner_ is a Class the owner is the allocation stub for that class.
@@ -1141,18 +1105,18 @@
   NOT_IN_PRECOMPILED(RawArray* deopt_info_array_);
   // (code-offset, function, code) triples.
   NOT_IN_PRECOMPILED(RawArray* static_calls_target_table_);
-  NOT_IN_PRECOMPILED(RawLocalVarDescriptors* var_descriptors_);
   NOT_IN_PRECOMPILED(RawArray* inlined_metadata_);
-  NOT_IN_PRECOMPILED(RawCodeSourceMap* code_source_map_);
-  NOT_IN_PRECOMPILED(RawArray* comments_);
   // If return_address_metadata_ is a Smi, it is the offset to the prologue.
   // Else, return_address_metadata_ is null.
   NOT_IN_PRECOMPILED(RawObject* return_address_metadata_);
+  NOT_IN_PRECOMPILED(RawLocalVarDescriptors* var_descriptors_);
+  NOT_IN_PRECOMPILED(RawCodeSourceMap* code_source_map_);
+  NOT_IN_PRECOMPILED(RawArray* comments_);
   RawObject** to() {
 #if defined(DART_PRECOMPILED_RUNTIME)
     return reinterpret_cast<RawObject**>(&ptr()->stackmaps_);
 #else
-    return reinterpret_cast<RawObject**>(&ptr()->return_address_metadata_);
+    return reinterpret_cast<RawObject**>(&ptr()->comments_);
 #endif
   }
 
@@ -1165,10 +1129,6 @@
   // Alive: If true, the embedded object pointers will be visited during GC.
   int32_t state_bits_;
 
-  // PC offsets for code patching.
-  NOT_IN_PRECOMPILED(int32_t lazy_deopt_return_pc_offset_);
-  NOT_IN_PRECOMPILED(int32_t lazy_deopt_throw_pc_offset_);
-
   // Variable length data follows here.
   int32_t* data() { OPEN_ARRAY_START(int32_t, int32_t); }
   const int32_t* data() const { OPEN_ARRAY_START(int32_t, int32_t); }
@@ -1176,7 +1136,8 @@
   static bool ContainsPC(RawObject* raw_obj, uword pc);
 
   friend class Function;
-  template<bool> friend class MarkingVisitorBase;
+  template <bool>
+  friend class MarkingVisitorBase;
   friend class SkippedCodeFunctions;
   friend class StackFrame;
   friend class Profiler;
@@ -1208,7 +1169,9 @@
 class RawInstructions : public RawObject {
   RAW_HEAP_OBJECT_IMPLEMENTATION(Instructions);
 
-  int32_t size_;
+  // Instructions size in bytes and flags.
+  // Currently, only flag indicates 1 or 2 entry points.
+  uint32_t size_and_flags_;
 
   // Variable length data follows here.
   uint8_t* data() { OPEN_ARRAY_START(uint8_t, uint8_t); }
@@ -1222,7 +1185,8 @@
   friend class RawFunction;
   friend class Code;
   friend class StackFrame;
-  template<bool> friend class MarkingVisitorBase;
+  template <bool>
+  friend class MarkingVisitorBase;
   friend class SkippedCodeFunctions;
   friend class Function;
   friend class InstructionsReader;
@@ -1233,14 +1197,14 @@
 class RawPcDescriptors : public RawObject {
  public:
   enum Kind {
-    kDeopt           = 1,  // Deoptimization continuation point.
-    kIcCall          = kDeopt << 1,  // IC call.
-    kUnoptStaticCall = kIcCall << 1,  // Call to a known target via stub.
-    kRuntimeCall     = kUnoptStaticCall << 1,  // Runtime call.
-    kOsrEntry        = kRuntimeCall << 1,  // OSR entry point in unopt. code.
-    kOther           = kOsrEntry << 1,
-    kLastKind        = kOther,
-    kAnyKind         = -1
+    kDeopt = 1,                            // Deoptimization continuation point.
+    kIcCall = kDeopt << 1,                 // IC call.
+    kUnoptStaticCall = kIcCall << 1,       // Call to a known target via stub.
+    kRuntimeCall = kUnoptStaticCall << 1,  // Runtime call.
+    kOsrEntry = kRuntimeCall << 1,         // OSR entry point in unopt. code.
+    kOther = kOsrEntry << 1,
+    kLastKind = kOther,
+    kAnyKind = -1
   };
 
   class MergedKindTry {
@@ -1316,7 +1280,7 @@
   // to be as large as 96, meaning 7 bits, leaving 25 bits for the length, or
   // as large as ~33 million entries. If that is sufficient, then these two
   // fields can be merged into a BitField.
-  int32_t length_;  // Length of payload, in bits.
+  int32_t length_;               // Length of payload, in bits.
   int32_t slow_path_bit_count_;  // Slow path live values, included in length_.
 
   // Offset from code entry point corresponding to this stack map
@@ -1351,14 +1315,15 @@
   };
 
   class IndexBits : public BitField<int32_t, int32_t, kIndexPos, kIndexSize> {};
-  class KindBits : public BitField<int32_t, int8_t, kKindPos, kKindSize>{};
+  class KindBits : public BitField<int32_t, int8_t, kKindPos, kKindSize> {};
 
   struct VarInfo {
     int32_t index_kind;  // Bitfield for slot index on stack or in context,
                          // and Entry kind of type VarInfoKind.
-    TokenPosition begin_pos;   // Token position of scope start.
-    TokenPosition end_pos;     // Token position of scope end.
-    int16_t scope_id;    // Scope to which the variable belongs.
+    TokenPosition declaration_pos;  // Token position of declaration.
+    TokenPosition begin_pos;        // Token position of scope start.
+    TokenPosition end_pos;          // Token position of scope end.
+    int16_t scope_id;               // Scope to which the variable belongs.
 
     VarInfoKind kind() const {
       return static_cast<VarInfoKind>(KindBits::decode(index_kind));
@@ -1366,9 +1331,7 @@
     void set_kind(VarInfoKind kind) {
       index_kind = KindBits::update(kind, index_kind);
     }
-    int32_t index() const {
-      return IndexBits::decode(index_kind) - kIndexBias;
-    }
+    int32_t index() const { return IndexBits::decode(index_kind) - kIndexBias; }
     void set_index(int32_t index) {
       index_kind = IndexBits::update(index + kIndexBias, index_kind);
     }
@@ -1385,9 +1348,7 @@
     // Array of [num_entries_] variable names.
     OPEN_ARRAY_START(RawString*, RawString*);
   }
-  RawString** nameAddrAt(intptr_t i) {
-    return &(ptr()->names()[i]);
-  }
+  RawString** nameAddrAt(intptr_t i) { return &(ptr()->names()[i]); }
 
   RawObject** to(intptr_t num_entries) {
     return reinterpret_cast<RawObject**>(nameAddrAt(num_entries - 1));
@@ -1408,9 +1369,9 @@
   // the try_index of the handler.
   struct HandlerInfo {
     uint32_t handler_pc_offset;  // PC offset value of handler.
-    int16_t outer_try_index;   // Try block index of enclosing try block.
-    int8_t needs_stacktrace;   // True if a stacktrace is needed.
-    int8_t has_catch_all;      // Catches all exceptions.
+    int16_t outer_try_index;     // Try block index of enclosing try block.
+    int8_t needs_stacktrace;     // True if a stacktrace is needed.
+    int8_t has_catch_all;        // Catches all exceptions.
   };
 
  private:
@@ -1441,9 +1402,7 @@
 
   // Variable length data follows here.
   RawObject** data() { OPEN_ARRAY_START(RawObject*, RawObject*); }
-  RawObject* const* data() const {
-      OPEN_ARRAY_START(RawObject*, RawObject*);
-  }
+  RawObject* const* data() const { OPEN_ARRAY_START(RawObject*, RawObject*); }
   RawObject** to(intptr_t num_vars) {
     return reinterpret_cast<RawObject**>(&ptr()->data()[num_vars - 1]);
   }
@@ -1458,6 +1417,7 @@
   // TODO(iposva): Switch to conventional enum offset based structure to avoid
   // alignment mishaps.
   struct VariableDesc {
+    RawSmi* declaration_token_pos;
     RawSmi* token_pos;
     RawString* name;
     RawBool* is_final;
@@ -1498,13 +1458,9 @@
 
 class RawSingleTargetCache : public RawObject {
   RAW_HEAP_OBJECT_IMPLEMENTATION(SingleTargetCache);
-  RawObject** from() {
-    return reinterpret_cast<RawObject**>(&ptr()->target_);
-  }
+  RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->target_); }
   RawCode* target_;
-  RawObject** to() {
-    return reinterpret_cast<RawObject**>(&ptr()->target_);
-  }
+  RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->target_); }
   uword entry_point_;
   classid_t lower_limit_;
   classid_t upper_limit_;
@@ -1527,16 +1483,12 @@
 class RawICData : public RawObject {
   RAW_HEAP_OBJECT_IMPLEMENTATION(ICData);
 
-  RawObject** from() {
-    return reinterpret_cast<RawObject**>(&ptr()->ic_data_);
-  }
-  RawArray* ic_data_;  // Contains class-ids, target and count.
-  RawString* target_name_;  // Name of target function.
+  RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->ic_data_); }
+  RawArray* ic_data_;          // Contains class-ids, target and count.
+  RawString* target_name_;     // Name of target function.
   RawArray* args_descriptor_;  // Arguments descriptor.
   RawObject* owner_;  // Parent/calling function or original IC of cloned IC.
-  RawObject** to() {
-    return reinterpret_cast<RawObject**>(&ptr()->owner_);
-  }
+  RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->owner_); }
   RawObject** to_snapshot(Snapshot::Kind kind) {
     switch (kind) {
       case Snapshot::kAppNoJIT:
@@ -1565,9 +1517,7 @@
 class RawMegamorphicCache : public RawObject {
   RAW_HEAP_OBJECT_IMPLEMENTATION(MegamorphicCache);
 
-  RawObject** from() {
-    return reinterpret_cast<RawObject**>(&ptr()->buckets_);
-  }
+  RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->buckets_); }
   RawArray* buckets_;
   RawSmi* mask_;
   RawString* target_name_;     // Name of target function.
@@ -1594,13 +1544,9 @@
 class RawApiError : public RawError {
   RAW_HEAP_OBJECT_IMPLEMENTATION(ApiError);
 
-  RawObject** from() {
-    return reinterpret_cast<RawObject**>(&ptr()->message_);
-  }
+  RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->message_); }
   RawString* message_;
-  RawObject** to() {
-    return reinterpret_cast<RawObject**>(&ptr()->message_);
-  }
+  RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->message_); }
 };
 
 
@@ -1619,7 +1565,7 @@
   }
   TokenPosition token_pos_;  // Source position in script_.
   bool report_after_token_;  // Report message at or after the token.
-  int8_t kind_;  // Of type Report::Kind.
+  int8_t kind_;              // Of type Report::Kind.
 };
 
 
@@ -1640,13 +1586,9 @@
 class RawUnwindError : public RawError {
   RAW_HEAP_OBJECT_IMPLEMENTATION(UnwindError);
 
-  RawObject** from() {
-    return reinterpret_cast<RawObject**>(&ptr()->message_);
-  }
+  RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->message_); }
   RawString* message_;
-  RawObject** to() {
-    return reinterpret_cast<RawObject**>(&ptr()->message_);
-  }
+  RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->message_); }
   bool is_user_initiated_;
   bool is_vm_restart_;
 };
@@ -1661,11 +1603,11 @@
   RAW_HEAP_OBJECT_IMPLEMENTATION(LibraryPrefix);
 
   RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); }
-  RawString* name_;               // Library prefix name.
-  RawLibrary* importer_;          // Library which declares this prefix.
-  RawArray* imports_;             // Libraries imported with this prefix.
-  RawArray* dependent_code_;      // Code that refers to deferred, unloaded
-                                  // library prefix.
+  RawString* name_;           // Library prefix name.
+  RawLibrary* importer_;      // Library which declares this prefix.
+  RawArray* imports_;         // Libraries imported with this prefix.
+  RawArray* dependent_code_;  // Code that refers to deferred, unloaded
+                              // library prefix.
   RawObject** to() {
     return reinterpret_cast<RawObject**>(&ptr()->dependent_code_);
   }
@@ -1685,7 +1627,7 @@
     UNREACHABLE();
     return NULL;
   }
-  uint16_t num_imports_;          // Number of library entries in libraries_.
+  uint16_t num_imports_;  // Number of library entries in libraries_.
   bool is_deferred_load_;
   bool is_loaded_;
 };
@@ -1694,10 +1636,10 @@
 class RawAbstractType : public RawInstance {
  protected:
   enum TypeState {
-    kAllocated,  // Initial state.
-    kResolved,  // Type class and type arguments resolved.
-    kBeingFinalized,  // In the process of being finalized.
-    kFinalizedInstantiated,  // Instantiated type ready for use.
+    kAllocated,                // Initial state.
+    kResolved,                 // Type class and type arguments resolved.
+    kBeingFinalized,           // In the process of being finalized.
+    kFinalizedInstantiated,    // Instantiated type ready for use.
     kFinalizedUninstantiated,  // Uninstantiated type ready for use.
   };
 
@@ -1726,7 +1668,7 @@
   // function type, its signature is lost, but the message in the error object
   // can describe the issue without needing the signature.
   union {
-    RawFunction* signature_;  // If not null, this type is a function type.
+    RawFunction* signature_;   // If not null, this type is a function type.
     RawLanguageError* error_;  // If not null, type is malformed or malbounded.
   } sig_or_err_;
   RawObject** to() {
@@ -1743,13 +1685,9 @@
  private:
   RAW_HEAP_OBJECT_IMPLEMENTATION(TypeRef);
 
-  RawObject** from() {
-    return reinterpret_cast<RawObject**>(&ptr()->type_);
-  }
+  RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->type_); }
   RawAbstractType* type_;  // The referenced type.
-  RawObject** to() {
-    return reinterpret_cast<RawObject**>(&ptr()->type_);
-  }
+  RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->type_); }
 };
 
 
@@ -1757,9 +1695,7 @@
  private:
   RAW_HEAP_OBJECT_IMPLEMENTATION(TypeParameter);
 
-  RawObject** from() {
-    return reinterpret_cast<RawObject**>(&ptr()->name_);
-  }
+  RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); }
   RawString* name_;
   RawSmi* hash_;
   RawAbstractType* bound_;  // ObjectType if no explicit bound specified.
@@ -1781,9 +1717,7 @@
  private:
   RAW_HEAP_OBJECT_IMPLEMENTATION(BoundedType);
 
-  RawObject** from() {
-    return reinterpret_cast<RawObject**>(&ptr()->type_);
-  }
+  RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->type_); }
   RawAbstractType* type_;
   RawAbstractType* bound_;
   RawSmi* hash_;
@@ -1822,9 +1756,7 @@
   RawFunction* function_;
   RawContext* context_;
 
-  RawObject** to() {
-    return reinterpret_cast<RawObject**>(&ptr()->context_);
-  }
+  RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->context_); }
 };
 
 
@@ -1914,22 +1846,17 @@
 };
 
 
-template<typename T>
+template <typename T>
 class ExternalStringData {
  public:
-  ExternalStringData(const T* data, void* peer, Dart_PeerFinalizer callback) :
-      data_(data), peer_(peer), callback_(callback) {
-  }
+  ExternalStringData(const T* data, void* peer, Dart_PeerFinalizer callback)
+      : data_(data), peer_(peer), callback_(callback) {}
   ~ExternalStringData() {
     if (callback_ != NULL) (*callback_)(peer_);
   }
 
-  const T* data() {
-    return data_;
-  }
-  void* peer() {
-    return peer_;
-  }
+  const T* data() { return data_; }
+  void* peer() { return peer_; }
 
   static intptr_t data_offset() {
     return OFFSET_OF(ExternalStringData<T>, data_);
@@ -1944,6 +1871,7 @@
 
 class RawExternalOneByteString : public RawString {
   RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalOneByteString);
+
  public:
   typedef ExternalStringData<uint8_t> ExternalData;
 
@@ -1955,6 +1883,7 @@
 
 class RawExternalTwoByteString : public RawString {
   RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalTwoByteString);
+
  public:
   typedef ExternalStringData<uint16_t> ExternalData;
 
@@ -1996,7 +1925,7 @@
   friend class LinkedHashMap;
   friend class RawLinkedHashMap;
   friend class Object;
-  friend class ICData;  // For high performance access.
+  friend class ICData;            // For high performance access.
   friend class SubtypeTestCache;  // For high performance access.
 };
 
@@ -2017,9 +1946,7 @@
   RawTypeArguments* type_arguments_;
   RawSmi* length_;
   RawArray* data_;
-  RawObject** to() {
-    return reinterpret_cast<RawObject**>(&ptr()->data_);
-  }
+  RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->data_); }
 
   friend class SnapshotReader;
 };
@@ -2163,9 +2090,7 @@
   }
   RawSendPort* send_port_;
   RawInstance* handler_;
-  RawObject** to() {
-    return reinterpret_cast<RawObject**>(&ptr()->handler_);
-  }
+  RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->handler_); }
 };
 
 
@@ -2179,7 +2104,7 @@
   RawObject** from() {
     return reinterpret_cast<RawObject**>(&ptr()->code_array_);
   }
-  RawArray* code_array_;  // Code object for each frame in the stack trace.
+  RawArray* code_array_;       // Code object for each frame in the stack trace.
   RawArray* pc_offset_array_;  // Offset of PC for each frame.
   RawObject** to() {
     return reinterpret_cast<RawObject**>(&ptr()->pc_offset_array_);
@@ -2198,14 +2123,29 @@
   }
   RawSmi* num_bracket_expressions_;
   RawString* pattern_;  // Pattern to be used for matching.
-  RawFunction* one_byte_function_;
-  RawFunction* two_byte_function_;
+  union {
+    RawFunction* function_;
+    RawTypedData* bytecode_;
+  } one_byte_;
+  union {
+    RawFunction* function_;
+    RawTypedData* bytecode_;
+  } two_byte_;
   RawFunction* external_one_byte_function_;
   RawFunction* external_two_byte_function_;
-  RawTypedData* one_byte_bytecode_;
-  RawTypedData* two_byte_bytecode_;
+  union {
+    RawFunction* function_;
+    RawTypedData* bytecode_;
+  } one_byte_sticky_;
+  union {
+    RawFunction* function_;
+    RawTypedData* bytecode_;
+  } two_byte_sticky_;
+  RawFunction* external_one_byte_sticky_function_;
+  RawFunction* external_two_byte_sticky_function_;
   RawObject** to() {
-    return reinterpret_cast<RawObject**>(&ptr()->two_byte_bytecode_);
+    return reinterpret_cast<RawObject**>(
+        &ptr()->external_two_byte_sticky_function_);
   }
 
   intptr_t num_registers_;
@@ -2220,21 +2160,18 @@
 class RawWeakProperty : public RawInstance {
   RAW_HEAP_OBJECT_IMPLEMENTATION(WeakProperty);
 
-  RawObject** from() {
-    return reinterpret_cast<RawObject**>(&ptr()->key_);
-  }
+  RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->key_); }
   RawObject* key_;
   RawObject* value_;
-  RawObject** to() {
-    return reinterpret_cast<RawObject**>(&ptr()->value_);
-  }
+  RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->value_); }
 
   // Linked list is chaining all pending weak properties.
   // Untyped to make it clear that it is not to be visited by GC.
   uword next_;
 
   friend class GCMarker;
-  template<bool> friend class MarkingVisitorBase;
+  template <bool>
+  friend class MarkingVisitorBase;
   friend class Scavenger;
   friend class ScavengerVisitor;
 };
@@ -2248,9 +2185,7 @@
     return reinterpret_cast<RawObject**>(&ptr()->referent_);
   }
   RawObject* referent_;
-  RawObject** to() {
-    return reinterpret_cast<RawObject**>(&ptr()->referent_);
-  }
+  RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->referent_); }
 };
 
 
@@ -2258,15 +2193,11 @@
 class RawUserTag : public RawInstance {
   RAW_HEAP_OBJECT_IMPLEMENTATION(UserTag);
 
-  RawObject** from() {
-    return reinterpret_cast<RawObject**>(&ptr()->label_);
-  }
+  RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->label_); }
 
   RawString* label_;
 
-  RawObject** to() {
-    return reinterpret_cast<RawObject**>(&ptr()->label_);
-  }
+  RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->label_); }
 
   // Isolate unique tag.
   uword tag_;
@@ -2282,21 +2213,18 @@
 
 inline bool RawObject::IsErrorClassId(intptr_t index) {
   // Make sure this function is updated when new Error types are added.
-  COMPILE_ASSERT(kApiErrorCid == kErrorCid + 1 &&
-                 kLanguageErrorCid == kErrorCid + 2 &&
-                 kUnhandledExceptionCid == kErrorCid + 3 &&
-                 kUnwindErrorCid == kErrorCid + 4 &&
-                 kInstanceCid == kErrorCid + 5);
+  COMPILE_ASSERT(
+      kApiErrorCid == kErrorCid + 1 && kLanguageErrorCid == kErrorCid + 2 &&
+      kUnhandledExceptionCid == kErrorCid + 3 &&
+      kUnwindErrorCid == kErrorCid + 4 && kInstanceCid == kErrorCid + 5);
   return (index >= kErrorCid && index < kInstanceCid);
 }
 
 
 inline bool RawObject::IsNumberClassId(intptr_t index) {
   // Make sure this function is updated when new Number types are added.
-  COMPILE_ASSERT(kIntegerCid == kNumberCid + 1 &&
-                 kSmiCid == kNumberCid + 2 &&
-                 kMintCid == kNumberCid + 3 &&
-                 kBigintCid == kNumberCid + 4 &&
+  COMPILE_ASSERT(kIntegerCid == kNumberCid + 1 && kSmiCid == kNumberCid + 2 &&
+                 kMintCid == kNumberCid + 3 && kBigintCid == kNumberCid + 4 &&
                  kDoubleCid == kNumberCid + 5);
   return (index >= kNumberCid && index < kBoolCid);
 }
@@ -2304,8 +2232,7 @@
 
 inline bool RawObject::IsIntegerClassId(intptr_t index) {
   // Make sure this function is updated when new Integer types are added.
-  COMPILE_ASSERT(kSmiCid == kIntegerCid + 1 &&
-                 kMintCid == kIntegerCid + 2 &&
+  COMPILE_ASSERT(kSmiCid == kIntegerCid + 1 && kMintCid == kIntegerCid + 2 &&
                  kBigintCid == kIntegerCid + 3 &&
                  kDoubleCid == kIntegerCid + 4);
   return (index >= kIntegerCid && index < kDoubleCid);
@@ -2357,10 +2284,8 @@
   // Make sure this function is updated when new builtin List types are added.
   COMPILE_ASSERT(kImmutableArrayCid == kArrayCid + 1);
   return ((index >= kArrayCid && index <= kImmutableArrayCid) ||
-          (index == kGrowableObjectArrayCid) ||
-          IsTypedDataClassId(index) ||
-          IsTypedDataViewClassId(index) ||
-          IsExternalTypedDataClassId(index) ||
+          (index == kGrowableObjectArrayCid) || IsTypedDataClassId(index) ||
+          IsTypedDataViewClassId(index) || IsExternalTypedDataClassId(index) ||
           (index == kByteBufferCid));
 }
 
@@ -2404,28 +2329,23 @@
       kTypedDataFloat64x2ArrayViewCid == kTypedDataInt8ArrayViewCid + 13 &&
       kByteDataViewCid == kTypedDataInt8ArrayViewCid + 14 &&
       kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 15);
-  return (index >= kTypedDataInt8ArrayViewCid &&
-          index <= kByteDataViewCid);
+  return (index >= kTypedDataInt8ArrayViewCid && index <= kByteDataViewCid);
 }
 
 
 inline bool RawObject::IsExternalTypedDataClassId(intptr_t index) {
   // Make sure this is updated when new ExternalTypedData types are added.
   COMPILE_ASSERT(
-      (kExternalTypedDataUint8ArrayCid ==
-       kExternalTypedDataInt8ArrayCid + 1) &&
+      (kExternalTypedDataUint8ArrayCid == kExternalTypedDataInt8ArrayCid + 1) &&
       (kExternalTypedDataUint8ClampedArrayCid ==
        kExternalTypedDataInt8ArrayCid + 2) &&
-      (kExternalTypedDataInt16ArrayCid ==
-       kExternalTypedDataInt8ArrayCid + 3) &&
+      (kExternalTypedDataInt16ArrayCid == kExternalTypedDataInt8ArrayCid + 3) &&
       (kExternalTypedDataUint16ArrayCid ==
        kExternalTypedDataInt8ArrayCid + 4) &&
-      (kExternalTypedDataInt32ArrayCid ==
-       kExternalTypedDataInt8ArrayCid + 5) &&
+      (kExternalTypedDataInt32ArrayCid == kExternalTypedDataInt8ArrayCid + 5) &&
       (kExternalTypedDataUint32ArrayCid ==
        kExternalTypedDataInt8ArrayCid + 6) &&
-      (kExternalTypedDataInt64ArrayCid ==
-       kExternalTypedDataInt8ArrayCid + 7) &&
+      (kExternalTypedDataInt64ArrayCid == kExternalTypedDataInt8ArrayCid + 7) &&
       (kExternalTypedDataUint64ArrayCid ==
        kExternalTypedDataInt8ArrayCid + 8) &&
       (kExternalTypedDataFloat32ArrayCid ==
@@ -2451,23 +2371,16 @@
 
 
 inline bool RawObject::IsVariableSizeClassId(intptr_t index) {
-  return (index == kArrayCid) ||
-         (index == kImmutableArrayCid) ||
+  return (index == kArrayCid) || (index == kImmutableArrayCid) ||
          RawObject::IsOneByteStringClassId(index) ||
          RawObject::IsTwoByteStringClassId(index) ||
-         RawObject::IsTypedDataClassId(index) ||
-         (index == kContextCid) ||
-         (index == kTypeArgumentsCid) ||
-         (index == kInstructionsCid) ||
-         (index == kObjectPoolCid) ||
-         (index == kPcDescriptorsCid) ||
-         (index == kCodeSourceMapCid) ||
-         (index == kStackmapCid) ||
+         RawObject::IsTypedDataClassId(index) || (index == kContextCid) ||
+         (index == kTypeArgumentsCid) || (index == kInstructionsCid) ||
+         (index == kObjectPoolCid) || (index == kPcDescriptorsCid) ||
+         (index == kCodeSourceMapCid) || (index == kStackmapCid) ||
          (index == kLocalVarDescriptorsCid) ||
-         (index == kExceptionHandlersCid) ||
-         (index == kCodeCid) ||
-         (index == kContextScopeCid) ||
-         (index == kInstanceCid) ||
+         (index == kExceptionHandlersCid) || (index == kCodeCid) ||
+         (index == kContextScopeCid) || (index == kInstanceCid) ||
          (index == kRegExpCid);
 }
 
@@ -2492,4 +2405,4 @@
 
 }  // namespace dart
 
-#endif  // VM_RAW_OBJECT_H_
+#endif  // RUNTIME_VM_RAW_OBJECT_H_
diff --git a/runtime/vm/raw_object_snapshot.cc b/runtime/vm/raw_object_snapshot.cc
index f345a19..2177722 100644
--- a/runtime/vm/raw_object_snapshot.cc
+++ b/runtime/vm/raw_object_snapshot.cc
@@ -25,8 +25,7 @@
   for (intptr_t i = 0; i <= num_flds; i++) {                                   \
     (*reader->PassiveObjectHandle()) =                                         \
         reader->ReadObjectImpl(as_reference, object_id, (i + from_offset));    \
-    object.StorePointer(((from) + i),                                          \
-                        reader->PassiveObjectHandle()->raw());                 \
+    object.StorePointer(((from) + i), reader->PassiveObjectHandle()->raw());   \
   }
 
 RawClass* Class::ReadFrom(SnapshotReader* reader,
@@ -65,9 +64,7 @@
     cls.set_state_bits(reader->Read<uint16_t>());
 
     // Set all the object fields.
-    READ_OBJECT_FIELDS(cls,
-                       cls.raw()->from(),
-                       cls.raw()->to_snapshot(kind),
+    READ_OBJECT_FIELDS(cls, cls.raw()->from(), cls.raw()->to_snapshot(kind),
                        kAsReference);
     cls.StorePointer(&cls.raw_ptr()->dependent_code_, Array::null());
     ASSERT(!cls.IsInFullSnapshot());
@@ -143,8 +140,8 @@
   ASSERT(reader != NULL);
 
   // Allocate unresolved class object.
-  UnresolvedClass& unresolved_class = UnresolvedClass::ZoneHandle(
-      reader->zone(), UnresolvedClass::New());
+  UnresolvedClass& unresolved_class =
+      UnresolvedClass::ZoneHandle(reader->zone(), UnresolvedClass::New());
   reader->AddBackRef(object_id, &unresolved_class, kIsDeserialized);
 
   // Set all non object fields.
@@ -152,10 +149,8 @@
       TokenPosition::SnapshotDecode(reader->Read<int32_t>()));
 
   // Set all the object fields.
-  READ_OBJECT_FIELDS(unresolved_class,
-                     unresolved_class.raw()->from(),
-                     unresolved_class.raw()->to(),
-                     kAsReference);
+  READ_OBJECT_FIELDS(unresolved_class, unresolved_class.raw()->from(),
+                     unresolved_class.raw()->to(), kAsReference);
 
   return unresolved_class.raw();
 }
@@ -214,7 +209,8 @@
   // Allocate type object.
   Type& type = Type::ZoneHandle(reader->zone(), Type::New());
   bool is_canonical = RawObject::IsCanonical(tags);
-  bool defer_canonicalization = is_canonical &&
+  bool defer_canonicalization =
+      is_canonical &&
       ((kind == Snapshot::kMessage) ||
        (!Snapshot::IsFull(kind) && typeclass_is_in_fullsnapshot));
   reader->AddBackRef(object_id, &type, kIsDeserialized, defer_canonicalization);
@@ -298,13 +294,11 @@
   ASSERT(reader != NULL);
 
   // Allocate type ref object.
-  TypeRef& type_ref = TypeRef::ZoneHandle(
-      reader->zone(), TypeRef::New());
+  TypeRef& type_ref = TypeRef::ZoneHandle(reader->zone(), TypeRef::New());
   reader->AddBackRef(object_id, &type_ref, kIsDeserialized);
 
   // Set all the object fields.
-  READ_OBJECT_FIELDS(type_ref,
-                     type_ref.raw()->from(), type_ref.raw()->to(),
+  READ_OBJECT_FIELDS(type_ref, type_ref.raw()->from(), type_ref.raw()->to(),
                      kAsReference);
 
   return type_ref.raw();
@@ -338,8 +332,8 @@
   ASSERT(reader != NULL);
 
   // Allocate type parameter object.
-  TypeParameter& type_parameter = TypeParameter::ZoneHandle(
-      reader->zone(), TypeParameter::New());
+  TypeParameter& type_parameter =
+      TypeParameter::ZoneHandle(reader->zone(), TypeParameter::New());
   reader->AddBackRef(object_id, &type_parameter, kIsDeserialized);
 
   // Set all non object fields.
@@ -350,9 +344,8 @@
   type_parameter.set_type_state(reader->Read<int8_t>());
 
   // Set all the object fields.
-  READ_OBJECT_FIELDS(type_parameter,
-                     type_parameter.raw()->from(), type_parameter.raw()->to(),
-                     kAsReference);
+  READ_OBJECT_FIELDS(type_parameter, type_parameter.raw()->from(),
+                     type_parameter.raw()->to(), kAsReference);
 
   // Read in the parameterized class.
   (*reader->ClassHandle()) =
@@ -404,14 +397,13 @@
   ASSERT(reader != NULL);
 
   // Allocate bounded type object.
-  BoundedType& bounded_type = BoundedType::ZoneHandle(
-      reader->zone(), BoundedType::New());
+  BoundedType& bounded_type =
+      BoundedType::ZoneHandle(reader->zone(), BoundedType::New());
   reader->AddBackRef(object_id, &bounded_type, kIsDeserialized);
 
   // Set all the object fields.
-  READ_OBJECT_FIELDS(bounded_type,
-                     bounded_type.raw()->from(), bounded_type.raw()->to(),
-                     kAsReference);
+  READ_OBJECT_FIELDS(bounded_type, bounded_type.raw()->from(),
+                     bounded_type.raw()->to(), kAsReference);
 
   return bounded_type.raw();
 }
@@ -468,16 +460,15 @@
       reader->zone(), TypeArguments::New(len, HEAP_SPACE(kind)));
   bool is_canonical = RawObject::IsCanonical(tags);
   bool defer_canonicalization = is_canonical && (!Snapshot::IsFull(kind));
-  reader->AddBackRef(object_id,
-                     &type_arguments,
-                     kIsDeserialized,
+  reader->AddBackRef(object_id, &type_arguments, kIsDeserialized,
                      defer_canonicalization);
 
   // Set the instantiations field, which is only read from a full snapshot.
   type_arguments.set_instantiations(Object::zero_array());
 
   // Now set all the type fields.
-  intptr_t offset = type_arguments.TypeAddr(0) -
+  intptr_t offset =
+      type_arguments.TypeAddr(0) -
       reinterpret_cast<RawAbstractType**>(type_arguments.raw()->ptr());
   for (intptr_t i = 0; i < len; i++) {
     *reader->TypeHandle() ^=
@@ -527,8 +518,7 @@
   ASSERT(kind == Snapshot::kScript);
 
   // Allocate function object.
-  PatchClass& cls = PatchClass::ZoneHandle(reader->zone(),
-                                           PatchClass::New());
+  PatchClass& cls = PatchClass::ZoneHandle(reader->zone(), PatchClass::New());
   reader->AddBackRef(object_id, &cls, kIsDeserialized);
 
   // Set all the object fields.
@@ -577,8 +567,7 @@
   // Check if closure is serializable, throw an exception otherwise.
   RawFunction* func = writer->IsSerializableClosure(this);
   if (func != Function::null()) {
-    writer->WriteStaticImplicitClosure(object_id,
-                                       func,
+    writer->WriteStaticImplicitClosure(object_id, func,
                                        writer->GetObjectTags(this));
     return;
   }
@@ -596,13 +585,12 @@
   ASSERT(kind == Snapshot::kScript);
 
   // Allocate closure data object.
-  ClosureData& data = ClosureData::ZoneHandle(reader->zone(),
-                                              ClosureData::New());
+  ClosureData& data =
+      ClosureData::ZoneHandle(reader->zone(), ClosureData::New());
   reader->AddBackRef(object_id, &data, kIsDeserialized);
 
   // Set all the object fields.
-  READ_OBJECT_FIELDS(data,
-                     data.raw()->from(), data.raw()->to(),
+  READ_OBJECT_FIELDS(data, data.raw()->from(), data.raw()->to(),
                      kAsInlinedObject);
 
   return data.raw();
@@ -653,14 +641,12 @@
   ASSERT(kind == Snapshot::kScript);
 
   // Allocate redirection data object.
-  RedirectionData& data = RedirectionData::ZoneHandle(reader->zone(),
-                                                      RedirectionData::New());
+  RedirectionData& data =
+      RedirectionData::ZoneHandle(reader->zone(), RedirectionData::New());
   reader->AddBackRef(object_id, &data, kIsDeserialized);
 
   // Set all the object fields.
-  READ_OBJECT_FIELDS(data,
-                     data.raw()->from(), data.raw()->to(),
-                     kAsReference);
+  READ_OBJECT_FIELDS(data, data.raw()->from(), data.raw()->to(), kAsReference);
 
   return data.raw();
 }
@@ -697,8 +683,7 @@
   bool is_in_fullsnapshot = reader->Read<bool>();
   if (!is_in_fullsnapshot) {
     // Allocate function object.
-    Function& func = Function::ZoneHandle(reader->zone(),
-                                          Function::New());
+    Function& func = Function::ZoneHandle(reader->zone(), Function::New());
     reader->AddBackRef(object_id, &func, kIsDeserialized);
 
     // Set all the non object fields. Read the token positions now but
@@ -714,11 +699,11 @@
     func.set_deoptimization_counter(reader->Read<int8_t>());
     func.set_optimized_instruction_count(reader->Read<uint16_t>());
     func.set_optimized_call_site_count(reader->Read<uint16_t>());
+    func.set_kernel_function(NULL);
     func.set_was_compiled(false);
 
     // Set all the object fields.
-    READ_OBJECT_FIELDS(func,
-                       func.raw()->from(), func.raw()->to_snapshot(),
+    READ_OBJECT_FIELDS(func, func.raw()->from(), func.raw()->to_snapshot(),
                        kAsReference);
     // Initialize all fields that are not part of the snapshot.
     bool is_optimized = func.usage_counter() != 0;
@@ -749,10 +734,11 @@
     intptr_t tags = writer->GetObjectTags(ptr()->owner_);
     intptr_t cid = ClassIdTag::decode(tags);
     owner_is_class = (cid == kClassCid);
-    is_in_fullsnapshot = owner_is_class ?
-        Class::IsInFullSnapshot(reinterpret_cast<RawClass*>(ptr()->owner_)) :
-        PatchClass::IsInFullSnapshot(
-            reinterpret_cast<RawPatchClass*>(ptr()->owner_));
+    is_in_fullsnapshot =
+        owner_is_class ? Class::IsInFullSnapshot(
+                             reinterpret_cast<RawClass*>(ptr()->owner_))
+                       : PatchClass::IsInFullSnapshot(
+                             reinterpret_cast<RawPatchClass*>(ptr()->owner_));
   }
 
   // Write out the serialization header value for this object.
@@ -770,7 +756,7 @@
   if (!is_in_fullsnapshot) {
     bool is_optimized = Code::IsOptimized(ptr()->code_);
 
-    // Write out all the non object fields.
+// Write out all the non object fields.
 #if !defined(DART_PRECOMPILED_RUNTIME)
     writer->Write<int32_t>(ptr()->token_pos_.SnapshotEncode());
     writer->Write<int32_t>(ptr()->end_token_pos_.SnapshotEncode());
@@ -815,16 +801,14 @@
   reader->AddBackRef(object_id, &field, kIsDeserialized);
 
   // Set all non object fields.
-  field.set_token_pos(
-      TokenPosition::SnapshotDecode(reader->Read<int32_t>()));
+  field.set_token_pos(TokenPosition::SnapshotDecode(reader->Read<int32_t>()));
   field.set_guarded_cid(reader->Read<int32_t>());
   field.set_is_nullable(reader->Read<int32_t>());
   field.set_kind_bits(reader->Read<uint8_t>());
+  field.set_kernel_field(NULL);
 
   // Set all the object fields.
-  READ_OBJECT_FIELDS(field,
-                     field.raw()->from(),
-                     field.raw()->to_snapshot(kind),
+  READ_OBJECT_FIELDS(field, field.raw()->from(), field.raw()->to_snapshot(kind),
                      kAsReference);
   field.StorePointer(&field.raw_ptr()->dependent_code_, Array::null());
 
@@ -895,8 +879,8 @@
   ASSERT(kind != Snapshot::kMessage);
 
   // Create the literal token object.
-  LiteralToken& literal_token = LiteralToken::ZoneHandle(reader->zone(),
-                                                         LiteralToken::New());
+  LiteralToken& literal_token =
+      LiteralToken::ZoneHandle(reader->zone(), LiteralToken::New());
   reader->AddBackRef(object_id, &literal_token, kIsDeserialized);
 
   // Read the token attributes.
@@ -904,9 +888,8 @@
   literal_token.set_kind(token_kind);
 
   // Set all the object fields.
-  READ_OBJECT_FIELDS(literal_token,
-                     literal_token.raw()->from(), literal_token.raw()->to(),
-                     kAsReference);
+  READ_OBJECT_FIELDS(literal_token, literal_token.raw()->from(),
+                     literal_token.raw()->to(), kAsReference);
 
   return literal_token.raw();
 }
@@ -947,8 +930,8 @@
   intptr_t len = reader->ReadSmiValue();
 
   // Create the token stream object.
-  TokenStream& token_stream = TokenStream::ZoneHandle(reader->zone(),
-                                                      TokenStream::New(len));
+  TokenStream& token_stream =
+      TokenStream::ZoneHandle(reader->zone(), TokenStream::New(len));
   reader->AddBackRef(object_id, &token_stream, kIsDeserialized);
 
   // Read the stream of tokens into the TokenStream object for script
@@ -1013,8 +996,7 @@
                          reader->Read<int32_t>());
   script.StoreNonPointer(&script.raw_ptr()->col_offset_,
                          reader->Read<int32_t>());
-  script.StoreNonPointer(&script.raw_ptr()->kind_,
-                         reader->Read<int8_t>());
+  script.StoreNonPointer(&script.raw_ptr()->kind_, reader->Read<int8_t>());
 
   *reader->StringHandle() ^= String::null();
   script.set_source(*reader->StringHandle());
@@ -1031,8 +1013,8 @@
                         reader->PassiveObjectHandle()->raw());
   }
 
-  script.set_load_timestamp(FLAG_remove_script_timestamps_for_test
-                            ? 0 : OS::GetCurrentTimeMillis());
+  script.set_load_timestamp(
+      FLAG_remove_script_timestamps_for_test ? 0 : OS::GetCurrentTimeMillis());
 
   return script.raw();
 }
@@ -1180,8 +1162,8 @@
   ASSERT(kind == Snapshot::kScript);
 
   // Allocate library prefix object.
-  LibraryPrefix& prefix = LibraryPrefix::ZoneHandle(reader->zone(),
-                                                    LibraryPrefix::New());
+  LibraryPrefix& prefix =
+      LibraryPrefix::ZoneHandle(reader->zone(), LibraryPrefix::New());
   reader->AddBackRef(object_id, &prefix, kIsDeserialized);
 
   // Set all non object fields.
@@ -1189,15 +1171,13 @@
                          reader->Read<int16_t>());
   prefix.StoreNonPointer(&prefix.raw_ptr()->is_deferred_load_,
                          reader->Read<bool>());
-  prefix.StoreNonPointer(&prefix.raw_ptr()->is_loaded_, reader->Read<bool>());
+  prefix.StoreNonPointer(&prefix.raw_ptr()->is_loaded_,
+                         !prefix.raw_ptr()->is_deferred_load_);
 
   // Set all the object fields.
-  READ_OBJECT_FIELDS(prefix,
-                     prefix.raw()->from(),
-                     prefix.raw()->to_snapshot(kind),
-                     kAsReference);
-  prefix.StorePointer(&prefix.raw_ptr()->dependent_code_,
-                      Array::null());
+  READ_OBJECT_FIELDS(prefix, prefix.raw()->from(),
+                     prefix.raw()->to_snapshot(kind), kAsReference);
+  prefix.StorePointer(&prefix.raw_ptr()->dependent_code_, Array::null());
 
   return prefix.raw();
 }
@@ -1220,7 +1200,6 @@
   // Write out all non object fields.
   writer->Write<int16_t>(ptr()->num_imports_);
   writer->Write<bool>(ptr()->is_deferred_load_);
-  writer->Write<bool>(ptr()->is_loaded_);
 
   // Write out all the object pointer fields.
   SnapshotWriterVisitor visitor(writer, kAsReference);
@@ -1483,6 +1462,7 @@
 
     // Create a descriptor for 'this' variable.
     context_scope.SetTokenIndexAt(0, TokenPosition::kMinSource);
+    context_scope.SetDeclarationTokenIndexAt(0, TokenPosition::kMinSource);
     context_scope.SetNameAt(0, Symbols::This());
     context_scope.SetIsFinalAt(0, true);
     context_scope.SetIsConstAt(0, false);
@@ -1578,10 +1558,8 @@
 #endif
 
   // Set all the object fields.
-  READ_OBJECT_FIELDS(result,
-                     result.raw()->from(),
-                     result.raw()->to_snapshot(kind),
-                     kAsReference);
+  READ_OBJECT_FIELDS(result, result.raw()->from(),
+                     result.raw()->to_snapshot(kind), kAsReference);
 
   return result.raw();
 }
@@ -1677,13 +1655,11 @@
   ASSERT(reader != NULL);
 
   // Allocate ApiError object.
-  ApiError& api_error =
-      ApiError::ZoneHandle(reader->zone(), ApiError::New());
+  ApiError& api_error = ApiError::ZoneHandle(reader->zone(), ApiError::New());
   reader->AddBackRef(object_id, &api_error, kIsDeserialized);
 
   // Set all the object fields.
-  READ_OBJECT_FIELDS(api_error,
-                     api_error.raw()->from(), api_error.raw()->to(),
+  READ_OBJECT_FIELDS(api_error, api_error.raw()->from(), api_error.raw()->to(),
                      kAsReference);
 
   return api_error.raw();
@@ -1728,9 +1704,8 @@
   language_error.set_kind(reader->Read<uint8_t>());
 
   // Set all the object fields.
-  READ_OBJECT_FIELDS(language_error,
-                     language_error.raw()->from(), language_error.raw()->to(),
-                     kAsReference);
+  READ_OBJECT_FIELDS(language_error, language_error.raw()->from(),
+                     language_error.raw()->to(), kAsReference);
 
   return language_error.raw();
 }
@@ -1765,13 +1740,12 @@
                                                     intptr_t tags,
                                                     Snapshot::Kind kind,
                                                     bool as_reference) {
-  UnhandledException& result = UnhandledException::ZoneHandle(
-      reader->zone(), UnhandledException::New());
+  UnhandledException& result =
+      UnhandledException::ZoneHandle(reader->zone(), UnhandledException::New());
   reader->AddBackRef(object_id, &result, kIsDeserialized);
 
   // Set all the object fields.
-  READ_OBJECT_FIELDS(result,
-                     result.raw()->from(), result.raw()->to(),
+  READ_OBJECT_FIELDS(result, result.raw()->from(), result.raw()->to(),
                      kAsReference);
 
   return result.raw();
@@ -1822,8 +1796,7 @@
   // Create an Instance object or get canonical one if it is a canonical
   // constant.
   Instance& obj = Instance::ZoneHandle(reader->zone(), Instance::null());
-  obj ^= Object::Allocate(kInstanceCid,
-                          Instance::InstanceSize(),
+  obj ^= Object::Allocate(kInstanceCid, Instance::InstanceSize(),
                           HEAP_SPACE(kind));
   if (RawObject::IsCanonical(tags)) {
     obj = obj.CheckAndCanonicalize(reader->thread(), NULL);
@@ -1862,8 +1835,8 @@
   // Check if the value could potentially fit in a Smi in our current
   // architecture, if so return the object as a Smi.
   if (Smi::IsValid(value)) {
-    Smi& smi = Smi::ZoneHandle(reader->zone(),
-                               Smi::New(static_cast<intptr_t>(value)));
+    Smi& smi =
+        Smi::ZoneHandle(reader->zone(), Smi::New(static_cast<intptr_t>(value)));
     reader->AddBackRef(object_id, &smi, kIsDeserialized);
     return smi.raw();
   }
@@ -2014,7 +1987,7 @@
 }
 
 
-template<typename StringType, typename CharacterType, typename CallbackType>
+template <typename StringType, typename CharacterType, typename CallbackType>
 void String::ReadFromImpl(SnapshotReader* reader,
                           String* str_obj,
                           intptr_t len,
@@ -2057,8 +2030,8 @@
   intptr_t len = reader->ReadSmiValue();
   String& str_obj = String::ZoneHandle(reader->zone(), String::null());
 
-  String::ReadFromImpl<OneByteString, uint8_t>(
-      reader, &str_obj, len, tags, Symbols::FromLatin1, kind);
+  String::ReadFromImpl<OneByteString, uint8_t>(reader, &str_obj, len, tags,
+                                               Symbols::FromLatin1, kind);
   reader->AddBackRef(object_id, &str_obj, kIsDeserialized);
   return raw(str_obj);
 }
@@ -2074,14 +2047,14 @@
   intptr_t len = reader->ReadSmiValue();
   String& str_obj = String::ZoneHandle(reader->zone(), String::null());
 
-  String::ReadFromImpl<TwoByteString, uint16_t>(
-      reader, &str_obj, len, tags, Symbols::FromUTF16, kind);
+  String::ReadFromImpl<TwoByteString, uint16_t>(reader, &str_obj, len, tags,
+                                                Symbols::FromUTF16, kind);
   reader->AddBackRef(object_id, &str_obj, kIsDeserialized);
   return raw(str_obj);
 }
 
 
-template<typename T>
+template <typename T>
 static void StringWriteTo(SnapshotWriter* writer,
                           intptr_t object_id,
                           Snapshot::Kind kind,
@@ -2119,13 +2092,8 @@
                                intptr_t object_id,
                                Snapshot::Kind kind,
                                bool as_reference) {
-  StringWriteTo(writer,
-                object_id,
-                kind,
-                kOneByteStringCid,
-                writer->GetObjectTags(this),
-                ptr()->length_,
-                ptr()->data());
+  StringWriteTo(writer, object_id, kind, kOneByteStringCid,
+                writer->GetObjectTags(this), ptr()->length_, ptr()->data());
 }
 
 
@@ -2133,13 +2101,8 @@
                                intptr_t object_id,
                                Snapshot::Kind kind,
                                bool as_reference) {
-  StringWriteTo(writer,
-                object_id,
-                kind,
-                kTwoByteStringCid,
-                writer->GetObjectTags(this),
-                ptr()->length_,
-                ptr()->data());
+  StringWriteTo(writer, object_id, kind, kTwoByteStringCid,
+                writer->GetObjectTags(this), ptr()->length_, ptr()->data());
 }
 
 
@@ -2170,12 +2133,8 @@
                                        Snapshot::Kind kind,
                                        bool as_reference) {
   // Serialize as a non-external one byte string.
-  StringWriteTo(writer,
-                object_id,
-                kind,
-                kOneByteStringCid,
-                writer->GetObjectTags(this),
-                ptr()->length_,
+  StringWriteTo(writer, object_id, kind, kOneByteStringCid,
+                writer->GetObjectTags(this), ptr()->length_,
                 ptr()->external_data_->data());
 }
 
@@ -2185,12 +2144,8 @@
                                        Snapshot::Kind kind,
                                        bool as_reference) {
   // Serialize as a non-external two byte string.
-  StringWriteTo(writer,
-                object_id,
-                kind,
-                kTwoByteStringCid,
-                writer->GetObjectTags(this),
-                ptr()->length_,
+  StringWriteTo(writer, object_id, kind, kTwoByteStringCid,
+                writer->GetObjectTags(this), ptr()->length_,
                 ptr()->external_data_->data());
 }
 
@@ -2231,8 +2186,8 @@
     state = kIsNotDeserialized;
   }
   if (array == NULL) {
-    array = &(Array::ZoneHandle(reader->zone(),
-                                Array::New(len, HEAP_SPACE(kind))));
+    array =
+        &(Array::ZoneHandle(reader->zone(), Array::New(len, HEAP_SPACE(kind))));
     reader->AddBackRef(object_id, array, state);
   }
   if (!as_reference) {
@@ -2262,9 +2217,8 @@
     state = kIsNotDeserialized;
   }
   if (array == NULL) {
-    array = &(Array::ZoneHandle(
-        reader->zone(),
-        ImmutableArray::New(len, HEAP_SPACE(kind))));
+    array = &(Array::ZoneHandle(reader->zone(),
+                                ImmutableArray::New(len, HEAP_SPACE(kind))));
     reader->AddBackRef(object_id, array, state);
   }
   if (!as_reference) {
@@ -2283,12 +2237,8 @@
                        Snapshot::Kind kind,
                        bool as_reference) {
   ASSERT(!this->IsCanonical());
-  writer->ArrayWriteTo(object_id,
-                       kArrayCid,
-                       writer->GetObjectTags(this),
-                       ptr()->length_,
-                       ptr()->type_arguments_,
-                       ptr()->data(),
+  writer->ArrayWriteTo(object_id, kArrayCid, writer->GetObjectTags(this),
+                       ptr()->length_, ptr()->type_arguments_, ptr()->data(),
                        as_reference);
 }
 
@@ -2297,13 +2247,9 @@
                                 intptr_t object_id,
                                 Snapshot::Kind kind,
                                 bool as_reference) {
-  writer->ArrayWriteTo(object_id,
-                       kImmutableArrayCid,
-                       writer->GetObjectTags(this),
-                       ptr()->length_,
-                       ptr()->type_arguments_,
-                       ptr()->data(),
-                       as_reference);
+  writer->ArrayWriteTo(object_id, kImmutableArrayCid,
+                       writer->GetObjectTags(this), ptr()->length_,
+                       ptr()->type_arguments_, ptr()->data(), as_reference);
 }
 
 
@@ -2370,8 +2316,8 @@
                                           bool as_reference) {
   ASSERT(reader != NULL);
 
-  LinkedHashMap& map = LinkedHashMap::ZoneHandle(
-      reader->zone(), LinkedHashMap::null());
+  LinkedHashMap& map =
+      LinkedHashMap::ZoneHandle(reader->zone(), LinkedHashMap::null());
   if (kind == Snapshot::kScript) {
     // The immutable maps that seed map literals are not yet VM-internal, so
     // we don't reach this.
@@ -2395,9 +2341,9 @@
   map.SetUsedData(used_data);
 
   // Allocate the data array.
-  intptr_t data_size = Utils::Maximum(
-      Utils::RoundUpToPowerOfTwo(used_data),
-      static_cast<uintptr_t>(LinkedHashMap::kInitialIndexSize));
+  intptr_t data_size =
+      Utils::Maximum(Utils::RoundUpToPowerOfTwo(used_data),
+                     static_cast<uintptr_t>(LinkedHashMap::kInitialIndexSize));
   Array& data = Array::ZoneHandle(reader->zone(),
                                   Array::New(data_size, HEAP_SPACE(kind)));
   map.SetData(data);
@@ -2484,8 +2430,7 @@
   float value3 = reader->Read<float>();
 
   // Create a Float32x4 object.
-  Float32x4& simd = Float32x4::ZoneHandle(reader->zone(),
-                                          Float32x4::null());
+  Float32x4& simd = Float32x4::ZoneHandle(reader->zone(), Float32x4::null());
   simd = Float32x4::New(value0, value1, value2, value3, HEAP_SPACE(kind));
   reader->AddBackRef(object_id, &simd, kIsDeserialized);
   return simd.raw();
@@ -2565,8 +2510,7 @@
   double value1 = reader->Read<double>();
 
   // Create a Float64x2 object.
-  Float64x2& simd = Float64x2::ZoneHandle(reader->zone(),
-                                          Float64x2::null());
+  Float64x2& simd = Float64x2::ZoneHandle(reader->zone(), Float64x2::null());
   simd = Float64x2::New(value0, value1, HEAP_SPACE(kind));
   reader->AddBackRef(object_id, &simd, kIsDeserialized);
   return simd.raw();
@@ -2595,7 +2539,7 @@
 #define TYPED_DATA_READ(setter, type)                                          \
   for (intptr_t i = 0; i < length_in_bytes; i += element_size) {               \
     result.Set##setter(i, reader->Read<type>());                               \
-  }                                                                            \
+  }
 
 
 RawTypedData* TypedData::ReadFrom(SnapshotReader* reader,
@@ -2674,8 +2618,8 @@
   intptr_t cid = RawObject::ClassIdTag::decode(tags);
   intptr_t length = reader->ReadSmiValue();
   uint8_t* data = reinterpret_cast<uint8_t*>(reader->ReadRawPointerValue());
-  ExternalTypedData& obj = ExternalTypedData::ZoneHandle(
-      ExternalTypedData::New(cid, data, length));
+  ExternalTypedData& obj =
+      ExternalTypedData::ZoneHandle(ExternalTypedData::New(cid, data, length));
   reader->AddBackRef(object_id, &obj, kIsDeserialized);
   void* peer = reinterpret_cast<void*>(reader->ReadRawPointerValue());
   Dart_WeakPersistentHandleFinalizer callback =
@@ -2693,7 +2637,7 @@
     for (intptr_t i = 0; i < len; i++) {                                       \
       writer->Write(data[i]);                                                  \
     }                                                                          \
-  }                                                                            \
+  }
 
 
 void RawTypedData::WriteTo(SnapshotWriter* writer,
@@ -2759,14 +2703,14 @@
     for (intptr_t i = 0; i < len; i++) {                                       \
       writer->Write(data[i]);                                                  \
     }                                                                          \
-  }                                                                            \
+  }
 
 
 #define EXT_TYPED_DATA_WRITE(cid, type)                                        \
   writer->WriteIndexedObject(cid);                                             \
   writer->WriteTags(writer->GetObjectTags(this));                              \
   writer->Write<RawObject*>(ptr()->length_);                                   \
-  TYPED_EXT_DATA_WRITE(type)                                                   \
+  TYPED_EXT_DATA_WRITE(type)
 
 
 void RawExternalTypedData::WriteTo(SnapshotWriter* writer,
@@ -2829,8 +2773,8 @@
                                     bool as_reference) {
   uint64_t id = reader->Read<uint64_t>();
 
-  Capability& result = Capability::ZoneHandle(reader->zone(),
-                                              Capability::New(id));
+  Capability& result =
+      Capability::ZoneHandle(reader->zone(), Capability::New(id));
   reader->AddBackRef(object_id, &result, kIsDeserialized);
   return result.raw();
 }
@@ -2887,8 +2831,7 @@
   uint64_t origin_id = reader->Read<uint64_t>();
 
   SendPort& result =
-      SendPort::ZoneHandle(reader->zone(),
-                           SendPort::New(id, origin_id));
+      SendPort::ZoneHandle(reader->zone(), SendPort::New(id, origin_id));
   reader->AddBackRef(object_id, &result, kIsDeserialized);
   return result.raw();
 }
@@ -2949,19 +2892,14 @@
   regex.set_pattern(*reader->StringHandle());
   regex.StoreNonPointer(&regex.raw_ptr()->num_registers_,
                         reader->Read<int32_t>());
-  regex.StoreNonPointer(&regex.raw_ptr()->type_flags_,
-                        reader->Read<int8_t>());
+  regex.StoreNonPointer(&regex.raw_ptr()->type_flags_, reader->Read<int8_t>());
 
-  // TODO(18854): Need to implement a way of recreating the irrexp functions.
   const Function& no_function = Function::Handle(reader->zone());
-  regex.set_function(kOneByteStringCid, no_function);
-  regex.set_function(kTwoByteStringCid, no_function);
-  regex.set_function(kExternalOneByteStringCid, no_function);
-  regex.set_function(kExternalTwoByteStringCid, no_function);
-
-  const TypedData& no_bytecode = TypedData::Handle(reader->zone());
-  regex.set_bytecode(true, no_bytecode);
-  regex.set_bytecode(false, no_bytecode);
+  for (intptr_t cid = kOneByteStringCid; cid <= kExternalTwoByteStringCid;
+       cid++) {
+    regex.set_function(cid, /*sticky=*/false, no_function);
+    regex.set_function(cid, /*sticky=*/true, no_function);
+  }
 
   return regex.raw();
 }
@@ -2996,14 +2934,13 @@
   ASSERT(reader != NULL);
 
   // Allocate the weak property object.
-  WeakProperty& weak_property = WeakProperty::ZoneHandle(reader->zone(),
-                                                         WeakProperty::New());
+  WeakProperty& weak_property =
+      WeakProperty::ZoneHandle(reader->zone(), WeakProperty::New());
   reader->AddBackRef(object_id, &weak_property, kIsDeserialized);
 
   // Set all the object fields.
-  READ_OBJECT_FIELDS(weak_property,
-                     weak_property.raw()->from(), weak_property.raw()->to(),
-                     kAsReference);
+  READ_OBJECT_FIELDS(weak_property, weak_property.raw()->from(),
+                     weak_property.raw()->to(), kAsReference);
 
   return weak_property.raw();
 }
diff --git a/runtime/vm/redundancy_elimination.cc b/runtime/vm/redundancy_elimination.cc
index f7bc9b7..e8ffd2c 100644
--- a/runtime/vm/redundancy_elimination.cc
+++ b/runtime/vm/redundancy_elimination.cc
@@ -16,8 +16,10 @@
 
 DEFINE_FLAG(bool, dead_store_elimination, true, "Eliminate dead stores");
 DEFINE_FLAG(bool, load_cse, true, "Use redundant load elimination.");
-DEFINE_FLAG(bool, trace_load_optimization, false,
-    "Print live sets for load optimization pass.");
+DEFINE_FLAG(bool,
+            trace_load_optimization,
+            false,
+            "Print live sets for load optimization pass.");
 
 // Quick access to the current zone.
 #define Z (zone())
@@ -31,12 +33,11 @@
   // forwarding pass via Alias structure.
   COMPILE_ASSERT(EffectSet::kLastEffect == 1);
 
-  CSEInstructionMap() : independent_(), dependent_() { }
+  CSEInstructionMap() : independent_(), dependent_() {}
   explicit CSEInstructionMap(const CSEInstructionMap& other)
       : ValueObject(),
         independent_(other.independent_),
-        dependent_(other.dependent_) {
-  }
+        dependent_(other.dependent_) {}
 
   void RemoveAffected(EffectSet effects) {
     if (!effects.IsNone()) {
@@ -48,12 +49,10 @@
     return GetMapFor(other)->LookupValue(other);
   }
 
-  void Insert(Instruction* instr) {
-    return GetMapFor(instr)->Insert(instr);
-  }
+  void Insert(Instruction* instr) { return GetMapFor(instr)->Insert(instr); }
 
  private:
-  typedef DirectChainedHashMap<PointerKeyValueTrait<Instruction> >  Map;
+  typedef DirectChainedHashMap<PointerKeyValueTrait<Instruction> > Map;
 
   Map* GetMapFor(Instruction* instr) {
     return instr->Dependencies().IsNone() ? &independent_ : &dependent_;
@@ -178,16 +177,12 @@
         flags_(other.flags_),
         instance_(other.instance_),
         raw_selector_(other.raw_selector_),
-        id_(other.id_) {
-  }
+        id_(other.id_) {}
 
   // Construct a place from instruction if instruction accesses any place.
   // Otherwise constructs kNone place.
   Place(Instruction* instr, bool* is_load, bool* is_store)
-      : flags_(0),
-        instance_(NULL),
-        raw_selector_(0),
-        id_(0) {
+      : flags_(0), instance_(NULL), raw_selector_(0), id_(0) {
     switch (instr->tag()) {
       case Instruction::kLoadField: {
         LoadFieldInstr* load_field = instr->AsLoadField();
@@ -205,8 +200,7 @@
       }
 
       case Instruction::kStoreInstanceField: {
-        StoreInstanceFieldInstr* store =
-            instr->AsStoreInstanceField();
+        StoreInstanceFieldInstr* store = instr->AsStoreInstanceField();
         set_representation(store->RequiredInputRepresentation(
             StoreInstanceFieldInstr::kValuePos));
         instance_ = store->instance()->definition()->OriginalDefinition();
@@ -230,8 +224,9 @@
 
       case Instruction::kStoreStaticField:
         set_kind(kField);
-        set_representation(instr->AsStoreStaticField()->
-            RequiredInputRepresentation(StoreStaticFieldInstr::kValuePos));
+        set_representation(
+            instr->AsStoreStaticField()->RequiredInputRepresentation(
+                StoreStaticFieldInstr::kValuePos));
         field_ = &instr->AsStoreStaticField()->field();
         *is_store = true;
         break;
@@ -241,20 +236,18 @@
         set_representation(load_indexed->representation());
         instance_ = load_indexed->array()->definition()->OriginalDefinition();
         SetIndex(load_indexed->index()->definition(),
-                 load_indexed->index_scale(),
-                 load_indexed->class_id());
+                 load_indexed->index_scale(), load_indexed->class_id());
         *is_load = true;
         break;
       }
 
       case Instruction::kStoreIndexed: {
         StoreIndexedInstr* store_indexed = instr->AsStoreIndexed();
-        set_representation(store_indexed->
-            RequiredInputRepresentation(StoreIndexedInstr::kValuePos));
+        set_representation(store_indexed->RequiredInputRepresentation(
+            StoreIndexedInstr::kValuePos));
         instance_ = store_indexed->array()->definition()->OriginalDefinition();
         SetIndex(store_indexed->index()->definition(),
-                 store_indexed->index_scale(),
-                 store_indexed->class_id());
+                 store_indexed->index_scale(), store_indexed->class_id());
         *is_store = true;
         break;
       }
@@ -265,12 +258,10 @@
   }
 
   // Create object representing *[*] alias.
-  static Place* CreateAnyInstanceAnyIndexAlias(Zone* zone,
-                                               intptr_t id) {
-    return Wrap(zone, Place(
-        EncodeFlags(kIndexed, kNoRepresentation, kNoSize),
-        NULL,
-        0), id);
+  static Place* CreateAnyInstanceAnyIndexAlias(Zone* zone, intptr_t id) {
+    return Wrap(
+        zone, Place(EncodeFlags(kIndexed, kNoRepresentation, kNoSize), NULL, 0),
+        id);
   }
 
   // Return least generic alias for this place. Given that aliases are
@@ -321,8 +312,7 @@
   // Given alias X[C] or *[C] return X[*] and *[*] respectively.
   Place CopyWithoutIndex() const {
     ASSERT(kind() == kConstantIndexed);
-    return Place(EncodeFlags(kIndexed, kNoRepresentation, kNoSize),
-                 instance_,
+    return Place(EncodeFlags(kIndexed, kNoRepresentation, kNoSize), instance_,
                  0);
   }
 
@@ -337,8 +327,7 @@
     ASSERT(kind() == kConstantIndexed);
     ASSERT(element_size() != kNoSize);
     ASSERT(element_size() < to);
-    return Place(ElementSizeBits::update(to, flags_),
-                 instance_,
+    return Place(ElementSizeBits::update(to, flags_), instance_,
                  RoundByteOffset(to, index_constant_));
   }
 
@@ -376,9 +365,7 @@
     return index_;
   }
 
-  ElementSize element_size() const {
-    return ElementSizeBits::decode(flags_);
-  }
+  ElementSize element_size() const { return ElementSizeBits::decode(flags_); }
 
   intptr_t index_constant() const {
     ASSERT(kind() == kConstantIndexed);
@@ -389,8 +376,8 @@
     if (def == NULL) {
       return "*";
     } else {
-      return Thread::Current()->zone()->PrintToString(
-            "v%" Pd, def->ssa_temp_index());
+      return Thread::Current()->zone()->PrintToString("v%" Pd,
+                                                      def->ssa_temp_index());
     }
   }
 
@@ -402,8 +389,7 @@
       case kField: {
         const char* field_name = String::Handle(field().name()).ToCString();
         if (field().is_static()) {
-          return Thread::Current()->zone()->PrintToString(
-              "<%s>", field_name);
+          return Thread::Current()->zone()->PrintToString("<%s>", field_name);
         } else {
           return Thread::Current()->zone()->PrintToString(
               "<%s.%s>", DefinitionName(instance()), field_name);
@@ -412,28 +398,20 @@
 
       case kVMField:
         return Thread::Current()->zone()->PrintToString(
-            "<%s.@%" Pd ">",
-            DefinitionName(instance()),
-            offset_in_bytes());
+            "<%s.@%" Pd ">", DefinitionName(instance()), offset_in_bytes());
 
       case kIndexed:
         return Thread::Current()->zone()->PrintToString(
-            "<%s[%s]>",
-            DefinitionName(instance()),
-            DefinitionName(index()));
+            "<%s[%s]>", DefinitionName(instance()), DefinitionName(index()));
 
       case kConstantIndexed:
         if (element_size() == kNoSize) {
           return Thread::Current()->zone()->PrintToString(
-              "<%s[%" Pd "]>",
-              DefinitionName(instance()),
-              index_constant());
+              "<%s[%" Pd "]>", DefinitionName(instance()), index_constant());
         } else {
           return Thread::Current()->zone()->PrintToString(
-              "<%s[%" Pd "|%" Pd "]>",
-              DefinitionName(instance()),
-              index_constant(),
-              ElementSizeMultiplier(element_size()));
+              "<%s[%" Pd "|%" Pd "]>", DefinitionName(instance()),
+              index_constant(), ElementSizeMultiplier(element_size()));
         }
     }
     UNREACHABLE();
@@ -444,20 +422,18 @@
   // Handle static finals as non-final with precompilation because
   // they may be reset to uninitialized after compilation.
   bool IsImmutableField() const {
-    return (kind() == kField)
-        && field().is_final()
-        && (!field().is_static() || !FLAG_fields_may_be_reset);
+    return (kind() == kField) && field().is_final() &&
+           (!field().is_static() || !FLAG_fields_may_be_reset);
   }
 
   intptr_t Hashcode() const {
     return (flags_ * 63 + reinterpret_cast<intptr_t>(instance_)) * 31 +
-        FieldHashcode();
+           FieldHashcode();
   }
 
   bool Equals(const Place* other) const {
-    return (flags_ == other->flags_) &&
-        (instance_ == other->instance_) &&
-        SameField(other);
+    return (flags_ == other->flags_) && (instance_ == other->instance_) &&
+           SameField(other);
   }
 
   // Create a zone allocated copy of this place and assign given id to it.
@@ -465,25 +441,20 @@
 
   static bool IsAllocation(Definition* defn) {
     return (defn != NULL) &&
-        (defn->IsAllocateObject() ||
-         defn->IsCreateArray() ||
-         defn->IsAllocateUninitializedContext() ||
-         (defn->IsStaticCall() &&
-          defn->AsStaticCall()->IsRecognizedFactory()));
+           (defn->IsAllocateObject() || defn->IsCreateArray() ||
+            defn->IsAllocateUninitializedContext() ||
+            (defn->IsStaticCall() &&
+             defn->AsStaticCall()->IsRecognizedFactory()));
   }
 
  private:
   Place(uword flags, Definition* instance, intptr_t selector)
-      : flags_(flags),
-        instance_(instance),
-        raw_selector_(selector),
-        id_(0) {
-  }
+      : flags_(flags), instance_(instance), raw_selector_(selector), id_(0) {}
 
   bool SameField(const Place* other) const {
-    return (kind() == kField) ?
-        (field().Original() == other->field().Original()) :
-        (offset_in_bytes_ == other->offset_in_bytes_);
+    return (kind() == kField)
+               ? (field().Original() == other->field().Original())
+               : (offset_in_bytes_ == other->offset_in_bytes_);
   }
 
   intptr_t FieldHashcode() const {
@@ -495,9 +466,7 @@
     flags_ = RepresentationBits::update(rep, flags_);
   }
 
-  void set_kind(Kind kind) {
-    flags_ = KindBits::update(kind, flags_);
-  }
+  void set_kind(Kind kind) { flags_ = KindBits::update(kind, flags_); }
 
   void set_element_size(ElementSize scale) {
     flags_ = ElementSizeBits::update(scale, flags_);
@@ -539,9 +508,8 @@
 
   static uword EncodeFlags(Kind kind, Representation rep, ElementSize scale) {
     ASSERT((kind == kConstantIndexed) || (scale == kNoSize));
-    return KindBits::encode(kind) |
-        RepresentationBits::encode(rep) |
-        ElementSizeBits::encode(scale);
+    return KindBits::encode(kind) | RepresentationBits::encode(rep) |
+           ElementSizeBits::encode(scale);
   }
 
   static ElementSize ElementSizeFor(intptr_t class_id) {
@@ -597,10 +565,10 @@
   }
 
   class KindBits : public BitField<uword, Kind, 0, 3> {};
-  class RepresentationBits :
-      public BitField<uword, Representation, KindBits::kNextBit, 11> {};
-  class ElementSizeBits :
-      public BitField<uword, ElementSize, RepresentationBits::kNextBit, 3> {};
+  class RepresentationBits
+      : public BitField<uword, Representation, KindBits::kNextBit, 11> {};
+  class ElementSizeBits
+      : public BitField<uword, ElementSize, RepresentationBits::kNextBit, 3> {};
 
   uword flags_;
   Definition* instance_;
@@ -618,7 +586,7 @@
 
 class ZonePlace : public ZoneAllocated {
  public:
-  explicit ZonePlace(const Place& place) : place_(place) { }
+  explicit ZonePlace(const Place& place) : place_(place) {}
 
   Place* place() { return &place_; }
 
@@ -628,7 +596,7 @@
 
 
 Place* Place::Wrap(Zone* zone, const Place& place, intptr_t id) {
-  Place* wrapped = (new(zone) ZonePlace(place))->place();
+  Place* wrapped = (new (zone) ZonePlace(place))->place();
   wrapped->id_ = id;
   return wrapped;
 }
@@ -641,14 +609,16 @@
   // Record a move from the place with id |from| to the place with id |to| at
   // the given block.
   void CreateOutgoingMove(Zone* zone,
-                          BlockEntryInstr* block, intptr_t from, intptr_t to) {
+                          BlockEntryInstr* block,
+                          intptr_t from,
+                          intptr_t to) {
     const intptr_t block_num = block->preorder_number();
     while (moves_.length() <= block_num) {
       moves_.Add(NULL);
     }
 
     if (moves_[block_num] == NULL) {
-      moves_[block_num] = new(zone) ZoneGrowableArray<Move>(5);
+      moves_[block_num] = new (zone) ZoneGrowableArray<Move>(5);
     }
 
     moves_[block_num]->Add(Move(from, to));
@@ -656,7 +626,7 @@
 
   class Move {
    public:
-    Move(intptr_t from, intptr_t to) : from_(from), to_(to) { }
+    Move(intptr_t from, intptr_t to) : from_(from), to_(to) {}
 
     intptr_t from() const { return from_; }
     intptr_t to() const { return to_; }
@@ -670,12 +640,11 @@
 
   MovesList GetOutgoingMoves(BlockEntryInstr* block) const {
     const intptr_t block_num = block->preorder_number();
-    return (block_num < moves_.length()) ?
-        moves_[block_num] : NULL;
+    return (block_num < moves_.length()) ? moves_[block_num] : NULL;
   }
 
  private:
-  GrowableArray<ZoneGrowableArray<Move>* > moves_;
+  GrowableArray<ZoneGrowableArray<Move>*> moves_;
 };
 
 
@@ -697,9 +666,9 @@
         typed_data_access_sizes_(),
         representatives_(),
         killed_(),
-        aliased_by_effects_(new(zone) BitVector(zone, places->length())) {
-    InsertAlias(Place::CreateAnyInstanceAnyIndexAlias(zone_,
-        kAnyInstanceAnyIndexAlias));
+        aliased_by_effects_(new (zone) BitVector(zone, places->length())) {
+    InsertAlias(Place::CreateAnyInstanceAnyIndexAlias(
+        zone_, kAnyInstanceAnyIndexAlias));
     for (intptr_t i = 0; i < places_.length(); i++) {
       AddRepresentative(places_[i]);
     }
@@ -720,9 +689,7 @@
 
   BitVector* aliased_by_effects() const { return aliased_by_effects_; }
 
-  const ZoneGrowableArray<Place*>& places() const {
-    return places_;
-  }
+  const ZoneGrowableArray<Place*>& places() const { return places_; }
 
   Place* LookupCanonical(Place* place) const {
     return places_map_->LookupValue(place);
@@ -730,9 +697,7 @@
 
   void PrintSet(BitVector* set) {
     bool comma = false;
-    for (BitVector::Iterator it(set);
-         !it.Done();
-         it.Advance()) {
+    for (BitVector::Iterator it(set); !it.Done(); it.Advance()) {
       if (comma) {
         THR_Print(", ");
       }
@@ -763,9 +728,7 @@
     return !alloc->Identity().IsNotAliased();
   }
 
-  enum {
-    kNoAlias = 0
-  };
+  enum { kNoAlias = 0 };
 
  private:
   enum {
@@ -795,13 +758,13 @@
       // killed sets computation.
       if (alias->kind() == Place::kConstantIndexed) {
         if (CanBeAliased(alias->instance())) {
-          EnsureSet(&representatives_, kAnyConstantIndexedAlias)->
-              Add(place->id());
+          EnsureSet(&representatives_, kAnyConstantIndexedAlias)
+              ->Add(place->id());
         }
 
         if (alias->instance() == NULL) {
-          EnsureSet(&representatives_, kUnknownInstanceConstantIndexedAlias)->
-              Add(place->id());
+          EnsureSet(&representatives_, kUnknownInstanceConstantIndexedAlias)
+              ->Add(place->id());
         }
 
         // Collect all element sizes used to access TypedData arrays in
@@ -812,8 +775,8 @@
         }
       } else if ((alias->kind() == Place::kIndexed) &&
                  CanBeAliased(place->instance())) {
-        EnsureSet(&representatives_, kAnyAllocationIndexedAlias)->
-            Add(place->id());
+        EnsureSet(&representatives_, kAnyAllocationIndexedAlias)
+            ->Add(place->id());
       }
 
       if (!IsIndependentFromEffects(place)) {
@@ -853,8 +816,7 @@
   const Place* CanonicalizeAlias(const Place& alias) {
     const Place* canonical = aliases_map_.LookupValue(&alias);
     if (canonical == NULL) {
-      canonical = Place::Wrap(zone_,
-                              alias,
+      canonical = Place::Wrap(zone_, alias,
                               kAnyInstanceAnyIndexAlias + aliases_.length());
       InsertAlias(canonical);
     }
@@ -866,15 +828,14 @@
     return (alias < representatives_.length()) ? representatives_[alias] : NULL;
   }
 
-  BitVector* EnsureSet(GrowableArray<BitVector*>* sets,
-                       intptr_t alias) {
+  BitVector* EnsureSet(GrowableArray<BitVector*>* sets, intptr_t alias) {
     while (sets->length() <= alias) {
       sets->Add(NULL);
     }
 
     BitVector* set = (*sets)[alias];
     if (set == NULL) {
-      (*sets)[alias] = set = new(zone_) BitVector(zone_, max_place_id());
+      (*sets)[alias] = set = new (zone_) BitVector(zone_, max_place_id());
     }
     return set;
   }
@@ -941,8 +902,7 @@
           // (if there are any) would update kill set for this alias when they
           // are visited.
           for (intptr_t i = static_cast<intptr_t>(alias->element_size()) + 1;
-               i <= Place::kLargestElementSize;
-               i++) {
+               i <= Place::kLargestElementSize; i++) {
             // Skip element sizes that a guaranteed to have no representatives.
             if (!typed_data_access_sizes_.Contains(alias->element_size())) {
               continue;
@@ -1010,8 +970,8 @@
     }
 
     return ((place->kind() == Place::kField) ||
-         (place->kind() == Place::kVMField)) &&
-        !CanBeAliased(place->instance());
+            (place->kind() == Place::kVMField)) &&
+           !CanBeAliased(place->instance());
   }
 
   // Returns true if there are direct loads from the given place.
@@ -1019,12 +979,10 @@
     ASSERT((place->kind() == Place::kField) ||
            (place->kind() == Place::kVMField));
 
-    for (Value* use = defn->input_use_list();
-         use != NULL;
+    for (Value* use = defn->input_use_list(); use != NULL;
          use = use->next_use()) {
       Instruction* instr = use->instruction();
-      if ((instr->IsRedefinition() ||
-           instr->IsAssertAssignable()) &&
+      if ((instr->IsRedefinition() || instr->IsAssertAssignable()) &&
           HasLoadsFromPlace(instr->AsDefinition(), place)) {
         return true;
       }
@@ -1042,21 +1000,21 @@
   // Check if any use of the definition can create an alias.
   // Can add more objects into aliasing_worklist_.
   bool AnyUseCreatesAlias(Definition* defn) {
-    for (Value* use = defn->input_use_list();
-         use != NULL;
+    for (Value* use = defn->input_use_list(); use != NULL;
          use = use->next_use()) {
       Instruction* instr = use->instruction();
-      if (instr->IsPushArgument() ||
-          (instr->IsStoreIndexed()
-           && (use->use_index() == StoreIndexedInstr::kValuePos)) ||
-          instr->IsStoreStaticField() ||
-          instr->IsPhi()) {
+      if (instr->IsPushArgument() || instr->IsCheckedSmiOp() ||
+          instr->IsCheckedSmiComparison() ||
+          (instr->IsStoreIndexed() &&
+           (use->use_index() == StoreIndexedInstr::kValuePos)) ||
+          instr->IsStoreStaticField() || instr->IsPhi()) {
         return true;
       } else if ((instr->IsAssertAssignable() || instr->IsRedefinition()) &&
                  AnyUseCreatesAlias(instr->AsDefinition())) {
         return true;
-      } else if ((instr->IsStoreInstanceField()
-           && (use->use_index() != StoreInstanceFieldInstr::kInstancePos))) {
+      } else if ((instr->IsStoreInstanceField() &&
+                  (use->use_index() !=
+                   StoreInstanceFieldInstr::kInstancePos))) {
         ASSERT(use->use_index() == StoreInstanceFieldInstr::kValuePos);
         // If we store this value into an object that is not aliased itself
         // and we never load again then the store does not create an alias.
@@ -1088,8 +1046,7 @@
   // Mark any value stored into the given object as potentially aliased.
   void MarkStoredValuesEscaping(Definition* defn) {
     // Find all stores into this object.
-    for (Value* use = defn->input_use_list();
-         use != NULL;
+    for (Value* use = defn->input_use_list(); use != NULL;
          use = use->next_use()) {
       if (use->instruction()->IsRedefinition() ||
           use->instruction()->IsAssertAssignable()) {
@@ -1203,8 +1160,7 @@
 static bool IsPhiDependentPlace(Place* place) {
   return ((place->kind() == Place::kField) ||
           (place->kind() == Place::kVMField)) &&
-        (place->instance() != NULL) &&
-        place->instance()->IsPhi();
+         (place->instance() != NULL) && place->instance()->IsPhi();
 }
 
 
@@ -1217,7 +1173,7 @@
     ZoneGrowableArray<Place*>* places) {
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
-  PhiPlaceMoves* phi_moves = new(zone) PhiPlaceMoves();
+  PhiPlaceMoves* phi_moves = new (zone) PhiPlaceMoves();
 
   for (intptr_t i = 0; i < places->length(); i++) {
     Place* place = (*places)[i];
@@ -1240,15 +1196,12 @@
           map->Insert(result);
           places->Add(result);
           if (FLAG_trace_optimization) {
-            THR_Print("  adding place %s as %" Pd "\n",
-                      result->ToCString(),
+            THR_Print("  adding place %s as %" Pd "\n", result->ToCString(),
                       result->id());
           }
         }
-        phi_moves->CreateOutgoingMove(zone,
-                                      block->PredecessorAt(j),
-                                      result->id(),
-                                      place->id());
+        phi_moves->CreateOutgoingMove(zone, block->PredecessorAt(j),
+                                      result->id(), place->id());
       }
     }
   }
@@ -1257,10 +1210,7 @@
 }
 
 
-enum CSEMode {
-  kOptimizeLoads,
-  kOptimizeStores
-};
+enum CSEMode { kOptimizeLoads, kOptimizeStores };
 
 
 static AliasedSet* NumberPlaces(
@@ -1270,18 +1220,15 @@
   // Loads representing different expression ids will be collected and
   // used to build per offset kill sets.
   Zone* zone = graph->zone();
-  ZoneGrowableArray<Place*>* places =
-      new(zone) ZoneGrowableArray<Place*>(10);
+  ZoneGrowableArray<Place*>* places = new (zone) ZoneGrowableArray<Place*>(10);
 
   bool has_loads = false;
   bool has_stores = false;
-  for (BlockIterator it = graph->reverse_postorder_iterator();
-       !it.Done();
+  for (BlockIterator it = graph->reverse_postorder_iterator(); !it.Done();
        it.Advance()) {
     BlockEntryInstr* block = it.Current();
 
-    for (ForwardInstructionIterator instr_it(block);
-         !instr_it.Done();
+    for (ForwardInstructionIterator instr_it(block); !instr_it.Done();
          instr_it.Advance()) {
       Instruction* instr = instr_it.Current();
       Place place(instr, &has_loads, &has_stores);
@@ -1296,8 +1243,7 @@
         places->Add(result);
 
         if (FLAG_trace_optimization) {
-          THR_Print("numbering %s as %" Pd "\n",
-                    result->ToCString(),
+          THR_Print("numbering %s as %" Pd "\n", result->ToCString(),
                     result->id());
         }
       }
@@ -1316,26 +1262,23 @@
   PhiPlaceMoves* phi_moves = ComputePhiMoves(map, places);
 
   // Build aliasing sets mapping aliases to loads.
-  return new(zone) AliasedSet(zone, map, places, phi_moves);
+  return new (zone) AliasedSet(zone, map, places, phi_moves);
 }
 
 
 // Load instructions handled by load elimination.
 static bool IsLoadEliminationCandidate(Instruction* instr) {
-  return instr->IsLoadField()
-      || instr->IsLoadIndexed()
-      || instr->IsLoadStaticField();
+  return instr->IsLoadField() || instr->IsLoadIndexed() ||
+         instr->IsLoadStaticField();
 }
 
 
 static bool IsLoopInvariantLoad(ZoneGrowableArray<BitVector*>* sets,
                                 intptr_t loop_header_index,
                                 Instruction* instr) {
-  return IsLoadEliminationCandidate(instr) &&
-      (sets != NULL) &&
-      instr->HasPlaceId() &&
-      ((*sets)[loop_header_index] != NULL) &&
-      (*sets)[loop_header_index]->Contains(instr->place_id());
+  return IsLoadEliminationCandidate(instr) && (sets != NULL) &&
+         instr->HasPlaceId() && ((*sets)[loop_header_index] != NULL) &&
+         (*sets)[loop_header_index]->Contains(instr->place_id());
 }
 
 
@@ -1360,10 +1303,8 @@
   }
   if (FLAG_trace_optimization) {
     THR_Print("Hoisting instruction %s:%" Pd " from B%" Pd " to B%" Pd "\n",
-              current->DebugName(),
-              current->GetDeoptId(),
-              current->GetBlock()->block_id(),
-              pre_header->block_id());
+              current->DebugName(), current->GetDeoptId(),
+              current->GetBlock()->block_id(), pre_header->block_id());
   }
   // Move the instruction out of the loop.
   current->RemoveEnvironment();
@@ -1410,8 +1351,7 @@
   }
 
   CheckSmiInstr* check = NULL;
-  for (Value* use = phi->input_use_list();
-       (use != NULL) && (check == NULL);
+  for (Value* use = phi->input_use_list(); (use != NULL) && (check == NULL);
        use = use->next_use()) {
     check = use->instruction()->AsCheckSmi();
   }
@@ -1475,13 +1415,10 @@
     BlockEntryInstr* pre_header = header->ImmediateDominator();
     if (pre_header == NULL) continue;
 
-    for (BitVector::Iterator loop_it(header->loop_info());
-         !loop_it.Done();
+    for (BitVector::Iterator loop_it(header->loop_info()); !loop_it.Done();
          loop_it.Advance()) {
       BlockEntryInstr* block = flow_graph()->preorder()[loop_it.Current()];
-      for (ForwardInstructionIterator it(block);
-           !it.Done();
-           it.Advance()) {
+      for (ForwardInstructionIterator it(block); !it.Done(); it.Advance()) {
         Instruction* current = it.Current();
         if ((current->AllowsCSE() &&
              block_effects->CanBeMovedTo(current, pre_header)) ||
@@ -1494,8 +1431,7 @@
               break;
             }
           }
-          if (inputs_loop_invariant &&
-              !current->IsAssertAssignable() &&
+          if (inputs_loop_invariant && !current->IsAssertAssignable() &&
               !current->IsAssertBoolean()) {
             // TODO(fschneider): Enable hoisting of Assert-instructions
             // if it safe to do.
@@ -1527,18 +1463,16 @@
     const intptr_t num_blocks = graph_->preorder().length();
     for (intptr_t i = 0; i < num_blocks; i++) {
       out_.Add(NULL);
-      gen_.Add(new(Z) BitVector(Z, aliased_set_->max_place_id()));
-      kill_.Add(new(Z) BitVector(Z, aliased_set_->max_place_id()));
-      in_.Add(new(Z) BitVector(Z, aliased_set_->max_place_id()));
+      gen_.Add(new (Z) BitVector(Z, aliased_set_->max_place_id()));
+      kill_.Add(new (Z) BitVector(Z, aliased_set_->max_place_id()));
+      in_.Add(new (Z) BitVector(Z, aliased_set_->max_place_id()));
 
       exposed_values_.Add(NULL);
       out_values_.Add(NULL);
     }
   }
 
-  ~LoadOptimizer() {
-    aliased_set_->RollbackAliasedIdentites();
-  }
+  ~LoadOptimizer() { aliased_set_->RollbackAliasedIdentites(); }
 
   Isolate* isolate() const { return graph_->isolate(); }
   Zone* zone() const { return graph_->zone(); }
@@ -1551,9 +1485,8 @@
 
     // For now, bail out for large functions to avoid OOM situations.
     // TODO(fschneider): Fix the memory consumption issue.
-    intptr_t function_length =
-        graph->function().end_token_pos().Pos() -
-        graph->function().token_pos().Pos();
+    intptr_t function_length = graph->function().end_token_pos().Pos() -
+                               graph->function().token_pos().Pos();
     if (function_length >= FLAG_huge_method_cutoff_in_tokens) {
       return false;
     }
@@ -1599,8 +1532,7 @@
   // instructions.
   void ComputeInitialSets() {
     for (BlockIterator block_it = graph_->reverse_postorder_iterator();
-         !block_it.Done();
-         block_it.Advance()) {
+         !block_it.Done(); block_it.Advance()) {
       BlockEntryInstr* block = block_it.Current();
       const intptr_t preorder_number = block->preorder_number();
 
@@ -1610,8 +1542,7 @@
       ZoneGrowableArray<Definition*>* exposed_values = NULL;
       ZoneGrowableArray<Definition*>* out_values = NULL;
 
-      for (ForwardInstructionIterator instr_it(block);
-           !instr_it.Done();
+      for (ForwardInstructionIterator instr_it(block); !instr_it.Done();
            instr_it.Advance()) {
         Instruction* instr = instr_it.Current();
 
@@ -1659,8 +1590,7 @@
           // to loads because other array stores (intXX/uintXX/float32)
           // may implicitly convert the value stored.
           StoreIndexedInstr* array_store = instr->AsStoreIndexed();
-          if ((array_store == NULL) ||
-              (array_store->class_id() == kArrayCid) ||
+          if ((array_store == NULL) || (array_store->class_id() == kArrayCid) ||
               (array_store->class_id() == kTypedDataFloat64ArrayCid) ||
               (array_store->class_id() == kTypedDataFloat32ArrayCid) ||
               (array_store->class_id() == kTypedDataFloat32x4ArrayCid)) {
@@ -1682,7 +1612,7 @@
           // load forwarding.
           const Place* canonical = aliased_set_->LookupCanonical(&place);
           if ((canonical != NULL) &&
-            (canonical->id() != instr->AsDefinition()->place_id())) {
+              (canonical->id() != instr->AsDefinition()->place_id())) {
             instr->AsDefinition()->set_place_id(canonical->id());
           }
         }
@@ -1712,8 +1642,7 @@
         // constructor invocation.
         AllocateObjectInstr* alloc = instr->AsAllocateObject();
         if ((alloc != NULL)) {
-          for (Value* use = alloc->input_use_list();
-               use != NULL;
+          for (Value* use = alloc->input_use_list(); use != NULL;
                use = use->next_use()) {
             // Look for all immediate loads from this object.
             if (use->use_index() != 0) {
@@ -1728,8 +1657,7 @@
               // Forward for all fields for non-escaping objects and only
               // non-final fields and type arguments for escaping ones.
               if (aliased_set_->CanBeAliased(alloc) &&
-                  (load->field() != NULL) &&
-                  load->field()->is_final()) {
+                  (load->field() != NULL) && load->field()->is_final()) {
                 continue;
               }
 
@@ -1763,8 +1691,7 @@
           graph_->EnsureSSATempIndex(defn, replacement);
           if (FLAG_trace_optimization) {
             THR_Print("Replacing load v%" Pd " with v%" Pd "\n",
-                      defn->ssa_temp_index(),
-                      replacement->ssa_temp_index());
+                      defn->ssa_temp_index(), replacement->ssa_temp_index());
           }
 
           defn->ReplaceUsesWith(replacement);
@@ -1777,7 +1704,7 @@
           // the block entry.
           if (exposed_values == NULL) {
             static const intptr_t kMaxExposedValuesInitialSize = 5;
-            exposed_values = new(Z) ZoneGrowableArray<Definition*>(
+            exposed_values = new (Z) ZoneGrowableArray<Definition*>(
                 Utils::Minimum(kMaxExposedValuesInitialSize,
                                aliased_set_->max_place_id()));
           }
@@ -1825,18 +1752,17 @@
   // Compute OUT sets by propagating them iteratively until fix point
   // is reached.
   void ComputeOutSets() {
-    BitVector* temp = new(Z) BitVector(Z, aliased_set_->max_place_id());
+    BitVector* temp = new (Z) BitVector(Z, aliased_set_->max_place_id());
     BitVector* forwarded_loads =
-        new(Z) BitVector(Z, aliased_set_->max_place_id());
-    BitVector* temp_out = new(Z) BitVector(Z, aliased_set_->max_place_id());
+        new (Z) BitVector(Z, aliased_set_->max_place_id());
+    BitVector* temp_out = new (Z) BitVector(Z, aliased_set_->max_place_id());
 
     bool changed = true;
     while (changed) {
       changed = false;
 
       for (BlockIterator block_it = graph_->reverse_postorder_iterator();
-           !block_it.Done();
-           block_it.Advance()) {
+           !block_it.Done(); block_it.Advance()) {
         BlockEntryInstr* block = block_it.Current();
 
         const intptr_t preorder_number = block->preorder_number();
@@ -1880,7 +1806,7 @@
           if ((block_out == NULL) || !block_out->Equals(*temp)) {
             if (block_out == NULL) {
               block_out = out_[preorder_number] =
-                  new(Z) BitVector(Z, aliased_set_->max_place_id());
+                  new (Z) BitVector(Z, aliased_set_->max_place_id());
             }
             block_out->CopyFrom(temp);
             changed = true;
@@ -1903,8 +1829,7 @@
     ZoneGrowableArray<Definition*>* temp_forwarded_values = NULL;
 
     for (BlockIterator block_it = graph_->reverse_postorder_iterator();
-         !block_it.Done();
-         block_it.Advance()) {
+         !block_it.Done(); block_it.Advance()) {
       BlockEntryInstr* block = block_it.Current();
 
       const bool can_merge_eagerly = CanMergeEagerly(block);
@@ -1917,8 +1842,7 @@
 
       // If OUT set has changed then we have new values available out of
       // the block. Compute these values creating phi where necessary.
-      for (BitVector::Iterator it(out_[preorder_number]);
-           !it.Done();
+      for (BitVector::Iterator it(out_[preorder_number]); !it.Done();
            it.Advance()) {
         const intptr_t place_id = it.Current();
 
@@ -1929,12 +1853,12 @@
 
         if ((*block_out_values)[place_id] == NULL) {
           ASSERT(block->PredecessorCount() > 0);
-          Definition* in_value = can_merge_eagerly ?
-              MergeIncomingValues(block, place_id) : NULL;
+          Definition* in_value =
+              can_merge_eagerly ? MergeIncomingValues(block, place_id) : NULL;
           if ((in_value == NULL) &&
               (in_[preorder_number]->Contains(place_id))) {
-            PhiInstr* phi = new(Z) PhiInstr(block->AsJoinEntry(),
-                                            block->PredecessorCount());
+            PhiInstr* phi = new (Z)
+                PhiInstr(block->AsJoinEntry(), block->PredecessorCount());
             phi->set_place_id(place_id);
             pending_phis.Add(phi);
             in_value = phi;
@@ -2007,7 +1931,7 @@
         graph_->LoopHeaders();
 
     ZoneGrowableArray<BitVector*>* invariant_loads =
-        new(Z) ZoneGrowableArray<BitVector*>(loop_headers.length());
+        new (Z) ZoneGrowableArray<BitVector*>(loop_headers.length());
 
     for (intptr_t i = 0; i < loop_headers.length(); i++) {
       BlockEntryInstr* header = loop_headers[i];
@@ -2017,16 +1941,14 @@
         continue;
       }
 
-      BitVector* loop_gen = new(Z) BitVector(Z, aliased_set_->max_place_id());
-      for (BitVector::Iterator loop_it(header->loop_info());
-           !loop_it.Done();
+      BitVector* loop_gen = new (Z) BitVector(Z, aliased_set_->max_place_id());
+      for (BitVector::Iterator loop_it(header->loop_info()); !loop_it.Done();
            loop_it.Advance()) {
         const intptr_t preorder_number = loop_it.Current();
         loop_gen->AddAll(gen_[preorder_number]);
       }
 
-      for (BitVector::Iterator loop_it(header->loop_info());
-           !loop_it.Done();
+      for (BitVector::Iterator loop_it(header->loop_info()); !loop_it.Done();
            loop_it.Advance()) {
         const intptr_t preorder_number = loop_it.Current();
         loop_gen->RemoveAll(kill_[preorder_number]);
@@ -2073,8 +1995,8 @@
     }
 
     // Incoming values are different. Phi is required to merge.
-    PhiInstr* phi = new(Z) PhiInstr(
-        block->AsJoinEntry(), block->PredecessorCount());
+    PhiInstr* phi =
+        new (Z) PhiInstr(block->AsJoinEntry(), block->PredecessorCount());
     phi->set_place_id(place_id);
     FillPhiInputs(phi);
     return phi;
@@ -2096,7 +2018,7 @@
       // To prevent using them we additionally mark definitions themselves
       // as replaced and store a pointer to the replacement.
       Definition* replacement = (*pred_out_values)[place_id]->Replacement();
-      Value* input = new(Z) Value(replacement);
+      Value* input = new (Z) Value(replacement);
       phi->SetInputAt(i, input);
       replacement->AddInputUse(input);
     }
@@ -2105,8 +2027,7 @@
     phis_.Add(phi);  // Postpone phi insertion until after load forwarding.
 
     if (FLAG_support_il_printer && FLAG_trace_load_optimization) {
-      THR_Print("created pending phi %s for %s at B%" Pd "\n",
-                phi->ToCString(),
+      THR_Print("created pending phi %s for %s at B%" Pd "\n", phi->ToCString(),
                 aliased_set_->places()[place_id]->ToCString(),
                 block->block_id());
     }
@@ -2116,8 +2037,7 @@
   // values.
   void ForwardLoads() {
     for (BlockIterator block_it = graph_->reverse_postorder_iterator();
-         !block_it.Done();
-         block_it.Advance()) {
+         !block_it.Done(); block_it.Advance()) {
       BlockEntryInstr* block = block_it.Current();
 
       ZoneGrowableArray<Definition*>* loads =
@@ -2145,8 +2065,7 @@
 
           if (FLAG_trace_optimization) {
             THR_Print("Replacing load v%" Pd " with v%" Pd "\n",
-                      load->ssa_temp_index(),
-                      replacement->ssa_temp_index());
+                      load->ssa_temp_index(), replacement->ssa_temp_index());
           }
 
           load->ReplaceUsesWith(replacement);
@@ -2169,7 +2088,7 @@
 
     worklist_.Clear();
     if (in_worklist_ == NULL) {
-      in_worklist_ = new(Z) BitVector(Z, graph_->current_ssa_temp_index());
+      in_worklist_ = new (Z) BitVector(Z, graph_->current_ssa_temp_index());
     } else {
       in_worklist_->Clear();
     }
@@ -2215,9 +2134,9 @@
   // are congruent.
   bool CanBeCongruent(Definition* a, Definition* b) {
     return (a->tag() == b->tag()) &&
-       ((a->IsPhi() && (a->GetBlock() == b->GetBlock())) ||
-        (a->AllowsCSE() && a->Dependencies().IsNone() &&
-         a->AttributesEqual(b)));
+           ((a->IsPhi() && (a->GetBlock() == b->GetBlock())) ||
+            (a->AllowsCSE() && a->Dependencies().IsNone() &&
+             a->AttributesEqual(b)));
   }
 
   // Given two definitions check if they are congruent under assumption that
@@ -2271,8 +2190,7 @@
     BlockEntryInstr* other_block = other->GetBlock();
 
     if (dom_block == other_block) {
-      for (Instruction* current = dom->next();
-           current != NULL;
+      for (Instruction* current = dom->next(); current != NULL;
            current = current->next()) {
         if (current == other) {
           return true;
@@ -2292,7 +2210,7 @@
 
     congruency_worklist_.Clear();
     if (in_worklist_ == NULL) {
-      in_worklist_ = new(Z) BitVector(Z, graph_->current_ssa_temp_index());
+      in_worklist_ = new (Z) BitVector(Z, graph_->current_ssa_temp_index());
     } else {
       in_worklist_->Clear();
     }
@@ -2333,8 +2251,7 @@
       }
 
       if (FLAG_support_il_printer && FLAG_trace_load_optimization) {
-        THR_Print("Replacing %s with congruent %s\n",
-                  a->ToCString(),
+        THR_Print("Replacing %s with congruent %s\n", a->ToCString(),
                   b->ToCString());
       }
 
@@ -2397,7 +2314,7 @@
 
   ZoneGrowableArray<Definition*>* CreateBlockOutValues() {
     ZoneGrowableArray<Definition*>* out =
-        new(Z) ZoneGrowableArray<Definition*>(aliased_set_->max_place_id());
+        new (Z) ZoneGrowableArray<Definition*>(aliased_set_->max_place_id());
     for (intptr_t i = 0; i < aliased_set_->max_place_id(); i++) {
       out->Add(NULL);
     }
@@ -2456,10 +2373,9 @@
 }
 
 
-bool DominatorBasedCSE::OptimizeRecursive(
-    FlowGraph* graph,
-    BlockEntryInstr* block,
-    CSEInstructionMap* map) {
+bool DominatorBasedCSE::OptimizeRecursive(FlowGraph* graph,
+                                          BlockEntryInstr* block,
+                                          CSEInstructionMap* map) {
   bool changed = false;
   for (ForwardInstructionIterator it(block); !it.Done(); it.Advance()) {
     Instruction* current = it.Current();
@@ -2488,7 +2404,7 @@
   intptr_t num_children = block->dominated_blocks().length();
   for (intptr_t i = 0; i < num_children; ++i) {
     BlockEntryInstr* child = block->dominated_blocks()[i];
-    if (i  < num_children - 1) {
+    if (i < num_children - 1) {
       // Copy map.
       CSEInstructionMap child_map(*map);
       changed = OptimizeRecursive(graph, child, &child_map) || changed;
@@ -2525,9 +2441,8 @@
 
     // For now, bail out for large functions to avoid OOM situations.
     // TODO(fschneider): Fix the memory consumption issue.
-    intptr_t function_length =
-        graph->function().end_token_pos().Pos() -
-        graph->function().token_pos().Pos();
+    intptr_t function_length = graph->function().end_token_pos().Pos() -
+                               graph->function().token_pos().Pos();
     if (function_length >= FLAG_huge_method_cutoff_in_tokens) {
       return;
     }
@@ -2570,12 +2485,11 @@
 
   virtual void ComputeInitialSets() {
     Zone* zone = graph_->zone();
-    BitVector* all_places = new(zone) BitVector(zone,
-        aliased_set_->max_place_id());
+    BitVector* all_places =
+        new (zone) BitVector(zone, aliased_set_->max_place_id());
     all_places->SetAll();
     for (BlockIterator block_it = graph_->postorder_iterator();
-         !block_it.Done();
-         block_it.Advance()) {
+         !block_it.Done(); block_it.Advance()) {
       BlockEntryInstr* block = block_it.Current();
       const intptr_t postorder_number = block->postorder_number();
 
@@ -2586,8 +2500,7 @@
       ZoneGrowableArray<Instruction*>* exposed_stores = NULL;
 
       // Iterate backwards starting at the last instruction.
-      for (BackwardInstructionIterator instr_it(block);
-           !instr_it.Done();
+      for (BackwardInstructionIterator instr_it(block); !instr_it.Done();
            instr_it.Advance()) {
         Instruction* instr = instr_it.Current();
 
@@ -2605,9 +2518,9 @@
             if (!live_in->Contains(instr->place_id()) &&
                 CanEliminateStore(instr)) {
               if (FLAG_trace_optimization) {
-                THR_Print(
-                    "Removing dead store to place %" Pd " in block B%" Pd "\n",
-                    instr->place_id(), block->block_id());
+                THR_Print("Removing dead store to place %" Pd " in block B%" Pd
+                          "\n",
+                          instr->place_id(), block->block_id());
               }
               instr_it.RemoveCurrentFromGraph();
             }
@@ -2616,7 +2529,7 @@
             // candidates for the global store elimination.
             if (exposed_stores == NULL) {
               const intptr_t kMaxExposedStoresInitialSize = 5;
-              exposed_stores = new(zone) ZoneGrowableArray<Instruction*>(
+              exposed_stores = new (zone) ZoneGrowableArray<Instruction*>(
                   Utils::Minimum(kMaxExposedStoresInitialSize,
                                  aliased_set_->max_place_id()));
             }
@@ -2629,11 +2542,8 @@
         }
 
         // Handle side effects, deoptimization and function return.
-        if (!instr->Effects().IsNone() ||
-            instr->CanDeoptimize() ||
-            instr->IsThrow() ||
-            instr->IsReThrow() ||
-            instr->IsReturn()) {
+        if (!instr->Effects().IsNone() || instr->CanDeoptimize() ||
+            instr->IsThrow() || instr->IsReThrow() || instr->IsReturn()) {
           // Instructions that return from the function, instructions with side
           // effects and instructions that can deoptimize are considered as
           // loads from all places.
@@ -2665,15 +2575,14 @@
   void EliminateDeadStores() {
     // Iteration order does not matter here.
     for (BlockIterator block_it = graph_->postorder_iterator();
-         !block_it.Done();
-         block_it.Advance()) {
+         !block_it.Done(); block_it.Advance()) {
       BlockEntryInstr* block = block_it.Current();
       const intptr_t postorder_number = block->postorder_number();
 
       BitVector* live_out = live_out_[postorder_number];
 
       ZoneGrowableArray<Instruction*>* exposed_stores =
-        exposed_stores_[postorder_number];
+          exposed_stores_[postorder_number];
       if (exposed_stores == NULL) continue;  // No exposed stores.
 
       // Iterate over candidate stores.
@@ -2754,8 +2663,8 @@
     if (use == store->value()) {
       Definition* instance = store->instance()->definition();
       return instance->IsAllocateObject() &&
-          ((check_type == kOptimisticCheck) ||
-           instance->Identity().IsAllocationSinkingCandidate());
+             ((check_type == kOptimisticCheck) ||
+              instance->Identity().IsAllocationSinkingCandidate());
     }
     return true;
   }
@@ -2770,14 +2679,12 @@
 // We do not support materialization of the object that has type arguments.
 static bool IsAllocationSinkingCandidate(Definition* alloc,
                                          SafeUseCheck check_type) {
-  for (Value* use = alloc->input_use_list();
-       use != NULL;
+  for (Value* use = alloc->input_use_list(); use != NULL;
        use = use->next_use()) {
     if (!IsSafeUse(use, check_type)) {
       if (FLAG_support_il_printer && FLAG_trace_optimization) {
         THR_Print("use of %s at %s is unsafe for allocation sinking\n",
-                  alloc->ToCString(),
-                  use->instruction()->ToCString());
+                  alloc->ToCString(), use->instruction()->ToCString());
       }
       return false;
     }
@@ -2811,18 +2718,15 @@
 
   // As an allocation sinking candidate it is only used in stores to its own
   // fields. Remove these stores.
-  for (Value* use = alloc->input_use_list();
-       use != NULL;
+  for (Value* use = alloc->input_use_list(); use != NULL;
        use = alloc->input_use_list()) {
     use->instruction()->RemoveFromGraph();
   }
 
-  // There should be no environment uses. The pass replaced them with
-  // MaterializeObject instructions.
+// There should be no environment uses. The pass replaced them with
+// MaterializeObject instructions.
 #ifdef DEBUG
-  for (Value* use = alloc->env_use_list();
-       use != NULL;
-       use = use->next_use()) {
+  for (Value* use = alloc->env_use_list(); use != NULL; use = use->next_use()) {
     ASSERT(use->instruction()->IsMaterializeObject());
   }
 #endif
@@ -2843,18 +2747,19 @@
 void AllocationSinking::CollectCandidates() {
   // Optimistically collect all potential candidates.
   for (BlockIterator block_it = flow_graph_->reverse_postorder_iterator();
-       !block_it.Done();
-       block_it.Advance()) {
+       !block_it.Done(); block_it.Advance()) {
     BlockEntryInstr* block = block_it.Current();
     for (ForwardInstructionIterator it(block); !it.Done(); it.Advance()) {
-      { AllocateObjectInstr* alloc = it.Current()->AsAllocateObject();
+      {
+        AllocateObjectInstr* alloc = it.Current()->AsAllocateObject();
         if ((alloc != NULL) &&
             IsAllocationSinkingCandidate(alloc, kOptimisticCheck)) {
           alloc->SetIdentity(AliasIdentity::AllocationSinkingCandidate());
           candidates_.Add(alloc);
         }
       }
-      { AllocateUninitializedContextInstr* alloc =
+      {
+        AllocateUninitializedContextInstr* alloc =
             it.Current()->AsAllocateUninitializedContext();
         if ((alloc != NULL) &&
             IsAllocationSinkingCandidate(alloc, kOptimisticCheck)) {
@@ -2908,9 +2813,7 @@
     Definition* alloc = candidates_[i];
 
     Value* next_use;
-    for (Value* use = alloc->input_use_list();
-         use != NULL;
-         use = next_use) {
+    for (Value* use = alloc->input_use_list(); use != NULL; use = next_use) {
       next_use = use->next_use();
       if (use->instruction()->IsMaterializeObject()) {
         use->BindTo(MaterializationFor(alloc, use->instruction()));
@@ -2986,8 +2889,7 @@
       }
 
 #ifdef DEBUG
-      for (Value* use = alloc->env_use_list();
-           use != NULL;
+      for (Value* use = alloc->env_use_list(); use != NULL;
            use = use->next_use()) {
         ASSERT(use->instruction()->IsMaterializeObject());
       }
@@ -2998,8 +2900,7 @@
       // use list: we will reconstruct it when we start removing
       // materializations.
       alloc->set_env_use_list(NULL);
-      for (Value* use = alloc->input_use_list();
-           use != NULL;
+      for (Value* use = alloc->input_use_list(); use != NULL;
            use = use->next_use()) {
         if (use->instruction()->IsLoadField()) {
           LoadFieldInstr* load = use->instruction()->AsLoadField();
@@ -3143,14 +3044,14 @@
 // Given the allocation and deoptimization exit try to find MaterializeObject
 // instruction corresponding to this allocation at this exit.
 MaterializeObjectInstr* AllocationSinking::MaterializationFor(
-    Definition* alloc, Instruction* exit) {
+    Definition* alloc,
+    Instruction* exit) {
   if (exit->IsMaterializeObject()) {
     exit = ExitForMaterialization(exit->AsMaterializeObject());
   }
 
   for (MaterializeObjectInstr* mat = exit->previous()->AsMaterializeObject();
-       mat != NULL;
-       mat = mat->previous()->AsMaterializeObject()) {
+       mat != NULL; mat = mat->previous()->AsMaterializeObject()) {
     if (mat->allocation() == alloc) {
       return mat;
     }
@@ -3167,7 +3068,7 @@
     Definition* alloc,
     const ZoneGrowableArray<const Object*>& slots) {
   ZoneGrowableArray<Value*>* values =
-      new(Z) ZoneGrowableArray<Value*>(slots.length());
+      new (Z) ZoneGrowableArray<Value*>(slots.length());
 
   // All loads should be inserted before the first materialization so that
   // IR follows the following pattern: loads, materializations, deoptimizing
@@ -3176,29 +3077,25 @@
 
   // Insert load instruction for every field.
   for (intptr_t i = 0; i < slots.length(); i++) {
-    LoadFieldInstr* load = slots[i]->IsField()
-        ? new(Z) LoadFieldInstr(
-            new(Z) Value(alloc),
-            &Field::Cast(*slots[i]),
-            AbstractType::ZoneHandle(Z),
-            alloc->token_pos())
-        : new(Z) LoadFieldInstr(
-            new(Z) Value(alloc),
-            Smi::Cast(*slots[i]).Value(),
-            AbstractType::ZoneHandle(Z),
-            alloc->token_pos());
-    flow_graph_->InsertBefore(
-        load_point, load, NULL, FlowGraph::kValue);
-    values->Add(new(Z) Value(load));
+    LoadFieldInstr* load =
+        slots[i]->IsField()
+            ? new (Z) LoadFieldInstr(
+                  new (Z) Value(alloc), &Field::Cast(*slots[i]),
+                  AbstractType::ZoneHandle(Z), alloc->token_pos())
+            : new (Z) LoadFieldInstr(
+                  new (Z) Value(alloc), Smi::Cast(*slots[i]).Value(),
+                  AbstractType::ZoneHandle(Z), alloc->token_pos());
+    flow_graph_->InsertBefore(load_point, load, NULL, FlowGraph::kValue);
+    values->Add(new (Z) Value(load));
   }
 
   MaterializeObjectInstr* mat = NULL;
   if (alloc->IsAllocateObject()) {
-    mat = new(Z) MaterializeObjectInstr(
-        alloc->AsAllocateObject(), slots, values);
+    mat = new (Z)
+        MaterializeObjectInstr(alloc->AsAllocateObject(), slots, values);
   } else {
     ASSERT(alloc->IsAllocateUninitializedContext());
-    mat = new(Z) MaterializeObjectInstr(
+    mat = new (Z) MaterializeObjectInstr(
         alloc->AsAllocateUninitializedContext(), slots, values);
   }
 
@@ -3208,8 +3105,7 @@
   // MaterializeObject instruction.
   // We must preserve the identity: all mentions are replaced by the same
   // materialization.
-  for (Environment::DeepIterator env_it(exit->env());
-       !env_it.Done();
+  for (Environment::DeepIterator env_it(exit->env()); !env_it.Done();
        env_it.Advance()) {
     Value* use = env_it.CurrentValue();
     if (use->definition() == alloc) {
@@ -3222,7 +3118,7 @@
   // Mark MaterializeObject as an environment use of this allocation.
   // This will allow us to discover it when we are looking for deoptimization
   // exits for another allocation that potentially flows into this one.
-  Value* val = new(Z) Value(alloc);
+  Value* val = new (Z) Value(alloc);
   val->set_instruction(mat);
   alloc->AddEnvUse(val);
 
@@ -3233,7 +3129,7 @@
 
 // Add given instruction to the list of the instructions if it is not yet
 // present there.
-template<typename T>
+template <typename T>
 void AddInstruction(GrowableArray<T*>* list, T* value) {
   ASSERT(!value->IsGraphEntry());
   for (intptr_t i = 0; i < list->length(); i++) {
@@ -3251,12 +3147,10 @@
 // dematerialized and that are referenced by deopt environments that
 // don't contain this allocation explicitly.
 void AllocationSinking::ExitsCollector::Collect(Definition* alloc) {
-  for (Value* use = alloc->env_use_list();
-       use != NULL;
-       use = use->next_use()) {
+  for (Value* use = alloc->env_use_list(); use != NULL; use = use->next_use()) {
     if (use->instruction()->IsMaterializeObject()) {
       AddInstruction(&exits_, ExitForMaterialization(
-          use->instruction()->AsMaterializeObject()));
+                                  use->instruction()->AsMaterializeObject()));
     } else {
       AddInstruction(&exits_, use->instruction());
     }
@@ -3266,8 +3160,7 @@
   // candidate and put it on worklist so that we conservatively collect all
   // exits for that candidate as well because they potentially might see
   // this object.
-  for (Value* use = alloc->input_use_list();
-       use != NULL;
+  for (Value* use = alloc->input_use_list(); use != NULL;
        use = use->next_use()) {
     Definition* obj = StoreInto(use);
     if ((obj != NULL) && (obj != alloc)) {
@@ -3297,10 +3190,9 @@
 void AllocationSinking::InsertMaterializations(Definition* alloc) {
   // Collect all fields that are written for this instance.
   ZoneGrowableArray<const Object*>* slots =
-      new(Z) ZoneGrowableArray<const Object*>(5);
+      new (Z) ZoneGrowableArray<const Object*>(5);
 
-  for (Value* use = alloc->input_use_list();
-       use != NULL;
+  for (Value* use = alloc->input_use_list(); use != NULL;
        use = use->next_use()) {
     StoreInstanceFieldInstr* store = use->instruction()->AsStoreInstanceField();
     if ((store != NULL) && (store->instance()->definition() == alloc)) {
@@ -3325,8 +3217,7 @@
 
   // Insert materializations at environment uses.
   for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) {
-    CreateMaterializationAt(
-        exits_collector_.exits()[i], alloc, *slots);
+    CreateMaterializationAt(exits_collector_.exits()[i], alloc, *slots);
   }
 }
 
@@ -3339,8 +3230,7 @@
   const GrowableArray<CatchBlockEntryInstr*>& catch_entries =
       flow_graph->graph_entry()->catch_entries();
   intptr_t base = kFirstLocalSlotFromFp + flow_graph->num_non_copied_params();
-  for (intptr_t catch_idx = 0;
-       catch_idx < catch_entries.length();
+  for (intptr_t catch_idx = 0; catch_idx < catch_entries.length();
        ++catch_idx) {
     CatchBlockEntryInstr* catch_entry = catch_entries[catch_idx];
 
@@ -3353,29 +3243,35 @@
     GrowableArray<Definition*> cdefs(idefs->length());
     cdefs.AddArray(*idefs);
 
-    // exception_var and stacktrace_var are never constant.
-    intptr_t ex_idx = base - catch_entry->exception_var().index();
-    intptr_t st_idx = base - catch_entry->stacktrace_var().index();
-    cdefs[ex_idx] = cdefs[st_idx] = NULL;
+    // exception_var and stacktrace_var are never constant.  In asynchronous or
+    // generator functions they may be context-allocated in which case they are
+    // not tracked in the environment anyway.
+    if (!catch_entry->exception_var().is_captured()) {
+      cdefs[base - catch_entry->exception_var().index()] = NULL;
+    }
+    if (!catch_entry->stacktrace_var().is_captured()) {
+      cdefs[base - catch_entry->stacktrace_var().index()] = NULL;
+    }
 
     for (BlockIterator block_it = flow_graph->reverse_postorder_iterator();
-         !block_it.Done();
-         block_it.Advance()) {
+         !block_it.Done(); block_it.Advance()) {
       BlockEntryInstr* block = block_it.Current();
       if (block->try_index() == catch_entry->catch_try_index()) {
-        for (ForwardInstructionIterator instr_it(block);
-             !instr_it.Done();
+        for (ForwardInstructionIterator instr_it(block); !instr_it.Done();
              instr_it.Advance()) {
           Instruction* current = instr_it.Current();
           if (current->MayThrow()) {
             Environment* env = current->env()->Outermost();
             ASSERT(env != NULL);
             for (intptr_t env_idx = 0; env_idx < cdefs.length(); ++env_idx) {
-              if (cdefs[env_idx] != NULL &&
+              if (cdefs[env_idx] != NULL && !cdefs[env_idx]->IsConstant() &&
                   env->ValueAt(env_idx)->BindsToConstant()) {
+                // If the recorded definition is not a constant, record this
+                // definition as the current constant definition.
                 cdefs[env_idx] = env->ValueAt(env_idx)->definition();
               }
               if (cdefs[env_idx] != env->ValueAt(env_idx)->definition()) {
+                // Non-constant definitions are reset to NULL.
                 cdefs[env_idx] = NULL;
               }
             }
@@ -3389,7 +3285,7 @@
         Definition* old = (*idefs)[j];
         ConstantInstr* orig = cdefs[j]->AsConstant();
         ConstantInstr* copy =
-            new(flow_graph->zone()) ConstantInstr(orig->value());
+            new (flow_graph->zone()) ConstantInstr(orig->value());
         copy->set_ssa_temp_index(flow_graph->alloc_ssa_temp_index());
         old->ReplaceUsesWith(copy);
         (*idefs)[j] = copy;
@@ -3404,9 +3300,7 @@
   // Environment uses are real (non-phi) uses.
   if (def->env_use_list() != NULL) return true;
 
-  for (Value::Iterator it(def->input_use_list());
-       !it.Done();
-       it.Advance()) {
+  for (Value::Iterator it(def->input_use_list()); !it.Done(); it.Advance()) {
     if (!it.Current()->instruction()->IsPhi()) return true;
   }
   return false;
@@ -3415,8 +3309,7 @@
 
 void DeadCodeElimination::EliminateDeadPhis(FlowGraph* flow_graph) {
   GrowableArray<PhiInstr*> live_phis;
-  for (BlockIterator b = flow_graph->postorder_iterator();
-       !b.Done();
+  for (BlockIterator b = flow_graph->postorder_iterator(); !b.Done();
        b.Advance()) {
     JoinEntryInstr* join = b.Current()->AsJoinEntry();
     if (join != NULL) {
@@ -3446,8 +3339,7 @@
     }
   }
 
-  for (BlockIterator it(flow_graph->postorder_iterator());
-       !it.Done();
+  for (BlockIterator it(flow_graph->postorder_iterator()); !it.Done();
        it.Advance()) {
     JoinEntryInstr* join = it.Current()->AsJoinEntry();
     if (join != NULL) {
@@ -3471,7 +3363,7 @@
             (*join->phis_)[i] = NULL;
             if (FLAG_trace_optimization) {
               THR_Print("Removing redundant phi v%" Pd "\n",
-                         phi->ssa_temp_index());
+                        phi->ssa_temp_index());
             }
           } else {
             (*join->phis_)[to_index++] = phi;
diff --git a/runtime/vm/redundancy_elimination.h b/runtime/vm/redundancy_elimination.h
index 73a9850..47afe21 100644
--- a/runtime/vm/redundancy_elimination.h
+++ b/runtime/vm/redundancy_elimination.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_REDUNDANCY_ELIMINATION_H_
-#define VM_REDUNDANCY_ELIMINATION_H_
+#ifndef RUNTIME_VM_REDUNDANCY_ELIMINATION_H_
+#define RUNTIME_VM_REDUNDANCY_ELIMINATION_H_
 
 #include "vm/intermediate_language.h"
 #include "vm/flow_graph.h"
@@ -15,13 +15,9 @@
 class AllocationSinking : public ZoneAllocated {
  public:
   explicit AllocationSinking(FlowGraph* flow_graph)
-      : flow_graph_(flow_graph),
-        candidates_(5),
-        materializations_(5) { }
+      : flow_graph_(flow_graph), candidates_(5), materializations_(5) {}
 
-  const GrowableArray<Definition*>& candidates() const {
-    return candidates_;
-  }
+  const GrowableArray<Definition*>& candidates() const { return candidates_; }
 
   // Find the materialization insterted for the given allocation
   // at the given exit.
@@ -40,7 +36,7 @@
   // this object.
   class ExitsCollector : public ValueObject {
    public:
-    ExitsCollector() : exits_(10), worklist_(3) { }
+    ExitsCollector() : exits_(10), worklist_(3) {}
 
     const GrowableArray<Instruction*>& exits() const { return exits_; }
 
@@ -66,10 +62,9 @@
 
   void InsertMaterializations(Definition* alloc);
 
-  void CreateMaterializationAt(
-      Instruction* exit,
-      Definition* alloc,
-      const ZoneGrowableArray<const Object*>& fields);
+  void CreateMaterializationAt(Instruction* exit,
+                               Definition* alloc,
+                               const ZoneGrowableArray<const Object*>& fields);
 
   void EliminateAllocation(Definition* alloc);
 
@@ -94,10 +89,9 @@
   static bool Optimize(FlowGraph* graph);
 
  private:
-  static bool OptimizeRecursive(
-      FlowGraph* graph,
-      BlockEntryInstr* entry,
-      CSEInstructionMap* map);
+  static bool OptimizeRecursive(FlowGraph* graph,
+                                BlockEntryInstr* entry,
+                                CSEInstructionMap* map);
 };
 
 
@@ -146,4 +140,4 @@
 
 }  // namespace dart
 
-#endif  // VM_REDUNDANCY_ELIMINATION_H_
+#endif  // RUNTIME_VM_REDUNDANCY_ELIMINATION_H_
diff --git a/runtime/vm/regexp.cc b/runtime/vm/regexp.cc
index 9edfbf6..3516bc8 100644
--- a/runtime/vm/regexp.cc
+++ b/runtime/vm/regexp.cc
@@ -270,9 +270,9 @@
  private:
   class CharacterFrequency {
    public:
-    CharacterFrequency() : counter_(0), character_(-1) { }
+    CharacterFrequency() : counter_(0), character_(-1) {}
     explicit CharacterFrequency(intptr_t character)
-        : counter_(0), character_(character) { }
+        : counter_(0), character_(character) {}
 
     void Increment() { counter_++; }
     intptr_t counter() { return counter_; }
@@ -294,19 +294,14 @@
 
 class RegExpCompiler : public ValueObject {
  public:
-  RegExpCompiler(intptr_t capture_count,
-                 bool ignore_case,
-                 bool is_one_byte);
+  RegExpCompiler(intptr_t capture_count, bool ignore_case, bool is_one_byte);
 
-  intptr_t AllocateRegister() {
-    return next_register_++;
-  }
+  intptr_t AllocateRegister() { return next_register_++; }
 
-  RegExpEngine::CompilationResult Assemble(
-      IRRegExpMacroAssembler* assembler,
-      RegExpNode* start,
-      intptr_t capture_count,
-      const String& pattern);
+  RegExpEngine::CompilationResult Assemble(IRRegExpMacroAssembler* assembler,
+                                           RegExpNode* start,
+                                           intptr_t capture_count,
+                                           const String& pattern);
 
   RegExpEngine::CompilationResult Assemble(
       BytecodeRegExpMacroAssembler* assembler,
@@ -364,6 +359,7 @@
     compiler->IncrementRecursionDepth();
   }
   ~RecursionCheck() { compiler_->DecrementRecursionDepth(); }
+
  private:
   RegExpCompiler* compiler_;
 };
@@ -387,7 +383,7 @@
       reg_exp_too_big_(false),
       current_expansion_factor_(1),
       zone_(Thread::Current()->zone()) {
-  accept_ = new(Z) EndNode(EndNode::ACCEPT, Z);
+  accept_ = new (Z) EndNode(EndNode::ACCEPT, Z);
 }
 
 
@@ -415,11 +411,10 @@
   macro_assembler->GenerateBacktrackBlock();
   macro_assembler->FinalizeRegistersArray();
 
-  return RegExpEngine::CompilationResult(macro_assembler->backtrack_goto(),
-                                         macro_assembler->graph_entry(),
-                                         macro_assembler->num_blocks(),
-                                         macro_assembler->num_stack_locals(),
-                                         next_register_);
+  return RegExpEngine::CompilationResult(
+      macro_assembler->backtrack_goto(), macro_assembler->graph_entry(),
+      macro_assembler->num_blocks(), macro_assembler->num_stack_locals(),
+      next_register_);
 }
 
 
@@ -460,11 +455,9 @@
 
 
 bool Trace::mentions_reg(intptr_t reg) {
-  for (DeferredAction* action = actions_;
-       action != NULL;
+  for (DeferredAction* action = actions_; action != NULL;
        action = action->next()) {
-    if (action->Mentions(reg))
-      return true;
+    if (action->Mentions(reg)) return true;
   }
   return false;
 }
@@ -472,8 +465,7 @@
 
 bool Trace::GetStoredPosition(intptr_t reg, intptr_t* cp_offset) {
   ASSERT(*cp_offset == 0);
-  for (DeferredAction* action = actions_;
-       action != NULL;
+  for (DeferredAction* action = actions_; action != NULL;
        action = action->next()) {
     if (action->Mentions(reg)) {
       if (action->action_type() == ActionNode::STORE_POSITION) {
@@ -491,11 +483,9 @@
 // This is called as we come into a loop choice node and some other tricky
 // nodes.  It normalizes the state of the code generator to ensure we can
 // generate generic code.
-intptr_t Trace::FindAffectedRegisters(OutSet* affected_registers,
-                                      Zone* zone) {
+intptr_t Trace::FindAffectedRegisters(OutSet* affected_registers, Zone* zone) {
   intptr_t max_register = RegExpCompiler::kNoRegister;
-  for (DeferredAction* action = actions_;
-       action != NULL;
+  for (DeferredAction* action = actions_; action != NULL;
        action = action->next()) {
     if (action->action_type() == ActionNode::CLEAR_CAPTURES) {
       Interval range = static_cast<DeferredClearCaptures*>(action)->range();
@@ -552,8 +542,7 @@
     intptr_t store_position = -1;
     // This is a little tricky because we are scanning the actions in reverse
     // historical order (newest first).
-    for (DeferredAction* action = actions_;
-         action != NULL;
+    for (DeferredAction* action = actions_; action != NULL;
          action = action->next()) {
       if (action->Mentions(reg)) {
         switch (action->action_type()) {
@@ -677,12 +666,8 @@
   intptr_t max_register = FindAffectedRegisters(&affected_registers, zone);
   OutSet registers_to_pop;
   OutSet registers_to_clear;
-  PerformDeferredActions(assembler,
-                         max_register,
-                         affected_registers,
-                         &registers_to_pop,
-                         &registers_to_clear,
-                         zone);
+  PerformDeferredActions(assembler, max_register, affected_registers,
+                         &registers_to_pop, &registers_to_clear, zone);
   if (cp_offset_ != 0) {
     assembler->AdvanceCurrentPosition(cp_offset_);
   }
@@ -695,9 +680,7 @@
 
   // On backtrack we need to restore state.
   assembler->BindBlock(&undo);
-  RestoreAffectedRegisters(assembler,
-                           max_register,
-                           registers_to_pop,
+  RestoreAffectedRegisters(assembler, max_register, registers_to_pop,
                            registers_to_clear);
   if (backtrack() == NULL) {
     assembler->Backtrack();
@@ -760,8 +743,7 @@
 
 
 void GuardedAlternative::AddGuard(Guard* guard, Zone* zone) {
-  if (guards_ == NULL)
-    guards_ = new(zone) ZoneGrowableArray<Guard*>(1);
+  if (guards_ == NULL) guards_ = new (zone) ZoneGrowableArray<Guard*>(1);
   guards_->Add(guard);
 }
 
@@ -770,7 +752,7 @@
                                     intptr_t val,
                                     RegExpNode* on_success) {
   ActionNode* result =
-      new(on_success->zone()) ActionNode(SET_REGISTER, on_success);
+      new (on_success->zone()) ActionNode(SET_REGISTER, on_success);
   result->data_.u_store_register.reg = reg;
   result->data_.u_store_register.value = val;
   return result;
@@ -780,7 +762,7 @@
 ActionNode* ActionNode::IncrementRegister(intptr_t reg,
                                           RegExpNode* on_success) {
   ActionNode* result =
-      new(on_success->zone()) ActionNode(INCREMENT_REGISTER, on_success);
+      new (on_success->zone()) ActionNode(INCREMENT_REGISTER, on_success);
   result->data_.u_increment_register.reg = reg;
   return result;
 }
@@ -790,17 +772,16 @@
                                       bool is_capture,
                                       RegExpNode* on_success) {
   ActionNode* result =
-      new(on_success->zone()) ActionNode(STORE_POSITION, on_success);
+      new (on_success->zone()) ActionNode(STORE_POSITION, on_success);
   result->data_.u_position_register.reg = reg;
   result->data_.u_position_register.is_capture = is_capture;
   return result;
 }
 
 
-ActionNode* ActionNode::ClearCaptures(Interval range,
-                                      RegExpNode* on_success) {
+ActionNode* ActionNode::ClearCaptures(Interval range, RegExpNode* on_success) {
   ActionNode* result =
-      new(on_success->zone()) ActionNode(CLEAR_CAPTURES, on_success);
+      new (on_success->zone()) ActionNode(CLEAR_CAPTURES, on_success);
   result->data_.u_clear_captures.range_from = range.from();
   result->data_.u_clear_captures.range_to = range.to();
   return result;
@@ -811,7 +792,7 @@
                                       intptr_t position_reg,
                                       RegExpNode* on_success) {
   ActionNode* result =
-      new(on_success->zone()) ActionNode(BEGIN_SUBMATCH, on_success);
+      new (on_success->zone()) ActionNode(BEGIN_SUBMATCH, on_success);
   result->data_.u_submatch.stack_pointer_register = stack_reg;
   result->data_.u_submatch.current_position_register = position_reg;
   return result;
@@ -823,9 +804,8 @@
                                                 intptr_t clear_register_count,
                                                 intptr_t clear_register_from,
                                                 RegExpNode* on_success) {
-  ActionNode* result =
-      new(on_success->zone()) ActionNode(POSITIVE_SUBMATCH_SUCCESS,
-                                            on_success);
+  ActionNode* result = new (on_success->zone())
+      ActionNode(POSITIVE_SUBMATCH_SUCCESS, on_success);
   result->data_.u_submatch.stack_pointer_register = stack_reg;
   result->data_.u_submatch.current_position_register = position_reg;
   result->data_.u_submatch.clear_register_count = clear_register_count;
@@ -839,7 +819,7 @@
                                         intptr_t repetition_limit,
                                         RegExpNode* on_success) {
   ActionNode* result =
-      new(on_success->zone()) ActionNode(EMPTY_MATCH_CHECK, on_success);
+      new (on_success->zone()) ActionNode(EMPTY_MATCH_CHECK, on_success);
   result->data_.u_empty_match_check.start_register = start_register;
   result->data_.u_empty_match_check.repetition_register = repetition_register;
   result->data_.u_empty_match_check.repetition_limit = repetition_limit;
@@ -847,10 +827,8 @@
 }
 
 
-#define DEFINE_ACCEPT(Type)                                          \
-  void Type##Node::Accept(NodeVisitor* visitor) {                    \
-    visitor->Visit##Type(this);                                      \
-  }
+#define DEFINE_ACCEPT(Type)                                                    \
+  void Type##Node::Accept(NodeVisitor* visitor) { visitor->Visit##Type(this); }
 FOR_EACH_NODE_TYPE(DEFINE_ACCEPT)
 #undef DEFINE_ACCEPT
 
@@ -870,14 +848,12 @@
   switch (guard->op()) {
     case Guard::LT:
       ASSERT(!trace->mentions_reg(guard->reg()));
-      macro_assembler->IfRegisterGE(guard->reg(),
-                                    guard->value(),
+      macro_assembler->IfRegisterGE(guard->reg(), guard->value(),
                                     trace->backtrack());
       break;
     case Guard::GEQ:
       ASSERT(!trace->mentions_reg(guard->reg()));
-      macro_assembler->IfRegisterLT(guard->reg(),
-                                    guard->value(),
+      macro_assembler->IfRegisterLT(guard->reg(), guard->value(),
                                     trace->backtrack());
       break;
   }
@@ -919,10 +895,7 @@
   RegExpMacroAssembler* assembler = compiler->macro_assembler();
   bool bound_checked = false;
   if (!preloaded) {
-    assembler->LoadCurrentCharacter(
-        cp_offset,
-        on_failure,
-        check);
+    assembler->LoadCurrentCharacter(cp_offset, on_failure, check);
     bound_checked = true;
   }
   assembler->CheckNotCharacter(c, on_failure);
@@ -995,9 +968,7 @@
     // trick.  We avoid the theoretical case where negative numbers are
     // involved in order to simplify code generation.
     uint16_t mask = char_mask ^ diff;
-    macro_assembler->CheckNotCharacterAfterMinusAnd(c1 - diff,
-                                                    diff,
-                                                    mask,
+    macro_assembler->CheckNotCharacterAfterMinusAnd(c1 - diff, diff, mask,
                                                     on_failure);
     return true;
   }
@@ -1036,11 +1007,8 @@
   ASSERT(unibrow::Ecma262UnCanonicalize::kMaxWidth == 4);
   switch (length) {
     case 2: {
-      if (ShortCutEmitCharacterPair(macro_assembler,
-                                    one_byte,
-                                    chars[0],
-                                    chars[1],
-                                    on_failure)) {
+      if (ShortCutEmitCharacterPair(macro_assembler, one_byte, chars[0],
+                                    chars[1], on_failure)) {
       } else {
         macro_assembler->CheckCharacter(chars[0], &ok);
         macro_assembler->CheckNotCharacter(chars[1], on_failure);
@@ -1050,7 +1018,7 @@
     }
     case 4:
       macro_assembler->CheckCharacter(chars[3], &ok);
-      // Fall through!
+    // Fall through!
     case 3:
       macro_assembler->CheckCharacter(chars[0], &ok);
       macro_assembler->CheckCharacter(chars[1], &ok);
@@ -1104,15 +1072,14 @@
 
 // even_label is for ranges[i] to ranges[i + 1] where i - start_index is even.
 // odd_label is for ranges[i] to ranges[i + 1] where i - start_index is odd.
-static void EmitUseLookupTable(
-    RegExpMacroAssembler* masm,
-    ZoneGrowableArray<int>* ranges,
-    intptr_t start_index,
-    intptr_t end_index,
-    intptr_t min_char,
-    BlockLabel* fall_through,
-    BlockLabel* even_label,
-    BlockLabel* odd_label) {
+static void EmitUseLookupTable(RegExpMacroAssembler* masm,
+                               ZoneGrowableArray<int>* ranges,
+                               intptr_t start_index,
+                               intptr_t end_index,
+                               intptr_t min_char,
+                               BlockLabel* fall_through,
+                               BlockLabel* even_label,
+                               BlockLabel* odd_label) {
   static const intptr_t kSize = RegExpMacroAssembler::kTableSize;
   static const intptr_t kMask = RegExpMacroAssembler::kTableMask;
 
@@ -1154,8 +1121,7 @@
   }
   // TODO(erikcorry): Cache these.
   const TypedData& ba = TypedData::ZoneHandle(
-        masm->zone(),
-        TypedData::New(kTypedDataUint8ArrayCid, kSize, Heap::kOld));
+      masm->zone(), TypedData::New(kTypedDataUint8ArrayCid, kSize, Heap::kOld));
   for (intptr_t i = 0; i < kSize; i++) {
     ba.SetUint8(i, templ[i]);
   }
@@ -1174,11 +1140,8 @@
   bool odd = (((cut_index - start_index) & 1) == 1);
   BlockLabel* in_range_label = odd ? odd_label : even_label;
   BlockLabel dummy;
-  EmitDoubleBoundaryTest(masm,
-                         ranges->At(cut_index),
-                         ranges->At(cut_index + 1) - 1,
-                         &dummy,
-                         in_range_label,
+  EmitDoubleBoundaryTest(masm, ranges->At(cut_index),
+                         ranges->At(cut_index + 1) - 1, &dummy, in_range_label,
                          &dummy);
   ASSERT(!dummy.IsLinked());
   // Cut out the single range by rewriting the array.  This creates a new
@@ -1231,10 +1194,9 @@
   // punctuation).
   if (*border - 1 > Symbols::kMaxOneCharCodeSymbol &&  // Latin1 case.
       end_index - start_index > (*new_start_index - start_index) * 2 &&
-      last - first > kSize * 2 &&
-      binary_chop_index > *new_start_index &&
+      last - first > kSize * 2 && binary_chop_index > *new_start_index &&
       ranges->At(binary_chop_index) >= first + 2 * kSize) {
-    intptr_t scan_forward_for_section_border = binary_chop_index;;
+    intptr_t scan_forward_for_section_border = binary_chop_index;
     intptr_t new_border = (ranges->At(binary_chop_index) | kMask) + 1;
 
     while (scan_forward_for_section_border < end_index) {
@@ -1290,8 +1252,8 @@
   // Another almost trivial case:  There is one interval in the middle that is
   // different from the end intervals.
   if (start_index + 1 == end_index) {
-    EmitDoubleBoundaryTest(
-        masm, first, last, fall_through, even_label, odd_label);
+    EmitDoubleBoundaryTest(masm, first, last, fall_through, even_label,
+                           odd_label);
     return;
   }
 
@@ -1309,18 +1271,11 @@
       }
     }
     if (cut == kNoCutIndex) cut = start_index;
-    CutOutRange(
-        masm, ranges, start_index, end_index, cut, even_label, odd_label);
+    CutOutRange(masm, ranges, start_index, end_index, cut, even_label,
+                odd_label);
     ASSERT(end_index - start_index >= 2);
-    GenerateBranches(masm,
-                     ranges,
-                     start_index + 1,
-                     end_index - 1,
-                     min_char,
-                     max_char,
-                     fall_through,
-                     even_label,
-                     odd_label);
+    GenerateBranches(masm, ranges, start_index + 1, end_index - 1, min_char,
+                     max_char, fall_through, even_label, odd_label);
     return;
   }
 
@@ -1329,28 +1284,15 @@
   static const intptr_t kBits = RegExpMacroAssembler::kTableSizeBits;
 
   if ((max_char >> kBits) == (min_char >> kBits)) {
-    EmitUseLookupTable(masm,
-                       ranges,
-                       start_index,
-                       end_index,
-                       min_char,
-                       fall_through,
-                       even_label,
-                       odd_label);
+    EmitUseLookupTable(masm, ranges, start_index, end_index, min_char,
+                       fall_through, even_label, odd_label);
     return;
   }
 
   if ((min_char >> kBits) != (first >> kBits)) {
     masm->CheckCharacterLT(first, odd_label);
-    GenerateBranches(masm,
-                     ranges,
-                     start_index + 1,
-                     end_index,
-                     first,
-                     max_char,
-                     fall_through,
-                     odd_label,
-                     even_label);
+    GenerateBranches(masm, ranges, start_index + 1, end_index, first, max_char,
+                     fall_through, odd_label, even_label);
     return;
   }
 
@@ -1358,12 +1300,8 @@
   intptr_t new_end_index = 0;
   intptr_t border = 0;
 
-  SplitSearchSpace(ranges,
-                   start_index,
-                   end_index,
-                   &new_start_index,
-                   &new_end_index,
-                   &border);
+  SplitSearchSpace(ranges, start_index, end_index, &new_start_index,
+                   &new_end_index, &border);
 
   BlockLabel handle_rest;
   BlockLabel* above = &handle_rest;
@@ -1386,34 +1324,20 @@
   ASSERT(ranges->At(new_end_index) < border);
   ASSERT(border < ranges->At(new_start_index) ||
          (border == ranges->At(new_start_index) &&
-          new_start_index == end_index &&
-          new_end_index == end_index - 1 &&
+          new_start_index == end_index && new_end_index == end_index - 1 &&
           border == last + 1));
   ASSERT(new_start_index == 0 || border >= ranges->At(new_start_index - 1));
 
   masm->CheckCharacterGT(border - 1, above);
   BlockLabel dummy;
-  GenerateBranches(masm,
-                   ranges,
-                   start_index,
-                   new_end_index,
-                   min_char,
-                   border - 1,
-                   &dummy,
-                   even_label,
-                   odd_label);
+  GenerateBranches(masm, ranges, start_index, new_end_index, min_char,
+                   border - 1, &dummy, even_label, odd_label);
 
   if (handle_rest.IsLinked()) {
     masm->BindBlock(&handle_rest);
     bool flip = (new_start_index & 1) != (start_index & 1);
-    GenerateBranches(masm,
-                     ranges,
-                     new_start_index,
-                     end_index,
-                     border,
-                     max_char,
-                     &dummy,
-                     flip ? odd_label : even_label,
+    GenerateBranches(masm, ranges, new_start_index, end_index, border, max_char,
+                     &dummy, flip ? odd_label : even_label,
                      flip ? even_label : odd_label);
   }
 }
@@ -1460,8 +1384,7 @@
     return;
   }
 
-  if (last_valid_range == 0 &&
-      ranges->At(0).IsEverything(max_char)) {
+  if (last_valid_range == 0 && ranges->At(0).IsEverything(max_char)) {
     if (cc->is_negated()) {
       macro_assembler->GoTo(on_failure);
     } else {
@@ -1472,8 +1395,7 @@
     }
     return;
   }
-  if (last_valid_range == 0 &&
-      !cc->is_negated() &&
+  if (last_valid_range == 0 && !cc->is_negated() &&
       ranges->At(0).IsEverything(max_char)) {
     // This is a common case hit by non-anchored expressions.
     if (check_offset) {
@@ -1487,9 +1409,9 @@
   }
 
   if (cc->is_standard() &&
-        macro_assembler->CheckSpecialCharacterClass(cc->standard_type(),
-                                                    on_failure)) {
-      return;
+      macro_assembler->CheckSpecialCharacterClass(cc->standard_type(),
+                                                  on_failure)) {
+    return;
   }
 
 
@@ -1500,7 +1422,7 @@
   // was already one there we fall through for success on that entry.
   // Subsequent entries have alternating meaning (success/failure).
   ZoneGrowableArray<int>* range_boundaries =
-      new(zone) ZoneGrowableArray<int>(last_valid_range);
+      new (zone) ZoneGrowableArray<int>(last_valid_range);
 
   bool zeroth_entry_is_failure = !cc->is_negated();
 
@@ -1520,21 +1442,18 @@
   }
 
   BlockLabel fall_through;
-  GenerateBranches(macro_assembler,
-                   range_boundaries,
+  GenerateBranches(macro_assembler, range_boundaries,
                    0,  // start_index.
                    end_index,
                    0,  // min_char.
-                   max_char,
-                   &fall_through,
+                   max_char, &fall_through,
                    zeroth_entry_is_failure ? &fall_through : on_failure,
                    zeroth_entry_is_failure ? on_failure : &fall_through);
   macro_assembler->BindBlock(&fall_through);
 }
 
 
-RegExpNode::~RegExpNode() {
-}
+RegExpNode::~RegExpNode() {}
 
 
 RegExpNode::LimitResult RegExpNode::LimitVersions(RegExpCompiler* compiler,
@@ -1567,8 +1486,7 @@
   // We are being asked to make a non-generic version.  Keep track of how many
   // non-generic versions we generate so as not to overdo it.
   trace_count_++;
-  if (kRegexpOptimization &&
-      trace_count_ < kMaxCopiesCodeGenerated &&
+  if (kRegexpOptimization && trace_count_ < kMaxCopiesCodeGenerated &&
       compiler->recursion_depth() <= RegExpCompiler::kMaxRecursion) {
     return CONTINUE;
   }
@@ -1586,9 +1504,7 @@
                                  bool not_at_start) {
   if (budget <= 0) return 0;
   if (action_type_ == POSITIVE_SUBMATCH_SUCCESS) return 0;  // Rewinds input!
-  return on_success()->EatsAtLeast(still_to_find,
-                                   budget - 1,
-                                   not_at_start);
+  return on_success()->EatsAtLeast(still_to_find, budget - 1, not_at_start);
 }
 
 
@@ -1615,9 +1531,7 @@
   // that won't prevent us from preloading a lot of characters for the other
   // branches in the node graph.
   if (assertion_type() == AT_START && not_at_start) return still_to_find;
-  return on_success()->EatsAtLeast(still_to_find,
-                                   budget - 1,
-                                   not_at_start);
+  return on_success()->EatsAtLeast(still_to_find, budget - 1, not_at_start);
 }
 
 
@@ -1636,9 +1550,7 @@
                                         intptr_t budget,
                                         bool not_at_start) {
   if (budget <= 0) return 0;
-  return on_success()->EatsAtLeast(still_to_find,
-                                   budget - 1,
-                                   not_at_start);
+  return on_success()->EatsAtLeast(still_to_find, budget - 1, not_at_start);
 }
 
 
@@ -1649,9 +1561,8 @@
   if (answer >= still_to_find) return answer;
   if (budget <= 0) return answer;
   // We are not at start after this node so we set the last argument to 'true'.
-  return answer + on_success()->EatsAtLeast(still_to_find - answer,
-                                            budget - 1,
-                                            true);
+  return answer +
+         on_success()->EatsAtLeast(still_to_find - answer, budget - 1, true);
 }
 
 
@@ -1701,20 +1612,14 @@
 intptr_t LoopChoiceNode::EatsAtLeast(intptr_t still_to_find,
                                      intptr_t budget,
                                      bool not_at_start) {
-  return EatsAtLeastHelper(still_to_find,
-                           budget - 1,
-                           loop_node_,
-                           not_at_start);
+  return EatsAtLeastHelper(still_to_find, budget - 1, loop_node_, not_at_start);
 }
 
 
 intptr_t ChoiceNode::EatsAtLeast(intptr_t still_to_find,
                                  intptr_t budget,
                                  bool not_at_start) {
-  return EatsAtLeastHelper(still_to_find,
-                           budget,
-                           NULL,
-                           not_at_start);
+  return EatsAtLeastHelper(still_to_find, budget, NULL, not_at_start);
 }
 
 
@@ -1761,8 +1666,8 @@
                                 QuickCheckDetails* details,
                                 bool fall_through_on_failure) {
   if (details->characters() == 0) return false;
-  GetQuickCheckDetails(
-      details, compiler, 0, trace->at_start() == Trace::FALSE_VALUE);
+  GetQuickCheckDetails(details, compiler, 0,
+                       trace->at_start() == Trace::FALSE_VALUE);
   if (details->cannot_match()) return false;
   if (!details->Rationalize(compiler->one_byte())) return false;
   ASSERT(details->characters() == 1 ||
@@ -1778,10 +1683,9 @@
     // any choice would eat, so if the bounds check fails, then none of the
     // choices can succeed, so we can just immediately backtrack, rather
     // than go to the next choice.
-    assembler->LoadCurrentCharacter(trace->cp_offset(),
-                                    bounds_check_trace->backtrack(),
-                                    !preload_has_checked_bounds,
-                                    details->characters());
+    assembler->LoadCurrentCharacter(
+        trace->cp_offset(), bounds_check_trace->backtrack(),
+        !preload_has_checked_bounds, details->characters());
   }
 
 
@@ -1948,7 +1852,7 @@
         // A mask and compare is only perfect if the differing bits form a
         // number like 00011111 with one single block of trailing 1s.
         if ((differing_bits & (differing_bits + 1)) == 0 &&
-             from + differing_bits == to) {
+            from + differing_bits == to) {
           pos->determines_perfectly = true;
         }
         uint32_t common_bits = ~SmearBitsRight(differing_bits);
@@ -1985,10 +1889,8 @@
   }
   ASSERT(characters_filled_in != details->characters());
   if (!details->cannot_match()) {
-    on_success()-> GetQuickCheckDetails(details,
-                                        compiler,
-                                        characters_filled_in,
-                                        true);
+    on_success()->GetQuickCheckDetails(details, compiler, characters_filled_in,
+                                       true);
   }
 }
 
@@ -2036,8 +1938,7 @@
   for (intptr_t i = from_index; i < characters_; i++) {
     QuickCheckDetails::Position* pos = positions(i);
     QuickCheckDetails::Position* other_pos = other->positions(i);
-    if (pos->mask != other_pos->mask ||
-        pos->value != other_pos->value ||
+    if (pos->mask != other_pos->mask || pos->value != other_pos->value ||
         !other_pos->determines_perfectly) {
       // Our mask-compare operation will be approximate unless we have the
       // exact same operation on both sides of the alternation.
@@ -2059,9 +1960,8 @@
     ASSERT(!info->visited);
     info->visited = true;
   }
-  ~VisitMarker() {
-    info_->visited = false;
-  }
+  ~VisitMarker() { info_->visited = false; }
+
  private:
   NodeInfo* info_;
 };
@@ -2087,8 +1987,8 @@
 // We need to check for the following characters: 0x39c 0x3bc 0x178.
 static inline bool RangeContainsLatin1Equivalents(CharacterRange range) {
   // TODO(dcarney): this could be a lot more efficient.
-  return range.Contains(0x39c) ||
-      range.Contains(0x3bc) || range.Contains(0x178);
+  return range.Contains(0x39c) || range.Contains(0x3bc) ||
+         range.Contains(0x178);
 }
 
 
@@ -2150,8 +2050,7 @@
       // Now they are in order so we only need to look at the first.
       intptr_t range_count = ranges->length();
       if (cc->is_negated()) {
-        if (range_count != 0 &&
-            ranges->At(0).from() == 0 &&
+        if (range_count != 0 && ranges->At(0).from() == 0 &&
             ranges->At(0).to() >= Symbols::kMaxOneCharCodeSymbol) {
           // This will be handled in a later filter.
           if (ignore_case && RangesContainLatin1Equivalents(ranges)) continue;
@@ -2226,7 +2125,7 @@
   // Only some of the nodes survived the filtering.  We need to rebuild the
   // alternatives list.
   ZoneGrowableArray<GuardedAlternative>* new_alternatives =
-      new(Z) ZoneGrowableArray<GuardedAlternative>(surviving);
+      new (Z) ZoneGrowableArray<GuardedAlternative>(surviving);
   for (intptr_t i = 0; i < choice_count; i++) {
     RegExpNode* replacement =
         (*alternatives_)[i].node()->FilterOneByte(depth - 1, ignore_case);
@@ -2269,10 +2168,8 @@
                                           bool not_at_start) {
   if (body_can_be_zero_length_ || info()->visited) return;
   VisitMarker marker(info());
-  return ChoiceNode::GetQuickCheckDetails(details,
-                                          compiler,
-                                          characters_filled_in,
-                                          not_at_start);
+  return ChoiceNode::GetQuickCheckDetails(details, compiler,
+                                          characters_filled_in, not_at_start);
 }
 
 
@@ -2297,15 +2194,12 @@
   not_at_start = (not_at_start || not_at_start_);
   intptr_t choice_count = alternatives_->length();
   ASSERT(choice_count > 0);
-  (*alternatives_)[0].node()->GetQuickCheckDetails(details,
-                                                    compiler,
-                                                    characters_filled_in,
-                                                    not_at_start);
+  (*alternatives_)[0].node()->GetQuickCheckDetails(
+      details, compiler, characters_filled_in, not_at_start);
   for (intptr_t i = 1; i < choice_count; i++) {
     QuickCheckDetails new_details(details->characters());
     RegExpNode* node = (*alternatives_)[i].node();
-    node->GetQuickCheckDetails(&new_details, compiler,
-                               characters_filled_in,
+    node->GetQuickCheckDetails(&new_details, compiler, characters_filled_in,
                                not_at_start);
     // Here we merge the quick match details of the two branches.
     details->Merge(&new_details, characters_filled_in);
@@ -2357,11 +2251,9 @@
   }
   // We already checked that we are not at the start of input so it must be
   // OK to load the previous character.
-  assembler->LoadCurrentCharacter(new_trace.cp_offset() -1,
-                                  new_trace.backtrack(),
-                                  false);
-  if (!assembler->CheckSpecialCharacterClass('n',
-                                             new_trace.backtrack())) {
+  assembler->LoadCurrentCharacter(new_trace.cp_offset() - 1,
+                                  new_trace.backtrack(), false);
+  if (!assembler->CheckSpecialCharacterClass('n', new_trace.backtrack())) {
     // Newline means \n, \r, 0x2028 or 0x2029.
     if (!compiler->one_byte()) {
       assembler->CheckCharacterAfterAnd(0x2028, 0xfffe, &ok);
@@ -2383,22 +2275,19 @@
   if (lookahead == NULL) {
     intptr_t eats_at_least =
         Utils::Minimum(kMaxLookaheadForBoyerMoore,
-                       EatsAtLeast(kMaxLookaheadForBoyerMoore,
-                                   kRecursionBudget,
+                       EatsAtLeast(kMaxLookaheadForBoyerMoore, kRecursionBudget,
                                    not_at_start));
     if (eats_at_least >= 1) {
       BoyerMooreLookahead* bm =
-          new(Z) BoyerMooreLookahead(eats_at_least, compiler, Z);
+          new (Z) BoyerMooreLookahead(eats_at_least, compiler, Z);
       FillInBMInfo(0, kRecursionBudget, bm, not_at_start);
-      if (bm->at(0)->is_non_word())
-        next_is_word_character = Trace::FALSE_VALUE;
+      if (bm->at(0)->is_non_word()) next_is_word_character = Trace::FALSE_VALUE;
       if (bm->at(0)->is_word()) next_is_word_character = Trace::TRUE_VALUE;
     }
   } else {
     if (lookahead->at(0)->is_non_word())
       next_is_word_character = Trace::FALSE_VALUE;
-    if (lookahead->at(0)->is_word())
-      next_is_word_character = Trace::TRUE_VALUE;
+    if (lookahead->at(0)->is_word()) next_is_word_character = Trace::TRUE_VALUE;
   }
   bool at_boundary = (assertion_type_ == AssertionNode::AT_BOUNDARY);
   if (next_is_word_character == Trace::UNKNOWN) {
@@ -2442,12 +2331,12 @@
 
   BlockLabel fall_through, dummy;
 
-  BlockLabel* non_word = backtrack_if_previous == kIsNonWord ?
-                         new_trace.backtrack() :
-                         &fall_through;
-  BlockLabel* word = backtrack_if_previous == kIsNonWord ?
-                     &fall_through :
-                     new_trace.backtrack();
+  BlockLabel* non_word = backtrack_if_previous == kIsNonWord
+                             ? new_trace.backtrack()
+                             : &fall_through;
+  BlockLabel* word = backtrack_if_previous == kIsNonWord
+                         ? &fall_through
+                         : new_trace.backtrack();
 
   if (new_trace.cp_offset() == 0) {
     // The start of input counts as a non-word character, so the question is
@@ -2472,9 +2361,7 @@
     details->set_cannot_match();
     return;
   }
-  return on_success()->GetQuickCheckDetails(details,
-                                            compiler,
-                                            filled_in,
+  return on_success()->GetQuickCheckDetails(details, compiler, filled_in,
                                             not_at_start);
 }
 
@@ -2501,8 +2388,7 @@
         on_success()->Emit(compiler, &at_start_trace);
         return;
       }
-    }
-    break;
+    } break;
     case AFTER_NEWLINE:
       EmitHat(compiler, on_success(), trace);
       return;
@@ -2600,13 +2486,9 @@
             break;
         }
         if (emit_function != NULL) {
-          bool bound_checked = emit_function(Z,
-                                             compiler,
-                                             quarks->At(j),
-                                             backtrack,
-                                             cp_offset + j,
-                                             *checked_up_to < cp_offset + j,
-                                             preloaded);
+          bool bound_checked = emit_function(
+              Z, compiler, quarks->At(j), backtrack, cp_offset + j,
+              *checked_up_to < cp_offset + j, preloaded);
           if (bound_checked) UpdateBoundsCheck(cp_offset + j, checked_up_to);
         }
       }
@@ -2616,14 +2498,8 @@
         if (first_element_checked && i == 0) continue;
         if (DeterminedAlready(quick_check, elm.cp_offset())) continue;
         RegExpCharacterClass* cc = elm.char_class();
-        EmitCharClass(assembler,
-                      cc,
-                      one_byte,
-                      backtrack,
-                      cp_offset,
-                      *checked_up_to < cp_offset,
-                      preloaded,
-                      Z);
+        EmitCharClass(assembler, cc, one_byte, backtrack, cp_offset,
+                      *checked_up_to < cp_offset, preloaded, Z);
         UpdateBoundsCheck(cp_offset, checked_up_to);
       }
     }
@@ -2678,12 +2554,8 @@
   if (trace->characters_preloaded() == 1) {
     for (intptr_t pass = kFirstRealPass; pass <= kLastPass; pass++) {
       if (!SkipPass(pass, compiler->ignore_case())) {
-        TextEmitPass(compiler,
-                     static_cast<TextEmitPassType>(pass),
-                     true,
-                     trace,
-                     false,
-                     &bound_checked_to);
+        TextEmitPass(compiler, static_cast<TextEmitPassType>(pass), true, trace,
+                     false, &bound_checked_to);
       }
     }
     first_elt_done = true;
@@ -2691,12 +2563,8 @@
 
   for (intptr_t pass = kFirstRealPass; pass <= kLastPass; pass++) {
     if (!SkipPass(pass, compiler->ignore_case())) {
-      TextEmitPass(compiler,
-                   static_cast<TextEmitPassType>(pass),
-                   false,
-                   trace,
-                   first_elt_done,
-                   &bound_checked_to);
+      TextEmitPass(compiler, static_cast<TextEmitPassType>(pass), false, trace,
+                   first_elt_done, &bound_checked_to);
     }
   }
 
@@ -2729,8 +2597,8 @@
     compiler->SetRegExpTooBig();
     cp_offset_ = 0;
   }
-  bound_checked_up_to_ = Utils::Maximum(static_cast<intptr_t>(0),
-                                        bound_checked_up_to_ - by);
+  bound_checked_up_to_ =
+      Utils::Maximum(static_cast<intptr_t>(0), bound_checked_up_to_ - by);
 }
 
 
@@ -2849,8 +2717,8 @@
 
 intptr_t ChoiceNode::CalculatePreloadCharacters(RegExpCompiler* compiler,
                                                 intptr_t eats_at_least) {
-  intptr_t preload_characters = Utils::Minimum(static_cast<intptr_t>(4),
-                                               eats_at_least);
+  intptr_t preload_characters =
+      Utils::Minimum(static_cast<intptr_t>(4), eats_at_least);
   if (compiler->macro_assembler()->CanReadUnaligned()) {
     bool one_byte = compiler->one_byte();
     if (one_byte) {
@@ -2876,7 +2744,7 @@
       : possible_success(),
         expects_preload(false),
         after(),
-        quick_check_details() { }
+        quick_check_details() {}
   BlockLabel possible_success;
   bool expects_preload;
   BlockLabel after;
@@ -2888,8 +2756,7 @@
 // size then it is on the stack, otherwise the excess is on the heap.
 class AlternativeGenerationList {
  public:
-  explicit AlternativeGenerationList(intptr_t count)
-      : alt_gens_(count) {
+  explicit AlternativeGenerationList(intptr_t count) : alt_gens_(count) {
     for (intptr_t i = 0; i < count && i < kAFew; i++) {
       alt_gens_.Add(a_few_alt_gens_ + i);
     }
@@ -2904,9 +2771,7 @@
     }
   }
 
-  AlternativeGeneration* at(intptr_t i) {
-    return alt_gens_[i];
-  }
+  AlternativeGeneration* at(intptr_t i) { return alt_gens_[i]; }
 
  private:
   static const intptr_t kAFew = 10;
@@ -2920,20 +2785,20 @@
 // The '2' variant is inclusive from and exclusive to.
 // This covers \s as defined in ECMA-262 5.1, 15.10.2.12,
 // which include WhiteSpace (7.2) or LineTerminator (7.3) values.
-static const intptr_t kSpaceRanges[] = { '\t', '\r' + 1, ' ', ' ' + 1,
-    0x00A0, 0x00A1, 0x1680, 0x1681, 0x180E, 0x180F, 0x2000, 0x200B,
-    0x2028, 0x202A, 0x202F, 0x2030, 0x205F, 0x2060, 0x3000, 0x3001,
-    0xFEFF, 0xFF00, 0x10000 };
+static const intptr_t kSpaceRanges[] = {
+    '\t',   '\r' + 1, ' ',    ' ' + 1, 0x00A0, 0x00A1, 0x1680, 0x1681,
+    0x180E, 0x180F,   0x2000, 0x200B,  0x2028, 0x202A, 0x202F, 0x2030,
+    0x205F, 0x2060,   0x3000, 0x3001,  0xFEFF, 0xFF00, 0x10000};
 static const intptr_t kSpaceRangeCount = ARRAY_SIZE(kSpaceRanges);
-static const intptr_t kWordRanges[] = {
-    '0', '9' + 1, 'A', 'Z' + 1, '_', '_' + 1, 'a', 'z' + 1, 0x10000 };
+static const intptr_t kWordRanges[] = {'0',     '9' + 1, 'A',     'Z' + 1, '_',
+                                       '_' + 1, 'a',     'z' + 1, 0x10000};
 static const intptr_t kWordRangeCount = ARRAY_SIZE(kWordRanges);
-static const intptr_t kDigitRanges[] = { '0', '9' + 1, 0x10000 };
+static const intptr_t kDigitRanges[] = {'0', '9' + 1, 0x10000};
 static const intptr_t kDigitRangeCount = ARRAY_SIZE(kDigitRanges);
-static const intptr_t kSurrogateRanges[] = { 0xd800, 0xe000, 0x10000 };
+static const intptr_t kSurrogateRanges[] = {0xd800, 0xe000, 0x10000};
 static const intptr_t kSurrogateRangeCount = ARRAY_SIZE(kSurrogateRanges);
-static const intptr_t kLineTerminatorRanges[] = {
-    0x000A, 0x000B, 0x000D, 0x000E, 0x2028, 0x202A, 0x10000 };
+static const intptr_t kLineTerminatorRanges[] = {0x000A, 0x000B, 0x000D, 0x000E,
+                                                 0x2028, 0x202A, 0x10000};
 static const intptr_t kLineTerminatorRangeCount =
     ARRAY_SIZE(kLineTerminatorRanges);
 
@@ -2952,7 +2817,8 @@
   if (interval.to() - interval.from() >= kMapSize - 1) {
     if (map_count_ != kMapSize) {
       map_count_ = kMapSize;
-      for (intptr_t i = 0; i < kMapSize; i++) (*map_)[i] = true;
+      for (intptr_t i = 0; i < kMapSize; i++)
+        (*map_)[i] = true;
     }
     return;
   }
@@ -2971,23 +2837,24 @@
   s_ = w_ = d_ = kLatticeUnknown;
   if (map_count_ != kMapSize) {
     map_count_ = kMapSize;
-    for (intptr_t i = 0; i < kMapSize; i++) (*map_)[i] = true;
+    for (intptr_t i = 0; i < kMapSize; i++)
+      (*map_)[i] = true;
   }
 }
 
 
-BoyerMooreLookahead::BoyerMooreLookahead(
-    intptr_t length, RegExpCompiler* compiler, Zone* zone)
-    : length_(length),
-      compiler_(compiler) {
+BoyerMooreLookahead::BoyerMooreLookahead(intptr_t length,
+                                         RegExpCompiler* compiler,
+                                         Zone* zone)
+    : length_(length), compiler_(compiler) {
   if (compiler->one_byte()) {
     max_char_ = Symbols::kMaxOneCharCodeSymbol;
   } else {
     max_char_ = Utf16::kMaxCodeUnit;
   }
-  bitmaps_ = new(zone) ZoneGrowableArray<BoyerMoorePositionInfo*>(length);
+  bitmaps_ = new (zone) ZoneGrowableArray<BoyerMoorePositionInfo*>(length);
   for (intptr_t i = 0; i < length; i++) {
-    bitmaps_->Add(new(zone) BoyerMoorePositionInfo(zone));
+    bitmaps_->Add(new (zone) BoyerMoorePositionInfo(zone));
   }
 }
 
@@ -3000,8 +2867,7 @@
   // If more than 32 characters out of 128 can occur it is unlikely that we can
   // be lucky enough to step forwards much of the time.
   const intptr_t kMaxMax = 32;
-  for (intptr_t max_number_of_chars = 4;
-       max_number_of_chars < kMaxMax;
+  for (intptr_t max_number_of_chars = 4; max_number_of_chars < kMaxMax;
        max_number_of_chars *= 2) {
     biggest_points =
         FindBestInterval(max_number_of_chars, biggest_points, from, to);
@@ -3017,22 +2883,24 @@
 // of points as the product of width-of-the-range and
 // probability-of-finding-one-of-the-characters, where the probability is
 // calculated using the frequency distribution of the sample subject string.
-intptr_t BoyerMooreLookahead::FindBestInterval(
-    intptr_t max_number_of_chars,
-    intptr_t old_biggest_points,
-    intptr_t* from,
-    intptr_t* to) {
+intptr_t BoyerMooreLookahead::FindBestInterval(intptr_t max_number_of_chars,
+                                               intptr_t old_biggest_points,
+                                               intptr_t* from,
+                                               intptr_t* to) {
   intptr_t biggest_points = old_biggest_points;
   static const intptr_t kSize = RegExpMacroAssembler::kTableSize;
-  for (intptr_t i = 0; i < length_; ) {
-    while (i < length_ && Count(i) > max_number_of_chars) i++;
+  for (intptr_t i = 0; i < length_;) {
+    while (i < length_ && Count(i) > max_number_of_chars)
+      i++;
     if (i == length_) break;
     intptr_t remembered_from = i;
     bool union_map[kSize];
-    for (intptr_t j = 0; j < kSize; j++) union_map[j] = false;
+    for (intptr_t j = 0; j < kSize; j++)
+      union_map[j] = false;
     while (i < length_ && Count(i) <= max_number_of_chars) {
       BoyerMoorePositionInfo* map = bitmaps_->At(i);
-      for (intptr_t j = 0; j < kSize; j++) union_map[j] |= map->at(j);
+      for (intptr_t j = 0; j < kSize; j++)
+        union_map[j] |= map->at(j);
       i++;
     }
     intptr_t frequency = 0;
@@ -3051,8 +2919,9 @@
     // dividing by 2 we switch off the skipping if the probability of skipping
     // is less than 50%.  This is because the multibyte mask-and-compare
     // skipping in quickcheck is more likely to do well on this case.
-    bool in_quickcheck_range = ((i - remembered_from < 4) ||
-        (compiler_->one_byte() ? remembered_from <= 4 : remembered_from <= 2));
+    bool in_quickcheck_range =
+        ((i - remembered_from < 4) ||
+         (compiler_->one_byte() ? remembered_from <= 4 : remembered_from <= 2));
     // Called 'probability' but it is only a rough estimate and can actually
     // be outside the 0-kSize range.
     intptr_t probability =
@@ -3140,8 +3009,7 @@
     masm->LoadCurrentCharacter(max_lookahead, &cont, true);
     if (max_char_ > kSize) {
       masm->CheckCharacterAfterAnd(single_character,
-                                   RegExpMacroAssembler::kTableMask,
-                                   &cont);
+                                   RegExpMacroAssembler::kTableMask, &cont);
     } else {
       masm->CheckCharacter(single_character, &cont);
     }
@@ -3152,10 +3020,10 @@
   }
 
   const TypedData& boolean_skip_table = TypedData::ZoneHandle(
-        compiler_->zone(),
-        TypedData::New(kTypedDataUint8ArrayCid, kSize, Heap::kOld));
-  intptr_t skip_distance = GetSkipTable(
-      min_lookahead, max_lookahead, boolean_skip_table);
+      compiler_->zone(),
+      TypedData::New(kTypedDataUint8ArrayCid, kSize, Heap::kOld));
+  intptr_t skip_distance =
+      GetSkipTable(min_lookahead, max_lookahead, boolean_skip_table);
   ASSERT(skip_distance != 0);
 
   BlockLabel cont, again;
@@ -3269,18 +3137,18 @@
 void ChoiceNode::SetUpPreLoad(RegExpCompiler* compiler,
                               Trace* current_trace,
                               PreloadState* state) {
-    if (state->eats_at_least_ == PreloadState::kEatsAtLeastNotYetInitialized) {
-      // Save some time by looking at most one machine word ahead.
-      state->eats_at_least_ =
-          EatsAtLeast(compiler->one_byte() ? 4 : 2, kRecursionBudget,
-                      current_trace->at_start() == Trace::FALSE_VALUE);
-    }
-    state->preload_characters_ =
-        CalculatePreloadCharacters(compiler, state->eats_at_least_);
+  if (state->eats_at_least_ == PreloadState::kEatsAtLeastNotYetInitialized) {
+    // Save some time by looking at most one machine word ahead.
+    state->eats_at_least_ =
+        EatsAtLeast(compiler->one_byte() ? 4 : 2, kRecursionBudget,
+                    current_trace->at_start() == Trace::FALSE_VALUE);
+  }
+  state->preload_characters_ =
+      CalculatePreloadCharacters(compiler, state->eats_at_least_);
 
-    state->preload_is_current_ =
-        (current_trace->characters_preloaded() == state->preload_characters_);
-    state->preload_has_checked_bounds_ = state->preload_is_current_;
+  state->preload_is_current_ =
+      (current_trace->characters_preloaded() == state->preload_characters_);
+  state->preload_has_checked_bounds_ = state->preload_is_current_;
 }
 
 
@@ -3311,12 +3179,8 @@
   AlternativeGenerationList alt_gens(choice_count);
 
   if (choice_count > 1 && text_length != kNodeIsTooComplexForGreedyLoops) {
-    trace = EmitGreedyLoop(compiler,
-                           trace,
-                           &alt_gens,
-                           &preload,
-                           &greedy_loop_state,
-                           text_length);
+    trace = EmitGreedyLoop(compiler, trace, &alt_gens, &preload,
+                           &greedy_loop_state, text_length);
   } else {
     // TODO(erikcorry): Delete this.  We don't need this label, but it makes us
     // match the traces produced pre-cleanup.
@@ -3325,11 +3189,7 @@
 
     preload.eats_at_least_ = EmitOptimizedUnanchoredSearch(compiler, trace);
 
-    EmitChoices(compiler,
-                &alt_gens,
-                0,
-                trace,
-                &preload);
+    EmitChoices(compiler, &alt_gens, 0, trace, &preload);
   }
 
   // At this point we need to generate slow checks for the alternatives where
@@ -3347,11 +3207,8 @@
     }
     bool next_expects_preload =
         i == choice_count - 1 ? false : alt_gens.at(i + 1)->expects_preload;
-    EmitOutOfLineContinuation(compiler,
-                              &new_trace,
-                              alternatives_->At(i),
-                              alt_gen,
-                              preload.preload_characters_,
+    EmitOutOfLineContinuation(compiler, &new_trace, alternatives_->At(i),
+                              alt_gen, preload.preload_characters_,
                               next_expects_preload);
   }
 }
@@ -3388,11 +3245,7 @@
 
   Trace* new_trace = greedy_loop_state->counter_backtrack_trace();
 
-  EmitChoices(compiler,
-              alt_gens,
-              1,
-              new_trace,
-              preload);
+  EmitChoices(compiler, alt_gens, 1, new_trace, preload);
 
   macro_assembler->BindBlock(greedy_loop_state->label());
   // If we have unwound to the bottom then backtrack.
@@ -3436,12 +3289,11 @@
   // small alternation.
   BoyerMooreLookahead* bm = bm_info(false);
   if (bm == NULL) {
-    eats_at_least = Utils::Minimum(kMaxLookaheadForBoyerMoore,
-                        EatsAtLeast(kMaxLookaheadForBoyerMoore,
-                                    kRecursionBudget,
-                                    false));
+    eats_at_least = Utils::Minimum(
+        kMaxLookaheadForBoyerMoore,
+        EatsAtLeast(kMaxLookaheadForBoyerMoore, kRecursionBudget, false));
     if (eats_at_least >= 1) {
-      bm = new(Z) BoyerMooreLookahead(eats_at_least, compiler, Z);
+      bm = new (Z) BoyerMooreLookahead(eats_at_least, compiler, Z);
       GuardedAlternative alt0 = alternatives_->At(0);
       alt0.node()->FillInBMInfo(0, kRecursionBudget, bm, false);
     }
@@ -3476,9 +3328,8 @@
     ZoneGrowableArray<Guard*>* guards = alternative.guards();
     intptr_t guard_count = (guards == NULL) ? 0 : guards->length();
     Trace new_trace(*trace);
-    new_trace.set_characters_preloaded(preload->preload_is_current_ ?
-                                         preload->preload_characters_ :
-                                         0);
+    new_trace.set_characters_preloaded(
+        preload->preload_is_current_ ? preload->preload_characters_ : 0);
     if (preload->preload_has_checked_bounds_) {
       new_trace.set_bound_checked_up_to(preload->preload_characters_);
     }
@@ -3491,13 +3342,10 @@
     bool generate_full_check_inline = false;
     if (kRegexpOptimization &&
         try_to_emit_quick_check_for_alternative(i == 0) &&
-        alternative.node()->EmitQuickCheck(compiler,
-                                           trace,
-                                           &new_trace,
-                                           preload->preload_has_checked_bounds_,
-                                           &alt_gen->possible_success,
-                                           &alt_gen->quick_check_details,
-                                           fall_through_on_failure)) {
+        alternative.node()->EmitQuickCheck(
+            compiler, trace, &new_trace, preload->preload_has_checked_bounds_,
+            &alt_gen->possible_success, &alt_gen->quick_check_details,
+            fall_through_on_failure)) {
       // Quick check was generated for this choice.
       preload->preload_is_current_ = true;
       preload->preload_has_checked_bounds_ = true;
@@ -3569,9 +3417,7 @@
     // Reload the current character, since the next quick check expects that.
     // We don't need to check bounds here because we only get into this
     // code through a quick check which already did the checked load.
-    macro_assembler->LoadCurrentCharacter(trace->cp_offset(),
-                                          NULL,
-                                          false,
+    macro_assembler->LoadCurrentCharacter(trace->cp_offset(), NULL, false,
                                           preload_characters);
     macro_assembler->GoTo(&(alt_gen->after));
   } else {
@@ -3594,35 +3440,33 @@
 
   switch (action_type_) {
     case STORE_POSITION: {
-      Trace::DeferredCapture
-          new_capture(data_.u_position_register.reg,
-                      data_.u_position_register.is_capture,
-                      trace);
+      Trace::DeferredCapture new_capture(data_.u_position_register.reg,
+                                         data_.u_position_register.is_capture,
+                                         trace);
       Trace new_trace = *trace;
       new_trace.add_action(&new_capture);
       on_success()->Emit(compiler, &new_trace);
       break;
     }
     case INCREMENT_REGISTER: {
-      Trace::DeferredIncrementRegister
-          new_increment(data_.u_increment_register.reg);
+      Trace::DeferredIncrementRegister new_increment(
+          data_.u_increment_register.reg);
       Trace new_trace = *trace;
       new_trace.add_action(&new_increment);
       on_success()->Emit(compiler, &new_trace);
       break;
     }
     case SET_REGISTER: {
-      Trace::DeferredSetRegister
-          new_set(data_.u_store_register.reg, data_.u_store_register.value);
+      Trace::DeferredSetRegister new_set(data_.u_store_register.reg,
+                                         data_.u_store_register.value);
       Trace new_trace = *trace;
       new_trace.add_action(&new_set);
       on_success()->Emit(compiler, &new_trace);
       break;
     }
     case CLEAR_CAPTURES: {
-      Trace::DeferredClearCaptures
-        new_capture(Interval(data_.u_clear_captures.range_from,
-                             data_.u_clear_captures.range_to));
+      Trace::DeferredClearCaptures new_capture(Interval(
+          data_.u_clear_captures.range_from, data_.u_clear_captures.range_to));
       Trace new_trace = *trace;
       new_trace.add_action(&new_capture);
       on_success()->Emit(compiler, &new_trace);
@@ -3722,8 +3566,7 @@
 
   ASSERT(start_reg_ + 1 == end_reg_);
   if (compiler->ignore_case()) {
-    assembler->CheckNotBackReferenceIgnoreCase(start_reg_,
-                                               trace->backtrack());
+    assembler->CheckNotBackReferenceIgnoreCase(start_reg_, trace->backtrack());
   } else {
     assembler->CheckNotBackReference(start_reg_, trace->backtrack());
   }
@@ -3738,16 +3581,15 @@
 #ifdef DEBUG
 
 
-class DotPrinter: public NodeVisitor {
+class DotPrinter : public NodeVisitor {
  public:
   explicit DotPrinter(bool ignore_case) {}
   void PrintNode(const char* label, RegExpNode* node);
   void Visit(RegExpNode* node);
   void PrintAttributes(RegExpNode* from);
   void PrintOnFailure(RegExpNode* from, RegExpNode* to);
-#define DECLARE_VISIT(Type)                                          \
-  virtual void Visit##Type(Type##Node* that);
-FOR_EACH_NODE_TYPE(DECLARE_VISIT)
+#define DECLARE_VISIT(Type) virtual void Visit##Type(Type##Node* that);
+  FOR_EACH_NODE_TYPE(DECLARE_VISIT)
 #undef DECLARE_VISIT
 };
 
@@ -3813,19 +3655,21 @@
 
 
 void DotPrinter::PrintAttributes(RegExpNode* that) {
-  OS::Print("  a%p [shape=Mrecord, color=grey, fontcolor=grey, "
-            "margin=0.1, fontsize=10, label=\"{", that);
+  OS::Print(
+      "  a%p [shape=Mrecord, color=grey, fontcolor=grey, "
+      "margin=0.1, fontsize=10, label=\"{",
+      that);
   AttributePrinter printer;
   NodeInfo* info = that->info();
   printer.PrintBit("NI", info->follows_newline_interest);
   printer.PrintBit("WI", info->follows_word_interest);
   printer.PrintBit("SI", info->follows_start_interest);
   BlockLabel* label = that->label();
-  if (label->IsBound())
-    printer.PrintPositive("@", label->Position());
-  OS::Print("}\"];\n"
-            "  a%p -> n%p [style=dashed, color=grey, arrowhead=none];\n",
-            that, that);
+  if (label->IsBound()) printer.PrintPositive("@", label->Position());
+  OS::Print(
+      "}\"];\n"
+      "  a%p -> n%p [style=dashed, color=grey, arrowhead=none];\n",
+      that, that);
 }
 
 
@@ -3985,20 +3829,20 @@
 RegExpNode* RegExpAtom::ToNode(RegExpCompiler* compiler,
                                RegExpNode* on_success) {
   ZoneGrowableArray<TextElement>* elms =
-      new(OZ) ZoneGrowableArray<TextElement>(1);
+      new (OZ) ZoneGrowableArray<TextElement>(1);
   elms->Add(TextElement::Atom(this));
-  return new(OZ) TextNode(elms, on_success);
+  return new (OZ) TextNode(elms, on_success);
 }
 
 
 RegExpNode* RegExpText::ToNode(RegExpCompiler* compiler,
                                RegExpNode* on_success) {
   ZoneGrowableArray<TextElement>* elms =
-      new(OZ) ZoneGrowableArray<TextElement>(1);
-  for (intptr_t  i = 0; i < elements()->length(); i++) {
+      new (OZ) ZoneGrowableArray<TextElement>(1);
+  for (intptr_t i = 0; i < elements()->length(); i++) {
     elms->Add(elements()->At(i));
   }
-  return new(OZ) TextNode(elms, on_success);
+  return new (OZ) TextNode(elms, on_success);
 }
 
 
@@ -4022,7 +3866,7 @@
       return false;
     }
     range = ranges->At((i >> 1) + 1);
-    if (special_class[i+1] != range.from()) {
+    if (special_class[i + 1] != range.from()) {
       return false;
     }
   }
@@ -4069,14 +3913,12 @@
     set_.set_standard_set_type('S');
     return true;
   }
-  if (CompareInverseRanges(set_.ranges(),
-                           kLineTerminatorRanges,
+  if (CompareInverseRanges(set_.ranges(), kLineTerminatorRanges,
                            kLineTerminatorRangeCount)) {
     set_.set_standard_set_type('.');
     return true;
   }
-  if (CompareRanges(set_.ranges(),
-                    kLineTerminatorRanges,
+  if (CompareRanges(set_.ranges(), kLineTerminatorRanges,
                     kLineTerminatorRangeCount)) {
     set_.set_standard_set_type('n');
     return true;
@@ -4095,7 +3937,7 @@
 
 RegExpNode* RegExpCharacterClass::ToNode(RegExpCompiler* compiler,
                                          RegExpNode* on_success) {
-  return new(OZ) TextNode(this, on_success);
+  return new (OZ) TextNode(this, on_success);
 }
 
 
@@ -4103,11 +3945,10 @@
                                       RegExpNode* on_success) {
   ZoneGrowableArray<RegExpTree*>* alternatives = this->alternatives();
   intptr_t length = alternatives->length();
-  ChoiceNode* result =
-      new(OZ) ChoiceNode(length, OZ);
+  ChoiceNode* result = new (OZ) ChoiceNode(length, OZ);
   for (intptr_t i = 0; i < length; i++) {
-    GuardedAlternative alternative(alternatives->At(i)->ToNode(compiler,
-                                                               on_success));
+    GuardedAlternative alternative(
+        alternatives->At(i)->ToNode(compiler, on_success));
     result->AddAlternative(alternative);
   }
   return result;
@@ -4116,12 +3957,7 @@
 
 RegExpNode* RegExpQuantifier::ToNode(RegExpCompiler* compiler,
                                      RegExpNode* on_success) {
-  return ToNode(min(),
-                max(),
-                is_greedy(),
-                body(),
-                compiler,
-                on_success);
+  return ToNode(min(), max(), is_greedy(), body(), compiler, on_success);
 }
 
 
@@ -4207,14 +4043,13 @@
     // Only unroll if there are no captures and the body can't be
     // empty.
     {
-      RegExpExpansionLimiter limiter(
-          compiler, min + ((max != min) ? 1 : 0));
+      RegExpExpansionLimiter limiter(compiler, min + ((max != min) ? 1 : 0));
       if (min > 0 && min <= kMaxUnrolledMinMatches && limiter.ok_to_expand()) {
         intptr_t new_max = (max == kInfinity) ? max : max - min;
         // Recurse once to get the loop or optional matches after the fixed
         // ones.
-        RegExpNode* answer = ToNode(
-            0, new_max, is_greedy, body, compiler, on_success, true);
+        RegExpNode* answer =
+            ToNode(0, new_max, is_greedy, body, compiler, on_success, true);
         // Unroll the forced matches from 0 to min.  This can cause chains of
         // TextNodes (which the parser does not generate).  These should be
         // combined if it turns out they hinder good code generation.
@@ -4231,7 +4066,7 @@
         // Unroll the optional matches up to max.
         RegExpNode* answer = on_success;
         for (intptr_t i = 0; i < max; i++) {
-          ChoiceNode* alternation = new(zone) ChoiceNode(2, zone);
+          ChoiceNode* alternation = new (zone) ChoiceNode(2, zone);
           if (is_greedy) {
             alternation->AddAlternative(
                 GuardedAlternative(body->ToNode(compiler, answer)));
@@ -4251,22 +4086,20 @@
   bool has_min = min > 0;
   bool has_max = max < RegExpTree::kInfinity;
   bool needs_counter = has_min || has_max;
-  intptr_t reg_ctr = needs_counter
-      ? compiler->AllocateRegister()
-      : RegExpCompiler::kNoRegister;
-  LoopChoiceNode* center = new(zone) LoopChoiceNode(body->min_match() == 0,
-                                                       zone);
+  intptr_t reg_ctr = needs_counter ? compiler->AllocateRegister()
+                                   : RegExpCompiler::kNoRegister;
+  LoopChoiceNode* center =
+      new (zone) LoopChoiceNode(body->min_match() == 0, zone);
   if (not_at_start) center->set_not_at_start();
-  RegExpNode* loop_return = needs_counter
-      ? static_cast<RegExpNode*>(ActionNode::IncrementRegister(reg_ctr, center))
-      : static_cast<RegExpNode*>(center);
+  RegExpNode* loop_return =
+      needs_counter ? static_cast<RegExpNode*>(
+                          ActionNode::IncrementRegister(reg_ctr, center))
+                    : static_cast<RegExpNode*>(center);
   if (body_can_be_empty) {
     // If the body can be empty we need to check if it was and then
     // backtrack.
-    loop_return = ActionNode::EmptyMatchCheck(body_start_reg,
-                                              reg_ctr,
-                                              min,
-                                              loop_return);
+    loop_return =
+        ActionNode::EmptyMatchCheck(body_start_reg, reg_ctr, min, loop_return);
   }
   RegExpNode* body_node = body->ToNode(compiler, loop_return);
   if (body_can_be_empty) {
@@ -4280,13 +4113,12 @@
   }
   GuardedAlternative body_alt(body_node);
   if (has_max) {
-    Guard* body_guard =
-        new(zone) Guard(reg_ctr, Guard::LT, max);
+    Guard* body_guard = new (zone) Guard(reg_ctr, Guard::LT, max);
     body_alt.AddGuard(body_guard, zone);
   }
   GuardedAlternative rest_alt(on_success);
   if (has_min) {
-    Guard* rest_guard = new(zone) Guard(reg_ctr, Guard::GEQ, min);
+    Guard* rest_guard = new (zone) Guard(reg_ctr, Guard::GEQ, min);
     rest_alt.AddGuard(rest_guard, zone);
   }
   if (is_greedy) {
@@ -4331,17 +4163,14 @@
       CharacterRange::AddClassEscape('n', newline_ranges);
       RegExpCharacterClass* newline_atom = new RegExpCharacterClass('n');
       TextNode* newline_matcher = new TextNode(
-         newline_atom,
-         ActionNode::PositiveSubmatchSuccess(stack_pointer_register,
-                                             position_register,
-                                             0,  // No captures inside.
-                                             -1,  // Ignored if no captures.
-                                             on_success));
+          newline_atom, ActionNode::PositiveSubmatchSuccess(
+                            stack_pointer_register, position_register,
+                            0,   // No captures inside.
+                            -1,  // Ignored if no captures.
+                            on_success));
       // Create an end-of-input matcher.
       RegExpNode* end_of_line = ActionNode::BeginSubmatch(
-          stack_pointer_register,
-          position_register,
-          newline_matcher);
+          stack_pointer_register, position_register, newline_matcher);
       // Add the two alternatives to the ChoiceNode.
       GuardedAlternative eol_alternative(end_of_line);
       result->AddAlternative(eol_alternative);
@@ -4358,10 +4187,9 @@
 
 RegExpNode* RegExpBackReference::ToNode(RegExpCompiler* compiler,
                                         RegExpNode* on_success) {
-  return new(OZ)
+  return new (OZ)
       BackReferenceNode(RegExpCapture::StartRegister(index()),
-                        RegExpCapture::EndRegister(index()),
-                        on_success);
+                        RegExpCapture::EndRegister(index()), on_success);
 }
 
 
@@ -4380,20 +4208,16 @@
   const intptr_t register_of_first_capture = 2;
   intptr_t register_count = capture_count_ * registers_per_capture;
   intptr_t register_start =
-    register_of_first_capture + capture_from_ * registers_per_capture;
+      register_of_first_capture + capture_from_ * registers_per_capture;
 
   RegExpNode* success;
   if (is_positive()) {
     RegExpNode* node = ActionNode::BeginSubmatch(
-        stack_pointer_register,
-        position_register,
-        body()->ToNode(
-            compiler,
-            ActionNode::PositiveSubmatchSuccess(stack_pointer_register,
-                                                position_register,
-                                                register_count,
-                                                register_start,
-                                                on_success)));
+        stack_pointer_register, position_register,
+        body()->ToNode(compiler,
+                       ActionNode::PositiveSubmatchSuccess(
+                           stack_pointer_register, position_register,
+                           register_count, register_start, on_success)));
     return node;
   } else {
     // We use a ChoiceNode for a negative lookahead because it has most of
@@ -4408,19 +4232,12 @@
     // checks.
 
     GuardedAlternative body_alt(
-        body()->ToNode(
-            compiler,
-            success = new(OZ) NegativeSubmatchSuccess(stack_pointer_register,
-                                                      position_register,
-                                                      register_count,
-                                                      register_start,
-                                                      OZ)));
-    ChoiceNode* choice_node =
-        new(OZ) NegativeLookaheadChoiceNode(body_alt,
-                                            GuardedAlternative(on_success),
-                                            OZ);
-    return ActionNode::BeginSubmatch(stack_pointer_register,
-                                     position_register,
+        body()->ToNode(compiler, success = new (OZ) NegativeSubmatchSuccess(
+                                     stack_pointer_register, position_register,
+                                     register_count, register_start, OZ)));
+    ChoiceNode* choice_node = new (OZ) NegativeLookaheadChoiceNode(
+        body_alt, GuardedAlternative(on_success), OZ);
+    return ActionNode::BeginSubmatch(stack_pointer_register, position_register,
                                      choice_node);
   }
 }
@@ -4467,13 +4284,13 @@
 }
 
 
-static void AddClassNegated(const intptr_t *elmv,
+static void AddClassNegated(const intptr_t* elmv,
                             intptr_t elmc,
                             ZoneGrowableArray<CharacterRange>* ranges) {
   elmc--;
   ASSERT(elmv[elmc] == 0x10000);
   ASSERT(elmv[0] != 0x0000);
-  ASSERT(elmv[elmc-1] != Utf16::kMaxCodeUnit);
+  ASSERT(elmv[elmc - 1] != Utf16::kMaxCodeUnit);
   uint16_t last = 0x0000;
   for (intptr_t i = 0; i < elmc; i += 2) {
     ASSERT(last <= elmv[i] - 1);
@@ -4507,9 +4324,7 @@
       AddClassNegated(kDigitRanges, kDigitRangeCount, ranges);
       break;
     case '.':
-      AddClassNegated(kLineTerminatorRanges,
-                      kLineTerminatorRangeCount,
-                      ranges);
+      AddClassNegated(kLineTerminatorRanges, kLineTerminatorRangeCount, ranges);
       break;
     // This is not a character range as defined by the spec but a
     // convenient shorthand for a character class that matches any
@@ -4520,9 +4335,7 @@
     // This is the set of characters matched by the $ and ^ symbols
     // in multiline mode.
     case 'n':
-      AddClass(kLineTerminatorRanges,
-               kLineTerminatorRangeCount,
-               ranges);
+      AddClass(kLineTerminatorRanges, kLineTerminatorRangeCount, ranges);
       break;
     default:
       UNREACHABLE();
@@ -4531,9 +4344,9 @@
 
 
 void CharacterRange::AddCaseEquivalents(
-                        ZoneGrowableArray<CharacterRange>* ranges,
-                        bool is_one_byte,
-                        Zone* zone) {
+    ZoneGrowableArray<CharacterRange>* ranges,
+    bool is_one_byte,
+    Zone* zone) {
   uint16_t bottom = from();
   uint16_t top = to();
   if (is_one_byte && !RangeContainsLatin1Equivalents(*this)) {
@@ -4548,7 +4361,8 @@
   int32_t chars[unibrow::Ecma262UnCanonicalize::kMaxWidth];
   if (top == bottom) {
     // If this is a singleton we just expand the one character.
-    intptr_t length = jsregexp_uncanonicalize.get(bottom, '\0', chars); // NOLINT
+    intptr_t length =
+        jsregexp_uncanonicalize.get(bottom, '\0', chars);  // NOLINT
     for (intptr_t i = 0; i < length; i++) {
       uint32_t chr = chars[i];
       if (chr != bottom) {
@@ -4586,7 +4400,7 @@
         block_end = range[0];
       }
       intptr_t end = (block_end > top) ? top : block_end;
-      length = jsregexp_uncanonicalize.get(block_end, '\0', range); // NOLINT
+      length = jsregexp_uncanonicalize.get(block_end, '\0', range);  // NOLINT
       for (intptr_t i = 0; i < length; i++) {
         uint32_t c = range[i];
         uint16_t range_from = c - (block_end - pos);
@@ -4644,9 +4458,9 @@
 
 
 static intptr_t InsertRangeInCanonicalList(
-                    ZoneGrowableArray<CharacterRange>* list,
-                    intptr_t count,
-                    CharacterRange insert) {
+    ZoneGrowableArray<CharacterRange>* list,
+    intptr_t count,
+    CharacterRange insert) {
   // Inserts a range into list[0..count[, which must be sorted
   // by from value and non-overlapping and non-adjacent, using at most
   // list[0..count] for the result. Returns the number of resulting
@@ -4734,11 +4548,10 @@
   // list, in order).
   // Notice that inserting a range can reduce the number of ranges in the
   // result due to combining of adjacent and overlapping ranges.
-  intptr_t read = i;  // Range to insert.
+  intptr_t read = i;           // Range to insert.
   intptr_t num_canonical = i;  // Length of canonicalized part of list.
   do {
-    num_canonical = InsertRangeInCanonicalList(character_ranges,
-                                               num_canonical,
+    num_canonical = InsertRangeInCanonicalList(character_ranges, num_canonical,
                                                character_ranges->At(read));
     read++;
   } while (read < n);
@@ -4776,8 +4589,7 @@
 
 
 // Workaround for the fact that ZoneGrowableArray does not have contains().
-static bool ArrayContains(ZoneGrowableArray<unsigned>* array,
-                          unsigned value) {
+static bool ArrayContains(ZoneGrowableArray<unsigned>* array, unsigned value) {
   for (intptr_t i = 0; i < array->length(); i++) {
     if (array->At(i) == value) {
       return true;
@@ -4792,7 +4604,7 @@
     first_ |= (1 << value);
   } else {
     if (remaining_ == NULL)
-      remaining_ = new(zone) ZoneGrowableArray<unsigned>(1);
+      remaining_ = new (zone) ZoneGrowableArray<unsigned>(1);
 
     bool remaining_contains_value = ArrayContains(remaining_, value);
     if (remaining_->is_empty() || !remaining_contains_value) {
@@ -4818,8 +4630,7 @@
 
 
 void Analysis::EnsureAnalyzed(RegExpNode* that) {
-  if (that->info()->been_analyzed || that->info()->being_analyzed)
-    return;
+  if (that->info()->been_analyzed || that->info()->being_analyzed) return;
   that->info()->being_analyzed = true;
   that->Accept(this);
   that->info()->being_analyzed = false;
@@ -4967,8 +4778,7 @@
         if (bm->compiler()->ignore_case()) {
           int32_t chars[unibrow::Ecma262UnCanonicalize::kMaxWidth];
           intptr_t length = GetCaseIndependentLetters(
-              character,
-              bm->max_char() == Symbols::kMaxOneCharCodeSymbol,
+              character, bm->max_char() == Symbols::kMaxOneCharCodeSymbol,
               chars);
           for (intptr_t j = 0; j < length; j++) {
             bm->Set(offset, chars[j]);
@@ -4987,8 +4797,8 @@
         for (intptr_t k = 0; k < ranges->length(); k++) {
           CharacterRange& range = (*ranges)[k];
           if (range.from() > max_char) continue;
-          intptr_t to = Utils::Minimum(max_char,
-                                       static_cast<intptr_t>(range.to()));
+          intptr_t to =
+              Utils::Minimum(max_char, static_cast<intptr_t>(range.to()));
           bm->SetInterval(offset, Interval(range.from(), to));
         }
       }
@@ -4999,9 +4809,7 @@
     if (initial_offset == 0) set_bm_info(not_at_start, bm);
     return;
   }
-  on_success()->FillInBMInfo(offset,
-                             budget - 1,
-                             bm,
+  on_success()->FillInBMInfo(offset, budget - 1, bm,
                              true);  // Not at start after a text node.
   if (initial_offset == 0) set_bm_info(not_at_start, bm);
 }
@@ -5016,6 +4824,7 @@
 
   const Function& function = parsed_function->function();
   const intptr_t specialization_cid = function.string_specialization_cid();
+  const intptr_t is_sticky = function.is_sticky_specialization();
   const bool is_one_byte = (specialization_cid == kOneByteStringCid ||
                             specialization_cid == kExternalOneByteStringCid);
   RegExp& regexp = RegExp::Handle(zone, function.regexp());
@@ -5039,35 +4848,27 @@
   // I'm not sure the performance gains are relevant enough.
 
   // Wrap the body of the regexp in capture #0.
-  RegExpNode* captured_body = RegExpCapture::ToNode(data->tree,
-                                                    0,
-                                                    &compiler,
-                                                    compiler.accept());
+  RegExpNode* captured_body =
+      RegExpCapture::ToNode(data->tree, 0, &compiler, compiler.accept());
 
   RegExpNode* node = captured_body;
-  bool is_end_anchored = data->tree->IsAnchoredAtEnd();
-  bool is_start_anchored = data->tree->IsAnchoredAtStart();
+  const bool is_end_anchored = data->tree->IsAnchoredAtEnd();
+  const bool is_start_anchored = data->tree->IsAnchoredAtStart();
   intptr_t max_length = data->tree->max_match();
-  if (!is_start_anchored) {
+  if (!is_start_anchored && !is_sticky) {
     // Add a .*? at the beginning, outside the body capture, unless
-    // this expression is anchored at the beginning.
-    RegExpNode* loop_node =
-        RegExpQuantifier::ToNode(0,
-                                 RegExpTree::kInfinity,
-                                 false,
-                                 new(zone) RegExpCharacterClass('*'),
-                                 &compiler,
-                                 captured_body,
-                                 data->contains_anchor);
+    // this expression is anchored at the beginning or is sticky.
+    RegExpNode* loop_node = RegExpQuantifier::ToNode(
+        0, RegExpTree::kInfinity, false, new (zone) RegExpCharacterClass('*'),
+        &compiler, captured_body, data->contains_anchor);
 
     if (data->contains_anchor) {
       // Unroll loop once, to take care of the case that might start
       // at the start of input.
-      ChoiceNode* first_step_node = new(zone) ChoiceNode(2, zone);
+      ChoiceNode* first_step_node = new (zone) ChoiceNode(2, zone);
       first_step_node->AddAlternative(GuardedAlternative(captured_body));
-      first_step_node->AddAlternative(GuardedAlternative(
-          new(zone) TextNode(
-              new(zone) RegExpCharacterClass('*'), loop_node)));
+      first_step_node->AddAlternative(GuardedAlternative(new (zone) TextNode(
+          new (zone) RegExpCharacterClass('*'), loop_node)));
       node = first_step_node;
     } else {
       node = loop_node;
@@ -5082,7 +4883,7 @@
     }
   }
 
-  if (node == NULL) node = new(zone) EndNode(EndNode::BACKTRACK, zone);
+  if (node == NULL) node = new (zone) EndNode(EndNode::BACKTRACK, zone);
   data->node = node;
   Analysis analysis(ignore_case, is_one_byte);
   analysis.EnsureAnalyzed(node);
@@ -5094,17 +4895,13 @@
   // Native regexp implementation.
 
   IRRegExpMacroAssembler* macro_assembler =
-      new(zone) IRRegExpMacroAssembler(specialization_cid,
-                                       data->capture_count,
-                                       parsed_function,
-                                       ic_data_array,
-                                       zone);
+      new (zone) IRRegExpMacroAssembler(specialization_cid, data->capture_count,
+                                        parsed_function, ic_data_array, zone);
 
   // Inserted here, instead of in Assembler, because it depends on information
   // in the AST that isn't replicated in the Node structure.
   static const intptr_t kMaxBacksearchLimit = 1024;
-  if (is_end_anchored &&
-      !is_start_anchored &&
+  if (is_end_anchored && !is_start_anchored && !is_sticky &&
       max_length < kMaxBacksearchLimit) {
     macro_assembler->SetCurrentPositionFromEnd(max_length);
   }
@@ -5117,10 +4914,7 @@
   }
 
   RegExpEngine::CompilationResult result =
-      compiler.Assemble(macro_assembler,
-                        node,
-                        data->capture_count,
-                        pattern);
+      compiler.Assemble(macro_assembler, node, data->capture_count, pattern);
 
   if (FLAG_trace_irregexp) {
     macro_assembler->PrintBlocks();
@@ -5134,6 +4928,7 @@
     RegExpCompileData* data,
     const RegExp& regexp,
     bool is_one_byte,
+    bool is_sticky,
     Zone* zone) {
   ASSERT(FLAG_interpret_irregexp);
   const String& pattern = String::Handle(zone, regexp.pattern());
@@ -5156,35 +4951,27 @@
   // I'm not sure the performance gains are relevant enough.
 
   // Wrap the body of the regexp in capture #0.
-  RegExpNode* captured_body = RegExpCapture::ToNode(data->tree,
-                                                    0,
-                                                    &compiler,
-                                                    compiler.accept());
+  RegExpNode* captured_body =
+      RegExpCapture::ToNode(data->tree, 0, &compiler, compiler.accept());
 
   RegExpNode* node = captured_body;
   bool is_end_anchored = data->tree->IsAnchoredAtEnd();
   bool is_start_anchored = data->tree->IsAnchoredAtStart();
   intptr_t max_length = data->tree->max_match();
-  if (!is_start_anchored) {
+  if (!is_start_anchored && !is_sticky) {
     // Add a .*? at the beginning, outside the body capture, unless
     // this expression is anchored at the beginning.
-    RegExpNode* loop_node =
-        RegExpQuantifier::ToNode(0,
-                                 RegExpTree::kInfinity,
-                                 false,
-                                 new(zone) RegExpCharacterClass('*'),
-                                 &compiler,
-                                 captured_body,
-                                 data->contains_anchor);
+    RegExpNode* loop_node = RegExpQuantifier::ToNode(
+        0, RegExpTree::kInfinity, false, new (zone) RegExpCharacterClass('*'),
+        &compiler, captured_body, data->contains_anchor);
 
     if (data->contains_anchor) {
       // Unroll loop once, to take care of the case that might start
       // at the start of input.
-      ChoiceNode* first_step_node = new(zone) ChoiceNode(2, zone);
+      ChoiceNode* first_step_node = new (zone) ChoiceNode(2, zone);
       first_step_node->AddAlternative(GuardedAlternative(captured_body));
-      first_step_node->AddAlternative(GuardedAlternative(
-          new(zone) TextNode(
-              new(zone) RegExpCharacterClass('*'), loop_node)));
+      first_step_node->AddAlternative(GuardedAlternative(new (zone) TextNode(
+          new (zone) RegExpCharacterClass('*'), loop_node)));
       node = first_step_node;
     } else {
       node = loop_node;
@@ -5199,7 +4986,7 @@
     }
   }
 
-  if (node == NULL) node = new(zone) EndNode(EndNode::BACKTRACK, zone);
+  if (node == NULL) node = new (zone) EndNode(EndNode::BACKTRACK, zone);
   data->node = node;
   Analysis analysis(ignore_case, is_one_byte);
   analysis.EnsureAnalyzed(node);
@@ -5212,13 +4999,12 @@
 
   ZoneGrowableArray<uint8_t> buffer(zone, 1024);
   BytecodeRegExpMacroAssembler* macro_assembler =
-      new(zone) BytecodeRegExpMacroAssembler(&buffer, zone);
+      new (zone) BytecodeRegExpMacroAssembler(&buffer, zone);
 
   // Inserted here, instead of in Assembler, because it depends on information
   // in the AST that isn't replicated in the Node structure.
   static const intptr_t kMaxBacksearchLimit = 1024;
-  if (is_end_anchored &&
-      !is_start_anchored &&
+  if (is_end_anchored && !is_start_anchored && !is_sticky &&
       max_length < kMaxBacksearchLimit) {
     macro_assembler->SetCurrentPositionFromEnd(max_length);
   }
@@ -5231,10 +5017,7 @@
   }
 
   RegExpEngine::CompilationResult result =
-      compiler.Assemble(macro_assembler,
-                        node,
-                        data->capture_count,
-                        pattern);
+      compiler.Assemble(macro_assembler, node, data->capture_count, pattern);
 
   if (FLAG_trace_irregexp) {
     macro_assembler->PrintBlocks();
@@ -5244,29 +5027,30 @@
 }
 
 
-static void CreateSpecializedFunction(Thread* thread, Zone* zone,
+static void CreateSpecializedFunction(Thread* thread,
+                                      Zone* zone,
                                       const RegExp& regexp,
                                       intptr_t specialization_cid,
+                                      bool sticky,
                                       const Object& owner) {
   const intptr_t kParamCount = RegExpMacroAssembler::kParamCount;
 
-  Function& fn = Function::Handle(zone, Function::New(
-      Symbols::ColonMatcher(),
-      RawFunction::kIrregexpFunction,
-      true,  // Static.
-      false,  // Not const.
-      false,  // Not abstract.
-      false,  // Not external.
-      false,  // Not native.
-      owner,
-      TokenPosition::kMinSource));
+  Function& fn =
+      Function::Handle(zone, Function::New(Symbols::ColonMatcher(),
+                                           RawFunction::kIrregexpFunction,
+                                           true,   // Static.
+                                           false,  // Not const.
+                                           false,  // Not abstract.
+                                           false,  // Not external.
+                                           false,  // Not native.
+                                           owner, TokenPosition::kMinSource));
 
   // TODO(zerny): Share these arrays between all irregexp functions.
   fn.set_num_fixed_parameters(kParamCount);
-  fn.set_parameter_types(Array::Handle(zone, Array::New(kParamCount,
-                                                        Heap::kOld)));
-  fn.set_parameter_names(Array::Handle(zone, Array::New(kParamCount,
-                                                        Heap::kOld)));
+  fn.set_parameter_types(
+      Array::Handle(zone, Array::New(kParamCount, Heap::kOld)));
+  fn.set_parameter_names(
+      Array::Handle(zone, Array::New(kParamCount, Heap::kOld)));
   fn.SetParameterTypeAt(RegExpMacroAssembler::kParamRegExpIndex,
                         Object::dynamic_type());
   fn.SetParameterNameAt(RegExpMacroAssembler::kParamRegExpIndex,
@@ -5282,9 +5066,9 @@
   fn.set_result_type(Type::Handle(zone, Type::ArrayType()));
 
   // Cache the result.
-  regexp.set_function(specialization_cid, fn);
+  regexp.set_function(specialization_cid, sticky, fn);
 
-  fn.SetRegExpData(regexp, specialization_cid);
+  fn.SetRegExpData(regexp, specialization_cid, sticky);
   fn.set_is_debuggable(false);
 
   // The function is compiled lazily during the first call.
@@ -5310,19 +5094,20 @@
   // TODO(zerny): We might want to use normal string searching algorithms
   // for simple patterns.
   regexp.set_is_complex();
-  regexp.set_is_global();   // All dart regexps are global.
+  regexp.set_is_global();  // All dart regexps are global.
 
   if (!FLAG_interpret_irregexp) {
     const Library& lib = Library::Handle(zone, Library::CoreLibrary());
-    const Class& owner = Class::Handle(zone,
-                                       lib.LookupClass(Symbols::RegExp()));
+    const Class& owner =
+        Class::Handle(zone, lib.LookupClass(Symbols::RegExp()));
 
-    CreateSpecializedFunction(thread, zone, regexp, kOneByteStringCid, owner);
-    CreateSpecializedFunction(thread, zone, regexp, kTwoByteStringCid, owner);
-    CreateSpecializedFunction(thread, zone,
-                              regexp, kExternalOneByteStringCid, owner);
-    CreateSpecializedFunction(thread, zone,
-                              regexp, kExternalTwoByteStringCid, owner);
+    for (intptr_t cid = kOneByteStringCid; cid <= kExternalTwoByteStringCid;
+         cid++) {
+      CreateSpecializedFunction(thread, zone, regexp, cid, /*sticky=*/false,
+                                owner);
+      CreateSpecializedFunction(thread, zone, regexp, cid, /*sticky=*/true,
+                                owner);
+    }
   }
 
   return regexp.raw();
diff --git a/runtime/vm/regexp.h b/runtime/vm/regexp.h
index bc8edd5..dbb89a4 100644
--- a/runtime/vm/regexp.h
+++ b/runtime/vm/regexp.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_REGEXP_H_
-#define VM_REGEXP_H_
+#ifndef RUNTIME_VM_REGEXP_H_
+#define RUNTIME_VM_REGEXP_H_
 
 #include "vm/assembler.h"
 #include "vm/intermediate_language.h"
@@ -25,8 +25,8 @@
 // inclusive.
 class CharacterRange {
  public:
-  CharacterRange() : from_(0), to_(0) { }
-  CharacterRange(uint16_t from, uint16_t to) : from_(from), to_(to) { }
+  CharacterRange() : from_(0), to_(0) {}
+  CharacterRange(uint16_t from, uint16_t to) : from_(from), to_(to) {}
 
   static void AddClassEscape(uint16_t type,
                              ZoneGrowableArray<CharacterRange>* ranges);
@@ -81,9 +81,9 @@
 
 // A set of unsigned integers that behaves especially well on small
 // integers (< 32).  May do zone-allocation.
-class OutSet: public ZoneAllocated {
+class OutSet : public ZoneAllocated {
  public:
-  OutSet() : first_(0), remaining_(NULL), successors_(NULL) { }
+  OutSet() : first_(0), remaining_(NULL), successors_(NULL) {}
   OutSet* Extend(unsigned value, Zone* zone);
   bool Get(unsigned value) const;
   static const unsigned kFirstLimit = 32;
@@ -100,7 +100,7 @@
   ZoneGrowableArray<OutSet*>* successors() { return successors_; }
 
   OutSet(uint32_t first, ZoneGrowableArray<unsigned>* remaining)
-      : first_(first), remaining_(remaining), successors_(NULL) { }
+      : first_(first), remaining_(remaining), successors_(NULL) {}
   uint32_t first_;
   ZoneGrowableArray<unsigned>* remaining_;
   ZoneGrowableArray<OutSet*>* successors_;
@@ -108,26 +108,26 @@
 };
 
 
-#define FOR_EACH_NODE_TYPE(VISIT)                                    \
-  VISIT(End)                                                         \
-  VISIT(Action)                                                      \
-  VISIT(Choice)                                                      \
-  VISIT(BackReference)                                               \
-  VISIT(Assertion)                                                   \
+#define FOR_EACH_NODE_TYPE(VISIT)                                              \
+  VISIT(End)                                                                   \
+  VISIT(Action)                                                                \
+  VISIT(Choice)                                                                \
+  VISIT(BackReference)                                                         \
+  VISIT(Assertion)                                                             \
   VISIT(Text)
 
 
-#define FOR_EACH_REG_EXP_TREE_TYPE(VISIT)                            \
-  VISIT(Disjunction)                                                 \
-  VISIT(Alternative)                                                 \
-  VISIT(Assertion)                                                   \
-  VISIT(CharacterClass)                                              \
-  VISIT(Atom)                                                        \
-  VISIT(Quantifier)                                                  \
-  VISIT(Capture)                                                     \
-  VISIT(Lookahead)                                                   \
-  VISIT(BackReference)                                               \
-  VISIT(Empty)                                                       \
+#define FOR_EACH_REG_EXP_TREE_TYPE(VISIT)                                      \
+  VISIT(Disjunction)                                                           \
+  VISIT(Alternative)                                                           \
+  VISIT(Assertion)                                                             \
+  VISIT(CharacterClass)                                                        \
+  VISIT(Atom)                                                                  \
+  VISIT(Quantifier)                                                            \
+  VISIT(Capture)                                                               \
+  VISIT(Lookahead)                                                             \
+  VISIT(BackReference)                                                         \
+  VISIT(Empty)                                                                 \
   VISIT(Text)
 
 
@@ -138,10 +138,7 @@
 
 class TextElement {
  public:
-  enum TextType {
-    ATOM,
-    CHAR_CLASS
-  };
+  enum TextType { ATOM, CHAR_CLASS };
 
   static TextElement Atom(RegExpAtom* atom);
   static TextElement CharClass(RegExpCharacterClass* char_class);
@@ -190,7 +187,7 @@
         follows_start_interest(false),
         at_end(false),
         visited(false),
-        replacement_calculated(false) { }
+        replacement_calculated(false) {}
 
   // Returns true if the interests and assumptions of this node
   // matches the given one.
@@ -211,8 +208,7 @@
   }
 
   bool HasLookbehind() {
-    return follows_word_interest ||
-           follows_newline_interest ||
+    return follows_word_interest || follows_newline_interest ||
            follows_start_interest;
   }
 
@@ -229,18 +225,18 @@
     been_analyzed = false;
   }
 
-  bool being_analyzed: 1;
-  bool been_analyzed: 1;
+  bool being_analyzed : 1;
+  bool been_analyzed : 1;
 
   // These bits are set of this node has to know what the preceding
   // character was.
-  bool follows_word_interest: 1;
-  bool follows_newline_interest: 1;
-  bool follows_start_interest: 1;
+  bool follows_word_interest : 1;
+  bool follows_newline_interest : 1;
+  bool follows_start_interest : 1;
 
-  bool at_end: 1;
-  bool visited: 1;
-  bool replacement_calculated: 1;
+  bool at_end : 1;
+  bool visited : 1;
+  bool replacement_calculated : 1;
 };
 
 
@@ -249,15 +245,9 @@
 class QuickCheckDetails {
  public:
   QuickCheckDetails()
-      : characters_(0),
-        mask_(0),
-        value_(0),
-        cannot_match_(false) { }
+      : characters_(0), mask_(0), value_(0), cannot_match_(false) {}
   explicit QuickCheckDetails(intptr_t characters)
-      : characters_(characters),
-        mask_(0),
-        value_(0),
-        cannot_match_(false) { }
+      : characters_(characters), mask_(0), value_(0), cannot_match_(false) {}
   bool Rationalize(bool one_byte);
   // Merge in the information from another branch of an alternation.
   void Merge(QuickCheckDetails* other, intptr_t from_index);
@@ -267,7 +257,7 @@
   bool cannot_match() { return cannot_match_; }
   void set_cannot_match() { cannot_match_ = true; }
   struct Position {
-    Position() : mask(0), value(0), determines_perfectly(false) { }
+    Position() : mask(0), value(0), determines_perfectly(false) {}
     uint16_t mask;
     uint16_t value;
     bool determines_perfectly;
@@ -298,10 +288,10 @@
 };
 
 
-class RegExpNode: public ZoneAllocated {
+class RegExpNode : public ZoneAllocated {
  public:
   explicit RegExpNode(Zone* zone)
-  : replacement_(NULL), trace_count_(0), zone_(zone) {
+      : replacement_(NULL), trace_count_(0), zone_(zone) {
     bm_info_[0] = bm_info_[1] = NULL;
   }
   virtual ~RegExpNode();
@@ -315,7 +305,8 @@
   // used to indicate that we know we are not at the start of the input.  In
   // this case anchored branches will always fail and can be ignored when
   // determining how many characters are consumed on success.
-  virtual intptr_t EatsAtLeast(intptr_t still_to_find, intptr_t budget,
+  virtual intptr_t EatsAtLeast(intptr_t still_to_find,
+                               intptr_t budget,
                                bool not_at_start) = 0;
   // Emits some quick code that checks whether the preloaded characters match.
   // Falls through on certain failure, jumps to the label on possible success.
@@ -372,7 +363,7 @@
   }
   RegExpNode* set_replacement(RegExpNode* replacement) {
     info()->replacement_calculated = true;
-    replacement_ =  replacement;
+    replacement_ = replacement;
     return replacement;  // For convenience.
   }
 
@@ -428,8 +419,8 @@
 // A simple closed interval.
 class Interval {
  public:
-  Interval() : from_(kNone), to_(kNone) { }
-  Interval(intptr_t from, intptr_t to) : from_(from), to_(to) { }
+  Interval() : from_(kNone), to_(kNone) {}
+  Interval(intptr_t from, intptr_t to) : from_(from), to_(to) {}
 
   Interval Union(Interval that) {
     if (that.from_ == kNone)
@@ -457,10 +448,10 @@
 };
 
 
-class SeqRegExpNode: public RegExpNode {
+class SeqRegExpNode : public RegExpNode {
  public:
   explicit SeqRegExpNode(RegExpNode* on_success)
-      : RegExpNode(on_success->zone()), on_success_(on_success) { }
+      : RegExpNode(on_success->zone()), on_success_(on_success) {}
   RegExpNode* on_success() { return on_success_; }
   void set_on_success(RegExpNode* node) { on_success_ = node; }
   virtual RegExpNode* FilterOneByte(intptr_t depth, bool ignore_case);
@@ -480,7 +471,7 @@
 };
 
 
-class ActionNode: public SeqRegExpNode {
+class ActionNode : public SeqRegExpNode {
  public:
   enum ActionType {
     SET_REGISTER,
@@ -491,7 +482,8 @@
     EMPTY_MATCH_CHECK,
     CLEAR_CAPTURES
   };
-  static ActionNode* SetRegister(intptr_t reg, intptr_t val,
+  static ActionNode* SetRegister(intptr_t reg,
+                                 intptr_t val,
                                  RegExpNode* on_success);
   static ActionNode* IncrementRegister(intptr_t reg, RegExpNode* on_success);
   static ActionNode* StorePosition(intptr_t reg,
@@ -512,14 +504,15 @@
                                      RegExpNode* on_success);
   virtual void Accept(NodeVisitor* visitor);
   virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual intptr_t EatsAtLeast(intptr_t still_to_find, intptr_t budget,
+  virtual intptr_t EatsAtLeast(intptr_t still_to_find,
+                               intptr_t budget,
                                bool not_at_start);
   virtual void GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
                                     intptr_t filled_in,
                                     bool not_at_start) {
-    return on_success()->GetQuickCheckDetails(
-        details, compiler, filled_in, not_at_start);
+    return on_success()->GetQuickCheckDetails(details, compiler, filled_in,
+                                              not_at_start);
   }
   virtual void FillInBMInfo(intptr_t offset,
                             intptr_t budget,
@@ -561,28 +554,25 @@
     } u_clear_captures;
   } data_;
   ActionNode(ActionType action_type, RegExpNode* on_success)
-      : SeqRegExpNode(on_success),
-        action_type_(action_type) { }
+      : SeqRegExpNode(on_success), action_type_(action_type) {}
   ActionType action_type_;
   friend class DotPrinter;
 };
 
 
-class TextNode: public SeqRegExpNode {
+class TextNode : public SeqRegExpNode {
  public:
-  TextNode(ZoneGrowableArray<TextElement>* elms,
-           RegExpNode* on_success)
+  TextNode(ZoneGrowableArray<TextElement>* elms, RegExpNode* on_success)
+      : SeqRegExpNode(on_success), elms_(elms) {}
+  TextNode(RegExpCharacterClass* that, RegExpNode* on_success)
       : SeqRegExpNode(on_success),
-        elms_(elms) { }
-  TextNode(RegExpCharacterClass* that,
-           RegExpNode* on_success)
-      : SeqRegExpNode(on_success),
-        elms_(new(zone()) ZoneGrowableArray<TextElement>(1)) {
+        elms_(new (zone()) ZoneGrowableArray<TextElement>(1)) {
     elms_->Add(TextElement::CharClass(that));
   }
   virtual void Accept(NodeVisitor* visitor);
   virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual intptr_t EatsAtLeast(intptr_t still_to_find, intptr_t budget,
+  virtual intptr_t EatsAtLeast(intptr_t still_to_find,
+                               intptr_t budget,
                                bool not_at_start);
   virtual void GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
@@ -622,7 +612,7 @@
 };
 
 
-class AssertionNode: public SeqRegExpNode {
+class AssertionNode : public SeqRegExpNode {
  public:
   enum AssertionType {
     AT_END,
@@ -632,24 +622,24 @@
     AFTER_NEWLINE
   };
   static AssertionNode* AtEnd(RegExpNode* on_success) {
-    return new(on_success->zone()) AssertionNode(AT_END, on_success);
+    return new (on_success->zone()) AssertionNode(AT_END, on_success);
   }
   static AssertionNode* AtStart(RegExpNode* on_success) {
-    return new(on_success->zone()) AssertionNode(AT_START, on_success);
+    return new (on_success->zone()) AssertionNode(AT_START, on_success);
   }
   static AssertionNode* AtBoundary(RegExpNode* on_success) {
-    return new(on_success->zone()) AssertionNode(AT_BOUNDARY, on_success);
+    return new (on_success->zone()) AssertionNode(AT_BOUNDARY, on_success);
   }
   static AssertionNode* AtNonBoundary(RegExpNode* on_success) {
-    return new(on_success->zone()) AssertionNode(AT_NON_BOUNDARY,
-                                                    on_success);
+    return new (on_success->zone()) AssertionNode(AT_NON_BOUNDARY, on_success);
   }
   static AssertionNode* AfterNewline(RegExpNode* on_success) {
-    return new(on_success->zone()) AssertionNode(AFTER_NEWLINE, on_success);
+    return new (on_success->zone()) AssertionNode(AFTER_NEWLINE, on_success);
   }
   virtual void Accept(NodeVisitor* visitor);
   virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual intptr_t EatsAtLeast(intptr_t still_to_find, intptr_t budget,
+  virtual intptr_t EatsAtLeast(intptr_t still_to_find,
+                               intptr_t budget,
                                bool not_at_start);
   virtual void GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
@@ -668,19 +658,17 @@
                            Trace* trace,
                            IfPrevious backtrack_if_previous);
   AssertionNode(AssertionType t, RegExpNode* on_success)
-      : SeqRegExpNode(on_success), assertion_type_(t) { }
+      : SeqRegExpNode(on_success), assertion_type_(t) {}
   AssertionType assertion_type_;
 };
 
 
-class BackReferenceNode: public SeqRegExpNode {
+class BackReferenceNode : public SeqRegExpNode {
  public:
   BackReferenceNode(intptr_t start_reg,
                     intptr_t end_reg,
                     RegExpNode* on_success)
-      : SeqRegExpNode(on_success),
-        start_reg_(start_reg),
-        end_reg_(end_reg) { }
+      : SeqRegExpNode(on_success), start_reg_(start_reg), end_reg_(end_reg) {}
   virtual void Accept(NodeVisitor* visitor);
   intptr_t start_register() { return start_reg_; }
   intptr_t end_register() { return end_reg_; }
@@ -705,16 +693,18 @@
 };
 
 
-class EndNode: public RegExpNode {
+class EndNode : public RegExpNode {
  public:
   enum Action { ACCEPT, BACKTRACK, NEGATIVE_SUBMATCH_SUCCESS };
   explicit EndNode(Action action, Zone* zone)
-      : RegExpNode(zone), action_(action) { }
+      : RegExpNode(zone), action_(action) {}
   virtual void Accept(NodeVisitor* visitor);
   virtual void Emit(RegExpCompiler* compiler, Trace* trace);
   virtual intptr_t EatsAtLeast(intptr_t still_to_find,
-                          intptr_t recursion_depth,
-                          bool not_at_start) { return 0; }
+                               intptr_t recursion_depth,
+                               bool not_at_start) {
+    return 0;
+  }
   virtual void GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
                                     intptr_t characters_filled_in,
@@ -735,7 +725,7 @@
 };
 
 
-class NegativeSubmatchSuccess: public EndNode {
+class NegativeSubmatchSuccess : public EndNode {
  public:
   NegativeSubmatchSuccess(intptr_t stack_pointer_reg,
                           intptr_t position_reg,
@@ -746,7 +736,7 @@
         stack_pointer_register_(stack_pointer_reg),
         current_position_register_(position_reg),
         clear_capture_count_(clear_capture_count),
-        clear_capture_start_(clear_capture_start) { }
+        clear_capture_start_(clear_capture_start) {}
   virtual void Emit(RegExpCompiler* compiler, Trace* trace);
 
  private:
@@ -757,13 +747,11 @@
 };
 
 
-class Guard: public ZoneAllocated {
+class Guard : public ZoneAllocated {
  public:
   enum Relation { LT, GEQ };
   Guard(intptr_t reg, Relation op, intptr_t value)
-      : reg_(reg),
-        op_(op),
-        value_(value) { }
+      : reg_(reg), op_(op), value_(value) {}
   intptr_t reg() { return reg_; }
   Relation op() { return op_; }
   intptr_t value() { return value_; }
@@ -777,7 +765,7 @@
 
 class GuardedAlternative {
  public:
-  explicit GuardedAlternative(RegExpNode* node) : node_(node), guards_(NULL) { }
+  explicit GuardedAlternative(RegExpNode* node) : node_(node), guards_(NULL) {}
   void AddGuard(Guard* guard, Zone* zone);
   RegExpNode* node() { return node_; }
   void set_node(RegExpNode* node) { node_ = node; }
@@ -794,23 +782,22 @@
 struct AlternativeGeneration;
 
 
-class ChoiceNode: public RegExpNode {
+class ChoiceNode : public RegExpNode {
  public:
   explicit ChoiceNode(intptr_t expected_size, Zone* zone)
       : RegExpNode(zone),
-        alternatives_(new(zone)
-                      ZoneGrowableArray<GuardedAlternative>(expected_size)),
+        alternatives_(new (zone)
+                          ZoneGrowableArray<GuardedAlternative>(expected_size)),
         not_at_start_(false),
-        being_calculated_(false) { }
+        being_calculated_(false) {}
   virtual void Accept(NodeVisitor* visitor);
-  void AddAlternative(GuardedAlternative node) {
-    alternatives()->Add(node);
-  }
+  void AddAlternative(GuardedAlternative node) { alternatives()->Add(node); }
   ZoneGrowableArray<GuardedAlternative>* alternatives() {
     return alternatives_;
   }
   virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual intptr_t EatsAtLeast(intptr_t still_to_find, intptr_t budget,
+  virtual intptr_t EatsAtLeast(intptr_t still_to_find,
+                               intptr_t budget,
                                bool not_at_start);
   intptr_t EatsAtLeastHelper(intptr_t still_to_find,
                              intptr_t budget,
@@ -875,7 +862,7 @@
 };
 
 
-class NegativeLookaheadChoiceNode: public ChoiceNode {
+class NegativeLookaheadChoiceNode : public ChoiceNode {
  public:
   explicit NegativeLookaheadChoiceNode(GuardedAlternative this_must_fail,
                                        GuardedAlternative then_do_this,
@@ -884,7 +871,8 @@
     AddAlternative(this_must_fail);
     AddAlternative(then_do_this);
   }
-  virtual intptr_t EatsAtLeast(intptr_t still_to_find, intptr_t budget,
+  virtual intptr_t EatsAtLeast(intptr_t still_to_find,
+                               intptr_t budget,
                                bool not_at_start);
   virtual void GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
@@ -894,8 +882,8 @@
                             intptr_t budget,
                             BoyerMooreLookahead* bm,
                             bool not_at_start) {
-    (*alternatives_)[1].node()->FillInBMInfo(
-        offset, budget - 1, bm, not_at_start);
+    (*alternatives_)[1].node()->FillInBMInfo(offset, budget - 1, bm,
+                                             not_at_start);
     if (offset == 0) set_bm_info(not_at_start, bm);
   }
   // For a negative lookahead we don't emit the quick check for the
@@ -910,17 +898,18 @@
 };
 
 
-class LoopChoiceNode: public ChoiceNode {
+class LoopChoiceNode : public ChoiceNode {
  public:
   explicit LoopChoiceNode(bool body_can_be_zero_length, Zone* zone)
       : ChoiceNode(2, zone),
         loop_node_(NULL),
         continue_node_(NULL),
-        body_can_be_zero_length_(body_can_be_zero_length) { }
+        body_can_be_zero_length_(body_can_be_zero_length) {}
   void AddLoopAlternative(GuardedAlternative alt);
   void AddContinueAlternative(GuardedAlternative alt);
   virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual intptr_t EatsAtLeast(intptr_t still_to_find,  intptr_t budget,
+  virtual intptr_t EatsAtLeast(intptr_t still_to_find,
+                               intptr_t budget,
                                bool not_at_start);
   virtual void GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
@@ -997,15 +986,15 @@
 class BoyerMoorePositionInfo : public ZoneAllocated {
  public:
   explicit BoyerMoorePositionInfo(Zone* zone)
-      : map_(new(zone) ZoneGrowableArray<bool>(kMapSize)),
+      : map_(new (zone) ZoneGrowableArray<bool>(kMapSize)),
         map_count_(0),
         w_(kNotYet),
         s_(kNotYet),
         d_(kNotYet),
         surrogate_(kNotYet) {
-     for (intptr_t i = 0; i < kMapSize; i++) {
-       map_->Add(false);
-     }
+    for (intptr_t i = 0; i < kMapSize; i++) {
+      map_->Add(false);
+    }
   }
 
   bool& at(intptr_t i) { return (*map_)[i]; }
@@ -1023,18 +1012,17 @@
 
  private:
   ZoneGrowableArray<bool>* map_;
-  intptr_t map_count_;  // Number of set bits in the map.
-  ContainedInLattice w_;  // The \w character class.
-  ContainedInLattice s_;  // The \s character class.
-  ContainedInLattice d_;  // The \d character class.
+  intptr_t map_count_;            // Number of set bits in the map.
+  ContainedInLattice w_;          // The \w character class.
+  ContainedInLattice s_;          // The \s character class.
+  ContainedInLattice d_;          // The \d character class.
   ContainedInLattice surrogate_;  // Surrogate UTF-16 code units.
 };
 
 
-class BoyerMooreLookahead : public ZoneAllocated{
+class BoyerMooreLookahead : public ZoneAllocated {
  public:
-  BoyerMooreLookahead(intptr_t length, RegExpCompiler* compiler,
-                      Zone* Zone);
+  BoyerMooreLookahead(intptr_t length, RegExpCompiler* compiler, Zone* Zone);
 
   intptr_t length() { return length_; }
   intptr_t max_char() { return max_char_; }
@@ -1062,12 +1050,11 @@
     }
   }
 
-  void SetAll(intptr_t map_number) {
-    bitmaps_->At(map_number)->SetAll();
-  }
+  void SetAll(intptr_t map_number) { bitmaps_->At(map_number)->SetAll(); }
 
   void SetRest(intptr_t from_map) {
-    for (intptr_t i = from_map; i < length_; i++) SetAll(i);
+    for (intptr_t i = from_map; i < length_; i++)
+      SetAll(i);
   }
   void EmitSkipInstructions(RegExpMacroAssembler* masm);
 
@@ -1086,10 +1073,10 @@
                         intptr_t max_lookahead,
                         const TypedData& boolean_skip_table);
   bool FindWorthwhileInterval(intptr_t* from, intptr_t* to);
-  intptr_t FindBestInterval(
-      intptr_t max_number_of_chars,
-      intptr_t old_biggest_points,
-      intptr_t* from, intptr_t* to);
+  intptr_t FindBestInterval(intptr_t max_number_of_chars,
+                            intptr_t old_biggest_points,
+                            intptr_t* from,
+                            intptr_t* to);
 };
 
 
@@ -1108,18 +1095,17 @@
  public:
   // A value for a property that is either known to be true, know to be false,
   // or not known.
-  enum TriBool {
-    UNKNOWN = -1, FALSE_VALUE = 0, TRUE_VALUE = 1
-  };
+  enum TriBool { UNKNOWN = -1, FALSE_VALUE = 0, TRUE_VALUE = 1 };
 
   class DeferredAction {
    public:
     DeferredAction(ActionNode::ActionType action_type, intptr_t reg)
-        : action_type_(action_type), reg_(reg), next_(NULL) { }
+        : action_type_(action_type), reg_(reg), next_(NULL) {}
     DeferredAction* next() { return next_; }
     bool Mentions(intptr_t reg);
     intptr_t reg() { return reg_; }
     ActionNode::ActionType action_type() { return action_type_; }
+
    private:
     ActionNode::ActionType action_type_;
     intptr_t reg_;
@@ -1134,9 +1120,10 @@
     DeferredCapture(intptr_t reg, bool is_capture, Trace* trace)
         : DeferredAction(ActionNode::STORE_POSITION, reg),
           cp_offset_(trace->cp_offset()),
-          is_capture_(is_capture) { }
+          is_capture_(is_capture) {}
     intptr_t cp_offset() { return cp_offset_; }
     bool is_capture() { return is_capture_; }
+
    private:
     intptr_t cp_offset_;
     bool is_capture_;
@@ -1146,9 +1133,9 @@
   class DeferredSetRegister : public DeferredAction {
    public:
     DeferredSetRegister(intptr_t reg, intptr_t value)
-        : DeferredAction(ActionNode::SET_REGISTER, reg),
-          value_(value) { }
+        : DeferredAction(ActionNode::SET_REGISTER, reg), value_(value) {}
     intptr_t value() { return value_; }
+
    private:
     intptr_t value_;
   };
@@ -1156,9 +1143,9 @@
   class DeferredClearCaptures : public DeferredAction {
    public:
     explicit DeferredClearCaptures(Interval range)
-        : DeferredAction(ActionNode::CLEAR_CAPTURES, -1),
-          range_(range) { }
+        : DeferredAction(ActionNode::CLEAR_CAPTURES, -1), range_(range) {}
     Interval range() { return range_; }
+
    private:
     Interval range_;
   };
@@ -1166,7 +1153,7 @@
   class DeferredIncrementRegister : public DeferredAction {
    public:
     explicit DeferredIncrementRegister(intptr_t reg)
-        : DeferredAction(ActionNode::INCREMENT_REGISTER, reg) { }
+        : DeferredAction(ActionNode::INCREMENT_REGISTER, reg) {}
   };
 
   Trace()
@@ -1178,7 +1165,7 @@
         characters_preloaded_(0),
         bound_checked_up_to_(0),
         flush_budget_(100),
-        at_start_(UNKNOWN) { }
+        at_start_(UNKNOWN) {}
 
   // End the trace.  This involves flushing the deferred actions in the trace
   // and pushing a backtrack location onto the backtrack stack.  Once this is
@@ -1198,13 +1185,9 @@
   // a trivial trace is recorded in a label in the node so that gotos can be
   // generated to that code.
   bool is_trivial() {
-    return backtrack_ == NULL &&
-           actions_ == NULL &&
-           cp_offset_ == 0 &&
-           characters_preloaded_ == 0 &&
-           bound_checked_up_to_ == 0 &&
-           quick_check_performed_.characters() == 0 &&
-           at_start_ == UNKNOWN;
+    return backtrack_ == NULL && actions_ == NULL && cp_offset_ == 0 &&
+           characters_preloaded_ == 0 && bound_checked_up_to_ == 0 &&
+           quick_check_performed_.characters() == 0 && at_start_ == UNKNOWN;
   }
   TriBool at_start() { return at_start_; }
   void set_at_start(bool at_start) {
@@ -1289,9 +1272,7 @@
   bool preload_has_checked_bounds_;
   intptr_t preload_characters_;
   intptr_t eats_at_least_;
-  void init() {
-    eats_at_least_ = kEatsAtLeastNotYetInitialized;
-  }
+  void init() { eats_at_least_ = kEatsAtLeastNotYetInitialized; }
 
   DISALLOW_ALLOCATION();
 };
@@ -1299,10 +1280,9 @@
 
 class NodeVisitor : public ValueObject {
  public:
-  virtual ~NodeVisitor() { }
-#define DECLARE_VISIT(Type)                                          \
-  virtual void Visit##Type(Type##Node* that) = 0;
-FOR_EACH_NODE_TYPE(DECLARE_VISIT)
+  virtual ~NodeVisitor() {}
+#define DECLARE_VISIT(Type) virtual void Visit##Type(Type##Node* that) = 0;
+  FOR_EACH_NODE_TYPE(DECLARE_VISIT)
 #undef DECLARE_VISIT
   virtual void VisitLoopChoice(LoopChoiceNode* that) { VisitChoice(that); }
 };
@@ -1320,17 +1300,16 @@
 //   +-------+  --->  +------------+
 //   | word? |        | check word |
 //   +-------+        +------------+
-class Analysis: public NodeVisitor {
+class Analysis : public NodeVisitor {
  public:
   Analysis(bool ignore_case, bool is_one_byte)
       : ignore_case_(ignore_case),
         is_one_byte_(is_one_byte),
-        error_message_(NULL) { }
+        error_message_(NULL) {}
   void EnsureAnalyzed(RegExpNode* node);
 
-#define DECLARE_VISIT(Type)                                          \
-  virtual void Visit##Type(Type##Node* that);
-FOR_EACH_NODE_TYPE(DECLARE_VISIT)
+#define DECLARE_VISIT(Type) virtual void Visit##Type(Type##Node* that);
+  FOR_EACH_NODE_TYPE(DECLARE_VISIT)
 #undef DECLARE_VISIT
   virtual void VisitLoopChoice(LoopChoiceNode* that);
 
@@ -1339,9 +1318,7 @@
     ASSERT(error_message_ != NULL);
     return error_message_;
   }
-  void fail(const char* error_message) {
-    error_message_ = error_message;
-  }
+  void fail(const char* error_message) { error_message_ = error_message; }
 
  private:
   bool ignore_case_;
@@ -1354,12 +1331,12 @@
 
 struct RegExpCompileData : public ZoneAllocated {
   RegExpCompileData()
-    : tree(NULL),
-      node(NULL),
-      simple(true),
-      contains_anchor(false),
-      error(String::Handle(String::null())),
-      capture_count(0) { }
+      : tree(NULL),
+        node(NULL),
+        simple(true),
+        contains_anchor(false),
+        error(String::Handle(String::null())),
+        capture_count(0) {}
   RegExpTree* tree;
   RegExpNode* node;
   bool simple;
@@ -1369,7 +1346,7 @@
 };
 
 
-class RegExpEngine: public AllStatic {
+class RegExpEngine : public AllStatic {
  public:
   struct CompilationResult {
     explicit CompilationResult(const char* error_message)
@@ -1395,12 +1372,12 @@
                       intptr_t num_blocks,
                       intptr_t num_stack_locals,
                       intptr_t num_registers)
-      : backtrack_goto(backtrack_goto),
-        graph_entry(graph_entry),
-        num_blocks(num_blocks),
-        num_stack_locals(num_stack_locals),
-        error_message(NULL),
-        bytecode(NULL) {}
+        : backtrack_goto(backtrack_goto),
+          graph_entry(graph_entry),
+          num_blocks(num_blocks),
+          num_stack_locals(num_stack_locals),
+          error_message(NULL),
+          bytecode(NULL) {}
 
     IndirectGotoInstr* backtrack_goto;
     GraphEntryInstr* graph_entry;
@@ -1418,21 +1395,20 @@
       const ParsedFunction* parsed_function,
       const ZoneGrowableArray<const ICData*>& ic_data_array);
 
-  static CompilationResult CompileBytecode(
-      RegExpCompileData* data,
-      const RegExp& regexp,
-      bool is_one_byte,
-      Zone* zone);
+  static CompilationResult CompileBytecode(RegExpCompileData* data,
+                                           const RegExp& regexp,
+                                           bool is_one_byte,
+                                           bool sticky,
+                                           Zone* zone);
 
-  static RawRegExp* CreateRegExp(
-      Thread* thread,
-      const String& pattern,
-      bool multi_line,
-      bool ignore_case);
+  static RawRegExp* CreateRegExp(Thread* thread,
+                                 const String& pattern,
+                                 bool multi_line,
+                                 bool ignore_case);
 
   static void DotPrint(const char* label, RegExpNode* node, bool ignore_case);
 };
 
 }  // namespace dart
 
-#endif  // VM_REGEXP_H_
+#endif  // RUNTIME_VM_REGEXP_H_
diff --git a/runtime/vm/regexp_assembler.cc b/runtime/vm/regexp_assembler.cc
index c916c70..df8a650 100644
--- a/runtime/vm/regexp_assembler.cc
+++ b/runtime/vm/regexp_assembler.cc
@@ -10,10 +10,7 @@
 namespace dart {
 
 BlockLabel::BlockLabel()
-    : block_(NULL),
-      is_bound_(false),
-      is_linked_(false),
-      pos_(-1) {
+    : block_(NULL), is_bound_(false), is_linked_(false), pos_(-1) {
   if (!FLAG_interpret_irregexp) {
     // Only needed by the compiled IR backend.
     block_ = new JoinEntryInstr(-1, -1);
@@ -22,13 +19,9 @@
 
 
 RegExpMacroAssembler::RegExpMacroAssembler(Zone* zone)
-  : slow_safe_compiler_(false),
-    global_mode_(NOT_GLOBAL),
-    zone_(zone) {
-}
+    : slow_safe_compiler_(false), global_mode_(NOT_GLOBAL), zone_(zone) {}
 
 
-RegExpMacroAssembler::~RegExpMacroAssembler() {
-}
+RegExpMacroAssembler::~RegExpMacroAssembler() {}
 
 }  // namespace dart
diff --git a/runtime/vm/regexp_assembler.h b/runtime/vm/regexp_assembler.h
index efd53c5..1a12789 100644
--- a/runtime/vm/regexp_assembler.h
+++ b/runtime/vm/regexp_assembler.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_REGEXP_ASSEMBLER_H_
-#define VM_REGEXP_ASSEMBLER_H_
+#ifndef RUNTIME_VM_REGEXP_ASSEMBLER_H_
+#define RUNTIME_VM_REGEXP_ASSEMBLER_H_
 
 #include "vm/assembler.h"
 #include "vm/intermediate_language.h"
@@ -31,9 +31,7 @@
   }
 
   bool IsLinked() const { return !is_bound_ && is_linked_; }
-  void SetLinked() {
-    is_linked_ = true;
-  }
+  void SetLinked() { is_linked_ = true; }
 
   intptr_t Position() const {
     ASSERT(IsBound());
@@ -48,13 +46,9 @@
 
   // Used by the bytecode assembler.
  public:
-  ~BlockLabel() {
-    ASSERT(!is_linked());
-  }
+  ~BlockLabel() { ASSERT(!is_linked()); }
 
-  intptr_t pos() const {
-    return pos_;
-  }
+  intptr_t pos() const { return pos_; }
   bool is_bound() const { return IsBound(); }
   bool is_linked() const { return IsLinked(); }
 
@@ -101,10 +95,7 @@
     kParamCount
   };
 
-  enum IrregexpImplementation {
-    kBytecodeImplementation,
-    kIRImplementation
-  };
+  enum IrregexpImplementation { kBytecodeImplementation, kIRImplementation };
 
   explicit RegExpMacroAssembler(Zone* zone);
   virtual ~RegExpMacroAssembler();
@@ -132,8 +123,8 @@
   virtual void CheckCharacterLT(uint16_t limit, BlockLabel* on_less) = 0;
   virtual void CheckGreedyLoop(BlockLabel* on_tos_equals_current_position) = 0;
   virtual void CheckNotAtStart(BlockLabel* on_not_at_start) = 0;
-  virtual void CheckNotBackReference(
-      intptr_t start_reg, BlockLabel* on_no_match) = 0;
+  virtual void CheckNotBackReference(intptr_t start_reg,
+                                     BlockLabel* on_no_match) = 0;
   virtual void CheckNotBackReferenceIgnoreCase(intptr_t start_reg,
                                                BlockLabel* on_no_match) = 0;
   // Check the current character for a match with a literal character.  If we
@@ -178,12 +169,14 @@
   virtual void Fail() = 0;
   // Check whether a register is >= a given constant and go to a label if it
   // is.  Backtracks instead if the label is NULL.
-  virtual void IfRegisterGE(
-      intptr_t reg, intptr_t comparand, BlockLabel* if_ge) = 0;
+  virtual void IfRegisterGE(intptr_t reg,
+                            intptr_t comparand,
+                            BlockLabel* if_ge) = 0;
   // Check whether a register is < a given constant and go to a label if it is.
   // Backtracks instead if the label is NULL.
-  virtual void IfRegisterLT(
-      intptr_t reg, intptr_t comparand, BlockLabel* if_lt) = 0;
+  virtual void IfRegisterLT(intptr_t reg,
+                            intptr_t comparand,
+                            BlockLabel* if_lt) = 0;
   // Check whether a register is == to the current position and go to a
   // label if it is.
   virtual void IfRegisterEqPos(intptr_t reg, BlockLabel* if_eq) = 0;
@@ -213,8 +206,8 @@
   virtual void SetRegister(intptr_t register_index, intptr_t to) = 0;
   // Return whether the matching (with a global regexp) will be restarted.
   virtual bool Succeed() = 0;
-  virtual void WriteCurrentPositionToRegister(
-      intptr_t reg, intptr_t cp_offset) = 0;
+  virtual void WriteCurrentPositionToRegister(intptr_t reg,
+                                              intptr_t cp_offset) = 0;
   virtual void ClearRegisters(intptr_t reg_from, intptr_t reg_to) = 0;
   virtual void WriteStackPointerToRegister(intptr_t reg) = 0;
 
@@ -227,9 +220,7 @@
   // a failure in a global regexp may still mean success overall.
   inline void set_global_mode(GlobalMode mode) { global_mode_ = mode; }
   inline bool global() { return global_mode_ != NOT_GLOBAL; }
-  inline bool global_with_zero_length_check() {
-    return global_mode_ == GLOBAL;
-  }
+  inline bool global_with_zero_length_check() { return global_mode_ == GLOBAL; }
 
   Zone* zone() const { return zone_; }
 
@@ -241,4 +232,4 @@
 
 }  // namespace dart
 
-#endif  // VM_REGEXP_ASSEMBLER_H_
+#endif  // RUNTIME_VM_REGEXP_ASSEMBLER_H_
diff --git a/runtime/vm/regexp_assembler_bytecode.cc b/runtime/vm/regexp_assembler_bytecode.cc
index 986c0e3..4f31fcf 100644
--- a/runtime/vm/regexp_assembler_bytecode.cc
+++ b/runtime/vm/regexp_assembler_bytecode.cc
@@ -22,7 +22,7 @@
     : RegExpMacroAssembler(zone),
       buffer_(buffer),
       pc_(0),
-      advance_current_end_(kInvalidPC) { }
+      advance_current_end_(kInvalidPC) {}
 
 
 BytecodeRegExpMacroAssembler::~BytecodeRegExpMacroAssembler() {
@@ -81,7 +81,8 @@
 
 
 void BytecodeRegExpMacroAssembler::WriteCurrentPositionToRegister(
-    intptr_t register_index, intptr_t cp_offset) {
+    intptr_t register_index,
+    intptr_t cp_offset) {
   ASSERT(register_index >= 0);
   ASSERT(register_index <= kMaxRegister);
   Emit(BC_SET_REGISTER_TO_CP, register_index);
@@ -204,7 +205,7 @@
 
 
 void BytecodeRegExpMacroAssembler::CheckGreedyLoop(
-      BlockLabel* on_tos_equals_current_position) {
+    BlockLabel* on_tos_equals_current_position) {
   Emit(BC_CHECK_GREEDY, 0);
   EmitOrLink(on_tos_equals_current_position);
 }
@@ -356,8 +357,8 @@
 }
 
 
-void BytecodeRegExpMacroAssembler::CheckBitInTable(
-    const TypedData& table, BlockLabel* on_bit_set) {
+void BytecodeRegExpMacroAssembler::CheckBitInTable(const TypedData& table,
+                                                   BlockLabel* on_bit_set) {
   Emit(BC_CHECK_BIT_IN_TABLE, 0);
   EmitOrLink(on_bit_set);
   for (int i = 0; i < kTableSize; i += kBitsPerByte) {
@@ -449,28 +450,31 @@
   buffer_->Add(0);
   buffer_->Add(0);
   intptr_t x = buffer_->length();
-  for (intptr_t i = 0; i < x; i++) buffer_->Add(0);
+  for (intptr_t i = 0; i < x; i++)
+    buffer_->Add(0);
 }
 
 
 static intptr_t Prepare(const RegExp& regexp,
                         const String& subject,
+                        bool sticky,
                         Zone* zone) {
-  bool is_one_byte = subject.IsOneByteString() ||
-                     subject.IsExternalOneByteString();
+  bool is_one_byte =
+      subject.IsOneByteString() || subject.IsExternalOneByteString();
 
-  if (regexp.bytecode(is_one_byte) == TypedData::null()) {
+  if (regexp.bytecode(is_one_byte, sticky) == TypedData::null()) {
     const String& pattern = String::Handle(zone, regexp.pattern());
-    NOT_IN_PRODUCT(TimelineDurationScope tds(Thread::Current(),
-                                             Timeline::GetCompilerStream(),
-                                             "CompileIrregexpBytecode");
+#if !defined(PRODUCT)
+    TimelineDurationScope tds(Thread::Current(), Timeline::GetCompilerStream(),
+                              "CompileIrregexpBytecode");
     if (tds.enabled()) {
       tds.SetNumArguments(1);
       tds.CopyArgument(0, "pattern", pattern.ToCString());
-    });  // !PRODUCT
+    }
+#endif  // !defined(PRODUCT)
 
     const bool multiline = regexp.is_multi_line();
-    RegExpCompileData* compile_data = new(zone) RegExpCompileData();
+    RegExpCompileData* compile_data = new (zone) RegExpCompileData();
     if (!RegExpParser::ParseRegExp(pattern, multiline, compile_data)) {
       // Parsing failures are handled in the RegExp factory constructor.
       UNREACHABLE();
@@ -483,13 +487,13 @@
       regexp.set_is_complex();
     }
 
-    RegExpEngine::CompilationResult result =
-        RegExpEngine::CompileBytecode(compile_data, regexp, is_one_byte, zone);
+    RegExpEngine::CompilationResult result = RegExpEngine::CompileBytecode(
+        compile_data, regexp, is_one_byte, sticky, zone);
     ASSERT(result.bytecode != NULL);
     ASSERT((regexp.num_registers() == -1) ||
            (regexp.num_registers() == result.num_registers));
     regexp.set_num_registers(result.num_registers);
-    regexp.set_bytecode(is_one_byte, *(result.bytecode));
+    regexp.set_bytecode(is_one_byte, sticky, *(result.bytecode));
   }
 
   ASSERT(regexp.num_registers() != -1);
@@ -502,18 +506,19 @@
 static IrregexpInterpreter::IrregexpResult ExecRaw(const RegExp& regexp,
                                                    const String& subject,
                                                    intptr_t index,
+                                                   bool sticky,
                                                    int32_t* output,
                                                    intptr_t output_size,
                                                    Zone* zone) {
-  bool is_one_byte = subject.IsOneByteString() ||
-                     subject.IsExternalOneByteString();
+  bool is_one_byte =
+      subject.IsOneByteString() || subject.IsExternalOneByteString();
 
   ASSERT(regexp.num_bracket_expressions() != Smi::null());
 
   // We must have done EnsureCompiledIrregexp, so we can get the number of
   // registers.
   int number_of_capture_registers =
-     (Smi::Value(regexp.num_bracket_expressions()) + 1) * 2;
+      (Smi::Value(regexp.num_bracket_expressions()) + 1) * 2;
   int32_t* raw_output = &output[number_of_capture_registers];
 
   // We do not touch the actual capture result registers until we know there
@@ -524,7 +529,7 @@
   }
 
   const TypedData& bytecode =
-      TypedData::Handle(zone, regexp.bytecode(is_one_byte));
+      TypedData::Handle(zone, regexp.bytecode(is_one_byte, sticky));
   ASSERT(!bytecode.IsNull());
   IrregexpInterpreter::IrregexpResult result =
       IrregexpInterpreter::Match(bytecode, subject, raw_output, index, zone);
@@ -548,8 +553,9 @@
 RawInstance* BytecodeRegExpMacroAssembler::Interpret(const RegExp& regexp,
                                                      const String& subject,
                                                      const Smi& start_index,
+                                                     bool sticky,
                                                      Zone* zone) {
-  intptr_t required_registers = Prepare(regexp, subject, zone);
+  intptr_t required_registers = Prepare(regexp, subject, sticky, zone);
   if (required_registers < 0) {
     // Compiling failed with an exception.
     UNREACHABLE();
@@ -558,21 +564,17 @@
   // V8 uses a shared copy on the isolate when smaller than some threshold.
   int32_t* output_registers = zone->Alloc<int32_t>(required_registers);
 
-  IrregexpInterpreter::IrregexpResult result = ExecRaw(regexp,
-                                                       subject,
-                                                       start_index.Value(),
-                                                       output_registers,
-                                                       required_registers,
-                                                       zone);
+  IrregexpInterpreter::IrregexpResult result =
+      ExecRaw(regexp, subject, start_index.Value(), sticky, output_registers,
+              required_registers, zone);
 
   if (result == IrregexpInterpreter::RE_SUCCESS) {
     intptr_t capture_count = Smi::Value(regexp.num_bracket_expressions());
     intptr_t capture_register_count = (capture_count + 1) * 2;
     ASSERT(required_registers >= capture_register_count);
 
-    const TypedData& result =
-        TypedData::Handle(TypedData::New(kTypedDataInt32ArrayCid,
-                                         capture_register_count));
+    const TypedData& result = TypedData::Handle(
+        TypedData::New(kTypedDataInt32ArrayCid, capture_register_count));
     {
 #ifdef DEBUG
       // These indices will be used with substring operations that don't check
@@ -584,8 +586,7 @@
 #endif
 
       NoSafepointScope no_safepoint;
-      memmove(result.DataAddr(0),
-              output_registers,
+      memmove(result.DataAddr(0), output_registers,
               capture_register_count * sizeof(int32_t));
     }
 
diff --git a/runtime/vm/regexp_assembler_bytecode.h b/runtime/vm/regexp_assembler_bytecode.h
index da2a6d7..df9e46f 100644
--- a/runtime/vm/regexp_assembler_bytecode.h
+++ b/runtime/vm/regexp_assembler_bytecode.h
@@ -2,15 +2,15 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_REGEXP_ASSEMBLER_BYTECODE_H_
-#define VM_REGEXP_ASSEMBLER_BYTECODE_H_
+#ifndef RUNTIME_VM_REGEXP_ASSEMBLER_BYTECODE_H_
+#define RUNTIME_VM_REGEXP_ASSEMBLER_BYTECODE_H_
 
 #include "vm/object.h"
 #include "vm/regexp_assembler.h"
 
 namespace dart {
 
-class BytecodeRegExpMacroAssembler: public RegExpMacroAssembler {
+class BytecodeRegExpMacroAssembler : public RegExpMacroAssembler {
  public:
   // Create an assembler. Instructions and relocation information are emitted
   // into a buffer, with the instructions starting from the beginning and the
@@ -25,8 +25,7 @@
   // for code generation and assumes its size to be buffer_size. If the buffer
   // is too small, a fatal error occurs. No deallocation of the buffer is done
   // upon destruction of the assembler.
-  BytecodeRegExpMacroAssembler(ZoneGrowableArray<uint8_t>* buffer,
-                               Zone* zone);
+  BytecodeRegExpMacroAssembler(ZoneGrowableArray<uint8_t>* buffer, Zone* zone);
   virtual ~BytecodeRegExpMacroAssembler();
 
   // The byte-code interpreter checks on each push anyway.
@@ -101,13 +100,14 @@
     // extra goto.
     return true;
   }
-  virtual void Print(const char* str)  { UNIMPLEMENTED(); }
+  virtual void Print(const char* str) { UNIMPLEMENTED(); }
   virtual void PrintBlocks() { UNIMPLEMENTED(); }
   /////
 
   static RawInstance* Interpret(const RegExp& regexp,
                                 const String& str,
                                 const Smi& start_index,
+                                bool is_sticky,
                                 Zone* zone);
 
  private:
@@ -141,4 +141,4 @@
 
 }  // namespace dart
 
-#endif  // VM_REGEXP_ASSEMBLER_BYTECODE_H_
+#endif  // RUNTIME_VM_REGEXP_ASSEMBLER_BYTECODE_H_
diff --git a/runtime/vm/regexp_assembler_bytecode_inl.h b/runtime/vm/regexp_assembler_bytecode_inl.h
index 2b370db..d2fe476 100644
--- a/runtime/vm/regexp_assembler_bytecode_inl.h
+++ b/runtime/vm/regexp_assembler_bytecode_inl.h
@@ -6,8 +6,8 @@
 
 #include "vm/regexp_bytecodes.h"
 
-#ifndef VM_REGEXP_ASSEMBLER_BYTECODE_INL_H_
-#define VM_REGEXP_ASSEMBLER_BYTECODE_INL_H_
+#ifndef RUNTIME_VM_REGEXP_ASSEMBLER_BYTECODE_INL_H_
+#define RUNTIME_VM_REGEXP_ASSEMBLER_BYTECODE_INL_H_
 
 namespace dart {
 
@@ -15,7 +15,7 @@
                                         uint32_t twenty_four_bits) {
   uint32_t word = ((twenty_four_bits << BYTECODE_SHIFT) | byte);
   ASSERT(pc_ <= buffer_->length());
-  if (pc_  + 3 >= buffer_->length()) {
+  if (pc_ + 3 >= buffer_->length()) {
     Expand();
   }
   *reinterpret_cast<uint32_t*>(buffer_->data() + pc_) = word;
@@ -54,4 +54,4 @@
 
 }  // namespace dart
 
-#endif  // VM_REGEXP_ASSEMBLER_BYTECODE_INL_H_
+#endif  // RUNTIME_VM_REGEXP_ASSEMBLER_BYTECODE_INL_H_
diff --git a/runtime/vm/regexp_assembler_ir.cc b/runtime/vm/regexp_assembler_ir.cc
index aac090e..bfe90b2 100644
--- a/runtime/vm/regexp_assembler_ir.cc
+++ b/runtime/vm/regexp_assembler_ir.cc
@@ -21,14 +21,20 @@
 
 // Debugging output macros. TAG() is called at the head of each interesting
 // function and prints its name during execution if irregexp tracing is enabled.
-#define TAG() if (FLAG_trace_irregexp) { TAG_(); }
-#define TAG_() \
-  Print(PushArgument( \
-    Bind(new(Z) ConstantInstr(String::ZoneHandle(Z, String::Concat( \
-        String::Handle(String::New("TAG: ")), \
-        String::Handle(String::New(__FUNCTION__)), Heap::kOld))))));
+#define TAG()                                                                  \
+  if (FLAG_trace_irregexp) {                                                   \
+    TAG_();                                                                    \
+  }
+#define TAG_()                                                                 \
+  Print(PushArgument(Bind(new (Z) ConstantInstr(String::ZoneHandle(            \
+      Z, String::Concat(String::Handle(String::New("TAG: ")),                  \
+                        String::Handle(String::New(__FUNCTION__)),             \
+                        Heap::kOld))))));
 
-#define PRINT(arg) if (FLAG_trace_irregexp) { Print(arg); }
+#define PRINT(arg)                                                             \
+  if (FLAG_trace_irregexp) {                                                   \
+    Print(arg);                                                                \
+  }
 
 namespace dart {
 
@@ -40,8 +46,8 @@
 
 
 void PrintUtf16(uint16_t c) {
-  const char* format = (0x20 <= c && c <= 0x7F) ?
-        "%c" : (c <= 0xff) ? "\\x%02x" : "\\u%04x";
+  const char* format =
+      (0x20 <= c && c <= 0x7F) ? "%c" : (c <= 0xff) ? "\\x%02x" : "\\u%04x";
   OS::Print(format, c);
 }
 
@@ -92,10 +98,15 @@
       registers_array_(TypedData::ZoneHandle(zone, TypedData::null())) {
   switch (specialization_cid) {
     case kOneByteStringCid:
-    case kExternalOneByteStringCid: mode_ = ASCII; break;
+    case kExternalOneByteStringCid:
+      mode_ = ASCII;
+      break;
     case kTwoByteStringCid:
-    case kExternalTwoByteStringCid: mode_ = UC16; break;
-    default: UNREACHABLE();
+    case kExternalTwoByteStringCid:
+      mode_ = UC16;
+      break;
+    default:
+      UNREACHABLE();
   }
 
   InitializeLocals();
@@ -103,23 +114,22 @@
   // Allocate an initial stack backing of the minimum stack size. The stack
   // backing is indirectly referred to so we can reuse it on subsequent matches
   // even in the case where the backing has been enlarged and thus reallocated.
-  stack_array_cell_.SetAt(0, TypedData::Handle(zone,
-    TypedData::New(kTypedDataInt32ArrayCid, kMinStackSize / 4, Heap::kOld)));
+  stack_array_cell_.SetAt(
+      0,
+      TypedData::Handle(zone, TypedData::New(kTypedDataInt32ArrayCid,
+                                             kMinStackSize / 4, Heap::kOld)));
 
   // Create and generate all preset blocks.
-  entry_block_ =
-      new(zone) GraphEntryInstr(
-        *parsed_function_,
-        new(zone) TargetEntryInstr(block_id_.Alloc(), kInvalidTryIndex),
-        Compiler::kNoOSRDeoptId);
-  start_block_ =
-      new(zone) JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
+  entry_block_ = new (zone) GraphEntryInstr(
+      *parsed_function_,
+      new (zone) TargetEntryInstr(block_id_.Alloc(), kInvalidTryIndex),
+      Compiler::kNoOSRDeoptId);
+  start_block_ = new (zone) JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
   success_block_ =
-      new(zone) JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
+      new (zone) JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
   backtrack_block_ =
-      new(zone) JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
-  exit_block_ =
-      new(zone) JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
+      new (zone) JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
+  exit_block_ = new (zone) JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
 
   GenerateEntryBlock();
   GenerateSuccessBlock();
@@ -137,7 +147,7 @@
 }
 
 
-IRRegExpMacroAssembler::~IRRegExpMacroAssembler() { }
+IRRegExpMacroAssembler::~IRRegExpMacroAssembler() {}
 
 
 void IRRegExpMacroAssembler::InitializeLocals() {
@@ -175,12 +185,10 @@
   // Store string.length.
   PushArgumentInstr* string_push = PushLocal(string_param_);
 
-  StoreLocal(
-      string_param_length_,
-      Bind(InstanceCall(
-          InstanceCallDescriptor(
-              String::ZoneHandle(Field::GetterSymbol(Symbols::Length()))),
-          string_push)));
+  StoreLocal(string_param_length_,
+             Bind(InstanceCall(InstanceCallDescriptor(String::ZoneHandle(
+                                   Field::GetterSymbol(Symbols::Length()))),
+                               string_push)));
 
   // Store (start_index - string.length) as the current position (since it's a
   // negative offset from the end of the string).
@@ -191,16 +199,16 @@
 
   // Generate a local list variable to represent "registers" and
   // initialize capture registers (others remain garbage).
-  StoreLocal(registers_, Bind(new(Z) ConstantInstr(registers_array_)));
+  StoreLocal(registers_, Bind(new (Z) ConstantInstr(registers_array_)));
   ClearRegisters(0, saved_registers_count_ - 1);
 
   // Generate a local list variable to represent the backtracking stack.
   PushArgumentInstr* stack_cell_push =
-      PushArgument(Bind(new(Z) ConstantInstr(stack_array_cell_)));
-  StoreLocal(stack_, Bind(InstanceCall(
-      InstanceCallDescriptor::FromToken(Token::kINDEX),
-      stack_cell_push,
-      PushArgument(Bind(Uint64Constant(0))))));
+      PushArgument(Bind(new (Z) ConstantInstr(stack_array_cell_)));
+  StoreLocal(stack_,
+             Bind(InstanceCall(InstanceCallDescriptor::FromToken(Token::kINDEX),
+                               stack_cell_push,
+                               PushArgument(Bind(Uint64Constant(0))))));
   StoreLocal(stack_pointer_, Bind(Int64Constant(-1)));
 
   // Jump to the start block.
@@ -215,19 +223,18 @@
 
   const intptr_t entries_count = entry_block_->indirect_entries().length();
 
-  TypedData& offsets = TypedData::ZoneHandle(Z,
-      TypedData::New(kTypedDataInt32ArrayCid, entries_count, Heap::kOld));
+  TypedData& offsets = TypedData::ZoneHandle(
+      Z, TypedData::New(kTypedDataInt32ArrayCid, entries_count, Heap::kOld));
 
   PushArgumentInstr* block_offsets_push =
-      PushArgument(Bind(new(Z) ConstantInstr(offsets)));
+      PushArgument(Bind(new (Z) ConstantInstr(offsets)));
   PushArgumentInstr* block_id_push = PushArgument(Bind(PopStack()));
 
   Value* offset_value =
       Bind(InstanceCall(InstanceCallDescriptor::FromToken(Token::kINDEX),
-                        block_offsets_push,
-                        block_id_push));
+                        block_offsets_push, block_id_push));
 
-  backtrack_goto_ = new(Z) IndirectGotoInstr(&offsets, offset_value);
+  backtrack_goto_ = new (Z) IndirectGotoInstr(&offsets, offset_value);
   CloseBlockWith(backtrack_goto_);
 
   // Add an edge from the "indirect" goto to each of the targets.
@@ -242,11 +249,11 @@
   set_current_instruction(success_block_);
   TAG();
 
-  Value* type = Bind(new(Z) ConstantInstr(
+  Value* type = Bind(new (Z) ConstantInstr(
       TypeArguments::ZoneHandle(Z, TypeArguments::null())));
   Value* length = Bind(Uint64Constant(saved_registers_count_));
-  Value* array = Bind(new(Z) CreateArrayInstr(
-      TokenPosition::kNoSource, type, length));
+  Value* array =
+      Bind(new (Z) CreateArrayInstr(TokenPosition::kNoSource, type, length));
   StoreLocal(result_, array);
 
   // Store captured offsets in the `matches` parameter.
@@ -262,17 +269,15 @@
         PushArgument(Bind(Add(offset_push, len_push)));
 
     Do(InstanceCall(InstanceCallDescriptor::FromToken(Token::kASSIGN_INDEX),
-                    matches_push,
-                    index_push,
-                    value_push));
+                    matches_push, index_push, value_push));
   }
 
   // Print the result if tracing.
   PRINT(PushLocal(result_));
 
   // Return true on success.
-  AppendInstruction(new(Z) ReturnInstr(
-      TokenPosition::kNoSource, Bind(LoadLocal(result_))));
+  AppendInstruction(
+      new (Z) ReturnInstr(TokenPosition::kNoSource, Bind(LoadLocal(result_))));
 }
 
 
@@ -281,8 +286,8 @@
   TAG();
 
   // Return false on failure.
-  AppendInstruction(new(Z) ReturnInstr(
-      TokenPosition::kNoSource, Bind(LoadLocal(result_))));
+  AppendInstruction(
+      new (Z) ReturnInstr(TokenPosition::kNoSource, Bind(LoadLocal(result_))));
 }
 
 
@@ -293,8 +298,7 @@
 }
 
 
-#if defined(TARGET_ARCH_ARM64) ||                                              \
-    defined(TARGET_ARCH_ARM) ||                                                \
+#if defined(TARGET_ARCH_ARM64) || defined(TARGET_ARCH_ARM) ||                  \
     defined(TARGET_ARCH_MIPS)
 // Disabling unaligned accesses forces the regexp engine to load characters one
 // by one instead of up to 4 at once, along with the associated performance hit.
@@ -310,13 +314,13 @@
 }
 
 
-RawArray* IRRegExpMacroAssembler::Execute(
-    const RegExp& regexp,
-    const String& input,
-    const Smi& start_offset,
-    Zone* zone) {
+RawArray* IRRegExpMacroAssembler::Execute(const RegExp& regexp,
+                                          const String& input,
+                                          const Smi& start_offset,
+                                          bool sticky,
+                                          Zone* zone) {
   const intptr_t cid = input.GetClassId();
-  const Function& fun = Function::Handle(regexp.function(cid));
+  const Function& fun = Function::Handle(regexp.function(cid, sticky));
   ASSERT(!fun.IsNull());
   // Create the argument list.
   const Array& args =
@@ -362,10 +366,10 @@
     int32_t c1 = str.CharAt(lhs_index.Value() + i);
     int32_t c2 = str.CharAt(rhs_index.Value() + i);
     if (c1 != c2) {
-      int32_t s1[1] = { c1 };
+      int32_t s1[1] = {c1};
       canonicalize.get(c1, '\0', s1);
       if (s1[0] != c2) {
-        int32_t s2[1] = { c2 };
+        int32_t s2[1] = {c2};
         canonicalize.get(c2, '\0', s2);
         if (s1[0] != s2[0]) {
           return Bool::False().raw();
@@ -378,14 +382,17 @@
 
 
 DEFINE_RAW_LEAF_RUNTIME_ENTRY(
-    CaseInsensitiveCompareUC16, 4, false /* is_float */,
+    CaseInsensitiveCompareUC16,
+    4,
+    false /* is_float */,
     reinterpret_cast<RuntimeFunction>(&CaseInsensitiveCompareUC16));
 
 
 LocalVariable* IRRegExpMacroAssembler::Parameter(const String& name,
                                                  intptr_t index) const {
-  LocalVariable* local = new(Z) LocalVariable(
-      TokenPosition::kNoSource, name, Object::dynamic_type());
+  LocalVariable* local =
+      new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource,
+                            name, Object::dynamic_type());
 
   intptr_t param_frame_index = kParamEndSlotFromFp + kParamCount - index;
   local->set_index(param_frame_index);
@@ -395,8 +402,9 @@
 
 
 LocalVariable* IRRegExpMacroAssembler::Local(const String& name) {
-  LocalVariable* local = new(Z) LocalVariable(
-      TokenPosition::kNoSource, name, Object::dynamic_type());
+  LocalVariable* local =
+      new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource,
+                            name, Object::dynamic_type());
   local->set_index(GetNextLocalIndex());
 
   return local;
@@ -404,33 +412,34 @@
 
 
 ConstantInstr* IRRegExpMacroAssembler::Int64Constant(int64_t value) const {
-  return new(Z) ConstantInstr(
-        Integer::ZoneHandle(Z, Integer::New(value, Heap::kOld)));
+  return new (Z)
+      ConstantInstr(Integer::ZoneHandle(Z, Integer::New(value, Heap::kOld)));
 }
 
 
 ConstantInstr* IRRegExpMacroAssembler::Uint64Constant(uint64_t value) const {
-  return new(Z) ConstantInstr(
-        Integer::ZoneHandle(Z, Integer::NewFromUint64(value, Heap::kOld)));
+  return new (Z) ConstantInstr(
+      Integer::ZoneHandle(Z, Integer::NewFromUint64(value, Heap::kOld)));
 }
 
 
 ConstantInstr* IRRegExpMacroAssembler::BoolConstant(bool value) const {
-  return new(Z) ConstantInstr(value ? Bool::True() : Bool::False());
+  return new (Z) ConstantInstr(value ? Bool::True() : Bool::False());
 }
 
 
 ConstantInstr* IRRegExpMacroAssembler::StringConstant(const char* value) const {
-  return new(Z) ConstantInstr(
-        String::ZoneHandle(Z, String::New(value, Heap::kOld)));
+  return new (Z)
+      ConstantInstr(String::ZoneHandle(Z, String::New(value, Heap::kOld)));
 }
 
 
 ConstantInstr* IRRegExpMacroAssembler::WordCharacterMapConstant() const {
   const Library& lib = Library::Handle(Z, Library::CoreLibrary());
-  const Class& regexp_class = Class::Handle(Z,
-        lib.LookupClassAllowPrivate(Symbols::_RegExp()));
-  const Field& word_character_field = Field::ZoneHandle(Z,
+  const Class& regexp_class =
+      Class::Handle(Z, lib.LookupClassAllowPrivate(Symbols::_RegExp()));
+  const Field& word_character_field = Field::ZoneHandle(
+      Z,
       regexp_class.LookupStaticFieldAllowPrivate(Symbols::_wordCharacterMap()));
   ASSERT(!word_character_field.IsNull());
 
@@ -440,54 +449,53 @@
   }
   ASSERT(!word_character_field.IsUninitialized());
 
-  return new(Z) ConstantInstr(
-        Instance::ZoneHandle(Z, word_character_field.StaticValue()));
+  return new (Z) ConstantInstr(
+      Instance::ZoneHandle(Z, word_character_field.StaticValue()));
 }
 
 
-ComparisonInstr* IRRegExpMacroAssembler::Comparison(
-    ComparisonKind kind, PushArgumentInstr* lhs, PushArgumentInstr* rhs) {
+ComparisonInstr* IRRegExpMacroAssembler::Comparison(ComparisonKind kind,
+                                                    PushArgumentInstr* lhs,
+                                                    PushArgumentInstr* rhs) {
   Token::Kind strict_comparison = Token::kEQ_STRICT;
   Token::Kind intermediate_operator = Token::kILLEGAL;
   switch (kind) {
-  case kEQ:
-    intermediate_operator = Token::kEQ;
-    break;
-  case kNE:
-    intermediate_operator = Token::kEQ;
-    strict_comparison = Token::kNE_STRICT;
-    break;
-  case kLT:
-    intermediate_operator = Token::kLT;
-    break;
-  case kGT:
-    intermediate_operator = Token::kGT;
-    break;
-  case kLTE:
-    intermediate_operator = Token::kLTE;
-    break;
-  case kGTE:
-    intermediate_operator = Token::kGTE;
-    break;
-  default:
-    UNREACHABLE();
+    case kEQ:
+      intermediate_operator = Token::kEQ;
+      break;
+    case kNE:
+      intermediate_operator = Token::kEQ;
+      strict_comparison = Token::kNE_STRICT;
+      break;
+    case kLT:
+      intermediate_operator = Token::kLT;
+      break;
+    case kGT:
+      intermediate_operator = Token::kGT;
+      break;
+    case kLTE:
+      intermediate_operator = Token::kLTE;
+      break;
+    case kGTE:
+      intermediate_operator = Token::kGTE;
+      break;
+    default:
+      UNREACHABLE();
   }
 
   ASSERT(intermediate_operator != Token::kILLEGAL);
 
-  Value* lhs_value =
-      Bind(InstanceCall(
-             InstanceCallDescriptor::FromToken(intermediate_operator),
-             lhs,
-             rhs));
+  Value* lhs_value = Bind(InstanceCall(
+      InstanceCallDescriptor::FromToken(intermediate_operator), lhs, rhs));
   Value* rhs_value = Bind(BoolConstant(true));
 
-  return new(Z) StrictCompareInstr(
-      TokenPosition::kNoSource, strict_comparison, lhs_value, rhs_value, true);
+  return new (Z) StrictCompareInstr(TokenPosition::kNoSource, strict_comparison,
+                                    lhs_value, rhs_value, true);
 }
 
-ComparisonInstr* IRRegExpMacroAssembler::Comparison(
-    ComparisonKind kind, Definition* lhs, Definition* rhs) {
+ComparisonInstr* IRRegExpMacroAssembler::Comparison(ComparisonKind kind,
+                                                    Definition* lhs,
+                                                    Definition* rhs) {
   PushArgumentInstr* lhs_push = PushArgument(Bind(lhs));
   PushArgumentInstr* rhs_push = PushArgument(Bind(rhs));
   return Comparison(kind, lhs_push, rhs_push);
@@ -497,7 +505,7 @@
 StaticCallInstr* IRRegExpMacroAssembler::StaticCall(
     const Function& function) const {
   ZoneGrowableArray<PushArgumentInstr*>* arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>(0);
+      new (Z) ZoneGrowableArray<PushArgumentInstr*>(0);
   return StaticCall(function, arguments);
 }
 
@@ -506,7 +514,7 @@
     const Function& function,
     PushArgumentInstr* arg1) const {
   ZoneGrowableArray<PushArgumentInstr*>* arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>(1);
+      new (Z) ZoneGrowableArray<PushArgumentInstr*>(1);
   arguments->Add(arg1);
 
   return StaticCall(function, arguments);
@@ -518,7 +526,7 @@
     PushArgumentInstr* arg1,
     PushArgumentInstr* arg2) const {
   ZoneGrowableArray<PushArgumentInstr*>* arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>(2);
+      new (Z) ZoneGrowableArray<PushArgumentInstr*>(2);
   arguments->Add(arg1);
   arguments->Add(arg2);
 
@@ -529,11 +537,9 @@
 StaticCallInstr* IRRegExpMacroAssembler::StaticCall(
     const Function& function,
     ZoneGrowableArray<PushArgumentInstr*>* arguments) const {
-  return new(Z) StaticCallInstr(TokenPosition::kNoSource,
-                                function,
-                                Object::null_array(),
-                                arguments,
-                                ic_data_array_);
+  return new (Z)
+      StaticCallInstr(TokenPosition::kNoSource, function, Object::null_array(),
+                      arguments, ic_data_array_);
 }
 
 
@@ -541,7 +547,7 @@
     const InstanceCallDescriptor& desc,
     PushArgumentInstr* arg1) const {
   ZoneGrowableArray<PushArgumentInstr*>* arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>(1);
+      new (Z) ZoneGrowableArray<PushArgumentInstr*>(1);
   arguments->Add(arg1);
 
   return InstanceCall(desc, arguments);
@@ -553,7 +559,7 @@
     PushArgumentInstr* arg1,
     PushArgumentInstr* arg2) const {
   ZoneGrowableArray<PushArgumentInstr*>* arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>(2);
+      new (Z) ZoneGrowableArray<PushArgumentInstr*>(2);
   arguments->Add(arg1);
   arguments->Add(arg2);
 
@@ -567,7 +573,7 @@
     PushArgumentInstr* arg2,
     PushArgumentInstr* arg3) const {
   ZoneGrowableArray<PushArgumentInstr*>* arguments =
-      new(Z) ZoneGrowableArray<PushArgumentInstr*>(3);
+      new (Z) ZoneGrowableArray<PushArgumentInstr*>(3);
   arguments->Add(arg1);
   arguments->Add(arg2);
   arguments->Add(arg3);
@@ -578,26 +584,20 @@
 
 InstanceCallInstr* IRRegExpMacroAssembler::InstanceCall(
     const InstanceCallDescriptor& desc,
-    ZoneGrowableArray<PushArgumentInstr*> *arguments) const {
-  return
-    new(Z) InstanceCallInstr(TokenPosition::kNoSource,
-                             desc.name,
-                             desc.token_kind,
-                             arguments,
-                             Object::null_array(),
-                             desc.checked_argument_count,
-                             ic_data_array_);
+    ZoneGrowableArray<PushArgumentInstr*>* arguments) const {
+  return new (Z) InstanceCallInstr(
+      TokenPosition::kNoSource, desc.name, desc.token_kind, arguments,
+      Object::null_array(), desc.checked_argument_count, ic_data_array_);
 }
 
 
 LoadLocalInstr* IRRegExpMacroAssembler::LoadLocal(LocalVariable* local) const {
-  return new(Z) LoadLocalInstr(*local, TokenPosition::kNoSource);
+  return new (Z) LoadLocalInstr(*local, TokenPosition::kNoSource);
 }
 
 
-void IRRegExpMacroAssembler::StoreLocal(LocalVariable* local,
-                                        Value* value) {
-  Do(new(Z) StoreLocalInstr(*local, value, TokenPosition::kNoSource));
+void IRRegExpMacroAssembler::StoreLocal(LocalVariable* local, Value* value) {
+  Do(new (Z) StoreLocalInstr(*local, value, TokenPosition::kNoSource));
 }
 
 
@@ -610,7 +610,7 @@
   AppendInstruction(definition);
   definition->set_temp_index(temp_id_.Alloc());
 
-  return new(Z) Value(definition);
+  return new (Z) Value(definition);
 }
 
 
@@ -621,10 +621,10 @@
 
 Value* IRRegExpMacroAssembler::BindLoadLocal(const LocalVariable& local) {
   if (local.IsConst()) {
-    return Bind(new(Z) ConstantInstr(*local.ConstValue()));
+    return Bind(new (Z) ConstantInstr(*local.ConstValue()));
   }
   ASSERT(!local.is_captured());
-  return Bind(new(Z) LoadLocalInstr(local, TokenPosition::kNoSource));
+  return Bind(new (Z) LoadLocalInstr(local, TokenPosition::kNoSource));
 }
 
 
@@ -632,15 +632,16 @@
 // a jmp not followed by a bind. We cannot do the same, since it is impossible
 // to append to a block following a jmp. In such cases, assume that we are doing
 // the correct thing, but output a warning when tracing.
-#define HANDLE_DEAD_CODE_EMISSION() \
-  if (current_instruction_ == NULL) { \
-    if (FLAG_trace_irregexp) { \
-      OS::Print("WARNING: Attempting to append to a closed assembler. " \
-                "This could be either a bug or generation of dead code " \
-                "inherited from V8.\n"); \
-    } \
-    BlockLabel dummy; \
-    BindBlock(&dummy); \
+#define HANDLE_DEAD_CODE_EMISSION()                                            \
+  if (current_instruction_ == NULL) {                                          \
+    if (FLAG_trace_irregexp) {                                                 \
+      OS::Print(                                                               \
+          "WARNING: Attempting to append to a closed assembler. "              \
+          "This could be either a bug or generation of dead code "             \
+          "inherited from V8.\n");                                             \
+    }                                                                          \
+    BlockLabel dummy;                                                          \
+    BindBlock(&dummy);                                                         \
   }
 
 void IRRegExpMacroAssembler::AppendInstruction(Instruction* instruction) {
@@ -695,7 +696,7 @@
 
 PushArgumentInstr* IRRegExpMacroAssembler::PushArgument(Value* value) {
   arg_id_.Alloc();
-  PushArgumentInstr* push = new(Z) PushArgumentInstr(value);
+  PushArgumentInstr* push = new (Z) PushArgumentInstr(value);
   // Do *not* use Do() for push argument instructions.
   AppendInstruction(push);
   return push;
@@ -708,16 +709,15 @@
 
 
 void IRRegExpMacroAssembler::Print(const char* str) {
-  Print(PushArgument(
-    Bind(new(Z) ConstantInstr(
-           String::ZoneHandle(Z, String::New(str, Heap::kOld))))));
+  Print(PushArgument(Bind(new (Z) ConstantInstr(
+      String::ZoneHandle(Z, String::New(str, Heap::kOld))))));
 }
 
 
 void IRRegExpMacroAssembler::Print(PushArgumentInstr* argument) {
   const Library& lib = Library::Handle(Library::CoreLibrary());
-  const Function& print_fn = Function::ZoneHandle(
-        Z, lib.LookupFunctionAllowPrivate(Symbols::print()));
+  const Function& print_fn =
+      Function::ZoneHandle(Z, lib.LookupFunctionAllowPrivate(Symbols::print()));
   Do(StaticCall(print_fn, argument));
 }
 
@@ -729,7 +729,7 @@
 }
 
 
-intptr_t IRRegExpMacroAssembler::stack_limit_slack()  {
+intptr_t IRRegExpMacroAssembler::stack_limit_slack() {
   return 32;
 }
 
@@ -798,8 +798,7 @@
   PushArgumentInstr* registers_push = PushLocal(registers_);
   PushArgumentInstr* index_push = PushRegisterIndex(index);
   return Bind(InstanceCall(InstanceCallDescriptor::FromToken(Token::kINDEX),
-                           registers_push,
-                           index_push));
+                           registers_push, index_push));
 }
 
 void IRRegExpMacroAssembler::StoreRegister(intptr_t index, intptr_t value) {
@@ -815,9 +814,7 @@
                                            PushArgumentInstr* value) {
   TAG();
   Do(InstanceCall(InstanceCallDescriptor::FromToken(Token::kASSIGN_INDEX),
-                  registers,
-                  index,
-                  value));
+                  registers, index, value));
 }
 
 PushArgumentInstr* IRRegExpMacroAssembler::PushRegisterIndex(intptr_t index) {
@@ -840,10 +837,9 @@
 void IRRegExpMacroAssembler::CheckCharacterGT(uint16_t limit,
                                               BlockLabel* on_greater) {
   TAG();
-  BranchOrBacktrack(Comparison(kGT,
-                               LoadLocal(current_character_),
-                               Uint64Constant(limit)),
-                    on_greater);
+  BranchOrBacktrack(
+      Comparison(kGT, LoadLocal(current_character_), Uint64Constant(limit)),
+      on_greater);
 }
 
 
@@ -853,10 +849,9 @@
   BlockLabel not_at_start;
 
   // Did we start the match at the start of the string at all?
-  BranchOrBacktrack(Comparison(kNE,
-                               LoadLocal(start_index_param_),
-                               Uint64Constant(0)),
-                    &not_at_start);
+  BranchOrBacktrack(
+      Comparison(kNE, LoadLocal(start_index_param_), Uint64Constant(0)),
+      &not_at_start);
 
   // If we did, are we still at the start of the input, i.e. is
   // (offset == string_length * -1)?
@@ -864,8 +859,7 @@
       InstanceCall(InstanceCallDescriptor::FromToken(Token::kNEGATE),
                    PushLocal(string_param_length_));
   Definition* offset_def = LoadLocal(current_position_);
-  BranchOrBacktrack(Comparison(kEQ, neg_len_def, offset_def),
-                    on_at_start);
+  BranchOrBacktrack(Comparison(kEQ, neg_len_def, offset_def), on_at_start);
 
   BindBlock(&not_at_start);
 }
@@ -875,10 +869,9 @@
   TAG();
 
   // Did we start the match at the start of the string at all?
-  BranchOrBacktrack(Comparison(kNE,
-                               LoadLocal(start_index_param_),
-                               Uint64Constant(0)),
-                    on_not_at_start);
+  BranchOrBacktrack(
+      Comparison(kNE, LoadLocal(start_index_param_), Uint64Constant(0)),
+      on_not_at_start);
 
   // If we did, are we still at the start of the input, i.e. is
   // (offset == string_length * -1)?
@@ -886,18 +879,16 @@
       InstanceCall(InstanceCallDescriptor::FromToken(Token::kNEGATE),
                    PushLocal(string_param_length_));
   Definition* offset_def = LoadLocal(current_position_);
-  BranchOrBacktrack(Comparison(kNE, neg_len_def, offset_def),
-                    on_not_at_start);
+  BranchOrBacktrack(Comparison(kNE, neg_len_def, offset_def), on_not_at_start);
 }
 
 
 void IRRegExpMacroAssembler::CheckCharacterLT(uint16_t limit,
                                               BlockLabel* on_less) {
   TAG();
-  BranchOrBacktrack(Comparison(kLT,
-                               LoadLocal(current_character_),
-                               Uint64Constant(limit)),
-                    on_less);
+  BranchOrBacktrack(
+      Comparison(kLT, LoadLocal(current_character_), Uint64Constant(limit)),
+      on_less);
 }
 
 
@@ -908,8 +899,7 @@
 
   Definition* head = PeekStack();
   Definition* cur_pos_def = LoadLocal(current_position_);
-  BranchOrBacktrack(Comparison(kNE, head, cur_pos_def),
-                    &fallthrough);
+  BranchOrBacktrack(Comparison(kNE, head, cur_pos_def), &fallthrough);
 
   // Pop, throwing away the value.
   Do(PopStack());
@@ -937,29 +927,26 @@
   // the start of the capture.
   // BranchOrBacktrack(less, on_no_match);
 
-  BranchOrBacktrack(Comparison(kLT,
-                               LoadLocal(capture_length_),
-                               Uint64Constant(0)),
-                    on_no_match);
+  BranchOrBacktrack(
+      Comparison(kLT, LoadLocal(capture_length_), Uint64Constant(0)),
+      on_no_match);
 
   // If length is zero, either the capture is empty or it is completely
   // uncaptured. In either case succeed immediately.
-  BranchOrBacktrack(Comparison(kEQ,
-                               LoadLocal(capture_length_),
-                               Uint64Constant(0)),
-                    &fallthrough);
+  BranchOrBacktrack(
+      Comparison(kEQ, LoadLocal(capture_length_), Uint64Constant(0)),
+      &fallthrough);
 
 
   // Check that there are sufficient characters left in the input.
   PushArgumentInstr* pos_push = PushLocal(current_position_);
   PushArgumentInstr* len_push = PushLocal(capture_length_);
   BranchOrBacktrack(
-        Comparison(kGT,
-                   InstanceCall(InstanceCallDescriptor::FromToken(Token::kADD),
-                                pos_push,
-                                len_push),
-                   Uint64Constant(0)),
-        on_no_match);
+      Comparison(kGT,
+                 InstanceCall(InstanceCallDescriptor::FromToken(Token::kADD),
+                              pos_push, len_push),
+                 Uint64Constant(0)),
+      on_no_match);
 
   pos_push = PushLocal(current_position_);
   len_push = PushLocal(string_param_length_);
@@ -982,63 +969,54 @@
     StoreLocal(char_in_capture_, CharacterAt(capture_start_index_));
     StoreLocal(char_in_match_, CharacterAt(match_start_index_));
 
-    BranchOrBacktrack(Comparison(kEQ,
-                                 LoadLocal(char_in_capture_),
-                                 LoadLocal(char_in_match_)),
-                      &loop_increment);
+    BranchOrBacktrack(
+        Comparison(kEQ, LoadLocal(char_in_capture_), LoadLocal(char_in_match_)),
+        &loop_increment);
 
     // Mismatch, try case-insensitive match (converting letters to lower-case).
     PushArgumentInstr* match_char_push = PushLocal(char_in_match_);
     PushArgumentInstr* mask_push = PushArgument(Bind(Uint64Constant(0x20)));
-    StoreLocal(char_in_match_,
-               Bind(InstanceCall(
-                      InstanceCallDescriptor::FromToken(Token::kBIT_OR),
-                      match_char_push,
-                      mask_push)));
+    StoreLocal(
+        char_in_match_,
+        Bind(InstanceCall(InstanceCallDescriptor::FromToken(Token::kBIT_OR),
+                          match_char_push, mask_push)));
 
     BlockLabel convert_capture;
     BlockLabel on_not_in_range;
-    BranchOrBacktrack(Comparison(kLT,
-                                 LoadLocal(char_in_match_),
-                                 Uint64Constant('a')),
-                      &on_not_in_range);
-    BranchOrBacktrack(Comparison(kGT,
-                                 LoadLocal(char_in_match_),
-                                 Uint64Constant('z')),
-                      &on_not_in_range);
+    BranchOrBacktrack(
+        Comparison(kLT, LoadLocal(char_in_match_), Uint64Constant('a')),
+        &on_not_in_range);
+    BranchOrBacktrack(
+        Comparison(kGT, LoadLocal(char_in_match_), Uint64Constant('z')),
+        &on_not_in_range);
     GoTo(&convert_capture);
     BindBlock(&on_not_in_range);
 
     // Latin-1: Check for values in range [224,254] but not 247.
-    BranchOrBacktrack(Comparison(kLT,
-                                 LoadLocal(char_in_match_),
-                                 Uint64Constant(224)),
-                      on_no_match);
-    BranchOrBacktrack(Comparison(kGT,
-                                 LoadLocal(char_in_match_),
-                                 Uint64Constant(254)),
-                      on_no_match);
+    BranchOrBacktrack(
+        Comparison(kLT, LoadLocal(char_in_match_), Uint64Constant(224)),
+        on_no_match);
+    BranchOrBacktrack(
+        Comparison(kGT, LoadLocal(char_in_match_), Uint64Constant(254)),
+        on_no_match);
 
-    BranchOrBacktrack(Comparison(kEQ,
-                                 LoadLocal(char_in_match_),
-                                 Uint64Constant(247)),
-                      on_no_match);
+    BranchOrBacktrack(
+        Comparison(kEQ, LoadLocal(char_in_match_), Uint64Constant(247)),
+        on_no_match);
 
     // Also convert capture character.
     BindBlock(&convert_capture);
 
     PushArgumentInstr* capture_char_push = PushLocal(char_in_capture_);
     mask_push = PushArgument(Bind(Uint64Constant(0x20)));
-    StoreLocal(char_in_capture_,
-               Bind(InstanceCall(
-                      InstanceCallDescriptor::FromToken(Token::kBIT_OR),
-                      capture_char_push,
-                      mask_push)));
+    StoreLocal(
+        char_in_capture_,
+        Bind(InstanceCall(InstanceCallDescriptor::FromToken(Token::kBIT_OR),
+                          capture_char_push, mask_push)));
 
-    BranchOrBacktrack(Comparison(kNE,
-                                 LoadLocal(char_in_match_),
-                                 LoadLocal(char_in_capture_)),
-                      on_no_match);
+    BranchOrBacktrack(
+        Comparison(kNE, LoadLocal(char_in_match_), LoadLocal(char_in_capture_)),
+        on_no_match);
 
     BindBlock(&loop_increment);
 
@@ -1052,8 +1030,7 @@
     StoreLocal(match_start_index_, Bind(Add(index_push, inc_push)));
 
     // Compare to end of match, and loop if not done.
-    BranchOrBacktrack(Comparison(kLT,
-                                 LoadLocal(match_start_index_),
+    BranchOrBacktrack(Comparison(kLT, LoadLocal(match_start_index_),
                                  LoadLocal(match_end_index_)),
                       &loop);
   } else {
@@ -1064,13 +1041,9 @@
     Value* rhs_index_value = Bind(LoadLocal(capture_start_index_));
     Value* length_value = Bind(LoadLocal(capture_length_));
 
-    Definition* is_match_def =
-        new(Z) CaseInsensitiveCompareUC16Instr(
-                            string_value,
-                            lhs_index_value,
-                            rhs_index_value,
-                            length_value,
-                            specialization_cid_);
+    Definition* is_match_def = new (Z) CaseInsensitiveCompareUC16Instr(
+        string_value, lhs_index_value, rhs_index_value, length_value,
+        specialization_cid_);
 
     BranchOrBacktrack(Comparison(kNE, is_match_def, BoolConstant(true)),
                       on_no_match);
@@ -1087,9 +1060,8 @@
 }
 
 
-void IRRegExpMacroAssembler::CheckNotBackReference(
-    intptr_t start_reg,
-    BlockLabel* on_no_match) {
+void IRRegExpMacroAssembler::CheckNotBackReference(intptr_t start_reg,
+                                                   BlockLabel* on_no_match) {
   TAG();
   ASSERT(start_reg + 1 <= registers_count_);
 
@@ -1102,27 +1074,24 @@
   StoreLocal(capture_length_, Bind(Sub(end_push, start_push)));
 
   // Fail on partial or illegal capture (start of capture after end of capture).
-  BranchOrBacktrack(Comparison(kLT,
-                               LoadLocal(capture_length_),
-                               Uint64Constant(0)),
-                    on_no_match);
+  BranchOrBacktrack(
+      Comparison(kLT, LoadLocal(capture_length_), Uint64Constant(0)),
+      on_no_match);
 
   // Succeed on empty capture (including no capture)
-  BranchOrBacktrack(Comparison(kEQ,
-                               LoadLocal(capture_length_),
-                               Uint64Constant(0)),
-                    &fallthrough);
+  BranchOrBacktrack(
+      Comparison(kEQ, LoadLocal(capture_length_), Uint64Constant(0)),
+      &fallthrough);
 
   // Check that there are sufficient characters left in the input.
   PushArgumentInstr* pos_push = PushLocal(current_position_);
   PushArgumentInstr* len_push = PushLocal(capture_length_);
   BranchOrBacktrack(
-        Comparison(kGT,
-                   InstanceCall(InstanceCallDescriptor::FromToken(Token::kADD),
-                                pos_push,
-                                len_push),
-                   Uint64Constant(0)),
-        on_no_match);
+      Comparison(kGT,
+                 InstanceCall(InstanceCallDescriptor::FromToken(Token::kADD),
+                              pos_push, len_push),
+                 Uint64Constant(0)),
+      on_no_match);
 
   // Compute pointers to match string and capture string.
   pos_push = PushLocal(current_position_);
@@ -1143,10 +1112,9 @@
   StoreLocal(char_in_capture_, CharacterAt(capture_start_index_));
   StoreLocal(char_in_match_, CharacterAt(match_start_index_));
 
-  BranchOrBacktrack(Comparison(kNE,
-                               LoadLocal(char_in_capture_),
-                               LoadLocal(char_in_match_)),
-                    on_no_match);
+  BranchOrBacktrack(
+      Comparison(kNE, LoadLocal(char_in_capture_), LoadLocal(char_in_match_)),
+      on_no_match);
 
   // Increment indexes into capture and match strings.
   PushArgumentInstr* index_push = PushLocal(capture_start_index_);
@@ -1158,8 +1126,7 @@
   StoreLocal(match_start_index_, Bind(Add(index_push, inc_push)));
 
   // Check if we have reached end of match area.
-  BranchOrBacktrack(Comparison(kLT,
-                               LoadLocal(match_start_index_),
+  BranchOrBacktrack(Comparison(kLT, LoadLocal(match_start_index_),
                                LoadLocal(match_end_index_)),
                     &loop);
 
@@ -1177,10 +1144,9 @@
 void IRRegExpMacroAssembler::CheckNotCharacter(uint32_t c,
                                                BlockLabel* on_not_equal) {
   TAG();
-  BranchOrBacktrack(Comparison(kNE,
-                               LoadLocal(current_character_),
-                               Uint64Constant(c)),
-                    on_not_equal);
+  BranchOrBacktrack(
+      Comparison(kNE, LoadLocal(current_character_), Uint64Constant(c)),
+      on_not_equal);
 }
 
 
@@ -1195,8 +1161,7 @@
   PushArgumentInstr* actual_push = PushArgument(Bind(actual_def));
   PushArgumentInstr* mask_push = PushArgument(Bind(Uint64Constant(mask)));
   actual_def = InstanceCall(InstanceCallDescriptor::FromToken(Token::kBIT_AND),
-                            actual_push,
-                            mask_push);
+                            actual_push, mask_push);
 
   BranchOrBacktrack(Comparison(kEQ, actual_def, expected_def), on_equal);
 }
@@ -1214,8 +1179,7 @@
   PushArgumentInstr* actual_push = PushArgument(Bind(actual_def));
   PushArgumentInstr* mask_push = PushArgument(Bind(Uint64Constant(mask)));
   actual_def = InstanceCall(InstanceCallDescriptor::FromToken(Token::kBIT_AND),
-                            actual_push,
-                            mask_push);
+                            actual_push, mask_push);
 
   BranchOrBacktrack(Comparison(kNE, actual_def, expected_def), on_not_equal);
 }
@@ -1238,17 +1202,15 @@
   actual_push = PushArgument(Bind(Sub(actual_push, minus_push)));
   PushArgumentInstr* mask_push = PushArgument(Bind(Uint64Constant(mask)));
   actual_def = InstanceCall(InstanceCallDescriptor::FromToken(Token::kBIT_AND),
-                            actual_push,
-                            mask_push);
+                            actual_push, mask_push);
 
   BranchOrBacktrack(Comparison(kNE, actual_def, expected_def), on_not_equal);
 }
 
 
-void IRRegExpMacroAssembler::CheckCharacterInRange(
-    uint16_t from,
-    uint16_t to,
-    BlockLabel* on_in_range) {
+void IRRegExpMacroAssembler::CheckCharacterInRange(uint16_t from,
+                                                   uint16_t to,
+                                                   BlockLabel* on_in_range) {
   TAG();
   ASSERT(from <= to);
 
@@ -1256,14 +1218,12 @@
   // compares. This pattern repeats in various places.
 
   BlockLabel on_not_in_range;
-  BranchOrBacktrack(Comparison(kLT,
-                               LoadLocal(current_character_),
-                               Uint64Constant(from)),
-                    &on_not_in_range);
-  BranchOrBacktrack(Comparison(kGT,
-                               LoadLocal(current_character_),
-                               Uint64Constant(to)),
-                    &on_not_in_range);
+  BranchOrBacktrack(
+      Comparison(kLT, LoadLocal(current_character_), Uint64Constant(from)),
+      &on_not_in_range);
+  BranchOrBacktrack(
+      Comparison(kGT, LoadLocal(current_character_), Uint64Constant(to)),
+      &on_not_in_range);
   BranchOrBacktrack(NULL, on_in_range);
 
   BindBlock(&on_not_in_range);
@@ -1277,40 +1237,34 @@
   TAG();
   ASSERT(from <= to);
 
-  BranchOrBacktrack(Comparison(kLT,
-                               LoadLocal(current_character_),
-                               Uint64Constant(from)),
-                    on_not_in_range);
+  BranchOrBacktrack(
+      Comparison(kLT, LoadLocal(current_character_), Uint64Constant(from)),
+      on_not_in_range);
 
-  BranchOrBacktrack(Comparison(kGT,
-                               LoadLocal(current_character_),
-                               Uint64Constant(to)),
-                    on_not_in_range);
+  BranchOrBacktrack(
+      Comparison(kGT, LoadLocal(current_character_), Uint64Constant(to)),
+      on_not_in_range);
 }
 
 
-void IRRegExpMacroAssembler::CheckBitInTable(
-    const TypedData& table,
-    BlockLabel* on_bit_set) {
+void IRRegExpMacroAssembler::CheckBitInTable(const TypedData& table,
+                                             BlockLabel* on_bit_set) {
   TAG();
 
   PushArgumentInstr* table_push =
-      PushArgument(Bind(new(Z) ConstantInstr(table)));
+      PushArgument(Bind(new (Z) ConstantInstr(table)));
   PushArgumentInstr* index_push = PushLocal(current_character_);
 
   if (mode_ != ASCII || kTableMask != Symbols::kMaxOneCharCodeSymbol) {
     PushArgumentInstr* mask_push =
         PushArgument(Bind(Uint64Constant(kTableSize - 1)));
     index_push = PushArgument(
-          Bind(InstanceCall(InstanceCallDescriptor::FromToken(Token::kBIT_AND),
-                            index_push,
-                            mask_push)));
+        Bind(InstanceCall(InstanceCallDescriptor::FromToken(Token::kBIT_AND),
+                          index_push, mask_push)));
   }
 
-  Definition* byte_def =
-      InstanceCall(InstanceCallDescriptor::FromToken(Token::kINDEX),
-                   table_push,
-                   index_push);
+  Definition* byte_def = InstanceCall(
+      InstanceCallDescriptor::FromToken(Token::kINDEX), table_push, index_push);
   Definition* zero_def = Int64Constant(0);
 
   BranchOrBacktrack(Comparison(kNE, byte_def, zero_def), on_bit_set);
@@ -1325,145 +1279,131 @@
   // Range checks (c in min..max) are generally implemented by an unsigned
   // (c - min) <= (max - min) check
   switch (type) {
-  case 's':
-    // Match space-characters
-    if (mode_ == ASCII) {
-      // One byte space characters are '\t'..'\r', ' ' and \u00a0.
+    case 's':
+      // Match space-characters
+      if (mode_ == ASCII) {
+        // One byte space characters are '\t'..'\r', ' ' and \u00a0.
+        BlockLabel success;
+        // Space (' ').
+        BranchOrBacktrack(
+            Comparison(kEQ, LoadLocal(current_character_), Uint64Constant(' ')),
+            &success);
+        // Check range 0x09..0x0d.
+        CheckCharacterInRange('\t', '\r', &success);
+        // \u00a0 (NBSP).
+        BranchOrBacktrack(Comparison(kNE, LoadLocal(current_character_),
+                                     Uint64Constant(0x00a0)),
+                          on_no_match);
+        BindBlock(&success);
+        return true;
+      }
+      return false;
+    case 'S':
+      // The emitted code for generic character classes is good enough.
+      return false;
+    case 'd':
+      // Match ASCII digits ('0'..'9')
+      CheckCharacterNotInRange('0', '9', on_no_match);
+      return true;
+    case 'D':
+      // Match non ASCII-digits
+      CheckCharacterInRange('0', '9', on_no_match);
+      return true;
+    case '.': {
+      // Match non-newlines (not 0x0a('\n'), 0x0d('\r'), 0x2028 and 0x2029)
+      BranchOrBacktrack(
+          Comparison(kEQ, LoadLocal(current_character_), Uint64Constant('\n')),
+          on_no_match);
+      BranchOrBacktrack(
+          Comparison(kEQ, LoadLocal(current_character_), Uint64Constant('\r')),
+          on_no_match);
+      if (mode_ == UC16) {
+        BranchOrBacktrack(Comparison(kEQ, LoadLocal(current_character_),
+                                     Uint64Constant(0x2028)),
+                          on_no_match);
+        BranchOrBacktrack(Comparison(kEQ, LoadLocal(current_character_),
+                                     Uint64Constant(0x2029)),
+                          on_no_match);
+      }
+      return true;
+    }
+    case 'w': {
+      if (mode_ != ASCII) {
+        // Table is 128 entries, so all ASCII characters can be tested.
+        BranchOrBacktrack(
+            Comparison(kGT, LoadLocal(current_character_), Uint64Constant('z')),
+            on_no_match);
+      }
+
+      PushArgumentInstr* table_push =
+          PushArgument(Bind(WordCharacterMapConstant()));
+      PushArgumentInstr* index_push = PushLocal(current_character_);
+
+      Definition* byte_def =
+          InstanceCall(InstanceCallDescriptor::FromToken(Token::kINDEX),
+                       table_push, index_push);
+      Definition* zero_def = Int64Constant(0);
+
+      BranchOrBacktrack(Comparison(kEQ, byte_def, zero_def), on_no_match);
+
+      return true;
+    }
+    case 'W': {
+      BlockLabel done;
+      if (mode_ != ASCII) {
+        // Table is 128 entries, so all ASCII characters can be tested.
+        BranchOrBacktrack(
+            Comparison(kGT, LoadLocal(current_character_), Uint64Constant('z')),
+            &done);
+      }
+
+      // TODO(zerny): Refactor to use CheckBitInTable if possible.
+
+      PushArgumentInstr* table_push =
+          PushArgument(Bind(WordCharacterMapConstant()));
+      PushArgumentInstr* index_push = PushLocal(current_character_);
+
+      Definition* byte_def =
+          InstanceCall(InstanceCallDescriptor::FromToken(Token::kINDEX),
+                       table_push, index_push);
+      Definition* zero_def = Int64Constant(0);
+
+      BranchOrBacktrack(Comparison(kNE, byte_def, zero_def), on_no_match);
+
+      if (mode_ != ASCII) {
+        BindBlock(&done);
+      }
+      return true;
+    }
+    // Non-standard classes (with no syntactic shorthand) used internally.
+    case '*':
+      // Match any character.
+      return true;
+    case 'n': {
+      // Match newlines (0x0a('\n'), 0x0d('\r'), 0x2028 or 0x2029).
+      // The opposite of '.'.
       BlockLabel success;
-      // Space (' ').
-      BranchOrBacktrack(Comparison(kEQ,
-                                   LoadLocal(current_character_),
-                                   Uint64Constant(' ')),
-                        &success);
-      // Check range 0x09..0x0d.
-      CheckCharacterInRange('\t', '\r', &success);
-      // \u00a0 (NBSP).
-      BranchOrBacktrack(Comparison(kNE,
-                                   LoadLocal(current_character_),
-                                   Uint64Constant(0x00a0)),
-                        on_no_match);
+      BranchOrBacktrack(
+          Comparison(kEQ, LoadLocal(current_character_), Uint64Constant('\n')),
+          &success);
+      BranchOrBacktrack(
+          Comparison(kEQ, LoadLocal(current_character_), Uint64Constant('\r')),
+          &success);
+      if (mode_ == UC16) {
+        BranchOrBacktrack(Comparison(kEQ, LoadLocal(current_character_),
+                                     Uint64Constant(0x2028)),
+                          &success);
+        BranchOrBacktrack(Comparison(kEQ, LoadLocal(current_character_),
+                                     Uint64Constant(0x2029)),
+                          &success);
+      }
+      BranchOrBacktrack(NULL, on_no_match);
       BindBlock(&success);
       return true;
     }
-    return false;
-  case 'S':
-    // The emitted code for generic character classes is good enough.
-    return false;
-  case 'd':
-    // Match ASCII digits ('0'..'9')
-    CheckCharacterNotInRange('0', '9', on_no_match);
-    return true;
-  case 'D':
-    // Match non ASCII-digits
-    CheckCharacterInRange('0', '9', on_no_match);
-    return true;
-  case '.': {
-    // Match non-newlines (not 0x0a('\n'), 0x0d('\r'), 0x2028 and 0x2029)
-    BranchOrBacktrack(Comparison(kEQ,
-                                 LoadLocal(current_character_),
-                                 Uint64Constant('\n')),
-                      on_no_match);
-    BranchOrBacktrack(Comparison(kEQ,
-                                 LoadLocal(current_character_),
-                                 Uint64Constant('\r')),
-                      on_no_match);
-    if (mode_ == UC16) {
-      BranchOrBacktrack(Comparison(kEQ,
-                                   LoadLocal(current_character_),
-                                   Uint64Constant(0x2028)),
-                        on_no_match);
-      BranchOrBacktrack(Comparison(kEQ,
-                                   LoadLocal(current_character_),
-                                   Uint64Constant(0x2029)),
-                        on_no_match);
-    }
-    return true;
-  }
-  case 'w': {
-    if (mode_ != ASCII) {
-      // Table is 128 entries, so all ASCII characters can be tested.
-      BranchOrBacktrack(Comparison(kGT,
-                                   LoadLocal(current_character_),
-                                   Uint64Constant('z')),
-                        on_no_match);
-    }
-
-    PushArgumentInstr* table_push =
-        PushArgument(Bind(WordCharacterMapConstant()));
-    PushArgumentInstr* index_push = PushLocal(current_character_);
-
-    Definition* byte_def =
-        InstanceCall(InstanceCallDescriptor::FromToken(Token::kINDEX),
-                     table_push,
-                     index_push);
-    Definition* zero_def = Int64Constant(0);
-
-    BranchOrBacktrack(Comparison(kEQ, byte_def, zero_def), on_no_match);
-
-    return true;
-  }
-  case 'W': {
-    BlockLabel done;
-    if (mode_ != ASCII) {
-      // Table is 128 entries, so all ASCII characters can be tested.
-      BranchOrBacktrack(Comparison(kGT,
-                                   LoadLocal(current_character_),
-                                   Uint64Constant('z')),
-                        &done);
-    }
-
-    // TODO(zerny): Refactor to use CheckBitInTable if possible.
-
-    PushArgumentInstr* table_push =
-        PushArgument(Bind(WordCharacterMapConstant()));
-    PushArgumentInstr* index_push = PushLocal(current_character_);
-
-    Definition* byte_def =
-        InstanceCall(InstanceCallDescriptor::FromToken(Token::kINDEX),
-                     table_push,
-                     index_push);
-    Definition* zero_def = Int64Constant(0);
-
-    BranchOrBacktrack(Comparison(kNE, byte_def, zero_def), on_no_match);
-
-    if (mode_ != ASCII) {
-      BindBlock(&done);
-    }
-    return true;
-  }
-  // Non-standard classes (with no syntactic shorthand) used internally.
-  case '*':
-    // Match any character.
-    return true;
-  case 'n': {
-    // Match newlines (0x0a('\n'), 0x0d('\r'), 0x2028 or 0x2029).
-    // The opposite of '.'.
-    BlockLabel success;
-    BranchOrBacktrack(Comparison(kEQ,
-                                 LoadLocal(current_character_),
-                                 Uint64Constant('\n')),
-                      &success);
-    BranchOrBacktrack(Comparison(kEQ,
-                                 LoadLocal(current_character_),
-                                 Uint64Constant('\r')),
-                      &success);
-    if (mode_ == UC16) {
-      BranchOrBacktrack(Comparison(kEQ,
-                                   LoadLocal(current_character_),
-                                   Uint64Constant(0x2028)),
-                        &success);
-      BranchOrBacktrack(Comparison(kEQ,
-                                   LoadLocal(current_character_),
-                                   Uint64Constant(0x2029)),
-                        &success);
-    }
-    BranchOrBacktrack(NULL, on_no_match);
-    BindBlock(&success);
-    return true;
-  }
-  // No custom implementation (yet): s(uint16_t), S(uint16_t).
-  default:
-    return false;
+    // No custom implementation (yet): s(uint16_t), S(uint16_t).
+    default:
+      return false;
   }
 }
 
@@ -1498,8 +1438,7 @@
 }
 
 
-void IRRegExpMacroAssembler::IfRegisterEqPos(intptr_t reg,
-                                             BlockLabel* if_eq) {
+void IRRegExpMacroAssembler::IfRegisterEqPos(intptr_t reg, BlockLabel* if_eq) {
   TAG();
   PushArgumentInstr* reg_push = PushArgument(LoadRegister(reg));
   PushArgumentInstr* pos = PushArgument(Bind(LoadLocal(current_position_)));
@@ -1508,7 +1447,7 @@
 
 
 RegExpMacroAssembler::IrregexpImplementation
-    IRRegExpMacroAssembler::Implementation() {
+IRRegExpMacroAssembler::Implementation() {
   return kIRImplementation;
 }
 
@@ -1518,8 +1457,8 @@
                                                   bool check_bounds,
                                                   intptr_t characters) {
   TAG();
-  ASSERT(cp_offset >= -1);      // ^ and \b can look behind one character.
-  ASSERT(cp_offset < (1<<30));  // Be sane! (And ensure negation works)
+  ASSERT(cp_offset >= -1);        // ^ and \b can look behind one character.
+  ASSERT(cp_offset < (1 << 30));  // Be sane! (And ensure negation works)
   if (check_bounds) {
     CheckPosition(cp_offset + characters - 1, on_end_of_input);
   }
@@ -1543,19 +1482,16 @@
 }
 
 
-void IRRegExpMacroAssembler::PushStack(Definition *definition) {
+void IRRegExpMacroAssembler::PushStack(Definition* definition) {
   PushArgumentInstr* stack_push = PushLocal(stack_);
   PushArgumentInstr* stack_pointer_push = PushLocal(stack_pointer_);
-  StoreLocal(stack_pointer_,
-             Bind(Add(stack_pointer_push,
-                      PushArgument(Bind(Uint64Constant(1))))));
+  StoreLocal(stack_pointer_, Bind(Add(stack_pointer_push,
+                                      PushArgument(Bind(Uint64Constant(1))))));
   stack_pointer_push = PushLocal(stack_pointer_);
   // TODO(zerny): bind value and push could break stack discipline.
   PushArgumentInstr* value_push = PushArgument(Bind(definition));
   Do(InstanceCall(InstanceCallDescriptor::FromToken(Token::kASSIGN_INDEX),
-                  stack_push,
-                  stack_pointer_push,
-                  value_push));
+                  stack_push, stack_pointer_push, value_push));
 }
 
 
@@ -1563,12 +1499,10 @@
   PushArgumentInstr* stack_push = PushLocal(stack_);
   PushArgumentInstr* stack_pointer_push1 = PushLocal(stack_pointer_);
   PushArgumentInstr* stack_pointer_push2 = PushLocal(stack_pointer_);
-  StoreLocal(stack_pointer_,
-             Bind(Sub(stack_pointer_push2,
-                      PushArgument(Bind(Uint64Constant(1))))));
+  StoreLocal(stack_pointer_, Bind(Sub(stack_pointer_push2,
+                                      PushArgument(Bind(Uint64Constant(1))))));
   return InstanceCall(InstanceCallDescriptor::FromToken(Token::kINDEX),
-                      stack_push,
-                      stack_pointer_push1);
+                      stack_push, stack_pointer_push1);
 }
 
 
@@ -1576,8 +1510,7 @@
   PushArgumentInstr* stack_push = PushLocal(stack_);
   PushArgumentInstr* stack_pointer_push = PushLocal(stack_pointer_);
   return InstanceCall(InstanceCallDescriptor::FromToken(Token::kINDEX),
-                      stack_push,
-                      stack_pointer_push);
+                      stack_push, stack_pointer_push);
 }
 
 
@@ -1610,16 +1543,13 @@
   // TODO(zerny): Refactor PushStack so it can be reused here.
   PushArgumentInstr* stack_push = PushLocal(stack_);
   PushArgumentInstr* stack_pointer_push = PushLocal(stack_pointer_);
-  StoreLocal(stack_pointer_,
-             Bind(Add(stack_pointer_push,
-                      PushArgument(Bind(Uint64Constant(1))))));
+  StoreLocal(stack_pointer_, Bind(Add(stack_pointer_push,
+                                      PushArgument(Bind(Uint64Constant(1))))));
   stack_pointer_push = PushLocal(stack_pointer_);
   // TODO(zerny): bind value and push could break stack discipline.
   PushArgumentInstr* value_push = PushArgument(LoadRegister(reg));
   Do(InstanceCall(InstanceCallDescriptor::FromToken(Token::kASSIGN_INDEX),
-                  stack_push,
-                  stack_pointer_push,
-                  value_push));
+                  stack_push, stack_pointer_push, value_push));
   CheckStackLimit();
 }
 
@@ -1631,24 +1561,21 @@
 void IRRegExpMacroAssembler::CheckStackLimit() {
   TAG();
   PushArgumentInstr* stack_push = PushLocal(stack_);
-  PushArgumentInstr* length_push = PushArgument(Bind(InstanceCall(
-      InstanceCallDescriptor(
-          String::ZoneHandle(Field::GetterSymbol(Symbols::Length()))),
-      stack_push)));
+  PushArgumentInstr* length_push = PushArgument(
+      Bind(InstanceCall(InstanceCallDescriptor(String::ZoneHandle(
+                            Field::GetterSymbol(Symbols::Length()))),
+                        stack_push)));
   PushArgumentInstr* capacity_push = PushArgument(Bind(Sub(
-      length_push,
-      PushArgument(Bind(Uint64Constant(stack_limit_slack()))))));
+      length_push, PushArgument(Bind(Uint64Constant(stack_limit_slack()))))));
   PushArgumentInstr* stack_pointer_push = PushLocal(stack_pointer_);
-  BranchInstr* branch = new(Z) BranchInstr(
-      Comparison(kGT, capacity_push, stack_pointer_push));
+  BranchInstr* branch =
+      new (Z) BranchInstr(Comparison(kGT, capacity_push, stack_pointer_push));
   CloseBlockWith(branch);
 
   BlockLabel grow_stack;
   BlockLabel fallthrough;
-  *branch->true_successor_address() =
-      TargetWithJoinGoto(fallthrough.block());
-  *branch->false_successor_address() =
-      TargetWithJoinGoto(grow_stack.block());
+  *branch->true_successor_address() = TargetWithJoinGoto(fallthrough.block());
+  *branch->false_successor_address() = TargetWithJoinGoto(grow_stack.block());
 
   BindBlock(&grow_stack);
   GrowStack();
@@ -1659,8 +1586,8 @@
 
 void IRRegExpMacroAssembler::GrowStack() {
   TAG();
-  Value* cell = Bind(new(Z) ConstantInstr(stack_array_cell_));
-  StoreLocal(stack_, Bind(new(Z) GrowRegExpStackInstr(cell)));
+  Value* cell = Bind(new (Z) ConstantInstr(stack_array_cell_));
+  StoreLocal(stack_, Bind(new (Z) GrowRegExpStackInstr(cell)));
 }
 
 
@@ -1676,7 +1603,7 @@
   StoreLocal(stack_pointer_, LoadRegister(reg));
 }
 
-void IRRegExpMacroAssembler::SetCurrentPositionFromEnd(intptr_t by)  {
+void IRRegExpMacroAssembler::SetCurrentPositionFromEnd(intptr_t by) {
   TAG();
 
   BlockLabel after_position;
@@ -1714,7 +1641,8 @@
 
 
 void IRRegExpMacroAssembler::WriteCurrentPositionToRegister(
-    intptr_t reg, intptr_t cp_offset) {
+    intptr_t reg,
+    intptr_t cp_offset) {
   TAG();
 
   PushArgumentInstr* registers_push = PushLocal(registers_);
@@ -1728,8 +1656,8 @@
 }
 
 
-void IRRegExpMacroAssembler::ClearRegisters(
-    intptr_t reg_from, intptr_t reg_to) {
+void IRRegExpMacroAssembler::ClearRegisters(intptr_t reg_from,
+                                            intptr_t reg_to) {
   TAG();
 
   ASSERT(reg_from <= reg_to);
@@ -1740,8 +1668,7 @@
   for (intptr_t reg = reg_from; reg <= reg_to; reg++) {
     PushArgumentInstr* registers_push = PushLocal(registers_);
     PushArgumentInstr* index_push = PushRegisterIndex(reg);
-    PushArgumentInstr* minus_one_push =
-        PushArgument(Bind(Int64Constant(-1)));
+    PushArgumentInstr* minus_one_push = PushArgument(Bind(Int64Constant(-1)));
     PushArgumentInstr* length_push = PushLocal(string_param_length_);
     PushArgumentInstr* value_push =
         PushArgument(Bind(Sub(minus_one_push, length_push)));
@@ -1772,14 +1699,12 @@
   // If (current_position_ < -cp_offset), we are in bounds.
   // Remember, current_position_ is a negative offset from the string end.
 
-  BranchOrBacktrack(Comparison(kGTE, curpos_def, cp_off_def),
-                    on_outside_input);
+  BranchOrBacktrack(Comparison(kGTE, curpos_def, cp_off_def), on_outside_input);
 }
 
 
-void IRRegExpMacroAssembler::BranchOrBacktrack(
-    ComparisonInstr* comparison,
-    BlockLabel* true_successor) {
+void IRRegExpMacroAssembler::BranchOrBacktrack(ComparisonInstr* comparison,
+                                               BlockLabel* true_successor) {
   if (comparison == NULL) {  // No condition
     if (true_successor == NULL) {
       Backtrack();
@@ -1800,11 +1725,9 @@
   // If the condition is not true, fall through to a new block.
   BlockLabel fallthrough;
 
-  BranchInstr* branch = new(Z) BranchInstr(comparison);
-  *branch->true_successor_address() =
-      TargetWithJoinGoto(true_successor_block);
-  *branch->false_successor_address() =
-      TargetWithJoinGoto(fallthrough.block());
+  BranchInstr* branch = new (Z) BranchInstr(comparison);
+  *branch->true_successor_address() = TargetWithJoinGoto(true_successor_block);
+  *branch->false_successor_address() = TargetWithJoinGoto(fallthrough.block());
 
   CloseBlockWith(branch);
   BindBlock(&fallthrough);
@@ -1813,11 +1736,11 @@
 
 TargetEntryInstr* IRRegExpMacroAssembler::TargetWithJoinGoto(
     JoinEntryInstr* dst) {
-  TargetEntryInstr* target = new(Z) TargetEntryInstr(
-          block_id_.Alloc(), kInvalidTryIndex);
+  TargetEntryInstr* target =
+      new (Z) TargetEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
   blocks_.Add(target);
 
-  target->AppendInstruction(new(Z) GotoInstr(dst));
+  target->AppendInstruction(new (Z) GotoInstr(dst));
 
   return target;
 }
@@ -1825,11 +1748,11 @@
 
 IndirectEntryInstr* IRRegExpMacroAssembler::IndirectWithJoinGoto(
     JoinEntryInstr* dst) {
-  IndirectEntryInstr* target = new(Z) IndirectEntryInstr(
-          block_id_.Alloc(), indirect_id_.Alloc(), kInvalidTryIndex);
+  IndirectEntryInstr* target = new (Z) IndirectEntryInstr(
+      block_id_.Alloc(), indirect_id_.Alloc(), kInvalidTryIndex);
   blocks_.Add(target);
 
-  target->AppendInstruction(new(Z) GotoInstr(dst));
+  target->AppendInstruction(new (Z) GotoInstr(dst));
 
   return target;
 }
@@ -1837,27 +1760,26 @@
 
 void IRRegExpMacroAssembler::CheckPreemption() {
   TAG();
-  AppendInstruction(new(Z) CheckStackOverflowInstr(
-      TokenPosition::kNoSource, 0));
+  AppendInstruction(new (Z)
+                        CheckStackOverflowInstr(TokenPosition::kNoSource, 0));
 }
 
 
-Definition* IRRegExpMacroAssembler::Add(
-    PushArgumentInstr* lhs,
-    PushArgumentInstr* rhs) {
+Definition* IRRegExpMacroAssembler::Add(PushArgumentInstr* lhs,
+                                        PushArgumentInstr* rhs) {
   return InstanceCall(InstanceCallDescriptor::FromToken(Token::kADD), lhs, rhs);
 }
 
 
-Definition* IRRegExpMacroAssembler::Sub(
-    PushArgumentInstr* lhs,
-    PushArgumentInstr* rhs) {
+Definition* IRRegExpMacroAssembler::Sub(PushArgumentInstr* lhs,
+                                        PushArgumentInstr* rhs) {
   return InstanceCall(InstanceCallDescriptor::FromToken(Token::kSUB), lhs, rhs);
 }
 
 
 void IRRegExpMacroAssembler::LoadCurrentCharacterUnchecked(
-    intptr_t cp_offset, intptr_t characters) {
+    intptr_t cp_offset,
+    intptr_t characters) {
   TAG();
 
   ASSERT(characters == 1 || CanReadUnaligned());
@@ -1871,12 +1793,9 @@
   // Calculate the addressed string index as:
   //    cp_offset + current_position_ + string_param_length_
   // TODO(zerny): Avoid generating 'add' instance-calls here.
-  PushArgumentInstr* off_arg =
-      PushArgument(Bind(Int64Constant(cp_offset)));
-  PushArgumentInstr* pos_arg =
-      PushArgument(BindLoadLocal(*current_position_));
-  PushArgumentInstr* off_pos_arg =
-      PushArgument(Bind(Add(off_arg, pos_arg)));
+  PushArgumentInstr* off_arg = PushArgument(Bind(Int64Constant(cp_offset)));
+  PushArgumentInstr* pos_arg = PushArgument(BindLoadLocal(*current_position_));
+  PushArgumentInstr* off_pos_arg = PushArgument(Bind(Add(off_arg, pos_arg)));
   PushArgumentInstr* len_arg =
       PushArgument(BindLoadLocal(*string_param_length_));
   // Index is stored in a temporary local so that we can later load it safely.
@@ -1915,20 +1834,16 @@
     // the first value is consumed to obtain the second value which is consumed
     // by LoadCodeUnitsAtInstr below.
     Value* external_val =
-        Bind(new(Z) LoadUntaggedInstr(pattern_val, external_offset));
-    pattern_val =
-        Bind(new(Z) LoadUntaggedInstr(external_val, data_offset));
+        Bind(new (Z) LoadUntaggedInstr(pattern_val, external_offset));
+    pattern_val = Bind(new (Z) LoadUntaggedInstr(external_val, data_offset));
   }
 
   // Here pattern_val might be untagged so this must not trigger a GC.
   Value* index_val = BindLoadLocal(*index);
 
-  return Bind(new(Z) LoadCodeUnitsInstr(
-      pattern_val,
-      index_val,
-      characters,
-      specialization_cid_,
-      TokenPosition::kNoSource));
+  return Bind(new (Z) LoadCodeUnitsInstr(pattern_val, index_val, characters,
+                                         specialization_cid_,
+                                         TokenPosition::kNoSource));
 }
 
 
diff --git a/runtime/vm/regexp_assembler_ir.h b/runtime/vm/regexp_assembler_ir.h
index f898346..ae70952 100644
--- a/runtime/vm/regexp_assembler_ir.h
+++ b/runtime/vm/regexp_assembler_ir.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_REGEXP_ASSEMBLER_IR_H_
-#define VM_REGEXP_ASSEMBLER_IR_H_
+#ifndef RUNTIME_VM_REGEXP_ASSEMBLER_IR_H_
+#define RUNTIME_VM_REGEXP_ASSEMBLER_IR_H_
 
 #include "vm/assembler.h"
 #include "vm/intermediate_language.h"
@@ -40,6 +40,7 @@
   static RawArray* Execute(const RegExp& regexp,
                            const String& input,
                            const Smi& start_offset,
+                           bool sticky,
                            Zone* zone);
 
   virtual bool IsClosed() const { return (current_instruction_ == NULL); }
@@ -83,13 +84,15 @@
   // Checks whether the given offset from the current position is before
   // the end of the string.
   virtual void CheckPosition(intptr_t cp_offset, BlockLabel* on_outside_input);
-  virtual bool CheckSpecialCharacterClass(
-      uint16_t type, BlockLabel* on_no_match);
+  virtual bool CheckSpecialCharacterClass(uint16_t type,
+                                          BlockLabel* on_no_match);
   virtual void Fail();
   virtual void IfRegisterGE(intptr_t reg,
-                            intptr_t comparand, BlockLabel* if_ge);
+                            intptr_t comparand,
+                            BlockLabel* if_ge);
   virtual void IfRegisterLT(intptr_t reg,
-                            intptr_t comparand, BlockLabel* if_lt);
+                            intptr_t comparand,
+                            BlockLabel* if_lt);
   virtual void IfRegisterEqPos(intptr_t reg, BlockLabel* if_eq);
   virtual IrregexpImplementation Implementation();
   virtual void GoTo(BlockLabel* to);
@@ -149,44 +152,48 @@
   struct InstanceCallDescriptor {
     // Standard (i.e. most non-Smi) functions.
     explicit InstanceCallDescriptor(const String& name)
-      : name(name),
-        token_kind(Token::kILLEGAL),
-        checked_argument_count(1) { }
+        : name(name), token_kind(Token::kILLEGAL), checked_argument_count(1) {}
 
     InstanceCallDescriptor(const String& name,
                            Token::Kind token_kind,
                            intptr_t checked_argument_count)
-      : name(name),
-        token_kind(token_kind),
-        checked_argument_count(checked_argument_count) { }
+        : name(name),
+          token_kind(token_kind),
+          checked_argument_count(checked_argument_count) {}
 
     // Special cases for Smi and indexing functions.
     static InstanceCallDescriptor FromToken(Token::Kind token_kind) {
       switch (token_kind) {
-        case Token::kEQ: return InstanceCallDescriptor(
-                  Symbols::EqualOperator(), token_kind, 2);
-        case Token::kADD: return InstanceCallDescriptor(
-                Symbols::Plus(), token_kind, 2);
-        case Token::kSUB: return InstanceCallDescriptor(
-                Symbols::Minus(), token_kind, 2);
-        case Token::kBIT_OR: return InstanceCallDescriptor(
-                Symbols::BitOr(), token_kind, 2);
-        case Token::kBIT_AND: return InstanceCallDescriptor(
-                Symbols::BitAnd(), token_kind, 2);
-        case Token::kLT: return InstanceCallDescriptor(
-                Symbols::LAngleBracket(), token_kind, 2);
-        case Token::kLTE: return InstanceCallDescriptor(
-                Symbols::LessEqualOperator(), token_kind, 2);
-        case Token::kGT: return InstanceCallDescriptor(
-                Symbols::RAngleBracket(), token_kind, 2);
-        case Token::kGTE: return InstanceCallDescriptor(
-                Symbols::GreaterEqualOperator(), token_kind, 2);
-        case Token::kNEGATE: return InstanceCallDescriptor(
-                Symbols::UnaryMinus(), token_kind, 1);
-        case Token::kINDEX: return InstanceCallDescriptor(
-                Symbols::IndexToken(), token_kind, 2);
-        case Token::kASSIGN_INDEX: return InstanceCallDescriptor(
-                Symbols::AssignIndexToken(), token_kind, 2);
+        case Token::kEQ:
+          return InstanceCallDescriptor(Symbols::EqualOperator(), token_kind,
+                                        2);
+        case Token::kADD:
+          return InstanceCallDescriptor(Symbols::Plus(), token_kind, 2);
+        case Token::kSUB:
+          return InstanceCallDescriptor(Symbols::Minus(), token_kind, 2);
+        case Token::kBIT_OR:
+          return InstanceCallDescriptor(Symbols::BitOr(), token_kind, 2);
+        case Token::kBIT_AND:
+          return InstanceCallDescriptor(Symbols::BitAnd(), token_kind, 2);
+        case Token::kLT:
+          return InstanceCallDescriptor(Symbols::LAngleBracket(), token_kind,
+                                        2);
+        case Token::kLTE:
+          return InstanceCallDescriptor(Symbols::LessEqualOperator(),
+                                        token_kind, 2);
+        case Token::kGT:
+          return InstanceCallDescriptor(Symbols::RAngleBracket(), token_kind,
+                                        2);
+        case Token::kGTE:
+          return InstanceCallDescriptor(Symbols::GreaterEqualOperator(),
+                                        token_kind, 2);
+        case Token::kNEGATE:
+          return InstanceCallDescriptor(Symbols::UnaryMinus(), token_kind, 1);
+        case Token::kINDEX:
+          return InstanceCallDescriptor(Symbols::IndexToken(), token_kind, 2);
+        case Token::kASSIGN_INDEX:
+          return InstanceCallDescriptor(Symbols::AssignIndexToken(), token_kind,
+                                        2);
         default:
           UNREACHABLE();
       }
@@ -294,9 +301,7 @@
   intptr_t GetNextLocalIndex();
 
   // We never have any copied parameters.
-  intptr_t num_copied_params() const {
-    return 0;
-  }
+  intptr_t num_copied_params() const { return 0; }
 
   // Return the position register at the specified index, creating it if
   // necessary. Note that the number of such registers can exceed the amount
@@ -336,7 +341,7 @@
   // A utility class tracking ids of various objects such as blocks, temps, etc.
   class IdAllocator : public ValueObject {
    public:
-    IdAllocator() : next_id(0) { }
+    IdAllocator() : next_id(0) {}
 
     intptr_t Count() const { return next_id; }
     intptr_t Alloc(intptr_t count = 1) {
@@ -432,4 +437,4 @@
 
 }  // namespace dart
 
-#endif  // VM_REGEXP_ASSEMBLER_IR_H_
+#endif  // RUNTIME_VM_REGEXP_ASSEMBLER_IR_H_
diff --git a/runtime/vm/regexp_ast.cc b/runtime/vm/regexp_ast.cc
index 9296170..7e0cbc7 100644
--- a/runtime/vm/regexp_ast.cc
+++ b/runtime/vm/regexp_ast.cc
@@ -9,25 +9,21 @@
 
 namespace dart {
 
-#define MAKE_ACCEPT(Name)                                            \
-  void* RegExp##Name::Accept(RegExpVisitor* visitor, void* data) {   \
-    return visitor->Visit##Name(this, data);                         \
+#define MAKE_ACCEPT(Name)                                                      \
+  void* RegExp##Name::Accept(RegExpVisitor* visitor, void* data) {             \
+    return visitor->Visit##Name(this, data);                                   \
   }
 FOR_EACH_REG_EXP_TREE_TYPE(MAKE_ACCEPT)
 #undef MAKE_ACCEPT
 
-#define MAKE_TYPE_CASE(Name)                                         \
-  RegExp##Name* RegExpTree::As##Name() {                             \
-    return NULL;                                                     \
-  }                                                                  \
+#define MAKE_TYPE_CASE(Name)                                                   \
+  RegExp##Name* RegExpTree::As##Name() { return NULL; }                        \
   bool RegExpTree::Is##Name() const { return false; }
 FOR_EACH_REG_EXP_TREE_TYPE(MAKE_TYPE_CASE)
 #undef MAKE_TYPE_CASE
 
-#define MAKE_TYPE_CASE(Name)                                        \
-  RegExp##Name* RegExp##Name::As##Name() {                          \
-    return this;                                                    \
-  }                                                                 \
+#define MAKE_TYPE_CASE(Name)                                                   \
+  RegExp##Name* RegExp##Name::As##Name() { return this; }                      \
   bool RegExp##Name::Is##Name() const { return true; }
 FOR_EACH_REG_EXP_TREE_TYPE(MAKE_TYPE_CASE)
 #undef MAKE_TYPE_CASE
@@ -81,8 +77,12 @@
   ZoneGrowableArray<RegExpTree*>* nodes = this->nodes();
   for (intptr_t i = 0; i < nodes->length(); i++) {
     RegExpTree* node = nodes->At(i);
-    if (node->IsAnchoredAtStart()) { return true; }
-    if (node->max_match() > 0) { return false; }
+    if (node->IsAnchoredAtStart()) {
+      return true;
+    }
+    if (node->max_match() > 0) {
+      return false;
+    }
   }
   return false;
 }
@@ -92,8 +92,12 @@
   ZoneGrowableArray<RegExpTree*>* nodes = this->nodes();
   for (intptr_t i = nodes->length() - 1; i >= 0; i--) {
     RegExpTree* node = nodes->At(i);
-    if (node->IsAnchoredAtEnd()) { return true; }
-    if (node->max_match() > 0) { return false; }
+    if (node->IsAnchoredAtEnd()) {
+      return true;
+    }
+    if (node->max_match() > 0) {
+      return false;
+    }
   }
   return false;
 }
@@ -102,8 +106,7 @@
 bool RegExpDisjunction::IsAnchoredAtStart() const {
   ZoneGrowableArray<RegExpTree*>* alternatives = this->alternatives();
   for (intptr_t i = 0; i < alternatives->length(); i++) {
-    if (!alternatives->At(i)->IsAnchoredAtStart())
-      return false;
+    if (!alternatives->At(i)->IsAnchoredAtStart()) return false;
   }
   return true;
 }
@@ -112,8 +115,7 @@
 bool RegExpDisjunction::IsAnchoredAtEnd() const {
   ZoneGrowableArray<RegExpTree*>* alternatives = this->alternatives();
   for (intptr_t i = 0; i < alternatives->length(); i++) {
-    if (!alternatives->At(i)->IsAnchoredAtEnd())
-      return false;
+    if (!alternatives->At(i)->IsAnchoredAtEnd()) return false;
   }
   return true;
 }
@@ -142,8 +144,7 @@
 class RegExpUnparser : public RegExpVisitor {
  public:
   void VisitCharacterRange(CharacterRange that);
-#define MAKE_CASE(Name) virtual void* Visit##Name(RegExp##Name*,          \
-                                                  void* data);
+#define MAKE_CASE(Name) virtual void* Visit##Name(RegExp##Name*, void* data);
   FOR_EACH_REG_EXP_TREE_TYPE(MAKE_CASE)
 #undef MAKE_CASE
 };
@@ -151,7 +152,7 @@
 
 void* RegExpUnparser::VisitDisjunction(RegExpDisjunction* that, void* data) {
   OS::Print("(|");
-  for (intptr_t i = 0; i <  that->alternatives()->length(); i++) {
+  for (intptr_t i = 0; i < that->alternatives()->length(); i++) {
     OS::Print(" ");
     (*that->alternatives())[i]->Accept(this, data);
   }
@@ -180,7 +181,6 @@
 }
 
 
-
 void* RegExpUnparser::VisitCharacterClass(RegExpCharacterClass* that,
                                           void* data) {
   if (that->is_negated()) OS::Print("^");
@@ -207,7 +207,7 @@
       break;
     case RegExpAssertion::END_OF_LINE:
       OS::Print("@$l");
-       break;
+      break;
     case RegExpAssertion::BOUNDARY:
       OS::Print("@b");
       break;
@@ -275,8 +275,7 @@
 }
 
 
-void* RegExpUnparser::VisitBackReference(RegExpBackReference* that,
-                                         void*) {
+void* RegExpUnparser::VisitBackReference(RegExpBackReference* that, void*) {
   OS::Print("(<- %" Pd ")", that->index());
   return NULL;
 }
diff --git a/runtime/vm/regexp_ast.h b/runtime/vm/regexp_ast.h
index 2be61ec..3d5601a 100644
--- a/runtime/vm/regexp_ast.h
+++ b/runtime/vm/regexp_ast.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_REGEXP_AST_H_
-#define VM_REGEXP_AST_H_
+#ifndef RUNTIME_VM_REGEXP_AST_H_
+#define RUNTIME_VM_REGEXP_AST_H_
 
 #include "platform/globals.h"
 #include "platform/utils.h"
@@ -28,8 +28,8 @@
 
 class RegExpVisitor : public ValueObject {
  public:
-  virtual ~RegExpVisitor() { }
-#define MAKE_CASE(Name)                                              \
+  virtual ~RegExpVisitor() {}
+#define MAKE_CASE(Name)                                                        \
   virtual void* Visit##Name(RegExp##Name*, void* data) = 0;
   FOR_EACH_REG_EXP_TREE_TYPE(MAKE_CASE)
 #undef MAKE_CASE
@@ -53,8 +53,8 @@
   virtual Interval CaptureRegisters() const { return Interval::Empty(); }
   virtual void AppendToText(RegExpText* text);
   void Print();
-#define MAKE_ASTYPE(Name)                                                  \
-  virtual RegExp##Name* As##Name();                                        \
+#define MAKE_ASTYPE(Name)                                                      \
+  virtual RegExp##Name* As##Name();                                            \
   virtual bool Is##Name() const;
   FOR_EACH_REG_EXP_TREE_TYPE(MAKE_ASTYPE)
 #undef MAKE_ASTYPE
@@ -65,8 +65,7 @@
  public:
   explicit RegExpDisjunction(ZoneGrowableArray<RegExpTree*>* alternatives);
   virtual void* Accept(RegExpVisitor* visitor, void* data);
-  virtual RegExpNode* ToNode(RegExpCompiler* compiler,
-                             RegExpNode* on_success);
+  virtual RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success);
   virtual RegExpDisjunction* AsDisjunction();
   virtual Interval CaptureRegisters() const;
   virtual bool IsDisjunction() const;
@@ -75,6 +74,7 @@
   virtual intptr_t min_match() const { return min_match_; }
   virtual intptr_t max_match() const { return max_match_; }
   ZoneGrowableArray<RegExpTree*>* alternatives() const { return alternatives_; }
+
  private:
   ZoneGrowableArray<RegExpTree*>* alternatives_;
   intptr_t min_match_;
@@ -86,8 +86,7 @@
  public:
   explicit RegExpAlternative(ZoneGrowableArray<RegExpTree*>* nodes);
   virtual void* Accept(RegExpVisitor* visitor, void* data);
-  virtual RegExpNode* ToNode(RegExpCompiler* compiler,
-                             RegExpNode* on_success);
+  virtual RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success);
   virtual RegExpAlternative* AsAlternative();
   virtual Interval CaptureRegisters() const;
   virtual bool IsAlternative() const;
@@ -96,6 +95,7 @@
   virtual intptr_t min_match() const { return min_match_; }
   virtual intptr_t max_match() const { return max_match_; }
   ZoneGrowableArray<RegExpTree*>* nodes() const { return nodes_; }
+
  private:
   ZoneGrowableArray<RegExpTree*>* nodes_;
   intptr_t min_match_;
@@ -113,10 +113,9 @@
     BOUNDARY,
     NON_BOUNDARY
   };
-  explicit RegExpAssertion(AssertionType type) : assertion_type_(type) { }
+  explicit RegExpAssertion(AssertionType type) : assertion_type_(type) {}
   virtual void* Accept(RegExpVisitor* visitor, void* data);
-  virtual RegExpNode* ToNode(RegExpCompiler* compiler,
-                             RegExpNode* on_success);
+  virtual RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success);
   virtual RegExpAssertion* AsAssertion();
   virtual bool IsAssertion() const;
   virtual bool IsAnchoredAtStart() const;
@@ -124,6 +123,7 @@
   virtual intptr_t min_match() const { return 0; }
   virtual intptr_t max_match() const { return 0; }
   AssertionType assertion_type() const { return assertion_type_; }
+
  private:
   AssertionType assertion_type_;
 };
@@ -132,11 +132,9 @@
 class CharacterSet : public ValueObject {
  public:
   explicit CharacterSet(uint16_t standard_set_type)
-      : ranges_(NULL),
-        standard_set_type_(standard_set_type) {}
+      : ranges_(NULL), standard_set_type_(standard_set_type) {}
   explicit CharacterSet(ZoneGrowableArray<CharacterRange>* ranges)
-      : ranges_(ranges),
-        standard_set_type_(0) {}
+      : ranges_(ranges), standard_set_type_(0) {}
   CharacterSet(const CharacterSet& that)
       : ValueObject(),
         ranges_(that.ranges_),
@@ -148,6 +146,7 @@
   }
   bool is_standard() { return standard_set_type_ != 0; }
   void Canonicalize();
+
  private:
   ZoneGrowableArray<CharacterRange>* ranges_;
   // If non-zero, the value represents a standard set (e.g., all whitespace
@@ -160,14 +159,11 @@
  public:
   RegExpCharacterClass(ZoneGrowableArray<CharacterRange>* ranges,
                        bool is_negated)
-      : set_(ranges),
-        is_negated_(is_negated) { }
+      : set_(ranges), is_negated_(is_negated) {}
   explicit RegExpCharacterClass(uint16_t type)
-      : set_(type),
-        is_negated_(false) { }
+      : set_(type), is_negated_(false) {}
   virtual void* Accept(RegExpVisitor* visitor, void* data);
-  virtual RegExpNode* ToNode(RegExpCompiler* compiler,
-                             RegExpNode* on_success);
+  virtual RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success);
   virtual RegExpCharacterClass* AsCharacterClass();
   virtual bool IsCharacterClass() const;
   virtual bool IsTextElement() const { return true; }
@@ -190,9 +186,7 @@
   // . : non-unicode non-newline
   // * : All characters
   uint16_t standard_type() const { return set_.standard_set_type(); }
-  ZoneGrowableArray<CharacterRange>* ranges() {
-    return set_.ranges();
-  }
+  ZoneGrowableArray<CharacterRange>* ranges() { return set_.ranges(); }
   bool is_negated() const { return is_negated_; }
 
  private:
@@ -203,10 +197,9 @@
 
 class RegExpAtom : public RegExpTree {
  public:
-  explicit RegExpAtom(ZoneGrowableArray<uint16_t>* data) : data_(data) { }
+  explicit RegExpAtom(ZoneGrowableArray<uint16_t>* data) : data_(data) {}
   virtual void* Accept(RegExpVisitor* visitor, void* data);
-  virtual RegExpNode* ToNode(RegExpCompiler* compiler,
-                             RegExpNode* on_success);
+  virtual RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success);
   virtual RegExpAtom* AsAtom();
   virtual bool IsAtom() const;
   virtual bool IsTextElement() const { return true; }
@@ -215,6 +208,7 @@
   virtual void AppendToText(RegExpText* text);
   ZoneGrowableArray<uint16_t>* data() const { return data_; }
   intptr_t length() const { return data_->length(); }
+
  private:
   ZoneGrowableArray<uint16_t>* data_;
 };
@@ -224,19 +218,19 @@
  public:
   RegExpText() : elements_(2), length_(0) {}
   virtual void* Accept(RegExpVisitor* visitor, void* data);
-  virtual RegExpNode* ToNode(RegExpCompiler* compiler,
-                             RegExpNode* on_success);
+  virtual RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success);
   virtual RegExpText* AsText();
   virtual bool IsText() const;
   virtual bool IsTextElement() const { return true; }
   virtual intptr_t min_match() const { return length_; }
   virtual intptr_t max_match() const { return length_; }
   virtual void AppendToText(RegExpText* text);
-  void AddElement(TextElement elm)  {
+  void AddElement(TextElement elm) {
     elements_.Add(elm);
     length_ += elm.length();
   }
   GrowableArray<TextElement>* elements() { return &elements_; }
+
  private:
   GrowableArray<TextElement> elements_;
   intptr_t length_;
@@ -246,8 +240,10 @@
 class RegExpQuantifier : public RegExpTree {
  public:
   enum QuantifierType { GREEDY, NON_GREEDY, POSSESSIVE };
-  RegExpQuantifier(intptr_t min, intptr_t max,
-                   QuantifierType type, RegExpTree* body)
+  RegExpQuantifier(intptr_t min,
+                   intptr_t max,
+                   QuantifierType type,
+                   RegExpTree* body)
       : body_(body),
         min_(min),
         max_(max),
@@ -260,8 +256,7 @@
     }
   }
   virtual void* Accept(RegExpVisitor* visitor, void* data);
-  virtual RegExpNode* ToNode(RegExpCompiler* compiler,
-                             RegExpNode* on_success);
+  virtual RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success);
   static RegExpNode* ToNode(intptr_t min,
                             intptr_t max,
                             bool is_greedy,
@@ -294,10 +289,9 @@
 class RegExpCapture : public RegExpTree {
  public:
   explicit RegExpCapture(RegExpTree* body, intptr_t index)
-      : body_(body), index_(index) { }
+      : body_(body), index_(index) {}
   virtual void* Accept(RegExpVisitor* visitor, void* data);
-  virtual RegExpNode* ToNode(RegExpCompiler* compiler,
-                             RegExpNode* on_success);
+  virtual RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success);
   static RegExpNode* ToNode(RegExpTree* body,
                             intptr_t index,
                             RegExpCompiler* compiler,
@@ -329,11 +323,10 @@
       : body_(body),
         is_positive_(is_positive),
         capture_count_(capture_count),
-        capture_from_(capture_from) { }
+        capture_from_(capture_from) {}
 
   virtual void* Accept(RegExpVisitor* visitor, void* data);
-  virtual RegExpNode* ToNode(RegExpCompiler* compiler,
-                             RegExpNode* on_success);
+  virtual RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success);
   virtual RegExpLookahead* AsLookahead();
   virtual Interval CaptureRegisters() const;
   virtual bool IsLookahead() const;
@@ -355,17 +348,16 @@
 
 class RegExpBackReference : public RegExpTree {
  public:
-  explicit RegExpBackReference(RegExpCapture* capture)
-      : capture_(capture) { }
+  explicit RegExpBackReference(RegExpCapture* capture) : capture_(capture) {}
   virtual void* Accept(RegExpVisitor* visitor, void* data);
-  virtual RegExpNode* ToNode(RegExpCompiler* compiler,
-                             RegExpNode* on_success);
+  virtual RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success);
   virtual RegExpBackReference* AsBackReference();
   virtual bool IsBackReference() const;
   virtual intptr_t min_match() const { return 0; }
   virtual intptr_t max_match() const { return capture_->max_match(); }
   intptr_t index() const { return capture_->index(); }
   RegExpCapture* capture() const { return capture_; }
+
  private:
   RegExpCapture* capture_;
 };
@@ -373,10 +365,9 @@
 
 class RegExpEmpty : public RegExpTree {
  public:
-  RegExpEmpty() { }
+  RegExpEmpty() {}
   virtual void* Accept(RegExpVisitor* visitor, void* data);
-  virtual RegExpNode* ToNode(RegExpCompiler* compiler,
-                             RegExpNode* on_success);
+  virtual RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success);
   virtual RegExpEmpty* AsEmpty();
   virtual bool IsEmpty() const;
   virtual intptr_t min_match() const { return 0; }
@@ -389,4 +380,4 @@
 
 }  // namespace dart
 
-#endif  // VM_REGEXP_AST_H_
+#endif  // RUNTIME_VM_REGEXP_AST_H_
diff --git a/runtime/vm/regexp_bytecodes.h b/runtime/vm/regexp_bytecodes.h
index 8d1cddb..c2ef82b 100644
--- a/runtime/vm/regexp_bytecodes.h
+++ b/runtime/vm/regexp_bytecodes.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_REGEXP_BYTECODES_H_
-#define VM_REGEXP_BYTECODES_H_
+#ifndef RUNTIME_VM_REGEXP_BYTECODES_H_
+#define RUNTIME_VM_REGEXP_BYTECODES_H_
 
 namespace dart {
 
@@ -14,6 +14,7 @@
 const unsigned int MAX_FIRST_ARG = 0x7fffffu;
 const int BYTECODE_SHIFT = 8;
 
+// clang-format off
 #define BYTECODE_ITERATOR(V)                                                   \
 V(BREAK,              0, 4)   /* bc8                                        */ \
 V(PUSH_CP,            1, 4)   /* bc8 pad24                                  */ \
@@ -64,16 +65,17 @@
 V(ADVANCE_CP_AND_GOTO, 46, 8) /* bc8 offset24 addr32                        */ \
 V(SET_CURRENT_POSITION_FROM_END, 47, 4) /* bc8 idx24                        */
 
-#define DECLARE_BYTECODES(name, code, length) \
-  static const int BC_##name = code;
+// clang-format on
+
+#define DECLARE_BYTECODES(name, code, length) static const int BC_##name = code;
 BYTECODE_ITERATOR(DECLARE_BYTECODES)
 #undef DECLARE_BYTECODES
 
-#define DECLARE_BYTECODE_LENGTH(name, code, length) \
+#define DECLARE_BYTECODE_LENGTH(name, code, length)                            \
   static const int BC_##name##_LENGTH = length;
 BYTECODE_ITERATOR(DECLARE_BYTECODE_LENGTH)
 #undef DECLARE_BYTECODE_LENGTH
 
 }  // namespace dart
 
-#endif  // VM_REGEXP_BYTECODES_H_
+#endif  // RUNTIME_VM_REGEXP_BYTECODES_H_
diff --git a/runtime/vm/regexp_interpreter.cc b/runtime/vm/regexp_interpreter.cc
index b036ec8..956d4ba 100644
--- a/runtime/vm/regexp_interpreter.cc
+++ b/runtime/vm/regexp_interpreter.cc
@@ -19,7 +19,7 @@
 
 typedef unibrow::Mapping<unibrow::Ecma262Canonicalize> Canonicalize;
 
-template<typename Char>
+template <typename Char>
 static bool BackRefMatchesNoCase(Canonicalize* interp_canonicalize,
                                  intptr_t from,
                                  intptr_t current,
@@ -36,8 +36,8 @@
     int32_t old_char = subject.CharAt(from++);
     int32_t new_char = subject.CharAt(current++);
     if (old_char == new_char) continue;
-    int32_t old_string[1] = { old_char };
-    int32_t new_string[1] = { new_char };
+    int32_t old_string[1] = {old_char};
+    int32_t new_string[1] = {new_char};
     interp_canonicalize->get(old_char, '\0', old_string);
     interp_canonicalize->get(new_char, '\0', new_string);
     if (old_string[0] != new_string[0]) {
@@ -82,16 +82,11 @@
   if (FLAG_trace_regexp_bytecodes) {
     bool printable = (current_char < 127 && current_char >= 32);
     const char* format =
-        printable ?
-        "pc = %02x, sp = %d, curpos = %d, curchar = %08x (%c), bc = %s" :
-        "pc = %02x, sp = %d, curpos = %d, curchar = %08x .%c., bc = %s";
-    OS::Print(format,
-              pc - code_base,
-              stack_depth,
-              current_position,
-              current_char,
-              printable ? current_char : '.',
-              bytecode_name);
+        printable
+            ? "pc = %02x, sp = %d, curpos = %d, curchar = %08x (%c), bc = %s"
+            : "pc = %02x, sp = %d, curpos = %d, curchar = %08x .%c., bc = %s";
+    OS::Print(format, pc - code_base, stack_depth, current_position,
+              current_char, printable ? current_char : '.', bytecode_name);
     for (int i = 0; i < bytecode_length; i++) {
       OS::Print(", %02x", pc[i]);
     }
@@ -109,30 +104,25 @@
 }
 
 
-#define BYTECODE(name)                                                      \
-  case BC_##name:                                                           \
-    TraceInterpreter(code_base,                                             \
-                     pc,                                                    \
-                     static_cast<int>(backtrack_sp - backtrack_stack_base), \
-                     current,                                               \
-                     current_char,                                          \
-                     BC_##name##_LENGTH,                                    \
-                     #name);
+#define BYTECODE(name)                                                         \
+  case BC_##name:                                                              \
+    TraceInterpreter(code_base, pc,                                            \
+                     static_cast<int>(backtrack_sp - backtrack_stack_base),    \
+                     current, current_char, BC_##name##_LENGTH, #name);
 #else
-#define BYTECODE(name)                                                      \
-  case BC_##name:
+#define BYTECODE(name) case BC_##name:
 #endif
 
 
 static int32_t Load32Aligned(const uint8_t* pc) {
   ASSERT((reinterpret_cast<intptr_t>(pc) & 3) == 0);
-  return *reinterpret_cast<const int32_t *>(pc);
+  return *reinterpret_cast<const int32_t*>(pc);
 }
 
 
 static int32_t Load16Aligned(const uint8_t* pc) {
   ASSERT((reinterpret_cast<intptr_t>(pc) & 1) == 0);
-  return *reinterpret_cast<const uint16_t *>(pc);
+  return *reinterpret_cast<const uint16_t*>(pc);
 }
 
 
@@ -190,97 +180,98 @@
     int32_t insn = Load32Aligned(pc);
     switch (insn & BYTECODE_MASK) {
       BYTECODE(BREAK)
-        UNREACHABLE();
-        return IrregexpInterpreter::RE_FAILURE;
+      UNREACHABLE();
+      return IrregexpInterpreter::RE_FAILURE;
       BYTECODE(PUSH_CP)
-        if (--backtrack_stack_space < 0) {
-          return IrregexpInterpreter::RE_EXCEPTION;
-        }
-        *backtrack_sp++ = current;
-        pc += BC_PUSH_CP_LENGTH;
-        break;
+      if (--backtrack_stack_space < 0) {
+        return IrregexpInterpreter::RE_EXCEPTION;
+      }
+      *backtrack_sp++ = current;
+      pc += BC_PUSH_CP_LENGTH;
+      break;
       BYTECODE(PUSH_BT)
-        if (--backtrack_stack_space < 0) {
-          return IrregexpInterpreter::RE_EXCEPTION;
-        }
-        *backtrack_sp++ = Load32Aligned(pc + 4);
-        pc += BC_PUSH_BT_LENGTH;
-        break;
+      if (--backtrack_stack_space < 0) {
+        return IrregexpInterpreter::RE_EXCEPTION;
+      }
+      *backtrack_sp++ = Load32Aligned(pc + 4);
+      pc += BC_PUSH_BT_LENGTH;
+      break;
       BYTECODE(PUSH_REGISTER)
-        if (--backtrack_stack_space < 0) {
-          return IrregexpInterpreter::RE_EXCEPTION;
-        }
-        *backtrack_sp++ = registers[insn >> BYTECODE_SHIFT];
-        pc += BC_PUSH_REGISTER_LENGTH;
-        break;
+      if (--backtrack_stack_space < 0) {
+        return IrregexpInterpreter::RE_EXCEPTION;
+      }
+      *backtrack_sp++ = registers[insn >> BYTECODE_SHIFT];
+      pc += BC_PUSH_REGISTER_LENGTH;
+      break;
       BYTECODE(SET_REGISTER)
-        registers[insn >> BYTECODE_SHIFT] = Load32Aligned(pc + 4);
-        pc += BC_SET_REGISTER_LENGTH;
-        break;
+      registers[insn >> BYTECODE_SHIFT] = Load32Aligned(pc + 4);
+      pc += BC_SET_REGISTER_LENGTH;
+      break;
       BYTECODE(ADVANCE_REGISTER)
-        registers[insn >> BYTECODE_SHIFT] += Load32Aligned(pc + 4);
-        pc += BC_ADVANCE_REGISTER_LENGTH;
-        break;
+      registers[insn >> BYTECODE_SHIFT] += Load32Aligned(pc + 4);
+      pc += BC_ADVANCE_REGISTER_LENGTH;
+      break;
       BYTECODE(SET_REGISTER_TO_CP)
-        registers[insn >> BYTECODE_SHIFT] = current + Load32Aligned(pc + 4);
-        pc += BC_SET_REGISTER_TO_CP_LENGTH;
-        break;
+      registers[insn >> BYTECODE_SHIFT] = current + Load32Aligned(pc + 4);
+      pc += BC_SET_REGISTER_TO_CP_LENGTH;
+      break;
       BYTECODE(SET_CP_TO_REGISTER)
-        current = registers[insn >> BYTECODE_SHIFT];
-        pc += BC_SET_CP_TO_REGISTER_LENGTH;
-        break;
+      current = registers[insn >> BYTECODE_SHIFT];
+      pc += BC_SET_CP_TO_REGISTER_LENGTH;
+      break;
       BYTECODE(SET_REGISTER_TO_SP)
-        registers[insn >> BYTECODE_SHIFT] =
-            static_cast<int>(backtrack_sp - backtrack_stack_base);
-        pc += BC_SET_REGISTER_TO_SP_LENGTH;
-        break;
+      registers[insn >> BYTECODE_SHIFT] =
+          static_cast<int>(backtrack_sp - backtrack_stack_base);
+      pc += BC_SET_REGISTER_TO_SP_LENGTH;
+      break;
       BYTECODE(SET_SP_TO_REGISTER)
-        backtrack_sp = backtrack_stack_base + registers[insn >> BYTECODE_SHIFT];
-        backtrack_stack_space = backtrack_stack.max_size() -
-            static_cast<int>(backtrack_sp - backtrack_stack_base);
-        pc += BC_SET_SP_TO_REGISTER_LENGTH;
-        break;
+      backtrack_sp = backtrack_stack_base + registers[insn >> BYTECODE_SHIFT];
+      backtrack_stack_space =
+          backtrack_stack.max_size() -
+          static_cast<int>(backtrack_sp - backtrack_stack_base);
+      pc += BC_SET_SP_TO_REGISTER_LENGTH;
+      break;
       BYTECODE(POP_CP)
-        backtrack_stack_space++;
-        --backtrack_sp;
-        current = *backtrack_sp;
-        pc += BC_POP_CP_LENGTH;
-        break;
+      backtrack_stack_space++;
+      --backtrack_sp;
+      current = *backtrack_sp;
+      pc += BC_POP_CP_LENGTH;
+      break;
       BYTECODE(POP_BT)
-        backtrack_stack_space++;
-        --backtrack_sp;
-        pc = code_base + *backtrack_sp;
-        break;
+      backtrack_stack_space++;
+      --backtrack_sp;
+      pc = code_base + *backtrack_sp;
+      break;
       BYTECODE(POP_REGISTER)
-        backtrack_stack_space++;
-        --backtrack_sp;
-        registers[insn >> BYTECODE_SHIFT] = *backtrack_sp;
-        pc += BC_POP_REGISTER_LENGTH;
-        break;
+      backtrack_stack_space++;
+      --backtrack_sp;
+      registers[insn >> BYTECODE_SHIFT] = *backtrack_sp;
+      pc += BC_POP_REGISTER_LENGTH;
+      break;
       BYTECODE(FAIL)
-        return IrregexpInterpreter::RE_FAILURE;
+      return IrregexpInterpreter::RE_FAILURE;
       BYTECODE(SUCCEED)
-        return IrregexpInterpreter::RE_SUCCESS;
+      return IrregexpInterpreter::RE_SUCCESS;
       BYTECODE(ADVANCE_CP)
-        current += insn >> BYTECODE_SHIFT;
-        pc += BC_ADVANCE_CP_LENGTH;
-        break;
+      current += insn >> BYTECODE_SHIFT;
+      pc += BC_ADVANCE_CP_LENGTH;
+      break;
       BYTECODE(GOTO)
-        pc = code_base + Load32Aligned(pc + 4);
-        break;
+      pc = code_base + Load32Aligned(pc + 4);
+      break;
       BYTECODE(ADVANCE_CP_AND_GOTO)
-        current += insn >> BYTECODE_SHIFT;
-        pc = code_base + Load32Aligned(pc + 4);
-        break;
+      current += insn >> BYTECODE_SHIFT;
+      pc = code_base + Load32Aligned(pc + 4);
+      break;
       BYTECODE(CHECK_GREEDY)
-        if (current == backtrack_sp[-1]) {
-          backtrack_sp--;
-          backtrack_stack_space++;
-          pc = code_base + Load32Aligned(pc + 4);
-        } else {
-          pc += BC_CHECK_GREEDY_LENGTH;
-        }
-        break;
+      if (current == backtrack_sp[-1]) {
+        backtrack_sp--;
+        backtrack_stack_space++;
+        pc = code_base + Load32Aligned(pc + 4);
+      } else {
+        pc += BC_CHECK_GREEDY_LENGTH;
+      }
+      break;
       BYTECODE(LOAD_CURRENT_CHAR) {
         int pos = current + (insn >> BYTECODE_SHIFT);
         if (pos >= subject_length) {
@@ -303,8 +294,8 @@
           pc = code_base + Load32Aligned(pc + 4);
         } else {
           Char next = subject.CharAt(pos + 1);
-          current_char = subject.CharAt(pos) |
-                         (next << (kBitsPerByte * sizeof(Char)));
+          current_char =
+              subject.CharAt(pos) | (next << (kBitsPerByte * sizeof(Char)));
           pc += BC_LOAD_2_CURRENT_CHARS_LENGTH;
         }
         break;
@@ -312,8 +303,8 @@
       BYTECODE(LOAD_2_CURRENT_CHARS_UNCHECKED) {
         int pos = current + (insn >> BYTECODE_SHIFT);
         Char next = subject.CharAt(pos + 1);
-        current_char = subject.CharAt(pos) |
-                       (next << (kBitsPerByte * sizeof(Char)));
+        current_char =
+            subject.CharAt(pos) | (next << (kBitsPerByte * sizeof(Char)));
         pc += BC_LOAD_2_CURRENT_CHARS_UNCHECKED_LENGTH;
         break;
       }
@@ -326,9 +317,7 @@
           Char next1 = subject.CharAt(pos + 1);
           Char next2 = subject.CharAt(pos + 2);
           Char next3 = subject.CharAt(pos + 3);
-          current_char = (subject.CharAt(pos) |
-                          (next1 << 8) |
-                          (next2 << 16) |
+          current_char = (subject.CharAt(pos) | (next1 << 8) | (next2 << 16) |
                           (next3 << 24));
           pc += BC_LOAD_4_CURRENT_CHARS_LENGTH;
         }
@@ -340,9 +329,7 @@
         Char next1 = subject.CharAt(pos + 1);
         Char next2 = subject.CharAt(pos + 2);
         Char next3 = subject.CharAt(pos + 3);
-        current_char = (subject.CharAt(pos) |
-                        (next1 << 8) |
-                        (next2 << 16) |
+        current_char = (subject.CharAt(pos) | (next1 << 8) | (next2 << 16) |
                         (next3 << 24));
         pc += BC_LOAD_4_CURRENT_CHARS_UNCHECKED_LENGTH;
         break;
@@ -480,34 +467,34 @@
         break;
       }
       BYTECODE(CHECK_REGISTER_LT)
-        if (registers[insn >> BYTECODE_SHIFT] < Load32Aligned(pc + 4)) {
-          pc = code_base + Load32Aligned(pc + 8);
-        } else {
-          pc += BC_CHECK_REGISTER_LT_LENGTH;
-        }
-        break;
+      if (registers[insn >> BYTECODE_SHIFT] < Load32Aligned(pc + 4)) {
+        pc = code_base + Load32Aligned(pc + 8);
+      } else {
+        pc += BC_CHECK_REGISTER_LT_LENGTH;
+      }
+      break;
       BYTECODE(CHECK_REGISTER_GE)
-        if (registers[insn >> BYTECODE_SHIFT] >= Load32Aligned(pc + 4)) {
-          pc = code_base + Load32Aligned(pc + 8);
-        } else {
-          pc += BC_CHECK_REGISTER_GE_LENGTH;
-        }
-        break;
+      if (registers[insn >> BYTECODE_SHIFT] >= Load32Aligned(pc + 4)) {
+        pc = code_base + Load32Aligned(pc + 8);
+      } else {
+        pc += BC_CHECK_REGISTER_GE_LENGTH;
+      }
+      break;
       BYTECODE(CHECK_REGISTER_EQ_POS)
-        if (registers[insn >> BYTECODE_SHIFT] == current) {
-          pc = code_base + Load32Aligned(pc + 4);
-        } else {
-          pc += BC_CHECK_REGISTER_EQ_POS_LENGTH;
-        }
-        break;
+      if (registers[insn >> BYTECODE_SHIFT] == current) {
+        pc = code_base + Load32Aligned(pc + 4);
+      } else {
+        pc += BC_CHECK_REGISTER_EQ_POS_LENGTH;
+      }
+      break;
       BYTECODE(CHECK_NOT_REGS_EQUAL)
-        if (registers[insn >> BYTECODE_SHIFT] ==
-            registers[Load32Aligned(pc + 4)]) {
-          pc += BC_CHECK_NOT_REGS_EQUAL_LENGTH;
-        } else {
-          pc = code_base + Load32Aligned(pc + 8);
-        }
-        break;
+      if (registers[insn >> BYTECODE_SHIFT] ==
+          registers[Load32Aligned(pc + 4)]) {
+        pc += BC_CHECK_NOT_REGS_EQUAL_LENGTH;
+      } else {
+        pc = code_base + Load32Aligned(pc + 8);
+      }
+      break;
       BYTECODE(CHECK_NOT_BACK_REF) {
         int from = registers[insn >> BYTECODE_SHIFT];
         int len = registers[(insn >> BYTECODE_SHIFT) + 1] - from;
@@ -543,8 +530,8 @@
           pc = code_base + Load32Aligned(pc + 4);
           break;
         } else {
-          if (BackRefMatchesNoCase<Char>(&canonicalize,
-                                         from, current, len, subject)) {
+          if (BackRefMatchesNoCase<Char>(&canonicalize, from, current, len,
+                                         subject)) {
             current += len;
             pc += BC_CHECK_NOT_BACK_REF_NO_CASE_LENGTH;
           } else {
@@ -554,19 +541,19 @@
         break;
       }
       BYTECODE(CHECK_AT_START)
-        if (current == 0) {
-          pc = code_base + Load32Aligned(pc + 4);
-        } else {
-          pc += BC_CHECK_AT_START_LENGTH;
-        }
-        break;
+      if (current == 0) {
+        pc = code_base + Load32Aligned(pc + 4);
+      } else {
+        pc += BC_CHECK_AT_START_LENGTH;
+      }
+      break;
       BYTECODE(CHECK_NOT_AT_START)
-        if (current == 0) {
-          pc += BC_CHECK_NOT_AT_START_LENGTH;
-        } else {
-          pc = code_base + Load32Aligned(pc + 4);
-        }
-        break;
+      if (current == 0) {
+        pc += BC_CHECK_NOT_AT_START_LENGTH;
+      } else {
+        pc = code_base + Load32Aligned(pc + 4);
+      }
+      break;
       BYTECODE(SET_CURRENT_POSITION_FROM_END) {
         int by = static_cast<uint32_t>(insn) >> BYTECODE_SHIFT;
         if (subject_length - current > by) {
@@ -599,19 +586,11 @@
   }
 
   if (subject.IsOneByteString() || subject.IsExternalOneByteString()) {
-    return RawMatch<uint8_t>(code_base,
-                             subject,
-                             registers,
-                             start_position,
-                             previous_char,
-                             zone);
+    return RawMatch<uint8_t>(code_base, subject, registers, start_position,
+                             previous_char, zone);
   } else if (subject.IsTwoByteString() || subject.IsExternalTwoByteString()) {
-    return RawMatch<uint16_t>(code_base,
-                              subject,
-                              registers,
-                              start_position,
-                              previous_char,
-                              zone);
+    return RawMatch<uint16_t>(code_base, subject, registers, start_position,
+                              previous_char, zone);
   } else {
     UNREACHABLE();
     return IrregexpInterpreter::RE_FAILURE;
diff --git a/runtime/vm/regexp_interpreter.h b/runtime/vm/regexp_interpreter.h
index eab89cb..9e4e567 100644
--- a/runtime/vm/regexp_interpreter.h
+++ b/runtime/vm/regexp_interpreter.h
@@ -4,8 +4,8 @@
 
 // A simple interpreter for the Irregexp byte code.
 
-#ifndef VM_REGEXP_INTERPRETER_H_
-#define VM_REGEXP_INTERPRETER_H_
+#ifndef RUNTIME_VM_REGEXP_INTERPRETER_H_
+#define RUNTIME_VM_REGEXP_INTERPRETER_H_
 
 #include "vm/allocation.h"
 #include "vm/object.h"
@@ -15,11 +15,7 @@
 
 class IrregexpInterpreter : public AllStatic {
  public:
-  enum IrregexpResult {
-    RE_FAILURE = 0,
-    RE_SUCCESS = 1,
-    RE_EXCEPTION = -1
-  };
+  enum IrregexpResult { RE_FAILURE = 0, RE_SUCCESS = 1, RE_EXCEPTION = -1 };
 
   static IrregexpResult Match(const TypedData& bytecode,
                               const String& subject,
@@ -30,4 +26,4 @@
 
 }  // namespace dart
 
-#endif  // VM_REGEXP_INTERPRETER_H_
+#endif  // RUNTIME_VM_REGEXP_INTERPRETER_H_
diff --git a/runtime/vm/regexp_parser.cc b/runtime/vm/regexp_parser.cc
index c4d471a..f75b30f 100644
--- a/runtime/vm/regexp_parser.cc
+++ b/runtime/vm/regexp_parser.cc
@@ -21,15 +21,17 @@
       text_(),
       alternatives_()
 #ifdef DEBUG
-    , last_added_(ADD_NONE)
+      ,
+      last_added_(ADD_NONE)
 #endif
-  {}
+{
+}
 
 
 void RegExpBuilder::FlushCharacters() {
   pending_empty_ = false;
   if (characters_ != NULL) {
-    RegExpTree* atom = new(Z) RegExpAtom(characters_);
+    RegExpTree* atom = new (Z) RegExpAtom(characters_);
     characters_ = NULL;
     text_.Add(atom);
     LAST(ADD_ATOM);
@@ -45,7 +47,7 @@
   } else if (num_text == 1) {
     terms_.Add(text_.Last());
   } else {
-    RegExpText* text = new(Z) RegExpText();
+    RegExpText* text = new (Z) RegExpText();
     for (intptr_t i = 0; i < num_text; i++)
       text_[i]->AppendToText(text);
     terms_.Add(text);
@@ -57,7 +59,7 @@
 void RegExpBuilder::AddCharacter(uint16_t c) {
   pending_empty_ = false;
   if (characters_ == NULL) {
-    characters_ = new(Z) ZoneGrowableArray<uint16_t>(4);
+    characters_ = new (Z) ZoneGrowableArray<uint16_t>(4);
   }
   characters_->Add(c);
   LAST(ADD_CHAR);
@@ -107,11 +109,11 @@
     alternative = terms_.Last();
   } else {
     ZoneGrowableArray<RegExpTree*>* terms =
-        new(Z) ZoneGrowableArray<RegExpTree*>();
+        new (Z) ZoneGrowableArray<RegExpTree*>();
     for (intptr_t i = 0; i < terms_.length(); i++) {
       terms->Add(terms_[i]);
     }
-    alternative = new(Z) RegExpAlternative(terms);
+    alternative = new (Z) RegExpAlternative(terms);
   }
   alternatives_.Add(alternative);
   terms_.Clear();
@@ -129,11 +131,11 @@
     return alternatives_.Last();
   }
   ZoneGrowableArray<RegExpTree*>* alternatives =
-      new(Z) ZoneGrowableArray<RegExpTree*>();
+      new (Z) ZoneGrowableArray<RegExpTree*>();
   for (intptr_t i = 0; i < alternatives_.length(); i++) {
     alternatives->Add(alternatives_[i]);
   }
-  return new(Z) RegExpDisjunction(alternatives);
+  return new (Z) RegExpDisjunction(alternatives);
 }
 
 
@@ -150,23 +152,23 @@
     DEBUG_ASSERT(last_added_ == ADD_CHAR);
     // Last atom was character.
 
-    ZoneGrowableArray<uint16_t> *char_vector =
-        new(Z) ZoneGrowableArray<uint16_t>();
+    ZoneGrowableArray<uint16_t>* char_vector =
+        new (Z) ZoneGrowableArray<uint16_t>();
     char_vector->AddArray(*characters_);
     intptr_t num_chars = char_vector->length();
     if (num_chars > 1) {
-      ZoneGrowableArray<uint16_t> *prefix =
-          new(Z) ZoneGrowableArray<uint16_t>();
+      ZoneGrowableArray<uint16_t>* prefix =
+          new (Z) ZoneGrowableArray<uint16_t>();
       for (intptr_t i = 0; i < num_chars - 1; i++) {
         prefix->Add(char_vector->At(i));
       }
-      text_.Add(new(Z) RegExpAtom(prefix));
-      ZoneGrowableArray<uint16_t> *tail = new(Z) ZoneGrowableArray<uint16_t>();
+      text_.Add(new (Z) RegExpAtom(prefix));
+      ZoneGrowableArray<uint16_t>* tail = new (Z) ZoneGrowableArray<uint16_t>();
       tail->Add(char_vector->At(num_chars - 1));
       char_vector = tail;
     }
     characters_ = NULL;
-    atom = new(Z) RegExpAtom(char_vector);
+    atom = new (Z) RegExpAtom(char_vector);
     FlushText();
   } else if (text_.length() > 0) {
     DEBUG_ASSERT(last_added_ == ADD_ATOM);
@@ -189,16 +191,14 @@
     UNREACHABLE();
     return;
   }
-  terms_.Add(new(Z) RegExpQuantifier(min, max, quantifier_type, atom));
+  terms_.Add(new (Z) RegExpQuantifier(min, max, quantifier_type, atom));
   LAST(ADD_TERM);
 }
 
 // ----------------------------------------------------------------------------
 // Implementation of Parser
 
-RegExpParser::RegExpParser(const String& in,
-                           String* error,
-                           bool multiline)
+RegExpParser::RegExpParser(const String& in, String* error, bool multiline)
     : zone_(Thread::Current()->zone()),
       error_(error),
       captures_(NULL),
@@ -216,7 +216,7 @@
 }
 
 
-bool RegExpParser::ParseFunction(ParsedFunction *parsed_function) {
+bool RegExpParser::ParseFunction(ParsedFunction* parsed_function) {
   VMTagScope tagScope(parsed_function->thread(),
                       VMTag::kCompileParseRegExpTagId);
   Zone* zone = parsed_function->zone();
@@ -225,7 +225,7 @@
   const String& pattern = String::Handle(regexp.pattern());
   const bool multiline = regexp.is_multi_line();
 
-  RegExpCompileData* compile_data = new(zone) RegExpCompileData();
+  RegExpCompileData* compile_data = new (zone) RegExpCompileData();
   if (!RegExpParser::ParseRegExp(pattern, multiline, compile_data)) {
     // Parsing failures are handled in the RegExp factory constructor.
     UNREACHABLE();
@@ -327,314 +327,325 @@
   RegExpBuilder* builder = initial_state.builder();
   while (true) {
     switch (current()) {
-    case kEndMarker:
-      if (stored_state->IsSubexpression()) {
-        // Inside a parenthesized group when hitting end of input.
-        ReportError("Unterminated group");
-        UNREACHABLE();
-      }
-      ASSERT(INITIAL == stored_state->group_type());
-      // Parsing completed successfully.
-      return builder->ToRegExp();
-    case ')': {
-      if (!stored_state->IsSubexpression()) {
-        ReportError("Unmatched ')'");
-        UNREACHABLE();
-      }
-      ASSERT(INITIAL != stored_state->group_type());
-
-      Advance();
-      // End disjunction parsing and convert builder content to new single
-      // regexp atom.
-      RegExpTree* body = builder->ToRegExp();
-
-      intptr_t end_capture_index = captures_started();
-
-      intptr_t capture_index = stored_state->capture_index();
-      SubexpressionType group_type = stored_state->group_type();
-
-      // Restore previous state.
-      stored_state = stored_state->previous_state();
-      builder = stored_state->builder();
-
-      // Build result of subexpression.
-      if (group_type == CAPTURE) {
-        RegExpCapture* capture = new(Z) RegExpCapture(body, capture_index);
-        (*captures_)[capture_index - 1] = capture;
-        body = capture;
-      } else if (group_type != GROUPING) {
-        ASSERT(group_type == POSITIVE_LOOKAHEAD ||
-               group_type == NEGATIVE_LOOKAHEAD);
-        bool is_positive = (group_type == POSITIVE_LOOKAHEAD);
-        body = new(Z) RegExpLookahead(body,
-                                      is_positive,
-                                      end_capture_index - capture_index,
-                                      capture_index);
-      }
-      builder->AddAtom(body);
-      // For compatibility with JSC and ES3, we allow quantifiers after
-      // lookaheads, and break in all cases.
-      break;
-    }
-    case '|': {
-      Advance();
-      builder->NewAlternative();
-      continue;
-    }
-    case '*':
-    case '+':
-    case '?':
-      ReportError("Nothing to repeat");
-      UNREACHABLE();
-    case '^': {
-      Advance();
-      if (multiline_) {
-        builder->AddAssertion(
-            new(Z) RegExpAssertion(RegExpAssertion::START_OF_LINE));
-      } else {
-        builder->AddAssertion(
-            new(Z) RegExpAssertion(RegExpAssertion::START_OF_INPUT));
-        set_contains_anchor();
-      }
-      continue;
-    }
-    case '$': {
-      Advance();
-      RegExpAssertion::AssertionType assertion_type =
-          multiline_ ? RegExpAssertion::END_OF_LINE :
-                       RegExpAssertion::END_OF_INPUT;
-      builder->AddAssertion(new RegExpAssertion(assertion_type));
-      continue;
-    }
-    case '.': {
-      Advance();
-      // everything except \x0a, \x0d, \u2028 and \u2029
-      ZoneGrowableArray<CharacterRange>* ranges =
-          new ZoneGrowableArray<CharacterRange>(2);
-      CharacterRange::AddClassEscape('.', ranges);
-      RegExpTree* atom = new RegExpCharacterClass(ranges, false);
-      builder->AddAtom(atom);
-      break;
-    }
-    case '(': {
-      SubexpressionType subexpr_type = CAPTURE;
-      Advance();
-      if (current() == '?') {
-        switch (Next()) {
-          case ':':
-            subexpr_type = GROUPING;
-            break;
-          case '=':
-            subexpr_type = POSITIVE_LOOKAHEAD;
-            break;
-          case '!':
-            subexpr_type = NEGATIVE_LOOKAHEAD;
-            break;
-          default:
-            ReportError("Invalid group");
-            UNREACHABLE();
-        }
-        Advance(2);
-      } else {
-        if (captures_ == NULL) {
-          captures_ = new ZoneGrowableArray<RegExpCapture*>(2);
-        }
-        if (captures_started() >= kMaxCaptures) {
-          ReportError("Too many captures");
+      case kEndMarker:
+        if (stored_state->IsSubexpression()) {
+          // Inside a parenthesized group when hitting end of input.
+          ReportError("Unterminated group");
           UNREACHABLE();
         }
-        captures_->Add(NULL);
+        ASSERT(INITIAL == stored_state->group_type());
+        // Parsing completed successfully.
+        return builder->ToRegExp();
+      case ')': {
+        if (!stored_state->IsSubexpression()) {
+          ReportError("Unmatched ')'");
+          UNREACHABLE();
+        }
+        ASSERT(INITIAL != stored_state->group_type());
+
+        Advance();
+        // End disjunction parsing and convert builder content to new single
+        // regexp atom.
+        RegExpTree* body = builder->ToRegExp();
+
+        intptr_t end_capture_index = captures_started();
+
+        intptr_t capture_index = stored_state->capture_index();
+        SubexpressionType group_type = stored_state->group_type();
+
+        // Restore previous state.
+        stored_state = stored_state->previous_state();
+        builder = stored_state->builder();
+
+        // Build result of subexpression.
+        if (group_type == CAPTURE) {
+          RegExpCapture* capture = new (Z) RegExpCapture(body, capture_index);
+          (*captures_)[capture_index - 1] = capture;
+          body = capture;
+        } else if (group_type != GROUPING) {
+          ASSERT(group_type == POSITIVE_LOOKAHEAD ||
+                 group_type == NEGATIVE_LOOKAHEAD);
+          bool is_positive = (group_type == POSITIVE_LOOKAHEAD);
+          body = new (Z)
+              RegExpLookahead(body, is_positive,
+                              end_capture_index - capture_index, capture_index);
+        }
+        builder->AddAtom(body);
+        // For compatibility with JSC and ES3, we allow quantifiers after
+        // lookaheads, and break in all cases.
+        break;
       }
-      // Store current state and begin new disjunction parsing.
-      stored_state = new RegExpParserState(stored_state, subexpr_type,
-                                           captures_started(), Z);
-      builder = stored_state->builder();
-      continue;
-    }
-    case '[': {
-      RegExpTree* atom = ParseCharacterClass();
-      builder->AddAtom(atom);
-      break;
-    }
-    // Atom ::
-    //   \ AtomEscape
-    case '\\':
-      switch (Next()) {
-      case kEndMarker:
-        ReportError("\\ at end of pattern");
+      case '|': {
+        Advance();
+        builder->NewAlternative();
+        continue;
+      }
+      case '*':
+      case '+':
+      case '?':
+        ReportError("Nothing to repeat");
         UNREACHABLE();
-      case 'b':
-        Advance(2);
-        builder->AddAssertion(
-            new RegExpAssertion(RegExpAssertion::BOUNDARY));
+      case '^': {
+        Advance();
+        if (multiline_) {
+          builder->AddAssertion(
+              new (Z) RegExpAssertion(RegExpAssertion::START_OF_LINE));
+        } else {
+          builder->AddAssertion(
+              new (Z) RegExpAssertion(RegExpAssertion::START_OF_INPUT));
+          set_contains_anchor();
+        }
         continue;
-      case 'B':
-        Advance(2);
-        builder->AddAssertion(
-            new RegExpAssertion(RegExpAssertion::NON_BOUNDARY));
+      }
+      case '$': {
+        Advance();
+        RegExpAssertion::AssertionType assertion_type =
+            multiline_ ? RegExpAssertion::END_OF_LINE
+                       : RegExpAssertion::END_OF_INPUT;
+        builder->AddAssertion(new RegExpAssertion(assertion_type));
         continue;
-      // AtomEscape ::
-      //   CharacterClassEscape
-      //
-      // CharacterClassEscape :: one of
-      //   d D s S w W
-      case 'd': case 'D': case 's': case 'S': case 'w': case 'W': {
-        uint32_t c = Next();
-        Advance(2);
+      }
+      case '.': {
+        Advance();
+        // everything except \x0a, \x0d, \u2028 and \u2029
         ZoneGrowableArray<CharacterRange>* ranges =
             new ZoneGrowableArray<CharacterRange>(2);
-        CharacterRange::AddClassEscape(c, ranges);
+        CharacterRange::AddClassEscape('.', ranges);
         RegExpTree* atom = new RegExpCharacterClass(ranges, false);
         builder->AddAtom(atom);
         break;
       }
-      case '1': case '2': case '3': case '4': case '5': case '6':
-      case '7': case '8': case '9': {
-        intptr_t index = 0;
-        if (ParseBackReferenceIndex(&index)) {
-          RegExpCapture* capture = NULL;
-          if (captures_ != NULL && index <= captures_->length()) {
-            capture = captures_->At(index - 1);
+      case '(': {
+        SubexpressionType subexpr_type = CAPTURE;
+        Advance();
+        if (current() == '?') {
+          switch (Next()) {
+            case ':':
+              subexpr_type = GROUPING;
+              break;
+            case '=':
+              subexpr_type = POSITIVE_LOOKAHEAD;
+              break;
+            case '!':
+              subexpr_type = NEGATIVE_LOOKAHEAD;
+              break;
+            default:
+              ReportError("Invalid group");
+              UNREACHABLE();
           }
-          if (capture == NULL) {
-            builder->AddEmpty();
+          Advance(2);
+        } else {
+          if (captures_ == NULL) {
+            captures_ = new ZoneGrowableArray<RegExpCapture*>(2);
+          }
+          if (captures_started() >= kMaxCaptures) {
+            ReportError("Too many captures");
+            UNREACHABLE();
+          }
+          captures_->Add(NULL);
+        }
+        // Store current state and begin new disjunction parsing.
+        stored_state = new RegExpParserState(stored_state, subexpr_type,
+                                             captures_started(), Z);
+        builder = stored_state->builder();
+        continue;
+      }
+      case '[': {
+        RegExpTree* atom = ParseCharacterClass();
+        builder->AddAtom(atom);
+        break;
+      }
+      // Atom ::
+      //   \ AtomEscape
+      case '\\':
+        switch (Next()) {
+          case kEndMarker:
+            ReportError("\\ at end of pattern");
+            UNREACHABLE();
+          case 'b':
+            Advance(2);
+            builder->AddAssertion(
+                new RegExpAssertion(RegExpAssertion::BOUNDARY));
+            continue;
+          case 'B':
+            Advance(2);
+            builder->AddAssertion(
+                new RegExpAssertion(RegExpAssertion::NON_BOUNDARY));
+            continue;
+          // AtomEscape ::
+          //   CharacterClassEscape
+          //
+          // CharacterClassEscape :: one of
+          //   d D s S w W
+          case 'd':
+          case 'D':
+          case 's':
+          case 'S':
+          case 'w':
+          case 'W': {
+            uint32_t c = Next();
+            Advance(2);
+            ZoneGrowableArray<CharacterRange>* ranges =
+                new ZoneGrowableArray<CharacterRange>(2);
+            CharacterRange::AddClassEscape(c, ranges);
+            RegExpTree* atom = new RegExpCharacterClass(ranges, false);
+            builder->AddAtom(atom);
             break;
           }
-          RegExpTree* atom = new RegExpBackReference(capture);
-          builder->AddAtom(atom);
-          break;
-        }
-        uint32_t first_digit = Next();
-        if (first_digit == '8' || first_digit == '9') {
-          // Treat as identity escape
-          builder->AddCharacter(first_digit);
-          Advance(2);
-          break;
-        }
-      }
-      // FALLTHROUGH
-      case '0': {
-        Advance();
-        uint32_t octal = ParseOctalLiteral();
-        builder->AddCharacter(octal);
-        break;
-      }
-      // ControlEscape :: one of
-      //   f n r t v
-      case 'f':
-        Advance(2);
-        builder->AddCharacter('\f');
-        break;
-      case 'n':
-        Advance(2);
-        builder->AddCharacter('\n');
-        break;
-      case 'r':
-        Advance(2);
-        builder->AddCharacter('\r');
-        break;
-      case 't':
-        Advance(2);
-        builder->AddCharacter('\t');
-        break;
-      case 'v':
-        Advance(2);
-        builder->AddCharacter('\v');
-        break;
-      case 'c': {
-        Advance();
-        uint32_t controlLetter = Next();
-        // Special case if it is an ASCII letter.
-        // Convert lower case letters to uppercase.
-        uint32_t letter = controlLetter & ~('a' ^ 'A');
-        if (letter < 'A' || 'Z' < letter) {
-          // controlLetter is not in range 'A'-'Z' or 'a'-'z'.
-          // This is outside the specification. We match JSC in
-          // reading the backslash as a literal character instead
-          // of as starting an escape.
-          builder->AddCharacter('\\');
-        } else {
-          Advance(2);
-          builder->AddCharacter(controlLetter & 0x1f);
+          case '1':
+          case '2':
+          case '3':
+          case '4':
+          case '5':
+          case '6':
+          case '7':
+          case '8':
+          case '9': {
+            intptr_t index = 0;
+            if (ParseBackReferenceIndex(&index)) {
+              RegExpCapture* capture = NULL;
+              if (captures_ != NULL && index <= captures_->length()) {
+                capture = captures_->At(index - 1);
+              }
+              if (capture == NULL) {
+                builder->AddEmpty();
+                break;
+              }
+              RegExpTree* atom = new RegExpBackReference(capture);
+              builder->AddAtom(atom);
+              break;
+            }
+            uint32_t first_digit = Next();
+            if (first_digit == '8' || first_digit == '9') {
+              // Treat as identity escape
+              builder->AddCharacter(first_digit);
+              Advance(2);
+              break;
+            }
+          }
+          // FALLTHROUGH
+          case '0': {
+            Advance();
+            uint32_t octal = ParseOctalLiteral();
+            builder->AddCharacter(octal);
+            break;
+          }
+          // ControlEscape :: one of
+          //   f n r t v
+          case 'f':
+            Advance(2);
+            builder->AddCharacter('\f');
+            break;
+          case 'n':
+            Advance(2);
+            builder->AddCharacter('\n');
+            break;
+          case 'r':
+            Advance(2);
+            builder->AddCharacter('\r');
+            break;
+          case 't':
+            Advance(2);
+            builder->AddCharacter('\t');
+            break;
+          case 'v':
+            Advance(2);
+            builder->AddCharacter('\v');
+            break;
+          case 'c': {
+            Advance();
+            uint32_t controlLetter = Next();
+            // Special case if it is an ASCII letter.
+            // Convert lower case letters to uppercase.
+            uint32_t letter = controlLetter & ~('a' ^ 'A');
+            if (letter < 'A' || 'Z' < letter) {
+              // controlLetter is not in range 'A'-'Z' or 'a'-'z'.
+              // This is outside the specification. We match JSC in
+              // reading the backslash as a literal character instead
+              // of as starting an escape.
+              builder->AddCharacter('\\');
+            } else {
+              Advance(2);
+              builder->AddCharacter(controlLetter & 0x1f);
+            }
+            break;
+          }
+          case 'x': {
+            Advance(2);
+            uint32_t value;
+            if (ParseHexEscape(2, &value)) {
+              builder->AddCharacter(value);
+            } else {
+              builder->AddCharacter('x');
+            }
+            break;
+          }
+          case 'u': {
+            Advance(2);
+            uint32_t value;
+            if (ParseHexEscape(4, &value)) {
+              builder->AddCharacter(value);
+            } else {
+              builder->AddCharacter('u');
+            }
+            break;
+          }
+          default:
+            // Identity escape.
+            builder->AddCharacter(Next());
+            Advance(2);
+            break;
         }
         break;
-      }
-      case 'x': {
-        Advance(2);
-        uint32_t value;
-        if (ParseHexEscape(2, &value)) {
-          builder->AddCharacter(value);
-        } else {
-          builder->AddCharacter('x');
+      case '{': {
+        intptr_t dummy;
+        if (ParseIntervalQuantifier(&dummy, &dummy)) {
+          ReportError("Nothing to repeat");
+          UNREACHABLE();
         }
-        break;
-      }
-      case 'u': {
-        Advance(2);
-        uint32_t value;
-        if (ParseHexEscape(4, &value)) {
-          builder->AddCharacter(value);
-        } else {
-          builder->AddCharacter('u');
-        }
-        break;
+        // fallthrough
       }
       default:
-        // Identity escape.
-        builder->AddCharacter(Next());
-        Advance(2);
+        builder->AddCharacter(current());
+        Advance();
         break;
-      }
-      break;
-    case '{': {
-      intptr_t dummy;
-      if (ParseIntervalQuantifier(&dummy, &dummy)) {
-        ReportError("Nothing to repeat");
-        UNREACHABLE();
-      }
-      // fallthrough
-    }
-    default:
-      builder->AddCharacter(current());
-      Advance();
-      break;
     }  // end switch(current())
 
     intptr_t min;
     intptr_t max;
     switch (current()) {
-    // QuantifierPrefix ::
-    //   *
-    //   +
-    //   ?
-    //   {
-    case '*':
-      min = 0;
-      max = RegExpTree::kInfinity;
-      Advance();
-      break;
-    case '+':
-      min = 1;
-      max = RegExpTree::kInfinity;
-      Advance();
-      break;
-    case '?':
-      min = 0;
-      max = 1;
-      Advance();
-      break;
-    case '{':
-      if (ParseIntervalQuantifier(&min, &max)) {
-        if (max < min) {
-          ReportError("numbers out of order in {} quantifier.");
-          UNREACHABLE();
-        }
+      // QuantifierPrefix ::
+      //   *
+      //   +
+      //   ?
+      //   {
+      case '*':
+        min = 0;
+        max = RegExpTree::kInfinity;
+        Advance();
         break;
-      } else {
+      case '+':
+        min = 1;
+        max = RegExpTree::kInfinity;
+        Advance();
+        break;
+      case '?':
+        min = 0;
+        max = 1;
+        Advance();
+        break;
+      case '{':
+        if (ParseIntervalQuantifier(&min, &max)) {
+          if (max < min) {
+            ReportError("numbers out of order in {} quantifier.");
+            UNREACHABLE();
+          }
+          break;
+        } else {
+          continue;
+        }
+      default:
         continue;
-      }
-    default:
-      continue;
     }
     RegExpQuantifier::QuantifierType quantifier_type = RegExpQuantifier::GREEDY;
     if (current() == '?') {
@@ -654,9 +665,12 @@
 // Currently only used in an ASSERT.
 static bool IsSpecialClassEscape(uint32_t c) {
   switch (c) {
-    case 'd': case 'D':
-    case 's': case 'S':
-    case 'w': case 'W':
+    case 'd':
+    case 'D':
+    case 's':
+    case 'S':
+    case 'w':
+    case 'W':
       return true;
     default:
       return false;
@@ -843,7 +857,7 @@
 }
 
 
-bool RegExpParser::ParseHexEscape(intptr_t length, uint32_t *value) {
+bool RegExpParser::ParseHexEscape(intptr_t length, uint32_t* value) {
   intptr_t start = position();
   uint32_t val = 0;
   bool done = false;
@@ -896,8 +910,7 @@
       // For compatibility with JSC, inside a character class
       // we also accept digits and underscore as control characters.
       if ((controlLetter >= '0' && controlLetter <= '9') ||
-          controlLetter == '_' ||
-          (letter >= 'A' && letter <= 'Z')) {
+          controlLetter == '_' || (letter >= 'A' && letter <= 'Z')) {
         Advance(2);
         // Control letters mapped to ASCII control characters in the range
         // 0x00-0x1f.
@@ -907,8 +920,14 @@
       // character instead of as starting an escape.
       return '\\';
     }
-    case '0': case '1': case '2': case '3': case '4': case '5':
-    case '6': case '7':
+    case '0':
+    case '1':
+    case '2':
+    case '3':
+    case '4':
+    case '5':
+    case '6':
+    case '7':
       // For compatibility, we interpret a decimal escape that isn't
       // a back reference (and therefore either \0 or not valid according
       // to the specification) as a 1..3 digit octal character code.
@@ -951,7 +970,12 @@
   uint32_t first = current();
   if (first == '\\') {
     switch (Next()) {
-      case 'w': case 'W': case 'd': case 'D': case 's': case 'S': {
+      case 'w':
+      case 'W':
+      case 'd':
+      case 'D':
+      case 's':
+      case 'S': {
         *char_class = Next();
         Advance(2);
         return CharacterRange::Singleton(0);  // Return dummy value.
@@ -998,7 +1022,7 @@
     Advance();
   }
   ZoneGrowableArray<CharacterRange>* ranges =
-      new(Z) ZoneGrowableArray<CharacterRange>(2);
+      new (Z) ZoneGrowableArray<CharacterRange>(2);
   while (has_more() && current() != ']') {
     uint16_t char_class = kNoCharClass;
     CharacterRange first = ParseClassAtom(&char_class);
@@ -1040,7 +1064,7 @@
     ranges->Add(CharacterRange::Everything());
     is_negated = !is_negated;
   }
-  return new(Z) RegExpCharacterClass(ranges, is_negated);
+  return new (Z) RegExpCharacterClass(ranges, is_negated);
 }
 
 
@@ -1067,8 +1091,8 @@
     Thread::Current()->clear_sticky_error();
 
     // Throw a FormatException on parsing failures.
-    const String& message = String::Handle(
-          String::Concat(result->error, input));
+    const String& message =
+        String::Handle(String::Concat(result->error, input));
     const Array& args = Array::Handle(Array::New(1));
     args.SetAt(0, message);
 
diff --git a/runtime/vm/regexp_parser.h b/runtime/vm/regexp_parser.h
index aed1423..7ebfcd1 100644
--- a/runtime/vm/regexp_parser.h
+++ b/runtime/vm/regexp_parser.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_REGEXP_PARSER_H_
-#define VM_REGEXP_PARSER_H_
+#ifndef RUNTIME_VM_REGEXP_PARSER_H_
+#define RUNTIME_VM_REGEXP_PARSER_H_
 
 #include "vm/allocation.h"
 #include "vm/growable_array.h"
@@ -12,7 +12,7 @@
 namespace dart {
 
 // Accumulates RegExp atoms and assertions into lists of terms and alternatives.
-class RegExpBuilder: public ZoneAllocated {
+class RegExpBuilder : public ZoneAllocated {
  public:
   RegExpBuilder();
 
@@ -23,8 +23,9 @@
   void AddAtom(RegExpTree* tree);
   void AddAssertion(RegExpTree* tree);
   void NewAlternative();  // '|'
-  void AddQuantifierToAtom(
-      intptr_t min, intptr_t max, RegExpQuantifier::QuantifierType type);
+  void AddQuantifierToAtom(intptr_t min,
+                           intptr_t max,
+                           RegExpQuantifier::QuantifierType type);
   RegExpTree* ToRegExp();
 
  private:
@@ -41,7 +42,7 @@
   GrowableArray<RegExpTree*> text_;
   GrowableArray<RegExpTree*> alternatives_;
 #ifdef DEBUG
-  enum {ADD_NONE, ADD_CHAR, ADD_TERM, ADD_ASSERT, ADD_ATOM} last_added_;
+  enum { ADD_NONE, ADD_CHAR, ADD_TERM, ADD_ASSERT, ADD_ATOM } last_added_;
 #define LAST(x) last_added_ = x;
 #else
 #define LAST(x)
@@ -50,9 +51,7 @@
 
 class RegExpParser : public ValueObject {
  public:
-  RegExpParser(const String& in,
-               String* error,
-               bool multiline_mode);
+  RegExpParser(const String& in, String* error, bool multiline_mode);
 
   static bool ParseFunction(ParsedFunction* parsed_function);
 
@@ -96,8 +95,9 @@
   bool simple();
   bool contains_anchor() { return contains_anchor_; }
   void set_contains_anchor() { contains_anchor_ = true; }
-  intptr_t captures_started() { return captures_ == NULL ?
-          0 : captures_->length(); }
+  intptr_t captures_started() {
+    return captures_ == NULL ? 0 : captures_->length();
+  }
   intptr_t position() { return next_pos_ - 1; }
   bool failed() { return failed_; }
 
@@ -118,9 +118,9 @@
     RegExpParserState(RegExpParserState* previous_state,
                       SubexpressionType group_type,
                       intptr_t disjunction_capture_index,
-                      Zone *zone)
+                      Zone* zone)
         : previous_state_(previous_state),
-          builder_(new(zone) RegExpBuilder()),
+          builder_(new (zone) RegExpBuilder()),
           group_type_(group_type),
           disjunction_capture_index_(disjunction_capture_index) {}
     // Parser state of containing expression, if any.
@@ -173,4 +173,4 @@
 
 }  // namespace dart
 
-#endif  // VM_REGEXP_PARSER_H_
+#endif  // RUNTIME_VM_REGEXP_PARSER_H_
diff --git a/runtime/vm/regexp_test.cc b/runtime/vm/regexp_test.cc
index 3948f64..7eb55ad 100644
--- a/runtime/vm/regexp_test.cc
+++ b/runtime/vm/regexp_test.cc
@@ -15,17 +15,18 @@
 static RawArray* Match(const String& pat, const String& str) {
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
-  const RegExp& regexp = RegExp::Handle(
-      RegExpEngine::CreateRegExp(thread, pat, false, false));
+  const RegExp& regexp =
+      RegExp::Handle(RegExpEngine::CreateRegExp(thread, pat, false, false));
   const Smi& idx = Smi::Handle(Smi::New(0));
-  return IRRegExpMacroAssembler::Execute(regexp, str, idx, zone);
+  return IRRegExpMacroAssembler::Execute(regexp, str, idx, /*sticky=*/false,
+                                         zone);
 }
 
 TEST_CASE(RegExp_OneByteString) {
-  uint8_t chars[] = { 'a', 'b', 'c', 'b', 'a' };
+  uint8_t chars[] = {'a', 'b', 'c', 'b', 'a'};
   intptr_t len = ARRAY_SIZE(chars);
-  const String& str = String::Handle(
-      OneByteString::New(chars, len, Heap::kNew));
+  const String& str =
+      String::Handle(OneByteString::New(chars, len, Heap::kNew));
 
   const String& pat = String::Handle(String::New("bc"));
   const Array& res = Array::Handle(Match(pat, str));
@@ -43,10 +44,10 @@
 }
 
 TEST_CASE(RegExp_TwoByteString) {
-  uint16_t chars[] = { 'a', 'b', 'c', 'b', 'a' };
+  uint16_t chars[] = {'a', 'b', 'c', 'b', 'a'};
   intptr_t len = ARRAY_SIZE(chars);
-  const String& str = String::Handle(
-      TwoByteString::New(chars, len, Heap::kNew));
+  const String& str =
+      String::Handle(TwoByteString::New(chars, len, Heap::kNew));
 
   const String& pat = String::Handle(String::New("bc"));
   const Array& res = Array::Handle(Match(pat, str));
@@ -64,7 +65,7 @@
 }
 
 TEST_CASE(RegExp_ExternalOneByteString) {
-  uint8_t chars[] = { 'a', 'b', 'c', 'b', 'a' };
+  uint8_t chars[] = {'a', 'b', 'c', 'b', 'a'};
   intptr_t len = ARRAY_SIZE(chars);
   const String& str = String::Handle(
       ExternalOneByteString::New(chars, len, NULL, NULL, Heap::kNew));
@@ -85,7 +86,7 @@
 }
 
 TEST_CASE(RegExp_ExternalTwoByteString) {
-  uint16_t chars[] = { 'a', 'b', 'c', 'b', 'a' };
+  uint16_t chars[] = {'a', 'b', 'c', 'b', 'a'};
   intptr_t len = ARRAY_SIZE(chars);
   const String& str = String::Handle(
       ExternalTwoByteString::New(chars, len, NULL, NULL, Heap::kNew));
diff --git a/runtime/vm/report.cc b/runtime/vm/report.cc
index b53c494..ba87b5e 100644
--- a/runtime/vm/report.cc
+++ b/runtime/vm/report.cc
@@ -24,12 +24,24 @@
                                   const String& message) {
   const char* message_header;
   switch (kind) {
-    case kWarning: message_header = "warning"; break;
-    case kError: message_header = "error"; break;
-    case kMalformedType: message_header = "malformed type"; break;
-    case kMalboundedType: message_header = "malbounded type"; break;
-    case kBailout: message_header = "bailout"; break;
-    default: message_header = ""; UNREACHABLE();
+    case kWarning:
+      message_header = "warning";
+      break;
+    case kError:
+      message_header = "error";
+      break;
+    case kMalformedType:
+      message_header = "malformed type";
+      break;
+    case kMalboundedType:
+      message_header = "malbounded type";
+      break;
+    case kBailout:
+      message_header = "bailout";
+      break;
+    default:
+      message_header = "";
+      UNREACHABLE();
   }
   String& result = String::Handle();
   if (!script.IsNull()) {
@@ -47,42 +59,34 @@
       // optimizing compilation. Those strings are created rarely and should not
       // polute old space.
       if (script.HasSource()) {
-        result = String::NewFormatted(Heap::kOld,
-                                      "'%s': %s: line %" Pd " pos %" Pd ": ",
-                                      script_url.ToCString(),
-                                      message_header,
-                                      line,
-                                      column);
+        result = String::NewFormatted(
+            Heap::kOld, "'%s': %s: line %" Pd " pos %" Pd ": ",
+            script_url.ToCString(), message_header, line, column);
       } else {
-        result = String::NewFormatted(Heap::kOld,
-                                      "'%s': %s: line %" Pd ": ",
-                                      script_url.ToCString(),
-                                      message_header,
-                                      line);
+        result =
+            String::NewFormatted(Heap::kOld, "'%s': %s: line %" Pd ": ",
+                                 script_url.ToCString(), message_header, line);
       }
       // Append the formatted error or warning message.
-      const Array& strs = Array::Handle(
-          Array::New(6, Heap::kOld));
+      const Array& strs = Array::Handle(Array::New(6, Heap::kOld));
       strs.SetAt(0, result);
       strs.SetAt(1, message);
       // Append the source line.
-      const String& script_line = String::Handle(
-          script.GetLine(line, Heap::kOld));
+      const String& script_line =
+          String::Handle(script.GetLine(line, Heap::kOld));
       ASSERT(!script_line.IsNull());
       strs.SetAt(2, Symbols::NewLine());
       strs.SetAt(3, script_line);
       strs.SetAt(4, Symbols::NewLine());
       // Append the column marker.
-      const String& column_line = String::Handle(
-          String::NewFormatted(Heap::kOld,
-                               "%*s\n", static_cast<int>(column), "^"));
+      const String& column_line = String::Handle(String::NewFormatted(
+          Heap::kOld, "%*s\n", static_cast<int>(column), "^"));
       strs.SetAt(5, column_line);
       result = String::ConcatAll(strs, Heap::kOld);
     } else {
       // Token position is unknown.
       result = String::NewFormatted(Heap::kOld, "'%s': %s: ",
-                                    script_url.ToCString(),
-                                    message_header);
+                                    script_url.ToCString(), message_header);
       result = String::Concat(result, message, Heap::kOld);
     }
   } else {
@@ -102,8 +106,10 @@
 
 
 void Report::LongJumpF(const Error& prev_error,
-                       const Script& script, TokenPosition token_pos,
-                       const char* format, ...) {
+                       const Script& script,
+                       TokenPosition token_pos,
+                       const char* format,
+                       ...) {
   va_list args;
   va_start(args, format);
   LongJumpV(prev_error, script, token_pos, format, args);
@@ -113,11 +119,12 @@
 
 
 void Report::LongJumpV(const Error& prev_error,
-                       const Script& script, TokenPosition token_pos,
-                       const char* format, va_list args) {
+                       const Script& script,
+                       TokenPosition token_pos,
+                       const char* format,
+                       va_list args) {
   const Error& error = Error::Handle(LanguageError::NewFormattedV(
-      prev_error, script, token_pos, Report::AtLocation,
-      kError, Heap::kOld,
+      prev_error, script, token_pos, Report::AtLocation, kError, Heap::kOld,
       format, args));
   LongJump(error);
   UNREACHABLE();
@@ -128,7 +135,8 @@
                       const Script& script,
                       TokenPosition token_pos,
                       bool report_after_token,
-                      const char* format, ...) {
+                      const char* format,
+                      ...) {
   va_list args;
   va_start(args, format);
   MessageV(kind, script, token_pos, report_after_token, format, args);
@@ -140,7 +148,8 @@
                       const Script& script,
                       TokenPosition token_pos,
                       bool report_after_token,
-                      const char* format, va_list args) {
+                      const char* format,
+                      va_list args) {
   if (kind < kError) {
     // Reporting a warning.
     if (FLAG_silent_warnings) {
@@ -155,14 +164,11 @@
     }
   }
   // Reporting an error (or a warning as error).
-  const Error& error = Error::Handle(
-      LanguageError::NewFormattedV(Error::Handle(),  // No previous error.
-                                   script, token_pos, report_after_token,
-                                   kind, Heap::kOld,
-                                   format, args));
+  const Error& error = Error::Handle(LanguageError::NewFormattedV(
+      Error::Handle(),  // No previous error.
+      script, token_pos, report_after_token, kind, Heap::kOld, format, args));
   LongJump(error);
   UNREACHABLE();
 }
 
 }  // namespace dart
-
diff --git a/runtime/vm/report.h b/runtime/vm/report.h
index f95cb84..00d45bd 100644
--- a/runtime/vm/report.h
+++ b/runtime/vm/report.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_REPORT_H_
-#define VM_REPORT_H_
+#ifndef RUNTIME_VM_REPORT_H_
+#define RUNTIME_VM_REPORT_H_
 
 #include "vm/allocation.h"
 #include "vm/token_position.h"
@@ -36,23 +36,29 @@
 
   // Concatenate and report an already formatted error and a new error message.
   static void LongJumpF(const Error& prev_error,
-                        const Script& script, TokenPosition token_pos,
-                        const char* format, ...) PRINTF_ATTRIBUTE(4, 5);
+                        const Script& script,
+                        TokenPosition token_pos,
+                        const char* format,
+                        ...) PRINTF_ATTRIBUTE(4, 5);
   static void LongJumpV(const Error& prev_error,
-                        const Script& script, TokenPosition token_pos,
-                        const char* format, va_list args);
+                        const Script& script,
+                        TokenPosition token_pos,
+                        const char* format,
+                        va_list args);
 
   // Report a warning/jswarning/error/bailout message.
   static void MessageF(Kind kind,
                        const Script& script,
                        TokenPosition token_pos,
                        bool report_after_token,
-                       const char* format, ...) PRINTF_ATTRIBUTE(5, 6);
+                       const char* format,
+                       ...) PRINTF_ATTRIBUTE(5, 6);
   static void MessageV(Kind kind,
                        const Script& script,
                        TokenPosition token_pos,
                        bool report_after_token,
-                       const char* format, va_list args);
+                       const char* format,
+                       va_list args);
 
   // Prepend a source snippet to the message.
   // A null script means no source and a negative token_pos means no position.
@@ -68,5 +74,4 @@
 
 }  // namespace dart
 
-#endif  // VM_REPORT_H_
-
+#endif  // RUNTIME_VM_REPORT_H_
diff --git a/runtime/vm/resolver.cc b/runtime/vm/resolver.cc
index 95f8c62..41169e4 100644
--- a/runtime/vm/resolver.cc
+++ b/runtime/vm/resolver.cc
@@ -39,11 +39,11 @@
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
 
-  Function& function = Function::Handle(zone,
+  Function& function = Function::Handle(
+      zone,
       ResolveDynamicAnyArgs(zone, receiver_class, function_name, allow_add));
 
-  if (function.IsNull() ||
-      !function.AreValidArguments(args_desc, NULL)) {
+  if (function.IsNull() || !function.AreValidArguments(args_desc, NULL)) {
     // Return a null function to signal to the upper levels to dispatch to
     // "noSuchMethod" function.
     if (FLAG_trace_resolving) {
@@ -53,8 +53,7 @@
         // Obtain more detailed error message.
         function.AreValidArguments(args_desc, &error_message);
       }
-      THR_Print("ResolveDynamic error '%s': %s.\n",
-                function_name.ToCString(),
+      THR_Print("ResolveDynamic error '%s': %s.\n", function_name.ToCString(),
                 error_message.ToCString());
     }
     return Function::null();
@@ -63,15 +62,13 @@
 }
 
 
-RawFunction* Resolver::ResolveDynamicAnyArgs(
-    Zone* zone,
-    const Class& receiver_class,
-    const String& function_name,
-    bool allow_add) {
+RawFunction* Resolver::ResolveDynamicAnyArgs(Zone* zone,
+                                             const Class& receiver_class,
+                                             const String& function_name,
+                                             bool allow_add) {
   Class& cls = Class::Handle(zone, receiver_class.raw());
   if (FLAG_trace_resolving) {
-    THR_Print("ResolveDynamic '%s' for class %s\n",
-              function_name.ToCString(),
+    THR_Print("ResolveDynamic '%s' for class %s\n", function_name.ToCString(),
               String::Handle(zone, cls.Name()).ToCString());
   }
 
@@ -162,12 +159,10 @@
         if (FLAG_trace_resolving) {
           String& error_message = String::Handle();
           // Obtain more detailed error message.
-          function.AreValidArguments(num_arguments,
-                                     argument_names,
+          function.AreValidArguments(num_arguments, argument_names,
                                      &error_message);
           THR_Print("ResolveStatic error '%s': %s.\n",
-                    function_name.ToCString(),
-                    error_message.ToCString());
+                    function_name.ToCString(), error_message.ToCString());
         }
         function = Function::null();
       }
@@ -183,22 +178,19 @@
     // ResolveStatic will return a NULL function object.
     const Class& cls = Class::Handle(library.LookupClass(class_name));
     if (!cls.IsNull()) {
-      function = ResolveStatic(cls,
-                               function_name,
-                               num_arguments,
-                               argument_names);
+      function =
+          ResolveStatic(cls, function_name, num_arguments, argument_names);
     }
     if (FLAG_trace_resolving && function.IsNull()) {
       THR_Print("ResolveStatic error: function '%s.%s' not found.\n",
-                class_name.ToCString(),
-                function_name.ToCString());
+                class_name.ToCString(), function_name.ToCString());
     }
   }
   return function.raw();
 }
 
 
-RawFunction* Resolver::ResolveStatic(const Class&  cls,
+RawFunction* Resolver::ResolveStatic(const Class& cls,
                                      const String& function_name,
                                      intptr_t num_arguments,
                                      const Array& argument_names) {
@@ -216,12 +208,10 @@
       String& error_message = String::Handle(String::New("function not found"));
       if (!function.IsNull()) {
         // Obtain more detailed error message.
-        function.AreValidArguments(num_arguments,
-                                   argument_names,
+        function.AreValidArguments(num_arguments, argument_names,
                                    &error_message);
       }
-      THR_Print("ResolveStatic error '%s': %s.\n",
-                function_name.ToCString(),
+      THR_Print("ResolveStatic error '%s': %s.\n", function_name.ToCString(),
                 error_message.ToCString());
     }
     return Function::null();
@@ -230,7 +220,7 @@
 }
 
 
-RawFunction* Resolver::ResolveStaticAllowPrivate(const Class&  cls,
+RawFunction* Resolver::ResolveStaticAllowPrivate(const Class& cls,
                                                  const String& function_name,
                                                  intptr_t num_arguments,
                                                  const Array& argument_names) {
@@ -248,13 +238,11 @@
       String& error_message = String::Handle(String::New("function not found"));
       if (!function.IsNull()) {
         // Obtain more detailed error message.
-        function.AreValidArguments(num_arguments,
-                                   argument_names,
+        function.AreValidArguments(num_arguments, argument_names,
                                    &error_message);
       }
       THR_Print("ResolveStaticAllowPrivate error '%s': %s.\n",
-                function_name.ToCString(),
-                error_message.ToCString());
+                function_name.ToCString(), error_message.ToCString());
     }
     return Function::null();
   }
diff --git a/runtime/vm/resolver.h b/runtime/vm/resolver.h
index 9a52ad3..8ce80c7 100644
--- a/runtime/vm/resolver.h
+++ b/runtime/vm/resolver.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_RESOLVER_H_
-#define VM_RESOLVER_H_
+#ifndef RUNTIME_VM_RESOLVER_H_
+#define RUNTIME_VM_RESOLVER_H_
 
 #include "vm/allocation.h"
 
@@ -36,11 +36,10 @@
       bool allow_add = true);
 
   // If 'allow_add' is true we may add a function to the class during lookup.
-  static RawFunction* ResolveDynamicAnyArgs(
-      Zone* zone,
-      const Class& receiver_class,
-      const String& function_name,
-      bool allow_add = true);
+  static RawFunction* ResolveDynamicAnyArgs(Zone* zone,
+                                            const Class& receiver_class,
+                                            const String& function_name,
+                                            bool allow_add = true);
 
   // Resolve specified dart static function. If library.IsNull, use
   // either application library or core library if no application library
@@ -56,14 +55,14 @@
 
   // Resolve specified dart static function with specified arity. Only resolves
   // public functions.
-  static RawFunction* ResolveStatic(const Class&  cls,
+  static RawFunction* ResolveStatic(const Class& cls,
                                     const String& function_name,
                                     intptr_t num_arguments,
                                     const Array& argument_names);
 
   // Resolve specified dart static function with specified arity. Resolves both
   // public and private functions.
-  static RawFunction* ResolveStaticAllowPrivate(const Class&  cls,
+  static RawFunction* ResolveStaticAllowPrivate(const Class& cls,
                                                 const String& function_name,
                                                 intptr_t num_arguments,
                                                 const Array& argument_names);
@@ -71,4 +70,4 @@
 
 }  // namespace dart
 
-#endif  // VM_RESOLVER_H_
+#endif  // RUNTIME_VM_RESOLVER_H_
diff --git a/runtime/vm/resolver_test.cc b/runtime/vm/resolver_test.cc
index 2252e23..b5a25aa 100644
--- a/runtime/vm/resolver_test.cc
+++ b/runtime/vm/resolver_test.cc
@@ -24,8 +24,7 @@
 
   // Setup a dart class and function.
   char script_chars[1024];
-  OS::SNPrint(script_chars,
-              sizeof(script_chars),
+  OS::SNPrint(script_chars, sizeof(script_chars),
               "class Base {\n"
               "  dynCall() { return 3; }\n"
               "  static statCall() { return 4; }\n"
@@ -34,17 +33,15 @@
               "class %s extends Base {\n"
               "  %s %s(String s, int i) { return i; }\n"
               "}\n",
-              test_class_name,
-              is_static ? "static" : "",
+              test_class_name, is_static ? "static" : "",
               test_static_function_name);
 
-  String& url = String::Handle(zone,
-      is_static ?
-          String::New("dart-test:DartStaticResolve") :
-          String::New("dart-test:DartDynamicResolve"));
+  String& url = String::Handle(
+      zone, is_static ? String::New("dart-test:DartStaticResolve")
+                      : String::New("dart-test:DartDynamicResolve"));
   String& source = String::Handle(zone, String::New(script_chars));
-  Script& script = Script::Handle(zone,
-      Script::New(url, source, RawScript::kScriptTag));
+  Script& script =
+      Script::Handle(zone, Script::New(url, source, RawScript::kScriptTag));
   const String& lib_name = String::Handle(zone, String::New(test_library_name));
   Library& lib = Library::Handle(zone, Library::New(lib_name));
   lib.Register(thread);
@@ -58,9 +55,7 @@
                                 const char* test_class_name,
                                 const char* test_static_function_name) {
   // Setup a static dart class and function.
-  SetupFunction(test_library_name,
-                test_class_name,
-                test_static_function_name,
+  SetupFunction(test_library_name, test_class_name, test_static_function_name,
                 true);
 }
 
@@ -70,10 +65,7 @@
                                   const char* test_class_name,
                                   const char* test_function_name) {
   // Setup a static dart class and function.
-  SetupFunction(test_library_name,
-                test_class_name,
-                test_function_name,
-                false);
+  SetupFunction(test_library_name, test_class_name, test_function_name, false);
 }
 
 
@@ -84,8 +76,7 @@
   const int kTestValue = 42;
 
   // Setup a static function which can be invoked.
-  SetupStaticFunction(test_library_name,
-                      test_class_name,
+  SetupStaticFunction(test_library_name, test_class_name,
                       test_static_function_name);
 
   const String& library_name = String::Handle(String::New(test_library_name));
@@ -99,11 +90,8 @@
   {
     const int kNumArguments = 2;
     const Function& function = Function::Handle(
-        Resolver::ResolveStatic(library,
-                                class_name,
-                                static_function_name,
-                                kNumArguments,
-                                Object::empty_array()));
+        Resolver::ResolveStatic(library, class_name, static_function_name,
+                                kNumArguments, Object::empty_array()));
     EXPECT(!function.IsNull());  // No ambiguity error expected.
     const Array& args = Array::Handle(Array::New(kNumArguments));
     const String& arg0 = String::Handle(String::New("junk"));
@@ -119,11 +107,8 @@
   {
     const int kNumArguments = 1;
     const Function& bad_function = Function::Handle(
-        Resolver::ResolveStatic(library,
-                                class_name,
-                                static_function_name,
-                                kNumArguments,
-                                Object::empty_array()));
+        Resolver::ResolveStatic(library, class_name, static_function_name,
+                                kNumArguments, Object::empty_array()));
     EXPECT(bad_function.IsNull());  // No ambiguity error expected.
   }
 
@@ -133,12 +118,9 @@
         String::Handle(String::New("statCall"));
     const String& super_class_name = String::Handle(String::New("Base"));
     const int kNumArguments = 0;
-    const Function& super_function = Function::Handle(
-        Resolver::ResolveStatic(library,
-                                super_class_name,
-                                super_static_function_name,
-                                kNumArguments,
-                                Object::empty_array()));
+    const Function& super_function = Function::Handle(Resolver::ResolveStatic(
+        library, super_class_name, super_static_function_name, kNumArguments,
+        Object::empty_array()));
     EXPECT(!super_function.IsNull());  // No ambiguity error expected.
   }
 }
@@ -151,18 +133,16 @@
   const int kTestValue = 42;
 
   // Setup a function which can be invoked.
-  SetupInstanceFunction(test_library_name,
-                        test_class_name,
-                        test_function_name);
+  SetupInstanceFunction(test_library_name, test_class_name, test_function_name);
 
   // Now create an instance object of the class and try to
   // resolve a function in it.
   const String& lib_name = String::Handle(String::New(test_library_name));
-  const Library& lib = Library::Handle(Library::LookupLibrary(thread,
-                                                              lib_name));
+  const Library& lib =
+      Library::Handle(Library::LookupLibrary(thread, lib_name));
   ASSERT(!lib.IsNull());
-  const Class& cls = Class::Handle(lib.LookupClass(
-      String::Handle(Symbols::New(thread, test_class_name))));
+  const Class& cls = Class::Handle(
+      lib.LookupClass(String::Handle(Symbols::New(thread, test_class_name))));
   EXPECT(!cls.IsNull());  // No ambiguity error expected.
 
   Instance& receiver = Instance::Handle(Instance::New(cls));
@@ -174,9 +154,7 @@
     ArgumentsDescriptor args_desc(
         Array::Handle(ArgumentsDescriptor::New(kNumArguments)));
     const Function& function = Function::Handle(
-        Resolver::ResolveDynamic(receiver,
-                                 function_name,
-                                 args_desc));
+        Resolver::ResolveDynamic(receiver, function_name, args_desc));
     EXPECT(!function.IsNull());
     const Array& args = Array::Handle(Array::New(kNumArguments));
     args.SetAt(0, receiver);
@@ -195,9 +173,7 @@
     ArgumentsDescriptor args_desc(
         Array::Handle(ArgumentsDescriptor::New(kNumArguments)));
     const Function& bad_function = Function::Handle(
-        Resolver::ResolveDynamic(receiver,
-                                 function_name,
-                                 args_desc));
+        Resolver::ResolveDynamic(receiver, function_name, args_desc));
     EXPECT(bad_function.IsNull());
   }
 
@@ -206,12 +182,9 @@
     const int kNumArguments = 1;
     ArgumentsDescriptor args_desc(
         Array::Handle(ArgumentsDescriptor::New(kNumArguments)));
-    const String& super_function_name =
-        String::Handle(String::New("dynCall"));
+    const String& super_function_name = String::Handle(String::New("dynCall"));
     const Function& super_function = Function::Handle(
-        Resolver::ResolveDynamic(receiver,
-                                 super_function_name,
-                                 args_desc));
+        Resolver::ResolveDynamic(receiver, super_function_name, args_desc));
     EXPECT(!super_function.IsNull());
   }
 }
diff --git a/runtime/vm/reusable_handles.h b/runtime/vm/reusable_handles.h
index 25e5154..11178d8 100644
--- a/runtime/vm/reusable_handles.h
+++ b/runtime/vm/reusable_handles.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_REUSABLE_HANDLES_H_
-#define VM_REUSABLE_HANDLES_H_
+#ifndef RUNTIME_VM_REUSABLE_HANDLES_H_
+#define RUNTIME_VM_REUSABLE_HANDLES_H_
 
 #include "vm/allocation.h"
 #include "vm/handles.h"
@@ -35,8 +35,7 @@
 #define REUSABLE_SCOPE(name)                                                   \
   class Reusable##name##HandleScope : public ValueObject {                     \
    public:                                                                     \
-    explicit Reusable##name##HandleScope(Thread* thread)                       \
-        : thread_(thread) {                                                    \
+    explicit Reusable##name##HandleScope(Thread* thread) : thread_(thread) {   \
       ASSERT(!thread->reusable_##name##_handle_scope_active());                \
       thread->set_reusable_##name##_handle_scope_active(true);                 \
     }                                                                          \
@@ -53,6 +52,7 @@
       ASSERT(thread_->name##_handle_ != NULL);                                 \
       return *thread_->name##_handle_;                                         \
     }                                                                          \
+                                                                               \
    private:                                                                    \
     Thread* thread_;                                                           \
     DISALLOW_COPY_AND_ASSIGN(Reusable##name##HandleScope);                     \
@@ -62,18 +62,15 @@
   class Reusable##name##HandleScope : public ValueObject {                     \
    public:                                                                     \
     explicit Reusable##name##HandleScope(Thread* thread)                       \
-        : handle_(thread->name##_handle_) {                                    \
-    }                                                                          \
+        : handle_(thread->name##_handle_) {}                                   \
     Reusable##name##HandleScope()                                              \
-        : handle_(Thread::Current()->name##_handle_) {                         \
-    }                                                                          \
-    ~Reusable##name##HandleScope() {                                           \
-      handle_->raw_ = name::null();                                            \
-    }                                                                          \
+        : handle_(Thread::Current()->name##_handle_) {}                        \
+    ~Reusable##name##HandleScope() { handle_->raw_ = name::null(); }           \
     name& Handle() const {                                                     \
       ASSERT(handle_ != NULL);                                                 \
       return *handle_;                                                         \
     }                                                                          \
+                                                                               \
    private:                                                                    \
     name* handle_;                                                             \
     DISALLOW_COPY_AND_ASSIGN(Reusable##name##HandleScope);                     \
@@ -93,15 +90,14 @@
 #define REUSABLE_ERROR_HANDLESCOPE(thread)                                     \
   ReusableErrorHandleScope reused_error_handle(thread);
 #define REUSABLE_EXCEPTION_HANDLERS_HANDLESCOPE(thread)                        \
-  ReusableExceptionHandlersHandleScope                                         \
-      reused_exception_handlers_handle(thread);
+  ReusableExceptionHandlersHandleScope reused_exception_handlers_handle(thread);
 #define REUSABLE_FIELD_HANDLESCOPE(thread)                                     \
   ReusableFieldHandleScope reused_field_handle(thread);
 #define REUSABLE_FUNCTION_HANDLESCOPE(thread)                                  \
   ReusableFunctionHandleScope reused_function_handle(thread);
 #define REUSABLE_GROWABLE_OBJECT_ARRAY_HANDLESCOPE(thread)                     \
-  ReusableGrowableObjectArrayHandleScope                                       \
-      reused_growable_object_array_handle(thread)
+  ReusableGrowableObjectArrayHandleScope reused_growable_object_array_handle(  \
+      thread)
 #define REUSABLE_INSTANCE_HANDLESCOPE(thread)                                  \
   ReusableInstanceHandleScope reused_instance_handle(thread);
 #define REUSABLE_LIBRARY_HANDLESCOPE(thread)                                   \
@@ -121,4 +117,4 @@
 
 }  // namespace dart
 
-#endif  // VM_REUSABLE_HANDLES_H_
+#endif  // RUNTIME_VM_REUSABLE_HANDLES_H_
diff --git a/runtime/vm/ring_buffer.h b/runtime/vm/ring_buffer.h
index e015930..a8079b5 100644
--- a/runtime/vm/ring_buffer.h
+++ b/runtime/vm/ring_buffer.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_RING_BUFFER_H_
-#define VM_RING_BUFFER_H_
+#ifndef RUNTIME_VM_RING_BUFFER_H_
+#define RUNTIME_VM_RING_BUFFER_H_
 
 #include "platform/assert.h"
 #include "platform/utils.h"
@@ -11,14 +11,12 @@
 namespace dart {
 
 // Fixed-capacity ring buffer.
-template<typename T, int N>
+template <typename T, int N>
 class RingBuffer {
  public:
-  RingBuffer() : count_(0) { }
+  RingBuffer() : count_(0) {}
 
-  void Add(const T& t) {
-    data_[count_++ & kMask] = t;
-  }
+  void Add(const T& t) { data_[count_++ & kMask] = t; }
 
   // Returns the i'th most recently added element. Requires 0 <= i < Size().
   const T& Get(int i) const {
@@ -40,4 +38,4 @@
 
 }  // namespace dart
 
-#endif  // VM_RING_BUFFER_H_
+#endif  // RUNTIME_VM_RING_BUFFER_H_
diff --git a/runtime/vm/runtime_entry.cc b/runtime/vm/runtime_entry.cc
index a082636..b0cd46e 100644
--- a/runtime/vm/runtime_entry.cc
+++ b/runtime/vm/runtime_entry.cc
@@ -10,6 +10,17 @@
 
 namespace dart {
 
+#if defined(TESTING) || defined(DEBUG)
+void VerifyOnTransition() {
+  Thread* thread = Thread::Current();
+  TransitionGeneratedToVM transition(thread);
+  thread->isolate()->heap()->WaitForSweeperTasks();
+  SafepointOperationScope safepoint_scope(thread);
+  VerifyPointersVisitor::VerifyPointers();
+  thread->isolate()->heap()->Verify();
+}
+#endif
+
 
 // Add function to a class and that class to the class dictionary so that
 // frame walking can be used.
@@ -18,20 +29,12 @@
   const String& class_name = String::Handle(Symbols::New(thread, "ownerClass"));
   const Script& script = Script::Handle();
   const Library& lib = Library::Handle(Library::CoreLibrary());
-  const Class& owner_class =
-      Class::Handle(Class::New(lib, class_name, script,
-                               TokenPosition::kNoSource));
+  const Class& owner_class = Class::Handle(
+      Class::New(lib, class_name, script, TokenPosition::kNoSource));
   const String& function_name = String::ZoneHandle(Symbols::New(thread, name));
-  const Function& function = Function::ZoneHandle(
-      Function::New(function_name,
-                    RawFunction::kRegularFunction,
-                    true,
-                    false,
-                    false,
-                    false,
-                    false,
-                    owner_class,
-                    TokenPosition::kMinSource));
+  const Function& function = Function::ZoneHandle(Function::New(
+      function_name, RawFunction::kRegularFunction, true, false, false, false,
+      false, owner_class, TokenPosition::kMinSource));
   const Array& functions = Array::Handle(Array::New(1));
   functions.SetAt(0, function);
   owner_class.SetFunctions(functions);
diff --git a/runtime/vm/runtime_entry.h b/runtime/vm/runtime_entry.h
index c52b6b5..c9e7bd3 100644
--- a/runtime/vm/runtime_entry.h
+++ b/runtime/vm/runtime_entry.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_RUNTIME_ENTRY_H_
-#define VM_RUNTIME_ENTRY_H_
+#ifndef RUNTIME_VM_RUNTIME_ENTRY_H_
+#define RUNTIME_VM_RUNTIME_ENTRY_H_
 
 #include "vm/allocation.h"
 #include "vm/flags.h"
@@ -22,14 +22,12 @@
 
 enum RuntimeFunctionId {
   kNoRuntimeFunctionId = -1,
-#define DECLARE_ENUM_VALUE(name) \
-  k##name##Id,
+#define DECLARE_ENUM_VALUE(name) k##name##Id,
   RUNTIME_ENTRY_LIST(DECLARE_ENUM_VALUE)
 #undef DECLARE_ENUM_VALUE
 
-#define DECLARE_LEAF_ENUM_VALUE(type, name, ...) \
-  k##name##Id,
-  LEAF_RUNTIME_ENTRY_LIST(DECLARE_LEAF_ENUM_VALUE)
+#define DECLARE_LEAF_ENUM_VALUE(type, name, ...) k##name##Id,
+      LEAF_RUNTIME_ENTRY_LIST(DECLARE_LEAF_ENUM_VALUE)
 #undef DECLARE_LEAF_ENUM_VALUE
 };
 
@@ -38,8 +36,11 @@
 // by the function.
 class RuntimeEntry : public ValueObject {
  public:
-  RuntimeEntry(const char* name, RuntimeFunction function,
-               intptr_t argument_count, bool is_leaf, bool is_float)
+  RuntimeEntry(const char* name,
+               RuntimeFunction function,
+               intptr_t argument_count,
+               bool is_leaf,
+               bool is_float)
       : name_(name),
         function_(function),
         argument_count_(argument_count),
@@ -83,7 +84,8 @@
   }
 #else
 #define TRACE_RUNTIME_CALL(format, name)                                       \
-  do { } while (0)
+  do {                                                                         \
+  } while (0)
 #endif
 
 // Helper macros for declaring and defining runtime entries.
@@ -91,16 +93,14 @@
 #define DEFINE_RUNTIME_ENTRY(name, argument_count)                             \
   extern void DRT_##name(NativeArguments arguments);                           \
   extern const RuntimeEntry k##name##RuntimeEntry(                             \
-      "DRT_"#name, &DRT_##name, argument_count, false, false);                 \
-  static void DRT_Helper##name(Isolate* isolate,                               \
-                               Thread* thread,                                 \
-                               Zone* zone,                                     \
+      "DRT_" #name, &DRT_##name, argument_count, false, false);                \
+  static void DRT_Helper##name(Isolate* isolate, Thread* thread, Zone* zone,   \
                                NativeArguments arguments);                     \
   void DRT_##name(NativeArguments arguments) {                                 \
     CHECK_STACK_ALIGNMENT;                                                     \
     VERIFY_ON_TRANSITION;                                                      \
     ASSERT(arguments.ArgCount() == argument_count);                            \
-    TRACE_RUNTIME_CALL("%s", ""#name);                                         \
+    TRACE_RUNTIME_CALL("%s", "" #name);                                        \
     {                                                                          \
       Thread* thread = arguments.thread();                                     \
       ASSERT(thread == Thread::Current());                                     \
@@ -112,23 +112,21 @@
     }                                                                          \
     VERIFY_ON_TRANSITION;                                                      \
   }                                                                            \
-  static void DRT_Helper##name(Isolate* isolate,                               \
-                               Thread* thread,                                 \
-                               Zone* zone,                                     \
+  static void DRT_Helper##name(Isolate* isolate, Thread* thread, Zone* zone,   \
                                NativeArguments arguments)
 
 #define DECLARE_RUNTIME_ENTRY(name)                                            \
   extern const RuntimeEntry k##name##RuntimeEntry;                             \
-  extern void DRT_##name(NativeArguments arguments);                           \
+  extern void DRT_##name(NativeArguments arguments);
 
 #define DEFINE_LEAF_RUNTIME_ENTRY(type, name, argument_count, ...)             \
   extern "C" type DLRT_##name(__VA_ARGS__);                                    \
   extern const RuntimeEntry k##name##RuntimeEntry(                             \
-      "DLRT_"#name, reinterpret_cast<RuntimeFunction>(&DLRT_##name),           \
+      "DLRT_" #name, reinterpret_cast<RuntimeFunction>(&DLRT_##name),          \
       argument_count, true, false);                                            \
   type DLRT_##name(__VA_ARGS__) {                                              \
     CHECK_STACK_ALIGNMENT;                                                     \
-    NoSafepointScope no_safepoint_scope;                                       \
+    NoSafepointScope no_safepoint_scope;
 
 #define END_LEAF_RUNTIME_ENTRY }
 
@@ -136,11 +134,11 @@
 // DEFINE_LEAF_RUNTIME_ENTRY instead.
 #define DEFINE_RAW_LEAF_RUNTIME_ENTRY(name, argument_count, is_float, func)    \
   extern const RuntimeEntry k##name##RuntimeEntry(                             \
-      "DFLRT_"#name, func, argument_count, true, is_float)                     \
+      "DFLRT_" #name, func, argument_count, true, is_float)
 
 #define DECLARE_LEAF_RUNTIME_ENTRY(type, name, ...)                            \
   extern const RuntimeEntry k##name##RuntimeEntry;                             \
-  extern "C" type DLRT_##name(__VA_ARGS__);                                    \
+  extern "C" type DLRT_##name(__VA_ARGS__);
 
 
 // Declare all runtime functions here.
@@ -154,14 +152,16 @@
 
 
 uword RuntimeEntry::AddressFromId(RuntimeFunctionId id) {
-    switch (id) {
+  switch (id) {
 #define DEFINE_RUNTIME_CASE(name)                                              \
-    case k##name##Id: return k##name##RuntimeEntry.GetEntryPoint();
+  case k##name##Id:                                                            \
+    return k##name##RuntimeEntry.GetEntryPoint();
     RUNTIME_ENTRY_LIST(DEFINE_RUNTIME_CASE)
 #undef DEFINE_RUNTIME_CASE
 
 #define DEFINE_LEAF_RUNTIME_CASE(type, name, ...)                              \
-    case k##name##Id: return k##name##RuntimeEntry.GetEntryPoint();
+  case k##name##Id:                                                            \
+    return k##name##RuntimeEntry.GetEntryPoint();
     LEAF_RUNTIME_ENTRY_LIST(DEFINE_LEAF_RUNTIME_CASE)
 #undef DEFINE_LEAF_RUNTIME_CASE
     default:
@@ -186,4 +186,4 @@
 
 }  // namespace dart
 
-#endif  // VM_RUNTIME_ENTRY_H_
+#endif  // RUNTIME_VM_RUNTIME_ENTRY_H_
diff --git a/runtime/vm/runtime_entry_arm.cc b/runtime/vm/runtime_entry_arm.cc
index a0bb2e9..846b91b 100644
--- a/runtime/vm/runtime_entry_arm.cc
+++ b/runtime/vm/runtime_entry_arm.cc
@@ -25,8 +25,7 @@
   // Redirection to leaf runtime calls supports a maximum of 4 arguments passed
   // in registers (maximum 2 double arguments for leaf float runtime calls).
   ASSERT(argument_count() >= 0);
-  ASSERT(!is_leaf() ||
-         (!is_float() && (argument_count() <= 4)) ||
+  ASSERT(!is_leaf() || (!is_float() && (argument_count() <= 4)) ||
          (argument_count() <= 2));
   Simulator::CallKind call_kind =
       is_leaf() ? (is_float() ? Simulator::kLeafFloatRuntimeCall
diff --git a/runtime/vm/runtime_entry_arm64.cc b/runtime/vm/runtime_entry_arm64.cc
index f3e98bc..2186fc3 100644
--- a/runtime/vm/runtime_entry_arm64.cc
+++ b/runtime/vm/runtime_entry_arm64.cc
@@ -25,8 +25,7 @@
   // Redirection to leaf runtime calls supports a maximum of 4 arguments passed
   // in registers (maximum 2 double arguments for leaf float runtime calls).
   ASSERT(argument_count() >= 0);
-  ASSERT(!is_leaf() ||
-         (!is_float() && (argument_count() <= 4)) ||
+  ASSERT(!is_leaf() || (!is_float() && (argument_count() <= 4)) ||
          (argument_count() <= 2));
   Simulator::CallKind call_kind =
       is_leaf() ? (is_float() ? Simulator::kLeafFloatRuntimeCall
diff --git a/runtime/vm/runtime_entry_list.h b/runtime/vm/runtime_entry_list.h
index 9564146..d450ee4 100644
--- a/runtime/vm/runtime_entry_list.h
+++ b/runtime/vm/runtime_entry_list.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_RUNTIME_ENTRY_LIST_H_
-#define VM_RUNTIME_ENTRY_LIST_H_
+#ifndef RUNTIME_VM_RUNTIME_ENTRY_LIST_H_
+#define RUNTIME_VM_RUNTIME_ENTRY_LIST_H_
 
 namespace dart {
 
@@ -46,7 +46,7 @@
   V(CompileFunction)                                                           \
   V(MonomorphicMiss)                                                           \
   V(SingleTargetMiss)                                                          \
-  V(UnlinkedCall)                                                              \
+  V(UnlinkedCall)
 
 #define LEAF_RUNTIME_ENTRY_LIST(V)                                             \
   V(void, PrintStopMessage, const char*)                                       \
@@ -67,9 +67,8 @@
   V(double, LibcAsin, double)                                                  \
   V(double, LibcAtan, double)                                                  \
   V(double, LibcAtan2, double, double)                                         \
-  V(RawBool*, CaseInsensitiveCompareUC16,                                      \
-    RawString*, RawSmi*, RawSmi*, RawSmi*)                                     \
+  V(RawBool*, CaseInsensitiveCompareUC16, RawString*, RawSmi*, RawSmi*, RawSmi*)
 
 }  // namespace dart
 
-#endif  // VM_RUNTIME_ENTRY_LIST_H_
+#endif  // RUNTIME_VM_RUNTIME_ENTRY_LIST_H_
diff --git a/runtime/vm/runtime_entry_mips.cc b/runtime/vm/runtime_entry_mips.cc
index b310556..b89781f 100644
--- a/runtime/vm/runtime_entry_mips.cc
+++ b/runtime/vm/runtime_entry_mips.cc
@@ -25,8 +25,7 @@
   // Redirection to leaf runtime calls supports a maximum of 4 arguments passed
   // in registers (maximum 2 double arguments for leaf float runtime calls).
   ASSERT(argument_count() >= 0);
-  ASSERT(!is_leaf() ||
-         (!is_float() && (argument_count() <= 4)) ||
+  ASSERT(!is_leaf() || (!is_float() && (argument_count() <= 4)) ||
          (argument_count() <= 2));
   Simulator::CallKind call_kind =
       is_leaf() ? (is_float() ? Simulator::kLeafFloatRuntimeCall
diff --git a/runtime/vm/safepoint.cc b/runtime/vm/safepoint.cc
index 7f5d92d..a554a9a 100644
--- a/runtime/vm/safepoint.cc
+++ b/runtime/vm/safepoint.cc
@@ -42,8 +42,7 @@
       safepoint_lock_(new Monitor()),
       number_threads_not_at_safepoint_(0),
       safepoint_operation_count_(0),
-      owner_(NULL) {
-}
+      owner_(NULL) {}
 
 
 SafepointHandler::~SafepointHandler() {
@@ -114,8 +113,7 @@
           // We have been waiting too long, start logging this as we might
           // have an issue where a thread is not checking in for a safepoint.
           OS::Print("Attempt:%" Pd " waiting for %d threads to check in\n",
-                    num_attempts,
-                    number_threads_not_at_safepoint_);
+                    num_attempts, number_threads_not_at_safepoint_);
         }
       }
     }
diff --git a/runtime/vm/safepoint.h b/runtime/vm/safepoint.h
index 15c2c98..5547ce7 100644
--- a/runtime/vm/safepoint.h
+++ b/runtime/vm/safepoint.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_SAFEPOINT_H_
-#define VM_SAFEPOINT_H_
+#ifndef RUNTIME_VM_SAFEPOINT_H_
+#define RUNTIME_VM_SAFEPOINT_H_
 
 #include "vm/globals.h"
 #include "vm/lockers.h"
@@ -320,8 +320,7 @@
 class TransitionToGenerated : public TransitionSafepointState {
  public:
   explicit TransitionToGenerated(Thread* T)
-      : TransitionSafepointState(T),
-        execution_state_(T->execution_state()) {
+      : TransitionSafepointState(T), execution_state_(T->execution_state()) {
     ASSERT(T == Thread::Current());
     ASSERT((execution_state_ == Thread::kThreadInVM) ||
            (execution_state_ == Thread::kThreadInNative));
@@ -357,8 +356,8 @@
 // transition set up.
 class TransitionToVM : public TransitionSafepointState {
  public:
-  explicit TransitionToVM(Thread* T) : TransitionSafepointState(T),
-                                       execution_state_(T->execution_state()) {
+  explicit TransitionToVM(Thread* T)
+      : TransitionSafepointState(T), execution_state_(T->execution_state()) {
     ASSERT(T == Thread::Current());
     ASSERT((execution_state_ == Thread::kThreadInVM) ||
            (execution_state_ == Thread::kThreadInNative));
@@ -384,4 +383,4 @@
 
 }  // namespace dart
 
-#endif  // VM_SAFEPOINT_H_
+#endif  // RUNTIME_VM_SAFEPOINT_H_
diff --git a/runtime/vm/scanner.cc b/runtime/vm/scanner.cc
index cd8abf5..a34439b 100644
--- a/runtime/vm/scanner.cc
+++ b/runtime/vm/scanner.cc
@@ -23,10 +23,10 @@
 class ScanContext : public ZoneAllocated {
  public:
   explicit ScanContext(Scanner* scanner)
-      :  next_(scanner->saved_context_),
-         string_delimiter_(scanner->string_delimiter_),
-         string_is_multiline_(scanner->string_is_multiline_),
-         brace_level_(scanner->brace_level_) {}
+      : next_(scanner->saved_context_),
+        string_delimiter_(scanner->string_delimiter_),
+        string_is_multiline_(scanner->string_is_multiline_),
+        brace_level_(scanner->brace_level_) {}
 
   void CopyTo(Scanner* scanner) {
     scanner->string_delimiter_ = string_delimiter_;
@@ -100,7 +100,7 @@
 
 
 void Scanner::PushContext() {
-  ScanContext* ctx = new(Z) ScanContext(this);
+  ScanContext* ctx = new (Z) ScanContext(this);
   saved_context_ = ctx;
   string_delimiter_ = '\0';
   string_is_multiline_ = false;
@@ -146,9 +146,8 @@
 
 
 bool Scanner::IsHexDigit(int32_t c) {
-  return IsDecimalDigit(c)
-         || (('A' <= c) && (c <= 'F'))
-         || (('a' <= c) && (c <= 'f'));
+  return IsDecimalDigit(c) || (('A' <= c) && (c <= 'F')) ||
+         (('a' <= c) && (c <= 'f'));
 }
 
 
@@ -169,7 +168,7 @@
   if (str.Length() == 0 || !IsIdentStartChar(CallCharAt()(str, 0))) {
     return false;
   }
-  for (int i =  1; i < str.Length(); i++) {
+  for (int i = 1; i < str.Length(); i++) {
     if (!IsIdentChar(CallCharAt()(str, i))) {
       return false;
     }
@@ -192,16 +191,13 @@
   s.Scan();
   tokens[2] = s.current_token();
 
-  if ((tokens[0].kind == Token::kINTEGER) &&
-      (tokens[1].kind == Token::kEOS)) {
+  if ((tokens[0].kind == Token::kINTEGER) && (tokens[1].kind == Token::kEOS)) {
     *is_positive = true;
     *value = tokens[0].literal;
     return true;
   }
-  if (((tokens[0].kind == Token::kADD) ||
-       (tokens[0].kind == Token::kSUB)) &&
-      (tokens[1].kind == Token::kINTEGER) &&
-      (tokens[2].kind == Token::kEOS)) {
+  if (((tokens[0].kind == Token::kADD) || (tokens[0].kind == Token::kSUB)) &&
+      (tokens[1].kind == Token::kINTEGER) && (tokens[2].kind == Token::kEOS)) {
     // Check there is no space between "+/-" and number.
     if ((tokens[0].offset + 1) != tokens[1].offset) {
       return false;
@@ -291,7 +287,7 @@
     }
   }
   current_token_.kind =
-    (nesting_level == 0) ? Token::kWHITESP : Token::kILLEGAL;
+      (nesting_level == 0) ? Token::kWHITESP : Token::kILLEGAL;
 }
 
 
@@ -317,7 +313,7 @@
         int char_pos = 1;
         while ((char_pos < ident_length) &&
                (keyword[char_pos] ==
-                   CallCharAt()(source_, ident_pos + char_pos))) {
+                CallCharAt()(source_, ident_pos + char_pos))) {
           char_pos++;
         }
         if (char_pos == ident_length) {
@@ -374,8 +370,7 @@
       }
     }
     if (((c0_ == 'e') || (c0_ == 'E')) &&
-        (IsDecimalDigit(LookaheadChar(1)) ||
-         (LookaheadChar(1) == '-') ||
+        (IsDecimalDigit(LookaheadChar(1)) || (LookaheadChar(1) == '-') ||
          (LookaheadChar(1) == '+'))) {
       Recognize(Token::kDOUBLE);
       if ((c0_ == '-') || (c0_ == '+')) {
@@ -544,8 +539,8 @@
       // Scanned a string piece.
       ASSERT(string_chars.data() != NULL);
       // Strings are canonicalized: Allocate a symbol.
-      current_token_.literal = &String::ZoneHandle(Z,
-          Symbols::FromUTF32(T, string_chars.data(), string_chars.length()));
+      current_token_.literal = &String::ZoneHandle(
+          Z, Symbols::FromUTF32(T, string_chars.data(), string_chars.length()));
       // Preserve error tokens.
       if (current_token_.kind != Token::kERROR) {
         current_token_.kind = Token::kSTRING;
@@ -553,9 +548,8 @@
       return;
     } else if (c0_ == string_delimiter_) {
       // Check if we are at the end of the string literal.
-      if (!string_is_multiline_ ||
-          ((LookaheadChar(1) == string_delimiter_) &&
-           (LookaheadChar(2) == string_delimiter_))) {
+      if (!string_is_multiline_ || ((LookaheadChar(1) == string_delimiter_) &&
+                                    (LookaheadChar(2) == string_delimiter_))) {
         if (string_is_multiline_) {
           ReadChar();  // Skip two string delimiters.
           ReadChar();
@@ -567,9 +561,9 @@
           Recognize(Token::kSTRING);
           ASSERT(string_chars.data() != NULL);
           // Strings are canonicalized: Allocate a symbol.
-          current_token_.literal = &String::ZoneHandle(Z,
-              Symbols::FromUTF32(T,
-                                 string_chars.data(), string_chars.length()));
+          current_token_.literal =
+              &String::ZoneHandle(Z, Symbols::FromUTF32(T, string_chars.data(),
+                                                        string_chars.length()));
         }
         EndStringLiteral();
         return;
@@ -877,8 +871,8 @@
           char utf8_char[5];
           int len = Utf8::Encode(c0_, utf8_char);
           utf8_char[len] = '\0';
-          OS::SNPrint(msg, sizeof(msg),
-                      "unexpected character: '%s' (U+%04X)\n", utf8_char, c0_);
+          OS::SNPrint(msg, sizeof(msg), "unexpected character: '%s' (U+%04X)\n",
+                      utf8_char, c0_);
           ErrorMsg(msg);
           ReadChar();
         }
@@ -893,8 +887,7 @@
     Scan();
     bool inserted_new_lines = false;
     for (intptr_t diff = current_token_.position.line - prev_token_line_;
-         diff > 0;
-         diff--) {
+         diff > 0; diff--) {
       newline_token_.position.line = current_token_.position.line - diff;
       collector->AddToken(newline_token_);
       inserted_new_lines = true;
@@ -902,11 +895,11 @@
     if (inserted_new_lines &&
         ((current_token_.kind == Token::kINTERPOL_VAR) ||
          (current_token_.kind == Token::kINTERPOL_START))) {
-          // NOTE: If this changes, be sure to update
-          // Script::GenerateLineNumberArray to stay in sync.
-          empty_string_token_.position.line = current_token_.position.line;
-          collector->AddToken(empty_string_token_);
-        }
+      // NOTE: If this changes, be sure to update
+      // Script::GenerateLineNumberArray to stay in sync.
+      empty_string_token_.position.line = current_token_.position.line;
+      collector->AddToken(empty_string_token_);
+    }
     collector->AddToken(current_token_);
     prev_token_line_ = current_token_.position.line;
   } while (current_token_.kind != Token::kEOS);
@@ -921,8 +914,7 @@
     Scan();
     bool inserted_new_lines = false;
     for (intptr_t diff = current_token_.position.line - prev_token_line_;
-         diff > 0;
-         diff--) {
+         diff > 0; diff--) {
       // Advance the index to account for tokens added in ScanAll.
       index++;
       inserted_new_lines = true;
@@ -930,8 +922,8 @@
     if (inserted_new_lines &&
         ((current_token_.kind == Token::kINTERPOL_VAR) ||
          (current_token_.kind == Token::kINTERPOL_START))) {
-          // Advance the index to account for tokens added in ScanAll.
-          index++;
+      // Advance the index to account for tokens added in ScanAll.
+      index++;
     }
     index++;
     prev_token_line_ = current_token_.position.line;
diff --git a/runtime/vm/scanner.h b/runtime/vm/scanner.h
index 30bc81e..d26b989 100644
--- a/runtime/vm/scanner.h
+++ b/runtime/vm/scanner.h
@@ -6,8 +6,8 @@
 // and produces a stream of tokens which is used by the parser.
 //
 
-#ifndef VM_SCANNER_H_
-#define VM_SCANNER_H_
+#ifndef RUNTIME_VM_SCANNER_H_
+#define RUNTIME_VM_SCANNER_H_
 
 #include "vm/growable_array.h"
 #include "vm/token.h"
@@ -46,9 +46,10 @@
 
   class TokenCollector : public ValueObject {
    public:
-    TokenCollector() { }
-    virtual ~TokenCollector() { }
-    virtual void AddToken(const TokenDescriptor& token) { }
+    TokenCollector() {}
+    virtual ~TokenCollector() {}
+    virtual void AddToken(const TokenDescriptor& token) {}
+
    private:
     DISALLOW_COPY_AND_ASSIGN(TokenCollector);
   };
@@ -166,12 +167,8 @@
 
   // Reads identifier.
   void ScanIdentChars(bool allow_dollar);
-  void ScanIdent() {
-    ScanIdentChars(true);
-  }
-  void ScanIdentNoDollar() {
-    ScanIdentChars(false);
-  }
+  void ScanIdent() { ScanIdentChars(true); }
+  void ScanIdentNoDollar() { ScanIdentChars(false); }
 
   // Reads a number literal.
   void ScanNumber(bool dec_point_seen);
@@ -183,17 +180,17 @@
   Thread* thread() const { return thread_; }
   Zone* zone() const { return zone_; }
 
-  TokenDescriptor current_token_;  // Current token.
-  TokenDescriptor newline_token_;  // Newline token.
+  TokenDescriptor current_token_;       // Current token.
+  TokenDescriptor newline_token_;       // Newline token.
   TokenDescriptor empty_string_token_;  // Token for "".
-  const String& source_;           // The source text being tokenized.
-  intptr_t source_length_;         // The length of the source text.
-  intptr_t lookahead_pos_;         // Position of lookahead character
-                                   // within source_.
-  intptr_t token_start_;           // Begin of current token in src_.
-  int32_t c0_;                     // Lookahead character.
-  bool newline_seen_;              // Newline before current token.
-  intptr_t prev_token_line_;       // Line number of the previous token.
+  const String& source_;                // The source text being tokenized.
+  intptr_t source_length_;              // The length of the source text.
+  intptr_t lookahead_pos_;              // Position of lookahead character
+                                        // within source_.
+  intptr_t token_start_;                // Begin of current token in src_.
+  int32_t c0_;                          // Lookahead character.
+  bool newline_seen_;                   // Newline before current token.
+  intptr_t prev_token_line_;            // Line number of the previous token.
 
   // The following fields keep track whether we are scanning a string literal
   // and its interpolated expressions.
@@ -204,7 +201,7 @@
 
   const String& private_key_;
 
-  SourcePosition c0_pos_;      // Source position of lookahead character c0_.
+  SourcePosition c0_pos_;  // Source position of lookahead character c0_.
 
   const CharAtFunc char_at_func_;
 
@@ -218,4 +215,4 @@
 
 }  // namespace dart
 
-#endif  // VM_SCANNER_H_
+#endif  // RUNTIME_VM_SCANNER_H_
diff --git a/runtime/vm/scanner_test.cc b/runtime/vm/scanner_test.cc
index b6d4d23..f934c54 100644
--- a/runtime/vm/scanner_test.cc
+++ b/runtime/vm/scanner_test.cc
@@ -15,9 +15,8 @@
 
 
 static void LogTokenDesc(Scanner::TokenDescriptor token) {
-  OS::Print("pos %2d:%d-%d token %s  ",
-            token.position.line, token.position.column,
-            token.position.column,
+  OS::Print("pos %2d:%d-%d token %s  ", token.position.line,
+            token.position.column, token.position.column,
             Token::Name(token.kind));
   if (token.literal != NULL) {
     OS::Print("%s", token.literal->ToCString());
@@ -39,73 +38,73 @@
 }
 
 
-static void CheckKind(const GrowableTokenStream &token_stream,
-               int index,
-               Token::Kind kind) {
+static void CheckKind(const GrowableTokenStream& token_stream,
+                      int index,
+                      Token::Kind kind) {
   if (token_stream[index].kind != kind) {
     OS::PrintErr("Token %d: expected kind %s but got %s\n", index,
-        Token::Name(kind), Token::Name(token_stream[index].kind));
+                 Token::Name(kind), Token::Name(token_stream[index].kind));
   }
   EXPECT_EQ(kind, token_stream[index].kind);
 }
 
 
 static void CheckLiteral(const GrowableTokenStream& token_stream,
-                 int index,
-                 const char* literal) {
+                         int index,
+                         const char* literal) {
   if (token_stream[index].literal == NULL) {
-    OS::PrintErr("Token %d: expected literal \"%s\" but got nothing\n",
-                 index, literal);
+    OS::PrintErr("Token %d: expected literal \"%s\" but got nothing\n", index,
+                 literal);
   } else if (strcmp(literal, token_stream[index].literal->ToCString())) {
-    OS::PrintErr("Token %d: expected literal \"%s\" but got \"%s\"\n",
-                 index, literal, token_stream[index].literal->ToCString());
+    OS::PrintErr("Token %d: expected literal \"%s\" but got \"%s\"\n", index,
+                 literal, token_stream[index].literal->ToCString());
   }
 }
 
 
 static void CheckIdent(const GrowableTokenStream& token_stream,
-               int index,
-               const char* literal) {
+                       int index,
+                       const char* literal) {
   CheckKind(token_stream, index, Token::kIDENT);
   CheckLiteral(token_stream, index, literal);
 }
 
 
 static void CheckInteger(const GrowableTokenStream& token_stream,
-                 int index,
-                 const char* literal) {
+                         int index,
+                         const char* literal) {
   CheckKind(token_stream, index, Token::kINTEGER);
   CheckLiteral(token_stream, index, literal);
 }
 
 
 static void CheckLineNumber(const GrowableTokenStream& token_stream,
-                     int index,
-                     int line_number) {
+                            int index,
+                            int line_number) {
   if (token_stream[index].position.line != line_number) {
-    OS::PrintErr("Token %d: expected line number %d but got %d\n",
-        index, line_number, token_stream[index].position.line);
+    OS::PrintErr("Token %d: expected line number %d but got %d\n", index,
+                 line_number, token_stream[index].position.line);
   }
 }
 
 
-static void CheckNumTokens(const GrowableTokenStream& token_stream,
-                    int index) {
+static void CheckNumTokens(const GrowableTokenStream& token_stream, int index) {
   if (token_stream.length() != index) {
-    OS::PrintErr("Expected %d tokens but got only %" Pd ".\n",
-        index, token_stream.length());
+    OS::PrintErr("Expected %d tokens but got only %" Pd ".\n", index,
+                 token_stream.length());
   }
 }
 
 
 class Collector : public Scanner::TokenCollector {
  public:
-  explicit Collector(GrowableTokenStream* ts) : ts_(ts) { }
-  virtual ~Collector() { }
+  explicit Collector(GrowableTokenStream* ts) : ts_(ts) {}
+  virtual ~Collector() {}
 
   virtual void AddToken(const Scanner::TokenDescriptor& token) {
     ts_->Add(token);
   }
+
  private:
   GrowableTokenStream* ts_;
 };
@@ -138,9 +137,9 @@
 
 
 static void CommentTest() {
-  const GrowableTokenStream& tokens =
-      Scan("Foo( /*block \n"
-           "comment*/ 0xff) // line comment;");
+  const GrowableTokenStream& tokens = Scan(
+      "Foo( /*block \n"
+      "comment*/ 0xff) // line comment;");
 
   CheckNumTokens(tokens, 6);
   CheckIdent(tokens, 0, "Foo");
@@ -192,15 +191,13 @@
 
 
 static void InvalidStringEscapes() {
-  const GrowableTokenStream& out_of_range_low =
-      Scan("\"\\u{110000}\"");
+  const GrowableTokenStream& out_of_range_low = Scan("\"\\u{110000}\"");
   EXPECT_EQ(2, out_of_range_low.length());
   CheckKind(out_of_range_low, 0, Token::kERROR);
   EXPECT(out_of_range_low[0].literal->Equals("invalid code point"));
   CheckKind(out_of_range_low, 1, Token::kEOS);
 
-  const GrowableTokenStream& out_of_range_high =
-      Scan("\"\\u{FFFFFF}\"");
+  const GrowableTokenStream& out_of_range_high = Scan("\"\\u{FFFFFF}\"");
   EXPECT_EQ(2, out_of_range_high.length());
   CheckKind(out_of_range_high, 0, Token::kERROR);
   EXPECT(out_of_range_high[0].literal->Equals("invalid code point"));
@@ -223,7 +220,7 @@
 
   EXPECT_EQ('\\', litchars[0]);
   EXPECT_EQ('\'', litchars[1]);
-  EXPECT_EQ(' ',  litchars[2]);
+  EXPECT_EQ(' ', litchars[2]);
   EXPECT_EQ('\\', litchars[3]);
   EXPECT_EQ('\\', litchars[4]);
 }
@@ -248,12 +245,12 @@
   const char* litchars = (tokens)[2].literal->ToCString();
   EXPECT_EQ(6, (tokens)[2].literal->Length());
 
-  EXPECT_EQ('1',  litchars[0]);  // First newline is dropped.
+  EXPECT_EQ('1', litchars[0]);  // First newline is dropped.
   EXPECT_EQ('\'', litchars[1]);
-  EXPECT_EQ(' ',  litchars[2]);
-  EXPECT_EQ('x',  litchars[3]);
+  EXPECT_EQ(' ', litchars[2]);
+  EXPECT_EQ('x', litchars[3]);
   EXPECT_EQ('\n', litchars[4]);
-  EXPECT_EQ('2',  litchars[5]);
+  EXPECT_EQ('2', litchars[5]);
 }
 
 
@@ -285,8 +282,7 @@
 
 
 static void NumberLiteral() {
-  const GrowableTokenStream& tokens =
-      Scan("5 0x5d 0.3 0.33 1E+12 .42 +5");
+  const GrowableTokenStream& tokens = Scan("5 0x5d 0.3 0.33 1E+12 .42 +5");
 
   CheckKind(tokens, 0, Token::kINTEGER);
   CheckKind(tokens, 1, Token::kINTEGER);
@@ -365,8 +361,7 @@
 
 
 void InvalidText() {
-  const GrowableTokenStream& tokens =
-      Scan("\\");
+  const GrowableTokenStream& tokens = Scan("\\");
 
   EXPECT_EQ(2, tokens.length());
   CheckKind(tokens, 0, Token::kERROR);
@@ -400,9 +395,9 @@
 
   EXPECT_EQ(4, (tokens)[5].literal->Length());
   const char* litchars = (tokens)[5].literal->ToCString();
-  EXPECT_EQ('c',  litchars[0]);  // First newline is dropped.
+  EXPECT_EQ('c', litchars[0]);  // First newline is dropped.
   EXPECT_EQ('\n', litchars[1]);
-  EXPECT_EQ('d',  litchars[2]);
+  EXPECT_EQ('d', litchars[2]);
   EXPECT_EQ('\n', litchars[3]);
 }
 
diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc
index fe366b0..69d09cb 100644
--- a/runtime/vm/scavenger.cc
+++ b/runtime/vm/scavenger.cc
@@ -22,10 +22,14 @@
 
 namespace dart {
 
-DEFINE_FLAG(int, early_tenuring_threshold, 66,
+DEFINE_FLAG(int,
+            early_tenuring_threshold,
+            66,
             "When more than this percentage of promotion candidates survive, "
             "promote all survivors of next scavenge.");
-DEFINE_FLAG(int, new_gen_garbage_threshold, 90,
+DEFINE_FLAG(int,
+            new_gen_garbage_threshold,
+            90,
             "Grow new gen when less than this percentage is garbage.");
 DEFINE_FLAG(int, new_gen_growth_factor, 4, "Grow new gen by this factor.");
 
@@ -72,7 +76,7 @@
         vm_heap_(Dart::vm_isolate()->heap()),
         page_space_(scavenger->heap_->old_space()),
         bytes_promoted_(0),
-        visiting_old_object_(NULL) { }
+        visiting_old_object_(NULL) {}
 
   void VisitPointers(RawObject** first, RawObject** last) {
     ASSERT((visiting_old_object_ != NULL) ||
@@ -159,8 +163,7 @@
       ASSERT(new_addr != 0);
       // Copy the object to the new location.
       memmove(reinterpret_cast<void*>(new_addr),
-              reinterpret_cast<void*>(raw_addr),
-              size);
+              reinterpret_cast<void*>(raw_addr), size);
       // Remember forwarding address.
       ForwardTo(raw_addr, new_addr);
     }
@@ -193,16 +196,16 @@
  public:
   ScavengerWeakVisitor(Thread* thread,
                        Scavenger* scavenger,
-                       FinalizationQueue* finalization_queue) :
-      HandleVisitor(thread),
-      scavenger_(scavenger),
-      queue_(finalization_queue) {
+                       FinalizationQueue* finalization_queue)
+      : HandleVisitor(thread),
+        scavenger_(scavenger),
+        queue_(finalization_queue) {
     ASSERT(scavenger->heap_->isolate() == thread->isolate());
   }
 
   void VisitHandle(uword addr) {
     FinalizablePersistentHandle* handle =
-      reinterpret_cast<FinalizablePersistentHandle*>(addr);
+        reinterpret_cast<FinalizablePersistentHandle*>(addr);
     RawObject** p = handle->raw_addr();
     if (scavenger_->IsUnreachable(p)) {
       handle->UpdateUnreachable(thread()->isolate(), queue_);
@@ -223,8 +226,7 @@
 // StoreBuffers.
 class VerifyStoreBufferPointerVisitor : public ObjectPointerVisitor {
  public:
-  VerifyStoreBufferPointerVisitor(Isolate* isolate,
-                                  const SemiSpace* to)
+  VerifyStoreBufferPointerVisitor(Isolate* isolate, const SemiSpace* to)
       : ObjectPointerVisitor(isolate), to_(to) {}
 
   void VisitPointers(RawObject** first, RawObject** last) {
@@ -254,8 +256,8 @@
 SemiSpace::~SemiSpace() {
   if (reserved_ != NULL) {
 #if defined(DEBUG)
-    memset(reserved_->address(), Heap::kZapByte,
-           size_in_words() << kWordSizeLog2);
+    memset(reserved_->address(), Heap::kZapByte, size_in_words()
+                                                     << kWordSizeLog2);
 #endif  // defined(DEBUG)
     delete reserved_;
   }
@@ -320,8 +322,8 @@
 
 void SemiSpace::WriteProtect(bool read_only) {
   if (reserved_ != NULL) {
-    bool success = reserved_->Protect(
-        read_only ? VirtualMemory::kReadOnly : VirtualMemory::kReadWrite);
+    bool success = reserved_->Protect(read_only ? VirtualMemory::kReadOnly
+                                                : VirtualMemory::kReadWrite);
     ASSERT(success);
   }
 }
@@ -343,11 +345,12 @@
   ASSERT(Object::tags_offset() == 0);
 
   // Set initial size resulting in a total of three different levels.
-  const intptr_t initial_semi_capacity_in_words = max_semi_capacity_in_words /
+  const intptr_t initial_semi_capacity_in_words =
+      max_semi_capacity_in_words /
       (FLAG_new_gen_growth_factor * FLAG_new_gen_growth_factor);
   to_ = SemiSpace::New(initial_semi_capacity_in_words);
   if (to_ == NULL) {
-    FATAL("Out of memory.\n");
+    OUT_OF_MEMORY();
   }
   // Setup local fields.
   top_ = FirstObjectStart();
@@ -358,9 +361,6 @@
 
   UpdateMaxHeapCapacity();
   UpdateMaxHeapUsage();
-  if (heap_ != NULL) {
-    heap_->UpdateGlobalMaxUsed();
-  }
 }
 
 
@@ -396,7 +396,7 @@
   if (to_ == NULL) {
     // TODO(koda): We could try to recover (collect old space, wait for another
     // isolate to finish scavenge, etc.).
-    FATAL("Out of memory.\n");
+    OUT_OF_MEMORY();
   }
   UpdateMaxHeapCapacity();
   top_ = FirstObjectStart();
@@ -546,8 +546,7 @@
 
 void Scavenger::ProcessToSpace(ScavengerVisitor* visitor) {
   // Iterate until all work has been drained.
-  while ((resolved_top_ < top_) ||
-         PromotedStackHasMore()) {
+  while ((resolved_top_ < top_) || PromotedStackHasMore()) {
     while (resolved_top_ < top_) {
       RawObject* raw_obj = RawObject::FromAddr(resolved_top_);
       intptr_t class_id = raw_obj->GetClassId();
@@ -616,8 +615,8 @@
   ASSERT(heap_ != NULL);
   Isolate* isolate = heap_->isolate();
   ASSERT(isolate != NULL);
-  isolate->GetHeapNewCapacityMaxMetric()->SetValue(
-      to_->size_in_words() * kWordSize);
+  isolate->GetHeapNewCapacityMaxMetric()->SetValue(to_->size_in_words() *
+                                                   kWordSize);
 }
 
 
@@ -638,11 +637,11 @@
   ASSERT(raw_weak->IsHeapObject());
   ASSERT(raw_weak->IsNewObject());
   ASSERT(raw_weak->IsWeakProperty());
-  DEBUG_ONLY(
-      uword raw_addr = RawObject::ToAddr(raw_weak);
-      uword header = *reinterpret_cast<uword*>(raw_addr);
-      ASSERT(!IsForwarding(header));
-  )
+#if defined(DEBUG)
+  uword raw_addr = RawObject::ToAddr(raw_weak);
+  uword header = *reinterpret_cast<uword*>(raw_addr);
+  ASSERT(!IsForwarding(header));
+#endif  // defined(DEBUG)
   ASSERT(raw_weak->ptr()->next_ == 0);
   raw_weak->ptr()->next_ = reinterpret_cast<uword>(delayed_weak_properties_);
   delayed_weak_properties_ = raw_weak;
@@ -669,13 +668,10 @@
 
 void Scavenger::ProcessWeakReferences() {
   // Rehash the weak tables now that we know which objects survive this cycle.
-  for (int sel = 0;
-       sel < Heap::kNumWeakSelectors;
-       sel++) {
-    WeakTable* table = heap_->GetWeakTable(
-        Heap::kNew, static_cast<Heap::WeakSelector>(sel));
-    heap_->SetWeakTable(Heap::kNew,
-                        static_cast<Heap::WeakSelector>(sel),
+  for (int sel = 0; sel < Heap::kNumWeakSelectors; sel++) {
+    WeakTable* table =
+        heap_->GetWeakTable(Heap::kNew, static_cast<Heap::WeakSelector>(sel));
+    heap_->SetWeakTable(Heap::kNew, static_cast<Heap::WeakSelector>(sel),
                         WeakTable::NewFrom(table));
     intptr_t size = table->size();
     for (intptr_t i = 0; i < size; i++) {
@@ -688,8 +684,7 @@
           // The object has survived.  Preserve its record.
           uword new_addr = ForwardedAddr(header);
           raw_obj = RawObject::FromAddr(new_addr);
-          heap_->SetWeakEntry(raw_obj,
-                              static_cast<Heap::WeakSelector>(sel),
+          heap_->SetWeakEntry(raw_obj, static_cast<Heap::WeakSelector>(sel),
                               table->ValueAt(i));
         }
       }
@@ -709,14 +704,14 @@
       // Reset the next pointer in the weak property.
       cur_weak->ptr()->next_ = 0;
 
-      DEBUG_ONLY(
-          RawObject* raw_key = cur_weak->ptr()->key_;
-          uword raw_addr = RawObject::ToAddr(raw_key);
-          uword header = *reinterpret_cast<uword*>(raw_addr);
-          ASSERT(!IsForwarding(header));
-          ASSERT(raw_key->IsHeapObject());
-          ASSERT(raw_key->IsNewObject());  // Key still points into from space.
-      )
+#if defined(DEBUG)
+      RawObject* raw_key = cur_weak->ptr()->key_;
+      uword raw_addr = RawObject::ToAddr(raw_key);
+      uword header = *reinterpret_cast<uword*>(raw_addr);
+      ASSERT(!IsForwarding(header));
+      ASSERT(raw_key->IsHeapObject());
+      ASSERT(raw_key->IsNewObject());  // Key still points into from space.
+#endif                                 // defined(DEBUG)
 
       WeakProperty::Clear(cur_weak);
 
@@ -839,11 +834,9 @@
     int64_t end = OS::GetCurrentTimeMicros();
     heap_->RecordTime(kProcessToSpace, middle - start);
     heap_->RecordTime(kIterateWeaks, end - middle);
-    stats_history_.Add(
-        ScavengeStats(start, end,
-                      usage_before, GetCurrentUsage(),
-                      promo_candidate_words,
-                      visitor.bytes_promoted() >> kWordSizeLog2));
+    stats_history_.Add(ScavengeStats(
+        start, end, usage_before, GetCurrentUsage(), promo_candidate_words,
+        visitor.bytes_promoted() >> kWordSizeLog2));
   }
   Epilogue(isolate, from, invoke_api_callbacks);
 
diff --git a/runtime/vm/scavenger.h b/runtime/vm/scavenger.h
index 798470c..ee64a06 100644
--- a/runtime/vm/scavenger.h
+++ b/runtime/vm/scavenger.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_SCAVENGER_H_
-#define VM_SCAVENGER_H_
+#ifndef RUNTIME_VM_SCAVENGER_H_
+#define RUNTIME_VM_SCAVENGER_H_
 
 #include "platform/assert.h"
 #include "platform/utils.h"
@@ -71,13 +71,13 @@
                 SpaceUsage before,
                 SpaceUsage after,
                 intptr_t promo_candidates_in_words,
-                intptr_t promoted_in_words) :
-      start_micros_(start_micros),
-      end_micros_(end_micros),
-      before_(before),
-      after_(after),
-      promo_candidates_in_words_(promo_candidates_in_words),
-      promoted_in_words_(promoted_in_words) {}
+                intptr_t promoted_in_words)
+      : start_micros_(start_micros),
+        end_micros_(end_micros),
+        before_(before),
+        after_(after),
+        promo_candidates_in_words_(promo_candidates_in_words),
+        promoted_in_words_(promoted_in_words) {}
 
   // Of all data before scavenge, what fraction was found to be garbage?
   double GarbageFraction() const {
@@ -88,14 +88,13 @@
   // Fraction of promotion candidates that survived and was thereby promoted.
   // Returns zero if there were no promotion candidates.
   double PromoCandidatesSuccessFraction() const {
-    return promo_candidates_in_words_ > 0 ?
-        promoted_in_words_ / static_cast<double>(promo_candidates_in_words_) :
-        0.0;
+    return promo_candidates_in_words_ > 0
+               ? promoted_in_words_ /
+                     static_cast<double>(promo_candidates_in_words_)
+               : 0.0;
   }
 
-  int64_t DurationMicros() const {
-    return end_micros_ - start_micros_;
-  }
+  int64_t DurationMicros() const { return end_micros_ - start_micros_; }
 
  private:
   int64_t start_micros_;
@@ -118,9 +117,7 @@
   // During scavenging both the to and from spaces contain "legal" objects.
   // During a scavenge this function only returns true for addresses that will
   // be part of the surviving objects.
-  bool Contains(uword addr) const {
-    return to_->Contains(addr);
-  }
+  bool Contains(uword addr) const { return to_->Contains(addr); }
 
   RawObject* FindObject(FindObjectVisitor* visitor) const;
 
@@ -165,12 +162,8 @@
   int64_t UsedInWords() const {
     return (top_ - FirstObjectStart()) >> kWordSizeLog2;
   }
-  int64_t CapacityInWords() const {
-    return to_->size_in_words();
-  }
-  int64_t ExternalInWords() const {
-    return external_size_ >> kWordSizeLog2;
-  }
+  int64_t CapacityInWords() const { return to_->size_in_words(); }
+  int64_t ExternalInWords() const { return external_size_ >> kWordSizeLog2; }
   SpaceUsage GetCurrentUsage() const {
     SpaceUsage usage;
     usage.used_in_words = UsedInWords();
@@ -186,21 +179,13 @@
 
   void WriteProtect(bool read_only);
 
-  void AddGCTime(int64_t micros) {
-    gc_time_micros_ += micros;
-  }
+  void AddGCTime(int64_t micros) { gc_time_micros_ += micros; }
 
-  int64_t gc_time_micros() const {
-    return gc_time_micros_;
-  }
+  int64_t gc_time_micros() const { return gc_time_micros_; }
 
-  void IncrementCollections() {
-    collections_++;
-  }
+  void IncrementCollections() { collections_++; }
 
-  intptr_t collections() const {
-    return collections_;
-  }
+  intptr_t collections() const { return collections_; }
 
 #ifndef PRODUCT
   void PrintToJSONObject(JSONObject* object) const;
@@ -312,4 +297,4 @@
 
 }  // namespace dart
 
-#endif  // VM_SCAVENGER_H_
+#endif  // RUNTIME_VM_SCAVENGER_H_
diff --git a/runtime/vm/scavenger_test.cc b/runtime/vm/scavenger_test.cc
index 9776cca..cd8d610 100644
--- a/runtime/vm/scavenger_test.cc
+++ b/runtime/vm/scavenger_test.cc
@@ -12,10 +12,8 @@
 // Expects to visit no objects (since the space should be empty).
 class FailingObjectVisitor : public ObjectVisitor {
  public:
-  FailingObjectVisitor() { }
-  virtual void VisitObject(RawObject* obj) {
-    EXPECT(false);
-  }
+  FailingObjectVisitor() {}
+  virtual void VisitObject(RawObject* obj) { EXPECT(false); }
 };
 
 // Expects to visit no objects (since the space should be empty).
@@ -30,7 +28,7 @@
 // Expects to visit no objects (since the space should be empty).
 class FailingFindObjectVisitor : public FindObjectVisitor {
  public:
-  FailingFindObjectVisitor() { }
+  FailingFindObjectVisitor() {}
   virtual bool FindObject(RawObject* obj) const {
     EXPECT(false);
     return false;
diff --git a/runtime/vm/scope_timer.h b/runtime/vm/scope_timer.h
index c60e67f..1266f29 100644
--- a/runtime/vm/scope_timer.h
+++ b/runtime/vm/scope_timer.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_SCOPE_TIMER_H_
-#define VM_SCOPE_TIMER_H_
+#ifndef RUNTIME_VM_SCOPE_TIMER_H_
+#define RUNTIME_VM_SCOPE_TIMER_H_
 
 #include "platform/globals.h"
 
@@ -13,10 +13,8 @@
 class ScopeTimer : public ValueObject {
  public:
   explicit ScopeTimer(const char* name, bool enabled = true)
-      : enabled_(enabled),
-        name_(name),
-        start_(0) {
-    if (!enabled_)     {
+      : enabled_(enabled), name_(name), start_(0) {
+    if (!enabled_) {
       return;
     }
     start_ = OS::GetCurrentTimeMicros();
@@ -45,4 +43,4 @@
 
 }  // namespace dart
 
-#endif  // VM_SCOPE_TIMER_H_
+#endif  // RUNTIME_VM_SCOPE_TIMER_H_
diff --git a/runtime/vm/scopes.cc b/runtime/vm/scopes.cc
index be2cdda..75f5d68 100644
--- a/runtime/vm/scopes.cc
+++ b/runtime/vm/scopes.cc
@@ -10,7 +10,9 @@
 
 namespace dart {
 
-DEFINE_FLAG(bool, share_enclosing_context, true,
+DEFINE_FLAG(bool,
+            share_enclosing_context,
+            true,
             "Allocate captured variables in the existing context of an "
             "enclosing scope (up to innermost loop) and spare the allocation "
             "of a local context.");
@@ -201,7 +203,7 @@
   ASSERT(num_parameters >= 0);
   // Parameters must be listed first and must all appear in the top scope.
   ASSERT(num_parameters <= num_variables());
-  int pos = 0;  // Current variable position.
+  int pos = 0;                              // Current variable position.
   int frame_index = first_parameter_index;  // Current free frame index.
   while (pos < num_parameters) {
     LocalVariable* parameter = VariableAt(pos);
@@ -241,13 +243,11 @@
   int min_frame_index = frame_index;  // Frame index decreases with allocations.
   LocalScope* child = this->child();
   while (child != NULL) {
-    int const dummy_parameter_index = 0;  // Ignored, since no parameters.
+    int const dummy_parameter_index = 0;    // Ignored, since no parameters.
     int const num_parameters_in_child = 0;  // No parameters in children scopes.
-    int child_frame_index = child->AllocateVariables(dummy_parameter_index,
-                                                     num_parameters_in_child,
-                                                     frame_index,
-                                                     context_owner,
-                                                     found_captured_variables);
+    int child_frame_index = child->AllocateVariables(
+        dummy_parameter_index, num_parameters_in_child, frame_index,
+        context_owner, found_captured_variables);
     if (child_frame_index < min_frame_index) {
       min_frame_index = child_frame_index;
     }
@@ -288,6 +288,7 @@
       desc.name = &name;
       desc.info.set_kind(kind);
       desc.info.scope_id = context_scope.ContextLevelAt(i);
+      desc.info.declaration_pos = context_scope.DeclarationTokenIndexAt(i);
       desc.info.begin_pos = begin_token_pos();
       desc.info.end_pos = end_token_pos();
       ASSERT(desc.info.begin_pos <= desc.info.end_pos);
@@ -336,6 +337,7 @@
         desc.name = &var->name();
         desc.info.set_kind(RawLocalVarDescriptors::kSavedCurrentContext);
         desc.info.scope_id = 0;
+        desc.info.declaration_pos = TokenPosition::kMinSource;
         desc.info.begin_pos = TokenPosition::kMinSource;
         desc.info.end_pos = TokenPosition::kMinSource;
         desc.info.set_index(var->index());
@@ -353,6 +355,7 @@
           desc.info.set_kind(RawLocalVarDescriptors::kStackVar);
           desc.info.scope_id = *scope_id;
         }
+        desc.info.declaration_pos = var->declaration_token_pos();
         desc.info.begin_pos = var->token_pos();
         desc.info.end_pos = var->owner()->end_token_pos();
         desc.info.set_index(var->index());
@@ -459,7 +462,7 @@
           (label->kind() == SourceLabel::kFor) ||
           (label->kind() == SourceLabel::kDoWhile) ||
           ((jump_kind == Token::kBREAK) &&
-              (label->kind() == SourceLabel::kSwitch))) {
+           (label->kind() == SourceLabel::kSwitch))) {
         return label;
       }
     }
@@ -530,8 +533,8 @@
 }
 
 
-RawContextScope* LocalScope::PreserveOuterScope(int current_context_level)
-    const {
+RawContextScope* LocalScope::PreserveOuterScope(
+    int current_context_level) const {
   // Since code generation for nested functions is postponed until first
   // invocation, the function level of the closure scope can only be 1.
   ASSERT(function_level() == 1);
@@ -551,6 +554,8 @@
     // Preserve the aliases of captured variables belonging to outer scopes.
     if (variable->owner()->function_level() != 1) {
       context_scope.SetTokenIndexAt(captured_idx, variable->token_pos());
+      context_scope.SetDeclarationTokenIndexAt(
+          captured_idx, variable->declaration_token_pos());
       context_scope.SetNameAt(captured_idx, variable->name());
       context_scope.SetIsFinalAt(captured_idx, variable->is_final());
       context_scope.SetIsConstAt(captured_idx, variable->IsConst());
@@ -582,15 +587,18 @@
   for (int i = 0; i < context_scope.num_variables(); i++) {
     LocalVariable* variable;
     if (context_scope.IsConstAt(i)) {
-      variable = new LocalVariable(context_scope.TokenIndexAt(i),
-          String::ZoneHandle(context_scope.NameAt(i)),
-          Object::dynamic_type());
+      variable = new LocalVariable(context_scope.DeclarationTokenIndexAt(i),
+                                   context_scope.TokenIndexAt(i),
+                                   String::ZoneHandle(context_scope.NameAt(i)),
+                                   Object::dynamic_type());
       variable->SetConstValue(
           Instance::ZoneHandle(context_scope.ConstValueAt(i)));
     } else {
-      variable = new LocalVariable(context_scope.TokenIndexAt(i),
-          String::ZoneHandle(context_scope.NameAt(i)),
-          AbstractType::ZoneHandle(context_scope.TypeAt(i)));
+      variable =
+          new LocalVariable(context_scope.DeclarationTokenIndexAt(i),
+                            context_scope.TokenIndexAt(i),
+                            String::ZoneHandle(context_scope.NameAt(i)),
+                            AbstractType::ZoneHandle(context_scope.TypeAt(i)));
     }
     variable->set_is_captured();
     variable->set_index(context_scope.ContextIndexAt(i));
@@ -616,7 +624,8 @@
   while (scope != top_scope->parent()) {
     for (intptr_t i = 0; i < scope->num_variables(); i++) {
       LocalVariable* variable = scope->VariableAt(i);
-      if ((variable->name().raw() == Symbols::StackTraceVar().raw()) ||
+      if (variable->is_forced_stack() ||
+          (variable->name().raw() == Symbols::StackTraceVar().raw()) ||
           (variable->name().raw() == Symbols::ExceptionVar().raw()) ||
           (variable->name().raw() == Symbols::SavedTryContextVar().raw())) {
         // Don't capture those variables because the VM expects them to be on
@@ -639,6 +648,7 @@
 
   // Create a descriptor for 'this' variable.
   context_scope.SetTokenIndexAt(0, func.token_pos());
+  context_scope.SetDeclarationTokenIndexAt(0, func.token_pos());
   context_scope.SetNameAt(0, Symbols::This());
   context_scope.SetIsFinalAt(0, true);
   context_scope.SetIsConstAt(0, false);
diff --git a/runtime/vm/scopes.h b/runtime/vm/scopes.h
index c2fbfe0..688050a 100644
--- a/runtime/vm/scopes.h
+++ b/runtime/vm/scopes.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_SCOPES_H_
-#define VM_SCOPES_H_
+#ifndef RUNTIME_VM_SCOPES_H_
+#define RUNTIME_VM_SCOPES_H_
 
 #include "platform/assert.h"
 #include "platform/globals.h"
@@ -21,25 +21,29 @@
 
 class LocalVariable : public ZoneAllocated {
  public:
-  LocalVariable(TokenPosition token_pos,
+  LocalVariable(TokenPosition declaration_pos,
+                TokenPosition token_pos,
                 const String& name,
                 const AbstractType& type)
-    : token_pos_(token_pos),
-      name_(name),
-      owner_(NULL),
-      type_(type),
-      const_value_(NULL),
-      is_final_(false),
-      is_captured_(false),
-      is_invisible_(false),
-      is_captured_parameter_(false),
-      index_(LocalVariable::kUninitializedIndex) {
+      : declaration_pos_(declaration_pos),
+        token_pos_(token_pos),
+        name_(name),
+        owner_(NULL),
+        type_(type),
+        const_value_(NULL),
+        is_final_(false),
+        is_captured_(false),
+        is_invisible_(false),
+        is_captured_parameter_(false),
+        is_forced_stack_(false),
+        index_(LocalVariable::kUninitializedIndex) {
     ASSERT(type.IsZoneHandle() || type.IsReadOnlyHandle());
     ASSERT(type.IsFinalized());
     ASSERT(name.IsSymbol());
   }
 
   TokenPosition token_pos() const { return token_pos_; }
+  TokenPosition declaration_token_pos() const { return declaration_pos_; }
   const String& name() const { return name_; }
   LocalScope* owner() const { return owner_; }
   void set_owner(LocalScope* owner) {
@@ -55,9 +59,14 @@
   bool is_captured() const { return is_captured_; }
   void set_is_captured() { is_captured_ = true; }
 
-  bool HasIndex() const {
-    return index_ != kUninitializedIndex;
-  }
+  // Variables marked as forced to stack are skipped and not captured by
+  // CaptureLocalVariables - which iterates scope chain between two scopes
+  // and indiscriminately marks all variables as captured.
+  // TODO(27590) remove the hardcoded blacklist from CaptureLocalVariables
+  bool is_forced_stack() const { return is_forced_stack_; }
+  void set_is_forced_stack() { is_forced_stack_ = true; }
+
+  bool HasIndex() const { return index_ != kUninitializedIndex; }
   int index() const {
     ASSERT(HasIndex());
     return index_;
@@ -69,24 +78,16 @@
     index_ = index;
   }
 
-  void set_invisible(bool value) {
-    is_invisible_ = value;
-  }
+  void set_invisible(bool value) { is_invisible_ = value; }
   bool is_invisible() const { return is_invisible_; }
 
   bool is_captured_parameter() const { return is_captured_parameter_; }
-  void set_is_captured_parameter(bool value) {
-    is_captured_parameter_ = value;
-  }
+  void set_is_captured_parameter(bool value) { is_captured_parameter_ = value; }
 
   // By convention, internal variables start with a colon.
-  bool IsInternal() const {
-    return name_.CharAt(0) == ':';
-  }
+  bool IsInternal() const { return name_.CharAt(0) == ':'; }
 
-  bool IsConst() const {
-    return const_value_ != NULL;
-  }
+  bool IsConst() const { return const_value_ != NULL; }
 
   void SetConstValue(const Instance& value) {
     ASSERT(value.IsZoneHandle() || value.IsReadOnlyHandle());
@@ -109,19 +110,21 @@
  private:
   static const int kUninitializedIndex = INT_MIN;
 
+  const TokenPosition declaration_pos_;
   const TokenPosition token_pos_;
   const String& name_;
   LocalScope* owner_;  // Local scope declaring this variable.
 
   const AbstractType& type_;  // Declaration type of local variable.
 
-  const Instance* const_value_;   // NULL or compile-time const value.
+  const Instance* const_value_;  // NULL or compile-time const value.
 
-  bool is_final_;  // If true, this variable is readonly.
+  bool is_final_;     // If true, this variable is readonly.
   bool is_captured_;  // If true, this variable lives in the context, otherwise
                       // in the stack frame.
   bool is_invisible_;
   bool is_captured_parameter_;
+  bool is_forced_stack_;
   int index_;  // Allocation index in words relative to frame pointer (if not
                // captured), or relative to the context pointer (if captured).
 
@@ -133,13 +136,13 @@
 class NameReference : public ZoneAllocated {
  public:
   NameReference(TokenPosition token_pos, const String& name)
-    : token_pos_(token_pos),
-      name_(name) {
+      : token_pos_(token_pos), name_(name) {
     ASSERT(name.IsSymbol());
   }
   const String& name() const { return name_; }
   TokenPosition token_pos() const { return token_pos_; }
   void set_token_pos(TokenPosition value) { token_pos_ = value; }
+
  private:
   TokenPosition token_pos_;
   const String& name_;
@@ -161,10 +164,7 @@
   };
 
   SourceLabel(TokenPosition token_pos, const String& name, Kind kind)
-    : token_pos_(token_pos),
-      name_(name),
-      owner_(NULL),
-      kind_(kind) {
+      : token_pos_(token_pos), name_(name), owner_(NULL), kind_(kind) {
     ASSERT(name.IsSymbol());
   }
 
@@ -172,18 +172,14 @@
     if (name != NULL) {
       return new SourceLabel(token_pos, *name, kind);
     } else {
-      return new SourceLabel(token_pos,
-                             Symbols::DefaultLabel(),
-                             kind);
+      return new SourceLabel(token_pos, Symbols::DefaultLabel(), kind);
     }
   }
 
   TokenPosition token_pos() const { return token_pos_; }
   const String& name() const { return name_; }
   LocalScope* owner() const { return owner_; }
-  void set_owner(LocalScope* owner) {
-    owner_ = owner;
-  }
+  void set_owner(LocalScope* owner) { owner_ = owner; }
 
   Kind kind() const { return kind_; }
 
@@ -331,7 +327,7 @@
   RawContextScope* PreserveOuterScope(int current_context_level) const;
 
   // Mark all local variables that are accessible from this scope up to
-  // top_scope (included) as captured.
+  // top_scope (included) as captured unless they are marked as forced to stack.
   void CaptureLocalVariables(LocalScope* top_scope);
 
   // Creates a LocalScope representing the outer scope of a local function to be
@@ -366,10 +362,10 @@
   LocalScope* parent_;
   LocalScope* child_;
   LocalScope* sibling_;
-  int function_level_;  // Reflects the nesting level of local functions.
-  int loop_level_;      // Reflects the loop nesting level.
-  int context_level_;   // Reflects the level of the runtime context.
-  int num_context_variables_;   // Only set if this scope is a context owner.
+  int function_level_;         // Reflects the nesting level of local functions.
+  int loop_level_;             // Reflects the loop nesting level.
+  int context_level_;          // Reflects the level of the runtime context.
+  int num_context_variables_;  // Only set if this scope is a context owner.
   TokenPosition begin_token_pos_;  // Token index of beginning of scope.
   TokenPosition end_token_pos_;    // Token index of end of scope.
   GrowableArray<LocalVariable*> variables_;
@@ -384,4 +380,4 @@
 
 }  // namespace dart
 
-#endif  // VM_SCOPES_H_
+#endif  // RUNTIME_VM_SCOPES_H_
diff --git a/runtime/vm/scopes_test.cc b/runtime/vm/scopes_test.cc
index 807f9f9..f2171a5 100644
--- a/runtime/vm/scopes_test.cc
+++ b/runtime/vm/scopes_test.cc
@@ -13,16 +13,16 @@
   // Allocate a couple of local variables first.
   const Type& dynamic_type = Type::ZoneHandle(Type::DynamicType());
   const String& a = String::ZoneHandle(Symbols::New(thread, "a"));
-  LocalVariable* var_a =
-      new LocalVariable(TokenPosition::kNoSource, a, dynamic_type);
-  LocalVariable* inner_var_a =
-      new LocalVariable(TokenPosition::kNoSource, a, dynamic_type);
+  LocalVariable* var_a = new LocalVariable(
+      TokenPosition::kNoSource, TokenPosition::kNoSource, a, dynamic_type);
+  LocalVariable* inner_var_a = new LocalVariable(
+      TokenPosition::kNoSource, TokenPosition::kNoSource, a, dynamic_type);
   const String& b = String::ZoneHandle(Symbols::New(thread, "b"));
-  LocalVariable* var_b =
-      new LocalVariable(TokenPosition::kNoSource, b, dynamic_type);
+  LocalVariable* var_b = new LocalVariable(
+      TokenPosition::kNoSource, TokenPosition::kNoSource, b, dynamic_type);
   const String& c = String::ZoneHandle(Symbols::New(thread, "c"));
-  LocalVariable* var_c =
-      new LocalVariable(TokenPosition::kNoSource, c, dynamic_type);
+  LocalVariable* var_c = new LocalVariable(
+      TokenPosition::kNoSource, TokenPosition::kNoSource, c, dynamic_type);
   const String& L = String::ZoneHandle(Symbols::New(thread, "L"));
   SourceLabel* label_L =
       new SourceLabel(TokenPosition::kNoSource, L, SourceLabel::kFor);
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index efc5c24..259b2c0 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -48,11 +48,15 @@
 DECLARE_FLAG(bool, trace_service);
 DECLARE_FLAG(bool, trace_service_pause_events);
 DECLARE_FLAG(bool, profile_vm);
-DEFINE_FLAG(charp, vm_name, "vm",
+DEFINE_FLAG(charp,
+            vm_name,
+            "vm",
             "The default name of this vm as reported by the VM service "
             "protocol");
 
-DEFINE_FLAG(bool, warn_on_pause_with_no_debugger, false,
+DEFINE_FLAG(bool,
+            warn_on_pause_with_no_debugger,
+            false,
             "Print a message when an isolate is paused but there is no "
             "debugger attached.");
 
@@ -69,26 +73,21 @@
 }
 
 
-ServiceIdZone::ServiceIdZone() {
-}
+ServiceIdZone::ServiceIdZone() {}
 
 
-ServiceIdZone::~ServiceIdZone() {
-}
+ServiceIdZone::~ServiceIdZone() {}
 
 
 RingServiceIdZone::RingServiceIdZone()
-    : ring_(NULL),
-      policy_(ObjectIdRing::kAllocateId) {
-}
+    : ring_(NULL), policy_(ObjectIdRing::kAllocateId) {}
 
 
-RingServiceIdZone::~RingServiceIdZone() {
-}
+RingServiceIdZone::~RingServiceIdZone() {}
 
 
-void RingServiceIdZone::Init(
-    ObjectIdRing* ring, ObjectIdRing::IdPolicy policy) {
+void RingServiceIdZone::Init(ObjectIdRing* ring,
+                             ObjectIdRing::IdPolicy policy) {
   ring_ = ring;
   policy_ = policy;
 }
@@ -128,25 +127,19 @@
 StreamInfo Service::timeline_stream("Timeline");
 
 static StreamInfo* streams_[] = {
-  &Service::vm_stream,
-  &Service::isolate_stream,
-  &Service::debug_stream,
-  &Service::gc_stream,
-  &Service::echo_stream,
-  &Service::graph_stream,
-  &Service::logging_stream,
-  &Service::extension_stream,
-  &Service::timeline_stream,
+    &Service::vm_stream,       &Service::isolate_stream,
+    &Service::debug_stream,    &Service::gc_stream,
+    &Service::echo_stream,     &Service::graph_stream,
+    &Service::logging_stream,  &Service::extension_stream,
+    &Service::timeline_stream,
 };
 
 
 bool Service::ListenStream(const char* stream_id) {
   if (FLAG_trace_service) {
-    OS::Print("vm-service: starting stream '%s'\n",
-              stream_id);
+    OS::Print("vm-service: starting stream '%s'\n", stream_id);
   }
-  intptr_t num_streams = sizeof(streams_) /
-                         sizeof(streams_[0]);
+  intptr_t num_streams = sizeof(streams_) / sizeof(streams_[0]);
   for (intptr_t i = 0; i < num_streams; i++) {
     if (strcmp(stream_id, streams_[i]->id()) == 0) {
       streams_[i]->set_enabled(true);
@@ -164,11 +157,9 @@
 
 void Service::CancelStream(const char* stream_id) {
   if (FLAG_trace_service) {
-    OS::Print("vm-service: stopping stream '%s'\n",
-              stream_id);
+    OS::Print("vm-service: stopping stream '%s'\n", stream_id);
   }
-  intptr_t num_streams = sizeof(streams_) /
-                         sizeof(streams_[0]);
+  intptr_t num_streams = sizeof(streams_) / sizeof(streams_[0]);
   for (intptr_t i = 0; i < num_streams; i++) {
     if (strcmp(stream_id, streams_[i]->id()) == 0) {
       streams_[i]->set_enabled(false);
@@ -198,20 +189,18 @@
     return Object::null();
   }
   if (!object.IsTypedData()) {
-    const String& error_message =
-        String::Handle(
-            String::New("An implementation of Dart_GetVMServiceAssetsArchive "
-                        "should return a Uint8Array or null."));
+    const String& error_message = String::Handle(
+        String::New("An implementation of Dart_GetVMServiceAssetsArchive "
+                    "should return a Uint8Array or null."));
     const Error& error = Error::Handle(ApiError::New(error_message));
     Exceptions::PropagateError(error);
     return Object::null();
   }
   const TypedData& typed_data = TypedData::Cast(object);
   if (typed_data.ElementSizeInBytes() != 1) {
-    const String& error_message =
-        String::Handle(
-            String::New("An implementation of Dart_GetVMServiceAssetsArchive "
-                        "should return a Uint8Array or null."));
+    const String& error_message = String::Handle(
+        String::New("An implementation of Dart_GetVMServiceAssetsArchive "
+                    "should return a Uint8Array or null."));
     const Error& error = Error::Handle(ApiError::New(error_message));
     Exceptions::PropagateError(error);
     return Object::null();
@@ -222,30 +211,28 @@
 
 static uint8_t* allocator(uint8_t* ptr, intptr_t old_size, intptr_t new_size) {
   void* new_ptr = realloc(reinterpret_cast<void*>(ptr), new_size);
+  if (new_ptr == NULL) {
+    OUT_OF_MEMORY();
+  }
   return reinterpret_cast<uint8_t*>(new_ptr);
 }
 
 
-static void PrintMissingParamError(JSONStream* js,
-                                   const char* param) {
-  js->PrintError(kInvalidParams,
-                 "%s expects the '%s' parameter", js->method(), param);
+static void PrintMissingParamError(JSONStream* js, const char* param) {
+  js->PrintError(kInvalidParams, "%s expects the '%s' parameter", js->method(),
+                 param);
 }
 
 
-static void PrintInvalidParamError(JSONStream* js,
-                                   const char* param) {
-  js->PrintError(kInvalidParams,
-                 "%s: invalid '%s' parameter: %s",
-                 js->method(), param, js->LookupParam(param));
+static void PrintInvalidParamError(JSONStream* js, const char* param) {
+  js->PrintError(kInvalidParams, "%s: invalid '%s' parameter: %s", js->method(),
+                 param, js->LookupParam(param));
 }
 
 
-static void PrintIllegalParamError(JSONStream* js,
-                                   const char* param) {
-  js->PrintError(kInvalidParams,
-                 "%s: illegal '%s' parameter: %s",
-                 js->method(), param, js->LookupParam(param));
+static void PrintIllegalParamError(JSONStream* js, const char* param) {
+  js->PrintError(kInvalidParams, "%s: illegal '%s' parameter: %s", js->method(),
+                 param, js->LookupParam(param));
 }
 
 
@@ -413,26 +400,17 @@
 class MethodParameter {
  public:
   MethodParameter(const char* name, bool required)
-      : name_(name), required_(required) {
-  }
+      : name_(name), required_(required) {}
 
-  virtual ~MethodParameter() { }
+  virtual ~MethodParameter() {}
 
-  virtual bool Validate(const char* value) const {
-    return true;
-  }
+  virtual bool Validate(const char* value) const { return true; }
 
-  virtual bool ValidateObject(const Object& value) const {
-    return true;
-  }
+  virtual bool ValidateObject(const Object& value) const { return true; }
 
-  const char* name() const {
-    return name_;
-  }
+  const char* name() const { return name_; }
 
-  bool required() const {
-    return required_;
-  }
+  bool required() const { return required_; }
 
   virtual void PrintError(const char* name,
                           const char* value,
@@ -455,8 +433,7 @@
 class DartStringParameter : public MethodParameter {
  public:
   DartStringParameter(const char* name, bool required)
-      : MethodParameter(name, required) {
-  }
+      : MethodParameter(name, required) {}
 
   virtual bool ValidateObject(const Object& value) const {
     return value.IsString();
@@ -467,8 +444,7 @@
 class DartListParameter : public MethodParameter {
  public:
   DartListParameter(const char* name, bool required)
-      : MethodParameter(name, required) {
-  }
+      : MethodParameter(name, required) {}
 
   virtual bool ValidateObject(const Object& value) const {
     return value.IsArray() || value.IsGrowableObjectArray();
@@ -478,13 +454,9 @@
 
 class NoSuchParameter : public MethodParameter {
  public:
-  explicit NoSuchParameter(const char* name)
-    : MethodParameter(name, false) {
-  }
+  explicit NoSuchParameter(const char* name) : MethodParameter(name, false) {}
 
-  virtual bool Validate(const char* value) const {
-    return (value == NULL);
-  }
+  virtual bool Validate(const char* value) const { return (value == NULL); }
 
   virtual bool ValidateObject(const Object& value) const {
     return value.IsNull();
@@ -495,8 +467,7 @@
 class BoolParameter : public MethodParameter {
  public:
   BoolParameter(const char* name, bool required)
-      : MethodParameter(name, required) {
-  }
+      : MethodParameter(name, required) {}
 
   virtual bool Validate(const char* value) const {
     if (value == NULL) {
@@ -517,8 +488,7 @@
 class UIntParameter : public MethodParameter {
  public:
   UIntParameter(const char* name, bool required)
-      : MethodParameter(name, required) {
-  }
+      : MethodParameter(name, required) {}
 
   virtual bool Validate(const char* value) const {
     if (value == NULL) {
@@ -547,8 +517,7 @@
 class Int64Parameter : public MethodParameter {
  public:
   Int64Parameter(const char* name, bool required)
-      : MethodParameter(name, required) {
-  }
+      : MethodParameter(name, required) {}
 
   virtual bool Validate(const char* value) const {
     if (value == NULL) {
@@ -577,20 +546,25 @@
 class IdParameter : public MethodParameter {
  public:
   IdParameter(const char* name, bool required)
-      : MethodParameter(name, required) {
-  }
+      : MethodParameter(name, required) {}
 
-  virtual bool Validate(const char* value) const {
-    return (value != NULL);
-  }
+  virtual bool Validate(const char* value) const { return (value != NULL); }
+};
+
+
+class StringParameter : public MethodParameter {
+ public:
+  StringParameter(const char* name, bool required)
+      : MethodParameter(name, required) {}
+
+  virtual bool Validate(const char* value) const { return (value != NULL); }
 };
 
 
 class RunnableIsolateParameter : public MethodParameter {
  public:
   explicit RunnableIsolateParameter(const char* name)
-      : MethodParameter(name, true) {
-  }
+      : MethodParameter(name, true) {}
 
   virtual bool Validate(const char* value) const {
     Isolate* isolate = Isolate::Current();
@@ -613,9 +587,7 @@
 class EnumParameter : public MethodParameter {
  public:
   EnumParameter(const char* name, bool required, const char* const* enums)
-      : MethodParameter(name, required),
-        enums_(enums) {
-  }
+      : MethodParameter(name, required), enums_(enums) {}
 
   virtual bool Validate(const char* value) const {
     if (value == NULL) {
@@ -636,7 +608,7 @@
 
 // If the key is not found, this function returns the last element in the
 // values array. This can be used to encode the default value.
-template<typename T>
+template <typename T>
 T EnumMapper(const char* value, const char* const* enums, T* values) {
   ASSERT(value != NULL);
   intptr_t i = 0;
@@ -653,9 +625,7 @@
 class EnumListParameter : public MethodParameter {
  public:
   EnumListParameter(const char* name, bool required, const char* const* enums)
-      : MethodParameter(name, required),
-        enums_(enums) {
-  }
+      : MethodParameter(name, required), enums_(enums) {}
 
   virtual bool Validate(const char* value) const {
     return ElementCount(value) >= 0;
@@ -692,8 +662,7 @@
  private:
   // For now observatory enums are ascii letters plus underscore.
   static bool IsEnumChar(char c) {
-    return (((c >= 'a') && (c <= 'z')) ||
-            ((c >= 'A') && (c <= 'Z')) ||
+    return (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')) ||
             (c == '_'));
   }
 
@@ -774,13 +743,13 @@
 struct ServiceMethodDescriptor {
   const char* name;
   const ServiceMethodEntry entry;
-  const MethodParameter* const * parameters;
+  const MethodParameter* const* parameters;
 };
 
 
 // TODO(johnmccutchan): Do we reject unexpected parameters?
 static bool ValidateParameters(const MethodParameter* const* parameters,
-                              JSONStream* js) {
+                               JSONStream* js) {
   if (parameters == NULL) {
     return true;
   }
@@ -832,11 +801,10 @@
   StackZone zone(T);
   HANDLESCOPE(T);
   JSONStream js;
-  js.Setup(zone.GetZone(), SendPort::Cast(reply_port).Id(),
-           id, method_name, parameter_keys, parameter_values);
-  js.PrintError(kExtensionError,
-                "Error in extension `%s`: %s",
-                js.method(), error.ToErrorCString());
+  js.Setup(zone.GetZone(), SendPort::Cast(reply_port).Id(), id, method_name,
+           parameter_keys, parameter_values);
+  js.PrintError(kExtensionError, "Error in extension `%s`: %s", js.method(),
+                error.ToErrorCString());
   js.PostReply();
 }
 
@@ -877,12 +845,8 @@
     }
 
     JSONStream js;
-    js.Setup(zone.GetZone(), SendPort::Cast(reply_port).Id(),
-             seq,
-             method_name,
-             param_keys,
-             param_values,
-             parameters_are_dart_objects);
+    js.Setup(zone.GetZone(), SendPort::Cast(reply_port).Id(), seq, method_name,
+             param_keys, param_values, parameters_are_dart_objects);
 
     // RPC came in with a custom service id zone.
     const char* id_zone_param = js.LookupParam("_idZone");
@@ -935,15 +899,11 @@
       return;
     }
 
-    const Instance& extension_handler = Instance::Handle(Z,
-        I->LookupServiceExtensionHandler(method_name));
+    const Instance& extension_handler =
+        Instance::Handle(Z, I->LookupServiceExtensionHandler(method_name));
     if (!extension_handler.IsNull()) {
-      ScheduleExtensionHandler(extension_handler,
-                               method_name,
-                               param_keys,
-                               param_values,
-                               reply_port,
-                               seq);
+      ScheduleExtensionHandler(extension_handler, method_name, param_keys,
+                               param_values, reply_port, seq);
       // Schedule was successful. Extension code will post a reply
       // asynchronously.
       return;
@@ -971,6 +931,7 @@
 void Service::HandleIsolateMessage(Isolate* isolate, const Array& msg) {
   ASSERT(isolate != NULL);
   InvokeMethod(isolate, msg);
+  MaybePause(isolate);
 }
 
 
@@ -991,9 +952,10 @@
   ASSERT(!ServiceIsolate::IsServiceIsolateDescendant(isolate));
 
   if (FLAG_trace_service) {
-    OS::Print("vm-service: Pushing ServiceEvent(isolate='%s', kind='%s',"
-              " len=%" Pd ") to stream %s\n",
-              isolate->name(), event_type, bytes_length, stream_id);
+    OS::Print(
+        "vm-service: Pushing ServiceEvent(isolate='%s', kind='%s',"
+        " len=%" Pd ") to stream %s\n",
+        isolate->name(), event_type, bytes_length, stream_id);
   }
 
   bool result;
@@ -1037,6 +999,9 @@
   const intptr_t total_bytes = sizeof(uint64_t) + metadata_size + data_size;
 
   uint8_t* message = static_cast<uint8_t*>(malloc(total_bytes));
+  if (message == NULL) {
+    OUT_OF_MEMORY();
+  }
   intptr_t offset = 0;
 
   // Metadata size.
@@ -1059,32 +1024,42 @@
 
 static void ReportPauseOnConsole(ServiceEvent* event) {
   const char* name = event->isolate()->debugger_name();
-  switch (event->kind())  {
+  switch (event->kind()) {
     case ServiceEvent::kPauseStart:
       OS::PrintErr(
           "vm-service: isolate '%s' has no debugger attached and is paused at "
-          "start.", name);
+          "start.",
+          name);
       break;
     case ServiceEvent::kPauseExit:
       OS::PrintErr(
           "vm-service: isolate '%s' has no debugger attached and is paused at "
-          "exit.", name);
+          "exit.",
+          name);
       break;
     case ServiceEvent::kPauseException:
       OS::PrintErr(
           "vm-service: isolate '%s' has no debugger attached and is paused due "
-          "to exception.", name);
+          "to exception.",
+          name);
       break;
     case ServiceEvent::kPauseInterrupted:
       OS::PrintErr(
           "vm-service: isolate '%s' has no debugger attached and is paused due "
-          "to interrupt.", name);
+          "to interrupt.",
+          name);
       break;
     case ServiceEvent::kPauseBreakpoint:
       OS::PrintErr(
           "vm-service: isolate '%s' has no debugger attached and is paused.",
           name);
       break;
+    case ServiceEvent::kPausePostRequest:
+      OS::PrintErr(
+          "vm-service: isolate '%s' has no debugger attached and is paused "
+          "post reload.",
+          name);
+      break;
     default:
       UNREACHABLE();
       break;
@@ -1105,10 +1080,8 @@
 
 
 void Service::HandleEvent(ServiceEvent* event) {
-  if (event->stream_info() != NULL &&
-      !event->stream_info()->enabled()) {
-    if (FLAG_warn_on_pause_with_no_debugger &&
-        event->IsPause()) {
+  if (event->stream_info() != NULL && !event->stream_info()->enabled()) {
+    if (FLAG_warn_on_pause_with_no_debugger && event->IsPause()) {
       // If we are about to pause a running program which has no
       // debugger connected, tell the user about it.
       ReportPauseOnConsole(event);
@@ -1168,9 +1141,10 @@
     if (isolate != NULL) {
       isolate_name = isolate->name();
     }
-    OS::Print("vm-service: Pushing ServiceEvent(isolate='%s', kind='%s') "
-              "to stream %s\n",
-              isolate_name, kind, stream_id);
+    OS::Print(
+        "vm-service: Pushing ServiceEvent(isolate='%s', kind='%s') "
+        "to stream %s\n",
+        isolate_name, kind, stream_id);
   }
 
   Dart_PostCObject(ServiceIsolate::Port(), &list_cobj);
@@ -1179,17 +1153,13 @@
 
 class EmbedderServiceHandler {
  public:
-  explicit EmbedderServiceHandler(const char* name) : name_(NULL),
-                                                      callback_(NULL),
-                                                      user_data_(NULL),
-                                                      next_(NULL) {
+  explicit EmbedderServiceHandler(const char* name)
+      : name_(NULL), callback_(NULL), user_data_(NULL), next_(NULL) {
     ASSERT(name != NULL);
     name_ = strdup(name);
   }
 
-  ~EmbedderServiceHandler() {
-    free(name_);
-  }
+  ~EmbedderServiceHandler() { free(name_); }
 
   const char* name() const { return name_; }
 
@@ -1199,14 +1169,10 @@
   }
 
   void* user_data() const { return user_data_; }
-  void set_user_data(void* user_data) {
-    user_data_ = user_data;
-  }
+  void set_user_data(void* user_data) { user_data_ = user_data; }
 
   EmbedderServiceHandler* next() const { return next_; }
-  void set_next(EmbedderServiceHandler* next) {
-    next_ = next;
-  }
+  void set_next(EmbedderServiceHandler* next) { next_ = next; }
 
  private:
   char* name_;
@@ -1263,8 +1229,7 @@
 }
 
 
-EmbedderServiceHandler* Service::FindIsolateEmbedderHandler(
-    const char* name) {
+EmbedderServiceHandler* Service::FindIsolateEmbedderHandler(const char* name) {
   EmbedderServiceHandler* current = isolate_service_handler_head_;
   while (current != NULL) {
     if (strcmp(name, current->name()) == 0) {
@@ -1276,10 +1241,9 @@
 }
 
 
-void Service::RegisterRootEmbedderCallback(
-    const char* name,
-    Dart_ServiceRequestCallback callback,
-    void* user_data) {
+void Service::RegisterRootEmbedderCallback(const char* name,
+                                           Dart_ServiceRequestCallback callback,
+                                           void* user_data) {
   if (name == NULL) {
     return;
   }
@@ -1315,8 +1279,7 @@
 }
 
 
-EmbedderServiceHandler* Service::FindRootEmbedderHandler(
-    const char* name) {
+EmbedderServiceHandler* Service::FindRootEmbedderHandler(const char* name) {
   EmbedderServiceHandler* current = root_service_handler_head_;
   while (current != NULL) {
     if (strcmp(name, current->name()) == 0) {
@@ -1341,18 +1304,13 @@
   ASSERT(!reply_port.IsNull());
   Isolate* isolate = Isolate::Current();
   ASSERT(isolate != NULL);
-  isolate->AppendServiceExtensionCall(handler,
-                                      method_name,
-                                      parameter_keys,
-                                      parameter_values,
-                                      reply_port,
-                                      id);
+  isolate->AppendServiceExtensionCall(handler, method_name, parameter_keys,
+                                      parameter_values, reply_port, id);
 }
 
 
 static const MethodParameter* get_isolate_params[] = {
-  ISOLATE_PARAMETER,
-  NULL,
+    ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -1363,9 +1321,7 @@
 
 
 static const MethodParameter* get_stack_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  new BoolParameter("_full", false),
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, new BoolParameter("_full", false), NULL,
 };
 
 
@@ -1435,9 +1391,8 @@
     }
   }
   uint8_t data[] = {0, 128, 255};
-  SendEventWithData(echo_stream.id(), "_Echo",
-                    js.buffer()->buf(), js.buffer()->length(),
-                    data, sizeof(data));
+  SendEventWithData(echo_stream.id(), "_Echo", js.buffer()->buf(),
+                    js.buffer()->length(), data, sizeof(data));
 }
 
 
@@ -1505,13 +1460,12 @@
   if (strncmp(arg, "int-", 4) == 0) {
     arg += 4;
     int64_t value = 0;
-    if (!OS::StringToInt64(arg, &value) ||
-        !Smi::IsValid(value)) {
+    if (!OS::StringToInt64(arg, &value) || !Smi::IsValid(value)) {
       *kind = ObjectIdRing::kInvalid;
       return Object::null();
     }
-    const Integer& obj = Integer::Handle(thread->zone(),
-        Smi::New(static_cast<intptr_t>(value)));
+    const Integer& obj =
+        Integer::Handle(thread->zone(), Smi::New(static_cast<intptr_t>(value)));
     return obj.raw();
   } else if (strcmp(arg, "bool-true") == 0) {
     return Bool::True().raw();
@@ -1533,7 +1487,8 @@
 
 
 static RawObject* LookupHeapObjectLibraries(Isolate* isolate,
-                                            char** parts, int num_parts) {
+                                            char** parts,
+                                            int num_parts) {
   // Library ids look like "libraries/35"
   if (num_parts < 2) {
     return Object::sentinel().raw();
@@ -1591,7 +1546,8 @@
 }
 
 static RawObject* LookupHeapObjectClasses(Thread* thread,
-                                          char** parts, int num_parts) {
+                                          char** parts,
+                                          int num_parts) {
   // Class ids look like: "classes/17"
   if (num_parts < 2) {
     return Object::sentinel().raw();
@@ -1600,8 +1556,7 @@
   Zone* zone = thread->zone();
   ClassTable* table = isolate->class_table();
   intptr_t id;
-  if (!GetIntegerId(parts[1], &id) ||
-      !table->IsValidIndex(id)) {
+  if (!GetIntegerId(parts[1], &id) || !table->IsValidIndex(id)) {
     return Object::sentinel().raw();
   }
   Class& cls = Class::Handle(zone, table->At(id));
@@ -1714,7 +1669,8 @@
 
 
 static RawObject* LookupHeapObjectTypeArguments(Thread* thread,
-                                                char** parts, int num_parts) {
+                                                char** parts,
+                                                int num_parts) {
   Isolate* isolate = thread->isolate();
   // TypeArguments ids look like: "typearguments/17"
   if (num_parts < 2) {
@@ -1725,8 +1681,8 @@
     return Object::sentinel().raw();
   }
   ObjectStore* object_store = isolate->object_store();
-  const Array& table = Array::Handle(thread->zone(),
-                                     object_store->canonical_type_arguments());
+  const Array& table =
+      Array::Handle(thread->zone(), object_store->canonical_type_arguments());
   ASSERT(table.Length() > 0);
   const intptr_t table_size = table.Length() - 1;
   if ((id < 0) || (id >= table_size) || (table.At(id) == Object::null())) {
@@ -1737,7 +1693,8 @@
 
 
 static RawObject* LookupHeapObjectCode(Isolate* isolate,
-                                       char** parts, int num_parts) {
+                                       char** parts,
+                                       int num_parts) {
   if (num_parts != 2) {
     return Object::sentinel().raw();
   }
@@ -1785,7 +1742,8 @@
 
 
 static RawObject* LookupHeapObjectMessage(Thread* thread,
-                                          char** parts, int num_parts) {
+                                          char** parts,
+                                          int num_parts) {
   if (num_parts != 2) {
     return Object::sentinel().raw();
   }
@@ -1800,9 +1758,7 @@
     return Object::sentinel().raw();
   }
   if (message->len() > 0) {
-    MessageSnapshotReader reader(message->data(),
-                                 message->len(),
-                                 thread);
+    MessageSnapshotReader reader(message->data(), message->len(), thread);
     return reader.ReadObject();
   } else {
     return message->raw_obj();
@@ -1954,8 +1910,8 @@
 
       jselement.AddProperty("source", source);
       if (source.IsArray()) {
-        intptr_t element_index = slot_offset.Value() -
-            (Array::element_offset(0) >> kWordSizeLog2);
+        intptr_t element_index =
+            slot_offset.Value() - (Array::element_offset(0) >> kWordSizeLog2);
         jselement.AddProperty("parentListIndex", element_index);
       } else if (source.IsInstance()) {
         source_class ^= source.clazz();
@@ -1984,8 +1940,7 @@
 
 
 static const MethodParameter* get_inbound_references_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -2055,14 +2010,14 @@
       slot_offset ^= path.At((i * 2) - 1);
       jselement.AddProperty("offset", slot_offset.Value());
       if (element.IsArray() || element.IsGrowableObjectArray()) {
-        intptr_t element_index = slot_offset.Value() -
-            (Array::element_offset(0) >> kWordSizeLog2);
+        intptr_t element_index =
+            slot_offset.Value() - (Array::element_offset(0) >> kWordSizeLog2);
         jselement.AddProperty("parentListIndex", element_index);
       } else if (element.IsLinkedHashMap()) {
         map = static_cast<RawLinkedHashMap*>(path.At(i * 2));
         map_data = map.data();
-        intptr_t element_index = slot_offset.Value() -
-            (Array::element_offset(0) >> kWordSizeLog2);
+        intptr_t element_index =
+            slot_offset.Value() - (Array::element_offset(0) >> kWordSizeLog2);
         LinkedHashMap::Iterator iterator(map);
         while (iterator.MoveNext()) {
           if (iterator.CurrentKey() == map_data.At(element_index) ||
@@ -2099,8 +2054,7 @@
 
 
 static const MethodParameter* get_retaining_path_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -2142,9 +2096,7 @@
 
 
 static const MethodParameter* get_retained_size_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  new IdParameter("targetId", true),
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, new IdParameter("targetId", true), NULL,
 };
 
 
@@ -2152,8 +2104,8 @@
   const char* target_id = js->LookupParam("targetId");
   ASSERT(target_id != NULL);
   ObjectIdRing::LookupResult lookup_result;
-  Object& obj = Object::Handle(LookupHeapObject(thread, target_id,
-                                                &lookup_result));
+  Object& obj =
+      Object::Handle(LookupHeapObject(thread, target_id, &lookup_result));
   if (obj.raw() == Object::sentinel().raw()) {
     if (lookup_result == ObjectIdRing::kCollected) {
       PrintSentinel(js, kCollectedSentinel);
@@ -2184,9 +2136,7 @@
 
 
 static const MethodParameter* get_reachable_size_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  new IdParameter("targetId", true),
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, new IdParameter("targetId", true), NULL,
 };
 
 
@@ -2194,8 +2144,8 @@
   const char* target_id = js->LookupParam("targetId");
   ASSERT(target_id != NULL);
   ObjectIdRing::LookupResult lookup_result;
-  Object& obj = Object::Handle(LookupHeapObject(thread, target_id,
-                                                &lookup_result));
+  Object& obj =
+      Object::Handle(LookupHeapObject(thread, target_id, &lookup_result));
   if (obj.raw() == Object::sentinel().raw()) {
     if (lookup_result == ObjectIdRing::kCollected) {
       PrintSentinel(js, kCollectedSentinel);
@@ -2226,8 +2176,7 @@
 
 
 static const MethodParameter* evaluate_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -2250,8 +2199,8 @@
   Zone* zone = thread->zone();
   const String& expr_str = String::Handle(zone, String::New(expr));
   ObjectIdRing::LookupResult lookup_result;
-  Object& obj = Object::Handle(zone, LookupHeapObject(thread, target_id,
-                                                      &lookup_result));
+  Object& obj =
+      Object::Handle(zone, LookupHeapObject(thread, target_id, &lookup_result));
   if (obj.raw() == Object::sentinel().raw()) {
     if (lookup_result == ObjectIdRing::kCollected) {
       PrintSentinel(js, kCollectedSentinel);
@@ -2264,44 +2213,42 @@
   }
   if (obj.IsLibrary()) {
     const Library& lib = Library::Cast(obj);
-    const Object& result = Object::Handle(zone,
+    const Object& result = Object::Handle(
+        zone,
         lib.Evaluate(expr_str, Array::empty_array(), Array::empty_array()));
     result.PrintJSON(js, true);
     return true;
   }
   if (obj.IsClass()) {
     const Class& cls = Class::Cast(obj);
-    const Object& result = Object::Handle(zone,
+    const Object& result = Object::Handle(
+        zone,
         cls.Evaluate(expr_str, Array::empty_array(), Array::empty_array()));
     result.PrintJSON(js, true);
     return true;
   }
-  if ((obj.IsInstance() || obj.IsNull()) &&
-      !ContainsNonInstance(obj)) {
+  if ((obj.IsInstance() || obj.IsNull()) && !ContainsNonInstance(obj)) {
     // We don't use Instance::Cast here because it doesn't allow null.
     Instance& instance = Instance::Handle(zone);
     instance ^= obj.raw();
     const Class& receiver_cls = Class::Handle(zone, instance.clazz());
-    const Object& result =
-        Object::Handle(zone, instance.Evaluate(receiver_cls,
-                                               expr_str,
-                                               Array::empty_array(),
-                                               Array::empty_array()));
+    const Object& result = Object::Handle(
+        zone, instance.Evaluate(receiver_cls, expr_str, Array::empty_array(),
+                                Array::empty_array()));
     result.PrintJSON(js, true);
     return true;
   }
   js->PrintError(kInvalidParams,
                  "%s: invalid 'targetId' parameter: "
-                 "Cannot evaluate against a VM-internal object", js->method());
+                 "Cannot evaluate against a VM-internal object",
+                 js->method());
   return true;
 }
 
 
 static const MethodParameter* evaluate_in_frame_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  new UIntParameter("frameIndex", true),
-  new MethodParameter("expression", true),
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, new UIntParameter("frameIndex", true),
+    new MethodParameter("expression", true), NULL,
 };
 
 
@@ -2363,8 +2310,7 @@
 
 
 static const MethodParameter* get_instances_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -2384,10 +2330,8 @@
     PrintInvalidParamError(js, "limit");
     return true;
   }
-  const Object& obj =
-      Object::Handle(LookupHeapObject(thread, target_id, NULL));
-  if (obj.raw() == Object::sentinel().raw() ||
-      !obj.IsClass()) {
+  const Object& obj = Object::Handle(LookupHeapObject(thread, target_id, NULL));
+  if (obj.raw() == Object::sentinel().raw() || !obj.IsClass()) {
     PrintInvalidParamError(js, "classId");
     return true;
   }
@@ -2420,28 +2364,29 @@
 
 
 static const char* const report_enum_names[] = {
-  SourceReport::kCallSitesStr,
-  SourceReport::kCoverageStr,
-  SourceReport::kPossibleBreakpointsStr,
-  SourceReport::kProfileStr,
-  NULL,
+    SourceReport::kCallSitesStr,
+    SourceReport::kCoverageStr,
+    SourceReport::kPossibleBreakpointsStr,
+    SourceReport::kProfileStr,
+    NULL,
 };
 
 
 static const MethodParameter* get_source_report_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  new EnumListParameter("reports", true, report_enum_names),
-  new IdParameter("scriptId", false),
-  new UIntParameter("tokenPos", false),
-  new UIntParameter("endTokenPos", false),
-  new BoolParameter("forceCompile", false),
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER,
+    new EnumListParameter("reports", true, report_enum_names),
+    new IdParameter("scriptId", false),
+    new UIntParameter("tokenPos", false),
+    new UIntParameter("endTokenPos", false),
+    new BoolParameter("forceCompile", false),
+    NULL,
 };
 
 
 static bool GetSourceReport(Thread* thread, JSONStream* js) {
   if (!thread->isolate()->compilation_allowed()) {
-    js->PrintError(kFeatureDisabled,
+    js->PrintError(
+        kFeatureDisabled,
         "Cannot get source report when running a precompiled program.");
     return true;
   }
@@ -2499,18 +2444,19 @@
     }
   }
   SourceReport report(report_set, compile_mode);
-  report.PrintJSON(js,
-                   script,
-                   TokenPosition(start_pos),
+  report.PrintJSON(js, script, TokenPosition(start_pos),
                    TokenPosition(end_pos));
   return true;
 }
 
 
 static const MethodParameter* reload_sources_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  new BoolParameter("force", false),
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER,
+    new BoolParameter("force", false),
+    new BoolParameter("pause", false),
+    new StringParameter("rootLibUri", false),
+    new StringParameter("packagesUri", false),
+    NULL,
 };
 
 
@@ -2518,12 +2464,7 @@
   Isolate* isolate = thread->isolate();
   if (!isolate->compilation_allowed()) {
     js->PrintError(kFeatureDisabled,
-        "Cannot reload source when running a precompiled program.");
-    return true;
-  }
-  if (Dart::snapshot_kind() == Snapshot::kAppWithJIT) {
-    js->PrintError(kFeatureDisabled,
-        "Cannot reload source when running an app snapshot.");
+                   "Cannot reload source when running a precompiled program.");
     return true;
   }
   Dart_LibraryTagHandler handler = isolate->library_tag_handler();
@@ -2540,8 +2481,7 @@
     return true;
   }
   if (isolate->IsReloading()) {
-    js->PrintError(kIsolateIsReloading,
-                   "This isolate is being reloaded.");
+    js->PrintError(kIsolateIsReloading, "This isolate is being reloaded.");
     return true;
   }
   if (!isolate->CanReload()) {
@@ -2552,17 +2492,39 @@
   const bool force_reload =
       BoolParameter::Parse(js->LookupParam("force"), false);
 
-  isolate->ReloadSources(js, force_reload);
+  isolate->ReloadSources(js, force_reload, js->LookupParam("rootLibUri"),
+                         js->LookupParam("packagesUri"));
+
+  Service::CheckForPause(isolate, js);
 
   return true;
 }
 
 
+void Service::CheckForPause(Isolate* isolate, JSONStream* stream) {
+  // Should we pause?
+  isolate->set_should_pause_post_service_request(
+      BoolParameter::Parse(stream->LookupParam("pause"), false));
+}
+
+
+void Service::MaybePause(Isolate* isolate) {
+  // Don't pause twice.
+  if (!isolate->IsPaused()) {
+    if (isolate->should_pause_post_service_request()) {
+      isolate->set_should_pause_post_service_request(false);
+      isolate->PausePostRequest();
+    }
+  }
+}
+
+
 static bool AddBreakpointCommon(Thread* thread,
                                 JSONStream* js,
                                 const String& script_uri) {
   if (!thread->isolate()->compilation_allowed()) {
-    js->PrintError(kFeatureDisabled,
+    js->PrintError(
+        kFeatureDisabled,
         "Cannot use breakpoints when running a precompiled program.");
     return true;
   }
@@ -2580,12 +2542,12 @@
   }
   ASSERT(!script_uri.IsNull());
   Breakpoint* bpt = NULL;
-  bpt = thread->isolate()->debugger()->
-      SetBreakpointAtLineCol(script_uri, line, col);
+  bpt = thread->isolate()->debugger()->SetBreakpointAtLineCol(script_uri, line,
+                                                              col);
   if (bpt == NULL) {
     js->PrintError(kCannotAddBreakpoint,
-                   "%s: Cannot add breakpoint at line '%s'",
-                   js->method(), line_param);
+                   "%s: Cannot add breakpoint at line '%s'", js->method(),
+                   line_param);
     return true;
   }
   bpt->PrintJSON(js);
@@ -2594,17 +2556,18 @@
 
 
 static const MethodParameter* add_breakpoint_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  new IdParameter("scriptId", true),
-  new UIntParameter("line", true),
-  new UIntParameter("column", false),
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER,
+    new IdParameter("scriptId", true),
+    new UIntParameter("line", true),
+    new UIntParameter("column", false),
+    NULL,
 };
 
 
 static bool AddBreakpoint(Thread* thread, JSONStream* js) {
   if (!thread->isolate()->compilation_allowed()) {
-    js->PrintError(kFeatureDisabled,
+    js->PrintError(
+        kFeatureDisabled,
         "Cannot use breakpoints when running a precompiled program.");
     return true;
   }
@@ -2622,17 +2585,18 @@
 
 
 static const MethodParameter* add_breakpoint_with_script_uri_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  new IdParameter("scriptUri", true),
-  new UIntParameter("line", true),
-  new UIntParameter("column", false),
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER,
+    new IdParameter("scriptUri", true),
+    new UIntParameter("line", true),
+    new UIntParameter("column", false),
+    NULL,
 };
 
 
 static bool AddBreakpointWithScriptUri(Thread* thread, JSONStream* js) {
   if (!thread->isolate()->compilation_allowed()) {
-    js->PrintError(kFeatureDisabled,
+    js->PrintError(
+        kFeatureDisabled,
         "Cannot use breakpoints when running a precompiled program.");
     return true;
   }
@@ -2643,15 +2607,14 @@
 
 
 static const MethodParameter* add_breakpoint_at_entry_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  new IdParameter("functionId", true),
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, new IdParameter("functionId", true), NULL,
 };
 
 
 static bool AddBreakpointAtEntry(Thread* thread, JSONStream* js) {
   if (!thread->isolate()->compilation_allowed()) {
-    js->PrintError(kFeatureDisabled,
+    js->PrintError(
+        kFeatureDisabled,
         "Cannot use breakpoints when running a precompiled program.");
     return true;
   }
@@ -2666,8 +2629,8 @@
       thread->isolate()->debugger()->SetBreakpointAtEntry(function, false);
   if (bpt == NULL) {
     js->PrintError(kCannotAddBreakpoint,
-                   "%s: Cannot add breakpoint at function '%s'",
-                   js->method(), function.ToCString());
+                   "%s: Cannot add breakpoint at function '%s'", js->method(),
+                   function.ToCString());
     return true;
   }
   bpt->PrintJSON(js);
@@ -2676,15 +2639,14 @@
 
 
 static const MethodParameter* add_breakpoint_at_activation_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  new IdParameter("objectId", true),
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, new IdParameter("objectId", true), NULL,
 };
 
 
 static bool AddBreakpointAtActivation(Thread* thread, JSONStream* js) {
   if (!thread->isolate()->compilation_allowed()) {
-    js->PrintError(kFeatureDisabled,
+    js->PrintError(
+        kFeatureDisabled,
         "Cannot use breakpoints when running a precompiled program.");
     return true;
   }
@@ -2699,8 +2661,7 @@
       thread->isolate()->debugger()->SetBreakpointAtActivation(closure, false);
   if (bpt == NULL) {
     js->PrintError(kCannotAddBreakpoint,
-                   "%s: Cannot add breakpoint at activation",
-                   js->method());
+                   "%s: Cannot add breakpoint at activation", js->method());
     return true;
   }
   bpt->PrintJSON(js);
@@ -2709,14 +2670,14 @@
 
 
 static const MethodParameter* remove_breakpoint_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, NULL,
 };
 
 
 static bool RemoveBreakpoint(Thread* thread, JSONStream* js) {
   if (!thread->isolate()->compilation_allowed()) {
-    js->PrintError(kFeatureDisabled,
+    js->PrintError(
+        kFeatureDisabled,
         "Cannot use breakpoints when running a precompiled program.");
     return true;
   }
@@ -2742,11 +2703,9 @@
 
 static RawClass* GetMetricsClass(Thread* thread) {
   Zone* zone = thread->zone();
-  const Library& prof_lib =
-      Library::Handle(zone, Library::DeveloperLibrary());
+  const Library& prof_lib = Library::Handle(zone, Library::DeveloperLibrary());
   ASSERT(!prof_lib.IsNull());
-  const String& metrics_cls_name =
-      String::Handle(zone, String::New("Metrics"));
+  const String& metrics_cls_name = String::Handle(zone, String::New("Metrics"));
   ASSERT(!metrics_cls_name.IsNull());
   const Class& metrics_cls =
       Class::Handle(zone, prof_lib.LookupClass(metrics_cls_name));
@@ -2755,7 +2714,6 @@
 }
 
 
-
 static bool HandleNativeMetricsList(Thread* thread, JSONStream* js) {
   JSONObject obj(js);
   obj.AddProperty("type", "MetricList");
@@ -2789,14 +2747,12 @@
 
 static bool HandleDartMetricsList(Thread* thread, JSONStream* js) {
   Zone* zone = thread->zone();
-  const Class& metrics_cls =
-      Class::Handle(zone, GetMetricsClass(thread));
+  const Class& metrics_cls = Class::Handle(zone, GetMetricsClass(thread));
   const String& print_metrics_name =
       String::Handle(String::New("_printMetrics"));
   ASSERT(!print_metrics_name.IsNull());
   const Function& print_metrics = Function::Handle(
-      zone,
-      metrics_cls.LookupStaticFunctionAllowPrivate(print_metrics_name));
+      zone, metrics_cls.LookupStaticFunctionAllowPrivate(print_metrics_name));
   ASSERT(!print_metrics.IsNull());
   const Array& args = Object::empty_array();
   const Object& result =
@@ -2811,14 +2767,11 @@
 
 static bool HandleDartMetric(Thread* thread, JSONStream* js, const char* id) {
   Zone* zone = thread->zone();
-  const Class& metrics_cls =
-      Class::Handle(zone, GetMetricsClass(thread));
-  const String& print_metric_name =
-      String::Handle(String::New("_printMetric"));
+  const Class& metrics_cls = Class::Handle(zone, GetMetricsClass(thread));
+  const String& print_metric_name = String::Handle(String::New("_printMetric"));
   ASSERT(!print_metric_name.IsNull());
   const Function& print_metric = Function::Handle(
-      zone,
-      metrics_cls.LookupStaticFunctionAllowPrivate(print_metric_name));
+      zone, metrics_cls.LookupStaticFunctionAllowPrivate(print_metric_name));
   ASSERT(!print_metric.IsNull());
   const String& arg0 = String::Handle(String::New(id));
   ASSERT(!arg0.IsNull());
@@ -2839,8 +2792,7 @@
 
 
 static const MethodParameter* get_isolate_metric_list_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -2867,8 +2819,7 @@
 
 
 static const MethodParameter* get_isolate_metric_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -2900,8 +2851,7 @@
 
 
 static const MethodParameter* get_vm_metric_list_params[] = {
-  NO_ISOLATE_PARAMETER,
-  NULL,
+    NO_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -2911,8 +2861,7 @@
 
 
 static const MethodParameter* get_vm_metric_params[] = {
-  NO_ISOLATE_PARAMETER,
-  NULL,
+    NO_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -2925,20 +2874,17 @@
 }
 
 static const char* const timeline_streams_enum_names[] = {
-  "all",
-#define DEFINE_NAME(name, unused)                                              \
-  #name,
-TIMELINE_STREAM_LIST(DEFINE_NAME)
+    "all",
+#define DEFINE_NAME(name, unused) #name,
+    TIMELINE_STREAM_LIST(DEFINE_NAME)
 #undef DEFINE_NAME
-  NULL
-};
+        NULL};
 
 static const MethodParameter* set_vm_timeline_flags_params[] = {
-  NO_ISOLATE_PARAMETER,
-  new EnumListParameter("recordedStreams",
-                        false,
-                        timeline_streams_enum_names),
-  NULL,
+    NO_ISOLATE_PARAMETER, new EnumListParameter("recordedStreams",
+                                                false,
+                                                timeline_streams_enum_names),
+    NULL,
 };
 
 
@@ -2972,7 +2918,7 @@
 
 #define SET_ENABLE_STREAM(name, unused)                                        \
   Timeline::SetStream##name##Enabled(HasStream(recorded_streams, #name));
-TIMELINE_STREAM_LIST(SET_ENABLE_STREAM);
+  TIMELINE_STREAM_LIST(SET_ENABLE_STREAM);
 #undef SET_ENABLE_STREAM
 
   PrintSuccess(js);
@@ -2982,8 +2928,7 @@
 
 
 static const MethodParameter* get_vm_timeline_flags_params[] = {
-  NO_ISOLATE_PARAMETER,
-  NULL,
+    NO_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -3002,8 +2947,7 @@
 
 
 static const MethodParameter* clear_vm_timeline_params[] = {
-  NO_ISOLATE_PARAMETER,
-  NULL,
+    NO_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -3021,10 +2965,8 @@
 
 
 static const MethodParameter* get_vm_timeline_params[] = {
-  NO_ISOLATE_PARAMETER,
-  new Int64Parameter("timeOriginMicros", false),
-  new Int64Parameter("timeExtentMicros", false),
-  NULL,
+    NO_ISOLATE_PARAMETER, new Int64Parameter("timeOriginMicros", false),
+    new Int64Parameter("timeExtentMicros", false), NULL,
 };
 
 
@@ -3047,8 +2989,7 @@
 
 
 static const MethodParameter* resume_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -3117,8 +3058,7 @@
 
 
 static const MethodParameter* pause_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -3136,8 +3076,7 @@
 
 
 static const MethodParameter* get_tag_profile_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -3150,32 +3089,24 @@
 
 
 static const char* const tags_enum_names[] = {
-  "None",
-  "UserVM",
-  "UserOnly",
-  "VMUser",
-  "VMOnly",
-  NULL,
+    "None", "UserVM", "UserOnly", "VMUser", "VMOnly", NULL,
 };
 
 
 static const Profile::TagOrder tags_enum_values[] = {
-  Profile::kNoTags,
-  Profile::kUserVM,
-  Profile::kUser,
-  Profile::kVMUser,
-  Profile::kVM,
-  Profile::kNoTags,  // Default value.
+    Profile::kNoTags, Profile::kUserVM, Profile::kUser,
+    Profile::kVMUser, Profile::kVM,
+    Profile::kNoTags,  // Default value.
 };
 
 
 static const MethodParameter* get_cpu_profile_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  new EnumParameter("tags", true, tags_enum_names),
-  new BoolParameter("_codeTransitionTags", false),
-  new Int64Parameter("timeOriginMicros", false),
-  new Int64Parameter("timeExtentMicros", false),
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER,
+    new EnumParameter("tags", true, tags_enum_names),
+    new BoolParameter("_codeTransitionTags", false),
+    new Int64Parameter("timeOriginMicros", false),
+    new Int64Parameter("timeExtentMicros", false),
+    NULL,
 };
 
 
@@ -3191,21 +3122,18 @@
       Int64Parameter::Parse(js->LookupParam("timeOriginMicros"));
   int64_t time_extent_micros =
       Int64Parameter::Parse(js->LookupParam("timeExtentMicros"));
-  ProfilerService::PrintJSON(js,
-                             tag_order,
-                             extra_tags,
-                             time_origin_micros,
+  ProfilerService::PrintJSON(js, tag_order, extra_tags, time_origin_micros,
                              time_extent_micros);
   return true;
 }
 
 
 static const MethodParameter* get_cpu_profile_timeline_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  new EnumParameter("tags", true, tags_enum_names),
-  new Int64Parameter("timeOriginMicros", false),
-  new Int64Parameter("timeExtentMicros", false),
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER,
+    new EnumParameter("tags", true, tags_enum_names),
+    new Int64Parameter("timeOriginMicros", false),
+    new Int64Parameter("timeExtentMicros", false),
+    NULL,
 };
 
 
@@ -3216,21 +3144,19 @@
       UIntParameter::Parse(js->LookupParam("timeOriginMicros"));
   int64_t time_extent_micros =
       UIntParameter::Parse(js->LookupParam("timeExtentMicros"));
-  ProfilerService::PrintTimelineJSON(js,
-                                     tag_order,
-                                     time_origin_micros,
+  ProfilerService::PrintTimelineJSON(js, tag_order, time_origin_micros,
                                      time_extent_micros);
   return true;
 }
 
 
 static const MethodParameter* get_allocation_samples_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  new EnumParameter("tags", true, tags_enum_names),
-  new IdParameter("classId", false),
-  new Int64Parameter("timeOriginMicros", false),
-  new Int64Parameter("timeExtentMicros", false),
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER,
+    new EnumParameter("tags", true, tags_enum_names),
+    new IdParameter("classId", false),
+    new Int64Parameter("timeOriginMicros", false),
+    new Int64Parameter("timeExtentMicros", false),
+    NULL,
 };
 
 
@@ -3247,10 +3173,7 @@
   Isolate* isolate = thread->isolate();
   if (IsValidClassId(isolate, cid)) {
     const Class& cls = Class::Handle(GetClassForId(isolate, cid));
-    ProfilerService::PrintAllocationJSON(js,
-                                         tag_order,
-                                         cls,
-                                         time_origin_micros,
+    ProfilerService::PrintAllocationJSON(js, tag_order, cls, time_origin_micros,
                                          time_extent_micros);
   } else {
     PrintInvalidParamError(js, "classId");
@@ -3260,8 +3183,7 @@
 
 
 static const MethodParameter* clear_cpu_profile_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -3273,8 +3195,7 @@
 
 
 static const MethodParameter* get_allocation_profile_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -3312,8 +3233,7 @@
 
 
 static const MethodParameter* get_heap_map_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -3324,18 +3244,33 @@
 }
 
 
+static const char* snapshot_roots_names[] = {
+    "User", "VM", NULL,
+};
+
+
+static ObjectGraph::SnapshotRoots snapshot_roots_values[] = {
+    ObjectGraph::kUser, ObjectGraph::kVM,
+};
+
+
 static const MethodParameter* request_heap_snapshot_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  new BoolParameter("collectGarbage", false /* not required */),
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER,
+    new EnumParameter("roots", false /* not required */, snapshot_roots_names),
+    new BoolParameter("collectGarbage", false /* not required */), NULL,
 };
 
 
 static bool RequestHeapSnapshot(Thread* thread, JSONStream* js) {
+  ObjectGraph::SnapshotRoots roots = ObjectGraph::kVM;
+  const char* roots_arg = js->LookupParam("roots");
+  if (roots_arg != NULL) {
+    roots = EnumMapper(roots_arg, snapshot_roots_names, snapshot_roots_values);
+  }
   const bool collect_garbage =
       BoolParameter::Parse(js->LookupParam("collectGarbage"), true);
   if (Service::graph_stream.enabled()) {
-    Service::SendGraphEvent(thread, collect_garbage);
+    Service::SendGraphEvent(thread, roots, collect_garbage);
   }
   // TODO(koda): Provide some id that ties this request to async response(s).
   JSONObject jsobj(js);
@@ -3344,11 +3279,13 @@
 }
 
 
-void Service::SendGraphEvent(Thread* thread, bool collect_garbage) {
+void Service::SendGraphEvent(Thread* thread,
+                             ObjectGraph::SnapshotRoots roots,
+                             bool collect_garbage) {
   uint8_t* buffer = NULL;
   WriteStream stream(&buffer, &allocator, 1 * MB);
   ObjectGraph graph(thread);
-  intptr_t node_count = graph.Serialize(&stream, collect_garbage);
+  intptr_t node_count = graph.Serialize(&stream, roots, collect_garbage);
 
   // Chrome crashes receiving a single tens-of-megabytes blob, so send the
   // snapshot in megabyte-sized chunks instead.
@@ -3380,12 +3317,11 @@
 
     uint8_t* chunk_start = buffer + (i * kChunkSize);
     intptr_t chunk_size = (i + 1 == num_chunks)
-        ? stream.bytes_written() - (i * kChunkSize)
-        : kChunkSize;
+                              ? stream.bytes_written() - (i * kChunkSize)
+                              : kChunkSize;
 
-    SendEventWithData(graph_stream.id(), "_Graph",
-                      js.buffer()->buf(), js.buffer()->length(),
-                      chunk_start, chunk_size);
+    SendEventWithData(graph_stream.id(), "_Graph", js.buffer()->buf(),
+                      js.buffer()->length(), chunk_start, chunk_size);
   }
 }
 
@@ -3460,8 +3396,8 @@
 
 class ContainsAddressVisitor : public FindObjectVisitor {
  public:
-  explicit ContainsAddressVisitor(uword addr) : addr_(addr) { }
-  virtual ~ContainsAddressVisitor() { }
+  explicit ContainsAddressVisitor(uword addr) : addr_(addr) {}
+  virtual ~ContainsAddressVisitor() {}
 
   virtual uword filter_addr() const { return addr_; }
 
@@ -3473,14 +3409,14 @@
     uword obj_end = obj_begin + obj->Size();
     return obj_begin <= addr_ && addr_ < obj_end;
   }
+
  private:
   uword addr_;
 };
 
 
 static const MethodParameter* get_object_by_address_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -3522,8 +3458,8 @@
     return true;
   }
   bool ref = js->HasParam("ref") && js->ParamIs("ref", "true");
-  const Object& obj = Object::Handle(thread->zone(),
-      GetObjectHelper(thread, addr));
+  const Object& obj =
+      Object::Handle(thread->zone(), GetObjectHelper(thread, addr));
   if (obj.IsNull()) {
     PrintSentinel(js, kFreeSentinel);
   } else {
@@ -3534,17 +3470,15 @@
 
 
 static const MethodParameter* get_persistent_handles_params[] = {
-  ISOLATE_PARAMETER,
-  NULL,
+    ISOLATE_PARAMETER, NULL,
 };
 
 
-template<typename T>
+template <typename T>
 class PersistentHandleVisitor : public HandleVisitor {
  public:
   PersistentHandleVisitor(Thread* thread, JSONArray* handles)
-      : HandleVisitor(thread),
-        handles_(handles) {
+      : HandleVisitor(thread), handles_(handles) {
     ASSERT(handles_ != NULL);
   }
 
@@ -3562,28 +3496,21 @@
 
     JSONObject obj(handles_);
     obj.AddProperty("type", "_WeakPersistentHandle");
-    const Object& object =
-        Object::Handle(weak_persistent_handle->raw());
+    const Object& object = Object::Handle(weak_persistent_handle->raw());
     obj.AddProperty("object", object);
+    obj.AddPropertyF("peer", "0x%" Px "", reinterpret_cast<uintptr_t>(
+                                              weak_persistent_handle->peer()));
     obj.AddPropertyF(
-        "peer",
-        "0x%" Px "",
-        reinterpret_cast<uintptr_t>(weak_persistent_handle->peer()));
-    obj.AddPropertyF(
-        "callbackAddress",
-        "0x%" Px "",
+        "callbackAddress", "0x%" Px "",
         reinterpret_cast<uintptr_t>(weak_persistent_handle->callback()));
     // Attempt to include a native symbol name.
     char* name = NativeSymbolResolver::LookupSymbolName(
-        reinterpret_cast<uintptr_t>(weak_persistent_handle->callback()),
-        NULL);
-    obj.AddProperty("callbackSymbolName",
-                    (name == NULL) ? "" : name);
+        reinterpret_cast<uintptr_t>(weak_persistent_handle->callback()), NULL);
+    obj.AddProperty("callbackSymbolName", (name == NULL) ? "" : name);
     if (name != NULL) {
       NativeSymbolResolver::FreeSymbolName(name);
     }
-    obj.AddPropertyF("externalSize",
-                     "%" Pd "",
+    obj.AddPropertyF("externalSize", "%" Pd "",
                      weak_persistent_handle->external_size());
   }
 
@@ -3611,8 +3538,8 @@
     {
       JSONArray persistent_handles(&obj, "persistentHandles");
       PersistentHandles& handles = api_state->persistent_handles();
-      PersistentHandleVisitor<PersistentHandle> visitor(
-          thread, &persistent_handles);
+      PersistentHandleVisitor<PersistentHandle> visitor(thread,
+                                                        &persistent_handles);
       handles.Visit(&visitor);
     }
     // Weak persistent handles.
@@ -3631,8 +3558,7 @@
 
 
 static const MethodParameter* get_ports_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -3664,10 +3590,8 @@
 
 
 static const MethodParameter* get_object_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  new UIntParameter("offset", false),
-  new UIntParameter("count", false),
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, new UIntParameter("offset", false),
+    new UIntParameter("count", false), NULL,
 };
 
 
@@ -3726,8 +3650,7 @@
 
 
 static const MethodParameter* get_object_store_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -3739,8 +3662,7 @@
 
 
 static const MethodParameter* get_class_list_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -3753,8 +3675,7 @@
 
 
 static const MethodParameter* get_type_arguments_list_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -3769,8 +3690,8 @@
       zone, object_store->canonical_type_arguments());
   const intptr_t table_size = typeargs_table.NumEntries();
   const intptr_t table_used = typeargs_table.NumOccupied();
-  const Array& typeargs_array = Array::Handle(
-      zone, HashTables::ToArray(typeargs_table, false));
+  const Array& typeargs_array =
+      Array::Handle(zone, HashTables::ToArray(typeargs_table, false));
   ASSERT(typeargs_array.Length() == table_used);
   TypeArguments& typeargs = TypeArguments::Handle(zone);
   JSONObject jsobj(js);
@@ -3792,16 +3713,17 @@
 
 
 static const MethodParameter* get_version_params[] = {
-  NO_ISOLATE_PARAMETER,
-  NULL,
+    NO_ISOLATE_PARAMETER, NULL,
 };
 
 
 static bool GetVersion(Thread* thread, JSONStream* js) {
   JSONObject jsobj(js);
   jsobj.AddProperty("type", "Version");
-  jsobj.AddProperty("major", static_cast<intptr_t>(3));
-  jsobj.AddProperty("minor", static_cast<intptr_t>(5));
+  jsobj.AddProperty("major",
+                    static_cast<intptr_t>(SERVICE_PROTOCOL_MAJOR_VERSION));
+  jsobj.AddProperty("minor",
+                    static_cast<intptr_t>(SERVICE_PROTOCOL_MINOR_VERSION));
   jsobj.AddProperty("_privateMajor", static_cast<intptr_t>(0));
   jsobj.AddProperty("_privateMinor", static_cast<intptr_t>(0));
   return true;
@@ -3810,9 +3732,7 @@
 
 class ServiceIsolateVisitor : public IsolateVisitor {
  public:
-  explicit ServiceIsolateVisitor(JSONArray* jsarr)
-      : jsarr_(jsarr) {
-  }
+  explicit ServiceIsolateVisitor(JSONArray* jsarr) : jsarr_(jsarr) {}
 
   virtual ~ServiceIsolateVisitor() {}
 
@@ -3829,8 +3749,7 @@
 
 
 static const MethodParameter* get_vm_params[] = {
-  NO_ISOLATE_PARAMETER,
-  NULL,
+    NO_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -3849,8 +3768,8 @@
   jsobj.AddProperty("_profilerMode", FLAG_profile_vm ? "VM" : "Dart");
   jsobj.AddProperty64("pid", OS::ProcessId());
   jsobj.AddProperty64("_maxRSS", OS::MaxRSS());
-  int64_t start_time_millis = (vm_isolate->start_time() /
-                               kMicrosecondsPerMillisecond);
+  int64_t start_time_millis =
+      (vm_isolate->start_time() / kMicrosecondsPerMillisecond);
   jsobj.AddPropertyTimeMillis("startTime", start_time_millis);
   // Construct the isolate list.
   {
@@ -3868,8 +3787,7 @@
 
 
 static const MethodParameter* restart_vm_params[] = {
-  NO_ISOLATE_PARAMETER,
-  NULL,
+    NO_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -3881,25 +3799,19 @@
 
 
 static const char* exception_pause_mode_names[] = {
-  "All",
-  "None",
-  "Unhandled",
-  NULL,
+    "All", "None", "Unhandled", NULL,
 };
 
 
 static Dart_ExceptionPauseInfo exception_pause_mode_values[] = {
-  kPauseOnAllExceptions,
-  kNoPauseOnExceptions,
-  kPauseOnUnhandledExceptions,
-  kInvalidExceptionPauseInfo,
+    kPauseOnAllExceptions, kNoPauseOnExceptions, kPauseOnUnhandledExceptions,
+    kInvalidExceptionPauseInfo,
 };
 
 
 static const MethodParameter* set_exception_pause_mode_params[] = {
-  ISOLATE_PARAMETER,
-  new EnumParameter("mode", true, exception_pause_mode_names),
-  NULL,
+    ISOLATE_PARAMETER,
+    new EnumParameter("mode", true, exception_pause_mode_names), NULL,
 };
 
 
@@ -3927,8 +3839,7 @@
 
 
 static const MethodParameter* get_flag_list_params[] = {
-  NO_ISOLATE_PARAMETER,
-  NULL,
+    NO_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -3939,8 +3850,7 @@
 
 
 static const MethodParameter* set_flags_params[] = {
-  NO_ISOLATE_PARAMETER,
-  NULL,
+    NO_ISOLATE_PARAMETER, NULL,
 };
 
 
@@ -3969,18 +3879,16 @@
 
 
 static const MethodParameter* set_library_debuggable_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  new IdParameter("libraryId", true),
-  new BoolParameter("isDebuggable", true),
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, new IdParameter("libraryId", true),
+    new BoolParameter("isDebuggable", true), NULL,
 };
 
 
 static bool SetLibraryDebuggable(Thread* thread, JSONStream* js) {
   const char* lib_id = js->LookupParam("libraryId");
   ObjectIdRing::LookupResult lookup_result;
-  Object& obj = Object::Handle(LookupHeapObject(thread, lib_id,
-                                                &lookup_result));
+  Object& obj =
+      Object::Handle(LookupHeapObject(thread, lib_id, &lookup_result));
   const bool is_debuggable =
       BoolParameter::Parse(js->LookupParam("isDebuggable"), false);
   if (obj.IsLibrary()) {
@@ -4002,9 +3910,7 @@
 
 
 static const MethodParameter* set_name_params[] = {
-  ISOLATE_PARAMETER,
-  new MethodParameter("name", true),
-  NULL,
+    ISOLATE_PARAMETER, new MethodParameter("name", true), NULL,
 };
 
 
@@ -4021,9 +3927,7 @@
 
 
 static const MethodParameter* set_vm_name_params[] = {
-  NO_ISOLATE_PARAMETER,
-  new MethodParameter("name", true),
-  NULL,
+    NO_ISOLATE_PARAMETER, new MethodParameter("name", true), NULL,
 };
 
 
@@ -4041,16 +3945,15 @@
 
 
 static const MethodParameter* set_trace_class_allocation_params[] = {
-  RUNNABLE_ISOLATE_PARAMETER,
-  new IdParameter("classId", true),
-  new BoolParameter("enable", true),
-  NULL,
+    RUNNABLE_ISOLATE_PARAMETER, new IdParameter("classId", true),
+    new BoolParameter("enable", true), NULL,
 };
 
 
 static bool SetTraceClassAllocation(Thread* thread, JSONStream* js) {
   if (!thread->isolate()->compilation_allowed()) {
-    js->PrintError(kFeatureDisabled,
+    js->PrintError(
+        kFeatureDisabled,
         "Cannot trace allocation when running a precompiled program.");
     return true;
   }
@@ -4071,6 +3974,7 @@
 }
 
 
+// clang-format off
 static const ServiceMethodDescriptor service_methods_[] = {
   { "_dumpIdZone", DumpIdZone, NULL },
   { "_echo", Echo,
@@ -4163,6 +4067,8 @@
     remove_breakpoint_params },
   { "_restartVM", RestartVM,
     restart_vm_params },
+  { "reloadSources", ReloadSources,
+    reload_sources_params },
   { "_reloadSources", ReloadSources,
     reload_sources_params },
   { "resume", Resume,
@@ -4184,11 +4090,10 @@
   { "_setVMTimelineFlags", SetVMTimelineFlags,
     set_vm_timeline_flags_params },
 };
-
+// clang-format on
 
 const ServiceMethodDescriptor* FindMethod(const char* method_name) {
-  intptr_t num_methods = sizeof(service_methods_) /
-                         sizeof(service_methods_[0]);
+  intptr_t num_methods = sizeof(service_methods_) / sizeof(service_methods_[0]);
   for (intptr_t i = 0; i < num_methods; i++) {
     const ServiceMethodDescriptor& method = service_methods_[i];
     if (strcmp(method_name, method.name) == 0) {
diff --git a/runtime/vm/service.h b/runtime/vm/service.h
index 6f9d1d6..a1ee159 100644
--- a/runtime/vm/service.h
+++ b/runtime/vm/service.h
@@ -2,17 +2,21 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_SERVICE_H_
-#define VM_SERVICE_H_
+#ifndef RUNTIME_VM_SERVICE_H_
+#define RUNTIME_VM_SERVICE_H_
 
 #include "include/dart_tools_api.h"
 
 #include "vm/allocation.h"
+#include "vm/object_graph.h"
 #include "vm/object_id_ring.h"
 #include "vm/os_thread.h"
 
 namespace dart {
 
+#define SERVICE_PROTOCOL_MAJOR_VERSION 3
+#define SERVICE_PROTOCOL_MINOR_VERSION 5
+
 class Array;
 class EmbedderServiceHandler;
 class Error;
@@ -37,6 +41,7 @@
  private:
 };
 
+#define ISOLATE_SERVICE_ID_FORMAT_STRING "isolates/%" Pd64 ""
 
 class RingServiceIdZone : public ServiceIdZone {
  public:
@@ -48,13 +53,9 @@
   // Returned string will be zone allocated.
   virtual char* GetServiceId(const Object& obj);
 
-  void set_policy(ObjectIdRing::IdPolicy policy) {
-    policy_ = policy;
-  }
+  void set_policy(ObjectIdRing::IdPolicy policy) { policy_ = policy; }
 
-  ObjectIdRing::IdPolicy policy() const {
-    return policy_;
-  }
+  ObjectIdRing::IdPolicy policy() const { return policy_; }
 
  private:
   ObjectIdRing* ring_;
@@ -96,10 +97,9 @@
       Dart_ServiceRequestCallback callback,
       void* user_data);
 
-  static void RegisterRootEmbedderCallback(
-      const char* name,
-      Dart_ServiceRequestCallback callback,
-      void* user_data);
+  static void RegisterRootEmbedderCallback(const char* name,
+                                           Dart_ServiceRequestCallback callback,
+                                           void* user_data);
 
   static void SetEmbedderStreamCallbacks(
       Dart_ServiceStreamListenCallback listen_callback,
@@ -109,7 +109,9 @@
       Dart_GetVMServiceAssetsArchive get_service_assets);
 
   static void SendEchoEvent(Isolate* isolate, const char* text);
-  static void SendGraphEvent(Thread* thread, bool collect_garbage);
+  static void SendGraphEvent(Thread* thread,
+                             ObjectGraph::SnapshotRoots roots,
+                             bool collect_garbage);
   static void SendInspectEvent(Isolate* isolate, const Object& inspectee);
 
   static void SendEmbedderEvent(Isolate* isolate,
@@ -164,6 +166,8 @@
 
   static void PrintJSONForVM(JSONStream* js, bool ref);
 
+  static void CheckForPause(Isolate* isolate, JSONStream* stream);
+
  private:
   static void InvokeMethod(Isolate* isolate,
                            const Array& message,
@@ -199,6 +203,8 @@
                         const char* kind,
                         JSONStream* event);
 
+  static void MaybePause(Isolate* isolate);
+
   static EmbedderServiceHandler* isolate_service_handler_head_;
   static EmbedderServiceHandler* root_service_handler_head_;
   static Dart_ServiceStreamListenCallback stream_listen_callback_;
@@ -214,4 +220,4 @@
 
 }  // namespace dart
 
-#endif  // VM_SERVICE_H_
+#endif  // RUNTIME_VM_SERVICE_H_
diff --git a/runtime/vm/service/service.md b/runtime/vm/service/service.md
index 7aab061..7975456 100644
--- a/runtime/vm/service/service.md
+++ b/runtime/vm/service/service.md
@@ -895,6 +895,15 @@
 class BoundVariable {
   string name;
   @Instance|Sentinel value;
+
+  // The token position where this variable was declared.
+  int declarationTokenPos;
+
+  // The first token position where this variable is visible to the scope.
+  int scopeStartTokenPos;
+
+  // The last token position where this variable is visible to the scope.
+  int scopeEndTokenPos;
 }
 ```
 
@@ -2528,4 +2537,6 @@
 3.3 | Pause event now indicates if the isolate is paused at an await, yield, or yield* suspension point via the 'atAsyncSuspension' field. Resume command now supports the step parameter 'OverAsyncSuspension'. A Breakpoint added synthetically by an 'OverAsyncSuspension' resume command identifies itself as such via the 'isSyntheticAsyncContinuation' field.
 3.4 | Add the superType and mixin fields to Class. Added new pause event 'None'.
 3.5 | Add the error field to SourceReportRange.  Clarify definition of token position.  Add "Isolate must be paused" error code.
+3.6 (unreleased) | Add 'scopeStartTokenPos', 'scopeEndTokenPos', and 'declarationTokenPos' to BoundVariable.
+
 [discuss-list]: https://groups.google.com/a/dartlang.org/forum/#!forum/observatory-discuss
diff --git a/runtime/vm/service_event.cc b/runtime/vm/service_event.cc
index 3ff1e1b..5d7cc75 100644
--- a/runtime/vm/service_event.cc
+++ b/runtime/vm/service_event.cc
@@ -83,6 +83,8 @@
       return "PauseInterrupted";
     case kPauseException:
       return "PauseException";
+    case kPausePostRequest:
+      return "PausePostRequest";
     case kNone:
       return "None";
     case kResume:
@@ -135,6 +137,7 @@
     case kPauseBreakpoint:
     case kPauseInterrupted:
     case kPauseException:
+    case kPausePostRequest:
     case kNone:
     case kResume:
     case kBreakpointAdded:
diff --git a/runtime/vm/service_event.h b/runtime/vm/service_event.h
index cd48844..d0db082 100644
--- a/runtime/vm/service_event.h
+++ b/runtime/vm/service_event.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_SERVICE_EVENT_H_
-#define VM_SERVICE_EVENT_H_
+#ifndef RUNTIME_VM_SERVICE_EVENT_H_
+#define RUNTIME_VM_SERVICE_EVENT_H_
 
 #include "vm/globals.h"
 #include "vm/heap.h"
@@ -22,7 +22,7 @@
 class ServiceEvent {
  public:
   enum EventKind {
-    kVMUpdate,           // VM identity information has changed
+    kVMUpdate,  // VM identity information has changed
 
     kIsolateStart,           // New isolate has started
     kIsolateRunnable,        // Isolate is ready to run
@@ -32,12 +32,13 @@
     kIsolateSpawn,           // Result of an isolate spawn request
     kServiceExtensionAdded,  // A service extension was registered
 
-    kPauseStart,         // --pause-isolates-on-start
-    kPauseExit,          // --pause-isolates-on-exit
+    kPauseStart,  // --pause-isolates-on-start
+    kPauseExit,   // --pause-isolates-on-exit
     kPauseBreakpoint,
     kPauseInterrupted,
     kPauseException,
-    kNone,               // isolate has not been made runnable yet.
+    kPausePostRequest,  // isolate is paused after a service request.
+    kNone,              // isolate has not been made runnable yet.
     kResume,
     kBreakpointAdded,
     kBreakpointResolved,
@@ -79,19 +80,18 @@
   Isolate* isolate() const { return isolate_; }
 
   // Used by the C embedding api.
-  Dart_Port isolate_id() const {
-    return isolate_->main_port();
-  }
+  Dart_Port isolate_id() const { return isolate_->main_port(); }
 
   EventKind kind() const { return kind_; }
 
   bool IsPause() const {
-    switch (kind())  {
+    switch (kind()) {
       case kPauseStart:
       case kPauseExit:
       case kPauseBreakpoint:
       case kPauseInterrupted:
       case kPauseException:
+      case kPausePostRequest:
         return true;
       default:
         return false;
@@ -113,38 +113,27 @@
     embedder_stream_id_ = stream_id;
   }
 
-  Breakpoint* breakpoint() const {
-    return breakpoint_;
-  }
+  Breakpoint* breakpoint() const { return breakpoint_; }
   void set_breakpoint(Breakpoint* bpt) {
-    ASSERT(kind() == kPauseBreakpoint ||
-           kind() == kBreakpointAdded ||
-           kind() == kBreakpointResolved ||
-           kind() == kBreakpointRemoved);
+    ASSERT(kind() == kPauseBreakpoint || kind() == kBreakpointAdded ||
+           kind() == kBreakpointResolved || kind() == kBreakpointRemoved);
     breakpoint_ = bpt;
   }
 
-  ActivationFrame* top_frame() const {
-    return top_frame_;
-  }
+  ActivationFrame* top_frame() const { return top_frame_; }
   void set_top_frame(ActivationFrame* frame) {
-    ASSERT(kind() == kPauseBreakpoint ||
-           kind() == kPauseInterrupted ||
-           kind() == kPauseException ||
+    ASSERT(kind() == kPauseBreakpoint || kind() == kPauseInterrupted ||
+           kind() == kPauseException || kind() == kPausePostRequest ||
            kind() == kResume);
     top_frame_ = frame;
   }
 
-  const String* extension_rpc() const {
-    return extension_rpc_;
-  }
+  const String* extension_rpc() const { return extension_rpc_; }
   void set_extension_rpc(const String* extension_rpc) {
     extension_rpc_ = extension_rpc;
   }
 
-  const Object* exception() const {
-    return exception_;
-  }
+  const Object* exception() const { return exception_; }
   void set_exception(const Object* exception) {
     ASSERT(kind_ == kPauseException);
     exception_ = exception;
@@ -177,45 +166,29 @@
     spawn_error_ = error;
   }
 
-  bool at_async_jump() const {
-    return at_async_jump_;
-  }
-  void set_at_async_jump(bool value) {
-    at_async_jump_ = value;
-  }
+  bool at_async_jump() const { return at_async_jump_; }
+  void set_at_async_jump(bool value) { at_async_jump_ = value; }
 
-  const Object* inspectee() const {
-    return inspectee_;
-  }
+  const Object* inspectee() const { return inspectee_; }
   void set_inspectee(const Object* inspectee) {
     ASSERT(kind_ == kInspect);
     inspectee_ = inspectee;
   }
 
-  const Heap::GCStats* gc_stats() const {
-    return gc_stats_;
-  }
+  const Heap::GCStats* gc_stats() const { return gc_stats_; }
 
-  void set_gc_stats(const Heap::GCStats* gc_stats) {
-    gc_stats_ = gc_stats;
-  }
+  void set_gc_stats(const Heap::GCStats* gc_stats) { gc_stats_ = gc_stats; }
 
-  const uint8_t* bytes() const {
-    return bytes_;
-  }
+  const uint8_t* bytes() const { return bytes_; }
 
-  intptr_t bytes_length() const {
-    return bytes_length_;
-  }
+  intptr_t bytes_length() const { return bytes_length_; }
 
   void set_bytes(const uint8_t* bytes, intptr_t bytes_length) {
     bytes_ = bytes;
     bytes_length_ = bytes_length;
   }
 
-  void set_log_record(const LogRecord& log_record) {
-    log_record_ = log_record;
-  }
+  void set_log_record(const LogRecord& log_record) { log_record_ = log_record; }
 
   void set_extension_event(const ExtensionEvent& extension_event) {
     extension_event_ = extension_event;
@@ -223,9 +196,7 @@
 
   void UpdateTimestamp();
 
-  int64_t timestamp() const {
-    return timestamp_;
-  }
+  int64_t timestamp() const { return timestamp_; }
 
   const TimelineEventBlock* timeline_event_block() const {
     return timeline_event_block_;
@@ -265,4 +236,4 @@
 
 }  // namespace dart
 
-#endif  // VM_SERVICE_EVENT_H_
+#endif  // RUNTIME_VM_SERVICE_EVENT_H_
diff --git a/runtime/vm/service_isolate.cc b/runtime/vm/service_isolate.cc
index c5e2e75..75342b5 100644
--- a/runtime/vm/service_isolate.cc
+++ b/runtime/vm/service_isolate.cc
@@ -27,9 +27,13 @@
 
 
 DEFINE_FLAG(bool, trace_service, false, "Trace VM service requests.");
-DEFINE_FLAG(bool, trace_service_pause_events, false,
+DEFINE_FLAG(bool,
+            trace_service_pause_events,
+            false,
             "Trace VM service isolate pause events.");
-DEFINE_FLAG(bool, trace_service_verbose, false,
+DEFINE_FLAG(bool,
+            trace_service_verbose,
+            false,
             "Provide extra service tracing information.");
 
 static uint8_t* allocator(uint8_t* ptr, intptr_t old_size, intptr_t new_size) {
@@ -43,7 +47,11 @@
 #define VM_SERVICE_ISOLATE_STARTUP_MESSAGE_ID 1
 #define VM_SERVICE_ISOLATE_SHUTDOWN_MESSAGE_ID 2
 
-static RawArray* MakeServiceControlMessage(Dart_Port port_id, intptr_t code,
+#define VM_SERVICE_WEB_SERVER_CONTROL_MESSAGE_ID 3
+#define VM_SERVICE_SERVER_INFO_MESSAGE_ID 4
+
+static RawArray* MakeServiceControlMessage(Dart_Port port_id,
+                                           intptr_t code,
                                            const String& name) {
   const Array& list = Array::Handle(Array::New(4));
   ASSERT(!list.IsNull());
@@ -58,6 +66,18 @@
 }
 
 
+static RawArray* MakeServerControlMessage(const SendPort& sp,
+                                          intptr_t code,
+                                          bool enable = false) {
+  const Array& list = Array::Handle(Array::New(3));
+  ASSERT(!list.IsNull());
+  list.SetAt(0, Integer::Handle(Integer::New(code)));
+  list.SetAt(1, sp);
+  list.SetAt(2, Bool::Get(enable));
+  return list.raw();
+}
+
+
 static RawArray* MakeServiceExitMessage() {
   const Array& list = Array::Handle(Array::New(1));
   ASSERT(!list.IsNull());
@@ -81,6 +101,30 @@
 bool ServiceIsolate::shutting_down_ = false;
 char* ServiceIsolate::server_address_ = NULL;
 
+void ServiceIsolate::RequestServerInfo(const SendPort& sp) {
+  const Array& message = Array::Handle(MakeServerControlMessage(
+      sp, VM_SERVICE_SERVER_INFO_MESSAGE_ID, false /* ignored */));
+  ASSERT(!message.IsNull());
+  uint8_t* data = NULL;
+  MessageWriter writer(&data, &allocator, false);
+  writer.WriteMessage(message);
+  intptr_t len = writer.BytesWritten();
+  PortMap::PostMessage(new Message(port_, data, len, Message::kNormalPriority));
+}
+
+
+void ServiceIsolate::ControlWebServer(const SendPort& sp, bool enable) {
+  const Array& message = Array::Handle(MakeServerControlMessage(
+      sp, VM_SERVICE_WEB_SERVER_CONTROL_MESSAGE_ID, enable));
+  ASSERT(!message.IsNull());
+  uint8_t* data = NULL;
+  MessageWriter writer(&data, &allocator, false);
+  writer.WriteMessage(message);
+  intptr_t len = writer.BytesWritten();
+  PortMap::PostMessage(new Message(port_, data, len, Message::kNormalPriority));
+}
+
+
 void ServiceIsolate::SetServerAddress(const char* address) {
   if (server_address_ != NULL) {
     free(server_address_);
@@ -159,10 +203,8 @@
   HANDLESCOPE(thread);
   const String& name = String::Handle(String::New(isolate->name()));
   ASSERT(!name.IsNull());
-  const Array& list = Array::Handle(
-      MakeServiceControlMessage(Dart_GetMainPortId(),
-                                VM_SERVICE_ISOLATE_STARTUP_MESSAGE_ID,
-                                name));
+  const Array& list = Array::Handle(MakeServiceControlMessage(
+      Dart_GetMainPortId(), VM_SERVICE_ISOLATE_STARTUP_MESSAGE_ID, name));
   ASSERT(!list.IsNull());
   uint8_t* data = NULL;
   MessageWriter writer(&data, &allocator, false);
@@ -170,8 +212,7 @@
   intptr_t len = writer.BytesWritten();
   if (FLAG_trace_service) {
     OS::Print("vm-service: Isolate %s %" Pd64 " registered.\n",
-              name.ToCString(),
-              Dart_GetMainPortId());
+              name.ToCString(), Dart_GetMainPortId());
   }
   return PortMap::PostMessage(
       new Message(port_, data, len, Message::kNormalPriority));
@@ -191,10 +232,8 @@
   HANDLESCOPE(thread);
   const String& name = String::Handle(String::New(isolate->name()));
   ASSERT(!name.IsNull());
-  const Array& list = Array::Handle(
-      MakeServiceControlMessage(Dart_GetMainPortId(),
-                                VM_SERVICE_ISOLATE_SHUTDOWN_MESSAGE_ID,
-                                name));
+  const Array& list = Array::Handle(MakeServiceControlMessage(
+      Dart_GetMainPortId(), VM_SERVICE_ISOLATE_SHUTDOWN_MESSAGE_ID, name));
   ASSERT(!list.IsNull());
   uint8_t* data = NULL;
   MessageWriter writer(&data, &allocator, false);
@@ -202,8 +241,7 @@
   intptr_t len = writer.BytesWritten();
   if (FLAG_trace_service) {
     OS::Print("vm-service: Isolate %s %" Pd64 " deregistered.\n",
-              name.ToCString(),
-              Dart_GetMainPortId());
+              name.ToCString(), Dart_GetMainPortId());
   }
   return PortMap::PostMessage(
       new Message(port_, data, len, Message::kNormalPriority));
@@ -220,9 +258,7 @@
   if (FLAG_trace_service) {
     OS::Print("vm-service: sending service exit message.\n");
   }
-  PortMap::PostMessage(new Message(port_,
-                                   exit_message_,
-                                   exit_message_length_,
+  PortMap::PostMessage(new Message(port_, exit_message_, exit_message_length_,
                                    Message::kNormalPriority));
 }
 
@@ -304,8 +340,7 @@
   virtual void Run() {
     ASSERT(Isolate::Current() == NULL);
 #ifndef PRODUCT
-    TimelineDurationScope tds(Timeline::GetVMStream(),
-                              "ServiceIsolateStartup");
+    TimelineDurationScope tds(Timeline::GetVMStream(), "ServiceIsolateStartup");
 #endif  // !PRODUCT
     char* error = NULL;
     Isolate* isolate = NULL;
@@ -322,14 +357,8 @@
     Dart_IsolateFlags api_flags;
     Isolate::FlagsInitialize(&api_flags);
 
-    isolate =
-        reinterpret_cast<Isolate*>(create_callback(ServiceIsolate::kName,
-                                                   NULL,
-                                                   NULL,
-                                                   NULL,
-                                                   &api_flags,
-                                                   NULL,
-                                                   &error));
+    isolate = reinterpret_cast<Isolate*>(create_callback(
+        ServiceIsolate::kName, NULL, NULL, NULL, &api_flags, NULL, &error));
     if (isolate == NULL) {
       if (FLAG_trace_service) {
         OS::PrintErr("vm-service: Isolate creation error: %s\n", error);
@@ -355,9 +384,7 @@
 
     ServiceIsolate::FinishedInitializing();
 
-    isolate->message_handler()->Run(Dart::thread_pool(),
-                                    NULL,
-                                    ShutdownIsolate,
+    isolate->message_handler()->Run(Dart::thread_pool(), NULL, ShutdownIsolate,
                                     reinterpret_cast<uword>(isolate));
   }
 
@@ -405,8 +432,8 @@
     StackZone zone(T);
     HANDLESCOPE(T);
     // Invoke main which will return the loadScriptPort.
-    const Library& root_library = Library::Handle(Z,
-        I->object_store()->root_library());
+    const Library& root_library =
+        Library::Handle(Z, I->object_store()->root_library());
     if (root_library.IsNull()) {
       if (FLAG_trace_service) {
         OS::Print("vm-service: Embedder did not install a script.");
@@ -417,8 +444,8 @@
     ASSERT(!root_library.IsNull());
     const String& entry_name = String::Handle(Z, String::New("main"));
     ASSERT(!entry_name.IsNull());
-    const Function& entry = Function::Handle(Z,
-        root_library.LookupFunctionAllowPrivate(entry_name));
+    const Function& entry = Function::Handle(
+        Z, root_library.LookupFunctionAllowPrivate(entry_name));
     if (entry.IsNull()) {
       // Service isolate is not supported by embedder.
       if (FLAG_trace_service) {
@@ -427,8 +454,8 @@
       return false;
     }
     ASSERT(!entry.IsNull());
-    const Object& result = Object::Handle(Z,
-        DartEntry::InvokeFunction(entry, Object::empty_array()));
+    const Object& result = Object::Handle(
+        Z, DartEntry::InvokeFunction(entry, Object::empty_array()));
     ASSERT(!result.IsNull());
     if (result.IsError()) {
       // Service isolate did not initialize properly.
@@ -511,13 +538,11 @@
       Library::Handle(Library::LookupLibrary(thread, Symbols::DartVMService()));
   ASSERT(!vmservice_library.IsNull());
   const String& boot_function_name = String::Handle(String::New("boot"));
-  const Function& boot_function =
-      Function::Handle(
-          vmservice_library.LookupFunctionAllowPrivate(boot_function_name));
+  const Function& boot_function = Function::Handle(
+      vmservice_library.LookupFunctionAllowPrivate(boot_function_name));
   ASSERT(!boot_function.IsNull());
-  const Object& result =
-      Object::Handle(
-          DartEntry::InvokeFunction(boot_function, Object::empty_array()));
+  const Object& result = Object::Handle(
+      DartEntry::InvokeFunction(boot_function, Object::empty_array()));
   ASSERT(!result.IsNull());
   Dart_Port port = ILLEGAL_PORT;
   if (result.IsReceivePort()) {
@@ -528,7 +553,6 @@
 }
 
 
-void ServiceIsolate::VisitObjectPointers(ObjectPointerVisitor* visitor) {
-}
+void ServiceIsolate::VisitObjectPointers(ObjectPointerVisitor* visitor) {}
 
 }  // namespace dart
diff --git a/runtime/vm/service_isolate.h b/runtime/vm/service_isolate.h
index 9def85c..9060301 100644
--- a/runtime/vm/service_isolate.h
+++ b/runtime/vm/service_isolate.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_SERVICE_ISOLATE_H_
-#define VM_SERVICE_ISOLATE_H_
+#ifndef RUNTIME_VM_SERVICE_ISOLATE_H_
+#define RUNTIME_VM_SERVICE_ISOLATE_H_
 
 #include "include/dart_api.h"
 
@@ -13,6 +13,7 @@
 namespace dart {
 
 class ObjectPointerVisitor;
+class SendPort;
 
 class ServiceIsolate : public AllStatic {
  public:
@@ -36,12 +37,13 @@
 
   static void BootVmServiceLibrary();
 
+  static void RequestServerInfo(const SendPort& sp);
+  static void ControlWebServer(const SendPort& sp, bool enable);
+
   static void SetServerAddress(const char* address);
 
   // Returns the server's web address or NULL if none is running.
-  static const char* server_address() {
-    return server_address_;
-  }
+  static const char* server_address() { return server_address_; }
 
   static void VisitObjectPointers(ObjectPointerVisitor* visitor);
 
@@ -79,4 +81,4 @@
 
 }  // namespace dart
 
-#endif  // VM_SERVICE_ISOLATE_H_
+#endif  // RUNTIME_VM_SERVICE_ISOLATE_H_
diff --git a/runtime/vm/service_test.cc b/runtime/vm/service_test.cc
index 378b65b..0bbed74 100644
--- a/runtime/vm/service_test.cc
+++ b/runtime/vm/service_test.cc
@@ -28,9 +28,7 @@
  public:
   ServiceTestMessageHandler() : _msg(NULL) {}
 
-  ~ServiceTestMessageHandler() {
-    free(_msg);
-  }
+  ~ServiceTestMessageHandler() { free(_msg); }
 
   MessageStatus HandleMessage(Message* message) {
     if (_msg != NULL) {
@@ -112,8 +110,8 @@
 
 
 static RawFunction* GetFunction(const Class& cls, const char* name) {
-  const Function& result = Function::Handle(cls.LookupDynamicFunction(
-      String::Handle(String::New(name))));
+  const Function& result = Function::Handle(
+      cls.LookupDynamicFunction(String::Handle(String::New(name))));
   EXPECT(!result.IsNull());
   return result.raw();
 }
@@ -140,8 +138,7 @@
 
 
 TEST_CASE(Service_IsolateStickyError) {
-  const char* kScript =
-      "main() => throw 'HI THERE STICKY';\n";
+  const char* kScript = "main() => throw 'HI THERE STICKY';\n";
 
   Isolate* isolate = thread->isolate();
   isolate->set_is_runnable(true);
@@ -276,10 +273,10 @@
 
   // The following test checks that a code object can be found only
   // at compile_timestamp()-code.EntryPoint().
-  service_msg = EvalF(lib, "[0, port, '0', 'getObject', "
-                      "['objectId'], ['code/%" Px64"-%" Px "']]",
-                      compile_timestamp,
-                      entry);
+  service_msg = EvalF(lib,
+                      "[0, port, '0', 'getObject', "
+                      "['objectId'], ['code/%" Px64 "-%" Px "']]",
+                      compile_timestamp, entry);
   HandleIsolateMessage(isolate, service_msg);
   EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   EXPECT_SUBSTRING("\"type\":\"Code\"", handler.msg());
@@ -287,20 +284,19 @@
     // Only perform a partial match.
     const intptr_t kBufferSize = 512;
     char buffer[kBufferSize];
-    OS::SNPrint(buffer, kBufferSize-1,
+    OS::SNPrint(buffer, kBufferSize - 1,
                 "\"fixedId\":true,\"id\":\"code\\/%" Px64 "-%" Px "\",",
-                compile_timestamp,
-                entry);
+                compile_timestamp, entry);
     EXPECT_SUBSTRING(buffer, handler.msg());
   }
 
   // Request code object at compile_timestamp-code.EntryPoint() + 16
   // Expect this to fail because the address is not the entry point.
   uintptr_t address = entry + 16;
-  service_msg = EvalF(lib, "[0, port, '0', 'getObject', "
-                      "['objectId'], ['code/%" Px64"-%" Px "']]",
-                      compile_timestamp,
-                      address);
+  service_msg = EvalF(lib,
+                      "[0, port, '0', 'getObject', "
+                      "['objectId'], ['code/%" Px64 "-%" Px "']]",
+                      compile_timestamp, address);
   HandleIsolateMessage(isolate, service_msg);
   EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   EXPECT_SUBSTRING("\"error\"", handler.msg());
@@ -308,27 +304,28 @@
   // Request code object at (compile_timestamp - 1)-code.EntryPoint()
   // Expect this to fail because the timestamp is wrong.
   address = entry;
-  service_msg = EvalF(lib, "[0, port, '0', 'getObject', "
-                      "['objectId'], ['code/%" Px64"-%" Px "']]",
-                      compile_timestamp - 1,
-                      address);
+  service_msg = EvalF(lib,
+                      "[0, port, '0', 'getObject', "
+                      "['objectId'], ['code/%" Px64 "-%" Px "']]",
+                      compile_timestamp - 1, address);
   HandleIsolateMessage(isolate, service_msg);
   EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   EXPECT_SUBSTRING("\"error\"", handler.msg());
 
   // Request native code at address. Expect the null code object back.
   address = last;
-  service_msg = EvalF(lib, "[0, port, '0', 'getObject', "
+  service_msg = EvalF(lib,
+                      "[0, port, '0', 'getObject', "
                       "['objectId'], ['code/native-%" Px "']]",
                       address);
   HandleIsolateMessage(isolate, service_msg);
   EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   // TODO(turnidge): It is pretty broken to return an Instance here.  Fix.
-  EXPECT_SUBSTRING("\"kind\":\"Null\"",
-                   handler.msg());
+  EXPECT_SUBSTRING("\"kind\":\"Null\"", handler.msg());
 
   // Request malformed native code.
-  service_msg = EvalF(lib, "[0, port, '0', 'getObject', ['objectId'], "
+  service_msg = EvalF(lib,
+                      "[0, port, '0', 'getObject', ['objectId'], "
                       "['code/native%" Px "']]",
                       address);
   HandleIsolateMessage(isolate, service_msg);
@@ -372,8 +369,10 @@
   Array& service_msg = Array::Handle();
 
   // Fetch object.
-  service_msg = EvalF(lib, "[0, port, '0', 'getObject', "
-                      "['objectId'], ['objects/%" Pd "']]", id);
+  service_msg = EvalF(lib,
+                      "[0, port, '0', 'getObject', "
+                      "['objectId'], ['objects/%" Pd "']]",
+                      id);
   HandleIsolateMessage(isolate, service_msg);
   EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
 
@@ -387,21 +386,21 @@
 
 TEST_CASE(Service_PcDescriptors) {
   const char* kScript =
-    "var port;\n"  // Set to our mock port by C++.
-    "\n"
-    "class A {\n"
-    "  var a;\n"
-    "  dynamic b() {}\n"
-    "  dynamic c() {\n"
-    "    var d = () { b(); };\n"
-    "    return d;\n"
-    "  }\n"
-    "}\n"
-    "main() {\n"
-    "  var z = new A();\n"
-    "  var x = z.c();\n"
-    "  x();\n"
-    "}";
+      "var port;\n"  // Set to our mock port by C++.
+      "\n"
+      "class A {\n"
+      "  var a;\n"
+      "  dynamic b() {}\n"
+      "  dynamic c() {\n"
+      "    var d = () { b(); };\n"
+      "    return d;\n"
+      "  }\n"
+      "}\n"
+      "main() {\n"
+      "  var z = new A();\n"
+      "  var x = z.c();\n"
+      "  x();\n"
+      "}";
 
   Isolate* isolate = thread->isolate();
   isolate->set_is_runnable(true);
@@ -435,8 +434,10 @@
   Array& service_msg = Array::Handle();
 
   // Fetch object.
-  service_msg = EvalF(lib, "[0, port, '0', 'getObject', "
-                      "['objectId'], ['objects/%" Pd "']]", id);
+  service_msg = EvalF(lib,
+                      "[0, port, '0', 'getObject', "
+                      "['objectId'], ['objects/%" Pd "']]",
+                      id);
   HandleIsolateMessage(isolate, service_msg);
   EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   // Check type.
@@ -449,21 +450,21 @@
 
 TEST_CASE(Service_LocalVarDescriptors) {
   const char* kScript =
-    "var port;\n"  // Set to our mock port by C++.
-    "\n"
-    "class A {\n"
-    "  var a;\n"
-    "  dynamic b() {}\n"
-    "  dynamic c() {\n"
-    "    var d = () { b(); };\n"
-    "    return d;\n"
-    "  }\n"
-    "}\n"
-    "main() {\n"
-    "  var z = new A();\n"
-    "  var x = z.c();\n"
-    "  x();\n"
-    "}";
+      "var port;\n"  // Set to our mock port by C++.
+      "\n"
+      "class A {\n"
+      "  var a;\n"
+      "  dynamic b() {}\n"
+      "  dynamic c() {\n"
+      "    var d = () { b(); };\n"
+      "    return d;\n"
+      "  }\n"
+      "}\n"
+      "main() {\n"
+      "  var z = new A();\n"
+      "  var x = z.c();\n"
+      "  x();\n"
+      "}";
 
   Isolate* isolate = thread->isolate();
   isolate->set_is_runnable(true);
@@ -497,8 +498,10 @@
   Array& service_msg = Array::Handle();
 
   // Fetch object.
-  service_msg = EvalF(lib, "[0, port, '0', 'getObject', "
-                      "['objectId'], ['objects/%" Pd "']]", id);
+  service_msg = EvalF(lib,
+                      "[0, port, '0', 'getObject', "
+                      "['objectId'], ['objects/%" Pd "']]",
+                      id);
   HandleIsolateMessage(isolate, service_msg);
   EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   // Check type.
@@ -509,24 +512,22 @@
 }
 
 
-
 static void WeakHandleFinalizer(void* isolate_callback_data,
                                 Dart_WeakPersistentHandle handle,
-                                void* peer) {
-}
+                                void* peer) {}
 
 
 TEST_CASE(Service_PersistentHandles) {
   const char* kScript =
-    "var port;\n"  // Set to our mock port by C++.
-    "\n"
-    "class A {\n"
-    "  var a;\n"
-    "}\n"
-    "var global = new A();\n"
-    "main() {\n"
-    "  return global;\n"
-    "}";
+      "var port;\n"  // Set to our mock port by C++.
+      "\n"
+      "class A {\n"
+      "  var a;\n"
+      "}\n"
+      "var global = new A();\n"
+      "main() {\n"
+      "  return global;\n"
+      "}";
 
   Isolate* isolate = thread->isolate();
   isolate->set_is_runnable(true);
@@ -543,10 +544,8 @@
 
   // Create a weak persistent handle to global.
   Dart_WeakPersistentHandle weak_persistent_handle =
-      Dart_NewWeakPersistentHandle(result,
-                                   reinterpret_cast<void*>(0xdeadbeef),
-                                   128,
-                                   WeakHandleFinalizer);
+      Dart_NewWeakPersistentHandle(result, reinterpret_cast<void*>(0xdeadbeef),
+                                   128, WeakHandleFinalizer);
 
   // Build a mock message handler and wrap it in a dart port.
   ServiceTestMessageHandler handler;
@@ -613,52 +612,50 @@
     char buf[1024];
     bool ref = offset % 2 == 0;
     OS::SNPrint(buf, sizeof(buf),
-                (ref
-                 ? "[0, port, '0', '_getObjectByAddress', "
-                   "['address', 'ref'], ['%" Px "', 'true']]"
-                 : "[0, port, '0', '_getObjectByAddress', "
-                   "['address'], ['%" Px "']]"),
+                (ref ? "[0, port, '0', '_getObjectByAddress', "
+                       "['address', 'ref'], ['%" Px "', 'true']]"
+                     : "[0, port, '0', '_getObjectByAddress', "
+                       "['address'], ['%" Px "']]"),
                 addr);
     service_msg = Eval(lib, buf);
     HandleIsolateMessage(isolate, service_msg);
     EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
-    EXPECT_SUBSTRING(ref ? "\"type\":\"@Instance\"" :
-                           "\"type\":\"Instance\"",
+    EXPECT_SUBSTRING(ref ? "\"type\":\"@Instance\"" : "\"type\":\"Instance\"",
                      handler.msg());
     EXPECT_SUBSTRING("\"kind\":\"String\"", handler.msg());
     EXPECT_SUBSTRING("foobar", handler.msg());
   }
   // Expect null when no object is found.
-  service_msg = Eval(lib, "[0, port, '0', '_getObjectByAddress', "
+  service_msg = Eval(lib,
+                     "[0, port, '0', '_getObjectByAddress', "
                      "['address'], ['7']]");
   HandleIsolateMessage(isolate, service_msg);
   EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   // TODO(turnidge): Should this be a ServiceException instead?
-  EXPECT_SUBSTRING("{\"type\":\"Sentinel\",\"kind\":\"Free\","
-                   "\"valueAsString\":\"<free>\"",
-               handler.msg());
+  EXPECT_SUBSTRING(
+      "{\"type\":\"Sentinel\",\"kind\":\"Free\","
+      "\"valueAsString\":\"<free>\"",
+      handler.msg());
 }
 
 
-static bool alpha_callback(
-    const char* name,
-    const char** option_keys,
-    const char** option_values,
-    intptr_t num_options,
-    void* user_data,
-    const char** result) {
+static bool alpha_callback(const char* name,
+                           const char** option_keys,
+                           const char** option_values,
+                           intptr_t num_options,
+                           void* user_data,
+                           const char** result) {
   *result = strdup("alpha");
   return true;
 }
 
 
-static bool beta_callback(
-    const char* name,
-    const char** option_keys,
-    const char** option_values,
-    intptr_t num_options,
-    void* user_data,
-    const char** result) {
+static bool beta_callback(const char* name,
+                          const char** option_keys,
+                          const char** option_values,
+                          intptr_t num_options,
+                          void* user_data,
+                          const char** result) {
   *result = strdup("beta");
   return false;
 }
@@ -666,13 +663,13 @@
 
 TEST_CASE(Service_EmbedderRootHandler) {
   const char* kScript =
-    "var port;\n"  // Set to our mock port by C++.
-    "\n"
-    "var x = 7;\n"
-    "main() {\n"
-    "  x = x * x;\n"
-    "  x = x / 13;\n"
-    "}";
+      "var port;\n"  // Set to our mock port by C++.
+      "\n"
+      "var x = 7;\n"
+      "main() {\n"
+      "  x = x * x;\n"
+      "  x = x / 13;\n"
+      "}";
 
   Dart_RegisterRootServiceRequestCallback("alpha", alpha_callback, NULL);
   Dart_RegisterRootServiceRequestCallback("beta", beta_callback, NULL);
@@ -699,20 +696,19 @@
   service_msg = Eval(lib, "[0, port, 1, 'beta', [], []]");
   HandleRootMessage(service_msg);
   EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
-  EXPECT_STREQ("{\"jsonrpc\":\"2.0\", \"error\":beta,\"id\":1}",
-               handler.msg());
+  EXPECT_STREQ("{\"jsonrpc\":\"2.0\", \"error\":beta,\"id\":1}", handler.msg());
 }
 
 
 TEST_CASE(Service_EmbedderIsolateHandler) {
   const char* kScript =
-    "var port;\n"  // Set to our mock port by C++.
-    "\n"
-    "var x = 7;\n"
-    "main() {\n"
-    "  x = x * x;\n"
-    "  x = x / 13;\n"
-    "}";
+      "var port;\n"  // Set to our mock port by C++.
+      "\n"
+      "var x = 7;\n"
+      "main() {\n"
+      "  x = x * x;\n"
+      "  x = x / 13;\n"
+      "}";
 
   Dart_RegisterIsolateServiceRequestCallback("alpha", alpha_callback, NULL);
   Dart_RegisterIsolateServiceRequestCallback("beta", beta_callback, NULL);
diff --git a/runtime/vm/signal_handler.h b/runtime/vm/signal_handler.h
index 615e584..734db06 100644
--- a/runtime/vm/signal_handler.h
+++ b/runtime/vm/signal_handler.h
@@ -2,14 +2,14 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_SIGNAL_HANDLER_H_
-#define VM_SIGNAL_HANDLER_H_
+#ifndef RUNTIME_VM_SIGNAL_HANDLER_H_
+#define RUNTIME_VM_SIGNAL_HANDLER_H_
 
 #include "vm/allocation.h"
 #include "vm/globals.h"
 
 #if defined(TARGET_OS_LINUX)
-#include <signal.h>  // NOLINT
+#include <signal.h>    // NOLINT
 #include <ucontext.h>  // NOLINT
 #elif defined(TARGET_OS_ANDROID)
 #include <signal.h>  // NOLINT
@@ -19,23 +19,22 @@
 typedef struct sigcontext mcontext_t;
 typedef struct ucontext {
   uint32_t uc_flags;
-  struct ucontext *uc_link;
+  struct ucontext* uc_link;
   stack_t uc_stack;
   struct sigcontext uc_mcontext;
   uint32_t uc_sigmask;
 } ucontext_t;
-#endif  // !defined(__BIONIC_HAVE_UCONTEXT_T)
+#endif                       // !defined(__BIONIC_HAVE_UCONTEXT_T)
 #elif defined(TARGET_OS_MACOS)
-#include <signal.h>  // NOLINT
+#include <signal.h>        // NOLINT
 #include <sys/ucontext.h>  // NOLINT
 #elif defined(TARGET_OS_WINDOWS)
 // Stub out for windows.
 struct siginfo_t;
 struct mcontext_t;
-struct sigset_t {
-};
+struct sigset_t {};
 #elif defined(TARGET_OS_FUCHSIA)
-#include <signal.h>  // NOLINT
+#include <signal.h>    // NOLINT
 #include <ucontext.h>  // NOLINT
 #endif
 
@@ -43,8 +42,8 @@
 // Old linux kernels on ARM might require a trampoline to
 // work around incorrect Thumb -> ARM transitions. See SignalHandlerTrampoline
 // below for more details.
-#if defined(HOST_ARCH_ARM) && \
-    (defined(TARGET_OS_LINUX) || defined(TARGET_OS_ANDROID)) && \
+#if defined(HOST_ARCH_ARM) &&                                                  \
+    (defined(TARGET_OS_LINUX) || defined(TARGET_OS_ANDROID)) &&                \
     !defined(__thumb__)
 #define USE_SIGNAL_HANDLER_TRAMPOLINE
 #endif
@@ -52,12 +51,11 @@
 
 namespace dart {
 
-typedef void (*SignalAction)(int signal, siginfo_t* info,
-                             void* context);
+typedef void (*SignalAction)(int signal, siginfo_t* info, void* context);
 
 class SignalHandler : public AllStatic {
  public:
-  template<SignalAction action>
+  template <SignalAction action>
   static void Install() {
 #if defined(USE_SIGNAL_HANDLER_TRAMPOLINE)
     InstallImpl(SignalHandlerTrampoline<action>);
@@ -108,10 +106,9 @@
     register siginfo_t* arg1 asm("r1") = info;
     register void* arg2 asm("r2") = context_;
     asm volatile("bx %3"
-                  :
-                  : "r"(arg0), "r"(arg1), "r"(arg2),
-                    "r"(action)
-                  : "memory");
+                 :
+                 : "r"(arg0), "r"(arg1), "r"(arg2), "r"(action)
+                 : "memory");
   }
 #endif  // defined(USE_SIGNAL_HANDLER_TRAMPOLINE)
 };
@@ -122,4 +119,4 @@
 
 }  // namespace dart
 
-#endif  // VM_SIGNAL_HANDLER_H_
+#endif  // RUNTIME_VM_SIGNAL_HANDLER_H_
diff --git a/runtime/vm/simulator.h b/runtime/vm/simulator.h
index b73bd97..6dbdbc6 100644
--- a/runtime/vm/simulator.h
+++ b/runtime/vm/simulator.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_SIMULATOR_H_
-#define VM_SIMULATOR_H_
+#ifndef RUNTIME_VM_SIMULATOR_H_
+#define RUNTIME_VM_SIMULATOR_H_
 
 #include "vm/globals.h"
 
@@ -24,4 +24,4 @@
 #endif  // defined(TARGET_ARCH_...)
 #endif  // defined(USING_SIMULATOR)
 
-#endif  // VM_SIMULATOR_H_
+#endif  // RUNTIME_VM_SIMULATOR_H_
diff --git a/runtime/vm/simulator_arm.cc b/runtime/vm/simulator_arm.cc
index 9c3e3cf..2b64e48 100644
--- a/runtime/vm/simulator_arm.cc
+++ b/runtime/vm/simulator_arm.cc
@@ -24,9 +24,13 @@
 
 namespace dart {
 
-DEFINE_FLAG(uint64_t, trace_sim_after, ULLONG_MAX,
+DEFINE_FLAG(uint64_t,
+            trace_sim_after,
+            ULLONG_MAX,
             "Trace simulator execution after instruction count reached.");
-DEFINE_FLAG(uint64_t, stop_sim_at, ULLONG_MAX,
+DEFINE_FLAG(uint64_t,
+            stop_sim_at,
+            ULLONG_MAX,
             "Instruction address or instruction count to stop simulator at.");
 
 
@@ -96,7 +100,9 @@
 
   static TokenPosition GetApproximateTokenIndex(const Code& code, uword pc);
 
-  static void PrintDartFrame(uword pc, uword fp, uword sp,
+  static void PrintDartFrame(uword pc,
+                             uword fp,
+                             uword sp,
                              const Function& function,
                              TokenPosition token_pos,
                              bool is_optimized,
@@ -119,8 +125,7 @@
 }
 
 
-SimulatorDebugger::~SimulatorDebugger() {
-}
+SimulatorDebugger::~SimulatorDebugger() {}
 
 
 void SimulatorDebugger::Stop(Instr* instr, const char* message) {
@@ -130,22 +135,13 @@
 
 
 static Register LookupCpuRegisterByName(const char* name) {
-  static const char* kNames[] = {
-      "r0",  "r1",  "r2",  "r3",
-      "r4",  "r5",  "r6",  "r7",
-      "r8",  "r9",  "r10", "r11",
-      "r12", "r13", "r14", "r15",
-      "pc",  "lr",  "sp",  "ip",
-      "fp",  "pp",  "ctx"
-  };
-  static const Register kRegisters[] = {
-      R0,  R1,  R2,  R3,
-      R4,  R5,  R6,  R7,
-      R8,  R9,  R10, R11,
-      R12, R13, R14, R15,
-      PC,  LR,  SP,  IP,
-      FP,  PP,  CTX
-  };
+  static const char* kNames[] = {"r0",  "r1",  "r2",  "r3",  "r4",  "r5",
+                                 "r6",  "r7",  "r8",  "r9",  "r10", "r11",
+                                 "r12", "r13", "r14", "r15", "pc",  "lr",
+                                 "sp",  "ip",  "fp",  "pp",  "ctx"};
+  static const Register kRegisters[] = {R0, R1, R2,  R3,  R4,  R5,  R6,  R7,
+                                        R8, R9, R10, R11, R12, R13, R14, R15,
+                                        PC, LR, SP,  IP,  FP,  PP,  CTX};
   ASSERT(ARRAY_SIZE(kNames) == ARRAY_SIZE(kRegisters));
   for (unsigned i = 0; i < ARRAY_SIZE(kNames); i++) {
     if (strcmp(kNames[i], name) == 0) {
@@ -245,7 +241,7 @@
 
 
 TokenPosition SimulatorDebugger::GetApproximateTokenIndex(const Code& code,
-                                                            uword pc) {
+                                                          uword pc) {
   TokenPosition token_pos = TokenPosition::kNoSource;
   uword pc_offset = pc - code.PayloadStart();
   const PcDescriptors& descriptors =
@@ -262,7 +258,9 @@
 }
 
 
-void SimulatorDebugger::PrintDartFrame(uword pc, uword fp, uword sp,
+void SimulatorDebugger::PrintDartFrame(uword pc,
+                                       uword fp,
+                                       uword sp,
                                        const Function& function,
                                        TokenPosition token_pos,
                                        bool is_optimized,
@@ -275,19 +273,15 @@
   if (token_pos.IsReal()) {
     script.GetTokenLocation(token_pos, &line, &column);
   }
-  OS::Print("pc=0x%" Px " fp=0x%" Px " sp=0x%" Px " %s%s (%s:%" Pd
-            ":%" Pd ")\n",
-            pc, fp, sp,
-            is_optimized ? (is_inlined ? "inlined " : "optimized ") : "",
-            func_name.ToCString(),
-            url.ToCString(),
-            line, column);
+  OS::Print(
+      "pc=0x%" Px " fp=0x%" Px " sp=0x%" Px " %s%s (%s:%" Pd ":%" Pd ")\n", pc,
+      fp, sp, is_optimized ? (is_inlined ? "inlined " : "optimized ") : "",
+      func_name.ToCString(), url.ToCString(), line, column);
 }
 
 
 void SimulatorDebugger::PrintBacktrace() {
-  StackFrameIterator frames(sim_->get_register(FP),
-                            sim_->get_register(SP),
+  StackFrameIterator frames(sim_->get_register(FP), sim_->get_register(SP),
                             sim_->get_pc(),
                             StackFrameIterator::kDontValidateFrames);
   StackFrame* frame = frames.NextFrame();
@@ -312,25 +306,25 @@
           uword unoptimized_pc = it.pc();
           it.Advance();
           if (!it.Done()) {
-            PrintDartFrame(unoptimized_pc, frame->fp(), frame->sp(),
-                           inlined_function,
-                           GetApproximateTokenIndex(unoptimized_code,
-                                                    unoptimized_pc),
-                           true, true);
+            PrintDartFrame(
+                unoptimized_pc, frame->fp(), frame->sp(), inlined_function,
+                GetApproximateTokenIndex(unoptimized_code, unoptimized_pc),
+                true, true);
           }
         }
         // Print the optimized inlining frame below.
       }
-      PrintDartFrame(frame->pc(), frame->fp(), frame->sp(),
-                     function,
+      PrintDartFrame(frame->pc(), frame->fp(), frame->sp(), function,
                      GetApproximateTokenIndex(code, frame->pc()),
                      code.is_optimized(), false);
     } else {
       OS::Print("pc=0x%" Px " fp=0x%" Px " sp=0x%" Px " %s frame\n",
                 frame->pc(), frame->fp(), frame->sp(),
-                frame->IsEntryFrame() ? "entry" :
-                    frame->IsExitFrame() ? "exit" :
-                        frame->IsStubFrame() ? "stub" : "invalid");
+                frame->IsEntryFrame()
+                    ? "entry"
+                    : frame->IsExitFrame()
+                          ? "exit"
+                          : frame->IsStubFrame() ? "stub" : "invalid");
     }
     frame = frames.NextFrame();
   }
@@ -425,26 +419,27 @@
                         "%" XSTR(ARG_SIZE) "s",
                         cmd, arg1, arg2);
       if ((strcmp(cmd, "h") == 0) || (strcmp(cmd, "help") == 0)) {
-        OS::Print("c/cont -- continue execution\n"
-                  "disasm -- disassemble instrs at current pc location\n"
-                  "  other variants are:\n"
-                  "    disasm <address>\n"
-                  "    disasm <address> <number_of_instructions>\n"
-                  "  by default 10 instrs are disassembled\n"
-                  "del -- delete breakpoints\n"
-                  "flags -- print flag values\n"
-                  "gdb -- transfer control to gdb\n"
-                  "h/help -- print this help string\n"
-                  "break <address> -- set break point at specified address\n"
-                  "p/print <reg or icount or value or *addr> -- print integer\n"
-                  "ps/printsingle <sreg or *addr> -- print float value\n"
-                  "pd/printdouble <dreg or *addr> -- print double value\n"
-                  "po/printobject <*reg or *addr> -- print object\n"
-                  "si/stepi -- single step an instruction\n"
-                  "trace -- toggle execution tracing mode\n"
-                  "bt -- print backtrace\n"
-                  "unstop -- if current pc is a stop instr make it a nop\n"
-                  "q/quit -- Quit the debugger and exit the program\n");
+        OS::Print(
+            "c/cont -- continue execution\n"
+            "disasm -- disassemble instrs at current pc location\n"
+            "  other variants are:\n"
+            "    disasm <address>\n"
+            "    disasm <address> <number_of_instructions>\n"
+            "  by default 10 instrs are disassembled\n"
+            "del -- delete breakpoints\n"
+            "flags -- print flag values\n"
+            "gdb -- transfer control to gdb\n"
+            "h/help -- print this help string\n"
+            "break <address> -- set break point at specified address\n"
+            "p/print <reg or icount or value or *addr> -- print integer\n"
+            "ps/printsingle <sreg or *addr> -- print float value\n"
+            "pd/printdouble <dreg or *addr> -- print double value\n"
+            "po/printobject <*reg or *addr> -- print object\n"
+            "si/stepi -- single step an instruction\n"
+            "trace -- toggle execution tracing mode\n"
+            "bt -- print backtrace\n"
+            "unstop -- if current pc is a stop instr make it a nop\n"
+            "q/quit -- Quit the debugger and exit the program\n");
       } else if ((strcmp(cmd, "quit") == 0) || (strcmp(cmd, "q") == 0)) {
         OS::Print("Quitting\n");
         OS::Exit(0);
@@ -488,8 +483,8 @@
           double dvalue;
           if (GetDValue(arg1, &dvalue)) {
             uint64_t long_value = bit_cast<uint64_t, double>(dvalue);
-            OS::Print("%s: %llu 0x%llx %.8g\n",
-                arg1, long_value, long_value, dvalue);
+            OS::Print("%s: %llu 0x%llx %.8g\n", arg1, long_value, long_value,
+                      dvalue);
           } else {
             OS::Print("%s unrecognized\n", arg1);
           }
@@ -506,8 +501,8 @@
             if (Isolate::Current()->heap()->Contains(value)) {
               OS::Print("%s: \n", arg1);
 #if defined(DEBUG)
-              const Object& obj = Object::Handle(
-                  reinterpret_cast<RawObject*>(value));
+              const Object& obj =
+                  Object::Handle(reinterpret_cast<RawObject*>(value));
               obj.Print();
 #endif  // defined(DEBUG)
             } else {
@@ -641,9 +636,7 @@
       return NULL;
     }
     intptr_t len = strlen(line_buf);
-    if (len > 1 &&
-        line_buf[len - 2] == '\\' &&
-        line_buf[len - 1] == '\n') {
+    if (len > 1 && line_buf[len - 2] == '\\' && line_buf[len - 1] == '\n') {
       // When we read a line that ends with a "\" we remove the escape and
       // append the remainder.
       line_buf[len - 2] = '\n';
@@ -689,8 +682,8 @@
 
 // Synchronization primitives support.
 Mutex* Simulator::exclusive_access_lock_ = NULL;
-Simulator::AddressTag Simulator::exclusive_access_state_[kNumAddressTags] =
-    {{NULL, 0}};
+Simulator::AddressTag Simulator::exclusive_access_state_[kNumAddressTags] = {
+    {NULL, 0}};
 int Simulator::next_address_tag_ = 0;
 
 
@@ -707,9 +700,9 @@
   // the size specified by the user and the buffer space needed for
   // handling stack overflow exceptions. To be safe in potential
   // stack underflows we also add some underflow buffer space.
-  stack_ = new char[(OSThread::GetSpecifiedStackSize() +
-                     OSThread::kStackSizeBuffer +
-                     kSimulatorStackUnderflowSize)];
+  stack_ =
+      new char[(OSThread::GetSpecifiedStackSize() + OSThread::kStackSizeBuffer +
+                kSimulatorStackUnderflowSize)];
   pc_modified_ = false;
   icount_ = 0;
   break_pc_ = NULL;
@@ -741,7 +734,7 @@
   }
   // Since VFP registers are overlapping, single-precision registers should
   // already be initialized.
-  ASSERT(2*kNumberOfDRegisters >= kNumberOfSRegisters);
+  ASSERT(2 * kNumberOfDRegisters >= kNumberOfSRegisters);
   for (int i = 0; i < kNumberOfSRegisters; i++) {
     ASSERT(sregisters_[i] == 0.0);
   }
@@ -820,10 +813,9 @@
     Redirection* list_head = list_;
     do {
       next_ = list_head;
-      list_head = reinterpret_cast<Redirection*>(
-          AtomicOperations::CompareAndSwapWord(
-              reinterpret_cast<uword*>(&list_),
-              reinterpret_cast<uword>(next_),
+      list_head =
+          reinterpret_cast<Redirection*>(AtomicOperations::CompareAndSwapWord(
+              reinterpret_cast<uword*>(&list_), reinterpret_cast<uword>(next_),
               reinterpret_cast<uword>(this)));
     } while (list_head != next_);
   }
@@ -980,8 +972,8 @@
   // it will be possible to disassemble the code and inspect registers.
   char buffer[128];
   snprintf(buffer, sizeof(buffer),
-           "illegal memory access at 0x%" Px ", pc=0x%" Px "\n",
-           addr, fault_pc);
+           "illegal memory access at 0x%" Px ", pc=0x%" Px "\n", addr,
+           fault_pc);
   SimulatorDebugger dbg(this);
   dbg.Stop(instr, buffer);
   // The debugger will return control in non-interactive mode.
@@ -1001,8 +993,8 @@
   // The debugger will not be able to single step past this instruction, but
   // it will be possible to disassemble the code and inspect registers.
   char buffer[64];
-  snprintf(buffer, sizeof(buffer),
-           "unaligned %s at 0x%" Px ", pc=%p\n", msg, addr, instr);
+  snprintf(buffer, sizeof(buffer), "unaligned %s at 0x%" Px ", pc=%p\n", msg,
+           addr, instr);
   SimulatorDebugger dbg(this);
   dbg.Stop(instr, buffer);
   // The debugger will return control in non-interactive mode.
@@ -1194,7 +1186,7 @@
   // To be safe in potential stack underflows we leave some buffer above and
   // set the stack top.
   return StackBase() +
-      (OSThread::GetSpecifiedStackSize() + OSThread::kStackSizeBuffer);
+         (OSThread::GetSpecifiedStackSize() + OSThread::kStackSizeBuffer);
 }
 
 
@@ -1205,8 +1197,7 @@
 
 // Unsupported instructions use Format to print an error and stop execution.
 void Simulator::Format(Instr* instr, const char* format) {
-  OS::Print("Simulator found unsupported instruction:\n 0x%p: %s\n",
-            instr,
+  OS::Print("Simulator found unsupported instruction:\n 0x%p: %s\n", instr,
             format);
   UNIMPLEMENTED();
 }
@@ -1216,22 +1207,38 @@
 // condition bits.
 bool Simulator::ConditionallyExecute(Instr* instr) {
   switch (instr->ConditionField()) {
-    case EQ: return z_flag_;
-    case NE: return !z_flag_;
-    case CS: return c_flag_;
-    case CC: return !c_flag_;
-    case MI: return n_flag_;
-    case PL: return !n_flag_;
-    case VS: return v_flag_;
-    case VC: return !v_flag_;
-    case HI: return c_flag_ && !z_flag_;
-    case LS: return !c_flag_ || z_flag_;
-    case GE: return n_flag_ == v_flag_;
-    case LT: return n_flag_ != v_flag_;
-    case GT: return !z_flag_ && (n_flag_ == v_flag_);
-    case LE: return z_flag_ || (n_flag_ != v_flag_);
-    case AL: return true;
-    default: UNREACHABLE();
+    case EQ:
+      return z_flag_;
+    case NE:
+      return !z_flag_;
+    case CS:
+      return c_flag_;
+    case CC:
+      return !c_flag_;
+    case MI:
+      return n_flag_;
+    case PL:
+      return !n_flag_;
+    case VS:
+      return v_flag_;
+    case VC:
+      return !v_flag_;
+    case HI:
+      return c_flag_ && !z_flag_;
+    case LS:
+      return !c_flag_ || z_flag_;
+    case GE:
+      return n_flag_ == v_flag_;
+    case LT:
+      return n_flag_ != v_flag_;
+    case GT:
+      return !z_flag_ && (n_flag_ == v_flag_);
+    case LE:
+      return z_flag_ || (n_flag_ != v_flag_);
+    case AL:
+      return true;
+    default:
+      UNREACHABLE();
   }
   return false;
 }
@@ -1341,7 +1348,7 @@
   } else {
     // by register
     Register rs = instr->RsField();
-    shift_amount = get_register(rs) &0xff;
+    shift_amount = get_register(rs) & 0xff;
     switch (shift) {
       case ASR: {
         if (shift_amount == 0) {
@@ -1509,8 +1516,10 @@
 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);
+typedef int32_t (*SimulatorLeafRuntimeCall)(int32_t r0,
+                                            int32_t r1,
+                                            int32_t r2,
+                                            int32_t r3);
 
 // Calls to leaf float Dart runtime functions are based on this interface.
 typedef double (*SimulatorLeafFloatRuntimeCall)(double d0, double d1);
@@ -1542,7 +1551,7 @@
         }
         if (redirection->call_kind() == kRuntimeCall) {
           NativeArguments arguments;
-          ASSERT(sizeof(NativeArguments) == 4*kWordSize);
+          ASSERT(sizeof(NativeArguments) == 4 * kWordSize);
           arguments.thread_ = reinterpret_cast<Thread*>(get_register(R0));
           arguments.argc_tag_ = get_register(R1);
           arguments.argv_ = reinterpret_cast<RawObject**>(get_register(R2));
@@ -1562,7 +1571,7 @@
           SimulatorLeafRuntimeCall target =
               reinterpret_cast<SimulatorLeafRuntimeCall>(external);
           r0 = target(r0, r1, r2, r3);
-          set_register(R0, r0);  // Set returned result from function.
+          set_register(R0, r0);       // Set returned result from function.
           set_register(R1, icount_);  // Zap unused result register.
         } else if (redirection->call_kind() == kLeafFloatRuntimeCall) {
           ASSERT((0 <= redirection->argument_count()) &&
@@ -1627,8 +1636,8 @@
           for (int i = D1; i <= D7; i++) {
             set_dregister(static_cast<DRegister>(i), zap_dvalue);
           }
-          // The above loop also zaps overlapping registers S2-S15.
-          // Registers D8-D15 (overlapping with S16-S31) are preserved.
+// The above loop also zaps overlapping registers S2-S15.
+// Registers D8-D15 (overlapping with S16-S31) are preserved.
 #if defined(VFPv3_D32)
           for (int i = D16; i <= D31; i++) {
             set_dregister(static_cast<DRegister>(i), zap_dvalue);
@@ -1719,7 +1728,7 @@
               dbg.Stop(instr, buffer);
             }
           } else {
-             // Format(instr, "smc'cond");
+            // Format(instr, "smc'cond");
             UnimplementedInstruction(instr);
           }
           break;
@@ -1741,8 +1750,8 @@
         int32_t rd_val = 0;
         switch (instr->Bits(21, 3)) {
           case 1:
-            // Registers rd, rn, rm, ra are encoded as rn, rm, rs, rd.
-            // Format(instr, "mla'cond's 'rn, 'rm, 'rs, 'rd");
+          // Registers rd, rn, rm, ra are encoded as rn, rm, rs, rd.
+          // Format(instr, "mla'cond's 'rn, 'rm, 'rs, 'rd");
           case 3: {
             // Registers rd, rn, rm, ra are encoded as rn, rm, rs, rd.
             // Format(instr, "mls'cond's 'rn, 'rm, 'rs, 'rd");
@@ -1768,18 +1777,18 @@
             break;
           }
           case 4:
-            // Registers rd_lo, rd_hi, rn, rm are encoded as rd, rn, rm, rs.
-            // Format(instr, "umull'cond's 'rd, 'rn, 'rm, 'rs");
+          // Registers rd_lo, rd_hi, rn, rm are encoded as rd, rn, rm, rs.
+          // Format(instr, "umull'cond's 'rd, 'rn, 'rm, 'rs");
           case 6: {
             // Registers rd_lo, rd_hi, rn, rm are encoded as rd, rn, rm, rs.
             // Format(instr, "smull'cond's 'rd, 'rn, 'rm, 'rs");
             int64_t result;
             if (instr->Bits(21, 3) == 4) {  // umull
-              uint64_t left_op  = static_cast<uint32_t>(rm_val);
+              uint64_t left_op = static_cast<uint32_t>(rm_val);
               uint64_t right_op = static_cast<uint32_t>(rs_val);
               result = left_op * right_op;  // Unsigned multiplication.
-            } else {  // smull
-              int64_t left_op  = static_cast<int32_t>(rm_val);
+            } else {                        // smull
+              int64_t left_op = static_cast<int32_t>(rm_val);
               int64_t right_op = static_cast<int32_t>(rs_val);
               result = left_op * right_op;  // Signed multiplication.
             }
@@ -1792,7 +1801,7 @@
                 // Collapse bits 0..31 into bit 32 so that 32-bit Z check works.
                 hi_res |= 1;
               }
-              ASSERT((result == 0) == (hi_res == 0));  // Z bit
+              ASSERT((result == 0) == (hi_res == 0));                 // Z bit
               ASSERT(((result & (1LL << 63)) != 0) == (hi_res < 0));  // N bit
               SetNZFlags(hi_res);
             }
@@ -1806,8 +1815,8 @@
               UnimplementedInstruction(instr);
             }
           case 5:
-            // Registers rd_lo, rd_hi, rn, rm are encoded as rd, rn, rm, rs.
-            // Format(instr, "umlal'cond's 'rd, 'rn, 'rm, 'rs");
+          // Registers rd_lo, rd_hi, rn, rm are encoded as rd, rn, rm, rs.
+          // Format(instr, "umlal'cond's 'rd, 'rn, 'rm, 'rs");
           case 7: {
             // Registers rd_lo, rd_hi, rn, rm are encoded as rd, rn, rm, rs.
             // Format(instr, "smlal'cond's 'rd, 'rn, 'rm, 'rs");
@@ -1818,21 +1827,21 @@
             int64_t accum = Utils::LowHighTo64Bits(accum_lo, accum_hi);
             int64_t result;
             if (instr->Bits(21, 3) == 5) {  // umlal
-              uint64_t left_op  = static_cast<uint32_t>(rm_val);
+              uint64_t left_op = static_cast<uint32_t>(rm_val);
               uint64_t right_op = static_cast<uint32_t>(rs_val);
               result = accum + left_op * right_op;  // Unsigned multiplication.
-            } else if (instr->Bits(21, 3) == 7) {  // smlal
-              int64_t left_op  = static_cast<int32_t>(rm_val);
+            } else if (instr->Bits(21, 3) == 7) {   // smlal
+              int64_t left_op = static_cast<int32_t>(rm_val);
               int64_t right_op = static_cast<int32_t>(rs_val);
               result = accum + left_op * right_op;  // Signed multiplication.
             } else {
               ASSERT(instr->Bits(21, 3) == 2);  // umaal
               ASSERT(!instr->HasS());
-              uint64_t left_op  = static_cast<uint32_t>(rm_val);
+              uint64_t left_op = static_cast<uint32_t>(rm_val);
               uint64_t right_op = static_cast<uint32_t>(rs_val);
               result = left_op * right_op +  // Unsigned multiplication.
-                  static_cast<uint32_t>(rd_lo_val) +
-                  static_cast<uint32_t>(rd_hi_val);
+                       static_cast<uint32_t>(rd_lo_val) +
+                       static_cast<uint32_t>(rd_hi_val);
             }
             int32_t hi_res = Utils::High32Bits(result);
             int32_t lo_res = Utils::Low32Bits(result);
@@ -1843,7 +1852,7 @@
                 // Collapse bits 0..31 into bit 32 so that 32-bit Z check works.
                 hi_res |= 1;
               }
-              ASSERT((result == 0) == (hi_res == 0));  // Z bit
+              ASSERT((result == 0) == (hi_res == 0));                 // Z bit
               ASSERT(((result & (1LL << 63)) != 0) == (hi_res < 0));  // N bit
               SetNZFlags(hi_res);
             }
@@ -2484,7 +2493,7 @@
   if (instr->HasLink()) {
     set_register(LR, pc + Instr::kInstrSize);
   }
-  set_pc(pc+off);
+  set_pc(pc + off);
 }
 
 
@@ -2514,12 +2523,12 @@
         set_register(rn, Utils::High32Bits(dm_val));
       } else {
         // Format(instr, "vmovdrr'cond 'dm, 'rd, 'rn");
-        int64_t dm_val = Utils::LowHighTo64Bits(get_register(rd),
-                                                get_register(rn));
+        int64_t dm_val =
+            Utils::LowHighTo64Bits(get_register(rd), get_register(rn));
         set_dregister_bits(dm, dm_val);
       }
     }
-  } else if (instr-> IsVFPLoadStore()) {
+  } else if (instr->IsVFPLoadStore()) {
     Register rn = instr->RnField();
     int32_t addr = get_register(rn);
     int32_t imm_val = instr->Bits(0, 8) << 2;
@@ -2718,7 +2727,7 @@
           }
           break;
         }
-        case 0xb: {  // Other VFP data-processing instructions
+        case 0xb: {                  // Other VFP data-processing instructions
           if (instr->Bit(6) == 0) {  // vmov immediate
             if (instr->Bit(8) == 0) {
               // Format(instr, "vmovs'cond 'sd, #'immf");
@@ -2788,8 +2797,8 @@
               }
               break;
             }
-            case 4:  // vcmp, vcmpe
-            case 5: {  // vcmp #0.0, vcmpe #0.0
+            case 4:                      // vcmp, vcmpe
+            case 5: {                    // vcmp #0.0, vcmpe #0.0
               if (instr->Bit(7) == 1) {  // vcmpe
                 UnimplementedInstruction(instr);
               } else {
@@ -2952,9 +2961,9 @@
               set_sregister_bits(sd, sd_val);
               break;
             }
-            case 2:  // vcvtb, vcvtt
-            case 3:  // vcvtb, vcvtt
-            case 9:  // undefined
+            case 2:   // vcvtb, vcvtt
+            case 3:   // vcvtb, vcvtt
+            case 9:   // undefined
             case 10:  // vcvt between floating-point and fixed-point
             case 11:  // vcvt between floating-point and fixed-point
             case 14:  // vcvt between floating-point and fixed-point
@@ -2964,8 +2973,7 @@
               break;
             }
           }
-        }
-        break;
+        } break;
       }
     } else {
       // 8, 16, or 32-bit Transfer between ARM Core and VFP
@@ -3019,9 +3027,12 @@
 
 static float arm_reciprocal_sqrt_estimate(float a) {
   // From the ARM Architecture Reference Manual A2-87.
-  if (isinf(a) || (fabs(a) >= exp2f(126))) return 0.0;
-  else if (a == 0.0) return kPosInfinity;
-  else if (isnan(a)) return a;
+  if (isinf(a) || (fabs(a) >= exp2f(126)))
+    return 0.0;
+  else if (a == 0.0)
+    return kPosInfinity;
+  else if (isnan(a))
+    return a;
 
   uint32_t a_bits = bit_cast<uint32_t, float>(a);
   uint64_t scaled;
@@ -3059,10 +3070,11 @@
   // r in units of 1/256 rounded to nearest.
   int32_t s = static_cast<int>(256.0 * r + 0.5);
   double estimate = static_cast<double>(s) / 256.0;
-  ASSERT((estimate >= 1.0) && (estimate <= (511.0/256.0)));
+  ASSERT((estimate >= 1.0) && (estimate <= (511.0 / 256.0)));
 
   // result = 0 : result_exp<7:0> : estimate<51:29>
-  int32_t result_bits = ((result_exp & 0xff) << 23) |
+  int32_t result_bits =
+      ((result_exp & 0xff) << 23) |
       ((bit_cast<uint64_t, double>(estimate) >> 29) & 0x7fffff);
   return bit_cast<float, int32_t>(result_bits);
 }
@@ -3070,9 +3082,12 @@
 
 static float arm_recip_estimate(float a) {
   // From the ARM Architecture Reference Manual A2-85.
-  if (isinf(a) || (fabs(a) >= exp2f(126))) return 0.0;
-  else if (a == 0.0) return kPosInfinity;
-  else if (isnan(a)) return a;
+  if (isinf(a) || (fabs(a) >= exp2f(126)))
+    return 0.0;
+  else if (a == 0.0)
+    return kPosInfinity;
+  else if (isnan(a))
+    return a;
 
   uint32_t a_bits = bit_cast<uint32_t, float>(a);
   // scaled = '0011 1111 1110' : a<22:0> : Zeros(29)
@@ -3092,7 +3107,7 @@
   // r in units of 1/256 rounded to nearest.
   int32_t s = static_cast<int32_t>(256.0 * r + 0.5);
   double estimate = static_cast<double>(s) / 256.0;
-  ASSERT((estimate >= 1.0) && (estimate <= (511.0/256.0)));
+  ASSERT((estimate >= 1.0) && (estimate <= (511.0 / 256.0)));
 
   // result = sign : result_exp<7:0> : estimate<51:29>
   int32_t result_bits =
@@ -3102,8 +3117,10 @@
 }
 
 
-static void simd_value_swap(simd_value_t* s1, int i1,
-                            simd_value_t* s2, int i2) {
+static void simd_value_swap(simd_value_t* s1,
+                            int i1,
+                            simd_value_t* s2,
+                            int i2) {
   uint32_t tmp;
   tmp = s1->data_[i1].u;
   s1->data_[i1].u = s2->data_[i2].u;
@@ -3344,7 +3361,7 @@
       // Format(instr, "vmaxqs 'qd, 'qn, 'qm");
       for (int i = 0; i < 4; i++) {
         s8d.data_[i].f =
-          s8n.data_[i].f >= s8m.data_[i].f ? s8n.data_[i].f : s8m.data_[i].f;
+            s8n.data_[i].f >= s8m.data_[i].f ? s8n.data_[i].f : s8m.data_[i].f;
       }
     } else if ((instr->Bits(8, 4) == 7) && (instr->Bit(4) == 0) &&
                (instr->Bits(20, 2) == 3) && (instr->Bits(23, 2) == 3) &&
@@ -3874,12 +3891,7 @@
 }
 
 
-void Simulator::Longjmp(uword pc,
-                        uword sp,
-                        uword fp,
-                        RawObject* raw_exception,
-                        RawObject* raw_stacktrace,
-                        Thread* thread) {
+void Simulator::JumpToFrame(uword pc, uword sp, uword fp, Thread* thread) {
   // Walk over all setjmp buffers (simulated --> C++ transitions)
   // and try to find the setjmp associated with the simulated stack pointer.
   SimulatorSetjmpBuffer* buf = last_setjmp_buffer();
@@ -3902,15 +3914,11 @@
   thread->set_vm_tag(VMTag::kDartTagId);
   // Clear top exit frame.
   thread->set_top_exit_frame_info(0);
-
-  ASSERT(raw_exception != Object::null());
-  set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception));
-  set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace));
   // Restore pool pointer.
-  int32_t code = *reinterpret_cast<int32_t*>(
-      fp + kPcMarkerSlotFromFp * kWordSize);
-  int32_t pp = *reinterpret_cast<int32_t*>(
-      code + Code::object_pool_offset() - kHeapObjectTag);
+  int32_t code =
+      *reinterpret_cast<int32_t*>(fp + kPcMarkerSlotFromFp * kWordSize);
+  int32_t pp = *reinterpret_cast<int32_t*>(code + Code::object_pool_offset() -
+                                           kHeapObjectTag);
   set_register(CODE_REG, code);
   set_register(PP, pp);
   buf->Longjmp();
diff --git a/runtime/vm/simulator_arm.h b/runtime/vm/simulator_arm.h
index c163a62..5a59f5bc 100644
--- a/runtime/vm/simulator_arm.h
+++ b/runtime/vm/simulator_arm.h
@@ -9,10 +9,10 @@
 // which will start execution in the Simulator or forwards to the real entry
 // on a ARM HW platform.
 
-#ifndef VM_SIMULATOR_ARM_H_
-#define VM_SIMULATOR_ARM_H_
+#ifndef RUNTIME_VM_SIMULATOR_ARM_H_
+#define RUNTIME_VM_SIMULATOR_ARM_H_
 
-#ifndef VM_SIMULATOR_H_
+#ifndef RUNTIME_VM_SIMULATOR_H_
 #error Do not include simulator_arm.h directly; use simulator.h.
 #endif
 
@@ -52,9 +52,7 @@
   void set_register(Register reg, int32_t value);
   int32_t get_register(Register reg) const;
 
-  int32_t get_sp() const {
-    return get_register(SPREG);
-  }
+  int32_t get_sp() const { return get_register(SPREG); }
 
   // Special case of set_register and get_register to access the raw PC value.
   void set_pc(int32_t value);
@@ -129,12 +127,7 @@
 
   static uword FunctionForRedirect(uword redirect);
 
-  void Longjmp(uword pc,
-               uword sp,
-               uword fp,
-               RawObject* raw_exception,
-               RawObject* raw_stacktrace,
-               Thread* thread);
+  void JumpToFrame(uword pc, uword sp, uword fp, Thread* thread);
 
  private:
   // Known bad pc value to ensure that the simulator does not execute
@@ -177,9 +170,7 @@
   int32_t break_instr_;
 
   // Illegal memory access support.
-  static bool IsIllegalAddress(uword addr) {
-    return addr < 64*1024;
-  }
+  static bool IsIllegalAddress(uword addr) { return addr < 64 * 1024; }
   void HandleIllegalAccess(uword addr, Instr* instr);
 
   // Handles a legal instruction that the simulator does not implement.
@@ -273,9 +264,7 @@
   bool IsTracingExecution() const;
 
   // Longjmp support for exceptions.
-  SimulatorSetjmpBuffer* last_setjmp_buffer() {
-    return last_setjmp_buffer_;
-  }
+  SimulatorSetjmpBuffer* last_setjmp_buffer() { return last_setjmp_buffer_; }
   void set_last_setjmp_buffer(SimulatorSetjmpBuffer* buffer) {
     last_setjmp_buffer_ = buffer;
   }
@@ -287,4 +276,4 @@
 
 }  // namespace dart
 
-#endif  // VM_SIMULATOR_ARM_H_
+#endif  // RUNTIME_VM_SIMULATOR_ARM_H_
diff --git a/runtime/vm/simulator_arm64.cc b/runtime/vm/simulator_arm64.cc
index 0cfcb2a..65a2034 100644
--- a/runtime/vm/simulator_arm64.cc
+++ b/runtime/vm/simulator_arm64.cc
@@ -23,9 +23,13 @@
 
 namespace dart {
 
-DEFINE_FLAG(uint64_t, trace_sim_after, ULLONG_MAX,
+DEFINE_FLAG(uint64_t,
+            trace_sim_after,
+            ULLONG_MAX,
             "Trace simulator execution after instruction count reached.");
-DEFINE_FLAG(uint64_t, stop_sim_at, ULLONG_MAX,
+DEFINE_FLAG(uint64_t,
+            stop_sim_at,
+            ULLONG_MAX,
             "Instruction address or instruction count to stop simulator at.");
 
 
@@ -96,7 +100,9 @@
 
   static TokenPosition GetApproximateTokenIndex(const Code& code, uword pc);
 
-  static void PrintDartFrame(uword pc, uword fp, uword sp,
+  static void PrintDartFrame(uword pc,
+                             uword fp,
+                             uword sp,
                              const Function& function,
                              TokenPosition token_pos,
                              bool is_optimized,
@@ -119,8 +125,7 @@
 }
 
 
-SimulatorDebugger::~SimulatorDebugger() {
-}
+SimulatorDebugger::~SimulatorDebugger() {}
 
 
 void SimulatorDebugger::Stop(Instr* instr, const char* message) {
@@ -131,24 +136,19 @@
 
 static Register LookupCpuRegisterByName(const char* name) {
   static const char* kNames[] = {
-      "r0",  "r1",  "r2",  "r3",
-      "r4",  "r5",  "r6",  "r7",
-      "r8",  "r9",  "r10", "r11",
-      "r12", "r13", "r14", "r15",
-      "r16", "r17", "r18", "r19",
-      "r20", "r21", "r22", "r23",
-      "r24", "r25", "r26", "r27",
-      "r28", "r29", "r30",
+      "r0",  "r1",  "r2",  "r3",  "r4",  "r5",  "r6",  "r7",
+      "r8",  "r9",  "r10", "r11", "r12", "r13", "r14", "r15",
+      "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
+      "r24", "r25", "r26", "r27", "r28", "r29", "r30",
 
-      "ip0", "ip1", "pp",  "ctx", "fp",  "lr",  "sp", "zr",
+      "ip0", "ip1", "pp",  "ctx", "fp",  "lr",  "sp",  "zr",
   };
   static const Register kRegisters[] = {
-      R0,  R1,  R2,  R3,  R4,  R5,  R6,  R7,
-      R8,  R9,  R10, R11, R12, R13, R14, R15,
-      R16, R17, R18, R19, R20, R21, R22, R23,
-      R24, R25, R26, R27, R28, R29, R30,
+      R0,  R1,  R2,  R3,  R4,  R5,  R6,  R7,  R8,  R9,  R10,
+      R11, R12, R13, R14, R15, R16, R17, R18, R19, R20, R21,
+      R22, R23, R24, R25, R26, R27, R28, R29, R30,
 
-      IP0, IP1, PP, CTX, FP, LR, R31, ZR,
+      IP0, IP1, PP,  CTX, FP,  LR,  R31, ZR,
   };
   ASSERT(ARRAY_SIZE(kNames) == ARRAY_SIZE(kRegisters));
   for (unsigned i = 0; i < ARRAY_SIZE(kNames); i++) {
@@ -263,7 +263,7 @@
 
 
 TokenPosition SimulatorDebugger::GetApproximateTokenIndex(const Code& code,
-                                                            uword pc) {
+                                                          uword pc) {
   TokenPosition token_pos = TokenPosition::kNoSource;
   uword pc_offset = pc - code.PayloadStart();
   const PcDescriptors& descriptors =
@@ -280,7 +280,9 @@
 }
 
 
-void SimulatorDebugger::PrintDartFrame(uword pc, uword fp, uword sp,
+void SimulatorDebugger::PrintDartFrame(uword pc,
+                                       uword fp,
+                                       uword sp,
                                        const Function& function,
                                        TokenPosition token_pos,
                                        bool is_optimized,
@@ -293,19 +295,15 @@
   if (token_pos.IsReal()) {
     script.GetTokenLocation(token_pos, &line, &column);
   }
-  OS::Print("pc=0x%" Px " fp=0x%" Px " sp=0x%" Px " %s%s (%s:%" Pd
-            ":%" Pd ")\n",
-            pc, fp, sp,
-            is_optimized ? (is_inlined ? "inlined " : "optimized ") : "",
-            func_name.ToCString(),
-            url.ToCString(),
-            line, column);
+  OS::Print(
+      "pc=0x%" Px " fp=0x%" Px " sp=0x%" Px " %s%s (%s:%" Pd ":%" Pd ")\n", pc,
+      fp, sp, is_optimized ? (is_inlined ? "inlined " : "optimized ") : "",
+      func_name.ToCString(), url.ToCString(), line, column);
 }
 
 
 void SimulatorDebugger::PrintBacktrace() {
-  StackFrameIterator frames(sim_->get_register(FP),
-                            sim_->get_register(SP),
+  StackFrameIterator frames(sim_->get_register(FP), sim_->get_register(SP),
                             sim_->get_pc(),
                             StackFrameIterator::kDontValidateFrames);
   StackFrame* frame = frames.NextFrame();
@@ -330,25 +328,25 @@
           uword unoptimized_pc = it.pc();
           it.Advance();
           if (!it.Done()) {
-            PrintDartFrame(unoptimized_pc, frame->fp(), frame->sp(),
-                           inlined_function,
-                           GetApproximateTokenIndex(unoptimized_code,
-                                                    unoptimized_pc),
-                           true, true);
+            PrintDartFrame(
+                unoptimized_pc, frame->fp(), frame->sp(), inlined_function,
+                GetApproximateTokenIndex(unoptimized_code, unoptimized_pc),
+                true, true);
           }
         }
         // Print the optimized inlining frame below.
       }
-      PrintDartFrame(frame->pc(), frame->fp(), frame->sp(),
-                     function,
+      PrintDartFrame(frame->pc(), frame->fp(), frame->sp(), function,
                      GetApproximateTokenIndex(code, frame->pc()),
                      code.is_optimized(), false);
     } else {
       OS::Print("pc=0x%" Px " fp=0x%" Px " sp=0x%" Px " %s frame\n",
                 frame->pc(), frame->fp(), frame->sp(),
-                frame->IsEntryFrame() ? "entry" :
-                    frame->IsExitFrame() ? "exit" :
-                        frame->IsStubFrame() ? "stub" : "invalid");
+                frame->IsEntryFrame()
+                    ? "entry"
+                    : frame->IsExitFrame()
+                          ? "exit"
+                          : frame->IsStubFrame() ? "stub" : "invalid");
     }
     frame = frames.NextFrame();
   }
@@ -443,27 +441,28 @@
                         "%" XSTR(ARG_SIZE) "s",
                         cmd, arg1, arg2);
       if ((strcmp(cmd, "h") == 0) || (strcmp(cmd, "help") == 0)) {
-        OS::Print("c/cont -- continue execution\n"
-                  "disasm -- disassemble instrs at current pc location\n"
-                  "  other variants are:\n"
-                  "    disasm <address>\n"
-                  "    disasm <address> <number_of_instructions>\n"
-                  "  by default 10 instrs are disassembled\n"
-                  "del -- delete breakpoints\n"
-                  "flags -- print flag values\n"
-                  "gdb -- transfer control to gdb\n"
-                  "h/help -- print this help string\n"
-                  "break <address> -- set break point at specified address\n"
-                  "p/print <reg or icount or value or *addr> -- print integer\n"
-                  "pf/printfloat <vreg or *addr> --print float value\n"
-                  "pd/printdouble <vreg or *addr> -- print double value\n"
-                  "pq/printquad <vreg or *addr> -- print vector register\n"
-                  "po/printobject <*reg or *addr> -- print object\n"
-                  "si/stepi -- single step an instruction\n"
-                  "trace -- toggle execution tracing mode\n"
-                  "bt -- print backtrace\n"
-                  "unstop -- if current pc is a stop instr make it a nop\n"
-                  "q/quit -- Quit the debugger and exit the program\n");
+        OS::Print(
+            "c/cont -- continue execution\n"
+            "disasm -- disassemble instrs at current pc location\n"
+            "  other variants are:\n"
+            "    disasm <address>\n"
+            "    disasm <address> <number_of_instructions>\n"
+            "  by default 10 instrs are disassembled\n"
+            "del -- delete breakpoints\n"
+            "flags -- print flag values\n"
+            "gdb -- transfer control to gdb\n"
+            "h/help -- print this help string\n"
+            "break <address> -- set break point at specified address\n"
+            "p/print <reg or icount or value or *addr> -- print integer\n"
+            "pf/printfloat <vreg or *addr> --print float value\n"
+            "pd/printdouble <vreg or *addr> -- print double value\n"
+            "pq/printquad <vreg or *addr> -- print vector register\n"
+            "po/printobject <*reg or *addr> -- print object\n"
+            "si/stepi -- single step an instruction\n"
+            "trace -- toggle execution tracing mode\n"
+            "bt -- print backtrace\n"
+            "unstop -- if current pc is a stop instr make it a nop\n"
+            "q/quit -- Quit the debugger and exit the program\n");
       } else if ((strcmp(cmd, "quit") == 0) || (strcmp(cmd, "q") == 0)) {
         OS::Print("Quitting\n");
         OS::Exit(0);
@@ -488,14 +487,12 @@
         } else {
           OS::Print("print <reg or icount or value or *addr>\n");
         }
-      } else if ((strcmp(cmd, "pf") == 0) ||
-                 (strcmp(cmd, "printfloat") == 0)) {
+      } else if ((strcmp(cmd, "pf") == 0) || (strcmp(cmd, "printfloat") == 0)) {
         if (args == 2) {
           uint32_t value;
           if (GetSValue(arg1, &value)) {
             float svalue = bit_cast<float, uint32_t>(value);
-            OS::Print("%s: %d 0x%x %.8g\n",
-                arg1, value, value, svalue);
+            OS::Print("%s: %d 0x%x %.8g\n", arg1, value, value, svalue);
           } else {
             OS::Print("%s unrecognized\n", arg1);
           }
@@ -508,16 +505,15 @@
           uint64_t long_value;
           if (GetDValue(arg1, &long_value)) {
             double dvalue = bit_cast<double, uint64_t>(long_value);
-            OS::Print("%s: %" Pu64 " 0x%" Px64 " %.8g\n",
-                arg1, long_value, long_value, dvalue);
+            OS::Print("%s: %" Pu64 " 0x%" Px64 " %.8g\n", arg1, long_value,
+                      long_value, dvalue);
           } else {
             OS::Print("%s unrecognized\n", arg1);
           }
         } else {
           OS::Print("printdouble <vreg or *addr>\n");
         }
-      } else if ((strcmp(cmd, "pq") == 0) ||
-                 (strcmp(cmd, "printquad") == 0)) {
+      } else if ((strcmp(cmd, "pq") == 0) || (strcmp(cmd, "printquad") == 0)) {
         if (args == 2) {
           simd_value_t quad_value;
           if (GetQValue(arg1, &quad_value)) {
@@ -555,8 +551,8 @@
             if (Isolate::Current()->heap()->Contains(value)) {
               OS::Print("%s: \n", arg1);
 #if defined(DEBUG)
-              const Object& obj = Object::Handle(
-                  reinterpret_cast<RawObject*>(value));
+              const Object& obj =
+                  Object::Handle(reinterpret_cast<RawObject*>(value));
               obj.Print();
 #endif  // defined(DEBUG)
             } else {
@@ -687,9 +683,7 @@
       return NULL;
     }
     intptr_t len = strlen(line_buf);
-    if (len > 1 &&
-        line_buf[len - 2] == '\\' &&
-        line_buf[len - 1] == '\n') {
+    if (len > 1 && line_buf[len - 2] == '\\' && line_buf[len - 1] == '\n') {
       // When we read a line that ends with a "\" we remove the escape and
       // append the remainder.
       line_buf[len - 2] = '\n';
@@ -735,8 +729,8 @@
 
 // Synchronization primitives support.
 Mutex* Simulator::exclusive_access_lock_ = NULL;
-Simulator::AddressTag Simulator::exclusive_access_state_[kNumAddressTags] =
-    {{NULL, 0}};
+Simulator::AddressTag Simulator::exclusive_access_state_[kNumAddressTags] = {
+    {NULL, 0}};
 int Simulator::next_address_tag_ = 0;
 
 
@@ -753,9 +747,9 @@
   // the size specified by the user and the buffer space needed for
   // handling stack overflow exceptions. To be safe in potential
   // stack underflows we also add some underflow buffer space.
-  stack_ = new char[(OSThread::GetSpecifiedStackSize() +
-                     OSThread::kStackSizeBuffer +
-                     kSimulatorStackUnderflowSize)];
+  stack_ =
+      new char[(OSThread::GetSpecifiedStackSize() + OSThread::kStackSizeBuffer +
+                kSimulatorStackUnderflowSize)];
   pc_modified_ = false;
   icount_ = 0;
   break_pc_ = NULL;
@@ -857,10 +851,9 @@
     Redirection* list_head = list_;
     do {
       next_ = list_head;
-      list_head = reinterpret_cast<Redirection*>(
-          AtomicOperations::CompareAndSwapWord(
-              reinterpret_cast<uword*>(&list_),
-              reinterpret_cast<uword>(next_),
+      list_head =
+          reinterpret_cast<Redirection*>(AtomicOperations::CompareAndSwapWord(
+              reinterpret_cast<uword*>(&list_), reinterpret_cast<uword>(next_),
               reinterpret_cast<uword>(this)));
     } while (list_head != next_);
   }
@@ -903,8 +896,10 @@
 
 
 // Sets the register in the architecture state.
-void Simulator::set_register(
-    Instr* instr, Register reg, int64_t value, R31Type r31t) {
+void Simulator::set_register(Instr* instr,
+                             Register reg,
+                             int64_t value,
+                             R31Type r31t) {
   // Register is in range.
   ASSERT((reg >= 0) && (reg < kNumberOfCpuRegisters));
   ASSERT(instr == NULL || reg != R18);  // R18 is globally reserved on iOS.
@@ -1020,9 +1015,9 @@
   uword fault_pc = get_pc();
   uword last_pc = get_last_pc();
   char buffer[128];
-  snprintf(buffer, sizeof(buffer),
-      "illegal memory access at 0x%" Px ", pc=0x%" Px ", last_pc=0x%" Px"\n",
-      addr, fault_pc, last_pc);
+  snprintf(buffer, sizeof(buffer), "illegal memory access at 0x%" Px
+                                   ", pc=0x%" Px ", last_pc=0x%" Px "\n",
+           addr, fault_pc, last_pc);
   SimulatorDebugger dbg(this);
   dbg.Stop(instr, buffer);
   // The debugger will return control in non-interactive mode.
@@ -1035,8 +1030,8 @@
 // so let's just not generate any.
 void Simulator::UnalignedAccess(const char* msg, uword addr, Instr* instr) {
   char buffer[128];
-  snprintf(buffer, sizeof(buffer),
-           "unaligned %s at 0x%" Px ", pc=%p\n", msg, addr, instr);
+  snprintf(buffer, sizeof(buffer), "unaligned %s at 0x%" Px ", pc=%p\n", msg,
+           addr, instr);
   SimulatorDebugger dbg(this);
   dbg.Stop(instr, buffer);
   // The debugger will not be able to single step past this instruction, but
@@ -1048,8 +1043,8 @@
 void Simulator::UnimplementedInstruction(Instr* instr) {
   char buffer[128];
   snprintf(buffer, sizeof(buffer),
-      "Unimplemented instruction: at %p, last_pc=0x%" Px64 "\n",
-      instr, get_last_pc());
+           "Unimplemented instruction: at %p, last_pc=0x%" Px64 "\n", instr,
+           get_last_pc());
   SimulatorDebugger dbg(this);
   dbg.Stop(instr, buffer);
   FATAL("Cannot continue execution after unimplemented instruction.");
@@ -1062,7 +1057,7 @@
   // To be safe in potential stack underflows we leave some buffer above and
   // set the stack top.
   return StackBase() +
-      (OSThread::GetSpecifiedStackSize() + OSThread::kStackSizeBuffer);
+         (OSThread::GetSpecifiedStackSize() + OSThread::kStackSizeBuffer);
 }
 
 
@@ -1282,8 +1277,7 @@
 
 // Unsupported instructions use Format to print an error and stop execution.
 void Simulator::Format(Instr* instr, const char* format) {
-  OS::Print("Simulator found unsupported instruction:\n 0x%p: %s\n",
-            instr,
+  OS::Print("Simulator found unsupported instruction:\n 0x%p: %s\n", instr,
             format);
   UNIMPLEMENTED();
 }
@@ -1321,7 +1315,9 @@
 
 // Calculate C flag value for additions and subtractions.
 bool Simulator::CarryFromX(int64_t alu_out,
-                           int64_t left, int64_t right, bool addition) {
+                           int64_t left,
+                           int64_t right,
+                           bool addition) {
   if (addition) {
     return (((left & right) | ((left | right) & ~alu_out)) >> 63) != 0;
   } else {
@@ -1332,7 +1328,9 @@
 
 // Calculate V flag value for additions and subtractions.
 bool Simulator::OverflowFromX(int64_t alu_out,
-                              int64_t left, int64_t right, bool addition) {
+                              int64_t left,
+                              int64_t right,
+                              bool addition) {
   if (addition) {
     return (((alu_out ^ left) & (alu_out ^ right)) >> 63) != 0;
   } else {
@@ -1357,8 +1355,8 @@
   const Register rd = instr->RdField();
   const int hw = instr->HWField();
   const int64_t shift = hw << 4;
-  const int64_t shifted_imm =
-      static_cast<int64_t>(instr->Imm16Field()) << shift;
+  const int64_t shifted_imm = static_cast<int64_t>(instr->Imm16Field())
+                              << shift;
 
   if (instr->SFField()) {
     if (instr->Bits(29, 2) == 0) {
@@ -1378,7 +1376,7 @@
   } else if ((hw & 0x2) == 0) {
     if (instr->Bits(29, 2) == 0) {
       // Format(instr, "movn'sf 'rd, 'imm16 'hw");
-      set_wregister(rd, ~shifted_imm & kWRegMask,  instr->RdMode());
+      set_wregister(rd, ~shifted_imm & kWRegMask, instr->RdMode());
     } else if (instr->Bits(29, 2) == 2) {
       // Format(instr, "movz'sf 'rd, 'imm16 'hw");
       set_wregister(rd, shifted_imm & kWRegMask, instr->RdMode());
@@ -1438,7 +1436,8 @@
   const int op = instr->Bits(29, 2);
   const bool set_flags = op == 3;
   const int out_size = ((instr->SFField() == 0) && (instr->NField() == 0))
-                       ? kWRegSizeInBits : kXRegSizeInBits;
+                           ? kWRegSizeInBits
+                           : kXRegSizeInBits;
   const Register rn = instr->RnField();
   const Register rd = instr->RdField();
   const int64_t rn_val = get_register(rn, instr->RnMode());
@@ -1544,22 +1543,38 @@
     cond = instr->ConditionField();
   }
   switch (cond) {
-    case EQ: return z_flag_;
-    case NE: return !z_flag_;
-    case CS: return c_flag_;
-    case CC: return !c_flag_;
-    case MI: return n_flag_;
-    case PL: return !n_flag_;
-    case VS: return v_flag_;
-    case VC: return !v_flag_;
-    case HI: return c_flag_ && !z_flag_;
-    case LS: return !c_flag_ || z_flag_;
-    case GE: return n_flag_ == v_flag_;
-    case LT: return n_flag_ != v_flag_;
-    case GT: return !z_flag_ && (n_flag_ == v_flag_);
-    case LE: return z_flag_ || (n_flag_ != v_flag_);
-    case AL: return true;
-    default: UNREACHABLE();
+    case EQ:
+      return z_flag_;
+    case NE:
+      return !z_flag_;
+    case CS:
+      return c_flag_;
+    case CC:
+      return !c_flag_;
+    case MI:
+      return n_flag_;
+    case PL:
+      return !n_flag_;
+    case VS:
+      return v_flag_;
+    case VC:
+      return !v_flag_;
+    case HI:
+      return c_flag_ && !z_flag_;
+    case LS:
+      return !c_flag_ || z_flag_;
+    case GE:
+      return n_flag_ == v_flag_;
+    case LT:
+      return n_flag_ != v_flag_;
+    case GT:
+      return !z_flag_ && (n_flag_ == v_flag_);
+    case LE:
+      return z_flag_ || (n_flag_ != v_flag_);
+    case AL:
+      return true;
+    default:
+      UNREACHABLE();
   }
   return false;
 }
@@ -1582,14 +1597,24 @@
 typedef void (*SimulatorRuntimeCall)(NativeArguments arguments);
 
 // Calls to leaf Dart runtime functions are based on this interface.
-typedef int64_t (*SimulatorLeafRuntimeCall)(
-    int64_t r0, int64_t r1, int64_t r2, int64_t r3,
-    int64_t r4, int64_t r5, int64_t r6, int64_t r7);
+typedef int64_t (*SimulatorLeafRuntimeCall)(int64_t r0,
+                                            int64_t r1,
+                                            int64_t r2,
+                                            int64_t r3,
+                                            int64_t r4,
+                                            int64_t r5,
+                                            int64_t r6,
+                                            int64_t r7);
 
 // Calls to leaf float Dart runtime functions are based on this interface.
-typedef double (*SimulatorLeafFloatRuntimeCall)(
-    double d0, double d1, double d2, double d3,
-    double d4, double d5, double d6, double d7);
+typedef double (*SimulatorLeafFloatRuntimeCall)(double d0,
+                                                double d1,
+                                                double d2,
+                                                double d3,
+                                                double d4,
+                                                double d5,
+                                                double d6,
+                                                double d7);
 
 // Calls to native Dart functions are based on this interface.
 typedef void (*SimulatorBootstrapNativeCall)(NativeArguments* arguments);
@@ -1635,7 +1660,7 @@
       const int64_t r6 = get_register(R6);
       const int64_t r7 = get_register(R7);
       const int64_t res = target(r0, r1, r2, r3, r4, r5, r6, r7);
-      set_register(instr, R0, res);  // Set returned result from function.
+      set_register(instr, R0, res);      // Set returned result from function.
       set_register(instr, R1, icount_);  // Zap unused result register.
     } else if (redirection->call_kind() == kLeafFloatRuntimeCall) {
       ASSERT((0 <= redirection->argument_count()) &&
@@ -1865,8 +1890,8 @@
   const Register rt = instr->RtField();
   const VRegister vt = instr->VtField();
   const int64_t rn_val = get_register(rn, R31IsSP);
-  const uint32_t size =
-      (instr->Bit(26) == 1) ? ((instr->Bit(23) << 2) | instr->SzField())
+  const uint32_t size = (instr->Bit(26) == 1)
+                            ? ((instr->Bit(23) << 2) | instr->SzField())
                             : instr->SzField();
   uword address = 0;
   uword wb_address = 0;
@@ -1876,7 +1901,7 @@
     const uint32_t imm12 = static_cast<uint32_t>(instr->Imm12Field());
     const uint32_t offset = imm12 << size;
     address = rn_val + offset;
-  }  else if (instr->Bits(10, 2) == 0) {
+  } else if (instr->Bits(10, 2) == 0) {
     // addr = rn + signed 9-bit immediate offset.
     wb = false;
     const int64_t offset = static_cast<int64_t>(instr->SImm9Field());
@@ -1899,8 +1924,7 @@
     // addr = rn + (rm EXT optionally scaled by operand instruction size).
     const Register rm = instr->RmField();
     const Extend ext = instr->ExtendTypeField();
-    const uint8_t scale =
-        (ext == UXTX) && (instr->Bit(12) == 1) ? size : 0;
+    const uint8_t scale = (ext == UXTX) && (instr->Bit(12) == 1) ? size : 0;
     const int64_t rm_val = get_register(rm, R31IsZR);
     const int64_t offset = ExtendOperand(kXRegSizeInBits, rm_val, ext, scale);
     address = rn_val + offset;
@@ -2170,9 +2194,7 @@
 
 
 void Simulator::DecodeLoadStoreExclusive(Instr* instr) {
-  if ((instr->Bit(23) != 0) ||
-      (instr->Bit(21) != 0) ||
-      (instr->Bit(15) != 0)) {
+  if ((instr->Bit(23) != 0) || (instr->Bit(21) != 0) || (instr->Bit(15) != 0)) {
     UNIMPLEMENTED();
   }
   const int32_t size = instr->Bits(30, 2);
@@ -2773,7 +2795,7 @@
       // Format(instr, "vmovrd 'rd, 'vn'idx5");
       set_register(instr, rd, get_vregisterd(vn, idx5), R31IsZR);
     }
-  } else if ((Q == 1)  && (op == 0) && (imm4 == 0)) {
+  } else if ((Q == 1) && (op == 0) && (imm4 == 0)) {
     // Format(instr, "vdup'csz 'vd, 'vn'idx5");
     if (element_bytes == 4) {
       for (int i = 0; i < 4; i++) {
@@ -2984,9 +3006,12 @@
 
 static float arm_reciprocal_sqrt_estimate(float a) {
   // From the ARM Architecture Reference Manual A2-87.
-  if (isinf(a) || (fabs(a) >= exp2f(126))) return 0.0;
-  else if (a == 0.0) return kPosInfinity;
-  else if (isnan(a)) return a;
+  if (isinf(a) || (fabs(a) >= exp2f(126)))
+    return 0.0;
+  else if (a == 0.0)
+    return kPosInfinity;
+  else if (isnan(a))
+    return a;
 
   uint32_t a_bits = bit_cast<uint32_t, float>(a);
   uint64_t scaled;
@@ -3024,10 +3049,11 @@
   // r in units of 1/256 rounded to nearest.
   int32_t s = static_cast<int>(256.0 * r + 0.5);
   double estimate = static_cast<double>(s) / 256.0;
-  ASSERT((estimate >= 1.0) && (estimate <= (511.0/256.0)));
+  ASSERT((estimate >= 1.0) && (estimate <= (511.0 / 256.0)));
 
   // result = 0 : result_exp<7:0> : estimate<51:29>
-  int32_t result_bits = ((result_exp & 0xff) << 23) |
+  int32_t result_bits =
+      ((result_exp & 0xff) << 23) |
       ((bit_cast<uint64_t, double>(estimate) >> 29) & 0x7fffff);
   return bit_cast<float, int32_t>(result_bits);
 }
@@ -3035,9 +3061,12 @@
 
 static float arm_recip_estimate(float a) {
   // From the ARM Architecture Reference Manual A2-85.
-  if (isinf(a) || (fabs(a) >= exp2f(126))) return 0.0;
-  else if (a == 0.0) return kPosInfinity;
-  else if (isnan(a)) return a;
+  if (isinf(a) || (fabs(a) >= exp2f(126)))
+    return 0.0;
+  else if (a == 0.0)
+    return kPosInfinity;
+  else if (isnan(a))
+    return a;
 
   uint32_t a_bits = bit_cast<uint32_t, float>(a);
   // scaled = '0011 1111 1110' : a<22:0> : Zeros(29)
@@ -3057,7 +3086,7 @@
   // r in units of 1/256 rounded to nearest.
   int32_t s = static_cast<int32_t>(256.0 * r + 0.5);
   double estimate = static_cast<double>(s) / 256.0;
-  ASSERT((estimate >= 1.0) && (estimate <= (511.0/256.0)));
+  ASSERT((estimate >= 1.0) && (estimate <= (511.0 / 256.0)));
 
   // result = sign : result_exp<7:0> : estimate<51:29>
   int32_t result_bits =
@@ -3217,8 +3246,9 @@
     // Format(instr, "scvtfd'sf 'vd, 'rn");
     const int64_t rn_val64 = get_register(rn, instr->RnMode());
     const int32_t rn_val32 = get_wregister(rn, instr->RnMode());
-    const double vn_dbl = (instr->SFField() == 1) ?
-        static_cast<double>(rn_val64) : static_cast<double>(rn_val32);
+    const double vn_dbl = (instr->SFField() == 1)
+                              ? static_cast<double>(rn_val64)
+                              : static_cast<double>(rn_val32);
     set_vregisterd(vd, 0, bit_cast<int64_t, double>(vn_dbl));
     set_vregisterd(vd, 1, 0);
   } else if (instr->Bits(16, 5) == 6) {
@@ -3572,12 +3602,7 @@
 }
 
 
-void Simulator::Longjmp(uword pc,
-                        uword sp,
-                        uword fp,
-                        RawObject* raw_exception,
-                        RawObject* raw_stacktrace,
-                        Thread* thread) {
+void Simulator::JumpToFrame(uword pc, uword sp, uword fp, Thread* thread) {
   // Walk over all setjmp buffers (simulated --> C++ transitions)
   // and try to find the setjmp associated with the simulated stack pointer.
   SimulatorSetjmpBuffer* buf = last_setjmp_buffer();
@@ -3600,15 +3625,11 @@
   thread->set_vm_tag(VMTag::kDartTagId);
   // Clear top exit frame.
   thread->set_top_exit_frame_info(0);
-
-  ASSERT(raw_exception != Object::null());
-  set_register(NULL, kExceptionObjectReg, bit_cast<int64_t>(raw_exception));
-  set_register(NULL, kStackTraceObjectReg, bit_cast<int64_t>(raw_stacktrace));
   // Restore pool pointer.
-  int64_t code = *reinterpret_cast<int64_t*>(
-      fp + kPcMarkerSlotFromFp * kWordSize);
-  int64_t pp = *reinterpret_cast<int64_t*>(
-      code + Code::object_pool_offset() - kHeapObjectTag);
+  int64_t code =
+      *reinterpret_cast<int64_t*>(fp + kPcMarkerSlotFromFp * kWordSize);
+  int64_t pp = *reinterpret_cast<int64_t*>(code + Code::object_pool_offset() -
+                                           kHeapObjectTag);
   pp -= kHeapObjectTag;  // In the PP register, the pool pointer is untagged.
   set_register(NULL, CODE_REG, code);
   set_register(NULL, PP, pp);
diff --git a/runtime/vm/simulator_arm64.h b/runtime/vm/simulator_arm64.h
index de49dd9..43c0571 100644
--- a/runtime/vm/simulator_arm64.h
+++ b/runtime/vm/simulator_arm64.h
@@ -9,10 +9,10 @@
 // which will start execution in the Simulator or forwards to the real entry
 // on a ARM64 HW platform.
 
-#ifndef VM_SIMULATOR_ARM64_H_
-#define VM_SIMULATOR_ARM64_H_
+#ifndef RUNTIME_VM_SIMULATOR_ARM64_H_
+#define RUNTIME_VM_SIMULATOR_ARM64_H_
 
-#ifndef VM_SIMULATOR_H_
+#ifndef RUNTIME_VM_SIMULATOR_H_
 #error Do not include simulator_arm64.h directly; use simulator.h.
 #endif
 
@@ -50,8 +50,10 @@
   // specifying the type. We also can't translate a dummy value for SPREG into
   // a real value because the architecture independent code expects SPREG to
   // be a real register value.
-  void set_register(
-      Instr* instr, Register reg, int64_t value, R31Type r31t = R31IsSP);
+  void set_register(Instr* instr,
+                    Register reg,
+                    int64_t value,
+                    R31Type r31t = R31IsSP);
   int64_t get_register(Register reg, R31Type r31t = R31IsSP) const;
   void set_wregister(Register reg, int32_t value, R31Type r31t = R31IsSP);
   int32_t get_wregister(Register reg, R31Type r31t = R31IsSP) const;
@@ -65,9 +67,7 @@
   void get_vregister(VRegister reg, simd_value_t* value) const;
   void set_vregister(VRegister reg, const simd_value_t& value);
 
-  int64_t get_sp() const {
-    return get_register(SPREG);
-  }
+  int64_t get_sp() const { return get_register(SPREG); }
 
   int64_t get_pc() const;
   int64_t get_last_pc() const;
@@ -124,12 +124,7 @@
 
   static uword FunctionForRedirect(uword redirect);
 
-  void Longjmp(uword pc,
-               uword sp,
-               uword fp,
-               RawObject* raw_exception,
-               RawObject* raw_stacktrace,
-               Thread* thread);
+  void JumpToFrame(uword pc, uword sp, uword fp, Thread* thread);
 
  private:
   // Known bad pc value to ensure that the simulator does not execute
@@ -165,9 +160,7 @@
   int64_t break_instr_;
 
   // Illegal memory access support.
-  static bool IsIllegalAddress(uword addr) {
-    return addr < 64*1024;
-  }
+  static bool IsIllegalAddress(uword addr) { return addr < 64 * 1024; }
   void HandleIllegalAccess(uword addr, Instr* instr);
 
   // Handles an unaligned memory access.
@@ -232,8 +225,10 @@
 
   void SetNZFlagsX(int64_t val);
   bool CarryFromX(int64_t alu_out, int64_t left, int64_t right, bool addition);
-  bool OverflowFromX(
-      int64_t alu_out, int64_t left, int64_t right, bool addition);
+  bool OverflowFromX(int64_t alu_out,
+                     int64_t left,
+                     int64_t right,
+                     bool addition);
 
   void SetCFlag(bool val);
   void SetVFlag(bool val);
@@ -256,10 +251,9 @@
 
   // Decode instructions.
   void InstructionDecode(Instr* instr);
-  #define DECODE_OP(op)                                                        \
-    void Decode##op(Instr* instr);
+#define DECODE_OP(op) void Decode##op(Instr* instr);
   APPLY_OP_LIST(DECODE_OP)
-  #undef DECODE_OP
+#undef DECODE_OP
 
   // Executes ARM64 instructions until the PC reaches kEndSimulatingPC.
   void Execute();
@@ -268,9 +262,7 @@
   bool IsTracingExecution() const;
 
   // Longjmp support for exceptions.
-  SimulatorSetjmpBuffer* last_setjmp_buffer() {
-    return last_setjmp_buffer_;
-  }
+  SimulatorSetjmpBuffer* last_setjmp_buffer() { return last_setjmp_buffer_; }
   void set_last_setjmp_buffer(SimulatorSetjmpBuffer* buffer) {
     last_setjmp_buffer_ = buffer;
   }
@@ -282,4 +274,4 @@
 
 }  // namespace dart
 
-#endif  // VM_SIMULATOR_ARM64_H_
+#endif  // RUNTIME_VM_SIMULATOR_ARM64_H_
diff --git a/runtime/vm/simulator_dbc.cc b/runtime/vm/simulator_dbc.cc
index 67c1728..8febf13 100644
--- a/runtime/vm/simulator_dbc.cc
+++ b/runtime/vm/simulator_dbc.cc
@@ -32,11 +32,18 @@
 
 namespace dart {
 
-DEFINE_FLAG(uint64_t, trace_sim_after, ULLONG_MAX,
+DEFINE_FLAG(uint64_t,
+            trace_sim_after,
+            ULLONG_MAX,
             "Trace simulator execution after instruction count reached.");
-DEFINE_FLAG(uint64_t, stop_sim_at, ULLONG_MAX,
+DEFINE_FLAG(uint64_t,
+            stop_sim_at,
+            ULLONG_MAX,
             "Instruction address or instruction count to stop simulator at.");
 
+#define LIKELY(cond) __builtin_expect((cond), 1)
+#define UNLIKELY(cond) __builtin_expect((cond), 0)
+
 // 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
@@ -94,17 +101,17 @@
 }
 
 
-#define RAW_CAST(Type, val)  (SimulatorHelpers::CastTo##Type(val))
+#define RAW_CAST(Type, val) (SimulatorHelpers::CastTo##Type(val))
 
 
 class SimulatorHelpers {
  public:
-#define DEFINE_CASTS(Type)                                              \
-    DART_FORCE_INLINE static Raw##Type* CastTo##Type(RawObject* obj) {  \
-      ASSERT((k##Type##Cid == kSmiCid) ? !obj->IsHeapObject()           \
-                                       : obj->Is##Type());              \
-      return reinterpret_cast<Raw##Type*>(obj);                         \
-    }
+#define DEFINE_CASTS(Type)                                                     \
+  DART_FORCE_INLINE static Raw##Type* CastTo##Type(RawObject* obj) {           \
+    ASSERT((k##Type##Cid == kSmiCid) ? !obj->IsHeapObject()                    \
+                                     : obj->Is##Type());                       \
+    return reinterpret_cast<Raw##Type*>(obj);                                  \
+  }
   CLASS_LIST(DEFINE_CASTS)
 #undef DEFINE_CASTS
 
@@ -129,8 +136,7 @@
     const intptr_t raw_smi_old =
         reinterpret_cast<intptr_t>(entries[offset + count_offset]);
     const intptr_t raw_smi_new = raw_smi_old + Smi::RawValue(1);
-    *reinterpret_cast<intptr_t*>(&entries[offset + count_offset]) =
-        raw_smi_new;
+    *reinterpret_cast<intptr_t*>(&entries[offset + count_offset]) = raw_smi_new;
   }
 
   DART_FORCE_INLINE static bool IsStrictEqualWithNumberCheck(RawObject* lhs,
@@ -170,10 +176,9 @@
   }
 
   DART_FORCE_INLINE static bool CheckIndex(RawSmi* index, RawSmi* length) {
-    return !index->IsHeapObject() &&
-           (reinterpret_cast<intptr_t>(index) >= 0) &&
+    return !index->IsHeapObject() && (reinterpret_cast<intptr_t>(index) >= 0) &&
            (reinterpret_cast<intptr_t>(index) <
-                reinterpret_cast<intptr_t>(length));
+            reinterpret_cast<intptr_t>(length));
   }
 
   static bool ObjectArraySetIndexed(Thread* thread,
@@ -239,6 +244,199 @@
     return false;
   }
 
+  static bool Double_getIsNan(Thread* thread,
+                              RawObject** FP,
+                              RawObject** result) {
+    RawObject** args = FrameArguments(FP, 1);
+    RawDouble* d = static_cast<RawDouble*>(args[0]);
+    *result =
+        isnan(d->ptr()->value_) ? Bool::True().raw() : Bool::False().raw();
+    return true;
+  }
+
+  static bool Double_getIsInfinite(Thread* thread,
+                                   RawObject** FP,
+                                   RawObject** result) {
+    RawObject** args = FrameArguments(FP, 1);
+    RawDouble* d = static_cast<RawDouble*>(args[0]);
+    *result =
+        isinf(d->ptr()->value_) ? Bool::True().raw() : Bool::False().raw();
+    return true;
+  }
+
+  static bool ObjectEquals(Thread* thread, RawObject** FP, RawObject** result) {
+    RawObject** args = FrameArguments(FP, 2);
+    *result = args[0] == args[1] ? Bool::True().raw() : Bool::False().raw();
+    return true;
+  }
+
+  static bool ObjectRuntimeType(Thread* thread,
+                                RawObject** FP,
+                                RawObject** result) {
+    RawObject** args = FrameArguments(FP, 1);
+    const intptr_t cid = GetClassId(args[0]);
+    if (cid == kClosureCid) {
+      return false;
+    }
+    if (cid < kNumPredefinedCids) {
+      if (cid == kDoubleCid) {
+        *result = thread->isolate()->object_store()->double_type();
+        return true;
+      } else if (RawObject::IsStringClassId(cid)) {
+        *result = thread->isolate()->object_store()->string_type();
+        return true;
+      } else if (RawObject::IsIntegerClassId(cid)) {
+        *result = thread->isolate()->object_store()->int_type();
+        return true;
+      }
+    }
+    RawClass* cls = thread->isolate()->class_table()->At(cid);
+    if (cls->ptr()->num_type_arguments_ != 0) {
+      return false;
+    }
+    RawType* typ = cls->ptr()->canonical_type_;
+    if (typ == Object::null()) {
+      return false;
+    }
+    *result = static_cast<RawObject*>(typ);
+    return true;
+  }
+
+  static bool GetDoubleOperands(RawObject** args, double* d1, double* d2) {
+    RawObject* obj2 = args[1];
+    if (!obj2->IsHeapObject()) {
+      *d2 =
+          static_cast<double>(reinterpret_cast<intptr_t>(obj2) >> kSmiTagSize);
+    } else if (obj2->GetClassId() == kDoubleCid) {
+      RawDouble* obj2d = static_cast<RawDouble*>(obj2);
+      *d2 = obj2d->ptr()->value_;
+    } else {
+      return false;
+    }
+    RawDouble* obj1 = static_cast<RawDouble*>(args[0]);
+    *d1 = obj1->ptr()->value_;
+    return true;
+  }
+
+  static RawObject* AllocateDouble(Thread* thread, double value) {
+    const intptr_t instance_size = Double::InstanceSize();
+    const uword start = thread->heap()->new_space()->TryAllocate(instance_size);
+    if (LIKELY(start != 0)) {
+      uword tags = 0;
+      tags = RawObject::ClassIdTag::update(kDoubleCid, tags);
+      tags = RawObject::SizeTag::update(instance_size, tags);
+      *reinterpret_cast<uword*>(start + Double::tags_offset()) = tags;
+      *reinterpret_cast<double*>(start + Double::value_offset()) = value;
+      return reinterpret_cast<RawObject*>(start + kHeapObjectTag);
+    }
+    return NULL;
+  }
+
+  static bool Double_add(Thread* thread, RawObject** FP, RawObject** result) {
+    double d1, d2;
+    if (!GetDoubleOperands(FrameArguments(FP, 2), &d1, &d2)) {
+      return false;
+    }
+    RawObject* new_double = AllocateDouble(thread, d1 + d2);
+    if (new_double != NULL) {
+      *result = new_double;
+      return true;
+    }
+    return false;
+  }
+
+  static bool Double_mul(Thread* thread, RawObject** FP, RawObject** result) {
+    double d1, d2;
+    if (!GetDoubleOperands(FrameArguments(FP, 2), &d1, &d2)) {
+      return false;
+    }
+    RawObject* new_double = AllocateDouble(thread, d1 * d2);
+    if (new_double != NULL) {
+      *result = new_double;
+      return true;
+    }
+    return false;
+  }
+
+  static bool Double_sub(Thread* thread, RawObject** FP, RawObject** result) {
+    double d1, d2;
+    if (!GetDoubleOperands(FrameArguments(FP, 2), &d1, &d2)) {
+      return false;
+    }
+    RawObject* new_double = AllocateDouble(thread, d1 - d2);
+    if (new_double != NULL) {
+      *result = new_double;
+      return true;
+    }
+    return false;
+  }
+
+  static bool Double_div(Thread* thread, RawObject** FP, RawObject** result) {
+    double d1, d2;
+    if (!GetDoubleOperands(FrameArguments(FP, 2), &d1, &d2)) {
+      return false;
+    }
+    RawObject* new_double = AllocateDouble(thread, d1 / d2);
+    if (new_double != NULL) {
+      *result = new_double;
+      return true;
+    }
+    return false;
+  }
+
+  static bool Double_greaterThan(Thread* thread,
+                                 RawObject** FP,
+                                 RawObject** result) {
+    double d1, d2;
+    if (!GetDoubleOperands(FrameArguments(FP, 2), &d1, &d2)) {
+      return false;
+    }
+    *result = d1 > d2 ? Bool::True().raw() : Bool::False().raw();
+    return true;
+  }
+
+  static bool Double_greaterEqualThan(Thread* thread,
+                                      RawObject** FP,
+                                      RawObject** result) {
+    double d1, d2;
+    if (!GetDoubleOperands(FrameArguments(FP, 2), &d1, &d2)) {
+      return false;
+    }
+    *result = d1 >= d2 ? Bool::True().raw() : Bool::False().raw();
+    return true;
+  }
+
+  static bool Double_lessThan(Thread* thread,
+                              RawObject** FP,
+                              RawObject** result) {
+    double d1, d2;
+    if (!GetDoubleOperands(FrameArguments(FP, 2), &d1, &d2)) {
+      return false;
+    }
+    *result = d1 < d2 ? Bool::True().raw() : Bool::False().raw();
+    return true;
+  }
+
+  static bool Double_equal(Thread* thread, RawObject** FP, RawObject** result) {
+    double d1, d2;
+    if (!GetDoubleOperands(FrameArguments(FP, 2), &d1, &d2)) {
+      return false;
+    }
+    *result = d1 == d2 ? Bool::True().raw() : Bool::False().raw();
+    return true;
+  }
+
+  static bool Double_lessEqualThan(Thread* thread,
+                                   RawObject** FP,
+                                   RawObject** result) {
+    double d1, d2;
+    if (!GetDoubleOperands(FrameArguments(FP, 2), &d1, &d2)) {
+      return false;
+    }
+    *result = d1 <= d2 ? Bool::True().raw() : Bool::False().raw();
+    return true;
+  }
+
   DART_FORCE_INLINE static RawCode* FrameCode(RawObject** FP) {
     ASSERT(GetClassId(FP[kPcMarkerSlotFromFp]) == kCodeCid);
     return static_cast<RawCode*>(FP[kPcMarkerSlotFromFp]);
@@ -250,8 +448,8 @@
     FP[kPcMarkerSlotFromFp] = code;
   }
 
-  DART_FORCE_INLINE static uint8_t* GetTypedData(
-      RawObject* obj, RawObject* index) {
+  DART_FORCE_INLINE static uint8_t* GetTypedData(RawObject* obj,
+                                                 RawObject* index) {
     ASSERT(RawObject::IsTypedDataClassId(obj->GetClassId()));
     RawTypedData* array = reinterpret_cast<RawTypedData*>(obj);
     const intptr_t byte_offset = Smi::Value(RAW_CAST(Smi, index));
@@ -290,13 +488,29 @@
       SimulatorHelpers::GrowableArraySetIndexed;
   intrinsics_[kGrowableArrayGetIndexedIntrinsic] =
       SimulatorHelpers::GrowableArrayGetIndexed;
+  intrinsics_[kObjectEqualsIntrinsic] = SimulatorHelpers::ObjectEquals;
+  intrinsics_[kObjectRuntimeTypeIntrinsic] =
+      SimulatorHelpers::ObjectRuntimeType;
+
+  intrinsics_[kDouble_getIsNaNIntrinsic] = SimulatorHelpers::Double_getIsNan;
+  intrinsics_[kDouble_getIsInfiniteIntrinsic] =
+      SimulatorHelpers::Double_getIsInfinite;
+  intrinsics_[kDouble_addIntrinsic] = SimulatorHelpers::Double_add;
+  intrinsics_[kDouble_mulIntrinsic] = SimulatorHelpers::Double_mul;
+  intrinsics_[kDouble_subIntrinsic] = SimulatorHelpers::Double_sub;
+  intrinsics_[kDouble_divIntrinsic] = SimulatorHelpers::Double_div;
+  intrinsics_[kDouble_greaterThanIntrinsic] =
+      SimulatorHelpers::Double_greaterThan;
+  intrinsics_[kDouble_greaterEqualThanIntrinsic] =
+      SimulatorHelpers::Double_greaterEqualThan;
+  intrinsics_[kDouble_lessThanIntrinsic] = SimulatorHelpers::Double_lessThan;
+  intrinsics_[kDouble_equalIntrinsic] = SimulatorHelpers::Double_equal;
+  intrinsics_[kDouble_lessEqualThanIntrinsic] =
+      SimulatorHelpers::Double_lessEqualThan;
 }
 
 
-Simulator::Simulator()
-    : stack_(NULL),
-      fp_(NULL),
-      sp_(NULL) {
+Simulator::Simulator() : stack_(NULL), fp_(NULL), sp_(NULL) {
   // Setup simulator support first. Some of this information is needed to
   // setup the architecture state.
   // We allocate the stack here, the size is computed as the sum of
@@ -482,16 +696,13 @@
 }
 
 
-#define LIKELY(cond) __builtin_expect((cond), 1)
-
-
 DART_FORCE_INLINE static bool AreBothSmis(intptr_t a, intptr_t b) {
   return ((a | b) & kHeapObjectTag) == 0;
 }
 
 
 #define SMI_MUL(lhs, rhs, pres) SignedMulWithOverflow((lhs), (rhs) >> 1, pres)
-#define SMI_COND(cond, lhs, rhs, pres) \
+#define SMI_COND(cond, lhs, rhs, pres)                                         \
   ((*(pres) = ((lhs cond rhs) ? true_value : false_value)), false)
 #define SMI_EQ(lhs, rhs, pres) SMI_COND(==, lhs, rhs, pres)
 #define SMI_LT(lhs, rhs, pres) SMI_COND(<, lhs, rhs, pres)
@@ -590,14 +801,8 @@
   // Handler arguments: arguments to check and an ICData object.
   const intptr_t miss_handler_argc = checked_args + 1;
   RawObject** exit_frame = miss_handler_args + miss_handler_argc;
-  CallRuntime(thread,
-              FP,
-              exit_frame,
-              pc,
-              miss_handler_argc,
-              miss_handler_args,
-              result,
-              reinterpret_cast<uword>(handler));
+  CallRuntime(thread, FP, exit_frame, pc, miss_handler_argc, miss_handler_args,
+              result, reinterpret_cast<uword>(handler));
 }
 
 
@@ -622,8 +827,7 @@
   bool found = false;
   const intptr_t length = Smi::Value(cache->length_);
   intptr_t i;
-  for (i = 0;
-       i < (length - (kCheckedArgs + 2)); i += (kCheckedArgs + 2)) {
+  for (i = 0; i < (length - (kCheckedArgs + 2)); i += (kCheckedArgs + 2)) {
     if (cache->data()[i + 0] == receiver_cid) {
       top[0] = cache->data()[i + kCheckedArgs];
       found = true;
@@ -636,8 +840,8 @@
       SimulatorHelpers::IncrementICUsageCount(cache->data(), i, kCheckedArgs);
     }
   } else {
-    InlineCacheMiss(
-        kCheckedArgs, thread, icdata, call_base, top, *pc, *FP, *SP);
+    InlineCacheMiss(kCheckedArgs, thread, icdata, call_base, top, *pc, *FP,
+                    *SP);
   }
 
   *argdesc = icdata->ptr()->args_descriptor_;
@@ -667,8 +871,7 @@
   bool found = false;
   const intptr_t length = Smi::Value(cache->length_);
   intptr_t i;
-  for (i = 0;
-       i < (length - (kCheckedArgs + 2)); i += (kCheckedArgs + 2)) {
+  for (i = 0; i < (length - (kCheckedArgs + 2)); i += (kCheckedArgs + 2)) {
     if ((cache->data()[i + 0] == receiver_cid) &&
         (cache->data()[i + 1] == arg0_cid)) {
       top[0] = cache->data()[i + kCheckedArgs];
@@ -682,8 +885,8 @@
       SimulatorHelpers::IncrementICUsageCount(cache->data(), i, kCheckedArgs);
     }
   } else {
-    InlineCacheMiss(
-        kCheckedArgs, thread, icdata, call_base, top, *pc, *FP, *SP);
+    InlineCacheMiss(kCheckedArgs, thread, icdata, call_base, top, *pc, *FP,
+                    *SP);
   }
 
   *argdesc = icdata->ptr()->args_descriptor_;
@@ -694,11 +897,10 @@
 // Note: functions below are marked DART_NOINLINE to recover performance on
 // ARM where inlining these functions into the interpreter loop seemed to cause
 // some code quality issues.
-static DART_NOINLINE bool InvokeRuntime(
-    Thread* thread,
-    Simulator* sim,
-    RuntimeFunction drt,
-    const NativeArguments& args) {
+static DART_NOINLINE bool InvokeRuntime(Thread* thread,
+                                        Simulator* sim,
+                                        RuntimeFunction drt,
+                                        const NativeArguments& args) {
   SimulatorSetjmpBuffer buffer(sim);
   if (!setjmp(buffer.buffer_)) {
     thread->set_vm_tag(reinterpret_cast<uword>(drt));
@@ -712,11 +914,10 @@
 }
 
 
-static DART_NOINLINE bool InvokeNative(
-    Thread* thread,
-    Simulator* sim,
-    SimulatorBootstrapNativeCall f,
-    NativeArguments* args) {
+static DART_NOINLINE bool InvokeNative(Thread* thread,
+                                       Simulator* sim,
+                                       SimulatorBootstrapNativeCall f,
+                                       NativeArguments* args) {
   SimulatorSetjmpBuffer buffer(sim);
   if (!setjmp(buffer.buffer_)) {
     thread->set_vm_tag(reinterpret_cast<uword>(f));
@@ -730,11 +931,10 @@
 }
 
 
-static DART_NOINLINE bool InvokeNativeWrapper(
-    Thread* thread,
-    Simulator* sim,
-    Dart_NativeFunction f,
-    NativeArguments* args) {
+static DART_NOINLINE bool InvokeNativeWrapper(Thread* thread,
+                                              Simulator* sim,
+                                              Dart_NativeFunction f,
+                                              NativeArguments* args) {
   SimulatorSetjmpBuffer buffer(sim);
   if (!setjmp(buffer.buffer_)) {
     thread->set_vm_tag(reinterpret_cast<uword>(f));
@@ -752,29 +952,32 @@
 
 // Decode opcode and A part of the given value and dispatch to the
 // corresponding bytecode handler.
-#define DISPATCH_OP(val)         \
-  do {                           \
-    op = (val);                \
-    rA = ((op >> 8) & 0xFF);   \
-    goto* dispatch[op & 0xFF]; \
+#define DISPATCH_OP(val)                                                       \
+  do {                                                                         \
+    op = (val);                                                                \
+    rA = ((op >> 8) & 0xFF);                                                   \
+    goto* dispatch[op & 0xFF];                                                 \
   } while (0)
 
 // Fetch next operation from PC, increment program counter and dispatch.
 #define DISPATCH() DISPATCH_OP(*pc++)
 
 // Define entry point that handles bytecode Name with the given operand format.
-#define BYTECODE(Name, Operands) \
+#define BYTECODE(Name, Operands)                                               \
   BYTECODE_HEADER(Name, DECLARE_##Operands, DECODE_##Operands)
 
-#define BYTECODE_HEADER(Name, Declare, Decode) \
-  Declare;                                     \
-  bc##Name : Decode                            \
+#define BYTECODE_HEADER(Name, Declare, Decode)                                 \
+  Declare;                                                                     \
+  bc##Name : Decode
 
 // Helpers to decode common instruction formats. Used in conjunction with
 // BYTECODE() macro.
-#define DECLARE_A_B_C uint16_t rB, rC; USE(rB); USE(rC)
-#define DECODE_A_B_C \
-  rB = ((op >> Bytecode::kBShift) & Bytecode::kBMask);    \
+#define DECLARE_A_B_C                                                          \
+  uint16_t rB, rC;                                                             \
+  USE(rB);                                                                     \
+  USE(rC)
+#define DECODE_A_B_C                                                           \
+  rB = ((op >> Bytecode::kBShift) & Bytecode::kBMask);                         \
   rC = ((op >> Bytecode::kCShift) & Bytecode::kCMask);
 
 #define DECLARE_0
@@ -783,13 +986,17 @@
 #define DECLARE_A
 #define DECODE_A
 
-#define DECLARE___D uint32_t rD; USE(rD)
+#define DECLARE___D                                                            \
+  uint32_t rD;                                                                 \
+  USE(rD)
 #define DECODE___D rD = (op >> Bytecode::kDShift);
 
 #define DECLARE_A_D DECLARE___D
 #define DECODE_A_D DECODE___D
 
-#define DECLARE_A_X int32_t rD; USE(rD)
+#define DECLARE_A_X                                                            \
+  int32_t rD;                                                                  \
+  USE(rD)
 #define DECODE_A_X rD = (static_cast<int32_t>(op) >> Bytecode::kDShift);
 
 
@@ -800,7 +1007,7 @@
     const RawICData* icdata = RAW_CAST(ICData, LOAD_CONSTANT(kidx));           \
     RawObject** entries = icdata->ptr()->ic_data_->ptr()->data();              \
     SimulatorHelpers::IncrementICUsageCount(entries, 0, 2);                    \
-  } while (0);                                                                 \
+  } while (0);
 
 // Declare bytecode handler for a smi operation (e.g. AddTOS) with the
 // given result type and the given behavior specified as a function
@@ -812,8 +1019,7 @@
     const intptr_t rhs = reinterpret_cast<intptr_t>(SP[-0]);                   \
     ResultT* slot = reinterpret_cast<ResultT*>(SP - 1);                        \
     if (LIKELY(!thread->isolate()->single_step()) &&                           \
-        LIKELY(AreBothSmis(lhs, rhs) &&                                        \
-        !Func(lhs, rhs, slot))) {                                              \
+        LIKELY(AreBothSmis(lhs, rhs) && !Func(lhs, rhs, slot))) {              \
       SMI_FASTPATH_ICDATA_INC;                                                 \
       /* Fast path succeeded. Skip the generic call that follows. */           \
       pc++;                                                                    \
@@ -841,7 +1047,7 @@
     const intptr_t rhs = reinterpret_cast<intptr_t>(FP[rC]);                   \
     ResultT* slot = reinterpret_cast<ResultT*>(&FP[rA]);                       \
     Func(lhs, rhs, slot);                                                      \
-  }                                                                            \
+  }
 
 
 // Exception handling helper. Gets handler FP and PC from the Simulator where
@@ -853,7 +1059,7 @@
   do {                                                                         \
     FP = reinterpret_cast<RawObject**>(fp_);                                   \
     pc = reinterpret_cast<uint32_t*>(pc_);                                     \
-    if ((reinterpret_cast<uword>(pc) & 2) != 0) {  /* Entry frame? */          \
+    if ((reinterpret_cast<uword>(pc) & 2) != 0) { /* Entry frame? */           \
       fp_ = sp_ = reinterpret_cast<RawObject**>(fp_[0]);                       \
       thread->set_top_exit_frame_info(reinterpret_cast<uword>(sp_));           \
       thread->set_top_resource(top_resource);                                  \
@@ -862,23 +1068,23 @@
     }                                                                          \
     pp = SimulatorHelpers::FrameCode(FP)->ptr()->object_pool_->ptr();          \
     goto DispatchAfterException;                                               \
-  } while (0)                                                                  \
+  } while (0)
 
 // Runtime call helpers: handle invocation and potential exception after return.
-#define INVOKE_RUNTIME(Func, Args)                \
-  if (!InvokeRuntime(thread, this, Func, Args)) { \
-    HANDLE_EXCEPTION;                             \
-  }                                               \
+#define INVOKE_RUNTIME(Func, Args)                                             \
+  if (!InvokeRuntime(thread, this, Func, Args)) {                              \
+    HANDLE_EXCEPTION;                                                          \
+  }
 
-#define INVOKE_NATIVE(Func, Args)                 \
-  if (!InvokeNative(thread, this, Func, &Args)) { \
-    HANDLE_EXCEPTION;                             \
-  }                                               \
+#define INVOKE_NATIVE(Func, Args)                                              \
+  if (!InvokeNative(thread, this, Func, &Args)) {                              \
+    HANDLE_EXCEPTION;                                                          \
+  }
 
-#define INVOKE_NATIVE_WRAPPER(Func, Args)                \
-  if (!InvokeNativeWrapper(thread, this, Func, &Args)) { \
-    HANDLE_EXCEPTION;                                    \
-  }                                                      \
+#define INVOKE_NATIVE_WRAPPER(Func, Args)                                      \
+  if (!InvokeNativeWrapper(thread, this, Func, &Args)) {                       \
+    HANDLE_EXCEPTION;                                                          \
+  }
 
 #define LOAD_CONSTANT(index) (pp->data()[(index)].raw_obj_)
 
@@ -895,10 +1101,10 @@
   };
 
   // Interpreter state (see constants_dbc.h for high-level overview).
-  uint32_t* pc;  // Program Counter: points to the next op to execute.
+  uint32_t* pc;       // Program Counter: points to the next op to execute.
   RawObjectPool* pp;  // Pool Pointer.
-  RawObject** FP;  // Frame Pointer.
-  RawObject** SP;  // Stack Pointer.
+  RawObject** FP;     // Frame Pointer.
+  RawObject** SP;     // Stack Pointer.
 
   RawArray* argdesc;  // Arguments Descriptor: used to pass information between
                       // call instruction and the function entry.
@@ -1066,7 +1272,7 @@
       // descriptor.
       RawObject** argdesc_data = argdesc->ptr()->data();
 
-      intptr_t i = named_count - 1;  // argument position
+      intptr_t i = named_count - 1;           // argument position
       intptr_t j = num_opt_named_params - 1;  // parameter position
       while ((j >= 0) && (i >= 0)) {
         // Fetch formal parameter information: name, default value, target slot.
@@ -1130,8 +1336,7 @@
       // Process the list of default values encoded as a sequence of
       // LoadConstant instructions after EntryOpt bytecode.
       // Execute only those that correspond to parameters the were not passed.
-      for (intptr_t i = pos_count - num_fixed_params;
-           i < num_opt_pos_params;
+      for (intptr_t i = pos_count - num_fixed_params; i < num_opt_pos_params;
            i++) {
         const uint32_t load_value = pc[i];
         ASSERT(Bytecode::DecodeOpcode(load_value) == Bytecode::kLoadConstant);
@@ -1193,7 +1398,7 @@
     BYTECODE(HotCheck, A_D);
     const uint8_t increment = rA;
     const uint16_t threshold = rD;
-    RawFunction* f =  FrameFunction(FP);
+    RawFunction* f = FrameFunction(FP);
     int32_t counter = f->ptr()->usage_counter_;
     // Note: we don't increment usage counter in the prologue of optimized
     // functions.
@@ -1201,19 +1406,28 @@
       counter += increment;
       f->ptr()->usage_counter_ = counter;
     }
-    if (counter >= threshold) {
+    if (UNLIKELY(counter >= threshold)) {
       FP[0] = f;
       FP[1] = 0;
+
+      // Make the DRT_OptimizeInvokedFunction see a stub as its caller for
+      // consistency with the other architectures, and to avoid needing to
+      // generate a stackmap for the HotCheck pc.
+      const StubEntry* stub = StubCode::OptimizeFunction_entry();
+      FP[kPcMarkerSlotFromFp] = stub->code();
+      pc = reinterpret_cast<uint32_t*>(stub->EntryPoint());
+
       Exit(thread, FP, FP + 2, pc);
       NativeArguments args(thread, 1, FP, FP + 1);
       INVOKE_RUNTIME(DRT_OptimizeInvokedFunction, args);
       {
         // DRT_OptimizeInvokedFunction returns the code object to execute.
-        ASSERT(FP[1]->GetClassId() == kCodeCid);
-        RawCode* code = static_cast<RawCode*>(FP[1]);
+        ASSERT(FP[1]->GetClassId() == kFunctionCid);
+        RawFunction* function = static_cast<RawFunction*>(FP[1]);
+        RawCode* code = function->ptr()->code_;
         SimulatorHelpers::SetFrameCode(FP, code);
         pp = code->ptr()->object_pool_->ptr();
-        pc = reinterpret_cast<uint32_t*>(code->ptr()->entry_point_);
+        pc = reinterpret_cast<uint32_t*>(function->ptr()->entry_point_);
         pc_ = reinterpret_cast<uword>(pc);  // For the profiler.
       }
     }
@@ -1429,8 +1643,7 @@
       RawICData* ic_data = RAW_CAST(ICData, ic_data_obj);
       RawObject** data = ic_data->ptr()->ic_data_->ptr()->data();
       SimulatorHelpers::IncrementICUsageCount(data, 0, 0);
-      SP[0] = data[ICData::TargetIndexFor(
-          ic_data->ptr()->state_bits_ & 0x3)];
+      SP[0] = data[ICData::TargetIndexFor(ic_data->ptr()->state_bits_ & 0x3)];
       RawObject** call_base = SP - argc;
       RawObject** call_top = SP;  // *SP contains function
       argdesc = static_cast<RawArray*>(LOAD_CONSTANT(rD));
@@ -1470,9 +1683,8 @@
       RawICData* icdata = RAW_CAST(ICData, LOAD_CONSTANT(kidx));
       SimulatorHelpers::IncrementUsageCounter(
           RAW_CAST(Function, icdata->ptr()->owner_));
-      InstanceCall1(thread, icdata, call_base, call_top,
-                    &argdesc, &pp, &pc, &FP, &SP,
-                    false /* optimized */);
+      InstanceCall1(thread, icdata, call_base, call_top, &argdesc, &pp, &pc,
+                    &FP, &SP, false /* optimized */);
     }
 
     DISPATCH();
@@ -1496,9 +1708,8 @@
       RawICData* icdata = RAW_CAST(ICData, LOAD_CONSTANT(kidx));
       SimulatorHelpers::IncrementUsageCounter(
           RAW_CAST(Function, icdata->ptr()->owner_));
-      InstanceCall2(thread, icdata, call_base, call_top,
-                    &argdesc, &pp, &pc, &FP, &SP,
-                    false /* optimized */);
+      InstanceCall2(thread, icdata, call_base, call_top, &argdesc, &pp, &pc,
+                    &FP, &SP, false /* optimized */);
     }
 
     DISPATCH();
@@ -1516,9 +1727,8 @@
 
       RawICData* icdata = RAW_CAST(ICData, LOAD_CONSTANT(kidx));
       SimulatorHelpers::IncrementUsageCounter(FrameFunction(FP));
-      InstanceCall1(thread, icdata, call_base, call_top,
-                    &argdesc, &pp, &pc, &FP, &SP,
-                    true /* optimized */);
+      InstanceCall1(thread, icdata, call_base, call_top, &argdesc, &pp, &pc,
+                    &FP, &SP, true /* optimized */);
     }
 
     DISPATCH();
@@ -1536,9 +1746,8 @@
 
       RawICData* icdata = RAW_CAST(ICData, LOAD_CONSTANT(kidx));
       SimulatorHelpers::IncrementUsageCounter(FrameFunction(FP));
-      InstanceCall2(thread, icdata, call_base, call_top,
-                    &argdesc, &pp, &pc, &FP, &SP,
-                    true /* optimized */);
+      InstanceCall2(thread, icdata, call_base, call_top, &argdesc, &pp, &pc,
+                    &FP, &SP, true /* optimized */);
     }
 
     DISPATCH();
@@ -1550,7 +1759,7 @@
     const intptr_t cids_length = rD;
     RawObject** args = SP - argc + 1;
     const intptr_t receiver_cid = SimulatorHelpers::GetClassId(args[0]);
-    for (intptr_t i = 0; i < 2*cids_length; i+=2) {
+    for (intptr_t i = 0; i < 2 * cids_length; i += 2) {
       const intptr_t icdata_cid = Bytecode::DecodeD(*(pc + i));
       if (receiver_cid == icdata_cid) {
         RawFunction* target =
@@ -1736,8 +1945,8 @@
     const intptr_t rhs = reinterpret_cast<intptr_t>(FP[rC]);
     if (rhs != 0) {
       const intptr_t lhs = reinterpret_cast<intptr_t>(FP[rB]);
-      const intptr_t res =
-          ((lhs >> kSmiTagSize) % (rhs >> kSmiTagSize)) << kSmiTagSize;
+      const intptr_t res = ((lhs >> kSmiTagSize) % (rhs >> kSmiTagSize))
+                           << kSmiTagSize;
       *reinterpret_cast<intptr_t*>(&FP[rA]) =
           (res < 0) ? ((rhs < 0) ? (res - rhs) : (res + rhs)) : res;
       pc++;
@@ -1748,7 +1957,7 @@
   {
     BYTECODE(Shl, A_B_C);
     const intptr_t rhs = reinterpret_cast<intptr_t>(FP[rC]) >> kSmiTagSize;
-    if (rhs >= 0) {
+    if (static_cast<uintptr_t>(rhs) < kBitsPerWord) {
       const intptr_t lhs = reinterpret_cast<intptr_t>(FP[rB]);
       const intptr_t res = lhs << rhs;
       if (lhs == (res >> rhs)) {
@@ -1766,8 +1975,8 @@
       const intptr_t shift_amount =
           (rhs >= kBitsPerWord) ? (kBitsPerWord - 1) : rhs;
       const intptr_t lhs = reinterpret_cast<intptr_t>(FP[rB]) >> kSmiTagSize;
-      *reinterpret_cast<intptr_t*>(&FP[rA]) =
-          (lhs >> shift_amount) << kSmiTagSize;
+      *reinterpret_cast<intptr_t*>(&FP[rA]) = (lhs >> shift_amount)
+                                              << kSmiTagSize;
       pc++;
     }
     DISPATCH();
@@ -2006,6 +2215,24 @@
   }
 
   {
+    BYTECODE(DoubleIsNaN, A);
+    const double v = bit_cast<double, RawObject*>(FP[rA]);
+    if (!isnan(v)) {
+      pc++;
+    }
+    DISPATCH();
+  }
+
+  {
+    BYTECODE(DoubleIsInfinite, A);
+    const double v = bit_cast<double, RawObject*>(FP[rA]);
+    if (!isinf(v)) {
+      pc++;
+    }
+    DISPATCH();
+  }
+
+  {
     BYTECODE(LoadIndexedFloat32, A_B_C);
     uint8_t* data = SimulatorHelpers::GetTypedData(FP[rB], FP[rC]);
     const uint32_t value = *reinterpret_cast<uint32_t*>(data);
@@ -2103,7 +2330,7 @@
     FP[rA] = Smi::New(static_cast<intptr_t>(value32));
     DISPATCH();
   }
-#else  // defined(ARCH_IS_64_BIT)
+#else   // defined(ARCH_IS_64_BIT)
   {
     BYTECODE(WriteIntoDouble, A_D);
     UNIMPLEMENTED();
@@ -2237,6 +2464,18 @@
   }
 
   {
+    BYTECODE(DoubleIsNaN, A_D);
+    UNREACHABLE();
+    DISPATCH();
+  }
+
+  {
+    BYTECODE(DoubleIsInfinite, A_D);
+    UNREACHABLE();
+    DISPATCH();
+  }
+
+  {
     BYTECODE(LoadIndexedFloat32, A_B_C);
     UNREACHABLE();
     DISPATCH();
@@ -2316,7 +2555,7 @@
 
     BYTECODE(ReturnTOS, 0);
     result = *SP;
-    // Fall through to the ReturnImpl.
+  // Fall through to the ReturnImpl.
 
   ReturnImpl:
     // Restore caller PC.
@@ -2367,7 +2606,20 @@
     const uint16_t value_reg = rC;
 
     RawInstance* instance = reinterpret_cast<RawInstance*>(FP[rA]);
-    RawObject* value = reinterpret_cast<RawObject*>(FP[value_reg]);
+    RawObject* value = FP[value_reg];
+
+    instance->StorePointer(
+        reinterpret_cast<RawObject**>(instance->ptr()) + offset_in_words,
+        value);
+    DISPATCH();
+  }
+
+  {
+    BYTECODE(StoreFieldExt, A_D);
+    // The offset is stored in the following nop-instruction which is skipped.
+    const uint16_t offset_in_words = Bytecode::DecodeD(*pc++);
+    RawInstance* instance = reinterpret_cast<RawInstance*>(FP[rA]);
+    RawObject* value = FP[rD];
 
     instance->StorePointer(
         reinterpret_cast<RawObject**>(instance->ptr()) + offset_in_words,
@@ -2398,6 +2650,16 @@
   }
 
   {
+    BYTECODE(LoadFieldExt, A_D);
+    // The offset is stored in the following nop-instruction which is skipped.
+    const uint16_t offset_in_words = Bytecode::DecodeD(*pc++);
+    const uint16_t instance_reg = rD;
+    RawInstance* instance = reinterpret_cast<RawInstance*>(FP[instance_reg]);
+    FP[rA] = reinterpret_cast<RawObject**>(instance->ptr())[offset_in_words];
+    DISPATCH();
+  }
+
+  {
     BYTECODE(LoadUntagged, A_B_C);
     const uint16_t instance_reg = rB;
     const uint16_t offset_in_words = rC;
@@ -2407,7 +2669,7 @@
   }
 
   {
-    BYTECODE(LoadFieldTOS, A_D);
+    BYTECODE(LoadFieldTOS, __D);
     const uint16_t offset_in_words = rD;
     RawInstance* instance = static_cast<RawInstance*>(SP[0]);
     SP[0] = reinterpret_cast<RawObject**>(instance->ptr())[offset_in_words];
@@ -2415,7 +2677,7 @@
   }
 
   {
-    BYTECODE(InitStaticTOS, A);
+    BYTECODE(InitStaticTOS, 0);
     RawField* field = static_cast<RawField*>(*SP--);
     RawObject* value = field->ptr()->value_.static_value_;
     if ((value == Object::sentinel().raw()) ||
@@ -2435,8 +2697,7 @@
     BYTECODE(AllocateUninitializedContext, A_D);
     const uint16_t num_context_variables = rD;
     const intptr_t instance_size = Context::InstanceSize(num_context_variables);
-    const uword start =
-        thread->heap()->new_space()->TryAllocate(instance_size);
+    const uword start = thread->heap()->new_space()->TryAllocate(instance_size);
     if (LIKELY(start != 0)) {
       uword tags = 0;
       tags = RawObject::ClassIdTag::update(kContextCid, tags);
@@ -2483,8 +2744,7 @@
     if (LIKELY(start != 0)) {
       *reinterpret_cast<uword*>(start + Instance::tags_offset()) = tags;
       for (intptr_t current_offset = sizeof(RawInstance);
-           current_offset < instance_size;
-           current_offset += kWordSize) {
+           current_offset < instance_size; current_offset += kWordSize) {
         *reinterpret_cast<RawObject**>(start + current_offset) = null_value;
       }
       FP[rA] = reinterpret_cast<RawObject*>(start + kHeapObjectTag);
@@ -2495,9 +2755,9 @@
 
   {
     BYTECODE(Allocate, A_D);
-    SP[1] = 0;  // Space for the result.
+    SP[1] = 0;                  // Space for the result.
     SP[2] = LOAD_CONSTANT(rD);  // Class object.
-    SP[3] = null_value;  // Type arguments.
+    SP[3] = null_value;         // Type arguments.
     Exit(thread, FP, SP + 4, pc);
     NativeArguments args(thread, 2, SP + 2, SP + 1);
     INVOKE_RUNTIME(DRT_AllocateObject, args);
@@ -2514,12 +2774,11 @@
       RawObject* type_args = SP[0];
       const intptr_t type_args_offset = Bytecode::DecodeD(*pc);
       *reinterpret_cast<uword*>(start + Instance::tags_offset()) = tags;
-      *reinterpret_cast<RawObject**>(start + type_args_offset) = type_args;
       for (intptr_t current_offset = sizeof(RawInstance);
-           current_offset < instance_size;
-           current_offset += kWordSize) {
+           current_offset < instance_size; current_offset += kWordSize) {
         *reinterpret_cast<RawObject**>(start + current_offset) = null_value;
       }
+      *reinterpret_cast<RawObject**>(start + type_args_offset) = type_args;
       FP[rA] = reinterpret_cast<RawObject*>(start + kHeapObjectTag);
       SP -= 1;  // Consume the type arguments on the stack.
       pc += 4;
@@ -2541,10 +2800,10 @@
   {
     BYTECODE(CreateArrayOpt, A_B_C);
     const intptr_t length = Smi::Value(RAW_CAST(Smi, FP[rB]));
-    if (LIKELY(length <= Array::kMaxElements)) {
+    if (LIKELY(static_cast<uintptr_t>(length) <= Array::kMaxElements)) {
       const intptr_t fixed_size = sizeof(RawArray) + kObjectAlignment - 1;
       const intptr_t instance_size =
-          (fixed_size + length*kWordSize) & ~(kObjectAlignment - 1);
+          (fixed_size + length * kWordSize) & ~(kObjectAlignment - 1);
       const uword start =
           thread->heap()->new_space()->TryAllocate(instance_size);
       if (LIKELY(start != 0)) {
@@ -2602,15 +2861,13 @@
       } else {
         instance_cid_or_function = Smi::New(cid);
 
-        RawClass* instance_class =
-            thread->isolate()->class_table()->At(cid);
+        RawClass* instance_class = thread->isolate()->class_table()->At(cid);
         if (instance_class->ptr()->num_type_arguments_ < 0) {
           goto InstanceOfCallRuntime;
         } else if (instance_class->ptr()->num_type_arguments_ > 0) {
           instance_type_arguments = reinterpret_cast<RawTypeArguments**>(
-              instance
-                  ->ptr())[instance_class->ptr()
-                               ->type_arguments_field_offset_in_words_];
+              instance->ptr())[instance_class->ptr()
+                                   ->type_arguments_field_offset_in_words_];
         }
       }
 
@@ -2618,17 +2875,18 @@
            entries[0] != null_value;
            entries += SubtypeTestCache::kTestEntryLength) {
         if ((entries[SubtypeTestCache::kInstanceClassIdOrFunction] ==
-                instance_cid_or_function) &&
+             instance_cid_or_function) &&
             (entries[SubtypeTestCache::kInstanceTypeArguments] ==
-                instance_type_arguments) &&
+             instance_type_arguments) &&
             (entries[SubtypeTestCache::kInstantiatorTypeArguments] ==
-                instantiator_type_arguments)) {
+             instantiator_type_arguments)) {
           SP[-3] = entries[SubtypeTestCache::kTestResult];
           goto InstanceOfOk;
         }
       }
     }
 
+  // clang-format off
   InstanceOfCallRuntime:
     {
       SP[1] = instance;
@@ -2639,6 +2897,7 @@
       NativeArguments native_args(thread, 4, SP + 1, SP - 3);
       INVOKE_RUNTIME(DRT_Instanceof, native_args);
     }
+  // clang-format on
 
   InstanceOfOk:
     SP -= 3;
@@ -2649,21 +2908,29 @@
   }
 
   {
-    BYTECODE(AssertAssignable, A_D);  // Stack: instance, type args, type, name
+    BYTECODE(BadTypeError, 0);  // Stack: instance, type args, type, name
     RawObject** args = SP - 3;
     if (args[0] != null_value) {
-      const AbstractType& dst_type =
-          AbstractType::Handle(static_cast<RawAbstractType*>(args[2]));
-      if (dst_type.IsMalformedOrMalbounded()) {
-        SP[1] = args[0];  // instance.
-        SP[2] = args[3];  // name.
-        SP[3] = args[2];  // type.
-        Exit(thread, FP, SP + 4, pc);
-        NativeArguments native_args(thread, 3, SP + 1, SP - 3);
-        INVOKE_RUNTIME(DRT_BadTypeError, native_args);
-        UNREACHABLE();
-      }
+      SP[1] = args[0];  // instance.
+      SP[2] = args[3];  // name.
+      SP[3] = args[2];  // type.
+      Exit(thread, FP, SP + 4, pc);
+      NativeArguments native_args(thread, 3, SP + 1, SP - 3);
+      INVOKE_RUNTIME(DRT_BadTypeError, native_args);
+      UNREACHABLE();
+    }
+    SP -= 3;
+    DISPATCH();
+  }
 
+  {
+    BYTECODE(AssertAssignable, A_D);  // Stack: instance, type args, type, name
+    RawObject** args = SP - 3;
+    const bool may_be_smi = (rA == 1);
+    const bool is_smi =
+        ((reinterpret_cast<intptr_t>(args[0]) & kSmiTagMask) == kSmiTag);
+    const bool smi_ok = is_smi && may_be_smi;
+    if (!smi_ok && (args[0] != null_value)) {
       RawSubtypeTestCache* cache =
           static_cast<RawSubtypeTestCache*>(LOAD_CONSTANT(rD));
       if (cache != null_value) {
@@ -2683,15 +2950,13 @@
         } else {
           instance_cid_or_function = Smi::New(cid);
 
-          RawClass* instance_class =
-              thread->isolate()->class_table()->At(cid);
+          RawClass* instance_class = thread->isolate()->class_table()->At(cid);
           if (instance_class->ptr()->num_type_arguments_ < 0) {
             goto AssertAssignableCallRuntime;
           } else if (instance_class->ptr()->num_type_arguments_ > 0) {
             instance_type_arguments = reinterpret_cast<RawTypeArguments**>(
-                instance
-                    ->ptr())[instance_class->ptr()
-                                 ->type_arguments_field_offset_in_words_];
+                instance->ptr())[instance_class->ptr()
+                                     ->type_arguments_field_offset_in_words_];
           }
         }
 
@@ -2699,11 +2964,11 @@
              entries[0] != null_value;
              entries += SubtypeTestCache::kTestEntryLength) {
           if ((entries[SubtypeTestCache::kInstanceClassIdOrFunction] ==
-                  instance_cid_or_function) &&
+               instance_cid_or_function) &&
               (entries[SubtypeTestCache::kInstanceTypeArguments] ==
-                  instance_type_arguments) &&
+               instance_type_arguments) &&
               (entries[SubtypeTestCache::kInstantiatorTypeArguments] ==
-                  instantiator_type_arguments)) {
+               instantiator_type_arguments)) {
             if (true_value == entries[SubtypeTestCache::kTestResult]) {
               goto AssertAssignableOk;
             } else {
@@ -2850,10 +3115,6 @@
           pc++;
           break;
         }
-        // The cids are sorted.
-        if (cid < desired_cid) {
-          break;
-        }
       }
       pc += cids_length;
     } else {
@@ -3059,7 +3320,7 @@
     pc += (lhs > rhs) ? 0 : 1;
     DISPATCH();
   }
-#else  // defined(ARCH_IS_64_BIT)
+#else   // defined(ARCH_IS_64_BIT)
   {
     BYTECODE(IfDEq, A_D);
     UNREACHABLE();
@@ -3376,9 +3637,8 @@
     pc = SavedCallerPC(FP);
 
     const bool has_dart_caller = (reinterpret_cast<uword>(pc) & 2) == 0;
-    const intptr_t argc = has_dart_caller
-                              ? Bytecode::DecodeArgc(pc[-1])
-                              : (reinterpret_cast<uword>(pc) >> 2);
+    const intptr_t argc = has_dart_caller ? Bytecode::DecodeArgc(pc[-1])
+                                          : (reinterpret_cast<uword>(pc) >> 2);
 
     SP = FrameArguments(FP, 0);
     RawObject** args = SP - argc;
@@ -3431,12 +3691,7 @@
 }
 
 
-void Simulator::Longjmp(uword pc,
-                        uword sp,
-                        uword fp,
-                        RawObject* raw_exception,
-                        RawObject* raw_stacktrace,
-                        Thread* thread) {
+void Simulator::JumpToFrame(uword pc, uword sp, uword fp, Thread* thread) {
   // Walk over all setjmp buffers (simulated --> C++ transitions)
   // and try to find the setjmp associated with the simulated stack pointer.
   SimulatorSetjmpBuffer* buf = last_setjmp_buffer();
@@ -3456,12 +3711,22 @@
   // Clear top exit frame.
   thread->set_top_exit_frame_info(0);
 
-  ASSERT(raw_exception != Object::null());
   sp_ = reinterpret_cast<RawObject**>(sp);
   fp_ = reinterpret_cast<RawObject**>(fp);
-  pc_ = pc;
-  special_[kExceptionSpecialIndex] = raw_exception;
-  special_[kStacktraceSpecialIndex] = raw_stacktrace;
+
+  if (pc == StubCode::RunExceptionHandler_entry()->EntryPoint()) {
+    // Instead of executing the RunException stub, we implement its
+    // behavior here.
+    RawObject* raw_exception = thread->active_exception();
+    RawObject* raw_stacktrace = thread->active_stacktrace();
+    ASSERT(raw_exception != Object::null());
+    special_[kExceptionSpecialIndex] = raw_exception;
+    special_[kStacktraceSpecialIndex] = raw_stacktrace;
+    pc_ = thread->resume_pc();
+  } else {
+    pc_ = pc;
+  }
+
   buf->Longjmp();
   UNREACHABLE();
 }
diff --git a/runtime/vm/simulator_dbc.h b/runtime/vm/simulator_dbc.h
index bb875bb..e0570b7 100644
--- a/runtime/vm/simulator_dbc.h
+++ b/runtime/vm/simulator_dbc.h
@@ -2,10 +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.
 
-#ifndef VM_SIMULATOR_DBC_H_
-#define VM_SIMULATOR_DBC_H_
+#ifndef RUNTIME_VM_SIMULATOR_DBC_H_
+#define RUNTIME_VM_SIMULATOR_DBC_H_
 
-#ifndef VM_SIMULATOR_H_
+#ifndef RUNTIME_VM_SIMULATOR_H_
 #error Do not include simulator_dbc.h directly; use simulator.h.
 #endif
 
@@ -64,24 +64,18 @@
                   const Array& arguments,
                   Thread* thread);
 
-  void Longjmp(uword pc,
-               uword sp,
-               uword fp,
-               RawObject* raw_exception,
-               RawObject* raw_stacktrace,
-               Thread* thread);
+  void JumpToFrame(uword pc, uword sp, uword fp, Thread* thread);
 
   uword get_sp() const { return reinterpret_cast<uword>(sp_); }
   uword get_fp() const { return reinterpret_cast<uword>(fp_); }
   uword get_pc() const { return reinterpret_cast<uword>(pc_); }
 
   enum IntrinsicId {
-#define V(test_class_name, test_function_name, enum_name, type, fp) \
-    k##enum_name##Intrinsic,
-  ALL_INTRINSICS_LIST(V)
-  GRAPH_INTRINSICS_LIST(V)
+#define V(test_class_name, test_function_name, enum_name, type, fp)            \
+  k##enum_name##Intrinsic,
+    ALL_INTRINSICS_LIST(V) GRAPH_INTRINSICS_LIST(V)
 #undef V
-    kIntrinsicCount,
+        kIntrinsicCount,
   };
 
   static bool IsSupportedIntrinsic(IntrinsicId id) {
@@ -136,7 +130,8 @@
                        RawObject** call_base,
                        RawObject** top,
                        uint32_t* pc,
-                       RawObject** FP, RawObject** SP);
+                       RawObject** FP,
+                       RawObject** SP);
 
   void InstanceCall1(Thread* thread,
                      RawICData* icdata,
@@ -145,7 +140,8 @@
                      RawArray** argdesc,
                      RawObjectPool** pp,
                      uint32_t** pc,
-                     RawObject*** FP, RawObject*** SP,
+                     RawObject*** FP,
+                     RawObject*** SP,
                      bool optimized);
 
   void InstanceCall2(Thread* thread,
@@ -155,13 +151,12 @@
                      RawArray** argdesc,
                      RawObjectPool** pp,
                      uint32_t** pc,
-                     RawObject*** FP, RawObject*** SP,
+                     RawObject*** FP,
+                     RawObject*** SP,
                      bool optimized);
 
   // Longjmp support for exceptions.
-  SimulatorSetjmpBuffer* last_setjmp_buffer() {
-    return last_setjmp_buffer_;
-  }
+  SimulatorSetjmpBuffer* last_setjmp_buffer() { return last_setjmp_buffer_; }
   void set_last_setjmp_buffer(SimulatorSetjmpBuffer* buffer) {
     last_setjmp_buffer_ = buffer;
   }
@@ -172,4 +167,4 @@
 
 }  // namespace dart
 
-#endif  // VM_SIMULATOR_DBC_H_
+#endif  // RUNTIME_VM_SIMULATOR_DBC_H_
diff --git a/runtime/vm/simulator_mips.cc b/runtime/vm/simulator_mips.cc
index f42b3fa..f3c325f 100644
--- a/runtime/vm/simulator_mips.cc
+++ b/runtime/vm/simulator_mips.cc
@@ -23,9 +23,13 @@
 
 namespace dart {
 
-DEFINE_FLAG(uint64_t, trace_sim_after, ULLONG_MAX,
+DEFINE_FLAG(uint64_t,
+            trace_sim_after,
+            ULLONG_MAX,
             "Trace simulator execution after instruction count reached.");
-DEFINE_FLAG(uint64_t, stop_sim_at, ULLONG_MAX,
+DEFINE_FLAG(uint64_t,
+            stop_sim_at,
+            ULLONG_MAX,
             "Instruction address or instruction count to stop simulator at.");
 
 
@@ -95,7 +99,9 @@
 
   static TokenPosition GetApproximateTokenIndex(const Code& code, uword pc);
 
-  static void PrintDartFrame(uword pc, uword fp, uword sp,
+  static void PrintDartFrame(uword pc,
+                             uword fp,
+                             uword sp,
                              const Function& function,
                              TokenPosition token_pos,
                              bool is_optimized,
@@ -118,8 +124,7 @@
 }
 
 
-SimulatorDebugger::~SimulatorDebugger() {
-}
+SimulatorDebugger::~SimulatorDebugger() {}
 
 
 void SimulatorDebugger::Stop(Instr* instr, const char* message) {
@@ -130,43 +135,23 @@
 
 static Register LookupCpuRegisterByName(const char* name) {
   static const char* kNames[] = {
-      "r0",  "r1",  "r2",  "r3",
-      "r4",  "r5",  "r6",  "r7",
-      "r8",  "r9",  "r10", "r11",
-      "r12", "r13", "r14", "r15",
-      "r16", "r17", "r18", "r19",
-      "r20", "r21", "r22", "r23",
-      "r24", "r25", "r26", "r27",
-      "r28", "r29", "r30", "r31",
+      "r0",  "r1",  "r2",  "r3",  "r4",  "r5",  "r6",  "r7",
+      "r8",  "r9",  "r10", "r11", "r12", "r13", "r14", "r15",
+      "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
+      "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
 
-      "zr",  "at",  "v0",  "v1",
-      "a0",  "a1",  "a2",  "a3",
-      "t0",  "t1",  "t2",  "t3",
-      "t4",  "t5",  "t6",  "t7",
-      "s0",  "s1",  "s2",  "s3",
-      "s4",  "s5",  "s6",  "s7",
-      "t8",  "t9",  "k0",  "k1",
-      "gp",  "sp",  "fp",  "ra"
-  };
+      "zr",  "at",  "v0",  "v1",  "a0",  "a1",  "a2",  "a3",
+      "t0",  "t1",  "t2",  "t3",  "t4",  "t5",  "t6",  "t7",
+      "s0",  "s1",  "s2",  "s3",  "s4",  "s5",  "s6",  "s7",
+      "t8",  "t9",  "k0",  "k1",  "gp",  "sp",  "fp",  "ra"};
   static const Register kRegisters[] = {
-      R0,  R1,  R2,  R3,
-      R4,  R5,  R6,  R7,
-      R8,  R9,  R10, R11,
-      R12, R13, R14, R15,
-      R16, R17, R18, R19,
-      R20, R21, R22, R23,
-      R24, R25, R26, R27,
-      R28, R29, R30, R31,
+      R0,  R1,  R2,  R3,  R4,  R5,  R6,  R7,  R8,  R9,  R10,
+      R11, R12, R13, R14, R15, R16, R17, R18, R19, R20, R21,
+      R22, R23, R24, R25, R26, R27, R28, R29, R30, R31,
 
-      ZR,  AT,  V0,  V1,
-      A0,  A1,  A2,  A3,
-      T0,  T1,  T2,  T3,
-      T4,  T5,  T6,  T7,
-      S0,  S1,  S2,  S3,
-      S4,  S5,  S6,  S7,
-      T8,  T9,  K0,  K1,
-      GP,  SP,  FP,  RA
-  };
+      ZR,  AT,  V0,  V1,  A0,  A1,  A2,  A3,  T0,  T1,  T2,
+      T3,  T4,  T5,  T6,  T7,  S0,  S1,  S2,  S3,  S4,  S5,
+      S6,  S7,  T8,  T9,  K0,  K1,  GP,  SP,  FP,  RA};
   ASSERT(ARRAY_SIZE(kNames) == ARRAY_SIZE(kRegisters));
   for (unsigned i = 0; i < ARRAY_SIZE(kNames); i++) {
     if (strcmp(kNames[i], name) == 0) {
@@ -256,7 +241,7 @@
 
 
 TokenPosition SimulatorDebugger::GetApproximateTokenIndex(const Code& code,
-                                                     uword pc) {
+                                                          uword pc) {
   TokenPosition token_pos = TokenPosition::kNoSource;
   uword pc_offset = pc - code.PayloadStart();
   const PcDescriptors& descriptors =
@@ -273,7 +258,9 @@
 }
 
 
-void SimulatorDebugger::PrintDartFrame(uword pc, uword fp, uword sp,
+void SimulatorDebugger::PrintDartFrame(uword pc,
+                                       uword fp,
+                                       uword sp,
                                        const Function& function,
                                        TokenPosition token_pos,
                                        bool is_optimized,
@@ -286,19 +273,15 @@
   if (token_pos.IsReal()) {
     script.GetTokenLocation(token_pos, &line, &column);
   }
-  OS::Print("pc=0x%" Px " fp=0x%" Px " sp=0x%" Px " %s%s (%s:%" Pd
-            ":%" Pd ")\n",
-            pc, fp, sp,
-            is_optimized ? (is_inlined ? "inlined " : "optimized ") : "",
-            func_name.ToCString(),
-            url.ToCString(),
-            line, column);
+  OS::Print(
+      "pc=0x%" Px " fp=0x%" Px " sp=0x%" Px " %s%s (%s:%" Pd ":%" Pd ")\n", pc,
+      fp, sp, is_optimized ? (is_inlined ? "inlined " : "optimized ") : "",
+      func_name.ToCString(), url.ToCString(), line, column);
 }
 
 
 void SimulatorDebugger::PrintBacktrace() {
-  StackFrameIterator frames(sim_->get_register(FP),
-                            sim_->get_register(SP),
+  StackFrameIterator frames(sim_->get_register(FP), sim_->get_register(SP),
                             sim_->get_pc(),
                             StackFrameIterator::kDontValidateFrames);
   StackFrame* frame = frames.NextFrame();
@@ -323,25 +306,25 @@
           uword unoptimized_pc = it.pc();
           it.Advance();
           if (!it.Done()) {
-            PrintDartFrame(unoptimized_pc, frame->fp(), frame->sp(),
-                           inlined_function,
-                           GetApproximateTokenIndex(unoptimized_code,
-                                                    unoptimized_pc),
-                           true, true);
+            PrintDartFrame(
+                unoptimized_pc, frame->fp(), frame->sp(), inlined_function,
+                GetApproximateTokenIndex(unoptimized_code, unoptimized_pc),
+                true, true);
           }
         }
         // Print the optimized inlining frame below.
       }
-      PrintDartFrame(frame->pc(), frame->fp(), frame->sp(),
-                     function,
+      PrintDartFrame(frame->pc(), frame->fp(), frame->sp(), function,
                      GetApproximateTokenIndex(code, frame->pc()),
                      code.is_optimized(), false);
     } else {
       OS::Print("pc=0x%" Px " fp=0x%" Px " sp=0x%" Px " %s frame\n",
                 frame->pc(), frame->fp(), frame->sp(),
-                frame->IsEntryFrame() ? "entry" :
-                    frame->IsExitFrame() ? "exit" :
-                        frame->IsStubFrame() ? "stub" : "invalid");
+                frame->IsEntryFrame()
+                    ? "entry"
+                    : frame->IsExitFrame()
+                          ? "exit"
+                          : frame->IsStubFrame() ? "stub" : "invalid");
     }
     frame = frames.NextFrame();
   }
@@ -436,24 +419,25 @@
                         "%" XSTR(ARG_SIZE) "s",
                         cmd, arg1, arg2);
       if ((strcmp(cmd, "h") == 0) || (strcmp(cmd, "help") == 0)) {
-        OS::Print("c/cont -- continue execution\n"
-                  "disasm -- disassemble instrs at current pc location\n"
-                  "  other variants are:\n"
-                  "    disasm <address>\n"
-                  "    disasm <address> <number_of_instructions>\n"
-                  "  by default 10 instrs are disassembled\n"
-                  "del -- delete breakpoints\n"
-                  "gdb -- transfer control to gdb\n"
-                  "h/help -- print this help string\n"
-                  "break <address> -- set break point at specified address\n"
-                  "p/print <reg or icount or value or *addr> -- print integer\n"
-                  "pf/printfloat <freg or *addr> -- print float value\n"
-                  "po/printobject <*reg or *addr> -- print object\n"
-                  "si/stepi -- single step an instruction\n"
-                  "trace -- toggle execution tracing mode\n"
-                  "bt -- print backtrace\n"
-                  "unstop -- if current pc is a stop instr make it a nop\n"
-                  "q/quit -- Quit the debugger and exit the program\n");
+        OS::Print(
+            "c/cont -- continue execution\n"
+            "disasm -- disassemble instrs at current pc location\n"
+            "  other variants are:\n"
+            "    disasm <address>\n"
+            "    disasm <address> <number_of_instructions>\n"
+            "  by default 10 instrs are disassembled\n"
+            "del -- delete breakpoints\n"
+            "gdb -- transfer control to gdb\n"
+            "h/help -- print this help string\n"
+            "break <address> -- set break point at specified address\n"
+            "p/print <reg or icount or value or *addr> -- print integer\n"
+            "pf/printfloat <freg or *addr> -- print float value\n"
+            "po/printobject <*reg or *addr> -- print object\n"
+            "si/stepi -- single step an instruction\n"
+            "trace -- toggle execution tracing mode\n"
+            "bt -- print backtrace\n"
+            "unstop -- if current pc is a stop instr make it a nop\n"
+            "q/quit -- Quit the debugger and exit the program\n");
       } else if ((strcmp(cmd, "quit") == 0) || (strcmp(cmd, "q") == 0)) {
         OS::Print("Quitting\n");
         OS::Exit(0);
@@ -478,14 +462,13 @@
         } else {
           OS::Print("print <reg or icount or value or *addr>\n");
         }
-      } else if ((strcmp(cmd, "pf") == 0) ||
-                 (strcmp(cmd, "printfloat") == 0)) {
+      } else if ((strcmp(cmd, "pf") == 0) || (strcmp(cmd, "printfloat") == 0)) {
         if (args == 2) {
           double dvalue;
           if (GetFValue(arg1, &dvalue)) {
             uint64_t long_value = bit_cast<uint64_t, double>(dvalue);
-            OS::Print("%s: %llu 0x%llx %.8g\n",
-                arg1, long_value, long_value, dvalue);
+            OS::Print("%s: %llu 0x%llx %.8g\n", arg1, long_value, long_value,
+                      dvalue);
           } else {
             OS::Print("%s unrecognized\n", arg1);
           }
@@ -498,8 +481,8 @@
           double dvalue;
           if (GetDValue(arg1, &dvalue)) {
             uint64_t long_value = bit_cast<uint64_t, double>(dvalue);
-            OS::Print("%s: %llu 0x%llx %.8g\n",
-                arg1, long_value, long_value, dvalue);
+            OS::Print("%s: %llu 0x%llx %.8g\n", arg1, long_value, long_value,
+                      dvalue);
           } else {
             OS::Print("%s unrecognized\n", arg1);
           }
@@ -516,8 +499,8 @@
             if (Isolate::Current()->heap()->Contains(value)) {
               OS::Print("%s: \n", arg1);
 #if defined(DEBUG)
-              const Object& obj = Object::Handle(
-                  reinterpret_cast<RawObject*>(value));
+              const Object& obj =
+                  Object::Handle(reinterpret_cast<RawObject*>(value));
               obj.Print();
 #endif  // defined(DEBUG)
             } else {
@@ -640,9 +623,7 @@
       return NULL;
     }
     intptr_t len = strlen(line_buf);
-    if (len > 1 &&
-        line_buf[len - 2] == '\\' &&
-        line_buf[len - 1] == '\n') {
+    if (len > 1 && line_buf[len - 2] == '\\' && line_buf[len - 1] == '\n') {
       // When we read a line that ends with a "\" we remove the escape and
       // append the remainder.
       line_buf[len - 2] = '\n';
@@ -688,8 +669,8 @@
 
 // Synchronization primitives support.
 Mutex* Simulator::exclusive_access_lock_ = NULL;
-Simulator::AddressTag Simulator::exclusive_access_state_[kNumAddressTags] =
-    {{NULL, 0}};
+Simulator::AddressTag Simulator::exclusive_access_state_[kNumAddressTags] = {
+    {NULL, 0}};
 int Simulator::next_address_tag_ = 0;
 
 
@@ -706,9 +687,9 @@
   // the size specified by the user and the buffer space needed for
   // handling stack overflow exceptions. To be safe in potential
   // stack underflows we also add some underflow buffer space.
-  stack_ = new char[(OSThread::GetSpecifiedStackSize() +
-                     OSThread::kStackSizeBuffer +
-                     kSimulatorStackUnderflowSize)];
+  stack_ =
+      new char[(OSThread::GetSpecifiedStackSize() + OSThread::kStackSizeBuffer +
+                kSimulatorStackUnderflowSize)];
   icount_ = 0;
   delay_slot_ = false;
   break_pc_ = NULL;
@@ -803,10 +784,9 @@
     Redirection* list_head = list_;
     do {
       next_ = list_head;
-      list_head = reinterpret_cast<Redirection*>(
-          AtomicOperations::CompareAndSwapWord(
-              reinterpret_cast<uword*>(&list_),
-              reinterpret_cast<uword>(next_),
+      list_head =
+          reinterpret_cast<Redirection*>(AtomicOperations::CompareAndSwapWord(
+              reinterpret_cast<uword*>(&list_), reinterpret_cast<uword>(next_),
               reinterpret_cast<uword>(this)));
     } while (list_head != next_);
   }
@@ -976,8 +956,8 @@
   // it will be possible to disassemble the code and inspect registers.
   char buffer[128];
   snprintf(buffer, sizeof(buffer),
-           "illegal memory access at 0x%" Px ", pc=0x%" Px "\n",
-           addr, fault_pc);
+           "illegal memory access at 0x%" Px ", pc=0x%" Px "\n", addr,
+           fault_pc);
   SimulatorDebugger dbg(this);
   dbg.Stop(instr, buffer);
   // The debugger will return control in non-interactive mode.
@@ -989,8 +969,8 @@
   // The debugger will not be able to single step past this instruction, but
   // it will be possible to disassemble the code and inspect registers.
   char buffer[128];
-  snprintf(buffer, sizeof(buffer),
-           "pc=%p, unaligned %s at 0x%" Px "\n",  instr, msg, addr);
+  snprintf(buffer, sizeof(buffer), "pc=%p, unaligned %s at 0x%" Px "\n", instr,
+           msg, addr);
   SimulatorDebugger dbg(this);
   dbg.Stop(instr, buffer);
   // The debugger will return control in non-interactive mode.
@@ -1004,7 +984,7 @@
   // To be safe in potential stack underflows we leave some buffer above and
   // set the stack top.
   return StackBase() +
-      (OSThread::GetSpecifiedStackSize() + OSThread::kStackSizeBuffer);
+         (OSThread::GetSpecifiedStackSize() + OSThread::kStackSizeBuffer);
 }
 
 
@@ -1212,8 +1192,10 @@
 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);
+typedef int32_t (*SimulatorLeafRuntimeCall)(int32_t r0,
+                                            int32_t r1,
+                                            int32_t r2,
+                                            int32_t r3);
 
 // Calls to leaf float Dart runtime functions are based on this interface.
 typedef double (*SimulatorLeafFloatRuntimeCall)(double d0, double d1);
@@ -1223,7 +1205,7 @@
 typedef void (*SimulatorNativeCall)(NativeArguments* arguments, uword target);
 
 
-void Simulator::DoBreak(Instr *instr) {
+void Simulator::DoBreak(Instr* instr) {
   ASSERT(instr->OpcodeField() == SPECIAL);
   ASSERT(instr->FunctionField() == BREAK);
   if (instr->BreakCodeField() == Instr::kStopMessageCode) {
@@ -1253,7 +1235,7 @@
       }
       if (redirection->call_kind() == kRuntimeCall) {
         NativeArguments arguments;
-        ASSERT(sizeof(NativeArguments) == 4*kWordSize);
+        ASSERT(sizeof(NativeArguments) == 4 * kWordSize);
         arguments.thread_ = reinterpret_cast<Thread*>(get_register(A0));
         arguments.argc_tag_ = get_register(A1);
         arguments.argv_ = reinterpret_cast<RawObject**>(get_register(A2));
@@ -1271,7 +1253,7 @@
         SimulatorLeafRuntimeCall target =
             reinterpret_cast<SimulatorLeafRuntimeCall>(external);
         a0 = target(a0, a1, a2, a3);
-        set_register(V0, a0);  // Set returned result from function.
+        set_register(V0, a0);       // Set returned result from function.
         set_register(V1, icount_);  // Zap second result register.
       } else if (redirection->call_kind() == kLeafFloatRuntimeCall) {
         ASSERT((0 <= redirection->argument_count()) &&
@@ -1424,7 +1406,7 @@
       ASSERT(instr->RsField() != instr->RdField());
       ASSERT(!delay_slot_);
       // Format(instr, "jalr'hint 'rd, rs");
-      set_register(instr->RdField(), pc_ + 2*Instr::kInstrSize);
+      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.
@@ -1547,8 +1529,7 @@
     }
     case SLL: {
       ASSERT(instr->RsField() == 0);
-      if ((instr->RdField() == R0) &&
-          (instr->RtField() == R0) &&
+      if ((instr->RdField() == R0) && (instr->RtField() == R0) &&
           (instr->SaField() == 0)) {
         // Format(instr, "nop");
         // Nothing to be done for NOP.
@@ -1745,14 +1726,14 @@
     case BGEZAL: {
       int32_t rs_val = get_register(instr->RsField());
       // Return address is one after the delay slot.
-      set_register(RA, pc_ + (2*Instr::kInstrSize));
+      set_register(RA, pc_ + (2 * Instr::kInstrSize));
       DoBranch(instr, rs_val >= 0, false);
       break;
     }
     case BLTZAL: {
       int32_t rs_val = get_register(instr->RsField());
       // Return address is one after the delay slot.
-      set_register(RA, pc_ + (2*Instr::kInstrSize));
+      set_register(RA, pc_ + (2 * Instr::kInstrSize));
       DoBranch(instr, rs_val < 0, false);
       break;
     }
@@ -1858,7 +1839,7 @@
         ASSERT(instr->FormatField() == FMT_D);  // Only D supported.
         ASSERT(instr->FdField() == F0);
         set_fcsr_bit(fcsr_cc,
-            (fs_val == ft_val) || isnan(fs_val) || isnan(ft_val));
+                     (fs_val == ft_val) || isnan(fs_val) || isnan(ft_val));
         break;
       }
       case COP1_C_OLT: {
@@ -1871,7 +1852,7 @@
         ASSERT(instr->FormatField() == FMT_D);  // Only D supported.
         ASSERT(instr->FdField() == F0);
         set_fcsr_bit(fcsr_cc,
-            (fs_val < ft_val) || isnan(fs_val) || isnan(ft_val));
+                     (fs_val < ft_val) || isnan(fs_val) || isnan(ft_val));
         break;
       }
       case COP1_C_OLE: {
@@ -1884,7 +1865,7 @@
         ASSERT(instr->FormatField() == FMT_D);  // Only D supported.
         ASSERT(instr->FdField() == F0);
         set_fcsr_bit(fcsr_cc,
-            (fs_val <= ft_val) || isnan(fs_val) || isnan(ft_val));
+                     (fs_val <= ft_val) || isnan(fs_val) || isnan(ft_val));
         break;
       }
       case COP1_TRUNC_W: {
@@ -2310,7 +2291,7 @@
     }
     default: {
       OS::PrintErr("Undecoded instruction: 0x%x at %p\n",
-                    instr->InstructionBits(), instr);
+                   instr->InstructionBits(), instr);
       UnimplementedInstruction(instr);
       break;
     }
@@ -2498,12 +2479,7 @@
 }
 
 
-void Simulator::Longjmp(uword pc,
-                        uword sp,
-                        uword fp,
-                        RawObject* raw_exception,
-                        RawObject* raw_stacktrace,
-                        Thread* thread) {
+void Simulator::JumpToFrame(uword pc, uword sp, uword fp, Thread* thread) {
   // Walk over all setjmp buffers (simulated --> C++ transitions)
   // and try to find the setjmp associated with the simulated stack pointer.
   SimulatorSetjmpBuffer* buf = last_setjmp_buffer();
@@ -2526,15 +2502,11 @@
   thread->set_vm_tag(VMTag::kDartTagId);
   // Clear top exit frame.
   thread->set_top_exit_frame_info(0);
-
-  ASSERT(raw_exception != Object::null());
-  set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception));
-  set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace));
   // Restore pool pointer.
-  int32_t code = *reinterpret_cast<int32_t*>(
-      fp + kPcMarkerSlotFromFp * kWordSize);
-  int32_t pp = *reinterpret_cast<int32_t*>(
-      code + Code::object_pool_offset() - kHeapObjectTag);
+  int32_t code =
+      *reinterpret_cast<int32_t*>(fp + kPcMarkerSlotFromFp * kWordSize);
+  int32_t pp = *reinterpret_cast<int32_t*>(code + Code::object_pool_offset() -
+                                           kHeapObjectTag);
   set_register(CODE_REG, code);
   set_register(PP, pp);
   buf->Longjmp();
diff --git a/runtime/vm/simulator_mips.h b/runtime/vm/simulator_mips.h
index cbda735..00d93ec 100644
--- a/runtime/vm/simulator_mips.h
+++ b/runtime/vm/simulator_mips.h
@@ -9,10 +9,10 @@
 // which will start execution in the Simulator or forwards to the real entry
 // on a MIPS HW platform.
 
-#ifndef VM_SIMULATOR_MIPS_H_
-#define VM_SIMULATOR_MIPS_H_
+#ifndef RUNTIME_VM_SIMULATOR_MIPS_H_
+#define RUNTIME_VM_SIMULATOR_MIPS_H_
 
-#ifndef VM_SIMULATOR_H_
+#ifndef RUNTIME_VM_SIMULATOR_H_
 #error Do not include simulator_mips.h directly; use simulator.h.
 #endif
 
@@ -58,9 +58,7 @@
   int64_t get_dregister_bits(DRegister freg) const;
   double get_dregister(DRegister freg) const;
 
-  int32_t get_sp() const {
-    return get_register(SPREG);
-  }
+  int32_t get_sp() const { return get_register(SPREG); }
 
   // Accessor for the pc.
   void set_pc(int32_t value) { pc_ = value; }
@@ -88,9 +86,7 @@
     }
   }
 
-  bool test_fcsr_bit(uint32_t cc) {
-    return fcsr_ & (1 << cc);
-  }
+  bool test_fcsr_bit(uint32_t cc) { return fcsr_ & (1 << cc); }
 
   // Accessors to the internal simulator stack base and top.
   uword StackBase() const { return reinterpret_cast<uword>(stack_); }
@@ -143,12 +139,7 @@
 
   static uword FunctionForRedirect(uword redirect);
 
-  void Longjmp(uword pc,
-               uword sp,
-               uword fp,
-               RawObject* raw_exception,
-               RawObject* raw_stacktrace,
-               Thread* thread);
+  void JumpToFrame(uword pc, uword sp, uword fp, Thread* thread);
 
  private:
   // A pc value used to signal the simulator to stop execution.  Generally
@@ -178,9 +169,7 @@
   int32_t break_instr_;
 
   // Illegal memory access support.
-  static bool IsIllegalAddress(uword addr) {
-    return addr < 64*1024;
-  }
+  static bool IsIllegalAddress(uword addr) { return addr < 64 * 1024; }
   void HandleIllegalAccess(uword addr, Instr* instr);
 
   // Read and write memory.
@@ -196,7 +185,7 @@
   inline int8_t ReadB(uword addr);
   inline uint8_t ReadBU(uword addr);
   inline int16_t ReadH(uword addr, Instr* instr);
-  inline uint16_t ReadHU(uword addr, Instr *instr);
+  inline uint16_t ReadHU(uword addr, Instr* instr);
   inline intptr_t ReadW(uword addr, Instr* instr);
 
   inline void WriteB(uword addr, uint8_t value);
@@ -238,7 +227,7 @@
   static bool HasExclusiveAccessAndOpen(uword addr);
 
   void DoBranch(Instr* instr, bool taken, bool likely);
-  void DoBreak(Instr *instr);
+  void DoBreak(Instr* instr);
 
   void DecodeSpecial(Instr* instr);
   void DecodeSpecial2(Instr* instr);
@@ -253,9 +242,7 @@
   bool IsTracingExecution() const;
 
   // Longjmp support for exceptions.
-  SimulatorSetjmpBuffer* last_setjmp_buffer() {
-    return last_setjmp_buffer_;
-  }
+  SimulatorSetjmpBuffer* last_setjmp_buffer() { return last_setjmp_buffer_; }
   void set_last_setjmp_buffer(SimulatorSetjmpBuffer* buffer) {
     last_setjmp_buffer_ = buffer;
   }
@@ -267,4 +254,4 @@
 
 }  // namespace dart
 
-#endif  // VM_SIMULATOR_MIPS_H_
+#endif  // RUNTIME_VM_SIMULATOR_MIPS_H_
diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc
index 0062dac..b7a1b83 100644
--- a/runtime/vm/snapshot.cc
+++ b/runtime/vm/snapshot.cc
@@ -22,9 +22,9 @@
 #include "vm/version.h"
 
 // We currently only expect the Dart mutator to read snapshots.
-#define ASSERT_NO_SAFEPOINT_SCOPE()                            \
-    isolate()->AssertCurrentThreadIsMutator();                 \
-    ASSERT(thread()->no_safepoint_scope_depth() != 0)
+#define ASSERT_NO_SAFEPOINT_SCOPE()                                            \
+  isolate()->AssertCurrentThreadIsMutator();                                   \
+  ASSERT(thread()->no_safepoint_scope_depth() != 0)
 
 namespace dart {
 
@@ -60,10 +60,8 @@
   // Return whether this class is serialized in two steps: first a reference,
   // with sufficient information to allocate a correctly sized object, and then
   // later inline with complete contents.
-  return class_id >= kNumPredefinedCids ||
-         class_id == kArrayCid ||
-         class_id == kImmutableArrayCid ||
-         class_id == kObjectPoolCid ||
+  return class_id >= kNumPredefinedCids || class_id == kArrayCid ||
+         class_id == kImmutableArrayCid || class_id == kObjectPoolCid ||
          RawObject::IsImplicitFieldClassId(class_id);
 }
 
@@ -84,26 +82,38 @@
 
 static RawType* GetType(ObjectStore* object_store, intptr_t index) {
   switch (index) {
-    case kObjectType: return object_store->object_type();
-    case kNullType: return object_store->null_type();
-    case kFunctionType: return object_store->function_type();
-    case kNumberType: return object_store->number_type();
-    case kSmiType: return object_store->smi_type();
-    case kMintType: return object_store->mint_type();
-    case kDoubleType: return object_store->double_type();
-    case kIntType: return object_store->int_type();
-    case kBoolType: return object_store->bool_type();
-    case kStringType: return object_store->string_type();
-    case kArrayType: return object_store->array_type();
-    default: break;
+    case kObjectType:
+      return object_store->object_type();
+    case kNullType:
+      return object_store->null_type();
+    case kFunctionType:
+      return object_store->function_type();
+    case kNumberType:
+      return object_store->number_type();
+    case kSmiType:
+      return object_store->smi_type();
+    case kMintType:
+      return object_store->mint_type();
+    case kDoubleType:
+      return object_store->double_type();
+    case kIntType:
+      return object_store->int_type();
+    case kBoolType:
+      return object_store->bool_type();
+    case kStringType:
+      return object_store->string_type();
+    case kArrayType:
+      return object_store->array_type();
+    default:
+      break;
   }
   UNREACHABLE();
   return Type::null();
 }
 
 
-static intptr_t GetTypeIndex(
-    ObjectStore* object_store, const RawType* raw_type) {
+static intptr_t GetTypeIndex(ObjectStore* object_store,
+                             const RawType* raw_type) {
   ASSERT(raw_type->IsHeapObject());
   if (raw_type == object_store->object_type()) {
     return kObjectType;
@@ -132,6 +142,27 @@
 }
 
 
+const char* Snapshot::KindToCString(Kind kind) {
+  switch (kind) {
+    case kCore:
+      return "core";
+    case kScript:
+      return "script";
+    case kMessage:
+      return "message";
+    case kAppWithJIT:
+      return "app-jit";
+    case kAppNoJIT:
+      return "app-aot";
+    case kNone:
+      return "none";
+    case kInvalid:
+    default:
+      return "invalid";
+  }
+}
+
+
 // TODO(5411462): Temporary setup of snapshot for testing purposes,
 // the actual creation of a snapshot maybe done differently.
 const Snapshot* Snapshot::SetupFromBuffer(const void* raw_memory) {
@@ -163,12 +194,11 @@
 }
 
 
-SnapshotReader::SnapshotReader(
-    const uint8_t* buffer,
-    intptr_t size,
-    Snapshot::Kind kind,
-    ZoneGrowableArray<BackRefNode>* backward_refs,
-    Thread* thread)
+SnapshotReader::SnapshotReader(const uint8_t* buffer,
+                               intptr_t size,
+                               Snapshot::Kind kind,
+                               ZoneGrowableArray<BackRefNode>* backward_refs,
+                               Thread* thread)
     : BaseReader(buffer, size),
       kind_(kind),
       thread_(thread),
@@ -191,10 +221,10 @@
       function_(Function::Handle(zone_)),
       error_(UnhandledException::Handle(zone_)),
       max_vm_isolate_object_id_(
-          (Snapshot::IsFull(kind)) ?
-              Object::vm_isolate_snapshot_object_table().Length() : 0),
-      backward_references_(backward_refs) {
-}
+          (Snapshot::IsFull(kind))
+              ? Object::vm_isolate_snapshot_object_table().Length()
+              : 0),
+      backward_references_(backward_refs) {}
 
 
 RawObject* SnapshotReader::ReadObject() {
@@ -238,7 +268,7 @@
     SetReadException("Invalid object found in message.");
   }
   str_ ^= ReadObjectImpl(kAsInlinedObject);
-  cls = library_.LookupClass(str_);
+  cls = library_.LookupClassAllowPrivate(str_);
   if (cls.IsNull()) {
     SetReadException("Invalid object found in message.");
   }
@@ -269,7 +299,7 @@
     str_ ^= ReadObjectImpl(kAsInlinedObject);
     func ^= library_.LookupLocalFunction(str_);
   } else {
-    cls_ = library_.LookupClass(str_);
+    cls_ = library_.LookupClassAllowPrivate(str_);
     if (cls_.IsNull()) {
       SetReadException("Expected a class name, but found an invalid name.");
     }
@@ -327,8 +357,8 @@
 
 
 intptr_t SnapshotReader::NextAvailableObjectId() const {
-  return backward_references_->length() +
-      kMaxPredefinedObjectIds + max_vm_isolate_object_id_;
+  return backward_references_->length() + kMaxPredefinedObjectIds +
+         max_vm_isolate_object_id_;
 }
 
 
@@ -338,10 +368,8 @@
   args.SetAt(0, error_str);
   Object& result = Object::Handle(zone());
   const Library& library = Library::Handle(zone(), Library::CoreLibrary());
-  result = DartLibraryCalls::InstanceCreate(library,
-                                            Symbols::ArgumentError(),
-                                            Symbols::Dot(),
-                                            args);
+  result = DartLibraryCalls::InstanceCreate(library, Symbols::ArgumentError(),
+                                            Symbols::Dot(), args);
   const Stacktrace& stacktrace = Stacktrace::Handle(zone());
   const UnhandledException& error = UnhandledException::Handle(
       zone(), UnhandledException::New(Instance::Cast(result), stacktrace));
@@ -367,10 +395,8 @@
     return NewInteger(header_value);
   }
   ASSERT((header_value <= kIntptrMax) && (header_value >= kIntptrMin));
-  return ReadObjectImpl(static_cast<intptr_t>(header_value),
-                        as_reference,
-                        patch_object_id,
-                        patch_offset);
+  return ReadObjectImpl(static_cast<intptr_t>(header_value), as_reference,
+                        patch_object_id, patch_offset);
 }
 
 
@@ -383,8 +409,7 @@
   }
   if (SerializedHeaderTag::decode(header_value) == kObjectId) {
     return ReadIndexedObject(SerializedHeaderData::decode(header_value),
-                             patch_object_id,
-                             patch_offset);
+                             patch_object_id, patch_offset);
   }
   ASSERT(SerializedHeaderTag::decode(header_value) == kInlined);
   intptr_t object_id = SerializedHeaderData::decode(header_value);
@@ -410,24 +435,22 @@
   intptr_t class_id = LookupInternalClass(class_header);
   switch (class_id) {
 #define SNAPSHOT_READ(clazz)                                                   \
-    case clazz::kClassId: {                                                    \
-      pobj_ = clazz::ReadFrom(this, object_id, tags, kind_, read_as_reference);\
-      break;                                                                   \
-    }
+  case clazz::kClassId: {                                                      \
+    pobj_ = clazz::ReadFrom(this, object_id, tags, kind_, read_as_reference);  \
+    break;                                                                     \
+  }
     CLASS_LIST_NO_OBJECT(SNAPSHOT_READ)
 #undef SNAPSHOT_READ
-#define SNAPSHOT_READ(clazz)                                                   \
-        case kTypedData##clazz##Cid:                                           \
+#define SNAPSHOT_READ(clazz) case kTypedData##clazz##Cid:
 
     CLASS_LIST_TYPED_DATA(SNAPSHOT_READ) {
       tags = RawObject::ClassIdTag::update(class_id, tags);
-      pobj_ = TypedData::ReadFrom(
-          this, object_id, tags, kind_, read_as_reference);
+      pobj_ =
+          TypedData::ReadFrom(this, object_id, tags, kind_, read_as_reference);
       break;
     }
 #undef SNAPSHOT_READ
-#define SNAPSHOT_READ(clazz)                                                   \
-    case kExternalTypedData##clazz##Cid:                                       \
+#define SNAPSHOT_READ(clazz) case kExternalTypedData##clazz##Cid:
 
     CLASS_LIST_TYPED_DATA(SNAPSHOT_READ) {
       tags = RawObject::ClassIdTag::update(class_id, tags);
@@ -435,7 +458,9 @@
       break;
     }
 #undef SNAPSHOT_READ
-    default: UNREACHABLE(); break;
+    default:
+      UNREACHABLE();
+      break;
   }
   if (!read_as_reference) {
     AddPatchRecord(object_id, patch_object_id, patch_offset);
@@ -488,8 +513,7 @@
       pobj_ = ReadObjectImpl(read_as_reference);
       result->SetFieldAtOffset(offset, pobj_);
       if ((offset != type_argument_field_offset) &&
-          (kind_ == Snapshot::kMessage) &&
-          FLAG_use_field_guards) {
+          (kind_ == Snapshot::kMessage) && FLAG_use_field_guards) {
         // TODO(fschneider): Consider hoisting these lookups out of the loop.
         // This would involve creating a handle, since cls_ can't be reused
         // across the call to ReadObjectImpl.
@@ -543,11 +567,9 @@
  public:
   HeapLocker(Thread* thread, PageSpace* page_space)
       : StackResource(thread), page_space_(page_space) {
-        page_space_->AcquireDataLock();
+    page_space_->AcquireDataLock();
   }
-  ~HeapLocker() {
-    page_space_->ReleaseDataLock();
-  }
+  ~HeapLocker() { page_space_->ReleaseDataLock(); }
 
  private:
   PageSpace* page_space_;
@@ -569,8 +591,7 @@
     if (!obj_.IsError()) {
       const intptr_t kMessageBufferSize = 128;
       char message_buffer[kMessageBufferSize];
-      OS::SNPrint(message_buffer,
-                  kMessageBufferSize,
+      OS::SNPrint(message_buffer, kMessageBufferSize,
                   "Invalid object %s found in script snapshot",
                   obj_.ToCString());
       const String& msg = String::Handle(String::New(message_buffer));
@@ -591,8 +612,7 @@
   if (PendingBytes() < version_len) {
     const intptr_t kMessageBufferSize = 128;
     char message_buffer[kMessageBufferSize];
-    OS::SNPrint(message_buffer,
-                kMessageBufferSize,
+    OS::SNPrint(message_buffer, kMessageBufferSize,
                 "No full snapshot version found, expected '%s'",
                 expected_version);
     // This can also fail while bringing up the VM isolate, so make sure to
@@ -607,11 +627,9 @@
     const intptr_t kMessageBufferSize = 256;
     char message_buffer[kMessageBufferSize];
     char* actual_version = OS::StrNDup(version, version_len);
-    OS::SNPrint(message_buffer,
-                kMessageBufferSize,
+    OS::SNPrint(message_buffer, kMessageBufferSize,
                 "Wrong %s snapshot version, expected '%s' found '%s'",
-                (Snapshot::IsFull(kind_)) ? "full" : "script",
-                expected_version,
+                (Snapshot::IsFull(kind_)) ? "full" : "script", expected_version,
                 actual_version);
     free(actual_version);
     // This can also fail while bringing up the VM isolate, so make sure to
@@ -632,13 +650,11 @@
       strncmp(features, expected_features, expected_len)) {
     const intptr_t kMessageBufferSize = 256;
     char message_buffer[kMessageBufferSize];
-    char* actual_features = OS::StrNDup(features, buffer_len < 128 ? buffer_len
-                                                                   : 128);
-    OS::SNPrint(message_buffer,
-                kMessageBufferSize,
+    char* actual_features =
+        OS::StrNDup(features, buffer_len < 128 ? buffer_len : 128);
+    OS::SNPrint(message_buffer, kMessageBufferSize,
                 "Wrong features in snapshot, expected '%s' found '%s'",
-                expected_features,
-                actual_features);
+                expected_features, actual_features);
     free(const_cast<char*>(expected_features));
     free(actual_features);
     // This can also fail while bringing up the VM isolate, so make sure to
@@ -694,8 +710,7 @@
 
 static void EnsureIdentifier(char* label) {
   for (char c = *label; c != '\0'; c = *++label) {
-    if (((c >= 'a') && (c <= 'z')) ||
-        ((c >= 'A') && (c <= 'Z')) ||
+    if (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')) ||
         ((c >= '0') && (c <= '9'))) {
       continue;
     }
@@ -704,11 +719,14 @@
 }
 
 
-void AssemblyInstructionsWriter::Write() {
+void AssemblyInstructionsWriter::Write(uint8_t* vmisolate_buffer,
+                                       intptr_t vmisolate_length,
+                                       uint8_t* isolate_buffer,
+                                       intptr_t isolate_length) {
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
-  NOT_IN_PRODUCT(TimelineDurationScope tds(thread,
-      Timeline::GetIsolateStream(), "WriteInstructions"));
+  NOT_IN_PRODUCT(TimelineDurationScope tds(thread, Timeline::GetIsolateStream(),
+                                           "WriteInstructions"));
 
   // Handlify collected raw pointers as building the names below
   // will allocate on the Dart heap.
@@ -767,8 +785,7 @@
       beginning += sizeof(uword);
 
       for (uword* cursor = reinterpret_cast<uword*>(beginning);
-           cursor < reinterpret_cast<uword*>(entry);
-           cursor++) {
+           cursor < reinterpret_cast<uword*>(entry); cursor++) {
         WriteWordLiteralText(*cursor);
       }
     }
@@ -782,8 +799,8 @@
       str = Class::Cast(owner).Name();
       const char* name = str.ToCString();
       EnsureIdentifier(const_cast<char*>(name));
-      assembly_stream_.Print("Precompiled_AllocationStub_%s_%" Pd ":\n",
-                             name, i);
+      assembly_stream_.Print("Precompiled_AllocationStub_%s_%" Pd ":\n", name,
+                             i);
     } else if (owner.IsFunction()) {
       const char* name = Function::Cast(owner).ToQualifiedCString();
       EnsureIdentifier(const_cast<char*>(name));
@@ -797,7 +814,7 @@
       NoSafepointScope no_safepoint;
       uword beginning = reinterpret_cast<uword>(insns.raw()) - kHeapObjectTag;
       uword entry = beginning + Instructions::HeaderSize();
-      uword payload_size = insns.size();
+      uword payload_size = insns.Size();
       payload_size = Utils::RoundUp(payload_size, OS::PreferredCodeAlignment());
       uword end = entry + payload_size;
 
@@ -806,8 +823,7 @@
       ASSERT(Utils::IsAligned(end, sizeof(uint64_t)));
 
       for (uword* cursor = reinterpret_cast<uword*>(entry);
-           cursor < reinterpret_cast<uword*>(end);
-           cursor++) {
+           cursor < reinterpret_cast<uword*>(end); cursor++) {
         WriteWordLiteralText(*cursor);
       }
     }
@@ -844,19 +860,36 @@
     WriteWordLiteralData(marked_tags);
     start += sizeof(uword);
     for (uword* cursor = reinterpret_cast<uword*>(start);
-         cursor < reinterpret_cast<uword*>(end);
-         cursor++) {
+         cursor < reinterpret_cast<uword*>(end); cursor++) {
       WriteWordLiteralData(*cursor);
     }
   }
+
+
+  assembly_stream_.Print(".globl _kVmIsolateSnapshot\n");
+  assembly_stream_.Print(".balign %" Pd ", 0\n", VirtualMemory::PageSize());
+  assembly_stream_.Print("_kVmIsolateSnapshot:\n");
+  for (intptr_t i = 0; i < vmisolate_length; i++) {
+    assembly_stream_.Print(".byte %" Pd "\n", vmisolate_buffer[i]);
+  }
+
+  assembly_stream_.Print(".globl _kIsolateSnapshot\n");
+  assembly_stream_.Print(".balign %" Pd ", 0\n", VirtualMemory::PageSize());
+  assembly_stream_.Print("_kIsolateSnapshot:\n");
+  for (intptr_t i = 0; i < isolate_length; i++) {
+    assembly_stream_.Print(".byte %" Pd "\n", isolate_buffer[i]);
+  }
 }
 
 
-void BlobInstructionsWriter::Write() {
+void BlobInstructionsWriter::Write(uint8_t* vmisolate_buffer,
+                                   intptr_t vmisolate_len,
+                                   uint8_t* isolate_buffer,
+                                   intptr_t isolate_length) {
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
-  NOT_IN_PRODUCT(TimelineDurationScope tds(thread,
-      Timeline::GetIsolateStream(), "WriteInstructions"));
+  NOT_IN_PRODUCT(TimelineDurationScope tds(thread, Timeline::GetIsolateStream(),
+                                           "WriteInstructions"));
 
   // Handlify collected raw pointers as building the names below
   // will allocate on the Dart heap.
@@ -902,8 +935,7 @@
       beginning += sizeof(uword);
 
       for (uword* cursor = reinterpret_cast<uword*>(beginning);
-           cursor < reinterpret_cast<uword*>(entry);
-           cursor++) {
+           cursor < reinterpret_cast<uword*>(entry); cursor++) {
         instructions_blob_stream_.WriteWord(*cursor);
       }
     }
@@ -913,7 +945,7 @@
       NoSafepointScope no_safepoint;
       uword beginning = reinterpret_cast<uword>(insns.raw()) - kHeapObjectTag;
       uword entry = beginning + Instructions::HeaderSize();
-      uword payload_size = insns.size();
+      uword payload_size = insns.Size();
       payload_size = Utils::RoundUp(payload_size, OS::PreferredCodeAlignment());
       uword end = entry + payload_size;
 
@@ -922,8 +954,7 @@
       ASSERT(Utils::IsAligned(end, sizeof(uint64_t)));
 
       for (uword* cursor = reinterpret_cast<uword*>(entry);
-           cursor < reinterpret_cast<uword*>(end);
-           cursor++) {
+           cursor < reinterpret_cast<uword*>(end); cursor++) {
         instructions_blob_stream_.WriteWord(*cursor);
       }
     }
@@ -950,8 +981,7 @@
     rodata_blob_stream_.WriteWord(marked_tags);
     start += sizeof(uword);
     for (uword* cursor = reinterpret_cast<uword*>(start);
-         cursor < reinterpret_cast<uword*>(end);
-         cursor++) {
+         cursor < reinterpret_cast<uword*>(end); cursor++) {
       rodata_blob_stream_.WriteWord(*cursor);
     }
   }
@@ -967,9 +997,8 @@
 RawObject* InstructionsReader::GetObjectAt(int32_t offset) {
   ASSERT(Utils::IsAligned(offset, kWordSize));
 
-  RawObject* result =
-      reinterpret_cast<RawObject*>(
-          reinterpret_cast<uword>(data_buffer_) + offset + kHeapObjectTag);
+  RawObject* result = reinterpret_cast<RawObject*>(
+      reinterpret_cast<uword>(data_buffer_) + offset + kHeapObjectTag);
   ASSERT(result->IsMarked());
 
   return result;
@@ -994,7 +1023,7 @@
 #define READ_VM_SINGLETON_OBJ(id, obj)                                         \
   if (object_id == id) {                                                       \
     return obj;                                                                \
-  }                                                                            \
+  }
 
 RawObject* SnapshotReader::ReadVMIsolateObject(intptr_t header_value) {
   intptr_t object_id = GetVMIsolateObjectId(header_value);
@@ -1113,7 +1142,7 @@
         // First we replace the back ref table with the canonical object.
         *objref = newobj.raw();
         // Now we go over all the patch records and patch the canonical object.
-        for (intptr_t j = 0; j < patches->length(); j+=2) {
+        for (intptr_t j = 0; j < patches->length(); j += 2) {
           NoSafepointScope no_safepoint;
           intptr_t patch_object_id = (*patches)[j];
           intptr_t patch_offset = (*patches)[j + 1];
@@ -1140,18 +1169,16 @@
   // Setup the object fields.
   const intptr_t typeargs_offset =
       GrowableObjectArray::type_arguments_offset() / kWordSize;
-  *TypeArgumentsHandle() ^= ReadObjectImpl(kAsInlinedObject,
-                                           object_id,
-                                           typeargs_offset);
+  *TypeArgumentsHandle() ^=
+      ReadObjectImpl(kAsInlinedObject, object_id, typeargs_offset);
   result.SetTypeArguments(*TypeArgumentsHandle());
 
   bool as_reference = RawObject::IsCanonical(tags) ? false : true;
   intptr_t offset = result.raw_ptr()->data() -
-      reinterpret_cast<RawObject**>(result.raw()->ptr());
+                    reinterpret_cast<RawObject**>(result.raw()->ptr());
   for (intptr_t i = 0; i < len; i++) {
-    *PassiveObjectHandle() = ReadObjectImpl(as_reference,
-                                            object_id,
-                                            (i + offset));
+    *PassiveObjectHandle() =
+        ReadObjectImpl(as_reference, object_id, (i + offset));
     result.SetAt(i, *PassiveObjectHandle());
   }
 }
@@ -1164,8 +1191,7 @@
                      size,
                      Snapshot::kScript,
                      new ZoneGrowableArray<BackRefNode>(kNumInitialReferences),
-                     thread) {
-}
+                     thread) {}
 
 
 ScriptSnapshotReader::~ScriptSnapshotReader() {
@@ -1180,8 +1206,7 @@
                      size,
                      Snapshot::kMessage,
                      new ZoneGrowableArray<BackRefNode>(kNumInitialReferences),
-                     thread) {
-}
+                     thread) {}
 
 
 MessageSnapshotReader::~MessageSnapshotReader() {
@@ -1226,21 +1251,21 @@
   V(Mint)                                                                      \
   V(Bigint)                                                                    \
   V(Double)                                                                    \
-  V(ImmutableArray)                                                            \
+  V(ImmutableArray)
 
 #define VM_OBJECT_WRITE(clazz)                                                 \
   case clazz::kClassId: {                                                      \
     object_id = forward_list_->AddObject(zone(), rawobj, kIsSerialized);       \
     Raw##clazz* raw_obj = reinterpret_cast<Raw##clazz*>(rawobj);               \
-        raw_obj->WriteTo(this, object_id, kind(), false);                      \
+    raw_obj->WriteTo(this, object_id, kind(), false);                          \
     return true;                                                               \
-  }                                                                            \
+  }
 
 #define WRITE_VM_SINGLETON_OBJ(obj, id)                                        \
   if (rawobj == obj) {                                                         \
     WriteVMIsolateObject(id);                                                  \
     return true;                                                               \
-  }                                                                            \
+  }
 
 bool SnapshotWriter::HandleVMIsolateObject(RawObject* rawobj) {
   // Check if it is one of the singleton VM objects.
@@ -1332,15 +1357,13 @@
 // objects and their accompanying token streams.
 class ScriptVisitor : public ObjectVisitor {
  public:
-  explicit ScriptVisitor(Thread* thread) :
-      objHandle_(Object::Handle(thread->zone())),
-      count_(0),
-      scripts_(NULL) {}
+  explicit ScriptVisitor(Thread* thread)
+      : objHandle_(Object::Handle(thread->zone())), count_(0), scripts_(NULL) {}
 
-  ScriptVisitor(Thread* thread, const Array* scripts) :
-      objHandle_(Object::Handle(thread->zone())),
-      count_(0),
-      scripts_(scripts) {}
+  ScriptVisitor(Thread* thread, const Array* scripts)
+      : objHandle_(Object::Handle(thread->zone())),
+        count_(0),
+        scripts_(scripts) {}
 
   void VisitObject(RawObject* obj) {
     if (obj->IsScript()) {
@@ -1512,16 +1535,15 @@
   }
   switch (class_id) {
 #define SNAPSHOT_WRITE(clazz)                                                  \
-    case clazz::kClassId: {                                                    \
-      Raw##clazz* raw_obj = reinterpret_cast<Raw##clazz*>(raw);                \
-          raw_obj->WriteTo(this, object_id, kind_, as_reference);              \
-      return;                                                                  \
-    }                                                                          \
+  case clazz::kClassId: {                                                      \
+    Raw##clazz* raw_obj = reinterpret_cast<Raw##clazz*>(raw);                  \
+    raw_obj->WriteTo(this, object_id, kind_, as_reference);                    \
+    return;                                                                    \
+  }
 
     CLASS_LIST_NO_OBJECT(SNAPSHOT_WRITE)
 #undef SNAPSHOT_WRITE
-#define SNAPSHOT_WRITE(clazz)                                                  \
-    case kTypedData##clazz##Cid:                                               \
+#define SNAPSHOT_WRITE(clazz) case kTypedData##clazz##Cid:
 
     CLASS_LIST_TYPED_DATA(SNAPSHOT_WRITE) {
       RawTypedData* raw_obj = reinterpret_cast<RawTypedData*>(raw);
@@ -1529,17 +1551,17 @@
       return;
     }
 #undef SNAPSHOT_WRITE
-#define SNAPSHOT_WRITE(clazz)                                                  \
-    case kExternalTypedData##clazz##Cid:                                       \
+#define SNAPSHOT_WRITE(clazz) case kExternalTypedData##clazz##Cid:
 
     CLASS_LIST_TYPED_DATA(SNAPSHOT_WRITE) {
       RawExternalTypedData* raw_obj =
-        reinterpret_cast<RawExternalTypedData*>(raw);
+          reinterpret_cast<RawExternalTypedData*>(raw);
       raw_obj->WriteTo(this, object_id, kind_, as_reference);
       return;
     }
 #undef SNAPSHOT_WRITE
-    default: break;
+    default:
+      break;
   }
 
   const Object& obj = Object::Handle(raw);
@@ -1571,18 +1593,17 @@
 
 
 void ForwardList::SerializeAll(ObjectVisitor* writer) {
-  // Write out all objects that were added to the forward list and have
-  // not been serialized yet. These would typically be fields of instance
-  // objects, arrays or immutable arrays (this is done in order to avoid
-  // deep recursive calls to WriteObjectImpl).
-  // NOTE: The forward list might grow as we process the list.
+// Write out all objects that were added to the forward list and have
+// not been serialized yet. These would typically be fields of instance
+// objects, arrays or immutable arrays (this is done in order to avoid
+// deep recursive calls to WriteObjectImpl).
+// NOTE: The forward list might grow as we process the list.
 #ifdef DEBUG
   for (intptr_t i = first_object_id(); i < first_unprocessed_object_id_; ++i) {
     ASSERT(NodeForObjectId(i)->is_serialized());
   }
 #endif  // DEBUG
-  for (intptr_t id = first_unprocessed_object_id_;
-       id < next_object_id();
+  for (intptr_t id = first_unprocessed_object_id_; id < next_object_id();
        ++id) {
     if (!NodeForObjectId(id)->is_serialized()) {
       // Write the object out in the stream.
@@ -1612,10 +1633,11 @@
 
 void SnapshotWriter::WriteFunctionId(RawFunction* func, bool owner_is_class) {
   ASSERT(kind_ == Snapshot::kScript);
-  RawClass* cls = (owner_is_class) ?
-      reinterpret_cast<RawClass*>(func->ptr()->owner_) :
-      reinterpret_cast<RawPatchClass*>(
-          func->ptr()->owner_)->ptr()->patched_class_;
+  RawClass* cls = (owner_is_class)
+                      ? reinterpret_cast<RawClass*>(func->ptr()->owner_)
+                      : reinterpret_cast<RawPatchClass*>(func->ptr()->owner_)
+                            ->ptr()
+                            ->patched_class_;
 
   // Write out the library url and class name.
   RawLibrary* library = cls->ptr()->library_;
@@ -1709,7 +1731,8 @@
   ASSERT(!errorFunc.IsNull());
 
   // All other closures are errors.
-  char* chars = OS::SCreate(thread()->zone(),
+  char* chars = OS::SCreate(
+      thread()->zone(),
       "Illegal argument in isolate message : (object is a closure - %s)",
       errorFunc.ToCString());
   SetWriteException(Exceptions::kArgument, chars);
@@ -1735,9 +1758,9 @@
     HANDLESCOPE(thread());
     const Class& clazz = Class::Handle(zone(), cls);
     char* chars = OS::SCreate(thread()->zone(),
-        "Illegal argument in isolate message"
-        " : (object extends NativeWrapper - %s)",
-        clazz.ToCString());
+                              "Illegal argument in isolate message"
+                              " : (object extends NativeWrapper - %s)",
+                              clazz.ToCString());
     SetWriteException(Exceptions::kArgument, chars);
   }
 }
@@ -1748,8 +1771,7 @@
   set_exception_type(type);
   set_exception_msg(msg);
   // The more specific error is set up in SnapshotWriter::ThrowException().
-  thread()->long_jump_base()->
-      Jump(1, Object::snapshot_writer_error());
+  thread()->long_jump_base()->Jump(1, Object::snapshot_writer_error());
 }
 
 
@@ -1776,8 +1798,8 @@
     // Write out the class information for this object.
     WriteObjectImpl(cls, kAsInlinedObject);
   } else {
-    intptr_t next_field_offset =
-        cls->ptr()->next_field_offset_in_words_ << kWordSizeLog2;
+    intptr_t next_field_offset = cls->ptr()->next_field_offset_in_words_
+                                 << kWordSizeLog2;
     ASSERT(next_field_offset > 0);
 
     // Write out the serialization header value for this object.
@@ -1856,8 +1878,7 @@
 }
 
 
-ScriptSnapshotWriter::ScriptSnapshotWriter(uint8_t** buffer,
-                                           ReAlloc alloc)
+ScriptSnapshotWriter::ScriptSnapshotWriter(uint8_t** buffer, ReAlloc alloc)
     : SnapshotWriter(Thread::Current(),
                      Snapshot::kScript,
                      buffer,
diff --git a/runtime/vm/snapshot.h b/runtime/vm/snapshot.h
index 3f767b8..7bc946f 100644
--- a/runtime/vm/snapshot.h
+++ b/runtime/vm/snapshot.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_SNAPSHOT_H_
-#define VM_SNAPSHOT_H_
+#ifndef RUNTIME_VM_SNAPSHOT_H_
+#define RUNTIME_VM_SNAPSHOT_H_
 
 #include "platform/assert.h"
 #include "vm/allocation.h"
@@ -109,7 +109,7 @@
 // - Object that is seen for the first time (inlined in the stream):
 //   (a unique id for this object | 0x1)
 enum SerializedHeaderType {
-  kInlined  = 0x1,
+  kInlined = 0x1,
   kObjectId = 0x3,
 };
 static const int8_t kHeaderTagBits = 2;
@@ -120,12 +120,13 @@
 static const intptr_t kInvalidPatchIndex = -1;
 
 
-class SerializedHeaderTag :
-    public BitField<intptr_t, enum SerializedHeaderType, 0, kHeaderTagBits> {};
+class SerializedHeaderTag
+    : public BitField<intptr_t, enum SerializedHeaderType, 0, kHeaderTagBits> {
+};
 
 
-class SerializedHeaderData :
-    public BitField<intptr_t, intptr_t, kHeaderTagBits, kObjectIdBits> {};
+class SerializedHeaderData
+    : public BitField<intptr_t, intptr_t, kHeaderTagBits, kObjectIdBits> {};
 
 
 enum DeserializeState {
@@ -164,6 +165,7 @@
     kNone,        // dart_bootstrap/gen_snapshot
     kInvalid
   };
+  static const char* KindToCString(Kind kind);
 
   static const int kHeaderSize = 2 * sizeof(int64_t);
   static const int kLengthIndex = 0;
@@ -192,9 +194,7 @@
   static intptr_t length_offset() {
     return OFFSET_OF(Snapshot, unaligned_length_);
   }
-  static intptr_t kind_offset() {
-    return OFFSET_OF(Snapshot, unaligned_kind_);
-  }
+  static intptr_t kind_offset() { return OFFSET_OF(Snapshot, unaligned_kind_); }
 
  private:
   // Prevent Snapshot from ever being allocated directly.
@@ -202,7 +202,7 @@
 
   // The following fields are potentially unaligned.
   int64_t unaligned_length_;  // Stream length.
-  int64_t unaligned_kind_;  // Kind of snapshot.
+  int64_t unaligned_kind_;    // Kind of snapshot.
 
   // Variable length data follows here.
 
@@ -213,13 +213,13 @@
 class InstructionsSnapshot : ValueObject {
  public:
   explicit InstructionsSnapshot(const void* raw_memory)
-    : raw_memory_(raw_memory) {
+      : raw_memory_(raw_memory) {
     ASSERT(Utils::IsAligned(raw_memory, OS::kMaxPreferredCodeAlignment));
   }
 
   void* instructions_start() {
-    return reinterpret_cast<void*>(
-        reinterpret_cast<uword>(raw_memory_) + kHeaderSize);
+    return reinterpret_cast<void*>(reinterpret_cast<uword>(raw_memory_) +
+                                   kHeaderSize);
   }
 
   uword instructions_size() {
@@ -238,14 +238,13 @@
 
 class DataSnapshot : ValueObject {
  public:
-  explicit DataSnapshot(const void* raw_memory)
-    : raw_memory_(raw_memory) {
+  explicit DataSnapshot(const void* raw_memory) : raw_memory_(raw_memory) {
     ASSERT(Utils::IsAligned(raw_memory, 2 * kWordSize));  // kObjectAlignment
   }
 
   void* data_start() {
-    return reinterpret_cast<void*>(
-        reinterpret_cast<uword>(raw_memory_) + kHeaderSize);
+    return reinterpret_cast<void*>(reinterpret_cast<uword>(raw_memory_) +
+                                   kHeaderSize);
   }
 
   uword data_size() {
@@ -285,9 +284,7 @@
   }
   COMPILE_ASSERT(sizeof(uint32_t) >= sizeof(classid_t));
 
-  void ReadBytes(uint8_t* addr, intptr_t len) {
-    stream_.ReadBytes(addr, len);
-  }
+  void ReadBytes(uint8_t* addr, intptr_t len) { stream_.ReadBytes(addr, len); }
 
   double ReadDouble() {
     double result;
@@ -304,13 +301,9 @@
     return stream_.AddressOfCurrentPosition();
   }
 
-  void Advance(intptr_t value) {
-    stream_.Advance(value);
-  }
+  void Advance(intptr_t value) { stream_.Advance(value); }
 
-  intptr_t PendingBytes() const {
-    return stream_.PendingBytes();
-  }
+  intptr_t PendingBytes() const { return stream_.PendingBytes(); }
 
   RawSmi* ReadAsSmi();
   intptr_t ReadSmiValue();
@@ -374,8 +367,7 @@
  public:
   InstructionsReader(const uint8_t* instructions_buffer,
                      const uint8_t* data_buffer)
-    : instructions_buffer_(instructions_buffer),
-      data_buffer_(data_buffer) {
+      : instructions_buffer_(instructions_buffer), data_buffer_(data_buffer) {
     ASSERT(instructions_buffer != NULL);
     ASSERT(data_buffer != NULL);
     ASSERT(Utils::IsAligned(reinterpret_cast<uword>(instructions_buffer),
@@ -441,7 +433,7 @@
                  Snapshot::Kind kind,
                  ZoneGrowableArray<BackRefNode>* backward_references,
                  Thread* thread);
-  ~SnapshotReader() { }
+  ~SnapshotReader() {}
 
   ZoneGrowableArray<BackRefNode>* GetBackwardReferenceTable() const {
     return backward_references_;
@@ -464,9 +456,7 @@
                             intptr_t patch_offset);
 
   // Read a Dart Instance object.
-  RawObject* ReadInstance(intptr_t object_id,
-                          intptr_t tags,
-                          bool as_reference);
+  RawObject* ReadInstance(intptr_t object_id, intptr_t tags, bool as_reference);
 
   // Read a VM isolate object that was serialized as an Id.
   RawObject* ReadVMIsolateObject(intptr_t object_id);
@@ -502,26 +492,26 @@
 
   bool is_vm_isolate() const;
 
-  Snapshot::Kind kind_;  // Indicates type of snapshot(full, script, message).
-  Thread* thread_;  // Current thread.
-  Zone* zone_;  // Zone for allocations while reading snapshot.
-  Heap* heap_;  // Heap of the current isolate.
+  Snapshot::Kind kind_;   // Indicates type of snapshot(full, script, message).
+  Thread* thread_;        // Current thread.
+  Zone* zone_;            // Zone for allocations while reading snapshot.
+  Heap* heap_;            // Heap of the current isolate.
   PageSpace* old_space_;  // Old space of the current isolate.
-  Class& cls_;  // Temporary Class handle.
-  Object& obj_;  // Temporary Object handle.
-  PassiveObject& pobj_;  // Temporary PassiveObject handle.
-  Array& array_;  // Temporary Array handle.
-  Field& field_;  // Temporary Field handle.
-  String& str_;  // Temporary String handle.
-  Library& library_;  // Temporary library handle.
-  AbstractType& type_;  // Temporary type handle.
+  Class& cls_;            // Temporary Class handle.
+  Object& obj_;           // Temporary Object handle.
+  PassiveObject& pobj_;   // Temporary PassiveObject handle.
+  Array& array_;          // Temporary Array handle.
+  Field& field_;          // Temporary Field handle.
+  String& str_;           // Temporary String handle.
+  Library& library_;      // Temporary library handle.
+  AbstractType& type_;    // Temporary type handle.
   TypeArguments& type_arguments_;  // Temporary type argument handle.
-  GrowableObjectArray& tokens_;  // Temporary tokens handle.
-  TokenStream& stream_;  // Temporary token stream handle.
-  ExternalTypedData& data_;  // Temporary stream data handle.
-  TypedData& typed_data_;  // Temporary typed data handle.
-  Function& function_;  // Temporary function handle.
-  UnhandledException& error_;  // Error handle.
+  GrowableObjectArray& tokens_;    // Temporary tokens handle.
+  TokenStream& stream_;            // Temporary token stream handle.
+  ExternalTypedData& data_;        // Temporary stream data handle.
+  TypedData& typed_data_;          // Temporary typed data handle.
+  Function& function_;             // Temporary function handle.
+  UnhandledException& error_;      // Error handle.
   intptr_t max_vm_isolate_object_id_;
   ZoneGrowableArray<BackRefNode>* backward_references_;
 
@@ -567,9 +557,7 @@
 
 class ScriptSnapshotReader : public SnapshotReader {
  public:
-  ScriptSnapshotReader(const uint8_t* buffer,
-                       intptr_t size,
-                       Thread* thread);
+  ScriptSnapshotReader(const uint8_t* buffer, intptr_t size, Thread* thread);
   ~ScriptSnapshotReader();
 
  private:
@@ -579,9 +567,7 @@
 
 class MessageSnapshotReader : public SnapshotReader {
  public:
-  MessageSnapshotReader(const uint8_t* buffer,
-                        intptr_t size,
-                        Thread* thread);
+  MessageSnapshotReader(const uint8_t* buffer, intptr_t size, Thread* thread);
   ~MessageSnapshotReader();
 
  private:
@@ -601,13 +587,9 @@
     WriteStream::Raw<sizeof(T), T>::Write(&stream_, value);
   }
 
-  void WriteRawPointerValue(intptr_t value) {
-    Write<int64_t>(value);
-  }
+  void WriteRawPointerValue(intptr_t value) { Write<int64_t>(value); }
 
-  void WriteClassIDValue(classid_t value) {
-    Write<uint32_t>(value);
-  }
+  void WriteClassIDValue(classid_t value) { Write<uint32_t>(value); }
   COMPILE_ASSERT(sizeof(uint32_t) >= sizeof(classid_t));
 
   // Write an object that is serialized as an Id (singleton in object store,
@@ -653,15 +635,12 @@
   }
 
  protected:
-  BaseWriter(uint8_t** buffer,
-             ReAlloc alloc,
-             intptr_t initial_size)
-      : StackResource(Thread::Current()),
-        stream_(buffer, alloc, initial_size) {
+  BaseWriter(uint8_t** buffer, ReAlloc alloc, intptr_t initial_size)
+      : StackResource(Thread::Current()), stream_(buffer, alloc, initial_size) {
     ASSERT(buffer != NULL);
     ASSERT(alloc != NULL);
   }
-  ~BaseWriter() { }
+  ~BaseWriter() {}
 
   void ReserveHeader() {
     // Make room for recording snapshot buffer size.
@@ -739,18 +718,20 @@
 class InstructionsWriter : public ZoneAllocated {
  public:
   InstructionsWriter()
-    : next_offset_(InstructionsSnapshot::kHeaderSize),
-      next_object_offset_(DataSnapshot::kHeaderSize),
-      instructions_(),
-      objects_() {
-  }
-  virtual ~InstructionsWriter() { }
+      : next_offset_(InstructionsSnapshot::kHeaderSize),
+        next_object_offset_(DataSnapshot::kHeaderSize),
+        instructions_(),
+        objects_() {}
+  virtual ~InstructionsWriter() {}
 
   int32_t GetOffsetFor(RawInstructions* instructions, RawCode* code);
 
   int32_t GetObjectOffsetFor(RawObject* raw_object);
 
-  virtual void Write() = 0;
+  virtual void Write(uint8_t* vmisolate_buffer,
+                     intptr_t vmisolate_length,
+                     uint8_t* isolate_buffer,
+                     intptr_t isolate_length) = 0;
   virtual intptr_t text_size() = 0;
   virtual intptr_t data_size() = 0;
 
@@ -759,7 +740,7 @@
     explicit InstructionsData(RawInstructions* insns,
                               RawCode* code,
                               intptr_t offset)
-        : raw_insns_(insns), raw_code_(code), offset_(offset) { }
+        : raw_insns_(insns), raw_code_(code), offset_(offset) {}
 
     union {
       RawInstructions* raw_insns_;
@@ -773,8 +754,7 @@
   };
 
   struct ObjectData {
-    explicit ObjectData(RawObject* raw_obj)
-        : raw_obj_(raw_obj) { }
+    explicit ObjectData(RawObject* raw_obj) : raw_obj_(raw_obj) {}
 
     union {
       RawObject* raw_obj_;
@@ -797,13 +777,15 @@
   AssemblyInstructionsWriter(uint8_t** assembly_buffer,
                              ReAlloc alloc,
                              intptr_t initial_size)
-    : InstructionsWriter(),
-      assembly_stream_(assembly_buffer, alloc, initial_size),
-      text_size_(0),
-      data_size_(0) {
-  }
+      : InstructionsWriter(),
+        assembly_stream_(assembly_buffer, alloc, initial_size),
+        text_size_(0),
+        data_size_(0) {}
 
-  virtual void Write();
+  virtual void Write(uint8_t* vmisolate_buffer,
+                     intptr_t vmisolate_length,
+                     uint8_t* isolate_buffer,
+                     intptr_t isolate_length);
   virtual intptr_t text_size() { return text_size_; }
   virtual intptr_t data_size() { return data_size_; }
 
@@ -811,7 +793,7 @@
 
  private:
   void WriteWordLiteralText(uword value) {
-    // Padding is helpful for comparing the .S with --disassemble.
+// Padding is helpful for comparing the .S with --disassemble.
 #if defined(ARCH_IS_64_BIT)
     assembly_stream_.Print(".quad 0x%0.16" Px "\n", value);
 #else
@@ -821,7 +803,7 @@
   }
 
   void WriteWordLiteralData(uword value) {
-    // Padding is helpful for comparing the .S with --disassemble.
+// Padding is helpful for comparing the .S with --disassemble.
 #if defined(ARCH_IS_64_BIT)
     assembly_stream_.Print(".quad 0x%0.16" Px "\n", value);
 #else
@@ -844,12 +826,16 @@
                          uint8_t** rodata_blob_buffer,
                          ReAlloc alloc,
                          intptr_t initial_size)
-    : InstructionsWriter(),
-      instructions_blob_stream_(instructions_blob_buffer, alloc, initial_size),
-      rodata_blob_stream_(rodata_blob_buffer, alloc, initial_size) {
-  }
+      : InstructionsWriter(),
+        instructions_blob_stream_(instructions_blob_buffer,
+                                  alloc,
+                                  initial_size),
+        rodata_blob_stream_(rodata_blob_buffer, alloc, initial_size) {}
 
-  virtual void Write();
+  virtual void Write(uint8_t* vmisolate_buffer,
+                     intptr_t vmisolate_length,
+                     uint8_t* isolate_buffer,
+                     intptr_t isolate_length);
   virtual intptr_t text_size() { return InstructionsBlobSize(); }
   virtual intptr_t data_size() { return RodataBlobSize(); }
 
@@ -891,16 +877,12 @@
 
   uword GetObjectTags(RawObject* raw);
 
-  Exceptions::ExceptionType exception_type() const {
-    return exception_type_;
-  }
+  Exceptions::ExceptionType exception_type() const { return exception_type_; }
   void set_exception_type(Exceptions::ExceptionType type) {
     exception_type_ = type;
   }
   const char* exception_msg() const { return exception_msg_; }
-  void set_exception_msg(const char* msg) {
-    exception_msg_ = msg;
-  }
+  void set_exception_msg(const char* msg) { exception_msg_ = msg; }
   bool can_send_any_object() const { return can_send_any_object_; }
   void ThrowException(Exceptions::ExceptionType type, const char* msg);
 
@@ -954,7 +936,7 @@
   ForwardList* forward_list_;
   Exceptions::ExceptionType exception_type_;  // Exception type.
   const char* exception_msg_;  // Message associated with exception.
-  bool can_send_any_object_;  // True if any Dart instance can be sent.
+  bool can_send_any_object_;   // True if any Dart instance can be sent.
 
   friend class RawArray;
   friend class RawClass;
@@ -993,7 +975,7 @@
  public:
   static const intptr_t kInitialSize = 64 * KB;
   ScriptSnapshotWriter(uint8_t** buffer, ReAlloc alloc);
-  ~ScriptSnapshotWriter() { }
+  ~ScriptSnapshotWriter() {}
 
   // Writes a partial snapshot of the script.
   void WriteScriptSnapshot(const Library& lib);
@@ -1009,7 +991,7 @@
  public:
   static const intptr_t kInitialSize = 512;
   MessageWriter(uint8_t** buffer, ReAlloc alloc, bool can_send_any_object);
-  ~MessageWriter() { }
+  ~MessageWriter() {}
 
   void WriteMessage(const Object& obj);
 
@@ -1040,4 +1022,4 @@
 
 }  // namespace dart
 
-#endif  // VM_SNAPSHOT_H_
+#endif  // RUNTIME_VM_SNAPSHOT_H_
diff --git a/runtime/vm/snapshot_ids.h b/runtime/vm/snapshot_ids.h
index 436b2a8..1e01b28 100644
--- a/runtime/vm/snapshot_ids.h
+++ b/runtime/vm/snapshot_ids.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_SNAPSHOT_IDS_H_
-#define VM_SNAPSHOT_IDS_H_
+#ifndef RUNTIME_VM_SNAPSHOT_IDS_H_
+#define RUNTIME_VM_SNAPSHOT_IDS_H_
 
 #include "vm/raw_object.h"
 #include "vm/dart_entry.h"
@@ -53,10 +53,11 @@
   kEmptyExceptionHandlers,
   kCachedArgumentsDescriptor0,
   kCachedArgumentsDescriptorN = (kCachedArgumentsDescriptor0 +
-      ArgumentsDescriptor::kCachedDescriptorCount - 1),
+                                 ArgumentsDescriptor::kCachedDescriptorCount -
+                                 1),
   kCachedICDataArray0,
-  kCachedICDataArrayN = (kCachedICDataArray0 +
-      ICData::kCachedICDataArrayCount - 1),
+  kCachedICDataArrayN =
+      (kCachedICDataArray0 + ICData::kCachedICDataArrayCount - 1),
 
   kInstanceObjectId,
   kStaticImplicitClosureObjectId,
@@ -66,4 +67,4 @@
 
 }  // namespace dart
 
-#endif  // VM_SNAPSHOT_IDS_H_
+#endif  // RUNTIME_VM_SNAPSHOT_IDS_H_
diff --git a/runtime/vm/snapshot_test.cc b/runtime/vm/snapshot_test.cc
index adc8e1f..81c4342 100644
--- a/runtime/vm/snapshot_test.cc
+++ b/runtime/vm/snapshot_test.cc
@@ -50,14 +50,16 @@
 }
 
 
-static uint8_t* malloc_allocator(
-    uint8_t* ptr, intptr_t old_size, intptr_t new_size) {
+static uint8_t* malloc_allocator(uint8_t* ptr,
+                                 intptr_t old_size,
+                                 intptr_t new_size) {
   return reinterpret_cast<uint8_t*>(realloc(ptr, new_size));
 }
 
 
-static uint8_t* zone_allocator(
-    uint8_t* ptr, intptr_t old_size, intptr_t new_size) {
+static uint8_t* zone_allocator(uint8_t* ptr,
+                               intptr_t old_size,
+                               intptr_t new_size) {
   Zone* zone = Thread::Current()->zone();
   return zone->Realloc<uint8_t>(ptr, old_size, new_size);
 }
@@ -258,10 +260,10 @@
   Mint& mint = Mint::Handle();
   mint ^= Integer::New(value);
   Dart_CObject* mint_cobject = SerializeAndDeserializeMint(mint);
-  // On 64-bit platforms mints always require 64-bits as the smi range
-  // here covers most of the 64-bit range. On 32-bit platforms the smi
-  // range covers most of the 32-bit range and values outside that
-  // range are also represented as mints.
+// On 64-bit platforms mints always require 64-bits as the smi range
+// here covers most of the 64-bit range. On 32-bit platforms the smi
+// range covers most of the 32-bit range and values outside that
+// range are also represented as mints.
 #if defined(ARCH_IS_64_BIT)
   EXPECT_EQ(Dart_CObject_kInt64, mint_cobject->type);
   EXPECT_EQ(value, mint_cobject->value.as_int64);
@@ -377,11 +379,6 @@
 }
 
 
-static uword allocator(intptr_t size) {
-  return reinterpret_cast<uword>(malloc(size));
-}
-
-
 TEST_CASE(SerializeCapability) {
   // Write snapshot with object content.
   const Capability& capability = Capability::Handle(Capability::New(12345));
@@ -425,7 +422,8 @@
   Bigint& obj = Bigint::Handle();
   obj ^= reader.ReadObject();
 
-  EXPECT_STREQ(bigint.ToHexCString(allocator), obj.ToHexCString(allocator));
+  Zone* zone = Thread::Current()->zone();
+  EXPECT_STREQ(bigint.ToHexCString(zone), obj.ToHexCString(zone));
 
   // Read object back from the snapshot into a C structure.
   ApiNativeScope scope;
@@ -455,11 +453,9 @@
     MessageSnapshotReader reader(buffer, buffer_len, thread);
     Bigint& serialized_bigint = Bigint::Handle();
     serialized_bigint ^= reader.ReadObject();
-    const char* str1 = bigint.ToHexCString(allocator);
-    const char* str2 = serialized_bigint.ToHexCString(allocator);
+    const char* str1 = bigint.ToHexCString(thread->zone());
+    const char* str2 = serialized_bigint.ToHexCString(thread->zone());
     EXPECT_STREQ(str1, str2);
-    free(const_cast<char*>(str1));
-    free(const_cast<char*>(str2));
   }
 
   // Read object back from the snapshot into a C structure.
@@ -563,12 +559,13 @@
 TEST_CASE(SerializeString) {
   TestString("This string shall be serialized");
   TestString("æøå");  // This file is UTF-8 encoded.
-  const char* data = "\x01"
-                     "\x7F"
-                     "\xC2\x80"       // U+0080
-                     "\xDF\xBF"       // U+07FF
-                     "\xE0\xA0\x80"   // U+0800
-                     "\xEF\xBF\xBF";  // U+FFFF
+  const char* data =
+      "\x01"
+      "\x7F"
+      "\xC2\x80"       // U+0080
+      "\xDF\xBF"       // U+07FF
+      "\xE0\xA0\x80"   // U+0800
+      "\xEF\xBF\xBF";  // U+FFFF
 
   TestString(data);
   // TODO(sgjesse): Add tests with non-BMP characters.
@@ -622,7 +619,7 @@
 TEST_CASE(FailSerializeLargeNestedArray) {
   Dart_CObject parent;
   Dart_CObject child;
-  Dart_CObject* values[1] = { &child };
+  Dart_CObject* values[1] = {&child};
 
   parent.type = Dart_CObject_kArray;
   parent.value.as_array.length = 1;
@@ -739,7 +736,7 @@
     serialized_array ^= reader.ReadObject();                                   \
     for (int i = 0; i < kArrayLength; i++) {                                   \
       EXPECT_EQ(static_cast<ctype>(i),                                         \
-                serialized_array.Get##darttype(i*scale));                      \
+                serialized_array.Get##darttype(i* scale));                     \
     }                                                                          \
   }
 
@@ -747,7 +744,7 @@
 #define TEST_EXTERNAL_TYPED_ARRAY(darttype, ctype)                             \
   {                                                                            \
     StackZone zone(thread);                                                    \
-    ctype data[] = { 0, 11, 22, 33, 44, 55, 66, 77 };                          \
+    ctype data[] = {0, 11, 22, 33, 44, 55, 66, 77};                            \
     intptr_t length = ARRAY_SIZE(data);                                        \
     ExternalTypedData& array = ExternalTypedData::Handle(                      \
         ExternalTypedData::New(kExternalTypedData##darttype##ArrayCid,         \
@@ -762,7 +759,7 @@
     serialized_array ^= reader.ReadObject();                                   \
     for (int i = 0; i < length; i++) {                                         \
       EXPECT_EQ(static_cast<ctype>(data[i]),                                   \
-                serialized_array.Get##darttype(i*scale));                      \
+                serialized_array.Get##darttype(i* scale));                     \
     }                                                                          \
   }
 
@@ -838,12 +835,10 @@
     ASSERT(buffer != NULL);
     ASSERT(alloc != NULL);
   }
-  ~TestSnapshotWriter() { }
+  ~TestSnapshotWriter() {}
 
   // Writes just a script object
-  void WriteScript(const Script& script) {
-    WriteObject(script.raw());
-  }
+  void WriteScript(const Script& script) { WriteObject(script.raw()); }
 
  private:
   ForwardList forward_list_;
@@ -859,23 +854,17 @@
   Zone* zone = Thread::Current()->zone();
   const TokenStream& expected_tokens =
       TokenStream::Handle(zone, script.tokens());
-  TokenStream::Iterator expected_iterator(
-      zone,
-      expected_tokens,
-      TokenPosition::kMinSource,
-      TokenStream::Iterator::kAllTokens);
+  TokenStream::Iterator expected_iterator(zone, expected_tokens,
+                                          TokenPosition::kMinSource,
+                                          TokenStream::Iterator::kAllTokens);
   const String& str = String::Handle(zone, expected_tokens.GenerateSource());
   const String& private_key =
       String::Handle(zone, expected_tokens.PrivateKey());
   const TokenStream& reconstructed_tokens =
-      TokenStream::Handle(zone, TokenStream::New(str,
-                                                 private_key,
-                                                 false));
+      TokenStream::Handle(zone, TokenStream::New(str, private_key, false));
   expected_iterator.SetCurrentPosition(TokenPosition::kMinSource);
   TokenStream::Iterator reconstructed_iterator(
-      zone,
-      reconstructed_tokens,
-      TokenPosition::kMinSource,
+      zone, reconstructed_tokens, TokenPosition::kMinSource,
       TokenStream::Iterator::kAllTokens);
   Token::Kind expected_kind = expected_iterator.CurrentTokenKind();
   Token::Kind reconstructed_kind = reconstructed_iterator.CurrentTokenKind();
@@ -941,9 +930,8 @@
   Zone* zone = thread->zone();
   String& url = String::Handle(zone, String::New("dart-test:SerializeScript"));
   String& source = String::Handle(zone, String::New(kScriptChars));
-  Script& script = Script::Handle(zone, Script::New(url,
-                                                    source,
-                                                    RawScript::kScriptTag));
+  Script& script =
+      Script::Handle(zone, Script::New(url, source, RawScript::kScriptTag));
   const String& lib_url = String::Handle(zone, Symbols::New(thread, "TestLib"));
   Library& lib = Library::Handle(zone, Library::New(lib_url));
   lib.Register(thread);
@@ -975,11 +963,9 @@
   const ExternalTypedData& serialized_data =
       ExternalTypedData::Handle(zone, serialized_tokens.GetStream());
   EXPECT_EQ(expected_data.Length(), serialized_data.Length());
-  TokenStream::Iterator expected_iterator(zone,
-                                          expected_tokens,
+  TokenStream::Iterator expected_iterator(zone, expected_tokens,
                                           TokenPosition::kMinSource);
-  TokenStream::Iterator serialized_iterator(zone,
-                                            serialized_tokens,
+  TokenStream::Iterator serialized_iterator(zone, serialized_tokens,
                                             TokenPosition::kMinSource);
   Token::Kind expected_kind = expected_iterator.CurrentTokenKind();
   Token::Kind serialized_kind = serialized_iterator.CurrentTokenKind();
@@ -1040,10 +1026,8 @@
     Dart_EnterScope();  // Start a Dart API scope for invoking API functions.
 
     // Write out the script snapshot.
-    result = Dart_CreateSnapshot(NULL,
-                                 &vm_isolate_snapshot_size,
-                                 &isolate_snapshot,
-                                 &isolate_snapshot_size);
+    result = Dart_CreateSnapshot(NULL, &vm_isolate_snapshot_size,
+                                 &isolate_snapshot, &isolate_snapshot_size);
     EXPECT_VALID(result);
     full_snapshot = reinterpret_cast<uint8_t*>(malloc(isolate_snapshot_size));
     memmove(full_snapshot, isolate_snapshot, isolate_snapshot_size);
@@ -1128,8 +1112,8 @@
 VM_TEST_CASE(GenerateSource) {
   Zone* zone = thread->zone();
   Isolate* isolate = thread->isolate();
-  const GrowableObjectArray& libs = GrowableObjectArray::Handle(
-      zone, isolate->object_store()->libraries());
+  const GrowableObjectArray& libs =
+      GrowableObjectArray::Handle(zone, isolate->object_store()->libraries());
   Library& lib = Library::Handle();
   String& uri = String::Handle();
   for (intptr_t i = 0; i < libs.Length(); i++) {
@@ -1188,9 +1172,7 @@
 
     // Write snapshot with object content.
     {
-      FullSnapshotWriter writer(Snapshot::kCore,
-                                NULL,
-                                &isolate_snapshot_buffer,
+      FullSnapshotWriter writer(Snapshot::kCore, NULL, &isolate_snapshot_buffer,
                                 &malloc_allocator,
                                 NULL /* instructions_writer */);
       writer.WriteFullSnapshot();
@@ -1208,8 +1190,7 @@
     OS::PrintErr("From Snapshot: %" Pd64 "us\n", timer2.TotalElapsedTime());
 
     // Invoke a function which returns an object.
-    Dart_Handle cls =
-        Dart_GetClass(TestCase::lib(), NewString("FieldsTest"));
+    Dart_Handle cls = Dart_GetClass(TestCase::lib(), NewString("FieldsTest"));
     result = Dart_Invoke(cls, NewString("testMain"), 0, NULL);
     EXPECT_VALID(result);
     Dart_ExitScope();
@@ -1248,9 +1229,7 @@
 
     // Write snapshot with object content.
     {
-      FullSnapshotWriter writer(Snapshot::kCore,
-                                NULL,
-                                &isolate_snapshot_buffer,
+      FullSnapshotWriter writer(Snapshot::kCore, NULL, &isolate_snapshot_buffer,
                                 &malloc_allocator,
                                 NULL /* instructions_writer */);
       writer.WriteFullSnapshot();
@@ -1273,8 +1252,7 @@
     OS::PrintErr("From Snapshot: %" Pd64 "us\n", timer2.TotalElapsedTime());
 
     // Invoke a function which returns an object.
-    Dart_Handle cls = Dart_GetClass(TestCase::lib(),
-                                    NewString("FieldsTest"));
+    Dart_Handle cls = Dart_GetClass(TestCase::lib(), NewString("FieldsTest"));
     Dart_Handle result = Dart_Invoke(cls, NewString("testMain"), 0, NULL);
     if (Dart_IsError(result)) {
       // Print the error.  It is probably an unhandled exception.
@@ -1353,10 +1331,8 @@
     Dart_EnterScope();  // Start a Dart API scope for invoking API functions.
 
     // Write out the script snapshot.
-    result = Dart_CreateSnapshot(NULL,
-                                 &vm_isolate_snapshot_size,
-                                 &isolate_snapshot,
-                                 &isolate_snapshot_size);
+    result = Dart_CreateSnapshot(NULL, &vm_isolate_snapshot_size,
+                                 &isolate_snapshot, &isolate_snapshot_size);
     EXPECT_VALID(result);
     full_snapshot = reinterpret_cast<uint8_t*>(malloc(isolate_snapshot_size));
     memmove(full_snapshot, isolate_snapshot, isolate_snapshot_size);
@@ -1372,18 +1348,16 @@
     Dart_EnterScope();  // Start a Dart API scope for invoking API functions.
 
     // Load the library.
-    Dart_Handle import_lib = Dart_LoadLibrary(NewString("dart_import_lib"),
-                                              Dart_Null(),
-                                              NewString(kLibScriptChars),
-                                              0, 0);
+    Dart_Handle import_lib =
+        Dart_LoadLibrary(NewString("dart_import_lib"), Dart_Null(),
+                         NewString(kLibScriptChars), 0, 0);
     EXPECT_VALID(import_lib);
 
     // Create a test library and Load up a test script in it.
     TestCase::LoadTestScript(kScriptChars, NULL);
 
-    EXPECT_VALID(Dart_LibraryImportLibrary(TestCase::lib(),
-                                           import_lib,
-                                           Dart_Null()));
+    EXPECT_VALID(
+        Dart_LibraryImportLibrary(TestCase::lib(), import_lib, Dart_Null()));
     EXPECT_VALID(Api::CheckAndFinalizePendingClasses(Thread::Current()));
 
     // Get list of library URLs loaded and save the count.
@@ -1435,10 +1409,8 @@
     Dart_EnterScope();  // Start a Dart API scope for invoking API functions.
 
     // Load the library.
-    Dart_Handle lib = Dart_LoadLibrary(NewString("dart_lib"),
-                                       Dart_Null(),
-                                       NewString(kScriptChars),
-                                       0, 0);
+    Dart_Handle lib = Dart_LoadLibrary(NewString("dart_lib"), Dart_Null(),
+                                       NewString(kScriptChars), 0, 0);
     EXPECT_VALID(lib);
 
     // Write out the script snapshot.
@@ -1475,10 +1447,10 @@
 
 UNIT_TEST_CASE(ScriptSnapshot1) {
   const char* kScriptChars =
-    "class _SimpleNumEnumerable<T extends num> {"
+      "class _SimpleNumEnumerable<T extends num> {"
       "final Iterable<T> _source;"
       "const _SimpleNumEnumerable(this._source) : super();"
-    "}";
+      "}";
 
   Dart_Handle result;
   uint8_t* buffer;
@@ -1499,10 +1471,8 @@
     Dart_EnterScope();  // Start a Dart API scope for invoking API functions.
 
     // Write out the script snapshot.
-    result = Dart_CreateSnapshot(NULL,
-                                 &vm_isolate_snapshot_size,
-                                 &isolate_snapshot,
-                                 &isolate_snapshot_size);
+    result = Dart_CreateSnapshot(NULL, &vm_isolate_snapshot_size,
+                                 &isolate_snapshot, &isolate_snapshot_size);
     EXPECT_VALID(result);
     full_snapshot = reinterpret_cast<uint8_t*>(malloc(isolate_snapshot_size));
     memmove(full_snapshot, isolate_snapshot, isolate_snapshot_size);
@@ -1593,10 +1563,8 @@
     Dart_EnterScope();  // Start a Dart API scope for invoking API functions.
 
     // Write out the script snapshot.
-    result = Dart_CreateSnapshot(NULL,
-                                 &vm_isolate_snapshot_size,
-                                 &isolate_snapshot,
-                                 &isolate_snapshot_size);
+    result = Dart_CreateSnapshot(NULL, &vm_isolate_snapshot_size,
+                                 &isolate_snapshot, &isolate_snapshot_size);
     EXPECT_VALID(result);
     full_snapshot = reinterpret_cast<uint8_t*>(malloc(isolate_snapshot_size));
     memmove(full_snapshot, isolate_snapshot, isolate_snapshot_size);
@@ -1611,18 +1579,16 @@
     Dart_EnterScope();  // Start a Dart API scope for invoking API functions.
 
     // Load the library.
-    Dart_Handle import_lib = Dart_LoadLibrary(NewString("dart_import_lib"),
-                                              Dart_Null(),
-                                              NewString(kLibScriptChars),
-                                              0, 0);
+    Dart_Handle import_lib =
+        Dart_LoadLibrary(NewString("dart_import_lib"), Dart_Null(),
+                         NewString(kLibScriptChars), 0, 0);
     EXPECT_VALID(import_lib);
 
     // Create a test library and Load up a test script in it.
     TestCase::LoadTestScript(kScriptChars, NULL);
 
-    EXPECT_VALID(Dart_LibraryImportLibrary(TestCase::lib(),
-                                           import_lib,
-                                           Dart_Null()));
+    EXPECT_VALID(
+        Dart_LibraryImportLibrary(TestCase::lib(), import_lib, Dart_Null()));
     EXPECT_VALID(Api::CheckAndFinalizePendingClasses(Thread::Current()));
 
     // Write out the script snapshot.
@@ -1668,6 +1634,86 @@
 }
 
 
+UNIT_TEST_CASE(MismatchedSnapshotKinds) {
+  const char* kScriptChars = "main() { print('Hello, world!'); }";
+  Dart_Handle result;
+
+  uint8_t* buffer;
+  intptr_t size;
+  intptr_t vm_isolate_snapshot_size;
+  uint8_t* isolate_snapshot = NULL;
+  intptr_t isolate_snapshot_size;
+  uint8_t* full_snapshot = NULL;
+  uint8_t* script_snapshot = NULL;
+
+  bool saved_load_deferred_eagerly_mode = FLAG_load_deferred_eagerly;
+  FLAG_load_deferred_eagerly = true;
+  bool saved_concurrent_sweep_mode = FLAG_concurrent_sweep;
+  FLAG_concurrent_sweep = false;
+  {
+    // Start an Isolate, and create a full snapshot of it.
+    TestIsolateScope __test_isolate__;
+    Dart_EnterScope();  // Start a Dart API scope for invoking API functions.
+
+    // Write out the script snapshot.
+    result = Dart_CreateSnapshot(NULL, &vm_isolate_snapshot_size,
+                                 &isolate_snapshot, &isolate_snapshot_size);
+    EXPECT_VALID(result);
+    full_snapshot = reinterpret_cast<uint8_t*>(malloc(isolate_snapshot_size));
+    memmove(full_snapshot, isolate_snapshot, isolate_snapshot_size);
+    Dart_ExitScope();
+  }
+  FLAG_concurrent_sweep = saved_concurrent_sweep_mode;
+  FLAG_load_deferred_eagerly = saved_load_deferred_eagerly_mode;
+
+  {
+    // Create an Isolate using the full snapshot, load a script and create
+    // a script snapshot of the script.
+    TestCase::CreateTestIsolateFromSnapshot(full_snapshot);
+    Dart_EnterScope();  // Start a Dart API scope for invoking API functions.
+
+    // Create a test library and Load up a test script in it.
+    TestCase::LoadTestScript(kScriptChars, NULL);
+
+    EXPECT_VALID(Api::CheckAndFinalizePendingClasses(Thread::Current()));
+
+    // Write out the script snapshot.
+    result = Dart_CreateScriptSnapshot(&buffer, &size);
+    EXPECT_VALID(result);
+    script_snapshot = reinterpret_cast<uint8_t*>(malloc(size));
+    memmove(script_snapshot, buffer, size);
+    Dart_ExitScope();
+    Dart_ShutdownIsolate();
+  }
+
+  {
+    // Use a script snapshot where a full snapshot is expected.
+    char* error = NULL;
+    Dart_Isolate isolate = Dart_CreateIsolate(
+        "script-uri", "main", script_snapshot, NULL, NULL, &error);
+    EXPECT(isolate == NULL);
+    EXPECT(error != NULL);
+    EXPECT_SUBSTRING("got 'script', expected 'core'", error);
+  }
+
+  {
+    TestCase::CreateTestIsolateFromSnapshot(full_snapshot);
+    Dart_EnterScope();  // Start a Dart API scope for invoking API functions.
+
+    // Use a full snapshot where a script snapshot is expected.
+    Dart_Handle result = Dart_LoadScriptFromSnapshot(full_snapshot, size);
+    EXPECT_ERROR(result,
+                 "Dart_LoadScriptFromSnapshot expects parameter"
+                 " 'buffer' to be a script type snapshot.");
+
+    Dart_ExitScope();
+  }
+  Dart_ShutdownIsolate();
+  free(full_snapshot);
+  free(script_snapshot);
+}
+
+
 #endif  // !PRODUCT
 
 
@@ -1798,8 +1844,7 @@
   EXPECT(isolate != NULL);
   Dart_EnterScope();
 
-  Dart_Handle lib = TestCase::LoadTestScript(kCustomIsolateScriptChars,
-                                             NULL);
+  Dart_Handle lib = TestCase::LoadTestScript(kCustomIsolateScriptChars, NULL);
   EXPECT_VALID(lib);
   Dart_Handle smi_result;
   smi_result = Dart_Invoke(lib, NewString("getSmi"), 0, NULL);
@@ -2691,9 +2736,9 @@
 static void CheckTypedData(Dart_CObject* object,
                            Dart_TypedData_Type typed_data_type,
                            int len) {
-    EXPECT_EQ(Dart_CObject_kTypedData, object->type);
-    EXPECT_EQ(typed_data_type, object->value.as_typed_data.type);
-    EXPECT_EQ(len, object->value.as_typed_data.length);
+  EXPECT_EQ(Dart_CObject_kTypedData, object->type);
+  EXPECT_EQ(typed_data_type, object->value.as_typed_data.type);
+  EXPECT_EQ(len, object->value.as_typed_data.length);
 }
 
 UNIT_TEST_CASE(DartGeneratedListMessagesWithTypedData) {
@@ -2792,23 +2837,16 @@
         Dart_TypedData_Type type;
         int size;
       } expected[] = {
-        { Dart_TypedData_kInt8, 256},
-        { Dart_TypedData_kUint8, 256},
-        { Dart_TypedData_kInt16, 512},
-        { Dart_TypedData_kUint16, 512},
-        { Dart_TypedData_kInt32, 1024},
-        { Dart_TypedData_kUint32, 1024},
-        { Dart_TypedData_kInt64, 2048},
-        { Dart_TypedData_kUint64, 2048},
-        { Dart_TypedData_kFloat32, 1024},
-        { Dart_TypedData_kFloat64, 2048},
-        { Dart_TypedData_kInvalid, -1 }
-      };
+          {Dart_TypedData_kInt8, 256},     {Dart_TypedData_kUint8, 256},
+          {Dart_TypedData_kInt16, 512},    {Dart_TypedData_kUint16, 512},
+          {Dart_TypedData_kInt32, 1024},   {Dart_TypedData_kUint32, 1024},
+          {Dart_TypedData_kInt64, 2048},   {Dart_TypedData_kUint64, 2048},
+          {Dart_TypedData_kFloat32, 1024}, {Dart_TypedData_kFloat64, 2048},
+          {Dart_TypedData_kInvalid, -1}};
 
       int i = 0;
       while (expected[i].type != Dart_TypedData_kInvalid) {
-        CheckTypedData(root->value.as_array.values[i],
-                       expected[i].type,
+        CheckTypedData(root->value.as_array.values[i], expected[i].type,
                        expected[i].size);
         i++;
       }
@@ -2825,46 +2863,29 @@
         Dart_TypedData_Type type;
         int size;
       } expected[] = {
-        { Dart_TypedData_kInt8, 256},
-        { Dart_TypedData_kUint8, 256},
-        { Dart_TypedData_kInt16, 512},
-        { Dart_TypedData_kUint16, 512},
-        { Dart_TypedData_kInt32, 1024},
-        { Dart_TypedData_kUint32, 1024},
-        { Dart_TypedData_kInt64, 2048},
-        { Dart_TypedData_kUint64, 2048},
-        { Dart_TypedData_kFloat32, 1024},
-        { Dart_TypedData_kFloat64, 2048},
+          {Dart_TypedData_kInt8, 256},     {Dart_TypedData_kUint8, 256},
+          {Dart_TypedData_kInt16, 512},    {Dart_TypedData_kUint16, 512},
+          {Dart_TypedData_kInt32, 1024},   {Dart_TypedData_kUint32, 1024},
+          {Dart_TypedData_kInt64, 2048},   {Dart_TypedData_kUint64, 2048},
+          {Dart_TypedData_kFloat32, 1024}, {Dart_TypedData_kFloat64, 2048},
 
-        { Dart_TypedData_kInt8, 512},
-        { Dart_TypedData_kUint8, 512},
-        { Dart_TypedData_kInt8, 1024},
-        { Dart_TypedData_kUint8, 1024},
-        { Dart_TypedData_kInt8, 2048},
-        { Dart_TypedData_kUint8, 2048},
-        { Dart_TypedData_kInt8, 1024},
-        { Dart_TypedData_kUint8, 1024},
-        { Dart_TypedData_kInt8, 2048},
-        { Dart_TypedData_kUint8, 2048},
+          {Dart_TypedData_kInt8, 512},     {Dart_TypedData_kUint8, 512},
+          {Dart_TypedData_kInt8, 1024},    {Dart_TypedData_kUint8, 1024},
+          {Dart_TypedData_kInt8, 2048},    {Dart_TypedData_kUint8, 2048},
+          {Dart_TypedData_kInt8, 1024},    {Dart_TypedData_kUint8, 1024},
+          {Dart_TypedData_kInt8, 2048},    {Dart_TypedData_kUint8, 2048},
 
-        { Dart_TypedData_kInt16, 256},
-        { Dart_TypedData_kUint16, 256},
-        { Dart_TypedData_kInt16, 1024},
-        { Dart_TypedData_kUint16, 1024},
-        { Dart_TypedData_kInt16, 2048},
-        { Dart_TypedData_kUint16, 2048},
-        { Dart_TypedData_kInt16, 1024},
-        { Dart_TypedData_kUint16, 1024},
-        { Dart_TypedData_kInt16, 2048},
-        { Dart_TypedData_kUint16, 2048},
+          {Dart_TypedData_kInt16, 256},    {Dart_TypedData_kUint16, 256},
+          {Dart_TypedData_kInt16, 1024},   {Dart_TypedData_kUint16, 1024},
+          {Dart_TypedData_kInt16, 2048},   {Dart_TypedData_kUint16, 2048},
+          {Dart_TypedData_kInt16, 1024},   {Dart_TypedData_kUint16, 1024},
+          {Dart_TypedData_kInt16, 2048},   {Dart_TypedData_kUint16, 2048},
 
-        { Dart_TypedData_kInvalid, -1 }
-      };
+          {Dart_TypedData_kInvalid, -1}};
 
       int i = 0;
       while (expected[i].type != Dart_TypedData_kInvalid) {
-        CheckTypedData(root->value.as_array.values[i],
-                       expected[i].type,
+        CheckTypedData(root->value.as_array.values[i], expected[i].type,
                        expected[i].size);
         i++;
       }
@@ -2882,23 +2903,16 @@
         Dart_TypedData_Type type;
         int size;
       } expected[] = {
-        { Dart_TypedData_kInt8, 256},
-        { Dart_TypedData_kUint8, 256},
-        { Dart_TypedData_kInt16, 256},
-        { Dart_TypedData_kUint16, 256},
-        { Dart_TypedData_kInt32, 256},
-        { Dart_TypedData_kUint32, 256},
-        { Dart_TypedData_kInt64, 256},
-        { Dart_TypedData_kUint64, 256},
-        { Dart_TypedData_kFloat32, 256},
-        { Dart_TypedData_kFloat64, 256},
-        { Dart_TypedData_kInvalid, -1 }
-      };
+          {Dart_TypedData_kInt8, 256},    {Dart_TypedData_kUint8, 256},
+          {Dart_TypedData_kInt16, 256},   {Dart_TypedData_kUint16, 256},
+          {Dart_TypedData_kInt32, 256},   {Dart_TypedData_kUint32, 256},
+          {Dart_TypedData_kInt64, 256},   {Dart_TypedData_kUint64, 256},
+          {Dart_TypedData_kFloat32, 256}, {Dart_TypedData_kFloat64, 256},
+          {Dart_TypedData_kInvalid, -1}};
 
       int i = 0;
       while (expected[i].type != Dart_TypedData_kInvalid) {
-        CheckTypedData(root->value.as_array.values[i],
-                       expected[i].type,
+        CheckTypedData(root->value.as_array.values[i], expected[i].type,
                        expected[i].size);
 
         // All views point to the same data.
@@ -2986,18 +3000,14 @@
   EXPECT(Dart_PostCObject(port_id, &object));
 
   static const int kArrayLength = 10;
-  Dart_CObject* array =
-      reinterpret_cast<Dart_CObject*>(
-          Dart_ScopeAllocate(
-              sizeof(Dart_CObject) + sizeof(Dart_CObject*) * kArrayLength));  // NOLINT
+  Dart_CObject* array = reinterpret_cast<Dart_CObject*>(Dart_ScopeAllocate(
+      sizeof(Dart_CObject) + sizeof(Dart_CObject*) * kArrayLength));  // NOLINT
   array->type = Dart_CObject_kArray;
   array->value.as_array.length = kArrayLength;
-  array->value.as_array.values =
-      reinterpret_cast<Dart_CObject**>(array + 1);
+  array->value.as_array.values = reinterpret_cast<Dart_CObject**>(array + 1);
   for (int i = 0; i < kArrayLength; i++) {
-    Dart_CObject* element =
-        reinterpret_cast<Dart_CObject*>(
-            Dart_ScopeAllocate(sizeof(Dart_CObject)));
+    Dart_CObject* element = reinterpret_cast<Dart_CObject*>(
+        Dart_ScopeAllocate(sizeof(Dart_CObject)));
     element->type = Dart_CObject_kInt32;
     element->value.as_int32 = i;
     array->value.as_array.values[i] = element;
diff --git a/runtime/vm/source_report.cc b/runtime/vm/source_report.cc
index 26f2cd2..e156203 100644
--- a/runtime/vm/source_report.cc
+++ b/runtime/vm/source_report.cc
@@ -1,7 +1,7 @@
 // Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
-
+#ifndef PRODUCT
 #include "vm/source_report.h"
 
 #include "vm/compiler.h"
@@ -26,8 +26,7 @@
       start_pos_(TokenPosition::kNoSource),
       end_pos_(TokenPosition::kNoSource),
       profile_(Isolate::Current()),
-      next_script_index_(0) {
-}
+      next_script_index_(0) {}
 
 
 SourceReport::~SourceReport() {
@@ -57,9 +56,8 @@
   ClearScriptTable();
   if (IsReportRequested(kProfile)) {
     // Build the profile.
-    SampleFilter samplesForIsolate(thread_->isolate(),
-                                   Thread::kMutatorTask,
-                                   -1, -1);
+    SampleFilter samplesForIsolate(thread_->isolate(), Thread::kMutatorTask, -1,
+                                   -1);
     profile_.Build(thread, &samplesForIsolate, Profile::kNoTags);
   }
 }
@@ -95,8 +93,7 @@
     default:
       return true;
   }
-  if (func.is_abstract() ||
-      func.IsImplicitConstructor() ||
+  if (func.is_abstract() || func.IsImplicitConstructor() ||
       func.IsRedirectingFactory()) {
     return true;
   }
@@ -166,10 +163,10 @@
   const TokenPosition end_pos = function.end_token_pos();
 
   ZoneGrowableArray<const ICData*>* ic_data_array =
-      new(zone()) ZoneGrowableArray<const ICData*>();
+      new (zone()) ZoneGrowableArray<const ICData*>();
   function.RestoreICDataMap(ic_data_array, false /* clone ic-data */);
-  const PcDescriptors& descriptors = PcDescriptors::Handle(
-      zone(), code.pc_descriptors());
+  const PcDescriptors& descriptors =
+      PcDescriptors::Handle(zone(), code.pc_descriptors());
 
   JSONArray sites(jsobj, "callSites");
 
@@ -178,7 +175,7 @@
       RawPcDescriptors::kIcCall | RawPcDescriptors::kUnoptStaticCall);
   while (iter.MoveNext()) {
     HANDLESCOPE(thread());
-    // TODO(zra): Remove this bailout once DBC has reliable ICData.
+// TODO(zra): Remove this bailout once DBC has reliable ICData.
 #if defined(TARGET_ARCH_DBC)
     if (iter.DeoptId() >= ic_data_array->length()) {
       continue;
@@ -206,10 +203,10 @@
   const TokenPosition end_pos = function.end_token_pos();
 
   ZoneGrowableArray<const ICData*>* ic_data_array =
-      new(zone()) ZoneGrowableArray<const ICData*>();
+      new (zone()) ZoneGrowableArray<const ICData*>();
   function.RestoreICDataMap(ic_data_array, false /* clone ic-data */);
-  const PcDescriptors& descriptors = PcDescriptors::Handle(
-      zone(), code.pc_descriptors());
+  const PcDescriptors& descriptors =
+      PcDescriptors::Handle(zone(), code.pc_descriptors());
 
   const int kCoverageNone = 0;
   const int kCoverageMiss = 1;
@@ -227,7 +224,7 @@
       RawPcDescriptors::kIcCall | RawPcDescriptors::kUnoptStaticCall);
   while (iter.MoveNext()) {
     HANDLESCOPE(thread());
-    // TODO(zra): Remove this bailout once DBC has reliable ICData.
+// TODO(zra): Remove this bailout once DBC has reliable ICData.
 #if defined(TARGET_ARCH_DBC)
     if (iter.DeoptId() >= ic_data_array->length()) {
       continue;
@@ -279,14 +276,14 @@
 void SourceReport::PrintPossibleBreakpointsData(JSONObject* jsobj,
                                                 const Function& func,
                                                 const Code& code) {
-  const uint8_t kSafepointKind = (RawPcDescriptors::kIcCall |
-                                  RawPcDescriptors::kUnoptStaticCall |
-                                  RawPcDescriptors::kRuntimeCall);
+  const uint8_t kSafepointKind =
+      (RawPcDescriptors::kIcCall | RawPcDescriptors::kUnoptStaticCall |
+       RawPcDescriptors::kRuntimeCall);
   const TokenPosition begin_pos = func.token_pos();
   const TokenPosition end_pos = func.end_token_pos();
 
-  const PcDescriptors& descriptors = PcDescriptors::Handle(
-      zone(), code.pc_descriptors());
+  const PcDescriptors& descriptors =
+      PcDescriptors::Handle(zone(), code.pc_descriptors());
 
   intptr_t func_length = (end_pos.Pos() - begin_pos.Pos()) + 1;
   GrowableArray<char> possible(func_length);
@@ -416,8 +413,7 @@
   // We skip compiled async functions.  Once an async function has
   // been compiled, there is another function with the same range which
   // actually contains the user code.
-  if (func.IsAsyncFunction() ||
-      func.IsAsyncGenerator() ||
+  if (func.IsAsyncFunction() || func.IsAsyncGenerator() ||
       func.IsSyncGenerator()) {
     return;
   }
@@ -537,3 +533,4 @@
 }
 
 }  // namespace dart
+#endif  // PRODUCT
diff --git a/runtime/vm/source_report.h b/runtime/vm/source_report.h
index dec18cfa..8db2418 100644
--- a/runtime/vm/source_report.h
+++ b/runtime/vm/source_report.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_SOURCE_REPORT_H_
-#define VM_SOURCE_REPORT_H_
+#ifndef RUNTIME_VM_SOURCE_REPORT_H_
+#define RUNTIME_VM_SOURCE_REPORT_H_
 
 #include "vm/allocation.h"
 #include "vm/flags.h"
@@ -20,10 +20,10 @@
 class SourceReport {
  public:
   enum ReportKind {
-    kCallSites           = 0x1,
-    kCoverage            = 0x2,
+    kCallSites = 0x1,
+    kCoverage = 0x2,
     kPossibleBreakpoints = 0x4,
-    kProfile             = 0x8,
+    kProfile = 0x8,
   };
 
   static const char* kCallSitesStr;
@@ -31,29 +31,28 @@
   static const char* kPossibleBreakpointsStr;
   static const char* kProfileStr;
 
-  enum CompileMode {
-    kNoCompile,
-    kForceCompile
-  };
+  enum CompileMode { kNoCompile, kForceCompile };
 
   // report_set is a bitvector indicating which reports to generate
   // (e.g. kCallSites | kCoverage).
-  explicit SourceReport(intptr_t report_set,
-                        CompileMode compile = kNoCompile);
+  explicit SourceReport(intptr_t report_set, CompileMode compile = kNoCompile);
   ~SourceReport();
 
   // Generate a source report for (some subrange of) a script.
   //
   // If script is null, then the report is generated for all scripts
   // in the isolate.
-  void PrintJSON(JSONStream* js, const Script& script,
+  void PrintJSON(JSONStream* js,
+                 const Script& script,
                  TokenPosition start_pos = TokenPosition::kNoSource,
                  TokenPosition end_pos = TokenPosition::kNoSource);
 
  private:
   void ClearScriptTable();
-  void Init(Thread* thread, const Script* script,
-            TokenPosition start_pos, TokenPosition end_pos);
+  void Init(Thread* thread,
+            const Script* script,
+            TokenPosition start_pos,
+            TokenPosition end_pos);
 
   Thread* thread() const { return thread_; }
   Zone* zone() const { return thread_->zone(); }
@@ -65,11 +64,14 @@
   bool ScriptIsLoadedByLibrary(const Script& script, const Library& lib);
 
   void PrintCallSitesData(JSONObject* jsobj,
-                          const Function& func, const Code& code);
+                          const Function& func,
+                          const Code& code);
   void PrintCoverageData(JSONObject* jsobj,
-                         const Function& func, const Code& code);
+                         const Function& func,
+                         const Code& code);
   void PrintPossibleBreakpointsData(JSONObject* jsobj,
-                                    const Function& func, const Code& code);
+                                    const Function& func,
+                                    const Code& code);
   void PrintProfileData(JSONObject* jsobj, ProfileFunction* profile_function);
 #if defined(DEBUG)
   void VerifyScriptTable();
@@ -95,17 +97,11 @@
     typedef const String* Key;
     typedef ScriptTableEntry* Pair;
 
-    static Key KeyOf(Pair kv) {
-      return kv->key;
-    }
+    static Key KeyOf(Pair kv) { return kv->key; }
 
-    static Value ValueOf(Pair kv) {
-      return kv;
-    }
+    static Value ValueOf(Pair kv) { return kv; }
 
-    static inline intptr_t Hashcode(Key key) {
-      return key->Hash();
-    }
+    static inline intptr_t Hashcode(Key key) { return key->Hash(); }
 
     static inline bool IsKeyEqual(Pair kv, Key key) {
       return kv->key->Equals(*key);
@@ -126,4 +122,4 @@
 
 }  // namespace dart
 
-#endif  // VM_SOURCE_REPORT_H_
+#endif  // RUNTIME_VM_SOURCE_REPORT_H_
diff --git a/runtime/vm/source_report_test.cc b/runtime/vm/source_report_test.cc
index 2d3f5bc..1651c4f 100644
--- a/runtime/vm/source_report_test.cc
+++ b/runtime/vm/source_report_test.cc
@@ -31,8 +31,8 @@
   Library& lib = Library::Handle();
   lib ^= ExecuteScript(kScript);
   ASSERT(!lib.IsNull());
-  const Script& script = Script::Handle(lib.LookupScript(
-      String::Handle(String::New("test-lib"))));
+  const Script& script =
+      Script::Handle(lib.LookupScript(String::Handle(String::New("test-lib"))));
 
   SourceReport report(SourceReport::kCoverage);
   JSONStream js;
@@ -68,8 +68,8 @@
   Library& lib = Library::Handle();
   lib ^= ExecuteScript(kScript);
   ASSERT(!lib.IsNull());
-  const Script& script = Script::Handle(lib.LookupScript(
-      String::Handle(String::New("test-lib"))));
+  const Script& script =
+      Script::Handle(lib.LookupScript(String::Handle(String::New("test-lib"))));
 
   SourceReport report(SourceReport::kCoverage);
   JSONStream js;
@@ -113,8 +113,8 @@
   Library& lib = Library::Handle();
   lib ^= ExecuteScript(kScript);
   ASSERT(!lib.IsNull());
-  const Script& script = Script::Handle(lib.LookupScript(
-      String::Handle(String::New("test-lib"))));
+  const Script& script =
+      Script::Handle(lib.LookupScript(String::Handle(String::New("test-lib"))));
 
   SourceReport report(SourceReport::kCoverage, SourceReport::kForceCompile);
   JSONStream js;
@@ -157,8 +157,8 @@
   Library& lib = Library::Handle();
   lib ^= ExecuteScript(kScript);
   ASSERT(!lib.IsNull());
-  const Script& script = Script::Handle(lib.LookupScript(
-      String::Handle(String::New("test-lib"))));
+  const Script& script =
+      Script::Handle(lib.LookupScript(String::Handle(String::New("test-lib"))));
 
   SourceReport report(SourceReport::kCoverage);
   JSONStream js;
@@ -200,8 +200,8 @@
   Library& lib = Library::Handle();
   lib ^= ExecuteScript(kScript);
   ASSERT(!lib.IsNull());
-  const Script& script = Script::Handle(lib.LookupScript(
-      String::Handle(String::New("test-lib"))));
+  const Script& script =
+      Script::Handle(lib.LookupScript(String::Handle(String::New("test-lib"))));
 
   SourceReport report(SourceReport::kCoverage, SourceReport::kForceCompile);
   JSONStream js;
@@ -244,8 +244,8 @@
   Library& lib = Library::Handle();
   lib ^= ExecuteScript(kScript);
   ASSERT(!lib.IsNull());
-  const Script& script = Script::Handle(lib.LookupScript(
-      String::Handle(String::New("test-lib"))));
+  const Script& script =
+      Script::Handle(lib.LookupScript(String::Handle(String::New("test-lib"))));
 
   SourceReport report(SourceReport::kCoverage, SourceReport::kForceCompile);
   JSONStream js;
@@ -297,8 +297,8 @@
   Library& lib = Library::Handle();
   lib ^= ExecuteScript(kScript);
   ASSERT(!lib.IsNull());
-  const Script& script = Script::Handle(lib.LookupScript(
-      String::Handle(String::New("test-lib"))));
+  const Script& script =
+      Script::Handle(lib.LookupScript(String::Handle(String::New("test-lib"))));
 
   SourceReport report(SourceReport::kCoverage);
   JSONStream js;
@@ -353,8 +353,8 @@
   Library& lib = Library::Handle();
   lib ^= ExecuteScript(kScript);
   ASSERT(!lib.IsNull());
-  const Script& script = Script::Handle(lib.LookupScript(
-      String::Handle(String::New("test-lib"))));
+  const Script& script =
+      Script::Handle(lib.LookupScript(String::Handle(String::New("test-lib"))));
   const Function& helper = Function::Handle(
       lib.LookupLocalFunction(String::Handle(String::New("helper0"))));
 
@@ -480,8 +480,8 @@
   Library& lib = Library::Handle();
   lib ^= ExecuteScript(kScript);
   ASSERT(!lib.IsNull());
-  const Script& script = Script::Handle(lib.LookupScript(
-      String::Handle(String::New("test-lib"))));
+  const Script& script =
+      Script::Handle(lib.LookupScript(String::Handle(String::New("test-lib"))));
 
   SourceReport report(SourceReport::kCallSites);
   JSONStream js;
@@ -537,8 +537,8 @@
   Library& lib = Library::Handle();
   lib ^= ExecuteScript(kScript);
   ASSERT(!lib.IsNull());
-  const Script& script = Script::Handle(lib.LookupScript(
-      String::Handle(String::New("test-lib"))));
+  const Script& script =
+      Script::Handle(lib.LookupScript(String::Handle(String::New("test-lib"))));
   const Function& helper = Function::Handle(
       lib.LookupLocalFunction(String::Handle(String::New("helper"))));
 
@@ -601,10 +601,10 @@
   Library& lib = Library::Handle();
   lib ^= ExecuteScript(kScript);
   ASSERT(!lib.IsNull());
-  const Script& script = Script::Handle(lib.LookupScript(
-      String::Handle(String::New("test-lib"))));
+  const Script& script =
+      Script::Handle(lib.LookupScript(String::Handle(String::New("test-lib"))));
 
-  SourceReport report(SourceReport::kCallSites|SourceReport::kCoverage);
+  SourceReport report(SourceReport::kCallSites | SourceReport::kCoverage);
   JSONStream js;
   report.PrintJSON(&js, script);
   ElideJSONSubstring("classes", js.ToCString(), buffer);
@@ -654,8 +654,8 @@
   Library& lib = Library::Handle();
   lib ^= ExecuteScript(kScript);
   ASSERT(!lib.IsNull());
-  const Script& script = Script::Handle(lib.LookupScript(
-      String::Handle(String::New("test-lib"))));
+  const Script& script =
+      Script::Handle(lib.LookupScript(String::Handle(String::New("test-lib"))));
 
   SourceReport report(SourceReport::kPossibleBreakpoints);
   JSONStream js;
diff --git a/runtime/vm/spaces.h b/runtime/vm/spaces.h
index 8d149b4..33e2031 100644
--- a/runtime/vm/spaces.h
+++ b/runtime/vm/spaces.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_SPACES_H_
-#define VM_SPACES_H_
+#ifndef RUNTIME_VM_SPACES_H_
+#define RUNTIME_VM_SPACES_H_
 
 // This file contains utilities shared by old and new space.
 // TODO(koda): Create Space base class with Space::CurrentUsage().
@@ -12,10 +12,7 @@
 
 // Usage statistics for a space/generation at a particular moment in time.
 struct SpaceUsage {
-  SpaceUsage()
-    : capacity_in_words(0),
-      used_in_words(0),
-      external_in_words(0) {}
+  SpaceUsage() : capacity_in_words(0), used_in_words(0), external_in_words(0) {}
   intptr_t capacity_in_words;
   intptr_t used_in_words;
   intptr_t external_in_words;
@@ -23,4 +20,4 @@
 
 }  // namespace dart
 
-#endif  // VM_SPACES_H_
+#endif  // RUNTIME_VM_SPACES_H_
diff --git a/runtime/vm/stack_frame.cc b/runtime/vm/stack_frame.cc
index f93111e..a07e414 100644
--- a/runtime/vm/stack_frame.cc
+++ b/runtime/vm/stack_frame.cc
@@ -46,19 +46,17 @@
     if (owner.IsFunction()) {
       const Function& function = Function::Cast(owner);
       return zone->PrintToString(
-          "[%-8s : sp(%#" Px ") fp(%#" Px ") pc(%#" Px ") %s ]",
-          GetName(), sp(), fp(), pc(),
-          function.ToFullyQualifiedCString());
+          "[%-8s : sp(%#" Px ") fp(%#" Px ") pc(%#" Px ") %s ]", GetName(),
+          sp(), fp(), pc(), function.ToFullyQualifiedCString());
     } else {
       return zone->PrintToString(
-          "[%-8s : sp(%#" Px ") fp(%#" Px ") pc(%#" Px ") %s ]",
-          GetName(), sp(), fp(), pc(),
-          owner.ToCString());
+          "[%-8s : sp(%#" Px ") fp(%#" Px ") pc(%#" Px ") %s ]", GetName(),
+          sp(), fp(), pc(), owner.ToCString());
     }
   } else {
-    return zone->PrintToString(
-        "[%-8s : sp(%#" Px ") fp(%#" Px ") pc(%#" Px ")]",
-        GetName(), sp(), fp(), pc());
+    return zone->PrintToString("[%-8s : sp(%#" Px ") fp(%#" Px ") pc(%#" Px
+                               ")]",
+                               GetName(), sp(), fp(), pc());
   }
 }
 
@@ -97,7 +95,7 @@
   // helper functions to the raw object interface.
   NoSafepointScope no_safepoint;
   Code code;
-  code = LookupDartCode();
+  code = GetCodeObject();
   if (!code.IsNull()) {
     // Visit the code object.
     RawObject* raw_code = code.raw();
@@ -222,9 +220,9 @@
 
 
 RawCode* StackFrame::LookupDartCode() const {
-  // We add a no gc scope to ensure that the code below does not trigger
-  // a GC as we are handling raw object references here. It is possible
-  // that the code is called while a GC is in progress, that is ok.
+// We add a no gc scope to ensure that the code below does not trigger
+// a GC as we are handling raw object references here. It is possible
+// that the code is called while a GC is in progress, that is ok.
 #if !defined(TARGET_OS_WINDOWS)
   // On Windows, the profiler calls this from a separate thread where
   // Thread::Current() is NULL, so we cannot create a NoSafepointScope.
@@ -353,7 +351,8 @@
 }
 
 
-StackFrameIterator::StackFrameIterator(uword last_fp, bool validate,
+StackFrameIterator::StackFrameIterator(uword last_fp,
+                                       bool validate,
                                        Thread* thread)
     : validate_(validate),
       entry_(thread),
@@ -370,8 +369,11 @@
 
 
 #if !defined(TARGET_ARCH_DBC)
-StackFrameIterator::StackFrameIterator(uword fp, uword sp, uword pc,
-                                       bool validate, Thread* thread)
+StackFrameIterator::StackFrameIterator(uword fp,
+                                       uword sp,
+                                       uword pc,
+                                       bool validate,
+                                       Thread* thread)
     : validate_(validate),
       entry_(thread),
       exit_(thread),
@@ -410,7 +412,8 @@
       // Iteration starts from an exit frame given by its fp.
       current_frame_ = NextExitFrame();
     } else if (*(reinterpret_cast<uword*>(
-        frames_.fp_ + (kSavedCallerFpSlotFromFp * kWordSize))) == 0) {
+                   frames_.fp_ + (kSavedCallerFpSlotFromFp * kWordSize))) ==
+               0) {
       // Iteration starts from an entry frame given by its fp, sp, and pc.
       current_frame_ = NextEntryFrame();
     } else {
@@ -486,15 +489,15 @@
 
 
 InlinedFunctionsIterator::InlinedFunctionsIterator(const Code& code, uword pc)
-  : index_(0),
-    num_materializations_(0),
-    dest_frame_size_(0),
-    code_(Code::Handle(code.raw())),
-    deopt_info_(TypedData::Handle()),
-    function_(Function::Handle()),
-    pc_(pc),
-    deopt_instructions_(),
-    object_table_(ObjectPool::Handle()) {
+    : index_(0),
+      num_materializations_(0),
+      dest_frame_size_(0),
+      code_(Code::Handle(code.raw())),
+      deopt_info_(TypedData::Handle()),
+      function_(Function::Handle()),
+      pc_(pc),
+      deopt_instructions_(),
+      object_table_(ObjectPool::Handle()) {
   ASSERT(code_.is_optimized());
   ASSERT(pc_ != 0);
   ASSERT(code.ContainsInstructionAt(pc));
@@ -546,9 +549,7 @@
 // current frame were to be deoptimized.
 intptr_t InlinedFunctionsIterator::GetDeoptFpOffset() const {
   ASSERT(deopt_instructions_.length() != 0);
-  for (intptr_t index = index_;
-       index < deopt_instructions_.length();
-       index++) {
+  for (intptr_t index = index_; index < deopt_instructions_.length(); index++) {
     DeoptInstr* deopt_instr = deopt_instructions_[index];
     if (deopt_instr->kind() == DeoptInstr::kCallerFp) {
 #if defined(TARGET_ARCH_DBC)
@@ -566,4 +567,15 @@
 }
 
 
+#if defined(DEBUG)
+void ValidateFrames() {
+  StackFrameIterator frames(StackFrameIterator::kValidateFrames);
+  StackFrame* frame = frames.NextFrame();
+  while (frame != NULL) {
+    frame = frames.NextFrame();
+  }
+}
+#endif
+
+
 }  // namespace dart
diff --git a/runtime/vm/stack_frame.h b/runtime/vm/stack_frame.h
index 268ca4a..dfadde2 100644
--- a/runtime/vm/stack_frame.h
+++ b/runtime/vm/stack_frame.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_STACK_FRAME_H_
-#define VM_STACK_FRAME_H_
+#ifndef RUNTIME_VM_STACK_FRAME_H_
+#define RUNTIME_VM_STACK_FRAME_H_
 
 #include "vm/allocation.h"
 #include "vm/object.h"
@@ -35,7 +35,7 @@
 // Generic stack frame.
 class StackFrame : public ValueObject {
  public:
-  virtual ~StackFrame() { }
+  virtual ~StackFrame() {}
 
   // Accessors to get the pc, sp and fp of a frame.
   uword sp() const { return sp_; }
@@ -51,8 +51,27 @@
     return 0;
   }
 
+  uword IsMarkedForLazyDeopt() const {
+    uword raw_pc =
+        *reinterpret_cast<uword*>(sp() + (kSavedPcSlotFromSp * kWordSize));
+    return raw_pc == StubCode::DeoptimizeLazyFromReturn_entry()->EntryPoint();
+  }
+  void MarkForLazyDeopt() {
+    set_pc(StubCode::DeoptimizeLazyFromReturn_entry()->EntryPoint());
+  }
+  void UnmarkForLazyDeopt() {
+    // If this frame was marked for lazy deopt, pc_ was computed to be the
+    // original return address using the pending deopts table in GetCallerPc.
+    // Write this value back into the frame.
+    uword original_pc = pc();
+    ASSERT(original_pc !=
+           StubCode::DeoptimizeLazyFromReturn_entry()->EntryPoint());
+    set_pc(original_pc);
+  }
+
   void set_pc(uword value) {
     *reinterpret_cast<uword*>(sp() + (kSavedPcSlotFromSp * kWordSize)) = value;
+    pc_ = value;
   }
 
   void set_pc_marker(RawCode* code) {
@@ -88,10 +107,12 @@
 
  protected:
   explicit StackFrame(Thread* thread)
-      : fp_(0), sp_(0), pc_(0), thread_(thread) { }
+      : fp_(0), sp_(0), pc_(0), thread_(thread) {}
 
   // Name of the frame, used for generic frame printing functionality.
-  virtual const char* GetName() const { return IsStubFrame()? "stub" : "dart"; }
+  virtual const char* GetName() const {
+    return IsStubFrame() ? "stub" : "dart";
+  }
 
   Isolate* isolate() const { return thread_->isolate(); }
 
@@ -100,18 +121,21 @@
  private:
   RawCode* GetCodeObject() const;
 
-  uword GetCallerSp() const {
-    return fp() + (kCallerSpSlotFromFp * kWordSize);
-  }
+  uword GetCallerSp() const { return fp() + (kCallerSpSlotFromFp * kWordSize); }
 
   uword GetCallerFp() const {
-    return *(reinterpret_cast<uword*>(
-      fp() + (kSavedCallerFpSlotFromFp * kWordSize)));
+    return *(reinterpret_cast<uword*>(fp() +
+                                      (kSavedCallerFpSlotFromFp * kWordSize)));
   }
 
   uword GetCallerPc() const {
-    return *(reinterpret_cast<uword*>(
+    uword raw_pc = *(reinterpret_cast<uword*>(
         fp() + (kSavedCallerPcSlotFromFp * kWordSize)));
+    ASSERT(raw_pc != StubCode::DeoptimizeLazyFromThrow_entry()->EntryPoint());
+    if (raw_pc == StubCode::DeoptimizeLazyFromReturn_entry()->EntryPoint()) {
+      return isolate()->FindPendingDeopt(GetCallerFp());
+    }
+    return raw_pc;
   }
 
   uword fp_;
@@ -123,6 +147,7 @@
   // fields fp_ and sp_ when they return the respective frame objects.
   friend class FrameSetIterator;
   friend class StackFrameIterator;
+  friend class ProfilerDartStackWalker;
   DISALLOW_COPY_AND_ASSIGN(StackFrame);
 };
 
@@ -143,7 +168,7 @@
   virtual const char* GetName() const { return "exit"; }
 
  private:
-  explicit ExitFrame(Thread* thread) : StackFrame(thread) { }
+  explicit ExitFrame(Thread* thread) : StackFrame(thread) {}
 
   friend class StackFrameIterator;
   DISALLOW_COPY_AND_ASSIGN(ExitFrame);
@@ -154,9 +179,7 @@
 // dart code.
 class EntryFrame : public StackFrame {
  public:
-  bool IsValid() const {
-    return StubCode::InInvocationStub(pc());
-  }
+  bool IsValid() const { return StubCode::InInvocationStub(pc()); }
   bool IsDartFrame(bool validate = true) const { return false; }
   bool IsStubFrame() const { return false; }
   bool IsEntryFrame() const { return true; }
@@ -168,7 +191,7 @@
   virtual const char* GetName() const { return "entry"; }
 
  private:
-  explicit EntryFrame(Thread* thread) : StackFrame(thread) { }
+  explicit EntryFrame(Thread* thread) : StackFrame(thread) {}
 
   friend class StackFrameIterator;
   DISALLOW_COPY_AND_ASSIGN(EntryFrame);
@@ -187,15 +210,19 @@
 
   // Iterators for iterating over all frames from the last ExitFrame to the
   // first EntryFrame.
-  StackFrameIterator(bool validate,
-                     Thread* thread = Thread::Current());
-  StackFrameIterator(uword last_fp, bool validate,
+  explicit StackFrameIterator(bool validate,
+                              Thread* thread = Thread::Current());
+  StackFrameIterator(uword last_fp,
+                     bool validate,
                      Thread* thread = Thread::Current());
 
 #if !defined(TARGET_ARCH_DBC)
   // Iterator for iterating over all frames from the current frame (given by its
   // fp, sp, and pc) to the first EntryFrame.
-  StackFrameIterator(uword fp, uword sp, uword pc, bool validate,
+  StackFrameIterator(uword fp,
+                     uword sp,
+                     uword pc,
+                     bool validate,
                      Thread* thread = Thread::Current());
 #endif
 
@@ -217,8 +244,8 @@
       if (fp_ == 0) {
         return false;
       }
-      const uword pc = *(reinterpret_cast<uword*>(
-          sp_ + (kSavedPcSlotFromSp * kWordSize)));
+      const uword pc =
+          *(reinterpret_cast<uword*>(sp_ + (kSavedPcSlotFromSp * kWordSize)));
       return !StubCode::InInvocationStub(pc);
     }
 
@@ -227,7 +254,7 @@
 
    private:
     explicit FrameSetIterator(Thread* thread)
-        : fp_(0), sp_(0), pc_(0), stack_frame_(thread), thread_(thread) { }
+        : fp_(0), sp_(0), pc_(0), stack_frame_(thread), thread_(thread) {}
     uword fp_;
     uword sp_;
     uword pc_;
@@ -253,13 +280,14 @@
   void SetupLastExitFrameData();
   void SetupNextExitFrameData();
 
-  bool validate_;  // Validate each frame as we traverse the frames.
+  bool validate_;     // Validate each frame as we traverse the frames.
   EntryFrame entry_;  // Singleton entry frame returned by NextEntryFrame().
-  ExitFrame exit_;  // Singleton exit frame returned by NextExitFrame().
+  ExitFrame exit_;    // Singleton exit frame returned by NextExitFrame().
   FrameSetIterator frames_;
   StackFrame* current_frame_;  // Points to the current frame in the iterator.
   Thread* thread_;
 
+  friend class ProfilerDartStackWalker;
   DISALLOW_COPY_AND_ASSIGN(StackFrameIterator);
 };
 
@@ -274,19 +302,16 @@
 class DartFrameIterator : public ValueObject {
  public:
   explicit DartFrameIterator(Thread* thread = Thread::Current())
-      : frames_(StackFrameIterator::kDontValidateFrames, thread) { }
-  DartFrameIterator(uword last_fp,
-                    Thread* thread = Thread::Current())
-      : frames_(last_fp, StackFrameIterator::kDontValidateFrames, thread) { }
+      : frames_(StackFrameIterator::kDontValidateFrames, thread) {}
+  explicit DartFrameIterator(uword last_fp, Thread* thread = Thread::Current())
+      : frames_(last_fp, StackFrameIterator::kDontValidateFrames, thread) {}
 
 #if !defined(TARGET_ARCH_DBC)
   DartFrameIterator(uword fp,
                     uword sp,
                     uword pc,
                     Thread* thread = Thread::Current())
-      : frames_(fp, sp, pc,
-                StackFrameIterator::kDontValidateFrames, thread) {
-  }
+      : frames_(fp, sp, pc, StackFrameIterator::kDontValidateFrames, thread) {}
 #endif
 
   // Get next dart frame.
@@ -348,6 +373,11 @@
 };
 
 
+#if defined(DEBUG)
+void ValidateFrames();
+#endif
+
+
 #if !defined(TARGET_ARCH_DBC)
 DART_FORCE_INLINE static intptr_t LocalVarIndex(intptr_t fp_offset,
                                                 intptr_t var_index) {
@@ -378,4 +408,4 @@
 
 }  // namespace dart
 
-#endif  // VM_STACK_FRAME_H_
+#endif  // RUNTIME_VM_STACK_FRAME_H_
diff --git a/runtime/vm/stack_frame_arm.h b/runtime/vm/stack_frame_arm.h
index a966a29..a0d1bba 100644
--- a/runtime/vm/stack_frame_arm.h
+++ b/runtime/vm/stack_frame_arm.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_STACK_FRAME_ARM_H_
-#define VM_STACK_FRAME_ARM_H_
+#ifndef RUNTIME_VM_STACK_FRAME_ARM_H_
+#define RUNTIME_VM_STACK_FRAME_ARM_H_
 
 namespace dart {
 
@@ -57,4 +57,4 @@
 
 }  // namespace dart
 
-#endif  // VM_STACK_FRAME_ARM_H_
+#endif  // RUNTIME_VM_STACK_FRAME_ARM_H_
diff --git a/runtime/vm/stack_frame_arm64.h b/runtime/vm/stack_frame_arm64.h
index a1ca2eb..7b1982d 100644
--- a/runtime/vm/stack_frame_arm64.h
+++ b/runtime/vm/stack_frame_arm64.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_STACK_FRAME_ARM64_H_
-#define VM_STACK_FRAME_ARM64_H_
+#ifndef RUNTIME_VM_STACK_FRAME_ARM64_H_
+#define RUNTIME_VM_STACK_FRAME_ARM64_H_
 
 namespace dart {
 
@@ -50,4 +50,4 @@
 
 }  // namespace dart
 
-#endif  // VM_STACK_FRAME_ARM64_H_
+#endif  // RUNTIME_VM_STACK_FRAME_ARM64_H_
diff --git a/runtime/vm/stack_frame_dbc.h b/runtime/vm/stack_frame_dbc.h
index 5d5ee78..9cc08ac 100644
--- a/runtime/vm/stack_frame_dbc.h
+++ b/runtime/vm/stack_frame_dbc.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_STACK_FRAME_DBC_H_
-#define VM_STACK_FRAME_DBC_H_
+#ifndef RUNTIME_VM_STACK_FRAME_DBC_H_
+#define RUNTIME_VM_STACK_FRAME_DBC_H_
 
 namespace dart {
 
@@ -43,7 +43,7 @@
 static const int kSavedCallerFpSlotFromFp = -1;
 static const int kSavedCallerPpSlotFromFp = kSavedCallerFpSlotFromFp;
 static const int kSavedCallerPcSlotFromFp = -2;
-static const int kCallerSpSlotFromFp = -kDartFrameFixedSize-1;
+static const int kCallerSpSlotFromFp = -kDartFrameFixedSize - 1;
 static const int kPcMarkerSlotFromFp = -3;
 static const int kFunctionSlotFromFp = -4;
 
@@ -84,4 +84,4 @@
 
 }  // namespace dart
 
-#endif  // VM_STACK_FRAME_DBC_H_
+#endif  // RUNTIME_VM_STACK_FRAME_DBC_H_
diff --git a/runtime/vm/stack_frame_ia32.h b/runtime/vm/stack_frame_ia32.h
index a331aef..b7eb7d9 100644
--- a/runtime/vm/stack_frame_ia32.h
+++ b/runtime/vm/stack_frame_ia32.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_STACK_FRAME_IA32_H_
-#define VM_STACK_FRAME_IA32_H_
+#ifndef RUNTIME_VM_STACK_FRAME_IA32_H_
+#define RUNTIME_VM_STACK_FRAME_IA32_H_
 
 namespace dart {
 
@@ -46,4 +46,4 @@
 
 }  // namespace dart
 
-#endif  // VM_STACK_FRAME_IA32_H_
+#endif  // RUNTIME_VM_STACK_FRAME_IA32_H_
diff --git a/runtime/vm/stack_frame_mips.h b/runtime/vm/stack_frame_mips.h
index 35c9aba..7290b8b 100644
--- a/runtime/vm/stack_frame_mips.h
+++ b/runtime/vm/stack_frame_mips.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_STACK_FRAME_MIPS_H_
-#define VM_STACK_FRAME_MIPS_H_
+#ifndef RUNTIME_VM_STACK_FRAME_MIPS_H_
+#define RUNTIME_VM_STACK_FRAME_MIPS_H_
 
 namespace dart {
 
@@ -47,4 +47,4 @@
 
 }  // namespace dart
 
-#endif  // VM_STACK_FRAME_MIPS_H_
+#endif  // RUNTIME_VM_STACK_FRAME_MIPS_H_
diff --git a/runtime/vm/stack_frame_test.cc b/runtime/vm/stack_frame_test.cc
index a2198aa..d1ebde6 100644
--- a/runtime/vm/stack_frame_test.cc
+++ b/runtime/vm/stack_frame_test.cc
@@ -34,8 +34,7 @@
 
 
 #define FUNCTION_NAME(name) StackFrame_##name
-#define REGISTER_FUNCTION(name, count)                                         \
-  { ""#name, FUNCTION_NAME(name), count },
+#define REGISTER_FUNCTION(name, count) {"" #name, FUNCTION_NAME(name), count},
 
 
 void FUNCTION_NAME(StackFrame_equals)(Dart_NativeArguments args) {
@@ -43,8 +42,8 @@
   const Instance& expected = Instance::CheckedHandle(arguments->NativeArgAt(0));
   const Instance& actual = Instance::CheckedHandle(arguments->NativeArgAt(1));
   if (!expected.OperatorEquals(actual)) {
-    OS::Print("expected: '%s' actual: '%s'\n",
-        expected.ToCString(), actual.ToCString());
+    OS::Print("expected: '%s' actual: '%s'\n", expected.ToCString(),
+              actual.ToCString());
     FATAL("Expect_equals fails.\n");
   }
 }
@@ -99,8 +98,8 @@
       const char* name = function.ToFullyQualifiedCString();
       // Currently all unit tests are loaded as being part of dart:core-lib.
       String& url = String::Handle(zone, String::New(TestCase::url()));
-      const Library& lib = Library::Handle(zone,
-                                           Library::LookupLibrary(thread, url));
+      const Library& lib =
+          Library::Handle(zone, Library::LookupLibrary(thread, url));
       ASSERT(!lib.IsNull());
       const char* lib_name = String::Handle(zone, lib.url()).ToCString();
       char* full_name = OS::SCreate(zone, "%s_%s", lib_name, expected_name);
@@ -123,16 +122,14 @@
   V(StackFrame_equals, 2)                                                      \
   V(StackFrame_frameCount, 0)                                                  \
   V(StackFrame_dartFrameCount, 0)                                              \
-  V(StackFrame_validateFrame, 2)                                               \
+  V(StackFrame_validateFrame, 2)
 
 
 static struct NativeEntries {
   const char* name_;
   Dart_NativeFunction function_;
   int argument_count_;
-} BuiltinEntries[] = {
-  STACKFRAME_NATIVE_LIST(REGISTER_FUNCTION)
-};
+} BuiltinEntries[] = {STACKFRAME_NATIVE_LIST(REGISTER_FUNCTION)};
 
 
 static Dart_NativeFunction native_lookup(Dart_Handle name,
@@ -237,8 +234,7 @@
       "  }"
       "}";
   Dart_Handle lib = TestCase::LoadTestScript(
-      kScriptChars,
-      reinterpret_cast<Dart_NativeEntryResolver>(native_lookup));
+      kScriptChars, reinterpret_cast<Dart_NativeEntryResolver>(native_lookup));
   Dart_Handle cls = Dart_GetClass(lib, NewString("StackFrameTest"));
   EXPECT_VALID(Dart_Invoke(cls, NewString("testMain"), 0, NULL));
 }
@@ -252,75 +248,77 @@
   // methods are marked invisible.
   if (FLAG_lazy_dispatchers) {
     kScriptChars =
-      "class StackFrame {"
-      "  static equals(var obj1, var obj2) native \"StackFrame_equals\";"
-      "  static int frameCount() native \"StackFrame_frameCount\";"
-      "  static int dartFrameCount() native \"StackFrame_dartFrameCount\";"
-      "  static validateFrame(int index,"
-      "                       String name) native \"StackFrame_validateFrame\";"
-      "} "
-      "class StackFrame2Test {"
-      "  StackFrame2Test() {}"
-      "  noSuchMethod(Invocation im) {"
-      "    /* We should have 6 general frames and 4 dart frames as follows:"
-      "     * exit frame"
-      "     * dart frame corresponding to StackFrame.frameCount"
-      "     * dart frame corresponding to StackFrame2Test.noSuchMethod"
-      "     * frame for instance function invocation stub calling noSuchMethod"
-      "     * dart frame corresponding to StackFrame2Test.testMain"
-      "     * entry frame"
-      "     */"
-      "    StackFrame.equals(6, StackFrame.frameCount());"
-      "    StackFrame.equals(4, StackFrame.dartFrameCount());"
-      "    StackFrame.validateFrame(0, \"StackFrame_validateFrame\");"
-      "    StackFrame.validateFrame(1, \"StackFrame2Test_noSuchMethod\");"
-      "    StackFrame.validateFrame(2, \"StackFrame2Test_foo\");"
-      "    StackFrame.validateFrame(3, \"StackFrame2Test_testMain\");"
-      "    return 5;"
-      "  }"
-      "  static testMain() {"
-      "    var obj = new StackFrame2Test();"
-      "    StackFrame.equals(5, obj.foo(101, 202));"
-      "  }"
-      "}";
+        "class StackFrame {"
+        "  static equals(var obj1, var obj2) native \"StackFrame_equals\";"
+        "  static int frameCount() native \"StackFrame_frameCount\";"
+        "  static int dartFrameCount() native \"StackFrame_dartFrameCount\";"
+        "  static validateFrame(int index,"
+        "                       String name) native "
+        "\"StackFrame_validateFrame\";"
+        "} "
+        "class StackFrame2Test {"
+        "  StackFrame2Test() {}"
+        "  noSuchMethod(Invocation im) {"
+        "    /* We should have 6 general frames and 4 dart frames as follows:"
+        "     * exit frame"
+        "     * dart frame corresponding to StackFrame.frameCount"
+        "     * dart frame corresponding to StackFrame2Test.noSuchMethod"
+        "     * frame for instance function invocation stub calling "
+        "noSuchMethod"
+        "     * dart frame corresponding to StackFrame2Test.testMain"
+        "     * entry frame"
+        "     */"
+        "    StackFrame.equals(6, StackFrame.frameCount());"
+        "    StackFrame.equals(4, StackFrame.dartFrameCount());"
+        "    StackFrame.validateFrame(0, \"StackFrame_validateFrame\");"
+        "    StackFrame.validateFrame(1, \"StackFrame2Test_noSuchMethod\");"
+        "    StackFrame.validateFrame(2, \"StackFrame2Test_foo\");"
+        "    StackFrame.validateFrame(3, \"StackFrame2Test_testMain\");"
+        "    return 5;"
+        "  }"
+        "  static testMain() {"
+        "    var obj = new StackFrame2Test();"
+        "    StackFrame.equals(5, obj.foo(101, 202));"
+        "  }"
+        "}";
   } else {
     kScriptChars =
-      "class StackFrame {"
-      "  static equals(var obj1, var obj2) native \"StackFrame_equals\";"
-      "  static int frameCount() native \"StackFrame_frameCount\";"
-      "  static int dartFrameCount() native \"StackFrame_dartFrameCount\";"
-      "  static validateFrame(int index,"
-      "                       String name) native \"StackFrame_validateFrame\";"
-      "} "
-      "class StackFrame2Test {"
-      "  StackFrame2Test() {}"
-      "  noSuchMethod(Invocation im) {"
-      "    /* We should have 8 general frames and 3 dart frames as follows:"
-      "     * exit frame"
-      "     * dart frame corresponding to StackFrame.frameCount"
-      "     * dart frame corresponding to StackFrame2Test.noSuchMethod"
-      "     * entry frame"
-      "     * exit frame (call to runtime InvokeNoSuchMethodDispatcher)"
-      "     * IC stub"
-      "     * dart frame corresponding to StackFrame2Test.testMain"
-      "     * entry frame"
-      "     */"
-      "    StackFrame.equals(8, StackFrame.frameCount());"
-      "    StackFrame.equals(3, StackFrame.dartFrameCount());"
-      "    StackFrame.validateFrame(0, \"StackFrame_validateFrame\");"
-      "    StackFrame.validateFrame(1, \"StackFrame2Test_noSuchMethod\");"
-      "    StackFrame.validateFrame(2, \"StackFrame2Test_testMain\");"
-      "    return 5;"
-      "  }"
-      "  static testMain() {"
-      "    var obj = new StackFrame2Test();"
-      "    StackFrame.equals(5, obj.foo(101, 202));"
-      "  }"
-      "}";
+        "class StackFrame {"
+        "  static equals(var obj1, var obj2) native \"StackFrame_equals\";"
+        "  static int frameCount() native \"StackFrame_frameCount\";"
+        "  static int dartFrameCount() native \"StackFrame_dartFrameCount\";"
+        "  static validateFrame(int index,"
+        "                       String name) native "
+        "\"StackFrame_validateFrame\";"
+        "} "
+        "class StackFrame2Test {"
+        "  StackFrame2Test() {}"
+        "  noSuchMethod(Invocation im) {"
+        "    /* We should have 8 general frames and 3 dart frames as follows:"
+        "     * exit frame"
+        "     * dart frame corresponding to StackFrame.frameCount"
+        "     * dart frame corresponding to StackFrame2Test.noSuchMethod"
+        "     * entry frame"
+        "     * exit frame (call to runtime InvokeNoSuchMethodDispatcher)"
+        "     * IC stub"
+        "     * dart frame corresponding to StackFrame2Test.testMain"
+        "     * entry frame"
+        "     */"
+        "    StackFrame.equals(8, StackFrame.frameCount());"
+        "    StackFrame.equals(3, StackFrame.dartFrameCount());"
+        "    StackFrame.validateFrame(0, \"StackFrame_validateFrame\");"
+        "    StackFrame.validateFrame(1, \"StackFrame2Test_noSuchMethod\");"
+        "    StackFrame.validateFrame(2, \"StackFrame2Test_testMain\");"
+        "    return 5;"
+        "  }"
+        "  static testMain() {"
+        "    var obj = new StackFrame2Test();"
+        "    StackFrame.equals(5, obj.foo(101, 202));"
+        "  }"
+        "}";
   }
   Dart_Handle lib = TestCase::LoadTestScript(
-      kScriptChars,
-      reinterpret_cast<Dart_NativeEntryResolver>(native_lookup));
+      kScriptChars, reinterpret_cast<Dart_NativeEntryResolver>(native_lookup));
   Dart_Handle cls = Dart_GetClass(lib, NewString("StackFrame2Test"));
   EXPECT_VALID(Dart_Invoke(cls, NewString("testMain"), 0, NULL));
 }
diff --git a/runtime/vm/stack_frame_x64.h b/runtime/vm/stack_frame_x64.h
index 8fc20a4..1ff4ba0 100644
--- a/runtime/vm/stack_frame_x64.h
+++ b/runtime/vm/stack_frame_x64.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_STACK_FRAME_X64_H_
-#define VM_STACK_FRAME_X64_H_
+#ifndef RUNTIME_VM_STACK_FRAME_X64_H_
+#define RUNTIME_VM_STACK_FRAME_X64_H_
 
 namespace dart {
 
@@ -53,4 +53,4 @@
 
 }  // namespace dart
 
-#endif  // VM_STACK_FRAME_X64_H_
+#endif  // RUNTIME_VM_STACK_FRAME_X64_H_
diff --git a/runtime/vm/store_buffer.cc b/runtime/vm/store_buffer.cc
index 67f0fcb..95e6f96 100644
--- a/runtime/vm/store_buffer.cc
+++ b/runtime/vm/store_buffer.cc
@@ -15,40 +15,39 @@
 }
 END_LEAF_RUNTIME_ENTRY
 
-template<int BlockSize>
-typename BlockStack<BlockSize>::List*
-BlockStack<BlockSize>::global_empty_ = NULL;
-template<int BlockSize>
+template <int BlockSize>
+typename BlockStack<BlockSize>::List* BlockStack<BlockSize>::global_empty_ =
+    NULL;
+template <int BlockSize>
 Mutex* BlockStack<BlockSize>::global_mutex_ = NULL;
 
 
-template<int BlockSize>
+template <int BlockSize>
 void BlockStack<BlockSize>::InitOnce() {
   global_empty_ = new List();
   global_mutex_ = new Mutex();
 }
 
 
-template<int BlockSize>
+template <int BlockSize>
 void BlockStack<BlockSize>::ShutDown() {
   delete global_empty_;
   delete global_mutex_;
 }
 
 
-template<int BlockSize>
-BlockStack<BlockSize>::BlockStack() : mutex_(new Mutex()) {
-}
+template <int BlockSize>
+BlockStack<BlockSize>::BlockStack() : mutex_(new Mutex()) {}
 
 
-template<int BlockSize>
+template <int BlockSize>
 BlockStack<BlockSize>::~BlockStack() {
   Reset();
   delete mutex_;
 }
 
 
-template<int BlockSize>
+template <int BlockSize>
 void BlockStack<BlockSize>::Reset() {
   MutexLocker local_mutex_locker(mutex_);
   {
@@ -69,7 +68,7 @@
 }
 
 
-template<int BlockSize>
+template <int BlockSize>
 typename BlockStack<BlockSize>::Block* BlockStack<BlockSize>::Blocks() {
   MutexLocker ml(mutex_);
   while (!partial_.IsEmpty()) {
@@ -79,7 +78,7 @@
 }
 
 
-template<int BlockSize>
+template <int BlockSize>
 void BlockStack<BlockSize>::PushBlockImpl(Block* block) {
   ASSERT(block->next() == NULL);  // Should be just a single block.
   if (block->IsFull()) {
@@ -110,7 +109,7 @@
 }
 
 
-template<int BlockSize>
+template <int BlockSize>
 typename BlockStack<BlockSize>::Block*
 BlockStack<BlockSize>::PopNonFullBlock() {
   {
@@ -123,7 +122,7 @@
 }
 
 
-template<int BlockSize>
+template <int BlockSize>
 typename BlockStack<BlockSize>::Block* BlockStack<BlockSize>::PopEmptyBlock() {
   {
     MutexLocker ml(global_mutex_);
@@ -135,7 +134,7 @@
 }
 
 
-template<int BlockSize>
+template <int BlockSize>
 typename BlockStack<BlockSize>::Block*
 BlockStack<BlockSize>::PopNonEmptyBlock() {
   MutexLocker ml(mutex_);
@@ -149,14 +148,14 @@
 }
 
 
-template<int BlockSize>
+template <int BlockSize>
 bool BlockStack<BlockSize>::IsEmpty() {
   MutexLocker ml(mutex_);
   return full_.IsEmpty() && partial_.IsEmpty();
 }
 
 
-template<int BlockSize>
+template <int BlockSize>
 BlockStack<BlockSize>::List::~List() {
   while (!IsEmpty()) {
     delete Pop();
@@ -164,7 +163,7 @@
 }
 
 
-template<int BlockSize>
+template <int BlockSize>
 typename BlockStack<BlockSize>::Block* BlockStack<BlockSize>::List::Pop() {
   Block* result = head_;
   head_ = head_->next_;
@@ -174,7 +173,7 @@
 }
 
 
-template<int BlockSize>
+template <int BlockSize>
 typename BlockStack<BlockSize>::Block* BlockStack<BlockSize>::List::PopAll() {
   Block* result = head_;
   head_ = NULL;
@@ -183,7 +182,7 @@
 }
 
 
-template<int BlockSize>
+template <int BlockSize>
 void BlockStack<BlockSize>::List::Push(Block* block) {
   ASSERT(block->next_ == NULL);
   block->next_ = head_;
@@ -198,7 +197,7 @@
 }
 
 
-template<int BlockSize>
+template <int BlockSize>
 void BlockStack<BlockSize>::TrimGlobalEmpty() {
   DEBUG_ASSERT(global_mutex_->IsOwnedByCurrentThread());
   while (global_empty_->length() > kMaxGlobalEmpty) {
diff --git a/runtime/vm/store_buffer.h b/runtime/vm/store_buffer.h
index 2fce2d6..45a0957 100644
--- a/runtime/vm/store_buffer.h
+++ b/runtime/vm/store_buffer.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_STORE_BUFFER_H_
-#define VM_STORE_BUFFER_H_
+#ifndef RUNTIME_VM_STORE_BUFFER_H_
+#define RUNTIME_VM_STORE_BUFFER_H_
 
 #include "platform/assert.h"
 #include "vm/globals.h"
@@ -16,7 +16,7 @@
 class RawObject;
 
 // A set of RawObject*. Must be emptied before destruction (using Pop/Reset).
-template<int Size>
+template <int Size>
 class PointerBlock {
  public:
   enum { kSize = Size };
@@ -68,7 +68,8 @@
   int32_t top_;
   RawObject* pointers_[kSize];
 
-  template<int> friend class BlockStack;
+  template <int>
+  friend class BlockStack;
 
   DISALLOW_COPY_AND_ASSIGN(PointerBlock);
 };
@@ -77,7 +78,7 @@
 // A synchronized collection of pointer blocks of a particular size.
 // This class is meant to be used as a base (note PushBlockImpl is protected).
 // The global list of cached empty blocks is currently per-size.
-template<int BlockSize>
+template <int BlockSize>
 class BlockStack {
  public:
   typedef PointerBlock<BlockSize> Block;
@@ -112,6 +113,7 @@
     intptr_t length() const { return length_; }
     bool IsEmpty() const { return head_ == NULL; }
     Block* PopAll();
+
    private:
     Block* head_;
     intptr_t length_;
@@ -144,10 +146,7 @@
   // Interrupt when crossing this threshold of non-empty blocks in the buffer.
   static const intptr_t kMaxNonEmpty = 100;
 
-  enum ThresholdPolicy {
-    kCheckThreshold,
-    kIgnoreThreshold
-  };
+  enum ThresholdPolicy { kCheckThreshold, kIgnoreThreshold };
 
   // Adds and transfers ownership of the block to the buffer. Optionally
   // checks the number of non-empty blocks for overflow, and schedules an
@@ -175,4 +174,4 @@
 
 }  // namespace dart
 
-#endif  // VM_STORE_BUFFER_H_
+#endif  // RUNTIME_VM_STORE_BUFFER_H_
diff --git a/runtime/vm/stub_code.cc b/runtime/vm/stub_code.cc
index f0eaf6d..5b6a5f5 100644
--- a/runtime/vm/stub_code.cc
+++ b/runtime/vm/stub_code.cc
@@ -20,8 +20,7 @@
 
 DEFINE_FLAG(bool, disassemble_stubs, false, "Disassemble generated stubs.");
 
-#define STUB_CODE_DECLARE(name)                                                \
-  StubEntry* StubCode::name##_entry_ = NULL;
+#define STUB_CODE_DECLARE(name) StubEntry* StubCode::name##_entry_ = NULL;
 VM_STUB_CODE_LIST(STUB_CODE_DECLARE);
 #undef STUB_CODE_DECLARE
 
@@ -31,8 +30,7 @@
       entry_point_(code.UncheckedEntryPoint()),
       checked_entry_point_(code.CheckedEntryPoint()),
       size_(code.Size()),
-      label_(code.UncheckedEntryPoint()) {
-}
+      label_(code.UncheckedEntryPoint()) {}
 
 
 // Visit all object pointers.
@@ -43,7 +41,7 @@
 
 
 #define STUB_CODE_GENERATE(name)                                               \
-  code ^= Generate("_stub_"#name, StubCode::Generate##name##Stub);             \
+  code ^= Generate("_stub_" #name, StubCode::Generate##name##Stub);            \
   name##_entry_ = new StubEntry(code);
 
 
@@ -62,16 +60,14 @@
 
 
 void StubCode::Push(Serializer* serializer) {
-#define WRITE_STUB(name)                                                       \
-  serializer->Push(StubCode::name##_entry()->code());
+#define WRITE_STUB(name) serializer->Push(StubCode::name##_entry()->code());
   VM_STUB_CODE_LIST(WRITE_STUB);
 #undef WRITE_STUB
 }
 
 
 void StubCode::WriteRef(Serializer* serializer) {
-#define WRITE_STUB(name)                                                       \
-  serializer->WriteRef(StubCode::name##_entry()->code());
+#define WRITE_STUB(name) serializer->WriteRef(StubCode::name##_entry()->code());
   VM_STUB_CODE_LIST(WRITE_STUB);
 #undef WRITE_STUB
 }
@@ -87,18 +83,16 @@
 }
 
 
-
-void StubCode::Init(Isolate* isolate) { }
+void StubCode::Init(Isolate* isolate) {}
 
 
-void StubCode::VisitObjectPointers(ObjectPointerVisitor* visitor) {
-}
+void StubCode::VisitObjectPointers(ObjectPointerVisitor* visitor) {}
 
 
 bool StubCode::HasBeenInitialized() {
 #if !defined(TARGET_ARCH_DBC)
-  // Use JumpToExceptionHandler and InvokeDart as canaries.
-  const StubEntry* entry_1 = StubCode::JumpToExceptionHandler_entry();
+  // Use JumpToHandler and InvokeDart as canaries.
+  const StubEntry* entry_1 = StubCode::JumpToFrame_entry();
   const StubEntry* entry_2 = StubCode::InvokeDartCode_entry();
   return (entry_1 != NULL) && (entry_2 != NULL);
 #else
@@ -121,11 +115,11 @@
 }
 
 
-bool StubCode::InJumpToExceptionHandlerStub(uword pc) {
+bool StubCode::InJumpToFrameStub(uword pc) {
 #if !defined(TARGET_ARCH_DBC)
   ASSERT(HasBeenInitialized());
-  uword entry = StubCode::JumpToExceptionHandler_entry()->EntryPoint();
-  uword size = StubCode::JumpToExceptionHandlerSize();
+  uword entry = StubCode::JumpToFrame_entry()->EntryPoint();
+  uword size = StubCode::JumpToFrameSize();
   return (pc >= entry) && (pc < (entry + size));
 #else
   // This stub does not exist on DBC.
@@ -135,7 +129,7 @@
 
 
 RawCode* StubCode::GetAllocationStubForClass(const Class& cls) {
-  // These stubs are not used by DBC.
+// These stubs are not used by DBC.
 #if !defined(TARGET_ARCH_DBC)
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
@@ -205,7 +199,7 @@
 
 const StubEntry* StubCode::UnoptimizedStaticCallEntry(
     intptr_t num_args_tested) {
-  // These stubs are not used by DBC.
+// These stubs are not used by DBC.
 #if !defined(TARGET_ARCH_DBC)
   switch (num_args_tested) {
     case 0:
@@ -228,8 +222,8 @@
                             void (*GenerateStub)(Assembler* assembler)) {
   Assembler assembler;
   GenerateStub(&assembler);
-  const Code& code = Code::Handle(
-      Code::FinalizeCode(name, &assembler, false /* optimized */));
+  const Code& code =
+      Code::Handle(Code::FinalizeCode(name, &assembler, false /* optimized */));
 #ifndef PRODUCT
   if (FLAG_support_disassembler && FLAG_disassemble_stubs) {
     LogBlock lb;
@@ -249,7 +243,7 @@
 #define VM_STUB_CODE_TESTER(name)                                              \
   if ((name##_entry() != NULL) &&                                              \
       (entry_point == name##_entry()->EntryPoint())) {                         \
-    return ""#name;                                                            \
+    return "" #name;                                                           \
   }
   VM_STUB_CODE_LIST(VM_STUB_CODE_TESTER);
 #undef VM_STUB_CODE_TESTER
diff --git a/runtime/vm/stub_code.h b/runtime/vm/stub_code.h
index bda3ba0..3a2cea0 100644
--- a/runtime/vm/stub_code.h
+++ b/runtime/vm/stub_code.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_STUB_CODE_H_
-#define VM_STUB_CODE_H_
+#ifndef RUNTIME_VM_STUB_CODE_H_
+#define RUNTIME_VM_STUB_CODE_H_
 
 #include "vm/allocation.h"
 #include "vm/assembler.h"
@@ -25,7 +25,8 @@
 #if !defined(TARGET_ARCH_DBC)
 #define VM_STUB_CODE_LIST(V)                                                   \
   V(GetStackPointer)                                                           \
-  V(JumpToExceptionHandler)                                                    \
+  V(JumpToFrame)                                                               \
+  V(RunExceptionHandler)                                                       \
   V(UpdateStoreBuffer)                                                         \
   V(PrintStopMessage)                                                          \
   V(CallToRuntime)                                                             \
@@ -67,16 +68,18 @@
   V(Subtype2TestCache)                                                         \
   V(Subtype3TestCache)                                                         \
   V(CallClosureNoSuchMethod)                                                   \
-  V(FrameAwaitingMaterialization)                                              \
+  V(FrameAwaitingMaterialization)
 
 #else
 #define VM_STUB_CODE_LIST(V)                                                   \
   V(LazyCompile)                                                               \
+  V(OptimizeFunction)                                                          \
+  V(RunExceptionHandler)                                                       \
   V(FixCallersTarget)                                                          \
   V(Deoptimize)                                                                \
   V(DeoptimizeLazyFromReturn)                                                  \
   V(DeoptimizeLazyFromThrow)                                                   \
-  V(FrameAwaitingMaterialization)                                              \
+  V(FrameAwaitingMaterialization)
 
 #endif  // !defined(TARGET_ARCH_DBC)
 
@@ -137,20 +140,16 @@
   // transitioning into dart code.
   static bool InInvocationStub(uword pc);
 
-  // Check if the specified pc is in the jump to exception handler stub.
-  static bool InJumpToExceptionHandlerStub(uword pc);
+  // Check if the specified pc is in the jump to frame stub.
+  static bool InJumpToFrameStub(uword pc);
 
   // Returns NULL if no stub found.
   static const char* NameOfStub(uword entry_point);
 
-  // Define the shared stub code accessors.
+// Define the shared stub code accessors.
 #define STUB_CODE_ACCESSOR(name)                                               \
-  static const StubEntry* name##_entry() {                                     \
-    return name##_entry_;                                                      \
-  }                                                                            \
-  static intptr_t name##Size() {                                               \
-    return name##_entry()->Size();                                             \
-  }
+  static const StubEntry* name##_entry() { return name##_entry_; }             \
+  static intptr_t name##Size() { return name##_entry()->Size(); }
   VM_STUB_CODE_LIST(STUB_CODE_ACCESSOR);
 #undef STUB_CODE_ACCESSOR
 
@@ -170,8 +169,7 @@
   VM_STUB_CODE_LIST(STUB_CODE_GENERATE);
 #undef STUB_CODE_GENERATE
 
-#define STUB_CODE_ENTRY(name)                                                  \
-  static StubEntry* name##_entry_;
+#define STUB_CODE_ENTRY(name) static StubEntry* name##_entry_;
   VM_STUB_CODE_LIST(STUB_CODE_ENTRY);
 #undef STUB_CODE_ENTRY
 
@@ -195,12 +193,8 @@
 };
 
 
-enum DeoptStubKind {
-  kLazyDeoptFromReturn,
-  kLazyDeoptFromThrow,
-  kEagerDeopt
-};
+enum DeoptStubKind { kLazyDeoptFromReturn, kLazyDeoptFromThrow, kEagerDeopt };
 
 }  // namespace dart
 
-#endif  // VM_STUB_CODE_H_
+#endif  // RUNTIME_VM_STUB_CODE_H_
diff --git a/runtime/vm/stub_code_arm.cc b/runtime/vm/stub_code_arm.cc
index 3bcf173..87b054d 100644
--- a/runtime/vm/stub_code_arm.cc
+++ b/runtime/vm/stub_code_arm.cc
@@ -23,8 +23,10 @@
 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.");
+DEFINE_FLAG(bool,
+            use_slow_path,
+            false,
+            "Set to true for debugging & verifying the slow paths.");
 DECLARE_FLAG(bool, trace_optimized_ic_calls);
 
 // Input parameters:
@@ -47,7 +49,8 @@
   __ StoreToOffset(kWord, FP, THR, Thread::top_exit_frame_info_offset());
 
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that we are always entering from Dart code.
     __ LoadFromOffset(kWord, R8, THR, Thread::vm_tag_offset());
     __ CompareImmediate(R8, VMTag::kDartTagId);
@@ -139,7 +142,8 @@
   __ StoreToOffset(kWord, FP, THR, Thread::top_exit_frame_info_offset());
 
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that we are always entering from Dart code.
     __ LoadFromOffset(kWord, R8, THR, Thread::vm_tag_offset());
     __ CompareImmediate(R8, VMTag::kDartTagId);
@@ -179,7 +183,7 @@
   // Passing the structure by value as in runtime calls would require changing
   // Dart API for native functions.
   // For now, space is reserved on the stack and we pass a pointer to it.
-  __ stm(IA, SP,  (1 << R0) | (1 << R1) | (1 << R2) | (1 << R3));
+  __ stm(IA, SP, (1 << R0) | (1 << R1) | (1 << R2) | (1 << R3));
   __ mov(R0, Operand(SP));  // Pass the pointer to the NativeArguments.
 
   __ mov(R1, Operand(R9));  // Pass the function entrypoint to call.
@@ -220,7 +224,8 @@
   __ StoreToOffset(kWord, FP, THR, Thread::top_exit_frame_info_offset());
 
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that we are always entering from Dart code.
     __ LoadFromOffset(kWord, R8, THR, Thread::vm_tag_offset());
     __ CompareImmediate(R8, VMTag::kDartTagId);
@@ -260,7 +265,7 @@
   // Passing the structure by value as in runtime calls would require changing
   // Dart API for native functions.
   // For now, space is reserved on the stack and we pass a pointer to it.
-  __ stm(IA, SP,  (1 << R0) | (1 << R1) | (1 << R2) | (1 << R3));
+  __ stm(IA, SP, (1 << R0) | (1 << R1) | (1 << R2) | (1 << R3));
   __ mov(R0, Operand(SP));  // Pass the pointer to the NativeArguments.
 
   // Call native function or redirection via simulator.
@@ -463,8 +468,8 @@
   }
 
   __ mov(R0, Operand(SP));  // Pass address of saved registers block.
-  bool is_lazy = (kind == kLazyDeoptFromReturn) ||
-                 (kind == kLazyDeoptFromThrow);
+  bool is_lazy =
+      (kind == kLazyDeoptFromReturn) || (kind == kLazyDeoptFromThrow);
   __ mov(R1, Operand(is_lazy ? 1 : 0));
   __ ReserveAlignedFrameSpace(0);
   __ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry, 2);
@@ -522,7 +527,7 @@
   __ CallRuntime(kDeoptimizeMaterializeRuntimeEntry, 0);
   // Result tells stub how many bytes to remove from the expression stack
   // of the bottom-most frame. They were used as materialization arguments.
-  __ Pop(R1);
+  __ Pop(R2);
   if (kind == kLazyDeoptFromReturn) {
     __ Pop(R0);  // Restore result.
   } else if (kind == kLazyDeoptFromThrow) {
@@ -531,34 +536,32 @@
   }
   __ LeaveStubFrame();
   // Remove materialization arguments.
-  __ add(SP, SP, Operand(R1, ASR, kSmiTagSize));
+  __ add(SP, SP, Operand(R2, ASR, kSmiTagSize));
   __ Ret();
 }
 
 
-// LR: return address + call-instruction-size
 // R0: result, must be preserved
 void StubCode::GenerateDeoptimizeLazyFromReturnStub(Assembler* assembler) {
-  // Correct return address to point just after the call that is being
-  // deoptimized.
-  __ AddImmediate(LR, -CallPattern::DeoptCallPatternLengthInBytes());
   // Push zap value instead of CODE_REG for lazy deopt.
   __ LoadImmediate(IP, 0xf1f1f1f1);
   __ Push(IP);
+  // Return address for "call" to deopt stub.
+  __ LoadImmediate(LR, 0xe1e1e1e1);
+  __ ldr(CODE_REG, Address(THR, Thread::lazy_deopt_from_return_stub_offset()));
   GenerateDeoptimizationSequence(assembler, kLazyDeoptFromReturn);
 }
 
 
-// LR: return address + call-instruction-size
 // R0: exception, must be preserved
 // R1: stacktrace, must be preserved
 void StubCode::GenerateDeoptimizeLazyFromThrowStub(Assembler* assembler) {
-  // Correct return address to point just after the call that is being
-  // deoptimized.
-  __ AddImmediate(LR, -CallPattern::DeoptCallPatternLengthInBytes());
   // Push zap value instead of CODE_REG for lazy deopt.
   __ LoadImmediate(IP, 0xf1f1f1f1);
   __ Push(IP);
+  // Return address for "call" to deopt stub.
+  __ LoadImmediate(LR, 0xe1e1e1e1);
+  __ ldr(CODE_REG, Address(THR, Thread::lazy_deopt_from_throw_stub_offset()));
   GenerateDeoptimizationSequence(assembler, kLazyDeoptFromThrow);
 }
 
@@ -647,7 +650,7 @@
   // Compute the size to be allocated, it is based on the array length
   // and is computed as:
   // RoundedAllocationSize((array_length * kwordSize) + sizeof(RawArray)).
-  __ MoveRegister(R3, R2);   // Array length.
+  __ MoveRegister(R3, R2);  // Array length.
   // Check that length is a positive Smi.
   __ tst(R3, Operand(kSmiTagMask));
   if (FLAG_use_slow_path) {
@@ -675,12 +678,11 @@
 
   // R9: Allocation size.
   Heap::Space space = Heap::kNew;
-  __ LoadIsolate(R8);
-  __ ldr(R8, Address(R8, Isolate::heap_offset()));
+  __ ldr(R8, Address(THR, Thread::heap_offset()));
   // Potential new object start.
   __ ldr(R0, Address(R8, Heap::TopOffset(space)));
   __ adds(NOTFP, R0, Operand(R9));  // Potential next object start.
-  __ b(&slow_case, CS);  // Branch if unsigned overflow.
+  __ b(&slow_case, CS);             // Branch if unsigned overflow.
 
   // Check if the allocation fits into the remaining space.
   // R0: potential new object start.
@@ -718,14 +720,11 @@
   // R0: new object start as a tagged pointer.
   // NOTFP: new object end address.
   // Store the type argument field.
-  __ StoreIntoObjectNoBarrier(R0,
-                              FieldAddress(R0, Array::type_arguments_offset()),
-                              R1);
+  __ StoreIntoObjectNoBarrier(
+      R0, FieldAddress(R0, Array::type_arguments_offset()), R1);
 
   // Set the length field.
-  __ StoreIntoObjectNoBarrier(R0,
-                              FieldAddress(R0, Array::length_offset()),
-                              R2);
+  __ StoreIntoObjectNoBarrier(R0, FieldAddress(R0, Array::length_offset()), R2);
 
   // Initialize all array elements to raw_null.
   // R0: new object start as a tagged pointer.
@@ -904,8 +903,7 @@
     // R2: object size.
     const intptr_t cid = kContextCid;
     Heap::Space space = Heap::kNew;
-    __ LoadIsolate(R9);
-    __ ldr(R9, Address(R9, Isolate::heap_offset()));
+    __ ldr(R9, Address(THR, Thread::heap_offset()));
     __ ldr(R0, Address(R9, Heap::TopOffset(space)));
     __ add(R3, R2, Operand(R0));
     // Check if the allocation fits into the remaining space.
@@ -1025,7 +1023,7 @@
   __ Bind(&add_to_buffer);
   // R2: Header word.
   if (TargetCPUFeatures::arm_version() == ARMv5TE) {
-    // TODO(21263): Implement 'swp' and use it below.
+// TODO(21263): Implement 'swp' and use it below.
 #if !defined(USING_SIMULATOR)
     ASSERT(OS::NumberOfAvailableProcessors() <= 1);
 #endif
@@ -1151,8 +1149,8 @@
       if ((end_offset - begin_offset) >= (2 * kWordSize)) {
         __ mov(R3, Operand(R2));
       }
-      __ InitializeFieldsNoBarrierUnrolled(R0, R0, begin_offset, end_offset,
-                                           R2, R3);
+      __ InitializeFieldsNoBarrierUnrolled(R0, R0, begin_offset, end_offset, R2,
+                                           R3);
     } else {
       // There are more than kInlineInstanceSize(12) fields
       __ add(R4, R0, Operand(Instance::NextFieldOffset() - kHeapObjectTag));
@@ -1195,7 +1193,7 @@
   // calling into the runtime.
   __ EnterStubFrame();  // Uses pool pointer to pass cls to runtime.
   __ LoadObject(R2, Object::null_object());
-  __ Push(R2);  // Setup space on stack for return value.
+  __ 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.
@@ -1205,7 +1203,7 @@
     __ Push(R2);
   }
   __ CallRuntime(kAllocateObjectRuntimeEntry, 2);  // Allocate object.
-  __ Drop(2);  // Pop arguments.
+  __ Drop(2);                                      // Pop arguments.
   __ Pop(R0);  // Pop result (newly allocated object).
   // R0: new object
   // Restore the frame pointer.
@@ -1255,10 +1253,10 @@
   if (FLAG_trace_optimized_ic_calls) {
     __ EnterStubFrame();
     __ PushList((1 << R9) | (1 << R8));  // Preserve.
-    __ Push(ic_reg);  // Argument.
-    __ Push(func_reg);  // Argument.
+    __ Push(ic_reg);                     // Argument.
+    __ Push(func_reg);                   // Argument.
     __ CallRuntime(kTraceICCallRuntimeEntry, 2);
-    __ Drop(2);  // Discard argument;
+    __ Drop(2);                         // Discard argument;
     __ PopList((1 << R9) | (1 << R8));  // Restore.
     __ LeaveStubFrame();
   }
@@ -1300,12 +1298,12 @@
   __ b(not_smi_or_overflow, NE);
   switch (kind) {
     case Token::kADD: {
-      __ adds(R0, R1, Operand(R0));  // Adds.
+      __ adds(R0, R1, Operand(R0));   // Adds.
       __ b(not_smi_or_overflow, VS);  // Branch if overflow.
       break;
     }
     case Token::kSUB: {
-      __ subs(R0, R1, Operand(R0));  // Subtract.
+      __ subs(R0, R1, Operand(R0));   // Subtract.
       __ b(not_smi_or_overflow, VS);  // Branch if overflow.
       break;
     }
@@ -1315,13 +1313,14 @@
       __ LoadObject(R0, Bool::False(), NE);
       break;
     }
-    default: UNIMPLEMENTED();
+    default:
+      UNIMPLEMENTED();
   }
   // R9: IC data object (preserved).
   __ ldr(R8, FieldAddress(R9, ICData::ic_data_offset()));
   // R8: ic_data_array with check entries: classes and target functions.
   __ AddImmediate(R8, R8, Array::data_offset() - kHeapObjectTag);
-  // R8: points directly to the first ic data array element.
+// R8: points directly to the first ic data array element.
 #if defined(DEBUG)
   // Check that first entry is for Smi/Smi.
   Label error, ok;
@@ -1367,7 +1366,8 @@
   __ CheckCodePointer();
   ASSERT(num_args > 0);
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that the IC data array has NumArgsTested() == num_args.
     // 'NumArgsTested' is stored in the least significant bits of 'state_bits'.
     __ ldr(R8, FieldAddress(R9, ICData::state_bits_offset()));
@@ -1447,7 +1447,7 @@
 
   const intptr_t entry_size = ICData::TestEntryLengthFor(num_args) * kWordSize;
   __ AddImmediate(R8, entry_size);  // Next entry.
-  __ ldr(R1, Address(R8, 0));  // Next class ID.
+  __ ldr(R1, Address(R8, 0));       // Next class ID.
 
   __ Bind(&test);
   __ CompareImmediate(R1, Smi::RawValue(kIllegalCid));  // Done?
@@ -1533,42 +1533,37 @@
 //   - 1 target function.
 void StubCode::GenerateOneArgCheckInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, R8);
-  GenerateNArgsCheckInlineCacheStub(assembler,
-      1,
-      kInlineCacheMissHandlerOneArgRuntimeEntry,
-      Token::kILLEGAL);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 1, kInlineCacheMissHandlerOneArgRuntimeEntry, Token::kILLEGAL);
 }
 
 
 void StubCode::GenerateTwoArgsCheckInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, R8);
-  GenerateNArgsCheckInlineCacheStub(assembler,
-      2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry,
-      Token::kILLEGAL);
+  GenerateNArgsCheckInlineCacheStub(assembler, 2,
+                                    kInlineCacheMissHandlerTwoArgsRuntimeEntry,
+                                    Token::kILLEGAL);
 }
 
 
 void StubCode::GenerateSmiAddInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, R8);
-  GenerateNArgsCheckInlineCacheStub(assembler,
-      2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry,
-      Token::kADD);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 2, kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kADD);
 }
 
 
 void StubCode::GenerateSmiSubInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, R8);
-  GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kSUB);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 2, kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kSUB);
 }
 
 
 void StubCode::GenerateSmiEqualInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, R8);
-  GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kEQ);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 2, kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kEQ);
 }
 
 
@@ -1576,8 +1571,8 @@
     Assembler* assembler) {
   GenerateOptimizedUsageCounterIncrement(assembler);
   GenerateNArgsCheckInlineCacheStub(assembler, 1,
-      kInlineCacheMissHandlerOneArgRuntimeEntry, Token::kILLEGAL,
-      true /* optimized */);
+                                    kInlineCacheMissHandlerOneArgRuntimeEntry,
+                                    Token::kILLEGAL, true /* optimized */);
 }
 
 
@@ -1585,8 +1580,8 @@
     Assembler* assembler) {
   GenerateOptimizedUsageCounterIncrement(assembler);
   GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kILLEGAL,
-      true /* optimized */);
+                                    kInlineCacheMissHandlerTwoArgsRuntimeEntry,
+                                    Token::kILLEGAL, true /* optimized */);
 }
 
 
@@ -1596,7 +1591,8 @@
 void StubCode::GenerateZeroArgsUnoptimizedStaticCallStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, R8);
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that the IC data array has NumArgsTested() == 0.
     // 'NumArgsTested' is stored in the least significant bits of 'state_bits'.
     __ ldr(R8, FieldAddress(R9, ICData::state_bits_offset()));
@@ -1666,8 +1662,8 @@
 
 void StubCode::GenerateTwoArgsUnoptimizedStaticCallStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, R8);
-  GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kStaticCallMissHandlerTwoArgsRuntimeEntry, Token::kILLEGAL);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 2, kStaticCallMissHandlerTwoArgsRuntimeEntry, Token::kILLEGAL);
 }
 
 
@@ -1681,7 +1677,7 @@
   __ PushList((1 << R4) | (1 << R9));
   __ Push(R0);  // Pass function.
   __ CallRuntime(kCompileFunctionRuntimeEntry, 1);
-  __ Pop(R0);  // Restore argument.
+  __ Pop(R0);                         // Restore argument.
   __ PopList((1 << R4) | (1 << R9));  // Restore arg desc. and IC data.
   __ LeaveStubFrame();
 
@@ -1720,8 +1716,7 @@
 
 
 // Called only from unoptimized code. All relevant registers have been saved.
-void StubCode::GenerateDebugStepCheckStub(
-    Assembler* assembler) {
+void StubCode::GenerateDebugStepCheckStub(Assembler* assembler) {
   // Check single stepping.
   Label stepping, done_stepping;
   __ LoadIsolate(R1);
@@ -1753,8 +1748,8 @@
     // Compute instance type arguments into R4.
     Label has_no_type_arguments;
     __ LoadObject(R4, Object::null_object());
-    __ ldr(R9, FieldAddress(R3,
-        Class::type_arguments_field_offset_in_words_offset()));
+    __ ldr(R9, FieldAddress(
+                   R3, Class::type_arguments_field_offset_in_words_offset()));
     __ CompareImmediate(R9, Class::kNoTypeArguments);
     __ b(&has_no_type_arguments, EQ);
     __ add(R9, R0, Operand(R9, LSL, 2));
@@ -1796,7 +1791,7 @@
     } else {
       __ b(&next_iteration, NE);
       __ ldr(R9, Address(R2, kWordSize *
-                             SubtypeTestCache::kInstantiatorTypeArguments));
+                                 SubtypeTestCache::kInstantiatorTypeArguments));
       __ cmp(R9, Operand(R1));
       __ b(&found, EQ);
     }
@@ -1855,25 +1850,21 @@
 }
 
 
-// Jump to the exception or error handler.
+// Jump to a frame on the call stack.
 // LR: return address.
 // R0: program_counter.
 // R1: stack_pointer.
 // R2: frame_pointer.
-// R3: error object.
-// SP + 0: address of stacktrace object.
-// SP + 4: thread.
+// R3: thread.
 // Does not return.
-void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) {
+void StubCode::GenerateJumpToFrameStub(Assembler* assembler) {
   ASSERT(kExceptionObjectReg == R0);
   ASSERT(kStackTraceObjectReg == R1);
-  __ mov(IP, Operand(R1));  // Copy Stack pointer into IP.
-  __ mov(LR, Operand(R0));  // Program counter.
-  __ mov(R0, Operand(R3));  // Exception object.
-  __ ldr(R1, Address(SP, 0));  // StackTrace object.
-  __ ldr(THR, Address(SP, 4));  // Thread.
-  __ mov(FP, Operand(R2));  // Frame_pointer.
-  __ mov(SP, Operand(IP));  // Set Stack pointer.
+  __ mov(IP, Operand(R1));      // Copy Stack pointer into IP.
+  __ mov(LR, Operand(R0));      // Program counter.
+  __ mov(THR, Operand(R3));     // Thread.
+  __ mov(FP, Operand(R2));      // Frame_pointer.
+  __ mov(SP, Operand(IP));      // Set Stack pointer.
   // Set the tag.
   __ LoadImmediate(R2, VMTag::kDartTagId);
   __ StoreToOffset(kWord, R2, THR, Thread::vm_tag_offset());
@@ -1883,6 +1874,27 @@
   // Restore the pool pointer.
   __ RestoreCodePointer();
   __ LoadPoolPointer();
+  __ bx(LR);  // Jump to continuation point.
+}
+
+
+// Run an exception handler.  Execution comes from JumpToFrame
+// stub or from the simulator.
+//
+// The arguments are stored in the Thread object.
+// Does not return.
+void StubCode::GenerateRunExceptionHandlerStub(Assembler* assembler) {
+  __ LoadFromOffset(kWord, LR, THR, Thread::resume_pc_offset());
+  __ LoadImmediate(R2, 0);
+
+  // Exception object.
+  __ LoadFromOffset(kWord, R0, THR, Thread::active_exception_offset());
+  __ StoreToOffset(kWord, R2, THR, Thread::active_exception_offset());
+
+  // Stacktrace object.
+  __ LoadFromOffset(kWord, R1, THR, Thread::active_stacktrace_offset());
+  __ StoreToOffset(kWord, R2, THR, Thread::active_stacktrace_offset());
+
   __ bx(LR);  // Jump to the exception handler code.
 }
 
@@ -1898,12 +1910,12 @@
   __ Push(R8);
   __ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry, 1);
   __ Pop(R0);  // Discard argument.
-  __ Pop(R0);  // Get Code object
+  __ Pop(R0);  // Get Function object
   __ Pop(R4);  // Restore argument descriptor.
   __ LeaveStubFrame();
-  __ mov(CODE_REG, Operand(R0));
-  __ ldr(R0, FieldAddress(R0, Code::entry_point_offset()));
-  __ bx(R0);
+  __ ldr(CODE_REG, FieldAddress(R0, Function::code_offset()));
+  __ ldr(R1, FieldAddress(R0, Function::entry_point_offset()));
+  __ bx(R1);
   __ bkpt(0);
 }
 
@@ -1962,7 +1974,7 @@
   __ b(&done, NE);
   __ EnterStubFrame();
   __ ReserveAlignedFrameSpace(2 * kWordSize);
-  __ stm(IA, SP,  (1 << R0) | (1 << R1));
+  __ stm(IA, SP, (1 << R0) | (1 << R1));
   __ CallRuntime(kBigintCompareRuntimeEntry, 2);
   // Result in R0, 0 means equal.
   __ LeaveStubFrame();
@@ -2035,8 +2047,6 @@
 //  CODE_REG: target Code
 //  R4: arguments descriptor
 void StubCode::GenerateMegamorphicCallStub(Assembler* assembler) {
-  __ NoMonomorphicCheckedEntry();
-
   __ LoadTaggedClassIdMayBeSmi(R0, R0);
   // R0: receiver cid as Smi.
   __ ldr(R2, FieldAddress(R9, MegamorphicCache::buckets_offset()));
@@ -2092,8 +2102,6 @@
 //  CODE_REG: target Code object
 //  R4: arguments descriptor
 void StubCode::GenerateICCallThroughFunctionStub(Assembler* assembler) {
-  __ NoMonomorphicCheckedEntry();
-
   Label loop, found, miss;
   __ ldr(R4, FieldAddress(R9, ICData::arguments_descriptor_offset()));
   __ ldr(R8, FieldAddress(R9, ICData::ic_data_offset()));
@@ -2129,8 +2137,6 @@
 
 
 void StubCode::GenerateICCallThroughCodeStub(Assembler* assembler) {
-  __ NoMonomorphicCheckedEntry();
-
   Label loop, found, miss;
   __ ldr(R4, FieldAddress(R9, ICData::arguments_descriptor_offset()));
   __ ldr(R8, FieldAddress(R9, ICData::ic_data_offset()));
@@ -2169,8 +2175,6 @@
 //  R0: receiver
 //  R9: UnlinkedCall
 void StubCode::GenerateUnlinkedCallStub(Assembler* assembler) {
-  __ NoMonomorphicCheckedEntry();
-
   __ EnterStubFrame();
   __ Push(R0);  // Preserve receiver.
 
@@ -2197,10 +2201,7 @@
 // Passed to target:
 //  CODE_REG: target Code object
 void StubCode::GenerateSingleTargetCallStub(Assembler* assembler) {
-  __ NoMonomorphicCheckedEntry();
-
   Label miss;
-
   __ LoadClassIdMayBeSmi(R1, R0);
   __ ldrh(R2, FieldAddress(R9, SingleTargetCache::lower_limit_offset()));
   __ ldrh(R3, FieldAddress(R9, SingleTargetCache::upper_limit_offset()));
@@ -2237,6 +2238,7 @@
 // Called from the monomorphic checked entry.
 //  R0: receiver
 void StubCode::GenerateMonomorphicMissStub(Assembler* assembler) {
+  __ ldr(CODE_REG, Address(THR, Thread::monomorphic_miss_stub_offset()));
   __ EnterStubFrame();
   __ Push(R0);  // Preserve receiver.
 
diff --git a/runtime/vm/stub_code_arm64.cc b/runtime/vm/stub_code_arm64.cc
index 7ee3dd3..5a5a156 100644
--- a/runtime/vm/stub_code_arm64.cc
+++ b/runtime/vm/stub_code_arm64.cc
@@ -22,8 +22,10 @@
 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.");
+DEFINE_FLAG(bool,
+            use_slow_path,
+            false,
+            "Set to true for debugging & verifying the slow paths.");
 DECLARE_FLAG(bool, trace_optimized_ic_calls);
 
 // Input parameters:
@@ -48,7 +50,8 @@
   __ StoreToOffset(FP, THR, Thread::top_exit_frame_info_offset());
 
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that we are always entering from Dart code.
     __ LoadFromOffset(R8, THR, Thread::vm_tag_offset());
     __ CompareImmediate(R8, VMTag::kDartTagId);
@@ -86,7 +89,7 @@
   // Set argv in NativeArguments.
   __ AddImmediate(R2, R2, kParamEndSlotFromFp * kWordSize);
 
-    ASSERT(retval_offset == 3 * kWordSize);
+  ASSERT(retval_offset == 3 * kWordSize);
   __ AddImmediate(R3, R2, kWordSize);
 
   __ StoreToOffset(R0, SP, thread_offset);
@@ -152,7 +155,8 @@
   __ StoreToOffset(FP, THR, Thread::top_exit_frame_info_offset());
 
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that we are always entering from Dart code.
     __ LoadFromOffset(R6, THR, Thread::vm_tag_offset());
     __ CompareImmediate(R6, VMTag::kDartTagId);
@@ -245,7 +249,8 @@
   __ StoreToOffset(FP, THR, Thread::top_exit_frame_info_offset());
 
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that we are always entering from Dart code.
     __ LoadFromOffset(R6, THR, Thread::vm_tag_offset());
     __ CompareImmediate(R6, VMTag::kDartTagId);
@@ -479,8 +484,8 @@
   }
 
   __ mov(R0, SP);  // Pass address of saved registers block.
-  bool is_lazy = (kind == kLazyDeoptFromReturn) ||
-                 (kind == kLazyDeoptFromThrow);
+  bool is_lazy =
+      (kind == kLazyDeoptFromReturn) || (kind == kLazyDeoptFromThrow);
   __ LoadImmediate(R1, is_lazy ? 1 : 0);
   __ ReserveAlignedFrameSpace(0);
   __ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry, 2);
@@ -542,8 +547,8 @@
   __ CallRuntime(kDeoptimizeMaterializeRuntimeEntry, 0);
   // Result tells stub how many bytes to remove from the expression stack
   // of the bottom-most frame. They were used as materialization arguments.
-  __ Pop(R1);
-  __ SmiUntag(R1);
+  __ Pop(R2);
+  __ SmiUntag(R2);
   if (kind == kLazyDeoptFromReturn) {
     __ Pop(R0);  // Restore result.
   } else if (kind == kLazyDeoptFromThrow) {
@@ -552,34 +557,32 @@
   }
   __ LeaveStubFrame();
   // Remove materialization arguments.
-  __ add(SP, SP, Operand(R1));
+  __ add(SP, SP, Operand(R2));
   __ ret();
 }
 
 
-// LR: return address + call-instruction-size
 // R0: result, must be preserved
 void StubCode::GenerateDeoptimizeLazyFromReturnStub(Assembler* assembler) {
-  // Correct return address to point just after the call that is being
-  // deoptimized.
-  __ AddImmediate(LR, LR, -CallPattern::kDeoptCallLengthInBytes);
   // Push zap value instead of CODE_REG for lazy deopt.
   __ LoadImmediate(TMP, 0xf1f1f1f1);
   __ Push(TMP);
+  // Return address for "call" to deopt stub.
+  __ LoadImmediate(LR, 0xe1e1e1e1);
+  __ ldr(CODE_REG, Address(THR, Thread::lazy_deopt_from_return_stub_offset()));
   GenerateDeoptimizationSequence(assembler, kLazyDeoptFromReturn);
 }
 
 
-// LR: return address + call-instruction-size
 // R0: exception, must be preserved
 // R1: stacktrace, must be preserved
 void StubCode::GenerateDeoptimizeLazyFromThrowStub(Assembler* assembler) {
-  // Correct return address to point just after the call that is being
-  // deoptimized.
-  __ AddImmediate(LR, LR, -CallPattern::kDeoptCallLengthInBytes);
   // Push zap value instead of CODE_REG for lazy deopt.
   __ LoadImmediate(TMP, 0xf1f1f1f1);
   __ Push(TMP);
+  // Return address for "call" to deopt stub.
+  __ LoadImmediate(LR, 0xe1e1e1e1);
+  __ ldr(CODE_REG, Address(THR, Thread::lazy_deopt_from_throw_stub_offset()));
   GenerateDeoptimizationSequence(assembler, kLazyDeoptFromThrow);
 }
 
@@ -694,8 +697,7 @@
   NOT_IN_PRODUCT(__ MaybeTraceAllocation(kArrayCid, R4, &slow_case));
 
   Heap::Space space = Heap::kNew;
-  __ LoadIsolate(R8);
-  __ ldr(R8, Address(R8, Isolate::heap_offset()));
+  __ ldr(R8, Address(THR, Thread::heap_offset()));
 
   // Calculate and align allocation size.
   // Load new object start and calculate next object start.
@@ -741,8 +743,7 @@
   // R7: new object end address.
 
   // Store the type argument field.
-  __ StoreIntoObjectOffsetNoBarrier(
-      R0, Array::type_arguments_offset(), R1);
+  __ StoreIntoObjectOffsetNoBarrier(R0, Array::type_arguments_offset(), R1);
 
   // Set the length field.
   __ StoreIntoObjectOffsetNoBarrier(R0, Array::length_offset(), R2);
@@ -962,8 +963,7 @@
     // R2: object size.
     const intptr_t cid = kContextCid;
     Heap::Space space = Heap::kNew;
-    __ LoadIsolate(R5);
-    __ ldr(R5, Address(R5, Isolate::heap_offset()));
+    __ ldr(R5, Address(THR, Thread::heap_offset()));
     __ ldr(R0, Address(R5, Heap::TopOffset(space)));
     __ add(R3, R2, Operand(R0));
     // Check if the allocation fits into the remaining space.
@@ -1024,8 +1024,7 @@
     // R1: number of context variables.
     // R2: raw null.
     Label loop, done;
-    __ AddImmediate(
-        R3, R0, Context::variable_offset(0) - kHeapObjectTag);
+    __ AddImmediate(R3, R0, Context::variable_offset(0) - kHeapObjectTag);
     __ Bind(&loop);
     __ subs(R1, R1, Operand(1));
     __ b(&done, MI);
@@ -1188,8 +1187,7 @@
       // Check if the object contains any non-header fields.
       // Small objects are initialized using a consecutive set of writes.
       for (intptr_t current_offset = Instance::NextFieldOffset();
-           current_offset < instance_size;
-           current_offset += kWordSize) {
+           current_offset < instance_size; current_offset += kWordSize) {
         __ StoreToOffset(R0, R2, current_offset);
       }
     } else {
@@ -1228,8 +1226,8 @@
   // Create a stub frame as we are pushing some objects on the stack before
   // calling into the runtime.
   __ EnterStubFrame();  // Uses pool pointer to pass cls to runtime.
-  __ Push(ZR);  // Result slot.
-  __ PushObject(cls);  // Push class of object to be allocated.
+  __ Push(ZR);          // Result slot.
+  __ PushObject(cls);   // Push class of object to be allocated.
   if (is_cls_parameterized) {
     // Push type arguments.
     __ Push(R1);
@@ -1238,7 +1236,7 @@
     __ PushObject(Object::null_object());
   }
   __ CallRuntime(kAllocateObjectRuntimeEntry, 2);  // Allocate object.
-  __ Drop(2);  // Pop arguments.
+  __ Drop(2);                                      // Pop arguments.
   __ Pop(R0);  // Pop result (newly allocated object).
   // R0: new object
   // Restore the frame pointer.
@@ -1288,9 +1286,9 @@
   Register func_reg = R6;
   if (FLAG_trace_optimized_ic_calls) {
     __ EnterStubFrame();
-    __ Push(R6);  // Preserve.
-    __ Push(R5);  // Preserve.
-    __ Push(ic_reg);  // Argument.
+    __ Push(R6);        // Preserve.
+    __ Push(R5);        // Preserve.
+    __ Push(ic_reg);    // Argument.
     __ Push(func_reg);  // Argument.
     __ CallRuntime(kTraceICCallRuntimeEntry, 2);
     __ Drop(2);  // Discard argument;
@@ -1298,11 +1296,9 @@
     __ Pop(R6);  // Restore.
     __ LeaveStubFrame();
   }
-  __ LoadFieldFromOffset(
-      R7, func_reg, Function::usage_counter_offset(), kWord);
+  __ LoadFieldFromOffset(R7, func_reg, Function::usage_counter_offset(), kWord);
   __ add(R7, R7, Operand(1));
-  __ StoreFieldToOffset(
-      R7, func_reg, Function::usage_counter_offset(), kWord);
+  __ StoreFieldToOffset(R7, func_reg, Function::usage_counter_offset(), kWord);
 }
 
 
@@ -1315,11 +1311,11 @@
     ASSERT(temp_reg == R6);
     __ Comment("Increment function counter");
     __ LoadFieldFromOffset(func_reg, ic_reg, ICData::owner_offset());
-    __ LoadFieldFromOffset(
-        R7, func_reg, Function::usage_counter_offset(), kWord);
+    __ LoadFieldFromOffset(R7, func_reg, Function::usage_counter_offset(),
+                           kWord);
     __ AddImmediate(R7, R7, 1);
-    __ StoreFieldToOffset(
-        R7, func_reg, Function::usage_counter_offset(), kWord);
+    __ StoreFieldToOffset(R7, func_reg, Function::usage_counter_offset(),
+                          kWord);
   }
 }
 
@@ -1333,19 +1329,19 @@
                           intptr_t num_args,
                           Label* not_smi_or_overflow) {
   __ Comment("Fast Smi op");
-  __ ldr(R0, Address(SP, + 0 * kWordSize));  // Right.
-  __ ldr(R1, Address(SP, + 1 * kWordSize));  // Left.
+  __ ldr(R0, Address(SP, +0 * kWordSize));  // Right.
+  __ ldr(R1, Address(SP, +1 * kWordSize));  // Left.
   __ orr(TMP, R0, Operand(R1));
   __ tsti(TMP, Immediate(kSmiTagMask));
   __ b(not_smi_or_overflow, NE);
   switch (kind) {
     case Token::kADD: {
-      __ adds(R0, R1, Operand(R0));  // Adds.
+      __ adds(R0, R1, Operand(R0));   // Adds.
       __ b(not_smi_or_overflow, VS);  // Branch if overflow.
       break;
     }
     case Token::kSUB: {
-      __ subs(R0, R1, Operand(R0));  // Subtract.
+      __ subs(R0, R1, Operand(R0));   // Subtract.
       __ b(not_smi_or_overflow, VS);  // Branch if overflow.
       break;
     }
@@ -1356,14 +1352,15 @@
       __ csel(R0, R1, R0, NE);
       break;
     }
-    default: UNIMPLEMENTED();
+    default:
+      UNIMPLEMENTED();
   }
 
   // R5: IC data object (preserved).
   __ LoadFieldFromOffset(R6, 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.
+// R6: points directly to the first ic data array element.
 #if defined(DEBUG)
   // Check that first entry is for Smi/Smi.
   Label error, ok;
@@ -1410,7 +1407,8 @@
     bool optimized) {
   ASSERT(num_args > 0);
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that the IC data array has NumArgsTested() == num_args.
     // 'NumArgsTested' is stored in the least significant bits of 'state_bits'.
     __ LoadFromOffset(R6, R5, ICData::state_bits_offset() - kHeapObjectTag,
@@ -1428,8 +1426,7 @@
   if (FLAG_support_debugger && !optimized) {
     __ Comment("Check single stepping");
     __ LoadIsolate(R6);
-    __ LoadFromOffset(
-        R6, R6, Isolate::single_step_offset(), kUnsignedByte);
+    __ LoadFromOffset(R6, R6, Isolate::single_step_offset(), kUnsignedByte);
     __ CompareRegisters(R6, ZR);
     __ b(&stepping, NE);
     __ Bind(&done_stepping);
@@ -1437,10 +1434,7 @@
 
   Label not_smi_or_overflow;
   if (kind != Token::kILLEGAL) {
-    EmitFastSmiOp(assembler,
-                  kind,
-                  num_args,
-                  &not_smi_or_overflow);
+    EmitFastSmiOp(assembler, kind, num_args, &not_smi_or_overflow);
   }
   __ Bind(&not_smi_or_overflow);
 
@@ -1500,7 +1494,7 @@
 
   const intptr_t entry_size = ICData::TestEntryLengthFor(num_args) * kWordSize;
   __ AddImmediate(R6, R6, entry_size);  // Next entry.
-  __ ldr(R1, Address(R6));  // Next class ID.
+  __ ldr(R1, Address(R6));              // Next class ID.
 
   __ Bind(&test);
   __ CompareImmediate(R1, Smi::RawValue(kIllegalCid));  // Done?
@@ -1593,36 +1587,37 @@
 //   - 1 target function.
 void StubCode::GenerateOneArgCheckInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, R6);
-  GenerateNArgsCheckInlineCacheStub(assembler, 1,
-      kInlineCacheMissHandlerOneArgRuntimeEntry, Token::kILLEGAL);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 1, kInlineCacheMissHandlerOneArgRuntimeEntry, Token::kILLEGAL);
 }
 
 
 void StubCode::GenerateTwoArgsCheckInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, R6);
   GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kILLEGAL);
+                                    kInlineCacheMissHandlerTwoArgsRuntimeEntry,
+                                    Token::kILLEGAL);
 }
 
 
 void StubCode::GenerateSmiAddInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, R6);
-  GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kADD);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 2, kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kADD);
 }
 
 
 void StubCode::GenerateSmiSubInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, R6);
-  GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kSUB);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 2, kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kSUB);
 }
 
 
 void StubCode::GenerateSmiEqualInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, R6);
-  GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kEQ);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 2, kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kEQ);
 }
 
 
@@ -1630,8 +1625,8 @@
     Assembler* assembler) {
   GenerateOptimizedUsageCounterIncrement(assembler);
   GenerateNArgsCheckInlineCacheStub(assembler, 1,
-      kInlineCacheMissHandlerOneArgRuntimeEntry, Token::kILLEGAL,
-      true /* optimized */);
+                                    kInlineCacheMissHandlerOneArgRuntimeEntry,
+                                    Token::kILLEGAL, true /* optimized */);
 }
 
 
@@ -1639,15 +1634,16 @@
     Assembler* assembler) {
   GenerateOptimizedUsageCounterIncrement(assembler);
   GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kILLEGAL,
-      true /* optimized */);
+                                    kInlineCacheMissHandlerTwoArgsRuntimeEntry,
+                                    Token::kILLEGAL, true /* optimized */);
 }
 
 
 void StubCode::GenerateZeroArgsUnoptimizedStaticCallStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, R6);
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that the IC data array has NumArgsTested() == 0.
     // 'NumArgsTested' is stored in the least significant bits of 'state_bits'.
     __ LoadFromOffset(R6, R5, ICData::state_bits_offset() - kHeapObjectTag,
@@ -1663,10 +1659,9 @@
 
   // Check single stepping.
   Label stepping, done_stepping;
-    if (FLAG_support_debugger) {
+  if (FLAG_support_debugger) {
     __ LoadIsolate(R6);
-    __ LoadFromOffset(
-        R6, R6, Isolate::single_step_offset(), kUnsignedByte);
+    __ LoadFromOffset(R6, R6, Isolate::single_step_offset(), kUnsignedByte);
     __ CompareImmediate(R6, 0);
     __ b(&stepping, NE);
     __ Bind(&done_stepping);
@@ -1720,8 +1715,8 @@
 
 void StubCode::GenerateTwoArgsUnoptimizedStaticCallStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, R6);
-  GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kStaticCallMissHandlerTwoArgsRuntimeEntry, Token::kILLEGAL);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 2, kStaticCallMissHandlerTwoArgsRuntimeEntry, Token::kILLEGAL);
 }
 
 
@@ -1772,13 +1767,11 @@
 }
 
 // Called only from unoptimized code. All relevant registers have been saved.
-void StubCode::GenerateDebugStepCheckStub(
-    Assembler* assembler) {
+void StubCode::GenerateDebugStepCheckStub(Assembler* assembler) {
   // Check single stepping.
   Label stepping, done_stepping;
   __ LoadIsolate(R1);
-  __ LoadFromOffset(
-      R1, R1, Isolate::single_step_offset(), kUnsignedByte);
+  __ LoadFromOffset(R1, R1, Isolate::single_step_offset(), kUnsignedByte);
   __ CompareImmediate(R1, 0);
   __ b(&stepping, NE);
   __ Bind(&done_stepping);
@@ -1807,8 +1800,8 @@
     // Compute instance type arguments into R4.
     Label has_no_type_arguments;
     __ LoadObject(R4, Object::null_object());
-    __ LoadFieldFromOffset(R5, R3,
-        Class::type_arguments_field_offset_in_words_offset(), kWord);
+    __ LoadFieldFromOffset(
+        R5, R3, Class::type_arguments_field_offset_in_words_offset(), kWord);
     __ CompareImmediate(R5, Class::kNoTypeArguments);
     __ b(&has_no_type_arguments, EQ);
     __ add(R5, R0, Operand(R5, LSL, 3));
@@ -1834,8 +1827,8 @@
   __ LoadFieldFromOffset(R3, R0, Closure::function_offset());
   // R3: instance class id as Smi or function.
   __ Bind(&loop);
-  __ LoadFromOffset(
-      R5, R2, kWordSize * SubtypeTestCache::kInstanceClassIdOrFunction);
+  __ LoadFromOffset(R5, R2,
+                    kWordSize * SubtypeTestCache::kInstanceClassIdOrFunction);
   __ CompareObject(R5, Object::null_object());
   __ b(&not_found, EQ);
   __ CompareRegisters(R5, R3);
@@ -1843,22 +1836,21 @@
     __ b(&found, EQ);
   } else {
     __ b(&next_iteration, NE);
-    __ LoadFromOffset(
-        R5, R2, kWordSize * SubtypeTestCache::kInstanceTypeArguments);
+    __ LoadFromOffset(R5, R2,
+                      kWordSize * SubtypeTestCache::kInstanceTypeArguments);
     __ CompareRegisters(R5, R4);
     if (n == 2) {
       __ b(&found, EQ);
     } else {
       __ b(&next_iteration, NE);
-      __ LoadFromOffset(R5, R2,
-          kWordSize * SubtypeTestCache::kInstantiatorTypeArguments);
+      __ LoadFromOffset(
+          R5, R2, kWordSize * SubtypeTestCache::kInstantiatorTypeArguments);
       __ CompareRegisters(R5, R1);
       __ b(&found, EQ);
     }
   }
   __ Bind(&next_iteration);
-  __ AddImmediate(
-      R2, R2, kWordSize * SubtypeTestCache::kTestEntryLength);
+  __ AddImmediate(R2, R2, kWordSize * SubtypeTestCache::kTestEntryLength);
   __ b(&loop);
   // Fall through to not found.
   __ Bind(&not_found);
@@ -1910,24 +1902,20 @@
 }
 
 
-// Jump to the exception or error handler.
+// Jump to a frame on the call stack.
 // LR: return address.
 // R0: program_counter.
 // R1: stack_pointer.
 // R2: frame_pointer.
-// R3: error object.
-// R4: address of stacktrace object.
-// R5: thread.
+// R3: thread.
 // Does not return.
-void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) {
+void StubCode::GenerateJumpToFrameStub(Assembler* assembler) {
   ASSERT(kExceptionObjectReg == R0);
   ASSERT(kStackTraceObjectReg == R1);
   __ mov(LR, R0);  // Program counter.
   __ mov(SP, R1);  // Stack pointer.
   __ mov(FP, R2);  // Frame_pointer.
-  __ mov(R0, R3);  // Exception object.
-  __ mov(R1, R4);  // StackTrace object.
-  __ mov(THR, R5);
+  __ mov(THR, R3);
   // Set the tag.
   __ LoadImmediate(R2, VMTag::kDartTagId);
   __ StoreToOffset(R2, THR, Thread::vm_tag_offset());
@@ -1936,6 +1924,27 @@
   // Restore the pool pointer.
   __ RestoreCodePointer();
   __ LoadPoolPointer();
+  __ ret();  // Jump to continuation point.
+}
+
+
+// Run an exception handler.  Execution comes from JumpToFrame
+// stub or from the simulator.
+//
+// The arguments are stored in the Thread object.
+// Does not return.
+void StubCode::GenerateRunExceptionHandlerStub(Assembler* assembler) {
+  __ LoadFromOffset(LR, THR, Thread::resume_pc_offset());
+  __ LoadImmediate(R2, 0);
+
+  // Exception object.
+  __ LoadFromOffset(R0, THR, Thread::active_exception_offset());
+  __ StoreToOffset(R2, THR, Thread::active_exception_offset());
+
+  // Stacktrace object.
+  __ LoadFromOffset(R1, THR, Thread::active_stacktrace_offset());
+  __ StoreToOffset(R2, THR, Thread::active_stacktrace_offset());
+
   __ ret();  // Jump to the exception handler code.
 }
 
@@ -1951,11 +1960,12 @@
   __ Push(R6);
   __ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry, 1);
   __ Pop(R0);  // Discard argument.
-  __ Pop(CODE_REG);  // Get Code object
+  __ Pop(R0);  // Get Function object
   __ Pop(R4);  // Restore argument descriptor.
-  __ LoadFieldFromOffset(R0, CODE_REG, Code::entry_point_offset());
+  __ LoadFieldFromOffset(CODE_REG, R0, Function::code_offset());
+  __ LoadFieldFromOffset(R1, R0, Function::entry_point_offset());
   __ LeaveStubFrame();
-  __ br(R0);
+  __ br(R1);
   __ brk(0);
 }
 
@@ -2076,8 +2086,6 @@
 //  CODE_REG: target Code
 //  R4: arguments descriptor
 void StubCode::GenerateMegamorphicCallStub(Assembler* assembler) {
-  __ NoMonomorphicCheckedEntry();
-
   // Jump if receiver is a smi.
   Label smi_case;
   __ TestImmediate(R0, kSmiTagMask);
@@ -2151,8 +2159,6 @@
 //  CODE_REG: target Code object
 //  R4: arguments descriptor
 void StubCode::GenerateICCallThroughFunctionStub(Assembler* assembler) {
-  __ NoMonomorphicCheckedEntry();
-
   Label loop, found, miss;
   __ ldr(R4, FieldAddress(R5, ICData::arguments_descriptor_offset()));
   __ ldr(R8, FieldAddress(R5, ICData::ic_data_offset()));
@@ -2188,8 +2194,6 @@
 
 
 void StubCode::GenerateICCallThroughCodeStub(Assembler* assembler) {
-  __ NoMonomorphicCheckedEntry();
-
   Label loop, found, miss;
   __ ldr(R4, FieldAddress(R5, ICData::arguments_descriptor_offset()));
   __ ldr(R8, FieldAddress(R5, ICData::ic_data_offset()));
@@ -2228,8 +2232,6 @@
 //  R0: receiver
 //  R5: SingleTargetCache
 void StubCode::GenerateUnlinkedCallStub(Assembler* assembler) {
-  __ NoMonomorphicCheckedEntry();
-
   __ EnterStubFrame();
   __ Push(R0);  // Preserve receiver.
 
@@ -2255,10 +2257,7 @@
 // Passed to target:
 //  CODE_REG: target Code object
 void StubCode::GenerateSingleTargetCallStub(Assembler* assembler) {
-  __ NoMonomorphicCheckedEntry();
-
   Label miss;
-
   __ LoadClassIdMayBeSmi(R1, R0);
   __ ldr(R2, FieldAddress(R5, SingleTargetCache::lower_limit_offset()),
          kUnsignedWord);
@@ -2296,6 +2295,7 @@
 // Called from the monomorphic checked entry.
 //  R0: receiver
 void StubCode::GenerateMonomorphicMissStub(Assembler* assembler) {
+  __ ldr(CODE_REG, Address(THR, Thread::monomorphic_miss_stub_offset()));
   __ EnterStubFrame();
   __ Push(R0);  // Preserve receiver.
 
diff --git a/runtime/vm/stub_code_arm64_test.cc b/runtime/vm/stub_code_arm64_test.cc
index f2d8a25..7112f26 100644
--- a/runtime/vm/stub_code_arm64_test.cc
+++ b/runtime/vm/stub_code_arm64_test.cc
@@ -20,25 +20,23 @@
 namespace dart {
 
 static Function* CreateFunction(const char* name) {
-  const String& class_name = String::Handle(Symbols::New(Thread::Current(),
-                                                         "ownerClass"));
+  const String& class_name =
+      String::Handle(Symbols::New(Thread::Current(), "ownerClass"));
   const Script& script = Script::Handle();
   const Library& lib = Library::Handle(Library::New(class_name));
   const Class& owner_class = Class::Handle(
       Class::New(lib, class_name, script, TokenPosition::kNoSource));
-  const String& function_name = String::ZoneHandle(
-      Symbols::New(Thread::Current(), name));
-  Function& function = Function::ZoneHandle(
-      Function::New(function_name, RawFunction::kRegularFunction,
-                    true, false, false, false, false, owner_class,
-                    TokenPosition::kNoSource));
+  const String& function_name =
+      String::ZoneHandle(Symbols::New(Thread::Current(), name));
+  Function& function = Function::ZoneHandle(Function::New(
+      function_name, RawFunction::kRegularFunction, true, false, false, false,
+      false, owner_class, TokenPosition::kNoSource));
   return &function;
 }
 
 
 // Test calls to stub code which calls into the runtime.
-static void GenerateCallToCallRuntimeStub(Assembler* assembler,
-                                          int length) {
+static void GenerateCallToCallRuntimeStub(Assembler* assembler, int length) {
   const int argc = 2;
   const Smi& smi_length = Smi::ZoneHandle(Smi::New(length));
   __ EnterDartFrame(0);
diff --git a/runtime/vm/stub_code_arm_test.cc b/runtime/vm/stub_code_arm_test.cc
index a0c35cc..5a79e93 100644
--- a/runtime/vm/stub_code_arm_test.cc
+++ b/runtime/vm/stub_code_arm_test.cc
@@ -20,25 +20,23 @@
 namespace dart {
 
 static Function* CreateFunction(const char* name) {
-  const String& class_name = String::Handle(Symbols::New(Thread::Current(),
-                                                         "ownerClass"));
+  const String& class_name =
+      String::Handle(Symbols::New(Thread::Current(), "ownerClass"));
   const Script& script = Script::Handle();
   const Library& lib = Library::Handle(Library::New(class_name));
   const Class& owner_class = Class::Handle(
       Class::New(lib, class_name, script, TokenPosition::kNoSource));
-  const String& function_name = String::ZoneHandle(
-      Symbols::New(Thread::Current(), name));
-  Function& function = Function::ZoneHandle(
-      Function::New(function_name, RawFunction::kRegularFunction,
-                    true, false, false, false, false, owner_class,
-                    TokenPosition::kNoSource));
+  const String& function_name =
+      String::ZoneHandle(Symbols::New(Thread::Current(), name));
+  Function& function = Function::ZoneHandle(Function::New(
+      function_name, RawFunction::kRegularFunction, true, false, false, false,
+      false, owner_class, TokenPosition::kNoSource));
   return &function;
 }
 
 
 // Test calls to stub code which calls into the runtime.
-static void GenerateCallToCallRuntimeStub(Assembler* assembler,
-                                          int length) {
+static void GenerateCallToCallRuntimeStub(Assembler* assembler, int length) {
   const int argc = 2;
   const Smi& smi_length = Smi::ZoneHandle(Smi::New(length));
   __ EnterDartFrame(0);
diff --git a/runtime/vm/stub_code_dbc.cc b/runtime/vm/stub_code_dbc.cc
index 1f2d23e..da24e19 100644
--- a/runtime/vm/stub_code_dbc.cc
+++ b/runtime/vm/stub_code_dbc.cc
@@ -23,8 +23,10 @@
 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.");
+DEFINE_FLAG(bool,
+            use_slow_path,
+            false,
+            "Set to true for debugging & verifying the slow paths.");
 DECLARE_FLAG(bool, trace_optimized_ic_calls);
 
 void StubCode::GenerateLazyCompileStub(Assembler* assembler) {
@@ -32,6 +34,19 @@
 }
 
 
+// Not executed, but used as a stack marker when calling
+// DRT_OptimizeInvokedFunction.
+void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) {
+  __ Trap();
+}
+
+
+// Not executed, but used as a sentinel in Simulator::JumpToFrame.
+void StubCode::GenerateRunExceptionHandlerStub(Assembler* assembler) {
+  __ Trap();
+}
+
+
 // TODO(vegorov) Don't generate this stub.
 void StubCode::GenerateFixCallersTargetStub(Assembler* assembler) {
   __ Trap();
diff --git a/runtime/vm/stub_code_ia32.cc b/runtime/vm/stub_code_ia32.cc
index fab258e..ca70617 100644
--- a/runtime/vm/stub_code_ia32.cc
+++ b/runtime/vm/stub_code_ia32.cc
@@ -24,8 +24,10 @@
 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.");
+DEFINE_FLAG(bool,
+            use_slow_path,
+            false,
+            "Set to true for debugging & verifying the slow paths.");
 DECLARE_FLAG(bool, trace_optimized_ic_calls);
 
 #define INT32_SIZEOF(x) static_cast<int32_t>(sizeof(x))
@@ -51,7 +53,8 @@
   __ movl(Address(THR, Thread::top_exit_frame_info_offset()), EBP);
 
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that we are always entering from Dart code.
     __ cmpl(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
     __ j(EQUAL, &ok, Assembler::kNearJump);
@@ -76,8 +79,8 @@
   __ movl(Address(ESP, argc_tag_offset), EDX);  // Set argc in NativeArguments.
   // Compute argv.
   __ leal(EAX, Address(EBP, EDX, TIMES_4, kParamEndSlotFromFp * kWordSize));
-  __ movl(Address(ESP, argv_offset), EAX);  // Set argv in NativeArguments.
-  __ addl(EAX, Immediate(1 * kWordSize));  // Retval is next to 1st argument.
+  __ movl(Address(ESP, argv_offset), EAX);    // Set argv in NativeArguments.
+  __ addl(EAX, Immediate(1 * kWordSize));     // Retval is next to 1st argument.
   __ movl(Address(ESP, retval_offset), EAX);  // Set retval in NativeArguments.
   __ call(ECX);
 
@@ -137,7 +140,8 @@
   __ movl(Address(THR, Thread::top_exit_frame_info_offset()), EBP);
 
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that we are always entering from Dart code.
     __ cmpl(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
     __ j(EQUAL, &ok, Assembler::kNearJump);
@@ -159,10 +163,10 @@
   }
 
   // Pass NativeArguments structure by value and call native function.
-  __ movl(Address(ESP, thread_offset), THR);  // Set thread in NativeArgs.
+  __ movl(Address(ESP, thread_offset), THR);    // Set thread in NativeArgs.
   __ movl(Address(ESP, argc_tag_offset), EDX);  // Set argc in NativeArguments.
-  __ movl(Address(ESP, argv_offset), EAX);  // Set argv in NativeArguments.
-  __ leal(EAX, Address(EBP, 2 * kWordSize));  // Compute return value addr.
+  __ movl(Address(ESP, argv_offset), EAX);      // Set argv in NativeArguments.
+  __ leal(EAX, Address(EBP, 2 * kWordSize));    // Compute return value addr.
   __ movl(Address(ESP, retval_offset), EAX);  // Set retval in NativeArguments.
   __ leal(EAX, Address(ESP, 2 * kWordSize));  // Pointer to the NativeArguments.
   __ movl(Address(ESP, 0), EAX);  // Pass the pointer to the NativeArguments.
@@ -205,7 +209,8 @@
   __ movl(Address(THR, Thread::top_exit_frame_info_offset()), EBP);
 
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that we are always entering from Dart code.
     __ cmpl(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
     __ j(EQUAL, &ok, Assembler::kNearJump);
@@ -226,12 +231,12 @@
   }
 
   // Pass NativeArguments structure by value and call native function.
-  __ movl(Address(ESP, thread_offset), THR);  // Set thread in NativeArgs.
+  __ movl(Address(ESP, thread_offset), THR);    // Set thread in NativeArgs.
   __ movl(Address(ESP, argc_tag_offset), EDX);  // Set argc in NativeArguments.
-  __ movl(Address(ESP, argv_offset), EAX);  // Set argv in NativeArguments.
-  __ leal(EAX, Address(EBP, 2 * kWordSize));  // Compute return value addr.
+  __ movl(Address(ESP, argv_offset), EAX);      // Set argv in NativeArguments.
+  __ leal(EAX, Address(EBP, 2 * kWordSize));    // Compute return value addr.
   __ movl(Address(ESP, retval_offset), EAX);  // Set retval in NativeArguments.
-  __ leal(EAX, Address(ESP, kWordSize));  // Pointer to the NativeArguments.
+  __ leal(EAX, Address(ESP, kWordSize));      // Pointer to the NativeArguments.
   __ movl(Address(ESP, 0), EAX);  // Pass the pointer to the NativeArguments.
   __ call(ECX);
 
@@ -249,7 +254,7 @@
 //   EDX: arguments descriptor array.
 void StubCode::GenerateCallStaticFunctionStub(Assembler* assembler) {
   __ EnterStubFrame();
-  __ pushl(EDX);  // Preserve arguments descriptor array.
+  __ pushl(EDX);           // Preserve arguments descriptor array.
   __ pushl(Immediate(0));  // Setup space on stack for return value.
   __ CallRuntime(kPatchStaticCallRuntimeEntry, 0);
   __ popl(EAX);  // Get Code object result.
@@ -269,7 +274,7 @@
   // Create a stub frame as we are pushing some objects on the stack before
   // calling into the runtime.
   __ EnterStubFrame();
-  __ pushl(EDX);  // Preserve arguments descriptor array.
+  __ pushl(EDX);           // Preserve arguments descriptor array.
   __ pushl(Immediate(0));  // Setup space on stack for return value.
   __ CallRuntime(kFixCallersTargetRuntimeEntry, 0);
   __ popl(EAX);  // Get Code object.
@@ -387,8 +392,8 @@
   __ movl(ECX, ESP);  // Preserve saved registers block.
   __ ReserveAlignedFrameSpace(2 * kWordSize);
   __ movl(Address(ESP, 0 * kWordSize), ECX);  // Start of register block.
-  bool is_lazy = (kind == kLazyDeoptFromReturn) ||
-                 (kind == kLazyDeoptFromThrow);
+  bool is_lazy =
+      (kind == kLazyDeoptFromReturn) || (kind == kLazyDeoptFromThrow);
   __ movl(Address(ESP, 1 * kWordSize), Immediate(is_lazy ? 1 : 0));
   __ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry, 2);
   // Result (EAX) is stack-size (FP - SP) in bytes.
@@ -403,10 +408,10 @@
   }
 
   __ LeaveFrame();
-  __ popl(EDX);  // Preserve return address.
+  __ popl(EDX);       // Preserve return address.
   __ movl(ESP, EBP);  // Discard optimized frame.
   __ subl(ESP, EAX);  // Reserve space for deoptimized frame.
-  __ pushl(EDX);  // Restore return address.
+  __ pushl(EDX);      // Restore return address.
 
   // Leaf runtime function DeoptimizeFillFrame expects a Dart frame.
   __ EnterDartFrame(0);
@@ -454,34 +459,26 @@
   }
   __ LeaveFrame();
 
-  __ popl(ECX);  // Pop return address.
+  __ popl(ECX);       // Pop return address.
   __ addl(ESP, EBX);  // Remove materialization arguments.
-  __ pushl(ECX);  // Push return address.
+  __ pushl(ECX);      // Push return address.
   __ ret();
 }
 
 
-// TOS: return address + call-instruction-size (5 bytes).
 // EAX: result, must be preserved
 void StubCode::GenerateDeoptimizeLazyFromReturnStub(Assembler* assembler) {
-  // Correct return address to point just after the call that is being
-  // deoptimized.
-  __ popl(EBX);
-  __ subl(EBX, Immediate(CallPattern::pattern_length_in_bytes()));
-  __ pushl(EBX);
+  // Return address for "call" to deopt stub.
+  __ pushl(Immediate(0xe1e1e1e1));
   GenerateDeoptimizationSequence(assembler, kLazyDeoptFromReturn);
 }
 
 
-// TOS: return address + call-instruction-size (5 bytes).
 // EAX: exception, must be preserved
 // EDX: stacktrace, must be preserved
 void StubCode::GenerateDeoptimizeLazyFromThrowStub(Assembler* assembler) {
-  // Correct return address to point just after the call that is being
-  // deoptimized.
-  __ popl(EBX);
-  __ subl(EBX, Immediate(CallPattern::pattern_length_in_bytes()));
-  __ pushl(EBX);
+  // Return address for "call" to deopt stub.
+  __ pushl(Immediate(0xe1e1e1e1));
   GenerateDeoptimizationSequence(assembler, kLazyDeoptFromThrow);
 }
 
@@ -503,12 +500,12 @@
   __ EnterStubFrame();
   // Load the receiver.
   __ movl(EDI, FieldAddress(EDX, ArgumentsDescriptor::count_offset()));
-  __ movl(EAX, Address(
-      EBP, EDI, TIMES_HALF_WORD_SIZE, kParamEndSlotFromFp * kWordSize));
+  __ movl(EAX, Address(EBP, EDI, TIMES_HALF_WORD_SIZE,
+                       kParamEndSlotFromFp * kWordSize));
   __ pushl(Immediate(0));  // Setup space on stack for result.
-  __ pushl(EAX);  // Receiver.
-  __ pushl(ECX);  // ICData/MegamorphicCache.
-  __ pushl(EDX);  // Arguments descriptor array.
+  __ pushl(EAX);           // Receiver.
+  __ pushl(ECX);           // ICData/MegamorphicCache.
+  __ pushl(EDX);           // Arguments descriptor array.
   __ movl(EDX, EDI);
   // EDX: Smi-tagged arguments array length.
   PushArgumentsArray(assembler);
@@ -534,9 +531,9 @@
   __ pushl(EDX);
 
   __ pushl(Immediate(0));  // Space for the result of the runtime call.
-  __ pushl(EAX);  // Pass receiver.
-  __ pushl(ECX);  // Pass IC data.
-  __ pushl(EDX);  // Pass arguments descriptor.
+  __ pushl(EAX);           // Pass receiver.
+  __ pushl(ECX);           // Pass IC data.
+  __ pushl(EDX);           // Pass arguments descriptor.
   __ CallRuntime(kMegamorphicCacheMissHandlerRuntimeEntry, 3);
   // Discard arguments.
   __ popl(EAX);
@@ -578,7 +575,7 @@
     __ j(NOT_ZERO, &slow_case);
   }
   __ cmpl(EDX, Immediate(0));
-  __ j(LESS,  &slow_case);
+  __ j(LESS, &slow_case);
 
   // Check for maximum allowed length.
   const Immediate& max_len =
@@ -586,10 +583,8 @@
   __ cmpl(EDX, max_len);
   __ j(GREATER, &slow_case);
 
-  NOT_IN_PRODUCT(__ MaybeTraceAllocation(kArrayCid,
-                                         EAX,
-                                         &slow_case,
-                                         Assembler::kFarJump));
+  NOT_IN_PRODUCT(
+      __ MaybeTraceAllocation(kArrayCid, EAX, &slow_case, Assembler::kFarJump));
 
   const intptr_t fixed_size = sizeof(RawArray) + kObjectAlignment - 1;
   __ leal(EBX, Address(EDX, TIMES_2, fixed_size));  // EDX is Smi.
@@ -650,13 +645,11 @@
   // EDX: Array length as Smi (preserved).
   // Store the type argument field.
   // No generetional barrier needed, since we store into a new object.
-  __ StoreIntoObjectNoBarrier(EAX,
-                              FieldAddress(EAX, Array::type_arguments_offset()),
-                              ECX);
+  __ StoreIntoObjectNoBarrier(
+      EAX, FieldAddress(EAX, Array::type_arguments_offset()), ECX);
 
   // Set the length field.
-  __ StoreIntoObjectNoBarrier(EAX,
-                              FieldAddress(EAX, Array::length_offset()),
+  __ StoreIntoObjectNoBarrier(EAX, FieldAddress(EAX, Array::length_offset()),
                               EDX);
 
   // Initialize all array elements to raw_null.
@@ -687,8 +680,8 @@
   // calling into the runtime.
   __ EnterStubFrame();
   __ pushl(Immediate(0));  // Setup space on stack for return value.
-  __ pushl(EDX);  // Array length as Smi.
-  __ pushl(ECX);  // Element type.
+  __ pushl(EDX);           // Array length as Smi.
+  __ pushl(ECX);           // Element type.
   __ CallRuntime(kAllocateArrayRuntimeEntry, 2);
   __ popl(EAX);  // Pop element type argument.
   __ popl(EDX);  // Pop array length argument (preserved).
@@ -822,9 +815,7 @@
     __ leal(EBX, Address(EDX, TIMES_4, fixed_size));
     __ andl(EBX, Immediate(-kObjectAlignment));
 
-    NOT_IN_PRODUCT(__ MaybeTraceAllocation(kContextCid,
-                                           EAX,
-                                           &slow_case,
+    NOT_IN_PRODUCT(__ MaybeTraceAllocation(kContextCid, EAX, &slow_case,
                                            Assembler::kFarJump));
 
     // Now allocate the object.
@@ -882,8 +873,7 @@
       // EAX: new object.
       // EDX: number of context variables.
       // EBX: size and bit tags.
-      __ orl(EBX,
-             Immediate(RawObject::ClassIdTag::encode(cid)));
+      __ orl(EBX, Immediate(RawObject::ClassIdTag::encode(cid)));
       __ movl(FieldAddress(EAX, Context::tags_offset()), EBX);  // Tags.
     }
 
@@ -911,8 +901,7 @@
       __ Bind(&loop);
       __ decl(EDX);
       // No generational barrier needed, since we are storing null.
-      __ StoreIntoObjectNoBarrier(EAX,
-                                  Address(EBX, EDX, TIMES_4, 0),
+      __ StoreIntoObjectNoBarrier(EAX, Address(EBX, EDX, TIMES_4, 0),
                                   Object::null_object());
       __ Bind(&entry);
       __ cmpl(EDX, Immediate(0));
@@ -1016,8 +1005,8 @@
 // Uses EAX, EBX, ECX, EDX, EDI as temporary registers.
 // Returns patch_code_pc offset where patching code for disabling the stub
 // has been generated (similar to regularly generated Dart code).
-void StubCode::GenerateAllocationStubForClass(
-    Assembler* assembler, const Class& cls) {
+void StubCode::GenerateAllocationStubForClass(Assembler* assembler,
+                                              const Class& cls) {
   const intptr_t kObjectTypeArgumentsOffset = 1 * kWordSize;
   const Immediate& raw_null =
       Immediate(reinterpret_cast<intptr_t>(Object::null()));
@@ -1080,10 +1069,8 @@
       // Check if the object contains any non-header fields.
       // Small objects are initialized using a consecutive set of writes.
       for (intptr_t current_offset = Instance::NextFieldOffset();
-           current_offset < instance_size;
-           current_offset += kWordSize) {
-        __ StoreIntoObjectNoBarrier(EAX,
-                                    FieldAddress(EAX, current_offset),
+           current_offset < instance_size; current_offset += kWordSize) {
+        __ StoreIntoObjectNoBarrier(EAX, FieldAddress(EAX, current_offset),
                                     Object::null_object());
       }
     } else {
@@ -1098,9 +1085,7 @@
       __ Bind(&init_loop);
       __ cmpl(ECX, EBX);
       __ j(ABOVE_EQUAL, &done, Assembler::kNearJump);
-      __ StoreIntoObjectNoBarrier(EAX,
-                                  Address(ECX, 0),
-                                  Object::null_object());
+      __ StoreIntoObjectNoBarrier(EAX, Address(ECX, 0), Object::null_object());
       __ addl(ECX, Immediate(kWordSize));
       __ jmp(&init_loop, Assembler::kNearJump);
       __ Bind(&done);
@@ -1157,8 +1142,8 @@
   __ movl(EAX, Address(EBP, EDI, TIMES_2, kParamEndSlotFromFp * kWordSize));
 
   __ pushl(Immediate(0));  // Setup space on stack for result from noSuchMethod.
-  __ pushl(EAX);  // Receiver.
-  __ pushl(EDX);  // Arguments descriptor array.
+  __ pushl(EAX);           // Receiver.
+  __ pushl(EDX);           // Arguments descriptor array.
 
   __ movl(EDX, EDI);
   // EDX: Smi-tagged arguments array length.
@@ -1178,15 +1163,15 @@
   Register func_reg = EBX;
   if (FLAG_trace_optimized_ic_calls) {
     __ EnterStubFrame();
-    __ pushl(func_reg);     // Preserve
-    __ pushl(ic_reg);       // Preserve.
-    __ pushl(ic_reg);       // Argument.
-    __ pushl(func_reg);     // Argument.
+    __ pushl(func_reg);  // Preserve
+    __ pushl(ic_reg);    // Preserve.
+    __ pushl(ic_reg);    // Argument.
+    __ pushl(func_reg);  // Argument.
     __ CallRuntime(kTraceICCallRuntimeEntry, 2);
-    __ popl(EAX);          // Discard argument;
-    __ popl(EAX);          // Discard argument;
-    __ popl(ic_reg);       // Restore.
-    __ popl(func_reg);     // Restore.
+    __ popl(EAX);       // Discard argument;
+    __ popl(EAX);       // Discard argument;
+    __ popl(ic_reg);    // Restore.
+    __ popl(func_reg);  // Restore.
     __ LeaveFrame();
   }
   __ incl(FieldAddress(func_reg, Function::usage_counter_offset()));
@@ -1217,8 +1202,8 @@
                           Label* not_smi_or_overflow) {
   __ Comment("Fast Smi op");
   ASSERT(num_args == 2);
-  __ movl(EDI, Address(ESP, + 1 * kWordSize));  // Right
-  __ movl(EAX, Address(ESP, + 2 * kWordSize));  // Left
+  __ movl(EDI, Address(ESP, +1 * kWordSize));  // Right
+  __ movl(EAX, Address(ESP, +2 * kWordSize));  // Left
   __ movl(EBX, EDI);
   __ orl(EBX, EAX);
   __ testl(EBX, Immediate(kSmiTagMask));
@@ -1251,7 +1236,8 @@
       __ Bind(&done);
       break;
     }
-    default: UNIMPLEMENTED();
+    default:
+      UNIMPLEMENTED();
   }
 
   // ECX: IC data object.
@@ -1302,7 +1288,8 @@
     bool optimized) {
   ASSERT(num_args > 0);
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that the IC data array has NumArgsTested() == num_args.
     // 'NumArgsTested' is stored in the least significant bits of 'state_bits'.
     __ movl(EBX, FieldAddress(ECX, ICData::state_bits_offset()));
@@ -1357,7 +1344,7 @@
     if (i > 0) {
       // If not the first, load the next argument's class ID.
       __ movl(EAX, FieldAddress(EDX, ArgumentsDescriptor::count_offset()));
-      __ movl(EDI, Address(ESP, EAX, TIMES_2, - i * kWordSize));
+      __ movl(EDI, Address(ESP, EAX, TIMES_2, -i * kWordSize));
       __ LoadTaggedClassIdMayBeSmi(EAX, EDI);
 
       // EAX: next argument class ID (smi).
@@ -1382,7 +1369,7 @@
 
   const intptr_t entry_size = ICData::TestEntryLengthFor(num_args) * kWordSize;
   __ addl(EBX, Immediate(entry_size));  // Next entry.
-  __ movl(EDI, Address(EBX, 0));  // Next class ID.
+  __ movl(EDI, Address(EBX, 0));        // Next class ID.
 
   __ Bind(&test);
   __ cmpl(EDI, Immediate(Smi::RawValue(kIllegalCid)));  // Done?
@@ -1396,8 +1383,8 @@
   // Create a stub frame as we are pushing some objects on the stack before
   // calling into the runtime.
   __ EnterStubFrame();
-  __ pushl(EDX);  // Preserve arguments descriptor array.
-  __ pushl(ECX);  // Preserve IC data object.
+  __ pushl(EDX);           // Preserve arguments descriptor array.
+  __ pushl(ECX);           // Preserve IC data object.
   __ pushl(Immediate(0));  // Result slot.
   // Push call arguments.
   for (intptr_t i = 0; i < num_args; i++) {
@@ -1466,41 +1453,37 @@
 //   - 1 target function.
 void StubCode::GenerateOneArgCheckInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, EBX);
-  GenerateNArgsCheckInlineCacheStub(assembler, 1,
-      kInlineCacheMissHandlerOneArgRuntimeEntry,
-      Token::kILLEGAL);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 1, kInlineCacheMissHandlerOneArgRuntimeEntry, Token::kILLEGAL);
 }
 
 
 void StubCode::GenerateTwoArgsCheckInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, EBX);
   GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry,
-      Token::kILLEGAL);
+                                    kInlineCacheMissHandlerTwoArgsRuntimeEntry,
+                                    Token::kILLEGAL);
 }
 
 
 void StubCode::GenerateSmiAddInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, EBX);
-  GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry,
-      Token::kADD);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 2, kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kADD);
 }
 
 
 void StubCode::GenerateSmiSubInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, EBX);
-  GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry,
-      Token::kSUB);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 2, kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kSUB);
 }
 
 
 void StubCode::GenerateSmiEqualInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, EBX);
-  GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry,
-      Token::kEQ);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 2, kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kEQ);
 }
 
 
@@ -1519,9 +1502,8 @@
     Assembler* assembler) {
   GenerateOptimizedUsageCounterIncrement(assembler);
   GenerateNArgsCheckInlineCacheStub(assembler, 1,
-      kInlineCacheMissHandlerOneArgRuntimeEntry,
-      Token::kILLEGAL,
-      true /* optimized */);
+                                    kInlineCacheMissHandlerOneArgRuntimeEntry,
+                                    Token::kILLEGAL, true /* optimized */);
 }
 
 
@@ -1529,9 +1511,8 @@
     Assembler* assembler) {
   GenerateOptimizedUsageCounterIncrement(assembler);
   GenerateNArgsCheckInlineCacheStub(assembler, 2,
-     kInlineCacheMissHandlerTwoArgsRuntimeEntry,
-     Token::kILLEGAL,
-     true /* optimized */);
+                                    kInlineCacheMissHandlerTwoArgsRuntimeEntry,
+                                    Token::kILLEGAL, true /* optimized */);
 }
 
 
@@ -1542,7 +1523,8 @@
   GenerateUsageCounterIncrement(assembler, EBX);
 
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that the IC data array has NumArgsTested() == num_args.
     // 'NumArgsTested' is stored in the least significant bits of 'state_bits'.
     __ movl(EBX, FieldAddress(ECX, ICData::state_bits_offset()));
@@ -1603,16 +1585,14 @@
 void StubCode::GenerateOneArgUnoptimizedStaticCallStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, EBX);
   GenerateNArgsCheckInlineCacheStub(
-      assembler, 1, kStaticCallMissHandlerOneArgRuntimeEntry,
-      Token::kILLEGAL);
+      assembler, 1, kStaticCallMissHandlerOneArgRuntimeEntry, Token::kILLEGAL);
 }
 
 
 void StubCode::GenerateTwoArgsUnoptimizedStaticCallStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, EBX);
-  GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kStaticCallMissHandlerTwoArgsRuntimeEntry,
-      Token::kILLEGAL);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 2, kStaticCallMissHandlerTwoArgsRuntimeEntry, Token::kILLEGAL);
 }
 
 
@@ -1707,8 +1687,9 @@
     // Compute instance type arguments into EBX.
     Label has_no_type_arguments;
     __ movl(EBX, raw_null);
-    __ movl(EDI, FieldAddress(ECX,
-        Class::type_arguments_field_offset_in_words_offset()));
+    __ movl(EDI,
+            FieldAddress(ECX,
+                         Class::type_arguments_field_offset_in_words_offset()));
     __ cmpl(EDI, Immediate(Class::kNoTypeArguments));
     __ j(EQUAL, &has_no_type_arguments, Assembler::kNearJump);
     __ movl(EBX, FieldAddress(EAX, EDI, TIMES_4, 0));
@@ -1732,9 +1713,8 @@
   __ movl(ECX, FieldAddress(EAX, Closure::function_offset()));
   // ECX: instance class id as Smi or function.
   __ Bind(&loop);
-  __ movl(EDI,
-          Address(EDX,
-                  kWordSize * SubtypeTestCache::kInstanceClassIdOrFunction));
+  __ movl(EDI, Address(EDX, kWordSize *
+                                SubtypeTestCache::kInstanceClassIdOrFunction));
   __ cmpl(EDI, raw_null);
   __ j(EQUAL, &not_found, Assembler::kNearJump);
   __ cmpl(EDI, ECX);
@@ -1743,7 +1723,7 @@
   } else {
     __ j(NOT_EQUAL, &next_iteration, Assembler::kNearJump);
     __ movl(EDI,
-          Address(EDX, kWordSize * SubtypeTestCache::kInstanceTypeArguments));
+            Address(EDX, kWordSize * SubtypeTestCache::kInstanceTypeArguments));
     __ cmpl(EDI, EBX);
     if (n == 2) {
       __ j(EQUAL, &found, Assembler::kNearJump);
@@ -1751,7 +1731,7 @@
       __ j(NOT_EQUAL, &next_iteration, Assembler::kNearJump);
       __ movl(EDI,
               Address(EDX, kWordSize *
-                           SubtypeTestCache::kInstantiatorTypeArguments));
+                               SubtypeTestCache::kInstantiatorTypeArguments));
       __ cmpl(EDI, Address(ESP, kInstantiatorTypeArgumentsInBytes));
       __ j(EQUAL, &found, Assembler::kNearJump);
     }
@@ -1812,21 +1792,15 @@
 }
 
 
-// Jump to the exception or error handler.
+// Jump to a frame on the call stack.
 // TOS + 0: return address
 // TOS + 1: program_counter
 // TOS + 2: stack_pointer
 // TOS + 3: frame_pointer
-// TOS + 4: exception object
-// TOS + 5: stacktrace object
-// TOS + 6: thread
+// TOS + 4: thread
 // No Result.
-void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) {
-  ASSERT(kExceptionObjectReg == EAX);
-  ASSERT(kStackTraceObjectReg == EDX);
-  __ movl(THR, Address(ESP, 6 * kWordSize));  // Load target thread.
-  __ movl(kStackTraceObjectReg, Address(ESP, 5 * kWordSize));
-  __ movl(kExceptionObjectReg, Address(ESP, 4 * kWordSize));
+void StubCode::GenerateJumpToFrameStub(Assembler* assembler) {
+  __ movl(THR, Address(ESP, 4 * kWordSize));  // Load target thread.
   __ movl(EBP, Address(ESP, 3 * kWordSize));  // Load target frame_pointer.
   __ movl(EBX, Address(ESP, 1 * kWordSize));  // Load target PC into EBX.
   __ movl(ESP, Address(ESP, 2 * kWordSize));  // Load target stack_pointer.
@@ -1838,6 +1812,29 @@
 }
 
 
+// Run an exception handler.  Execution comes from JumpToFrame stub.
+//
+// The arguments are stored in the Thread object.
+// No result.
+void StubCode::GenerateRunExceptionHandlerStub(Assembler* assembler) {
+  ASSERT(kExceptionObjectReg == EAX);
+  ASSERT(kStackTraceObjectReg == EDX);
+  __ movl(EBX, Address(THR, Thread::resume_pc_offset()));
+
+  // Load the exception from the current thread.
+  Address exception_addr(THR, Thread::active_exception_offset());
+  __ movl(kExceptionObjectReg, exception_addr);
+  __ movl(exception_addr, Immediate(0));
+
+  // Load the stacktrace from the current thread.
+  Address stacktrace_addr(THR, Thread::active_stacktrace_offset());
+  __ movl(kStackTraceObjectReg, stacktrace_addr);
+  __ movl(stacktrace_addr, Immediate(0));
+
+  __ jmp(EBX);  // Jump to continuation point.
+}
+
+
 // Calls to the runtime to optimize the given function.
 // EBX: function to be reoptimized.
 // EDX: argument descriptor (preserved).
@@ -1848,10 +1845,11 @@
   __ pushl(EBX);
   __ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry, 1);
   __ popl(EAX);  // Discard argument.
-  __ popl(EAX);  // Get Code object
+  __ popl(EAX);  // Get Function object
   __ popl(EDX);  // Restore argument descriptor.
-  __ movl(EAX, FieldAddress(EAX, Code::entry_point_offset()));
   __ LeaveFrame();
+  __ movl(CODE_REG, FieldAddress(EAX, Function::code_offset()));
+  __ movl(EAX, FieldAddress(EAX, Function::entry_point_offset()));
   __ jmp(EAX);
   __ int3();
 }
diff --git a/runtime/vm/stub_code_ia32_test.cc b/runtime/vm/stub_code_ia32_test.cc
index 6ba14dc..ed2951b 100644
--- a/runtime/vm/stub_code_ia32_test.cc
+++ b/runtime/vm/stub_code_ia32_test.cc
@@ -20,25 +20,23 @@
 namespace dart {
 
 static Function* CreateFunction(const char* name) {
-  const String& class_name = String::Handle(Symbols::New(Thread::Current(),
-                                                         "ownerClass"));
+  const String& class_name =
+      String::Handle(Symbols::New(Thread::Current(), "ownerClass"));
   const Script& script = Script::Handle();
   const Library& lib = Library::Handle(Library::New(class_name));
   const Class& owner_class = Class::Handle(
       Class::New(lib, class_name, script, TokenPosition::kNoSource));
-  const String& function_name = String::ZoneHandle(
-      Symbols::New(Thread::Current(), name));
-  Function& function = Function::ZoneHandle(
-      Function::New(function_name, RawFunction::kRegularFunction,
-                    true, false, false, false, false, owner_class,
-                    TokenPosition::kMinSource));
+  const String& function_name =
+      String::ZoneHandle(Symbols::New(Thread::Current(), name));
+  Function& function = Function::ZoneHandle(Function::New(
+      function_name, RawFunction::kRegularFunction, true, false, false, false,
+      false, owner_class, TokenPosition::kMinSource));
   return &function;
 }
 
 
 // Test calls to stub code which calls into the runtime.
-static void GenerateCallToCallRuntimeStub(Assembler* assembler,
-                                          int length) {
+static void GenerateCallToCallRuntimeStub(Assembler* assembler, int length) {
   const int argc = 2;
   const Smi& smi_length = Smi::ZoneHandle(Smi::New(length));
   __ enter(Immediate(0));
diff --git a/runtime/vm/stub_code_mips.cc b/runtime/vm/stub_code_mips.cc
index de6db70..d52e6cc 100644
--- a/runtime/vm/stub_code_mips.cc
+++ b/runtime/vm/stub_code_mips.cc
@@ -22,8 +22,10 @@
 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.");
+DEFINE_FLAG(bool,
+            use_slow_path,
+            false,
+            "Set to true for debugging & verifying the slow paths.");
 DECLARE_FLAG(bool, trace_optimized_ic_calls);
 
 // Input parameters:
@@ -48,7 +50,8 @@
   __ sw(FP, Address(THR, Thread::top_exit_frame_info_offset()));
 
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that we are always entering from Dart code.
     __ lw(T0, Assembler::VMTagAddress());
     __ BranchEqual(T0, Immediate(VMTag::kDartTagId), &ok);
@@ -90,7 +93,7 @@
   __ mov(T9, S5);
   __ jalr(T9);
 
-    ASSERT(retval_offset == 3 * kWordSize);
+  ASSERT(retval_offset == 3 * kWordSize);
   // Retval is next to 1st argument.
   __ delay_slot()->addiu(A3, A2, Immediate(kWordSize));
   __ Comment("CallToRuntimeStub return");
@@ -146,7 +149,8 @@
   __ sw(FP, Address(THR, Thread::top_exit_frame_info_offset()));
 
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that we are always entering from Dart code.
     __ lw(T0, Assembler::VMTagAddress());
     __ BranchEqual(T0, Immediate(VMTag::kDartTagId), &ok);
@@ -188,7 +192,7 @@
   __ mov(A0, SP);  // Pass the pointer to the NativeArguments.
 
 
-  __ mov(A1, T5);  // Pass the function entrypoint.
+  __ mov(A1, T5);                              // Pass the function entrypoint.
   __ ReserveAlignedFrameSpace(2 * kWordSize);  // Just passing A0, A1.
 
   // Call native wrapper function or redirection via simulator.
@@ -228,7 +232,8 @@
   __ sw(FP, Address(THR, Thread::top_exit_frame_info_offset()));
 
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that we are always entering from Dart code.
     __ lw(T0, Assembler::VMTagAddress());
     __ BranchEqual(T0, Immediate(VMTag::kDartTagId), &ok);
@@ -473,8 +478,8 @@
   }
 
   __ mov(A0, SP);  // Pass address of saved registers block.
-  bool is_lazy = (kind == kLazyDeoptFromReturn) ||
-                 (kind == kLazyDeoptFromThrow);
+  bool is_lazy =
+      (kind == kLazyDeoptFromReturn) || (kind == kLazyDeoptFromThrow);
   __ LoadImmediate(A1, is_lazy ? 1 : 0);
   __ ReserveAlignedFrameSpace(1 * kWordSize);
   __ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry, 2);
@@ -547,29 +552,27 @@
   __ Ret();
 }
 
-// RA: return address + call-instruction-size
 // V0: result, must be preserved
 void StubCode::GenerateDeoptimizeLazyFromReturnStub(Assembler* assembler) {
-  // Correct return address to point just after the call that is being
-  // deoptimized.
-  __ AddImmediate(RA, -CallPattern::kDeoptCallLengthInBytes);
   // Push zap value instead of CODE_REG for lazy deopt.
   __ LoadImmediate(TMP, 0xf1f1f1f1);
   __ Push(TMP);
+  // Return address for "call" to deopt stub.
+  __ LoadImmediate(RA, 0xe1e1e1e1);
+  __ lw(CODE_REG, Address(THR, Thread::lazy_deopt_from_return_stub_offset()));
   GenerateDeoptimizationSequence(assembler, kLazyDeoptFromReturn);
 }
 
 
-// RA: return address + call-instruction-size
 // V0: exception, must be preserved
 // V1: stacktrace, must be preserved
 void StubCode::GenerateDeoptimizeLazyFromThrowStub(Assembler* assembler) {
-  // Correct return address to point just after the call that is being
-  // deoptimized.
-  __ AddImmediate(RA, -CallPattern::kDeoptCallLengthInBytes);
   // Push zap value instead of CODE_REG for lazy deopt.
   __ LoadImmediate(TMP, 0xf1f1f1f1);
   __ Push(TMP);
+  // Return address for "call" to deopt stub.
+  __ LoadImmediate(RA, 0xe1e1e1e1);
+  __ lw(CODE_REG, Address(THR, Thread::lazy_deopt_from_throw_stub_offset()));
   GenerateDeoptimizationSequence(assembler, kLazyDeoptFromThrow);
 }
 
@@ -701,12 +704,11 @@
   // T2: Allocation size.
 
   Heap::Space space = Heap::kNew;
-  __ LoadIsolate(T3);
-  __ lw(T3, Address(T3, Isolate::heap_offset()));
+  __ lw(T3, Address(THR, Thread::heap_offset()));
   // Potential new object start.
   __ lw(T0, Address(T3, Heap::TopOffset(space)));
 
-  __ addu(T1, T0, T2);  // Potential next object start.
+  __ addu(T1, T0, T2);                        // Potential next object start.
   __ BranchUnsignedLess(T1, T0, &slow_case);  // Branch on unsigned overflow.
 
   // Check if the allocation fits into the remaining space.
@@ -732,8 +734,8 @@
     Label overflow, done;
     const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2;
 
-    __ BranchUnsignedGreater(
-        T2, Immediate(RawObject::SizeTag::kMaxSizeTag), &overflow);
+    __ BranchUnsignedGreater(T2, Immediate(RawObject::SizeTag::kMaxSizeTag),
+                             &overflow);
     __ b(&done);
     __ delay_slot()->sll(T2, T2, shift);
     __ Bind(&overflow);
@@ -750,14 +752,11 @@
   // T0: new object start as a tagged pointer.
   // T1: new object end address.
   // Store the type argument field.
-  __ StoreIntoObjectNoBarrier(T0,
-                              FieldAddress(T0, Array::type_arguments_offset()),
-                              A0);
+  __ StoreIntoObjectNoBarrier(
+      T0, FieldAddress(T0, Array::type_arguments_offset()), A0);
 
   // Set the length field.
-  __ StoreIntoObjectNoBarrier(T0,
-                              FieldAddress(T0, Array::length_offset()),
-                              A1);
+  __ StoreIntoObjectNoBarrier(T0, FieldAddress(T0, Array::length_offset()), A1);
 
   __ LoadObject(T7, Object::null_object());
   // Initialize all array elements to raw_null.
@@ -825,8 +824,8 @@
   // The saved vm tag, top resource, and top exit frame info.
   const intptr_t kPreservedSlots = 3;
   const intptr_t kPreservedRegSpace =
-      kWordSize * (kAbiPreservedCpuRegCount + kAbiPreservedFpuRegCount +
-                   kPreservedSlots);
+      kWordSize *
+      (kAbiPreservedCpuRegCount + kAbiPreservedFpuRegCount + kPreservedSlots);
 
   __ addiu(SP, SP, Immediate(-kPreservedRegSpace));
   for (int i = S0; i <= S7; i++) {
@@ -835,12 +834,11 @@
     __ sw(r, Address(SP, slot * kWordSize));
   }
 
-  for (intptr_t i = kAbiFirstPreservedFpuReg;
-       i <= kAbiLastPreservedFpuReg; i++) {
+  for (intptr_t i = kAbiFirstPreservedFpuReg; i <= kAbiLastPreservedFpuReg;
+       i++) {
     FRegister r = static_cast<FRegister>(i);
-    const intptr_t slot =
-        kAbiPreservedCpuRegCount + kPreservedSlots + i -
-        kAbiFirstPreservedFpuReg;
+    const intptr_t slot = kAbiPreservedCpuRegCount + kPreservedSlots + i -
+                          kAbiFirstPreservedFpuReg;
     __ swc1(r, Address(SP, slot * kWordSize));
   }
 
@@ -931,12 +929,11 @@
     __ lw(r, Address(SP, slot * kWordSize));
   }
 
-  for (intptr_t i = kAbiFirstPreservedFpuReg;
-       i <= kAbiLastPreservedFpuReg; i++) {
+  for (intptr_t i = kAbiFirstPreservedFpuReg; i <= kAbiLastPreservedFpuReg;
+       i++) {
     FRegister r = static_cast<FRegister>(i);
-    const intptr_t slot =
-        kAbiPreservedCpuRegCount + kPreservedSlots + i -
-        kAbiFirstPreservedFpuReg;
+    const intptr_t slot = kAbiPreservedCpuRegCount + kPreservedSlots + i -
+                          kAbiFirstPreservedFpuReg;
     __ lwc1(r, Address(SP, slot * kWordSize));
   }
 
@@ -963,7 +960,7 @@
     __ sll(T0, T1, 2);
     __ addu(T2, T2, T0);
     ASSERT(kSmiTagShift == 1);
-    __ LoadImmediate(T0, ~((kObjectAlignment) - 1));
+    __ LoadImmediate(T0, ~((kObjectAlignment)-1));
     __ and_(T2, T2, T0);
 
     NOT_IN_PRODUCT(__ MaybeTraceAllocation(kContextCid, T4, &slow_case));
@@ -972,8 +969,7 @@
     // T2: object size.
     const intptr_t cid = kContextCid;
     Heap::Space space = Heap::kNew;
-    __ LoadIsolate(T5);
-    __ lw(T5, Address(T5, Isolate::heap_offset()));
+    __ lw(T5, Address(THR, Thread::heap_offset()));
     __ lw(V0, Address(T5, Heap::TopOffset(space)));
     __ addu(T3, T2, V0);
 
@@ -1008,8 +1004,8 @@
     const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2;
     __ LoadImmediate(TMP, RawObject::SizeTag::kMaxSizeTag);
     __ sltu(CMPRES1, TMP, T2);  // CMPRES1 = T2 > TMP ? 1 : 0.
-    __ movn(T2, ZR, CMPRES1);  // T2 = CMPRES1 != 0 ? 0 : T2.
-    __ sll(TMP, T2, shift);  // TMP = T2 << shift.
+    __ movn(T2, ZR, CMPRES1);   // T2 = CMPRES1 != 0 ? 0 : T2.
+    __ sll(TMP, T2, shift);     // TMP = T2 << shift.
     __ movz(T2, TMP, CMPRES1);  // T2 = CMPRES1 == 0 ? TMP : T2.
 
     // Get the class index and insert it into the tags.
@@ -1057,8 +1053,8 @@
   __ sw(TMP, Address(SP, 1 * kWordSize));  // Store null.
   __ sw(T1, Address(SP, 0 * kWordSize));
   __ CallRuntime(kAllocateContextRuntimeEntry, 1);  // Allocate context.
-  __ lw(V0, Address(SP, 1 * kWordSize));  // Get the new context.
-  __ addiu(SP, SP, Immediate(2 * kWordSize));  // Pop argument and return.
+  __ lw(V0, Address(SP, 1 * kWordSize));            // Get the new context.
+  __ addiu(SP, SP, Immediate(2 * kWordSize));       // Pop argument and return.
 
   // V0: new object
   // Restore the frame pointer.
@@ -1208,8 +1204,7 @@
       // Check if the object contains any non-header fields.
       // Small objects are initialized using a consecutive set of writes.
       for (intptr_t current_offset = Instance::NextFieldOffset();
-           current_offset < instance_size;
-           current_offset += kWordSize) {
+           current_offset < instance_size; current_offset += kWordSize) {
         __ sw(T7, Address(T2, current_offset));
       }
     } else {
@@ -1317,7 +1312,7 @@
     __ addiu(SP, SP, Immediate(-4 * kWordSize));
     __ sw(T0, Address(SP, 3 * kWordSize));
     __ sw(S5, Address(SP, 2 * kWordSize));
-    __ sw(ic_reg, Address(SP, 1 * kWordSize));  // Argument.
+    __ sw(ic_reg, Address(SP, 1 * kWordSize));    // Argument.
     __ sw(func_reg, Address(SP, 0 * kWordSize));  // Argument.
     __ CallRuntime(kTraceICCallRuntimeEntry, 2);
     __ lw(S5, Address(SP, 2 * kWordSize));
@@ -1365,13 +1360,13 @@
   __ bne(CMPRES1, ZR, not_smi_or_overflow);
   switch (kind) {
     case Token::kADD: {
-     __ AdduDetectOverflow(V0, T1, T0, CMPRES1);  // Add.
-     __ bltz(CMPRES1, not_smi_or_overflow);  // Fall through on overflow.
+      __ AdduDetectOverflow(V0, T1, T0, CMPRES1);  // Add.
+      __ bltz(CMPRES1, not_smi_or_overflow);       // Fall through on overflow.
       break;
     }
     case Token::kSUB: {
       __ SubuDetectOverflow(V0, T1, T0, CMPRES1);  // Subtract.
-      __ bltz(CMPRES1, not_smi_or_overflow);  // Fall through on overflow.
+      __ bltz(CMPRES1, not_smi_or_overflow);       // Fall through on overflow.
       break;
     }
     case Token::kEQ: {
@@ -1384,13 +1379,14 @@
       __ Bind(&done);
       break;
     }
-    default: UNIMPLEMENTED();
+    default:
+      UNIMPLEMENTED();
   }
   // S5: IC data object (preserved).
   __ lw(T0, FieldAddress(S5, ICData::ic_data_offset()));
   // T0: ic_data_array with check entries: classes and target functions.
   __ AddImmediate(T0, Array::data_offset() - kHeapObjectTag);
-  // T0: points directly to the first ic data array element.
+// T0: points directly to the first ic data array element.
 #if defined(DEBUG)
   // Check that first entry is for Smi/Smi.
   Label error, ok;
@@ -1437,7 +1433,8 @@
   __ Comment("NArgsCheckInlineCacheStub");
   ASSERT(num_args > 0);
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that the IC data array has NumArgsTested() == num_args.
     // 'NumArgsTested' is stored in the least significant bits of 'state_bits'.
     __ lw(T0, FieldAddress(S5, ICData::state_bits_offset()));
@@ -1514,7 +1511,7 @@
       // Last check, all checks before matched.
       Label skip;
       __ bne(T3, T4, &skip);
-      __ b(&found);  // Break.
+      __ b(&found);                  // Break.
       __ delay_slot()->mov(RA, T2);  // Restore return address if found.
       __ Bind(&skip);
     }
@@ -1530,7 +1527,7 @@
 
   const intptr_t entry_size = ICData::TestEntryLengthFor(num_args) * kWordSize;
   __ AddImmediate(T0, entry_size);  // Next entry.
-  __ lw(T4, Address(T0));  // Next class ID.
+  __ lw(T4, Address(T0));           // Next class ID.
 
   __ Bind(&test);
   __ BranchNotEqual(T4, Immediate(Smi::RawValue(kIllegalCid)), &loop);  // Done?
@@ -1639,36 +1636,37 @@
 //   - 1 target function.
 void StubCode::GenerateOneArgCheckInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, T0);
-  GenerateNArgsCheckInlineCacheStub(assembler, 1,
-      kInlineCacheMissHandlerOneArgRuntimeEntry, Token::kILLEGAL);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 1, kInlineCacheMissHandlerOneArgRuntimeEntry, Token::kILLEGAL);
 }
 
 
 void StubCode::GenerateTwoArgsCheckInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, T0);
   GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kILLEGAL);
+                                    kInlineCacheMissHandlerTwoArgsRuntimeEntry,
+                                    Token::kILLEGAL);
 }
 
 
 void StubCode::GenerateSmiAddInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, T0);
-  GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kADD);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 2, kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kADD);
 }
 
 
 void StubCode::GenerateSmiSubInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, T0);
-  GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kSUB);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 2, kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kSUB);
 }
 
 
 void StubCode::GenerateSmiEqualInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, T0);
-  GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kEQ);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 2, kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kEQ);
 }
 
 
@@ -1676,8 +1674,8 @@
     Assembler* assembler) {
   GenerateOptimizedUsageCounterIncrement(assembler);
   GenerateNArgsCheckInlineCacheStub(assembler, 1,
-      kInlineCacheMissHandlerOneArgRuntimeEntry, Token::kILLEGAL,
-      true /* optimized */);
+                                    kInlineCacheMissHandlerOneArgRuntimeEntry,
+                                    Token::kILLEGAL, true /* optimized */);
 }
 
 
@@ -1685,8 +1683,8 @@
     Assembler* assembler) {
   GenerateOptimizedUsageCounterIncrement(assembler);
   GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kILLEGAL,
-      true /* optimized */);
+                                    kInlineCacheMissHandlerTwoArgsRuntimeEntry,
+                                    Token::kILLEGAL, true /* optimized */);
 }
 
 
@@ -1697,7 +1695,8 @@
   GenerateUsageCounterIncrement(assembler, T0);
   __ Comment("UnoptimizedStaticCallStub");
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that the IC data array has NumArgsTested() == 0.
     // 'NumArgsTested' is stored in the least significant bits of 'state_bits'.
     __ lw(T0, FieldAddress(S5, ICData::state_bits_offset()));
@@ -1737,7 +1736,7 @@
   }
 
   // Load arguments descriptor into S4.
-  __ lw(S4,  FieldAddress(S5, ICData::arguments_descriptor_offset()));
+  __ lw(S4, FieldAddress(S5, ICData::arguments_descriptor_offset()));
 
   // Get function and call it, if possible.
   __ lw(T0, Address(T0, target_offset));
@@ -1772,8 +1771,8 @@
 
 void StubCode::GenerateTwoArgsUnoptimizedStaticCallStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, T0);
-  GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kStaticCallMissHandlerTwoArgsRuntimeEntry, Token::kILLEGAL);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 2, kStaticCallMissHandlerTwoArgsRuntimeEntry, Token::kILLEGAL);
 }
 
 
@@ -1875,10 +1874,10 @@
     // Compute instance type arguments into T1.
     Label has_no_type_arguments;
     __ LoadObject(T1, Object::null_object());
-    __ lw(T2, FieldAddress(T0,
-        Class::type_arguments_field_offset_in_words_offset()));
-    __ BranchEqual(
-        T2, Immediate(Class::kNoTypeArguments), &has_no_type_arguments);
+    __ lw(T2, FieldAddress(
+                  T0, Class::type_arguments_field_offset_in_words_offset()));
+    __ BranchEqual(T2, Immediate(Class::kNoTypeArguments),
+                   &has_no_type_arguments);
     __ sll(T2, T2, 2);
     __ addu(T2, A0, T2);  // T2 <- A0 + T2 * 4
     __ lw(T1, FieldAddress(T2, 0));
@@ -1920,14 +1919,14 @@
     } else {
       __ bne(T3, T1, &next_iteration);
       __ lw(T3, Address(T2, kWordSize *
-                        SubtypeTestCache::kInstantiatorTypeArguments));
+                                SubtypeTestCache::kInstantiatorTypeArguments));
       __ beq(T3, A1, &found);
     }
   }
   __ Bind(&next_iteration);
   __ b(&loop);
-  __ delay_slot()->addiu(T2, T2,
-      Immediate(kWordSize * SubtypeTestCache::kTestEntryLength));
+  __ delay_slot()->addiu(
+      T2, T2, Immediate(kWordSize * SubtypeTestCache::kTestEntryLength));
   // Fall through to not found.
   __ Bind(&not_found);
   __ Ret();
@@ -1986,19 +1985,13 @@
 // A0: program_counter.
 // A1: stack_pointer.
 // A2: frame_pointer.
-// A3: error object.
-// SP + 4*kWordSize: address of stacktrace object.
-// SP + 5*kWordSize: address of thread.
+// A3: thread.
 // Does not return.
-void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) {
+void StubCode::GenerateJumpToFrameStub(Assembler* assembler) {
   ASSERT(kExceptionObjectReg == V0);
   ASSERT(kStackTraceObjectReg == V1);
-  __ mov(V0, A3);  // Exception object.
-  // MIPS ABI reserves stack space for all arguments. The StackTrace object is
-  // the last of five arguments, so it is first pushed on the stack.
-  __ lw(V1, Address(SP, 4 * kWordSize));  // StackTrace object.
-  __ mov(FP, A2);  // Frame_pointer.
-  __ lw(THR, Address(SP, 5 * kWordSize));  // Thread.
+  __ mov(FP, A2);   // Frame_pointer.
+  __ mov(THR, A3);  // Thread.
   // Set tag.
   __ LoadImmediate(A2, VMTag::kDartTagId);
   __ sw(A2, Assembler::VMTagAddress());
@@ -2007,11 +2000,34 @@
   // Restore pool pointer.
   __ RestoreCodePointer();
   __ LoadPoolPointer();
-  __ jr(A0);  // Jump to the exception handler code.
+  __ jr(A0);                     // Jump to the program counter.
   __ delay_slot()->mov(SP, A1);  // Stack pointer.
 }
 
 
+// Run an exception handler.  Execution comes from JumpToFrame
+// stub or from the simulator.
+//
+// The arguments are stored in the Thread object.
+// Does not return.
+void StubCode::GenerateRunExceptionHandlerStub(Assembler* assembler) {
+  __ lw(A0, Address(THR, Thread::resume_pc_offset()));
+  __ LoadImmediate(A2, 0);
+
+  // Load the exception from the current thread.
+  Address exception_addr(THR, Thread::active_exception_offset());
+  __ lw(V0, exception_addr);
+  __ sw(A2, exception_addr);
+
+  // Load the stacktrace from the current thread.
+  Address stacktrace_addr(THR, Thread::active_stacktrace_offset());
+  __ lw(V1, stacktrace_addr);
+
+  __ jr(A0);  // Jump to continuation point.
+  __ delay_slot()->sw(A2, stacktrace_addr);
+}
+
+
 // Calls to the runtime to optimize the given function.
 // T0: function to be reoptimized.
 // S4: argument descriptor (preserved).
@@ -2025,12 +2041,13 @@
   __ sw(T0, Address(SP, 0 * kWordSize));
   __ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry, 1);
   __ Comment("OptimizeFunctionStub return");
-  __ lw(CODE_REG, Address(SP, 1 * kWordSize));  // Get Code object
-  __ lw(S4, Address(SP, 2 * kWordSize));  // Restore argument descriptor.
+  __ lw(T0, Address(SP, 1 * kWordSize));       // Get Function object
+  __ lw(S4, Address(SP, 2 * kWordSize));       // Restore argument descriptor.
   __ addiu(SP, SP, Immediate(3 * kWordSize));  // Discard argument.
 
-  __ lw(T0, FieldAddress(CODE_REG, Code::entry_point_offset()));
-  __ LeaveStubFrameAndReturn(T0);
+  __ lw(CODE_REG, FieldAddress(T0, Function::code_offset()));
+  __ lw(T1, FieldAddress(T0, Function::entry_point_offset()));
+  __ LeaveStubFrameAndReturn(T1);
   __ break_(0);
 }
 
@@ -2181,8 +2198,6 @@
 //  CODE_REG: target Code object
 //  S4: arguments descriptor
 void StubCode::GenerateMegamorphicCallStub(Assembler* assembler) {
-  __ NoMonomorphicCheckedEntry();
-
   __ LoadTaggedClassIdMayBeSmi(T0, T0);
   // T0: class ID of the receiver (smi).
   __ lw(S4, FieldAddress(S5, MegamorphicCache::arguments_descriptor_offset()));
@@ -2234,8 +2249,6 @@
 //  CODE_REG: target Code object
 //  S4: arguments descriptor
 void StubCode::GenerateICCallThroughFunctionStub(Assembler* assembler) {
-  __ NoMonomorphicCheckedEntry();
-
   Label loop, found, miss;
   __ lw(T6, FieldAddress(S5, ICData::ic_data_offset()));
   __ lw(S4, FieldAddress(S5, ICData::arguments_descriptor_offset()));
@@ -2270,8 +2283,6 @@
 
 
 void StubCode::GenerateICCallThroughCodeStub(Assembler* assembler) {
-  __ NoMonomorphicCheckedEntry();
-
   Label loop, found, miss;
   __ lw(T6, FieldAddress(S5, ICData::ic_data_offset()));
   __ lw(S4, FieldAddress(S5, ICData::arguments_descriptor_offset()));
@@ -2309,8 +2320,6 @@
 //  T0: receiver
 //  S5: SingleTargetCache
 void StubCode::GenerateUnlinkedCallStub(Assembler* assembler) {
-  __ NoMonomorphicCheckedEntry();
-
   __ EnterStubFrame();
   __ Push(T0);  // Preserve receiver.
 
@@ -2336,10 +2345,7 @@
 // Passed to target:
 //  CODE_REG: target Code object
 void StubCode::GenerateSingleTargetCallStub(Assembler* assembler) {
-  __ NoMonomorphicCheckedEntry();
-
   Label miss;
-
   __ LoadClassIdMayBeSmi(T1, T0);
   __ lhu(T2, FieldAddress(S5, SingleTargetCache::lower_limit_offset()));
   __ lhu(T3, FieldAddress(S5, SingleTargetCache::upper_limit_offset()));
@@ -2373,6 +2379,7 @@
 // Called from the monomorphic checked entry.
 //  T0: receiver
 void StubCode::GenerateMonomorphicMissStub(Assembler* assembler) {
+  __ lw(CODE_REG, Address(THR, Thread::monomorphic_miss_stub_offset()));
   __ EnterStubFrame();
   __ Push(T0);  // Preserve receiver.
 
diff --git a/runtime/vm/stub_code_mips_test.cc b/runtime/vm/stub_code_mips_test.cc
index 65ff616..13e3101 100644
--- a/runtime/vm/stub_code_mips_test.cc
+++ b/runtime/vm/stub_code_mips_test.cc
@@ -20,25 +20,23 @@
 namespace dart {
 
 static Function* CreateFunction(const char* name) {
-  const String& class_name = String::Handle(Symbols::New(Thread::Current(),
-                                                         "ownerClass"));
+  const String& class_name =
+      String::Handle(Symbols::New(Thread::Current(), "ownerClass"));
   const Script& script = Script::Handle();
   const Library& lib = Library::Handle(Library::New(class_name));
   const Class& owner_class = Class::Handle(
       Class::New(lib, class_name, script, TokenPosition::kNoSource));
-  const String& function_name = String::ZoneHandle(
-      Symbols::New(Thread::Current(), name));
-  Function& function = Function::ZoneHandle(
-      Function::New(function_name, RawFunction::kRegularFunction,
-                    true, false, false, false, false, owner_class,
-                    TokenPosition::kNoSource));
+  const String& function_name =
+      String::ZoneHandle(Symbols::New(Thread::Current(), name));
+  Function& function = Function::ZoneHandle(Function::New(
+      function_name, RawFunction::kRegularFunction, true, false, false, false,
+      false, owner_class, TokenPosition::kNoSource));
   return &function;
 }
 
 
 // Test calls to stub code which calls into the runtime.
-static void GenerateCallToCallRuntimeStub(Assembler* assembler,
-                                          int length) {
+static void GenerateCallToCallRuntimeStub(Assembler* assembler, int length) {
   const int argc = 2;
   const Smi& smi_length = Smi::ZoneHandle(Smi::New(length));
   __ EnterDartFrame(0);
diff --git a/runtime/vm/stub_code_x64.cc b/runtime/vm/stub_code_x64.cc
index 6ec5ba1..167154b 100644
--- a/runtime/vm/stub_code_x64.cc
+++ b/runtime/vm/stub_code_x64.cc
@@ -23,8 +23,10 @@
 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.");
+DEFINE_FLAG(bool,
+            use_slow_path,
+            false,
+            "Set to true for debugging & verifying the slow paths.");
 DECLARE_FLAG(bool, trace_optimized_ic_calls);
 
 // Input parameters:
@@ -48,7 +50,8 @@
   __ movq(Address(THR, Thread::top_exit_frame_info_offset()), RBP);
 
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that we are always entering from Dart code.
     __ movq(RAX, Immediate(VMTag::kDartTagId));
     __ cmpq(RAX, Assembler::VMTagAddress());
@@ -74,8 +77,8 @@
   __ movq(Address(RSP, argc_tag_offset), R10);  // Set argc in NativeArguments.
   // Compute argv.
   __ leaq(RAX, Address(RBP, R10, TIMES_8, kParamEndSlotFromFp * kWordSize));
-  __ movq(Address(RSP, argv_offset), RAX);  // Set argv in NativeArguments.
-  __ addq(RAX, Immediate(1 * kWordSize));  // Retval is next to 1st argument.
+  __ movq(Address(RSP, argv_offset), RAX);    // Set argv in NativeArguments.
+  __ addq(RAX, Immediate(1 * kWordSize));     // Retval is next to 1st argument.
   __ movq(Address(RSP, retval_offset), RAX);  // Set retval in NativeArguments.
 #if defined(_WIN64)
   ASSERT(sizeof(NativeArguments) > CallingConventions::kRegisterTransferLimit);
@@ -107,7 +110,7 @@
 // Must preserve all registers.
 void StubCode::GeneratePrintStopMessageStub(Assembler* assembler) {
   __ EnterCallRuntimeFrame(0);
-  // Call the runtime leaf function. RDI already contains the parameter.
+// Call the runtime leaf function. RDI already contains the parameter.
 #if defined(_WIN64)
   __ movq(CallingConventions::kArg1Reg, RDI);
 #endif
@@ -141,7 +144,8 @@
   __ movq(Address(THR, Thread::top_exit_frame_info_offset()), RBP);
 
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that we are always entering from Dart code.
     __ movq(R8, Immediate(VMTag::kDartTagId));
     __ cmpq(R8, Assembler::VMTagAddress());
@@ -163,10 +167,10 @@
   }
 
   // Pass NativeArguments structure by value and call native function.
-  __ movq(Address(RSP, thread_offset), THR);  // Set thread in NativeArgs.
+  __ movq(Address(RSP, thread_offset), THR);    // Set thread in NativeArgs.
   __ movq(Address(RSP, argc_tag_offset), R10);  // Set argc in NativeArguments.
-  __ movq(Address(RSP, argv_offset), RAX);  // Set argv in NativeArguments.
-  __ leaq(RAX, Address(RBP, 2 * kWordSize));  // Compute return value addr.
+  __ movq(Address(RSP, argv_offset), RAX);      // Set argv in NativeArguments.
+  __ leaq(RAX, Address(RBP, 2 * kWordSize));    // Compute return value addr.
   __ movq(Address(RSP, retval_offset), RAX);  // Set retval in NativeArguments.
 
   // Pass the pointer to the NativeArguments.
@@ -212,7 +216,8 @@
   __ movq(Address(THR, Thread::top_exit_frame_info_offset()), RBP);
 
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that we are always entering from Dart code.
     __ movq(R8, Immediate(VMTag::kDartTagId));
     __ cmpq(R8, Assembler::VMTagAddress());
@@ -234,10 +239,10 @@
   }
 
   // Pass NativeArguments structure by value and call native function.
-  __ movq(Address(RSP, thread_offset), THR);  // Set thread in NativeArgs.
+  __ movq(Address(RSP, thread_offset), THR);    // Set thread in NativeArgs.
   __ movq(Address(RSP, argc_tag_offset), R10);  // Set argc in NativeArguments.
-  __ movq(Address(RSP, argv_offset), RAX);  // Set argv in NativeArguments.
-  __ leaq(RAX, Address(RBP, 2 * kWordSize));  // Compute return value addr.
+  __ movq(Address(RSP, argv_offset), RAX);      // Set argv in NativeArguments.
+  __ leaq(RAX, Address(RBP, 2 * kWordSize));    // Compute return value addr.
   __ movq(Address(RSP, retval_offset), RAX);  // Set retval in NativeArguments.
 
   // Pass the pointer to the NativeArguments.
@@ -264,7 +269,7 @@
   __ pushq(Immediate(0));
   __ CallRuntime(kPatchStaticCallRuntimeEntry, 0);
   __ popq(CODE_REG);  // Get Code object result.
-  __ popq(R10);  // Restore arguments descriptor array.
+  __ popq(R10);       // Restore arguments descriptor array.
   // Remove the stub frame as we are about to jump to the dart function.
   __ LeaveStubFrame();
 
@@ -287,7 +292,7 @@
   __ pushq(Immediate(0));
   __ CallRuntime(kFixCallersTargetRuntimeEntry, 0);
   __ popq(CODE_REG);  // Get Code object.
-  __ popq(R10);  // Restore arguments descriptor array.
+  __ popq(R10);       // Restore arguments descriptor array.
   __ movq(RAX, FieldAddress(CODE_REG, Code::entry_point_offset()));
   __ LeaveStubFrame();
   __ jmp(RAX);
@@ -412,8 +417,8 @@
 
   // Pass address of saved registers block.
   __ movq(CallingConventions::kArg1Reg, RSP);
-  bool is_lazy = (kind == kLazyDeoptFromReturn) ||
-                 (kind == kLazyDeoptFromThrow);
+  bool is_lazy =
+      (kind == kLazyDeoptFromReturn) || (kind == kLazyDeoptFromThrow);
   __ movq(CallingConventions::kArg2Reg, Immediate(is_lazy ? 1 : 0));
   __ ReserveAlignedFrameSpace(0);  // Ensure stack is aligned before the call.
   __ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry, 2);
@@ -432,10 +437,10 @@
   __ RestoreCodePointer();
   __ LeaveStubFrame();
 
-  __ popq(RCX);   // Preserve return address.
+  __ popq(RCX);       // Preserve return address.
   __ movq(RSP, RBP);  // Discard optimized frame.
   __ subq(RSP, RAX);  // Reserve space for deoptimized frame.
-  __ pushq(RCX);  // Restore return address.
+  __ pushq(RCX);      // Restore return address.
 
   // DeoptimizeFillFrame expects a Dart frame, i.e. EnterDartFrame(0), but there
   // is no need to set the correct PC marker or load PP, since they get patched.
@@ -490,38 +495,32 @@
   }
   __ LeaveStubFrame();
 
-  __ popq(RCX);  // Pop return address.
+  __ popq(RCX);       // Pop return address.
   __ addq(RSP, RBX);  // Remove materialization arguments.
-  __ pushq(RCX);  // Push return address.
+  __ pushq(RCX);      // Push return address.
   __ ret();
 }
 
 
-// TOS: return address + call-instruction-size (5 bytes).
 // RAX: result, must be preserved
 void StubCode::GenerateDeoptimizeLazyFromReturnStub(Assembler* assembler) {
-  // Correct return address to point just after the call that is being
-  // deoptimized.
-  __ popq(RBX);
-  __ subq(RBX, Immediate(ShortCallPattern::pattern_length_in_bytes()));
   // Push zap value instead of CODE_REG for lazy deopt.
   __ pushq(Immediate(0xf1f1f1f1));
-  __ pushq(RBX);
+  // Return address for "call" to deopt stub.
+  __ pushq(Immediate(0xe1e1e1e1));
+  __ movq(CODE_REG, Address(THR, Thread::lazy_deopt_from_return_stub_offset()));
   GenerateDeoptimizationSequence(assembler, kLazyDeoptFromReturn);
 }
 
 
-// TOS: return address + call-instruction-size (5 bytes).
 // RAX: exception, must be preserved
 // RDX: stacktrace, must be preserved
 void StubCode::GenerateDeoptimizeLazyFromThrowStub(Assembler* assembler) {
-  // Correct return address to point just after the call that is being
-  // deoptimized.
-  __ popq(RBX);
-  __ subq(RBX, Immediate(ShortCallPattern::pattern_length_in_bytes()));
   // Push zap value instead of CODE_REG for lazy deopt.
   __ pushq(Immediate(0xf1f1f1f1));
-  __ pushq(RBX);
+  // Return address for "call" to deopt stub.
+  __ pushq(Immediate(0xe1e1e1e1));
+  __ movq(CODE_REG, Address(THR, Thread::lazy_deopt_from_throw_stub_offset()));
   GenerateDeoptimizationSequence(assembler, kLazyDeoptFromThrow);
 }
 
@@ -541,12 +540,12 @@
   __ EnterStubFrame();
   // Load the receiver.
   __ movq(RDI, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
-  __ movq(RAX, Address(
-      RBP, RDI, TIMES_HALF_WORD_SIZE, kParamEndSlotFromFp * kWordSize));
+  __ movq(RAX, Address(RBP, RDI, TIMES_HALF_WORD_SIZE,
+                       kParamEndSlotFromFp * kWordSize));
   __ pushq(Immediate(0));  // Setup space on stack for result.
-  __ pushq(RAX);  // Receiver.
-  __ pushq(RBX);  // ICData/MegamorphicCache.
-  __ pushq(R10);  // Arguments descriptor array.
+  __ pushq(RAX);           // Receiver.
+  __ pushq(RBX);           // ICData/MegamorphicCache.
+  __ pushq(R10);           // Arguments descriptor array.
   __ movq(R10, RDI);
   // EDX: Smi-tagged arguments array length.
   PushArgumentsArray(assembler);
@@ -566,8 +565,8 @@
   __ movq(RAX, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
   // Three words (saved pp, saved fp, stub's pc marker)
   // in the stack above the return address.
-  __ movq(RAX, Address(RSP, RAX, TIMES_4,
-                       kSavedAboveReturnAddress * kWordSize));
+  __ movq(RAX,
+          Address(RSP, RAX, TIMES_4, kSavedAboveReturnAddress * kWordSize));
   // Preserve IC data and arguments descriptor.
   __ pushq(RBX);
   __ pushq(R10);
@@ -626,9 +625,8 @@
   __ j(GREATER, &slow_case);
 
   // Check for allocation tracing.
-  NOT_IN_PRODUCT(__ MaybeTraceAllocation(kArrayCid,
-                                         &slow_case,
-                                         Assembler::kFarJump));
+  NOT_IN_PRODUCT(
+      __ MaybeTraceAllocation(kArrayCid, &slow_case, Assembler::kFarJump));
 
   const intptr_t fixed_size = sizeof(RawArray) + kObjectAlignment - 1;
   __ leaq(RDI, Address(RDI, TIMES_4, fixed_size));  // RDI is a Smi.
@@ -680,13 +678,11 @@
   // RAX: new object start as a tagged pointer.
   // Store the type argument field.
   // No generetional barrier needed, since we store into a new object.
-  __ StoreIntoObjectNoBarrier(RAX,
-                              FieldAddress(RAX, Array::type_arguments_offset()),
-                              RBX);
+  __ StoreIntoObjectNoBarrier(
+      RAX, FieldAddress(RAX, Array::type_arguments_offset()), RBX);
 
   // Set the length field.
-  __ StoreIntoObjectNoBarrier(RAX,
-                              FieldAddress(RAX, Array::length_offset()),
+  __ StoreIntoObjectNoBarrier(RAX, FieldAddress(RAX, Array::length_offset()),
                               R10);
 
   // Initialize all array elements to raw_null.
@@ -744,9 +740,9 @@
   __ EnterFrame(0);
 
   const Register kTargetCodeReg = CallingConventions::kArg1Reg;
-  const Register kArgDescReg    = CallingConventions::kArg2Reg;
-  const Register kArgsReg       = CallingConventions::kArg3Reg;
-  const Register kThreadReg     = CallingConventions::kArg4Reg;
+  const Register kArgDescReg = CallingConventions::kArg2Reg;
+  const Register kArgsReg = CallingConventions::kArg3Reg;
+  const Register kThreadReg = CallingConventions::kArg4Reg;
 
   // Push code object to PC marker slot.
   __ pushq(Address(kThreadReg, Thread::invoke_dart_code_stub_offset()));
@@ -758,7 +754,7 @@
 
   const intptr_t kInitialOffset = 2;
   // Save arguments descriptor array.
-  const intptr_t kArgumentsDescOffset = -(kInitialOffset) * kWordSize;
+  const intptr_t kArgumentsDescOffset = -(kInitialOffset)*kWordSize;
   __ pushq(kArgDescReg);
 
   // Save C++ ABI callee-saved registers.
@@ -784,8 +780,7 @@
   // StackFrameIterator reads the top exit frame info saved in this frame.
   __ movq(RAX, Address(THR, Thread::top_resource_offset()));
   __ pushq(RAX);
-  __ movq(Address(THR, Thread::top_resource_offset()),
-          Immediate(0));
+  __ movq(Address(THR, Thread::top_resource_offset()), Immediate(0));
   __ movq(RAX, Address(THR, Thread::top_exit_frame_info_offset()));
   // The constant kExitLinkSlotFromEntryFp must be kept in sync with the
   // code below.
@@ -801,8 +796,7 @@
   }
 #endif
 
-  __ movq(Address(THR, Thread::top_exit_frame_info_offset()),
-          Immediate(0));
+  __ movq(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0));
 
   // Load arguments descriptor array into R10, which is passed to Dart code.
   __ movq(R10, Address(kArgDescReg, VMHandles::kOffsetOfRawPtrInHandle));
@@ -881,9 +875,8 @@
     __ andq(R13, Immediate(-kObjectAlignment));
 
     // Check for allocation tracing.
-    NOT_IN_PRODUCT(__ MaybeTraceAllocation(kContextCid,
-                                           &slow_case,
-                                           Assembler::kFarJump));
+    NOT_IN_PRODUCT(
+        __ MaybeTraceAllocation(kContextCid, &slow_case, Assembler::kFarJump));
 
     // Now allocate the object.
     // R10: number of context variables.
@@ -937,8 +930,7 @@
       // RAX: new object.
       // R10: number of context variables.
       // R13: size and bit tags.
-      __ orq(R13,
-             Immediate(RawObject::ClassIdTag::encode(cid)));
+      __ orq(R13, Immediate(RawObject::ClassIdTag::encode(cid)));
       __ movq(FieldAddress(RAX, Context::tags_offset()), R13);  // Tags.
     }
 
@@ -951,9 +943,8 @@
     // RAX: new object.
     // R10: number of context variables.
     // No generational barrier needed, since we are storing null.
-    __ StoreIntoObjectNoBarrier(RAX,
-                                FieldAddress(RAX, Context::parent_offset()),
-                                R9);
+    __ StoreIntoObjectNoBarrier(
+        RAX, FieldAddress(RAX, Context::parent_offset()), R9);
 
     // Initialize the context variables.
     // RAX: new object.
@@ -970,9 +961,7 @@
       __ Bind(&loop);
       __ decq(R10);
       // No generational barrier needed, since we are storing null.
-      __ StoreIntoObjectNoBarrier(RAX,
-                                  Address(R13, R10, TIMES_8, 0),
-                                  R9);
+      __ StoreIntoObjectNoBarrier(RAX, Address(R13, R10, TIMES_8, 0), R9);
       __ Bind(&entry);
       __ cmpq(R10, Immediate(0));
       __ j(NOT_EQUAL, &loop, Assembler::kNearJump);
@@ -1129,11 +1118,8 @@
       // Check if the object contains any non-header fields.
       // Small objects are initialized using a consecutive set of writes.
       for (intptr_t current_offset = Instance::NextFieldOffset();
-           current_offset < instance_size;
-           current_offset += kWordSize) {
-        __ StoreIntoObjectNoBarrier(RAX,
-                                    FieldAddress(RAX, current_offset),
-                                    R9);
+           current_offset < instance_size; current_offset += kWordSize) {
+        __ StoreIntoObjectNoBarrier(RAX, FieldAddress(RAX, current_offset), R9);
       }
     } else {
       __ leaq(RCX, FieldAddress(RAX, Instance::NextFieldOffset()));
@@ -1174,8 +1160,8 @@
   // RDX: new object type arguments.
   // Create a stub frame.
   __ EnterStubFrame();  // Uses PP to access class object.
-  __ pushq(R9);  // Setup space on stack for return value.
-  __ PushObject(cls);  // Push class of object to be allocated.
+  __ pushq(R9);         // Setup space on stack for return value.
+  __ PushObject(cls);   // Push class of object to be allocated.
   if (is_cls_parameterized) {
     __ pushq(RDX);  // Push type arguments of object to be allocated.
   } else {
@@ -1207,8 +1193,8 @@
   __ movq(RAX, Address(RBP, R13, TIMES_4, kParamEndSlotFromFp * kWordSize));
 
   __ pushq(Immediate(0));  // Result slot.
-  __ pushq(RAX);  // Receiver.
-  __ pushq(R10);  // Arguments descriptor array.
+  __ pushq(RAX);           // Receiver.
+  __ pushq(R10);           // Arguments descriptor array.
 
   __ movq(R10, R13);  // Smi-tagged arguments array length.
   PushArgumentsArray(assembler);
@@ -1227,15 +1213,15 @@
   Register func_reg = RDI;
   if (FLAG_trace_optimized_ic_calls) {
     __ EnterStubFrame();
-    __ pushq(func_reg);     // Preserve
-    __ pushq(ic_reg);       // Preserve.
-    __ pushq(ic_reg);       // Argument.
-    __ pushq(func_reg);     // Argument.
+    __ pushq(func_reg);  // Preserve
+    __ pushq(ic_reg);    // Preserve.
+    __ pushq(ic_reg);    // Argument.
+    __ pushq(func_reg);  // Argument.
     __ CallRuntime(kTraceICCallRuntimeEntry, 2);
-    __ popq(RAX);          // Discard argument;
-    __ popq(RAX);          // Discard argument;
-    __ popq(ic_reg);       // Restore.
-    __ popq(func_reg);     // Restore.
+    __ popq(RAX);       // Discard argument;
+    __ popq(RAX);       // Discard argument;
+    __ popq(ic_reg);    // Restore.
+    __ popq(func_reg);  // Restore.
     __ LeaveStubFrame();
   }
   __ incl(FieldAddress(func_reg, Function::usage_counter_offset()));
@@ -1266,8 +1252,8 @@
                           Label* not_smi_or_overflow) {
   __ Comment("Fast Smi op");
   ASSERT(num_args == 2);
-  __ movq(RCX, Address(RSP, + 1 * kWordSize));  // Right
-  __ movq(RAX, Address(RSP, + 2 * kWordSize));  // Left.
+  __ movq(RCX, Address(RSP, +1 * kWordSize));  // Right
+  __ movq(RAX, Address(RSP, +2 * kWordSize));  // Left.
   __ movq(R13, RCX);
   __ orq(R13, RAX);
   __ testq(R13, Immediate(kSmiTagMask));
@@ -1294,14 +1280,15 @@
       __ Bind(&done);
       break;
     }
-    default: UNIMPLEMENTED();
+    default:
+      UNIMPLEMENTED();
   }
 
   // RBX: IC data object (preserved).
   __ movq(R13, FieldAddress(RBX, ICData::ic_data_offset()));
   // R13: ic_data_array with check entries: classes and target functions.
   __ leaq(R13, FieldAddress(R13, Array::data_offset()));
-  // R13: points directly to the first ic data array element.
+// R13: points directly to the first ic data array element.
 #if defined(DEBUG)
   // Check that first entry is for Smi/Smi.
   Label error, ok;
@@ -1348,7 +1335,8 @@
     bool optimized) {
   ASSERT(num_args > 0);
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that the IC data array has NumArgsTested() == num_args.
     // 'NumArgsTested' is stored in the least significant bits of 'state_bits'.
     __ movl(RCX, FieldAddress(RBX, ICData::state_bits_offset()));
@@ -1372,11 +1360,7 @@
 
   Label not_smi_or_overflow;
   if (kind != Token::kILLEGAL) {
-    EmitFastSmiOp(
-        assembler,
-        kind,
-        num_args,
-        &not_smi_or_overflow);
+    EmitFastSmiOp(assembler, kind, num_args, &not_smi_or_overflow);
   }
   __ Bind(&not_smi_or_overflow);
 
@@ -1406,7 +1390,7 @@
     if (i > 0) {
       // If not the first, load the next argument's class ID.
       __ movq(RAX, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
-      __ movq(R9, Address(RSP, RAX, TIMES_4, - i * kWordSize));
+      __ movq(R9, Address(RSP, RAX, TIMES_4, -i * kWordSize));
       __ LoadTaggedClassIdMayBeSmi(RAX, R9);
       // RAX: next argument class ID (smi).
       __ movq(R9, Address(R13, i * kWordSize));
@@ -1430,7 +1414,7 @@
 
   const intptr_t entry_size = ICData::TestEntryLengthFor(num_args) * kWordSize;
   __ addq(R13, Immediate(entry_size));  // Next entry.
-  __ movq(R9, Address(R13, 0));  // Next class ID.
+  __ movq(R9, Address(R13, 0));         // Next class ID.
 
   __ Bind(&test);
   __ cmpq(R9, Immediate(Smi::RawValue(kIllegalCid)));  // Done?
@@ -1442,8 +1426,8 @@
   __ movq(RAX, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
   __ leaq(RAX, Address(RSP, RAX, TIMES_4, 0));  // RAX is Smi.
   __ EnterStubFrame();
-  __ pushq(R10);  // Preserve arguments descriptor array.
-  __ pushq(RBX);  // Preserve IC data object.
+  __ pushq(R10);           // Preserve arguments descriptor array.
+  __ pushq(RBX);           // Preserve IC data object.
   __ pushq(Immediate(0));  // Result slot.
   // Push call arguments.
   for (intptr_t i = 0; i < num_args; i++) {
@@ -1517,41 +1501,37 @@
 //   - 1 target function.
 void StubCode::GenerateOneArgCheckInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, RCX);
-  GenerateNArgsCheckInlineCacheStub(assembler, 1,
-      kInlineCacheMissHandlerOneArgRuntimeEntry,
-      Token::kILLEGAL);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 1, kInlineCacheMissHandlerOneArgRuntimeEntry, Token::kILLEGAL);
 }
 
 
 void StubCode::GenerateTwoArgsCheckInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, RCX);
   GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry,
-      Token::kILLEGAL);
+                                    kInlineCacheMissHandlerTwoArgsRuntimeEntry,
+                                    Token::kILLEGAL);
 }
 
 
 void StubCode::GenerateSmiAddInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, RCX);
-  GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry,
-      Token::kADD);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 2, kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kADD);
 }
 
 
 void StubCode::GenerateSmiSubInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, RCX);
-  GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry,
-      Token::kSUB);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 2, kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kSUB);
 }
 
 
 void StubCode::GenerateSmiEqualInlineCacheStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, RCX);
-  GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry,
-      Token::kEQ);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 2, kInlineCacheMissHandlerTwoArgsRuntimeEntry, Token::kEQ);
 }
 
 
@@ -1570,9 +1550,8 @@
     Assembler* assembler) {
   GenerateOptimizedUsageCounterIncrement(assembler);
   GenerateNArgsCheckInlineCacheStub(assembler, 1,
-      kInlineCacheMissHandlerOneArgRuntimeEntry,
-      Token::kILLEGAL,
-      true /* optimized */);
+                                    kInlineCacheMissHandlerOneArgRuntimeEntry,
+                                    Token::kILLEGAL, true /* optimized */);
 }
 
 
@@ -1580,9 +1559,8 @@
     Assembler* assembler) {
   GenerateOptimizedUsageCounterIncrement(assembler);
   GenerateNArgsCheckInlineCacheStub(assembler, 2,
-      kInlineCacheMissHandlerTwoArgsRuntimeEntry,
-      Token::kILLEGAL,
-      true /* optimized */);
+                                    kInlineCacheMissHandlerTwoArgsRuntimeEntry,
+                                    Token::kILLEGAL, true /* optimized */);
 }
 
 
@@ -1592,7 +1570,8 @@
 void StubCode::GenerateZeroArgsUnoptimizedStaticCallStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, RCX);
 #if defined(DEBUG)
-  { Label ok;
+  {
+    Label ok;
     // Check that the IC data array has NumArgsTested() == 0.
     // 'NumArgsTested' is stored in the least significant bits of 'state_bits'.
     __ movl(RCX, FieldAddress(RBX, ICData::state_bits_offset()));
@@ -1612,9 +1591,9 @@
     __ movzxb(RAX, Address(RAX, Isolate::single_step_offset()));
     __ cmpq(RAX, Immediate(0));
 #if defined(DEBUG)
-      static const bool kJumpLength = Assembler::kFarJump;
+    static const bool kJumpLength = Assembler::kFarJump;
 #else
-      static const bool kJumpLength = Assembler::kNearJump;
+    static const bool kJumpLength = Assembler::kNearJump;
 #endif  // DEBUG
     __ j(NOT_EQUAL, &stepping, kJumpLength);
     __ Bind(&done_stepping);
@@ -1662,19 +1641,14 @@
 void StubCode::GenerateOneArgUnoptimizedStaticCallStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, RCX);
   GenerateNArgsCheckInlineCacheStub(
-      assembler,
-      1,
-      kStaticCallMissHandlerOneArgRuntimeEntry,
-      Token::kILLEGAL);
+      assembler, 1, kStaticCallMissHandlerOneArgRuntimeEntry, Token::kILLEGAL);
 }
 
 
 void StubCode::GenerateTwoArgsUnoptimizedStaticCallStub(Assembler* assembler) {
   GenerateUsageCounterIncrement(assembler, RCX);
-  GenerateNArgsCheckInlineCacheStub(assembler,
-      2,
-      kStaticCallMissHandlerTwoArgsRuntimeEntry,
-      Token::kILLEGAL);
+  GenerateNArgsCheckInlineCacheStub(
+      assembler, 2, kStaticCallMissHandlerTwoArgsRuntimeEntry, Token::kILLEGAL);
 }
 
 
@@ -1703,15 +1677,15 @@
 // TOS(0): return address (Dart code).
 void StubCode::GenerateICCallBreakpointStub(Assembler* assembler) {
   __ EnterStubFrame();
-  __ pushq(RBX);  // Preserve IC data.
+  __ pushq(RBX);           // Preserve IC data.
   __ pushq(Immediate(0));  // Result slot.
   __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
   __ popq(CODE_REG);  // Original stub.
-  __ popq(RBX);  // Restore IC data.
+  __ popq(RBX);       // Restore IC data.
   __ LeaveStubFrame();
 
   __ movq(RAX, FieldAddress(CODE_REG, Code::entry_point_offset()));
-  __ jmp(RAX);   // Jump to original stub.
+  __ jmp(RAX);  // Jump to original stub.
 }
 
 
@@ -1724,7 +1698,7 @@
   __ LeaveStubFrame();
 
   __ movq(RAX, FieldAddress(CODE_REG, Code::entry_point_offset()));
-  __ jmp(RAX);   // Jump to original stub.
+  __ jmp(RAX);  // Jump to original stub.
 }
 
 
@@ -1765,8 +1739,9 @@
     // Compute instance type arguments into R13.
     Label has_no_type_arguments;
     __ movq(R13, R9);
-    __ movl(RDI, FieldAddress(R10,
-        Class::type_arguments_field_offset_in_words_offset()));
+    __ movl(RDI,
+            FieldAddress(R10,
+                         Class::type_arguments_field_offset_in_words_offset()));
     __ cmpl(RDI, Immediate(Class::kNoTypeArguments));
     __ j(EQUAL, &has_no_type_arguments, Assembler::kNearJump);
     __ movq(R13, FieldAddress(RAX, RDI, TIMES_8, 0));
@@ -1789,9 +1764,8 @@
   __ movq(R10, FieldAddress(RAX, Closure::function_offset()));
   // R10: instance class id as Smi or function.
   __ Bind(&loop);
-  __ movq(RDI,
-          Address(RDX,
-                  kWordSize * SubtypeTestCache::kInstanceClassIdOrFunction));
+  __ movq(RDI, Address(RDX, kWordSize *
+                                SubtypeTestCache::kInstanceClassIdOrFunction));
   __ cmpq(RDI, R9);
   __ j(EQUAL, &not_found, Assembler::kNearJump);
   __ cmpq(RDI, R10);
@@ -1800,15 +1774,15 @@
   } else {
     __ j(NOT_EQUAL, &next_iteration, Assembler::kNearJump);
     __ movq(RDI,
-        Address(RDX, kWordSize * SubtypeTestCache::kInstanceTypeArguments));
+            Address(RDX, kWordSize * SubtypeTestCache::kInstanceTypeArguments));
     __ cmpq(RDI, R13);
     if (n == 2) {
       __ j(EQUAL, &found, Assembler::kNearJump);
     } else {
       __ j(NOT_EQUAL, &next_iteration, Assembler::kNearJump);
       __ movq(RDI,
-          Address(RDX,
-                  kWordSize * SubtypeTestCache::kInstantiatorTypeArguments));
+              Address(RDX, kWordSize *
+                               SubtypeTestCache::kInstantiatorTypeArguments));
       __ cmpq(RDI, Address(RSP, kInstantiatorTypeArgumentsInBytes));
       __ j(EQUAL, &found, Assembler::kNearJump);
     }
@@ -1871,42 +1845,49 @@
 }
 
 
-// Jump to the exception or error handler.
+// Jump to a frame on the call stack.
 // TOS + 0: return address
 // Arg1: program counter
 // Arg2: stack pointer
 // Arg3: frame_pointer
-// Arg4: exception object
-// Arg5: stacktrace object
-// Arg6: thread
+// Arg4: thread
 // No Result.
-void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) {
-  ASSERT(kExceptionObjectReg == RAX);
-  ASSERT(kStackTraceObjectReg == RDX);
-  ASSERT(CallingConventions::kArg4Reg != kStackTraceObjectReg);
-  ASSERT(CallingConventions::kArg1Reg != kStackTraceObjectReg);
-
-#if defined(_WIN64)
-  Register stacktrace_reg = RBX;
-  __ movq(stacktrace_reg, Address(RSP, 5 * kWordSize));
-  __ movq(THR, Address(RSP, 6 * kWordSize));
-#else
-  Register stacktrace_reg = CallingConventions::kArg5Reg;
-  __ movq(THR, CallingConventions::kArg6Reg);
-#endif
+void StubCode::GenerateJumpToFrameStub(Assembler* assembler) {
+  __ movq(THR, CallingConventions::kArg4Reg);
   __ movq(RBP, CallingConventions::kArg3Reg);
   __ movq(RSP, CallingConventions::kArg2Reg);
-  __ movq(kStackTraceObjectReg, stacktrace_reg);
-  __ movq(kExceptionObjectReg, CallingConventions::kArg4Reg);
   // Set the tag.
   __ movq(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
   // Clear top exit frame.
-  __ movq(Address(THR, Thread::top_exit_frame_info_offset()),
-          Immediate(0));
+  __ movq(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0));
   // Restore the pool pointer.
   __ RestoreCodePointer();
   __ LoadPoolPointer(PP);
-  __ jmp(CallingConventions::kArg1Reg);  // Jump to the exception handler code.
+  __ jmp(CallingConventions::kArg1Reg);  // Jump to program counter.
+}
+
+
+// Run an exception handler.  Execution comes from JumpToFrame stub.
+//
+// The arguments are stored in the Thread object.
+// No result.
+void StubCode::GenerateRunExceptionHandlerStub(Assembler* assembler) {
+  ASSERT(kExceptionObjectReg == RAX);
+  ASSERT(kStackTraceObjectReg == RDX);
+  __ movq(CallingConventions::kArg1Reg,
+          Address(THR, Thread::resume_pc_offset()));
+
+  // Load the exception from the current thread.
+  Address exception_addr(THR, Thread::active_exception_offset());
+  __ movq(kExceptionObjectReg, exception_addr);
+  __ movq(exception_addr, Immediate(0));
+
+  // Load the stacktrace from the current thread.
+  Address stacktrace_addr(THR, Thread::active_stacktrace_offset());
+  __ movq(kStackTraceObjectReg, stacktrace_addr);
+  __ movq(stacktrace_addr, Immediate(0));
+
+  __ jmp(CallingConventions::kArg1Reg);  // Jump to continuation point.
 }
 
 
@@ -1915,16 +1896,17 @@
 // R10: argument descriptor (preserved).
 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) {
   __ EnterStubFrame();
-  __ pushq(R10);  // Preserve args descriptor.
+  __ pushq(R10);           // Preserve args descriptor.
   __ pushq(Immediate(0));  // Result slot.
-  __ pushq(RDI);  // Arg0: function to optimize
+  __ pushq(RDI);           // Arg0: function to optimize
   __ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry, 1);
   __ popq(RAX);  // Disard argument.
-  __ popq(CODE_REG);  // Get Code object.
+  __ popq(RAX);  // Get Code object.
   __ popq(R10);  // Restore argument descriptor.
-  __ movq(RAX, FieldAddress(CODE_REG, Code::entry_point_offset()));
   __ LeaveStubFrame();
-  __ jmp(RAX);
+  __ movq(CODE_REG, FieldAddress(RAX, Function::code_offset()));
+  __ movq(RCX, FieldAddress(RAX, Function::entry_point_offset()));
+  __ jmp(RCX);
   __ int3();
 }
 
@@ -2046,8 +2028,6 @@
 //  CODE_REG: target Code
 //  R10: arguments descriptor
 void StubCode::GenerateMegamorphicCallStub(Assembler* assembler) {
-  __ NoMonomorphicCheckedEntry();
-
   // Jump if receiver is a smi.
   Label smi_case;
   __ testq(RDI, Immediate(kSmiTagMask));
@@ -2119,10 +2099,7 @@
 //  CODE_REG: target Code object
 //  R10: arguments descriptor
 void StubCode::GenerateICCallThroughFunctionStub(Assembler* assembler) {
-  __ NoMonomorphicCheckedEntry();
-
   Label loop, found, miss;
-
   __ movq(R13, FieldAddress(RBX, ICData::ic_data_offset()));
   __ movq(R10, FieldAddress(RBX, ICData::arguments_descriptor_offset()));
   __ leaq(R13, FieldAddress(R13, Array::data_offset()));
@@ -2159,10 +2136,7 @@
 
 
 void StubCode::GenerateICCallThroughCodeStub(Assembler* assembler) {
-  __ NoMonomorphicCheckedEntry();
-
   Label loop, found, miss;
-
   __ movq(R13, FieldAddress(RBX, ICData::ic_data_offset()));
   __ movq(R10, FieldAddress(RBX, ICData::arguments_descriptor_offset()));
   __ leaq(R13, FieldAddress(R13, Array::data_offset()));
@@ -2201,8 +2175,6 @@
 //  RDI: receiver
 //  RBX: UnlinkedCall
 void StubCode::GenerateUnlinkedCallStub(Assembler* assembler) {
-  __ NoMonomorphicCheckedEntry();
-
   __ EnterStubFrame();
   __ pushq(RDI);  // Preserve receiver.
 
@@ -2229,8 +2201,6 @@
 // Passed to target::
 //  CODE_REG: target Code object
 void StubCode::GenerateSingleTargetCallStub(Assembler* assembler) {
-  __ NoMonomorphicCheckedEntry();
-
   Label miss;
   __ LoadClassIdMayBeSmi(RAX, RDI);
   __ movl(R9, FieldAddress(RBX, SingleTargetCache::lower_limit_offset()));
@@ -2265,6 +2235,7 @@
 // Called from the monomorphic checked entry.
 //  RDI: receiver
 void StubCode::GenerateMonomorphicMissStub(Assembler* assembler) {
+  __ movq(CODE_REG, Address(THR, Thread::monomorphic_miss_stub_offset()));
   __ EnterStubFrame();
   __ pushq(RDI);  // Preserve receiver.
 
diff --git a/runtime/vm/stub_code_x64_test.cc b/runtime/vm/stub_code_x64_test.cc
index 66feaeb..d217c32 100644
--- a/runtime/vm/stub_code_x64_test.cc
+++ b/runtime/vm/stub_code_x64_test.cc
@@ -20,25 +20,23 @@
 namespace dart {
 
 static Function* CreateFunction(const char* name) {
-  const String& class_name = String::Handle(Symbols::New(Thread::Current(),
-                                                         "ownerClass"));
+  const String& class_name =
+      String::Handle(Symbols::New(Thread::Current(), "ownerClass"));
   const Script& script = Script::Handle();
   const Library& lib = Library::Handle(Library::New(class_name));
   const Class& owner_class = Class::Handle(
       Class::New(lib, class_name, script, TokenPosition::kNoSource));
-  const String& function_name = String::ZoneHandle(
-      Symbols::New(Thread::Current(), name));
-  Function& function = Function::ZoneHandle(
-      Function::New(function_name, RawFunction::kRegularFunction,
-                    true, false, false, false, false, owner_class,
-                    TokenPosition::kNoSource));
+  const String& function_name =
+      String::ZoneHandle(Symbols::New(Thread::Current(), name));
+  Function& function = Function::ZoneHandle(Function::New(
+      function_name, RawFunction::kRegularFunction, true, false, false, false,
+      false, owner_class, TokenPosition::kNoSource));
   return &function;
 }
 
 
 // Test calls to stub code which calls into the runtime.
-static void GenerateCallToCallRuntimeStub(Assembler* assembler,
-                                          int length) {
+static void GenerateCallToCallRuntimeStub(Assembler* assembler, int length) {
   const int argc = 2;
   const Smi& smi_length = Smi::ZoneHandle(Smi::New(length));
   __ EnterStubFrame();
diff --git a/runtime/vm/symbols.cc b/runtime/vm/symbols.cc
index 0f91fb6..0d95289 100644
--- a/runtime/vm/symbols.cc
+++ b/runtime/vm/symbols.cc
@@ -21,38 +21,38 @@
 String* Symbols::symbol_handles_[Symbols::kMaxPredefinedId];
 
 static const char* names[] = {
+    // clang-format off
   NULL,
-
-#define DEFINE_SYMBOL_LITERAL(symbol, literal)                                 \
-  literal,
-PREDEFINED_SYMBOLS_LIST(DEFINE_SYMBOL_LITERAL)
+#define DEFINE_SYMBOL_LITERAL(symbol, literal) literal,
+  PREDEFINED_SYMBOLS_LIST(DEFINE_SYMBOL_LITERAL)
 #undef DEFINE_SYMBOL_LITERAL
-
   "",  // matches kTokenTableStart.
-
-#define DEFINE_TOKEN_SYMBOL_INDEX(t, s, p, a)                                  \
-  s,
+#define DEFINE_TOKEN_SYMBOL_INDEX(t, s, p, a) s,
   DART_TOKEN_LIST(DEFINE_TOKEN_SYMBOL_INDEX)
   DART_KEYWORD_LIST(DEFINE_TOKEN_SYMBOL_INDEX)
 #undef DEFINE_TOKEN_SYMBOL_INDEX
+    // clang-format on
 };
 
 RawString* StringFrom(const uint8_t* data, intptr_t len, Heap::Space space) {
   return String::FromLatin1(data, len, space);
 }
+
+
 RawString* StringFrom(const uint16_t* data, intptr_t len, Heap::Space space) {
   return String::FromUTF16(data, len, space);
 }
+
+
 RawString* StringFrom(const int32_t* data, intptr_t len, Heap::Space space) {
   return String::FromUTF32(data, len, space);
 }
 
 
-template<typename CharType>
+template <typename CharType>
 class CharArray {
  public:
-  CharArray(const CharType* data, intptr_t len)
-      : data_(data), len_(len) {
+  CharArray(const CharType* data, intptr_t len) : data_(data), len_(len) {
     hash_ = String::Hash(data, len);
   }
   RawString* ToSymbol() const {
@@ -69,6 +69,7 @@
     return other.Equals(data_, len_);
   }
   intptr_t Hash() const { return hash_; }
+
  private:
   const CharType* data_;
   intptr_t len_;
@@ -94,6 +95,7 @@
     return other.Equals(str_, begin_index_, len_);
   }
   intptr_t Hash() const { return hash_; }
+
  private:
   bool is_all() const { return begin_index_ == 0 && len_ == str_.Length(); }
   const String& str_;
@@ -108,8 +110,8 @@
     str_.SetCanonical();
     return str_.raw();
   } else {
-    String& result = String::Handle(
-        String::SubString(str_, begin_index_, len_, Heap::kOld));
+    String& result =
+        String::Handle(String::SubString(str_, begin_index_, len_, Heap::kOld));
     result.SetCanonical();
     result.SetHash(hash_);
     return result.raw();
@@ -130,6 +132,7 @@
     return other.EqualsConcat(str1_, str2_);
   }
   intptr_t Hash() const { return hash_; }
+
  private:
   const String& str1_;
   const String& str2_;
@@ -165,7 +168,7 @@
     // Use a comparison which does not consider the state of the canonical bit.
     return a_str.Equals(b_str, 0, a_len);
   }
-  template<typename CharType>
+  template <typename CharType>
   static bool IsMatch(const CharArray<CharType>& array, const Object& obj) {
     return array.Equals(String::Cast(obj));
   }
@@ -175,20 +178,14 @@
   static bool IsMatch(const ConcatString& concat, const Object& obj) {
     return concat.Equals(String::Cast(obj));
   }
-  static uword Hash(const Object& key) {
-    return String::Cast(key).Hash();
-  }
-  template<typename CharType>
+  static uword Hash(const Object& key) { return String::Cast(key).Hash(); }
+  template <typename CharType>
   static uword Hash(const CharArray<CharType>& array) {
     return array.Hash();
   }
-  static uword Hash(const StringSlice& slice) {
-    return slice.Hash();
-  }
-  static uword Hash(const ConcatString& concat) {
-    return concat.Hash();
-  }
-  template<typename CharType>
+  static uword Hash(const StringSlice& slice) { return slice.Hash(); }
+  static uword Hash(const ConcatString& concat) { return concat.Hash(); }
+  template <typename CharType>
   static RawObject* NewKey(const CharArray<CharType>& array) {
     return array.ToSymbol();
   }
@@ -310,8 +307,9 @@
   ASSERT(isolate != NULL);
 
   // Setup the symbol table used within the String class.
-  const intptr_t initial_size = (isolate == Dart::vm_isolate()) ?
-      kInitialVMIsolateSymtabSize : kInitialSymtabSize;
+  const intptr_t initial_size = (isolate == Dart::vm_isolate())
+                                    ? kInitialVMIsolateSymtabSize
+                                    : kInitialSymtabSize;
   Array& array =
       Array::Handle(HashTables::New<SymbolTable>(initial_size, Heap::kOld));
   isolate->object_store()->set_symbol_table(array);
@@ -330,8 +328,8 @@
                        Dart::vm_isolate()->object_store()->symbol_table());
   SymbolTable table(zone, isolate->object_store()->symbol_table());
   intptr_t unified_size = vm_table.NumOccupied() + table.NumOccupied();
-  SymbolTable unified_table(zone, HashTables::New<SymbolTable>(unified_size,
-                                                               Heap::kOld));
+  SymbolTable unified_table(
+      zone, HashTables::New<SymbolTable>(unified_size, Heap::kOld));
   String& symbol = String::Handle(zone);
 
   SymbolTable::Iterator vm_iter(&vm_table);
@@ -369,10 +367,8 @@
   GrowableArray<String*> symbols;
   class SymbolCollector : public ObjectVisitor {
    public:
-    SymbolCollector(Thread* thread,
-                    GrowableArray<String*>* symbols)
-        : symbols_(symbols),
-          zone_(thread->zone()) {}
+    SymbolCollector(Thread* thread, GrowableArray<String*>* symbols)
+        : symbols_(symbols), zone_(thread->zone()) {}
 
     void VisitObject(RawObject* obj) {
       if (obj->IsCanonical() && obj->IsStringInstance()) {
@@ -389,9 +385,8 @@
   isolate->heap()->IterateObjects(&visitor);
 
   // 3. Build a new table from the surviving symbols.
-  Array& array =
-      Array::Handle(zone, HashTables::New<SymbolTable>(symbols.length() * 4 / 3,
-                                                       Heap::kOld));
+  Array& array = Array::Handle(
+      zone, HashTables::New<SymbolTable>(symbols.length() * 4 / 3, Heap::kOld));
   SymbolTable table(zone, array.raw());
   for (intptr_t i = 0; i < symbols.length(); i++) {
     String& symbol = *symbols[i];
@@ -402,7 +397,7 @@
   }
   isolate->object_store()->set_symbol_table(table.Release());
 }
-#endif   // DART_PRECOMPILER
+#endif  // DART_PRECOMPILER
 
 
 void Symbols::GetStats(Isolate* isolate, intptr_t* size, intptr_t* capacity) {
@@ -495,7 +490,8 @@
 // TODO(srdjan): If this becomes performance critical code, consider looking
 // up symbol from hash of pieces instead of concatenating them first into
 // a string.
-RawString* Symbols::FromConcatAll(Thread* thread,
+RawString* Symbols::FromConcatAll(
+    Thread* thread,
     const GrowableHandlePtrArray<const String>& strs) {
   const intptr_t strs_length = strs.length();
   GrowableArray<intptr_t> lengths(strs_length);
@@ -527,9 +523,9 @@
       if (str_len > 0) {
         const String& str = strs[i];
         ASSERT(str.IsOneByteString() || str.IsExternalOneByteString());
-        const uint8_t* src_p = str.IsOneByteString() ?
-            OneByteString::CharAddr(str, 0) :
-            ExternalOneByteString::CharAddr(str, 0);
+        const uint8_t* src_p = str.IsOneByteString()
+                                   ? OneByteString::CharAddr(str, 0)
+                                   : ExternalOneByteString::CharAddr(str, 0);
         memmove(buffer, src_p, str_len);
         buffer += str_len;
       }
@@ -551,9 +547,9 @@
         } else {
           // One-byte to two-byte string copy.
           ASSERT(str.IsOneByteString() || str.IsExternalOneByteString());
-          const uint8_t* src_p = str.IsOneByteString() ?
-              OneByteString::CharAddr(str, 0) :
-              ExternalOneByteString::CharAddr(str, 0);
+          const uint8_t* src_p = str.IsOneByteString()
+                                     ? OneByteString::CharAddr(str, 0)
+                                     : ExternalOneByteString::CharAddr(str, 0);
           for (int n = 0; n < str_len; n++) {
             buffer[n] = src_p[n];
           }
@@ -568,7 +564,7 @@
 
 
 // StringType can be StringSlice, ConcatString, or {Latin1,UTF16,UTF32}Array.
-template<typename StringType>
+template <typename StringType>
 RawString* Symbols::NewSymbol(Thread* thread, const StringType& str) {
   REUSABLE_OBJECT_HANDLESCOPE(thread);
   REUSABLE_SMI_HANDLESCOPE(thread);
@@ -598,7 +594,7 @@
 }
 
 
-template<typename StringType>
+template <typename StringType>
 RawString* Symbols::Lookup(Thread* thread, const StringType& str) {
   REUSABLE_OBJECT_HANDLESCOPE(thread);
   REUSABLE_SMI_HANDLESCOPE(thread);
@@ -628,8 +624,9 @@
 }
 
 
-RawString* Symbols::LookupFromConcat(
-    Thread* thread, const String& str1, const String& str2) {
+RawString* Symbols::LookupFromConcat(Thread* thread,
+                                     const String& str1,
+                                     const String& str2) {
   if (str1.Length() == 0) {
     return Lookup(thread, str2);
   } else if (str2.Length() == 0) {
@@ -671,7 +668,6 @@
 }
 
 
-
 RawString* Symbols::NewFormatted(Thread* thread, const char* format, ...) {
   va_list args;
   va_start(args, format);
diff --git a/runtime/vm/symbols.h b/runtime/vm/symbols.h
index 29cdb8a..f8a7996 100644
--- a/runtime/vm/symbols.h
+++ b/runtime/vm/symbols.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_SYMBOLS_H_
-#define VM_SYMBOLS_H_
+#ifndef RUNTIME_VM_SYMBOLS_H_
+#define RUNTIME_VM_SYMBOLS_H_
 
 #include "vm/growable_array.h"
 #include "vm/object.h"
@@ -55,6 +55,8 @@
   V(Close, "close")                                                            \
   V(Values, "values")                                                          \
   V(_EnumNames, "_enum_names")                                                 \
+  V(_DeletedEnumSentinel, "_deleted_enum_sentinel")                            \
+  V(_DeletedEnumPrefix, "Deleted enum value from ")                            \
   V(ExprTemp, ":expr_temp")                                                    \
   V(FinallyRetVal, ":finally_ret_val")                                         \
   V(AnonymousClosure, "<anonymous closure>")                                   \
@@ -230,20 +232,20 @@
   V(Float64x2List, "Float64x2List")                                            \
   V(Float32List, "Float32List")                                                \
   V(Float64List, "Float64List")                                                \
-  V(_Int8ArrayFactory, "Int8List.")                                          \
-  V(_Uint8ArrayFactory, "Uint8List.")                                        \
-  V(_Uint8ClampedArrayFactory, "Uint8ClampedList.")                          \
-  V(_Int16ArrayFactory, "Int16List.")                                        \
-  V(_Uint16ArrayFactory, "Uint16List.")                                      \
-  V(_Int32ArrayFactory, "Int32List.")                                        \
-  V(_Uint32ArrayFactory, "Uint32List.")                                      \
-  V(_Int64ArrayFactory, "Int64List.")                                        \
-  V(_Uint64ArrayFactory, "Uint64List.")                                      \
-  V(_Float32x4ArrayFactory, "Float32x4List.")                                \
-  V(_Int32x4ArrayFactory, "Int32x4List.")                                    \
-  V(_Float64x2ArrayFactory, "Float64x2List.")                                \
-  V(_Float32ArrayFactory, "Float32List.")                                    \
-  V(_Float64ArrayFactory, "Float64List.")                                    \
+  V(_Int8ArrayFactory, "Int8List.")                                            \
+  V(_Uint8ArrayFactory, "Uint8List.")                                          \
+  V(_Uint8ClampedArrayFactory, "Uint8ClampedList.")                            \
+  V(_Int16ArrayFactory, "Int16List.")                                          \
+  V(_Uint16ArrayFactory, "Uint16List.")                                        \
+  V(_Int32ArrayFactory, "Int32List.")                                          \
+  V(_Uint32ArrayFactory, "Uint32List.")                                        \
+  V(_Int64ArrayFactory, "Int64List.")                                          \
+  V(_Uint64ArrayFactory, "Uint64List.")                                        \
+  V(_Float32x4ArrayFactory, "Float32x4List.")                                  \
+  V(_Int32x4ArrayFactory, "Int32x4List.")                                      \
+  V(_Float64x2ArrayFactory, "Float64x2List.")                                  \
+  V(_Float32ArrayFactory, "Float32List.")                                      \
+  V(_Float64ArrayFactory, "Float64List.")                                      \
   V(_Int8ArrayView, "_Int8ArrayView")                                          \
   V(_Uint8ArrayView, "_Uint8ArrayView")                                        \
   V(_Uint8ClampedArrayView, "_Uint8ClampedArrayView")                          \
@@ -365,11 +367,9 @@
   V(hashCode, "get:hashCode")                                                  \
   V(OptimizedOut, "<optimized out>")                                           \
   V(NotInitialized, "<not initialized>")                                       \
-  V(AllocationStubFor, "[Stub] Allocate ")                                     \
   V(TempParam, ":temp_param")                                                  \
   V(_UserTag, "_UserTag")                                                      \
   V(Default, "Default")                                                        \
-  V(StubPrefix, "[Stub] ")                                                     \
   V(ClassID, "ClassID")                                                        \
   V(DartIsVM, "dart.isVM")                                                     \
   V(stack, ":stack")                                                           \
@@ -403,6 +403,8 @@
   V(_name, "_name")                                                            \
   V(_classRangeCheck, "_classRangeCheck")                                      \
   V(_classRangeCheckNegative, "_classRangeCheckNegative")                      \
+  V(GetRuntimeType, "get:runtimeType")                                         \
+  V(HaveSameRuntimeType, "_haveSameRuntimeType")
 
 
 // Contains a list of frequently used strings in a canonicalized form. This
@@ -414,23 +416,23 @@
 
   // List of strings that are pre created in the vm isolate.
   enum SymbolId {
+    // clang-format off
     kIllegal = 0,
 
-#define DEFINE_SYMBOL_INDEX(symbol, literal)                                   \
-    k##symbol##Id,
+#define DEFINE_SYMBOL_INDEX(symbol, literal) k##symbol##Id,
     PREDEFINED_SYMBOLS_LIST(DEFINE_SYMBOL_INDEX)
 #undef DEFINE_SYMBOL_INDEX
 
     kTokenTableStart,  // First token at kTokenTableStart + 1.
 
-#define DEFINE_TOKEN_SYMBOL_INDEX(t, s, p, a)                                  \
-    t##Id,
-    DART_TOKEN_LIST(DEFINE_TOKEN_SYMBOL_INDEX)
-    DART_KEYWORD_LIST(DEFINE_TOKEN_SYMBOL_INDEX)
+#define DEFINE_TOKEN_SYMBOL_INDEX(t, s, p, a) t##Id,
+    DART_TOKEN_LIST(DEFINE_TOKEN_SYMBOL_INDEX) DART_KEYWORD_LIST(
+        DEFINE_TOKEN_SYMBOL_INDEX)
 #undef DEFINE_TOKEN_SYMBOL_INDEX
 
     kNullCharId,  // One char code symbol starts here and takes up 256 entries.
     kMaxPredefinedId = kNullCharId + kMaxOneCharCodeSymbol + 1,
+    // clang-format on
   };
 
   // Number of one character symbols being predefined in the predefined_ array.
@@ -446,21 +448,13 @@
   }
 
   // Access methods for one byte character symbols stored in the vm isolate.
-  static const String& Dot() {
-    return *(symbol_handles_[kNullCharId + '.']);
-  }
+  static const String& Dot() { return *(symbol_handles_[kNullCharId + '.']); }
   static const String& Equals() {
     return *(symbol_handles_[kNullCharId + '=']);
   }
-  static const String& Plus() {
-    return *(symbol_handles_[kNullCharId + '+']);
-  }
-  static const String& Minus() {
-    return *(symbol_handles_[kNullCharId + '-']);
-  }
-  static const String& BitOr() {
-    return *(symbol_handles_[kNullCharId + '|']);
-  }
+  static const String& Plus() { return *(symbol_handles_[kNullCharId + '+']); }
+  static const String& Minus() { return *(symbol_handles_[kNullCharId + '-']); }
+  static const String& BitOr() { return *(symbol_handles_[kNullCharId + '|']); }
   static const String& BitAnd() {
     return *(symbol_handles_[kNullCharId + '&']);
   }
@@ -488,9 +482,7 @@
   static const String& RBrace() {
     return *(symbol_handles_[kNullCharId + '}']);
   }
-  static const String& Blank() {
-    return *(symbol_handles_[kNullCharId + ' ']);
-  }
+  static const String& Blank() { return *(symbol_handles_[kNullCharId + ' ']); }
   static const String& Dollar() {
     return *(symbol_handles_[kNullCharId + '$']);
   }
@@ -506,39 +498,27 @@
   static const String& LowercaseR() {
     return *(symbol_handles_[kNullCharId + 'r']);
   }
-  static const String& Dash() {
-    return *(symbol_handles_[kNullCharId + '-']);
-  }
+  static const String& Dash() { return *(symbol_handles_[kNullCharId + '-']); }
   static const String& Ampersand() {
     return *(symbol_handles_[kNullCharId + '&']);
   }
   static const String& Backtick() {
     return *(symbol_handles_[kNullCharId + '`']);
   }
-  static const String& Slash() {
-    return *(symbol_handles_[kNullCharId + '/']);
-  }
-  static const String& At() {
-    return *(symbol_handles_[kNullCharId + '@']);
-  }
+  static const String& Slash() { return *(symbol_handles_[kNullCharId + '/']); }
+  static const String& At() { return *(symbol_handles_[kNullCharId + '@']); }
   static const String& HashMark() {
     return *(symbol_handles_[kNullCharId + '#']);
   }
   static const String& Semicolon() {
     return *(symbol_handles_[kNullCharId + ';']);
   }
-  static const String& Star() {
-    return *(symbol_handles_[kNullCharId + '*']);
-  }
+  static const String& Star() { return *(symbol_handles_[kNullCharId + '*']); }
   static const String& Percent() {
     return *(symbol_handles_[kNullCharId + '%']);
   }
-  static const String& Caret() {
-    return *(symbol_handles_[kNullCharId + '^']);
-  }
-  static const String& Tilde() {
-    return *(symbol_handles_[kNullCharId + '~']);
-  }
+  static const String& Caret() { return *(symbol_handles_[kNullCharId + '^']); }
+  static const String& Tilde() { return *(symbol_handles_[kNullCharId + '~']); }
 
   static const String& Empty() { return *(symbol_handles_[kTokenTableStart]); }
   static const String& False() { return *(symbol_handles_[kFALSEId]); }
@@ -548,14 +528,14 @@
   static const String& True() { return *(symbol_handles_[kTRUEId]); }
   static const String& Void() { return *(symbol_handles_[kVOIDId]); }
 
-  // Access methods for symbol handles stored in the vm isolate for predefined
-  // symbols.
+// Access methods for symbol handles stored in the vm isolate for predefined
+// symbols.
 #define DEFINE_SYMBOL_HANDLE_ACCESSOR(symbol, literal)                         \
   static const String& symbol() { return *(symbol_handles_[k##symbol##Id]); }
   PREDEFINED_SYMBOLS_LIST(DEFINE_SYMBOL_HANDLE_ACCESSOR)
 #undef DEFINE_SYMBOL_HANDLE_ACCESSOR
 
-  // Access methods for symbol handles stored in the vm isolate for keywords.
+// Access methods for symbol handles stored in the vm isolate for keywords.
 #define DEFINE_SYMBOL_HANDLE_ACCESSOR(t, s, p, a)                              \
   static const String& t() { return *(symbol_handles_[t##Id]); }
   DART_TOKEN_LIST(DEFINE_SYMBOL_HANDLE_ACCESSOR)
@@ -623,7 +603,8 @@
                                const String& str1,
                                const String& str2);
 
-  static RawString* FromConcatAll(Thread* thread,
+  static RawString* FromConcatAll(
+      Thread* thread,
       const GrowableHandlePtrArray<const String>& strs);
 
   static RawString* FromGet(Thread* thread, const String& str);
@@ -642,7 +623,7 @@
   static void DumpStats();
 
   // Returns Symbol::Null if no symbol is found.
-  template<typename StringType>
+  template <typename StringType>
   static RawString* Lookup(Thread* thread, const StringType& str);
 
   // Returns Symbol::Null if no symbol is found.
@@ -654,17 +635,12 @@
   static RawString* LookupFromSet(Thread* thread, const String& str);
   static RawString* LookupFromDot(Thread* thread, const String& str);
 
-  static void GetStats(Isolate* isolate,
-                       intptr_t* size,
-                       intptr_t* capacity);
+  static void GetStats(Isolate* isolate, intptr_t* size, intptr_t* capacity);
 
  private:
-  enum {
-    kInitialVMIsolateSymtabSize = 1024,
-    kInitialSymtabSize = 2048
-  };
+  enum { kInitialVMIsolateSymtabSize = 1024, kInitialSymtabSize = 2048 };
 
-  template<typename StringType>
+  template <typename StringType>
   static RawString* NewSymbol(Thread* thread, const StringType& str);
 
   static intptr_t LookupPredefinedSymbol(RawObject* obj);
@@ -695,4 +671,4 @@
 
 }  // namespace dart
 
-#endif  // VM_SYMBOLS_H_
+#endif  // RUNTIME_VM_SYMBOLS_H_
diff --git a/runtime/vm/tags.cc b/runtime/vm/tags.cc
index ccb52ab..30e284c 100644
--- a/runtime/vm/tags.cc
+++ b/runtime/vm/tags.cc
@@ -83,12 +83,13 @@
 
 
 VMTag::TagEntry VMTag::entries_[] = {
-  { "InvalidTag", kInvalidTagId, },
-#define DEFINE_VM_TAG_ENTRY(tag)                                               \
-  { ""#tag, k##tag##TagId },
-  VM_TAG_LIST(DEFINE_VM_TAG_ENTRY)
+    {
+        "InvalidTag", kInvalidTagId,
+    },
+#define DEFINE_VM_TAG_ENTRY(tag) {"" #tag, k##tag##TagId},
+    VM_TAG_LIST(DEFINE_VM_TAG_ENTRY)
 #undef DEFINE_VM_TAG_ENTRY
-  { "kNumVMTags", kNumVMTags },
+        {"kNumVMTags", kNumVMTags},
 };
 
 
@@ -162,8 +163,7 @@
   ASSERT(tag_id >= kUserTagIdOffset);
   ASSERT(tag_id < kUserTagIdOffset + kMaxUserTags);
   Zone* zone = Thread::Current()->zone();
-  const UserTag& tag =
-      UserTag::Handle(zone, UserTag::FindTagById(tag_id));
+  const UserTag& tag = UserTag::Handle(zone, UserTag::FindTagById(tag_id));
   ASSERT(!tag.IsNull());
   const String& label = String::Handle(zone, tag.label());
   return label.ToCString();
diff --git a/runtime/vm/tags.h b/runtime/vm/tags.h
index 8c6ef65..66ab39e 100644
--- a/runtime/vm/tags.h
+++ b/runtime/vm/tags.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_TAGS_H_
-#define VM_TAGS_H_
+#ifndef RUNTIME_VM_TAGS_H_
+#define RUNTIME_VM_TAGS_H_
 
 #include "vm/allocation.h"
 
@@ -14,9 +14,9 @@
 class RuntimeEntry;
 
 #define VM_TAG_LIST(V)                                                         \
-  V(Idle)          /* isolate is idle and is_runnable() */                     \
-  V(LoadWait)      /* isolate is idle and !is_runnable() */                    \
-  V(VM)            /* Catch all */                                             \
+  V(Idle)     /* isolate is idle and is_runnable() */                          \
+  V(LoadWait) /* isolate is idle and !is_runnable() */                         \
+  V(VM)       /* Catch all */                                                  \
   V(CompileOptimized)                                                          \
   V(CompileUnoptimized)                                                        \
   V(CompileClass)                                                              \
@@ -30,17 +30,16 @@
   V(GCOldSpace)                                                                \
   V(Embedder)                                                                  \
   V(Runtime)                                                                   \
-  V(Native)                                                                    \
+  V(Native)
 
 class VMTag : public AllStatic {
  public:
   enum VMTagId {
     kInvalidTagId = 0,
-#define DEFINE_VM_TAG_ID(tag)                                                  \
-    k##tag##TagId,
+#define DEFINE_VM_TAG_ID(tag) k##tag##TagId,
     VM_TAG_LIST(DEFINE_VM_TAG_ID)
 #undef DEFINE_VM_TAG_KIND
-    kNumVMTags,
+        kNumVMTags,
     //
     // All tags below |kNumVMTags| are special meta-data tags and do not
     // indicate the state of the VM during a sample.
@@ -82,6 +81,7 @@
  public:
   VMTagScope(Thread* thread, uword tag, bool conditional_set = true);
   ~VMTagScope();
+
  private:
   uword previous_tag_;
 
@@ -123,4 +123,4 @@
 
 }  // namespace dart
 
-#endif  // VM_TAGS_H_
+#endif  // RUNTIME_VM_TAGS_H_
diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc
index d3534af..709d735 100644
--- a/runtime/vm/thread.cc
+++ b/runtime/vm/thread.cc
@@ -56,8 +56,7 @@
 #define REUSABLE_HANDLE_SCOPE_INIT(object)
 #endif  // defined(DEBUG)
 
-#define REUSABLE_HANDLE_INITIALIZERS(object)                                   \
-  object##_handle_(NULL),
+#define REUSABLE_HANDLE_INITIALIZERS(object) object##_handle_(NULL),
 
 
 Thread::Thread(Isolate* isolate)
@@ -94,30 +93,30 @@
       type_range_cache_(NULL),
       deopt_id_(0),
       pending_functions_(GrowableObjectArray::null()),
+      active_exception_(Object::null()),
+      active_stacktrace_(Object::null()),
+      resume_pc_(0),
       sticky_error_(Error::null()),
       compiler_stats_(NULL),
       REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS)
-      REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT)
-      safepoint_state_(0),
+          REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT) safepoint_state_(0),
       execution_state_(kThreadInNative),
       next_(NULL) {
-NOT_IN_PRODUCT(
+#if !defined(PRODUCT)
   dart_stream_ = Timeline::GetDartStream();
   ASSERT(dart_stream_ != NULL);
-)
+#endif
 #define DEFAULT_INIT(type_name, member_name, init_expr, default_init_value)    \
   member_name = default_init_value;
-CACHED_CONSTANTS_LIST(DEFAULT_INIT)
+  CACHED_CONSTANTS_LIST(DEFAULT_INIT)
 #undef DEFAULT_INIT
 
-#define DEFAULT_INIT(name)                                                     \
-  name##_entry_point_ = 0;
-RUNTIME_ENTRY_LIST(DEFAULT_INIT)
+#define DEFAULT_INIT(name) name##_entry_point_ = 0;
+  RUNTIME_ENTRY_LIST(DEFAULT_INIT)
 #undef DEFAULT_INIT
 
-#define DEFAULT_INIT(returntype, name, ...)                                    \
-  name##_entry_point_ = 0;
-LEAF_RUNTIME_ENTRY_LIST(DEFAULT_INIT)
+#define DEFAULT_INIT(returntype, name, ...) name##_entry_point_ = 0;
+  LEAF_RUNTIME_ENTRY_LIST(DEFAULT_INIT)
 #undef DEFAULT_INIT
 
   // We cannot initialize the VM constants here for the vm isolate thread
@@ -138,73 +137,67 @@
 static const struct ALIGN16 {
   uint64_t a;
   uint64_t b;
-} double_negate_constant =
-    {0x8000000000000000LL, 0x8000000000000000LL};
+} double_negate_constant = {0x8000000000000000LL, 0x8000000000000000LL};
 
 static const struct ALIGN16 {
   uint64_t a;
   uint64_t b;
-} double_abs_constant =
-    {0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFFLL};
+} double_abs_constant = {0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFFLL};
 
 static const struct ALIGN16 {
   uint32_t a;
   uint32_t b;
   uint32_t c;
   uint32_t d;
-} float_not_constant =
-    { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
+} float_not_constant = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
 
 static const struct ALIGN16 {
   uint32_t a;
   uint32_t b;
   uint32_t c;
   uint32_t d;
-} float_negate_constant =
-    { 0x80000000, 0x80000000, 0x80000000, 0x80000000 };
+} float_negate_constant = {0x80000000, 0x80000000, 0x80000000, 0x80000000};
 
 static const struct ALIGN16 {
   uint32_t a;
   uint32_t b;
   uint32_t c;
   uint32_t d;
-} float_absolute_constant =
-    { 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF };
+} float_absolute_constant = {0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF};
 
 static const struct ALIGN16 {
   uint32_t a;
   uint32_t b;
   uint32_t c;
   uint32_t d;
-} float_zerow_constant =
-    { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000 };
+} float_zerow_constant = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000};
 
 
 void Thread::InitVMConstants() {
 #define ASSERT_VM_HEAP(type_name, member_name, init_expr, default_init_value)  \
   ASSERT((init_expr)->IsOldObject());
-CACHED_VM_OBJECTS_LIST(ASSERT_VM_HEAP)
+  CACHED_VM_OBJECTS_LIST(ASSERT_VM_HEAP)
 #undef ASSERT_VM_HEAP
 
 #define INIT_VALUE(type_name, member_name, init_expr, default_init_value)      \
   ASSERT(member_name == default_init_value);                                   \
   member_name = (init_expr);
-CACHED_CONSTANTS_LIST(INIT_VALUE)
+  CACHED_CONSTANTS_LIST(INIT_VALUE)
 #undef INIT_VALUE
 
 #define INIT_VALUE(name)                                                       \
   ASSERT(name##_entry_point_ == 0);                                            \
   name##_entry_point_ = k##name##RuntimeEntry.GetEntryPoint();
-RUNTIME_ENTRY_LIST(INIT_VALUE)
+  RUNTIME_ENTRY_LIST(INIT_VALUE)
 #undef INIT_VALUE
 
 #define INIT_VALUE(returntype, name, ...)                                      \
   ASSERT(name##_entry_point_ == 0);                                            \
   name##_entry_point_ = k##name##RuntimeEntry.GetEntryPoint();
-LEAF_RUNTIME_ENTRY_LIST(INIT_VALUE)
+  LEAF_RUNTIME_ENTRY_LIST(INIT_VALUE)
 #undef INIT_VALUE
 
-  // Setup the thread specific reusable handles.
+// Setup the thread specific reusable handles.
 #define REUSABLE_HANDLE_ALLOCATION(object)                                     \
   this->object##_handle_ = this->AllocateReusableHandle<object>();
   REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_ALLOCATION)
@@ -225,6 +218,17 @@
 }
 
 
+void Thread::set_active_exception(const Object& value) {
+  ASSERT(!value.IsNull());
+  active_exception_ = value.raw();
+}
+
+
+void Thread::set_active_stacktrace(const Object& value) {
+  active_stacktrace_ = value.raw();
+}
+
+
 RawError* Thread::sticky_error() const {
   return sticky_error_;
 }
@@ -280,8 +284,8 @@
                                   bool bypass_safepoint) {
   ASSERT(kind != kMutatorTask);
   const bool kIsNotMutatorThread = false;
-  Thread* thread = isolate->ScheduleThread(kIsNotMutatorThread,
-                                           bypass_safepoint);
+  Thread* thread =
+      isolate->ScheduleThread(kIsNotMutatorThread, bypass_safepoint);
   if (thread != NULL) {
     ASSERT(thread->store_buffer_block_ == NULL);
     // TODO(koda): Use StoreBufferAcquire once we properly flush
@@ -326,14 +330,14 @@
 
 
 void Thread::SetStackLimitFromStackBase(uword stack_base) {
-  // Set stack limit.
+// Set stack limit.
 #if !defined(TARGET_ARCH_DBC)
 #if defined(USING_SIMULATOR)
   // Ignore passed-in native stack top and use Simulator stack top.
   Simulator* sim = Simulator::Current();  // May allocate a simulator.
   ASSERT(isolate()->simulator() == sim);  // Isolate's simulator is current one.
   stack_base = sim->StackTop();
-  // The overflow area is accounted for by the simulator.
+// The overflow area is accounted for by the simulator.
 #endif
   SetStackLimit(stack_base - OSThread::GetSpecifiedStackSize());
 #else
@@ -370,7 +374,7 @@
 #else
   uword (*func)() = NULL;
 #endif
-  // But for performance (and to support simulators), we normally use a local.
+// But for performance (and to support simulators), we normally use a local.
 #if defined(__has_feature)
 #if __has_feature(address_sanitizer)
   uword current_sp = func();
@@ -506,8 +510,10 @@
       // False result from HandleOOBMessages signals that the isolate should
       // be terminating.
       if (FLAG_trace_isolates) {
-        OS::Print("[!] Terminating isolate due to OOB message:\n"
-                  "\tisolate:    %s\n", isolate()->name());
+        OS::Print(
+            "[!] Terminating isolate due to OOB message:\n"
+            "\tisolate:    %s\n",
+            isolate()->name());
       }
       Thread* thread = Thread::Current();
       const Error& error = Error::Handle(thread->sticky_error());
@@ -578,18 +584,16 @@
 
 
 bool Thread::IsExecutingDartCode() const {
-  return (top_exit_frame_info() == 0) &&
-         (vm_tag() == VMTag::kDartTagId);
+  return (top_exit_frame_info() == 0) && (vm_tag() == VMTag::kDartTagId);
 }
 
 
 bool Thread::HasExitedDartCode() const {
-  return (top_exit_frame_info() != 0) &&
-         (vm_tag() != VMTag::kDartTagId);
+  return (top_exit_frame_info() != 0) && (vm_tag() != VMTag::kDartTagId);
 }
 
 
-template<class C>
+template <class C>
 C* Thread::AllocateReusableHandle() {
   C* handle = reinterpret_cast<C*>(reusable_handles_.AllocateScopedHandle());
   C::initializeHandle(handle, C::null());
@@ -598,8 +602,7 @@
 
 
 void Thread::ClearReusableHandles() {
-#define CLEAR_REUSABLE_HANDLE(object)                                          \
-  *object##_handle_ = object::null();
+#define CLEAR_REUSABLE_HANDLE(object) *object##_handle_ = object::null();
   REUSABLE_HANDLE_LIST(CLEAR_REUSABLE_HANDLE)
 #undef CLEAR_REUSABLE_HANDLE
 }
@@ -616,10 +619,10 @@
   // Visit objects in thread specific handles area.
   reusable_handles_.VisitObjectPointers(visitor);
 
-  visitor->VisitPointer(
-      reinterpret_cast<RawObject**>(&pending_functions_));
-  visitor->VisitPointer(
-      reinterpret_cast<RawObject**>(&sticky_error_));
+  visitor->VisitPointer(reinterpret_cast<RawObject**>(&pending_functions_));
+  visitor->VisitPointer(reinterpret_cast<RawObject**>(&active_exception_));
+  visitor->VisitPointer(reinterpret_cast<RawObject**>(&active_stacktrace_));
+  visitor->VisitPointer(reinterpret_cast<RawObject**>(&sticky_error_));
 
   // Visit the api local scope as it has all the api local handles.
   ApiLocalScope* scope = api_top_scope_;
@@ -629,8 +632,7 @@
   }
 
   // Iterate over all the stack frames and visit objects on the stack.
-  StackFrameIterator frames_iterator(top_exit_frame_info(),
-                                     validate_frames);
+  StackFrameIterator frames_iterator(top_exit_frame_info(), validate_frames);
   StackFrame* frame = frames_iterator.NextFrame();
   while (frame != NULL) {
     frame->VisitObjectPointers(visitor);
@@ -642,7 +644,7 @@
 bool Thread::CanLoadFromThread(const Object& object) {
 #define CHECK_OBJECT(type_name, member_name, expr, default_init_value)         \
   if (object.raw() == expr) return true;
-CACHED_VM_OBJECTS_LIST(CHECK_OBJECT)
+  CACHED_VM_OBJECTS_LIST(CHECK_OBJECT)
 #undef CHECK_OBJECT
   return false;
 }
@@ -652,7 +654,7 @@
 #define COMPUTE_OFFSET(type_name, member_name, expr, default_init_value)       \
   ASSERT((expr)->IsVMHeapObject());                                            \
   if (object.raw() == expr) return Thread::member_name##offset();
-CACHED_VM_OBJECTS_LIST(COMPUTE_OFFSET)
+  CACHED_VM_OBJECTS_LIST(COMPUTE_OFFSET)
 #undef COMPUTE_OFFSET
   UNREACHABLE();
   return -1;
@@ -671,7 +673,7 @@
     *object = expr;                                                            \
     return true;                                                               \
   }
-CACHED_VM_OBJECTS_LIST(COMPUTE_OFFSET)
+  CACHED_VM_OBJECTS_LIST(COMPUTE_OFFSET)
 #undef COMPUTE_OFFSET
   return false;
 }
@@ -679,17 +681,17 @@
 
 intptr_t Thread::OffsetFromThread(const RuntimeEntry* runtime_entry) {
 #define COMPUTE_OFFSET(name)                                                   \
-  if (runtime_entry->function() == k##name##RuntimeEntry.function())         { \
+  if (runtime_entry->function() == k##name##RuntimeEntry.function()) {         \
     return Thread::name##_entry_point_offset();                                \
   }
-RUNTIME_ENTRY_LIST(COMPUTE_OFFSET)
+  RUNTIME_ENTRY_LIST(COMPUTE_OFFSET)
 #undef COMPUTE_OFFSET
 
 #define COMPUTE_OFFSET(returntype, name, ...)                                  \
-  if (runtime_entry->function() == k##name##RuntimeEntry.function())         { \
+  if (runtime_entry->function() == k##name##RuntimeEntry.function()) {         \
     return Thread::name##_entry_point_offset();                                \
   }
-LEAF_RUNTIME_ENTRY_LIST(COMPUTE_OFFSET)
+  LEAF_RUNTIME_ENTRY_LIST(COMPUTE_OFFSET)
 #undef COMPUTE_OFFSET
 
   UNREACHABLE();
@@ -735,8 +737,7 @@
   // Unwind all scopes using the same stack_marker, i.e. all scopes allocated
   // under the same top_exit_frame_info.
   ApiLocalScope* scope = api_top_scope_;
-  while (scope != NULL &&
-         scope->stack_marker() != 0 &&
+  while (scope != NULL && scope->stack_marker() != 0 &&
          scope->stack_marker() == stack_marker) {
     api_top_scope_ = scope->previous();
     delete scope;
diff --git a/runtime/vm/thread.h b/runtime/vm/thread.h
index 50b5c47..a9fb55f 100644
--- a/runtime/vm/thread.h
+++ b/runtime/vm/thread.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_THREAD_H_
-#define VM_THREAD_H_
+#ifndef RUNTIME_VM_THREAD_H_
+#define RUNTIME_VM_THREAD_H_
 
 #include "include/dart_api.h"
 #include "platform/assert.h"
@@ -71,7 +71,7 @@
   V(Smi)                                                                       \
   V(String)                                                                    \
   V(TypeArguments)                                                             \
-  V(TypeParameter)                                                             \
+  V(TypeParameter)
 
 
 #if defined(TARGET_ARCH_DBC)
@@ -86,12 +86,16 @@
     StubCode::FixAllocationStubTarget_entry()->code(), NULL)                   \
   V(RawCode*, invoke_dart_code_stub_,                                          \
     StubCode::InvokeDartCode_entry()->code(), NULL)                            \
-  V(RawCode*, call_to_runtime_stub_,                                           \
-    StubCode::CallToRuntime_entry()->code(), NULL)                             \
+  V(RawCode*, call_to_runtime_stub_, StubCode::CallToRuntime_entry()->code(),  \
+    NULL)                                                                      \
   V(RawCode*, monomorphic_miss_stub_,                                          \
     StubCode::MonomorphicMiss_entry()->code(), NULL)                           \
   V(RawCode*, ic_lookup_through_code_stub_,                                    \
     StubCode::ICCallThroughCode_entry()->code(), NULL)                         \
+  V(RawCode*, lazy_deopt_from_return_stub_,                                    \
+    StubCode::DeoptimizeLazyFromReturn_entry()->code(), NULL)                  \
+  V(RawCode*, lazy_deopt_from_throw_stub_,                                     \
+    StubCode::DeoptimizeLazyFromThrow_entry()->code(), NULL)
 
 #endif
 
@@ -100,7 +104,7 @@
   V(RawObject*, object_null_, Object::null(), NULL)                            \
   V(RawBool*, bool_true_, Object::bool_true().raw(), NULL)                     \
   V(RawBool*, bool_false_, Object::bool_false().raw(), NULL)                   \
-  CACHED_VM_STUBS_LIST(V)                                                      \
+  CACHED_VM_STUBS_LIST(V)
 
 #if defined(TARGET_ARCH_DBC)
 #define CACHED_VM_STUBS_ADDRESSES_LIST(V)
@@ -111,7 +115,9 @@
   V(uword, call_to_runtime_entry_point_,                                       \
     StubCode::CallToRuntime_entry()->EntryPoint(), 0)                          \
   V(uword, megamorphic_call_checked_entry_,                                    \
-    StubCode::MegamorphicCall_entry()->CheckedEntryPoint(), 0)                 \
+    StubCode::MegamorphicCall_entry()->EntryPoint(), 0)                        \
+  V(uword, monomorphic_miss_entry_,                                            \
+    StubCode::MonomorphicMiss_entry()->EntryPoint(), 0)
 
 #endif
 
@@ -119,24 +125,24 @@
   CACHED_VM_STUBS_ADDRESSES_LIST(V)                                            \
   V(uword, native_call_wrapper_entry_point_,                                   \
     NativeEntry::NativeCallWrapperEntry(), 0)                                  \
-  V(RawString**, predefined_symbols_address_,                                  \
-    Symbols::PredefinedAddress(), NULL)                                        \
+  V(RawString**, predefined_symbols_address_, Symbols::PredefinedAddress(),    \
+    NULL)                                                                      \
   V(uword, double_negate_address_,                                             \
     reinterpret_cast<uword>(&double_negate_constant), 0)                       \
-  V(uword, double_abs_address_,                                                \
-    reinterpret_cast<uword>(&double_abs_constant), 0)                          \
-  V(uword, float_not_address_,                                                 \
-    reinterpret_cast<uword>(&float_not_constant), 0)                           \
+  V(uword, double_abs_address_, reinterpret_cast<uword>(&double_abs_constant), \
+    0)                                                                         \
+  V(uword, float_not_address_, reinterpret_cast<uword>(&float_not_constant),   \
+    0)                                                                         \
   V(uword, float_negate_address_,                                              \
     reinterpret_cast<uword>(&float_negate_constant), 0)                        \
   V(uword, float_absolute_address_,                                            \
     reinterpret_cast<uword>(&float_absolute_constant), 0)                      \
   V(uword, float_zerow_address_,                                               \
-    reinterpret_cast<uword>(&float_zerow_constant), 0)                         \
+    reinterpret_cast<uword>(&float_zerow_constant), 0)
 
 #define CACHED_CONSTANTS_LIST(V)                                               \
   CACHED_VM_OBJECTS_LIST(V)                                                    \
-  CACHED_ADDRESSES_LIST(V)                                                     \
+  CACHED_ADDRESSES_LIST(V)
 
 // A VM thread; may be executing Dart code or performing helper tasks like
 // garbage collection or compilation. The Thread structure associated with
@@ -204,9 +210,7 @@
 
 #if defined(TARGET_ARCH_DBC)
   // Access to the current stack limit for DBC interpreter.
-  uword stack_limit() const {
-    return stack_limit_;
-  }
+  uword stack_limit() const { return stack_limit_; }
 #endif
 
   // Stack overflow flags
@@ -225,9 +229,7 @@
     return ++stack_overflow_count_;
   }
 
-  TaskKind task_kind() const {
-    return task_kind_;
-  }
+  TaskKind task_kind() const { return task_kind_; }
 
   // Retrieves and clears the stack overflow flags.  These are set by
   // the generated code before the slow path runtime routine for a
@@ -249,9 +251,7 @@
 
   // OSThread corresponding to this thread.
   OSThread* os_thread() const { return os_thread_; }
-  void set_os_thread(OSThread* os_thread) {
-    os_thread_ = os_thread;
-  }
+  void set_os_thread(OSThread* os_thread) { os_thread_ = os_thread; }
 
   // Monitor corresponding to this thread.
   Monitor* thread_lock() const { return thread_lock_; }
@@ -275,9 +275,7 @@
 
   // The isolate that this thread is operating on, or NULL if none.
   Isolate* isolate() const { return isolate_; }
-  static intptr_t isolate_offset() {
-    return OFFSET_OF(Thread, isolate_);
-  }
+  static intptr_t isolate_offset() { return OFFSET_OF(Thread, isolate_); }
   bool IsMutatorThread() const;
   bool CanCollectGarbage() const;
 
@@ -308,9 +306,7 @@
     type_range_cache_ = value;
   }
 
-  int32_t no_callback_scope_depth() const {
-    return no_callback_scope_depth_;
-  }
+  int32_t no_callback_scope_depth() const { return no_callback_scope_depth_; }
 
   void IncrementNoCallbackScopeDepth() {
     ASSERT(no_callback_scope_depth_ < INT_MAX);
@@ -334,9 +330,7 @@
     return OFFSET_OF(Thread, store_buffer_block_);
   }
 
-  uword top_exit_frame_info() const {
-    return top_exit_frame_info_;
-  }
+  uword top_exit_frame_info() const { return top_exit_frame_info_; }
   void set_top_exit_frame_info(uword top_exit_frame_info) {
     top_exit_frame_info_ = top_exit_frame_info;
   }
@@ -345,18 +339,14 @@
   }
 
   StackResource* top_resource() const { return top_resource_; }
-  void set_top_resource(StackResource* value) {
-    top_resource_ = value;
-  }
+  void set_top_resource(StackResource* value) { top_resource_ = value; }
   static intptr_t top_resource_offset() {
     return OFFSET_OF(Thread, top_resource_);
   }
 
   // Heap of the isolate that this thread is operating on.
   Heap* heap() const { return heap_; }
-  static intptr_t heap_offset() {
-    return OFFSET_OF(Thread, heap_);
-  }
+  static intptr_t heap_offset() { return OFFSET_OF(Thread, heap_); }
 
   int32_t no_handle_scope_depth() const {
 #if defined(DEBUG)
@@ -420,21 +410,21 @@
   static intptr_t member_name##offset() {                                      \
     return OFFSET_OF(Thread, member_name);                                     \
   }
-CACHED_CONSTANTS_LIST(DEFINE_OFFSET_METHOD)
+  CACHED_CONSTANTS_LIST(DEFINE_OFFSET_METHOD)
 #undef DEFINE_OFFSET_METHOD
 
 #define DEFINE_OFFSET_METHOD(name)                                             \
   static intptr_t name##_entry_point_offset() {                                \
     return OFFSET_OF(Thread, name##_entry_point_);                             \
   }
-RUNTIME_ENTRY_LIST(DEFINE_OFFSET_METHOD)
+  RUNTIME_ENTRY_LIST(DEFINE_OFFSET_METHOD)
 #undef DEFINE_OFFSET_METHOD
 
 #define DEFINE_OFFSET_METHOD(returntype, name, ...)                            \
   static intptr_t name##_entry_point_offset() {                                \
     return OFFSET_OF(Thread, name##_entry_point_);                             \
   }
-LEAF_RUNTIME_ENTRY_LIST(DEFINE_OFFSET_METHOD)
+  LEAF_RUNTIME_ENTRY_LIST(DEFINE_OFFSET_METHOD)
 #undef DEFINE_OFFSET_METHOD
 
   static bool CanLoadFromThread(const Object& object);
@@ -472,23 +462,31 @@
   }
 
   LongJumpScope* long_jump_base() const { return long_jump_base_; }
-  void set_long_jump_base(LongJumpScope* value) {
-    long_jump_base_ = value;
-  }
+  void set_long_jump_base(LongJumpScope* value) { long_jump_base_ = value; }
 
-  uword vm_tag() const {
-    return vm_tag_;
-  }
-  void set_vm_tag(uword tag) {
-    vm_tag_ = tag;
-  }
-  static intptr_t vm_tag_offset() {
-    return OFFSET_OF(Thread, vm_tag_);
-  }
+  uword vm_tag() const { return vm_tag_; }
+  void set_vm_tag(uword tag) { vm_tag_ = tag; }
+  static intptr_t vm_tag_offset() { return OFFSET_OF(Thread, vm_tag_); }
 
   RawGrowableObjectArray* pending_functions();
   void clear_pending_functions();
 
+  RawObject* active_exception() const { return active_exception_; }
+  void set_active_exception(const Object& value);
+  static intptr_t active_exception_offset() {
+    return OFFSET_OF(Thread, active_exception_);
+  }
+
+  RawObject* active_stacktrace() const { return active_stacktrace_; }
+  void set_active_stacktrace(const Object& value);
+  static intptr_t active_stacktrace_offset() {
+    return OFFSET_OF(Thread, active_stacktrace_);
+  }
+
+  uword resume_pc() const { return resume_pc_; }
+  void set_resume_pc(uword value) { resume_pc_ = value; }
+  static uword resume_pc_offset() { return OFFSET_OF(Thread, resume_pc_); }
+
   RawError* sticky_error() const;
   void set_sticky_error(const Error& value);
   void clear_sticky_error();
@@ -508,7 +506,9 @@
 
   bool IsAnyReusableHandleScopeActive() const {
 #define IS_REUSABLE_HANDLE_SCOPE_ACTIVE(object)                                \
-    if (reusable_##object##_handle_scope_active_) return true;
+  if (reusable_##object##_handle_scope_active_) {                              \
+    return true;                                                               \
+  }
     REUSABLE_HANDLE_LIST(IS_REUSABLE_HANDLE_SCOPE_ACTIVE)
     return false;
 #undef IS_REUSABLE_HANDLE_SCOPE_ACTIVE
@@ -518,9 +518,7 @@
   void ClearReusableHandles();
 
 #define REUSABLE_HANDLE(object)                                                \
-  object& object##Handle() const {                                             \
-    return *object##_handle_;                                                  \
-  }
+  object& object##Handle() const { return *object##_handle_; }
   REUSABLE_HANDLE_LIST(REUSABLE_HANDLE)
 #undef REUSABLE_HANDLE
 
@@ -571,9 +569,8 @@
     do {
       old_state = safepoint_state_;
       new_state = SafepointRequestedField::update(value, old_state);
-    } while (AtomicOperations::CompareAndSwapUint32(&safepoint_state_,
-                                                    old_state,
-                                                    new_state) != old_state);
+    } while (AtomicOperations::CompareAndSwapUint32(
+                 &safepoint_state_, old_state, new_state) != old_state);
     return old_state;
   }
   static bool IsBlockedForSafepoint(uint32_t state) {
@@ -650,7 +647,8 @@
   void InitVMConstants();
 
  private:
-  template<class T> T* AllocateReusableHandle();
+  template <class T>
+  T* AllocateReusableHandle();
 
   // Accessed from generated code:
   uword stack_limit_;
@@ -661,20 +659,18 @@
   StoreBufferBlock* store_buffer_block_;
   uword vm_tag_;
   TaskKind task_kind_;
-  // State that is cached in the TLS for fast access in generated code.
+// State that is cached in the TLS for fast access in generated code.
 #define DECLARE_MEMBERS(type_name, member_name, expr, default_init_value)      \
   type_name member_name;
-CACHED_CONSTANTS_LIST(DECLARE_MEMBERS)
+  CACHED_CONSTANTS_LIST(DECLARE_MEMBERS)
 #undef DECLARE_MEMBERS
 
-#define DECLARE_MEMBERS(name)      \
-  uword name##_entry_point_;
-RUNTIME_ENTRY_LIST(DECLARE_MEMBERS)
+#define DECLARE_MEMBERS(name) uword name##_entry_point_;
+  RUNTIME_ENTRY_LIST(DECLARE_MEMBERS)
 #undef DECLARE_MEMBERS
 
-#define DECLARE_MEMBERS(returntype, name, ...)      \
-  uword name##_entry_point_;
-LEAF_RUNTIME_ENTRY_LIST(DECLARE_MEMBERS)
+#define DECLARE_MEMBERS(returntype, name, ...) uword name##_entry_point_;
+  LEAF_RUNTIME_ENTRY_LIST(DECLARE_MEMBERS)
 #undef DECLARE_MEMBERS
 
   TimelineStream* dart_stream_;
@@ -704,13 +700,17 @@
   intptr_t deopt_id_;  // Compilation specific counter.
   RawGrowableObjectArray* pending_functions_;
 
+  // JumpToExceptionHandler state:
+  RawObject* active_exception_;
+  RawObject* active_stacktrace_;
+  uword resume_pc_;
+
   RawError* sticky_error_;
 
   CompilerStats* compiler_stats_;
 
-  // Reusable handles support.
-#define REUSABLE_HANDLE_FIELDS(object)                                         \
-  object* object##_handle_;
+// Reusable handles support.
+#define REUSABLE_HANDLE_FIELDS(object) object* object##_handle_;
   REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_FIELDS)
 #undef REUSABLE_HANDLE_FIELDS
 
@@ -735,13 +735,9 @@
       StoreBuffer::ThresholdPolicy policy = StoreBuffer::kCheckThreshold);
   void StoreBufferAcquire();
 
-  void set_zone(Zone* zone) {
-    zone_ = zone;
-  }
+  void set_zone(Zone* zone) { zone_ = zone; }
 
-  void set_safepoint_state(uint32_t value) {
-    safepoint_state_ = value;
-  }
+  void set_safepoint_state(uint32_t value) { safepoint_state_ = value; }
   void EnterSafepointUsingLock();
   void ExitSafepointUsingLock();
   void BlockForSafepoint();
@@ -755,7 +751,7 @@
 
 #define REUSABLE_FRIEND_DECLARATION(name)                                      \
   friend class Reusable##name##HandleScope;
-REUSABLE_HANDLE_LIST(REUSABLE_FRIEND_DECLARATION)
+  REUSABLE_HANDLE_LIST(REUSABLE_FRIEND_DECLARATION)
 #undef REUSABLE_FRIEND_DECLARATION
 
   friend class ApiZone;
@@ -786,4 +782,4 @@
 
 }  // namespace dart
 
-#endif  // VM_THREAD_H_
+#endif  // RUNTIME_VM_THREAD_H_
diff --git a/runtime/vm/thread_barrier.h b/runtime/vm/thread_barrier.h
index 39c56a8..020fcf6 100644
--- a/runtime/vm/thread_barrier.h
+++ b/runtime/vm/thread_barrier.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_THREAD_BARRIER_H_
-#define VM_THREAD_BARRIER_H_
+#ifndef RUNTIME_VM_THREAD_BARRIER_H_
+#define RUNTIME_VM_THREAD_BARRIER_H_
 
 #include "vm/globals.h"
 #include "vm/os_thread.h"
@@ -49,12 +49,12 @@
   explicit ThreadBarrier(intptr_t num_threads,
                          Monitor* monitor,
                          Monitor* done_monitor)
-    : num_threads_(num_threads),
-      monitor_(monitor),
-      remaining_(num_threads),
-      parity_(false),
-      done_monitor_(done_monitor),
-      done_(false) {
+      : num_threads_(num_threads),
+        monitor_(monitor),
+        remaining_(num_threads),
+        parity_(false),
+        done_monitor_(done_monitor),
+        done_(false) {
     ASSERT(remaining_ > 0);
   }
 
@@ -117,4 +117,4 @@
 
 }  // namespace dart
 
-#endif  // VM_THREAD_BARRIER_H_
+#endif  // RUNTIME_VM_THREAD_BARRIER_H_
diff --git a/runtime/vm/thread_barrier_test.cc b/runtime/vm/thread_barrier_test.cc
index 7ca11c6..9fcdc1c 100644
--- a/runtime/vm/thread_barrier_test.cc
+++ b/runtime/vm/thread_barrier_test.cc
@@ -12,13 +12,8 @@
 
 class FuzzTask : public ThreadPool::Task {
  public:
-  FuzzTask(intptr_t num_rounds,
-           ThreadBarrier* barrier,
-           uint64_t seed)
-    : num_rounds_(num_rounds),
-      barrier_(barrier),
-      rng_(seed) {
-  }
+  FuzzTask(intptr_t num_rounds, ThreadBarrier* barrier, uint64_t seed)
+      : num_rounds_(num_rounds), barrier_(barrier), rng_(seed) {}
 
   virtual void Run() {
     for (intptr_t i = 0; i < num_rounds_; ++i) {
diff --git a/runtime/vm/thread_interrupter.cc b/runtime/vm/thread_interrupter.cc
index fa14d2e..0ad9ead 100644
--- a/runtime/vm/thread_interrupter.cc
+++ b/runtime/vm/thread_interrupter.cc
@@ -47,8 +47,7 @@
 // effect: if the thread is interrupted by a signal handler during a ThreadState
 // update the signal handler will immediately return.
 
-DEFINE_FLAG(bool, trace_thread_interrupter, false,
-            "Trace thread interrupter");
+DEFINE_FLAG(bool, trace_thread_interrupter, false, "Trace thread interrupter");
 
 bool ThreadInterrupter::initialized_ = false;
 bool ThreadInterrupter::shutdown_ = false;
diff --git a/runtime/vm/thread_interrupter.h b/runtime/vm/thread_interrupter.h
index 82e0474..c425c39 100644
--- a/runtime/vm/thread_interrupter.h
+++ b/runtime/vm/thread_interrupter.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_THREAD_INTERRUPTER_H_
-#define VM_THREAD_INTERRUPTER_H_
+#ifndef RUNTIME_VM_THREAD_INTERRUPTER_H_
+#define RUNTIME_VM_THREAD_INTERRUPTER_H_
 
 #include "vm/allocation.h"
 #include "vm/signal_handler.h"
@@ -63,4 +63,4 @@
 
 }  // namespace dart
 
-#endif  // VM_THREAD_INTERRUPTER_H_
+#endif  // RUNTIME_VM_THREAD_INTERRUPTER_H_
diff --git a/runtime/vm/thread_interrupter_android.cc b/runtime/vm/thread_interrupter_android.cc
index 58f302f..30bd440 100644
--- a/runtime/vm/thread_interrupter_android.cc
+++ b/runtime/vm/thread_interrupter_android.cc
@@ -6,7 +6,7 @@
 #if defined(TARGET_OS_ANDROID)
 
 #include <sys/syscall.h>  // NOLINT
-#include <errno.h>  // NOLINT
+#include <errno.h>        // NOLINT
 
 #include "vm/flags.h"
 #include "vm/os.h"
@@ -23,7 +23,8 @@
 
 class ThreadInterrupterAndroid : public AllStatic {
  public:
-  static void ThreadInterruptSignalHandler(int signal, siginfo_t* info,
+  static void ThreadInterruptSignalHandler(int signal,
+                                           siginfo_t* info,
                                            void* context_) {
     if (signal != SIGPROF) {
       return;
diff --git a/runtime/vm/thread_interrupter_linux.cc b/runtime/vm/thread_interrupter_linux.cc
index 4eb07f4..167581e 100644
--- a/runtime/vm/thread_interrupter_linux.cc
+++ b/runtime/vm/thread_interrupter_linux.cc
@@ -20,7 +20,8 @@
 
 class ThreadInterrupterLinux : public AllStatic {
  public:
-  static void ThreadInterruptSignalHandler(int signal, siginfo_t* info,
+  static void ThreadInterruptSignalHandler(int signal,
+                                           siginfo_t* info,
                                            void* context_) {
     if (signal != SIGPROF) {
       return;
diff --git a/runtime/vm/thread_interrupter_macos.cc b/runtime/vm/thread_interrupter_macos.cc
index 222a294..fb9e145 100644
--- a/runtime/vm/thread_interrupter_macos.cc
+++ b/runtime/vm/thread_interrupter_macos.cc
@@ -22,7 +22,8 @@
 
 class ThreadInterrupterMacOS : public AllStatic {
  public:
-  static void ThreadInterruptSignalHandler(int signal, siginfo_t* info,
+  static void ThreadInterruptSignalHandler(int signal,
+                                           siginfo_t* info,
                                            void* context_) {
     if (signal != SIGPROF) {
       return;
diff --git a/runtime/vm/thread_interrupter_win.cc b/runtime/vm/thread_interrupter_win.cc
index 30d6d8b..bcbcc77 100644
--- a/runtime/vm/thread_interrupter_win.cc
+++ b/runtime/vm/thread_interrupter_win.cc
@@ -56,11 +56,9 @@
 
   static void Interrupt(OSThread* os_thread) {
     ASSERT(!OSThread::Compare(GetCurrentThreadId(), os_thread->id()));
-    HANDLE handle = OpenThread(THREAD_GET_CONTEXT |
-                               THREAD_QUERY_INFORMATION |
-                               THREAD_SUSPEND_RESUME,
-                               false,
-                               os_thread->id());
+    HANDLE handle = OpenThread(
+        THREAD_GET_CONTEXT | THREAD_QUERY_INFORMATION | THREAD_SUSPEND_RESUME,
+        false, os_thread->id());
     ASSERT(handle != NULL);
     DWORD result = SuspendThread(handle);
     if (result == kThreadError) {
diff --git a/runtime/vm/thread_pool.cc b/runtime/vm/thread_pool.cc
index 0c326d3..40ca9d5 100644
--- a/runtime/vm/thread_pool.cc
+++ b/runtime/vm/thread_pool.cc
@@ -10,20 +10,21 @@
 
 namespace dart {
 
-DEFINE_FLAG(int, worker_timeout_millis, 5000,
+DEFINE_FLAG(int,
+            worker_timeout_millis,
+            5000,
             "Free workers when they have been idle for this amount of time.");
 
 ThreadPool::ThreadPool()
-  : shutting_down_(false),
-    all_workers_(NULL),
-    idle_workers_(NULL),
-    count_started_(0),
-    count_stopped_(0),
-    count_running_(0),
-    count_idle_(0),
-    shutting_down_workers_(NULL),
-    join_list_(NULL) {
-}
+    : shutting_down_(false),
+      all_workers_(NULL),
+      idle_workers_(NULL),
+      count_started_(0),
+      count_stopped_(0),
+      count_running_(0),
+      count_idle_(0),
+      shutting_down_workers_(NULL),
+      join_list_(NULL) {}
 
 
 ThreadPool::~ThreadPool() {
@@ -146,8 +147,7 @@
 
 bool ThreadPool::IsIdle(Worker* worker) {
   ASSERT(worker != NULL && worker->owned_);
-  for (Worker* current = idle_workers_;
-       current != NULL;
+  for (Worker* current = idle_workers_; current != NULL;
        current = current->idle_next_) {
     if (current == worker) {
       return true;
@@ -170,8 +170,7 @@
     return true;
   }
 
-  for (Worker* current = idle_workers_;
-       current->idle_next_ != NULL;
+  for (Worker* current = idle_workers_; current->idle_next_ != NULL;
        current = current->idle_next_) {
     if (current->idle_next_ == worker) {
       current->idle_next_ = worker->idle_next_;
@@ -198,8 +197,7 @@
     return true;
   }
 
-  for (Worker* current = all_workers_;
-       current->all_next_ != NULL;
+  for (Worker* current = all_workers_; current->all_next_ != NULL;
        current = current->all_next_) {
     if (current->all_next_ == worker) {
       current->all_next_ = worker->all_next_;
@@ -298,8 +296,7 @@
   }
 
   for (Worker* current = shutting_down_workers_;
-       current->shutdown_next_ != NULL;
-       current = current->shutdown_next_) {
+       current->shutdown_next_ != NULL; current = current->shutdown_next_) {
     if (current->shutdown_next_ == worker) {
       current->shutdown_next_ = worker->shutdown_next_;
       worker->shutdown_next_ = NULL;
@@ -325,24 +322,21 @@
 }
 
 
-ThreadPool::Task::Task() {
-}
+ThreadPool::Task::Task() {}
 
 
-ThreadPool::Task::~Task() {
-}
+ThreadPool::Task::~Task() {}
 
 
 ThreadPool::Worker::Worker(ThreadPool* pool)
-  : pool_(pool),
-    task_(NULL),
-    id_(OSThread::kInvalidThreadId),
-    done_(false),
-    owned_(false),
-    all_next_(NULL),
-    idle_next_(NULL),
-    shutdown_next_(NULL) {
-}
+    : pool_(pool),
+      task_(NULL),
+      id_(OSThread::kInvalidThreadId),
+      done_(false),
+      owned_(false),
+      all_next_(NULL),
+      idle_next_(NULL),
+      shutdown_next_(NULL) {}
 
 
 ThreadId ThreadPool::Worker::id() {
@@ -354,13 +348,12 @@
 void ThreadPool::Worker::StartThread() {
 #if defined(DEBUG)
   // Must call SetTask before StartThread.
-  { // NOLINT
+  {  // NOLINT
     MonitorLocker ml(&monitor_);
     ASSERT(task_ != NULL);
   }
 #endif
-  int result = OSThread::Start("Dart ThreadPool Worker",
-                               &Worker::Main,
+  int result = OSThread::Start("Dart ThreadPool Worker", &Worker::Main,
                                reinterpret_cast<uword>(this));
   if (result != 0) {
     FATAL1("Could not start worker thread: result = %d.", result);
@@ -478,8 +471,8 @@
       JoinList::AddLocked(join_id, &pool->join_list_);
     }
 
-    // worker->id_ should never be read again, so set to invalid in debug mode
-    // for asserts.
+// worker->id_ should never be read again, so set to invalid in debug mode
+// for asserts.
 #if defined(DEBUG)
     {
       MonitorLocker ml(&worker->monitor_);
diff --git a/runtime/vm/thread_pool.h b/runtime/vm/thread_pool.h
index 8cd29a2..6fbe0d7 100644
--- a/runtime/vm/thread_pool.h
+++ b/runtime/vm/thread_pool.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_THREAD_POOL_H_
-#define VM_THREAD_POOL_H_
+#ifndef RUNTIME_VM_THREAD_POOL_H_
+#define RUNTIME_VM_THREAD_POOL_H_
 
 #include "vm/allocation.h"
 #include "vm/globals.h"
@@ -93,8 +93,7 @@
 
   class JoinList {
    public:
-    explicit JoinList(ThreadJoinId id, JoinList* next) : id_(id), next_(next) {
-    }
+    explicit JoinList(ThreadJoinId id, JoinList* next) : id_(id), next_(next) {}
 
     // The thread pool's mutex_ must be held when calling this.
     static void AddLocked(ThreadJoinId id, JoinList** list);
@@ -147,4 +146,4 @@
 
 }  // namespace dart
 
-#endif  // VM_THREAD_POOL_H_
+#endif  // RUNTIME_VM_THREAD_POOL_H_
diff --git a/runtime/vm/thread_pool_test.cc b/runtime/vm/thread_pool_test.cc
index 48d2125..23d6140 100644
--- a/runtime/vm/thread_pool_test.cc
+++ b/runtime/vm/thread_pool_test.cc
@@ -19,11 +19,19 @@
 
 class TestTask : public ThreadPool::Task {
  public:
-  TestTask(Monitor* sync, bool* done)
-      : sync_(sync), done_(done) {
-  }
+  TestTask(Monitor* sync, bool* done) : sync_(sync), done_(done) {}
 
+  // Before running the task, *done_ should be true. This lets the caller
+  // ASSERT things knowing that the thread is still around. To unblock the
+  // thread, the caller should take the lock, set *done_ to false, and Notify()
+  // the monitor.
   virtual void Run() {
+    {
+      MonitorLocker ml(sync_);
+      while (*done_) {
+        ml.Wait();
+      }
+    }
     MonitorLocker ml(sync_);
     *done_ = true;
     ml.Notify();
@@ -38,10 +46,12 @@
 UNIT_TEST_CASE(ThreadPool_RunOne) {
   ThreadPool thread_pool;
   Monitor sync;
-  bool done = false;
+  bool done = true;
   thread_pool.Run(new TestTask(&sync, &done));
   {
     MonitorLocker ml(&sync);
+    done = false;
+    ml.Notify();
     while (!done) {
       ml.Wait();
     }
@@ -61,11 +71,13 @@
   bool done[kTaskCount];
 
   for (int i = 0; i < kTaskCount; i++) {
-    done[i] = false;
+    done[i] = true;
     thread_pool.Run(new TestTask(&sync[i], &done[i]));
   }
   for (int i = 0; i < kTaskCount; i++) {
     MonitorLocker ml(&sync[i]);
+    done[i] = false;
+    ml.Notify();
     while (!done[i]) {
       ml.Wait();
     }
@@ -80,8 +92,7 @@
       : sync_(sync),
         started_count_(started_count),
         slept_count_(slept_count),
-        millis_(millis) {
-  }
+        millis_(millis) {}
 
   virtual void Run() {
     {
@@ -157,12 +168,14 @@
 
   // Run a worker.
   Monitor sync;
-  bool done = false;
+  bool done = true;
   thread_pool.Run(new TestTask(&sync, &done));
   EXPECT_EQ(1U, thread_pool.workers_started());
   EXPECT_EQ(0U, thread_pool.workers_stopped());
   {
     MonitorLocker ml(&sync);
+    done = false;
+    ml.Notify();
     while (!done) {
       ml.Wait();
     }
@@ -184,8 +197,7 @@
 class SpawnTask : public ThreadPool::Task {
  public:
   SpawnTask(ThreadPool* pool, Monitor* sync, int todo, int total, int* done)
-      : pool_(pool), sync_(sync), todo_(todo), total_(total), done_(done) {
-  }
+      : pool_(pool), sync_(sync), todo_(todo), total_(total), done_(done) {}
 
   virtual void Run() {
     todo_--;  // Subtract one for current task.
@@ -193,8 +205,8 @@
 
     // Spawn 0-2 children.
     if (todo_ > 0) {
-      pool_->Run(new SpawnTask(
-          pool_, sync_, todo_ - child_todo, total_, done_));
+      pool_->Run(
+          new SpawnTask(pool_, sync_, todo_ - child_todo, total_, done_));
     }
     if (todo_ > 1) {
       pool_->Run(new SpawnTask(pool_, sync_, child_todo, total_, done_));
diff --git a/runtime/vm/thread_registry.h b/runtime/vm/thread_registry.h
index dd2c6df..eb2d327 100644
--- a/runtime/vm/thread_registry.h
+++ b/runtime/vm/thread_registry.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_THREAD_REGISTRY_H_
-#define VM_THREAD_REGISTRY_H_
+#ifndef RUNTIME_VM_THREAD_REGISTRY_H_
+#define RUNTIME_VM_THREAD_REGISTRY_H_
 
 #include "vm/globals.h"
 #include "vm/growable_array.h"
@@ -43,7 +43,7 @@
   // we need to iterate over threads (both active and free) in an isolate.
   Monitor* threads_lock_;
   Thread* active_list_;  // List of active threads in the isolate.
-  Thread* free_list_;  // Free list of Thread objects that can be reused.
+  Thread* free_list_;    // Free list of Thread objects that can be reused.
 
   // TODO(asiva): Currently we treat a mutator thread as a special thread
   // and always schedule execution of Dart code on the same mutator thread
@@ -67,4 +67,4 @@
 
 }  // namespace dart
 
-#endif  // VM_THREAD_REGISTRY_H_
+#endif  // RUNTIME_VM_THREAD_REGISTRY_H_
diff --git a/runtime/vm/thread_test.cc b/runtime/vm/thread_test.cc
index dc2edac..2dcf568 100644
--- a/runtime/vm/thread_test.cc
+++ b/runtime/vm/thread_test.cc
@@ -15,8 +15,8 @@
 
 UNIT_TEST_CASE(Mutex) {
   // This unit test case needs a running isolate.
-  Dart_CreateIsolate(
-      NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL, NULL);
+  Dart_CreateIsolate(NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL,
+                     NULL);
 
   Mutex* mutex = new Mutex();
   mutex->Lock();
@@ -37,8 +37,8 @@
 
 UNIT_TEST_CASE(Monitor) {
   // This unit test case needs a running isolate.
-  Dart_CreateIsolate(
-      NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL, NULL);
+  Dart_CreateIsolate(NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL,
+                     NULL);
   OSThread* thread = OSThread::Current();
   // Thread interrupter interferes with this test, disable interrupts.
   thread->DisableThreadInterrupts();
@@ -63,7 +63,7 @@
     // Check whether this attempt falls within the exptected time limits.
     int64_t wakeup_time = stop - start;
     OS::Print("wakeup_time: %" Pd64 "\n", wakeup_time);
-    const int kAcceptableTimeJitter = 20;  // Measured in milliseconds.
+    const int kAcceptableTimeJitter = 20;    // Measured in milliseconds.
     const int kAcceptableWakeupDelay = 150;  // Measured in milliseconds.
     if (((wait_time - kAcceptableTimeJitter) <= wakeup_time) &&
         (wakeup_time <= (wait_time + kAcceptableWakeupDelay))) {
@@ -85,7 +85,7 @@
 class ObjectCounter : public ObjectPointerVisitor {
  public:
   explicit ObjectCounter(Isolate* isolate, const Object* obj)
-      : ObjectPointerVisitor(isolate), obj_(obj), count_(0) { }
+      : ObjectPointerVisitor(isolate), obj_(obj), count_(0) {}
 
   virtual void VisitPointers(RawObject** first, RawObject** last) {
     for (RawObject** current = first; current <= last; ++current) {
@@ -119,7 +119,7 @@
       HANDLESCOPE(thread);
       Zone* zone = thread->zone();
       EXPECT_EQ(zone, stack_zone.GetZone());
-      ZoneGrowableArray<bool>* a0 = new(zone) ZoneGrowableArray<bool>(zone, 1);
+      ZoneGrowableArray<bool>* a0 = new (zone) ZoneGrowableArray<bool>(zone, 1);
       GrowableArray<bool> a1(zone, 1);
       for (intptr_t i = 0; i < 100000; ++i) {
         a0->Add(true);
@@ -135,9 +135,8 @@
       {
         ObjectCounter counter(isolate_, &smi);
         // Ensure that our particular zone is visited.
-        isolate_->IterateObjectPointers(
-            &counter,
-            StackFrameIterator::kValidateFrames);
+        isolate_->IterateObjectPointers(&counter,
+                                        StackFrameIterator::kValidateFrames);
         EXPECT_EQ(1, counter.count());
       }
       char* unique_chars = zone->PrintToString("unique_str_%" Pd, id_);
@@ -152,9 +151,8 @@
       {
         ObjectCounter str_counter(isolate_, &unique_str);
         // Ensure that our particular zone is visited.
-        isolate_->IterateObjectPointers(
-            &str_counter,
-            StackFrameIterator::kValidateFrames);
+        isolate_->IterateObjectPointers(&str_counter,
+                                        StackFrameIterator::kValidateFrames);
         // We should visit the string object exactly once.
         EXPECT_EQ(1, str_counter.count());
       }
@@ -213,14 +211,14 @@
   char* orig_str = orig_zone->PrintToString("foo");
   Dart_ExitIsolate();
   // Create and enter a new isolate.
-  Dart_CreateIsolate(
-      NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL, NULL);
+  Dart_CreateIsolate(NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL,
+                     NULL);
   Zone* zone0 = Thread::Current()->zone();
   EXPECT(zone0 != orig_zone);
   Dart_ShutdownIsolate();
   // Create and enter yet another isolate.
-  Dart_CreateIsolate(
-      NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL, NULL);
+  Dart_CreateIsolate(NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL,
+                     NULL);
   {
     // Create a stack resource this time, and exercise it.
     StackZone stack_zone(Thread::Current());
@@ -251,12 +249,12 @@
                     intptr_t* expected_count,
                     intptr_t* total_done,
                     intptr_t* exited)
-    : isolate_(isolate),
-      monitor_(monitor),
-      expected_count_(expected_count),
-      total_done_(total_done),
-      exited_(exited),
-      local_done_(false) {}
+      : isolate_(isolate),
+        monitor_(monitor),
+        expected_count_(expected_count),
+        total_done_(total_done),
+        exited_(exited),
+        local_done_(false) {}
 
   virtual void Run() {
     Thread::EnterIsolateAsHelper(isolate_, Thread::kUnknownTask);
@@ -265,7 +263,7 @@
       ++*expected_count_;
     }
     Thread* thread = Thread::Current();
-    for (int i = reinterpret_cast<intptr_t>(thread); ; ++i) {
+    for (int i = reinterpret_cast<intptr_t>(thread);; ++i) {
       StackZone stack_zone(thread);
       Zone* zone = thread->zone();
       HANDLESCOPE(thread);
@@ -278,9 +276,8 @@
         // But occasionally, organize a rendezvous.
         SafepointOperationScope safepoint_scope(thread);
         ObjectCounter counter(isolate_, &smi);
-        isolate_->IterateObjectPointers(
-            &counter,
-            StackFrameIterator::kValidateFrames);
+        isolate_->IterateObjectPointers(&counter,
+                                        StackFrameIterator::kValidateFrames);
         {
           MonitorLocker ml(monitor_);
           EXPECT_EQ(*expected_count_, counter.count());
@@ -345,10 +342,10 @@
     Dart::thread_pool()->Run(new SafepointTestTask(
         isolate, &monitor, &expected_count, &total_done, &exited));
   }
-  // Run Dart code on the main thread long enough to allow all helpers
-  // to get their verification done and exit. Use a specific UserTag
-  // to enable the helpers to verify that the main thread is
-  // successfully interrupted in the pure Dart loop.
+// Run Dart code on the main thread long enough to allow all helpers
+// to get their verification done and exit. Use a specific UserTag
+// to enable the helpers to verify that the main thread is
+// successfully interrupted in the pure Dart loop.
 #if defined(USING_SIMULATOR)
   const intptr_t kLoopCount = 12345678;
 #else
@@ -356,14 +353,16 @@
 #endif  // USING_SIMULATOR
   char buffer[1024];
   OS::SNPrint(buffer, sizeof(buffer),
-      "import 'dart:developer';\n"
-      "int dummy = 0;\n"
-      "main() {\n"
-      "  new UserTag('foo').makeCurrent();\n"
-      "  for (dummy = 0; dummy < %" Pd "; ++dummy) {\n"
-      "    dummy += (dummy & 1);\n"
-      "  }\n"
-      "}\n", kLoopCount);
+              "import 'dart:developer';\n"
+              "int dummy = 0;\n"
+              "main() {\n"
+              "  new UserTag('foo').makeCurrent();\n"
+              "  for (dummy = 0; dummy < %" Pd
+              "; ++dummy) {\n"
+              "    dummy += (dummy & 1);\n"
+              "  }\n"
+              "}\n",
+              kLoopCount);
   Dart_Handle lib = TestCase::LoadTestScript(buffer, NULL);
   EXPECT_VALID(lib);
   Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
@@ -491,8 +490,7 @@
     MonitorLocker ml(params.monitor);
     EXPECT(params.spawned_thread_id == OSThread::kInvalidThreadId);
     // Spawn thread and wait to receive the thread id.
-    OSThread::Start("ThreadIteratorTest",
-                    ThreadIteratorTestMain,
+    OSThread::Start("ThreadIteratorTest", ThreadIteratorTestMain,
                     reinterpret_cast<uword>(&params));
     while (params.spawned_thread_id == OSThread::kInvalidThreadId) {
       ml.Wait();
@@ -586,13 +584,8 @@
 
 class AllocAndGCTask : public ThreadPool::Task {
  public:
-  AllocAndGCTask(Isolate* isolate,
-                 Monitor* done_monitor,
-                 bool* done)
-    : isolate_(isolate),
-      done_monitor_(done_monitor),
-      done_(done) {
-  }
+  AllocAndGCTask(Isolate* isolate, Monitor* done_monitor, bool* done)
+      : isolate_(isolate), done_monitor_(done_monitor), done_(done) {}
 
   virtual void Run() {
     Thread::EnterIsolateAsHelper(isolate_, Thread::kUnknownTask);
diff --git a/runtime/vm/timeline.cc b/runtime/vm/timeline.cc
index 2627ac9..f0b0ee1 100644
--- a/runtime/vm/timeline.cc
+++ b/runtime/vm/timeline.cc
@@ -23,20 +23,29 @@
 DEFINE_FLAG(bool, complete_timeline, false, "Record the complete timeline");
 DEFINE_FLAG(bool, startup_timeline, false, "Record the startup timeline");
 DEFINE_FLAG(bool, systrace_timeline, false, "Record the timeline to systrace");
-DEFINE_FLAG(bool, trace_timeline, false,
-            "Trace timeline backend");
-DEFINE_FLAG(bool, trace_timeline_analysis, false,
+DEFINE_FLAG(bool, trace_timeline, false, "Trace timeline backend");
+DEFINE_FLAG(bool,
+            trace_timeline_analysis,
+            false,
             "Trace timeline analysis backend");
-DEFINE_FLAG(bool, timing, false,
+DEFINE_FLAG(bool,
+            timing,
+            false,
             "Dump isolate timing information from timeline.");
-DEFINE_FLAG(charp, timeline_dir, NULL,
+DEFINE_FLAG(charp,
+            timeline_dir,
+            NULL,
             "Enable all timeline trace streams and output VM global trace "
             "into specified directory.");
-DEFINE_FLAG(charp, timeline_streams, NULL,
+DEFINE_FLAG(charp,
+            timeline_streams,
+            NULL,
             "Comma separated list of timeline streams to record. "
             "Valid values: all, API, Compiler, Dart, Debugger, Embedder, "
             "GC, Isolate, and VM.");
-DEFINE_FLAG(charp, timeline_recorder, "ring",
+DEFINE_FLAG(charp,
+            timeline_recorder,
+            "ring",
             "Select the timeline recorder used. "
             "Valid values: ring, endless, startup, and systrace.")
 
@@ -164,8 +173,8 @@
 
 // Returns true if |streams| contains |stream| or "all". Not case sensitive.
 static bool HasStream(MallocGrowableArray<char*>* streams, const char* stream) {
-  if ((FLAG_timeline_dir != NULL) ||
-      FLAG_timing || FLAG_complete_timeline || FLAG_startup_timeline) {
+  if ((FLAG_timeline_dir != NULL) || FLAG_timing || FLAG_complete_timeline ||
+      FLAG_startup_timeline) {
     return true;
   }
   for (intptr_t i = 0; i < streams->length(); i++) {
@@ -184,10 +193,9 @@
   recorder_ = CreateTimelineRecorder();
   ASSERT(recorder_ != NULL);
   enabled_streams_ = GetEnabledByDefaultTimelineStreams();
-  // Global overrides.
+// Global overrides.
 #define TIMELINE_STREAM_FLAG_DEFAULT(name, not_used)                           \
-  stream_##name##_.Init(#name,                                                 \
-                        HasStream(enabled_streams_, #name));
+  stream_##name##_.Init(#name, HasStream(enabled_streams_, #name));
   TIMELINE_STREAM_LIST(TIMELINE_STREAM_FLAG_DEFAULT)
 #undef TIMELINE_STREAM_FLAG_DEFAULT
 
@@ -226,7 +234,7 @@
     recorder_->WriteTo(FLAG_timeline_dir);
   }
 
-  // Disable global streams.
+// Disable global streams.
 #define TIMELINE_STREAM_DISABLE(name, not_used)                                \
   Timeline::stream_##name##_.set_enabled(false);
   TIMELINE_STREAM_LIST(TIMELINE_STREAM_DISABLE)
@@ -278,18 +286,17 @@
   }
   {
     JSONArray availableStreams(&obj, "availableStreams");
-#define ADD_STREAM_NAME(name, not_used)                                        \
-    availableStreams.AddValue(#name);
-TIMELINE_STREAM_LIST(ADD_STREAM_NAME);
+#define ADD_STREAM_NAME(name, not_used) availableStreams.AddValue(#name);
+    TIMELINE_STREAM_LIST(ADD_STREAM_NAME);
 #undef ADD_STREAM_NAME
   }
   {
     JSONArray recordedStreams(&obj, "recordedStreams");
 #define ADD_RECORDED_STREAM_NAME(name, not_used)                               \
-    if (stream_##name##_.enabled()) {                                          \
-      recordedStreams.AddValue(#name);                                         \
-    }
-TIMELINE_STREAM_LIST(ADD_RECORDED_STREAM_NAME);
+  if (stream_##name##_.enabled()) {                                            \
+    recordedStreams.AddValue(#name);                                           \
+  }
+    TIMELINE_STREAM_LIST(ADD_RECORDED_STREAM_NAME);
 #undef ADD_RECORDED_STREAM_NAME
   }
 }
@@ -312,7 +319,7 @@
 
 #define TIMELINE_STREAM_DEFINE(name, enabled_by_default)                       \
   TimelineStream Timeline::stream_##name##_;
-  TIMELINE_STREAM_LIST(TIMELINE_STREAM_DEFINE)
+TIMELINE_STREAM_LIST(TIMELINE_STREAM_DEFINE)
 #undef TIMELINE_STREAM_DEFINE
 
 TimelineEvent::TimelineEvent()
@@ -326,8 +333,7 @@
       label_(NULL),
       category_(""),
       thread_(OSThread::kInvalidThreadId),
-      isolate_id_(ILLEGAL_PORT) {
-}
+      isolate_id_(ILLEGAL_PORT) {}
 
 
 TimelineEvent::~TimelineEvent() {
@@ -390,16 +396,14 @@
 }
 
 
-void TimelineEvent::DurationEnd(int64_t micros,
-                                int64_t thread_micros) {
+void TimelineEvent::DurationEnd(int64_t micros, int64_t thread_micros) {
   ASSERT(timestamp1_ == 0);
   set_timestamp1(micros);
   set_thread_timestamp1(thread_micros);
 }
 
 
-void TimelineEvent::Instant(const char* label,
-                            int64_t micros) {
+void TimelineEvent::Instant(const char* label, int64_t micros) {
   Init(kInstant, label);
   set_timestamp0(micros);
 }
@@ -477,8 +481,10 @@
 }
 
 
-void TimelineEvent::FormatArgument(intptr_t i, const char* name,
-                                   const char* fmt, ...) {
+void TimelineEvent::FormatArgument(intptr_t i,
+                                   const char* name,
+                                   const char* fmt,
+                                   ...) {
   ASSERT(i >= 0);
   ASSERT(i < arguments_length_);
   va_list args;
@@ -519,25 +525,20 @@
   switch (event_type()) {
     case kBegin: {
       length = OS::SNPrint(buffer, buffer_size, "B|%" Pd64 "|%s", pid, label());
-    }
-    break;
+    } break;
     case kEnd: {
       length = OS::SNPrint(buffer, buffer_size, "E");
-    }
-    break;
+    } break;
     case kCounter: {
       if (arguments_length_ > 0) {
         // We only report the first counter value.
-        length = OS::SNPrint(buffer, buffer_size,
-                             "C|%" Pd64 "|%s|%s",
-                             pid,
-                             label(),
-                             arguments_[0].value);
+        length = OS::SNPrint(buffer, buffer_size, "C|%" Pd64 "|%s|%s", pid,
+                             label(), arguments_[0].value);
       }
     }
     default:
       // Ignore event types that we cannot serialize to the Systrace format.
-    break;
+      break;
   }
   return length;
 }
@@ -573,8 +574,7 @@
 }
 
 
-void TimelineEvent::Init(EventType event_type,
-                         const char* label) {
+void TimelineEvent::Init(EventType event_type, const char* label) {
   ASSERT(label != NULL);
   state_ = 0;
   timestamp0_ = 0;
@@ -600,8 +600,7 @@
 
 bool TimelineEvent::Within(int64_t time_origin_micros,
                            int64_t time_extent_micros) {
-  if ((time_origin_micros == -1) ||
-      (time_extent_micros == -1)) {
+  if ((time_origin_micros == -1) || (time_extent_micros == -1)) {
     // No time range specified.
     return true;
   }
@@ -653,48 +652,39 @@
   switch (event_type()) {
     case kBegin: {
       obj.AddProperty("ph", "B");
-    }
-    break;
+    } break;
     case kEnd: {
       obj.AddProperty("ph", "E");
-    }
-    break;
+    } break;
     case kDuration: {
       obj.AddProperty("ph", "X");
       obj.AddPropertyTimeMicros("dur", TimeDuration());
       if (HasThreadCPUTime()) {
         obj.AddPropertyTimeMicros("tdur", ThreadCPUTimeDuration());
       }
-    }
-    break;
+    } break;
     case kInstant: {
       obj.AddProperty("ph", "i");
       obj.AddProperty("s", "p");
-    }
-    break;
+    } break;
     case kAsyncBegin: {
       obj.AddProperty("ph", "b");
       obj.AddPropertyF("id", "%" Px64 "", AsyncId());
-    }
-    break;
+    } break;
     case kAsyncInstant: {
       obj.AddProperty("ph", "n");
       obj.AddPropertyF("id", "%" Px64 "", AsyncId());
-    }
-    break;
+    } break;
     case kAsyncEnd: {
       obj.AddProperty("ph", "e");
       obj.AddPropertyF("id", "%" Px64 "", AsyncId());
-    }
-    break;
+    } break;
     case kMetadata: {
       obj.AddProperty("ph", "M");
-    }
-    break;
+    } break;
     case kCounter: {
       obj.AddProperty("ph", "C");
-    }
-    break;
+    } break;
     default:
       UNIMPLEMENTED();
   }
@@ -751,7 +741,6 @@
 }
 
 
-
 int64_t TimelineEvent::ThreadCPUTimeOrigin() const {
   ASSERT(HasThreadCPUTime());
   return thread_timestamp0_;
@@ -768,14 +757,10 @@
 }
 
 
-TimelineStream::TimelineStream()
-    : name_(NULL),
-      enabled_(false) {
-}
+TimelineStream::TimelineStream() : name_(NULL), enabled_(false) {}
 
 
-void TimelineStream::Init(const char* name,
-                          bool enabled) {
+void TimelineStream::Init(const char* name, bool enabled) {
   name_ = name;
   enabled_ = enabled;
 }
@@ -879,7 +864,8 @@
 
 void TimelineEventScope::FormatArgument(intptr_t i,
                                         const char* name,
-                                        const char* fmt, ...) {
+                                        const char* fmt,
+                                        ...) {
   if (!enabled()) {
     return;
   }
@@ -958,11 +944,8 @@
   }
   ASSERT(event != NULL);
   // Emit a duration event.
-  event->Duration(label(),
-                  timestamp_,
-                  OS::GetCurrentMonotonicMicros(),
-                  thread_timestamp_,
-                  OS::GetCurrentThreadCPUMicros());
+  event->Duration(label(), timestamp_, OS::GetCurrentMonotonicMicros(),
+                  thread_timestamp_, OS::GetCurrentThreadCPUMicros());
   StealArguments(event);
   event->Complete();
 }
@@ -1047,25 +1030,19 @@
 }
 
 
-TimelineEventFilter::~TimelineEventFilter() {
-}
+TimelineEventFilter::~TimelineEventFilter() {}
 
 
 IsolateTimelineEventFilter::IsolateTimelineEventFilter(
     Dart_Port isolate_id,
     int64_t time_origin_micros,
     int64_t time_extent_micros)
-    : TimelineEventFilter(time_origin_micros,
-                          time_extent_micros),
-      isolate_id_(isolate_id) {
-}
+    : TimelineEventFilter(time_origin_micros, time_extent_micros),
+      isolate_id_(isolate_id) {}
 
 
 TimelineEventRecorder::TimelineEventRecorder()
-    : async_id_(0),
-      time_low_micros_(0),
-      time_high_micros_(0) {
-}
+    : async_id_(0), time_low_micros_(0), time_high_micros_(0) {}
 
 
 void TimelineEventRecorder::PrintJSONMeta(JSONArray* events) const {
@@ -1133,7 +1110,7 @@
     TimelineEvent* event = thread_block->StartEvent();
     return event;
   }
-  // Drop lock here as no event is being handed out.
+// Drop lock here as no event is being handed out.
 #if defined(DEBUG)
   if (T != NULL) {
     T->DecrementNoSafepointScopeDepth();
@@ -1210,8 +1187,8 @@
   Timeline::ReclaimCachedBlocksFromThreads();
 
   intptr_t pid = OS::ProcessId();
-  char* filename = OS::SCreate(NULL,
-      "%s/dart-timeline-%" Pd ".json", directory, pid);
+  char* filename =
+      OS::SCreate(NULL, "%s/dart-timeline-%" Pd ".json", directory, pid);
   void* file = (*file_open)(filename, true);
   if (file == NULL) {
     OS::Print("Failed to write timeline file: %s\n", filename);
@@ -1238,8 +1215,8 @@
 
 int64_t TimelineEventRecorder::GetNextAsyncId() {
   // TODO(johnmccutchan): Gracefully handle wrap around.
-  uint32_t next = static_cast<uint32_t>(
-      AtomicOperations::FetchAndIncrement(&async_id_));
+  uint32_t next =
+      static_cast<uint32_t>(AtomicOperations::FetchAndIncrement(&async_id_));
   return static_cast<int64_t>(next);
 }
 
@@ -1261,17 +1238,13 @@
 
 TimelineEventFixedBufferRecorder::TimelineEventFixedBufferRecorder(
     intptr_t capacity)
-    : blocks_(NULL),
-      capacity_(capacity),
-      num_blocks_(0),
-      block_cursor_(0) {
+    : blocks_(NULL), capacity_(capacity), num_blocks_(0), block_cursor_(0) {
   // Capacity must be a multiple of TimelineEventBlock::kBlockSize
   ASSERT((capacity % TimelineEventBlock::kBlockSize) == 0);
   // Allocate blocks array.
   num_blocks_ = capacity / TimelineEventBlock::kBlockSize;
-  blocks_ =
-      reinterpret_cast<TimelineEventBlock**>(
-          calloc(num_blocks_, sizeof(TimelineEventBlock*)));
+  blocks_ = reinterpret_cast<TimelineEventBlock**>(
+      calloc(num_blocks_, sizeof(TimelineEventBlock*)));
   // Allocate each block.
   for (intptr_t i = 0; i < num_blocks_; i++) {
     blocks_[i] = new TimelineEventBlock(i);
@@ -1401,8 +1374,7 @@
 
 
 TimelineEventSystraceRecorder::TimelineEventSystraceRecorder(intptr_t capacity)
-    : TimelineEventFixedBufferRecorder(capacity),
-      systrace_fd_(-1) {
+    : TimelineEventFixedBufferRecorder(capacity), systrace_fd_(-1) {
 #if defined(TARGET_OS_ANDROID) || defined(TARGET_OS_LINUX)
   const char* kSystracePath = "/sys/kernel/debug/tracing/trace_marker";
   systrace_fd_ = open(kSystracePath, O_WRONLY);
@@ -1411,8 +1383,9 @@
                  kSystracePath);
   }
 #else
-  OS::PrintErr("Warning: The systrace timeline recorder is equivalent to the"
-               "ring recorder on this platform.");
+  OS::PrintErr(
+      "Warning: The systrace timeline recorder is equivalent to the"
+      "ring recorder on this platform.");
 #endif
 }
 
@@ -1487,16 +1460,14 @@
 }
 
 
-TimelineEventCallbackRecorder::TimelineEventCallbackRecorder() {
-}
+TimelineEventCallbackRecorder::TimelineEventCallbackRecorder() {}
 
 
-TimelineEventCallbackRecorder::~TimelineEventCallbackRecorder() {
-}
+TimelineEventCallbackRecorder::~TimelineEventCallbackRecorder() {}
 
 
 void TimelineEventCallbackRecorder::PrintJSON(JSONStream* js,
-                                               TimelineEventFilter* filter) {
+                                              TimelineEventFilter* filter) {
   if (!FLAG_support_service) {
     return;
   }
@@ -1532,9 +1503,7 @@
 
 
 TimelineEventEndlessRecorder::TimelineEventEndlessRecorder()
-    : head_(NULL),
-      block_index_(0) {
-}
+    : head_(NULL), block_index_(0) {}
 
 
 void TimelineEventEndlessRecorder::PrintJSON(JSONStream* js,
@@ -1662,8 +1631,7 @@
       length_(0),
       block_index_(block_index),
       thread_id_(OSThread::kInvalidThreadId),
-      in_use_(false) {
-}
+      in_use_(false) {}
 
 
 TimelineEventBlock::~TimelineEventBlock() {
@@ -1760,8 +1728,7 @@
 
 TimelineEventBlockIterator::TimelineEventBlockIterator(
     TimelineEventRecorder* recorder)
-    : current_(NULL),
-      recorder_(NULL) {
+    : current_(NULL), recorder_(NULL) {
   Reset(recorder);
 }
 
diff --git a/runtime/vm/timeline.h b/runtime/vm/timeline.h
index 851113f..cc93040 100644
--- a/runtime/vm/timeline.h
+++ b/runtime/vm/timeline.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_TIMELINE_H_
-#define VM_TIMELINE_H_
+#ifndef RUNTIME_VM_TIMELINE_H_
+#define RUNTIME_VM_TIMELINE_H_
 
 #include "include/dart_tools_api.h"
 
@@ -44,20 +44,13 @@
  public:
   TimelineStream();
 
-  void Init(const char* name,
-            bool enabled);
+  void Init(const char* name, bool enabled);
 
-  const char* name() const {
-    return name_;
-  }
+  const char* name() const { return name_; }
 
-  bool enabled() const {
-    return enabled_ != 0;
-  }
+  bool enabled() const { return enabled_ != 0; }
 
-  void set_enabled(bool enabled) {
-    enabled_ = enabled ? 1 : 0;
-  }
+  void set_enabled(bool enabled) { enabled_ = enabled ? 1 : 0; }
 
   // Records an event. Will return |NULL| if not enabled. The returned
   // |TimelineEvent| is in an undefined state and must be initialized.
@@ -230,18 +223,15 @@
   // |name| must be a compile time constant. Copies |argument|.
   void CopyArgument(intptr_t i, const char* name, const char* argument);
   // |name| must be a compile time constant.
-  void FormatArgument(intptr_t i,
-                      const char* name,
-                      const char* fmt, ...) PRINTF_ATTRIBUTE(4, 5);
+  void FormatArgument(intptr_t i, const char* name, const char* fmt, ...)
+      PRINTF_ATTRIBUTE(4, 5);
 
   void StealArguments(intptr_t arguments_length,
                       TimelineEventArgument* arguments);
   // Mandatory to call when this event is completely filled out.
   void Complete();
 
-  EventType event_type() const {
-    return EventTypeField::decode(state_);
-  }
+  EventType event_type() const { return EventTypeField::decode(state_); }
 
   bool IsFinishedDuration() const {
     return (event_type() == kDuration) && (timestamp1_ > timestamp0_);
@@ -266,43 +256,27 @@
 
   void PrintJSON(JSONStream* stream) const;
 
-  ThreadId thread() const {
-    return thread_;
-  }
+  ThreadId thread() const { return thread_; }
 
-  void set_thread(ThreadId tid) {
-    thread_ = tid;
-  }
+  void set_thread(ThreadId tid) { thread_ = tid; }
 
-  Dart_Port isolate_id() const {
-    return isolate_id_;
-  }
+  Dart_Port isolate_id() const { return isolate_id_; }
 
-  const char* label() const {
-    return label_;
-  }
+  const char* label() const { return label_; }
 
   // Does this duration end before |micros| ?
   bool DurationFinishedBefore(int64_t micros) const {
     return TimeEnd() <= micros;
   }
 
-  bool IsDuration() const {
-    return (event_type() == kDuration);
-  }
+  bool IsDuration() const { return (event_type() == kDuration); }
 
-  bool IsBegin() const {
-    return (event_type() == kBegin);
-  }
+  bool IsBegin() const { return (event_type() == kBegin); }
 
-  bool IsEnd() const {
-    return (event_type() == kEnd);
-  }
+  bool IsEnd() const { return (event_type() == kEnd); }
 
   // Is this event a synchronous begin or end event?
-  bool IsBeginOrEnd() const {
-    return IsBegin() || IsEnd();
-  }
+  bool IsBeginOrEnd() const { return IsBegin() || IsEnd(); }
 
   // Does this duration fully contain |other| ?
   bool DurationContains(TimelineEvent* other) const {
@@ -333,8 +307,7 @@
     }
   }
 
-  bool Within(int64_t time_origin_micros,
-              int64_t time_extent_micros);
+  bool Within(int64_t time_origin_micros, int64_t time_extent_micros);
 
   const char* GetSerializedJSON() const;
 
@@ -376,17 +349,13 @@
     thread_timestamp1_ = value;
   }
 
-  bool pre_serialized_json() const {
-    return PreSerializedJSON::decode(state_);
-  }
+  bool pre_serialized_json() const { return PreSerializedJSON::decode(state_); }
 
   void set_pre_serialized_json(bool pre_serialized_json) {
     state_ = PreSerializedJSON::update(pre_serialized_json, state_);
   }
 
-  bool owns_label() const {
-    return OwnsLabelBit::decode(state_);
-  }
+  bool owns_label() const { return OwnsLabelBit::decode(state_); }
 
   enum StateBits {
     kEventTypeBit = 0,  // reserve 4 bits for type.
@@ -396,8 +365,8 @@
   };
 
   class EventTypeField : public BitField<uword, EventType, kEventTypeBit, 4> {};
-  class PreSerializedJSON :
-      public BitField<uword, bool, kPreSerializedJSON, 1> {};
+  class PreSerializedJSON
+      : public BitField<uword, bool, kPreSerializedJSON, 1> {};
   class OwnsLabelBit : public BitField<uword, bool, kOwnsLabelBit, 1> {};
 
   int64_t timestamp0_;
@@ -425,15 +394,11 @@
 
 #ifndef PRODUCT
 #define TIMELINE_FUNCTION_COMPILATION_DURATION(thread, name, function)         \
-  TimelineDurationScope tds(thread,                                            \
-                            Timeline::GetCompilerStream(),                     \
-                            name);                                             \
+  TimelineDurationScope tds(thread, Timeline::GetCompilerStream(), name);      \
   if (tds.enabled()) {                                                         \
     tds.SetNumArguments(1);                                                    \
-    tds.CopyArgument(                                                          \
-        0,                                                                     \
-        "function",                                                            \
-        function.ToLibNamePrefixedQualifiedCString());                         \
+    tds.CopyArgument(0, "function",                                            \
+                     function.ToLibNamePrefixedQualifiedCString());            \
   }
 
 #define TIMELINE_FUNCTION_GC_DURATION(thread, name)                            \
@@ -446,9 +411,7 @@
 // See |TimelineDurationScope| and |TimelineBeginEndScope|.
 class TimelineEventScope : public StackResource {
  public:
-  bool enabled() const {
-    return enabled_;
-  }
+  bool enabled() const { return enabled_; }
 
   void SetNumArguments(intptr_t length);
 
@@ -456,33 +419,21 @@
 
   void CopyArgument(intptr_t i, const char* name, const char* argument);
 
-  void FormatArgument(intptr_t i,
-                      const char* name,
-                      const char* fmt, ...)  PRINTF_ATTRIBUTE(4, 5);
+  void FormatArgument(intptr_t i, const char* name, const char* fmt, ...)
+      PRINTF_ATTRIBUTE(4, 5);
 
  protected:
-  TimelineEventScope(TimelineStream* stream,
-                     const char* label);
+  TimelineEventScope(TimelineStream* stream, const char* label);
 
-  TimelineEventScope(Thread* thread,
-                     TimelineStream* stream,
-                     const char* label);
+  TimelineEventScope(Thread* thread, TimelineStream* stream, const char* label);
 
-  bool ShouldEmitEvent() const {
-    return enabled_;
-  }
+  bool ShouldEmitEvent() const { return enabled_; }
 
-  void set_enabled(bool enabled) {
-    enabled_ = enabled;
-  }
+  void set_enabled(bool enabled) { enabled_ = enabled; }
 
-  const char* label() const {
-    return label_;
-  }
+  const char* label() const { return label_; }
 
-  TimelineStream* stream() const {
-    return stream_;
-  }
+  TimelineStream* stream() const { return stream_; }
 
   virtual ~TimelineEventScope();
 
@@ -504,8 +455,7 @@
 
 class TimelineDurationScope : public TimelineEventScope {
  public:
-  TimelineDurationScope(TimelineStream* stream,
-                        const char* label);
+  TimelineDurationScope(TimelineStream* stream, const char* label);
 
   TimelineDurationScope(Thread* thread,
                         TimelineStream* stream,
@@ -523,8 +473,7 @@
 
 class TimelineBeginEndScope : public TimelineEventScope {
  public:
-  TimelineBeginEndScope(TimelineStream* stream,
-                        const char* label);
+  TimelineBeginEndScope(TimelineStream* stream, const char* label);
 
   TimelineBeginEndScope(Thread* thread,
                         TimelineStream* stream,
@@ -548,28 +497,16 @@
   explicit TimelineEventBlock(intptr_t index);
   ~TimelineEventBlock();
 
-  TimelineEventBlock* next() const {
-    return next_;
-  }
-  void set_next(TimelineEventBlock* next) {
-    next_ = next;
-  }
+  TimelineEventBlock* next() const { return next_; }
+  void set_next(TimelineEventBlock* next) { next_ = next; }
 
-  intptr_t length() const {
-    return length_;
-  }
+  intptr_t length() const { return length_; }
 
-  intptr_t block_index() const {
-    return block_index_;
-  }
+  intptr_t block_index() const { return block_index_; }
 
-  bool IsEmpty() const {
-    return length_ == 0;
-  }
+  bool IsEmpty() const { return length_ == 0; }
 
-  bool IsFull() const {
-    return length_ == kBlockSize;
-  }
+  bool IsFull() const { return length_ == kBlockSize; }
 
   TimelineEvent* At(intptr_t index) {
     ASSERT(index >= 0);
@@ -595,14 +532,10 @@
   void Reset();
 
   // Only safe to access under the recorder's lock.
-  bool in_use() const {
-    return in_use_;
-  }
+  bool in_use() const { return in_use_; }
 
   // Only safe to access under the recorder's lock.
-  ThreadId thread_id() const {
-    return thread_id_;
-  }
+  ThreadId thread_id() const { return thread_id_; }
 
  protected:
   void PrintJSON(JSONStream* stream) const;
@@ -657,13 +590,9 @@
     return event->IsValid();
   }
 
-  int64_t time_origin_micros() const {
-    return time_origin_micros_;
-  }
+  int64_t time_origin_micros() const { return time_origin_micros_; }
 
-  int64_t time_extent_micros() const {
-    return time_extent_micros_;
-  }
+  int64_t time_extent_micros() const { return time_extent_micros_; }
 
  private:
   int64_t time_origin_micros_;
@@ -686,8 +615,7 @@
   }
 
   bool IncludeEvent(TimelineEvent* event) {
-    return event->IsValid() &&
-           (event->isolate_id() == isolate_id_);
+    return event->IsValid() && (event->isolate_id() == isolate_id_);
   }
 
  private:
@@ -782,9 +710,7 @@
       : TimelineEventFixedBufferRecorder(capacity) {}
   ~TimelineEventRingRecorder() {}
 
-  const char* name() const {
-    return "Ring";
-  }
+  const char* name() const { return "Ring"; }
 
  protected:
   TimelineEventBlock* GetNewBlockLocked();
@@ -794,16 +720,13 @@
 // A recorder that writes events to Android Systrace. Events are also stored in
 // a buffer of fixed capacity. When the buffer is full, new events overwrite
 // old events.
-class TimelineEventSystraceRecorder
-    : public TimelineEventFixedBufferRecorder {
+class TimelineEventSystraceRecorder : public TimelineEventFixedBufferRecorder {
  public:
   explicit TimelineEventSystraceRecorder(intptr_t capacity = kDefaultCapacity);
 
   ~TimelineEventSystraceRecorder();
 
-  const char* name() const {
-    return "Systrace";
-  }
+  const char* name() const { return "Systrace"; }
 
  protected:
   TimelineEventBlock* GetNewBlockLocked();
@@ -821,9 +744,7 @@
       : TimelineEventFixedBufferRecorder(capacity) {}
   ~TimelineEventStartupRecorder() {}
 
-  const char* name() const {
-    return "Startup";
-  }
+  const char* name() const { return "Startup"; }
 
  protected:
   TimelineEventBlock* GetNewBlockLocked();
@@ -844,19 +765,12 @@
   // |event| as it may be freed as soon as this function returns.
   virtual void OnEvent(TimelineEvent* event) = 0;
 
-  const char* name() const {
-    return "Callback";
-  }
+  const char* name() const { return "Callback"; }
 
  protected:
-  TimelineEventBlock* GetNewBlockLocked() {
-    return NULL;
-  }
-  TimelineEventBlock* GetHeadBlockLocked() {
-    return NULL;
-  }
-  void Clear() {
-  }
+  TimelineEventBlock* GetNewBlockLocked() { return NULL; }
+  TimelineEventBlock* GetHeadBlockLocked() { return NULL; }
+  void Clear() {}
   TimelineEvent* StartEvent();
   void CompleteEvent(TimelineEvent* event);
 };
@@ -872,9 +786,7 @@
   void PrintJSON(JSONStream* js, TimelineEventFilter* filter);
   void PrintTraceEvent(JSONStream* js, TimelineEventFilter* filter);
 
-  const char* name() const {
-    return "Endless";
-  }
+  const char* name() const { return "Endless"; }
 
  protected:
   TimelineEvent* StartEvent();
@@ -914,4 +826,4 @@
 
 }  // namespace dart
 
-#endif  // VM_TIMELINE_H_
+#endif  // RUNTIME_VM_TIMELINE_H_
diff --git a/runtime/vm/timeline_analysis.cc b/runtime/vm/timeline_analysis.cc
index 5360d29..f4e7fd0 100644
--- a/runtime/vm/timeline_analysis.cc
+++ b/runtime/vm/timeline_analysis.cc
@@ -15,13 +15,10 @@
 DECLARE_FLAG(bool, trace_timeline_analysis);
 DECLARE_FLAG(bool, timing);
 
-TimelineAnalysisThread::TimelineAnalysisThread(ThreadId id)
-    : id_(id) {
-}
+TimelineAnalysisThread::TimelineAnalysisThread(ThreadId id) : id_(id) {}
 
 
-TimelineAnalysisThread::~TimelineAnalysisThread() {
-}
+TimelineAnalysisThread::~TimelineAnalysisThread() {}
 
 
 void TimelineAnalysisThread::AddBlock(TimelineEventBlock* block) {
@@ -43,8 +40,7 @@
   blocks_.Sort(CompareBlocksLowerTimeBound);
   if (FLAG_trace_timeline_analysis) {
     THR_Print("Thread %" Px " has %" Pd " blocks\n",
-              OSThread::ThreadIdToIntPtr(id_),
-              blocks_.length());
+              OSThread::ThreadIdToIntPtr(id_), blocks_.length());
   }
 }
 
@@ -120,8 +116,7 @@
 }
 
 
-TimelineAnalysis::~TimelineAnalysis() {
-}
+TimelineAnalysis::~TimelineAnalysis() {}
 
 
 void TimelineAnalysis::BuildThreads() {
@@ -166,11 +161,15 @@
     }
     if (!block->CheckBlock()) {
       if (FLAG_trace_timeline_analysis) {
-        THR_Print("DiscoverThreads block %" Pd " "
-                  "violates invariants.\n", block->block_index());
+        THR_Print("DiscoverThreads block %" Pd
+                  " "
+                  "violates invariants.\n",
+                  block->block_index());
       }
-      SetError("Block %" Pd " violates invariants. See "
-               "TimelineEventBlock::CheckBlock", block->block_index());
+      SetError("Block %" Pd
+               " violates invariants. See "
+               "TimelineEventBlock::CheckBlock",
+               block->block_index());
       return;
     }
     TimelineAnalysisThread* thread = GetOrAddThread(block->thread_id());
@@ -268,8 +267,7 @@
 TimelinePauses::TimelinePauses(Zone* zone,
                                Isolate* isolate,
                                TimelineEventRecorder* recorder)
-    : TimelineAnalysis(zone, isolate, recorder) {
-}
+    : TimelineAnalysis(zone, isolate, recorder) {}
 
 
 void TimelinePauses::Setup() {
@@ -376,8 +374,7 @@
   PopFinishedDurations(kMaxInt64);
   if (FLAG_trace_timeline_analysis) {
     THR_Print("<<< TimelinePauses::ProcessThread %" Px " had %" Pd " events\n",
-              OSThread::ThreadIdToIntPtr(thread->id()),
-              event_count);
+              OSThread::ThreadIdToIntPtr(thread->id()), event_count);
   }
 }
 
@@ -410,10 +407,8 @@
       // Top of stack completes before |start|.
       stack_.RemoveLast();
       if (FLAG_trace_timeline_analysis) {
-        THR_Print("Popping %s (%" Pd64 " <= %" Pd64 ")\n",
-                  top.event->label(),
-                  top.event->TimeEnd(),
-                  start);
+        THR_Print("Popping %s (%" Pd64 " <= %" Pd64 ")\n", top.event->label(),
+                  top.event->TimeEnd(), start);
       }
     } else {
       return;
@@ -440,26 +435,22 @@
   const int64_t duration = end - start;
   // Sanity checks.
   if (strcmp(top_label, label) != 0) {
-    SetError("PopBegin(%s, ...) called with %s at the top of stack",
-             label, top.event->label());
+    SetError("PopBegin(%s, ...) called with %s at the top of stack", label,
+             top.event->label());
     return;
   }
   if (!top_is_begin) {
-    SetError("kEnd event not paired with kBegin event for label %s",
-             label);
+    SetError("kEnd event not paired with kBegin event for label %s", label);
     return;
   }
   // Pop this event.
   // Add duration to exclusive micros.
   if (FLAG_trace_timeline_analysis) {
-    THR_Print("Popping %s (%" Pd64 ")\n",
-              top.event->label(),
-              duration);
+    THR_Print("Popping %s (%" Pd64 ")\n", top.event->label(), duration);
   }
   const int64_t exclusive_micros = top.exclusive_micros + duration;
   stack_.RemoveLast();
-  top.pause_info->OnBeginPop(duration,
-                             exclusive_micros,
+  top.pause_info->OnBeginPop(duration, exclusive_micros,
                              IsLabelOnStack(top_label));
   if (StackDepth() > 0) {
     StackItem& top = GetStackTop();
@@ -474,8 +465,7 @@
   ASSERT(pause_info != NULL);
   // |pause_info| will be running for |event->TimeDuration()|.
   if (FLAG_trace_timeline_analysis) {
-    THR_Print("Pushing %s %" Pd64 " us\n",
-              pause_info->name(),
+    THR_Print("Pushing %s %" Pd64 " us\n", pause_info->name(),
               event->TimeDuration());
   }
   if (event->IsDuration()) {
@@ -541,12 +531,10 @@
 }
 
 
-TimelinePauseTrace::TimelinePauseTrace() {
-}
+TimelinePauseTrace::TimelinePauseTrace() {}
 
 
-TimelinePauseTrace::~TimelinePauseTrace() {
-}
+TimelinePauseTrace::~TimelinePauseTrace() {}
 
 
 void TimelinePauseTrace::Print() {
@@ -561,16 +549,14 @@
   TimelinePauses pauses(zone, isolate, recorder);
   pauses.Setup();
 
-  THR_Print("Timing for isolate %s (from %" Pd " threads)\n",
-            isolate->name(),
+  THR_Print("Timing for isolate %s (from %" Pd " threads)\n", isolate->name(),
             pauses.NumThreads());
   THR_Print("\n");
   for (intptr_t t_idx = 0; t_idx < pauses.NumThreads(); t_idx++) {
     TimelineAnalysisThread* tat = pauses.At(t_idx);
     ASSERT(tat != NULL);
     pauses.CalculatePauseTimesForThread(tat->id());
-    THR_Print("Thread %" Pd " (%" Px "):\n",
-              t_idx,
+    THR_Print("Thread %" Pd " (%" Px "):\n", t_idx,
               OSThread::ThreadIdToIntPtr(tat->id()));
     for (intptr_t j = 0; j < pauses.NumPauseInfos(); j++) {
       const TimelineLabelPauseInfo* pause_info = pauses.PauseInfoAt(j);
diff --git a/runtime/vm/timeline_analysis.h b/runtime/vm/timeline_analysis.h
index 4f733a6..ca1424b 100644
--- a/runtime/vm/timeline_analysis.h
+++ b/runtime/vm/timeline_analysis.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_TIMELINE_ANALYSIS_H_
-#define VM_TIMELINE_ANALYSIS_H_
+#ifndef RUNTIME_VM_TIMELINE_ANALYSIS_H_
+#define RUNTIME_VM_TIMELINE_ANALYSIS_H_
 
 #include "vm/growable_array.h"
 #include "vm/timeline.h"
@@ -15,17 +15,11 @@
   explicit TimelineAnalysisThread(ThreadId id);
   ~TimelineAnalysisThread();
 
-  ThreadId id() const {
-    return id_;
-  }
+  ThreadId id() const { return id_; }
 
-  intptr_t NumBlocks() const {
-    return blocks_.length();
-  }
+  intptr_t NumBlocks() const { return blocks_.length(); }
 
-  TimelineEventBlock* At(intptr_t i) const {
-    return blocks_.At(i);
-  }
+  TimelineEventBlock* At(intptr_t i) const { return blocks_.At(i); }
 
  private:
   void AddBlock(TimelineEventBlock* block);
@@ -69,23 +63,15 @@
 
   void BuildThreads();
 
-  intptr_t NumThreads() const {
-    return threads_.length();
-  }
+  intptr_t NumThreads() const { return threads_.length(); }
 
-  TimelineAnalysisThread* At(intptr_t i) const {
-    return threads_[i];
-  }
+  TimelineAnalysisThread* At(intptr_t i) const { return threads_[i]; }
 
   TimelineAnalysisThread* GetThread(ThreadId tid);
 
-  bool has_error() const {
-    return has_error_;
-  }
+  bool has_error() const { return has_error_; }
 
-  const char* error_msg() const {
-    return error_msg_;
-  }
+  const char* error_msg() const { return error_msg_; }
 
  protected:
   TimelineAnalysisThread* GetOrAddThread(ThreadId tid);
@@ -109,25 +95,15 @@
  public:
   explicit TimelineLabelPauseInfo(const char* name);
 
-  const char* name() const {
-    return name_;
-  }
+  const char* name() const { return name_; }
 
-  int64_t inclusive_micros() const {
-    return inclusive_micros_;
-  }
+  int64_t inclusive_micros() const { return inclusive_micros_; }
 
-  int64_t exclusive_micros() const {
-    return exclusive_micros_;
-  }
+  int64_t exclusive_micros() const { return exclusive_micros_; }
 
-  int64_t max_inclusive_micros() const {
-    return max_inclusive_micros_;
-  }
+  int64_t max_inclusive_micros() const { return max_inclusive_micros_; }
 
-  int64_t max_exclusive_micros() const {
-    return max_exclusive_micros_;
-  }
+  int64_t max_exclusive_micros() const { return max_exclusive_micros_; }
 
  private:
   // Adjusts |inclusive_micros_| and |exclusive_micros_| by |micros|.
@@ -174,9 +150,7 @@
 
 class TimelinePauses : public TimelineAnalysis {
  public:
-  TimelinePauses(Zone* zone,
-                 Isolate* isolate,
-                 TimelineEventRecorder* recorder);
+  TimelinePauses(Zone* zone, Isolate* isolate, TimelineEventRecorder* recorder);
 
   void Setup();
 
@@ -189,9 +163,7 @@
   int64_t MaxInclusiveTime(const char* name) const;
   int64_t MaxExclusiveTime(const char* name) const;
 
-  intptr_t NumPauseInfos() const {
-    return labels_.length();
-  }
+  intptr_t NumPauseInfos() const { return labels_.length(); }
 
   const TimelineLabelPauseInfo* PauseInfoAt(intptr_t i) const {
     return labels_.At(i);
@@ -236,4 +208,4 @@
 
 }  // namespace dart
 
-#endif  // VM_TIMELINE_ANALYSIS_H_
+#endif  // RUNTIME_VM_TIMELINE_ANALYSIS_H_
diff --git a/runtime/vm/timeline_test.cc b/runtime/vm/timeline_test.cc
index e7f0e7a..2266898 100644
--- a/runtime/vm/timeline_test.cc
+++ b/runtime/vm/timeline_test.cc
@@ -24,9 +24,7 @@
     Timeline::recorder_ = new_recorder;
   }
 
-  ~TimelineRecorderOverride() {
-    Timeline::recorder_ = recorder_;
-  }
+  ~TimelineRecorderOverride() { Timeline::recorder_ = recorder_; }
 
  private:
   TimelineEventRecorder* recorder_;
@@ -39,11 +37,10 @@
     event->StreamInit(stream);
   }
 
-  static void FakeThreadEvent(
-      TimelineEventBlock* block,
-      intptr_t ftid,
-      const char* label = "fake",
-      TimelineStream* stream = NULL) {
+  static void FakeThreadEvent(TimelineEventBlock* block,
+                              intptr_t ftid,
+                              const char* label = "fake",
+                              TimelineStream* stream = NULL) {
     TimelineEvent* event = block->StartEvent();
     ASSERT(event != NULL);
     event->DurationBegin(label);
@@ -53,16 +50,14 @@
     }
   }
 
-  static void SetBlockThread(TimelineEventBlock* block,
-                             intptr_t ftid) {
+  static void SetBlockThread(TimelineEventBlock* block, intptr_t ftid) {
     block->thread_id_ = OSThread::ThreadIdFromIntPtr(ftid);
   }
 
-  static void FakeDuration(
-      TimelineEventRecorder* recorder,
-      const char* label,
-      int64_t start,
-      int64_t end) {
+  static void FakeDuration(TimelineEventRecorder* recorder,
+                           const char* label,
+                           int64_t start,
+                           int64_t end) {
     ASSERT(recorder != NULL);
     ASSERT(start < end);
     ASSERT(label != NULL);
@@ -72,10 +67,9 @@
     event->Complete();
   }
 
-  static void FakeBegin(
-      TimelineEventRecorder* recorder,
-      const char* label,
-      int64_t start) {
+  static void FakeBegin(TimelineEventRecorder* recorder,
+                        const char* label,
+                        int64_t start) {
     ASSERT(recorder != NULL);
     ASSERT(label != NULL);
     ASSERT(start >= 0);
@@ -85,10 +79,9 @@
     event->Complete();
   }
 
-  static void FakeEnd(
-      TimelineEventRecorder* recorder,
-      const char* label,
-      int64_t end) {
+  static void FakeEnd(TimelineEventRecorder* recorder,
+                      const char* label,
+                      int64_t end) {
     ASSERT(recorder != NULL);
     ASSERT(label != NULL);
     ASSERT(end >= 0);
@@ -103,9 +96,7 @@
     recorder->Clear();
   }
 
-  static void FinishBlock(TimelineEventBlock* block) {
-    block->Finish();
-  }
+  static void FinishBlock(TimelineEventBlock* block) { block->Finish(); }
 };
 
 
@@ -289,13 +280,9 @@
     }
   }
 
-  void OnEvent(TimelineEvent* event) {
-    counts_[event->event_type()]++;
-  }
+  void OnEvent(TimelineEvent* event) { counts_[event->event_type()]++; }
 
-  intptr_t CountFor(TimelineEvent::EventType type) {
-    return counts_[type];
-  }
+  intptr_t CountFor(TimelineEvent::EventType type) { return counts_[type]; }
 
  private:
   intptr_t counts_[TimelineEvent::kNumEventTypes];
@@ -307,8 +294,7 @@
   TimelineRecorderOverride override(recorder);
 
   // Initial counts are all zero.
-  for (intptr_t i = TimelineEvent::kNone + 1;
-       i < TimelineEvent::kNumEventTypes;
+  for (intptr_t i = TimelineEvent::kNone + 1; i < TimelineEvent::kNumEventTypes;
        i++) {
     EXPECT_EQ(0, recorder->CountFor(static_cast<TimelineEvent::EventType>(i)));
   }
diff --git a/runtime/vm/timer.cc b/runtime/vm/timer.cc
index 5b76b48..94835e9 100644
--- a/runtime/vm/timer.cc
+++ b/runtime/vm/timer.cc
@@ -6,8 +6,4 @@
 #include "vm/timer.h"
 #include "vm/json_stream.h"
 
-namespace dart {
-
-
-
-}  // namespace dart
+namespace dart {}  // namespace dart
diff --git a/runtime/vm/timer.h b/runtime/vm/timer.h
index 01a6b6f..1cf28c9 100644
--- a/runtime/vm/timer.h
+++ b/runtime/vm/timer.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_TIMER_H_
-#define VM_TIMER_H_
+#ifndef RUNTIME_VM_TIMER_H_
+#define RUNTIME_VM_TIMER_H_
 
 #include "platform/utils.h"
 #include "vm/allocation.h"
@@ -16,8 +16,7 @@
 // Timer class allows timing of specific operations in the VM.
 class Timer : public ValueObject {
  public:
-  Timer(bool report, const char* message)
-      : report_(report), message_(message) {
+  Timer(bool report, const char* message) : report_(report), message_(message) {
     Reset();
   }
   ~Timer() {}
@@ -69,7 +68,7 @@
 
   bool IsReset() const {
     return (start_ == 0) && (stop_ == 0) && (total_ == 0) &&
-        (max_contiguous_ == 0) && !running_;
+           (max_contiguous_ == 0) && !running_;
   }
 
   void AddTotal(const Timer& other) {
@@ -111,9 +110,7 @@
 class TimerScope : public StackResource {
  public:
   TimerScope(bool flag, Timer* timer, Thread* thread = NULL)
-      : StackResource(thread),
-        nested_(false),
-        timer_(flag ? timer : NULL) {
+      : StackResource(thread), nested_(false), timer_(flag ? timer : NULL) {
     Init();
   }
 
@@ -146,9 +143,7 @@
 class PauseTimerScope : public StackResource {
  public:
   PauseTimerScope(bool flag, Timer* timer, Thread* thread = NULL)
-      : StackResource(thread),
-        nested_(false),
-        timer_(flag ? timer : NULL) {
+      : StackResource(thread), nested_(false), timer_(flag ? timer : NULL) {
     if (timer_) {
       if (timer_->running()) {
         timer_->Stop();
@@ -174,7 +169,6 @@
 };
 
 
-
 }  // namespace dart
 
-#endif  // VM_TIMER_H_
+#endif  // RUNTIME_VM_TIMER_H_
diff --git a/runtime/vm/token.cc b/runtime/vm/token.cc
index b6a34ce..5109177 100644
--- a/runtime/vm/token.cc
+++ b/runtime/vm/token.cc
@@ -9,31 +9,23 @@
 namespace dart {
 
 #define TOKEN_NAME(t, s, p, a) #t,
-const char* Token::name_[] = {
-  DART_TOKEN_LIST(TOKEN_NAME)
-  DART_KEYWORD_LIST(TOKEN_NAME)
-};
+const char* Token::name_[] = {DART_TOKEN_LIST(TOKEN_NAME)
+                                  DART_KEYWORD_LIST(TOKEN_NAME)};
 #undef TOKEN_NAME
 
 #define TOKEN_STRING(t, s, p, a) s,
-const char* Token::tok_str_[] = {
-  DART_TOKEN_LIST(TOKEN_STRING)
-  DART_KEYWORD_LIST(TOKEN_STRING)
-};
+const char* Token::tok_str_[] = {DART_TOKEN_LIST(TOKEN_STRING)
+                                     DART_KEYWORD_LIST(TOKEN_STRING)};
 #undef TOKEN_STRING
 
 #define TOKEN_PRECEDENCE(t, s, p, a) p,
-const uint8_t Token::precedence_[] = {
-  DART_TOKEN_LIST(TOKEN_PRECEDENCE)
-  DART_KEYWORD_LIST(TOKEN_PRECEDENCE)
-};
+const uint8_t Token::precedence_[] = {DART_TOKEN_LIST(TOKEN_PRECEDENCE)
+                                          DART_KEYWORD_LIST(TOKEN_PRECEDENCE)};
 #undef TOKEN_PRECEDENCE
 
 #define TOKEN_ATTRIBUTE(t, s, p, a) a,
-  const Token::Attribute Token::attributes_[] = {
-    DART_TOKEN_LIST(TOKEN_ATTRIBUTE)
-    DART_KEYWORD_LIST(TOKEN_ATTRIBUTE)
-  };
+const Token::Attribute Token::attributes_[] = {
+    DART_TOKEN_LIST(TOKEN_ATTRIBUTE) DART_KEYWORD_LIST(TOKEN_ATTRIBUTE)};
 #undef TOKEN_ATTRIBUTE
 
 
@@ -77,4 +69,18 @@
   return (token == kBIT_NOT) || (token == kNEGATE);
 }
 
+
+bool Token::IsBinaryBitwiseOperator(Token::Kind token) {
+  switch (token) {
+    case Token::kBIT_OR:
+    case Token::kBIT_XOR:
+    case Token::kBIT_AND:
+    case Token::kSHL:
+    case Token::kSHR:
+      return true;
+    default:
+      return false;
+  }
+}
+
 }  // namespace dart
diff --git a/runtime/vm/token.h b/runtime/vm/token.h
index 6ddf17b..3d2e821 100644
--- a/runtime/vm/token.h
+++ b/runtime/vm/token.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_TOKEN_H_
-#define VM_TOKEN_H_
+#ifndef RUNTIME_VM_TOKEN_H_
+#define RUNTIME_VM_TOKEN_H_
 
 #include "platform/assert.h"
 #include "vm/allocation.h"
@@ -42,12 +42,12 @@
   TOK(kLBRACE, "{", 0, kNoAttribute)                                           \
   TOK(kRBRACE, "}", 0, kNoAttribute)                                           \
   TOK(kARROW, "=>", 0, kNoAttribute)                                           \
-  TOK(kCOLON,  ":", 0, kNoAttribute)                                           \
+  TOK(kCOLON, ":", 0, kNoAttribute)                                            \
   TOK(kSEMICOLON, ";", 0, kNoAttribute)                                        \
   TOK(kPERIOD, ".", 0, kNoAttribute)                                           \
   TOK(kQM_PERIOD, "?.", 0, kNoAttribute)                                       \
-  TOK(kINCR,   "++", 0, kNoAttribute)                                          \
-  TOK(kDECR,   "--", 0, kNoAttribute)                                          \
+  TOK(kINCR, "++", 0, kNoAttribute)                                            \
+  TOK(kDECR, "--", 0, kNoAttribute)                                            \
                                                                                \
   /* Assignment operators.                            */                       \
   /* Please update IsAssignmentOperator() if you make */                       \
@@ -139,7 +139,7 @@
   TOK(kSCRIPTTAG, "#!", 0, kNoAttribute)                                       \
                                                                                \
   /* Support for optimized code */                                             \
-  TOK(kREM, "", 0, kNoAttribute)                                               \
+  TOK(kREM, "", 0, kNoAttribute)
 
 // List of keywords. The list must be alphabetically ordered. The
 // keyword recognition code depends on the ordering.
@@ -199,17 +199,13 @@
 class Token {
  public:
 #define T(t, s, p, a) t,
-  enum Kind {
-    DART_TOKEN_LIST(T)
-    DART_KEYWORD_LIST(T)
-    kNumTokens
-  };
+  enum Kind { DART_TOKEN_LIST(T) DART_KEYWORD_LIST(T) kNumTokens };
 #undef T
 
   enum Attribute {
-    kNoAttribute     = 0,
-    kKeyword         = 1 << 0,
-    kPseudoKeyword   = 1 << 1,
+    kNoAttribute = 0,
+    kKeyword = 1 << 0,
+    kPseudoKeyword = 1 << 1,
   };
 
   static const Kind kFirstKeyword = kABSTRACT;
@@ -236,9 +232,7 @@
     return (tok == kIS) || (tok == kISNOT);
   }
 
-  static bool IsTypeCastOperator(Kind tok) {
-    return tok == kAS;
-  }
+  static bool IsTypeCastOperator(Kind tok) { return tok == kAS; }
 
   static bool IsIndexOperator(Kind tok) {
     return tok == kINDEX || tok == kASSIGN_INDEX;
@@ -248,9 +242,7 @@
     return (Attributes(tok) & kPseudoKeyword) != 0;
   }
 
-  static bool IsKeyword(Kind tok) {
-    return (Attributes(tok) & kKeyword) != 0;
-  }
+  static bool IsKeyword(Kind tok) { return (Attributes(tok) & kKeyword) != 0; }
 
   static bool IsIdentifier(Kind tok) {
     return (tok == kIDENT) || IsPseudoKeyword(tok);
@@ -278,20 +270,16 @@
 
   static bool CanBeOverloaded(Kind tok) {
     ASSERT(tok < kNumTokens);
-    return IsRelationalOperator(tok) ||
-           (tok == kEQ) ||
-           (tok >= kADD && tok <= kMOD) ||  // Arithmetic operations.
+    return IsRelationalOperator(tok) || (tok == kEQ) ||
+           (tok >= kADD && tok <= kMOD) ||     // Arithmetic operations.
            (tok >= kBIT_OR && tok <= kSHR) ||  // Bit operations.
-           (tok == kINDEX) ||
-           (tok == kASSIGN_INDEX);
+           (tok == kINDEX) || (tok == kASSIGN_INDEX);
   }
 
   static bool NeedsLiteralToken(Kind tok) {
     ASSERT(tok < kNumTokens);
-    return ((tok == Token::kINTEGER) ||
-            (tok == Token::kSTRING) ||
-            (tok == Token::kINTERPOL_VAR) ||
-            (tok == Token::kERROR) ||
+    return ((tok == Token::kINTEGER) || (tok == Token::kSTRING) ||
+            (tok == Token::kINTERPOL_VAR) || (tok == Token::kERROR) ||
             (tok == Token::kDOUBLE));
   }
 
@@ -301,20 +289,32 @@
   static bool IsBinaryArithmeticOperator(Token::Kind token);
   static bool IsUnaryArithmeticOperator(Token::Kind token);
 
+  static bool IsBinaryBitwiseOperator(Token::Kind token);
+
   // For a comparison operation return an operation for the negated comparison:
   // !(a (op) b) === a (op') b
   static Token::Kind NegateComparison(Token::Kind op) {
     switch (op) {
-      case Token::kEQ: return Token::kNE;
-      case Token::kNE: return Token::kEQ;
-      case Token::kLT: return Token::kGTE;
-      case Token::kGT: return Token::kLTE;
-      case Token::kLTE: return Token::kGT;
-      case Token::kGTE: return Token::kLT;
-      case Token::kEQ_STRICT: return Token::kNE_STRICT;
-      case Token::kNE_STRICT: return Token::kEQ_STRICT;
-      case Token::kIS:    return Token::kISNOT;
-      case Token::kISNOT: return Token::kIS;
+      case Token::kEQ:
+        return Token::kNE;
+      case Token::kNE:
+        return Token::kEQ;
+      case Token::kLT:
+        return Token::kGTE;
+      case Token::kGT:
+        return Token::kLTE;
+      case Token::kLTE:
+        return Token::kGT;
+      case Token::kGTE:
+        return Token::kLT;
+      case Token::kEQ_STRICT:
+        return Token::kNE_STRICT;
+      case Token::kNE_STRICT:
+        return Token::kEQ_STRICT;
+      case Token::kIS:
+        return Token::kISNOT;
+      case Token::kISNOT:
+        return Token::kIS;
       default:
         UNREACHABLE();
         return Token::kILLEGAL;
@@ -330,4 +330,4 @@
 
 }  // namespace dart
 
-#endif  // VM_TOKEN_H_
+#endif  // RUNTIME_VM_TOKEN_H_
diff --git a/runtime/vm/token_position.cc b/runtime/vm/token_position.cc
index a6490cd..cfda6af 100644
--- a/runtime/vm/token_position.cc
+++ b/runtime/vm/token_position.cc
@@ -31,20 +31,19 @@
 
 
 #define DEFINE_VALUES(name, value)                                             \
-const TokenPosition TokenPosition::k##name = TokenPosition(value);
-  SENTINEL_TOKEN_DESCRIPTORS(DEFINE_VALUES);
+  const TokenPosition TokenPosition::k##name = TokenPosition(value);
+SENTINEL_TOKEN_DESCRIPTORS(DEFINE_VALUES);
 #undef DEFINE_VALUES
-const TokenPosition TokenPosition::kMinSource =
-    TokenPosition(kMinSourcePos);
+const TokenPosition TokenPosition::kMinSource = TokenPosition(kMinSourcePos);
 
-const TokenPosition TokenPosition::kMaxSource =
-    TokenPosition(kMaxSourcePos);
+const TokenPosition TokenPosition::kMaxSource = TokenPosition(kMaxSourcePos);
 
 
 const char* TokenPosition::ToCString() const {
   switch (value_) {
 #define DEFINE_CASE(name, value)                                               \
-    case value: return #name;
+  case value:                                                                  \
+    return #name;
     SENTINEL_TOKEN_DESCRIPTORS(DEFINE_CASE);
 #undef DEFINE_CASE
     default: {
diff --git a/runtime/vm/token_position.h b/runtime/vm/token_position.h
index c964716..b0a2062 100644
--- a/runtime/vm/token_position.h
+++ b/runtime/vm/token_position.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_TOKEN_POSITION_H_
-#define VM_TOKEN_POSITION_H_
+#ifndef RUNTIME_VM_TOKEN_POSITION_H_
+#define RUNTIME_VM_TOKEN_POSITION_H_
 
 #include "platform/utils.h"
 #include "vm/allocation.h"
@@ -29,41 +29,33 @@
 // This organization allows for ~1 billion token positions.
 
 #define SENTINEL_TOKEN_DESCRIPTORS(V)                                          \
-    V(NoSource, -1)                                                            \
-    V(Box, -2)                                                                 \
-    V(ParallelMove, -3)                                                        \
-    V(TempMove, -4)                                                            \
-    V(Constant, -5)                                                            \
-    V(PushArgument, -6)                                                        \
-    V(ControlFlow, -7)                                                         \
-    V(Context, -8)                                                             \
-    V(MethodExtractor, -9)                                                     \
-    V(DeferredSlowPath, -10)                                                   \
-    V(DeferredDeoptInfo, -11)                                                  \
-    V(DartCodePrologue, -12)                                                   \
-    V(DartCodeEpilogue, -13)                                                   \
-    V(Last, -14)   // Always keep this at the end.
+  V(NoSource, -1)                                                              \
+  V(Box, -2)                                                                   \
+  V(ParallelMove, -3)                                                          \
+  V(TempMove, -4)                                                              \
+  V(Constant, -5)                                                              \
+  V(PushArgument, -6)                                                          \
+  V(ControlFlow, -7)                                                           \
+  V(Context, -8)                                                               \
+  V(MethodExtractor, -9)                                                       \
+  V(DeferredSlowPath, -10)                                                     \
+  V(DeferredDeoptInfo, -11)                                                    \
+  V(DartCodePrologue, -12)                                                     \
+  V(DartCodeEpilogue, -13)                                                     \
+  V(Last, -14)  // Always keep this at the end.
 
 // A token position representing a debug safe source (real) position,
 // non-debug safe source (synthetic) positions, or a classifying value used
 // by the profiler.
 class TokenPosition {
  public:
-  TokenPosition()
-      : value_(kNoSource.value()) {
-  }
+  TokenPosition() : value_(kNoSource.value()) {}
 
-  explicit TokenPosition(intptr_t value)
-      : value_(value) {
-  }
+  explicit TokenPosition(intptr_t value) : value_(value) {}
 
-  bool operator==(const TokenPosition& b) const {
-    return value() == b.value();
-  }
+  bool operator==(const TokenPosition& b) const { return value() == b.value(); }
 
-  bool operator!=(const TokenPosition& b) const {
-    return !(*this == b);
-  }
+  bool operator!=(const TokenPosition& b) const { return !(*this == b); }
 
   bool operator<(const TokenPosition& b) const {
     // TODO(johnmccutchan): Assert that this is a source position.
@@ -87,8 +79,7 @@
 
   static const intptr_t kMaxSentinelDescriptors = 64;
 
-#define DECLARE_VALUES(name, value)                                            \
-  static const TokenPosition k##name;
+#define DECLARE_VALUES(name, value) static const TokenPosition k##name;
   SENTINEL_TOKEN_DESCRIPTORS(DECLARE_VALUES);
 #undef DECLARE_VALUES
   static const TokenPosition kMinSource;
@@ -109,9 +100,7 @@
 
   // The raw value.
   // TODO(johnmccutchan): Make this private.
-  intptr_t value() const {
-    return value_;
-  }
+  intptr_t value() const { return value_; }
 
   // Return the source position.
   intptr_t Pos() const {
@@ -134,9 +123,7 @@
   }
 
   // Is |this| the no source position sentinel?
-  bool IsNoSource() const {
-    return *this == kNoSource;
-  }
+  bool IsNoSource() const { return *this == kNoSource; }
 
   // Is |this| a synthetic source position?
   // Synthetic source positions are used by the profiler to attribute ticks to a
@@ -144,9 +131,7 @@
   bool IsSynthetic() const;
 
   // Is |this| a real source position?
-  bool IsReal() const {
-    return value_ >= kMinSourcePos;
-  }
+  bool IsReal() const { return value_ >= kMinSourcePos; }
 
   // Is |this| a source position?
   bool IsSourcePosition() const {
@@ -205,4 +190,4 @@
 
 }  // namespace dart
 
-#endif  // VM_TOKEN_POSITION_H_
+#endif  // RUNTIME_VM_TOKEN_POSITION_H_
diff --git a/runtime/vm/type_table.h b/runtime/vm/type_table.h
index c33a124..6541d20 100644
--- a/runtime/vm/type_table.h
+++ b/runtime/vm/type_table.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_TYPE_TABLE_H_
-#define VM_TYPE_TABLE_H_
+#ifndef RUNTIME_VM_TYPE_TABLE_H_
+#define RUNTIME_VM_TYPE_TABLE_H_
 
 #include "platform/assert.h"
 #include "vm/hash_table.h"
@@ -13,14 +13,9 @@
 
 class CanonicalTypeKey {
  public:
-  explicit CanonicalTypeKey(const Type& key) : key_(key) {
-  }
-  bool Matches(const Type& arg) const {
-    return key_.Equals(arg);
-  }
-  uword Hash() const {
-    return key_.Hash();
-  }
+  explicit CanonicalTypeKey(const Type& key) : key_(key) {}
+  bool Matches(const Type& arg) const { return key_.Equals(arg); }
+  uword Hash() const { return key_.Hash(); }
   const Type& key_;
 
  private:
@@ -49,26 +44,21 @@
     ASSERT(key.IsType());
     return Type::Cast(key).Hash();
   }
-  static uword Hash(const CanonicalTypeKey& key) {
-    return key.Hash();
-  }
+  static uword Hash(const CanonicalTypeKey& key) { return key.Hash(); }
   static RawObject* NewKey(const CanonicalTypeKey& obj) {
     return obj.key_.raw();
   }
 };
-typedef UnorderedHashSet <CanonicalTypeTraits> CanonicalTypeSet;
+typedef UnorderedHashSet<CanonicalTypeTraits> CanonicalTypeSet;
 
 
 class CanonicalTypeArgumentsKey {
  public:
-  explicit CanonicalTypeArgumentsKey(const TypeArguments& key) : key_(key) {
-  }
+  explicit CanonicalTypeArgumentsKey(const TypeArguments& key) : key_(key) {}
   bool Matches(const TypeArguments& arg) const {
     return key_.Equals(arg) && (key_.Hash() == arg.Hash());
   }
-  uword Hash() const {
-    return key_.Hash();
-  }
+  uword Hash() const { return key_.Hash(); }
   const TypeArguments& key_;
 
  private:
@@ -97,9 +87,7 @@
     ASSERT(key.IsTypeArguments());
     return TypeArguments::Cast(key).Hash();
   }
-  static uword Hash(const CanonicalTypeArgumentsKey& key) {
-    return key.Hash();
-  }
+  static uword Hash(const CanonicalTypeArgumentsKey& key) { return key.Hash(); }
   static RawObject* NewKey(const CanonicalTypeArgumentsKey& obj) {
     return obj.key_.raw();
   }
@@ -109,4 +97,4 @@
 
 }  // namespace dart
 
-#endif  // VM_TYPE_TABLE_H_
+#endif  // RUNTIME_VM_TYPE_TABLE_H_
diff --git a/runtime/vm/unibrow-inl.h b/runtime/vm/unibrow-inl.h
index 340d1be..ab6f5d5 100644
--- a/runtime/vm/unibrow-inl.h
+++ b/runtime/vm/unibrow-inl.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_UNIBROW_INL_H_
-#define VM_UNIBROW_INL_H_
+#ifndef RUNTIME_VM_UNIBROW_INL_H_
+#define RUNTIME_VM_UNIBROW_INL_H_
 
 #include "vm/unibrow.h"
 
@@ -11,8 +11,8 @@
 
 namespace unibrow {
 
-template <class T, intptr_t s> intptr_t Mapping<T, s>::get(
-    int32_t c, int32_t n, int32_t* result) {
+template <class T, intptr_t s>
+intptr_t Mapping<T, s>::get(int32_t c, int32_t n, int32_t* result) {
   CacheEntry entry = entries_[c & kMask];
   if (entry.code_point_ == c) {
     if (entry.offset_ == 0) {
@@ -26,8 +26,8 @@
   }
 }
 
-template <class T, intptr_t s> intptr_t Mapping<T, s>::CalculateValue(
-    int32_t c, int32_t n, int32_t* result) {
+template <class T, intptr_t s>
+intptr_t Mapping<T, s>::CalculateValue(int32_t c, int32_t n, int32_t* result) {
   bool allow_caching = true;
   intptr_t length = T::Convert(c, n, result, &allow_caching);
   if (allow_caching) {
@@ -45,4 +45,4 @@
 
 }  // namespace unibrow
 
-#endif  // VM_UNIBROW_INL_H_
+#endif  // RUNTIME_VM_UNIBROW_INL_H_
diff --git a/runtime/vm/unibrow.cc b/runtime/vm/unibrow.cc
index 197db69..e39a6d3 100644
--- a/runtime/vm/unibrow.cc
+++ b/runtime/vm/unibrow.cc
@@ -5,6 +5,8 @@
 // This file was generated at 2014-10-08 15:25:47.940335 (in v8, copied to dart)
 
 #include "vm/unibrow-inl.h"
+#include "vm/unibrow.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -186,7 +188,7 @@
 
 
 // Letter:               point.category in ['Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl']
-
+// clang-format off
 static const uint16_t kLetterTable0Size = 431;
 static const int32_t kLetterTable0[431] = {
     1073741889, 90,         1073741921, 122,
@@ -1821,34 +1823,29 @@
 static const uint16_t kCanonicalizationRangeTable7Size = 4;  // NOLINT
 static const int32_t kCanonicalizationRangeTable7[8] = {
   1073749793, 100, 7994, 0, 1073749825, 100, 8026, 0 };  // NOLINT
+
+// clang-format on
+
 intptr_t CanonicalizationRange::Convert(int32_t c,
-                      int32_t n,
-                      int32_t* result,
-                      bool* allow_caching_ptr) {
+                                        int32_t n,
+                                        int32_t* result,
+                                        bool* allow_caching_ptr) {
   intptr_t chunk_index = c >> 13;
   switch (chunk_index) {
-    case 0: return LookupMapping<false>(kCanonicalizationRangeTable0,
-                                           kCanonicalizationRangeTable0Size,
-                                           kCanonicalizationRangeMultiStrings0,
-                                           c,
-                                           n,
-                                           result,
-                                           allow_caching_ptr);
-    case 1: return LookupMapping<false>(kCanonicalizationRangeTable1,
-                                           kCanonicalizationRangeTable1Size,
-                                           kCanonicalizationRangeMultiStrings1,
-                                           c,
-                                           n,
-                                           result,
-                                           allow_caching_ptr);
-    case 7: return LookupMapping<false>(kCanonicalizationRangeTable7,
-                                           kCanonicalizationRangeTable7Size,
-                                           kCanonicalizationRangeMultiStrings7,
-                                           c,
-                                           n,
-                                           result,
-                                           allow_caching_ptr);
-    default: return 0;
+    case 0:
+      return LookupMapping<false>(
+          kCanonicalizationRangeTable0, kCanonicalizationRangeTable0Size,
+          kCanonicalizationRangeMultiStrings0, c, n, result, allow_caching_ptr);
+    case 1:
+      return LookupMapping<false>(
+          kCanonicalizationRangeTable1, kCanonicalizationRangeTable1Size,
+          kCanonicalizationRangeMultiStrings1, c, n, result, allow_caching_ptr);
+    case 7:
+      return LookupMapping<false>(
+          kCanonicalizationRangeTable7, kCanonicalizationRangeTable7Size,
+          kCanonicalizationRangeMultiStrings7, c, n, result, allow_caching_ptr);
+    default:
+      return 0;
   }
 }
 
diff --git a/runtime/vm/unibrow.h b/runtime/vm/unibrow.h
index 82250d2..565a9a8 100644
--- a/runtime/vm/unibrow.h
+++ b/runtime/vm/unibrow.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_UNIBROW_H_
-#define VM_UNIBROW_H_
+#ifndef RUNTIME_VM_UNIBROW_H_
+#define RUNTIME_VM_UNIBROW_H_
 
 #include <sys/types.h>
 
@@ -23,16 +23,16 @@
 template <class T, intptr_t size = 256>
 class Mapping {
  public:
-  inline Mapping() { }
+  inline Mapping() {}
   inline intptr_t get(int32_t c, int32_t n, int32_t* result);
+
  private:
   friend class Test;
   intptr_t CalculateValue(int32_t c, int32_t n, int32_t* result);
   struct CacheEntry {
-    inline CacheEntry() : code_point_(kNoChar), offset_(0) { }
+    inline CacheEntry() : code_point_(kNoChar), offset_(0) {}
     inline CacheEntry(int32_t code_point, signed offset)
-      : code_point_(code_point),
-        offset_(offset) { }
+        : code_point_(code_point), offset_(offset) {}
     int32_t code_point_;
     signed offset_;
     static const intptr_t kNoChar = (1 << 21) - 1;
@@ -69,4 +69,4 @@
 
 }  // namespace unibrow
 
-#endif  // VM_UNIBROW_H_
+#endif  // RUNTIME_VM_UNIBROW_H_
diff --git a/runtime/vm/unicode.cc b/runtime/vm/unicode.cc
index 8e1649e..f271574 100644
--- a/runtime/vm/unicode.cc
+++ b/runtime/vm/unicode.cc
@@ -10,6 +10,7 @@
 
 namespace dart {
 
+// clang-format off
 const int8_t Utf8::kTrailBytes[256] = {
   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -28,29 +29,17 @@
   3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
   4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 0, 0
 };
+// clang-format on
 
-
-const uint32_t Utf8::kMagicBits[7] = {
-  0,  // Padding.
-  0x00000000,
-  0x00003080,
-  0x000E2080,
-  0x03C82080,
-  0xFA082080,
-  0x82082080
-};
+const uint32_t Utf8::kMagicBits[7] = {0,  // Padding.
+                                      0x00000000, 0x00003080, 0x000E2080,
+                                      0x03C82080, 0xFA082080, 0x82082080};
 
 
 // Minimum values of code points used to check shortest form.
-const uint32_t Utf8::kOverlongMinimum[7] = {
-  0,  // Padding.
-  0x0,
-  0x80,
-  0x800,
-  0x10000,
-  0xFFFFFFFF,
-  0xFFFFFFFF
-};
+const uint32_t Utf8::kOverlongMinimum[7] = {0,  // Padding.
+                                            0x0,     0x80,       0x800,
+                                            0x10000, 0xFFFFFFFF, 0xFFFFFFFF};
 
 
 // Returns the most restricted coding form in which the sequence of utf8
@@ -65,7 +54,7 @@
     uint8_t code_unit = utf8_array[i];
     if (!IsTrailByte(code_unit)) {
       ++len;
-      if (!IsLatin1SequenceStart(code_unit)) {  // > U+00FF
+      if (!IsLatin1SequenceStart(code_unit)) {          // > U+00FF
         if (IsSupplementarySequenceStart(code_unit)) {  // >= U+10000
           char_type = kSupplementary;
           ++len;
@@ -99,10 +88,8 @@
         }
       }
       ch -= kMagicBits[num_trail_bytes];
-      if (!((is_malformed == false) &&
-            (j == num_trail_bytes) &&
-            !Utf::IsOutOfRange(ch) &&
-            !IsNonShortestForm(ch, j))) {
+      if (!((is_malformed == false) && (j == num_trail_bytes) &&
+            !Utf::IsOutOfRange(ch) && !IsNonShortestForm(ch, j))) {
         return false;
       }
     }
@@ -197,10 +184,8 @@
       }
     }
     ch -= kMagicBits[num_trail_bytes];
-    if (!((is_malformed == false) &&
-          (i == num_trail_bytes) &&
-          !Utf::IsOutOfRange(ch) &&
-          !IsNonShortestForm(ch, i))) {
+    if (!((is_malformed == false) && (i == num_trail_bytes) &&
+          !Utf::IsOutOfRange(ch) && !IsNonShortestForm(ch, i))) {
       *dst = -1;
       return 0;
     }
diff --git a/runtime/vm/unicode.h b/runtime/vm/unicode.h
index 7ea10e9..5116863 100644
--- a/runtime/vm/unicode.h
+++ b/runtime/vm/unicode.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_UNICODE_H_
-#define VM_UNICODE_H_
+#ifndef RUNTIME_VM_UNICODE_H_
+#define RUNTIME_VM_UNICODE_H_
 
 #include "vm/allocation.h"
 #include "vm/globals.h"
@@ -38,8 +38,8 @@
 class Utf8 : AllStatic {
  public:
   enum Type {
-    kLatin1 = 0,  // Latin-1 code point [U+0000, U+00FF].
-    kBMP,  // Basic Multilingual Plane code point [U+0000, U+FFFF].
+    kLatin1 = 0,     // Latin-1 code point [U+0000, U+00FF].
+    kBMP,            // Basic Multilingual Plane code point [U+0000, U+FFFF].
     kSupplementary,  // Supplementary code point [U+010000, U+10FFFF].
   };
 
@@ -75,14 +75,12 @@
                             intptr_t array_len,
                             int32_t* dst,
                             intptr_t len);
-  static bool DecodeCStringToUTF32(const char* str,
-                                   int32_t* dst,
-                                   intptr_t len);
+  static bool DecodeCStringToUTF32(const char* str, int32_t* dst, intptr_t len);
 
-  static const int32_t kMaxOneByteChar   = 0x7F;
-  static const int32_t kMaxTwoByteChar   = 0x7FF;
+  static const int32_t kMaxOneByteChar = 0x7F;
+  static const int32_t kMaxTwoByteChar = 0x7FF;
   static const int32_t kMaxThreeByteChar = 0xFFFF;
-  static const int32_t kMaxFourByteChar  = Utf::kMaxCodePoint;
+  static const int32_t kMaxFourByteChar = Utf::kMaxCodePoint;
 
  private:
   static bool IsTrailByte(uint8_t code_unit) {
@@ -117,9 +115,7 @@
   }
 
   // Returns true if ch is a lead or trail surrogate.
-  static bool IsSurrogate(uint32_t ch) {
-    return (ch & 0xFFFFF800) == 0xD800;
-  }
+  static bool IsSurrogate(uint32_t ch) { return (ch & 0xFFFFF800) == 0xD800; }
 
   // Returns true if ch is a lead surrogate.
   static bool IsLeadSurrogate(uint32_t ch) {
@@ -228,4 +224,4 @@
 
 }  // namespace dart
 
-#endif  // VM_UNICODE_H_
+#endif  // RUNTIME_VM_UNICODE_H_
diff --git a/runtime/vm/unicode_data.cc b/runtime/vm/unicode_data.cc
index e61eccb..d8fed1e 100644
--- a/runtime/vm/unicode_data.cc
+++ b/runtime/vm/unicode_data.cc
@@ -6,6 +6,7 @@
 
 namespace dart {
 
+// clang-format off
 const uint8_t CaseMapping::stage1_[261] = {
   0, 1, 2, 3, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6,
   6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 9, 10, 6, 11, 6, 6, 12, 6, 6, 6,
@@ -679,5 +680,6 @@
   { 0, -10783 },  // U+2C6F
   { 0, -35332 },  // U+A77D
 };
+// clang-format on
 
 }  // namespace dart
diff --git a/runtime/vm/unicode_test.cc b/runtime/vm/unicode_test.cc
index 36fdf85..c8f6a26 100644
--- a/runtime/vm/unicode_test.cc
+++ b/runtime/vm/unicode_test.cc
@@ -12,7 +12,7 @@
   // Examples from the Unicode specification, chapter 3
   {
     const char* src = "\x41\xC3\xB1\x42";
-    int32_t expected[] = { 0x41, 0xF1, 0x42 };
+    int32_t expected[] = {0x41, 0xF1, 0x42};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -22,7 +22,7 @@
 
   {
     const char* src = "\x4D";
-    int32_t expected[] = { 0x4D };
+    int32_t expected[] = {0x4D};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -32,7 +32,7 @@
 
   {
     const char* src = "\xD0\xB0";
-    int32_t expected[] = { 0x430 };
+    int32_t expected[] = {0x430};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -42,7 +42,7 @@
 
   {
     const char* src = "\xE4\xBA\x8C";
-    int32_t expected[] = { 0x4E8C };
+    int32_t expected[] = {0x4E8C};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -52,7 +52,7 @@
 
   {
     const char* src = "\xF0\x90\x8C\x82";
-    int32_t expected[] = { 0x10302 };
+    int32_t expected[] = {0x10302};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -62,7 +62,7 @@
 
   {
     const char* src = "\x4D\xD0\xB0\xE4\xBA\x8C\xF0\x90\x8C\x82";
-    int32_t expected[] = { 0x4D, 0x430, 0x4E8C, 0x10302 };
+    int32_t expected[] = {0x4D, 0x430, 0x4E8C, 0x10302};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -72,12 +72,12 @@
 
   // Mixture of non-ASCII and ASCII characters
   {
-    const char* src = "\xD7\x92\xD7\x9C\xD7\xA2\xD7\x93"
-                      "\x20"
-                      "\xD7\x91\xD7\xA8\xD7\x9B\xD7\x94";
-    int32_t expected[] = { 0x5D2, 0x5DC, 0x5E2, 0x5D3,
-                           0x20,
-                           0x5D1, 0x5E8, 0x5DB, 0x5D4 };
+    const char* src =
+        "\xD7\x92\xD7\x9C\xD7\xA2\xD7\x93"
+        "\x20"
+        "\xD7\x91\xD7\xA8\xD7\x9B\xD7\x94";
+    int32_t expected[] = {0x5D2, 0x5DC, 0x5E2, 0x5D3, 0x20,
+                          0x5D1, 0x5E8, 0x5DB, 0x5D4};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -90,7 +90,7 @@
   // 1 - Some correct UTF-8 text
   {
     const char* src = "\xCE\xBA\xE1\xBD\xB9\xCF\x83\xCE\xBC\xCE\xB5";
-    int32_t expected[] = { 0x3BA, 0x1F79, 0x3C3, 0x3BC, 0x3B5 };
+    int32_t expected[] = {0x3BA, 0x1F79, 0x3C3, 0x3BC, 0x3B5};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -105,7 +105,7 @@
   // 2.1.1 - 1 byte (U-00000000):        "\x00"
   {
     const char* src = "\x00";
-    int32_t expected[] = { 0x0 };
+    int32_t expected[] = {0x0};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0xFF, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -116,7 +116,7 @@
   // 2.1.2 - 2 bytes (U-00000080):        "\xC2\x80"
   {
     const char* src = "\xC2\x80";
-    int32_t expected[] = { 0x80 };
+    int32_t expected[] = {0x80};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -127,7 +127,7 @@
   // 2.1.3 - 3 bytes (U-00000800):        "\xE0\xA0\x80"
   {
     const char* src = "\xE0\xA0\x80";
-    int32_t expected[] = { 0x800 };
+    int32_t expected[] = {0x800};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -138,7 +138,7 @@
   // 2.1.4 - 4 bytes (U-00010000):        "\xF0\x90\x80\x80"
   {
     const char* src = "\xF0\x90\x80\x80";
-    int32_t expected[] = { 0x10000 };
+    int32_t expected[] = {0x10000};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -149,7 +149,7 @@
   // 2.1.5 - 5 bytes (U-00200000):        "\xF8\x88\x80\x80\x80"
   {
     const char* src = "\xF8\x88\x80\x80\x80";
-    int32_t expected[] = { 0x200000 };
+    int32_t expected[] = {0x200000};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -160,7 +160,7 @@
   // 2.1.6 - 6 bytes (U-04000000):        "\xFC\x84\x80\x80\x80\x80"
   {
     const char* src = "\xFC\x84\x80\x80\x80\x80";
-    int32_t expected[] = { 0x400000 };
+    int32_t expected[] = {0x400000};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -173,7 +173,7 @@
   // 2.2.1 - 1 byte (U-0000007F):        "\x7F"
   {
     const char* src = "\x7F";
-    int32_t expected[] = { 0x7F };
+    int32_t expected[] = {0x7F};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -184,7 +184,7 @@
   // 2.2.2 - 2 bytes (U-000007FF):        "\xDF\xBF"
   {
     const char* src = "\xDF\xBF";
-    int32_t expected[] = { 0x7FF };
+    int32_t expected[] = {0x7FF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -195,7 +195,7 @@
   // 2.2.3 - 3 bytes (U-0000FFFF):        "\xEF\xBF\xBF"
   {
     const char* src = "\xEF\xBF\xBF";
-    int32_t expected[] = { 0xFFFF };
+    int32_t expected[] = {0xFFFF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -206,7 +206,7 @@
   // 2.2.4 - 4 bytes (U-001FFFFF):        "\xF7\xBF\xBF\xBF"
   {
     const char* src = "\xF7\xBF\xBF\xBF";
-    int32_t expected[] = { 0x1FFFF };
+    int32_t expected[] = {0x1FFFF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -217,7 +217,7 @@
   // 2.2.5 - 5 bytes (U-03FFFFFF):        "\xFB\xBF\xBF\xBF\xBF"
   {
     const char* src = "\xFB\xBF\xBF\xBF\xBF";
-    int32_t expected[] = { 0x3FFFFFF };
+    int32_t expected[] = {0x3FFFFFF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -228,7 +228,7 @@
   // 2.2.6 - 6 bytes (U-7FFFFFFF):        "\xFD\xBF\xBF\xBF\xBF\xBF"
   {
     const char* src = "\xFD\xBF\xBF\xBF\xBF\xBF";
-    int32_t expected[] = { 0x7FFFFFF };
+    int32_t expected[] = {0x7FFFFFF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -241,7 +241,7 @@
   // 2.3.1 - U-0000D7FF = ed 9f bf = "\xED\x9F\xBF"
   {
     const char* src = "\xED\x9F\xBF";
-    int32_t expected[] = { 0xD7FF };
+    int32_t expected[] = {0xD7FF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -252,7 +252,7 @@
   // 2.3.2 - U-0000E000 = ee 80 80 = "\xEE\x80\x80"
   {
     const char* src = "\xEE\x80\x80";
-    int32_t expected[] = { 0xE000 };
+    int32_t expected[] = {0xE000};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -263,7 +263,7 @@
   // 2.3.3 - U-0000FFFD = ef bf bd = "\xEF\xBF\xBD"
   {
     const char* src = "\xEF\xBF\xBD";
-    int32_t expected[] = { 0xFFFD };
+    int32_t expected[] = {0xFFFD};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -274,7 +274,7 @@
   // 2.3.4 - U-0010FFFF = f4 8f bf bf = "\xF4\x8F\xBF\xBF"
   {
     const char* src = "\xF4\x8F\xBF\xBF";
-    int32_t expected[] = { 0x10FFFF };
+    int32_t expected[] = {0x10FFFF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -285,7 +285,7 @@
   // 2.3.5 - U-00110000 = f4 90 80 80 = "\xF4\x90\x80\x80"
   {
     const char* src = "\xF4\x90\x80\x80";
-    int32_t expected[] = { 0x110000 };
+    int32_t expected[] = {0x110000};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -300,7 +300,7 @@
   // 3.1.1 - First continuation byte 0x80: "\x80"
   {
     const char* src = "\x80";
-    int32_t expected[] = { 0x80 };
+    int32_t expected[] = {0x80};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -311,7 +311,7 @@
   // 3.1.2 - Last continuation byte 0xbf: "\xBF"
   {
     const char* src = "\xBF";
-    int32_t expected[] = { 0xBF };
+    int32_t expected[] = {0xBF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -322,7 +322,7 @@
   // 3.1.3 - 2 continuation bytes: "\x80\xBF"
   {
     const char* src = "\x80\xBF";
-    int32_t expected[] = { 0x80, 0xBF };
+    int32_t expected[] = {0x80, 0xBF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -333,7 +333,7 @@
   // 3.1.4 - 3 continuation bytes: "\x80\xBF\x80"
   {
     const char* src = "\x80\xBF\x80";
-    int32_t expected[] = { 0x80, 0xBF, 0x80 };
+    int32_t expected[] = {0x80, 0xBF, 0x80};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -344,7 +344,7 @@
   // 3.1.5 - 4 continuation bytes: "\x80\xBF\x80\xBF"
   {
     const char* src = "\x80\xBF\x80\xBF";
-    int32_t expected[] = { 0x80, 0xBF, 0x80, 0xBF  };
+    int32_t expected[] = {0x80, 0xBF, 0x80, 0xBF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -355,7 +355,7 @@
   // 3.1.6 - 5 continuation bytes: "\x80\xBF\x80\xBF\x80"
   {
     const char* src = "\x80\xBF\x80\xBF\x80";
-    int32_t expected[] = { 0x80, 0xBF, 0x80, 0xBF, 0x80 };
+    int32_t expected[] = {0x80, 0xBF, 0x80, 0xBF, 0x80};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -366,7 +366,7 @@
   // 3.1.7 - 6 continuation bytes: "\x80\xBF\x80\xBF\x80\xBF"
   {
     const char* src = "\x80\xBF\x80\xBF\x80\xBF";
-    int32_t expected[] = { 0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF };
+    int32_t expected[] = {0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -377,7 +377,7 @@
   // 3.1.8 - 7 continuation bytes: "\x80\xBF\x80\xBF\x80\xBF\x80"
   {
     const char* src = "\x80\xBF\x80\xBF\x80\xBF\x80";
-    int32_t expected[] = { 0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF, 0x80 };
+    int32_t expected[] = {0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF, 0x80};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -387,15 +387,16 @@
 
   // 3.1.9 - Sequence of all 64 possible continuation bytes (0x80-0xbf):
   {
-    const char* src = "\x80\x81\x82\x83\x84\x85\x86\x87"
-                      "\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F"
-                      "\x90\x91\x92\x93\x94\x95\x96\x97"
-                      "\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F"
-                      "\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7"
-                      "\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF"
-                      "\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7"
-                      "\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF";
-    int32_t expected[] = { 0x0 };
+    const char* src =
+        "\x80\x81\x82\x83\x84\x85\x86\x87"
+        "\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F"
+        "\x90\x91\x92\x93\x94\x95\x96\x97"
+        "\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F"
+        "\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7"
+        "\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF"
+        "\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7"
+        "\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF";
+    int32_t expected[] = {0x0};
     int32_t dst[ARRAY_SIZE(expected)];
     for (size_t i = 0; i < strlen(src); ++i) {
       memset(dst, 0xFF, sizeof(dst));
@@ -410,15 +411,16 @@
   // 3.2.1 - All 32 first bytes of 2-byte sequences (0xc0-0xdf), each
   //         followed by a space character:
   {
-    const char* src = "\xC0\x20\xC1\x20\xC2\x20\xC3\x20"
-                      "\xC4\x20\xC5\x20\xC6\x20\xC7\x20"
-                      "\xC8\x20\xC9\x20\xCA\x20\xCB\x20"
-                      "\xCC\x20\xCD\x20\xCE\x20\xCF\x20"
-                      "\xD0\x20\xD1\x20\xD2\x20\xD3\x20"
-                      "\xD4\x20\xD5\x20\xD6\x20\xD7\x20"
-                      "\xD8\x20\xD9\x20\xDA\x20\xDB\x20"
-                      "\xDC\x20\xDD\x20\xDE\x20\xDF\x20";
-    int32_t expected[] = { 0x0 };
+    const char* src =
+        "\xC0\x20\xC1\x20\xC2\x20\xC3\x20"
+        "\xC4\x20\xC5\x20\xC6\x20\xC7\x20"
+        "\xC8\x20\xC9\x20\xCA\x20\xCB\x20"
+        "\xCC\x20\xCD\x20\xCE\x20\xCF\x20"
+        "\xD0\x20\xD1\x20\xD2\x20\xD3\x20"
+        "\xD4\x20\xD5\x20\xD6\x20\xD7\x20"
+        "\xD8\x20\xD9\x20\xDA\x20\xDB\x20"
+        "\xDC\x20\xDD\x20\xDE\x20\xDF\x20";
+    int32_t expected[] = {0x0};
     int32_t dst[ARRAY_SIZE(expected)];
     for (size_t i = 0; i < strlen(src); i += 2) {
       memset(dst, 0xFF, sizeof(dst));
@@ -431,11 +433,12 @@
   // 3.2.2 - All 16 first bytes of 3-byte sequences (0xe0-0xef), each
   //         followed by a space character:
   {
-    const char* src = "\xE0\x20\xE1\x20\xE2\x20\xE3\x20"
-                      "\xE4\x20\xE5\x20\xE6\x20\xE7\x20"
-                      "\xE8\x20\xE9\x20\xEA\x20\xEB\x20"
-                      "\xEC\x20\xED\x20\xEE\x20\xEF\x20";
-    int32_t expected[] = { 0x0 };
+    const char* src =
+        "\xE0\x20\xE1\x20\xE2\x20\xE3\x20"
+        "\xE4\x20\xE5\x20\xE6\x20\xE7\x20"
+        "\xE8\x20\xE9\x20\xEA\x20\xEB\x20"
+        "\xEC\x20\xED\x20\xEE\x20\xEF\x20";
+    int32_t expected[] = {0x0};
     int32_t dst[ARRAY_SIZE(expected)];
     for (size_t i = 0; i < strlen(src); i += 2) {
       memset(dst, 0xFF, sizeof(dst));
@@ -448,9 +451,10 @@
   // 3.2.3 - All 8 first bytes of 4-byte sequences (0xf0-0xf7), each
   //         followed by a space character:
   {
-    const char* src = "\xF0\x20\xF1\x20\xF2\x20\xF3\x20"
-                      "\xF4\x20\xF5\x20\xF6\x20\xF7\x20";
-    int32_t expected[] = { 0x0 };
+    const char* src =
+        "\xF0\x20\xF1\x20\xF2\x20\xF3\x20"
+        "\xF4\x20\xF5\x20\xF6\x20\xF7\x20";
+    int32_t expected[] = {0x0};
     int32_t dst[ARRAY_SIZE(expected)];
     for (size_t i = 0; i < strlen(src); i += 2) {
       memset(dst, 0xFF, sizeof(dst));
@@ -464,7 +468,7 @@
   //         followed by a space character:
   {
     const char* src = "\xF8\x20\xF9\x20\xFA\x20\xFB\x20";
-    int32_t expected[] = { 0x0 };
+    int32_t expected[] = {0x0};
     int32_t dst[ARRAY_SIZE(expected)];
     for (size_t i = 0; i < strlen(src); i += 2) {
       memset(dst, 0xFF, sizeof(dst));
@@ -478,7 +482,7 @@
   //         followed by a space character:
   {
     const char* src = "\xFC\x20\xFD\x20";
-    int32_t expected[] = { 0x0 };
+    int32_t expected[] = {0x0};
     int32_t dst[ARRAY_SIZE(expected)];
     for (size_t i = 0; i < strlen(src); i += 2) {
       memset(dst, 0xFF, sizeof(dst));
@@ -493,7 +497,7 @@
   // 3.3.1 - 2-byte sequence with last byte missing (U+0000): "\xC0"
   {
     const char* src = "\xC0";
-    int32_t expected[] = { 0x0 };
+    int32_t expected[] = {0x0};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0xFF, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -504,7 +508,7 @@
   // 3.3.2 - 3-byte sequence with last byte missing (U+0000): "\xE0\x80"
   {
     const char* src = "\xE0\x80";
-    int32_t expected[] = { 0x0 };
+    int32_t expected[] = {0x0};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0xFF, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -515,7 +519,7 @@
   // 3.3.3 - 4-byte sequence with last byte missing (U+0000): "\xF0\x80\x80"
   {
     const char* src = "\xF0\x80\x80";
-    int32_t expected[] = { 0x0 };
+    int32_t expected[] = {0x0};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0xFF, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -526,7 +530,7 @@
   // 3.3.4 - 5-byte sequence with last byte missing (U+0000): "\xF8\x80\x80\x80"
   {
     const char* src = "\xF8\x80\x80\x80";
-    int32_t expected[] = { 0x0 };
+    int32_t expected[] = {0x0};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0xFF, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -538,7 +542,7 @@
   // "\xFC\x80\x80\x80\x80"
   {
     const char* src = "\xFC\x80\x80\x80\x80";
-    int32_t expected[] = { 0x0 };
+    int32_t expected[] = {0x0};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0xFF, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -549,7 +553,7 @@
   // 3.3.6 - 2-byte sequence with last byte missing (U-000007FF): "\xDF"
   {
     const char* src = "\xDF";
-    int32_t expected[] = { 0x0 };
+    int32_t expected[] = {0x0};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0xFF, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -560,7 +564,7 @@
   // 3.3.7 - 3-byte sequence with last byte missing (U-0000FFFF): "\xEF\xBF"
   {
     const char* src = "\xEF\xBF";
-    int32_t expected[] = { 0x0 };
+    int32_t expected[] = {0x0};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0xFF, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -571,7 +575,7 @@
   // 3.3.8 - 4-byte sequence with last byte missing (U-001FFFFF): "\xF7\xBF\xBF"
   {
     const char* src = "\xF7\xBF\xBF";
-    int32_t expected[] = { 0x0 };
+    int32_t expected[] = {0x0};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0xFF, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -583,7 +587,7 @@
   // "\xFB\xBF\xBF\xBF"
   {
     const char* src = "\xFB\xBF\xBF\xBF";
-    int32_t expected[] = { 0x0 };
+    int32_t expected[] = {0x0};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0xFF, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -595,7 +599,7 @@
   // "\xFD\xBF\xBF\xBF\xBF"
   {
     const char* src = "\xFD\xBF\xBF\xBF\xBF";
-    int32_t expected[] = { 0x0 };
+    int32_t expected[] = {0x0};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0xFF, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -605,18 +609,19 @@
 
   // 3.4 - Concatenation of incomplete sequences
   {
-    const char* src = "\xC0\xE0\x80\xF0\x80\x80"
-                      "\xF8\x80\x80\x80\xFC\x80"
-                      "\x80\x80\x80\xDF\xEF\xBF"
-                      "\xF7\xBF\xBF\xFB\xBF\xBF"
-                      "\xBF\xFD\xBF\xBF\xBF\xBF";
-    int32_t expected[] = { 0x0 };
+    const char* src =
+        "\xC0\xE0\x80\xF0\x80\x80"
+        "\xF8\x80\x80\x80\xFC\x80"
+        "\x80\x80\x80\xDF\xEF\xBF"
+        "\xF7\xBF\xBF\xFB\xBF\xBF"
+        "\xBF\xFD\xBF\xBF\xBF\xBF";
+    int32_t expected[] = {0x0};
     int32_t dst[ARRAY_SIZE(expected)];
     for (size_t i = 0; i < strlen(src); ++i) {
       for (size_t j = 1; j < (strlen(src) - i); ++j) {
         memset(dst, 0xFF, sizeof(dst));
-        bool is_valid = Utf8::DecodeCStringToUTF32(&src[i],
-                                                   dst, ARRAY_SIZE(dst));
+        bool is_valid =
+            Utf8::DecodeCStringToUTF32(&src[i], dst, ARRAY_SIZE(dst));
         EXPECT(!is_valid);
         EXPECT(memcmp(expected, dst, sizeof(expected)));
       }
@@ -628,7 +633,7 @@
   // 3.5.1 - fe = "\xFE"
   {
     const char* src = "\xFE";
-    int32_t expected[] = { 0xFE };
+    int32_t expected[] = {0xFE};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -639,7 +644,7 @@
   // 3.5.2 - ff = "\xFF"
   {
     const char* src = "\xFF";
-    int32_t expected[] = { 0xFF };
+    int32_t expected[] = {0xFF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -650,7 +655,7 @@
   // 3.5.3 - fe fe ff ff = "\xFE\xFE\xFF\xFF"
   {
     const char* src = "\xFE\xFE\xFF\xFF";
-    int32_t expected[] = { 0xFF };
+    int32_t expected[] = {0xFF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -665,7 +670,7 @@
   // 4.1.1 - U+002F = c0 af             = "\xC0\xAF"
   {
     const char* src = "\xC0\xAF";
-    int32_t expected[] = { 0x2F };
+    int32_t expected[] = {0x2F};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -676,7 +681,7 @@
   // 4.1.2 - U+002F = e0 80 af          = "\xE0\x80\xAF"
   {
     const char* src = "\xE0\x80\xAF";
-    int32_t expected[] = { 0x2F };
+    int32_t expected[] = {0x2F};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -687,7 +692,7 @@
   // 4.1.3 - U+002F = f0 80 80 af       = "\xF0\x80\x80\xAF"
   {
     const char* src = "\xF0\x80\x80\xAF";
-    int32_t expected[] = { 0x2F };
+    int32_t expected[] = {0x2F};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -698,7 +703,7 @@
   // 4.1.4 - U+002F = f8 80 80 80 af    = "\xF8\x80\x80\x80\xAF"
   {
     const char* src = "\xF8\x80\x80\x80\xAF";
-    int32_t expected[] = { 0x2F };
+    int32_t expected[] = {0x2F};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -709,7 +714,7 @@
   // 4.1.5 - U+002F = fc 80 80 80 80 af = "\xFC\x80\x80\x80\x80\xAF"
   {
     const char* src = "\xFC\x80\x80\x80\x80\xAF";
-    int32_t expected[] = { 0x2F };
+    int32_t expected[] = {0x2F};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -722,7 +727,7 @@
   // 4.2.1 - U-0000007F = c1 bf             = "\xC1\xBF"
   {
     const char* src = "\xC1\xBF";
-    int32_t expected[] = { 0x7F };
+    int32_t expected[] = {0x7F};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -733,7 +738,7 @@
   // 4.2.2 U+000007FF = e0 9f bf          = "\xE0\x9F\xBF"
   {
     const char* src = "\xE0\x9F\xBF";
-    int32_t expected[] = { 0x7FF };
+    int32_t expected[] = {0x7FF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -744,7 +749,7 @@
   // 4.2.3 - U+0000FFFF = f0 8f bf bf       = "\xF0\x8F\xBF\xBF"
   {
     const char* src = "\xF0\x8F\xBF\xBF";
-    int32_t expected[] = { 0xFFFF };
+    int32_t expected[] = {0xFFFF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -755,7 +760,7 @@
   // 4.2.4  U-001FFFFF = f8 87 bf bf bf    = "\xF8\x87\xBF\xBF\xBF"
   {
     const char* src = "\xF8\x87\xBF\xBF\xBF";
-    int32_t expected[] = { 0x1FFFFF };
+    int32_t expected[] = {0x1FFFFF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -766,7 +771,7 @@
   // 4.2.5  U-03FFFFFF = fc 83 bf bf bf bf = "\xFC\x83\xBF\xBF\xBF\xBF"
   {
     const char* src = "\xFC\x83\xBF\xBF\xBF\xBF";
-    int32_t expected[] = { 0x3FFFFFF };
+    int32_t expected[] = {0x3FFFFFF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -779,7 +784,7 @@
   // 4.3.1 - U+0000 = "\xC0\x80"
   {
     const char* src = "\xC0\x80";
-    int32_t expected[] = { 0x0 };
+    int32_t expected[] = {0x0};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0xFF, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -790,7 +795,7 @@
   // 4.3.2  U+0000 = e0 80 80 = "\xE0\x80\x80"
   {
     const char* src = "\xE0\x80\x80";
-    int32_t expected[] = { 0x0 };
+    int32_t expected[] = {0x0};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0xFF, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -801,7 +806,7 @@
   // 4.3.3  U+0000 = f0 80 80 80 = "\xF0\x80\x80\x80"
   {
     const char* src = "\xF0\x80\x80\x80";
-    int32_t expected[] = { 0x0 };
+    int32_t expected[] = {0x0};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0xFF, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -812,7 +817,7 @@
   // 4.3.4  U+0000 = f8 80 80 80 80 = "\xF8\x80\x80\x80\x80"
   {
     const char* src = "\xF8\x80\x80\x80\x80";
-    int32_t expected[] = { 0x0 };
+    int32_t expected[] = {0x0};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0xFF, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -823,7 +828,7 @@
   // 4.3.5  U+0000 = fc 80 80 80 80 80 = "\xFC\x80\x80\x80\x80\x80"
   {
     const char* src = "\xFC\x80\x80\x80\x80\x80";
-    int32_t expected[] = { 0x0 };
+    int32_t expected[] = {0x0};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0xFF, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -838,7 +843,7 @@
   // 5.1.1 - U+D800 = ed a0 80 = "\xED\xA0\x80"
   {
     const char* src = "\xED\xA0\x80";
-    int32_t expected[] = { 0xD800 };
+    int32_t expected[] = {0xD800};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -849,7 +854,7 @@
   // 5.1.2 - U+DB7F = ed ad bf = "\xED\xAD\xBF"
   {
     const char* src = "\xED\xAD\xBF";
-    int32_t expected[] = { 0xDB7F };
+    int32_t expected[] = {0xDB7F};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -860,7 +865,7 @@
   // 5.1.3 - U+DB80 = ed ae 80 = "\xED\xAE\x80"
   {
     const char* src = "\xED\xAE\x80";
-    int32_t expected[] = { 0xDB80 };
+    int32_t expected[] = {0xDB80};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -871,7 +876,7 @@
   // 5.1.4 - U+DBFF = ed af bf = "\xED\xAF\xBF"
   {
     const char* src = "\xED\xAF\xBF";
-    int32_t expected[] = { 0xDBFF };
+    int32_t expected[] = {0xDBFF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -882,7 +887,7 @@
   // 5.1.5 - U+DC00 = ed b0 80 = "\xED\xB0\x80"
   {
     const char* src = "\xED\xB0\x80";
-    int32_t expected[] = { 0xDC00 };
+    int32_t expected[] = {0xDC00};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -893,7 +898,7 @@
   // 5.1.6 - U+DF80 = ed be 80 = "\xED\xBE\x80"
   {
     const char* src = "\xED\xBE\x80";
-    int32_t expected[] = { 0xDF80 };
+    int32_t expected[] = {0xDF80};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -904,7 +909,7 @@
   // 5.1.7 - U+DFFF = ed bf bf = "\xED\xBF\xBF"
   {
     const char* src = "\xED\xBF\xBF";
-    int32_t expected[] = { 0xDFFF };
+    int32_t expected[] = {0xDFFF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -922,7 +927,7 @@
   // 5.2.1 - U+D800 U+DC00 = ed a0 80 ed b0 80 = "\xED\xA0\x80\xED\xB0\x80"
   {
     const char* src = "\xED\xA0\x80\xED\xB0\x80";
-    int32_t expected[] = { 0xD800, 0xDC00 };
+    int32_t expected[] = {0xD800, 0xDC00};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -933,7 +938,7 @@
   // 5.2.2 - U+D800 U+DFFF = ed a0 80 ed bf bf = "\xED\xA0\x80\xED\xBF\xBF"
   {
     const char* src = "\xED\xA0\x80\xED\xBF\xBF";
-    int32_t expected[] = { 0xD800, 0xDFFF };
+    int32_t expected[] = {0xD800, 0xDFFF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -944,7 +949,7 @@
   // 5.2.3 - U+DB7F U+DC00 = ed a0 80 ed bf bf = "\xED\xAD\xBF\xED\xB0\x80"
   {
     const char* src = "\xED\xAD\xBF\xED\xB0\x80";
-    int32_t expected[] = { 0xDB7F, 0xDC00 };
+    int32_t expected[] = {0xDB7F, 0xDC00};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -955,7 +960,7 @@
   // 5.2.4 - U+DB7F U+DFFF = ed ad bf ed bf bf = "\xED\xAD\xBF\xED\xBF\xBF"
   {
     const char* src = "\xED\xAD\xBF\xED\xBF\xBF";
-    int32_t expected[] = { 0xDB7F, 0xDFFF };
+    int32_t expected[] = {0xDB7F, 0xDFFF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -966,7 +971,7 @@
   // 5.2.5 - U+DB80 U+DC00 = ed ae 80 ed b0 80 = "\xED\xAE\x80\xED\xB0\x80"
   {
     const char* src = "\xED\xAE\x80\xED\xB0\x80";
-    int32_t expected[] = { 0xDB80, 0xDC00 };
+    int32_t expected[] = {0xDB80, 0xDC00};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -977,7 +982,7 @@
   // 5.2.6 - U+DB80 U+DFFF = ed ae 80 ed bf bf = "\xED\xAE\x80\xED\xBF\xBF"
   {
     const char* src = "\xED\xAE\x80\xED\xBF\xBF";
-    int32_t expected[] = { 0xDB80, 0xDFFF };
+    int32_t expected[] = {0xDB80, 0xDFFF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -988,7 +993,7 @@
   // 5.2.7 - U+DBFF U+DC00 = ed af bf ed b0 80 = "\xED\xAF\xBF\xED\xB0\x80"
   {
     const char* src = "\xED\xAF\xBF\xED\xB0\x80";
-    int32_t expected[] = { 0xDBFF, 0xDC00 };
+    int32_t expected[] = {0xDBFF, 0xDC00};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -999,7 +1004,7 @@
   // 5.2.8 - U+DBFF U+DFFF = ed af bf ed bf bf = "\xED\xAF\xBF\xED\xBF\xBF"
   {
     const char* src = "\xED\xAF\xBF\xED\xBF\xBF";
-    int32_t expected[] = { 0xDBFF, 0xDFFF };
+    int32_t expected[] = {0xDBFF, 0xDFFF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -1012,7 +1017,7 @@
   // 5.3.1 - U+FFFE = ef bf be = "\xEF\xBF\xBE"
   {
     const char* src = "\xEF\xBF\xBE";
-    int32_t expected[] = { 0xFFFE };
+    int32_t expected[] = {0xFFFE};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
@@ -1023,7 +1028,7 @@
   // 5.3.2 - U+FFFF = ef bf bf = "\xEF\xBF\xBF"
   {
     const char* src = "\xEF\xBF\xBF";
-    int32_t expected[] = { 0xFFFF };
+    int32_t expected[] = {0xFFFF};
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
diff --git a/runtime/vm/unit_test.cc b/runtime/vm/unit_test.cc
index b507c00..c036981 100644
--- a/runtime/vm/unit_test.cc
+++ b/runtime/vm/unit_test.cc
@@ -54,8 +54,8 @@
 Dart_Isolate TestCase::CreateIsolate(const uint8_t* buffer, const char* name) {
   bin::IsolateData* isolate_data = new bin::IsolateData(name, NULL, NULL);
   char* err;
-  Dart_Isolate isolate = Dart_CreateIsolate(
-      name, NULL, buffer, NULL, isolate_data, &err);
+  Dart_Isolate isolate =
+      Dart_CreateIsolate(name, NULL, buffer, NULL, isolate_data, &err);
   if (isolate == NULL) {
     OS::Print("Creation of isolate failed '%s'\n", err);
     free(err);
@@ -118,8 +118,7 @@
   const char* kIsolateReloadTestLibUri = "test:isolate_reload_helper";
   static const intptr_t kIsolateReloadTestLibUriLen =
       strlen(kIsolateReloadTestLibUri);
-  return (strncmp(url_name,
-                  kIsolateReloadTestLibUri,
+  return (strncmp(url_name, kIsolateReloadTestLibUri,
                   kIsolateReloadTestLibUriLen) == 0);
 }
 
@@ -149,8 +148,7 @@
   Dart_Handle dart_args[kNumArgs];
   dart_args[0] = DartUtils::NewString(uri_chars);
   return Dart_Invoke(DartUtils::BuiltinLib(),
-                     DartUtils::NewString("_filePathFromUri"),
-                     kNumArgs,
+                     DartUtils::NewString("_filePathFromUri"), kNumArgs,
                      dart_args);
 }
 
@@ -170,16 +168,11 @@
   if (tag == Dart_kScriptTag) {
     // Reload request.
     ASSERT(script_reload_key != kUnsetThreadLocalKey);
-    const char* script_source =
-       reinterpret_cast<const char*>(
-           OSThread::GetThreadLocal(script_reload_key));
+    const char* script_source = reinterpret_cast<const char*>(
+        OSThread::GetThreadLocal(script_reload_key));
     ASSERT(script_source != NULL);
     OSThread::SetThreadLocal(script_reload_key, 0);
-    return Dart_LoadScript(url,
-                           Dart_Null(),
-                           NewString(script_source),
-                           0,
-                           0);
+    return Dart_LoadScript(url, Dart_Null(), NewString(script_source), 0, 0);
   }
   if (!Dart_IsLibrary(library)) {
     return Dart_NewApiError("not a library");
@@ -217,20 +210,19 @@
     Dart_Handle source = Dart_NewStringFromCString(lib_source);
     return Dart_LoadLibrary(url, Dart_Null(), source, 0, 0);
   }
-  NOT_IN_PRODUCT(
+#if !defined(PRODUCT)
   if (IsIsolateReloadTestLib(url_chars)) {
     Dart_Handle library =
         Dart_LoadLibrary(url, Dart_Null(), IsolateReloadTestLibSource(), 0, 0);
     DART_CHECK_VALID(library);
     Dart_SetNativeResolver(library, IsolateReloadTestNativeResolver, 0);
     return library;
-  })
+  }
+#endif
   if (is_io_library) {
     ASSERT(tag == Dart_kSourceTag);
-    return Dart_LoadSource(library,
-                           url, Dart_Null(),
-                           Builtin::PartSource(Builtin::kIOLibrary,
-                                               url_chars),
+    return Dart_LoadSource(library, url, Dart_Null(),
+                           Builtin::PartSource(Builtin::kIOLibrary, url_chars),
                            0, 0);
   }
   Dart_Handle resolved_url = url;
@@ -296,8 +288,9 @@
     TransitionNativeToVM transition(Thread::Current());
     success = isolate->ReloadSources(&js,
                                      false,  // force_reload
+                                     NULL, NULL,
                                      true);  // dont_delete_reload_context
-    fprintf(stderr, "RELOAD REPORT:\n%s\n", js.ToCString());
+    OS::PrintErr("RELOAD REPORT:\n%s\n", js.ToCString());
   }
 
   if (success) {
@@ -378,27 +371,22 @@
 
 
 void AssemblerTest::Assemble() {
-  const String& function_name = String::ZoneHandle(
-      Symbols::New(Thread::Current(), name_));
+  const String& function_name =
+      String::ZoneHandle(Symbols::New(Thread::Current(), name_));
 
   // We make a dummy script so that exception objects can be composed for
   // assembler instructions that do runtime calls, in particular on DBC.
   const char* kDummyScript = "assembler_test_dummy_function() {}";
-  const Script& script = Script::Handle(Script::New(
-      function_name,
-      String::Handle(String::New(kDummyScript)),
-      RawScript::kSourceTag));
+  const Script& script = Script::Handle(
+      Script::New(function_name, String::Handle(String::New(kDummyScript)),
+                  RawScript::kSourceTag));
   script.Tokenize(String::Handle());
   const Library& lib = Library::Handle(Library::CoreLibrary());
   const Class& cls = Class::ZoneHandle(
-      Class::New(lib,
-                 function_name,
-                 script,
-                 TokenPosition::kMinSource));
+      Class::New(lib, function_name, script, TokenPosition::kMinSource));
   Function& function = Function::ZoneHandle(
-      Function::New(function_name, RawFunction::kRegularFunction,
-                    true, false, false, false, false, cls,
-                    TokenPosition::kMinSource));
+      Function::New(function_name, RawFunction::kRegularFunction, true, false,
+                    false, false, false, cls, TokenPosition::kMinSource));
   code_ = Code::FinalizeCode(function, assembler_);
   code_.set_owner(function);
   code_.set_exception_handlers(Object::empty_exception_handlers());
@@ -416,22 +404,21 @@
 
 
 CodeGenTest::CodeGenTest(const char* name)
-  : function_(Function::ZoneHandle()),
-    node_sequence_(new SequenceNode(TokenPosition::kMinSource,
-                                    new LocalScope(NULL, 0, 0))),
-    default_parameter_values_(new ZoneGrowableArray<const Instance*> ()) {
+    : function_(Function::ZoneHandle()),
+      node_sequence_(new SequenceNode(TokenPosition::kMinSource,
+                                      new LocalScope(NULL, 0, 0))),
+      default_parameter_values_(new ZoneGrowableArray<const Instance*>()) {
   ASSERT(name != NULL);
-  const String& function_name = String::ZoneHandle(
-      Symbols::New(Thread::Current(), name));
+  const String& function_name =
+      String::ZoneHandle(Symbols::New(Thread::Current(), name));
   // Add function to a class and that class to the class dictionary so that
   // frame walking can be used.
   Library& lib = Library::Handle(Library::CoreLibrary());
-  const Class& cls = Class::ZoneHandle(
-      Class::New(lib, function_name, Script::Handle(),
-                  TokenPosition::kMinSource));
-  function_ = Function::New(
-      function_name, RawFunction::kRegularFunction,
-      true, false, false, false, false, cls, TokenPosition::kMinSource);
+  const Class& cls = Class::ZoneHandle(Class::New(
+      lib, function_name, Script::Handle(), TokenPosition::kMinSource));
+  function_ =
+      Function::New(function_name, RawFunction::kRegularFunction, true, false,
+                    false, false, false, cls, TokenPosition::kMinSource);
   function_.set_result_type(Type::Handle(Type::DynamicType()));
   const Array& functions = Array::Handle(Array::New(1));
   functions.SetAt(0, function_);
@@ -447,8 +434,7 @@
   parsed_function->SetNodeSequence(node_sequence_);
   parsed_function->set_instantiator(NULL);
   parsed_function->set_default_parameter_values(default_parameter_values_);
-  node_sequence_->scope()->AddVariable(
-      parsed_function->current_context_var());
+  node_sequence_->scope()->AddVariable(parsed_function->current_context_var());
   parsed_function->EnsureExpressionTemp();
   node_sequence_->scope()->AddVariable(parsed_function->expression_temp_var());
   parsed_function->AllocateVariables();
@@ -464,8 +450,7 @@
   ASSERT(isolate != NULL);
   const Error& error = Error::Handle(Compiler::Compile(library, script));
   if (!error.IsNull()) {
-    OS::Print("Error compiling test script:\n%s\n",
-    error.ToErrorCString());
+    OS::Print("Error compiling test script:\n%s\n", error.ToErrorCString());
   }
   return error.IsNull();
 }
@@ -475,8 +460,8 @@
   Thread* thread = Thread::Current();
   ASSERT(thread != NULL);
   ASSERT(ClassFinalizer::AllClassesFinalized());
-  const Error& error = Error::Handle(Compiler::CompileFunction(thread,
-                                                               function));
+  const Error& error =
+      Error::Handle(Compiler::CompileFunction(thread, function));
   return error.IsNull();
 }
 
diff --git a/runtime/vm/unit_test.h b/runtime/vm/unit_test.h
index 189515f..c08f36e 100644
--- a/runtime/vm/unit_test.h
+++ b/runtime/vm/unit_test.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_UNIT_TEST_H_
-#define VM_UNIT_TEST_H_
+#ifndef RUNTIME_VM_UNIT_TEST_H_
+#define RUNTIME_VM_UNIT_TEST_H_
 
 #include "include/dart_native_api.h"
 
@@ -34,8 +34,7 @@
 // this macro is transitioned from kThreadInNative to kThreadInVM.
 #define VM_TEST_CASE(name)                                                     \
   static void Dart_TestHelper##name(Thread* thread);                           \
-  UNIT_TEST_CASE(name)                                                         \
-  {                                                                            \
+  UNIT_TEST_CASE(name) {                                                       \
     TestIsolateScope __test_isolate__;                                         \
     Thread* __thread__ = Thread::Current();                                    \
     ASSERT(__thread__->isolate() == __test_isolate__.isolate());               \
@@ -52,8 +51,7 @@
 // execution state of threads using this macro remains kThreadNative.
 #define TEST_CASE(name)                                                        \
   static void Dart_TestHelper##name(Thread* thread);                           \
-  UNIT_TEST_CASE(name)                                                         \
-  {                                                                            \
+  UNIT_TEST_CASE(name) {                                                       \
     TestIsolateScope __test_isolate__;                                         \
     Thread* __thread__ = Thread::Current();                                    \
     ASSERT(__thread__->isolate() == __test_isolate__.isolate());               \
@@ -80,7 +78,7 @@
   static void AssemblerTestRun##name(AssemblerTest* test);                     \
   VM_TEST_CASE(name) {                                                         \
     Assembler __assembler__;                                                   \
-    AssemblerTest test(""#name, &__assembler__);                               \
+    AssemblerTest test("" #name, &__assembler__);                              \
     AssemblerTestGenerate##name(test.assembler());                             \
     test.Assemble();                                                           \
     AssemblerTestRun##name(&test);                                             \
@@ -102,7 +100,7 @@
 #define CODEGEN_TEST_RUN(name, expected)                                       \
   static void CodeGenTestRun##name(const Function& function);                  \
   VM_TEST_CASE(name) {                                                         \
-    CodeGenTest __test__(""#name);                                             \
+    CodeGenTest __test__("" #name);                                            \
     CodeGenTestGenerate##name(&__test__);                                      \
     __test__.Compile();                                                        \
     CodeGenTestRun##name(__test__.function());                                 \
@@ -122,7 +120,7 @@
 #define CODEGEN_TEST_RAW_RUN(name, function)                                   \
   static void CodeGenTestRun##name(const Function& function);                  \
   VM_TEST_CASE(name) {                                                         \
-    CodeGenTest __test__(""#name);                                             \
+    CodeGenTest __test__("" #name);                                            \
     CodeGenTestGenerate##name(&__test__);                                      \
     __test__.Compile();                                                        \
     CodeGenTestRun##name(__test__.function());                                 \
@@ -136,11 +134,11 @@
   static void CodeGenTestRun##name1(const Function& function);                 \
   VM_TEST_CASE(name1) {                                                        \
     /* Generate code for name2 */                                              \
-    CodeGenTest __test2__(""#name2);                                           \
+    CodeGenTest __test2__("" #name2);                                          \
     CodeGenTestGenerate##name2(&__test2__);                                    \
     __test2__.Compile();                                                       \
     /* Generate code for name1, providing function2 */                         \
-    CodeGenTest __test1__(""#name1);                                           \
+    CodeGenTest __test1__("" #name1);                                          \
     CodeGenTestGenerate##name1(__test2__.function(), &__test1__);              \
     __test1__.Compile();                                                       \
     CodeGenTestRun##name1(__test1__.function());                               \
@@ -155,74 +153,76 @@
   }
 
 
-#if defined(TARGET_ARCH_ARM) ||                                                \
-    defined(TARGET_ARCH_MIPS) ||                                               \
+#if defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS) ||                   \
     defined(TARGET_ARCH_ARM64)
-#if defined(HOST_ARCH_ARM) ||                                                  \
-    defined(HOST_ARCH_MIPS) ||                                                 \
+#if defined(HOST_ARCH_ARM) || defined(HOST_ARCH_MIPS) ||                       \
     defined(HOST_ARCH_ARM64)
 // Running on actual ARM or MIPS hardware, execute code natively.
 #define EXECUTE_TEST_CODE_INT32(name, entry) reinterpret_cast<name>(entry)()
 #define EXECUTE_TEST_CODE_INT64(name, entry) reinterpret_cast<name>(entry)()
 #define EXECUTE_TEST_CODE_INT64_LL(name, entry, long_arg0, long_arg1)          \
-    reinterpret_cast<name>(entry)(long_arg0, long_arg1)
+  reinterpret_cast<name>(entry)(long_arg0, long_arg1)
 #define EXECUTE_TEST_CODE_FLOAT(name, entry) reinterpret_cast<name>(entry)()
 #define EXECUTE_TEST_CODE_DOUBLE(name, entry) reinterpret_cast<name>(entry)()
 #define EXECUTE_TEST_CODE_INT32_F(name, entry, float_arg)                      \
-    reinterpret_cast<name>(entry)(float_arg)
+  reinterpret_cast<name>(entry)(float_arg)
 #define EXECUTE_TEST_CODE_INT32_D(name, entry, double_arg)                     \
-    reinterpret_cast<name>(entry)(double_arg)
+  reinterpret_cast<name>(entry)(double_arg)
 #define EXECUTE_TEST_CODE_INTPTR_INTPTR(name, entry, pointer_arg)              \
-    reinterpret_cast<name>(entry)(pointer_arg)
+  reinterpret_cast<name>(entry)(pointer_arg)
+#define EXECUTE_TEST_CODE_INT32_INTPTR(name, entry, pointer_arg)               \
+  reinterpret_cast<name>(entry)(pointer_arg)
 #else
 // Not running on ARM or MIPS hardware, call simulator to execute code.
 #if defined(ARCH_IS_64_BIT)
-// TODO(zra): Supply more macros for 64-bit as tests are added for ARM64.
 #define EXECUTE_TEST_CODE_INT64(name, entry)                                   \
-  static_cast<int64_t>(Simulator::Current()->Call(                             \
-      bit_cast<int64_t, uword>(entry), 0, 0, 0, 0))
+  static_cast<int64_t>(                                                        \
+      Simulator::Current()->Call(bit_cast<int64_t, uword>(entry), 0, 0, 0, 0))
 #define EXECUTE_TEST_CODE_DOUBLE(name, entry)                                  \
   bit_cast<double, int64_t>(Simulator::Current()->Call(                        \
       bit_cast<int64_t, uword>(entry), 0, 0, 0, 0, true))
 #define EXECUTE_TEST_CODE_INTPTR_INTPTR(name, entry, pointer_arg)              \
   static_cast<intptr_t>(Simulator::Current()->Call(                            \
       bit_cast<int64_t, uword>(entry),                                         \
-      bit_cast<int64_t, intptr_t>(pointer_arg),                                \
-      0, 0, 0))
+      bit_cast<int64_t, intptr_t>(pointer_arg), 0, 0, 0))
+#define EXECUTE_TEST_CODE_INT32_INTPTR(name, entry, pointer_arg)               \
+  static_cast<int32_t>(Simulator::Current()->Call(                             \
+      bit_cast<int64_t, uword>(entry),                                         \
+      bit_cast<int64_t, intptr_t>(pointer_arg), 0, 0, 0))
 #else
 #define EXECUTE_TEST_CODE_INT32(name, entry)                                   \
-  static_cast<int32_t>(Simulator::Current()->Call(                             \
-      bit_cast<int32_t, uword>(entry), 0, 0, 0, 0))
+  static_cast<int32_t>(                                                        \
+      Simulator::Current()->Call(bit_cast<int32_t, uword>(entry), 0, 0, 0, 0))
 #define EXECUTE_TEST_CODE_DOUBLE(name, entry)                                  \
   bit_cast<double, int64_t>(Simulator::Current()->Call(                        \
       bit_cast<int32_t, uword>(entry), 0, 0, 0, 0, true))
 #define EXECUTE_TEST_CODE_INTPTR_INTPTR(name, entry, pointer_arg)              \
   static_cast<intptr_t>(Simulator::Current()->Call(                            \
       bit_cast<int32_t, uword>(entry),                                         \
-      bit_cast<int32_t, intptr_t>(pointer_arg),                                \
-      0, 0, 0))
+      bit_cast<int32_t, intptr_t>(pointer_arg), 0, 0, 0))
+#define EXECUTE_TEST_CODE_INT32_INTPTR(name, entry, pointer_arg)               \
+  static_cast<int32_t>(Simulator::Current()->Call(                             \
+      bit_cast<int32_t, uword>(entry),                                         \
+      bit_cast<int32_t, intptr_t>(pointer_arg), 0, 0, 0))
 #endif  // defined(ARCH_IS_64_BIT)
 #define EXECUTE_TEST_CODE_INT64_LL(name, entry, long_arg0, long_arg1)          \
   static_cast<int64_t>(Simulator::Current()->Call(                             \
-      bit_cast<int32_t, uword>(entry),                                         \
-      Utils::Low32Bits(long_arg0),                                             \
-      Utils::High32Bits(long_arg0),                                            \
-      Utils::Low32Bits(long_arg1),                                             \
+      bit_cast<int32_t, uword>(entry), Utils::Low32Bits(long_arg0),            \
+      Utils::High32Bits(long_arg0), Utils::Low32Bits(long_arg1),               \
       Utils::High32Bits(long_arg1)))
 #define EXECUTE_TEST_CODE_FLOAT(name, entry)                                   \
   bit_cast<float, int32_t>(Simulator::Current()->Call(                         \
       bit_cast<int32_t, uword>(entry), 0, 0, 0, 0, true))
 #define EXECUTE_TEST_CODE_INT32_F(name, entry, float_arg)                      \
   static_cast<int32_t>(Simulator::Current()->Call(                             \
-      bit_cast<int32_t, uword>(entry),                                         \
-      bit_cast<int32_t, float>(float_arg),                                     \
-      0, 0, 0, false, true))
+      bit_cast<int32_t, uword>(entry), bit_cast<int32_t, float>(float_arg), 0, \
+      0, 0, false, true))
 #define EXECUTE_TEST_CODE_INT32_D(name, entry, double_arg)                     \
   static_cast<int32_t>(Simulator::Current()->Call(                             \
       bit_cast<int32_t, uword>(entry),                                         \
       Utils::Low32Bits(bit_cast<int64_t, double>(double_arg)),                 \
-      Utils::High32Bits(bit_cast<int64_t, double>(double_arg)),                \
-      0, 0, false, true))
+      Utils::High32Bits(bit_cast<int64_t, double>(double_arg)), 0, 0, false,   \
+      true))
 #endif  // defined(HOST_ARCH_ARM) || defined(HOST_ARCH_MIPS)
 #endif  // defined(TARGET_ARCH_{ARM, ARM64, MIPS})
 
@@ -254,7 +254,7 @@
 class TestCaseBase {
  public:
   explicit TestCaseBase(const char* name);
-  virtual ~TestCaseBase() { }
+  virtual ~TestCaseBase() {}
 
   const char* name() const { return name_; }
 
@@ -278,9 +278,9 @@
 
 class TestCase : TestCaseBase {
  public:
-  typedef void (RunEntry)();
+  typedef void(RunEntry)();
 
-  TestCase(RunEntry* run, const char* name) : TestCaseBase(name), run_(run) { }
+  TestCase(RunEntry* run, const char* name) : TestCaseBase(name), run_(run) {}
 
   static Dart_Handle LoadTestScript(const char* script,
                                     Dart_NativeEntryResolver resolver,
@@ -290,8 +290,8 @@
                                         Dart_NativeEntryResolver resolver);
   static Dart_Handle lib();
   static const char* url() { return USER_TEST_URI; }
-  static Dart_Isolate CreateTestIsolateFromSnapshot(
-      uint8_t* buffer, const char* name = NULL) {
+  static Dart_Isolate CreateTestIsolateFromSnapshot(uint8_t* buffer,
+                                                    const char* name = NULL) {
     return CreateIsolate(buffer, name);
   }
   static Dart_Isolate CreateTestIsolate(const char* name = NULL) {
@@ -345,22 +345,26 @@
 };
 
 
-template<typename T> struct is_void {
+template <typename T>
+struct is_void {
   static const bool value = false;
 };
 
 
-template<> struct is_void<void> {
+template <>
+struct is_void<void> {
   static const bool value = true;
 };
 
 
-template<typename T> struct is_double {
+template <typename T>
+struct is_double {
   static const bool value = false;
 };
 
 
-template<> struct is_double<double> {
+template <>
+struct is_double<double> {
   static const bool value = true;
 };
 
@@ -368,13 +372,11 @@
 class AssemblerTest {
  public:
   AssemblerTest(const char* name, Assembler* assembler)
-      : name_(name),
-        assembler_(assembler),
-        code_(Code::ZoneHandle()) {
+      : name_(name), assembler_(assembler), code_(Code::ZoneHandle()) {
     ASSERT(name != NULL);
     ASSERT(assembler != NULL);
   }
-  ~AssemblerTest() { }
+  ~AssemblerTest() {}
 
   Assembler* assembler() const { return assembler_; }
 
@@ -383,10 +385,10 @@
   uword payload_start() const { return code_.PayloadStart(); }
   uword entry() const { return code_.UncheckedEntryPoint(); }
 
-  // Invoke/InvokeWithCodeAndThread is used to call assembler test functions
-  // using the ABI calling convention.
-  // ResultType is the return type of the assembler test function.
-  // ArgNType is the type of the Nth argument.
+// Invoke/InvokeWithCodeAndThread is used to call assembler test functions
+// using the ABI calling convention.
+// ResultType is the return type of the assembler test function.
+// ArgNType is the type of the Nth argument.
 #if defined(USING_SIMULATOR) && !defined(TARGET_ARCH_DBC)
 
 #if defined(ARCH_IS_64_BIT)
@@ -396,18 +398,17 @@
   // on 32-bit platforms when returning an int32_t. Since template functions
   // don't support partial specialization, we'd need to introduce a helper
   // class to support 32-bit return types.
-  template<typename ResultType> ResultType InvokeWithCodeAndThread() {
+  template <typename ResultType>
+  ResultType InvokeWithCodeAndThread() {
     const bool fp_return = is_double<ResultType>::value;
     const bool fp_args = false;
     Thread* thread = Thread::Current();
     ASSERT(thread != NULL);
     return bit_cast<ResultType, int64_t>(Simulator::Current()->Call(
-        bit_cast<intptr_t, uword>(entry()),
-        reinterpret_cast<intptr_t>(&code_),
-        reinterpret_cast<intptr_t>(thread),
-        0, 0, fp_return, fp_args));
+        bit_cast<intptr_t, uword>(entry()), reinterpret_cast<intptr_t>(&code_),
+        reinterpret_cast<intptr_t>(thread), 0, 0, fp_return, fp_args));
   }
-  template<typename ResultType, typename Arg1Type>
+  template <typename ResultType, typename Arg1Type>
   ResultType InvokeWithCodeAndThread(Arg1Type arg1) {
     const bool fp_return = is_double<ResultType>::value;
     const bool fp_args = is_double<Arg1Type>::value;
@@ -416,18 +417,16 @@
     Thread* thread = Thread::Current();
     ASSERT(thread != NULL);
     return bit_cast<ResultType, int64_t>(Simulator::Current()->Call(
-        bit_cast<intptr_t, uword>(entry()),
-        reinterpret_cast<intptr_t>(&code_),
-        reinterpret_cast<intptr_t>(thread),
-        reinterpret_cast<intptr_t>(arg1),
-        0, fp_return, fp_args));
+        bit_cast<intptr_t, uword>(entry()), reinterpret_cast<intptr_t>(&code_),
+        reinterpret_cast<intptr_t>(thread), reinterpret_cast<intptr_t>(arg1), 0,
+        fp_return, fp_args));
   }
 #endif  // ARCH_IS_64_BIT
 
-  template<typename ResultType,
-           typename Arg1Type,
-           typename Arg2Type,
-           typename Arg3Type>
+  template <typename ResultType,
+            typename Arg1Type,
+            typename Arg2Type,
+            typename Arg3Type>
   ResultType Invoke(Arg1Type arg1, Arg2Type arg2, Arg3Type arg3) {
     // TODO(fschneider): Support double arguments for simulator calls.
     COMPILE_ASSERT(is_void<ResultType>::value);
@@ -437,17 +436,15 @@
     const bool fp_args = false;
     const bool fp_return = false;
     Simulator::Current()->Call(
-        bit_cast<intptr_t, uword>(entry()),
-        reinterpret_cast<intptr_t>(arg1),
-        reinterpret_cast<intptr_t>(arg2),
-        reinterpret_cast<intptr_t>(arg3),
-        0, fp_return, fp_args);
+        bit_cast<intptr_t, uword>(entry()), reinterpret_cast<intptr_t>(arg1),
+        reinterpret_cast<intptr_t>(arg2), reinterpret_cast<intptr_t>(arg3), 0,
+        fp_return, fp_args);
   }
 #elif defined(USING_SIMULATOR) && defined(TARGET_ARCH_DBC)
-  template<typename ResultType,
-           typename Arg1Type,
-           typename Arg2Type,
-           typename Arg3Type>
+  template <typename ResultType,
+            typename Arg1Type,
+            typename Arg2Type,
+            typename Arg3Type>
   ResultType Invoke(Arg1Type arg1, Arg2Type arg2, Arg3Type arg3) {
     // TODO(fschneider): Support double arguments for simulator calls.
     COMPILE_ASSERT(is_void<ResultType>::value);
@@ -460,34 +457,32 @@
     const Array& arguments = Array::Handle(Array::New(2));
     arguments.SetAt(0, arg1obj);
     arguments.SetAt(1, arg2obj);
-    Simulator::Current()->Call(
-        code(),
-        argdesc,
-        arguments,
-        reinterpret_cast<Thread*>(arg3));
+    Simulator::Current()->Call(code(), argdesc, arguments,
+                               reinterpret_cast<Thread*>(arg3));
   }
 #else
-  template<typename ResultType> ResultType InvokeWithCodeAndThread() {
+  template <typename ResultType>
+  ResultType InvokeWithCodeAndThread() {
     Thread* thread = Thread::Current();
     ASSERT(thread != NULL);
-    typedef ResultType (*FunctionType) (const Code&, Thread*);
+    typedef ResultType (*FunctionType)(const Code&, Thread*);
     return reinterpret_cast<FunctionType>(entry())(code_, thread);
   }
 
-  template<typename ResultType, typename Arg1Type>
+  template <typename ResultType, typename Arg1Type>
   ResultType InvokeWithCodeAndThread(Arg1Type arg1) {
     Thread* thread = Thread::Current();
     ASSERT(thread != NULL);
-    typedef ResultType (*FunctionType) (const Code&, Thread*, Arg1Type);
+    typedef ResultType (*FunctionType)(const Code&, Thread*, Arg1Type);
     return reinterpret_cast<FunctionType>(entry())(code_, thread, arg1);
   }
 
-  template<typename ResultType,
-           typename Arg1Type,
-           typename Arg2Type,
-           typename Arg3Type>
+  template <typename ResultType,
+            typename Arg1Type,
+            typename Arg2Type,
+            typename Arg3Type>
   ResultType Invoke(Arg1Type arg1, Arg2Type arg2, Arg3Type arg3) {
-    typedef ResultType (*FunctionType) (Arg1Type, Arg2Type, Arg3Type);
+    typedef ResultType (*FunctionType)(Arg1Type, Arg2Type, Arg3Type);
     return reinterpret_cast<FunctionType>(entry())(arg1, arg2, arg3);
   }
 #endif  // defined(USING_SIMULATOR) && !defined(TARGET_ARCH_DBC)
@@ -507,9 +502,9 @@
 class CodeGenTest {
  public:
   explicit CodeGenTest(const char* name);
-  ~CodeGenTest() { }
+  ~CodeGenTest() {}
 
-    // Accessors.
+  // Accessors.
   const Function& function() const { return function_; }
 
   SequenceNode* node_sequence() const { return node_sequence_; }
@@ -545,10 +540,12 @@
   do {                                                                         \
     Dart_Handle tmp_handle = (handle);                                         \
     if (Dart_IsError(tmp_handle)) {                                            \
-      dart::Expect(__FILE__, __LINE__).Fail(                                   \
-          "expected '%s' to be a valid handle but found an error handle:\n"    \
-          "    '%s'\n",                                                        \
-          #handle, Dart_GetError(tmp_handle));                                 \
+      dart::Expect(__FILE__, __LINE__)                                         \
+          .Fail(                                                               \
+              "expected '%s' to be a valid handle but found an error "         \
+              "handle:\n"                                                      \
+              "    '%s'\n",                                                    \
+              #handle, Dart_GetError(tmp_handle));                             \
     }                                                                          \
   } while (0)
 
@@ -556,12 +553,14 @@
   do {                                                                         \
     Dart_Handle tmp_handle = (handle);                                         \
     if (Dart_IsError(tmp_handle)) {                                            \
-      dart::Expect(__FILE__, __LINE__).IsSubstring((substring),                \
-                                                   Dart_GetError(tmp_handle)); \
+      dart::Expect(__FILE__, __LINE__)                                         \
+          .IsSubstring((substring), Dart_GetError(tmp_handle));                \
     } else {                                                                   \
-      dart::Expect(__FILE__, __LINE__).Fail(                                   \
-          "expected '%s' to be an error handle but found a valid handle.\n",   \
-          #handle);                                                            \
+      dart::Expect(__FILE__, __LINE__)                                         \
+          .Fail(                                                               \
+              "expected '%s' to be an error handle but found a valid "         \
+              "handle.\n",                                                     \
+              #handle);                                                        \
     }                                                                          \
   } while (0)
 
@@ -572,12 +571,12 @@
       bool value;                                                              \
       Dart_BooleanValue(tmp_handle, &value);                                   \
       if (!value) {                                                            \
-        dart::Expect(__FILE__, __LINE__).Fail("expected True, but was '%s'\n", \
-            #handle);                                                          \
+        dart::Expect(__FILE__, __LINE__)                                       \
+            .Fail("expected True, but was '%s'\n", #handle);                   \
       }                                                                        \
     } else {                                                                   \
-      dart::Expect(__FILE__, __LINE__).Fail("expected True, but was '%s'\n",   \
-          #handle);                                                            \
+      dart::Expect(__FILE__, __LINE__)                                         \
+          .Fail("expected True, but was '%s'\n", #handle);                     \
     }                                                                          \
   } while (0)
 
@@ -599,18 +598,14 @@
 void ElideJSONSubstring(const char* prefix, const char* in, char* out);
 
 
-template<typename T>
+template <typename T>
 class SetFlagScope : public ValueObject {
  public:
-  SetFlagScope(T* flag, T value)
-      : flag_(flag),
-        original_value_(*flag) {
+  SetFlagScope(T* flag, T value) : flag_(flag), original_value_(*flag) {
     *flag_ = value;
   }
 
-  ~SetFlagScope() {
-    *flag_ = original_value_;
-  }
+  ~SetFlagScope() { *flag_ = original_value_; }
 
  private:
   T* flag_;
@@ -619,4 +614,4 @@
 
 }  // namespace dart
 
-#endif  // VM_UNIT_TEST_H_
+#endif  // RUNTIME_VM_UNIT_TEST_H_
diff --git a/runtime/vm/uri.cc b/runtime/vm/uri.cc
index 7d9ef76..6b8c9c4 100644
--- a/runtime/vm/uri.cc
+++ b/runtime/vm/uri.cc
@@ -9,23 +9,32 @@
 namespace dart {
 
 static bool IsUnreservedChar(intptr_t value) {
-  return ((value >= 'a' && value <= 'z') ||
-          (value >= 'A' && value <= 'Z') ||
-          (value >= '0' && value <= '9') ||
-          value == '-' ||
-          value == '.' ||
-          value == '_' ||
-          value == '~');
+  return ((value >= 'a' && value <= 'z') || (value >= 'A' && value <= 'Z') ||
+          (value >= '0' && value <= '9') || value == '-' || value == '.' ||
+          value == '_' || value == '~');
 }
 
 
 static bool IsDelimiter(intptr_t value) {
   switch (value) {
-    case ':': case '/': case '?': case '#':
-    case '[': case ']': case '@': case '!':
-    case '$': case '&': case '\'': case '(':
-    case ')': case '*': case '+': case ',':
-    case ';': case '=':
+    case ':':
+    case '/':
+    case '?':
+    case '#':
+    case '[':
+    case ']':
+    case '@':
+    case '!':
+    case '$':
+    case '&':
+    case '\'':
+    case '(':
+    case ')':
+    case '*':
+    case '+':
+    case ',':
+    case ';':
+    case '=':
       return true;
     default:
       return false;
@@ -34,8 +43,7 @@
 
 
 static bool IsHexDigit(char value) {
-  return ((value >= '0' && value <= '9') ||
-          (value >= 'A' && value <= 'F') ||
+  return ((value >= '0' && value <= '9') || (value >= 'A' && value <= 'F') ||
           (value >= 'a' && value <= 'f'));
 }
 
@@ -224,8 +232,7 @@
   if (*question_pos == '?') {
     // There is a query part.
     const char* query_start = question_pos + 1;
-    parsed_uri->query =
-        NormalizeEscapes(query_start, (hash_pos - query_start));
+    parsed_uri->query = NormalizeEscapes(query_start, (hash_pos - query_start));
   } else {
     parsed_uri->query = NULL;
   }
@@ -235,8 +242,7 @@
     // There is an authority part.
     const char* authority_start = rest + 2;  // 2 for '//'.
 
-    intptr_t authority_len =
-        ParseAuthority(authority_start, parsed_uri);
+    intptr_t authority_len = ParseAuthority(authority_start, parsed_uri);
     if (authority_len < 0) {
       ClearParsedUri(parsed_uri);
       return false;
@@ -367,7 +373,7 @@
   intptr_t truncated_base_len = last_slash - base_path;
   intptr_t ref_path_len = strlen(ref_path);
   intptr_t len = truncated_base_len + ref_path_len + 1;  // +1 for '/'
-  char* buffer = zone->Alloc<char>(len + 1);  // +1 for '\0'
+  char* buffer = zone->Alloc<char>(len + 1);             // +1 for '\0'
 
   // Copy truncated base.
   strncpy(buffer, base_path, truncated_base_len);
@@ -399,17 +405,16 @@
   // relative urls inside a "dart:" library.
   if (uri.scheme == NULL) {
     ASSERT(uri.userinfo == NULL && uri.host == NULL && uri.port == NULL);
-    return zone->PrintToString("%s%s%s%s%s",
-                               uri.path, query_separator, query,
+    return zone->PrintToString("%s%s%s%s%s", uri.path, query_separator, query,
                                fragment_separator, fragment);
   }
 
   // Uri with no authority: "scheme:path[?query][#fragment]"
   if (uri.host == NULL) {
     ASSERT(uri.userinfo == NULL && uri.port == NULL);
-    return zone->PrintToString("%s:%s%s%s%s%s",
-                               uri.scheme, uri.path, query_separator, query,
-                               fragment_separator, fragment);
+    return zone->PrintToString("%s:%s%s%s%s%s", uri.scheme, uri.path,
+                               query_separator, query, fragment_separator,
+                               fragment);
   }
 
   const char* user = uri.userinfo == NULL ? "" : uri.userinfo;
@@ -419,16 +424,16 @@
 
   // If the path doesn't start with a '/', add one.  We need it to
   // separate the path from the authority.
-  const char* path_separator = ((uri.path[0] == '\0' || uri.path[0] == '/')
-                                ? "" : "/");
+  const char* path_separator =
+      ((uri.path[0] == '\0' || uri.path[0] == '/') ? "" : "/");
 
   // Uri with authority:
   //   "scheme://[userinfo@]host[:port][/]path[?query][#fragment]"
   return zone->PrintToString(
       "%s://%s%s%s%s%s%s%s%s%s%s%s",  // There is *nothing* wrong with this.
       uri.scheme, user, user_separator, uri.host, port_separator, port,
-      path_separator, uri.path, query_separator, query,
-      fragment_separator, fragment);
+      path_separator, uri.path, query_separator, query, fragment_separator,
+      fragment);
 }
 
 
diff --git a/runtime/vm/uri.h b/runtime/vm/uri.h
index 453b371..3dfdda0 100644
--- a/runtime/vm/uri.h
+++ b/runtime/vm/uri.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_URI_H_
-#define VM_URI_H_
+#ifndef RUNTIME_VM_URI_H_
+#define RUNTIME_VM_URI_H_
 
 #include "platform/utils.h"
 #include "vm/globals.h"
@@ -30,4 +30,4 @@
 
 }  // namespace dart
 
-#endif  // VM_URI_H_
+#endif  // RUNTIME_VM_URI_H_
diff --git a/runtime/vm/uri_test.cc b/runtime/vm/uri_test.cc
index 34631a5..14f26fb 100644
--- a/runtime/vm/uri_test.cc
+++ b/runtime/vm/uri_test.cc
@@ -48,8 +48,8 @@
 
 TEST_CASE(ParseUri_WithScheme_WithQueryWithFragment) {
   ParsedUri uri;
-  EXPECT(ParseUri("foo://example.com:8042/over/there?name=ferret#fragment",
-                  &uri));
+  EXPECT(
+      ParseUri("foo://example.com:8042/over/there?name=ferret#fragment", &uri));
   EXPECT_STREQ("foo", uri.scheme);
   EXPECT(uri.userinfo == NULL);
   EXPECT_STREQ("example.com", uri.host);
@@ -244,8 +244,8 @@
 
 TEST_CASE(ParseUri_NormalizeEscapes_PathQueryFragment) {
   ParsedUri uri;
-  EXPECT(ParseUri(
-      "scheme:/This%09Is A P%61th?This%09Is A Qu%65ry#A Fr%61gment", &uri));
+  EXPECT(ParseUri("scheme:/This%09Is A P%61th?This%09Is A Qu%65ry#A Fr%61gment",
+                  &uri));
   EXPECT_STREQ("scheme", uri.scheme);
   EXPECT(uri.userinfo == NULL);
   EXPECT(uri.host == NULL);
@@ -258,8 +258,7 @@
 
 TEST_CASE(ParseUri_NormalizeEscapes_UppercaseEscapesPreferred) {
   ParsedUri uri;
-  EXPECT(ParseUri(
-      "scheme:/%1b%1B", &uri));
+  EXPECT(ParseUri("scheme:/%1b%1B", &uri));
   EXPECT_STREQ("scheme", uri.scheme);
   EXPECT(uri.userinfo == NULL);
   EXPECT(uri.host == NULL);
@@ -272,8 +271,7 @@
 
 TEST_CASE(ParseUri_NormalizeEscapes_Authority) {
   ParsedUri uri;
-  EXPECT(ParseUri(
-      "scheme://UsEr N%61%4de@h%4FsT.c%6fm:80/", &uri));
+  EXPECT(ParseUri("scheme://UsEr N%61%4de@h%4FsT.c%6fm:80/", &uri));
   EXPECT_STREQ("scheme", uri.scheme);
   EXPECT_STREQ("UsEr%20NaMe", uri.userinfo);  // Normalized, case preserved.
   EXPECT_STREQ("host.com", uri.host);         // Normalized, lower-cased.
@@ -299,8 +297,7 @@
 
 TEST_CASE(ParseUri_BrokenEscapeSequence) {
   ParsedUri uri;
-  EXPECT(ParseUri(
-      "scheme:/%1g", &uri));
+  EXPECT(ParseUri("scheme:/%1g", &uri));
   EXPECT_STREQ("scheme", uri.scheme);
   EXPECT(uri.userinfo == NULL);
   EXPECT(uri.host == NULL);
@@ -340,8 +337,7 @@
 
 TEST_CASE(ResolveUri_NoSchemeNoAuthority_AbsolutePath) {
   const char* target_uri;
-  EXPECT(ResolveUri("/ref/path",
-                    "bscheme://buser@bhost:11/base/path?baseQuery",
+  EXPECT(ResolveUri("/ref/path", "bscheme://buser@bhost:11/base/path?baseQuery",
                     &target_uri));
   EXPECT_STREQ("bscheme://buser@bhost:11/ref/path", target_uri);
 }
@@ -349,8 +345,7 @@
 
 TEST_CASE(ResolveUri_NoSchemeNoAuthority_RelativePath) {
   const char* target_uri;
-  EXPECT(ResolveUri("ref/path",
-                    "bscheme://buser@bhost:11/base/path?baseQuery",
+  EXPECT(ResolveUri("ref/path", "bscheme://buser@bhost:11/base/path?baseQuery",
                     &target_uri));
   EXPECT_STREQ("bscheme://buser@bhost:11/base/ref/path", target_uri);
 }
@@ -358,18 +353,14 @@
 
 TEST_CASE(ResolveUri_NoSchemeNoAuthority_RelativePathEmptyBasePath) {
   const char* target_uri;
-  EXPECT(ResolveUri("ref/path",
-                    "bscheme://buser@bhost:11",
-                    &target_uri));
+  EXPECT(ResolveUri("ref/path", "bscheme://buser@bhost:11", &target_uri));
   EXPECT_STREQ("bscheme://buser@bhost:11/ref/path", target_uri);
 }
 
 
 TEST_CASE(ResolveUri_NoSchemeNoAuthority_RelativePathWeirdBasePath) {
   const char* target_uri;
-  EXPECT(ResolveUri("ref/path",
-                    "bscheme:base",
-                    &target_uri));
+  EXPECT(ResolveUri("ref/path", "bscheme:base", &target_uri));
   EXPECT_STREQ("bscheme:ref/path", target_uri);
 }
 
@@ -405,36 +396,28 @@
 
 TEST_CASE(ResolveUri_RemoveDots_RemoveOneDotSegment) {
   const char* target_uri;
-  EXPECT(ResolveUri("./refpath",
-                    "scheme://auth/a/b/c/d",
-                    &target_uri));
+  EXPECT(ResolveUri("./refpath", "scheme://auth/a/b/c/d", &target_uri));
   EXPECT_STREQ("scheme://auth/a/b/c/refpath", target_uri);
 }
 
 
 TEST_CASE(ResolveUri_RemoveDots_RemoveTwoDotSegments) {
   const char* target_uri;
-  EXPECT(ResolveUri("././refpath",
-                    "scheme://auth/a/b/c/d",
-                    &target_uri));
+  EXPECT(ResolveUri("././refpath", "scheme://auth/a/b/c/d", &target_uri));
   EXPECT_STREQ("scheme://auth/a/b/c/refpath", target_uri);
 }
 
 
 TEST_CASE(ResolveUri_RemoveDots_RemoveOneDotDotSegment) {
   const char* target_uri;
-  EXPECT(ResolveUri("../refpath",
-                    "scheme://auth/a/b/c/d",
-                    &target_uri));
+  EXPECT(ResolveUri("../refpath", "scheme://auth/a/b/c/d", &target_uri));
   EXPECT_STREQ("scheme://auth/a/b/refpath", target_uri);
 }
 
 
 TEST_CASE(ResolveUri_RemoveDots_RemoveTwoDotDotSegments) {
   const char* target_uri;
-  EXPECT(ResolveUri("../../refpath",
-                    "scheme://auth/a/b/c/d",
-                    &target_uri));
+  EXPECT(ResolveUri("../../refpath", "scheme://auth/a/b/c/d", &target_uri));
   EXPECT_STREQ("scheme://auth/a/refpath", target_uri);
 }
 
@@ -442,47 +425,36 @@
 TEST_CASE(ResolveUri_RemoveDots_RemoveTooManyDotDotSegments) {
   const char* target_uri;
   EXPECT(ResolveUri("../../../../../../../../../refpath",
-                    "scheme://auth/a/b/c/d",
-                    &target_uri));
+                    "scheme://auth/a/b/c/d", &target_uri));
   EXPECT_STREQ("scheme://auth/refpath", target_uri);
 }
 
 
 TEST_CASE(ResolveUri_RemoveDots_RemoveDotSegmentsNothingLeft1) {
   const char* target_uri;
-  EXPECT(ResolveUri("../../../../..",
-                    "scheme://auth/a/b/c/d",
-                    &target_uri));
+  EXPECT(ResolveUri("../../../../..", "scheme://auth/a/b/c/d", &target_uri));
   EXPECT_STREQ("scheme://auth/", target_uri);
 }
 
 
-
 TEST_CASE(ResolveUri_RemoveDots_RemoveDotSegmentsNothingLeft2) {
   const char* target_uri;
-  EXPECT(ResolveUri(".",
-                    "scheme://auth/",
-                    &target_uri));
+  EXPECT(ResolveUri(".", "scheme://auth/", &target_uri));
   EXPECT_STREQ("scheme://auth/", target_uri);
 }
 
 
-
 TEST_CASE(ResolveUri_RemoveDots_RemoveDotSegmentsInitialPrefix) {
   const char* target_uri;
-  EXPECT(ResolveUri("../../../../refpath",
-                    "scheme://auth",
-                    &target_uri));
+  EXPECT(ResolveUri("../../../../refpath", "scheme://auth", &target_uri));
   EXPECT_STREQ("scheme://auth/refpath", target_uri);
 }
 
 
-
 TEST_CASE(ResolveUri_RemoveDots_RemoveDotSegmentsMixed) {
   const char* target_uri;
   EXPECT(ResolveUri("../../1/./2/../3/4/../5/././6/../7",
-                    "scheme://auth/a/b/c/d/e",
-                    &target_uri));
+                    "scheme://auth/a/b/c/d/e", &target_uri));
   EXPECT_STREQ("scheme://auth/a/b/1/3/5/7", target_uri);
 }
 
@@ -500,19 +472,15 @@
 
 TEST_CASE(ResolveUri_NormalizeEscapes_UppercaseHexPreferred) {
   const char* target_uri;
-  EXPECT(ResolveUri("",
-                    "scheme:/%1b%1B",
-                    &target_uri));
-  EXPECT_STREQ("scheme:/%1B%1B",
-               target_uri);
+  EXPECT(ResolveUri("", "scheme:/%1b%1B", &target_uri));
+  EXPECT_STREQ("scheme:/%1B%1B", target_uri);
 }
 
 
 TEST_CASE(ResolveUri_NormalizeEscapes_Authority) {
   const char* target_uri;
-  EXPECT(ResolveUri("",
-                    "scheme://UsEr N%61%4de@h%4FsT.c%6fm:80/",
-                    &target_uri));
+  EXPECT(
+      ResolveUri("", "scheme://UsEr N%61%4de@h%4FsT.c%6fm:80/", &target_uri));
   // userinfo is normalized and case is preserved.  host is normalized
   // and lower-cased.
   EXPECT_STREQ("scheme://UsEr%20NaMe@host.com:80/", target_uri);
@@ -521,18 +489,30 @@
 
 TEST_CASE(ResolveUri_NormalizeEscapes_BrokenEscapeSequence) {
   const char* target_uri;
-  EXPECT(ResolveUri("",
-                    "scheme:/%1g",
-                    &target_uri));
+  EXPECT(ResolveUri("", "scheme:/%1g", &target_uri));
   // We don't change broken escape sequences.
-  EXPECT_STREQ("scheme:/%1g",
-               target_uri);
+  EXPECT_STREQ("scheme:/%1g", target_uri);
 }
 
 
 TEST_CASE(ResolveUri_DataUri) {
   const char* data_uri =
-      "data:application/dart;charset=utf-8,%20%20%20%20%20%20%20%20import%20%22dart:isolate%22;%0A%0A%20%20%20%20%20%20%20%20import%20%22package:stream_channel/stream_channel.dart%22;%0A%0A%20%20%20%20%20%20%20%20import%20%22package:test/src/runner/plugin/remote_platform_helpers.dart%22;%0A%20%20%20%20%20%20%20%20import%20%22package:test/src/runner/vm/catch_isolate_errors.dart%22;%0A%0A%20%20%20%20%20%20%20%20import%20%22file:///home/sra/xxxx/dev_compiler/test/all_tests.dart%22%20as%20test;%0A%0A%20%20%20%20%20%20%20%20void%20main(_,%20SendPort%20message)%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20channel%20=%20serializeSuite(()%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20catchIsolateErrors();%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20test.main;%0A%20%20%20%20%20%20%20%20%20%20%7D);%0A%20%20%20%20%20%20%20%20%20%20new%20IsolateChannel.connectSend(message).pipe(channel);%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20";  // NOLINT
+      "data:application/"
+      "dart;charset=utf-8,%20%20%20%20%20%20%20%20import%20%22dart:isolate%22;%"
+      "0A%0A%20%20%20%20%20%20%20%20import%20%22package:stream_channel/"
+      "stream_channel.dart%22;%0A%0A%20%20%20%20%20%20%20%20import%20%"
+      "22package:test/src/runner/plugin/"
+      "remote_platform_helpers.dart%22;%0A%20%20%20%20%20%20%20%20import%20%"
+      "22package:test/src/runner/vm/"
+      "catch_isolate_errors.dart%22;%0A%0A%20%20%20%20%20%20%20%20import%20%"
+      "22file:///home/sra/xxxx/dev_compiler/test/"
+      "all_tests.dart%22%20as%20test;%0A%0A%20%20%20%20%20%20%20%20void%20main("
+      "_,%20SendPort%20message)%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%"
+      "20channel%20=%20serializeSuite(()%20%7B%0A%20%20%20%20%20%20%20%20%20%"
+      "20%20%20catchIsolateErrors();%0A%20%20%20%20%20%20%20%20%20%20%20%"
+      "20return%20test.main;%0A%20%20%20%20%20%20%20%20%20%20%7D);%0A%20%20%20%"
+      "20%20%20%20%20%20%20new%20IsolateChannel.connectSend(message).pipe("
+      "channel);%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20";
 
   const char* target_uri;
   EXPECT(ResolveUri(data_uri,
@@ -581,51 +561,51 @@
   const char* base = "http://a/b/c/d;p?q";
 
   // From RFC 3986
-  EXPECT_STREQ("g:h",                   TestResolve(base, "g:h"));
-  EXPECT_STREQ("http://a/b/c/g",        TestResolve(base, "g"));
-  EXPECT_STREQ("http://a/b/c/g",        TestResolve(base, "./g"));
-  EXPECT_STREQ("http://a/b/c/g/",       TestResolve(base, "g/"));
-  EXPECT_STREQ("http://a/g",            TestResolve(base, "/g"));
-  EXPECT_STREQ("http://g",              TestResolve(base, "//g"));
-  EXPECT_STREQ("http://a/b/c/d;p?y",    TestResolve(base, "?y"));
-  EXPECT_STREQ("http://a/b/c/g?y",      TestResolve(base, "g?y"));
-  EXPECT_STREQ("http://a/b/c/d;p?q#s",  TestResolve(base, "#s"));
-  EXPECT_STREQ("http://a/b/c/g#s",      TestResolve(base, "g#s"));
-  EXPECT_STREQ("http://a/b/c/g?y#s",    TestResolve(base, "g?y#s"));
-  EXPECT_STREQ("http://a/b/c/;x",       TestResolve(base, ";x"));
-  EXPECT_STREQ("http://a/b/c/g;x",      TestResolve(base, "g;x"));
-  EXPECT_STREQ("http://a/b/c/g;x?y#s",  TestResolve(base, "g;x?y#s"));
-  EXPECT_STREQ("http://a/b/c/d;p?q",    TestResolve(base, ""));
-  EXPECT_STREQ("http://a/b/c/",         TestResolve(base, "."));
-  EXPECT_STREQ("http://a/b/c/",         TestResolve(base, "./"));
-  EXPECT_STREQ("http://a/b/",           TestResolve(base, ".."));
-  EXPECT_STREQ("http://a/b/",           TestResolve(base, "../"));
-  EXPECT_STREQ("http://a/b/g",          TestResolve(base, "../g"));
-  EXPECT_STREQ("http://a/",             TestResolve(base, "../.."));
-  EXPECT_STREQ("http://a/",             TestResolve(base, "../../"));
-  EXPECT_STREQ("http://a/g",            TestResolve(base, "../../g"));
-  EXPECT_STREQ("http://a/g",            TestResolve(base, "../../../g"));
-  EXPECT_STREQ("http://a/g",            TestResolve(base, "../../../../g"));
-  EXPECT_STREQ("http://a/g",            TestResolve(base, "/./g"));
-  EXPECT_STREQ("http://a/g",            TestResolve(base, "/../g"));
-  EXPECT_STREQ("http://a/b/c/g.",       TestResolve(base, "g."));
-  EXPECT_STREQ("http://a/b/c/.g",       TestResolve(base, ".g"));
-  EXPECT_STREQ("http://a/b/c/g..",      TestResolve(base, "g.."));
-  EXPECT_STREQ("http://a/b/c/..g",      TestResolve(base, "..g"));
-  EXPECT_STREQ("http://a/b/g",          TestResolve(base, "./../g"));
-  EXPECT_STREQ("http://a/b/c/g/",       TestResolve(base, "./g/."));
-  EXPECT_STREQ("http://a/b/c/g/h",      TestResolve(base, "g/./h"));
-  EXPECT_STREQ("http://a/b/c/h",        TestResolve(base, "g/../h"));
-  EXPECT_STREQ("http://a/b/c/g;x=1/y",  TestResolve(base, "g;x=1/./y"));
-  EXPECT_STREQ("http://a/b/c/y",        TestResolve(base, "g;x=1/../y"));
-  EXPECT_STREQ("http://a/b/c/g?y/./x",  TestResolve(base, "g?y/./x"));
+  EXPECT_STREQ("g:h", TestResolve(base, "g:h"));
+  EXPECT_STREQ("http://a/b/c/g", TestResolve(base, "g"));
+  EXPECT_STREQ("http://a/b/c/g", TestResolve(base, "./g"));
+  EXPECT_STREQ("http://a/b/c/g/", TestResolve(base, "g/"));
+  EXPECT_STREQ("http://a/g", TestResolve(base, "/g"));
+  EXPECT_STREQ("http://g", TestResolve(base, "//g"));
+  EXPECT_STREQ("http://a/b/c/d;p?y", TestResolve(base, "?y"));
+  EXPECT_STREQ("http://a/b/c/g?y", TestResolve(base, "g?y"));
+  EXPECT_STREQ("http://a/b/c/d;p?q#s", TestResolve(base, "#s"));
+  EXPECT_STREQ("http://a/b/c/g#s", TestResolve(base, "g#s"));
+  EXPECT_STREQ("http://a/b/c/g?y#s", TestResolve(base, "g?y#s"));
+  EXPECT_STREQ("http://a/b/c/;x", TestResolve(base, ";x"));
+  EXPECT_STREQ("http://a/b/c/g;x", TestResolve(base, "g;x"));
+  EXPECT_STREQ("http://a/b/c/g;x?y#s", TestResolve(base, "g;x?y#s"));
+  EXPECT_STREQ("http://a/b/c/d;p?q", TestResolve(base, ""));
+  EXPECT_STREQ("http://a/b/c/", TestResolve(base, "."));
+  EXPECT_STREQ("http://a/b/c/", TestResolve(base, "./"));
+  EXPECT_STREQ("http://a/b/", TestResolve(base, ".."));
+  EXPECT_STREQ("http://a/b/", TestResolve(base, "../"));
+  EXPECT_STREQ("http://a/b/g", TestResolve(base, "../g"));
+  EXPECT_STREQ("http://a/", TestResolve(base, "../.."));
+  EXPECT_STREQ("http://a/", TestResolve(base, "../../"));
+  EXPECT_STREQ("http://a/g", TestResolve(base, "../../g"));
+  EXPECT_STREQ("http://a/g", TestResolve(base, "../../../g"));
+  EXPECT_STREQ("http://a/g", TestResolve(base, "../../../../g"));
+  EXPECT_STREQ("http://a/g", TestResolve(base, "/./g"));
+  EXPECT_STREQ("http://a/g", TestResolve(base, "/../g"));
+  EXPECT_STREQ("http://a/b/c/g.", TestResolve(base, "g."));
+  EXPECT_STREQ("http://a/b/c/.g", TestResolve(base, ".g"));
+  EXPECT_STREQ("http://a/b/c/g..", TestResolve(base, "g.."));
+  EXPECT_STREQ("http://a/b/c/..g", TestResolve(base, "..g"));
+  EXPECT_STREQ("http://a/b/g", TestResolve(base, "./../g"));
+  EXPECT_STREQ("http://a/b/c/g/", TestResolve(base, "./g/."));
+  EXPECT_STREQ("http://a/b/c/g/h", TestResolve(base, "g/./h"));
+  EXPECT_STREQ("http://a/b/c/h", TestResolve(base, "g/../h"));
+  EXPECT_STREQ("http://a/b/c/g;x=1/y", TestResolve(base, "g;x=1/./y"));
+  EXPECT_STREQ("http://a/b/c/y", TestResolve(base, "g;x=1/../y"));
+  EXPECT_STREQ("http://a/b/c/g?y/./x", TestResolve(base, "g?y/./x"));
   EXPECT_STREQ("http://a/b/c/g?y/../x", TestResolve(base, "g?y/../x"));
-  EXPECT_STREQ("http://a/b/c/g#s/./x",  TestResolve(base, "g#s/./x"));
+  EXPECT_STREQ("http://a/b/c/g#s/./x", TestResolve(base, "g#s/./x"));
   EXPECT_STREQ("http://a/b/c/g#s/../x", TestResolve(base, "g#s/../x"));
-  EXPECT_STREQ("http:g",                TestResolve(base, "http:g"));
+  EXPECT_STREQ("http:g", TestResolve(base, "http:g"));
 
   // Additional tests (not from RFC 3986).
-  EXPECT_STREQ("http://a/b/g;p/h;s",    TestResolve(base, "../g;p/h;s"));
+  EXPECT_STREQ("http://a/b/g;p/h;s", TestResolve(base, "../g;p/h;s"));
 
   base = "s:a/b";
   EXPECT_STREQ("s:/c", TestResolve(base, "../c"));
@@ -635,32 +615,32 @@
 // This test is ported from sdk/tests/corelib/uri_test.dart (testResolvePath).
 TEST_CASE(ResolveUri_MoreDotSegmentTests) {
   const char* base = "/";
-  EXPECT_STREQ("/a/g",    TestResolve(base, "/a/b/c/./../../g"));
-  EXPECT_STREQ("/a/g",    TestResolve(base, "/a/b/c/./../../g"));
-  EXPECT_STREQ("/mid/6",  TestResolve(base, "mid/content=5/../6"));
-  EXPECT_STREQ("/a/b/e",  TestResolve(base, "a/b/c/d/../../e"));
-  EXPECT_STREQ("/a/b/e",  TestResolve(base, "../a/b/c/d/../../e"));
-  EXPECT_STREQ("/a/b/e",  TestResolve(base, "./a/b/c/d/../../e"));
-  EXPECT_STREQ("/a/b/e",  TestResolve(base, "../a/b/./c/d/../../e"));
-  EXPECT_STREQ("/a/b/e",  TestResolve(base, "./a/b/./c/d/../../e"));
+  EXPECT_STREQ("/a/g", TestResolve(base, "/a/b/c/./../../g"));
+  EXPECT_STREQ("/a/g", TestResolve(base, "/a/b/c/./../../g"));
+  EXPECT_STREQ("/mid/6", TestResolve(base, "mid/content=5/../6"));
+  EXPECT_STREQ("/a/b/e", TestResolve(base, "a/b/c/d/../../e"));
+  EXPECT_STREQ("/a/b/e", TestResolve(base, "../a/b/c/d/../../e"));
+  EXPECT_STREQ("/a/b/e", TestResolve(base, "./a/b/c/d/../../e"));
+  EXPECT_STREQ("/a/b/e", TestResolve(base, "../a/b/./c/d/../../e"));
+  EXPECT_STREQ("/a/b/e", TestResolve(base, "./a/b/./c/d/../../e"));
   EXPECT_STREQ("/a/b/e/", TestResolve(base, "./a/b/./c/d/../../e/."));
   EXPECT_STREQ("/a/b/e/", TestResolve(base, "./a/b/./c/d/../../e/./."));
   EXPECT_STREQ("/a/b/e/", TestResolve(base, "./a/b/./c/d/../../e/././."));
 
-  #define LH "http://localhost"
+#define LH "http://localhost"
   base = LH;
-  EXPECT_STREQ(LH "/a/g",    TestResolve(base, "/a/b/c/./../../g"));
-  EXPECT_STREQ(LH "/a/g",    TestResolve(base, "/a/b/c/./../../g"));
-  EXPECT_STREQ(LH "/mid/6",  TestResolve(base, "mid/content=5/../6"));
-  EXPECT_STREQ(LH "/a/b/e",  TestResolve(base, "a/b/c/d/../../e"));
-  EXPECT_STREQ(LH "/a/b/e",  TestResolve(base, "../a/b/c/d/../../e"));
-  EXPECT_STREQ(LH "/a/b/e",  TestResolve(base, "./a/b/c/d/../../e"));
-  EXPECT_STREQ(LH "/a/b/e",  TestResolve(base, "../a/b/./c/d/../../e"));
-  EXPECT_STREQ(LH "/a/b/e",  TestResolve(base, "./a/b/./c/d/../../e"));
+  EXPECT_STREQ(LH "/a/g", TestResolve(base, "/a/b/c/./../../g"));
+  EXPECT_STREQ(LH "/a/g", TestResolve(base, "/a/b/c/./../../g"));
+  EXPECT_STREQ(LH "/mid/6", TestResolve(base, "mid/content=5/../6"));
+  EXPECT_STREQ(LH "/a/b/e", TestResolve(base, "a/b/c/d/../../e"));
+  EXPECT_STREQ(LH "/a/b/e", TestResolve(base, "../a/b/c/d/../../e"));
+  EXPECT_STREQ(LH "/a/b/e", TestResolve(base, "./a/b/c/d/../../e"));
+  EXPECT_STREQ(LH "/a/b/e", TestResolve(base, "../a/b/./c/d/../../e"));
+  EXPECT_STREQ(LH "/a/b/e", TestResolve(base, "./a/b/./c/d/../../e"));
   EXPECT_STREQ(LH "/a/b/e/", TestResolve(base, "./a/b/./c/d/../../e/."));
   EXPECT_STREQ(LH "/a/b/e/", TestResolve(base, "./a/b/./c/d/../../e/./."));
   EXPECT_STREQ(LH "/a/b/e/", TestResolve(base, "./a/b/./c/d/../../e/././."));
-  #undef LH
+#undef LH
 }
 
 }  // namespace dart
diff --git a/runtime/vm/verifier.cc b/runtime/vm/verifier.cc
index a2ce0c3..fc11867 100644
--- a/runtime/vm/verifier.cc
+++ b/runtime/vm/verifier.cc
@@ -26,18 +26,18 @@
       }
     } else {
       switch (mark_expectation_) {
-       case kForbidMarked:
-        if (raw_obj->IsMarked()) {
-          FATAL1("Marked object encountered %#" Px "\n", raw_addr);
-        }
-        break;
-       case kAllowMarked:
-        break;
-       case kRequireMarked:
-        if (!raw_obj->IsMarked()) {
-          FATAL1("Unmarked object encountered %#" Px "\n", raw_addr);
-        }
-        break;
+        case kForbidMarked:
+          if (raw_obj->IsMarked()) {
+            FATAL1("Marked object encountered %#" Px "\n", raw_addr);
+          }
+          break;
+        case kAllowMarked:
+          break;
+        case kRequireMarked:
+          if (!raw_obj->IsMarked()) {
+            FATAL1("Unmarked object encountered %#" Px "\n", raw_addr);
+          }
+          break;
       }
     }
   }
@@ -72,13 +72,11 @@
   Thread* thread = Thread::Current();
   Isolate* isolate = thread->isolate();
   StackZone stack_zone(thread);
-  ObjectSet* allocated_set =
-      isolate->heap()->CreateAllocatedObjectSet(stack_zone.GetZone(),
-                                                mark_expectation);
+  ObjectSet* allocated_set = isolate->heap()->CreateAllocatedObjectSet(
+      stack_zone.GetZone(), mark_expectation);
   VerifyPointersVisitor visitor(isolate, allocated_set);
   // Visit all strongly reachable objects.
-  isolate->IterateObjectPointers(&visitor,
-                                 StackFrameIterator::kValidateFrames);
+  isolate->IterateObjectPointers(&visitor, StackFrameIterator::kValidateFrames);
   VerifyWeakPointersVisitor weak_visitor(&visitor);
   // Visit weak handles and prologue weak handles.
   isolate->VisitWeakPersistentHandles(&weak_visitor);
@@ -87,16 +85,19 @@
 
 #if defined(DEBUG)
 VerifyCanonicalVisitor::VerifyCanonicalVisitor(Thread* thread)
-    : thread_(thread),
-      instanceHandle_(Instance::Handle(thread->zone())) {
-}
+    : thread_(thread), instanceHandle_(Instance::Handle(thread->zone())) {}
 
 
 void VerifyCanonicalVisitor::VisitObject(RawObject* obj) {
   if (obj->GetClassId() >= kInstanceCid) {
     if (obj->IsCanonical()) {
       instanceHandle_ ^= obj;
-      ASSERT(instanceHandle_.CheckIsCanonical(thread_));
+      const bool is_canonical = instanceHandle_.CheckIsCanonical(thread_);
+      if (!is_canonical) {
+        OS::PrintErr("Instance `%s` is not canonical!\n",
+                     instanceHandle_.ToCString());
+      }
+      ASSERT(is_canonical);
     }
   }
 }
diff --git a/runtime/vm/verifier.h b/runtime/vm/verifier.h
index 8ae222d..e949738 100644
--- a/runtime/vm/verifier.h
+++ b/runtime/vm/verifier.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_VERIFIER_H_
-#define VM_VERIFIER_H_
+#ifndef RUNTIME_VM_VERIFIER_H_
+#define RUNTIME_VM_VERIFIER_H_
 
 #include "vm/flags.h"
 #include "vm/globals.h"
@@ -18,22 +18,17 @@
 class RawObject;
 
 
-enum MarkExpectation {
-  kForbidMarked,
-  kAllowMarked,
-  kRequireMarked
-};
+enum MarkExpectation { kForbidMarked, kAllowMarked, kRequireMarked };
 
 
 class VerifyObjectVisitor : public ObjectVisitor {
  public:
   VerifyObjectVisitor(Isolate* isolate,
-                     ObjectSet* allocated_set,
-                     MarkExpectation mark_expectation)
+                      ObjectSet* allocated_set,
+                      MarkExpectation mark_expectation)
       : isolate_(isolate),
         allocated_set_(allocated_set),
-        mark_expectation_(mark_expectation) {
-  }
+        mark_expectation_(mark_expectation) {}
 
   virtual void VisitObject(RawObject* obj);
 
@@ -50,9 +45,7 @@
 class VerifyPointersVisitor : public ObjectPointerVisitor {
  public:
   explicit VerifyPointersVisitor(Isolate* isolate, ObjectSet* allocated_set)
-      : ObjectPointerVisitor(isolate),
-        allocated_set_(allocated_set) {
-  }
+      : ObjectPointerVisitor(isolate), allocated_set_(allocated_set) {}
 
   virtual void VisitPointers(RawObject** first, RawObject** last);
 
@@ -67,9 +60,7 @@
 class VerifyWeakPointersVisitor : public HandleVisitor {
  public:
   explicit VerifyWeakPointersVisitor(VerifyPointersVisitor* visitor)
-      :  HandleVisitor(Thread::Current()),
-         visitor_(visitor) {
-  }
+      : HandleVisitor(Thread::Current()), visitor_(visitor) {}
 
   virtual void VisitHandle(uword addr);
 
@@ -98,4 +89,4 @@
 
 }  // namespace dart
 
-#endif  // VM_VERIFIER_H_
+#endif  // RUNTIME_VM_VERIFIER_H_
diff --git a/runtime/vm/version.h b/runtime/vm/version.h
index 45afcb5..2acf205 100644
--- a/runtime/vm/version.h
+++ b/runtime/vm/version.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_VERSION_H_
-#define VM_VERSION_H_
+#ifndef RUNTIME_VM_VERSION_H_
+#define RUNTIME_VM_VERSION_H_
 
 #include "vm/allocation.h"
 
@@ -21,4 +21,4 @@
 
 }  // namespace dart
 
-#endif  // VM_VERSION_H_
+#endif  // RUNTIME_VM_VERSION_H_
diff --git a/runtime/vm/virtual_memory.cc b/runtime/vm/virtual_memory.cc
index 1372545..1e62f8b 100644
--- a/runtime/vm/virtual_memory.cc
+++ b/runtime/vm/virtual_memory.cc
@@ -19,7 +19,7 @@
   ASSERT((new_size & (PageSize() - 1)) == 0);
   ASSERT(new_size <= size());
   if (try_unmap &&
-      (reserved_size_ == size()) &&  /* Don't create holes in reservation. */
+      (reserved_size_ == size()) && /* Don't create holes in reservation. */
       FreeSubSegment(reinterpret_cast<void*>(start() + new_size),
                      size() - new_size)) {
     reserved_size_ = new_size;
diff --git a/runtime/vm/virtual_memory.h b/runtime/vm/virtual_memory.h
index 6e43cb4..a26b8ce7 100644
--- a/runtime/vm/virtual_memory.h
+++ b/runtime/vm/virtual_memory.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_VIRTUAL_MEMORY_H_
-#define VM_VIRTUAL_MEMORY_H_
+#ifndef RUNTIME_VM_VIRTUAL_MEMORY_H_
+#define RUNTIME_VM_VIRTUAL_MEMORY_H_
 
 #include "platform/utils.h"
 #include "vm/globals.h"
@@ -32,9 +32,7 @@
 
   static void InitOnce();
 
-  bool Contains(uword addr) const {
-    return region_.Contains(addr);
-  }
+  bool Contains(uword addr) const { return region_.Contains(addr); }
 
   // Commits the virtual memory area, which is guaranteed to be zeroed. Returns
   // true on success and false on failure (e.g., out-of-memory).
@@ -44,15 +42,11 @@
 
   // Changes the protection of the virtual memory area.
   static bool Protect(void* address, intptr_t size, Protection mode);
-  bool Protect(Protection mode) {
-    return Protect(address(), size(), mode);
-  }
+  bool Protect(Protection mode) { return Protect(address(), size(), mode); }
 
   // Reserves a virtual memory segment with size. If a segment of the requested
   // size cannot be allocated NULL is returned.
-  static VirtualMemory* Reserve(intptr_t size) {
-    return ReserveInternal(size);
-  }
+  static VirtualMemory* Reserve(intptr_t size) { return ReserveInternal(size); }
 
   static intptr_t PageSize() {
     ASSERT(page_size_ != 0);
@@ -83,11 +77,11 @@
 
   // This constructor is only used internally when reserving new virtual spaces.
   // It does not reserve any virtual address space on its own.
-  explicit VirtualMemory(const MemoryRegion& region, int32_t handle = 0) :
-      region_(region.pointer(), region.size()),
-      reserved_size_(region.size()),
-      handle_(handle),
-      embedder_allocated_(false) { }
+  explicit VirtualMemory(const MemoryRegion& region, int32_t handle = 0)
+      : region_(region.pointer(), region.size()),
+        reserved_size_(region.size()),
+        handle_(handle),
+        embedder_allocated_(false) {}
 
   MemoryRegion region_;
 
@@ -107,4 +101,4 @@
 
 }  // namespace dart
 
-#endif  // VM_VIRTUAL_MEMORY_H_
+#endif  // RUNTIME_VM_VIRTUAL_MEMORY_H_
diff --git a/runtime/vm/virtual_memory_android.cc b/runtime/vm/virtual_memory_android.cc
index 16aa834..7406d22 100644
--- a/runtime/vm/virtual_memory_android.cc
+++ b/runtime/vm/virtual_memory_android.cc
@@ -8,7 +8,7 @@
 #include "vm/virtual_memory.h"
 
 #include <sys/mman.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <unistd.h>    // NOLINT
 
 #include "platform/assert.h"
 #include "platform/utils.h"
@@ -33,8 +33,7 @@
 VirtualMemory* VirtualMemory::ReserveInternal(intptr_t size) {
   // TODO(4408): use ashmem instead of anonymous memory.
   void* address = mmap(NULL, size, PROT_NONE,
-                       MAP_PRIVATE | MAP_ANON | MAP_NORESERVE,
-                       -1, 0);
+                       MAP_PRIVATE | MAP_ANON | MAP_NORESERVE, -1, 0);
   if (address == MAP_FAILED) {
     return NULL;
   }
@@ -72,8 +71,7 @@
   ASSERT(Contains(addr + size) || (addr + size == end()));
   int prot = PROT_READ | PROT_WRITE | (executable ? PROT_EXEC : 0);
   void* address = mmap(reinterpret_cast<void*>(addr), size, prot,
-                       MAP_PRIVATE | MAP_ANON | MAP_FIXED,
-                       -1, 0);
+                       MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0);
   if (address == MAP_FAILED) {
     return false;
   }
@@ -106,8 +104,7 @@
       break;
   }
   return (mprotect(reinterpret_cast<void*>(page_address),
-                   end_address - page_address,
-                   prot) == 0);
+                   end_address - page_address, prot) == 0);
 }
 
 }  // namespace dart
diff --git a/runtime/vm/virtual_memory_fuchsia.cc b/runtime/vm/virtual_memory_fuchsia.cc
index 8cbc836..bd78bf9 100644
--- a/runtime/vm/virtual_memory_fuchsia.cc
+++ b/runtime/vm/virtual_memory_fuchsia.cc
@@ -7,7 +7,6 @@
 
 #include "vm/virtual_memory.h"
 
-#include <magenta/process.h>
 #include <magenta/syscalls.h>
 #include <unistd.h>  // NOLINT
 
@@ -26,20 +25,19 @@
 
 
 VirtualMemory* VirtualMemory::ReserveInternal(intptr_t size) {
-  mx_handle_t vmo = mx_vmo_create(size);
-  if (vmo <= 0) {
+  mx_handle_t vmo = MX_HANDLE_INVALID;
+  mx_status_t status = mx_vmo_create(size, 0u, &vmo);
+  if (status != NO_ERROR) {
     return NULL;
   }
 
   // TODO(zra): map with PERM_NONE, when that works, and relax with
   // Commit and Protect when they are implemented.
   // Issue MG-161.
-  const int prot = MX_VM_FLAG_PERM_READ |
-                   MX_VM_FLAG_PERM_WRITE |
-                   MX_VM_FLAG_PERM_EXECUTE;
+  const int prot =
+      MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_PERM_EXECUTE;
   uintptr_t addr;
-  mx_status_t status = mx_process_map_vm(
-      mx_process_self(), vmo, 0, size, &addr, prot);
+  status = mx_process_map_vm(mx_process_self(), vmo, 0, size, &addr, prot);
   if (status != NO_ERROR) {
     mx_handle_close(vmo);
     FATAL("VirtualMemory::ReserveInternal FAILED");
@@ -56,8 +54,8 @@
     // TODO(zra): Use reserved_size_.
     // Issue MG-162.
     uintptr_t addr = reinterpret_cast<uintptr_t>(address());
-    mx_status_t status = mx_process_unmap_vm(
-        mx_process_self(), addr, 0 /*reserved_size_*/);
+    mx_status_t status =
+        mx_process_unmap_vm(mx_process_self(), addr, 0 /*reserved_size_*/);
     if (status != NO_ERROR) {
       FATAL("VirtualMemory::~VirtualMemory: unamp FAILED");
     }
diff --git a/runtime/vm/virtual_memory_linux.cc b/runtime/vm/virtual_memory_linux.cc
index 0228f68..be3655f 100644
--- a/runtime/vm/virtual_memory_linux.cc
+++ b/runtime/vm/virtual_memory_linux.cc
@@ -8,7 +8,7 @@
 #include "vm/virtual_memory.h"
 
 #include <sys/mman.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <unistd.h>    // NOLINT
 
 #include "platform/assert.h"
 #include "platform/utils.h"
@@ -32,8 +32,7 @@
 
 VirtualMemory* VirtualMemory::ReserveInternal(intptr_t size) {
   void* address = mmap(NULL, size, PROT_NONE,
-                       MAP_PRIVATE | MAP_ANON | MAP_NORESERVE,
-                       -1, 0);
+                       MAP_PRIVATE | MAP_ANON | MAP_NORESERVE, -1, 0);
   if (address == MAP_FAILED) {
     return NULL;
   }
@@ -71,8 +70,7 @@
   ASSERT(Contains(addr + size) || (addr + size == end()));
   int prot = PROT_READ | PROT_WRITE | (executable ? PROT_EXEC : 0);
   void* address = mmap(reinterpret_cast<void*>(addr), size, prot,
-                       MAP_PRIVATE | MAP_ANON | MAP_FIXED,
-                       -1, 0);
+                       MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0);
   if (address == MAP_FAILED) {
     return false;
   }
@@ -105,8 +103,7 @@
       break;
   }
   return (mprotect(reinterpret_cast<void*>(page_address),
-                   end_address - page_address,
-                   prot) == 0);
+                   end_address - page_address, prot) == 0);
 }
 
 
diff --git a/runtime/vm/virtual_memory_macos.cc b/runtime/vm/virtual_memory_macos.cc
index 484ad78..6f42b55 100644
--- a/runtime/vm/virtual_memory_macos.cc
+++ b/runtime/vm/virtual_memory_macos.cc
@@ -8,7 +8,7 @@
 #include "vm/virtual_memory.h"
 
 #include <sys/mman.h>  // NOLINT
-#include <unistd.h>  // NOLINT
+#include <unistd.h>    // NOLINT
 
 #include "platform/assert.h"
 #include "platform/utils.h"
@@ -33,8 +33,7 @@
 VirtualMemory* VirtualMemory::ReserveInternal(intptr_t size) {
   ASSERT((size & (PageSize() - 1)) == 0);
   void* address = mmap(NULL, size, PROT_NONE,
-                       MAP_PRIVATE | MAP_ANON | MAP_NORESERVE,
-                       -1, 0);
+                       MAP_PRIVATE | MAP_ANON | MAP_NORESERVE, -1, 0);
   if (address == MAP_FAILED) {
     return NULL;
   }
@@ -72,8 +71,7 @@
   ASSERT(Contains(addr + size) || (addr + size == end()));
   int prot = PROT_READ | PROT_WRITE | (executable ? PROT_EXEC : 0);
   void* address = mmap(reinterpret_cast<void*>(addr), size, prot,
-                       MAP_PRIVATE | MAP_ANON | MAP_FIXED,
-                       -1, 0);
+                       MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0);
   if (address == MAP_FAILED) {
     return false;
   }
@@ -106,8 +104,7 @@
       break;
   }
   return (mprotect(reinterpret_cast<void*>(page_address),
-                   end_address - page_address,
-                   prot) == 0);
+                   end_address - page_address, prot) == 0);
 }
 
 }  // namespace dart
diff --git a/runtime/vm/virtual_memory_win.cc b/runtime/vm/virtual_memory_win.cc
index 2584613..de9156d 100644
--- a/runtime/vm/virtual_memory_win.cc
+++ b/runtime/vm/virtual_memory_win.cc
@@ -90,9 +90,7 @@
   }
   DWORD old_prot = 0;
   bool result = VirtualProtect(reinterpret_cast<void*>(page_address),
-                        end_address - page_address,
-                        prot,
-                        &old_prot);
+                               end_address - page_address, prot, &old_prot);
   return result;
 }
 
diff --git a/runtime/vm/visitor.h b/runtime/vm/visitor.h
index 3b071e2..51f95ed 100644
--- a/runtime/vm/visitor.h
+++ b/runtime/vm/visitor.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_VISITOR_H_
-#define VM_VISITOR_H_
+#ifndef RUNTIME_VM_VISITOR_H_
+#define RUNTIME_VM_VISITOR_H_
 
 #include "vm/allocation.h"
 #include "vm/globals.h"
@@ -18,8 +18,8 @@
 // An object pointer visitor interface.
 class ObjectPointerVisitor {
  public:
-  explicit ObjectPointerVisitor(Isolate* isolate) : isolate_(isolate) { }
-  virtual ~ObjectPointerVisitor() { }
+  explicit ObjectPointerVisitor(Isolate* isolate) : isolate_(isolate) {}
+  virtual ~ObjectPointerVisitor() {}
 
   Isolate* isolate() const { return isolate_; }
 
@@ -27,15 +27,13 @@
   virtual void VisitPointers(RawObject** first, RawObject** last) = 0;
 
   virtual bool visit_function_code() const { return true; }
-  virtual void add_skipped_code_function(RawFunction* funct) {
-    UNREACHABLE();
-  }
+  virtual void add_skipped_code_function(RawFunction* funct) { UNREACHABLE(); }
   // len argument is the number of pointers to visit starting from 'p'.
   void VisitPointers(RawObject** p, intptr_t len) {
     VisitPointers(p, (p + len - 1));
   }
 
-  void VisitPointer(RawObject** p) { VisitPointers(p , p); }
+  void VisitPointer(RawObject** p) { VisitPointers(p, p); }
 
  private:
   Isolate* isolate_;
@@ -48,9 +46,9 @@
 // An object visitor interface.
 class ObjectVisitor {
  public:
-  ObjectVisitor() { }
+  ObjectVisitor() {}
 
-  virtual ~ObjectVisitor() { }
+  virtual ~ObjectVisitor() {}
 
   // Invoked for each object.
   virtual void VisitObject(RawObject* obj) = 0;
@@ -63,8 +61,8 @@
 // An object finder visitor interface.
 class FindObjectVisitor {
  public:
-  FindObjectVisitor() { }
-  virtual ~FindObjectVisitor() { }
+  FindObjectVisitor() {}
+  virtual ~FindObjectVisitor() {}
 
   // Allow to specify a address filter.
   virtual uword filter_addr() const { return 0; }
@@ -82,4 +80,4 @@
 
 }  // namespace dart
 
-#endif  // VM_VISITOR_H_
+#endif  // RUNTIME_VM_VISITOR_H_
diff --git a/runtime/vm/vm.gypi b/runtime/vm/vm.gypi
index a08a1b8..a072f65 100644
--- a/runtime/vm/vm.gypi
+++ b/runtime/vm/vm.gypi
@@ -967,6 +967,10 @@
       ]
     },
     {
+      # Unlike the other libraries in the SDK, dart:typed_data is not
+      # implemented as a patch applied to the base SDK implementation.
+      # Instead the VM has a complete replacement library and the
+      # implementation in the SDK is ignored.
       'target_name': 'generate_typed_data_cc_file',
       'type': 'none',
       'toolsets':['host'],
@@ -1234,5 +1238,456 @@
         },
       ]
     },
+    {
+      'target_name': 'generate_patched_sdk',
+      'type': 'none',
+      'toolsets': ['host'],
+      'dependencies': [
+        'dart_bootstrap#host',
+        'generate_async_library_patch',
+        'generate_collection_library_patch',
+        'generate_convert_library_patch',
+        'generate_core_library_patch',
+        'generate_developer_library_patch',
+        'generate_internal_library_patch',
+        'generate_io_library_patch',
+        'generate_isolate_library_patch',
+        'generate_math_library_patch',
+        'generate_mirrors_library_patch',
+        'generate_profiler_library_patch',
+        'generate_vmservice_library_patch',
+      ],
+      'actions': [
+        {
+          'action_name': 'patch_sdk',
+          'inputs': [
+            '<!@(["python", "../tools/list_files.py",' '"dart$",' '"sdk/lib"])',
+            '../../tools/patch_sdk.py',
+            '../../tools/patch_sdk.dart',
+            # Unlike the other libraries in the SDK, dart:typed_data is not
+            # implemented as a patch applied to the base SDK implementation.
+            # Instead the VM has a complete replacement library and the
+            # implementation in the SDK is ignored.
+            '../lib/typed_data.dart',
+            # Unlike the other libraries in the SDK, dart:_builtin and
+            # dart:nativewrappers are only available for the Dart VM.
+            '../bin/builtin.dart',
+            '../bin/vmservice/vmservice_io.dart',
+            '../bin/vmservice/loader.dart',
+            '../bin/vmservice/server.dart',
+            '<(gen_source_dir)/patches/async_patch.dart',
+            '<(gen_source_dir)/patches/collection_patch.dart',
+            '<(gen_source_dir)/patches/convert_patch.dart',
+            '<(gen_source_dir)/patches/core_patch.dart',
+            '<(gen_source_dir)/patches/developer_patch.dart',
+            '<(gen_source_dir)/patches/internal_patch.dart',
+            '<(gen_source_dir)/patches/io_patch.dart',
+            '<(gen_source_dir)/patches/isolate_patch.dart',
+            '<(gen_source_dir)/patches/math_patch.dart',
+            '<(gen_source_dir)/patches/mirrors_patch.dart',
+            '<(gen_source_dir)/patches/profiler_patch.dart',
+            '<(gen_source_dir)/patches/vmservice_patch.dart',
+          ],
+          'outputs': [
+            # Instead of listing all outputs we list a single well-known one.
+            '<(PRODUCT_DIR)/patched_sdk/lib/core/core.dart',
+          ],
+          'action': [
+            'python',
+            '../tools/patch_sdk.py',
+            '--dart-executable',
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart_bootstrap<(EXECUTABLE_SUFFIX)',
+            'vm',
+            '../sdk',
+            '<(gen_source_dir)/patches',
+            '<(PRODUCT_DIR)/patched_sdk',
+          ],
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'async',
+        'library_uri': 'dart:async',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../lib/async_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'collection',
+        'library_uri': 'dart:collection',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../lib/collection_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'convert',
+        'library_uri': 'dart:convert',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../lib/convert_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'core',
+        'library_uri': 'dart:core',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../lib/core_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'developer',
+        'library_uri': 'dart:developer',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../lib/developer_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'internal',
+        'library_uri': 'dart:_internal',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../lib/internal_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'io',
+        'library_uri': 'dart:io',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../bin/io_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'isolate',
+        'library_uri': 'dart:isolate',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../lib/isolate_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'math',
+        'library_uri': 'dart:math',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../lib/math_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'mirrors',
+        'library_uri': 'dart:mirrors',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../lib/mirrors_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'profiler',
+        'library_uri': 'dart:profiler',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../lib/profiler_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'vmservice',
+        'library_uri': 'dart:_vmservice',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../lib/vmservice_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
   ]
 }
diff --git a/runtime/vm/vm_sources.gypi b/runtime/vm/vm_sources.gypi
index 156b120..83b325f 100644
--- a/runtime/vm/vm_sources.gypi
+++ b/runtime/vm/vm_sources.gypi
@@ -362,6 +362,13 @@
     'port_test.cc',
     'precompiler.cc',
     'precompiler.h',
+    'kernel.h',
+    'kernel.cc',
+    'kernel_binary.cc',
+    'kernel_to_il.cc',
+    'kernel_to_il.h',
+    'kernel_reader.h',
+    'kernel_reader.cc',
     'proccpuinfo.cc',
     'proccpuinfo.h',
     'profiler_service.cc',
diff --git a/runtime/vm/weak_code.cc b/runtime/vm/weak_code.cc
index 6dedc88..c7e12d1 100644
--- a/runtime/vm/weak_code.cc
+++ b/runtime/vm/weak_code.cc
@@ -32,13 +32,13 @@
     }
   }
 
-  const WeakProperty& weak_property = WeakProperty::Handle(
-      WeakProperty::New(Heap::kOld));
+  const WeakProperty& weak_property =
+      WeakProperty::Handle(WeakProperty::New(Heap::kOld));
   weak_property.set_key(value);
 
   intptr_t length = array_.IsNull() ? 0 : array_.Length();
-  const Array& new_array = Array::Handle(
-      Array::Grow(array_, length + 1, Heap::kOld));
+  const Array& new_array =
+      Array::Handle(Array::Grow(array_, length + 1, Heap::kOld));
   new_array.SetAt(length, weak_property);
   UpdateArrayTo(new_array);
 }
@@ -76,7 +76,7 @@
       code = frame->LookupDartCode();
       if (IsOptimizedCode(code_objects, code)) {
         ReportDeoptimization(code);
-        DeoptimizeAt(code, frame->pc());
+        DeoptimizeAt(code, frame);
       }
       frame = iterator.NextFrame();
     }
diff --git a/runtime/vm/weak_code.h b/runtime/vm/weak_code.h
index 9fd11c1..42da4d7 100644
--- a/runtime/vm/weak_code.h
+++ b/runtime/vm/weak_code.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_WEAK_CODE_H_
-#define VM_WEAK_CODE_H_
+#ifndef RUNTIME_VM_WEAK_CODE_H_
+#define RUNTIME_VM_WEAK_CODE_H_
 
 #include "vm/allocation.h"
 #include "vm/globals.h"
@@ -39,4 +39,4 @@
 
 }  // namespace dart
 
-#endif  // VM_WEAK_CODE_H_
+#endif  // RUNTIME_VM_WEAK_CODE_H_
diff --git a/runtime/vm/weak_table.cc b/runtime/vm/weak_table.cc
index e45e9c8..a9e8c11 100644
--- a/runtime/vm/weak_table.cc
+++ b/runtime/vm/weak_table.cc
@@ -18,8 +18,9 @@
     // Increase the capacity.
     result = size * 2;
     if (result < size) {
-      FATAL("Reached impossible state of having more weak table entries"
-            " than memory available for heap objects.");
+      FATAL(
+          "Reached impossible state of having more weak table entries"
+          " than memory available for heap objects.");
     }
   }
   if (result < kMinSize) {
@@ -91,8 +92,8 @@
 
   intptr_t new_size = SizeFor(count(), size());
   ASSERT(Utils::IsPowerOfTwo(new_size));
-  intptr_t* new_data = reinterpret_cast<intptr_t*>(
-      calloc(new_size, kEntrySize * kWordSize));
+  intptr_t* new_data =
+      reinterpret_cast<intptr_t*>(calloc(new_size, kEntrySize * kWordSize));
 
   intptr_t mask = new_size - 1;
   set_used(0);
diff --git a/runtime/vm/weak_table.h b/runtime/vm/weak_table.h
index 2c40aa3..5814bb0 100644
--- a/runtime/vm/weak_table.h
+++ b/runtime/vm/weak_table.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_WEAK_TABLE_H_
-#define VM_WEAK_TABLE_H_
+#ifndef RUNTIME_VM_WEAK_TABLE_H_
+#define RUNTIME_VM_WEAK_TABLE_H_
 
 #include "vm/globals.h"
 
@@ -26,7 +26,7 @@
     }
     // Get a max size that avoids overflows.
     const intptr_t kMaxSize =
-      (kIntptrOne << (kBitsPerWord - 2)) / (kEntrySize * kWordSize);
+        (kIntptrOne << (kBitsPerWord - 2)) / (kEntrySize * kWordSize);
     ASSERT(Utils::IsPowerOfTwo(kMaxSize));
     if (size > kMaxSize) {
       size = kMaxSize;
@@ -36,9 +36,7 @@
     data_ = reinterpret_cast<intptr_t*>(calloc(size_, kEntrySize * kWordSize));
   }
 
-  ~WeakTable() {
-    free(data_);
-  }
+  ~WeakTable() { free(data_); }
 
   static WeakTable* NewFrom(WeakTable* original) {
     return new WeakTable(SizeFor(original->count(), original->size()));
@@ -49,11 +47,9 @@
   intptr_t count() const { return count_; }
 
   bool IsValidEntryAt(intptr_t i) const {
-    ASSERT(((ValueAt(i) == 0) &&
-            ((ObjectAt(i) == NULL) ||
-             (data_[ObjectIndex(i)] == kDeletedEntry))) ||
-           ((ValueAt(i) != 0) &&
-            (ObjectAt(i) != NULL) &&
+    ASSERT(((ValueAt(i) == 0) && ((ObjectAt(i) == NULL) ||
+                                  (data_[ObjectIndex(i)] == kDeletedEntry))) ||
+           ((ValueAt(i) != 0) && (ObjectAt(i) != NULL) &&
             (data_[ObjectIndex(i)] != kDeletedEntry)));
     return (data_[ValueIndex(i)] != 0);
   }
@@ -111,9 +107,7 @@
   }
   intptr_t limit() const { return LimitFor(size()); }
 
-  intptr_t index(intptr_t i) const {
-    return i * kEntrySize;
-  }
+  intptr_t index(intptr_t i) const { return i * kEntrySize; }
 
   void set_used(intptr_t val) {
     ASSERT(val <= limit());
@@ -126,13 +120,9 @@
     count_ = val;
   }
 
-  intptr_t ObjectIndex(intptr_t i) const {
-    return index(i) + kObjectOffset;
-  }
+  intptr_t ObjectIndex(intptr_t i) const { return index(i) + kObjectOffset; }
 
-  intptr_t ValueIndex(intptr_t i) const {
-    return index(i) + kValueOffset;
-  }
+  intptr_t ValueIndex(intptr_t i) const { return index(i) + kValueOffset; }
 
   void SetObjectAt(intptr_t i, RawObject* key) {
     ASSERT(i >= 0);
@@ -171,4 +161,4 @@
 
 }  // namespace dart
 
-#endif  // VM_WEAK_TABLE_H_
+#endif  // RUNTIME_VM_WEAK_TABLE_H_
diff --git a/runtime/vm/zone.cc b/runtime/vm/zone.cc
index ac79f35..45314dc 100644
--- a/runtime/vm/zone.cc
+++ b/runtime/vm/zone.cc
@@ -59,7 +59,7 @@
   ASSERT(size >= 0);
   Segment* result = reinterpret_cast<Segment*>(malloc(size));
   if (result == NULL) {
-    FATAL("Out of memory.\n");
+    OUT_OF_MEMORY();
   }
   ASSERT(Utils::IsAligned(result->start(), Zone::kAlignment));
 #ifdef DEBUG
@@ -107,7 +107,7 @@
     Segment::DeleteSegmentList(large_segments_);
   }
 
-  // Reset zone state.
+// Reset zone state.
 #ifdef DEBUG
   memset(initial_buffer_.pointer(), kZapDeletedByte, initial_buffer_.size());
 #endif
@@ -147,11 +147,11 @@
   // there isn't enough room in the Zone to satisfy the request.
   ASSERT(Utils::IsAligned(size, kAlignment));
   intptr_t free_size = (limit_ - position_);
-  ASSERT(free_size <  size);
+  ASSERT(free_size < size);
 
   // First check to see if we should just chain it as a large segment.
-  intptr_t max_size = Utils::RoundDown(kSegmentSize - sizeof(Segment),
-                                       kAlignment);
+  intptr_t max_size =
+      Utils::RoundDown(kSegmentSize - sizeof(Segment), kAlignment);
   ASSERT(max_size > 0);
   if (size > max_size) {
     return AllocateLargeSegment(size);
@@ -175,7 +175,7 @@
   // there isn't enough room in the Zone to satisfy the request.
   ASSERT(Utils::IsAligned(size, kAlignment));
   intptr_t free_size = (limit_ - position_);
-  ASSERT(free_size <  size);
+  ASSERT(free_size < size);
 
   // Create a new large segment and chain it up.
   ASSERT(Utils::IsAligned(sizeof(Segment), kAlignment));
@@ -230,7 +230,8 @@
   for (Segment* s = large_segments_; s != NULL; s = s->next()) {
     size += s->size();
   }
-  OS::PrintErr("***   Zone(0x%" Px ") size in bytes,"
+  OS::PrintErr("***   Zone(0x%" Px
+               ") size in bytes,"
                " Total = %" Pd " Large Segments = %" Pd "\n",
                reinterpret_cast<intptr_t>(this), SizeInBytes(), size);
 }
diff --git a/runtime/vm/zone.h b/runtime/vm/zone.h
index 0d274ad..4e2e8a9 100644
--- a/runtime/vm/zone.h
+++ b/runtime/vm/zone.h
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-#ifndef VM_ZONE_H_
-#define VM_ZONE_H_
+#ifndef RUNTIME_VM_ZONE_H_
+#define RUNTIME_VM_ZONE_H_
 
 #include "platform/utils.h"
 #include "vm/allocation.h"
@@ -98,9 +98,7 @@
   uword AllocateLargeSegment(intptr_t size);
 
   // Insert zone into zone chain, after current_zone.
-  void Link(Zone* current_zone) {
-    previous_ = current_zone;
-  }
+  void Link(Zone* current_zone) { previous_ = current_zone; }
 
   // Delete all objects and free all memory allocated in the zone.
   void DeleteAll();
@@ -156,9 +154,9 @@
 
   friend class StackZone;
   friend class ApiZone;
-  template<typename T, typename B, typename Allocator>
+  template <typename T, typename B, typename Allocator>
   friend class BaseGrowableArray;
-  template<typename T, typename B, typename Allocator>
+  template <typename T, typename B, typename Allocator>
   friend class BaseDirectChainedHashMap;
   DISALLOW_COPY_AND_ASSIGN(Zone);
 };
@@ -181,8 +179,10 @@
  private:
   Zone zone_;
 
-  template<typename T> friend class GrowableArray;
-  template<typename T> friend class ZoneGrowableArray;
+  template <typename T>
+  friend class GrowableArray;
+  template <typename T>
+  friend class ZoneGrowableArray;
 
   DISALLOW_IMPLICIT_CONSTRUCTORS(StackZone);
 };
@@ -251,12 +251,11 @@
   ElementType* new_data = Alloc<ElementType>(new_len);
   if (old_data != 0) {
     memmove(reinterpret_cast<void*>(new_data),
-            reinterpret_cast<void*>(old_data),
-            old_len * kElementSize);
+            reinterpret_cast<void*>(old_data), old_len * kElementSize);
   }
   return new_data;
 }
 
 }  // namespace dart
 
-#endif  // VM_ZONE_H_
+#endif  // RUNTIME_VM_ZONE_H_
diff --git a/runtime/vm/zone_test.cc b/runtime/vm/zone_test.cc
index 9ddf276..4cb9231 100644
--- a/runtime/vm/zone_test.cc
+++ b/runtime/vm/zone_test.cc
@@ -14,8 +14,8 @@
 #if defined(DEBUG)
   FLAG_trace_zones = true;
 #endif
-  Dart_CreateIsolate(
-      NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL, NULL);
+  Dart_CreateIsolate(NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL,
+                     NULL);
   Thread* thread = Thread::Current();
   EXPECT(thread->zone() == NULL);
   {
@@ -46,8 +46,8 @@
 
     // Test corner cases of kSegmentSize.
     uint8_t* buffer = NULL;
-    buffer = reinterpret_cast<uint8_t*>(
-        zone->AllocUnsafe(kSegmentSize - kWordSize));
+    buffer =
+        reinterpret_cast<uint8_t*>(zone->AllocUnsafe(kSegmentSize - kWordSize));
     EXPECT(buffer != NULL);
     buffer[(kSegmentSize - kWordSize) - 1] = 0;
     allocated_size += (kSegmentSize - kWordSize);
@@ -60,8 +60,8 @@
     allocated_size += (kSegmentSize - (2 * kWordSize));
     EXPECT_LE(allocated_size, zone->SizeInBytes());
 
-    buffer = reinterpret_cast<uint8_t*>(
-        zone->AllocUnsafe(kSegmentSize + kWordSize));
+    buffer =
+        reinterpret_cast<uint8_t*>(zone->AllocUnsafe(kSegmentSize + kWordSize));
     EXPECT(buffer != NULL);
     buffer[(kSegmentSize + kWordSize) - 1] = 0;
     allocated_size += (kSegmentSize + kWordSize);
@@ -76,8 +76,8 @@
 #if defined(DEBUG)
   FLAG_trace_zones = true;
 #endif
-  Dart_CreateIsolate(
-      NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL, NULL);
+  Dart_CreateIsolate(NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL,
+                     NULL);
   Thread* thread = Thread::Current();
   EXPECT(thread->zone() == NULL);
   {
@@ -100,8 +100,8 @@
 #if defined(DEBUG)
   FLAG_trace_zones = true;
 #endif
-  Dart_CreateIsolate(
-      NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL, NULL);
+  Dart_CreateIsolate(NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL,
+                     NULL);
   Thread* thread = Thread::Current();
   EXPECT(thread->zone() == NULL);
   {
@@ -119,16 +119,16 @@
 #if defined(DEBUG)
   FLAG_trace_zones = true;
 #endif
-  Dart_CreateIsolate(
-      NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL, NULL);
+  Dart_CreateIsolate(NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL,
+                     NULL);
   Thread* thread = Thread::Current();
   EXPECT(thread->zone() == NULL);
   static int marker;
 
   class SimpleZoneObject : public ZoneAllocated {
    public:
-    SimpleZoneObject() : slot(marker++) { }
-    virtual ~SimpleZoneObject() { }
+    SimpleZoneObject() : slot(marker++) {}
+    virtual ~SimpleZoneObject() {}
     virtual int GetSlot() { return slot; }
     int slot;
   };
diff --git a/samples/sample_extension/test/sample_extension_app_snapshot_test.dart b/samples/sample_extension/test/sample_extension_app_snapshot_test.dart
new file mode 100644
index 0000000..04193c9
--- /dev/null
+++ b/samples/sample_extension/test/sample_extension_app_snapshot_test.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+//
+// Dart test program for testing native extensions.
+
+import 'sample_extension_test_helper.dart';
+
+void main() {
+  testNativeExtensions("app-jit");
+}
diff --git a/samples/sample_extension/test/sample_extension_script_snapshot_test.dart b/samples/sample_extension/test/sample_extension_script_snapshot_test.dart
new file mode 100644
index 0000000..31b9e03
--- /dev/null
+++ b/samples/sample_extension/test/sample_extension_script_snapshot_test.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+//
+// Dart test program for testing native extensions.
+
+import 'sample_extension_test_helper.dart';
+
+void main() {
+  testNativeExtensions("script");
+}
diff --git a/samples/sample_extension/test/sample_extension_test.dart b/samples/sample_extension/test/sample_extension_test.dart
index 9c0a42d..4311ff5 100644
--- a/samples/sample_extension/test/sample_extension_test.dart
+++ b/samples/sample_extension/test/sample_extension_test.dart
@@ -1,72 +1,11 @@
-// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 //
 // Dart test program for testing native extensions.
 
-import 'dart:async';
-import 'dart:io';
-import 'dart:isolate';
-
-import "package:expect/expect.dart";
-import "package:path/path.dart";
-
-Future copyFileToDirectory(String file, String directory) {
-  String src = file;
-  String dst = directory;
-  switch (Platform.operatingSystem) {
-    case 'linux':
-    case 'macos':
-      return Process.run('cp', [src, dst]);
-    case 'windows':
-      return Process.run('cmd.exe', ['/C', 'copy $src $dst']);
-    default:
-      Expect.fail('Unknown operating system ${Platform.operatingSystem}');
-  }
-}
-
-String getNativeLibraryPath(String buildDirectory) {
-  switch (Platform.operatingSystem) {
-    case 'linux':
-      return join(buildDirectory, 'lib.target', 'libsample_extension.so');
-    case 'macos':
-      return join(buildDirectory, 'libsample_extension.dylib');
-    case 'windows':
-      return join(buildDirectory, 'sample_extension.dll');
-    default:
-      Expect.fail('Unknown operating system ${Platform.operatingSystem}');
-  }
-}
+import 'sample_extension_test_helper.dart';
 
 void main() {
-  String buildDirectory = dirname(Platform.executable);
-  Directory tempDirectory =
-      Directory.systemTemp.createTempSync('sample_extension_');
-  String testDirectory = tempDirectory.path;
-  String sourceDirectory = Platform.script.resolve('..').toFilePath();
-
-  // Copy sample_extension shared library, sample_extension dart files and
-  // sample_extension tests to the temporary test directory.
-  copyFileToDirectory(getNativeLibraryPath(buildDirectory), testDirectory)
-  .then((_) => Future.forEach(['sample_synchronous_extension.dart',
-                               'sample_asynchronous_extension.dart',
-                               'test_sample_synchronous_extension.dart',
-                               'test_sample_asynchronous_extension.dart'],
-    (file) => copyFileToDirectory(join(sourceDirectory, file), testDirectory)
-  ))
-
-  .then((_) => Future.forEach(['test_sample_synchronous_extension.dart',
-                               'test_sample_asynchronous_extension.dart'],
-    (test) => Process.run(Platform.executable, [join(testDirectory, test)])
-    .then((ProcessResult result) {
-      if (result.exitCode != 0) {
-        print('Failing test: ${join(sourceDirectory, test)}');
-        print('Failing process stdout: ${result.stdout}');
-        print('Failing process stderr: ${result.stderr}');
-        print('End failing process stderr');
-        Expect.fail('Test failed with exit code ${result.exitCode}');
-      }
-    })
-  ))
-  .whenComplete(() => tempDirectory.deleteSync(recursive: true));
+  testNativeExtensions(null /* no snapshot */);
 }
diff --git a/samples/sample_extension/test/sample_extension_test_helper.dart b/samples/sample_extension/test/sample_extension_test_helper.dart
new file mode 100644
index 0000000..e1c1faa
--- /dev/null
+++ b/samples/sample_extension/test/sample_extension_test_helper.dart
@@ -0,0 +1,90 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+//
+// Dart test program for testing native extensions.
+
+import 'dart:async';
+import 'dart:io';
+import 'dart:isolate';
+
+import "package:expect/expect.dart";
+import "package:path/path.dart";
+
+Future copyFileToDirectory(String file, String directory) {
+  String src = file;
+  String dst = directory;
+  switch (Platform.operatingSystem) {
+    case 'linux':
+    case 'macos':
+      return Process.run('cp', [src, dst]);
+    case 'windows':
+      return Process.run('cmd.exe', ['/C', 'copy $src $dst']);
+    default:
+      Expect.fail('Unknown operating system ${Platform.operatingSystem}');
+  }
+}
+
+String getNativeLibraryPath(String buildDirectory) {
+  switch (Platform.operatingSystem) {
+    case 'linux':
+      return join(buildDirectory, 'lib.target', 'libsample_extension.so');
+    case 'macos':
+      return join(buildDirectory, 'libsample_extension.dylib');
+    case 'windows':
+      return join(buildDirectory, 'sample_extension.dll');
+    default:
+      Expect.fail('Unknown operating system ${Platform.operatingSystem}');
+  }
+}
+
+Future run(String program, List arguments) async {
+  print("+ $program ${arguments.join(' ')}");
+  ProcessResult result = await Process.run(program, arguments);
+  if (result.exitCode != 0) {
+    print('Failing process stdout: ${result.stdout}');
+    print('Failing process stderr: ${result.stderr}');
+    print('End failing process stderr');
+    Expect.fail('Test failed with exit code ${result.exitCode}');
+  }
+}
+
+Future testNativeExtensions(String snapshotKind) async {
+  String buildDirectory = dirname(Platform.executable);
+  Directory tempDirectory =
+      Directory.systemTemp.createTempSync('sample_extension_');
+  try {
+    String testDirectory = tempDirectory.path;
+    String sourceDirectory = Platform.script.resolve('..').toFilePath();
+
+    // Copy sample_extension shared library, sample_extension dart files and
+    // sample_extension tests to the temporary test directory.
+    await copyFileToDirectory(getNativeLibraryPath(buildDirectory),
+                              testDirectory);
+    for (var file in ['sample_synchronous_extension.dart',
+                      'sample_asynchronous_extension.dart',
+                      'test_sample_synchronous_extension.dart',
+                      'test_sample_asynchronous_extension.dart']) {
+      await copyFileToDirectory(join(sourceDirectory, file), testDirectory);
+    }
+
+    for (var test in ['test_sample_synchronous_extension.dart',
+                      'test_sample_asynchronous_extension.dart']) {
+      String script = join(testDirectory, test);
+      String snapshot;
+      if (snapshotKind == null) {
+        snapshot = script;
+      } else {
+        snapshot = join(testDirectory, "$test.snapshot");
+        await run(Platform.executable,
+                  ['--snapshot=$snapshot',
+                   '--snapshot-kind=$snapshotKind',
+                   script]);
+      }
+
+      await run(Platform.executable, [snapshot]);
+    }
+  } finally {
+    await tempDirectory.deleteSync(recursive: true);
+  }
+}
diff --git a/samples/samples.status b/samples/samples.status
index c01c0d9..2b249fd 100644
--- a/samples/samples.status
+++ b/samples/samples.status
@@ -14,15 +14,14 @@
 [ $compiler == dart2js && $cps_ir && $checked ]
 sample_extension: Crash # Unable to compile UnsupportedError.message.
 
-
 [ $compiler == dart2analyzer ]
 build_dart: Skip
 
 [ $arch == arm ]
-sample_extension/test/sample_extension_test: Skip # Issue 14705
+sample_extension/test/*: Skip # Issue 14705
 
-[ $arch == simarm64 ]
-*: Skip
+[ $compiler == precompiler ]
+sample_extension/test/*: Skip # These tests attempt to spawn another script using the precompiled runtime.
 
-[ $noopt || $runtime == dart_precompiled || $runtime == dart_app ]
-sample_extension: Skip # Platform.executable
+[ $runtime == dart_app ]
+sample_extension/test/*: Skip # Shared use of a temp directory
diff --git a/sdk/lib/_internal/js_runtime/lib/collection_patch.dart b/sdk/lib/_internal/js_runtime/lib/collection_patch.dart
index beb67f2..0d61257 100644
--- a/sdk/lib/_internal/js_runtime/lib/collection_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/collection_patch.dart
@@ -431,8 +431,7 @@
   String toString() => Maps.mapToString(this);
 }
 
-class _HashMapKeyIterable<E> extends Iterable<E>
-                             implements EfficientLength {
+class _HashMapKeyIterable<E> extends EfficientLengthIterable<E> {
   final _map;
   _HashMapKeyIterable(this._map);
 
@@ -664,8 +663,7 @@
   String toString() => Maps.mapToString(this);
 }
 
-class _Es6MapIterable<E> extends Iterable<E>
-                         implements EfficientLength {
+class _Es6MapIterable<E> extends EfficientLengthIterable<E> {
   final _map;
   final bool _isKeys;
 
diff --git a/sdk/lib/_internal/js_runtime/lib/core_patch.dart b/sdk/lib/_internal/js_runtime/lib/core_patch.dart
index 5d84791..5c5ec25 100644
--- a/sdk/lib/_internal/js_runtime/lib/core_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/core_patch.dart
@@ -464,6 +464,7 @@
 
 @patch
 class RegExp {
+  @NoInline()
   @patch
   factory RegExp(String source,
                        {bool multiLine: false,
diff --git a/sdk/lib/_internal/js_runtime/lib/developer_patch.dart b/sdk/lib/_internal/js_runtime/lib/developer_patch.dart
index b1073b2..541658b 100644
--- a/sdk/lib/_internal/js_runtime/lib/developer_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/developer_patch.dart
@@ -105,3 +105,28 @@
                       String argumentsAsJson) {
  // TODO.
 }
+
+@patch
+int _getServiceMajorVersion() {
+  return 0;
+}
+
+@patch
+int _getServiceMinorVersion() {
+  return 0;
+}
+
+@patch
+void _getServerInfo(SendPort sendPort) {
+  sendPort.send(null);
+}
+
+@patch
+void _webServerControl(SendPort sendPort, bool enable) {
+  sendPort.send(null);
+}
+
+@patch
+String _getIsolateIDFromSendPort(SendPort sendPort) {
+  return null;
+}
\ No newline at end of file
diff --git a/sdk/lib/_internal/js_runtime/lib/interceptors.dart b/sdk/lib/_internal/js_runtime/lib/interceptors.dart
index 23025ad..7246c40 100644
--- a/sdk/lib/_internal/js_runtime/lib/interceptors.dart
+++ b/sdk/lib/_internal/js_runtime/lib/interceptors.dart
@@ -168,24 +168,69 @@
     }
   }
 
-  var interceptor = lookupAndCacheInterceptor(object);
-  if (interceptor == null) {
-    // JavaScript Objects created via object literals and `Object.create(null)`
-    // are 'plain' Objects.  This test could be simplified and the dispatch path
-    // be faster if Object.prototype was pre-patched with a non-leaf dispatch
-    // record.
-    if (JS('bool', 'typeof # == "function"', object)) {
-      return JS_INTERCEPTOR_CONSTANT(JavaScriptFunction);
-    }
-    var proto = JS('', 'Object.getPrototypeOf(#)', object);
-    if (JS('bool', '# == null || # === Object.prototype', proto, proto)) {
-      return JS_INTERCEPTOR_CONSTANT(PlainJavaScriptObject);
-    } else {
-      return JS_INTERCEPTOR_CONSTANT(UnknownJavaScriptObject);
-    }
-  }
+  // Check for cached UnknownJavaScriptObject. This avoids doing the slow
+  // dispatch-record based lookup for repeated js-interop classes.
+  var constructor = JS('', '#.constructor', object);
+  var interceptor = lookupInterceptorByConstructor(constructor);
+  if (interceptor != null) return interceptor;
 
-  return interceptor;
+  // This takes care of dispatch-record based caching, but not constructor based
+  // caching of [UnknownJavaScriptObject]s.
+  interceptor = lookupAndCacheInterceptor(object);
+  if (interceptor != null) return interceptor;
+
+  // JavaScript Objects created via object literals and `Object.create(null)`
+  // are 'plain' Objects.  This test could be simplified and the dispatch path
+  // be faster if Object.prototype was pre-patched with a non-leaf dispatch
+  // record.
+  if (JS('bool', 'typeof # == "function"', object)) {
+    interceptor = JS_INTERCEPTOR_CONSTANT(JavaScriptFunction);
+    // TODO(sra): Investigate caching on `Function`. It might be impossible if
+    // some HTML embedded objects on some browsers are (still) JS functions.
+    return interceptor;
+  }
+  var proto = JS('', 'Object.getPrototypeOf(#)', object);
+  if (JS('bool', '# == null', proto)) {
+    // Nowhere to cache output.
+    return JS_INTERCEPTOR_CONSTANT(PlainJavaScriptObject);
+  }
+  interceptor = JS_INTERCEPTOR_CONSTANT(UnknownJavaScriptObject);
+  if (JS('bool', '# === Object.prototype', proto)) {
+    interceptor = JS_INTERCEPTOR_CONSTANT(PlainJavaScriptObject);
+    // TODO(sra): Investigate caching on 'Object'. It might be impossible if
+    // some native class is plain Object (e.g. like Firefox's ImageData).
+    return interceptor;
+  }
+  if (JS('bool', 'typeof # == "function"', constructor)) {
+    cacheInterceptorOnConstructor(constructor, interceptor);
+    return interceptor;
+  }
+  return JS_INTERCEPTOR_CONSTANT(UnknownJavaScriptObject);
+}
+
+
+// A JS String or Symbol.
+final JS_INTEROP_INTERCEPTOR_TAG = getIsolateAffinityTag(r'_$dart_js');
+
+lookupInterceptorByConstructor(constructor) {
+  return constructor == null
+      ? null
+      : JS('', '#[#]', constructor, JS_INTEROP_INTERCEPTOR_TAG);
+}
+
+void cacheInterceptorOnConstructor(constructor, interceptor) {
+  defineProperty(constructor, JS_INTEROP_INTERCEPTOR_TAG, interceptor);
+}
+
+var constructorToInterceptor =
+    JS('', 'typeof(self.WeakMap) == "undefined" ? new Map() : new WeakMap()');
+
+XlookupInterceptorByConstructor(constructor) {
+  return JS('', '#.get(#)', constructorToInterceptor, constructor);
+}
+
+void XcacheInterceptorOnConstructor(constructor, interceptor) {
+  JS('', '#.set(#, #)', constructorToInterceptor, constructor, interceptor);
 }
 
 /**
diff --git a/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart b/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart
index c181c6d..18da81d 100644
--- a/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart
@@ -751,6 +751,14 @@
 
   static String thisScript = computeThisScript();
 
+  /// Returns the base path added to Uri.base to resolve `package:` Uris.
+  ///
+  /// This is used by `Isolate.resolvePackageUri` to load resources. The default
+  /// value is `packages/` but users can override this by using the
+  /// `defaultPackagesBase` hook.
+  static String get packagesBase =>
+      JS('String', r'self.defaultPackagesBase || "packages/"');
+
   /// Associates an ID with a native worker object.
   static final Expando<int> workerIds = new Expando<int>();
 
diff --git a/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart b/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart
index 79931ba..637943b 100644
--- a/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart
@@ -10,6 +10,8 @@
                                    ReceivePortImpl,
                                    RawReceivePortImpl;
 
+typedef _UnaryFunction(arg);
+
 @patch
 class Isolate {
   static final _currentIsolateCache = IsolateNatives.currentIsolate;
@@ -29,9 +31,12 @@
     throw new UnsupportedError("Isolate.packageConfig");
   }
 
+  static Uri _packageBase = Uri.base.resolve(IsolateNatives.packagesBase);
+
   @patch
-  static Future<Uri> resolvePackageUri(Uri packageUri) {
-    throw new UnsupportedError("Isolate.resolvePackageUri");
+  static Future<Uri> resolvePackageUri(Uri packageUri) async {
+    if (packageUri.scheme != 'package') return packageUri;
+    return _packageBase.resolveUri(packageUri.replace(scheme: ''));
   }
 
   @patch
@@ -42,6 +47,11 @@
                       (onExit != null) ||
                       (onError != null);
     try {
+      // Check for the type of `entryPoint` on the spawning isolate to make
+      // error-handling easier.
+      if (entryPoint is! _UnaryFunction) {
+        throw new ArgumentError(entryPoint);
+      }
       // TODO: Consider passing the errorsAreFatal/onExit/onError values
       //       as arguments to the internal spawnUri instead of setting
       //       them after the isolate has been created.
diff --git a/sdk/lib/_internal/js_runtime/lib/js_array.dart b/sdk/lib/_internal/js_runtime/lib/js_array.dart
index 004127b..447c74928 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_array.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_array.dart
@@ -146,7 +146,7 @@
   void insertAll(int index, Iterable<E> iterable) {
     checkGrowable('insertAll');
     RangeError.checkValueInInterval(index, 0, this.length, "index");
-    if (iterable is! EfficientLength) {
+    if (iterable is! EfficientLengthIterable) {
       iterable = iterable.toList();
     }
     int insertionLength = iterable.length;
@@ -463,7 +463,7 @@
   void replaceRange(int start, int end, Iterable<E> replacement) {
     checkGrowable('replace range');
     RangeError.checkValidRange(start, end, this.length);
-    if (replacement is! EfficientLength) {
+    if (replacement is! EfficientLengthIterable) {
       replacement = replacement.toList();
     }
     int removeLength = end - start;
diff --git a/sdk/lib/_internal/js_runtime/lib/js_helper.dart b/sdk/lib/_internal/js_runtime/lib/js_helper.dart
index 011e45e..9368930 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_helper.dart
@@ -56,7 +56,7 @@
 import 'dart:_interceptors';
 import 'dart:_internal' as _symbol_dev;
 import 'dart:_internal' show
-    EfficientLength,
+    EfficientLengthIterable,
     MappedIterable,
     IterableElementError;
 
@@ -1036,7 +1036,8 @@
   }
 
   static String flattenString(String str) {
-    return JS('String', "#.charCodeAt(0) == 0 ? # : #", str, str, str);
+    return JS('returns:String;depends:none;effects:none;throws:never;gvn:true',
+              "#.charCodeAt(0) == 0 ? # : #", str, str, str);
   }
 
   static String getTimeZoneName(DateTime receiver) {
diff --git a/sdk/lib/_internal/js_runtime/lib/js_number.dart b/sdk/lib/_internal/js_runtime/lib/js_number.dart
index 1f9748c..7513b1e 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_number.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_number.dart
@@ -56,7 +56,7 @@
     return JS('num', r'# % #', this, b);
   }
 
-  num abs() => JS('returns:num;effects:none;depends:none;throws:never',
+  num abs() => JS('returns:num;effects:none;depends:none;throws:never;gvn:true',
       r'Math.abs(#)', this);
 
   num get sign => this > 0 ? 1 : this < 0 ? -1 : this;
diff --git a/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart b/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart
index ada768f..98fad05 100644
--- a/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart
+++ b/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart
@@ -380,8 +380,7 @@
   LinkedHashMapCell(this.hashMapCellKey, this.hashMapCellValue);
 }
 
-class LinkedHashMapKeyIterable<E> extends Iterable<E>
-    implements EfficientLength {
+class LinkedHashMapKeyIterable<E> extends EfficientLengthIterable<E> {
   final dynamic/*=JsLinkedHashMap<E, dynamic>*/ _map;
   LinkedHashMapKeyIterable(this._map);
 
diff --git a/sdk/lib/_internal/js_runtime/lib/native_helper.dart b/sdk/lib/_internal/js_runtime/lib/native_helper.dart
index 30d3ba7..d3ef5f2 100644
--- a/sdk/lib/_internal/js_runtime/lib/native_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/native_helper.dart
@@ -449,13 +449,9 @@
 
 const _baseHooks = const JS_CONST(r'''
 function() {
-  function typeNameInChrome(o) {
-    var constructor = o.constructor;
-    if (constructor) {
-      var name = constructor.name;
-      if (name) return name;
-    }
-    var s = Object.prototype.toString.call(o);
+  var toStringFunction = Object.prototype.toString;
+  function getTag(o) {
+    var s = toStringFunction.call(o);
     return s.substring(8, s.length - 1);
   }
   function getUnknownTag(object, tag) {
@@ -463,7 +459,7 @@
     // here allows [getUnknownTag] to be tested on d8.
     if (/^HTML[A-Z].*Element$/.test(tag)) {
       // Check that it is not a simple JavaScript object.
-      var name = Object.prototype.toString.call(object);
+      var name = toStringFunction.call(object);
       if (name == "[object Object]") return null;
       return "HTMLElement";
     }
@@ -484,7 +480,7 @@
   var isBrowser = typeof navigator == "object";
 
   return {
-    getTag: typeNameInChrome,
+    getTag: getTag,
     getUnknownTag: isBrowser ? getUnknownTagGenericBrowser : getUnknownTag,
     prototypeForTag: prototypeForTag,
     discriminator: discriminator };
@@ -501,30 +497,6 @@
  */
 const _constructorNameFallback = const JS_CONST(r'''
 function getTagFallback(o) {
-  var constructor = o.constructor;
-  if (typeof constructor == "function") {
-    var name = constructor.name;
-    // If the name is a non-empty string, we use that as the type name of this
-    // object.  There are various cases where that does not work, so we have to
-    // detect them and fall through to the toString() based implementation.
-
-    if (typeof name == "string" &&
-
-        // Sometimes the string is empty.  This test also catches minified
-        // shadow dom polyfil wrapper for Window on Firefox where the faked
-        // constructor name does not 'stick'.  The shortest real DOM object
-        // names have three characters (e.g. URL, CSS).
-        name.length > 2 &&
-
-        // On Firefox we often get "Object" as the constructor name, even for
-        // more specialized DOM objects.
-        name !== "Object" &&
-
-        // This can happen in Opera.
-        name !== "Function.prototype") {
-      return name;
-    }
-  }
   var s = Object.prototype.toString.call(o);
   return s.substring(8, s.length - 1);
 }''');
diff --git a/sdk/lib/_internal/js_runtime/lib/regexp_helper.dart b/sdk/lib/_internal/js_runtime/lib/regexp_helper.dart
index 35a42d1c..f756868 100644
--- a/sdk/lib/_internal/js_runtime/lib/regexp_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/regexp_helper.dart
@@ -18,7 +18,7 @@
  */
 regExpGetGlobalNative(JSSyntaxRegExp regexp) {
   var nativeRegexp = regexp._nativeGlobalVersion;
-  JS("void", "#.lastIndex = 0", nativeRegexp);
+  JS('void', '#.lastIndex = 0', nativeRegexp);
   return nativeRegexp;
 }
 
@@ -34,7 +34,7 @@
  */
 int regExpCaptureCount(JSSyntaxRegExp regexp) {
   var nativeAnchoredRegExp = regexp._nativeAnchoredVersion;
-  var match = JS('JSExtendableArray', "#.exec('')", nativeAnchoredRegExp);
+  var match = JS('JSExtendableArray', '#.exec("")', nativeAnchoredRegExp);
   // The native-anchored regexp always have one capture more than the original,
   // and always matches the empty string.
   return match.length - 2;
@@ -46,7 +46,7 @@
   var _nativeGlobalRegExp;
   var _nativeAnchoredRegExp;
 
-  String toString() => "RegExp/$pattern/";
+  String toString() => 'RegExp/$pattern/';
 
   JSSyntaxRegExp(String source,
                  { bool multiLine: false,
@@ -70,14 +70,14 @@
     // that it tries, and you can see if the original regexp matched, or it
     // was the added zero-width match that matched, by looking at the last
     // capture. If it is a String, the match participated, otherwise it didn't.
-    return _nativeAnchoredRegExp = makeNative("$pattern|()",
+    return _nativeAnchoredRegExp = makeNative('$pattern|()',
                                               _isMultiLine,
                                               _isCaseSensitive,
                                               true);
   }
 
-  bool get _isMultiLine => JS("bool", "#.multiline", _nativeRegExp);
-  bool get _isCaseSensitive => JS("bool", "!#.ignoreCase", _nativeRegExp);
+  bool get _isMultiLine => JS('bool', '#.multiline', _nativeRegExp);
+  bool get _isCaseSensitive => JS('bool', '!#.ignoreCase', _nativeRegExp);
 
   static makeNative(
       String source, bool multiLine, bool caseSensitive, bool global) {
@@ -135,21 +135,20 @@
 
   Match _execGlobal(String string, int start) {
     Object regexp = _nativeGlobalVersion;
-    JS("void", "#.lastIndex = #", regexp, start);
-    List match = JS("JSExtendableArray|Null", "#.exec(#)", regexp, string);
+    JS('void', '#.lastIndex = #', regexp, start);
+    List match = JS('JSExtendableArray|Null', '#.exec(#)', regexp, string);
     if (match == null) return null;
     return new _MatchImplementation(this, match);
   }
 
   Match _execAnchored(String string, int start) {
     Object regexp = _nativeAnchoredVersion;
-    JS("void", "#.lastIndex = #", regexp, start);
-    List match = JS("JSExtendableArray|Null", "#.exec(#)", regexp, string);
+    JS('void', '#.lastIndex = #', regexp, start);
+    List match = JS('JSExtendableArray|Null', '#.exec(#)', regexp, string);
     if (match == null) return null;
     // If the last capture group participated, the original regexp did not
     // match at the start position.
-    if (match[match.length - 1] != null) return null;
-    match.length -= 1;
+    if (match.removeLast() != null) return null;
     return new _MatchImplementation(this, match);
   }
 
@@ -167,17 +166,23 @@
 class _MatchImplementation implements Match {
   final Pattern pattern;
   // Contains a JS RegExp match object.
-  // It is an Array of String values with extra "index" and "input" properties.
+  // It is an Array of String values with extra 'index' and 'input' properties.
   final List<String> _match;
 
   _MatchImplementation(this.pattern, this._match) {
-    assert(JS("var", "#.input", _match) is String);
-    assert(JS("var", "#.index", _match) is int);
+    assert(JS('var', '#.input', _match) is String);
+    assert(JS('var', '#.index', _match) is int);
   }
 
-  String get input => JS("String", "#.input", _match);
-  int get start => JS("int", "#.index", _match);
-  int get end => start + _match[0].length;
+  String get input => JS('String', '#.input', _match);
+
+  int get start =>
+      JS('returns:int;depends:none;effects:none;gvn:true', '#.index', _match);
+
+  int get end =>
+      start +
+      JS('returns:int;depends:none;effects:none;gvn:true', '#[0].length',
+          _match);
 
   String group(int index) => _match[index];
   String operator [](int index) => group(index);
diff --git a/sdk/lib/async/stream.dart b/sdk/lib/async/stream.dart
index 9a9487a..f114f8d 100644
--- a/sdk/lib/async/stream.dart
+++ b/sdk/lib/async/stream.dart
@@ -511,7 +511,7 @@
    * Creates a wrapper Stream that intercepts some errors from this stream.
    *
    * If this stream sends an error that matches [test], then it is intercepted
-   * by the [handle] function.
+   * by the [onError] function.
    *
    * The [onError] callback must be of type `void onError(error)` or
    * `void onError(error, StackTrace stackTrace)`. Depending on the function
@@ -519,10 +519,11 @@
    * trace. The stack trace argument might be `null` if the stream itself
    * received an error without stack trace.
    *
-   * An asynchronous error [:e:] is matched by a test function if [:test(e):]
-   * returns true. If [test] is omitted, every error is considered matching.
+   * An asynchronous error `error` is matched by a test function if
+   *`test(error)` returns true. If [test] is omitted, every error is considered
+   * matching.
    *
-   * If the error is intercepted, the [handle] function can decide what to do
+   * If the error is intercepted, the [onError] function can decide what to do
    * with it. It can throw if it wants to raise a new (or the same) error,
    * or simply return to make the stream forget the error.
    *
@@ -902,23 +903,23 @@
       => listen(null, cancelOnError: true).asFuture/*<E>*/(futureValue);
 
   /**
-   * Provides at most the first [n] values of this stream.
+   * Provides at most the first [count] data events of this stream.
    *
-   * Forwards the first [n] data events of this stream, and all error
-   * events, to the returned stream, and ends with a done event.
+   * Forwards all events of this stream to the returned stream
+   * until [count] data events have been forwarded or this stream ends,
+   * then ends the returned stream with a done event.
    *
-   * If this stream produces fewer than [count] values before it's done,
+   * If this stream produces fewer than [count] data events before it's done,
    * so will the returned stream.
    *
-   * Stops listening to the stream after the first [n] elements have been
-   * received.
+   * Starts listening to this stream when the returned stream is listened to
+   * and stops listening when the first [count] data events have been received.
    *
-   * Internally the method cancels its subscription after these elements. This
-   * means that single-subscription (non-broadcast) streams are closed and
-   * cannot be reused after a call to this method.
+   * This means that if this is a single-subscription (non-broadcast) streams
+   * it cannot be reused after the returned stream has been listened to.
    *
-   * The returned stream is a broadcast stream if this stream is.
-   * For a broadcast stream, the events are only counted from the time
+   * If this is a broadcast stream, the returned stream is a broadcast stream.
+   * In that case, the events are only counted from the time
    * the returned stream is listened to.
    */
   Stream<T> take(int count) {
@@ -929,7 +930,7 @@
    * Forwards data events while [test] is successful.
    *
    * The returned stream provides the same events as this stream as long
-   * as [test] returns [:true:] for the event data. The stream is done
+   * as [test] returns `true` for the event data. The stream is done
    * when either this stream is done, or when this stream first provides
    * a value that [test] doesn't accept.
    *
diff --git a/sdk/lib/async/stream_pipe.dart b/sdk/lib/async/stream_pipe.dart
index d26b0c5..643d142 100644
--- a/sdk/lib/async/stream_pipe.dart
+++ b/sdk/lib/async/stream_pipe.dart
@@ -326,6 +326,10 @@
       Function onError,
       void onDone(),
       bool cancelOnError) {
+    if (_count == 0) {
+      _source.listen(null).cancel();
+      return new _DoneStreamSubscription<T>(onDone);
+    }
     return new _StateStreamSubscription<T>(
         this, onData, onError, onDone, cancelOnError, _count);
   }
diff --git a/sdk/lib/collection/iterable.dart b/sdk/lib/collection/iterable.dart
index 26ccb5c..edfce85 100644
--- a/sdk/lib/collection/iterable.dart
+++ b/sdk/lib/collection/iterable.dart
@@ -91,7 +91,7 @@
   Set<E> toSet() => new Set<E>.from(this);
 
   int get length {
-    assert(this is! EfficientLength);
+    assert(this is! EfficientLengthIterable);
     int count = 0;
     Iterator it = iterator;
     while (it.moveNext()) {
diff --git a/sdk/lib/collection/list.dart b/sdk/lib/collection/list.dart
index 7e6dbd3a..8b6713a 100644
--- a/sdk/lib/collection/list.dart
+++ b/sdk/lib/collection/list.dart
@@ -395,7 +395,7 @@
 
   void replaceRange(int start, int end, Iterable<E> newContents) {
     RangeError.checkValidRange(start, end, this.length);
-    if (newContents is! EfficientLength) {
+    if (newContents is! EfficientLengthIterable) {
       newContents = newContents.toList();
     }
     int removeLength = end - start;
@@ -482,7 +482,7 @@
 
   void insertAll(int index, Iterable<E> iterable) {
     RangeError.checkValueInInterval(index, 0, length, "index");
-    if (iterable is! EfficientLength || identical(iterable, this)) {
+    if (iterable is! EfficientLengthIterable || identical(iterable, this)) {
       iterable = iterable.toList();
     }
     int insertionLength = iterable.length;
diff --git a/sdk/lib/collection/maps.dart b/sdk/lib/collection/maps.dart
index 7871b87..d5b8621 100644
--- a/sdk/lib/collection/maps.dart
+++ b/sdk/lib/collection/maps.dart
@@ -111,8 +111,7 @@
  * It accesses the values by iterating over the keys of the map, and using the
  * map's `operator[]` to lookup the keys.
  */
-class _MapBaseValueIterable<K, V> extends Iterable<V>
-                                  implements EfficientLength {
+class _MapBaseValueIterable<K, V> extends EfficientLengthIterable<V> {
   final Map<K, V> _map;
   _MapBaseValueIterable(this._map);
 
diff --git a/sdk/lib/collection/queue.dart b/sdk/lib/collection/queue.dart
index 386cf50..2e6a24a 100644
--- a/sdk/lib/collection/queue.dart
+++ b/sdk/lib/collection/queue.dart
@@ -17,7 +17,7 @@
  * This goes both for using the [iterator] directly, or for iterating an
  * `Iterable` returned by a method like [map] or [where].
  */
-abstract class Queue<E> implements Iterable<E>, EfficientLength {
+abstract class Queue<E> implements EfficientLengthIterable<E> {
 
   /**
    * Creates a queue.
@@ -487,7 +487,7 @@
       return queue;
     } else {
       int capacity = _INITIAL_CAPACITY;
-      if (elements is EfficientLength) {
+      if (elements is EfficientLengthIterable) {
         capacity = elements.length;
       }
       ListQueue<E> result = new ListQueue<E>(capacity);
diff --git a/sdk/lib/collection/splay_tree.dart b/sdk/lib/collection/splay_tree.dart
index 72a2f52..9a41ef3 100644
--- a/sdk/lib/collection/splay_tree.dart
+++ b/sdk/lib/collection/splay_tree.dart
@@ -607,8 +607,7 @@
   T _getValue(_SplayTreeNode<K> node);
 }
 
-class _SplayTreeKeyIterable<K> extends Iterable<K>
-                               implements EfficientLength {
+class _SplayTreeKeyIterable<K> extends EfficientLengthIterable<K> {
   _SplayTree<K, _SplayTreeNode<K>> _tree;
   _SplayTreeKeyIterable(this._tree);
   int get length => _tree._count;
@@ -624,8 +623,7 @@
   }
 }
 
-class _SplayTreeValueIterable<K, V> extends Iterable<V>
-                                    implements EfficientLength {
+class _SplayTreeValueIterable<K, V> extends EfficientLengthIterable<V> {
   SplayTreeMap<K, V> _map;
   _SplayTreeValueIterable(this._map);
   int get length => _map._count;
diff --git a/sdk/lib/convert/codec.dart b/sdk/lib/convert/codec.dart
index 3fc2d31..f4ff700 100644
--- a/sdk/lib/convert/codec.dart
+++ b/sdk/lib/convert/codec.dart
@@ -13,8 +13,6 @@
  *
  * Fused codecs generally attempt to optimize the operations and can be faster
  * than executing each step of an encoding separately.
- *
- * *Codecs are still experimental and are subject to change without notice.*
  */
 abstract class Codec<S, T> {
   const Codec();
@@ -62,8 +60,8 @@
    */
   // TODO(floitsch): use better example with line-splitter once that one is
   // in this library.
-  Codec<S, dynamic> fuse(Codec<T, dynamic> other) {
-    return new _FusedCodec<S, T, dynamic>(this, other);
+  Codec<S, dynamic/*=R*/> fuse/*<R>*/(Codec<T, dynamic/*=R*/> other) {
+    return new _FusedCodec<S, T, dynamic/*=R*/>(this, other);
   }
 
   /**
@@ -99,4 +97,4 @@
   Converter<S, T> get decoder => _codec.encoder;
 
   Codec<S, T> get inverted => _codec;
-}
\ No newline at end of file
+}
diff --git a/sdk/lib/convert/utf.dart b/sdk/lib/convert/utf.dart
index aeee9ef..86763cb 100644
--- a/sdk/lib/convert/utf.dart
+++ b/sdk/lib/convert/utf.dart
@@ -37,7 +37,7 @@
    * The optional [allowMalformed] argument defines how [decoder] (and [decode])
    * deal with invalid or unterminated character sequences.
    *
-   * If it is `true` (and not overriden at the method invocation) [decode] and
+   * If it is `true` (and not overridden at the method invocation) [decode] and
    * the [decoder] replace invalid (or unterminated) octet
    * sequences with the Unicode Replacement character `U+FFFD` (�). Otherwise
    * they throw a [FormatException].
diff --git a/sdk/lib/core/date_time.dart b/sdk/lib/core/date_time.dart
index b792ac2..0453704 100644
--- a/sdk/lib/core/date_time.dart
+++ b/sdk/lib/core/date_time.dart
@@ -572,7 +572,14 @@
    * Returns a new [DateTime] instance with [duration] added to [this].
    *
    *     DateTime today = new DateTime.now();
-   *     DateTime sixtyDaysFromNow = today.add(new Duration(days: 60));
+   *     DateTime fiftyDaysFromNow = today.add(new Duration(days: 50));
+   *
+   * Notice that the duration being added is actually 50 * 24 * 60 * 60
+   * seconds. If the resulting `DateTime` has a different daylight saving offset
+   * than `this`, then the result won't have the same time-of-day as `this`, and
+   * may not even hit the calendar date 50 days later.
+   *
+   * Be careful when working with dates in local time.
    */
   external DateTime add(Duration duration);
 
@@ -580,13 +587,14 @@
    * Returns a new [DateTime] instance with [duration] subtracted from [this].
    *
    *     DateTime today = new DateTime.now();
-   *     DateTime sixtyDaysAgo = today.subtract(new Duration(days: 30));
+   *     DateTime fiftyDaysAgo = today.subtract(new Duration(days: 50));
    *
-   * Notice that duration being subtracted is actually 30 * 24 * 60 * 60 seconds
-   * and if that crosses a daylight saving time change, the resulting `DateTime`
-   * won't have the same time of day as `today`, and may not actually hit the
-   * calendar date 30 days earlier. Be careful when working with dates in local
-   * time.
+   * Notice that the duration being subtracted is actually 50 * 24 * 60 * 60
+   * seconds. If the resulting `DateTime` has a different daylight saving offset
+   * than `this`, then the result won't have the same time-of-day as `this`, and
+   * may not even hit the calendar date 50 days earlier.
+   *
+   * Be careful when working with dates in local time.
    */
   external DateTime subtract(Duration duration);
 
diff --git a/sdk/lib/core/duration.dart b/sdk/lib/core/duration.dart
index c5b73a2..f2dd01b 100644
--- a/sdk/lib/core/duration.dart
+++ b/sdk/lib/core/duration.dart
@@ -11,6 +11,16 @@
  * duration may be "negative" if the difference is from a later time to an
  * earlier.
  *
+ * Durations are context independent. For example, a duration of 2 days is
+ * always 48 hours, even when it is added to a `DateTime` just when the
+ * time zone is about to do a daylight-savings switch. (See [DateTime.add]).
+ *
+ * Despite the same name, a `Duration` object does not implement "Durations"
+ * as specified by ISO 8601. In particular, a duration object does not keep
+ * track of the individually provided members (such as "days" or "hours"), but
+ * only uses these arguments to compute the length of the corresponding time
+ * interval.
+ *
  * To create a new Duration object, use this class's single constructor
  * giving the appropriate arguments:
  *
diff --git a/sdk/lib/core/iterable.dart b/sdk/lib/core/iterable.dart
index aa9292e..9ea0c02 100644
--- a/sdk/lib/core/iterable.dart
+++ b/sdk/lib/core/iterable.dart
@@ -368,7 +368,7 @@
    * Some iterables have a more efficient way to find the number of elements.
    */
   int get length {
-    assert(this is! EfficientLength);
+    assert(this is! EfficientLengthIterable);
     int count = 0;
     Iterator it = iterator;
     while (it.moveNext()) {
diff --git a/sdk/lib/core/list.dart b/sdk/lib/core/list.dart
index d887e67..33e011c 100644
--- a/sdk/lib/core/list.dart
+++ b/sdk/lib/core/list.dart
@@ -51,7 +51,7 @@
  * directly or through iterating an [Iterable] that is backed by the list, will
  * break the iteration.
  */
-abstract class List<E> implements Iterable<E>, EfficientLength {
+abstract class List<E> implements EfficientLengthIterable<E> {
   /**
    * Creates a list of the given length.
    *
diff --git a/sdk/lib/core/set.dart b/sdk/lib/core/set.dart
index 7e2508c..d2e9d8d 100644
--- a/sdk/lib/core/set.dart
+++ b/sdk/lib/core/set.dart
@@ -31,7 +31,7 @@
  * iterating either the set itself or any [Iterable] that is backed by the set,
  * such as the ones returned by methods like [where] and [map].
  */
-abstract class Set<E> extends Iterable<E> implements EfficientLength {
+abstract class Set<E> extends EfficientLengthIterable<E> {
   /**
    * Creates an empty [Set].
    *
@@ -185,7 +185,7 @@
    * That is, the returned set contains all the elements of this [Set] that
    * are not elements of [other] according to `other.contains`.
    */
-  Set<E> difference(Set<E> other);
+  Set<E> difference(Set<Object> other);
 
   /**
    * Removes all elements in the set.
diff --git a/sdk/lib/core/stopwatch.dart b/sdk/lib/core/stopwatch.dart
index e923083..f6dd85e 100644
--- a/sdk/lib/core/stopwatch.dart
+++ b/sdk/lib/core/stopwatch.dart
@@ -9,31 +9,35 @@
  */
 class Stopwatch {
   /**
-   * Frequency of the elapsed counter in Hz.
+   * Cached frequency of the system. Must be initialized in [_initTicker];
    */
-  int get frequency => _frequency;
+  static int _frequency;
 
   // The _start and _stop fields capture the time when [start] and [stop]
   // are called respectively.
-  // If _start is null, then the [Stopwatch] has not been started yet.
-  // If _stop is null, then the [Stopwatch] has not been stopped yet,
-  // or is running.
-  int _start;
-  int _stop;
+  // If _stop is null, the stopwatched is running.
+  int _start = 0;
+  int _stop = 0;
 
   /**
    * Creates a [Stopwatch] in stopped state with a zero elapsed count.
    *
    * The following example shows how to start a [Stopwatch]
    * immediately after allocation.
-   *
-   *     Stopwatch stopwatch = new Stopwatch()..start();
+   * ```
+   * var stopwatch = new Stopwatch()..start();
+   * ```
    */
   Stopwatch() {
-    _initTicker();
+    if (_frequency == null) _initTicker();
   }
 
   /**
+   * Frequency of the elapsed counter in Hz.
+   */
+  int get frequency => _frequency;
+
+  /**
    * Starts the [Stopwatch].
    *
    * The [elapsed] count is increasing monotonically. If the [Stopwatch] has
@@ -43,14 +47,10 @@
    * If the [Stopwatch] is currently running, then calling start does nothing.
    */
   void start() {
-    if (isRunning) return;
-    if (_start == null) {
-      // This stopwatch has never been started.
-      _start = _now();
-    } else {
-      // Restart this stopwatch. Prepend the elapsed time to the current
-      // start time.
-      _start = _now() - (_stop - _start);
+    if (_stop != null) {
+      // (Re)start this stopwatch.
+      // Don't count the time while the stopwatch has been stopped.
+      _start += _now() - _stop;
       _stop = null;
     }
   }
@@ -63,8 +63,7 @@
    * effect.
    */
   void stop() {
-    if (!isRunning) return;
-    _stop = _now();
+    _stop ??= _now();
   }
 
   /**
@@ -73,51 +72,40 @@
    * This method does not stop or start the [Stopwatch].
    */
   void reset() {
-    if (_start == null) return;
-    // If [_start] is not null, then the stopwatch had already been started. It
-    // may running right now.
-    _start = _now();
-    if (_stop != null) {
-      // The watch is not running. So simply set the [_stop] to [_start] thus
-      // having an elapsed time of 0.
-      _stop = _start;
-    }
+    _start = _stop ?? _now();
   }
 
   /**
-   * Returns the elapsed number of clock ticks since calling [start] while the
+   * The elapsed number of clock ticks since calling [start] while the
    * [Stopwatch] is running.
    *
-   * Returns the elapsed number of clock ticks between calling [start] and
+   * This is the elapsed number of clock ticks between calling [start] and
    * calling [stop].
    *
-   * Returns 0 if the [Stopwatch] has never been started.
+   * Is 0 if the [Stopwatch] has never been started.
    *
    * The elapsed number of clock ticks increases by [frequency] every second.
    */
   int get elapsedTicks {
-    if (_start == null) {
-      return 0;
-    }
-    return (_stop == null) ? (_now() - _start) : (_stop - _start);
+    return (_stop ?? _now()) - _start;
   }
 
   /**
-   * Returns the [elapsedTicks] counter converted to a [Duration].
+   * The [elapsedTicks] counter converted to a [Duration].
    */
   Duration get elapsed {
     return new Duration(microseconds: elapsedMicroseconds);
   }
 
   /**
-   * Returns the [elapsedTicks] counter converted to microseconds.
+   * The [elapsedTicks] counter converted to microseconds.
    */
   int get elapsedMicroseconds {
     return (elapsedTicks * 1000000) ~/ frequency;
   }
 
   /**
-   * Returns the [elapsedTicks] counter converted to milliseconds.
+   * The [elapsedTicks] counter converted to milliseconds.
    */
   int get elapsedMilliseconds {
     return (elapsedTicks * 1000) ~/ frequency;
@@ -125,14 +113,9 @@
 
 
   /**
-   * Returns wether the [StopWatch] is currently running.
+   * Whether the [StopWatch] is currently running.
    */
-  bool get isRunning => _start != null && _stop == null;
-
-  /**
-   * Cached frequency of the system. Must be initialized in [_initTicker];
-   */
-  static int _frequency;
+  bool get isRunning => _stop == null;
 
   /**
    * Initializes the time-measuring system. *Must* initialize the [_frequency]
diff --git a/sdk/lib/developer/developer.dart b/sdk/lib/developer/developer.dart
index 74c9d50..aab137c 100644
--- a/sdk/lib/developer/developer.dart
+++ b/sdk/lib/developer/developer.dart
@@ -17,10 +17,12 @@
 
 import 'dart:async';
 import 'dart:convert';
+import 'dart:isolate' show Isolate, RawReceivePort, SendPort;
 
 part 'extension.dart';
 part 'profiler.dart';
 part 'timeline.dart';
+part 'service.dart';
 
 /// If [when] is true, stop the program as if a breakpoint were hit at the
 /// following statement.
diff --git a/sdk/lib/developer/developer_sources.gypi b/sdk/lib/developer/developer_sources.gypi
index 5bdfe3d..91596a3 100644
--- a/sdk/lib/developer/developer_sources.gypi
+++ b/sdk/lib/developer/developer_sources.gypi
@@ -8,6 +8,7 @@
     # The above file needs to be first if additional parts are added to the lib.
     'extension.dart',
     'profiler.dart',
+    'service.dart',
     'timeline.dart',
   ],
 }
diff --git a/sdk/lib/developer/extension.dart b/sdk/lib/developer/extension.dart
index 75737f6..5883fb5 100644
--- a/sdk/lib/developer/extension.dart
+++ b/sdk/lib/developer/extension.dart
@@ -13,7 +13,7 @@
   final int _errorCode;
   final String _errorDetail;
 
-  /// Creates a successful to a service protocol extension RPC.
+  /// Creates a successful response to a service protocol extension RPC.
   ///
   /// Requires [result] to be a JSON object encoded as a string. When forming
   /// the JSON-RPC message [result] will be inlined directly.
diff --git a/sdk/lib/developer/service.dart b/sdk/lib/developer/service.dart
new file mode 100644
index 0000000..bbe954d
--- /dev/null
+++ b/sdk/lib/developer/service.dart
@@ -0,0 +1,104 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 dart.developer;
+
+/// Service protocol is the protocol that a client like the observatory
+/// could use to access the services provided by the Dart VM for
+/// debugging and inspecting Dart programs. This class encapsulates the
+/// version number and Uri for accessing this service.
+class ServiceProtocolInfo {
+  /// The major version of the protocol. If the running Dart environment does
+  /// not support the service protocol, this is 0.
+  final int majorVersion = _getServiceMajorVersion();
+  /// The minor version of the protocol. If the running Dart environment does
+  /// not support the service protocol, this is 0.
+  final int minorVersion = _getServiceMinorVersion();
+  /// The Uri to access the service. If the web server is not running, this
+  /// will be null.
+  final Uri serverUri;
+
+  ServiceProtocolInfo(this.serverUri);
+
+  String toString() {
+    if (serverUri != null) {
+      return 'Dart VM Service Protocol v$majorVersion.$minorVersion '
+             'listening on $serverUri';
+    } else {
+      return 'Dart VM Service Protocol v$majorVersion.$minorVersion';
+    }
+  }
+}
+
+/// Access information about the service protocol and control the web server
+/// that provides access to the services provided by the Dart VM for
+/// debugging and inspecting Dart programs.
+class Service {
+  /// Get information about the service protocol (version number and
+  /// Uri to access the service).
+  static Future<ServiceProtocolInfo> getInfo() async {
+    // Port to receive response from service isolate.
+    final RawReceivePort receivePort = new RawReceivePort();
+    final Completer<Uri> uriCompleter = new Completer<Uri>();
+    receivePort.handler = (Uri uri) => uriCompleter.complete(uri);
+    // Request the information from the service isolate.
+    _getServerInfo(receivePort.sendPort);
+    // Await the response from the service isolate.
+    Uri uri = await uriCompleter.future;
+    // Close the port.
+    receivePort.close();
+    return new ServiceProtocolInfo(uri);
+  }
+
+  /// Control the web server that the service protocol is accessed through.
+  /// The [enable] argument must be a boolean and is used as a toggle to
+  /// enable(true) or disable(false) the web server servicing requests.
+  static Future<ServiceProtocolInfo> controlWebServer(
+      {bool enable: false}) async {
+    if (enable is! bool) {
+      throw new ArgumentError.value(enable,
+                                    'enable',
+                                    'Must be a bool');
+    }
+    // Port to receive response from service isolate.
+    final RawReceivePort receivePort = new RawReceivePort();
+    final Completer<Uri> uriCompleter = new Completer<Uri>();
+    receivePort.handler = (Uri uri) => uriCompleter.complete(uri);
+    // Request the information from the service isolate.
+    _webServerControl(receivePort.sendPort, enable);
+    // Await the response from the service isolate.
+    Uri uri = await uriCompleter.future;
+    // Close the port.
+    receivePort.close();
+    return new ServiceProtocolInfo(uri);
+  }
+
+  /// Returns a [String] token representing the ID of [isolate].
+  ///
+  /// Returns null if the running Dart environment does not support the service
+  /// protocol.
+  static String getIsolateID(Isolate isolate) {
+    if (isolate is! Isolate) {
+      throw new ArgumentError.value(isolate,
+                                    'isolate',
+                                    'Must be an Isolate');
+    }
+    return _getIsolateIDFromSendPort(isolate.controlPort);
+  }
+}
+
+/// [sendPort] will receive a Uri or null.
+external void _getServerInfo(SendPort sendPort);
+
+/// [sendPort] will receive a Uri or null.
+external void _webServerControl(SendPort sendPort, bool enable);
+
+/// Returns the major version of the service protocol.
+external int _getServiceMajorVersion();
+
+/// Returns the minor version of the service protocol.
+external int _getServiceMinorVersion();
+
+/// Returns the service id for the isolate that owns [sendPort].
+external String _getIsolateIDFromSendPort(SendPort sendPort);
\ No newline at end of file
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 7a937b3..04ed9e6 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -89,7 +89,8 @@
 /**
  * Root node for all content in a web page.
  */
-HtmlDocument get document => JS('HtmlDocument', 'document');
+HtmlDocument get document =>
+    JS('returns:HtmlDocument;depends:none;effects:none;gvn:true', 'document');
 
 // Workaround for tags like <cite> that lack their own Element subclass --
 // Dart issue 1990.
@@ -3069,10 +3070,8 @@
 @Native("Comment")
 class Comment extends CharacterData {
   factory Comment([String data]) {
-    if (data != null) {
-      return JS('Comment', '#.createComment(#)', document, data);
-    }
-    return JS('Comment', '#.createComment("")', document);
+    return JS('returns:Comment;depends:none;effects:none;new:true',
+        '#.createComment(#)', document, data == null ? "" : data);
   }
   // To suppress missing implicit constructor warnings.
   factory Comment._() { throw new UnsupportedError("Not supported"); }
@@ -31999,7 +31998,9 @@
 @DomName('Text')
 @Native("Text")
 class Text extends CharacterData {
-  factory Text(String data) => document._createTextNode(data);
+  factory Text(String data) =>
+      JS('returns:Text;depends:none;effects:none;new:true',
+          '#.createTextNode(#)', document, data);
   // To suppress missing implicit constructor warnings.
   factory Text._() { throw new UnsupportedError("Not supported"); }
 
@@ -39803,7 +39804,7 @@
   /**
    * Set this CSS Dimension to the specified number of x-heights.
    *
-   * One ex is equal to the the x-height of a font's baseline to its mean line,
+   * One ex is equal to the x-height of a font's baseline to its mean line,
    * generally the height of the letter "x" in the font, which is usually about
    * half the font-size.
    */
@@ -42765,6 +42766,21 @@
       convertDartClosureToJS(callback, 4));
 }
 
+/// Checks whether the given [element] correctly extends from the native class
+/// with the given [baseClassName]. This method will throw if the base class
+/// doesn't match, except when the element extends from `template` and it's base
+/// class is `HTMLUnknownElement`. This exclusion is needed to support extension
+/// of template elements (used heavily in Polymer 1.0) on IE11 when using the
+/// webcomponents-lite.js polyfill.
+void _checkExtendsNativeClassOrTemplate(
+    Element element, String extendsTag, String baseClassName) {
+  if (!JS('bool', '(# instanceof window[#])', element, baseClassName) &&
+      !((extendsTag == 'template' &&
+       JS('bool', '(# instanceof window["HTMLUnknownElement"])', element)))) {
+    throw new UnsupportedError('extendsTag does not match base native class');
+  }
+}
+
 void _registerCustomElement(context, document, String tag, Type type,
     String extendsTagName) {
   // Function follows the same pattern as the following JavaScript code for
@@ -42808,10 +42824,8 @@
           'native class is not HtmlElement');
     }
   } else {
-    if (!JS('bool', '(#.createElement(#) instanceof window[#])',
-        document, extendsTagName, baseClassName)) {
-      throw new UnsupportedError('extendsTag does not match base native class');
-    }
+    var element = document.createElement(extendsTagName);
+    _checkExtendsNativeClassOrTemplate(element, extendsTagName, baseClassName);
   }
 
   var baseConstructor = JS('=Object', '#[#]', context, baseClassName);
@@ -42881,11 +42895,7 @@
       _nativeType = HtmlElement;
     } else {
       var element = document.createElement(extendsTag);
-      if (!JS('bool', '(# instanceof window[#])',
-          element, baseClassName)) {
-        throw new UnsupportedError(
-            'extendsTag does not match base native class');
-      }
+      _checkExtendsNativeClassOrTemplate(element, extendsTag, baseClassName);
       _nativeType = element.runtimeType;
     }
 
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index b3be182..5385090 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -44329,7 +44329,7 @@
   /**
    * Set this CSS Dimension to the specified number of x-heights.
    *
-   * One ex is equal to the the x-height of a font's baseline to its mean line,
+   * One ex is equal to the x-height of a font's baseline to its mean line,
    * generally the height of the letter "x" in the font, which is usually about
    * half the font-size.
    */
diff --git a/sdk/lib/html/dartium/nativewrappers.dart b/sdk/lib/html/dartium/nativewrappers.dart
index 55e5742..0d4e111 100644
--- a/sdk/lib/html/dartium/nativewrappers.dart
+++ b/sdk/lib/html/dartium/nativewrappers.dart
@@ -4,9 +4,10 @@
 
 library nativewrappers;
 
-class NativeFieldWrapperClass2 {
-  NativeFieldWrapperClass2() {
-    throw new UnsupportedError(
-        "Generative constructors not supported on native types.");
-  }
-}
+class NativeFieldWrapperClass1 { }
+
+class NativeFieldWrapperClass2 { }
+
+class NativeFieldWrapperClass3 { }
+
+class NativeFieldWrapperClass4 { }
diff --git a/sdk/lib/internal/iterable.dart b/sdk/lib/internal/iterable.dart
index 0e7b171..73b3669 100644
--- a/sdk/lib/internal/iterable.dart
+++ b/sdk/lib/internal/iterable.dart
@@ -8,7 +8,8 @@
  * Marker interface for [Iterable] subclasses that have an efficient
  * [length] implementation.
  */
-abstract class EfficientLength {
+abstract class EfficientLengthIterable<T> extends Iterable<T> {
+  const EfficientLengthIterable();
   /**
    * Returns the number of elements in the iterable.
    *
@@ -24,8 +25,7 @@
  * All other methods are implemented in terms of [length] and [elementAt],
  * including [iterator].
  */
-abstract class ListIterable<E> extends Iterable<E>
-                               implements EfficientLength {
+abstract class ListIterable<E> extends EfficientLengthIterable<E> {
   int get length;
   E elementAt(int i);
 
@@ -354,7 +354,7 @@
   final _Transformation<S, T> _f;
 
   factory MappedIterable(Iterable<S> iterable, T function(S value)) {
-    if (iterable is EfficientLength) {
+    if (iterable is EfficientLengthIterable) {
       return new EfficientLengthMappedIterable<S, T>(iterable, function);
     }
     return new MappedIterable<S, T>._(iterable, function);
@@ -376,7 +376,7 @@
 }
 
 class EfficientLengthMappedIterable<S, T> extends MappedIterable<S, T>
-                                          implements EfficientLength {
+    implements EfficientLengthIterable<T> {
   EfficientLengthMappedIterable(Iterable<S> iterable, T function(S value))
       : super._(iterable, function);
 }
@@ -406,7 +406,7 @@
  * Expects efficient `length` and `elementAt` on the source iterable.
  */
 class MappedListIterable<S, T> extends ListIterable<T>
-                               implements EfficientLength {
+                               implements EfficientLengthIterable<T> {
   final Iterable<S> _source;
   final _Transformation<S, T> _f;
 
@@ -427,7 +427,7 @@
 
   Iterator<E> get iterator => new WhereIterator<E>(_iterable.iterator, _f);
 
-  // Specialization of [Iterable.map] to non-EfficientLength.
+  // Specialization of [Iterable.map] to non-EfficientLengthIterable.
   Iterable/*<T>*/ map/*<T>*/(/*=T*/ f(E element)) =>
      new MappedIterable<E, dynamic/*=T*/>._(this, f);
 }
@@ -500,7 +500,7 @@
     if (takeCount is! int || takeCount < 0) {
       throw new ArgumentError(takeCount);
     }
-    if (iterable is EfficientLength) {
+    if (iterable is EfficientLengthIterable) {
       return new EfficientLengthTakeIterable<E>(iterable, takeCount);
     }
     return new TakeIterable<E>._(iterable, takeCount);
@@ -514,7 +514,7 @@
 }
 
 class EfficientLengthTakeIterable<E> extends TakeIterable<E>
-                                     implements EfficientLength {
+                                     implements EfficientLengthIterable<E> {
   EfficientLengthTakeIterable(Iterable<E> iterable, int takeCount)
       : super._(iterable, takeCount);
 
@@ -587,7 +587,7 @@
   final int _skipCount;
 
   factory SkipIterable(Iterable<E> iterable, int count) {
-    if (iterable is EfficientLength) {
+    if (iterable is EfficientLengthIterable) {
       return new EfficientLengthSkipIterable<E>(iterable, count);
     }
     return new SkipIterable<E>._(iterable, count);
@@ -614,7 +614,7 @@
 }
 
 class EfficientLengthSkipIterable<E> extends SkipIterable<E>
-                                     implements EfficientLength {
+                                     implements EfficientLengthIterable<E> {
   EfficientLengthSkipIterable(Iterable<E> iterable, int skipCount)
       : super._(iterable, skipCount);
 
@@ -676,7 +676,7 @@
 /**
  * The always empty [Iterable].
  */
-class EmptyIterable<E> extends Iterable<E> implements EfficientLength {
+class EmptyIterable<E> extends EfficientLengthIterable<E> {
   const EmptyIterable();
 
   Iterator<E> get iterator => const EmptyIterator();
diff --git a/sdk/lib/io/http.dart b/sdk/lib/io/http.dart
index d61835c..71eff21 100644
--- a/sdk/lib/io/http.dart
+++ b/sdk/lib/io/http.dart
@@ -149,7 +149,7 @@
  * about the streaming qualities of an HttpServer.
  * Pausing the subscription of the stream, pauses at the OS level.
  *
- * * The [http_server](https://pub.dartlang.org/packages/http_server)
+ * * The [shelf](https://pub.dartlang.org/packages/shelf)
  * package on pub.dartlang.org contains a set of high-level classes that,
  * together with this class, makes it easy to provide content through HTTP
  * servers.
@@ -1668,13 +1668,13 @@
                                            int port));
 
   /**
-   * Shutdown the HTTP client. If [force] is [:false:] (the default)
+   * Shut down the HTTP client. If [force] is [:false:] (the default)
    * the [:HttpClient:] will be kept alive until all active
    * connections are done. If [force] is [:true:] any active
    * connections will be closed to immediately release all
    * resources. These closed connections will receive an [:onError:]
-   * callback to indicate that the client was shutdown. In both cases
-   * trying to establish a new connection after calling [shutdown]
+   * callback to indicate that the client was shut down. In both cases
+   * trying to establish a new connection after calling [close]
    * will throw an exception.
    */
   void close({bool force: false});
diff --git a/sdk/lib/io/io.dart b/sdk/lib/io/io.dart
index c0d63de..844a380 100644
--- a/sdk/lib/io/io.dart
+++ b/sdk/lib/io/io.dart
@@ -62,7 +62,7 @@
  * The [HttpServer] class provides the basic functionality for
  * implementing an HTTP server.
  * For some higher-level building-blocks, we recommend that you try
- * the [http_server](https://pub.dartlang.org/packages/http_server)
+ * the [shelf](https://pub.dartlang.org/packages/shelf)
  * pub package, which contains
  * a set of high-level classes that, together with the [HttpServer] class
  * in this library, make it easier to implement HTTP servers.
@@ -120,7 +120,7 @@
  *
  * The client connects to the WebSocket using the `connect()` method
  * and a URI that uses the Web Socket protocol.
- * The the client can write to the WebSocket with the `add()` method.
+ * The client can write to the WebSocket with the `add()` method.
  * For example,
  *
  *     WebSocket.connect('ws://127.0.0.1:4040/ws').then((socket) {
diff --git a/sdk/lib/io/platform_impl.dart b/sdk/lib/io/platform_impl.dart
index 92d5699..8b83fc0 100644
--- a/sdk/lib/io/platform_impl.dart
+++ b/sdk/lib/io/platform_impl.dart
@@ -11,6 +11,7 @@
   external static _localHostname();
   external static _executable();
   external static _resolvedExecutable();
+
   /**
    * Retrieve the entries of the process environment.
    *
diff --git a/sdk/lib/isolate/isolate.dart b/sdk/lib/isolate/isolate.dart
index cb58a44..77b40c0 100644
--- a/sdk/lib/isolate/isolate.dart
+++ b/sdk/lib/isolate/isolate.dart
@@ -412,7 +412,7 @@
    * The [priority] must be one of [IMMEDIATE] or [BEFORE_NEXT_EVENT].
    * The shutdown is performed at different times depending on the priority:
    *
-   * * `IMMEDIATE`: The the isolate shuts down as soon as possible.
+   * * `IMMEDIATE`: The isolate shuts down as soon as possible.
    *     Control messages are handled in order, so all previously sent control
    *     events from this isolate will all have been processed.
    *     The shutdown should happen no later than if sent with
@@ -435,7 +435,7 @@
    * The [priority] must be one of [IMMEDIATE] or [BEFORE_NEXT_EVENT].
    * The response is sent at different times depending on the ping type:
    *
-   * * `IMMEDIATE`: The the isolate responds as soon as it receives the
+   * * `IMMEDIATE`: The isolate responds as soon as it receives the
    *     control message. This is after any previous control message
    *     from the same isolate has been received, but may be during
    *     execution of another event.
diff --git a/sdk/lib/js/dart2js/js_dart2js.dart b/sdk/lib/js/dart2js/js_dart2js.dart
index 61bf1da..b08f7ac 100644
--- a/sdk/lib/js/dart2js/js_dart2js.dart
+++ b/sdk/lib/js/dart2js/js_dart2js.dart
@@ -465,7 +465,7 @@
     super['length'] = length;
   }
 
-  // Methods overriden for better performance
+  // Methods overridden for better performance
 
   void add(E value) {
     callMethod('push', [value]);
diff --git a/sdk/lib/js/dartium/js_dartium.dart b/sdk/lib/js/dartium/js_dartium.dart
index fbda496..b14e032 100644
--- a/sdk/lib/js/dartium/js_dartium.dart
+++ b/sdk/lib/js/dartium/js_dartium.dart
@@ -1557,7 +1557,7 @@
     super['length'] = length;
   }
 
-  // Methods overriden for better performance
+  // Methods overridden for better performance
 
   void add(E value) {
     callMethod('push', [value]);
diff --git a/sdk/lib/mirrors/mirrors.dart b/sdk/lib/mirrors/mirrors.dart
index a5f5750..206410a 100644
--- a/sdk/lib/mirrors/mirrors.dart
+++ b/sdk/lib/mirrors/mirrors.dart
@@ -944,7 +944,7 @@
   /**
    * The defining type for this typedef.
    *
-   * If the the type referred to by the reflectee is a function type *F*, the
+   * If the type referred to by the reflectee is a function type *F*, the
    * result will be [:FunctionTypeMirror:] reflecting *F* which is abstract
    * and has an abstract method [:call:] whose signature corresponds to *F*.
    * For instance [:void f(int):] is the referent for [:typedef void f(int):].
diff --git a/sdk/lib/rules.gni b/sdk/lib/rules.gni
index 27779ea..fe51bbb 100644
--- a/sdk/lib/rules.gni
+++ b/sdk/lib/rules.gni
@@ -31,24 +31,29 @@
   } else {
     destination = "$root_gen_dir/dart_sdk"
   }
-  dart_sdk_sdk_lib_path =
-      rebase_path("sdk/lib", "", dart_root)
+  dart_sdk_sdk_lib_path = rebase_path("sdk/lib", "", dart_root)
   dart_sdk_tools_gypi_to_gn_path =
       rebase_path("tools/gypi_to_gn.py", "", dart_root)
+
   # The name of the SDK library being copied.
   lib_name = invoker.sdk_lib_name
+
   # The path to the libraries source directory.
   lib_path = rebase_path(lib_name, "", dart_sdk_sdk_lib_path)
+
   # The path to the sources gypi.
   lib_sources_gypi = lib_name + "_sources.gypi"
+
   # Get the contents of the gypi file.
   sdk_lib_sources_gypi =
       exec_script(dart_sdk_tools_gypi_to_gn_path,
-                  [rebase_path(lib_sources_gypi, "", lib_path)],
+                  [ rebase_path(lib_sources_gypi, "", lib_path) ],
                   "scope",
-                  [rebase_path(lib_sources_gypi, "", lib_path)])
+                  [ rebase_path(lib_sources_gypi, "", lib_path) ])
   copy(target_name) {
     sources = rebase_path(sdk_lib_sources_gypi.sources, "", lib_path)
-    outputs = [ "$destination/$lib_name/{{source_file_part}}" ]
+    outputs = [
+      "$destination/$lib_name/{{source_file_part}}",
+    ]
   }
 }
diff --git a/sdk/lib/vmservice/constants.dart b/sdk/lib/vmservice/constants.dart
index e899dd1..bc985cd 100644
--- a/sdk/lib/vmservice/constants.dart
+++ b/sdk/lib/vmservice/constants.dart
@@ -9,4 +9,6 @@
   static const int SERVICE_EXIT_MESSAGE_ID = 0;
   static const int ISOLATE_STARTUP_MESSAGE_ID = 1;
   static const int ISOLATE_SHUTDOWN_MESSAGE_ID = 2;
+  static const int WEB_SERVER_CONTROL_MESSAGE_ID = 3;
+  static const int SERVER_INFO_MESSAGE_ID = 4;
 }
diff --git a/sdk/lib/vmservice/vmservice.dart b/sdk/lib/vmservice/vmservice.dart
index a56c293..0330233 100644
--- a/sdk/lib/vmservice/vmservice.dart
+++ b/sdk/lib/vmservice/vmservice.dart
@@ -7,7 +7,9 @@
 import 'dart:async';
 import 'dart:collection';
 import 'dart:convert';
+import 'dart:developer' show ServiceProtocolInfo;
 import 'dart:isolate';
+import 'dart:math';
 import 'dart:typed_data';
 
 part 'asset.dart';
@@ -19,13 +21,29 @@
 part 'message.dart';
 part 'message_router.dart';
 
-final RawReceivePort isolateLifecyclePort = new RawReceivePort();
+final RawReceivePort isolateControlPort = new RawReceivePort();
 final RawReceivePort scriptLoadPort = new RawReceivePort();
 
 abstract class IsolateEmbedderData {
   void cleanup();
 }
 
+String _makeAuthToken() {
+  final kTokenByteSize = 8;
+  Uint8List bytes = new Uint8List(kTokenByteSize);
+  Random random = new Random.secure();
+  for (int i = 0; i < kTokenByteSize; i++) {
+    bytes[i] = random.nextInt(256);
+  }
+  return BASE64URL.encode(bytes);
+}
+
+// The randomly generated auth token used to access the VM service.
+final String serviceAuthToken = _makeAuthToken();
+
+// TODO(johnmccutchan): Enable the auth token and drop the origin check.
+final bool useAuthToken = const bool.fromEnvironment('DART_SERVICE_USE_AUTH');
+
 // This is for use by the embedder. It is a map from the isolateId to
 // anything implementing IsolateEmbedderData. When an isolate goes away,
 // the cleanup method will be invoked after being removed from the map.
@@ -125,6 +143,12 @@
 /// Called to list all files under some path.
 typedef Future<List<Map<String,String>>> ListFilesCallback(Uri path);
 
+/// Called when we need information about the server.
+typedef Future<Uri> ServerInformationCallback();
+
+/// Called when we want to [enable] or disable the web server.
+typedef Future<Uri> WebServerControlCallback(bool enable);
+
 /// Hooks that are setup by the embedder.
 class VMServiceEmbedderHooks {
   static ServerStartCallback serverStart;
@@ -136,6 +160,8 @@
   static WriteStreamFileCallback writeStreamFile;
   static ReadFileCallback readFile;
   static ListFilesCallback listFiles;
+  static ServerInformationCallback serverInformation;
+  static WebServerControlCallback webServerControl;
 }
 
 class VMService extends MessageRouter {
@@ -194,6 +220,27 @@
     }
   }
 
+  Future<Null> _serverMessageHandler(int code, SendPort sp, bool enable) async {
+    switch (code) {
+      case Constants.WEB_SERVER_CONTROL_MESSAGE_ID:
+        if (VMServiceEmbedderHooks.webServerControl == null) {
+          sp.send(null);
+          return;
+        }
+        Uri uri = await VMServiceEmbedderHooks.webServerControl(enable);
+        sp.send(uri);
+      break;
+      case Constants.SERVER_INFO_MESSAGE_ID:
+        if (VMServiceEmbedderHooks.serverInformation == null) {
+          sp.send(null);
+          return;
+        }
+        Uri uri = await VMServiceEmbedderHooks.serverInformation();
+        sp.send(uri);
+      break;
+    }
+  }
+
   Future _exit() async {
     // Stop the server.
     if (VMServiceEmbedderHooks.serverStop != null) {
@@ -201,7 +248,7 @@
     }
 
     // Close receive ports.
-    isolateLifecyclePort.close();
+    isolateControlPort.close();
     scriptLoadPort.close();
 
     // Create a copy of the set as a list because client.disconnect() will
@@ -233,6 +280,13 @@
         _exit();
         return;
       }
+      if (message.length == 3) {
+        // This is a message interacting with the web server.
+        assert((message[0] == Constants.WEB_SERVER_CONTROL_MESSAGE_ID) ||
+               (message[0] == Constants.SERVER_INFO_MESSAGE_ID));
+        _serverMessageHandler(message[0], message[1], message[2]);
+        return;
+      }
       if (message.length == 4) {
         // This is a message informing us of the birth or death of an
         // isolate.
@@ -244,7 +298,7 @@
   }
 
   VMService._internal()
-      : eventPort = isolateLifecyclePort {
+      : eventPort = isolateControlPort {
     eventPort.handler = messageHandler;
   }
 
@@ -425,8 +479,8 @@
 }
 
 RawReceivePort boot() {
-  // Return the port we expect isolate startup and shutdown messages on.
-  return isolateLifecyclePort;
+  // Return the port we expect isolate control messages on.
+  return isolateControlPort;
 }
 
 void _registerIsolate(int port_id, SendPort sp, String name) {
diff --git a/tests/co19/co19-analyzer2.status b/tests/co19/co19-analyzer2.status
index 0d0cdc5..990fb9c 100644
--- a/tests/co19/co19-analyzer2.status
+++ b/tests/co19/co19-analyzer2.status
@@ -4,16 +4,7 @@
 
 [ $compiler == dart2analyzer ]
 
-# Trailing commas are now allowed by the language - issue #26644
-Language/Functions/Formal_Parameters/syntax_t12: MissingCompileTimeError
-Language/Functions/Formal_Parameters/syntax_t05: MissingCompileTimeError
-Language/Functions/Formal_Parameters/syntax_t04: MissingCompileTimeError
-Language/Expressions/Function_Invocation/Actual_Argument_List_Evaluation/syntax_t05: MissingCompileTimeError
-Language/Expressions/Method_Invocation/Ordinary_Invocation/syntax_t05: MissingCompileTimeError
-Language/Expressions/Method_Invocation/Ordinary_Invocation/syntax_t10: MissingCompileTimeError
-Language/Expressions/Method_Invocation/Super_Invocation/syntax_t05: MissingCompileTimeError
-# End issue #26644
-
+Language/Functions/Formal_Parameters/syntax_t05: StaticWarning # Issue 26644
 Language/Classes/Classes/method_definition_t06: MissingStaticWarning # Please triage this failure.
 Language/Classes/Getters/static_getter_t02: CompileTimeError # Issue 24534
 Language/Classes/Getters/static_t01: StaticWarning # Please triage this failure.
@@ -37,7 +28,6 @@
 Language/Classes/method_definition_t06: MissingStaticWarning # Please triage this failure.
 Language/Enums/syntax_t08: MissingCompileTimeError # Please triage this failure.
 Language/Enums/syntax_t09: MissingCompileTimeError # Please triage this failure.
-Language/Expressions/Assignable_Expressions/syntax_t08: StaticWarning
 Language/Expressions/Assignment/super_assignment_static_warning_t03: StaticWarning # Issue 15467
 Language/Expressions/Constants/exception_t01: fail, OK # co19 issue #438, Static variables are initialized lazily, need not be constants
 Language/Expressions/Constants/exception_t02: fail, OK # co19 issue #438, Static variables are initialized lazily, need not be constants
@@ -166,7 +156,6 @@
 Language/Interfaces/Superinterfaces/Inheritance_and_Overriding/inheritance_t03: StaticWarning # Please triage this failure.
 Language/Interfaces/Superinterfaces/Inheritance_and_Overriding/same_name_method_and_getter_t01: CompileTimeError # Please triage this failure.
 Language/Interfaces/Superinterfaces/Inheritance_and_Overriding/same_name_method_and_getter_t02: CompileTimeError # Please triage this failure.
-Language/Libraries_and_Scripts/Imports/deferred_import_t02: CompileTimeError # co19 issue 60.
 Language/Libraries_and_Scripts/Imports/invalid_uri_deferred_t02: CompileTimeError # Please triage this failure.
 Language/Libraries_and_Scripts/Parts/compilation_t01: Pass, MissingCompileTimeError # Issue 26692
 Language/Libraries_and_Scripts/Parts/compilation_t02: Pass, MissingCompileTimeError # Issue 26692
@@ -210,7 +199,6 @@
 LayoutTests/fast/backgrounds/001_t01: StaticWarning # Please triage this failure.
 LayoutTests/fast/canvas/canvas-arc-negative-radius_t01: StaticWarning # Issue 20939
 LayoutTests/fast/canvas/canvas-createImageBitmap-animated_t01: StaticWarning # Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view_t01: StaticWarning # Please triage this failure.
 LayoutTests/fast/canvas/webgl/webgl-specific_t01: StaticWarning # Please triage this failure.
 LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err_t01: StaticWarning # Please triage this failure.
 LayoutTests/fast/dom/DOMImplementation/createDocumentType-err_t01: StaticWarning # Please triage this failure.
@@ -265,7 +253,6 @@
 LayoutTests/fast/dom/icon-url-list_t01: StaticWarning # Please triage this failure.
 LayoutTests/fast/dom/implementation-api-args_t01: StaticWarning # Please triage this failure.
 LayoutTests/fast/dom/javascript-backslash_t01: StaticWarning # Please triage this failure.
-LayoutTests/fast/dom/location-missing-arguments_t01: StaticWarning # Please triage this failure.
 LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered_t01: Skip # Please triage this failure. isProtocolHandlerRegistered and unregisterProtocolHandler don't exist
 LayoutTests/fast/dom/navigatorcontentutils/unregister-protocol-handler_t01: StaticWarning # Please triage this failure.
 LayoutTests/fast/dom/option-properties_t01: StaticWarning # Please triage this failure.
@@ -353,26 +340,6 @@
 LibTest/html/Window/requestFileSystem_A02_t01: StaticWarning # Please triage this failure.
 LibTest/html/Window/resizeBy_A01_t01: StaticWarning # Please triage this failure.
 LibTest/html/Window/resizeTo_A01_t01: StaticWarning # Please triage this failure.
-LibTest/isolate/Isolate/spawnUri_A02_t01: StaticWarning # co19 issue 74
-LibTest/isolate/Isolate/spawnUri_A02_t06: StaticWarning # co19 issue 74
-LibTest/isolate/Isolate/spawnUri_A02_t07: StaticWarning # co19 issue 74
-LibTest/isolate/Isolate/spawn_A02_t04: StaticWarning # co19 issue 74
-LibTest/isolate/Isolate/spawn_A02_t05: StaticWarning # co19 issue 74
-LibTest/isolate/Isolate/spawn_A02_t06: StaticWarning # co19 issue 74
-LibTest/isolate/Isolate/spawn_A02_t07: StaticWarning # co19 issue 74
-LibTest/isolate/Isolate/spawn_A04_t01: StaticWarning # co19 issue 74
-LibTest/isolate/Isolate/spawn_A04_t02: StaticWarning # co19 issue 74
-LibTest/isolate/Isolate/spawn_A04_t03: StaticWarning # co19 issue 74
-LibTest/isolate/Isolate/spawn_A04_t04: StaticWarning # co19 issue 74
-LibTest/isolate/Isolate/spawn_A04_t05: StaticWarning # co19 issue 74
-LibTest/isolate/Isolate/spawn_A05_t03: StaticWarning # co19 issue 74
-LibTest/isolate/Isolate/spawn_A06_t01: StaticWarning # co19 issue 74
-LibTest/isolate/Isolate/spawn_A06_t02: StaticWarning # co19 issue 74
-LibTest/isolate/Isolate/spawn_A06_t03: StaticWarning # co19 issue 74
-LibTest/isolate/Isolate/spawn_A06_t04: StaticWarning # co19 issue 74
-LibTest/isolate/Isolate/spawn_A06_t05: StaticWarning # co19 issue 74
-LibTest/isolate/Isolate/spawn_A06_t06: StaticWarning # co19 issue 74
-LibTest/isolate/Isolate/spawn_A06_t07: StaticWarning # co19 issue 74
 LibTest/isolate/IsolateStream/any_A01_t01: Fail # Please triage this failure.
 LibTest/isolate/IsolateStream/any_A02_t01: Fail # Please triage this failure.
 LibTest/isolate/IsolateStream/asBroadcastStream_A01_t01: Fail # Please triage this failure.
diff --git a/tests/co19/co19-co19.status b/tests/co19/co19-co19.status
index 8b1627d..957c549 100644
--- a/tests/co19/co19-co19.status
+++ b/tests/co19/co19-co19.status
@@ -15,17 +15,8 @@
 # Tests that fail everywhere, including the analyzer.
 
 LibTest/typed_data/ByteData/buffer_A01_t01: Fail # co19 r736 bug - sent comment.
-
 LibTest/core/RegExp/firstMatch_A01_t01: Fail # co19 issue 742
 
-[ $system == linux ]
-LibTest/collection/ListBase/ListBase_class_A01_t01: Fail # co19 issue 72
-LibTest/collection/ListBase/ListBase_class_A01_t02: Fail # co19 issue 72
-LibTest/collection/ListBase/listToString_A01_t01: Fail # co19 issue 72
-LibTest/collection/ListBase/listToString_A02_t01: Fail # co19 issue 72
-LibTest/collection/MapBase/MapBase_class_A01_t01: Fail # co19 issue 72
-LibTest/collection/MapMixin/MapMixin_class_A01_t01: Fail # co19 issue 72
-
 [ $compiler != dart2analyzer ]
 # Tests that fail on every runtime, but not on the analyzer.
 Language/Classes/same_name_type_variable_t04: Pass, MissingCompileTimeError, Fail # Issue 14513,25525
@@ -34,7 +25,6 @@
 Language/Expressions/Instance_Creation/Const/abstract_class_t03: Pass, Fail # co19 issue 66
 LibTest/async/Stream/asBroadcastStream_A02_t01: Fail # co19 issue 687
 LibTest/collection/DoubleLinkedQueue/DoubleLinkedQueue_class_A01_t01: RuntimeError # Issue 27183
-LibTest/collection/LinkedListEntry/unlink_A01_t02: Fail # co19 pull request 73
 LibTest/core/Expando/Expando_A03_t01: RuntimeError # Issue 17735
 LibTest/core/Expando/Expando_A03_t03: RuntimeError # Issue 17735
 LibTest/core/Expando/Expando_A03_t04: RuntimeError # Issue 17735
@@ -78,13 +68,7 @@
 [ $runtime == dartium || $compiler == dart2js ]
 LibTest/async/Future/Future.delayed_A01_t02: Pass, Fail # Issue 15524
 
-[ ($compiler == none || $compiler == precompiler || $compiler == dart2appjit) && ($runtime == vm || $runtime == drt || $runtime == dartium || $runtime == dart_precompiled || $runtime == dart_app) ]
+[ ($compiler == none || $compiler == precompiler || $compiler == dart2app || $compiler == dart2appjit) && ($runtime == vm || $runtime == drt || $runtime == dart_precompiled || $runtime == dart_app) ]
 # Optional trailing commas for argument and parameter lists added to language.
 # https://github.com/dart-lang/co19/issues/68
-Language/Expressions/Function_Invocation/Actual_Argument_List_Evaluation/syntax_t05: Fail, OK
-Language/Expressions/Method_Invocation/Ordinary_Invocation/syntax_t05: Fail, OK
-Language/Expressions/Method_Invocation/Ordinary_Invocation/syntax_t10: Fail, OK
-Language/Expressions/Method_Invocation/Super_Invocation/syntax_t05: Fail, OK
-Language/Functions/Formal_Parameters/syntax_t04: Fail, OK
 Language/Functions/Formal_Parameters/syntax_t05: Fail, OK
-Language/Functions/Formal_Parameters/syntax_t12: Fail, OK
diff --git a/tests/co19/co19-dart2js.status b/tests/co19/co19-dart2js.status
index 1a80ab8..ba7e90e 100644
--- a/tests/co19/co19-dart2js.status
+++ b/tests/co19/co19-dart2js.status
@@ -3,18 +3,7 @@
 # BSD-style license that can be found in the LICENSE file.
 
 [ $compiler == dart2js ]
-# Trailing commas are now allowed by the language - issue #26644
-Language/Functions/Formal_Parameters/syntax_t12: MissingCompileTimeError
-Language/Functions/Formal_Parameters/syntax_t05: MissingCompileTimeError
-Language/Functions/Formal_Parameters/syntax_t04: MissingCompileTimeError
-Language/Expressions/Function_Invocation/Actual_Argument_List_Evaluation/syntax_t05: MissingCompileTimeError
-Language/Expressions/Method_Invocation/Ordinary_Invocation/syntax_t05: MissingCompileTimeError
-Language/Expressions/Method_Invocation/Ordinary_Invocation/syntax_t10: MissingCompileTimeError
-Language/Expressions/Method_Invocation/Super_Invocation/syntax_t05: MissingCompileTimeError
-# End of issue 26644
-Language/Variables/final_t01/01: CompileTimeError # co19 issue 77
-Language/Variables/final_t02/01: CompileTimeError # co19 issue 77
-LibTest/isolate/Isolate/spawn_A03_t01: CompileTimeError # co19 issue 77
+Language/Functions/Formal_Parameters/syntax_t05: RuntimeError # Issue 26644
 
 Language/Classes/Constructors/Generative_Constructors/execution_of_a_superinitializer_t01: RuntimeError # compiler cancelled: cannot resolve type T
 Language/Classes/Constructors/Generative_Constructors/execution_of_a_superinitializer_t01: RuntimeError, OK # co19 issue 258
@@ -240,11 +229,11 @@
 Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/setter_closurization_t08: CompileTimeError # Please triage this failure
 Language/Expressions/Property_Extraction/Super_Closurization: CompileTimeError # Issue 26287
 Language/Expressions/Property_Extraction/Super_Getter_Access_and_Method_Closurization/no_such_method_t01: RuntimeError # Please triage this failure
+Language/Expressions/Shift/syntax_t01/14: MissingRuntimeError # Please triage this failure
 Language/Functions/External_Functions/not_connected_to_a_body_t01: CompileTimeError, OK # Issue 5021
 Language/Generics/syntax_t17: fail # Issue 21203
 Language/Interfaces/Superinterfaces/Inheritance_and_Overriding/same_name_method_and_getter_t01: CompileTimeError # Please triage this failure
 Language/Interfaces/Superinterfaces/Inheritance_and_Overriding/same_name_method_and_getter_t02: CompileTimeError # Please triage this failure
-Language/Libraries_and_Scripts/Imports/deferred_import_t02: CompileTimeError # co19 issue 60
 Language/Libraries_and_Scripts/Imports/invalid_uri_deferred_t01/01: CompileTimeError # Please triage this failure
 Language/Libraries_and_Scripts/Imports/invalid_uri_deferred_t02: CompileTimeError # Please triage this failure
 Language/Libraries_and_Scripts/Scripts/top_level_main_t05: RuntimeError # Please triage this failure
@@ -290,6 +279,8 @@
 Language/Types/Interface_Types/subtype_t27: Skip # Times out or crashes. Issue 21174
 Language/Types/Interface_Types/subtype_t28: Pass, Fail, Crash # Stack overflow. Issue 25282
 Language/Types/Interface_Types/subtype_t30: fail # Issue 14654
+Language/Variables/final_t01/01: CompileTimeError # co19 issue 77
+Language/Variables/final_t02/01: CompileTimeError # co19 issue 77
 Language/Variables/local_variable_t01: MissingCompileTimeError # Issue 21050
 LayoutTests/fast/dom/css-innerHTML_t01: SkipByDesign # Test is incorrect.
 LayoutTests/fast/loader/loadInProgress_t01: Skip # Issue 23466
@@ -495,8 +486,28 @@
 LibTest/core/Map/Map_class_A01_t04: Slow, Pass
 LibTest/core/Uri/Uri_A06_t03: Slow, Pass
 LibTest/math/Point/operator_mult_A02_t01: RuntimeError # Issue 1533
-LibTest/typed_data/Float32x4List/reduce_A01_t01: Fail # co19 issue 78
-LibTest/typed_data/Float32x4List/lastWhere_A02_t01: Fail # co19 issue 78
+
+[ $compiler == dart2js && $checked && $runtime != d8]
+LayoutTests/fast/inline/empty-inline-before-collapsed-space_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/parser/pre-first-line-break_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/trivial_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/trivial-segments_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/writing-mode/auto-sizing-orthogonal-flows_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-templates/parsing-html-templates/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-body-context_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-templates/parsing-html-templates/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-context_t01: RuntimeError # Please triage this failure
+
+[ $compiler == dart2js && $checked && $runtime != drt && $runtime != d8]
+LayoutTests/fast/forms/change-form-element-document-crash_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/createElement_A04_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/createElementNS_A04_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/isAttribute_A02_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/html-elements-in-shadow-trees/html-forms/test-002_t01: RuntimeError # Please triage this failure
+
+[ $compiler == dart2js && $runtime != drt && $runtime != d8 && $runtime != jsshell && $runtime != chrome]
+WebPlatformTest/shadow-dom/html-elements-in-shadow-trees/html-forms/test-001_t01: RuntimeError # Please triage this failure
+
+[ $compiler == dart2js && $checked && $runtime != ff && $runtime != d8 && $runtime != drt]
+LayoutTests/fast/dom/clone-node-load-event-crash_t01: RuntimeError # Please triage this failure
 
 [ $compiler == dart2js && $fast_startup ]
 Language/Classes/Instance_Methods/Operators/unary_minus: Fail # mirrors not supported
@@ -541,23 +552,16 @@
 Language/Metadata/compilation_t11: Pass # mirrors not supported, fails for the wrong reason
 WebPlatformTest/shadow-dom/testcommon: Fail # mirrors not supported
 
-[ $compiler == dart2js && ($runtime == jsshell || ($fast_startup && ($runtime != chrome && $runtime != ff && $runtime != drt)))]
-LibTest/isolate/Isolate/spawn_A04_t04: Fail # please triage
+[ $compiler == dart2js && $runtime == jsshell ]
+LibTest/isolate/Isolate/spawn_A04_t04: Fail # Issue 27558
+
+[ $compiler == dart2js && $fast_startup && $runtime == d8]
+LibTest/isolate/Isolate/spawn_A04_t04: Fail # Issue 27558
 
 [ $compiler == dart2js && $fast_startup && $runtime == jsshell ]
 LibTest/isolate/ReceivePort/asBroadcastStream_A03_t01: Fail # please triage
 
 [ $compiler == dart2js && $fast_startup && $browser ]
-LayoutTests/fast/dom/custom/document-register-on-create-callback_t01: Fail # please triage
-LayoutTests/fast/dom/custom/unresolved-pseudoclass_t01: Fail # please triage
-WebPlatformTest/custom-elements/concepts/type_A01_t01: Fail # custom elements not supported
-LayoutTests/fast/dom/custom/attribute-changed-callback_t01: Fail # custom elements not supported
-LayoutTests/fast/dom/custom/created-callback_t01: Fail # please triage
-LayoutTests/fast/dom/custom/document-register-namespace_t01: Fail # please triage
-LayoutTests/fast/dom/custom/document-register-type-extensions_t01: Fail # please triage
-LayoutTests/fast/dom/custom/element-type_t01: Fail # custom elements not supported
-LayoutTests/fast/dom/custom/element-upgrade_t01: Fail # please triage
-LayoutTests/fast/dom/custom/type-extensions_t01: Fail # custom elements not supported
 WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-001_t01: Fail # custom elements not supported
 WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-004_t01: Fail # please triage
 WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-004_t02: Fail # please triage
@@ -580,7 +584,6 @@
 WebPlatformTest/shadow-dom/html-elements-and-their-shadow-trees/test-001_t01: Fail # please triage
 WebPlatformTest/shadow-dom/html-elements-and-their-shadow-trees/test-002_t01: Fail # please triage
 WebPlatformTest/shadow-dom/html-elements-and-their-shadow-trees/test-003_t01: Fail # please triage
-
 WebPlatformTest/shadow-dom/shadow-trees/custom-pseudo-elements/test-001_t01: Fail # please triage
 WebPlatformTest/shadow-dom/shadow-trees/distributed-pseudo-element/test-001_t01: Fail # please triage
 WebPlatformTest/shadow-dom/shadow-trees/distributed-pseudo-element/test-002_t01: Fail # please triage
@@ -589,15 +592,6 @@
 WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/selectors-api-001_t01: Fail # please triage
 WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/selectors-api-002_t01: Fail # please triage
 WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/test-009_t01: Fail # please triage
-WebPlatformTest/custom-elements/concepts/type_A07_t01: Fail # custom elements not supported
-WebPlatformTest/custom-elements/concepts/type_A08_t01: Fail # please triage
-WebPlatformTest/custom-elements/instantiating/createElementNS_A01_t01: Fail # please triage
-WebPlatformTest/custom-elements/instantiating/createElementNS_A04_t01: Fail # custom elements not supported
-WebPlatformTest/custom-elements/instantiating/createElementNS_A05_t01: Fail # custom elements not supported
-WebPlatformTest/custom-elements/instantiating/createElement_A01_t01: Fail # please triage
-WebPlatformTest/custom-elements/instantiating/createElement_A05_t01: Fail # please triage
-WebPlatformTest/custom-elements/instantiating/isAttribute_A03_t01: Fail # please triage
-WebPlatformTest/custom-elements/instantiating/localName_A01_t01: Fail # please triage
 
 [ $compiler == dart2js && $fast_startup && $browser && $runtime != chrome && $runtime != drt]
 WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-005_t01: Fail # please triage
@@ -626,7 +620,6 @@
 WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t04: Fail # please triage
 WebPlatformTest/shadow-dom/events/retargeting-relatedtarget/test-001_t01: Fail # please triage
 WebPlatformTest/shadow-dom/events/retargeting-relatedtarget/test-002_t01: Fail # please triage
-
 WebPlatformTest/shadow-dom/html-elements-in-shadow-trees/html-forms/test-001_t01: Fail # custom elements not supported
 WebPlatformTest/shadow-dom/html-elements-in-shadow-trees/html-forms/test-002_t01: Fail # please triage
 WebPlatformTest/shadow-dom/html-elements-in-shadow-trees/inert-html-elements/test-002_t01: Fail # please triage
@@ -676,8 +669,9 @@
 [ $compiler == dart2js && $checked != true ]
 Language/Expressions/Property_Extraction/General_Super_Property_Extraction/getter_lookup_t02: Timeout, Skip # Please triage this failure
 Language/Expressions/Property_Extraction/Super_Closurization/setter_closurization_t09: CompileTimeError # Please triage this failure
-LibTest/isolate/Isolate/spawn_A02_t04: RuntimeError # Issue 27185
-LibTest/isolate/Isolate/spawn_A02_t05: RuntimeError # Issue 27185
+
+[ $compiler == dart2js && $checked != true && $runtime != d8 && $runtime != jsshell]
+LayoutTests/fast/xpath/invalid-resolver_t01: RuntimeError # Please triage this failure
 
 [ $compiler == dart2js && $minified ]
 LibTest/typed_data/Float32List/runtimeType_A01_t01: fail # co19-roll r559: Please triage this failure
@@ -756,7 +750,7 @@
 LibTest/core/Stopwatch/start_A01_t03: RuntimeError # Issue 7728, timer not supported in jsshell
 LibTest/core/Stopwatch/stop_A01_t01: RuntimeError # Issue 7728, timer not supported in jsshell
 LibTest/core/Uri/Uri_A06_t03: Pass, Slow
-LibTest/isolate/Isolate/spawn_A03_t01: Pass # co19 issue 77
+LibTest/isolate/Isolate/spawn_A03_t01: RuntimeError # Please triage this failure
 LibTest/isolate/Isolate/spawn_A03_t03: RuntimeError # Please triage this failure
 LibTest/isolate/Isolate/spawn_A03_t04: RuntimeError # Please triage this failure
 LibTest/isolate/Isolate/spawn_A04_t02: RuntimeError # Please triage this failure
@@ -825,8 +819,6 @@
 LibTest/async/DeferredLibrary/*: Skip # Issue 17458
 
 [ $compiler == dart2js && $browser ]
-Language/Classes/deсlarations_t01: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t34: Skip # Times out. Please triage this failure.
 LayoutTests/fast/mediastream/getusermedia_t01: Pass, RuntimeError, Timeout # Please triage this failure.
 LayoutTests/fast/css-generated-content/bug91547_t01: Skip # Test reloads itself. Issue 18558.
 LayoutTests/fast/filesystem/file-after-reload-crash_t01: Skip # Test reloads itself. Issue 18558.
@@ -985,6 +977,7 @@
 LayoutTests/fast/canvas/2d.text.draw.fill.maxWidth.negative_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/2d.text.draw.fill.maxWidth.veryLarge_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/2d.text.draw.fill.maxWidth.verySmall_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/DrawImageSinglePixelStretch_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/alpha_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-arc-negative-radius_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-as-image-incremental-repaint_t01: Skip # Times out. Please triage this failure
@@ -1009,6 +1002,7 @@
 LayoutTests/fast/canvas/webgl/buffer-data-array-buffer_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias-t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/context-lost-restored_t01: Pass, Timeout # Please triage this failure
+LayoutTests/fast/canvas/webgl/oes-vertex-array-object_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgb565_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba4444_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba5551_t01: RuntimeError # Please triage this failure
@@ -1020,6 +1014,7 @@
 LayoutTests/fast/canvas/webgl/webgl-depth-texture_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/webgl-large-texture_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/webgl-layer-update_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/canvas/webgl/webgl-specific_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css-generated-content/hit-test-generated-content_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/css-generated-content/malformed-url_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/css-generated-content/pseudo-animation-before-onload_t01: Pass, RuntimeError # Please triage this failure
@@ -1074,10 +1069,10 @@
 LayoutTests/fast/css/aspect-ratio-inheritance_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/css/aspect-ratio-parsing-tests_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/css/auto-min-size_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/background-serialize_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/checked-pseudo-selector_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/content/content-none_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/content/content-normal_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css/content/content-quotes-05_t01: RuntimeError # Issue https://github.com/dart-lang/co19/issues/46
 LayoutTests/fast/css/counters/complex-before_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/css-escaped-identifier_t01: RuntimeError # co19 issue 14
 LayoutTests/fast/css/css-properties-case-insensitive_t01: RuntimeError # Please triage this failure
@@ -1102,6 +1097,7 @@
 LayoutTests/fast/css/getComputedStyle/computed-style-border-image_t01: RuntimeError # co19 issue 14
 LayoutTests/fast/css/getComputedStyle/computed-style-cross-fade_t01: RuntimeError # co19 issue 14
 LayoutTests/fast/css/getComputedStyle/font-family-fallback-reset_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/getComputedStyle/getComputedStyle-zIndex-auto_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/getPropertyValue-border_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/html-attr-case-sensitivity_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/id-or-class-before-stylesheet_t01: RuntimeError # Please triage this failure
@@ -1186,6 +1182,8 @@
 LayoutTests/fast/dom/HTMLImageElement/image-alt-text_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLImageElement/parse-src_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLInputElement/input-image-alt-text_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLLabelElement/click-label_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLLabelElement/form/test1_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLLinkElement/link-beforeload-recursive_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/dom/HTMLLinkElement/resolve-url-on-insertion_t01: RuntimeError # Issue 18010
 LayoutTests/fast/dom/HTMLObjectElement/beforeload-set-text-crash_t01: Skip # Times out. Please triage this failure
@@ -1267,6 +1265,7 @@
 LayoutTests/fast/dom/shadow/event-path_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/shadow/host-context-pseudo-class-css-text_t01: RuntimeError # https://github.com/dart-lang/co19/issues/49
 LayoutTests/fast/dom/shadow/host-pseudo-class-css-text_t01: RuntimeError # https://github.com/dart-lang/co19/issues/49
+LayoutTests/fast/dom/shadow/link-in-shadow-tree_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/shadow/olderShadowRoot_t01: RuntimeError # Issue 26729
 LayoutTests/fast/dom/shadow/pseudoclass-update-checked-option_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-optgroup_t01: RuntimeError # Please triage this failure
@@ -1347,6 +1346,7 @@
 LayoutTests/fast/forms/file/file-input-capture_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/focus-style-pending_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/forms/focus_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/forms/form-attribute-nonexistence-form-id_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/form-attribute_t01: RuntimeError # Issue 25155
 LayoutTests/fast/forms/input-appearance-elementFromPoint_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/input-hit-test-border_t01: Pass, RuntimeError # Please triage this failure
@@ -1357,9 +1357,11 @@
 LayoutTests/fast/forms/menulist-selection-reset_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/menulist-submit-without-selection_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/multiple-selected-options-innerHTML_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/onchange-change-type_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/option-change-single-selected_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/option-strip-unicode-spaces_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/parser-associated-form-removal_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/paste-into-textarea_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/plaintext-mode-1_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/search-popup-crasher_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/select-change-popup-to-listbox-in-event-handler_t01: Skip # Times out. Please triage this failure
@@ -1375,6 +1377,7 @@
 LayoutTests/fast/forms/validationMessage_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/validity-property_t01: RuntimeError # Issue 25155
 LayoutTests/fast/forms/willvalidate_t01: RuntimeError # Issue 25155
+LayoutTests/fast/html/empty-fragment-id-goto-top_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/html/hidden-attr_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/html/imports/import-element-removed-flag_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/html/imports/import-events_t01: RuntimeError # Please triage this failure
@@ -1386,7 +1389,6 @@
 LayoutTests/fast/inline/parent-inline-element-padding-contributes-width_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/inline/positioned-element-padding-contributes-width_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/innerHTML/innerHTML-uri-resolution_t01: RuntimeError # co19 issue 14
-LayoutTests/fast/innerHTML/innerHTML-uri-resolution_t01: RuntimeError # co19 issue 14
 LayoutTests/fast/layers/zindex-hit-test_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/loader/about-blank-hash-change_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/loader/about-blank-hash-kept_t01: Skip # Times out. Please triage this failure
@@ -1436,8 +1438,10 @@
 LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-margin-right_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-image-margin_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-image-margin_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-inset-rounded-different-writing-modes-left_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-inset-rounded-different-writing-modes-right_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/shapes/shape-outside-floats/shape-outside-rounded-boxes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-rounded-boxes_t02: RuntimeError # Please triage this failure
 LayoutTests/fast/speechsynthesis/speech-synthesis-boundary-events_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/speechsynthesis/speech-synthesis-cancel_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/speechsynthesis/speech-synthesis-pause-resume_t01: Skip # Times out. Please triage this failure
@@ -1480,6 +1484,7 @@
 LayoutTests/fast/text/international/rtl-text-wrapping_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/text/international/thai-offsetForPosition-inside-character_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/text/ipa-tone-letters_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/text/line-break-after-question-mark_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/text/offsetForPosition-cluster-at-zero_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/text/remove-zero-length-run_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/text/sub-pixel/text-scaling-ltr_t01: Pass, RuntimeError # Please triage this failure
@@ -1487,6 +1492,7 @@
 LayoutTests/fast/text/sub-pixel/text-scaling-rtl_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/text/sub-pixel/text-scaling-vertical_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/text/sub-pixel/text-scaling-webfont_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/text/text-combine-shrink-to-fit_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/transforms/bounding-rect-zoom_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/transforms/hit-test-large-scale_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/url/file-http-base_t01: RuntimeError # Please triage this failure
@@ -1524,7 +1530,6 @@
 LayoutTests/fast/xpath/attr-namespace_t02: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/ensure-null-namespace_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/implicit-node-args_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/xpath/invalid-resolver_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/node-name-case-sensitivity_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/node-name-case-sensitivity_t02: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/position_t01: RuntimeError # Please triage this failure
@@ -1558,8 +1563,6 @@
 LibTest/html/Element/focus_A01_t01: Skip # Times out. Please triage this failure
 LibTest/html/Element/getAttributeNS_A01_t01: RuntimeError # Issue 16395
 LibTest/html/Element/getNamespacedAttributes_A01_t01: RuntimeError # Issue 16395
-LibTest/html/Element/isContentEditable_A01_t01: RuntimeError # Please triage this failure
-LibTest/html/Element/isContentEditable_A02_t01: RuntimeError # Please triage this failure
 LibTest/html/Element/isTagSupported_A01_t01: RuntimeError # Issue 25155
 LibTest/html/Element/marginEdge_A01_t01: RuntimeError # Issue 16574
 LibTest/html/Element/mouseWheelEvent_A01_t01: Skip # Times out. Please triage this failure
@@ -1598,7 +1601,6 @@
 LibTest/html/IFrameElement/focus_A01_t01: Skip # Times out. Please triage this failure
 LibTest/html/IFrameElement/getNamespacedAttributes_A01_t01: RuntimeError # Please triage this failure
 LibTest/html/IFrameElement/innerHtml_A01_t01: RuntimeError # Please triage this failure
-LibTest/html/IFrameElement/isContentEditable_A01_t01: RuntimeError # Please triage this failure
 LibTest/html/IFrameElement/leftView_A01_t01: Skip # Times out. Please triage this failure
 LibTest/html/IFrameElement/marginEdge_A01_t01: RuntimeError # Issue 16574
 LibTest/html/IFrameElement/offsetTo_A01_t01: RuntimeError # Please triage this failure
@@ -1636,6 +1638,7 @@
 WebPlatformTest/Utils/test/asyncTestFail_t01: RuntimeError # Please triage this failure
 WebPlatformTest/Utils/test/asyncTestFail_t02: RuntimeError # Please triage this failure
 WebPlatformTest/Utils/test/asyncTestTimeout_t01: Skip # Times out. Please triage this failure
+WebPlatformTest/custom-elements/concepts/type_A03_t01: RuntimeError # Please triage this failure
 WebPlatformTest/custom-elements/concepts/type_A05_t01: RuntimeError # Please triage this failure
 WebPlatformTest/custom-elements/concepts/type_A06_t01: RuntimeError # Please triage this failure
 WebPlatformTest/custom-elements/instantiating/createElementNS_A02_t01: RuntimeError # Issue 25155
@@ -1797,16 +1800,9 @@
 WebPlatformTest/webstorage/event_constructor_t01: RuntimeError # Please triage this failure
 WebPlatformTest/webstorage/event_constructor_t02: RuntimeError # Please triage this failure
 
-[ $compiler == dart2js && $runtime == chrome && $fast_startup ]
-WebPlatformTest/custom-elements/concepts/type_A04_t01: RuntimeError # Please triage this failure
-WebPlatformTest/custom-elements/instantiating/createElement_A04_t01: RuntimeError # Please triage this failure
-WebPlatformTest/custom-elements/instantiating/isAttribute_A02_t01: RuntimeError # Please triage this failure
-WebPlatformTest/custom-elements/instantiating/namespace_A01_t01: RuntimeError # Please triage this failure
-
-[ $compiler == dart2js && $runtime == chrome && $fast_startup == false ]
-WebPlatformTest/custom-elements/concepts/type_A03_t01: RuntimeError # Please triage this failure
-
-[ $compiler == dart2js && $runtime == chrome && $checked ]
+[ $compiler == dart2js && $runtime == chrome && $checked]
+LayoutTests/fast/canvas/webgl/framebuffer-object-attachment_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/read-pixels-test_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css-intrinsic-dimensions/css-tables_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-absolutes_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-blocks_t01: RuntimeError # Please triage this failure
@@ -1846,13 +1842,13 @@
 LayoutTests/fast/multicol/fixed-column-percent-logical-height-orthogonal-writing-mode_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/multicol/vertical-lr/image-inside-nested-blocks-with-border_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/replaced/available-height-for-content_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor-vertical-lr_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/replaced/computed-image-width-with-percent-height-inside-table-cell-and-fixed-ancestor_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/shapes/parsing/parsing-shape-image-threshold_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/shapes/parsing/parsing-shape-margin_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/shapes/parsing/parsing-shape-outside_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/table/absolute-table-percent-lengths_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/css-table-width-with-border-padding_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/table/css-table-width_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/table/fixed-table-layout-width-change_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/table/html-table-width-max-width-constrained_t01: RuntimeError # Please triage this failure
@@ -1863,13 +1859,11 @@
 LayoutTests/fast/table/switch-table-layout_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/table/table-width-exceeding-max-width_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/text/line-break-after-inline-latin1_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/xmlhttprequest/xmlhttprequest-bad-mimetype_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/xmlhttprequest/xmlhttprequest-invalid-values_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/4XPath/Core/test_parser_t01: RuntimeError # Dartium JSInterop failure
 LayoutTests/fast/xpath/py-dom-xpath/axes_t01: RuntimeError # Dartium JSInterop failure
 LayoutTests/fast/xpath/xpath-result-eventlistener-crash_t01: RuntimeError # Please triage this failure
-LibTest/html/Node/ownerDocument_A01_t01: RuntimeError # Issue 18251
 LibTest/html/Element/Element.tag_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Node/ownerDocument_A01_t01: RuntimeError # Issue 18251
 WebPlatformTest/DOMEvents/approved/Propagation.path.target.removed_t01: RuntimeError # Please triage this failure
 WebPlatformTest/custom-elements/instantiating/createElementNS_A05_t01: RuntimeError # Please triage this failure
 WebPlatformTest/custom-elements/instantiating/createElement_A05_t01: RuntimeError # Please triage this failure
@@ -1882,12 +1876,13 @@
 [ $compiler == dart2js && $runtime == chrome && $system == macos ]
 Language/Expressions/Function_Invocation/async_invokation_t04: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/canvas-test_t01: Skip # Times out. Please triage this failure
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba5551_t01: Skip # Times out flakily.
 LayoutTests/fast/canvas/webgl/context-lost-restored_t01: Skip # Times out. Please triage this failure.
 LayoutTests/fast/canvas/webgl/draw-webgl-to-canvas-2d_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/oes-vertex-array-object_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba5551_t01: Skip # Times out flakily.
 LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/MutationObserver/observe-attributes_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/forms/percent-height-auto-width-form-controls_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/multicol/newmulticol/balance_t04: RuntimeError # Please triage this failure
 LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-inset-rounded-different-writing-modes-left_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/shapes/shape-outside-floats/shape-outside-rounded-boxes_t02: RuntimeError # Please triage this failure
@@ -1895,8 +1890,13 @@
 LayoutTests/fast/text/line-break-after-question-mark_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/text/text-combine-shrink-to-fit_t01: RuntimeError # Please triage this failure
 LibTest/async/Timer/Timer.periodic_A01_t01: Skip # Times out. Please triage this failure
+LibTest/isolate/Isolate/spawn_A01_t05: Skip # Times out. Please triage this failure
 WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-002_t01: Skip # Times out. Please triage this failure
 
+[ $compiler == dart2js && $runtime == chrome && $system == windows ]
+Language/Classes/Constructors/Generative_Constructors/execution_of_an_initializer_t04: Pass, Slow # Issue 25940
+Language/Expressions/Bitwise_Expressions/method_invocation_super_t01: Pass, Slow # Issue 25940
+
 [ $compiler == dart2js && $runtime == chrome && $system != macos ]
 LayoutTests/fast/canvas/webgl/WebGLContextEvent_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/array-bounds-clamping_t01: RuntimeError # Please triage this failure
@@ -1951,7 +1951,6 @@
 LayoutTests/fast/canvas/webgl/null-uniform-location_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/object-deletion-behaviour_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/oes-element-index-uint_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/oes-vertex-array-object_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/point-size_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/premultiplyalpha-test_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/program-test_t01: RuntimeError # Please triage this failure
@@ -1991,30 +1990,18 @@
 LayoutTests/fast/canvas/webgl/webgl-composite-modes-repaint_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/webgl-composite-modes_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/webgl-exceptions_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/webgl-layer-update_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/webgl-specific_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/webgl-texture-binding-preserved_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/webgl-unprefixed-context-id_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/webgl-viewport-parameters-preserved_t01: RuntimeError # Please triage this failure
+
+[ $compiler == dart2js && $runtime == chrome && $system == linux]
 LayoutTests/fast/multicol/newmulticol/balance_t04: RuntimeError # Please triage this failure
 LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-inset-rounded-different-writing-modes-left_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/shapes/shape-outside-floats/shape-outside-rounded-boxes_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/text/international/combining-marks-position_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/text/line-break-after-question-mark_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/text/regional-indicator-symobls_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/text/text-combine-shrink-to-fit_t01: RuntimeError # Please triage this failure
-
-[ $compiler == dart2js && $runtime == chrome && $system == windows ]
-Language/Expressions/Bitwise_Expressions/method_invocation_super_t01: Pass, Slow # Issue 25940
-Language/Classes/Constructors/Generative_Constructors/execution_of_an_initializer_t04: Pass, Slow # Issue 25940
-
-[ $compiler == dart2js && $runtime == chrome && $system == linux]
-LayoutTests/fast/css/background-serialize_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/HTMLLabelElement/click-label_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/HTMLLabelElement/form/test1_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/forms/form-attribute-nonexistence-form-id_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/forms/onchange-change-type_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/html/empty-fragment-id-goto-top_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/text/international/combining-marks-position_t01: RuntimeError # Please triage this failure
 LibTest/math/log_A01_t01: RuntimeError # Please triage this failure
 
 [ $compiler == dart2js && $runtime == drt ]
@@ -2236,8 +2223,8 @@
 LayoutTests/fast/dom/HTMLOutputElement/dom-settable-token-list_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLScriptElement/async-onbeforeload_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLScriptElement/defer-onbeforeload_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLScriptElement/isURLAttribute_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/dom/HTMLScriptElement/remove-in-beforeload_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/HTMLScriptElement/remove-source_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLSelectElement/remove-element-from-within-focus-handler-crash_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLSelectElement/selected-index-preserved-when-option-text-changes_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLTemplateElement/custom-element-wrapper-gc_t01: RuntimeError # Please triage this failure
@@ -2293,7 +2280,6 @@
 LayoutTests/fast/events/change-overflow-on-overflow-change_t01: Skip # Times out.
 LayoutTests/fast/events/document-elementFromPoint_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/events/event-creation_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/events/event-listener-html-non-html-confusion_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/events/event-trace_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/events/initkeyboardevent-crash_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/events/invalid-003_t01: RuntimeError # Please triage this failure
@@ -2334,7 +2320,7 @@
 LayoutTests/fast/loader/about-blank-hash-kept_t01: Skip # Times out.
 LayoutTests/fast/loader/hashchange-event-properties_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/loader/onhashchange-attribute-listeners_t01: Skip # Times out.
-LayoutTests/fast/loader/scroll-position-restored-on-back_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/loader/scroll-position-restored-on-back_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/loader/scroll-position-restored-on-reload-at-load-event_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/loader/stateobjects/replacestate-in-onunload_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/masking/parsing-clip-path-shape_t01: RuntimeError # Please triage this failure
@@ -2544,6 +2530,7 @@
 WebPlatformTest/Utils/test/asyncTestFail_t01: RuntimeError # Please triage this failure
 WebPlatformTest/Utils/test/asyncTestFail_t02: RuntimeError # Please triage this failure
 WebPlatformTest/Utils/test/asyncTestTimeout_t01: Skip # Times out.
+WebPlatformTest/custom-elements/concepts/type_A03_t01: RuntimeError # Please triage this failure
 WebPlatformTest/custom-elements/concepts/type_A05_t01: RuntimeError # Please triage this failure
 WebPlatformTest/custom-elements/concepts/type_A06_t01: RuntimeError # Please triage this failure
 WebPlatformTest/dom/EventTarget/dispatchEvent_A02_t01: RuntimeError # Please triage this failure
@@ -2673,24 +2660,28 @@
 WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/test-009_t01: RuntimeError # Please triage this failure
 WebPlatformTest/webstorage/event_constructor_t01: RuntimeError # Please triage this failure
 WebPlatformTest/webstorage/event_constructor_t02: RuntimeError # Please triage this failure
+WebPlatformTest/webstorage/event_local_key_t01: Skip # Times out. Please triage this failure
+WebPlatformTest/webstorage/event_local_newvalue_t01: Skip # Times out. Please triage this failure
+WebPlatformTest/webstorage/event_local_oldvalue_t01: Skip # Times out. Please triage this failure
+WebPlatformTest/webstorage/event_local_storagearea_t01: Skip # Times out. Please triage this failure
+WebPlatformTest/webstorage/event_local_url_t01: Skip # Times out. Please triage this failure
+WebPlatformTest/webstorage/event_session_key_t01: Skip # Times out. Please triage this failure
+WebPlatformTest/webstorage/event_session_newvalue_t01: Skip # Times out. Please triage this failure
+WebPlatformTest/webstorage/event_session_oldvalue_t01: Skip # Times out. Please triage this failure
+WebPlatformTest/webstorage/event_session_storagearea_t01: Skip # Times out. Please triage this failure
+WebPlatformTest/webstorage/event_session_url_t01: Skip # Times out. Please triage this failure
 
-[ $compiler == dart2js && $runtime == drt && $fast_startup ]
-WebPlatformTest/custom-elements/concepts/type_A04_t01: RuntimeError # Please triage this failure
-WebPlatformTest/custom-elements/instantiating/createElementNS_A02_t01: RuntimeError # Please triage this failure
-WebPlatformTest/custom-elements/instantiating/createElementNS_A03_t01: RuntimeError # Please triage this failure
-WebPlatformTest/custom-elements/instantiating/createElement_A02_t01: RuntimeError # Please triage this failure
-WebPlatformTest/custom-elements/instantiating/createElement_A03_t01: RuntimeError # Please triage this failure
-WebPlatformTest/custom-elements/instantiating/createElement_A04_t01: RuntimeError # Please triage this failure
-WebPlatformTest/custom-elements/instantiating/isAttribute_A01_t01: RuntimeError # Please triage this failure
-WebPlatformTest/custom-elements/instantiating/isAttribute_A01_t02: RuntimeError # Please triage this failure
-WebPlatformTest/custom-elements/instantiating/isAttribute_A02_t01: RuntimeError # Please triage this failure
-WebPlatformTest/custom-elements/instantiating/namespace_A01_t01: RuntimeError # Please triage this failure
+[ $compiler == dart2js && $runtime == drt && $minified && $csp ]
+LayoutTests/fast/dom/HTMLScriptElement/script-for-attribute-unexpected-execution_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLScriptElement/script-reexecution_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLTemplateElement/inertContents_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Range/create-contextual-fragment-script-unmark-already-started_t01: RuntimeError # Please triage this failure
 
-[ $compiler == dart2js && $runtime == drt && $fast_startup == false ]
-WebPlatformTest/custom-elements/concepts/type_A03_t01: RuntimeError # Please triage this failure
+[ $compiler == dart2js && $runtime == drt && $minified != true && $csp != true]
+LayoutTests/fast/dom/HTMLScriptElement/remove-source_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/event-listener-html-non-html-confusion_t01: RuntimeError # Please triage this failure
 
 [ $compiler == dart2js && $runtime == drt && $fast_startup && $checked ]
-WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/ownerdocument-001_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css-grid-layout/auto-content-resolution-rows_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css-grid-layout/breadth-size-resolution-grid_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css-grid-layout/calc-resolution-grid-item_t01: RuntimeError # Please triage this failure
@@ -2741,7 +2732,6 @@
 LayoutTests/fast/flexbox/intrinsic-min-width-applies-with-fixed-width_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/html/article-element_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/html/aside-element_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/inline/empty-inline-before-collapsed-space_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/inline/inline-with-empty-inline-children_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/inline/parent-inline-element-padding-contributes-width_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/inline/positioned-element-padding-contributes-width_t01: RuntimeError # Please triage this failure
@@ -2749,7 +2739,6 @@
 LayoutTests/fast/multicol/fixed-column-percent-logical-height-orthogonal-writing-mode_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/multicol/vertical-lr/float-truncation_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/multicol/vertical-lr/image-inside-nested-blocks-with-border_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/parser/pre-first-line-break_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/replaced/available-height-for-content_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/shapes/parsing/parsing-shape-image-threshold_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/shapes/parsing/parsing-shape-margin_t01: RuntimeError # Please triage this failure
@@ -2764,17 +2753,15 @@
 LayoutTests/fast/table/table-rowspan-cell-with-empty-cell_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/text/line-break-after-inline-latin1_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/text/text-combine-shrink-to-fit_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/url/trivial-segments_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/url/trivial_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/writing-mode/auto-sizing-orthogonal-flows_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/xpath-result-eventlistener-crash_t01: RuntimeError # Please triage this failure
 LibTest/html/Node/ownerDocument_A01_t01: RuntimeError # Please triage this failure
 WebPlatformTest/DOMEvents/approved/Propagation.path.target.removed_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/createElementNS_A05_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/createElement_A05_t01: RuntimeError # Please triage this failure
 WebPlatformTest/dom/nodes/DOMImplementation-createDocumentType_t01: RuntimeError # Please triage this failure
-WebPlatformTest/html-templates/parsing-html-templates/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-body-context_t01: RuntimeError # Please triage this failure
-WebPlatformTest/html-templates/parsing-html-templates/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-context_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html-templates/parsing-html-templates/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-row-context_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/dom/elements/global-attributes/dataset-enumeration_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/ownerdocument-001_t01: RuntimeError # Please triage this failure
 
 [ $compiler == dart2js && $runtime == drt && $checked == false ]
 LayoutTests/fast/xpath/invalid-resolver_t01: RuntimeError # Please triage this failure
@@ -2794,7 +2781,6 @@
 LayoutTests/fast/backgrounds/background-repeat-computed-style_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/backgrounds/background-shorthand-with-backgroundSize-style_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/backgrounds/mask-box-image-width_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/backgrounds/multiple-backgrounds-computed-style_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/backgrounds/repeat/parsing-background-repeat_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/borders/border-color-visited_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/borders/border-radius-child_t01: Pass, RuntimeError # Please triage this failure
@@ -2809,9 +2795,9 @@
 LayoutTests/fast/canvas/alpha_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-arc-negative-radius_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-blend-solid_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/canvas-blending-text_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-composite-canvas_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-composite-image_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-composite-text-alpha_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-currentColor_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-currentTransform_t01: RuntimeError # Feature is not implemented.
 LayoutTests/fast/canvas/canvas-drawImage-incomplete_t01: RuntimeError # Please triage this failure
@@ -2819,7 +2805,6 @@
 LayoutTests/fast/canvas/canvas-empty-image-pattern_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-fill-zeroSizeGradient_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-fillRect-zeroSizeGradient_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/canvas-fillText-invalid-maxWidth_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-fillText-zeroSizeGradient_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-font-ex-units-crash_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-frameless-document-text_t01: RuntimeError # Please triage this failure
@@ -2843,36 +2828,37 @@
 LayoutTests/fast/canvas/canvas-strokeRect-alpha-shadow_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-strokeRect-gradient-shadow_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-strokeRect-zeroSizeGradient_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/canvas-strokeText-invalid-maxWidth_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-strokeText-zeroSizeGradient_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css/test-setting-canvas-color_t01: Pass, RuntimeError # co19 issue 64 (depends on the FF version)
 LayoutTests/fast/canvas/canvas-toDataURL-crash_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/draw-custom-focus-ring_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/drawImage-with-valid-image_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/getPutImageDataPairTest_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/rgba-parsing_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/WebGLContextEvent_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/buffer-data-array-buffer_t01: RuntimeError # Issue 27872
 LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias-t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/context-destroyed-crash_t01: Pass, RuntimeError # Issue 26898
 LayoutTests/fast/canvas/webgl/context-lost-restored_t01: Pass, RuntimeError # Issue 26898
 LayoutTests/fast/canvas/webgl/context-lost_t01: Pass, RuntimeError # Issue 26898
+LayoutTests/fast/canvas/webgl/gl-enum-tests_t01: RuntimeError # Issue 27872
+LayoutTests/fast/canvas/webgl/gl-get-calls_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/renderer-and-vendor-strings_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view_t01: Skip # Times out.
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgb565_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba4444_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba5551_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/tex-input-validation_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/tex-sub-image-2d-bad-args_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/texture-transparent-pixels-initialized_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/uniform-location_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/uninitialized-test_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/webgl-depth-texture_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/webgl-large-texture_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-generated-content/details-before-after-content_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css-generated-content/malformed-url_t01: Skip # Times out. Please triage this failure
-LayoutTests/fast/css-generated-content/pseudo-animation_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/css-generated-content/pseudo-animation-before-onload_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/css-generated-content/pseudo-animation-display_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/css-generated-content/pseudo-animation_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/css-generated-content/pseudo-element-events_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/css-generated-content/pseudo-transition-event_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/css-generated-content/pseudo-transition_t01: RuntimeError # Please triage this failure
@@ -2925,7 +2911,6 @@
 LayoutTests/fast/css-intrinsic-dimensions/multicol_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css-intrinsic-dimensions/tables_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css-intrinsic-dimensions/width-property-value_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css-intrinsic-dimensions/width-shrinks-avoid-floats_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/aspect-ratio-inheritance_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/aspect-ratio-parsing-tests_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/auto-min-size_t01: RuntimeError # Please triage this failure
@@ -2938,7 +2923,6 @@
 LayoutTests/fast/css/border-shorthand-initialize-longhands_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/border-start-end_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/border-width-large_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css/box-sizing-backwards-compat-prefix_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/checked-pseudo-selector_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/child-selector-implicit-tbody_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/content/content-none_t01: RuntimeError # Please triage this failure
@@ -2948,14 +2932,11 @@
 LayoutTests/fast/css/counters/counter-cssText_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/counters/counter-reset-subtree-insert-crash_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/css-escaped-identifier_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css/css-keyframe-style-crash_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css/css-keyframe-unexpected-end_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/css-properties-case-insensitive_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/css3-nth-tokens-style_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/csstext-of-content-string_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/cursor-parsing-image-set_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/cursor-parsing_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css/deprecated-flex-box-zero-width-intrinsic-max-width_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/deprecated-flexbox-auto-min-size_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/draggable-region-parser_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/dynamic-class-backdrop-pseudo_t01: RuntimeError # Please triage this failure
@@ -2994,6 +2975,7 @@
 LayoutTests/fast/css/inherited-properties-rare-text_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/insertRule-font-face_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/insertRule-media_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/invalid-hex-color_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/invalid-import-rule-insertion_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/invalid-predefined-color_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/invalidation/clears-invalidation-whole-tree_t01: RuntimeError # Please triage this failure
@@ -3059,6 +3041,7 @@
 LayoutTests/fast/css/style-scoped/style-scoped-scoping-nodes-different-order_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/style-scoped/style-scoped-shadow-crash_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/style-scoped/style-scoped-with-important-rule_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/test-setting-canvas-color_t01: Pass, RuntimeError # co19 issue 64 (depends on the FF version)
 LayoutTests/fast/css/text-align-webkit-match-parent-parse_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/text-align-webkit-match-parent_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/unicode-bidi-computed-value_t01: RuntimeError # Please triage this failure
@@ -3109,6 +3092,7 @@
 LayoutTests/fast/dom/HTMLDialogElement/dialog-close-event_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLDialogElement/dialog-enabled_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLDialogElement/dialog-open_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/dialog-return-value_t01: RuntimeError # Dartium JSInterop failure
 LayoutTests/fast/dom/HTMLDialogElement/dialog-scrolled-viewport_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLDialogElement/dialog-show-modal_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLDialogElement/inert-does-not-match-disabled-selector_t01: RuntimeError # Please triage this failure
@@ -3158,6 +3142,7 @@
 LayoutTests/fast/dom/HTMLInputElement/input-hidden-value_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLInputElement/input-image-alt-text_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLLabelElement/click-label_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLLabelElement/form/test1_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/dom/HTMLLinkElement/link-beforeload-recursive_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/dom/HTMLLinkElement/link-onerror-stylesheet-with-existent-and-non-existent-import_t01: Pass, RuntimeError # Please triage this failure
@@ -3172,6 +3157,7 @@
 LayoutTests/fast/dom/HTMLOptionElement/collection-setter-getter_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLOutputElement/dom-settable-token-list_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-validity_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement_t01: RuntimeError # Issue 26714
 LayoutTests/fast/dom/HTMLProgressElement/set-progress-properties_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLScriptElement/async-false-inside-async-false-load_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLScriptElement/async-inline-script_t01: RuntimeError # Please triage this failure
@@ -3232,7 +3218,6 @@
 LayoutTests/fast/dom/Window/window-resize_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/Window/window-screen-properties_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/dom/Window/window-scroll-arguments_t01: RuntimeError # Issue 22564
-LayoutTests/fast/dom/XMLSerializer-attribute-entities_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/anchor-origin_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/anchor-without-content_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/attribute-namespaces-get-set_t01: RuntimeError # Please triage this failure
@@ -3243,6 +3228,7 @@
 LayoutTests/fast/dom/click-method-on-html-element_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/client-width-height-quirks_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/containerNode_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/dom/createElementNS-namespace-errors_t01: RuntimeError # Issue 27873
 LayoutTests/fast/dom/css-delete-doc_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/css-rule-functions_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/css-selectorText_t01: RuntimeError # Please triage this failure
@@ -3281,8 +3267,6 @@
 LayoutTests/fast/dom/horizontal-scrollbar-in-rtl-doesnt-fire-onscroll_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/horizontal-scrollbar-in-rtl_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/horizontal-scrollbar-when-dir-change_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/HTMLDialogElement/dialog-return-value_t01: RuntimeError # Dartium JSInterop failure
-LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement_t01: RuntimeError # Issue 26714
 LayoutTests/fast/dom/icon-size-property_t01: RuntimeError # Issue 26714
 LayoutTests/fast/dom/importNode-unsupported-node-type_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/insert-span-into-long-text-bug-28245_t01: RuntimeError # Please triage this failure
@@ -3443,7 +3427,6 @@
 LayoutTests/fast/filesystem/filesystem-reference_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/filesystem/filesystem-unserializable_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/filesystem/filesystem-uri-origin_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/filesystem/input-access-entries_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/filesystem/op-copy_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/filesystem/op-get-entry_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/filesystem/op-get-metadata_t01: RuntimeError # Please triage this failure
@@ -3464,8 +3447,6 @@
 LayoutTests/fast/filesystem/snapshot-file-with-gc_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/flexbox/box-orient-button_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/flexbox/box-size-integer-overflow_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/flexbox/flexing-overflow-scroll-item_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/flexbox/repaint-scrollbar_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/11423_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/4628409_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/8250_t01: RuntimeError # Please triage this failure
@@ -3484,8 +3465,8 @@
 LayoutTests/fast/forms/autofocus-opera-005_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/autofocus-opera-007_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/forms/autofocus-readonly-attribute_t01: Skip # Times out. Please triage this failure
-LayoutTests/fast/forms/button/button-disabled-blur_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/forms/button-baseline-and-collapsing_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/forms/button/button-disabled-blur_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/forms/checkValidity-001_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/forms/checkValidity-002_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/forms/checkValidity-004_t01: Pass, RuntimeError # Please triage this failure
@@ -3506,7 +3487,6 @@
 LayoutTests/fast/forms/date/input-valueasdate-date_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/date/input-valueasnumber-date_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-change-layout-by-value_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/forms/datetimelocal/input-valueasnumber-datetimelocal_t01: RuntimeError # Dartium JSInterop failure
 LayoutTests/fast/forms/datetimelocal/ValidityState-rangeOverflow-datetimelocal_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/datetimelocal/ValidityState-rangeUnderflow-datetimelocal_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/datetimelocal/ValidityState-stepMismatch-datetimelocal_t01: RuntimeError # Please triage this failure
@@ -3514,12 +3494,14 @@
 LayoutTests/fast/forms/datetimelocal/datetimelocal-input-type_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/datetimelocal/datetimelocal-pseudo-classes_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/datetimelocal/input-valueasdate-datetimelocal_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/datetimelocal/input-valueasnumber-datetimelocal_t01: RuntimeError # Dartium JSInterop failure
 LayoutTests/fast/forms/delete-text-with-invisible-br_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/fieldset/fieldset-disabled_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/fieldset/fieldset-elements_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/file/file-input-capture_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/focus-style-pending_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/forms/focus_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/form-attribute-nonexistence-form-id_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/form-attribute_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/form-dirname-attribute_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/formmethod-attribute-button-html_t01: Pass, RuntimeError # Please triage this failure
@@ -3565,8 +3547,8 @@
 LayoutTests/fast/forms/setCustomValidity-existence_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/setrangetext_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/shadow-tree-exposure_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/forms/submit-form-with-dirname-attribute_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/forms/submit-form-with-dirname-attribute-with-ancestor-dir-attribute_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/forms/submit-form-with-dirname-attribute_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/forms/text-control-select-blurred_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/textarea-maxlength_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/textarea-no-scroll-on-blur_t01: RuntimeError # Please triage this failure
@@ -3585,7 +3567,6 @@
 LayoutTests/fast/html/details-add-details-child-1_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/html/details-add-details-child-2_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/html/details-click-controls_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/html/details-mouse-click_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/html/figcaption-element_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/html/figure-element_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/html/footer-element_t01: RuntimeError # Please triage this failure
@@ -3699,11 +3680,11 @@
 LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-inset-rounded-different-writing-modes-right_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/shapes/shape-outside-floats/shape-outside-rounded-boxes_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/shapes/shape-outside-floats/shape-outside-rounded-boxes_t02: RuntimeError # Please triage this failure
-LayoutTests/fast/speechsynthesis/speech-synthesis-boundary-events_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/speechsynthesis/speech-synthesis-cancel_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/speechsynthesis/speech-synthesis-pause-resume_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/speechsynthesis/speech-synthesis-speak_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/speechsynthesis/speech-synthesis-utterance-uses-voice_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/speechsynthesis/speech-synthesis-boundary-events_t01:  Skip # Times out. Please triage this failure
+LayoutTests/fast/speechsynthesis/speech-synthesis-cancel_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/speechsynthesis/speech-synthesis-pause-resume_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/speechsynthesis/speech-synthesis-speak_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/speechsynthesis/speech-synthesis-utterance-uses-voice_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/speechsynthesis/speech-synthesis-voices_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/storage/disallowed-storage_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/storage/storage-disallowed-in-data-url_t01: RuntimeError # Please triage this failure
@@ -3749,8 +3730,6 @@
 LayoutTests/fast/text/window-find_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/text/zero-width-characters-complex-script_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/text/zero-width-characters_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/transforms/topmost-becomes-bottomost-for-scrolling_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/transforms/transform-inside-overflow-scroll_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/url/anchor_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/url/file-http-base_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/url/file_t01: RuntimeError # Please triage this failure
@@ -3796,12 +3775,11 @@
 LayoutTests/fast/xpath/attr-namespace_t02: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/ensure-null-namespace_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/implicit-node-args_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/xpath/invalid-resolver_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/node-name-case-sensitivity_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/node-name-case-sensitivity_t02: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/position_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/xpath/py-dom-xpath/axes_t01: RuntimeError # Dartium JSInterop failure
 LayoutTests/fast/xpath/py-dom-xpath/abbreviations_t01: RuntimeError # Dartium JSInterop failure
+LayoutTests/fast/xpath/py-dom-xpath/axes_t01: RuntimeError # Dartium JSInterop failure
 LayoutTests/fast/xpath/py-dom-xpath/data_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/py-dom-xpath/expressions_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/py-dom-xpath/paths_t01: RuntimeError # Please triage this failure
@@ -3910,14 +3888,8 @@
 LibTest/html/Window/resizeBy_A01_t01: RuntimeError # Please triage this failure
 LibTest/html/Window/resizeTo_A01_t01: RuntimeError # Please triage this failure
 LibTest/math/log_A01_t01: Fail # Please triage this failure.
-LibTest/typed_data/Float32List/Float32List.view_A06_t01: RuntimeError # Please triage this failure
 LibTest/typed_data/Float32x4List/Float32x4List.view_A06_t01: RuntimeError # Please triage this failure
-LibTest/typed_data/Float64List/Float64List.view_A06_t01: RuntimeError # Please triage this failure
-LibTest/typed_data/Int16List/Int16List.view_A06_t01: RuntimeError # Please triage this failure
-LibTest/typed_data/Int32List/Int32List.view_A06_t01: RuntimeError # Please triage this failure
 LibTest/typed_data/Int32x4/operator_OR_A01_t01: RuntimeError # Please triage this failure
-LibTest/typed_data/Uint16List/Uint16List.view_A06_t01: RuntimeError # Please triage this failure
-LibTest/typed_data/Uint32List/Uint32List.view_A06_t01: RuntimeError # Please triage this failure
 WebPlatformTest/DOMEvents/approved/EventObject.after.dispatchEvenr_t01: RuntimeError # Please triage this failure
 WebPlatformTest/DOMEvents/approved/ProcessingInstruction.DOMCharacterDataModified_t01: Skip # Times out. Please triage this failure
 WebPlatformTest/DOMEvents/approved/addEventListener.optional.useCapture_t01: RuntimeError # Please triage this failure
@@ -3994,8 +3966,10 @@
 WebPlatformTest/html/dom/elements/global-attributes/dataset-set_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/semantics/embedded-content/media-elements/error-codes/error_t01: Skip # Times out. Please triage this failure
 WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/addTextTrack_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/kind_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/src_t01: RuntimeError # Please triage this failure
-WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues_t01: Skip # Times out. Please triage this failure
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/TextTrack/kind_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/TextTrack/mode_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/semantics/forms/attributes-common-to-form-controls/formAction_document_address_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/semantics/forms/attributes-common-to-form-controls/formaction_t01: RuntimeError # Please triage this failure
@@ -4030,7 +4004,6 @@
 WebPlatformTest/html/semantics/forms/the-option-element/option-text-spaces_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/semantics/grouping-content/the-blockquote-element/grouping-blockquote_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/semantics/grouping-content/the-ol-element/ol.start-reflection_t02: RuntimeError # Please triage this failure
-WebPlatformTest/html/semantics/interactive-elements/the-details-element/toggleEvent_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/semantics/interactive-elements/the-dialog-element/dialog-close_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/semantics/interactive-elements/the-dialog-element/dialog-showModal_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/semantics/scripting-1/the-script-element/script-text_t02: RuntimeError # Please triage this failure
@@ -4039,20 +4012,19 @@
 WebPlatformTest/html/semantics/selectors/pseudo-classes/enabled_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/semantics/selectors/pseudo-classes/focus_t01: Pass, RuntimeError # Please triage this failure
 WebPlatformTest/html/semantics/selectors/pseudo-classes/indeterminate_t01: RuntimeError # Please triage this failure
-WebPlatformTest/html/semantics/selectors/pseudo-classes/inrange-outofrange_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/semantics/tabular-data/the-caption-element/caption_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/semantics/tabular-data/the-table-element/caption-methods_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/semantics/tabular-data/the-table-element/table-insertRow_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/semantics/tabular-data/the-table-element/table-rows_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/syntax/parsing/Document.getElementsByTagName-foreign_t02: RuntimeError # Please triage this failure
 WebPlatformTest/html/syntax/serializing-html-fragments/outerHTML_t01: RuntimeError # Please triage this failure
-WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol_t00: RuntimeError # Please triage this failure
 WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t02: RuntimeError # Please triage this failure
 WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t03: RuntimeError # Please triage this failure
 WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t04: RuntimeError # Please triage this failure
 WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t05: RuntimeError # Please triage this failure
 WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t06: RuntimeError # Please triage this failure
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol_t00: RuntimeError # Please triage this failure
 WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-001_t01: RuntimeError # Please triage this failure
 WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-004_t01: RuntimeError # Please triage this failure
 WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-004_t02: RuntimeError # Please triage this failure
@@ -4157,18 +4129,63 @@
 WebPlatformTest/webstorage/storage_local_setitem_quotaexceedederr_t01: Skip # Times out. Please triage this failure. Note that Chrome also requires the Slow flag. (Could just be a slow test).
 WebPlatformTest/webstorage/storage_session_setitem_quotaexceedederr_t01: Skip # Times out. Please triage this failure
 
+[ $compiler == dart2js && $runtime == ff && $checked == false]
+LayoutTests/fast/xpath/invalid-resolver_t01: RuntimeError # Please triage this failure
+
+[ $compiler == dart2js && $runtime == ff && $system == macos]
+LayoutTests/fast/canvas/canvas-modify-emptyPath_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/innerHTML/005_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/draggable_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/ruby/modify-positioned-ruby-text-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/table-all-rowspans-height-distribution-in-rows-except-overlapped_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/margins-perpendicular-containing-block_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/table-colgroup-present-after-table-row_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/table-rowspan-cell-with-empty-cell_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text-autosizing/vertical-writing-mode_t01: RuntimeError # Please triage this failure
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Atom_A03_t03: RuntimeError # Please triage this failure
+
+[ $compiler == dart2js && $runtime == ff && $checked]
+LayoutTests/fast/css-intrinsic-dimensions/width-shrinks-avoid-floats_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-imageSmoothingEnabled-zero-size_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/framebuffer-object-attachment_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/oes-vertex-array-object_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/read-pixels-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-column-flex-items_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-flex-items_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/box-sizing-border-box-dynamic-padding-border-update_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/display-inline-block-scrollbar_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/fixed-width-intrinsic-width-excludes-scrollbars_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/flexbox/flexing-overflow-scroll-item_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLTableElement/insert-row_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/flexbox/intrinsic-min-width-applies-with-fixed-width_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/lists/marker-preferred-margins_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/replaced/available-height-for-content_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/absolute-table-percent-lengths_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/css-table-width_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/switch-table-layout-dynamic-cells_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/switch-table-layout-multiple-section_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/switch-table-layout_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/line-break-after-inline-latin1_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/xpath-result-eventlistener-crash_t01: RuntimeError # Please triage this failure
+LibTest/html/Node/ownerDocument_A01_t01: RuntimeError # Please triage this failure
+WebPlatformTest/DOMEvents/approved/Propagation.path.target.removed_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/DOMImplementation-createDocumentType_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-templates/parsing-html-templates/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-row-context_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/elements/global-attributes/dataset-enumeration_t01: RuntimeError # Please triage this failure
+
 [ $compiler == dart2js && $runtime == ff && $system == windows ]
-LayoutTests/fast/canvas/webgl/drawingbuffer-test_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/gl-get-calls_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css/font-face-multiple-ranges-for-unicode-range_t01: RuntimeError # Please triage this failure
-WebPlatformTest/html/syntax/parsing/math-parse_t03: RuntimeError # Issue 22564
 Language/Classes/Getters/type_object_t02: RuntimeError, Slow # Issue 25940
 Language/Classes/Abstract_Instance_Members/override_no_named_parameters_t06: Pass, Slow # Issue 25940
 Language/Classes/Constructors/Factories/return_type_t03: Pass, Slow # Issue 25940
 Language/Classes/Constructors/Factories/return_wrong_type_t02: Pass, Slow # Issue 25940
 Language/Classes/Constructors/Factories/return_type_t05: Pass, Slow # Issue 25940
+LayoutTests/fast/canvas/canvas-blending-text_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/draw-webgl-to-canvas-2d_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/drawingbuffer-test_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/syntax/parsing/math-parse_t03: RuntimeError # Issue 22564
 
 [ $compiler == dart2js && $runtime == ff && $system != windows ]
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/4XPath/Core/test_parser_t01: RuntimeError # Dartium JSInterop failure
 LayoutTests/fast/xpath/py-dom-xpath/abbreviations_t01: RuntimeError # Dartium JSInterop failure
 
@@ -4178,6 +4195,10 @@
 LayoutTests/fast/canvas/webgl/oes-element-index-uint_t01: Skip # Times out always
 LayoutTests/fast/canvas/webgl/texture-complete_t01: Skip # Times out sometimes
 LayoutTests/fast/canvas/webgl/texture-npot_t01: Skip # Times out sometimes
+LayoutTests/fast/canvas/webgl/tex-sub-image-2d-bad-args_t01: RuntimeError # Please triage this failure
+
+[ $compiler == dart2js && $runtime == ff && $system != linux]
+LayoutTests/fast/css/font-face-multiple-ranges-for-unicode-range_t01: RuntimeError # Please triage this failure
 
 [ $compiler == dart2js && $runtime == safari ]
 Language/Statements/Yield_and_Yield_Each/Yield/execution_async_t01: RuntimeError # Issue 26615
@@ -5381,7 +5402,7 @@
 LayoutTests/fast/canvas/canvas-blending-shadow_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-blending-text_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-blending-transforms_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/canvas-composite-canvas_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-composite-canvas_t01: Skip # Times out on Windows 8. Please triage this failure
 LayoutTests/fast/canvas/canvas-composite-stroke-alpha_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-composite-text-alpha_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-currentTransform_t01: RuntimeError # Feature is not implemented
@@ -5586,7 +5607,6 @@
 LayoutTests/fast/css/computed-offset-with-zoom_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/content/content-none_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/content/content-normal_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css/content/content-quotes-01_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/content/content-quotes-05_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/css-escaped-identifier_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/css-properties-case-insensitive_t01: RuntimeError # Please triage this failure
@@ -6269,6 +6289,11 @@
 LayoutTests/fast/xpath/reverse-axes_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/xpath-template-element_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xsl/default-html_t01: RuntimeError # Please triage this failure
+LibTest/async/Future/doWhile_A05_t01: RuntimeError # Please triage this failure
+LibTest/async/Future/forEach_A04_t02: RuntimeError # Please triage this failure
+LibTest/async/Stream/timeout_A01_t01: Pass, RuntimeError # Please triage this failure
+LibTest/async/Stream/timeout_A03_t01: Pass, RuntimeError # Please triage this failure
+LibTest/async/Stream/timeout_A04_t01: Pass, RuntimeError # Please triage this failure
 LibTest/core/List/List_A02_t01: RuntimeError # Please triage this failure
 LibTest/core/List/List_A03_t01: RuntimeError # Please triage this failure
 LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t01: RuntimeError # Issue 22200
@@ -6652,14 +6677,9 @@
 WebPlatformTest/webstorage/event_local_key_t01: RuntimeError # Please triage this failure
 WebPlatformTest/webstorage/event_session_key_t01: RuntimeError # Please triage this failure
 
-# This test is not flaky: IE10 on Windows 7 is different from IE10 on Windows 8.
-# The test fails on Windows 7's version, but it is currently not possible to test
-# for the OS version (see https://code.google.com/p/dart/issues/detail?id=22806).
-[ $compiler == dart2js && $runtime == ie10 ]
-LayoutTests/fast/table/hittest-tablecell-with-borders-bottom-edge_t01: RuntimeError, Pass # Issue 22752. Please triage this failure.
-
 [ $compiler == dart2js && $runtime == ie10 ]
 Language/Expressions/Top_level_Getter_Invocation/17_Getter_Invocation_A03_t02: Skip # Times out. Please triage this failure
+Language/Statements/If/type_t06: Skip # Times out on Windows 8. Please triage this failure
 Language/Statements/Yield_and_Yield_Each/Yield/execution_async_t01: RuntimeError # Issue 26615
 Language/Statements/Yield_and_Yield_Each/Yield/execution_async_t04: RuntimeError # Issue 26615
 LayoutTests/fast/alignment/parse-align-items_t01: RuntimeError # Please triage this failure
@@ -6717,6 +6737,7 @@
 LayoutTests/fast/canvas/canvas-blending-transforms_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-clip-rule_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-composite-canvas_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-composite-image_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-currentColor_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-currentTransform_t01: RuntimeError # Feature is not implemented
 LayoutTests/fast/canvas/canvas-ellipse-360-winding_t01: RuntimeError # Please triage this failure
@@ -6753,7 +6774,7 @@
 LayoutTests/fast/canvas/canvas-set-properties-with-non-invertible-ctm_t01: Pass, RuntimeError # Issue 22216
 LayoutTests/fast/canvas/canvas-setTransform_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-to-canvas_t01: Pass, RuntimeError # Issue 22216
-LayoutTests/fast/canvas/canvas-transforms-fillRect-shadow_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-transforms-fillRect-shadow_t01: Pass, RuntimeError # Passes on Windows 8. Please triage this failure
 LayoutTests/fast/canvas/draw-custom-focus-ring_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/drawImage-with-bad-canvas_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/canvas/drawImage-with-negative-source-destination_t01: Pass, RuntimeError # Issue 22216
@@ -6954,7 +6975,6 @@
 LayoutTests/fast/css/computed-offset-with-zoom_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/content/content-none_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/content/content-normal_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css/content/content-quotes-01_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/content/content-quotes-03_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/content/content-quotes-06_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/counters/complex-before_t01: RuntimeError # Please triage this failure
@@ -7921,6 +7941,7 @@
 LayoutTests/fast/table/css-table-max-width_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/table/css-table-width-with-border-padding_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/table/hittest-tablecell-right-edge_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/hittest-tablecell-with-borders-bottom-edge_t01: RuntimeError, Pass # Fails on Windows 7 but not Windows8.
 LayoutTests/fast/table/hittest-tablecell-with-borders-right-edge_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/table/large-shrink-wrapped-width_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/table/margins-perpendicular-containing-block_t01: RuntimeError # Please triage this failure
@@ -8013,6 +8034,7 @@
 LayoutTests/fast/writing-mode/vertical-font-vmtx-units-per-em_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/writing-mode/vertical-inline-block-hittest_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xmlhttprequest/xmlhttprequest-invalid-values_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responseXML-html-no-responsetype_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/xmlhttprequest/xmlhttprequest-responseXML-xml-document-responsetype_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xmlhttprequest/xmlhttprequest-responseXML-xml-text-responsetype_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-arraybuffer_t01: RuntimeError # Please triage this failure
@@ -8079,7 +8101,12 @@
 LayoutTests/fast/xsl/xslt-fragment-in-empty-doc_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xsl/xslt-string-parameters_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xsl/xslt-transform-to-fragment-crash_t01: RuntimeError # Please triage this failure
+LibTest/async/Future/doWhile_A05_t01: Pass, RuntimeError # Sometimes passes on windows 8. Please triage this failure
+LibTest/async/Future/forEach_A04_t02: RuntimeError # Please triage this failure
 LibTest/async/Stream/Stream.periodic_A01_t01: Pass, RuntimeError # Please triage this failure
+LibTest/async/Stream/timeout_A01_t01: Pass, RuntimeError # Sometimes passes on windows 8. Please triage this failure
+LibTest/async/Stream/timeout_A03_t01: Pass, RuntimeError # Sometimes passes on windows 8. Please triage this failure
+LibTest/async/Stream/timeout_A04_t01: Pass, RuntimeError # Sometimes passes on windows 8. Please triage this failure
 LibTest/async/StreamController/StreamController.broadcast_A04_t01: Pass, RuntimeError # Please triage this failure
 LibTest/async/Timer/Timer.periodic_A01_t01: Pass, RuntimeError # Please triage this failure
 LibTest/async/Timer/Timer_A01_t01: Pass, RuntimeError # Please triage this failure
@@ -8126,9 +8153,9 @@
 LibTest/html/Element/leftView_A01_t01: RuntimeError # Please triage this failure
 LibTest/html/Element/loadEvent_A01_t01: Skip # Times out. Please triage this failure
 LibTest/html/Element/mouseWheelEvent_A01_t01: Skip # Times out, Issue 23437
-LibTest/html/Element/onMouseWheel_A01_t01: Skip # Times out, Issue 23437
 LibTest/html/Element/onFocus_A01_t01: Pass, RuntimeError # Please triage this failure
 LibTest/html/Element/onLoad_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/Element/onMouseWheel_A01_t01: Skip # Times out, Issue 23437
 LibTest/html/Element/ownerDocument_A01_t05: RuntimeError # Please triage this failure
 LibTest/html/Element/querySelectorAll_A01_t02: RuntimeError # Please triage this failure
 LibTest/html/Element/replaceWith_A01_t02: RuntimeError # Please triage this failure
@@ -8442,9 +8469,9 @@
 WebPlatformTest/html-templates/parsing-html-templates/additions-to-the-in-head-insertion-mode/generating-of-implied-end-tags_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html-templates/parsing-html-templates/additions-to-the-in-table-insertion-mode/end-tag-table_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html-templates/parsing-html-templates/appending-to-a-template/template-child-nodes_t01: RuntimeError # Please triage this failure
-WebPlatformTest/html-templates/parsing-html-templates/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-row-context_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html-templates/parsing-html-templates/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-body-context_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html-templates/parsing-html-templates/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-context_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-templates/parsing-html-templates/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-row-context_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html-templates/parsing-html-templates/creating-an-element-for-the-token/template-owner-document_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html-templates/serializing-html-templates/outerhtml_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html-templates/template-element/content-attribute_t01: RuntimeError # Please triage this failure
@@ -8661,15 +8688,15 @@
 WebPlatformTest/webstorage/storage_local_setitem_quotaexceedederr_t01: Skip # Times out. Please triage this failure
 
 [ $compiler == dart2js && $runtime == ie11 ]
-Language/Variables/implicit_setter_void_t07: Skip # Times out. Please triage this failure
-Language/Functions/Formal_Parameters/scope_t01: Skip # Times out. Please triage this failure
 Language/Expressions/Conditional/type_t04: Skip # Times out. Please triage this failure
 Language/Expressions/Identifier_Reference/evaluation_function_t02: Skip # Times out. Please triage this failure
+Language/Functions/Formal_Parameters/scope_t01: Skip # Times out. Please triage this failure
 Language/Statements/Local_Variable_Declaration/syntax_t18: Skip # Times out. Please triage this failure
 Language/Statements/Yield_and_Yield_Each/Yield/execution_async_t01: RuntimeError # Issue 26615
 Language/Statements/Yield_and_Yield_Each/Yield/execution_async_t04: RuntimeError # Issue 26615
-Language/Types/Interface_Types/subtype_t37: Skip # Times out. Please triage this failure
 Language/Types/Function_Types/subtype_no_args_t03: Skip # Times out. Please triage this failure
+Language/Types/Interface_Types/subtype_t37: Skip # Times out. Please triage this failure
+Language/Variables/implicit_setter_void_t07: Skip # Times out. Please triage this failure
 LayoutTests/fast/alignment/parse-align-items_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/alignment/parse-align-self_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/alignment/parse-justify-self_t01: RuntimeError # Please triage this failure
@@ -8849,9 +8876,9 @@
 LayoutTests/fast/canvas/winding-enumeration_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css-generated-content/block-after_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css-generated-content/malformed-url_t01: Skip # Times out. Please triage this failure
-LayoutTests/fast/css-generated-content/pseudo-animation_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/css-generated-content/pseudo-animation-before-onload_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/css-generated-content/pseudo-animation-display_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/css-generated-content/pseudo-animation_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/css-generated-content/pseudo-element-events_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/css-generated-content/pseudo-transition-event_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/css-generated-content/pseudo-transition_t01: RuntimeError # Please triage this failure
@@ -9318,7 +9345,6 @@
 LayoutTests/fast/dom/Window/window-resize-contents_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/Window/window-resize_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/Window/window-scroll-arguments_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/XMLSerializer-attribute-entities_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/XMLSerializer-attribute-namespaces_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/XMLSerializer-element-ns-no-reemit_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/allowed-children_t01: RuntimeError # Please triage this failure
@@ -9403,7 +9429,6 @@
 LayoutTests/fast/dom/partial-layout-non-overlay-scrollbars_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/partial-layout-overlay-scrollbars_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/remove-body-during-body-replacement_t01: Skip # Times out. Please triage this failure
-LayoutTests/fast/dom/serialize-attribute_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/set-innerHTML_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/setAttribute-using-initial-input-value_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/setAttributeNS-namespace-errors_t01: RuntimeError # Please triage this failure
@@ -10078,10 +10103,10 @@
 LibTest/html/Element/loadEvent_A01_t01: Skip # Times out. Please triage this failure
 LibTest/html/Element/marginEdge_A01_t01: RuntimeError # Please triage this failure
 LibTest/html/Element/mouseWheelEvent_A01_t01: Skip # Times out, Issue 23437
-LibTest/html/Element/onMouseWheel_A01_t01: Skip # Times out, Issue 23437
 LibTest/html/Element/onError_A01_t01: Skip # Times out. Please triage this failure
 LibTest/html/Element/onFocus_A01_t01: Pass, RuntimeError # Please triage this failure
 LibTest/html/Element/onLoad_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/Element/onMouseWheel_A01_t01: Skip # Times out, Issue 23437
 LibTest/html/Element/ownerDocument_A01_t05: RuntimeError # Please triage this failure
 LibTest/html/Element/paddingEdge_A01_t01: RuntimeError # Please triage this failure
 LibTest/html/Element/querySelectorAll_A01_t02: RuntimeError # Please triage this failure
@@ -10171,7 +10196,6 @@
 LibTest/html/Window/resizeTo_A01_t01: RuntimeError # Please triage this failure
 LibTest/math/sqrt_A02_t02: Skip # Times out. Please triage this failure
 LibTest/typed_data/ByteData/ByteData.view_A01_t01: Pass, RuntimeError # Please triage this failure
-LibTest/typed_data/ByteData/offsetInBytes_A01_t01: RuntimeError # Please triage this failure
 LibTest/typed_data/Float32List/removeWhere_A01_t01: Skip # Times out. Please triage this failure
 LibTest/typed_data/Float32x4List/Float32x4List.view_A06_t01: RuntimeError # Please triage this failure
 LibTest/typed_data/Int32List/lastWhere_A01_t01: Skip # Times out. Please triage this failure
@@ -10267,9 +10291,9 @@
 WebPlatformTest/html-templates/parsing-html-templates/additions-to-the-in-head-insertion-mode/generating-of-implied-end-tags_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html-templates/parsing-html-templates/additions-to-the-in-table-insertion-mode/end-tag-table_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html-templates/parsing-html-templates/appending-to-a-template/template-child-nodes_t01: RuntimeError # Please triage this failure
-WebPlatformTest/html-templates/parsing-html-templates/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-row-context_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html-templates/parsing-html-templates/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-body-context_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html-templates/parsing-html-templates/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-context_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-templates/parsing-html-templates/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-row-context_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html-templates/parsing-html-templates/creating-an-element-for-the-token/template-owner-document_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html-templates/serializing-html-templates/outerhtml_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html-templates/template-element/content-attribute_t01: RuntimeError # Please triage this failure
@@ -10498,6 +10522,11 @@
 LayoutTests/fast/canvas/webgl/tex-sub-image-cube-maps_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/webgl/webgl-depth-texture_t01: RuntimeError # Please triage this failure
 
+[ $compiler == dart2js && $runtime == ie11 && $builder_tag == win8]
+LibTest/typed_data/ByteData/offsetInBytes_A01_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/XMLSerializer-attribute-entities_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/serialize-attribute_t01: RuntimeError # Please triage this failure
+
 [ $compiler == dart2js && $cps_ir ]
 Language/Types/Interface_Types/subtype_t09: Crash # Pending static: JSArray
 LibTest/collection/ListBase/ListBase_class_A01_t02: Pass, Timeout
diff --git a/tests/co19/co19-dartium.status b/tests/co19/co19-dartium.status
index 91274b0..3f61aa96 100644
--- a/tests/co19/co19-dartium.status
+++ b/tests/co19/co19-dartium.status
@@ -5,12 +5,1214 @@
 [ $compiler == none && $runtime == drt ]
 *: Skip # running co19 tests on content_shell would make our dartium cycle-times very long
 
+[ $compiler == none && $runtime == dartium ]
+Language/Classes/Constructors/Generative_Constructors/execution_t03: Fail, OK
+Language/Classes/Constructors/Generative_Constructors/final_variables_t01: Pass, Fail #: Please triage this failure.
+Language/Classes/declarations_t01: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t02: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t03: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t04: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t06: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t08: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t12: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t13: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t14: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t15: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t16: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t17: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t18: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t19: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t20: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t21: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t22: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t23: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t24: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t25: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t26: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t27: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t28: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t29: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t30: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t31: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t32: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t33: Skip # Times out. Please triage this failure.
+Language/Classes/declarations_t34: Skip # Times out. Please triage this failure.
+Language/Classes/Getters/type_object_t01: RuntimeError # Please triage this failure.
+Language/Classes/Getters/type_object_t02: RuntimeError # Please triage this failure.
+Language/Classes/Setters/type_object_t01: RuntimeError # Please triage this failure.
+Language/Classes/Setters/type_object_t02: RuntimeError # Please triage this failure.
+Language/Classes/Static_Methods/type_object_t01: RuntimeError # Please triage this failure.
+Language/Classes/Static_Methods/type_object_t02: RuntimeError # Please triage this failure.
+Language/Expressions/Assignment/super_assignment_failed_t05: RuntimeError # Issue 25671
+Language/Expressions/Function_Invocation/async_generator_invokation_t08: Skip # Times out. Issue 25967
+Language/Expressions/Function_Invocation/async_generator_invokation_t10: Skip # Times out. Issue 25967
+Language/Expressions/Identifier_Reference/built_in_identifier_t35: Fail # Issue 25732
+Language/Expressions/Identifier_Reference/built_in_identifier_t36: Fail # Issue 25732
+Language/Expressions/Identifier_Reference/built_in_identifier_t37: Fail # Issue 25732
+Language/Expressions/Identifier_Reference/built_in_identifier_t53: Fail # Issue 25733
+Language/Expressions/Identifier_Reference/built_in_identifier_t54: Fail # Issue 25733
+Language/Expressions/Identifier_Reference/built_in_identifier_t55: Fail # Issue 25733
+Language/Expressions/Identifier_Reference/built_in_identifier_t56: Fail # Issue 25733
+Language/Expressions/Identifier_Reference/built_in_identifier_t57: Fail # Issue 25733
+Language/Expressions/Identifier_Reference/built_in_identifier_t58: Fail # Issue 25733
+Language/Expressions/Identifier_Reference/built_in_identifier_t59: Fail # Issue 25733
+Language/Expressions/Identifier_Reference/built_in_identifier_t60: Fail # Issue 25733
+Language/Expressions/Identifier_Reference/built_in_identifier_t61: Fail # Issue 25733
+Language/Expressions/Identifier_Reference/built_in_identifier_t62: Fail # Issue 25733
+Language/Expressions/Identifier_Reference/built_in_identifier_t63: Fail # Issue 25733
+Language/Expressions/Identifier_Reference/built_in_identifier_t64: Fail # Issue 25733
+Language/Expressions/Identifier_Reference/built_in_identifier_t65: Fail # Issue 25733
+Language/Expressions/Identifier_Reference/built_in_identifier_t66: Fail # Issue 25733
+Language/Expressions/Identifier_Reference/built_in_identifier_t67: Fail # Issue 25733
+Language/Expressions/Identifier_Reference/built_in_identifier_t68: Fail # Issue 25733
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t14: Fail # Issue 25732
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t19: Fail # Issue 25772
+Language/Expressions/Instance_Creation/New/execution_t04: Fail, OK
+Language/Expressions/Instance_Creation/New/execution_t06: Fail, OK
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Closurization/identical_t01: RuntimeError # Issue 24607
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Closurization/identical_t02: RuntimeError # Issue 24607
+Language/Expressions/Property_Extraction/General_Super_Property_Extraction: RuntimeError # Issue 26287
+Language/Expressions/Property_Extraction/Named_Constructor_Closurization/identical_t01: RuntimeError # Issue 24607
+Language/Expressions/Property_Extraction/Super_Closurization: RuntimeError # Issue 26287
+Language/Expressions/Spawning_an_Isolate/new_isolate_t01: RuntimeError, OK  # Uses Isolate.spawn.
+Language/Functions/Formal_Parameters/syntax_t05: RuntimeError # Issue 26644
+Language/Libraries_and_Scripts/Exports/reexport_t01: fail # Dart issue 12916
+Language/Libraries_and_Scripts/Exports/reexport_t02: fail # Dart issue 12916
+Language/Libraries_and_Scripts/Parts/compilation_t02: Skip # Please triage this failure.
+Language/Libraries_and_Scripts/Parts/syntax_t05: Skip # Times out flakily. Issue 20881
+Language/Libraries_and_Scripts/Scripts/top_level_main_t03: Pass # Issue 14478: This should break.
+Language/Libraries_and_Scripts/Scripts/top_level_main_t03: RuntimeError # co19-roll r786: Please triage this failure.
+Language/Metadata/before_variable_t01: RuntimeError # Please triage this failure.
+Language/Mixins/declaring_constructor_t05: Fail # Issue 24767
+Language/Mixins/declaring_constructor_t06: Fail # Issue 24767
+Language/Mixins/Mixin_Application/syntax_t16: RuntimeError # Please triage this failure.
+Language/Mixins/not_object_superclass_t01: Fail # Please triage this failure.
+Language/Mixins/reference_to_super_t01: Fail # Please triage this failure.
+Language/Statements/Assert/execution_t02: skip # co19 issue 734
+Language/Statements/Assert/execution_t03: skip # co19 issue 734
+Language/Statements/Assert/type_t02: skip # co19 issue 734
+Language/Statements/Assert/type_t05: skip # co19 issue 734
+Language/Statements/Continue/async_loops_t10: Timeout, Skip # Issue 25748
+Language/Statements/Labels/syntax_t03: fail # Dart issue 2238
+Language/Statements/Switch/syntax_t02: fail # Dart issue 12908
+Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_t08: RuntimeError # Issue 25748
+Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_t09: RuntimeError # Issue 25748
+Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_t10: RuntimeError # Issue 25748
+Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_sync_t05: RuntimeError # Issue 25662,25634
+Language/Statements/Yield_and_Yield_Each/Yield/execution_async_t01: RuntimeError # Please triage this failure
+Language/Statements/Yield_and_Yield_Each/Yield/execution_async_t02: RuntimeError # Please triage this failure
+Language/Statements/Yield_and_Yield_Each/Yield/execution_async_t04: RuntimeError # Please triage this failure
+LayoutTests/fast/alignment/parse-align-items_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/alignment/parse-align-self_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/alignment/parse-justify-self_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/backgrounds/repeat/parsing-background-repeat_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/borders/border-radius-child_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/borders/border-radius-child_t01: Skip # co19 issue 732.
+LayoutTests/fast/canvas/2d.fillText.gradient_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/2d.text.draw.fill.maxWidth.gradient_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/2d.text.draw.fill.maxWidth.negative_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/2d.text.draw.fill.maxWidth.veryLarge_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/2d.text.draw.fill.maxWidth.verySmall_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/canvas-arc-negative-radius_t01: Skip # Times out. co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/canvas-blending-text_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/canvas-currentTransform_t01: RuntimeError # Feature is behind a flag in Chrome
+LayoutTests/fast/canvas/canvas-empty-image-pattern_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/canvas-getImageData-invalid_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/canvas-large-dimensions_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/canvas-large-fills_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/canvas-lose-restore-googol-size_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/canvas-lose-restore-max-int-size_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/draw-custom-focus-ring_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/drawImage-with-broken-image_t01: Timeout, Pass # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/getPutImageDataPairTest_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/webgl/array-bounds-clamping_t01: RuntimeError # Issue 25653
+LayoutTests/fast/canvas/webgl/attrib-location-length-limits_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/bad-arguments-test_t01: Pass, RuntimeError # Issue 20, 22026
+LayoutTests/fast/canvas/webgl/buffer-bind-test_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/canvas-2d-webgl-texture_t01: RuntimeError # Issue 25653
+LayoutTests/fast/canvas/webgl/canvas-resize-crash_t01: Skip # Causes following tests to fail. co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/webgl/canvas-test_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure. Issue 22026
+LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias-t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/webgl/context-destroyed-crash_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/context-lost-restored_t01: RuntimeError # Issue 25653
+LayoutTests/fast/canvas/webgl/copy-tex-image-and-sub-image-2d_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/webgl/copy-tex-image-and-sub-image-2d_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/css-webkit-canvas_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/css-webkit-canvas-repaint_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/draw-webgl-to-canvas-2d_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/drawingbuffer-test_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/webgl/error-reporting_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/framebuffer-object-attachment_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/framebuffer-object-attachment_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/framebuffer-test_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/framebuffer-test_t01: RuntimeError # Issue 20, 22026
+LayoutTests/fast/canvas/webgl/functions-returning-strings_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/get-active-test_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/gl-bind-attrib-location-test_t01: RuntimeError # Issue 25653
+LayoutTests/fast/canvas/webgl/gl-enable-enum-test_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/gl-get-calls_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/gl-getshadersource_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/gl-getstring_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/gl-pixelstorei_t01: RuntimeError # Issue 25653
+LayoutTests/fast/canvas/webgl/gl-teximage_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/gl-teximage_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-vertexattribpointer_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/glsl-conformance_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/incorrect-context-object-behaviour_t01: Pass, RuntimeError # Issue 20, 22026
+LayoutTests/fast/canvas/webgl/invalid-UTF-16_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/is-object_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/webgl/null-object-behaviour_t01: Pass, RuntimeError # Issue 20, 22026
+LayoutTests/fast/canvas/webgl/object-deletion-behaviour_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/object-deletion-behaviour_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/oes-element-index-uint_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/canvas/webgl/oes-element-index-uint_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/oes-vertex-array-object_t01: RuntimeError # Issue 25653
+LayoutTests/fast/canvas/webgl/point-size_t01: RuntimeError # Issue 25653
+LayoutTests/fast/canvas/webgl/premultiplyalpha-test_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/webgl/read-pixels-pack-alignment_t01: RuntimeError # Issue 25653
+LayoutTests/fast/canvas/webgl/read-pixels-test_t01: RuntimeError # Issue 25653
+LayoutTests/fast/canvas/webgl/renderbuffer-initialization_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/webgl/renderer-and-vendor-strings_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/shader-precision-format_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgb565_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgb565_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgba4444_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgba4444_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgba5551_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgba5551_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgb565_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgb565_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgba4444_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgba4444_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgba5551_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgba5551_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgb565_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgb565_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba4444_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba4444_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba5551_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba5551_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video_t01: Skip # Issue 20540
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgb565_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgb565_t01: Skip # Issue 20540
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba4444_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba4444_t01: Skip # Issue 20540
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba5551_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba5551_t01: Skip # Issue 20540
+LayoutTests/fast/canvas/webgl/tex-image-webgl_t01: RuntimeError # Issue 25653
+LayoutTests/fast/canvas/webgl/tex-sub-image-2d_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-sub-image-2d_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-sub-image-2d-bad-args_t01: Pass, RuntimeError # Issue 20, 22026
+LayoutTests/fast/canvas/webgl/tex-sub-image-cube-maps_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-sub-image-cube-maps_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/texImage2DImageDataTest_t01: RuntimeError # Issue 25653
+LayoutTests/fast/canvas/webgl/texture-active-bind_t01: RuntimeError # Issue 25653
+LayoutTests/fast/canvas/webgl/texture-bindings-uneffected-on-resize_t01: RuntimeError # Issue 25653
+LayoutTests/fast/canvas/webgl/texture-color-profile_t01: RuntimeError # Issue 25653
+LayoutTests/fast/canvas/webgl/texture-complete_t01: RuntimeError # Issue 25653
+LayoutTests/fast/canvas/webgl/texture-npot_t01: RuntimeError # Issue 25653
+LayoutTests/fast/canvas/webgl/texture-transparent-pixels-initialized_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/canvas/webgl/texture-transparent-pixels-initialized_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/canvas/webgl/triangle_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/webgl/uniform-location_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/webgl/uniform-location_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/uniform-location-length-limits_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/uninitialized-test_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/uninitialized-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/viewport-unchanged-upon-resize_t01: RuntimeError # Issue 25653
+LayoutTests/fast/canvas/webgl/webgl-composite-modes_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/webgl-composite-modes-repaint_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/webgl-depth-texture_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/webgl/webgl-large-texture_t01: RuntimeError # Issue 25653
+LayoutTests/fast/canvas/webgl/webgl-layer-update_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/webgl-specific_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/webgl-texture-binding-preserved_t01: RuntimeError # Issue 25653
+LayoutTests/fast/canvas/webgl/webgl-viewport-parameters-preserved_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/WebGLContextEvent_t01: Pass, RuntimeError # Issue 22026
+LayoutTests/fast/css-generated-content/bug91547_t01: Skip # Test reloads itself. Issue 18558.
+LayoutTests/fast/css-generated-content/hit-test-generated-content_t01: Skip # co19 issue 732.
+LayoutTests/fast/css-generated-content/malformed-url_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-generated-content/pseudo-animation_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-generated-content/pseudo-animation-before-onload_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/css-generated-content/pseudo-element-events_t01: Skip # Timeout. co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-generated-content/pseudo-transition_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-generated-content/pseudo-transition-event_t01: Skip # Timeout. co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/auto-content-resolution-rows_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/breadth-size-resolution-grid_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/calc-resolution-grid-item_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/display-grid-set-get_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/flex-and-minmax-content-resolution-rows_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/flex-content-resolution-columns_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/flex-content-resolution-rows_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/grid-auto-columns-rows-get-set_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/grid-auto-flow-get-set_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/grid-auto-flow-update_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/grid-container-change-explicit-grid-recompute-child_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/grid-element-border-grid-item_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/grid-element-border-padding-grid-item_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/grid-element-empty-row-column_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/grid-element-min-max-height_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/grid-element-padding-grid-item_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/grid-element-padding-margin_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/grid-element-shrink-to-fit_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/grid-item-area-get-set_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/grid-item-bad-named-area-auto-placement_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/grid-item-bad-resolution-double-span_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/grid-item-change-order-auto-flow_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/grid-item-display_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-horiz-bt_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-vert-lr_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-vert-rl_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/grid-item-margin-resolution_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/grid-item-order-auto-flow-resolution_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/grid-template-areas-get-set_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/implicit-rows-auto-resolution_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/justify-self-cell_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/minmax-fixed-logical-height-only_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/minmax-fixed-logical-width-only_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track-in-percent-grid_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track-update_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/percent-padding-margin-resolution-grid-item_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/percent-padding-margin-resolution-grid-item-update_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/percent-resolution-grid-item_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-grid-layout/place-cell-by-index_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-replaced-absolutes_t01: Skip # 45 Roll failure.
+LayoutTests/fast/css/aspect-ratio-inheritance_t01: Skip # 45 Roll No longer supported.
+LayoutTests/fast/css/aspect-ratio-parsing-tests_t01: Skip # 45 Roll No longer supported.
+LayoutTests/fast/css/auto-min-size_t01: RuntimeError #  45 Roll co19 test rewrite issue 25807
+LayoutTests/fast/css/checked-pseudo-selector_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/collapsed-whitespace-reattach-in-style-recalc_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/collapsed-whitespace-reattach-in-style-recalc_t01: Skip # co19 issue 732.
+LayoutTests/fast/css/computed-offset-with-zoom_t01: Skip # co19 issue 732.
+LayoutTests/fast/css/content/content-none_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/content/content-normal_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/counters/complex-before_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/css-properties-case-insensitive_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/css3-nth-tokens-style_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/deprecated-flexbox-auto-min-size_t01: Pass, RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/first-child-display-change-inverse_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/focus-display-block-inline_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/font-face-cache-bug_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/font-face-insert-link_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css/font-face-multiple-ranges-for-unicode-range_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css/font-face-unicode-range-load_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/font-face-unicode-range-overlap-load_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/fontfaceset-events_t01: Pass, RuntimeError # Issue 23433
+LayoutTests/fast/css/fontfaceset-loadingdone_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/html-attr-case-sensitivity_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/id-or-class-before-stylesheet_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/inherit-initial-shorthand-values_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/invalid-predefined-color_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/link-alternate-stylesheet-1_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/link-alternate-stylesheet-2_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/link-alternate-stylesheet-3_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/link-alternate-stylesheet-4_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/link-alternate-stylesheet-5_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/media-query-recovery_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/parsing-at-rule-recovery_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/parsing-css-allowed-string-characters_t01: RuntimeError #  45 Roll co19 test rewrite issue 25807
+LayoutTests/fast/css/parsing-object-position_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/parsing-page-rule_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/parsing-selector-error-recovery_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/pseudo-any_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/pseudo-target-indirect-sibling-001_t01: Skip # Times out. co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/pseudo-target-indirect-sibling-002_t01: Skip # Times out. co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/readonly-pseudoclass-opera-001_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/readonly-pseudoclass-opera-002_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/readonly-pseudoclass-opera-003_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/readonly-pseudoclass-opera-004_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/readonly-pseudoclass-opera-005_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/sticky/parsing-position-sticky_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/style-element-process-crash_t01: Skip # Times out. co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/style-scoped/style-scoped-nested_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css/style-scoped/style-scoped-with-dom-operation_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css/style-scoped/style-scoped-with-important-rule_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css/stylesheet-enable-first-alternate-on-load-sheet_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/stylesheet-enable-second-alternate-link_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/webkit-keyframes-errors_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last-inherited_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-color_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-line_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-style_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css3-text/css3-text-indent/getComputedStyle/getComputedStyle-text-indent_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css3-text/css3-text-indent/getComputedStyle/getComputedStyle-text-indent-inherited_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/css3-text/css3-text-justify/getComputedStyle/getComputedStyle-text-justify_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/dom/anchor-without-content_t01: RuntimeError # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/attribute-namespaces-get-set_t01: RuntimeError # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/blur-contenteditable_t01: RuntimeError, Pass # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/characterdata-api-arguments_t01: RuntimeError # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/client-width-height-quirks_t01: RuntimeError # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/computed-style-set-property_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/computed-style-set-property_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/createDocumentType2_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/createDocumentType2_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/createElementNS_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/createElementNS_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/css-cached-import-rule_t01: Skip # Test reloads itself. Issue 18558.
+LayoutTests/fast/dom/css-innerHTML_t01: RuntimeError # Test is incorrect.
+LayoutTests/fast/dom/cssTarget-crash_t01: Skip # Test reloads itself. Issue 18558.
+LayoutTests/fast/dom/custom/document-register-basic_t01: RuntimeError # Bad test can't register HtmlElement.
+LayoutTests/fast/dom/custom/document-register-namespace_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/custom/document-register-namespace_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/custom/document-register-svg-extends_t01: RuntimeError # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/custom/document-register-type-extensions_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/custom/document-register-type-extensions_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/custom/element-names_t01: RuntimeError # 45 Roll issue dart-lang/co19/issues/25
+LayoutTests/fast/dom/custom/element-type_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/custom/element-type_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/custom/element-upgrade_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/custom/element-upgrade_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/dataset_t01: RuntimeError # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/dataset-xhtml_t01: RuntimeError # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/document-importNode-arguments_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/basic_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-strict-mode-wtih-checkbox_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-zoom-and-scroll_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/hittest-relative-to-viewport_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/replace-element_t01: Pass, RuntimeError # co19-roll r706.  Please triage this failure.
+LayoutTests/fast/dom/Document/createElement-invalid-names_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/Document/createElement-invalid-names_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/Document/createElementNS-namespace-err_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LayoutTests/fast/dom/DOMException/prototype-object_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/DOMException/prototype-object_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LayoutTests/fast/dom/Element/attribute-uppercase_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LayoutTests/fast/dom/Element/getClientRects_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LayoutTests/fast/dom/Element/setAttributeNS-namespace-err_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LayoutTests/fast/dom/empty-hash-and-search_t01: Skip # Test reloads itself. Issue 18558.
+LayoutTests/fast/dom/focus-contenteditable_t01: RuntimeError, Pass # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/getElementsByClassName/011_t01: RuntimeError # Chrome 39 roll. Please triage this failure
+LayoutTests/fast/dom/horizontal-scrollbar-in-rtl-doesnt-fire-onscroll_t01: RuntimeError # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/horizontal-scrollbar-when-dir-change_t01: RuntimeError # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/HTMLAnchorElement/remove-href-from-focused-anchor_t01: Skip # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hostname_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-pathname_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-port_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-protocol_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-search_t01: RuntimeError, Pass # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLButtonElement/change-type_t01: Skip # Test reloads itself. Issue 18558.
+LayoutTests/fast/dom/HTMLDialogElement/dialog-autofocus_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLDialogElement/dialog-scrolled-viewport_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLDialogElement/dialog-show-modal_t01: RuntimeError, Pass # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-unfocusable_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLDialogElement/multiple-centered-dialogs_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLDialogElement/non-anchored-dialog-positioning_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLDialogElement/show-modal-focusing-steps_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLDocument/active-element-gets-unforcusable_t01: Skip # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLDocument/set-focus-on-valid-element_t01: Skip # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLElement/insertAdjacentHTML-errors_t01: RuntimeError # co19 issue 11.
+LayoutTests/fast/dom/HTMLElement/set-inner-outer-optimization_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLElement/spellcheck_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLFormElement/move-option-between-documents_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLImageElement/image-alt-text_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLImageElement/parse-src_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLInputElement/input-image-alt-text_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test_t01: Skip # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLLinkElement/link-beforeload-recursive_t01: Skip # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLLinkElement/prefetch_t01: Skip # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLLinkElement/prefetch-onload_t01: Skip # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLLinkElement/resolve-url-on-insertion_t01: RuntimeError # co19-roll r722: Issue 18010
+LayoutTests/fast/dom/HTMLObjectElement/beforeload-set-text-crash_t01: Skip # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLOptionElement/collection-setter-getter_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLScriptElement/async-false-inside-async-false-load_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLScriptElement/async-inline-script_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLScriptElement/async-onbeforeload_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLScriptElement/defer-inline-script_t01: RuntimeError, Pass # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLScriptElement/defer-onbeforeload_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLScriptElement/remove-in-beforeload_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLScriptElement/script-set-src_t01: RuntimeError, Pass # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/HTMLSelectElement/selected-index-preserved-when-option-text-changes_t01: RuntimeError # co19-roll r722: Issue 18127
+LayoutTests/fast/dom/HTMLTemplateElement/custom-element-wrapper-gc_t01: RuntimeError # co19-roll r722: Issue 18250
+LayoutTests/fast/dom/HTMLTemplateElement/cycles_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/HTMLTemplateElement/cycles_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/HTMLTemplateElement/cycles-in-shadow_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/HTMLTemplateElement/cycles-in-shadow_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/HTMLTemplateElement/innerHTML_t01: RuntimeError # co19-roll r722: Issue 18249
+LayoutTests/fast/dom/HTMLTemplateElement/ownerDocumentXHTML_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/location-hash_t01: Pass, RuntimeError # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/MutationObserver/database-callback-delivery_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/dom/MutationObserver/observe-childList_t01: RuntimeError # co19-roll r722: Issue 18253
+LayoutTests/fast/dom/MutationObserver/weak-callback-gc-crash_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered_t01: RuntimeError # Dartium JSInterop failure
+LayoutTests/fast/dom/navigatorcontentutils/unregister-protocol-handler_t01: RuntimeError # Dartium JSInterop failure
+LayoutTests/fast/dom/Node/contains-method_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/Node/contains-method_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/Node/fragment-mutation_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/Node/initial-values_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/option-properties_t01: RuntimeError # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/partial-layout-overlay-scrollbars_t01: RuntimeError # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/Range/bug-19527_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/Range/range-created-during-remove-children_t01: RuntimeError, Pass # co19-roll r722: Please triage this failure.
+LayoutTests/fast/dom/Range/range-detached-exceptions_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/set-innerHTML_t01: RuntimeError # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/shadow/form-in-shadow_t01: Skip # Test reloads itself. Issue 18558.
+LayoutTests/fast/dom/shadow/no-renderers-for-light-children_t01: RuntimeError # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/shadow/pseudoclass-update-checked-option_t01: RuntimeError # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-optgroup_t01: RuntimeError # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-option_t01: RuntimeError # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/shadow/pseudoclass-update-enabled-optgroup_t01: RuntimeError # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/shadow/pseudoclass-update-enabled-option_t01: RuntimeError # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/shadow/shadow-content-crash_t01: RuntimeError # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/shadow/shadow-hierarchy-exception_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/shadow/shadow-hierarchy-exception_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/shadow/shadow-removechild-and-blur-event_t01: RuntimeError, Pass # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/StyleSheet/css-medialist-item_t01: RuntimeError # Dartium JSInterop failure
+LayoutTests/fast/dom/StyleSheet/discarded-sheet-owner-null_t01: Skip # Test reloads itself. Issue 18558.
+LayoutTests/fast/dom/Window/window-resize_t01: RuntimeError # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/Window/window-resize-contents_t01: Pass, RuntimeError # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dom/Window/window-scroll-arguments_t01: RuntimeError # co19-roll r738: Please triage this failure.
+LayoutTests/fast/dynamic/crash-generated-counter_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/dynamic/crash-generated-image_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/dynamic/crash-generated-quote_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/dynamic/crash-generated-text_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/dynamic/insertAdjacentElement_t01: Skip # Timeout. co19-roll r786: Please triage this failure.
+LayoutTests/fast/dynamic/insertAdjacentHTML_t01: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/dynamic/recursive-layout_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/encoding/css-charset-dom_t01: Skip #  45 Roll No longer supported see issue https://github.com/dart-lang/co19/issues/35
+LayoutTests/fast/events/change-overflow-on-overflow-change_t01: Skip # Timeout. Please triage this failure.
+LayoutTests/fast/events/clipboard-clearData_t01: Skip # Timeout. co19-roll r786: Please triage this failure.
+LayoutTests/fast/events/clipboard-dataTransferItemList_t01: Skip # Timeout. co19-roll r786: Please triage this failure.
+LayoutTests/fast/events/div-focus_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/events/document-elementFromPoint_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/events/document-elementFromPoint_t01: Skip # co19 issue 732.
+LayoutTests/fast/events/event-creation_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/events/event-listener-html-non-html-confusion_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/events/initkeyboardevent-crash_t01: RuntimeError, Timeout # co19-roll r786: Please triage this failure.
+LayoutTests/fast/events/input-focus-no-duplicate-events_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/events/invalid-003_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/events/invalid-004_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/events/label-focus_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/events/mutation-during-append-child_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/events/mutation-during-append-child_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/events/mutation-during-insert-before_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/events/mutation-during-insert-before_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/events/mutation-during-replace-child_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/events/mutation-during-replace-child-2_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/events/nested-event-remove-node-crash_t01: Skip # Flaky timeout. co19-roll r786: Please triage this failure.
+LayoutTests/fast/events/overflowchanged-event-raf-timing_t01: Skip #  45 Roll No longer supported.
+LayoutTests/fast/events/scoped/editing-commands_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/events/scroll-event-does-not-bubble_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/events/tabindex-removal-from-focused-element_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/exclusions/parsing/parsing-wrap-flow_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/exclusions/parsing/parsing-wrap-through_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/files/blob-close_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/files/blob-close-read_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/files/blob-close-revoke_t01: RuntimeError # Experimental feature not exposed anywhere yet
+LayoutTests/fast/files/xhr-response-blob_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/filesystem/async-operations_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/filesystem/directory-entry-to-uri_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/filesystem/file-after-reload-crash_t01: Skip # Test reloads itself. Issue 18558.
+LayoutTests/fast/filesystem/file-entry-to-uri_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/filesystem/file-writer-abort-continue_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/filesystem/file-writer-abort-depth_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/filesystem/file-writer-events_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/filesystem/file-writer-gc-blob_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/filesystem/file-writer-write-overlapped_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/filesystem/filesystem-reference_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/filesystem/read-directory-many_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/filesystem/simple-readonly_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/autofocus-focus-only-once_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/autofocus-input-css-style-change_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/autofocus-opera-007_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/autofocus-readonly-attribute_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/button-baseline-and-collapsing_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/button/button-disabled-blur_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/clone-input-with-dirty-value_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-onblur-setvalue-onfocusremoved_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-change-layout-by-value_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/datetimelocal/datetimelocal-interactive-validation-required_t01: Skip # Test reloads itself. Issue 18558.
+LayoutTests/fast/forms/file/file-input-capture_t01: RuntimeError # Experimental feature not exposed in Chrome yet
+LayoutTests/fast/forms/focus_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/focus-style-pending_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/form-submission-create-crash_t01: Skip # Test reloads itself. Issue 18558.
+LayoutTests/fast/forms/formmethod-attribute-button-html_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/formmethod-attribute-button-html_t01: Skip # Test reloads itself. Issue 18558.
+LayoutTests/fast/forms/formmethod-attribute-input-2_t01: Skip # Test reloads itself. Issue 18558.
+LayoutTests/fast/forms/formmethod-attribute-input-html_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/formmethod-attribute-input-html_t01: Skip # Test reloads itself. Issue 18558.
+LayoutTests/fast/forms/HTMLOptionElement_selected2_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/input-hit-test-border_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/input-inputmode_t01: RuntimeError # Experimental feature not exposed in Chrome yet
+LayoutTests/fast/forms/input-value-sanitization_t01: RuntimeError # 45 roll issue
+LayoutTests/fast/forms/input-width-height-attributes-without-renderer-loaded-image_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/listbox-select-all_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/listbox-selection-2_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/menulist-disabled-selected-option_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/menulist-selection-reset_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/menulist-submit-without-selection_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/missing-action_t01: Skip # Test reloads itself. Issue 18558.
+LayoutTests/fast/forms/multiple-selected-options-innerHTML_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/option-change-single-selected_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/option-strip-unicode-spaces_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/parser-associated-form-removal_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/search-popup-crasher_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/select-change-popup-to-listbox-in-event-handler_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/select-clientheight-large-size_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/select-clientheight-with-multiple-attr_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/select-list-box-mouse-focus_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/submit-form-with-dirname-attribute_t01: Skip # Test reloads itself. Issue 18558.
+LayoutTests/fast/forms/submit-form-with-dirname-attribute-with-ancestor-dir-attribute_t01: Skip # Test reloads itself. Issue 18558.
+LayoutTests/fast/forms/submit-form-with-dirname-attribute-with-nonhtml-ancestor_t01: Skip # Test reloads itself. Issue 18558.
+LayoutTests/fast/forms/submit-nil-value-field-assert_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/submit-nil-value-field-assert_t01: Skip # Test reloads itself. Issue 18558.
+LayoutTests/fast/forms/textarea-paste-newline_t01: Pass, RuntimeError # Issue 23433
+LayoutTests/fast/forms/textarea-scrollbar-height_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/textarea-submit-crash_t01: Skip # Test reloads itself. Issue 18558.
+LayoutTests/fast/forms/textfield-focus-out_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/html/adjacent-html-context-element_t01:RuntimeError # co19 issue 11.
+LayoutTests/fast/html/hidden-attr_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LayoutTests/fast/html/imports/import-element-removed-flag_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LayoutTests/fast/html/imports/import-element-removed-flag_t01: Skip # co19-roll r722: Please triage this failure.
+LayoutTests/fast/html/imports/import-events_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LayoutTests/fast/html/select-dropdown-consistent-background-color_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/inline/boundingBox-with-continuation_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/inline/inline-position-top-align_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/inline/inline-with-empty-inline-children_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/inline/out-of-flow-objects-and-whitespace-after-empty-inline_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/inline/parent-inline-element-padding-contributes-width_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/inline/positioned-element-padding-contributes-width_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/layers/zindex-hit-test_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/layers/zindex-hit-test_t01: RuntimeError # co19 issue 11.
+LayoutTests/fast/lists/list-style-position-inside_t01: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/loader/about-blank-hash-change_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/about-blank-hash-kept_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/hashchange-event-properties_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/loadInProgress_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/onhashchange-attribute-listeners_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/onload-policy-ignore-for-frame_t01: Skip # Times out. Dartium 45 roll: Please triage this failure.
+LayoutTests/fast/loader/scroll-position-restored-on-back_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/scroll-position-restored-on-reload-at-load-event_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/stateobjects/replacestate-in-onunload_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/masking/parsing-clip-path-shape_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/masking/parsing-mask_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/masking/parsing-mask-source-type_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/media/media-query-list-syntax_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/media/mq-parsing_t01: Pass, RuntimeError # False passes on Firefox, but trying to keep these grouped with the issue. # co19 issue 11.
+LayoutTests/fast/mediastream/getusermedia_t01: Skip # co19 issue 738
+LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream_t01: Skip # Issue 22111
+LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream_t01: Skip # Passes on Safari, Issue 23475 # co19 issue 11.
+LayoutTests/fast/multicol/balance-unbreakable_t01: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/multicol/break-after-always-bottom-margin_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/break-properties_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/column-width-zero_t01: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/multicol/cssom-view_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/flipped-blocks-hit-test_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/float-truncation_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/hit-test-above-or-below_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/hit-test-end-of-column_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/hit-test-end-of-column-with-line-height_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/hit-test-float_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/hit-test-gap-between-pages_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/newmulticol/balance_t01: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/multicol/newmulticol/balance_t02: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/multicol/newmulticol/balance_t04: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/multicol/newmulticol/balance_t04: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/newmulticol/balance_t05: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/multicol/newmulticol/balance_t06: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/multicol/newmulticol/balance_t07: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/multicol/newmulticol/balance_t07: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/newmulticol/balance_t08: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/multicol/newmulticol/balance_t08: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/newmulticol/balance_t09: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/multicol/newmulticol/balance_t09: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/newmulticol/balance_t10: Pass, RuntimeError # I don't understand how, but sometimes passes. # co19 issue 11.
+LayoutTests/fast/multicol/newmulticol/balance_t10: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/newmulticol/balance-images_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/newmulticol/balance-maxheight_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/orphans-relayout_t01: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/multicol/vertical-lr/float-truncation_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/vertical-rl/float-truncation_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/widows_t01: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/multicol/widows_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/overflow/child-100percent-height-inside-fixed-container-with-overflow-auto_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/overflow/child-100percent-height-inside-fixed-container-with-overflow-auto_t01: RuntimeError # co19 issue 11.
+LayoutTests/fast/overflow/overflow-rtl-vertical-origin_t01: Pass, RuntimeError # False passes on Firefox, but trying to keep these grouped with the issue. # co19 issue 11.
+LayoutTests/fast/overflow/replaced-child-100percent-height-inside-fixed-container-with-overflow-auto_t01: Pass, RuntimeError # False pass on Safari # co19 issue 11.
+LayoutTests/fast/overflow/replaced-child-100percent-height-inside-fixed-container-with-overflow-auto_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/overflow/scroll-vertical-not-horizontal_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/overflow/scrollbar-restored_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/parser/foster-parent-adopted_t02: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/parser/fragment-parser-doctype_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/parser/innerhtml-with-prefixed-elements_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/parser/parse-wbr_t01: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor_t01: Pass # False pass # co19 issue 11.
+LayoutTests/fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor_t01: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor-vertical-lr_t01: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/replaced/computed-image-width-with-percent-height-inside-table-cell-and-fixed-ancestor_t01: RuntimeError, Pass # Spurious intermittent pass # co19 issue 11.
+LayoutTests/fast/replaced/computed-image-width-with-percent-height-inside-table-cell-and-fixed-ancestor-vertical-lr_t01: RuntimeError, Pass # Spurious intermittent pass # co19 issue 11.
+LayoutTests/fast/replaced/container-width-zero_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/replaced/iframe-with-percentage-height-within-table-with-anonymous-table-cell_t01: Skip # Times out: Please triage this failure.
+LayoutTests/fast/replaced/iframe-with-percentage-height-within-table-with-table-cell-ignore-height_t01: Skip # Times out: Please triage this failure.
+LayoutTests/fast/replaced/preferred-widths_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/replaced/table-percent-height_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/replaced/table-percent-width_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/ruby/parse-rp_t01: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/ruby/ruby-line-height_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/parsing/parsing-shape-lengths_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-big-box-border-radius_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-diamond-margin-polygon_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-margin-left_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-margin-right_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-image-margin_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-image-margin_t02: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-inset-rounded-different-writing-modes-left_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-inset-rounded-different-writing-modes-right_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-rounded-boxes_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-rounded-boxes_t02: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/speechsynthesis/*: Skip # Times out on Dartium. Fails elsewhere. Issue 22017
+LayoutTests/fast/storage/disallowed-storage_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/storage/storage-disallowed-in-data-url_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/sub-pixel/cssom-subpixel-precision_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/sub-pixel/float-containing-block-with-margin_t01: RuntimeError # co19 issue 11.
+LayoutTests/fast/sub-pixel/float-containing-block-with-margin_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/sub-pixel/float-containing-block-with-margin_t01: Skip # co19 issue 732.
+LayoutTests/fast/sub-pixel/inline-block-with-padding_t01: Skip # co19 issue 732.
+LayoutTests/fast/sub-pixel/replaced-element-baseline_t01: Pass, RuntimeError # Fails on Safari, false pass on others # co19 issue 11.
+LayoutTests/fast/sub-pixel/replaced-element-baseline_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/sub-pixel/size-of-span-with-different-positions_t01: Skip # co19 issue 732.
+LayoutTests/fast/sub-pixel/table-rows-have-stable-height_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/sub-pixel/table-rows-have-stable-height_t01: Skip # co19 issue 732.
+LayoutTests/fast/table/anonymous-table-section-removed_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/anonymous-table-section-removed_t01: Skip # co19 issue 11.
+LayoutTests/fast/table/caption-orthogonal-writing-mode-sizing_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/col-width-span-expand_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/col-width-span-expand_t01: Skip # co19 issue 11.
+LayoutTests/fast/table/col-width-span-expand_t01: Skip # co19 issue 732.
+LayoutTests/fast/table/computeLogicalWidth-table-needsSectionRecalc_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/css-table-max-height_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/css-table-max-width_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/fixed-table-layout-width-change_t01: Pass, RuntimeError # False passes on Firefox # co19 issue 11.
+LayoutTests/fast/table/hittest-tablecell-bottom-edge_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/hittest-tablecell-bottom-edge_t01: Skip # co19 issue 11.
+LayoutTests/fast/table/hittest-tablecell-right-edge_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/hittest-tablecell-with-borders-bottom-edge_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/hittest-tablecell-with-borders-right-edge_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/html-table-width-max-width-constrained_t01: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/table/large-shrink-wrapped-width_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/margins-flipped-text-direction_t01: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/table/margins-perpendicular-containing-block_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/min-max-width-preferred-size_t01: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/table/min-width-css-block-table_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/min-width-css-inline-table_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/min-width-html-block-table_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/min-width-html-inline-table_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/nested-tables-with-div-offset_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/table/padding-height-and-override-height_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/table-all-rowspans-height-distribution-in-rows_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/table-all-rowspans-height-distribution-in-rows-except-overlapped_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/table-cell-offset-width_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/table-colgroup-present-after-table-row_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/table-rowspan-cell-with-empty-cell_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/table-rowspan-height-distribution-in-rows_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/table-rowspan-height-distribution-in-rows_t02: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/table/table-width-exceeding-max-width_t01: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/table/table-with-content-width-exceeding-max-width_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/text-autosizing/vertical-writing-mode_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/text-autosizing/vertical-writing-mode_t01: Skip # co19 issue 732.
+LayoutTests/fast/text/find-soft-hyphen_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/text/find-spaces_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/text/font-fallback-synthetic-italics_t01: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/text/font-fallback-synthetic-italics_t01: RuntimeError # co19 issue 11.
+LayoutTests/fast/text/font-ligatures-linebreak_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/text/font-ligatures-linebreak-word_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/text/font-ligatures-linebreak-word_t01: Skip # co19 issue 11.
+LayoutTests/fast/text/font-ligatures-linebreak-word_t01: Skip # co19 issue 11.
+LayoutTests/fast/text/glyph-reordering_t01: Pass, RuntimeError # This is a false pass. The font gets sanitized, so whether it works or not probably depends on default sizes. # co19 issue 11.
+LayoutTests/fast/text/international/complex-text-rectangle_t01: Skip # co19 issue 732.
+LayoutTests/fast/text/international/iso-8859-8_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/text/international/rtl-text-wrapping_t01: Pass # This is a false pass. All the content gets sanitized, so there's nothing to assert fail on. If the code did anything it would fail. # co19 issue 11.
+LayoutTests/fast/text/international/rtl-text-wrapping_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/text/international/rtl-text-wrapping_t01: Skip # co19 issue 732.
+LayoutTests/fast/text/international/thai-offsetForPosition-inside-character_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/text/ipa-tone-letters_t01: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/text/ipa-tone-letters_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/text/line-break-after-empty-inline-hebrew_t01: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/text/line-break-after-question-mark_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/text/line-breaks-after-hyphen-before-number_t01: RuntimeError # co19 issue 11.
+LayoutTests/fast/text/line-breaks-after-hyphen-before-number_t01: Skip # co19 issue 732.
+LayoutTests/fast/text/offsetForPosition-cluster-at-zero_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/text/regional-indicator-symobls_t01: Pass, Fail # co19 issue 11.
+LayoutTests/fast/text/regional-indicator-symobls_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/text/remove-zero-length-run_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/text/sub-pixel/text-scaling-ltr_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/text/sub-pixel/text-scaling-pixel_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/text/sub-pixel/text-scaling-rtl_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/text/sub-pixel/text-scaling-vertical_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/text/sub-pixel/text-scaling-webfont_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/text/text-combine-shrink-to-fit_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/transforms/bounding-rect-zoom_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/transforms/bounding-rect-zoom_t01: RuntimeError, Pass # Erratic, but only passes because divs have been entirely removed. # co19 issue 11.
+LayoutTests/fast/transforms/hit-test-large-scale_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/transforms/scrollIntoView-transformed_t01: Pass, RuntimeError # False passes on Firefox. # co19 issue 11.
+LayoutTests/fast/transforms/transform-hit-test-flipped_t01: Pass, RuntimeError # Passes on Firefox, but is clearly not testing what it's trying to test. # co19 issue 11.
+LayoutTests/fast/url/file_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/url/file-http-base_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/url/host_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/url/idna2003_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/url/idna2008_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/url/invalid-urls-utf8_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/url/ipv4_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/url/ipv6_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/url/path_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/url/query_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/url/relative_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/url/relative-unix_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/url/relative-win_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/url/segments_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/url/segments-from-data-url_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/url/standard-url_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/writing-mode/percentage-margins-absolute-replaced_t01: Pass, RuntimeError # co19 issue 11.
+LayoutTests/fast/writing-mode/positionForPoint_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/writing-mode/positionForPoint_t01: Skip # co19 issue 732.
+LayoutTests/fast/writing-mode/table-hit-test_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/writing-mode/vertical-font-vmtx-units-per-em_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-abort_t01: Skip # Timeout. co19-roll r786: Please triage this failure.
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-arraybuffer_t01: Skip # Timeout. co19-roll r786: Please triage this failure.
+LayoutTests/fast/xpath/4XPath/Borrowed/cz_20030217_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/xpath/4XPath/Borrowed/namespace-nodes_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/xpath/4XPath/Core/test_core_functions_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/xpath/4XPath/Core/test_core_functions_t02: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/xpath/4XPath/Core/test_node_test_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/xpath/4XPath/Core/test_node_test_t02: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/xpath/4XPath/Core/test_parser_t01: RuntimeError # Dartium JSInterop failure
+LayoutTests/fast/xpath/attr-namespace_t02: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/xpath/ensure-null-namespace_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/xpath/implicit-node-args_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/xpath/node-name-case-sensitivity_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/xpath/node-name-case-sensitivity_t02: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/xpath/position_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/xpath/py-dom-xpath/abbreviations_t01: RuntimeError # Dartium JSInterop failure
+LayoutTests/fast/xpath/py-dom-xpath/axes_t01: RuntimeError # Dartium JSInterop failure
+LayoutTests/fast/xpath/py-dom-xpath/data_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/xpath/py-dom-xpath/expressions_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/xpath/py-dom-xpath/paths_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/xpath/reverse-axes_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/xsl/default-html_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LibTest/async/Stream/Stream.periodic_A01_t01: Pass, RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/async/Timer/Timer_A01_t01: RuntimeError, Pass # Issue 16475
+LibTest/collection/ListBase/ListBase_class_A01_t01: Skip # co19-roll r722: Please triage this failure.
+LibTest/collection/ListMixin/ListMixin_class_A01_t01: Skip # co19-roll r722: Please triage this failure.
+LibTest/collection/ListMixin/ListMixin_class_A01_t02: Skip # co19-roll r722: Please triage this failure.
+LibTest/core/int/operator_left_shift_A01_t02: Pass, Fail # Please triage this failure.
+LibTest/core/int/toRadixString_A01_t01: Fail # co19 issue 492
+LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t01: Fail # Issue 22200
+LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t05: Fail # Issue 22200
+LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t06: Fail # Issue 22200
+LibTest/core/Symbol/Symbol_A01_t03: RuntimeError # Issue 13596
+LibTest/core/Symbol/Symbol_A01_t05: RuntimeError # Issue 13596
+LibTest/html/CanvasRenderingContext2D/addEventListener_A01_t03: RuntimeError # co19-roll r722: Please triage this failure.
+LibTest/html/CanvasRenderingContext2D/addEventListener_A01_t06: RuntimeError # co19-roll r722: Please triage this failure.
+LibTest/html/Document/childNodes_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/Document/clone_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/Document/clone_A01_t02: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/Document/insertAllBefore_A01_t01: RuntimeError # Please triage this failure.
+LibTest/html/Document/insertBefore_A01_t01: RuntimeError # Please triage this failure.
+LibTest/html/Document/securityPolicy_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/Document/text_A01_t01: RuntimeError # Please triage this failure.
+LibTest/html/Element/blur_A01_t01: Skip # co19-roll r706.  Please triage this failure.
+LibTest/html/Element/borderEdge_A01_t01: RuntimeError # co19-roll r706.  Issue 16574
+LibTest/html/Element/contentEdge_A01_t01: RuntimeError # co19-roll r706.  Issue 16574
+LibTest/html/Element/dataset_A02_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/Element/focus_A01_t01: Skip # co19-roll r706.  Please triage this failure.
+LibTest/html/Element/getAttributeNS_A01_t01: RuntimeError # co19-roll r706.  Issue 16395
+LibTest/html/Element/getAttributeNS_A01_t02: RuntimeError # Please triage this failure.
+LibTest/html/Element/getNamespacedAttributes_A01_t01: RuntimeError # co19-roll r706.  Issue 16395
+LibTest/html/Element/insertAllBefore_A01_t01: RuntimeError # Please triage this failure.
+LibTest/html/Element/insertBefore_A01_t01: RuntimeError # Please triage this failure.
+LibTest/html/Element/isContentEditable_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/Element/isContentEditable_A02_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/Element/marginEdge_A01_t01: RuntimeError # co19-roll r706.  Issue 16574
+LibTest/html/Element/paddingEdge_A01_t01: RuntimeError # co19-roll r706.  Issue 16574
+LibTest/html/Element/querySelectorAll_A01_t02: RuntimeError # co19-roll r761: Please triage this failure.
+LibTest/html/Element/replaceWith_A01_t02: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/Element/text_A01_t01: RuntimeError # Please triage this failure.
+LibTest/html/HttpRequest/onError_A01_t02: Skip # co19-roll r706.  Please triage this failure.
+LibTest/html/HttpRequest/responseText_A01_t02: Skip # co19-roll r706.  Please triage this failure.
+LibTest/html/HttpRequest/responseType_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/HttpRequest/responseType_A01_t03: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/HttpRequest/statusText_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/HttpRequestUpload/onError_A01_t02: Skip # co19-roll r706.  Please triage this failure.
+LibTest/html/HttpRequestUpload/onLoad_A01_t01: Skip # co19-roll r706.  Please triage this failure.
+LibTest/html/HttpRequestUpload/onLoadEnd_A01_t01: Skip # co19-roll r706.  Please triage this failure.
+LibTest/html/HttpRequestUpload/onLoadStart_A01_t01: Skip # co19-roll r706.  Please triage this failure.
+LibTest/html/IFrameElement/appendHtml_A01_t01: Pass, RuntimeError # Issue 23462
+LibTest/html/IFrameElement/appendHtml_A01_t01: RuntimeError # Issue 23462
+LibTest/html/IFrameElement/appendHtml_A01_t02: Pass, RuntimeError # Issue 23462
+LibTest/html/IFrameElement/appendHtml_A01_t02: RuntimeError # Issue 23462
+LibTest/html/IFrameElement/attributeChanged_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/IFrameElement/attributes_setter_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/IFrameElement/blur_A01_t01: Skip # co19-roll r706.  Please triage this failure.
+LibTest/html/IFrameElement/borderEdge_A01_t01: RuntimeError # co19-roll r706.  Issue 16574
+LibTest/html/IFrameElement/clone_A01_t02: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/IFrameElement/contentWindow_A01_t01: RuntimeError # Please triage this failure.
+LibTest/html/IFrameElement/createFragment_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/IFrameElement/createFragment_A01_t02: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/IFrameElement/createFragment_A01_t03: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/IFrameElement/createShadowRoot_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/IFrameElement/enteredView_A01_t01: Skip # co19-roll r706.  Please triage this failure.
+LibTest/html/IFrameElement/focus_A01_t01: Skip # co19-roll r706.  Please triage this failure.
+LibTest/html/IFrameElement/getNamespacedAttributes_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/IFrameElement/IFrameElement.created_A01_t01: RuntimeError # Issue 24568
+LibTest/html/IFrameElement/innerHtml_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/IFrameElement/insertAllBefore_A01_t01: RuntimeError # Please triage this failure.
+LibTest/html/IFrameElement/insertBefore_A01_t01: RuntimeError # Please triage this failure.
+LibTest/html/IFrameElement/isContentEditable_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/IFrameElement/leftView_A01_t01: Skip # co19-roll r706.  Please triage this failure.
+LibTest/html/IFrameElement/marginEdge_A01_t01: RuntimeError # co19-roll r706.  Issue 16574
+LibTest/html/IFrameElement/offsetTo_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/IFrameElement/outerHtml_setter_A01_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LibTest/html/IFrameElement/paddingEdge_A01_t01: RuntimeError # co19-roll r722: Issue 16574
+LibTest/html/IFrameElement/querySelector_A01_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LibTest/html/IFrameElement/setInnerHtml_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/Node/addEventListener_A01_t06: RuntimeError # co19-roll r722: Please triage this failure.
+LibTest/html/Node/append_A01_t02: RuntimeError # co19-roll r722: Please triage this failure.
+LibTest/html/Node/nodes_A01_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LibTest/html/Node/nodes_A01_t02: RuntimeError # co19-roll r722: Please triage this failure.
+LibTest/html/Node/parent_A01_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LibTest/html/Node/previousNode_A01_t01: RuntimeError # co19-roll r722: Please triage this failure.
+LibTest/html/Window/document_A01_t01: Skip # accesses window.document from a cross-frame window
+LibTest/html/Window/find_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/Window/find_A03_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/Window/find_A06_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/Window/moveBy_A01_t01: RuntimeError # Please triage this failure.
+LibTest/html/Window/moveTo_A01_t01: RuntimeError, Pass # co19-roll r706.  Please triage this failure.
+LibTest/html/Window/moveTo_A02_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/Window/postMessage_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/Window/postMessage_A01_t02: RuntimeError # Please triage this failure.
+LibTest/html/Window/requestFileSystem_A01_t02: RuntimeError,Pass # co19-roll r722: Please triage this failure.
+LibTest/html/Window/requestFileSystem_A02_t01: Skip # Issue 24585.
+LibTest/html/Window/resizeBy_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/html/Window/resizeTo_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
+LibTest/isolate/Isolate/spawn_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/Isolate/spawn_A01_t02: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/Isolate/spawn_A01_t03: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/Isolate/spawn_A01_t04: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/Isolate/spawn_A01_t05: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/Isolate/spawn_A01_t06: RuntimeError # Issue 27219
+LibTest/isolate/Isolate/spawn_A03_t01: RuntimeError # Issue 27219
+LibTest/isolate/Isolate/spawn_A03_t02: RuntimeError # Issue 27219
+LibTest/isolate/Isolate/spawn_A03_t03: RuntimeError # Issue 27219
+LibTest/isolate/Isolate/spawn_A03_t04: RuntimeError # Issue 27219
+LibTest/isolate/Isolate/spawn_A04_t01: RuntimeError # Issue 27219
+LibTest/isolate/Isolate/spawn_A04_t02: RuntimeError # Issue 27219
+LibTest/isolate/Isolate/spawn_A04_t03: RuntimeError # Issue 27219
+LibTest/isolate/Isolate/spawn_A04_t04: RuntimeError # Issue 27219
+LibTest/isolate/Isolate/spawn_A04_t05: RuntimeError # Issue 27219
+LibTest/isolate/Isolate/spawn_A05_t01: RuntimeError # Issue 27219
+LibTest/isolate/Isolate/spawn_A05_t02: RuntimeError # Issue 27219
+LibTest/isolate/Isolate/spawn_A05_t03: RuntimeError # Issue 27219
+LibTest/isolate/Isolate/spawn_A06_t01: RuntimeError # Issue 27219
+LibTest/isolate/Isolate/spawn_A06_t02: RuntimeError # Issue 27219
+LibTest/isolate/Isolate/spawn_A06_t03: RuntimeError # Issue 27219
+LibTest/isolate/Isolate/spawn_A06_t04: RuntimeError # Issue 27219
+LibTest/isolate/Isolate/spawn_A06_t05: RuntimeError # Issue 27219
+LibTest/isolate/Isolate/spawn_A06_t06: RuntimeError # Issue 27219
+LibTest/isolate/Isolate/spawn_A06_t07: RuntimeError # Issue 27219
+LibTest/isolate/Isolate/spawnUri_A01_t01: RuntimeError # Dart issue 15974
+LibTest/isolate/Isolate/spawnUri_A01_t02: Skip # Dart issue 15974
+LibTest/isolate/Isolate/spawnUri_A01_t03: Skip # Dart issue 15974
+LibTest/isolate/Isolate/spawnUri_A01_t04: RuntimeError # Dart issue 15974
+LibTest/isolate/Isolate/spawnUri_A01_t05: RuntimeError # Dart issue 15974
+LibTest/isolate/Isolate/spawnUri_A01_t06: RuntimeError # Issue 27219
+LibTest/isolate/Isolate/spawnUri_A01_t07: RuntimeError # Issue 27219
+LibTest/isolate/Isolate/spawnUri_A02_t02: Skip # Dart issue 15974
+LibTest/isolate/Isolate/spawnUri_A02_t03: Skip # Dart issue 15974
+LibTest/isolate/Isolate/spawnUri_A02_t04: Skip # Dart issue 15974
+LibTest/isolate/RawReceivePort/close_A01_t01: Pass, RuntimeError # Issue 13921, co19 issue for false pass https://github.com/dart-lang/co19/issues/13
+LibTest/isolate/RawReceivePort/handler_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/RawReceivePort/RawReceivePort_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/RawReceivePort/RawReceivePort_A01_t02: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/RawReceivePort/sendPort_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/any_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/any_A01_t02: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/asBroadcastStream_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/asBroadcastStream_A01_t02: Pass, RuntimeError # Issue 13921, co19 issue for false pass https://github.com/dart-lang/co19/issues/13
+LibTest/isolate/ReceivePort/asBroadcastStream_A01_t03: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/asBroadcastStream_A01_t04: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/asBroadcastStream_A02_t01: RuntimeError # Issue 13921
+LibTest/isolate/ReceivePort/asBroadcastStream_A03_t01: Pass, RuntimeError # Issue 13921, co19 issue for false pass https://github.com/dart-lang/co19/issues/13
+LibTest/isolate/ReceivePort/asBroadcastStream_A03_t02: Pass, RuntimeError # Issue 13921, co19 issue for false pass https://github.com/dart-lang/co19/issues/13
+LibTest/isolate/ReceivePort/asBroadcastStream_A03_t03: Pass, RuntimeError # Issue 13921, co19 issue for false pass https://github.com/dart-lang/co19/issues/13
+LibTest/isolate/ReceivePort/asBroadcastStream_A04_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/asBroadcastStream_A04_t02: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/asBroadcastStream_A04_t03: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/close_A01_t01: Pass, RuntimeError # Issue 13921, co19 issue for false pass https://github.com/dart-lang/co19/issues/13
+LibTest/isolate/ReceivePort/close_A02_t01: Skip # Times out
+LibTest/isolate/ReceivePort/contains_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/distinct_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/distinct_A01_t02: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/drain_A02_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/drain_A02_t02: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/elementAt_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/elementAt_A03_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/every_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/expand_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/first_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/first_A02_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/first_A02_t02: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/firstWhere_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/firstWhere_A02_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/firstWhere_A03_t02: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/fold_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/fold_A01_t02: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/forEach_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/isEmpty_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/join_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/join_A01_t02: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/last_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/last_A02_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/lastWhere_A02_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/lastWhere_A04_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/length_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/listen_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/map_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/pipe_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/reduce_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/reduce_A01_t02: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/reduce_A01_t03: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/sendPort_A01_t01: RuntimeError # Issue 13921
+LibTest/isolate/ReceivePort/single_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/single_A02_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/singleWhere_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/singleWhere_A02_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/skip_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/skipWhile_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/take_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/take_A01_t02: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/take_A01_t03: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/takeWhile_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/toList_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/toSet_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/transform_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/transform_A01_t02: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/where_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/ReceivePort/where_A01_t02: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/SendPort/send_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/SendPort/send_A01_t02: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/SendPort/send_A01_t03: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/SendPort/send_A01_t04: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/SendPort/send_A02_t01: RuntimeError, OK  # Uses Isolate.spawn.
+LibTest/isolate/SendPort/send_A02_t04: Fail # Issue 13921
+LibTest/isolate/SendPort/send_A02_t05: Fail # Issue 13921
+LibTest/isolate/SendPort/send_A02_t06: Fail # Issue 13921
+WebPlatformTest/custom-elements/concepts/type_A03_t01: RuntimeError # Please triage this failure.
+WebPlatformTest/custom-elements/concepts/type_A05_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/custom-elements/concepts/type_A06_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/dom/events/event_constants/constants_A01_t01: Skip # co19-roll r706.  Please triage this failure.
+WebPlatformTest/dom/events/event_constructors/Event_A01_t01: Skip # co19-roll r706.  Please triage this failure.
+WebPlatformTest/dom/events/event_constructors/Event_A02_t01: Skip # co19-roll r706.  Please triage this failure.
+WebPlatformTest/dom/events/type_A01_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/dom/EventTarget/dispatchEvent_A02_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/dom/EventTarget/dispatchEvent_A03_t01: Skip # co19-roll r722: Please triage this failure.
+WebPlatformTest/dom/Node-replaceChild_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/dom/nodes/attributes/setAttribute_A01_t01: RuntimeError # Please triage this failure.
+WebPlatformTest/dom/nodes/attributes/setAttribute_A01_t01: RuntimeError # Please triage this failure.
+WebPlatformTest/dom/nodes/attributes/setAttribute_A03_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A05_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A06_t03: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A07_t02: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A07_t03: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A08_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/dom/nodes/Document-adoptNode_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/dom/nodes/Document-createElement_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/dom/nodes/Document-createElementNS_t01: RuntimeError, Pass # co19-roll r722: Please triage this failure.
+WebPlatformTest/dom/nodes/Document-getElementsByTagName_t01: RuntimeError, Pass # co19-roll r722: Please triage this failure.
+WebPlatformTest/dom/nodes/DOMImplementation-createDocument_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/dom/nodes/DOMImplementation-createDocumentType_t01: RuntimeError, Pass # co19-roll r722: Please triage this failure.
+WebPlatformTest/dom/nodes/DOMImplementation-createHTMLDocument_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/dom/nodes/Element-childElementCount_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/dom/nodes/Element-childElementCount-nochild_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/dom/nodes/Node-appendChild_t01: RuntimeError # Please triage this failure.
+WebPlatformTest/dom/nodes/Node-appendChild_t01: RuntimeError # Please triage this failure.
+WebPlatformTest/dom/nodes/Node-appendChild_t02: RuntimeError, Pass # co19-roll r722: Please triage this failure.
+WebPlatformTest/dom/nodes/Node-insertBefore_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/dom/nodes/Node-isEqualNode_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/dom/nodes/Node-nodeName_t01: RuntimeError # Please triage this failure.
+WebPlatformTest/dom/nodes/Node-replaceChild_t01: RuntimeError # co19-roll r722: Please triage this failure
+WebPlatformTest/dom/nodes/Node-textContent_t01: RuntimeError # Please triage this failure.
+WebPlatformTest/DOMEvents/approved/addEventListener.optional.useCapture_t01: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/DOMEvents/approved/EventObject.after.dispatchEvenr_t01: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/DOMEvents/approved/EventObject.multiple.dispatchEvent_t01: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/DOMEvents/approved/ProcessingInstruction.DOMCharacterDataModified_t01: Skip # Times out. co19-roll r738: Please triage this failure.
+WebPlatformTest/html-imports/link-import_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html-imports/link-import_t02: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html-imports/link-import-null_t01: RuntimeError # co19 issue 11.
+WebPlatformTest/html-imports/loading-import_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html-templates/innerhtml-on-templates/innerhtml_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/html-templates/parsing-html-templates/additions-to-the-in-head-insertion-mode/generating-of-implied-end-tags_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/html-templates/parsing-html-templates/creating-an-element-for-the-token/template-owner-document_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/html/browsers/browsing-the-web/read-media/pageload-image_t01: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/html/browsers/browsing-the-web/read-media/pageload-video_t01: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/html/browsers/browsing-the-web/read-text/load-text-plain_t01: Skip # accesses window.document from a cross-frame window
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.body-getter_t01: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.body-setter_t01: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.getElementsByName-case_t01: RuntimeError # co19 issue 11.
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.getElementsByName-namespace_t01: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.getElementsByName-newelements_t01: RuntimeError # co19 issue 11.
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.getElementsByName-param_t01: RuntimeError # co19 issue 11.
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.title_t01: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.title_t05: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.title_t07: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/html/dom/documents/dom-tree-accessors/nameditem_t02: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/html/dom/documents/dom-tree-accessors/nameditem_t03: RuntimeError # co19 issue 11.
+WebPlatformTest/html/dom/documents/dom-tree-accessors/nameditem_t05: RuntimeError # co19 issue 11.
+WebPlatformTest/html/dom/elements/global-attributes/dataset-delete_t01: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/html/dom/elements/global-attributes/dataset-get_t01: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/html/dom/elements/global-attributes/dataset-set_t01: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/html/semantics/disabled-elements/disabledElement_t01: RuntimeError # co19 issue 11.
+WebPlatformTest/html/semantics/document-metadata/styling/LinkStyle_t01: RuntimeError # co19 issue 11.
+WebPlatformTest/html/semantics/document-metadata/styling/LinkStyle_t01: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/html/semantics/embedded-content/media-elements/error-codes/error_t01: Skip # Times out and fails. # co19-roll r738: Please triage this failure.
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/addTextTrack_t01: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/src_t01: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues_t01: Skip # Times out and fails. # co19-roll r738: Please triage this failure.LayoutTests/fast/dom/Window/window-resize-contents_t01: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/TextTrack/mode_t01: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/html/semantics/forms/attributes-common-to-form-controls/formAction_document_address_t01: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/html/semantics/forms/attributes-common-to-form-controls/formaction_t01: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/html/semantics/forms/textfieldselection/selection_t01: RuntimeError # Dartium 45 roll
+WebPlatformTest/html/semantics/forms/textfieldselection/textfieldselection-setRangeText_t01: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange_t01: RuntimeError, Pass # co19-roll r738: Please triage this failure.  Pass on macos.
+WebPlatformTest/html/semantics/forms/the-button-element/button-validation_t01: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/html/semantics/forms/the-fieldset-element/disabled_t01: RuntimeError # co19-roll r738: Please triage this failure.
+WebPlatformTest/html/semantics/forms/the-form-element/form-autocomplete_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/forms/the-form-element/form-elements-matches_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/forms/the-form-element/form-elements-nameditem_t02: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/forms/the-form-element/form-nameditem_t01: RuntimeError # co19 issue 11.
+WebPlatformTest/html/semantics/forms/the-input-element/date_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/forms/the-input-element/datetime_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/forms/the-input-element/datetime_t02: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/forms/the-input-element/datetime-local_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/forms/the-input-element/email_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/forms/the-input-element/email_t02: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/forms/the-input-element/input-textselection_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/forms/the-input-element/month_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/forms/the-input-element/password_t01: RuntimeError # co19-roll r786: Please triage this failure.
+WebPlatformTest/html/semantics/forms/the-input-element/pattern_attribute_t01: RuntimeError # co19 issue 11.
+WebPlatformTest/html/semantics/forms/the-input-element/range_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/forms/the-input-element/time_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/forms/the-input-element/time_t02: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/forms/the-input-element/type-change-state_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/forms/the-input-element/url_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/forms/the-input-element/valueMode_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/forms/the-input-element/week_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/forms/the-meter-element/meter_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/forms/the-option-element/option-text-recurse_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/forms/the-option-element/option-text-spaces_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/grouping-content/the-blockquote-element/grouping-blockquote_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/grouping-content/the-ol-element/ol.start-reflection_t02: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/grouping-content/the-ol-element/ol.start-reflection_t02: Skip # co19 issue 11.
+WebPlatformTest/html/semantics/interactive-elements/the-dialog-element/dialog-close_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/interactive-elements/the-dialog-element/dialog-showModal_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/scripting-1/the-script-element/async_t11: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/scripting-1/the-script-element/async_t11: Skip # co19 issue 11.
+WebPlatformTest/html/semantics/scripting-1/the-script-element/script-text_t02: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/selectors/pseudo-classes/checked_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/selectors/pseudo-classes/default_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/selectors/pseudo-classes/dir_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/selectors/pseudo-classes/disabled_t01: Pass, RuntimeError # Spurious pass # co19 issue 11.
+WebPlatformTest/html/semantics/selectors/pseudo-classes/disabled_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/selectors/pseudo-classes/enabled_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/selectors/pseudo-classes/focus_t01: RuntimeError # co19 issue 11.
+WebPlatformTest/html/semantics/selectors/pseudo-classes/focus_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/selectors/pseudo-classes/indeterminate_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/selectors/pseudo-classes/inrange-outofrange_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/selectors/pseudo-classes/link_t01: RuntimeError # co19 issue 11.
+WebPlatformTest/html/semantics/selectors/pseudo-classes/link_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/selectors/pseudo-classes/valid-invalid_t01: RuntimeError # co19 issue 11.
+WebPlatformTest/html/semantics/selectors/pseudo-classes/valid-invalid_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/tabular-data/the-table-element/table-rows_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/tabular-data/the-tr-element/rowIndex_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/semantics/text-level-semantics/the-a-element/a.text-getter_t01: RuntimeError # co19 issue 11.
+WebPlatformTest/html/syntax/parsing/Document.getElementsByTagName-foreign_t01: RuntimeError # co19 issue 11.
+WebPlatformTest/html/syntax/parsing/Document.getElementsByTagName-foreign_t02: RuntimeError # co19-roll r786: Please triage this failure.
+WebPlatformTest/html/syntax/parsing/math-parse_t01: RuntimeError # co19 issue 11.
+WebPlatformTest/html/syntax/parsing/math-parse_t03: RuntimeError # co19 issue 11.
+WebPlatformTest/html/syntax/serializing-html-fragments/outerHTML_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t01: RuntimeError # Tests APIs that aren't yet visible. Tests should be deleted.
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t02: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t03: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t04: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t05: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t06: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-001_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-004_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-004_t02: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/methods/elements-001_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-005_t01: RuntimeError # Please triage this failure.
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-006_t01: RuntimeError # Please triage this failure.
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-002_t01: RuntimeError # 45 roll issue https://github.com/dart-lang/co19/issues/33
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-005_t01: RuntimeError #  45 Roll co19 test rewrite issue 25807
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-004_t01: RuntimeError # Please triage this failure.
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-004_t02: RuntimeError # Please triage this failure.
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-006_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-001_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-003_t01: RuntimeError # Please triage this failure.
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-003_t02: RuntimeError # Please triage this failure.
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-005_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/events/event-dispatch/test-001_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/events/event-dispatch/test-002_t01: RuntimeError # Please triage this failure.
+WebPlatformTest/shadow-dom/events/event-dispatch/test-003_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/events/event-retargeting/test-001_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/events/event-retargeting/test-002_t01: RuntimeError # Not clear that any of this works. Also suppressed in dart2js
+WebPlatformTest/shadow-dom/events/event-retargeting/test-004_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t01: Pass, RuntimeError # Flaky with Dartium JsInterop. Seems like timing issues in the test.
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t02: Skip # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t05: Skip # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t06: Skip # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-002_t01: Pass, Fail # https://github.com/dart-lang/co19/issues/12
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-003_t01: RuntimeError, Pass # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/events/retargeting-relatedtarget/test-003_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/html-elements-and-their-shadow-trees/test-001_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/html-elements-and-their-shadow-trees/test-002_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/html-elements-and-their-shadow-trees/test-003_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/shadow-trees/custom-pseudo-elements/test-001_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/shadow-trees/distributed-pseudo-element/test-001_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/shadow-trees/distributed-pseudo-element/test-002_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/shadow-trees/lower-boundary-encapsulation/test-004_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/ownerdocument-002_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/selectors-api-001_t01: RuntimeError # Please triage this failure.
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/selectors-api-002_t01: RuntimeError # Please triage this failure.
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/test-009_t01: RuntimeError # Please triage this failure.
+WebPlatformTest/Utils/test/asyncTestFail_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/Utils/test/asyncTestFail_t02: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/Utils/test/asyncTestTimeout_t01: Skip # co19-roll r722: Please triage this failure.
+WebPlatformTest/Utils/test/testFail_t01: RuntimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/webstorage/event_constructor_t01: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/webstorage/event_constructor_t02: RuntimeError # co19-roll r761: Please triage this failure.
+WebPlatformTest/webstorage/storage_local_setitem_quotaexceedederr_t01: Skip # Times out flakily. co19-roll r761: Please triage this failure.
+WebPlatformTest/webstorage/storage_session_setitem_quotaexceedederr_t01: Skip # Times out flakily. co19-roll r761: Please triage this failure.
+
+# Must fix failures below after JsInterop checkin.
+LayoutTests/fast/events/clipboard-dataTransferItemList-remove_t01: Skip # Issue 26134, timesout
+LibTest/html/CanvasRenderingContext2D/addEventListener_A01_t06: Skip # Issue 26134, timeout
+html/cross_domain_iframe_test: RuntimeError # Issue 26134
+
 [ $compiler == none && $runtime == dartium && $system == macos ]
 LayoutTests/fast/css-generated-content/pseudo-animation-before-onload_t01: Skip # Depends on animation timing, commented as known to be flaky in test.  Will not fix.
 LayoutTests/fast/forms/input-value-sanitization_t01: RuntimeError # 45 roll
 LayoutTests/fast/writing-mode/broken-ideographic-font_t01: Skip # Timing out on the bots. Please triage this failure.
 LayoutTests/fast/writing-mode/flipped-blocks-hit-test-overflow_t01: Pass, RuntimeError # Issue 21605
 LayoutTests/fast/writing-mode/vertical-inline-block-hittest_t01: Pass, RuntimeError # Issue 21605
+LibTest/collection/ListBase/ListBase_class_A01_t02: Skip # Timing out on the bots. Please triage this failure.
+WebPlatformTest/custom-elements/concepts/type_A07_t01: Skip # Timing out on the bots. Please triage this failure.
 
 [ $compiler == none && $runtime == dartium && $system == windows ]
 LayoutTests/fast/writing-mode/vertical-inline-block-hittest_t01: Pass, RuntimeError # Issue 21605
@@ -51,7 +1253,6 @@
 LayoutTests/fast/canvas/webgl/webgl-exceptions_t01: RuntimeError # 45 rollwebgl doesn't run on on windows/linux bots.
 LayoutTests/fast/canvas/webgl/webgl-unprefixed-context-id_t01: RuntimeError # 45 rollwebgl doesn't run on on windows/linux bots.
 
-
 [ $compiler == none && $runtime == dartium && $mode == debug ]
 WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/TextTrack/mode_t01: Skip # Issue 19495.
 WebPlatformTest/html/semantics/forms/the-datalist-element/datalistoptions_t01: Skip # Issue 20540.
@@ -144,1188 +1345,3 @@
 WebPlatformTest/html/dom/elements/global-attributes/dataset-enumeration_t01: RuntimeError # co19-roll r738: Please triage this failure.
 WebPlatformTest/html/semantics/forms/textfieldselection/selection_t01: RuntimeError # co19-roll r738: Please triage this failure.
 WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/ownerdocument-001_t01: RuntimeError # co19-roll r722: Please triage this failure.
-
-[ $compiler == none && $runtime == dartium ]
-Language/Classes/Constructors/Generative_Constructors/execution_t03: Fail, OK
-Language/Classes/Constructors/Generative_Constructors/final_variables_t01: Pass, Fail #: Please triage this failure.
-Language/Classes/Getters/type_object_t01: RuntimeError # Please triage this failure.
-Language/Classes/Getters/type_object_t02: RuntimeError # Please triage this failure.
-Language/Classes/Setters/type_object_t01: RuntimeError # Please triage this failure.
-Language/Classes/Setters/type_object_t02: RuntimeError # Please triage this failure.
-Language/Classes/Static_Methods/type_object_t01: RuntimeError # Please triage this failure.
-Language/Classes/Static_Methods/type_object_t02: RuntimeError # Please triage this failure.
-Language/Classes/deсlarations_t01: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t02: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t03: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t04: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t06: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t08: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t12: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t13: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t14: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t15: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t16: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t17: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t18: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t19: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t20: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t21: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t22: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t23: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t24: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t25: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t26: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t27: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t28: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t29: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t30: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t31: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t32: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t33: Skip # Times out. Please triage this failure.
-Language/Classes/deсlarations_t34: Skip # Times out. Please triage this failure.
-Language/Expressions/Assignment/super_assignment_failed_t05: RuntimeError # Issue 25671
-Language/Expressions/Function_Invocation/async_generator_invokation_t08: Skip # Times out. Issue 25967
-Language/Expressions/Function_Invocation/async_generator_invokation_t10: Skip # Times out. Issue 25967
-Language/Expressions/Identifier_Reference/built_in_identifier_t35: Fail # Issue 25732
-Language/Expressions/Identifier_Reference/built_in_identifier_t36: Fail # Issue 25732
-Language/Expressions/Identifier_Reference/built_in_identifier_t37: Fail # Issue 25732
-Language/Expressions/Identifier_Reference/built_in_identifier_t53: Fail # Issue 25733
-Language/Expressions/Identifier_Reference/built_in_identifier_t54: Fail # Issue 25733
-Language/Expressions/Identifier_Reference/built_in_identifier_t55: Fail # Issue 25733
-Language/Expressions/Identifier_Reference/built_in_identifier_t56: Fail # Issue 25733
-Language/Expressions/Identifier_Reference/built_in_identifier_t57: Fail # Issue 25733
-Language/Expressions/Identifier_Reference/built_in_identifier_t58: Fail # Issue 25733
-Language/Expressions/Identifier_Reference/built_in_identifier_t59: Fail # Issue 25733
-Language/Expressions/Identifier_Reference/built_in_identifier_t60: Fail # Issue 25733
-Language/Expressions/Identifier_Reference/built_in_identifier_t61: Fail # Issue 25733
-Language/Expressions/Identifier_Reference/built_in_identifier_t62: Fail # Issue 25733
-Language/Expressions/Identifier_Reference/built_in_identifier_t63: Fail # Issue 25733
-Language/Expressions/Identifier_Reference/built_in_identifier_t64: Fail # Issue 25733
-Language/Expressions/Identifier_Reference/built_in_identifier_t65: Fail # Issue 25733
-Language/Expressions/Identifier_Reference/built_in_identifier_t66: Fail # Issue 25733
-Language/Expressions/Identifier_Reference/built_in_identifier_t67: Fail # Issue 25733
-Language/Expressions/Identifier_Reference/built_in_identifier_t68: Fail # Issue 25733
-Language/Expressions/Identifier_Reference/built_in_not_dynamic_t14: Fail # Issue 25732
-Language/Expressions/Identifier_Reference/built_in_not_dynamic_t19: Fail # Issue 25772
-Language/Expressions/Instance_Creation/New/execution_t04: Fail, OK
-Language/Expressions/Instance_Creation/New/execution_t06: Fail, OK
-Language/Expressions/Method_Invocation/Ordinary_Invocation/syntax_t05: Pass
-Language/Expressions/Property_Extraction/Anonymous_Constructor_Closurization/identical_t01: RuntimeError # Issue 24607
-Language/Expressions/Property_Extraction/Anonymous_Constructor_Closurization/identical_t02: RuntimeError # Issue 24607
-Language/Expressions/Property_Extraction/General_Super_Property_Extraction: RuntimeError # Issue 26287
-Language/Expressions/Property_Extraction/Named_Constructor_Closurization/identical_t01: RuntimeError # Issue 24607
-Language/Expressions/Property_Extraction/Super_Closurization: RuntimeError # Issue 26287
-Language/Expressions/Spawning_an_Isolate/new_isolate_t01: RuntimeError, OK  # Uses Isolate.spawn.
-Language/Functions/Formal_Parameters/syntax_t05: Pass
-Language/Libraries_and_Scripts/Exports/reexport_t01: fail # Dart issue 12916
-Language/Libraries_and_Scripts/Exports/reexport_t02: fail # Dart issue 12916
-Language/Libraries_and_Scripts/Parts/compilation_t02: Skip # Please triage this failure.
-Language/Libraries_and_Scripts/Parts/syntax_t05: Skip # Times out flakily. Issue 20881
-Language/Libraries_and_Scripts/Scripts/top_level_main_t03: Pass # Issue 14478: This should break.
-Language/Libraries_and_Scripts/Scripts/top_level_main_t03: RuntimeError # co19-roll r786: Please triage this failure.
-Language/Metadata/before_variable_t01: RuntimeError # Please triage this failure.
-Language/Mixins/Mixin_Application/syntax_t16: RuntimeError # Please triage this failure.
-Language/Mixins/declaring_constructor_t05: Fail # Issue 24767
-Language/Mixins/declaring_constructor_t06: Fail # Issue 24767
-Language/Mixins/not_object_superclass_t01: Fail # Please triage this failure.
-Language/Mixins/reference_to_super_t01: Fail # Please triage this failure.
-Language/Statements/Assert/execution_t02: skip # co19 issue 734
-Language/Statements/Assert/execution_t03: skip # co19 issue 734
-Language/Statements/Assert/type_t02: skip # co19 issue 734
-Language/Statements/Assert/type_t05: skip # co19 issue 734
-Language/Statements/Continue/async_loops_t10: Timeout, Skip # Issue 25748
-Language/Statements/Labels/syntax_t03: fail # Dart issue 2238
-Language/Statements/Switch/syntax_t02: fail # Dart issue 12908
-Language/Statements/Yield_and_Yield_Each/Yield/execution_async_t01: RuntimeError # Please triage this failure
-Language/Statements/Yield_and_Yield_Each/Yield/execution_async_t02: RuntimeError # Please triage this failure
-Language/Statements/Yield_and_Yield_Each/Yield/execution_async_t04: RuntimeError # Please triage this failure
-Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_t08: RuntimeError # Issue 25748
-Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_t09: RuntimeError # Issue 25748
-Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_t10: RuntimeError # Issue 25748
-Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_sync_t05: RuntimeError # Issue 25662,25634
-LayoutTests/fast/alignment/parse-align-items_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/alignment/parse-align-self_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/alignment/parse-justify-self_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/backgrounds/repeat/parsing-background-repeat_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/borders/border-radius-child_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/borders/border-radius-child_t01: Skip # co19 issue 732.
-LayoutTests/fast/canvas/2d.fillText.gradient_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/2d.text.draw.fill.maxWidth.gradient_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/2d.text.draw.fill.maxWidth.negative_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/2d.text.draw.fill.maxWidth.veryLarge_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/2d.text.draw.fill.maxWidth.verySmall_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/canvas-arc-negative-radius_t01: Skip # Times out. co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/canvas-blending-text_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/canvas-currentTransform_t01: RuntimeError # Feature is behind a flag in Chrome
-LayoutTests/fast/canvas/canvas-empty-image-pattern_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/canvas-getImageData-invalid_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/canvas-large-dimensions_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/canvas-large-fills_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/canvas-lose-restore-googol-size_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/canvas-lose-restore-max-int-size_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/draw-custom-focus-ring_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/drawImage-with-broken-image_t01: Timeout, Pass # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/getPutImageDataPairTest_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/WebGLContextEvent_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/array-bounds-clamping_t01: RuntimeError # Issue 25653
-LayoutTests/fast/canvas/webgl/attrib-location-length-limits_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/bad-arguments-test_t01: Pass, RuntimeError # Issue 20, 22026
-LayoutTests/fast/canvas/webgl/buffer-bind-test_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/canvas-2d-webgl-texture_t01: RuntimeError # Issue 25653
-LayoutTests/fast/canvas/webgl/canvas-resize-crash_t01: Skip # Causes following tests to fail. co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/canvas-test_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/canvas/webgl/canvas-test_t01: RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias-t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias-t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/context-destroyed-crash_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/context-lost-restored_t01: RuntimeError # Issue 25653
-LayoutTests/fast/canvas/webgl/copy-tex-image-and-sub-image-2d_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/copy-tex-image-and-sub-image-2d_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/css-webkit-canvas-repaint_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/css-webkit-canvas_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/draw-webgl-to-canvas-2d_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/drawingbuffer-test_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/error-reporting_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize_t01: RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/framebuffer-object-attachment_t01: RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/framebuffer-object-attachment_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/framebuffer-test_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/framebuffer-test_t01: RuntimeError # Issue 20, 22026
-LayoutTests/fast/canvas/webgl/functions-returning-strings_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/get-active-test_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/gl-bind-attrib-location-test_t01: RuntimeError # Issue 25653
-LayoutTests/fast/canvas/webgl/gl-enable-enum-test_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/gl-get-calls_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/gl-getshadersource_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/gl-getstring_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/gl-pixelstorei_t01: RuntimeError # Issue 25653
-LayoutTests/fast/canvas/webgl/gl-teximage_t01: RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/gl-teximage_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/gl-vertexattribpointer_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/glsl-conformance_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/incorrect-context-object-behaviour_t01: Pass, RuntimeError # Issue 20, 22026
-LayoutTests/fast/canvas/webgl/invalid-UTF-16_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/is-object_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/null-object-behaviour_t01: Pass, RuntimeError # Issue 20, 22026
-LayoutTests/fast/canvas/webgl/object-deletion-behaviour_t01: RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/object-deletion-behaviour_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/oes-element-index-uint_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/canvas/webgl/oes-element-index-uint_t01: RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/oes-vertex-array-object_t01: RuntimeError # Issue 25653
-LayoutTests/fast/canvas/webgl/point-size_t01: RuntimeError # Issue 25653
-LayoutTests/fast/canvas/webgl/premultiplyalpha-test_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/read-pixels-pack-alignment_t01: RuntimeError # Issue 25653
-LayoutTests/fast/canvas/webgl/read-pixels-test_t01: RuntimeError # Issue 25653
-LayoutTests/fast/canvas/webgl/renderbuffer-initialization_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/renderer-and-vendor-strings_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/shader-precision-format_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view_t01: RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgb565_t01: RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgb565_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgba4444_t01: RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgba4444_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgba5551_t01: RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgba5551_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas_t01: RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgb565_t01: RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgb565_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgba4444_t01: RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgba4444_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgba5551_t01: RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgba5551_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data_t01: RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgb565_t01: RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgb565_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba4444_t01: RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba4444_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba5551_t01: RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba5551_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image_t01: RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgb565_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgb565_t01: Skip # Issue 20540
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba4444_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba4444_t01: Skip # Issue 20540
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba5551_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba5551_t01: Skip # Issue 20540
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video_t01: Skip # Issue 20540
-LayoutTests/fast/canvas/webgl/tex-image-webgl_t01: RuntimeError # Issue 25653
-LayoutTests/fast/canvas/webgl/tex-sub-image-2d-bad-args_t01: Pass, RuntimeError # Issue 20, 22026
-LayoutTests/fast/canvas/webgl/tex-sub-image-2d_t01: RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/tex-sub-image-2d_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/tex-sub-image-cube-maps_t01: RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/tex-sub-image-cube-maps_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/texImage2DImageDataTest_t01: RuntimeError # Issue 25653
-LayoutTests/fast/canvas/webgl/texture-active-bind_t01: RuntimeError # Issue 25653
-LayoutTests/fast/canvas/webgl/texture-bindings-uneffected-on-resize_t01: RuntimeError # Issue 25653
-LayoutTests/fast/canvas/webgl/texture-color-profile_t01: RuntimeError # Issue 25653
-LayoutTests/fast/canvas/webgl/texture-complete_t01: RuntimeError # Issue 25653
-LayoutTests/fast/canvas/webgl/texture-npot_t01: RuntimeError # Issue 25653
-LayoutTests/fast/canvas/webgl/texture-transparent-pixels-initialized_t01: RuntimeError # 45 rollwebgl doesn't run on on windows/linux but failed on mac bots.
-LayoutTests/fast/canvas/webgl/triangle_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/uniform-location-length-limits_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/uniform-location_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/uniform-location_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/uninitialized-test_t01: RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/uninitialized-test_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/viewport-unchanged-upon-resize_t01: RuntimeError # Issue 25653
-LayoutTests/fast/canvas/webgl/webgl-composite-modes-repaint_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/webgl-composite-modes_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/webgl-depth-texture_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/webgl/webgl-depth-texture_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/webgl-large-texture_t01: RuntimeError # Issue 25653
-LayoutTests/fast/canvas/webgl/webgl-layer-update_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/webgl-specific_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/canvas/webgl/webgl-texture-binding-preserved_t01: RuntimeError # Issue 25653
-LayoutTests/fast/canvas/webgl/webgl-viewport-parameters-preserved_t01: Pass, RuntimeError # Issue 22026
-LayoutTests/fast/css-generated-content/bug91547_t01: Skip # Test reloads itself. Issue 18558.
-LayoutTests/fast/css-generated-content/hit-test-generated-content_t01: Skip # co19 issue 732.
-LayoutTests/fast/css-generated-content/malformed-url_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-generated-content/pseudo-animation-before-onload_t01: Pass, RuntimeError # Please triage this failure
-LayoutTests/fast/css-generated-content/pseudo-animation_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-generated-content/pseudo-element-events_t01: Skip # Timeout. co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-generated-content/pseudo-transition-event_t01: Skip # Timeout. co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-generated-content/pseudo-transition_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/auto-content-resolution-rows_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/breadth-size-resolution-grid_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/calc-resolution-grid-item_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/display-grid-set-get_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/flex-and-minmax-content-resolution-rows_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/flex-content-resolution-columns_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/flex-content-resolution-rows_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/grid-auto-columns-rows-get-set_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/grid-auto-flow-get-set_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/grid-auto-flow-update_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/grid-container-change-explicit-grid-recompute-child_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/grid-element-border-grid-item_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/grid-element-border-padding-grid-item_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/grid-element-empty-row-column_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/grid-element-min-max-height_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/grid-element-padding-grid-item_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/grid-element-padding-margin_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/grid-element-shrink-to-fit_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/grid-item-area-get-set_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/grid-item-bad-named-area-auto-placement_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/grid-item-bad-resolution-double-span_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/grid-item-change-order-auto-flow_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/grid-item-display_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-horiz-bt_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-vert-lr_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-vert-rl_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/grid-item-margin-resolution_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/grid-item-order-auto-flow-resolution_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/grid-template-areas-get-set_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/implicit-rows-auto-resolution_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/justify-self-cell_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/minmax-fixed-logical-height-only_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/minmax-fixed-logical-width-only_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track-in-percent-grid_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track-update_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/percent-padding-margin-resolution-grid-item-update_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/percent-padding-margin-resolution-grid-item_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/percent-resolution-grid-item_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-grid-layout/place-cell-by-index_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-replaced-absolutes_t01: Skip # 45 Roll failure.
-LayoutTests/fast/css/aspect-ratio-inheritance_t01: Skip # 45 Roll No longer supported.
-LayoutTests/fast/css/aspect-ratio-parsing-tests_t01: Skip # 45 Roll No longer supported.
-LayoutTests/fast/css/auto-min-size_t01: RuntimeError #  45 Roll co19 test rewrite issue 25807
-LayoutTests/fast/css/checked-pseudo-selector_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/collapsed-whitespace-reattach-in-style-recalc_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/collapsed-whitespace-reattach-in-style-recalc_t01: Skip # co19 issue 732.
-LayoutTests/fast/css/computed-offset-with-zoom_t01: Skip # co19 issue 732.
-LayoutTests/fast/css/content/content-none_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/content/content-normal_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/counters/complex-before_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/css-properties-case-insensitive_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/css3-nth-tokens-style_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/deprecated-flexbox-auto-min-size_t01: Pass, RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/first-child-display-change-inverse_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/focus-display-block-inline_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/font-face-cache-bug_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/font-face-insert-link_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css/font-face-multiple-ranges-for-unicode-range_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css/font-face-unicode-range-load_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/font-face-unicode-range-overlap-load_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/fontfaceset-events_t01: Pass, RuntimeError # Issue 23433
-LayoutTests/fast/css/fontfaceset-loadingdone_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/html-attr-case-sensitivity_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/id-or-class-before-stylesheet_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/inherit-initial-shorthand-values_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/invalid-predefined-color_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/link-alternate-stylesheet-1_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/link-alternate-stylesheet-2_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/link-alternate-stylesheet-3_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/link-alternate-stylesheet-4_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/link-alternate-stylesheet-5_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/media-query-recovery_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/parsing-at-rule-recovery_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/parsing-css-allowed-string-characters_t01: RuntimeError #  45 Roll co19 test rewrite issue 25807
-LayoutTests/fast/css/parsing-object-position_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css/parsing-page-rule_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/parsing-selector-error-recovery_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/pseudo-any_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/pseudo-target-indirect-sibling-001_t01: Skip # Times out. co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/pseudo-target-indirect-sibling-002_t01: Skip # Times out. co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/readonly-pseudoclass-opera-001_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/readonly-pseudoclass-opera-002_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/readonly-pseudoclass-opera-003_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/readonly-pseudoclass-opera-004_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/readonly-pseudoclass-opera-005_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/sticky/parsing-position-sticky_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/style-element-process-crash_t01: Skip # Times out. co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/style-scoped/style-scoped-nested_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css/style-scoped/style-scoped-with-dom-operation_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css/style-scoped/style-scoped-with-important-rule_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css/stylesheet-enable-first-alternate-on-load-sheet_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/stylesheet-enable-second-alternate-link_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/webkit-keyframes-errors_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last-inherited_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-color_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-line_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-style_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css3-text/css3-text-indent/getComputedStyle/getComputedStyle-text-indent-inherited_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css3-text/css3-text-indent/getComputedStyle/getComputedStyle-text-indent_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/css3-text/css3-text-justify/getComputedStyle/getComputedStyle-text-justify_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LayoutTests/fast/dom/Document/CaretRangeFromPoint/basic_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-strict-mode-wtih-checkbox_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-zoom-and-scroll_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LayoutTests/fast/dom/Document/CaretRangeFromPoint/hittest-relative-to-viewport_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LayoutTests/fast/dom/Document/CaretRangeFromPoint/replace-element_t01: Pass, RuntimeError # co19-roll r706.  Please triage this failure.
-LayoutTests/fast/dom/Document/createElementNS-namespace-err_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LayoutTests/fast/dom/Element/attribute-uppercase_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LayoutTests/fast/dom/Element/getClientRects_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LayoutTests/fast/dom/Element/setAttributeNS-namespace-err_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LayoutTests/fast/dom/HTMLAnchorElement/remove-href-from-focused-anchor_t01: Skip # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hostname_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-pathname_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-port_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-protocol_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-search_t01: RuntimeError, Pass # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLButtonElement/change-type_t01: Skip # Test reloads itself. Issue 18558.
-LayoutTests/fast/dom/HTMLDialogElement/dialog-autofocus_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLDialogElement/dialog-scrolled-viewport_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLDialogElement/dialog-show-modal_t01: RuntimeError, Pass # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-unfocusable_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLDialogElement/multiple-centered-dialogs_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLDialogElement/non-anchored-dialog-positioning_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLDialogElement/show-modal-focusing-steps_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLDocument/active-element-gets-unforcusable_t01: Skip # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLDocument/set-focus-on-valid-element_t01: Skip # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLElement/insertAdjacentHTML-errors_t01: RuntimeError # co19 issue 11.
-LayoutTests/fast/dom/HTMLElement/set-inner-outer-optimization_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLElement/spellcheck_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLFormElement/move-option-between-documents_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLImageElement/image-alt-text_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLImageElement/parse-src_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLInputElement/input-image-alt-text_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test_t01: Skip # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLLinkElement/link-beforeload-recursive_t01: Skip # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLLinkElement/prefetch-onload_t01: Skip # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLLinkElement/prefetch_t01: Skip # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLLinkElement/resolve-url-on-insertion_t01: RuntimeError # co19-roll r722: Issue 18010
-LayoutTests/fast/dom/HTMLObjectElement/beforeload-set-text-crash_t01: Skip # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLOptionElement/collection-setter-getter_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLScriptElement/async-false-inside-async-false-load_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLScriptElement/async-inline-script_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLScriptElement/async-onbeforeload_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLScriptElement/defer-inline-script_t01: RuntimeError, Pass # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLScriptElement/defer-onbeforeload_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLScriptElement/remove-in-beforeload_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLScriptElement/script-set-src_t01: RuntimeError, Pass # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/HTMLSelectElement/selected-index-preserved-when-option-text-changes_t01: RuntimeError # co19-roll r722: Issue 18127
-LayoutTests/fast/dom/HTMLTemplateElement/custom-element-wrapper-gc_t01: RuntimeError # co19-roll r722: Issue 18250
-LayoutTests/fast/dom/HTMLTemplateElement/innerHTML_t01: RuntimeError # co19-roll r722: Issue 18249
-LayoutTests/fast/dom/HTMLTemplateElement/ownerDocumentXHTML_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/MutationObserver/database-callback-delivery_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/dom/MutationObserver/observe-childList_t01: RuntimeError # co19-roll r722: Issue 18253
-LayoutTests/fast/dom/MutationObserver/weak-callback-gc-crash_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/Node/fragment-mutation_t01: RuntimeError # Please triage this failure.
-LayoutTests/fast/dom/Node/initial-values_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/Range/bug-19527_t01: RuntimeError # Please triage this failure.
-LayoutTests/fast/dom/Range/range-created-during-remove-children_t01: RuntimeError, Pass # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/Range/range-detached-exceptions_t01: RuntimeError # Please triage this failure.
-LayoutTests/fast/dom/StyleSheet/css-medialist-item_t01: RuntimeError # Dartium JSInterop failure
-LayoutTests/fast/dom/StyleSheet/discarded-sheet-owner-null_t01: Skip # Test reloads itself. Issue 18558.
-LayoutTests/fast/dom/Window/window-resize-contents_t01: Pass, RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/Window/window-resize_t01: RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/Window/window-scroll-arguments_t01: RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/anchor-without-content_t01: RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/attribute-namespaces-get-set_t01: RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/blur-contenteditable_t01: RuntimeError, Pass # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/characterdata-api-arguments_t01: RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/client-width-height-quirks_t01: RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/css-cached-import-rule_t01: Skip # Test reloads itself. Issue 18558.
-LayoutTests/fast/dom/css-innerHTML_t01: RuntimeError # Test is incorrect.
-LayoutTests/fast/dom/cssTarget-crash_t01: Skip # Test reloads itself. Issue 18558.
-LayoutTests/fast/dom/custom/document-register-basic_t01: RuntimeError # Bad test can't register HtmlElement.
-LayoutTests/fast/dom/custom/document-register-svg-extends_t01: RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/custom/element-names_t01: RuntimeError # 45 Roll issue dart-lang/co19/issues/25
-LayoutTests/fast/dom/dataset-xhtml_t01: RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/dataset_t01: RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/document-importNode-arguments_t01: RuntimeError # Please triage this failure.
-LayoutTests/fast/dom/empty-hash-and-search_t01: Skip # Test reloads itself. Issue 18558.
-LayoutTests/fast/dom/focus-contenteditable_t01: RuntimeError, Pass # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/getElementsByClassName/011_t01: RuntimeError # Chrome 39 roll. Please triage this failure
-LayoutTests/fast/dom/horizontal-scrollbar-in-rtl-doesnt-fire-onscroll_t01: RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/horizontal-scrollbar-when-dir-change_t01: RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/location-hash_t01: Pass, RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered_t01: RuntimeError # Dartium JSInterop failure
-LayoutTests/fast/dom/navigatorcontentutils/unregister-protocol-handler_t01: RuntimeError # Dartium JSInterop failure
-LayoutTests/fast/dom/option-properties_t01: RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/partial-layout-overlay-scrollbars_t01: RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/set-innerHTML_t01: RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/shadow/form-in-shadow_t01: Skip # Test reloads itself. Issue 18558.
-LayoutTests/fast/dom/shadow/no-renderers-for-light-children_t01: RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/shadow/pseudoclass-update-checked-option_t01: RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-optgroup_t01: RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-option_t01: RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/shadow/pseudoclass-update-enabled-optgroup_t01: RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/shadow/pseudoclass-update-enabled-option_t01: RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/shadow/shadow-content-crash_t01: RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/shadow/shadow-removechild-and-blur-event_t01: RuntimeError, Pass # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dynamic/crash-generated-counter_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/dynamic/crash-generated-image_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/dynamic/crash-generated-quote_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/dynamic/crash-generated-text_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/dynamic/insertAdjacentElement_t01: Skip # Timeout. co19-roll r786: Please triage this failure.
-LayoutTests/fast/dynamic/insertAdjacentHTML_t01: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/dynamic/recursive-layout_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/encoding/css-charset-dom_t01: Skip #  45 Roll No longer supported see issue https://github.com/dart-lang/co19/issues/35
-LayoutTests/fast/events/change-overflow-on-overflow-change_t01: Skip # Timeout. Please triage this failure.
-LayoutTests/fast/events/clipboard-clearData_t01: Skip # Timeout. co19-roll r786: Please triage this failure.
-LayoutTests/fast/events/clipboard-dataTransferItemList_t01: Skip # Timeout. co19-roll r786: Please triage this failure.
-LayoutTests/fast/events/div-focus_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/events/document-elementFromPoint_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/events/document-elementFromPoint_t01: Skip # co19 issue 732.
-LayoutTests/fast/events/event-creation_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/events/event-listener-html-non-html-confusion_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/events/initkeyboardevent-crash_t01: RuntimeError, Timeout # co19-roll r786: Please triage this failure.
-LayoutTests/fast/events/input-focus-no-duplicate-events_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/events/invalid-003_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/events/invalid-004_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/events/label-focus_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/events/mutation-during-replace-child-2_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/events/mutation-during-replace-child_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/events/nested-event-remove-node-crash_t01: Skip # Flaky timeout. co19-roll r786: Please triage this failure.
-LayoutTests/fast/events/overflowchanged-event-raf-timing_t01: Skip #  45 Roll No longer supported.
-LayoutTests/fast/events/scoped/editing-commands_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/events/scroll-event-does-not-bubble_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/events/tabindex-removal-from-focused-element_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/exclusions/parsing/parsing-wrap-flow_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/exclusions/parsing/parsing-wrap-through_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/files/blob-close-read_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/files/blob-close-revoke_t01: RuntimeError # Experimental feature not exposed anywhere yet
-LayoutTests/fast/files/blob-close_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/files/xhr-response-blob_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/filesystem/async-operations_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/filesystem/directory-entry-to-uri_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/filesystem/file-after-reload-crash_t01: Skip # Test reloads itself. Issue 18558.
-LayoutTests/fast/filesystem/file-entry-to-uri_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/filesystem/file-writer-abort-continue_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/filesystem/file-writer-abort-depth_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/filesystem/file-writer-events_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/filesystem/file-writer-gc-blob_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/filesystem/file-writer-write-overlapped_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/filesystem/filesystem-reference_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/filesystem/read-directory-many_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/filesystem/simple-readonly_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/HTMLOptionElement_selected2_t01: Skip # Times out. co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/autofocus-focus-only-once_t01: Skip # Times out. co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/autofocus-input-css-style-change_t01: Skip # Times out. co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/autofocus-opera-007_t01: Skip # Times out. co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/autofocus-readonly-attribute_t01: Skip # Times out. co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/button-baseline-and-collapsing_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/button/button-disabled-blur_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/clone-input-with-dirty-value_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-onblur-setvalue-onfocusremoved_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-change-layout-by-value_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/datetimelocal/datetimelocal-interactive-validation-required_t01: Skip # Test reloads itself. Issue 18558.
-LayoutTests/fast/forms/file/file-input-capture_t01: RuntimeError # Experimental feature not exposed in Chrome yet
-LayoutTests/fast/forms/focus-style-pending_t01: Skip # Times out. co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/focus_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/form-submission-create-crash_t01: Skip # Test reloads itself. Issue 18558.
-LayoutTests/fast/forms/formmethod-attribute-button-html_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/formmethod-attribute-button-html_t01: Skip # Test reloads itself. Issue 18558.
-LayoutTests/fast/forms/formmethod-attribute-input-2_t01: Skip # Test reloads itself. Issue 18558.
-LayoutTests/fast/forms/formmethod-attribute-input-html_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/formmethod-attribute-input-html_t01: Skip # Test reloads itself. Issue 18558.
-LayoutTests/fast/forms/input-hit-test-border_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/input-inputmode_t01: RuntimeError # Experimental feature not exposed in Chrome yet
-LayoutTests/fast/forms/input-value-sanitization_t01: RuntimeError # 45 roll issue
-LayoutTests/fast/forms/input-width-height-attributes-without-renderer-loaded-image_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/listbox-select-all_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/listbox-selection-2_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/menulist-disabled-selected-option_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/menulist-selection-reset_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/menulist-submit-without-selection_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/missing-action_t01: Skip # Test reloads itself. Issue 18558.
-LayoutTests/fast/forms/multiple-selected-options-innerHTML_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/option-change-single-selected_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/option-strip-unicode-spaces_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/parser-associated-form-removal_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/search-popup-crasher_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/select-change-popup-to-listbox-in-event-handler_t01: Skip # Times out. co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/select-clientheight-large-size_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/select-clientheight-with-multiple-attr_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/select-list-box-mouse-focus_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/submit-form-with-dirname-attribute-with-ancestor-dir-attribute_t01: Skip # Test reloads itself. Issue 18558.
-LayoutTests/fast/forms/submit-form-with-dirname-attribute-with-nonhtml-ancestor_t01: Skip # Test reloads itself. Issue 18558.
-LayoutTests/fast/forms/submit-form-with-dirname-attribute_t01: Skip # Test reloads itself. Issue 18558.
-LayoutTests/fast/forms/submit-nil-value-field-assert_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/submit-nil-value-field-assert_t01: Skip # Test reloads itself. Issue 18558.
-LayoutTests/fast/forms/textarea-paste-newline_t01: Pass, RuntimeError # Issue 23433
-LayoutTests/fast/forms/textarea-scrollbar-height_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/forms/textarea-submit-crash_t01: Skip # Test reloads itself. Issue 18558.
-LayoutTests/fast/forms/textfield-focus-out_t01: Skip # Times out. co19-roll r801: Please triage this failure.
-LayoutTests/fast/html/adjacent-html-context-element_t01:RuntimeError # co19 issue 11.
-LayoutTests/fast/html/hidden-attr_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LayoutTests/fast/html/imports/import-element-removed-flag_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LayoutTests/fast/html/imports/import-element-removed-flag_t01: Skip # co19-roll r722: Please triage this failure.
-LayoutTests/fast/html/imports/import-events_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LayoutTests/fast/html/select-dropdown-consistent-background-color_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/inline/boundingBox-with-continuation_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/inline/inline-position-top-align_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/inline/inline-with-empty-inline-children_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/inline/out-of-flow-objects-and-whitespace-after-empty-inline_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/inline/parent-inline-element-padding-contributes-width_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/inline/positioned-element-padding-contributes-width_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/layers/zindex-hit-test_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/layers/zindex-hit-test_t01: RuntimeError # co19 issue 11.
-LayoutTests/fast/lists/list-style-position-inside_t01: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/loader/about-blank-hash-change_t01: Skip # Times out. co19-roll r801: Please triage this failure.
-LayoutTests/fast/loader/about-blank-hash-kept_t01: Skip # Times out. co19-roll r801: Please triage this failure.
-LayoutTests/fast/loader/hashchange-event-properties_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/loader/loadInProgress_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/loader/onhashchange-attribute-listeners_t01: Skip # Times out. co19-roll r801: Please triage this failure.
-LayoutTests/fast/loader/onload-policy-ignore-for-frame_t01: Skip # Times out. Dartium 45 roll: Please triage this failure.
-LayoutTests/fast/loader/scroll-position-restored-on-back_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/loader/scroll-position-restored-on-reload-at-load-event_t01: Skip # Times out. co19-roll r801: Please triage this failure.
-LayoutTests/fast/loader/stateobjects/replacestate-in-onunload_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/masking/parsing-clip-path-shape_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/masking/parsing-mask-source-type_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/masking/parsing-mask_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/media/media-query-list-syntax_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/media/mq-parsing_t01: Pass, RuntimeError # False passes on Firefox, but trying to keep these grouped with the issue. # co19 issue 11.
-LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream_t01: Skip # Issue 22111
-LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream_t01: Skip # Passes on Safari, Issue 23475 # co19 issue 11.
-LayoutTests/fast/mediastream/getusermedia_t01: Skip # co19 issue 738
-LayoutTests/fast/multicol/balance-unbreakable_t01: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/multicol/break-after-always-bottom-margin_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/multicol/break-properties_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/multicol/column-width-zero_t01: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/multicol/cssom-view_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/multicol/flipped-blocks-hit-test_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/multicol/float-truncation_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/multicol/hit-test-above-or-below_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/multicol/hit-test-end-of-column-with-line-height_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/multicol/hit-test-end-of-column_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/multicol/hit-test-float_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/multicol/hit-test-gap-between-pages_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/multicol/newmulticol/balance-images_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/multicol/newmulticol/balance-maxheight_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/multicol/newmulticol/balance_t01: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/multicol/newmulticol/balance_t02: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/multicol/newmulticol/balance_t04: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/multicol/newmulticol/balance_t04: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/multicol/newmulticol/balance_t05: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/multicol/newmulticol/balance_t06: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/multicol/newmulticol/balance_t07: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/multicol/newmulticol/balance_t07: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/multicol/newmulticol/balance_t08: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/multicol/newmulticol/balance_t08: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/multicol/newmulticol/balance_t09: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/multicol/newmulticol/balance_t09: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/multicol/newmulticol/balance_t10: Pass, RuntimeError # I don't understand how, but sometimes passes. # co19 issue 11.
-LayoutTests/fast/multicol/newmulticol/balance_t10: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/multicol/orphans-relayout_t01: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/multicol/vertical-lr/float-truncation_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/multicol/vertical-rl/float-truncation_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/multicol/widows_t01: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/multicol/widows_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/overflow/child-100percent-height-inside-fixed-container-with-overflow-auto_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/overflow/child-100percent-height-inside-fixed-container-with-overflow-auto_t01: RuntimeError # co19 issue 11.
-LayoutTests/fast/overflow/overflow-rtl-vertical-origin_t01: Pass, RuntimeError # False passes on Firefox, but trying to keep these grouped with the issue. # co19 issue 11.
-LayoutTests/fast/overflow/replaced-child-100percent-height-inside-fixed-container-with-overflow-auto_t01: Pass, RuntimeError # False pass on Safari # co19 issue 11.
-LayoutTests/fast/overflow/replaced-child-100percent-height-inside-fixed-container-with-overflow-auto_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/overflow/scroll-vertical-not-horizontal_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/overflow/scrollbar-restored_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/parser/foster-parent-adopted_t02: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/parser/fragment-parser-doctype_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/parser/innerhtml-with-prefixed-elements_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/parser/parse-wbr_t01: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor-vertical-lr_t01: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor_t01: Pass # False pass # co19 issue 11.
-LayoutTests/fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor_t01: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/replaced/computed-image-width-with-percent-height-inside-table-cell-and-fixed-ancestor-vertical-lr_t01: RuntimeError, Pass # Spurious intermittent pass # co19 issue 11.
-LayoutTests/fast/replaced/computed-image-width-with-percent-height-inside-table-cell-and-fixed-ancestor_t01: RuntimeError, Pass # Spurious intermittent pass # co19 issue 11.
-LayoutTests/fast/replaced/container-width-zero_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/replaced/iframe-with-percentage-height-within-table-with-anonymous-table-cell_t01: Skip # Times out: Please triage this failure.
-LayoutTests/fast/replaced/iframe-with-percentage-height-within-table-with-table-cell-ignore-height_t01: Skip # Times out: Please triage this failure.
-LayoutTests/fast/replaced/preferred-widths_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/replaced/table-percent-height_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/replaced/table-percent-width_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/ruby/parse-rp_t01: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/ruby/ruby-line-height_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/shapes/parsing/parsing-shape-lengths_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/shapes/shape-outside-floats/shape-outside-big-box-border-radius_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-diamond-margin-polygon_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-margin-left_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-margin-right_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-image-margin_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-image-margin_t02: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-inset-rounded-different-writing-modes-left_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-inset-rounded-different-writing-modes-right_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/shapes/shape-outside-floats/shape-outside-rounded-boxes_t01: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/shapes/shape-outside-floats/shape-outside-rounded-boxes_t02: RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/speechsynthesis/*: Skip # Times out on Dartium. Fails elsewhere. Issue 22017
-LayoutTests/fast/storage/disallowed-storage_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/storage/storage-disallowed-in-data-url_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/sub-pixel/cssom-subpixel-precision_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/sub-pixel/float-containing-block-with-margin_t01: RuntimeError # co19 issue 11.
-LayoutTests/fast/sub-pixel/float-containing-block-with-margin_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/sub-pixel/float-containing-block-with-margin_t01: Skip # co19 issue 732.
-LayoutTests/fast/sub-pixel/inline-block-with-padding_t01: Skip # co19 issue 732.
-LayoutTests/fast/sub-pixel/replaced-element-baseline_t01: Pass, RuntimeError # Fails on Safari, false pass on others # co19 issue 11.
-LayoutTests/fast/sub-pixel/replaced-element-baseline_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/sub-pixel/size-of-span-with-different-positions_t01: Skip # co19 issue 732.
-LayoutTests/fast/sub-pixel/table-rows-have-stable-height_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/sub-pixel/table-rows-have-stable-height_t01: Skip # co19 issue 732.
-LayoutTests/fast/table/anonymous-table-section-removed_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/anonymous-table-section-removed_t01: Skip # co19 issue 11.
-LayoutTests/fast/table/caption-orthogonal-writing-mode-sizing_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/col-width-span-expand_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/col-width-span-expand_t01: Skip # co19 issue 11.
-LayoutTests/fast/table/col-width-span-expand_t01: Skip # co19 issue 732.
-LayoutTests/fast/table/computeLogicalWidth-table-needsSectionRecalc_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/css-table-max-height_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/css-table-max-width_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/fixed-table-layout-width-change_t01: Pass, RuntimeError # False passes on Firefox # co19 issue 11.
-LayoutTests/fast/table/hittest-tablecell-bottom-edge_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/hittest-tablecell-bottom-edge_t01: Skip # co19 issue 11.
-LayoutTests/fast/table/hittest-tablecell-right-edge_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/hittest-tablecell-with-borders-bottom-edge_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/hittest-tablecell-with-borders-right-edge_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/html-table-width-max-width-constrained_t01: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/table/large-shrink-wrapped-width_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/margins-flipped-text-direction_t01: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/table/margins-perpendicular-containing-block_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/min-max-width-preferred-size_t01: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/table/min-width-css-block-table_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/min-width-css-inline-table_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/min-width-html-block-table_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/min-width-html-inline-table_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/nested-tables-with-div-offset_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
-LayoutTests/fast/table/padding-height-and-override-height_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/table-all-rowspans-height-distribution-in-rows-except-overlapped_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/table-all-rowspans-height-distribution-in-rows_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/table-cell-offset-width_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/table-colgroup-present-after-table-row_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/table-rowspan-cell-with-empty-cell_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/table-rowspan-height-distribution-in-rows_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/table-rowspan-height-distribution-in-rows_t02: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/table-width-exceeding-max-width_t01: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/table/table-with-content-width-exceeding-max-width_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/text-autosizing/vertical-writing-mode_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/text-autosizing/vertical-writing-mode_t01: Skip # co19 issue 732.
-LayoutTests/fast/text/find-soft-hyphen_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/text/find-spaces_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/text/font-fallback-synthetic-italics_t01: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/text/font-fallback-synthetic-italics_t01: RuntimeError # co19 issue 11.
-LayoutTests/fast/text/font-ligatures-linebreak-word_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/text/font-ligatures-linebreak-word_t01: Skip # co19 issue 11.
-LayoutTests/fast/text/font-ligatures-linebreak-word_t01: Skip # co19 issue 11.
-LayoutTests/fast/text/font-ligatures-linebreak_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/text/glyph-reordering_t01: Pass, RuntimeError # This is a false pass. The font gets sanitized, so whether it works or not probably depends on default sizes. # co19 issue 11.
-LayoutTests/fast/text/international/complex-text-rectangle_t01: Skip # co19 issue 732.
-LayoutTests/fast/text/international/iso-8859-8_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/text/international/rtl-text-wrapping_t01: Pass # This is a false pass. All the content gets sanitized, so there's nothing to assert fail on. If the code did anything it would fail. # co19 issue 11.
-LayoutTests/fast/text/international/rtl-text-wrapping_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/text/international/rtl-text-wrapping_t01: Skip # co19 issue 732.
-LayoutTests/fast/text/international/thai-offsetForPosition-inside-character_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/text/ipa-tone-letters_t01: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/text/ipa-tone-letters_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/text/line-break-after-empty-inline-hebrew_t01: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/text/line-break-after-question-mark_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/text/line-breaks-after-hyphen-before-number_t01: RuntimeError # co19 issue 11.
-LayoutTests/fast/text/line-breaks-after-hyphen-before-number_t01: Skip # co19 issue 732.
-LayoutTests/fast/text/offsetForPosition-cluster-at-zero_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/text/regional-indicator-symobls_t01: Pass, Fail # co19 issue 11.
-LayoutTests/fast/text/regional-indicator-symobls_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/text/remove-zero-length-run_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/text/sub-pixel/text-scaling-ltr_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/text/sub-pixel/text-scaling-pixel_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/text/sub-pixel/text-scaling-rtl_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/text/sub-pixel/text-scaling-vertical_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/text/sub-pixel/text-scaling-webfont_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/text/text-combine-shrink-to-fit_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/transforms/bounding-rect-zoom_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/transforms/bounding-rect-zoom_t01: RuntimeError, Pass # Erratic, but only passes because divs have been entirely removed. # co19 issue 11.
-LayoutTests/fast/transforms/hit-test-large-scale_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/transforms/scrollIntoView-transformed_t01: Pass, RuntimeError # False passes on Firefox. # co19 issue 11.
-LayoutTests/fast/transforms/transform-hit-test-flipped_t01: Pass, RuntimeError # Passes on Firefox, but is clearly not testing what it's trying to test. # co19 issue 11.
-LayoutTests/fast/url/file-http-base_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/url/file_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/url/host_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/url/idna2003_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/url/idna2008_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/url/invalid-urls-utf8_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/url/ipv4_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/url/ipv6_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/url/path_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/url/query_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/url/relative-unix_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/url/relative-win_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/url/relative_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/url/segments-from-data-url_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/url/segments_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/url/standard-url_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/writing-mode/percentage-margins-absolute-replaced_t01: Pass, RuntimeError # co19 issue 11.
-LayoutTests/fast/writing-mode/positionForPoint_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/writing-mode/positionForPoint_t01: Skip # co19 issue 732.
-LayoutTests/fast/writing-mode/table-hit-test_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/writing-mode/vertical-font-vmtx-units-per-em_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-abort_t01: Skip # Timeout. co19-roll r786: Please triage this failure.
-LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-arraybuffer_t01: Skip # Timeout. co19-roll r786: Please triage this failure.
-LayoutTests/fast/xpath/4XPath/Borrowed/cz_20030217_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/xpath/4XPath/Borrowed/namespace-nodes_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/xpath/4XPath/Core/test_core_functions_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/xpath/4XPath/Core/test_core_functions_t02: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/xpath/4XPath/Core/test_node_test_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/xpath/4XPath/Core/test_node_test_t02: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/xpath/4XPath/Core/test_parser_t01: RuntimeError # Dartium JSInterop failure
-LayoutTests/fast/xpath/attr-namespace_t02: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/xpath/ensure-null-namespace_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/xpath/implicit-node-args_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/xpath/node-name-case-sensitivity_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/xpath/node-name-case-sensitivity_t02: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/xpath/position_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/xpath/py-dom-xpath/abbreviations_t01: RuntimeError # Dartium JSInterop failure
-LayoutTests/fast/xpath/py-dom-xpath/axes_t01: RuntimeError # Dartium JSInterop failure
-LayoutTests/fast/xpath/py-dom-xpath/data_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/xpath/py-dom-xpath/expressions_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/xpath/py-dom-xpath/paths_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/xpath/reverse-axes_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/xsl/default-html_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LibTest/async/Stream/Stream.periodic_A01_t01: Pass, RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/async/Timer/Timer_A01_t01: RuntimeError, Pass # Issue 16475
-LibTest/collection/ListBase/ListBase_class_A01_t01: Skip # co19-roll r722: Please triage this failure.
-LibTest/collection/ListMixin/ListMixin_class_A01_t01: Skip # co19-roll r722: Please triage this failure.
-LibTest/collection/ListMixin/ListMixin_class_A01_t02: Skip # co19-roll r722: Please triage this failure.
-LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t01: Fail # Issue 22200
-LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t05: Fail # Issue 22200
-LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t06: Fail # Issue 22200
-LibTest/core/Symbol/Symbol_A01_t03: RuntimeError # Issue 13596
-LibTest/core/Symbol/Symbol_A01_t05: RuntimeError # Issue 13596
-LibTest/core/int/operator_left_shift_A01_t02: Pass, Fail # Please triage this failure.
-LibTest/core/int/toRadixString_A01_t01: Fail # co19 issue 492
-LibTest/html/CanvasRenderingContext2D/addEventListener_A01_t03: RuntimeError # co19-roll r722: Please triage this failure.
-LibTest/html/CanvasRenderingContext2D/addEventListener_A01_t06: RuntimeError # co19-roll r722: Please triage this failure.
-LibTest/html/Document/childNodes_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/Document/clone_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/Document/clone_A01_t02: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/Document/securityPolicy_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/Element/blur_A01_t01: Skip # co19-roll r706.  Please triage this failure.
-LibTest/html/Element/borderEdge_A01_t01: RuntimeError # co19-roll r706.  Issue 16574
-LibTest/html/Element/contentEdge_A01_t01: RuntimeError # co19-roll r706.  Issue 16574
-LibTest/html/Element/dataset_A02_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/Element/focus_A01_t01: Skip # co19-roll r706.  Please triage this failure.
-LibTest/html/Element/getAttributeNS_A01_t01: RuntimeError # co19-roll r706.  Issue 16395
-LibTest/html/Element/getAttributeNS_A01_t02: RuntimeError # Please triage this failure.
-LibTest/html/Element/getNamespacedAttributes_A01_t01: RuntimeError # co19-roll r706.  Issue 16395
-LibTest/html/Element/isContentEditable_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/Element/isContentEditable_A02_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/Element/marginEdge_A01_t01: RuntimeError # co19-roll r706.  Issue 16574
-LibTest/html/Element/paddingEdge_A01_t01: RuntimeError # co19-roll r706.  Issue 16574
-LibTest/html/Element/querySelectorAll_A01_t02: RuntimeError # co19-roll r761: Please triage this failure.
-LibTest/html/Element/replaceWith_A01_t02: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/HttpRequest/onError_A01_t02: Skip # co19-roll r706.  Please triage this failure.
-LibTest/html/HttpRequest/responseText_A01_t02: Skip # co19-roll r706.  Please triage this failure.
-LibTest/html/HttpRequest/responseType_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/HttpRequest/responseType_A01_t03: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/HttpRequest/statusText_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/HttpRequestUpload/onError_A01_t02: Skip # co19-roll r706.  Please triage this failure.
-LibTest/html/HttpRequestUpload/onLoadEnd_A01_t01: Skip # co19-roll r706.  Please triage this failure.
-LibTest/html/HttpRequestUpload/onLoadStart_A01_t01: Skip # co19-roll r706.  Please triage this failure.
-LibTest/html/HttpRequestUpload/onLoad_A01_t01: Skip # co19-roll r706.  Please triage this failure.
-LibTest/html/IFrameElement/IFrameElement.created_A01_t01: RuntimeError # Issue 24568
-LibTest/html/IFrameElement/appendHtml_A01_t01: Pass, RuntimeError # Issue 23462
-LibTest/html/IFrameElement/appendHtml_A01_t01: RuntimeError # Issue 23462
-LibTest/html/IFrameElement/appendHtml_A01_t02: Pass, RuntimeError # Issue 23462
-LibTest/html/IFrameElement/appendHtml_A01_t02: RuntimeError # Issue 23462
-LibTest/html/IFrameElement/attributeChanged_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/IFrameElement/attributes_setter_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/IFrameElement/blur_A01_t01: Skip # co19-roll r706.  Please triage this failure.
-LibTest/html/IFrameElement/borderEdge_A01_t01: RuntimeError # co19-roll r706.  Issue 16574
-LibTest/html/IFrameElement/clone_A01_t02: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/IFrameElement/contentWindow_A01_t01: RuntimeError # Also fails in dart2js as this test should not pass given current Dart semantics for cross frame windows.
-LibTest/html/IFrameElement/createFragment_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/IFrameElement/createFragment_A01_t02: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/IFrameElement/createFragment_A01_t03: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/IFrameElement/createShadowRoot_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/IFrameElement/enteredView_A01_t01: Skip # co19-roll r706.  Please triage this failure.
-LibTest/html/IFrameElement/focus_A01_t01: Skip # co19-roll r706.  Please triage this failure.
-LibTest/html/IFrameElement/getNamespacedAttributes_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/IFrameElement/innerHtml_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/IFrameElement/isContentEditable_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/IFrameElement/leftView_A01_t01: Skip # co19-roll r706.  Please triage this failure.
-LibTest/html/IFrameElement/marginEdge_A01_t01: RuntimeError # co19-roll r706.  Issue 16574
-LibTest/html/IFrameElement/offsetTo_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/IFrameElement/outerHtml_setter_A01_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LibTest/html/IFrameElement/paddingEdge_A01_t01: RuntimeError # co19-roll r722: Issue 16574
-LibTest/html/IFrameElement/querySelector_A01_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LibTest/html/IFrameElement/setInnerHtml_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/Node/addEventListener_A01_t06: RuntimeError # co19-roll r722: Please triage this failure.
-LibTest/html/Node/append_A01_t02: RuntimeError # co19-roll r722: Please triage this failure.
-LibTest/html/Node/nodes_A01_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LibTest/html/Node/nodes_A01_t02: RuntimeError # co19-roll r722: Please triage this failure.
-LibTest/html/Node/parent_A01_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LibTest/html/Node/previousNode_A01_t01: RuntimeError # co19-roll r722: Please triage this failure.
-LibTest/html/Window/document_A01_t01: Skip # accesses window.document from a cross-frame window
-LibTest/html/Window/find_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/Window/find_A03_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/Window/find_A06_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/Window/moveBy_A01_t01: RuntimeError # Also fails in dart2js as this test should not pass given current Dart semantics for cross frame windows.
-LibTest/html/Window/moveTo_A01_t01: RuntimeError, Pass # co19-roll r706.  Please triage this failure.
-LibTest/html/Window/moveTo_A02_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/Window/postMessage_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/Window/postMessage_A01_t02: RuntimeError # Also fails in dart2js.
-LibTest/html/Window/requestFileSystem_A01_t02: RuntimeError,Pass # co19-roll r722: Please triage this failure.
-LibTest/html/Window/requestFileSystem_A02_t01: Skip # Issue 24585.
-LibTest/html/Window/resizeBy_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/html/Window/resizeTo_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
-LibTest/isolate/Isolate/spawnUri_A01_t01: RuntimeError # Dart issue 15974
-LibTest/isolate/Isolate/spawnUri_A01_t02: Skip # Dart issue 15974
-LibTest/isolate/Isolate/spawnUri_A01_t03: Skip # Dart issue 15974
-LibTest/isolate/Isolate/spawnUri_A01_t04: RuntimeError # Dart issue 15974
-LibTest/isolate/Isolate/spawnUri_A01_t05: RuntimeError # Dart issue 15974
-LibTest/isolate/Isolate/spawnUri_A01_t06: RuntimeError # Issue 27219
-LibTest/isolate/Isolate/spawnUri_A01_t07: RuntimeError # Issue 27219
-LibTest/isolate/Isolate/spawnUri_A02_t02: Skip # Dart issue 15974
-LibTest/isolate/Isolate/spawnUri_A02_t03: Skip # Dart issue 15974
-LibTest/isolate/Isolate/spawnUri_A02_t04: Skip # Dart issue 15974
-LibTest/isolate/Isolate/spawn_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/Isolate/spawn_A01_t02: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/Isolate/spawn_A01_t03: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/Isolate/spawn_A01_t04: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/Isolate/spawn_A01_t05: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/Isolate/spawn_A01_t06: RuntimeError # Issue 27219
-LibTest/isolate/Isolate/spawn_A03_t01: RuntimeError # Issue 27219
-LibTest/isolate/Isolate/spawn_A03_t02: RuntimeError # Issue 27219
-LibTest/isolate/Isolate/spawn_A03_t03: RuntimeError # Issue 27219
-LibTest/isolate/Isolate/spawn_A03_t04: RuntimeError # Issue 27219
-LibTest/isolate/Isolate/spawn_A04_t01: RuntimeError # Issue 27219
-LibTest/isolate/Isolate/spawn_A04_t02: RuntimeError # Issue 27219
-LibTest/isolate/Isolate/spawn_A04_t03: RuntimeError # Issue 27219
-LibTest/isolate/Isolate/spawn_A04_t04: RuntimeError # Issue 27219
-LibTest/isolate/Isolate/spawn_A04_t05: RuntimeError # Issue 27219
-LibTest/isolate/Isolate/spawn_A05_t01: RuntimeError # Issue 27219
-LibTest/isolate/Isolate/spawn_A05_t02: RuntimeError # Issue 27219
-LibTest/isolate/Isolate/spawn_A05_t03: RuntimeError # Issue 27219
-LibTest/isolate/Isolate/spawn_A06_t01: RuntimeError # Issue 27219
-LibTest/isolate/Isolate/spawn_A06_t02: RuntimeError # Issue 27219
-LibTest/isolate/Isolate/spawn_A06_t03: RuntimeError # Issue 27219
-LibTest/isolate/Isolate/spawn_A06_t04: RuntimeError # Issue 27219
-LibTest/isolate/Isolate/spawn_A06_t05: RuntimeError # Issue 27219
-LibTest/isolate/Isolate/spawn_A06_t06: RuntimeError # Issue 27219
-LibTest/isolate/Isolate/spawn_A06_t07: RuntimeError # Issue 27219
-LibTest/isolate/RawReceivePort/RawReceivePort_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/RawReceivePort/RawReceivePort_A01_t02: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/RawReceivePort/close_A01_t01: Pass, RuntimeError # Issue 13921, co19 issue for false pass https://github.com/dart-lang/co19/issues/13
-LibTest/isolate/RawReceivePort/handler_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/RawReceivePort/sendPort_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/any_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/any_A01_t02: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/asBroadcastStream_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/asBroadcastStream_A01_t02: Pass, RuntimeError # Issue 13921, co19 issue for false pass https://github.com/dart-lang/co19/issues/13
-LibTest/isolate/ReceivePort/asBroadcastStream_A01_t03: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/asBroadcastStream_A01_t04: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/asBroadcastStream_A02_t01: RuntimeError # Issue 13921
-LibTest/isolate/ReceivePort/asBroadcastStream_A03_t01: Pass, RuntimeError # Issue 13921, co19 issue for false pass https://github.com/dart-lang/co19/issues/13
-LibTest/isolate/ReceivePort/asBroadcastStream_A03_t02: Pass, RuntimeError # Issue 13921, co19 issue for false pass https://github.com/dart-lang/co19/issues/13
-LibTest/isolate/ReceivePort/asBroadcastStream_A03_t03: Pass, RuntimeError # Issue 13921, co19 issue for false pass https://github.com/dart-lang/co19/issues/13
-LibTest/isolate/ReceivePort/asBroadcastStream_A04_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/asBroadcastStream_A04_t02: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/asBroadcastStream_A04_t03: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/close_A01_t01: Pass, RuntimeError # Issue 13921, co19 issue for false pass https://github.com/dart-lang/co19/issues/13
-LibTest/isolate/ReceivePort/close_A02_t01: Skip # Times out
-LibTest/isolate/ReceivePort/contains_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/distinct_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/distinct_A01_t02: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/drain_A02_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/drain_A02_t02: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/elementAt_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/elementAt_A03_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/every_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/expand_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/firstWhere_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/firstWhere_A02_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/firstWhere_A03_t02: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/first_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/first_A02_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/first_A02_t02: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/fold_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/fold_A01_t02: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/forEach_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/isEmpty_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/join_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/join_A01_t02: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/lastWhere_A02_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/lastWhere_A04_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/last_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/last_A02_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/length_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/listen_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/map_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/pipe_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/reduce_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/reduce_A01_t02: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/reduce_A01_t03: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/sendPort_A01_t01: RuntimeError # Issue 13921
-LibTest/isolate/ReceivePort/singleWhere_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/singleWhere_A02_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/single_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/single_A02_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/skipWhile_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/skip_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/takeWhile_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/take_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/take_A01_t02: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/take_A01_t03: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/toList_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/toSet_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/transform_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/transform_A01_t02: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/where_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/ReceivePort/where_A01_t02: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/SendPort/send_A01_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/SendPort/send_A01_t02: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/SendPort/send_A01_t03: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/SendPort/send_A01_t04: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/SendPort/send_A02_t01: RuntimeError, OK  # Uses Isolate.spawn.
-LibTest/isolate/SendPort/send_A02_t04: Fail # Issue 13921
-LibTest/isolate/SendPort/send_A02_t05: Fail # Issue 13921
-LibTest/isolate/SendPort/send_A02_t06: Fail # Issue 13921
-WebPlatformTest/DOMEvents/approved/EventObject.after.dispatchEvenr_t01: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/DOMEvents/approved/EventObject.multiple.dispatchEvent_t01: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/DOMEvents/approved/ProcessingInstruction.DOMCharacterDataModified_t01: Skip # Times out. co19-roll r738: Please triage this failure.
-WebPlatformTest/DOMEvents/approved/addEventListener.optional.useCapture_t01: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/Utils/test/asyncTestFail_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/Utils/test/asyncTestFail_t02: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/Utils/test/asyncTestTimeout_t01: Skip # co19-roll r722: Please triage this failure.
-WebPlatformTest/Utils/test/testFail_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/custom-elements/concepts/type_A03_t01: RuntimeError # Please triage this failure.
-WebPlatformTest/custom-elements/concepts/type_A05_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/custom-elements/concepts/type_A06_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/EventTarget/dispatchEvent_A02_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/EventTarget/dispatchEvent_A03_t01: Skip # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/Node-replaceChild_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/dom/events/event_constants/constants_A01_t01: Skip # co19-roll r706.  Please triage this failure.
-WebPlatformTest/dom/events/event_constructors/Event_A01_t01: Skip # co19-roll r706.  Please triage this failure.
-WebPlatformTest/dom/events/event_constructors/Event_A02_t01: Skip # co19-roll r706.  Please triage this failure.
-WebPlatformTest/dom/events/type_A01_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/nodes/DOMImplementation-createDocumentType_t01: RuntimeError, Pass # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/nodes/DOMImplementation-createDocument_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/nodes/DOMImplementation-createHTMLDocument_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/nodes/Document-adoptNode_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/nodes/Document-createElementNS_t01: RuntimeError, Pass # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/nodes/Document-createElement_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/nodes/Document-getElementsByTagName_t01: RuntimeError, Pass # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/nodes/Element-childElementCount-nochild_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/nodes/Element-childElementCount_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/nodes/Node-appendChild_t02: RuntimeError, Pass # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/nodes/Node-insertBefore_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/nodes/Node-isEqualNode_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/nodes/Node-nodeName_t01: RuntimeError # Please triage this failure.
-WebPlatformTest/dom/nodes/Node-replaceChild_t01: RuntimeError # co19-roll r722: Please triage this failure
-WebPlatformTest/dom/nodes/Node-textContent_t01: RuntimeError # Please triage this failure.
-WebPlatformTest/dom/nodes/attributes/setAttributeNS_A05_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/nodes/attributes/setAttributeNS_A06_t03: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/nodes/attributes/setAttributeNS_A07_t02: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/nodes/attributes/setAttributeNS_A07_t03: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/nodes/attributes/setAttributeNS_A08_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/nodes/attributes/setAttribute_A03_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/html-imports/link-import-null_t01: RuntimeError # co19 issue 11.
-WebPlatformTest/html-imports/link-import_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html-imports/link-import_t02: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html-imports/loading-import_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html-templates/innerhtml-on-templates/innerhtml_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/html-templates/parsing-html-templates/additions-to-the-in-head-insertion-mode/generating-of-implied-end-tags_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/html-templates/parsing-html-templates/creating-an-element-for-the-token/template-owner-document_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/html/browsers/browsing-the-web/read-media/pageload-image_t01: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/html/browsers/browsing-the-web/read-media/pageload-video_t01: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/html/browsers/browsing-the-web/read-text/load-text-plain_t01: Skip # accesses window.document from a cross-frame window
-WebPlatformTest/html/dom/documents/dom-tree-accessors/document.body-getter_t01: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/html/dom/documents/dom-tree-accessors/document.body-setter_t01: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/html/dom/documents/dom-tree-accessors/document.getElementsByName-case_t01: RuntimeError # co19 issue 11.
-WebPlatformTest/html/dom/documents/dom-tree-accessors/document.getElementsByName-namespace_t01: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/html/dom/documents/dom-tree-accessors/document.getElementsByName-newelements_t01: RuntimeError # co19 issue 11.
-WebPlatformTest/html/dom/documents/dom-tree-accessors/document.getElementsByName-param_t01: RuntimeError # co19 issue 11.
-WebPlatformTest/html/dom/documents/dom-tree-accessors/document.title_t01: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/html/dom/documents/dom-tree-accessors/document.title_t05: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/html/dom/documents/dom-tree-accessors/document.title_t07: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/html/dom/documents/dom-tree-accessors/nameditem_t02: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/html/dom/documents/dom-tree-accessors/nameditem_t03: RuntimeError # co19 issue 11.
-WebPlatformTest/html/dom/documents/dom-tree-accessors/nameditem_t05: RuntimeError # co19 issue 11.
-WebPlatformTest/html/dom/elements/global-attributes/dataset-delete_t01: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/html/dom/elements/global-attributes/dataset-get_t01: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/html/dom/elements/global-attributes/dataset-set_t01: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/html/semantics/disabled-elements/disabledElement_t01: RuntimeError # co19 issue 11.
-WebPlatformTest/html/semantics/document-metadata/styling/LinkStyle_t01: RuntimeError # co19 issue 11.
-WebPlatformTest/html/semantics/document-metadata/styling/LinkStyle_t01: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/html/semantics/embedded-content/media-elements/error-codes/error_t01: Skip # Times out and fails. # co19-roll r738: Please triage this failure.
-WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/addTextTrack_t01: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/src_t01: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues_t01: Skip # Times out and fails. # co19-roll r738: Please triage this failure.LayoutTests/fast/dom/Window/window-resize-contents_t01: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/TextTrack/mode_t01: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/html/semantics/forms/attributes-common-to-form-controls/formAction_document_address_t01: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/html/semantics/forms/attributes-common-to-form-controls/formaction_t01: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/html/semantics/forms/textfieldselection/selection_t01: RuntimeError # Dartium 45 roll
-WebPlatformTest/html/semantics/forms/textfieldselection/textfieldselection-setRangeText_t01: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange_t01: RuntimeError, Pass # co19-roll r738: Please triage this failure.  Pass on macos.
-WebPlatformTest/html/semantics/forms/the-button-element/button-validation_t01: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/html/semantics/forms/the-fieldset-element/disabled_t01: RuntimeError # co19-roll r738: Please triage this failure.
-WebPlatformTest/html/semantics/forms/the-form-element/form-autocomplete_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/forms/the-form-element/form-elements-matches_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/forms/the-form-element/form-elements-nameditem_t02: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/forms/the-form-element/form-nameditem_t01: RuntimeError # co19 issue 11.
-WebPlatformTest/html/semantics/forms/the-input-element/date_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/forms/the-input-element/datetime-local_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/forms/the-input-element/datetime_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/forms/the-input-element/datetime_t02: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/forms/the-input-element/email_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/forms/the-input-element/email_t02: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/forms/the-input-element/input-textselection_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/forms/the-input-element/month_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/forms/the-input-element/password_t01: RuntimeError # co19-roll r786: Please triage this failure.
-WebPlatformTest/html/semantics/forms/the-input-element/pattern_attribute_t01: RuntimeError # co19 issue 11.
-WebPlatformTest/html/semantics/forms/the-input-element/range_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/forms/the-input-element/time_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/forms/the-input-element/time_t02: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/forms/the-input-element/type-change-state_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/forms/the-input-element/url_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/forms/the-input-element/valueMode_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/forms/the-input-element/week_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/forms/the-meter-element/meter_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/forms/the-option-element/option-text-recurse_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/forms/the-option-element/option-text-spaces_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/grouping-content/the-blockquote-element/grouping-blockquote_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/grouping-content/the-ol-element/ol.start-reflection_t02: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/grouping-content/the-ol-element/ol.start-reflection_t02: Skip # co19 issue 11.
-WebPlatformTest/html/semantics/interactive-elements/the-dialog-element/dialog-close_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/interactive-elements/the-dialog-element/dialog-showModal_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/scripting-1/the-script-element/async_t11: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/scripting-1/the-script-element/async_t11: Skip # co19 issue 11.
-WebPlatformTest/html/semantics/scripting-1/the-script-element/script-text_t02: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/selectors/pseudo-classes/checked_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/selectors/pseudo-classes/default_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/selectors/pseudo-classes/dir_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/selectors/pseudo-classes/disabled_t01: Pass, RuntimeError # Spurious pass # co19 issue 11.
-WebPlatformTest/html/semantics/selectors/pseudo-classes/disabled_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/selectors/pseudo-classes/enabled_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/selectors/pseudo-classes/focus_t01: RuntimeError # co19 issue 11.
-WebPlatformTest/html/semantics/selectors/pseudo-classes/focus_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/selectors/pseudo-classes/indeterminate_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/selectors/pseudo-classes/inrange-outofrange_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/selectors/pseudo-classes/link_t01: RuntimeError # co19 issue 11.
-WebPlatformTest/html/semantics/selectors/pseudo-classes/link_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/selectors/pseudo-classes/valid-invalid_t01: RuntimeError # co19 issue 11.
-WebPlatformTest/html/semantics/selectors/pseudo-classes/valid-invalid_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/tabular-data/the-table-element/table-rows_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/tabular-data/the-tr-element/rowIndex_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/semantics/text-level-semantics/the-a-element/a.text-getter_t01: RuntimeError # co19 issue 11.
-WebPlatformTest/html/syntax/parsing/Document.getElementsByTagName-foreign_t01: RuntimeError # co19 issue 11.
-WebPlatformTest/html/syntax/parsing/Document.getElementsByTagName-foreign_t02: RuntimeError # co19-roll r786: Please triage this failure.
-WebPlatformTest/html/syntax/parsing/math-parse_t01: RuntimeError # co19 issue 11.
-WebPlatformTest/html/syntax/parsing/math-parse_t03: RuntimeError # co19 issue 11.
-WebPlatformTest/html/syntax/serializing-html-fragments/outerHTML_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t01: RuntimeError # Tests APIs that aren't yet visible. Tests should be deleted.
-WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t02: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t03: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t04: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t05: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t06: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-001_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-004_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-004_t02: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/methods/elements-001_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-005_t01: RuntimeError # Please triage this failure.
-WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-006_t01: RuntimeError # Please triage this failure.
-WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-002_t01: RuntimeError # 45 roll issue https://github.com/dart-lang/co19/issues/33
-WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-005_t01: RuntimeError #  45 Roll co19 test rewrite issue 25807
-WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-004_t01: RuntimeError # Please triage this failure.
-WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-004_t02: RuntimeError # Please triage this failure.
-WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-006_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-001_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-003_t01: RuntimeError # Please triage this failure.
-WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-003_t02: RuntimeError # Please triage this failure.
-WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-005_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/events/event-dispatch/test-001_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/events/event-dispatch/test-002_t01: RuntimeError # Please triage this failure.
-WebPlatformTest/shadow-dom/events/event-dispatch/test-003_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/events/event-retargeting/test-001_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/events/event-retargeting/test-002_t01: RuntimeError # Not clear that any of this works. Also suppressed in dart2js
-WebPlatformTest/shadow-dom/events/event-retargeting/test-004_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t01: Pass, RuntimeError # Flaky with Dartium JsInterop. Seems like timing issues in the test.
-WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t02: Skip # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t05: Skip # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t06: Skip # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-002_t01: Pass, Fail # https://github.com/dart-lang/co19/issues/12
-WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-003_t01: RuntimeError, Pass # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/events/retargeting-relatedtarget/test-003_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/html-elements-and-their-shadow-trees/test-001_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/html-elements-and-their-shadow-trees/test-002_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/html-elements-and-their-shadow-trees/test-003_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/shadow-trees/custom-pseudo-elements/test-001_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/shadow-trees/distributed-pseudo-element/test-001_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/shadow-trees/distributed-pseudo-element/test-002_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/shadow-trees/lower-boundary-encapsulation/test-004_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/ownerdocument-002_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/selectors-api-001_t01: RuntimeError # Please triage this failure.
-WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/test-009_t01: RuntimeError # Please triage this failure.
-WebPlatformTest/webstorage/event_constructor_t01: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/webstorage/event_constructor_t02: RuntimeError # co19-roll r761: Please triage this failure.
-WebPlatformTest/webstorage/storage_local_setitem_quotaexceedederr_t01: Skip # Times out flakily. co19-roll r761: Please triage this failure.
-WebPlatformTest/webstorage/storage_session_setitem_quotaexceedederr_t01: Skip # Times out flakily. co19-roll r761: Please triage this failure.
-WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/selectors-api-002_t01: RuntimeError # Please triage this failure.
-# Must fix failures below after JsInterop checkin.
-WebPlatformTest/dom/nodes/Node-appendChild_t01: RuntimeError # Issue 26134
-WebPlatformTest/dom/nodes/attributes/setAttribute_A01_t01: RuntimeError # Issue 26134
-LayoutTests/fast/dom/Document/createElement-invalid-names_t01: RuntimeError # Issue 26134
-LayoutTests/fast/dom/createDocumentType2_t01: RuntimeError # Issue 26134
-LayoutTests/fast/dom/createElementNS_t01: RuntimeError # Issue 26134
-LayoutTests/fast/dom/HTMLTemplateElement/cycles-in-shadow_t01: RuntimeError # Issue 26134
-LayoutTests/fast/dom/HTMLTemplateElement/cycles_t01: RuntimeError # Issue 26134
-LayoutTests/fast/dom/computed-style-set-property_t01: RuntimeError # Issue 26134
-LayoutTests/fast/dom/custom/document-register-type-extensions_t01: RuntimeError # Issue 26134
-LayoutTests/fast/dom/custom/document-register-namespace_t01: RuntimeError # Issue 26134
-LayoutTests/fast/dom/custom/element-type_t01: RuntimeError # Issue 26134
-LayoutTests/fast/dom/custom/element-upgrade_t01: RuntimeError # Issue 26134
-LayoutTests/fast/dom/DOMException/prototype-object_t01: RuntimeError # Issue 26134
-LayoutTests/fast/dom/shadow/shadow-hierarchy-exception_t01: RuntimeError # Issue 26134
-LayoutTests/fast/dom/Node/contains-method_t01: RuntimeError # Issue 26134
-LayoutTests/fast/events/mutation-during-append-child_t01: RuntimeError # Issue 26134
-LayoutTests/fast/events/mutation-during-insert-before_t01: RuntimeError # Issue 26134
-LayoutTests/fast/events/clipboard-dataTransferItemList-remove_t01: Skip # Issue 26134, timesout
-LibTest/html/Document/text_A01_t01: RuntimeError # Issue 26134
-LibTest/html/Document/insertBefore_A01_t01: RuntimeError # Issue 26134
-LibTest/html/Document/insertAllBefore_A01_t01: RuntimeError # Issue 26134
-LibTest/html/IFrameElement/insertBefore_A01_t01: RuntimeError # Issue 26134
-LibTest/html/IFrameElement/insertAllBefore_A01_t01: RuntimeError # Issue 26134
-LibTest/html/Element/text_A01_t01: RuntimeError # Issue 26134
-LibTest/html/Element/insertBefore_A01_t01: RuntimeError # Issue 26134
-LibTest/html/Element/insertAllBefore_A01_t01: RuntimeError # Issue 26134
-LibTest/html/CanvasRenderingContext2D/addEventListener_A01_t06: Skip # Issue 26134, timeout
-html/cross_domain_iframe_test: RuntimeError # Issue 26134
diff --git a/tests/co19/co19-kernel.status b/tests/co19/co19-kernel.status
new file mode 100644
index 0000000..6b4334a
--- /dev/null
+++ b/tests/co19/co19-kernel.status
@@ -0,0 +1,613 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+# Disable tests globally for kernel.
+[ $compiler == rasta || $compiler == rastap || $compiler == dartk || $compiler == dartkp ]
+Language/Libraries_and_Scripts/Imports/static_type_t01: Skip # No support for deferred libraries.
+Language/Metadata/*: Skip # No support for metadata ATM.
+LibTest/async/DeferredLibrary/DeferredLibrary_A01_t01: Skip # No support for deferred libraries.
+LibTest/isolate/*: Skip # No support for isolates ATM.
+
+# Override tests marked as failing elsewhere.
+[ $compiler == dartk || $compiler == dartkp ]
+Language/Libraries_and_Scripts/Exports/reexport_t01: Pass
+Language/Functions/Formal_Parameters/Optional_Formals/syntax_t14: Pass
+
+# dartk: JIT failures
+[ $compiler == dartk && $runtime == vm ]
+Language/Classes/Constructors/Generative_Constructors/execution_of_a_superinitializer_t01: RuntimeError
+Language/Classes/Constructors/Generative_Constructors/execution_of_an_initializer_t02: RuntimeError
+Language/Classes/Constructors/Generative_Constructors/formal_parameter_t01: Crash
+Language/Classes/Constructors/Generative_Constructors/formal_parameter_t03: Crash
+Language/Classes/Constructors/Generative_Constructors/formal_parameter_t04: Crash
+Language/Classes/Constructors/Generative_Constructors/formal_parameter_t05: Crash
+Language/Classes/Constructors/Generative_Constructors/formal_parameter_t06: Crash
+Language/Classes/Constructors/Generative_Constructors/initializing_formals_execution_t02: RuntimeError
+Language/Classes/Constructors/Generative_Constructors/initializing_this_t02: Crash
+Language/Classes/Getters/static_getter_t02: CompileTimeError
+Language/Classes/Setters/name_t08: CompileTimeError
+Language/Classes/Setters/name_t09: CompileTimeError
+Language/Classes/Setters/name_t10: CompileTimeError
+Language/Classes/Setters/name_t11: CompileTimeError
+Language/Classes/Setters/name_t12: CompileTimeError
+Language/Classes/Setters/name_t13: CompileTimeError
+Language/Classes/Setters/name_t14: CompileTimeError
+Language/Classes/Setters/name_t15: CompileTimeError
+Language/Classes/definition_t23: CompileTimeError
+Language/Enums/declaration_equivalent_t01: RuntimeError
+Language/Enums/syntax_t08: MissingCompileTimeError
+Language/Enums/syntax_t09: MissingCompileTimeError
+Language/Expressions/Constants/exception_t01: MissingCompileTimeError
+Language/Expressions/Constants/exception_t02: MissingCompileTimeError
+Language/Expressions/Constants/string_length_t01: Crash
+Language/Expressions/Function_Invocation/Function_Expression_Invocation/not_a_function_expression_t01: RuntimeError
+Language/Expressions/Function_Invocation/Unqualified_Invocation/function_expr_invocation_t03: RuntimeError
+Language/Expressions/Function_Invocation/Unqualified_Invocation/function_expr_invocation_t04: RuntimeError
+Language/Expressions/Function_Invocation/Unqualified_Invocation/instance_context_invocation_t03: MissingCompileTimeError
+Language/Expressions/Function_Invocation/Unqualified_Invocation/instance_context_invocation_t04: MissingCompileTimeError
+Language/Expressions/Function_Invocation/Unqualified_Invocation/static_method_invocation_t02: RuntimeError
+Language/Expressions/Function_Invocation/async_cleanup_t07: Fail
+Language/Expressions/Function_Invocation/async_cleanup_t08: Fail
+Language/Expressions/Function_Invocation/async_generator_invokation_t05: RuntimeError
+Language/Expressions/Function_Invocation/async_generator_invokation_t06: RuntimeError
+Language/Expressions/Function_Invocation/async_generator_invokation_t09: RuntimeError
+Language/Expressions/Identifier_Reference/built_in_identifier_t35: Pass
+Language/Expressions/Identifier_Reference/built_in_identifier_t36: Pass
+Language/Expressions/Identifier_Reference/built_in_identifier_t37: Pass
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t14: Pass
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t17: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t18: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t21: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t22: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t23: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t24: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t25: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t26: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t27: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t28: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t29: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t30: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t31: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t32: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/evaluation_property_extraction_t03: RuntimeError
+Language/Expressions/Identifier_Reference/evaluation_type_parameter_t01: RuntimeError
+Language/Expressions/Identifier_Reference/evaluation_type_parameter_t02: MissingCompileTimeError
+Language/Expressions/Instance_Creation/Const/canonicalized_t05: RuntimeError
+Language/Expressions/Instance_Creation/New/evaluation_t12: RuntimeError
+Language/Expressions/Instance_Creation/New/evaluation_t19: RuntimeError
+Language/Expressions/Instance_Creation/New/evaluation_t20: RuntimeError
+Language/Expressions/Lookup/Method_Lookup/superclass_t08: RuntimeError
+Language/Expressions/Method_Invocation/Ordinary_Invocation/accessible_instance_member_t05: RuntimeError
+Language/Expressions/Method_Invocation/Ordinary_Invocation/evaluation_t07: RuntimeError
+Language/Expressions/Method_Invocation/Ordinary_Invocation/method_lookup_failed_t18: RuntimeError
+Language/Expressions/Object_Identity/string_t01: RuntimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Closurization/identical_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Closurization/identical_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Closurization/identical_t03: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Closurization/named_parameters_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Closurization/positional_parameters_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/closurization_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/closurization_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/closurization_t03: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/deferred_type_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/malbounded_type_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/malbounded_type_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/malformed_type_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/malformed_type_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/no_such_method_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/no_such_method_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/not_class_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/not_class_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/not_class_t03: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/static_type_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/static_type_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/static_type_t03: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/class_object_member_t01: Pass
+Language/Expressions/Property_Extraction/General_Closurization/class_object_member_t02: Pass
+Language/Expressions/Property_Extraction/General_Closurization/class_object_member_t03: Pass
+Language/Expressions/Property_Extraction/General_Closurization/class_object_member_t04: Pass
+Language/Expressions/Property_Extraction/General_Closurization/class_object_member_t05: Pass
+Language/Expressions/Property_Extraction/General_Closurization/class_object_member_t06: Pass
+Language/Expressions/Property_Extraction/General_Closurization/expression_evaluation_t01: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/expression_evaluation_t02: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/expression_evaluation_t03: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/getter_lookup_t01: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/getter_lookup_t02: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/getter_lookup_t03: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/getter_lookup_t04: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/getter_lookup_t05: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/getter_lookup_t06: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/getter_lookup_t07: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/getter_lookup_t08: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/getter_lookup_t09: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/method_lookup_t01: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/method_lookup_t02: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/method_lookup_t03: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/method_lookup_t04: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/method_lookup_t05: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/method_lookup_t06: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/method_lookup_t07: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/no_accessible_member_t01: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/no_accessible_member_t02: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/no_accessible_member_t03: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/no_accessible_member_t04: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/no_accessible_member_t05: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/no_accessible_member_t06: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/no_accessible_member_t07: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/no_accessible_member_t08: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/setter_lookup_t01: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/setter_lookup_t02: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/setter_lookup_t03: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/setter_lookup_t04: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/setter_lookup_t05: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/setter_lookup_t06: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/setter_lookup_t07: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/setter_lookup_t08: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/setter_lookup_t09: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/static_type_t01: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/static_type_t02: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/static_type_t03: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/static_type_t04: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/static_type_t05: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/static_type_t06: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/static_type_t07: CompileTimeError
+Language/Expressions/Property_Extraction/Getter_Access_and_Method_Extraction/expression_evaluation_t07: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Closurization/identical_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Closurization/identical_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Closurization/named_parameters_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Closurization/positional_parameters_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/closurization_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/closurization_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/deferred_type_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/malbounded_type_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/malbounded_type_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/malformed_type_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/malformed_type_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/no_such_method_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/no_such_method_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/not_class_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/not_class_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/not_class_t03: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/static_type_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/static_type_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/static_type_t03: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/static_type_t04: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/getter_closurization_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/getter_closurization_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/getter_closurization_t03: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/getter_closurization_t04: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/getter_closurization_t05: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/getter_closurization_t06: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/getter_closurization_t07: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/getter_closurization_t08: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/method_closurization_named_params_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/method_closurization_named_params_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/method_closurization_positional_params_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/method_closurization_positional_params_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/method_identical_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/method_identical_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/method_identical_t03: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_list_access_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_list_assignment_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t03: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t04: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t05: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t06: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t07: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t08: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t09: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t10: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t11: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t12: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t13: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t14: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t15: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t16: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t17: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_unary_bitwise_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/setter_closurization_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/setter_closurization_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/setter_closurization_t03: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/setter_closurization_t04: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/setter_closurization_t05: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/setter_closurization_t06: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/setter_closurization_t07: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/setter_closurization_t08: CompileTimeError
+Language/Expressions/Strings/adjacent_strings_t02: RuntimeError
+Language/Expressions/Type_Test/evaluation_t10: RuntimeError
+Language/Functions/External_Functions/not_connected_to_a_body_t01: RuntimeError
+Language/Functions/Formal_Parameters/syntax_t05: RuntimeError
+Language/Interfaces/Superinterfaces/Inheritance_and_Overriding/same_name_method_and_getter_t01: CompileTimeError
+Language/Interfaces/Superinterfaces/Inheritance_and_Overriding/same_name_method_and_getter_t02: CompileTimeError
+Language/Libraries_and_Scripts/Exports/invalid_uri_t02: Pass
+Language/Libraries_and_Scripts/Exports/syntax_t01: MissingCompileTimeError
+Language/Libraries_and_Scripts/Exports/syntax_t04: MissingCompileTimeError
+Language/Libraries_and_Scripts/Exports/syntax_t05: MissingCompileTimeError
+Language/Libraries_and_Scripts/Exports/syntax_t06: MissingCompileTimeError
+Language/Libraries_and_Scripts/Imports/deferred_import_t01: RuntimeError
+Language/Libraries_and_Scripts/Imports/deferred_import_t02: RuntimeError
+Language/Libraries_and_Scripts/Imports/invalid_uri_deferred_t01/01: MissingRuntimeError
+Language/Libraries_and_Scripts/Imports/invalid_uri_deferred_t02: CompileTimeError
+Language/Libraries_and_Scripts/Imports/invalid_uri_t02: Pass
+Language/Libraries_and_Scripts/Imports/static_type_t01: RuntimeError
+Language/Libraries_and_Scripts/Parts/compilation_t02: Pass Crash
+Language/Libraries_and_Scripts/Parts/syntax_t06: Pass
+Language/Libraries_and_Scripts/Scripts/top_level_main_t01: Crash
+Language/Libraries_and_Scripts/Scripts/top_level_main_t02: Crash
+Language/Libraries_and_Scripts/definition_syntax_t01: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t03: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t04: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t06: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t07: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t08: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t09: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t10: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t15: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t17: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t18: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t19: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t20: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t21: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t22: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t23: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t24: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t25: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t26: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t27: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t29: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t02: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t03: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t04: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t05: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t06: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t07: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t08: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t09: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t10: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t11: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t12: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t13: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t14: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t15: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t16: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t17: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t18: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t19: MissingCompileTimeError
+Language/Mixins/Mixin_Application/error_t01: MissingCompileTimeError
+Language/Mixins/Mixin_Application/error_t02: MissingCompileTimeError
+Language/Mixins/Mixin_Application/syntax_t16: Crash
+Language/Statements/Break/label_t03: MissingCompileTimeError
+Language/Statements/Break/label_t04: MissingCompileTimeError
+Language/Statements/Continue/label_t07: MissingCompileTimeError
+Language/Statements/Labels/syntax_t03: Pass
+Language/Statements/Rethrow/execution_t04: RuntimeError
+Language/Statements/Switch/syntax_t02: Pass
+Language/Statements/Try/catch_scope_t01: RuntimeError
+Language/Statements/Yield_and_Yield_Each/Yield/execution_async_t04: Fail
+Language/Statements/Yield_and_Yield_Each/Yield/execution_async_t05: Fail
+Language/Statements/Yield_and_Yield_Each/Yield/execution_async_t06: Fail
+Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_t01: RuntimeError
+Language/Types/Interface_Types/subtype_t44: RuntimeError
+Language/Types/Static_Types/deferred_type_t01: RuntimeError
+Language/Variables/final_or_static_initialization_t01: MissingCompileTimeError
+Language/Variables/final_or_static_initialization_t02: MissingCompileTimeError
+Language/Variables/final_or_static_initialization_t03: MissingCompileTimeError
+Language/Variables/final_t01/01: MissingRuntimeError
+Language/Variables/final_t02/01: MissingRuntimeError
+Language/Variables/final_t04: MissingCompileTimeError
+Language/Variables/final_t05: MissingCompileTimeError
+Language/Variables/final_t06: MissingCompileTimeError
+Language/Variables/final_t07: MissingCompileTimeError
+
+# These tests should throw RuntimeError but they Pass instead.
+Language/Libraries_and_Scripts/Imports/static_type_t01/04: Pass
+Language/Libraries_and_Scripts/Imports/static_type_t01/06: Pass
+Language/Libraries_and_Scripts/Imports/static_type_t01/01: Pass
+Language/Libraries_and_Scripts/Imports/static_type_t01/05: Pass
+Language/Libraries_and_Scripts/Imports/static_type_t01/03: Pass
+Language/Libraries_and_Scripts/Imports/static_type_t01/07: Pass
+Language/Libraries_and_Scripts/Imports/static_type_t01/02: Pass
+Language/Libraries_and_Scripts/Imports/static_type_t01/04: Pass
+Language/Libraries_and_Scripts/Imports/static_type_t01/06: Pass
+Language/Libraries_and_Scripts/Imports/static_type_t01/01: Pass
+Language/Libraries_and_Scripts/Imports/static_type_t01/05: Pass
+Language/Libraries_and_Scripts/Imports/static_type_t01/03: Pass
+Language/Libraries_and_Scripts/Imports/static_type_t01/07: Pass
+Language/Libraries_and_Scripts/Imports/static_type_t01/02: Pass
+
+# dartk: JIT failures (debug)
+[ $compiler == dartk && $runtime == vm && $mode == debug ]
+Language/Expressions/Shift/syntax_t15: Crash  # Invalid class id during isolate shutdown Heap::VerifyGC
+Language/Expressions/Spawning_an_Isolate/new_isolate_t01: Crash  # Class finalization issue
+Language/Libraries_and_Scripts/Scripts/top_level_main_t05: Crash  # !main_obj.IsNull()
+LibTest/typed_data/ByteBuffer/runtimeType_A01_t02: Pass, Crash  # Out of memory
+LibTest/collection/DoubleLinkedQueue/every_A01_t02: Pass, Crash  # Out of memory
+
+# dartk: precompilation failures
+[ $compiler == dartkp && $runtime == dart_precompiled ]
+Language/Classes/Constructors/Generative_Constructors/execution_of_a_superinitializer_t01: RuntimeError
+Language/Classes/Constructors/Generative_Constructors/execution_of_an_initializer_t02: RuntimeError
+Language/Classes/Constructors/Generative_Constructors/formal_parameter_t01: Crash
+Language/Classes/Constructors/Generative_Constructors/formal_parameter_t03: Crash
+Language/Classes/Constructors/Generative_Constructors/formal_parameter_t04: Crash
+Language/Classes/Constructors/Generative_Constructors/formal_parameter_t05: Crash
+Language/Classes/Constructors/Generative_Constructors/formal_parameter_t06: Crash
+Language/Classes/Constructors/Generative_Constructors/initializing_formals_execution_t02: RuntimeError
+Language/Classes/Constructors/Generative_Constructors/initializing_this_t02: Crash
+Language/Classes/Getters/static_getter_t02: CompileTimeError
+Language/Classes/Setters/name_t08: CompileTimeError
+Language/Classes/Setters/name_t09: CompileTimeError
+Language/Classes/Setters/name_t10: CompileTimeError
+Language/Classes/Setters/name_t11: CompileTimeError
+Language/Classes/Setters/name_t12: CompileTimeError
+Language/Classes/Setters/name_t13: CompileTimeError
+Language/Classes/Setters/name_t14: CompileTimeError
+Language/Classes/Setters/name_t15: CompileTimeError
+Language/Classes/definition_t23: CompileTimeError
+Language/Enums/declaration_equivalent_t01: RuntimeError
+Language/Enums/syntax_t08: MissingCompileTimeError
+Language/Enums/syntax_t09: MissingCompileTimeError
+Language/Expressions/Constants/exception_t01: Crash
+Language/Expressions/Constants/exception_t02: Crash
+Language/Expressions/Constants/string_length_t01: Crash
+Language/Expressions/Function_Invocation/Function_Expression_Invocation/not_a_function_expression_t01: RuntimeError
+Language/Expressions/Function_Invocation/Unqualified_Invocation/function_expr_invocation_t03: RuntimeError
+Language/Expressions/Function_Invocation/Unqualified_Invocation/function_expr_invocation_t04: RuntimeError
+Language/Expressions/Function_Invocation/Unqualified_Invocation/instance_context_invocation_t03: MissingCompileTimeError
+Language/Expressions/Function_Invocation/Unqualified_Invocation/instance_context_invocation_t04: MissingCompileTimeError
+Language/Expressions/Function_Invocation/Unqualified_Invocation/static_method_invocation_t02: RuntimeError
+Language/Expressions/Function_Invocation/async_cleanup_t07: RuntimeError
+Language/Expressions/Function_Invocation/async_cleanup_t08: RuntimeError
+Language/Expressions/Function_Invocation/async_generator_invokation_t05: RuntimeError
+Language/Expressions/Function_Invocation/async_generator_invokation_t06: RuntimeError
+Language/Expressions/Function_Invocation/async_generator_invokation_t09: RuntimeError
+Language/Expressions/Identifier_Reference/built_in_identifier_t35: Pass
+Language/Expressions/Identifier_Reference/built_in_identifier_t36: Pass
+Language/Expressions/Identifier_Reference/built_in_identifier_t37: Pass
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t14: Pass
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t17: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t18: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t21: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t22: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t23: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t24: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t25: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t26: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t27: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t28: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t29: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t30: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t31: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/built_in_not_dynamic_t32: MissingCompileTimeError
+Language/Expressions/Identifier_Reference/evaluation_property_extraction_t03: RuntimeError
+Language/Expressions/Identifier_Reference/evaluation_type_parameter_t01: RuntimeError
+Language/Expressions/Instance_Creation/New/evaluation_t12: RuntimeError
+Language/Expressions/Instance_Creation/New/evaluation_t19: RuntimeError
+Language/Expressions/Instance_Creation/New/evaluation_t20: RuntimeError
+Language/Expressions/Lookup/Method_Lookup/superclass_t08: RuntimeError
+Language/Expressions/Method_Invocation/Ordinary_Invocation/accessible_instance_member_t05: RuntimeError
+Language/Expressions/Method_Invocation/Ordinary_Invocation/evaluation_t07: RuntimeError
+Language/Expressions/Method_Invocation/Ordinary_Invocation/method_lookup_failed_t18: RuntimeError
+Language/Expressions/Null/instance_of_class_null_t01: Crash
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Closurization/identical_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Closurization/identical_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Closurization/identical_t03: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Closurization/named_parameters_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Closurization/positional_parameters_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/closurization_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/closurization_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/closurization_t03: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/deferred_type_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/malbounded_type_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/malbounded_type_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/malformed_type_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/malformed_type_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/no_such_method_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/no_such_method_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/not_class_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/not_class_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/not_class_t03: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/static_type_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/static_type_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Anonymous_Constructor_Extraction/static_type_t03: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/class_object_member_t01: Pass
+Language/Expressions/Property_Extraction/General_Closurization/class_object_member_t02: Pass
+Language/Expressions/Property_Extraction/General_Closurization/class_object_member_t03: Pass
+Language/Expressions/Property_Extraction/General_Closurization/class_object_member_t04: Pass
+Language/Expressions/Property_Extraction/General_Closurization/class_object_member_t05: Pass
+Language/Expressions/Property_Extraction/General_Closurization/class_object_member_t06: Pass
+Language/Expressions/Property_Extraction/General_Closurization/expression_evaluation_t01: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/expression_evaluation_t02: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/expression_evaluation_t03: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/getter_lookup_t01: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/getter_lookup_t02: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/getter_lookup_t03: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/getter_lookup_t04: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/getter_lookup_t05: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/getter_lookup_t06: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/getter_lookup_t07: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/getter_lookup_t08: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/getter_lookup_t09: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/method_lookup_t01: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/method_lookup_t02: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/method_lookup_t03: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/method_lookup_t04: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/method_lookup_t05: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/method_lookup_t06: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/method_lookup_t07: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/no_accessible_member_t01: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/no_accessible_member_t02: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/no_accessible_member_t03: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/no_accessible_member_t04: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/no_accessible_member_t05: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/no_accessible_member_t06: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/no_accessible_member_t07: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/no_accessible_member_t08: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/setter_lookup_t01: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/setter_lookup_t02: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/setter_lookup_t03: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/setter_lookup_t04: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/setter_lookup_t05: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/setter_lookup_t06: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/setter_lookup_t07: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/setter_lookup_t08: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/setter_lookup_t09: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/static_type_t01: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/static_type_t02: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/static_type_t03: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/static_type_t04: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/static_type_t05: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/static_type_t06: CompileTimeError
+Language/Expressions/Property_Extraction/General_Closurization/static_type_t07: CompileTimeError
+Language/Expressions/Property_Extraction/Getter_Access_and_Method_Extraction/expression_evaluation_t07: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Closurization/identical_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Closurization/identical_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Closurization/named_parameters_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Closurization/positional_parameters_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/closurization_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/closurization_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/deferred_type_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/malbounded_type_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/malbounded_type_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/malformed_type_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/malformed_type_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/no_such_method_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/no_such_method_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/not_class_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/not_class_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/not_class_t03: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/static_type_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/static_type_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/static_type_t03: CompileTimeError
+Language/Expressions/Property_Extraction/Named_Constructor_Extraction/static_type_t04: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/getter_closurization_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/getter_closurization_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/getter_closurization_t03: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/getter_closurization_t04: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/getter_closurization_t05: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/getter_closurization_t06: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/getter_closurization_t07: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/getter_closurization_t08: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/method_closurization_named_params_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/method_closurization_named_params_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/method_closurization_positional_params_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/method_closurization_positional_params_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/method_identical_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/method_identical_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/method_identical_t03: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_list_access_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_list_assignment_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t03: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t04: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t05: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t06: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t07: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t08: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t09: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t10: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t11: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t12: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t13: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t14: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t15: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t16: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_t17: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/operator_closurization_unary_bitwise_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/setter_closurization_t01: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/setter_closurization_t02: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/setter_closurization_t03: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/setter_closurization_t04: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/setter_closurization_t05: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/setter_closurization_t06: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/setter_closurization_t07: CompileTimeError
+Language/Expressions/Property_Extraction/Ordinary_Member_Closurization/setter_closurization_t08: CompileTimeError
+Language/Expressions/Type_Test/evaluation_t10: RuntimeError
+Language/Functions/External_Functions/not_connected_to_a_body_t01: RuntimeError
+Language/Functions/Formal_Parameters/syntax_t05: RuntimeError
+Language/Interfaces/Superinterfaces/Inheritance_and_Overriding/same_name_method_and_getter_t01: CompileTimeError
+Language/Interfaces/Superinterfaces/Inheritance_and_Overriding/same_name_method_and_getter_t02: CompileTimeError
+Language/Libraries_and_Scripts/Exports/invalid_uri_t02: Pass
+Language/Libraries_and_Scripts/Exports/syntax_t01: MissingCompileTimeError
+Language/Libraries_and_Scripts/Exports/syntax_t04: MissingCompileTimeError
+Language/Libraries_and_Scripts/Exports/syntax_t05: MissingCompileTimeError
+Language/Libraries_and_Scripts/Exports/syntax_t06: MissingCompileTimeError
+Language/Libraries_and_Scripts/Imports/deferred_import_t01: RuntimeError
+Language/Libraries_and_Scripts/Imports/deferred_import_t02: RuntimeError
+Language/Libraries_and_Scripts/Imports/invalid_uri_deferred_t01/01: MissingRuntimeError
+Language/Libraries_and_Scripts/Imports/invalid_uri_deferred_t02: CompileTimeError
+Language/Libraries_and_Scripts/Imports/invalid_uri_t02: Pass
+Language/Libraries_and_Scripts/Parts/syntax_t06: Pass
+Language/Libraries_and_Scripts/Scripts/top_level_main_t01: Crash
+Language/Libraries_and_Scripts/Scripts/top_level_main_t02: Crash
+Language/Libraries_and_Scripts/definition_syntax_t01: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t03: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t04: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t06: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t07: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t08: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t09: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t10: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t15: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t17: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t18: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t19: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t20: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t21: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t22: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t23: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t24: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t25: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t26: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t27: MissingCompileTimeError
+Language/Libraries_and_Scripts/definition_syntax_t29: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t02: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t03: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t04: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t05: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t06: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t07: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t08: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t09: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t10: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t11: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t12: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t13: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t14: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t15: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t16: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t17: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t18: MissingCompileTimeError
+Language/Libraries_and_Scripts/top_level_syntax_t19: MissingCompileTimeError
+Language/Statements/Break/label_t03: MissingCompileTimeError
+Language/Statements/Break/label_t04: MissingCompileTimeError
+Language/Statements/Continue/label_t07: MissingCompileTimeError
+Language/Statements/Labels/syntax_t03: Pass
+Language/Statements/Rethrow/execution_t04: RuntimeError
+Language/Statements/Switch/syntax_t02: Pass
+Language/Statements/Try/catch_scope_t01: RuntimeError
+Language/Statements/Yield_and_Yield_Each/Yield/execution_async_t04: Fail
+Language/Statements/Yield_and_Yield_Each/Yield/execution_async_t05: Fail
+Language/Statements/Yield_and_Yield_Each/Yield/execution_async_t06: Fail
+Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_t01: RuntimeError
+Language/Types/Interface_Types/subtype_t44: RuntimeError
+Language/Types/Static_Types/deferred_type_t01: RuntimeError
+Language/Variables/final_or_static_initialization_t01: MissingCompileTimeError
+Language/Variables/final_or_static_initialization_t02: MissingCompileTimeError
+Language/Variables/final_or_static_initialization_t03: MissingCompileTimeError
+Language/Variables/final_t01/01: MissingRuntimeError
+Language/Variables/final_t02/01: MissingRuntimeError
+Language/Variables/final_t04: MissingCompileTimeError
+Language/Variables/final_t05: MissingCompileTimeError
+Language/Variables/final_t06: MissingCompileTimeError
+Language/Variables/final_t07: MissingCompileTimeError
+LibTest/core/StringBuffer/StringBuffer_A01_t02: RuntimeError
+LibTest/core/StringBuffer/write_A01_t02: RuntimeError
+
+# dartk: precompilation failures (debug)
+[ $compiler == dartkp && $runtime == dart_precompiled && $mode == debug ]
+Language/Libraries_and_Scripts/Scripts/top_level_main_t05: Crash  # !main_obj.IsNull()
diff --git a/tests/co19/co19-runtime.status b/tests/co19/co19-runtime.status
index e0845d9..a0e3bc4 100644
--- a/tests/co19/co19-runtime.status
+++ b/tests/co19/co19-runtime.status
@@ -26,20 +26,14 @@
 Language/Statements/Assert/type_t02: skip # co19 issue 734
 Language/Statements/Assert/type_t05: skip # co19 issue 734
 
-
-LibTest/core/DateTime/DateTime.now_A01_t02: Pass, Fail # co19 issue 709
-
-LibTest/isolate/Isolate/spawnUri_A01_t02: Skip # Issue 15974
-LibTest/isolate/Isolate/spawnUri_A01_t03: Skip # Issue 15974
 LibTest/isolate/Isolate/spawnUri_A02_t02: Skip # Issue 15974
 LibTest/isolate/Isolate/spawnUri_A02_t03: Skip # Issue 15974
-LibTest/isolate/Isolate/spawnUri_A02_t04: Skip # Issue 15974
 LibTest/isolate/Isolate/spawn_A03_t02: Skip # Issue 15974
 LibTest/isolate/Isolate/spawn_A04_t01: Skip # Issue 15974
 LibTest/isolate/Isolate/spawn_A04_t04: Skip # Issue 15974
 LibTest/isolate/Isolate/spawn_A06_t03: Skip # Issue 15974
 LibTest/isolate/Isolate/spawn_A06_t05: Skip # Issue 15974
-LibTest/isolate/Isolate/spawn_A04_t03: Pass, RuntimeError # Issue 27202
+LibTest/isolate/Isolate/spawn_A04_t03: Skip # Flaky, Issue 15974
 
 LibTest/core/Symbol/Symbol_A01_t03: RuntimeError # Issue 13596
 LibTest/core/Symbol/Symbol_A01_t05: RuntimeError # Issue 13596
@@ -54,16 +48,11 @@
 
 [ ($runtime == vm || $runtime == dart_precompiled || $runtime == dart_app) && $mode == debug ]
 LibTest/core/List/List_class_A01_t02: Pass, Slow
+
+[ ($runtime == dart_precompiled || $runtime == dart_app) && $mode == debug ]
 Language/Libraries_and_Scripts/Imports/deferred_import_t02: Crash # Issue 27201
 
-[ ($runtime == vm || $runtime == dart_precompiled || $runtime == dart_app) && $system == windows ]
-Language/Expressions/Function_Invocation/async_invokation_t04: Pass, RuntimeError # co19 issue 54
-
-[ ($runtime == vm || $runtime == dart_precompiled || $runtime == dart_app) && $checked == false ]
-LibTest/isolate/Isolate/spawn_A02_t04: RuntimeError # Issue 27185
-LibTest/isolate/Isolate/spawn_A02_t05: RuntimeError, Crash # Issue 27185
-
-[ ($runtime == vm || $runtime == dart_precompiled || $runtime == dart_app) && ($arch != x64 && $arch != simarm64 && $arch != arm64 && $arch != simdbc && $arch != simdbc64) ]
+[ ($runtime == vm || $runtime == dart_precompiled || $runtime == dart_app) && ($arch != x64 && $arch != simarm64 && $arch != arm64 && $arch != simdbc64 && $arch != simdbc) ]
 LibTest/core/int/operator_left_shift_A01_t02: Fail # co19 issue 129
 
 [ ($compiler == none || $compiler == precompiler) && ($runtime == vm || $runtime == dart_precompiled) && ($arch == mips || $arch == arm64) ]
@@ -82,8 +71,6 @@
 LibTest/collection/ListMixin/ListMixin_class_A01_t01: Skip  # Timeout
 LibTest/collection/ListMixin/ListMixin_class_A01_t02: Skip  # Timeout
 LibTest/core/Uri/Uri_A06_t03: Skip  # Timeout
-LibTest/isolate/Isolate/spawnUri_A01_t06: Pass, Fail # Issue 27378
-LibTest/isolate/Isolate/spawnUri_A01_t07: Pass, Fail # Issue 27378
 
 [ $system == windows ]
 LibTest/collection/ListMixin/ListMixin_class_A01_t02: Pass, Slow
@@ -168,14 +155,14 @@
 Language/Metadata/*: SkipByDesign # Uses dart:mirrors
 Language/Expressions/Null/instance_of_class_null_t01: Skip # Uses dart:mirrors
 
-[ $noopt || $compiler == precompiler || $compiler == dart2appjit || $mode == product ]
+[ $noopt || $compiler == precompiler || $compiler == dart2app || $compiler == dart2appjit || $mode == product ]
 Language/Libraries_and_Scripts/Imports/deferred_import_t01: Skip # Eager loading
 Language/Libraries_and_Scripts/Imports/deferred_import_t02: Skip # Eager loading
 Language/Libraries_and_Scripts/Imports/invalid_uri_deferred_t01: Skip # Eager loading
 Language/Libraries_and_Scripts/Imports/invalid_uri_deferred_t02: Skip # Eager loading
 
 [ $runtime == dart_precompiled || $runtime == dart_app ]
-LibTest/isolate/Isolate/spawnUri*: Skip # Isolate.spawnUri
+LibTest/isolate/Isolate/spawnUri*: SkipByDesign # Isolate.spawnUri
 
 [ $noopt || $compiler == precompiler ]
 LibTest/collection/ListBase/ListBase_class_A01_t02: Pass, Timeout
@@ -183,12 +170,11 @@
 LibTest/core/Map/Map_class_A01_t04: Pass, Timeout
 LibTest/core/Uri/encodeQueryComponent_A01_t02: Pass, Timeout
 
-[ $noopt || $compiler == precompiler || $compiler == dart2appjit ]
+[ $noopt || $compiler == precompiler || $compiler == dart2app || $compiler == dart2appjit ]
 Language/Mixins/Mixin_Application/error_t01: Pass
 Language/Mixins/Mixin_Application/error_t02: Pass
 Language/Mixins/declaring_constructor_t01: Pass
 
-
 [ ($arch == simdbc || $arch == simdbc64) && $mode == debug ]
 # TODO(vegorov) These tests are very slow on unoptimized SIMDBC
 LibTest/collection/ListMixin/ListMixin_class_A01_t02: Timeout
@@ -196,8 +182,6 @@
 
 [ $compiler == precompiler && $runtime == dart_precompiled && $system == android ]
 *: Skip # Issue 27294
-LibTest/isolate/*: Skip # Issue #26373
-Language/Expressions/Spawning_an_Isolate/new_isolate_t01: Skip # Issue #26373
 
 LibTest/math/log_A01_t01: RuntimeError # Precision of Math.log (Issue #18998)
 Language/Expressions/Object_Identity/double_t02: RuntimeError # Issue #26374
@@ -238,9 +222,12 @@
 LibTest/collection/ListBase/ListBase_class_A01_t02: Pass, Timeout
 LibTest/collection/ListMixin/ListMixin_class_A01_t01: Pass, Timeout
 LibTest/collection/ListMixin/ListMixin_class_A01_t02: Pass, Timeout
+LibTest/core/List/List_class_A01_t01: Pass, Timeout
 LibTest/core/List/List_class_A01_t02: Pass, Timeout
 LibTest/core/Map/Map_class_A01_t04: Pass, Timeout
 LibTest/core/Uri/Uri_A06_t03: Pass, Timeout
 LibTest/core/Uri/encodeQueryComponent_A01_t02: Pass, Timeout
 LibTest/isolate/Isolate/spawn_A01_t04: Pass, Timeout
-
+LibTest/isolate/Isolate/spawnUri_A01_t06: Pass, Fail # Timing dependent
+LibTest/isolate/Isolate/spawnUri_A01_t07: Pass, Fail # Timing dependent
+LibTest/isolate/ReceivePort/take_A01_t02: Skip # Issue 27773
diff --git a/tests/compiler/dart2js/analyze_test_test.dart b/tests/compiler/dart2js/analyze_test_test.dart
index caa69cd..9f917bb 100644
--- a/tests/compiler/dart2js/analyze_test_test.dart
+++ b/tests/compiler/dart2js/analyze_test_test.dart
@@ -27,9 +27,6 @@
     "Library 'package:async/async.dart' doesn't export a "
         "'ForkableStream' declaration.",
   ],
-  "/utils.dart": const [
-    "Duplicated library name 'utils'.",
-  ],
 };
 
 const List<String> SKIP_LIST = const <String>[
diff --git a/tests/compiler/dart2js/analyze_unused_dart2js_test.dart b/tests/compiler/dart2js/analyze_unused_dart2js_test.dart
index 6440587..ae753a2 100644
--- a/tests/compiler/dart2js/analyze_unused_dart2js_test.dart
+++ b/tests/compiler/dart2js/analyze_unused_dart2js_test.dart
@@ -39,7 +39,7 @@
   // Serialization code is only used in test.
   "lib/src/serialization/": const ["is never"],
 
-  "lib/src/universe/universe.dart": const [
+  "lib/src/universe/world_builder.dart": const [
     "The method 'getterInvocationsByName' is never called.",
     "The method 'setterInvocationsByName' is never called."
   ],
diff --git a/tests/compiler/dart2js/assert_message_throw_test.dart b/tests/compiler/dart2js/assert_message_throw_test.dart
new file mode 100644
index 0000000..75a5bb4
--- /dev/null
+++ b/tests/compiler/dart2js/assert_message_throw_test.dart
@@ -0,0 +1,76 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:async_helper/async_helper.dart';
+import 'package:compiler/src/commandline_options.dart';
+import 'package:compiler/src/compiler.dart';
+import 'package:compiler/src/elements/elements.dart';
+import 'package:compiler/src/types/masks.dart';
+import 'package:expect/expect.dart';
+import 'memory_compiler.dart';
+import 'type_mask_test_helper.dart';
+
+const String SOURCE = '''
+main(args) {
+  test0();
+  test1(args == null);
+  test2(args == null);
+  test3(args);
+}
+
+// Check that `throw` in the message does is handled conditionally.
+test0() {
+  assert(true, throw "unreachable");
+  var list = [];
+  return list;
+}
+
+// Check that side-effects of the assert message is not included after the
+// assert.
+test1(b) {
+  var a;
+  assert(b, a = 42);
+  return a;
+}
+
+// Check that side-effects of the assert message is included after the assert
+// through the thrown exception.
+test2(b) {
+  var a;
+  try {
+    assert(b, a = 42);
+  } catch (e) {}
+  return a;
+}
+
+// Check that type tests are preserved after the assert.
+test3(a) {
+  assert(a is int);
+  return a;
+}
+''';
+
+main() {
+  asyncTest(() async {
+    CompilationResult result = await runCompiler(
+        entryPoint: Uri.parse('memory:main.dart'),
+        memorySourceFiles: {'main.dart': SOURCE},
+        options: [Flags.enableCheckedMode, Flags.enableAssertMessage]);
+    Compiler compiler = result.compiler;
+
+    void check(String methodName, TypeMask expectedReturnType) {
+      Element element = compiler.mainApp.find(methodName);
+      TypeMask typeMask = simplify(
+          compiler.globalInference.results.resultOf(element).returnType,
+          compiler);
+      Expect.equals(expectedReturnType, typeMask,
+          "Unexpected return type on method '$methodName'.");
+    }
+
+    check('test0', compiler.closedWorld.commonMasks.growableListType);
+    check('test1', compiler.closedWorld.commonMasks.nullType);
+    check('test2', compiler.closedWorld.commonMasks.uint31Type.nullable());
+    check('test3', compiler.closedWorld.commonMasks.intType);
+  });
+}
diff --git a/tests/compiler/dart2js/call_site_simple_type_inferer_test.dart b/tests/compiler/dart2js/call_site_simple_type_inferer_test.dart
index 8a6e86b..f12fe38 100644
--- a/tests/compiler/dart2js/call_site_simple_type_inferer_test.dart
+++ b/tests/compiler/dart2js/call_site_simple_type_inferer_test.dart
@@ -211,7 +211,7 @@
     var expectedTypes = f(compiler);
     var signature = element.functionSignature;
     int index = 0;
-    var inferrer = compiler.globalInference.typesInferrer;
+    var inferrer = compiler.globalInference.typesInferrerInternal;
     signature.forEachParameter((Element element) {
       Expect.equals(expectedTypes[index++],
           simplify(inferrer.getTypeOfElement(element), compiler), test);
@@ -230,31 +230,37 @@
 }
 
 void test() {
-  runTest(TEST_1, (compiler) => [compiler.commonMasks.stringType]);
-  runTest(TEST_2, (compiler) => [compiler.commonMasks.uint31Type]);
-  runTest(TEST_3, (compiler) => [compiler.commonMasks.intType]);
-  runTest(TEST_4, (compiler) => [compiler.commonMasks.numType]);
-  runTest(TEST_5, (compiler) => [compiler.commonMasks.numType]);
-  runTest(TEST_6, (compiler) => [compiler.commonMasks.numType]);
+  runTest(TEST_1, (compiler) => [compiler.closedWorld.commonMasks.stringType]);
+  runTest(TEST_2, (compiler) => [compiler.closedWorld.commonMasks.uint31Type]);
+  runTest(TEST_3, (compiler) => [compiler.closedWorld.commonMasks.intType]);
+  runTest(TEST_4, (compiler) => [compiler.closedWorld.commonMasks.numType]);
+  runTest(TEST_5, (compiler) => [compiler.closedWorld.commonMasks.numType]);
+  runTest(TEST_6, (compiler) => [compiler.closedWorld.commonMasks.numType]);
   runTest(TEST_7a, (compiler) => [subclassOfInterceptor(compiler)]);
   runTest(
-      TEST_7b, (compiler) => [compiler.commonMasks.dynamicType.nonNullable()]);
+      TEST_7b,
+      (compiler) =>
+          [compiler.closedWorld.commonMasks.dynamicType.nonNullable()]);
 
   runTest(
       TEST_8,
       (compiler) => [
-            compiler.commonMasks.uint31Type,
+            compiler.closedWorld.commonMasks.uint31Type,
             subclassOfInterceptor(compiler),
-            compiler.commonMasks.dynamicType.nonNullable()
+            compiler.closedWorld.commonMasks.dynamicType.nonNullable()
           ]);
   runTest(
       TEST_9,
-      (compiler) =>
-          [compiler.commonMasks.uint31Type, compiler.commonMasks.uint31Type]);
+      (compiler) => [
+            compiler.closedWorld.commonMasks.uint31Type,
+            compiler.closedWorld.commonMasks.uint31Type
+          ]);
   runTest(
       TEST_10,
-      (compiler) =>
-          [compiler.commonMasks.uint31Type, compiler.commonMasks.uint31Type]);
+      (compiler) => [
+            compiler.closedWorld.commonMasks.uint31Type,
+            compiler.closedWorld.commonMasks.uint31Type
+          ]);
   runTest(
       TEST_11,
       (compiler) =>
@@ -262,35 +268,41 @@
 
   runTest(
       TEST_12,
-      (compiler) =>
-          [compiler.commonMasks.stringType, compiler.commonMasks.uint31Type]);
+      (compiler) => [
+            compiler.closedWorld.commonMasks.stringType,
+            compiler.closedWorld.commonMasks.uint31Type
+          ]);
 
-  runTest(TEST_13, (compiler) => [compiler.commonMasks.numType]);
+  runTest(TEST_13, (compiler) => [compiler.closedWorld.commonMasks.numType]);
 
   runTest(
       TEST_14,
-      (compiler) =>
-          [compiler.commonMasks.uint31Type, compiler.commonMasks.stringType]);
+      (compiler) => [
+            compiler.closedWorld.commonMasks.uint31Type,
+            compiler.closedWorld.commonMasks.stringType
+          ]);
 
   runTest(
       TEST_15,
-      (compiler) =>
-          [compiler.commonMasks.stringType, compiler.commonMasks.boolType]);
+      (compiler) => [
+            compiler.closedWorld.commonMasks.stringType,
+            compiler.closedWorld.commonMasks.boolType
+          ]);
 
   runTest(
       TEST_16,
       (compiler) => [
-            compiler.commonMasks.uint31Type,
-            compiler.commonMasks.uint31Type,
-            compiler.commonMasks.stringType
+            compiler.closedWorld.commonMasks.uint31Type,
+            compiler.closedWorld.commonMasks.uint31Type,
+            compiler.closedWorld.commonMasks.stringType
           ]);
 
   runTest(
       TEST_17,
       (compiler) => [
-            compiler.commonMasks.uint31Type,
-            compiler.commonMasks.boolType,
-            compiler.commonMasks.doubleType
+            compiler.closedWorld.commonMasks.uint31Type,
+            compiler.closedWorld.commonMasks.boolType,
+            compiler.closedWorld.commonMasks.doubleType
           ]);
 
   runTest(
diff --git a/tests/compiler/dart2js/class_set_test.dart b/tests/compiler/dart2js/class_set_test.dart
index 64442b1..9eea4f1 100644
--- a/tests/compiler/dart2js/class_set_test.dart
+++ b/tests/compiler/dart2js/class_set_test.dart
@@ -529,7 +529,7 @@
   checkForEach(X, [X, A, B, D, C, G, F, I, H, E],
       skipSubclasses: [D], forEachSubtype: true);
   checkForEach(X, [A, D, C, G, F, I, H, E],
-      forEachSubtype: true, mask: ClassHierarchyNode.DIRECTLY_INSTANTIATED);
+      forEachSubtype: true, mask: ClassHierarchyNode.EXPLICITLY_INSTANTIATED);
   checkForEach(X, [A, B, D, C, G, F, I, H, E],
       forEachSubtype: true, mask: ClassHierarchyNode.INSTANTIATED);
 
diff --git a/tests/compiler/dart2js/closure_tracer_test.dart b/tests/compiler/dart2js/closure_tracer_test.dart
index 110ccd4..f76bea1 100644
--- a/tests/compiler/dart2js/closure_tracer_test.dart
+++ b/tests/compiler/dart2js/closure_tracer_test.dart
@@ -154,8 +154,8 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST, uri);
   asyncTest(() => compiler.run(uri).then((_) {
-        var commonMasks = compiler.commonMasks;
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var commonMasks = compiler.closedWorld.commonMasks;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
         checkType(String name, type) {
           var element = findElement(compiler, name);
diff --git a/tests/compiler/dart2js/compiler_helper.dart b/tests/compiler/dart2js/compiler_helper.dart
index c9bd508..ff3dffa 100644
--- a/tests/compiler/dart2js/compiler_helper.dart
+++ b/tests/compiler/dart2js/compiler_helper.dart
@@ -72,16 +72,17 @@
     lego.Element element = compiler.mainApp.find(entry);
     if (element == null) return null;
     compiler.phase = Compiler.PHASE_RESOLVING;
-    compiler.backend.enqueueHelpers(
-        compiler.enqueuer.resolution, compiler.globalDependencies);
+    compiler.enqueuer.resolution
+        .applyImpact(compiler.backend.computeHelpersImpact());
     compiler.processQueue(compiler.enqueuer.resolution, element);
-    compiler.openWorld.closeWorld();
+    compiler.openWorld.closeWorld(compiler.reporter);
     compiler.backend.onResolutionComplete();
-    ResolutionWorkItem resolutionWork = new ResolutionWorkItem(element);
-    resolutionWork.run(compiler, compiler.enqueuer.resolution);
-    CodegenWorkItem work = new CodegenWorkItem(compiler, element);
+    ResolutionWorkItem resolutionWork =
+        new ResolutionWorkItem(compiler.resolution, element);
+    resolutionWork.run();
+    CodegenWorkItem work = new CodegenWorkItem(compiler.backend, element);
     compiler.phase = Compiler.PHASE_COMPILING;
-    work.run(compiler, compiler.enqueuer.codegen);
+    work.run();
     js.JavaScriptBackend backend = compiler.backend;
     String generated = backend.getGeneratedCode(element);
     if (check != null) {
diff --git a/tests/compiler/dart2js/concrete_type_inference_test.dart b/tests/compiler/dart2js/concrete_type_inference_test.dart
index e3833ad..ce5b556 100644
--- a/tests/compiler/dart2js/concrete_type_inference_test.dart
+++ b/tests/compiler/dart2js/concrete_type_inference_test.dart
@@ -20,47 +20,44 @@
   asyncTest(() => compileAndFind('main() { print($expression); }', 'print',
           (compiler, printElement) {
         var parameter = printElement.functionSignature.requiredParameters.first;
-        var type = compiler.globalInference.results.typeOf(parameter);
-        checkType(compiler, type);
+        checkType(compiler, _typeOf(compiler, parameter));
       }));
 
   asyncTest(() =>
       compileAndFind('main() { var x = print; print($expression); }', 'print',
           (compiler, printElement) {
         var parameter = printElement.functionSignature.requiredParameters.first;
-        var type = compiler.globalInference.results.typeOf(parameter);
-        checkType(compiler, type);
+        checkType(compiler, _typeOf(compiler, parameter));
       }));
 
   asyncTest(() => compileAndFind(
           'main() { print($expression); print($expression); }', 'print',
           (compiler, printElement) {
         var parameter = printElement.functionSignature.requiredParameters.first;
-        var type = compiler.globalInference.results.typeOf(parameter);
-        checkType(compiler, type);
+        checkType(compiler, _typeOf(compiler, parameter));
       }));
 }
 
 void testBasicTypes() {
   checkPrintType('true', (compiler, type) {
     if (type.isForwarding) type = type.forwardTo;
-    Expect.identical(compiler.commonMasks.boolType, type);
+    Expect.identical(compiler.closedWorld.commonMasks.boolType, type);
   });
   checkPrintType('1.5', (compiler, type) {
-    Expect.identical(compiler.commonMasks.doubleType, type);
+    Expect.identical(compiler.closedWorld.commonMasks.doubleType, type);
   });
   checkPrintType('1', (compiler, type) {
-    Expect.identical(compiler.commonMasks.uint31Type, type);
+    Expect.identical(compiler.closedWorld.commonMasks.uint31Type, type);
   });
   checkPrintType('[]', (compiler, type) {
     if (type.isForwarding) type = type.forwardTo;
-    Expect.identical(compiler.commonMasks.growableListType, type);
+    Expect.identical(compiler.closedWorld.commonMasks.growableListType, type);
   });
   checkPrintType('null', (compiler, type) {
-    Expect.identical(compiler.commonMasks.nullType, type);
+    Expect.identical(compiler.closedWorld.commonMasks.nullType, type);
   });
   checkPrintType('"foo"', (compiler, type) {
-    Expect.isTrue(compiler.commonMasks.stringType
+    Expect.isTrue(compiler.closedWorld.commonMasks.stringType
         .containsOnlyString(compiler.closedWorld));
   });
 }
@@ -71,14 +68,10 @@
     var firstParameter = fiskElement.functionSignature.requiredParameters[0];
     var secondParameter = fiskElement.functionSignature.optionalParameters[0];
     var thirdParameter = fiskElement.functionSignature.optionalParameters[1];
-    var commonMasks = compiler.commonMasks;
-    var inference = compiler.globalInference;
-    Expect.identical(
-        commonMasks.uint31Type, inference.results.typeOf(firstParameter));
-    Expect.identical(
-        commonMasks.nullType, inference.results.typeOf(secondParameter));
-    Expect.identical(
-        commonMasks.nullType, inference.results.typeOf(thirdParameter));
+    var commonMasks = compiler.closedWorld.commonMasks;
+    Expect.identical(commonMasks.uint31Type, _typeOf(compiler, firstParameter));
+    Expect.identical(commonMasks.nullType, _typeOf(compiler, secondParameter));
+    Expect.identical(commonMasks.nullType, _typeOf(compiler, thirdParameter));
   });
 }
 
@@ -86,3 +79,6 @@
   testBasicTypes();
   testOptionalParameters();
 }
+
+_typeOf(compiler, parameter) =>
+    compiler.globalInference.results.resultOf(parameter).type;
diff --git a/tests/compiler/dart2js/constant_expression_test.dart b/tests/compiler/dart2js/constant_expression_test.dart
index 7013167..d0cefd8 100644
--- a/tests/compiler/dart2js/constant_expression_test.dart
+++ b/tests/compiler/dart2js/constant_expression_test.dart
@@ -147,8 +147,6 @@
 }
 class B<S> implements C {
   const factory B({field1}) = A<B<S>>;
-  // TODO(johnniwinther): Enable this when the constructor evaluator doesn't 
-  // crash:
   const factory B.named() = A<S>;
 }
 class C<U> {
diff --git a/tests/compiler/dart2js/container_mask_equal_test.dart b/tests/compiler/dart2js/container_mask_equal_test.dart
index 21836b7..9f67840 100644
--- a/tests/compiler/dart2js/container_mask_equal_test.dart
+++ b/tests/compiler/dart2js/container_mask_equal_test.dart
@@ -30,7 +30,7 @@
   asyncTest(() async {
     var result = await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES);
     var compiler = result.compiler;
-    var typesInferrer = compiler.globalInference.typesInferrer;
+    var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
     var element = compiler.mainApp.find('a');
     var mask1 = typesInferrer.getReturnTypeOfElement(element);
diff --git a/tests/compiler/dart2js/dart2js.status b/tests/compiler/dart2js/dart2js.status
index 9b3a477..22d2c68 100644
--- a/tests/compiler/dart2js/dart2js.status
+++ b/tests/compiler/dart2js/dart2js.status
@@ -68,6 +68,7 @@
 uri_retention_test: Pass, Slow
 value_range_test: Pass, Slow
 jsinterop/world_test: Pass, Slow
+sourcemaps/stacktrace_test: Pass, Slow
 
 [ $mode == debug ]
 check_elements_invariants_test: Skip # Slow and only needs to be run in one
diff --git a/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart b/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
index 5e67cc3..0563a63 100644
--- a/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
+++ b/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
@@ -24,7 +24,6 @@
 
     var main = compiler.mainFunction;
     Expect.isNotNull(main, "Could not find 'main'");
-    compiler.deferredLoadTask.onResolutionComplete(main);
 
     var outputUnitForElement = compiler.deferredLoadTask.outputUnitForElement;
 
diff --git a/tests/compiler/dart2js/dictionary_types_test.dart b/tests/compiler/dart2js/dictionary_types_test.dart
index 0a169d6..15a4e57 100644
--- a/tests/compiler/dart2js/dictionary_types_test.dart
+++ b/tests/compiler/dart2js/dictionary_types_test.dart
@@ -141,8 +141,8 @@
         compiler.stopAfterTypeInference = !createCode;
       });
   var compiler = result.compiler;
-  var commonMasks = compiler.commonMasks;
-  var typesInferrer = compiler.globalInference.typesInferrer;
+  var commonMasks = compiler.closedWorld.commonMasks;
+  var typesInferrer = compiler.globalInference.typesInferrerInternal;
   getType(String name) {
     var element = findElement(compiler, name);
     return typesInferrer.getTypeOfElement(element);
diff --git a/tests/compiler/dart2js/embedded_category_api_boundary_test.dart b/tests/compiler/dart2js/embedded_category_api_boundary_test.dart
index 042bc37..c6e391d 100644
--- a/tests/compiler/dart2js/embedded_category_api_boundary_test.dart
+++ b/tests/compiler/dart2js/embedded_category_api_boundary_test.dart
@@ -23,7 +23,8 @@
     }
   });
   asyncTest(() async {
-    analyze(uriList, {}, checkResults: checkResults, mode: AnalysisMode.MAIN);
+    await analyze(uriList, {},
+        checkResults: checkResults, mode: AnalysisMode.MAIN);
   });
 }
 
@@ -42,6 +43,10 @@
     LibraryInfo info = libraries[element.library.canonicalUri.path];
     bool isAllowedInEmbedded =
         info.isInternal || info.categories.contains(Category.embedded);
+    if (!isAllowedInEmbedded) {
+      print(
+          'Disallowed element: $element from ${element.library.canonicalUri}');
+    }
     return isAllowedInEmbedded;
   });
 }
diff --git a/tests/compiler/dart2js/exit_code_test.dart b/tests/compiler/dart2js/exit_code_test.dart
index 1ca76fc..8478d42 100644
--- a/tests/compiler/dart2js/exit_code_test.dart
+++ b/tests/compiler/dart2js/exit_code_test.dart
@@ -11,7 +11,9 @@
 import 'package:expect/expect.dart';
 
 import 'package:compiler/compiler_new.dart' as api;
+import 'package:compiler/src/common/backend_api.dart';
 import 'package:compiler/src/common/codegen.dart';
+import 'package:compiler/src/common/resolution.dart';
 import 'package:compiler/src/compile_time_constants.dart';
 import 'package:compiler/src/compiler.dart';
 import 'package:compiler/src/dart2js.dart' as entry;
@@ -20,8 +22,8 @@
 import 'package:compiler/src/diagnostics/messages.dart';
 import 'package:compiler/src/diagnostics/spannable.dart';
 import 'package:compiler/src/apiimpl.dart' as apiimpl;
-import 'package:compiler/src/enqueue.dart';
 import 'package:compiler/src/elements/elements.dart';
+import 'package:compiler/src/js_backend/js_backend.dart';
 import 'package:compiler/src/library_loader.dart';
 import 'package:compiler/src/null_compiler_output.dart';
 import 'package:compiler/src/options.dart' show CompilerOptions;
@@ -52,9 +54,17 @@
   }
 
   @override
+  Backend createBackend() {
+    return new TestBackend(this);
+  }
+
+  @override
   ScannerTask createScannerTask() => new TestScanner(this);
 
   @override
+  Resolution createResolution() => new TestResolution(this);
+
+  @override
   ResolverTask createResolverTask() {
     return new TestResolver(this, backend.constantCompilerTask);
   }
@@ -74,16 +84,6 @@
     return super.onLibrariesLoaded(loadedLibraries);
   }
 
-  WorldImpact analyzeElement(Element element) {
-    test('Compiler.analyzeElement');
-    return super.analyzeElement(element);
-  }
-
-  WorldImpact codegen(CodegenWorkItem work, Enqueuer world) {
-    test('Compiler.codegen');
-    return super.codegen(work, world);
-  }
-
   test(String marker) {
     if (marker == testMarker) {
       switch (testType) {
@@ -121,6 +121,23 @@
   }
 }
 
+class TestBackend extends JavaScriptBackend {
+  final TestCompiler compiler;
+  TestBackend(TestCompiler compiler)
+      : this.compiler = compiler,
+        super(compiler,
+            generateSourceMap: compiler.options.generateSourceMap,
+            useStartupEmitter: compiler.options.useStartupEmitter,
+            useNewSourceInfo: compiler.options.useNewSourceInfo,
+            useKernel: compiler.options.useKernel);
+
+  @override
+  WorldImpact codegen(CodegenWorkItem work) {
+    compiler.test('Compiler.codegen');
+    return super.codegen(work);
+  }
+}
+
 class TestDiagnosticReporter extends DiagnosticReporterWrapper {
   TestCompiler compiler;
   DiagnosticReporter reporter;
@@ -161,6 +178,20 @@
   }
 }
 
+class TestResolution extends CompilerResolution {
+  TestCompiler compiler;
+
+  TestResolution(TestCompiler compiler)
+      : this.compiler = compiler,
+        super(compiler);
+
+  @override
+  WorldImpact computeWorldImpact(Element element) {
+    compiler.test('Compiler.analyzeElement');
+    return super.computeWorldImpact(element);
+  }
+}
+
 int checkedResults = 0;
 
 Future testExitCode(
diff --git a/tests/compiler/dart2js/expect_annotations_test.dart b/tests/compiler/dart2js/expect_annotations_test.dart
index 10ee78c..c9c47e0 100644
--- a/tests/compiler/dart2js/expect_annotations_test.dart
+++ b/tests/compiler/dart2js/expect_annotations_test.dart
@@ -92,17 +92,18 @@
           expectAssumeDynamic,
           backend.annotations.assumeDynamic(method),
           "Unexpected annotation of @AssumeDynamic on '$method'.");
-      TypesInferrer inferrer = compiler.globalInference.typesInferrer;
+      TypesInferrer inferrer = compiler.globalInference.typesInferrerInternal;
       if (expectTrustTypeAnnotations && expectedParameterType != null) {
         testTypeMatch(
             method, expectedParameterType, expectedReturnType, inferrer);
       } else if (expectAssumeDynamic) {
-        testTypeMatch(method, compiler.commonMasks.dynamicType, null, inferrer);
+        testTypeMatch(method, compiler.closedWorld.commonMasks.dynamicType,
+            null, inferrer);
       }
     }
 
-    TypeMask jsStringType = compiler.commonMasks.stringType;
-    TypeMask jsIntType = compiler.commonMasks.intType;
+    TypeMask jsStringType = compiler.closedWorld.commonMasks.stringType;
+    TypeMask jsIntType = compiler.closedWorld.commonMasks.intType;
     TypeMask coreStringType = new TypeMask.subtype(
         compiler.coreClasses.stringClass, compiler.closedWorld);
 
diff --git a/tests/compiler/dart2js/field_type_simple_inferer_test.dart b/tests/compiler/dart2js/field_type_simple_inferer_test.dart
index 03d7de3..0e930a0 100644
--- a/tests/compiler/dart2js/field_type_simple_inferer_test.dart
+++ b/tests/compiler/dart2js/field_type_simple_inferer_test.dart
@@ -5,6 +5,8 @@
 import 'package:expect/expect.dart';
 import 'package:async_helper/async_helper.dart';
 import 'package:compiler/src/types/types.dart' show TypeMask;
+import 'package:compiler/src/types/masks.dart' show CommonMasks;
+import 'package:compiler/src/compiler.dart' show Compiler;
 
 import 'compiler_helper.dart';
 import 'type_mask_test_helper.dart';
@@ -469,11 +471,14 @@
   }
 """;
 
-void doTest(String test, bool disableInlining, Map<String, Function> fields) {
-  fields.forEach((String name, Function f) {
+typedef TypeMask TestCallback(Compiler compiler, CommonMasks masks);
+
+void doTest(
+    String test, bool disableInlining, Map<String, TestCallback> fields) {
+  fields.forEach((String name, TestCallback f) {
     compileAndFind(test, 'A', name, disableInlining, (compiler, field) {
-      TypeMask type = f(compiler.commonMasks);
-      var inferrer = compiler.globalInference.typesInferrer;
+      TypeMask type = f(compiler, compiler.closedWorld.commonMasks);
+      var inferrer = compiler.globalInference.typesInferrerInternal;
       TypeMask inferredType =
           simplify(inferrer.getTypeOfElement(field), inferrer.compiler);
       Expect.equals(type, inferredType, test);
@@ -481,92 +486,120 @@
   });
 }
 
-void runTest(String test, Map<String, Function> fields) {
+void runTest(String test, Map<String, TestCallback> fields) {
   doTest(test, false, fields);
   doTest(test, true, fields);
 }
 
 void test() {
-  subclassOfInterceptor(types) =>
-      findTypeMask(types.compiler, 'Interceptor', 'nonNullSubclass');
+  TypeMask subclassOfInterceptor(Compiler compiler, CommonMasks types) =>
+      findTypeMask(compiler, 'Interceptor', 'nonNullSubclass');
 
-  runTest(TEST_1, {'f': (types) => types.nullType});
-  runTest(TEST_2,
-      {'f1': (types) => types.nullType, 'f2': (types) => types.uint31Type});
-  runTest(TEST_3, {
-    'f1': (types) => types.uint31Type,
-    'f2': (types) => types.uint31Type.nullable()
+  runTest(
+      TEST_1, <String, TestCallback>{'f': (compiler, types) => types.nullType});
+  runTest(TEST_2, <String, TestCallback>{
+    'f1': (compiler, types) => types.nullType,
+    'f2': (compiler, types) => types.uint31Type
   });
-  runTest(TEST_4, {
+  runTest(TEST_3, <String, TestCallback>{
+    'f1': (compiler, types) => types.uint31Type,
+    'f2': (compiler, types) => types.uint31Type.nullable()
+  });
+  runTest(TEST_4, <String, TestCallback>{
     'f1': subclassOfInterceptor,
-    'f2': (types) => types.stringType.nullable()
+    'f2': (compiler, types) => types.stringType.nullable()
   });
 
   // TODO(ngeoffray): We should try to infer that the initialization
   // code at the declaration site of the fields does not matter.
-  runTest(TEST_5, {'f1': subclassOfInterceptor, 'f2': subclassOfInterceptor});
-  runTest(TEST_6, {'f1': subclassOfInterceptor, 'f2': subclassOfInterceptor});
-  runTest(TEST_7, {'f1': subclassOfInterceptor, 'f2': subclassOfInterceptor});
+  runTest(TEST_5, <String, TestCallback>{
+    'f1': subclassOfInterceptor,
+    'f2': subclassOfInterceptor
+  });
+  runTest(TEST_6, <String, TestCallback>{
+    'f1': subclassOfInterceptor,
+    'f2': subclassOfInterceptor
+  });
+  runTest(TEST_7, <String, TestCallback>{
+    'f1': subclassOfInterceptor,
+    'f2': subclassOfInterceptor
+  });
 
-  runTest(TEST_8, {'f': (types) => types.stringType.nullable()});
-  runTest(TEST_9, {'f': (types) => types.stringType.nullable()});
-  runTest(TEST_10, {'f': (types) => types.uint31Type});
-  runTest(TEST_11, {'fs': (types) => types.uint31Type});
+  runTest(TEST_8, <String, TestCallback>{
+    'f': (compiler, types) => types.stringType.nullable()
+  });
+  runTest(TEST_9, <String, TestCallback>{
+    'f': (compiler, types) => types.stringType.nullable()
+  });
+  runTest(TEST_10,
+      <String, TestCallback>{'f': (compiler, types) => types.uint31Type});
+  runTest(TEST_11,
+      <String, TestCallback>{'fs': (compiler, types) => types.uint31Type});
 
   // TODO(ngeoffray): We should try to infer that the initialization
   // code at the declaration site of the fields does not matter.
-  runTest(TEST_12, {'fs': subclassOfInterceptor});
+  runTest(TEST_12, <String, TestCallback>{'fs': subclassOfInterceptor});
 
-  runTest(TEST_13, {'fs': (types) => types.uint31Type});
-  runTest(TEST_14, {'f': (types) => types.uint31Type});
-  runTest(TEST_15, {
-    'f': (types) {
-      ClassElement cls = types.compiler.backend.helpers.jsIndexableClass;
-      return new TypeMask.nonNullSubtype(cls, types.compiler.closedWorld);
+  runTest(TEST_13,
+      <String, TestCallback>{'fs': (compiler, types) => types.uint31Type});
+  runTest(TEST_14,
+      <String, TestCallback>{'f': (compiler, types) => types.uint31Type});
+  runTest(TEST_15, <String, TestCallback>{
+    'f': (compiler, types) {
+      ClassElement cls = compiler.backend.helpers.jsIndexableClass;
+      return new TypeMask.nonNullSubtype(cls, compiler.closedWorld);
     }
   });
-  runTest(TEST_16, {'f': subclassOfInterceptor});
-  runTest(TEST_17, {'f': (types) => types.uint31Type.nullable()});
-  runTest(TEST_18, {
-    'f1': (types) => types.uint31Type,
-    'f2': (types) => types.stringType,
-    'f3': (types) => types.dynamicType
+  runTest(TEST_16, <String, TestCallback>{'f': subclassOfInterceptor});
+  runTest(TEST_17, <String, TestCallback>{
+    'f': (compiler, types) => types.uint31Type.nullable()
   });
-  runTest(TEST_19, {
-    'f1': (types) => types.uint31Type,
-    'f2': (types) => types.stringType,
-    'f3': (types) => types.dynamicType
+  runTest(TEST_18, <String, TestCallback>{
+    'f1': (compiler, types) => types.uint31Type,
+    'f2': (compiler, types) => types.stringType,
+    'f3': (compiler, types) => types.dynamicType
   });
-  runTest(TEST_20, {'f': (types) => types.uint31Type.nullable()});
-  runTest(TEST_21, {'f': (types) => types.uint31Type.nullable()});
-
-  runTest(TEST_22, {
-    'f1': (types) => types.uint31Type,
-    'f2': (types) => types.uint31Type,
-    'f3': (types) => types.stringType.nullable()
+  runTest(TEST_19, <String, TestCallback>{
+    'f1': (compiler, types) => types.uint31Type,
+    'f2': (compiler, types) => types.stringType,
+    'f3': (compiler, types) => types.dynamicType
+  });
+  runTest(TEST_20, <String, TestCallback>{
+    'f': (compiler, types) => types.uint31Type.nullable()
+  });
+  runTest(TEST_21, <String, TestCallback>{
+    'f': (compiler, types) => types.uint31Type.nullable()
   });
 
-  runTest(TEST_23, {
-    'f1': (types) => types.uint31Type.nullable(),
-    'f2': (types) => types.uint31Type.nullable(),
-    'f3': (types) => types.uint31Type.nullable(),
-    'f4': (types) => types.uint31Type.nullable()
+  runTest(TEST_22, <String, TestCallback>{
+    'f1': (compiler, types) => types.uint31Type,
+    'f2': (compiler, types) => types.uint31Type,
+    'f3': (compiler, types) => types.stringType.nullable()
   });
 
-  runTest(TEST_24, {
-    'f1': (types) => types.positiveIntType,
-    'f2': (types) => types.positiveIntType,
-    'f3': (types) => types.uint31Type,
-    'f4': (types) => types.uint31Type,
-    'f5': (types) => types.numType.nullable(),
-    'f6': (types) => types.stringType.nullable()
+  runTest(TEST_23, <String, TestCallback>{
+    'f1': (compiler, types) => types.uint31Type.nullable(),
+    'f2': (compiler, types) => types.uint31Type.nullable(),
+    'f3': (compiler, types) => types.uint31Type.nullable(),
+    'f4': (compiler, types) => types.uint31Type.nullable()
   });
 
-  runTest(TEST_25, {'f1': (types) => types.uint31Type});
-  runTest(TEST_26, {'f1': (types) => types.positiveIntType});
-  runTest(TEST_27, {
-    'f1': (types) => types.uint31Type,
-    'f2': (types) => types.uint31Type.nullable()
+  runTest(TEST_24, <String, TestCallback>{
+    'f1': (compiler, types) => types.positiveIntType,
+    'f2': (compiler, types) => types.positiveIntType,
+    'f3': (compiler, types) => types.uint31Type,
+    'f4': (compiler, types) => types.uint31Type,
+    'f5': (compiler, types) => types.numType.nullable(),
+    'f6': (compiler, types) => types.stringType.nullable()
+  });
+
+  runTest(TEST_25,
+      <String, TestCallback>{'f1': (compiler, types) => types.uint31Type});
+  runTest(TEST_26,
+      <String, TestCallback>{'f1': (compiler, types) => types.positiveIntType});
+  runTest(TEST_27, <String, TestCallback>{
+    'f1': (compiler, types) => types.uint31Type,
+    'f2': (compiler, types) => types.uint31Type.nullable()
   });
 }
 
diff --git a/tests/compiler/dart2js/generic_method_type_usage_test.dart b/tests/compiler/dart2js/generic_method_type_usage_test.dart
index b1f0f22..bbaae78 100644
--- a/tests/compiler/dart2js/generic_method_type_usage_test.dart
+++ b/tests/compiler/dart2js/generic_method_type_usage_test.dart
@@ -69,6 +69,13 @@
   aFunction<Set>();
 }
 ''',
+
+  'dynamic_as_type_argument.dart': '''
+main() {
+  method<dynamic>();
+}
+method<T>() {}
+''',
 };
 
 Future runTest(Uri main, {MessageKind warning, MessageKind info}) async {
@@ -84,7 +91,7 @@
       outputProvider: output);
 
   Expect.isFalse(output.hasExtraOutput);
-  Expect.equals(0, diagnostics.errors.length);
+  Expect.equals(0, diagnostics.errors.length, "Unexpected errors.");
   Expect.equals(warning != null ? 1 : 0, diagnostics.warnings.length);
   if (warning != null) {
     Expect.equals(warning, diagnostics.warnings.first.message.kind);
@@ -105,5 +112,7 @@
 
     await runTest(Uri.parse('memory:cannot_new_function_type_variable.dart'),
         warning: MessageKind.CANNOT_INSTANTIATE_TYPE_VARIABLE);
+
+    await runTest(Uri.parse('memory:dynamic_as_type_argument.dart'));
   });
 }
diff --git a/tests/compiler/dart2js/issue13354_test.dart b/tests/compiler/dart2js/issue13354_test.dart
index 32826cc..ecf8dba 100644
--- a/tests/compiler/dart2js/issue13354_test.dart
+++ b/tests/compiler/dart2js/issue13354_test.dart
@@ -29,8 +29,8 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST, uri);
   asyncTest(() => compiler.run(uri).then((_) {
-        var commonMasks = compiler.commonMasks;
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var commonMasks = compiler.closedWorld.commonMasks;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
         checkReturn(String name, type) {
           var element = findElement(compiler, name);
diff --git a/tests/compiler/dart2js/js_spec_optimization_test.dart b/tests/compiler/dart2js/js_spec_optimization_test.dart
index 822175e..4b5df36 100644
--- a/tests/compiler/dart2js/js_spec_optimization_test.dart
+++ b/tests/compiler/dart2js/js_spec_optimization_test.dart
@@ -57,6 +57,33 @@
   }
 """;
 
+const String TEST_4 = r"""
+  import 'dart:_foreign_helper';
+  main() {
+    var s = JS('String|Null', '"Hello"');
+    var s1 = JS('returns:String;depends:none;effects:none;throws:null(1)',
+        '#.toLowerCase()', s);
+    var s2 = JS('returns:String;depends:none;effects:none;throws:null(1)',
+        '#.toUpperCase()', s);
+
+    // present: 'erCase' - retained at least one call to guarantee exception.
+  }
+""";
+
+const String TEST_5 = r"""
+  import 'dart:_foreign_helper';
+  main() {
+    var s = JS('String', '"Hello"');
+    var s1 = JS('returns:String;depends:none;effects:none;throws:null(1)',
+        '#.toLowerCase()', s);
+    var s2 = JS('returns:String;depends:none;effects:none;throws:null(1)',
+        '#.toUpperCase()', s);
+
+    // absent: 'erCase' - neither call needs to be retained since there is no
+    // exception.
+  }
+""";
+
 main() {
   RegExp directivePattern = new RegExp(
       //      \1                    \2        \3
@@ -90,5 +117,7 @@
         check(TEST_1),
         check(TEST_2),
         check(TEST_3),
+        check(TEST_4),
+        check(TEST_5),
       ]));
 }
diff --git a/tests/compiler/dart2js/js_spec_string_test.dart b/tests/compiler/dart2js/js_spec_string_test.dart
index bf18bce..491356c3 100644
--- a/tests/compiler/dart2js/js_spec_string_test.dart
+++ b/tests/compiler/dart2js/js_spec_string_test.dart
@@ -57,7 +57,7 @@
         setThrows: (b) => actualThrows = b,
         setIsAllocation: (b) => actualNew = b,
         setUseGvn: (b) => actualGvn = b,
-        resolveType: (t) => t,
+        lookupType: (t) => t,
         typesReturned: actualReturns,
         typesInstantiated: actualCreates,
         objectType: OBJECT,
diff --git a/tests/compiler/dart2js/jsinterop/world_test.dart b/tests/compiler/dart2js/jsinterop/world_test.dart
index e994791..074860f 100644
--- a/tests/compiler/dart2js/jsinterop/world_test.dart
+++ b/tests/compiler/dart2js/jsinterop/world_test.dart
@@ -21,6 +21,7 @@
 testClasses() async {
   test(String mainSource,
       {List<String> directlyInstantiated: const <String>[],
+      List<String> abstractlyInstantiated: const <String>[],
       List<String> indirectlyInstantiated: const <String>[]}) async {
     TypeEnvironment env = await TypeEnvironment.create(
         r"""
@@ -120,6 +121,13 @@
             "Expected $name to be directly instantiated in `${mainSource}`:"
             "\n${world.dump(cls)}");
       }
+      if (abstractlyInstantiated.contains(name)) {
+        isInstantiated = true;
+        Expect.isTrue(
+            world.isAbstractlyInstantiated(cls),
+            "Expected $name to be abstractly instantiated in `${mainSource}`:"
+            "\n${world.dump(cls)}");
+      }
       if (indirectlyInstantiated.contains(name)) {
         isInstantiated = true;
         Expect.isTrue(
@@ -139,19 +147,19 @@
   await test('main() {}');
 
   await test('main() => newA();',
-      directlyInstantiated: ['A', 'B', 'C', 'D'],
+      abstractlyInstantiated: ['A', 'B', 'C', 'D'],
       indirectlyInstantiated: ['Object', 'Interceptor', 'JavaScriptObject']);
 
   await test('main() => newB();',
-      directlyInstantiated: ['A', 'B', 'C', 'D'],
+      abstractlyInstantiated: ['A', 'B', 'C', 'D'],
       indirectlyInstantiated: ['Object', 'Interceptor', 'JavaScriptObject']);
 
   await test('main() => newC();',
-      directlyInstantiated: ['A', 'B', 'C', 'D'],
+      abstractlyInstantiated: ['A', 'B', 'C', 'D'],
       indirectlyInstantiated: ['Object', 'Interceptor', 'JavaScriptObject']);
 
   await test('main() => newD();',
-      directlyInstantiated: ['A', 'B', 'C', 'D'],
+      abstractlyInstantiated: ['A', 'B', 'C', 'D'],
       indirectlyInstantiated: ['Object', 'Interceptor', 'JavaScriptObject']);
 
   await test('main() => newE();', directlyInstantiated: ['E']);
@@ -159,6 +167,7 @@
   await test('main() => newF();', directlyInstantiated: ['F']);
 
   await test('main() => [newD(), newE()];',
-      directlyInstantiated: ['A', 'B', 'C', 'D', 'E'],
+      directlyInstantiated: ['E'],
+      abstractlyInstantiated: ['A', 'B', 'C', 'D'],
       indirectlyInstantiated: ['Object', 'Interceptor', 'JavaScriptObject']);
 }
diff --git a/tests/compiler/dart2js/kernel/assert_test.dart b/tests/compiler/dart2js/kernel/assert_test.dart
new file mode 100644
index 0000000..48c8997
--- /dev/null
+++ b/tests/compiler/dart2js/kernel/assert_test.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:compiler/src/commandline_options.dart' show Flags;
+import 'package:test/test.dart';
+
+import 'helper.dart' show check;
+
+main() {
+  test('assert without message', () {
+    String code = '''
+bool foo() => 2 + 2 == 4;
+main() {
+  assert(foo());
+}''';
+    return check(code, extraOptions: const <String>[Flags.enableCheckedMode]);
+  });
+
+  test('assert with message', () {
+    String code = '''
+bool foo() => 2 + 2 == 4;
+main() {
+  assert(foo(), "foo failed");
+}''';
+    return check(code,
+        extraOptions: const <String>[
+          Flags.enableCheckedMode,
+          Flags.enableAssertMessage,
+        ]);
+  });
+}
diff --git a/tests/compiler/dart2js/kernel/class_hierarchy_test.dart b/tests/compiler/dart2js/kernel/class_hierarchy_test.dart
new file mode 100644
index 0000000..9b6aa08
--- /dev/null
+++ b/tests/compiler/dart2js/kernel/class_hierarchy_test.dart
@@ -0,0 +1,76 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 dart2js copy of [KernelVisitor] generates the expected class
+/// hierarchy.
+
+import 'package:compiler/src/compiler.dart' show Compiler;
+import 'package:compiler/src/elements/elements.dart';
+import 'package:compiler/src/js_backend/backend.dart' show JavaScriptBackend;
+import 'package:compiler/src/commandline_options.dart' show Flags;
+import 'package:kernel/ast.dart' as ir;
+import 'package:kernel/class_hierarchy.dart';
+import 'package:test/test.dart';
+
+import '../memory_compiler.dart';
+
+main(List<String> arguments) {
+  Compiler compiler = compilerFor(memorySourceFiles: {
+    'main.dart': '''
+      class S {
+        sMethod() {}
+      }
+      class M {
+        mMethod() {}
+      }
+      class C extends S with M {
+        cMethod() {}
+      }
+      main() {}
+      '''
+  }, options: [
+    Flags.analyzeOnly,
+    Flags.analyzeMain,
+    Flags.useKernel
+  ]);
+  test('mixin', () async {
+    Uri mainUri = Uri.parse('memory:main.dart');
+    LibraryElement library = await compiler.analyzeUri(mainUri);
+    JavaScriptBackend backend = compiler.backend;
+    ir.Program program = backend.kernelTask.buildProgram(library);
+    ClassHierarchy hierarchy = new ClassHierarchy(program);
+
+    ir.Class getClass(String name) {
+      for (ir.Class cls in hierarchy.classes) {
+        if (cls.enclosingLibrary.importUri == mainUri && cls.name == name) {
+          if (arguments.contains('-v')) {
+            print('$cls');
+            print(' dispatch targets:');
+            hierarchy
+                .getDispatchTargets(cls)
+                .forEach((member) => print('  $member'));
+          }
+          return cls;
+        }
+      }
+      fail('Class $name not found.');
+    }
+
+    ir.Class classS = getClass('S');
+    ir.Class classM = getClass('M');
+    ir.Class classC = getClass('C');
+
+    void checkInheritance(ir.Class superClass, ir.Class subClass) {
+      for (ir.Member member in hierarchy.getDispatchTargets(superClass)) {
+        expect(
+            hierarchy.getDispatchTarget(subClass, member.name), equals(member),
+            reason: 'Unexpected dispatch target for ${member.name} '
+                'in $subClass');
+      }
+    }
+
+    checkInheritance(classS, classC);
+    checkInheritance(classM, classC);
+  });
+}
diff --git a/tests/compiler/dart2js/kernel/closed_world_test.dart b/tests/compiler/dart2js/kernel/closed_world_test.dart
new file mode 100644
index 0000000..cf642fa
--- /dev/null
+++ b/tests/compiler/dart2js/kernel/closed_world_test.dart
@@ -0,0 +1,144 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Tests that the closed world computed from [WorldImpact]s derived from kernel
+// is equivalent to the original computed from resolution.
+library dart2js.kernel.closed_world_test;
+
+import 'package:async_helper/async_helper.dart';
+import 'package:compiler/src/commandline_options.dart';
+import 'package:compiler/src/common.dart';
+import 'package:compiler/src/common/resolution.dart';
+import 'package:compiler/src/compiler.dart';
+import 'package:compiler/src/dart_types.dart';
+import 'package:compiler/src/elements/elements.dart';
+import 'package:compiler/src/enqueue.dart';
+import 'package:compiler/src/js_backend/backend.dart';
+import 'package:compiler/src/js_backend/type_variable_handler.dart';
+import 'package:compiler/src/ssa/kernel_impact.dart';
+import 'package:compiler/src/serialization/equivalence.dart';
+import 'package:compiler/src/universe/world_builder.dart';
+import 'package:compiler/src/universe/world_impact.dart';
+import 'package:compiler/src/world.dart';
+import 'impact_test.dart';
+import '../memory_compiler.dart';
+import '../serialization/helper.dart';
+import '../serialization/model_test_helper.dart';
+
+const SOURCE = const {
+  'main.dart': '''
+abstract class A {
+  // redirecting factory in abstract class to other class
+  factory A.a() = D.a;
+  // redirecting factory in abstract class to factory in abstract class
+  factory A.b() = B.a;
+}
+abstract class B implements A {
+  factory B.a() => null;
+}
+class C implements B {
+  // redirecting factory in concrete to other class
+  factory C.a() = D.a;
+}
+class D implements C {
+  D.a();
+}
+main(args) {
+  new A.a();
+  new A.b();
+  new C.a();
+  print(new List<String>()..add('Hello World!'));
+}
+'''
+};
+
+main(List<String> args) {
+  Arguments arguments = new Arguments.from(args);
+  Uri entryPoint;
+  Map<String, String> memorySourceFiles;
+  if (arguments.uri != null) {
+    entryPoint = arguments.uri;
+    memorySourceFiles = const <String, String>{};
+  } else {
+    entryPoint = Uri.parse('memory:main.dart');
+    memorySourceFiles = SOURCE;
+  }
+
+  asyncTest(() async {
+    enableDebugMode();
+    Compiler compiler = compilerFor(
+        entryPoint: entryPoint,
+        memorySourceFiles: memorySourceFiles,
+        options: [
+          Flags.analyzeOnly,
+          Flags.useKernel,
+          Flags.enableAssertMessage
+        ]);
+    ResolutionWorldBuilderImpl worldBuilder =
+        compiler.enqueuer.resolution.universe;
+    worldBuilder.useInstantiationMap = true;
+    compiler.resolution.retainCachesForTesting = true;
+    await compiler.run(entryPoint);
+    compiler.openWorld.closeWorld(compiler.reporter);
+
+    JavaScriptBackend backend = compiler.backend;
+    // Create a new resolution enqueuer and feed it with the [WorldImpact]s
+    // computed from kernel through the [build] in `kernel_impact.dart`.
+    ResolutionEnqueuer enqueuer = new ResolutionEnqueuer(
+        compiler.enqueuer,
+        compiler.options,
+        compiler.resolution,
+        const TreeShakingEnqueuerStrategy(),
+        compiler.globalDependencies,
+        backend,
+        compiler.commonElements,
+        compiler.cacheStrategy,
+        'enqueuer from kernel');
+    // TODO(johnniwinther): Store backend info separately. This replacement is
+    // made to reset a field in [TypeVariableHandler] that prevents it from
+    // enqueuing twice.
+    backend.typeVariableHandler = new TypeVariableHandler(compiler);
+
+    if (compiler.deferredLoadTask.isProgramSplit) {
+      enqueuer.applyImpact(backend.computeDeferredLoadingImpact());
+    }
+    enqueuer.applyImpact(backend.computeHelpersImpact());
+    enqueuer.applyImpact(enqueuer.nativeEnqueuer
+        .processNativeClasses(compiler.libraryLoader.libraries));
+    enqueuer.applyImpact(
+        backend.computeMainImpact(compiler.mainFunction, forResolution: true));
+    enqueuer.forEach((work) {
+      AstElement element = work.element;
+      ResolutionImpact resolutionImpact = build(compiler, element.resolvedAst);
+      WorldImpact worldImpact = compiler.backend.impactTransformer
+          .transformResolutionImpact(enqueuer, resolutionImpact);
+      enqueuer.registerProcessedElement(element);
+      enqueuer.applyImpact(worldImpact, impactSource: element);
+    });
+    ClosedWorld closedWorld =
+        enqueuer.universe.openWorld.closeWorld(compiler.reporter);
+
+    checkResolutionEnqueuers(compiler.enqueuer.resolution, enqueuer,
+        typeEquivalence: (DartType a, DartType b) {
+      return areTypesEquivalent(unalias(a), unalias(b));
+    }, elementFilter: (Element element) {
+      if (element is ConstructorElement && element.isRedirectingFactory) {
+        // Redirecting factory constructors are skipped in kernel.
+        return false;
+      }
+      if (element is ClassElement) {
+        for (ConstructorElement constructor in element.constructors) {
+          if (!constructor.isRedirectingFactory) {
+            return true;
+          }
+        }
+        // The class cannot itself be instantiated.
+        return false;
+      }
+      return true;
+    }, verbose: arguments.verbose);
+    checkClosedWorlds(compiler.closedWorld, closedWorld,
+        verbose: arguments.verbose);
+  });
+}
diff --git a/tests/compiler/dart2js/kernel/constructors_test.dart b/tests/compiler/dart2js/kernel/constructors_test.dart
new file mode 100644
index 0000000..1d30c1c
--- /dev/null
+++ b/tests/compiler/dart2js/kernel/constructors_test.dart
@@ -0,0 +1,41 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:compiler/src/compiler.dart' show Compiler;
+import 'package:compiler/src/elements/elements.dart';
+import 'package:test/test.dart';
+
+import 'helper.dart' show check;
+
+main() {
+  test('simple default constructor', () {
+    String code = '''
+class A {
+}
+
+main() {
+  var a = new A();
+  return a;
+}''';
+    return check(code, lookup: defaultConstructorFor('A'));
+  });
+
+  test('simple default constructor with field', () {
+    String code = '''
+class A {
+  int x = 1;
+}
+
+main() {
+  var a = new A();
+  return a;
+}''';
+    return check(code, lookup: defaultConstructorFor('A'));
+  });
+}
+
+defaultConstructorFor(String className) => (Compiler compiler) {
+      ClassElement clazz = compiler.mainApp.find(className);
+      return clazz.lookupDefaultConstructor();
+    };
diff --git a/tests/compiler/dart2js/kernel/helper.dart b/tests/compiler/dart2js/kernel/helper.dart
index 1d83a10..cbb1638b 100644
--- a/tests/compiler/dart2js/kernel/helper.dart
+++ b/tests/compiler/dart2js/kernel/helper.dart
@@ -14,36 +14,54 @@
 import '../memory_compiler.dart';
 
 Future<String> compile(String code,
-    {String entry: 'main',
+    {dynamic lookup: 'main',
     bool useKernel: true,
-    bool disableTypeInference: true}) async {
+    bool disableTypeInference: true,
+    List<String> extraOptions: const <String>[]}) async {
   List<String> options = <String>[
     Flags.disableInlining,
   ];
   if (disableTypeInference) options.add(Flags.disableTypeInference);
   if (useKernel) options.add(Flags.useKernel);
+  options.addAll(extraOptions);
 
-  if (entry != 'main' && !code.contains('main')) {
-    code = "$code\n\nmain() => $entry;";
+  if (lookup is String && lookup != 'main' && !code.contains('main')) {
+    code = "$code\n\nmain() => $lookup;";
   }
   CompilationResult result = await runCompiler(
       memorySourceFiles: {'main.dart': code}, options: options);
   expect(result.isSuccess, isTrue);
   Compiler compiler = result.compiler;
-  Element element = compiler.mainApp.find(entry);
+  Element element;
+  if (lookup is String) {
+    element = compiler.mainApp.find(lookup);
+  } else {
+    element = lookup(compiler);
+  }
   js.JavaScriptBackend backend = compiler.backend;
   return backend.getGeneratedCode(element);
 }
 
+/// Checks that the given Dart [code] compiles to the same JS in kernel and
+/// normal mode.
+///
+/// The function to check at the end is given by [lookup]. If [lookup] is a
+/// String, then the generated code for a top-level element named [lookup] is
+/// checked. Otherwise, [lookup] is a function that takes a [Compiler] and
+/// returns an [Element], and the returned [Element] is checked.
 Future check(String code,
-    {String entry: 'main', bool disableTypeInference: true}) async {
+    {dynamic lookup: 'main',
+    bool disableTypeInference: true,
+    List<String> extraOptions: const <String>[]}) async {
   var original = await compile(code,
-      entry: entry,
+      lookup: lookup,
       useKernel: false,
-      disableTypeInference: disableTypeInference);
+      disableTypeInference: disableTypeInference,
+      extraOptions: extraOptions);
   var kernel = await compile(code,
-      entry: entry,
+      lookup: lookup,
       useKernel: true,
-      disableTypeInference: disableTypeInference);
+      disableTypeInference: disableTypeInference,
+      extraOptions: extraOptions);
   expect(kernel, original);
 }
diff --git a/tests/compiler/dart2js/kernel/impact_test.dart b/tests/compiler/dart2js/kernel/impact_test.dart
index 2716d53..fd2467f 100644
--- a/tests/compiler/dart2js/kernel/impact_test.dart
+++ b/tests/compiler/dart2js/kernel/impact_test.dart
@@ -4,25 +4,30 @@
 
 library dart2js.kernel.impact_test;
 
-import 'dart:async';
 import 'package:async_helper/async_helper.dart';
 import 'package:compiler/src/commandline_options.dart';
 import 'package:compiler/src/common.dart';
 import 'package:compiler/src/common/names.dart';
 import 'package:compiler/src/common/resolution.dart';
 import 'package:compiler/src/compiler.dart';
+import 'package:compiler/src/constants/expressions.dart';
+import 'package:compiler/src/dart_types.dart';
 import 'package:compiler/src/elements/elements.dart';
 import 'package:compiler/src/resolution/registry.dart';
+import 'package:compiler/src/resolution/tree_elements.dart';
 import 'package:compiler/src/ssa/kernel_impact.dart';
 import 'package:compiler/src/serialization/equivalence.dart';
+import 'package:compiler/src/universe/call_structure.dart';
 import 'package:compiler/src/universe/feature.dart';
 import 'package:compiler/src/universe/use.dart';
+import 'package:expect/expect.dart';
 import '../memory_compiler.dart';
 import '../serialization/test_helper.dart';
 
 const Map<String, String> SOURCE = const <String, String>{
   'main.dart': r'''
 import 'helper.dart';
+import 'dart:html';
 
 main() {
   testEmpty();
@@ -36,6 +41,8 @@
   testStringInterpolationConst();
   testStringJuxtaposition();
   testSymbol();
+  testTypeLiteral();
+  testBoolFromEnvironment();
   testEmptyListLiteral();
   testEmptyListLiteralDynamic();
   testEmptyListLiteralTyped();
@@ -53,14 +60,61 @@
   testPostDec(null);
   testPreInc(null);
   testPreDec(null);
+  testIs();
+  testIsGeneric();
+  testIsGenericRaw();
+  testIsGenericDynamic();
+  testIsNot();
+  testIsNotGeneric();
+  testIsNotGenericRaw();
+  testIsNotGenericDynamic();
+  testIsTypedef();
+  testIsTypedefGeneric();
+  testIsTypedefGenericRaw();
+  testIsTypedefGenericDynamic();
+  testIsTypedefDeep();
+  testAs();
+  testAsGeneric();
+  testAsGenericRaw();
+  testAsGenericDynamic();
+  testThrow();
+  testIfNotNull(null);
+  testIfNotNullSet(null);
+  testIfNull(null);
+  testSetIfNull(null);
+  testSyncStar();
+  testAsync();
+  testAsyncStar();
   testIfThen();
   testIfThenElse();
+  testForIn(null);
+  testForInTyped(null);
+  testAsyncForIn(null);
+  testAsyncForInTyped(null);
+  testTryCatch();
+  testTryCatchOn();
+  testTryCatchStackTrace();
+  testTryFinally();
+  testSwitchWithoutFallthrough(null);
+  testSwitchWithFallthrough(null);
   testTopLevelInvoke();
   testTopLevelInvokeTyped();
   testTopLevelFunctionTyped();
   testTopLevelFunctionGet();
+  testTopLevelGetterGet();
+  testTopLevelGetterGetTyped();
+  testTopLevelSetterSet();
+  testTopLevelSetterSetTyped();
   testTopLevelField();
+  testTopLevelFieldLazy();
+  testTopLevelFieldConst();
+  testTopLevelFieldFinal();
   testTopLevelFieldTyped();
+  testTopLevelFieldGeneric1();
+  testTopLevelFieldGeneric2();
+  testTopLevelFieldGeneric3();
+  testTopLevelFieldWrite();
+  testStaticFunctionGet();
   testDynamicInvoke(null);
   testDynamicGet(null);
   testDynamicSet(null);
@@ -77,6 +131,10 @@
   testInvokeIndexSet(null);
   testAssert();
   testAssertWithMessage();
+  testConstructorInvoke();
+  testConstructorInvokeGeneric();
+  testConstructorInvokeGenericRaw();
+  testConstructorInvokeGenericDynamic();
   testFactoryInvoke();
   testFactoryInvokeGeneric();
   testFactoryInvokeGenericRaw();
@@ -85,6 +143,31 @@
   testRedirectingFactoryInvokeGeneric();
   testRedirectingFactoryInvokeGenericRaw();
   testRedirectingFactoryInvokeGenericDynamic();
+  testConstRedirectingFactoryInvoke();
+  testConstRedirectingFactoryInvokeGeneric();
+  testConstRedirectingFactoryInvokeGenericRaw();
+  testConstRedirectingFactoryInvokeGenericDynamic();
+  testImplicitConstructor();
+  testFactoryConstructor();
+  testDefaultValuesPositional();
+  testDefaultValuesNamed();
+  testFieldInitializer1();
+  testFieldInitializer2();
+  testFieldInitializer3();
+  testInstanceFieldWithInitializer();
+  testInstanceFieldTyped();
+  testThisInitializer();
+  testSuperInitializer();
+  testGenericClass();
+  testSuperCall();
+  testSuperGet();
+  testSuperFieldSet();
+  testSuperSetterSet();
+  testSuperClosurization();
+  testForwardingConstructor();
+  testForwardingConstructorTyped();
+  testForwardingConstructorGeneric();
+  testEnum();
 }
 
 testEmpty() {}
@@ -100,6 +183,8 @@
 }
 testStringJuxtaposition() => 'a' 'b';
 testSymbol() => #main;
+testTypeLiteral() => Object;
+testBoolFromEnvironment() => const bool.fromEnvironment('FOO');
 testEmptyListLiteral() => [];
 testEmptyListLiteralDynamic() => <dynamic>[];
 testEmptyListLiteralTyped() => <String>[];
@@ -117,6 +202,33 @@
 testPostDec(o) => o--;
 testPreInc(o) => ++o;
 testPreDec(o) => --o;
+
+testIs() => null is Class;
+testIsGeneric() => null is GenericClass<int, String>;
+testIsGenericRaw() => null is GenericClass;
+testIsGenericDynamic() => null is GenericClass<dynamic, dynamic>;
+testIsNot() => null is! Class;
+testIsNotGeneric() => null is! GenericClass<int, String>;
+testIsNotGenericRaw() => null is! GenericClass;
+testIsNotGenericDynamic() => null is! GenericClass<dynamic, dynamic>;
+testIsTypedef() => null is Typedef;
+testIsTypedefGeneric() => null is GenericTypedef<int, String>;
+testIsTypedefGenericRaw() => null is GenericTypedef;
+testIsTypedefGenericDynamic() => null is GenericTypedef<dynamic, dynamic>;
+testIsTypedefDeep() => null is List<GenericTypedef<int, GenericTypedef>>;
+testAs() => null as Class;
+testAsGeneric() => null as GenericClass<int, String>;
+testAsGenericRaw() => null as GenericClass;
+testAsGenericDynamic() => null as GenericClass<dynamic, dynamic>;
+testThrow() => throw '';
+testIfNotNull(o) => o?.foo;
+testIfNotNullSet(o) => o?.foo = 42;
+testIfNull(o) => o ?? 42;
+testSetIfNull(o) => o ??= 42;
+
+testSyncStar() sync* {}
+testAsync() async {}
+testAsyncStar() async* {}
 testIfThen() {
   if (false) return 42;
   return 1;
@@ -128,6 +240,57 @@
     return 1;
   }
 }
+testForIn(o) {
+  for (var e in o) {}
+}
+testForInTyped(o) {
+  for (int e in o) {}
+}
+testAsyncForIn(o) async {
+  await for (var e in o) {}
+}
+testAsyncForInTyped(o) async {
+  await for (int e in o) {}
+}
+testTryCatch() {
+  try {} catch (e) {}
+}
+testTryCatchOn() {
+  try {} on String catch (e) {}
+}
+testTryCatchStackTrace() {
+  try {} catch (e, s) {}
+}
+testTryFinally() {
+  try {} finally {}
+}
+testSwitchWithoutFallthrough(o) {
+  switch (o) {
+  case 0:
+  case 1:
+    o = 2;
+    break;
+  case 2:
+    o = 3;
+    return;
+  case 3:
+    throw '';
+  case 4:
+  default:
+  }
+}
+testSwitchWithFallthrough(o) {
+  switch (o) {
+  case 0:
+  case 1:
+    o = 2;
+  case 2:
+    o = 3;
+    return;
+  case 3:
+  default:
+  }
+}
 topLevelFunction1(a) {}
 topLevelFunction2(a, [b, c]) {}
 topLevelFunction3(a, {b, c}) {}
@@ -170,11 +333,37 @@
   topLevelFunctionTyped4(null);
 }
 testTopLevelFunctionGet() => topLevelFunction1;
+get topLevelGetter => 0;
+testTopLevelGetterGet() => topLevelGetter;
+int get topLevelGetterTyped => 0;
+testTopLevelGetterGetTyped() => topLevelGetterTyped;
+set topLevelSetter(_) {}
+testTopLevelSetterSet() => topLevelSetter = 0;
+void set topLevelSetterTyped(int value) {}
+testTopLevelSetterSetTyped() => topLevelSetterTyped = 0;
 
 var topLevelField;
 testTopLevelField() => topLevelField;
+var topLevelFieldLazy = topLevelFunction1(null);
+testTopLevelFieldLazy() => topLevelFieldLazy;
+const topLevelFieldConst = 0;
+testTopLevelFieldConst() => topLevelFieldConst;
+final topLevelFieldFinal = topLevelFunction1(null);
+testTopLevelFieldFinal() => topLevelFieldFinal;
 int topLevelFieldTyped;
 testTopLevelFieldTyped() => topLevelFieldTyped;
+GenericClass topLevelFieldGeneric1;
+testTopLevelFieldGeneric1() => topLevelFieldGeneric1;
+GenericClass<dynamic, dynamic> topLevelFieldGeneric2;
+testTopLevelFieldGeneric2() => topLevelFieldGeneric2;
+GenericClass<int, String> topLevelFieldGeneric3;
+testTopLevelFieldGeneric3() => topLevelFieldGeneric3;
+testTopLevelFieldWrite() => topLevelField = 3;
+class StaticFunctionGetClass {
+  static foo() {}
+}
+testStaticFunctionGet() => StaticFunctionGetClass.foo;
+
 testDynamicInvoke(o) {
   o.f1(0);
   o.f2(1);
@@ -225,6 +414,18 @@
 testAssertWithMessage() {
   assert(true, 'ok');
 }
+testConstructorInvoke() {
+  new Class.generative();
+}
+testConstructorInvokeGeneric() {
+  new GenericClass<int, String>.generative();
+}
+testConstructorInvokeGenericRaw() {
+  new GenericClass.generative();
+}
+testConstructorInvokeGenericDynamic() {
+  new GenericClass<dynamic, dynamic>.generative();
+}
 testFactoryInvoke() {
   new Class.fact();
 }
@@ -249,18 +450,153 @@
 testRedirectingFactoryInvokeGenericDynamic() {
   new GenericClass<dynamic, dynamic>.redirect();
 }
+testConstRedirectingFactoryInvoke() {
+  const Class.redirect();
+}
+testConstRedirectingFactoryInvokeGeneric() {
+  const GenericClass<int, String>.redirect();
+}
+testConstRedirectingFactoryInvokeGenericRaw() {
+  const GenericClass.redirect();
+}
+testConstRedirectingFactoryInvokeGenericDynamic() {
+  const GenericClass<dynamic, dynamic>.redirect();
+}
+class ClassImplicitConstructor {}
+testImplicitConstructor() => new ClassImplicitConstructor();
+class ClassFactoryConstructor {
+  factory ClassFactoryConstructor() => null;
+}
+testFactoryConstructor() => new ClassFactoryConstructor();
+testDefaultValuesPositional([bool value = false]) {}
+testDefaultValuesNamed({bool value: false}) {}
+
+class ClassFieldInitializer1 {
+  var field;
+  ClassFieldInitializer1(this.field);
+}
+testFieldInitializer1() => new ClassFieldInitializer1(42);
+class ClassFieldInitializer2 {
+  var field;
+  ClassFieldInitializer2(value) : field = value;
+}
+testFieldInitializer2() => new ClassFieldInitializer2(42);
+class ClassFieldInitializer3 {
+  var field;
+  ClassFieldInitializer3.a();
+  ClassFieldInitializer3.b(value) : field = value;
+}
+testFieldInitializer3() {
+  new ClassFieldInitializer3.a();
+  new ClassFieldInitializer3.b(42);
+}
+class ClassInstanceFieldWithInitializer {
+  var field = false;
+}
+testInstanceFieldWithInitializer() => new ClassInstanceFieldWithInitializer();
+class ClassInstanceFieldTyped {
+  int field;
+}
+testInstanceFieldTyped() => new ClassInstanceFieldTyped();
+class ClassGeneric<T> {
+  ClassGeneric(T arg);
+}
+class ClassThisInitializer {
+  ClassThisInitializer() : this.internal();
+  ClassThisInitializer.internal();
+}
+testThisInitializer() => new ClassThisInitializer();
+class ClassSuperInitializer extends ClassThisInitializer {
+  ClassSuperInitializer() : super.internal();
+}
+testSuperInitializer() => new ClassSuperInitializer();
+testGenericClass() => new ClassGeneric<int>(0);
+class Super1 {
+  foo() {}
+}
+class Sub1 extends Super1 {
+  Sub1() {
+    super.foo();
+  }
+}
+testSuperCall() => new Sub1();
+class Super2 {
+  var foo;
+}
+class Sub2 extends Super2 {
+  Sub2() {
+    super.foo;
+  }
+}
+testSuperGet() => new Sub2();
+class Super3 {
+  var foo;
+}
+class Sub3 extends Super3 {
+  Sub3() {
+    super.foo = 42;
+  }
+}
+testSuperFieldSet() => new Sub3();
+class Super4 {
+  set foo(_) {}
+}
+class Sub4 extends Super4 {
+  Sub4() {
+    super.foo = 42;
+  }
+}
+testSuperSetterSet() => new Sub4();
+class Super5 {
+  foo() {}
+}
+class Sub5 extends Super5 {
+  Sub5() {
+    super.foo;
+  }
+}
+testSuperClosurization() => new Sub5();
+
+class EmptyMixin {}
+class ForwardingConstructorSuperClass {
+  ForwardingConstructorSuperClass(arg);
+}
+class ForwardingConstructorClass =
+    ForwardingConstructorSuperClass with EmptyMixin;
+testForwardingConstructor() => new ForwardingConstructorClass(null);
+
+class ForwardingConstructorTypedSuperClass {
+  ForwardingConstructorTypedSuperClass(int arg);
+}
+class ForwardingConstructorTypedClass =
+    ForwardingConstructorTypedSuperClass with EmptyMixin;
+testForwardingConstructorTyped() => new ForwardingConstructorTypedClass(null);
+
+class ForwardingConstructorGenericSuperClass<T> {
+  ForwardingConstructorGenericSuperClass(T arg);
+}
+class ForwardingConstructorGenericClass<S> =
+    ForwardingConstructorGenericSuperClass<S> with EmptyMixin;
+testForwardingConstructorGeneric() {
+  new ForwardingConstructorGenericClass<int>(null);
+}
+
+enum Enum { A }
+testEnum() => Enum.A;
 ''',
   'helper.dart': '''
 class Class {
-  Class.generative();
+  const Class.generative();
   factory Class.fact() => null;
-  factory Class.redirect() = Class.generative;
+  const factory Class.redirect() = Class.generative;
 }
 class GenericClass<X, Y> {
-  GenericClass.generative();
+  const GenericClass.generative();
   factory GenericClass.fact() => null;
-  factory GenericClass.redirect() = GenericClass.generative;
+  const factory GenericClass.redirect() = GenericClass<X, Y>.generative;
 }
+typedef Typedef();
+typedef X GenericTypedef<X, Y>(Y y);
 ''',
 };
 
@@ -278,53 +614,202 @@
         ]);
     compiler.resolution.retainCachesForTesting = true;
     await compiler.run(entryPoint);
-    checkLibrary(compiler, compiler.mainApp);
+    compiler.libraryLoader.libraries.forEach((LibraryElement library) {
+      checkLibrary(compiler, library, fullTest: args.contains('--full'));
+    });
   });
 }
 
-void checkLibrary(Compiler compiler, LibraryElement library) {
+void checkLibrary(Compiler compiler, LibraryElement library,
+    {bool fullTest: false}) {
   library.forEachLocalMember((AstElement element) {
     if (element.isClass) {
-      // TODO(johnniwinther): Handle class members.
+      ClassElement cls = element;
+      cls.forEachLocalMember((AstElement member) {
+        checkElement(compiler, member, fullTest: fullTest);
+      });
+    } else if (element.isTypedef) {
+      // Skip typedefs.
     } else {
-      checkElement(compiler, element);
+      checkElement(compiler, element, fullTest: fullTest);
     }
   });
 }
 
-void checkElement(Compiler compiler, AstElement element) {
+void checkElement(Compiler compiler, AstElement element,
+    {bool fullTest: false}) {
+  if (!fullTest) {
+    if (element.library.isPlatformLibrary) {
+      // Test only selected elements in web-related platform libraries since
+      // this unittest otherwise takes too long to run.
+      switch (element.library.canonicalUri.path) {
+        case 'html':
+          if ('$element' ==
+              'function(_ValidatingTreeSanitizer#_sanitizeUntrustedElement)') {
+            break;
+          }
+          return;
+        case 'web_gl':
+          if ('$element' ==
+              'function(RenderingContext#getFramebufferAttachmentParameter)') {
+            return;
+          }
+          break;
+        case 'indexed_db':
+          if ('$element' == 'field(ObjectStore#keyPath)') {
+            break;
+          }
+          return;
+        case 'web_audio':
+          return;
+      }
+    }
+  }
+  if (element.isConstructor) {
+    ConstructorElement constructor = element;
+    if (constructor.isRedirectingFactory) {
+      // Skip redirecting constructors for now; they might not be supported.
+      return;
+    }
+  }
   ResolutionImpact astImpact = compiler.resolution.getResolutionImpact(element);
-  astImpact = laxImpact(element, astImpact);
+  astImpact = laxImpact(compiler, element, astImpact);
   ResolutionImpact kernelImpact = build(compiler, element.resolvedAst);
+  Expect.isNotNull(kernelImpact, 'No impact computed for $element');
   testResolutionImpactEquivalence(
       astImpact, kernelImpact, const CheckStrategy());
 }
 
 /// Lax the precision of [impact] to meet expectancy of the corresponding impact
 /// generated from kernel.
-ResolutionImpact laxImpact(AstElement element, ResolutionImpact impact) {
+ResolutionImpact laxImpact(
+    Compiler compiler, AstElement element, ResolutionImpact impact) {
   ResolutionWorldImpactBuilder builder =
       new ResolutionWorldImpactBuilder('Lax impact of ${element}');
-  impact.staticUses.forEach(builder.registerStaticUse);
+  for (StaticUse staticUse in impact.staticUses) {
+    switch (staticUse.kind) {
+      case StaticUseKind.CONSTRUCTOR_INVOKE:
+      case StaticUseKind.CONST_CONSTRUCTOR_INVOKE:
+        ConstructorElement constructor = staticUse.element;
+        ConstructorElement effectiveTarget = constructor.effectiveTarget;
+        DartType effectiveTargetType =
+            constructor.computeEffectiveTargetType(staticUse.type);
+        builder.registerStaticUse(
+            staticUse.kind == StaticUseKind.CONST_CONSTRUCTOR_INVOKE
+                ? new StaticUse.constConstructorInvoke(
+                    effectiveTarget.declaration, null, effectiveTargetType)
+                : new StaticUse.typedConstructorInvoke(
+                    effectiveTarget.declaration, null, effectiveTargetType));
+        break;
+      default:
+        builder.registerStaticUse(staticUse);
+        break;
+    }
+  }
   impact.dynamicUses.forEach(builder.registerDynamicUse);
-  impact.typeUses.forEach(builder.registerTypeUse);
+  for (TypeUse typeUse in impact.typeUses) {
+    builder.registerTypeUse(
+        new TypeUse.internal(unalias(typeUse.type), typeUse.kind));
+  }
   impact.constantLiterals.forEach(builder.registerConstantLiteral);
   impact.constSymbolNames.forEach(builder.registerConstSymbolName);
   impact.listLiterals.forEach(builder.registerListLiteral);
   impact.mapLiterals.forEach(builder.registerMapLiteral);
   for (Feature feature in impact.features) {
-    builder.registerFeature(feature);
     switch (feature) {
+      case Feature.FIELD_WITHOUT_INITIALIZER:
+        if (element.isInstanceMember) {
+          bool missing = false;
+          OUTER:
+          for (ConstructorElement constructor
+              in element.enclosingClass.constructors) {
+            if (constructor.isGenerativeConstructor &&
+                !constructor.isRedirectingGenerative) {
+              for (ParameterElement parameter in constructor.parameters) {
+                if (parameter is InitializingFormalElement &&
+                    parameter.fieldElement == element) {
+                  continue OUTER;
+                }
+              }
+              if (constructor.resolvedAst.kind == ResolvedAstKind.PARSED) {
+                var function = constructor.resolvedAst.node;
+                if (function.initializers != null) {
+                  TreeElements elements = constructor.resolvedAst.elements;
+                  for (var initializer in function.initializers) {
+                    if (elements[initializer] == element) {
+                      continue OUTER;
+                    }
+                  }
+                }
+              }
+              missing = true;
+            }
+          }
+          if (!missing) continue;
+        }
+        builder.registerConstantLiteral(new NullConstantExpression());
+        break;
       case Feature.STRING_INTERPOLATION:
       case Feature.STRING_JUXTAPOSITION:
         // These are both converted into a string concatenation in kernel so
-        // we cannot tell the diferrence.
+        // we cannot tell the difference.
         builder.registerFeature(Feature.STRING_INTERPOLATION);
         builder.registerFeature(Feature.STRING_JUXTAPOSITION);
         break;
+      case Feature.FALL_THROUGH_ERROR:
+        LibraryElement library =
+            compiler.libraryLoader.lookupLibrary(Uris.dart_core);
+        ClassElement cls =
+            library.implementation.localLookup('FallThroughError');
+        ConstructorElement constructor = cls.lookupConstructor('');
+        builder.registerStaticUse(new StaticUse.typedConstructorInvoke(
+            constructor, CallStructure.NO_ARGS, cls.thisType));
+        builder.registerFeature(Feature.THROW_EXPRESSION);
+        break;
       default:
+        builder.registerFeature(feature);
+        break;
     }
   }
   impact.nativeData.forEach(builder.registerNativeData);
   return builder;
 }
+
+/// Visitor the performers unaliasing of all typedefs nested within a
+/// [DartType].
+class Unaliaser extends BaseDartTypeVisitor<dynamic, DartType> {
+  const Unaliaser();
+
+  @override
+  DartType visit(DartType type, [_]) => type.accept(this, null);
+
+  @override
+  DartType visitType(DartType type, _) => type;
+
+  List<DartType> visitList(List<DartType> types) => types.map(visit).toList();
+
+  @override
+  DartType visitInterfaceType(InterfaceType type, _) {
+    return type.createInstantiation(visitList(type.typeArguments));
+  }
+
+  @override
+  DartType visitTypedefType(TypedefType type, _) {
+    return visit(type.unaliased);
+  }
+
+  @override
+  DartType visitFunctionType(FunctionType type, _) {
+    return new FunctionType.synthesized(
+        visit(type.returnType),
+        visitList(type.parameterTypes),
+        visitList(type.optionalParameterTypes),
+        type.namedParameters,
+        visitList(type.namedParameterTypes));
+  }
+}
+
+/// Perform unaliasing of all typedefs nested within a [DartType].
+DartType unalias(DartType type) {
+  return const Unaliaser().visit(type);
+}
diff --git a/tests/compiler/dart2js/kernel/simple_function_test.dart b/tests/compiler/dart2js/kernel/simple_function_test.dart
index 6539134..d58ca33 100644
--- a/tests/compiler/dart2js/kernel/simple_function_test.dart
+++ b/tests/compiler/dart2js/kernel/simple_function_test.dart
@@ -42,6 +42,6 @@
       main() {
         foo(1);
       }''';
-    return check(code, entry: 'foo');
+    return check(code, lookup: 'foo');
   });
 }
diff --git a/tests/compiler/dart2js/kernel/visitor_test.dart b/tests/compiler/dart2js/kernel/visitor_test.dart
index 1edd591..d632442 100644
--- a/tests/compiler/dart2js/kernel/visitor_test.dart
+++ b/tests/compiler/dart2js/kernel/visitor_test.dart
@@ -7,21 +7,28 @@
 
 import 'dart:io';
 import 'package:compiler/src/compiler.dart' show Compiler;
+import 'package:compiler/src/elements/elements.dart';
 import 'package:compiler/src/js_backend/backend.dart' show JavaScriptBackend;
 import 'package:compiler/src/commandline_options.dart' show Flags;
 import 'package:kernel/ast.dart';
 import 'package:kernel/text/ast_to_text.dart';
 import 'package:kernel/transformations/mixin_full_resolution.dart';
+import 'package:kernel/class_hierarchy.dart';
 import 'package:path/path.dart' as pathlib;
 import 'package:test/test.dart';
 
 import '../memory_compiler.dart';
 
-const String TESTCASE_DIR = 'third_party/pkg/kernel/testcases/';
+const String TESTCASE_DIR = 'pkg/kernel/testcases/';
 
-const List<String> SKIP_TESTS = const <String>[];
+const List<String> SKIP_TESTS = const <String>[
+  /// The test expects an unpatched api.
+  'external',
+];
 
 main(List<String> arguments) {
+  Compiler compiler = compilerFor(
+      options: [Flags.analyzeOnly, Flags.analyzeMain, Flags.useKernel]);
   Directory directory = new Directory('${TESTCASE_DIR}/input');
   for (FileSystemEntity file in directory.listSync()) {
     if (file is File && file.path.endsWith('.dart')) {
@@ -33,16 +40,13 @@
       }
 
       test(name, () async {
-        var result = await runCompiler(
-            entryPoint: file.absolute.uri,
-            options: [Flags.analyzeOnly, Flags.useKernel]);
-        Compiler compiler = result.compiler;
+        LibraryElement library = await compiler.analyzeUri(file.absolute.uri);
         JavaScriptBackend backend = compiler.backend;
         StringBuffer buffer = new StringBuffer();
-        Program program = backend.kernelTask.program;
+        Program program = backend.kernelTask.buildProgram(library);
         new MixinFullResolution().transform(program);
-        new Printer(buffer).writeLibraryFile(
-            backend.kernelTask.program.mainMethod.enclosingLibrary);
+        new Printer(buffer)
+            .writeLibraryFile(program.mainMethod.enclosingLibrary);
         String actual = buffer.toString();
         String expected =
             new File('${TESTCASE_DIR}/spec-mode/$name.baseline.txt')
diff --git a/tests/compiler/dart2js/list_tracer2_test.dart b/tests/compiler/dart2js/list_tracer2_test.dart
index d03ab91..c0a5166 100644
--- a/tests/compiler/dart2js/list_tracer2_test.dart
+++ b/tests/compiler/dart2js/list_tracer2_test.dart
@@ -24,7 +24,7 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST, uri);
   asyncTest(() => compiler.run(uri).then((_) {
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
         checkType(String name, type) {
           var element = findElement(compiler, name);
@@ -32,6 +32,6 @@
           Expect.equals(type, simplify(mask.elementType, compiler), name);
         }
 
-        checkType('myList', compiler.commonMasks.uint31Type);
+        checkType('myList', compiler.closedWorld.commonMasks.uint31Type);
       }));
 }
diff --git a/tests/compiler/dart2js/list_tracer3_test.dart b/tests/compiler/dart2js/list_tracer3_test.dart
index cb1b936..1e61858 100644
--- a/tests/compiler/dart2js/list_tracer3_test.dart
+++ b/tests/compiler/dart2js/list_tracer3_test.dart
@@ -26,7 +26,7 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST, uri);
   asyncTest(() => compiler.run(uri).then((_) {
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
         checkType(String name, type) {
           var element = findElement(compiler, name);
diff --git a/tests/compiler/dart2js/list_tracer_test.dart b/tests/compiler/dart2js/list_tracer_test.dart
index fe1bd17..c407ce8 100644
--- a/tests/compiler/dart2js/list_tracer_test.dart
+++ b/tests/compiler/dart2js/list_tracer_test.dart
@@ -198,8 +198,8 @@
   var compiler = compilerFor(generateTest(allocation), uri,
       expectedErrors: 0, expectedWarnings: 1);
   asyncTest(() => compiler.run(uri).then((_) {
-        var commonMasks = compiler.commonMasks;
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var commonMasks = compiler.closedWorld.commonMasks;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
         checkType(String name, type) {
           var element = findElement(compiler, name);
diff --git a/tests/compiler/dart2js/list_tracer_typed_data_length_test.dart b/tests/compiler/dart2js/list_tracer_typed_data_length_test.dart
index b0dc4fd..ee15963 100644
--- a/tests/compiler/dart2js/list_tracer_typed_data_length_test.dart
+++ b/tests/compiler/dart2js/list_tracer_typed_data_length_test.dart
@@ -29,7 +29,7 @@
   asyncTest(() async {
     CompilationResult result = await runCompiler(memorySourceFiles: TEST);
     Compiler compiler = result.compiler;
-    var typesInferrer = compiler.globalInference.typesInferrer;
+    var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
     checkType(String name, type, length) {
       var element = findElement(compiler, name);
@@ -40,7 +40,7 @@
       Expect.equals(container.length, length);
     }
 
-    checkType('myList', compiler.commonMasks.numType, 42);
-    checkType('myOtherList', compiler.commonMasks.uint31Type, 32);
+    checkType('myList', compiler.closedWorld.commonMasks.numType, 42);
+    checkType('myOtherList', compiler.closedWorld.commonMasks.uint31Type, 32);
   });
 }
diff --git a/tests/compiler/dart2js/map_tracer_const_test.dart b/tests/compiler/dart2js/map_tracer_const_test.dart
index ee20f9f..69d9554 100644
--- a/tests/compiler/dart2js/map_tracer_const_test.dart
+++ b/tests/compiler/dart2js/map_tracer_const_test.dart
@@ -33,8 +33,8 @@
   var compiler = compilerFor(TEST, uri, expectedErrors: 0, expectedWarnings: 0);
   compiler.stopAfterTypeInference = true;
   asyncTest(() => compiler.run(uri).then((_) {
-        var commonMasks = compiler.commonMasks;
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var commonMasks = compiler.closedWorld.commonMasks;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
         var element = findElement(compiler, 'closure');
         var mask = typesInferrer.getReturnTypeOfElement(element);
         Expect.equals(commonMasks.numType, simplify(mask, compiler));
diff --git a/tests/compiler/dart2js/map_tracer_keys_test.dart b/tests/compiler/dart2js/map_tracer_keys_test.dart
index 4516fb3..4394879 100644
--- a/tests/compiler/dart2js/map_tracer_keys_test.dart
+++ b/tests/compiler/dart2js/map_tracer_keys_test.dart
@@ -57,8 +57,8 @@
   var compiler = compilerFor(generateTest(key, value, initial), uri,
       expectedErrors: 0, expectedWarnings: 0);
   asyncTest(() => compiler.run(uri).then((_) {
-        var commonMasks = compiler.commonMasks;
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var commonMasks = compiler.closedWorld.commonMasks;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
         var aDoubleType =
             typesInferrer.getTypeOfElement(findElement(compiler, 'aDouble'));
         var aListType =
diff --git a/tests/compiler/dart2js/map_tracer_test.dart b/tests/compiler/dart2js/map_tracer_test.dart
index 4399798..571450c 100644
--- a/tests/compiler/dart2js/map_tracer_test.dart
+++ b/tests/compiler/dart2js/map_tracer_test.dart
@@ -211,11 +211,11 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(generateTest(allocation), uri,
       expectedErrors: 0, expectedWarnings: 1);
-  var closedWorld = compiler.openWorld.closeWorld();
+  var closedWorld = compiler.openWorld.closeWorld(compiler.reporter);
   asyncTest(() => compiler.run(uri).then((_) {
         var keyType, valueType;
-        var commonMasks = compiler.commonMasks;
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var commonMasks = compiler.closedWorld.commonMasks;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
         var emptyType = new TypeMask.nonNullEmpty();
         var aKeyType =
             typesInferrer.getTypeOfElement(findElement(compiler, 'aKey'));
diff --git a/tests/compiler/dart2js/mirror_final_field_inferrer2_test.dart b/tests/compiler/dart2js/mirror_final_field_inferrer2_test.dart
index 4f109a4..3d5ce6d 100644
--- a/tests/compiler/dart2js/mirror_final_field_inferrer2_test.dart
+++ b/tests/compiler/dart2js/mirror_final_field_inferrer2_test.dart
@@ -28,8 +28,8 @@
     var result = await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES);
     var compiler = result.compiler;
     var element = findElement(compiler, 'field');
-    var commonMasks = compiler.commonMasks;
-    var typesInferrer = compiler.globalInference.typesInferrer;
+    var commonMasks = compiler.closedWorld.commonMasks;
+    var typesInferrer = compiler.globalInference.typesInferrerInternal;
     Expect.equals(commonMasks.uint31Type,
         simplify(typesInferrer.getTypeOfElement(element), compiler), 'field');
   });
diff --git a/tests/compiler/dart2js/mirror_final_field_inferrer_test.dart b/tests/compiler/dart2js/mirror_final_field_inferrer_test.dart
index 31b555d..78ea487 100644
--- a/tests/compiler/dart2js/mirror_final_field_inferrer_test.dart
+++ b/tests/compiler/dart2js/mirror_final_field_inferrer_test.dart
@@ -28,8 +28,8 @@
     var result = await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES);
     var compiler = result.compiler;
     var element = findElement(compiler, 'field');
-    var commonMasks = compiler.commonMasks;
-    var typesInferrer = compiler.globalInference.typesInferrer;
+    var commonMasks = compiler.closedWorld.commonMasks;
+    var typesInferrer = compiler.globalInference.typesInferrerInternal;
     Expect.equals(commonMasks.uint31Type,
         simplify(typesInferrer.getTypeOfElement(element), compiler), 'field');
   });
diff --git a/tests/compiler/dart2js/mirror_tree_shaking_test.dart b/tests/compiler/dart2js/mirror_tree_shaking_test.dart
index 3618c816..744d36e 100644
--- a/tests/compiler/dart2js/mirror_tree_shaking_test.dart
+++ b/tests/compiler/dart2js/mirror_tree_shaking_test.dart
@@ -16,15 +16,18 @@
     CompilationResult result = await runCompiler(
         memorySourceFiles: MEMORY_SOURCE_FILES, diagnosticHandler: collector);
     Compiler compiler = result.compiler;
+    JavaScriptBackend backend = compiler.backend;
     Expect.isTrue(collector.errors.isEmpty);
     Expect.isTrue(collector.infos.isEmpty);
     Expect.isFalse(compiler.compilationFailed);
-    Expect.isFalse(compiler.enqueuer.resolution.hasEnqueuedReflectiveElements);
+    Expect.isFalse(backend
+        .mirrorsAnalysis.resolutionHandler.hasEnqueuedReflectiveElements);
+    Expect.isFalse(backend
+        .mirrorsAnalysis.resolutionHandler.hasEnqueuedReflectiveStaticFields);
     Expect.isFalse(
-        compiler.enqueuer.resolution.hasEnqueuedReflectiveStaticFields);
-    JavaScriptBackend backend = compiler.backend;
-    Expect.isFalse(backend.codegenEnqueuer.hasEnqueuedReflectiveElements);
-    Expect.isFalse(backend.codegenEnqueuer.hasEnqueuedReflectiveStaticFields);
+        backend.mirrorsAnalysis.codegenHandler.hasEnqueuedReflectiveElements);
+    Expect.isFalse(backend
+        .mirrorsAnalysis.codegenHandler.hasEnqueuedReflectiveStaticFields);
     Expect.isFalse(compiler.disableTypeInference);
     Expect.isFalse(backend.hasRetainedMetadata);
   });
diff --git a/tests/compiler/dart2js/mock_libraries.dart b/tests/compiler/dart2js/mock_libraries.dart
index 4ceb375..867bf4d 100644
--- a/tests/compiler/dart2js/mock_libraries.dart
+++ b/tests/compiler/dart2js/mock_libraries.dart
@@ -155,6 +155,9 @@
                                String contextName, var context,
                                var typeArguments) {}''',
   'checkMalformedType': 'checkMalformedType(value, message) {}',
+  'checkInt': 'checkInt(value) {}',
+  'checkNum': 'checkNum(value) {}',
+  'checkString': 'checkString(value) {}',
   'Closure': 'abstract class Closure implements Function { }',
   'closureFromTearOff':
       r'''closureFromTearOff(receiver, functions, reflectionInfo,
diff --git a/tests/compiler/dart2js/needs_no_such_method_test.dart b/tests/compiler/dart2js/needs_no_such_method_test.dart
new file mode 100644
index 0000000..892087e
--- /dev/null
+++ b/tests/compiler/dart2js/needs_no_such_method_test.dart
@@ -0,0 +1,290 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+import 'package:async_helper/async_helper.dart';
+import 'package:expect/expect.dart';
+import 'package:compiler/src/common.dart';
+import 'package:compiler/src/elements/elements.dart'
+    show Element, ClassElement, PublicName;
+import 'package:compiler/src/universe/call_structure.dart';
+import 'package:compiler/src/universe/selector.dart';
+import 'package:compiler/src/world.dart' show ClosedWorld, ClassQuery;
+import 'type_test_helper.dart';
+
+void main() {
+  asyncTest(() async {
+    await testClassSets();
+  });
+}
+
+const String CLASSES = r"""
+class Superclass {
+  foo() {}
+}
+class Subclass extends Superclass {
+  bar() {}
+}
+class Subtype implements Superclass {
+  bar() {}
+}
+""";
+
+testClassSets() async {
+  Selector foo, bar, baz;
+  ClosedWorld closedWorld;
+  ClassElement superclass, subclass, subtype;
+  String testMode;
+
+  Future run(List<String> instantiated) async {
+    StringBuffer main = new StringBuffer();
+    main.write('main() {');
+    for (String cls in instantiated) {
+      main.write('new $cls();');
+    }
+    main.write('}');
+    testMode = '$instantiated';
+
+    var env = await TypeEnvironment.create(CLASSES,
+        mainSource: main.toString(), useMockCompiler: false);
+    foo = new Selector.call(const PublicName('foo'), CallStructure.NO_ARGS);
+    bar = new Selector.call(const PublicName('bar'), CallStructure.NO_ARGS);
+    baz = new Selector.call(const PublicName('baz'), CallStructure.NO_ARGS);
+
+    closedWorld = env.compiler.closedWorld;
+    superclass = env.getElement('Superclass');
+    subclass = env.getElement('Subclass');
+    subtype = env.getElement('Subtype');
+  }
+
+  void check(ClassElement cls, ClassQuery query, Selector selector,
+      bool expectedResult) {
+    bool result = closedWorld.needsNoSuchMethod(cls, selector, query);
+    Expect.equals(
+        expectedResult,
+        result,
+        'Unexpected result for $selector in $cls ($query)'
+        'for instantiations $testMode');
+  }
+
+  await run([]);
+
+  Expect.isFalse(closedWorld.isDirectlyInstantiated(superclass));
+  Expect.isFalse(closedWorld.isIndirectlyInstantiated(superclass));
+  Expect.isFalse(closedWorld.isImplemented(superclass));
+
+  Expect.isFalse(closedWorld.isDirectlyInstantiated(subclass));
+  Expect.isFalse(closedWorld.isIndirectlyInstantiated(subclass));
+  Expect.isFalse(closedWorld.isImplemented(subclass));
+
+  Expect.isFalse(closedWorld.isDirectlyInstantiated(subtype));
+  Expect.isFalse(closedWorld.isIndirectlyInstantiated(subtype));
+  Expect.isFalse(closedWorld.isImplemented(subtype));
+
+  check(superclass, ClassQuery.EXACT, foo, false);
+  check(superclass, ClassQuery.EXACT, bar, false);
+  check(superclass, ClassQuery.EXACT, baz, false);
+  check(superclass, ClassQuery.SUBCLASS, foo, false);
+  check(superclass, ClassQuery.SUBCLASS, bar, false);
+  check(superclass, ClassQuery.SUBCLASS, baz, false);
+  check(superclass, ClassQuery.SUBTYPE, foo, false);
+  check(superclass, ClassQuery.SUBTYPE, bar, false);
+  check(superclass, ClassQuery.SUBTYPE, baz, false);
+
+  check(subclass, ClassQuery.EXACT, foo, false);
+  check(subclass, ClassQuery.EXACT, bar, false);
+  check(subclass, ClassQuery.EXACT, baz, false);
+  check(subclass, ClassQuery.SUBCLASS, foo, false);
+  check(subclass, ClassQuery.SUBCLASS, bar, false);
+  check(subclass, ClassQuery.SUBCLASS, baz, false);
+  check(subclass, ClassQuery.SUBTYPE, foo, false);
+  check(subclass, ClassQuery.SUBTYPE, bar, false);
+  check(subclass, ClassQuery.SUBTYPE, baz, false);
+
+  check(subtype, ClassQuery.EXACT, foo, false);
+  check(subtype, ClassQuery.EXACT, bar, false);
+  check(subtype, ClassQuery.EXACT, baz, false);
+  check(subtype, ClassQuery.SUBCLASS, foo, false);
+  check(subtype, ClassQuery.SUBCLASS, bar, false);
+  check(subtype, ClassQuery.SUBCLASS, baz, false);
+  check(subtype, ClassQuery.SUBTYPE, foo, false);
+  check(subtype, ClassQuery.SUBTYPE, bar, false);
+  check(subtype, ClassQuery.SUBTYPE, baz, false);
+
+  await run(['Superclass']);
+
+  Expect.isTrue(closedWorld.isDirectlyInstantiated(superclass));
+  Expect.isFalse(closedWorld.isIndirectlyInstantiated(superclass));
+  Expect.isTrue(closedWorld.isImplemented(superclass));
+
+  Expect.isFalse(closedWorld.isDirectlyInstantiated(subclass));
+  Expect.isFalse(closedWorld.isIndirectlyInstantiated(subclass));
+  Expect.isFalse(closedWorld.isImplemented(subclass));
+
+  Expect.isFalse(closedWorld.isDirectlyInstantiated(subtype));
+  Expect.isFalse(closedWorld.isIndirectlyInstantiated(subtype));
+  Expect.isFalse(closedWorld.isImplemented(subtype));
+
+  check(superclass, ClassQuery.EXACT, foo, false);
+  check(superclass, ClassQuery.EXACT, bar, true);
+  check(superclass, ClassQuery.EXACT, baz, true);
+  check(superclass, ClassQuery.SUBCLASS, foo, false);
+  check(superclass, ClassQuery.SUBCLASS, bar, true);
+  check(superclass, ClassQuery.SUBCLASS, baz, true);
+  check(superclass, ClassQuery.SUBTYPE, foo, false);
+  check(superclass, ClassQuery.SUBTYPE, bar, true);
+  check(superclass, ClassQuery.SUBTYPE, baz, true);
+
+  check(subclass, ClassQuery.EXACT, foo, false);
+  check(subclass, ClassQuery.EXACT, bar, false);
+  check(subclass, ClassQuery.EXACT, baz, false);
+  check(subclass, ClassQuery.SUBCLASS, foo, false);
+  check(subclass, ClassQuery.SUBCLASS, bar, false);
+  check(subclass, ClassQuery.SUBCLASS, baz, false);
+  check(subclass, ClassQuery.SUBTYPE, foo, false);
+  check(subclass, ClassQuery.SUBTYPE, bar, false);
+  check(subclass, ClassQuery.SUBTYPE, baz, false);
+
+  check(subtype, ClassQuery.EXACT, foo, false);
+  check(subtype, ClassQuery.EXACT, bar, false);
+  check(subtype, ClassQuery.EXACT, baz, false);
+  check(subtype, ClassQuery.SUBCLASS, foo, false);
+  check(subtype, ClassQuery.SUBCLASS, bar, false);
+  check(subtype, ClassQuery.SUBCLASS, baz, false);
+  check(subtype, ClassQuery.SUBTYPE, foo, false);
+  check(subtype, ClassQuery.SUBTYPE, bar, false);
+  check(subtype, ClassQuery.SUBTYPE, baz, false);
+
+  await run(['Subclass']);
+
+  Expect.isFalse(closedWorld.isDirectlyInstantiated(superclass));
+  Expect.isTrue(closedWorld.isIndirectlyInstantiated(superclass));
+  Expect.isTrue(closedWorld.isImplemented(superclass));
+
+  Expect.isTrue(closedWorld.isDirectlyInstantiated(subclass));
+  Expect.isFalse(closedWorld.isIndirectlyInstantiated(subclass));
+  Expect.isTrue(closedWorld.isImplemented(subclass));
+
+  Expect.isFalse(closedWorld.isDirectlyInstantiated(subtype));
+  Expect.isFalse(closedWorld.isIndirectlyInstantiated(subtype));
+  Expect.isFalse(closedWorld.isImplemented(subtype));
+
+  check(superclass, ClassQuery.EXACT, foo, false);
+  check(superclass, ClassQuery.EXACT, bar, false);
+  check(superclass, ClassQuery.EXACT, baz, false);
+  check(superclass, ClassQuery.SUBCLASS, foo, false);
+  check(superclass, ClassQuery.SUBCLASS, bar, false);
+  check(superclass, ClassQuery.SUBCLASS, baz, true);
+  check(superclass, ClassQuery.SUBTYPE, foo, false);
+  check(superclass, ClassQuery.SUBTYPE, bar, false);
+  check(superclass, ClassQuery.SUBTYPE, baz, true);
+
+  check(subclass, ClassQuery.EXACT, foo, false);
+  check(subclass, ClassQuery.EXACT, bar, false);
+  check(subclass, ClassQuery.EXACT, baz, true);
+  check(subclass, ClassQuery.SUBCLASS, foo, false);
+  check(subclass, ClassQuery.SUBCLASS, bar, false);
+  check(subclass, ClassQuery.SUBCLASS, baz, true);
+  check(subclass, ClassQuery.SUBTYPE, foo, false);
+  check(subclass, ClassQuery.SUBTYPE, bar, false);
+  check(subclass, ClassQuery.SUBTYPE, baz, true);
+
+  check(subtype, ClassQuery.EXACT, foo, false);
+  check(subtype, ClassQuery.EXACT, bar, false);
+  check(subtype, ClassQuery.EXACT, baz, false);
+  check(subtype, ClassQuery.SUBCLASS, foo, false);
+  check(subtype, ClassQuery.SUBCLASS, bar, false);
+  check(subtype, ClassQuery.SUBCLASS, baz, false);
+  check(subtype, ClassQuery.SUBTYPE, foo, false);
+  check(subtype, ClassQuery.SUBTYPE, bar, false);
+  check(subtype, ClassQuery.SUBTYPE, baz, false);
+
+  await run(['Subtype']);
+
+  Expect.isFalse(closedWorld.isDirectlyInstantiated(superclass));
+  Expect.isFalse(closedWorld.isIndirectlyInstantiated(superclass));
+  Expect.isTrue(closedWorld.isImplemented(superclass));
+
+  Expect.isFalse(closedWorld.isDirectlyInstantiated(subclass));
+  Expect.isFalse(closedWorld.isIndirectlyInstantiated(subclass));
+  Expect.isFalse(closedWorld.isImplemented(subclass));
+
+  Expect.isTrue(closedWorld.isDirectlyInstantiated(subtype));
+  Expect.isFalse(closedWorld.isIndirectlyInstantiated(subtype));
+  Expect.isTrue(closedWorld.isImplemented(subtype));
+
+  check(superclass, ClassQuery.EXACT, foo, false);
+  check(superclass, ClassQuery.EXACT, bar, false);
+  check(superclass, ClassQuery.EXACT, baz, false);
+  check(superclass, ClassQuery.SUBCLASS, foo, false);
+  check(superclass, ClassQuery.SUBCLASS, bar, false);
+  check(superclass, ClassQuery.SUBCLASS, baz, false);
+  check(superclass, ClassQuery.SUBTYPE, foo, true);
+  check(superclass, ClassQuery.SUBTYPE, bar, false);
+  check(superclass, ClassQuery.SUBTYPE, baz, true);
+
+  check(subclass, ClassQuery.EXACT, foo, false);
+  check(subclass, ClassQuery.EXACT, bar, false);
+  check(subclass, ClassQuery.EXACT, baz, false);
+  check(subclass, ClassQuery.SUBCLASS, foo, false);
+  check(subclass, ClassQuery.SUBCLASS, bar, false);
+  check(subclass, ClassQuery.SUBCLASS, baz, false);
+  check(subclass, ClassQuery.SUBTYPE, foo, false);
+  check(subclass, ClassQuery.SUBTYPE, bar, false);
+  check(subclass, ClassQuery.SUBTYPE, baz, false);
+
+  check(subtype, ClassQuery.EXACT, foo, true);
+  check(subtype, ClassQuery.EXACT, bar, false);
+  check(subtype, ClassQuery.EXACT, baz, true);
+  check(subtype, ClassQuery.SUBCLASS, foo, true);
+  check(subtype, ClassQuery.SUBCLASS, bar, false);
+  check(subtype, ClassQuery.SUBCLASS, baz, true);
+  check(subtype, ClassQuery.SUBTYPE, foo, true);
+  check(subtype, ClassQuery.SUBTYPE, bar, false);
+  check(subtype, ClassQuery.SUBTYPE, baz, true);
+
+  await run(['Subclass', 'Subtype']);
+
+  Expect.isFalse(closedWorld.isDirectlyInstantiated(superclass));
+  Expect.isTrue(closedWorld.isIndirectlyInstantiated(superclass));
+  Expect.isTrue(closedWorld.isImplemented(superclass));
+
+  Expect.isTrue(closedWorld.isDirectlyInstantiated(subclass));
+  Expect.isFalse(closedWorld.isIndirectlyInstantiated(subclass));
+  Expect.isTrue(closedWorld.isImplemented(subclass));
+
+  Expect.isTrue(closedWorld.isDirectlyInstantiated(subtype));
+  Expect.isFalse(closedWorld.isIndirectlyInstantiated(subtype));
+  Expect.isTrue(closedWorld.isImplemented(subtype));
+
+  check(superclass, ClassQuery.EXACT, foo, false);
+  check(superclass, ClassQuery.EXACT, bar, false);
+  check(superclass, ClassQuery.EXACT, baz, false);
+  check(superclass, ClassQuery.SUBCLASS, foo, false);
+  check(superclass, ClassQuery.SUBCLASS, bar, false);
+  check(superclass, ClassQuery.SUBCLASS, baz, true);
+  check(superclass, ClassQuery.SUBTYPE, foo, true);
+  check(superclass, ClassQuery.SUBTYPE, bar, false);
+  check(superclass, ClassQuery.SUBTYPE, baz, true);
+
+  check(subclass, ClassQuery.EXACT, foo, false);
+  check(subclass, ClassQuery.EXACT, bar, false);
+  check(subclass, ClassQuery.EXACT, baz, true);
+  check(subclass, ClassQuery.SUBCLASS, foo, false);
+  check(subclass, ClassQuery.SUBCLASS, bar, false);
+  check(subclass, ClassQuery.SUBCLASS, baz, true);
+  check(subclass, ClassQuery.SUBTYPE, foo, false);
+  check(subclass, ClassQuery.SUBTYPE, bar, false);
+  check(subclass, ClassQuery.SUBTYPE, baz, true);
+
+  check(subtype, ClassQuery.EXACT, foo, true);
+  check(subtype, ClassQuery.EXACT, bar, false);
+  check(subtype, ClassQuery.EXACT, baz, true);
+  check(subtype, ClassQuery.SUBCLASS, foo, true);
+  check(subtype, ClassQuery.SUBCLASS, bar, false);
+  check(subtype, ClassQuery.SUBCLASS, baz, true);
+  check(subtype, ClassQuery.SUBTYPE, foo, true);
+  check(subtype, ClassQuery.SUBTYPE, bar, false);
+  check(subtype, ClassQuery.SUBTYPE, baz, true);
+}
diff --git a/tests/compiler/dart2js/options_helper.dart b/tests/compiler/dart2js/options_helper.dart
index 5df9c08..ec63774 100644
--- a/tests/compiler/dart2js/options_helper.dart
+++ b/tests/compiler/dart2js/options_helper.dart
@@ -18,7 +18,3 @@
   bool get hidePackageWarnings => true;
   bool showPackageWarningsFor(Uri uri) => false;
 }
-
-class MockParserOptions implements ParserOptions {
-  bool get enableGenericMethodSyntax => true;
-}
diff --git a/tests/compiler/dart2js/parser_helper.dart b/tests/compiler/dart2js/parser_helper.dart
index 4ed194b..36472bb 100644
--- a/tests/compiler/dart2js/parser_helper.dart
+++ b/tests/compiler/dart2js/parser_helper.dart
@@ -105,7 +105,7 @@
       new ScannerOptions(canUseNative: true),
       reporter,
       library.entryCompilationUnit);
-  Parser parser = new Parser(listener, new MockParserOptions());
+  Parser parser = new Parser(listener);
   Token endToken = parseMethod(parser, tokens);
   assert(endToken.kind == EOF_TOKEN);
   Node node = listener.popNode();
@@ -150,7 +150,7 @@
       reporter,
       unit,
       new IdGenerator());
-  PartialParser parser = new PartialParser(listener, new MockParserOptions());
+  PartialParser parser = new PartialParser(listener);
   reporter.withCurrentElement(unit, () => parser.parseUnit(tokens));
   return unit.localMembers;
 }
diff --git a/tests/compiler/dart2js/partial_parser_test.dart b/tests/compiler/dart2js/partial_parser_test.dart
index b1c4d3b..8cf82ae 100644
--- a/tests/compiler/dart2js/partial_parser_test.dart
+++ b/tests/compiler/dart2js/partial_parser_test.dart
@@ -12,7 +12,7 @@
 
 void testSkipExpression() {
   PartialParser parser =
-      new PartialParser(new Listener(), new MockParserOptions());
+      new PartialParser(new Listener());
   Token token = scan('a < b;');
   token = parser.skipExpression(token);
   Expect.equals(';', token.value);
diff --git a/tests/compiler/dart2js/patch_test.dart b/tests/compiler/dart2js/patch_test.dart
index f12c2b2..95ee5c3 100644
--- a/tests/compiler/dart2js/patch_test.dart
+++ b/tests/compiler/dart2js/patch_test.dart
@@ -200,7 +200,7 @@
         Expect.equals(patchText, patch.node.toString());
       }
 
-      compiler.analyzeElement(origin);
+      compiler.resolution.computeWorldImpact(origin);
       compiler.enqueuer.resolution.emptyDeferredQueueForTesting();
 
       DiagnosticCollector collector = compiler.diagnosticCollector;
@@ -920,7 +920,7 @@
       """,
       runCompiler: true,
       analyzeOnly: true);
-  ClosedWorld world = compiler.openWorld.closeWorld();
+  ClosedWorld world = compiler.openWorld.closeWorld(compiler.reporter);
 
   ClassElement cls = ensure(
       compiler, "A", compiler.commonElements.coreLibrary.find,
diff --git a/tests/compiler/dart2js/related_types.dart b/tests/compiler/dart2js/related_types.dart
index 09b28ea..a2516f7 100644
--- a/tests/compiler/dart2js/related_types.dart
+++ b/tests/compiler/dart2js/related_types.dart
@@ -35,7 +35,7 @@
 
 /// Check all loaded libraries in [compiler] for unrelated types.
 void checkRelatedTypes(Compiler compiler) {
-  compiler.openWorld.closeWorld();
+  compiler.openWorld.closeWorld(compiler.reporter);
   for (LibraryElement library in compiler.libraryLoader.libraries) {
     checkLibraryElement(compiler, library);
   }
diff --git a/tests/compiler/dart2js/related_types_test.dart b/tests/compiler/dart2js/related_types_test.dart
index 38449bc..6711fb2 100644
--- a/tests/compiler/dart2js/related_types_test.dart
+++ b/tests/compiler/dart2js/related_types_test.dart
@@ -267,7 +267,7 @@
     Expect.isFalse(
         collector.hasRegularMessages, "Unexpected analysis messages.");
     Compiler compiler = result.compiler;
-    compiler.openWorld.closeWorld();
+    compiler.openWorld.closeWorld(compiler.reporter);
 
     void checkMember(MemberElement member) {
       if (!member.name.startsWith('test_')) return;
diff --git a/tests/compiler/dart2js/resolver_test.dart b/tests/compiler/dart2js/resolver_test.dart
index 8d1ec64..7be75ef1 100644
--- a/tests/compiler/dart2js/resolver_test.dart
+++ b/tests/compiler/dart2js/resolver_test.dart
@@ -16,6 +16,8 @@
 import 'package:compiler/src/resolution/resolution_result.dart';
 import 'package:compiler/src/resolution/scope.dart';
 import 'package:compiler/src/resolution/tree_elements.dart';
+import 'package:compiler/src/universe/use.dart';
+import 'package:compiler/src/universe/world_impact.dart';
 
 import 'compiler_helper.dart';
 import 'link_helper.dart';
@@ -241,7 +243,9 @@
     compiler.resolveStatement("Foo foo;");
     ClassElement fooElement = compiler.mainApp.find("Foo");
     FunctionElement funElement = fooElement.lookupLocalMember("foo");
-    compiler.processQueue(compiler.enqueuer.resolution, funElement);
+    compiler.enqueuer.resolution.applyImpact(new WorldImpactBuilderImpl()
+      ..registerStaticUse(new StaticUse.foreignUse(funElement)));
+    compiler.processQueue(compiler.enqueuer.resolution, null);
     DiagnosticCollector collector = compiler.diagnosticCollector;
     Expect.equals(0, collector.warnings.length);
     Expect.equals(1, collector.errors.length);
diff --git a/tests/compiler/dart2js/serialization/helper.dart b/tests/compiler/dart2js/serialization/helper.dart
index cd6ecb2..7fab60f 100644
--- a/tests/compiler/dart2js/serialization/helper.dart
+++ b/tests/compiler/dart2js/serialization/helper.dart
@@ -11,6 +11,7 @@
 import 'package:compiler/src/common/names.dart';
 import 'package:compiler/src/compiler.dart';
 import 'package:compiler/src/elements/elements.dart';
+import 'package:compiler/src/filenames.dart';
 
 import '../memory_compiler.dart';
 import 'test_data.dart';
@@ -71,6 +72,13 @@
         saveSerializedData: saveSerializedData);
   }
 
+  Uri get uri {
+    if (filename != null) {
+      return Uri.base.resolve(nativeToUriPath(filename));
+    }
+    return null;
+  }
+
   Future forEachTest(SerializedData serializedData, List<Test> tests,
       TestFunction testFunction) async {
     Uri entryPoint = Uri.parse('memory:main.dart');
diff --git a/tests/compiler/dart2js/serialization/model_test_helper.dart b/tests/compiler/dart2js/serialization/model_test_helper.dart
index 90cde97..e3e6614 100644
--- a/tests/compiler/dart2js/serialization/model_test_helper.dart
+++ b/tests/compiler/dart2js/serialization/model_test_helper.dart
@@ -13,13 +13,18 @@
 import 'package:compiler/src/common.dart';
 import 'package:compiler/src/constants/values.dart';
 import 'package:compiler/src/compiler.dart';
+import 'package:compiler/src/dart_types.dart';
 import 'package:compiler/src/deferred_load.dart';
 import 'package:compiler/src/elements/elements.dart';
+import 'package:compiler/src/enqueue.dart';
 import 'package:compiler/src/filenames.dart';
 import 'package:compiler/src/js_backend/js_backend.dart';
 import 'package:compiler/src/serialization/equivalence.dart';
 import 'package:compiler/src/tree/nodes.dart';
 import 'package:compiler/src/universe/class_set.dart';
+import 'package:compiler/src/universe/world_builder.dart';
+import 'package:compiler/src/util/enumset.dart';
+import 'package:compiler/src/world.dart' show ClosedWorld;
 import '../memory_compiler.dart';
 import 'helper.dart';
 import 'test_data.dart';
@@ -36,8 +41,8 @@
     Arguments arguments = new Arguments.from(args);
     SerializedData serializedData =
         await serializeDartCore(arguments: arguments);
-    if (arguments.filename != null) {
-      Uri entryPoint = Uri.base.resolve(nativeToUriPath(arguments.filename));
+    if (arguments.uri != null) {
+      Uri entryPoint = arguments.uri;
       SerializationResult result =
           await measure('${entryPoint}', 'serialize', () {
         return serialize(entryPoint,
@@ -72,11 +77,7 @@
         memorySourceFiles: sourceFiles, options: [Flags.analyzeOnly]);
     compilerNormal.resolution.retainCachesForTesting = true;
     await compilerNormal.run(entryPoint);
-    compilerNormal.phase = Compiler.PHASE_DONE_RESOLVING;
-    compilerNormal.openWorld.closeWorld();
-    compilerNormal.backend.onResolutionComplete();
-    compilerNormal.deferredLoadTask
-        .onResolutionComplete(compilerNormal.mainFunction);
+    compilerNormal.closeResolution();
     return compilerNormal;
   });
 
@@ -88,122 +89,147 @@
         options: [Flags.analyzeOnly]);
     compilerDeserialized.resolution.retainCachesForTesting = true;
     await compilerDeserialized.run(entryPoint);
-    compilerDeserialized.phase = Compiler.PHASE_DONE_RESOLVING;
-    compilerDeserialized.openWorld.closeWorld();
-    compilerDeserialized.backend.onResolutionComplete();
-    compilerDeserialized.deferredLoadTask
-        .onResolutionComplete(compilerDeserialized.mainFunction);
+    compilerDeserialized.closeResolution();
     return compilerDeserialized;
   });
 
   return measure(title, 'check models', () async {
     checkAllImpacts(compilerNormal, compilerDeserialized, verbose: verbose);
-
-    checkSets(
-        compilerNormal.resolverWorld.directlyInstantiatedClasses,
-        compilerDeserialized.resolverWorld.directlyInstantiatedClasses,
-        "Directly instantiated classes mismatch",
-        areElementsEquivalent,
+    checkResolutionEnqueuers(compilerNormal.enqueuer.resolution,
+        compilerDeserialized.enqueuer.resolution,
         verbose: verbose);
-
-    checkSets(
-        compilerNormal.resolverWorld.instantiatedTypes,
-        compilerDeserialized.resolverWorld.instantiatedTypes,
-        "Instantiated types mismatch",
-        areTypesEquivalent,
+    checkClosedWorlds(
+        compilerNormal.closedWorld, compilerDeserialized.closedWorld,
         verbose: verbose);
+    checkBackendInfo(compilerNormal, compilerDeserialized, verbose: verbose);
+  });
+}
 
-    checkSets(
-        compilerNormal.resolverWorld.isChecks,
-        compilerDeserialized.resolverWorld.isChecks,
-        "Is-check mismatch",
-        areTypesEquivalent,
-        verbose: verbose);
+void checkResolutionEnqueuers(
+    ResolutionEnqueuer enqueuer1, ResolutionEnqueuer enqueuer2,
+    {bool typeEquivalence(DartType a, DartType b): areTypesEquivalent,
+    bool elementFilter(Element element),
+    bool verbose: false}) {
+  checkSets(enqueuer1.processedElements, enqueuer2.processedElements,
+      "Processed element mismatch", areElementsEquivalent,
+      elementFilter: elementFilter, verbose: verbose);
 
-    checkSets(
-        compilerNormal.enqueuer.resolution.processedElements,
-        compilerDeserialized.enqueuer.resolution.processedElements,
-        "Processed element mismatch",
-        areElementsEquivalent, onSameElement: (a, b) {
-      checkElements(compilerNormal, compilerDeserialized, a, b,
-          verbose: verbose);
-    }, verbose: verbose);
+  ResolutionWorldBuilderImpl worldBuilder1 = enqueuer1.universe;
+  ResolutionWorldBuilderImpl worldBuilder2 = enqueuer2.universe;
 
-    checkClassHierarchyNodes(
-        compilerNormal,
-        compilerDeserialized,
-        compilerNormal.closedWorld
-            .getClassHierarchyNode(compilerNormal.coreClasses.objectClass),
-        compilerDeserialized.closedWorld.getClassHierarchyNode(
-            compilerDeserialized.coreClasses.objectClass),
-        verbose: verbose);
+  checkMaps(
+      worldBuilder1.getInstantiationMap(),
+      worldBuilder2.getInstantiationMap(),
+      "Instantiated classes mismatch",
+      areElementsEquivalent,
+      (a, b) => areInstantiationInfosEquivalent(a, b, typeEquivalence),
+      verbose: verbose);
 
-    Expect.equals(
-        compilerNormal.enabledInvokeOn,
-        compilerDeserialized.enabledInvokeOn,
-        "Compiler.enabledInvokeOn mismatch");
-    Expect.equals(
-        compilerNormal.enabledFunctionApply,
-        compilerDeserialized.enabledFunctionApply,
-        "Compiler.enabledFunctionApply mismatch");
-    Expect.equals(
-        compilerNormal.enabledRuntimeType,
-        compilerDeserialized.enabledRuntimeType,
-        "Compiler.enabledRuntimeType mismatch");
-    Expect.equals(
-        compilerNormal.hasIsolateSupport,
-        compilerDeserialized.hasIsolateSupport,
-        "Compiler.hasIsolateSupport mismatch");
-    Expect.equals(
-        compilerNormal.deferredLoadTask.isProgramSplit,
-        compilerDeserialized.deferredLoadTask.isProgramSplit,
-        "isProgramSplit mismatch");
+  checkSets(
+      enqueuer1.universe.directlyInstantiatedClasses,
+      enqueuer2.universe.directlyInstantiatedClasses,
+      "Directly instantiated classes mismatch",
+      areElementsEquivalent,
+      verbose: verbose);
 
-    Map<ConstantValue, OutputUnit> constants1 =
-        compilerNormal.deferredLoadTask.outputUnitForConstantsForTesting;
-    Map<ConstantValue, OutputUnit> constants2 =
-        compilerDeserialized.deferredLoadTask.outputUnitForConstantsForTesting;
-    checkSets(
-        constants1.keys,
-        constants2.keys,
-        'deferredLoadTask._outputUnitForConstants.keys',
-        areConstantValuesEquivalent,
-        failOnUnfound: false,
-        failOnExtra: false,
-        onSameElement: (ConstantValue value1, ConstantValue value2) {
-      OutputUnit outputUnit1 = constants1[value1];
-      OutputUnit outputUnit2 = constants2[value2];
-      checkOutputUnits(
-          outputUnit1,
-          outputUnit2,
-          'for ${value1.toStructuredText()} '
-          'vs ${value2.toStructuredText()}');
-    }, onUnfoundElement: (ConstantValue value1) {
-      OutputUnit outputUnit1 = constants1[value1];
-      Expect.isTrue(outputUnit1.isMainOutput,
-          "Missing deferred constant: ${value1.toStructuredText()}");
-    }, onExtraElement: (ConstantValue value2) {
-      OutputUnit outputUnit2 = constants2[value2];
-      Expect.isTrue(outputUnit2.isMainOutput,
-          "Extra deferred constant: ${value2.toStructuredText()}");
-    }, elementToString: (a) {
-      return '${a.toStructuredText()} -> ${constants1[a]}/${constants2[a]}';
-    });
+  checkSets(
+      enqueuer1.universe.instantiatedTypes,
+      enqueuer2.universe.instantiatedTypes,
+      "Instantiated types mismatch",
+      typeEquivalence,
+      verbose: verbose);
+
+  checkSets(enqueuer1.universe.isChecks, enqueuer2.universe.isChecks,
+      "Is-check mismatch", typeEquivalence,
+      verbose: verbose);
+
+  JavaScriptBackend backend1 = enqueuer1.backend;
+  JavaScriptBackend backend2 = enqueuer2.backend;
+  Expect.equals(backend1.hasInvokeOnSupport, backend2.hasInvokeOnSupport,
+      "Compiler.enabledInvokeOn mismatch");
+  Expect.equals(
+      enqueuer1.universe.hasFunctionApplySupport,
+      enqueuer2.universe.hasFunctionApplySupport,
+      "ResolutionEnqueuer.universe.hasFunctionApplySupport mismatch");
+  Expect.equals(
+      enqueuer1.universe.hasRuntimeTypeSupport,
+      enqueuer2.universe.hasRuntimeTypeSupport,
+      "ResolutionEnqueuer.universe.hasRuntimeTypeSupport mismatch");
+  Expect.equals(
+      enqueuer1.universe.hasIsolateSupport,
+      enqueuer2.universe.hasIsolateSupport,
+      "ResolutionEnqueuer.universe.hasIsolateSupport mismatch");
+}
+
+void checkClosedWorlds(ClosedWorld closedWorld1, ClosedWorld closedWorld2,
+    {bool verbose: false}) {
+  checkClassHierarchyNodes(
+      closedWorld1,
+      closedWorld2,
+      closedWorld1.getClassHierarchyNode(closedWorld1.coreClasses.objectClass),
+      closedWorld2.getClassHierarchyNode(closedWorld2.coreClasses.objectClass),
+      verbose: verbose);
+}
+
+void checkBackendInfo(Compiler compilerNormal, Compiler compilerDeserialized,
+    {bool verbose: false}) {
+  checkSets(
+      compilerNormal.enqueuer.resolution.processedElements,
+      compilerDeserialized.enqueuer.resolution.processedElements,
+      "Processed element mismatch",
+      areElementsEquivalent, onSameElement: (a, b) {
+    checkElements(compilerNormal, compilerDeserialized, a, b, verbose: verbose);
+  }, verbose: verbose);
+  Expect.equals(
+      compilerNormal.deferredLoadTask.isProgramSplit,
+      compilerDeserialized.deferredLoadTask.isProgramSplit,
+      "isProgramSplit mismatch");
+
+  Map<ConstantValue, OutputUnit> constants1 =
+      compilerNormal.deferredLoadTask.outputUnitForConstantsForTesting;
+  Map<ConstantValue, OutputUnit> constants2 =
+      compilerDeserialized.deferredLoadTask.outputUnitForConstantsForTesting;
+  checkSets(
+      constants1.keys,
+      constants2.keys,
+      'deferredLoadTask._outputUnitForConstants.keys',
+      areConstantValuesEquivalent,
+      failOnUnfound: false,
+      failOnExtra: false,
+      onSameElement: (ConstantValue value1, ConstantValue value2) {
+    OutputUnit outputUnit1 = constants1[value1];
+    OutputUnit outputUnit2 = constants2[value2];
+    checkOutputUnits(
+        outputUnit1,
+        outputUnit2,
+        'for ${value1.toStructuredText()} '
+        'vs ${value2.toStructuredText()}');
+  }, onUnfoundElement: (ConstantValue value1) {
+    OutputUnit outputUnit1 = constants1[value1];
+    Expect.isTrue(outputUnit1.isMainOutput,
+        "Missing deferred constant: ${value1.toStructuredText()}");
+  }, onExtraElement: (ConstantValue value2) {
+    OutputUnit outputUnit2 = constants2[value2];
+    Expect.isTrue(outputUnit2.isMainOutput,
+        "Extra deferred constant: ${value2.toStructuredText()}");
+  }, elementToString: (a) {
+    return '${a.toStructuredText()} -> ${constants1[a]}/${constants2[a]}';
   });
 }
 
 void checkElements(
     Compiler compiler1, Compiler compiler2, Element element1, Element element2,
     {bool verbose: false}) {
+  if (element1.isAbstract) return;
   if (element1.isFunction ||
       element1.isConstructor ||
       (element1.isField && element1.isInstanceMember)) {
     AstElement astElement1 = element1;
     AstElement astElement2 = element2;
     ClosureClassMap closureData1 = compiler1.closureToClassMapper
-        .computeClosureToClassMapping(astElement1.resolvedAst);
+        .getClosureToClassMapping(astElement1.resolvedAst);
     ClosureClassMap closureData2 = compiler2.closureToClassMapper
-        .computeClosureToClassMapping(astElement2.resolvedAst);
+        .getClosureToClassMapping(astElement2.resolvedAst);
 
     checkElementIdentities(
         closureData1,
@@ -267,19 +293,19 @@
   checkElementOutputUnits(compiler1, compiler2, element1, element2);
 }
 
-void checkMixinUses(Compiler compiler1, Compiler compiler2, ClassElement class1,
-    ClassElement class2,
+void checkMixinUses(ClosedWorld closedWorld1, ClosedWorld closedWorld2,
+    ClassElement class1, ClassElement class2,
     {bool verbose: false}) {
-  checkSets(
-      compiler1.closedWorld.mixinUsesOf(class1),
-      compiler2.closedWorld.mixinUsesOf(class2),
-      "Mixin uses of $class1 vs $class2",
-      areElementsEquivalent,
+  checkSets(closedWorld1.mixinUsesOf(class1), closedWorld2.mixinUsesOf(class2),
+      "Mixin uses of $class1 vs $class2", areElementsEquivalent,
       verbose: verbose);
 }
 
-void checkClassHierarchyNodes(Compiler compiler1, Compiler compiler2,
-    ClassHierarchyNode node1, ClassHierarchyNode node2,
+void checkClassHierarchyNodes(
+    ClosedWorld closedWorld1,
+    ClosedWorld closedWorld2,
+    ClassHierarchyNode node1,
+    ClassHierarchyNode node2,
     {bool verbose: false}) {
   if (verbose) {
     print('Checking $node1 vs $node2');
@@ -302,7 +328,7 @@
     bool found = false;
     for (ClassHierarchyNode other in node2.directSubclasses) {
       if (areElementsEquivalent(child.cls, other.cls)) {
-        checkClassHierarchyNodes(compiler1, compiler2, child, other,
+        checkClassHierarchyNodes(closedWorld1, closedWorld2, child, other,
             verbose: verbose);
         found = true;
         break;
@@ -312,10 +338,10 @@
       if (child.isInstantiated) {
         print('Missing subclass ${child.cls} of ${node1.cls} '
             'in ${node2.directSubclasses}');
-        print(compiler1.closedWorld
-            .dump(verbose ? compiler1.coreClasses.objectClass : node1.cls));
-        print(compiler2.closedWorld
-            .dump(verbose ? compiler2.coreClasses.objectClass : node2.cls));
+        print(closedWorld1
+            .dump(verbose ? closedWorld1.coreClasses.objectClass : node1.cls));
+        print(closedWorld2
+            .dump(verbose ? closedWorld2.coreClasses.objectClass : node2.cls));
       }
       Expect.isFalse(
           child.isInstantiated,
@@ -323,7 +349,8 @@
           '${node2.directSubclasses}');
     }
   }
-  checkMixinUses(compiler1, compiler2, node1.cls, node2.cls, verbose: verbose);
+  checkMixinUses(closedWorld1, closedWorld2, node1.cls, node2.cls,
+      verbose: verbose);
 }
 
 bool areLocalsEquivalent(Local a, Local b) {
@@ -398,3 +425,23 @@
       outputUnit2.imports,
       (a, b) => areElementsEquivalent(a.declaration, b.declaration));
 }
+
+bool areInstantiationInfosEquivalent(InstantiationInfo info1,
+    InstantiationInfo info2, bool typeEquivalence(DartType a, DartType b)) {
+  checkMaps(
+      info1.instantiationMap,
+      info2.instantiationMap,
+      'instantiationMap of\n   '
+      '${info1.instantiationMap}\nvs ${info2.instantiationMap}',
+      areElementsEquivalent,
+      (a, b) => areSetsEquivalent(
+          a, b, (a, b) => areInstancesEquivalent(a, b, typeEquivalence)));
+  return true;
+}
+
+bool areInstancesEquivalent(Instance instance1, Instance instance2,
+    bool typeEquivalence(DartType a, DartType b)) {
+  return typeEquivalence(instance1.type, instance2.type) &&
+      instance1.kind == instance2.kind &&
+      instance1.isRedirection == instance2.isRedirection;
+}
diff --git a/tests/compiler/dart2js/serialization/test_helper.dart b/tests/compiler/dart2js/serialization/test_helper.dart
index f081bbd..1808b7f 100644
--- a/tests/compiler/dart2js/serialization/test_helper.dart
+++ b/tests/compiler/dart2js/serialization/test_helper.dart
@@ -208,18 +208,20 @@
   // set.difference would work)
   Set remaining = set2.toSet();
   for (var element1 in set1) {
+    bool found = false;
     var correspondingElement;
     for (var element2 in remaining) {
       if (sameElement(element1, element2)) {
         if (checkElements != null) {
           checkElements(element1, element2);
         }
+        found = true;
         correspondingElement = element2;
         remaining.remove(element2);
         break;
       }
     }
-    if (correspondingElement != null) {
+    if (found) {
       common.add([element1, correspondingElement]);
     } else {
       unfound.add(element1);
@@ -474,7 +476,17 @@
     void onSameElement(a, b),
     void onUnfoundElement(a),
     void onExtraElement(b),
+    bool elementFilter(element),
+    elementConverter(element),
     String elementToString(key): defaultToString}) {
+  if (elementFilter != null) {
+    set1 = set1.where(elementFilter);
+    set2 = set2.where(elementFilter);
+  }
+  if (elementConverter != null) {
+    set1 = set1.map(elementConverter);
+    set2 = set2.map(elementConverter);
+  }
   List<List> common = <List>[];
   List unfound = [];
   Set remaining = computeSetDifference(set1, set2, common, unfound,
diff --git a/tests/compiler/dart2js/simple_inferrer_and_or_test.dart b/tests/compiler/dart2js/simple_inferrer_and_or_test.dart
index ac2e682..2c81edc 100644
--- a/tests/compiler/dart2js/simple_inferrer_and_or_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_and_or_test.dart
@@ -96,7 +96,7 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST, uri);
   asyncTest(() => compiler.run(uri).then((_) {
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
         checkReturn(String name, type) {
           var element = findElement(compiler, name);
@@ -112,16 +112,17 @@
         checkReturn('returnDyn1', subclassOfInterceptor);
         checkReturn('returnDyn2', subclassOfInterceptor);
         checkReturn('returnDyn3', subclassOfInterceptor);
-        checkReturn(
-            'returnDyn4', compiler.commonMasks.dynamicType.nonNullable());
-        checkReturn(
-            'returnDyn5', compiler.commonMasks.dynamicType.nonNullable());
-        checkReturn(
-            'returnDyn6', compiler.commonMasks.dynamicType.nonNullable());
+        checkReturn('returnDyn4',
+            compiler.closedWorld.commonMasks.dynamicType.nonNullable());
+        checkReturn('returnDyn5',
+            compiler.closedWorld.commonMasks.dynamicType.nonNullable());
+        checkReturn('returnDyn6',
+            compiler.closedWorld.commonMasks.dynamicType.nonNullable());
         checkReturn('returnDyn7', subclassOfInterceptor);
         checkReturn('returnDyn7b', subclassOfInterceptor);
         checkReturn('returnDyn8', subclassOfInterceptor);
         checkReturn('returnDyn9', subclassOfInterceptor);
-        checkReturn('returnString', compiler.commonMasks.stringType);
+        checkReturn(
+            'returnString', compiler.closedWorld.commonMasks.stringType);
       }));
 }
diff --git a/tests/compiler/dart2js/simple_inferrer_callers_test.dart b/tests/compiler/dart2js/simple_inferrer_callers_test.dart
index 85b537e..41b9457 100644
--- a/tests/compiler/dart2js/simple_inferrer_callers_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_callers_test.dart
@@ -35,10 +35,13 @@
 
 void main() {
   Uri uri = new Uri(scheme: 'source');
-  var compiler = compilerFor(TEST, uri);
-  var inferrer = new MyInferrer(compiler, compiler.commonMasks);
-  compiler.globalInference.typesInferrer = inferrer;
+  var compiler = compilerFor(TEST, uri, analyzeOnly: true);
   asyncTest(() => compiler.run(uri).then((_) {
+        compiler.closeResolution();
+        var inferrer =
+            new MyInferrer(compiler, compiler.closedWorld.commonMasks);
+        compiler.globalInference.typesInferrerInternal = inferrer;
+        compiler.globalInference.runGlobalTypeInference(compiler.mainFunction);
         var mainElement = findElement(compiler, 'main');
         var classA = findElement(compiler, 'A');
         var fieldA = classA.lookupLocalMember('field');
diff --git a/tests/compiler/dart2js/simple_inferrer_closure_test.dart b/tests/compiler/dart2js/simple_inferrer_closure_test.dart
index 5a12baa..109f197 100644
--- a/tests/compiler/dart2js/simple_inferrer_closure_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_closure_test.dart
@@ -118,7 +118,7 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST, uri);
   asyncTest(() => compiler.run(uri).then((_) {
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
         checkReturn(String name, type) {
           var element = findElement(compiler, name);
@@ -128,20 +128,20 @@
               name);
         }
 
-        checkReturn('returnInt1', compiler.commonMasks.uint31Type);
-        checkReturn('returnInt2', compiler.commonMasks.uint31Type);
-        checkReturn('returnInt3', compiler.commonMasks.uint31Type);
-        checkReturn('returnInt4', compiler.commonMasks.uint31Type);
-        checkReturn(
-            'returnIntOrNull', compiler.commonMasks.uint31Type.nullable());
+        checkReturn('returnInt1', compiler.closedWorld.commonMasks.uint31Type);
+        checkReturn('returnInt2', compiler.closedWorld.commonMasks.uint31Type);
+        checkReturn('returnInt3', compiler.closedWorld.commonMasks.uint31Type);
+        checkReturn('returnInt4', compiler.closedWorld.commonMasks.uint31Type);
+        checkReturn('returnIntOrNull',
+            compiler.closedWorld.commonMasks.uint31Type.nullable());
 
-        checkReturn(
-            'returnDyn1', compiler.commonMasks.dynamicType.nonNullable());
-        checkReturn(
-            'returnDyn2', compiler.commonMasks.dynamicType.nonNullable());
-        checkReturn(
-            'returnDyn3', compiler.commonMasks.dynamicType.nonNullable());
-        checkReturn('returnNum1', compiler.commonMasks.numType);
+        checkReturn('returnDyn1',
+            compiler.closedWorld.commonMasks.dynamicType.nonNullable());
+        checkReturn('returnDyn2',
+            compiler.closedWorld.commonMasks.dynamicType.nonNullable());
+        checkReturn('returnDyn3',
+            compiler.closedWorld.commonMasks.dynamicType.nonNullable());
+        checkReturn('returnNum1', compiler.closedWorld.commonMasks.numType);
 
         checkReturnInClass(String className, String methodName, type) {
           var cls = findElement(compiler, className);
diff --git a/tests/compiler/dart2js/simple_inferrer_const_closure2_test.dart b/tests/compiler/dart2js/simple_inferrer_const_closure2_test.dart
index 175d716..2e59a21 100644
--- a/tests/compiler/dart2js/simple_inferrer_const_closure2_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_const_closure2_test.dart
@@ -28,7 +28,7 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST, uri);
   asyncTest(() => compiler.run(uri).then((_) {
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
         checkReturn(String name, type) {
           var element = findElement(compiler, name);
@@ -38,7 +38,7 @@
               name);
         }
 
-        checkReturn('method', compiler.commonMasks.numType);
-        checkReturn('returnNum', compiler.commonMasks.numType);
+        checkReturn('method', compiler.closedWorld.commonMasks.numType);
+        checkReturn('returnNum', compiler.closedWorld.commonMasks.numType);
       }));
 }
diff --git a/tests/compiler/dart2js/simple_inferrer_const_closure3_test.dart b/tests/compiler/dart2js/simple_inferrer_const_closure3_test.dart
index 1a60bc8..a354985 100644
--- a/tests/compiler/dart2js/simple_inferrer_const_closure3_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_const_closure3_test.dart
@@ -28,7 +28,7 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST, uri);
   asyncTest(() => compiler.run(uri).then((_) {
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
         checkArgument(String functionName, type) {
           var functionElement = findElement(compiler, functionName);
@@ -40,6 +40,6 @@
               functionName);
         }
 
-        checkArgument('method', compiler.commonMasks.uint31Type);
+        checkArgument('method', compiler.closedWorld.commonMasks.uint31Type);
       }));
 }
diff --git a/tests/compiler/dart2js/simple_inferrer_const_closure4_test.dart b/tests/compiler/dart2js/simple_inferrer_const_closure4_test.dart
index 40914d4..eeeeb02 100644
--- a/tests/compiler/dart2js/simple_inferrer_const_closure4_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_const_closure4_test.dart
@@ -29,7 +29,7 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST, uri);
   asyncTest(() => compiler.run(uri).then((_) {
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
         checkArgument(String functionName, type) {
           var functionElement = findElement(compiler, functionName);
@@ -41,7 +41,7 @@
               functionName);
         }
 
-        checkArgument('method', compiler.commonMasks.numType);
-        checkArgument('returnNum', compiler.commonMasks.numType);
+        checkArgument('method', compiler.closedWorld.commonMasks.numType);
+        checkArgument('returnNum', compiler.closedWorld.commonMasks.numType);
       }));
 }
diff --git a/tests/compiler/dart2js/simple_inferrer_const_closure5_test.dart b/tests/compiler/dart2js/simple_inferrer_const_closure5_test.dart
index 413a385..a41c254 100644
--- a/tests/compiler/dart2js/simple_inferrer_const_closure5_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_const_closure5_test.dart
@@ -29,7 +29,7 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST, uri);
   asyncTest(() => compiler.run(uri).then((_) {
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
         checkArgument(String functionName, type) {
           var functionElement = findElement(compiler, functionName);
@@ -41,6 +41,6 @@
               functionName);
         }
 
-        checkArgument('method', compiler.commonMasks.numType);
+        checkArgument('method', compiler.closedWorld.commonMasks.numType);
       }));
 }
diff --git a/tests/compiler/dart2js/simple_inferrer_const_closure_default_test.dart b/tests/compiler/dart2js/simple_inferrer_const_closure_default_test.dart
index 0a97f95..f2d38c6 100644
--- a/tests/compiler/dart2js/simple_inferrer_const_closure_default_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_const_closure_default_test.dart
@@ -42,7 +42,7 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST, uri);
   asyncTest(() => compiler.run(uri).then((_) {
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
         checkArgument(String functionName, type) {
           var functionElement = findElement(compiler, functionName);
@@ -66,41 +66,47 @@
               functionName);
         }
 
-        checkArgument('foo1', compiler.commonMasks.functionType);
+        checkArgument('foo1', compiler.closedWorld.commonMasks.functionType);
 
         /// 01: ok
-        checkArgument('foo2', compiler.commonMasks.functionType);
+        checkArgument('foo2', compiler.closedWorld.commonMasks.functionType);
 
         /// 02: ok
-        checkArgument('foo3', compiler.commonMasks.functionType);
+        checkArgument('foo3', compiler.closedWorld.commonMasks.functionType);
 
         /// 03: ok
-        checkArgument('foo4', compiler.commonMasks.functionType);
+        checkArgument('foo4', compiler.closedWorld.commonMasks.functionType);
 
         /// 04: ok
-        checkArgument('foo5', compiler.commonMasks.dynamicType);
+        checkArgument('foo5', compiler.closedWorld.commonMasks.dynamicType);
 
         /// 05: ok
-        checkArgument('foo6', compiler.commonMasks.dynamicType);
+        checkArgument('foo6', compiler.closedWorld.commonMasks.dynamicType);
 
         /// 06: ok
 
-        checkArgument('defaultFn1', compiler.commonMasks.uint31Type);
+        checkArgument(
+            'defaultFn1', compiler.closedWorld.commonMasks.uint31Type);
 
         /// 07: ok
-        checkArgument('defaultFn2', compiler.commonMasks.uint31Type);
+        checkArgument(
+            'defaultFn2', compiler.closedWorld.commonMasks.uint31Type);
 
         /// 08: ok
-        checkArgument('defaultFn3', compiler.commonMasks.uint31Type);
+        checkArgument(
+            'defaultFn3', compiler.closedWorld.commonMasks.uint31Type);
 
         /// 09: ok
-        checkArgument('defaultFn4', compiler.commonMasks.uint31Type);
+        checkArgument(
+            'defaultFn4', compiler.closedWorld.commonMasks.uint31Type);
 
         /// 10: ok
-        checkArgument('defaultFn5', compiler.commonMasks.uint31Type);
+        checkArgument(
+            'defaultFn5', compiler.closedWorld.commonMasks.uint31Type);
 
         /// 11: ok
-        checkArgument('defaultFn6', compiler.commonMasks.uint31Type);
+        checkArgument(
+            'defaultFn6', compiler.closedWorld.commonMasks.uint31Type);
 
         /// 12: ok
       }));
diff --git a/tests/compiler/dart2js/simple_inferrer_const_closure_test.dart b/tests/compiler/dart2js/simple_inferrer_const_closure_test.dart
index bb5e17e..6dbd781 100644
--- a/tests/compiler/dart2js/simple_inferrer_const_closure_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_const_closure_test.dart
@@ -37,7 +37,7 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST, uri);
   asyncTest(() => compiler.run(uri).then((_) {
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
         checkReturn(String name, type) {
           var element = findElement(compiler, name);
@@ -47,10 +47,10 @@
               name);
         }
 
-        checkReturn('method1', compiler.commonMasks.uint31Type);
-        checkReturn('returnInt1', compiler.commonMasks.uint31Type);
+        checkReturn('method1', compiler.closedWorld.commonMasks.uint31Type);
+        checkReturn('returnInt1', compiler.closedWorld.commonMasks.uint31Type);
 
-        checkReturn('method2', compiler.commonMasks.uint31Type);
-        checkReturn('returnInt2', compiler.commonMasks.uint31Type);
+        checkReturn('method2', compiler.closedWorld.commonMasks.uint31Type);
+        checkReturn('returnInt2', compiler.closedWorld.commonMasks.uint31Type);
       }));
 }
diff --git a/tests/compiler/dart2js/simple_inferrer_final_field2_test.dart b/tests/compiler/dart2js/simple_inferrer_final_field2_test.dart
index cc429df..2a31462 100644
--- a/tests/compiler/dart2js/simple_inferrer_final_field2_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_final_field2_test.dart
@@ -28,7 +28,7 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST, uri);
   asyncTest(() => compiler.run(uri).then((_) {
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
         checkFieldTypeInClass(String className, String fieldName, type) {
           var cls = findElement(compiler, className);
diff --git a/tests/compiler/dart2js/simple_inferrer_final_field3_test.dart b/tests/compiler/dart2js/simple_inferrer_final_field3_test.dart
index caa821f..7eeefae 100644
--- a/tests/compiler/dart2js/simple_inferrer_final_field3_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_final_field3_test.dart
@@ -27,7 +27,7 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST, uri);
   asyncTest(() => compiler.run(uri).then((_) {
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
         checkFieldTypeInClass(String className, String fieldName, type) {
           var cls = findElement(compiler, className);
diff --git a/tests/compiler/dart2js/simple_inferrer_final_field_test.dart b/tests/compiler/dart2js/simple_inferrer_final_field_test.dart
index d36ffa9..78b3ebc 100644
--- a/tests/compiler/dart2js/simple_inferrer_final_field_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_final_field_test.dart
@@ -31,7 +31,7 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST, uri);
   asyncTest(() => compiler.run(uri).then((_) {
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
         checkFieldTypeInClass(String className, String fieldName, type) {
           var cls = findElement(compiler, className);
@@ -40,12 +40,13 @@
               simplify(typesInferrer.getTypeOfElement(element), compiler));
         }
 
-        checkFieldTypeInClass('A', 'intField', compiler.commonMasks.uint31Type);
+        checkFieldTypeInClass(
+            'A', 'intField', compiler.closedWorld.commonMasks.uint31Type);
         checkFieldTypeInClass('A', 'giveUpField1',
             findTypeMask(compiler, 'Interceptor', 'nonNullSubclass'));
         checkFieldTypeInClass('A', 'giveUpField2',
-            compiler.commonMasks.dynamicType.nonNullable());
+            compiler.closedWorld.commonMasks.dynamicType.nonNullable());
         checkFieldTypeInClass(
-            'A', 'fieldParameter', compiler.commonMasks.uint31Type);
+            'A', 'fieldParameter', compiler.closedWorld.commonMasks.uint31Type);
       }));
 }
diff --git a/tests/compiler/dart2js/simple_inferrer_global_field_closure2_test.dart b/tests/compiler/dart2js/simple_inferrer_global_field_closure2_test.dart
index c2e7492..01a896a 100644
--- a/tests/compiler/dart2js/simple_inferrer_global_field_closure2_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_global_field_closure2_test.dart
@@ -28,7 +28,7 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST, uri);
   asyncTest(() => compiler.run(uri).then((_) {
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
         checkArgument(String functionName, type) {
           var functionElement = findElement(compiler, functionName);
@@ -40,6 +40,6 @@
               functionName);
         }
 
-        checkArgument('method', compiler.commonMasks.uint31Type);
+        checkArgument('method', compiler.closedWorld.commonMasks.uint31Type);
       }));
 }
diff --git a/tests/compiler/dart2js/simple_inferrer_global_field_closure_test.dart b/tests/compiler/dart2js/simple_inferrer_global_field_closure_test.dart
index eb486bc..f20912a 100644
--- a/tests/compiler/dart2js/simple_inferrer_global_field_closure_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_global_field_closure_test.dart
@@ -37,7 +37,7 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST, uri);
   asyncTest(() => compiler.run(uri).then((_) {
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
         checkReturn(String name, type) {
           var element = findElement(compiler, name);
@@ -47,10 +47,10 @@
               name);
         }
 
-        checkReturn('method1', compiler.commonMasks.uint31Type);
-        checkReturn('returnInt1', compiler.commonMasks.uint31Type);
+        checkReturn('method1', compiler.closedWorld.commonMasks.uint31Type);
+        checkReturn('returnInt1', compiler.closedWorld.commonMasks.uint31Type);
 
-        checkReturn('method2', compiler.commonMasks.uint31Type);
-        checkReturn('returnInt2', compiler.commonMasks.uint31Type);
+        checkReturn('method2', compiler.closedWorld.commonMasks.uint31Type);
+        checkReturn('returnInt2', compiler.closedWorld.commonMasks.uint31Type);
       }));
 }
diff --git a/tests/compiler/dart2js/simple_inferrer_no_such_method_test.dart b/tests/compiler/dart2js/simple_inferrer_no_such_method_test.dart
index 96ede85..a68120c 100644
--- a/tests/compiler/dart2js/simple_inferrer_no_such_method_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_no_such_method_test.dart
@@ -164,7 +164,7 @@
   Uri uri = new Uri(scheme: 'source');
 
   checkReturn(MockCompiler compiler, String name, type) {
-    var typesInferrer = compiler.globalInference.typesInferrer;
+    var typesInferrer = compiler.globalInference.typesInferrerInternal;
     var element = findElement(compiler, name);
     Expect.equals(
         type,
@@ -174,51 +174,74 @@
 
   var compiler1 = compilerFor(TEST1, uri);
   asyncTest(() => compiler1.run(uri).then((_) {
-        checkReturn(compiler1, 'test1', compiler1.commonMasks.uint31Type);
+        checkReturn(
+            compiler1, 'test1', compiler1.closedWorld.commonMasks.uint31Type);
         checkReturn(compiler1, 'test2',
-            compiler1.commonMasks.dynamicType.nonNullable());
-        checkReturn(compiler1, 'test3', compiler1.commonMasks.uint31Type);
-        checkReturn(compiler1, 'test4', compiler1.commonMasks.mapType);
+            compiler1.closedWorld.commonMasks.dynamicType.nonNullable());
+        checkReturn(
+            compiler1, 'test3', compiler1.closedWorld.commonMasks.uint31Type);
+        checkReturn(
+            compiler1, 'test4', compiler1.closedWorld.commonMasks.mapType);
         checkReturn(compiler1, 'test5',
-            compiler1.commonMasks.dynamicType.nonNullable());
+            compiler1.closedWorld.commonMasks.dynamicType.nonNullable());
         checkReturn(compiler1, 'test6',
-            compiler1.commonMasks.dynamicType.nonNullable());
+            compiler1.closedWorld.commonMasks.dynamicType.nonNullable());
       }));
 
   var compiler2 = compilerFor(TEST2, uri);
   asyncTest(() => compiler2.run(uri).then((_) {
+        checkReturn(compiler2, 'test1',
+            compiler2.closedWorld.commonMasks.mapType.nonNullable());
         checkReturn(
-            compiler2, 'test1', compiler2.commonMasks.mapType.nonNullable());
-        checkReturn(compiler2, 'test2', compiler2.commonMasks.mapType);
-        checkReturn(compiler2, 'test3', compiler2.commonMasks.mapType);
-        checkReturn(compiler2, 'test4', compiler2.commonMasks.mapType);
-        checkReturn(compiler2, 'test5', compiler2.commonMasks.mapType);
+            compiler2, 'test2', compiler2.closedWorld.commonMasks.mapType);
+        checkReturn(
+            compiler2, 'test3', compiler2.closedWorld.commonMasks.mapType);
+        checkReturn(
+            compiler2, 'test4', compiler2.closedWorld.commonMasks.mapType);
+        checkReturn(
+            compiler2, 'test5', compiler2.closedWorld.commonMasks.mapType);
 
-        checkReturn(compiler2, 'test6', compiler2.commonMasks.numType);
-        checkReturn(compiler2, 'test7', compiler2.commonMasks.uint31Type);
-        checkReturn(compiler2, 'test8', compiler2.commonMasks.uint31Type);
-        checkReturn(compiler2, 'test9', compiler2.commonMasks.uint31Type);
-        checkReturn(compiler2, 'test10', compiler2.commonMasks.numType);
-        checkReturn(compiler2, 'test11', compiler2.commonMasks.doubleType);
+        checkReturn(
+            compiler2, 'test6', compiler2.closedWorld.commonMasks.numType);
+        checkReturn(
+            compiler2, 'test7', compiler2.closedWorld.commonMasks.uint31Type);
+        checkReturn(
+            compiler2, 'test8', compiler2.closedWorld.commonMasks.uint31Type);
+        checkReturn(
+            compiler2, 'test9', compiler2.closedWorld.commonMasks.uint31Type);
+        checkReturn(
+            compiler2, 'test10', compiler2.closedWorld.commonMasks.numType);
+        checkReturn(
+            compiler2, 'test11', compiler2.closedWorld.commonMasks.doubleType);
       }));
 
   var compiler3 = compilerFor(TEST3, uri);
   asyncTest(() => compiler3.run(uri).then((_) {
         checkReturn(compiler3, 'test1', const TypeMask.nonNullEmpty());
-        checkReturn(compiler3, 'test2', compiler3.commonMasks.mapType);
-        checkReturn(compiler3, 'test3', compiler3.commonMasks.mapType);
-        checkReturn(compiler3, 'test4', compiler3.commonMasks.mapType);
-        checkReturn(compiler3, 'test5', compiler3.commonMasks.mapType);
-        checkReturn(compiler3, 'test6', compiler3.commonMasks.mapType);
+        checkReturn(
+            compiler3, 'test2', compiler3.closedWorld.commonMasks.mapType);
+        checkReturn(
+            compiler3, 'test3', compiler3.closedWorld.commonMasks.mapType);
+        checkReturn(
+            compiler3, 'test4', compiler3.closedWorld.commonMasks.mapType);
+        checkReturn(
+            compiler3, 'test5', compiler3.closedWorld.commonMasks.mapType);
+        checkReturn(
+            compiler3, 'test6', compiler3.closedWorld.commonMasks.mapType);
       }));
 
   var compiler4 = compilerFor(TEST4, uri);
   asyncTest(() => compiler4.run(uri).then((_) {
         checkReturn(compiler4, 'test1', const TypeMask.nonNullEmpty());
-        checkReturn(compiler4, 'test2', compiler4.commonMasks.mapType);
-        checkReturn(compiler4, 'test3', compiler4.commonMasks.mapType);
-        checkReturn(compiler4, 'test4', compiler4.commonMasks.mapType);
-        checkReturn(compiler4, 'test5', compiler4.commonMasks.mapType);
-        checkReturn(compiler4, 'test6', compiler4.commonMasks.mapType);
+        checkReturn(
+            compiler4, 'test2', compiler4.closedWorld.commonMasks.mapType);
+        checkReturn(
+            compiler4, 'test3', compiler4.closedWorld.commonMasks.mapType);
+        checkReturn(
+            compiler4, 'test4', compiler4.closedWorld.commonMasks.mapType);
+        checkReturn(
+            compiler4, 'test5', compiler4.closedWorld.commonMasks.mapType);
+        checkReturn(
+            compiler4, 'test6', compiler4.closedWorld.commonMasks.mapType);
       }));
 }
diff --git a/tests/compiler/dart2js/simple_inferrer_postfix_prefix_test.dart b/tests/compiler/dart2js/simple_inferrer_postfix_prefix_test.dart
index 3b308f0..3d37e58 100644
--- a/tests/compiler/dart2js/simple_inferrer_postfix_prefix_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_postfix_prefix_test.dart
@@ -66,8 +66,8 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST, uri);
   asyncTest(() => compiler.run(uri).then((_) {
-        var commonMasks = compiler.commonMasks;
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var commonMasks = compiler.closedWorld.commonMasks;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
         checkReturnInClass(String className, String methodName, type) {
           var cls = findElement(compiler, className);
diff --git a/tests/compiler/dart2js/simple_inferrer_test.dart b/tests/compiler/dart2js/simple_inferrer_test.dart
index ccb07a8..cf29a1a 100644
--- a/tests/compiler/dart2js/simple_inferrer_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_test.dart
@@ -727,8 +727,8 @@
   var compiler = compilerFor(TEST, uri);
   compiler.diagnosticHandler = createHandler(compiler, TEST);
   asyncTest(() => compiler.run(uri).then((_) {
-        var commonMasks = compiler.commonMasks;
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var commonMasks = compiler.closedWorld.commonMasks;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
         var world = compiler.closedWorld;
 
         checkReturn(String name, type) {
diff --git a/tests/compiler/dart2js/simple_inferrer_try_catch_test.dart b/tests/compiler/dart2js/simple_inferrer_try_catch_test.dart
index 28c8fde..207a861 100644
--- a/tests/compiler/dart2js/simple_inferrer_try_catch_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_try_catch_test.dart
@@ -167,8 +167,8 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST, uri);
   asyncTest(() => compiler.run(uri).then((_) {
-        var commonMasks = compiler.commonMasks;
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var commonMasks = compiler.closedWorld.commonMasks;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
         checkReturn(String name, type) {
           var element = findElement(compiler, name);
diff --git a/tests/compiler/dart2js/simple_inferrer_unregister_call_test.dart b/tests/compiler/dart2js/simple_inferrer_unregister_call_test.dart
index 1253b83..f0be6f8 100644
--- a/tests/compiler/dart2js/simple_inferrer_unregister_call_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_unregister_call_test.dart
@@ -32,7 +32,7 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST, uri);
   asyncTest(() => compiler.run(uri).then((_) {
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
         checkReturnInClass(String className, String methodName, type) {
           var cls = findElement(compiler, className);
@@ -40,6 +40,7 @@
           Expect.equals(type, typesInferrer.getReturnTypeOfElement(element));
         }
 
-        checkReturnInClass('A', '+', compiler.commonMasks.uint31Type);
+        checkReturnInClass(
+            'A', '+', compiler.closedWorld.commonMasks.uint31Type);
       }));
 }
diff --git a/tests/compiler/dart2js/sourcemaps/diff.dart b/tests/compiler/dart2js/sourcemaps/diff.dart
index 7505892..9627b3c 100644
--- a/tests/compiler/dart2js/sourcemaps/diff.dart
+++ b/tests/compiler/dart2js/sourcemaps/diff.dart
@@ -11,11 +11,7 @@
 import 'sourcemap_helper.dart';
 import 'sourcemap_html_helper.dart';
 
-enum DiffKind {
-  UNMATCHED,
-  MATCHING,
-  IDENTICAL,
-}
+enum DiffKind { UNMATCHED, MATCHING, IDENTICAL, }
 
 /// Id for an output column.
 class DiffColumn {
diff --git a/tests/compiler/dart2js/sourcemaps/diff_view.dart b/tests/compiler/dart2js/sourcemaps/diff_view.dart
index bd29b49..db07f93 100644
--- a/tests/compiler/dart2js/sourcemaps/diff_view.dart
+++ b/tests/compiler/dart2js/sourcemaps/diff_view.dart
@@ -69,9 +69,8 @@
     // deleted.
     // Use default options; comparing SSA and CPS output using the new
     // source information strategy.
+    options.add(commonArguments);
     options.add([Flags.useNewSourceInfo]..addAll(commonArguments));
-    options.add([Flags.useNewSourceInfo]..addAll(commonArguments));
-    throw "missing options: please specify options for the second column";
   } else if (optionSegments.length == 2) {
     // Use alternative options for the second output column.
     options.add(commonArguments);
@@ -793,7 +792,7 @@
     if (!added) {
       int offset;
       if (options.contains(Flags.useNewSourceInfo)) {
-        offset = step.offset.subexpressionOffset;
+        offset = step.offset.value;
       } else {
         offset = info.jsCodePositions[step.node].startPosition;
       }
diff --git a/tests/compiler/dart2js/sourcemaps/html_parts.dart b/tests/compiler/dart2js/sourcemaps/html_parts.dart
index 2691a09..d4e809f 100644
--- a/tests/compiler/dart2js/sourcemaps/html_parts.dart
+++ b/tests/compiler/dart2js/sourcemaps/html_parts.dart
@@ -125,15 +125,7 @@
   }
 }
 
-enum HtmlPartKind {
-  CODE,
-  LINE,
-  CONST,
-  NEWLINE,
-  TEXT,
-  TAG,
-  LINE_NUMBER,
-}
+enum HtmlPartKind { CODE, LINE, CONST, NEWLINE, TEXT, TAG, LINE_NUMBER, }
 
 abstract class HtmlPart {
   void printHtmlOn(StringBuffer buffer, HtmlPrintContext context);
diff --git a/tests/compiler/dart2js/sourcemaps/lax_json.dart b/tests/compiler/dart2js/sourcemaps/lax_json.dart
new file mode 100644
index 0000000..fb79973
--- /dev/null
+++ b/tests/compiler/dart2js/sourcemaps/lax_json.dart
@@ -0,0 +1,296 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// Decode a lax JSON encoded text, that is, JSON with Dart-like comments and
+/// trailing commas.
+///
+/// This is used together with `load.dart` and `save.dart` to allow for an easy
+/// editing of a human-readable source-map file.
+
+library lazon;
+
+decode(String text) {
+  return new _Decoder(text)._decode();
+}
+
+class _Decoder {
+  static final int LF = '\n'.codeUnits.single;
+  static final int CR = '\r'.codeUnits.single;
+  static final int BACKSPACE = '\b'.codeUnits.single;
+  static final int FORMFEED = '\f'.codeUnits.single;
+  static final int TAB = '\t'.codeUnits.single;
+  static final int SPACE = ' '.codeUnits.single;
+  static final int SLASH = '/'.codeUnits.single;
+  static final int STAR = '*'.codeUnits.single;
+  static final int QUOTE = '"'.codeUnits.single;
+  static final int BACKSLASH = '\\'.codeUnits.single;
+  static final int COMMA = ','.codeUnits.single;
+  static final int COLON = ':'.codeUnits.single;
+  static final int LEFT_BRACE = '{'.codeUnits.single;
+  static final int RIGHT_BRACE = '}'.codeUnits.single;
+  static final int LEFT_BRACKET = '['.codeUnits.single;
+  static final int RIGHT_BRACKET = ']'.codeUnits.single;
+  static final int T = 't'.codeUnits.single;
+  static final List<int> TRUE = 'true'.codeUnits;
+  static final int F = 'f'.codeUnits.single;
+  static final List<int> FALSE = 'false'.codeUnits;
+  static final int N = 'n'.codeUnits.single;
+  static final List<int> NULL = 'null'.codeUnits;
+  static final int _0 = '0'.codeUnits.single;
+  static final int _9 = '9'.codeUnits.single;
+  static final int B = 'b'.codeUnits.single;
+  static final int R = 'r'.codeUnits.single;
+  static final int U = 'u'.codeUnits.single;
+
+  final List<int> codeUnits;
+  final int length;
+  int position = 0;
+
+  _Decoder(String text)
+      : codeUnits = text.codeUnits,
+        length = text.length;
+
+  _decode() {
+    var result = _decodeValue();
+    _trimWhitespace();
+    if (position != codeUnits.length) {
+      throw new ArgumentError("Unexpected trailing text: "
+          "'${new String.fromCharCodes(codeUnits, position)}'.");
+    }
+    return result;
+  }
+
+  _decodeValue() {
+    var result;
+    _trimWhitespace();
+    if (position < codeUnits.length) {
+      int codeUnit = codeUnits[position];
+      if (codeUnit == QUOTE) {
+        result = _decodeString();
+      } else if (codeUnit == LEFT_BRACE) {
+        result = _decodeMap();
+      } else if (codeUnit == LEFT_BRACKET) {
+        result = _decodeList();
+      } else if (codeUnit == T) {
+        result = _decodeTrue();
+      } else if (codeUnit == F) {
+        result = _decodeFalse();
+      } else if (codeUnit == N) {
+        result = _decodeNull();
+      } else {
+        result = _decodeNumber();
+      }
+    } else {
+      throw new ArgumentError("No value found in text: "
+          "'${new String.fromCharCodes(codeUnits, 0)}'.");
+    }
+    return result;
+  }
+
+  void _trimWhitespace() {
+    OUTER:
+    while (position < codeUnits.length) {
+      int codeUnit = codeUnits[position];
+      if (codeUnit == SLASH) {
+        if (position + 1 < codeUnits.length) {
+          int nextCodeUnit = codeUnits[position + 1];
+          if (nextCodeUnit == SLASH) {
+            position += 2;
+            while (position < codeUnits.length) {
+              codeUnit = codeUnits[position];
+              if (codeUnit == LF || codeUnit == CR) {
+                continue OUTER;
+              }
+              position++;
+            }
+          } else if (nextCodeUnit == STAR) {
+            position += 2;
+            while (position < codeUnits.length) {
+              codeUnit = codeUnits[position];
+              if (codeUnit == STAR &&
+                  position + 1 < codeUnits.length &&
+                  codeUnits[position + 1] == SLASH) {
+                position += 2;
+                continue OUTER;
+              }
+              position++;
+            }
+          }
+        }
+        break;
+      } else if (codeUnit == LF ||
+          codeUnit == CR ||
+          codeUnit == TAB ||
+          codeUnit == SPACE) {
+        position++;
+      } else {
+        break;
+      }
+    }
+  }
+
+  String _decodeString() {
+    int codeUnit = codeUnits[position];
+    if (codeUnit != QUOTE) {
+      _fail();
+    }
+    position++;
+    List<int> charCodes = <int>[];
+    while (position < length) {
+      codeUnit = codeUnits[position];
+      if (codeUnit == QUOTE) {
+        break;
+      } else if (codeUnit == BACKSLASH) {
+        if (position + 1 >= length) {
+          _fail();
+        }
+        codeUnit = codeUnits[++position];
+        if (codeUnit == B) {
+          codeUnit = BACKSPACE;
+        } else if (codeUnit == F) {
+          codeUnit = FORMFEED;
+        } else if (codeUnit == N) {
+          codeUnit = LF;
+        } else if (codeUnit == R) {
+          codeUnit = CR;
+        } else if (codeUnit == T) {
+          codeUnit = TAB;
+        } else if (codeUnit == U) {
+          throw new UnsupportedError('unicode escapes');
+        } else if (codeUnit == QUOTE ||
+            codeUnit == SLASH ||
+            codeUnit == BACKSLASH) {
+          // Ok.
+        } else {
+          _fail();
+        }
+      }
+      charCodes.add(codeUnit);
+      position++;
+    }
+    if (codeUnit != QUOTE) {
+      _fail();
+    }
+    position++;
+    return new String.fromCharCodes(charCodes);
+  }
+
+  Map _decodeMap() {
+    int codeUnit = codeUnits[position];
+    if (codeUnit != LEFT_BRACE) {
+      _fail();
+    }
+    position++;
+    _trimWhitespace();
+    Map result = {};
+    while (position < length) {
+      codeUnit = codeUnits[position];
+      if (codeUnit == RIGHT_BRACE) {
+        break;
+      }
+      String key = _decodeString();
+      _trimWhitespace();
+      if (position < length) {
+        codeUnit = codeUnits[position];
+        if (codeUnit == COLON) {
+          position++;
+          _trimWhitespace();
+        } else {
+          _fail();
+        }
+      } else {
+        _fail();
+      }
+      var value = _decodeValue();
+      result[key] = value;
+      _trimWhitespace();
+      if (position < length) {
+        codeUnit = codeUnits[position];
+        if (codeUnit == COMMA) {
+          position++;
+          _trimWhitespace();
+          continue;
+        } else {
+          break;
+        }
+      }
+    }
+
+    if (codeUnit != RIGHT_BRACE) {
+      _fail();
+    }
+    position++;
+    return result;
+  }
+
+  List _decodeList() {
+    int codeUnit = codeUnits[position];
+    if (codeUnit != LEFT_BRACKET) {
+      _fail();
+    }
+    position++;
+    _trimWhitespace();
+    List result = [];
+    while (position < length) {
+      codeUnit = codeUnits[position];
+      if (codeUnit == RIGHT_BRACKET) {
+        break;
+      }
+      result.add(_decodeValue());
+      _trimWhitespace();
+      if (position < length) {
+        codeUnit = codeUnits[position];
+        if (codeUnit == COMMA) {
+          position++;
+          _trimWhitespace();
+          continue;
+        } else {
+          break;
+        }
+      }
+    }
+
+    if (codeUnit != RIGHT_BRACKET) {
+      _fail();
+    }
+    position++;
+    return result;
+  }
+
+  bool _decodeTrue() {
+    match(TRUE);
+    return true;
+  }
+
+  bool _decodeFalse() {
+    match(FALSE);
+    return false;
+  }
+
+  Null _decodeNull() {
+    match(NULL);
+    return null;
+  }
+
+  void match(List<int> codes) {
+    if (position + codes.length > length) {
+      _fail();
+    }
+    for (int i = 0; i < codes.length; i++) {
+      if (codes[i] != codeUnits[position + i]) {
+        _fail();
+      }
+    }
+    position += codes.length;
+  }
+
+  num _decodeNumber() {
+    throw new UnsupportedError('_decodeNumber');
+  }
+
+  void _fail() {
+    throw new ArgumentError("Unexpected value: "
+        "'${new String.fromCharCodes(codeUnits, position)}'.");
+  }
+}
diff --git a/tests/compiler/dart2js/sourcemaps/lax_json_test.dart b/tests/compiler/dart2js/sourcemaps/lax_json_test.dart
new file mode 100644
index 0000000..4af0301
--- /dev/null
+++ b/tests/compiler/dart2js/sourcemaps/lax_json_test.dart
@@ -0,0 +1,64 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:unittest/unittest.dart';
+import 'lax_json.dart';
+
+void main() {
+  test('primitives', () {
+    expect(decode('true'), equals(true));
+    expect(decode(' true'), equals(true));
+    expect(decode('true '), equals(true));
+    expect(decode('true// '), equals(true));
+    expect(decode('// \ntrue'), equals(true));
+    expect(decode('\ttrue\r'), equals(true));
+    expect(decode('\t\ntrue\r\n'), equals(true));
+    expect(decode('true/* */'), equals(true));
+    expect(decode('/* */true'), equals(true));
+    expect(decode('/* false */true '), equals(true));
+
+    expect(decode('false'), equals(false));
+    expect(decode('null'), equals(null));
+  });
+
+  test('string', () {
+    expect(decode('"foo"'), equals("foo"));
+    expect(decode('"foo bar baz"'), equals("foo bar baz"));
+    expect(decode(r'"\""'), equals(r'"'));
+    expect(decode(r'"\\"'), equals(r'\'));
+    expect(decode(r'"\/"'), equals('/'));
+    expect(decode(r'"\b"'), equals('\b'));
+    expect(decode(r'"\f"'), equals('\f'));
+    expect(decode(r'"\r"'), equals('\r'));
+    expect(decode(r'"\n"'), equals('\n'));
+    expect(decode(r'"\t"'), equals('\t'));
+    expect(decode(r'"\t\"\\\/\f\nfoo\r\t"'), equals('\t\"\\/\f\nfoo\r\t'));
+  });
+
+  test('list', () {
+    expect(decode('[]'), equals([]));
+    expect(decode('[\n]'), equals([]));
+    expect(decode('["foo"]'), equals(['foo']));
+    expect(decode('["foo",]'), equals(['foo']));
+    expect(decode('["foo", "bar", true, \nnull\n,false,]'),
+        equals(['foo', 'bar', true, null, false]));
+  });
+
+  test('map', () {
+    expect(decode('{}'), equals({}));
+    expect(decode('{\n}'), equals({}));
+    expect(decode('{"foo":"bar"}'), equals({'foo': 'bar'}));
+    expect(decode('{"foo":"bar",}'), equals({'foo': 'bar'}));
+    expect(
+        decode('{"foo":true, "bar": false, "baz": true, '
+            '"boz": \nnull\n,"qux": false,}'),
+        equals({
+          'foo': true,
+          'bar': false,
+          'baz': true,
+          'boz': null,
+          'qux': false
+        }));
+  });
+}
diff --git a/tests/compiler/dart2js/sourcemaps/load.dart b/tests/compiler/dart2js/sourcemaps/load.dart
new file mode 100644
index 0000000..29cb8e0
--- /dev/null
+++ b/tests/compiler/dart2js/sourcemaps/load.dart
@@ -0,0 +1,97 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// Loads a source map file and outputs a human-readable version of it.
+
+library load;
+
+import 'dart:convert';
+import 'dart:io';
+import 'package:source_maps/source_maps.dart';
+
+void main(List<String> args) {
+  if (args.isEmpty) {
+    print('''
+Usage: load <dir-containing 'out.js.map'>
+   or: load <source-map-file> [<human-readable-source-map-file>]''');
+    exit(1);
+  }
+
+  File humanReadableSourceMapFile;
+  File sourceMapFile;
+  if (args.length == 1 && new Directory(args[0]).existsSync()) {
+    humanReadableSourceMapFile = new File('${args[0]}/out.js.map2');
+    sourceMapFile = new File('${args[0]}/out.js.map');
+  } else {
+    sourceMapFile = new File(args[0]);
+    if (args.length > 1) {
+      humanReadableSourceMapFile = new File(args[1]);
+    }
+  }
+  mainInternal(sourceMapFile, humanReadableSourceMapFile);
+}
+
+void mainInternal(File sourceMapFile, File humanReadableSourceMapFile) {
+  SingleMapping sourceMap =
+      new SingleMapping.fromJson(JSON.decode(sourceMapFile.readAsStringSync()));
+  String humanReadableSourceMap = convertToHumanReadableSourceMap(sourceMap);
+  if (humanReadableSourceMapFile != null) {
+    humanReadableSourceMapFile.writeAsStringSync(humanReadableSourceMap);
+  } else {
+    print(humanReadableSourceMap);
+  }
+}
+
+String convertToHumanReadableSourceMap(SingleMapping sourceMap) {
+  StringBuffer sb = new StringBuffer();
+  sb.write('{\n');
+  sb.write('  "file": "${sourceMap.targetUrl}",\n');
+  sb.write('  "sourceRoot": "${sourceMap.sourceRoot}",\n');
+  sb.write('  "sources": {\n');
+  for (int index = 0; index < sourceMap.urls.length; index++) {
+    if (index > 0) {
+      sb.write(',\n');
+    }
+    sb.write('    "$index": "${sourceMap.urls[index]}"');
+  }
+  sb.write('\n  },\n');
+  sb.write('  "lines": [\n');
+  bool needsComma = false;
+  for (int lineIndex = 0; lineIndex < sourceMap.lines.length; lineIndex++) {
+    TargetLineEntry lineEntry = sourceMap.lines[lineIndex];
+    int line = lineEntry.line + 1;
+    for (int entryIndex = 0;
+        entryIndex < lineEntry.entries.length;
+        entryIndex++) {
+      TargetEntry entry = lineEntry.entries[entryIndex];
+      int columnStart = entry.column + 1;
+      int columnEnd;
+      String position;
+      if (entryIndex + 1 < lineEntry.entries.length) {
+        columnEnd = lineEntry.entries[entryIndex + 1].column + 1;
+        position = '$line,$columnStart-$columnEnd';
+      } else {
+        position = '$line,$columnStart-';
+      }
+      if (entry.sourceUrlId != null) {
+        int sourceUrlId = entry.sourceUrlId;
+        int sourceLine = entry.sourceLine + 1;
+        int sourceColumn = entry.sourceColumn + 1;
+        if (needsComma) {
+          sb.write(',\n');
+        }
+        sb.write('    {"target": "$position"');
+        sb.write(', "source": "$sourceUrlId:$sourceLine,$sourceColumn"');
+        if (entry.sourceNameId != null) {
+          sb.write(', "name": "${sourceMap.names[entry.sourceNameId]}"');
+        }
+        sb.write('}');
+        needsComma = true;
+      }
+    }
+  }
+  sb.write('\n  ]\n');
+  sb.write('}');
+  return sb.toString();
+}
diff --git a/tests/compiler/dart2js/sourcemaps/load_save_test.dart b/tests/compiler/dart2js/sourcemaps/load_save_test.dart
new file mode 100644
index 0000000..380f7f2
--- /dev/null
+++ b/tests/compiler/dart2js/sourcemaps/load_save_test.dart
@@ -0,0 +1,76 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:convert';
+import 'package:source_maps/source_maps.dart';
+import 'package:unittest/unittest.dart';
+import 'load.dart';
+import 'save.dart';
+
+const String SOURCEMAP = '''
+{
+  "version": 3,
+  "file": "out.js",
+  "sourceRoot": "",
+  "sources": ["sdk/lib/_internal/compiler/js_lib/js_primitives.dart","hello_world.dart","sdk/lib/_internal/compiler/js_lib/internal_patch.dart"],
+  "names": ["printString","main","printToConsole"],
+  "mappings": "A;A;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A;;eAoBAA;;;AAIIA;;;;AAOAA;;;AAKAA;;;AAMAA;;;GAOJA;;sC;;QC5CAC;;ICYEC;GDRFD;;;;A;A;A;;;A;;;A;A;A;A;A;A;A;;;;;;A;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A;C;;;;;;;;;;;;;;;;;;;;;;;;;;;;A"
+}''';
+
+const String HUMAN_READABLE_SOURCE_MAP = '''
+{
+  "file": "out.js",
+  "sourceRoot": "",
+  "sources": {
+    "0": "out.js.map",
+    "1": "test.dart",
+    "2": "out.js"
+  },
+  "lines": [
+    {"target": "3,3-", "source": "1:2,17"},
+    {"target": "4,3-", "source": "1:3,17"},
+    {"target": "5,3-15", "source": "1:4,17"},
+    {"target": "5,15-20", "source": "1:5,17"},
+    {"target": "5,20-", "source": "1:6,4"},
+    {"target": "6,3-", "source": "1:7,17"},
+    {"target": "7,3-", "source": "1:8,17"},
+    {"target": "8,1-", "source": "1:9,1"},
+    {"target": "10,3-", "source": "1:11,17"},
+    {"target": "11,3-", "source": "1:12,17"},
+    {"target": "12,3-", "source": "1:13,17"},
+    {"target": "13,3-", "source": "1:14,17"},
+    {"target": "14,1-", "source": "1:15,4"}
+  ]
+}''';
+
+void main() {
+  test('read/write', () {
+    SingleMapping sourceMap =
+        new SingleMapping.fromJson(JSON.decode(SOURCEMAP));
+    String humanReadable = convertToHumanReadableSourceMap(sourceMap);
+    SingleMapping sourceMap2 = convertFromHumanReadableSourceMap(humanReadable);
+    String humanReadable2 = convertToHumanReadableSourceMap(sourceMap2);
+    SingleMapping sourceMap3 =
+        convertFromHumanReadableSourceMap(humanReadable2);
+    String humanReadable3 = convertToHumanReadableSourceMap(sourceMap3);
+
+    // Target line entries without sourceUrl are removed.
+    //expect(sourceMap.toJson(), equals(sourceMap2.toJson()));
+    expect(sourceMap2.toJson(), equals(sourceMap3.toJson()));
+    expect(JSON.decode(humanReadable), equals(JSON.decode(humanReadable2)));
+    expect(JSON.decode(humanReadable2), equals(JSON.decode(humanReadable3)));
+  });
+
+  test('write/read', () {
+    SingleMapping sourceMap =
+        convertFromHumanReadableSourceMap(HUMAN_READABLE_SOURCE_MAP);
+    print(sourceMap);
+    String humanReadable = convertToHumanReadableSourceMap(sourceMap);
+    print(humanReadable);
+    SingleMapping sourceMap2 = convertFromHumanReadableSourceMap(humanReadable);
+    expect(JSON.decode(HUMAN_READABLE_SOURCE_MAP),
+        equals(JSON.decode(humanReadable)));
+    expect(sourceMap.toJson(), equals(sourceMap2.toJson()));
+  });
+}
diff --git a/tests/compiler/dart2js/sourcemaps/output_structure.dart b/tests/compiler/dart2js/sourcemaps/output_structure.dart
index 648973a..21a5bc3 100644
--- a/tests/compiler/dart2js/sourcemaps/output_structure.dart
+++ b/tests/compiler/dart2js/sourcemaps/output_structure.dart
@@ -637,11 +637,7 @@
   String toString() => '[$from,$to[';
 }
 
-enum CodeKind {
-  LIBRARY,
-  CLASS,
-  MEMBER,
-}
+enum CodeKind { LIBRARY, CLASS, MEMBER, }
 
 class CodeLocation {
   final Uri uri;
diff --git a/tests/compiler/dart2js/sourcemaps/save.dart b/tests/compiler/dart2js/sourcemaps/save.dart
new file mode 100644
index 0000000..4c2c296
--- /dev/null
+++ b/tests/compiler/dart2js/sourcemaps/save.dart
@@ -0,0 +1,141 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// Loads a human-readable source map and outputs the source map file for it.
+
+library save;
+
+import 'dart:convert';
+import 'dart:io';
+import 'package:source_maps/source_maps.dart';
+import 'lax_json.dart' as lazon;
+
+void main(List<String> args) {
+  if (args.isEmpty) {
+    print('''
+Usage: save <dir-containing 'out.js.map2'>
+   or: save <human-readable-source-map-file> [<source-map-file>]''');
+    exit(1);
+  }
+
+  File humanReadableSourceMapFile;
+  File sourceMapFile;
+  if (args.length == 1 && new Directory(args[0]).existsSync()) {
+    humanReadableSourceMapFile = new File('${args[0]}/out.js.map2');
+    sourceMapFile = new File('${args[0]}/out.js.map');
+  } else {
+    humanReadableSourceMapFile = new File(args[0]);
+    if (args.length > 1) {
+      sourceMapFile = new File(args[1]);
+    }
+  }
+
+  String humanReadableSourceMap = humanReadableSourceMapFile.readAsStringSync();
+  SingleMapping mapping =
+      convertFromHumanReadableSourceMap(humanReadableSourceMap);
+
+  if (sourceMapFile != null) {
+    sourceMapFile.writeAsStringSync(JSON.encoder.convert(mapping.toJson()));
+  } else {
+    print(new JsonEncoder.withIndent('  ').convert(mapping.toJson()));
+  }
+}
+
+SingleMapping convertFromHumanReadableSourceMap(String json) {
+  Map inputMap = lazon.decode(json);
+  String file = inputMap['file'];
+  Map urls = inputMap['sources'];
+  List<String> sources = new List<String>.filled(urls.length, null);
+  urls.forEach((String index, String url) {
+    int i = int.parse(index);
+    assert(sources[i] == null);
+    sources[i] = url;
+  });
+  List lines = inputMap['lines'];
+  Map<String, int> names = <String, int>{};
+  Map<int, TargetLineEntry> lineEntryMap = {};
+
+  for (Map line in lines) {
+    String targetString = line['target'];
+    String sourceString = line['source'];
+    String name = line['name'];
+    int nameIndex;
+    if (name != null) {
+      nameIndex = names.putIfAbsent(name, () => names.length);
+    }
+
+    int lineNo;
+    int columnStart;
+    int columnEnd;
+    if (targetString != null) {
+      int commaPos = targetString.indexOf(',');
+      lineNo = int.parse(targetString.substring(0, commaPos)) - 1;
+      if (lineNo < 0) {
+        throw new ArgumentError('target line must be > 0: $lineNo');
+      }
+      targetString = targetString.substring(commaPos + 1);
+      int dashPos = targetString.indexOf('-');
+      columnStart = int.parse(targetString.substring(0, dashPos)) - 1;
+      if (columnStart < 0) {
+        throw new ArgumentError(
+            'target column start must be > 0: $columnStart');
+      }
+      targetString = targetString.substring(dashPos + 1);
+      if (!targetString.isEmpty) {
+        columnEnd = int.parse(targetString) - 1;
+        if (columnEnd < 0) {
+          throw new ArgumentError('target column end must be > 0: $columnEnd');
+        }
+      }
+    }
+    int sourceUrlId;
+    int sourceLine;
+    int sourceColumn;
+    if (sourceString != null) {
+      int colonPos = sourceString.indexOf(':');
+      sourceUrlId = int.parse(sourceString.substring(0, colonPos));
+      if (sourceUrlId < 0) {
+        throw new ArgumentError('source url id end must be > 0: $sourceUrlId');
+      } else if (sourceUrlId >= sources.length) {
+        throw new ArgumentError(
+            'source url id end must be < ${sources.length}: $sourceUrlId');
+      }
+
+      sourceString = sourceString.substring(colonPos + 1);
+      int commaPos = sourceString.indexOf(',');
+      sourceLine = int.parse(sourceString.substring(0, commaPos)) - 1;
+      if (sourceLine < 0) {
+        throw new ArgumentError('source line end must be > 0: $sourceLine');
+      }
+      sourceString = sourceString.substring(commaPos + 1);
+      sourceColumn = int.parse(sourceString) - 1;
+      if (sourceColumn < 0) {
+        throw new ArgumentError('source column must be > 0: $sourceColumn');
+      }
+    }
+
+    TargetLineEntry lineEntry =
+        lineEntryMap.putIfAbsent(lineNo, () => new TargetLineEntry(lineNo, []));
+    lineEntry.entries.add(new TargetEntry(
+        columnStart, sourceUrlId, sourceLine, sourceColumn, nameIndex));
+    if (columnEnd != null) {
+      lineEntry.entries.add(new TargetEntry(columnEnd));
+    }
+  }
+
+  List<TargetLineEntry> lineEntries = lineEntryMap.values.toList();
+
+  Map outputMap = {
+    'version': 3,
+    'sourceRoot': inputMap['sourceRoot'],
+    'file': inputMap['file'],
+    'sources': sources,
+    'names': names.keys.toList(),
+    'mappings': '',
+  };
+
+  SingleMapping mapping = new SingleMapping.fromJson(outputMap);
+  mapping.lines.addAll(lineEntries);
+  return mapping;
+}
diff --git a/tests/compiler/dart2js/sourcemaps/sourcemap_html_helper.dart b/tests/compiler/dart2js/sourcemaps/sourcemap_html_helper.dart
index ddb6fdc..423c054 100644
--- a/tests/compiler/dart2js/sourcemaps/sourcemap_html_helper.dart
+++ b/tests/compiler/dart2js/sourcemaps/sourcemap_html_helper.dart
@@ -307,7 +307,9 @@
 
   void addAnnotations(List<Annotation> annotations) {
     currentAnnotations.addAll(annotations);
-    currentLine.annotations.addAll(annotations);
+    if (currentLine != null) {
+      currentLine.annotations.addAll(annotations);
+    }
   }
 
   void beginLine(int currentOffset) {
diff --git a/tests/compiler/dart2js/sourcemaps/stacktrace_test.dart b/tests/compiler/dart2js/sourcemaps/stacktrace_test.dart
new file mode 100644
index 0000000..89d1ff7
--- /dev/null
+++ b/tests/compiler/dart2js/sourcemaps/stacktrace_test.dart
@@ -0,0 +1,504 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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:convert';
+import 'dart:io';
+
+import 'package:async_helper/async_helper.dart';
+import 'package:compiler/compiler_new.dart';
+import 'package:compiler/src/apiimpl.dart';
+import 'package:compiler/src/commandline_options.dart';
+import 'package:compiler/src/dart2js.dart' as entry;
+import 'package:expect/expect.dart';
+import 'package:source_maps/source_maps.dart';
+import 'package:source_maps/src/utils.dart';
+
+import '../source_map_validator_helper.dart';
+
+const String EXCEPTION_MARKER = '>ExceptionMarker<';
+const String INPUT_FILE_NAME = 'in.dart';
+
+const List<String> TESTS = const <String>[
+  '''
+main() {
+  @{1:main}throw '$EXCEPTION_MARKER';
+}
+''',
+  '''
+import 'package:expect/expect.dart';
+main() {
+  @{1:main}test();
+}
+@NoInline()
+test() {
+  @{2:test}throw '$EXCEPTION_MARKER';
+}
+''',
+  '''
+import 'package:expect/expect.dart';
+main() {
+  @{1:main}Class.test();
+}
+class Class {
+  @NoInline()
+  static test() {
+    @{2:Class.test}throw '$EXCEPTION_MARKER';
+  }
+}
+''',
+  '''
+import 'package:expect/expect.dart';
+main() {
+  var c = new Class();
+  c.@{1:main}test();
+}
+class Class {
+  @NoInline()
+  test() {
+    @{2:Class.test}throw '$EXCEPTION_MARKER';
+  }
+}
+''',
+  '''
+import 'package:expect/expect.dart';
+main() {
+  var c = @{1:main}new Class();
+}
+class Class {
+  @NoInline()
+  Class() {
+    @{2:Class}throw '$EXCEPTION_MARKER';
+  }
+}
+''',
+  '''
+import 'package:expect/expect.dart';
+main() {
+  @{1:main}test();
+}
+@NoInline()
+test() {
+  try {
+    @{2:test}throw '$EXCEPTION_MARKER';
+  } finally {
+  }
+}
+''',
+  '''
+import 'package:expect/expect.dart';
+main() {
+  @{1:main}test();
+}
+@NoInline()
+test() {
+  try {
+    @{2:test}throw '$EXCEPTION_MARKER';
+  } on Error catch (e) {
+  }
+}
+''',
+  '''
+import 'package:expect/expect.dart';
+main() {
+  @{1:main}test();
+}
+@NoInline()
+test() {
+  try {
+    @{2:test}throw '$EXCEPTION_MARKER';
+  } on String catch (e) {
+    rethrow;
+  }
+}
+''',
+  '''
+import 'package:expect/expect.dart';
+main() {
+  // This call is no longer on the stack when the error is thrown.
+  @{:main}test();
+}
+@NoInline()
+test() async {
+  @{1:test}throw '$EXCEPTION_MARKER';
+}
+''',
+  '''
+import 'package:expect/expect.dart';
+main() {
+  test1();
+}
+@NoInline()
+test1() async {
+  // This call is no longer on the stack when the error is thrown.
+  await @{:test1}test2();
+}
+@NoInline()
+test2() async {
+  @{1:test2}throw '$EXCEPTION_MARKER';
+}
+''',
+  '''
+import 'package:expect/expect.dart';
+main() {
+  test1();
+}
+@NoInline()
+test1() async {
+  @{1:test1}test2();
+}
+@NoInline()
+test2() {
+  @{2:test2}throw '$EXCEPTION_MARKER';
+}
+''',
+  '''
+import 'package:expect/expect.dart';
+main() {
+  // This call is no longer on the stack when the error is thrown.
+  @{:main}test();
+}
+test() async {
+  var c = @{1:test}new Class();
+}
+class Class {
+  @NoInline()
+  Class() {
+    @{2:Class}throw '$EXCEPTION_MARKER';
+  }
+}
+''',
+];
+
+class Test {
+  final String code;
+  final List<StackTraceLine> expectedLines;
+  final List<StackTraceLine> unexpectedLines;
+
+  Test(this.code, this.expectedLines, this.unexpectedLines);
+}
+
+const int _LF = 0x0A;
+const int _CR = 0x0D;
+const int _LBRACE = 0x7B;
+
+Test processTestCode(String code) {
+  StringBuffer codeBuffer = new StringBuffer();
+  Map<int, StackTraceLine> stackTraceMap = <int, StackTraceLine>{};
+  List<StackTraceLine> unexpectedLines = <StackTraceLine>[];
+  int index = 0;
+  int lineNo = 1;
+  int columnNo = 1;
+  while (index < code.length) {
+    int charCode = code.codeUnitAt(index);
+    switch (charCode) {
+      case _LF:
+        codeBuffer.write('\n');
+        lineNo++;
+        columnNo = 1;
+        break;
+      case _CR:
+        if (index + 1 < code.length && code.codeUnitAt(index + 1) == _LF) {
+          index++;
+        }
+        codeBuffer.write('\n');
+        lineNo++;
+        columnNo = 1;
+        break;
+      case 0x40:
+        if (index + 1 < code.length && code.codeUnitAt(index + 1) == _LBRACE) {
+          int colonIndex = code.indexOf(':', index);
+          int endIndex = code.indexOf('}', index);
+          String methodName = code.substring(colonIndex + 1, endIndex);
+          String indexText = code.substring(index + 2, colonIndex);
+          StackTraceLine stackTraceLine =
+              new StackTraceLine(methodName, INPUT_FILE_NAME, lineNo, columnNo);
+          if (indexText == '') {
+            unexpectedLines.add(stackTraceLine);
+          } else {
+            int stackTraceIndex = int.parse(indexText);
+            assert(!stackTraceMap.containsKey(stackTraceIndex));
+            stackTraceMap[stackTraceIndex] = stackTraceLine;
+          }
+          index = endIndex;
+        } else {
+          codeBuffer.writeCharCode(charCode);
+          columnNo++;
+        }
+        break;
+      default:
+        codeBuffer.writeCharCode(charCode);
+        columnNo++;
+    }
+    index++;
+  }
+  List<StackTraceLine> expectedLines = <StackTraceLine>[];
+  for (int stackTraceIndex in (stackTraceMap.keys.toList()..sort()).reversed) {
+    expectedLines.add(stackTraceMap[stackTraceIndex]);
+  }
+  return new Test(codeBuffer.toString(), expectedLines, unexpectedLines);
+}
+
+void main(List<String> arguments) {
+  bool verbose = false;
+  bool printJs = false;
+  List<int> indices;
+  for (String arg in arguments) {
+    if (arg == '-v') {
+      verbose = true;
+    } else if (arg == '--print-js') {
+      printJs = true;
+    } else {
+      int index = int.parse(arg, onError: (_) => null);
+      if (index != null) {
+        indices ??= <int>[];
+        if (index < 0 || index >= TESTS.length) {
+          print('Index $index out of bounds: [0;${TESTS.length - 1}]');
+        } else {
+          indices.add(index);
+        }
+      }
+    }
+  }
+  if (indices == null) {
+    indices = new List<int>.generate(TESTS.length, (i) => i);
+  }
+  asyncTest(() async {
+    for (int index in indices) {
+      await runTest(index, processTestCode(TESTS[index]),
+          printJs: printJs, verbose: verbose);
+    }
+  });
+}
+
+Future runTest(int index, Test test,
+    {bool printJs: false, bool verbose: false}) async {
+  Directory tmpDir = await createTempDir();
+  String input = '${tmpDir.path}/$INPUT_FILE_NAME';
+  new File(input).writeAsStringSync(test.code);
+  String output = '${tmpDir.path}/out.js';
+  List<String> arguments = [
+    '-o$output',
+    '--library-root=sdk',
+    '--packages=${Platform.packageConfig}',
+    Flags.useNewSourceInfo,
+    input,
+  ];
+  print("--$index------------------------------------------------------------");
+  print("Compiling dart2js ${arguments.join(' ')}\n${test.code}");
+  CompilationResult compilationResult = await entry.internalMain(arguments);
+  Expect.isTrue(compilationResult.isSuccess,
+      "Unsuccessful compilation of test:\n${test.code}");
+  CompilerImpl compiler = compilationResult.compiler;
+  SingleMapping sourceMap = new SingleMapping.fromJson(
+      JSON.decode(new File('$output.map').readAsStringSync()));
+
+  if (printJs) {
+    print('JavaScript output:');
+    print(new File(output).readAsStringSync());
+  }
+  print("Running d8 $output");
+  ProcessResult runResult = Process.runSync(d8executable,
+      ['sdk/lib/_internal/js_runtime/lib/preambles/d8.js', output]);
+  String out = '${runResult.stderr}\n${runResult.stdout}';
+  if (verbose) {
+    print('d8 output:');
+    print(out);
+  }
+  List<String> lines = out.split(new RegExp(r'(\r|\n|\r\n)'));
+  List<StackTraceLine> jsStackTrace = <StackTraceLine>[];
+  bool seenMarker = false;
+  for (String line in lines) {
+    if (seenMarker) {
+      line = line.trim();
+      if (line.startsWith('at ')) {
+        jsStackTrace.add(new StackTraceLine.fromText(line));
+      }
+    } else if (line == EXCEPTION_MARKER) {
+      seenMarker = true;
+    }
+  }
+
+  List<StackTraceLine> dartStackTrace = <StackTraceLine>[];
+  for (StackTraceLine line in jsStackTrace) {
+    TargetEntry targetEntry = _findColumn(line.lineNo - 1, line.columnNo - 1,
+        _findLine(sourceMap, line.lineNo - 1));
+    if (targetEntry == null) {
+      dartStackTrace.add(line);
+    } else {
+      String methodName;
+      if (targetEntry.sourceNameId != 0) {
+        methodName = sourceMap.names[targetEntry.sourceNameId];
+      }
+      String fileName;
+      if (targetEntry.sourceUrlId != 0) {
+        fileName = sourceMap.urls[targetEntry.sourceUrlId];
+      }
+      dartStackTrace.add(new StackTraceLine(methodName, fileName,
+          targetEntry.sourceLine + 1, targetEntry.sourceColumn + 1));
+    }
+  }
+
+  int expectedIndex = 0;
+  List<StackTraceLine> unexpectedLines = <StackTraceLine>[];
+  for (StackTraceLine line in dartStackTrace) {
+    if (expectedIndex < test.expectedLines.length) {
+      StackTraceLine expectedLine = test.expectedLines[expectedIndex];
+      if (line.methodName == expectedLine.methodName &&
+          line.lineNo == expectedLine.lineNo &&
+          line.columnNo == expectedLine.columnNo) {
+        expectedIndex++;
+      }
+    }
+    for (StackTraceLine unexpectedLine in test.unexpectedLines) {
+      if (line.methodName == unexpectedLine.methodName &&
+          line.lineNo == unexpectedLine.lineNo &&
+          line.columnNo == unexpectedLine.columnNo) {
+        unexpectedLines.add(line);
+      }
+    }
+  }
+  if (verbose) {
+    print('JavaScript stacktrace:');
+    print(jsStackTrace.join('\n'));
+    print('Dart stacktrace:');
+    print(dartStackTrace.join('\n'));
+  }
+  Expect.equals(
+      expectedIndex,
+      test.expectedLines.length,
+      "Missing stack trace lines for test:\n${test.code}\n"
+      "Actual:\n${dartStackTrace.join('\n')}\n"
+      "Expected:\n${test.expectedLines.join('\n')}\n");
+  Expect.isTrue(
+      unexpectedLines.isEmpty,
+      "Unexpected stack trace lines for test:\n${test.code}\n"
+      "Actual:\n${dartStackTrace.join('\n')}\n"
+      "Unexpected:\n${test.unexpectedLines.join('\n')}\n");
+
+  print("Deleting '${tmpDir.path}'.");
+  tmpDir.deleteSync(recursive: true);
+}
+
+class StackTraceLine {
+  String methodName;
+  String fileName;
+  int lineNo;
+  int columnNo;
+
+  StackTraceLine(this.methodName, this.fileName, this.lineNo, this.columnNo);
+
+  /// Creates a [StackTraceLine] by parsing a d8 stack trace line [text]. The
+  /// expected formats are
+  ///
+  ///     at <methodName>(<fileName>:<lineNo>:<columnNo>)
+  ///     at <methodName>(<fileName>:<lineNo>)
+  ///     at <methodName>(<fileName>)
+  ///     at <fileName>:<lineNo>:<columnNo>
+  ///     at <fileName>:<lineNo>
+  ///     at <fileName>
+  ///
+  factory StackTraceLine.fromText(String text) {
+    text = text.trim();
+    assert(text.startsWith('at '));
+    text = text.substring('at '.length);
+    String methodName;
+    if (text.endsWith(')')) {
+      int nameEnd = text.indexOf(' (');
+      methodName = text.substring(0, nameEnd);
+      text = text.substring(nameEnd + 2, text.length - 1);
+    }
+    int lineNo;
+    int columnNo;
+    String fileName;
+    int lastColon = text.lastIndexOf(':');
+    if (lastColon != -1) {
+      int lastValue =
+          int.parse(text.substring(lastColon + 1), onError: (_) => null);
+      if (lastValue != null) {
+        int secondToLastColon = text.lastIndexOf(':', lastColon - 1);
+        if (secondToLastColon != -1) {
+          int secondToLastValue = int.parse(
+              text.substring(secondToLastColon + 1, lastColon),
+              onError: (_) => null);
+          if (secondToLastValue != null) {
+            lineNo = secondToLastValue;
+            columnNo = lastValue;
+            fileName = text.substring(0, secondToLastColon);
+          } else {
+            lineNo = lastValue;
+            fileName = text.substring(0, lastColon);
+          }
+        } else {
+          lineNo = lastValue;
+          fileName = text.substring(0, lastColon);
+        }
+      } else {
+        fileName = text;
+      }
+    } else {
+      fileName = text;
+    }
+    return new StackTraceLine(methodName, fileName, lineNo, columnNo);
+  }
+
+  String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.write('  at ');
+    if (methodName != null) {
+      sb.write(methodName);
+      sb.write(' (');
+      sb.write(fileName ?? '?');
+      sb.write(':');
+      sb.write(lineNo);
+      sb.write(':');
+      sb.write(columnNo);
+      sb.write(')');
+    } else {
+      sb.write(fileName ?? '?');
+      sb.write(':');
+      sb.write(lineNo);
+      sb.write(':');
+      sb.write(columnNo);
+    }
+    return sb.toString();
+  }
+}
+
+/// Returns [TargetLineEntry] which includes the location in the target [line]
+/// number. In particular, the resulting entry is the last entry whose line
+/// number is lower or equal to [line].
+///
+/// Copied from [SingleMapping._findLine].
+TargetLineEntry _findLine(SingleMapping sourceMap, int line) {
+  int index = binarySearch(sourceMap.lines, (e) => e.line > line);
+  return (index <= 0) ? null : sourceMap.lines[index - 1];
+}
+
+/// Returns [TargetEntry] which includes the location denoted by
+/// [line], [column]. If [lineEntry] corresponds to [line], then this will be
+/// the last entry whose column is lower or equal than [column]. If
+/// [lineEntry] corresponds to a line prior to [line], then the result will be
+/// the very last entry on that line.
+///
+/// Copied from [SingleMapping._findColumn].
+TargetEntry _findColumn(int line, int column, TargetLineEntry lineEntry) {
+  if (lineEntry == null || lineEntry.entries.length == 0) return null;
+  if (lineEntry.line != line) return lineEntry.entries.last;
+  var entries = lineEntry.entries;
+  int index = binarySearch(entries, (e) => e.column > column);
+  return (index <= 0) ? null : entries[index - 1];
+}
+
+/// Returns the path of the d8 executable.
+String get d8executable {
+  if (Platform.isWindows) {
+    return 'third_party/d8/windows/d8.exe';
+  } else if (Platform.isLinux) {
+    return 'third_party/d8/linux/d8';
+  } else if (Platform.isMacOS) {
+    return 'third_party/d8/macos/d8';
+  }
+  throw new UnsupportedError('Unsupported platform.');
+}
diff --git a/tests/compiler/dart2js/sourcemaps/trace_graph.dart b/tests/compiler/dart2js/sourcemaps/trace_graph.dart
index 0db1e18..feceab2 100644
--- a/tests/compiler/dart2js/sourcemaps/trace_graph.dart
+++ b/tests/compiler/dart2js/sourcemaps/trace_graph.dart
@@ -20,7 +20,7 @@
 
   void addStep(TraceStep step) {
     steps.add(step);
-    int offset = step.offset.subexpressionOffset;
+    int offset = step.offset.value;
     TraceStep existingStep = offsetMap[offset];
     if (existingStep != null) {
       // TODO(johnniwinther): Fix problems with reuse of JS nodes from
diff --git a/tests/compiler/dart2js/trust_type_annotations_test.dart b/tests/compiler/dart2js/trust_type_annotations_test.dart
index c140fed..764e5ef 100644
--- a/tests/compiler/dart2js/trust_type_annotations_test.dart
+++ b/tests/compiler/dart2js/trust_type_annotations_test.dart
@@ -50,7 +50,7 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST, uri, trustTypeAnnotations: true);
   asyncTest(() => compiler.run(uri).then((_) {
-        var typesInferrer = compiler.globalInference.typesInferrer;
+        var typesInferrer = compiler.globalInference.typesInferrerInternal;
 
         ClassElement classA = findElement(compiler, "A");
 
diff --git a/tests/compiler/dart2js/type_checker_test.dart b/tests/compiler/dart2js/type_checker_test.dart
index 0ac90d1..96dba28 100644
--- a/tests/compiler/dart2js/type_checker_test.dart
+++ b/tests/compiler/dart2js/type_checker_test.dart
@@ -2724,7 +2724,7 @@
   Token tokens = scan(text);
   NodeListener listener =
       new NodeListener(const ScannerOptions(), compiler.reporter, null);
-  Parser parser = new Parser(listener, new MockParserOptions());
+  Parser parser = new Parser(listener);
   parser.parseStatement(tokens);
   Node node = listener.popNode();
   Element compilationUnit = new CompilationUnitElementX(
@@ -2768,7 +2768,7 @@
   Token tokens = scan(text);
   NodeListener listener =
       new NodeListener(const ScannerOptions(), compiler.reporter, null);
-  Parser parser = new Parser(listener, new MockParserOptions(),
+  Parser parser = new Parser(listener,
       asyncAwaitKeywordsEnabled: element.asyncMarker != AsyncMarker.SYNC);
   parser.parseStatement(tokens);
   Node node = listener.popNode();
diff --git a/tests/compiler/dart2js/type_combination_test.dart b/tests/compiler/dart2js/type_combination_test.dart
index f15d471f..bde511b 100644
--- a/tests/compiler/dart2js/type_combination_test.dart
+++ b/tests/compiler/dart2js/type_combination_test.dart
@@ -8,6 +8,8 @@
 import 'package:compiler/src/js_backend/js_backend.dart';
 import 'package:compiler/src/types/types.dart';
 import 'package:compiler/src/world.dart';
+import 'package:compiler/src/universe/use.dart';
+import 'package:compiler/src/universe/world_impact.dart';
 import 'compiler_helper.dart';
 import 'type_mask_test_helper.dart';
 
@@ -736,24 +738,26 @@
     """);
     JavaScriptBackend backend = compiler.backend;
     BackendHelpers helpers = backend.helpers;
-    ClosedWorld world = compiler.openWorld.closeWorld();
+    ClosedWorld world = compiler.openWorld.closeWorld(compiler.reporter);
+    WorldImpactBuilderImpl impactBuilder = new WorldImpactBuilderImpl();
     helpers.interceptorsLibrary.forEachLocalMember((element) {
       if (element.isClass) {
         element.ensureResolved(compiler.resolution);
-        backend.registerInstantiatedType(element.rawType,
-            compiler.enqueuer.resolution, compiler.globalDependencies);
+        impactBuilder
+            .registerTypeUse(new TypeUse.instantiation(element.rawType));
       }
     });
     ClassElement patternImplClass = compiler.mainApp.find('PatternImpl');
     patternImplClass.ensureResolved(compiler.resolution);
 
-    backend.registerInstantiatedType(compiler.coreTypes.mapType(),
-        compiler.enqueuer.resolution, compiler.globalDependencies);
-    backend.registerInstantiatedType(compiler.coreTypes.functionType,
-        compiler.enqueuer.resolution, compiler.globalDependencies);
-    backend.registerInstantiatedType(patternImplClass.rawType,
-        compiler.enqueuer.resolution, compiler.globalDependencies);
-    compiler.openWorld.closeWorld();
+    impactBuilder.registerTypeUse(
+        new TypeUse.instantiation(compiler.coreTypes.mapType()));
+    impactBuilder.registerTypeUse(
+        new TypeUse.instantiation(compiler.coreTypes.functionType));
+    impactBuilder
+        .registerTypeUse(new TypeUse.instantiation(patternImplClass.rawType));
+    compiler.enqueuer.resolution.applyImpact(impactBuilder);
+    compiler.openWorld.closeWorld(compiler.reporter);
 
     // Grab hold of a supertype for String so we can produce potential
     // string types.
diff --git a/tests/compiler/dart2js/type_inference6_test.dart b/tests/compiler/dart2js/type_inference6_test.dart
index 7eaf0a5..a9cdc0a 100644
--- a/tests/compiler/dart2js/type_inference6_test.dart
+++ b/tests/compiler/dart2js/type_inference6_test.dart
@@ -24,8 +24,8 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST, uri);
   return compiler.run(uri).then((_) {
-    var commonMasks = compiler.commonMasks;
-    var typesInferrer = compiler.globalInference.typesInferrer;
+    var commonMasks = compiler.closedWorld.commonMasks;
+    var typesInferrer = compiler.globalInference.typesInferrerInternal;
     var element = findElement(compiler, "foo");
     var mask = typesInferrer.getReturnTypeOfElement(element);
     Expect.equals(commonMasks.uint31Type, simplify(mask, compiler));
diff --git a/tests/compiler/dart2js/type_inference7_test.dart b/tests/compiler/dart2js/type_inference7_test.dart
index 42b19b0..a8ebbb0 100644
--- a/tests/compiler/dart2js/type_inference7_test.dart
+++ b/tests/compiler/dart2js/type_inference7_test.dart
@@ -23,8 +23,8 @@
     // Assertions enabled:
     var compiler = compilerFor(TEST, uri, enableUserAssertions: true);
     await compiler.run(uri);
-    var commonMasks = compiler.commonMasks;
-    var typesInferrer = compiler.globalInference.typesInferrer;
+    var commonMasks = compiler.closedWorld.commonMasks;
+    var typesInferrer = compiler.globalInference.typesInferrerInternal;
     var foo = findElement(compiler, "foo");
     // Return type is null|bool.
     var mask = typesInferrer.getReturnTypeOfElement(foo);
@@ -52,8 +52,8 @@
     // Assertions disabled:
     var compiler = compilerFor(TEST, uri, enableUserAssertions: false);
     await compiler.run(uri);
-    var commonMasks = compiler.commonMasks;
-    var typesInferrer = compiler.globalInference.typesInferrer;
+    var commonMasks = compiler.closedWorld.commonMasks;
+    var typesInferrer = compiler.globalInference.typesInferrerInternal;
     var foo = findElement(compiler, "foo");
     // Return type is null.
     var mask = typesInferrer.getReturnTypeOfElement(foo);
diff --git a/tests/compiler/dart2js/type_inference8_test.dart b/tests/compiler/dart2js/type_inference8_test.dart
index bcae368..fb4717c 100644
--- a/tests/compiler/dart2js/type_inference8_test.dart
+++ b/tests/compiler/dart2js/type_inference8_test.dart
@@ -34,8 +34,8 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST1, uri);
   return compiler.run(uri).then((_) {
-    var commonMasks = compiler.commonMasks;
-    var typesInferrer = compiler.globalInference.typesInferrer;
+    var commonMasks = compiler.closedWorld.commonMasks;
+    var typesInferrer = compiler.globalInference.typesInferrerInternal;
     var element = findElement(compiler, "foo");
     var mask = typesInferrer.getReturnTypeOfElement(element);
     var falseType =
@@ -77,8 +77,8 @@
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(TEST2, uri);
   return compiler.run(uri).then((_) {
-    var commonMasks = compiler.commonMasks;
-    var typesInferrer = compiler.globalInference.typesInferrer;
+    var commonMasks = compiler.closedWorld.commonMasks;
+    var typesInferrer = compiler.globalInference.typesInferrerInternal;
     var element = findElement(compiler, "foo");
     var mask = typesInferrer.getReturnTypeOfElement(element);
     // Can't infer value for foo's return type, it could be either true or false
diff --git a/tests/compiler/dart2js/type_inference_switch_test.dart b/tests/compiler/dart2js/type_inference_switch_test.dart
index bac1abd..181fc41 100644
--- a/tests/compiler/dart2js/type_inference_switch_test.dart
+++ b/tests/compiler/dart2js/type_inference_switch_test.dart
@@ -135,15 +135,15 @@
   var compiler = compilerFor(test, uri);
 
   checkTypeOf(String name, TypeMask type) {
-    var commonMasks = compiler.commonMasks;
-    var typesInferrer = compiler.globalInference.typesInferrer;
+    var commonMasks = compiler.closedWorld.commonMasks;
+    var typesInferrer = compiler.globalInference.typesInferrerInternal;
     var element = findElement(compiler, name);
     var mask = typesInferrer.getReturnTypeOfElement(element);
     Expect.equals(type, simplify(mask, compiler));
   }
 
   return compiler.run(uri).then((_) {
-    checker(compiler.commonMasks, checkTypeOf);
+    checker(compiler.closedWorld.commonMasks, checkTypeOf);
   });
 }
 
diff --git a/tests/compiler/dart2js/type_mask_test.dart b/tests/compiler/dart2js/type_mask_test.dart
index fae28df..3cb01a0 100644
--- a/tests/compiler/dart2js/type_mask_test.dart
+++ b/tests/compiler/dart2js/type_mask_test.dart
@@ -21,7 +21,7 @@
 main() {
   Uri uri = new Uri(scheme: 'source');
   var compiler = compilerFor(CODE, uri);
-  var closedWorld = compiler.openWorld.closeWorld();
+  var closedWorld = compiler.openWorld.closeWorld(compiler.reporter);
 
   asyncTest(() => compiler.run(uri).then((_) {
         var classA = findElement(compiler, 'A');
diff --git a/tests/compiler/dart2js/union_type_test.dart b/tests/compiler/dart2js/union_type_test.dart
index 336ce10..65e6da6 100644
--- a/tests/compiler/dart2js/union_type_test.dart
+++ b/tests/compiler/dart2js/union_type_test.dart
@@ -22,7 +22,8 @@
       }
       """,
         useMockCompiler: false);
-    ClosedWorld world = env.compiler.openWorld.closeWorld();
+    ClosedWorld world =
+        env.compiler.openWorld.closeWorld(env.compiler.reporter);
     FlatTypeMask mask1 = new FlatTypeMask.exact(env.getElement('A'));
     FlatTypeMask mask2 = new FlatTypeMask.exact(env.getElement('B'));
     UnionTypeMask union1 = mask1.nonNullable().union(mask2, world);
diff --git a/tests/compiler/dart2js/unparser2_test.dart b/tests/compiler/dart2js/unparser2_test.dart
index d63bdb4..820fab7 100644
--- a/tests/compiler/dart2js/unparser2_test.dart
+++ b/tests/compiler/dart2js/unparser2_test.dart
@@ -93,7 +93,7 @@
   Token beginToken = scanner.tokenize();
   NodeListener listener =
       new NodeListener(const ScannerOptions(), diagnosticListener, element);
-  Parser parser = new Parser(listener, new MockParserOptions());
+  Parser parser = new Parser(listener);
   parser.parseUnit(beginToken);
   Node node = listener.popNode();
   Expect.isTrue(listener.nodes.isEmpty);
diff --git a/tests/compiler/dart2js/world_test.dart b/tests/compiler/dart2js/world_test.dart
index c68e05a..4e29307 100644
--- a/tests/compiler/dart2js/world_test.dart
+++ b/tests/compiler/dart2js/world_test.dart
@@ -7,8 +7,9 @@
 import 'package:expect/expect.dart';
 import 'package:async_helper/async_helper.dart';
 import 'type_test_helper.dart';
-import 'package:compiler/src/common.dart';
-import 'package:compiler/src/elements/elements.dart' show Element, ClassElement;
+import 'package:compiler/src/common/names.dart';
+import 'package:compiler/src/elements/elements.dart'
+    show Element, ClassElement, LibraryElement;
 import 'package:compiler/src/universe/class_set.dart';
 import 'package:compiler/src/world.dart' show ClosedWorld;
 
@@ -16,6 +17,7 @@
   asyncTest(() async {
     await testClassSets();
     await testProperties();
+    await testNativeClasses();
   });
 }
 
@@ -33,6 +35,7 @@
       class X {}
       """,
       mainSource: r"""
+      import 'dart:html' as html;
       main() {
         new A();
         new B();
@@ -41,6 +44,8 @@
         new E();
         new F();
         new G();
+        html.window;
+        new html.Worker('');
       }
       """,
       useMockCompiler: false);
@@ -298,3 +303,210 @@
   check("H3", hasStrictSubtype: false, hasOnlySubclasses: true);
   check("H4", hasStrictSubtype: false, hasOnlySubclasses: true);
 }
+
+testNativeClasses() async {
+  var env = await TypeEnvironment.create('',
+      mainSource: r"""
+      import 'dart:html' as html;
+      main() {
+        html.window; // Creates 'Window'.
+        new html.Worker(''); // Creates 'Worker'.
+        new html.CanvasElement() // Creates CanvasElement
+            ..getContext(''); // Creates CanvasRenderingContext2D
+      }
+      """,
+      useMockCompiler: false);
+  ClosedWorld closedWorld = env.compiler.closedWorld;
+  LibraryElement dart_html =
+      env.compiler.libraryLoader.lookupLibrary(Uris.dart_html);
+
+  ClassElement clsEventTarget = dart_html.findExported('EventTarget');
+  ClassElement clsWindow = dart_html.findExported('Window');
+  ClassElement clsAbstractWorker = dart_html.findExported('AbstractWorker');
+  ClassElement clsWorker = dart_html.findExported('Worker');
+  ClassElement clsCanvasElement = dart_html.findExported('CanvasElement');
+  ClassElement clsCanvasRenderingContext =
+      dart_html.findExported('CanvasRenderingContext');
+  ClassElement clsCanvasRenderingContext2D =
+      dart_html.findExported('CanvasRenderingContext2D');
+
+  List<ClassElement> allClasses = [
+    clsEventTarget,
+    clsWindow,
+    clsAbstractWorker,
+    clsWorker,
+    clsCanvasElement,
+    clsCanvasRenderingContext,
+    clsCanvasRenderingContext2D
+  ];
+
+  check(ClassElement cls,
+      {bool isDirectlyInstantiated,
+      bool isAbstractlyInstantiated,
+      bool isIndirectlyInstantiated,
+      bool hasStrictSubtype,
+      bool hasOnlySubclasses,
+      ClassElement lubOfInstantiatedSubclasses,
+      ClassElement lubOfInstantiatedSubtypes,
+      int instantiatedSubclassCount,
+      int instantiatedSubtypeCount,
+      List<ClassElement> subclasses: const <ClassElement>[],
+      List<ClassElement> subtypes: const <ClassElement>[]}) {
+    ClassSet classSet = closedWorld.getClassSet(cls);
+    ClassHierarchyNode node = classSet.node;
+
+    String dumpText = '\n${closedWorld.dump(cls)}';
+
+    Expect.equals(
+        isDirectlyInstantiated,
+        closedWorld.isDirectlyInstantiated(cls),
+        "Unexpected isDirectlyInstantiated property on $cls.$dumpText");
+    Expect.equals(
+        isAbstractlyInstantiated,
+        closedWorld.isAbstractlyInstantiated(cls),
+        "Unexpected isAbstractlyInstantiated property on $cls.$dumpText");
+    Expect.equals(
+        isIndirectlyInstantiated,
+        closedWorld.isIndirectlyInstantiated(cls),
+        "Unexpected isIndirectlyInstantiated property on $cls.$dumpText");
+    Expect.equals(hasStrictSubtype, closedWorld.hasAnyStrictSubtype(cls),
+        "Unexpected hasAnyStrictSubtype property on $cls.$dumpText");
+    Expect.equals(hasOnlySubclasses, closedWorld.hasOnlySubclasses(cls),
+        "Unexpected hasOnlySubclasses property on $cls.$dumpText");
+    Expect.equals(
+        lubOfInstantiatedSubclasses,
+        node.getLubOfInstantiatedSubclasses(),
+        "Unexpected getLubOfInstantiatedSubclasses() result on $cls.$dumpText");
+    Expect.equals(
+        lubOfInstantiatedSubtypes,
+        classSet.getLubOfInstantiatedSubtypes(),
+        "Unexpected getLubOfInstantiatedSubtypes() result on $cls.$dumpText");
+    if (instantiatedSubclassCount != null) {
+      Expect.equals(instantiatedSubclassCount, node.instantiatedSubclassCount,
+          "Unexpected instantiatedSubclassCount property on $cls.$dumpText");
+    }
+    if (instantiatedSubtypeCount != null) {
+      Expect.equals(instantiatedSubtypeCount, classSet.instantiatedSubtypeCount,
+          "Unexpected instantiatedSubtypeCount property on $cls.$dumpText");
+    }
+    for (ClassElement other in allClasses) {
+      if (other == cls) continue;
+      if (!closedWorld.isExplicitlyInstantiated(other)) continue;
+      Expect.equals(
+          subclasses.contains(other),
+          closedWorld.isSubclassOf(other, cls),
+          "Unexpected subclass relation between $other and $cls.");
+      Expect.equals(
+          subtypes.contains(other),
+          closedWorld.isSubtypeOf(other, cls),
+          "Unexpected subtype relation between $other and $cls.");
+    }
+
+    Set<ClassElement> strictSubclasses = new Set<ClassElement>();
+    closedWorld.forEachStrictSubclassOf(cls, (ClassElement other) {
+      if (allClasses.contains(other)) {
+        strictSubclasses.add(other);
+      }
+    });
+    Expect.setEquals(subclasses, strictSubclasses,
+        "Unexpected strict subclasses of $cls: ${strictSubclasses}.");
+
+    Set<ClassElement> strictSubtypes = new Set<ClassElement>();
+    closedWorld.forEachStrictSubtypeOf(cls, (ClassElement other) {
+      if (allClasses.contains(other)) {
+        strictSubtypes.add(other);
+      }
+    });
+    Expect.setEquals(subtypes, strictSubtypes,
+        "Unexpected strict subtypes of $cls: $strictSubtypes.");
+  }
+
+  // Extended by Window.
+  check(clsEventTarget,
+      isDirectlyInstantiated: false,
+      isAbstractlyInstantiated: false,
+      isIndirectlyInstantiated: true,
+      hasStrictSubtype: true,
+      hasOnlySubclasses: true,
+      lubOfInstantiatedSubclasses: clsEventTarget,
+      lubOfInstantiatedSubtypes: clsEventTarget,
+      // May vary with implementation, do no test.
+      instantiatedSubclassCount: null,
+      instantiatedSubtypeCount: null,
+      subclasses: [clsWindow, clsCanvasElement, clsWorker],
+      subtypes: [clsWindow, clsCanvasElement, clsWorker]);
+
+  // Created by 'html.window'.
+  check(clsWindow,
+      isDirectlyInstantiated: false,
+      isAbstractlyInstantiated: true,
+      isIndirectlyInstantiated: false,
+      hasStrictSubtype: false,
+      hasOnlySubclasses: true,
+      lubOfInstantiatedSubclasses: clsWindow,
+      lubOfInstantiatedSubtypes: clsWindow,
+      instantiatedSubclassCount: 0,
+      instantiatedSubtypeCount: 0);
+
+  // Implemented by 'Worker'.
+  check(clsAbstractWorker,
+      isDirectlyInstantiated: false,
+      isAbstractlyInstantiated: false,
+      isIndirectlyInstantiated: false,
+      hasStrictSubtype: true,
+      hasOnlySubclasses: false,
+      lubOfInstantiatedSubclasses: null,
+      lubOfInstantiatedSubtypes: clsWorker,
+      instantiatedSubclassCount: 0,
+      instantiatedSubtypeCount: 1,
+      subtypes: [clsWorker]);
+
+  // Created by 'new html.Worker'.
+  check(clsWorker,
+      isDirectlyInstantiated: false,
+      isAbstractlyInstantiated: true,
+      isIndirectlyInstantiated: false,
+      hasStrictSubtype: false,
+      hasOnlySubclasses: true,
+      lubOfInstantiatedSubclasses: clsWorker,
+      lubOfInstantiatedSubtypes: clsWorker,
+      instantiatedSubclassCount: 0,
+      instantiatedSubtypeCount: 0);
+
+  // Created by 'new html.CanvasElement'.
+  check(clsCanvasElement,
+      isDirectlyInstantiated: false,
+      isAbstractlyInstantiated: true,
+      isIndirectlyInstantiated: false,
+      hasStrictSubtype: false,
+      hasOnlySubclasses: true,
+      lubOfInstantiatedSubclasses: clsCanvasElement,
+      lubOfInstantiatedSubtypes: clsCanvasElement,
+      instantiatedSubclassCount: 0,
+      instantiatedSubtypeCount: 0);
+
+  // Implemented by CanvasRenderingContext2D and RenderingContext.
+  check(clsCanvasRenderingContext,
+      isDirectlyInstantiated: false,
+      isAbstractlyInstantiated: false,
+      isIndirectlyInstantiated: false,
+      hasStrictSubtype: true,
+      hasOnlySubclasses: false,
+      lubOfInstantiatedSubclasses: null,
+      lubOfInstantiatedSubtypes: clsCanvasRenderingContext,
+      instantiatedSubclassCount: 0,
+      instantiatedSubtypeCount: 2,
+      subtypes: [clsCanvasRenderingContext2D]);
+
+  // Created by 'html.CanvasElement.getContext'.
+  check(clsCanvasRenderingContext2D,
+      isDirectlyInstantiated: false,
+      isAbstractlyInstantiated: true,
+      isIndirectlyInstantiated: false,
+      hasStrictSubtype: false,
+      hasOnlySubclasses: true,
+      lubOfInstantiatedSubclasses: clsCanvasRenderingContext2D,
+      lubOfInstantiatedSubtypes: clsCanvasRenderingContext2D,
+      instantiatedSubclassCount: 0,
+      instantiatedSubtypeCount: 0);
+}
diff --git a/tests/compiler/dart2js_extra/inference_super_set_call_test.dart b/tests/compiler/dart2js_extra/inference_super_set_call_test.dart
new file mode 100644
index 0000000..5a56023
--- /dev/null
+++ b/tests/compiler/dart2js_extra/inference_super_set_call_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.
+
+// Regression test for dart2js: we incorrectly modeled `super.x = rhs` as a
+// call and not an assignment, so the type of the expression was incorrectly
+// assumed to be the return type of the setter rather than the type of the rhs.
+import 'package:expect/expect.dart';
+
+abstract class A {
+  set x(v) {}
+  set z(v) {}
+  set y(v) { return 'hi';}
+}
+
+class S extends A {
+  var _x;      // was bad: inferred as null, than [null | int]
+  var _y = ''; // was bad: inferred as String, rather than [String | int]
+  var _z;      // was ok : inferred as [null | int]
+
+  set x(v) {
+    _x = super.x = v;
+  }
+
+  set z(v) {
+    super.z = v;
+    _z = v;
+  }
+
+  set y(v) {
+    _y = super.y = v;
+  }
+
+  get isXNull => _x == null;
+  get isZNull => _z == null;
+}
+
+main() {
+  var s = new S()
+    ..x = 2
+    ..y = 2
+    ..z = 2;
+  Expect.equals(false, s.isXNull);      // was incorrectly optimized to 'true'
+  Expect.equals(false, s._y is String); // was incorrectly optimized to 'true'
+  Expect.equals(false, s.isZNull);      // prints false
+}
diff --git a/tests/compiler/dart2js_extra/multi_global_def_single_instantiation_test.dart b/tests/compiler/dart2js_extra/multi_global_def_single_instantiation_test.dart
new file mode 100644
index 0000000..f118b61
--- /dev/null
+++ b/tests/compiler/dart2js_extra/multi_global_def_single_instantiation_test.dart
@@ -0,0 +1,6 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+var y, w, z, x = [], q, r = [];
+main() => [x, r];
diff --git a/tests/compiler/dart2js_extra/round_constant_folding_test.dart b/tests/compiler/dart2js_extra/round_constant_folding_test.dart
new file mode 100644
index 0000000..cd2ad5a
--- /dev/null
+++ b/tests/compiler/dart2js_extra/round_constant_folding_test.dart
@@ -0,0 +1,167 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+const double PD1 = 0.0;
+const double PD2 = double.MIN_POSITIVE;
+const double PD3 = 2.0 * double.MIN_POSITIVE;
+const double PD4 = 1.18e-38;
+const double PD5 = 1.18e-38 * 2;
+const double PD6 = 0.49999999999999994;
+const double PD7 = 0.5;
+const double PD8 = 0.9999999999999999;
+const double PD9 = 1.0;
+const double PD10 = 1.000000000000001;
+const double PD11 = double.MAX_FINITE;
+
+const double ND1 = -PD1;
+const double ND2 = -PD2;
+const double ND3 = -PD3;
+const double ND4 = -PD4;
+const double ND5 = -PD5;
+const double ND6 = -PD6;
+const double ND7 = -PD7;
+const double ND8 = -PD8;
+const double ND9 = -PD9;
+const double ND10 = -PD10;
+const double ND11 = -PD11;
+
+const X1 = double.INFINITY;
+const X2 = double.NEGATIVE_INFINITY;
+const X3 = double.NAN;
+
+// The following numbers are on the border of 52 bits.
+// For example: 4503599627370499 + 0.5 => 4503599627370500.
+const PQ1 = 4503599627370496.0;
+const PQ2 = 4503599627370497.0;
+const PQ3 = 4503599627370498.0;
+const PQ4 = 4503599627370499.0;
+const PQ5 = 9007199254740991.0;
+const PQ6 = 9007199254740992.0;
+
+const NQ1 = -PQ1;
+const NQ2 = -PQ2;
+const NQ3 = -PQ3;
+const NQ4 = -PQ4;
+const NQ5 = -PQ5;
+const NQ6 = -PQ6;
+
+const int PI1 = 0;
+const int PI2 = 1;
+const int PI3 = 0x1234;
+const int PI4 = 0x12345678;
+const int PI5 = 0x123456789AB;
+const int PI6 = 0x123456789ABCDEF;
+const int PI7 = 0x123456789ABCDEF0123456789ABCDEF0123456789ABCDEF;
+
+const int NI1 = 0-PI1;
+const int NI2 = -PI2;
+const int NI3 = -PI3;
+const int NI4 = -PI4;
+const int NI5 = -PI5;
+const int NI6 = -PI6;
+const int NI7 = -PI7;
+
+
+/// Ensures that the behaviour of `action()` is the same as `value.round()`.
+@NoInline()  // To ensure 'value.round()' has a non-constant receiver.
+check(value, action) {
+  var result1, result2;
+  try {
+    result1 = value.round();
+  } catch (e) {
+    result1 = e;
+  }
+
+  try {
+    result2 = action();
+  } catch (e) {
+    result2 = e;
+  }
+
+  Expect.equals(result1.runtimeType, result2.runtimeType);
+  if (result1 is num) {
+    Expect.equals(result1, result2);
+    Expect.equals(result1 is int, result2 is int);
+  } else {
+    Expect.equals(result1.runtimeType, result2.runtimeType);
+    Expect.isTrue(result1 is Error);
+  }
+}
+
+@NoInline()
+void unusedCall(num x) {
+  x.round(); // This call should not be removed since it might throw.
+}
+
+main() {
+  check(PD1, () => PD1.round());
+  check(PD2, () => PD2.round());
+  check(PD3, () => PD3.round());
+  check(PD4, () => PD4.round());
+  check(PD5, () => PD5.round());
+  check(PD6, () => PD6.round());
+  check(PD7, () => PD7.round());
+  check(PD8, () => PD8.round());
+  check(PD9, () => PD9.round());
+  check(PD10, () => PD10.round());
+  check(PD11, () => PD11.round());
+
+  check(ND1, () => ND1.round());
+  check(ND2, () => ND2.round());
+  check(ND3, () => ND3.round());
+  check(ND4, () => ND4.round());
+  check(ND5, () => ND5.round());
+  check(ND6, () => ND6.round());
+  check(ND7, () => ND7.round());
+  check(ND8, () => ND8.round());
+  check(ND9, () => ND9.round());
+  check(ND10, () => ND10.round());
+  check(ND11, () => ND11.round());
+
+  check(X1, () => X1.round());
+  check(X2, () => X2.round());
+  check(X3, () => X3.round());
+
+  check(PQ1, () => PQ1.round());
+  check(PQ2, () => PQ2.round());
+  check(PQ3, () => PQ3.round());
+  check(PQ4, () => PQ4.round());
+  check(PQ5, () => PQ5.round());
+  check(PQ6, () => PQ6.round());
+
+  check(NQ1, () => NQ1.round());
+  check(NQ2, () => NQ2.round());
+  check(NQ3, () => NQ3.round());
+  check(NQ4, () => NQ4.round());
+  check(NQ5, () => NQ5.round());
+  check(NQ6, () => NQ6.round());
+
+  check(PI1, () => PI1.round());
+  check(PI2, () => PI2.round());
+  check(PI3, () => PI3.round());
+  check(PI4, () => PI4.round());
+  check(PI5, () => PI5.round());
+  check(PI6, () => PI6.round());
+  check(PI7, () => PI7.round());
+
+  check(NI1, () => NI1.round());
+  check(NI2, () => NI2.round());
+  check(NI3, () => NI3.round());
+  check(NI4, () => NI4.round());
+  check(NI5, () => NI5.round());
+  check(NI6, () => NI6.round());
+  check(NI7, () => NI7.round());
+
+  // Check that the operation is not removed if it can throw, even if the result
+  // is unused.
+  Expect.throws(() { X1.round(); });
+  Expect.throws(() { X2.round(); });
+  Expect.throws(() { X3.round(); });
+  unusedCall(0);
+  Expect.throws(() { unusedCall(X1); });
+  Expect.throws(() { unusedCall(X2); });
+  Expect.throws(() { unusedCall(X3); });
+}
diff --git a/tests/compiler/dart2js_native/abstract_class_test.dart b/tests/compiler/dart2js_native/abstract_class_test.dart
index 18e0af3..d90fe2e 100644
--- a/tests/compiler/dart2js_native/abstract_class_test.dart
+++ b/tests/compiler/dart2js_native/abstract_class_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Native classes can have subclasses that are not declared to the program.  The
 // subclasses are indistinguishable from the base class.  This means that
@@ -29,17 +28,17 @@
 B.prototype.foo = function() { return 'B.foo'; };
 makeA = function(){return new A};
 makeB = function(){return new B};
+self.nativeConstructor(A);
+self.nativeConstructor(B);
 """;
 
-var inscrutable;
 main() {
+  nativeTesting();
   setup();
-  inscrutable = (x) => x;
-  inscrutable = inscrutable(inscrutable);
 
   var a = makeA();
   var b = makeB();
-  var c = inscrutable(new C());
+  var c = confuse(new C());
 
   Expect.isTrue(a is A);
   Expect.isFalse(b is A);
diff --git a/tests/compiler/dart2js_native/bound_closure_super_test.dart b/tests/compiler/dart2js_native/bound_closure_super_test.dart
index 35b19e0..d97d8e1 100644
--- a/tests/compiler/dart2js_native/bound_closure_super_test.dart
+++ b/tests/compiler/dart2js_native/bound_closure_super_test.dart
@@ -5,7 +5,7 @@
 // Test calling convention of property extraction closures (super edition).
 library bound_closure_super_test;
 
-import "package:expect/expect.dart";
+import 'package:expect/expect.dart';
 
 import 'bound_closure_test.dart' as bound_closure_test;
 
diff --git a/tests/compiler/dart2js_native/bound_closure_test.dart b/tests/compiler/dart2js_native/bound_closure_test.dart
index a637121..325f23f 100644
--- a/tests/compiler/dart2js_native/bound_closure_test.dart
+++ b/tests/compiler/dart2js_native/bound_closure_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import 'native_testing.dart';
 
 // Test calling convention of property extraction closures.
 
@@ -42,9 +41,13 @@
 makeBB = function(){return new BB;};
 makeCC = function(){return new CC;};
 inscrutable = function(a){return a;};
+
+self.nativeConstructor(BB);
+self.nativeConstructor(CC);
 """;
 
 main() {
+  nativeTesting();
   setup();
   var a = inscrutable(new AA());
   var b = inscrutable(makeBB());
diff --git a/tests/compiler/dart2js_native/browser_compat_1_prepatched_test.dart b/tests/compiler/dart2js_native/browser_compat_1_prepatched_test.dart
index 40662d8..606d4b1 100644
--- a/tests/compiler/dart2js_native/browser_compat_1_prepatched_test.dart
+++ b/tests/compiler/dart2js_native/browser_compat_1_prepatched_test.dart
@@ -2,10 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
-//import 'dart:_foreign_helper' show JS;
-//import 'dart:_js_helper' show Creates, setNativeSubclassDispatchRecord;
+import "native_testing.dart";
 
 // Test for dartNativeDispatchHooksTransformer, getTag hook.
 
@@ -42,6 +39,10 @@
 makeT1B = function(){return new T1CrazyB;};
 makeT1C = function(){return new T1fakeA;};
 
+self.nativeConstructor(T1A);
+self.nativeConstructor(T1CrazyB);
+self.nativeConstructor(T1fakeA);
+
 var getTagCount = 0;
 getTagCallCount = function() { return getTagCount; }
 
@@ -69,11 +70,9 @@
 dartNativeDispatchHooksTransformer = [transformer1];
 ''';
 
-var inscrutable;
-
 main() {
+  nativeTesting();
   setup();
-  inscrutable = (x) => x;
 
   var t1a = makeT1A();
   var t1b = makeT1B();
@@ -85,9 +84,9 @@
 
   Expect.equals(2, getTagCallCount());
 
-  Expect.equals(true, inscrutable(t1a) is T1A, '$t1a is T1A');
-  Expect.equals(true, inscrutable(t1b) is T1B, '$t1b is T1B');
-  Expect.equals(true, inscrutable(t1c) is T1C, '$t1c is T1C');
+  Expect.equals(true, confuse(t1a) is T1A, '$t1a is T1A');
+  Expect.equals(true, confuse(t1b) is T1B, '$t1b is T1B');
+  Expect.equals(true, confuse(t1c) is T1C, '$t1c is T1C');
 
   Expect.equals(2, getTagCallCount());
 }
diff --git a/tests/compiler/dart2js_native/browser_compat_1_unpatched_test.dart b/tests/compiler/dart2js_native/browser_compat_1_unpatched_test.dart
index 5e494d4..f2ada1e 100644
--- a/tests/compiler/dart2js_native/browser_compat_1_unpatched_test.dart
+++ b/tests/compiler/dart2js_native/browser_compat_1_unpatched_test.dart
@@ -2,10 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
-//import 'dart:_foreign_helper' show JS;
-//import 'dart:_js_helper' show Creates, setNativeSubclassDispatchRecord;
+import "native_testing.dart";
 
 // Test for dartNativeDispatchHooksTransformer, getTag hook.
 // Same as browser_compat_1_prepatched_test but with prepatching disabled.
@@ -43,6 +40,10 @@
 makeT1B = function(){return new T1CrazyB;};
 makeT1C = function(){return new T1fakeA;};
 
+self.nativeConstructor(T1A);
+self.nativeConstructor(T1CrazyB);
+self.nativeConstructor(T1fakeA);
+
 var getTagCount = 0;
 getTagCallCount = function() { return getTagCount; }
 
@@ -72,11 +73,9 @@
 dartNativeDispatchHooksTransformer = [transformer1];
 ''';
 
-var inscrutable;
-
 main() {
+  nativeTesting();
   setup();
-  inscrutable = (x) => x;
 
   var t1a = makeT1A();
   var t1b = makeT1B();
@@ -88,9 +87,9 @@
 
   Expect.equals(3, getTagCallCount());
 
-  Expect.equals(true, inscrutable(t1a) is T1A, '$t1a is T1A');
-  Expect.equals(true, inscrutable(t1b) is T1B, '$t1b is T1B');
-  Expect.equals(true, inscrutable(t1c) is T1C, '$t1c is T1C');
+  Expect.equals(true, confuse(t1a) is T1A, '$t1a is T1A');
+  Expect.equals(true, confuse(t1b) is T1B, '$t1b is T1B');
+  Expect.equals(true, confuse(t1c) is T1C, '$t1c is T1C');
 
   Expect.equals(3, getTagCallCount());
 }
diff --git a/tests/compiler/dart2js_native/browser_compat_2_test.dart b/tests/compiler/dart2js_native/browser_compat_2_test.dart
index eeb87fa..e659ce4 100644
--- a/tests/compiler/dart2js_native/browser_compat_2_test.dart
+++ b/tests/compiler/dart2js_native/browser_compat_2_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Test for dartNativeDispatchHooksTransformer
 //  - uncached, instance, leaf and interior caching modes.
@@ -63,6 +62,11 @@
 makeT1C = function(){return new T1C;};
 makeT1D = function(){return new T1D;};
 
+self.nativeConstructor(T1A);
+self.nativeConstructor(T1B);
+self.nativeConstructor(T1C);
+self.nativeConstructor(T1D);
+
 var getTagCount = 0;
 getTagCallCount = function() { return getTagCount; }
 clearTagCallCount = function() { getTagCount = 0; }
@@ -99,11 +103,9 @@
 dartNativeDispatchHooksTransformer = [transformer1, transformer2];
 ''';
 
-var inscrutable;
-
 main() {
+  nativeTesting();
   setup();
-  inscrutable = (x) => x;
 
   var t1a = makeT1A();
   var t1b = makeT1B();
@@ -111,17 +113,17 @@
   var t1d = makeT1D();
 
   clearTagCallCount();
-  Expect.equals("aA", inscrutable(t1a).foo(), 't1a is T1A');
-  Expect.equals("bB", inscrutable(t1b).foo(), 't1b is T1B');
-  Expect.equals("cC", inscrutable(t1c).foo(), 't1c is T1C');
-  Expect.equals("dD", inscrutable(t1d).foo(), 't1d is T1D');
+  Expect.equals("aA", confuse(t1a).foo(), 't1a is T1A');
+  Expect.equals("bB", confuse(t1b).foo(), 't1b is T1B');
+  Expect.equals("cC", confuse(t1c).foo(), 't1c is T1C');
+  Expect.equals("dD", confuse(t1d).foo(), 't1d is T1D');
   Expect.equals(4, getTagCallCount(), '4 fresh instances / types');
 
   clearTagCallCount();
-  Expect.equals("aA", inscrutable(t1a).foo(), 't1a is T1A');
-  Expect.equals("bB", inscrutable(t1b).foo(), 't1b is T1B');
-  Expect.equals("cC", inscrutable(t1c).foo(), 't1c is T1C');
-  Expect.equals("dD", inscrutable(t1d).foo(), 't1d is T1D');
+  Expect.equals("aA", confuse(t1a).foo(), 't1a is T1A');
+  Expect.equals("bB", confuse(t1b).foo(), 't1b is T1B');
+  Expect.equals("cC", confuse(t1c).foo(), 't1c is T1C');
+  Expect.equals("dD", confuse(t1d).foo(), 't1d is T1D');
   Expect.equals(1, getTagCallCount(), '1 = 1 uncached + (3 cached)');
 
   t1a = makeT1A();
@@ -130,18 +132,18 @@
   t1d = makeT1D();
 
   clearTagCallCount();
-  Expect.equals("aA", inscrutable(t1a).foo(), 't1a is T1A');
-  Expect.equals("bB", inscrutable(t1b).foo(), 't1b is T1B');
-  Expect.equals("cC", inscrutable(t1c).foo(), 't1c is T1C');
-  Expect.equals("dD", inscrutable(t1d).foo(), 't1d is T1D');
+  Expect.equals("aA", confuse(t1a).foo(), 't1a is T1A');
+  Expect.equals("bB", confuse(t1b).foo(), 't1b is T1B');
+  Expect.equals("cC", confuse(t1c).foo(), 't1c is T1C');
+  Expect.equals("dD", confuse(t1d).foo(), 't1d is T1D');
   Expect.equals(2, getTagCallCount(),
       '2 = 1 fresh instance + 1 uncached (+ 2 proto cached)');
 
   clearTagCallCount();
-  Expect.equals("aA", inscrutable(t1a).foo(), 't1a is T1A');
-  Expect.equals("bB", inscrutable(t1b).foo(), 't1b is T1B');
-  Expect.equals("cC", inscrutable(t1c).foo(), 't1c is T1C');
-  Expect.equals("dD", inscrutable(t1d).foo(), 't1d is T1D');
+  Expect.equals("aA", confuse(t1a).foo(), 't1a is T1A');
+  Expect.equals("bB", confuse(t1b).foo(), 't1b is T1B');
+  Expect.equals("cC", confuse(t1c).foo(), 't1c is T1C');
+  Expect.equals("dD", confuse(t1d).foo(), 't1d is T1D');
   Expect.equals(1, getTagCallCount(),
       '1 = 2 proto cached + 1 instance cached + 1 uncached');
 }
diff --git a/tests/compiler/dart2js_native/catch_javascript_null_stack_trace_test.dart b/tests/compiler/dart2js_native/catch_javascript_null_stack_trace_test.dart
index 43a6b22..cf9f528 100644
--- a/tests/compiler/dart2js_native/catch_javascript_null_stack_trace_test.dart
+++ b/tests/compiler/dart2js_native/catch_javascript_null_stack_trace_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import 'dart:_foreign_helper' show JS;
-import "package:expect/expect.dart";
+import 'native_testing.dart';
 
 // Try throwing a javascript null, and getting a stack-trace from it.
 
diff --git a/tests/compiler/dart2js_native/core_type_check_native_test.dart b/tests/compiler/dart2js_native/core_type_check_native_test.dart
index 261acf7..307509f 100644
--- a/tests/compiler/dart2js_native/core_type_check_native_test.dart
+++ b/tests/compiler/dart2js_native/core_type_check_native_test.dart
@@ -2,10 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
-
-var inscrutable = (int x) => x == 0 ? 0 : x | inscrutable(x & (x - 1));
+import "native_testing.dart";
 
 @Native("A")
 class A {}
@@ -33,6 +30,11 @@
 makeC = function() { return new C; }
 function D() {};
 makeD = function() { return new D; }
+
+self.nativeConstructor(A);
+self.nativeConstructor(B);
+self.nativeConstructor(C);
+self.nativeConstructor(D);
 """;
 
 checkTest(value, expectComparable, expectPattern) {
@@ -65,7 +67,7 @@
     makeC(),
     makeD()
   ];
-  value(i) => things[inscrutable(i)];
+  value(i) => confuse(things[i]);
 
   check(value(0), false, false); // List
   check(value(1), true, false); // int
@@ -79,6 +81,7 @@
 }
 
 main() {
+  nativeTesting();
   setup();
 
   checkAll(checkTest);
diff --git a/tests/compiler/dart2js_native/dart2js_native.status b/tests/compiler/dart2js_native/dart2js_native.status
index 080c6e1..874ace3 100644
--- a/tests/compiler/dart2js_native/dart2js_native.status
+++ b/tests/compiler/dart2js_native/dart2js_native.status
@@ -25,11 +25,3 @@
 
 [ $compiler == dart2js && $runtime == d8 && $system == windows ]
 compute_this_script_test: Skip # Issue 17458
-
-[ $compiler == dart2js && $cps_ir ]
-foreign_test: RuntimeError # Expect.equals(expected: <1234567891011>, actual: <1234567891011>) fails.
-native_exception_test: RuntimeError # Issue 24421
-optimization_hints_test: RuntimeError # Please triage this failure.
-
-[ $compiler == dart2js && $cps_ir && $checked ]
-*: Skip # `assert` not implemented, 75% of the tests fail.
diff --git a/tests/compiler/dart2js_native/dispatch_property_initialization_test.dart b/tests/compiler/dart2js_native/dispatch_property_initialization_test.dart
index 174eaf8..6da238e 100644
--- a/tests/compiler/dart2js_native/dispatch_property_initialization_test.dart
+++ b/tests/compiler/dart2js_native/dispatch_property_initialization_test.dart
@@ -4,9 +4,7 @@
 
 // Test for initialization of dispatchPropertyName.
 
-import "package:expect/expect.dart";
-import 'dart:_foreign_helper' show JS;
-import 'dart:_js_helper' show Native;
+import 'native_testing.dart';
 
 @Native("Foo")
 class Foo {
@@ -20,10 +18,13 @@
 Foo.prototype.method = function(x) { return 'Foo ' + x; }
 
 self.makeFoo = function() { return new Foo(); }
+
+self.nativeConstructor(Foo);
 """;
 
 
 main() {
+  nativeTesting();
   setup();
 
   // If the dispatchPropertyName is uninitialized, it will be `undefined` or
diff --git a/tests/compiler/dart2js_native/downcast_test.dart b/tests/compiler/dart2js_native/downcast_test.dart
index f993388..dab6ec8 100644
--- a/tests/compiler/dart2js_native/downcast_test.dart
+++ b/tests/compiler/dart2js_native/downcast_test.dart
@@ -4,8 +4,7 @@
 
 // Test for downcasts on native classes.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 abstract class J {}
 
@@ -48,6 +47,9 @@
 A.prototype.write = function(x) { this._x = x; };
 makeA = function(){return new A};
 makeB = function(){return new B};
+
+self.nativeConstructor(A);
+self.nativeConstructor(B);
 """;
 
 class C {}
@@ -55,6 +57,7 @@
 bool _check(a, b) => identical(a, b);
 
 main() {
+  nativeTesting();
   setup();
 
   var a1 = makeA();
diff --git a/tests/compiler/dart2js_native/error_safeToString_test.dart b/tests/compiler/dart2js_native/error_safeToString_test.dart
index fa022d9..7e117f9 100644
--- a/tests/compiler/dart2js_native/error_safeToString_test.dart
+++ b/tests/compiler/dart2js_native/error_safeToString_test.dart
@@ -2,9 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "package:expect/expect.dart";
-import 'dart:_foreign_helper' show JS_INTERCEPTOR_CONSTANT, JS;
-import 'dart:_js_helper' show Native, Creates;
+import "native_testing.dart";
+import 'dart:_foreign_helper' show JS_INTERCEPTOR_CONSTANT;
 import 'dart:_interceptors'
     show
         Interceptor,
@@ -70,6 +69,9 @@
 function RRRR(){}
 makeR = function(){return new RRRR();};
 
+self.nativeConstructor(PPPP);
+self.nativeConstructor(QQQQ);
+self.nativeConstructor(RRRR);
 """;
 
 expectTypeName(expectedName, s) {
@@ -158,6 +160,7 @@
 }
 
 main() {
+  nativeTesting();
   setup();
 
   testDistinctInterceptors();
diff --git a/tests/compiler/dart2js_native/event_loop_test.dart b/tests/compiler/dart2js_native/event_loop_test.dart
index 18d2068..60dd77a 100644
--- a/tests/compiler/dart2js_native/event_loop_test.dart
+++ b/tests/compiler/dart2js_native/event_loop_test.dart
@@ -3,9 +3,8 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import "dart:async";
-import "dart:_js_helper";
 import "package:async_helper/async_helper.dart";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 typedef void Callback0();
 
@@ -20,9 +19,11 @@
 function A() {}
 A.prototype.foo = function(f) { return f(); };
 makeA = function() { return new A; };
+self.nativeConstructor(A);
 """;
 
 main() {
+  nativeTesting();
   setup();
 
   // Makes sure that we don't run the event-loop when we have a reentrant
diff --git a/tests/compiler/dart2js_native/fake_thing_2_test.dart b/tests/compiler/dart2js_native/fake_thing_2_test.dart
index 3ec92e0..157e08f 100644
--- a/tests/compiler/dart2js_native/fake_thing_2_test.dart
+++ b/tests/compiler/dart2js_native/fake_thing_2_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import 'native_testing.dart';
 
 // Test that native objects cannot accidentally or maliciously be mistaken for
 // Dart objects.
@@ -27,19 +26,20 @@
 function NT() {}
 NT.prototype.$isThing = true;
 make3 = function(){return new NT;};
+
+self.nativeConstructor(NT);
 """;
 
-var inscrutable;
 main() {
+  nativeTesting();
   setup();
-  inscrutable = (x) => x;
 
   var a = new Thing();
   var b = make1();
   var c = make2();
   var d = make3();
-  Expect.isTrue(inscrutable(a) is Thing);
-  Expect.isFalse(inscrutable(b) is Thing);
-  Expect.isFalse(inscrutable(c) is Thing);
-  Expect.isFalse(inscrutable(d) is Thing);
+  Expect.isTrue(confuse(a) is Thing);
+  Expect.isFalse(confuse(b) is Thing);
+  Expect.isFalse(confuse(c) is Thing);
+  Expect.isFalse(confuse(d) is Thing);
 }
diff --git a/tests/compiler/dart2js_native/field_type2_test.dart b/tests/compiler/dart2js_native/field_type2_test.dart
index 31de669..e3f0693 100644
--- a/tests/compiler/dart2js_native/field_type2_test.dart
+++ b/tests/compiler/dart2js_native/field_type2_test.dart
@@ -5,7 +5,7 @@
 // Test that a closure call on a native field is recognized by the
 // type inferrer.
 
-import 'dart:_js_helper';
+import 'native_testing.dart';
 
 @Native("Node")
 class Node {
@@ -18,9 +18,12 @@
 // This code is all inside 'setup' and so not accesible from the global scope.
 function Node(parent){ this.parentNode = parent; }
 makeNode = function(p){return new Node(p);};
+
+self.nativeConstructor(Node);
 """;
 
 main() {
+  nativeTesting();
   setup();
   var node = makeNode(null);
   if (node.parentNode != null) {
diff --git a/tests/compiler/dart2js_native/field_type_test.dart b/tests/compiler/dart2js_native/field_type_test.dart
index ebb83c6..c9f4ec9 100644
--- a/tests/compiler/dart2js_native/field_type_test.dart
+++ b/tests/compiler/dart2js_native/field_type_test.dart
@@ -6,8 +6,7 @@
 // This regression test verifies that compiler accounts for hidden constructor
 // when analysing field values.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 @Native("Node")
 class Node {
@@ -48,9 +47,11 @@
 // This code is all inside 'setup' and so not accesible from the global scope.
 function Node(parent){ this.parentNode = parent; }
 makeNode = function(p){return new Node(p);};
+self.nativeConstructor(Node);
 """;
 
 main() {
+  nativeTesting();
   setup();
 
   var n1 = makeNode(null);
diff --git a/tests/compiler/dart2js_native/fixup_get_tag_test.dart b/tests/compiler/dart2js_native/fixup_get_tag_test.dart
index 8fc9b70..160e41a 100644
--- a/tests/compiler/dart2js_native/fixup_get_tag_test.dart
+++ b/tests/compiler/dart2js_native/fixup_get_tag_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Test for dartExperimentalFixupGetTag.
 
@@ -34,12 +33,15 @@
 
 makeA = function() { return new A; };
 makeB = function() { return new B; };
+
+self.nativeConstructor(A);
 """;
 
 makeA() native ;
 makeB() native ;
 
 main() {
+  nativeTesting();
   setup();
 
   var a = makeA();
diff --git a/tests/compiler/dart2js_native/foreign_test.dart b/tests/compiler/dart2js_native/foreign_test.dart
index e2a4c4e..c1d1c65 100644
--- a/tests/compiler/dart2js_native/foreign_test.dart
+++ b/tests/compiler/dart2js_native/foreign_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "package:expect/expect.dart";
-import 'dart:_foreign_helper' show JS;
+import "native_testing.dart";
 
 foreign1(var a, var b) {
   return JS("num", r"# + #", a, b);
diff --git a/tests/compiler/dart2js_native/hash_code_test.dart b/tests/compiler/dart2js_native/hash_code_test.dart
index c909a10..8bf0180 100644
--- a/tests/compiler/dart2js_native/hash_code_test.dart
+++ b/tests/compiler/dart2js_native/hash_code_test.dart
@@ -2,20 +2,32 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import 'native_testing.dart';
 
 @Native("A")
 class A {}
 
+@Native("B")
+class B {
+  int get hashCode => 1234567;
+}
+
 makeA() native ;
+makeB() native ;
 
 void setup() native """
 function A() {}
+function B() {}
 makeA = function(){return new A;};
+makeB = function(){return new B;};
+
+self.nativeConstructor(A);
+self.nativeConstructor(B);
 """;
 
 main() {
+  nativeTesting();
   setup();
   Expect.isTrue(makeA().hashCode is int);
+  Expect.equals(1234567, makeB().hashCode);
 }
diff --git a/tests/compiler/dart2js_native/inference_of_helper_methods_test.dart b/tests/compiler/dart2js_native/inference_of_helper_methods_test.dart
index 7d821c3..ef29951 100644
--- a/tests/compiler/dart2js_native/inference_of_helper_methods_test.dart
+++ b/tests/compiler/dart2js_native/inference_of_helper_methods_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.
 
-import "package:expect/expect.dart";
+import 'native_testing.dart';
 import 'dart:_js_helper' show intTypeCheck;
 
 bool get inCheckedMode {
@@ -18,7 +18,7 @@
   var a = [];
   a.add(42);
   a.add('foo');
-  // By calling direclty [intTypeCheck] with an int, we're making the
+  // By calling directly [intTypeCheck] with an int, we're making the
   // type inferrer infer that the parameter type of [intTypeCheck] is
   // always an int, and therefore the method will be compiled to
   // never throw. So when the backend actually uses the helper for
diff --git a/tests/compiler/dart2js_native/is_check_test.dart b/tests/compiler/dart2js_native/is_check_test.dart
index ecc42b2..ec1d703 100644
--- a/tests/compiler/dart2js_native/is_check_test.dart
+++ b/tests/compiler/dart2js_native/is_check_test.dart
@@ -2,13 +2,12 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import 'native_testing.dart';
 
 @Native("A")
 class A {}
 
 main() {
-  var a = [new Object()];
-  Expect.isFalse(a[0] is A);
+  JS('A', '(null)'); // Class 'A' appears to be created.
+  Expect.isFalse(confuse(new Object()) is A);
 }
diff --git a/tests/compiler/dart2js_native/issue9182_test.dart b/tests/compiler/dart2js_native/issue9182_test.dart
index 5e06b35..1b5d1ac 100644
--- a/tests/compiler/dart2js_native/issue9182_test.dart
+++ b/tests/compiler/dart2js_native/issue9182_test.dart
@@ -5,8 +5,7 @@
 // Regression test for Issue 9182.  The generative constructor body function
 // should not have the interceptor calling convention.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 @Native("A")
 class Foo {
@@ -28,16 +27,17 @@
 void setup() native r"""
 function A(){}
 makeA = function() { return new A; };
+self.nativeConstructor(A);
 """;
 
 makeA() native ;
 
 main() {
+  nativeTesting();
   setup();
 
-  var things = [new Foo(), new Bar(30, 40)];
-  var foo = things[0];
-  var bar = things[1];
+  var foo = confuse(new Foo());
+  var bar = confuse(new Bar(30, 40));
 
   Expect.equals(123, foo.Bar()); // Ensure that Foo.Bar is used.
 
diff --git a/tests/compiler/dart2js_native/js_constant_test.dart b/tests/compiler/dart2js_native/js_constant_test.dart
index 7658dc0..bc9837e 100644
--- a/tests/compiler/dart2js_native/js_constant_test.dart
+++ b/tests/compiler/dart2js_native/js_constant_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import 'dart:_foreign_helper' show JS;
-import "package:expect/expect.dart";
+import 'native_testing.dart';
 
 // Negative constant numbers must be generated as negation, not just a literal
 // with a sign, i.e.
diff --git a/tests/compiler/dart2js_native/jsobject_test.dart b/tests/compiler/dart2js_native/jsobject_test.dart
index f7a92f9..7f31dd1 100644
--- a/tests/compiler/dart2js_native/jsobject_test.dart
+++ b/tests/compiler/dart2js_native/jsobject_test.dart
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "package:expect/expect.dart";
-import 'dart:_js_helper' show Native, Creates, setNativeSubclassDispatchRecord;
+import 'native_testing.dart';
+import 'dart:_js_helper' show setNativeSubclassDispatchRecord;
 import 'dart:_interceptors'
     show
         JSObject, // The interface, which may be re-exported by a
@@ -32,6 +32,8 @@
 
 function QQ(){}
 makeQ = function(){return new QQ();};
+
+self.nativeConstructor(QQ);
 """;
 
 class Is<T> {
@@ -93,6 +95,7 @@
 }
 
 main() {
+  nativeTesting();
   setup();
 
   dynamic_test();
diff --git a/tests/compiler/dart2js_native/load_elim_refinement_test.dart b/tests/compiler/dart2js_native/load_elim_refinement_test.dart
index 026b142..981c0fa 100644
--- a/tests/compiler/dart2js_native/load_elim_refinement_test.dart
+++ b/tests/compiler/dart2js_native/load_elim_refinement_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "package:expect/expect.dart";
-import 'dart:_foreign_helper' show JS;
+import 'native_testing.dart';
 
 class A {
   int a;
diff --git a/tests/compiler/dart2js_native/mirror_intercepted_field_test.dart b/tests/compiler/dart2js_native/mirror_intercepted_field_test.dart
index a9cb2e0..4a3b337 100644
--- a/tests/compiler/dart2js_native/mirror_intercepted_field_test.dart
+++ b/tests/compiler/dart2js_native/mirror_intercepted_field_test.dart
@@ -3,8 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import 'dart:mirrors';
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import 'native_testing.dart';
 
 @Native("B")
 class B {
@@ -20,6 +19,7 @@
 const symF = const Symbol('f');
 
 main() {
+  JS('B', '(null)'); // B appears to be created.
   var a = new A();
 
   InstanceMirror mirror = reflect(a);
diff --git a/tests/compiler/dart2js_native/native_call_arity1_frog_test.dart b/tests/compiler/dart2js_native/native_call_arity1_frog_test.dart
index ed3d131..d435bdd 100644
--- a/tests/compiler/dart2js_native/native_call_arity1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_call_arity1_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Test that native methods with unnamed* optional arguments are called with the
 // number of arguments in the call site.  This is necessary because native
@@ -38,12 +37,14 @@
 
 makeA = function(){return new A;};
 makeB = function(){return new B;};
+
+self.nativeConstructor(A);
+self.nativeConstructor(B);
 """;
 
 testDynamicContext() {
-  var things = [makeA(), makeB()];
-  var a = things[0];
-  var b = things[1];
+  var a = confuse(makeA());
+  var b = confuse(makeB());
 
   Expect.throws(() => a.foo());
   Expect.equals(1, a.foo(10));
@@ -76,6 +77,7 @@
 }
 
 main() {
+  nativeTesting();
   setup();
   testDynamicContext();
   testStaticContext();
diff --git a/tests/compiler/dart2js_native/native_call_arity2_frog_test.dart b/tests/compiler/dart2js_native/native_call_arity2_frog_test.dart
index b99e07b..029122c 100644
--- a/tests/compiler/dart2js_native/native_call_arity2_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_call_arity2_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // This is a similar test to NativeCallArity1FrogTest, but makes sure
 // that subclasses also get the right number of arguments.
@@ -41,12 +40,14 @@
 
 makeA = function(){return new A;};
 makeB = function(){return new B;};
+
+self.nativeConstructor(A);
+self.nativeConstructor(B);
 """;
 
 testDynamicContext() {
-  var things = [makeA(), makeB()];
-  var a = things[0];
-  var b = things[1];
+  var a = confuse(makeA());
+  var b = confuse(makeB());
 
   Expect.equals(0, a.foo());
   Expect.equals(1, a.foo(10));
@@ -91,6 +92,7 @@
 }
 
 main() {
+  nativeTesting();
   setup();
   testDynamicContext();
   testStaticContext();
diff --git a/tests/compiler/dart2js_native/native_call_arity3_frog_test.dart b/tests/compiler/dart2js_native/native_call_arity3_frog_test.dart
index 1b4048e..f333d81 100644
--- a/tests/compiler/dart2js_native/native_call_arity3_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_call_arity3_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Test similar to NativeCallArity1FrogTest, but with default values to
 // parameters set to null. These parameters should be treated as if they
@@ -34,12 +33,14 @@
 
 makeA = function(){return new A;};
 makeB = function(){return new B;};
+
+self.nativeConstructor(A);
+self.nativeConstructor(B);
 """;
 
 testDynamicContext() {
-  var things = [makeA(), makeB()];
-  var a = things[0];
-  var b = things[1];
+  var a = confuse(makeA());
+  var b = confuse(makeB());
 
   Expect.throws(() => a.foo());
   Expect.equals(1, a.foo(10));
@@ -78,6 +79,7 @@
 }
 
 main() {
+  nativeTesting();
   setup();
   testDynamicContext();
   testStaticContext();
diff --git a/tests/compiler/dart2js_native/native_checked_arguments1_frog_test.dart b/tests/compiler/dart2js_native/native_checked_arguments1_frog_test.dart
index 9a64a3d..e0f1e31 100644
--- a/tests/compiler/dart2js_native/native_checked_arguments1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_checked_arguments1_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import 'native_testing.dart';
 
 // Test that type checks occur on native methods.
 
@@ -33,6 +32,9 @@
 
 makeA = function(){return new A;};
 makeB = function(){return new B;};
+
+self.nativeConstructor(A);
+self.nativeConstructor(B);
 """;
 
 expectThrows(action()) {
@@ -135,6 +137,7 @@
 }
 
 main() {
+  nativeTesting();
   setup();
 
   if (isCheckedMode()) {
diff --git a/tests/compiler/dart2js_native/native_checked_fields_frog_test.dart b/tests/compiler/dart2js_native/native_checked_fields_frog_test.dart
index 3ae79bf..83f5bac 100644
--- a/tests/compiler/dart2js_native/native_checked_fields_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_checked_fields_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import 'native_testing.dart';
 
 // Test that type checks occur on assignment to fields of native methods.
 
@@ -27,6 +26,9 @@
 
 makeA = function(){return new A;};
 makeB = function(){return new B;};
+
+self.nativeConstructor(A);
+self.nativeConstructor(B);
 """;
 
 expectThrows(action()) {
@@ -109,6 +111,7 @@
 }
 
 main() {
+  nativeTesting();
   setup();
 
   if (isCheckedMode()) {
diff --git a/tests/compiler/dart2js_native/native_class_avoids_hidden_name_frog_test.dart b/tests/compiler/dart2js_native/native_class_avoids_hidden_name_frog_test.dart
index 8690e4b..3f28682 100644
--- a/tests/compiler/dart2js_native/native_class_avoids_hidden_name_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_class_avoids_hidden_name_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Test that hidden native class names are not used by generated code.
 
@@ -41,18 +40,18 @@
 function CC(){}
 makeA = function(){return new BB};  // AA is native "BB"
 makeB = function(){return new CC};  // BB is native "CC"
+self.nativeConstructor(BB);
+self.nativeConstructor(CC);
 """;
 
-int inscrutable(int x) => x == 0 ? 0 : x | inscrutable(x & (x - 1));
-
 main() {
+  nativeTesting();
   setup1();
   setup2();
 
-  var things = [AA.create(), BB.create(), CC.create()];
-  var a = things[inscrutable(0)];
-  var b = things[inscrutable(1)];
-  var c = things[inscrutable(2)];
+  var a = confuse(AA.create());
+  var b = confuse(BB.create());
+  var c = confuse(CC.create());
 
   Expect.equals('AA', a.name);
   Expect.equals('BB', b.name);
diff --git a/tests/compiler/dart2js_native/native_class_fields_2_test.dart b/tests/compiler/dart2js_native/native_class_fields_2_test.dart
index 419d82f..efd4398 100644
--- a/tests/compiler/dart2js_native/native_class_fields_2_test.dart
+++ b/tests/compiler/dart2js_native/native_class_fields_2_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Verify that methods are not renamed to clash with native field names
 // that are known from the DOM (like x, y, z).
@@ -23,7 +22,7 @@
 
 function A(){
   var a = Object.create(
-      { constructor: { name: 'A'}},
+      { constructor: A },
       { x: { get: getter, configurable: false, writeable: false },
         y: { get: getter, configurable: false, writeable: false },
         z: { get: getter, configurable: false, writeable: false }
@@ -33,6 +32,7 @@
 }
 
 makeA = function() { return new A; };
+self.nativeConstructor(A);
 """;
 
 A makeA() native ;
@@ -72,9 +72,10 @@
 int inscrutable(int x) => x == 0 ? 0 : x | inscrutable(x & (x - 1));
 
 main() {
+  nativeTesting();
   setup();
-  var both = [makeA(), new B()];
-  var x = both[inscrutable(0)];
+  confuse(new B()).a();
+  var x = confuse(makeA());
   // Each of these will throw, because an instance of A doesn't have any of
   // these functions.  The important thing is that none of them have been
   // renamed to be called 'z' by the minifier, because then the getter will be
diff --git a/tests/compiler/dart2js_native/native_class_fields_3_test.dart b/tests/compiler/dart2js_native/native_class_fields_3_test.dart
index ce6c28d..5576638 100644
--- a/tests/compiler/dart2js_native/native_class_fields_3_test.dart
+++ b/tests/compiler/dart2js_native/native_class_fields_3_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Verify that we can have fields with names that start with g and s even
 // though those names are reserved for getters and setters in minified mode.
@@ -45,7 +44,7 @@
 
 function A(){
   var a = Object.create(
-      { constructor: { name: 'A'}},
+      { constructor: A },
       { bar: descriptor,
         g: descriptor,
         s: descriptor,
@@ -59,30 +58,46 @@
 }
 
 makeA = function() { return new A; };
+self.nativeConstructor(A);
 """;
 
 A makeA() native ;
 
 class B {}
 
-int inscrutable(int x) => x == 0 ? 0 : x | inscrutable(x & (x - 1));
-
 main() {
+  nativeTesting();
   setup();
-  var both = [makeA(), new B()];
-  var foo = both[inscrutable(0)];
-  Expect.equals(42, foo.bar);
-  Expect.equals(42, foo.g);
-  Expect.equals(42, foo.s);
-  Expect.equals(42, foo.end);
-  Expect.equals(42, foo.gend);
-  Expect.equals(42, foo.send);
-  Expect.equals(271, foo.bar = 271);
-  Expect.equals(271, foo.g = 271);
-  Expect.equals(271, foo.s = 271);
-  Expect.equals(271, foo.end = 271);
-  Expect.equals(271, foo.gend = 271);
-  Expect.equals(271, foo.send = 271);
-  Expect.equals(6, foo.gettersCalled);
-  Expect.equals(6, foo.settersCalled);
+  confuse(new B());
+  var a = makeA();
+
+  Expect.equals(42, confuse(a).bar);
+  Expect.equals(42, confuse(a).g);
+  Expect.equals(42, confuse(a).s);
+  Expect.equals(42, confuse(a).end);
+  Expect.equals(42, confuse(a).gend);
+  Expect.equals(42, confuse(a).send);
+  Expect.equals(271, confuse(a).bar = 271);
+  Expect.equals(271, confuse(a).g = 271);
+  Expect.equals(271, confuse(a).s = 271);
+  Expect.equals(271, confuse(a).end = 271);
+  Expect.equals(271, confuse(a).gend = 271);
+  Expect.equals(271, confuse(a).send = 271);
+  Expect.equals(6, confuse(a).gettersCalled);
+  Expect.equals(6, confuse(a).settersCalled);
+
+  Expect.equals(42, a.bar);
+  Expect.equals(42, a.g);
+  Expect.equals(42, a.s);
+  Expect.equals(42, a.end);
+  Expect.equals(42, a.gend);
+  Expect.equals(42, a.send);
+  Expect.equals(271, a.bar = 271);
+  Expect.equals(271, a.g = 271);
+  Expect.equals(271, a.s = 271);
+  Expect.equals(271, a.end = 271);
+  Expect.equals(271, a.gend = 271);
+  Expect.equals(271, a.send = 271);
+  Expect.equals(12, a.gettersCalled);
+  Expect.equals(12, a.settersCalled);
 }
diff --git a/tests/compiler/dart2js_native/native_class_fields_test.dart b/tests/compiler/dart2js_native/native_class_fields_test.dart
index 45a45bf..67380cb 100644
--- a/tests/compiler/dart2js_native/native_class_fields_test.dart
+++ b/tests/compiler/dart2js_native/native_class_fields_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Verify that native fields on classes are not renamed by the minifier.
 @Native("A")
@@ -25,7 +24,7 @@
 
 function A(){
   var a = Object.create(
-      { constructor: { name: 'A'}},
+      { constructor: A},
       { myLongPropertyName: { get: getter,
                               set: setter,
                               configurable: false,
@@ -37,17 +36,24 @@
 }
 
 makeA = function(){return new A;};
+self.nativeConstructor(A);
 """;
 
 A makeA() native ;
 
 main() {
+  nativeTesting();
   setup();
   var a = makeA();
   a.myLongPropertyName = 21;
   int gotten = a.myLongPropertyName;
   Expect.equals(11, gotten);
 
+  // Force interceptor dispatch.
+  confuse(a).myLongPropertyName = 99;
+  gotten = confuse(a).myLongPropertyName;
+  Expect.equals(22, gotten);
+
   var a2 = makeA();
   if (a2 is A) {
     // Inside this 'if' the compiler knows that a2 is an A, so it is tempted
diff --git a/tests/compiler/dart2js_native/native_class_inheritance1_frog_test.dart b/tests/compiler/dart2js_native/native_class_inheritance1_frog_test.dart
index 3b0ab8b..2693b13 100644
--- a/tests/compiler/dart2js_native/native_class_inheritance1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_class_inheritance1_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Test to see if resolving a hidden native class's method interferes with
 // subsequent resolving the subclass's method.  This might happen if the
@@ -67,9 +66,15 @@
 
 makeA2 = function(){return new A2};
 makeB2 = function(){return new B2};
+
+self.nativeConstructor(A1);
+self.nativeConstructor(A2);
+self.nativeConstructor(B1);
+self.nativeConstructor(B2);
 """;
 
 main() {
+  nativeTesting();
   setup();
 
   var a1 = makeA1();
diff --git a/tests/compiler/dart2js_native/native_class_inheritance2_frog_test.dart b/tests/compiler/dart2js_native/native_class_inheritance2_frog_test.dart
index d01b4ff..49c7bfd 100644
--- a/tests/compiler/dart2js_native/native_class_inheritance2_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_class_inheritance2_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Test to see if resolving a hidden native class's method interferes with
 // subsequent resolving the subclass's method.  This might happen if the
@@ -59,9 +58,15 @@
 makeB = function(){return new B};
 makeC = function(){return new C};
 makeD = function(){return new D};
+
+self.nativeConstructor(A);
+self.nativeConstructor(B);
+self.nativeConstructor(C);
+self.nativeConstructor(D);
 """;
 
 main() {
+  nativeTesting();
   setup();
 
   var a = makeA();
diff --git a/tests/compiler/dart2js_native/native_class_inheritance3_frog_test.dart b/tests/compiler/dart2js_native/native_class_inheritance3_frog_test.dart
index 9c23566..900b011 100644
--- a/tests/compiler/dart2js_native/native_class_inheritance3_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_class_inheritance3_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Test to see if resolving a hidden native class's method to noSuchMethod
 // interferes with subsequent resolving of the method.  This might happen if the
@@ -59,9 +58,15 @@
 makeB2 = function(){return new B2};
 
 makeObject = function(){return new Object};
+
+self.nativeConstructor(A1);
+self.nativeConstructor(A2);
+self.nativeConstructor(B1);
+self.nativeConstructor(B2);
 """;
 
 main() {
+  nativeTesting();
   setup();
 
   var a1 = makeA1();
diff --git a/tests/compiler/dart2js_native/native_class_inheritance4_frog_test.dart b/tests/compiler/dart2js_native/native_class_inheritance4_frog_test.dart
index 3f7544a..3ba8cc8 100644
--- a/tests/compiler/dart2js_native/native_class_inheritance4_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_class_inheritance4_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Additional Dart code may be 'placed on' hidden native classes.  With
 // inheritance, the superclass method must not be reached by a call on the
@@ -53,6 +52,9 @@
 inherits(B, A);
 makeA = function(){return new A;};
 makeB = function(){return new B;};
+
+self.nativeConstructor(A);
+self.nativeConstructor(B);
 """;
 
 testBasicA_dynamic() {
@@ -145,6 +147,7 @@
 }
 
 main() {
+  nativeTesting();
   testBasicA_dynamic();
   testBasicA_typed();
   testBasicB_dynamic();
diff --git a/tests/compiler/dart2js_native/native_class_is_check1_frog_test.dart b/tests/compiler/dart2js_native/native_class_is_check1_frog_test.dart
index b5ace6d..3c2e908 100644
--- a/tests/compiler/dart2js_native/native_class_is_check1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_class_is_check1_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Test for correct simple is-checks on hidden native classes.
 
@@ -29,11 +28,13 @@
 A.prototype.read = function() { return this._x; };
 A.prototype.write = function(x) { this._x = x; };
 makeA = function(){return new A};
+self.nativeConstructor(A);
 """;
 
 class B {}
 
 main() {
+  nativeTesting();
   setup();
 
   var a1 = makeA();
diff --git a/tests/compiler/dart2js_native/native_class_is_check3_frog_test.dart b/tests/compiler/dart2js_native/native_class_is_check3_frog_test.dart
index e6d55fe..f24c355 100644
--- a/tests/compiler/dart2js_native/native_class_is_check3_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_class_is_check3_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Test for correct simple is-checks on hidden native classes.
 
@@ -48,11 +47,14 @@
 A.prototype.write = function(x) { this._x = x; };
 makeA = function(){return new A};
 makeB = function(){return new B};
+self.nativeConstructor(A);
+self.nativeConstructor(B);
 """;
 
 class C {}
 
 main() {
+  nativeTesting();
   setup();
 
   var a1 = makeA();
diff --git a/tests/compiler/dart2js_native/native_class_with_dart_methods_frog_test.dart b/tests/compiler/dart2js_native/native_class_with_dart_methods_frog_test.dart
index 08d19ef..5c90a1b 100644
--- a/tests/compiler/dart2js_native/native_class_with_dart_methods_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_class_with_dart_methods_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import 'native_testing.dart';
 
 // Additional Dart code may be 'placed on' hidden native classes.
 
@@ -24,9 +23,11 @@
 void setup() native """
 function A() {}
 makeA = function(){return new A;};
+self.nativeConstructor(A);
 """;
 
 main() {
+  nativeTesting();
   setup();
 
   var a = makeA();
diff --git a/tests/compiler/dart2js_native/native_closure_identity_frog_test.dart b/tests/compiler/dart2js_native/native_closure_identity_frog_test.dart
index 2a27d5d..3d73c35 100644
--- a/tests/compiler/dart2js_native/native_closure_identity_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_closure_identity_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import 'native_testing.dart';
 
 typedef void MyFunctionType();
 
@@ -22,6 +21,8 @@
 A.prototype.check = function(f) { return this.f === f; };
 A.prototype.invoke = function() { return this.f(); };
 makeA = function(){return new A;};
+
+self.nativeConstructor(A);
 """;
 
 var staticClosure;
@@ -45,6 +46,7 @@
 }
 
 main() {
+  nativeTesting();
   setup();
 
   staticClosure = () => 44;
diff --git a/tests/compiler/dart2js_native/native_constructor_name_test.dart b/tests/compiler/dart2js_native/native_constructor_name_test.dart
index 76a30d7..34e6734c 100644
--- a/tests/compiler/dart2js_native/native_constructor_name_test.dart
+++ b/tests/compiler/dart2js_native/native_constructor_name_test.dart
@@ -8,8 +8,7 @@
 // This could be done by renaming the Dart constructor or by being able to check
 // that objects are Dart classes.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 class A {}
 
@@ -23,9 +22,11 @@
 void setup() native """
 function A(){}
 makeZ = function(){return new A};
+self.nativeConstructor(A);
 """;
 
 main() {
+  nativeTesting();
   setup();
 
   var a = new A();
diff --git a/tests/compiler/dart2js_native/native_equals_frog_test.dart b/tests/compiler/dart2js_native/native_equals_frog_test.dart
index b8868a5..c6913ec 100644
--- a/tests/compiler/dart2js_native/native_equals_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_equals_frog_test.dart
@@ -2,20 +2,35 @@
 // for 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:_js_helper";
-import "package:expect/expect.dart";
+import 'native_testing.dart';
 
 @Native("A")
 class A {}
 
+int calls = 0;
+@Native("B")
+class B {
+  bool operator==(other) {
+    ++calls;
+    return other is B;
+  }
+  int get hashCode => 1;
+}
+
 makeA() native ;
+makeB() native ;
 
 void setup() native """
 function A() {}
+function B() {}
 makeA = function(){return new A;};
+makeB = function(){return new B;};
+
+self.nativeConstructor(B);
 """;
 
 main() {
+  nativeTesting();
   setup();
   var a = makeA();
   Expect.isTrue(a == a);
@@ -23,4 +38,13 @@
 
   Expect.isFalse(a == makeA());
   Expect.isFalse(identical(a, makeA()));
+
+  var b = makeB();
+  Expect.isTrue(b == b);
+  Expect.isTrue(identical(b, b));
+
+  Expect.isTrue(b == makeB());
+  Expect.isFalse(identical(b, makeB()));
+
+  Expect.equals(2, calls);
 }
diff --git a/tests/compiler/dart2js_native/native_exception2_test.dart b/tests/compiler/dart2js_native/native_exception2_test.dart
index 44f89fb..916709b 100644
--- a/tests/compiler/dart2js_native/native_exception2_test.dart
+++ b/tests/compiler/dart2js_native/native_exception2_test.dart
@@ -8,19 +8,24 @@
 library native_exception2_test;
 
 import 'native_exception_test.dart' as other;
-import 'dart:_js_helper';
+import 'native_testing.dart';
 
 @Native("NativeClass")
-class NativeClass {}
+class NativeClass {
+  foo() => 'oof';
+}
 
 makeNativeClass() native ;
 
 setup() native """
 function NativeClass() {}
 makeNativeClass = function() { return new NativeClass; }
+self.nativeConstructor(NativeClass);
 """;
 
 main() {
+  nativeTesting();
   setup();
+  Expect.equals('oof', makeNativeClass().foo());
   other.main();
 }
diff --git a/tests/compiler/dart2js_native/native_exception_test.dart b/tests/compiler/dart2js_native/native_exception_test.dart
index 0c2edf5..e3e4a98 100644
--- a/tests/compiler/dart2js_native/native_exception_test.dart
+++ b/tests/compiler/dart2js_native/native_exception_test.dart
@@ -6,9 +6,7 @@
 
 library native_exception_test;
 
-import 'dart:_foreign_helper' show JS;
-import 'dart:_js_helper';
-import 'package:expect/expect.dart';
+import 'native_testing.dart';
 
 main() {
   var previous;
diff --git a/tests/compiler/dart2js_native/native_exceptions1_frog_test.dart b/tests/compiler/dart2js_native/native_exceptions1_frog_test.dart
index a111650..9ab4283 100644
--- a/tests/compiler/dart2js_native/native_exceptions1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_exceptions1_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import 'native_testing.dart';
 
 // Test that hidden native exception classes can be marked as existing.
 //
@@ -57,11 +56,15 @@
   return  x / 2;
 };
 makeA = function(){return new A};
+
+self.nativeConstructor(E);
+self.nativeConstructor(A);
 """;
 
 int inscrutable(int x) => x == 0 ? 0 : x | inscrutable(x & (x - 1));
 
 main() {
+  nativeTesting();
   setup1();
   setup2();
 
diff --git a/tests/compiler/dart2js_native/native_field_invocation2_test.dart b/tests/compiler/dart2js_native/native_field_invocation2_test.dart
index 290a68f..05e2eab 100644
--- a/tests/compiler/dart2js_native/native_field_invocation2_test.dart
+++ b/tests/compiler/dart2js_native/native_field_invocation2_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 @Native("NNative")
 class NNative {
@@ -11,19 +10,9 @@
 
   var f;
 
-  ClickCounter() {
-    f = wrap(g);
-  }
-
   g(val) => "### $val ###";
 }
 
-nativeId(x) native ;
-
-void setup() native """
-nativeId = function(x) { return x; }
-""";
-
 class ClickCounter {
   var status;
 
@@ -42,6 +31,13 @@
   };
 }
 
+nativeId(x) native ;
+
+void setup() native """
+nativeId = function(x) { return x; }
+""";
+
+
 main() {
   setup();
   // Make sure the ClickCounter class goes through interceptors.
diff --git a/tests/compiler/dart2js_native/native_field_invocation3_test.dart b/tests/compiler/dart2js_native/native_field_invocation3_test.dart
index 0944f17..18390cd 100644
--- a/tests/compiler/dart2js_native/native_field_invocation3_test.dart
+++ b/tests/compiler/dart2js_native/native_field_invocation3_test.dart
@@ -2,14 +2,14 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 makeCC() native ;
 
 void setup() native """
 function CC() {}
 makeCC = function() { return new CC; }
+self.nativeConstructor(CC);
 """;
 
 @Native("CC")
@@ -32,6 +32,7 @@
 }
 
 main() {
+  nativeTesting();
   setup();
   var c = makeCC();
   c.init();
diff --git a/tests/compiler/dart2js_native/native_field_invocation4_test.dart b/tests/compiler/dart2js_native/native_field_invocation4_test.dart
index 18489d5..40f8670 100644
--- a/tests/compiler/dart2js_native/native_field_invocation4_test.dart
+++ b/tests/compiler/dart2js_native/native_field_invocation4_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 @Native("A")
 class A {
@@ -26,8 +25,8 @@
   b.foo = (x) => x + 1;
   b = nativeId(b); // Inferrer doesn't know if A has been instantiated.
   // At this point b could be A or B. The call to "foo" thus needs to go through
-  // an interceptor. Tests that the interceptor doesn't screw with retrieving
-  // the field and invoking the closure.
+  // an interceptor. Tests that the interceptor works for retrieving the field
+  // and invoking the closure.
   // Use a type-check to guarantee that b is a "B".
   if (b is B) {
     Expect.equals(499, b.foo(498));
diff --git a/tests/compiler/dart2js_native/native_field_invocation5_test.dart b/tests/compiler/dart2js_native/native_field_invocation5_test.dart
index abc60aa..5c3ff7b 100644
--- a/tests/compiler/dart2js_native/native_field_invocation5_test.dart
+++ b/tests/compiler/dart2js_native/native_field_invocation5_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 makeCC() native ;
 nativeFirst(x, y) native ;
@@ -12,6 +11,7 @@
 function CC() {}
 makeCC = function() { return new CC; }
 nativeFirst = function(x, y) { return x; }
+self.nativeConstructor(CC);
 """;
 
 class C {
@@ -38,6 +38,7 @@
 }
 
 main() {
+  nativeTesting();
   setup();
   var c = makeCC();
   c.init();
diff --git a/tests/compiler/dart2js_native/native_field_invocation6_test.dart b/tests/compiler/dart2js_native/native_field_invocation6_test.dart
index 3d3b264..ec27608 100644
--- a/tests/compiler/dart2js_native/native_field_invocation6_test.dart
+++ b/tests/compiler/dart2js_native/native_field_invocation6_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 makeA() native ;
 nativeFirst(x, y) native ;
@@ -13,6 +12,7 @@
 
 function A() {}
 makeA = function() { return new A; }
+self.nativeConstructor(A);
 """;
 
 @Native("A")
@@ -39,6 +39,7 @@
 }
 
 main() {
+  nativeTesting();
   setup();
   var a = makeA();
   a.init();
diff --git a/tests/compiler/dart2js_native/native_field_invocation_test.dart b/tests/compiler/dart2js_native/native_field_invocation_test.dart
index df6b9ab..2bfb71d 100644
--- a/tests/compiler/dart2js_native/native_field_invocation_test.dart
+++ b/tests/compiler/dart2js_native/native_field_invocation_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 @Native("A")
 class A {
@@ -26,7 +25,7 @@
   b.foo = (x) => x + 1;
   b = nativeId(b); // Inferrer doesn't know if A has been instantiated.
   // At this point b could be A or B. The call to "foo" thus needs to go through
-  // an interceptor. Tests that the interceptor doesn't screw with retrieving
-  // the field and invoking the closure.
+  // an interceptor. Tests that the interceptor works for retrieving the Dart
+  // class field and invoking the closure.
   Expect.equals(499, b.foo(498));
 }
diff --git a/tests/compiler/dart2js_native/native_field_name_test.dart b/tests/compiler/dart2js_native/native_field_name_test.dart
index b0001a8..6269e4f 100644
--- a/tests/compiler/dart2js_native/native_field_name_test.dart
+++ b/tests/compiler/dart2js_native/native_field_name_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import 'native_testing.dart';
 
 // Check that native fields are not incorrectly renamed.
 
@@ -29,7 +28,7 @@
 
 function A(){
   var a = Object.create(
-      { constructor: { name: 'A'}},
+      { constructor: A },
       { myLongPropertyName: { get: getter,
                               set: setter,
                               configurable: false,
@@ -41,11 +40,14 @@
 }
 
 makeA = function(){return new A;};
+
+self.nativeConstructor(A);
 """;
 
-A makeA() native ;
+/*A*/ makeA() native ;
 
 main() {
+  nativeTesting();
   setup();
   var a = makeA();
   a.myLongPropertyName = 21;
diff --git a/tests/compiler/dart2js_native/native_field_optimization_test.dart b/tests/compiler/dart2js_native/native_field_optimization_test.dart
index a24be43..0210071 100644
--- a/tests/compiler/dart2js_native/native_field_optimization_test.dart
+++ b/tests/compiler/dart2js_native/native_field_optimization_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import 'native_testing.dart';
 
 // Test that compiler is cautious with optimizations on native fields.  The
 // motivation is that DOM properties are getters and setters with arbitrary
@@ -42,6 +41,8 @@
 });
 
 makeFoo = function() { return new Foo() }
+
+self.nativeConstructor(Foo);
 """;
 
 test1() {
@@ -84,6 +85,7 @@
 }
 
 main() {
+  nativeTesting();
   setup();
   (test1)();
   (test2)();
diff --git a/tests/compiler/dart2js_native/native_field_rename_1_frog_test.dart b/tests/compiler/dart2js_native/native_field_rename_1_frog_test.dart
index aaa578b..a18c31c 100644
--- a/tests/compiler/dart2js_native/native_field_rename_1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_field_rename_1_frog_test.dart
@@ -6,8 +6,7 @@
 // fields.  However, native fields keep their name.  The implication: a getter
 // for the field must be based on the field's name, not the field's jsname.
 
-import "package:expect/expect.dart";
-import 'dart:_js_helper' show Native, JSName;
+import 'native_testing.dart';
 
 @Native("A")
 class A {
@@ -44,13 +43,15 @@
 
 makeA = function(){return new A};
 makeX = function(){return new X};
+
+self.nativeConstructor(A);
+self.nativeConstructor(X);
 """;
 
 testDynamic() {
-  var things = [makeA(), new B(), makeX()];
-  var a = things[0];
-  var b = things[1];
-  var x = things[2];
+  var a = confuse(makeA());
+  var b = confuse(new B());
+  var x = confuse(makeX());
 
   Expect.equals(111, a.key);
   Expect.equals(222, b.key);
@@ -77,6 +78,7 @@
 }
 
 main() {
+  nativeTesting();
   setup();
 
   testTyped();
diff --git a/tests/compiler/dart2js_native/native_field_rename_2_frog_test.dart b/tests/compiler/dart2js_native/native_field_rename_2_frog_test.dart
index cb093cb..1d3cdcc 100644
--- a/tests/compiler/dart2js_native/native_field_rename_2_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_field_rename_2_frog_test.dart
@@ -6,8 +6,7 @@
 // fields.  However, native fields keep their name.  The implication: a getter
 // for the field must be based on the field's name, not the field's jsname.
 
-import "package:expect/expect.dart";
-import 'dart:_js_helper' show Native, JSName;
+import 'native_testing.dart';
 
 abstract class I {
   int key;
@@ -47,13 +46,15 @@
 
 makeA = function(){return new A};
 makeX = function(){return new X};
+
+self.nativeConstructor(A);
+self.nativeConstructor(X);
 """;
 
 testDynamic() {
-  var things = [makeA(), new B(), makeX()];
-  var a = things[0];
-  var b = things[1];
-  var x = things[2];
+  var a = confuse(makeA());
+  var b = confuse(new B());
+  var x = confuse(makeX());
 
   Expect.equals(111, a.key);
   Expect.equals(222, b.key);
@@ -91,6 +92,7 @@
 }
 
 main() {
+  nativeTesting();
   setup();
 
   testTyped();
diff --git a/tests/compiler/dart2js_native/native_library_same_name_used_frog_test.dart b/tests/compiler/dart2js_native/native_library_same_name_used_frog_test.dart
index 9f305f7..e90e9f4 100644
--- a/tests/compiler/dart2js_native/native_library_same_name_used_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_library_same_name_used_frog_test.dart
@@ -6,7 +6,7 @@
 
 library main;
 
-import "package:expect/expect.dart";
+import 'native_testing.dart';
 import 'native_library_same_name_used_lib1.dart';
 
 void setup() native """
@@ -15,6 +15,7 @@
   I.prototype.read = function() { return this._x; };
   I.prototype.write = function(x) { this._x = x; };
   makeI = function(){return new I};
+  self.nativeConstructor(I);
 """;
 
 // A pure Dart implementation of I.
@@ -31,6 +32,7 @@
 }
 
 main() {
+  nativeTesting();
   setup();
 
   var a1 = makeI();
@@ -47,4 +49,7 @@
 
   Expect.isTrue(a1 is I, 'a1 is I');
   Expect.isFalse(a1 is ProxyI, 'a1 is ProxyI');
+
+  Expect.isTrue(confuse(a1) is I, 'a1 is I');
+  Expect.isFalse(confuse(a1) is ProxyI, 'a1 is ProxyI');
 }
diff --git a/tests/compiler/dart2js_native/native_method_inlining_test.dart b/tests/compiler/dart2js_native/native_method_inlining_test.dart
index dce81ec..07a0620 100644
--- a/tests/compiler/dart2js_native/native_method_inlining_test.dart
+++ b/tests/compiler/dart2js_native/native_method_inlining_test.dart
@@ -5,8 +5,7 @@
 // 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.
 
-import "package:expect/expect.dart";
-import 'dart:_js_helper' show Native, NoInline;
+import 'native_testing.dart';
 
 typedef int Int2Int(int x);
 
@@ -71,6 +70,8 @@
     if (s.indexOf(string)>0) return s;
   }
 };
+
+self.nativeConstructor(A);
 """;
 
 bool get isCheckedMode {
@@ -148,6 +149,7 @@
 }
 
 main() {
+  nativeTesting();
   setup();
   test1();
   test2();
diff --git a/tests/compiler/dart2js_native/native_method_rename1_frog_test.dart b/tests/compiler/dart2js_native/native_method_rename1_frog_test.dart
index e38cd28..4d8ead2 100644
--- a/tests/compiler/dart2js_native/native_method_rename1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_method_rename1_frog_test.dart
@@ -4,7 +4,7 @@
 
 // Test the feature where the native string declares the native method's name.
 
-import "package:expect/expect.dart";
+import 'native_testing.dart';
 import 'dart:_js_helper' show Native, JSName;
 
 @Native("A")
@@ -34,14 +34,13 @@
 A.prototype.bazA = function(){return 300;};
 
 makeA = function(){return new A};
+
+self.nativeConstructor(A);
 """;
 
 testDynamic() {
-  setup();
-
-  var things = [makeA(), new B()];
-  var a = things[0];
-  var b = things[1];
+  var a = confuse(makeA());
+  var b = confuse(new B());
 
   Expect.equals(100, a.foo());
   Expect.equals(200, a.bar());
@@ -62,6 +61,7 @@
 }
 
 main() {
+  nativeTesting();
   setup();
   testDynamic();
   testTyped();
diff --git a/tests/compiler/dart2js_native/native_method_rename2_frog_test.dart b/tests/compiler/dart2js_native/native_method_rename2_frog_test.dart
index e375f2f..5979e1e 100644
--- a/tests/compiler/dart2js_native/native_method_rename2_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_method_rename2_frog_test.dart
@@ -4,8 +4,7 @@
 
 // Test the feature where the native string declares the native method's name.
 
-import "package:expect/expect.dart";
-import 'dart:_js_helper' show Native, JSName;
+import "native_testing.dart";
 
 @Native("A")
 class A {
@@ -42,6 +41,9 @@
 
 makeA = function(){return new A};
 makeB = function(){return new B};
+
+self.nativeConstructor(A);
+self.nativeConstructor(B);
 """;
 
 testDynamic() {
@@ -76,6 +78,7 @@
 }
 
 main() {
+  nativeTesting();
   setup();
 
   testDynamic();
diff --git a/tests/compiler/dart2js_native/native_method_rename3_frog_test.dart b/tests/compiler/dart2js_native/native_method_rename3_frog_test.dart
index fcfd40b..014e669 100644
--- a/tests/compiler/dart2js_native/native_method_rename3_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_method_rename3_frog_test.dart
@@ -5,8 +5,7 @@
 // Test the feature where the native string declares the native method's name.
 // #3. The name does not get
 
-import "package:expect/expect.dart";
-import 'dart:_js_helper' show Native, JSName;
+import 'native_testing.dart';
 
 @Native("A")
 class A {
@@ -49,13 +48,15 @@
 
 makeA = function(){return new A};
 makeB = function(){return new B};
+
+self.nativeConstructor(A);
+self.nativeConstructor(B);
 """;
 
 testDynamic() {
-  var things = [makeA(), makeB(), new Decoy()];
-  var a = things[0];
-  var b = things[1];
-  var d = things[2];
+  var a = confuse(makeA());
+  var b = confuse(makeB());
+  var d = confuse(new Decoy());
 
   Expect.equals(100, a.foo());
   Expect.equals(200, b.foo());
@@ -87,6 +88,7 @@
 }
 
 main() {
+  nativeTesting();
   setup();
 
   testDynamic();
diff --git a/tests/compiler/dart2js_native/native_method_with_keyword_name_test.dart b/tests/compiler/dart2js_native/native_method_with_keyword_name_test.dart
index cb16ab1..d35c1c7 100644
--- a/tests/compiler/dart2js_native/native_method_with_keyword_name_test.dart
+++ b/tests/compiler/dart2js_native/native_method_with_keyword_name_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import 'native_testing.dart';
 
 // Make sure we can have a native with a name that is a JavaScript keyword.
 
@@ -19,13 +18,15 @@
 A.prototype.delete = function() { return 87; };
 
 makeA = function(){return new A;};
+self.nativeConstructor(A);
 """;
 
 main() {
+  nativeTesting();
   setup();
 
-  var a = makeA();
-  Expect.equals(87, a.delete());
-  A aa = a;
-  Expect.equals(87, aa.delete());
+  var a1 = confuse(makeA());
+  Expect.equals(87, a1.delete());
+  A a2 = makeA();
+  Expect.equals(87, a2.delete());
 }
diff --git a/tests/compiler/dart2js_native/native_mirror_test.dart b/tests/compiler/dart2js_native/native_mirror_test.dart
index 58e8ffe..99551c6 100644
--- a/tests/compiler/dart2js_native/native_mirror_test.dart
+++ b/tests/compiler/dart2js_native/native_mirror_test.dart
@@ -9,9 +9,9 @@
 // calling-convention for parts of the compiler, and the non-intercepted
 // convention for others, making this fail.
 
-import "package:expect/expect.dart";
-import "dart:_js_helper";
-import "dart:mirrors";
+import 'native_testing.dart';
+import 'dart:_js_helper';
+import 'dart:mirrors';
 
 @Native("A")
 class A {
diff --git a/tests/compiler/dart2js_native/native_missing_method1_frog_test.dart b/tests/compiler/dart2js_native/native_missing_method1_frog_test.dart
index a6c0e077..6223080 100644
--- a/tests/compiler/dart2js_native/native_missing_method1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_missing_method1_frog_test.dart
@@ -2,47 +2,50 @@
 // for 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:_js_helper";
-import "package:expect/expect.dart";
+import 'native_testing.dart';
 
 @Native("A")
 class A {}
 
-makeA() native ;
+A makeA() native ;
 
 void setup() native """
 function A() {};
-A.prototype.foo = function() { return  42; }
+A.prototype.foo = function() { return  99; }
 makeA = function() { return new A; }
+self.nativeConstructor(A);
 """;
 
 class B {
-  // We need to define a foo method so that Frog sees it. Because it's
-  // the only occurence of 'foo', Frog does not bother mangling the
-  // call sites. It thinks all calls will either go to this method, or
-  // throw a NoSuchMethodError.
+  // We need to define a foo method so that dart2js sees it. Because the the
+  // only occurences of 'foo' is on B, a Dart class, no interceptor is used.  It
+  // thinks all calls will either go to this method, or throw a
+  // NoSuchMethodError. It is possible that the native class will shadow a
+  // method, but it will not shadow 'foo' because the name is either 'mangled'
+  // with the arity, or minified.
   foo() {
     return 42;
   }
 }
 
 typedContext() {
-  var things = [makeA(), new B()];
-  A a = things[0];
+  confuse(new B()).foo();
+  A a = makeA();
   Expect.throws(() => a.foo(), (e) => e is NoSuchMethodError);
   Expect.throws(() => a.foo, (e) => e is NoSuchMethodError);
   Expect.throws(() => a.foo = 4, (e) => e is NoSuchMethodError);
 }
 
 untypedContext() {
-  var things = [makeA(), new B()];
-  var a = things[0];
+  confuse(new B()).foo();
+  var a = confuse(makeA());
   Expect.throws(() => a.foo(), (e) => e is NoSuchMethodError);
   Expect.throws(() => a.foo, (e) => e is NoSuchMethodError);
   Expect.throws(() => a.foo = 4, (e) => e is NoSuchMethodError);
 }
 
 main() {
+  nativeTesting();
   setup();
   typedContext();
   untypedContext();
diff --git a/tests/compiler/dart2js_native/native_missing_method2_frog_test.dart b/tests/compiler/dart2js_native/native_missing_method2_frog_test.dart
index 0a7b1f4..2baba11 100644
--- a/tests/compiler/dart2js_native/native_missing_method2_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_missing_method2_frog_test.dart
@@ -2,18 +2,17 @@
 // for 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:_js_helper";
-import "package:expect/expect.dart";
-
+import 'native_testing.dart';
 @Native("A")
 class A {}
 
-makeA() native ;
+A makeA() native ;
 
 void setup() native """
 function A() {};
 A.prototype.foo = function() { return  42; }
 makeA = function() { return new A; }
+self.nativeConstructor(A);
 """;
 
 class B {
@@ -31,23 +30,24 @@
 }
 
 typedContext() {
-  var things = [makeA(), new B()];
-  A a = things[0];
+  A a = makeA();
   Expect.throws(() => a.foo(), (e) => e is NoSuchMethodError);
   Expect.throws(() => a.foo, (e) => e is NoSuchMethodError);
   Expect.throws(() => a.foo = 4, (e) => e is NoSuchMethodError);
 }
 
 untypedContext() {
-  var things = [makeA(), new B()];
-  var a = things[0];
+  var a = confuse(makeA());
   Expect.throws(() => a.foo(), (e) => e is NoSuchMethodError);
   Expect.throws(() => a.foo, (e) => e is NoSuchMethodError);
   Expect.throws(() => a.foo = 4, (e) => e is NoSuchMethodError);
 }
 
 main() {
+  nativeTesting();
   setup();
+  confuse(new B()).foo();
+  confuse(new C()).foo(1);
   typedContext();
   untypedContext();
 }
diff --git a/tests/compiler/dart2js_native/native_mixin_field_test.dart b/tests/compiler/dart2js_native/native_mixin_field_test.dart
index 87688c5..5cf736b 100644
--- a/tests/compiler/dart2js_native/native_mixin_field_test.dart
+++ b/tests/compiler/dart2js_native/native_mixin_field_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Test that native classes can use ordinary Dart classes with fields
 // as mixins.
@@ -35,9 +34,14 @@
 function B() {A.call(this);this.bar='B-bar';this.baz='M1-baz';}
 makeA = function(){return new A;};
 makeB = function(){return new B;};
+
+self.nativeConstructor(A);
+self.nativeConstructor(B);
 """;
 
+
 main() {
+  nativeTesting();
   setup();
   A a = makeA();
   Expect.equals("A-foo", a.foo);
diff --git a/tests/compiler/dart2js_native/native_mixin_multiple2_test.dart b/tests/compiler/dart2js_native/native_mixin_multiple2_test.dart
index e3196e1..2fb2b2b 100644
--- a/tests/compiler/dart2js_native/native_mixin_multiple2_test.dart
+++ b/tests/compiler/dart2js_native/native_mixin_multiple2_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Test that native classes can access methods defined only by mixins.
 
@@ -30,9 +29,12 @@
 void setup() native """
 function B() {}
 makeB = function(){return new B;};
+
+self.nativeConstructor(B);
 """;
 
 main() {
+  nativeTesting();
   setup();
 
   B b = makeB();
diff --git a/tests/compiler/dart2js_native/native_mixin_multiple3_test.dart b/tests/compiler/dart2js_native/native_mixin_multiple3_test.dart
index 3b8875c..ccbdd0c 100644
--- a/tests/compiler/dart2js_native/native_mixin_multiple3_test.dart
+++ b/tests/compiler/dart2js_native/native_mixin_multiple3_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Test that native classes and plain classes can access methods defined only by
 // the same mixin.
@@ -46,6 +45,10 @@
 makeA = function(){return new A;};
 makeB = function(){return new B;};
 makeC = function(){return new C;};
+
+self.nativeConstructor(A);
+self.nativeConstructor(B);
+self.nativeConstructor(C);
 """;
 
 var g;
@@ -62,6 +65,7 @@
 makeAll() => [makeA(), makeB(), makeC(), new D(), new E()];
 
 main() {
+  nativeTesting();
   setup();
   /*
   var a = makeA();
diff --git a/tests/compiler/dart2js_native/native_mixin_multiple_test.dart b/tests/compiler/dart2js_native/native_mixin_multiple_test.dart
index 0e43179..b8167bc 100644
--- a/tests/compiler/dart2js_native/native_mixin_multiple_test.dart
+++ b/tests/compiler/dart2js_native/native_mixin_multiple_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Test that native classes can use ordinary Dart classes as mixins.
 
@@ -35,9 +34,13 @@
 function B() {}
 makeA = function(){return new A;};
 makeB = function(){return new B;};
+
+self.nativeConstructor(A);
+self.nativeConstructor(B);
 """;
 
 main() {
+  nativeTesting();
   setup();
   A a = makeA();
   Expect.equals("A-foo", a.foo());
diff --git a/tests/compiler/dart2js_native/native_mixin_test.dart b/tests/compiler/dart2js_native/native_mixin_test.dart
index 667da82..a0ab15b 100644
--- a/tests/compiler/dart2js_native/native_mixin_test.dart
+++ b/tests/compiler/dart2js_native/native_mixin_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Test that native classes can use ordinary Dart classes as mixins.
 
@@ -31,9 +30,13 @@
 function B() {}
 makeA = function(){return new A;};
 makeB = function(){return new B;};
+
+self.nativeConstructor(A);
+self.nativeConstructor(B);
 """;
 
 main() {
+  nativeTesting();
   setup();
   A a = makeA();
   Expect.equals("A-foo", a.foo());
diff --git a/tests/compiler/dart2js_native/native_mixin_with_plain_test.dart b/tests/compiler/dart2js_native/native_mixin_with_plain_test.dart
index 92377a1..5311c32 100644
--- a/tests/compiler/dart2js_native/native_mixin_with_plain_test.dart
+++ b/tests/compiler/dart2js_native/native_mixin_with_plain_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Test that native classes and ordinary Dart classes can both use the same
 // ordinary Dart classes as a mixin.
@@ -46,9 +45,13 @@
 function B() {this.aa = 'bb'}
 makeA = function(){return new A;};
 makeB = function(){return new B;};
+
+self.nativeConstructor(A);
+self.nativeConstructor(B);
 """;
 
 main() {
+  nativeTesting();
   setup();
   var things = [makeA, makeB, () => new C(), () => new D(), () => new M()]
       .map((f) => f())
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 9553be5..ef9429a 100644
--- a/tests/compiler/dart2js_native/native_named_constructors2_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_named_constructors2_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Native class with named constructors and static methods.
 
@@ -30,9 +29,11 @@
 function A(arg) { this._x = arg; }
 A.prototype.foo = function() { return this._x; };
 makeA = function(arg) { return new A(arg); }
+self.nativeConstructor(A);
 """;
 
 main() {
+  nativeTesting();
   setup();
   var a1 = new A(100);
   var a2 = new A.fromString('Hello');
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 dcc89fa..390835c 100644
--- a/tests/compiler/dart2js_native/native_named_constructors3_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_named_constructors3_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Hidden native class with factory constructors and NO static methods.
 // Regression test.
@@ -29,9 +28,11 @@
 function A(arg) { this._x = arg; }
 A.prototype.foo = function(){ return this._x; }
 makeA = function(arg) { return new A(arg); }
+self.nativeConstructor(A);
 """;
 
 main() {
+  nativeTesting();
   setup();
   var a1 = new A(100);
   var a2 = new A.fromString('Hello');
diff --git a/tests/compiler/dart2js_native/native_no_such_method_exception2_frog_test.dart b/tests/compiler/dart2js_native/native_no_such_method_exception2_frog_test.dart
index 42a6bda..369b3d9 100644
--- a/tests/compiler/dart2js_native/native_no_such_method_exception2_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_no_such_method_exception2_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 @Native("A")
 class A {}
@@ -33,9 +32,13 @@
   makeA = function() { return new A; }
   makeB = function() { return new B; }
   B.prototype.foo = function() { return 42; }
+
+  self.nativeConstructor(A);
+  self.nativeConstructor(B);
 """;
 
 main() {
+  nativeTesting();
   setup();
   var a = makeA();
   var exception;
diff --git a/tests/compiler/dart2js_native/native_no_such_method_exception3_frog_test.dart b/tests/compiler/dart2js_native/native_no_such_method_exception3_frog_test.dart
index ca125cb..367cb2a 100644
--- a/tests/compiler/dart2js_native/native_no_such_method_exception3_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_no_such_method_exception3_frog_test.dart
@@ -3,8 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import "dart:mirrors" show reflect;
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 class GetName {
   foo(x, y, [z]) => "foo";
@@ -32,9 +31,12 @@
 setup() native """
   function A() {}
   makeA = function() { return new A; }
+
+  self.nativeConstructor(A);
 """;
 
 main() {
+  nativeTesting();
   setup();
   var a = makeA();
   a.bar();
diff --git a/tests/compiler/dart2js_native/native_no_such_method_exception4_frog_test.dart b/tests/compiler/dart2js_native/native_no_such_method_exception4_frog_test.dart
index 3bf26fd..6d3f866 100644
--- a/tests/compiler/dart2js_native/native_no_such_method_exception4_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_no_such_method_exception4_frog_test.dart
@@ -3,8 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import "dart:mirrors" show reflect;
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 class GetName {
   foo(x, y) => "foo";
@@ -29,9 +28,11 @@
 setup() native """
   function A() {}
   makeA = function() { return new A; }
+  self.nativeConstructor(A);
 """;
 
 main() {
+  nativeTesting();
   setup();
   var a = makeA();
   a.bar();
diff --git a/tests/compiler/dart2js_native/native_no_such_method_exception5_frog_test.dart b/tests/compiler/dart2js_native/native_no_such_method_exception5_frog_test.dart
index 141ab49..0d744c9 100644
--- a/tests/compiler/dart2js_native/native_no_such_method_exception5_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_no_such_method_exception5_frog_test.dart
@@ -3,8 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import "dart:mirrors" show reflect;
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 class GetName {
   foo(x, [y]) => "foo";
@@ -34,9 +33,11 @@
 setup() native """
   function A() {}
   makeA = function() { return new A; }
+  self.nativeConstructor(A);
 """;
 
 main() {
+  nativeTesting();
   setup();
   var a = makeA();
   a.bar();
diff --git a/tests/compiler/dart2js_native/native_no_such_method_exception_frog_test.dart b/tests/compiler/dart2js_native/native_no_such_method_exception_frog_test.dart
index f578e89..9aaa100 100644
--- a/tests/compiler/dart2js_native/native_no_such_method_exception_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_no_such_method_exception_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 @Native("A")
 class A {
@@ -20,9 +19,11 @@
 setup() native """
   function A() {}
   makeA = function() { return new A; }
+  self.nativeConstructor(A);
 """;
 
 main() {
+  nativeTesting();
   setup();
   var a = makeA();
   a.bar();
diff --git a/tests/compiler/dart2js_native/native_novel_html_test.dart b/tests/compiler/dart2js_native/native_novel_html_test.dart
index e03589e..01b5099 100644
--- a/tests/compiler/dart2js_native/native_novel_html_test.dart
+++ b/tests/compiler/dart2js_native/native_novel_html_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import 'native_testing.dart';
 
 // Test to see if novel HTML tags are interpreted as HTMLElement.
 
@@ -31,15 +30,11 @@
 };
 makeF = function(){return new HTMLFakeyElement};
 
-// Make the HTMLGoofyElement look like a real host object.
-var theRealObjectToString = Object.prototype.toString;
-Object.prototype.toString = function() {
-  if (this instanceof HTMLGoofyElement) return '[object HTMLGoofyElement]';
-  return theRealObjectToString.call(this);
-}
+self.nativeConstructor(HTMLGoofyElement);
 """;
 
 main() {
+  nativeTesting();
   setup();
 
   var e = makeE();
diff --git a/tests/compiler/dart2js_native/native_null_closure_frog_test.dart b/tests/compiler/dart2js_native/native_null_closure_frog_test.dart
index ec6f8d5..7f19e1e 100644
--- a/tests/compiler/dart2js_native/native_null_closure_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_null_closure_frog_test.dart
@@ -4,9 +4,7 @@
 
 // Test that exception unwrapping handle cases like ({foo:null}).foo().
 
-import "dart:_js_helper";
-
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 typedef void MyFunctionType();
 
@@ -25,9 +23,12 @@
 A.prototype.check = function(f) { return this.f === f; };
 A.prototype.invoke = function() { return this.f(); };
 makeA = function(){return new A;};
+
+self.nativeConstructor(A);
 """;
 
 main() {
+  nativeTesting();
   setup();
   A a = makeA();
   a.setClosure(null);
@@ -35,7 +36,7 @@
   bool caughtException = false;
   try {
     a.invoke();
-  } on JsNoSuchMethodError catch (e) {
+  } on NoSuchMethodError catch (e) {
     print(e);
     caughtException = true;
   }
diff --git a/tests/compiler/dart2js_native/native_null_frog_test.dart b/tests/compiler/dart2js_native/native_null_frog_test.dart
index d554a52..9bd08eb 100644
--- a/tests/compiler/dart2js_native/native_null_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_null_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Test for values of some basic types.
 
@@ -24,10 +23,11 @@
 A.prototype.returnEmptyString = function() { return ""; };
 A.prototype.returnZero = function() { return 0; };
 makeA = function(){return new A;};
+self.nativeConstructor(A);
 """;
 
-main() {
-  setup();
+@NoInline()
+staticTests() {
   A a = makeA();
   Expect.equals(null, a.returnNull());
   Expect.equals(null, a.returnUndefined());
@@ -39,3 +39,24 @@
   Expect.isTrue(a.returnZero() is int);
   Expect.equals(0, a.returnZero());
 }
+
+@NoInline()
+dynamicTests() {
+  A a = makeA();
+  Expect.equals(null, confuse(a).returnNull());
+  Expect.equals(null, confuse(a).returnUndefined());
+
+  Expect.equals('', confuse(a).returnEmptyString());
+  Expect.isTrue(confuse(a).returnEmptyString().isEmpty);
+  Expect.isTrue(confuse(a).returnEmptyString() is String);
+
+  Expect.isTrue(confuse(a).returnZero() is int);
+  Expect.equals(0, confuse(a).returnZero());
+}
+
+main() {
+  nativeTesting();
+  setup();
+  staticTests();
+  dynamicTests();
+}
diff --git a/tests/compiler/dart2js_native/native_property_frog_test.dart b/tests/compiler/dart2js_native/native_property_frog_test.dart
index a897596..ae68f6e 100644
--- a/tests/compiler/dart2js_native/native_property_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_property_frog_test.dart
@@ -4,9 +4,7 @@
 
 // Properties on hidden native classes.
 
-import "package:expect/expect.dart";
-import "dart:_js_helper";
-import 'dart:_foreign_helper' show JS;
+import 'native_testing.dart';
 
 @Native("A")
 class A {
@@ -36,10 +34,13 @@
 });
 
 makeA = function(){return new A;};
+
+self.nativeConstructor(A);
 """;
 
 
 main() {
+  nativeTesting();
   setup();
 
   var a = makeA();
@@ -54,4 +55,11 @@
   Expect.equals(10, a.X);
   Expect.equals(20, a.Y);
   Expect.equals(30, a.Z);
+
+  confuse(a).setX(6);
+  Expect.equals(6, confuse(a).getX());
+
+  Expect.equals(6, confuse(a).X);
+  Expect.equals(20, confuse(a).Y);
+  Expect.equals(30, confuse(a).Z);
 }
diff --git a/tests/compiler/dart2js_native/native_testing.dart b/tests/compiler/dart2js_native/native_testing.dart
new file mode 100644
index 0000000..8d90b0b
--- /dev/null
+++ b/tests/compiler/dart2js_native/native_testing.dart
@@ -0,0 +1,50 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Native testing library. Provides support for mock @Native classes and
+// collects common imports.
+
+
+import "package:expect/expect.dart";
+import 'dart:_js_helper' show Native;
+
+export "package:expect/expect.dart";
+export 'dart:_js_helper' show Creates, Native, JSName, Returns;
+export 'dart:_foreign_helper' show JS;
+
+void _setup() native r'''
+((function() {
+  var toStringResultProperty = "_toStringResult";
+  var objectToStringMethod = Object.prototype.toString;
+
+  Object.prototype.toString = function() {
+    if (this != null) {
+      var constructor = this.constructor;
+      if (constructor != null) {
+        var result = constructor[toStringResultProperty];
+        if (typeof result == "string") return result;
+      }
+    }
+    return objectToStringMethod.call(this);
+  }
+
+  // To mock a @Native class with JavaScript constructor `Foo`, add
+  //
+  //     self.nativeConstructor(Foo);
+  //
+  // to the JavaScript code.
+  self.nativeConstructor = function(constructor, opt_name) {
+    var toStringResult = "[object " + (opt_name || constructor.name) + "]";
+    constructor[toStringResultProperty] = toStringResult;
+  }
+})());
+''';
+
+void nativeTesting() {
+  _setup();
+}
+
+@NoInline()
+@AssumeDynamic()
+confuse(x) => x;
diff --git a/tests/compiler/dart2js_native/native_to_string_frog_test.dart b/tests/compiler/dart2js_native/native_to_string_frog_test.dart
index cff3ac4..1eaffb7 100644
--- a/tests/compiler/dart2js_native/native_to_string_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_to_string_frog_test.dart
@@ -2,20 +2,28 @@
 // for 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:_js_helper";
-import "package:expect/expect.dart";
+import 'native_testing.dart';
 
 @Native("A")
-class A {}
+class A {
+  toString() => 'AAA';
+}
 
 makeA() native ;
 
 void setup() native """
 function A() {}
 makeA = function(){return new A;};
+self.nativeConstructor(A);
 """;
 
 main() {
+  nativeTesting();
   setup();
+
   Expect.isTrue(makeA().toString() is String);
+  Expect.equals('AAA', makeA().toString());
+
+  Expect.isTrue(confuse(makeA()).toString() is String);
+  Expect.equals('AAA', confuse(makeA()).toString());
 }
diff --git a/tests/compiler/dart2js_native/native_use_native_name_in_table_frog_test.dart b/tests/compiler/dart2js_native/native_use_native_name_in_table_frog_test.dart
index 712d173..604cfa1 100644
--- a/tests/compiler/dart2js_native/native_use_native_name_in_table_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_use_native_name_in_table_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import 'native_testing.dart';
 
 // Test that we put native names and not Dart names into the dynamic
 // dispatch table.
@@ -37,18 +36,18 @@
 
 makeA = function(){return new NativeA;};
 makeB = function(){return new NativeB;};
+
+self.nativeConstructor(NativeA);
+self.nativeConstructor(NativeB);
 """;
 
 main() {
+  nativeTesting();
   setup();
 
-  var a = makeA();
-  Expect.equals(42, a.foo());
-  A aa = a;
-  Expect.equals(42, aa.foo());
+  Expect.equals(42, makeA().foo());
+  Expect.equals(42, confuse(makeA()).foo());
 
-  var b = makeB();
-  Expect.equals(42, b.foo());
-  B bb = b;
-  Expect.equals(42, bb.foo());
+  Expect.equals(42, makeB().foo());
+  Expect.equals(42, confuse(makeB()).foo());
 }
diff --git a/tests/compiler/dart2js_native/native_window1_frog_test.dart b/tests/compiler/dart2js_native/native_window1_frog_test.dart
index 80c56cb..fd18641 100644
--- a/tests/compiler/dart2js_native/native_window1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_window1_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 abstract class Window {
   final int document;
@@ -19,6 +18,7 @@
 class Win implements Window {}
 
 main() {
+  nativeTesting();
   // By typing this variable to 'Window', Frog will optimize calls on
   // it.
   Window win = new Win();
diff --git a/tests/compiler/dart2js_native/native_window2_frog_test.dart b/tests/compiler/dart2js_native/native_window2_frog_test.dart
index d523667..77846c3 100644
--- a/tests/compiler/dart2js_native/native_window2_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_window2_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 abstract class Window {
   final int document;
@@ -19,6 +18,7 @@
 class Win implements Window {}
 
 main() {
+  nativeTesting();
   // By not typing the variable, Frog does not try to optimize calls
   // on it.
   var win = new Win();
diff --git a/tests/compiler/dart2js_native/native_wrapping_function3_frog_test.dart b/tests/compiler/dart2js_native/native_wrapping_function3_frog_test.dart
index 4e82838..a331521 100644
--- a/tests/compiler/dart2js_native/native_wrapping_function3_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_wrapping_function3_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "package:expect/expect.dart";
-import "dart:_js_helper";
+import "native_testing.dart";
 
 typedef void Callback0();
 typedef void Callback1(arg1);
@@ -15,7 +14,7 @@
   foo2(Callback2 closure, [arg1 = 0, arg2 = 1]) native ;
 }
 
-makeA() native ;
+A makeA() native ;
 
 void setup() native """
 function A() {}
@@ -24,21 +23,24 @@
   return closure(arg1, arg2);
 };
 makeA = function(){return new A;};
+self.nativeConstructor(A);
 """;
 
 main() {
+  nativeTesting();
   setup();
   var a = makeA();
+  // Statically known receiver type calls.
   Expect.equals(43, a.foo1((arg1) => arg1, 43));
   Expect.equals(0, a.foo1((arg1) => arg1));
 
   Expect.equals(44, a.foo2((arg1, arg2) => arg1 + arg2, 21, 23));
   Expect.equals(22, a.foo2((arg1, arg2) => arg1 + arg2, 21));
 
-  A aa = a;
-  Expect.equals(43, aa.foo1((arg1) => arg1, 43));
-  Expect.equals(0, aa.foo1((arg1) => arg1));
+  // Dynamic calls.
+  Expect.equals(43, confuse(a).foo1((arg1) => arg1, 43));
+  Expect.equals(0, confuse(a).foo1((arg1) => arg1));
 
-  Expect.equals(44, aa.foo2((arg1, arg2) => arg1 + arg2, 21, 23));
-  Expect.equals(22, aa.foo2((arg1, arg2) => arg1 + arg2, 21));
+  Expect.equals(44, confuse(a).foo2((arg1, arg2) => arg1 + arg2, 21, 23));
+  Expect.equals(22, confuse(a).foo2((arg1, arg2) => arg1 + arg2, 21));
 }
diff --git a/tests/compiler/dart2js_native/native_wrapping_function_frog_test.dart b/tests/compiler/dart2js_native/native_wrapping_function_frog_test.dart
index e57daf6..51597dd 100644
--- a/tests/compiler/dart2js_native/native_wrapping_function_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_wrapping_function_frog_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 typedef void Callback0();
 typedef void Callback1(arg1);
@@ -26,9 +25,11 @@
   return closure(arg1, arg2);
 };
 makeA = function(){return new A;};
+self.nativeConstructor(A);
 """;
 
 main() {
+  nativeTesting();
   setup();
   var a = makeA();
   Expect.equals(42, a.foo0(() => 42));
diff --git a/tests/compiler/dart2js_native/oddly_named_fields_test.dart b/tests/compiler/dart2js_native/oddly_named_fields_test.dart
index 9561a58..23b244e 100644
--- a/tests/compiler/dart2js_native/oddly_named_fields_test.dart
+++ b/tests/compiler/dart2js_native/oddly_named_fields_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.
 
-import 'dart:_js_helper';
+import 'native_testing.dart';
 
 // JavaScript reserved words:
 //
@@ -1384,9 +1384,11 @@
 setup() native """
 function NativeClassWithOddNames() {}
 makeNativeClassWithOddNames = function() { return new NativeClassWithOddNames; }
+self.nativeConstructor(NativeClassWithOddNames);
 """;
 
 main() {
+  nativeTesting();
   setup();
   var object = makeNativeClassWithOddNames();
   object.testMyFields();
diff --git a/tests/compiler/dart2js_native/runtimetype_test.dart b/tests/compiler/dart2js_native/runtimetype_test.dart
index 4667eca..babdc11 100644
--- a/tests/compiler/dart2js_native/runtimetype_test.dart
+++ b/tests/compiler/dart2js_native/runtimetype_test.dart
@@ -2,9 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "package:expect/expect.dart";
-import "dart:_js_helper";
-import 'dart:_foreign_helper' show JS;
+import 'native_testing.dart';
 
 // Test to see runtimeType works on native classes and does not use the native
 // constructor name.
@@ -33,6 +31,9 @@
 
 makeA = function(){return new TAGX};
 makeB = function(){return new TAGY};
+
+self.nativeConstructor(TAGX);
+self.nativeConstructor(TAGY);
 """;
 
 testDynamicContext() {
@@ -58,6 +59,7 @@
 }
 
 main() {
+  nativeTesting();
   setup();
 
   testDynamicContext();
diff --git a/tests/compiler/dart2js_native/static_methods_test.dart b/tests/compiler/dart2js_native/static_methods_test.dart
index f1cfd44..c646bfd 100644
--- a/tests/compiler/dart2js_native/static_methods_test.dart
+++ b/tests/compiler/dart2js_native/static_methods_test.dart
@@ -7,8 +7,8 @@
 //   identifier @JSName -> use @Native tag as 'scope' for @JSName.
 //   other @JSName -> use @JSName as an expression.
 
-import "package:expect/expect.dart";
-import 'dart:_js_helper' show Native, JSName, convertDartClosureToJS;
+import 'native_testing.dart';
+import 'dart:_js_helper' show convertDartClosureToJS;
 
 typedef int Callback(String s);
 
@@ -51,6 +51,7 @@
 """;
 
 main() {
+  nativeTesting();
   setup();
 
   // TODO(sra): Investigate why this line is necessary to get a correctly
diff --git a/tests/compiler/dart2js_native/subclassing_1_test.dart b/tests/compiler/dart2js_native/subclassing_1_test.dart
index 77ca191..69a2aa9 100644
--- a/tests/compiler/dart2js_native/subclassing_1_test.dart
+++ b/tests/compiler/dart2js_native/subclassing_1_test.dart
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "package:expect/expect.dart";
-import 'dart:_js_helper' show Native, Creates, setNativeSubclassDispatchRecord;
+import "native_testing.dart";
+import 'dart:_js_helper' show setNativeSubclassDispatchRecord;
 import 'dart:_interceptors' show findInterceptorForType;
 
 // Test that subclasses of native classes can be defined by setting the dispatch
@@ -43,6 +43,7 @@
 """;
 
 main() {
+  nativeTesting();
   setup();
 
   setNativeSubclassDispatchRecord(getBPrototype(), findInterceptorForType(B));
diff --git a/tests/compiler/dart2js_native/subclassing_2_test.dart b/tests/compiler/dart2js_native/subclassing_2_test.dart
index 4b9785c..a6b8bb3 100644
--- a/tests/compiler/dart2js_native/subclassing_2_test.dart
+++ b/tests/compiler/dart2js_native/subclassing_2_test.dart
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "package:expect/expect.dart";
-import 'dart:_js_helper' show Native, Creates, setNativeSubclassDispatchRecord;
+import 'native_testing.dart';
+import 'dart:_js_helper' show setNativeSubclassDispatchRecord;
 import 'dart:_interceptors' show findInterceptorForType;
 
 // Test calling convention of methods introduced on subclasses of native
@@ -37,6 +37,7 @@
 """;
 
 main() {
+  nativeTesting();
   setup();
 
   setNativeSubclassDispatchRecord(getBPrototype(), findInterceptorForType(B));
diff --git a/tests/compiler/dart2js_native/subclassing_3_test.dart b/tests/compiler/dart2js_native/subclassing_3_test.dart
index 890f556..528104d 100644
--- a/tests/compiler/dart2js_native/subclassing_3_test.dart
+++ b/tests/compiler/dart2js_native/subclassing_3_test.dart
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "package:expect/expect.dart";
-import 'dart:_js_helper' show Native, Creates, setNativeSubclassDispatchRecord;
+import 'native_testing.dart';
+import 'dart:_js_helper' show setNativeSubclassDispatchRecord;
 import 'dart:_interceptors' show Interceptor, findInterceptorForType;
 
 // Test calling convention of methods introduced on subclasses of native
@@ -42,6 +42,7 @@
 """;
 
 main() {
+  nativeTesting();
   setup();
 
   setNativeSubclassDispatchRecord(getBPrototype(), findInterceptorForType(B));
diff --git a/tests/compiler/dart2js_native/subclassing_4_test.dart b/tests/compiler/dart2js_native/subclassing_4_test.dart
index 3e5d482..a284158 100644
--- a/tests/compiler/dart2js_native/subclassing_4_test.dart
+++ b/tests/compiler/dart2js_native/subclassing_4_test.dart
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "package:expect/expect.dart";
-import 'dart:_js_helper' show Native, Creates, setNativeSubclassDispatchRecord;
+import 'native_testing.dart';
+import 'dart:_js_helper' show setNativeSubclassDispatchRecord;
 import 'dart:_interceptors' show Interceptor, findInterceptorForType;
 
 // Test calling convention on subclasses of native classes.
@@ -39,6 +39,7 @@
 """;
 
 main() {
+  nativeTesting();
   setup();
 
   setNativeSubclassDispatchRecord(getBPrototype(), findInterceptorForType(B));
diff --git a/tests/compiler/dart2js_native/subclassing_5_test.dart b/tests/compiler/dart2js_native/subclassing_5_test.dart
index 7985893..26a4655 100644
--- a/tests/compiler/dart2js_native/subclassing_5_test.dart
+++ b/tests/compiler/dart2js_native/subclassing_5_test.dart
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "package:expect/expect.dart";
-import 'dart:_js_helper' show Native, Creates, setNativeSubclassDispatchRecord;
+import 'native_testing.dart';
+import 'dart:_js_helper' show setNativeSubclassDispatchRecord;
 import 'dart:_interceptors' show Interceptor, findInterceptorForType;
 
 // Test type checks.
@@ -121,51 +121,49 @@
   Expect.identical(x, z);
 }
 
-var inscrutable;
-
 main() {
+  nativeTesting();
   setup();
-  inscrutable = (x) => x;
 
   setNativeSubclassDispatchRecord(getBPrototype(), findInterceptorForType(B));
 
-  var b = inscrutable(makeB());
+  var b = confuse(makeB());
 
-  inscrutable(testIsB)(b);
-  inscrutable(testIsA)(b);
-  inscrutable(testIsN)(b);
-  inscrutable(testIsM)(b);
-  inscrutable(testIsI)(b);
+  confuse(testIsB)(b);
+  confuse(testIsA)(b);
+  confuse(testIsN)(b);
+  confuse(testIsM)(b);
+  confuse(testIsI)(b);
 
-  inscrutable(new Checks<B>().isCheck)(b);
-  inscrutable(new Checks<A>().isCheck)(b);
-  inscrutable(new Checks<N>().isCheck)(b);
-  inscrutable(new Checks<M>().isCheck)(b);
-  inscrutable(new Checks<I>().isCheck)(b);
+  confuse(new Checks<B>().isCheck)(b);
+  confuse(new Checks<A>().isCheck)(b);
+  confuse(new Checks<N>().isCheck)(b);
+  confuse(new Checks<M>().isCheck)(b);
+  confuse(new Checks<I>().isCheck)(b);
 
   if (isCheckedMode()) {
-    inscrutable(testAssignB)(b);
-    inscrutable(testAssignA)(b);
-    inscrutable(testAssignN)(b);
-    inscrutable(testAssignM)(b);
-    inscrutable(testAssignI)(b);
+    confuse(testAssignB)(b);
+    confuse(testAssignA)(b);
+    confuse(testAssignN)(b);
+    confuse(testAssignM)(b);
+    confuse(testAssignI)(b);
 
-    inscrutable(testCastB)(b);
-    inscrutable(testCastA)(b);
-    inscrutable(testCastN)(b);
-    inscrutable(testCastM)(b);
-    inscrutable(testCastI)(b);
+    confuse(testCastB)(b);
+    confuse(testCastA)(b);
+    confuse(testCastN)(b);
+    confuse(testCastM)(b);
+    confuse(testCastI)(b);
 
-    inscrutable(new Checks<B>().assignCheck)(b);
-    inscrutable(new Checks<A>().assignCheck)(b);
-    inscrutable(new Checks<N>().assignCheck)(b);
-    inscrutable(new Checks<M>().assignCheck)(b);
-    inscrutable(new Checks<I>().assignCheck)(b);
+    confuse(new Checks<B>().assignCheck)(b);
+    confuse(new Checks<A>().assignCheck)(b);
+    confuse(new Checks<N>().assignCheck)(b);
+    confuse(new Checks<M>().assignCheck)(b);
+    confuse(new Checks<I>().assignCheck)(b);
 
-    inscrutable(new Checks<B>().castCheck)(b);
-    inscrutable(new Checks<A>().castCheck)(b);
-    inscrutable(new Checks<N>().castCheck)(b);
-    inscrutable(new Checks<M>().castCheck)(b);
-    inscrutable(new Checks<I>().castCheck)(b);
+    confuse(new Checks<B>().castCheck)(b);
+    confuse(new Checks<A>().castCheck)(b);
+    confuse(new Checks<N>().castCheck)(b);
+    confuse(new Checks<M>().castCheck)(b);
+    confuse(new Checks<I>().castCheck)(b);
   }
 }
diff --git a/tests/compiler/dart2js_native/subclassing_constructor_1_test.dart b/tests/compiler/dart2js_native/subclassing_constructor_1_test.dart
index 657dc96..cbd04e5 100644
--- a/tests/compiler/dart2js_native/subclassing_constructor_1_test.dart
+++ b/tests/compiler/dart2js_native/subclassing_constructor_1_test.dart
@@ -2,9 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "package:expect/expect.dart";
-import 'dart:_foreign_helper' show JS;
-import 'dart:_js_helper' show Native, Creates, setNativeSubclassDispatchRecord;
+import "native_testing.dart";
+import 'dart:_js_helper' show setNativeSubclassDispatchRecord;
 import 'dart:_interceptors'
     show findInterceptorForType, findConstructorForNativeSubclassType;
 
@@ -158,11 +157,9 @@
   checkThrows(() => new B.three([]), 'new B.three([])');
 }
 
-var inscrutable;
-
 main() {
+  nativeTesting();
   setup();
-  inscrutable = (x) => x;
   log = (message) {
     trace.add('$message');
     return message;
diff --git a/tests/compiler/dart2js_native/subclassing_constructor_2_test.dart b/tests/compiler/dart2js_native/subclassing_constructor_2_test.dart
index 2b9f6c5..f1c8dd1 100644
--- a/tests/compiler/dart2js_native/subclassing_constructor_2_test.dart
+++ b/tests/compiler/dart2js_native/subclassing_constructor_2_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Test that native classes and subclasses of native classes cannot be directly
 // created via a generative constructor.
diff --git a/tests/compiler/dart2js_native/subclassing_super_call_test.dart b/tests/compiler/dart2js_native/subclassing_super_call_test.dart
index a3bb7f4..be90112 100644
--- a/tests/compiler/dart2js_native/subclassing_super_call_test.dart
+++ b/tests/compiler/dart2js_native/subclassing_super_call_test.dart
@@ -2,9 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "package:expect/expect.dart";
-import 'dart:_foreign_helper' show JS;
-import 'dart:_js_helper' show Native, Creates, setNativeSubclassDispatchRecord;
+import "native_testing.dart";
+import 'dart:_js_helper' show setNativeSubclassDispatchRecord;
 import 'dart:_interceptors'
     show findInterceptorForType, findConstructorForNativeSubclassType;
 
@@ -53,8 +52,6 @@
 getBBPrototype = function(){return BB.prototype;};
 """;
 
-var inscrutable;
-
 testSuperOnNative() {
   BB b1 = makeBB();
   BB b2 = makeBB();
@@ -64,14 +61,14 @@
   JS('', '#(#)', constructor, b1);
   JS('', '#(#)', constructor, b2);
 
-  b1.text = inscrutable('one');
-  b2.text = inscrutable('two');
+  b1.text = confuse('one');
+  b2.text = confuse('two');
 
-  print('b1.text ${inscrutable(b1).text}');
-  print('b2.text ${inscrutable(b2).text}');
+  print('b1.text ${confuse(b1).text}');
+  print('b2.text ${confuse(b2).text}');
 
-  print('b1.foo() ${inscrutable(b1).foo()}');
-  print('b2.foo() ${inscrutable(b2).foo()}');
+  print('b1.foo() ${confuse(b1).foo()}');
+  print('b2.foo() ${confuse(b2).foo()}');
 
   Expect.equals('one', b1.text);
   Expect.equals('two', b2.text);
@@ -79,14 +76,14 @@
   Expect.equals('foo:one', b1.foo());
   Expect.equals('foo:two', b2.foo());
 
-  inscrutable(b1).text = inscrutable('three');
-  inscrutable(b2).text = inscrutable('four');
+  confuse(b1).text = confuse('three');
+  confuse(b2).text = confuse('four');
 
-  Expect.equals('three', inscrutable(b1).text);
-  Expect.equals('four', inscrutable(b2).text);
+  Expect.equals('three', confuse(b1).text);
+  Expect.equals('four', confuse(b2).text);
 
-  Expect.equals('foo:three', inscrutable(b1).foo());
-  Expect.equals('foo:four', inscrutable(b2).foo());
+  Expect.equals('foo:three', confuse(b1).foo());
+  Expect.equals('foo:four', confuse(b2).foo());
 }
 
 testSuperOnSubclassOfNative() {
@@ -98,14 +95,14 @@
   JS('', '#(#)', constructor, b1);
   JS('', '#(#)', constructor, b2);
 
-  b1.afield = inscrutable('one');
-  b2.afield = inscrutable('two');
+  b1.afield = confuse('one');
+  b2.afield = confuse('two');
 
-  print('b1.afield ${inscrutable(b1).afield}');
-  print('b2.afield ${inscrutable(b2).afield}');
+  print('b1.afield ${confuse(b1).afield}');
+  print('b2.afield ${confuse(b2).afield}');
 
-  print('b1.afun() ${inscrutable(b1).afun()}');
-  print('b2.afun() ${inscrutable(b2).afun()}');
+  print('b1.afun() ${confuse(b1).afun()}');
+  print('b2.afun() ${confuse(b2).afun()}');
 
   Expect.equals('one', b1.afield);
   Expect.equals('two', b2.afield);
@@ -113,19 +110,19 @@
   Expect.equals('afun:one', b1.afun());
   Expect.equals('afun:two', b2.afun());
 
-  inscrutable(b1).afield = inscrutable('three');
-  inscrutable(b2).afield = inscrutable('four');
+  confuse(b1).afield = confuse('three');
+  confuse(b2).afield = confuse('four');
 
-  Expect.equals('three', inscrutable(b1).afield);
-  Expect.equals('four', inscrutable(b2).afield);
+  Expect.equals('three', confuse(b1).afield);
+  Expect.equals('four', confuse(b2).afield);
 
-  Expect.equals('afun:three', inscrutable(b1).afun());
-  Expect.equals('afun:four', inscrutable(b2).afun());
+  Expect.equals('afun:three', confuse(b1).afun());
+  Expect.equals('afun:four', confuse(b2).afun());
 }
 
 main() {
+  nativeTesting();
   setup();
-  inscrutable = (x) => x;
 
   setNativeSubclassDispatchRecord(getBBPrototype(), findInterceptorForType(BB));
 
diff --git a/tests/compiler/dart2js_native/subclassing_super_field_1_test.dart b/tests/compiler/dart2js_native/subclassing_super_field_1_test.dart
index 1e602df..c3fb6fd 100644
--- a/tests/compiler/dart2js_native/subclassing_super_field_1_test.dart
+++ b/tests/compiler/dart2js_native/subclassing_super_field_1_test.dart
@@ -2,9 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "package:expect/expect.dart";
-import 'dart:_foreign_helper' show JS;
-import 'dart:_js_helper' show Native, Creates, setNativeSubclassDispatchRecord;
+import "native_testing.dart";
+import 'dart:_js_helper' show setNativeSubclassDispatchRecord;
 import 'dart:_interceptors'
     show findInterceptorForType, findConstructorForNativeSubclassType;
 
@@ -40,11 +39,9 @@
 getBPrototype = function(){return B.prototype;};
 """;
 
-var inscrutable;
-
 main() {
+  nativeTesting();
   setup();
-  inscrutable = (x) => x;
 
   setNativeSubclassDispatchRecord(getBPrototype(), findInterceptorForType(B));
 
@@ -56,8 +53,8 @@
 
   print(b);
 
-  Expect.equals(222, inscrutable(b).Bfoo());
-  Expect.equals(111, inscrutable(b).Afoo());
+  Expect.equals(222, confuse(b).Bfoo());
+  Expect.equals(111, confuse(b).Afoo());
 
   Expect.equals(222, b.Bfoo());
   Expect.equals(111, b.Afoo());
diff --git a/tests/compiler/dart2js_native/subclassing_super_field_2_test.dart b/tests/compiler/dart2js_native/subclassing_super_field_2_test.dart
index 4778ed1..8e9bd93 100644
--- a/tests/compiler/dart2js_native/subclassing_super_field_2_test.dart
+++ b/tests/compiler/dart2js_native/subclassing_super_field_2_test.dart
@@ -2,9 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "package:expect/expect.dart";
-import 'dart:_foreign_helper' show JS;
-import 'dart:_js_helper' show Native, Creates, setNativeSubclassDispatchRecord;
+import "native_testing.dart";
+import 'dart:_js_helper' show setNativeSubclassDispatchRecord;
 import 'dart:_interceptors'
     show findInterceptorForType, findConstructorForNativeSubclassType;
 
@@ -44,11 +43,9 @@
 getBPrototype = function(){return B.prototype;};
 """;
 
-var inscrutable;
-
 main() {
+  nativeTesting();
   setup();
-  inscrutable = (x) => x;
 
   setNativeSubclassDispatchRecord(getBPrototype(), findInterceptorForType(B));
 
@@ -60,9 +57,9 @@
 
   print(b);
 
-  Expect.equals(333, inscrutable(b).Bfoo());
-  Expect.equals(222, inscrutable(b).Afoo());
-  Expect.equals(111, inscrutable(b).Nfoo());
+  Expect.equals(333, confuse(b).Bfoo());
+  Expect.equals(222, confuse(b).Afoo());
+  Expect.equals(111, confuse(b).Nfoo());
 
   Expect.equals(333, b.Bfoo());
   Expect.equals(222, b.Afoo());
diff --git a/tests/compiler/dart2js_native/subclassing_type_test.dart b/tests/compiler/dart2js_native/subclassing_type_test.dart
index a4e14e8..3ab4af9 100644
--- a/tests/compiler/dart2js_native/subclassing_type_test.dart
+++ b/tests/compiler/dart2js_native/subclassing_type_test.dart
@@ -2,8 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "package:expect/expect.dart";
-import 'dart:_js_helper' show Native, Creates, setNativeSubclassDispatchRecord;
+import 'native_testing.dart';
+import 'dart:_js_helper' show setNativeSubclassDispatchRecord;
 import 'dart:_interceptors' show Interceptor, findInterceptorForType;
 
 // Test that type checks and casts work for subclasses of native classes and
diff --git a/tests/compiler/dart2js_native/super_call_test.dart b/tests/compiler/dart2js_native/super_call_test.dart
index b420516..0a880f3 100644
--- a/tests/compiler/dart2js_native/super_call_test.dart
+++ b/tests/compiler/dart2js_native/super_call_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Test to see if resolving a hidden native class's method interferes with
 // subsequent resolving the subclass's method.  This might happen if the
@@ -62,9 +61,15 @@
 makeB = function(){return new B};
 makeC = function(){return new C};
 makeD = function(){return new D};
+
+self.nativeConstructor(A);
+self.nativeConstructor(B);
+self.nativeConstructor(C);
+self.nativeConstructor(D);
 """;
 
 main() {
+  nativeTesting();
   setup();
 
   var a = makeA();
diff --git a/tests/compiler/dart2js_native/super_property_test.dart b/tests/compiler/dart2js_native/super_property_test.dart
index fbe98f7..0174525 100644
--- a/tests/compiler/dart2js_native/super_property_test.dart
+++ b/tests/compiler/dart2js_native/super_property_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Tests super setter where the HInvokeSuper is using interceptor aka
 // explicit-receiver calling convention.
@@ -47,6 +46,8 @@
 function B(){}
 makeA = function(){return new A};
 makeB = function(){return new B};
+self.nativeConstructor(A);
+self.nativeConstructor(B);
 """;
 
 testThing(a) {
@@ -60,6 +61,7 @@
 }
 
 main() {
+  nativeTesting();
   setup();
   var things = [makeA(), makeB(), new C(), new D()];
   var test = testThing;
diff --git a/tests/compiler/dart2js_native/type_error_decode_test.dart b/tests/compiler/dart2js_native/type_error_decode_test.dart
index 3c9a8f0..1c37f03 100644
--- a/tests/compiler/dart2js_native/type_error_decode_test.dart
+++ b/tests/compiler/dart2js_native/type_error_decode_test.dart
@@ -4,9 +4,8 @@
 
 library test.type_error_decode_test;
 
-import 'package:expect/expect.dart';
-
-import 'dart:_js_helper';
+import 'native_testing.dart';
+import 'dart:_js_helper' show NullError, JsNoSuchMethodError;
 
 class Foo {
   var field;
@@ -41,12 +40,19 @@
   var s = "Cannot call method 'foo' of null";
   var nul = null;
   var f = new Foo();
-  // This should foil code analysis so the variables aren't inlined below.
-  [].forEach((y) => f.field = nul = s = x = z = v = y);
+
   expectThrows(() => x.fisk(), isNullError);
   expectThrows(() => v.fisk(), isNullError);
   expectThrows(() => z.fisk(), isJsNoSuchMethodError);
   expectThrows(() => s.fisk(), isJsNoSuchMethodError);
   expectThrows(() => null(), isNullError);
   expectThrows(() => f.field(), isNullError);
+
+  expectThrows(() => confuse(x).fisk(), isNullError);
+  expectThrows(() => confuse(v).fisk(), isNullError);
+  expectThrows(() => confuse(z).fisk(), isJsNoSuchMethodError);
+  expectThrows(() => confuse(s).fisk(), isJsNoSuchMethodError);
+  expectThrows(() => confuse(null)(), isNullError);
+  expectThrows(() => confuse(f).field(), isNullError);
+  expectThrows(() => confuse(f.field)(), isNullError);
 }
diff --git a/tests/compiler/dart2js_native/undefined_bailout_test.dart b/tests/compiler/dart2js_native/undefined_bailout_test.dart
index 8819be1..feff806 100644
--- a/tests/compiler/dart2js_native/undefined_bailout_test.dart
+++ b/tests/compiler/dart2js_native/undefined_bailout_test.dart
@@ -18,8 +18,7 @@
 // comparison does not work for undefined, which the DOM sometimes
 // returns.
 
-import "package:expect/expect.dart";
-import 'dart:_foreign_helper' show JS;
+import "native_testing.dart";
 
 var a = 42;
 var b = 0;
diff --git a/tests/compiler/dart2js_native/uninstantiated_type_parameter_test.dart b/tests/compiler/dart2js_native/uninstantiated_type_parameter_test.dart
index 730a5bb..158063c 100644
--- a/tests/compiler/dart2js_native/uninstantiated_type_parameter_test.dart
+++ b/tests/compiler/dart2js_native/uninstantiated_type_parameter_test.dart
@@ -2,8 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import "dart:_js_helper";
-import "package:expect/expect.dart";
+import "native_testing.dart";
 
 // Test for uninstantiated native classes as type parameters.
 
diff --git a/tests/corelib/big_integer_arith_vm_test.dart b/tests/corelib/big_integer_arith_vm_test.dart
index b9696b4..7ff1863 100644
--- a/tests/corelib/big_integer_arith_vm_test.dart
+++ b/tests/corelib/big_integer_arith_vm_test.dart
@@ -5,6 +5,7 @@
 // Testing Bigints with and without intrinsics.
 // VMOptions=
 // VMOptions=--no_intrinsify
+// VMOptions=--no-background-compilation
 // VMOptions=--optimization_counter_threshold=10 --no-background_compilation
 
 library big_integer_test;
diff --git a/tests/corelib/corelib.status b/tests/corelib/corelib.status
index 24a5cd6..48cfb52 100644
--- a/tests/corelib/corelib.status
+++ b/tests/corelib/corelib.status
@@ -81,11 +81,11 @@
 [ $runtime == ff ]
 double_round3_test: Pass, Fail, OK # Fails on ff 34, passes on ff 35. Runtime rounds 0.49999999999999994 to 1.
 double_round_to_double2_test: Pass, Fail, OK # Fails on ff 34, passes on ff 35. Runtime rounds 0.49999999999999994 to 1.
+list_test/none: RuntimeError # Issue 27871
+list_test/01: RuntimeError # Issue 27871
 
-[ $runtime == opera ]
-core_runtime_types_test: Fail
-null_nosuchmethod_test: Fail # Issue: 7413
-unicode_test: Fail # Issue 14694
+[ $compiler == dart2js && $runtime == drt && $csp && $minified ]
+core_runtime_types_test: Pass, Fail # Issue 27913
 
 [ $compiler == dart2js ]
 error_stack_trace1_test: RuntimeError # Issue 12399
@@ -207,3 +207,7 @@
 
 [ $arch == simdbc || $arch == simdbc64 ]
 regexp/stack-overflow_test: RuntimeError, OK # Smaller limit with irregex interpreter
+
+[ $hot_reload || $hot_reload_rollback ]
+big_integer_parsed_mul_div_vm_test: Pass, Slow # Slow.
+
diff --git a/tests/corelib/growable_list_test.dart b/tests/corelib/growable_list_test.dart
index 4b125bf..5350919 100644
--- a/tests/corelib/growable_list_test.dart
+++ b/tests/corelib/growable_list_test.dart
@@ -34,7 +34,7 @@
   int get length => throw "SHOULD NOT BE CALLED";
 }
 
-// Implement Set for private EfficientLength interface.
+// Implement Set for private EfficientLengthIterable interface.
 class EfficientTestIterable extends TestIterableBase
                             implements Set<int> {
   EfficientTestIterable(length, count, [callbackIndex = -1, callback])
@@ -104,7 +104,7 @@
 }
 
 void testConcurrentModification() {
-  // Without EfficientLength interface
+  // Without EfficientLengthIterable interface
   {
     // Change length of list after 200 additions.
     var l = [];
@@ -127,7 +127,7 @@
     }, (e) => e is ConcurrentModificationError, "cm2");
   }
 
-  // With EfficientLength interface (uses length).
+  // With EfficientLengthIterable interface (uses length).
   {
     // Change length of list after 20 additions.
     var l = [];
diff --git a/tests/corelib/regexp/regexp_test.dart b/tests/corelib/regexp/regexp_test.dart
index 60483ba..3231f2a 100644
--- a/tests/corelib/regexp/regexp_test.dart
+++ b/tests/corelib/regexp/regexp_test.dart
@@ -591,4 +591,28 @@
   // Tests skipped from V8:
   // Test that RegExp.prototype.toString() throws TypeError for
   // incompatible receivers (ES5 section 15.10.6 and 15.10.6.4).
+
+  testSticky();
+}
+
+testSticky() {
+  var re = new RegExp(r"foo.bar");
+  Expect.isNotNull(re.matchAsPrefix("foo_bar", 0));
+  Expect.isNull(re.matchAsPrefix("..foo_bar", 0));
+  Expect.isNotNull(re.matchAsPrefix("..foo_bar", 2));
+
+  re = new RegExp(r"^foo");
+  Expect.isNotNull(re.matchAsPrefix("foobar", 0));
+  Expect.isNull(re.matchAsPrefix("..foo", 0));
+  Expect.isNull(re.matchAsPrefix("..foo", 2));
+
+  re = new RegExp(r"^foo", multiLine: true);
+  Expect.isNotNull(re.matchAsPrefix("foobar", 0));
+  Expect.isNull(re.matchAsPrefix("..\nfoo", 0));
+  Expect.isNotNull(re.matchAsPrefix("..\nfoo", 3));
+  Expect.isNull(re.matchAsPrefix("..\nfoofoo", 6));
+
+  re = new RegExp(r"bar$");
+  Expect.isNull(re.matchAsPrefix("foobar", 0));
+  Expect.isNotNull(re.matchAsPrefix("foobar", 3));
 }
diff --git a/tests/corelib/set_test.dart b/tests/corelib/set_test.dart
index 55e7250..9900bb8 100644
--- a/tests/corelib/set_test.dart
+++ b/tests/corelib/set_test.dart
@@ -166,6 +166,17 @@
   }
   Expect.isTrue(twice.difference(thrice).difference(twice).isEmpty);
 
+  // Test Set.difference with non-element type.
+  Set diffSet = create()..addAll([0, 1, 2, 499, 999]);
+  Set<Object> objectSet = new Set<Object>();
+  objectSet.add("foo");
+  objectSet.add(499);
+  Set diffResult = diffSet.difference(objectSet);
+  Expect.equals(4, diffResult.length);
+  for (int value in [0, 1, 2, 999]) {
+    Expect.isTrue(diffResult.contains(value));
+  }
+
   // Test Set.addAll.
   List list = new List(10);
   for (int i = 0; i < 10; i++) {
diff --git a/tests/html/custom/document_register_template_test.dart b/tests/html/custom/document_register_template_test.dart
new file mode 100644
index 0000000..11b0b8d
--- /dev/null
+++ b/tests/html/custom/document_register_template_test.dart
@@ -0,0 +1,24 @@
+import 'package:unittest/unittest.dart';
+import 'package:unittest/html_config.dart';
+import 'dart:html';
+import '../utils.dart';
+
+main() {
+  useHtmlConfiguration();
+
+  setUp(() => customElementsReady);
+
+  test('can register custom template with webcomponents-lite polyfill', () {
+    document.registerElement('my-element', MyElement, extendsTag: 'template');
+    var e = new Element.tag('template', 'my-element');
+    document.body.append(e);
+    expect(e is TemplateElement, isTrue);
+    expect(e.method(), 'value');
+  });
+}
+
+
+class MyElement extends TemplateElement {
+  MyElement.created() : super.created();
+  method() => 'value';
+}
diff --git a/tests/html/custom/document_register_template_test.html b/tests/html/custom/document_register_template_test.html
new file mode 100644
index 0000000..26f59bf
--- /dev/null
+++ b/tests/html/custom/document_register_template_test.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <meta name="dart.unittest" content="full-stack-traces">
+  <title> document_register_basic_test </title>
+  <style>
+     .unittest-table { font-family:monospace; border:1px; }
+     .unittest-pass { background: #6b3;}
+     .unittest-fail { background: #d55;}
+     .unittest-error { background: #a11;}
+  </style>
+  <script src="/packages/web_components/webcomponents-lite.js"></script>
+  <script src="/packages/web_components/dart_support.js"></script>
+</head>
+<body>
+  <h1> Running document_register_basic_test </h1>
+  <script type="text/javascript"
+      src="/root_dart/tools/testing/dart/test_controller.js"></script>
+  %TEST_SCRIPTS%
+</body>
+</html>
diff --git a/tests/html/html.status b/tests/html/html.status
index e4544e8..b3aece5 100644
--- a/tests/html/html.status
+++ b/tests/html/html.status
@@ -14,6 +14,8 @@
 js_typed_interop_type3_test: Fail, OK # tests dart2js-specific behavior.
 
 native_gc_test: Skip # Dartium JSInterop failure
+js_interop_constructor_name_test/HTMLDivElement-methods: Fail # Investigate.
+js_interop_constructor_name_test/HTMLDivElement-types: Fail # ditto
 
 [ $compiler == none && ($runtime == drt || $runtime == dartium ) ]
 worker_api_test: Fail # Issue 10223
@@ -32,7 +34,8 @@
 js_type_test/dynamic-null-not-Foo: Fail  # Issue 26838
 js_type_test/dynamic-String-not-Foo: Fail  # Issue 26838
 js_type_test/dynamic-String-not-dynamic-Foo: Fail  # Issue 26838
-
+js_interop_constructor_name_test/HTMLDivElement-types-erroneous1: Fail # Issue 26838
+js_interop_constructor_name_test/HTMLDivElement-types-erroneous2: Fail # Issue 26838
 
 [ $compiler == dart2js && $checked ]
 js_function_getter_trust_types_test: Skip # --trust-type-annotations incompatible with --checked
@@ -75,6 +78,11 @@
 [ $compiler == none && $runtime == drt && $system == windows ]
 worker_test/functional: Pass, Crash # Issue 9929.
 
+[ $compiler == dart2js && $runtime == chrome ]
+fileapi_test/entry: Fail # TODO(dart2js-team): Please triage this failure.
+fileapi_test/getDirectory: Fail # TODO(dart2js-team): Please triage this failure.
+fileapi_test/getFile: Fail # TODO(dart2js-team): Please triage this failure.
+
 [ $compiler == dart2js && $runtime == chromeOnAndroid ]
 crypto_test/functional: Pass, Slow # TODO(dart2js-team): Please triage this failure.
 input_element_test/supported_datetime-local: Pass, Slow # TODO(dart2js-team): Please triage this failure.
@@ -325,7 +333,7 @@
 
 # Firefox Feature support statuses-
 # All changes should be accompanied by platform support annotation changes.
-element_types_test/supported_details: Fail
+element_classes_test: RuntimeError # Issue 27535
 element_types_test/supported_embed: Fail
 element_types_test/supported_keygen: Fail
 element_types_test/supported_object: Fail
@@ -419,27 +427,6 @@
 custom/mirrors_test: Fail # mirrors not supported
 mirrors_js_typed_interop_test: Fail # mirrors not supported
 
-[ $compiler == dart2js && $fast_startup && $browser ]
-custom/attribute_changed_callback_test/fully_supported: Fail # custom elements not supported
-custom/attribute_changed_callback_test/unsupported_on_polyfill: Fail # custom elements not supported
-custom/document_register_type_extensions_test/construction: Fail # custom elements not supported
-custom/document_register_type_extensions_test/functional: Fail # custom elements not supported
-custom/document_register_type_extensions_test/namespaces: Fail # custom elements not supported
-custom/document_register_type_extensions_test/parsing: Fail # custom elements not supported
-custom/document_register_type_extensions_test/registration: Fail # custom elements not supported
-custom/entered_left_view_test: Fail # custom elements not supported
-custom/element_upgrade_test: Fail # custom elements not supported
-custom/document_register_basic_test: Fail # custom elements not supported
-custom/document_register_type_extensions: Fail # custom elements not supported
-custom_elements_23127_test/baseline: Fail # custom elements not supported
-custom_elements_23127_test/c1t: Fail # custom elements not supported
-custom_elements_23127_test/c2: Fail # custom elements not supported
-js_function_getter_test: Fail # js-interop function's not supported
-js_typed_interop_callable_object_test: Fail # js-interop function's not supported
-js_typed_interop_test/closure: Fail # js-interop function's not supported
-js_typed_interop_test/method: Fail # js-interop function's not supported
-js_typed_interop_window_property_test/bind*: Fail # js-interop function's not supported
-
 [ $compiler == dart2js && $cps_ir && $browser ]
 js_typed_interop_side_cast_exp_test: RuntimeError # Corner case in package:js that we might want to remove (See comment in #24978).
 js_typed_interop_test/static_method_tearoff_1: RuntimeError # Tree-shaking a used tear-off (#24978, #25720).
diff --git a/tests/html/js_interop_constructor_name_test.dart b/tests/html/js_interop_constructor_name_test.dart
new file mode 100644
index 0000000..0b488f4
--- /dev/null
+++ b/tests/html/js_interop_constructor_name_test.dart
@@ -0,0 +1,98 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library jsTest;
+
+import 'dart:async';
+import 'dart:html' as html;
+import 'dart:js';
+import 'package:js/js.dart';
+
+import 'package:unittest/unittest.dart';
+import 'package:unittest/html_individual_config.dart';
+import 'package:expect/expect.dart' show NoInline, AssumeDynamic;
+
+@JS()
+external makeDiv(String text);
+
+@JS()
+class HTMLDivElement {
+  external String bar();
+}
+
+@NoInline() @AssumeDynamic()
+confuse(x) => x;
+
+main() {
+  useHtmlIndividualConfiguration();
+
+  group('HTMLDivElement-types', () {
+    test('dom-is-dom', () {
+      var e = confuse(new html.DivElement());
+      expect(e is html.DivElement, isTrue);
+    });
+
+    test('js-is-dom', () {
+      var e = confuse(makeDiv('hello'));
+      expect(e is html.DivElement, isFalse);
+    });
+
+    test('js-is-js', () {
+      var e = confuse(makeDiv('hello'));
+      expect(e is HTMLDivElement, isTrue);
+    });
+
+  });
+
+  group('HTMLDivElement-types-erroneous1', () {
+    test('dom-is-js', () {
+      var e = confuse(new html.DivElement());
+      // TODO(26838): When Issue 26838 is fixed and this test passes, move this
+      // test into group `HTMLDivElement-types`.
+
+      // Currently, HTML types are not [JavaScriptObject]s. We could change that
+      // by having HTML types extend JavaScriptObject, in which case we would
+      // change this expectation.
+      expect(e is HTMLDivElement, isFalse);
+    });
+  });
+
+  group('HTMLDivElement-types-erroneous2', () {
+    test('String-is-not-js', () {
+      var e = confuse('kombucha');
+      // TODO(26838): When Issue 26838 is fixed and this test passes, move this
+      // test into group `HTMLDivElement-types`.
+
+      // A String should not be a JS interop type. The type test flags are added
+      // to Interceptor, but should be added to the class that implements all
+      // the JS-interop methods.
+      expect(e is HTMLDivElement, isFalse);
+    });
+  });
+
+
+  group('HTMLDivElement-methods', () {
+
+    test('js-call-js-method', () {
+      var e = confuse(makeDiv('hello'));
+      expect(e.bar(), equals('hello'));
+    });
+
+    test('dom-call-js-method', () {
+      var e = confuse(new html.DivElement());
+      expect(() => e.bar(), throws);
+    });
+
+    test('js-call-dom-method', () {
+      var e = confuse(makeDiv('hello'));
+      expect(() => e.clone(false), throws);
+    });
+
+    test('dom-call-dom-method', () {
+      var e = confuse(new html.DivElement());
+      expect(e.clone(false), new isInstanceOf<html.DivElement>());
+    });
+
+  });
+}
diff --git a/tests/html/js_interop_constructor_name_test.html b/tests/html/js_interop_constructor_name_test.html
new file mode 100644
index 0000000..4b21d8b
--- /dev/null
+++ b/tests/html/js_interop_constructor_name_test.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <meta name="dart.unittest" content="full-stack-traces">
+  <title> js_interop_constructor_name_test </title>
+  <style>
+     .unittest-table { font-family:monospace; border:1px; }
+     .unittest-pass { background: #6b3;}
+     .unittest-fail { background: #d55;}
+     .unittest-error { background: #a11;}
+  </style>
+</head>
+<body>
+  <h1> Running js_interop_constructor_name_test </h1>
+  <script type="text/javascript"
+      src="/root_dart/tests/html/js_interop_constructor_name_test_js.js"></script>
+  <script type="text/javascript"
+      src="/root_dart/tools/testing/dart/test_controller.js"></script>
+  %TEST_SCRIPTS%
+</body>
+</html>
diff --git a/tests/html/js_interop_constructor_name_test_js.js b/tests/html/js_interop_constructor_name_test_js.js
new file mode 100644
index 0000000..828cbc9
--- /dev/null
+++ b/tests/html/js_interop_constructor_name_test_js.js
@@ -0,0 +1,20 @@
+(function() {
+
+  // A constructor function with the same name as a HTML element.
+  function HTMLDivElement(a) {
+    this.a = a;
+  }
+
+  HTMLDivElement.prototype.bar = function() {
+    return this.a;
+  }
+
+  HTMLDivElement.prototype.toString = function() {
+    return "HTMLDivElement(" + this.a + ")";
+  }
+
+  self.makeDiv = function(text) {
+    return new HTMLDivElement(text);
+  };
+
+})();
diff --git a/tests/html/js_typed_interop_test.dart b/tests/html/js_typed_interop_test.dart
index 960c0cc..bbbd867 100644
--- a/tests/html/js_typed_interop_test.dart
+++ b/tests/html/js_typed_interop_test.dart
@@ -80,7 +80,7 @@
     _getA: function() { return this._a;}
   };
 
-  var selection = ["a", "b", "c", foo, bar];  
+  var selection = ["a", "b", "c", foo, bar];
 
   function returnNumArgs() { return arguments.length; };
   function returnLastArg() { return arguments[arguments.length-1]; };
@@ -144,6 +144,14 @@
   external get b;
 }
 
+@JS('ClassWithConstructor')
+class ClassWithFactory {
+  external factory ClassWithFactory(aParam, bParam);
+  external getA();
+  external get a;
+  external get b;
+}
+
 @JS()
 class JS$_PrivateClass {
   external JS$_PrivateClass(aParam, bParam);
@@ -324,6 +332,12 @@
       expect(o.b, equals("bar"));
       expect(o.getA(), equals("foo"));
     });
+    test('external factory', () {
+      var o = new ClassWithFactory("foo", "bar");
+      expect(o.a, equals("foo"));
+      expect(o.b, equals("bar"));
+      expect(o.getA(), equals("foo"));
+    });
   });
 
   group('private class', () {
diff --git a/tests/isolate/browser/package_resolve_browser_hook2_test.dart b/tests/isolate/browser/package_resolve_browser_hook2_test.dart
new file mode 100644
index 0000000..7768338
--- /dev/null
+++ b/tests/isolate/browser/package_resolve_browser_hook2_test.dart
@@ -0,0 +1,28 @@
+// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
+// for 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:js';
+import 'dart:isolate';
+import 'package:unittest/unittest.dart';
+import 'package:unittest/html_config.dart';
+
+main() async {
+  useHtmlConfiguration();
+
+  setUp(() {
+      context['defaultPackagesBase'] = 'path1/';
+  });
+
+  test('hook overrides package-uri resolution', () async {
+    var uri = await Isolate.resolvePackageUri(Uri.parse('package:foo/bar.txt'));
+    expect(uri, Uri.base.resolve('path1/foo/bar.txt'));
+  });
+
+  test('hook is read once, on the first use of resolvePackageUri', () async {
+    await Isolate.resolvePackageUri(Uri.parse('package:foo/bar.txt'));
+    context['defaultPackagesBase'] = 'path2/';
+    var uri = await Isolate.resolvePackageUri(Uri.parse('package:foo/bar.txt'));
+    expect(uri, Uri.base.resolve('path1/foo/bar.txt'));
+  });
+}
diff --git a/tests/isolate/browser/package_resolve_browser_hook_test.dart b/tests/isolate/browser/package_resolve_browser_hook_test.dart
new file mode 100644
index 0000000..5c90474
--- /dev/null
+++ b/tests/isolate/browser/package_resolve_browser_hook_test.dart
@@ -0,0 +1,16 @@
+// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:isolate';
+import 'package:unittest/unittest.dart';
+import 'package:unittest/html_config.dart';
+
+main() async {
+  useHtmlConfiguration();
+
+  test('defaultPackagesBase hook overrides package-uri resolution', () async {
+    var uri = await Isolate.resolvePackageUri(Uri.parse('package:foo/bar.txt'));
+    expect(uri, Uri.base.resolve('path/set/from/hook/foo/bar.txt'));
+  });
+}
diff --git a/tests/isolate/browser/package_resolve_browser_hook_test.html b/tests/isolate/browser/package_resolve_browser_hook_test.html
new file mode 100644
index 0000000..a3b67b6
--- /dev/null
+++ b/tests/isolate/browser/package_resolve_browser_hook_test.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <meta name="dart.unittest" content="full-stack-traces">
+  <title> mirrors_test </title>
+  <style>
+     .unittest-table { font-family:monospace; border:1px; }
+     .unittest-pass { background: #6b3;}
+     .unittest-fail { background: #d55;}
+     .unittest-error { background: #a11;}
+  </style>
+</head>
+<body>
+  <h1> Running mirrors_test </h1>
+  <script type="text/javascript"
+      src="/root_dart/tools/testing/dart/test_controller.js"></script>
+  <script>
+  // Dart2js exposes this hook to override the default base path where resource
+  // package uris are resolved from.
+  defaultPackagesBase = 'path/set/from/hook/';
+  </script>
+  %TEST_SCRIPTS%
+</body>
+</html>
diff --git a/tests/isolate/browser/package_resolve_browser_test.dart b/tests/isolate/browser/package_resolve_browser_test.dart
new file mode 100644
index 0000000..49ced93
--- /dev/null
+++ b/tests/isolate/browser/package_resolve_browser_test.dart
@@ -0,0 +1,16 @@
+// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:isolate';
+import 'package:unittest/unittest.dart';
+import 'package:unittest/html_config.dart';
+
+main() {
+  useHtmlConfiguration();
+
+  test('by default package-uri resolve under base/packages/', () async {
+    var uri = await Isolate.resolvePackageUri(Uri.parse('package:foo/bar.txt'));
+    expect(uri, Uri.base.resolve('packages/foo/bar.txt'));
+  });
+}
diff --git a/tests/isolate/compile_time_error_test.dart b/tests/isolate/compile_time_error_test.dart
index 4bb70c7..8450630 100644
--- a/tests/isolate/compile_time_error_test.dart
+++ b/tests/isolate/compile_time_error_test.dart
@@ -14,7 +14,7 @@
   TestClass.named(num this.fld1)
     // Should cause a compilation error (for the spawned isolate). It is a
     // runtime error for the test.
-    : fld2 = fld1  /// 01: compile-time error
+    : fld2 = this.fld1  /// 01: compile-time error
   ;
   num fld1;
   num fld2;
diff --git a/tests/isolate/isolate.status b/tests/isolate/isolate.status
index 473e036..8274317 100644
--- a/tests/isolate/isolate.status
+++ b/tests/isolate/isolate.status
@@ -89,6 +89,7 @@
 
 [ $csp ]
 deferred_in_isolate2_test: Skip # Issue 16898. Deferred loading does not work from an isolate in CSP-mode
+browser/package_resolve_browser_hook_test: RuntimeError # CSP violation. Issue 27914
 
 [ $compiler == dart2js && $runtime == chromeOnAndroid ]
 isolate_stress_test: Pass, Slow # TODO(kasperl): Please triage.
@@ -105,13 +106,14 @@
 spawn_uri_multi_test/none: RuntimeError # Issue 13544
 
 [ ($compiler == none) && $runtime == dartium && $arch == x64 ]
-isolate/spawn_uri_multi_test/01: Skip # Times out. Issue 24795
+spawn_uri_multi_test/01: Skip # Times out. Issue 24795
 
 [ ($compiler == none) && ( $runtime == dartium || $runtime == drt) ]
 spawn_uri_nested_vm_test: Skip # Issue 14479: This test is timing out. Issue 14463
 typed_message_test: Skip # Issue 13921, 14400
 isolate_stress_test: Skip # Issue 13921 Dom isolates don't support spawnFunction
 object_leak_test: Skip # Issue 13921 Dom isolates don't support spawnFunction
+send_private_test: Skip # Issue 13921 Dom isolates don't support spawnFunction
 spawn_uri_missing_from_isolate_test: Skip # Issue 17649
 spawn_uri_missing_test: SkipSlow # Times out.
 kill3_test: Fail, OK  # 13921 Dom isolates don't support spawnFunction
@@ -152,7 +154,7 @@
 simple_message_test/none: RuntimeError, OK  # Uses Isolate.spawn.
 start_paused_test: RuntimeError, OK  # Uses Isolate.spawn.
 message3_test/int32x4: RuntimeError, OK  # Uses Isolate.spawn.
-
+browser/package_*: Skip # Issue 25594 (missing implementation in Dartium).
 
 [ $compiler == dart2analyzer ]
 browser/typed_data_message_test: StaticWarning
@@ -228,12 +230,6 @@
 [ $mode == product ]
 issue_24243_parent_isolate_test: Skip # Requires checked mode
 
-[ $compiler == dart2js && $cps_ir && $checked ]
-*: Skip # `assert` not implemented
-
-[ $compiler == precompiler && $runtime == dart_precompiled && $system == android ]
-*: Skip # Issue #26373
-
 [ $hot_reload || $hot_reload_rollback ]
 function_send_test: Pass, Fail # Closure identity
 message3_test/fun: Pass, Fail # Closure identity
diff --git a/tests/isolate/send_private_test.dart b/tests/isolate/send_private_test.dart
new file mode 100644
index 0000000..57df312
--- /dev/null
+++ b/tests/isolate/send_private_test.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "dart:isolate";
+import "package:expect/expect.dart";
+
+class _Private {
+  String data;
+  _Private(this.data);
+}
+
+void child(message) {
+  print("Got message: $message");
+  SendPort replyPort = message[0];
+  _Private object = message[1];
+  Expect.isTrue(object is _Private);
+  Expect.equals("XYZ", object.data);
+  replyPort.send(object);
+}
+
+void main() {
+  var port;
+  port = new RawReceivePort((message) {
+    print("Got reply: $message");
+    Expect.isTrue(message is _Private);
+    Expect.equals("XYZ", message.data);
+    port.close();
+  });
+
+  Isolate.spawn(child, [port.sendPort, new _Private("XYZ")]);
+}
diff --git a/tests/isolate/spawn_uri_child_isolate.dart b/tests/isolate/spawn_uri_child_isolate.dart
index 57f1dde..81f40f9 100644
--- a/tests/isolate/spawn_uri_child_isolate.dart
+++ b/tests/isolate/spawn_uri_child_isolate.dart
@@ -4,9 +4,8 @@
 
 // Child isolate code to be spawned from a URI to this file.
 library SpawnUriChildIsolate;
-import 'dart:isolate';
 
-void main(List<String> args, SendPort replyTo) {
+void main(List<String> args, replyTo) {
   var data = args[0];
   replyTo.send('re: $data');
 }
diff --git a/tests/kernel/kernel.status b/tests/kernel/kernel.status
new file mode 100644
index 0000000..ab88299
--- /dev/null
+++ b/tests/kernel/kernel.status
@@ -0,0 +1,20 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+unsorted/invocation_errors_test: RuntimeError
+
+[ $compiler == dartk && $runtime == vm ]
+
+[ $compiler == dartkp && $runtime == dart_precompiled ]
+
+[ $compiler == dart2analyzer && $runtime == none ]
+unsorted/invocation_errors_test: StaticWarning
+unsorted/super_mixin_test: CompileTimeError
+
+[ $compiler == dart2js ]
+unsorted/invocation_errors_test: Pass
+unsorted/nsm_dispatcher_test: Skip # The test uses Symbol without MirrorsUsed
+unsorted/super_initializer_test: Skip
+unsorted/super_mixin_test: CompileTimeError
+unsorted/loop_test: Skip
diff --git a/tests/kernel/unsorted/as_is_test.dart b/tests/kernel/unsorted/as_is_test.dart
new file mode 100644
index 0000000..846fdf1
--- /dev/null
+++ b/tests/kernel/unsorted/as_is_test.dart
@@ -0,0 +1,28 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Tests of class literals, is, and as expressions.
+
+import 'package:expect/expect.dart';
+
+class C {}
+
+class D extends C {}
+
+test0() => C;
+test1() => D;
+
+main() {
+  var c = new C();
+  var d = new D();
+  Expect.isTrue(test0() == C);
+  Expect.isTrue(test1() == D);
+  Expect.isTrue(c is C);
+  Expect.isTrue(c is! D);
+  Expect.isTrue(d is C);
+  Expect.isTrue(d is D);
+  Expect.isTrue(c as C == c);
+  Expect.isTrue(d as C == d);
+  Expect.isTrue(d as D == d);
+}
diff --git a/tests/kernel/unsorted/block_scope_test.dart b/tests/kernel/unsorted/block_scope_test.dart
new file mode 100644
index 0000000..36e3d66
--- /dev/null
+++ b/tests/kernel/unsorted/block_scope_test.dart
@@ -0,0 +1,60 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Tests of block scoping.
+
+import 'package:expect/expect.dart';
+
+bool oracle() => true;
+
+test0() {
+  var x = 'outer', y = x;
+  Expect.isTrue(x == 'outer');
+  Expect.isTrue(y == 'outer');
+  { var x = 'inner';
+    Expect.isTrue(x == 'inner');
+    Expect.isTrue(y == 'outer');
+  }
+  Expect.isTrue(x == 'outer');
+  Expect.isTrue(y == 'outer');
+
+  if (oracle()) {
+    var y = 'inner';
+    Expect.isTrue(x == 'outer');
+    Expect.isTrue(y == 'inner');
+  } else {
+    Expect.isTrue(false);
+  }
+  Expect.isTrue(x == 'outer');
+  Expect.isTrue(y == 'outer');
+}
+
+var x = 'toplevel';
+
+test1() {
+  var y = 'outer';
+  Expect.isTrue(x == 'toplevel');
+  Expect.isTrue(y == 'outer');
+  { var x = 'inner';
+    Expect.isTrue(x == 'inner');
+    Expect.isTrue(y == 'outer');
+  }
+  Expect.isTrue(x == 'toplevel');
+  Expect.isTrue(y == 'outer');
+
+  if (oracle()) {
+    var y = 'inner';
+    Expect.isTrue(x == 'toplevel');
+    Expect.isTrue(y == 'inner');
+  } else {
+    Expect.isTrue(false);
+  }
+  Expect.isTrue(x == 'toplevel');
+  Expect.isTrue(y == 'outer');
+}
+
+main() {
+  test0();
+  test1();
+}
diff --git a/tests/kernel/unsorted/breakable_statement_test.dart b/tests/kernel/unsorted/breakable_statement_test.dart
new file mode 100644
index 0000000..22263cc
--- /dev/null
+++ b/tests/kernel/unsorted/breakable_statement_test.dart
@@ -0,0 +1,81 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+testFor() {
+  int current;
+  for (int i = 0; i < 100; i++) {
+    current = i;
+    if (i > 41) break;
+  }
+  Expect.isTrue(current == 42);
+}
+
+testWhile() {
+  int i = 0;
+  while (i < 100) {
+    if (++i > 41) break;
+  }
+  Expect.isTrue(i == 42);
+}
+
+testDoWhile() {
+  int i = 0;
+  do {
+    if (++i > 41) break;
+  } while (i < 100);
+  Expect.isTrue(i == 42);
+}
+
+testLabledBreakOutermost() {
+  int i = 0;
+  outer: {
+    middle: {
+      while (i < 100) {
+        if (++i > 41) break outer;
+      }
+      i++;
+    }
+    i++;
+  }
+  Expect.isTrue(i == 42);
+}
+
+testLabledBreakMiddle() {
+  int i = 0;
+  outer: {
+    middle: {
+      while (i < 100) {
+        if (++i > 41) break middle;
+      }
+      i++;
+    }
+    i++;
+  }
+  Expect.isTrue(i == 43);
+}
+
+testLabledBreakInner() {
+  int i = 0;
+  outer: {
+    middle: {
+      while (i < 100) {
+        if (++i > 41) break;
+      }
+      i++;
+    }
+    i++;
+  }
+  Expect.isTrue(i == 44);
+}
+
+main() {
+  testFor();
+  testWhile();
+  testDoWhile();
+  testLabledBreakOutermost();
+  testLabledBreakMiddle();
+  testLabledBreakInner();
+}
diff --git a/tests/kernel/unsorted/closures_regression_test.dart b/tests/kernel/unsorted/closures_regression_test.dart
new file mode 100644
index 0000000..51c18d3
--- /dev/null
+++ b/tests/kernel/unsorted/closures_regression_test.dart
@@ -0,0 +1,22 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+f(fun) => fun();
+class A {
+  identity(arg) {
+    return f(() {
+      print(this);
+      return f(() {
+        return this;
+      });
+    });
+  }
+}
+
+main() {
+  var a = new A();
+  Expect.isTrue(identical(a.identity(42), a));
+}
diff --git a/tests/kernel/unsorted/closures_test.dart b/tests/kernel/unsorted/closures_test.dart
new file mode 100644
index 0000000..df3430f
--- /dev/null
+++ b/tests/kernel/unsorted/closures_test.dart
@@ -0,0 +1,65 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+class Base {
+  int constant1000() => 1000;
+}
+
+class Foo extends Base {
+  final int base;
+  Foo(this.base);
+
+  nestedAdderFunction(a, b, c, d, e) {
+    var result = a + b;
+    return () {
+      var result2 = c + d;
+      return () {
+        return base + result + result2 + e;
+      };
+    };
+  }
+
+  nestedAdderFunction2(a, b, c, d, e) {
+    var result = a + b;
+    return () {
+      var base = super.constant1000;
+      var result2 = c + d;
+      return () {
+        return base() + result + result2 + e;
+      };
+    };
+  }
+}
+
+nestedAdderFunction(a, b, c, d, e) {
+  var result = a + b;
+  return () {
+    var result2 = c + d;
+    return () {
+      return result + result2 + e;
+    };
+  };
+}
+
+main() {
+  Expect.isTrue(nestedAdderFunction(1, 2, 3, 4, 5)()() == 15);
+
+  var foo = new Foo(100);
+  Expect.isTrue(foo.nestedAdderFunction(1, 2, 3, 4, 5)()() == 115);
+  Expect.isTrue(foo.nestedAdderFunction2(1, 2, 3, 4, 5)()() == 1015);
+
+  var funs = [];
+  for (int i = 0; i < 3; i++) {
+    funs.add(() => i);
+  }
+  Expect.isTrue((funs[0]() + funs[1]() + funs[2]()) == 3);
+
+  var funs2 = [];
+  for (var i in [0, 1, 2]) {
+    funs2.add(() => i);
+  }
+  Expect.isTrue((funs2[0]() + funs2[1]() + funs2[2]()) == 3);
+}
diff --git a/tests/kernel/unsorted/conditional_test.dart b/tests/kernel/unsorted/conditional_test.dart
new file mode 100644
index 0000000..3bf30a3
--- /dev/null
+++ b/tests/kernel/unsorted/conditional_test.dart
@@ -0,0 +1,142 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Tests of conditional expressions and statements and negation.
+
+import 'package:expect/expect.dart';
+
+mkTrue() => true;
+mkFalse() => false;
+
+check(b) {
+  Expect.isTrue(b);
+  return b;
+}
+
+main() {
+  // Check that ?: gets the right answer.
+  Expect.isTrue((mkTrue() ? 0 : 1) == 0);
+  Expect.isTrue((mkFalse() ? 0 : 1) == 1);
+  // Check that it doesn't evaluate all subexpressions.
+  mkTrue() ? Expect.isTrue(true) : Expect.isTrue(false);
+  mkFalse() ? Expect.isTrue(false) : Expect.isTrue(true);
+
+  // Check that && and || get the right answers.
+  Expect.isTrue(mkTrue() && mkTrue());
+  Expect.isTrue(!(mkTrue() && mkFalse()));
+  Expect.isTrue(!(mkFalse() && mkTrue()));
+  Expect.isTrue(!(mkFalse() && mkFalse()));
+  Expect.isTrue(mkTrue() || mkTrue());
+  Expect.isTrue(mkTrue() || mkFalse());
+  Expect.isTrue(mkFalse() || mkTrue());
+  Expect.isTrue(!(mkFalse() || mkFalse()));
+
+  // Check that they don't evaluate both subexpressions.
+  mkTrue() && check(true);
+  mkFalse() && check(false);
+  mkTrue() || check(true);
+  mkFalse() || check(true);
+
+  // Check that if works.
+  if (mkTrue()) {
+    Expect.isTrue(true);
+  } else {
+    Expect.isTrue(false);
+  }
+  if (mkFalse()) {
+    Expect.isTrue(false);
+  } else {
+    Expect.isTrue(true);
+  }
+  if (!mkTrue()) {
+    Expect.isTrue(false);
+  } else {
+    Expect.isTrue(true);
+  }
+  if (!mkFalse()) {
+    Expect.isTrue(true);
+  } else {
+    Expect.isTrue(false);
+  }
+
+  // Check that ?:, &&, and || work for control flow.
+  if (mkTrue() ? mkTrue() : mkFalse()) {
+    Expect.isTrue(true);
+  } else {
+    Expect.isTrue(false);
+  }
+  if (mkTrue() ? mkFalse() : mkTrue()) {
+    Expect.isTrue(false);
+  } else {
+    Expect.isTrue(true);
+  }
+  if (mkFalse() ? mkTrue() : mkFalse()) {
+    Expect.isTrue(false);
+  } else {
+    Expect.isTrue(true);
+  }
+  if (mkFalse() ? mkFalse() : mkTrue()) {
+    Expect.isTrue(true);
+  } else {
+    Expect.isTrue(false);
+  }
+  if (mkTrue() && mkTrue()) {
+    Expect.isTrue(true);
+  } else {
+    Expect.isTrue(false);
+  }
+  if (mkTrue() && mkFalse()) {
+    Expect.isTrue(false);
+  } else {
+    Expect.isTrue(true);
+  }
+  if (mkFalse() && mkTrue()) {
+    Expect.isTrue(false);
+  } else {
+    Expect.isTrue(true);
+  }
+  if (mkFalse() && mkFalse()) {
+    Expect.isTrue(false);
+  } else {
+    Expect.isTrue(true);
+  }
+  if (mkTrue() || mkTrue()) {
+    Expect.isTrue(true);
+  } else {
+    Expect.isTrue(false);
+  }
+  if (mkTrue() || mkFalse()) {
+    Expect.isTrue(true);
+  } else {
+    Expect.isTrue(false);
+  }
+  if (mkFalse() || mkTrue()) {
+    Expect.isTrue(true);
+  } else {
+    Expect.isTrue(false);
+  }
+  if (mkFalse() || mkFalse()) {
+    Expect.isTrue(false);
+  } else {
+    Expect.isTrue(true);
+  }
+
+  // Test empty else branches.
+  if (mkTrue()) {
+    Expect.isTrue(true);
+  }
+  if (mkFalse()) {
+    Expect.isTrue(false);
+  }
+
+  var x = 0;
+  if (mkTrue()) {
+    x = 1;
+  }
+  Expect.isTrue(x == 1);
+  if (mkFalse()) {
+    x = 2;
+  }
+  Expect.isTrue(x == 1);
+}
diff --git a/tests/kernel/unsorted/constant_evaluator_regression_test.dart b/tests/kernel/unsorted/constant_evaluator_regression_test.dart
new file mode 100644
index 0000000..e5c79c6
--- /dev/null
+++ b/tests/kernel/unsorted/constant_evaluator_regression_test.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+const X = const bool.fromEnvironment('foobar');
+
+main() {
+  Expect.isTrue(X == false);
+}
diff --git a/tests/kernel/unsorted/constant_expressions_test.dart b/tests/kernel/unsorted/constant_expressions_test.dart
new file mode 100644
index 0000000..0d5a3ec
--- /dev/null
+++ b/tests/kernel/unsorted/constant_expressions_test.dart
@@ -0,0 +1,100 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+const int42 = 40 + 2;
+const stringAB = 'a' + 'b';
+const stringAB2 = 'a' + 'b';
+const list123 = const [1, 2, 3];
+const mapABC = const {'a' : 'b', 'b': 'c'};
+
+const boxInt42 = const Box(int42);
+const boxStringAB = const Box(stringAB);
+
+class Box {
+  final value;
+  const Box(this.value);
+}
+
+returnPositional([a = const Box('posi' + 'tional')]) => a;
+
+returnNamed({a: const Box('nam' + 'ed')}) => a;
+
+returnSwitchCasedValue(value) {
+  switch (value) {
+    case const Box(42): return 42;
+    case const Box('abc'): return 'abc';
+    case const Box(const Box('abc')): return const Box('abc');
+    default: return 'default';
+  }
+}
+
+testConstantExpressions() {
+  Expect.isTrue(identical(const Box(40 + 2), const Box(40 + 2)));
+  Expect.isTrue(identical(const Box('a' + 'b'), const Box('ab')));
+  Expect.isTrue(identical(const Box(const Box(40 + 2)),
+                          const Box(const Box(42))));
+  Expect.isTrue(identical(const Box(const Box('a' + 'b')),
+                          const Box(const Box('ab'))));
+}
+
+testConstantFieldValues() {
+  Expect.isTrue(identical(42, int42));
+  Expect.isTrue(identical(stringAB, stringAB2));
+  Expect.isTrue(identical(const Box(42), boxInt42));
+  Expect.isTrue(identical(const Box('ab'), boxStringAB));
+}
+
+testConstantFunctionParameters() {
+  Expect.isTrue(identical(const Box('positional'), returnPositional()));
+  Expect.isTrue(identical(const Box('named'), returnNamed()));
+  Expect.isTrue(identical(const Box('abc'),
+                          returnPositional(const Box('abc'))));
+  Expect.isTrue(identical(const Box('def'),
+                          returnNamed(a: const Box('def'))));
+}
+
+testConstantSwitchExpressions() {
+  Expect.isTrue(returnSwitchCasedValue(const Box(42)) == 42);
+  Expect.isTrue(returnSwitchCasedValue(const Box('abc')) == 'abc');
+  Expect.isTrue(returnSwitchCasedValue(const Box(const Box('abc')))
+                == const Box('abc'));
+  Expect.isTrue(returnSwitchCasedValue(const Box('go-to-default'))
+                == 'default');
+}
+
+testConstantLocalVariables() {
+  const a = 'a';
+  const b = a + 'b';
+  const c = b + 'c';
+  const box = const Box(c);
+  Expect.isTrue(identical(const Box('abc'), box));
+}
+
+testComplextConstLiterals() {
+  Expect.isTrue(identical(const [1, 2, 3], const [1, 2, 3]));
+  Expect.isTrue(identical(const [1, 2, 3], list123));
+  Expect.isTrue(identical(const {'a': 'b', 'b': 'c'}, const {'a': 'b', 'b': 'c'}));
+  Expect.isTrue(identical(const {'a': 'b', 'b': 'c'}, mapABC));
+
+  Expect.isTrue(mapABC['a'] == 'b');
+  Expect.isTrue(mapABC['b'] == 'c');
+  Expect.isTrue(mapABC.length == 2);
+
+  Expect.isTrue(list123[0] == 1);
+  Expect.isTrue(list123[1] == 2);
+  Expect.isTrue(list123[2] == 3);
+  Expect.isTrue(list123.length == 3);
+}
+
+main() {
+  testConstantExpressions();
+  testConstantFieldValues();
+  testConstantFunctionParameters();
+  testConstantSwitchExpressions();
+  testComplextConstLiterals();
+  testConstantExpressions();
+  testConstantLocalVariables();
+}
diff --git a/tests/kernel/unsorted/factory_regression_test.dart b/tests/kernel/unsorted/factory_regression_test.dart
new file mode 100644
index 0000000..efccf81
--- /dev/null
+++ b/tests/kernel/unsorted/factory_regression_test.dart
@@ -0,0 +1,23 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:typed_data';
+
+import 'package:expect/expect.dart';
+
+var list = [1, 2, 3];
+
+class Foo {
+  final value;
+  Foo(this.value) {}
+
+  factory Foo.fac(value) {
+    return new Foo(value);
+  }
+}
+
+main() {
+  Expect.isTrue(new Uint8List.fromList(list)[1] == 2);
+  Expect.isTrue(new Foo.fac(10).value == 10);
+}
diff --git a/tests/kernel/unsorted/field_dispatcher_test.dart b/tests/kernel/unsorted/field_dispatcher_test.dart
new file mode 100644
index 0000000..cddba91
--- /dev/null
+++ b/tests/kernel/unsorted/field_dispatcher_test.dart
@@ -0,0 +1,37 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+class A {
+  Function fun;
+  A(this.fun);
+}
+
+globalFunctionPositional(int a, [int b = 42]) => a + b;
+
+globalFunctionNamed(int a, {int b: 42}) => a + b;
+
+class Foo {
+  int base;
+
+  Foo(this.base);
+
+  methodFunctionPositional(int a, [int b = 42]) => base + a + b;
+
+  methodFunctionNamed(int a, {int b: 42}) => base + a + b;
+}
+
+main() {
+  Expect.isTrue(new A(globalFunctionPositional).fun(1, 2) == 3);
+  Expect.isTrue(new A(globalFunctionPositional).fun(1) == 43);
+  Expect.isTrue(new A(globalFunctionNamed).fun(1, b: 2) == 3);
+  Expect.isTrue(new A(globalFunctionNamed).fun(1) == 43);
+
+  var foo = new Foo(100);
+  Expect.isTrue(new A(foo.methodFunctionPositional).fun(1, 2) == 103);
+  Expect.isTrue(new A(foo.methodFunctionPositional).fun(1) == 143);
+  Expect.isTrue(new A(foo.methodFunctionNamed).fun(1, b: 2) == 103);
+  Expect.isTrue(new A(foo.methodFunctionNamed).fun(1) == 143);
+}
diff --git a/tests/kernel/unsorted/finally_contexts_test.dart b/tests/kernel/unsorted/finally_contexts_test.dart
new file mode 100644
index 0000000..a392c65
--- /dev/null
+++ b/tests/kernel/unsorted/finally_contexts_test.dart
@@ -0,0 +1,47 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+// Test that the context depth is correct in the presence of control flow,
+// specifically branching and joining in the presence of break.  The
+// implementation uses the context depth after the else block of an if/then/else
+// as the context depth at the join point.  This test has an extra context
+// allocated in the (untaken) else branch so it tests that compiling the
+// (untaken) break properly tracks the context depth.
+
+test(list) {
+  // The loops force creation of a new context, otherwise context allocated
+  // variables might be hoisted to an outer context.
+  do {
+    if (list.length > 1) {
+      do {
+        var sum = 0;
+        addem() {
+          for (var x in list) sum += x;
+        }
+        addem();
+        Expect.isTrue(sum == 15);
+        L: if (sum != 15) {
+          // Unreachable.
+          do {
+            var product = 1;
+            multiplyem() {
+              for (var x in list) product *= x;
+            }
+            multiplyem();
+            Expect.isTrue(false);
+            break L;
+          } while (false);
+        }
+      } while (false);
+    }
+  } while (false);
+  Expect.isTrue(list.length == 5);
+}
+
+
+main() {
+  test([1, 2, 3, 4, 5]);
+}
diff --git a/tests/kernel/unsorted/for_in_loop_test.dart b/tests/kernel/unsorted/for_in_loop_test.dart
new file mode 100644
index 0000000..635d72f
--- /dev/null
+++ b/tests/kernel/unsorted/for_in_loop_test.dart
@@ -0,0 +1,38 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Tests of for-in loops and list literals.
+
+import 'package:expect/expect.dart';
+
+fact4() {
+  var f = 1;
+  for (var n in [1, 2, 3, 4]) {
+    f *= n;
+  }
+  return f;
+}
+
+fact5() {
+  var f = 1, n;
+  for (n in [1, 2, 3, 4, 5]) {
+    f *= n;
+  }
+  return f;
+}
+
+var global;
+fact6() {
+  var f = 1;
+  for (global in [1, 2, 3, 4, 5, 6]) {
+    f *= global;
+  }
+  return f;
+}
+
+main() {
+  Expect.isTrue(fact4() == 24);
+  Expect.isTrue(fact5() == 120);
+  Expect.isTrue(fact6() == 720);
+}
diff --git a/tests/kernel/unsorted/getters_and_setters_test.dart b/tests/kernel/unsorted/getters_and_setters_test.dart
new file mode 100644
index 0000000..816a0e0
--- /dev/null
+++ b/tests/kernel/unsorted/getters_and_setters_test.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+var field;
+
+get getField {
+  print('B.getField');
+  return field;
+}
+
+set setField(value) {
+  print('B.setField');
+  field = value;
+  return null;
+}
+
+main() {
+  var result;
+
+  result = (field = 42);
+  Expect.isTrue(result == 42);
+  Expect.isTrue(field == 42);
+  Expect.isTrue(getField == 42);
+
+  result = (setField = 99);
+  Expect.isTrue(result == 99);
+  Expect.isTrue(field == 99);
+  Expect.isTrue(getField == 99);
+}
diff --git a/tests/kernel/unsorted/global_field_initializer_test.dart b/tests/kernel/unsorted/global_field_initializer_test.dart
new file mode 100644
index 0000000..a19fe34
--- /dev/null
+++ b/tests/kernel/unsorted/global_field_initializer_test.dart
@@ -0,0 +1,37 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+var intField = 1;
+var doubleField = 3.1415;
+var stringField = "hello";
+var nullField = null;
+var nullField2;
+var composed = "hello" + " " + "world";
+
+class A {
+  static var intField = 1;
+  static var doubleField = 3.1415;
+  static var stringField = "hello";
+  static var nullField = null;
+  static var nullField2;
+  static var composed = "hello" + " " + "world";
+}
+
+main() {
+  Expect.isTrue(intField == 1);
+  Expect.isTrue(doubleField == 3.1415);
+  Expect.isTrue(stringField == "hello");
+  Expect.isTrue(nullField == null);
+  Expect.isTrue(nullField2 == null);
+  Expect.isTrue(composed == "hello world");
+
+  Expect.isTrue(A.intField == 1);
+  Expect.isTrue(A.doubleField == 3.1415);
+  Expect.isTrue(A.stringField == "hello");
+  Expect.isTrue(A.nullField == null);
+  Expect.isTrue(A.nullField2 == null);
+  Expect.isTrue(A.composed == "hello world");
+}
diff --git a/tests/kernel/unsorted/global_function_test.dart b/tests/kernel/unsorted/global_function_test.dart
new file mode 100644
index 0000000..925ce80
--- /dev/null
+++ b/tests/kernel/unsorted/global_function_test.dart
@@ -0,0 +1,35 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+main() {
+  foo(1, 2);
+  print('---');
+  foo(1, 2, d: 12);
+  print('---');
+  foo(1, 2, c: 11, e: 13);
+
+  print('=====');
+
+  bar(1, 2);
+  print('---');
+  bar(1, 2, 3);
+  print('---');
+  bar(1, 2, 3, 4);
+}
+
+foo(a, b, {c, d, e}) {
+  print(a);
+  print(b);
+  print(c);
+  print(d);
+  print(e);
+}
+
+bar(a, b, [c, d]) {
+  print(a);
+  print(b);
+  print(c);
+  print(d);
+}
+
diff --git a/tests/kernel/unsorted/instance_getters_and_setters_test.dart b/tests/kernel/unsorted/instance_getters_and_setters_test.dart
new file mode 100644
index 0000000..4430a62
--- /dev/null
+++ b/tests/kernel/unsorted/instance_getters_and_setters_test.dart
@@ -0,0 +1,36 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+class A {
+  var field;
+
+  get getField {
+    return field;
+  }
+
+  set setField(value) {
+    field = value;
+    return null;
+  }
+}
+
+main() {
+  var result;
+  var a = new A();
+
+  Expect.isTrue(a.field == null);
+  Expect.isTrue(a.getField == null);
+
+  result = (a.field = 42);
+  Expect.isTrue(result == 42);
+  Expect.isTrue(a.field == 42);
+  Expect.isTrue(a.getField == 42);
+
+  result = (a.setField = 99);
+  Expect.isTrue(result == 99);
+  Expect.isTrue(a.field == 99);
+  Expect.isTrue(a.getField == 99);
+}
diff --git a/tests/kernel/unsorted/invocation_errors_test.dart b/tests/kernel/unsorted/invocation_errors_test.dart
new file mode 100644
index 0000000..9c9c516
--- /dev/null
+++ b/tests/kernel/unsorted/invocation_errors_test.dart
@@ -0,0 +1,16 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Erroneous cases of invocations.
+
+import 'package:expect/expect.dart';
+
+test0(x) {
+  print('test0');
+}
+
+main() {
+  // Incorrect number of arguments, should be NoSuchMethodError but crashes.
+  test0(0, 1);
+}
diff --git a/tests/kernel/unsorted/invocation_test.dart b/tests/kernel/unsorted/invocation_test.dart
new file mode 100644
index 0000000..dbf862c
--- /dev/null
+++ b/tests/kernel/unsorted/invocation_test.dart
@@ -0,0 +1,40 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Tests of invocations.
+
+import 'package:expect/expect.dart';
+
+test0(x) {
+  Expect.isTrue(x == 'argument0');
+  return 'return0';
+}
+
+class C0 {
+  static test1(x) {
+    Expect.isTrue(x == 'argument1');
+    return 'return1';
+  }
+}
+
+class C1 {
+  test2(x) {
+    Expect.isTrue(x == 'argument2');
+    return 'return2';
+  }
+}
+
+class C2 {
+  C2.test3(x) {
+    Expect.isTrue(x == 'argument3');
+  }
+}
+
+main() {
+  Expect.isTrue(test0('argument0') == 'return0');
+  Expect.isTrue(C0.test1('argument1') == 'return1');
+  Expect.isTrue(new C1().test2('argument2') == 'return2');
+  var c = new C2.test3('argument3');
+  Expect.isTrue(c is C2);
+}
diff --git a/tests/kernel/unsorted/klass_field_initializer_test.dart b/tests/kernel/unsorted/klass_field_initializer_test.dart
new file mode 100644
index 0000000..1d28341
--- /dev/null
+++ b/tests/kernel/unsorted/klass_field_initializer_test.dart
@@ -0,0 +1,36 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+class A {
+  var intField = 1;
+  var doubleField = 3.1415;
+  var stringField = "hello";
+  var o;
+
+  A(this.o);
+}
+
+class B extends A {
+  var nullField = null;
+  var nullField2;
+
+  var n;
+  var m;
+
+  B(this.n, o) : super(o), m = "m";
+}
+
+main() {
+  var o = new B("n", "o");
+  Expect.isTrue(o.intField == 1);
+  Expect.isTrue(o.doubleField == 3.1415);
+  Expect.isTrue(o.stringField == "hello");
+  Expect.isTrue(o.nullField == null);
+  Expect.isTrue(o.nullField2 == null);
+  Expect.isTrue(o.m == 'm');
+  Expect.isTrue(o.n == 'n');
+  Expect.isTrue(o.o == 'o');
+}
diff --git a/tests/kernel/unsorted/klass_test.dart b/tests/kernel/unsorted/klass_test.dart
new file mode 100644
index 0000000..2745882
--- /dev/null
+++ b/tests/kernel/unsorted/klass_test.dart
@@ -0,0 +1,52 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 A {
+  A() {
+    print("A");
+  }
+
+  hello() {
+    print("A.hello()");
+  }
+
+  hello1(a) {
+    print("A.hello1()");
+    print(a);
+  }
+
+  foo(a, [b]) {
+    print("A.foo()");
+    print(a);
+    print(b);
+  }
+
+  bar(a, {b}) {
+    print("A.bar()");
+    print(a);
+    print(b);
+  }
+}
+
+main() {
+  print("before constructor");
+  var a = new A();
+  print("============");
+  a.hello();
+  print('-----(obj):');
+  print(a);
+  print('-----');
+  a.hello1(1);
+  print('-----');
+  a.foo(1);
+  print('-----');
+  a.foo(1, 2);
+  print('-----');
+  print("============");
+  a.bar(1);
+  print('-----');
+  a.bar(1, b: 2);
+  print("============");
+}
+
diff --git a/tests/kernel/unsorted/let_test.dart b/tests/kernel/unsorted/let_test.dart
new file mode 100644
index 0000000..7687966
--- /dev/null
+++ b/tests/kernel/unsorted/let_test.dart
@@ -0,0 +1,10 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+main() {
+  var a = [1];
+  Expect.isTrue((a..add(42))[1] == 42);
+}
diff --git a/tests/kernel/unsorted/load_store_test.dart b/tests/kernel/unsorted/load_store_test.dart
new file mode 100644
index 0000000..d19f87b
--- /dev/null
+++ b/tests/kernel/unsorted/load_store_test.dart
@@ -0,0 +1,64 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Tests of reading and writing to variables.
+
+import 'package:expect/expect.dart';
+
+test0() {
+  var x0 = 0, x1;
+  Expect.isTrue(x0 == 0);
+  Expect.isTrue(x1 == null);
+  x0 = 1;
+  Expect.isTrue(x0 == 1);
+  Expect.isTrue((x0 = 2) == 2);
+  Expect.isTrue(x0 == 2);
+}
+
+var x2 = 0, x3;
+
+test1() {
+  Expect.isTrue(x2 == 0);
+  Expect.isTrue(x3 == null);
+  x2 = 1;
+  Expect.isTrue(x2 == 1);
+  Expect.isTrue((x2 = 2) == 2);
+  Expect.isTrue(x2 == 2);
+}
+
+class C {
+  static var x4 = 0;
+  static var x5;
+}
+
+test3() {
+  Expect.isTrue(C.x4 == 0);
+  Expect.isTrue(C.x5 == null);
+  C.x4 = 1;
+  Expect.isTrue(C.x4 == 1);
+  Expect.isTrue((C.x4 = 2) == 2);
+  Expect.isTrue(C.x4 == 2);
+}
+
+class D {
+  var x6 = 0;
+  var x7;
+}
+
+test4() {
+  var d = new D();
+  Expect.isTrue(d.x6 == 0);
+  Expect.isTrue(d.x7 == null);
+  d.x6 = 1;
+  Expect.isTrue(d.x6 == 1);
+  Expect.isTrue((d.x6 = 2) == 2);
+  Expect.isTrue(d.x6 == 2);
+}
+
+main() {
+  test0();
+  test1();
+  test3();
+  test4();
+}
diff --git a/tests/kernel/unsorted/local_function_test.dart b/tests/kernel/unsorted/local_function_test.dart
new file mode 100644
index 0000000..536c96a
--- /dev/null
+++ b/tests/kernel/unsorted/local_function_test.dart
@@ -0,0 +1,25 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Tests of function expressions and function statements.
+
+import 'package:expect/expect.dart';
+
+main() {
+  var even;
+  odd(n) => n > 0 && even(n - 1);
+  even = (n) => n == 0 || odd(n - 1);
+
+  Expect.isTrue(even(0));
+  Expect.isTrue(!odd(0));
+
+  Expect.isTrue(odd(1));
+  Expect.isTrue(!even(1));
+
+  Expect.isTrue(even(42));
+  Expect.isTrue(!odd(42));
+
+  Expect.isTrue(odd(101));
+  Expect.isTrue(!even(101));
+}
diff --git a/tests/kernel/unsorted/loop_test.dart b/tests/kernel/unsorted/loop_test.dart
new file mode 100644
index 0000000..3885138
--- /dev/null
+++ b/tests/kernel/unsorted/loop_test.dart
@@ -0,0 +1,91 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Tests of loops.
+
+import 'package:expect/expect.dart';
+
+fact(n) {
+  var f = 1;
+  while (n > 0) {
+    f *= n;
+    --n;
+  }
+  return f;
+}
+
+fib(n) {
+  if (n == 0) return 0;
+  var previous = 0, current = 1;
+  while (n > 1) {
+    var temp = current;
+    current += previous;
+    previous = temp;
+    --n;
+  }
+  return current;
+}
+
+mkTrue() => true;
+mkFalse() => false;
+
+check(b) {
+  Expect.isTrue(b);
+  return b;
+}
+
+test0() {
+  while (mkTrue()) {
+    Expect.isTrue(true);
+    return;
+  }
+  Expect.isTrue(false);
+}
+
+test1() {
+  while (mkFalse()) {
+    Expect.isTrue(false);
+  }
+  Expect.isTrue(true);
+}
+
+test2() {
+  do {
+    Expect.isTrue(true);
+  } while (mkFalse());
+  Expect.isTrue(true);
+}
+
+test3() {
+  do {
+    Expect.isTrue(true);
+    return;
+  } while (check(false));
+  Expect.isTrue(false);
+}
+
+main() {
+  Expect.isTrue(fact(0) == 1);
+  Expect.isTrue(fact(1) == 1);
+  Expect.isTrue(fact(5) == 120);
+  Expect.isTrue(fact(42) ==
+      1405006117752879898543142606244511569936384000000000);
+  Expect.isTrue(fact(3.14159) == 1.0874982674320444);
+
+  Expect.isTrue(fib(0) == 0);
+  Expect.isTrue(fib(1) == 1);
+  Expect.isTrue(fib(2) == 1);
+  Expect.isTrue(fib(3) == 2);
+  Expect.isTrue(fib(4) == 3);
+  Expect.isTrue(fib(5) == 5);
+  Expect.isTrue(fib(6) == 8);
+  Expect.isTrue(fib(7) == 13);
+  Expect.isTrue(fib(42) == 267914296);
+  Expect.isTrue(fib(3.14159) == 3);
+
+  test0();
+  test1();
+  test2();
+  test3();
+}
diff --git a/tests/kernel/unsorted/mapliteral_test.dart b/tests/kernel/unsorted/mapliteral_test.dart
new file mode 100644
index 0000000..146422d
--- /dev/null
+++ b/tests/kernel/unsorted/mapliteral_test.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+main() {
+  var map = {
+    'k1': 'v1',
+    'k2': 'v2',
+    1: 2,
+    1.5 : 1.2,
+    3: 3.14,
+  };
+
+  Expect.isTrue(map.length == 5);
+
+  map['foo'] = 'bar';
+
+  Expect.isTrue(map['k1'] == 'v1');
+  Expect.isTrue(map['k2'] == 'v2');
+  Expect.isTrue(map[1] == 2);
+  Expect.isTrue(map[1.5] == 1.2);
+  Expect.isTrue(map[3] == 3.14);
+  Expect.isTrue(map['foo'] == 'bar');
+  Expect.isTrue(map.length == 6);
+}
diff --git a/tests/kernel/unsorted/mixin_test.dart b/tests/kernel/unsorted/mixin_test.dart
new file mode 100644
index 0000000..c04a2f3
--- /dev/null
+++ b/tests/kernel/unsorted/mixin_test.dart
@@ -0,0 +1,64 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+class Base {
+  baseFoo() {
+    print('Base.baseFoo()');
+    return 1;
+  }
+
+  foo() {
+    print('Base.foo()');
+    return 1;
+  }
+}
+
+class Mixin {
+  mixinFoo() {
+    print('Mixin.mixinFoo()');
+    return 2;
+  }
+
+  foo() {
+    print('Mixin.foo()');
+    return 2;
+  }
+}
+
+class Mixin2 {
+  mixin2Foo() {
+    print('Mixin2.mixin2Foo()');
+    return 3;
+  }
+
+  foo() {
+    print('Mixin2.foo()');
+    return 3;
+  }
+}
+
+class Sub extends Base with Mixin, Mixin2 {
+  subFoo() {
+    print('Sub.subFoo()');
+    return 4;
+  }
+
+  foo() {
+    print('Sub.foo()');
+    return 4;
+  }
+}
+
+main() {
+  var o = new Sub();
+
+  Expect.isTrue(o.baseFoo() == 1);
+  Expect.isTrue(o.mixinFoo() == 2);
+  Expect.isTrue(o.mixin2Foo() == 3);
+  Expect.isTrue(o.subFoo() == 4);
+  Expect.isTrue(o.foo() == 4);
+}
+
diff --git a/tests/kernel/unsorted/nsm_dispatcher_test.dart b/tests/kernel/unsorted/nsm_dispatcher_test.dart
new file mode 100644
index 0000000..f9cfe40
--- /dev/null
+++ b/tests/kernel/unsorted/nsm_dispatcher_test.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+class A {
+  noSuchMethod(Invocation invocation) {
+    var s = '|${invocation.memberName}|';
+    for (var a in invocation.positionalArguments) {
+      s = '$s$a|';
+    }
+    invocation.namedArguments.forEach((Symbol k, v) {
+      s = '$s$k/$v|';
+    });
+    print(s);
+    return s;
+  }
+}
+
+main() {
+  var o = new A();
+  Expect.isTrue(o.fun() == '|Symbol("fun")|');
+  Expect.isTrue(o.fun(1) == '|Symbol("fun")|1|');
+  Expect.isTrue(o.fun(1, 2) == '|Symbol("fun")|1|2|');
+  Expect.isTrue(o.fun(1, b: 2) ==
+      '|Symbol("fun")|1|Symbol("b")/2|');
+  Expect.isTrue(o.fun(1, a: 1, b: 2) ==
+      '|Symbol("fun")|1|Symbol("a")/1|Symbol("b")/2|');
+  Expect.isTrue(o.fun(1, b: 2, a: 1) ==
+      '|Symbol("fun")|1|Symbol("a")/1|Symbol("b")/2|');
+}
diff --git a/tests/kernel/unsorted/nullable_operator_test.dart b/tests/kernel/unsorted/nullable_operator_test.dart
new file mode 100644
index 0000000..9bf1bcb7
--- /dev/null
+++ b/tests/kernel/unsorted/nullable_operator_test.dart
@@ -0,0 +1,13 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+mkOne() => 1;
+mkNull() => null;
+
+main() {
+  Expect.isTrue((mkOne() ?? 2) == 1);
+  Expect.isTrue((mkNull() ?? 2) == 2);
+}
diff --git a/tests/kernel/unsorted/rethrow_test.dart b/tests/kernel/unsorted/rethrow_test.dart
new file mode 100644
index 0000000..c8f31d1
--- /dev/null
+++ b/tests/kernel/unsorted/rethrow_test.dart
@@ -0,0 +1,67 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+testNormalRethrow() {
+  var x = 0;
+  try {
+    try {
+      throw x++;
+    } catch (e) {
+      Expect.isTrue(e == 0);
+      x++;
+      rethrow;
+    }
+  } catch (e) {
+    Expect.isTrue(e == 0);
+    x++;
+  }
+  Expect.isTrue(x == 3);
+}
+
+testNormalRethrow2() {
+  var x = 0;
+  try {
+    try {
+      throw x++;
+    } on int catch (e) {
+      Expect.isTrue(e == 0);
+      x++;
+      rethrow;
+    }
+  } catch (e) {
+    Expect.isTrue(e == 0);
+    x++;
+  }
+  Expect.isTrue(x == 3);
+}
+
+testRethrowWithinTryRethrow() {
+  var x = 0;
+  try {
+    try {
+      throw x++;
+    } on int catch (e) {
+      Expect.isTrue(e == 0);
+      x++;
+      try {
+        x++;
+        rethrow;
+      } finally {
+        x++;
+      }
+    }
+  } catch (e) {
+    Expect.isTrue(e == 0);
+    x++;
+  }
+  Expect.isTrue(x == 5);
+}
+
+main() {
+  testNormalRethrow();
+  testNormalRethrow2();
+  testRethrowWithinTryRethrow();
+}
diff --git a/tests/kernel/unsorted/return_test.dart b/tests/kernel/unsorted/return_test.dart
new file mode 100644
index 0000000..9bf60d2
--- /dev/null
+++ b/tests/kernel/unsorted/return_test.dart
@@ -0,0 +1,28 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Tests of return (and imports, literals, ==, and static methods).
+
+import 'package:expect/expect.dart';
+
+test0() {}
+
+test1() { return; }
+
+test3() { return 3; }
+
+test4() => 4;
+
+test5() {
+  return 5;
+  Expect.isTrue(false);
+}
+
+main() {
+  Expect.isTrue(test0() == null);
+  Expect.isTrue(test1() == null);
+  Expect.isTrue(test3() == 3);
+  Expect.isTrue(test4() == 4);
+  Expect.isTrue(test5() == 5);
+}
diff --git a/tests/kernel/unsorted/simple_literal_test.dart b/tests/kernel/unsorted/simple_literal_test.dart
new file mode 100644
index 0000000..fd7ba87
--- /dev/null
+++ b/tests/kernel/unsorted/simple_literal_test.dart
@@ -0,0 +1,45 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Tests of literals (and imports, return, ==, and static methods).
+import 'package:expect/expect.dart';
+
+test0() {
+  return 'Hello, world!';
+}
+
+test1() {
+  return 42;
+}
+
+test2() {
+  return 2.71828;
+}
+
+test3() {
+  return 6.022e23;
+}
+
+test4() {
+  return true;
+}
+
+test5() {
+  return false;
+}
+
+test6() {
+  return 1405006117752879898543142606244511569936384000000000;
+}
+
+main() {
+  Expect.isTrue(test0() == 'Hello, world!');
+  Expect.isTrue(test1() == 42);
+  Expect.isTrue(test2() == 2.71828);
+  Expect.isTrue(test3() == 6.022e23);
+  Expect.isTrue(test4());
+  Expect.isTrue(test5() == false);
+  Expect.isTrue(
+      test6() == 1405006117752879898543142606244511569936384000000000);
+}
diff --git a/tests/kernel/unsorted/string_buffer_test.dart b/tests/kernel/unsorted/string_buffer_test.dart
new file mode 100644
index 0000000..a89aee6
--- /dev/null
+++ b/tests/kernel/unsorted/string_buffer_test.dart
@@ -0,0 +1,9 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+main() {
+  var sb = new StringBuffer();
+  sb.writeln('hello world :)');
+  print(sb);
+}
diff --git a/tests/kernel/unsorted/string_concatenation_test.dart b/tests/kernel/unsorted/string_concatenation_test.dart
new file mode 100644
index 0000000..be6543a
--- /dev/null
+++ b/tests/kernel/unsorted/string_concatenation_test.dart
@@ -0,0 +1,13 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+class A {
+  toString() => 'hello';
+}
+
+main() {
+  Expect.isTrue('begin ${new A()} end' == 'begin hello end');
+}
diff --git a/tests/kernel/unsorted/super_initializer_test.dart b/tests/kernel/unsorted/super_initializer_test.dart
new file mode 100644
index 0000000..b230686
--- /dev/null
+++ b/tests/kernel/unsorted/super_initializer_test.dart
@@ -0,0 +1,48 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE.md file.
+
+import 'package:expect/expect.dart';
+
+String log;
+init() { log = ''; }
+logit(msg) { return log = '$log$msg'; }
+
+class Base {
+  var b;
+  Base.arg0() : b = logit('b') {
+    logit('B');
+  }
+  Base.arg1(a) : b = logit('b') {
+    logit('B');
+  }
+  Base.arg2(a, b) : b = logit('b') {
+    logit('B');
+  }
+}
+
+class Sub extends Base {
+  var x;
+  var s;
+  Sub.arg0() : x = logit('x'), super.arg0(), s = logit('s') {
+    logit('S');
+  }
+  Sub.arg1(a) : x = logit('x'), super.arg1(logit('1')), s = logit('s') {
+    logit('S');
+  }
+  Sub.arg2(a, b) : x = logit('x'), super.arg2(logit('1'), logit('2')), s = logit('s') {
+    logit('S');
+  }
+}
+
+test(fun(), String result) {
+  init();
+  fun();
+  Expect.isTrue(log == result);
+}
+
+main() {
+  test(() => new Sub.arg0(), 'xsbBS');
+  test(() => new Sub.arg1(1), 'x1sbBS');
+  test(() => new Sub.arg2(1, 2), 'x12sbBS');
+}
diff --git a/tests/kernel/unsorted/super_mixin_test.dart b/tests/kernel/unsorted/super_mixin_test.dart
new file mode 100644
index 0000000..de0871e
--- /dev/null
+++ b/tests/kernel/unsorted/super_mixin_test.dart
@@ -0,0 +1,39 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+class Base {
+  var field;
+
+  method(x) {
+    print(x);
+    return x;
+  }
+
+  set setter(x) {
+    print(x);
+    field = x;
+  }
+}
+
+class Mixin {
+  method(x) {
+    return super.method(x + 'Mixin');
+  }
+
+  set setter(x) {
+    super.setter = x + 'Mixin';
+  }
+}
+
+class Sub extends Base with Mixin {
+}
+
+main() {
+  var object = new Sub();
+  Expect.isTrue(object.method('x') == 'xMixin');
+  object.setter = 'y';
+  Expect.isTrue(object.field == 'yMixin');
+}
diff --git a/tests/kernel/unsorted/super_test.dart b/tests/kernel/unsorted/super_test.dart
new file mode 100644
index 0000000..54f5d99
--- /dev/null
+++ b/tests/kernel/unsorted/super_test.dart
@@ -0,0 +1,40 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+class A {
+  var field = 9;
+  var called = false;
+
+  superMethod() {
+    Expect.isTrue(field == 10);
+    called = true;
+    return true;
+  }
+}
+
+class B extends A {
+  doit() {
+    Expect.isTrue((super.field = 10) == 10);
+    Expect.isTrue(super.superMethod());
+    if (called) {
+      Expect.isTrue((super.field = 11) == 11);
+    }
+    return super.field;
+  }
+}
+
+class C extends B {
+  set field(v) {
+    throw 'should not happen';
+  }
+}
+
+main() {
+  var c = new C();
+  Expect.isTrue(c.field == 9);
+  Expect.isTrue(c.doit() == 11);
+  Expect.isTrue(c.field == 11);
+}
diff --git a/tests/kernel/unsorted/superclass_test.dart b/tests/kernel/unsorted/superclass_test.dart
new file mode 100644
index 0000000..15f1f56
--- /dev/null
+++ b/tests/kernel/unsorted/superclass_test.dart
@@ -0,0 +1,64 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+class A {
+  A() {
+    print("A");
+  }
+
+  hello() {
+    print("A.hello()");
+    return 1;
+  }
+
+  hello1(a) {
+    print("A.hello1()");
+    print(a);
+    return 1;
+  }
+
+  foo(a, [b]) {
+    print("A.foo()");
+    print(a);
+    print(b);
+    return 1;
+  }
+
+  bar(a, {b}) {
+    print("A.bar()");
+    print(a);
+    print(b);
+    return 1;
+  }
+}
+
+class B extends A {
+  hello() {
+    print("B.hello()");
+    return 2;
+  }
+
+  bar(a, {b}) {
+    print("B.bar()");
+    print(a);
+    print(b);
+    return 2;
+  }
+}
+
+main() {
+  var o = new B();
+
+  // Base class methods.
+  Expect.isTrue(o.hello1(1) == 1);
+  Expect.isTrue(o.foo(1) == 1);
+  Expect.isTrue(o.foo(1, 2) == 1);
+
+  // Overwritten methods.
+  Expect.isTrue(o.hello() == 2);
+  Expect.isTrue(o.bar(1) == 2);
+  Expect.isTrue(o.bar(1, b: 2) == 2);
+}
diff --git a/tests/kernel/unsorted/switch_case_test.dart b/tests/kernel/unsorted/switch_case_test.dart
new file mode 100644
index 0000000..333310f
--- /dev/null
+++ b/tests/kernel/unsorted/switch_case_test.dart
@@ -0,0 +1,174 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+mkOne() => 1;
+mkTwo() => 2;
+
+testNormal() {
+  int result;
+  switch(mkOne()) {
+    case 0:
+      result = 0;
+      break;
+    case 1:
+      result = 1;
+      break;
+    case 2:
+      result = 2;
+      break;
+    default:
+      result = 3;
+      break;
+  }
+  Expect.isTrue(result == 1);
+}
+
+testDefault() {
+  int result;
+  switch(null) {
+    case 0:
+      result = 0;
+      break;
+    case 1:
+      result = 1;
+      break;
+    case 2:
+      result = 2;
+      break;
+    default:
+      result = 3;
+      break;
+  }
+  Expect.isTrue(result == 3);
+}
+
+testFallThrough() {
+  int result;
+  switch(mkOne()) {
+    case 0:
+      result = 0;
+      break;
+    case 1:
+    case 2:
+      result = 2;
+      break;
+    default:
+      result = 3;
+      break;
+  }
+  Expect.isTrue(result == 2);
+}
+
+testContinue() {
+  int result;
+  switch(mkTwo()) {
+    case 0:
+      result = 0;
+      break;
+
+    setitto1:
+    case 1:
+      result = 1;
+      continue setitto3;
+
+    case 2:
+      result = 2;
+      continue setitto1;
+
+    setitto3:
+    default:
+      result = 3;
+      break;
+  }
+  Expect.isTrue(result == 3);
+}
+
+testOnlyDefault() {
+  int result;
+  switch(mkTwo()) {
+    default:
+      result = 42;
+  }
+  Expect.isTrue(result == 42);
+}
+
+testOnlyDefaultWithBreak() {
+  int result;
+  switch(mkTwo()) {
+    default:
+      result = 42;
+  }
+  Expect.isTrue(result == 42);
+}
+
+String testReturn() {
+  switch(mkOne()) {
+    case 0: return "bad";
+    case 1: return "good";
+    default: return "bad";
+  }
+}
+
+regressionTest() {
+  Expect.isTrue(regressionTestHelper(0, 0) == -1);
+  Expect.isTrue(regressionTestHelper(4, 0) == -1);
+  Expect.isTrue(regressionTestHelper(4, 1) == 42);
+}
+
+regressionTestHelper(i, j) {
+  switch (i) {
+    case 4:
+      switch (j) {
+        case 1:
+          return 42;
+      }
+  }
+  return -1;
+}
+
+regressionTest2() {
+  var state = 1;
+  while (state < 2) {
+    switch (state) {
+      case 1:
+        state++;
+        break;
+      case 3:
+      case 4:
+        // We will translate this currently to an empty [Fragment] which can
+        // cause issues if we would like to append/prepend to it.
+        assert(false);
+    }
+  }
+  return [1];
+}
+
+regressionTest3() {
+  f(x) {
+    switch (x) {
+      case 1:
+        return 2;
+      case 2:
+    }
+    throw new UnsupportedError("Unexpected constant kind.");
+  }
+  Expect.isTrue(f(1) == 2);
+}
+
+main() {
+  testNormal();
+  testDefault();
+  testFallThrough();
+  testContinue();
+  testOnlyDefault();
+  testOnlyDefaultWithBreak();
+  regressionTest();
+  regressionTest2();
+  regressionTest3();
+
+  var result = testReturn();
+  Expect.isTrue(result == "good");
+}
diff --git a/tests/kernel/unsorted/symbol_literal_test.dart b/tests/kernel/unsorted/symbol_literal_test.dart
new file mode 100644
index 0000000..6a3cc8a
--- /dev/null
+++ b/tests/kernel/unsorted/symbol_literal_test.dart
@@ -0,0 +1,10 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+main() {
+  Expect.isTrue('${#abc}' == 'Symbol("abc")');
+  Expect.isTrue('${#abc.xzy}' == 'Symbol("abc.xzy")');
+}
diff --git a/tests/kernel/unsorted/this_capture_test.dart b/tests/kernel/unsorted/this_capture_test.dart
new file mode 100644
index 0000000..ea296d6
--- /dev/null
+++ b/tests/kernel/unsorted/this_capture_test.dart
@@ -0,0 +1,34 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+class Foo {
+  capture() {
+    return () {
+      return this;
+    };
+  }
+
+  captureFirst(a, b) {
+    return () {
+      print(a);
+      return this;
+    };
+  }
+
+  captureLast(a, b) {
+    return () {
+      print(b);
+      return this;
+    };
+  }
+}
+
+main() {
+  var foo = new Foo();
+  Expect.isTrue(identical(foo, (foo.capture())()));
+  Expect.isTrue(identical(foo, (foo.captureFirst(1, 2))()));
+  Expect.isTrue(identical(foo, (foo.captureLast(1, 2))()));
+}
diff --git a/tests/kernel/unsorted/this_test.dart b/tests/kernel/unsorted/this_test.dart
new file mode 100644
index 0000000..666da97
--- /dev/null
+++ b/tests/kernel/unsorted/this_test.dart
@@ -0,0 +1,15 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+class A {
+  getThis() => this;
+}
+
+main() {
+  var a = new A();
+  Expect.isTrue(a == a.getThis());
+  Expect.isTrue(identical(a, a.getThis()));
+}
diff --git a/tests/kernel/unsorted/throw_try_catch_test.dart b/tests/kernel/unsorted/throw_try_catch_test.dart
new file mode 100644
index 0000000..d76cba7
--- /dev/null
+++ b/tests/kernel/unsorted/throw_try_catch_test.dart
@@ -0,0 +1,190 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+testSimpleThrowCatch() {
+  var x = 1;
+  try {
+    throw x++;
+  } on int catch (e) {
+    Expect.isTrue(e == 1);
+    Expect.isTrue(x == 2);
+    x++;
+  }
+  Expect.isTrue(x == 3);
+}
+
+testNestedThrowCatch() {
+  var x = 1;
+  try {
+    throw x++;
+  } catch (e) {
+    Expect.isTrue(e == 1);
+    Expect.isTrue(x == 2);
+    x++;
+
+    try {
+      throw x++;
+    } catch (e) {
+      Expect.isTrue(e == 3);
+      Expect.isTrue(x == 4);
+      x++;
+    }
+  }
+  Expect.isTrue(x == 5);
+}
+
+testNestedThrowCatch2() {
+  var x = 1;
+  try {
+    try {
+      throw x++;
+    } catch (e) {
+      Expect.isTrue(e == 1);
+      Expect.isTrue(x == 2);
+      x++;
+    }
+    throw x++;
+  } catch (e) {
+    Expect.isTrue(e == 3);
+    Expect.isTrue(x == 4);
+    x++;
+  }
+  Expect.isTrue(x == 5);
+}
+
+testSiblingThrowCatch() {
+  var x = 1;
+  try {
+    throw x++;
+  } catch (e) {
+    Expect.isTrue(e == 1);
+    Expect.isTrue(x == 2);
+    x++;
+  }
+  try {
+    throw x++;
+  } catch (e) {
+    Expect.isTrue(e == 3);
+    Expect.isTrue(x == 4);
+    x++;
+  }
+
+  Expect.isTrue(x == 5);
+}
+
+testTypedCatch() {
+  var good = false;
+  try {
+    throw 1;
+  } on int catch (e) {
+    Expect.isTrue(e == 1);
+    good = true;
+  } on String catch (_) {
+    Expect.isTrue(false);
+  }
+  Expect.isTrue(good);
+}
+
+testTypedCatch2() {
+  var good = false;
+  try {
+    throw 'a';
+  } on int catch (_) {
+    Expect.isTrue(false);
+  } on String catch (e) {
+    Expect.isTrue(e == 'a');
+    good = true;
+  }
+  Expect.isTrue(good);
+}
+
+testThrowNull() {
+  var good = false;
+  try {
+    throw null;
+  } on NullThrownError catch (_) {
+    good = true;
+  }
+  Expect.isTrue(good);
+}
+
+testFinally() {
+  var x = 0;
+  try {
+    throw x++;
+  } catch (_) {
+    x++;
+  } finally {
+    x++;
+  }
+  Expect.isTrue(x == 3);
+}
+
+testFinally2() {
+  var x = 0;
+  try {
+    try {
+      throw x++;
+    } catch (_) {
+      x++;
+    } finally {
+      x++;
+    }
+  } finally {
+    x++;
+  }
+  Expect.isTrue(x == 4);
+}
+
+testFinally3() {
+  try {
+    var x = 0;
+    try {
+      throw x++;
+    } finally {
+      x++;
+    }
+    Expect.isTrue(x == 2);
+  } catch (_) {}
+}
+
+testSuccessfulBody() {
+  var x = 0;
+  try {
+    x++;
+  } finally {
+    x++;
+  }
+  Expect.isTrue(x == 2);
+}
+
+testSuccessfulBody2() {
+  var x = 0;
+  try {
+    try {
+      x++;
+    } finally {
+      x++;
+      throw 1;
+    }
+  } on int {}
+  Expect.isTrue(x == 2);
+}
+
+main() {
+  testSimpleThrowCatch();
+  testNestedThrowCatch();
+  testNestedThrowCatch2();
+  testSiblingThrowCatch();
+  testTypedCatch();
+  testTypedCatch2();
+  testThrowNull();
+  testFinally();
+  testFinally2();
+  testFinally3();
+  testSuccessfulBody();
+  testSuccessfulBody2();
+}
diff --git a/tests/kernel/unsorted/try_context_test.dart b/tests/kernel/unsorted/try_context_test.dart
new file mode 100644
index 0000000..f836c89
--- /dev/null
+++ b/tests/kernel/unsorted/try_context_test.dart
@@ -0,0 +1,91 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+throwValue(val) => throw val;
+
+f1() {
+  var a = 0;
+  var b = 0;
+  var c = 0;
+  var d = 0;
+  for (var i = 0; i < 10; i++) {
+    try {
+      for (var j = 0; j < 11; j++) {
+        try {
+          capture() => [i, j, a, b, c, d];
+          throwValue(j == 10 ? "${j}" : j);
+        } on num catch (e) {
+          a += j;
+          b -= e;
+        }
+      }
+    } catch (e) {
+      c++;
+      d += int.parse(e);
+    }
+  }
+  return [a, b, c, d];
+}
+
+
+f2() {
+  var a = 0;
+  var b = 0;
+  var c = 0;
+  var d = 0;
+  for (var i = 0; i < 10; i++) {
+    try {
+      for (var j = 0; j < 11; j++) {
+        try {
+          capture() => [i, j, a, b, c, d];
+          throwValue(j == 10 ? "${j}" : j);
+        } on num catch (e) {
+          a += j;
+          b -= e;
+        }
+      }
+    } catch (e) {
+      capture() => e;
+      c++;
+      d += int.parse(e);
+    }
+  }
+  return [a, b, c, d];
+}
+
+
+f3() {
+  var a = 0;
+  var b = 0;
+  var c = 0;
+  var d = 0;
+  for (var i = 0; i < 10; i++) {
+    try {
+      for (var j = 0; j < 11; j++) {
+        try {
+          capture() => [i, j, a, b, c, d];
+          throwValue(j == 10 ? "${j}" : j);
+        } on num catch (e) {
+          a += j;
+          b -= e;
+        }
+      }
+    } catch (e) {
+      capture() => e;
+      c++;
+      d += int.parse(e);
+      continue;
+    }
+  }
+  return [a, b, c, d];
+}
+
+
+main() {
+  Expect.listEquals([450, -450, 10, 100], f1());
+  Expect.listEquals([450, -450, 10, 100], f2());
+  Expect.listEquals([450, -450, 10, 100], f3());
+}
diff --git a/tests/kernel/unsorted/try_finally_test.dart b/tests/kernel/unsorted/try_finally_test.dart
new file mode 100644
index 0000000..87bb968
--- /dev/null
+++ b/tests/kernel/unsorted/try_finally_test.dart
@@ -0,0 +1,187 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+testSimpleBreak() {
+  var x = 1;
+  while (true) {
+    try {
+      x++;
+      break;
+    } finally {
+      x++;
+      break;
+    }
+  }
+  return x;
+}
+
+testReturnFinally() {
+  try {
+    return 1;
+  } finally {
+    return 42;
+  }
+}
+
+testNestedReturnFinally() {
+  try {
+    try {
+      return 1;
+    } finally {
+      return 2;
+    }
+  } finally {
+    return 42;
+  }
+}
+
+testReturnInsideLoop() {
+  while (true) {
+    try {
+      print("hello");
+    } finally {
+      return 42;
+    }
+  }
+}
+
+testStopContinueInsideLoop() {
+  while (true) {
+    try {
+      continue;
+    } finally {
+      return 42;
+    }
+  }
+}
+
+testStopBreakInsideLoop() {
+  var foo = 1;
+  while (true) {
+    try {
+      if (foo == 1) {
+        // 1st iteration we break.
+        break;
+      } else if (foo == 2) {
+        // 2nd iteration we return.
+        return 42;
+      }
+    } finally {
+      // 1st iteration we overrwrite break with continue.
+      if (foo == 1) {
+        foo++;
+        continue;
+      } else {
+        // Let return work
+      }
+    }
+  }
+  return foo;
+}
+
+testStopBreakInsideLoop2() {
+  var foo = 1;
+  while (true) {
+    try {
+      if (foo == 1) {
+        // 1st iteration we break.
+        break;
+      } else if (foo == 2) {
+        // 2nd iteration we return.
+        return -1;
+      }
+    } finally {
+      // 1st iteration we overrwrite break with continue.
+      if (foo == 1) {
+        foo++;
+        continue;
+      } else {
+        // 2nd iteration we overrwrite return with break.
+        foo = 42;
+        break;
+      }
+    }
+  }
+  return foo;
+}
+
+testStopContinueInsideSwitch() {
+  var foo = 1;
+  switch (foo) {
+    jump5:
+    case 5:
+      return -1;
+
+    case 1:
+      try {
+        continue jump5;
+      } finally {
+        return 42;
+      }
+  }
+}
+
+testStopContinueInsideSwitch2() {
+  var foo = 1;
+  switch (foo) {
+    jump5:
+    case 5:
+      return -1;
+
+    jump42:
+    case 5:
+      return 42;
+
+    case 1:
+      try {
+        continue jump5;
+      } finally {
+        continue jump42;
+      }
+  }
+}
+
+testNestedFinally() {
+  var events = '';
+  try {
+    try {
+      events = '$events|start';
+    } finally {
+      events = '$events|start-catch';
+    }
+    try {
+      try {
+        return;
+      } finally {
+        events = '$events|inner';
+        throw 0;
+      }
+    } finally {
+      events = '$events|middle';
+    }
+  } catch (e) {
+    events = '$events|outer-catch';
+  } finally {
+    events = '$events|outer-finally';
+  }
+  Expect.equals(
+      events,
+      '|start|start-catch|inner|middle|outer-catch|outer-finally');
+}
+
+main() {
+  Expect.isTrue(testSimpleBreak() == 3);
+  Expect.isTrue(testReturnFinally() == 42);
+  Expect.isTrue(testNestedReturnFinally() == 42);
+  Expect.isTrue(testReturnInsideLoop() == 42);
+  Expect.isTrue(testStopContinueInsideLoop() == 42);
+  Expect.isTrue(testStopBreakInsideLoop() == 42);
+  Expect.isTrue(testStopBreakInsideLoop2() == 42);
+  Expect.isTrue(testStopContinueInsideLoop() == 42);
+  Expect.isTrue(testStopContinueInsideSwitch() == 42);
+  Expect.isTrue(testStopContinueInsideSwitch2() == 42);
+  testNestedFinally();
+}
diff --git a/tests/kernel/unsorted/type_args_regression_test.dart b/tests/kernel/unsorted/type_args_regression_test.dart
new file mode 100644
index 0000000..0b88bd7
--- /dev/null
+++ b/tests/kernel/unsorted/type_args_regression_test.dart
@@ -0,0 +1,22 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+class Box<T> {
+  T value;
+
+  Box(this.value);
+
+  factory Box.a(T v) => new Box(v);
+  factory Box.b(T v) = Box<T>;
+  factory Box.c(T v) => new Box(v);
+}
+
+main() {
+  Expect.isTrue(new Box<int>(1).value == 1);
+  Expect.isTrue(new Box<int>.a(1).value == 1);
+  Expect.isTrue(new Box<int>.b(1).value == 1);
+  Expect.isTrue(new Box<int>.c(1).value == 1);
+}
diff --git a/tests/kernel/unsorted/types_test.dart b/tests/kernel/unsorted/types_test.dart
new file mode 100644
index 0000000..157f2f8
--- /dev/null
+++ b/tests/kernel/unsorted/types_test.dart
@@ -0,0 +1,202 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+class TypeTester<T> {
+  const TypeTester();
+  bool isCorrectType(object) => object is T;
+}
+
+class ClosureTypeTester<T> {
+  const ClosureTypeTester();
+  bool isCorrectType(object) => (() => object is T)();
+}
+
+class Base<A, B> {
+  final A a;
+  final B b;
+  const Base(this.a, this.b);
+  const factory Base.fac(A a, B b) = Base<A, B>;
+}
+
+class Sub1<C, D> extends Base<C, C> {
+  final D d;
+  const Sub1(C a, this.d) : super(a, a);
+  const factory Sub1.fac(C a, D d) = Sub1<C, D>;
+}
+
+class Sub2<C, D> extends Base<D, C> {
+  const Sub2(C a, D b) : super(b, a);
+  const factory Sub2.fac(C a, D b) = Sub2<C, D>;
+}
+
+class G<T> { }
+class I { }
+class A implements I { }
+class B extends A { }
+class C {}
+
+testConstantLiteralTypes() {
+  Expect.isTrue(const [1] is List);
+  Expect.isTrue(const [1] is List<int>);
+  Expect.isTrue(const [1] is List<String>);
+  Expect.isTrue(const <int>[1] is List);
+  Expect.isTrue(const <int>[1] is List<int>);
+  Expect.isTrue(!(const <int>[1] is List<String>));
+  Expect.isTrue(const {"a": 1} is Map);
+  Expect.isTrue(const {"a": 1} is Map<String, int>);
+  Expect.isTrue(const {"a": 1} is Map<int, String>);
+  Expect.isTrue(const <String, int>{"a": 1} is Map);
+  Expect.isTrue(const <String, int>{"a": 1} is Map<String, int>);
+  Expect.isTrue(!(const <String, int>{"a": 1} is Map<int, String>));
+}
+
+testNonConstantLiteralTypes() {
+  Expect.isTrue([1] is List);
+  Expect.isTrue([1] is List<int>);
+  Expect.isTrue([1] is List<String>);
+  Expect.isTrue(<int>[1] is List);
+  Expect.isTrue(<int>[1] is List<int>);
+  Expect.isTrue(!(<int>[1] is List<String>));
+}
+
+testParametrizedClass() {
+  Expect.isTrue(new Base<int, int>(1, 1) is Base<int, int>);
+  Expect.isTrue(new Base<int, int>(1, 1) is Base);
+  Expect.isTrue(new Base<int, int>(1, 1) is Base<Object, Object>);
+  Expect.isTrue(!(new Base<int, int>(1, 1) is Base<int, String>));
+  Expect.isTrue(!(new Base<int, int>(1, 1) is Base<String, int>));
+  Expect.isTrue(new Sub1<int, String>(1, "1") is Base<int, int>);
+  Expect.isTrue(new Sub1<int, String>(1, "1") is Base);
+  Expect.isTrue(new Sub1<int, String>(1, "1") is Sub1<int, String>);
+  Expect.isTrue(new Sub1<int, String>(1, "1") is Sub1);
+  Expect.isTrue(!(new Sub1<int, String>(1, "1") is Base<String, int>));
+  Expect.isTrue(!(new Sub1<int, String>(1, "1") is Base<int, String>));
+  Expect.isTrue(!(new Sub1<int, String>(1, "1") is Sub1<String, String>));
+  Expect.isTrue(new Sub2<int, String>(1, "1") is Base<String, int>);
+  Expect.isTrue(new Sub2<int, String>(1, "1") is Base);
+  Expect.isTrue(new Sub2<int, String>(1, "1") is Sub2<int, String>);
+  Expect.isTrue(new Sub2<int, String>(1, "1") is Sub2);
+  Expect.isTrue(!(new Sub2<int, String>(1, "1") is Base<int, int>));
+  Expect.isTrue(!(new Sub2<int, String>(1, "1") is Base<int, String>));
+  Expect.isTrue(!(new Sub2<int, String>(1, "1") is Sub2<String, String>));
+}
+
+testTypeTester() {
+  Expect.isTrue(new TypeTester<int>().isCorrectType(10));
+  Expect.isTrue(!new TypeTester<int>().isCorrectType("abc"));
+  Expect.isTrue(new TypeTester<List<int>>().isCorrectType([1]));
+  Expect.isTrue(new TypeTester<List<int>>().isCorrectType(<int>[1]));
+  Expect.isTrue(!new TypeTester<List<int>>().isCorrectType(<String>["1"]));
+  Expect.isTrue(new TypeTester<Base<String, int>>()
+      .isCorrectType(new Sub2<int, String>(1, "1")));
+  Expect.isTrue(new TypeTester<Sub2<int, String>>()
+      .isCorrectType(new Sub2<int, String>(1, "1")));
+}
+
+testClosureTypeTester() {
+  Expect.isTrue(new ClosureTypeTester<int>().isCorrectType(10));
+  Expect.isTrue(!new ClosureTypeTester<int>().isCorrectType("abc"));
+  Expect.isTrue(new ClosureTypeTester<List<int>>().isCorrectType([1]));
+  Expect.isTrue(new ClosureTypeTester<List<int>>().isCorrectType(<int>[1]));
+  Expect.isTrue(!new ClosureTypeTester<List<int>>()
+      .isCorrectType(<String>["1"]));
+  Expect.isTrue(new ClosureTypeTester<Base<String, int>>()
+      .isCorrectType(new Sub2<int, String>(1, "1")));
+  Expect.isTrue(new ClosureTypeTester<Sub2<int, String>>()
+      .isCorrectType(new Sub2<int, String>(1, "1")));
+}
+
+testConstTypeArguments() {
+  Expect.isTrue(const Sub1<int, String>(1, "1") is Sub1<int, String>);
+  Expect.isTrue(const Sub1<int, String>.fac(1, "1") is Sub1<int, String>);
+  Expect.isTrue(!(const Sub1<int, String>(1, "1") is Sub1<String, String>));
+  Expect.isTrue(!(const Sub1<int, String>.fac(1, "1") is Sub1<String, String>));
+
+  Expect.isTrue(const ClosureTypeTester<List<Base<int, String>>>()
+      .isCorrectType(
+       const <Base<int, String>>[const Base<int, String>(1, "2")]));
+  Expect.isTrue(const ClosureTypeTester<List<Base<int, String>>>()
+      .isCorrectType(
+       const <Base<int, String>>[const Base<int, String>.fac(1, "2")]));
+  Expect.isTrue(!const ClosureTypeTester<List<Base<int, String>>>()
+      .isCorrectType(
+       const <Base<String, String>>[const Base<String, String>("1", "2")]));
+  Expect.isTrue(!const ClosureTypeTester<List<Base<int, String>>>()
+      .isCorrectType(
+       const <Base<String, String>>[const Base<String, String>.fac("1", "2")]));
+
+  Expect.isTrue(const TypeTester<Sub2<int, String>>()
+      .isCorrectType(const Sub2<int, String>(1, "1")));
+  Expect.isTrue(const TypeTester<Sub2<int, String>>()
+      .isCorrectType(const Sub2<int, String>.fac(1, "1")));
+  Expect.isTrue(!const TypeTester<Sub2<int, String>>()
+      .isCorrectType(const Sub2<String, String>("a", "b")));
+  Expect.isTrue(!const TypeTester<Sub2<int, String>>()
+      .isCorrectType(const Sub2<String, String>.fac("a", "b")));
+}
+
+testNoBound() {
+  new G<int>();
+  new G<num>();
+  new G<Function>();
+  new G<Object>();
+  new G();
+  new G();
+  new G<G>();
+}
+
+testSubtypeChecker() {
+  Expect.isTrue(new TypeTester<num>().isCorrectType(1));
+  Expect.isTrue(new TypeTester<num>().isCorrectType(1.0));
+  Expect.isTrue(new TypeTester<A>().isCorrectType(new B()));
+  Expect.isTrue(new TypeTester<Object>().isCorrectType(new C()));
+  Expect.isTrue(new TypeTester<I>().isCorrectType(new A()));
+}
+
+testFunctionTypes() {
+  fun(int x, String y) => "${x}${y}";
+  Expect.isTrue(fun is FunctionType);
+  Expect.isTrue(nan is FunctionType);
+  Expect.isTrue(nan is Function);
+}
+
+num nan(double d, Pattern p) => double.NAN;
+
+typedef int FunctionType(num _, Pattern __);
+
+
+testLiteralTypeArguments() {
+  Expect.isTrue(new Foo<String, int>().foo() is List<String>);
+  Expect.isTrue(new Foo<int, String>().bar() is Map<int, String>);
+}
+
+class Foo<T1, T2> {
+  foo() => <T1>[];
+  bar() => <T1, T2>{};
+}
+
+regressionTest1() {
+  Expect.isTrue(!StaticTypeTester.isInt('abc'));
+}
+
+class StaticTypeTester<T> {
+  static isInt(x) => x is int;
+}
+
+main() {
+  testConstantLiteralTypes();
+  testNonConstantLiteralTypes();
+  testParametrizedClass();
+  testTypeTester();
+  testClosureTypeTester();
+  testConstTypeArguments();
+  testNoBound();
+  testSubtypeChecker();
+  testFunctionTypes();
+  testLiteralTypeArguments();
+  regressionTest1();
+}
+
diff --git a/tests/language/deferred_not_loaded_check_test.dart b/tests/language/deferred_not_loaded_check_test.dart
index 5c48da3..70be80f 100644
--- a/tests/language/deferred_not_loaded_check_test.dart
+++ b/tests/language/deferred_not_loaded_check_test.dart
@@ -12,6 +12,12 @@
 
 var c;
 
+expectSideEffect(test) {
+  c = 0;
+  test();
+  Expect.isTrue(c == 1);
+}
+
 expectNoSideEffect(test) {
   c = 0;
   test();
@@ -28,7 +34,7 @@
 }
 
 void main() {
-  expectNoSideEffect(() {
+  expectSideEffect(() {
     expectThrowsNotLoaded(() {
       lib.foo(sideEffect());
     });
@@ -38,7 +44,7 @@
       lib.C.foo(sideEffect());
     });
   });
-  expectNoSideEffect(() {
+  expectSideEffect(() {
     expectThrowsNotLoaded(() {
       new lib.C(sideEffect());
     });
@@ -46,7 +52,7 @@
   expectThrowsNotLoaded(() {
     lib.a;
   });
-  expectNoSideEffect(() {
+  expectSideEffect(() {
     expectThrowsNotLoaded(() {
       lib.a = sideEffect();
     });
@@ -54,7 +60,7 @@
   expectThrowsNotLoaded(() {
     lib.getter;
   });
-  expectNoSideEffect(() {
+  expectSideEffect(() {
     expectThrowsNotLoaded(() {
       lib.setter = sideEffect();
     });
@@ -64,7 +70,7 @@
       lib.list[sideEffect()] = sideEffect();
     });
   });
-  expectNoSideEffect(() {
+  expectSideEffect(() {
     expectThrowsNotLoaded(() {
       lib.closure(sideEffect());
     });
diff --git a/tests/language/efficient_length_warning_test.dart b/tests/language/efficient_length_warning_test.dart
new file mode 100644
index 0000000..5edfc72
--- /dev/null
+++ b/tests/language/efficient_length_warning_test.dart
@@ -0,0 +1,16 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// Third dart test program.
+
+import "dart:math";
+
+main() {
+  // This should no longer cause a warning because the least-upper-bound
+  // of List<int> and Set<int> is Object.
+  // The LUB is now EfficientLengthIterable and it extends Iterable.
+  var x = (new Random().nextBool() // Unpredictable condition.
+      ? <int>[1]
+      : new Set<int>.from([1])).first;
+  if (x != 1) throw "Wat?";
+}
diff --git a/tests/language/field_test.dart b/tests/language/field_test.dart
index 6a1937f..ca41740 100644
--- a/tests/language/field_test.dart
+++ b/tests/language/field_test.dart
@@ -52,11 +52,11 @@
     // The tests below are a little cumbersome because not
     // everything is implemented yet.
     var o = new Second();
-    // 'a' getter is overriden, always returns -12.
+    // 'a' getter is overridden, always returns -12.
     Expect.equals(-12, o.a);
     o.a = 2;
     Expect.equals(-12, o.a);
-    // 'b' setter is overriden to write 12 to field 'c'.
+    // 'b' setter is overridden to write 12 to field 'c'.
     o.b = o;
     Expect.equals(12, o.c);
   }
diff --git a/tests/language/generic_functions_test.dart b/tests/language/generic_functions_test.dart
index 0e6d5b3..f7ae6bb 100644
--- a/tests/language/generic_functions_test.dart
+++ b/tests/language/generic_functions_test.dart
@@ -2,7 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 //
-// DartOptions=--generic-method-syntax
 // VMOptions=--generic-method-syntax
 
 /// Dart test verifying that the parser can handle type parameterization of
diff --git a/tests/language/generic_local_functions_test.dart b/tests/language/generic_local_functions_test.dart
index 1b363d1..7b85297 100644
--- a/tests/language/generic_local_functions_test.dart
+++ b/tests/language/generic_local_functions_test.dart
@@ -2,7 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 //
-// DartOptions=--generic-method-syntax
 // VMOptions=--generic-method-syntax
 
 /// Dart test verifying that the parser can handle type parameterization of
diff --git a/tests/language/generic_methods_function_type_test.dart b/tests/language/generic_methods_function_type_test.dart
index 23c1992..d82a0b4 100644
--- a/tests/language/generic_methods_function_type_test.dart
+++ b/tests/language/generic_methods_function_type_test.dart
@@ -2,7 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 //
-// DartOptions=--generic-method-syntax
 // VMOptions=--generic-method-syntax
 
 /// Dart test on the usage of method type arguments in a function typed
diff --git a/tests/language/generic_methods_generic_function_parameter_test.dart b/tests/language/generic_methods_generic_function_parameter_test.dart
index 81eeade..45014c4 100644
--- a/tests/language/generic_methods_generic_function_parameter_test.dart
+++ b/tests/language/generic_methods_generic_function_parameter_test.dart
@@ -2,7 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 //
-// DartOptions=--generic-method-syntax
 // VMOptions=--generic-method-syntax
 
 import "package:expect/expect.dart";
diff --git a/tests/language/generic_methods_new_test.dart b/tests/language/generic_methods_new_test.dart
index 0836fd5..83359f1 100644
--- a/tests/language/generic_methods_new_test.dart
+++ b/tests/language/generic_methods_new_test.dart
@@ -2,7 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 //
-// DartOptions=--generic-method-syntax
 // VMOptions=--generic-method-syntax
 
 /// Dart test on the usage of method type arguments in object creation. With
diff --git a/tests/language/generic_methods_test.dart b/tests/language/generic_methods_test.dart
index ec7d488..e32526a 100644
--- a/tests/language/generic_methods_test.dart
+++ b/tests/language/generic_methods_test.dart
@@ -2,7 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 //
-// DartOptions=--generic-method-syntax
 // VMOptions=--generic-method-syntax
 
 /// Dart test verifying that the parser can handle type parameterization of
diff --git a/tests/language/generic_methods_type_expression_test.dart b/tests/language/generic_methods_type_expression_test.dart
index dd98c7a..ccf24bc 100644
--- a/tests/language/generic_methods_type_expression_test.dart
+++ b/tests/language/generic_methods_type_expression_test.dart
@@ -2,7 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 //
-// DartOptions=--generic-method-syntax
 // VMOptions=--generic-method-syntax
 
 /// Dart test on the usage of method type arguments in type expressions. With
@@ -51,8 +50,8 @@
   Expect.throws(() => f3<String>(42), (e) => e is TypeError);
   Expect.equals(f4<int>(<int>[42]), false);
   Expect.equals(f4<String>(<int>[42]), false); // `is! List<dynamic>` is false.
-  Expect.throws(() => f5<String>(s), (e) => e is TypeError);
-  Expect.throws(() => f5<int>(s), (e) => e is TypeError);
+  Expect.equals(f5<String>(s), s); // `s as dynamic == s`
+  Expect.equals(f5<int>(s), s); // `s as dynamic == s`
   Expect.equals(f6<String>(ss), ss);
   Expect.equals(f6<int>(ss), ss); // `as List<dynamic>` succeeds.
   Expect.throws(() => f7<int>(), (e) => e is TypeError);
diff --git a/tests/language/generic_sends_test.dart b/tests/language/generic_sends_test.dart
index 75c7dc9..68e50fe 100644
--- a/tests/language/generic_sends_test.dart
+++ b/tests/language/generic_sends_test.dart
@@ -2,7 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 //
-// DartOptions=--generic-method-syntax
 // VMOptions=--generic-method-syntax
 
 /// Dart test verifying that the parser can handle certain cases where
diff --git a/tests/language/initializing_formal_promotion_test.dart b/tests/language/initializing_formal_promotion_test.dart
index 5f0a3b6..89ec79e 100644
--- a/tests/language/initializing_formal_promotion_test.dart
+++ b/tests/language/initializing_formal_promotion_test.dart
@@ -11,12 +11,8 @@
 
 class A {
   B x, y;
-  A(this.x) {
-    // Promote to subtype.
-    if (x is C) y = x.x;
-    // Promotion fails, not a subtype.
-    if (x is A) y = x;
-  }
+  // Promotion occurs for the initializing formal because C <: B.
+  A(this.x) : y = (x is C) ? x.x : x;
 }
 
 class C extends A implements B {
@@ -24,8 +20,8 @@
 }
 
 main() {
-  C c2 = new C(null);
-  C cc = new C(c2);
-  Expect.equals(c2.y, null);
-  Expect.equals(cc.y, c2);
+  C c = new C(null);
+  C cc = new C(c);
+  Expect.equals(c.y, null);
+  Expect.equals(cc.y, null);
 }
diff --git a/tests/language/initializing_formal_type_test.dart b/tests/language/initializing_formal_type_test.dart
index 7544f9d..af44444 100644
--- a/tests/language/initializing_formal_type_test.dart
+++ b/tests/language/initializing_formal_type_test.dart
@@ -8,9 +8,14 @@
 import "package:expect/expect.dart";
 
 class A {
-  int x;
-  String y;
-  A(this.x) : y = x { y = x; }
+  num x;
+  double y;
+  // Finding the type of an initializing formal: should cause a warning
+  // in the initializer but not the body, because the former has type
+  // `int` and the latter has type `num`.
+  A(int this.x) : y = x {
+    y = x;
+  }
 }
 
 main() {
diff --git a/tests/language/language.status b/tests/language/language.status
index de99e84..c0489a5 100644
--- a/tests/language/language.status
+++ b/tests/language/language.status
@@ -5,11 +5,9 @@
 # This directory contains tests that are intended to show the
 # current state of the language.
 
-[ ($compiler == dart2app || $compiler == dart2appjit) ]
-string_literals_test: Skip # Issue 27433
-
 [ ($compiler == none || $compiler == precompiler || $compiler == dart2app || $compiler == dart2appjit) ]
 tearoff_constructor_basic_test: Skip # Crashes in checked mode -- hausner investigating
+generic_methods_type_expression_test: RuntimeError # Issue 25869
 
 # This is OK for now, but we may want to change the semantics to match the test.
 async_star_pause_test: Fail, OK
@@ -50,15 +48,18 @@
 async_star_regression_2238_test: CompileTimeError, RuntimeError # drt only runtime-errs.
 async_star_cancel_while_paused_test: RuntimeError
 
+# Fails because `as T` is an error rather than being treated like `as dynamic`.
+generic_methods_type_expression_test: RuntimeError # Issue 27460
+
 [ ($compiler == none || $compiler == precompiler || $compiler == dart2app || $compiler == dart2appjit) && $checked ]
-# The generic functions tests fail in checked mode because the parsed type parameters
-# are ignored.
-generic_methods_function_type_test: RuntimeError # Issue 25869
-generic_methods_test: RuntimeError # Issue 25869
-generic_methods_new_test: RuntimeError # Issue 25869
-generic_local_functions_test: RuntimeError # Issue 25869
-generic_functions_test: RuntimeError # Issue 25869
-generic_methods_generic_function_parameter_test: RuntimeError # Issue 25869
+# These generic functions tests pass for the wrong reason in checked mode,
+# because the parsed type parameters are mapped to dynamic type.
+generic_methods_function_type_test: Pass # Issue 25869
+generic_methods_test: Pass # Issue 25869
+generic_methods_new_test: Pass # Issue 25869
+generic_local_functions_test: Pass # Issue 25869
+generic_functions_test: Pass # Issue 25869
+generic_methods_generic_function_parameter_test: Pass # Issue 25869
 
 [ ($compiler == none || $compiler == precompiler || $compiler == dart2app || $compiler == dart2appjit) && ($runtime == vm || $runtime == dart_precompiled || $runtime == dart_app) ]
 
@@ -90,7 +91,6 @@
 [ $compiler == none && ($runtime == dartium || $runtime == drt) ]
 issue13474_test: Pass, Fail # Issue 14651.
 config_import_test: Fail # Issue 14651.
-generic_methods_generic_function_parameter_test: RuntimeError # Issue 25869
 vm/optimized_guarded_field_isolates_test: RuntimeError, OK  # Uses Isolate.spawn.
 main_test/01: Fail # Issue 20028
 main_test/02: Fail # Issue 20028
@@ -105,7 +105,9 @@
 initializing_formal_access_test: Skip
 initializing_formal_capture_test: Skip
 initializing_formal_final_test: Skip
+initializing_formal_promotion_test: Skip
 initializing_formal_type_test: Skip
+parameter_initializer5_test: Skip
 
 # Experimental feature: Syntactic support for generic methods.
 # Skip these in dartium, because the test framework can't pass VM flags to
@@ -139,6 +141,9 @@
 
 [ ($runtime == vm || $runtime == dart_precompiled || $runtime == dart_app) && ( $arch == simarm || $arch == arm || $arch == simarmv6 || $arch == armv6 || $arch == simarmv5te || $arch == armv5te || $arch == simarm64 || $arch == arm64 || $arch == simmips || $arch == mips) ]
 vm/load_to_load_unaligned_forwarding_vm_test: Pass, Crash # Unaligned offset. Issue 22151
+vm/unaligned_float_access_literal_index_test: Pass, Crash # Unaligned offset. Issue 22151
+vm/unaligned_float_access_literal_index_test: Pass, Crash # Unaligned offset. Issue 22151
+
 
 [ $compiler == none && ($runtime == dartium || $runtime == drt) ]
 issue23244_test: Fail # Issue 23244
@@ -146,6 +151,9 @@
 [ ($compiler == none || $compiler == precompiler || $compiler == dart2app || $compiler == dart2appjit) && (($runtime == vm || $runtime == dart_precompiled || $runtime == dart_app) || $runtime == drt || $runtime == dartium) && $arch == ia32 ]
 vm/regress_24517_test: Pass, Fail # Issue 24517.
 
+[ $compiler == precompiler && $runtime == dart_precompiled ]
+vm/regress_27671_test: Skip # Unsupported
+
 [ $noopt || $compiler == precompiler ]
 # Stacktraces in precompilation omit inlined frames.
 full_stacktrace1_test: Pass, RuntimeError
@@ -180,24 +188,39 @@
 super_getter_setter_test: SkipByDesign
 vm/reflect_core_vm_test: SkipByDesign
 
-[ $noopt || $compiler == precompiler || $compiler == dart2app || $compiler == dart2appjit || $mode == product ]
-# Deferred loading happens eagerly
-regress_23408_test: Skip
-deferred_inheritance_constraints_test: Skip
-deferred_global_test: Skip
-deferred_load_constants_test: Skip
-tearoff_basic_test: Skip
-deferred_static_seperate_test: Skip
-deferred_constraints_type_annotation_test/new_before_load: Skip
-regress_22443_test: Skip
+[ $noopt ]
+# Deferred loading happens eagerly. Issue #27587
+regress_23408_test: Fail
+deferred_inheritance_constraints_test/redirecting_constructor: Fail
+deferred_global_test: Fail
+deferred_load_constants_test/02: Fail
+deferred_load_constants_test/03: Fail
+deferred_load_constants_test/05: Fail
+tearoff_basic_test: Fail
+regress_22443_test: Fail
+deferred_not_loaded_check_test: Fail
+vm/regress_27201_test: Fail
+
+[ $mode == product || $compiler == dart2appjit || $compiler == dart2app || $compiler == precompiler ]
+# Deferred loading happens eagerly. Issue #27587
+regress_23408_test: Fail
+deferred_inheritance_constraints_test/redirecting_constructor: Fail
+deferred_load_constants_test/02: Fail
+deferred_load_constants_test/03: Fail
+deferred_load_constants_test/05: Fail
+tearoff_basic_test: Fail
+deferred_not_loaded_check_test: Fail
+vm/regress_27201_test: Fail
+
+[ $compiler == precompiler ]
+# Deferred loading happens eagerly. Issue #27587
+deferred_global_test: Fail
+vm/regress_27201_test: Fail
 
 [ $compiler == precompiler || $compiler == dart2app || $compiler == dart2appjit ]
 ct_const2_test: Skip # Incompatible flag: --compile_all
 hello_dart_test: Skip # Incompatible flag: --compile_all
 
-[ $runtime == dart_app ]
-number_identity_test: RuntimeError # Issue 26873
-
 [ $compiler == precompiler ]
 implicit_closure_test: Skip # Incompatible flag: --use_slow_path
 deopt_inlined_function_lazy_test: Skip # Incompatible flag: --deoptimize-alot
@@ -240,15 +263,6 @@
 # The following tests are supposed to fail.
 library_env_test/has_mirror_support: RuntimeError, OK
 
-[ $arch == simdbc || $arch == simdbc64 ]
-# TODO(vegorov) Encoding limitation: StoreField bytecode only supports 256
-# fields in an object.
-large_class_declaration_test: Skip
-
-[ $compiler == precompiler && $runtime == dart_precompiled && $system == android ]
-vm/optimized_guarded_field_isolates_test: Skip # Issue #26373
-issue23244_test: Skip # Issue #26373
-
 [ $hot_reload || $hot_reload_rollback ]
 static_closure_identical_test: Pass, Fail # Closure identity
 cha_deopt1_test: Crash # Requires deferred libraries
@@ -285,6 +299,11 @@
 tearoff_basic_test: Crash # Requires deferred libraries
 conditional_import_test: Crash # Requires deferred libraries
 conditional_import_string_test: Crash # Requires deferred libraries
+override_field_method1_negative_test: Pass, Crash # Issue 27835
+override_field_method2_negative_test: Pass, Crash # Issue 27835
+override_field_method4_negative_test: Pass, Crash # Issue 27835
+override_field_method5_negative_test: Pass, Crash # Issue 27835
+vm/regress_27201_test: Pass, Crash # Requires deferred libraries
 
 [$runtime != vm || $compiler != none]
 assert_initializer_test: SKIP  # not implemented yet, experiment is VM only.
@@ -297,3 +316,9 @@
 # The VM doesn't enforce that potentially const expressions are actually
 # const expressions when the constructor is called with `const`.
 assert_initializer_test/4*: MissingCompileTimeError # Issue 392.
+
+[$runtime == vm && $compiler == none]
+duplicate_part_test/01: MissingCompileTimeError # Issue 27516
+
+[$compiler == dart2analyzer]
+vm/regress_27201_test: SkipByDesign # Loads bad library, so will always crash.
diff --git a/tests/language/language_analyzer2.status b/tests/language/language_analyzer2.status
index cb9c4b0c..72203db 100644
--- a/tests/language/language_analyzer2.status
+++ b/tests/language/language_analyzer2.status
@@ -5,6 +5,7 @@
 [ $compiler == dart2analyzer ]
 
 regress_26668_test: Fail # Issue 26678
+regress_27617_test/1: MissingCompileTimeError
 
 # Runtime negative test. No static errors or warnings.
 closure_call_wrong_argument_count_negative_test: skip
@@ -355,7 +356,6 @@
 parameter_initializer2_negative_test: CompileTimeError
 parameter_initializer3_negative_test: CompileTimeError
 parameter_initializer4_negative_test: CompileTimeError
-parameter_initializer5_negative_test: CompileTimeError
 parameter_initializer6_negative_test: CompileTimeError
 parser_quirks_test: StaticWarning
 part2_test: StaticWarning
@@ -409,7 +409,6 @@
 switch3_negative_test: CompileTimeError
 switch4_negative_test: CompileTimeError
 switch5_negative_test: CompileTimeError
-switch6_test: StaticWarning
 switch7_negative_test: CompileTimeError
 switch_fallthru_test: StaticWarning
 test_negative_test: CompileTimeError
@@ -498,15 +497,10 @@
 for_in_side_effects_test: StaticWarning, OK # Test uses custom class that does not implement Iterable in for-in.
 
 # Experimental feature: Syntactic support for generic methods.
-generic_functions_test: CompileTimeError # Issue 25868
-generic_local_functions_test: CompileTimeError # Issue 25868
-generic_methods_test: CompileTimeError # Issue 25868
-generic_sends_test: CompileTimeError # Issue 25868
-generic_methods_new_test: CompiletimeError # Issue 25868
-generic_methods_function_type_test: CompiletimeError # Issue 25868
-generic_methods_type_expression_test: CompiletimeError # Issue 25868
-generic_methods_generic_function_parameter_test: CompiletimeError # Issue 25868
+generic_methods_type_expression_test: StaticWarning # Issue 25868
+generic_methods_generic_function_parameter_test: StaticWarning # Issue 25868
 
 # Experimental feature: Use initializing formals in initializers and constructor body.
-initializing_formal_promotion_test: StaticWarning # Issue 26658
 initializing_formal_type_test: StaticWarning # Issue 26658
+
+regress_27572_test: StaticWarning # Warning about undefined method expected.
diff --git a/tests/language/language_dart2js.status b/tests/language/language_dart2js.status
index 03c99a9..4d5379c 100644
--- a/tests/language/language_dart2js.status
+++ b/tests/language/language_dart2js.status
@@ -3,6 +3,7 @@
 # BSD-style license that can be found in the LICENSE file.
 
 [ $compiler == dart2js ]
+deferred_not_loaded_check_test: Fail # Issue 27577
 getter_setter_in_lib_test: Fail # Issue 23288
 method_name_test: Fail # issue 25574
 setter4_test: CompileTimeError # issue 13639
@@ -36,6 +37,8 @@
 accessor_conflict_import_prefixed_test: RuntimeError # Issue 25626
 accessor_conflict_import_test: RuntimeError # Issue 25626
 
+duplicate_part_test/01: MissingCompileTimeError # Issue 27517
+
 [ $compiler == dart2js && $fast_startup ]
 const_evaluation_test/*: Fail # mirrors not supported
 deferred_constraints_constants_test/none: Fail # mirrors not supported
@@ -77,22 +80,6 @@
 [ $compiler == dart2js && $browser ]
 config_import_test: Fail # Test flag is not passed to the compiler.
 
-# Experimental feature: Syntactic support for generic methods.
-generic_functions_test: CompileTimeError # DartOptions not passed to compiler.
-generic_local_functions_test: CompileTimeError # DartOptions not passed to compiler.
-generic_methods_test: CompileTimeError # DartOptions not passed to compiler.
-generic_sends_test: CompileTimeError # DartOptions not passed to compiler.
-generic_methods_new_test: CompiletimeError # DartOptions not passed to compiler.
-generic_methods_function_type_test: CompiletimeError # DartOptions not passed to compiler.
-generic_methods_type_expression_test: CompiletimeError # DartOptions not passed to compiler.
-generic_methods_generic_function_parameter_test: CompiletimeError # DartOptions not passed to compiler.
-
-# Experimental feature: Use initializing formals in initializers and constructor body.
-initializing_formal_access_test: CompiletimeError # DartOptions not passed to compiler.
-initializing_formal_capture_test: CompiletimeError # DartOptions not passed to compiler.
-initializing_formal_final_test: CompiletimeError # DartOptions not passed to compiler.
-initializing_formal_type_test: CompiletimeError # DartOptions not passed to compiler.
-
 library_env_test/has_no_io_support: Pass # Issue 27398
 library_env_test/has_io_support: RuntimeError # Issue 27398
 
@@ -263,7 +250,10 @@
 [ $compiler == dart2js && $runtime == chrome && $system == macos ]
 await_future_test: Pass, Timeout # Issue 26735
 
-[ $compiler == dart2js && ($runtime == safari || $runtime == safarimobilesim)]
+[ $compiler == dart2js && ($runtime == chrome || $runtime == ff) && $system == windows ]
+string_literals_test: RuntimeError # Issue 27533
+
+[ $compiler == dart2js && $runtime == safarimobilesim ]
 # Safari codegen bug, fixed on some versions of Safari 7.1 (Version 7.1 (9537.85.10.17.1))
 call_through_getter_test: Fail, OK
 
@@ -281,8 +271,6 @@
 generic_field_mixin5_test: Crash # Issue 18651
 many_method_calls_test: Crash # Stack overflow in HGraphVisitor.visitPostDominatorTree.visitBasicBlockAndSuccessors
 method_override5_test: RuntimeError # Issue 12809
-super_no_such_method4_test/01: RuntimeError # Issue 25716
-super_no_such_method5_test/01: RuntimeError # Issue 25716
 
 [ $compiler == dart2js && $runtime != drt && $runtime != dartium ]
 issue23244_test: RuntimeError # 23244
@@ -366,3 +354,6 @@
 regress_26855_test/2: Crash # Issue 26867
 regress_26855_test/3: Crash # Issue 26867
 regress_26855_test/4: Crash # Issue 26867
+
+[ $compiler != dart2analyzer]
+switch_case_warn_test: SKIP # Analyzer only, see language_analyzer2.status
diff --git a/tests/language/language_kernel.status b/tests/language/language_kernel.status
new file mode 100644
index 0000000..b5cc7b3
--- /dev/null
+++ b/tests/language/language_kernel.status
@@ -0,0 +1,676 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+# These tests currently take too long. Remove when they are fixed.
+[ $compiler == dartk || $compiler == rasta ]
+large_class_declaration_test: Skip
+large_implicit_getter_test: Skip
+larger_implicit_getter_test: Skip
+
+# dartk: JIT failures
+[ $compiler == dartk && $runtime == vm ]
+accessor_conflict_export2_test: RuntimeError
+accessor_conflict_export_test: RuntimeError
+accessor_conflict_import2_test: RuntimeError
+accessor_conflict_import_prefixed2_test: RuntimeError
+accessor_conflict_import_prefixed_test: RuntimeError
+accessor_conflict_import_test: RuntimeError
+assertion_test: RuntimeError
+async_await_test: RuntimeError
+async_star_cancel_and_throw_in_finally_test: RuntimeError
+async_star_cancel_while_paused_test: RuntimeError
+async_star_pause_test: RuntimeError
+async_star_regression_fisk_test: Timeout
+async_star_stream_take_test: Timeout
+async_star_take_reyield_test: Timeout
+async_star_test: Timeout
+asyncstar_throw_in_catch_test: Timeout
+asyncstar_yield_test: Timeout
+asyncstar_yieldstar_test: Timeout
+bad_constructor_test/05: CompileTimeError
+bad_raw_string_negative_test: Fail
+cha_deopt1_test: RuntimeError
+cha_deopt2_test: RuntimeError
+cha_deopt3_test: RuntimeError
+closure_type_variable_test: RuntimeError
+closures_initializer_test: RuntimeError
+compile_time_constant12_test: Crash
+compile_time_constant_k_test/01: RuntimeError
+compile_time_constant_k_test/02: RuntimeError
+compile_time_constant_k_test/03: RuntimeError
+compile_time_constant_o_test/01: RuntimeError
+compile_time_constant_o_test/02: RuntimeError
+conditional_import_string_test: CompileTimeError
+conditional_import_test: CompileTimeError
+config_import_test: RuntimeError
+conflicting_type_variable_and_setter_test: CompileTimeError
+const_dynamic_type_literal_test/02: RuntimeError
+const_error_multiply_initialized_test/02: RuntimeError
+const_error_multiply_initialized_test/04: RuntimeError
+const_evaluation_test/01: RuntimeError
+const_for_in_variable_test/01: MissingCompileTimeError
+const_locals_test: RuntimeError
+const_nested_test: RuntimeError
+const_string_test: RuntimeError
+constructor2_test: RuntimeError
+constructor3_test: RuntimeError
+constructor5_test: RuntimeError
+constructor6_test: RuntimeError
+constructor_duplicate_final_test/01: MissingRuntimeError
+constructor_duplicate_final_test/02: MissingRuntimeError
+constructor_duplicate_final_test/03: MissingCompileTimeError
+constructor_named_arguments_test/01: Crash
+custom_await_stack_trace_test: RuntimeError
+cyclic_type2_test: CompileTimeError
+cyclic_type_test/00: RuntimeError
+cyclic_type_test/01: RuntimeError
+cyclic_type_test/02: CompileTimeError
+cyclic_type_test/03: RuntimeError
+cyclic_type_test/04: CompileTimeError
+cyclic_type_variable_test/01: Crash
+cyclic_type_variable_test/02: Crash
+cyclic_type_variable_test/03: Crash
+cyclic_type_variable_test/04: Crash
+cyclic_type_variable_test/none: Crash
+deep_nesting1_negative_test: Crash
+deep_nesting2_negative_test: Crash
+deferred_call_empty_before_load_test: RuntimeError
+deferred_closurize_load_library_test: Crash
+deferred_constant_list_test: RuntimeError
+deferred_constraints_constants_test/none: RuntimeError
+deferred_constraints_constants_test/reference_after_load: RuntimeError
+deferred_constraints_type_annotation_test/as_operation: RuntimeError
+deferred_constraints_type_annotation_test/catch_check: RuntimeError
+deferred_constraints_type_annotation_test/is_check: RuntimeError
+deferred_constraints_type_annotation_test/new: RuntimeError
+deferred_constraints_type_annotation_test/new_before_load: RuntimeError
+deferred_constraints_type_annotation_test/new_generic1: RuntimeError
+deferred_constraints_type_annotation_test/new_generic2: RuntimeError
+deferred_constraints_type_annotation_test/new_generic3: RuntimeError
+deferred_constraints_type_annotation_test/none: RuntimeError
+deferred_constraints_type_annotation_test/static_method: RuntimeError
+deferred_constraints_type_annotation_test/type_annotation1: RuntimeError
+deferred_constraints_type_annotation_test/type_annotation_generic1: RuntimeError
+deferred_constraints_type_annotation_test/type_annotation_generic2: RuntimeError
+deferred_constraints_type_annotation_test/type_annotation_generic3: RuntimeError
+deferred_constraints_type_annotation_test/type_annotation_generic4: RuntimeError
+deferred_constraints_type_annotation_test/type_annotation_non_deferred: RuntimeError
+deferred_constraints_type_annotation_test/type_annotation_null: RuntimeError
+deferred_constraints_type_annotation_test/type_annotation_top_level: RuntimeError
+deferred_function_type_test: RuntimeError
+deferred_global_test: RuntimeError
+deferred_import_core_test: RuntimeError
+deferred_inheritance_constraints_test/redirecting_constructor: RuntimeError
+deferred_inlined_test: RuntimeError
+deferred_load_constants_test/none: RuntimeError
+deferred_load_inval_code_test: RuntimeError
+deferred_load_library_wrong_args_test/none: RuntimeError
+deferred_mixin_test: RuntimeError
+deferred_no_such_method_test: RuntimeError
+deferred_not_loaded_check_test: RuntimeError
+deferred_only_constant_test: RuntimeError
+deferred_optimized_test: RuntimeError
+deferred_redirecting_factory_test: RuntimeError
+deferred_regression_22995_test: RuntimeError
+deferred_shadow_load_library_test: RuntimeError
+deferred_shared_and_unshared_classes_test: RuntimeError
+deferred_static_seperate_test: RuntimeError
+deferred_super_dependency_test/01: RuntimeError
+deferred_type_dependency_test/as: RuntimeError
+deferred_type_dependency_test/is: RuntimeError
+deferred_type_dependency_test/none: RuntimeError
+deferred_type_dependency_test/type_annotation: RuntimeError
+duplicate_export_negative_test: Fail
+enum_duplicate_test/01: RuntimeError
+enum_duplicate_test/02: RuntimeError
+enum_duplicate_test/none: RuntimeError
+enum_mirror_test: RuntimeError
+enum_private_test/01: RuntimeError
+enum_private_test/02: RuntimeError
+enum_private_test/none: RuntimeError
+enum_syntax_test/05: MissingCompileTimeError
+enum_syntax_test/06: MissingCompileTimeError
+enum_test: RuntimeError
+evaluation_redirecting_constructor_test: RuntimeError
+example_constructor_test: RuntimeError
+export_double_same_main_test: Crash
+export_main_test: Crash
+external_test/10: MissingRuntimeError
+external_test/13: MissingRuntimeError
+external_test/20: MissingRuntimeError
+external_test/21: MissingCompileTimeError
+external_test/24: MissingCompileTimeError
+external_test/25: MissingCompileTimeError
+f_bounded_equality_test: RuntimeError
+field_initialization_order_test: RuntimeError
+final_field_initialization_order_test: RuntimeError
+final_syntax_test/01: MissingCompileTimeError
+final_syntax_test/02: MissingCompileTimeError
+final_syntax_test/03: MissingCompileTimeError
+final_syntax_test/04: MissingCompileTimeError
+fixed_type_variable2_test/02: RuntimeError
+fixed_type_variable2_test/04: RuntimeError
+fixed_type_variable2_test/06: RuntimeError
+fixed_type_variable_test/01: RuntimeError
+fixed_type_variable_test/02: RuntimeError
+fixed_type_variable_test/03: RuntimeError
+fixed_type_variable_test/04: RuntimeError
+fixed_type_variable_test/05: RuntimeError
+fixed_type_variable_test/06: RuntimeError
+for2_test: RuntimeError
+for_variable_capture_test: RuntimeError
+function_subtype2_test: RuntimeError
+function_subtype_bound_closure3_test: RuntimeError
+function_subtype_bound_closure4_test: RuntimeError
+function_subtype_cast1_test: RuntimeError
+function_subtype_inline0_test: RuntimeError
+function_subtype_local3_test: RuntimeError
+function_subtype_local4_test: RuntimeError
+function_subtype_not1_test: RuntimeError
+function_type_alias2_test: RuntimeError
+function_type_alias3_test: RuntimeError
+function_type_alias4_test: RuntimeError
+generic2_test: RuntimeError
+generic_closure_test: RuntimeError
+generic_creation_test: RuntimeError
+generic_field_mixin2_test: RuntimeError
+generic_field_mixin4_test: RuntimeError
+generic_field_mixin5_test: RuntimeError
+generic_functions_test: Crash
+generic_inheritance_test: RuntimeError
+generic_local_functions_test: Crash
+generic_methods_function_type_test: Crash
+generic_methods_generic_function_parameter_test: Crash
+generic_methods_new_test: Crash
+generic_methods_test: Crash
+generic_methods_type_expression_test: Crash
+generic_test: RuntimeError
+getter_closure_execution_order_test: RuntimeError
+getter_setter_in_lib_test: RuntimeError
+inferrer_closure_test: RuntimeError
+initializing_formal_final_test: RuntimeError
+instance_creation_in_function_annotation_test: RuntimeError
+is_not_class2_test: RuntimeError
+issue13474_test: RuntimeError
+issue_1751477_test: RuntimeError
+least_upper_bound_expansive_test/01: CompileTimeError
+least_upper_bound_expansive_test/02: CompileTimeError
+least_upper_bound_expansive_test/03: CompileTimeError
+least_upper_bound_expansive_test/04: CompileTimeError
+least_upper_bound_expansive_test/05: CompileTimeError
+least_upper_bound_expansive_test/06: CompileTimeError
+least_upper_bound_expansive_test/07: CompileTimeError
+least_upper_bound_expansive_test/08: CompileTimeError
+least_upper_bound_expansive_test/09: CompileTimeError
+least_upper_bound_expansive_test/10: CompileTimeError
+least_upper_bound_expansive_test/11: CompileTimeError
+least_upper_bound_expansive_test/12: CompileTimeError
+least_upper_bound_expansive_test/none: CompileTimeError
+library_env_test/has_html_support: RuntimeError
+library_env_test/has_no_io_support: RuntimeError
+library_env_test/has_no_mirror_support: RuntimeError
+list_literal4_test: RuntimeError
+main_not_a_function_test/01: Crash
+malformed_test/none: RuntimeError
+map_literal3_test: RuntimeError
+map_literal4_test: RuntimeError
+map_literal6_test: RuntimeError
+metadata_test: CompileTimeError
+method_override_test: RuntimeError
+mixin_generic_test: RuntimeError
+mixin_illegal_super_use_test/01: MissingCompileTimeError
+mixin_illegal_super_use_test/02: MissingCompileTimeError
+mixin_illegal_super_use_test/03: MissingCompileTimeError
+mixin_illegal_super_use_test/04: MissingCompileTimeError
+mixin_illegal_super_use_test/05: MissingCompileTimeError
+mixin_illegal_super_use_test/06: MissingCompileTimeError
+mixin_illegal_super_use_test/07: MissingCompileTimeError
+mixin_illegal_super_use_test/08: MissingCompileTimeError
+mixin_illegal_super_use_test/09: MissingCompileTimeError
+mixin_illegal_super_use_test/10: MissingCompileTimeError
+mixin_illegal_super_use_test/11: MissingCompileTimeError
+mixin_illegal_superclass_test/01: MissingCompileTimeError
+mixin_illegal_superclass_test/02: MissingCompileTimeError
+mixin_illegal_superclass_test/03: MissingCompileTimeError
+mixin_illegal_superclass_test/04: MissingCompileTimeError
+mixin_illegal_superclass_test/05: MissingCompileTimeError
+mixin_illegal_superclass_test/06: MissingCompileTimeError
+mixin_illegal_superclass_test/07: MissingCompileTimeError
+mixin_illegal_superclass_test/08: MissingCompileTimeError
+mixin_illegal_superclass_test/09: MissingCompileTimeError
+mixin_illegal_superclass_test/10: MissingCompileTimeError
+mixin_illegal_superclass_test/11: MissingCompileTimeError
+mixin_illegal_superclass_test/12: MissingCompileTimeError
+mixin_illegal_superclass_test/13: MissingCompileTimeError
+mixin_illegal_superclass_test/14: MissingCompileTimeError
+mixin_illegal_superclass_test/15: MissingCompileTimeError
+mixin_illegal_superclass_test/16: MissingCompileTimeError
+mixin_illegal_superclass_test/17: MissingCompileTimeError
+mixin_illegal_superclass_test/18: MissingCompileTimeError
+mixin_illegal_superclass_test/19: MissingCompileTimeError
+mixin_illegal_superclass_test/20: MissingCompileTimeError
+mixin_illegal_superclass_test/21: MissingCompileTimeError
+mixin_illegal_superclass_test/22: MissingCompileTimeError
+mixin_illegal_superclass_test/23: MissingCompileTimeError
+mixin_illegal_superclass_test/24: MissingCompileTimeError
+mixin_illegal_superclass_test/25: MissingCompileTimeError
+mixin_illegal_superclass_test/26: MissingCompileTimeError
+mixin_illegal_superclass_test/27: MissingCompileTimeError
+mixin_illegal_superclass_test/28: MissingCompileTimeError
+mixin_illegal_superclass_test/29: MissingCompileTimeError
+mixin_illegal_superclass_test/30: MissingCompileTimeError
+mixin_illegal_syntax_test/13: CompileTimeError
+mixin_illegal_syntax_test/none: CompileTimeError
+mixin_mixin2_test: RuntimeError
+mixin_mixin3_test: RuntimeError
+mixin_mixin4_test: RuntimeError
+mixin_mixin5_test: RuntimeError
+mixin_mixin_bound2_test: RuntimeError
+mixin_mixin_bound_test: RuntimeError
+mixin_super_test: RuntimeError
+mixin_type_parameters_simple_test: RuntimeError
+mixin_type_parameters_super_extends_test: RuntimeError
+mixin_type_parameters_super_test: RuntimeError
+multiline_newline_test/01: CompileTimeError
+multiline_newline_test/02: CompileTimeError
+multiline_newline_test/03: CompileTimeError
+multiline_newline_test/04: MissingCompileTimeError
+multiline_newline_test/05: MissingCompileTimeError
+multiline_newline_test/06: MissingCompileTimeError
+multiline_newline_test/none: RuntimeError
+named_parameters_type_test/01: MissingRuntimeError
+named_parameters_type_test/02: MissingRuntimeError
+named_parameters_type_test/03: MissingRuntimeError
+no_main_test/01: Crash
+not_enough_positional_arguments_test/01: CompileTimeError
+not_enough_positional_arguments_test/02: MissingRuntimeError
+not_enough_positional_arguments_test/05: MissingRuntimeError
+null_test/none: RuntimeError
+number_identifier_test/05: RuntimeError
+positional_parameters_type_test/01: MissingRuntimeError
+positional_parameters_type_test/02: MissingRuntimeError
+prefix10_negative_test: Fail
+prefix21_test: RuntimeError
+redirecting_constructor_initializer_test: RuntimeError
+redirecting_factory_reflection_test: RuntimeError
+regress_18713_test: RuntimeError
+regress_22443_test: RuntimeError
+regress_22700_test: RuntimeError
+regress_23408_test: RuntimeError
+regress_27164_test: CompileTimeError
+regress_27617_test/1: MissingCompileTimeError
+regress_r24720_test: RuntimeError
+reify_typevar_static_test/00: MissingCompileTimeError
+reify_typevar_test: RuntimeError
+script1_negative_test: Fail
+script2_negative_test: Fail
+setter_no_getter_call_test/none: RuntimeError
+static_setter_get_test/01: RuntimeError
+super_call3_test/01: Crash
+super_test: RuntimeError
+switch7_negative_test: Fail
+switch_try_catch_test: RuntimeError
+sync_generator3_test/test2: RuntimeError
+tearoff_basic_test: CompileTimeError
+tearoff_constructor_basic_test: CompileTimeError
+try_catch_on_syntax_test/10: MissingRuntimeError
+try_catch_on_syntax_test/11: MissingRuntimeError
+try_finally_regress_25654_test: RuntimeError
+type_checks_in_factory_method_test: RuntimeError
+type_parameter_literal_test: RuntimeError
+type_variable_conflict2_test/02: MissingCompileTimeError
+type_variable_conflict2_test/06: MissingCompileTimeError
+type_variable_conflict2_test/08: MissingCompileTimeError
+type_variable_conflict2_test/10: MissingCompileTimeError
+type_variable_function_type_test: RuntimeError
+vm/debug_break_enabled_vm_test/01: CompileTimeError
+vm/debug_break_enabled_vm_test/none: CompileTimeError
+vm/reflect_core_vm_test: CompileTimeError
+vm/type_cast_vm_test: RuntimeError
+vm/type_vm_test: RuntimeError
+
+# dartk: JIT failures (debug)
+[ $compiler == dartk && $runtime == vm && $mode == debug ]
+async_star_regression_fisk_test: Crash  # Stack mismatch during expression translation.
+async_star_test: Crash  # Stack mismatch during expression translation.
+issue23244_test: Crash  # Class finalization issue
+not_enough_positional_arguments_test/02: Crash  # Crash
+not_enough_positional_arguments_test/05: Crash  # Crash
+vm/optimized_guarded_field_isolates_test: Crash  # Class finalization issue
+generic_sends_test: Crash  # Crash
+
+# dartk: precompilation failures
+[ $compiler == dartkp && $runtime == dart_precompiled ]
+accessor_conflict_export2_test: RuntimeError
+accessor_conflict_export_test: RuntimeError
+accessor_conflict_import2_test: RuntimeError
+accessor_conflict_import_prefixed2_test: RuntimeError
+accessor_conflict_import_prefixed_test: RuntimeError
+accessor_conflict_import_test: RuntimeError
+assertion_test: RuntimeError
+async_await_test: RuntimeError
+async_star_cancel_and_throw_in_finally_test: RuntimeError
+async_star_cancel_while_paused_test: RuntimeError
+async_star_pause_test: RuntimeError
+async_star_regression_fisk_test: Timeout
+async_star_stream_take_test: Timeout
+async_star_take_reyield_test: Timeout
+async_star_test: Timeout
+asyncstar_throw_in_catch_test: Timeout
+asyncstar_yield_test: Timeout
+asyncstar_yieldstar_test: Timeout
+bad_constructor_test/05: CompileTimeError
+bad_raw_string_negative_test: Fail
+cha_deopt1_test: RuntimeError
+cha_deopt2_test: RuntimeError
+cha_deopt3_test: RuntimeError
+closure_type_variable_test: RuntimeError
+closures_initializer_test: RuntimeError
+compile_time_constant12_test: Crash
+compile_time_constant_k_test/01: RuntimeError
+compile_time_constant_k_test/02: RuntimeError
+compile_time_constant_k_test/03: RuntimeError
+compile_time_constant_o_test/01: RuntimeError
+compile_time_constant_o_test/02: RuntimeError
+conditional_import_string_test: CompileTimeError
+conditional_import_test: CompileTimeError
+config_import_test: RuntimeError
+conflicting_type_variable_and_setter_test: CompileTimeError
+const_dynamic_type_literal_test/02: RuntimeError
+const_error_multiply_initialized_test/02: RuntimeError
+const_error_multiply_initialized_test/04: RuntimeError
+const_evaluation_test/01: Crash
+const_for_in_variable_test/01: MissingCompileTimeError
+const_nested_test: RuntimeError
+constructor2_test: RuntimeError
+constructor3_test: RuntimeError
+constructor5_test: RuntimeError
+constructor6_test: RuntimeError
+constructor_duplicate_final_test/01: MissingRuntimeError
+constructor_duplicate_final_test/02: MissingRuntimeError
+constructor_duplicate_final_test/03: MissingCompileTimeError
+custom_await_stack_trace_test: RuntimeError
+cyclic_type2_test: CompileTimeError
+cyclic_type_test/00: RuntimeError
+cyclic_type_test/01: RuntimeError
+cyclic_type_test/02: CompileTimeError
+cyclic_type_test/03: RuntimeError
+cyclic_type_test/04: CompileTimeError
+cyclic_type_variable_test/01: Crash
+cyclic_type_variable_test/02: Crash
+cyclic_type_variable_test/03: Crash
+cyclic_type_variable_test/04: Crash
+cyclic_type_variable_test/none: Crash
+deep_nesting1_negative_test: Crash
+deep_nesting2_negative_test: Crash
+deferred_call_empty_before_load_test: RuntimeError
+deferred_closurize_load_library_test: Crash
+deferred_constant_list_test: RuntimeError
+deferred_constraints_constants_test/none: RuntimeError
+deferred_constraints_constants_test/reference_after_load: RuntimeError
+deferred_constraints_type_annotation_test/as_operation: RuntimeError
+deferred_constraints_type_annotation_test/catch_check: RuntimeError
+deferred_constraints_type_annotation_test/is_check: RuntimeError
+deferred_constraints_type_annotation_test/new: RuntimeError
+deferred_constraints_type_annotation_test/new_before_load: RuntimeError
+deferred_constraints_type_annotation_test/new_generic1: RuntimeError
+deferred_constraints_type_annotation_test/new_generic2: RuntimeError
+deferred_constraints_type_annotation_test/new_generic3: RuntimeError
+deferred_constraints_type_annotation_test/none: RuntimeError
+deferred_constraints_type_annotation_test/static_method: RuntimeError
+deferred_constraints_type_annotation_test/type_annotation1: RuntimeError
+deferred_constraints_type_annotation_test/type_annotation_generic1: RuntimeError
+deferred_constraints_type_annotation_test/type_annotation_generic2: RuntimeError
+deferred_constraints_type_annotation_test/type_annotation_generic3: RuntimeError
+deferred_constraints_type_annotation_test/type_annotation_generic4: RuntimeError
+deferred_constraints_type_annotation_test/type_annotation_non_deferred: RuntimeError
+deferred_constraints_type_annotation_test/type_annotation_null: RuntimeError
+deferred_constraints_type_annotation_test/type_annotation_top_level: RuntimeError
+deferred_function_type_test: RuntimeError
+deferred_global_test: RuntimeError
+deferred_import_core_test: RuntimeError
+deferred_inheritance_constraints_test/redirecting_constructor: RuntimeError
+deferred_inlined_test: RuntimeError
+deferred_load_constants_test/none: RuntimeError
+deferred_load_inval_code_test: RuntimeError
+deferred_load_library_wrong_args_test/none: RuntimeError
+deferred_mixin_test: RuntimeError
+deferred_no_such_method_test: RuntimeError
+deferred_not_loaded_check_test: RuntimeError
+deferred_only_constant_test: RuntimeError
+deferred_optimized_test: RuntimeError
+deferred_redirecting_factory_test: RuntimeError
+deferred_regression_22995_test: RuntimeError
+deferred_shadow_load_library_test: RuntimeError
+deferred_shared_and_unshared_classes_test: RuntimeError
+deferred_static_seperate_test: RuntimeError
+deferred_super_dependency_test/01: RuntimeError
+deferred_type_dependency_test/as: RuntimeError
+deferred_type_dependency_test/is: RuntimeError
+deferred_type_dependency_test/none: RuntimeError
+deferred_type_dependency_test/type_annotation: RuntimeError
+duplicate_export_negative_test: Fail
+enum_duplicate_test/01: RuntimeError
+enum_duplicate_test/02: RuntimeError
+enum_duplicate_test/none: RuntimeError
+enum_mirror_test: RuntimeError
+enum_private_test/01: RuntimeError
+enum_private_test/02: RuntimeError
+enum_private_test/none: RuntimeError
+enum_syntax_test/06: MissingCompileTimeError
+enum_test: RuntimeError
+evaluation_redirecting_constructor_test: RuntimeError
+example_constructor_test: RuntimeError
+export_double_same_main_test: Crash
+export_main_test: Crash
+external_test/10: MissingRuntimeError
+external_test/13: MissingRuntimeError
+external_test/20: MissingRuntimeError
+external_test/21: MissingCompileTimeError
+external_test/24: MissingCompileTimeError
+external_test/25: MissingCompileTimeError
+f_bounded_equality_test: RuntimeError
+field_initialization_order_test: RuntimeError
+final_field_initialization_order_test: RuntimeError
+final_syntax_test/01: MissingCompileTimeError
+final_syntax_test/02: MissingCompileTimeError
+final_syntax_test/03: MissingCompileTimeError
+final_syntax_test/04: MissingCompileTimeError
+fixed_type_variable2_test/02: RuntimeError
+fixed_type_variable2_test/04: RuntimeError
+fixed_type_variable2_test/06: RuntimeError
+fixed_type_variable_test/01: RuntimeError
+fixed_type_variable_test/02: RuntimeError
+fixed_type_variable_test/03: RuntimeError
+fixed_type_variable_test/04: RuntimeError
+fixed_type_variable_test/05: RuntimeError
+fixed_type_variable_test/06: RuntimeError
+for2_test: RuntimeError
+for_variable_capture_test: RuntimeError
+full_stacktrace1_test: RuntimeError
+full_stacktrace2_test: RuntimeError
+full_stacktrace3_test: RuntimeError
+function_subtype2_test: RuntimeError
+function_subtype_bound_closure3_test: RuntimeError
+function_subtype_bound_closure4_test: RuntimeError
+function_subtype_cast1_test: RuntimeError
+function_subtype_inline0_test: RuntimeError
+function_subtype_local3_test: RuntimeError
+function_subtype_local4_test: RuntimeError
+function_subtype_not1_test: RuntimeError
+function_type_alias2_test: RuntimeError
+function_type_alias3_test: RuntimeError
+function_type_alias4_test: RuntimeError
+generic2_test: RuntimeError
+generic_closure_test: RuntimeError
+generic_creation_test: RuntimeError
+generic_field_mixin2_test: RuntimeError
+generic_field_mixin4_test: RuntimeError
+generic_field_mixin5_test: RuntimeError
+generic_functions_test: Crash
+generic_inheritance_test: RuntimeError
+generic_local_functions_test: Crash
+generic_methods_function_type_test: Crash
+generic_methods_generic_function_parameter_test: Crash
+generic_methods_new_test: Crash
+generic_methods_test: Crash
+generic_methods_type_expression_test: Crash
+generic_test: RuntimeError
+getter_closure_execution_order_test: RuntimeError
+getter_setter_in_lib_test: RuntimeError
+if_null_assignment_static_test/35: Crash
+inferrer_closure_test: RuntimeError
+initializing_formal_final_test: RuntimeError
+instance_creation_in_function_annotation_test: Crash
+invocation_mirror_invoke_on2_test: Crash
+is_not_class2_test: RuntimeError
+issue13474_test: RuntimeError
+issue21079_test: Crash
+issue_1751477_test: RuntimeError
+large_class_declaration_test: Timeout
+least_upper_bound_expansive_test/01: CompileTimeError
+least_upper_bound_expansive_test/02: CompileTimeError
+least_upper_bound_expansive_test/03: CompileTimeError
+least_upper_bound_expansive_test/04: CompileTimeError
+least_upper_bound_expansive_test/05: CompileTimeError
+least_upper_bound_expansive_test/06: CompileTimeError
+least_upper_bound_expansive_test/07: CompileTimeError
+least_upper_bound_expansive_test/08: CompileTimeError
+least_upper_bound_expansive_test/09: CompileTimeError
+least_upper_bound_expansive_test/10: CompileTimeError
+least_upper_bound_expansive_test/11: CompileTimeError
+least_upper_bound_expansive_test/12: CompileTimeError
+least_upper_bound_expansive_test/none: CompileTimeError
+library_env_test/has_html_support: RuntimeError
+library_env_test/has_mirror_support: RuntimeError
+library_env_test/has_no_io_support: RuntimeError
+list_literal4_test: RuntimeError
+main_not_a_function_test/01: Crash
+malformed_test/none: RuntimeError
+map_literal3_test: RuntimeError
+map_literal4_test: RuntimeError
+map_literal6_test: RuntimeError
+metadata_test: CompileTimeError
+method_override_test: RuntimeError
+mixin_generic_test: RuntimeError
+mixin_illegal_super_use_test/01: MissingCompileTimeError
+mixin_illegal_super_use_test/02: MissingCompileTimeError
+mixin_illegal_super_use_test/03: MissingCompileTimeError
+mixin_illegal_super_use_test/04: MissingCompileTimeError
+mixin_illegal_super_use_test/05: MissingCompileTimeError
+mixin_illegal_super_use_test/06: MissingCompileTimeError
+mixin_illegal_super_use_test/07: MissingCompileTimeError
+mixin_illegal_super_use_test/08: MissingCompileTimeError
+mixin_illegal_super_use_test/09: MissingCompileTimeError
+mixin_illegal_super_use_test/10: MissingCompileTimeError
+mixin_illegal_super_use_test/11: MissingCompileTimeError
+mixin_illegal_superclass_test/01: MissingCompileTimeError
+mixin_illegal_superclass_test/02: MissingCompileTimeError
+mixin_illegal_superclass_test/03: MissingCompileTimeError
+mixin_illegal_superclass_test/04: MissingCompileTimeError
+mixin_illegal_superclass_test/05: MissingCompileTimeError
+mixin_illegal_superclass_test/06: MissingCompileTimeError
+mixin_illegal_superclass_test/07: MissingCompileTimeError
+mixin_illegal_superclass_test/08: MissingCompileTimeError
+mixin_illegal_superclass_test/09: MissingCompileTimeError
+mixin_illegal_superclass_test/10: MissingCompileTimeError
+mixin_illegal_superclass_test/11: MissingCompileTimeError
+mixin_illegal_superclass_test/12: MissingCompileTimeError
+mixin_illegal_superclass_test/13: MissingCompileTimeError
+mixin_illegal_superclass_test/14: MissingCompileTimeError
+mixin_illegal_superclass_test/15: MissingCompileTimeError
+mixin_illegal_superclass_test/16: MissingCompileTimeError
+mixin_illegal_superclass_test/17: MissingCompileTimeError
+mixin_illegal_superclass_test/18: MissingCompileTimeError
+mixin_illegal_superclass_test/19: MissingCompileTimeError
+mixin_illegal_superclass_test/20: MissingCompileTimeError
+mixin_illegal_superclass_test/21: MissingCompileTimeError
+mixin_illegal_superclass_test/22: MissingCompileTimeError
+mixin_illegal_superclass_test/23: MissingCompileTimeError
+mixin_illegal_superclass_test/24: MissingCompileTimeError
+mixin_illegal_superclass_test/25: MissingCompileTimeError
+mixin_illegal_superclass_test/26: MissingCompileTimeError
+mixin_illegal_superclass_test/27: MissingCompileTimeError
+mixin_illegal_superclass_test/28: MissingCompileTimeError
+mixin_illegal_superclass_test/29: MissingCompileTimeError
+mixin_illegal_superclass_test/30: MissingCompileTimeError
+mixin_illegal_syntax_test/13: CompileTimeError
+mixin_illegal_syntax_test/none: CompileTimeError
+mixin_mixin2_test: RuntimeError
+mixin_mixin3_test: RuntimeError
+mixin_mixin4_test: RuntimeError
+mixin_mixin5_test: RuntimeError
+mixin_mixin_bound2_test: RuntimeError
+mixin_mixin_bound_test: RuntimeError
+mixin_super_test: RuntimeError
+mixin_type_parameters_simple_test: RuntimeError
+mixin_type_parameters_super_extends_test: RuntimeError
+mixin_type_parameters_super_test: RuntimeError
+multiline_newline_test/01: CompileTimeError
+multiline_newline_test/02: CompileTimeError
+multiline_newline_test/03: CompileTimeError
+multiline_newline_test/04: MissingCompileTimeError
+multiline_newline_test/05: MissingCompileTimeError
+multiline_newline_test/06: MissingCompileTimeError
+multiline_newline_test/none: RuntimeError
+named_parameters_type_test/01: MissingRuntimeError
+named_parameters_type_test/02: MissingRuntimeError
+named_parameters_type_test/03: MissingRuntimeError
+no_main_test/01: Crash
+not_enough_positional_arguments_test/01: CompileTimeError
+not_enough_positional_arguments_test/02: MissingRuntimeError
+not_enough_positional_arguments_test/05: MissingRuntimeError
+null_test/none: RuntimeError
+number_identifier_test/05: RuntimeError
+positional_parameters_type_test/01: MissingRuntimeError
+positional_parameters_type_test/02: MissingRuntimeError
+prefix10_negative_test: Fail
+prefix21_test: RuntimeError
+redirecting_constructor_initializer_test: RuntimeError
+redirecting_factory_reflection_test: Crash
+regress_18535_test: Crash
+regress_18713_test: RuntimeError
+regress_22443_test: RuntimeError
+regress_22700_test: RuntimeError
+regress_23408_test: RuntimeError
+regress_27164_test: CompileTimeError
+regress_27617_test/1: MissingCompileTimeError
+regress_r24720_test: RuntimeError
+reify_typevar_test: RuntimeError
+script1_negative_test: Fail
+script2_negative_test: Fail
+setter_no_getter_call_test/none: RuntimeError
+stack_trace_test: RuntimeError
+stacktrace_rethrow_error_test/none: RuntimeError
+stacktrace_rethrow_error_test/withtraceparameter: RuntimeError
+stacktrace_rethrow_nonerror_test: RuntimeError
+static_setter_get_test/01: RuntimeError
+string_interpolation7_test: RuntimeError
+super_call3_test/01: Crash
+super_call4_test: RuntimeError
+super_test: RuntimeError
+switch7_negative_test: Fail
+switch_try_catch_test: RuntimeError
+sync_generator3_test/test2: RuntimeError
+tearoff_basic_test: CompileTimeError
+tearoff_constructor_basic_test: CompileTimeError
+try_catch_on_syntax_test/10: MissingRuntimeError
+try_catch_on_syntax_test/11: MissingRuntimeError
+try_finally_regress_25654_test: RuntimeError
+type_checks_in_factory_method_test: RuntimeError
+type_parameter_literal_test: RuntimeError
+type_variable_conflict2_test/02: MissingCompileTimeError
+type_variable_function_type_test: RuntimeError
+vm/debug_break_enabled_vm_test/01: CompileTimeError
+vm/debug_break_enabled_vm_test/none: CompileTimeError
+vm/reflect_core_vm_test: CompileTimeError
+vm/type_cast_vm_test: RuntimeError
+vm/type_vm_test: RuntimeError
+
+# dartk: precompilation failures (debug)
+[ $compiler == dartkp && $runtime == dart_precompiled && $mode == debug ]
+constructor_named_arguments_test/01: Crash
+enum_syntax_test/05: Crash
+generic_sends_test: Crash
+not_enough_positional_arguments_test/05: Crash
diff --git a/tests/language/named_parameters_default_eq_test.dart b/tests/language/named_parameters_default_eq_test.dart
new file mode 100644
index 0000000..2afc8c4
--- /dev/null
+++ b/tests/language/named_parameters_default_eq_test.dart
@@ -0,0 +1,99 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Check that both `=` and `:` are allowed for named parameters.
+
+import "package:expect/expect.dart";
+
+// Default values are not allowed on typedefs.
+typedef int F1({x = 3, y}); /// 01: compile-time error
+
+typedef int functype({x, y, z});
+
+int topF({x = 3, y : 5, z}) => x * y * (z ?? 2);
+
+class A {
+  int x;
+  int y;
+  int z;
+  A({this.x = 3, this.y : 5, z }) : z = z ?? 2;
+  A.redirect({x = 3, y : 5, z}) : this(x: x, y: y, z: z);
+  factory A.factory({x = 3, y : 5, z}) => new A(x: x, y: y, z: z ?? 2);
+  factory A.redirectFactory({x, y, z}) = A;
+
+  // Default values are not allowed on redirecting factory constructors.
+  factory A.badRedirectFactory({x = 3, y}) = A; /// 02: compile-time error
+
+  int get value => x * y * z;
+
+  static int staticF({x = 3, y : 5, z}) => x * y * (z ?? 2);
+  int instanceF({x = 3, y : 5, z}) => x * y * (z ?? 2);
+}
+
+main() {
+  // Reference the type, or dart2js won't see that the declaration is invalid
+  F1 _ = null;  /// 01: continued
+
+  var a = new A();
+
+  int local({x = 3, y : 5, z}) => x * y * (z ?? 2);
+  var expr = ({x = 3, y : 5, z}) => x * y * (z ?? 2);
+  var tearOff = a.instanceF;
+
+  test(function) {
+    Expect.equals(30, function());
+    Expect.equals(70, function(x: 7));
+    Expect.equals(42, function(y: 7));
+    Expect.equals(28, function(x: 7, y: 2));
+    Expect.equals(15, function(z: 1));
+    Expect.equals(21, function(y: 7, z: 1));
+    Expect.equals(35, function(x: 7, z: 1));
+    Expect.equals(14, function(x: 7, y: 2, z: 1));
+    Expect.isTrue(function is functype);
+  }
+
+  test(topF);
+  test(A.staticF);
+  test(a.instanceF);
+  test(local);
+  test(expr);
+  test(tearOff);
+
+  // Can't tear off constructors.
+  Expect.equals(30, new A().value);
+  Expect.equals(70, new A(x: 7).value);
+  Expect.equals(42, new A(y: 7).value);
+  Expect.equals(28, new A(x: 7, y: 2).value);
+  Expect.equals(15, new A(z: 1).value);
+  Expect.equals(21, new A(y: 7, z: 1).value);
+  Expect.equals(35, new A(x: 7, z: 1).value);
+  Expect.equals(14, new A(x: 7, y: 2, z: 1).value);
+
+  Expect.equals(30, new A.redirect().value);
+  Expect.equals(70, new A.redirect(x: 7).value);
+  Expect.equals(42, new A.redirect(y: 7).value);
+  Expect.equals(28, new A.redirect(x: 7, y: 2).value);
+  Expect.equals(15, new A.redirect(z: 1).value);
+  Expect.equals(21, new A.redirect(y: 7, z: 1).value);
+  Expect.equals(35, new A.redirect(x: 7, z: 1).value);
+  Expect.equals(14, new A.redirect(x: 7, y: 2, z: 1).value);
+
+  Expect.equals(30, new A.factory().value);
+  Expect.equals(70, new A.factory(x: 7).value);
+  Expect.equals(42, new A.factory(y: 7).value);
+  Expect.equals(28, new A.factory(x: 7, y: 2).value);
+  Expect.equals(15, new A.factory(z: 1).value);
+  Expect.equals(21, new A.factory(y: 7, z: 1).value);
+  Expect.equals(35, new A.factory(x: 7, z: 1).value);
+  Expect.equals(14, new A.factory(x: 7, y: 2, z: 1).value);
+
+  Expect.equals(30, new A.redirectFactory().value);
+  Expect.equals(70, new A.redirectFactory(x: 7).value);
+  Expect.equals(42, new A.redirectFactory(y: 7).value);
+  Expect.equals(28, new A.redirectFactory(x: 7, y: 2).value);
+  Expect.equals(15, new A.redirectFactory(z: 1).value);
+  Expect.equals(21, new A.redirectFactory(y: 7, z: 1).value);
+  Expect.equals(35, new A.redirectFactory(x: 7, z: 1).value);
+  Expect.equals(14, new A.redirectFactory(x: 7, y: 2, z: 1).value);
+}
diff --git a/tests/language/parameter_initializer5_negative_test.dart b/tests/language/parameter_initializer5_negative_test.dart
deleted file mode 100644
index afa5e2a..0000000
--- a/tests/language/parameter_initializer5_negative_test.dart
+++ /dev/null
@@ -1,15 +0,0 @@
-// 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.
-
-// Fails because this.x parameter is used in initializer expression.
-
-class Foo {
-  var x, y;
-  Foo(this.x): y = x { }
-}
-
-
-main() {
-  new Foo(12);
-}
diff --git a/tests/language/parameter_initializer5_test.dart b/tests/language/parameter_initializer5_test.dart
new file mode 100644
index 0000000..eb7208d
--- /dev/null
+++ b/tests/language/parameter_initializer5_test.dart
@@ -0,0 +1,17 @@
+// 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.
+//
+// DartOptions=--initializing-formal-access
+// VMOptions=--initializing-formal-access
+
+// Use the this.x parameter in an initializer expression.
+
+class Foo {
+  var x, y;
+  Foo(this.x): y = x { }
+}
+
+main() {
+  new Foo(12);
+}
diff --git a/tests/language/regress_27572_test.dart b/tests/language/regress_27572_test.dart
new file mode 100644
index 0000000..61cff0e
--- /dev/null
+++ b/tests/language/regress_27572_test.dart
@@ -0,0 +1,17 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 static noSuchMethod with a prefix.
+
+import "package:expect/expect.dart";
+
+import 'dart:collection' as col;
+
+main() {
+  try {
+    col.foobar(1234567);
+  } catch(e) {
+    Expect.isTrue(e.toString().contains("1234567"));
+  }
+}
diff --git a/tests/language/regress_27617_test.dart b/tests/language/regress_27617_test.dart
new file mode 100644
index 0000000..9a0fdbd
--- /dev/null
+++ b/tests/language/regress_27617_test.dart
@@ -0,0 +1,16 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 Foo {
+  final String greeting;
+  Foo._(this.greeting) { }
+
+  // Const constructor must not redirect to non-const constructor.
+  const Foo.hi() : this._('hi');  /// 1: compile-time error
+}
+
+main() {
+  const h = const Foo.hi();  /// 1: continued
+}
diff --git a/tests/language/regress_27659_test.dart b/tests/language/regress_27659_test.dart
new file mode 100644
index 0000000..e40a886
--- /dev/null
+++ b/tests/language/regress_27659_test.dart
@@ -0,0 +1,28 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 String lineLength = '120';
+
+foo({lineLength: lineLength}) {
+  print(lineLength);
+}
+
+bar({lineLength: lineLength}) async {
+  print(lineLength);
+}
+
+baz([lineLength = lineLength]) {
+  print(lineLength);
+}
+
+qux([lineLength = lineLength]) async {
+  print(lineLength);
+}
+
+main() {
+  foo();
+  bar();
+  baz();
+  qux();
+}
diff --git a/tests/language/regress_27957_lib1.dart b/tests/language/regress_27957_lib1.dart
new file mode 100644
index 0000000..7a06ff3
--- /dev/null
+++ b/tests/language/regress_27957_lib1.dart
@@ -0,0 +1,9 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 regress_27957_lib1;
+
+class Superclass {
+  int m() => 1;
+}
diff --git a/tests/language/regress_27957_lib2.dart b/tests/language/regress_27957_lib2.dart
new file mode 100644
index 0000000..24097d0
--- /dev/null
+++ b/tests/language/regress_27957_lib2.dart
@@ -0,0 +1,9 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 regress_27957_lib2;
+
+class Superclass {
+  int m() => 2;
+}
diff --git a/tests/language/regress_27957_test.dart b/tests/language/regress_27957_test.dart
new file mode 100644
index 0000000..c9cb543
--- /dev/null
+++ b/tests/language/regress_27957_test.dart
@@ -0,0 +1,17 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+import 'regress_27957_lib1.dart' as s1;
+import 'regress_27957_lib2.dart' as s2;
+
+class Mixin {}
+class C1 = s1.Superclass with Mixin;
+class C2 = s2.Superclass with Mixin;
+
+main() {
+  var c1 = new C1(), c2 = new C2();
+  Expect.equals(1, c1.m());
+  Expect.equals(2, c2.m());
+}
diff --git a/tests/language/switch_case_warn_test.dart b/tests/language/switch_case_warn_test.dart
new file mode 100644
index 0000000..4447bd7
--- /dev/null
+++ b/tests/language/switch_case_warn_test.dart
@@ -0,0 +1,205 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 switch statement.
+
+// Tests some switch-case statements blocks that should and should not
+// cause static warnings.
+// This test is not testing runtime behavior, only static warnings.
+
+// None of the cases blocks should cause a warning.
+void testSwitch(int x) {
+  // Catch all control flow leaving the switch.
+  // Run switch in catch clause to check rethrow.
+  TRY: try {
+    throw x;
+  } catch (x) {
+    // Add loop as break/continue target.
+    LOOP: do {
+      switch (x) {
+        case 0:
+        case 1:
+          nop(x);
+          break;  // Break switch.
+        case 2:
+          nop(x);
+          break LOOP;
+        case 3:
+          nop(x);
+          continue;  // Continue loop.
+        case 4:
+          nop(x);
+          continue LOOP;
+        case 5:
+          nop(x);
+          continue LAST;
+        // Avoid warning for "return;"" and "return e;" in same function.
+        case 6:      /// retnon: ok
+          nop(x);    /// retnon: continued
+          return;    /// retnon: continued
+        case 7:      /// retval: ok
+          nop(x);    /// retval: continued
+          return x;  /// retval: continued
+        case 8:
+          nop(x);
+          throw x;
+        case 9:
+          nop(x);
+          rethrow;
+        case 10:
+        case 11: {
+          nop(x);
+          break;  // Break switch.
+        }
+        case 12: {
+          nop(x);
+          break LOOP;
+        }
+        case 13: {
+          nop(x);
+          continue;  // Continue loop.
+        }
+        case 14: {
+          nop(x);
+          continue LOOP;
+        }
+        case 15: {
+          nop(x);
+          continue LAST;
+        }
+        case 16: {   /// retnon: continued
+          nop(x);    /// retnon: continued
+          return;    /// retnon: continued
+        }            /// retnon: continued
+        case 17: {   /// retval: continued
+          nop(x);    /// retval: continued
+          return x;  /// retval: continued
+        }            /// retval: continued
+        case 18: {
+          nop(x);
+          throw x;
+        }
+        case 19: {
+          nop(x);
+          rethrow;
+        }
+        LAST:
+        case 20: {
+          nop(x);
+          // Fallthrough allowed on last statements.
+        }
+      }
+    } while (false);
+  } finally {
+    // Catch all control flow leaving the switch and ignore it.
+    // Use break instead of return to avoid warning for `return` and `return e`
+    // in same function.
+    break TRY;
+  }
+}
+
+// All these switch cases should cause warnings.
+void testSwitchWarn(x) {
+  // Catch all control flow from the switch and ignore it.
+  TRY: try {
+    throw 0;
+  } catch (e) {
+    // Wrap in loop as target for continue/break.
+    LOOP: do {
+      switch (x) {
+        case 0:                          /// 01: static type warning
+        case 1: {                        /// 01: continued
+          {                              /// 01: continued
+            nop(x);                      /// 01: continued
+            break;  // Break switch.     /// 01: continued
+          }                              /// 01: continued
+        }                                /// 01: continued
+        case 2: {                        /// 02: static type warning
+          {                              /// 02: continued
+            nop(x);                      /// 02: continued
+            break LOOP;                  /// 02: continued
+          }                              /// 02: continued
+        }                                /// 02: continued
+        case 3: {                        /// 03: static type warning
+          {                              /// 03: continued
+            nop(x);                      /// 03: continued
+            continue;  // Continue loop. /// 03: continued
+          }                              /// 03: continued
+        }                                /// 03: continued
+        case 4: {                        /// 04: static type warning
+          {                              /// 04: continued
+            nop(x);                      /// 04: continued
+            continue LOOP;               /// 04: continued
+          }                              /// 04: continued
+        }                                /// 04: continued
+        case 5: {                        /// 05: static type warning
+          {                              /// 05: continued
+            nop(x);                      /// 05: continued
+            continue LAST;               /// 05: continued
+          }                              /// 05: continued
+        }                                /// 05: continued
+        case 6: {                        /// 06: static type warning
+          {                              /// 06: continued
+            nop(x);                      /// 06: continued
+            return;                      /// 06: continued
+          }                              /// 06: continued
+        }                                /// 06: continued
+        case 7: {                        /// 07: static type warning
+          {                              /// 07: continued
+            nop(x);                      /// 07: continued
+            return x;                    /// 07: continued
+          }                              /// 07: continued
+        }                                /// 07: continued
+        case 8: {                        /// 08: static type warning
+          {                              /// 08: continued
+            nop(x);                      /// 08: continued
+            throw x;                     /// 08: continued
+          }                              /// 08: continued
+        }                                /// 08: continued
+        case 9: {                        /// 09: static type warning
+          {                              /// 09: continued
+            nop(x);                      /// 09: continued
+            rethrow;                     /// 09: continued
+          }                              /// 09: continued
+        }                                /// 09: continued
+        case 10:                         /// 10: static type warning
+          while (true) break;            /// 10: continued
+        case 11:                         /// 11: static type warning
+          do break; while (true);        /// 11: continued
+        case 12:                         /// 12: static type warning
+          for (;;) break;                /// 12: continued
+        case 13:                         /// 13: static type warning
+          for (var _ in []) break;       /// 13: continued
+        case 14:                         /// 14: static type warning
+          if (x) break; else break;      /// 14: continued
+        case 15:                         /// 15: static type warning
+          (throw 0);                     /// 15: continued
+        case 16:                         /// 16: static type warning
+          nop(x);      // fallthrough.   /// 16: continued
+        case 17:                         /// 17: static type warning
+          L: break;                      /// 17: continued
+        LAST:
+        case 99:
+          // Last case can't cause static warning.
+      }
+    } while (false);
+  } finally {
+    // Catch all control flow leaving the switch and ignore it.
+    // Use break instead of return to avoid warning for `return` and `return e`
+    // in same function.
+    break TRY;
+  }
+}
+
+main() {
+  // Ensure that all the cases compile and run (even if they might throw).
+  for (int i = 0; i <= 20; i++) {
+    testSwitch(i);  // Just make sure it runs.
+  }
+  for (int i = 0; i <= 18; i++) {
+    testSwitchWarn(i);
+  }
+}
+
+/// Don't make it obvious that a switch case isn't doing anything.
+void nop(x) {}
diff --git a/tests/language/try_catch_optimized5_test.dart b/tests/language/try_catch_optimized5_test.dart
new file mode 100644
index 0000000..d96b1f0
--- /dev/null
+++ b/tests/language/try_catch_optimized5_test.dart
@@ -0,0 +1,77 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// Dart test program for testing try/catch statement without any exceptions
+// being thrown.
+// VMOptions=--optimization-counter-threshold=100 --no-background-compilation --enable-inlining-annotations
+
+// Test optional parameters updated inside try-catch
+
+import "package:expect/expect.dart";
+
+const noInline = "NeverInline";
+
+@noInline
+m1(int b) {
+  if (b == 1) throw 123;
+}
+
+
+@noInline
+m2(int b) {
+  if (b == 2) throw 456;
+}
+
+
+@noInline
+test1(int b, [int state = 0]) {
+  try {
+    state++;
+    m1(b);
+    state++;
+    m2(b);
+    state++;
+  } on dynamic catch (e, s) {
+    if (b == 1 && state != 1) throw "fail1";
+    if (b == 2 && state != 2) throw "fail2";
+    if (b == 3 && state != 3) throw "fail3";
+    if (s is! StackTrace) throw "fail4";
+    return e;
+  }
+  return "no throw";
+}
+
+@noInline
+test2(int b, [int state]) {
+  state = 0;
+  try {
+    state++;
+    m1(b);
+    state++;
+    m2(b);
+    state++;
+  } on dynamic catch (e, s) {
+    if (b == 1 && state != 1) throw "fail1";
+    if (b == 2 && state != 2) throw "fail2";
+    if (b == 3 && state != 3) throw "fail3";
+    if (s is! StackTrace) throw "fail4";
+    return e;
+  } 
+  return "no throw";
+}
+
+main() {
+  for (var i=0; i<300; i++) {
+    Expect.equals("no throw", test1(0));
+  }
+  Expect.equals("no throw", test1(0));
+  Expect.equals(123, test1(1));
+  Expect.equals(456, test1(2));
+
+  for (var i=0; i<300; i++) {
+    Expect.equals("no throw", test2(0));
+  }
+  Expect.equals("no throw", test2(0));
+  Expect.equals(123, test2(1));
+  Expect.equals(456, test2(2));
+}
diff --git a/tests/language/try_catch_regress_27483_test.dart b/tests/language/try_catch_regress_27483_test.dart
new file mode 100644
index 0000000..4da202f
--- /dev/null
+++ b/tests/language/try_catch_regress_27483_test.dart
@@ -0,0 +1,51 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// Dart test program for testing try/catch statement without any exceptions
+// being thrown.
+// VMOptions=--optimization-counter-threshold=100 --no-background-compilation --enable-inlining-annotations
+
+// Test local variables updated inside try-catch.
+
+import "package:expect/expect.dart";
+
+const noInline = "NeverInline";
+
+@noInline
+m1(int b) {
+  if (b == 1) throw 123;
+}
+
+
+@noInline
+m2(int b) {
+  if (b == 2) throw 456;
+}
+
+
+@noInline
+test(b) {
+  var state = 0;
+  try {
+    state++;
+    m1(b);
+    state++;
+    m2(b);
+    state++;
+  } on dynamic catch (e, s) {
+    if (b == 1 && state != 1) throw "fail1";
+    if (b == 2 && state != 2) throw "fail2";
+    if (b == 3 && state != 3) throw "fail3";
+    return e;
+  } 
+  return "no throw";
+}
+
+main() {
+  for (var i=0; i<300; i++) {
+    Expect.equals("no throw", test(0));
+  }
+  Expect.equals("no throw", test(0));
+  Expect.equals(123, test(1));
+  Expect.equals(456, test(2));
+}
diff --git a/tests/language/vm/no_such_method_error_message_vm_test.dart b/tests/language/vm/no_such_method_error_message_vm_test.dart
index 6be2738..259a13a 100644
--- a/tests/language/vm/no_such_method_error_message_vm_test.dart
+++ b/tests/language/vm/no_such_method_error_message_vm_test.dart
@@ -6,7 +6,7 @@
 import "package:expect/expect.dart";
 
 // Test error message with noSuchMethodError: non-existent names
-// should result in a "method not found" message.
+// should result in a message that reports the missing method.
 
 call_bar(x) => x.bar();
 
@@ -14,7 +14,7 @@
   try {
     call_bar(5);
   } catch (e) {
-    Expect.isTrue(e.toString().indexOf("method not found") != -1);
+    Expect.isTrue(e.toString().indexOf("has no instance method 'bar'") != -1);
   }
 }
 
diff --git a/tests/language/vm/optimized_list_constructor_test.dart b/tests/language/vm/optimized_list_constructor_test.dart
new file mode 100644
index 0000000..a6e27ce
--- /dev/null
+++ b/tests/language/vm/optimized_list_constructor_test.dart
@@ -0,0 +1,26 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 various optimizations and deoptimizations of optimizing compiler..
+// VMOptions=--optimization-counter-threshold=10 --no-background-compilation
+
+import "package:expect/expect.dart";
+
+// Test correct throwing of ArgumentError in optimized code.
+
+test() {
+  try {
+    var r = new List<int>(-1);
+    Expect.isTrue(false);  // Unreachable.
+  } on RangeError {
+    return true;
+  }
+  Expect.isTrue(false);  // Unreachable.
+}
+
+main() {
+  for (var i = 0; i < 20; i++) {
+    Expect.isTrue(test());
+  }
+}
+
diff --git a/tests/language/vm/optimized_unique_selector_test.dart b/tests/language/vm/optimized_unique_selector_test.dart
new file mode 100644
index 0000000..bf0b5e4d
--- /dev/null
+++ b/tests/language/vm/optimized_unique_selector_test.dart
@@ -0,0 +1,42 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+
+class A {
+  _uniqueSelector() { }
+  final uniqueField = 10;
+}
+
+test1(obj) {
+  var res = 0;
+  for (var i = 0; i < 2; i++) {
+    obj._uniqueSelector();
+    res += obj.uniqueField;  // This load must not be hoisted out of the loop.
+  }
+  return res;
+}
+
+test2(obj) {
+  final objAlias = obj;
+  closure() => objAlias;
+  var res = 0;
+  for (var i = 0; i < 2; i++) {
+    obj._uniqueSelector();
+    res += objAlias.uniqueField;  // This load must not be hoisted out of the loop.
+  }
+  return res;
+}
+
+var foofoo_ = test1;
+
+main () {
+  Expect.equals(20, foofoo_(new A()));
+  Expect.throws(() => foofoo_(0));
+
+  foofoo_ = test2;
+
+  Expect.equals(20, foofoo_(new A()));
+  Expect.throws(() => foofoo_(0));
+}
diff --git a/tests/language/vm/regress_27201_lib.dart b/tests/language/vm/regress_27201_lib.dart
new file mode 100644
index 0000000..4973ee7
--- /dev/null
+++ b/tests/language/vm/regress_27201_lib.dart
@@ -0,0 +1,20 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 import_lib;
+
+final foo = 1;
+var someVar = 3;
+var _privateVar;
+
+int get someGetter => 2;
+
+void set someSetter(int val) {}
+
+int someFunc() => 0;
+
+class SomeClass {
+}
+
+typedef int Func(Object a);
diff --git a/tests/language/vm/regress_27201_test.dart b/tests/language/vm/regress_27201_test.dart
new file mode 100644
index 0000000..251a1ad
--- /dev/null
+++ b/tests/language/vm/regress_27201_test.dart
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+ * for details. All rights reserved. Use of this source code is governed by a
+ * BSD-style license that can be found in the LICENSE file.
+ */
+import "dart:async";
+import "package:expect/expect.dart";
+import "regress_27201_lib.dart" deferred as p;
+import "regress_27201_bad_lib_path.dart" deferred as q;
+
+test_loaded() {
+  try {
+    p.someFunc();
+  } catch (e) {
+    Expect.fail("Should not be here");
+  }
+  try {
+    p.someGetter;
+  } catch (e) {
+    Expect.fail("Should not be here");
+  }
+  try {
+    p.someSetter = 1;
+  } catch (e) {
+    Expect.fail("Should not be here");
+  }
+  try {
+    p.Func;
+  } catch (e) {
+    Expect.fail("Should not be here");
+  }
+  try {
+    Expect.isTrue(p.loadLibrary() is Future);
+  } catch (e) {
+    Expect.fail("Should not be here");
+  }
+}
+
+
+main() {
+  p.loadLibrary().then((v) {
+    test_loaded();
+  },
+  onError: (e) {
+    Expect.fail("Should have loaded library!");
+  });
+
+  // Ensure bad library import is handled correctly.
+  q.loadLibrary().then((v) {
+    Expect.fail("Should have failed");
+  },
+  onError: (e) {
+    Expect.throws(() => q.x);
+  });
+}
+
diff --git a/tests/language/vm/regress_27671_other.dart b/tests/language/vm/regress_27671_other.dart
new file mode 100644
index 0000000..a180d18
--- /dev/null
+++ b/tests/language/vm/regress_27671_other.dart
@@ -0,0 +1,10 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 'regress_27671_test.dart';
+
+@AlwaysInline
+void check(f, x) {
+  assert(f(x) && true);
+}
diff --git a/tests/language/vm/regress_27671_test.dart b/tests/language/vm/regress_27671_test.dart
new file mode 100644
index 0000000..fa258da
--- /dev/null
+++ b/tests/language/vm/regress_27671_test.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+//
+// VMOptions=--enable_asserts --enable-inlining-annotations --optimization-counter-threshold=10 --no-background-compilation
+
+import 'package:expect/expect.dart';
+import 'regress_27671_other.dart';
+
+const AlwaysInline = "AlwaysInline";
+const NeverInline = "NeverInline";
+
+@AlwaysInline
+bounce(x) {
+  for (int i = 0; i < 10; i++) {
+    check(f, x);
+  }
+}
+
+@AlwaysInline
+bool f(y) => y > 0;
+
+main() {
+  for (int i = 0; i < 100; i++) {
+    bounce(1);
+  }
+  try {
+    bounce(-1);
+  } catch (e) {
+    Expect.isTrue(e.toString().contains('f(x) && true'));
+  }
+}
diff --git a/tests/language/vm/unaligned_float_access_literal_index_test.dart b/tests/language/vm/unaligned_float_access_literal_index_test.dart
new file mode 100644
index 0000000..c224dc9
--- /dev/null
+++ b/tests/language/vm/unaligned_float_access_literal_index_test.dart
@@ -0,0 +1,46 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--optimization_counter_threshold=10 --no-background_compilation
+
+import 'dart:typed_data';
+import 'package:expect/expect.dart';
+
+unalignedFloat32() {
+  var bytes = new ByteData(64);
+  bytes.setFloat32(0, 16.25);
+  Expect.equals(16.25, bytes.getFloat32(0));
+  bytes.setFloat32(1, 32.125);
+  Expect.equals(32.125, bytes.getFloat32(1));
+  bytes.setFloat32(2, 16.25);
+  Expect.equals(16.25, bytes.getFloat32(2));
+  bytes.setFloat32(3, 32.125);
+  Expect.equals(32.125, bytes.getFloat32(3));
+}
+
+unalignedFloat64() {
+  var bytes = new ByteData(64);
+  bytes.setFloat64(0, 16.25);
+  Expect.equals(16.25, bytes.getFloat64(0));
+  bytes.setFloat64(1, 32.125);
+  Expect.equals(32.125, bytes.getFloat64(1));
+  bytes.setFloat64(2, 16.25);
+  Expect.equals(16.25, bytes.getFloat64(2));
+  bytes.setFloat64(3, 32.125);
+  Expect.equals(32.125, bytes.getFloat64(3));
+  bytes.setFloat64(4, 16.25);
+  Expect.equals(16.25, bytes.getFloat64(4));
+  bytes.setFloat64(5, 32.125);
+  Expect.equals(32.125, bytes.getFloat64(5));
+  bytes.setFloat64(6, 16.25);
+  Expect.equals(16.25, bytes.getFloat64(6));
+  bytes.setFloat64(7, 32.125);
+  Expect.equals(32.125, bytes.getFloat64(7));
+}
+
+main() {
+  for (var i = 0; i < 20; i++) {
+    unalignedFloat32();
+    unalignedFloat64();
+  }
+}
diff --git a/tests/language/vm/unaligned_float_access_register_index_test.dart b/tests/language/vm/unaligned_float_access_register_index_test.dart
new file mode 100644
index 0000000..334efe5
--- /dev/null
+++ b/tests/language/vm/unaligned_float_access_register_index_test.dart
@@ -0,0 +1,30 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--optimization_counter_threshold=10 --no-background_compilation
+
+import 'dart:typed_data';
+import 'package:expect/expect.dart';
+
+unalignedFloat32() {
+  var bytes = new ByteData(64);
+  for (var i = 0; i < 4; i++) {
+    bytes.setFloat32(i, 16.25);
+    Expect.equals(16.25, bytes.getFloat32(i));
+  }
+}
+
+unalignedFloat64() {
+  var bytes = new ByteData(64);
+  for (var i = 0; i < 8; i++) {
+    bytes.setFloat64(i, 16.25);
+    Expect.equals(16.25, bytes.getFloat64(i));
+  }
+}
+
+main() {
+  for (var i = 0; i < 20; i++) {
+    unalignedFloat32();
+    unalignedFloat64();
+  }
+}
diff --git a/tests/language/vm/unaligned_integer_access_literal_index_test.dart b/tests/language/vm/unaligned_integer_access_literal_index_test.dart
new file mode 100644
index 0000000..6373a24
--- /dev/null
+++ b/tests/language/vm/unaligned_integer_access_literal_index_test.dart
@@ -0,0 +1,98 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--optimization_counter_threshold=10 --no-background_compilation
+
+import 'dart:typed_data';
+import 'package:expect/expect.dart';
+
+unalignedUint16() {
+  var bytes = new ByteData(64);
+  bytes.setUint16(0, 0xABCD);
+  Expect.equals(0xABCD, bytes.getUint16(0));
+  bytes.setUint16(1, 0xBCDE);
+  Expect.equals(0xBCDE, bytes.getUint16(1));
+}
+
+unalignedInt16() {
+  var bytes = new ByteData(64);
+  bytes.setInt16(0, -0x1234);
+  Expect.equals(-0x1234, bytes.getInt16(0));
+  bytes.setInt16(1, -0x2345);
+  Expect.equals(-0x2345, bytes.getInt16(1));
+}
+
+unalignedUint32() {
+  var bytes = new ByteData(64);
+  bytes.setUint32(0, 0xABCDABCD);
+  Expect.equals(0xABCDABCD, bytes.getUint32(0));
+  bytes.setUint32(1, 0xBCDEBCDE);
+  Expect.equals(0xBCDEBCDE, bytes.getUint32(1));
+  bytes.setUint32(2, 0xABCDABCD);
+  Expect.equals(0xABCDABCD, bytes.getUint32(2));
+  bytes.setUint32(3, 0xBCDEBCDE);
+  Expect.equals(0xBCDEBCDE, bytes.getUint32(3));
+}
+
+unalignedInt32() {
+  var bytes = new ByteData(64);
+  bytes.setInt32(0, -0x12341234);
+  Expect.equals(-0x12341234, bytes.getInt32(0));
+  bytes.setInt32(1, -0x23452345);
+  Expect.equals(-0x23452345, bytes.getInt32(1));
+  bytes.setInt32(2, -0x12341234);
+  Expect.equals(-0x12341234, bytes.getInt32(2));
+  bytes.setInt32(3, -0x23452345);
+  Expect.equals(-0x23452345, bytes.getInt32(3));
+}
+
+unalignedUint64() {
+  var bytes = new ByteData(64);
+  bytes.setUint64(0, 0xABCDABCD);
+  Expect.equals(0xABCDABCD, bytes.getUint64(0));
+  bytes.setUint64(1, 0xBCDEBCDE);
+  Expect.equals(0xBCDEBCDE, bytes.getUint64(1));
+  bytes.setUint64(2, 0xABCDABCD);
+  Expect.equals(0xABCDABCD, bytes.getUint64(2));
+  bytes.setUint64(3, 0xBCDEBCDE);
+  Expect.equals(0xBCDEBCDE, bytes.getUint64(3));
+  bytes.setUint64(4, 0xABCDABCD);
+  Expect.equals(0xABCDABCD, bytes.getUint64(4));
+  bytes.setUint64(5, 0xBCDEBCDE);
+  Expect.equals(0xBCDEBCDE, bytes.getUint64(5));
+  bytes.setUint64(6, 0xABCDABCD);
+  Expect.equals(0xABCDABCD, bytes.getUint64(6));
+  bytes.setUint64(7, 0xBCDEBCDE);
+  Expect.equals(0xBCDEBCDE, bytes.getUint64(7));
+}
+
+unalignedInt64() {
+  var bytes = new ByteData(64);
+  bytes.setInt64(0, -0x12341234);
+  Expect.equals(-0x12341234, bytes.getInt64(0));
+  bytes.setInt64(1, -0x23452345);
+  Expect.equals(-0x23452345, bytes.getInt64(1));
+  bytes.setInt64(2, -0x12341234);
+  Expect.equals(-0x12341234, bytes.getInt64(2));
+  bytes.setInt64(3, -0x23452345);
+  Expect.equals(-0x23452345, bytes.getInt64(3));
+  bytes.setInt64(4, -0x12341234);
+  Expect.equals(-0x12341234, bytes.getInt64(4));
+  bytes.setInt64(5, -0x23452345);
+  Expect.equals(-0x23452345, bytes.getInt64(5));
+  bytes.setInt64(6, -0x12341234);
+  Expect.equals(-0x12341234, bytes.getInt64(6));
+  bytes.setInt64(7, -0x23452345);
+  Expect.equals(-0x23452345, bytes.getInt64(7));
+}
+
+main() {
+  for (var i = 0; i < 20; i++) {
+    unalignedUint16();
+    unalignedInt16();
+    unalignedUint32();
+    unalignedInt32();
+    unalignedUint64();
+    unalignedInt64();
+  }
+}
diff --git a/tests/language/vm/unaligned_integer_access_register_index_test.dart b/tests/language/vm/unaligned_integer_access_register_index_test.dart
new file mode 100644
index 0000000..7c49cce
--- /dev/null
+++ b/tests/language/vm/unaligned_integer_access_register_index_test.dart
@@ -0,0 +1,66 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--optimization_counter_threshold=10 --no-background_compilation
+
+import 'dart:typed_data';
+import 'package:expect/expect.dart';
+
+unalignedUint16() {
+  var bytes = new ByteData(64);
+  for (var i = 0; i < 2; i++) {
+    bytes.setUint16(i, 0xABCD);
+    Expect.equals(0xABCD, bytes.getUint16(i));
+  }
+}
+
+unalignedInt16() {
+  var bytes = new ByteData(64);
+  for (var i = 0; i < 2; i++) {
+    bytes.setInt16(i, -0x1234);
+    Expect.equals(-0x1234, bytes.getInt16(i));
+  }
+}
+
+unalignedUint32() {
+  var bytes = new ByteData(64);
+  for (var i = 0; i < 4; i++) {
+    bytes.setUint32(i, 0xABCDABCD);
+    Expect.equals(0xABCDABCD, bytes.getUint32(i));
+  }
+}
+
+unalignedInt32() {
+  var bytes = new ByteData(64);
+  for (var i = 0; i < 4; i++) {
+    bytes.setInt32(i, -0x12341234);
+    Expect.equals(-0x12341234, bytes.getInt32(i));
+  }
+}
+
+unalignedUint64() {
+  var bytes = new ByteData(64);
+  for (var i = 0; i < 8; i++) {
+    bytes.setUint64(i, 0xABCDABCD);
+    Expect.equals(0xABCDABCD, bytes.getUint64(i));
+  }
+}
+
+unalignedInt64() {
+  var bytes = new ByteData(64);
+  for (var i = 0; i < 8; i++) {
+    bytes.setInt64(i, -0x12341234);
+    Expect.equals(-0x12341234, bytes.getInt64(i));
+  }
+}
+
+main() {
+  for (var i = 0; i < 20; i++) {
+    unalignedUint16();
+    unalignedInt16();
+    unalignedUint32();
+    unalignedInt32();
+    unalignedUint64();
+    unalignedInt64();
+  }
+}
diff --git a/tests/language/vm/unique_selector_test.dart b/tests/language/vm/unique_selector_test.dart
new file mode 100644
index 0000000..e26d4b5
--- /dev/null
+++ b/tests/language/vm/unique_selector_test.dart
@@ -0,0 +1,34 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+
+class A {
+  _unique_method() => "foo";
+  bar() => "A";
+}
+
+class B {
+  noSuchMethod(invocation) => "nsm";
+  bar() => "B";
+}
+
+confuse(x) {
+  try {
+    throw x;
+  } catch (e) {
+    return e;
+  }
+  return null;
+}
+
+main() {
+  var a = confuse(new A());
+  Expect.equals("foo", a._unique_method());
+  Expect.equals("A", a.bar());
+
+  var b = confuse(new B());
+  Expect.equals("nsm", b._unique_method());
+  Expect.equals("B", b.bar()); // Don't propagate type A to b.
+}
diff --git a/tests/lib/async/stream_take_test.dart b/tests/lib/async/stream_take_test.dart
new file mode 100644
index 0000000..e341a22
--- /dev/null
+++ b/tests/lib/async/stream_take_test.dart
@@ -0,0 +1,63 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+import "package:expect/expect.dart";
+import "package:async_helper/async_helper.dart";
+
+class A { const A(); }
+class B extends A { const B(); }
+
+/// Stream which emits an error if it's not canceled at the correct time.
+///
+/// Must be canceled after at most [maxEvents] events.
+Stream makeStream(int maxEvents) {
+  var c;
+  int event = 0;
+  bool canceled = false;
+  c = new StreamController(onListen: () {
+    new Timer.periodic(const Duration(milliseconds: 10), (t) {
+      if (canceled) {
+        t.cancel();
+        return;
+      }
+      if (event == maxEvents) {
+        c.addError("NOT CANCELED IN TIME: $maxEvents");
+        c.close();
+        t.cancel();
+      } else {
+        c.add(event++);
+      }
+    });
+  }, onCancel: () {
+    canceled = true;
+  });
+  return c.stream;
+}
+
+main() {
+  asyncStart();
+  tests().then((_) { asyncEnd(); });
+}
+
+tests() async {
+  await expectThrowsAsync(makeStream(4).take(5).toList(), "5/4");
+  await expectThrowsAsync(makeStream(0).take(1).toList(), "1/0");
+
+  Expect.listEquals([0, 1, 2, 3, 4], await makeStream(5).take(5).toList());
+
+  Expect.listEquals([0, 1, 2, 3], await makeStream(5).take(4).toList());
+
+  Expect.listEquals([0], await makeStream(5).take(1).toList());
+
+  Expect.listEquals([], await makeStream(5).take(0).toList());
+
+  Expect.listEquals([], await makeStream(0).take(0).toList());
+}
+
+Future expectThrowsAsync(Future computation, String name) {
+  return computation.then((_) {
+    Expect.fail("$name: Did not throw");
+  }, onError: (e, s){});
+}
diff --git a/tests/lib/lib.status b/tests/lib/lib.status
index 99f0273..2a84f7b 100644
--- a/tests/lib/lib.status
+++ b/tests/lib/lib.status
@@ -139,7 +139,7 @@
 typed_data/setRange_2_test: RuntimeError # TODO(dart2js-team): Please triage this failure.
 typed_data/setRange_3_test: RuntimeError # TODO(dart2js-team): Please triage this failure.
 
-[ $compiler == dart2js && $runtime != jsshell && $runtime != safarimobilesim && $runtime != safari && $runtime != ff &&  $runtime != ie10 && ($runtime != chrome || $system != linux) ]
+[ $compiler == dart2js && ($runtime == d8 || $runtime == drt || $runtime == ie11) ]
 math/math_test: RuntimeError
 math/math2_test: RuntimeError
 
@@ -189,6 +189,7 @@
 async/stream_controller_test: Fail # Timer interface not supported: Issue 7728.
 async/stream_subscription_cancel_test: Fail # Timer interface not supported: Issue 7728.
 async/future_constructor2_test: Fail # Timer interface not supported: Issue 7728.
+async/stream_take_test: Fail # Timer interface not supported: Issue 7728.
 mirrors/mirrors_reader_test: Skip # Running in v8 suffices. Issue 16589 - RuntimeError.  Issue 22130 - Crash (out of memory).
 
 [ $compiler == dart2js && $checked ]
@@ -258,6 +259,7 @@
 async/timer_not_available_test: Fail, OK
 mirrors/native_class_test: Fail, OK # This test is meant to run in a browser.
 mirrors/deferred_type_test: CompileTimeError, OK # Don't have a multitest marker for dynamic compile time errors.
+mirrors/initializing_formals_test/01: Fail # initializing formals are implicitly final as of Dart 1.21
 
 [ $compiler == none || $compiler == precompiler || $compiler == dart2app || $compiler == dart2appjit ]
 async/timer_not_available_test: SkipByDesign # only meant to test when there is no way to implement timer (currently only in d8)
@@ -267,6 +269,7 @@
 mirrors/mirrors_used*: SkipByDesign # Invalid tests. MirrorsUsed does not have a specification, and dart:mirrors is not required to hide declarations that are not covered by any MirrorsUsed annotation.
 
 [ $compiler == none && ($runtime == drt || $runtime == dartium) ]
+mirrors/initializing_formals_test/01: Fail # initializing formals are implicitly final as of Dart 1.21
 async/schedule_microtask6_test: Fail # Issue 10910
 async/timer_test: Fail, Pass # Issue 15487
 async/multiple_timer_test: Fail, Pass # Issue 15487
@@ -279,6 +282,9 @@
 mirrors/local_isolate_test: RuntimeError # Issue 12188
 mirrors/deferred_type_test: RuntimeError, OK # Should be CompileTimeError. Issue 22072
 
+[ $compiler == none && $runtime == dartium && $system == macos ]
+convert/streamed_conversion_utf8_decode_test: Pass, Slow
+
 [ $compiler == none && $runtime == drt && $system == windows ]
 async/multiple_timer_test: Fail, Pass # See Issue 10982
 async/timer_test: Fail, Pass # See Issue 10982
@@ -391,11 +397,6 @@
 convert/chunked_conversion_utf88_test: Pass, Timeout
 convert/utf85_test: Pass, Timeout
 
-[ $arch == simdbc || $arch == simdbc64 ]
-# TODO(vegorov) LoadField bytecode supports only up to 256 fields. Need a long
-# version.
-mirrors/accessor_cache_overflow_test: Skip
-
 [ $hot_reload || $hot_reload_rollback ]
 async/multiple_timer_test: Pass, Fail # Timing related
 async/stream_transformer_test: Pass, Fail # Closure identity
@@ -412,7 +413,7 @@
 mirrors/load_library_test: Crash # Deferred loading
 
 [ $hot_reload ]
-mirrors/metadata_scope_test/none: Fail # Constant equality - Issue 26868
 mirrors/generic_bounded_test/02: Fail # Type equality - Issue 26869
 mirrors/typedef_reflected_type_test/01: Fail # Type equality - Issue 26869
 mirrors/generic_bounded_by_type_parameter_test/02: Fail # Type equality - Issue 26869
+async/timer_regress22626_test: Pass, RuntimeError # Timing dependent.
diff --git a/tests/lib/mirrors/unnamed_mixin_application_test.dart b/tests/lib/mirrors/unnamed_mixin_application_test.dart
new file mode 100644
index 0000000..782774b
--- /dev/null
+++ b/tests/lib/mirrors/unnamed_mixin_application_test.dart
@@ -0,0 +1,24 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for 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 forwarding constructors of unnamed mixin applications are 
+/// included for reflection.
+
+import 'dart:mirrors';
+
+class S {
+  S();
+  S.anUnusedName();
+}
+class M {}
+class C extends S with M {
+  C();
+}
+
+main() {
+  // Use 'C#', 'S+M#' and 'S#' but not 'S#anUnusedName' nor 'S+M#anUnusedName'.
+  new C();
+  // Disable tree shaking making 'S+M#anUnusedName' live.
+  reflectClass(C);
+}
\ No newline at end of file
diff --git a/tests/standalone/env_test.dart b/tests/standalone/env_test.dart
new file mode 100644
index 0000000..6280f60
--- /dev/null
+++ b/tests/standalone/env_test.dart
@@ -0,0 +1,10 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// SharedOptions=-Dvar -D -D=var -Dvar=invalid -Dvar=valid -Dvar
+
+import "package:expect/expect.dart";
+
+main() {
+  Expect.equals('valid', const String.fromEnvironment('var'));
+}
diff --git a/tests/standalone/fixed_precision_double_test.dart b/tests/standalone/fixed_precision_double_test.dart
deleted file mode 100644
index 350bbc3..0000000
--- a/tests/standalone/fixed_precision_double_test.dart
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import "package:expect/expect.dart";
-
-bool testAssociativity(Function f) {
-  // Example from https://en.wikipedia.org/wiki/Floating_point
-  // Test that (a + b) + c == a + (b + c).
-  double a = f(1234.567);  // Chop literals.
-  double b = f(45.67834);
-  double c = f(0.0004);
-  double x = (a + b) + c;  // Chop result of multiplication or division only.
-  double y = a + (b + c);
-  print("x: $x");
-  print("y: $y");
-  return x == y;
-}
-
-bool testDistributivity(Function f) {
-  // Example from https://en.wikipedia.org/wiki/Floating_point
-  // Test that (a + b)*c == a*c + b*c.
-  double a = f(1234.567);  // Chop literals.
-  double b = f(1.234567);
-  double c = f(3.333333);
-  double x = f((a + b)*c);  // Chop result of multiplication.
-  double y = f(a*c) + f(b*c);
-  print("x: $x");
-  print("y: $y");
-  return x == y;
-}
-
-// Simulate precision checking with assert.
-assertP(double d) {
-  assert(d == d.p);
-}
-
-bool assertionsEnabled() {
-  try {
-    assert(false);
-    return false;
-  } on AssertionError catch (e) {
-    return true;
-  }
-  return false;
-}
-
-main() {
-  // The getter p keeps only 20 (by default) bits after the decimal point.
-  Expect.equals(0.0, 0.0.p);  // 0.0 has no 1-bit after the decimal point.
-  Expect.equals(1.5, 1.5.p);  // 1.5 has a single 1-bit after the decimal point.
-  Expect.notEquals(1.1, 1.1.p);  // 1.1 has many 1-bits after the decimal point.
-  Expect.notEquals(1/3, (1/3).p);  // 0.33333333... ditto.
-
-  Expect.equals(1.1 + 1/3, 1/3 + 1.1);  // Test addition commutativity.
-  Expect.equals(1.1.p + (1/3).p, (1/3).p + 1.1.p);
-  Expect.equals(1.1 * 1/3, 1/3 * 1.1);  // Test multiplication commutativity.
-  Expect.equals(1.1.p * (1/3).p, (1/3).p * 1.1.p);
-
-  print("Without chopping fractional bits:");
-  Expect.isFalse(testAssociativity((x) => x));
-  Expect.isFalse(testDistributivity((x) => x));
-  print("With chopping fractional bits:");
-  Expect.isTrue(testAssociativity((x) => x.p));
-  Expect.isTrue(testDistributivity((x) => x.p));
-
-  // Check that p works with NaN and Infinity.
-  Expect.isTrue(double.NAN.p.isNaN);
-  Expect.isTrue(double.INFINITY.p.isInfinite);
-  Expect.isFalse(double.INFINITY.p.isNegative);
-  Expect.isTrue(double.NEGATIVE_INFINITY.p.isInfinite);
-  Expect.isTrue(double.NEGATIVE_INFINITY.p.isNegative);
-
-  // Check use of assert to verify precision.
-  if (assertionsEnabled()) {
-    assertP(1.5);
-    assertP(1.1.p);
-    Expect.throws(() => assertP(1.1), (e) => e is AssertionError);
-    assertP(1.23456789.p);
-    Expect.throws(() => assertP(1.23456789), (e) => e is AssertionError);
-  }
-}
diff --git a/tests/standalone/http_launch_test.dart b/tests/standalone/http_launch_test.dart
index 31c524b..40fd509 100644
--- a/tests/standalone/http_launch_test.dart
+++ b/tests/standalone/http_launch_test.dart
@@ -5,6 +5,10 @@
 // VMOptions=--short_socket_read
 // VMOptions=--short_socket_write
 // VMOptions=--short_socket_read --short_socket_write
+// OtherResources=http_launch_data/http_isolate_main.dart
+// OtherResources=http_launch_data/http_launch_main.dart
+// OtherResources=http_launch_data/http_spawn_main.dart
+// OtherResources=http_launch_data/packages/simple/simple.dart
 //
 // Test:
 //   *) Launching a script fetched over HTTP.
diff --git a/tests/standalone/io/addlatexhash_test.dart b/tests/standalone/io/addlatexhash_test.dart
index 5c1c740..861f496 100755
--- a/tests/standalone/io/addlatexhash_test.dart
+++ b/tests/standalone/io/addlatexhash_test.dart
@@ -9,8 +9,8 @@
 import 'package:path/path.dart' as path;
 import '../../../tools/addlatexhash.dart';
 
-final scriptDir = path.dirname(path.fromUri(Platform.script));
-final dartRootDir = path.dirname(path.dirname(path.dirname(scriptDir)));
+final execDir = path.dirname(path.fromUri(Platform.executable));
+final dartRootDir = path.dirname(path.dirname(execDir));
 final dartRootPath = dartRootDir.toString();
 
 List<String> packageOptions() {
diff --git a/build/util/lib/common/__init__.py b/tests/standalone/io/empty_file
similarity index 100%
rename from build/util/lib/common/__init__.py
rename to tests/standalone/io/empty_file
diff --git a/tests/standalone/io/file_blocking_lock_script.dart b/tests/standalone/io/file_blocking_lock_script.dart
index 5c955c4..9ba2feb 100644
--- a/tests/standalone/io/file_blocking_lock_script.dart
+++ b/tests/standalone/io/file_blocking_lock_script.dart
@@ -11,32 +11,15 @@
   var raf = await file.open(mode: APPEND);
   await raf.setPosition(0);
   int nextToWrite = 1;
-  while (nextToWrite <= len) {
-    await raf.lock(FileLock.BLOCKING_EXCLUSIVE, 0, len);
-
-    int at;
-    int p;
-    while (true) {
-      p = await raf.position();
-      at = await raf.readByte();
-      if (at == 0 || at == -1) break;
-      nextToWrite++;
-    }
-    await raf.setPosition(p);
-    await raf.writeByte(nextToWrite);
-    await raf.flush();
-    nextToWrite++;
-    await raf.unlock(0, len);
-  }
-
   await raf.lock(FileLock.BLOCKING_EXCLUSIVE, 0, len);
-  await raf.setPosition(0);
-  for (int i = 1; i <= len; i++) {
-    if ((await raf.readByte()) != i) {
-      await raf.unlock(0, len);
-      await raf.close();
-      return 1;
-    }
+
+  // Make sure the peer fails a non-blocking lock at some point.
+  await new Future.delayed(const Duration(seconds: 1));
+
+  int p = 0;
+  while (p < len) {
+    await raf.writeByte(1);
+    p++;
   }
   await raf.unlock(0, len);
   await raf.close();
diff --git a/tests/standalone/io/file_blocking_lock_test.dart b/tests/standalone/io/file_blocking_lock_test.dart
index 9cd6689..9f665b6 100644
--- a/tests/standalone/io/file_blocking_lock_test.dart
+++ b/tests/standalone/io/file_blocking_lock_test.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// OtherResources=file_blocking_lock_script.dart
+
 // This test works by spawning a new process running
 // file_blocking_lock_script.dart, trading the file lock back and forth,
 // writing bytes 1 ... 25 in order to the file. There are checks to ensure
@@ -37,69 +39,55 @@
   });
 }
 
+const int peerTimeoutMilliseconds = 10000;
+
+Future<bool> waitForPeer(RandomAccessFile raf, int length) async {
+  Stopwatch s = new Stopwatch();
+  s.start();
+  while (true) {
+    await raf.unlock(0, length);
+    if (s.elapsedMilliseconds > peerTimeoutMilliseconds) {
+      s.stop();
+      return false;
+    }
+    try {
+      await raf.lock(FileLock.EXCLUSIVE, 0, length);
+    } on dynamic {
+      await raf.lock(FileLock.BLOCKING_EXCLUSIVE, 0, length);
+      break;
+    }
+  }
+  s.stop();
+  return true;
+}
+
 testLockWholeFile() async {
   const int length = 25;
   Directory directory = await Directory.systemTemp.createTemp('dart_file_lock');
   File file = new File(join(directory.path, "file"));
   await file.writeAsBytes(new List.filled(length, 0));
   var raf = await file.open(mode: APPEND);
-  await raf.setPosition(0);
   await raf.lock(FileLock.BLOCKING_EXCLUSIVE, 0, length);
   Process peer = await runPeer(file.path, length, FileLock.BLOCKING_EXCLUSIVE);
 
-  int nextToWrite = 1;
-  int at = 0;
-  List iWrote = new List.filled(length, 0);
-  bool nonBlockingFailed = false;
-  while (nextToWrite <= length) {
-    int p = await raf.position();
-    await raf.writeByte(nextToWrite);
-    await raf.flush();
-    // Record which bytes this process wrote so that we can check that the
-    // other process was able to take the lock and write some bytes.
-    iWrote[nextToWrite-1] = nextToWrite;
-    nextToWrite++;
-    // Let the other process get the lock at least once by spinning until the
-    // non-blocking lock fails.
-    while (!nonBlockingFailed) {
-      await raf.unlock(0, length);
-      try {
-        await raf.lock(FileLock.EXCLUSIVE, 0, length);
-      } catch(e) {
-        // Check that at some point the non-blocking lock fails.
-        nonBlockingFailed = true;
-        await raf.lock(FileLock.BLOCKING_EXCLUSIVE, 0, length);
-      }
-    }
-    while (true) {
-      p = await raf.position();
-      at = await raf.readByte();
-      if (at == 0 || at == -1) break;
-      nextToWrite++;
-    }
-    await raf.setPosition(p);
-  }
+  // Waits for the peer to take the lock, then takes the lock.
+  Expect.isTrue(await waitForPeer(raf, length));
 
+  // Check that the peer wrote to the file.
+  int p = 0;
   await raf.setPosition(0);
-  for (int i = 1; i <= length; i++) {
-    Expect.equals(i, await raf.readByte());
+  while (p < length) {
+    int at = await raf.readByte();
+    Expect.equals(1, at);
+    p++;
   }
   await raf.unlock(0, length);
 
-  bool wroteAll = true;
-  for (int i = 0; i < length; i++) {
-    // If there's a 0 entry, this process didn't write all bytes.
-    wroteAll = wroteAll && (iWrote[i] == 0);
-  }
-  Expect.equals(false, wroteAll);
-
-  Expect.equals(true, nonBlockingFailed);
-
-  await peer.exitCode.then((v) async {
-    Expect.equals(0, v);
-    await raf.close();
-    await directory.delete(recursive: true);
-  });
+  // Check that the peer exited successfully.
+  int v = await peer.exitCode;
+  Expect.equals(0, v);
+  await raf.close();
+  await directory.delete(recursive: true);
 }
 
 main() async {
diff --git a/tests/standalone/io/file_input_stream_test.dart b/tests/standalone/io/file_input_stream_test.dart
index 25cf360..88615a6 100644
--- a/tests/standalone/io/file_input_stream_test.dart
+++ b/tests/standalone/io/file_input_stream_test.dart
@@ -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.
 // Testing file input stream, VM-only, standalone test.
+//
+// OtherResources=readuntil_test.dat
+// OtherResources=readline_test1.dat
+// OtherResources=readline_test2.dat
 
 import "dart:convert";
 import "dart:io";
@@ -9,17 +13,12 @@
 import "package:async_helper/async_helper.dart";
 import "package:expect/expect.dart";
 
-// Helper method to be able to run the test from the runtime
-// directory, or the top directory.
 String getFilename(String path) {
-  var testPath = Platform.script.resolve('../../../$path');
-  return new File.fromUri(testPath).existsSync()
-      ? testPath.toFilePath()
-      : Platform.script.resolve('../../../runtime/$path').toFilePath();
+  return Platform.script.resolve(path).toFilePath();
 }
 
 void testStringLineSplitter() {
-  String fileName = getFilename("tests/standalone/io/readuntil_test.dat");
+  String fileName = getFilename("readuntil_test.dat");
   // File contains "Hello Dart\nwassup!\n"
   File file = new File(fileName);
   int linesRead = 0;
@@ -41,7 +40,7 @@
 
 void testOpenStreamAsync() {
   asyncStart();
-  String fileName = getFilename("tests/standalone/io/readuntil_test.dat");
+  String fileName = getFilename("readuntil_test.dat");
   // File contains "Hello Dart\nwassup!\n"
   var expected = "Hello Dart\nwassup!\n".codeUnits;
   var byteCount = 0;
@@ -234,7 +233,7 @@
 
 
 void testStringLineSplitterEnding(String name, int length) {
-  String fileName = getFilename("tests/standalone/io/$name");
+  String fileName = getFilename(name);
   // File contains 10 lines.
   File file = new File(fileName);
   Expect.equals(length, file.lengthSync());
diff --git a/tests/standalone/io/file_invalid_arguments_test.dart b/tests/standalone/io/file_invalid_arguments_test.dart
index 335e574..db15b77 100644
--- a/tests/standalone/io/file_invalid_arguments_test.dart
+++ b/tests/standalone/io/file_invalid_arguments_test.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// OtherResources=fixed_length_file
+
 import "dart:async";
 import "dart:io";
 
@@ -9,7 +11,7 @@
 import "package:expect/expect.dart";
 
 void testReadInvalidArgs(arg) {
-  String filename = getFilename("tests/vm/data/fixed_length_file");
+  String filename = getFilename("fixed_length_file");
   var file = (new File(filename)).openSync();
   Expect.throws(() => file.readSync(arg),
                 (e) => e is ArgumentError);
@@ -20,7 +22,7 @@
 }
 
 void testReadIntoInvalidArgs(buffer, start, end) {
-  String filename = getFilename("tests/vm/data/fixed_length_file");
+  String filename = getFilename("fixed_length_file");
   var file = (new File(filename)).openSync();
   Expect.throws(() => file.readIntoSync(buffer, start, end),
                 (e) => e is ArgumentError);
@@ -31,7 +33,7 @@
 }
 
 void testWriteByteInvalidArgs(value) {
-  String filename = getFilename("tests/vm/data/fixed_length_file");
+  String filename = getFilename("fixed_length_file");
   var file = (new File("${filename}_out")).openSync(mode: FileMode.WRITE);
   Expect.throws(() => file.writeByteSync(value),
                 (e) => e is ArgumentError);
@@ -42,7 +44,7 @@
 }
 
 void testWriteFromInvalidArgs(buffer, start, end) {
-  String filename = getFilename("tests/vm/data/fixed_length_file");
+  String filename = getFilename("fixed_length_file");
   var file = (new File("${filename}_out")).openSync(mode: FileMode.WRITE);
   Expect.throws(() => file.writeFromSync(buffer, start, end),
                 (e) => e is ArgumentError);
@@ -53,7 +55,7 @@
 }
 
 void testWriteStringInvalidArgs(string, encoding) {
-  String filename = getFilename("tests/vm/data/fixed_length_file");
+  String filename = getFilename("fixed_length_file");
   var file = new File("${filename}_out").openSync(mode: FileMode.WRITE);
   Expect.throws(() => file.writeStringSync(string, encoding: encoding),
                 (e) => e is ArgumentError);
@@ -99,10 +101,7 @@
 }
 
 String getFilename(String path) {
-  var testPath = Platform.script.resolve('../../../$path');
-  return new File.fromUri(testPath).existsSync()
-      ? testPath.toFilePath()
-      : Platform.script.resolve('../../../runtime/$path').toFilePath();
+  return Platform.script.resolve(path).toFilePath();
 }
 
 main() {
diff --git a/tests/standalone/io/file_lock_test.dart b/tests/standalone/io/file_lock_test.dart
index ca590c1..c24cbe2 100644
--- a/tests/standalone/io/file_lock_test.dart
+++ b/tests/standalone/io/file_lock_test.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// OtherResources=file_lock_script.dart
+
 import 'dart:async';
 import 'dart:io';
 
diff --git a/tests/standalone/io/file_read_special_device_test.dart b/tests/standalone/io/file_read_special_device_test.dart
index 482ac57..e57f777 100644
--- a/tests/standalone/io/file_read_special_device_test.dart
+++ b/tests/standalone/io/file_read_special_device_test.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// OtherResources=file_read_stdio_script.dart
+
 import 'package:expect/expect.dart';
 import 'package:path/path.dart';
 import 'dart:io';
diff --git a/tests/standalone/io/file_test.dart b/tests/standalone/io/file_test.dart
index 0519b92..8a8d681 100644
--- a/tests/standalone/io/file_test.dart
+++ b/tests/standalone/io/file_test.dart
@@ -4,6 +4,12 @@
 //
 // Dart test program for testing file I/O.
 
+// OtherResources=empty_file
+// OtherResources=file_test.txt
+// OtherResources=fixed_length_file
+// OtherResources=read_as_text.dat
+// OtherResources=readline_test1.dat
+
 import 'dart:async';
 import 'dart:convert';
 import 'dart:collection';
@@ -59,7 +65,7 @@
   // Test for file read functionality.
   static void testReadStream() {
     // Read a file and check part of it's contents.
-    String filename = getFilename("bin/file_test.cc");
+    String filename = getFilename("file_test.txt");
     File file = new File(filename);
     Expect.isTrue('$file'.contains(file.path));
     var subscription;
@@ -90,7 +96,7 @@
     asyncTestStarted();
 
     // Read a file.
-    String inFilename = getFilename("tests/vm/data/fixed_length_file");
+    String inFilename = getFilename("fixed_length_file");
     File file;
     int bytesRead;
 
@@ -226,7 +232,7 @@
   static void testRead() {
     asyncStart();
     // Read a file and check part of it's contents.
-    String filename = getFilename("bin/file_test.cc");
+    String filename = getFilename("file_test.txt");
     File file = new File(filename);
     file.open(mode: READ).then((RandomAccessFile file) {
       List<int> buffer = new List<int>(10);
@@ -252,7 +258,7 @@
 
   static void testReadSync() {
     // Read a file and check part of it's contents.
-    String filename = getFilename("bin/file_test.cc");
+    String filename = getFilename("file_test.txt");
     RandomAccessFile raf = (new File(filename)).openSync();
     List<int> buffer = new List<int>(42);
     int bytes_read = 0;
@@ -274,7 +280,7 @@
     Expect.equals(116, buffer[11]);  // represents 't' in the file.
     raf.closeSync();
 
-    filename = getFilename("tests/vm/data/fixed_length_file");
+    filename = getFilename("fixed_length_file");
     File file = new File(filename);
     int len = file.lengthSync();
     int read(int length) {
@@ -296,7 +302,7 @@
   static void testReadWrite() {
     asyncTestStarted();
     // Read a file.
-    String inFilename = getFilename("tests/vm/data/fixed_length_file");
+    String inFilename = getFilename("fixed_length_file");
     final File file = new File(inFilename);
     file.open(mode: READ).then((openedFile) {
       List<int> buffer1 = new List<int>(42);
@@ -437,7 +443,7 @@
 
   static void testReadWriteSync() {
     // Read a file.
-    String inFilename = getFilename("tests/vm/data/fixed_length_file");
+    String inFilename = getFilename("fixed_length_file");
     RandomAccessFile file = (new File(inFilename)).openSync();
     List<int> buffer1 = new List<int>(42);
     int bytes_read = 0;
@@ -475,7 +481,7 @@
 
   static void testReadWriteNoArgsSync() {
     // Read a file.
-    String inFilename = getFilename("tests/vm/data/fixed_length_file");
+    String inFilename = getFilename("fixed_length_file");
     RandomAccessFile file = (new File(inFilename)).openSync();
     List<int> buffer1 = new List<int>(42);
     int bytes_read = 0;
@@ -615,7 +621,7 @@
   // Test for file length functionality.
   static void testLength() {
     asyncTestStarted();
-    String filename = getFilename("tests/vm/data/fixed_length_file");
+    String filename = getFilename("fixed_length_file");
     File file = new File(filename);
     RandomAccessFile openedFile = file.openSync();
     openedFile.length().then((length) {
@@ -628,7 +634,7 @@
   }
 
   static void testLengthSync() {
-    String filename = getFilename("tests/vm/data/fixed_length_file");
+    String filename = getFilename("fixed_length_file");
     File file = new File(filename);
     RandomAccessFile openedFile = file.openSync();
     Expect.equals(42, file.lengthSync());
@@ -639,7 +645,7 @@
   // Test for file position functionality.
   static void testPosition() {
     asyncTestStarted();
-    String filename = getFilename("tests/vm/data/fixed_length_file");
+    String filename = getFilename("fixed_length_file");
     RandomAccessFile input = (new File(filename)).openSync();
     input.position().then((position) {
       Expect.equals(0, position);
@@ -664,7 +670,7 @@
   }
 
   static void testPositionSync() {
-    String filename = getFilename("tests/vm/data/fixed_length_file");
+    String filename = getFilename("fixed_length_file");
     RandomAccessFile input = (new File(filename)).openSync();
     Expect.equals(0, input.positionSync());
     List<int> buffer = new List<int>(100);
@@ -1056,7 +1062,7 @@
 
   static void testReadAsBytes() {
     asyncTestStarted();
-    var name = getFilename("tests/vm/data/fixed_length_file");
+    var name = getFilename("fixed_length_file");
     var f = new File(name);
     f.readAsBytes().then((bytes) {
       Expect.isTrue(new String.fromCharCodes(bytes).endsWith("42 bytes."));
@@ -1067,7 +1073,7 @@
 
   static void testReadAsBytesEmptyFile() {
     asyncTestStarted();
-    var name = getFilename("tests/vm/data/empty_file");
+    var name = getFilename("empty_file");
     var f = new File(name);
     f.readAsBytes().then((bytes) {
       Expect.equals(0, bytes.length);
@@ -1076,26 +1082,26 @@
   }
 
   static void testReadAsBytesSync() {
-    var name = getFilename("tests/vm/data/fixed_length_file");
+    var name = getFilename("fixed_length_file");
     var bytes = new File(name).readAsBytesSync();
     Expect.isTrue(new String.fromCharCodes(bytes).endsWith("42 bytes."));
     Expect.equals(bytes.length, 42);
   }
 
   static void testReadAsBytesSyncEmptyFile() {
-    var name = getFilename("tests/vm/data/empty_file");
+    var name = getFilename("empty_file");
     var bytes = new File(name).readAsBytesSync();
     Expect.equals(bytes.length, 0);
   }
 
   static void testReadAsText() {
     asyncTestStarted();
-    var name = getFilename("tests/vm/data/fixed_length_file");
+    var name = getFilename("fixed_length_file");
     var f = new File(name);
     f.readAsString(encoding: UTF8).then((text) {
       Expect.isTrue(text.endsWith("42 bytes."));
       Expect.equals(42, text.length);
-      var name = getFilename("tests/standalone/io/read_as_text.dat");
+      var name = getFilename("read_as_text.dat");
       var f = new File(name);
       f.readAsString(encoding: UTF8).then((text) {
         Expect.equals(6, text.length);
@@ -1118,7 +1124,7 @@
 
   static void testReadAsTextEmptyFile() {
     asyncTestStarted();
-    var name = getFilename("tests/vm/data/empty_file");
+    var name = getFilename("empty_file");
     var f = new File(name);
     f.readAsString(encoding: UTF8).then((text) {
       Expect.equals(0, text.length);
@@ -1128,11 +1134,11 @@
   }
 
   static void testReadAsTextSync() {
-    var name = getFilename("tests/vm/data/fixed_length_file");
+    var name = getFilename("fixed_length_file");
     var text = new File(name).readAsStringSync();
     Expect.isTrue(text.endsWith("42 bytes."));
     Expect.equals(42, text.length);
-    name = getFilename("tests/standalone/io/read_as_text.dat");
+    name = getFilename("read_as_text.dat");
     text = new File(name).readAsStringSync();
     Expect.equals(6, text.length);
     var expected = [955, 120, 46, 32, 120, 10];
@@ -1155,14 +1161,14 @@
   }
 
   static void testReadAsTextSyncEmptyFile() {
-    var name = getFilename("tests/vm/data/empty_file");
+    var name = getFilename("empty_file");
     var text = new File(name).readAsStringSync();
     Expect.equals(0, text.length);
   }
 
   static void testReadAsLines() {
     asyncTestStarted();
-    var name = getFilename("tests/vm/data/fixed_length_file");
+    var name = getFilename("fixed_length_file");
     var f = new File(name);
     f.readAsLines(encoding: UTF8).then((lines) {
       Expect.equals(1, lines.length);
@@ -1174,13 +1180,13 @@
   }
 
   static void testReadAsLinesSync() {
-    var name = getFilename("tests/vm/data/fixed_length_file");
+    var name = getFilename("fixed_length_file");
     var lines = new File(name).readAsLinesSync();
     Expect.equals(1, lines.length);
     var line = lines[0];
     Expect.isTrue(line.endsWith("42 bytes."));
     Expect.equals(42, line.length);
-    name = getFilename("tests/standalone/io/readline_test1.dat");
+    name = getFilename("readline_test1.dat");
     lines = new File(name).readAsLinesSync();
     Expect.equals(10, lines.length);
   }
@@ -1398,13 +1404,8 @@
     }
   }
 
-  // Helper method to be able to run the test from the runtime
-  // directory, or the top directory.
   static String getFilename(String path) {
-    var testPath = Platform.script.resolve('../../../$path');
-    return new File.fromUri(testPath).existsSync()
-        ? testPath.toFilePath()
-        : Platform.script.resolve('../../../runtime/$path').toFilePath();
+    return Platform.script.resolve(path).toFilePath();
   }
 
   // Main test entrypoint.
diff --git a/tests/standalone/io/file_test.txt b/tests/standalone/io/file_test.txt
new file mode 100644
index 0000000..4c2c0d1
--- /dev/null
+++ b/tests/standalone/io/file_test.txt
@@ -0,0 +1,63 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#include "bin/file.h"
+#include "platform/assert.h"
+#include "platform/globals.h"
+#include "vm/unit_test.h"
+
+namespace dart {
+namespace bin {
+
+// Helper method to be able to run the test from the runtime
+// directory, or the top directory.
+static const char* GetFileName(const char* name) {
+  if (File::Exists(name)) {
+    return name;
+  } else {
+    static const int kRuntimeLength = strlen("runtime/");
+    return name + kRuntimeLength;
+  }
+}
+
+
+TEST_CASE(Read) {
+  const char* kFilename = GetFileName("runtime/bin/file_test.cc");
+  File* file = File::Open(kFilename, File::kRead);
+  EXPECT(file != NULL);
+  char buffer[16];
+  buffer[0] = '\0';
+  EXPECT(file->ReadFully(buffer, 13));  // ReadFully returns true.
+  buffer[13] = '\0';
+  EXPECT_STREQ("// Copyright ", buffer);
+  EXPECT(!file->WriteByte(1));  // Cannot write to a read-only file.
+  file->Release();
+}
+
+
+TEST_CASE(FileLength) {
+  const char* kFilename =
+      GetFileName("runtime/tests/vm/data/fixed_length_file");
+  File* file = File::Open(kFilename, File::kRead);
+  EXPECT(file != NULL);
+  EXPECT_EQ(42, file->Length());
+  file->Release();
+}
+
+
+TEST_CASE(FilePosition) {
+  char buf[42];
+  const char* kFilename =
+      GetFileName("runtime/tests/vm/data/fixed_length_file");
+  File* file = File::Open(kFilename, File::kRead);
+  EXPECT(file != NULL);
+  EXPECT(file->ReadFully(buf, 12));
+  EXPECT_EQ(12, file->Position());
+  EXPECT(file->ReadFully(buf, 6));
+  EXPECT_EQ(18, file->Position());
+  file->Release();
+}
+
+}  // namespace bin
+}  // namespace dart
diff --git a/tests/standalone/io/fixed_length_file b/tests/standalone/io/fixed_length_file
new file mode 100644
index 0000000..52ce32d
--- /dev/null
+++ b/tests/standalone/io/fixed_length_file
@@ -0,0 +1 @@
+This file should contain exactly 42 bytes.
\ No newline at end of file
diff --git a/build/util/lib/common/__init__.py b/tests/standalone/io/fixed_length_file_out
similarity index 100%
copy from build/util/lib/common/__init__.py
copy to tests/standalone/io/fixed_length_file_out
diff --git a/tests/standalone/io/http_client_stays_alive_test.dart b/tests/standalone/io/http_client_stays_alive_test.dart
index 7355667..171eb38 100644
--- a/tests/standalone/io/http_client_stays_alive_test.dart
+++ b/tests/standalone/io/http_client_stays_alive_test.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// OtherResources=http_client_stays_alive_test.dart
+
 import 'dart:io';
 
 import "package:async_helper/async_helper.dart";
@@ -39,7 +41,9 @@
     });
 
     var sw = new Stopwatch()..start();
-    var arguments = packageOptions()..add(Platform.script.toString())..add(url);
+    var script = Platform.script.resolve('http_client_stays_alive_test.dart')
+        .toFilePath();
+    var arguments = packageOptions()..add(script)..add(url);
     Process.run(Platform.executable, arguments).then((res) {
       subscription.cancel();
       if (res.exitCode != 0) {
diff --git a/tests/standalone/io/http_proxy_advanced_test.dart b/tests/standalone/io/http_proxy_advanced_test.dart
index 7a349d1..8309fc7 100644
--- a/tests/standalone/io/http_proxy_advanced_test.dart
+++ b/tests/standalone/io/http_proxy_advanced_test.dart
@@ -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.
 
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/trusted_certs.pem
+
 import "package:convert/convert.dart";
 import "package:crypto/crypto.dart";
 import "package:expect/expect.dart";
diff --git a/tests/standalone/io/http_proxy_test.dart b/tests/standalone/io/http_proxy_test.dart
index 70a7f8c..2d2fdcb 100644
--- a/tests/standalone/io/http_proxy_test.dart
+++ b/tests/standalone/io/http_proxy_test.dart
@@ -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.
 
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/trusted_certs.pem
+
 import "package:convert/convert.dart";
 import "package:crypto/crypto.dart";
 import "package:expect/expect.dart";
diff --git a/tests/standalone/io/http_server_close_response_after_error_test.dart b/tests/standalone/io/http_server_close_response_after_error_test.dart
index c5cdcec..f768325 100644
--- a/tests/standalone/io/http_server_close_response_after_error_test.dart
+++ b/tests/standalone/io/http_server_close_response_after_error_test.dart
@@ -6,6 +6,7 @@
 // VMOptions=--short_socket_read
 // VMOptions=--short_socket_write
 // VMOptions=--short_socket_read --short_socket_write
+// OtherResources=http_server_close_response_after_error_client.dart
 
 import 'dart:async';
 import 'dart:io';
diff --git a/tests/standalone/io/http_server_response_test.dart b/tests/standalone/io/http_server_response_test.dart
index 967a508..c3c0afb 100644
--- a/tests/standalone/io/http_server_response_test.dart
+++ b/tests/standalone/io/http_server_response_test.dart
@@ -6,12 +6,18 @@
 // VMOptions=--short_socket_read
 // VMOptions=--short_socket_write
 // VMOptions=--short_socket_read --short_socket_write
+// OtherResources=http_server_response_test.dart
 
 import "package:expect/expect.dart";
 import "dart:async";
 import "dart:io";
 import "dart:typed_data";
 
+// Platform.script may refer to a AOT or JIT snapshot, which are significantly
+// larger.
+File scriptSource = new File(
+    Platform.script.resolve("http_server_response_test.dart").toFilePath());
+
 void testServerRequest(void handler(server, request),
                        {int bytes,
                         bool closeClient}) {
@@ -81,7 +87,7 @@
 
 
 void testResponseAddStream() {
-  File file = new File(Platform.script.toFilePath());
+  File file = scriptSource;
   int bytes = file.lengthSync();
 
   testServerRequest((server, request) {
@@ -130,7 +136,7 @@
 
 
 void testResponseAddStreamClosed() {
-  File file = new File(Platform.script.toFilePath());
+  File file = scriptSource;
   testServerRequest((server, request) {
     request.response.addStream(file.openRead())
         .then((response) {
@@ -160,7 +166,7 @@
 
 
 void testResponseAddClosed() {
-  File file = new File(Platform.script.toFilePath());
+  File file = scriptSource;
   testServerRequest((server, request) {
     request.response.add(file.readAsBytesSync());
     request.response.close();
diff --git a/tests/standalone/io/https_bad_certificate_test.dart b/tests/standalone/io/https_bad_certificate_test.dart
index cafacfb..6205bb3 100644
--- a/tests/standalone/io/https_bad_certificate_test.dart
+++ b/tests/standalone/io/https_bad_certificate_test.dart
@@ -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.
 
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/trusted_certs.pem
+
 // This test verifies that the bad certificate callback works in HttpClient.
 
 import "dart:async";
diff --git a/tests/standalone/io/https_server_test.dart b/tests/standalone/io/https_server_test.dart
index 3f9bc52..f49ac12 100644
--- a/tests/standalone/io/https_server_test.dart
+++ b/tests/standalone/io/https_server_test.dart
@@ -1,6 +1,10 @@
 // Copyright (c) 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.
+//
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/trusted_certs.pem
 
 import "dart:async";
 import "dart:io";
diff --git a/tests/standalone/io/https_unauthorized_test.dart b/tests/standalone/io/https_unauthorized_test.dart
index a556626..6bded12 100644
--- a/tests/standalone/io/https_unauthorized_test.dart
+++ b/tests/standalone/io/https_unauthorized_test.dart
@@ -1,6 +1,13 @@
 // 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.
+//
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/untrusted_server_chain.pem
+// OtherResources=certificates/untrusted_server_key.pem
+// OtherResources=certificates/trusted_certs.pem
+// OtherResources=https_unauthorized_client.dart
 
 // This test verifies that secure connections that fail due to
 // unauthenticated certificates throw exceptions in HttpClient.
@@ -35,9 +42,7 @@
 }
 
 void main() {
-  var clientScript = Platform.script
-                             .resolve('https_unauthorized_client.dart')
-                             .toFilePath();
+  var clientScript = localFile('https_unauthorized_client.dart');
   Future clientProcess(int port) {
     return Process.run(Platform.executable,
         [clientScript, port.toString()])
diff --git a/tests/standalone/io/pipe_server_test.dart b/tests/standalone/io/pipe_server_test.dart
index 6481a91..f0cba0e 100644
--- a/tests/standalone/io/pipe_server_test.dart
+++ b/tests/standalone/io/pipe_server_test.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 //
+// OtherResources=readline_test1.dat
+//
 // VMOptions=
 // VMOptions=--short_socket_read
 // VMOptions=--short_socket_write
@@ -18,7 +20,7 @@
 
 
 String getDataFilename(String path) =>
-    new File(path).existsSync() ? path : '../$path';
+    Platform.script.resolve(path).toFilePath();
 
 
 bool compareFileContent(String fileName1, String fileName2) {
@@ -47,7 +49,7 @@
 
     void connectHandler() {
       String srcFileName =
-          getDataFilename("tests/standalone/io/readline_test1.dat");
+          getDataFilename("readline_test1.dat");
       Stream fileInput = new File(srcFileName).openRead();
       fileInput.pipe(_socket).then((_) {
         var tempDir = Directory.systemTemp.createTempSync('dart_pipe_server');
diff --git a/tests/standalone/io/print_sync_test.dart b/tests/standalone/io/print_sync_test.dart
index f709df6..f076f41c 100644
--- a/tests/standalone/io/print_sync_test.dart
+++ b/tests/standalone/io/print_sync_test.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// OtherResources=print_sync_script.dart
+
 import 'dart:io';
 
 import "package:expect/expect.dart";
diff --git a/tests/standalone/io/process_detached_test.dart b/tests/standalone/io/process_detached_test.dart
index 194e756..b72f26a 100644
--- a/tests/standalone/io/process_detached_test.dart
+++ b/tests/standalone/io/process_detached_test.dart
@@ -1,7 +1,9 @@
 // Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
-//
+
+// OtherResources=process_detached_script.dart
+
 // Process test program to test detached processes.
 
 import 'dart:async';
diff --git a/tests/standalone/io/process_set_exit_code_test.dart b/tests/standalone/io/process_set_exit_code_test.dart
index 4dded0c..64182c1 100644
--- a/tests/standalone/io/process_set_exit_code_test.dart
+++ b/tests/standalone/io/process_set_exit_code_test.dart
@@ -1,7 +1,9 @@
 // Copyright (c) 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.
-//
+
+// OtherResources=process_set_exit_code_script.dart
+
 // Process test program to test process communication.
 
 library ProcessSetExitCodeTest;
diff --git a/tests/standalone/io/process_shell_test.dart b/tests/standalone/io/process_shell_test.dart
index 91442fe..f1acdc9 100644
--- a/tests/standalone/io/process_shell_test.dart
+++ b/tests/standalone/io/process_shell_test.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// OtherResources=process_echo_util.dart
+
 import "package:path/path.dart";
 import "package:async_helper/async_helper.dart";
 import "dart:io";
@@ -11,9 +13,9 @@
 void testRunShell() {
   test(args) {
     asyncStart();
-    var path = Platform.script.resolve("process_echo_util.dart").toFilePath();
+    var script = Platform.script.resolve("process_echo_util.dart").toFilePath();
     Process.run(Platform.executable,
-                [path]..addAll(args),
+                [script]..addAll(args),
                 runInShell: true)
         .then((result) {
           if (Platform.operatingSystem == "windows") {
diff --git a/tests/standalone/io/process_sync_test.dart b/tests/standalone/io/process_sync_test.dart
index 7601ddf..4d4b10f 100644
--- a/tests/standalone/io/process_sync_test.dart
+++ b/tests/standalone/io/process_sync_test.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// OtherResources=process_sync_script.dart
+
 import "package:expect/expect.dart";
 import 'package:path/path.dart';
 import "dart:io";
diff --git a/tests/standalone/io/raw_secure_server_closing_test.dart b/tests/standalone/io/raw_secure_server_closing_test.dart
index e6c084a..fc73018 100644
--- a/tests/standalone/io/raw_secure_server_closing_test.dart
+++ b/tests/standalone/io/raw_secure_server_closing_test.dart
@@ -6,6 +6,9 @@
 // VMOptions=--short_socket_read
 // VMOptions=--short_socket_write
 // VMOptions=--short_socket_read --short_socket_write
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/trusted_certs.pem
 
 import "dart:async";
 import "dart:io";
diff --git a/tests/standalone/io/raw_secure_server_socket_test.dart b/tests/standalone/io/raw_secure_server_socket_test.dart
index b9c7e9b..7b5ef57 100644
--- a/tests/standalone/io/raw_secure_server_socket_test.dart
+++ b/tests/standalone/io/raw_secure_server_socket_test.dart
@@ -6,6 +6,11 @@
 // VMOptions=--short_socket_read
 // VMOptions=--short_socket_write
 // VMOptions=--short_socket_read --short_socket_write
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/trusted_certs.pem
+// OtherResources=certificates/untrusted_server_chain.pem
+// OtherResources=certificates/untrusted_server_key.pem
 
 import "dart:async";
 import "dart:io";
diff --git a/tests/standalone/io/raw_secure_socket_pause_test.dart b/tests/standalone/io/raw_secure_socket_pause_test.dart
index 0073cda..5d9b8f6 100644
--- a/tests/standalone/io/raw_secure_socket_pause_test.dart
+++ b/tests/standalone/io/raw_secure_socket_pause_test.dart
@@ -6,6 +6,9 @@
 // VMOptions=--short_socket_read
 // VMOptions=--short_socket_write
 // VMOptions=--short_socket_read --short_socket_write
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/trusted_certs.pem
 
 import "package:expect/expect.dart";
 import "package:path/path.dart";
diff --git a/tests/standalone/io/raw_secure_socket_test.dart b/tests/standalone/io/raw_secure_socket_test.dart
index df3994e..5af28f9 100644
--- a/tests/standalone/io/raw_secure_socket_test.dart
+++ b/tests/standalone/io/raw_secure_socket_test.dart
@@ -6,6 +6,9 @@
 // VMOptions=--short_socket_read
 // VMOptions=--short_socket_write
 // VMOptions=--short_socket_read --short_socket_write
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/trusted_certs.pem
 
 import "package:expect/expect.dart";
 import "package:path/path.dart";
diff --git a/tests/standalone/io/read_into_const_list_test.dart b/tests/standalone/io/read_into_const_list_test.dart
index 3eb624a..11e56ce 100644
--- a/tests/standalone/io/read_into_const_list_test.dart
+++ b/tests/standalone/io/read_into_const_list_test.dart
@@ -1,6 +1,8 @@
 // Copyright (c) 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.
+//
+// OtherResources=readline_test1.dat
 
 // Regression test for missing immutability check in the ListSet
 // methods in the API. This allowed overwriting const Lists.
@@ -9,19 +11,15 @@
 import "dart:io";
 
 String getFilename(String path) {
-  var testPath = Platform.script.resolve('../../../$path');
-  return new File.fromUri(testPath).existsSync()
-      ? testPath.toFilePath()
-      : Platform.script.resolve('../../../runtime/$path').toFilePath();
+  return Platform.script.resolve(path).toFilePath();
 }
 
-
 void main() {
   var a = const [0];
   var b = const [0];
   Expect.identical(a, b);
 
-  String filename = getFilename("bin/file_test.cc");
+  String filename = getFilename("readline_test1.dat");
   File file = new File(filename);
   file.open().then((input) {
       try {
diff --git a/tests/standalone/io/regress_21160_test.dart b/tests/standalone/io/regress_21160_test.dart
index b3d39f1..c4c4f13 100644
--- a/tests/standalone/io/regress_21160_test.dart
+++ b/tests/standalone/io/regress_21160_test.dart
@@ -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.
 
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/trusted_certs.pem
+
 import "package:expect/expect.dart";
 import "package:path/path.dart";
 import "package:async_helper/async_helper.dart";
diff --git a/tests/standalone/io/regress_7191_test.dart b/tests/standalone/io/regress_7191_test.dart
index 5a8a7ea..be15856 100644
--- a/tests/standalone/io/regress_7191_test.dart
+++ b/tests/standalone/io/regress_7191_test.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// OtherResources=regress_7191_script.dart
+
 // Regression test for http://dartbug.com/7191.
 
 // Starts a sub-process which in turn starts another sub-process and then closes
diff --git a/tests/standalone/io/resolve_symbolic_links_test.dart b/tests/standalone/io/resolve_symbolic_links_test.dart
index 690cbc5..4d3f22e 100644
--- a/tests/standalone/io/resolve_symbolic_links_test.dart
+++ b/tests/standalone/io/resolve_symbolic_links_test.dart
@@ -11,7 +11,8 @@
 import 'dart:io';
 
 main() {
-  String testsDir = Platform.script.resolve('../..').toFilePath();
+  String testsDir = Directory.current.uri.resolve('tests').toFilePath();
+
   // All of these tests test that resolveSymbolicLinks gives a path
   // that points to the same place as the original, and that it removes
   // all links, .., and . segments, and that it produces an absolute path.
diff --git a/tests/standalone/io/secure_bad_certificate_test.dart b/tests/standalone/io/secure_bad_certificate_test.dart
index 7b28284..c4e81cc 100644
--- a/tests/standalone/io/secure_bad_certificate_test.dart
+++ b/tests/standalone/io/secure_bad_certificate_test.dart
@@ -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.
 
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/trusted_certs.pem
+
 // This test verifies that the bad certificate callback works.
 
 import "dart:async";
diff --git a/tests/standalone/io/secure_client_raw_server_test.dart b/tests/standalone/io/secure_client_raw_server_test.dart
index e8cb63d..20f7a3f 100644
--- a/tests/standalone/io/secure_client_raw_server_test.dart
+++ b/tests/standalone/io/secure_client_raw_server_test.dart
@@ -6,6 +6,9 @@
 // VMOptions=--short_socket_read
 // VMOptions=--short_socket_write
 // VMOptions=--short_socket_read --short_socket_write
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/trusted_certs.pem
 
 import "dart:async";
 import "dart:io";
diff --git a/tests/standalone/io/secure_client_server_test.dart b/tests/standalone/io/secure_client_server_test.dart
index 4d928ef..1c16908 100644
--- a/tests/standalone/io/secure_client_server_test.dart
+++ b/tests/standalone/io/secure_client_server_test.dart
@@ -6,6 +6,9 @@
 // VMOptions=--short_socket_read
 // VMOptions=--short_socket_write
 // VMOptions=--short_socket_read --short_socket_write
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/trusted_certs.pem
 
 import "dart:async";
 import "dart:io";
diff --git a/tests/standalone/io/secure_multiple_client_server_test.dart b/tests/standalone/io/secure_multiple_client_server_test.dart
index a0577df..add0c9c 100644
--- a/tests/standalone/io/secure_multiple_client_server_test.dart
+++ b/tests/standalone/io/secure_multiple_client_server_test.dart
@@ -6,6 +6,9 @@
 // VMOptions=--short_socket_read
 // VMOptions=--short_socket_write
 // VMOptions=--short_socket_read --short_socket_write
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/trusted_certs.pem
 
 import "dart:async";
 import "dart:io";
diff --git a/tests/standalone/io/secure_server_client_certificate_test.dart b/tests/standalone/io/secure_server_client_certificate_test.dart
index 4c16ab0..561ea33 100644
--- a/tests/standalone/io/secure_server_client_certificate_test.dart
+++ b/tests/standalone/io/secure_server_client_certificate_test.dart
@@ -2,6 +2,19 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/trusted_certs.pem
+// OtherResources=certificates/client_authority.pem
+// OtherResources=certificates/client1.pem
+// OtherResources=certificates/client1_key.pem
+// OtherResources=certificates/server_chain.p12
+// OtherResources=certificates/server_key.p12
+// OtherResources=certificates/trusted_certs.p12
+// OtherResources=certificates/client_authority.p12
+// OtherResources=certificates/client1.p12
+// OtherResources=certificates/client1_key.p12
+
 import "dart:async";
 import "dart:io";
 
diff --git a/tests/standalone/io/secure_server_closing_test.dart b/tests/standalone/io/secure_server_closing_test.dart
index 159c6ae4..10a730d 100644
--- a/tests/standalone/io/secure_server_closing_test.dart
+++ b/tests/standalone/io/secure_server_closing_test.dart
@@ -6,6 +6,9 @@
 // VMOptions=--short_socket_read
 // VMOptions=--short_socket_write
 // VMOptions=--short_socket_read --short_socket_write
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/trusted_certs.pem
 
 import "dart:async";
 import "dart:io";
diff --git a/tests/standalone/io/secure_server_socket_test.dart b/tests/standalone/io/secure_server_socket_test.dart
index 2af0510..767c531 100644
--- a/tests/standalone/io/secure_server_socket_test.dart
+++ b/tests/standalone/io/secure_server_socket_test.dart
@@ -6,6 +6,9 @@
 // VMOptions=--short_socket_read
 // VMOptions=--short_socket_write
 // VMOptions=--short_socket_read --short_socket_write
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/trusted_certs.pem
 
 import "dart:async";
 import "dart:io";
diff --git a/tests/standalone/io/secure_session_resume_test.dart b/tests/standalone/io/secure_session_resume_test.dart
index 15f2b0b..f48a888 100644
--- a/tests/standalone/io/secure_session_resume_test.dart
+++ b/tests/standalone/io/secure_session_resume_test.dart
@@ -15,6 +15,9 @@
 // VMOptions=--short_socket_read
 // VMOptions=--short_socket_write
 // VMOptions=--short_socket_read --short_socket_write
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/trusted_certs.pem
 
 import "dart:async";
 import "dart:io";
diff --git a/tests/standalone/io/secure_socket_alpn_test.dart b/tests/standalone/io/secure_socket_alpn_test.dart
index 8bd4e27..6b835e6 100644
--- a/tests/standalone/io/secure_socket_alpn_test.dart
+++ b/tests/standalone/io/secure_socket_alpn_test.dart
@@ -1,6 +1,10 @@
 // Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
+//
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/trusted_certs.pem
 
 import 'dart:io';
 import 'dart:convert';
diff --git a/tests/standalone/io/secure_socket_renegotiate_test.dart b/tests/standalone/io/secure_socket_renegotiate_test.dart
index 457cee6..e445ed4 100644
--- a/tests/standalone/io/secure_socket_renegotiate_test.dart
+++ b/tests/standalone/io/secure_socket_renegotiate_test.dart
@@ -1,6 +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.
+//
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
 
 // This test verifies that client certificates work, if the client and server
 // are in separate processes, and that connection renegotiation works, and
diff --git a/tests/standalone/io/secure_socket_test.dart b/tests/standalone/io/secure_socket_test.dart
index bf128df..9a92757 100644
--- a/tests/standalone/io/secure_socket_test.dart
+++ b/tests/standalone/io/secure_socket_test.dart
@@ -6,6 +6,12 @@
 // VMOptions=--short_socket_read
 // VMOptions=--short_socket_write
 // VMOptions=--short_socket_read --short_socket_write
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/trusted_certs.pem
+// OtherResources=certificates/server_chain.p12
+// OtherResources=certificates/server_key.p12
+// OtherResources=certificates/trusted_certs.p12
 
 import "package:async_helper/async_helper.dart";
 import "package:expect/expect.dart";
diff --git a/tests/standalone/io/secure_unauthorized_test.dart b/tests/standalone/io/secure_unauthorized_test.dart
index a600d74..b0d8823 100644
--- a/tests/standalone/io/secure_unauthorized_test.dart
+++ b/tests/standalone/io/secure_unauthorized_test.dart
@@ -2,6 +2,12 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// OtherResources=certificates/untrusted_server_chain.pem
+// OtherResources=certificates/untrusted_server_key.pem
+// OtherResources=certificates/untrusted_server_chain.pem
+// OtherResources=certificates/trusted_certs.pem
+// OtherResources=secure_unauthorized_client.dart
+
 // This test verifies that failing secure connection attempts always complete
 // their returned future.
 
@@ -32,9 +38,7 @@
 }
 
 void main() {
-  var clientScript = Platform.script
-                             .resolve('secure_unauthorized_client.dart')
-                             .toFilePath();
+  var clientScript = localFile('secure_unauthorized_client.dart');
 
   Future clientProcess(int port) {
     return Process.run(Platform.executable,
diff --git a/tests/standalone/io/security_context_argument_test.dart b/tests/standalone/io/security_context_argument_test.dart
index fc6ff1c..117d257 100644
--- a/tests/standalone/io/security_context_argument_test.dart
+++ b/tests/standalone/io/security_context_argument_test.dart
@@ -1,6 +1,15 @@
 // Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
+//
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/server_key.p12
+// OtherResources=certificates/client1_key_malformed.pem
+// OtherResources=certificates/trusted_certs_malformed.pem
+// OtherResources=certificates/server_chain_malformed1.pem
+// OtherResources=certificates/server_chain_malformed2.pem
+// OtherResources=certificates/client_authority_malformed.pem
 
 import "package:expect/expect.dart";
 import "dart:io";
diff --git a/tests/standalone/io/signals_test.dart b/tests/standalone/io/signals_test.dart
index a811208..910c2c4 100644
--- a/tests/standalone/io/signals_test.dart
+++ b/tests/standalone/io/signals_test.dart
@@ -2,6 +2,9 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// OtherResources=signal_test_script.dart
+// OtherResources=signals_test_script.dart
+
 import "dart:io";
 import "dart:convert";
 
diff --git a/tests/standalone/io/skipping_dart2js_compilations_test.dart b/tests/standalone/io/skipping_dart2js_compilations_test.dart
index c175383..da24696 100644
--- a/tests/standalone/io/skipping_dart2js_compilations_test.dart
+++ b/tests/standalone/io/skipping_dart2js_compilations_test.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// OtherResources=skipping_dart2js_compilations_helper.dart
+
 /*
  * This test makes sure that the "skipping Dart2Js compilations if the output is
  * already up to date" feature does work as it should.
diff --git a/tests/standalone/io/socket_info_ipv4_test.dart b/tests/standalone/io/socket_info_ipv4_test.dart
new file mode 100644
index 0000000..f8d63bd
--- /dev/null
+++ b/tests/standalone/io/socket_info_ipv4_test.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+import "dart:io";
+
+void testHostAndPort() {
+  ServerSocket.bind("127.0.0.1", 0).then((server) {
+
+    Socket.connect("127.0.0.1", server.port).then((clientSocket) {
+      server.listen((socket) {
+        Expect.equals(socket.port, server.port);
+        Expect.equals(clientSocket.port, socket.remotePort);
+        Expect.equals(clientSocket.remotePort, socket.port);
+        Expect.equals(socket.remoteAddress.address, "127.0.0.1");
+        Expect.equals(socket.remoteAddress.type,
+                      InternetAddressType.IP_V4);
+        Expect.equals(clientSocket.remoteAddress.address, "127.0.0.1");
+        Expect.equals(clientSocket.remoteAddress.type,
+                      InternetAddressType.IP_V4);
+        socket.destroy();
+        clientSocket.destroy();
+        server.close();
+      });
+    });
+  });
+}
+
+void main() {
+  testHostAndPort();
+}
diff --git a/tests/standalone/io/socket_info_ipv6_test.dart b/tests/standalone/io/socket_info_ipv6_test.dart
new file mode 100644
index 0000000..d6969ab
--- /dev/null
+++ b/tests/standalone/io/socket_info_ipv6_test.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+import "dart:io";
+
+void testHostAndPort() {
+  ServerSocket.bind("::1", 0).then((server) {
+
+    Socket.connect("::1", server.port).then((clientSocket) {
+      server.listen((socket) {
+        Expect.equals(socket.port, server.port);
+        Expect.equals(clientSocket.port, socket.remotePort);
+        Expect.equals(clientSocket.remotePort, socket.port);
+        Expect.equals(socket.remoteAddress.address, "::1");
+        Expect.equals(socket.remoteAddress.type,
+                      InternetAddressType.IP_V6);
+        Expect.equals(clientSocket.remoteAddress.address, "::1");
+        Expect.equals(clientSocket.remoteAddress.type,
+                      InternetAddressType.IP_V6);
+        socket.destroy();
+        clientSocket.destroy();
+        server.close();
+      });
+    });
+  });
+}
+
+void main() {
+  testHostAndPort();
+}
diff --git a/tests/standalone/io/socket_info_test.dart b/tests/standalone/io/socket_info_test.dart
deleted file mode 100644
index eb14246..0000000
--- a/tests/standalone/io/socket_info_test.dart
+++ /dev/null
@@ -1,28 +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.
-
-import "package:expect/expect.dart";
-import "dart:io";
-
-void testHostAndPort() {
-  ServerSocket.bind("127.0.0.1", 0).then((server) {
-
-    Socket.connect("127.0.0.1", server.port).then((clientSocket) {
-      server.listen((socket) {
-        Expect.equals(socket.port, server.port);
-        Expect.equals(clientSocket.port, socket.remotePort);
-        Expect.equals(clientSocket.remotePort, socket.port);
-        Expect.equals(socket.remoteAddress.address, "127.0.0.1");
-        Expect.equals(clientSocket.remoteAddress.address, "127.0.0.1");
-        socket.destroy();
-        clientSocket.destroy();
-        server.close();
-      });
-    });
-  });
-}
-
-void main() {
-  testHostAndPort();
-}
diff --git a/tests/standalone/io/socket_upgrade_to_secure_test.dart b/tests/standalone/io/socket_upgrade_to_secure_test.dart
index b4c862b..3822300 100644
--- a/tests/standalone/io/socket_upgrade_to_secure_test.dart
+++ b/tests/standalone/io/socket_upgrade_to_secure_test.dart
@@ -6,6 +6,9 @@
 // VMOptions=--short_socket_read
 // VMOptions=--short_socket_write
 // VMOptions=--short_socket_read --short_socket_write
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/trusted_certs.pem
 
 import "dart:async";
 import "dart:io";
diff --git a/tests/standalone/io/stdin_sync_test.dart b/tests/standalone/io/stdin_sync_test.dart
index 470f34b..e9e5610 100644
--- a/tests/standalone/io/stdin_sync_test.dart
+++ b/tests/standalone/io/stdin_sync_test.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// OtherResources=stdin_sync_script.dart
+
 import "dart:convert";
 import "dart:io";
 
diff --git a/tests/standalone/io/stdio_implicit_close_test.dart b/tests/standalone/io/stdio_implicit_close_test.dart
index dc67f0e..07e8dc0 100644
--- a/tests/standalone/io/stdio_implicit_close_test.dart
+++ b/tests/standalone/io/stdio_implicit_close_test.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// OtherResources=stdio_implicit_close_script.dart
+
 import "package:async_helper/async_helper.dart";
 import "package:expect/expect.dart";
 import "dart:convert";
diff --git a/tests/standalone/io/stdio_nonblocking_test.dart b/tests/standalone/io/stdio_nonblocking_test.dart
index 69220e9..d788fb5 100644
--- a/tests/standalone/io/stdio_nonblocking_test.dart
+++ b/tests/standalone/io/stdio_nonblocking_test.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// OtherResources=stdio_nonblocking_script.dart
+
 import "dart:convert";
 import "dart:io";
 
diff --git a/tests/standalone/io/stream_pipe_test.dart b/tests/standalone/io/stream_pipe_test.dart
index 2504e77..1945a7b 100644
--- a/tests/standalone/io/stream_pipe_test.dart
+++ b/tests/standalone/io/stream_pipe_test.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 //
+// OtherResources=readline_test1.dat
+//
 // VMOptions=
 // VMOptions=--short_socket_read
 // VMOptions=--short_socket_write
@@ -15,7 +17,7 @@
 // Helper method to be able to run the test from the runtime
 // directory, or the top directory.
 String getDataFilename(String path) =>
-    new File(path).existsSync() ? path : '../$path';
+    Platform.script.resolve(path).toFilePath();
 
 
 bool compareFileContent(String fileName1,
@@ -64,7 +66,7 @@
   asyncStart();
 
   String srcFileName =
-      getDataFilename("tests/standalone/io/readline_test1.dat");
+      getDataFilename("readline_test1.dat");
   var srcStream = new File(srcFileName).openRead();
 
   var tempDir = Directory.systemTemp.createTempSync('dart_stream_pipe');
@@ -89,7 +91,7 @@
   asyncStart();
 
   String srcFileName =
-      getDataFilename("tests/standalone/io/readline_test1.dat");
+      getDataFilename("readline_test1.dat");
   var srcFile = new File(srcFileName);
   var srcStream = srcFile.openRead();
 
@@ -131,7 +133,7 @@
   asyncStart();
 
   String srcFileName =
-      getDataFilename("tests/standalone/io/readline_test1.dat");
+      getDataFilename("readline_test1.dat");
   var srcFile = new File(srcFileName);
   var srcStream = srcFile.openRead();
 
diff --git a/tests/standalone/io/test_extension_test.dart b/tests/standalone/io/test_extension_test.dart
index 40d768e..cf98925 100644
--- a/tests/standalone/io/test_extension_test.dart
+++ b/tests/standalone/io/test_extension_test.dart
@@ -56,6 +56,7 @@
   if (buildDirectory.endsWith('SIMARM')) return '';
   if (buildDirectory.endsWith('SIMARM64')) return '';
   if (buildDirectory.endsWith('SIMDBC')) return '';
+  if (buildDirectory.endsWith('SIMDBC64')) return '';
   if (buildDirectory.endsWith('SIMMIPS')) return '';
   if (buildDirectory.endsWith('ARM')) return '-arm';
   if (buildDirectory.endsWith('ARM64')) return '-arm64';
diff --git a/tests/standalone/io/test_runner_test.dart b/tests/standalone/io/test_runner_test.dart
index d4d6076..e9f3276 100644
--- a/tests/standalone/io/test_runner_test.dart
+++ b/tests/standalone/io/test_runner_test.dart
@@ -12,7 +12,7 @@
 import "../../../tools/testing/dart/test_options.dart";
 import "process_test_util.dart";
 
-final DEFAULT_TIMEOUT = 10;
+final DEFAULT_TIMEOUT = 20;
 final LONG_TIMEOUT = 30;
 
 List<String> packageOptions() {
diff --git a/tests/standalone/io/uri_platform_test.dart b/tests/standalone/io/uri_platform_test.dart
index cc67760..45da0e3 100644
--- a/tests/standalone/io/uri_platform_test.dart
+++ b/tests/standalone/io/uri_platform_test.dart
@@ -3,6 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import "package:expect/expect.dart";
+import 'package:path/path.dart' as path;
 import "dart:io";
 
 main() {
@@ -36,7 +37,12 @@
     Expect.equals("a/b", new Uri.file("a/b").toFilePath());
     Expect.equals("a\\b", new Uri.file("a\\b").toFilePath());
   }
-
-  Expect.equals(Uri.base,
-                new Uri.file(Directory.current.path + Platform.pathSeparator));
+  // If the current path is only the root prefix (/ (or c:\), then don't add a
+  // separator at the end.
+  Expect.equals(
+      Uri.base,
+      (Directory.current.path.toString() !=
+       path.rootPrefix(Directory.current.path.toString()))
+      ? new Uri.file(Directory.current.path + Platform.pathSeparator)
+      : new Uri.file(Directory.current.path));
 }
diff --git a/tests/standalone/io/web_socket_error_test.dart b/tests/standalone/io/web_socket_error_test.dart
index 42b93d4..5003832 100644
--- a/tests/standalone/io/web_socket_error_test.dart
+++ b/tests/standalone/io/web_socket_error_test.dart
@@ -6,6 +6,8 @@
 // VMOptions=--short_socket_read
 // VMOptions=--short_socket_write
 // VMOptions=--short_socket_read --short_socket_write
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
 
 library dart.io;
 
diff --git a/tests/standalone/packages_file_test.dart b/tests/standalone/packages_file_test.dart
index d41e46b..b36bc83 100644
--- a/tests/standalone/packages_file_test.dart
+++ b/tests/standalone/packages_file_test.dart
@@ -209,7 +209,7 @@
 // * A variable defined in a library loaded using a `package:` URI.
 //
 // The configurations all have URIs as `root`, `config` and `mainFile` strings,
-// have empty argument lists and `mainFile` points to the the `main.dart` file.
+// have empty argument lists and `mainFile` points to the `main.dart` file.
 void createConfigurations() {
   add(String description, String mainDir, {String root, String config,
       Map file, Map http, Map expect}) {
diff --git a/tests/standalone/standalone.status b/tests/standalone/standalone.status
index dc43ab8..dfc31c0 100644
--- a/tests/standalone/standalone.status
+++ b/tests/standalone/standalone.status
@@ -16,15 +16,12 @@
 package/scenarios/empty_packages_file/empty_packages_file_option_test: Fail, OK # CompileTimeErrors intentionally
 package/scenarios/invalid/invalid_package_name_test: RuntimeError, CompileTimeError # Errors intentionally
 package/scenarios/invalid/same_package_twice_test.dart: RuntimeError, CompileTimeError # Errors intentionally
-full_coverage_test: Pass, Slow, Timeout
 
 issue14236_test: Pass # Do not remove this line. It serves as a marker for Issue 14516 comment #4.
 
-[ ($runtime != vm || $compiler != none) && $compiler != dartanalyzer && $compiler != dart2analyzer ]
-packages_file_test: Skip # Uses Platform.executable
-
 [ ($runtime != vm && $runtime != dart_precompiled && $runtime != dart_app) && ($runtime != drt || $compiler != none)) ]
 no_assert_test: Fail, OK # This is testing a vm flag.
+env_test: Skip # This is testing a vm command line parsing scenario.
 
 [ ($runtime == vm || $runtime == dart_precompiled || $runtime == dart_app) ]
 package/package_isolate_test: Fail # Issue 12474
@@ -66,7 +63,6 @@
 typed_data_isolate_test: SkipByDesign # This test uses dart:io
 io/*: SkipByDesign # Don't run tests using dart:io in the browser
 package/*: Skip # Do not run those in Dartium.
-full_coverage_test: Skip
 http_launch_test: Skip
 vmservice/*: SkipByDesign # Do not run standalone vm service tests in browser.
 issue14236_test: Skip # Issue 14236 Script snapshots do not work in the browser.
@@ -75,10 +71,10 @@
 map_insert_remove_oom_test: Skip  # Issue 24571
 verbose_gc_to_bmu_test: Skip
 regress_26031_test: SkipByDesign # Standalone only test
+env_test: Skip # This is testing a vm command line parsing scenario.
 
 [ $compiler == dartanalyzer || $compiler == dart2analyzer ]
 issue14236_test: Skip # Analyzer can't handle Script snapshots.
-fixed_precision_double_test: Skip # double p getter only implemented in VM.
 
 # test issue https://code.google.com/p/dart/issues/detail?id=11518
 io/file_constructor_test: fail
@@ -103,7 +99,6 @@
 package/package_test: Fail, OK # dart2js does not support 'package:foo.dart' imports
 package/package1_test: Fail, OK # dart2js does not support 'package:foo.dart' imports
 package/scenarios/invalid/*: CompileTimeError  # Negative tests expecting CompileTimeErrors.
-full_coverage_test: Skip
 left_shift_bit_and_op_test: Skip # Integers exceed dart2js precision.
 pow_test: Skip # Precision > 53 bits.
 double_smi_comparison_test: Skip # Precision > 53 bits.
@@ -115,7 +110,6 @@
 pair_location_remapping_test: Skip
 regress_25335_test: Skip # Int64List not supported.
 deferred_transitive_import_error_test: Skip # Contains intentional errors.
-fixed_precision_double_test: Skip # double p getter only implemented in VM.
 
 [ $compiler == dart2js && $cps_ir && $checked ]
 *: Skip # `assert` not implemented
@@ -161,7 +155,6 @@
 [ $arch == mips && $mode == debug ]
 io/web_socket_test: SkipSlow # Times out. Issue 20352
 io/test_runner_test: Skip # Flakily times out in a subtest. Issue 201351
-full_coverage_test: SkipSlow # Times out. Issue 20352
 io/http_client_stays_alive_test: Skip # Timing dependent test, MIPS machine too slow.
 
 [ $compiler == none && $runtime == dartium && $unchecked ]
@@ -202,9 +195,9 @@
 io/platform_resolved_executable_test/06: RuntimeError  # Issue 23641
 io/process_sync_test: Pass, Timeout # Issue 24596
 io/sleep_test: Pass, Fail # Issue 25757
+io/socket_info_ipv6_test: RuntimeError # Issue 27876
 
 [ ($runtime == vm || $runtime == dart_precompiled || $runtime == dart_app) && $mode == debug && $builder_tag == asan ]
-full_coverage_test: Skip  # Timeout.
 io/file_lock_test: Skip  # Timeout.
 io/test_runner_test: Skip  # Timeout.
 io/http_client_stays_alive_test: Skip  # Timeout.
@@ -227,56 +220,56 @@
 map_insert_remove_oom_test: Skip # Heap limit too low. Increasing iteration count to make a higher limit a meaningful test makes it too slow for simarm[64] bots.
 io/web_socket_test: Pass, RuntimeError # Issue 24674
 
-[ $noopt || $compiler == precompiler || $compiler == dart2appjit ]
-io/test_extension_test: Skip # Platform.executable
-io/test_extension_fail_test: Skip # Platform.executable
-io/platform_test: Skip # Platform.executable
-io/code_collection_test: Skip # Platform.executable
-full_coverage_test: Skip # Platform.executable
-regress_26031_test: Skip # Platform.resolvedExecutable
-
 [ $compiler == precompiler || $compiler == dart2app || $compiler == dart2appjit ]
 io/compile_all_test: Skip # Incompatible flag --compile_all
 
 [ $runtime == dart_app ]
 io/stdout_bad_argument_test: Skip # Test exits and so can't generate snapshot.
+io/directory_list_sync_test: Skip # Snapshot path differs from script path.
+io/test_extension_test: Skip # Snapshot path differs from script path.
+io/test_extension_fail_test: Skip # Snapshot path differs from script path.
+io/platform_test: Skip # Snapshot path differs from script path.
 
-[ $runtime == dart_precompiled || $runtime == dart_app ]
-full_coverage_test: Skip # Platform.executable
-http_launch_test: Skip # Platform.executable
-io/addlatexhash_test: Skip # Platform.executable
-io/file_read_special_device_test: Skip # Platform.executable
-io/file_stream_test: Skip # Platform.executable
-io/file_test: Skip # Platform.executable
-io/http_cross_process_test: Skip # Platform.executable
-io/https_unauthorized_test: Skip # Platform.executable
-io/platform_resolved_executable_test: Skip # Platform.resolvedExecutable
-io/skipping_dart2js_compilations_test: Skip # Platform.executable
-io/snapshot_fail_test: Skip # Platform.executable
-io/stdin_sync_test: Skip # Platform.executable
-io/test_extension_fail_test: Skip # Platform.executable
-io/file_read_special_device_test: Skip # Platform.executable
-verbose_gc_to_bmu_test: Skip # Platform.executable
-io/http_server_close_response_after_error_test: Skip # Platform.executable
-io/http_client_stays_alive_test: Skip # Platform.executable
-io/print_sync_test: Skip # Platform.executable
-io/signals_test: Skip # Platform.executable
-io/stdio_implicit_close_test: Skip # Platform.executable
-io/stdio_nonblocking_test: Skip # Platform.executable
-io/regress_7191_test: Skip # Platform.executable
-io/secure_unauthorized_test: Skip # Platform.executable
-io/dart_std_io_pipe_test: Skip # Platform.executable
-io/platform_test: Skip # Platform.executable
-io/socket_cross_process_test: Skip # Platform.executable
-io/test_runner_test: Skip # Platform.executable
-io/file_lock_test: Skip # Platform.executable
-io/code_collection_test: Skip # Platform.executable
-io/file_blocking_lock_test: Skip # Platform.executable
-io/raw_socket_cross_process_test: Skip # Platform.executable
-io/test_extension_test: Skip # Platform.executable
-io/named_pipe_script_test: Skip # Platform.executable
-io/regress_7679_test: Skip # Platform.executable
-io/process_*: Skip # Most use Platform.executable
+[ $runtime == dart_precompiled ]
+# These tests attempt to spawn another script using the precompiled runtime.
+http_launch_test: Skip
+io/addlatexhash_test: Skip
+io/dart_std_io_pipe_test: Skip
+io/dart_std_io_pipe_test: Skip
+io/file_blocking_lock_test: Skip
+io/file_lock_test: Skip
+io/file_read_special_device_test: Skip
+io/http_client_stays_alive_test: Skip
+io/http_response_deadline_test: Skip
+io/http_server_close_response_after_error_test: Skip
+io/https_unauthorized_test: Skip
+io/named_pipe_script_test: Skip
+io/print_sync_test: Skip
+io/process_check_arguments_test: Skip
+io/process_detached_test: Skip
+io/process_environment_test: Skip
+io/process_non_ascii_test: Skip
+io/process_run_output_test: Skip
+io/process_set_exit_code_test: Skip
+io/process_shell_test: Skip
+io/process_stderr_test: Skip
+io/process_stdin_transform_unsubscribe_test: Skip
+io/process_stdout_test: Skip
+io/process_sync_test: Skip
+io/raw_datagram_socket_test: Skip
+io/regress_7191_test: Skip
+io/regress_7679_test: Skip
+io/secure_unauthorized_test: Skip
+io/signals_test: Skip
+io/stdin_sync_test: Skip
+io/stdio_implicit_close_test: Skip
+io/stdio_nonblocking_test: Skip
+io/test_extension_test: Skip
+io/test_extension_fail_test: Skip
+verbose_gc_to_bmu_test: Skip
+
+io/platform_test: RuntimeError # Expects to be running from 'dart' instead of 'dart_precompiled_runtime'
+io/directory_list_sync_test: Timeout, Skip # Expects to find the test directory relative to the script.
 
 [ $runtime == dart_precompiled || $mode == product ]
 io/skipping_dart2js_compilations_test: CompileTimeError # Imports dart:mirrors
@@ -288,10 +281,6 @@
 no_assert_test: SkipByDesign # Requires checked mode.
 io/code_collection_test: Skip # Incompatible flags
 
-# Code coverage is not supported in product mode.
-[ $mode == product ]
-full_coverage_test: SkipByDesign
-
 # Overriding these flags are not supported in product mode.
 [ $mode == product ]
 no_profiler_test: SkipByDesign
@@ -315,24 +304,43 @@
 package/scenarios/packages_option_only/packages_option_only_test: Skip
 
 [ $arch == simdbc || $arch == simdbc64 ]
-# TODO(vegorov) SIMDBC interpreter doesn't support coverage yet.
-full_coverage_test: Skip
-
 # SIMDBC interpreter doesn't support lazy linking of natives.
 link_natives_lazily_test: SkipByDesign
 
 # SIMDBC interpreter doesn't support --no_lazy_dispatchers
 no_lazy_dispatchers_test: SkipByDesign
 
-[ $compiler == precompiler && $runtime == dart_precompiled && $system == android ]
-io/*: Skip # Issue #26376
-
-typed_data_isolate_test: Skip # Issue #26376
-typed_array_test: Skip # Issue #26376
-typed_array_int64_uint64_test: Skip # Issue #26376
-
-oom_error_stacktrace_test: Skip # Issue #26377
-out_of_memory_test: Skip # Issue #26377
+[ $system == android ]
+# Issue 26376
+io/platform_resolved_executable_test: RuntimeError
+io/process_path_test: RuntimeError
+io/file_test: RuntimeError
+io/process_path_environment_test: RuntimeError
+io/file_system_watcher_test: RuntimeError
+io/resolve_symbolic_links_test: RuntimeError
+io/file_stat_test: RuntimeError
+# Issue 27638
+io/raw_datagram_socket_test: RuntimeError
+io/http_proxy_advanced_test: RuntimeError
+io/regress_21160_test: RuntimeError
+io/secure_multiple_client_server_test: RuntimeError
+io/http_proxy_test: RuntimeError
+io/secure_session_resume_test: RuntimeError
+io/raw_secure_server_socket_test: RuntimeError
+io/raw_secure_server_closing_test: RuntimeError
+io/raw_secure_socket_pause_test: RuntimeError
+io/https_server_test: RuntimeError
+io/secure_server_client_certificate_test: RuntimeError
+io/secure_socket_alpn_test: RuntimeError
+io/secure_bad_certificate_test: RuntimeError
+io/secure_server_socket_test: RuntimeError
+io/secure_client_server_test: RuntimeError
+io/socket_upgrade_to_secure_test: RuntimeError
+io/secure_client_raw_server_test: RuntimeError
+io/secure_socket_test: RuntimeError
+io/raw_secure_socket_test: RuntimeError
+io/https_bad_certificate_test: RuntimeError
+io/secure_server_closing_test: RuntimeError
 
 [ $runtime == vm || $runtime == dart_app || $runtime == dart_precompiled ]
 deferred_transitive_import_error_test: Skip # Contains intentional errors.
@@ -340,12 +348,16 @@
 [ $hot_reload || $hot_reload_rollback ]
 deferred_transitive_import_error_test: Crash # Uses deferred imports.
 package/*: SkipByDesign # Launches VMs in interesting ways.
+io/raw_datagram_read_all_test: Pass, Fail # Timing dependent.
+io/test_runner_test: Pass, Slow # Slow.
+io/skipping_dart2js_compilations_test: Pass, Slow # Slow.
 
 [ $builder_tag == no_ipv6 ]
-io/http_bind_test: Skip
-io/raw_datagram_socket_test: Skip
-io/socket_source_address_test: Skip
-io/socket_bind_test: Skip
-io/http_proxy_advanced_test: Skip
-io/http_ipv6_test: Skip
-io/socket_ipv6_test: Skip
+io/http_bind_test: SkipByDesign
+io/raw_datagram_socket_test: SkipByDesign
+io/socket_source_address_test: SkipByDesign
+io/socket_bind_test: SkipByDesign
+io/http_proxy_advanced_test: SkipByDesign
+io/http_ipv6_test: SkipByDesign
+io/socket_ipv6_test: SkipByDesign
+io/socket_info_ipv6_test: SkipByDesign
diff --git a/tests/standalone/verbose_gc_to_bmu_script.dart b/tests/standalone/verbose_gc_to_bmu_script.dart
new file mode 100644
index 0000000..b64a4e3
--- /dev/null
+++ b/tests/standalone/verbose_gc_to_bmu_script.dart
@@ -0,0 +1,20 @@
+// 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.
+// Testing GC, issue 1469.
+
+
+main() {
+  var div;
+  for (int i = 0; i < 200; ++i) {
+    List l = new List(1000000);
+    var m  = 2;
+    div = (_) {
+      var b = l;  // Was causing OutOfMemory.
+    };
+    var lSmall = new List(3);
+    // Circular reference between new and old gen objects.
+    lSmall[0] = l;
+    l[0] = lSmall;
+  }
+}
diff --git a/tests/standalone/verbose_gc_to_bmu_test.dart b/tests/standalone/verbose_gc_to_bmu_test.dart
index 1442739..92d41a5 100644
--- a/tests/standalone/verbose_gc_to_bmu_test.dart
+++ b/tests/standalone/verbose_gc_to_bmu_test.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// OtherResources=verbose_gc_to_bmu_script.dart
+
 // This test forks a second vm process that runs the BMU tool and verifies that
 // it produces some output. This test is mainly here to ensure that the BMU
 // tool compiles and runs.
@@ -13,13 +15,15 @@
 import "package:path/path.dart";
 
 // Tool script relative to the path of this test.
-var toolScript = "../../runtime/tools/verbose_gc_to_bmu.dart";
+var toolScript = Uri.parse(Platform.executable)
+    .resolve("../../runtime/tools/verbose_gc_to_bmu.dart").toFilePath();
 
 // Target script relative to this test.
-var targetScript = "../language/gc_test.dart";
+var targetScript = Platform.script
+    .resolve("verbose_gc_to_bmu_script.dart").toFilePath();
 const minOutputLines = 20;
 
-void checkExitCode(exitCode) {
+void checkExitCode(targetResult) {
   if (exitCode != 0) {
     print("Process terminated with exit code ${exitCode}.");
     exit(-1);
@@ -28,14 +32,11 @@
 
 void main() {
   // Compute paths for tool and target relative to the path of this script.
-  var scriptDir = dirname(Platform.script.toFilePath());
-  var targPath = normalize(join(scriptDir, targetScript));
   var targetResult =
-      Process.runSync(Platform.executable, ["--verbose_gc", targPath]);
-  checkExitCode(targetResult.exitCode);
+      Process.runSync(Platform.executable, ["--verbose_gc", targetScript]);
+  checkExitCode(targetResult);
   var gcLog = targetResult.stderr;
-  var toolPath = normalize(join(scriptDir, toolScript));
-  Process.start(Platform.executable, [toolPath]).then((Process process) {
+  Process.start(Platform.executable, [toolScript]).then((Process process) {
     // Feed the GC log of the target to the BMU tool.
     process.stdin.write(gcLog);
     process.stdin.close();
diff --git a/tests/utils/utils.status b/tests/utils/utils.status
index acd7a5b..fde7eba 100644
--- a/tests/utils/utils.status
+++ b/tests/utils/utils.status
@@ -25,5 +25,9 @@
 recursive_import_test: Skip # Running dart2js under frequent reloads is slow.
 dummy_compiler_test: Skip # Running dart2js under frequent reloads is slow.
 
+[ $compiler == none && ($runtime == dartium || $runtime == drt) ]
+dummy_compiler_test: Skip # Issue 27744
+recursive_import_test: Skip # Issue 27744
+
 [ $builder_tag == asan ]
 recursive_import_test: Skip # Issue 27441
diff --git a/third_party/pkg/petitparser.tar.gz.sha1 b/third_party/pkg/petitparser.tar.gz.sha1
deleted file mode 100644
index 20b3196..0000000
--- a/third_party/pkg/petitparser.tar.gz.sha1
+++ /dev/null
@@ -1 +0,0 @@
-9626eed1ad9963e782f55a943ee8a1f82ff251a1
\ No newline at end of file
diff --git a/third_party/tcmalloc/BUILD.gn b/third_party/tcmalloc/BUILD.gn
index e970559..8568429 100644
--- a/third_party/tcmalloc/BUILD.gn
+++ b/third_party/tcmalloc/BUILD.gn
@@ -30,9 +30,7 @@
     "-fno-builtin-pvalloc",
   ]
   if (is_clang) {
-    cflags += [
-      "-Wno-unused-const-variable",
-    ]
+    cflags += [ "-Wno-unused-const-variable" ]
   }
 }
 
@@ -62,19 +60,18 @@
 }
 
 tcmalloc_sources_list = exec_script("../../tools/gypi_to_gn.py",
-                              [rebase_path("tcmalloc_sources.gypi")],
-                              "scope",
-                              ["tcmalloc_sources.gypi"])
-
+                                    [ rebase_path("tcmalloc_sources.gypi") ],
+                                    "scope",
+                                    [ "tcmalloc_sources.gypi" ])
 
 source_set("tcmalloc") {
   configs -= [ "//build/config/compiler:chromium_code" ]
   configs += [ ":internal_config" ]
 
-  public_configs = [":link_config"]
+  public_configs = [ ":link_config" ]
 
   deps = [
-    ":dynamic_annotations"
+    ":dynamic_annotations",
   ]
 
   include_dirs = [
@@ -87,15 +84,14 @@
   defines = [
     "ENABLE_EMERGENCY_MALLOC",
     "NO_HEAP_CHECK",
+
     # Disable debug even in a Dart Debug build. It is too slow.
     "NDEBUG",
   ]
 
   # Disable stack sampling for heap profiling in Product builds.
   if (is_product) {
-    defines += [
-      "NO_TCMALLOC_SAMPLES",
-    ]
+    defines += [ "NO_TCMALLOC_SAMPLES" ]
   }
 
   cflags = [
@@ -105,20 +101,26 @@
     "-fpermissive",
   ]
 
+  if (!is_clang && current_cpu == "x86") {
+    cflags += [ "-Wno-format" ]
+  }
+
   set_sources_assignment_filter([
-    # No debug allocator.
-    "gperftools/src/debugallocation.cc",
-    # Not needed when using emergency malloc.
-    "gperftools/src/fake_stacktrace_scope.cc",
-    # Not using the cpuprofiler
-    "gperftools/src/base/thread_lister.c",
-    "gperftools/src/base/thread_lister.h",
-    "gperftools/src/profile-handler.cc",
-    "gperftools/src/profile-handler.h",
-    "gperftools/src/profiledata.cc",
-    "gperftools/src/profiledata.h",
-    "gperftools/src/profiler.cc",
-  ])
+                                  # No debug allocator.
+                                  "gperftools/src/debugallocation.cc",
+
+                                  # Not needed when using emergency malloc.
+                                  "gperftools/src/fake_stacktrace_scope.cc",
+
+                                  # Not using the cpuprofiler
+                                  "gperftools/src/base/thread_lister.c",
+                                  "gperftools/src/base/thread_lister.h",
+                                  "gperftools/src/profile-handler.cc",
+                                  "gperftools/src/profile-handler.h",
+                                  "gperftools/src/profiledata.cc",
+                                  "gperftools/src/profiledata.h",
+                                  "gperftools/src/profiler.cc",
+                                ])
 
   sources = tcmalloc_sources_list.sources
 }
diff --git a/third_party/tcmalloc/COPYING b/third_party/tcmalloc/COPYING
new file mode 100644
index 0000000..e4956cf
--- /dev/null
+++ b/third_party/tcmalloc/COPYING
@@ -0,0 +1,28 @@
+Copyright (c) 2005, Google Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+    * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/third_party/tcmalloc/README.dart b/third_party/tcmalloc/README.dart
index 71dd619..bf326f9 100644
--- a/third_party/tcmalloc/README.dart
+++ b/third_party/tcmalloc/README.dart
@@ -11,6 +11,8 @@
 . From that repo, copy src/config.h and src/gperftools/tcmalloc.h, and any other
   generated header files to the include/ directory in this directory.
 
+. Also copy the COPYING file and any other relevant licensing information.
+
 . Make sure that include/config.h defines HAVE_UCONTEXT_H on Linux,
 
 . Update tcmalloc_sources.gypi, and tcmalloc.gyp if necessary. This may require
diff --git a/tools/VERSION b/tools/VERSION
index c843334..fef80b6 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -1,3 +1,4 @@
+
 # This file is used by tools/utils.py to generate version strings.
 # The numbers are changed as follows:
 #
@@ -25,7 +26,7 @@
 #
 CHANNEL stable
 MAJOR 1
-MINOR 20
-PATCH 1
+MINOR 21
+PATCH 0
 PRERELEASE 0
 PRERELEASE_PATCH 0
diff --git a/tools/bots/bot_utils.py b/tools/bots/bot_utils.py
index 1e2ce69..dcd5433 100644
--- a/tools/bots/bot_utils.py
+++ b/tools/bots/bot_utils.py
@@ -352,6 +352,7 @@
   with open(checksum_filename, 'w') as f:
     f.write('%s *%s' % (checksum, mangled_filename))
 
+  print "MD5 checksum of %s is %s" % (filename, checksum)
   return checksum_filename
 
 def CreateSha256ChecksumFile(filename, mangled_filename=None):
@@ -365,6 +366,7 @@
   with open(checksum_filename, 'w') as f:
     f.write('%s *%s' % (checksum, mangled_filename))
 
+  print "SHA256 checksum of %s is %s" % (filename, checksum)
   return checksum_filename
 
 def GetChannelFromName(name):
diff --git a/tools/bots/dart_sdk.py b/tools/bots/dart_sdk.py
index 66905de..588061a 100644
--- a/tools/bots/dart_sdk.py
+++ b/tools/bots/dart_sdk.py
@@ -56,8 +56,8 @@
   url = 'https://api.dartlang.org/stable'
   with bot.BuildStep('Build API docs by dartdoc'):
     bot_utils.run([dart_exe, dartdoc_dart,
-                  '--sdk-docs','--output', dirname, '--dart-sdk', dart_sdk, 
-                  '--footer' , footer_file, '--rel-canonical-prefix=' + url])
+                  '--sdk-docs','--output', dirname, '--footer' , footer_file,
+                  '--rel-canonical-prefix=' + url])
 
 def CreateUploadVersionFile():
   file_path = os.path.join(bot_utils.DART_DIR,
diff --git a/tools/bots/ddc_tests.py b/tools/bots/ddc_tests.py
new file mode 100644
index 0000000..fc6830f
--- /dev/null
+++ b/tools/bots/ddc_tests.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for 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 os
+import os.path
+import shutil
+import sys
+import subprocess
+
+import bot
+import bot_utils
+
+utils = bot_utils.GetUtils()
+
+BUILD_OS = utils.GuessOS()
+
+(bot_name, _) = bot.GetBotName()
+CHANNEL = bot_utils.GetChannelFromName(bot_name)
+
+if __name__ == '__main__':
+  with utils.ChangedWorkingDirectory('pkg/dev_compiler'):
+    with bot.BuildStep('npm install'):
+      bot.RunProcess(['npm', 'install'])
+
+    with bot.BuildStep('Compile tests and run unit tests'):
+      bot.RunProcess([utils.CheckedInSdkExecutable(), 'test/all_tests.dart'])
+
+    with bot.BuildStep('Execute compiled tests'):
+      bot.RunProcess(['npm', 'test'])
diff --git a/tools/bots/gn_build.py b/tools/bots/gn_build.py
new file mode 100644
index 0000000..0fe2298
--- /dev/null
+++ b/tools/bots/gn_build.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for 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 os
+import os.path
+import shutil
+import sys
+import subprocess
+
+SCRIPT_DIR = os.path.dirname(sys.argv[0])
+DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..', '..'))
+
+def main(argv):
+  os.environ["DART_USE_GN"] = "1"
+  generate_buildfiles = os.path.join(
+      DART_ROOT, 'tools', 'generate_buildfiles.py')
+  gclient_result = subprocess.call(['python', generate_buildfiles])
+  if gclient_result != 0:
+    return gclient_result
+
+  build_py = os.path.join(DART_ROOT, 'tools', 'build.py')
+  build_result = subprocess.call(['python', build_py] + argv[1:])
+  if build_result != 0:
+    return build_result
+  return 0
+
+if __name__ == '__main__':
+  sys.exit(main(sys.argv))
diff --git a/tools/bots/gn_tests.py b/tools/bots/gn_tests.py
new file mode 100755
index 0000000..1f44d69
--- /dev/null
+++ b/tools/bots/gn_tests.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for 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 os
+import os.path
+import shutil
+import sys
+import subprocess
+
+SCRIPT_DIR = os.path.dirname(sys.argv[0])
+DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..', '..'))
+
+def main(argv):
+  test_py = os.path.join(DART_ROOT, 'tools', 'test.py')
+  build_result = subprocess.call(
+      ['python', test_py, '--builder-tag=no_ipv6', '--exclude-suite=pkg']
+      + argv[1:])
+  if build_result != 0:
+    return build_result
+  build_result = subprocess.call(
+      ['python', test_py, '--builder-tag=no_ipv6',
+       '-cdart2js', '-rd8', '--use-sdk', 'language/first']
+      + argv[1:])
+  if build_result != 0:
+    return build_result
+  build_result = subprocess.call(
+      ['python', test_py, '--builder-tag=no_ipv6',
+       '-cdart2analyzer', '-rnone', '--use-sdk', 'language/first']
+      + argv[1:])
+  if build_result != 0:
+    return build_result
+  return 0
+
+if __name__ == '__main__':
+  sys.exit(main(sys.argv))
diff --git a/tools/build.py b/tools/build.py
index a27dd41..4f5d2e1 100755
--- a/tools/build.py
+++ b/tools/build.py
@@ -44,6 +44,13 @@
 
 unless you really intend to use a non-default Makefile.""" % DART_ROOT
 
+DART_USE_GN = "DART_USE_GN"
+
+
+def use_gn():
+  return DART_USE_GN in os.environ
+
+
 def BuildOptions():
   result = optparse.OptionParser(usage=usage)
   result.add_option("-m", "--mode",
@@ -77,6 +84,10 @@
       help='Name of the devenv.com/msbuild executable on Windows (varies for '
            'different versions of Visual Studio)',
       default=vs_executable)
+  result.add_option("--gn",
+      help='Build with GN/Ninja',
+      default=use_gn(),
+      action='store_true')
   return result
 
 
@@ -389,86 +400,116 @@
     os.system(command)
 
 
+def RunGN(target_os, mode, arch):
+  gn_os = 'host' if target_os == HOST_OS else target_os
+  gn_command = [
+    'python',
+    os.path.join(DART_ROOT, 'tools', 'gn.py'),
+    '-m', mode,
+    '-a', arch,
+    '--os', gn_os,
+    '-v',
+  ]
+  process = subprocess.Popen(gn_command)
+  process.wait()
+  if process.returncode != 0:
+    print ("Tried to run GN, but it failed. Try running it manually: \n\t$ " +
+           ' '.join(gn_command))
+
+def BuildNinjaCommand(options, target, target_os, mode, arch):
+  out_dir = utils.GetBuildRoot(HOST_OS, mode, arch, target_os)
+  if not os.path.exists(out_dir):
+    RunGN(target_os, mode, arch)
+  command = ['ninja', '-C', out_dir]
+  if options.verbose:
+    command += ['-v']
+  command += [target]
+  return command
+
+
 filter_xcodebuild_output = False
 def BuildOneConfig(options, target, target_os, mode, arch, override_tools):
   global filter_xcodebuild_output
   start_time = time.time()
-  os.environ['DART_BUILD_MODE'] = mode
+  args = []
   build_config = utils.GetBuildConf(mode, arch, target_os)
-  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()
-    args = ['xcodebuild',
-            '-project',
-            project_file,
-            '-target',
-            target,
-            '-configuration',
-            build_config,
-            'SYMROOT=%s' % os.path.abspath('xcodebuild')
-            ]
-  elif HOST_OS == 'win32':
-    project_file = 'dart.sln'
-    if os.path.exists('dart-%s.gyp' % CurrentDirectoryBaseName()):
-      project_file = 'dart-%s.sln' % CurrentDirectoryBaseName()
-    # Select a platform suffix to pass to devenv.
-    if arch == 'ia32':
-      platform_suffix = 'Win32'
-    elif arch == 'x64':
-      platform_suffix = 'x64'
-    else:
-      print 'Unsupported arch for MSVC build: %s' % arch
-      return 1
-    config_name = '%s|%s' % (build_config, platform_suffix)
-    if target == 'all':
-      args = [options.devenv + os.sep + options.executable,
-              '/build',
-              config_name,
-              project_file
-             ]
-    else:
-      args = [options.devenv + os.sep + options.executable,
-              '/build',
-              config_name,
-              '/project',
-              target,
-              project_file
-             ]
+  if options.gn:
+    args = BuildNinjaCommand(options, target, target_os, mode, arch)
   else:
-    make = 'make'
-    if HOST_OS == 'freebsd':
-      make = 'gmake'
-      # work around lack of flock
-      os.environ['LINK'] = '$(CXX)'
-    args = [make,
-            '-j',
-            options.j,
-            'BUILDTYPE=' + build_config,
-            ]
-    if target_os != HOST_OS:
-      args += ['builddir_name=' + utils.GetBuildDir(HOST_OS)]
-    if options.verbose:
-      args += ['V=1']
-
-    args += [target]
-
-  toolsOverride = None
-  if override_tools:
-    toolsOverride = SetTools(arch, target_os, options)
-  if toolsOverride:
-    for k, v in toolsOverride.iteritems():
-      args.append(  k + "=" + v)
-      if options.verbose:
-        print k + " = " + v
-    if not os.path.isfile(toolsOverride['CC.target']):
-      if arch == 'arm':
-        print arm_cc_error
+    os.environ['DART_BUILD_MODE'] = mode
+    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()
+      args = ['xcodebuild',
+              '-project',
+              project_file,
+              '-target',
+              target,
+              '-configuration',
+              build_config,
+              'SYMROOT=%s' % os.path.abspath('xcodebuild')
+              ]
+    elif HOST_OS == 'win32':
+      project_file = 'dart.sln'
+      if os.path.exists('dart-%s.gyp' % CurrentDirectoryBaseName()):
+        project_file = 'dart-%s.sln' % CurrentDirectoryBaseName()
+      # Select a platform suffix to pass to devenv.
+      if arch == 'ia32':
+        platform_suffix = 'Win32'
+      elif arch == 'x64':
+        platform_suffix = 'x64'
       else:
-        print "Couldn't find compiler: %s" % toolsOverride['CC.target']
-      return 1
+        print 'Unsupported arch for MSVC build: %s' % arch
+        return 1
+      config_name = '%s|%s' % (build_config, platform_suffix)
+      if target == 'all':
+        args = [options.devenv + os.sep + options.executable,
+                '/build',
+                config_name,
+                project_file
+               ]
+      else:
+        args = [options.devenv + os.sep + options.executable,
+                '/build',
+                config_name,
+                '/project',
+                target,
+                project_file
+               ]
+    else:
+      make = 'make'
+      if HOST_OS == 'freebsd':
+        make = 'gmake'
+        # work around lack of flock
+        os.environ['LINK'] = '$(CXX)'
+      args = [make,
+              '-j',
+              options.j,
+              'BUILDTYPE=' + build_config,
+              ]
+      if target_os != HOST_OS:
+        args += ['builddir_name=' + utils.GetBuildDir(HOST_OS)]
+      if options.verbose:
+        args += ['V=1']
 
+      args += [target]
+
+    toolsOverride = None
+    if override_tools:
+      toolsOverride = SetTools(arch, target_os, options)
+    if toolsOverride:
+      for k, v in toolsOverride.iteritems():
+        args.append(  k + "=" + v)
+        if options.verbose:
+          print k + " = " + v
+      if not os.path.isfile(toolsOverride['CC.target']):
+        if arch == 'arm':
+          print arm_cc_error
+        else:
+          print "Couldn't find compiler: %s" % toolsOverride['CC.target']
+        return 1
 
   print ' '.join(args)
   process = None
@@ -501,9 +542,6 @@
   if BuildOneConfig(options, 'runtime', target_os, mode, arch, True) != 0:
     return 1
 
-  # TODO(zra): verify that no platform specific details leak into the snapshots
-  # created for pub, dart2js, etc.
-
   # Copy dart-sdk from the host build products dir to the target build
   # products dir, and copy the dart binary for target to the sdk bin/ dir.
   src = os.path.join(
diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py
index 55b64ee..100bdec 100755
--- a/tools/clang/scripts/update.py
+++ b/tools/clang/scripts/update.py
@@ -3,12 +3,12 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
-"""Windows can't run .sh files, so this is a Python implementation of
-update.sh. This script should replace update.sh on all platforms eventually."""
+"""This script is used to download prebuilt clang binaries.
+
+It is also used by package.py to build the prebuilt clang binaries."""
 
 import argparse
-import contextlib
-import cStringIO
+import distutils.spawn
 import glob
 import os
 import pipes
@@ -18,26 +18,25 @@
 import stat
 import sys
 import tarfile
+import tempfile
 import time
 import urllib2
 import zipfile
 
+
 # Do NOT CHANGE this if you don't know what you're doing -- see
-# https://code.google.com/p/chromium/wiki/UpdatingClang
+# https://chromium.googlesource.com/chromium/src/+/master/docs/updating_clang.md
 # Reverting problematic clang rolls is safe, though.
-# Note: this revision is only used for Windows. Other platforms use update.sh.
-# TODO(thakis): Use the same revision on Windows and non-Windows.
-# TODO(thakis): Remove update.sh, use update.py everywhere.
-LLVM_WIN_REVISION = '242415'
+CLANG_REVISION = '282487'
 
 use_head_revision = 'LLVM_FORCE_HEAD_REVISION' in os.environ
 if use_head_revision:
-  LLVM_WIN_REVISION = 'HEAD'
+  CLANG_REVISION = 'HEAD'
 
 # This is incremented when pushing a new build of Clang at the same revision.
 CLANG_SUB_REVISION=1
 
-PACKAGE_VERSION = "%s-%s" % (LLVM_WIN_REVISION, CLANG_SUB_REVISION)
+PACKAGE_VERSION = "%s-%s" % (CLANG_REVISION, CLANG_SUB_REVISION)
 
 # Path constants. (All of these should be absolute paths.)
 THIS_DIR = os.path.abspath(os.path.dirname(__file__))
@@ -47,71 +46,135 @@
 LLVM_BOOTSTRAP_DIR = os.path.join(THIRD_PARTY_DIR, 'llvm-bootstrap')
 LLVM_BOOTSTRAP_INSTALL_DIR = os.path.join(THIRD_PARTY_DIR,
                                           'llvm-bootstrap-install')
+LLVM_LTO_GOLD_PLUGIN_DIR = os.path.join(THIRD_PARTY_DIR, 'llvm-lto-gold-plugin')
 CHROME_TOOLS_SHIM_DIR = os.path.join(LLVM_DIR, 'tools', 'chrometools')
 LLVM_BUILD_DIR = os.path.join(CHROMIUM_DIR, 'third_party', 'llvm-build',
                               'Release+Asserts')
-COMPILER_RT_BUILD_DIR = os.path.join(LLVM_BUILD_DIR, '32bit-compiler-rt')
+COMPILER_RT_BUILD_DIR = os.path.join(LLVM_BUILD_DIR, 'compiler-rt')
 CLANG_DIR = os.path.join(LLVM_DIR, 'tools', 'clang')
 LLD_DIR = os.path.join(LLVM_DIR, 'tools', 'lld')
-COMPILER_RT_DIR = os.path.join(LLVM_DIR, 'projects', 'compiler-rt')
+# compiler-rt is built as part of the regular LLVM build on Windows to get
+# the 64-bit runtime, and out-of-tree elsewhere.
+# TODO(thakis): Try to unify this.
+if sys.platform == 'win32':
+  COMPILER_RT_DIR = os.path.join(LLVM_DIR, 'projects', 'compiler-rt')
+else:
+  COMPILER_RT_DIR = os.path.join(LLVM_DIR, 'compiler-rt')
 LIBCXX_DIR = os.path.join(LLVM_DIR, 'projects', 'libcxx')
 LIBCXXABI_DIR = os.path.join(LLVM_DIR, 'projects', 'libcxxabi')
 LLVM_BUILD_TOOLS_DIR = os.path.abspath(
     os.path.join(LLVM_DIR, '..', 'llvm-build-tools'))
-STAMP_FILE = os.path.join(LLVM_DIR, '..', 'llvm-build', 'cr_build_revision')
+STAMP_FILE = os.path.normpath(
+    os.path.join(LLVM_DIR, '..', 'llvm-build', 'cr_build_revision'))
 BINUTILS_DIR = os.path.join(THIRD_PARTY_DIR, 'binutils')
-VERSION = '3.8.0'
+BINUTILS_BIN_DIR = os.path.join(BINUTILS_DIR, BINUTILS_DIR,
+                                'Linux_x64', 'Release', 'bin')
+BFD_PLUGINS_DIR = os.path.join(BINUTILS_DIR, 'Linux_x64', 'Release',
+                               'lib', 'bfd-plugins')
+VERSION = '4.0.0'
+ANDROID_NDK_DIR = os.path.join(
+    CHROMIUM_DIR, 'third_party', 'android_tools', 'ndk')
 
 # URL for pre-built binaries.
-CDS_URL = 'https://commondatastorage.googleapis.com/chromium-browser-clang'
+CDS_URL = os.environ.get('CDS_CLANG_BUCKET_OVERRIDE',
+    'https://commondatastorage.googleapis.com/chromium-browser-clang')
 
 LLVM_REPO_URL='https://llvm.org/svn/llvm-project'
 if 'LLVM_REPO_URL' in os.environ:
   LLVM_REPO_URL = os.environ['LLVM_REPO_URL']
 
+# Bump after VC updates.
+DIA_DLL = {
+  '2013': 'msdia120.dll',
+  '2015': 'msdia140.dll',
+}
+
 
 def DownloadUrl(url, output_file):
   """Download url into output_file."""
   CHUNK_SIZE = 4096
   TOTAL_DOTS = 10
-  sys.stdout.write('Downloading %s ' % url)
-  sys.stdout.flush()
-  response = urllib2.urlopen(url)
-  total_size = int(response.info().getheader('Content-Length').strip())
-  bytes_done = 0
-  dots_printed = 0
+  num_retries = 3
+  retry_wait_s = 5  # Doubled at each retry.
+
   while True:
-    chunk = response.read(CHUNK_SIZE)
-    if not chunk:
-      break
-    output_file.write(chunk)
-    bytes_done += len(chunk)
-    num_dots = TOTAL_DOTS * bytes_done / total_size
-    sys.stdout.write('.' * (num_dots - dots_printed))
-    sys.stdout.flush()
-    dots_printed = num_dots
-  print ' Done.'
+    try:
+      sys.stdout.write('Downloading %s ' % url)
+      sys.stdout.flush()
+      response = urllib2.urlopen(url)
+      total_size = int(response.info().getheader('Content-Length').strip())
+      bytes_done = 0
+      dots_printed = 0
+      while True:
+        chunk = response.read(CHUNK_SIZE)
+        if not chunk:
+          break
+        output_file.write(chunk)
+        bytes_done += len(chunk)
+        num_dots = TOTAL_DOTS * bytes_done / total_size
+        sys.stdout.write('.' * (num_dots - dots_printed))
+        sys.stdout.flush()
+        dots_printed = num_dots
+      if bytes_done != total_size:
+        raise urllib2.URLError("only got %d of %d bytes" %
+                               (bytes_done, total_size))
+      print ' Done.'
+      return
+    except urllib2.URLError as e:
+      sys.stdout.write('\n')
+      print e
+      if num_retries == 0 or isinstance(e, urllib2.HTTPError) and e.code == 404:
+        raise e
+      num_retries -= 1
+      print 'Retrying in %d s ...' % retry_wait_s
+      time.sleep(retry_wait_s)
+      retry_wait_s *= 2
 
 
-def ReadStampFile():
+def EnsureDirExists(path):
+  if not os.path.exists(path):
+    print "Creating directory %s" % path
+    os.makedirs(path)
+
+
+def DownloadAndUnpack(url, output_dir):
+  with tempfile.TemporaryFile() as f:
+    DownloadUrl(url, f)
+    f.seek(0)
+    EnsureDirExists(output_dir)
+    if url.endswith('.zip'):
+      zipfile.ZipFile(f).extractall(path=output_dir)
+    else:
+      tarfile.open(mode='r:gz', fileobj=f).extractall(path=output_dir)
+
+
+def ReadStampFile(path=STAMP_FILE):
   """Return the contents of the stamp file, or '' if it doesn't exist."""
   try:
-    with open(STAMP_FILE, 'r') as f:
-      return f.read()
+    with open(path, 'r') as f:
+      return f.read().rstrip()
   except IOError:
     return ''
 
 
-def WriteStampFile(s):
+def WriteStampFile(s, path=STAMP_FILE):
   """Write s to the stamp file."""
-  if not os.path.exists(os.path.dirname(STAMP_FILE)):
-    os.makedirs(os.path.dirname(STAMP_FILE))
-  with open(STAMP_FILE, 'w') as f:
+  EnsureDirExists(os.path.dirname(path))
+  with open(path, 'w') as f:
     f.write(s)
+    f.write('\n')
 
 
 def GetSvnRevision(svn_repo):
   """Returns current revision of the svn repo at svn_repo."""
+  if sys.platform == 'darwin':
+    # mac_files toolchain must be set for hermetic builds.
+    root = os.path.dirname(os.path.dirname(os.path.dirname(
+        os.path.dirname(__file__))))
+    sys.path.append(os.path.join(root, 'build'))
+    import mac_toolchain
+
+    mac_toolchain.SetToolchainEnvironment()
   svn_info = subprocess.check_output('svn info ' + svn_repo, shell=True)
   m = re.search(r'Revision: (\d+)', svn_info)
   return m.group(1)
@@ -129,6 +192,15 @@
   shutil.rmtree(dir, onerror=ChmodAndRetry)
 
 
+def RmCmakeCache(dir):
+  """Delete CMake cache related files from dir."""
+  for dirpath, dirs, files in os.walk(dir):
+    if 'CMakeCache.txt' in files:
+      os.remove(os.path.join(dirpath, 'CMakeCache.txt'))
+    if 'CMakeFiles' in dirs:
+      RmTree(os.path.join(dirpath, 'CMakeFiles'))
+
+
 def RunCommand(command, msvc_arch=None, env=None, fail_hard=True):
   """Run command and return success (True) or failure; or if fail_hard is
      True, exit on failure.  If msvc_arch is set, runs the command in a
@@ -163,15 +235,15 @@
 
 def CopyFile(src, dst):
   """Copy a file from src to dst."""
-  shutil.copy(src, dst)
   print "Copying %s to %s" % (src, dst)
+  shutil.copy(src, dst)
 
 
 def CopyDirectoryContents(src, dst, filename_filter=None):
   """Copy the files from directory src to dst
   with an optional filename filter."""
-  if not os.path.exists(dst):
-    os.makedirs(dst)
+  dst = os.path.realpath(dst)  # realpath() in case dst ends in /..
+  EnsureDirExists(dst)
   for root, _, files in os.walk(src):
     for f in files:
       if filename_filter and not re.match(filename_filter, f):
@@ -181,9 +253,9 @@
 
 def Checkout(name, url, dir):
   """Checkout the SVN module at url into dir. Use name for the log message."""
-  print "Checking out %s r%s into '%s'" % (name, LLVM_WIN_REVISION, dir)
+  print "Checking out %s r%s into '%s'" % (name, CLANG_REVISION, dir)
 
-  command = ['svn', 'checkout', '--force', url + '@' + LLVM_WIN_REVISION, dir]
+  command = ['svn', 'checkout', '--force', url + '@' + CLANG_REVISION, dir]
   if RunCommand(command, fail_hard=False):
     return
 
@@ -195,120 +267,9 @@
   RunCommand(command)
 
 
-def RevertPreviouslyPatchedFiles():
-  print 'Reverting previously patched files'
-  files = [
-    '%(clang)s/test/Index/crash-recovery-modules.m',
-    '%(clang)s/unittests/libclang/LibclangTest.cpp',
-    '%(compiler_rt)s/lib/asan/asan_rtl.cc',
-    '%(compiler_rt)s/test/asan/TestCases/Linux/new_array_cookie_test.cc',
-    '%(llvm)s/test/DebugInfo/gmlt.ll',
-    '%(llvm)s/lib/CodeGen/SpillPlacement.cpp',
-    '%(llvm)s/lib/CodeGen/SpillPlacement.h',
-    '%(llvm)s/lib/Transforms/Instrumentation/MemorySanitizer.cpp',
-    '%(clang)s/test/Driver/env.c',
-    '%(clang)s/lib/Frontend/InitPreprocessor.cpp',
-    '%(clang)s/test/Frontend/exceptions.c',
-    '%(clang)s/test/Preprocessor/predefined-exceptions.m',
-    '%(llvm)s/test/Bindings/Go/go.test',
-    '%(clang)s/lib/Parse/ParseExpr.cpp',
-    '%(clang)s/lib/Parse/ParseTemplate.cpp',
-    '%(clang)s/lib/Sema/SemaDeclCXX.cpp',
-    '%(clang)s/lib/Sema/SemaExprCXX.cpp',
-    '%(clang)s/test/SemaCXX/default2.cpp',
-    '%(clang)s/test/SemaCXX/typo-correction-delayed.cpp',
-    '%(compiler_rt)s/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc',
-    '%(compiler_rt)s/test/tsan/signal_segv_handler.cc',
-    '%(compiler_rt)s/lib/sanitizer_common/sanitizer_coverage_libcdep.cc',
-    '%(compiler_rt)s/cmake/config-ix.cmake',
-    '%(compiler_rt)s/CMakeLists.txt',
-    '%(compiler_rt)s/lib/ubsan/ubsan_platform.h',
-    ]
-  for f in files:
-    f = f % {
-        'clang': CLANG_DIR,
-        'compiler_rt': COMPILER_RT_DIR,
-        'llvm': LLVM_DIR,
-        }
-    if os.path.exists(f):
-      os.remove(f)  # For unversioned files.
-      RunCommand(['svn', 'revert', f])
-
-
-def ApplyLocalPatches():
-  # There's no patch program on Windows by default.  We don't need patches on
-  # Windows yet, and maybe this not working on Windows will motivate us to
-  # remove patches over time.
-  assert sys.platform != 'win32'
-
-  # Apply patch for tests failing with --disable-pthreads (llvm.org/PR11974)
-  clang_patches = [ r"""\
---- test/Index/crash-recovery-modules.m	(revision 202554)
-+++ test/Index/crash-recovery-modules.m	(working copy)
-@@ -12,6 +12,8 @@
- 
- // REQUIRES: crash-recovery
- // REQUIRES: shell
-+// XFAIL: *
-+//    (PR11974)
- 
- @import Crash;
-""", r"""\
---- unittests/libclang/LibclangTest.cpp (revision 215949)
-+++ unittests/libclang/LibclangTest.cpp (working copy)
-@@ -431,7 +431,7 @@
-   EXPECT_EQ(0U, clang_getNumDiagnostics(ClangTU));
- }
-
--TEST_F(LibclangReparseTest, ReparseWithModule) {
-+TEST_F(LibclangReparseTest, DISABLED_ReparseWithModule) {
-   const char *HeaderTop = "#ifndef H\n#define H\nstruct Foo { int bar;";
-   const char *HeaderBottom = "\n};\n#endif\n";
-   const char *MFile = "#include \"HeaderFile.h\"\nint main() {"
-"""
-      ]
-
-  # This Go bindings test doesn't work after bootstrap on Linux, PR21552.
-  llvm_patches = [ r"""\
---- test/Bindings/Go/go.test    (revision 223109)
-+++ test/Bindings/Go/go.test    (working copy)
-@@ -1,3 +1,3 @@
--; RUN: llvm-go test llvm.org/llvm/bindings/go/llvm
-+; RUN: true
- 
- ; REQUIRES: shell
-"""
-      ]
-
-  # The UBSan run-time, which is now bundled with the ASan run-time, doesn't
-  # work on Mac OS X 10.8 (PR23539).
-  compiler_rt_patches = [ r"""\
---- CMakeLists.txt	(revision 241602)
-+++ CMakeLists.txt	(working copy)
-@@ -305,6 +305,7 @@
-       list(APPEND SANITIZER_COMMON_SUPPORTED_OS iossim)
-     endif()
-   endif()
-+  set(SANITIZER_MIN_OSX_VERSION "10.7")
-   if(SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.7")
-     message(FATAL_ERROR "Too old OS X version: ${SANITIZER_MIN_OSX_VERSION}")
-   endif()
-"""
-      ]
-
-  for path, patches in [(LLVM_DIR, llvm_patches),
-                        (CLANG_DIR, clang_patches),
-                        (COMPILER_RT_DIR, compiler_rt_patches)]:
-    print 'Applying patches in', path
-    for patch in patches:
-      print patch
-      p = subprocess.Popen( ['patch', '-p0', '-d', path], stdin=subprocess.PIPE)
-      (stdout, stderr) = p.communicate(input=patch)
-      if p.returncode != 0:
-        raise RuntimeError('stdout %s, stderr %s' % (stdout, stderr))
-
-
 def DeleteChromeToolsShim():
+  OLD_SHIM_DIR = os.path.join(LLVM_DIR, 'tools', 'zzz-chrometools')
+  shutil.rmtree(OLD_SHIM_DIR, ignore_errors=True)
   shutil.rmtree(CHROME_TOOLS_SHIM_DIR, ignore_errors=True)
 
 
@@ -337,30 +298,53 @@
     f.write('endif (CHROMIUM_TOOLS_SRC)\n')
 
 
+def DownloadHostGcc(args):
+  """Downloads gcc 4.8.5 and makes sure args.gcc_toolchain is set."""
+  if not sys.platform.startswith('linux') or args.gcc_toolchain:
+    return
+  # Unconditionally download a prebuilt gcc to guarantee the included libstdc++
+  # works on Ubuntu Precise.
+  gcc_dir = os.path.join(LLVM_BUILD_TOOLS_DIR, 'gcc485precise')
+  if not os.path.exists(gcc_dir):
+    print 'Downloading pre-built GCC 4.8.5...'
+    DownloadAndUnpack(
+        CDS_URL + '/tools/gcc485precise.tgz', LLVM_BUILD_TOOLS_DIR)
+  args.gcc_toolchain = gcc_dir
+
+
 def AddCMakeToPath():
   """Download CMake and add it to PATH."""
   if sys.platform == 'win32':
-    zip_name = 'cmake-3.2.2-win32-x86.zip'
+    zip_name = 'cmake-3.4.3-win32-x86.zip'
     cmake_dir = os.path.join(LLVM_BUILD_TOOLS_DIR,
-                             'cmake-3.2.2-win32-x86', 'bin')
+                             'cmake-3.4.3-win32-x86', 'bin')
   else:
     suffix = 'Darwin' if sys.platform == 'darwin' else 'Linux'
-    zip_name = 'cmake310_%s.tgz' % suffix
-    cmake_dir = os.path.join(LLVM_BUILD_TOOLS_DIR, 'cmake310', 'bin')
+    zip_name = 'cmake343_%s.tgz' % suffix
+    cmake_dir = os.path.join(LLVM_BUILD_TOOLS_DIR, 'cmake343', 'bin')
   if not os.path.exists(cmake_dir):
-    if not os.path.exists(LLVM_BUILD_TOOLS_DIR):
-      os.makedirs(LLVM_BUILD_TOOLS_DIR)
-    # The cmake archive is smaller than 20 MB, small enough to keep in memory:
-    with contextlib.closing(cStringIO.StringIO()) as f:
-      DownloadUrl(CDS_URL + '/tools/' + zip_name, f)
-      f.seek(0)
-      if zip_name.endswith('.zip'):
-        zipfile.ZipFile(f).extractall(path=LLVM_BUILD_TOOLS_DIR)
-      else:
-        tarfile.open(mode='r:gz', fileobj=f).extractall(path=
-            LLVM_BUILD_TOOLS_DIR)
+    DownloadAndUnpack(CDS_URL + '/tools/' + zip_name, LLVM_BUILD_TOOLS_DIR)
   os.environ['PATH'] = cmake_dir + os.pathsep + os.environ.get('PATH', '')
 
+
+def AddGnuWinToPath():
+  """Download some GNU win tools and add them to PATH."""
+  if sys.platform != 'win32':
+    return
+
+  gnuwin_dir = os.path.join(LLVM_BUILD_TOOLS_DIR, 'gnuwin')
+  GNUWIN_VERSION = '5'
+  GNUWIN_STAMP = os.path.join(gnuwin_dir, 'stamp')
+  if ReadStampFile(GNUWIN_STAMP) == GNUWIN_VERSION:
+    print 'GNU Win tools already up to date.'
+  else:
+    zip_name = 'gnuwin-%s.zip' % GNUWIN_VERSION
+    DownloadAndUnpack(CDS_URL + '/tools/' + zip_name, LLVM_BUILD_TOOLS_DIR)
+    WriteStampFile(GNUWIN_VERSION, GNUWIN_STAMP)
+
+  os.environ['PATH'] = gnuwin_dir + os.pathsep + os.environ.get('PATH', '')
+
+
 vs_version = None
 def GetVSVersion():
   global vs_version
@@ -377,99 +361,152 @@
   # or a system-wide installation otherwise.
   sys.path.append(os.path.join(CHROMIUM_DIR, 'tools', 'gyp', 'pylib'))
   import gyp.MSVSVersion
-  vs_version = gyp.MSVSVersion.SelectVisualStudioVersion('2013')
+  vs_version = gyp.MSVSVersion.SelectVisualStudioVersion(
+      vs_toolchain.GetVisualStudioVersion())
   return vs_version
 
 
+def CopyDiaDllTo(target_dir):
+  # This script always wants to use the 64-bit msdia*.dll.
+  dia_path = os.path.join(GetVSVersion().Path(), 'DIA SDK', 'bin', 'amd64')
+  dia_dll = os.path.join(dia_path, DIA_DLL[GetVSVersion().ShortName()])
+  CopyFile(dia_dll, target_dir)
+
+
+def VeryifyVersionOfBuiltClangMatchesVERSION():
+  """Checks that `clang --version` outputs VERSION.  If this fails, VERSION
+  in this file is out-of-date and needs to be updated (possibly in an
+  `if use_head_revision:` block in main() first)."""
+  clang = os.path.join(LLVM_BUILD_DIR, 'bin', 'clang')
+  if sys.platform == 'win32':
+    # TODO: Parse `clang-cl /?` output for built clang's version and check that
+    # to check the binary we're actually shipping? But clang-cl.exe is just
+    # a copy of clang.exe, so this does check the same thing.
+    clang += '.exe'
+  version_out = subprocess.check_output([clang, '--version'])
+  version_out = re.match(r'clang version ([0-9.]+)', version_out).group(1)
+  if version_out != VERSION:
+    print ('unexpected clang version %s (not %s), update VERSION in update.py'
+           % (version_out, VERSION))
+    sys.exit(1)
+
+
 def UpdateClang(args):
   print 'Updating Clang to %s...' % PACKAGE_VERSION
-  if ReadStampFile() == PACKAGE_VERSION:
-    print 'Already up to date.'
-    return 0
+
+  need_gold_plugin = 'LLVM_DOWNLOAD_GOLD_PLUGIN' in os.environ or (
+      sys.platform.startswith('linux') and
+      'buildtype=Official' in os.environ.get('GYP_DEFINES', '') and
+      'branding=Chrome' in os.environ.get('GYP_DEFINES', ''))
+
+  if ReadStampFile() == PACKAGE_VERSION and not args.force_local_build:
+    print 'Clang is already up to date.'
+    if not need_gold_plugin or os.path.exists(
+        os.path.join(LLVM_BUILD_DIR, "lib/LLVMgold.so")):
+      return 0
 
   # Reset the stamp file in case the build is unsuccessful.
   WriteStampFile('')
 
   if not args.force_local_build:
     cds_file = "clang-%s.tgz" %  PACKAGE_VERSION
-    cds_full_url = CDS_URL + '/Win/' + cds_file
+    if sys.platform == 'win32' or sys.platform == 'cygwin':
+      cds_full_url = CDS_URL + '/Win/' + cds_file
+    elif sys.platform == 'darwin':
+      cds_full_url = CDS_URL + '/Mac/' + cds_file
+    else:
+      assert sys.platform.startswith('linux')
+      cds_full_url = CDS_URL + '/Linux_x64/' + cds_file
 
-    # Check if there's a prebuilt binary and if so just fetch that. That's
-    # faster, and goma relies on having matching binary hashes on client and
-    # server too.
-    print 'Trying to download prebuilt clang'
+    print 'Downloading prebuilt clang'
+    if os.path.exists(LLVM_BUILD_DIR):
+      RmTree(LLVM_BUILD_DIR)
+    try:
+      DownloadAndUnpack(cds_full_url, LLVM_BUILD_DIR)
+      print 'clang %s unpacked' % PACKAGE_VERSION
+      if sys.platform == 'win32':
+        CopyDiaDllTo(os.path.join(LLVM_BUILD_DIR, 'bin'))
+      # Download the gold plugin if requested to by an environment variable.
+      # This is used by the CFI ClusterFuzz bot, and it's required for official
+      # builds on linux.
+      if need_gold_plugin:
+        RunCommand(['python', CHROMIUM_DIR+'/build/download_gold_plugin.py'])
+      WriteStampFile(PACKAGE_VERSION)
+      return 0
+    except urllib2.URLError:
+      print 'Failed to download prebuilt clang %s' % cds_file
+      print 'Use --force-local-build if you want to build locally.'
+      print 'Exiting.'
+      return 1
 
-    # clang packages are smaller than 50 MB, small enough to keep in memory.
-    with contextlib.closing(cStringIO.StringIO()) as f:
-      try:
-        DownloadUrl(cds_full_url, f)
-        f.seek(0)
-        tarfile.open(mode='r:gz', fileobj=f).extractall(path=LLVM_BUILD_DIR)
-        print 'clang %s unpacked' % PACKAGE_VERSION
-        # Download the gold plugin if requested to by an environment variable.
-        # This is used by the CFI ClusterFuzz bot.
-        if 'LLVM_DOWNLOAD_GOLD_PLUGIN' in os.environ:
-          RunCommand(['python', CHROMIUM_DIR+'/build/download_gold_plugin.py'])
-        WriteStampFile(PACKAGE_VERSION)
-        return 0
-      except urllib2.HTTPError:
-        print 'Did not find prebuilt clang %s, building locally' % cds_file
+  if args.with_android and not os.path.exists(ANDROID_NDK_DIR):
+    print 'Android NDK not found at ' + ANDROID_NDK_DIR
+    print 'The Android NDK is needed to build a Clang whose -fsanitize=address'
+    print 'works on Android. See '
+    print 'https://www.chromium.org/developers/how-tos/android-build-instructions'
+    print 'for how to install the NDK, or pass --without-android.'
+    return 1
 
+  DownloadHostGcc(args)
   AddCMakeToPath()
+  AddGnuWinToPath()
 
-  RevertPreviouslyPatchedFiles()
   DeleteChromeToolsShim()
 
   Checkout('LLVM', LLVM_REPO_URL + '/llvm/trunk', LLVM_DIR)
   Checkout('Clang', LLVM_REPO_URL + '/cfe/trunk', CLANG_DIR)
-  if sys.platform == 'win32':
+  if sys.platform == 'win32' or use_head_revision:
     Checkout('LLD', LLVM_REPO_URL + '/lld/trunk', LLD_DIR)
   Checkout('compiler-rt', LLVM_REPO_URL + '/compiler-rt/trunk', COMPILER_RT_DIR)
   if sys.platform == 'darwin':
     # clang needs a libc++ checkout, else -stdlib=libc++ won't find includes
     # (i.e. this is needed for bootstrap builds).
     Checkout('libcxx', LLVM_REPO_URL + '/libcxx/trunk', LIBCXX_DIR)
-    # While we're bundling our own libc++ on OS X, we need to compile libc++abi
-    # into it too (since OS X 10.6 doesn't have libc++abi.dylib either).
-    Checkout('libcxxabi', LLVM_REPO_URL + '/libcxxabi/trunk', LIBCXXABI_DIR)
-
-  if args.with_patches and sys.platform != 'win32':
-    ApplyLocalPatches()
+    # We used to check out libcxxabi on OS X; we no longer need that.
+    if os.path.exists(LIBCXXABI_DIR):
+      RmTree(LIBCXXABI_DIR)
 
   cc, cxx = None, None
-  cflags = cxxflags = ldflags = []
+  libstdcpp = None
+  if args.gcc_toolchain:  # This option is only used on Linux.
+    # Use the specified gcc installation for building.
+    cc = os.path.join(args.gcc_toolchain, 'bin', 'gcc')
+    cxx = os.path.join(args.gcc_toolchain, 'bin', 'g++')
 
-  # LLVM uses C++11 starting in llvm 3.5. On Linux, this means libstdc++4.7+ is
-  # needed, on OS X it requires libc++. clang only automatically links to libc++
-  # when targeting OS X 10.9+, so add stdlib=libc++ explicitly so clang can run
-  # on OS X versions as old as 10.7.
-  # TODO(thakis): Some bots are still on 10.6 (nacl...), so for now bundle
-  # libc++.dylib.  Remove this once all bots are on 10.7+, then use
-  # -DLLVM_ENABLE_LIBCXX=ON and change deployment_target to 10.7.
-  deployment_target = ''
+    if not os.access(cc, os.X_OK):
+      print 'Invalid --gcc-toolchain: "%s"' % args.gcc_toolchain
+      print '"%s" does not appear to be valid.' % cc
+      return 1
 
-  if sys.platform == 'darwin':
-    # When building on 10.9, /usr/include usually doesn't exist, and while
-    # Xcode's clang automatically sets a sysroot, self-built clangs don't.
-    cflags = ['-isysroot', subprocess.check_output(
-        ['xcrun', '--show-sdk-path']).rstrip()]
-    cxxflags = ['-stdlib=libc++', '-nostdinc++',
-                '-I' + os.path.join(LIBCXX_DIR, 'include')] + cflags
-    if args.bootstrap:
-      deployment_target = '10.6'
+    # Set LD_LIBRARY_PATH to make auxiliary targets (tablegen, bootstrap
+    # compiler, etc.) find the .so.
+    libstdcpp = subprocess.check_output(
+        [cxx, '-print-file-name=libstdc++.so.6']).rstrip()
+    os.environ['LD_LIBRARY_PATH'] = os.path.dirname(libstdcpp)
+
+  cflags = []
+  cxxflags = []
+  ldflags = []
 
   base_cmake_args = ['-GNinja',
                      '-DCMAKE_BUILD_TYPE=Release',
                      '-DLLVM_ENABLE_ASSERTIONS=ON',
                      '-DLLVM_ENABLE_THREADS=OFF',
+                     '-DLLVM_ENABLE_TIMESTAMPS=OFF',
+                     # Statically link MSVCRT to avoid DLL dependencies.
+                     '-DLLVM_USE_CRT_RELEASE=MT',
                      ]
 
+  binutils_incdir = ''
+  if sys.platform.startswith('linux'):
+    binutils_incdir = os.path.join(BINUTILS_DIR, 'Linux_x64/Release/include')
+
   if args.bootstrap:
     print 'Building bootstrap compiler'
-    if not os.path.exists(LLVM_BOOTSTRAP_DIR):
-      os.makedirs(LLVM_BOOTSTRAP_DIR)
+    EnsureDirExists(LLVM_BOOTSTRAP_DIR)
     os.chdir(LLVM_BOOTSTRAP_DIR)
     bootstrap_args = base_cmake_args + [
+        '-DLLVM_BINUTILS_INCDIR=' + binutils_incdir,
         '-DLLVM_TARGETS_TO_BUILD=host',
         '-DCMAKE_INSTALL_PREFIX=' + LLVM_BOOTSTRAP_INSTALL_DIR,
         '-DCMAKE_C_FLAGS=' + ' '.join(cflags),
@@ -477,11 +514,18 @@
         ]
     if cc is not None:  bootstrap_args.append('-DCMAKE_C_COMPILER=' + cc)
     if cxx is not None: bootstrap_args.append('-DCMAKE_CXX_COMPILER=' + cxx)
+    RmCmakeCache('.')
     RunCommand(['cmake'] + bootstrap_args + [LLVM_DIR], msvc_arch='x64')
     RunCommand(['ninja'], msvc_arch='x64')
     if args.run_tests:
+      if sys.platform == 'win32':
+        CopyDiaDllTo(os.path.join(LLVM_BOOTSTRAP_DIR, 'bin'))
       RunCommand(['ninja', 'check-all'], msvc_arch='x64')
     RunCommand(['ninja', 'install'], msvc_arch='x64')
+    if args.gcc_toolchain:
+      # Copy that gcc's stdlibc++.so.6 to the build dir, so the bootstrap
+      # compiler can start.
+      CopyFile(libstdcpp, os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'lib'))
 
     if sys.platform == 'win32':
       cc = os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'bin', 'clang-cl.exe')
@@ -493,61 +537,78 @@
     else:
       cc = os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'bin', 'clang')
       cxx = os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'bin', 'clang++')
+
+    if args.gcc_toolchain:
+      # Tell the bootstrap compiler to use a specific gcc prefix to search
+      # for standard library headers and shared object files.
+      cflags = ['--gcc-toolchain=' + args.gcc_toolchain]
+      cxxflags = ['--gcc-toolchain=' + args.gcc_toolchain]
     print 'Building final compiler'
 
-  if sys.platform == 'darwin':
-    # Build libc++.dylib while some bots are still on OS X 10.6.
-    libcxxbuild = os.path.join(LLVM_BUILD_DIR, 'libcxxbuild')
-    if os.path.isdir(libcxxbuild):
-      RmTree(libcxxbuild)
-    libcxxflags = ['-O3', '-std=c++11', '-fstrict-aliasing']
+  # Build LLVM gold plugin with LTO. That speeds up the linker by ~10%.
+  # We only use LTO for Linux now.
+  if args.bootstrap and args.lto_gold_plugin:
+    print 'Building LTO LLVM Gold plugin'
+    if os.path.exists(LLVM_LTO_GOLD_PLUGIN_DIR):
+      RmTree(LLVM_LTO_GOLD_PLUGIN_DIR)
+    EnsureDirExists(LLVM_LTO_GOLD_PLUGIN_DIR)
+    os.chdir(LLVM_LTO_GOLD_PLUGIN_DIR)
 
-    # libcxx and libcxxabi both have a file stdexcept.cpp, so put their .o files
-    # into different subdirectories.
-    os.makedirs(os.path.join(libcxxbuild, 'libcxx'))
-    os.chdir(os.path.join(libcxxbuild, 'libcxx'))
-    RunCommand(['c++', '-c'] + cxxflags + libcxxflags +
-                glob.glob(os.path.join(LIBCXX_DIR, 'src', '*.cpp')))
+    # Create a symlink to LLVMgold.so build in the previous step so that ar
+    # and ranlib could find it while linking LLVMgold.so with LTO.
+    EnsureDirExists(BFD_PLUGINS_DIR)
+    RunCommand(['ln', '-sf',
+                os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'lib', 'LLVMgold.so'),
+                os.path.join(BFD_PLUGINS_DIR, 'LLVMgold.so')])
 
-    os.makedirs(os.path.join(libcxxbuild, 'libcxxabi'))
-    os.chdir(os.path.join(libcxxbuild, 'libcxxabi'))
-    RunCommand(['c++', '-c'] + cxxflags + libcxxflags +
-               glob.glob(os.path.join(LIBCXXABI_DIR, 'src', '*.cpp')) +
-               ['-I' + os.path.join(LIBCXXABI_DIR, 'include')])
+    lto_cflags = ['-flto']
+    lto_ldflags = ['-fuse-ld=gold']
+    if args.gcc_toolchain:
+      # Tell the bootstrap compiler to use a specific gcc prefix to search
+      # for standard library headers and shared object files.
+      lto_cflags += ['--gcc-toolchain=' + args.gcc_toolchain]
+    lto_cmake_args = base_cmake_args + [
+        '-DLLVM_BINUTILS_INCDIR=' + binutils_incdir,
+        '-DCMAKE_C_COMPILER=' + cc,
+        '-DCMAKE_CXX_COMPILER=' + cxx,
+        '-DCMAKE_C_FLAGS=' + ' '.join(lto_cflags),
+        '-DCMAKE_CXX_FLAGS=' + ' '.join(lto_cflags),
+        '-DCMAKE_EXE_LINKER_FLAGS=' + ' '.join(lto_ldflags),
+        '-DCMAKE_SHARED_LINKER_FLAGS=' + ' '.join(lto_ldflags),
+        '-DCMAKE_MODULE_LINKER_FLAGS=' + ' '.join(lto_ldflags)]
 
-    os.chdir(libcxxbuild)
-    libdir = os.path.join(LIBCXX_DIR, 'lib')
-    RunCommand(['cc'] + glob.glob('libcxx/*.o') + glob.glob('libcxxabi/*.o') +
-        ['-o', 'libc++.1.dylib', '-dynamiclib', '-nodefaultlibs',
-         '-current_version', '1', '-compatibility_version', '1', '-lSystem',
-         '-install_name', '@executable_path/libc++.dylib',
-         '-Wl,-unexported_symbols_list,' + libdir + '/libc++unexp.exp',
-         '-Wl,-force_symbols_not_weak_list,' + libdir + '/notweak.exp',
-         '-Wl,-force_symbols_weak_list,' + libdir + '/weak.exp'])
-    if os.path.exists('libc++.dylib'):
-      os.remove('libc++.dylib')
-    os.symlink('libc++.1.dylib', 'libc++.dylib')
-    ldflags += ['-stdlib=libc++', '-L' + libcxxbuild]
+    # We need to use the proper binutils which support LLVM Gold plugin.
+    lto_env = os.environ.copy()
+    lto_env['PATH'] = BINUTILS_BIN_DIR + os.pathsep + lto_env.get('PATH', '')
 
-    if args.bootstrap:
-      # Now that the libc++ headers have been installed and libc++.dylib is
-      # built, delete the libc++ checkout again so that it's not part of the
-      # main build below -- the libc++(abi) tests don't pass on OS X in
-      # bootstrap builds (http://llvm.org/PR24068)
-      RmTree(LIBCXX_DIR)
-      RmTree(LIBCXXABI_DIR)
-      cxxflags = ['-stdlib=libc++', '-nostdinc++',
-                  '-I' + os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR,
-                                      'include/c++/v1')
-                  ] + cflags
+    RmCmakeCache('.')
+    RunCommand(['cmake'] + lto_cmake_args + [LLVM_DIR], env=lto_env)
+    RunCommand(['ninja', 'LLVMgold'], env=lto_env)
+
+
+  # LLVM uses C++11 starting in llvm 3.5. On Linux, this means libstdc++4.7+ is
+  # needed, on OS X it requires libc++. clang only automatically links to libc++
+  # when targeting OS X 10.9+, so add stdlib=libc++ explicitly so clang can run
+  # on OS X versions as old as 10.7.
+  deployment_target = ''
+
+  if sys.platform == 'darwin' and args.bootstrap:
+    # When building on 10.9, /usr/include usually doesn't exist, and while
+    # Xcode's clang automatically sets a sysroot, self-built clangs don't.
+    cflags = ['-isysroot', subprocess.check_output(
+        ['xcrun', '--show-sdk-path']).rstrip()]
+    cxxflags = ['-stdlib=libc++'] + cflags
+    ldflags += ['-stdlib=libc++']
+    deployment_target = '10.7'
+    # Running libc++ tests takes a long time. Since it was only needed for
+    # the install step above, don't build it as part of the main build.
+    # This makes running package.py over 10% faster (30 min instead of 34 min)
+    RmTree(LIBCXX_DIR)
 
   # Build clang.
-  binutils_incdir = ''
-  if sys.platform.startswith('linux'):
-    binutils_incdir = os.path.join(BINUTILS_DIR, 'Linux_x64/Release/include')
 
   # If building at head, define a macro that plugins can use for #ifdefing
-  # out code that builds at head, but not at LLVM_WIN_REVISION or vice versa.
+  # out code that builds at head, but not at CLANG_REVISION or vice versa.
   if use_head_revision:
     cflags += ['-DLLVM_FORCE_HEAD_REVISION']
     cxxflags += ['-DLLVM_FORCE_HEAD_REVISION']
@@ -559,7 +620,13 @@
     deployment_env = os.environ.copy()
     deployment_env['MACOSX_DEPLOYMENT_TARGET'] = deployment_target
 
-  cmake_args = base_cmake_args + [
+  cmake_args = []
+  # TODO(thakis): Unconditionally append this to base_cmake_args instead once
+  # compiler-rt can build with clang-cl on Windows (http://llvm.org/PR23698)
+  cc_args = base_cmake_args if sys.platform != 'win32' else cmake_args
+  if cc is not None:  cc_args.append('-DCMAKE_C_COMPILER=' + cc)
+  if cxx is not None: cc_args.append('-DCMAKE_CXX_COMPILER=' + cxx)
+  cmake_args += base_cmake_args + [
       '-DLLVM_BINUTILS_INCDIR=' + binutils_incdir,
       '-DCMAKE_C_FLAGS=' + ' '.join(cflags),
       '-DCMAKE_CXX_FLAGS=' + ' '.join(cxxflags),
@@ -567,19 +634,26 @@
       '-DCMAKE_SHARED_LINKER_FLAGS=' + ' '.join(ldflags),
       '-DCMAKE_MODULE_LINKER_FLAGS=' + ' '.join(ldflags),
       '-DCMAKE_INSTALL_PREFIX=' + LLVM_BUILD_DIR,
+      # TODO(thakis): Remove this once official builds pass -Wl,--build-id
+      # explicitly, https://crbug.com/622775
+      '-DENABLE_LINKER_BUILD_ID=ON',
       '-DCHROMIUM_TOOLS_SRC=%s' % os.path.join(CHROMIUM_DIR, 'tools', 'clang'),
       '-DCHROMIUM_TOOLS=%s' % ';'.join(args.tools)]
-  # TODO(thakis): Unconditionally append this to base_cmake_args instead once
-  # compiler-rt can build with clang-cl on Windows (http://llvm.org/PR23698)
-  cc_args = base_cmake_args if sys.platform != 'win32' else cmake_args
-  if cc is not None:  cc_args.append('-DCMAKE_C_COMPILER=' + cc)
-  if cxx is not None: cc_args.append('-DCMAKE_CXX_COMPILER=' + cxx)
 
-  if not os.path.exists(LLVM_BUILD_DIR):
-    os.makedirs(LLVM_BUILD_DIR)
+  EnsureDirExists(LLVM_BUILD_DIR)
   os.chdir(LLVM_BUILD_DIR)
+  RmCmakeCache('.')
   RunCommand(['cmake'] + cmake_args + [LLVM_DIR],
              msvc_arch='x64', env=deployment_env)
+
+  if args.gcc_toolchain:
+    # Copy in the right stdlibc++.so.6 so clang can start.
+    if not os.path.exists(os.path.join(LLVM_BUILD_DIR, 'lib')):
+      os.mkdir(os.path.join(LLVM_BUILD_DIR, 'lib'))
+    libstdcpp = subprocess.check_output(
+        [cxx] + cxxflags + ['-print-file-name=libstdc++.so.6']).rstrip()
+    CopyFile(libstdcpp, os.path.join(LLVM_BUILD_DIR, 'lib'))
+
   RunCommand(['ninja'], msvc_arch='x64')
 
   if args.tools:
@@ -587,17 +661,21 @@
     RunCommand(['ninja', 'cr-install'], msvc_arch='x64')
 
   if sys.platform == 'darwin':
-    CopyFile(os.path.join(LLVM_BUILD_DIR, 'libc++.1.dylib'),
-             os.path.join(LLVM_BUILD_DIR, 'bin'))
     # See http://crbug.com/256342
     RunCommand(['strip', '-x', os.path.join(LLVM_BUILD_DIR, 'bin', 'clang')])
   elif sys.platform.startswith('linux'):
     RunCommand(['strip', os.path.join(LLVM_BUILD_DIR, 'bin', 'clang')])
 
-  # Do an x86 build of compiler-rt to get the 32-bit ASan run-time.
+  VeryifyVersionOfBuiltClangMatchesVERSION()
+
+  # Do an out-of-tree build of compiler-rt.
+  # On Windows, this is used to get the 32-bit ASan run-time.
   # TODO(hans): Remove once the regular build above produces this.
-  if not os.path.exists(COMPILER_RT_BUILD_DIR):
-    os.makedirs(COMPILER_RT_BUILD_DIR)
+  # On Mac and Linux, this is used to get the regular 64-bit run-time.
+  # Do a clobbered build due to cmake changes.
+  if os.path.isdir(COMPILER_RT_BUILD_DIR):
+    RmTree(COMPILER_RT_BUILD_DIR)
+  os.makedirs(COMPILER_RT_BUILD_DIR)
   os.chdir(COMPILER_RT_BUILD_DIR)
   # TODO(thakis): Add this once compiler-rt can build with clang-cl (see
   # above).
@@ -608,13 +686,21 @@
   compiler_rt_args = base_cmake_args + [
       '-DCMAKE_C_FLAGS=' + ' '.join(cflags),
       '-DCMAKE_CXX_FLAGS=' + ' '.join(cxxflags)]
+  if sys.platform == 'darwin':
+    compiler_rt_args += ['-DCOMPILER_RT_ENABLE_IOS=ON']
   if sys.platform != 'win32':
     compiler_rt_args += ['-DLLVM_CONFIG_PATH=' +
-                         os.path.join(LLVM_BUILD_DIR, 'bin', 'llvm-config')]
-  RunCommand(['cmake'] + compiler_rt_args + [LLVM_DIR],
-              msvc_arch='x86', env=deployment_env)
+                         os.path.join(LLVM_BUILD_DIR, 'bin', 'llvm-config'),
+                        '-DSANITIZER_MIN_OSX_VERSION="10.7"']
+  # compiler-rt is part of the llvm checkout on Windows but a stand-alone
+  # directory elsewhere, see the TODO above COMPILER_RT_DIR.
+  RmCmakeCache('.')
+  RunCommand(['cmake'] + compiler_rt_args +
+             [LLVM_DIR if sys.platform == 'win32' else COMPILER_RT_DIR],
+             msvc_arch='x86', env=deployment_env)
   RunCommand(['ninja', 'compiler-rt'], msvc_arch='x86')
 
+  # Copy select output to the main tree.
   # TODO(hans): Make this (and the .gypi and .isolate files) version number
   # independent.
   if sys.platform == 'win32':
@@ -624,17 +710,35 @@
   else:
     assert sys.platform.startswith('linux')
     platform = 'linux'
-  asan_rt_lib_src_dir = os.path.join(COMPILER_RT_BUILD_DIR, 'lib', 'clang',
-                                     VERSION, 'lib', platform)
+  asan_rt_lib_src_dir = os.path.join(COMPILER_RT_BUILD_DIR, 'lib', platform)
+  if sys.platform == 'win32':
+    # TODO(thakis): This too is due to compiler-rt being part of the checkout
+    # on Windows, see TODO above COMPILER_RT_DIR.
+    asan_rt_lib_src_dir = os.path.join(COMPILER_RT_BUILD_DIR, 'lib', 'clang',
+                                       VERSION, 'lib', platform)
   asan_rt_lib_dst_dir = os.path.join(LLVM_BUILD_DIR, 'lib', 'clang',
                                      VERSION, 'lib', platform)
-  CopyDirectoryContents(asan_rt_lib_src_dir, asan_rt_lib_dst_dir,
-                        r'^.*-i386\.lib$')
-  CopyDirectoryContents(asan_rt_lib_src_dir, asan_rt_lib_dst_dir,
-                        r'^.*-i386\.dll$')
+  # Blacklists:
+  CopyDirectoryContents(os.path.join(asan_rt_lib_src_dir, '..', '..'),
+                        os.path.join(asan_rt_lib_dst_dir, '..', '..'),
+                        r'^.*blacklist\.txt$')
+  # Headers:
+  if sys.platform != 'win32':
+    CopyDirectoryContents(
+        os.path.join(COMPILER_RT_BUILD_DIR, 'include/sanitizer'),
+        os.path.join(LLVM_BUILD_DIR, 'lib/clang', VERSION, 'include/sanitizer'))
+  # Static and dynamic libraries:
+  CopyDirectoryContents(asan_rt_lib_src_dir, asan_rt_lib_dst_dir)
+  if sys.platform == 'darwin':
+    for dylib in glob.glob(os.path.join(asan_rt_lib_dst_dir, '*.dylib')):
+      # Fix LC_ID_DYLIB for the ASan dynamic libraries to be relative to
+      # @executable_path.
+      # TODO(glider): this is transitional. We'll need to fix the dylib
+      # name either in our build system, or in Clang. See also
+      # http://crbug.com/344836.
+      subprocess.call(['install_name_tool', '-id',
+                       '@executable_path/' + os.path.basename(dylib), dylib])
 
-  CopyFile(os.path.join(asan_rt_lib_src_dir, '..', '..', 'asan_blacklist.txt'),
-           os.path.join(asan_rt_lib_dst_dir, '..', '..'))
 
   if sys.platform == 'win32':
     # Make an extra copy of the sanitizer headers, to be put on the include path
@@ -644,22 +748,69 @@
     aux_sanitizer_include_dir = os.path.join(LLVM_BUILD_DIR, 'lib', 'clang',
                                              VERSION, 'include_sanitizer',
                                              'sanitizer')
-    if not os.path.exists(aux_sanitizer_include_dir):
-      os.makedirs(aux_sanitizer_include_dir)
+    EnsureDirExists(aux_sanitizer_include_dir)
     for _, _, files in os.walk(sanitizer_include_dir):
       for f in files:
         CopyFile(os.path.join(sanitizer_include_dir, f),
                  aux_sanitizer_include_dir)
 
+  if args.with_android:
+    make_toolchain = os.path.join(
+        ANDROID_NDK_DIR, 'build', 'tools', 'make_standalone_toolchain.py')
+    for target_arch in ['aarch64', 'arm', 'i686']:
+      # Make standalone Android toolchain for target_arch.
+      toolchain_dir = os.path.join(
+          LLVM_BUILD_DIR, 'android-toolchain-' + target_arch)
+      RunCommand([
+          make_toolchain,
+          '--api=' + ('21' if target_arch == 'aarch64' else '19'),
+          '--force',
+          '--install-dir=%s' % toolchain_dir,
+          '--stl=stlport',
+          '--arch=' + {
+              'aarch64': 'arm64',
+              'arm': 'arm',
+              'i686': 'x86',
+          }[target_arch]])
+      # Android NDK r9d copies a broken unwind.h into the toolchain, see
+      # http://crbug.com/357890
+      for f in glob.glob(os.path.join(toolchain_dir, 'include/c++/*/unwind.h')):
+        os.remove(f)
+
+      # Build ASan runtime for Android in a separate build tree.
+      build_dir = os.path.join(LLVM_BUILD_DIR, 'android-' + target_arch)
+      if not os.path.exists(build_dir):
+        os.mkdir(os.path.join(build_dir))
+      os.chdir(build_dir)
+      cflags = ['--target=%s-linux-androideabi' % target_arch,
+                '--sysroot=%s/sysroot' % toolchain_dir,
+                '-B%s' % toolchain_dir]
+      android_args = base_cmake_args + [
+        '-DCMAKE_C_COMPILER=' + os.path.join(LLVM_BUILD_DIR, 'bin/clang'),
+        '-DCMAKE_CXX_COMPILER=' + os.path.join(LLVM_BUILD_DIR, 'bin/clang++'),
+        '-DLLVM_CONFIG_PATH=' + os.path.join(LLVM_BUILD_DIR, 'bin/llvm-config'),
+        '-DCMAKE_C_FLAGS=' + ' '.join(cflags),
+        '-DCMAKE_CXX_FLAGS=' + ' '.join(cflags),
+        '-DANDROID=1']
+      RmCmakeCache('.')
+      RunCommand(['cmake'] + android_args + [COMPILER_RT_DIR])
+      RunCommand(['ninja', 'libclang_rt.asan-%s-android.so' % target_arch])
+
+      # And copy it into the main build tree.
+      runtime = 'libclang_rt.asan-%s-android.so' % target_arch
+      for root, _, files in os.walk(build_dir):
+        if runtime in files:
+          shutil.copy(os.path.join(root, runtime), asan_rt_lib_dst_dir)
+
   # Run tests.
   if args.run_tests or use_head_revision:
     os.chdir(LLVM_BUILD_DIR)
-    RunCommand(GetVSVersion().SetupScript('x64') +
-               ['&&', 'ninja', 'cr-check-all'])
+    RunCommand(['ninja', 'cr-check-all'], msvc_arch='x64')
   if args.run_tests:
+    if sys.platform == 'win32':
+      CopyDiaDllTo(os.path.join(LLVM_BUILD_DIR, 'bin'))
     os.chdir(LLVM_BUILD_DIR)
-    RunCommand(GetVSVersion().SetupScript('x64') +
-               ['&&', 'ninja', 'check-all'])
+    RunCommand(['ninja', 'check-all'], msvc_arch='x64')
 
   WriteStampFile(PACKAGE_VERSION)
   print 'Clang update was successful.'
@@ -667,31 +818,6 @@
 
 
 def main():
-  if not sys.platform in ['win32', 'cygwin']:
-    # For non-Windows, fall back to update.sh.
-    # TODO(hans): Make update.py replace update.sh completely.
-
-    # This script is called by gclient. gclient opens its hooks subprocesses
-    # with (stdout=subprocess.PIPE, stderr=subprocess.STDOUT) and then does
-    # custom output processing that breaks printing '\r' characters for
-    # single-line updating status messages as printed by curl and wget.
-    # Work around this by setting stderr of the update.sh process to stdin (!):
-    # gclient doesn't redirect stdin, and while stdin itself is read-only, a
-    # dup()ed sys.stdin is writable, try
-    #   fd2 = os.dup(sys.stdin.fileno()); os.write(fd2, 'hi')
-    # TODO: Fix gclient instead, http://crbug.com/95350
-    if '--no-stdin-hack' in sys.argv:
-      sys.argv.remove('--no-stdin-hack')
-      stderr = None
-    else:
-      try:
-        stderr = os.fdopen(os.dup(sys.stdin.fileno()))
-      except:
-        stderr = sys.stderr
-    return subprocess.call(
-        [os.path.join(os.path.dirname(__file__), 'update.sh')] + sys.argv[1:],
-        stderr=stderr)
-
   parser = argparse.ArgumentParser(description='Build Clang.')
   parser.add_argument('--bootstrap', action='store_true',
                       help='first build clang with CC, then with itself.')
@@ -699,6 +825,14 @@
                       help="run only if the script thinks clang is needed")
   parser.add_argument('--force-local-build', action='store_true',
                       help="don't try to download prebuild binaries")
+  parser.add_argument('--gcc-toolchain', help='set the version for which gcc '
+                      'version be used for building; --gcc-toolchain=/opt/foo '
+                      'picks /opt/foo/bin/gcc')
+  parser.add_argument('--lto-gold-plugin', action='store_true',
+                      help='build LLVM Gold plugin with LTO')
+  parser.add_argument('--llvm-force-head-revision', action='store_true',
+                      help=('use the revision in the repo when printing '
+                            'the revision'))
   parser.add_argument('--print-revision', action='store_true',
                       help='print current clang revision and exit.')
   parser.add_argument('--print-clang-version', action='store_true',
@@ -708,16 +842,19 @@
   parser.add_argument('--tools', nargs='*',
                       help='select which chrome tools to build',
                       default=['plugins', 'blink_gc_plugin'])
-  parser.add_argument('--without-patches', action='store_false',
-                      help="don't apply patches (default)", dest='with_patches',
-                      default=True)
-
-  # For now, these flags are only used for the non-Windows flow, but argparser
-  # gets mad if it sees a flag it doesn't recognize.
-  parser.add_argument('--no-stdin-hack', action='store_true')
-
+  parser.add_argument('--without-android', action='store_false',
+                      help='don\'t build Android ASan runtime (linux only)',
+                      dest='with_android',
+                      default=sys.platform.startswith('linux'))
   args = parser.parse_args()
 
+  if args.lto_gold_plugin and not args.bootstrap:
+    print '--lto-gold-plugin requires --bootstrap'
+    return 1
+  if args.lto_gold_plugin and not sys.platform.startswith('linux'):
+    print '--lto-gold-plugin is only effective on Linux. Ignoring the option.'
+    args.lto_gold_plugin = False
+
   if args.if_needed:
     is_clang_required = False
     # clang is always used on Mac and Linux.
@@ -727,7 +864,7 @@
     if re.search(r'\b(clang|asan|lsan|msan|tsan)=1',
                  os.environ.get('GYP_DEFINES', '')):
       is_clang_required = True
-    # clang previously downloaded, keep it up-to-date.
+    # clang previously downloaded, keep it up to date.
     # If you don't want this, delete third_party/llvm-build on your machine.
     if os.path.isdir(LLVM_BUILD_DIR):
       is_clang_required = True
@@ -737,9 +874,9 @@
       print 'Skipping Clang update (make_clang_dir= was set in GYP_DEFINES).'
       return 0
 
-  global LLVM_WIN_REVISION, PACKAGE_VERSION
+  global CLANG_REVISION, PACKAGE_VERSION
   if args.print_revision:
-    if use_head_revision:
+    if use_head_revision or args.llvm_force_head_revision:
       print GetSvnRevision(LLVM_DIR)
     else:
       print PACKAGE_VERSION
@@ -757,12 +894,13 @@
   if use_head_revision:
     # Use a real revision number rather than HEAD to make sure that the stamp
     # file logic works.
-    LLVM_WIN_REVISION = GetSvnRevision(LLVM_REPO_URL)
-    PACKAGE_VERSION = LLVM_WIN_REVISION + '-0'
+    CLANG_REVISION = GetSvnRevision(LLVM_REPO_URL)
+    PACKAGE_VERSION = CLANG_REVISION + '-0'
 
     args.force_local_build = True
-    # Skip local patches when using HEAD: they probably don't apply anymore.
-    args.with_patches = False
+    if 'OS=android' not in os.environ.get('GYP_DEFINES', ''):
+      # Only build the Android ASan rt on ToT bots when targetting Android.
+      args.with_android = False
 
   return UpdateClang(args)
 
diff --git a/tools/create_sdk.py b/tools/create_sdk.py
index 85ba811..160844c 100755
--- a/tools/create_sdk.py
+++ b/tools/create_sdk.py
@@ -47,12 +47,14 @@
 # ......_internal/
 #.........spec.sum
 #.........strong.sum
+#.........dev_compiler/
 # ......analysis_server/
 # ......analyzer/
 # ......async/
 # ......collection/
 # ......convert/
 # ......core/
+# ......front_end/
 # ......html/
 # ......internal/
 # ......io/
@@ -144,7 +146,7 @@
              join(sdk_root, 'bin', 'snapshots', snapshot))
 
 def CopyAnalyzerSources(home, lib_dir):
-  for library in ['analyzer', 'analysis_server']:
+  for library in ['analyzer', 'analysis_server', 'front_end']:
     copytree(join(home, 'pkg', library), join(lib_dir, library),
              ignore=ignore_patterns('*.svn', 'doc', '*.py', '*.gypi', '*.sh',
                                     '.gitignore', 'packages'))
@@ -169,6 +171,11 @@
   copyfile(join(snapshots, 'strong.sum'),
            join(lib, '_internal', 'strong.sum'))
 
+def CopyDevCompilerSdk(home, lib):
+  copyfile(join(home, 'pkg', 'dev_compiler', 'lib', 'sdk', 'ddc_sdk.sum'),
+           join(lib, '_internal', 'ddc_sdk.sum'))
+  copytree(join(home, 'pkg', 'dev_compiler', 'lib', 'js'),
+           join(lib, 'dev_compiler'))
 
 def Main():
   # Pull in all of the gypi files which will be munged into the sdk.
@@ -304,6 +311,7 @@
   CopyDartdocResources(HOME, SDK_tmp)
   CopyAnalyzerSources(HOME, LIB)
   CopyAnalysisSummaries(SNAPSHOT, LIB)
+  CopyDevCompilerSdk(HOME, LIB)
 
   # Write the 'version' file
   version = utils.GetVersion()
diff --git a/tools/dartium/test.py b/tools/dartium/test.py
index ca48152..5df8c3c 100755
--- a/tools/dartium/test.py
+++ b/tools/dartium/test.py
@@ -194,7 +194,6 @@
             test = os.path.join(DART_TEST_DIR, options.layout_test)
           else:
             test = DART_TEST_DIR
-          package_root = os.path.join(build_dir, 'packages')
           utils.runCommand(['python',
                             test_script,
                             test_mode,
@@ -204,8 +203,6 @@
                             '--builder-name', 'BuildBot',
                             '--additional-env-var',
                             'DART_FLAGS=%s' % dart_flags,
-                            '--additional-env-var',
-                            'DART_PACKAGE_ROOT=file://%s' % package_root,
                             test])
 
         # Run core dart tests
diff --git a/tools/dartk_wrappers/dartk b/tools/dartk_wrappers/dartk
new file mode 100755
index 0000000..9d15f6e
--- /dev/null
+++ b/tools/dartk_wrappers/dartk
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
+PROG_NAME="$BASH_SOURCE"
+WRAPPERS_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
+DART_ROOT="$(cd "${WRAPPERS_DIR}/../.." ; pwd -P)"
+DARTK="$DART_ROOT/pkg/kernel/bin/dartk.dart"
+
+if [[ `uname` == 'Darwin' ]];
+then
+  DART="$DART_ROOT/tools/sdks/mac/dart-sdk/bin/dart"
+else
+  DART="$DART_ROOT/tools/sdks/linux/dart-sdk/bin/dart"
+fi
+
+exec "$DART" "$DARTK" "$@"
diff --git a/tools/deps/dartium.deps/DEPS b/tools/deps/dartium.deps/DEPS
index 6cee812..c1a89e7 100644
--- a/tools/deps/dartium.deps/DEPS
+++ b/tools/deps/dartium.deps/DEPS
@@ -9,7 +9,7 @@
 
 vars.update({
   "dartium_chromium_commit": "7558afb6379171d7f96b2db68ae9d2b64b2c5544",
-  "dartium_webkit_commit": "8c0535e2ee1f49410cb978bd7c18d4582a5fd886",
+  "dartium_webkit_commit": "e46ac6cf905ae6be30852fbee231cfd385c24420",
   "chromium_base_revision": "338390",
 
   # We use mirrors of all github repos to guarantee reproducibility and
@@ -32,7 +32,7 @@
   "collection_tag": "@1.9.1",
   "crypto_rev" : "@2df57a1e26dd88e8d0614207d4b062c73209917d",
   "csslib_tag" : "@0.12.0",
-  "dart2js_info_rev" : "@0a221eaf16aec3879c45719de656680ccb80d8a1",
+  "dart2js_info_tag" : "@0.5.0",
   "glob_rev": "@704cf75e4f26b417505c5c611bdaacd8808467dd",
   "html_tag" : "@0.12.1+1",
   "http_rev" : "@9b93e1542c753090c50b46ef1592d44bc858bfe7",
@@ -40,7 +40,6 @@
   "http_parser_rev" : "@8b179e36aba985208e4c5fb15cfddd386b6370a4",
   "http_throttle_rev" : "@a81f08be942cdd608883c7b67795c12226abc235",
   "json_rpc_2_rev": "@a38eefd116d910199de205f962af92fed87c164c",
-  "kernel_rev": "@449803b82e850a41148e636db1a6e4a848284aed",
   "logging_rev": "@85d83e002670545e9039ad3985f0018ab640e597",
   "matcher_tag": "@0.12.0",
   "mime_rev": "@75890811d4af5af080351ba8a2853ad4c8df98dd",
@@ -70,7 +69,7 @@
   "web_components_rev": "@6349e09f9118dce7ae1b309af5763745e25a9d61",
   "WebCore_rev": "@a86fe28efadcfc781f836037a80f27e22a5dad17",
 
-  "co19_rev": "@d4767b4caea3c5828ad8e053cd051d44a59061af",
+  "co19_rev": "@f05d5aee5930bfd487aedf832fbd7b832f502b15",
 })
 
 deps.update({
@@ -93,7 +92,7 @@
   "src/dart/third_party/pkg/csslib":
       (Var("github_mirror") % "csslib") + Var("csslib_tag"),
   "src/dart/third_party/pkg/dart2js_info":
-      (Var("github_mirror") % "dart2js_info") + Var("dart2js_info_rev"),
+      (Var("github_mirror") % "dart2js_info") + Var("dart2js_info_tag"),
   "src/dart/third_party/pkg/collection":
       (Var("github_mirror") % "collection") + Var("collection_tag"),
   "src/dart/third_party/pkg/glob":
@@ -111,8 +110,6 @@
       (Var("github_mirror") % "http_parser") + Var("http_parser_rev"),
   "src/dart/third_party/pkg/http_throttle":
       (Var("github_mirror") % "http_throttle") + Var("http_throttle_rev"),
-  "src/dart/third_party/pkg/kernel":
-      (Var("github_mirror") % "kernel") + Var("kernel_rev"),
   "src/dart/third_party/pkg/logging":
       (Var("github_mirror") % "logging") + Var("logging_rev"),
   "src/dart/third_party/pkg/matcher":
diff --git a/tools/dom/src/Dimension.dart b/tools/dom/src/Dimension.dart
index 96014c3..6286ae9 100644
--- a/tools/dom/src/Dimension.dart
+++ b/tools/dom/src/Dimension.dart
@@ -43,7 +43,7 @@
   /**
    * Set this CSS Dimension to the specified number of x-heights.
    *
-   * One ex is equal to the the x-height of a font's baseline to its mean line,
+   * One ex is equal to the x-height of a font's baseline to its mean line,
    * generally the height of the letter "x" in the font, which is usually about
    * half the font-size.
    */
diff --git a/tools/dom/src/dart2js_CustomElementSupport.dart b/tools/dom/src/dart2js_CustomElementSupport.dart
index 62c120d..e82d3fd 100644
--- a/tools/dom/src/dart2js_CustomElementSupport.dart
+++ b/tools/dom/src/dart2js_CustomElementSupport.dart
@@ -47,6 +47,21 @@
       convertDartClosureToJS(callback, 4));
 }
 
+/// Checks whether the given [element] correctly extends from the native class
+/// with the given [baseClassName]. This method will throw if the base class
+/// doesn't match, except when the element extends from `template` and it's base
+/// class is `HTMLUnknownElement`. This exclusion is needed to support extension
+/// of template elements (used heavily in Polymer 1.0) on IE11 when using the
+/// webcomponents-lite.js polyfill.
+void _checkExtendsNativeClassOrTemplate(
+    Element element, String extendsTag, String baseClassName) {
+  if (!JS('bool', '(# instanceof window[#])', element, baseClassName) &&
+      !((extendsTag == 'template' &&
+       JS('bool', '(# instanceof window["HTMLUnknownElement"])', element)))) {
+    throw new UnsupportedError('extendsTag does not match base native class');
+  }
+}
+
 void _registerCustomElement(context, document, String tag, Type type,
     String extendsTagName) {
   // Function follows the same pattern as the following JavaScript code for
@@ -90,10 +105,8 @@
           'native class is not HtmlElement');
     }
   } else {
-    if (!JS('bool', '(#.createElement(#) instanceof window[#])',
-        document, extendsTagName, baseClassName)) {
-      throw new UnsupportedError('extendsTag does not match base native class');
-    }
+    var element = document.createElement(extendsTagName);
+    _checkExtendsNativeClassOrTemplate(element, extendsTagName, baseClassName);
   }
 
   var baseConstructor = JS('=Object', '#[#]', context, baseClassName);
@@ -163,11 +176,7 @@
       _nativeType = HtmlElement;
     } else {
       var element = document.createElement(extendsTag);
-      if (!JS('bool', '(# instanceof window[#])',
-          element, baseClassName)) {
-        throw new UnsupportedError(
-            'extendsTag does not match base native class');
-      }
+      _checkExtendsNativeClassOrTemplate(element, extendsTag, baseClassName);
       _nativeType = element.runtimeType;
     }
 
diff --git a/tools/dom/templates/html/dart2js/html_dart2js.darttemplate b/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
index a2bd1e8..d15ba93 100644
--- a/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
+++ b/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
@@ -116,7 +116,8 @@
 /**
  * Root node for all content in a web page.
  */
-HtmlDocument get document => JS('HtmlDocument', 'document');
+HtmlDocument get document =>
+    JS('returns:HtmlDocument;depends:none;effects:none;gvn:true', 'document');
 
 // Workaround for tags like <cite> that lack their own Element subclass --
 // Dart issue 1990.
diff --git a/tools/dom/templates/html/impl/impl_Comment.darttemplate b/tools/dom/templates/html/impl/impl_Comment.darttemplate
index dc6e574..9934bb0 100644
--- a/tools/dom/templates/html/impl/impl_Comment.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Comment.darttemplate
@@ -8,10 +8,8 @@
 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$MIXINS$IMPLEMENTS {
 $if DART2JS
   factory Comment([String data]) {
-    if (data != null) {
-      return JS('Comment', '#.createComment(#)', document, data);
-    }
-    return JS('Comment', '#.createComment("")', document);
+    return JS('returns:Comment;depends:none;effects:none;new:true',
+        '#.createComment(#)', document, data == null ? "" : data);
   }
 $endif
 $!MEMBERS}
diff --git a/tools/dom/templates/html/impl/impl_Text.darttemplate b/tools/dom/templates/html/impl/impl_Text.darttemplate
index 8c53058..a459077 100644
--- a/tools/dom/templates/html/impl/impl_Text.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Text.darttemplate
@@ -7,6 +7,12 @@
 part of $LIBRARYNAME;
 
 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
+$if DART2JS
+  factory $CLASSNAME(String data) =>
+      JS('returns:Text;depends:none;effects:none;new:true',
+          '#.createTextNode(#)', document, data);
+$else
   factory $CLASSNAME(String data) => document._createTextNode(data);
+$endif
 $!MEMBERS
 }
diff --git a/tools/find_depot_tools.py b/tools/find_depot_tools.py
new file mode 100644
index 0000000..286349b
--- /dev/null
+++ b/tools/find_depot_tools.py
@@ -0,0 +1,44 @@
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+"""Small utility function to find depot_tools and add it to the python path.
+Will throw an ImportError exception if depot_tools can't be found since it
+imports breakpad.
+"""
+
+import os
+import sys
+
+
+def IsRealDepotTools(path):
+  return os.path.isfile(os.path.join(path, 'gclient.py'))
+
+
+def add_depot_tools_to_path():
+  """Search for depot_tools and add it to sys.path."""
+  # First look if depot_tools is already in PYTHONPATH.
+  for i in sys.path:
+    if i.rstrip(os.sep).endswith('depot_tools') and IsRealDepotTools(i):
+      return i
+  # Then look if depot_tools is in PATH, common case.
+  for i in os.environ['PATH'].split(os.pathsep):
+    if IsRealDepotTools(i):
+      sys.path.append(i.rstrip(os.sep))
+      return i
+  # Rare case, it's not even in PATH, look upward up to root.
+  root_dir = os.path.dirname(os.path.abspath(__file__))
+  previous_dir = os.path.abspath(__file__)
+  while root_dir and root_dir != previous_dir:
+    i = os.path.join(root_dir, 'depot_tools')
+    if IsRealDepotTools(i):
+      sys.path.append(i)
+      return i
+    previous_dir = root_dir
+    root_dir = os.path.dirname(root_dir)
+  print >> sys.stderr, 'Failed to find depot_tools'
+  return None
+
+add_depot_tools_to_path()
+
+# pylint: disable=W0611
+import breakpad
diff --git a/tools/generate_buildfiles.py b/tools/generate_buildfiles.py
new file mode 100644
index 0000000..9aa26e7
--- /dev/null
+++ b/tools/generate_buildfiles.py
@@ -0,0 +1,87 @@
+#!/usr/bin/env python
+# Copyright 2016 The Dart project authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import argparse
+import os
+import subprocess
+import sys
+import utils
+
+SCRIPT_DIR = os.path.dirname(sys.argv[0])
+DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..'))
+DART_USE_GN = "DART_USE_GN"
+DART_DISABLE_BUILDFILES = "DART_DISABLE_BUILDFILES"
+
+
+def use_gn():
+  return DART_USE_GN in os.environ
+
+
+def disable_buildfiles():
+  return DART_DISABLE_BUILDFILES in os.environ
+
+
+def execute(args):
+  process = subprocess.Popen(args, cwd=DART_ROOT)
+  process.wait()
+  return process.returncode
+
+
+def run_gn():
+  gn_command = [
+    'python',
+    os.path.join(DART_ROOT, 'tools', 'gn.py'),
+    '-m', 'all',
+    '-a', 'all',
+  ]
+  return execute(gn_command)
+
+
+def run_gyp():
+  gyp_command = [
+    'python',
+    os.path.join(DART_ROOT, 'tools', 'gyp_dart.py'),
+  ]
+  return execute(gyp_command)
+
+
+def parse_args(args):
+  args = args[1:]
+  parser = argparse.ArgumentParser(
+      description="A script to generate Dart's build files.")
+
+  parser.add_argument("-v", "--verbose",
+      help='Verbose output.',
+      default=False,
+      action="store_true")
+  parser.add_argument("--gn",
+      help='Use GN',
+      default=use_gn(),
+      action='store_true')
+  parser.add_argument("--gyp",
+      help='Use gyp',
+      default=not use_gn(),
+      action='store_true')
+
+  options = parser.parse_args(args)
+  # If gn is enabled one way or another, then disable gyp
+  if options.gn:
+    options.gyp = False
+  return options
+
+
+def main(argv):
+  # Check the environment and become a no-op if directed.
+  if disable_buildfiles():
+    return 0
+  options = parse_args(argv)
+  if options.gn:
+    return run_gn()
+  else:
+    return run_gyp()
+
+
+if __name__ == '__main__':
+    sys.exit(main(sys.argv))
diff --git a/tools/get_archive.py b/tools/get_archive.py
index 7517f54..fe1ac51 100755
--- a/tools/get_archive.py
+++ b/tools/get_archive.py
@@ -114,7 +114,7 @@
         None, we return the latest revision. If the revision number is specified
         but unavailable, find the nearest older revision and use that instead.
   """
-  osdict = {'Darwin':'mac', 'Linux':'lucid64', 'Windows':'win'}
+  osdict = {'Darwin':'mac-x64', 'Linux':'linux-x64', 'Windows':'win-ia32'}
 
   def FindPermanentUrl(out, osname, the_revision_num):
     output_lines = out.split()
@@ -318,7 +318,9 @@
   # Issue 13399 Quick fix, update with channel support.
   bot = 'inc-be'
   if args.debug:
-    bot = 'debug-be'
+    print >>sys.stderr, (
+      'Debug versions of Dartium and content_shell not available')
+    return 1
 
   if positional[0] == 'dartium':
     GetDartiumRevision('Dartium', bot, DARTIUM_DIR, DARTIUM_VERSION,
diff --git a/tools/gn.py b/tools/gn.py
index 22f3530..fd9a1b7 100755
--- a/tools/gn.py
+++ b/tools/gn.py
@@ -4,19 +4,22 @@
 # found in the LICENSE file.
 
 import argparse
+import multiprocessing
+import os
 import subprocess
 import sys
-import os
+import time
 import utils
 
 HOST_OS = utils.GuessOS()
 HOST_ARCH = utils.GuessArchitecture()
-HOST_CPUS = utils.GuessCpus()
 SCRIPT_DIR = os.path.dirname(sys.argv[0])
 DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..'))
 
-def get_out_dir(args):
-  return utils.GetBuildRoot(HOST_OS, args.mode, args.arch, args.os)
+
+def get_out_dir(mode, arch, target_os):
+  return utils.GetBuildRoot(HOST_OS, mode, arch, target_os)
+
 
 def to_command_line(gn_args):
   def merge(key, value):
@@ -25,6 +28,7 @@
     return '%s="%s"' % (key, value)
   return [merge(x, y) for x, y in gn_args.iteritems()]
 
+
 def host_cpu_for_arch(arch):
   if arch in ['ia32', 'arm', 'armv6', 'armv5te', 'mips',
               'simarm', 'simarmv6', 'simarmv5te', 'simmips', 'simdbc']:
@@ -32,7 +36,8 @@
   if arch in ['x64', 'arm64', 'simarm64', 'simdbc64']:
     return 'x64'
 
-def target_cpu_for_arch(arch, os):
+
+def target_cpu_for_arch(arch, target_os):
   if arch in ['ia32', 'simarm', 'simarmv6', 'simarmv5te', 'simmips']:
     return 'x86'
   if arch in ['simarm64']:
@@ -40,54 +45,91 @@
   if arch == 'mips':
     return 'mipsel'
   if arch == 'simdbc':
-    return 'arm' if os == 'android' else 'x86'
+    return 'arm' if target_os == 'android' else 'x86'
   if arch == 'simdbc64':
-    return 'arm64' if os == 'android' else 'x64'
+    return 'arm64' if target_os == 'android' else 'x64'
   return arch
 
-def to_gn_args(args):
+
+def host_os_for_gn(host_os):
+  if host_os.startswith('macos'):
+    return 'mac'
+  if host_os.startswith('win'):
+    return 'win'
+  return host_os
+
+
+def to_gn_args(args, mode, arch, target_os):
   gn_args = {}
 
-  if args.os == 'host':
-    gn_args['target_os'] = HOST_OS
+  host_os = host_os_for_gn(HOST_OS)
+  if target_os == 'host':
+    gn_args['target_os'] = host_os
   else:
-    gn_args['target_os'] = args.os
+    gn_args['target_os'] = target_os
 
-  gn_args['dart_target_arch'] = args.arch
-  gn_args['target_cpu'] = target_cpu_for_arch(args.arch, args.os)
-  gn_args['host_cpu'] = host_cpu_for_arch(args.arch)
+  gn_args['dart_target_arch'] = arch
+  gn_args['target_cpu'] = target_cpu_for_arch(arch, target_os)
+  gn_args['host_cpu'] = host_cpu_for_arch(arch)
 
-  # TODO(zra): This is for the observatory, which currently builds using the
-  # checked-in sdk. If/when the observatory no longer builds with the
-  # checked-in sdk, this can be removed.
-  gn_args['dart_host_pub_exe'] = os.path.join(
-      DART_ROOT, 'tools', 'sdks', HOST_OS, 'dart-sdk', 'bin', 'pub')
+  # See: runtime/observatory/BUILD.gn.
+  # This allows the standalone build of the observatory to fall back on
+  # dart_bootstrap if the prebuilt SDK doesn't work.
+  gn_args['dart_host_pub_exe'] = ""
 
-  # For Fuchsia support, the default is to not compile in the root
-  # certificates.
-  gn_args['dart_use_fallback_root_certificates'] = True
+  # We only want the fallback root certs in the standalone VM on
+  # Linux and Windows.
+  if gn_args['target_os'] in ['linux', 'win']:
+    gn_args['dart_use_fallback_root_certificates'] = True
 
   gn_args['dart_zlib_path'] = "//runtime/bin/zlib"
 
-  gn_args['dart_use_tcmalloc'] = gn_args['target_os'] == 'linux'
+  # Use tcmalloc only when targeting Linux and when not using ASAN.
+  gn_args['dart_use_tcmalloc'] = (gn_args['target_os'] == 'linux'
+                                  and not args.asan)
 
-  gn_args['is_debug'] = args.mode == 'debug'
-  gn_args['is_release'] = args.mode == 'release'
-  gn_args['is_product'] = args.mode == 'product'
-  gn_args['dart_debug'] = args.mode == 'debug'
+  # Force -mfloat-abi=hard and -mfpu=neon on Linux as we're specifying
+  # a gnueabihf compiler in //build/toolchain/linux BUILD.gn.
+  # TODO(zra): This will likely need some adjustment to build for armv6 etc.
+  hard_float = (gn_args['target_cpu'].startswith('arm') and
+                gn_args['target_os'] == 'linux')
+  if hard_float:
+    gn_args['arm_float_abi'] = 'hard'
+    gn_args['arm_use_neon'] = True
+
+  gn_args['is_debug'] = mode == 'debug'
+  gn_args['is_release'] = mode == 'release'
+  gn_args['is_product'] = mode == 'product'
+  gn_args['dart_debug'] = mode == 'debug'
 
   # This setting is only meaningful for Flutter. Standalone builds of the VM
   # should leave this set to 'develop', which causes the build to defer to
   # 'is_debug', 'is_release' and 'is_product'.
   gn_args['dart_runtime_mode'] = 'develop'
 
-  gn_args['is_clang'] = args.clang and args.os not in ['android']
+  # TODO(zra): Investigate using clang with these configurations.
+  # Clang compiles tcmalloc's inline assembly for ia32 on Linux wrong, so we
+  # don't use clang in that configuration.
+  has_clang = (host_os != 'win'
+               and args.os not in ['android']
+               and not (gn_args['target_os'] == 'linux' and
+                        gn_args['host_cpu'] == 'x86' and
+                        not args.asan)  # Use clang for asan builds.
+               and not gn_args['target_cpu'].startswith('arm')
+               and not gn_args['target_cpu'].startswith('mips'))
+  gn_args['is_clang'] = args.clang and has_clang
 
-  if args.target_sysroot:
-    gn_args['target_sysroot'] = args.target_sysroot
+  gn_args['is_asan'] = args.asan and gn_args['is_clang']
 
-  if args.toolchain_prefix:
-    gn_args['toolchain_prefix'] = args.toolchain_prefix
+  # Setup the user-defined sysroot.
+  if gn_args['target_os'] == 'linux' and args.wheezy:
+    gn_args['dart_use_wheezy_sysroot'] = True
+  else:
+    if args.target_sysroot:
+      gn_args['target_sysroot'] = args.target_sysroot
+
+    if args.toolchain_prefix:
+      gn_args['toolchain_prefix'] = args.toolchain_prefix
 
   goma_dir = os.environ.get('GOMA_DIR')
   goma_home_dir = os.path.join(os.getenv('HOME', ''), 'goma')
@@ -103,37 +145,170 @@
 
   return gn_args
 
+
+def process_os_option(os_name):
+  if os_name == 'host':
+    return HOST_OS
+  return os_name
+
+
+def process_options(args):
+  if args.arch == 'all':
+    args.arch = 'ia32,x64,simarm,simarm64,simmips,simdbc64'
+  if args.mode == 'all':
+    args.mode = 'debug,release,product'
+  if args.os == 'all':
+    args.os = 'host,android'
+  args.mode = args.mode.split(',')
+  args.arch = args.arch.split(',')
+  args.os = args.os.split(',')
+  for mode in args.mode:
+    if not mode in ['debug', 'release', 'product']:
+      print "Unknown mode %s" % mode
+      return False
+  for arch in args.arch:
+    archs = ['ia32', 'x64', 'simarm', 'arm', 'simarmv6', 'armv6',
+             'simarmv5te', 'armv5te', 'simmips', 'mips', 'simarm64', 'arm64',
+             'simdbc', 'simdbc64', 'armsimdbc']
+    if not arch in archs:
+      print "Unknown arch %s" % arch
+      return False
+  oses = [process_os_option(os_name) for os_name in args.os]
+  for os_name in oses:
+    if not os_name in ['android', 'freebsd', 'linux', 'macos', 'win32']:
+      print "Unknown os %s" % os_name
+      return False
+    if os_name != HOST_OS:
+      if os_name != 'android':
+        print "Unsupported target os %s" % os_name
+        return False
+      if not HOST_OS in ['linux']:
+        print ("Cross-compilation to %s is not supported on host os %s."
+               % (os_name, HOST_OS))
+        return False
+      if not arch in ['ia32', 'x64', 'arm', 'armv6', 'armv5te', 'arm64', 'mips',
+                      'simdbc', 'simdbc64']:
+        print ("Cross-compilation to %s is not supported for architecture %s."
+               % (os_name, arch))
+        return False
+  return True
+
+
+def os_has_ide(host_os):
+  return host_os.startswith('win') or host_os.startswith('mac')
+
+
+def ide_switch(host_os):
+  if host_os.startswith('win'):
+    return '--ide=vs'
+  elif host_os.startswith('mac'):
+    return '--ide=xcode'
+  else:
+    return '--ide=json'
+
+
+# Environment variables for default settings.
+DART_USE_ASAN = "DART_USE_ASAN"
+DART_USE_WHEEZY = "DART_USE_WHEEZY"
+
+def use_asan():
+  return DART_USE_ASAN in os.environ
+
+
+def use_wheezy():
+  return DART_USE_WHEEZY in os.environ
+
+
 def parse_args(args):
   args = args[1:]
-  parser = argparse.ArgumentParser(description='A script run` gn gen`.')
+  parser = argparse.ArgumentParser(description='A script to run `gn gen`.')
 
+  parser.add_argument("-v", "--verbose",
+      help='Verbose output.',
+      default=False, action="store_true")
   parser.add_argument('--mode', '-m',
       type=str,
-      choices=['debug', 'release', 'product'],
+      help='Build variants (comma-separated).',
+      metavar='[all,debug,release,product]',
       default='debug')
   parser.add_argument('--os',
       type=str,
-      choices=['host', 'android'],
+      help='Target OSs (comma-separated).',
+      metavar='[all,host,android]',
       default='host')
   parser.add_argument('--arch', '-a',
       type=str,
-      choices=['ia32', 'x64', 'simarm', 'arm', 'simarmv6', 'armv6',
-               'simarmv5te', 'armv5te', 'simmips', 'mips', 'simarm64', 'arm64',
-               'simdbc', 'simdbc64'],
+      help='Target architectures (comma-separated).',
+      metavar='[all,ia32,x64,simarm,arm,simarmv6,armv6,simarmv5te,armv5te,'
+              'simmips,mips,simarm64,arm64,simdbc,armsimdbc]',
       default='x64')
+  parser.add_argument('--asan',
+      help='Build with ASAN',
+      default=use_asan(),
+      action='store_true')
+  parser.add_argument('--no-asan',
+      help='Disable ASAN',
+      dest='asan',
+      action='store_false')
+  parser.add_argument('--wheezy',
+      help='Use the Debian wheezy sysroot on Linux',
+      default=use_wheezy(),
+      action='store_true')
+  parser.add_argument('--no-wheezy',
+      help='Disable the Debian wheezy sysroot on Linux',
+      dest='wheezy',
+      action='store_false')
+  parser.add_argument('--goma',
+      help='Use goma',
+      default=True,
+      action='store_true')
+  parser.add_argument('--no-goma',
+      help='Disable goma',
+      dest='goma',
+      action='store_false')
+  parser.add_argument('--clang',
+      help='Use Clang',
+      default=True,
+      action='store_true')
+  parser.add_argument('--no-clang',
+      help='Disable Clang',
+      dest='clang',
+      action='store_false')
+  parser.add_argument('--ide',
+      help='Generate an IDE file.',
+      default=os_has_ide(HOST_OS),
+      action='store_true')
+  parser.add_argument('--target-sysroot', '-s',
+      type=str,
+      help='Path to the toolchain sysroot')
+  parser.add_argument('--toolchain-prefix', '-t',
+      type=str,
+      help='Path to the toolchain prefix')
+  parser.add_argument('--workers', '-w',
+      type=int,
+      help='Number of simultaneous GN invocations',
+      dest='workers',
+      default=multiprocessing.cpu_count())
 
-  parser.add_argument('--goma', default=True, action='store_true')
-  parser.add_argument('--no-goma', dest='goma', action='store_false')
+  options = parser.parse_args(args)
+  if not process_options(options):
+    parser.print_help()
+    return None
+  return options
 
-  parser.add_argument('--clang', default=True, action='store_true')
-  parser.add_argument('--no-clang', dest='clang', action='store_false')
 
-  parser.add_argument('--target-sysroot', '-s', type=str)
-  parser.add_argument('--toolchain-prefix', '-t', type=str)
+def run_command(command):
+  try:
+    subprocess.check_output(
+        command, cwd=DART_ROOT, stderr=subprocess.STDOUT)
+    return 0
+  except subprocess.CalledProcessError as e:
+    return ("Command failed: " + ' '.join(command) + "\n" +
+            "output: " + e.output)
 
-  return parser.parse_args(args)
 
 def main(argv):
+  starttime = time.time()
   args = parse_args(argv)
 
   if sys.platform.startswith(('cygwin', 'win')):
@@ -143,19 +318,40 @@
   elif sys.platform.startswith('linux'):
      subdir = 'linux64'
   else:
-    raise Error('Unknown platform: ' + sys.platform)
+    print 'Unknown platform: ' + sys.platform
+    return 1
 
-  command = [
-    '%s/buildtools/%s/gn' % (DART_ROOT, subdir),
-    'gen',
-    '--check'
-  ]
-  gn_args = to_command_line(to_gn_args(args))
-  out_dir = get_out_dir(args)
-  print "gn gen --check in %s" % out_dir
-  command.append(out_dir)
-  command.append('--args=%s' % ' '.join(gn_args))
-  return subprocess.call(command, cwd=DART_ROOT)
+  commands = []
+  for target_os in args.os:
+    for mode in args.mode:
+      for arch in args.arch:
+        command = [
+          '%s/buildtools/%s/gn' % (DART_ROOT, subdir),
+          'gen',
+          '--check'
+        ]
+        gn_args = to_command_line(to_gn_args(args, mode, arch, target_os))
+        out_dir = get_out_dir(mode, arch, target_os)
+        if args.verbose:
+          print "gn gen --check in %s" % out_dir
+        if args.ide:
+          command.append(ide_switch(HOST_OS))
+        command.append(out_dir)
+        command.append('--args=%s' % ' '.join(gn_args))
+        commands.append(command)
+
+  pool = multiprocessing.Pool(args.workers)
+  results = pool.map(run_command, commands, chunksize=1)
+  for r in results:
+    if r != 0:
+      print r.strip()
+      return 1
+
+  endtime = time.time()
+  if args.verbose:
+    print ("GN Time: %.3f seconds" % (endtime - starttime))
+  return 0
+
 
 if __name__ == '__main__':
-    sys.exit(main(sys.argv))
+  sys.exit(main(sys.argv))
diff --git a/tools/gyp/all.gypi b/tools/gyp/all.gypi
index 160c0bb..980b5c5 100644
--- a/tools/gyp/all.gypi
+++ b/tools/gyp/all.gypi
@@ -14,6 +14,8 @@
     'dart_io_support': 1,
     # Flag that tells us whether this is an ASAN build.
     'asan%': 0,
+    # Flag that tells us whether this is a MSAN build.
+    'msan%': 0,
   },
   'conditions': [
     [ 'OS=="linux"', {
diff --git a/tools/gypi_to_gn.py b/tools/gypi_to_gn.py
index ca62a12..7cb1190 100755
--- a/tools/gypi_to_gn.py
+++ b/tools/gypi_to_gn.py
@@ -3,9 +3,9 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
-"""Converts a given gypi file to a python scope and writes the result to stdout.
+"""Converts given gypi files to a python scope and writes the result to stdout.
 
-It is assumed that the file contains a toplevel dictionary, and this script
+It is assumed that the files contain a toplevel dictionary, and this script
 will return that dictionary as a GN "scope" (see example below). This script
 does not know anything about GYP and it will not expand variables or execute
 conditions.
@@ -22,10 +22,11 @@
   }
 
 You would call it like this:
+  gypi_files = [ "your_file.gypi", "your_other_file.gypi" ]
   gypi_values = exec_script("//build/gypi_to_gn.py",
-                            [ rebase_path("your_file.gypi") ],
+                            [ rebase_path(gypi_files) ],
                             "scope",
-                            [ "your_file.gypi" ])
+                            [ gypi_files ])
 
 Notes:
  - The rebase_path call converts the gypi file from being relative to the
@@ -41,14 +42,14 @@
 
 Read the values into a target like this:
   component("mycomponent") {
-    sources = gypi_values.sources
-    defines = gypi_values.defines
+    sources = gypi_values.your_file_sources
+    defines = gypi_values.your_file_defines
   }
 
 Sometimes your .gypi file will include paths relative to a different
 directory than the current .gn file. In this case, you can rebase them to
 be relative to the current directory.
-  sources = rebase_path(gypi_values.sources, ".",
+  sources = rebase_path(gypi_values.your_files_sources, ".",
                         "//path/gypi/input/values/are/relative/to")
 
 This script will tolerate a 'variables' in the toplevel dictionary or not. If
@@ -73,6 +74,7 @@
 import gn_helpers
 from optparse import OptionParser
 import sys
+import os.path
 
 def LoadPythonDictionary(path):
   file_string = open(path).read()
@@ -105,30 +107,6 @@
   return file_data
 
 
-def ReplaceSubstrings(values, search_for, replace_with):
-  """Recursively replaces substrings in a value.
-
-  Replaces all substrings of the "search_for" with "repace_with" for all
-  strings occurring in "values". This is done by recursively iterating into
-  lists as well as the keys and values of dictionaries."""
-  if isinstance(values, str):
-    return values.replace(search_for, replace_with)
-
-  if isinstance(values, list):
-    return [ReplaceSubstrings(v, search_for, replace_with) for v in values]
-
-  if isinstance(values, dict):
-    # For dictionaries, do the search for both the key and values.
-    result = {}
-    for key, value in values.items():
-      new_key = ReplaceSubstrings(key, search_for, replace_with)
-      new_value = ReplaceSubstrings(value, search_for, replace_with)
-      result[new_key] = new_value
-    return result
-
-  # Assume everything else is unchanged.
-  return values
-
 def KeepOnly(values, filters):
   """Recursively filters out strings not ending in "f" from "values"""
 
@@ -147,37 +125,41 @@
 
 def main():
   parser = OptionParser()
-  parser.add_option("-r", "--replace", action="append",
-    help="Replaces substrings. If passed a=b, replaces all substrs a with b.")
   parser.add_option("-k", "--keep_only", default = [], action="append",
     help="Keeps only files ending with the listed strings.")
+  parser.add_option("--prefix", action="store_true",
+    help="Prefix variables with base name")
   (options, args) = parser.parse_args()
 
-  if len(args) != 1:
-    raise Exception("Need one argument which is the .gypi file to read.")
+  if len(args) < 1:
+    raise Exception("Need at least one .gypi file to read.")
 
-  data = LoadPythonDictionary(args[0])
-  if options.replace:
-    # Do replacements for all specified patterns.
-    for replace in options.replace:
-      split = replace.split('=')
-      # Allow "foo=" to replace with nothing.
-      if len(split) == 1:
-        split.append('')
-      assert len(split) == 2, "Replacement must be of the form 'key=value'."
-      data = ReplaceSubstrings(data, split[0], split[1])
+  data = {}
 
-  if options.keep_only != []:
-    data = KeepOnly(data, options.keep_only)
+  for gypi in args:
+    gypi_data = LoadPythonDictionary(gypi)
 
-  # Sometimes .gypi files use the GYP syntax with percents at the end of the
-  # variable name (to indicate not to overwrite a previously-defined value):
-  #   'foo%': 'bar',
-  # Convert these to regular variables.
-  for key in data:
-    if len(key) > 1 and key[len(key) - 1] == '%':
-      data[key[:-1]] = data[key]
-      del data[key]
+    if options.keep_only != []:
+      gypi_data = KeepOnly(gypi_data, options.keep_only)
+
+    # Sometimes .gypi files use the GYP syntax with percents at the end of the
+    # variable name (to indicate not to overwrite a previously-defined value):
+    #   'foo%': 'bar',
+    # Convert these to regular variables.
+    for key in gypi_data:
+      if len(key) > 1 and key[len(key) - 1] == '%':
+        gypi_data[key[:-1]] = gypi_data[key]
+        del gypi_data[key]
+    gypi_name = os.path.basename(gypi)[:-len(".gypi")]
+    for key in gypi_data:
+      if options.prefix:
+        # Prefix all variables from this gypi file with the name to disambiguate
+        data[gypi_name + "_" + key] = gypi_data[key]
+      elif key in data:
+        for entry in gypi_data[key]:
+            data[key].append(entry)
+      else:
+        data[key] = gypi_data[key]
 
   print gn_helpers.ToGNString(data)
 
diff --git a/tools/list_dart_files.py b/tools/list_dart_files.py
new file mode 100755
index 0000000..60d2295
--- /dev/null
+++ b/tools/list_dart_files.py
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+"""Tool for listing Dart source files.
+
+Usage:
+  python tools/list_dart_files.py <directory> <root directory pattern>
+"""
+
+import os
+import re
+import sys
+
+
+def main(argv):
+  directory = argv[1]
+
+  pattern = None
+  if len(argv) > 2:
+    pattern = re.compile(argv[2])
+
+  for root, directories, files in os.walk(directory):
+    # We only care about actual source files, not generated code or tests.
+    for skip_dir in ['.git', 'gen', 'test']:
+      if skip_dir in directories:
+        directories.remove(skip_dir)
+
+    # If we are looking at the root directory, filter the immediate
+    # subdirectories by the given pattern.
+    if pattern and root == directory:
+      directories[:] = filter(pattern.match, directories)
+
+    for filename in files:
+      if filename.endswith('.dart') and not filename.endswith('_test.dart'):
+        fullname = os.path.relpath(os.path.join(root, filename))
+        fullname = fullname.replace(os.sep, '/')
+        print fullname
+
+
+if __name__ == '__main__':
+  sys.exit(main(sys.argv))
diff --git a/tools/list_files.py b/tools/list_files.py
old mode 100644
new mode 100755
index 1b10b62..ad277e8
--- a/tools/list_files.py
+++ b/tools/list_files.py
@@ -18,8 +18,8 @@
   pattern = re.compile(argv[1])
   for directory in argv[2:]:
     for root, directories, files in os.walk(directory):
-      if '.svn' in directories:
-        directories.remove('.svn')
+      if '.git' in directories:
+        directories.remove('.git')
       for filename in files:
         fullname = os.path.relpath(os.path.join(root, filename))
         fullname = fullname.replace(os.sep, '/')
diff --git a/tools/patch_sdk.dart b/tools/patch_sdk.dart
new file mode 100644
index 0000000..d92f0a6
--- /dev/null
+++ b/tools/patch_sdk.dart
@@ -0,0 +1,550 @@
+#!/usr/bin/env dart
+// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// Command line tool to merge the SDK libraries and our patch files.
+/// This is currently designed as an offline tool, but we could automate it.
+
+import 'dart:io';
+import 'dart:math' as math;
+
+import 'package:analyzer/analyzer.dart';
+import 'package:analyzer/src/generated/sdk.dart';
+import 'package:path/path.dart' as path;
+
+void main(List<String> argv) {
+  var base = path.fromUri(Platform.script);
+  var dartDir = path.dirname(path.dirname(path.absolute(base)));
+
+  if (argv.length != 4 ||
+      !argv.isEmpty && argv.first != 'vm' && argv.first != 'ddc') {
+    var self = path.relative(base);
+    print('Usage: $self MODE SDK_DIR PATCH_DIR OUTPUT_DIR');
+    print('MODE must be one of ddc or vm.');
+
+    var toolDir = path.relative(path.dirname(base));
+    var sdkExample = path.join(toolDir, 'input_sdk');
+    var patchExample = path.join(sdkExample, 'patch');
+    var outExample =
+        path.relative(path.normalize(path.join('gen', 'patched_sdk')));
+    print('For example:');
+    print('\$ $self ddc $sdkExample $patchExample $outExample');
+
+    var repositoryDir = path.relative(path.dirname(path.dirname(base)));
+    sdkExample = path.relative(path.join(repositoryDir, 'sdk'));
+    patchExample = path.relative(path.join(repositoryDir, 'out', 'DebugX64',
+                                           'obj', 'gen', 'patch'));
+    outExample = path.relative(path.join(repositoryDir, 'out', 'DebugX64',
+                                         'obj', 'gen', 'patched_sdk'));
+    print('or:');
+    print('\$ $self vm $sdkExample $patchExample $outExample');
+
+    exit(1);
+  }
+
+  var mode = argv[0];
+  var input = argv[1];
+  var sdkLibIn = path.join(input, 'lib');
+  var patchIn = argv[2];
+  var sdkOut = path.join(argv[3], 'lib');
+
+  var privateIn = path.join(input, 'private');
+  var INTERNAL_PATH = '_internal/compiler/js_lib/';
+
+  // Copy and patch libraries.dart and version
+  var libContents = new File(path.join(sdkLibIn, '_internal',
+      'sdk_library_metadata', 'lib', 'libraries.dart')).readAsStringSync();
+  var patchedLibContents = libContents;
+  if (mode == 'vm') {
+    libContents = libContents.replaceAll(
+        ' libraries = const {',
+        ''' libraries = const {
+
+  "_builtin": const LibraryInfo(
+      "_builtin/_builtin.dart",
+      categories: "Client,Server",
+      implementation: true,
+      documented: false,
+      platforms: VM_PLATFORM),
+
+  "profiler": const LibraryInfo(
+      "profiler/profiler.dart",
+      maturity: Maturity.DEPRECATED,
+      documented: false),
+
+  "_vmservice": const LibraryInfo(
+      "vmservice/vmservice.dart",
+      implementation: true,
+      documented: false,
+      platforms: VM_PLATFORM),
+
+  "vmservice_io": const LibraryInfo(
+      "vmservice_io/vmservice_io.dart",
+      implementation: true,
+      documented: false,
+      platforms: VM_PLATFORM),
+
+''');
+  }
+  _writeSync(
+      path.join(
+          sdkOut, '_internal', 'sdk_library_metadata', 'lib', 'libraries.dart'),
+      libContents);
+  if (mode == 'ddc') {
+    _writeSync(path.join(sdkOut, '..', 'version'),
+        new File(path.join(sdkLibIn, '..', 'version')).readAsStringSync());
+  }
+
+  // Parse libraries.dart
+  var sdkLibraries = _getSdkLibraries(libContents);
+
+  // Enumerate core libraries and apply patches
+  for (SdkLibrary library in sdkLibraries) {
+    // TODO(jmesserly): analyzer does not handle the default case of
+    // "both platforms" correctly, and treats it as being supported on neither.
+    // So instead we skip explicitly marked as either VM or dart2js libs.
+    if (mode == 'ddc' ? libary.isVmLibrary : library.isDart2JsLibrary) {
+      continue;
+    }
+
+    var libraryOut = path.join(sdkLibIn, library.path);
+    var libraryIn;
+    if (mode == 'vm' && library.path.contains('typed_data.dart')) {
+      // dart:typed_data is unlike the other libraries in the SDK. The VM does
+      // not apply a patch to the base SDK implementation of the library.
+      // Instead, the VM provides a replacement implementation and ignores the
+      // sources in the SDK.
+      libraryIn =
+          path.join(dartDir, 'runtime', 'lib', 'typed_data.dart');
+    } else if (mode == 'ddc' && library.path.contains(INTERNAL_PATH)) {
+      libraryIn =
+          path.join(privateIn, library.path.replaceAll(INTERNAL_PATH, ''));
+    } else {
+      libraryIn = libraryOut;
+    }
+
+    var libraryFile = new File(libraryIn);
+    if (libraryFile.existsSync()) {
+      var outPaths = <String>[libraryOut];
+      var libraryContents = libraryFile.readAsStringSync();
+
+      int inputModifyTime =
+          libraryFile.lastModifiedSync().millisecondsSinceEpoch;
+      var partFiles = <File>[];
+      for (var part in parseDirectives(libraryContents).directives) {
+        if (part is PartDirective) {
+          var partPath = part.uri.stringValue;
+          outPaths.add(path.join(path.dirname(libraryOut), partPath));
+
+          var partFile = new File(path.join(path.dirname(libraryIn), partPath));
+          partFiles.add(partFile);
+          inputModifyTime = math.max(inputModifyTime,
+              partFile.lastModifiedSync().millisecondsSinceEpoch);
+        }
+      }
+
+      // See if we can find a patch file.
+      var patchPath = path.join(
+          patchIn, path.basenameWithoutExtension(libraryIn) + '_patch.dart');
+
+      var patchFile = new File(patchPath);
+      bool patchExists = patchFile.existsSync();
+      if (patchExists) {
+        inputModifyTime = math.max(inputModifyTime,
+            patchFile.lastModifiedSync().millisecondsSinceEpoch);
+      }
+
+      // Compute output paths
+      outPaths = outPaths
+          .map((p) => path.join(sdkOut, path.relative(p, from: sdkLibIn)))
+          .toList();
+
+      // Compare output modify time with input modify time.
+      bool needsUpdate = false;
+      for (var outPath in outPaths) {
+        var outFile = new File(outPath);
+        if (!outFile.existsSync() ||
+            outFile.lastModifiedSync().millisecondsSinceEpoch <
+                inputModifyTime) {
+          needsUpdate = true;
+          break;
+        }
+      }
+
+      if (needsUpdate) {
+        var contents = <String>[libraryContents];
+        contents.addAll(partFiles.map((f) => f.readAsStringSync()));
+        if (patchExists) {
+          var patchContents = patchFile.readAsStringSync();
+          contents = _patchLibrary(
+              patchFile.path, contents, patchContents);
+        }
+
+        for (var i = 0; i < outPaths.length; i++) {
+          if (path.basename(outPaths[i]) == 'internal.dart') {
+            contents[i] += '''
+
+/// Marks a function as an external implementation ("native" in the Dart VM).
+///
+/// Provides a backend-specific String that can be used to identify the
+/// function's implementation
+class ExternalName {
+  final String name;
+  const ExternalName(this.name);
+}
+''';
+          }
+
+          _writeSync(outPaths[i], contents[i]);
+        }
+      }
+    }
+  }
+  if (mode == 'vm') {
+
+    for (var tuple in [['_builtin', 'builtin.dart']]) {
+      var vmLibrary = tuple[0];
+      var dartFile = tuple[1];
+
+      // The "dart:_builtin" library is only available for the DartVM.
+      var builtinLibraryIn  = path.join(dartDir, 'runtime', 'bin', dartFile);
+      var builtinLibraryOut = path.join(sdkOut, vmLibrary, '${vmLibrary}.dart');
+      _writeSync(builtinLibraryOut, new File(builtinLibraryIn).readAsStringSync());
+    }
+
+    for (var file in ['loader.dart', 'server.dart', 'vmservice_io.dart']) {
+      var libraryIn  = path.join(dartDir, 'runtime', 'bin', 'vmservice', file);
+      var libraryOut = path.join(sdkOut, 'vmservice_io', file);
+      _writeSync(libraryOut, new File(libraryIn).readAsStringSync());
+    }
+  }
+}
+
+/// Writes a file, creating the directory if needed.
+void _writeSync(String filePath, String contents) {
+  var outDir = new Directory(path.dirname(filePath));
+  if (!outDir.existsSync()) outDir.createSync(recursive: true);
+
+  new File(filePath).writeAsStringSync(contents);
+}
+
+/// Merges dart:* library code with code from *_patch.dart file.
+///
+/// Takes a list of the library's parts contents, with the main library contents
+/// first in the list, and the contents of the patch file.
+///
+/// The result will have `@patch` implementations merged into the correct place
+/// (e.g. the class or top-level function declaration) and all other
+/// declarations introduced by the patch will be placed into the main library
+/// file.
+///
+/// This is purely a syntactic transformation. Unlike dart2js patch files, there
+/// is no semantic meaning given to the *_patch files, and they do not magically
+/// get their own library scope, etc.
+///
+/// Editorializing: the dart2js approach requires a Dart front end such as
+/// package:analyzer to semantically model a feature beyond what is specified
+/// in the Dart language. Since this feature is only for the convenience of
+/// writing the dart:* libraries, and not a tool given to Dart developers, it
+/// seems like a non-ideal situation. Instead we keep the preprocessing simple.
+List<String> _patchLibrary(String name,
+                           List<String> partsContents,
+                           String patchContents) {
+  var results = <StringEditBuffer>[];
+
+  // Parse the patch first. We'll need to extract bits of this as we go through
+  // the other files.
+  final patchFinder = new PatchFinder.parseAndVisit(name, patchContents);
+
+  // Merge `external` declarations with the corresponding `@patch` code.
+  for (var partContent in partsContents) {
+    var partEdits = new StringEditBuffer(partContent);
+    var partUnit = parseCompilationUnit(partContent);
+    partUnit.accept(new PatchApplier(partEdits, patchFinder));
+    results.add(partEdits);
+  }
+
+  if (patchFinder.patches.length != patchFinder.applied.length) {
+    print('Some elements marked as @patch do not have corresponding elements:');
+    for (var patched in patchFinder.patches.keys) {
+      if (!patchFinder.applied.contains(patched)) {
+        print('*** ${patched}');
+      }
+    }
+    throw "Failed to apply all @patch-es";
+  }
+
+  return new List<String>.from(results.map((e) => e.toString()));
+}
+
+/// Merge `@patch` declarations into `external` declarations.
+class PatchApplier extends GeneralizingAstVisitor {
+  final StringEditBuffer edits;
+  final PatchFinder patch;
+
+  bool _isLibrary = true; // until proven otherwise.
+
+  PatchApplier(this.edits, this.patch);
+
+  @override
+  visitCompilationUnit(CompilationUnit node) {
+    super.visitCompilationUnit(node);
+    if (_isLibrary) _mergeUnpatched(node);
+  }
+
+  void _merge(AstNode node, int pos) {
+    var code = patch.contents.substring(node.offset, node.end);
+    edits.insert(pos, '\n' + code);
+  }
+
+  /// Merges directives and declarations that are not `@patch` into the library.
+  void _mergeUnpatched(CompilationUnit unit) {
+    // Merge imports from the patch
+    // TODO(jmesserly): remove duplicate imports
+
+    // To patch a library, we must have a library directive
+    var libDir = unit.directives.first as LibraryDirective;
+    int importPos = unit.directives
+        .lastWhere((d) => d is ImportDirective, orElse: () => libDir)
+        .end;
+    for (var d in patch.unit.directives.where((d) => d is ImportDirective)) {
+      _merge(d, importPos);
+    }
+
+    int partPos = unit.directives.last.end;
+    for (var d in patch.unit.directives.where((d) => d is PartDirective)) {
+      _merge(d, partPos);
+    }
+
+    // Merge declarations from the patch
+    int declPos = edits.original.length;
+    for (var d in patch.mergeDeclarations) {
+      _merge(d, declPos);
+    }
+  }
+
+  @override
+  visitPartOfDirective(PartOfDirective node) {
+    _isLibrary = false;
+  }
+
+  @override
+  visitFunctionDeclaration(FunctionDeclaration node) {
+    _maybePatch(node);
+  }
+
+  /// Merge patches and extensions into the class
+  @override
+  visitClassDeclaration(ClassDeclaration node) {
+    node.members.forEach(_maybePatch);
+
+    var mergeMembers = patch.mergeMembers[_qualifiedName(node)];
+    if (mergeMembers == null) return;
+
+    // Merge members from the patch
+    var pos = node.members.last.end;
+    for (var member in mergeMembers) {
+      var code = patch.contents.substring(member.offset, member.end);
+      edits.insert(pos, '\n\n  ' + code);
+    }
+  }
+
+  void _maybePatch(AstNode node) {
+    if (node is FieldDeclaration) return;
+
+    var externalKeyword = (node as dynamic).externalKeyword;
+
+    var name = _qualifiedName(node);
+    var patchNode = patch.patches[name];
+    if (patchNode == null) {
+      if (externalKeyword != null) {
+        print('warning: patch not found for $name: $node');
+      }
+      return;
+    }
+    patch.applied.add(name);
+
+    Annotation patchMeta = patchNode.metadata.lastWhere(_isPatchAnnotation);
+    int start = patchMeta.endToken.next.offset;
+    var code = patch.contents.substring(start, patchNode.end);
+
+    // For some node like static fields, the node's offset doesn't include
+    // the external keyword. Also starting from the keyword lets us preserve
+    // documentation comments.
+    edits.replace(externalKeyword?.offset ?? node.offset, node.end, code);
+  }
+}
+
+class PatchFinder extends GeneralizingAstVisitor {
+  final String contents;
+  final CompilationUnit unit;
+
+  final Map patches = <String, Declaration>{};
+  final Map mergeMembers = <String, List<ClassMember>>{};
+  final List mergeDeclarations = <CompilationUnitMember>[];
+  final Set<String> applied = new Set<String>();
+
+  PatchFinder.parseAndVisit(String name, String contents)
+      : contents = contents,
+        unit = parseCompilationUnit(contents, name: name) {
+    visitCompilationUnit(unit);
+  }
+
+  @override
+  visitCompilationUnitMember(CompilationUnitMember node) {
+    mergeDeclarations.add(node);
+  }
+
+  @override
+  visitClassDeclaration(ClassDeclaration node) {
+    if (_isPatch(node)) {
+      var members = <ClassMember>[];
+      for (var member in node.members) {
+        if (_isPatch(member)) {
+          patches[_qualifiedName(member)] = member;
+        } else {
+          members.add(member);
+        }
+      }
+      if (members.isNotEmpty) {
+        mergeMembers[_qualifiedName(node)] = members;
+      }
+    } else {
+      mergeDeclarations.add(node);
+    }
+  }
+
+  @override
+  visitFunctionDeclaration(FunctionDeclaration node) {
+    if (_isPatch(node)) {
+      patches[_qualifiedName(node)] = node;
+    } else {
+      mergeDeclarations.add(node);
+    }
+  }
+
+  @override
+  visitFunctionBody(node) {} // skip method bodies
+}
+
+String _qualifiedName(Declaration node) {
+  var parent = node.parent;
+  var className = '';
+  if (parent is ClassDeclaration) {
+    className = parent.name.name + '.';
+  }
+  var name = (node as dynamic).name;
+  name = (name != null ? name.name : '');
+
+  var accessor = '';
+  if (node is MethodDeclaration) {
+    if (node.isGetter) accessor = 'get:';
+    else if (node.isSetter) accessor = 'set:';
+  }
+  return className + accessor + name;
+}
+
+bool _isPatch(AnnotatedNode node) => node.metadata.any(_isPatchAnnotation);
+
+bool _isPatchAnnotation(Annotation m) =>
+    m.name.name == 'patch' && m.constructorName == null && m.arguments == null;
+
+/// Editable string buffer.
+///
+/// Applies a series of edits (insertions, removals, replacements) using
+/// original location information, and composes them into the edited string.
+///
+/// For example, starting with a parsed AST with original source locations,
+/// this type allows edits to be made without regards to other edits.
+class StringEditBuffer {
+  final String original;
+  final _edits = <_StringEdit>[];
+
+  /// Creates a new transaction.
+  StringEditBuffer(this.original);
+
+  bool get hasEdits => _edits.length > 0;
+
+  /// Edit the original text, replacing text on the range [begin] and
+  /// exclusive [end] with the [replacement] string.
+  void replace(int begin, int end, String replacement) {
+    _edits.add(new _StringEdit(begin, end, replacement));
+  }
+
+  /// Insert [string] at [offset].
+  /// Equivalent to `replace(offset, offset, string)`.
+  void insert(int offset, String string) => replace(offset, offset, string);
+
+  /// Remove text from the range [begin] to exclusive [end].
+  /// Equivalent to `replace(begin, end, '')`.
+  void remove(int begin, int end) => replace(begin, end, '');
+
+  /// Applies all pending [edit]s and returns a new string.
+  ///
+  /// This method is non-destructive: it does not discard existing edits or
+  /// change the [original] string. Further edits can be added and this method
+  /// can be called again.
+  ///
+  /// Throws [UnsupportedError] if the edits were overlapping. If no edits were
+  /// made, the original string will be returned.
+  String toString() {
+    var sb = new StringBuffer();
+    if (_edits.length == 0) return original;
+
+    // Sort edits by start location.
+    _edits.sort();
+
+    int consumed = 0;
+    for (var edit in _edits) {
+      if (consumed > edit.begin) {
+        sb = new StringBuffer();
+        sb.write('overlapping edits. Insert at offset ');
+        sb.write(edit.begin);
+        sb.write(' but have consumed ');
+        sb.write(consumed);
+        sb.write(' input characters. List of edits:');
+        for (var e in _edits) {
+          sb.write('\n    ');
+          sb.write(e);
+        }
+        throw new UnsupportedError(sb.toString());
+      }
+
+      // Add characters from the original string between this edit and the last
+      // one, if any.
+      var betweenEdits = original.substring(consumed, edit.begin);
+      sb.write(betweenEdits);
+      sb.write(edit.replace);
+      consumed = edit.end;
+    }
+
+    // Add any text from the end of the original string that was not replaced.
+    sb.write(original.substring(consumed));
+    return sb.toString();
+  }
+}
+
+class _StringEdit implements Comparable<_StringEdit> {
+  final int begin;
+  final int end;
+  final String replace;
+
+  _StringEdit(this.begin, this.end, this.replace);
+
+  int get length => end - begin;
+
+  String toString() => '(Edit @ $begin,$end: "$replace")';
+
+  int compareTo(_StringEdit other) {
+    int diff = begin - other.begin;
+    if (diff != 0) return diff;
+    return end - other.end;
+  }
+}
+
+List<SdkLibrary> _getSdkLibraries(String contents) {
+  var libraryBuilder = new SdkLibrariesReader_LibraryBuilder(true);
+  parseCompilationUnit(contents).accept(libraryBuilder);
+  return libraryBuilder.librariesMap.sdkLibraries;
+}
diff --git a/tools/patch_sdk.py b/tools/patch_sdk.py
new file mode 100755
index 0000000..f87addb
--- /dev/null
+++ b/tools/patch_sdk.py
@@ -0,0 +1,48 @@
+#!/usr/bin/env python
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for 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 argparse
+import os
+import subprocess
+import sys
+import utils
+
+usage = """patch_sdk.py [options]"""
+
+def DisplayBootstrapWarning():
+  print """\
+
+
+WARNING: Your system cannot run the checked-in Dart SDK. Using the
+bootstrap Dart executable will make debug builds slow.
+Please see the Wiki for instructions on replacing the checked-in Dart SDK.
+
+https://github.com/dart-lang/sdk/wiki/The-checked-in-SDK-in-tools
+
+"""
+
+def BuildArguments():
+  result = argparse.ArgumentParser(usage=usage)
+  result.add_argument("--dart-executable", help="dart executable", default=None)
+  return result
+
+def main():
+  # Parse the options.
+  parser = BuildArguments()
+  (options, args) = parser.parse_known_args()
+  if utils.CheckedInSdkCheckExecutable():
+    options.dart_executable = utils.CheckedInSdkExecutable()
+  elif options.dart_executable is not None:
+    DisplayBootstrapWarning()
+    options.dart_executable = os.path.abspath(options.dart_executable)
+  else:
+    print >> sys.stderr, 'ERROR: cannot locate dart executable'
+    return -1
+  dart_file = os.path.join(os.path.dirname(__file__), 'patch_sdk.dart')
+  subprocess.check_call([options.dart_executable, dart_file] + args)
+  return 0
+
+if __name__ == '__main__':
+  sys.exit(main())
diff --git a/tools/process_gypis.py b/tools/process_gypis.py
new file mode 100755
index 0000000..b74ce2c
--- /dev/null
+++ b/tools/process_gypis.py
@@ -0,0 +1,69 @@
+#!/usr/bin/env python
+# Copyright 2016, the Dart project authors.  Please see the AUTHORS file
+# for 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 gn_helpers
+import os.path
+import sys
+
+# Given a list of dart package names read in the set of runtime and sdk library
+# sources into variables in a gn scope.
+
+
+def LoadPythonDictionary(path):
+  file_string = open(path).read()
+  try:
+    file_data = eval(file_string, {'__builtins__': None}, None)
+  except SyntaxError, e:
+    e.filename = path
+    raise
+  except Exception, e:
+    raise Exception('Unexpected error while reading %s: %s' %
+                    (path, str(e)))
+
+  assert isinstance(
+    file_data, dict), '%s does not eval to a dictionary' % path
+  return file_data
+
+
+def main():
+  dart_root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+  runtime_dir = os.path.join(dart_root_dir, 'runtime')
+  runtime_lib_dir = os.path.join(runtime_dir, 'lib')
+  sdk_lib_dir = os.path.join(dart_root_dir, 'sdk', 'lib')
+  libs = sys.argv[1:]
+  data = {}
+  data['allsources'] = []
+
+  for lib in libs:
+    runtime_path = os.path.join(runtime_lib_dir, lib + '_sources.gypi')
+    sdk_path = os.path.join(sdk_lib_dir, lib, lib + '_sources.gypi')
+    runtime_dict = LoadPythonDictionary(runtime_path)
+    for source in runtime_dict['sources']:
+      data['allsources'].append(source)
+    data[lib + '_runtime_sources'] = runtime_dict['sources']
+    sdk_dict = LoadPythonDictionary(sdk_path)
+    data[lib + '_sdk_sources'] = sdk_dict['sources']
+
+  vm_sources_path = os.path.join(runtime_dir, 'vm', 'vm_sources.gypi')
+  vm_sources_dict = LoadPythonDictionary(vm_sources_path)
+  data['vm_sources'] = vm_sources_dict['sources']
+
+  platform_sources_base = os.path.join(runtime_dir, 'platform', 'platform_')
+  platform_headers_dict = LoadPythonDictionary(
+      platform_sources_base + 'headers.gypi')
+  platform_sources_dict = LoadPythonDictionary(
+      platform_sources_base + 'sources.gypi')
+  data['platform_sources'] = platform_headers_dict[
+      'sources'] + platform_sources_dict['sources']
+
+  bin_io_sources_path = os.path.join(runtime_dir, 'bin', 'io_sources.gypi')
+  bin_io_sources_dict = LoadPythonDictionary(bin_io_sources_path)
+  data['bin_io_sources'] = bin_io_sources_dict['sources']
+
+  print gn_helpers.ToGNString(data)
+  return 0
+
+if __name__ == '__main__':
+  sys.exit(main())
diff --git a/tools/testing/dart/co19_test.dart b/tools/testing/dart/co19_test.dart
index 9118fc8..130db11 100644
--- a/tools/testing/dart/co19_test.dart
+++ b/tools/testing/dart/co19_test.dart
@@ -47,7 +47,7 @@
     '--use-sdk',
     '--checked'
   ],
-  const <String>['-mrelease', '-rdartium', '-cnone', '--use-sdk', '--checked'],
+  const <String>['-mrelease', '-rdartium', '-cnone', '--use-sdk', '--fast-startup'],
   const <String>['-mrelease', '-rdartium', '-cnone', '--use-sdk'],
 ];
 
diff --git a/tools/testing/dart/co19_test_config.dart b/tools/testing/dart/co19_test_config.dart
index c331f93..9dc55fa 100644
--- a/tools/testing/dart/co19_test_config.dart
+++ b/tools/testing/dart/co19_test_config.dart
@@ -17,7 +17,8 @@
           "tests/co19/co19-analyzer2.status",
           "tests/co19/co19-runtime.status",
           "tests/co19/co19-dart2js.status",
-          "tests/co19/co19-dartium.status"
+          "tests/co19/co19-dartium.status",
+          "tests/co19/co19-kernel.status"
         ]);
 
   bool isTestFile(String filename) => _testRegExp.hasMatch(filename);
diff --git a/tools/testing/dart/compiler_configuration.dart b/tools/testing/dart/compiler_configuration.dart
index d0e6f5f..0a15772 100644
--- a/tools/testing/dart/compiler_configuration.dart
+++ b/tools/testing/dart/compiler_configuration.dart
@@ -58,6 +58,7 @@
     bool hotReload = configuration['hot_reload'];
     bool hotReloadRollback = configuration['hot_reload_rollback'];
     bool useFastStartup = configuration['fast_startup'];
+    bool verifyKernel = configuration['verify-ir'];
 
     switch (compiler) {
       case 'dart2analyzer':
@@ -78,11 +79,9 @@
             useFastStartup: useFastStartup,
             extraDart2jsOptions:
                 TestUtils.getExtraOptions(configuration, 'dart2js_options'));
+      case 'dart2appjit':
       case 'dart2app':
         return new Dart2AppSnapshotCompilerConfiguration(
-            isDebug: isDebug, isChecked: isChecked);
-      case 'dart2appjit':
-        return new Dart2AppJitSnapshotCompilerConfiguration(
             isDebug: isDebug, isChecked: isChecked, useBlobs: useBlobs);
       case 'precompiler':
         return new PrecompilerCompilerConfiguration(
@@ -91,6 +90,19 @@
             arch: configuration['arch'],
             useBlobs: useBlobs,
             isAndroid: configuration['system'] == 'android');
+      case 'dartk':
+        return ComposedCompilerConfiguration.createDartKConfiguration(
+            isHostChecked: isHostChecked,
+            useSdk: useSdk,
+            verify: verifyKernel);
+      case 'dartkp':
+        return ComposedCompilerConfiguration.createDartKPConfiguration(
+            isHostChecked: isHostChecked,
+            arch: configuration['arch'],
+            useBlobs: useBlobs,
+            isAndroid: configuration['system'] == 'android',
+            useSdk: useSdk,
+            verify: verifyKernel);
       case 'none':
         return new NoneCompilerConfiguration(
             isDebug: isDebug,
@@ -201,6 +213,189 @@
   }
 }
 
+/// The "dartk" compiler.
+class DartKCompilerConfiguration extends CompilerConfiguration {
+  final bool verify;
+
+  DartKCompilerConfiguration({bool isHostChecked, bool useSdk, this.verify})
+      : super._subclass(isHostChecked: isHostChecked, useSdk: useSdk);
+
+  @override
+  String computeCompilerPath(String buildDir) {
+    return 'tools/dartk_wrappers/dartk$executableScriptSuffix';
+  }
+
+  CompilationCommand computeCompilationCommand(
+      String outputFileName,
+      String buildDir,
+      CommandBuilder commandBuilder,
+      List arguments,
+      Map<String, String> environmentOverrides) {
+    Iterable<String> extraArguments = [
+      '--sdk',
+      '$buildDir/patched_sdk',
+      '--link',
+      '--target=vm',
+      verify ? '--verify-ir' : null,
+      '--out',
+      outputFileName
+    ].where((x) => x != null);
+    return commandBuilder.getKernelCompilationCommand(
+        'dartk',
+        outputFileName,
+        true,
+        bootstrapDependencies(buildDir),
+        computeCompilerPath(buildDir),
+        []..addAll(arguments)..addAll(extraArguments),
+        environmentOverrides);
+  }
+
+  CommandArtifact computeCompilationArtifact(
+      String buildDir,
+      String tempDir,
+      CommandBuilder commandBuilder,
+      List arguments,
+      Map<String, String> environmentOverrides) {
+    return new CommandArtifact(<Command>[
+      this.computeCompilationCommand('$tempDir/out.dill', buildDir,
+          CommandBuilder.instance, arguments, environmentOverrides)
+    ], '$tempDir/out.dill', 'application/dart');
+  }
+}
+
+typedef List<String> CompilerArgumentsFunction(
+    List<String> globalArguments,
+    String previousCompilerOutput);
+
+class PipelineCommand {
+  final CompilerConfiguration compilerConfiguration;
+  final CompilerArgumentsFunction _argumentsFunction;
+
+  PipelineCommand._(this.compilerConfiguration, this._argumentsFunction);
+
+  factory PipelineCommand.runWithGlobalArguments(CompilerConfiguration conf) {
+    return new PipelineCommand._(conf, (List<String> globalArguments,
+                                        String previousOutput) {
+      assert(previousOutput == null);
+      return globalArguments;
+    });
+  }
+
+  factory PipelineCommand.runWithDartOrKernelFile(CompilerConfiguration conf) {
+    return new PipelineCommand._(conf, (List<String> globalArguments,
+                                        String previousOutput) {
+      var filtered = globalArguments
+        .where((String name) => name.endsWith('.dart') ||
+                                name.endsWith('.dill'))
+        .toList();
+      assert(filtered.length == 1);
+      return filtered;
+    });
+  }
+
+  factory PipelineCommand.runWithPreviousKernelOutput(
+      CompilerConfiguration conf) {
+    return new PipelineCommand._(conf, (List<String> globalArguments,
+                                        String previousOutput) {
+      assert(previousOutput.endsWith('.dill'));
+      return [previousOutput];
+    });
+  }
+
+  List<String> extractArguments(List<String> globalArguments,
+                                String previousOutput) {
+    return _argumentsFunction(globalArguments, previousOutput);
+  }
+}
+
+class ComposedCompilerConfiguration extends CompilerConfiguration {
+  final List<PipelineCommand> pipelineCommands;
+  final bool isPrecompiler;
+
+  ComposedCompilerConfiguration(this.pipelineCommands, {this.isPrecompiler: false})
+      : super._subclass();
+
+  CommandArtifact computeCompilationArtifact(
+      String buildDir,
+      String tempDir,
+      CommandBuilder commandBuilder,
+      List globalArguments,
+      Map<String, String> environmentOverrides) {
+
+    List<Command> allCommands = [];
+
+    // The first compilation command is as usual.
+    var arguments = pipelineCommands[0].extractArguments(globalArguments, null);
+    CommandArtifact artifact =
+        pipelineCommands[0].compilerConfiguration.computeCompilationArtifact(
+          buildDir, tempDir, commandBuilder, arguments, environmentOverrides);
+    allCommands.addAll(artifact.commands);
+
+    // The following compilation commands are based on the output of the
+    // previous one.
+    for (int i = 1; i < pipelineCommands.length; i++) {
+      PipelineCommand pc = pipelineCommands[i];
+
+      arguments = pc.extractArguments(globalArguments, artifact.filename);
+      artifact = pc.compilerConfiguration.computeCompilationArtifact(
+          buildDir, tempDir, commandBuilder, arguments, environmentOverrides);
+
+      allCommands.addAll(artifact.commands);
+    }
+
+    return new CommandArtifact(
+        allCommands, artifact.filename, artifact.mimeType);
+  }
+
+  List<String> computeCompilerArguments(vmOptions, sharedOptions, args) {
+    // The result will be passed as an input to [extractArguments]
+    // (i.e. the arguments to the [PipelineCommand]).
+    return new List<String>.from(sharedOptions)..addAll(args);
+  }
+
+  List<String> computeRuntimeArguments(
+      RuntimeConfiguration runtimeConfiguration,
+      String buildDir,
+      TestInformation info,
+      List<String> vmOptions,
+      List<String> sharedOptions,
+      List<String> originalArguments,
+      CommandArtifact artifact) {
+    final String suffix = isPrecompiler ? "/out.aotsnapshot" : "";
+    return <String>["${artifact.filename}${suffix}"];
+  }
+
+  static ComposedCompilerConfiguration createDartKPConfiguration(
+      {bool isHostChecked, String arch, bool useBlobs, bool isAndroid,
+       bool useSdk, bool verify}) {
+    var nested = [];
+
+    // Compile with dartk.
+    nested.add(new PipelineCommand.runWithGlobalArguments(
+        new DartKCompilerConfiguration(isHostChecked: isHostChecked,
+            useSdk: useSdk, verify: verify)));
+
+    // Run the normal precompiler.
+    nested.add(new PipelineCommand.runWithPreviousKernelOutput(
+        new PrecompilerCompilerConfiguration(
+          arch: arch, useBlobs: useBlobs, isAndroid: isAndroid)));
+
+    return new ComposedCompilerConfiguration(nested, isPrecompiler: true);
+  }
+
+  static ComposedCompilerConfiguration createDartKConfiguration(
+      {bool isHostChecked, bool useSdk, bool verify}) {
+    var nested = [];
+
+    // Compile with dartk.
+    nested.add(new PipelineCommand.runWithGlobalArguments(
+        new DartKCompilerConfiguration(isHostChecked: isHostChecked,
+            useSdk: useSdk, verify: verify)));
+
+    return new ComposedCompilerConfiguration(nested, isPrecompiler: false);
+  }
+}
+
 /// Common configuration for dart2js-based tools, such as, dart2js
 class Dart2xCompilerConfiguration extends CompilerConfiguration {
   final String moniker;
@@ -369,10 +564,12 @@
       Map<String, String> environmentOverrides) {
     var exec = "$buildDir/dart_bootstrap";
     var args = new List();
-    args.add("--snapshot=$tempDir");
     args.add("--snapshot-kind=app-aot");
     if (useBlobs) {
+      args.add("--snapshot=$tempDir/out.aotsnapshot");
       args.add("--use-blobs");
+    } else {
+      args.add("--snapshot=$tempDir/out.S");
     }
     if (isAndroid && arch == 'arm') {
       args.add('--no-sim-use-hardfp');
@@ -390,15 +587,13 @@
       List arguments,
       Map<String, String> environmentOverrides) {
 
-    var cc, shared, libname;
+    var cc, shared;
     if (Platform.isLinux) {
       cc = 'gcc';
       shared = '-shared';
-      libname = 'libprecompiled.so';
     } else if (Platform.isMacOS) {
       cc = 'clang';
       shared = '-dynamiclib';
-      libname = 'libprecompiled.dylib';
     } else {
       throw "Platform not supported: ${Platform.operatingSystem}";
     }
@@ -430,8 +625,8 @@
     var args = (cc_flags != null) ? [ shared, cc_flags ] : [ shared ];
     args.addAll([
       '-o',
-      '$tempDir/$libname',
-      '$tempDir/snapshot.S'
+      '$tempDir/out.aotsnapshot',
+      '$tempDir/out.S'
     ]);
 
     return commandBuilder.getCompilationCommand('assemble', tempDir, !useSdk,
@@ -447,7 +642,7 @@
       List arguments,
       Map<String, String> environmentOverrides) {
     var exec = 'rm';
-    var args = ['$tempDir/snapshot.S'];
+    var args = ['$tempDir/out.S'];
 
     return commandBuilder.getCompilationCommand(
         'remove_assembly',
@@ -502,8 +697,9 @@
 }
 
 class Dart2AppSnapshotCompilerConfiguration extends CompilerConfiguration {
-  Dart2AppSnapshotCompilerConfiguration({bool isDebug, bool isChecked})
-      : super._subclass(isDebug: isDebug, isChecked: isChecked);
+  final bool useBlobs;
+  Dart2AppSnapshotCompilerConfiguration({bool isDebug, bool isChecked, bool useBlobs})
+      : super._subclass(isDebug: isDebug, isChecked: isChecked), this.useBlobs = useBlobs;
 
   int computeTimeoutMultiplier() {
     int multiplier = 2;
@@ -530,10 +726,13 @@
       CommandBuilder commandBuilder,
       List arguments,
       Map<String, String> environmentOverrides) {
-    var exec = "$buildDir/dart_bootstrap";
+    var exec = "$buildDir/dart";
     var args = new List();
-    args.add("--snapshot=$tempDir");
-    args.add("--snapshot-kind=app-after-run");
+    args.add("--snapshot=$tempDir/out.jitsnapshot");
+    args.add("--snapshot-kind=app-jit");
+    if (useBlobs) {
+      args.add("--use-blobs");
+    }
     args.addAll(arguments);
 
     return commandBuilder.getCompilationCommand(
@@ -579,37 +778,6 @@
   }
 }
 
-class Dart2AppJitSnapshotCompilerConfiguration extends Dart2AppSnapshotCompilerConfiguration {
-  final bool useBlobs;
-  Dart2AppJitSnapshotCompilerConfiguration({bool isDebug, bool isChecked, bool useBlobs})
-      : super(isDebug: isDebug, isChecked: isChecked), this.useBlobs = useBlobs;
-
-  CompilationCommand computeCompilationCommand(
-      String tempDir,
-      String buildDir,
-      CommandBuilder commandBuilder,
-      List arguments,
-      Map<String, String> environmentOverrides) {
-    var exec = "$buildDir/dart";
-    var args = new List();
-    args.add("--snapshot=$tempDir");
-    args.add("--snapshot-kind=app-jit-after-run");
-    if (useBlobs) {
-      args.add("--use-blobs");
-    }
-    args.addAll(arguments);
-
-    return commandBuilder.getCompilationCommand(
-        'dart2snapshot',
-        tempDir,
-        !useSdk,
-        bootstrapDependencies(buildDir),
-        exec,
-        args,
-        environmentOverrides);
-  }
-}
-
 class AnalyzerCompilerConfiguration extends CompilerConfiguration {
   AnalyzerCompilerConfiguration(
       {bool isDebug, bool isChecked, bool isStrong, bool isHostChecked, bool
diff --git a/tools/testing/dart/runtime_configuration.dart b/tools/testing/dart/runtime_configuration.dart
index 8983cc5..97c918a 100644
--- a/tools/testing/dart/runtime_configuration.dart
+++ b/tools/testing/dart/runtime_configuration.dart
@@ -4,6 +4,8 @@
 
 library runtime_configuration;
 
+import 'dart:io' show Platform;
+
 import 'compiler_configuration.dart' show CommandArtifact;
 
 // TODO(ahe): Remove this import, we can precompute all the values required
@@ -244,16 +246,17 @@
       throw "dart_app cannot run files of type '$type'.";
     }
 
-    var augmentedArgs = new List();
-    augmentedArgs.add("--run-app-snapshot=${artifact.filename}");
-    if (useBlobs) {
-      augmentedArgs.add("--use-blobs");
+    var args = new List();
+    args.addAll(arguments);
+    for (var i = 0; i < args.length; i++) {
+      if (args[i].endsWith(".dart")) {
+        args[i] = "${artifact.filename}/out.jitsnapshot";
+      }
     }
-    augmentedArgs.addAll(arguments);
 
     return <Command>[
       commandBuilder.getVmCommand(suite.dartVmBinaryFileName,
-          augmentedArgs, environmentOverrides)
+          args, environmentOverrides)
     ];
   }
 }
@@ -274,16 +277,17 @@
       throw "dart_precompiled cannot run files of type '$type'.";
     }
 
-    var augmentedArgs = new List();
-    augmentedArgs.add("--run-app-snapshot=${artifact.filename}");
-    if (useBlobs) {
-      augmentedArgs.add("--use-blobs");
+    var args = new List();
+    args.addAll(arguments);
+    for (var i = 0; i < args.length; i++) {
+      if (args[i].endsWith(".dart")) {
+        args[i] = "${artifact.filename}/out.aotsnapshot";
+      }
     }
-    augmentedArgs.addAll(arguments);
 
     return <Command>[
       commandBuilder.getVmCommand(suite.dartPrecompiledBinaryFileName,
-          augmentedArgs, environmentOverrides)
+          args, environmentOverrides)
     ];
   }
 }
@@ -306,8 +310,10 @@
     }
 
     String precompiledRunner = suite.dartPrecompiledBinaryFileName;
+    String processTest = suite.processTestBinaryFileName;
     return <Command>[
       commandBuilder.getAdbPrecompiledCommand(precompiledRunner,
+                                              processTest,
                                               script,
                                               arguments,
                                               useBlobs)
diff --git a/tools/testing/dart/test_configurations.dart b/tools/testing/dart/test_configurations.dart
index f82e62d..d9e7128 100644
--- a/tools/testing/dart/test_configurations.dart
+++ b/tools/testing/dart/test_configurations.dart
@@ -42,6 +42,7 @@
   new Path('tests/corelib'),
   new Path('tests/html'),
   new Path('tests/isolate'),
+  new Path('tests/kernel'),
   new Path('tests/language'),
   new Path('tests/lib'),
   new Path('tests/standalone'),
diff --git a/tools/testing/dart/test_options.dart b/tools/testing/dart/test_options.dart
index 936bb39..83856fe 100644
--- a/tools/testing/dart/test_options.dart
+++ b/tools/testing/dart/test_options.dart
@@ -26,6 +26,7 @@
   'pkg',
   'analyze_library',
   'service',
+  'kernel',
   'observatory_ui'
 ];
 
@@ -73,10 +74,25 @@
    dart2analyzer: Perform static analysis on Dart code by running the analyzer
           (only valid with the following runtimes: none)
 
-   dart2app: Compile the Dart code into an app snapshot before running the test
-          (only valid with the following runtimes: dart_app)''',
+   dart2app:
+   dart2appjit: Compile the Dart code into an app snapshot before running test
+          (only valid with dart_app runtime)
+
+   dartk: Compile the Dart source into Kernel before running test.
+
+   dartkp: Compiler the Dart source into Kernel and then Kernel into AOT
+   snapshot before running the test.''',
           ['-c', '--compiler'],
-          ['none', 'precompiler', 'dart2js', 'dart2analyzer', 'dart2app', 'dart2appjit'],
+          [
+            'none',
+            'precompiler',
+            'dart2js',
+            'dart2analyzer',
+            'dart2app',
+            'dart2appjit',
+            'dartk',
+            'dartkp'
+          ],
           'none'),
       // TODO(antonm): fix the option drt.
       new _TestOptionSpecification(
@@ -190,21 +206,29 @@
           'noopt', 'Run an in-place precompilation', ['--noopt'], [], false,
           type: 'bool'),
       new _TestOptionSpecification(
-          'fast_startup', 'Pass the --fast-startup flag to dart2js',
-          ['--fast-startup'], [], false,
+          'fast_startup',
+          'Pass the --fast-startup flag to dart2js',
+          ['--fast-startup'],
+          [],
+          false,
+          type: 'bool'),
+      new _TestOptionSpecification('hot_reload', 'Run hot reload stress tests',
+          ['--hot-reload'], [], false,
           type: 'bool'),
       new _TestOptionSpecification(
-          'hot_reload', 'Run hot reload stress tests', ['--hot-reload'], [],
-          false, type: 'bool'),
-      new _TestOptionSpecification(
           'hot_reload_rollback',
-          'Run hot reload rollback stress tests', ['--hot-reload-rollback'],
+          'Run hot reload rollback stress tests',
+          ['--hot-reload-rollback'],
           [],
-          false, type: 'bool'),
+          false,
+          type: 'bool'),
       new _TestOptionSpecification(
           'use_blobs',
           'Use mmap instead of shared libraries for precompilation',
-          ['--use-blobs'], [], false, type: 'bool'),
+          ['--use-blobs'],
+          [],
+          false,
+          type: 'bool'),
       new _TestOptionSpecification(
           'timeout', 'Timeout in seconds', ['-t', '--timeout'], [], -1,
           type: 'int'),
@@ -263,6 +287,9 @@
           'verbose', 'Verbose output', ['-v', '--verbose'], [], false,
           type: 'bool'),
       new _TestOptionSpecification(
+          'verify-ir', 'Verify kernel IR', ['--verify-ir'], [], false,
+          type: 'bool'),
+      new _TestOptionSpecification(
           'list', 'List tests only, do not run them', ['--list'], [], false,
           type: 'bool'),
       new _TestOptionSpecification(
@@ -581,56 +608,56 @@
   // For printing out reproducing command lines, we don't want to add these
   // options.
   Set<String> _blacklistedOptions = new Set<String>.from([
-    'progress',
-    'failure-summary',
-    'step_name',
-    'report',
-    'tasks',
-    'verbose',
-    'time',
-    'dart',
-    'drt',
-    'dartium',
-    'firefox',
-    'chrome',
-    'safari',
-    'build_directory',
     'append_logs',
+    'build_directory',
+    'chrome',
+    'copy_coredumps',
+    'dart',
+    'dartium',
+    'drt',
+    'exclude_suite',
+    'failure-summary',
+    'firefox',
     'local_ip',
+    'progress',
+    'report',
+    'safari',
     'shard',
     'shards',
+    'step_name',
+    'tasks',
+    'time',
+    'verbose',
+    'write_debug_log',
+    'write_test_outcome_log',
   ]);
 
   List<String> _constructReproducingCommandArguments(Map config) {
     var arguments = new List<String>();
-    for (var configKey in config.keys) {
-      if (!_blacklistedOptions.contains(configKey)) {
-        for (var option in _options) {
-          var configValue = config[configKey];
-          // We only include entries of [conf] if we find an option for it.
-          if (configKey == option.name && configValue != option.defaultValue) {
-            var isBooleanOption = option.type == 'bool';
-            // Sort by length, so we get the shortest variant.
-            var possibleOptions = new List.from(option.keys);
-            possibleOptions.sort((a, b) => (a.length < b.length ? -1 : 1));
-            var key = possibleOptions[0];
-            if (key.startsWith('--')) {
-              // long version
-              arguments.add(key);
-              if (!isBooleanOption) {
-                arguments.add("$configValue");
-              }
-            } else {
-              // short version
-              assert(key.startsWith('-'));
-              if (!isBooleanOption) {
-                arguments.add("$key$configValue");
-              } else {
-                arguments.add(key);
-              }
-            }
-          }
-        }
+    for (var option in _options) {
+      var name = option.name;
+      if (!config.containsKey(name) || _blacklistedOptions.contains(name)) {
+        continue;
+      }
+      var value = config[name];
+      if (config[name] == option.defaultValue ||
+          (name == 'packages' &&
+              value ==
+                  TestUtils.dartDirUri.resolve('.packages').toFilePath())) {
+        continue;
+      }
+      shortest(String a, String b) => a.length <= b.length ? a : b;
+      var key = option.keys.reduce(shortest);
+      if (option.type == 'bool') {
+        arguments.add(key);
+      } else if (key.startsWith('--')) {
+        // long version
+        arguments.add(key);
+        arguments.add("$value");
+      } else {
+        // short version
+        assert(key.startsWith('-'));
+        arguments.add("$key$value");
       }
     }
     return arguments;
@@ -670,14 +697,18 @@
         validRuntimes = const ['none'];
         break;
       case 'dart2app':
-        validRuntimes = const ['dart_app'];
-        break;
       case 'dart2appjit':
         validRuntimes = const ['dart_app'];
         break;
       case 'precompiler':
         validRuntimes = const ['dart_precompiled'];
         break;
+      case 'dartk':
+        validRuntimes = const ['vm'];
+        break;
+      case 'dartkp':
+        validRuntimes = const ['dart_precompiled'];
+        break;
       case 'none':
         validRuntimes = const [
           'vm',
@@ -814,20 +845,23 @@
     if (selectors.containsKey('observatory_ui')) {
       if (selectors.length == 1) {
         configuration['packages'] = TestUtils.dartDirUri
-          .resolve('runtime/observatory/.packages').toFilePath();
+            .resolve('runtime/observatory/.packages')
+            .toFilePath();
       } else {
         // Make a new configuration whose selectors map only contains
         // observatory_ui, and remove the key from the original selectors.
         // The only mutable value in the map is the selectors, so a
         // shallow copy is safe.
         var observatoryConfiguration = new Map.from(configuration);
-        observatoryConfiguration['selectors'] =
-          {'observatory_ui': selectors['observatory_ui']};
+        observatoryConfiguration['selectors'] = {
+          'observatory_ui': selectors['observatory_ui']
+        };
         selectors.remove('observatory_ui');
 
         // Set the packages flag.
         observatoryConfiguration['packages'] = TestUtils.dartDirUri
-          .resolve('runtime/observatory/.packages').toFilePath();
+            .resolve('runtime/observatory/.packages')
+            .toFilePath();
 
         // Return the expansions of both configurations. Neither will reach
         // this line in the recursive call to _expandConfigurations.
@@ -839,9 +873,9 @@
     if (configuration['package_root'] == null &&
         configuration['packages'] == null) {
       configuration['packages'] =
-        TestUtils.dartDirUri.resolve('.packages').toFilePath();     
+          TestUtils.dartDirUri.resolve('.packages').toFilePath();
     }
-    
+
     // Expand the architectures.
     if (configuration['arch'].contains(',')) {
       return _expandHelper('arch', configuration);
@@ -871,8 +905,8 @@
 
     // Adjust default timeout based on mode, compiler, and sometimes runtime.
     if (configuration['timeout'] == -1) {
-      var isReload = configuration['hot_reload'] ||
-                     configuration['hot_reload_rollback'];
+      var isReload =
+          configuration['hot_reload'] || configuration['hot_reload_rollback'];
       int compilerMulitiplier =
           new CompilerConfiguration(configuration).computeTimeoutMultiplier();
       int runtimeMultiplier = new RuntimeConfiguration(configuration)
diff --git a/tools/testing/dart/test_runner.dart b/tools/testing/dart/test_runner.dart
index 220d3eb..1cb1a39 100644
--- a/tools/testing/dart/test_runner.dart
+++ b/tools/testing/dart/test_runner.dart
@@ -221,6 +221,20 @@
       deepJsonCompare(_bootstrapDependencies, other._bootstrapDependencies);
 }
 
+class KernelCompilationCommand extends CompilationCommand {
+  KernelCompilationCommand._(
+      String displayName,
+      String outputFile,
+      bool neverSkipCompilation,
+      List<Uri> bootstrapDependencies,
+      String executable,
+      List<String> arguments,
+      Map<String, String> environmentOverrides)
+      : super._(displayName, outputFile, neverSkipCompilation,
+                bootstrapDependencies, executable, arguments,
+                environmentOverrides);
+}
+
 /// This is just a Pair(String, Map) class with hashCode and operator ==
 class AddFlagsKey {
   final String flags;
@@ -350,12 +364,16 @@
 
 class AdbPrecompilationCommand extends Command {
   final String precompiledRunnerFilename;
+  final String processTestFilename;
   final String precompiledTestDirectory;
   final List<String> arguments;
   final bool useBlobs;
 
   AdbPrecompilationCommand._(this.precompiledRunnerFilename,
-      this.precompiledTestDirectory, this.arguments, this.useBlobs)
+                             this.processTestFilename,
+                             this.precompiledTestDirectory,
+                             this.arguments,
+                             this.useBlobs)
       : super._("adb_precompilation");
 
   void _buildHashCode(HashCodeBuilder builder) {
@@ -650,6 +668,25 @@
     return _getUniqueCommand(command);
   }
 
+  CompilationCommand getKernelCompilationCommand(
+      String displayName,
+      outputFile,
+      neverSkipCompilation,
+      List<Uri> bootstrapDependencies,
+      String executable,
+      List<String> arguments,
+      Map<String, String> environment) {
+    var command = new KernelCompilationCommand._(
+        displayName,
+        outputFile,
+        neverSkipCompilation,
+        bootstrapDependencies,
+        executable,
+        arguments,
+        environment);
+    return _getUniqueCommand(command);
+  }
+
   AnalysisCommand getAnalysisCommand(
       String displayName, executable, arguments, environmentOverrides,
       {String flavor: 'dart2analyzer'}) {
@@ -665,9 +702,12 @@
   }
 
   AdbPrecompilationCommand getAdbPrecompiledCommand(String precompiledRunner,
-      String testDirectory, List<String> arguments, bool useBlobs) {
+                                                    String processTest,
+                                                    String testDirectory,
+                                                    List<String> arguments,
+                                                    bool useBlobs) {
     var command = new AdbPrecompilationCommand._(
-        precompiledRunner, testDirectory, arguments, useBlobs);
+        precompiledRunner, processTest, testDirectory, arguments, useBlobs);
     return _getUniqueCommand(command);
   }
 
@@ -1609,6 +1649,29 @@
   }
 }
 
+class KernelCompilationCommandOutputImpl extends CompilationCommandOutputImpl {
+  KernelCompilationCommandOutputImpl(
+      Command command, int exitCode, bool timedOut,
+      List<int> stdout, List<int> stderr,
+      Duration time, bool compilationSkipped)
+      : super(command, exitCode, timedOut, stdout, stderr, time,
+              compilationSkipped);
+
+  bool get canRunDependendCommands {
+    // See [BatchRunnerProcess]: 0 means success, 1 means compile-time error.
+    // TODO(asgerf): When the frontend supports it, continue running even if
+    //   there were compile-time errors. See kernel_sdk issue #18.
+    return !hasCrashed && !timedOut && exitCode == 0;
+  }
+
+  // If the compiler was able to produce a Kernel IR file we want to run the
+  // result on the Dart VM.  We therefore mark the [KernelCompilationCommand] as
+  // successful.
+  // => This ensures we test that the DartVM produces correct CompileTime errors
+  //    as it is supposed to for our test suites.
+  bool get successful => canRunDependendCommands;
+}
+
 class JsCommandlineOutputImpl extends CommandOutputImpl
     with UnittestSuiteMessagesMixin {
   JsCommandlineOutputImpl(Command command, int exitCode, bool timedOut,
@@ -1683,6 +1746,9 @@
   } else if (command is VmCommand) {
     return new VmCommandOutputImpl(
         command, exitCode, timedOut, stdout, stderr, time, pid);
+  } else if (command is KernelCompilationCommand) {
+    return new KernelCompilationCommandOutputImpl(
+        command, exitCode, timedOut, stdout, stderr, time, compilationSkipped);
   } else if (command is AdbPrecompilationCommand) {
     return new VmCommandOutputImpl(
         command, exitCode, timedOut, stdout, stderr, time, pid);
@@ -1788,6 +1854,7 @@
   int pid;
   OutputLog stdout = new OutputLog();
   OutputLog stderr = new OutputLog();
+  List<String> diagnostics = <String>[];
   bool compilationSkipped = false;
   Completer<CommandOutput> completer;
 
@@ -1851,43 +1918,35 @@
 
           // Close stdin so that tests that try to block on input will fail.
           process.stdin.close();
-          void timeoutHandler() {
+          timeoutHandler() async {
             timedOut = true;
             if (process != null) {
+              var executable, arguments;
               if (io.Platform.isLinux) {
-                // Try to print stack traces of the timed out process.
-                io.Process.run('eu-stack', ['-p ${process.pid}'])
-                .then((result) {
-                  io.stdout.write(result.stdout);
-                  io.stderr.write(result.stderr);
-                })
-                .catchError(
-                    (error) => print("Error when printing stack trace: $error"))
-                .whenComplete(() {
-                  if (!process.kill()) {
-                    DebugLogger.error("Unable to kill ${process.pid}");
-                  }
-                });
+                executable = 'eu-stack';
+                arguments = ['-p ${process.pid}'];
               } else if (io.Platform.isMacOS) {
                 // Try to print stack traces of the timed out process.
-                io.Process.run('/usr/bin/sample',
-                               ['${process.pid}', '1', '1', '-mayDie'])
-                .then((result) {
-                  io.stdout.write(result.stdout);
-                  io.stderr.write(result.stderr);
-                })
-                .catchError(
-                    (error) => print("Error when printing stack trace: $error"))
-                .whenComplete(() {
-                  if (!process.kill()) {
-                    DebugLogger.error("Unable to kill ${process.pid}");
-                  }
-                });
-              } else {
-                if (!process.kill()) {
-                  DebugLogger.error("Unable to kill ${process.pid}");
+                // `sample` is a sampling profiler but we ask it sample for 1
+                // second with a 4 second delay between samples so that we only
+                // sample the threads once.
+                executable = '/usr/bin/sample';
+                arguments = ['${process.pid}', '1', '4000', '-mayDie'];
+              }
+
+              if (executable != null) {
+                try {
+                  var result = await io.Process.run(executable, arguments);
+                  diagnostics.addAll(result.stdout.split('\n'));
+                  diagnostics.addAll(result.stderr.split('\n'));
+                } catch (error) {
+                  diagnostics.add("Unable to capture stack traces: $error");
                 }
               }
+
+              if (!process.kill()) {
+                diagnostics.add("Unable to kill ${process.pid}");
+              }
             }
           }
 
@@ -1945,6 +2004,7 @@
         new DateTime.now().difference(startTime),
         compilationSkipped,
         pid);
+    commandOutput.diagnostics.addAll(diagnostics);
     return commandOutput;
   }
 
@@ -2546,6 +2606,12 @@
 
     if (command is BrowserTestCommand) {
       return _startBrowserControllerTest(command, timeout);
+    } else if (command is KernelCompilationCommand) {
+      // For now, we always run dartk in batch mode.
+      var name = command.displayName;
+      assert(name == 'dartk');
+      return _getBatchRunner(name)
+          .runCommand(name, command, timeout, command.arguments);
     } else if (command is CompilationCommand && dart2jsBatchMode) {
       return _getBatchRunner("dart2js")
           .runCommand("dart2js", command, timeout, command.arguments);
@@ -2570,6 +2636,7 @@
   Future<CommandOutput> _runAdbPrecompilationCommand(
       AdbDevice device, AdbPrecompilationCommand command, int timeout) async {
     var runner = command.precompiledRunnerFilename;
+    var processTest = command.processTestFilename;
     var testdir = command.precompiledTestDirectory;
     var arguments = command.arguments;
     var devicedir = '/data/local/tmp/precompilation-testing';
@@ -2579,7 +2646,6 @@
     // directory.
     List<String> files = new io.Directory(testdir)
         .listSync()
-        .where((fse) => fse is io.File)
         .map((file) => file.path)
         .map((path) => path.substring(path.lastIndexOf('/') + 1))
         .toList();
@@ -2596,31 +2662,30 @@
     // timing).
     steps.add(() => device.runAdbCommand(
         ['push', runner, '$devicedir/dart_precompiled_runtime']));
+    steps.add(() => device.runAdbCommand(
+        ['push', processTest, '$devicedir/process_test']));
     steps.add(() => device.runAdbShellCommand(
-        ['chmod', '777', '$devicedir/dart_precompiled_runtime']));
+        ['chmod', '777', '$devicedir/dart_precompiled_runtime $devicedir/process_test']));
 
     for (var file in files) {
       steps.add(() => device
           .runAdbCommand(['push', '$testdir/$file', '$deviceTestDir/$file']));
     }
 
-    if (command.useBlobs) {
-      steps.add(() => device.runAdbShellCommand(
-          [
-            '$devicedir/dart_precompiled_runtime',
-            '--run-app-snapshot=$deviceTestDir',
-            '--use-blobs'
-          ]..addAll(arguments),
-          timeout: timeoutDuration));
-    } else {
-      steps.add(() => device.runAdbShellCommand(
-          [
-            '$devicedir/dart_precompiled_runtime',
-            '--run-app-snapshot=$deviceTestDir'
-          ]..addAll(arguments),
-          timeout: timeoutDuration));
+    var args = new List();
+    args.addAll(arguments);
+    for (var i = 0; i < args.length; i++) {
+      if (args[i].endsWith(".dart")) {
+        args[i] = "$deviceTestDir/out.aotsnapshot";
+      }
     }
 
+    steps.add(() => device.runAdbShellCommand(
+        [
+          '$devicedir/dart_precompiled_runtime',
+        ]..addAll(args),
+        timeout: timeoutDuration));
+
     var stopwatch = new Stopwatch()..start();
     var writer = new StringBuffer();
 
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index cf6a1a0..c13b69a 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -234,6 +234,13 @@
     return dartExecutable;
   }
 
+  String get processTestBinaryFileName {
+    String suffix = executableBinarySuffix;
+    String processTestExecutable = '$buildDir/process_test$suffix';
+    TestUtils.ensureExists(processTestExecutable, configuration);
+    return processTestExecutable;
+  }
+
   String get d8FileName {
     var suffix = getExecutableSuffix('d8');
     var d8Dir = TestUtils.dartDir.append('third_party/d8');
@@ -717,7 +724,8 @@
       '$directory/$name.status',
       '$directory/.status',
       '$directory/${name}_dart2js.status',
-      '$directory/${name}_analyzer2.status'
+      '$directory/${name}_analyzer2.status',
+      '$directory/${name}_kernel.status'
     ];
 
     return new StandardTestSuite(configuration, name, directory, status_paths,
@@ -1069,6 +1077,15 @@
         path = path.join(new Path(vmOptionsVarient.toString()));
       }
       tempDir = createCompilationOutputDirectory(path);
+
+      List<String> otherResources = info.optionsFromFile['otherResources'];
+      for (String name in otherResources) {
+        Path namePath = new Path(name);
+        String fileName = namePath.filename;
+        Path fromPath = info.filePath.directoryPath.join(namePath);
+        new File('$tempDir/$name').parent.createSync(recursive: true);
+        new File(fromPath.toNativePath()).copySync('$tempDir/$name');
+      }
     }
 
     CommandArtifact compilationArtifact =
@@ -1666,13 +1683,16 @@
    * configurations, so it may not use [configuration].
    */
   Map readOptionsFromFile(Path filePath) {
-    if (filePath.segments().contains('co19')) {
+    if (filePath.filename.endsWith('.dill')) {
+      return optionsFromKernelFile();
+    } else if (filePath.segments().contains('co19')) {
       return readOptionsFromCo19File(filePath);
     }
     RegExp testOptionsRegExp = new RegExp(r"// VMOptions=(.*)");
     RegExp sharedOptionsRegExp = new RegExp(r"// SharedOptions=(.*)");
     RegExp dartOptionsRegExp = new RegExp(r"// DartOptions=(.*)");
     RegExp otherScriptsRegExp = new RegExp(r"// OtherScripts=(.*)");
+    RegExp otherResourcesRegExp = new RegExp(r"// OtherResources=(.*)");
     RegExp packageRootRegExp = new RegExp(r"// PackageRoot=(.*)");
     RegExp packagesRegExp = new RegExp(r"// Packages=(.*)");
     RegExp isolateStubsRegExp = new RegExp(r"// IsolateStubs=(.*)");
@@ -1752,6 +1772,12 @@
       otherScripts.addAll(match[1].split(' ').where((e) => e != '').toList());
     }
 
+    List<String> otherResources = new List<String>();
+    matches = otherResourcesRegExp.allMatches(contents);
+    for (var match in matches) {
+      otherResources.addAll(match[1].split(' ').where((e) => e != '').toList());
+    }
+
     bool isMultitest = multiTestRegExp.hasMatch(contents);
     bool isMultiHtmlTest = multiHtmlTestRegExp.hasMatch(contents);
     Match isolateMatch = isolateStubsRegExp.firstMatch(contents);
@@ -1776,6 +1802,7 @@
       "hasRuntimeError": false,
       "hasStaticWarning": false,
       "otherScripts": otherScripts,
+      "otherResources": otherResources,
       "isMultitest": isMultitest,
       "isMultiHtmlTest": isMultiHtmlTest,
       "subtestNames": subtestNames,
@@ -1784,6 +1811,25 @@
     };
   }
 
+  Map optionsFromKernelFile() {
+    return const {
+      "vmOptions": const [ const []],
+      "sharedOptions": const [],
+      "dartOptions": null,
+      "packageRoot": null,
+      "packages": null,
+      "hasCompileError": false,
+      "hasRuntimeError": false,
+      "hasStaticWarning": false,
+      "otherScripts": const [],
+      "isMultitest": false,
+      "isMultiHtmlTest": false,
+      "subtestNames": const [],
+      "isolateStubs": '',
+      "containsDomImport": false,
+    };
+  }
+
   List<List<String>> getVmOptions(Map optionsFromFile) {
     var COMPILERS = const ['none', 'precompiler', 'dart2app', 'dart2appjit'];
     var RUNTIMES = const [
@@ -1835,6 +1881,7 @@
       "hasRuntimeError": hasRuntimeError,
       "hasStaticWarning": hasStaticWarning,
       "otherScripts": <String>[],
+      "otherResources": <String>[],
       "isMultitest": isMultitest,
       "isMultiHtmlTest": false,
       "subtestNames": <String>[],
diff --git a/utils/analysis_server/BUILD.gn b/utils/analysis_server/BUILD.gn
new file mode 100644
index 0000000..9359e2c
--- /dev/null
+++ b/utils/analysis_server/BUILD.gn
@@ -0,0 +1,10 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for 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("../application_snapshot.gni")
+
+application_snapshot("analysis_server") {
+  main_dart = "../../pkg/analysis_server/bin/server.dart"
+  training_args = [ "--help" ]
+}
diff --git a/utils/application_snapshot.gni b/utils/application_snapshot.gni
new file mode 100644
index 0000000..0f36737
--- /dev/null
+++ b/utils/application_snapshot.gni
@@ -0,0 +1,51 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for 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("//build/compiled_action.gni")
+
+_dart_root = rebase_path("..")
+
+template("application_snapshot") {
+  assert(defined(invoker.main_dart), "Must specify 'main_dart'")
+  assert(defined(invoker.training_args), "Must specify 'training_args'")
+  main_dart = invoker.main_dart
+  training_args = invoker.training_args
+  name = target_name
+  if (defined(invoker.name)) {
+    name = invoker.name
+  }
+  extra_deps = []
+  if (defined(invoker.deps)) {
+    extra_deps += invoker.deps
+  }
+  extra_inputs = []
+  if (defined(invoker.inputs)) {
+    extra_inputs += invoker.inputs
+  }
+  compiled_action(target_name) {
+    tool = get_path_info("$_dart_root/runtime/bin:dart", "abspath")
+    deps = extra_deps + [ "$_dart_root/pkg:pkg_files_stamp" ]
+
+    inputs = extra_inputs + [
+               "$_dart_root/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart",
+               "$root_gen_dir/pkg_files.stamp",
+             ]
+
+    output = "$root_gen_dir/$name.dart.snapshot"
+    outputs = [
+      output,
+    ]
+
+    dot_packages = rebase_path("$_dart_root/.packages")
+    abs_output = rebase_path(output)
+    main_file = rebase_path(main_dart)
+
+    args = [
+             "--packages=$dot_packages",
+             "--snapshot=$abs_output",
+             "--snapshot-kind=app-jit",
+             main_file,
+           ] + training_args
+  }
+}
diff --git a/utils/compiler/BUILD.gn b/utils/compiler/BUILD.gn
new file mode 100644
index 0000000..9ec1093
--- /dev/null
+++ b/utils/compiler/BUILD.gn
@@ -0,0 +1,76 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for 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("//build/compiled_action.gni")
+import("../create_timestamp.gni")
+import("../application_snapshot.gni")
+
+create_timestamp_file("dart2js_files_stamp") {
+  path = rebase_path("../../pkg/compiler/lib")
+  output = "$root_gen_dir/dart2js_files.stamp"
+}
+
+create_timestamp_file("runtime_lib_files_stamp") {
+  path = rebase_path("../../runtime/lib")
+  output = "$target_gen_dir/runtime_lib_files.stamp"
+}
+
+create_timestamp_file("dartdoc_files_stamp") {
+  path = rebase_path("../../sdk/lib/_internal/dartdoc")
+  output = "$target_gen_dir/dartdoc_files.stamp"
+}
+
+compiled_action("dart2js_create_snapshot_entries") {
+  tool = "../../runtime/bin:dart"
+  deps = [
+    ":dart2js_files_stamp",
+    ":dartdoc_files_stamp",
+    ":runtime_lib_files_stamp",
+  ]
+
+  dot_packages = rebase_path("../../.packages")
+  create_snapshot_entry = rebase_path("create_snapshot_entry.dart")
+  output_dir = rebase_path(root_gen_dir)
+
+  inputs = [
+    "../../sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart",
+    create_snapshot_entry,
+    "$root_gen_dir/dart2js_files.stamp",
+    "../../tools/VERSION",
+  ]
+
+  utils_output = "$root_gen_dir/utils_wrapper.dart"
+  dart2js_output = "$root_gen_dir/dart2js.dart"
+  outputs = [
+    utils_output,
+    dart2js_output,
+  ]
+
+  args = [
+    "--packages=$dot_packages",
+    create_snapshot_entry,
+    "--output_dir=$output_dir",
+    "--dart2js_main=pkg/compiler/lib/src/dart2js.dart",
+  ]
+}
+
+application_snapshot("dart2js") {
+  deps = [
+    ":dart2js_create_snapshot_entries",
+  ]
+  main_dart = "$root_gen_dir/dart2js.dart"
+  training_args = [
+    "--library-root=" + rebase_path("../../sdk"),
+    "--categories=all",
+    rebase_path("$root_gen_dir/dart2js.dart"),
+  ]
+}
+
+application_snapshot("utils_wrapper") {
+  deps = [
+    ":dart2js_create_snapshot_entries",
+  ]
+  main_dart = "$root_gen_dir/utils_wrapper.dart"
+  training_args = [ "--help" ]
+}
diff --git a/utils/compiler/create_snapshot_entry.dart b/utils/compiler/create_snapshot_entry.dart
new file mode 100644
index 0000000..ea9c511
--- /dev/null
+++ b/utils/compiler/create_snapshot_entry.dart
@@ -0,0 +1,95 @@
+// 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';
+
+Future<String> getVersion(var rootPath) {
+  var suffix = Platform.operatingSystem == 'windows' ? '.exe' : '';
+  var printVersionScript = rootPath.resolve("tools/print_version.py");
+  return Process.run("python$suffix",
+                     [printVersionScript.toFilePath()]).then((result) {
+    if (result.exitCode != 0) {
+      throw "Could not generate version";
+    }
+    return result.stdout.trim();
+  });
+}
+
+Future<String> getSnapshotGenerationFile(var args, var rootPath) {
+  var dart2js = rootPath.resolve(args["dart2js_main"]);
+  return getVersion(rootPath).then((version) {
+    var snapshotGenerationText =
+"""
+import '${dart2js.toFilePath(windows: false)}' as dart2jsMain;
+import 'dart:io';
+
+void main(List<String> arguments) {
+  if (arguments.length < 1) throw "No tool given as argument";
+  String tool = arguments[0];
+  if (tool == "dart2js") {
+    dart2jsMain.BUILD_ID = "$version";
+    dart2jsMain.main(arguments.skip(1).toList());
+  }
+}
+
+""";
+    return snapshotGenerationText;
+  });
+}
+
+Future<String> getDart2jsSnapshotGenerationFile(var args, var rootPath) {
+  var dart2js = rootPath.resolve(args["dart2js_main"]);
+  return getVersion(rootPath).then((version) {
+    var snapshotGenerationText =
+"""
+import '${dart2js.toFilePath(windows: false)}' as dart2jsMain;
+
+void main(List<String> arguments) {
+  dart2jsMain.BUILD_ID = "$version";
+  dart2jsMain.main(arguments);
+}
+""";
+    return snapshotGenerationText;
+  });
+}
+
+void writeSnapshotFile(var path, var content) {
+    File file = new File(path);
+    var writer = file.openSync(mode: FileMode.WRITE);
+    writer.writeStringSync(content);
+    writer.close();
+}
+
+/**
+ * Takes the following arguments:
+ * --output_dir=val     The full path to the output_dir.
+ * --dart2js_main=val   The path to the dart2js main script relative to root.
+ */
+void main(List<String> arguments) {
+  var validArguments = ["--output_dir", "--dart2js_main"];
+  var args = {};
+  for (var argument in arguments) {
+    var argumentSplit = argument.split("=");
+    if (argumentSplit.length != 2) throw "Invalid argument $argument, no =";
+    if (!validArguments.contains(argumentSplit[0])) {
+      throw "Invalid argument $argument";
+    }
+    args[argumentSplit[0].substring(2)] = argumentSplit[1];
+  }
+  if (!args.containsKey("dart2js_main")) throw "Please specify dart2js_main";
+  if (!args.containsKey("output_dir")) throw "Please specify output_dir";
+
+  var scriptFile = Uri.base.resolveUri(Platform.script);
+  var path = scriptFile.resolve(".");
+  var rootPath = path.resolve("../..");
+  getSnapshotGenerationFile(args, rootPath).then((result) {
+    var wrapper = "${args['output_dir']}/utils_wrapper.dart";
+    writeSnapshotFile(wrapper, result);
+  });
+
+  getDart2jsSnapshotGenerationFile(args, rootPath).then((result) {
+    var wrapper = "${args['output_dir']}/dart2js.dart";
+    writeSnapshotFile(wrapper, result);
+  });
+}
diff --git a/utils/create_timestamp.gni b/utils/create_timestamp.gni
new file mode 100644
index 0000000..c579da1
--- /dev/null
+++ b/utils/create_timestamp.gni
@@ -0,0 +1,36 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for 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_root = rebase_path("..")
+
+template("create_timestamp_file") {
+  assert(defined(invoker.path), "Must specify 'path'")
+  assert(defined(invoker.output), "Must specify 'output'")
+  new_base = "."
+  if (defined(invoker.new_base)) {
+    new_base = invoker.new_base
+  }
+  current_base = "."
+  if (defined(invoker.current_base)) {
+    current_base = invoker.current_base
+  }
+  path = invoker.path
+  output = invoker.output
+  action(target_name) {
+    list_args = [ path ]
+    if (defined(invoker.pattern)) {
+      list_args += [ invoker.pattern ]
+    }
+    files = exec_script("$_dart_root/tools/list_dart_files.py",
+                        list_args,
+                        "list lines")
+    inputs = [ "$_dart_root/tools/list_dart_files.py" ] +
+             rebase_path(files, new_base, current_base)
+    outputs = [
+      output,
+    ]
+    script = "$_dart_root/tools/create_timestamp_file.py"
+    args = [ rebase_path(output) ]
+  }
+}
diff --git a/utils/dartanalyzer/BUILD.gn b/utils/dartanalyzer/BUILD.gn
new file mode 100644
index 0000000..dbefeec
--- /dev/null
+++ b/utils/dartanalyzer/BUILD.gn
@@ -0,0 +1,71 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for 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("//build/compiled_action.gni")
+import("../application_snapshot.gni")
+
+group("dartanalyzer") {
+  deps = [
+    ":generate_dartanalyzer_snapshot",
+    ":generate_summary_spec",
+    ":generate_summary_strong",
+  ]
+}
+
+analyzer_files = exec_script("../../tools/list_dart_files.py",
+                             [ rebase_path("../../pkg/analyzer") ],
+                             "list lines")
+
+application_snapshot("generate_dartanalyzer_snapshot") {
+  main_dart = "../../pkg/analyzer_cli/bin/analyzer.dart"
+  training_args = [
+    "--dart-sdk=" + rebase_path("../../sdk"),
+    rebase_path("../../tests/language/first_test.dart"),
+  ]
+  name = "dartanalyzer"
+  cli_files = exec_script("../../tools/list_dart_files.py",
+                          [ rebase_path("../../pkg/analyzer_cli") ],
+                          "list lines")
+  inputs = cli_files + analyzer_files
+}
+
+sdk_lib_files = exec_script("../../tools/list_dart_files.py",
+                            [ rebase_path("../../sdk/lib") ],
+                            "list lines")
+
+template("generate_summary") {
+  assert(defined(invoker.type), "Must specify the summary type")
+  type = invoker.type
+  assert(type == "spec" || type == "strong")
+  compiled_action(target_name) {
+    tool = "../../runtime/bin:dart"
+    inputs = sdk_lib_files + analyzer_files
+
+    output = "$root_gen_dir/$type.sum"
+    outputs = [
+      output,
+    ]
+
+    dot_packages = rebase_path("../../.packages")
+    build_sdk_summaries =
+        rebase_path("../../pkg/analyzer/tool/summary/build_sdk_summaries.dart")
+    abs_output = rebase_path(output)
+
+    args = [
+      "--packages=$dot_packages",
+      build_sdk_summaries,
+      "build-$type",
+      abs_output,
+      rebase_path("../../sdk"),
+    ]
+  }
+}
+
+generate_summary("generate_summary_spec") {
+  type = "spec"
+}
+
+generate_summary("generate_summary_strong") {
+  type = "strong"
+}
diff --git a/utils/dartdevc/BUILD.gn b/utils/dartdevc/BUILD.gn
new file mode 100644
index 0000000..0c93423
--- /dev/null
+++ b/utils/dartdevc/BUILD.gn
@@ -0,0 +1,19 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for 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("../application_snapshot.gni")
+
+application_snapshot("dartdevc") {
+  main_dart = "../../pkg/dev_compiler/bin/dartdevc.dart"
+  training_args = [
+    "--dart-sdk",
+    rebase_path("../../sdk"),
+    "--dart-sdk-summary",
+    rebase_path("../../pkg/dev_compiler/lib/sdk/ddc_sdk.sum"),
+    "--help",
+  ]
+  inputs = exec_script("../../tools/list_dart_files.py",
+                       [ rebase_path("../../pkg/dev_compiler/bin") ],
+                       "list lines")
+}
diff --git a/utils/dartdoc/BUILD.gn b/utils/dartdoc/BUILD.gn
new file mode 100644
index 0000000..6abdc9a
--- /dev/null
+++ b/utils/dartdoc/BUILD.gn
@@ -0,0 +1,13 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for 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("../application_snapshot.gni")
+
+application_snapshot("dartdoc") {
+  main_dart = "../../third_party/pkg/dartdoc/bin/dartdoc.dart"
+  training_args = [ "--help" ]
+  inputs = exec_script("../../tools/list_dart_files.py",
+                       [ rebase_path("../../third_party/pkg/dartdoc") ],
+                       "list lines")
+}
diff --git a/utils/dartfmt/BUILD.gn b/utils/dartfmt/BUILD.gn
new file mode 100644
index 0000000..41c5bc4
--- /dev/null
+++ b/utils/dartfmt/BUILD.gn
@@ -0,0 +1,14 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for 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("../application_snapshot.gni")
+
+application_snapshot("dartfmt") {
+  main_dart = "../../third_party/pkg_tested/dart_style/bin/format.dart"
+  training_args = [ "--help" ]
+  inputs =
+      exec_script("../../tools/list_dart_files.py",
+                  [ rebase_path("../../third_party/pkg_tested/dart_style") ],
+                  "list lines")
+}
diff --git a/utils/pub/BUILD.gn b/utils/pub/BUILD.gn
new file mode 100644
index 0000000..82669cb
--- /dev/null
+++ b/utils/pub/BUILD.gn
@@ -0,0 +1,16 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for 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("../application_snapshot.gni")
+
+application_snapshot("pub") {
+  main_dart = "../../third_party/pkg/pub/bin/pub.dart"
+  training_args = [ "--help" ]
+  deps = [
+    "../compiler:dart2js_files_stamp",
+  ]
+  inputs = [
+    "$root_gen_dir/dart2js_files.stamp",
+  ]
+}